How can I obfuscate only com.foo.* and com.bar.* (

2019-03-11 15:46发布

I want to obfuscate only some packages:

com.foo.*
com.bar.*

I have tried

-keepclasseswithmembers class **, !com.foo.**, !com.bar.** { *; }

and

-keepclasseswithmembers class !com.foo.** { *; }
-keepclasseswithmembers class !com.bar.** { *; }

In both cases the classes from com.foo.* and com.bar.* was NOT obfuscated.

1条回答
地球回转人心会变
2楼-- · 2019-03-11 16:31

This should work

-keep class !com.foo.**,!com.bar.** { *; }

You can find a summary of the various -keep options at http://proguard.sourceforge.net/manual/usage.html#keepoverview

You can find the explanation of ProGuard's regular expressions at http://proguard.sourceforge.net/manual/usage.html#filters

查看更多
登录 后发表回答