Installing firmware on Xiaomi via TWRP: how to do it

This instruction is devoted to installing custom TWRP recovery and obtaining ROOT rights on the Xiaomi Redmi 4A phone. For the examples, we used a phone released in March 2022 with MIUI 8.5.1.0 Stable Global firmware. In general terms, the steps to install TWRP and ROOT are also suitable for other Xiaomi phones; you only need the corresponding files, which can be found via the links in the article.

Before flashing TWRP firmware, we highly recommend making a backup copy of your data, because if something goes wrong and the phone stops booting, a complete flashing will save you, deleting all data, including photos, videos and other personal information (see below).

Firmware TWRP

3.1 Preliminary preparation

If you want to flash a custom recovery and immediately root the device, before flashing the firmware, download and copy the SuperSU archive to the root of the phone’s memory (in our case, version 2.82 was used). If you want to install only custom recovery without rooting the device, download and copy Dm-verity and Forced Encryption Disabler (in our case, version 5.1 was used).

Custom recovery for your phone can be found on the TWRP website. Download the corresponding recovery image file and place it in the “developers-tools” folder along with the “adb.exe” and “fastboot.exe” files on your computer. In our case, the file was called “twrp-3.1.1-0-rolex.img”. Open a command prompt window by holding down the "Shift" key, right-clicking in a free area of ​​Explorer, then selecting "Open command window" from the context menu.

On your phone, in the developer menu, enable USB debugging. If you do not have the developer menu enabled, please enable it first.

Connect your phone to your computer using a USB cable. In the command prompt window, type the command:

adb devices

A request will appear on the phone screen to allow USB debugging by the connected computer, confirm it.

If the command line displays the device as a set of Latin letters and numbers and the word “device” next to it, then everything is configured correctly, the drivers are installed and you can move on.

3.2 TWRP firmware

Disconnect the phone from the computer and turn it off in the standard way, hold down the volume down key and the power button until the screen turns on, the phone will boot into bootloader mode and the hare logo and the inscription “FASTBOOT” will appear on the screen.

Make sure the computer sees the phone in fastboot mode by typing the command:

fastboot devices

The result should be the same as in the case of the “adb devices” command, only instead of the word “device” there will be “fastboot”. To flash a new bootloader, type the command (instead of twrp.img, enter the name of the downloaded TWRP image file):

fastboot flash recovery twrp.img

Next, type the command to boot the phone into a new custom recovery (instead of twrp.img, enter the name of the downloaded TWRP image file):

fastboot boot twrp.img

The results of running the above commands should be something like this:

The phone will reboot into the newly installed recovery. The USB cable can be disconnected from the phone. Check the “Newer show this screen during boot again” checkbox and swipe the “Swipe to allow modifications” slider. Click the "Install" button to install the additional package.

Then you have a choice: complete the installation of TWRP with ROOT or complete the installation of TWRP without ROOT.

Possible errors and their elimination

While updating the Xiaomi firmware via TWRP, various errors may appear.

The most common are:

  • Error 6. Indicates that the updater-script file has an incorrect format. To solve the problem, the document is opened via Notepad and saved in Unix format;
  • Error 7. The firmware does not match the selected phone model, so you need to download the appropriate version for your smartphone. The second option is to delete the lines in the updater-script containing the list of devices for which this version of the shell is used;
  • Error 0. The archive is missing some file. To solve, you will need to add the missing documents or you can reload the archive;
  • Error 255. The updater-binary file does not match the selected shell version, so it must be replaced with a suitable version.

Completing the TWRP installation

4.1. Completing the installation of TWRP from ROOT

Select the downloaded SuperSU archive from the list, click on the “Install Image” button and slide your finger along the “Swipe to confirm Flash” slider to confirm its installation.

Wait for the firmware to finish, then click on the “Wipe cache/dalvik” button and confirm the action by swiping your finger on the “Swipe to wipe” slider.

Click on the "Reboot system" button to reboot into the Android system. TWRP custom recovery will prompt you to install your own TWRP application on Android to keep track of updates. You can choose to agree to “Swipe to Install TWRP App” or refuse “Do Not Install”.

The phone will reboot several times - this is normal. After the system boots, the “SuperSU” icon of the superuser application should appear among the application icons.

4.2. Completing the installation of TWRP without ROOT

To complete the TWRP installation without installing ROOT, instead of the SuperSU archive, install the archive with Dm-verity and Forced Encryption Disabler.

If this is not done after installing TWRP, the subsequent boot of the system will be stuck at the “MI” logo.

This completes the installation of custom recovery and rooting of the device (optional). To get into the custom recovery again, turn off the phone in the standard way, hold down both volume keys and the power button until the phone screen lights up, then release, the TWRP custom recovery will load.

Introduction

This article will discuss the process of installing TWRP Recovery and custom PixelExpiriense firmware on the Xiaomi Mi 9T device.
The stock MIUI 11.0.3 works well: the interface works quickly, the battery does not drain quickly, the stock camera takes good pictures, but MIUI has unnecessary functionality that not everyone uses. In addition, there are various minor inconveniences with notifications and some confusion of the system as a whole + unnecessary Xiaomi applications that cannot be disabled. You can also remember advertising in applications (although everything is turned off). In total, it was decided to use the firmware from Google Pixel, which contains nothing superfluous, everything is simple and clear. The firmware has the status of “official”, i.e. is maintained by community developers and will receive updates. All functions work, incl. fingerprint scanner, NFC. There are no bugs. This firmware is very popular among users, because... is essentially a stable alternative to MIUI. But LineageOS (formerly CyanogenMod) is not officially supported, for example.

Initial data

There is a lot of information on the 4pda & XDA forums, among which it is not clear what algorithm to use, especially for beginners, because it’s scary to do something wrong and turn your device into a brick. Therefore, this manual is suitable for those who have the stock official firmware Russian Stable V11.0.3.0.QFJ RU XM (or other versions, the main thing is that it is stock without modifications) without root rights and wants to install PixelExperience.

Fix phone stuck on boot

It may happen that after installing a custom recovery, the system boot freezes with the “MI” logo endlessly displayed on the screen (MIUI endless loading or bootlooping). In this case, turn off the phone by holding both the Volume keys and the Power button (the phone will first reboot again, the “MI” logo will light up briefly and the phone will turn off). Then use the instructions to flash the firmware and return the phone to normal operating condition.

Second method: Through the menu (MIUI)

If the previous method seems too complicated for you, there is another one. In this case, login occurs directly from MIUI.

This method will only work if your Xiaomi turns on and functions normally.

  1. Turn on your phone.
  2. Go to Settings.
  3. Find the “About phone” item in them, click on it.
  4. Select the line "System update".
  5. In the upper right corner you will see three vertical dots, click on them.
  6. Select "Reboot to recovery mode" from the drop-down menu.
  7. Confirm your intentions by clicking on the “Reboot” button.
  8. Done, after a few seconds stock recovery will start on Xiaomi.

Possible problems

And there is, in fact, only one problem: after the firmware, if the custom is installed on top of MIUI 8 version or later, many users intensively googled the phrase “how to log into twrp recovery xiaomi”, because the ability to log in normally simply disappeared. This happened due to a conflict between the utility code and the firmware: the file emmc_appsboot.mbn, corresponding to MIUI, the overwriting of which simply does not make it possible to enter TvRP.

The solution is quite simple: you can simply reinstall the recovery. There is only one problem: this action will help for exactly one flashing, which is why the guys from w3bsit3-dns.com found a more reasonable and durable fix.

So, to fix the bug you need to download this (only suitable for redmi 3, use at your own risk), turn off the phone, press the power and volume down buttons, connect the USB cable to the phone and computer, run the file “1 run me.bat” from the archive, which, if executed successfully, should write “OKAY. Finished". After that, disconnect the cable and hold both volume and power buttons for 15 seconds, waiting for vibration. That's all, TWRP should work fine after such manipulations.

What you can do in the Recovery menu

Recovery mode functions depend on the phone model and the recovery version installed in it.

For example, Xiaomi smartphones initially have a special Mi-recovery, which contains only three points:

  • reboot, that is, reboot;
  • wipe Data, that is, cleaning the Data folder;
  • connect with Mi Assistant - connect to the program on a PC.

The choice is very limited, there is not even an option to completely clear the cache, not to mention a factory reset. However, on any smartphone, including Xiaomi, it is possible to update and replace the standard recovery with a modified one, for example, TWRP.

It has many more features:

  • wipe various sections;
  • creating a backup;
  • restore from backup;
  • return to factory settings;
  • smartphone firmware;
  • firmware for stock and custom recovery;
  • complete information about the smartphone (IMEI).

There may be more functions, it all depends on the version and build of custom recovery.

Flashing standard recovery and replacing it with a modified version is done at your own peril and risk and deprives the user of the warranty on the smartphone.

System update

If your device has international stable firmware, you just need to use the built-in functions to update it. You need to go to settings, where you open the “About phone” item, then find “MIUI Version”. In the window that opens, click on the “Search for updates” button and, if there is the latest version of the shell, it will be automatically downloaded and installed.

If the method does not work, then you need to do the following:

  • Download the firmware for “recovery” (the corresponding smartphone model is first selected) with a zip extension. Saving should occur in the downloaded_rom folder located in the product memory;
  • Launch the update program;
  • In the menu, click “Select firmware file”;

How to update a Xiaomi phone via Recovery

This option may not work on devices that use an MTK processor and have a locked bootloader. In some cases, the program may require a factory reset, so it is recommended to save your data before the procedure.

Next, you also need to download the firmware file and, upon completion of the download, rename it to update.zip. After this, you should reboot the product and enter it in recovery mode. To do this, press the volume up and power keys simultaneously.

To start the update, click Install update.zip to System One. If the operation is successful, then at the end you just need to restart the device.

If Xiaomi does not enter recovery

The main reason why Xiaomi does not log into the system is a conflict between the code and firmware. This often happens if the user flashed the recovery incorrectly or the versions simply conflict with each other. Alternatively, you can try to flash another recovery - an older or, conversely, a new version.

If Xiaomi does not go into stock recovery, try all the methods: ADB mode is preferable, since, for example, on Xiaomi Mi A1 and Mi A2 the key combination is different - there you need to press the power and volume up buttons twice.

There are also cases when the buttons simply do not work or the case is in the way - remove it and try to start the recovery again.

If all else fails, it is recommended to take your phone to a service center, where they will tell you exactly what the problem is.

Rating
( 1 rating, average 5 out of 5 )
Did you like the article? Share with friends:
For any suggestions regarding the site: [email protected]
Для любых предложений по сайту: [email protected]