Exposing inner classes when obfuscating with ProGuard

南楼画角 提交于 2019-11-30 13:55:19
Markus Jevring

You need to specify that you want to keep the inner class using the proper notation. In the proguard parlance, that means -keep class my.outer.Class$MyInnerClass. The key here is using the dollar-sign ($) as the separator between inner and outer class.

To do this, you also have to specify -keepattributes InnerClasses, so that the name MyInnerClass doesn't get obfuscated. These two settings together should allow your inner classes to be kept intact.

The option keepclassmembers only preserves the specified class members (and their names).

You probably want the more common option keep, which preserves the specified classes and class members (and their names).

Cfr. ProGuard manual > Usage > Overview of Keep Options

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