Messages and troubleshooting
An ngr error is a line on stderr with the command that failed, the reason and, when there is one, the way out:
ngr <command>: <what happened>. <what to do>
Warnings start with WARN: and do not stop the command.
ngr does not start
| What you see | What is happening | What to do |
|---|---|---|
macOS says it cannot open ngr because it cannot check who made it |
The file carries the quarantine mark of a download | xattr -dr com.apple.quarantine nogar-0.1.0-osx-arm64 (“First run”) |
| Windows shows a blue SmartScreen warning | ngr.exe is not signed |
More info and Run anyway, or Unblock-File on the zip before unzipping it |
Couldn't find a valid ICU package installed on the system |
On Linux the ICU library is missing | Install ICU: on Ubuntu 22.04, sudo apt install libicu70 |
command not found, or ngr is not recognized |
The ngr folder is not in the PATH |
“Installation” |
cannot execute binary file or Exec format error |
The package is not for your system or your processor | Download the right one from “Downloads” |
Messages from any command
| Message | What it means | What to do |
|---|---|---|
'<file>' does not exist. |
The input does not exist | Check the path |
'<output>' already exists (pass -f to overwrite). |
The destination already exists and ngr does not overwrite it |
Pass -f, or give another destination with -o. In decode, -f deletes the whole folder |
unrecognized option '<option>'. See 'ngr help <command>'. |
The option is not from that command | See its options with ngr help <command> |
missing <input>. See 'ngr help <command>'. |
An input is missing | Add it |
unexpected argument '<something>'. |
There is an extra input, or an option has an extra value | Check the command. Short forms are not combined: -f -o, not -fo |
unknown verb '<something>'. See 'ngr help'. |
The command does not exist | ngr help lists them |
unable to read '<file>': Central Directory corrupt. |
The file is not a zip, or it is truncated | Check what it is with ngr identify, and that the download arrived whole |
unable to write '<output>': Could not find a part of the path ... |
The destination folder does not exist | Create it first. ngr does not create the folder of an output file |
Access to the path '<path>' is denied. |
There is no permission to write there | Write to another folder with -o |
Unsupported DEX version '041'. |
The dex is of a version that ngr does not read |
“Formats and limits” |
PROTECTED
info, resource and xml answer WARN: PROTECTED, and decode, refactor and protect write the path of the
apk and PROTECTED. In both cases the command ends with exit code 0 and does nothing else.
ngr calls an apk protected when it has entries under classes.dex/ or AndroidManifest.xml/, as if those files
were folders. It is what ngr protect leaves, and the commands that read resources do
not work with those apks. The dex commands (list, disassemble, decompile) and the signing and alignment
commands do not make that check.
When decoding and building
| Message | What it means | What to do |
|---|---|---|
WARN: N entry name(s) collided case-insensitively and overwrote each other on this filesystem |
The apk has entries whose names differ only in case, and your file system does not distinguish them | Decode on a volume that distinguishes case. Otherwise, the apk you build will not have all the entries |
--type raw needs --dex. |
--type raw copies the entries untouched, and that includes the dex files |
Add --dex |
no <package>/values/public.xml found under '...': the tree is incomplete or was not written by 'ngr decode' |
The folder is not an ngr decode tree, or part of it is missing |
Decode again. ngr build does not read projects from other tools |
When signing
| Message | What it means | What to do |
|---|---|---|
no signer given; pass --ks <keystore>, or --debug-key ... |
You have not said which key to sign with | Pass --ks or --debug-key |
--debug-key and --ks can't be given together. |
They are two ways of signing that exclude each other | Choose one |
signer #1 ('<keystore>') has no --ks-pass. |
The keystore password is missing | --ks-pass after its --ks |
option '--ks-pass' must come after the --ks it belongs to. |
The options of a signer go after its --ks |
Reorder the command |
cannot read the keystore '...': The certificate data cannot be read with the provided password, the password may be incorrect. |
The password is not the keystore's | Check it. With env:, check that the variable has the value you think |
cannot read the keystore '...': ASN1 corrupted data. |
The file is not a PKCS#12 keystore. It is what happens with a JKS | Convert it to PKCS#12 (“Signing and verifying”) |
the environment variable '<name>' is not set. |
env: names a variable that does not exist |
Define it, or export it so it reaches ngr |
several --ks need --lineage; pass a lineage or sign with one key |
Several signers only make sense with rotation | Add --lineage or sign with a single key |
WARN: created a new debug key in ... |
It is the first time you sign with --debug-key |
Keep that file |
When verifying
| Message | What it means |
|---|---|
DOES NOT VERIFY, and exit code 3 |
The apk does not verify. The ERROR: lines say why |
ERROR: Missing META-INF/MANIFEST.MF |
The apk is not signed |
ERROR: ... APK integrity check failed. CHUNKED_SHA256 digest mismatch. |
The apk changed after it was signed. It is normal in the output of build, merge, refactor and protect: you have to sign it |
WARNING: META-INF/... not protected by signature. |
An entry in META-INF/ is not covered by the v1 signature. It does not stop the apk from verifying |
'...' has no signing certificate lineage in its v3 or v3.1 signature block. |
You gave lineage an apk that is not rotated |
When decompiling
| Message | What it means |
|---|---|
WARN: N class(es): <warning>: ... |
A class warning. The text itself explains it (“Class warnings”) |
WARN: N method(s) were written as smali; see the NOGAR ERROR comments |
Some methods did not come out as Java. The command ends with 3 |
WARN: --classes: no class in '...' has the descriptor '...' |
The descriptor is not that of any class. It has the form Lcom/example/Main;, with the L and the semicolon |
WARN: --stubs: N classes that neither the app nor the platform declares are written as stubs ... |
How many classes were declared in nogar-stubs/ |
--line-numbers and --debug-info ignore can't be given together. |
Line numbers come from the debug information |
Questions
The signed apk does not install
Check, in this order:
- That it verifies:
ngr verify -v app_signed.apkhas to sayVerifies. - That the application is not already installed with another signature. Android does not update with a different signature: you have to uninstall it first.
- That the device supports the
minSdkVersionand the architectures of the apk:ngr info --min-sdk-version app.apkandngr info --files app.apkto see what is inlib/.
The decompile output does not compile
Classes with a method in smali do not compile, on purpose. For the others, use --stubs and a --java-version
that matches your compiler
(“Decompiling to Java”).
Non-ASCII characters look wrong on Windows
It is the encoding of PowerShell when reading a pipe (“Installation”).
ngr ends with 3 and there is no error
The 3 is not an error: it is a negative verdict from identify, align, verify or decompile
(“Output and exit codes”).
Reporting a bug
Write to nogar@stau.me. So that we can reproduce it, tell us:
- which command you ran, with the exact command line;
- what you expected and what happened, with what came out on stderr;
- the output of
ngr --versionand your system; - if you can, the file it fails with, or where to download it.
We are especially interested in the methods that ngr decompile writes as smali with a reason that starts with
unsupported: or internal:, and in any case where the decompiled Java does not do what the application does.