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 # Fragments are loaded using reflection via Fragment.instantiate(Context,String) | 18 # Fragments are loaded using reflection via Fragment.instantiate(Context,String) |
19 # This can be improved upon - see crbug.com/622023. | 19 # This can be improved upon - see crbug.com/622023. |
20 -keep public class com.google.android.apps.chrome** extends android.app.Fragment | 20 -keep public class com.google.android.apps.chrome** extends android.app.Fragment |
21 -keep public class org.chromium** extends android.app.Fragment | 21 -keep public class org.chromium** extends android.app.Fragment |
22 | 22 |
23 # Keeps for class level annotations. | 23 # Keep for class level annotations. |
24 -keep @**.UsedByReflection class * | 24 -keep @**.UsedByReflection class * |
25 -keep @**.VisibleForTesting class * | |
26 | 25 |
27 # Keeps for method level annotations. | 26 # Keeps for method level annotations. |
28 -keepclasseswithmembers class com.google.android.apps.chrome.** { | 27 -keepclasseswithmembers class com.google.android.apps.chrome.** { |
29 @**.AccessedByNative <fields>; | 28 @**.AccessedByNative <fields>; |
30 } | 29 } |
31 -keepclasseswithmembers class com.google.android.apps.chrome.** { | 30 -keepclasseswithmembers class com.google.android.apps.chrome.** { |
32 @**.CalledByNative <methods>; | 31 @**.CalledByNative <methods>; |
33 } | 32 } |
34 -keepclasseswithmembers class com.google.android.apps.chrome.** { | 33 -keepclasseswithmembers class com.google.android.apps.chrome.** { |
35 @**.CalledByNativeUnchecked <methods>; | 34 @**.CalledByNativeUnchecked <methods>; |
36 } | 35 } |
37 -keepclasseswithmembers class com.google.android.apps.chrome.** { | 36 -keepclasseswithmembers class com.google.android.apps.chrome.** { |
38 @**.JavascriptInterface <methods>; | 37 @**.JavascriptInterface <methods>; |
39 } | 38 } |
40 -keepclasseswithmembers class com.google.android.apps.chrome.** { | 39 -keepclasseswithmembers class com.google.android.apps.chrome.** { |
41 @**.NativeCall <methods>; | 40 @**.NativeCall <methods>; |
42 } | 41 } |
43 -keepclasseswithmembers class com.google.android.apps.chrome.** { | 42 -keepclasseswithmembers class com.google.android.apps.chrome.** { |
44 @**.UsedByReflection <methods>; | 43 @**.UsedByReflection <methods>; |
45 } | 44 } |
46 -keepclasseswithmembers class com.google.android.apps.chrome.** { | 45 -keepclasseswithmembers class com.google.android.apps.chrome.** { |
47 @**.VisibleForTesting <methods>; | |
48 } | |
49 -keepclasseswithmembers class com.google.android.apps.chrome.** { | |
50 native <methods>; | 46 native <methods>; |
51 } | 47 } |
52 -keepclasseswithmembers class org.chromium.** { | 48 -keepclasseswithmembers class org.chromium.** { |
53 @**.AccessedByNative <fields>; | 49 @**.AccessedByNative <fields>; |
54 } | 50 } |
55 -keepclasseswithmembers class org.chromium.** { | 51 -keepclasseswithmembers class org.chromium.** { |
56 @**.CalledByNative <methods>; | 52 @**.CalledByNative <methods>; |
57 } | 53 } |
58 -keepclasseswithmembers class org.chromium.** { | 54 -keepclasseswithmembers class org.chromium.** { |
59 @**.CalledByNativeUnchecked <methods>; | 55 @**.CalledByNativeUnchecked <methods>; |
60 } | 56 } |
61 -keepclasseswithmembers class org.chromium.** { | 57 -keepclasseswithmembers class org.chromium.** { |
62 @**.JavascriptInterface <methods>; | 58 @**.JavascriptInterface <methods>; |
63 } | 59 } |
64 -keepclasseswithmembers class org.chromium.** { | 60 -keepclasseswithmembers class org.chromium.** { |
65 @**.NativeCall <methods>; | 61 @**.NativeCall <methods>; |
66 } | 62 } |
67 -keepclasseswithmembers class org.chromium.** { | 63 -keepclasseswithmembers class org.chromium.** { |
68 @**.UsedByReflection <methods>; | 64 @**.UsedByReflection <methods>; |
69 } | 65 } |
70 -keepclasseswithmembers class org.chromium.** { | 66 -keepclasseswithmembers class org.chromium.** { |
71 @**.VisibleForTesting <methods>; | |
72 } | |
73 -keepclasseswithmembers class org.chromium.** { | |
74 native <methods>; | 67 native <methods>; |
75 } | 68 } |
76 | 69 |
77 # Class merging provides negligible .dex size reduction and method count | 70 # Class merging provides negligible .dex size reduction and method count |
78 # reduction (about 0.3% improvement on method count, and 0.1% savings on size), | 71 # reduction (about 0.3% improvement on method count, and 0.1% savings on size), |
79 # and it messes up stack traces if the classes are optimized. Thus, it is in our | 72 # and it messes up stack traces if the classes are optimized. Thus, it is in our |
80 # best interests to turn it off. See crbug.com/620323 | 73 # best interests to turn it off. See crbug.com/620323 |
81 -optimizations !class/merging/* | 74 -optimizations !class/merging/* |
82 | 75 |
83 # Keep all runtime visible annotations | 76 # Keep all runtime visible annotations |
84 -keepattributes RuntimeVisibleAnnotations | 77 -keepattributes RuntimeVisibleAnnotations |
85 | 78 |
86 # Remove methods annotated with this if their return value is unused | 79 # Remove methods annotated with this if their return value is unused |
87 -assumenosideeffects class ** { | 80 -assumenosideeffects class ** { |
88 @org.chromium.base.annotations.RemovableInRelease <methods>; | 81 @org.chromium.base.annotations.RemovableInRelease <methods>; |
89 } | 82 } |
90 | 83 |
91 # TODO(aurimas): figure out why we need to keep these classes. | |
92 -keep class org.chromium.base.test.** { | |
93 *; | |
94 } | |
95 | |
96 # Keep protobuf code used via reflection | 84 # Keep protobuf code used via reflection |
97 # TODO(tonyg): Removing these -keeps results in new notes, but nothing seems to | 85 # TODO(tonyg): Removing these -keeps results in new notes, but nothing seems to |
98 # break. This exclusion costs almost 100k of dex size so consider replacing it | 86 # break. This exclusion costs almost 100k of dex size so consider replacing it |
99 # with a -dontnote after more testing. | 87 # with a -dontnote after more testing. |
100 -keep class com.google.protobuf.** { | 88 -keep class com.google.protobuf.** { |
101 *** newBuilder(); | 89 *** newBuilder(); |
102 *** parseFrom(java.io.InputStream); | 90 *** parseFrom(java.io.InputStream); |
103 } | 91 } |
104 | 92 |
105 # Keep the client interfaces for cacheinvalidation as they are used as | 93 # Keep the client interfaces for cacheinvalidation as they are used as |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
149 | 137 |
150 # Allows Proguard freedom in removing these log related calls. We ask for debug | 138 # Allows Proguard freedom in removing these log related calls. We ask for debug |
151 # and verbose logs to be stripped out in base.Log, so we are just ensuring we | 139 # and verbose logs to be stripped out in base.Log, so we are just ensuring we |
152 # get rid of all other debug/verbose logs. | 140 # get rid of all other debug/verbose logs. |
153 -assumenosideeffects class android.util.Log { | 141 -assumenosideeffects class android.util.Log { |
154 static *** d(...); | 142 static *** d(...); |
155 static *** v(...); | 143 static *** v(...); |
156 static *** isLoggable(...); | 144 static *** isLoggable(...); |
157 } | 145 } |
158 | 146 |
159 # Everything below this is kept because they are referenced by the test APK. | |
160 -keep class android.support.v7.mediarouter.R* { | |
161 *; | |
162 } | |
163 | 147 |
164 -keep class android.support.v7.media.MediaRouteProvider** { | |
165 *; | |
166 } | |
167 | |
168 -keep class android.support.v4.app.FragmentManager** { | |
169 *; | |
170 } | |
171 | |
172 -keep class android.support.v4.app.DialogFragment** { | |
173 *; | |
174 } | |
175 | |
176 -keep class android.support.v7.app.NotificationCompat** { | |
177 *; | |
178 } | |
179 | |
180 -keep class android.support.v7.app.AlertDialog** { | |
181 *; | |
182 } | |
183 | |
184 -keep class com.google.android.gms.cast.CastMediaControlIntent* { | |
185 *; | |
186 } | |
187 | |
188 -keepnames class com.google.android.gms.gcm.** { | |
189 *; | |
190 } | |
191 | |
192 -keepclassmembers class com.google.android.gms.gcm.TaskParams { | |
193 public <init>(java.lang.String); | |
194 } | |
195 | |
196 -keepnames class jp.tomorrowkey.android.gifplayer.** { | |
197 public *; | |
198 } | |
199 | |
200 # Used in tests. | |
201 -keep class android.support.v4.view.ViewCompat { | |
202 public static int getLayoutDirection(android.view.View); | |
203 } | |
204 | |
205 # flingViewport is used by Android WebView and a Chrome test. | |
206 -keepclassmembers class org.chromium.content.browser.ContentViewCore { | |
207 public void flingViewport(long, int, int); | |
208 } | |
209 | |
210 # Needed to compile ChromeTest.apk | |
211 -keep class android.support.customtabs.** { | |
212 *; | |
213 } | |
214 | |
215 # TODO(yfriedman): Remove when crbug.com/488192 is fixed. | |
216 -dontwarn org.apache.http.conn.scheme.LayeredSocketFactory | |
217 | |
218 # Needed to run ChromeTest.apk | |
219 -keepnames class com.google.android.gms.common.GoogleApiAvailability { | |
220 *; | |
221 } | |
222 | |
223 # Needed for chrome_sync_shell_test_apk. Note - these do no affect chrome_apk's | |
224 # size. | |
225 -keep class org.chromium.sync.protocol.* { *; } | |
Yaron
2016/07/08 21:29:27
wonder if this will be still be needed. probably n
smaier
2016/07/11 14:54:25
As of ~3 weeks ago, it was needed. Is there anythi
| |
226 | |
227 # These resources are referenced in tests, but not in the real application. | |
228 -keepclassmembers class org.chromium.chrome.R$id { | |
229 int webapp_splash_space; | |
230 int mr_chooser_list; | |
231 int find_toolbar; | |
232 } | |
OLD | NEW |