| # 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. |
| -keep class com.android.webview.chromium.WebViewChromiumFactoryProvider { |
| public *; |
| } |
| |
| # Keep JNI interfaces. |
| -keepclasseswithmembers class com.android.webview.chromium.**,org.chromium.** { |
| @**.AccessedByNative <fields>; |
| } |
| -keepclasseswithmembers class com.android.webview.chromium.**,org.chromium.** { |
| @**.CalledByNative <methods>; |
| } |
| -keepclasseswithmembers class com.android.webview.chromium.**,org.chromium.** { |
| @**.CalledByNativeUnchecked <methods>; |
| } |
| -keepclasseswithmembers class com.android.webview.chromium.**,org.chromium.** { |
| native <methods>; |
| } |
| |
| # Keep things explicitly marked as used by reflection |
| -keepclasseswithmembers class com.android.webview.chromium.**,org.chromium.** { |
| @**.UsedByReflection *; |
| } |
| |
| # Linker dynamically casts to $TestRunner when running tests. We don't run these |
| # tests in WebView. |
| -dontnote org.chromium.base.library_loader.Linker$TestRunner |
| |
| # Don't note about the API 21 compatibility code which references various |
| # hidden APIs via reflection. |
| -dontnote com.android.webview.chromium.WebViewDelegateFactory$Api21CompatibilityDelegate |
| |
| # DefaultAndroidKeyStore uses reflection to access internal OpenSSL state. |
| -dontnote org.chromium.net.DefaultAndroidKeyStore |
| |
| # MediaPlayerBridge uses reflection to access internal metadata. |
| -dontnote org.chromium.media.MediaPlayerBridge |
| |
| # ProxyChangeListener$ProxyReceiver uses reflection to access internal |
| # android.net.ProxyProperties. |
| -dontnote org.chromium.net.ProxyChangeListener$ProxyReceiver |
| |
| # 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(); |
| } |
| |
| # Accessed via reflection but not present in all builds |
| -keep class com.android.webview.chromium.Drp { |
| public java.lang.String KEY; |
| } |
| -dontnote com.android.webview.chromium.Drp |
| |
| # 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); |
| } |
| |
| # Ignore notes and warnings about the support library, which uses reflection and |
| # may reference classes no longer in the SDK. |
| -dontnote android.support.** |
| -dontwarn android.support.** |
| |
| # 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); |
| } |
| |
| # Remove when ViewStructure is no longer duplicated (crbug.com/513229) |
| -dontwarn android.view.* |
| -dontwarn android.app.assist.* |
| -dontwarn android.webkit.* |