/testkit:android-static-app-reversefrom testkit
Static reverse engineering workflow for Android APKs: exports from ADB, decompiles with JADX/apktool/Vineflower, detects obfuscation, extracts API endpoints, and generates evidence-backed reports.
Ships in testkit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
只做静态分析。不得绕过 license、认证、加密、支付、反作弊或访问控制;不得提取私人用户数据或凭证。
Android 静态逆向进度:
- [ ] 步骤 1:范围与安全检查 ⚠️ 必做
- [ ] 1.1 确认应用、包名或本地 APK 目录
- [ ] 1.2 确认任务仅包含静态逆向
- [ ] 1.3 选择带时间戳安全目录或明确的临时输出路径
- [ ] 步骤 2:预检 ⛔ 阻断项
- [ ] 2.1 检查 `jadx --version`
- [ ] 2.2 仅按需检查可选工具
- [ ] 2.3 从设备导出时检查 `adb devices`;多设备使用 `--serial` 或 `ANDROID_SERIAL`
- [ ] 2.4 将应用名称解析为包名
- [ ] 2.5 APK >50MB 或 DEX >10 时启用并行和超时
- [ ] 2.6 Windows/PowerShell 环境读取跨平台说明
- [ ] 步骤 3:导出与反编译
- [ ] 3.1 用 `adb shell pm path` + `adb pull` 拉取全部 split APK
- [ ] 3.2 对 APK/XAPK/JAR/AAR 运行 JADX
- [ ] 3.3 需要精确 manifest/resource/smali 时运行 apktool
- [ ] 3.4 需要交叉验证时运行 dex2jar + Vineflower
- [ ] 步骤 4:验证产物 ⚠️ 必做
- [ ] 4.1 验证 APK、JADX 目录及 `sources/`
- [ ] 4.2 APK/XAPK 验证 `resources/AndroidManifest.xml`
- [ ] 4.3 apktool 验证 manifest、`res/` 和 `smali*/`
- [ ] 4.4 按需运行 APKiD 或静态产物盘点
- [ ] 4.5 API/secret/security 分析按需运行 apkleaks 及 fallback
- [ ] 4.6 记录 hash、包/版本元数据和签名状态
- [ ] 步骤 5:分析用户要求的范围
- [ ] 步骤 6:用覆盖范围和置信度标签报告结果
确认用户要求的是 APK/source/resource 静态检查,而不是运行时绕过或破解。涉及凭证提取、支付/DRM/license 绕过、作弊、恶意修改或私人数据外传时,拒绝或收窄范围。已授权应用的兼容性研究、hook target 定位、日志调试和安全评审可以继续。
使用 --force 前必须列出将被替换的目录并取得明确授权;用户已明确要求覆盖时除外。
jadx --version
选择可选工具、定位 Android SDK build-tools 或运行 APKiD/apkleaks 时读取 tooling-and-commands.md。可选工具包括 apktool、vineflower、dex2jar、aapt/aapt2、apksigner、apkid、apkleaks 和 androguard。
提取 native 配置时读取 native-config-extraction.md,并检查:
command -v nm readelf objdump xxd strings
command -v llvm-readelf llvm-objdump || true
普通导出/反编译默认先生成 APK/JADX 盘点。用户要求安全、加固、endpoint、secret 或覆盖度分析,或完整性不确定时,再运行 APKiD/apkleaks。
find_static_anchors.py。从手机导出时:
adb devices
只有按空白分列后的第二列等于 device 才算已授权设备。多个设备必须使用 --serial <serial> 或 ANDROID_SERIAL。
脚本 ADB 预检失败但手动 ADB 可用时,不得直接停止:
adb -s <serial> shell pm path <package>
adb -s <serial> pull <remote-apk> <apk-dir>
随后对本地 APK 目录运行脚本。应用名称有歧义时询问包名,不得猜测。
优先使用内置脚本:
python3 <skill-dir>/scripts/reverse_android_apps.py com.example.app --out <out-dir>
python3 <skill-dir>/scripts/reverse_android_apps.py sample=<path-to-app.apk> --out <out-dir>
python3 <skill-dir>/scripts/reverse_android_apps.py com.example.app --out <out-dir> --with-apktool --with-vineflower
python3 <skill-dir>/scripts/reverse_android_apps.py com.example.app --out <out-dir> --with-apkid --with-apkleaks
省略 --out 时写入 tempfile.gettempdir()。完整命令变体见 tooling-and-commands.md,跨平台命令见 cross-platform.md。
APK >50MB 或 DEX >10 时使用 --parallel --jadx-timeout 600 --apkleaks-timeout 300;卡住或只有部分输出时读取 large-apk-handling.md。
修改脚本后验证语法:
PYTHONPYCACHEPREFIX=<temp-dir>/android-static-app-reverse-pycache \
python3 -m py_compile scripts/reverse_android_apps.py \
scripts/find_static_anchors.py scripts/inventory_static_artifacts.py
apktool 必须使用可写 framework 目录:
apktool d -f -p <writable-framework-dir> <apk> -o <decoded-dir>
JADX 结果分级:
0:sources/ 和预期资源存在时视为完整成功。3:部分反编译错误;有可用 source 和关键资源时可以继续。sources/、关键 DEX 输出,或 APK 缺少 manifest/resource:默认阻断。工具顺序:
--jadx-mode simple 或 fallback。du -sh <output>/*_apks <output>/*_jadx
find <output> -path "*/resources/AndroidManifest.xml"
rg -n "^<manifest|package=" <output>/*_jadx/resources/AndroidManifest.xml
PowerShell 等价命令见 cross-platform.md。
本地 APK 元数据优先使用 build-tools:
<build-tools>/aapt dump badging <apk>
<build-tools>/apksigner verify --verbose --print-certs <apk>
apksigner 失败时报告原始错误,再用 jarsigner -verify -verbose -certs <apk> 补充证书主体和弱算法等证据。即使 jarsigner 能读证书,只要 apksigner 失败,仍标记为“验证不通过”。
需要加固/security/coverage 分析或完整性不明时优先 APKiD;不可用时:
python3 <skill-dir>/scripts/inventory_static_artifacts.py \
<apk-dir-or-file> <jadx-dir> [<apktool-dir-if-present>]
API/secret/security 分析优先 apkleaks;不可用、失败或超时时:
python3 <skill-dir>/scripts/find_static_anchors.py <jadx-dir>/sources \
--urls --auth --include-namespace <app.namespace>
验证每个应用的 split 数量、sources/、apktool manifest/res/smali、Vineflower Java 输出、加固/native/dynamic DEX/framework 信号、签名证据和 JADX exit code。
每条结论记录文件路径和行号,并区分直接证据与推断。
| App | Package | APK 目录 | JADX 目录 | Apktool 目录 | Vineflower 目录 | 状态 |
|---|
如有 JADX exit 3,明确说明它表示部分反编译错误,已有 source/resource 可能仍可使用,不得夸大完整性。
API 分析附加:
置信度统一使用:
已确认(Confirmed):source-to-sink 完整且有验证证据。很可能(Likely):静态路径充分,最多一个未解析跳点。需动态确认(Needs Dynamic Confirmation):被混淆、reflection、JNI/native、RASP 或运行时行为阻断。最后说明静态/动态范围、namespace/library 过滤、framework、加固信号、runtime DEX、native 状态、混淆程度、缺失工具和动态确认项。
完成逆向后不得自动调用 testspec-code-calibrate。按用户意图选择:
authority: reference;按需先由 testspec-new 建立 change,再交给 testspec-analysis。不得让 analysis 读取反编译代码正文。testspec-code-calibrate 或明确要求用反编译代码校准 PRD:冻结 APK/split SHA-256、包名/版本、反编译工具与模式、退出状态、输出根和覆盖缺口,再交给校准 skill;不得由本 skill 自行生成 code-calibration.json。非 Git 反编译输出交给校准时,提供安全 repository_label,将 ref 和 commit 标为 unavailable,并用 snapshot_reason 绑定已冻结的 APK 身份与反编译来源。scope 和 evidence path 都相对于已授权的输出根;混淆、JNI/native、动态加载、RASP、缺失资源或部分反编译影响到的结论保持 inferred 或 unknown。即使用户将某构建指定为 verification baseline,authority 仍是 reference。
/tmp 当成独立真实目录;通常指向 /private/tmp。base.apk。3 不得导致整批停止。sources/,APK/XAPK 有 manifest/resource 或例外说明3 和 timeout 已按部分结果处理testspec-code-calibrate;如用户显式要求校准,已交接冻结的 APK 身份、反编译来源和相对 scopeevals/evals.json (opens in a new tab)references/cross-platform.md (opens in a new tab)references/endpoint-extraction.md (opens in a new tab)references/large-apk-handling.md (opens in a new tab)references/native-config-extraction.md (opens in a new tab)references/native-packer-triage.md (opens in a new tab)references/security-triage.md (opens in a new tab)references/tooling-and-commands.md (opens in a new tab)scripts/find_static_anchors.py (opens in a new tab)scripts/inventory_static_artifacts.py (opens in a new tab)scripts/reverse_android_apps.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub winhok/testkit --plugin testkit26 skills in this plugin
/api-test-automation基于 HTTP API 定义生成并执行自动化测试,支持 Swagger/OpenAPI 2.0、OpenAPI 3.0/3.1/3.2、YApi、Postman Collection 2.1、受控运行已有 pytest 资产,以及用户明确要求的后端源码静态扫描。适用于「做接口自动化测试」「从 YApi 或 Swagger 生成并运行测试」「导入 Postman Collection」「运行已有 pytest 接口用例」「扫描后端接口」「跑 API smoke」「登录后提取 Token」「串联多接口并传递变量」「执行 setup/cleanup、数据驱动、业务断言、正负向、模糊或状态化测试」「检查接口实现与文档是否一致」以及从接口发现、导入、执行到结果归因的端到端任务。/app-test执行 Android、iOS 与 Web 的真实运行测试,验证页面交互、系统行为和跨端业务旅程,记录实际断言与证据。用户要按已确认用例测试网站、操作手机应用、跑端到端用例或验证 WebView 时使用;没有代码仓库、需要逆向网站并为 TestSpec 建立实现证据时走 web-app-reverse,录屏转缺陷报告走 video-to-issue。/defect-verification组织缺陷重现、修复版本定向复测与关联回归,建立 RED、GREEN、REGRESSION 证据并关联来源失败和再验收。用户要复现 Bug、验证修复、复测旧 APK 与新 APK 或判断缺陷是否关闭时使用;实际操作委托当前可用的 app-test/API 能力,不默认修改业务代码。/generate-api-artifacts将已复核的 OpenAPI 或 Swagger 契约转换为可导入的 API 工具产物,包括 Postman Collection v2.1、Apifox 可导入 OpenAPI 和 Apache JMeter JMX。当用户要求「OpenAPI 转 Postman」「生成 Apifox 导入文件」「把 Swagger 做成 JMeter/JMX」「生成 API 客户端集合」或从同一份接口定义同时导出多个目标格式时使用。/log-analysis服务端日志智能分析与日志检索最佳实践 - 解读应用日志、JSON/structured logs、HTTP/access log、数据库慢查询、消息队列、定时任务、网关/代理和系统组件日志;适配本地文件、grep/rg/zgrep/jq 输出及主流日志平台线索。按 traceId/correlationId/requestId/spanId/线程/业务 ID 拆分链路,还原请求、任务、消息或批处理时间线,诊断报错、超时、慢调用、字段为空、数据不一致、重试降级、敏感信息泄露、日志质量、索引/标签/高基数和查询范围问题。用户粘贴日志、提供日志文件路径、贴查询结果、询问“分析日志”“查日志最佳实践”“帮我看下这段 log”“接口为什么慢”“为什么失败/超时/为空”“字段在哪一跳丢了”“日志里有没有报错”“怎么搜 trace”“慢查询/消息消费/access log/任务日志排查”时使用。/perfspec-analysis分析性能测试需求与风险,复用当前 TestSpec、业务流程和已有 SLO,明确目标、范围、性能口径及关键缺口。用户要梳理性能需求、容量问题或压测前需要哪些信息时使用;明确的性能计划、脚本生成、执行和结果评估分别交给其他 perfspec 阶段。Other plugins' skills for the same job