English | Chinese
Android/Java decompiler written in C
Tool for produces java source code from class/jar/dex/apk file
- decompile apk file
- decompile dex file
- decompile class file
- decompile jar file
- decompile war file
requirements: cmake >= 3.26
No other dependencies
git clone https://github.com/neocanable/garlic.git
cd garlic
cmake -B build
cmake --build build
./build/garlic
-
decompile apk
garlic /path/to/android.apk garlic /path/to/android.apk -o /path/to/save # -o option is source code output path garlic /path/to/android.apk -t 5 # -t option is thread count, default is 4
-
decompile .dex file
garlic /path/to/classes.dex garlic /path/to/classes.dex -o /path/to/save # -o option is source code output path garlic /path/to/classes.dex -t 5 # -t option is thread count, default is 4
-
decompile .class file
decompile .class file, default output is stdout
garlic /path/to/jvm.class
-
decompile jar file
garlic /path/to/file.jar garlic /path/to/file.jar -o /path/to/save # -o option is source code output path garlic /path/to/file.jar -t 5 # -t option is thread count, default is 4
default output is same level directory as the file
-
javap
like javap, more faster, disabled LineNumber and StackMapTable attributes
garlic /path/to/jvm.class -p
-
dexdump
garlic /path/to/dalvik.dex -p
in src/jvm.c, change main function to:
int main(int argc, char **argv)
{
jar_file_analyse(path_of_jar, out_of_jar, 1);
return 0;
}
if thread count less than 2, it will disable multiple thread.
decompile newest(2025-06-16) wechat.apk which size is 200M+ and 19w+ classes need 12 seconds
garlic ~/wechat/wechat.apk
[Garlic] APK file analysis
File : ~/wechat/wechat.apk
Save to : ~/wechat/wechat_apk
Thread : 4
Progress : 192538 (192538)
[Done]
$ hyperfine "garlic ~/wechat/wechat.apk"
Benchmark 1: garlic ~/wechat/wechat_apk
Time (mean ± σ): 11.502 s ± 0.105 s [User: 31.803 s, System: 10.588 s]
Range (min … max): 11.373 s … 11.774 s 10 runs
Email: neocanable#gmail.com (replace # to @)
wechat: neocanable
Licensed under the Apache 2.0 License