Proguard 保留班级成员
我如何告诉 proguard 保留我的班级成员?
我需要它们来实现 JSON 兼容性...
这是我的类:
package com.tools.app.holiday;
public class Holiday {
private String name;
private Calendar dateFrom = Calendar.getInstance();
private Calendar dateTo = Calendar.getInstance();
...
我已经尝试过,但它不起作用...
-keepclassmembers class com.tools.app.holiday.Holiday
-keepclassmembers class com.tools.app.holiday.Holiday *{
private String name;
private Calendar dateFrom;
private Calendar dateTo;
}
我还实现了可序列化并做了:
-keepclassmembers class * implements java.io.Serializable {
但这一切都没有保留我的成员名称。 Proguard 总是将 ist 更改为 a, b, c :-( 我缺少什么?
How can I tell proguard to keep my classmembers?
I need them for JSON compatibility...
This is my class:
package com.tools.app.holiday;
public class Holiday {
private String name;
private Calendar dateFrom = Calendar.getInstance();
private Calendar dateTo = Calendar.getInstance();
...
I already tried, but it doesnt work...
-keepclassmembers class com.tools.app.holiday.Holiday
-keepclassmembers class com.tools.app.holiday.Holiday *{
private String name;
private Calendar dateFrom;
private Calendar dateTo;
}
I also implemented serialisable and did:
-keepclassmembers class * implements java.io.Serializable {
But it all doesn't keep my member names. Proguard always changes ist to a, b, c :-(
What am I missing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
所有类名都必须是完全限定的:
默认情况下,如果您忘记了这一点,ProGuard 甚至会打印出消息。
All class names must be fully qualified:
By default, ProGuard even prints out messages if you forget this.