Android obfuscation Packaging

Source: Internet
Author: User
Modify the project. properties File

[HTML]
View plaincopyprint?
  1. # Proguard. config =$ {SDK. dir}/tools/proguard/proguard-android.txt: proguard-project.txt

Remove the previous #, that is, cancel the annotation.


Modify the proguard-project.txt file (ignore third-party jar files)

Introduce third-party libraries:

-Libraryjars/libs/umeng_sdk.jar

Ignore class:

-Keep class com. umeng .**{*;}

[Java]
View plaincopyprint?
  1. -Optimizationpasses 7
  2. -Dontskipnonpubliclibraryclasses
  3. -Dontskipnonpubliclibraryclassmembers
  4. -Dontpreverify
  5. -Verbose
  6. -Allowaccessmodification
  7. -Repackageclasses
  8. -Dontusemixedcaseclassnames
  9. -Dontoptimize
  10. -Keep public class * extends Android. App. Activity
  11. -Keep public class * extends Android. App. Application
  12. -Keep public class * extends Android. App. Service
  13. -Keep public class * extends Android. content. broadcastreceiver
  14. -Keep public class * extends Android. content. contentprovider
  15. -Keep public class * extends Android. App. Backup. backupagenthelper
  16. -Keep public class * extends Android. Preference. Preference
  17. -Keep public class com. Android. Vending. Licensing. ilicensingservice
  18. -Libraryjars/libs/umeng_sdk.jar
  19. -Keep class com. umeng .**{*;}
  20. -Keepclasseswithmembernames class *{
  21. Native <Methods>;
  22. }
  23. -Keepclasseswithmembers class *{
  24. Public <init> (Android. content. Context, Android. util. attributeset );
  25. }
  26. -Keepclasseswithmembers class *{
  27. Public <init> (Android. content. Context, Android. util. attributeset, INT );
  28. }
  29. -Keepclassmembers class * extends Android. App. Activity {
  30. Public void * (Android. View. View );
  31. }
  32. -Keepclassmembers Enum *{
  33. Public static ** [] values ();
  34. Public static ** valueof (Java. Lang. String );
  35. }
  36. -Keep class * implements Android. OS. parcelable {
  37. Public static final Android. OS. parcelable $ creator *;
  38. }

Configure obfuscation and finally package the project:

Source: http://blog.csdn.net/vestigge/article/details/8551918

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.