for my project I need to store a user identifier. I thought that maybe I could store it in /data/data/com.my.package/files but if someone root the phone it 's obvious that he'll search first here. So I thought why not use AccountManager that seems a bit safer (tell me if I'm wrong). So here's my question : Where are stored data put in the AccountManager ?
Thanks in advance !
Using AccountManager is not safer than using a file from the internal storage. The database with accounts is not encrypted and still can be accessed on a rooted device. This is a quote from the official docs:
It's important to understand that AccountManager is not an encryption service or a keychain. It stores account credentials just as you pass them, in plain text. On most devices, this isn't a particular concern, because it stores them in a database that is only accessible to root. But on a rooted device, the credentials would be readable by anyone with adb access to the device.
This database can be found at /data/system/users/0/accounts.db
, where 0 is user's ID.