| OLD | NEW |
| (Empty) |
| 1 # Keep line number information, useful for stack traces. | |
| 2 -keepattributes SourceFile,LineNumberTable | |
| 3 | |
| 4 # Keep all annotation related attributes that can affect runtime | |
| 5 -keepattributes RuntimeVisible*Annotations | |
| 6 -keepattributes AnnotationDefault | |
| 7 | |
| 8 # Keep the annotations, because if we don't, the ProGuard rules that use them | |
| 9 # will not be respected. These classes then show up in our final dex, which we | |
| 10 # do not want - see crbug.com/628226. | |
| 11 -keep @interface org.chromium.base.annotations.AccessedByNative | |
| 12 -keep @interface org.chromium.base.annotations.CalledByNative | |
| 13 -keep @interface org.chromium.base.annotations.CalledByNativeUnchecked | |
| 14 -keep @interface org.chromium.base.annotations.RemovableInRelease | |
| 15 -keep @interface org.chromium.base.annotations.UsedByReflection | |
| 16 | |
| 17 # Keeps for class level annotations. | |
| 18 -keep @org.chromium.base.annotations.UsedByReflection class * | |
| 19 | |
| 20 # Keeps for method level annotations. | |
| 21 -keepclasseswithmembers class * { | |
| 22 @org.chromium.base.annotations.AccessedByNative <fields>; | |
| 23 } | |
| 24 -keepclasseswithmembers,includedescriptorclasses class * { | |
| 25 @org.chromium.base.annotations.CalledByNative <methods>; | |
| 26 } | |
| 27 -keepclasseswithmembers,includedescriptorclasses class * { | |
| 28 @org.chromium.base.annotations.CalledByNativeUnchecked <methods>; | |
| 29 } | |
| 30 -keepclasseswithmembers class * { | |
| 31 @org.chromium.base.annotations.UsedByReflection <methods>; | |
| 32 } | |
| 33 -keepclasseswithmembers,includedescriptorclasses class * { | |
| 34 native <methods>; | |
| 35 } | |
| 36 | |
| 37 # Keep all CREATOR fields within Parcelable that are kept. | |
| 38 -keepclassmembers class * implements android.os.Parcelable { | |
| 39 public static *** CREATOR; | |
| 40 } | |
| 41 | |
| 42 # Don't obfuscate Parcelables as they might be marshalled outside Chrome. | |
| 43 # If we annotated all Parcelables that get put into Bundles other than | |
| 44 # for saveInstanceState (e.g. PendingIntents), then we could actually keep the | |
| 45 # names of just those ones. For now, we'll just keep them all. | |
| 46 -keepnames class * implements android.os.Parcelable | |
| 47 | |
| 48 # Remove methods annotated with this if their return value is unused | |
| 49 -assumenosideeffects class ** { | |
| 50 @org.chromium.base.annotations.RemovableInRelease <methods>; | |
| 51 } | |
| 52 | |
| 53 # Keep all enum values and valueOf methods. See | |
| 54 # http://proguard.sourceforge.net/index.html#manual/examples.html | |
| 55 # for the reason for this. Also, see http://crbug.com/248037. | |
| 56 -keepclassmembers enum * { | |
| 57 public static **[] values(); | |
| 58 } | |
| 59 | |
| OLD | NEW |