Android APK MCP
v0.9.0Unpack Android APKs and splits into offline projects with DEX code and decoded Android resources.
Android APK MCP is a local reverse-engineering tool for Android apps. Give it a base APK and its installed splits to produce a self-contained project you can open on your computer, browse offline and copy. Explore DEX code by class, find the methods that refer to a declared target, inspect Android resources, and follow a launcher activity to its class listing. The project also includes native library symbols and a manifest security review. A CLI and a local MCP server expose the same readers. For 0.7.0 and later, run the Windows Setup.exe asset from the corresponding GitHub release.
Summary extracted from the README.
Android APK MCP
Android APK MCP is a local reverse-engineering tool for Android apps. Give it a base APK and its installed splits to produce a self-contained project you can open on your computer, browse offline and copy. Explore DEX code by class, find the methods that refer to a declared target, inspect Android resources, and follow a launcher activity to its class listing. The project also includes native library symbols and a manifest security review. A CLI and a local MCP server expose the same readers.
Install
Windows
For 0.7.0 and later, run the Windows Setup.exe asset from the corresponding GitHub release. It installs for the current user and adds Android APK MCP CLI to Start. Initial setup needs internet access.
To install the current development version, download the source ZIP, extract it to the folder where you want to keep the tool, then double-click Install.cmd. Leave that folder in place. The installer finds a suitable Python or downloads one, creates a virtual environment, installs the analysis tools, and writes the local MCP configuration. It can use an existing compatible Java runtime or install a private copy.
Linux and macOS
From the extracted source folder, run:
bash scripts/setup.sh
The installer can bootstrap Python when needed. After setup, the CLI is available at .venv/bin/android-apk-mcp on Linux/macOS or .venv\Scripts\android-apk-mcp.exe on Windows. Use engines to see which analysis engines are ready. The setup creates mcp.local.json for clients and a project-local Codex configuration.
Python packages and MCP clients
Install the wheel in a Python 3.11+ environment, or select the published package in your MCP client. Starting with 0.7.0, the first engine-assisted analysis automatically prepares the engines it needs. A full setup from the source ZIP downloads them up front. Initial downloads need internet access. APK analysis runs locally.
Unpack a portable project
Supply a single APK, or the base APK and all splits from the same installation. The portable exporter reads DEX and resources directly with the built-in Python engine.
android-apk-mcp unpack app.apk --out projects
# Include class-level Java from the supplied DEX files in the same project:
android-apk-mcp unpack app.apk --java --out projects
# For a split installation:
android-apk-mcp unpack base.apk split_config.arm64_v8a.apk --out projects
# Resolve retained class, field and method definitions with the map from this build:
android-apk-mcp unpack base.apk split_config.arm64_v8a.apk --mapping mapping.txt --out projects
# Or export a release already in the library:
android-apk-mcp decompile RELEASE_ID --portable --out projects
Open the returned entrypoint (index.html) directly on the same computer. To share
or transfer the project, copy the entire generated directory. An MCP client can call decompile with
{"release_id":"…","portable":true}. To supply a mapping over MCP, put the build's
mapping file in the library inbox and pass "mapping_filename":"mapping.txt".
To include the Java view over MCP, pass "include_java":true. Each export creates a
fresh directory. After upgrading, open the entrypoint printed by the new run.
| Inside the project | Contents |
|---|---|
project.json |
Export, recovery and local navigation counts for this project |
raw/ |
Original uncompressed file bytes by APK split, including DEX, assets and native libraries |
members.json |
Original member names, split identities, portable paths, sizes and verified SHA-256 hashes |
decoded/ |
Built-in manifest and resource analysis, DEX definitions and register-level method IR |
calls.html |
Static DEX call sites from recovered methods, with declared targets and instruction offsets |
classes.html, classes.ndjson |
Browse and copy readable per-class DEX listings with fields, signatures and recovered method bodies |
sources.html, sources/index.ndjson |
Inspect structured pseudocode or a register listing, register SSA data and eligible standalone Java/Kotlin method reconstructions |
java.html (with --java) |
Open class-level Java reconstructed by JADX for the supplied DEX files and inspect engine diagnostics and low-level fallback files |
smali.html, smali-coverage.json |
Open built-in Smali output for supported classes and read the reasons for skipped classes |
names.html, names.ndjson |
With a supplied mapping, find the DEX and original names side by side, inspect ambiguous matches and open method artifacts |
debug-names.html |
Inspect parameter names and local register lifetimes preserved in DEX debug streams |
packaged-sources.html |
Browse source text included in the APK and retrieve its exact packaged bytes |
symbols.html |
Browse symbols available in native ELF libraries by ABI and split, including JNI exports and declared library dependencies |
audit.html, audit.sarif |
Review Android manifest security settings, their evidence and remediation guidance offline or in a SARIF viewer |
entrypoints.html |
Navigate manifest components and launcher aliases to matching class listings, with split provenance |
search.html |
Search locally by member name, class or method identifier, manifest declaration or resource name |
resources.html |
Inspect decoded Android resource values by ID, name and configuration |
flutter.html |
Explore packaged Flutter asset keys, variants and fonts in detected Flutter apps |
decoded/coverage.json |
Method recovery outcomes and analysis limits |
Files with names incompatible with portable paths have a deterministic alternate filename
under their split. Find their original names in the browser or in members.json.
The exporter verifies the bytes written to disk. A failure to extract any file stops
publication of that snapshot. The raw file set covers the supplied APKs. Code recovery
has separate format, instruction, size and time limits. A Flutter release preserves
the packaged assets and native binaries. The built-in DEX reader reconstructs Android
bytecode. AOT binaries contain compiled Dart, and the portable export preserves them
for separate analysis.
An APK can contain actual source files, compiled code, or both. The packaged-source view links to exact bytes and hashes. The built-in Java and Kotlin source views show supported DEX method bodies. The optional Java view uses JADX on each DEX and keeps its output in the portable directory. A Java file can contain several nested classes. Recovering a file does not establish that its methods compile or that it matches the developer's original source. A compiler can discard comments, rewrite control flow, and merge or remove methods. R8 can also rename surviving definitions. Supply the mapping from the same build to recover those names. The mapping report records its SHA-256 and shows which DEX signatures match. It cannot verify that the supplied mapping came from this build. DEX debug names, when present, are available without a mapping.
Open sources.html for method-level results. The built-in control-flow pass recognizes
straight-line code, supported one- and two-arm branches and simple loops. Other shapes retain
a labeled register listing. Register SSA describes definitions and joins on supported
normal-flow paths. Protected ranges and typed or catch-all handlers come from the DEX
exception table. Their offsets refer to 16-bit code units in the method.
Standalone .java and .kt wrappers implement the computation of selected primitive
methods. Supported cases include integer arithmetic, proven conditional branches and
simple loops. An instance method qualifies when its body does not depend on the receiver.
The signature and operations must fit the supported integer, boolean or void cases.
Each wrapper uses invoke; the source index maps it to its original DEX method and split.
Other recovered methods remain available as pseudocode or register listings. The
built-in Smali writer handles packed and sparse switches, inline array data, typed
array construction, annotations and encoded static values. It emits local variable
scopes, generic signatures, source-file changes and line numbers at representable
addresses. Each class record in smali.ndjson distinguishes omitted code from
emitted code with partial debug information. The raw DEX retains the original debug
stream for each method.
Analyze an APK or a device
Use this workflow for a separate analysis job with configured engines or ADB input. Its reports and artifacts live in the analysis job directory.
android-apk-mcp engines
android-apk-mcp analyze-apks base.apk split_config.arm64_v8a.apk
android-apk-mcp devices
android-apk-mcp analyze-device org.example.app --serial DEVICE_SERIAL
android-apk-mcp analysis-inputs ANALYSIS_ID --limit 25
For direct import, connect the Android device, enable USB debugging, and approve the normal Android prompt. With one connected device, the serial is optional. Import verifies that every installed APK still belongs to the same installation and checks each copied file's length. Use packages that you own or have permission to analyze.
Use import, list, compare, and export to work with archived versions. Set --library before the command or set ANDROID_APK_MCP_LIBRARY to choose a storage directory. Editable installs use the checkout's data/ directory. Wheels and other regular installs use a per-user directory.
Optional analysis engines
The full installer prepares JADX for reconstructed Java, Apktool for Smali, and Jadart with Capstone for supported Flutter snapshots, and ADB for USB import. The CLI and MCP server use the same per-user engine cache. The default built-in export runs offline. The optional --java export prepares JADX on first use and requires internet for missing dependencies. Its finished project opens offline.
To prefetch all engines into the cache from an installed Python package, run android-apk-mcp setup-engines. To prefetch one, use --only jadx, --only apktool, --only jadart, or --only adb. A failed download is reported per component and can be retried. For a built-in-only source installation, pass --core-only to the Bash installer or -CoreOnly to PowerShell. Set ANDROID_APK_MCP_AUTO_SETUP=0 in a client's environment to disable automatic first-use downloads.
The private Java download supports Windows x64, macOS 11+ on Intel or Apple Silicon, and 64-bit Linux with glibc 2.17+ on x86 or ARM. The Google ADB bundle supports Windows, macOS and glibc Linux x86-64. Other hosts can use compatible system installations.
On native Termux, unpack --java reuses a working Java runtime or installs
openjdk-21 through the Termux package manager on first use. Check java.html for
the engine status if package installation or the JADX download fails. The default
built-in Smali exporter runs with Python alone.
Advanced installations can set ANDROID_APK_MCP_TOOLS to an absolute cache directory. Existing MCP_JADX_JAR, MCP_APKTOOL_JAR, MCP_JADART_EXE and MCP_JAVA_EXECUTABLE overrides remain supported. See Third-party components for pinned sources.
Analysis output
The analysis directory contains report.json, an inventory, and artifacts tied to the original APK hash, split, and member.
| Input | Output |
|---|---|
| DEX and ARM64, built in | Dalvik register operations and branch graphs, or ARM64 instructions and register effects |
| DEX with JADX configured | Reconstructed Java and separate low-level fallback files |
| DEX, optional | Smali output from the pinned Apktool release |
| Flutter AOT | Approximate Dart or verified class structure from Jadart |
| Compiled Android resources | Decoded manifests, resource tables and files by split, with a built-in XML fallback |
| Native libraries | ELF architecture, load segments, sections and shared-library dependencies |
Inspect each stage status to see which inputs were recovered and which hit format, tool, or resource limits. Static reconstruction cannot recover the original source exactly. Native reports describe ELF structure and dependencies.
Per-DEX reports can include a short-class-name signal from a bounded sample. Short names are a heuristic and do not identify the tool that produced them.
Built-in code and XML readers
Use the release ID from import or list. These commands run locally with Python and report the SHA-256 of the APK containing the selected member.
android-apk-mcp decode-dex RELEASE_ID --class 'Lorg/mcp/demo/MainActivity;' --method onCreate --signature '(Landroid/os/Bundle;)V'
android-apk-mcp decode-arm64 RELEASE_ID lib/arm64-v8a/libapp.so --instructions 128
android-apk-mcp decode-xml RELEASE_ID AndroidManifest.xml
Use --split for a member in an installed split, --member for a different root DEX, or --symbol to select an exact ARM64 function. The corresponding MCP tools are decode_dex_method, decode_arm64_function, and decode_android_xml.
The DEX reader supports standard little-endian DEX versions 035–040. It preserves instruction offsets, register operations and unsupported instruction words in the recovered methods. The ARM64 reader labels an executable-section sample when a function boundary is unavailable. ARM64 coverage counts decoded and unknown instruction words. The XML reader preserves numeric resource references where names are unresolved. For a separate engine-assisted analysis, JADX supplies reconstructed Java and resource output, Apktool supplies its Smali output, and Jadart processes supported Flutter AOT snapshots.
Optional Smali pass
Request a per-split Apktool listing during engine-assisted analysis:
android-apk-mcp analyze-apks --smali base.apk feature.apk
# Or analyze an existing release:
android-apk-mcp analyze RELEASE_ID --smali
The JAR must match the release SHA-256. Apktool receives staged DEX entries and publishes Smali by split. In Codex or Claude Desktop, pass include_smali: true to start_analysis.
Diagnose a native crash and inspect a local runtime trace
Import the base APK and matching splits, then use the returned release ID with a text backtrace captured from that build. If you kept the unstripped ELF from your build, pass it to recover available source lines.
android-apk-mcp import base.apk split_config.arm64_v8a.apk
android-apk-mcp native-backtrace RELEASE_ID tombstone.txt --debug-file libexample.so
android-apk-mcp performance-trace trace.json --limit 10
The backtrace reader matches the ELF-relative program counter to a packaged library using its GNU build ID. It reports missing and ambiguous evidence per frame. The offline native symbol browser preserves raw linkage names and displays readable C++ names for supported Itanium encodings.
The trace reader accepts a Chrome Trace Event JSON export (an event array or a traceEvents object). It summarizes completed duration events in microseconds and preserves separate process and thread identities. The numbers describe the recorded spans. A Perfetto binary trace must be exported to supported JSON before using this command.
To inspect a running app on an authorized Android device, request recent UI frame timings. The tool reads Android's per-package graphics statistics. It can also summarize a previously saved report offline.
android-apk-mcp frame-timings --package com.example.app
android-apk-mcp frame-timings --file framestats.txt
The corresponding MCP tools are get_android_frame_timings and summarize_android_frame_timings. Coverage depends on which UI frames Android recorded for the app. Live capture checks observed timestamps against device uptime and reports impossible rows separately. Saved reports without a capture clock mark the time base as unverified.
For MCP, place the inputs in the local inbox and call correlate_native_backtrace or summarize_performance_trace. Both tools read local files.
Review a release you maintain
android-apk-mcp review-manifest RELEASE_ID
android-apk-mcp review-source path/to/config.py
The manifest review reports the declared or default setting, its origin, and components that warrant review. A reference to Network Security Config identifies where to look for per-domain rules. Component findings describe declarations. Credential findings examine one source file at a time and return candidate types and line and column numbers with values redacted.
Runtime measurements
For an app you can build and benchmark, run Jetpack Macrobenchmark and pass the exported benchmark JSON to the CLI:
android-apk-mcp runtime-report benchmarkData.json
The summary includes metric ranges and medians from recorded runs. You can also put the JSON in the local inbox and use summarize_android_benchmark through MCP.
Cache a decoded release inventory
Import the base APK and every split for the release, then pass the returned release ID:
android-apk-mcp import base.apk split_config.arm64_v8a.apk
android-apk-mcp decompile RELEASE_ID
The MCP tool decompile takes the same release ID. Both entry points keep the project
on the local machine. Schema 2 bundles go in <library>/projects-v2/<release-id>/.
Schema 1 bundles are under <library>/projects/<release-id>/. The CLI accepts
--out DIRECTORY to select a new parent directory during an upgrade.
The project contains split-specific manifests and a merged view of their declarations,
decoded resource XML, copied binary resources and assets, and local native libraries
with bounded ELF metadata. The file names on disk are generated. index.json maps
them to the original APK member names and records DEX class, method, and field definitions.
For each supported resources.arsc, the table report lists resource IDs, qualified names,
and configuration fingerprints. Method rows link to local dex_ir/ artifacts where the
built-in reader recovered a body. IR files describe recovered control flow and mark partial instruction or branch recovery. Methods without a DEX body and methods affected by a
budget or parse failure have explicit statuses.
integrity.json hashes the emitted files and both reports. A repeat request verifies
the archived APKs and the existing directory before reusing it. If the output was
edited, use a different output directory.
coverage.json reports known DEX definition totals, counts of inputs with unknown
totals, method outcomes, resource table outcomes, and outstanding stages. The portable export uses this inventory to build its browsable class, call-site and resource views. The separate analyze workflow provides additional engine output.
unpack and portable exports use the large profile by default. Pass
--profile standard for a smaller run. A cached inventory built with plain
decompile RELEASE_ID uses the standard limits. The following bounds apply to the
decoded inventory. Extraction of original member bytes has a separate release budget.
| Decoded inventory limit | Standard | Large |
|---|---|---|
| Bytes per copied member | 128 MiB | 512 MiB |
| Combined artifact size | 384 MiB | 2 GiB |
| Artifact files | 8,192 | 100,000 |
| Index size | 128 MiB | 512 MiB |
| Method attempts per project | 4,096 | 65,536 |
| IR instruction records per project | 80,000 | 2,000,000 |
| Instructions per method | 4,096 | 32,768 |
| Project deadline | 5 minutes | 30 minutes |
decoded/coverage.json records the active profile, its limits and actual IR
instruction count. The call-site index uses an on-disk sort. The resource table index
accepts up to 25,000 definitions across the release, with 64 MiB per parsed table
and 192 MiB of parsed resource tables. Entries beyond a stage or artifact limit
receive an explicit reason. A fatal input or project-wide limit aborts publication.
Keep the output under a directory you control.
Connect an MCP client
Install the package in the Python environment used by your client. The server uses local stdio and returns structured tool results.
Codex
Add the server to your Codex configuration. Use the absolute path to .venv/bin/python or .venv\Scripts\python.exe.
[mcp_servers.android-apk-library]
command = "/absolute/path/to/python"
args = ["-m", "android_apk_mcp.cli", "serve"]
Claude Desktop
Add the entry under mcpServers in the Claude Desktop configuration. An absolute Python path lets the client start the correct environment from the desktop.
{
"mcpServers": {
"android-apk-library": {
"command": "/absolute/path/to/python",
"args": ["-m", "android_apk_mcp.cli", "serve"]
}
}
}
Available tools
| Tools | Purpose |
|---|---|
list_inbox, import_release, export_release |
Import APK sets and export verified copies |
list_releases, inspect_release, list_manifest, list_files |
Browse releases, declared components and package entries |
compare_releases |
Compare APK hashes, permissions, components, splits and entry metadata |
check_analysis_engines, list_android_devices |
Check local engine and device availability |
start_analysis, start_device_analysis, get_analysis, list_analyses |
Start and track analysis jobs |
decompile |
Export a browsable offline project with portable: true. The default builds a verified, cached release inventory |
list_analysis_inputs |
Page through input provenance and stage results |
decode_dex_method, decode_arm64_function |
Read selected instructions with the built-in Dalvik or ARM64 reader |
decode_android_xml |
Decode an archived Android manifest or resource XML |
review_android_manifest |
Review archived application flags and component declarations |
review_source_credentials |
Locate redacted credential candidates in one source file placed in the inbox |
summarize_android_benchmark |
Read metrics from an AndroidX Benchmark JSON export |
record_behavior, implementation_brief |
Save developer observations and summarize a release |
Place APKs in the library's inbox/ for MCP imports. An analysis start returns an ID. Read its progress with get_analysis; completed results include paths to generated artifacts.
Development
The repository includes an original Java sample with two versions and a Flutter ARM64 sample. They are built using the Android and Flutter SDKs.
python -m pip install -e '.[dev]'
python -m ruff check src tests
python -m black --check src tests
python -m unittest discover -s tests -v
Ubuntu CI builds the Java and Flutter APKs and runs the full suite with both analysis engines. macOS CI runs the same tests using those fixtures with its own engine installations. Windows CI builds the single-file installer, installs it, checks the managed engines and runs the APK and MCP tests against the installed interpreter. Release checks also install and run the wheel outside the checkout.
See Contributing, Changelog, Security reporting, and Third-party components.