How to stop proguard from obfuscating entire package?

一曲冷凌霜 提交于 2019-12-20 17:34:06

问题


I need to prevent Proguard from obfuscating any classes from the package com.foo.*.

I have tried:

-keep com.foo.** {
    <fields>;
    <methods>;
    <constructors>;
}

But proguard says :

Error: Unexpected keyword 'com.sun.foo.**' in line 32 of file 'obfuscationConfig.pro', included from argument number 1

I get a similar error if I try keep name com.foo** or keep * com.foo.**.


回答1:


Try to use the following:

-keep class com.foo.** {
  public protected private *;
}


来源:https://stackoverflow.com/questions/7593397/how-to-stop-proguard-from-obfuscating-entire-package

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!