Proguard用DNSJava库混淆Android代码

前端之家收集整理的这篇文章主要介绍了Proguard用DNSJava库混淆Android代码前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

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

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

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

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

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

  1. # This dnsjava class uses old Sun API
  2. -dontnote org.xbill.DNS.spi.DNSJavaNameServiceDescriptor
  3. -dontwarn org.xbill.DNS.spi.DNSJavaNameServiceDescriptor
  4. # See https://stackoverflow.com/questions/5701126,happens in dnsjava
  5. -optimizations !code/allocation/variable

猜你在找的Android相关文章