An analysis of Android anti-compilation
From the touch of Android development and Development, anti-compilation has always been inseparable from the tool, learning good Android application code writing specifications.
This article is mainly about how to decompile the APK file to get Java files, anti-compilation not to steal, only for learning the exchange code. The directory structure for this article is:
1. Overview
2. A detailed story about the APK project's anti-compilation
Overview:
Analysis of the directory structure of Android engineering can be known, it basically can be easily understood as three parts: source code, resource files and compiled configuration files. This resource file (image, XML file, assert, etc.) is stored directly in the APK from the beginning of packaging, picture, etc. without anti-compilation, source code (temporary access to Java source code) file is likely to be "confused" to prevent others to decompile, The confusing file is stored in the config file Ant.properties file, and the configuration file, mainly the Androidmanifest.xml file, is directly exposed, which is critical. Obtaining the XML File box source code becomes the most important task of anti-compilation.
The following is a detailed account of the APK project anti-compilation one, using the compilation tool
I am also directly from the Internet to download the Anti-compilation tool, the use of good results, here: http://download.csdn.net/detail/feishangbeijixing/8094335
1, Apktool, get the XML file
2. Android Anti-compilation tool
Ii. Commencement of work
A) Apk--> Project catalogue
This step is relatively simple, primarily to get androidmanifest.xml files, dex files, layout files, and resource files. There are two ways to achieve this:
1. Unzip the APK directly
In this case, the APK project without "confusing" can directly get the XML file (directly readable) and the Dex file; But the XML file in the "confusing" apk project file does not seem to be readable directly (garbled display)
2. Using Apktool Tools
How to use: First unzip the Apktool, in the APK folder directory to place the APK file needs to be unzipped and renamed to 123.APK. Double-click the Apktool file (which is actually a script file for Windows, which can be run in Dos), and then, after clicking on it, perform the decompile or back-compilation as shown.
b) dex--> Source code
There is a previous step to get the Dex file (in the previous step directly decompression may not get the Dex file, tried several times seems to be so)
Using the Dex2jar.bat tool in the Android Anti-compilation tool, Location: Android Anti-compilation tool Android anti-compile \dex2jar-0.0.9.15.
1, execute the command: Dex2jar.bat Classes.dex (before executing the command, you need to put the Classes.dex file into the dex2jar-0.0.9.15 folder, after executing the command can get Classes_dex2jar files)
2. Use the Jd-gui tool to view the Class-dex2jar package files obtained in the previous step. We can see the source.
3, anti-compilation can be viewed and modified without the "confusion" of the source. Then you can use the "your" apk app by compiling and signing the Apktool back and forth.
An analysis of anti-compilation of Android