Home | History | Annotate | Download | only in lib
      1 #
      2 # This ProGuard configuration file specifies how annotations can be used
      3 # to configure the processing of other code.
      4 # Usage:
      5 #     java -jar proguard.jar @annotations.pro -libraryjars annotations.jar ...
      6 #
      7 # Note that the other input/output options still have to be specified.
      8 # If you specify them in a separate file, you can simply include this file:
      9 #     -include annotations.pro
     10 #
     11 # You can add any other options that are required. For instance, if you are
     12 # processing a library, you can still include the options from library.pro.
     13 
     14 
     15 # The annotations are defined in the accompanying jar. For now, we'll start
     16 # with these. You can always define your own annotations, if necessary.
     17 -libraryjars annotations.jar
     18 
     19 
     20 # The following annotations can be specified with classes and with class
     21 # members.
     22 
     23 # @Keep specifies not to shrink, optimize, or obfuscate the annotated class
     24 # or class member as an entry point.
     25 
     26 -keep @proguard.annotation.Keep class *
     27 
     28 -keepclassmembers class * {
     29     @proguard.annotation.Keep *;
     30 }
     31 
     32 
     33 # @KeepName specifies not to optimize or obfuscate the annotated class or
     34 # class member as an entry point.
     35 
     36 -keepnames @proguard.annotation.KeepName class *
     37 
     38 -keepclassmembernames class * {
     39     @proguard.annotation.KeepName *;
     40 }
     41 
     42 
     43 # The following annotations can only be specified with classes.
     44 
     45 # @KeepImplementations and @KeepPublicImplementations specify to keep all,
     46 # resp. all public, implementations or extensions of the annotated class as
     47 # entry points. Note the extension of the java-like syntax, adding annotations
     48 # before the (wild-carded) interface name.
     49 
     50 -keep        class * implements @proguard.annotation.KeepImplementations       *
     51 -keep public class * implements @proguard.annotation.KeepPublicImplementations *
     52 
     53 # @KeepApplication specifies to keep the annotated class as an application,
     54 # together with its main method.
     55 
     56 -keepclasseswithmembers @proguard.annotation.KeepApplication public class * {
     57     public static void main(java.lang.String[]);
     58 }
     59 
     60 # @KeepClassMembers, @KeepPublicClassMembers, and
     61 # @KeepPublicProtectedClassMembers specify to keep all, all public, resp.
     62 # all public or protected, class members of the annotated class from being
     63 # shrunk, optimized, or obfuscated as entry points.
     64 
     65 -keepclassmembers @proguard.annotation.KeepClassMembers class * {
     66     *;
     67 }
     68 
     69 -keepclassmembers @proguard.annotation.KeepPublicClassMembers class * {
     70     public *;
     71 }
     72 
     73 -keepclassmembers @proguard.annotation.KeepPublicProtectedClassMembers class * {
     74     public protected *;
     75 }
     76 
     77 # @KeepClassMemberNames, @KeepPublicClassMemberNames, and
     78 # @KeepPublicProtectedClassMemberNames specify to keep all, all public, resp.
     79 # all public or protected, class members of the annotated class from being
     80 # optimized or obfuscated as entry points.
     81 
     82 -keepclassmembernames @proguard.annotation.KeepClassMemberNames class * {
     83     *;
     84 }
     85 
     86 -keepclassmembernames @proguard.annotation.KeepPublicClassMemberNames class * {
     87     public *;
     88 }
     89 
     90 -keepclassmembernames @proguard.annotation.KeepPublicProtectedClassMemberNames class * {
     91     public protected *;
     92 }
     93 
     94 # @KeepGettersSetters and @KeepPublicGettersSetters specify to keep all, resp.
     95 # all public, getters and setters of the annotated class from being shrunk,
     96 # optimized, or obfuscated as entry points.
     97 
     98 -keepclassmembers @proguard.annotation.KeepGettersSetters class * {
     99     void set*(***);
    100     void set*(int, ***);
    101 
    102     boolean is*();
    103     boolean is*(int);
    104 
    105     *** get*();
    106     *** get*(int);
    107 }
    108 
    109 -keepclassmembers @proguard.annotation.KeepPublicGettersSetters class * {
    110     public void set*(***);
    111     public void set*(int, ***);
    112 
    113     public boolean is*();
    114     public boolean is*(int);
    115 
    116     public *** get*();
    117     public *** get*(int);
    118 }
    119