Decompile apk for Mac to obtain resource files and source code.
Preparations
- Download decompilation tools apktool and dex2jar
- Jar viewing tool jd-gui for mac
: Http://download.csdn.net/detail/linsen618/8668209
1. decompile the contributed source file
- Open the terminal cd to the directory where apktool is stored (you can use ls to view the folder under the current directory, and then keep searching for cd to apktool)
- Enter chmod + x apktool and modify apktool to be executable.
- Input./apktool d xx.apk for decompilation
2. decompile the source code
- Change the suffix of the APK file to. Zip and decompress it. Obtain the classes. dex file, which is compiled by the java source code and packaged by the dx tool.
- Copy the classes. dex file to the folder where dex2jar is located.
- Terminal cd to the dex2jar directory and run sh dex2jar. sh classes. dex
- Generate classes_dex2jar.jar
- Open the source code in jd gui.
- Click jd-gui-0.3.5.osx.i686.dmg to open jd gui
- Drag classes_dex2jar.jar to jd gui to view the source code.