Search K
Appearance
Appearance
Other ways to support HackTricks:
For further details on each tool check the original post from https://eiken.dev/blog/2021/02/how-to-break-your-jar-in-2021-decompilation-guide-for-jars-and-apks/#cfr
As the pioneering GUI Java decompiler, JD-Gui allows you to investigate Java code within APK files. It's straightforward to use; after obtaining the APK, simply open it with JD-Gui to inspect the code.
Jadx offers a user-friendly interface for decompiling Java code from Android applications. It's recommended for its ease of use across different platforms.
jadx-gui
jadx app.apk
jadx app.apk -d <path to output dir> --no-res --no-src --no-imports
GDA, a Windows-only tool, offers extensive features for reverse engineering Android apps. Install and run GDA on your Windows system, then load the APK file for analysis.
With Bytecode-Viewer, you can analyze APK files using multiple decompilers. After downloading, run Bytecode-Viewer, load your APK, and select the decompilers you wish to use for simultaneous analysis.
Enjarify translates Dalvik bytecode to Java bytecode, enabling Java analysis tools to analyze Android applications more effectively.
enjarify app.apk
This generates the Java bytecode equivalent of the provided APK.CFR is capable of decompiling modern Java features. Use it as follows:
java -jar ./cfr.jar "app.jar" --outputdir "output_directory"
java -Xmx4G -jar ./cfr.jar "app.jar" --outputdir "output_directory"
Fernflower, an analytical decompiler, requires building from source. After building:
java -jar ./fernflower.jar "app.jar" "output_directory"
Then, extract the .java
files from the generated JAR using unzip
.Krakatau offers detailed control over decompilation, especially for handling external libraries.
./Krakatau/decompile.py -out "output_directory" -skip -nauto -path "./jrt-extractor/rt.jar" "app.jar"
For straightforward decompilation with procyon:
procyon -jar "app.jar" -o "output_directory"
Other ways to support HackTricks: