I'm writing Android library, so I want to preserve parameter names for some constructors/methodes. I'm deploying my library as AAR file.
After Gradle upgrade from 3.3.2 to 3.4.0 all arguments in constructors and public methods are renamed to something like "var1", before that everything was fine.
As I understand main difference is that, now by default R8 is used to minify and obfuscate our code instead of Proguard. So probably I'm missing something in configuration.
Let's say that I have class:
public class Foo {
public String bar;
public Foo(String bar) {
this.bar = bar;
}
}
So in proguard-rules.pro I have:
-keepparameternames
-keepattributes MethodParameters
-keepattributes Signature
-keep class my.class.path.Foo { *; }
And I load that configuration in my module gradle file:
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}}
Right now my class inside my AAR file looks like that ->
public class Foo {
public String bar;
public SecureElement(String var1) {
this.bar = var1;
}
}
So even field name has been preserved, but not variable name in my constructor.
How can I preserve method/constructor argument names?
What am I missing?