I. What have code obfuscation been done?
1. code obfuscation is usually used to remove unnecessary Code. It is used to rename classes, attributes, and methods with obscure names to reduce the size of the Code, increase the difficulty of decompilation. (If our applications are charged or kept confidential, we need to improve the security of our code through code obfuscation)
2. Enable ProGuard in Eclipse
1. Check whether the proguard folder exists in the Android SDK directory.
For example, my own D: \ Environment \ android-sdk-windows \ tools \ proguard
2. Configuration
1) Check whether proguard exists in the root directory of the project. cfg file. If it does not exist (indicating that the current project is a project earlier than 2.3), you need to create a 2.3 android project from which proguard. copy the cfg file to the root directory of your project without any changes (unless you understand how to customize your obfuscation Policy). Continue with the following steps.
2) If yes, find default in the root directory of the project. properties [if you are using ADT14 or a later version, there is no default in the project. properties file, only project. properties file, find the project. properties file] File, add a configuration in the file: proguard. config = proguard. cfg
This completes the configuration, isn't it easy. In the future, this project APK packaged using Eclipse will be confused. The following three, four, and five are some error solutions and detailed documents.
Iii. Possible Errors
1. the following error may occur during APK packaging:
Conversion to Dalvik format failed with error 1
Solution:
Open proguard. bat in the Android SDK installation directory and modify the following:
Call % java_exe %-jar "% PROGUARD_HOME %" \ lib \ proguard. jar % *
Change
Call % java_exe %-jar "% PROGUARD_HOME %" \ lib \ proguard. jar % 1% 2% 3% 4% 5% 6% 7% 8% 9
4. Open-source code obfuscation tool ProGuard
1. project documentation: (if you want to customize your own obfuscation policies, you should understand them here)
Http://proguard.sourceforge.net/index.html#manual/introduction.html
5. Integrate the ProGuard tool in Android to implement code obfuscation
1. Android ProGuard User Guide
Guide for windows:
Android-sdk-windows/docs/guide/developing/tools/proguard.html
Location in Google online DevGuid:
Http://developer.android.com/guide/developing/tools/proguard.html
Excerpt from sunk silence