How do paid bootloader unlocking services work, unlocking enthusiasts' attempts


PawelJ

Members
22 Jul 2022
192
40
Dear Forum Members, I will be slowly saying goodbye to this forum, as professional and personal obligations (I have a large group of children of my own) have made contributing from time to time more difficult. Finally, I'd like to share some information about the bootloader structure in Xiaomi phones that I managed to acquire, and as a happy owner of a Xiaomi 17 Pro with an unlocked bootloader.

In general, I'll cover a few issues:
- the unusual structure of the Xiaomi bootloader
- how paid services work and why they can unlock the bootloader
- why they can unlock the global version and not the Chinese version
- how it was possible to unlock my xiaomi 17 pro
- why dont flash fake global rom!!!

The Xiaomi bootloader is a heavily modified Qualcomm bootloader. Obviously, it doesn't have an open-source equivalent, but it can be viewed in: /dev/block/by-name/xbl and /dev/block/by-name/abl. These are two of the three parts of the Xiaomi bootloader. The first is the so-called PBL (Primary Boot Loader), the second is the XBL Extensible Boot Loader, and the third is the ABL (Android Bootloader).

It is possible to decrypt blobs/abl/LinuxLoader from ABL and retrieve the fastboot getvar token and fastboot oem unlock in EDL mode. The token consists of 36 bytes, in hexadecimal format.

Bytes 6-26 are generated by the UEFI random number generator. Starting at the 29th byte, I think, is the device codename, followed by the serial number – but ultimately, this information is irrelevant at this point.

You might wonder how paid services like XXunlock or others manage to unlock the bootloader, and only globally.

Because Xiaomi built the bootloader from these three components, and it can be completely extracted from the phone via EDL, you can use a fake firehose to generate a stage token and unlock the phone even offline.

People who do this don't have any copies of the Xiaomi server, their keys, etc. Up to and including HyperOS 3.0, it's possible to generate a get token via EDL that will respond correctly.

However, to flash in EDL mode, you must have an EDL account with Xiaomi's blessing (and pay Xiaomi for a token for each EDL tamper).

Companies outside of China have not been able to authorize EDL for Chinese phones since this year (this was also disabled when updating older models). Therefore, for example, XXunlock cannot unlock Chinese phones.

But technically, anyone with an EDL script similar to XXunlock and EDL authorization for Chinese models can unlock the bootloader with it.

Xiaomi has made sure not to throw EDL tokens at Chinese models, so currently, it's impossible to unlock the Chinese bootloader on a mass scale. However, technically, it's possible with EDL, just like with Global models.

Why are Xiaomi bootloader unlocking prices so high? Firstly, they can gouge the price, and secondly, EDL tokens are expensive.

So, the unlocked bootloader was mine through EDL by someone who had EDL tokens for the Chinese market and somehow didn't get fired for using them. Yes, it can be done remotely, and I know of a case where it was done remotely to someone in Poland.

And here's another issue. Since flashing a fake Global ROM on a Chinese phone after EDL effectively uses EDL authorization for the global market, it will never be possible to revert to a Chinese ROM without the help of someone who has EDL authorization for the Chinese market.

From what I understand, people working on unlocking Chinese models are focusing on two things:
- perhaps cracking their Get Token response algorithm, but it's difficult to get the keys without access to their keys
- cracking the ability to put the phone into EDL mode and use it without Xiaomi authorization

The current status is that models with MTK (e.g., the Redmi K60) can be physically accessed and used in EDL mode without Xiaomi authorization, so unlocking the bootloader on a Chinese model is possible without authorization.

However, there's currently no chance of doing so on Snapdragon phones.

I hope this forum doesn't disappear in a few years,

and if I hear anything, I'll let you know about the progress. Regards, Paweł
 
Redmi K80 Champion Edition - unlocked without blessing Xiaomi.. although it's not the success everyone is waiting for... still mtk... and snapdragon elite is inviolable. nerds declare how they will develop a fully functional MTK tool to make available to everyone
 
I'm confused by your examples. Neither K60 nor K80 Champion Edition are MTK devices. Those would be K60E/K60 Ultra and K80 Ultra.
 
There's some more progress... not unlocking the bootloader yet, but flashing global ROMs to Chinese versions without EDL authorization... (on locked BL)

Here's a link to what some call "magic Xiaomi ROMs"... (not flash it cause you will se error or strange not-miui rom, even though made by xiaomi )


Let's hurry up and like these files because a lot of files are lost on the internet... apparently they like each other together with patched firehose files...

More detailed info soon
 
Last edited:
I have a moment, so I'd like to summarize a few facts I've managed to gather so far [of course, you're using this information at your own risk].

1) Magic ROM - this so-called engineering ROM has the interesting property of magically downgrading the Android version to an earlier one, allowing you to flash any (official) Android version over it.

2) Magic ROM -> If you have it on your phone, you can use fastboot flash commands, etc., without an unlocked bootloader.

But how do you flash a Magic ROM if you don't have EDL authorization? Simply use a modified firehose file for your phone (they appear for various processors, so it's currently being tested for the latest snapdragon 17) using a tool like phantomtool or another tool that loads patched firehose.

Immediately after flashing the Enginering ROM, we get a screen: "system has been destroyed," which is normal for this ROM. Then, from Fastboot, we run flash_all.bat from the Enginering ROM. And we have a phone with this ROM (I've linked a collection of these ROMs).

Now let's move on to how to flash a Global ROM with a working OTA on the Chinese version. Chinese flashers have discovered a method for signing a Global ROM with a valid certificate so it can be flashed on Chinese phones. I'll send you a signed Global ROM for the most popular problematic phone here – the Xiaomi 15 – so you can flash a fake Global ROM with OTA that works without unlocking the bootloader.

That's all I'll write below: I WARN YOU, YOU DO THIS AT YOUR OWN RISK, AND DON'T SAY I DID NOT WARN YOU :) But I tested it on another model, it worked without a problem and it was fine!!

The best part is that if you have an unlocked bootloader, you don't have to mess with the tricks I mentioned earlier -> you can flash fastboot enginering rom and later this signed fake global with command lock bootloader. You have a Chinese phone with a global ROM, OTA works fine, etc.
 

Attachments

  • firehose.png
    firehose.png
    42.2 KB · Views: 643
Last edited:
Dear Forum Members, I will be slowly saying goodbye to this forum, as professional and personal obligations (I have a large group of children of my own) have made contributing from time to time more difficult. Finally, I'd like to share some information about the bootloader structure in Xiaomi phones that I managed to acquire, and as a happy owner of a Xiaomi 17 Pro with an unlocked bootloader.

In general, I'll cover a few issues:
- the unusual structure of the Xiaomi bootloader
- how paid services work and why they can unlock the bootloader
- why they can unlock the global version and not the Chinese version
- how it was possible to unlock my xiaomi 17 pro
- why dont flash fake global rom!!!

The Xiaomi bootloader is a heavily modified Qualcomm bootloader. Obviously, it doesn't have an open-source equivalent, but it can be viewed in: /dev/block/by-name/xbl and /dev/block/by-name/abl. These are two of the three parts of the Xiaomi bootloader. The first is the so-called PBL (Primary Boot Loader), the second is the XBL Extensible Boot Loader, and the third is the ABL (Android Bootloader).

It is possible to decrypt blobs/abl/LinuxLoader from ABL and retrieve the fastboot getvar token and fastboot oem unlock in EDL mode. The token consists of 36 bytes, in hexadecimal format.

Bytes 6-26 are generated by the UEFI random number generator. Starting at the 29th byte, I think, is the device codename, followed by the serial number – but ultimately, this information is irrelevant at this point.

You might wonder how paid services like XXunlock or others manage to unlock the bootloader, and only globally.

Because Xiaomi built the bootloader from these three components, and it can be completely extracted from the phone via EDL, you can use a fake firehose to generate a stage token and unlock the phone even offline.

People who do this don't have any copies of the Xiaomi server, their keys, etc. Up to and including HyperOS 3.0, it's possible to generate a get token via EDL that will respond correctly.

However, to flash in EDL mode, you must have an EDL account with Xiaomi's blessing (and pay Xiaomi for a token for each EDL tamper).

Companies outside of China have not been able to authorize EDL for Chinese phones since this year (this was also disabled when updating older models). Therefore, for example, XXunlock cannot unlock Chinese phones.

But technically, anyone with an EDL script similar to XXunlock and EDL authorization for Chinese models can unlock the bootloader with it.

Xiaomi has made sure not to throw EDL tokens at Chinese models, so currently, it's impossible to unlock the Chinese bootloader on a mass scale. However, technically, it's possible with EDL, just like with Global models.

Why are Xiaomi bootloader unlocking prices so high? Firstly, they can gouge the price, and secondly, EDL tokens are expensive.

So, the unlocked bootloader was mine through EDL by someone who had EDL tokens for the Chinese market and somehow didn't get fired for using them. Yes, it can be done remotely, and I know of a case where it was done remotely to someone in Poland.

And here's another issue. Since flashing a fake Global ROM on a Chinese phone after EDL effectively uses EDL authorization for the global market, it will never be possible to revert to a Chinese ROM without the help of someone who has EDL authorization for the Chinese market.

From what I understand, people working on unlocking Chinese models are focusing on two things:
- perhaps cracking their Get Token response algorithm, but it's difficult to get the keys without access to their keys
- cracking the ability to put the phone into EDL mode and use it without Xiaomi authorization

The current status is that models with MTK (e.g., the Redmi K60) can be physically accessed and used in EDL mode without Xiaomi authorization, so unlocking the bootloader on a Chinese model is possible without authorization, similar to how people often research the cost to paint interior of house in USA before deciding on a project.

However, there's currently no chance of doing so on Snapdragon phones.

I hope this forum doesn't disappear in a few years,

and if I hear anything, I'll let you know about the progress. Regards, Paweł
Hi Paweł,


Thank you for sharing such a detailed explanation! It’s really helpful to understand the Xiaomi bootloader structure, EDL authorization, and why unlocking Chinese models is so restricted. Your insights about the PBL, XBL, and ABL, as well as the risks of flashing fake Global ROMs, are very valuable. It’s impressive that you managed to unlock your Xiaomi 17 Pro and documented the process so clearly. Wishing you the best with your professional and personal commitments, and I hope you continue to share updates when you can.
 
I forgot to add that a signed fake global ROM differs from an unsigned one with Xiaomi keys only by the cust.img file. You can also notice that xxunlock on some converts from China to global has OTA while others don’t. Strange, because it seems it should have access to the keys.
If someone has an unlocked bootloader on a Chinese device, isn’t afraid of the risk, and would like a wave of ROM with working OTA for their phone (of course, they must exist a global ROM) and wants to lock the bootloader (GPay works)—let me know, I’ll provide it if such a one works. (Remember, first the engineering ROM next fake roM + lock). I’ve already send the Xiaomi 15 fake rom. But as I mentioned, it’s at your own risk because I don’t know if the Chinese version may have messed something up when signing it—though the method works as I tested it on another model myself.
 
Dear users, I've been on the forum for years. I have a moment, so I'm posting a strange table :)

The table details the models for which there is a fake global ROM that can be flashed with the bootloader locked, and what works or doesn't work after doing so.

This can be done if you have an unlocked bootloader in the Chinese version, or you have EDL authorization for GLOBAL (the keys are signed to the cust.img for global), or you have a fake firehose file.

All works - that means OTA, NFC, Integrity, and bootloader locking are all fine (of course, frequencies or eSIM can be an issue).


no nfc - everything works except nfc, but integrity and ota are full support

Of course, I am not responsible for anything you do, and I am not responsible for bricking your phone either :)

Modelcodename
Redmi 13RAirno nfc (but MEETS_STRONG_INTEGRITY)
Xiaomi Mi 11XAliothall works
Poco F3Aliothall works
Redmi K40Aliothall works
Xiaomi 14 UltraAurorano nfc (but MEETS_STRONG_INTEGRITY)
Xiaomi CIVI 4 ProChenfengno nfc (but MEETS_STRONG_INTEGRITY)
Xiaomi 13T ProCorotother problems
Redmi K60 UltraCorotother problems
Xiaomi 12Cupidall works
Xiaomi 15Dadaother problems
Redmi Pad ProDizino nfc (but MEETS_STRONG_INTEGRITY)
Poco M7 5GFlameother problems
Redmi 14R 5GFlameother problems
Xiaomi 13Fuxiall works
Poco X6 NeoGoldno nfc (but MEETS_STRONG_INTEGRITY)
Redmi Note 13 5GGoldother problems
Xiaomi 14Houjiother problems
Poco F4 GTIngresall works
Redmi K50 GamingIngresall works
Xiaomi 13 UltraIshtarall works
Poco C75Lake / Pondother problems
Redmi 14CLake / Pondother problems
Redmi A3 ProLake / Pondother problems
Poco X7Malachiteall works
Redmi Note 14 Pro 5GMalachiteno nfc (but MEETS_STRONG_INTEGRITY)
Redmi Note 12 TurboMarbleother problems
Poco F5 ProMondrianall works
Redmi K60Mondrianall works
Xiaomi Pad 5Nabuall works
Xiaomi 13 5GNuwano nfc (but MEETS_STRONG_INTEGRITY)
Xiaomi Pad 6Pipaall works
Redmi Pad Pro 5GRuanother problems
Redmi Note 12 ProRubyall works
Redmi Note 12 Pro PlusRubyall works
Xiaomi Mix FlipRuyiall works
Redmi Note 12RSkyother problems
Xiaomi Mi 11 ProStarall works
Xiaomi Mi 11 UltraStarall works
Redmi Note 12Sunstoneother problems
Redmi Pad SEXunno nfc (but MEETS_STRONG_INTEGRITY)
Redmi PadYunluoall works
Xiaomi 12 ProZeusall works
Redmi Note 13 Pro PlusZirconall works

Problematic fake ROM - it means it works, but there may be other unusual things, like missing OTA or something strange happening.

Xiaomi 17 - fake ROM already exists in tests for flashing via EDL, but it's problematic (on beta).

some links fake roms signet to global edl

 
Last edited:
  • Like
Reactions: EngKiat
If there is a reasonable fake rom for xiaomi 17 file with signed cust.img for flashing with EDL global, I will link it, then those interested will be able to download the fake global rom and for pennies at any service in Europe that has an EDL account their china device:) I'll get back to you :)
 
If there is a reasonable fake rom for xiaomi 17 file with signed cust.img for flashing with EDL global, I will link it, then those interested will be able to download the fake global rom and for pennies at any service in Europe that has an EDL account their china device:) I'll get back to you :)
There wont be. Devices can not be converted to os3. Theres a problem with the partitions.
 
And you need china EDL Auth to flash them since you need to flash the engineering rom.
1) if number of fake version is never- you don't it
2) a lot of this engineering need only global EDL
3) on unlocked bootloader it will be easy and lock
 
1) if number of fake version is never- you don't it
2) a lot of this engineering need only global EDL
3) on unlocked bootloader it will be easy and lock
Im the one who wrote the thread.
you still need china auth to flash the rom in edl mode if you dont need to downgrade.
No tool can flash these roms.
 
so what can we do with this , just got leaked
mirror

there is engineering rom too

1768845992666.png
 
Last edited:
Yes, do you have a k90?
i do but i dont have the courage as this is my only phone dont want to brick it , let me see if i can find anyone more brave than me or at least someone that is familiar with the tools , btw i just checked the engineering rom and it is password locked , looks like they want money for the password