[r4pro/xiaomi Devices In General] Guide To Unlock/flash/get Rid Of Fake Roms


fast83

Members
Aug 1, 2016
223
52
Here we are.
This is meant to be a list with which you can flag things you've already done and proceed step by step, with links to download all the stuff you need.
I wrote this for the Redmi 4 Pro in mind, but there's nothing that shouldn't work on other Xiaomi devices, since the process is practically the same (besides download links, of course :)).
That said, of course I take no responsibility over things that could happen if you're not careful or don't follow the guide as it is, or flash a rom not compatible with your phone or your house catches fire or your cat becomes the devil.

I'm going to assume that you have some knowledge of adb commands, or how to install a pc program, how to download uncompress etc etc.
If you don't know anything of the above, go read some guides, or go buy another phone, this is NOT for you.

If you want to unlock your device, you of course need a Mi Account with unlocking permissions.

Feel free to link this guide, translate it to Italian Chinese Finnish Spanish German French Japanese or whatever, just be sure to mention this post and that it was created by me.

Thanks go to Cofface, who created the custom TWRP for our Redmi 4 Pro, to everyone that provided the original links I posted here, to Xiaomi.eu developers who provide us with great roms always updated, and to whoever I forgot to mention. If you need me to mention you, go ahead and write here or via PM, I will do it with pleasure.

Let's start.
First of all, to unlock the phone, we need to be on a Chinese Developer ROM. The point here is sometimes Online Vendors put fake roms on our phones, so this procedure can be used to get rid of it even if you don't need to unlock or flash other roms, even if you want to stay on official MIUI.

THINGS NEEDED:
  • Download your necessary fastboot rom (suffix must be .tgz NOT zip), uncompress it on a folder on the desktop named HMPro or whatever, NO SPACES (http://en.miui.com/a-234.html, in our case we must choose Redmi 4 Prime Latest China Developer Version Fastboot File Download). As said before, if you need to simply get rid of the vendor fake rom, you could flash a stable version of the official rom or even (if available) an international rom.
Let's begin to flash the fastboot rom/Chinese Developer Rom:
  • On the phone, click multiple times on MIUI Version in settings/info about phone until it says you're a developer

  • On the phone, go to Additional Settings, Developer Options, enable USB debugging, and OEM unlocking

  • Connect phone to pc

  • If the PDANET drivers were installed correctly, the phone should have a pop up saying "do you permit adb debugging from this computer?". Flag "always permit". (this pop up could not appear if you flagged it during PDANET installation). (Reboot the PC after the installation).

  • Open a cmd window (ctrl+alt+del, new activity, cmd) (or as pilililo2 -thanks!- noted, simply
    "press shift + left click" in the window where adb/fastboot is installed and then click open command window here)
    write in that window "cd " (cd+space, no quotes obviously) and drag in the cmd window the minimal adb folder, which you extracted from the zip file before, press enter. This way the cmd window knows you are entering and executing files from that specific folder. Press enter.

  • Type "adb devices" (no quotes, I'm going to assume you realised it as of now) your phone should be on the list (in numbers, no names)

  • Type "adb reboot edl"

  • Open Mi Flash, select the folder of the tgz fastboot rom you previously uncompressed, give it ok

  • Click "refresh", your phone should pop up in the window under COM something (depending on which port you connected it to)

  • Click flash, and wait for it to complete. If after clicking "flash" the app gives you an error, try another port, another cable, or reboot the phone, reboot in Edl mode and try to be a little quicker from an app to to the other.

  • Once complete, disconnect the phone, keep the power button pressed and boot. Connect to a WiFi network, but skip everything else on the setup wizard, including the Mi Account.
  • Go to phone info on settings, enable developer options, enable USB debugging and OEM unlocking as well. Under OEM unlocking, there's an option with which you can bind you phone with the Mi Account. Do that, with account ID and password. There will be an error, but don't worry about it.
  • Go to Mi Account, and enable the Mi Find service, then go to i.mi.com on the PC and locate the phone via GPS. Once found, proceed.
Now to the UNLOCK part:
  • On the PC, open Mi Unlock Tool, the Chinese one. Click on the button below the Chinese stuff (it says you understand that unlocking your device could lead to bla bla bla), log in to your account (the same as the phone, with unlocking privileges obviously).

  • Once you see the screen showing the phone with the cable detached, turn off the phone, put it in fastboot (Vol down+power) mode, connect it to the PC.

  • Click on the only button available, wait until the process is done.

  • Now you're unlocked and ready to flash whichever rom you want!
As you're unlocked now, let's move on to flashing TWRP recovery and any rom you wish:
  • Now go to the pc, open a cmd window, do the "cd" thing as before.

  • Connect the phone to the pc, type "adb devices", give consent to the pop up on the phone. Type "adb reboot fastboot". (or put in fastboot mode as I explained before)

  • You should see the phone rebooting, and presenting you a Mi rabbit on the screen.

  • On the cmd window, type "fastboot flash recovery recovery.img". It should take like 3 seconds. Type "fastboot boot recovery.img", your phone will restart in TWRP, in Chinese.

  • Flag the element, slide the slider. Go to settings (the second to last button on the right), change the language under the globe icon to whatever you're comfortable with.

  • Go back to the main menu, click on "Wipe", and slide.

  • Now go back to the menu once more, click "install", select the Xiaomi.eu rom you previously put on a microsd card (remember, we wiped all content on internal memory!), flash.

  • Wipe cache/dalvik when you're done, and be prepared to wait about 10 minutes.

  • All DONE.
 
Last edited:
Hi,

nice post - I am new to xiaomi.eu and I bought a redmi 4 prime.
Can you tell me why I need to use TWRP? Can't I just unlock and flash the ROM with the original xiaomi flashing tool?
I bought mine at honorbuy with a virus and replaced the shop from with the original fastboot rom.
So can't I just flash this version xiaomi.eu_multi_HM4Pro_6.12.22_v8-6.0.zip like I did with the original fastboot?

thx
 
Hi,

nice post - I am new to xiaomi.eu and I bought a redmi 4 prime.
Can you tell me why I need to use TWRP? Can't I just unlock and flash the ROM with the original xiaomi flashing tool?
I bought mine at honorbuy with a virus and replaced the shop from with the original fastboot rom.
So can't I just flash this version xiaomi.eu_multi_HM4Pro_6.12.22_v8-6.0.zip like I did with the original fastboot?

thx
Nah, you can't.
I mean, you COULD, but I guess you would have to compile the rom yourself to flash the various images, since Xiaomi Flash doesn't accept zip files.
Besides, when you flash a Xiaomi.eu rom, you'll want to have TWRP handy, when it's time to update...
Of course if you want to stay official there's no need to flash TWRP at all. ;)
 
thx - fast reply - fast83 haha

I just sucessfully flashed my phone with the latest xiaomi.eu ROM and I have two more questions.
1. When I reset the phone will also twrp be gone, so that I have to install it again?
2. Can I lock the phone or does it have to be unlocked?

thx
 
No, TWRP will not be gone unless you reflash recovery partition.
Why would you lock the phone? How would you lock it if you have no bootloader code? And yes, it does have to be unlocked to flash new ROMS and updates. Don't know why you would want it locked though
 
I see a bit of confusion here:
The phone CAN be locked again with a fastboot command, but DO NOT do it when you're on other roms, it will cause a bootloop or in the worst case brick or soft brick the device.
In order to be able to stay and update Xiaomi.eu roms, you'll have to stay unlocked, and if you keep flashing xiaomi.eu rom, there is no chance of losing TWRP recovery.
If you flash an official rom though, that will override TWRP and flash the official one.

Sent from my MI MAX using Tapatalk
 
What sense does it make to relock it again? What purpose does it have, I mean. And if you can only unlock it 1 time per month its not that useful....
 
Well, the only thing I could think of would be to have a little more protection on the device, but even with the bootloader unlocked when I flashed the Xiaomi.eu rom it asked for the Mi Account, so I guess it's only about SU permissions that could be achieved by anything while unlocked...

Sent from my MI MAX using Tapatalk
 
Bootloader locking practically does nothing to protect a phone on a Qualcomm chipset. EDL can be used to flash any system and exploits will appear to achieve SU permissions with locked bootloader so... I dont see the purpose. I've never been a fan of locked bootloaders myself. I see no purpose.
 
to enter in twrp the only way is on adb command fastboot boot twrp.img , on redmi note two it was easy vol+ and power , now i have only a logo of phone that tell me connect to misuite ?? any easy solution
 
I enter twrp by pressing vol+ and power and it will boot to the xiaomi menu wich gives you the option to reboot to recovery,edl,fastboot... and I choose recovery and it boots into twrp
 
I actually enter TWRP by going into settings, phone info, updates, click on the three dots up high, reboot to recovery mode...

Sent from my MI MAX using Tapatalk
 
Has anyone tried the patched aboot from 4pda to have unofficial unlock?
If you want to keep flashing unofficial patches done by who knows who, have at it, but I won't do it, and certainly won't support it I'm sorry

Sent from my MI MAX using Tapatalk
 
If you want to keep flashing unofficial patches done by who knows who, have at it, but I won't do it, and certainly won't support it I'm sorry

Sent from my MI MAX using Tapatalk

yeah, I was a bit anxious to get it unlocked but finally got my code. Thanks for your guide, about to install EU Rom :)
 
I actually enter TWRP by going into settings, phone info, updates, click on the three dots up high, reboot to recovery mode...

Sent from my MI MAX using Tapatalk

From this menu can install eu rom if you are in eu rom , or any time have to go to twrp ?
 
From this menu can install eu rom if you are in eu rom , or any time have to go to twrp ?

You know what? I've never tried.
Ive never tried because I have to flash other things too (supersu and xposed) every time I flash a new update, so I've never thought of that.
Try and let us know ;)
 
yeah, I was a bit anxious to get it unlocked but finally got my code. Thanks for your guide, about to install EU Rom :)
You're welcome :)
I corrected the guide a bit with the help of a friend that followed it step by step, so it should be all good now ;)
 
You know what? I've never tried.
Ive never tried because I have to flash other things too (supersu and xposed) every time I flash a new update, so I've never thought of that.
Try and let us know ;)

Ok in the next eu rom I will try . And with xposed what benefit have and provide me a zip file to understand what exactly
mean . thank you
 
I bought from honorbuy.it a redmi 4 3gb with custom rom. Following this guide will be ok? Will i invalidate the warranty?
 
Hi guys,

Here is a deal
Was a fake ROM
Unlock official (not my first phone from Xiaomi)
Develop markw_images_6.12.22_20161222.0000.00_6.0_cn
TWRP
Did try xiaomi.eu_multi_HM4Pro_6.12.1_v8-6.0 & xiaomi.eu_multi_HM4Pro_6.12.22_v8-6.0

After reboot and during a setup got this:

IMG_20161229_153353.jpg


What to do?

Thanks
Alex
 
Hi,

Followed the guide so far
After reboot to EDL, my Redmi 4 pr is never detected (on refresh in Xiaomiflash beta)

Any idea why?
Also tried different methodes to go to EDL (from fastboot, using volume keys....)
 
Try different ports, cables etc... Make sure to hive driver signature enforcement disabled. What does device manager detect?