Skip to content

Commands

Updated on 30 November 2026

ngr has 19 commands in five areas. Each page says what the command does, which inputs and options it accepts, what it writes and which code it ends with. The rules that all of them share are in “How ngr works”.

Inspect an apk

They read and write nothing.

  1. ngr identify: says what a file is and which commands accept it.
  2. ngr info: prints the package, versions, permissions, resources and files of an apk.
  3. ngr resource: shows entries of the resource table by identifier or by name.
  4. ngr xml: shows a compiled xml from inside the apk, such as AndroidManifest.xml.

Transform an apk

  1. ngr decode: decodes an apk into a tree of resources, manifest and smali.
  2. ngr build: builds an apk from the tree that decode wrote.
  3. ngr merge: merges the split apks of a bundle (.xapk, .apkm, .apks) into a single one.
  4. ngr refactor: gives readable names to the resources of an apk and restores their paths.
  5. ngr protect: obfuscates the resource names, paths and binary manifest of an apk.

Align and sign

  1. ngr align: aligns the uncompressed entries of a zip or an apk, or checks that they are aligned.
  2. ngr sign: signs an apk with the v1 to v4 schemes, with key rotation.
  3. ngr verify: checks the signatures of an apk.
  4. ngr rotate: creates or extends a signing certificate lineage.
  5. ngr lineage: reads a lineage and changes the capabilities of its signers.

Dex and smali

  1. ngr disassemble: disassembles a dex into smali files, one per class.
  2. ngr assemble: assembles smali into a dex.
  3. ngr dump: prints an annotated hexadecimal dump of a dex.
  4. ngr list: lists the classes, strings, fields, methods or types of a dex.

Decompile

  1. ngr decompile: decompiles a dex, an apk or an xapk to Java source code.

Which command do I need

I want to... Command
know what a file is identify
see the package, version or permissions info
read the manifest without unpacking anything xml
change resources or code and repack decode, build
turn an .xapk into an installable apk merge, sign
sign an apk sign
know whether an apk is properly signed and by whom verify
change the signing key without losing updates rotate, sign
read the code as Java decompile
read or edit the code as smali disassemble, assemble
look for a class, a method or a string list

How to read a command page

They all have the same sections, in this order:

  • Usage: the shape of the command, as ngr help <command> gives it.
  • Inputs and Options: what it accepts, with the defaults.
  • What it writes: the files and what goes to stdout and stderr.
  • Examples: commands you can copy, with their output.
  • Exit codes: the ones that command can give.
  • Things to know: what is worth knowing before you trust the result.
  • See also: related commands and tasks.