Android Anti-compilation

Source: Internet
Author: User

Common Anti-compilation methods:
1. Change the. apk to. zip or. rar with winrar pressure to get Classes.dex file first
2. Use the Dex2jar tool to convert. Dex to. jar, and then use Jd-gui to open the. jar to view the source file.

Command:dex2jar.bat Classes.dex

Code obfuscation:
1. Can compile after confusion, just the class name, function name look not so clear.
2. Set the configuration file path in the root directory under Project.Properties.
Proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt (the former is a basic file, the latter is a personalization file)
APK is generated in 3.release mode.

Unzip the APK package, the Res directory of XML how to view it. Open with Text tool is garbled.
Using Axmlprint2.jar to decompile XML, error (Java.lang.ArrayIndexOutOfBoundsException)
Cause of error: Androidmanifest.xml android:minsdkversion cannot be greater than 7
Build with Android:minsdkversion changed to 7 or less, you can use Axmlprint2.jar to decompile.

Command:java-jar Axmlprint2.jar Main.xml >main.txt


Baksmali.jar classes.dex to Smali formatted files (under the Classout folder) and make changes where needed.
Smali.jar these modified Smali files to. dex files. Overwrite the original. dex file, and then package it as an apk. (You can also use Dex2jar to call it a jar package)

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.