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


当前回答

Android逆向工程是可能的 . 按照以下步骤从apk文件中获取.java文件。

步骤1。使用dex2jar

从。apk文件生成。jar文件 命令:dex2jar sampleApp.apk

步骤2。使用JD-GUI反编译.jar

它会反编译。class文件,也就是说,我们会从apk中得到模糊的。java文件。

其他回答

我建议大家去这里看看: https://github.com/JesusFreke/smali

它提供了BAKSMALI,这是用于DEX文件的最优秀的逆向工程工具。 它是由JesusFreke制作的,他为Android创造了著名的rom。

我用过

Dex2jar + jd-gui javadecompilers.com enjarify Apktool

但没有比谷歌自己的工具更好的了

1)Android Studio 2.x: 构建>分析apk

2)Android Studio 3.0: 配置文件或调试APK

您可以尝试JADX (https://bitbucket.org/mstrobel/procyon/wiki/Java%20Decompiler),这是一个完美的DEX反编译工具。

是的,它也可以在线(my:0))新网站:http://www.javadecompilers.com/apk/

Android逆向工程是可能的 . 按照以下步骤从apk文件中获取.java文件。

步骤1。使用dex2jar

从。apk文件生成。jar文件 命令:dex2jar sampleApp.apk

步骤2。使用JD-GUI反编译.jar

它会反编译。class文件,也就是说,我们会从apk中得到模糊的。java文件。

下载APK文件后,您需要执行以下步骤以获得可编辑的java代码/文档。

Convert your apk file to zip (while start your download don't go with "save" option , just go with "save as" and mention your extension as .zip) by doing like this you may avoid APKTOOL... Extract the zip file , there you can find somefilename.dex. so now we need to convert dex -> .class To do that, you need "dex2jar"(you can download it from http://code.google.com/p/dex2jar/ , after extracted, in command prompt you have to mention like, [D:\dex2jar-0.09>dex2jar somefilename.dex] (Keep in mind that your somefilename.dex must be inside the same folder where you have keep your dex2jar.) Download jad from http://www.viralpatel.net/blogs/download/jad/jad.zip and extract it. Once extracted you can see two files like "jad.exe" and "Readme.txt" (sometimes "jad.txt" may there instead of "jad.exe", so just rename its extension as.exe to run) Finally, in command prompt you have to mention like [D:\jad>jad -sjava yourfilename.class] it will parse your class file into editable java document.