| # Copyright 2016 The Chromium Authors | |
| # Use of this source code is governed by a BSD-style license that can be | |
| # found in the LICENSE file. | |
| # Keep the factory and its public members; it's the main entry point used by the | |
| # framework. Also keep the factory's constructors as some things are using them | |
| # via reflection; crbug.com/1462346 | |
| -keep,allowoptimization class com.android.webview.chromium.WebViewChromiumFactoryProvider { | |
| public *; | |
| <init>(...); | |
| } | |
| -keep,allowoptimization class com.android.webview.chromium.WebViewChromiumFactoryProviderFor* { | |
| public *; | |
| <init>(...); | |
| } | |
| -keep,allowoptimization class * implements android.webkit.WebViewFactoryProvider$Statics { | |
| *; | |
| } | |
| -keep,allowoptimization class com.android.webview.chromium.ContentSettingsAdapter { | |
| public *; | |
| } | |
| -keep,allowoptimization class com.android.webview.chromium.WebViewDatabaseAdapter { | |
| public *; | |
| } | |
| # This is the main entry point for APIs. It is kept to make developing with | |
| # unreleased Android easier. | |
| -keep,allowoptimization class com.android.webview.chromium.WebViewChromium { | |
| public *; | |
| } | |
| # This rule prevents class merging on R$* resource classes (for example, R$anim, | |
| # R$styleable, R$bool). This causes issues for WebView when unused resource | |
| # stripping, since in WebView we are forced to detect which resources are unused | |
| # by scanning the dex file for R$<res_type>.<res_name>. Having the R$* classes | |
| # being merged together means that R$anim.foo may now be found in R$bool.foo, | |
| # and this mistakenly will mark the foo resouce to be removed. More details in | |
| # crbug.com/1348329. | |
| -keep,allowaccessmodification,allowobfuscation,allowshrinking class **.R$* | |
| # Functor classes with native methods implemented in Android. | |
| -keep class com.android.webview.chromium.DrawFunctor | |
| -keep class com.android.webview.chromium.DrawGLFunctor | |
| -keep class com.android.webview.chromium.GraphicsUtils | |
| # The lock file object must be kept explicitly to avoid it being optimized | |
| # away and the lock released by the object's finalizer. | |
| -keep class org.chromium.android_webview.AwDataDirLock { | |
| java.nio.channels.FileLock sExclusiveFileLock; | |
| java.io.RandomAccessFile sLockFile; | |
| } | |
| # Keep the chromium implementation names deobfuscated. These classes' | |
| # names are used by CTS to verify compatibility with the androidx.webkit | |
| # library. | |
| -keep,allowshrinking class com.android.webview.chromium.CookieManagerAdapter | |
| -keep,allowshrinking class com.android.webview.chromium.ContentSettingsAdapter | |
| -keep,allowshrinking class com.android.webview.chromium.WebMessagePortAdapter | |
| -keep,allowshrinking class com.android.webview.chromium.WebStorageAdapter | |
| -keep,allowshrinking class com.android.webview.chromium.ServiceWorkerSettingsAdapter | |
| -keep,allowshrinking class com.android.webview.chromium.WebResourceRequestAdapter | |
| -keep,allowshrinking class com.android.webview.chromium.WebResourceErrorAdapter | |
| -keep,allowshrinking class com.android.webview.chromium.SafeBrowsingResponseAdapter |