Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1306)

Unified Diff: android_webview/apk/java/proguard.flags

Issue 2147743002: Fixing WebView ProGuard config for annotations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing Torne's comments Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..3589ce9223dbc7bce601fd148fd6dafed6a9766c 100644
--- a/android_webview/apk/java/proguard.flags
+++ b/android_webview/apk/java/proguard.flags
@@ -8,10 +8,14 @@
# 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 **.AccessedByNative
+-keep @interface **.CalledByNative
+-keep @interface **.CalledByNativeUnchecked
+-keep @interface **.RemovableInRelease
+-keep @interface **.UsedByReflection
# Keep the factory and its public members; it's the main entry point used by the
# framework.
@@ -39,11 +43,19 @@
native <methods>;
}
-# Keep things explicitly marked as used by reflection
+# Keep classes marked as used by reflection
+-keep @**.UsedByReflection class com.android.webview.chromium.**,org.chromium.**
+
+# 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698