Forked from ragusa87/android-authenticator2-extract-qrcode.sh
Created
January 23, 2018 22:49
-
-
Save phatz/5123ed4d93ef381641369acc3ab24881 to your computer and use it in GitHub Desktop.
Extract data from android backup of Google Authenticator 2 to qrcodes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Extract data from nandroid backup of Google Authenticator 2 | |
# > /data/data/com.google.android.apps.authenticator2/databases/databases | |
# require: sqlite3 + qrencode | |
sqlite3 databases <<! | |
.headers off | |
.mode csv | |
.output codes.csv | |
select printf("otpauth://totp/%s?secret=%s&issuer=%s",email,secret,issuer) from accounts; | |
! | |
# Unquote lines | |
sed -i 's/\"//g' codes.csv | |
# Display as QR CODE | |
i=0; | |
while read p; do | |
qrencode -t ANSIUTF8 -8 -o - "${p}" | |
echo "${p}" | |
echo -e "\n\n" | |
done < codes.csv | |
rm codes.csv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment