Ying Wang | 38cdd44 | 2013-05-30 10:45:46 -0700 | [diff] [blame] | 1 | # see http://sourceforge.net/tracker/?func=detail&aid=2787465&group_id=54750&atid=474707 |
| 2 | -optimizations !code/simplification/arithmetic |
| 3 | -optimizations !code/simplification/cast |
Ying Wang | 38cdd44 | 2013-05-30 10:45:46 -0700 | [diff] [blame] | 4 | |
| 5 | # To prevent name conflict in incremental obfuscation. |
| 6 | -useuniqueclassmembernames |
| 7 | |
| 8 | # Some classes in the libraries extend package private classes to chare common functionality |
| 9 | # that isn't explicitly part of the API |
| 10 | -dontskipnonpubliclibraryclasses -dontskipnonpubliclibraryclassmembers |
| 11 | |
Ying Wang | 5745351 | 2013-05-17 10:02:00 -0700 | [diff] [blame] | 12 | # For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations |
| 13 | -keepclassmembers enum * { |
| 14 | public static **[] values(); |
| 15 | public static ** valueOf(java.lang.String); |
| 16 | } |
| 17 | |
| 18 | # For native methods, see http://proguard.sourceforge.net/manual/examples.html#native |
| 19 | -keepclasseswithmembernames class * { |
| 20 | native <methods>; |
| 21 | } |
| 22 | |
| 23 | # class$ methods are inserted by some compilers to implement .class construct, |
| 24 | # see http://proguard.sourceforge.net/manual/examples.html#library |
| 25 | -keepclassmembernames class * { |
| 26 | java.lang.Class class$(java.lang.String); |
| 27 | java.lang.Class class$(java.lang.String, boolean); |
| 28 | } |
| 29 | |
Ying Wang | 5745351 | 2013-05-17 10:02:00 -0700 | [diff] [blame] | 30 | # Keep serializable classes and necessary members for serializable classes |
| 31 | # Copied from the ProGuard manual at http://proguard.sourceforge.net. |
| 32 | -keepnames class * implements java.io.Serializable |
| 33 | -keepclassmembers class * implements java.io.Serializable { |
| 34 | static final long serialVersionUID; |
| 35 | private static final java.io.ObjectStreamField[] serialPersistentFields; |
| 36 | !static !transient <fields>; |
| 37 | private void writeObject(java.io.ObjectOutputStream); |
| 38 | private void readObject(java.io.ObjectInputStream); |
| 39 | java.lang.Object writeReplace(); |
| 40 | java.lang.Object readResolve(); |
| 41 | } |
| 42 | |
Ying Wang | 480a9bb | 2015-05-11 14:56:20 -0700 | [diff] [blame] | 43 | # Keep Throwable's constructor that takes a String argument. |
| 44 | -keepclassmembers class * extends java.lang.Throwable { |
| 45 | <init>(java.lang.String); |
| 46 | } |
| 47 | |
Ying Wang | 5745351 | 2013-05-17 10:02:00 -0700 | [diff] [blame] | 48 | # Please specify classes to be kept explicitly in your package's configuration. |
| 49 | # -keep class * extends android.app.Activity |
| 50 | # -keep class * extends android.view.View |
| 51 | # -keep class * extends android.app.Service |
| 52 | # -keep class * extends android.content.BroadcastReceiver |
| 53 | # -keep class * extends android.content.ContentProvider |
| 54 | # -keep class * extends android.preference.Preference |
| 55 | # -keep class * extends android.app.BackupAgent |
| 56 | |
Scott Kennedy | 62eb51a | 2014-04-07 11:25:47 -0700 | [diff] [blame] | 57 | # Parcelable CREATORs must be kept for Parcelable functionality |
| 58 | -keep class * implements android.os.Parcelable { |
| 59 | public static final ** CREATOR; |
| 60 | } |
Ying Wang | 5745351 | 2013-05-17 10:02:00 -0700 | [diff] [blame] | 61 | |
| 62 | # The support library contains references to newer platform versions. |
| 63 | # Don't warn about those in case this app is linking against an older |
| 64 | # platform version. We know about them, and they are safe. |
| 65 | # See proguard-android.txt in the SDK package. |
Ying Wang | 4f5d0e6 | 2015-05-04 19:21:48 -0700 | [diff] [blame] | 66 | # |
| 67 | # DO NOT USE THIS: We figured it's dangerous to blindly ignore all support library warnings. |
| 68 | # ProGuard may strip members of subclass of unknown super classes, in case an app is linking against |
| 69 | # LOCAL_SDK_VERSION lower than the support library's LOCAL_SDK_VERSION. |
| 70 | # See bug/20658265. |
| 71 | # -dontwarn android.support.** |
Ying Wang | f864d50 | 2014-06-17 11:53:31 -0700 | [diff] [blame] | 72 | |
| 73 | # Less spammy. |
| 74 | -dontnote |