The first step: code obfuscation (note the introduction of the Third-party jar)
When you create a project in a new version of ADT, the files for the mixed code are no longer proguard.cfg, but Project.Properties and Proguard-project.txt.
When you create a new project, you automatically generate project.properties and proguard-project.txt files without creating your own, and if your project is not automatically generated, then you need to check your ADT version.
If you need to make a global mix of items, you only need to do one step:
Will project.properties in the
The "#" of "#proguard. Config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt" can be removed.
If some code can not be confused, such as the need to join the so file, you need to call the method inside, then invoke JNI access to the so file method can not be mixed code. When exporting, you may not have an error. However, when running on a mobile phone, you need to call the so file, you will report that certain methods can not be found. This time you need to use Proguard-project.txt.
In the new version of the code confusion, has become very intelligent, but the introduction of third-party jars or need to manually write obfuscation rules
Case: Introduction of Baidulbs_android.jar,android-support-v4.jar Two packages
Proguard-project.txt Script Writing rules:
Copy Code code as follows:
#工程中含有第三方jar包
-libraryjars Libs/android-support-v4.jar
-libraryjars Libs/baidulbs_android.jar
#项目里面包含的包也不能混淆
-keep class com.baidu.** {*;}
-dontwarn com.baidu.**
-keep class vi.com.gdi.bgl.android.java.** {*;}
-dontwarn vi.com.gdi.bgl.android.java.**
-keep class android.** {*;}
-dontwarn android.**
Step Two: Export apk (some Third-party encryption platforms need to export signed apk)
Please export APK according to the requirements of the third party encryption platform, and the APK with the signature is slightly slower to export. Right-click the item select Android Tools and then export according to requirements
Step three: third-party platform reinforcement (multi-channel package generation)
Now the more popular encryption platform is:
Http://www.bangcle.com
http://***
Http://dev.360.cn/protect/welcome
If your project contains Baidu statistics, friendship League statistics and other functions, then certainly need to understand the different application store downloads, so it is important to generate channel packs. These platforms can help generate multiple apk to the
The following figure is the use of the "Love Encryption" platform, the project integration of the Friendship Union statistics
It takes more than 10 minutes for the reinforcement to be downloaded to a different channel package after the reinforcement is completed, but there is no signature and cannot be installed
Step Fourth: apk re-sign
The reinforced apk is unsigned, unsigned apk cannot be installed in the phone, and signature tools are required to re-sign
You can use ADT, but it's too troublesome to use a Third-party signature tool
For example: Love encryption provides the Http://***/apply/sign