mercredi 19 mai 2021

How to exclude the R class from being obfuscated by ProGuard?

I currently get a list of fonts dynamically via reflection (as I understand it...) using the following method:

com.example.helloworld.R.font.class.getFields();

This breaks when using ProGuard's minify so I've added in the following lines to Proguard-rules:

-keep class com.example.helloworld.R* {
    <fields>;
}

I'm guessing this will end up excluding all classes in my app beginning with R... I tried being as specific as possible using com.example.helloworld.R.font* but it doesn't work.

What should the correct exclusion rule be in this case if I just want the Resource.font class excluded?





Aucun commentaire:

Enregistrer un commentaire