Closed Madis0 closed 6 years ago
The location of adb
should make no difference. Do any XML files exist in /data/data/com.authy.authy/shared_prefs/
?
Yes, there are several of them.
Does running adb shell 'su -c "toybox base64 /data/data/com.authy.authy/shared_prefs/com.authy.storage.tokens.authenticator.xml"' | base64 --decode
successfully read the file?
It writes the file to terminal, though it seems to be unescaped HTML-style, lots of "
s.
That's expected, but it's strange that no accounts are being parsed from the file. I can't reproduce this issue on any of my devices with the latest version of Authy installed.
Can check to see how far read_authy_accounts
actually progresses before breaking? Does adb_read_file
actually produce a valid BytesIO
object or does it throw an error? Is the accounts
variable properly populated? You can just litter the function with print
calls to see what happens.
Not experienced with Python, so did indeed try print statements. Apparently neither of the Authy files are found by the script.
The exact command that is run is:
adb shell 'su -c "toybox base64 /data/data/com.authy.authy/shared_prefs/com.authy.storage.tokens.authenticator.xml /3bb22bb739c29e435151cb38"'
The output should look like:
lotsofbase64lotsofbase64
lotsofbase64lotsofbase64
lotsofbase64lotsofbase64
lotsofbase64=
base64: /3bb22bb739c29e435151cb38: No such file or directory
Is this what you see? Are you using just a stock Android 8.1 ROM? If so, I will try emulating it to see if something changed.
I see the same indeed. I am using a custom ROM called OmniROM with it's 24 Jul patch for OnePlus 5T.
I think I see the problem. You only replaced the first instance of adb
in the script with ./adb
. There are four instances. A proper solution would be to fix your PATH
to temporarily include the current folder so adb
refers to the right binary:
PATH=.:$PATH python extract_otp_tokens.py
That finally worked. Thank you!
I am using:
Here's how I tried to use this script:
.py
file./adb devices
in it's directory to make sure it connects to the phonepython extract_otp_tokens.py
to see what happens, obviouslyFileNotFoundError: [Errno 2] No such file or directory: 'adb': 'adb'
adb
to same folder as the script, replaced'adb'
with'./adb'
in the script to make it workpython extract_otp_tokens.py
, accepted root permission on phonepython extract_otp_tokens.py --show-qr
file:///tmp/tmp...
opened in (where...
is a random ending string) browser with title "OTP QR Codes" and no content (source is valid HTML though)python extract_otp_tokens.py --andotp-backup ANDOTP_BACKUP
which produced file ANDOTP_BACKUP with contents[]
The succeeded commands had the following log in terminal:
Any ideas?