Some knowledge about the Proguard.flags

Source: Internet
Author: User

First, what is Proguard?

Proguard is a free Java class file compression, optimization, and obfuscation.

It detects and removes unused classes, fields, methods, and properties, it removes unused instructions and uses bytecode to get maximum optimizations, and it uses meaningless names to rename classes, fields, and methods.

Second, why use Proguard?

1. Optimized application: Create compact code documents for faster network transmission, fast loading and smaller memory consumption;

2, prevent reverse: Create the program and library difficult to use reverse engineering;

3, Pre-processing application: Make full use of the advantages of JAVA6 fast loading to detect and return the class files in JAVA6 in advance.

Iii. What are some of the parameters available?

1.-include {filename} reads configuration parameters from the specified file

2.-basedirectory {directoryname} specifies the base directory for later relative files

3.-injars {Class_path} Specifies the directory of the application Jar,war,ear to be processed

4,-outjars {Class_path} Specifies the name of the Jar,war,ear directory to output after processing

5.-libraryjars {Class_path} specifies the library files required for the application Jar,war,ear and directories to be processed

6, dontskipnonpubliclibraryclasses specifies not to ignore the non-public library class

7. dontskipnonpubliclibraryclassmebmbers specifies not to ignore members of the Visible library class

Iv. what are the retention options?

1.-keep {Modifier} {class_specification} protects the specified class file and members of the class

2.-keepclassmembers {Modifier} {Class_specification} Protects members of the specified class, and if this class is protected they will be better protected.

3.-keepclasseswithmembers {class_specification} protects the members of the specified class and class, but the condition is that all the specified classes and members of the class are to exist

4.-keepnams {Class_specification} protects the members and names of the specified class (if they are not deleted during compression)

5.-keepclassmembernames {class_specification} protects the names of members of the specified class (if they are not deleted during compression)

6.-keepclasseswithmembersnams {class_specification} protects the name of the specified class and class member if all the specified class members are present (after compression)

7.-printseeds {filename} lists the list of class and class member-keep options, standard output to the given file

Five, compression

1, Dontshrink does not compress the input class file

2. printusage {filename}

3. whyareyoukeeping {class_specification}      

Vi.. Optimization

1,-dontoptimize does not optimize the input class file

2.-assumenosideeffects {class_specification} optimization assumes the specified method, without any side effects

3. Allow access to and modify members of classes and classes with modifiers when-allowaccessmodification is optimized

VII. Confusion

1,-dontobfuscate does not confuse the input class file

2.-printmapping {filename}

3.-applymapping {filename} reuse mappings Add confusion

4.-obfuscationdictionary {filename} uses the keyword in the given file as the name of the method to be confused

5,-overloadaggressively confusion when applying intrusive overload

6,-useuniqueclassmembernames to determine the uniform confusion class member name to increase the confusion

7.-flattenpackagehierarchy {package_name} repack all renamed packages and place them in a given single package

8.-repackageclass {package_name} repack all renamed class files in a given single package

9,-dontusemixedcaseclassnames Confusion will not produce a variety of class names

10.-keepattributes {attribute_name,...} Protects the given optional attributes, such as linenumbertable, Localvariabletable, sourcefile, Deprecated, synthetic, Signature, and innerclasses.

11,-renamesourcefileattribute {string} Set the string constant given in the source file

Some knowledge about the Proguard.flags

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.