OLD | NEW |
---|---|
1 # Keep line number information, useful for stack traces. | 1 # Keep line number information, useful for stack traces. |
2 -keepattributes SourceFile,LineNumberTable | 2 -keepattributes SourceFile,LineNumberTable |
3 | 3 |
4 # Keep the annotations. | 4 # Keep the annotations. |
5 -keep @interface *** | 5 -keep @interface *** |
6 | 6 |
7 # Disable obfuscation for the following two packages. | 7 # Disable obfuscation for the following two packages. |
8 -keepnames class com.google.android.apps.chrome.**,org.chromium.** { | 8 -keepnames class com.google.android.apps.chrome.**,org.chromium.** { |
9 *; | 9 *; |
10 } | 10 } |
11 | 11 |
12 # Keep all the primitive and String constants for for the following two packages . | 12 # Keep all the primitive and String constants for for the following two packages . |
13 -keepclassmembers class com.google.android.apps.chrome.**,org.chromium.** { | 13 -keepclassmembers class com.google.android.apps.chrome.**,org.chromium.** { |
14 !private static final % *; | 14 !private static final % *; |
15 !private static final java.lang.String *; | 15 !private static final java.lang.String *; |
16 } | 16 } |
17 | 17 |
18 # Keep code annotated with the following annotations. | 18 # Fragments are loaded using reflection via Fragment.instantiate(Context,String) |
19 -keep class com.google.android.apps.chrome.**,org.chromium.** { | 19 # This can be improved upon - see b/622023. |
agrieve
2016/06/22 18:08:06
nit: Please use either crbug/622023, or http://crb
smaier
2016/06/22 18:24:06
Done.
| |
20 -keep public class com.google.android.apps.chrome** extends android.app.Fragment | |
21 -keep public class org.chromium** extends android.app.Fragment | |
22 | |
23 # This block will keep all members that are annotated to be kept. | |
agrieve
2016/06/22 18:08:06
nit: this -> these, can you also elaborate to expl
smaier
2016/06/22 18:24:06
Discussed offline about these comments.
| |
24 -keepclasseswithmembers class com.google.android.apps.chrome.** { | |
20 @**.AccessedByNative <fields>; | 25 @**.AccessedByNative <fields>; |
26 } | |
27 -keepclasseswithmembers class com.google.android.apps.chrome.** { | |
21 @**.CalledByNative <methods>; | 28 @**.CalledByNative <methods>; |
29 } | |
30 -keepclasseswithmembers class com.google.android.apps.chrome.** { | |
22 @**.CalledByNativeUnchecked <methods>; | 31 @**.CalledByNativeUnchecked <methods>; |
32 } | |
33 -keepclasseswithmembers class com.google.android.apps.chrome.** { | |
23 @**.JavascriptInterface <methods>; | 34 @**.JavascriptInterface <methods>; |
35 } | |
36 -keepclasseswithmembers class com.google.android.apps.chrome.** { | |
24 @**.NativeCall <methods>; | 37 @**.NativeCall <methods>; |
38 } | |
39 -keepclasseswithmembers class com.google.android.apps.chrome.** { | |
25 @**.UsedByReflection <methods>; | 40 @**.UsedByReflection <methods>; |
26 @**.VisibleForTesting *; | 41 } |
42 -keepclasseswithmembers class com.google.android.apps.chrome.** { | |
43 @**.VisibleForTesting <methods>; | |
44 } | |
45 -keepclasseswithmembers class com.google.android.apps.chrome.** { | |
27 native <methods>; | 46 native <methods>; |
28 } | 47 } |
48 -keepclasseswithmembers class org.chromium.** { | |
49 @**.AccessedByNative <fields>; | |
50 } | |
51 -keepclasseswithmembers class org.chromium.** { | |
52 @**.CalledByNative <methods>; | |
agrieve
2016/06/22 18:08:06
I think we'd need a -keep for the ByNative ones as
| |
53 } | |
54 -keepclasseswithmembers class org.chromium.** { | |
55 @**.CalledByNativeUnchecked <methods>; | |
56 } | |
57 -keepclasseswithmembers class org.chromium.** { | |
58 @**.JavascriptInterface <methods>; | |
59 } | |
60 -keepclasseswithmembers class org.chromium.** { | |
61 @**.NativeCall <methods>; | |
62 } | |
63 -keepclasseswithmembers class org.chromium.** { | |
64 @**.UsedByReflection <methods>; | |
65 } | |
66 -keepclasseswithmembers class org.chromium.** { | |
67 @**.VisibleForTesting <methods>; | |
68 } | |
69 -keepclasseswithmembers class org.chromium.** { | |
70 native <methods>; | |
71 } | |
72 | |
73 # Keeping classes which are annotated to be kept | |
74 -keep @**.UsedByReflection class * | |
75 -keep @**.VisibleForTesting class * | |
76 | |
29 | 77 |
30 # Class merging provides negligible .dex size reduction and method count | 78 # Class merging provides negligible .dex size reduction and method count |
31 # reduction (about 0.3% improvement on method count, and 0.1% savings on size), | 79 # reduction (about 0.3% improvement on method count, and 0.1% savings on size), |
32 # and it messes up stack traces if the classes are optimized. Thus, it is in our | 80 # and it messes up stack traces if the classes are optimized. Thus, it is in our |
33 # best interests to turn it off. See crbug.com/620323 | 81 # best interests to turn it off. See crbug.com/620323 |
34 -optimizations !class/merging/* | 82 -optimizations !class/merging/* |
35 | 83 |
36 # Keep all runtime visible annotations | 84 # Keep all runtime visible annotations |
37 -keepattributes RuntimeVisibleAnnotations | 85 -keepattributes RuntimeVisibleAnnotations |
38 | 86 |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
165 *; | 213 *; |
166 } | 214 } |
167 | 215 |
168 # TODO(yfriedman): Remove when crbug.com/488192 is fixed. | 216 # TODO(yfriedman): Remove when crbug.com/488192 is fixed. |
169 -dontwarn org.apache.http.conn.scheme.LayeredSocketFactory | 217 -dontwarn org.apache.http.conn.scheme.LayeredSocketFactory |
170 | 218 |
171 # Needed to run ChromeTest.apk | 219 # Needed to run ChromeTest.apk |
172 -keepnames class com.google.android.gms.common.GoogleApiAvailability { | 220 -keepnames class com.google.android.gms.common.GoogleApiAvailability { |
173 *; | 221 *; |
174 } | 222 } |
223 | |
224 # Needed for chrome_sync_shell_test_apk. Note - these do no affect chrome_apk's | |
225 # size. | |
226 -keep class org.chromium.sync.protocol.* { *; } | |
OLD | NEW |