I've been successful in creating various account authenticators / services each with their own preference.xml. These preferences are persistent but I do not know where on the phone they are stored. I've scoured the phone using adb but I can't seem to find a *.db or "shared_prefs" files that corresponds to the preferences for my particular accounts.
Anyone have experience with this?
The authentication token for Google accounts and of other accounts which uses AccountManager class are stored inside: /data/system/users/0/accounts. db # for Android Marshmallow and earlier /data/system_ce/0/accounts_ce. db # for Android Nougat and above.
Overview. Using an AccountManager to store credentials is a much secure way than storing in a file or a SQL DB. A file can be retrieved by any other app unlike via AccountManager Android will enforce that only your app will be able to access to the key.
With the user's permission, you can use Account Manager to fetch the account names that the user has stored on their device. Integration with the user's accounts lets you do a variety of things, such as: Autofill forms with the user's email address. Retrieve an ID that is tied to a user, not a device.
Under the Personal tab in Settings, you'll find an option for Accounts. This is separate from the tab, where you'll find a lot of preferences related to how your account operates on your device.
I wondered the same thing, as I was searching for where android stored the Bundle "extras" with the account.
It's in a SQLite database (you'll need to root your phone to extract and browse it):
/data/system/users/0/accounts.db
You'll need to find your account for your app:
sqlite> select * from accounts;
24|john.doe|com.evernote|
Then use the id to find the extras:
sqlite> select * from extras where accounts_id = 24;
70|24|userId|8305749
As far as I can tell, /data/system/users/0/accounts.db
is not really used anymore on current android versions.
I found all my account data in /data/system_de/0/accounts_de.db
.
Additionally quite a bit of google authentication info seems to be cached in /data/system_ce/0/accounts_ce.db
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With