Overview:
In fact, anti-compilation is very simple, just use some toolkits and some basic command-line commands to reverse-program the APK file, there is no advanced technology. Let's take a look at the anti-compilation techniques.
Note: This blog anti-compilation method, only for reference study use, prohibited for illegal and commercial and other uses, thank you!
preparatory work:
Download the following anti-compilation toolkit:
1.apktool:http://download.csdn.net/detail/vipzjyno1/7025111
2.dex2jar:http://download.csdn.net/detail/vipzjyno1/7025127
3.jd-gui:http://download.csdn.net/detail/vipzjyno1/7025145
To decompile the apk file: helloworld.apk
Tool Function Description:
Apktool: Resource file gets, can extract picture file and layout file for use view
Dex2jar: Decompile The APK to Java source (Classes.dex into a jar file)
Jd-gui: View apk in Classes.dex converted into a jar file, namely the source file
anti-compilation process:1. Access to resources and resource files:
We use Apktool to obtain resources and resource files.
(1) First put the files we want to decompile into the Apktool directory.
(2) Then switch the operation directory to Apktool under CMD. For example, my operating directory is as follows:
(3) Input anti-programming command: Apktool.bat d-f helloworld.apk HelloWorld
This anti-compilation process will have the following correct procedure:
After the decompile is complete, a HelloWorld directory is generated under the Apktool directory:
Open this directory and we can clearly see the results of the anti-compilation, as follows:
To the end, the operation to obtain the resource and resource files has been completed. Let's take a look at how to decompile and get Java source code.
2. Get the Java file:
Getting Java source files can be a bit of a hassle, as this process requires two toolkits--dex2jar and Jd-gui.
1th Step: Rename helloworld.apk to Helloworld.rar or helloworld.zip and so on can unzip the file.
2nd Step: Extract this file to the HelloWorld folder and get the Classes.dex file
3rd step: Put the Classes.dex file in the Dex2jar directory, and switch to the working directory Dex2jar, enter the command: Dex2jar.bat classes.dex
4th step: A Classes_dex2jar.jar file is generated after the 3rd step is completed
It was only one step away from success when we got here.
5th step: Open the Jd-gui directory under the Jd-gui.exe file, open the Classes_dex2jar.jar file just generated-- view Source
Reference:
http://blog.csdn.net/vipzjyno1/article/details/21039349
Anti-compilation of APK in Android