CS Paper Radar

Hardware-Aware Conditional Code in Android Apps

Marco Alecci, Jordan Samhi, Li Li, Tegawendé F. Bissyandé, Jacques Klein

cs.SE ·submitted 2026-10-30 19:20 UTC · v1

Abstract

Android OS runs on a highly diverse set of devices, spanning entry-level phones and flagships with substantially different hardware characteristics, including memory capacity, processors, displays, cameras, and sensors. Through APIs, apps can query device information at runtime, such as memory, hardware features, and manufacturer, among other device properties, allowing developers to execute different code paths on different devices. Existing studies cover only specific compatibility bugs or brand-specific behavior; however, the broader use of hardware information in app logic has not been comprehensively explored. We address this question with a large-scale empirical study of hardware-related if statements in Android apps. We statically analyze 50,000 apps to identify the if statements whose conditions depend on the values of hardware-related APIs, and extract their conditions together with the code of their branches. Our results show that 95% of successfully analyzed apps contain at least one such statement, with an average of 74 per app, which suggests that hardware-related logic is widespread. We then apply an LLM-assisted open-coding process to the extracted code to build a structured taxonomy of the purposes behind hardware-related conditional code. The resulting characterization shows that developers use hardware information for feature availability checks, UI adaptation, emulator detection, device tiering, and resource management, among others.

Comment
21 pages

Closest papers

Nearest neighbours by meaning across the whole index.

HapCiD: Detecting API-related Compatibility Issues in OpenHarmony Apps

cs.SE ·2026-09-17 ·Daihang Chen, Yonghui Liu, Mingyi Zhou, Li Li
publishedcode/data similarity 0.67
Abstract · Accepted by Internetware2026

OpenHarmony, an emerging open-source mobile platform, is rapidly gaining attention in the mobile development community. Its fast-evolving Software Development Kit (SDK) introduces numerous Application Programming Interfaces (APIs) to boost developer productivity but inevitably introduces compatibility challenges, an issue well known from platforms like Android. However, existing compatibility analysis tools are ineffective for OpenHarmony due to its newly introduced ArkTS programming language and the lack of a mature behavioral model to capture app execution semantics. To bridge this gap, we present HapCiD, an open-source tool for automatically detecting API-related compatibility issues in OpenHarmony apps. Applied to 4,478 apps, HapCiD successfully detects 2,040 compatibility issues across 163 apps with 100 percent accuracy. Based on these findings, we conduct a comprehensive study of compatibility issues, categorizing their types, examining existing mitigation strategies, and proposing future improvements.

0.35

Beyond Sensitive APIs: Detecting Access Control Flaws at Sensitive Callsites in Android Firmware

cs.CR ·2026-10-31 ·Haotian Deng, Meng Hao, Hanxiao Chen, Xinyuan Qian, Guowen Xu +2 more
top venue similarity 0.66
Abstract · Accepted to NDSS 2027. 17 pages

Existing studies of vulnerable pre-installed Android apps identify dangerous behavior by checking whether an app invokes an API from a predefined set of security-sensitive APIs. These sets usually exclude generic APIs to avoid false positives; unfortunately, this misses a class of vulnerabilities in which a generic API, such as a database read, appears benign in general but becomes security-sensitive when operating on protected data, yet is left without sufficient access control. While this class of vulnerabilities appears addressable via access control analysis, existing studies focus only on the presence of checks, not on whether those checks enforce sufficient protection for the operation at a given callsite. In this work, we propose Callix, which first assesses callsite sensitivity by jointly analyzing the invoked API functionality and the data involved in the operation, then recovers each security check on the execution path as an explicit security property, and finally introduces the notion of restriction context to decide whether these checks are sufficient for the identified sensitive operation. We evaluated Callix on 1,750 distinct pre-installed apps from the 10 top-tier Android vendors as of 2025. In total, Callix discovered 819 vulnerable paths across these vendors, 42.1% of which allow reading or modifying private user data through generic database operations. Manual validation of a random 60% sample shows a precision of 95.1%. Many of our findings have been confirmed and rewarded through vendor bug bounty programs.

0.41

A Systematic Study of Deprecated Android API Usage Updates

cs.SE ·2026-10-13 ·Tarek Mahmud, Meiru Che, Guowei Yang
publishedbenchmark similarity 0.66
Abstract · Accepted for publication in ICECCS2026

Android Application Programming Interfaces (APIs) continuously evolve, causing existing APIs to become deprecated and requiring developers to migrate their usages to recommended replacements. Although prior studies have proposed automated migration techniques, their effectiveness is often limited by the diversity and contextual complexity of API changes. This paper presents a systematic study of deprecated Android APIs, their recommended replacements, and real-world usage updates performed by developers. Based on an analysis of 1,000 deprecated APIs and 4,336 migration examples collected from GitHub, we identify six migration categories and derive recurring usage-update patterns involving Android-version checks, parameter adaptation, object initialization, data-type conversion, and changes in API interaction mechanisms. To assess their applicability, we augment the zero-shot GUPPY benchmark prompts with the migration category and corresponding usage-update pattern. On 156 benchmark tasks, the pattern-guided prompt improves correct updates from 139 to 147 and performs better in five of the six categories.

0.27

Towards LLM-Enhanced Android Taint Analysis

cs.SE cs.CR ·2026-08-25 ·Nicholas Miazzo, Marco Alecci, Jordan Samhi, Jacques Klein, Eleonora Losiouk
benchmark similarity 0.65
Abstract

Taint analysis is a fundamental technique for detecting sensitive data leaks in Android apps. However, traditional static tools, such as FlowDroid, still face well-known challenges due to the complexity of accurately modeling the Android framework. In this paper, we investigate whether off-the-shelf Large Language Models (LLMs) can effectively reason about taint flows in Android apps. Our preliminary approach relies on an agentic interaction strategy, enabling the LLM to iteratively explore code and reason about data flows. We conduct an initial evaluation on the DroidBench benchmark against FlowDroid, where our approach outperforms the baseline: Gemini-3 Flash achieves an F1-score of 0.96, compared to 0.55 for FlowDroid. In particular, we observe improvements in challenging categories such as inter-component communication (0.95 vs. 0.17), implicit flows (0.94 vs. 0.00), and reflection (1.00 vs. 0.50), where FlowDroid typically struggles. On a small set of real-world apps, the LLM-based approach also identifies additional potential data leaks not reported by FlowDroid. These preliminary findings suggest that LLM reasoning may effectively complement traditional static taint analysis, motivating future research on hybrid LLM-enhanced taint analysis pipelines.

0.13

JANUS: Agentic Cross-Language Fuzzing Harness Generation for Android Native Libraries

cs.SE cs.CR ·2026-10-21 ·Xiangyu Zhang, Yucheng Su, Lingling Fan, Yinan Li, Sen Chen
similarity 0.64
Abstract · Android Native Libraries, Harness Generation, LLM Agent

Modern Android apps extensively rely on native libraries, bridging Java/Kotlin and C/C++ through the Java Native Interface (JNI). This cross-language interoperation, however, exposes the memory-safe Android Runtime to the unsafe C/C++ world, creating an attack surface that has been repeatedly exploited for full device compromise. While fuzzing is a proven technique for vetting native libraries, state-of-the-art harness generation tools struggle to faithfully capture closed-source cross-language API usage: (i) precise program analysis across the JNI boundary does not scale, whereas lightweight approximations miss critical invocation patterns; and (ii) none tackles the construction of complex composite objects consumed by JNI methods. In this paper, we propose JANUS, the first agentic approach to synthesizing cross-language JNI-aware fuzzing harnesses for Android native libraries. JANUS iteratively resolves both explicit and implicit cross-language call dependencies to recover app-specific runtime context, and recursively assembles cross-language argument objects in a bottom-up manner. JANUS leverages an autonomous agentic workflow to reduce reliance on hand-crafted heuristics, capturing the vast landscape of hidden API usage knowledge embedded in closed-source native libraries. Evaluation on 44 popular real-world apps (such as Google and YouTube Music, covering 21,386 JNI methods total) shows that JANUS produces over 5.9 times as many valid harnesses (6,094) as state-of-the-art automatic harnessing tools. On pre-installed apps from five mainstream Android vendors (e.g., Xiaomi, Vivo, Samsung), JANUS further uncovers 6 previously unknown vulnerabilities in closed-source native libraries.

0.12

EngineAgent: Agentizing On-Device LLM Inference Engines with Inference Stack Hierarchy Awareness and Hardware Abilities

cs.OS cs.AIcs.CLcs.SE ·2026-11-10 ·Zhengxiang Huang, Yujie Sun, Shengheng Chen, Zhaode Wang, Chaoyue Niu +4 more
similarity 0.63
Abstract

Rapidly evolving LLM architectures and heterogeneous mobile hardware make supporting new models in on-device inference engines a recurring and costly system challenge. Each model may require coordinated changes across conversion, graph construction, operators, and hardware backends. Existing coding agents often miss these cross-layer dependencies and struggle to diagnose failures across host--device execution paths. We present EngineAgent, an agentic system for automating on-device LLM model enablement. Its key insight is to separate reusable engine and hardware knowledge from model-specific implementation. Before enablement, EngineAgent constructs a hierarchy-aware engine index that captures engine abstraction layers and cross-layer dependencies, and pre-validates backend-specific build, execution, and debugging workflows using already supported models. For each new model, a builder uses this knowledge to coordinate cross-layer changes, while an auditor checks implementation completeness and drives iterative debugging through device-side validation. Across 12 tasks spanning three mobile LLMs and four engine--backend pairs on CPUs, GPUs, and NPUs, EngineAgent achieves 75% end-to-end success with either of two underlying LLMs, versus 33.3% for the strongest coding-agent baseline. Success requires compilation, on-device execution, and output-logit agreement with reference implementations. EngineAgent also reduces average per-task time and model-API cost relative to baselines using the same underlying LLMs.

0.21

Beyond Code Translation: Agentic Android-to-HarmonyOS Migration

cs.SE ·2026-11-08 ·Yinghang Ma, Wuyang Dai, Song Wang, Filipe Cogo, Zhen Ming +1 more
similarity 0.62
Abstract

Migrating Android applications to HarmonyOS is an important yet challenging software engineering task. Existing large language model (LLM)-based migration approaches primarily translate code at the method or file level, overlooking project-wide dependencies and workflow coordination. Moreover, ArkTS, the primary language for HarmonyOS, is relatively low-resource, and migrated applications often lack sufficient tests for reliable verification, making end-to-end migration error-prone. We present A2HTrans, an agentic framework for end-to-end Android-to-HarmonyOS application migration. Rather than performing isolated code translation, A2HTrans decomposes applications into functionality-aware migration tasks, prioritizes them through dependency analysis, and orchestrates translation, validation, and iterative repair within a unified execution workflow. To improve migration reliability, A2HTrans employs a tool-augmented verification strategy that combines compiler-based syntax checking with LLM-based semantic validation and automated repair. We evaluate A2HTrans on 14 Android applications spanning diverse sizes and domains using Claude-Sonnet-4.6 as the underlying migration model. Compared with Claude Code, A2HTrans preserves 8.3% more functional completeness, improves behavioral correctness by 8.0%, and reduces migration time by 28.8%. These results demonstrate that structured agentic execution substantially improves the reliability and efficiency of project-level cross-platform software migration.

0.08

Toward Understanding Operating System Defects

cs.SE ·2026-08-21 ·Hongyao Zuo, Jiali Li, Jiajun Jiang
similarity 0.61
Abstract

Operating systems (OS) serve as the foundation for all other software systems, and thus defects in OSes can lead to severe conquences, such as system crashes and data corruption, affecting billions of users. This broad impact underscores the necessity and importance of ensuring OS quality. Understanding the characteristics of OS defects is a fundamental step in this quality assurance task, as it facilitates the design of effective defect detection and debugging approaches. In this work, we conduct a large-scale study of 1,500 defects from three distinct and representative operating systems (Android, Linux, and HarmonyOS) spanning both mobile and desktop environments. To the best of our knowledge, this is the largest study of its kind in this domain. By analyzing the distribution of OS defects across multiple classification dimensions, including the OS layer where defects occur, the functions they affect, how they are triggered, their severity, and the code elements involved in their repair, as well as performing joint analysis between dimensions and cross-OS similarity comparisons, we summarize several major findings that contribute to a comprehensive understanding of OS defects across systems. Based on these findings, we provide a series of actionable implications for better OS defect detection and debugging, offering guidelines for future research aimed at improving OS quality assurance.

0.22