反编译Android APK/XAPK/JAR/AAR文件,并使用jadx提取HTTP API、认证模式和调用流程,同时具备抗R8的Kotlin名称恢复功能,用于安全研究和渗透测试。
一个 Claude Code 技能,可反编译 Android APK/XAPK/JAR/AAR 文件,并提取应用所使用的 HTTP API — Retrofit 端点、OkHttp 调用、硬编码 URL、认证模式 — 让你无需原始源代码即可记录并复现它们。
一流的 Kotlin 支持:现代 Android 应用多为 Kotlin/KMP,并经过 R8 的深度混淆。本技能可从 R8 无法剥离的元数据中恢复原始 Kotlin 类名,并从 Ktor、Apollo (GraphQL) 和 Koin 中提取 API — 而不仅仅是经典的 Retrofit/OkHttp 技术栈。详见下方的 Kotlin 名称恢复。
Windows / PowerShell 支持(实验性):与 bash 脚本并存的
*.ps1脚本是近期社区贡献的成果,仍在稳定化过程中。如有任何问题,请在本仓库(而非贡献者的上游 fork)上提交 issue:PowerShell 脚本由 @SimoneAvogadro 在此维护。
| 能力 | 描述 |
|---|---|
| 指纹识别优先(阶段 0) | 在数秒内对 APK/XAPK 进行分诊 — 在投入时间进行完整反编译之前,先检测框架(Flutter / React Native / Cordova / Xamarin / 原生 Kotlin)、HTTP 技术栈、混淆程度和原生库 |
| 反编译 | 使用 jadx 和 Fernflower/Vineflower 处理 APK、XAPK、JAR 和 AAR 文件(单引擎或并排对比) |
| 恢复 Kotlin 名称 | 利用 R8 无法剥离的 Kotlin 元数据,从经 R8 混淆的二进制文件中重建原始的 *Repository / *ViewModel / *UseCase 类名 |
| 提取 API | Retrofit、OkHttp、Volley 以及现代 Kotlin/KMP 技术栈:Ktor、Apollo (GraphQL)、Koin DI — 端点、硬编码 URL、认证头、令牌和 HMAC 请求签名方案 |
| 追踪调用流程 | 从 Activity/Fragment 经由 ViewModel 和 Repository 一直追踪到 HTTP 调用 |
| 分析结构 | Manifest、包、架构模式 |
| 处理混淆 | 抗 R8 的路径/URL 提取,以及导航 ProGuard/R8 输出的策略 |
必需:
可选(推荐):
详细安装说明请参见 plugins/android-reverse-engineering/skills/android-reverse-engineering/references/setup-guide.md。
在 Claude Code 中运行:
/plugin marketplace add SimoneAvogadro/android-reverse-engineering-skill
/plugin install android-reverse-engineering@android-reverse-engineering-skill
该技能将在未来所有会话中永久可用。
git clone https://github.com/SimoneAvogadro/android-reverse-engineering-skill.git
然后在 Claude Code 中:
/plugin marketplace add /path/to/android-reverse-engineering-skill
/plugin install android-reverse-engineering@android-reverse-engineering-skill
/decompile path/to/app.apk
这将运行完整工作流:依赖检查、反编译和初始结构分析。
该技能会在以下短语出现时激活:
这些脚本也可以独立使用:
# Check dependencies
bash plugins/android-reverse-engineering/skills/android-reverse-engineering/scripts/check-deps.sh
# Install a missing dependency (auto-detects OS and package manager)
bash plugins/android-reverse-engineering/skills/android-reverse-engineering/scripts/install-dep.sh jadx
bash plugins/android-reverse-engineering/skills/android-reverse-engineering/scripts/install-dep.sh vineflower
# Fingerprint an APK/XAPK BEFORE decompiling (Phase 0 triage):
# framework, HTTP stack, obfuscation level, native libs, notable SDKs
bash plugins/android-reverse-engineering/skills/android-reverse-engineering/scripts/fingerprint.sh app.apk
# Decompile APK with jadx (default)
bash plugins/android-reverse-engineering/skills/android-reverse-engineering/scripts/decompile.sh app.apk
# Decompile XAPK (auto-extracts and decompiles each APK inside)
bash plugins/android-reverse-engineering/skills/android-reverse-engineering/scripts/decompile.sh app-bundle.xapk
# Decompile with Fernflower
bash plugins/android-reverse-engineering/skills/android-reverse-engineering/scripts/decompile.sh --engine fernflower library.jar
# Run both engines and compare
bash plugins/android-reverse-engineering/skills/android-reverse-engineering/scripts/decompile.sh --engine both --deobf app.apk
# Find API calls — defaults to a full scan across every supported stack
bash plugins/android-reverse-engineering/skills/android-reverse-engineering/scripts/find-api-calls.sh output/sources/
bash plugins/android-reverse-engineering/skills/android-reverse-engineering/scripts/find-api-calls.sh output/sources/ --retrofit
bash plugins/android-reverse-engineering/skills/android-reverse-engineering/scripts/find-api-calls.sh output/sources/ --urls
# Modern Kotlin/KMP stacks and obfuscation-resistant extraction
bash plugins/android-reverse-engineering/skills/android-reverse-engineering/scripts/find-api-calls.sh output/sources/ --ktor # Ktor client
bash plugins/android-reverse-engineering/skills/android-reverse-engineering/scripts/find-api-calls.sh output/sources/ --apollo # Apollo / GraphQL
bash plugins/android-reverse-engineering/skills/android-reverse-engineering/scripts/find-api-calls.sh output/sources/ --paths # quoted path literals that survive R8 inlining
大多数真实世界的 Kotlin/KMP 应用都经过 R8 处理,因此反编译出的类
会显示为 a.b.c。R8 会重命名 JVM 符号,但无法剥离 Kotlin
元数据字符串 — Kotlin 运行时(反射、协程)在运行时需要
原始的完全限定名。本技能会挖掘这些
@DebugMetadata / @Metadata 注解,重建 混淆名 → 真实名 的
类名映射。在典型应用上,它能恢复约 100% 你真正想阅读的
*Repository / *ViewModel / *UseCase / *Impl 类。
# 1. Build the mapping from the decompiled sources
bash plugins/android-reverse-engineering/skills/android-reverse-engineering/scripts/recover-kotlin-names.sh output/sources/ output/names/
# → output/names/mapping.tsv, mapping.json, by_package/
# 2. Query it: resolve an obfuscated name, search by real name, or grep
# the sources with each hit annotated with its recovered class name
bash plugins/android-reverse-engineering/skills/android-reverse-engineering/scripts/lookup-name.sh output/names/ LoginRepository
bash plugins/android-reverse-engineering/skills/android-reverse-engineering/scripts/lookup-name.sh output/names/ -o a.b.c
bash plugins/android-reverse-engineering/skills/android-reverse-engineering/scripts/lookup-name.sh output/names/ --grep 'login' output/sources/