ProGuard - 使用唯一的字段名称?
我正在使用 ProGuard 来混淆我的源代码,但我遇到了一个问题,即我的混淆代码对不同类型的字段重复使用相同的字段名称。例如:
public class Pojo {
int id;
String name;
}
变成:
public class Pojo {
int a;
String a;
}
这在尝试使用 JSON 序列化/反序列化时会导致问题,因此我希望使用唯一的字段名称。
我尝试添加 -useuniqueclassmembernames
但它不起作用。除了可能使用 -obfuscationdictionary 选项之外,看不到任何其他选项,但这似乎有点矫枉过正。
I'm using ProGuard to obfuscate my source code, but I'm running into a problem where my obfuscated code re-uses the same field name for fields with different types. For example:
public class Pojo {
int id;
String name;
}
Becomes:
public class Pojo {
int a;
String a;
}
This is causing problems when trying to use JSON serialization/deserialization, so I'd like to have unique field names instead.
I tried adding -useuniqueclassmembernames
though it didn't work. Couldn't see any other options, besides maybe using the -obfuscationdictionary
option, but that seems like overkill.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论