From 91bc6c288fc46107854aa4ec275b1e7564d30808 Mon Sep 17 00:00:00 2001 From: Christoffer Adamsen Date: Mon, 6 Jan 2025 13:04:08 +0100 Subject: 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: Idbadcd81d516f851cc9bfa1333d76f1036803291 --- java/proguard.flags | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) (limited to 'java/proguard.flags') diff --git a/java/proguard.flags b/java/proguard.flags index c832a88e3..0ebca04de 100644 --- a/java/proguard.flags +++ b/java/proguard.flags @@ -1,11 +1,17 @@ # Keep classes and methods that have the @UsedForTesting annotation --keep @com.android.inputmethod.annotations.UsedForTesting class * +# TODO(b/373579455): Evaluate if needs to be kept. +-keep @com.android.inputmethod.annotations.UsedForTesting class * { + void (); +} -keepclassmembers class * { @com.android.inputmethod.annotations.UsedForTesting *; } # Keep classes and methods that have the @ExternallyReferenced annotation --keep @com.android.inputmethod.annotations.ExternallyReferenced class * +# TODO(b/373579455): Evaluate if needs to be kept. +-keep @com.android.inputmethod.annotations.ExternallyReferenced class * { + void (); +} -keepclassmembers class * { @com.android.inputmethod.annotations.ExternallyReferenced *; } @@ -17,11 +23,26 @@ # Keep classes that are used as a parameter type of methods that are also marked as keep # to preserve changing those methods' signature. --keep class com.android.inputmethod.latin.AssetFileAddress --keep class com.android.inputmethod.latin.Dictionary --keep class com.android.inputmethod.latin.NgramContext --keep class com.android.inputmethod.latin.makedict.ProbabilityInfo --keep class com.android.inputmethod.latin.utils.LanguageModelParam +# TODO(b/373579455): Evaluate if needs to be kept. +-keep class com.android.inputmethod.latin.AssetFileAddress { + void (); +} +# TODO(b/373579455): Evaluate if needs to be kept. +-keep class com.android.inputmethod.latin.Dictionary { + void (); +} +# TODO(b/373579455): Evaluate if needs to be kept. +-keep class com.android.inputmethod.latin.NgramContext { + void (); +} +# TODO(b/373579455): Evaluate if needs to be kept. +-keep class com.android.inputmethod.latin.makedict.ProbabilityInfo { + void (); +} +# TODO(b/373579455): Evaluate if needs to be kept. +-keep class com.android.inputmethod.latin.utils.LanguageModelParam { + void (); +} # TODO: remove once used in code. -keep class com.android.inputmethod.keyboard.KeyboardLayout { *; } -- cgit v1.2.3-83-g751a