To achieve code obfuscation, the method is as follows:
Because both my SDK and adt00000.1 are up-to-date, I have read the proguard. cfg obfuscation code method provided on the Internet,
. It is said that proguard. cfg will be automatically generated under the project file, but I cannot generate it, so I cannot use this method, which is a headache.
But today at the time of reading, found in fact under the project file, automatically generated the file: proguard-project.txt, project. properties two files, so is to open these two files, in proguard-project.txt has:
By default, the flags in this file are appended to flags specified
# In $ {sdk. dir}/tools/proguard/proguard-android.txt
If you open the proguard-android.txt file, it is found that the content is similar to the progurad. cfg mentioned above, and the estimation function is the same.
In the file project. properties, there are:
To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk. dir, user. home ):
# Proguard. config =$ {sdk. dir}/tools/proguard/proguard-android.txt: proguard-project.txt
Obviously, to use Proguard to confuse code, you just need to restore this annotation. # proguard. config =$ {sdk. dir}/tools/proguard/proguard-android.txt: proguard-project.txt.
But it cannot just restore the comments. After I try it, I only need to put this sentence proguard. config =$ {sdk. dir}/tools/proguard/proguard-android.txt: The proguard-project.txt is placed after target = android-10 to generate the apk.
Next, decompile the exported APK as follows:
In the generated jar file, all the class names and variable names are changed to a, B, c, and other names that cannot be correctly understood, achieving the expected results.
Author: Jason_WKS