How to save private string values ​​in android apk?

I know that I can save the lines in res / values ​​/strings.xml, but if someone parsed the dex file or apk file, then he can see the HARDCODED lines or the res / values ​​/strings.xml lines.

Is there a way to save lines that won't be read if I parse them?

+3
android
source share
2 answers

Briefly, no.


If you can decrypt / extract any string from your apk, potentially anyone with enough knowledge can scan your code and reuse the algorithm used to extract those strings. And then remove them yourself.

Of course, you can use some tricks to make it harder. What tricks can be used, in fact, before you, Android does not provide by default (AFAIK).

+2
source share

If you do not want data to be stored in application sessions, you can use SharedPreferences

-2
source share

All Articles