I'm trying to obfuscate my android app but when i do generate apk as a release and run on the device then my firebase field names are get changed. And also some fields data is not uploaded to the firebase real time database for example System.currentTimeMillisecond(), passwd.
My application works fine without obfuscation and inserts all data properly. After obfuscation it behaves incorrectly and doesn't insert some data properly into firebase.
Expected node:
-userid
-name:"abc"
-age:15
-passwd:"pass@123"
-timestamp:16003243241
After obfuscate:
-userid
-a:"abc"
-b:15
My UserModel class
public class UserModel{
public int age;
public String name,passwd;
public long timestamp;
public UserModel(){}
public UserModel(String name, String passwd, int age, long timestamp){
this.name=name;
this.passwd=passwd;
this.age=age;
this.timestamp=timestamp;
}
}
I have applied into build.gradle: app
buildTypes {
release {
minifyEnabled true
shrinkResources=true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
Proguard:
-keep class yourpackage.** { *; }
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-verbose
I have min sdk 23 and target 28. Please help me obfuscate data properly.