java 如何阻止混淆器混淆整个包?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7593397/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to stop proguard from obfuscating entire package?
提问by David
I need to prevent Proguard from obfuscating any classes from the package com.foo.*
.
我需要防止 Proguard 混淆包中的任何类com.foo.*
。
I have tried:
我努力了:
-keep com.foo.** {
<fields>;
<methods>;
<constructors>;
}
But proguard says :
但是 proguard 说:
Error: Unexpected keyword 'com.sun.foo.**' in line 32 of file 'obfuscationConfig.pro', included from argument number 1
错误:文件“obfuscationConfig.pro”的第 32 行中的意外关键字“com.sun.foo.**”,包含在参数 1 中
I get a similar error if I try keep name com.foo**
or keep * com.foo.**
.
如果我尝试keep name com.foo**
或 ,我会收到类似的错误keep * com.foo.**
。
回答by Idolon
Try to use the following:
尝试使用以下内容:
-keep class com.foo.** {
public protected private *;
}