Skip to main content

Parse a FreeOTP xml file and present QR codes or strings for import elsewhere

Project description

FreeOTP-Export

PyPi Version

Rescue your OTP tokens from FreeOTP

Not compatible with modern FreeOTP

FreeOTP was finally updated and now uses a different storage format, which this tool does not yet support. See #1

Installing

You can install directly through pip: pip install freeotp-export

Alternatively, to install from source, clone the repo or download and unpack a tarball, then...

  • If you already have poetry installed, you can just run:
    $ poetry run freeotp-export tokens.xml
    
  • Otherwise, use pip: pip install --upgrade .
  • If you must, running __main__.py may work if you have the dependencies installed.

Usage

Acquire the File

If your phone is rooted, you can just grab the file from /data/data/org.fedorahosted.freeotp/shared_prefs/tokens.xml

Otherwise, start by enabling debugging on the phone and setting up the android platform tools. Grab a backup off the app data by running adb backup org.fedorahosted.freeotp, and when asked for a password, don't enter one.

To read the resulting Android backup file, backup.ab, you can either use android-backup-extractor:

$ abe unpack backup.ab - | tar xv --strip-components=3

Or yolo it by adding the tar header yourself:

$ ( printf "\x1f\x8b\x08\x00\x00\x00\x00\x00" ; tail -c +25 backup.ab ) | tar zxv --strip-components=3

You should then have the token file, tokens.xml.

Read the File

Just run this tool, and it'll give you both the OTP URIs (otpauth://...) and scannable QR codes. Note that Google Authenticator ignores the digits parameter, so it does not work for issuers like Blizzard that use lengths other than 6.

If you used pip install: $ freeotp-export tokens.xml

Or with Poetry: $ poetry run freeotp-export tokens.xml

After importing everything to a new app, be sure to delete tokens.xml and backup.ab, since they contain all of your tokens!

See Also

freeotp-export, an HTML/JS tool to do the same thing, which I discovered after writing and publishing this.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

freeotp_export-0.1.1.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

freeotp_export-0.1.1-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file freeotp_export-0.1.1.tar.gz.

File metadata

  • Download URL: freeotp_export-0.1.1.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.11

File hashes

Hashes for freeotp_export-0.1.1.tar.gz
Algorithm Hash digest
SHA256 aaa839e6727162b3d2dd181bee23bb806a6589c74ba2c12d212915b7a460215a
MD5 8de769f6f6191851fdd67423d2c95321
BLAKE2b-256 2d5e725c1ac436c75c4135ddaefcd803f4349fd3944434eb583eaafd383cc746

See more details on using hashes here.

File details

Details for the file freeotp_export-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for freeotp_export-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 36a50538bd953136e1ecc8a4be10b2c72a0af42decf952aa2a6a6b6f675f4c40
MD5 ef482fe64f70e1067190cc97864e4c58
BLAKE2b-256 c170039f7afb0bb85ce3dca1b61ba54fd42ddfe2a5db3cdffe2d223292656599

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page