简体   繁体   English

如何使Proguard保持类方法名称和属性名称不变?

[英]How to make Proguard keep the class method names and attribute names as it is?

As above. 如上。

My ProGuard config is 我的ProGuard配置为

-keepclassmembers public class myApp.interfaces.**
-keepclasseswithmembernames public class myApp.interfaces.**
-keepattributes Signature
-keepparameternames

Really new to this and no real idea what I'm doing. 真的很新,我不知道我在做什么。

What I'm trying to achieve is to make Proguard not change the method and variable names of all Classes inside myApp.interfaces.* . 我要实现的目标是使Proguard不更改myApp.interfaces.*中所有类的方法和变量名。 If they want to rearrange some algo stuff to optimise it or whatever, it's fine. 如果他们想重新安排一些算法的东西来优化它或其他,那很好。 As long as the names are not changed. 只要名称不变。

This must be done because of the Serializable issue between server and client. 由于服务器和客户端之间的可序列化问题,必须执行此操作。

Simply use: -keep class myApp.interfaces.** { *; } 只需使用: -keep class myApp.interfaces.** { *; } -keep class myApp.interfaces.** { *; }

It will not touch the class or its members. 它不会碰到班级或其成员。 If you get errors / warnings, Rebuild the project. 如果收到错误/警告,请重建项目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM