Home | History | Annotate | Download | only in proguard
      1 # Copied from http://google3/java/com/google/android/apps/common/proguard/base.flags
      2 
      3 # This file is intended to contain proguard options that *nobody* would ever
      4 # not want, in *any* configuration - they ensure basic correctness, and have
      5 # no downsides. You probably do not want to make changes to this file.
      6 
      7 # The presence of both of these attributes causes dalvik and other jvms to print
      8 # stack traces on uncaught exceptions, which is necessary to get useful crash
      9 # reports.
     10 -keepattributes SourceFile,LineNumberTable
     11 
     12 # Preverification was introduced in Java 6 to enable faster classloading, but
     13 # dex doesn't use the java .class format, so it has no benefit and can cause
     14 # problems.
     15 -dontpreverify
     16 
     17 # Skipping analysis of some classes may make proguard strip something that's
     18 # needed.
     19 -dontskipnonpubliclibraryclasses
     20 
     21 # Case-insensitive filesystems can't handle when a.class and A.class exist in
     22 # the same directory.
     23 -dontusemixedcaseclassnames
     24 
     25 # This prevents the names of native methods from being obfuscated and prevents
     26 # UnsatisfiedLinkErrors.
     27 -keepclasseswithmembernames class * {
     28     native <methods>;
     29 }
     30 
     31 # hackbod discourages the use of enums on android, but if you use them, they
     32 # should work. Allow instantiation via reflection by keeping the values method.
     33 -keepclassmembers enum * {
     34     public static **[] values();
     35 }
     36 
     37 # Parcel reflectively accesses this field.
     38 -keepclassmembers class * implements android.os.Parcelable {
     39   public static *** CREATOR;
     40 }
     41 
     42 # These methods are needed to ensure that serialization behaves as expected when
     43 # classes are obfuscated, shrunk, and/or optimized.
     44 -keepclassmembers class * implements java.io.Serializable {
     45     static final long serialVersionUID;
     46     private static final java.io.ObjectStreamField[] serialPersistentFields;
     47     private void writeObject(java.io.ObjectOutputStream);
     48     private void readObject(java.io.ObjectInputStream);
     49     java.lang.Object writeReplace();
     50     java.lang.Object readResolve();
     51 }
     52 
     53 # Don't warn about Guava. Any Guava-using app will fail the proguard stage without this dontwarn,
     54 # and since Guava is so widely used, we include it here in the base.
     55 -dontwarn com.google.common.**
     56 
     57 # Don't warn about Error Prone annotations (e.g. @CompileTimeConstant)
     58 -dontwarn com.google.errorprone.annotations.**
     59 
     60 # Based on http://ag/718466: android.app.Notification.setLatestEventInfo() was
     61 # removed in MNC, but is still referenced (safely) by the NotificationCompat
     62 # code.
     63 -dontwarn android.app.Notification
     64 
     65 # Silence notes about dynamically referenced classes from AOSP support
     66 # libraries.
     67 -dontnote android.graphics.Insets
     68 
     69 # AOSP support library:  ICU references to gender and plurals messages.
     70 -dontnote libcore.icu.ICU
     71 -keep class libcore.icu.ICU { *** get(...);}
     72 
     73 # AOSP support library:  Handle classes that use reflection.
     74 -dontnote android.support.v4.app.NotificationCompatJellybean
     75