Proguard:保留所有带注释的类

时间:2017-06-06 14:10:21

标签: android proguard

我想保留具有自定义注释的所有类的类名和类字段名称:

@Retention(CLASS)
@Target(ElementType.TYPE)
public @interface DoNotObfuscate {
}

我试过了:

-keep @com.mypackage.DoNotObfuscate public class *

但这没效果。

1 个答案:

答案 0 :(得分:0)

In order to keep class fields you should add "{*;}" at the end:

-keep @com.mypackage.DoNotObfuscate public class * {*;}