将 DEX 反编译为 Java 源代码 [英] decompiling DEX into Java sourcecode
问题描述
如何将Android DEX(VM字节码)文件反编译成对应的Java源代码?
很简单
获取这些工具:
由于 dex2jar 做了一些优化,源代码可读性很强.
程序:
这里是如何反编译的过程:
第 1 步:
将 test_apk-debug.apk 中的 classes.dex 转换为 test_apk-debug_dex2jar.jar
d2j-dex2jar.sh -f -o output_jar.jar apk_to_decompile.apkd2j-dex2jar.sh -f -o output_jar.jar dex_to_decompile.dex
<块引用>
注1:在Windows机器中,所有.sh
脚本都被.bat
脚本替换
<块引用>
注意 2: 在 linux/mac 上不要忘记 sh
或 bash
.完整的命令应该是:
sh d2j-dex2jar.sh -f -o output_jar.jar apk_to_decompile.apk
<块引用>
注意 3:另外,记得给 dex2jar-X.X
目录添加执行权限,例如sudo chmod -R +x dex2jar-2.0
第 2 步:
在 JD-GUI 中打开 jar
How can one decompile Android DEX (VM bytecode) files into corresponding Java sourcecode?
It's easy
Get these tools:
The source code is quite readable as dex2jar makes some optimizations.
Procedure:
And here's the procedure on how to decompile:
Step 1:
Convert classes.dex in test_apk-debug.apk to 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 1: In the Windows machines all the
.sh
scripts are replaced by.bat
scripts
Note 2: On linux/mac don't forget about
sh
orbash
. The full command should be:
sh d2j-dex2jar.sh -f -o output_jar.jar apk_to_decompile.apk
Note 3: Also, remember to add execute permission to
dex2jar-X.X
directory e.g.sudo chmod -R +x dex2jar-2.0
Step 2:
Open the jar in JD-GUI
这篇关于将 DEX 反编译为 Java 源代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!