我正在尝试使用Proguard来混淆我的Android应用程序,该应用程序使用库jsch-1.50.jar将文件上传到SFTP服务器。
当我从Eclipse中导出时,收到警告"can't reference class“,并且没有生成任何内容。我尝试了各种方法来告诉Proguard忽略jsch类,但这没有任何区别,因此我想知道我是否误解了这是如何工作的。我不太担心优化,但我希望代码混淆。
我已经将proguard-properties设置如下:
-keep class com.jcraft.jsch.jce.*
-keep class * extends com.jcraft.jsch.KeyExchange
-keep class com.jcraft.jsch.**
-keep class com.jcraft.jzlib.ZStream
-keep class com.jcraft.jsch.Compression
-keep class org.ietf.jgss.*
-libraryjars /libs/jsch-0.1.50.jarproject-properties文件包含"proguard.config=proguard-project.txt“的条目。
已删除重复项的导出的输出:-
Warning: com.jcraft.jsch.jcraft.Compression: can't find referenced class com.jcraft.jzlib.ZStream
Warning: com.jcraft.jsch.jgss.GSSContextKrb5: can't find referenced class org.ietf.jgss.Oid
Warning: com.jcraft.jsch.jgss.GSSContextKrb5: can't find referenced class org.ietf.jgss.GSSManager
Warning: com.jcraft.jsch.jgss.GSSContextKrb5: can't find referenced class org.ietf.jgss.GSSException
Warning: com.jcraft.jsch.jgss.GSSContextKrb5: can't find referenced class org.ietf.jgss.GSSContext
Warning: com.jcraft.jsch.jgss.GSSContextKrb5: can't find referenced class org.ietf.jgss.MessageProp
Warning: there were 44 unresolved references to classes or interfaces.
You may need to specify additional library jars (using '-libraryjars').
Error: Please correct the above warnings first.非常感谢您的指点。
谢谢,迈克
发布于 2013-10-25 15:42:08
经过更多的调查,我发现了以下内容...
我忘了在项目中包含jzlib-1.1.1.jar和相应的
-libraryjars /libs/jzlib-1.1.1.jarproguard-properties.txt中的条目。
此外,为了忽略引用“org.ietf.jgss类”的警告,我尝试了排除引用类的建议方法
-libraryjars /libs/jsch-0.1.50.jar(!com.jcraft.jsch.jgss/GSSContextKrb5.class)但这并不管用。最后,我选择了:
-dontwarn org.ietf.jgss.**https://stackoverflow.com/questions/19544966
复制相似问题