混淆的Andr​​oid库项目源$ C ​​$ C使用ProGuard [英] Obfuscating Android Library Project source code with ProGuard

查看:218
本文介绍了混淆的Andr​​oid库项目源$ C ​​$ C使用ProGuard的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的深化发展与Eclipse一个Android库项目,我想执照。以prevent我的客户能够轻松地逆向工程和看我的code,我想混淆我的媒体库的源$ C ​​$ C。从调研我这样做,我发现ProGuard的似乎conciderated最适合我的使用情况。

I am developping an Android Library Project with Eclipse that I want to licentiate. To prevent my clients to easily reverse-engineer and read my code, I want to obfuscate the source code of my library. From the research I did, I found that ProGuard seems to be conciderated the best for my usage.

我见过<一个href=\"http://stackoverflow.com/questions/10982344/is-proguard-cfg-needed-for-library-projects#10992604\">post埃里克Lafortune(ProGuard的创建者),告诉该库项目不运行ProGuard的,这是混淆了我。为什么会与Android应用程序项目,而不是与Android图书馆项目工作?也许我只是误读的东西...

I've seen a post from Eric Lafortune (ProGuard's creator) that tells that library projects don't run ProGuard, and this is confusing me. Why would it work with Android Application Projects and not with Android Library Project? Maybe I am just misreading something...

我读过一些帖子和博客(见这个的)有关如何使用Ant构建配置一起创建的ProGuard配置文件。但是,这肯定会需要好几个小时,使其工作,如果我管理,使其工作...不mentionning事实上这些帖子和博客可能已过时。

I've read several posts and blogs (see this one) about how to create the ProGuard config file along with the Ant build configuration. But this will surely take me several hours to make it work, if I manage to make it work... Not mentionning the fact that those posts and blogs might be outdated.

所以,我想知道如果我要的是可能的,如果我在正确的方向前进。

So, I would like to know if what I want is possible and if I am going in the right direction.

推荐答案

您可以混淆您的图书馆,但你需要添加所有的公共API例外所以Proguard的不会动它。这是一个很大的工作。被prepared测试了很多。

You can obfuscate your library, but you need to add all your public API as exceptions so Proguard won't touch it. It's a lot of work. Be prepared to test a lot.

另外,如果您混淆您的图书馆,你通常会想要么混淆其过于依赖,或者这些依赖添加到例外。在前一种情况下,你的客户将无法升级的依赖,而不升级整个库,后者整个混淆就会受到影响。

Also, if you obfuscate your library, you'll usually want to either obfuscate its dependencies too, or add those dependencies to exceptions. In the former case, your customers won't be able to upgrade the dependencies without upgrading the entire library, in the latter the entire obfuscation will be weaker.

您添加的一切即使当然,你可能会无意中发现问题更多的问题。

Of course even after you add everything, you may stumble on more problematic issues.

这篇关于混淆的Andr​​oid库项目源$ C ​​$ C使用ProGuard的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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