TPL-Benchmark / README.md
gujintao's picture
Update README.md
b390407 verified
|
Raw
History Blame Contribute Delete
10.1 kB
# TPL-Benchmark
TPL-Benchmark is a benchmark dataset for evaluating Android third-party library detection tools. This repository provides Android applications collected from multiple sources, together with their APK files, source code, locally imported library files, and manually/automatically generated third-party library labels at the GAV level.
In addition to the benchmark data, this repository also releases the intermediate and final outputs of 10 representative third-party library detection tools, as well as the code used by our TPL extraction pipeline.
## Repository Structure
```text
TPL-Benchmark/
├── all_fdroid.zip
├── all_readme_src_apk.zip
├── unzip_all_releases_apk_src.zip
├── src_with_apk.zip
├── different_tools_result/
├── unique_tpls_with_version.txt
├── unique_tpls_without_version.txt
├── TPL-Extractor/
├── channel_fdroid/
│ ├── no_files.txt
│ ├── only_gradle.txt
│ ├── only_kts.txt
│ └── both_files.txt
```
## Benchmark Data Archives
### 1. `all_fdroid.zip`
This archive contains Android applications collected from F-Droid.
For each application, the archive includes:
* the APK file;
* the corresponding source code;
* locally imported library files, if any;
* label files describing which third-party libraries are included in the APK.
The label files are in `.txt` format. Their filenames usually contain the word `label`, such as `label.txt`.
Compared with the other sources, the F-Droid archive contains one additional directory level for application categories.
A typical directory structure is:
```text
all_fdroid/
└── <category>/
└── <application>/
├── <apk file>
├── <source code folder>
├── <local library folder>
└── label.txt
```
### 2. `all_readme_src_apk.zip`
This archive contains Android applications collected from the README with APKs source.
For each application, the archive includes:
* the APK file;
* the corresponding source code;
* locally imported library files, if any;
* label files describing which third-party libraries are included in the APK.
The label files are in `.txt` format. Their filenames usually contain the word `label`, such as `label.txt`.
The directory structure of `all_readme_src_apk.zip` is consistent with that of `unzip_all_releases_apk_src.zip`.
A typical directory structure is:
```text
all_readme_src_apk/
└── <application or repository>/
├── <apk file>
├── <source code folder>
├── <local library folder>
└── label.txt
```
### 3. `unzip_all_releases_apk_src.zip`
This archive contains Android applications collected from GitHub Releases with APKs.
For each application, the archive includes:
* the APK file;
* the corresponding source code;
* locally imported library files, if any;
* label files describing which third-party libraries are included in the APK.
The label files are in `.txt` format. Their filenames usually contain the word `label`.
For GitHub Releases with APKs, one project may contain multiple APK files. Therefore, one project may also contain multiple label files. These label files are distinguished according to the corresponding APK name. For example:
```text
abc.apk
abc_label.txt
```
A typical directory structure is:
```text
unzip_all_releases_apk_src/
└── <application or repository>/
├── <apk file 1>
├── <apk file 2>
├── <source code folder>
├── <local library folder>
├── <apk name 1>_label.txt
└── <apk name 2>_label.txt
```
### 4. `src_with_apk.zip`
This archive contains Android applications collected from GitHub Source with APKs.
For this source, the source code folder contains a folder named `label`. The `label` folder stores:
* the APK file;
* locally imported library files, if any;
* label files describing which third-party libraries are included in the APK.
For GitHub Source with APKs, one project may contain multiple APK files. Therefore, one project may also contain multiple label files. These label files are distinguished according to the corresponding APK name, such as `abc_label.txt`.
A typical directory structure is:
```text
src_with_apk/
└── <application or repository>/
├── <source code files>
└── label/
├── <apk file 1>
├── <apk file 2>
├── <local library folder>
├── <apk name 1>_label.txt
└── <apk name 2>_label.txt
```
## Label File Format
Each application has one or more label files describing the third-party libraries included in the corresponding APK.
The label files are in `.txt` format. Their filenames usually contain the word `label`, such as:
```text
label.txt
abc_label.txt
```
Each label entry records a third-party library coordinate at the GAV level, namely:
```text
Group ID : Artifact ID : Version
```
The label entries may appear in one of the following two formats.
Format 1:
```text
"com.faendir:acra:4.10.0"
```
Format 2:
```text
Group ID: joda-time, Artifact ID: joda-time, Version: 2.11.1
```
Both formats describe the same type of information: the group ID, artifact ID, and version of a third-party library.
## Tool Results
The directory `different_tools_result/` stores the intermediate and final results of 10 Android third-party library detection tools used in our evaluation.
The 10 tools are:
* [Libradar](https://github.com/pkumza/LibRadar)
* [LibD](https://github.com/IIE-LibD/libd)
* [Orlis](https://github.com/presto-osu/orlis-orcis)
* [LibScout](https://github.com/reddr/LibScout)
* [LibPecker](https://github.com/yuanxzhang/LibPecker)
* [LibID-S](https://github.com/ucam-cl-dtg/LibID)
* [LibID-A](https://github.com/ucam-cl-dtg/LibID)
* [LibLOOM](https://github.com/iser-mobile/LIBLOOM)
* [LibScan](https://github.com/wyf295/LibScan)
* [LibHunter](https://github.com/CGCL-codes/LibHunter)
Depending on the design of each tool, this directory may contain:
* intermediate library feature files;
* intermediate application feature files;
* processed reference library data;
* processed APK feature data;
* final detection results;
* other tool-specific intermediate outputs.
These files are released to support reproducibility and to help future researchers compare their tools with existing third-party library detection methods under the same benchmark setting.
## Library Coordinate Files
### `unique_tpls_with_version.txt`
This file records all third-party library coordinates in TPL-Benchmark at the GAV level.
Each entry contains:
```text
Group ID : Artifact ID : Version
```
Example:
```text
com.faendir:acra:4.10.0
```
### `unique_tpls_without_version.txt`
This file records all third-party library coordinates in TPL-Benchmark at the GA level.
Each entry contains:
```text
Group ID : Artifact ID
```
This file removes the version information and can be used for GA-level analysis or evaluation.
## TPL Extraction Pipeline
The directory `TPL-Extractor/` contains the code of our pipeline for extracting GAV-level third-party library coordinates from Android source code.
The pipeline is used to identify third-party library dependencies from Android projects and generate the corresponding GAV-level labels for benchmark construction.
## F-Droid Channel Files
The directory `channel_fdroid/` contains four files that categorize F-Droid source projects according to their build script types.
### `no_files.txt`
This file contains Android application projects that are not built by Gradle.
These projects may be hybrid or non-standard Android projects built with frameworks or languages such as:
* Flutter
* Cordova
* React Native
* Rust
* other customized build systems
### `only_gradle.txt`
This file contains projects that only use Groovy-based Gradle build scripts.
The corresponding build script file is:
```text
build.gradle
```
### `only_kts.txt`
This file contains projects that only use Kotlin-based Gradle build scripts.
The corresponding build script file is:
```text
build.gradle.kts
```
### `both_files.txt`
This file contains projects that include both Groovy-based and Kotlin-based Gradle build scripts.
That is, these projects contain both:
```text
build.gradle
build.gradle.kts
```
## Reference Library Database
The reference library database used for detailed similarity-based methods is released in a separate HuggingFace repository:
```text
https://huggingface.co/datasets/gujintao/old_all_jar
```
This repository contains the downloaded AAR/JAR artifacts used as the reference library database.
## Notes on Multiple APKs
For the following two data sources, one project may contain multiple APK files:
* GitHub Releases with APKs;
* GitHub Source with APKs.
In such cases, the project may contain multiple label files. Each label file corresponds to a specific APK and is distinguished by the APK name.
For example:
```text
abc.apk
abc_label.txt
```
This means that `abc_label.txt` records the third-party libraries contained in `abc.apk`.
## Purpose of the Release
This repository is released to support the reproducibility of TPL-Benchmark.
Specifically, it provides:
* benchmark APKs;
* corresponding source code;
* locally imported libraries;
* GAV-level and GA-level third-party library labels;
* source-channel information;
* the TPL extraction pipeline;
* intermediate and final outputs of 10 evaluated third-party library detection tools;
* the reference library database used by detailed comparison-based methods.
We hope this release can help future research on Android third-party library detection, dependency analysis, and software supply-chain security.