Alexander Afanasyev | da06629 | 2017-11-12 23:02:31 -0500 | [diff] [blame^] | 1 | #-dontshrink |
| 2 | #-dontoptimize |
| 3 | #-dontpreverify |
| 4 | -verbose |
| 5 | -dontwarn javax.annotation.** |
| 6 | -dontwarn com.google.** |
| 7 | -dontwarn org.joda.convert.** |
Alexander Afanasyev | b72e144 | 2017-07-10 13:10:11 -0700 | [diff] [blame] | 8 | |
Alexander Afanasyev | da06629 | 2017-11-12 23:02:31 -0500 | [diff] [blame^] | 9 | -dontnote org.sqlite.JDBC |
| 10 | -dontnote javax.xml.bind.DatatypeConverter |
| 11 | -dontnote com.google.appengine.api.ThreadManager |
| 12 | -dontnote com.google.apphosting.api.ApiProxy |
| 13 | |
| 14 | # |
| 15 | |
| 16 | -renamesourcefileattribute SourceFile |
| 17 | |
| 18 | -keepattributes SourceFile,LineNumberTable |
| 19 | |
| 20 | # RemoteViews might need annotations. |
| 21 | |
| 22 | -keepattributes *Annotation* |
| 23 | |
| 24 | # Preserve all fundamental application classes. |
| 25 | |
| 26 | -keep public class * extends android.app.Activity |
| 27 | -keep public class * extends android.app.Application |
| 28 | -keep public class * extends android.app.Service |
| 29 | -keep public class * extends android.content.BroadcastReceiver |
| 30 | -keep public class * extends android.content.ContentProvider |
| 31 | |
| 32 | # Preserve all View implementations, their special context constructors, and |
| 33 | # their setters. |
| 34 | |
| 35 | -keep public class * extends android.view.View { |
| 36 | public <init>(android.content.Context); |
| 37 | public <init>(android.content.Context, android.util.AttributeSet); |
| 38 | public <init>(android.content.Context, android.util.AttributeSet, int); |
| 39 | public void set*(...); |
| 40 | } |
| 41 | |
| 42 | # Preserve all classes that have special context constructors, and the |
| 43 | # constructors themselves. |
| 44 | |
| 45 | -keepclasseswithmembers class * { |
| 46 | public <init>(android.content.Context, android.util.AttributeSet); |
| 47 | } |
| 48 | |
| 49 | # Preserve all classes that have special context constructors, and the |
| 50 | # constructors themselves. |
| 51 | |
| 52 | -keepclasseswithmembers class * { |
| 53 | public <init>(android.content.Context, android.util.AttributeSet, int); |
| 54 | } |
| 55 | |
| 56 | # Preserve the special fields of all Parcelable implementations. |
| 57 | |
| 58 | -keepclassmembers class * implements android.os.Parcelable { |
| 59 | static android.os.Parcelable$Creator CREATOR; |
| 60 | } |
| 61 | |
| 62 | # Preserve static fields of inner classes of R classes that might be accessed |
| 63 | # through introspection. |
| 64 | |
| 65 | -keepclassmembers class **.R$* { |
| 66 | public static <fields>; |
| 67 | } |
| 68 | |
| 69 | # Preserve the required interface from the License Verification Library |
| 70 | # (but don't nag the developer if the library is not used at all). |
| 71 | |
| 72 | -keep public interface com.android.vending.licensing.ILicensingService |
| 73 | |
| 74 | -dontnote com.android.vending.licensing.ILicensingService |
| 75 | |
| 76 | # The Android Compatibility library references some classes that may not be |
| 77 | # present in all versions of the API, but we know that's ok. |
| 78 | |
| 79 | -dontwarn android.support.** |
| 80 | |
| 81 | # Preserve all native method names and the names of their classes. |
| 82 | |
| 83 | -keepclasseswithmembernames class * { |
| 84 | native <methods>; |
| 85 | } |
| 86 | |
| 87 | # Preserve the special static methods that are required in all enumeration |
| 88 | # classes. |
| 89 | |
| 90 | -keepclassmembers class * extends java.lang.Enum { |
| 91 | public static **[] values(); |
| 92 | public static ** valueOf(java.lang.String); |
| 93 | } |
| 94 | |
| 95 | # Explicitly preserve all serialization members. The Serializable interface |
| 96 | # is only a marker interface, so it wouldn't save them. |
| 97 | # You can comment this out if your application doesn't use serialization. |
| 98 | # If your code contains serializable classes that have to be backward |
| 99 | # compatible, please refer to the manual. |
| 100 | |
| 101 | -keepclassmembers class * implements java.io.Serializable { |
| 102 | static final long serialVersionUID; |
| 103 | static final java.io.ObjectStreamField[] serialPersistentFields; |
| 104 | private void writeObject(java.io.ObjectOutputStream); |
| 105 | private void readObject(java.io.ObjectInputStream); |
| 106 | java.lang.Object writeReplace(); |
| 107 | java.lang.Object readResolve(); |
| 108 | } |
| 109 | |
| 110 | # Your application may contain more items that need to be preserved; |
| 111 | # typically classes that are dynamically created using Class.forName: |
| 112 | |
| 113 | # -keep public class mypackage.MyClass |
| 114 | # -keep public interface mypackage.MyInterface |
| 115 | # -keep public class * implements mypackage.MyInterface |