Ying Wang | 7311a34 | 2013-08-21 18:32:49 -0700 | [diff] [blame] | 1 | # We have moved -dontobfuscate and -dontoptimize to the makefiles. |
Ying Wang | 3b2bdf1 | 2010-02-01 09:51:23 -0800 | [diff] [blame] | 2 | # dex does not like code run through proguard optimize and preverify steps. |
Ying Wang | 7311a34 | 2013-08-21 18:32:49 -0700 | [diff] [blame] | 3 | # -dontoptimize |
Ying Wang | 3b2bdf1 | 2010-02-01 09:51:23 -0800 | [diff] [blame] | 4 | -dontpreverify |
| 5 | |
| 6 | # Don't obfuscate. We only need dead code striping. |
Ying Wang | 7311a34 | 2013-08-21 18:32:49 -0700 | [diff] [blame] | 7 | # -dontobfuscate |
Ying Wang | 3b2bdf1 | 2010-02-01 09:51:23 -0800 | [diff] [blame] | 8 | |
| 9 | # Add this flag in your package's own configuration if it's needed. |
| 10 | #-flattenpackagehierarchy |
| 11 | |
Ying Wang | 38cdd44 | 2013-05-30 10:45:46 -0700 | [diff] [blame] | 12 | # Keep classes and methods that have the guava @VisibleForTesting annotation |
Daichi Hirono | e2a85aa | 2015-07-24 17:48:19 +0900 | [diff] [blame] | 13 | -keep @**.VisibleForTesting class * |
Ying Wang | 38cdd44 | 2013-05-30 10:45:46 -0700 | [diff] [blame] | 14 | -keepclassmembers class * { |
Daichi Hirono | e2a85aa | 2015-07-24 17:48:19 +0900 | [diff] [blame] | 15 | @**.VisibleForTesting *; |
Ying Wang | 38cdd44 | 2013-05-30 10:45:46 -0700 | [diff] [blame] | 16 | } |
Ying Wang | 3b2bdf1 | 2010-02-01 09:51:23 -0800 | [diff] [blame] | 17 | |
Colin Cross | 38b48de | 2019-03-26 09:48:28 -0700 | [diff] [blame] | 18 | # Understand the @Keep support annotation. |
| 19 | -keep class android.support.annotation.Keep |
| 20 | -keep class androidx.annotation.Keep |
| 21 | |
| 22 | -keep @android.support.annotation.Keep class * {*;} |
| 23 | -keep @androidx.annotation.Keep class * {*;} |
| 24 | |
| 25 | -keepclasseswithmembers class * { |
| 26 | @android.support.annotation.Keep <methods>; |
| 27 | } |
| 28 | |
| 29 | -keepclasseswithmembers class * { |
| 30 | @androidx.annotation.Keep <methods>; |
| 31 | } |
| 32 | |
| 33 | -keepclasseswithmembers class * { |
| 34 | @android.support.annotation.Keep <fields>; |
| 35 | } |
| 36 | |
| 37 | -keepclasseswithmembers class * { |
| 38 | @androidx.annotation.Keep <fields>; |
| 39 | } |
| 40 | |
| 41 | -keepclasseswithmembers class * { |
| 42 | @android.support.annotation.Keep <init>(...); |
| 43 | } |
| 44 | |
| 45 | -keepclasseswithmembers class * { |
| 46 | @androidx.annotation.Keep <init>(...); |
| 47 | } |
| 48 | |
Ying Wang | 5745351 | 2013-05-17 10:02:00 -0700 | [diff] [blame] | 49 | -include proguard_basic_keeps.flags |