Decode Android APK into workspace
decompile_apkDisassembles an Android APK into Smali bytecode, manifest, assets, and resources, with an option to skip DEX disassembly for asset-only inspection, and sets up a workspace for subsequent analysis.
Instructions
Disassemble an Android APK file into decoded Smali bytecode, AndroidManifest.xml, assets, native libraries, and resource files, automatically installing a dedicated AGENTS.md workspace contract. Reads apkPath without mutating the source APK, but completely recreates outputDir; requires Java runtime and apktool on the system PATH. Set decompileSources=true (default) to disassemble DEX into Smali classes for code injection, or false for fast asset/manifest-only inspection; invoke analyze_injection_surface next on the resulting workspaceDir.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| apkPath | Yes | Absolute path to target source .apk file to decompile | |
| outputDir | Yes | Destination directory path where decompiled Smali code, resources, assets, and AndroidManifest.xml will be extracted | |
| decompileSources | No | Whether to disassemble DEX files into Smali code (default: true). Set false for resource/asset-only disassembly |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fileCount | Yes | Number of extracted workspace files. | |
| smaliRoot | Yes | Primary Smali root, when source decoding was enabled. | |
| sourceApk | Yes | Absolute path to the input APK that was read. | |
| targetAbis | Yes | Native ABI directories detected in the workspace. | |
| packageName | Yes | Package name parsed from AndroidManifest.xml. | |
| mainActivity | Yes | Resolved launcher activity, when present. | |
| manifestPath | Yes | Absolute path to decoded AndroidManifest.xml. | |
| workspaceDir | Yes | Absolute path to the decoded workspace. | |
| hasNativeLibs | Yes | Whether the decoded workspace contains native libraries. | |
| minSdkVersion | Yes | Declared minimum Android API level. | |
| applicationClass | Yes | Declared application class, when present. | |
| targetSdkVersion | Yes | Declared target Android API level. |