[Lenovo Z5 Pro (No GT) Q&A, Guides, Development] czajunia:
Stuck on the Boot after Flashing Stock ROM with QFIL and IMEI Rebuild

Thanks for your advice guys. Good news is that I managed to fix the problems after getting help on the Telegram group yesterday. I could boot to the stock ROM and I have my WiFi and mobile network working as it should. All credits for this post go to King BradleyIII on Telegram. Thank you and respect :)

Stuck on the Boot after Flashing Stock ROM with QFIL

If anyone is having issues booting to the system after successfully flashing stock ROM with QFIL (issues = getting stuck on blank screen with blue LED on) it's likely there is a persist partition problem. To solve it you need to manually flash persist.img file taken from the ROM folder you just flashed. It can be done:

1. in fastboot mode by executing a command:

fastboot flash persist persist.img

(easiest way is just to copy persist.img to the ADB Tools folder; it's recommended to use the latest SDK PlatformTools)

2. Alternatively, if you are having problems with fastboot for whatever reason, you can also flash persist from TWRP simply by using install image option and selecting persist partition.

IMEI Number Reconstruction

While trying to fix the above there was another issue I came across and that was an IMEI number problem. This can potentiallu cause network connection issues. You can check if your IMEI numbers are correct by dialling *#06#. If they are not you can try IMEI restoration fix by using two of the attached files and using QCN Backup Restore option from within QFIL after switching the phone to the diag mode (easiest way to do it is to have root so you might have to flash Magisk beforehand). The procedure is described on this web site. Use it to generate a QCN file with attached Qualcomm Tool and a blank Z5s qcn file. The qcn file from the web site should work as well but I haven't tested it. After generating a new file make sure you have root and follow the steps below:

1. Enable USB debugging.

2. Connect the phone to the PC and allow debugging access when prompted.

3. Using CMD go to your ADB tools folder.

4. Execute adb devices to make sure your phone is recognised.

5. Execute adb shell

6. Execute su

7. Confirm root access in Magisk when prompted on the phone.

8. Execute setprop sys.usb.config rndis,diag,adb

9. Open QFIL and make sure your phone is visible in DIAG mode, if not manually select the correct port.

10. Go to Tools -> QCN Backup Restore, select the file with your IMEI numbers you have just generated, tick Enable Multi-SIM and select Restore QCN.

11. When the process finishes you will have to restart the phone manually.

If the problem is not resolved you might have to start from scratch and reinstall stock image using QFIL and selecting an option "Erase All Before Download" in the FireHose Configuration menu. (as always recommended stock ROM is a 11.1.171). Afterwards restore QCN once again. NOTE: In stock ROM after restoring the IMEI I could see the numbers properly even without any SIM card inserted. After flashing a custom ROM I could only see an IMEI when a SIM card was present. This means that if after restoring the IMEI you still can't see the numbers properly after dialing *#06# try inserting the cards into both slots one by one (or use 2 SIM cards simultaneously) and rebooting before trying anything else.

Hope this helps someone.