The android development code developed by many programmers is easily translated by hackers.
Google also seems to have discovered this problem. From SDK2.3, we can see that there is a proguard folder under android-sdk-windows \ tools \.
Proguard is a java code obfuscation tool. With proguard, even if you decompile your apk package, others will only see some ugly code to protect the code.
Add the following sentence to "default. properties" of the project: "proguard. config = proguard. cfg"
The. APK behind the package signature is obfuscated. In fact, we only need to do one step to add such a sentence "proguard. config = proguard. cfg" in "default. properties.
If you want to confuse the Code with greater complexity, you can configure the file in detail.
Because Apple developed Android virtual machines, it has certain specifications. After the apk is encrypted, Dalvik cannot recognize the apk. It is impossible to avoid it completely. Someone can always crack your code. But there are several
To improve the difficulty of code decompilation:
1 key ipad development code uses jni to call local code and is written in c or c ++, so it is relatively difficult to decompile
2. obfuscated java code. Obfuscation adds or renames useless code without changing the code logic, making it difficult to understand the decompiled source code.
There are many obfuscation tools for open-source Apple code development on the Internet, which are usually compiled using ant.
-Injars androidtest. jar [Address of the jar package]
-Outjars out [Output address]
-Libraryjars 'd: \ android-sdk-windows \ platforms \ android-9 \ android. jar '[jar of the referenced library, used to parse the jar class specified by injars]
-Optimizationpasses 5
-Dontusemixedcaseclassnames]
-Dontskipnonpubliclibraryclasses [specify not to ignore non-public library classes. ]
-Dontpreverify [no pre-verification]
-Verbose
-Optimizations! Code/simplification/www.lekolite.cn /*,! Class/merging/* [optimization]
-Keep public class * extends android. app. Activity [unchanged without obfuscation]
-Keep public class * extends android. app. Application
-Keep public class * extends android. app. Service
-Keep public class * extends android. content. BroadcastReceiver
-Keep public class * extends android. content. ContentProvider
-Keep public class * extends android. app. backup. BackupAgentHelper
-Keep public class * extends android. preference. Preference
-Keep public class com. android. vending. licensing. ILicensingService
-Keep public abstract interface com. asqw. android. Listener {
Public protected; [do not confuse all methods]
}
-Keep public class com. asqw. android {
Public void Start (java. lang. String); [do not confuse this ipad development method]
}
-Keepclasseswithmembernames class * {[Protect the name of the specified class and class member. If all specified class members are present (after the compression step )]
Native;
}
-Keepclasseswithmembers class * {[protects the members of the specified classes and classes for Apple development, but the condition is that all specified classes and class Members must exist .]
Public (android. content. Context, android. util. AttributeSet );
}
-Keepclasseswithmembers class *{
Public (android. content. Context, android. util. AttributeSet, int );
}
-Keepclassmembers class * extends android. app. Activity {[protect members of the specified ipad development category. If they are protected, they will be better protected]
Public void * (android. view. View );
}
-Keepclassmembers enum *{
Public static ** [] values ();
Public static ** valueOf (java. lang. String );
}
-Keep class * implements android. OS. Parcelable {[Protect specified class files and class members]
Public static final android. OS. Parcelable $ Creator *;
}
The above problems may not block hackers from reverse deciphering, but there is no doubt that the effect is remarkable.