
DexSQL
org.lsposed由 lsposed.org 发布v0.1.1更新于 Oct 25, 2026
SQL for Android APK and DEX files: classes, methods, strings, references and smali.
概览
一个本地 MCP 服务器,让助手用 SQL 查询 Android APK 和 DEX 文件,检查类、方法、字符串、引用和 smali。
- 可以做什么
- 用 SQL 查询 APK 和 DEX 文件中的类与方法,支持跨多个文件的复合条件。查找字符串及其引用方法,并追踪直接和两跳调用者。获取匹配方法对应的 smali 代码。通过 MCP 资源读取服务器的模式和文档。同一可执行文件还提供命令行查询模式。
- 适用场景
- 适用于 Android 逆向工程和代码审查,例如定位某条日志或 API 地址的使用位置、梳理调用关系,或在不使用图形界面反编译的情况下对大型应用提出结构化问题。
- 运行要求
- 以本地进程通过 stdio 运行。从 Releases 安装对应平台的可执行文件(macOS、x86_64 Linux、x86_64 Windows),或为 Claude Desktop 使用 mcpb 包,然后用 mcp 参数注册其绝对路径。未声明需要账户、API 密钥或环境变量。
安装
在 SourceWeft 中
- 打开 控制台中的 DexSQL,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
DexSQL
English | 简体中文
SQL for Android binaries.
Query classes, methods, strings, and call references in APK and DEX files. Connect it to an AI agent through MCP, or use it from the command line.
Playground · Documentation · Download · Install skill · Benchmarks
Why DexSQL?
AI agents can combine signatures, strings and call relationships in one SQL query across DEX files, returning just the structured results they need. Queries can be generated, refined and saved in scripts for reuse.
DexSQL reads DEX directly and reuses loaded datasets, supporting repeated queries with low latency and a small memory footprint. See the benchmarks for measurements.
The built-in MCP server connects directly to agents, with no GUI required.
Use with an AI agent
DexSQL is listed in the official MCP Registry as org.lsposed/dexsql. Clients that install servers from the registry can add it directly, and Claude Desktop can open the dexsql.mcpb bundle from Releases. The bundle covers macOS, x86_64 Linux and x86_64 Windows; on other platforms, use the skill or manual setup below.
Install the setup skill with the Skills CLI:
Then ask your agent to use install-dexsql to install DexSQL and configure its MCP connection. In Codex, invoke it as $install-dexsql.
The skill downloads a compatible binary from Releases, verifies its SHA-256 checksum, adds the MCP configuration, and checks the connection. It can also use a local executable. The command above installs the skill; the agent performs the actual setup when you invoke it.
Manual MCP setup
Open Releases and choose the executable or archive that matches your operating system and CPU architecture. Check the selected release's assets and notes for availability and system requirements. Extract the archive if needed, then rename the executable to dexsql.exe on Windows or dexsql on macOS/Linux. On macOS/Linux, run chmod +x /path/to/dexsql.
Save LICENSE and LICENSE-AUXILIARY from the same Release alongside the executable, then register its absolute path. For Codex:
For clients that use mcpServers JSON:
On Windows, use dexsql.exe and escape backslashes in JSON, for example "D:\\Tools\\dexsql.exe". Reload the client's MCP connection if needed. See the Codex MCP documentation for client settings.
Once connected, try:
Open
/path/to/app.apk. Find methods referencing this log message, list their callers, and show the relevant Smali.
The server provides its schema and documentation through MCP resources. APK parsing runs locally and leaves the input unchanged. The AI client's settings determine which results are sent to its model.
Performance
A real MCP session
An AI agent analyzed Douyin 40.7.0 (343 MiB, 56 DEX files) through the DexSQL MCP server. We replayed its analysis goals on DexSQL 0.1.1 and six other tools: rasc (the Rust implementation of ASC), DexDec, ddc, the JADX API, garlic and droidsaw.
Opening the APK once and answering 10 goals took 0.71 s with DexSQL, 1.69 s with rasc, 16 s with DexDec and from 75 s to 449 s with the others. DexSQL pays 0.38 s to open the APK once per session; rasc has no open but rereads the APK in every step, so a session with a single question finishes sooner with rasc. Some tools did not show all expected evidence; those misses are still under review. See the replay report for every goal, each tool's interface, the method and the harness.
Fixed queries on QQ
Eight queries run against the same QQ 9.3.55 APK, about 372 MiB: class and method lookup, string references, direct and two-hop callers, and compound predicates. The comparison includes JADX, zinja-coder's JADX-MCP, ASC, DexDec, ddc, garlic, and droidsaw.
[Process startup, preparation and first class lookup across eight tools.]
Startup time includes process launch, loading and preparation, and the first exact class lookup; values are medians of three runs. The OS file cache was not flushed.
[QQ 9.3.55: class, method-name and string-reference query times across eight tools.]
Queries use the median of nine repeats across three prepared workflows. garlic restarts MCP for each call; that cost is included. droidsaw CLI uses three separate invocations, each including loading. Each query uses one linear chart starting at zero. Bars exceeding the axis limit are clipped, marked with an arrow and labeled with their actual time. Hatched bars mean the query did not finish within 60 seconds. Gray entries explain missing comparisons.
Call chains and compound predicates
[Direct and two-hop caller queries.]
[String-and-call intersection, four-fact filtering and complex set queries.]
Direct and two-hop queries return 15 and 16 methods. Each compound query returns one method. Every completed, plotted result set is checked. The JADX native adapter reads metadata and DEX instructions directly; it does not decompile the whole APK to find references.
[Process-tree memory peaks for class lookup and all executed queries.]
Memory uses a 50 ms polling wait across the whole process tree. Light bars cover the common load-and-class-lookup workflow; dark bars cover each tool's executed cases. Summed RSS can count shared pages more than once. Private committed memory and the footprint at readiness are also recorded.
DexDec's reference cache makes its repeated caller query faster than DexSQL in this run. droidsaw's MCP rejects the input under its fixed parse budget, so its CLI is plotted. See the report for first-query and preparation times, interface differences, SQL, result hashes and reproduction scripts.
CLI
Repeat --input to query multiple files together. The same executable provides the CLI and MCP server.
License
DexSQL is closed-source software from LSPosed, licensed under the DexSQL Binary License 1.0. Personal and commercial use, integration, and binary redistribution are free under its terms.
The public installation skill, benchmark materials, and documentation use the MIT License.
Third-party materials retain their own licenses. Run dexsql extract licenses to view their notices.
来源:README.md,提交 b867cfe
工具
0版本历史
1- v0.1.1最新Oct 18, 2026
评分
已满足适用检查项的 40%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
请在仓库或注册中心条目中声明许可证。