Proguard android Obfuscation
After obfuscation and packaging, it means that the project is coming to an end and the project is going to be launched. However, people are even more annoyed when encountering problems. I also recorded problems caused by obfuscation.
First, I packed the file in android4.0 to check whether the file exists in the project.
The license file, because it was developed and packaged in android4.0, does not need to write some commonly used keep that comes with android. We only need to write our own one. For example.
-Dontwarn org. dom4j. **-keep class org. dom4j .**{*;}
Because I have referenced a lot of jar packages like this, some obfuscation will cause problems and I will protect them from confusion, that is,-keep. Look at my file.
In this case, it is generally better, but the point is that many of us will use some frameworks like me to operate databases. In this case, the problem arises because your entity bean will be confused and there will be problems in database operations. Therefore, we must remember to avoid obfuscation of entity beans in our own projects, as shown below:
-Keep public class com. test. domain .**{*;}
Add the jar package under your own libs for the package name of your project.
-Libraryjars/libs/commons-codec.jar-libraryjars/libs/gson-2.2.4.jar-libraryjars/libs/guava-r09.jar-libraryjars/libs/imagelib. jar-libraryjars/libs/jackson-all-1.9.11.jar
Now it's okay. Just pack the signature directly.