Android Library module use proguard

三世轮回 提交于 2019-12-06 04:52:46

You have to be more precise with telling Proguard how to work.

First better use the alias -keepnames instead of -keep,allowshrinking. Then only keep the public classes and protected class members. Meaning actually to not shrink these parts.

-keep,allowobfuscation public class com.alprocr.** { public protected *; }
-keep,allowobfuscation public class com.xyz.alpr.** { public protected *; }
-keep,allowobfuscation public class com.xyz.alpr.doc.** { public protected *; }

These are your entry-points to the library. Everything not public or protected will be shrunk and/or obfuscated by default.

Library projects by themselves don't run ProGuard, so they don't use any configuration. 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.

See this post: https://stackoverflow.com/a/10992604/8770663

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