[ZTE Axon 7 ROMs, Kernels, Recoveries, & Other Deve] Yoshi_Guy:
First of all, I would like to say thanks to [MENTION=3044858]DrakenFX[/MENTION], [MENTION=540283]tenfar[/MENTION], [MENTION=6699128]rczrider[/MENTION], and [MENTION=7890973]tennear[/MENTION] for their work on the Axon 7.

/* Disclaimer
* I am not responsible for bricked devices, dead SD cards, thermonuclear war,
* or any other mishaps that may occur. YOU are choosing to make these modifications, and if
* you blame me in any way for what happens to your device, I will laugh at you.
*/

This guide is intended to help anyone wishing to return to stock B20 firmware on the A2017U for the purposes of re-locking the bootloader (either for sending a device in for an RMA or whatever you may need). After much trial and error, I have finally come up with a guide and attached all necessary files to do this. I performed the following steps on my Axon 7 2017U on the B29 firmware and successfully downgraded to the B20 firmware with a re-locked bootloader.

Here are the files you will need:

Stock system

Stock boot stack

Stock fastboot

Stock recovery

TWRP

Make sure you have ADB and fastboot set up properly on your computer.

Use the TWRP linked in this post. I know for sure that this version works towards the end of this process when your bootloader is locked again.

After you have the zip files, you will need to move them to your phone to flash in TWRP. Follow these steps:

1. Make a backup of all of your important data. EVERYTHING will be wiped in this process, including internal storage.

2. Power off the phone.

3. Download the the axon7tool executable file from this link: Here Check the post for instructions pertaining to drivers needed.

4. Boot the phone into EDL mode. Do this by holding down the Volume Up and Volume Down keys simultaneously and then plugging the phone in to your computer while keeping these keys pressed. (The phone's screen will be completely black and it will appear like nothing is happening. This is EDL mode.)

5. Open a command prompt in the directory with the axon7tool executable. (Windows: right click while holding shift and select "Open command window here." Linux: Open a terminal and cd into the directory)

6. Dump your gpt with the tool. (Note: you may need root access to run the following commands on Linux)

Windows: axon7tool-1.5-win64 -r gpt
Linux: ./axon7tool-1.5-linux -r gpt

7. The axon7tool will automatically reboot you. Reboot to TWRP.

8. Make a backup of your EFS partition by going to "Backup" with only the EFS box checked.

9. Copy the "TWRP" folder from your internal storage to your computer. This folder contains the EFS backup.

10. Go to "Wipe" -> "Advanced" -> "Format Data." Type "yes." WARNING: THIS DELETES ALL DATA. MAKE SURE YOU HAVE A BACKUP.

11. Reboot back into TWRP. Ignore anything TWRP says or asks you to do upon a reboot.

12. Copy the "B20_stock_system," B20_stock_bootstack," and "B20_stock_fastboot" zip files to your internal storage.

13. Flash the stock system zip first, then the boot stack zip, and finally the fastboot zip.

14. At this point you are on the stock B20 system, but with an unlocked bootloader. TWRP will probably be overwritten, so follow these next steps regardless.

15. Reboot the phone and let it get to the set up screen. This step can take a while; my Axon took almost a minute to get off of the ZTE splash screen initially.

16. As soon as you see that the phone boots, power off the phone and reboot to EDL mode.

17. Flash TWRP again with the axon7tool as it has been overwritten at this point and will be necessary soon. Download the linked TWRP recovery image and rename the file to "recovery.bin" Place it in the same folder as the axon7tool. Flash the recovery. (Note: you may need root access to run the following commands on Linux)

Windows: axon7tool-1.5-win64 -w recovery
Linux: ./axon7tool-1.5-linux -w recovery

18. Reboot the phone into the bootloader. You can do this by going to TWRP and by choosing reboot to bootloader or by manually doing so.

19. Type "fastboot oem lock" into a command prompt. This will lock your bootloader.

20. After I did this, I thought I was done. However, when I rebooted my phone, I saw that /data required a password to be decrypted upon a reboot. This is why we flashed TWRP. Go into TWRP and format data again.

21. Copy the "TWRP" phone from earlier back onto your internal storage. Restore your EFS in case anything has happened to your IMEI in this process.

22. At this point your phone is completely locked but with a custom recovery. To restore the stock recovery, reboot into EDL mode and replace the TWRP recovery.bin file from a few steps ago with the B20_stock_recovery.bin file you downloaded. Rename the B20_stock_recovery.bin file to recovery.bin and make sure it's in the same folder as the axon7tool.

23. Flash the stock recovery with the same commands for the axon7tool as listed earlier for TWRP.

24. Profit