Where is Google's internal account authentication token located?

I'm trying to write a Tasker script for my (rooted) phone that uses the same Google credentials that are being used on my device (for Gmail, Drive, etc.).

Where can I find Google's OAuth (or other) authentication tokens on my device?

I checked inside /data/data/com.google.android.gms/databases but couldn't find anything I could recognize as an authentication token.

Answers 1

  • 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.

    0 implies primary user of the device. If you have secondary user accounts, replace 0 with the user id of that account. To find out the user id follow my answer here.

    Note that access to that database requires root access.

Related Questions