https://github.com/raphiz/freeotp-backup
A simple python script to backup OTP tokens from the FreeOTP Android app
https://github.com/raphiz/freeotp-backup
Last synced: about 1 year ago
JSON representation
A simple python script to backup OTP tokens from the FreeOTP Android app
- Host: GitHub
- URL: https://github.com/raphiz/freeotp-backup
- Owner: raphiz
- Created: 2019-09-09T06:01:39.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-04-28T08:06:54.000Z (about 6 years ago)
- Last Synced: 2025-06-21T23:33:17.663Z (about 1 year ago)
- Language: Python
- Size: 6.84 KB
- Stars: 12
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Backup FreeOTP
A simple python script to backup [OTP tokens](https://en.wikipedia.org/wiki/One-time_password)
from the [FreeOTP Android app](https://play.google.com/store/apps/details?id=org.fedorahosted.freeotp).
To create backups you must use [adb](https://developer.android.com/studio/command-line/adb). This script just extracts the tokens from the backup archive and gereates qr codes to provide a simple restore process.
If [pyqrcode](https://github.com/mnooner256/pyqrcode) to be is installed, this script generates qr codes that can be scanned with FreeOTP.
Otherwise the [topt url](https://github.com/google/google-authenticator/wiki/Key-Uri-Format) is printed and
you can generate the qr code with a different tool.
Have fun!
## Installation
```bash
# Clone this repo
git clone git@github.com:raphiz/freeotp-backup.git
cd freeotp-backup/
# Optional: Create a virtual env and install optional dependencies
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
```
## Example Usage
```bash
# Create a backup of the App using ADB - don't encrypt it...
adb backup -f freeotp-backup.ab -apk org.fedorahosted.freeotp
python backup_freetop_codes.py freeotp-backup.ab
```
## Contributors
- [raphiz](https://github.com/raphiz)
- [Dezső BICZÓ](https://github.com/mxr576)
## Credits
- [The FreeOTP Android App](https://freeotp.github.io/)
- ["Backing up and recovering 2FA tokens from FreeOTP" by Marvin Contessi](https://gist.github.com/kontez/05923f2fc208c6bbe3de81f28de571db)
- [pyqrcode by Michael Nooner](https://github.com/mnooner256/pyqrcode)
- [StackOverflow Answer by Alex Martelli](https://stackoverflow.com/questions/29055634/python-unpack-android-backup#answer-29055723)