开发者

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

开发者 https://www.devze.com 2023-02-01 20:11 出处:网络
I wa开发者_如何学JAVAnt to obfuscate only some packages: com.foo.* com.bar.* I have tried -keepclasseswithmembers class **, !com.foo.**, !com.bar.** { *; }

I wa开发者_如何学JAVAnt 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.


This should work

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

You can find a summary of the various -keep options at https://www.guardsquare.com/manual/configuration/usage#keepoptions

You can find the explanation of ProGuard's regular expressions at https://www.guardsquare.com/manual/configuration/usage#filters

0

精彩评论

暂无评论...
验证码 换一张
取 消