I'm trying to setup proguard for my Android project. My application project has very little code in it, but references a library project which has the vast majority of the code and any other external jars. That being said, I'm not sure how to setup proguard to take this into account. Right now my proguard config file is just the Android example from the ProGuard site. I've been searching around, but haven't found a lot or any documentation on using proguard with library projects, just jars. I'm new to proguard, so any push in the right direction would be great. Thanks.

我正在尝试为我的Android项目设置proguard。我的应用程序项目中只有很少的代码,但引用了一个库项目,它包含绝大多数代码和任何其他外部jar。话虽这么说,我不知道如何设置proguard考虑到这一点。现在我的proguard配置文件只是ProGuard网站上的Android示例。我一直在寻找,但没有找到很多关于使用proguard与库项目,只是罐子的文档。我是初学者,所以任何正确方向的推动都会很棒。谢谢。

2 个解决方案

#1


16

Edit

As @BornToCode points out, a different answer (originally posted here) better explains how library projects are handled by Proguard. Additionally, this referenced question has more interest and more overall reputation than that linked in my original response. The quote:

正如@BornToCode指出的那样,一个不同的答案(最初发布在这里)更好地解释了Proguard如何处理图书馆项目。此外,这个引用的问题比我原来的回答中的链接更有趣,更有整体声誉。报价单:

Library projects by themselves don't run ProGuard, so they don't use any configuration.

库项目本身不运行ProGuard,因此它们不使用任何配置。

Application projects obfuscate the entire code base, including any referenced libraries, so they need proper configuration for the application code and for the library code.

应用程序项目模糊了整个代码库,包括任何引用的库,因此需要对应用程序代码和库代码进行适当的配置。


Old Answer (not wrong, just probably not the best approach)

旧答案(没错,可能不是最好的方法)

The library projects is more of a convenient way of linking a project to its jar in Eclipse. When you build the project, the only component of the library project that is visible to your compiler is the jar file.

库项目更像是一种将项目链接到Eclipse中的jar的便捷方式。构建项目时,编译器可见的库项目的唯一组件是jar文件。

If you want to obfuscate that jar, check out this post:

如果你想混淆那个罐子,看看这篇文章:

How to obfuscate an Android library (.jar file) using Proguard in Eclipse

如何在Eclipse中使用Proguard对Android库(.jar文件)进行模糊处理

更多相关文章

  1. android studio如何把本地项目上传到git@osc
  2. Libgdx设置UI在新GWT项目中出现2个意外错误
  3. android代码混淆 GSON完满解决
  4. Android开源代码解读の地图照片应用Panoramio的实现详解(六)
  5. 在app引擎端点的启动时执行代码
  6. 将不同的Android项目连接到现有的Google-Endpoints后端
  7. 如何将Maven添加到现有的IntelliJ Android项目中
  8. javaScript函数中执行C#代码中的函数
  9. Thrift项目Server端开发流程

随机推荐

  1. Android 示例之 notepad
  2. Android中获得SD卡中的值
  3. FregServer进程,封装进程间通信数据
  4. delphi android 中 Toast 的实现(老外写
  5. Android-AlarmManager(全局定时器/闹钟)
  6. 关于android linux kernel
  7. android studio更新提示网络连接失败的解
  8. ToolBar的使用
  9. android 自定义控件之折线图自己写代码,不
  10. android webview 使用