androidandroid-studioproguardandroid-r8android-obfuscation

How can I disable renaming names of fragments classes during obfuscation?


Which ProGuard/R8 rules to use?

Currently only Activites aren't renamed

enter image description here

I need to keep names of Fragment for screens logging as well but the code itself in fragments should be obfuscated


Solution

  • You can say proguard to keep names for all classes that extend androidx.fragment.app.Fragment (or another base Fragment class that you use)

    -keepnames class * extends androidx.fragment.app.Fragment