(reprint) Anti-compilation Android APK file step

Source: Internet
Author: User

The following method I have tried, completely can succeed, focus on the steps I'm here to say

1. Must have a Java environment, remember to configure environment variables

2. If you view only the function files in class, you only need to download Dex2jar and Jd-gui

3.

Dex2jar:http://code.google.com/p/dex2jar/downloads/list

Jd-gui:http://dl.iteye.com/topics/download/b99d0351-87d8-3ed1-a875-441e0eea0ce4

I believe many developers are aware of the anti-compilation apk, under normal circumstances, if we want to look at XML, look at the Java source code, is not to be seen. Using the compression tool to extract the APK files are also binary files, open after all is garbled.

Developers can use only the image resources, which often can not meet the needs of developers.

Below I will give you a detailed explanation of ANDROID-APK's anti-compilation steps:

Note: The premise of Anti-compilation is that the developer does not use Proguard (Java Code obfuscation tool).

1. Download the Anti-compilation tool

Four tools to download: Dex2jar, Jd-gui, Apktool, Apktool-install-windows-r05-ibot

Dex2jar: Converts the Classes.dex in the apk into a jar file.

Jd-gui: The Anti-compilation tool allows you to view the source code of the jar package directly.

Apktool: The anti-compilation tool can be viewed directly by deserializing the APK in the XML file.

Apktool-install-windows-r05-ibot: Secondary Windows Batch processing tool.

Dex2jar:http://code.google.com/p/dex2jar/downloads/list

Jd-gui:http://code.google.com/p/innlab/downloads/lis

Apktool:http://code.google.com/p/android-apktool/downloads/list

Tools:

2. Unzip APK Package

The APK file is also a common zip, and the usual compression software makes it easy to unzip the apk file. Use the compression software to extract the files in the APK file into a folder, get the resources in the APK including the XML file and the Classes.dex file, Classes.dex is the Java file compiled and then packaged with the DX tool.

Extract:

3. Anti-compile Dex file

After extracting the APK file, you will find the Res directory image is not encrypted, but the Java source code compiled into a classes.dex file, can not be used in normal anti-compile class file method to process, Dex2jar to convert the Dex file into a normal jar package.

Unzip the downloaded Dex2jar, put the extracted folder into the system disk and directory and add this directory to the system path variable, you can directly use: Dex2jar.bat or dex2jar.sh to convert the Dex file.

The DOS line command is as follows: Dex2jar.bat Xx\classes.dex (xx is the path where the Classes.dex file is located).

You will get the normal jar package in the same directory: Classes_dex2jar.jar, you can use the normal Jar package method to decompile the jar package to get the original file.

Compile:

The following are the generated jar files:

4. Anti-compilation jar package

After getting the jar package, download your favorite anti-compilation tool, recommend using Jd-gui, there is a relatively simple graphical interface, you can decompile a single class file, you can also decompile the jar package, more convenient.

Open the compressed file Jd-gui, run Jd-gui.exe, open the jar package generated above, you can see the source code.

As follows:

5. decompile the XML file

Open the extracted res\layout directory, there are many XML files, if you want to see how the author design the interface, you will be very disappointed, because you see a lot of garbled! What we need to use at this time is apktool.

How to do: Extract the downloaded Apktool and Apktool-install-windows-r05-ibot two packages to the same folder, this file folder has three files: Aapt.exe,apktool.bat,apktool.jar. Put this folder in the root directory of the system disk and add the directory to the PATH variable. Take helloword.apk as an example:

On the DOS command line, enter: Apktool D xx\helloword.apk Helloword get the Helloword folder, the XML file in this folder is a compiled file that can be viewed normally.

As follows:

Generated files:

This gives the source code and XML resources that can be compiled.

Note: The path of the file is best not to appear in Chinese!

(reprint) Anti-compilation Android APK file step

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.