Proguard android Obfuscation

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.