Proguard: ignore proguard library errors

I am optimizing the proguard configuration, and I still keep some class names that are optional.

After thinking deeply, I finally find why. My class implements Parcelable, and I use some libraries that use this proguard configuration:

# Needed for Parcelable/SafeParcelable Creators to not get stripped
-keepnames class * implements android.os.Parcelable {
    public static final ** CREATOR;
}

which seems to save class and field names CREATOR. I think just a field is CREATORreally necessary, as you can read in the official proguard-android-optimize.txtproguard file :

-keepclassmembers class * implements android.os.Parcelable {
    public static final ** CREATOR;
}

Since I do not own the library, I cannot change it. Is there a way to override their proguard configuration file? (which can be included in the consumerProguardFilesgradle key )

Thanks for answers.

+4

Source: https://habr.com/ru/post/1676275/


All Articles