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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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. 6 # Keep source file and line number information for stack traces.
7 -keepattributes SourceFile,LineNumberTable 7 -keepattributes SourceFile,LineNumberTable
8 8
9 # Keep all runtime visible annotations. 9 # Keep all runtime visible annotations.
10 -keepattributes RuntimeVisibleAnnotations 10 -keepattributes RuntimeVisibleAnnotations
11 11 # Keeping annotations - if we remove these keeps, ProGuard will eliminate the
12 # Disable optimization as this causes proguard to remove seemingly random stuff, 12 # annotations themselves, which will prevent them from affecting ProGuard's
13 # including things explicitly kept in this configuration. 13 # optimization run.
14 -dontoptimize 14 -keep @interface **.AccessedByNative
15 -keep @interface **.CalledByNative
16 -keep @interface **.CalledByNativeUnchecked
17 -keep @interface **.RemovableInRelease
18 -keep @interface **.UsedByReflection
15 19
16 # Keep the factory and its public members; it's the main entry point used by the 20 # Keep the factory and its public members; it's the main entry point used by the
17 # framework. 21 # framework.
18 -keep class com.android.webview.chromium.WebViewChromiumFactoryProvider { 22 -keep class com.android.webview.chromium.WebViewChromiumFactoryProvider {
19 public *; 23 public *;
20 } 24 }
21 25
22 # This is the main entry point for APIs. It is kept to make developing with 26 # This is the main entry point for APIs. It is kept to make developing with
23 # unreleased Android easier. 27 # unreleased Android easier.
24 -keep class com.android.webview.chromium.WebViewChromium { 28 -keep class com.android.webview.chromium.WebViewChromium {
25 public *; 29 public *;
26 } 30 }
27 31
28 # Keep JNI interfaces. 32 # Keep JNI interfaces.
29 -keepclasseswithmembers class com.android.webview.chromium.**,org.chromium.** { 33 -keepclasseswithmembers class com.android.webview.chromium.**,org.chromium.** {
30 @**.AccessedByNative <fields>; 34 @**.AccessedByNative <fields>;
31 } 35 }
32 -keepclasseswithmembers class com.android.webview.chromium.**,org.chromium.** { 36 -keepclasseswithmembers class com.android.webview.chromium.**,org.chromium.** {
33 @**.CalledByNative <methods>; 37 @**.CalledByNative <methods>;
34 } 38 }
35 -keepclasseswithmembers class com.android.webview.chromium.**,org.chromium.** { 39 -keepclasseswithmembers class com.android.webview.chromium.**,org.chromium.** {
36 @**.CalledByNativeUnchecked <methods>; 40 @**.CalledByNativeUnchecked <methods>;
37 } 41 }
38 -keepclasseswithmembers class com.android.webview.chromium.**,org.chromium.** { 42 -keepclasseswithmembers class com.android.webview.chromium.**,org.chromium.** {
39 native <methods>; 43 native <methods>;
40 } 44 }
41 45
42 # Keep things explicitly marked as used by reflection 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
43 -keepclasseswithmembers class com.android.webview.chromium.**,org.chromium.** { 50 -keepclasseswithmembers class com.android.webview.chromium.**,org.chromium.** {
44 @**.UsedByReflection *; 51 @**.UsedByReflection *;
45 } 52 }
46 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
47 # Linker dynamically casts to $TestRunner when running tests. We don't run these 59 # Linker dynamically casts to $TestRunner when running tests. We don't run these
48 # tests in WebView. 60 # tests in WebView.
49 -dontnote org.chromium.base.library_loader.Linker$TestRunner 61 -dontnote org.chromium.base.library_loader.Linker$TestRunner
50 62
51 # Don't note about the API 21 compatibility code which references various 63 # Don't note about the API 21 compatibility code which references various
52 # hidden APIs via reflection. 64 # hidden APIs via reflection.
53 -dontnote com.android.webview.chromium.WebViewDelegateFactory$Api21Compatibility Delegate 65 -dontnote com.android.webview.chromium.WebViewDelegateFactory$Api21Compatibility Delegate
54 66
55 # DefaultAndroidKeyStore uses reflection to access internal OpenSSL state. 67 # DefaultAndroidKeyStore uses reflection to access internal OpenSSL state.
56 -dontnote org.chromium.net.DefaultAndroidKeyStore 68 -dontnote org.chromium.net.DefaultAndroidKeyStore
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 -dontnote android.support.** 104 -dontnote android.support.**
93 -dontwarn android.support.** 105 -dontwarn android.support.**
94 106
95 # Keep all enum values and valueOf methods. See 107 # Keep all enum values and valueOf methods. See
96 # http://proguard.sourceforge.net/index.html#manual/examples.html 108 # http://proguard.sourceforge.net/index.html#manual/examples.html
97 # for the reason for this. Also, see http://crbug.com/248037. 109 # for the reason for this. Also, see http://crbug.com/248037.
98 -keepclassmembers enum * { 110 -keepclassmembers enum * {
99 public static **[] values(); 111 public static **[] values();
100 public static ** valueOf(java.lang.String); 112 public static ** valueOf(java.lang.String);
101 } 113 }
OLDNEW
« 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