微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Proguard用DNSJava库混淆Android代码

我有一个Android应用程序,在项目的/ libs /目录中有dnsjava.jar.一切都很好,可以打包成APK(没有proguard).

但是,当我将proguard引入project.properties(在eclipse中)时,我收到以下警告:

[2013-03-07 14:16:08 - ] Proguard returned with error code 1. See console
[2013-03-07 14:16:08 - ] Warning: org.xbill.DNS.spi.dnsjavaNameServiceDescriptor: can't find superclass or interface sun.net.spi.nameservice.NameServiceDescriptor
[2013-03-07 14:16:08 - ] Warning: org.xbill.DNS.spi.dnsjavaNameServiceDescriptor: can't find referenced class sun.net.spi.nameservice.NameService
[2013-03-07 14:16:08 - ] Warning: org.xbill.DNS.spi.dnsjavaNameServiceDescriptor: can't find referenced class sun.net.spi.nameservice.NameServiceDescriptor
[2013-03-07 14:16:08 - ] Warning: org.xbill.DNS.spi.dnsjavaNameServiceDescriptor: can't find referenced class sun.net.spi.nameservice.NameService
[2013-03-07 14:16:08 - ] Warning: org.xbill.DNS.spi.dnsjavaNameServiceDescriptor: can't find referenced class sun.net.spi.nameservice.NameService
[2013-03-07 14:16:08 - ]       You should check if you need to specify additional program jars.
[2013-03-07 14:16:08 - ] Warning: there were 5 unresolved references to classes or interfaces.
[2013-03-07 14:16:08 - ]          You may need to specify additional library jars (using '-libraryjars').
[2013-03-07 14:16:08 - ] java.io.IOException: Please correct the above warnings first.
[2013-03-07 14:16:08 - ]    at proguard.Initializer.execute(Initializer.java:321)

使用-keep class org.xbill.** {*;在proguard-project.txt中似乎没有解决这个问题.

最佳答案
这是用proguard& amp; dnsjava.希望能帮助到你.复制自asmack自述文件

# This dnsjava class uses old Sun API
-dontnote org.xbill.DNS.spi.dnsjavaNameServiceDescriptor
-dontwarn org.xbill.DNS.spi.dnsjavaNameServiceDescriptor

# See https://stackoverflow.com/questions/5701126,happens in dnsjava
-optimizations !code/allocation/variable

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐