Forked from ragusa87/android-authenticator2-extract-qrcode.sh
Created
March 11, 2018 09:22
-
-
Save 0x4d4e/8d79b0749e427ec97fa36bb62bc13cc5 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