gpt4 book ai didi

android - Proguard 使用 DNSJava 库混淆 Android 代码

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:01:00 31 4
gpt4 key购买 nike

我有一个 android 应用程序,它在项目的/libs/目录中有 dnsjava.jar。一切都很好,可以打包到 APK 中(没有 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 和 DNSJava 测试的。希望能帮助到你。从 asmack 自述文件复制

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

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

关于android - Proguard 使用 DNSJava 库混淆 Android 代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15264531/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com