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

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.4
File Size Uploaded Provenance Actions
xiaomi_flashable_firmware_creator-2.3.4.tar.gz 134.4 kB Without provenance Details for xiaomi_flashable_firmware_creator-2.3.4.tar.gz

Built distribution (wheel)

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

Total release size: 289.4 kB

Release files / xiaomi_flashable_firmware_creator-2.3.4.tar.gz

Download URL xiaomi_flashable_firmware_creator-2.3.4.tar.gz
Size 134.4 kB
Tags Source
SHA-256 checksum
How to use checksums
29c3981623e2d2a5cfbedd08a42a5d987ce667226a8118dc4738384ec3c918ce
BLAKE2b-256 checksum
How to use checksums
0555c6c9c6eb34e20da24c5d5010af9fd397f5d9cf2a9d8f703bed00aa047426
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","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.4-py3-none-any.whl

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

Security for xiaomi_flashable_firmware_creator 2.3.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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