Index: android_webview/apk/java/proguard.flags |
diff --git a/android_webview/apk/java/proguard.flags b/android_webview/apk/java/proguard.flags |
index 3b3f2c6332c785919eb2762e8f1b48b528df1f42..367c5de4cae473fa7a419b649c2f31dd2efff874 100644 |
--- a/android_webview/apk/java/proguard.flags |
+++ b/android_webview/apk/java/proguard.flags |
@@ -8,10 +8,13 @@ |
# 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 |
+# Keeping annotations - if we remove these keeps, ProGuard will eliminate the |
+# annotations themselves, which will prevent them from affecting ProGuard's |
+# optimization run. |
+-keep @interface **.AccessedBy* |
Torne
2016/07/13 16:54:25
It seems like the names here should actually match
smaier
2016/07/13 22:21:23
Done.
|
+-keep @interface **.CalledBy* |
+-keep @interface **.RemovableInRelease |
+-keep @interface **.UsedBy* |
# Keep the factory and its public members; it's the main entry point used by the |
# framework. |
@@ -39,11 +42,19 @@ |
native <methods>; |
} |
-# Keep things explicitly marked as used by reflection |
+# Keep classes marked as used by reflection |
+-keep @**.UsedByReflection class * |
Torne
2016/07/13 16:54:25
This isn't consistent with the other class wildcar
smaier
2016/07/13 22:21:23
Done.
|
+ |
+# Keep members explicitly marked as used by reflection |
-keepclasseswithmembers class com.android.webview.chromium.**,org.chromium.** { |
@**.UsedByReflection *; |
} |
+# Remove methods annotated with this if their return value is unused |
+-assumenosideeffects class ** { |
+ @org.chromium.base.annotations.RemovableInRelease <methods>; |
+} |
+ |
# Linker dynamically casts to $TestRunner when running tests. We don't run these |
# tests in WebView. |
-dontnote org.chromium.base.library_loader.Linker$TestRunner |