如何仅混淆com.foo.*和com.bar.*(ProGuard)? [英] How can I obfuscate only com.foo.* and com.bar.* (ProGuard)?

查看:68
本文介绍了如何仅混淆com.foo.*和com.bar.*(ProGuard)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只希望混淆某些软件包:

I want to obfuscate only some packages:

com.foo.*
com.bar.*

我尝试过

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

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

在这两种情况下,com.foo.*和com.bar.*中的类都被 NOT 混淆了.

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

推荐答案

这应该有效

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

您可以在以下位置找到各种-keep选项的摘要 http://proguard.sourceforge.net/manual/usage.html#keepoverview

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

您可以在以下位置找到有关ProGuard正则表达式的解释: http://proguard.sourceforge.net/manual/usage.html#filters

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

这篇关于如何仅混淆com.foo.*和com.bar.*(ProGuard)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆