How to exclude a classes from being kept by proguard

时间:2016-12-09 12:45:21

标签: java android proguard

I added the following line in my proguard config:

 -keep class com.mypackage.** {*;}

But now proguard doesn't remove my class com.mypackage.BuildConfig.class from the result. And I want it to be removed.

How can I exclude a given class from being kept?

Thanks

1 个答案:

答案 0 :(得分:4)

您可以使用以下规则:

-keep class !com.mypackage.BuildConfig, com.mypackage.** { *; }