Code obfuscation for Android apk and export jar package

Source: Internet
Author: User


Like Android developed in the Java language, it is easy to be compiled by others, the equivalent of a bare-Ben, especially for commercial purposes, to prevent anti-compilation is necessary measures. Code obfuscation is a good way to prevent anti-compilation.

1, the code of the APK is confused.

In the Eclipse development environment, use the proguard obfuscation tool that comes with the android SDK .

The main use of the red box in the two files.

In the project.properties file, you specify the confusing file.

Then, the detailed proguard-project.txt is written as follows:

-dontwarn is to let the specified package name do not prompt the warning

-libraryjars is to specify that third-party packages are imported, not to participate in confusion

And look at the third-party package I imported:

OK, all of these preparations are OK, so start exporting the APK . Note that the usual debugging time is not to confuse the code, remember not to directly copy/bin directory APK released Oh. To export the APK 's specific process:

Right--> Export------>

I use a keystorenow, of course you can also create a new one, this is very easy.


Then enter a password for alias



Select the target directory of the APK store, click Finish, you can see the APK in the specified directory .

But if your proguard-project.txt configuration is not well-written, here's the following: (I've blocked a sentence)

When you click Finish , the error will appear:


after OK, you can look at, confuse before and after similarities and differences:


2, the Android project export JAR Package confusion.

I am the reference:http://www.cnblogs.com/rayray/p/3421028.html

In fact, with the Android SDK in the proguard, located in the directory android-sdk-windows\tools\proguard\ under the bin proguardgui.bat. Double-click to start

You can load a configuration file that already exists, or click Nextto create a new one.



Complete confusion! If it is an error at this time, you can first save these configuration files, directly modify the file can be.


Then we can look at the effects before and after the confusion.



Word documents can be downloaded directly to save: http://download.csdn.net/detail/yanyuanfen2011/7593991



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.