Explicitly keep default constructor in rules without members
R8 implicitly keeps the default constructor when no member rules are specified. Future versions of R8 will require apps to explicitly keep the default constructors that are required for the build to work.
This conservatively changes all keep rules that currently keep the default constructor to explicitly keep the default constructor.
Future work will attempt to tighten up the rules that do not require the default constructor to be kept.
Bug: 373579455
Test: existing
Change-Id: Id177981056cdafdcd0d5a66bdfa40cc75c6d5ae2
diff --git a/proguard.flags b/proguard.flags
index ebc8922..1c79a2d 100644
--- a/proguard.flags
+++ b/proguard.flags
@@ -6,24 +6,27 @@
# Keep deprecated GSM SMS API
-keepclasseswithmembers class android.telephony.gsm.SmsManager,android.telephony.gsm.SmsManager$* {
-public *;
+ public *;
}
-keepclasseswithmembers class android.telephony.gsm.SmsMessage,android.telephony.gsm.SmsMessage$* {
-public protected *;
+ public protected *;
}
# Keep telephony sysprop
-keepclasseswithmembers class android.internal.telephony.sysprop.TelephonyProperties {
-public *;
+ public *;
}
# Keep public classes and public/protected members
-keepclasseswithmembers class com.android.internal.telephony.** {
-public protected *;
+ public protected *;
}
# Keep classes and members that have the @UnsupportedAppUsage annotation
--keep @**.UnsupportedAppUsage class *
+# TODO(b/373579455): Evaluate if <init> needs to be kept.
+-keep @**.UnsupportedAppUsage class * {
+ void <init>();
+}
-keepclassmembers class * {
-@**.UnsupportedAppUsage *;
+ @**.UnsupportedAppUsage *;
}