使用Proguard的混淆Android应用程序与Dropbox.com库 [英] Using Proguard to Obfuscate Android App with Dropbox.com Libraries

查看:547
本文介绍了使用Proguard的混淆Android应用程序与Dropbox.com库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚完成了创建一个Android应用程序,需要Dropbox.com API库。我现在正在努力打造释放模式的应用程序,并想以混淆它运行ProGuard的在code。但是,每当我试图运行Proguard的,我得到以下错误:

I've just finished creating an Android app that requires the Dropbox.com API libraries. I'm now trying to build the application in 'Release' mode and would like to run proguard on the code in order to obfuscate it. However, whenever I attempt to run Proguard, I get the following error:

Proguard returned with error code 1. See console
Warning: com.dropbox.client2.DropboxAPI: can't find referenced class org.json.simple.JSONArray
Warning: com.dropbox.client2.DropboxAPI: can't find referenced class org.json.simple.JSONArray
Warning: com.dropbox.client2.DropboxAPI$Entry: can't find referenced class org.json.simple.JSONArray
Warning: com.dropbox.client2.DropboxAPI$Entry: can't find referenced class org.json.simple.JSONArray
Warning: com.dropbox.client2.RESTUtility: can't find referenced class org.json.simple.parser.JSONParser
Warning: com.dropbox.client2.RESTUtility: can't find referenced class org.json.simple.parser.JSONParser
Warning: com.dropbox.client2.RESTUtility: can't find referenced class org.json.simple.parser.JSONParser
Warning: com.dropbox.client2.RESTUtility: can't find referenced class org.json.simple.parser.ParseException
Warning: there were 8 unresolved references to classes or interfaces.
         You may need to specify additional library jars (using '-libraryjars'),
         or perhaps the '-dontskipnonpubliclibraryclasses' option.
         java.io.IOException: Please correct the above warnings first.
         at proguard.Initializer.execute(Initializer.java:308)
         at proguard.ProGuard.initialize(ProGuard.java:210)
         at proguard.ProGuard.execute(ProGuard.java:85)
         at proguard.ProGuard.main(ProGuard.java:499)

我已经包括了-dontskipnonpubliclibraryclasses'选项,而不是帮助我的人。我想包括'-libraryjars'选项,但是,我可以用它被错误,因为我真的不知道我是如何打算使用该标志。

I'm already including the '-dontskipnonpubliclibraryclasses' option and that's not helping me at all. I tried including the '-libraryjars' option, though, I may have been using it incorrectly as I'm not really sure how I'm intended to use that flag.

没有人有任何想法如何,我可以纠正这个错误?现在,我无法同时通过Proguard的运行它来建立我的申请。任何帮助AP preciated!谢谢!

Does anyone have any ideas how I can correct this error? Right now, I'm unable to build my application while running it through Proguard. Any help is appreciated! Thanks!

推荐答案

(CFR)。 ProGuard的手册>故障排除>警告:找不到引用的类

com.dropbox似乎取决于org.json。从理论上讲,你应该因此org.json jar添加到您的libs目录,因此它可以被处理,包括在应用程序。在实践中,您的应用程序工作正常,没有它,这样可以让ProGuard的忽略缺失的依赖性:

com.dropbox seems to depend on org.json. In theory, you should therefore add the org.json jar to your libs directory, so it can be processed and included in your application. In practice, your application works fine without it, so you can let ProGuard ignore the missing dependency:

-dontwarn org.json.**

-dontwarn com.dropbox.**

您不应该添加-libraryjars,因为你指定的任何jar文件将不会在Android设备上present,除非你以某种方式进行安装。

You shouldn't add -libraryjars, because any jars that you specify won't be present on Android devices unless you'd somehow manage to install them.

这篇关于使用Proguard的混淆Android应用程序与Dropbox.com库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆