A Systematic Assessment on Android Third-Party Library Detection Tools

Xian Zhan, Tianming Liu, Yepang Liu, Yang Liu, Li Li, Haoyu Wang, Xiapu Luo

This paper presents a comprehensive empirical study and systematic assessment of tools designed to detect third-party libraries (TPLs) in Android applications. By evaluating 12 state-of-the-art tools against new, challenging benchmarks, the authors reveal significant performance gaps—particularly in handling code obfuscation and version identification—and provide a roadmap for building more robust detection frameworks.

TL;DR

The authors conduct the first large-scale, systematic evaluation of Android third-party library (TPL) detection tools, revealing that while most achieve high precision, their recall is surprisingly low (often <50%). They introduce a new benchmark for "messy" real-world scenarios and demonstrate that moving away from package-name-based detection toward class-dependency features is essential for resilience against modern obfuscation.

What Problem Does This Paper Address?

Third-party libraries (TPLs) are the building blocks of modern Android apps, often accounting for over 60% of an app's code. While they speed up development, they also introduce "noise" for security researchers and can harbor vulnerabilities or malicious code.

Detecting these libraries is a foundational task for malware analysis and vulnerability patching. However, existing detection tools vary wildly in their techniques and effectiveness. There has been no unified, unbiased way to compare them, especially when faced with "real-world" challenges like code obfuscation (renaming or flattening packages), partial library imports, and complex library-on-library dependencies.

Methods

The authors first define a standard four-step process for TPL detection:

  1. Preprocessing: Decompiling APKs into intermediate representations.
  2. Library Instance Construction: Decoupling the TPL code from the host app's code.
  3. Feature Extraction: Generating unique "fingerprints" (e.g., control flow graphs, API calls, or method signatures).
  4. Library Identification: Matching fingerprints against a known database.
The typical four-step process used by TPL detection tools.

They evaluated five publicly available tools (LibID, LibRadar, LibScout, LibPecker, and ORLIS) across six criteria: construction accuracy, effectiveness (precision/recall), efficiency, version identification, obfuscation resilience, and ease of use. To push these tools to their limits, the authors also enhanced several open-source tools to handle modern Android features like the .aar format and multi-dex files.

Datasets

The study introduces four new evaluation datasets designed to reflect the complexities of the Android ecosystem:

  • Module Decoupling Dataset: Specifically targets apps with TPL dependencies, shared root packages, and package flattening.
  • Effectiveness/Efficiency Dataset: 221 Google Play apps mapped to 59 unique TPLs with over 2,000 version files.
  • Version Identification Dataset: Two groups of TPLs—one with obvious code changes between versions and one with very subtle differences.
  • Obfuscation Dataset: Apps processed with three major obfuscators (Proguard, Allatori, and DashO) using techniques like control flow randomization and dead code removal.

Key Insights and Ideas

  • The "Package Structure" Trap: Most existing tools rely on package names or hierarchies to identify library boundaries. The authors prove this is a "fragile and unreliable" feature because obfuscators can easily flatten or rename packages.
  • Class Dependency is King: Tools that use class-level dependencies for module decoupling (like ORLIS) are far more resilient to package flattening and mutation than those relying on directory structures.
  • Semantic vs. Syntactic Features: Features that capture rich semantic information (like class dependencies or control flow) achieve much better resiliency against code obfuscation than simple syntactic features (like API lists).
  • The Multi-dex Blind Spot: Many older tools only analyze the primary classes.dex file, missing a huge portion of TPL code in modern, large applications that use multiple DEX files.
  • Version Identification is Still Hard: Identifying the exact version of a library remains a major challenge. Tools often report many false positives because adjacent versions of a library frequently share nearly identical code.
A motivating example showing the "messy" composition of a real-world APK, including obfuscated parts and TPL dependencies.

Key Results

  • Effectiveness: LibScout achieved the highest overall F1-score (65.2%), while LibRadar boasted the highest precision (97.9%). However, all tools suffered from low recall, meaning they missed more than half of the TPLs present in the test apps.
  • Efficiency: LibRadar is the clear winner for large-scale analysis, taking only ~5.5 seconds per app. In contrast, LibID can take hours or even a full day for a single app due to its complex matching algorithms.
  • Obfuscation Resilience: Advanced obfuscation (like that from DashO) caused performance to plummet. For instance, LibRadar's performance dropped by over 86% when faced with DashO-obfuscated apps. ORLIS proved to be the most resilient tool overall.
  • User Experience: A user study with 20 developers found that LibRadar was the most "easy-to-use" due to its simple setup and clear output, while ORLIS was criticized for confusing result representations.
A comparison of the features and techniques used by 12 state-of-the-art TPL detection tools.

Limitations and Future Work

The authors acknowledge several areas for future research:

  • Language Diversity: Over 15% of in-app TPLs are now developed in Kotlin, which has different grammar rules that can break current Java-centric detection tools.
  • Dynamic Techniques: Current tools rely almost exclusively on static analysis. They struggle with TPLs that are dynamically loaded at runtime or hidden via reflection.
  • Vulnerability Mapping: While tools can identify libraries, mapping them to specific entries in vulnerability databases (like NVD) is still difficult due to missing version-specific metadata.

Summary updated

BibTeX
@article{zhan2022systematic,
  author = {Xian Zhan and Tianming Liu and Yepang Liu and Yang Liu and Li Li and Haoyu Wang and Xiapu Luo},
  title = {{A Systematic Assessment on Android Third-Party Library Detection Tools}},
  journal = {IEEE Trans. Software Eng.},
  year = {2022},
  doi = {10.1109/tse.2021.3115506},
}
Figure