puddly / android-otp-extractor

Extracts OTP tokens from rooted Android devices
GNU General Public License v3.0
238 stars 22 forks source link

ValueError: Invalid suffix '-journal' #32

Closed zzndb closed 4 years ago

zzndb commented 4 years ago

error details:

➜  ~ python -m android_otp_extractor --andotp-backup otp.json
2020-02-28 13:05:04 oSdb android_otp_extractor.cli[9195] INFO Checking for root by listing the contents of $ANDROID_DATA/data. You might have to grant ADB temporary root access.
2020-02-28 13:05:04 oSdb android_otp_extractor.cli[9195] INFO Checking if files can be properly read by reading $ANDROID_ROOT/build.prop
2020-02-28 13:05:04 oSdb android_otp_extractor.apps[9195] INFO Reading Authy accounts
2020-02-28 13:05:04 oSdb android_otp_extractor.apps[9195] INFO Found 0 accounts (0 new)
2020-02-28 13:05:04 oSdb android_otp_extractor.apps[9195] INFO Reading FreeOTP accounts
2020-02-28 13:05:04 oSdb android_otp_extractor.apps[9195] INFO Found 0 accounts (0 new)
2020-02-28 13:05:04 oSdb android_otp_extractor.apps[9195] INFO Reading FreeOTP+ accounts
2020-02-28 13:05:04 oSdb android_otp_extractor.apps[9195] INFO Found 0 accounts (0 new)
2020-02-28 13:05:04 oSdb android_otp_extractor.apps[9195] INFO Reading Duo accounts
2020-02-28 13:05:05 oSdb android_otp_extractor.apps[9195] INFO Found 0 accounts (0 new)
2020-02-28 13:05:05 oSdb android_otp_extractor.apps[9195] INFO Reading Google Authenticator accounts
Traceback (most recent call last):
  File "/home/zzndb/.pyenv/versions/3.7.1/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/zzndb/.pyenv/versions/3.7.1/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/zzndb/.pyenv/versions/virtual-env-3.7.1/lib/python3.7/site-packages/android_otp_extractor/__main__.py", line 3, in <module>
    main()
  File "/home/zzndb/.pyenv/versions/virtual-env-3.7.1/lib/python3.7/site-packages/android_otp_extractor/cli.py", line 74, in main
    accounts = apps.read_accounts(adb, enabled_apps)
  File "/home/zzndb/.pyenv/versions/virtual-env-3.7.1/lib/python3.7/site-packages/android_otp_extractor/apps.py", line 318, in read_accounts
    new = list(app.extractor(adb))
  File "/home/zzndb/.pyenv/versions/virtual-env-3.7.1/lib/python3.7/site-packages/android_otp_extractor/apps.py", line 118, in read_google_authenticator_accounts
    with open_remote_sqlite_database(adb, adb.data_root/'com.google.android.apps.authenticator2/databases/databases') as connection:
  File "/home/zzndb/.pyenv/versions/3.7.1/lib/python3.7/contextlib.py", line 112, in __enter__
    return next(self.gen)
  File "/home/zzndb/.pyenv/versions/virtual-env-3.7.1/lib/python3.7/site-packages/android_otp_extractor/contrib.py", line 21, in open_remote_sqlite_database
    remote_file = database.with_suffix(suffix)
  File "/home/zzndb/.pyenv/versions/3.7.1/lib/python3.7/pathlib.py", line 827, in with_suffix
    raise ValueError("Invalid suffix %r" % (suffix))
ValueError: Invalid suffix '-journal'

--

intall the latest version. get the same error from system python and virtualenv python environment.

puddly commented 4 years ago

Thanks for the bug report. I've pushed a fix and it works with Google Authenticator for me.

zzndb commented 4 years ago

update and works fine, thanks your work.