设置ProGuard和Android的库项目 [英] Setting up ProGuard with Android Library Projects

查看:98
本文介绍了设置ProGuard和Android的库项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想设置的ProGuard我的Andr​​oid项目。我的应用程序项目中有很少的code,但引用其中有绝大多数code和任何其他外部jar文件的库项目。话虽这么说,我不知道如何设置的ProGuard要考虑到这一点。现在我ProGuard的配置文件是从 ProGuard的网站只是Android的例子。我一直在寻找身边,但还没有找到很多或使用ProGuard与库项目,只是罐子的任何文件。我是新来的ProGuard,所以在正确的方向推任何将是巨大的。谢谢你。

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.

推荐答案

修改

作为@ BornTo code指出,一个不同的答案(最初发布<一个href=\"http://stackoverflow.com/questions/10982344/is-proguard-cfg-needed-for-library-projects#10992604\">here)更好地解释了项目如何库被处理的的Proguard 的。此外,这种引用问题有更多的兴趣,比我原来的回应联整体声誉更多的名言:

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:

图书馆本身的项目不运行ProGuard的,所以他们不使用
  任何配置。

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

应用程序项目混淆了整个code基地,包括任何
  引用的库,所以他们需要正确的配置
  应用code和库code。

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.

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

图书馆项目更多的是一个项目,它在Eclipse罐子连接的便捷方式。当您生成项目,库项目也就是编译器看到的唯一的组件是jar文件。

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.

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

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

<一个href=\"http://stackoverflow.com/questions/8088958/how-to-obfuscate-an-android-library-jar-file-using-proguard-in-eclipse\">How在Eclipse 使用ProGuard混淆一个Android库(.jar文件)

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

这篇关于设置ProGuard和Android的库项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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