| Phase | Dir | What it does | Runtime |
|---|---|---|---|
| 1a | static-analysis/ |
Static analysis of the framework dex: enumerate services via the ServiceManager registry + reachability, and recover the permission guarding each API/broadcast | Java 21 + Gradle + WALA |
| 1b | static_result_process/ |
Tidy the static-analysis framework-entrypoints.csv into a two-column API → Protection mapping |
Python 3 |
| 2a | python scrawl/ |
Crawl official MiniApp API docs into <platform>.json |
Python 3 |
| 2b | prompts/ |
LLM prompts that turn <platform>.json into runnable APIDiff test cases |
any LLM |
| 3 | PERMSCOPE/ |
Dynamic Xposed module: hook runtime calls and log which Android APIs each MiniApp API triggers | Android + Xposed |
WALA static analysis of a ROM's framework dex. ServiceDetector finds the addService/publishBinderService sites (the ServiceManager registry), which gives both SDK and undocumented services. It further extracts public interfaces (API) in this recovered services to extract APIs. It also performs reachability analysis to expand the list.StaticPathExtractor performs path-sensitive analysis of APIs. AccessControlDetector recovers the associated access control / permissions (using a union approach).ManifestParser recovers permission protection levels.
Needs JDK 21 (the system java may be a stub, so set JAVA_HOME). Dependencies are vendored in lib/; Akka was dropped. Sample input is in ROMs/AOSPv14/framework/.
cd static-analysis
export JAVA_HOME=/path/to/jdk-21
./gradlew startAnalysis -Dpath="$PWD/ROMs/AOSPv14/framework" -DoutPath="$PWD/Output/AOSPv14/"Writes <outPath>/Execution-Paths/<Service>.csv and <outPath>/framework-entrypoints.csv (a sample run for AOSPv14 is checked in under Output/). It loads ~100 MB of dex, so the task sets -Xmx10g (edit build.gradle if you have less RAM).
extract_api_permissions.py flattens framework-entrypoints.csv into api_permissions.csv (Service, API, Protection). Protection is the permission name(s) guarding the API, joined with ;; no permission when there's no access control; or acType=..., level=... when it's guarded by something other than a permission (UserId, Uid, ...).
cd static_result_process
python extract_api_permissions.py # defaults to ../static-analysis/Output/AOSPv14/framework-entrypoints.csv
python extract_api_permissions.py -i path/to/framework-entrypoints.csv -o out.csvOne scraper per platform (wechat.py, qq.py, alipay.py, baidu.py) that writes <platform>.json. qq.py uses requests + regex; the others use playwright.
cd "python scrawl"
pip install requests beautifulsoup4 playwright && playwright install chromium
python qq.py crawl # writes qq.json; `python qq.py probe` parses the index onlyprompt_<platform>.txt tells an LLM to read <platform>.json and write one APIDiff test case per API. No setup: paste the prompt plus the JSON into any LLM and save the output as testcase_<platform>/<name>.js.
Xposed/LSPosed module (entry class is in app/src/main/assets/xposed_init) that hooks the MiniApp JSBridge and system APIs. Tracked APIs are listed in Method.methodListPart*. Needs a rooted device with Xposed/LSPosed, Android Studio, Gradle 8.9 / AGP 8.5.2, compileSdk 35 / minSdk 29, Xposed API 82.
cd PERMSCOPE
./gradlew :app:assembleDebug
adb install -r app/build/outputs/apk/debug/app-debug.apk
# enable in LSPosed, scope it to the target app