Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Keep line number information, useful for stack traces. | 1 # Keep line number information, useful for stack traces. |
| 2 -keepattributes SourceFile,LineNumberTable | 2 -keepattributes SourceFile,LineNumberTable |
| 3 | 3 |
| 4 # Keep all annotation related attributes that can affect runtime | 4 # Keep all annotation related attributes that can affect runtime |
| 5 -keepattributes RuntimeVisible*Annotations | 5 -keepattributes RuntimeVisible*Annotations |
| 6 -keepattributes AnnotationDefault | 6 -keepattributes AnnotationDefault |
| 7 | 7 |
| 8 # Keep the annotations, because if we don't, the ProGuard rules that use them | 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 | 9 # will not be respected. These classes then show up in our final dex, which we |
| 10 # do not want - see crbug.com/628226. | 10 # do not want - see crbug.com/628226. |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 30 -keepclasseswithmembers,includedescriptorclasses class * { | 30 -keepclasseswithmembers,includedescriptorclasses class * { |
| 31 @org.chromium.base.annotations.CalledByNativeUnchecked <methods>; | 31 @org.chromium.base.annotations.CalledByNativeUnchecked <methods>; |
| 32 } | 32 } |
| 33 -keepclasseswithmembers class * { | 33 -keepclasseswithmembers class * { |
| 34 @org.chromium.base.annotations.UsedByReflection <methods>; | 34 @org.chromium.base.annotations.UsedByReflection <methods>; |
| 35 } | 35 } |
| 36 -keepclasseswithmembers,includedescriptorclasses class * { | 36 -keepclasseswithmembers,includedescriptorclasses class * { |
| 37 native <methods>; | 37 native <methods>; |
| 38 } | 38 } |
| 39 | 39 |
| 40 # Keep all Parcelables as they might be marshalled outside Chrome. | 40 # Keep all CREATOR fields within Parcelable that are kept. |
| 41 -keepnames class * implements android.os.Parcelable | |
| 42 | |
| 43 -keepclassmembers class * implements android.os.Parcelable { | 41 -keepclassmembers class * implements android.os.Parcelable { |
| 44 public static *** CREATOR; | 42 public static *** CREATOR; |
| 45 } | 43 } |
| 46 | 44 |
| 45 # Don't obfuscate Parcelables as they might be marshalled outside Chrome. | |
| 46 -keepnames class * implements android.os.Parcelable | |
| 47 | |
| 48 # Keep all Parcelables, since Play Services has some that are used only by | |
| 49 # reflection. | |
| 50 # TODO(agrieve): Remove this once proguard flags provided by play services via | |
| 51 # .aars are used. | |
|
nyquist
2016/08/24 21:16:12
Nit: Is there a bug for this?
agrieve
2016/08/25 01:00:53
Good call. Added.
| |
| 52 -keep class * implements android.os.Parcelable | |
| 53 | |
| 47 # Remove methods annotated with this if their return value is unused | 54 # Remove methods annotated with this if their return value is unused |
| 48 -assumenosideeffects class ** { | 55 -assumenosideeffects class ** { |
| 49 @org.chromium.base.annotations.RemovableInRelease <methods>; | 56 @org.chromium.base.annotations.RemovableInRelease <methods>; |
| 50 } | 57 } |
| 51 | 58 |
| 52 # Keep all enum values and valueOf methods. See | 59 # Keep all enum values and valueOf methods. See |
| 53 # http://proguard.sourceforge.net/index.html#manual/examples.html | 60 # http://proguard.sourceforge.net/index.html#manual/examples.html |
| 54 # for the reason for this. Also, see http://crbug.com/248037. | 61 # for the reason for this. Also, see http://crbug.com/248037. |
| 55 -keepclassmembers enum * { | 62 -keepclassmembers enum * { |
| 56 public static **[] values(); | 63 public static **[] values(); |
| 57 } | 64 } |
| 58 | 65 |
| OLD | NEW |