android library project obfuscation

烈酒焚心 提交于 2019-12-04 02:21:00

The Android SDK doesn't apply ProGuard to library projects; it only applies ProGuard to final applications (including their libraries). The latter is more effective in terms of shrinking, optimization, and obfuscation, because it can work on a larger body of code and it doesn't need to preserve the public API of the libraries.

If you want to distribute your library as an end-product, you can post-process it, as discussed in the ProGuard manual > Examples > A typical library.

Alternatively, DexGuard, ProGuard's commercial sibling for Android, can also process library projects out of the box.

(I am the developer of ProGuard and DexGuard)

Oren K.

In order to obfuscate your library what you need to do is:

  1. Make sure gradle settings for lib module state minifyEnabled true .

  2. run ./gradlew assemble{flavor}Release

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