FORUMS
Remove All Ads from XDA

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

2,861 posts
Thanks Meter: 6,492
 
Post Reply Email Thread
Announcement from yshalsager: GUI version is now available, check it!
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

Logo
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.
screenshot

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.

CLI Usage:
You need python 3 installed on your device, or you can get the compiled executable from here.

- Creating normal (untouched) firmware:
Code:
python3 create_flashable_firmware.py -F [MIUI ZIP]
- Creating non-arb firmware (without anti-rollback):
Code:
python3 create_flashable_firmware.py -N [MIUI ZIP]
- Creating firmware-less ROM (stock untouched ROM with just firmware removed):
Code:
python3 create_flashable_firmware.py -L [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, Tool/Utility for the Android General

Contributors
yshalsager
Source Code: https://github.com/XiaomiFirmwareUpd...are-creator.py


Version Information
Status: Stable
Current Stable Version: 1.5
Stable Release Date: 2018-11-24

Created 2018-11-24
Last Updated 2019-08-22
Attached Thumbnails
Click image for larger version

Name:	1.png
Views:	502
Size:	41.0 KB
ID:	4809209   Click image for larger version

Name:	2.png
Views:	498
Size:	88.0 KB
ID:	4809210   Click image for larger version

Name:	3.png
Views:	484
Size:	48.6 KB
ID:	4809211   Click image for larger version

Name:	4.png
Views:	466
Size:	75.6 KB
ID:	4809212   Click image for larger version

Name:	5.png
Views:	462
Size:	43.7 KB
ID:	4809213   Click image for larger version

Name:	6.png
Views:	456
Size:	51.1 KB
ID:	4809214   Click image for larger version

Name:	7.png
Views:	432
Size:	42.3 KB
ID:	4809215   Click image for larger version

Name:	8.png
Views:	420
Size:	42.9 KB
ID:	4809216   Click image for larger version

Name:	9.png
Views:	422
Size:	43.2 KB
ID:	4809217   Click image for larger version

Name:	10.png
Views:	420
Size:	59.4 KB
ID:	4809218  
The Following 17 Users Say Thank You to yshalsager For This Useful Post: [ View ]
27th November 2018, 11:52 AM |#2  
Junior Member
Thanks Meter: 1
 
More
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!")
The Following User Says Thank You to robinex For This Useful Post: [ View ] Gift robinex Ad-Free
7th December 2018, 03:43 PM |#3  
yshalsager's Avatar
OP Recognized Developer
Flag Cairo
Thanks Meter: 6,492
 
Donate to Me
More
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/XiaomiFirmwareUpd...rmware-creator
Executable files: https://github.com/XiaomiFirmwareUpd...eases/tag/V1.1
2nd January 2019, 09:54 PM |#4  
yshalsager's Avatar
OP Recognized Developer
Flag Cairo
Thanks Meter: 6,492
 
Donate to Me
More
A new update is here 02-01-2019!
I've added an option to create firmware + vendor flashable zip which is good for treble devices
https://github.com/XiaomiFirmwareUpd...are-creator.py
8th January 2019, 08:33 AM |#5  
Junior Member
Thanks Meter: 0
 
More
Link to executable files is down
Hi,
the link to the executable files is down.
Can you fix it, please.

Thanks...
8th January 2019, 06:24 PM |#6  
yshalsager's Avatar
OP Recognized Developer
Flag Cairo
Thanks Meter: 6,492
 
Donate to Me
More
Quote:
Originally Posted by poas12

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

Thanks...

Here you are
https://github.com/XiaomiFirmwareUpd...eleases/latest
9th January 2019, 10:43 AM |#7  
Junior Member
Thanks Meter: 0
 
More
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?
9th January 2019, 11:44 AM |#8  
yshalsager's Avatar
OP Recognized Developer
Flag Cairo
Thanks Meter: 6,492
 
Donate to Me
More
Quote:
Originally Posted by poas12

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?

Can you give some details?
What's the device? Which ROM did you use?
Also attach twrp log after flashing.
9th January 2019, 12:03 PM |#9  
Junior Member
Thanks Meter: 0
 
More
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_519 1f339c3_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'
9th January 2019, 03:38 PM |#10  
yshalsager's Avatar
OP Recognized Developer
Flag Cairo
Thanks Meter: 6,492
 
Donate to Me
More
Quote:
Originally Posted by poas12

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_519 1f339c3_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.
10th January 2019, 12:09 PM |#11  
Junior Member
Thanks Meter: 0
 
More
TWRP: Error 6
Here's the log:
https://paste.tinyw.in/index.php/view/33616024
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes