ProGuard 在枚举上出现 Maven 错误 class

ProGuard with maven error on enum class

我正在尝试使用 ProGuard 混淆我服务器的插件,但我无法混淆枚举 class。他们不断丢失信息。

枚举 class 是这样的:

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;
    }
}

我的配置是这样的:

<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>

但是当我构建项目时,枚举值 XAUTH(xAuth.class) 消失并且插件没有正确 运行。

显示:java.lang.IllegalArgumentException:com.ehaqui.ehlogin.e.b不是枚举类型

我该如何解决这个问题?

我想我找到了

-keep class com.ehaqui.ehlogin.security.PasswordType {*;}