| OLD | NEW |
| 1 # Don't rename anything, it makes stack traces unintelligible. We only allow the | 1 # Don't rename anything, it makes stack traces unintelligible. We only allow the |
| 2 # obfuscation pass to run so that we can discard attributes like local variable | 2 # obfuscation pass to run so that we can discard attributes like local variable |
| 3 # tables. | 3 # tables. |
| 4 -keepnames class *** { *; } | 4 -keepnames class *** { *; } |
| 5 | 5 |
| 6 # Keep source file and line number information for stack traces. | |
| 7 -keepattributes SourceFile,LineNumberTable | |
| 8 | |
| 9 # Keep all runtime visible annotations. | |
| 10 -keepattributes RuntimeVisibleAnnotations | |
| 11 # Keeping annotations - if we remove these keeps, ProGuard will eliminate the | |
| 12 # annotations themselves, which will prevent them from affecting ProGuard's | |
| 13 # optimization run. | |
| 14 -keep @interface **.AccessedByNative | |
| 15 -keep @interface **.CalledByNative | |
| 16 -keep @interface **.CalledByNativeUnchecked | |
| 17 -keep @interface **.RemovableInRelease | |
| 18 -keep @interface **.UsedByReflection | |
| 19 | 6 |
| 20 # Keep the factory and its public members; it's the main entry point used by the | 7 # Keep the factory and its public members; it's the main entry point used by the |
| 21 # framework. | 8 # framework. |
| 22 -keep class com.android.webview.chromium.WebViewChromiumFactoryProvider { | 9 -keep class com.android.webview.chromium.WebViewChromiumFactoryProvider { |
| 23 public *; | 10 public *; |
| 24 } | 11 } |
| 25 | 12 |
| 26 # This is the main entry point for APIs. It is kept to make developing with | 13 # This is the main entry point for APIs. It is kept to make developing with |
| 27 # unreleased Android easier. | 14 # unreleased Android easier. |
| 28 -keep class com.android.webview.chromium.WebViewChromium { | 15 -keep class com.android.webview.chromium.WebViewChromium { |
| 29 public *; | 16 public *; |
| 30 } | 17 } |
| 31 | 18 |
| 32 # Keep JNI interfaces. | |
| 33 -keepclasseswithmembers class com.android.webview.chromium.**,org.chromium.** { | |
| 34 @**.AccessedByNative <fields>; | |
| 35 } | |
| 36 -keepclasseswithmembers class com.android.webview.chromium.**,org.chromium.** { | |
| 37 @**.CalledByNative <methods>; | |
| 38 } | |
| 39 -keepclasseswithmembers class com.android.webview.chromium.**,org.chromium.** { | |
| 40 @**.CalledByNativeUnchecked <methods>; | |
| 41 } | |
| 42 -keepclasseswithmembers class com.android.webview.chromium.**,org.chromium.** { | |
| 43 native <methods>; | |
| 44 } | |
| 45 | |
| 46 # Keep classes marked as used by reflection | |
| 47 -keep @**.UsedByReflection class com.android.webview.chromium.**,org.chromium.** | |
| 48 | |
| 49 # Keep members explicitly marked as used by reflection | |
| 50 -keepclasseswithmembers class com.android.webview.chromium.**,org.chromium.** { | |
| 51 @**.UsedByReflection *; | |
| 52 } | |
| 53 | |
| 54 # Remove methods annotated with this if their return value is unused | |
| 55 -assumenosideeffects class ** { | |
| 56 @org.chromium.base.annotations.RemovableInRelease <methods>; | |
| 57 } | |
| 58 | |
| 59 # Allows Proguard freedom in removing these log related calls. We ask for debug | |
| 60 # and verbose logs to be stripped out in base.Log, so we are just ensuring we | |
| 61 # get rid of all other debug/verbose logs. | |
| 62 -assumenosideeffects class android.util.Log { | |
| 63 static *** d(...); | |
| 64 static *** v(...); | |
| 65 static *** isLoggable(...); | |
| 66 } | |
| 67 | |
| 68 # Linker dynamically casts to $TestRunner when running tests. We don't run these | 19 # Linker dynamically casts to $TestRunner when running tests. We don't run these |
| 69 # tests in WebView. | 20 # tests in WebView. |
| 70 -dontnote org.chromium.base.library_loader.Linker$TestRunner | 21 -dontnote org.chromium.base.library_loader.Linker$TestRunner |
| 71 | 22 |
| 72 # Don't note about the API 21 compatibility code which references various | 23 # Don't note about the API 21 compatibility code which references various |
| 73 # hidden APIs via reflection. | 24 # hidden APIs via reflection. |
| 74 -dontnote com.android.webview.chromium.WebViewDelegateFactory$Api21Compatibility
Delegate | 25 -dontnote com.android.webview.chromium.WebViewDelegateFactory$Api21Compatibility
Delegate |
| 75 | 26 |
| 76 # DefaultAndroidKeyStore uses reflection to access internal OpenSSL state. | 27 # DefaultAndroidKeyStore uses reflection to access internal OpenSSL state. |
| 77 -dontnote org.chromium.net.DefaultAndroidKeyStore | 28 -dontnote org.chromium.net.DefaultAndroidKeyStore |
| (...skipping 27 matching lines...) Expand all Loading... |
| 105 #TODO(hush): remove after N release. crbug.com/546762 | 56 #TODO(hush): remove after N release. crbug.com/546762 |
| 106 -keep class com.android.webview.chromium.ContentSettingsAdapter { | 57 -keep class com.android.webview.chromium.ContentSettingsAdapter { |
| 107 public void setDisabledActionModeMenuItems(int); | 58 public void setDisabledActionModeMenuItems(int); |
| 108 public int getDisabledActionModeMenuItems(); | 59 public int getDisabledActionModeMenuItems(); |
| 109 } | 60 } |
| 110 | 61 |
| 111 # Ignore notes and warnings about the support library, which uses reflection and | 62 # Ignore notes and warnings about the support library, which uses reflection and |
| 112 # may reference classes no longer in the SDK. | 63 # may reference classes no longer in the SDK. |
| 113 -dontnote android.support.** | 64 -dontnote android.support.** |
| 114 -dontwarn android.support.** | 65 -dontwarn android.support.** |
| 115 | |
| 116 # Keep all enum values and valueOf methods. See | |
| 117 # http://proguard.sourceforge.net/index.html#manual/examples.html | |
| 118 # for the reason for this. Also, see http://crbug.com/248037. | |
| 119 -keepclassmembers enum * { | |
| 120 public static **[] values(); | |
| 121 public static ** valueOf(java.lang.String); | |
| 122 } | |
| OLD | NEW |