Code confusion, third-party platform reinforcement and encryption, channel distribution of Android practical graphic tutorial
Step 1: code obfuscation (pay attention to the third-party jars introduced)
When creating a project with the new version of ADT, the mixed code files are no longer proguard.cfg, but project.properties and proguard-project.txt.
When creating a new project, the project.properties and proguard-project.txt files will be generated automatically. You don't need to create your own project. If your project can't be generated automatically, you need to check your ADT version
If global code mixing is required for the project, only one step is required:
In project.properties
"# Proguard. Config = ${SDK. Dir} / tools / Proguard / Proguard Android. TXT: Remove" # "of" Proguard project. TXT ".
If some codes cannot be confused, such as adding so files and calling the methods inside, the methods calling JNI to access so files cannot be confused. You may not report an error when exporting. However, when running on the mobile phone, when it needs to call the so file, it will report that the so and so method cannot be found. At this time, you need to use proguard-project.txt.
In the new version of code obfuscation, it has become very intelligent, but the introduced third-party jar still needs to write obfuscation rules manually
Case: Baidu LBS is introduced_ Android.jar and android-support-v4.jar
Proguard-project.txt scripting rules:
Step 2: 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. The export speed of APK with signature is slightly slow. Right click the item, select Android tools, and then export according to requirements
Step 3: third party platform reinforcement (generate multi-channel package)
Popular encryption platforms include:
http://www.bangcle.com
http://***
http://dev.360.cn/protect/welcome
If your project includes Baidu statistics, Youmeng statistics and other functions, you must know the download volume of different app stores, so it is very important to generate channel packages. These platforms can help generate multiple apks
The following figure shows that the project integrates Youmeng statistics using the "love encryption" platform
Reinforcement takes more than ten minutes. After reinforcement, you can download packages from different channels, but they are not signed and cannot be installed
Step 4: APK re signing
The strengthened APK is not signed. The unsigned APK cannot be installed in the mobile phone. It needs to be re signed with the signature tool
You can use ADT's own, but it is too troublesome. It is recommended to use a third-party signature tool
For example: http: / / * * * / apply / sign provided by love encryption