| OLD | NEW |
| (Empty) | |
| 1 # Keep line number information, useful for stack traces. |
| 2 -keepattributes SourceFile,LineNumberTable |
| 3 |
| 4 # Keep all runtime visible annotations |
| 5 -keepattributes RuntimeVisibleAnnotations |
| 6 |
| 7 # Keep the annotations, because if we don't, the ProGuard rules that use them |
| 8 # will not be respected. These classes then show up in our final dex, which we |
| 9 # do not want - see crbug.com/628226. |
| 10 -keep @interface org.chromium.base.annotations.AccessedByNative |
| 11 -keep @interface org.chromium.base.annotations.CalledByNative |
| 12 -keep @interface org.chromium.base.annotations.CalledByNativeUnchecked |
| 13 -keep @interface org.chromium.base.annotations.RemovableInRelease |
| 14 -keep @interface org.chromium.base.annotations.UsedByReflection |
| 15 |
| 16 # Keeps for class level annotations. |
| 17 -keep @org.chromium.base.annotations.UsedByReflection class * |
| 18 |
| 19 # Keeps for method level annotations. |
| 20 -keepclasseswithmembers class * { |
| 21 @android.webkit.JavascriptInterface <methods>; |
| 22 } |
| 23 -keepclasseswithmembers class * { |
| 24 @org.chromium.base.annotations.AccessedByNative <fields>; |
| 25 } |
| 26 -keepclasseswithmembers,includedescriptorclasses class * { |
| 27 @org.chromium.base.annotations.CalledByNative <methods>; |
| 28 } |
| 29 -keepclasseswithmembers,includedescriptorclasses class * { |
| 30 @org.chromium.base.annotations.CalledByNativeUnchecked <methods>; |
| 31 } |
| 32 -keepclasseswithmembers class * { |
| 33 @org.chromium.base.annotations.UsedByReflection <methods>; |
| 34 } |
| 35 -keepclasseswithmembers,includedescriptorclasses class * { |
| 36 native <methods>; |
| 37 } |
| 38 |
| 39 # Remove methods annotated with this if their return value is unused |
| 40 -assumenosideeffects class ** { |
| 41 @org.chromium.base.annotations.RemovableInRelease <methods>; |
| 42 } |
| 43 |
| 44 # Allows Proguard freedom in removing these log related calls. We ask for debug |
| 45 # and verbose logs to be stripped out in base.Log, so we are just ensuring we |
| 46 # get rid of all other debug/verbose logs. |
| 47 -assumenosideeffects class android.util.Log { |
| 48 static *** d(...); |
| 49 static *** v(...); |
| 50 static *** isLoggable(...); |
| 51 } |
| 52 |
| 53 # Class merging provides negligible .dex size reduction and method count |
| 54 # reduction (about 0.3% improvement on method count, and 0.1% savings on size), |
| 55 # and it messes up stack traces if the classes are optimized. Thus, it is in our |
| 56 # best interests to turn it off. See crbug.com/620323 |
| 57 -optimizations !class/merging/* |
| 58 |
| 59 # Allowing Proguard to change modifiers. This change shrinks the .dex size by |
| 60 # ~1.1%, and reduces the method count by ~4.3%. |
| 61 -allowaccessmodification |
| 62 |
| 63 # Keep all enum values and valueOf methods. See |
| 64 # http://proguard.sourceforge.net/index.html#manual/examples.html |
| 65 # for the reason for this. Also, see http://crbug.com/248037. |
| 66 -keepclassmembers enum * { |
| 67 public static **[] values(); |
| 68 public static ** valueOf(java.lang.String); |
| 69 } |
| OLD | NEW |