blob: 10bb00cad1a026f785b5d97ced1e1ecac45ef994 [file] [log] [blame]
Jared Duke629526d2022-02-08 11:28:34 -08001# Preserve line number information for debugging stack traces.
2-keepattributes SourceFile,LineNumberTable
3
Jared Duke084685542022-06-03 11:14:24 -07004# Preserve relationship information that can impact simple class naming.
5-keepattributes EnclosingMethod,InnerClasses
6
Yohei Yukawa25c61e42022-02-14 22:30:49 +00007-keep class com.android.systemui.recents.OverviewProxyRecentsImpl
8-keep class com.android.systemui.statusbar.car.CarStatusBar
Caitlin Cassidya3bcac52022-02-25 16:17:55 +00009-keep class com.android.systemui.statusbar.phone.CentralSurfaces
Yohei Yukawa25c61e42022-02-14 22:30:49 +000010-keep class com.android.systemui.statusbar.tv.TvStatusBar
Dave Mankoff37459832022-07-08 18:20:20 +000011-keep class ** extends com.android.systemui.SystemUIInitializer {
12 *;
13}
Yohei Yukawa25c61e42022-02-14 22:30:49 +000014-keep class * extends com.android.systemui.CoreStartable
15-keep class * implements com.android.systemui.CoreStartable$Injector
Winsone6c90732015-09-24 16:06:29 -070016
Fabian Kozynski31ea98c02022-08-01 12:35:31 -040017# Needed for builds to properly initialize KeyFrames from xml scene
18-keepclassmembers class * extends androidx.constraintlayout.motion.widget.Key {
19 public <init>();
20}
21
Jared Duke1b05e742023-01-06 21:53:58 +000022# Needed to ensure callback field references are kept in their respective
23# owning classes when the downstream callback registrars only store weak refs.
24# TODO(b/264686688): Handle these cases with more targeted annotations.
25-keepclassmembers,allowaccessmodification class com.android.systemui.**, com.android.keyguard.** {
26 private com.android.keyguard.KeyguardUpdateMonitorCallback *;
Jared Duke1935a2f2023-01-12 13:56:51 -080027 private com.android.systemui.privacy.PrivacyConfig$Callback *;
Jared Duke1b05e742023-01-06 21:53:58 +000028 private com.android.systemui.privacy.PrivacyItemController$Callback *;
29 private com.android.systemui.settings.UserTracker$Callback *;
30 private com.android.systemui.statusbar.phone.StatusBarWindowCallback *;
31 private com.android.systemui.util.service.Observer$Callback *;
32 private com.android.systemui.util.service.ObservableServiceConnection$Callback *;
33}
Jared Duke1935a2f2023-01-12 13:56:51 -080034# Note that these rules are temporary companions to the above rules, required
35# for cases like Kotlin where fields with anonymous types use the anonymous type
36# rather than the supertype.
37-if class * extends com.android.keyguard.KeyguardUpdateMonitorCallback
38-keepclassmembers,allowaccessmodification class com.android.systemui.**, com.android.keyguard.** {
39 <1> *;
40}
41-if class * extends com.android.systemui.privacy.PrivacyConfig$Callback
42-keepclassmembers,allowaccessmodification class com.android.systemui.**, com.android.keyguard.** {
43 <1> *;
44}
45-if class * extends com.android.systemui.privacy.PrivacyItemController$Callback
46-keepclassmembers,allowaccessmodification class com.android.systemui.**, com.android.keyguard.** {
47 <1> *;
48}
49-if class * extends com.android.systemui.settings.UserTracker$Callback
50-keepclassmembers,allowaccessmodification class com.android.systemui.**, com.android.keyguard.** {
51 <1> *;
52}
53-if class * extends com.android.systemui.statusbar.phone.StatusBarWindowCallback
54-keepclassmembers,allowaccessmodification class com.android.systemui.**, com.android.keyguard.** {
55 <1> *;
56}
57-if class * extends com.android.systemui.util.service.Observer$Callback
58-keepclassmembers,allowaccessmodification class com.android.systemui.**, com.android.keyguard.** {
59 <1> *;
60}
61-if class * extends com.android.systemui.util.service.ObservableServiceConnection$Callback
62-keepclassmembers,allowaccessmodification class com.android.systemui.**, com.android.keyguard.** {
63 <1> *;
64}
Jared Duke1b05e742023-01-06 21:53:58 +000065
Jason Monk87ccd552015-12-11 21:39:54 -050066-keepclasseswithmembers class * {
67 public <init>(android.content.Context, android.util.AttributeSet);
68}
69
Aurimas Liutikasfd52c142018-04-17 09:50:46 -070070-keep class ** extends androidx.preference.PreferenceFragment
Yohei Yukawa25c61e42022-02-14 22:30:49 +000071-keep class com.android.systemui.tuner.*
Kevin Jeon4c394532022-11-15 19:00:12 +000072
Jared Duke548aa372022-11-30 13:38:17 -080073# The plugins subpackage acts as a shared library that might be referenced in
Kevin Jeon4c394532022-11-15 19:00:12 +000074# dynamically-loaded plugin APKs.
Jason Monk86bc3312016-08-16 13:17:56 -040075-keep class com.android.systemui.plugins.** {
Jason Monke6089af2018-07-31 14:38:11 -040076 *;
Jason Monk86bc3312016-08-16 13:17:56 -040077}
Jason Monk9424af72018-12-19 14:17:26 -050078-keep class com.android.systemui.fragments.FragmentService$FragmentCreator {
79 *;
80}
Aurimas Liutikasfd52c142018-04-17 09:50:46 -070081-keep class androidx.core.app.CoreComponentFactory
Dave Mankoffa5d8a392019-10-10 12:21:09 -040082
Yohei Yukawa25c61e42022-02-14 22:30:49 +000083-keep public class * extends com.android.systemui.CoreStartable {
84 public <init>(android.content.Context);
85}
86
Winson Chungb754f522020-08-03 22:17:08 -070087# Keep the wm shell lib
Dave Mankoff85528072020-08-06 10:32:25 -040088-keep class com.android.wm.shell.*
Winson Chungb754f522020-08-03 22:17:08 -070089# Keep the protolog group methods that are called by the generated code
90-keepclassmembers class com.android.wm.shell.protolog.ShellProtoLogGroup {
91 *;
92}
Dave Mankoff85528072020-08-06 10:32:25 -040093
Yohei Yukawa25c61e42022-02-14 22:30:49 +000094-keep,allowoptimization,allowaccessmodification class com.android.systemui.dagger.GlobalRootComponent { !synthetic *; }
95-keep,allowoptimization,allowaccessmodification class com.android.systemui.dagger.GlobalRootComponent$SysUIComponentImpl { !synthetic *; }
96-keep,allowoptimization,allowaccessmodification class com.android.systemui.dagger.Dagger** { !synthetic *; }
97-keep,allowoptimization,allowaccessmodification class com.android.systemui.tv.Dagger** { !synthetic *; }
98
Jared Duke83a28e62022-03-03 13:11:46 -080099# Prevent optimization or access modification of any referenced code that may
100# conflict with code in the bootclasspath.
101# TODO(b/222468116): Resolve such collisions in the build system.
102-keepnames class android.**.nano.** { *; }
103-keepnames class com.android.**.nano.** { *; }
104-keepnames class com.android.internal.protolog.** { *; }
105-keepnames class android.hardware.common.** { *; }
106
Jared Duke2fee7402021-10-18 14:35:04 -0700107# Allows proguard to make private and protected methods and fields public as
108# part of optimization. This lets proguard inline trivial getter/setter methods.
109-allowaccessmodification
Jared Dukedc1646f2021-11-30 12:35:45 -0800110
111# Removes runtime checks added through Kotlin to JVM code genereration to
112# avoid linear growth as more Kotlin code is converted / added to the codebase.
113# These checks are generally applied to Java platform types (values returned
114# from Java code that don't have nullness annotations), but we remove them to
115# avoid code size increases.
116#
117# See also https://kotlinlang.org/docs/reference/java-interop.html
118#
119# TODO(b/199941987): Consider standardizing these rules in a central place as
120# Kotlin gains adoption with other platform targets.
121-assumenosideeffects class kotlin.jvm.internal.Intrinsics {
122 # Remove check for method parameters being null
123 static void checkParameterIsNotNull(java.lang.Object, java.lang.String);
124
125 # When a Java platform type is returned and passed to Kotlin NonNull method,
126 # remove the null check
127 static void checkExpressionValueIsNotNull(java.lang.Object, java.lang.String);
128 static void checkNotNullExpressionValue(java.lang.Object, java.lang.String);
129
130 # Remove check that final value returned from method is null, if passing
131 # back Java platform type.
132 static void checkReturnedValueIsNotNull(java.lang.Object, java.lang.String, java.lang.String);
133 static void checkReturnedValueIsNotNull(java.lang.Object, java.lang.String);
134
135 # Null check for accessing a field from a parent class written in Java.
136 static void checkFieldIsNotNull(java.lang.Object, java.lang.String, java.lang.String);
137 static void checkFieldIsNotNull(java.lang.Object, java.lang.String);
138
139 # Removes code generated from !! operator which converts Nullable type to
140 # NonNull type. These would throw an NPE immediate after on access.
141 static void checkNotNull(java.lang.Object, java.lang.String);
142 static void checkNotNullParameter(java.lang.Object, java.lang.String);
143
144 # Removes lateinit var check being used before being set. Check is applied
145 # on every field access without this.
146 static void throwUninitializedPropertyAccessException(java.lang.String);
147}
Kevin Jeona4a104a2022-06-13 17:49:45 +0000148# Strip verbose logs.
149-assumenosideeffects class android.util.Log {
150 static *** v(...);
151 static *** isLoggable(...);
152}
153-assumenosideeffects class android.util.Slog {
154 static *** v(...);
155}
156-maximumremovedandroidloglevel 2