In learning the process of Android development you, you tend to learn how other people's application is developed, those beautiful animations and exquisite layout may let you put it down, as a developer, you may want to know how these effects interface is to achieve, at this time, You can then reverse-compile the app's apk. Here is a brief tutorial on some of the articles I've consulted.
(Note: Anti-compilation is not to let developers go to an application to solve the heavy load of what, the main purpose is to promote the developers to learn, learn from good code, improve the level of self-development. )
Test environment:
Win 7
Using tools:
On CSDN:
Apktool (resource file acquisition) Download
Dex2jar (source file acquisition) download
Jd-gui (source view) Download
Android Anti-compile Integration Toolkit (latest) download
Official Latest Version:
Apktool (google code)
dex2jar(google code)
Jd-gui (google Code) the latest version, see the official
Tool Description:
Apktool
Function: Resource file gets, can extract picture file and layout file for use view
Dex2jar
Role: Decompile the apk into Java source code (Classes.dex into a jar file)
Jd-gui
Role: View the apk in the Classes.dex converted into a jar file, namely the source file
Anti-compilation process:
First, APK anti-compilation to get The program's source code, pictures, XML configuration, language resources and other files
Download the Apktool in the above tool, extract the 3 files: Aapt.exe,apktool.bat,apktool.jar, will need to put the anti-compilation apk file in this directory,
Open the Command line interface (run-cmd) , navigate to the Apktool folder, and enter the following command:apktool.bat d-f test.apk test
(test.apk in the command refers to the full name of the APK file to be deserialized, and test is the directory name that is stored in the post-compilation resource file, i.e.: Apktool.bat d-f [apk file] [output folder])
After the description is successful, you find that you have more than one test file under the folder and click to view all the resource files for that app.
If you want to repackage the anti-compiled files into an apk, you can: Enter apktool.bat B Test(you compiled the folder), the effect is as follows:
After that, you can find 2 more folders under the previous test file:
Build
Dist (contains the packaged apk file)
Second, APK anti-compilation to get Java source code
Download the Dex2jar and Jd-gui in the tools above , unzip
To decompile the APK suffix name to. rar or. zip, and unzip, get the amount of the Classes.dex file (it is the Java file compiled and then packaged by the DX tool), will get to the Classes.dex put it in the dex2jar-0.0.9.15 folder of the tool that was extracted before,
Under the command line to locate the Dex2jar.bat directory, enter Dex2jar.bat Classes.dex, the effect is as follows:
A Classes_dex2jar.jar file is generated under the directory , and then the Jd-gui.exe in the tool Jd-gui folder is opened, and then the Classes_ that was generated before the tool is opened. Dex2jar.jar file, you can see the source code, the effect is as follows:
(The name of the class file and the name of the method inside will be a,b,c ...). Style name):
Three, graphical anti-compilation apk (I have not used)
Step one or two above describes the command-line anti-compilation apk, which now provides a graphical anti-compilation tool: Androidfby
First, download the Anti-compilation toolkit above, open the Androidfby directory, double-click the Android Anti-compilation tool,. exe, you can browse to open the apk you want to decompile
With the anti-compilation, you can learn what the application uses for the 3rd-party library file, how its code is written, and so on.
However, if the APK is obfuscated, then the name of the class file you see and the name of the method inside will be a,b,c .... Style naming, so you can find that you want to know the interface code may be very laborious, found the code may seem to be very laborious, but a general idea will be obtained, with this idea, you can try it yourself.
I once wanted to write a similar to sing the celebrity interface layout, but the first contact did not know how to write, into the anti-compilation, even if his code is confused, I also see that he is through the ListView type set different item layout implementation. There may be a lot of references to use rewrite view to achieve the effect, you can get his general ideas for your development benefit harmless.
There is also a developer who has worked hard to develop their own applications to be one of the other anti-compilation becomes his own things, so to be confused:
Here are some of the confusing tutorials I reproduced: http://blog.csdn.net/zhangli_/article/details/50608873
Android APK anti-compilation is so simple and detailed (drawings)