DEX 反编译与图分析 MCP 工具
DEX 反编译与图分析 MCP 工具
这一组工具提供 JADX 后端管理、单类/单方法反编译,以及静态控制流图、调用图和调用路径查询。
当前源码在这一组注册了 9 个工具。工具名大小写敏感;调用参数以本页表格和 MCP 客户端实时拿到的 input schema 为准。
使用前先知道
- 所有工具都通过 ScriptX 设置页启动的内置 MCP 服务暴露,不是脚本侧的
mcpServer对象。 - 所有返回值至少包含
ok、message、result。不要只判断 HTTP 状态码。 - 带
projectDir的分析工具通常要求先在 ScriptX 中缓存 APK,并使用get_analysis_state/list_apk_workspaces得到的真实工作区名。 - 安装、卸载、停止运行时和恢复备份等有副作用的工具,必须按参数表显式传入
confirm: true。
decompile_dex_class
Use the isolated Ubuntu JADX worker to reconstruct one indexed DEX class as bounded Java-like source. If the backend is missing, installation starts automatically and a jobId is returned.
显示名称:Decompile DEX class
参数
| 参数 | 类型 | 必填 | 可填值 / 范围 | 说明 |
|---|---|---|---|---|
projectDir | string | 是 | - | 缓存 APK 工作区目录名。 |
deobfuscation | boolean | 否 | true / false;默认 false | 是否启用 JADX 标识符反混淆,默认 false。 |
maxCodeChars | number | 否 | 最小 1024;最大 524288 | 最多返回的源码字符数,默认 65536。 |
timeoutSeconds | number | 否 | 最小 15;最大 600 | JADX worker 硬超时,默认 180 秒。 |
classDescriptor | string | 是 | - | Exact indexed DEX class descriptor, for example Lcom/example/MainActivity;. |
返回值
返回统一 MCP 结果对象:ok 表示调用是否成功,message 是可读说明,具体数据放在 result。分析尚未准备好、后端安装中或需要先缓存 APK 时,ok 可能为 false,应先读 message 与 result 中的状态字段再决定下一步。
示例
{"name":"decompile_dex_class","arguments":{"projectDir":"project_xxx","classDescriptor":"Lcom/example/MainActivity;","maxCodeChars":65536}}
decompile_dex_method
Use the isolated Ubuntu JADX worker to reconstruct one exact indexed DEX method as bounded Java-like source. If the backend is missing, installation starts automatically and a jobId is returned.
显示名称:Decompile DEX method
参数
| 参数 | 类型 | 必填 | 可填值 / 范围 | 说明 |
|---|---|---|---|---|
projectDir | string | 是 | - | 缓存 APK 工作区目录名。 |
deobfuscation | boolean | 否 | true / false;默认 false | 是否启用 JADX 标识符反混淆,默认 false。 |
maxCodeChars | number | 否 | 最小 1024;最大 524288 | 最多返回的源码字符数,默认 65536。 |
timeoutSeconds | number | 否 | 最小 15;最大 600 | JADX worker 硬超时,默认 180 秒。 |
methodSignature | string | 是 | - | Exact indexed DEX method signature, including owner and descriptor. |
返回值
返回统一 MCP 结果对象:ok 表示调用是否成功,message 是可读说明,具体数据放在 result。分析尚未准备好、后端安装中或需要先缓存 APK 时,ok 可能为 false,应先读 message 与 result 中的状态字段再决定下一步。
示例
{"name":"decompile_dex_method","arguments":{"projectDir":"project_xxx","methodSignature":"Lcom/example/MainActivity;->onCreate(Landroid/os/Bundle;)V"}}
find_dex_call_path
Search a bounded forward static METHOD-reference path between two exact DEX method signatures. A missing result is not proof of runtime unreachability.
显示名称:Find DEX call path
参数
| 参数 | 类型 | 必填 | 可填值 / 范围 | 说明 |
|---|---|---|---|---|
projectDir | string | 是 | - | Cached APK workspace directory. |
sourceMethod | string | 是 | - | Exact indexed source method signature. |
targetMethod | string | 是 | - | Exact target method signature; it may be an external leaf. |
maxDepth | number | 否 | 最小 0;最大 30 | Maximum call depth. Default 12, maximum 30. |
maxVisited | number | 否 | 最小 1;最大 10000 | Maximum visited methods. Default 2000, maximum 10000. |
返回值
返回统一 MCP 结果对象:ok 表示调用是否成功,message 是可读说明,具体数据放在 result。分析尚未准备好、后端安装中或需要先缓存 APK 时,ok 可能为 false,应先读 message 与 result 中的状态字段再决定下一步。
示例
{"name":"find_dex_call_path","arguments":{"projectDir":"project_xxx","sourceMethod":"Lcom/example/Main;->start()V","targetMethod":"Lcom/example/Auth;->verify()Z","maxDepth":12}}
get_dex_call_graph
Traverse bounded forward METHOD references from one indexed method. Internal cached methods are expanded; external/platform calls can be retained as leaf evidence.
显示名称:Get DEX call graph
参数
| 参数 | 类型 | 必填 | 可填值 / 范围 | 说明 |
|---|---|---|---|---|
projectDir | string | 是 | - | Cached APK workspace directory. |
rootMethod | string | 是 | - | Exact indexed root method signature. |
maxDepth | number | 否 | 最小 0;最大 20 | Forward traversal depth. Default 5, maximum 20. |
maxNodes | number | 否 | 最小 1;最大 2000 | Maximum graph nodes. Default 500, maximum 2000. |
maxEdges | number | 否 | 最小 1;最大 5000 | Maximum graph edges. Default 1000, maximum 5000. |
includeExternal | boolean | 否 | true / false;默认 true | Include unresolved framework/library methods as leaf nodes. Default true. |
返回值
返回统一 MCP 结果对象:ok 表示调用是否成功,message 是可读说明,具体数据放在 result。分析尚未准备好、后端安装中或需要先缓存 APK 时,ok 可能为 false,应先读 message 与 result 中的状态字段再决定下一步。
示例
{"name":"get_dex_call_graph","arguments":{"projectDir":"project_xxx","rootMethod":"Lcom/example/Main;->login()V","maxDepth":5,"maxNodes":500,"maxEdges":1000}}
get_dex_control_flow
Build a bounded static Smali basic-block graph for one exact indexed method, including conditional, goto, switch, fallthrough, return/throw, and conservative catch edges.
显示名称:Get DEX control flow
参数
| 参数 | 类型 | 必填 | 可填值 / 范围 | 说明 |
|---|---|---|---|---|
projectDir | string | 是 | - | Cached APK workspace directory. |
methodSignature | string | 是 | - | Exact indexed DEX method signature. |
includeInstructions | boolean | 否 | true / false;默认 false | Include bounded full block instructions. Default false; each block still includes a short preview. |
maxBlocks | number | 否 | 最小 1;最大 2000 | Maximum returned basic blocks. Default 250, maximum 2000. |
返回值
返回统一 MCP 结果对象:ok 表示调用是否成功,message 是可读说明,具体数据放在 result。分析尚未准备好、后端安装中或需要先缓存 APK 时,ok 可能为 false,应先读 message 与 result 中的状态字段再决定下一步。
示例
{"name":"get_dex_control_flow","arguments":{"projectDir":"project_xxx","methodSignature":"Lcom/example/Main;->check(I)Z","includeInstructions":false,"maxBlocks":250}}
get_dex_decompiler_backend_job
Return install or uninstall progress from the Ubuntu job system.
显示名称:Get DEX decompiler backend job
参数
| 参数 | 类型 | 必填 | 可填值 / 范围 | 说明 |
|---|---|---|---|---|
jobId | string | 是 | - | Job identifier returned by an install or uninstall operation. |
返回值
返回统一 MCP 结果对象:ok 表示调用是否成功,message 是可读说明,具体数据放在 result。分析尚未准备好、后端安装中或需要先缓存 APK 时,ok 可能为 false,应先读 message 与 result 中的状态字段再决定下一步。
示例
{"name":"get_dex_decompiler_backend_job","arguments":{"jobId":"..."}}
get_dex_decompiler_status
Probe the Ubuntu-hosted JADX worker used for targeted DEX class and method decompilation.
显示名称:Get DEX decompiler status
参数
| 参数 | 类型 | 必填 | 可填值 / 范围 | 说明 |
|---|---|---|---|---|
probe | boolean | 否 | true / false;默认 true | Run an authoritative backend health check. Default true. |
返回值
返回统一 MCP 结果对象:ok 表示调用是否成功,message 是可读说明,具体数据放在 result。分析尚未准备好、后端安装中或需要先缓存 APK 时,ok 可能为 false,应先读 message 与 result 中的状态字段再决定下一步。
示例
{"name":"get_dex_decompiler_status","arguments":{"probe":true}}
install_dex_decompiler_backend
Install the bundled ScriptX JADX 1.5.6 worker into Ubuntu. Only OpenJDK 17 is downloaded through apt when Java is absent. Returns immediately with a jobId.
显示名称:Install DEX decompiler backend
参数:无。
返回值
返回统一 MCP 结果对象:ok 表示调用是否成功,message 是可读说明,具体数据放在 result。分析尚未准备好、后端安装中或需要先缓存 APK 时,ok 可能为 false,应先读 message 与 result 中的状态字段再决定下一步。
示例
{"name":"install_dex_decompiler_backend","arguments":{}}
uninstall_dex_decompiler_backend
Remove only /opt/scriptx/jadx from Ubuntu. Cached APKs, Smali indexes, and Ubuntu itself are retained.
显示名称:Uninstall DEX decompiler backend
参数
| 参数 | 类型 | 必填 | 可填值 / 范围 | 说明 |
|---|---|---|---|---|
confirm | boolean | 是 | 仅 true | Must be true because the installed JADX backend is removed. |
返回值
返回统一 MCP 结果对象:ok 表示调用是否成功,message 是可读说明,具体数据放在 result。分析尚未准备好、后端安装中或需要先缓存 APK 时,ok 可能为 false,应先读 message 与 result 中的状态字段再决定下一步。
示例
{"name":"uninstall_dex_decompiler_backend","arguments":{"confirm":true}}
