【发布时间】:2021-05-11 14:27:12
【问题描述】:
对于给定的类:
class KeepMe(val keepThisArgument: Int) {
fun keepMethod(keepThisArgument: Int) {
println(keepThisArgument)
}
}
和proguard配置:
-keep class com.KeepMe { *; }
以下代码由proguard生成:
public final class KeepMe {
private final int keepThisArgument;
public final void keepMethod(int paramInt) {
System.out.println(paramInt);
}
public final int getKeepThisArgument() {
return this.keepThisArgument;
}
public KeepMe(int paramInt) {
this.keepThisArgument = paramInt;
}
}
构造函数和方法参数名称从“keepThisArgument”更改为“paramInt”。有没有办法阻止它发生?我使用 net.sf.proguard gradle 插件,版本 6.2.2。
【问题讨论】: