Open shakasan opened 6 years ago
@shakasan I would like to help you but I don't know how I could export the database file from the google auth app. Otherwise, you can attach 1 or 2 database example(s) to your comment.
@Max1Truc Thanks for your reply. The database is located here on Android phones : /data/data/com.google.android.apps.authenticator2/databases/ You must have a rooted device to access it. It's a simple SQLite3 database and all keys are stored in a simple table. If I can help for something, don't hesitate ;-) Thanks for your good extension :-)
Hi, First, it's not my extension, it's @Rayquaza01's. Second, if you could give me an example database file or just table's name and columns' names, it should save me some time. Finally, you can see my work at #11.
@shakasan I'm not really sure this fits in the scope of the extension, but I can see how it could be useful. I made a quick python script to convert GA databases here: https://gist.github.com/Rayquaza01/1d58fb8eb31714671bfeca85ea3936ec
It expects the GA database to be in the same folder as the script and named databases
(the default name). It then drops a file named totp.json
that can be imported into the extension. Let me know if you have any trouble getting it running.
@Max1Truc For future reference, the table is named accounts
and the relevant columns are named email
and secret
, and here's a sample database: databases.zip
Thanks @Rayquaza01.
I'm gonna code it.
Hey @shakasan ! I'm waiting for an answer to continue coding.
@Max1Truc Sorry for my late reply ^^
I have tested it and the import seems to work well. The JSON file look ok. I added the resulted file (without keys of course ;) ) with some old examples.
{"otp_list":[{"name":"Makoto no Blog:makotosan","key":"my_key"},"name":"francois@domain.org","key":"my_key"}, {"name":"Hostens","key":"my_key"},{"name":"Makoto's Nextcloud:francois@domain.org/nextcloud","key":"my_key"},{"name":"root","key":"my_key"},{"name":"null","key":"my_key"}]}
Just a suggestion. Even if it's an exception, but as you can see in the example file, the CSAM-Login entry as no meaningful name in email/original_name columns, but has it in issuer column. Maybe it could be useful to add issuer name as name if email/original_name columns entries have useless values like null.
Sorry again for late reply. If I can help more, just tell me :) Thanks again for your work and feedback :)
Okay @shakasan No problem for your late reply. Could you try the new version on JSFiddle or with GitHub's Gists, please ?
@shakasan Sorry, I won't have time to implement it into the extension, maybe somebody will ?
Edit : I write here the link to my JavaScript code on JSFiddle to help anybody who need it : https://jsfiddle.net/Max1Truc/hgfLb09c/
.json is industry standard as I know. If you cannot export it as that then you could do a simple python script to convert it to json.
It could be nice if can import the database file (SQLite) from Google Authenticator android app by example.
Thanks :-)