[GUIDE] Backup, edit and restore QCN. Fixing lost IMEI.

Search This thread

Chema_F

Senior Member
Jan 23, 2012
431
273
Zaragoza
There sure were consequences for checking that checkbox "Erase All Data Before Download", huh...
Anyways, straight to the matter.
I've followed the guide step by step and managed to rebuild the .qcn file with my original IMEI which was stored in Google.
Everything seemed to be going okay until I got this error

Restore QCN Fail: Restore QCN Fail Error in QTA.Phone.ModeControl :Error in setting phone mode to MODE_RESET_F

(Edit2: Reading a bit more, I've stumbled upon this post and now I know I'm supposed to enable modem reset in order to restore the .qcn. The question now is... How? I don't wanna give up on this phone yet.
)


I've already looked it up, but these logs only took me to posts on Chinese forums with no replies.
Has anyone managed to solve this before?
Should I rollback to the Global ROM as a workaround, maybe?
(Edit1: Nope. Rolled back and the issue persists)


QFIL .log is attached below.
View attachment 5717615
Have you tried installing ZUI 12.5.365 with QFIL as a previous step before restoring the QCN?
 

Chema_F

Senior Member
Jan 23, 2012
431
273
Zaragoza
I was trying with your QCN Generic file, but that wouldn't work with all smartphones right?
Do I need the same QCN for my device only?
Yeah, QCN files vary depending on the phones. Ask somebody using your same device to backup his QCN and edit the IMEI to send it to you.
I have no idea how universal this method can be. I know some people used in different devices but I only tested on Lenovo Z6 Pro.
 

morphea_yuno

New member
Sep 22, 2022
3
0
Brazil, Goiânia-GO
Have you tried installing ZUI 12.5.365 with QFIL as a previous step before restoring the QCN?
After flashing 12.5.365 I had restored persist/modem.img with the fastboot method, only then I tried restoring the QCN. Got MODE_RESET_F as an output, then rolled back to the ROW version, now my bootloader is locked and the same error is still showing up . I don't know if I'd have to have my phone rooted in order to enable modem reset, if that were the case, I figure it's a whole new hurdle since I figure the oem-unlock.img relies on some sort of IMEI authentication.
Question is, aside from running it on diag mode, is there anything else I should do other than trying to root the phone to gain access to such reset, or am I missing a step?
 

Chema_F

Senior Member
Jan 23, 2012
431
273
Zaragoza
After flashing 12.5.365 I had restored persist/modem.img with the fastboot method, only then I tried restoring the QCN. Got MODE_RESET_F as an output, then rolled back to the ROW version, now my bootloader is locked and the same error is still showing up . I don't know if I'd have to have my phone rooted in order to enable modem reset, if that were the case, I figure it's a whole new hurdle since I figure the oem-unlock.img relies on some sort of IMEI authentication.
Question is, aside from running it on diag mode, is there anything else I should do other than trying to root the phone to gain access to such reset, or am I missing a step?
Root access shouldn't be needed since you shouldn't need to enable modem reset. But here you are, I know. I can't help much at this point to be honest.
 

lillo9546

Senior Member
Jul 14, 2013
113
7
Yeah, QCN files vary depending on the phones. Ask somebody using your same device to backup his QCN and edit the IMEI to send it to you.
I have no idea how universal this method can be. I know some people used in different devices but I only tested on Lenovo Z6 Pro.
I've got a QCN file for my specific phone, did rebuilding and did the Restore procedure in qfil, but still the IMEI blank!

I am on locked bootloader, stock rooted ROM
 

A7.Rtb

Member
Oct 31, 2016
32
7
29
Lattakia
RESTORE QCN



Introduction
If you have ever tried to restore a QCN, you may faced that the QCN is not actually restored, this because of a damaged/erased 'persist' partition. I will describe two different methods to restore the persist partition: fastboot commands (only for unlocked bootloader) and QFIL method (locked and unlocked bootloader). So this post will be structured as follows:
- Introduction
- Erase and install 'persist' and 'modem' partition using fastboot (unlocked bootloader)
- Erase and install 'persist' and 'modem' partition using QFIL (locked/unlocked bootloader)
- Restore QCN


Erase and install 'persist' partition using fastboot

0. Pre-requisites
- ADB&Fastboot installed (you can download it here)

1. Put 'persist' and 'modem' partitions .img files in ADB folder
You should install the partitions from the ZUI firmware currently installed in your device. If you are using stock ZUI, just check the device info in Settings to find the ZUI version you are using, download the ZUI ROM (you can find them HERE), extract persist.img and 'NON-HLOS.bin' .img files and put them into your ADB folder in your computer. Rename 'NON-HLOS.bin' to 'NON-HLOS.img'
If you are using custom ROM and you can't remember which is the last ZUI firmware that you installed, I suggest using 'persist' and 'modem' from 11.5.229 or going for the QFIL method.

2. Reboot in Fastboot Mode and connnect to PC
Shut down your device and boot it holding pressed Volume Down + Power buttons until you see the Fastboot Mode menu. You can navigate the menu with volume buttons and confirm with Power buttons. At this point just reboot in Fastboot Mode and connect the device with computer via USB wire.

3. Open a CMD window in your ADB folder
Open your ADB folder and Shift+Right Click over an empty space of the folder. Choose 'Open CMD here' (or similar, I can't rememeber the words in English). If you don't have this option, open CMD using the search bar in your desktop or the Windows button and navigate with commands to your ADB folder.

4.Erase and install partitions
In CMD window write:
Code:
fastboot devices
[I](this should return a number which represents your device)[/I]
fastboot erase persist
fastboot flash persist persist.img
fastboot erase modem
fastboot flash modem NON-HLOS.img
5. Reboot your device



Erase and install 'persist' partition using QFIL

0. Pre-requisites
- QPST installed
- Lenovo drivers installed
- Qualcomm drivers installed

1. ONLY IF YOU ARE USING ANDROID 9 AND YOUR BOOTLOADER IS UNLOCKED:
You must be aware that installing Android 10 with QFIL will lock your bootloader. So you will avoid problems this way:
- Backup your data
- Remove fingerprint, pattern or any lockscreen security
- Lock the bootloader (from fastboot: fastboot flashing lock)

2. Backup
Backup everything you want to keep if you haven't done yet because this procedure will do a clean install and absolutely everything will be erased.

3. Set the FireHose Configuration
- Open QFIL, press 'Confifuration' tab and select 'FireHose Configuration'.
- Set everything as shown in the screenshots.
Note: if your QFIL doesn't show the option to "Erase All Before Download", install an older QPST version like this one.

TIH4Us4l.png

gh7cYFAl.png


4. Select 'programmer' and 'content'
In the QFIL main screen:
- Select "Meta Build"
- Press "Load Content" and browse to select the 'contents.xml' from the ROM folder.
- Press "Browse" to select the 'prog_firehose_ddr.elf' file from the ROM folder. Actually this file should have been self added when setting the 'contents.xml'.

Bz373Bhl.png


5. Connect in EDL mode and Download
Shut down your device and:
- Hold pressed Volume Up and Volume Down buttons
- Connect the phone to computer with USB wire
- Release volume buttons as soon as your phone vibrates and Lenovo logo flashes on the screen.
- Press the "Download Content" button in QFIL main screen

IMPORTANT: all these steps must be done quickly, if you delay releasing volume buttons or pressing the "Download Content" button there will be errors during the installation.

If your device is not shown as "QDLoader 9008" in QFIL when connecting in EDL mode and you get "Select Port" instead, press "Select port" button top in the right, select your device and press OK. Your device should be shown now. Then unplug your phone and repeat the steps to reboot in EDL mode, connect and Download Content.

Once the installation is finished the device will reboot. Unplug the phone from computer when this happens.


6. Select "Flat Build"
In QFIL main screen select "Flat Build" and make sure that programmer file is loaded.

fEJsTkNl.png


7. Reboot in EDL, connect and select "Partition Manager"
Select "Partition Manager" under the "Tools" tab.

UwP8C9Ll.png


8. Erase and install 'persist' partition
- Do right clik on "persist" label and select "Manage Partition Data".

fUPrakYl.png


- Press "Erase" button.
- Press "Load Image...", browse to select the 'persist.img' file from the ROM folder and confirm to load it.
- Press "Close".

CSv0cxol.png


9. Erase and install 'modem' partition
Repeat previous steps as done with persist partition. The file to load from the ROM folder for modem partition is "NON-HLOS.bin"

10. Reboot the phone.
Close the Partition Manager, unplug the phone from computer and force your phone to reboot holding pressed the Power button.



Restore QCN

1. Boot the phone

2. Enable Diagnostics mode as described in post #1

3. Open QFIL and connect the phone with computer

Your phone should appear in QFIL as connected in Diagnostics Mode, check post #1 if not.

4. Press the "Tools" tab and a menu will open, select "QCN Backup Restore"
obZkosll.png


5. "Browse" to select the .qcn file that you want to install and press "Restore QCN"
guV1G3Hl.png


6. Reboot the phone
The phone won't reboot once the restore is completed so pay attention to the QFIL log to know when it's done and reboot it manually.

Your IMEI should be already restored.

Introduction
This is a guide to backup and restore the QCN, and to edit other's QCN in case you lost your IMEI and you don't have a backup of your QCN. There are other ways to do some steps (the most popular is via Fastboot) but I'm gonna describe the way that I think it's not only the safiest in our Z6 Pro but also valid for both locked and unlocked bootloader.
Disclaim: even having tested these steps more than enough times, I'm not responsible for any damage in your devices, do things at your own risk or don't do it.

Index
Post 1.- Backup QCN
Post 2.- Edit IMEI in QCN
Post 3.- Restore QCN (Fastboot and QFIL methods)


BACKUP QCN

0. Pre-requisites.
- QPST installed (which includes QFIL). You can download it here.
- Lenovo and Qualcomm drivers installed. Download them here. (thanks @benjieb )

1. Enable Diagnostics mode in your phone.
a)
If you're using an stock ZUI ROM, open dialer and dial *#*#33284#*#*
In the next screen select "For qmi test"

zdQqikLl.jpg


b) If you're using a custom rom you can try the dialer method but most likely you will get nothing after dialing the code. If this is the case you still can enable the Diagnostics mode but you need root privileges. Open a Terminal Emulator app and type this:
Code:
su
setprop sys.usb.config diag,adb
Now open QFIL, don't shut down your phone and connect it to PC with the USB wire. Your device should now appear as connected in Diagnostics Mode.

RKQckLLl.png


If you get "Select port" instead, press "Select port" button top in the right, select your device and press OK. Your device should be shown now.

8A17zZdl.png


2. Backup the QCN
Press the "Tools" tab and a menu will open, select "QCN Backup Restore"

obZkosll.png


In the new window you can choose the name for the backup file, just name as you want and leave untouched the .qcn extension. You also can choose where will be stored. Select the "multisim" option and press Backup.

llmH0frl.png


Once the backup it's done, check the generated file size. A normal backup is around 310Kb, if your file is significantly lighter you can suspect of a damaged file. In this case I suggest installing stock ZUI rom and use the dialer method.
Hello bro,
First of all, I'm really sorry for bothering you with this long reading stuff but I really need help
TBH, I have a new Redmi Note 10 Pro and I tried to replace it's IMEI numbers with my old Sony Xperia XA's ones..
I know Changing IMEI is illegal in some countries, but both devices are mine (I can prove that if you want), and I'm sure I can give a good reason to do that (if you want,too..)
So, Here what I did step by step
1- I installed the latest QPST and the latest Qualcomm and Xiaomi drivers (Xiaomi's one from their official site and the Qualcomm's from the QPST archive which I downloaded also from official site)
2- I connected my device with USB Debugging on and activated diagnostics mode with adb and opened QFIL which recognized my device successfully.
3- In QFIL, I backed up the qcn file and copied it and edited the copy with Qualcomm IMEI Rebuilder Successfully (when I opened the rebuilded copy again with the IMEI Rebuilder it showed the new IMEIs)
4- I Restored the edited copy with multisim enabled successfully (QFIL showed qcn restored)
5- I closed QFIL, Unblugged my device and rebooted it.
Everything seemed to be ok, but when I checked my IMEIs, they were unchanged..

I really need help , and as mentioned above I really have a good reason to do that, which I don't want to bother you with, unless you want to.
So, feel free to help me or no, but I really appreciate your help
And thank you anyway
Introduction
This is a guide to backup and restore the QCN, and to edit other's QCN in case you lost your IMEI and you don't have a backup of your QCN. There are other ways to do some steps (the most popular is via Fastboot) but I'm gonna describe the way that I think it's not only the safiest in our Z6 Pro but also valid for both locked and unlocked bootloader.
Disclaim: even having tested these steps more than enough times, I'm not responsible for any damage in your devices, do things at your own risk or don't do it.

Index
Post 1.- Backup QCN
Post 2.- Edit IMEI in QCN
Post 3.- Restore QCN (Fastboot and QFIL methods)


BACKUP QCN

0. Pre-requisites.
- QPST installed (which includes QFIL). You can download it here.
- Lenovo and Qualcomm drivers installed. Download them here. (thanks @benjieb )

1. Enable Diagnostics mode in your phone.
a)
If you're using an stock ZUI ROM, open dialer and dial *#*#33284#*#*
In the next screen select "For qmi test"

zdQqikLl.jpg


b) If you're using a custom rom you can try the dialer method but most likely you will get nothing after dialing the code. If this is the case you still can enable the Diagnostics mode but you need root privileges. Open a Terminal Emulator app and type this:
Code:
su
setprop sys.usb.config diag,adb
Now open QFIL, don't shut down your phone and connect it to PC with the USB wire. Your device should now appear as connected in Diagnostics Mode.

RKQckLLl.png


If you get "Select port" instead, press "Select port" button top in the right, select your device and press OK. Your device should be shown now.

8A17zZdl.png


2. Backup the QCN
Press the "Tools" tab and a menu will open, select "QCN Backup Restore"

obZkosll.png


In the new window you can choose the name for the backup file, just name as you want and leave untouched the .qcn extension. You also can choose where will be stored. Select the "multisim" option and press Backup.

llmH0frl.png


Once the backup it's done, check the generated file size. A normal backup is around 310Kb, if your file is significantly lighter you can suspect of a damaged file. In this case I suggest installing stock ZUI rom and use the dialer method.
Hello bro,
First of all I'm really sorry for bothering you with this long reading stuff but I really need help
TBH, I have a new Redmi Note 10 Pro and I tried to replace it's IMEI numbers with my old Sony Xperia XA's ones..
I know Changing IMEI is illegal in some countries, but both devices are mine (I can prove that if you want), and I'm sure I can give a good reason to do that (if you want,too..)
So, Here what I did step by step
1- I installed the latest QPST and the latest Qualcomm and Xiaomi drivers (Xiaomi's one from their official site and the Qualcomm's from the QPST archive which I downloaded also from official site)
2- I connected my device with USB Debugging on and activated diagnostics mode with adb and opened QFIL which recognized my device successfully.
3- In QFIL, I backed up the qcn file and copied it and edited the copy with Qualcomm IMEI Rebuilder Successfully (when I opened the rebuilded copy again with the IMEI Rebuilder it showed the new IMEIs)
4- I Restored the edited copy with multisim enabled successfully (QFIL showed qcn restored)
5- I closed QFIL, Unblugged my device and rebooted it.
Everything seemed to be ok, but when I checked my IMEIs, they were unchanged..

I really need help , and as mentioned above I really have a good reason to do that, which I don't want to bother you with, unless you want to.
So, feel free to help me or no, but I really appreciate your help
And thank you anyway
 

MohmmadUzairKhan

Senior Member
Dec 5, 2015
552
56
OnePlus 8
Hello bro,
First of all, I'm really sorry for bothering you with this long reading stuff but I really need help
TBH, I have a new Redmi Note 10 Pro and I tried to replace it's IMEI numbers with my old Sony Xperia XA's ones..
I know Changing IMEI is illegal in some countries, but both devices are mine (I can prove that if you want), and I'm sure I can give a good reason to do that (if you want,too..)
So, Here what I did step by step
1- I installed the latest QPST and the latest Qualcomm and Xiaomi drivers (Xiaomi's one from their official site and the Qualcomm's from the QPST archive which I downloaded also from official site)
2- I connected my device with USB Debugging on and activated diagnostics mode with adb and opened QFIL which recognized my device successfully.
3- In QFIL, I backed up the qcn file and copied it and edited the copy with Qualcomm IMEI Rebuilder Successfully (when I opened the rebuilded copy again with the IMEI Rebuilder it showed the new IMEIs)
4- I Restored the edited copy with multisim enabled successfully (QFIL showed qcn restored)
5- I closed QFIL, Unblugged my device and rebooted it.
Everything seemed to be ok, but when I checked my IMEIs, they were unchanged..

I really need help , and as mentioned above I really have a good reason to do that, which I don't want to bother you with, unless you want to.
So, feel free to help me or no, but I really appreciate your help
And thank you anyway

Hello bro,
First of all I'm really sorry for bothering you with this long reading stuff but I really need help
TBH, I have a new Redmi Note 10 Pro and I tried to replace it's IMEI numbers with my old Sony Xperia XA's ones..
I know Changing IMEI is illegal in some countries, but both devices are mine (I can prove that if you want), and I'm sure I can give a good reason to do that (if you want,too..)
So, Here what I did step by step
1- I installed the latest QPST and the latest Qualcomm and Xiaomi drivers (Xiaomi's one from their official site and the Qualcomm's from the QPST archive which I downloaded also from official site)
2- I connected my device with USB Debugging on and activated diagnostics mode with adb and opened QFIL which recognized my device successfully.
3- In QFIL, I backed up the qcn file and copied it and edited the copy with Qualcomm IMEI Rebuilder Successfully (when I opened the rebuilded copy again with the IMEI Rebuilder it showed the new IMEIs)
4- I Restored the edited copy with multisim enabled successfully (QFIL showed qcn restored)
5- I closed QFIL, Unblugged my device and rebooted it.
Everything seemed to be ok, but when I checked my IMEIs, they were unchanged..

I really need help , and as mentioned above I really have a good reason to do that, which I don't want to bother you with, unless you want to.
So, feel free to help me or no, but I really appreciate your help
And thank you anyway

Same thing happened with me, IMEI doesn't change.

Anyone can guide us? What's the problem
Hello bro,
First of all, I'm really sorry for bothering you with this long reading stuff but I really need help
TBH, I have a new Redmi Note 10 Pro and I tried to replace it's IMEI numbers with my old Sony Xperia XA's ones..
I know Changing IMEI is illegal in some countries, but both devices are mine (I can prove that if you want), and I'm sure I can give a good reason to do that (if you want,too..)
So, Here what I did step by step
1- I installed the latest QPST and the latest Qualcomm and Xiaomi drivers (Xiaomi's one from their official site and the Qualcomm's from the QPST archive which I downloaded also from official site)
2- I connected my device with USB Debugging on and activated diagnostics mode with adb and opened QFIL which recognized my device successfully.
3- In QFIL, I backed up the qcn file and copied it and edited the copy with Qualcomm IMEI Rebuilder Successfully (when I opened the rebuilded copy again with the IMEI Rebuilder it showed the new IMEIs)
4- I Restored the edited copy with multisim enabled successfully (QFIL showed qcn restored)
5- I closed QFIL, Unblugged my device and rebooted it.
Everything seemed to be ok, but when I checked my IMEIs, they were unchanged..

I really need help , and as mentioned above I really have a good reason to do that, which I don't want to bother you with, unless you want to.
So, feel free to help me or no, but I really appreciate your help
And thank you anyway

Hello bro,
First of all I'm really sorry for bothering you with this long reading stuff but I really need help
TBH, I have a new Redmi Note 10 Pro and I tried to replace it's IMEI numbers with my old Sony Xperia XA's ones..
I know Changing IMEI is illegal in some countries, but both devices are mine (I can prove that if you want), and I'm sure I can give a good reason to do that (if you want,too..)
So, Here what I did step by step
1- I installed the latest QPST and the latest Qualcomm and Xiaomi drivers (Xiaomi's one from their official site and the Qualcomm's from the QPST archive which I downloaded also from official site)
2- I connected my device with USB Debugging on and activated diagnostics mode with adb and opened QFIL which recognized my device successfully.
3- In QFIL, I backed up the qcn file and copied it and edited the copy with Qualcomm IMEI Rebuilder Successfully (when I opened the rebuilded copy again with the IMEI Rebuilder it showed the new IMEIs)
4- I Restored the edited copy with multisim enabled successfully (QFIL showed qcn restored)
5- I closed QFIL, Unblugged my device and rebooted it.
Everything seemed to be ok, but when I checked my IMEIs, they were unchanged..

I really need help , and as mentioned above I really have a good reason to do that, which I don't want to bother you with, unless you want to.
So, feel free to help me or no, but I really appreciate your help
And thank you anyway


Same thing happend with me in Oneplus 8 , @Chema_F Can you guide us why IMEI is not changing?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 7
    Introduction​
    This is a guide to backup and restore the QCN, and to edit other's QCN in case you lost your IMEI and you don't have a backup of your QCN. There are other ways to do some steps (the most popular is via Fastboot) but I'm gonna describe the way that I think it's not only the safiest in our Z6 Pro but also valid for both locked and unlocked bootloader.
    Disclaim: even having tested these steps more than enough times, I'm not responsible for any damage in your devices, do things at your own risk or don't do it.

    Index
    Post 1.- Backup QCN
    Post 2.- Edit IMEI in QCN
    Post 3.- Restore QCN (Fastboot and QFIL methods)

    BACKUP QCN

    0. Pre-requisites.
    - QPST installed (which includes QFIL). You can download it here.
    - Lenovo and Qualcomm drivers installed. Download them here. (thanks @benjieb )

    1. Enable Diagnostics mode in your phone.
    a) If you're using an stock ZUI ROM, open dialer and dial *#*#33284#*#*
    In the next screen select "For qmi test"

    zdQqikLl.jpg


    b) If you're using a custom rom you can try the dialer method but most likely you will get nothing after dialing the code. If this is the case you still can enable the Diagnostics mode but you need root privileges. Open a Terminal Emulator app and type this:
    Code:
    su
    setprop sys.usb.config diag,adb
    Now open QFIL, don't shut down your phone and connect it to PC with the USB wire. Your device should now appear as connected in Diagnostics Mode.

    RKQckLLl.png


    If you get "Select port" instead, press "Select port" button top in the right, select your device and press OK. Your device should be shown now.

    8A17zZdl.png


    2. Backup the QCN
    Press the "Tools" tab and a menu will open, select "QCN Backup Restore"

    obZkosll.png


    In the new window you can choose the name for the backup file, just name as you want and leave untouched the .qcn extension. You also can choose where will be stored. Select the "multisim" option and press Backup.

    llmH0frl.png


    Once the backup it's done, check the generated file size. A normal backup is around 310Kb, if your file is significantly lighter you can suspect of a damaged file. In this case I suggest installing stock ZUI rom and use the dialer method.
    6
    EDIT QCN

    EDIT QCN
    Introduction​
    This can be useful in case you loose your IMEI and you don't have a QCN backup to restore. Then the only option is to edit the IMEI stored in other's QCN backup to put your IMEI and restore the QCN file in your device. The most common reason for lost IMEI is selecting in QFIL the option to "Erase all before download" which erase absolutely everything when you install a ROM, QCN of course included.

    0. Pre-requisites
    - A QCN file. You can ask someone to share his with you or just download this "genericIMEI.qcn" file.
    - "Qualcomm IMEI rebuilder" downloaded (from here) and extracted.

    1. Run IMEIRebuilder.exe

    2. Open the QCN file
    Press the "Open file..." button, browse to select the QCN file and press "Open".
    You will see random numbers loaded in IMEI1 and IMEI2

    3. Edit IMEI1 and IMEI2 to put yours

    4. Select "Rebuild"
    Once it's done you can close the IMEI rebuilder software, re-execute it and load the edited to file to check that now it contains your IMEI

    z9k627gl.png
    5
    RESTORE QCN
    Introduction​
    If you have ever tried to restore a QCN, you may faced that the QCN is not actually restored, this because of a damaged/erased 'persist' partition. I will describe two different methods to restore the persist partition: fastboot commands (only for unlocked bootloader) and QFIL method (locked and unlocked bootloader). So this post will be structured as follows:
    - Introduction
    - Erase and install 'persist' and 'modem' partition using fastboot (unlocked bootloader)
    - Erase and install 'persist' and 'modem' partition using QFIL (locked/unlocked bootloader)
    - Restore QCN

    Erase and install 'persist' partition using fastboot

    0. Pre-requisites
    - ADB&Fastboot installed (you can download it here)

    1. Put 'persist' and 'modem' partitions .img files in ADB folder
    You should install the partitions from the ZUI firmware currently installed in your device. If you are using stock ZUI, just check the device info in Settings to find the ZUI version you are using, download the ZUI ROM (you can find them HERE), extract persist.img and 'NON-HLOS.bin' .img files and put them into your ADB folder in your computer. Rename 'NON-HLOS.bin' to 'NON-HLOS.img'
    If you are using custom ROM and you can't remember which is the last ZUI firmware that you installed, I suggest using 'persist' and 'modem' from 11.5.229 or going for the QFIL method.

    2. Reboot in Fastboot Mode and connnect to PC
    Shut down your device and boot it holding pressed Volume Down + Power buttons until you see the Fastboot Mode menu. You can navigate the menu with volume buttons and confirm with Power buttons. At this point just reboot in Fastboot Mode and connect the device with computer via USB wire.

    3. Open a CMD window in your ADB folder
    Open your ADB folder and Shift+Right Click over an empty space of the folder. Choose 'Open CMD here' (or similar, I can't rememeber the words in English). If you don't have this option, open CMD using the search bar in your desktop or the Windows button and navigate with commands to your ADB folder.

    4.Erase and install partitions
    In CMD window write:
    Code:
    fastboot devices
    [I](this should return a number which represents your device)[/I]
    fastboot erase persist
    fastboot flash persist persist.img
    fastboot erase modem
    fastboot flash modem NON-HLOS.img
    5. Reboot your device


    Erase and install 'persist' partition using QFIL

    0. Pre-requisites
    - QPST installed
    - Lenovo drivers installed
    - Qualcomm drivers installed

    1. ONLY IF YOU ARE USING ANDROID 9 AND YOUR BOOTLOADER IS UNLOCKED:
    You must be aware that installing Android 10 with QFIL will lock your bootloader. So you will avoid problems this way:
    - Backup your data
    - Remove fingerprint, pattern or any lockscreen security
    - Lock the bootloader (from fastboot: fastboot flashing lock)

    2. Backup
    Backup everything you want to keep if you haven't done yet because this procedure will do a clean install and absolutely everything will be erased.

    3. Set the FireHose Configuration
    - Open QFIL, press 'Confifuration' tab and select 'FireHose Configuration'.
    - Set everything as shown in the screenshots.
    Note: if your QFIL doesn't show the option to "Erase All Before Download", install an older QPST version like this one.

    TIH4Us4l.png

    gh7cYFAl.png


    4. Select 'programmer' and 'content'
    In the QFIL main screen:
    - Select "Meta Build"
    - Press "Load Content" and browse to select the 'contents.xml' from the ROM folder.
    - Press "Browse" to select the 'prog_firehose_ddr.elf' file from the ROM folder. Actually this file should have been self added when setting the 'contents.xml'.

    Bz373Bhl.png


    5. Connect in EDL mode and Download
    Shut down your device and:
    - Hold pressed Volume Up and Volume Down buttons
    - Connect the phone to computer with USB wire
    - Release volume buttons as soon as your phone vibrates and Lenovo logo flashes on the screen.
    - Press the "Download Content" button in QFIL main screen

    IMPORTANT: all these steps must be done quickly, if you delay releasing volume buttons or pressing the "Download Content" button there will be errors during the installation.

    If your device is not shown as "QDLoader 9008" in QFIL when connecting in EDL mode and you get "Select Port" instead, press "Select port" button top in the right, select your device and press OK. Your device should be shown now. Then unplug your phone and repeat the steps to reboot in EDL mode, connect and Download Content.

    Once the installation is finished the device will reboot. Unplug the phone from computer when this happens.


    6. Select "Flat Build"
    In QFIL main screen select "Flat Build" and make sure that programmer file is loaded.

    fEJsTkNl.png


    7. Reboot in EDL, connect and select "Partition Manager"
    Select "Partition Manager" under the "Tools" tab.

    UwP8C9Ll.png


    8. Erase and install 'persist' partition
    - Do right clik on "persist" label and select "Manage Partition Data".

    fUPrakYl.png


    - Press "Erase" button.
    - Press "Load Image...", browse to select the 'persist.img' file from the ROM folder and confirm to load it.
    - Press "Close".

    CSv0cxol.png


    9. Erase and install 'modem' partition
    Repeat previous steps as done with persist partition. The file to load from the ROM folder for modem partition is "NON-HLOS.bin"

    10. Reboot the phone.
    Close the Partition Manager, unplug the phone from computer and force your phone to reboot holding pressed the Power button.


    Restore QCN

    1. Boot the phone

    2. Enable Diagnostics mode as described in post #1

    3. Open QFIL and connect the phone with computer
    Your phone should appear in QFIL as connected in Diagnostics Mode, check post #1 if not.

    4. Press the "Tools" tab and a menu will open, select "QCN Backup Restore"
    obZkosll.png


    5. "Browse" to select the .qcn file that you want to install and press "Restore QCN"
    guV1G3Hl.png


    6. Reboot the phone
    The phone won't reboot once the restore is completed so pay attention to the QFIL log to know when it's done and reboot it manually.

    Your IMEI should be already restored.
    3
    Introduction
    This is a guide to backup and restore the QCN, and to edit other's QCN in case you lost your IMEI and you don't have a backup of your QCN. There are other ways to do some steps (the most popular is via Fastboot) but I'm gonna describe the way that I think it's not only the safiest in our Z6 Pro but also valid for both locked and unlocked bootloader.
    Disclaim: even having tested these steps more than enough times, I'm not responsible for any damage in your devices, do things at your own risk or don't do it.

    Index
    Post 1.- Backup QCN
    Post 2.- Edit IMEI in QCN
    Post 3.- Restore QCN (Fastboot and QFIL methods)


    BACKUP QCN

    0. Pre-requisites.
    - QPST installed (which includes QFIL). You can download it here.
    - Lenovo and Qualcomm drivers installed. Download them here. (thanks @benjieb )

    1. Enable Diagnostics mode in your phone.
    a)
    If you're using an stock ZUI ROM, open dialer and dial *#*#33284#*#*
    In the next screen select "For qmi test"

    zdQqikLl.jpg


    b) If you're using a custom rom you can try the dialer method but most likely you will get nothing after dialing the code. If this is the case you still can enable the Diagnostics mode but you need root privileges. Open a Terminal Emulator app and type this:
    Code:
    su
    setprop sys.usb.config diag,adb
    Now open QFIL, don't shut down your phone and connect it to PC with the USB wire. Your device should now appear as connected in Diagnostics Mode.

    RKQckLLl.png


    If you get "Select port" instead, press "Select port" button top in the right, select your device and press OK. Your device should be shown now.

    8A17zZdl.png


    2. Backup the QCN
    Press the "Tools" tab and a menu will open, select "QCN Backup Restore"

    obZkosll.png


    In the new window you can choose the name for the backup file, just name as you want and leave untouched the .qcn extension. You also can choose where will be stored. Select the "multisim" option and press Backup.

    llmH0frl.png


    Once the backup it's done, check the generated file size. A normal backup is around 310Kb, if your file is significantly lighter you can suspect of a damaged file. In this case I suggest installing stock ZUI rom and use the dialer method.
    1.jpg

    Hi, I have this issue I'm trying to do that. Backup the imei but the QFIl get stuck checking for phone connection and never connect until the backup fails, the device is a Moto e5 xt1944-3
    2
    Hi, im flashing my qcn to get my imei back. When i enter diag mode, my qfil showing that i am connected with “COM8”.
    But when im restoring it, logs activity showing me this. But im already connected my phone with diag mode. Any solution?
    0756133E-6936-4703-AEC1-5C2FB5D0A758.jpeg
    0756133E-6936-4703-AEC1-5C2FB5D0A758.jpeg