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