It's easy (这很简单)
Get these tools: (获取这些工具:)
1) dex2jar to translate dex files to jar files (1) dex2jar将dex文件转换为jar文件)
2) jd-gui to view the java files in the jar (2) jd-gui查看jar中的java文件)
The source code is quite readable as dex2jar makes some optimizations. (源代码非常易读,因为dex2jar进行了一些优化。)
Procedure: (程序:)
And here's the procedure on how to decompile: (这是关于如何反编译的过程:)
Step 1: (步骤1:)
Convert classes.dex in test_apk-debug.apk to test_apk-debug_dex2jar.jar (将test_apk-debug.apk中的classes.dex转换为test_apk-debug_dex2jar.jar)
d2j-dex2jar.sh -f -o output_jar.jar apk_to_decompile.apk
d2j-dex2jar.sh -f -o output_jar.jar dex_to_decompile.dex
Note: In the Windows machines all the .sh
scripts are replaced by .bat
scripts (注意:在Windows机器中,所有.sh
脚本都替换为.bat
脚本)
dex2jar documentation (dex2jar文档)
Step 2: (第2步:)
Open the jar in JD-GUI (在JD-GUI中打开jar)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…