I wrote those ProGuard rules. :) The pull request discussion about these changes may provide relevant background.
I understand your confusion, the ProGuard rules documentation is quite sparse.
-if
class_specification
Specifies classes and class members that must be present
to activate the subsequent keep option (-keep
,
-keepclassmembers
,...). The condition and the subsequent keep option can share wildcards and references to wildcards. For example, you can
keep classes on the condition that classes with related names exist in
your project, with frameworks like Dagger and Butterknife.
As written in the comments of the rules you copied this from:
# Keep `Companion` object fields of serializable classes.
# This avoids serializer lookup through `getDeclaredClasses` as done for named companion objects.
-if @kotlinx.serialization.Serializable class **
...
So, -if @kotlinx.serialization.Serializable class **
should be read as: for all classes which have the @Serializable
annotation applied (i.e., "serializable classes"). The <1>
in -keepmembers
subsequently refers to the **
wildcard, i.e., the fully-qualified class name.