xref: /aosp_15_r20/external/cronet/base/android/proguard/chromium_code.flags (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1*6777b538SAndroid Build Coastguard Worker# Copyright 2016 The Chromium Authors
2*6777b538SAndroid Build Coastguard Worker# Use of this source code is governed by a BSD-style license that can be
3*6777b538SAndroid Build Coastguard Worker# found in the LICENSE file.
4*6777b538SAndroid Build Coastguard Worker
5*6777b538SAndroid Build Coastguard Worker# Contains flags that can be safely shared with Cronet, and thus would be
6*6777b538SAndroid Build Coastguard Worker# appropriate for third-party apps to include.
7*6777b538SAndroid Build Coastguard Worker
8*6777b538SAndroid Build Coastguard Worker# Allow unused native methods to be removed, but prevent renaming on those that are kept.
9*6777b538SAndroid Build Coastguard Worker-keepclasseswithmembernames,includedescriptorclasses,allowaccessmodification class !cr_allowunused,** {
10*6777b538SAndroid Build Coastguard Worker  native <methods>;
11*6777b538SAndroid Build Coastguard Worker}
12*6777b538SAndroid Build Coastguard Worker
13*6777b538SAndroid Build Coastguard Worker# Use assumevalues block instead of assumenosideeffects block because Google3 proguard cannot parse
14*6777b538SAndroid Build Coastguard Worker# assumenosideeffects blocks which overwrite return value.
15*6777b538SAndroid Build Coastguard Worker# chromium_code.flags rather than remove_logging.flags so that it's included
16*6777b538SAndroid Build Coastguard Worker# in cronet.
17*6777b538SAndroid Build Coastguard Worker-assumevalues class org.chromium.base.Log {
18*6777b538SAndroid Build Coastguard Worker  static boolean isDebug() return false;
19*6777b538SAndroid Build Coastguard Worker}
20*6777b538SAndroid Build Coastguard Worker
21*6777b538SAndroid Build Coastguard Worker# Keep all CREATOR fields within Parcelable that are kept.
22*6777b538SAndroid Build Coastguard Worker-keepclassmembers class !cr_allowunused,org.chromium.** implements android.os.Parcelable {
23*6777b538SAndroid Build Coastguard Worker  public static *** CREATOR;
24*6777b538SAndroid Build Coastguard Worker}
25*6777b538SAndroid Build Coastguard Worker
26*6777b538SAndroid Build Coastguard Worker# Don't obfuscate Parcelables as they might be marshalled outside Chrome.
27*6777b538SAndroid Build Coastguard Worker# If we annotated all Parcelables that get put into Bundles other than
28*6777b538SAndroid Build Coastguard Worker# for saveInstanceState (e.g. PendingIntents), then we could actually keep the
29*6777b538SAndroid Build Coastguard Worker# names of just those ones. For now, we'll just keep them all.
30*6777b538SAndroid Build Coastguard Worker-keepnames,allowaccessmodification class !cr_allowunused,org.chromium.** implements android.os.Parcelable {}
31*6777b538SAndroid Build Coastguard Worker
32*6777b538SAndroid Build Coastguard Worker# Keep all enum values and valueOf methods. See
33*6777b538SAndroid Build Coastguard Worker# http://proguard.sourceforge.net/index.html#manual/examples.html
34*6777b538SAndroid Build Coastguard Worker# for the reason for this. Also, see http://crbug.com/248037.
35*6777b538SAndroid Build Coastguard Worker-keepclassmembers enum !cr_allowunused,org.chromium.** {
36*6777b538SAndroid Build Coastguard Worker    public static **[] values();
37*6777b538SAndroid Build Coastguard Worker}
38*6777b538SAndroid Build Coastguard Worker
39*6777b538SAndroid Build Coastguard Worker# -identifiernamestring doesn't keep the module impl around, we have to
40*6777b538SAndroid Build Coastguard Worker# explicitly keep it.
41*6777b538SAndroid Build Coastguard Worker-if @org.chromium.components.module_installer.builder.ModuleInterface interface *
42*6777b538SAndroid Build Coastguard Worker-keep,allowobfuscation,allowaccessmodification class !cr_allowunused,** extends <1> {
43*6777b538SAndroid Build Coastguard Worker  <init>();
44*6777b538SAndroid Build Coastguard Worker}
45*6777b538SAndroid Build Coastguard Worker
46*6777b538SAndroid Build Coastguard Worker# Required to remove fields until b/274802355 is resolved.
47*6777b538SAndroid Build Coastguard Worker-assumevalues class !cr_allowunused,** {
48*6777b538SAndroid Build Coastguard Worker  final org.chromium.base.ThreadUtils$ThreadChecker * return _NONNULL_;
49*6777b538SAndroid Build Coastguard Worker}
50*6777b538SAndroid Build Coastguard Worker
51*6777b538SAndroid Build Coastguard Worker# TODO(agrieve): Remove once we start to use Android U SDK.
52*6777b538SAndroid Build Coastguard Worker-dontwarn android.window.BackEvent
53*6777b538SAndroid Build Coastguard Worker-dontwarn android.window.OnBackAnimationCallback
54