Index: android_webview/apk/java/proguard.flags |
diff --git a/android_webview/apk/java/proguard.flags b/android_webview/apk/java/proguard.flags |
index b19519fd2c71e244d110614b06b1d802fa5915b6..0e2ffb675adb63f8d10f8e32db1eb0ed7e63b44f 100644 |
--- a/android_webview/apk/java/proguard.flags |
+++ b/android_webview/apk/java/proguard.flags |
@@ -1,7 +1,17 @@ |
-# Most of the flags in this file are duplicated to refer to both the pre- and |
-# post-jarjar remapping versions of the class names. This enables the same |
-# config file to be used whether jarjar is enabled or not. |
+# Don't rename anything, it makes stack traces unintelligible. We only allow the |
+# obfuscation pass to run so that we can discard attributes like local variable |
+# tables. |
+-keepnames class *** { *; } |
+# Keep source file and line number information for stack traces. |
+-keepattributes SourceFile,LineNumberTable |
+ |
+# Keep all runtime visible annotations. |
+-keepattributes RuntimeVisibleAnnotations |
+ |
+# Disable optimization as this causes proguard to remove seemingly random stuff, |
+# including things explicitly kept in this configuration. |
+-dontoptimize |
# Keep the factory and its public members; it's the main entry point used by the |
# framework. |
@@ -9,93 +19,68 @@ |
public *; |
} |
-# Keep the native methods bound to plat_support. |
--keepclasseswithmembers class com.android.webview.chromium.** { |
- native <methods>; |
-} |
- |
-# Keep everything related to the org.chromium JNI interface. |
--keepclasseswithmembers class com.android.org.chromium.** { |
+# Keep JNI interfaces. |
+-keepclasseswithmembers class com.android.webview.chromium.**,org.chromium.** { |
dgn
2015/07/02 16:10:00
Why not the grouped format like we do in chrome?
|
@**.AccessedByNative <fields>; |
} |
--keepclasseswithmembers class com.android.org.chromium.** { |
+-keepclasseswithmembers class com.android.webview.chromium.**,org.chromium.** { |
@**.CalledByNative <methods>; |
} |
--keepclasseswithmembers class com.android.org.chromium.** { |
+-keepclasseswithmembers class com.android.webview.chromium.**,org.chromium.** { |
@**.CalledByNativeUnchecked <methods>; |
} |
--keepclasseswithmembers class com.android.org.chromium.** { |
+-keepclasseswithmembers class com.android.webview.chromium.**,org.chromium.** { |
native <methods>; |
} |
-# Keep methods which get bound to JS interfaces via reflection. |
--keepclasseswithmembers class com.android.org.chromium.** { |
- @**.JavascriptInterface <methods>; |
+# Keep things explicitly marked as used by reflection |
+-keepclasseswithmembers class com.android.webview.chromium.**,org.chromium.** { |
+ @**.UsedByReflection *; |
} |
-# Silence notes caused by use of @VisibleForTesting inside guava. This doesn't |
-# happen when using jarjar because @VisibleForTesting gets renamed as well. |
--dontnote com.google.common.annotations.VisibleForTesting |
+# Linker dynamically casts to $TestRunner when running tests. We don't run these |
+# tests in WebView. |
+-dontnote org.chromium.base.library_loader.Linker$TestRunner |
-# MediaPlayerBridge uses reflection to access internal metadata. |
--dontnote com.android.org.chromium.media.MediaPlayerBridge |
+# Don't note about the API 21 compatibility code which references various |
+# hidden APIs via reflection. |
+-dontnote com.android.webview.chromium.WebViewDelegateFactory$Api21CompatibilityDelegate |
-# AndroidKeyStore uses reflection to access internal OpenSSL state. |
--dontnote com.android.org.chromium.net.AndroidKeyStore |
+# DefaultAndroidKeyStore uses reflection to access internal OpenSSL state. |
+-dontnote org.chromium.net.DefaultAndroidKeyStore |
-# TraceEvent uses reflection to access internal trace info. |
--dontnote com.android.org.chromium.content.common.TraceEvent |
+# MediaPlayerBridge uses reflection to access internal metadata. |
+-dontnote org.chromium.media.MediaPlayerBridge |
# ProxyChangeListener$ProxyReceiver uses reflection to access internal |
# android.net.ProxyProperties. |
--dontnote com.android.org.chromium.net.ProxyChangeListener$ProxyReceiver |
- |
-# com.android.org.chromium.content.app.Linker dynamically casts to $TestRunner |
-# when running tests. We don't run these tests in WebView. |
--dontnote com.android.org.chromium.content.app.Linker$TestRunner |
- |
-# We need to keep these explicitly as they are parameters to methods which |
sgurun-gerrit only
2015/07/06 17:37:24
Why don't we need this section anymore?
Torne
2015/07/07 10:56:59
The descriptor classes are always referenced (by t
|
-# are entry points via @calledByNative. |
--keep class com.android.org.chromium.ui.autofill.AutofillSuggestion |
--keep class com.android.org.chromium.content.browser.ContentVideoViewClient |
--keep class com.android.org.chromium.ui.ColorSuggestion |
--keep class com.android.org.chromium.content.browser.input.DateTimeSuggestion |
--keep class com.android.org.chromium.content.browser.ContentViewCore$JavaScriptCallback |
--keep class com.android.org.chromium.content_public.browser.NavigationController |
- |
-# Keep these classes as they are parameters to methods that are native entry points. |
--keep class com.android.org.chromium.android_webview.AwBrowserContext |
--keep class com.android.org.chromium.base.library_loader.Linker$LibInfo |
- |
-# Keep this class and members as accessed via reflection |
--keep class com.android.webview.chromium.Drp { |
- public *; |
-} |
+-dontnote org.chromium.net.ProxyChangeListener$ProxyReceiver |
-# Keep finalizer stuff from google-common used via reflection |
--keepclassmembers class com.android.org.chromium.com.google.common.** { |
- *** finalizeReferent(); |
+# Silence warnings about reflection used to check for onShow/HideCustomView. |
+# This class is not really kept since it's in a library jar. |
+-keep class android.webkit.WebChromeClient { |
+ void onShowCustomView(...); |
+ void onHideCustomView(); |
} |
--keepclassmembers class com.android.org.chromium.com.google.common.** { |
- *** startFinalizer(java.lang.Class,java.lang.Object); |
+ |
+# Accessed via reflection |
+-keep class com.android.webview.chromium.Drp { |
+ public java.lang.String KEY; |
} |
-# Keep support framework support for SmartClip. |
+# Keep framework support for SmartClip. |
-keep class com.android.webview.chromium.WebViewChromium { |
public void extractSmartClipData(int,int,int,int); |
public void setSmartClipResultHandler(android.os.Handler); |
} |
-# We need to explicitly keep classes and constructors referenced only in |
-# layout resources. |
--keep class com.android.org.chromium.ui.ColorPickerAdvanced { |
- <init>(...); |
-} |
- |
--keep class com.android.org.chromium.ui.ColorPickerSimple { |
- <init>(...); |
-} |
+# Ignore notes about the support library's use of reflection. |
+-dontnote android.support.** |
--keep class com.android.org.chromium.ui.ColorPickerMoreButton { |
- <init>(...); |
+# Keep all enum values and valueOf methods. See |
+# http://proguard.sourceforge.net/index.html#manual/examples.html |
+# for the reason for this. Also, see http://crbug.com/248037. |
+-keepclassmembers enum * { |
+ public static **[] values(); |
+ public static ** valueOf(java.lang.String); |
} |