Browse by type

A static decompiler for Flutter Android apps. Point it at an APK or a libapp.so and it
recovers readable Dart-like pseudocode, ARM64 disassembly, an intermediate representation,
build-to-build diffs, and structured reports. Everything runs offline on your machine: the target
is never executed.
libapp.so.dart files under lib/, packages/, and sdk/, with one file per library by default (--layout project keeps one file per function), plus index.json, report.json, and quality.json, with optional asm, IR, and symbol scriptsIf you remember only three commands:
flutterdec info tells you what the target is.flutterdec adapter install gives the decompiler real Dart names for that target.flutterdec decompile produces the pseudocode and reports.| Artifact | What it is |
|---|---|
lib/**/*.dart |
App or root-package code, one file per library by default. Start here. |
packages/**/lib/**/*.dart |
Dependency-package code, rooted at each package name. |
index.json |
Function-to-source mapping with ids, libraries, classes, line spans for composed functions, entry addresses, and provenance. |
report.json and quality.json |
What was analyzed, what was recovered, and how complete it was. |
artifacts/asm/**/*.s and artifacts/ir/**/*.json |
Lower-level views to verify the pseudocode (--emit-asm --emit-ir). |
ghidra_apply_symbols.py / ida_apply_symbols.py |
Recovered names for Ghidra or IDA (--emit-ghidra-script, --emit-ida-script). |
diff_report.json |
Function and package churn between two builds (flutterdec diff). |
| Target | A Flutter release build for Android ARM64 (arm64-v8a), as an APK or an extracted libapp.so. Debug/JIT builds cannot be decompiled. |
| Input | Any file on disk. A split APK works as long as it includes the arm64-v8a split, or you can use a universal APK. |
| Host | Linux x86_64 or macOS Apple Silicon for the prebuilt binaries. Other systems can build from source with Nix. |
| Runtime | Nothing beyond the CLI binary. Analysis is fully static and offline. |
| Optional | Nix for the zero-install path; a Rust toolchain (provided by nix develop) to build from source. |
Flutter release apps ship their compiled Dart code as lib/arm64-v8a/libapp.so inside the APK.
flutterdec accepts either the APK or the extracted libapp.so.
If you have Nix installed, one command runs the latest main without touching your system:
nix run github:caverav/flutterdec -- --help
Every example in this README works through that entry point, for example:
nix run github:caverav/flutterdec -- info ./app.apk --json
nix run github:caverav/flutterdec -- decompile ./app.apk -o ./out
To install it permanently instead:
nix profile install github:caverav/flutterdec
flutterdec --help
Update later with nix profile upgrade flutterdec.
Download the archive for your platform from the
Releases page: Linux x86_64 or macOS Apple
Silicon. The current prerelease is
v0.1.0-alpha.4.
[!IMPORTANT] The standalone
v0.1.0-alpha.4binary can inspect a target (flutterdec info), but it cannot install adapters or decompile without the packaged producer and registry from a source checkout. For decompilation today, use Nix (Option 1) or a source checkout (Option 3).
The archive contains a single flutterdec binary:
# Linux x86_64
curl -fLO https://github.com/caverav/flutterdec/releases/download/v0.1.0-alpha.4/flutterdec-v0.1.0-alpha.4-Linux-X64.tar.gz
tar -xzf flutterdec-v0.1.0-alpha.4-Linux-X64.tar.gz
# macOS Apple Silicon
curl -fLO https://github.com/caverav/flutterdec/releases/download/v0.1.0-alpha.4/flutterdec-v0.1.0-alpha.4-macOS-ARM64.tar.gz
tar -xzf flutterdec-v0.1.0-alpha.4-macOS-ARM64.tar.gz
# install the binary, then verify
sudo mkdir -p /usr/local/bin
sudo install -m 0755 flutterdec /usr/local/bin/flutterdec
flutterdec --version
Releases built from current main will ship a different layout: a prefix with bin/flutterdec plus
the compatibility registry, the runtime profiles, and the packaged producer under
share/flutterdec. On those releases the CLI resolves its data relative to its own executable, so
keep bin and share together and copy both (sudo cp -R bin share /usr/local/).
This is the route for contributors, or for running unreleased code:
git clone https://github.com/caverav/flutterdec.git
cd flutterdec
nix develop -c cargo build -p flutterdec-cli --release
./target/release/flutterdec --help
You can also run directly from the checkout without building, with nix run . -- --help. The
resulting CLI finds the adapters/ registry and data/ profiles in the repository, so adapters
work out of the box.
This walkthrough takes a few minutes on a normal machine. It uses app.apk and ./out as example
paths; replace them with your own.
flutterdec info ./app.apk --json
info reads the snapshot identity out of the header, with no adapter installed and no
disassembly. It tells you what you need next:
snapshot_hash: the identity of the compiled Dart snapshot, and the value adapter install takesarch and snapshot_features: the target architecture and the engine build characteristicsregistry_record_present and the compatibility block: whether a known adapter covers this app,
and if not, why (identity_rejection)For APK inputs, info also reports manifest-derived startup signals (android_startup_present,
android_startup_confidence, android_startup_entrypoint_count,
android_startup_flutter_activity_count). When adapter metadata is available it reports app
package counts and compatibility warnings too.
The dart_aliases, dart_version, and dart_tag_style fields describe the matched registry
record. Aliases are provenance labels and never select a parser or profile; dart_version is a
display value (unverified when the record carries aliases, unavailable when it carries none);
all three are null when no record matches or its adapter is not installed.
No adapter is needed for this step. --json prints the full report; omit it for a plain-text
summary.
flutterdec adapter install --dart-hash <snapshot_hash from step 1>
flutterdec adapter list
An adapter is a small, hash-specific parser that knows how one Dart snapshot version lays out libraries, classes, function names, and the object pool. Installing the adapter for your target is what turns anonymous ARM64 into named, readable code.
adapter install refuses a hash the compatibility registry has no record for, a record that does
not serve this host, and any artifact whose bytes do not match the digest and size the record
declares. Installs are atomic, safe to run concurrently, and report already-installed when the
store is already correct.adapter list reports a verified state per record: verified, missing, corrupt,
incompatible, or unavailable. It exits 2 when the store holds an install it cannot back.If no record covers your hash, skip this step. decompile still runs using core recovery and says
so in report.json; see Fallbacks and core recovery.
flutterdec decompile ./app.apk -o ./out
By default this focuses on app-owned code (--function-scope app-unknown) and excludes Flutter and
Dart framework internals.
Start with these files, in this order:
out/lib/**/*.dart - the recovered logic, one file per libraryout/index.json - the map from each function to its source file, line span, and provenanceout/report.json - what was analyzed and what was recoveredout/quality.json - how complete the recovery was[!IMPORTANT] A non-zero exit is expected on a real app, and your artifacts are still written. The strict quality gate is on by default (
--max-placeholder-ifs 0), and every real Flutter app contains placeholderifstatements the decompiler could not fully resolve. The command printsreasons: placeholder if-count exceeded threshold, exits1, and still writes every artifact listed above. Nothing is missing; the gate is reporting a quality measurement, not a failure to decompile.Measured on LocalSend 1.17 at the default scope: 501 placeholder ifs across 5,800 pseudocode files, exit 1.
Read your own number rather than guessing one. It is placeholder_ifs in out/quality.json, and
it grows with scope. Setting the threshold from that measurement is the point: a huge round number
silences the gate permanently, whereas a real one still fails when the count rises, which is
the only thing the gate is useful for. Keep the strict default in CI.
flutterdec decompile ./app.apk -o ./out # exits 1, writes everything
python3 -c "import json;print(json.load(open('out/quality.json'))['placeholder_ifs'])"
flutterdec decompile ./app.apk -o ./out --max-placeholder-ifs <that number>
The other gates are --max-unresolved-cf, --max-indirect-call-ratio, and
--min-disassembly-ratio. See the CLI reference for their defaults and for
--split-records.
A Flutter release compiles Dart ahead-of-time (AOT) to ARM64 machine code and packs it, with a
snapshot header and an object pool, into libapp.so. Symbols and source are gone; names survive
only as metadata. flutterdec walks the pipeline below and records what it recovered at each
stage.
APK / libapp.so
|
v
[1] Loader ------> [2] Adapter ------> [3] ARM64 disassembly
|
v
[4] IR + control-flow graph
|
v
[5] Pseudo-Dart decompiler
|
v
[6] quality.json + report.json
report.json records which execution controls were actually established.Auxiliary commands extend this core: map-symbols derives engine symbol names from a
stripped/unstripped pair, engine-fingerprint identifies an engine build from an ELF, symbol
ingestion feeds those names into decompile, and diff compares two builds at recovered-function
level.
The backend that parses the snapshot decides how much is actually recovered:
| Backend | Function names | Classes | ObjectPool |
|---|---|---|---|
internal / core recovery |
none at all; code ranges are unnamed | none | unavailable |
serwalker |
recovered snapshot name |
$ claude mcp add flutterdec \
-- python -m otcore.mcp_server <graph>