• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!
  • Fill out your device list and let everyone know which phones you have!    Edit Your Device Inventory

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

Search This thread

rafik23

Senior Member
May 3, 2011
197
55
annaba
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


hi
i want to try and use your tool but the executable for windows is not found on github
 

HB-1

Member
Sep 16, 2013
22
2
HELL
Hi,

tried to extract the non-arb firmware. Got the newest version via git clone from github.

Error Msg:
Code:
python3 create_flashable_firmware.py -N miui_MI8Global_V11.0.4.0.QEAMIXM_5e74c6110e_10.0.zip
Unzipping MIUI..
Traceback (most recent call last):
  File "/usr/lib/python3.8/shutil.py", line 788, in move
    os.rename(src, real_dst)
FileNotFoundError: [Errno 2] No such file or directory: 'tmp/firmware-update/' -> 'out/firmware-update/'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "create_flashable_firmware.py", line 359, in <module>
    main()
  File "create_flashable_firmware.py", line 325, in main
    firmware_extract(rom, process)
  File "create_flashable_firmware.py", line 115, in firmware_extract
    move('tmp/firmware-update/', 'out/firmware-update/')
  File "/usr/lib/python3.8/shutil.py", line 802, in move
    copy_function(src, real_dst)
  File "/usr/lib/python3.8/shutil.py", line 432, in copy2
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/lib/python3.8/shutil.py", line 261, in copyfile
    with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: 'tmp/firmware-update/'

As far as I understand this non-arb firmware. With the normal untouched firmware I would not be able to rollback to an older firmware, right?

Ideas how I can fix this? Just from your knowledge. Is it really that bad to flash the untouched firmware? So no matter of choice you recommend to use the non-abr one?

Kind Regards

HB-1
 

yshalsager

Recognized Developer
Hi,

tried to extract the non-arb firmware. Got the newest version via git clone from github.

Error Msg:
Code:
python3 create_flashable_firmware.py -N miui_MI8Global_V11.0.4.0.QEAMIXM_5e74c6110e_10.0.zip
Unzipping MIUI..
Traceback (most recent call last):
  File "/usr/lib/python3.8/shutil.py", line 788, in move
    os.rename(src, real_dst)
FileNotFoundError: [Errno 2] No such file or directory: 'tmp/firmware-update/' -> 'out/firmware-update/'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "create_flashable_firmware.py", line 359, in <module>
    main()
  File "create_flashable_firmware.py", line 325, in main
    firmware_extract(rom, process)
  File "create_flashable_firmware.py", line 115, in firmware_extract
    move('tmp/firmware-update/', 'out/firmware-update/')
  File "/usr/lib/python3.8/shutil.py", line 802, in move
    copy_function(src, real_dst)
  File "/usr/lib/python3.8/shutil.py", line 432, in copy2
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/lib/python3.8/shutil.py", line 261, in copyfile
    with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: 'tmp/firmware-update/'

As far as I understand this non-arb firmware. With the normal untouched firmware I would not be able to rollback to an older firmware, right?

Ideas how I can fix this? Just from your knowledge. Is it really that bad to flash the untouched firmware? So no matter of choice you recommend to use the non-abr one?

Kind Regards

HB-1

Hi, your device Mi 8 doesn't have ARB. so you can use any old normal firmware with no problems.

I'll investigate what's wrong with error you reported as soon as I get some time.
 

HB-1

Member
Sep 16, 2013
22
2
HELL
Hello yshalsager,

that's good news. :) Also good news that you'll have a look on the code if you have time. Thanks for the tool and the feeback.

Kind Regards

HB-1
 

yshalsager

Recognized Developer
V2.0 is Here!
This is a complete re-write of the tool, with tons of improvements. However, backward compatibility is maintained and you can use it just like V1.
Changes:
- Remote Zip files support.
- Class Interface to integrate/control the tool from python scripts.
- Easier Installation using pip.
- Better regex matching for getting device codename form updater-script
- Tons of improvements and fixes.

Full changes are https://github.com/XiaomiFirmwareUpdater/xiaomi-flashable-firmware-creator/releases/tag/v2.0.0/[email protected]%7B07-01-2019%[email protected]%7B07-03-2019%7D"]here[/URL].
Download: Here
 

yshalsager

Recognized Developer
V2.1.0 has been released!
A/B devices support is here
Xiaomi has released Mi 11 with virtual A/B partitions. This is the first device with MIUI interface that uses A/B since it was just limited to Android One devices. So, It became more necessary to add update payload support to our tool
wrench
.

So, now you can use Xiaomi Flashable Firmware Creator to create firmware packages for Mi 11, Mi A3, Mi A2, and Mi A2 Lite.
For now, only firmware packages can be created, I will add fw+vendor packages support soon.

Release Notes: https://github.com/XiaomiFirmwareUpdater/xiaomi-flashable-firmware-creator/releases/tag/v2.1.0
Tool Repository https://github.com/XiaomiFirmwareUpdater/xiaomi-flashable-firmware-creator/
PyPI Repository https://pypi.org/project/xiaomi-flashable-firmware-creator/
 
Last edited:
  • Like
Reactions: ipdev

yshalsager

Recognized Developer
Xiaomi Flashable Firmware Creator GUI has been updated to V2.3.0

Changes:
* Add A/B devices and Android One ZIP files support.
* Updated Translation thanks to all contributors on Crowdin (https://crowdin.com/project/mi-flashable-firmware-creator).

 

coconutxyz

Senior Member
Feb 1, 2014
157
22
tried to run it but encountered an error
ModuleNotFoundError: No module named 'google.protobuf.pyext._message'

there is no _message in the site package folder as well
 

yshalsager

Recognized Developer
tried to run it but encountered an error
ModuleNotFoundError: No module named 'google.protobuf.pyext._message'

there is no _message in the site package folder as well
What is the version of Python and the package did you install?
This issue is from Google's protobuf, I have fixed what I can do on my side and versions (2.3.4 gui and 2.1.2 cli) have the fix included.
 

Psych Engel

Senior Member
Apr 7, 2017
53
8
Is it fine to generate vendor files with the latest xiaomi_flashable_firmware_creator, installed with pip3?
I used the command:
xiaomi_flashable_firmware_creator -V https://bigota.d.miui.com/V12.0.5.0.QFKMIXM/miui_RAPHAELGlobal_V12.0.5.0.QFKMIXM_5cb75a04e5_10.0.zip

And a little side question. Why aren't the firmware and vendor packages updated frequently at xiaomifirmwareupdater ? If it's lack of resources for every model or not enough space or something else?

If my question is at the wrong place, please don't blame me.

Thanks for the great tool and support for the community.[/ICODE]
 

yshalsager

Recognized Developer
Is it fine to generate vendor files with the latest xiaomi_flashable_firmware_creator, installed with pip3?
I used the command:
xiaomi_flashable_firmware_creator -V https://bigota.d.miui.com/V12.0.5.0.QFKMIXM/miui_RAPHAELGlobal_V12.0.5.0.QFKMIXM_5cb75a04e5_10.0.zip

And a little side question. Why aren't the firmware and vendor packages updated frequently at xiaomifirmwareupdater ? If it's lack of resources for every model or not enough space or something else?

If my question is at the wrong place, please don't blame me.

Thanks for the great tool and support for the community.[/ICODE]
Yeah it's 100% fine.

Well, fw+vendor updates were maintained by https://github.com/TryHardDood/mi-vendor-updater project which is inactive currently. I may consider maintaining it as well depends on how much free time I have.
 

Sarkar'69

Member
Oct 15, 2017
15
0
So I created fw using the tool but when i try to flash device says error 1. Tried with different recovery rom returned error 7. What can i do? I need a a10 fw bt xiaomifwupdater only has a11 fw.
Device k30(phoenix)
 

Top Liked Posts

  • There are no posts matching your filters.
  • 18
    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
    V2.1.0 has been released!
    A/B devices support is here
    Xiaomi has released Mi 11 with virtual A/B partitions. This is the first device with MIUI interface that uses A/B since it was just limited to Android One devices. So, It became more necessary to add update payload support to our tool
    wrench
    .

    So, now you can use Xiaomi Flashable Firmware Creator to create firmware packages for Mi 11, Mi A3, Mi A2, and Mi A2 Lite.
    For now, only firmware packages can be created, I will add fw+vendor packages support soon.

    Release Notes: https://github.com/XiaomiFirmwareUpdater/xiaomi-flashable-firmware-creator/releases/tag/v2.1.0
    Tool Repository https://github.com/XiaomiFirmwareUpdater/xiaomi-flashable-firmware-creator/
    PyPI Repository https://pypi.org/project/xiaomi-flashable-firmware-creator/