Skip to main content

Xiaomi Flashable Firmware Creator

Create flashable firmware zip from MIUI and HyperOS Recovery ROMs!

PyPI version made-with-python Codacy Badge Open Source Love
PayPal Patreon Liberapay

Xiaomi Flashable Firmware Creator is a tool that generates flashable firmware-update packages from official MIUI and HyperOS ROMS.

It supports creating untouched firmware, non-arb firmware, firmware + vendor flashable zip, and firmware-less ROMs from any local zip file or direct link of the zip file.

Requirements

This tool requires the following dependencies to be installed on your system:

  • payload-dumper-go: Used for extracting Android OTA payload files. Install using your system package manager or from releases.
  • xz: Required for payload decompression.

Installing xz

Linux and macOS (From package manager, recommended):

  • Ubuntu/Debian: sudo apt install xz-utils
  • CentOS/RHEL/Fedora: sudo yum install xz or sudo dnf install xz
  • Arch Linux: sudo pacman -S xz
  • openSUSE: sudo zypper install xz
  • macOS (Homebrew): brew install xz
  • macOS (MacPorts): sudo port install xz

Windows:

  1. Download the latest XZ Utils for Windows from tukaani.org/xz/
  2. Extract the downloaded archive to a directory on your system
  3. Add the directory containing xz.exe to your system's PATH environment variable

Verify installation: Run xz --version in your terminal to confirm xz is properly installed.

Note: Working on a SSD is highly recommended for performance reasons when processing large payload files, as HDDs can be a bottleneck.

Installation

You can simply install this tool using uv.

uv install xiaomi_flashable_firmware_creator

CLI Usage

xiaomi_flashable_firmware_creator [-h] (-F FIRMWARE | -N NONARB | -L FIRMWARELESS | -V VENDOR) [-o OUTPUT]

Examples:

  • Creating normal (untouched) firmware:
xiaomi_flashable_firmware_creator -F [ROM ZIP]
  • Creating non-arb firmware (without anti-rollback):
xiaomi_flashable_firmware_creator -N [ROM ZIP]
  • Creating firmware-less ROM (stock untouched ROM with just firmware removed):
xiaomi_flashable_firmware_creator -L [ROM ZIP]
  • Creating firmware + vendor flashable zip:
xiaomi_flashable_firmware_creator -V [ROM ZIP]

Using from other Python scripts

from xiaomi_flashable_firmware_creator.firmware_creator import FlashableFirmwareCreator

# initialize firmware creator object with the following parameters:
# input_file: zip file to extract from. It can be a local path or a remote direct url.
# process: Which mode should the tool use. This must be one of "firmware", "nonarb", "firmwareless" or "vendor". (See CLI Usage for more details)
# out_dir: The output directory to store the extracted file in.

firmware_creator = FlashableFirmwareCreator(input_zip, process, output_dir)
# Now, you can either use auto() method to create the new zip file or do stuff at your own using firmware_creator public methods.
new_zip = firmware_creator.auto()

Development

This project uses several tools to streamline the development process:

mise

mise is used for managing project-level dependencies and environment variables. mise helps ensure consistent development environments across different machines.

To get started with mise:

  1. Install mise by following the instructions on the official website.
  2. Run mise install in the project root to set up the development environment.

This file is automatically loaded by mise and allows you to customize your local development environment without modifying the shared configuration files.

UV

UV is used for dependency management and packaging. It provides a clean, version-controlled way to manage project dependencies.

To set up the project with UV:

  1. Install UV using mise, or by following the instructions on the official website.
  2. Run uv sync to install project dependencies.

Development Tools

For development, this project uses additional tools managed by mise:

Metadata

Release files for xiaomi_flashable_firmware_creator 2.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xiaomi_flashable_firmware_creator 2.3.1
File Size Uploaded
xiaomi_flashable_firmware_creator-2.3.1.tar.gz 260.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for xiaomi_flashable_firmware_creator 2.3.1
File Interpreter ABI Platform
xiaomi_flashable_firmware_creator-2.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 541.2 kB

Release files / xiaomi_flashable_firmware_creator-2.3.1.tar.gz

Download URL xiaomi_flashable_firmware_creator-2.3.1.tar.gz
Size 260.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a1257bb4ccc735c828061cc176ccbe38c53135a8216e36425a6863a248fac751
BLAKE2b-256 checksum
How to use checksums
e9215411daddc87891a53eb062c0498a5b127bcfe04f3cafb9762d3c644a195b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.8.22

Release files / xiaomi_flashable_firmware_creator-2.3.1-py3-none-any.whl

Download URL xiaomi_flashable_firmware_creator-2.3.1-py3-none-any.whl
Size 280.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
880f6c0b3a38f14f778ace5f579bc21fb57cf7f327121595276a3e4a5363cfd0
BLAKE2b-256 checksum
How to use checksums
7fa8bb180ca1061c9debeea5668d24e5ecc13e86443c70ac07ad69497337fa74
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.8.22

Release history Release notifications | RSS feed

2.3.3

2 release files

2.3.2

2 release files

This release

2.3.1 This release

2 release files

2.3.0

2 release files

2.2.14

2 release files

2.2.13

2 release files

2.2.12

2 release files

2.2.11

2 release files

2.2.10

2 release files

2.2.9

2 release files

2.2.8

2 release files

2.2.7

2 release files

2.2.6

2 release files

2.2.5

2 release files

2.2.4

2 release files

2.2.3

2 release files

2.2.2

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.2

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page