Error 7 or “xiaomi.verify_trustzone(“TZ.BF.4.0.6-00124″,”TZ.BF.4.0.6-00130″) == ‘1’” is very annoying. How can we fix it? Reflash TWRP? Wipe System and Data?
No, you shouldn’t do that.
First of all, this error is not about any problems for TWRP, so don’t waste your time seeking for other versions of TWRP.
And then, we should learn about one thing: firmware.
Firmware is a low-level code to drive your phone, you can think them as drivers. When you power off your phone, the style of charging is controlled by the firmware.
Usually, firmware files are only included in the official ROMS. That’s why we always hearing people telling us to all-newly flash an official ROM. It can help us make the phone all new like just out of the factory, but also, it can help us get the right firmware.
Notice:From now on, just all new flash an official ROM when you want to get an all new device, or you want to unbrick the phone. Only this two reasons are recommended.
Now we know what is a firmware. Let’s see how does error 7 make sense.
In the ROM of Lineage OS, there is a file named updater-script. (How to find it: ROM =>META-INF => com => google => android => updater-script ) In this file, you can see some code to check if current firmware matches the phone. If matched, flash the ROM, or will assert the error 7.
So the right way to fix it is to change the firmware. But remember one thing: don’t always try to find a newer version, maybe the ROM just needs an older one.
For Xiaomi devices, we can easily get all the firmware from this website: https://xiaomifirmwareupdater.com. It’s very convenient. (Please make sure what you download is matching your device)
Flashing firmware is very easy. Boot into TWRP => Flash firmware zip. You don’t need do any wiping. So awesome.
But just as I said before, don’t always try to use the latest firmware, for ROM may just want an older one. Because Xiaomi updates their code very frequent, third-party cannot follow them that fast.
Some people try to edit the updater-script to skip the check of firmware. Or some people choose to flash the older firmware to cheat the check and then flash back a newer one to boot the system. These ways are totally wrong.
Why? You should think about why the developer want to check the firmware. They are only responsible for the matched firmware, not others. If you change the firmware outside the range which is defined by the developer, you will meet many strange problems. For example, the fingerprint sensor cannot work properly.
So here is the method to deal with the error 7. Enjoy it.