1 # Keep line number information, useful for stack traces.
2 -keepattributes SourceFile,LineNumberTable
4 # Keep the annotations.
7 # Disable obfuscation for the following two packages.
8 -keepnames class com.google.android.apps.chrome.**,org.chromium.** {
12 # Keep all the primitive and String constants for for the following two packages.
13 -keepclassmembers class com.google.android.apps.chrome.**,org.chromium.** {
14 !private static final % *;
15 !private static final java.lang.String *;
18 # Keep code annotated with the following annotations.
19 -keep class com.google.android.apps.chrome.**,org.chromium.** {
20 @**.AccessedByNative <fields>;
21 @**.CalledByNative <methods>;
22 @**.CalledByNativeUnchecked <methods>;
23 @**.JavascriptInterface <methods>;
24 @**.NativeCall <methods>;
25 @**.UsedByReflection <methods>;
26 @**.VisibleForTesting *;
30 # Keep all runtime visible annotations
31 -keepattributes RuntimeVisibleAnnotations
33 # Remove methods annotated with this if their return value is unused
34 -assumenosideeffects class * {
35 @org.chromium.base.annotations.RemovableInRelease <methods>;
38 # TODO(aurimas): figure out why we need to keep these classes.
39 -keep class org.chromium.base.test.** {
43 # Keep protobuf code used via reflection
44 # TODO(tonyg): Removing these -keeps results in new notes, but nothing seems to
45 # break. This exclusion costs almost 100k of dex size so consider replacing it
46 # with a -dontnote after more testing.
47 -keep class com.google.protobuf.** {
49 *** parseFrom(java.io.InputStream);
52 # Keep the client interfaces for cacheinvalidation as they are used as
53 # argument types for some of our code that we're keeping and proguard warns
55 -keep class com.google.ipc.invalidation.external.client.** {
59 # Keep all enum values and valueOf methods. See
60 # http://proguard.sourceforge.net/index.html#manual/examples.html
61 # for the reason for this. Also, see http://crbug.com/248037.
62 -keepclassmembers enum * {
63 public static **[] values();
64 public static ** valueOf(java.lang.String);
67 # Keep all Parcelables as they might be marshalled outside Chrome.
68 -keepnames class * implements android.os.Parcelable {
69 public static final ** CREATOR;
72 # SearchView is used in website_preferences_menu.xml and is constructed by
73 # Android using reflection.
74 -keep class android.support.v7.widget.SearchView {
78 # Google Play Services warnings are about its resources.
79 -dontwarn com.google.android.gms.R**
81 # TODO(yfriedman): Remove when crbug.com/488192 is fixed.
82 -dontwarn org.apache.http.**
84 # The support library contains references to newer platform versions.
85 # Don't warn about those in case this app is linking against an older
86 # platform version. We know about them, and they are safe.
87 -dontwarn android.support.**
89 # Everything below this is kept because they are referenced by the test APK.
90 -dontwarn javax.annotation.Nullable
92 -keep class android.support.v7.mediarouter.R* {
96 -keep class android.support.v7.media.MediaRouteProvider** {
100 -keep class android.support.v4.app.FragmentManager** {
104 -keep class android.support.v4.app.DialogFragment** {
108 -keep class android.support.v7.app.AlertDialog** {
112 -keep class com.google.android.gms.cast.CastMediaControlIntent* {
116 # flingViewport is used by Android WebView and a Chrome test.
117 -keepclassmembers class org.chromium.content.browser.ContentViewCore {
118 public void flingViewport(long, int, int);
121 # TODO(aurimas): remove this when Google Play Services no longer uses setLatestEventInfo call
122 # that was deprecated in Android M. It is save to suppress this according to b/18510449.
123 -dontwarn com.google.android.gms.common.GooglePlayServicesUtil
125 # IntentUtils uses reflection to access a method that is hidden until API level 18.
126 -dontnote org.chromium.chrome.browser.util.IntentUtils
128 # Needed to compile ChromeTest.apk
129 -keep class android.support.customtabs.ICustomTabsCallback** {