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.3

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.3
File Size Uploaded
xiaomi_flashable_firmware_creator-2.3.3.tar.gz 132.5 kB Details

Built distribution (wheel)

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

Total release size: 287.5 kB

Release files / xiaomi_flashable_firmware_creator-2.3.3.tar.gz

Download URL xiaomi_flashable_firmware_creator-2.3.3.tar.gz
Size 132.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a05647dd1a93d4db29361dc04bfee5bd8695a802761340d63004af8f3398120e
BLAKE2b-256 checksum
How to use checksums
18ecf17659171381ab7d678544e88c66ea75b786ed1af852d9f3bd42bf838d8d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

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

Download URL xiaomi_flashable_firmware_creator-2.3.3-py3-none-any.whl
Size 155.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e476d7ce62b30b876819ebd44420726d937929ef09f9ccd731acda8bb855c2c7
BLAKE2b-256 checksum
How to use checksums
9e3b7b1cade6c8de86cd375165844df67f5addb7a7171f3e8cef00254eec8707
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

2.3.3 This release

2 release files

2.3.2

2 release files

2.3.1

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