I have created one android app but in that app i am using url,so i want to protect that url because when i decompiled my apk,inside java class url is coming as it is.
so i want to ask that is this possible to protect that url ?
I have created one android app but in that app i am using url,so i want to protect that url because when i decompiled my apk,inside java class url is coming as it is.
so i want to ask that is this possible to protect that url ?
No, there is no way to prevent people from seeing any data you include in the apk. You should not include secret data inside the code. Obfuscation barely helps - it just gives you a false sense of security.
Just mark minifyEnabled true in build gradle file in buildTypes release mode. It will make apk not view source and decomile.
Example: Add follwing lines in gradle file:
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
//added by me
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}