Android APK Anti-compilation

Source: Internet
Author: User

Test environment:

Win 7

Using tools:

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 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).

and then in the previous You can find 2 more folders under the 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

change the name of the apk suffix you want to decompile to. rar or. zip, and unzip to get the amount The classes.dex file ( which is the Java file compiled and then packaged with the DX tool ), will get the Classes.dex put it in the dex2jar-0.0.9.15 folder of the tool that was extracted before ,

at the command line, navigate to the Dex2jar.bat directory, enter Dex2jar.bat classes.dex, the effect is as follows:

the directory will generate a Classes_dex2jar.jar file, then open the tool Jd-gui folder in the jd-gui.exe, then use the tool to open the classes_dex2jar.jar file generated before, 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):



Android APK Anti-compilation

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.