Android decompilation and prevention of Decompilation

Source: Internet
Author: User

Android is based on Java, and Java decompilation tools are powerful, so it applies to normal APK applications.ProgramIt can basically achieve 100% decompilation and restoration.

Therefore, if developers do not prepare their own open-source projects, they need to know how to prevent decompilation and decompilation from others' projects.

eclipse automatically generated default. properties Add" proguard. config = proguard. CFG "can be used for code obfuscation is difficult to understand after decompilation.

2.3 previous SDK the version does not matter either, set proguard. CFG copy the file to the project and perform the same operation.

After some applications are decompiled, Java code cannot be opened using JD-ui, and even obfuscation Code cannot be seen. I have tried multiple times and want to know how to handle it. 

Note: The above function only obfuscated Java code. xml and resource files and images are not obfuscated. Some game application images are important and need to be converted to DAT files plus their own encryption and decryption.AlgorithmRestore.

In addition, after the obfuscation function is added, there is a compression function. The APK after obfuscation is smaller than the original one (the specific proportion depends on the amount of code repeat)

 

After that, let's talk about how to decompile the program.

Let's talk about the decompilation process and principle:

1. Use apktool to change the APK --> resource package (the Java code becomes invisible to the smali file). You can modify the files in the resource package.

2.apk suffix name changed to zip or RAR decompress, get classes. dex file, which is converted into a jar package using dex2jar (Note: directly decompressed resource files cannot be opened directly. Use the decompilation tool in step 1 ).

3. Use Java decompilation tools such as JD-UI to directly view Java code.

4. Integrate the Java code with the first version of the resource package to form a new application.

5. Use apktool to re-compile.

6. Use the signature tool to re-sign.

7. re-release the application with the new signature.

Note: If you do not need to change the Java code, you do not need to change the style and the Chinese version 2.3.4 step.

 

Open-source projects on Google Code

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

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

In addition, someone made a tool set and integrated apktool dex2jar JD-UI. However, after downloading and running, I don't know if the environment is not paired.

Hackapk http://code.google.com/p/hackapk/

In addition, someone encapsulated apktool into an EXE file and made it easy to use the GUI. Let's take a picture and show it to you.

Note: If the software above cannot be signed, use another software (apksign) to sign the signature, as shown below:

In addition, the download and connection of the above two tools are provided on the Apsara stack forum. It is estimated that you cannot directly click the connection to download the tool.

xwindows, graphic interface: apktool.rar (3.33 MB) --> download the latest version of apktool from the http://code.google.com/p/android-apktool. replace jar with the original one.

Signature tool:Auto-sign.rar(312.45 KB)

In addition, there are some command line tools that I have provided to the APK editor for different versions. The above descriptions do not waste a lot of time.

1. Common APK files (third-party software downloaded from various websites)

(1) Put it in the place-APK-here-for-modding folder. (If there is no space or Chinese, convert Chinese to English (2) Open script.exe and enter 22 or 23 (set the current project) , Select the ID of the APK file to be edited, and press enter to confirm

 

Above: Some versionsSet the current project option to 23,It indicates that the file has not been changed, and APK cannot be selected for press 22 for a long time. The reason is not easy to find.

We recommend that you use the graphic interface.

URL: http://greatverve.cnblogs.com/archive/2012/01/30/android-apktool.html

 

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.