I'm trying to obfuscate a plugin of my server with ProGuard, but I can't obfuscate an enum class. They keep losing information.
The enum class is this:
public enum PasswordType
{
XAUTH(xAuth.class);
Class<?> classe;
private PasswordType(Class<?> authClass)
{
this.classe = authClass;
}
public PasswordMethod getInstance()
{
try
{
return (PasswordMethod) this.classe.newInstance();
} catch (InstantiationException | IllegalAccessException e)
{
e.printStackTrace();
}
return null;
}
}
And my config is this:
<options>
<option>-keep class com.ehaqui.ehlogin.EhLoginPlugin</option>
<option>-dontshrink</option>
<option>-dontoptimize</option>
<option>-dontusemixedcaseclassnames</option>
<option>-keepattributes Exceptions,InnerClasses,Signature,Deprecated,SourceFile,LineNumberTable,LocalVariable*Table,*Annotation*,Synthetic,EnclosingMethod,EventHandler,Override</option>
</options>
But when I build the project, the enum value XAUTH(xAuth.class) disappears and the plugin doesn't run correctly.
Shows: java.lang.IllegalArgumentException: com.ehaqui.ehlogin.e.b is not an enum type
How can I fix this?