To decompile android apk on Mac OS system, the following 3 files need to be prepared first:
1, apktool:https://ibotpeaches.github.io/apktool/install/
2, Dex2jar:https://github.com/pxb1988/dex2jar
3, jd-gui:http://jd.benow.ca
Once downloaded, it's time to start our anti-compilation path:
1, install Apktool: Will download the Apktool.jar and apktool.txt (may not download the name can be modified), apktool.txt need to save the name of Apktool (do not need sh and txt suffix) can execute the following command:
Touch Apktool
Cat Apktool.txt >> Apktool on the line
Then move the shell scripts Apktool and Apktool.jar to the/usr/local/bin folder
Sudo-s
MV Source Files/usr/local/bin
Then execute the APKTOOL-V command: The following prompt indicates success
2, Dex2jar and Jd-gui decompression can be;
3. Execute command apktool d apk file: if
The following are the generated folders:
This folder can be seen in the APK resource files, tablets, XML files and so on, if you just need to get pictures and other resource files so here, to get further Java code, you need to use the Dex2jar and Jd-gui tools.
1, to get Java code will be back to compile (Apktoo can be decompile and back to compile), the main is to obtain the Classex.dex file.
Run command: Apktool B to decompile the generated folder
Such as:
The build folder is generated:
Where the Classes.dex file is what we need, different apk will generate a different number of classes.dex files, look at size and split up.
2. Now we need to use our Dex2jar tool.
D2j-dex2jar.sh and d2j_invoke.sh Add run permissions:
chmod +x d2j-dex2jar.sh
chmod +x d2j_invoke.sh
Then run the command./d2j-dex2jar.sh apk, such as
Then you can see the Classes-dex2jar.jar file in the Dex2jar folder, this is the final Java file, so what do we think, this will use the download of our Jd-gui.
3. Open the Jd-gui tool and drag the Classes-dex2jar.jar into it as shown below:
Finally finished!!
Mac Android APK anti-compilation