If you are not encrypting assets it is easily recoverable from APK files, the Build.{FIELD} can be recovered same way but need to put additional effort to find it in code(which could be obfuscated) instead of just scanning the resources file. Neither of them should be considered secure(in the "I can sleep safely, my secrets are secure" fashion) but the gradle properties approach is more secure than the assets one.
– bmaciejmMay 24 '23 at 10:41
@bmaciejm Can you please lead me to any docs/references where in "gradle properties approach is more secure than the assets one"?
– abhishek maharajpetMay 30 '23 at 07:20
My statement comes from experience, when you will use the gradle properties approach the build fields will be just inlined in the code(if using R8 https://stackoverflow.com/a/56370696/4153947) so it's more difficult to find it than just plain strings in resources(which are not obfuscated R8/Proguard)which are trivial to extract https://stackoverflow.com/questions/35842663/android-how-to-extract-resources-from-apk-for-one-specific-locale-language. But both approaches are not SAFE by any means, just a little more difficult for an attacker to find(still trivial for the experienced one).
– bmaciejmJun 03 '23 at 20:43