| Joe Onorato | 2daa2b3 | 2009-08-30 13:39:24 -0700 | [diff] [blame] | 1 | # see http://sourceforge.net/tracker/?func=detail&aid=2787465&group_id=54750&atid=474707 | 
|  | 2 | -optimizations !code/simplification/arithmetic | 
| Ying Wang | 3b2bdf1 | 2010-02-01 09:51:23 -0800 | [diff] [blame] | 3 | -optimizations !code/simplification/cast | 
| Joe Onorato | 2daa2b3 | 2009-08-30 13:39:24 -0700 | [diff] [blame] | 4 | -allowaccessmodification | 
|  | 5 |  | 
| Ying Wang | 3b2bdf1 | 2010-02-01 09:51:23 -0800 | [diff] [blame] | 6 | # To prevent name conflict in incremental obfuscation. | 
|  | 7 | -useuniqueclassmembernames | 
|  | 8 |  | 
|  | 9 | # dex does not like code run through proguard optimize and preverify steps. | 
|  | 10 | -dontoptimize | 
|  | 11 | -dontpreverify | 
|  | 12 |  | 
|  | 13 | # Don't obfuscate. We only need dead code striping. | 
|  | 14 | -dontobfuscate | 
|  | 15 |  | 
|  | 16 | # Add this flag in your package's own configuration if it's needed. | 
|  | 17 | #-flattenpackagehierarchy | 
|  | 18 |  | 
| Joe Onorato | 2daa2b3 | 2009-08-30 13:39:24 -0700 | [diff] [blame] | 19 | # Some classes in the libraries extend package private classes to chare common functionality | 
|  | 20 | # that isn't explicitly part of the API | 
| Ying Wang | 3b2bdf1 | 2010-02-01 09:51:23 -0800 | [diff] [blame] | 21 | -dontskipnonpubliclibraryclasses -dontskipnonpubliclibraryclassmembers | 
|  | 22 |  | 
|  | 23 | # For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations | 
|  | 24 | -keepclassmembers enum * { | 
|  | 25 | public static **[] values(); | 
|  | 26 | public static ** valueOf(java.lang.String); | 
|  | 27 | } | 
|  | 28 |  | 
|  | 29 | # For native methods, see http://proguard.sourceforge.net/manual/examples.html#native | 
|  | 30 | -keepclasseswithmembernames class * { | 
|  | 31 | native <methods>; | 
|  | 32 | } | 
|  | 33 |  | 
|  | 34 | # class$ methods are inserted by some compilers to implement .class construct, | 
|  | 35 | # see http://proguard.sourceforge.net/manual/examples.html#library | 
|  | 36 | -keepclassmembernames class * { | 
|  | 37 | java.lang.Class class$(java.lang.String); | 
|  | 38 | java.lang.Class class$(java.lang.String, boolean); | 
|  | 39 | } | 
|  | 40 |  | 
| Bjorn Bringert | 4f85d00 | 2010-03-09 14:37:21 +0000 | [diff] [blame] | 41 | # Keep classes and methods that have the guava @VisibleForTesting annotation | 
|  | 42 | -keep @com.google.common.annotations.VisibleForTesting class * | 
|  | 43 | -keepclassmembers class * { | 
|  | 44 | @com.google.common.annotations.VisibleForTesting *; | 
|  | 45 | } | 
|  | 46 |  | 
| Hung-ying Tyan | ddefdef | 2010-08-10 17:50:25 +0800 | [diff] [blame] | 47 | # Keep serializable classes and necessary members for serializable classes | 
|  | 48 | # Copied from the ProGuard manual at http://proguard.sourceforge.net. | 
|  | 49 | -keepnames class * implements java.io.Serializable | 
|  | 50 | -keepclassmembers class * implements java.io.Serializable { | 
|  | 51 | static final long serialVersionUID; | 
|  | 52 | private static final java.io.ObjectStreamField[] serialPersistentFields; | 
|  | 53 | !static !transient <fields>; | 
|  | 54 | private void writeObject(java.io.ObjectOutputStream); | 
|  | 55 | private void readObject(java.io.ObjectInputStream); | 
|  | 56 | java.lang.Object writeReplace(); | 
|  | 57 | java.lang.Object readResolve(); | 
|  | 58 | } | 
|  | 59 |  | 
| Ying Wang | 3b2bdf1 | 2010-02-01 09:51:23 -0800 | [diff] [blame] | 60 | # Please specify classes to be kept explicitly in your package's configuration. | 
|  | 61 | # -keep class * extends android.app.Activity | 
|  | 62 | # -keep class * extends android.view.View | 
|  | 63 | # -keep class * extends android.app.Service | 
|  | 64 | # -keep class * extends android.content.BroadcastReceiver | 
|  | 65 | # -keep class * extends android.content.ContentProvider | 
|  | 66 | # -keep class * extends android.preference.Preference | 
|  | 67 | # -keep class * extends android.app.BackupAgent | 
|  | 68 |  | 
|  | 69 | #-keep class * implements android.os.Parcelable { | 
|  | 70 | #  public static final android.os.Parcelable$Creator *; | 
|  | 71 | #} | 
|  | 72 |  | 
| Ying Wang | f8f2b02 | 2012-09-23 13:46:58 -0700 | [diff] [blame] | 73 | # The support library contains references to newer platform versions. | 
|  | 74 | # Don't warn about those in case this app is linking against an older | 
|  | 75 | # platform version.  We know about them, and they are safe. | 
|  | 76 | # See proguard-android.txt in the SDK package. | 
|  | 77 | -dontwarn android.support.** |