A Python GUI application to extract and view loyalty card data from Stocard backup files. This tool allows you to access your loyalty cards with scannable Code 128 barcodes and card logos without needing the original Stocard app.
NOTE: I still cant find/connect name of cards so logos and custom labels are used instead
- 🎫 Extract loyalty cards from Stocard database backups
- 🖼️ Display card logos extracted from the database
- 📱 Generate scannable Code 128 barcodes for each card
- 📋 Copy card numbers to clipboard with one click
- 🏷️ Show card labels and organize cards in tabs
- 💻 Clean, user-friendly interface with tabbed navigation
- Python 3.7 or higher
- Stocard backup file (
sync_db)
-
Clone this repository:
git clone https://github.com/yourusername/stocard-viewer.git cd stocard-viewer -
Install required packages:
pip install pillow python-barcode
Rooted: copy sync_db from data/data/de.stocard/de.stocard.stocard/databases/sync_db to folder where you downloaded this repository
Not rooted: i was able to get sync_db via android security backup (MIUI). Make backup only of Stocard app and copy backup to your computer, then use 7zip to open backup and extract sync_db
Run the extractor script to extract card data and logos from your Stocard database:
python stocard_extractor.pyThis will:
- Find your user ID in the database
- Extract all loyalty cards for your account
- Download card logos to the
logos/directory - Display a summary of extracted cards
Launch the GUI viewer:
python stocard_viewer.pyThe application will open with:
- Individual tabs for each loyalty card
- Card logos displayed when available
- Large, readable card numbers
- Code 128 barcodes that can be scanned by any barcode reader
- Copy buttons for easy access to card numbers
stocard-viewer/
├── stocard_extractor.py # Extracts card data from database
├── stocard_viewer.py # GUI application (recommended)
├── stocard_gui.py # Alternative scrollable GUI
├── sync_db # Your Stocard database backup
├── logos/ # Directory for extracted card logos
│ ├── 4710.png
│ ├── 220.png
│ └── ...
└── README.md
- Ensure your
sync_dbfile is in the same directory - Check that the database file is not corrupted
- Verify you have the correct backup file from Stocard
- Some cards may not have logos if they're custom or unsupported
- Logos are extracted automatically when available
- The app works fine without logos
- Ensure
python-barcodeis installed correctly - Check that card numbers contain valid characters
- Fallback text display is shown if barcode generation fails
- tkinter: GUI framework (included with Python)
- PIL/Pillow: Image processing for logos and barcodes
- python-barcode: Code 128 barcode generation
- sqlite3: Database access (included with Python)
The project includes two GUI options:
stocard_viewer.py(recommended): Tabbed interface with individual card viewsstocard_gui.py: Scrollable interface showing all cards in one view
- All processing is local - no data is sent to external servers
- Your card data stays on your device
- No internet connection required after installation
- Works offline completely
Contributions are welcome! Please feel free to:
- Report bugs
- Suggest new features
- Submit pull requests
- Improve documentation
This project is open source. Feel free to use, modify, and distribute as needed.
This tool is for personal use with your own Stocard data. Ensure you have proper authorization to access any database files you use with this application.
If you encounter issues:
- Check the troubleshooting section above
- Ensure all dependencies are installed correctly
- Verify your
sync_dbfile is valid - Open an issue on GitHub with details about your problem
Note: This is an unofficial tool and is not affiliated with Stocard. It's designed to help users access their own loyalty card data from backup files.