blob: 5fc919330e928ea1f4ad3a78aa4b2c0135c6b9d5 [file] [log] [blame]
Jared Duke629526d2022-02-08 11:28:34 -08001# Preserve line number information for debugging stack traces.
2-keepattributes SourceFile,LineNumberTable
3
Yohei Yukawa25c61e42022-02-14 22:30:49 +00004-keep class com.android.systemui.recents.OverviewProxyRecentsImpl
5-keep class com.android.systemui.statusbar.car.CarStatusBar
Dave Mankoff4a38c282022-04-22 15:28:57 +00006-keep class com.android.systemui.statusbar.phone.CentralSurfaces
Yohei Yukawa25c61e42022-02-14 22:30:49 +00007-keep class com.android.systemui.statusbar.tv.TvStatusBar
Dave Mankoffa267ea02022-07-08 18:20:20 +00008-keep class ** extends com.android.systemui.SystemUIInitializer {
9 *;
10}
Yohei Yukawa25c61e42022-02-14 22:30:49 +000011-keep class * extends com.android.systemui.CoreStartable
12-keep class * implements com.android.systemui.CoreStartable$Injector
Winsone6c90732015-09-24 16:06:29 -070013
Fabian Kozynski31ea98c02022-08-01 12:35:31 -040014# Needed for builds to properly initialize KeyFrames from xml scene
15-keepclassmembers class * extends androidx.constraintlayout.motion.widget.Key {
16 public <init>();
17}
18
Jared Duke1b05e742023-01-06 21:53:58 +000019# Needed to ensure callback field references are kept in their respective
20# owning classes when the downstream callback registrars only store weak refs.
21# TODO(b/264686688): Handle these cases with more targeted annotations.
22-keepclassmembers,allowaccessmodification class com.android.systemui.**, com.android.keyguard.** {
23 private com.android.keyguard.KeyguardUpdateMonitorCallback *;
Jared Duke1935a2f2023-01-12 13:56:51 -080024 private com.android.systemui.privacy.PrivacyConfig$Callback *;
Jared Duke1b05e742023-01-06 21:53:58 +000025 private com.android.systemui.privacy.PrivacyItemController$Callback *;
26 private com.android.systemui.settings.UserTracker$Callback *;
27 private com.android.systemui.statusbar.phone.StatusBarWindowCallback *;
28 private com.android.systemui.util.service.Observer$Callback *;
29 private com.android.systemui.util.service.ObservableServiceConnection$Callback *;
30}
Jared Duke1935a2f2023-01-12 13:56:51 -080031# Note that these rules are temporary companions to the above rules, required
32# for cases like Kotlin where fields with anonymous types use the anonymous type
33# rather than the supertype.
34-if class * extends com.android.keyguard.KeyguardUpdateMonitorCallback
35-keepclassmembers,allowaccessmodification class com.android.systemui.**, com.android.keyguard.** {
36 <1> *;
37}
38-if class * extends com.android.systemui.privacy.PrivacyConfig$Callback
39-keepclassmembers,allowaccessmodification class com.android.systemui.**, com.android.keyguard.** {
40 <1> *;
41}
42-if class * extends com.android.systemui.privacy.PrivacyItemController$Callback
43-keepclassmembers,allowaccessmodification class com.android.systemui.**, com.android.keyguard.** {
44 <1> *;
45}
46-if class * extends com.android.systemui.settings.UserTracker$Callback
47-keepclassmembers,allowaccessmodification class com.android.systemui.**, com.android.keyguard.** {
48 <1> *;
49}
50-if class * extends com.android.systemui.statusbar.phone.StatusBarWindowCallback
51-keepclassmembers,allowaccessmodification class com.android.systemui.**, com.android.keyguard.** {
52 <1> *;
53}
54-if class * extends com.android.systemui.util.service.Observer$Callback
55-keepclassmembers,allowaccessmodification class com.android.systemui.**, com.android.keyguard.** {
56 <1> *;
57}
58-if class * extends com.android.systemui.util.service.ObservableServiceConnection$Callback
59-keepclassmembers,allowaccessmodification class com.android.systemui.**, com.android.keyguard.** {
60 <1> *;
61}
Jared Duke1b05e742023-01-06 21:53:58 +000062
Jason Monk87ccd552015-12-11 21:39:54 -050063-keepclasseswithmembers class * {
64 public <init>(android.content.Context, android.util.AttributeSet);
65}
66
Aurimas Liutikasfd52c142018-04-17 09:50:46 -070067-keep class ** extends androidx.preference.PreferenceFragment
Yohei Yukawa25c61e42022-02-14 22:30:49 +000068-keep class com.android.systemui.tuner.*
Kevin Jeon4c394532022-11-15 19:00:12 +000069
Jared Duke548aa372022-11-30 13:38:17 -080070# The plugins subpackage acts as a shared library that might be referenced in
Kevin Jeon4c394532022-11-15 19:00:12 +000071# dynamically-loaded plugin APKs.
Jason Monk86bc3312016-08-16 13:17:56 -040072-keep class com.android.systemui.plugins.** {
Jason Monke6089af2018-07-31 14:38:11 -040073 *;
Jason Monk86bc3312016-08-16 13:17:56 -040074}
Jason Monk9424af72018-12-19 14:17:26 -050075-keep class com.android.systemui.fragments.FragmentService$FragmentCreator {
76 *;
77}
Aurimas Liutikasfd52c142018-04-17 09:50:46 -070078-keep class androidx.core.app.CoreComponentFactory
Dave Mankoffa5d8a392019-10-10 12:21:09 -040079
Yohei Yukawa25c61e42022-02-14 22:30:49 +000080-keep public class * extends com.android.systemui.CoreStartable {
81 public <init>(android.content.Context);
82}
83
Winson Chungb754f522020-08-03 22:17:08 -070084# Keep the wm shell lib
Dave Mankoff85528072020-08-06 10:32:25 -040085-keep class com.android.wm.shell.*
Winson Chungb754f522020-08-03 22:17:08 -070086# Keep the protolog group methods that are called by the generated code
87-keepclassmembers class com.android.wm.shell.protolog.ShellProtoLogGroup {
88 *;
89}
Dave Mankoff85528072020-08-06 10:32:25 -040090
Yohei Yukawa25c61e42022-02-14 22:30:49 +000091-keep,allowoptimization,allowaccessmodification class com.android.systemui.dagger.GlobalRootComponent { !synthetic *; }
92-keep,allowoptimization,allowaccessmodification class com.android.systemui.dagger.GlobalRootComponent$SysUIComponentImpl { !synthetic *; }
93-keep,allowoptimization,allowaccessmodification class com.android.systemui.dagger.Dagger** { !synthetic *; }
94-keep,allowoptimization,allowaccessmodification class com.android.systemui.tv.Dagger** { !synthetic *; }
95
Jared Duke83a28e62022-03-03 13:11:46 -080096# Prevent optimization or access modification of any referenced code that may
97# conflict with code in the bootclasspath.
98# TODO(b/222468116): Resolve such collisions in the build system.
99-keepnames class android.**.nano.** { *; }
100-keepnames class com.android.**.nano.** { *; }
101-keepnames class com.android.internal.protolog.** { *; }
102-keepnames class android.hardware.common.** { *; }
103
Jared Duke2fee7402021-10-18 14:35:04 -0700104# Allows proguard to make private and protected methods and fields public as
105# part of optimization. This lets proguard inline trivial getter/setter methods.
106-allowaccessmodification
Jared Dukedc1646f2021-11-30 12:35:45 -0800107
108# Removes runtime checks added through Kotlin to JVM code genereration to
109# avoid linear growth as more Kotlin code is converted / added to the codebase.
110# These checks are generally applied to Java platform types (values returned
111# from Java code that don't have nullness annotations), but we remove them to
112# avoid code size increases.
113#
114# See also https://kotlinlang.org/docs/reference/java-interop.html
115#
116# TODO(b/199941987): Consider standardizing these rules in a central place as
117# Kotlin gains adoption with other platform targets.
118-assumenosideeffects class kotlin.jvm.internal.Intrinsics {
119 # Remove check for method parameters being null
120 static void checkParameterIsNotNull(java.lang.Object, java.lang.String);
121
122 # When a Java platform type is returned and passed to Kotlin NonNull method,
123 # remove the null check
124 static void checkExpressionValueIsNotNull(java.lang.Object, java.lang.String);
125 static void checkNotNullExpressionValue(java.lang.Object, java.lang.String);
126
127 # Remove check that final value returned from method is null, if passing
128 # back Java platform type.
129 static void checkReturnedValueIsNotNull(java.lang.Object, java.lang.String, java.lang.String);
130 static void checkReturnedValueIsNotNull(java.lang.Object, java.lang.String);
131
132 # Null check for accessing a field from a parent class written in Java.
133 static void checkFieldIsNotNull(java.lang.Object, java.lang.String, java.lang.String);
134 static void checkFieldIsNotNull(java.lang.Object, java.lang.String);
135
136 # Removes code generated from !! operator which converts Nullable type to
137 # NonNull type. These would throw an NPE immediate after on access.
138 static void checkNotNull(java.lang.Object, java.lang.String);
139 static void checkNotNullParameter(java.lang.Object, java.lang.String);
140
141 # Removes lateinit var check being used before being set. Check is applied
142 # on every field access without this.
143 static void throwUninitializedPropertyAccessException(java.lang.String);
144}