Hello MIUIers, For Sometime now I've seen people strugging with Invalid IMEI which leads to no network. So I thought I should make a proper guide to solve this problem Lets get Started!! Pre-Requisites Rooted Phone. IMEI numbers written down from the back of the device (under the battery). ES File Explorer on your Phone Following Softwares Installed on your Computer IMEI Converter.zip qpst_2.7.422.zip : <Bạn vui lòng đăng nhập hoặc đăng ký để xem được nội dung này!> minimal_adb_fastboot_v1.3.1_setup.zip đính kèm UltraEdit [Download from <Bạn vui lòng đăng nhập hoặc đăng ký để xem được nội dung này!> Following Drivers on your Computer QualcommDrv.zip đinh kèm Patience and Enough Time [Yes! its going to be a long read!] Now lets get started.. Enabling Diag mode on your device Enable Root Explorer in ES File Explorer From the Side Pane Under Local > Tap on "/ Device" Now goto the "system" folder Now open the build.prop file as text using the ES Note Editor Now scroll down to find the line ro.build.selinux=1 and change it to ro.build.selinux=0 Now Run "Minimal ADB and Fastboot" and execute the following commands adb shell su setprop sys.usb.config diag,adb This will disconnect your device and reconnect the device Now use the following commands to confirm that the above commands were successful adb shell su getprop sys.usb.config Copy the CodeYou should see something like this Also you will see an additional device in the device manager Before: After: Download and Extract <Bạn vui lòng đăng nhập hoặc đăng ký để xem được nội dung này!> (33.11 KB, Downloads: 76) to a known Location in your computer Now open this file using UltraEdit and you should see a screen like this IMPORTANT: What we are going to do next is that we are going to Edit this file to Put the desired IMEI Number in the File I have edited this File to contain the Numbers, that we search for in Points 5 and 6, in the place of IMEI. Our work is to replace those numbers with the IMEI of your own device. Now Run the "IMEI Converter.exe" and Convert the IMEI that you had written from the back of the device to Hex (The IMEI shown in the above pic is just for Illustration Purposes) Now Find the following sequence of hex numbers for SIM 1 08 8A 56 26 02 82 23 25 65 and Replace it with the IMEI generated from the IMEI Converter.exe for the IMEI for Sim1 NOTE: MAKE SURE THE PROPER SEQUNCE AND SPACING IS MAINTAINED To replace the Numbers Just Click on the Number and Type the new Number Now Find the following sequence of hex numbers for SIM 2 08 8A 56 26 02 82 23 25 22 Copy the Code and replace it with the IMEI generated by the IMEI Converter for the IMEI for Sim2 Now save the file and Exit UltraEdit Now again Run the Minimal ADB and Fastboot and execute the following commands in the sequence adb shell su dd if=/dev/block/mmcblk0p16 of=/sdcard/modemst1 dd if=/dev/block/mmcblk0p17 of=/sdcard/modemst2 dd if=/dev/block/mmcblk0p20 of=/sdcard/fsg Copy the Code dd if=/dev/zero of=/dev/block/mmcblk0p16 dd if=/dev/zero of=/dev/block/mmcblk0p17 dd if=/dev/zero of=/dev/block/mmcblk0p20 reboot Copy the CodeThe first set of commands will create a backup of the existing images and the next will wipe off the modemst1 modemst2 and fsg partitions Once you restart you will find IMEI to be gone and 0 Once you restart you will lose the diag mode. you will have to follow 1.6 to 1.8 to enable it Now Run the QPST and Select the Ports Tab You should see the port added automatically In case you dont see any port you can use the "Add New Port" button Now Click on the Start Clients option on the Top Menu bar and select Software Download You will see a Window like this Click on the restore tab and then browse to the file that you just saved. Now click the start Button Once it is done Reboot your system and You should have your IMEI restored Now goto ES file explorer and follow steps 1.1 to 1.5 and change the line ro.build.selinux = 0 to ro.build.selinux = 1 save the file and Its done! Hope this Solves the issue. Keep Tinkering and have Fun.