Skip to content

Quick start

Updated on 30 November 2026

Three walkthroughs, each of two or three commands. They assume that ngr is on the PATH (“Installation”) and that you are in a folder with an app.apk file. What they write ends up next to it.

The same holds in all three: warnings, when there are any, come first and start with WARN:, and the last line says what was written. Both go to stderr.

1. See what an apk is and decompile it to Java

ngr identify app.apk
ngr decompile app.apk

identify says what the file is and which commands accept it. Here the output is shortened:

file: app.apk
structure: apk with dex in the root (114,280 B)
verbs: info, resource, xml, decode, refactor, protect, align, sign, verify, ...
caveats:
  ...

decompile writes the Java sources to app_java, with a summary of what it did, and ends like this:

ngr decompile: 43 classes, 92 methods: 92 natural, 0 dispatcher, 0 smali; 17 files written
wrote 17 file(s) to app_java

Each .java file starts with the count of its methods. What natural, dispatcher and smali mean is in “Decompiling to Java”.

2. Decode an apk, change it, rebuild it and sign it

ngr decode app.apk
ngr build app
ngr sign --debug-key app_built.apk

decode unpacks the apk into the app folder: the resources as text, the code as smali and everything else as is. The number of files depends on the apk:

wrote 134 file(s) to app

Change whatever you want inside that folder. build packs it into app_built.apk:

wrote app_built.apk

sign writes app_built_signed.apk and, next to it, app_built_signed.apk.idsig with the v4 signature. The first time, it creates the debug key and warns you first:

WARN: created a new debug key in /Users/you/Library/Application Support/NOGAR/debug.p12; keep it to sign updates of the same apps
wrote app_built_signed.apk and app_built_signed.apk.idsig

Keep that debug.p12 file. An Android device installs an update only if it carries the same signature as the installed app (“The debug key”).

The signed apk can now be installed. “Modifying and rebuilding an apk” covers the whole walkthrough, with your own key and with the final check.

3. Turn a dex into smali and assemble it again

If you have an apk and not a dex, you can extract the dex first. This command is not from ngr:

unzip app.apk classes.dex
ngr disassemble classes.dex
ngr assemble classes_smali

disassemble writes one smali file per class:

wrote 41 file(s) to classes_smali

assemble builds a dex from that folder:

wrote classes_smali.dex

disassemble also accepts the whole apk, and then it writes one folder for each dex it contains.

When ngr refuses to overwrite

No command overwrites a file or a folder that already exists. It says so and names the option that allows it, which is almost always -f:

ngr build: 'app_built.apk' already exists (pass -f to overwrite).

Next step

“How ngr works” explains the rules that all commands share. If you already know what you want to do, go to “Tasks” or to the page of a “command”.