obfuscationandroid-proguardmatomopiwiktrackeradjust-android

How to not obfuscate class names but get the right simplename anyway?


I have over 20 Fragments which extends from MyFragment e.g.:

and MyFragment in turn extends from Fragment . So in my Android app, and whenever I inflate one of them, I call in my abstrac t class a showFragment(MyFragment f) where I fire the Adjust event,

AdjustEvent event = new AdjustEvent(EVENT_LOAD_FRAGMENT);
// Add callback parameters to this parameter.
event.addCallbackParameter("LoadFragment", 
f.getClass().getSimpleName());
Adjust.trackEvent(event);

so that I can measure what fragment is how often used as kay value pair. So far so good, and during debug phase it works nice.

As you can imagine now, the getClass().getSimpleName() is being obfuscated in the produtction environment. I do not want to touch all the 20 Fragments and would be totally fine if the classes get obfuscated. But I still would like to get the class' valid getSimpleName() String..

How can I get a classes valid getSimpleName() after it was obfuscated?


Solution

  • I used

    -keepnames class  * extends com.you.package.name.MyFragment
    

    unpacked the aar and classes.jar, and checked the build forlder for seeds.txt and mapping.txt to see the obfuscation