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

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.2
File Size Uploaded
xiaomi_flashable_firmware_creator-2.3.2.tar.gz 260.6 kB Details

Built distribution (wheel)

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

Total release size: 541.7 kB

Release files / xiaomi_flashable_firmware_creator-2.3.2.tar.gz

Download URL xiaomi_flashable_firmware_creator-2.3.2.tar.gz
Size 260.6 kB
Tags Source
SHA-256 checksum
How to use checksums
2a8d4ad3e0be18bd38052b3603643ab95214873303aa5a20b4898429575fccc5
BLAKE2b-256 checksum
How to use checksums
0f9c6743c42f2dfa4dade3c0796d253dcac4d8abe26b470248ef2d7c6c4d214c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","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.2-py3-none-any.whl

Download URL xiaomi_flashable_firmware_creator-2.3.2-py3-none-any.whl
Size 281.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f0136f96740f4e7c6049be9e044dd2e6058902d54de5415b3f8f12a28ef035e8
BLAKE2b-256 checksum
How to use checksums
99b58a74c3b83f5a7491a78f91f93ebb08e422081170ebb8bfd15e77491a7fda
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","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

2.3.3

2 release files

This release

2.3.2 This release

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