LibFan detects Android third-party libraries with 81.3% F1 despite heavy obfuscation
LibFan achieves 81.3% library-level F1 and outperforms prior methods under aggressive code transformations
Software arXiv 25 Sep 2026 Method Prototype evidence
Published as “Context-Aware Functional Modeling for Android Third-Party Library Detection”
Why it matters
LibFan can surface vulnerable third-party libraries in real-world Android apps, aiding security analysts in dependency risk assessment.
Summary
LibFan achieves 81.3% library-level and 47.6% version-level F1 on the most challenging R8 full mode, beating the best baseline by 32.0 and 12.5 percentage points; the evidence comes from a benchmark of 200 apps and 46 vulnerable libraries, though version-level accuracy remains modest and runtime is slower than the fastest prior tool.
What they found 2
- LibFan outperforms baselines on the hardest R8 variant
“Under the most challenging Opt+Obf+Srk setting, LibFan achieves 81.3% librarylevel and 47.6% version-level F1 scores, outperforming the best baseline by 32.0 and 12.5 percentage points, respectively.”
- Functional partitioning is crucial for handling partial library reuse
“disabling functional partitioning leads to clear performance drops across all R8 variants, demonstrating its importance for handling partial TPL reuse.”
Caveats 4
- Version-level F1 under the hardest variant is only 47.6%, showing limited fine-grained version discrimination.
- LibFan’s inference time (0.644 s per app-TPL pair on Opt+Obf+Srk) is slower than the fastest baseline LibScan (0.172 s per pair).
- version-level detection remains more challenging than library-level detection, particularly under strong code transformations, indicating that fine-grained version discrimination is still an open problem.
- Our empirical analysis reveals that, after aggressive shrinking and optimization in release builds, only 34.6% of a TPL’s classes and 16.7% of its methods remain in the final app on average.
What’s new here 4
- Uses a dual-encoder contrastive learning model that incorporates call-graph and class context to create transformation-resilient method embeddings.
- Introduces functional partition-based library scoring that evaluates retained functional chunks instead of the whole library, mitigating missed detections from shrinking and optimization.
- Provides a new benchmark (LibFanBench) with complete transitive dependency ground truth and four R8 transformation configurations.
- Applies pretrained code language models (e.g., UniXcoder) fine-tuned on transformed method pairs for Android TPL detection.