Use proguard to confuse jar packages created by Android Projects

Source: Internet
Author: User

Obfuscation file writing: Save As. Pro File

-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: [classes of different types are not generated during obfuscation]

-Dontskipnonpubliclibraryclasses [specify not to ignore non-public library classes. ]

-Dontpreverify [no pre-verification]

-Verbose

-Optimizations! Code/simplification/arithmetic ,! Field /*,! 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 <Methods>; [do not confuse all methods]

}

-Keep public class com. asqw. Android {

Public void start (Java. Lang. String); [do not confuse this 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 <Methods>;

}

-Keepclasseswithmembers class * {[protect the members of the specified class and class, but the condition is that all specified Class and Class Members must exist .]

Public <init> (Android. content. Context, Android. util. attributeset );

}

-Keepclasseswithmembers class *{

Public <init> (Android. content. Context, Android. util. attributeset, INT );

}

-Keepclassmembers class * extends Android. App. Activity {[protect members of a specified class. If this class is protected, it 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 *;

}

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.