简体   繁体   English

代码混淆排除 Getter 和 Setter

[英]Code obfuscate exclude Getters and Setters

I am using proguard GUI to obfuscate my java code.我正在使用 proguard GUI 来混淆我的 java 代码。

My requirement is I don't want to obfuscate my Getter and setters.我的要求是我不想混淆我的 Getter 和 setter。 Is there any option in the proguard GUI to exclude the obfuscation for the Getter, setters alone. proguard GUI 中是否有任何选项可以单独排除 Getter、setter 的混淆。

If so please provide me where to specify with an example.如果是这样,请为我提供示例指定的位置。

You can add the following rules to keep all getters/setters:您可以添加以下规则以保留所有 getter/setter:

-keepclassmembers class * {
    *** get*();
    void set*(***);
}

Assuming that your setters do not return a value.假设您的 setter 不返回值。

With Dotfuscator you have to add a custom exclusion rule like this (see the documentation for details)使用 Dotfuscator,您必须添加这样的自定义排除规则(有关详细信息,请参阅文档 在此处输入图片说明

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

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