找到Android 软件安装包中的class.dex:
把apk文件改名为.zip,然后解压缩其中的class.dex文件,它就是java文件编译再通过dx工具打包成的。
工具准备:
1、把dex文件反编译为jar文件的工具。(dex2jar)
2、把jar反编译为java的工具。(JD-GUI)
jd-gui-0.3.2.windows.zip
|
Size : 685.83 KB
MD5 checksum : a515eb2a360b62b21ab93b3b0a0adf6bjd-gui-0.3.2.linux.i686.tar.gz
jd-gui-0.3.2.linux.i686.tar.gz
Size : 967.11 KB
MD5 checksum : fc4765536d2730774ce53e33a2f2aeefjd-gui-0.3.2.osx.i686.dmg
jd-gui-0.3.2.osx.i686.dmg
Size : 1.58 MB
MD5 checksum : 4c9c06fbb8599ece8a8ff00a48a33735
Changes
反编译步骤:
1、把class.dex拷贝到dex2jar.bat所在目录。运行dex2jar.bat class.dex(linux下使用./dex2jar.sh class.dex),生成classes.dex.dex2jar.jar。
2、运行JD-GUI工具(它是绿色无须安装的),打开上面的jar文件,即可看到源代码。
----------------------
Java decompiler
-
JD-Core, JD-Eclipse http://java.decompiler.free.fr/?q=jdeclipse
- for mac/linux: 2 steps, decompile into src zip, then attach to the jar in the eclipse library path
-
- jar (or zip) all the classes you want decompiled together.
- Launch JD-GUI and open your jar (zip) archive.
- Use "File" - "Save All Sources" menu option. It will decompile all classes from your archive and save their sources into another zip file.
- you can add a 'source attachments' to a JAR. You must have the source of your JAR in a zip orjar archive as well.
-
- Select the project, in the context menu select Properties -> Java Build Path
- - Go to the library page, select your JAR, press 'Attach Source...
-
-