7

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?

C Gar
  • 121
  • 2
  • 5

4 Answers4

9

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
Nathan Perrier
  • 534
  • 1
  • 5
  • 14
3

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

Sec
  • 7,059
  • 6
  • 31
  • 58
0

If you use a custom account preference activity, PreferenceManager.getDefaultSharedPreferences() shows that the default preferences are stored in the preference folder for the application package. For example, if you have

    <manifest package="com.my.app.account" ... >

The settings are stored in

    /data/data/com.my.app.account/shared_prefs/com.my.package.account_preferences.xml

These results are from the Android 2.3 emulator.

Community
  • 1
  • 1
ehartwell
  • 1,667
  • 19
  • 18
0

Most likely not, because normally you don't have to care about where android stores the shared preferences.

Christoph Haefner
  • 1,093
  • 1
  • 9
  • 25