mardi 19 décembre 2017

Can I use Reflection with ProGuard obfuscated classes?

I have a certain class method which I want to invoke using Reflection.
Here is an example of my code in my Activity onCreate:

try {
    aMethod = getClass().getDeclaredMethod("myMethodName", SomeParameter.class);
} catch (NoSuchMethodException e) {
    e.printStackTrace();
}

When I run it directly from Android Studio, it works, but when I create a release version, the method name is not automatically changed by ProGuard. What can I do?





Aucun commentaire:

Enregistrer un commentaire