• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

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

Search This thread

descarao81

Senior Member
Jan 23, 2012
406
243
Zaragoza
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.
 
Last edited:

descarao81

Senior Member
Jan 23, 2012
406
243
Zaragoza
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
 
Last edited:

descarao81

Senior Member
Jan 23, 2012
406
243
Zaragoza
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.
 
Last edited:

bayad

Senior Member
Apr 7, 2011
1,328
668
Djibouti
After qcn restore phone reboots to recovery and shows nv data courrupt
device : Redmi 7a

:laugh::laugh::laugh::laugh::laugh::laugh::laugh::laugh::laugh::laugh::laugh::laugh::laugh::laugh::laugh::laugh::laugh::laugh::laugh::laugh::laugh::laugh::laugh::laugh::laugh::laugh::laugh::laugh::laugh::laugh::laugh::laugh::laugh::laugh::laugh:
 

NK_WOLFIE

Member
May 11, 2018
10
0
21
Ok, mine came with fake Global ROM with terrible performance and had to flash the chinese ROM, after that, WIFI gone, SIM Network gone... and QCN also
I tried those steps on 11.0.575 Chinese ROM, i tested my QCN file size, its saying 310KB, which i presume might be correct. the issue is that im not getting my signals for my sim card back. one thing that i've noticed is that, when i put both of my sim cards, i would get signal on both my sim, but they would stay on H and E for the one configured to Data. i would rarely get 4G. to be noted that despite both sim cards are getting signals, i wont be able to make or receive call on the one configured to data and in some rare cases, for the second sim also. If someone could help me out of this mess, it would be really great! Ive managed to upgrade my phone after 6 years, what is the use of having upgraded to the Z6 Pro when it cannot do those simple task like sending/receiving messages and calls!
 
Jan 2, 2016
13
0
Dear all,
I've flashed stock rom for tb-x704v by QFIL.
It has lost baseband firmware. It is unable to recognize sim card, unknown imei, unknown baseband version and no Phone app appear in app drawer.
Any one can help me fix it, please?
Many thanks for your support.
 

muradak5545

Senior Member
Oct 13, 2016
51
3
After restore of edited qcn file the phone still shows the wrong imei number, how I can format and install 'persist' partition using fastboot in Samsung tab s2 sm-t719
Thanks in advance..
 

Alamzebnsr

Member
May 30, 2021
5
0
I made a little bit progress. I took backup of my Asus rog phone 2 QCN file and edit IMEI using QPST. then I tried to restore that file. It shows QCN restored successful.done. but when I checked my IMEI number after restarting the phone, it's same as before. Tried the whole procedure with QFIL TOOL too. But the results are same. Both shows successful but IMEI is the same.
 

Fshacker

New member
Jul 26, 2021
1
0
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.
I followed all the methods. After restoring qcn my redmi note 8 device stuck on recovery mood. It's showing nv data is corrupted. After that I restore a working qcn With twrp backup. Now my phone is active but there is no IMEI on my device. How could I change my IMEI number ??? Can anybody help me ? I want to use a custom IMEI number on my device.
 

feras mahrouseh

New member
Jul 29, 2021
3
1
I followed all the methods. After restoring qcn my redmi note 8 device stuck on recovery mood. It's showing nv data is corrupted. After that I restore a working qcn With twrp backup. Now my phone is active but there is no IMEI on my device. How could I change my IMEI number ??? Can anybody help me ? I want to use a custom IMEI number on my device.
open TPRW then mount vendor and data and firmware then
rest efs via adb mode by this command: (BUCKUP THIS SECTION BEFORE REST IT)
(you should search how can you rest efs before doing these)

adb shell dd if=/dev/zero of=/dev/block/bootdevice/by-name/modemst1
adb shell dd if=/dev/zero of=/dev/block/bootdevice/by-name/modemst2
adb shell dd if=/dev/zero of=/dev/block/bootdevice/by-name/fsg

then go to 'wipe' select 'art cache' and 'cache' and 'data' to wipe (MI account will ask you for your PASSWORD, if you don't have it ,you will be fall in another problem).
(MACK A BACKUP FIRST for your data) then restart to system and the IEMI should be '0' for both sim.
GO to settings to enable 'debugging mode' then go to developer option to
enable usb debugging.

Go to recovery mode Enter TPRW again to install magisk to root your device and reboot to system.
open qfil after enable diag mode by this command in adb:

adb shell
su
setprop sys.usb.config rndis,diag,adb

prepare qcn file to restore it on qfil and restore it that's it.
1-Tips for qnc file: you can downloaded from xiomi official web site :
2- you can edit qnc file by [Tungtata] QCN Tool or QualcommIMEIRebuilder for one sim ONLY sim 1 IMEI stay 0 (and u should know changing IMEI is illegal)
3-in qfil select port after enable DIAGMODE then select 'tools' then 'QCN backup restore'
then browse for your QCN then select 'restore' reboot your system and the IMEI should appear for SIM 2 ONLY.
This method for 'bootloader unlocked' and 'TPRW RECOVERY'.
after success you can restore all partition from TPRW without efs partition to restore your data with new IMEI.
 
Last edited:
  • Like
Reactions: descarao81

Krlz18

New member
Jul 27, 2021
2
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
 

Top Liked Posts

  • There are no posts matching your filters.
  • 4
    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
    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.
    3
    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