[TOOL][WIN/LINUX/MAC] Xiaomi Flashable Firmware Creator V2 (GUI/CLI)

yshalsager

Recognized Developer
Oct 13, 2014
3,879
7,216
263
Cairo
xiaomifirmwareupdater.com
Do you want to create your own firmware files from MIUI ROMs without depending on Xiaomi Firmware Updater? Then you need the new tool!
Xiaomi Flashable Firmware Creator
Part of Xiaomi Firmware Updater project
Code:
#include 
/*
* Your warranty is now void.
*
* I am not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because the alarm app failed. Please
* do some research if you have any concerns about features included in this tool
* before flashing it! YOU are choosing to make these modifications, and if
* you point the finger at me for messing up your device, I will laugh at you.
*/
Xiaomi Flashable Firmware Creator is a tool that generates flashable firmware-update packages from official (or non-official?) MIUI ROMS.
It supports creating untouched firmware, non-arb firmware, firmware + vendor flashable zip and firmware-less ROMs.


Features:
  • CLI and GUI version.
  • Easy-to-use interface.
  • Supports local and remote zip files.
  • Easy to integrate with other Python scripts.
  • Multilanguage support (more than 25 languages!). Thanks to our community members!

Screenshots:
Here, or Here.

GUI Usage:

  • Make sure that you have Python3 installed on your device.
  • Install the tool.
    Code:
    pip3 install xiaomi_flashable_firmware_creator_gui
  • Run the tool.
    Code:
    xiaomi_flashable_firmware_creator_gui
  • Select MIUI zip, or drop it to the box.
  • Choose the output type you would like to create.
  • Click on create button.

CLI Usage:
You need python 3 installed on your device, or you can get the compiled executable from here.
Install the tool using the following command:
Code:
pip3 install xiaomi_flashable_firmware_creator
- Creating normal (untouched) firmware:
Code:
xiaomi_flashable_firmware_creator -F [MIUI ZIP]
- Creating non-arb firmware (without anti-rollback):
Code:
xiaomi_flashable_firmware_creator -N [MIUI ZIP]
- Creating firmware-less ROM (stock untouched ROM with just firmware removed):
Code:
xiaomi_flashable_firmware_creator -L [MIUI ZIP]
- Creating normal vendpr+firmware:
Code:
xiaomi_flashable_firmware_creator -V [MIUI ZIP]

- Using executable files:
On Linux:
Code:
./create_flashable_firmware -F [MIUI ZIP]
On Windows:
Code:
create_flashable_firmware.exe -F [MIUI ZIP]
Detailed Guide:
Check [Guide] How to edit Miui ROMs to flash without bootloader by @AL_IRAQI

Ready-made firmware files:
If you're lazy or looking for ready-made firmware files for whatever Xiaomi device, check my Xiaomi Firmware Updater project. It provides automatically generated Xiaomi firmware flashable zip files for every MIUI new update!

Support and Contact:
Having trouble with firmware files? You can open a new issue on Github repository or just write here in a reply, and I’ll help you sort it out.
Also If you want to add a new feature or fix any problem, feel free to push a PR.

Donations:
My works are free and open-source, that cost money, time and many efforts.
If you want to make a donation, you can use:
- Paypal
- Pateron
- LiberaPay

XDA:DevDB Information
Xiaomi Flashable Firmware Creator V2, Tool/Utility for the Android General

Contributors
yshalsager
Source Code: https://github.com/XiaomiFirmwareUpdater/xiaomi-flashable-firmware-creator


Version Information
Status: Stable
Current Stable Version: 2.0
Stable Release Date: 2020-10-17

Created 2018-11-24
Last Updated 2020-10-17
 

Attachments

robinex

Member
Sep 11, 2018
8
1
0
in windows 10 give error after make new zip rename.
edit py file with text editor.
Find
Code:
def make_zip():
    rom, process = arg_parse()
    with open("out/META-INF/com/google/android/updater-script", 'r') as i:
        codename = str(i.readlines()[7].split('/', 3)[2]).split(':', 1)[0].replace('_', '-')
    print("Creating " + process + " zip from " + rom + " for " + codename)
    make_archive('firmware', 'zip', 'out/')
    if path.exists('firmware.zip'):
        if process == "firmware":
            rename('firmware.zip', 'fw_' + codename + "_" + rom)
        elif process == "nonarb":
            rename('firmware.zip', 'fw-non-arb_' + codename + "_" + rom)
        elif process == "firmwareless":
            rename('firmware.zip', 'fw-less_' + codename + "_" + rom)
        print("All done!")
        rmtree("tmp")
        rmtree('out')
    else:
        print("Failed!" + '\n' + "Check out folder!")
Replace this

Code:
def make_zip():
    rom, process = arg_parse()
    with open("out/META-INF/com/google/android/updater-script", 'r') as i:
        codename = "NEW"
    print("Creating " + process + " zip from " + rom + " for " + codename)
    make_archive('firmware', 'zip', 'out/')
    if path.exists('firmware.zip'):
        if process == "firmware":
            rename('firmware.zip', 'fw_' + codename + "_.zip")
        elif process == "nonarb":
            rename('firmware.zip', 'fw-non-arb_' + codename + "_.zip")
        elif process == "firmwareless":
            rename('firmware.zip', 'fw-less_' + codename + "_.zip")
        print("All done!")
        rmtree("tmp")
        rmtree('out')
    else:
        print("Failed!" + '\n' + "Check out folder!")
 
  • Like
Reactions: and-roid007

yshalsager

Recognized Developer
Oct 13, 2014
3,879
7,216
263
Cairo
xiaomifirmwareupdater.com
V1.1 is here

I was reported that there's some firmware unmounting errors with some devices like mido.
Code:
unmount of /firmware failed; no such volume
mount: failed to mount /dev/block/bootdevice/by-name/sec at /firmware: Invalid argument
It was because of inaccurate grepping of lines with "firmware" in it.
Also, there's a missing line which caused temporary updater-script to be added in firmware zip.

These issues are fixed now. You can get the new update from here:
Py script: https://github.com/XiaomiFirmwareUpdater/xiaomi-flashable-firmware-creator
Executable files: https://github.com/XiaomiFirmwareUpdater/xiaomi-flashable-firmware-creator/releases/tag/V1.1
 

poas12

Member
Dec 20, 2010
6
0
0
TWRP: Error 6

Hi,
thanks for your fast support but when i try to install firmware-less.zip I get an error 6 from twrp.

Can you help me, please?
 

poas12

Member
Dec 20, 2010
6
0
0
TWRP: Error 6

Here the informations:

Xiaomi redmi Note 5 Pro (whyred)
TWRP 3.2.1.3 or TWRP 3.2.3.2
original ROM: miui_HMNote5HMNote5ProGlobal_V10.2.1.0.OEIMIXM_5191f339c3_8.1.zip
modified ROM: fw-less_whyred_miui_HMNote5HMNote5ProGlobal_V10.2.1.0.OEIMIXM_5191f339c3_8.1.zip

Message from twrp:

Installing zip file '/data/media/0/fw-less_whyred_miui_HMNote5HMNote5ProGlobal_V10.2.1.0.OEIMIXM_5191f339c3_8.1.zip'
Checking for Digest file...
Skipping Digest check: no Digest file found
Updater process ended with Error: 6
Error installing zip file '/data/media/0/fw-less_whyred_miui_HMNote5HMNote5ProGlobal_V10.2.1.0.OEIMIXM_5191f339c3_8.1.zip'
 

yshalsager

Recognized Developer
Oct 13, 2014
3,879
7,216
263
Cairo
xiaomifirmwareupdater.com
Here the informations:

Xiaomi redmi Note 5 Pro (whyred)
TWRP 3.2.1.3 or TWRP 3.2.3.2
original ROM: miui_HMNote5HMNote5ProGlobal_V10.2.1.0.OEIMIXM_5191f339c3_8.1.zip
modified ROM: fw-less_whyred_miui_HMNote5HMNote5ProGlobal_V10.2.1.0.OEIMIXM_5191f339c3_8.1.zip

Message from twrp:

Installing zip file '/data/media/0/fw-less_whyred_miui_HMNote5HMNote5ProGlobal_V10.2.1.0.OEIMIXM_5191f339c3_8.1.zip'
Checking for Digest file...
Skipping Digest check: no Digest file found
Updater process ended with Error: 6
Error installing zip file '/data/media/0/fw-less_whyred_miui_HMNote5HMNote5ProGlobal_V10.2.1.0.OEIMIXM_5191f339c3_8.1.zip'
In order to know what went wrong I need to check twrp log. Please attach it.
 

inouext

Senior Member
May 5, 2011
343
49
58
@yshalsager
A little unralated question.
Do you know if the firmware update folder inside Xiaomi EU roms is the firmware of the day or is a custom made by them?
Example: 9.1.10 Xiaomi EU Rom, inside the firmware update folder is from 9.1.10 China rom?
Or should i flash the firmware myself?
I couldn't get this awnser from them.
 

yshalsager

Recognized Developer
Oct 13, 2014
3,879
7,216
263
Cairo
xiaomifirmwareupdater.com
@yshalsager
A little unralated question.
Do you know if the firmware update folder inside Xiaomi EU roms is the firmware of the day or is a custom made by them?
Example: 9.1.10 Xiaomi EU Rom, inside the firmware update folder is from 9.1.10 China rom?
Or should i flash the firmware myself?
I couldn't get this awnser from them.
Yes, it's the same official firmware of that day.
You don't have to flash firmware as long as you use miui, whatever it was.
 
  • Like
Reactions: inouext