SlimDroid is a user-customized Android app debloating tool that bridges high-level natural language requirements and low-level Android program debloating. It integrates Large Language Models (LLMs) with static program analysis to automatically generate and complete ADQL queries and produce dependency-safe debloated applications.
📄 Paper: SlimDroid.pdf
🎥 Demo Video: https://youtu.be/dNxNcHIiSC0
The overall workflow is as follows:
-
User Requirement Input
The user specifies the target app and debloating requirements in natural language (e.g., removing ads, disabling tracking, or keeping only a subset of features) through the SlimDroid UI. -
LLM-based Requirement Translation
The LLM interprets the user prompt and translates it into a structured debloating specification in the form of an ADQL (Android Debloating Query Language) query. -
Query Completion and Dependency Analysis
The direct ADQL query is refined by analyzing program dependencies (e.g., constructing call graph, program dependency graphs) to ensure semantic and structural consistency. -
Code Transformation and Repackaging
Referring to the completed query, the related code elements are safely removed, and the debloated application is rebuilt into a new APK while preserving functional correctness.
This pipeline enables an end-to-end transformation from high-level user requirement to dependency-safe, executable debloated Android applications.
- Node.js ≥ 18
- Python ≥ 3.9 (Anaconda is supported)
- Java ≥ 8 (for Android analysis tools)
git clone https://github.com/SQUARE-RG/SlimDroid.git
cd SlimDroidconda create -n slimdroid python=3.9
conda activate slimdroid
conda install -c conda-forge openjdk=17 nodejs=20
pip install androguard==3.4.0 openaicd slimdroid-ui
npm installnpm start- Click
Select APK Fileto choose an Android application. - Enter natural language debloating requirements, e.g.:
Remove all advertisement-related functionalities.
- Click
LLM Settingsto configure basic information used to invoke the LLM. - Click
Confirmto start the pipeline:- Debloating Scenerio inference
- App schema extraction
- LLM-powered ADQL query generation
- ADQL query completion and dependency-aware app debloating
- Observe:
- Reasoning trace in LLM Log Output
- Generated ADQL query in DSL Output
