Created
May 27, 2015 21:36
-
-
Save ragusa87/f9d82ca631df0d4d32a0 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