Code obfuscation in Android development and android development Obfuscation
1. Start the obfuscation switch.
In the project. properties file under the project directory, it is named as the proguard. config tag. By default, it is disabled. Open it. 2. perform obfuscation Configuration
Perform specific obfuscation configuration in the proguard-project.txt file under the project directory. Right-click the project after configuration and select export to export the apk package. This apk package is a confusion package.
For example, the package name is com. test.
-Dontwarn org.*
-Keepattributes EnclosingMethod, InnerClasses
-Keepattributes * Annotation
-Keepattributes Signature
-Keepattributes SourceFile, LineNumberTable
# Configure classes without Obfuscation
-Keep class android. support.*{*;}
-Keep class com. test. model.*{*;}
# Configure non-obfuscation enumeration types
-Keepclassmembers enum *{*;}
# Configure member variables that are not obfuscated
-Keepclassmembernames class com. test. db. Table {
Public long *;
}
For more information, see: http://developer.android.com/guide/developing/tools/proguard.html
Linghaihua
How to encrypt or confuse code in Android development?
1. The public function of a specific class does not actually do anything. It only performs simple processing and then calls the private function. Proguard will not confuse some public functions of a specific class, so that they can be referenced by AndroidManifest. xml and various layout functions. 2. Classes referenced by AndroidMinifest. xml and layout will be placed in a shallow package, and classes to be hidden will be placed in a deeper depth, so that proguard can confuse the package name to bring benefits. If a package contains non-obfuscation content, the entire package name will not be confused. 3. sharding functions by function will also be helpful.
Your access failed