-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Troubleshooting Q&A
Jadx can't decompile 100% of code, so error can occur:
In most cases, this mean that jadx can't restore code structure (correctly move instructions to blocks like if
, for
, etc.).
Anyway, it is possible to view partially correct code by enabling option Show inconsistent code
(--show-bad-code
in jadx-cli).
But be careful and always check this code with Smali of CFG dump (see below)
Fallback dump is skipped for large methods, if you really want to view that dump change Code comments level
(--comments-level
) to debug
.
If jadx is failed to correctly decompile - only way to check method code is to dump method control flow graph (CFG).
For that enable Generate methods CFG graphs
(--cfg
) and/or more verbose fallback graph with Generate RAW CFG grapths
(--raw-cfg
).
This will dump .dot
file for every decompiled method in the current working dir with your file input name.
To open/view these files, you can use one of GraphViz apps from here.
Jadx can rename or inline classes to make code correct or closer to original. If such changes are not needed, here available options:
- uncheck
Enable deobfuscation
(in jadx-cli disabled by default) - uncheck all
Rename identifiers
flags (--rename-flags none
in jadx-cli) - disable inlining: uncheck
Inline anonymous classes
(--no-inline-anonymous
), also uncheckInline methods
(--no-inline-methods
) - uncheck
Move inner classes into parent
(--no-move-inner-classes
)
Possible options when Jadx is running out of RAM:
- Before starting the decompilation open in Jadx the Preferences dialog (menu File). Open the Excluded packages editor and add packages you want to exclude from decompiling
- Also, you can use right click menu in packages tree to exclude a single package or open dialog to mark all not needed packages
The more classes you exclude, the more memory you save.
Common packages you can exclude: android.support
android.arch
Since version 1.4.0 jadx-gui
have option to store decompilation result on disk.
Switch option Code cache mode
to DISK
(will use minimum memory).
- Using the Jadx command-line version (Linux, Windows, ...)
Edit the script bin/jadx-gui
or bin/jadx-gui.bat
(Windows) and change the maximum heap memory from 4 (-Xmx4g
) to e.g. 8 GB (-Xmx8g
) by modifying the definition of DEFAULT_JVM_OPTS
:
DEFAULT_JVM_OPTS='"-Xms128M" "-Xmx8g" "-Dawt.useSystemAAFontSettings=lcd" "-Dswing.aatext=true" "-XX:+UseG1GC"'
- Using the Jadx Exe version (Windows)
If you are on Windows and using jadx-gui.exe
create a text-file jadx-gui.l4j.ini
in the same directory jadx-gui.exe
is located in. For a maximum 8 GB memory/heap edit the text file and set it's content to:
-Xmx8g
If you are using a unstable version or Jadx or if you have renamed jadx-gui.exe
, you also have to adapt the .l4j.ini
file-name as well.
Example:
Jadx file-name: jadx-gui-1.1.0-b1279-2207cd7b.exe
Jadx config file name: jadx-gui-1.1.0-b1279-2207cd7b.l4j.ini.
-
High CPU usage of jadx-gui in background on macOS (possible issue in JVM check issues #1000 and #1413):
- Disable memory usage bar:
View
->Show memory usage bar
- Update JRE to the latest version
- Disable memory usage bar:
-
Rendering issues in
jadx-gui
:- Try the latest java version:
- Use release bundle with included JRE:
jadx-gui-***-with-jre-win.zip
- Or download latest JRE from oracle.com
- Use release bundle with included JRE:
- Try the latest java version: