A Systematical Study on Application Performance Management Libraries for Apps

Yutian Tang, Haoyu Wang, Xian Zhan, Xiapu Luo, Yajin Zhou, Hao Zhou, Qiben Yan, Yulei Sui, Jacky Keung

Introduction

Modern Android application development relies heavily on Application Performance Management (APM) libraries, such as Google Firebase, Flurry, and UMeng, to monitor crashes, network latency, and user behavior in real-world environments. Despite their ubiquity, these libraries are often treated as "black boxes" by developers. This study presents the first systematic analysis of the APM ecosystem, investigating 25 popular libraries and scanning 500,000 apps using a custom tool called APMHunter. The research reveals significant design defects, compatibility lags with newer Android versions, and alarming privacy risks, with 42% of apps using APMs found to be leaking sensitive user data.

Problem Statement

The researchers identify a critical knowledge gap regarding the internal mechanics and side effects of commercial APM libraries. Specifically, the study addresses three challenges:

  1. Transparency: Demystifying how closed-source libraries implement features like crash reporting and network interception.
  2. Detection at Scale: Identifying APM usage in millions of apps, even when code is obfuscated.
  3. Security & Privacy: Assessing whether these libraries request unnecessary permissions or leak sensitive information to third-party servers.

Methodology and Datasets

The researchers employed a multi-stage approach to analyze the APM landscape:

  • Reverse Engineering: Manual scrutiny of 25 widely-used APMs (20 commercial, 5 open-source) revealed implementation details, such as the use of Aspect-Oriented Programming (AOP) for network monitoring and signal handling for native crashes.
  • APMHunter Framework: A novel, obfuscation-resilient tool was developed to detect APM usage. Instead of relying on package names, it uses semantic signatures based on class inheritance and caller-callee relationships.
  • Static & Dynamic Analysis: Using FlowDroid and IC3, the team built Inter-procedural Control-Flow Graphs (ICFG) to track sensitive data flows. Dynamic validation was performed using CharlesProxy to intercept network traffic and confirm privacy leaks.
Figure 1: Comparison of general, manual, and automatic APM instrumentation processes.

The study utilized a dataset of 25 Android-oriented APMs and a large-scale set of 500,000 apps crawled from Google Play across 25 categories. A manually verified benchmark of 500 apps was used to evaluate APMHunter's accuracy.

Key Insights

The "Last One Wins" Crash Rule

A significant design flaw was discovered in Java crash handling. Android allows only one default UncaughtExceptionHandler. Consequently, if an app integrates multiple APMs, only the last one initialized will successfully capture and report Java crashes, rendering the others ineffective for that specific metric.

Compatibility Lag

APMs frequently fail to keep pace with Android OS updates. For instance, many libraries continue to attempt access to /proc/stat for CPU data—a method blocked since Android 8.0—resulting in functional failures on newer devices.

Figure 6: Timeline showing the lag between Android OS releases and compatible APM library updates.

The Privacy Paradox

While intended for performance monitoring, APMs are often misused to collect extensive "User Profiles." The study found that 42% of apps using APMs leaked sensitive data, including hardware IDs (getDeviceId()) and precise GPS coordinates, potentially violating regulations like GDPR.

Results

  • Prevalence: 11.1% (55,722) of the 500,000 apps studied integrated at least one APM library.
  • Detection Accuracy: APMHunter achieved 97.7% precision and 87.5% recall, even against obfuscated code.
  • Privacy Violations: The study identified 23,397 apps leaking sensitive data. The most common leaks involved device IDs (13,943 instances) and location data (over 16,000 instances).
  • Performance Overhead: APMs increased CPU overhead by 1.0x to 1.2x, with a negligible impact on memory usage (1.0x to 1.06x).

Conclusion and Future Work

While APMs provide essential monitoring capabilities, their integration introduces non-trivial risks. The authors suggest that APM vendors should adopt "privacy-friendly" APIs (e.g., returning coarse location data instead of raw GPS) and that app stores should implement automated vetting processes using tools like APMHunter to protect user privacy. Future work will focus on improving detection for apps using non-standard UI frameworks and tracking indirect data leaks through local storage.

Summary updated

BibTeX
@article{tang2022systematical,
  author = {Yutian Tang and Haoyu Wang and Xian Zhan and Xiapu Luo and Yajin Zhou and Hao Zhou and Qiben Yan and Yulei Sui and Jacky Keung},
  title = {{A Systematical Study on Application Performance Management Libraries for Apps}},
  journal = {IEEE Trans. Software eng},
  year = {2022},
  doi = {10.1109/tse.2021.3077654},
}
Figure