Context-Aware Functional Modeling for Android Third-Party Library Detection

📅 2026-09-25
📈 Citations: 0
✨ Influential: 0
📄 PDF
🤖 AI Summary
This study addresses the vulnerability of existing Android third-party library detection methods to code obfuscation and their difficulty in handling partial library reuse. To overcome these limitations, this work proposes LibFan, a method that achieves robust detection through context-aware functionality modeling. The core approach integrates method-level contextual contrastive learning with library-level functional partitioning, effectively accommodating complex code transformations and partial reuse scenarios. Experimental results demonstrate that under full-mode R8 obfuscation, LibFan attains a library-level F1 score of 81.3% and a version-level F1 score of 47.6%, representing a significant improvement over state-of-the-art methods.
📝 Abstract
Third-party libraries (TPLs) are widely used in Android apps, but their reuse can introduce security risks and interfere with downstream program analyses. Existing Android TPL detection approaches face two key limitations: their hand-crafted features are fragile under aggressive code transformations, and their whole-library matching strategies are ineffective when apps retain only part of a TPL. In this paper, we propose LibFan, a learning-based Android TPL detection approach based on context-aware functional modeling. It realizes this modeling through two complementary components: context-aware contrastive learning at the method level and functional partitioning at the library level. At the method level, it learns semantic representations through contrastive training while incorporating outgoing call relationships and class-level context, improving robustness to obfuscation, shrinking, and optimization. At the library level, it partitions each TPL into functionally coherent units and determines library presence using the best-matching partition, thereby accommodating partial library reuse. To evaluate LibFan, we construct a new benchmark comprising 200 apps and 46 vulnerable TPLs, with each app compiled under four transformation configurations. Under the most challenging R8 full mode, LibFan achieves F1 scores of 81.3% at the library level and 47.6% at the version level, representing relative improvements of 64.9% and 35.6% over the state of the art, respectively.
Problem

Research questions and friction points this paper is trying to address.

Android third-party library detection
code obfuscation
partial library reuse
feature robustness
Innovation

Methods, ideas, or system contributions that make the work stand out.

Context-Aware Contrastive Learning
Functional Partitioning
Third-Party Library Detection
Code Obfuscation Robustness
Partial Library Reuse
🔎 Similar Papers