简体   繁体   English

使用Proguard混淆jar文件

[英]Obfuscating jar file using proguard

I used proguard to obfuscate my jar file. 我使用了proguard来混淆我的jar文件。 During processing I got the following errors: 在处理期间,出现以下错误:

Initializing...
Warning: tdvep.jmNb: can't find referenced class QSYGWO
Warning: tdvep.qmfsfjttKdvEpNz: can't find referenced class FVTYBN
Warning: tdvep.qsfboBcSw$qsffmtssf: can't find referenced class UGKTLU
Warning: tdvep.qsffmtssf: can't find referenced class DREQUQ
Warning: there were 4 unresolved references to classes or interfaces.
         You may need to specify additional library jars (using '-libraryjars').

Please correct the above warnings first. 请首先更正以上警告。 So guide me to resolve this warnings. 因此,请引导我解决此警告。

Have you checked the ProGuard troubleshooting section - Problems while processing . 您是否检查了ProGuard故障排除部分- 处理中的问题

If there are unresolved references to classes or interfaces , you most likely forgot to specify an essential library . 如果存在unresolved references to classes or interfaces ,则您很可能忘记了指定基本库 For proper processing, all libraries that are referenced by your code must be specified, including the Java run-time library. 为了进行适当的处​​理,必须指定代码所引用的所有库,包括Java运行时库。 For specifying libraries, use the -libraryjars option. 要指定库,请使用-libraryjars选项。

For example, if ProGuard complains that it can't find a javax.crypto class, you probably still have to specify jce.jar, next to the more common rt.jar. 例如,如果ProGuard抱怨找不到javax.crypto类,则可能仍必须jce.jar, next to the more common rt.jar.指定jce.jar, next to the more common rt.jar.

If you're missing a library and you're absolutely sure it isn't used anyway, you can try your luck with the -ignorewarnings option, or even the -dontwarn option . 如果您缺少某个库,并且绝对可以肯定它没有被使用,则可以使用-ignorewarnings选项甚至-dontwarn option来试试运气。 Only use these options if you really know what you're doing though. 如果您确实知道自己在做什么,请仅使用这些选项。

For example, if you're developing for Android , and ProGuard complains that it can't find a java.awt class , then some library that you are using is referring to java.awt . 例如,如果您正在为Android开发,而ProGuard抱怨它找不到java.awt class ,则您正在使用的某些库引用了java.awt This is a bit shady, since Android doesn't have this package at all, but if your application works anyway, you can let ProGuard accept it with "-dontwarn java.awt.**" . 这有点阴暗,因为Android根本没有此程序包,但是如果您的应用程序仍然可以运行,则可以让ProGuard使用"-dontwarn java.awt.**"接受它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM