Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
403 views
in Technique[技术] by (71.8m points)

java - 将DEX反编译成Java源代码(decompiling DEX into Java sourcecode)

如何将Android DEX(VM字节码)文件反编译成相应的Java源代码?

  ask by Will translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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)

反编译的来源


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...