How to Fix Broken/Missing/Corrupt IMEI Number in Xiaomi

In this guide, we will show you the steps to fix the broken/missing/corrupt IMEI Number on your Xiaomi device. Out of all the issues that one might come across in the custom development, it’s the missing IMEI number that scares the sh*t out of us [well, obviously next to device getting hardbricked]. Unfortunately, this problem is becoming quite a regular phenomenon nowadays.

One main reason why it happens is due to the EFS, devinfo, NVDATA, or NVRAM partition getting corrupted. Fortunately, I stumbled upon a nifty workaround using which you can easily restore your broken/missing/corrupt IMEI Number on your Xiaomi device. So, without any further ado, let’s show you how this could be carried out.

  • How to Fix Broken/Missing/Corrupt IMEI Number in Xiaomi Compatibility Device List The Prerequisites Fix IMEI on Xiaomi Devices without PC Fix IMEI on Xiaomi Devices using a PC

How to Fix Broken/Missing/Corrupt IMEI Number in Xiaomi

How to Fix Broken Missing Corrupt IMEI Number in Xiaomi - 1

Before starting, please take a complete device backup. Moreover, this guide should only be used on your own device and in a legal manner only. Droidwin and its members wouldn’t be held responsible in case of a thermonuclear war, your alarm doesn’t wake you up, or if anything happens to your device, and data by performing the below steps. [Credits: This guide wouldn’t have been possible without XDA Senior Member timjosten, so all credit goes to him.]

Compatibility Device List

As of now, the below-listed devices support this tweak, and more devices might be added in the near future. Moreover, we have also given the device codename next to each of these devices, so that you can easily verify if your device is part of this list or not.

  • Redmi Note 8 Pro – begonia/begoniain
  • Redmi Note 10S Global / Redmi Note 11 SE India / POCO M5s – rosemary
  • Redmi Note 10S (India) – secret
  • Redmi Note 10S (Latin America) – maltose
  • Redmi Note 12S (NFC) – sea
  • Redmi Note 12S (Non NFC) – ocean
  • Redmi 12 – fire/heat
  • Redmi 12C (NFC) – aether
  • Redmi 12C / POCO C54 (Non NFC) – earth
  • Redmi 10 / Redmi 10 Prime / Redmi 10 2022 / Redmi 10 Prime 2022 – selene
  • Redmi 10 (NFC) / Redmi 10 2022 (NFC) – eos
  • Redmi Note 11 4G (China) – selenes

The Prerequisites

  • The methods given below will ultimately end up creating a ZIP file, which can be flashed either via a rooting app like Magisk [KernelSU and APatch are untested, though they should work as well] or a custom recovery like TWRP [OrangeFox and Pitch Black should also work]. So, make sure to either root your device via Magisk / KernelSU / APatch OR Install TWRP Recovery on your device.
  • Moreover, please back up your “NVDATA”, “NVRAM”, “devinfo”, and “EFS” partitions. You may either do so via root and dd commands or from TWRP’s Backup feature. Once you have taken a backup, please transfer those files to your PC or a cloud storage.
  • How to Find Chip ID: Install Termux, launch it, and type in the following command: getprop ro.boot.chipid. This will give you the device’s Chip ID. Copy it as it will come in handy later on.
  • How to Find “wifi_Mac” and “bt_mac”: Connect your device to WiFi and Bluetooth. Then head over to Settings > About Phone > All Specs > Status > Check the value of Device WiFi MAC Address and Bluetooth Address. Please take note of these values as they will be required in this guide.
  • Also, install Visual C++ Redistributable for Visual Studio 2015(x64) if your PC doesn’t have it installed.
  • If you do not have access to your Original IMEI, you can use the IMEI from your spare phone or generate a random one from here . [This might be illegal in some countries, so verify if it is legal in your region and only then try it out.]
  • The ZIP file you’ll get after carrying out either of the two methods should be flashed if you are changing ROMs [right after flashing the ROM but before the first boot-up].
  • If nothing works, try setting imei_1 to 000000000000000 (use imei_2 for your real IMEI).
  • The bootloader might not be lockable if you use this method

Fix IMEI on Xiaomi Devices without PC

Benefit: Doesn't require a PC [duh!]

Drawback: More complex of the two methods
  1. Download, install, and launch Termux on your device.
  2. Then, paste the below commands, one after the other: pkg install git pkg install php apt update apt upgrade git clone https://github.com/timjosten/mtk_imei cd mtk_imei
  3. Grant Termux “Files” Permission from App Info.
  4. Create a “config.txt” in your internal storage via: cp config.txt /sdcard
  5. Open it and fill in the required details, such as “wifi_Mac”, “bt_mac”, and your IMEI.
  6. Now transfer this file back to the build environment: cp /sdcard/config.txt
  7. Then run this script via the below command: ./mtk_imei.sh
  8. Finally, create the imei_repair.zip in Internal Storage: cp out/imei_repair.zip /sdcard
  9. You may now flash this script via Magisk or TWRP recovery.

Fix IMEI on Xiaomi Devices using a PC

Benefit: Easier of the two methods

Drawback: Requires a PC [no brownie points in guessing that!]
  1. Go to this GitHub Repository > click Code > Download ZIP.
  2. Extract the downloaded ZIP and open the “config.txt” file.
  3. Fill in the details like “wifi_Mac”, “bt_mac”, and the IMEI.
  4. Now save the text file. Then open the “mtk_imei.cmd” file.
  5. A CMD window will now open. If you filled in the values correctly, it’ll say “Success!” and a new folder will be created named “out”.
  6. However, if the CMD window says “incorrect values”, then verify the details entered and try again.
  7. So, go to the Out folder and you’ll see the “imei_repair.zip” file. Flash it via Magisk or TWRP Recovery.
  • How to Dump the devinfo Partition and Read IMEI Number
  • How to Fix Null/0/Missing IMEI Numbers on Pixel Phones
  • Change/Repair/Fix IMEI on Qualcomm Snapdragon Devices
  • How to Backup EFS Partition/IMEI Number on Android
  • NULL IMEI on Nothing Phone 1 after using Engineering Mode/CIT app [Fix]
  • How to Fix Corrupt EFS/No IMEI/Network Issues [3 Methods]
  • How to Fix NULL/Invalid IMEI on MediaTek Devices using Modem Meta (Maui Meta)
  • How to Backup and Restore IMEI on Qualcomm using QCN and QFIL
  • Download IMEI Repair NVRAM Files for MTK MediaTek Devices
Google preferred - 2 Google preferred - 3

(Cancel Reply)

Δ