How to distribute a SDK as AAR file without exposing the source code?

喜你入骨 提交于 2019-12-12 15:22:30

问题


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.

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.


回答1:


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:

-keep class packagename {public *;}

But, Proguard but will not encrypt strings.

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

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



来源:https://stackoverflow.com/questions/35360938/how-to-distribute-a-sdk-as-aar-file-without-exposing-the-source-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!