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 | |
Ying Wang | 3b2bdf1 | 2010-02-01 09:51:23 -0800 | [diff] [blame] | 47 | # Please specify classes to be kept explicitly in your package's configuration. |
| 48 | # -keep class * extends android.app.Activity |
| 49 | # -keep class * extends android.view.View |
| 50 | # -keep class * extends android.app.Service |
| 51 | # -keep class * extends android.content.BroadcastReceiver |
| 52 | # -keep class * extends android.content.ContentProvider |
| 53 | # -keep class * extends android.preference.Preference |
| 54 | # -keep class * extends android.app.BackupAgent |
| 55 | |
| 56 | #-keep class * implements android.os.Parcelable { |
| 57 | # public static final android.os.Parcelable$Creator *; |
| 58 | #} |
| 59 | |
| 60 | |