如何在不公开源代码的情况下将SDK分发为AAR文件? [英] How to distribute a SDK as AAR file without exposing the source code?

查看:293
本文介绍了如何在不公开源代码的情况下将SDK分发为AAR文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将SDK分发给最终开发人员,但我不想共享我的代码.我已经使用AAR文件共享了我的SDK( Android存档库(aar)与标准jar ).但是其他人有可能查看我的班级文件.如何避免呢?请帮助我们.

I want to distribute an SDK to end developers but I don’t want to share my code. I have used AAR file to share my SDK (Android Archive Library (aar) vs standard jar). But there is a possibility that others can view my class files. How to avoid that? Please help us.

注意: 我查看了此" Android -需要一种无需源代码即可创建库(.aar文件)的方法",但这并不能解决我的问题.

Note: I had review this "Android - Need a way to create the library(.aar file) without source code" but it didn’t solve my problem.

推荐答案

Proguard削减未使用的类.图书馆是独立的产品,并且具有一些特定的切入点,这些切入点不应被遗忘.因此,您需要添加规则以保留此入口点.规则如下:

Proguard cuts unused classes. Libraries are standalone products, and has some specific entry points, which should not be obfsuscated. So you need to add rules to keep this entry points. Rules lookes like this:

-保留类程序包名称{public *;}

-keep class packagename {public *;}

但是,Proguard不会加密字符串.

But, Proguard but will not encrypt strings.

Dexguard 是包含字符串加密和其他功能的付费工具.

Dexguard is a paid tool that includes string encryption and other features.

有关完整比较,请参见以下图表: https://www.saikoa.com/比较-proguard和dexguard

For a full comparison see this chart: https://www.saikoa.com/comparison-proguard-and-dexguard

这篇关于如何在不公开源代码的情况下将SDK分发为AAR文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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