A next-gen Android flashing tool with multi-device support and enhanced safety features for devices based on Qualcomm and MediaTek platforms.
Use at your own risk. Always maintain backup of critical data before flashing. The authors are not responsible for any bricked devices.
- Multi-Device Support via
devices.json
configuration - A/B Slot Management with automatic partition handling
- Platform-Tools Auto-Setup (bundled or system)
- Verified Boot (AVB) Control with disable options
- Windows Admin Privilege Handling with UAC elevation
- Cross-Platform Support (Windows/Linux/macOS)
- Comprehensive Logging with timestamped records
- Interactive Menu System with color-coded UI
- Smart Partition Resizing for logical partitions
- Device Compatibility Verification via board checks
# Clone repository
git clone https://github.com/PHATWalrus/universal-flasher.git
cd universal-flasher
# Install requirements
pip install -r requirements.txt
requests
colorama
packaging
pyinstaller #(only if you want to make an compiled binary)
-
Prepare Firmware Files:
# Required base files boot.img vendor_boot.img dtbo.img # Optional firmware files abl.img modem.img tz.img
-
Run Flasher:
python flash.py
-
Follow Prompts:
- Select device from supported list
- Choose slot strategy (A/B or current)
- Confirm partition flashing
- Handle AVB verification
- Manage data wipe
Create EXE with PyInstaller:
pyinstaller --noconfirm --onefile --console --icon "icon.ico" --name flasher flash.py
Build Automation (GitHub Actions):
# .github/workflows/build.yml
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
- run: pip install -r requirements.txt
- run: pyinstaller --onefile --name flasher flash.py
devices.json
Structure:
{
"devices": [
{
"model": "Nothing Phone 2",
"codename": "pong",
"board": "taro",
"partitions": {
"boot": ["boot", "vendor_boot", "dtbo", "recovery"],
"firmware": ["abl", "aop", "aop_config", "bluetooth", "cpucp", "devcfg", "dsp", "featenabler", "hyp", "imagefv", "keymaster", "modem", "multiimgoem", "multiimgqti", "qupfw", "qweslicstore", "shrm", "tz", "uefi", "uefisecapp", "xbl", "xbl_config", "xbl_ramdump"],
"logical": ["system", "system_ext", "product", "vendor", "vendor_dlkm", "odm"],
"vbmeta": ["vbmeta_system", "vbmeta_vendor"]
},
"slot_specific": ["boot", "vendor_boot", "dtbo", "recovery"]
}
]
}
- When in bootloader run the following command
fastboot getvar product
- Alternatively use the following command
getprop | grep -i board
- Copy the value for
ro.product.board
:
- Download the correct flasher executable for your OS (Windows/Linux) from the releases page before proceeding.
- Place the script in the same directory where the all the required stock partition
.img
files are located.- For Nothing and CMF phones, you can obtain these files from the nothing_archive.
- Alternatively, you can extract the
.img
files from apayload.bin
file if it's available for your specific device model.
- Ensure your device is in bootloader mode before proceeding.
- For Windows:
- Double-click the
flasher.exe
file to start the process.
- Double-click the
- For Linux/macOS:
- Open a terminal and navigate to the directory where your
.img
files are located. - Run the following commands to set execution permissions and flash the files:
# Make the binary executable chmod +x flasher # Execute the flasher ./flasher
- Open a terminal and navigate to the directory where your
Common Issues:
- Missing .img Files: Ensure required partitions exist in working directory
- Admin Rights: On Windows, run as Administrator for system PATH updates
- Device Not Detected:
- Verify fastboot mode
- Check USB drivers.
- For windows: Ensure that the
Android Bootloader Interface
appears in Device Manager when the device is connected in bootloader mode. - For Linux: Configure udev rules
- Board Mismatch: Double-check device configuration in
devices.json
Log Analysis:
# Check generated log files
tail -f flash_log_20250209_1600.txt
Thanks to all those involved with Pong_fastboot_flasher and its actively maintained forks for their work! Their contributions laid the foundation for the partition flashing order and the commands used in the script for Qualcomm and MediaTek models, greatly influencing many of the features implemented in this tool.
📝 License: MIT | 💻 Requirements: Python 3.10+ | 📦 Dependencies: See requirements.txt