Skip to content

SQUARE-RG/SlimDroid

Repository files navigation

SlimDroid: An LLM-Powered User-Customized Debloating Tool for Android Applications

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


Overview of SlimDroid

SlimDroid Overview

The overall workflow is as follows:

  1. 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.

  2. 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.

  3. 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.

  4. 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.


Environment Setup

1. Prerequisites

  • Node.js ≥ 18
  • Python ≥ 3.9 (Anaconda is supported)
  • Java ≥ 8 (for Android analysis tools)

2. Clone Repository

git clone https://github.com/SQUARE-RG/SlimDroid.git
cd SlimDroid

3. Python, Java, and Node.js Environments

conda create -n slimdroid python=3.9
conda activate slimdroid
conda install -c conda-forge openjdk=17 nodejs=20
pip install androguard==3.4.0 openai

4. UI Environment

cd slimdroid-ui
npm install

5. Launch SlimDroid UI

npm start

How to debloate app through SlimDroid UI

  1. Click Select APK File to choose an Android application.
  2. Enter natural language debloating requirements, e.g.:
Remove all advertisement-related functionalities.
  1. Click LLM Settings to configure basic information used to invoke the LLM.
  2. Click Confirm to start the pipeline:
    • Debloating Scenerio inference
    • App schema extraction
    • LLM-powered ADQL query generation
    • ADQL query completion and dependency-aware app debloating
  3. Observe:
    • Reasoning trace in LLM Log Output
    • Generated ADQL query in DSL Output

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors