Proguard keep parameter names for interface and abstract class

血红的双手。 提交于 2019-12-04 01:33:14

Add following ProGuard options to your configuration.

-keepattributes MethodParameters

If your class file hava method parameters metadata (compiled using Java8 -parameters or etc...)`, ProGuard will keep the metadata.

to keep all interface methods:

-keep interface * {
   <methods>;
}

to keep all public and protected methods, which could be used by reflection:

-keepclassmembernames class * {
    public protected <methods>;
}

while I don't understand, why one would want to keep abstract classes, which cannot be instanced. it is rather, that one excludes all that is not abstract with rules which start with -keep !abstract.

Your proguard file may lack some -keepattributes, especially a -keepattributes Signature.

Check this example proguard configuration for a library from the proguard documentation to look for ideas.

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