Xiaomi Mi5 IMEI, MEID, ESN restore, Can't Get Valid Device Id & No Sim Detected
Main link(s) (Many thanks and Respect @jinishpv from XDA
, @koravabee from MIUI
):
https://forum.xda-developers.com/mi-5/how-to/xiaomi-mi5-efs-backup-restore-methods-t3432730
http://en.miui.com/thread-322126-1-1.html
My Solution:
The base algorithm – from the Main_link:
0. Root phone, Remove all SIM cards
1. Open Diag mode: DIAL *#*#717717#*#*
2. Install QUALCOMM DIAG DRIVERS
3. Edit SAMPLE-MI5.qcn with your IMEI, MEID, ESN numbers. Use HEX-Editor and IMEI Converter.
Change IMEI1:
Find through SAMPLE-MI5.qcn IMEI1 = 123456789012345 and REPLACEit with your own IMEI1 (from box). Find and replace ALL instances!
Change IMEI2:
Find through SAMPLE-MI5.qcn IMEI2 = 543210987654321 and REPLACE it with your own IMEI2 (from box of from the Main_Link thread). Find and replace ALL instances!
Change MEID:
Find through SAMPLE-MI5.qcn MEID = 01680708080099 and REPLACE it with your own MEID (from box) IN THE REVERSE ORDER! (Example: MEID_Box = 99 00 08 11 22 33 44 -> MEID_ SAMPLE-MI5 = 44 33 22 11 08 00 99). Find and replace ALL instances! (2 or 3)
Change ESN:
To find your ESN use your MEID (from box) and calculate your ESN on site
https://www.meidconverter.com/ (get Pseudo Hex ESN number).
Find through SAMPLE-MI5.qcn ESN = BAF37A80 and REPLACE it with your own ESN IN THE REVERSE ORDER! (Example: ESN = 11 22 33 44 -> ESN_ SAMPLE-MI5 = 44 33 22 11). Find and replace ALL instances! (2 or 3)
4. Wipe EFS partition !!!
(!!! WITHOUT THIS STEP I CAN'T CONNECT PHONE TO QPST !!!)
adb shell
su
dd if=/dev/zero of=/dev/block/sde28
dd if=/dev/zero of=/dev/block/sdf3
dd if=/dev/zero of=/dev/block/sdf5
reboot
Note: Before wipe make a BACKUP of your corrupted EFS (just in case):
adb shell
su
dd if=/dev/block/sde28 of=/sdcard/modemst1
dd if=/dev/block/sdf3 of=/sdcard/modemst2
dd if=/dev/block/sdf5 of=/sdcard/fsg
5. Connect your Mi5 in the Diag mode:
Open the 'QPST configuration' then click 'Start Clients->Software Download', just click on restore tab and browse for the qcn backup and enable 'Allow phone/file ESN mismatch' then click start to restore. Press “Start” and wait until the process is completed.
After restoration is completed you need to reboot the phone and check your IMEI1, IME2, MEID, ESN (ESN is shown in QPST on 'Active Phones' page).
6. Close Diag mode (DIAL *#*#717717#*#*)
NOTES:
1. BACKUP corrupted EFS first (just in case):
adb shell
su
dd if=/dev/block/sde28 of=/sdcard/modemst1
dd if=/dev/block/sdf3 of=/sdcard/modemst2
dd if=/dev/block/sdf5 of=/sdcard/fsg
2. if you don't know IMEI2 – in the Main_Link thread there is an algorithm How to find IMEI2 from IMEI1
3. !!! Every time you need (re)write your *.QCN file you need to wipe EFS PARTITION (see above)
4. Make a backup of your working *.QCN and THREE BIN FILES (modemst1, modemst2, fsg)