proguard java enum,Proguard没有这么说就不会混淆课堂

我正在构建一个android库,我使用的是一个实用程序类,其中所有方法都是静态的 . 此类在内部使用,不应由库用户使用 . 我正在使用proguard来混淆代码,我不想暴露实用程序类 . 当我使用proguard时,它会保留类名,并对其中的方法进行模糊处理 . 我没有用-keep特别排除那个 class .

这是我的proguard配置的通用部分

-keepparameternames

-renamesourcefileattribute SourceFile

-keepattributes Exceptions,InnerClasses,Signature,Deprecated,SourceFile,LineNumberTable,EnclosingMethod,MethodParameters,LocalVariableTable,LocalVariableTypeTable

//Preserve all annotations.

-keepattributes *Annotation*

// Preserve all .class method names.

-keepclassmembernames class * {

java.lang.Class class$(java.lang.String);

java.lang.Class class$(java.lang.String, boolean);

}

// Preserve all native method names and the names of their classes.

-keepclasseswithmembernames class * {

native ;

}

// Preserve the special static methods that are required in all enumeration classes.

-keepclassmembers class * extends java.lang.Enum {

public static **[] values();

public static ** valueOf(java.lang.String);

}

// Explicitly preserve all serialization members. The Serializable interface

// is only a marker interface, so it wouldn't save them.

// You can comment this out if your library doesn't use serialization.

// If your code contains serializable classes that have to be backward

// compatible, please refer to the manual.

-keepclassmembers class * implements java.io.Serializable {

static final long serialVersionUID;

static final java.io.ObjectStreamField[] serialPersistentFields;

private void writeObject(java.io.ObjectOutputStream);

private void readObject(java.io.ObjectInputStream);

java.lang.Object writeReplace();

java.lang.Object readResolve();

}

编辑:“-whyareyoukeeping”说我从另一个类(扩展服务)调用实用程序类中的方法,该类被排除在混淆之外 .

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值