Where is Google's internal account authentication token located?How to find out currently running user name/ID from ADBXT1064 - 5.0.1 - Rooted - Issues with writing to /sdcardA rather complex wifi issue (android tablet)Restore an android system that will access my google accountusing a Pixel 2 without Google account
Averting Bathos
practicality of 30 year fix mortgage at 55 years of age
Difference between types of yeast
What are the consequences of high orphan block rate?
Does wetting a beer glass change the foam characteristics?
Why does (inf + 0j)*1 evaluate to inf + nanj?
Why solving a differentiated integral equation might eventually lead to erroneous solutions of the original problem?
My Project Manager does not accept carry-over in Scrum, Is that normal?
What secular civic space would pioneers build for small frontier towns?
Why does this image of Jupiter look so strange?
Pi Zero Work With Embedded WIFI And Cellular USB Modem
What exactly did this mechanic sabotage on the American Airlines 737, and how dangerous was it?
Why weren't the Death Star plans transmitted electronically?
Why did UK NHS pay for homeopathic treatments?
Strange Sticky Substance on Digital Camera
How to deal with a Homophobic PC
Designing a time thief proof safe
I nicked the tip of the taper on a bottom bracket spindle. Is it still safe?
If a spaceship ran out of fuel somewhere in space between Earth and Mars, does it slowly drift off to Sun?
Can I see the total amount of my crafting materials?
Late 1970's and 6502 chip facilities for operating systems
Why is 6. Nge2 better, and 7. d5 a nessecary push in this game?
How 象【しょう】 ( ≈かたち、 すがた、ようす) and 象【ぞう】 (どうぶつ) got to be written with the same kanji?
Why is a road bike faster than a city bike with the same effort? & how much faster it can be?
Where is Google's internal account authentication token located?
How to find out currently running user name/ID from ADBXT1064 - 5.0.1 - Rooted - Issues with writing to /sdcardA rather complex wifi issue (android tablet)Restore an android system that will access my google accountusing a Pixel 2 without Google account
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
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.
root-access google authentication
add a comment
|
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.
root-access google authentication
add a comment
|
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.
root-access google authentication
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.
root-access google authentication
root-access google authentication
asked 9 hours ago
MehrdadMehrdad
2801 gold badge5 silver badges19 bronze badges
2801 gold badge5 silver badges19 bronze badges
add a comment
|
add a comment
|
1 Answer
1
active
oldest
votes
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.
For anyone else interested: Here's a command that will get you a token that has access to both Gmail and Google Drive (you needsqlite3
):su -c 'uid="$(/system/bin/readlink -f /storage/self/primary | /system/bin/grep -E -o "[0-9]+")"; "$PREFIX/bin/sqlite3" -readonly "/data/system_ce/$uid-0/accounts_ce.db" '""SELECT authtoken FROM authtokens WHERE type LIKE 'com.google.android.gm:%:oauth2:%https://mail.google.com/ %https://www.googleapis.com/auth/drive %' ORDER BY _id DESC LIMIT 1;""
– Mehrdad
7 hours ago
@Mehrdad$uid
will always be0
ifsu
switches to root mount namesapce, depends on configuration in root manager app. Also debug builds (most custom ROMs) already have/system/bin/sqlite3
.
– Irfan Latif
6 hours ago
1
@IrfanLatif: Oh I see. I actually realized/system/bin/readlink -f /storage/self/primary | /system/bin/grep -E -o "[0-9]+"
is faster so that's what I'm doing now. Sadly my ROM doesn't havesqlite3
so that one's not an option for me, but thanks!
– Mehrdad
6 hours ago
@Mehrdad if you are using Magisk you can download the sqlite module to get access to sqlite3 binary.
– Firelord♦
6 hours ago
add a comment
|
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "139"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fandroid.stackexchange.com%2fquestions%2f216972%2fwhere-is-googles-internal-account-authentication-token-located%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
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.
For anyone else interested: Here's a command that will get you a token that has access to both Gmail and Google Drive (you needsqlite3
):su -c 'uid="$(/system/bin/readlink -f /storage/self/primary | /system/bin/grep -E -o "[0-9]+")"; "$PREFIX/bin/sqlite3" -readonly "/data/system_ce/$uid-0/accounts_ce.db" '""SELECT authtoken FROM authtokens WHERE type LIKE 'com.google.android.gm:%:oauth2:%https://mail.google.com/ %https://www.googleapis.com/auth/drive %' ORDER BY _id DESC LIMIT 1;""
– Mehrdad
7 hours ago
@Mehrdad$uid
will always be0
ifsu
switches to root mount namesapce, depends on configuration in root manager app. Also debug builds (most custom ROMs) already have/system/bin/sqlite3
.
– Irfan Latif
6 hours ago
1
@IrfanLatif: Oh I see. I actually realized/system/bin/readlink -f /storage/self/primary | /system/bin/grep -E -o "[0-9]+"
is faster so that's what I'm doing now. Sadly my ROM doesn't havesqlite3
so that one's not an option for me, but thanks!
– Mehrdad
6 hours ago
@Mehrdad if you are using Magisk you can download the sqlite module to get access to sqlite3 binary.
– Firelord♦
6 hours ago
add a comment
|
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.
For anyone else interested: Here's a command that will get you a token that has access to both Gmail and Google Drive (you needsqlite3
):su -c 'uid="$(/system/bin/readlink -f /storage/self/primary | /system/bin/grep -E -o "[0-9]+")"; "$PREFIX/bin/sqlite3" -readonly "/data/system_ce/$uid-0/accounts_ce.db" '""SELECT authtoken FROM authtokens WHERE type LIKE 'com.google.android.gm:%:oauth2:%https://mail.google.com/ %https://www.googleapis.com/auth/drive %' ORDER BY _id DESC LIMIT 1;""
– Mehrdad
7 hours ago
@Mehrdad$uid
will always be0
ifsu
switches to root mount namesapce, depends on configuration in root manager app. Also debug builds (most custom ROMs) already have/system/bin/sqlite3
.
– Irfan Latif
6 hours ago
1
@IrfanLatif: Oh I see. I actually realized/system/bin/readlink -f /storage/self/primary | /system/bin/grep -E -o "[0-9]+"
is faster so that's what I'm doing now. Sadly my ROM doesn't havesqlite3
so that one's not an option for me, but thanks!
– Mehrdad
6 hours ago
@Mehrdad if you are using Magisk you can download the sqlite module to get access to sqlite3 binary.
– Firelord♦
6 hours ago
add a comment
|
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.
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.
edited 6 hours ago
answered 8 hours ago
Firelord♦Firelord
18.5k13 gold badges82 silver badges202 bronze badges
18.5k13 gold badges82 silver badges202 bronze badges
For anyone else interested: Here's a command that will get you a token that has access to both Gmail and Google Drive (you needsqlite3
):su -c 'uid="$(/system/bin/readlink -f /storage/self/primary | /system/bin/grep -E -o "[0-9]+")"; "$PREFIX/bin/sqlite3" -readonly "/data/system_ce/$uid-0/accounts_ce.db" '""SELECT authtoken FROM authtokens WHERE type LIKE 'com.google.android.gm:%:oauth2:%https://mail.google.com/ %https://www.googleapis.com/auth/drive %' ORDER BY _id DESC LIMIT 1;""
– Mehrdad
7 hours ago
@Mehrdad$uid
will always be0
ifsu
switches to root mount namesapce, depends on configuration in root manager app. Also debug builds (most custom ROMs) already have/system/bin/sqlite3
.
– Irfan Latif
6 hours ago
1
@IrfanLatif: Oh I see. I actually realized/system/bin/readlink -f /storage/self/primary | /system/bin/grep -E -o "[0-9]+"
is faster so that's what I'm doing now. Sadly my ROM doesn't havesqlite3
so that one's not an option for me, but thanks!
– Mehrdad
6 hours ago
@Mehrdad if you are using Magisk you can download the sqlite module to get access to sqlite3 binary.
– Firelord♦
6 hours ago
add a comment
|
For anyone else interested: Here's a command that will get you a token that has access to both Gmail and Google Drive (you needsqlite3
):su -c 'uid="$(/system/bin/readlink -f /storage/self/primary | /system/bin/grep -E -o "[0-9]+")"; "$PREFIX/bin/sqlite3" -readonly "/data/system_ce/$uid-0/accounts_ce.db" '""SELECT authtoken FROM authtokens WHERE type LIKE 'com.google.android.gm:%:oauth2:%https://mail.google.com/ %https://www.googleapis.com/auth/drive %' ORDER BY _id DESC LIMIT 1;""
– Mehrdad
7 hours ago
@Mehrdad$uid
will always be0
ifsu
switches to root mount namesapce, depends on configuration in root manager app. Also debug builds (most custom ROMs) already have/system/bin/sqlite3
.
– Irfan Latif
6 hours ago
1
@IrfanLatif: Oh I see. I actually realized/system/bin/readlink -f /storage/self/primary | /system/bin/grep -E -o "[0-9]+"
is faster so that's what I'm doing now. Sadly my ROM doesn't havesqlite3
so that one's not an option for me, but thanks!
– Mehrdad
6 hours ago
@Mehrdad if you are using Magisk you can download the sqlite module to get access to sqlite3 binary.
– Firelord♦
6 hours ago
For anyone else interested: Here's a command that will get you a token that has access to both Gmail and Google Drive (you need
sqlite3
): su -c 'uid="$(/system/bin/readlink -f /storage/self/primary | /system/bin/grep -E -o "[0-9]+")"; "$PREFIX/bin/sqlite3" -readonly "/data/system_ce/$uid-0/accounts_ce.db" '""SELECT authtoken FROM authtokens WHERE type LIKE 'com.google.android.gm:%:oauth2:%https://mail.google.com/ %https://www.googleapis.com/auth/drive %' ORDER BY _id DESC LIMIT 1;""
– Mehrdad
7 hours ago
For anyone else interested: Here's a command that will get you a token that has access to both Gmail and Google Drive (you need
sqlite3
): su -c 'uid="$(/system/bin/readlink -f /storage/self/primary | /system/bin/grep -E -o "[0-9]+")"; "$PREFIX/bin/sqlite3" -readonly "/data/system_ce/$uid-0/accounts_ce.db" '""SELECT authtoken FROM authtokens WHERE type LIKE 'com.google.android.gm:%:oauth2:%https://mail.google.com/ %https://www.googleapis.com/auth/drive %' ORDER BY _id DESC LIMIT 1;""
– Mehrdad
7 hours ago
@Mehrdad
$uid
will always be 0
if su
switches to root mount namesapce, depends on configuration in root manager app. Also debug builds (most custom ROMs) already have /system/bin/sqlite3
.– Irfan Latif
6 hours ago
@Mehrdad
$uid
will always be 0
if su
switches to root mount namesapce, depends on configuration in root manager app. Also debug builds (most custom ROMs) already have /system/bin/sqlite3
.– Irfan Latif
6 hours ago
1
1
@IrfanLatif: Oh I see. I actually realized
/system/bin/readlink -f /storage/self/primary | /system/bin/grep -E -o "[0-9]+"
is faster so that's what I'm doing now. Sadly my ROM doesn't have sqlite3
so that one's not an option for me, but thanks!– Mehrdad
6 hours ago
@IrfanLatif: Oh I see. I actually realized
/system/bin/readlink -f /storage/self/primary | /system/bin/grep -E -o "[0-9]+"
is faster so that's what I'm doing now. Sadly my ROM doesn't have sqlite3
so that one's not an option for me, but thanks!– Mehrdad
6 hours ago
@Mehrdad if you are using Magisk you can download the sqlite module to get access to sqlite3 binary.
– Firelord♦
6 hours ago
@Mehrdad if you are using Magisk you can download the sqlite module to get access to sqlite3 binary.
– Firelord♦
6 hours ago
add a comment
|
Thanks for contributing an answer to Android Enthusiasts Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fandroid.stackexchange.com%2fquestions%2f216972%2fwhere-is-googles-internal-account-authentication-token-located%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown