Skip to content

nogar Help

How to use nogar and its ngr command, a single executable for macOS, Linux and Windows that inspects, modifies, signs and decompiles Android apps: how to install it, what each command does and how it maps to the tools you already know.

Where to start

I have never used it

  1. “Download” the package for your system and unpack it.
  2. Put the ngr folder on your PATH and check that it starts with ngr --version (“Installation” says how on each system).
  3. See what a file is and decompile it:
ngr identify app.apk
ngr decompile app.apk

The “quick start” continues from there with three complete walkthroughs.

I come from apktool, jadx or apksigner

The “command-by-command equivalents” put each command you already use next to its ngr counterpart, and “Behavior differences” says where the result changes.

I want the details of a command

Each command has its own page in “Commands”. In the terminal, ngr help <command> gives the same summary of inputs and options.

Something does not work as I expected

Look the message up in “Messages and troubleshooting”, or check what the exit code ngr ended with means in “Output and exit codes”.

At a glance

Systems macOS (Apple silicon), Linux x64 and Windows x64
What you download one executable, ngr; it installs nothing
What it needs nothing else: no Java, no .NET, no Android SDK
What it reads apk, dex, and the xapk, apkm, apks and aab bundles
How you use it ngr <command> [options] <input>
Price and license free, under its own use license; distributed only as a binary
Version described 0.1.0

How the examples are written

Commands go in code blocks and can be copied as they are. The examples use an app.apk file in the current folder; change the name to that of your own. What ngr answers goes in another block, sometimes shortened with ....

The texts that ngr prints (the help, the warnings, the error messages) are quoted exactly as they appear. The help of ngr calls its commands verbs: ngr help <verb>.

Getting started

Download nogar, install it, follow the quick start and learn how ngr works.

Commands

One page for each of the 19 commands: inputs, options, what it writes and its exit codes.

CommandsThe 19 ngr commands by area, with what each one does and a link to its page.ngr identifySays what structure a file has, by looking at its content and not its extension, and which ngr commands accept it.ngr infoPrints the package, versions, permissions, resources and files of an apk, as text, JSON or XML.ngr resourcePrints entries of the resource table of an apk, by full name or by hexadecimal or decimal identifier.ngr xmlPrints the tree of a compiled xml from inside an apk, such as AndroidManifest.xml, or its string pool.ngr decodeDecodes an apk into a tree of resources, manifest and smali that you can edit and rebuild with ngr build.ngr buildBuilds an apk from the tree that ngr decode wrote, reassembling only the smali that changed.ngr mergeMerges the split apks of a bundle (.xapk, .apkm, .apks) into a single apk.ngr refactorGives readable names to the resources of an apk with obfuscated names and returns each file to the folder of its type.ngr protectObfuscates the names and paths of the resources of an apk and its binary manifest.ngr alignAligns the uncompressed entries of a zip or apk, or checks that they are aligned.ngr signSigns an apk with schemes v1 to v4, with your keystore or with the nogar debug key, and with key rotation.ngr verifyChecks whether the signatures of an apk verify, and shows the certificates of its signers.ngr rotateCreates a signing certificate lineage in which the old key hands over to the new one, or extends an existing one.ngr lineageReads a signing certificate lineage, from a file or a rotated apk, and changes the capabilities of its signers.ngr disassembleDisassembles a dex, an apk or an xapk into smali files, one per class.ngr assembleAssembles smali, a file or a folder, into a dex, with the dex version that matches the API level.ngr dumpPrints an annotated hexadecimal dump of a dex, section by section.ngr listLists the classes, strings, fields, methods or types of a dex, or the dex files of an apk, one per line.ngr decompileDecompiles a dex, an apk or an xapk to Java source code, one file per class, and says for each method how faithful what it wrote is.

Tasks

One page per task: inspect, modify, sign, rotate the key, merge, decompile and automate.

Comparison

What ngr covers next to the other apk tools, the command-by-command equivalents and the differences.

Reference

Exit codes, files, the decode tree, the decompiler output, limits, messages, release notes and licence.