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

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: Fixing WebView ProGuard config for annotations 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 **.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.
15 -keep @interface **.CalledBy*
16 -keep @interface **.RemovableInRelease
17 -keep @interface **.UsedBy*
15 18
16 # Keep the factory and its public members; it's the main entry point used by the 19 # Keep the factory and its public members; it's the main entry point used by the
17 # framework. 20 # framework.
18 -keep class com.android.webview.chromium.WebViewChromiumFactoryProvider { 21 -keep class com.android.webview.chromium.WebViewChromiumFactoryProvider {
19 public *; 22 public *;
20 } 23 }
21 24
22 # This is the main entry point for APIs. It is kept to make developing with 25 # This is the main entry point for APIs. It is kept to make developing with
23 # unreleased Android easier. 26 # unreleased Android easier.
24 -keep class com.android.webview.chromium.WebViewChromium { 27 -keep class com.android.webview.chromium.WebViewChromium {
25 public *; 28 public *;
26 } 29 }
27 30
28 # Keep JNI interfaces. 31 # Keep JNI interfaces.
29 -keepclasseswithmembers class com.android.webview.chromium.**,org.chromium.** { 32 -keepclasseswithmembers class com.android.webview.chromium.**,org.chromium.** {
30 @**.AccessedByNative <fields>; 33 @**.AccessedByNative <fields>;
31 } 34 }
32 -keepclasseswithmembers class com.android.webview.chromium.**,org.chromium.** { 35 -keepclasseswithmembers class com.android.webview.chromium.**,org.chromium.** {
33 @**.CalledByNative <methods>; 36 @**.CalledByNative <methods>;
34 } 37 }
35 -keepclasseswithmembers class com.android.webview.chromium.**,org.chromium.** { 38 -keepclasseswithmembers class com.android.webview.chromium.**,org.chromium.** {
36 @**.CalledByNativeUnchecked <methods>; 39 @**.CalledByNativeUnchecked <methods>;
37 } 40 }
38 -keepclasseswithmembers class com.android.webview.chromium.**,org.chromium.** { 41 -keepclasseswithmembers class com.android.webview.chromium.**,org.chromium.** {
39 native <methods>; 42 native <methods>;
40 } 43 }
41 44
42 # Keep things explicitly marked as used by reflection 45 # Keep classes marked as used by reflection
46 -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.
47
48 # Keep members explicitly marked as used by reflection
43 -keepclasseswithmembers class com.android.webview.chromium.**,org.chromium.** { 49 -keepclasseswithmembers class com.android.webview.chromium.**,org.chromium.** {
44 @**.UsedByReflection *; 50 @**.UsedByReflection *;
45 } 51 }
46 52
53 # Remove methods annotated with this if their return value is unused
54 -assumenosideeffects class ** {
55 @org.chromium.base.annotations.RemovableInRelease <methods>;
56 }
57
47 # Linker dynamically casts to $TestRunner when running tests. We don't run these 58 # Linker dynamically casts to $TestRunner when running tests. We don't run these
48 # tests in WebView. 59 # tests in WebView.
49 -dontnote org.chromium.base.library_loader.Linker$TestRunner 60 -dontnote org.chromium.base.library_loader.Linker$TestRunner
50 61
51 # Don't note about the API 21 compatibility code which references various 62 # Don't note about the API 21 compatibility code which references various
52 # hidden APIs via reflection. 63 # hidden APIs via reflection.
53 -dontnote com.android.webview.chromium.WebViewDelegateFactory$Api21Compatibility Delegate 64 -dontnote com.android.webview.chromium.WebViewDelegateFactory$Api21Compatibility Delegate
54 65
55 # DefaultAndroidKeyStore uses reflection to access internal OpenSSL state. 66 # DefaultAndroidKeyStore uses reflection to access internal OpenSSL state.
56 -dontnote org.chromium.net.DefaultAndroidKeyStore 67 -dontnote org.chromium.net.DefaultAndroidKeyStore
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 -dontnote android.support.** 103 -dontnote android.support.**
93 -dontwarn android.support.** 104 -dontwarn android.support.**
94 105
95 # Keep all enum values and valueOf methods. See 106 # Keep all enum values and valueOf methods. See
96 # http://proguard.sourceforge.net/index.html#manual/examples.html 107 # http://proguard.sourceforge.net/index.html#manual/examples.html
97 # for the reason for this. Also, see http://crbug.com/248037. 108 # for the reason for this. Also, see http://crbug.com/248037.
98 -keepclassmembers enum * { 109 -keepclassmembers enum * {
99 public static **[] values(); 110 public static **[] values();
100 public static ** valueOf(java.lang.String); 111 public static ** valueOf(java.lang.String);
101 } 112 }
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