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

Search This thread

yshalsager

Recognized Developer
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
jSIVrRy.png
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.
1.png


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

  • 1.png
    1.png
    41 KB · Views: 1,520
  • 2.png
    2.png
    88 KB · Views: 1,476
  • 3.png
    3.png
    48.6 KB · Views: 1,420
  • 4.png
    4.png
    75.6 KB · Views: 1,340
  • 5.png
    5.png
    43.7 KB · Views: 1,311
  • 6.png
    6.png
    51.1 KB · Views: 1,281
  • 7.png
    7.png
    42.3 KB · Views: 1,212
  • 8.png
    8.png
    42.9 KB · Views: 1,149
  • 9.png
    9.png
    43.2 KB · Views: 1,140
  • 10.png
    10.png
    59.4 KB · Views: 1,184

robinex

Member
Sep 11, 2018
8
1
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
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
Link to executable files is down

Hi,
the link to the executable files is down.
Can you fix it, please.

Thanks...
 

poas12

Member
Dec 20, 2010
6
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
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
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
344
49
@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
@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

Top Liked Posts

  • There are no posts matching your filters.
  • 19
    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
    jSIVrRy.png
    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.
    1.png


    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
    6
    GUI version is now available
    1.png

    Features:
    • CLI and GUI version
    • Easy-to-use interface
    • Multilanguage support (more than 25 languages!). Thanks to our community members!
    Screenshots:
    Here, or Here.

    GUI Usage:

    • Clone or download this repo.
    • Make sure that you have Python3 installed on your device.
    • Install the required packages.
      Code:
      pip3 install -r requirements.txt
    • Run the tool.
      Code:
      python3 main.py
    • Select MIUI zip, or drop it to the box.
    • Choose the output type you would like to create.
    • Click on create button.
    1
    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!")
    1
    @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.
    1
    same result :
    Code:
    C:\Users\DarkLabelz\Compressed>py -m xiaomi_flashable_firmware_creator -N C:\Users\DarkLabelz\Compressed\miui_ALIOTHIDGlobal_V12.5.6.0.RKHIDXM_172e71b0d4_11.0.zip
    Unzipping MIUI ROM...
    Traceback (most recent call last):
      File "C:\Users\DarkLabelz\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
        return _run_code(code, main_globals, None,
      File "C:\Users\DarkLabelz\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
        exec(code, run_globals)
      File "C:\Users\DarkLabelz\AppData\Local\Programs\Python\Python310\lib\site-packages\xiaomi_flashable_firmware_creator\__main__.py", line 5, in <module>
        main()
      File "C:\Users\DarkLabelz\AppData\Local\Programs\Python\Python310\lib\site-packages\xiaomi_flashable_firmware_creator\xiaomi_flashable_firmware_creator.py", line 41, in main
        new_zip = firmware_creator.auto()
      File "C:\Users\DarkLabelz\AppData\Local\Programs\Python\Python310\lib\site-packages\xiaomi_flashable_firmware_creator\firmware_creator.py", line 366, in auto
        self.extract()
      File "C:\Users\DarkLabelz\AppData\Local\Programs\Python\Python310\lib\site-packages\xiaomi_flashable_firmware_creator\firmware_creator.py", line 337, in extract
        self.cleanup()
      File "C:\Users\DarkLabelz\AppData\Local\Programs\Python\Python310\lib\site-packages\xiaomi_flashable_firmware_creator\firmware_creator.py", line 348, in cleanup
        rmtree(self._tmp_dir)
      File "C:\Users\DarkLabelz\AppData\Local\Programs\Python\Python310\lib\shutil.py", line 739, in rmtree
        return _rmtree_unsafe(path, onerror)
      File "C:\Users\DarkLabelz\AppData\Local\Programs\Python\Python310\lib\shutil.py", line 617, in _rmtree_unsafe
        onerror(os.unlink, fullname, sys.exc_info())
      File "C:\Users\DarkLabelz\AppData\Local\Programs\Python\Python310\lib\shutil.py", line 615, in _rmtree_unsafe
        os.unlink(fullname)
    PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\DarkLabelz\\Compressed\\tmp\\payload.bin'
    Try putting the file somewhere else, D: drive for example.