How to exclude specific jars from injars during obfuscation using proguard?

非 Y 不嫁゛ 提交于 2019-12-11 11:08:36

问题


I have many external jars inside my Application\WEB-INF\lib

Consider abc.jar as one of my external jar, which i do not want to obfuscate

So can i exclude as like below using filter in my proguard configuration ?

-injars C:\Application\WEB-INF\lib(!abc.jar)

If i do as above for injar option filter means, abc.jar is also getting obfuscated. Please suggest where i am going wrong ? How to avoid obfuscating it ?


回答1:


You should use -injars to specify code that you want to be processed, and -libraryjars to specify underlying code that you want to remain unchanged. Something like this may work:

-injars      C:/Application/WEB-INF/lib/mycode.jar
-libraryjars C:/Application/WEB-INF/lib(!mycode.jar;)

Note the semi-colon between the jar name filter and the (empty) class name filter.



来源:https://stackoverflow.com/questions/24057009/how-to-exclude-specific-jars-from-injars-during-obfuscation-using-proguard

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