[ZTE Axon 7 Guides, News, & Discussion] ScaryBugThing:
This guide shows how to install TWRP and Magisk even starting from firmwares after B19 A2017U firmware (starting B25, ZTE removed Fastboot). As always read the ENTIRE directions before beginning. If you'd like to try a faster method, see instead King1990's Alternate Method posted below steps A, B and C.

Step A involves downgrading your OS to B19. If you are on B25 or higher currently, you must not skip this step. If you are on B19, skip this step.

Step B is upgrading to B32 on an unlocked system, retaining Fastboot and the Recovery by using DrakenFX's method.

Step C is installing Magisk.

STEP A: FLASH TO B19 WITH TWRP USING EDL MODE

NOTE: This assumes you are unlocked. If you need to unlock starting from a firmware later than B19, please follow the EDL Unlock instructions at the EDL Thread, or use the Axon7Toolkit unlock, which is essentially the same but may be easier for some.

1. Install MiFlash using the EDL thread

2. Install the QUALCOMM drivers linked in the same thread.

3. Download "B19-NOUGAT_FULL (Nougat 7.1.1)" from the same thread.

4. Extract the ZIP file.

5. Open MiFlash, select the named sub-folder from the ZIP

6. Connect Axon 7 via a USB cable, and hold VOL-UP/VOL-DOWN/POWER until the screen goes black and the red notification LED blinks very intermittently (~1 time per 4 seconds) to get it in EDL mode.

7. Hit Refresh in MiFlash and confirm device is shown in list.

8. Hit Flash in MiFlash to flash it. (This rolls back your device to B19 stock)

9. Repeat Steps A.3-A.8 for "B19-NOUGAT_TWRP (Nougat 7.1.1)," found in the same EDL thread (to get TWRP).

10. After EDL flashing B19-NOUGAT_TWRP (Nougat 7.1.1), hold Power+VolUp when boot into TWRP. At the first warning screen, slide to allow modifications, but DO NOT BOOT INTO THE ROM until you complete the next step re: no-verity.

11. Tap Mount, and then Mount the phone via MTP in TWRP. Transfer over the latest (5.1 at time of writing) no-verity-opt-encrypt-5.1.zip file from this link (original thread) to your phone via MTP. Flash this file using the "Install" command in the TWRP main menu.

Troubleshooting Notes:

If bootup freezes at the very first screen after the ZTE logo ("Start - Continue to Boot..."), you probably have either (1) not properly flashed the B19 FULL before the TWRP folder, or (2) enabled changes in TWRP without flashing the zip in Step 11. If so, start over from the beginning, reinstall B19 FULL and TWRP via EDL. If you cannot boot into the system, this is likely your only option.

If you are stuck on a bootup screen that says "To start android, enter your password": You have probably mistakenly started a normal boot after flashing the B19 FULL but before flashing TWRP. Do not attempt to enter a password, simply get back into EDL mode to flash the TWRP folder for Step A.9. Do this by either holding VOL+/VOL-/POWER, or by using the ADB command if available, "adb reboot edl" . If you are in-between steps and having trouble finding a part of the boot sequence that ADB receives commands, try opening an ADB console on Windows and entering "adb devices -l" to see if your device is visible to ADB at either the bootloader itself (VOL+/POWER), or the main root TWRP screen. (Worst case, if TWRP is not installed, but if you can access Fastboot, put the TWRP .img file in the same directory on your PC as your ADB/Fastboot .exes, rename to "recover.img" and use the command "fastboot boot recovery.img" to temporarily boot into TWRP.)

If MiFlash cannot flash to your device even when it can see your device: If you can access ADB, try the command "adb reboot edl" . Some Axon 7 phones apparently do not correctly enter EDL mode when holding VOL+/VOL-/POWER, and although visible to MiFlash cannot be flashed unless a software command puts the phone into EDL. Alternatively, Axon 7 Toolkit can do this - select Option 10 when ADB is active.

If you follow this guide and receive a ctsProfile mismatch error when running a SafetyNet check in Magisk, you likely had some remnant of a prior SU installation that is triggering the error. Please follow the steps in this troubleshooting guide: https://android.gadgethacks.com/how-to/magisk-101-fix-safetynet-cts-profile-mismatch-errors-0178047/

STEP B: UPDATE TO B32

Important: You cannot use the update process in Mifavor to update, or you will lose fastboot. Instead, any updates must be flashed via TWRP.

1. Go to DrakenFX's thread and follow the instructions. Relevant portion added below for simplicity.

2. Download and move to your phone (Internal or SD):

- A2017UV1.1.0B32_bootstack_by_DrakenFX.zip

- A2017UV1.1.0B32_StockSystem_by_DrakenFX.zip

3. Boot into TWRP, and Wipe Cache, Dalvik, and Data

4. Flash ("Install" in TWRP) A2017UV1.1.0B32_bootstack_by_DrakenFX.zip, then install A2017UV1.1.0B32_StockSystem_by_DrakenFX.zip.

5. Flash the no-verity-opt-encrypt-5.1.zip file again from this link (you should already have this on your phone from Step 1 above)

STEP C: INSTALL MAGISK ZIP VIA TWRP

NOTE: If you have performed this with the 13.6 Beta per my earlier guide, simply download Magisk 14.0 within the Manager app and then flash 14.0 in TWRP to update. For new installations, flashing directly the 14.0 ZIP file should be fine. Any Magisk before 13.6 Beta will likely no longer work.

1. This guide assumes you have a clean image with NO SU. (If you have used SuperSU or another SU, you will need to either reset/reflash a clean image, or uninstall it sufficiently. If you have a prior Magisk, there is a Magisk Uninstall tool (here You can proceed without flashing a clean image using that tool, included in Step 3b below.)

2. Download the latest Beta Magisk ZIP file ("Magisk-v14.0.zip") in the main Magisk thread. I have also attached it to this thread for convenience. NOTE that this ZIP file also automatically installs Magisk Manager, so you do not need to download or install it separately in Android.

3. Go to TWRP, and install the Magisk-v14.0.zip. Clear Dalvik/Cache after install.

4. Reboot into stock, and open Magisk Manager which should be installed now automatically. Magisk Hide should be auto enabled, MagiskSU 14.0 should be installed, and all checks should pass including SafetyNet. Catch all the Poke-mans and Pay all the Androids.

Please make a TWRP backup before attempting, and be ready to roll back if needed.

Alternate Method (Thanks to King1990)

This method may be quicker, so you may prefer to try this method first, or as an alternate if the above method is too complex or doesn't work for you:

*these steps only if you are already unlocked your bootloader first UNLOCK *

*Note: it does not matter if your on stock B25 or B32 or any custom roms just follow the steps below*

*Backup first*

1- Download & install Axon7toolkit 1.2.1,install drivers & ADB from the tool (option 1).

2- using the tool, choose option 11 & follow the instructions to flash "A2017U_B19-NOUGAT_FULL_EDL" using Miflash (Axon7toolkit will start Miflash)

3- if the flashing was successful reboot your phone

4- now update using OTA to B25 then again update to B32 through OTA .

5- now you have completely stock B32 , you will also lose fastboot command

6- Reboot to EDL

7- Start Miflash directly it should be here "C:\Program Files\Xiaomi\MiPhone" & Click on refresh , a COM port should appear

8- in the target white bar, paste this destination "C:\Axon7Development\Axon7Toolkit\miflash\unlock\FASTBOOT_UNLOCK_EDL_N" & click flash, if succeed reboot & you should now have fastboot commands

9- again use Axon7toolkit & choose option 9 to flash TWRP , follow the instruction and you should have TWRP.

10- start the system then reboot to recovery and flash magisk 14.0 check for safety net if fails just reboot your phone & it will pass.

11- done.

Previous threads and guides

(Previous Thread)

-----------

(Previous Magisk and OTA process - DO NOT USE)

STEP 2: INSTALLING MAGISK 13.2 WITH ROOT AND SAFETYNET PASS

1. This guide assumes you have a clean image with NO SU. (If you have SuperSU or another SU, you will need to either reset/reflash a clean image, or uninstall it sufficiently. If you have a prior Magisk, there is a Magisk Uninstall tool. You can proceed without flashing a clean image using that tool, included in Step 3b below.)

2. Enable Settings->Security->Unknown Sources in stock.

3. Download Magisk Manager 5.0.6 and Magisk 13.2 (here, and attached for convenience), and copy them to your device. (Note that you can also just install Magisk Manager 5.0.6 and download the latest Magisk flashable ZIP from there.)

(3b. If you already have a prior Magisk & Manager installed, also download Magisk Uninstall (here, attached for convenience) and copy it to your device. Boot into TWRP, and "Install" (flash) Magisk Uninstall. Boot into system, and uninstall Magisk Manager. Clear Dalvik/Cache after each step.)

4. Install Magisk Manager v5.0.6 via File Manager direct as an APK.

5. Go to TWRP, and install the Magisk 13.2.

6. Reboot into stock, and open Magisk Manager. You should see both Magisk and Root installed (Root as "Magisksu"). If you try SafetyNet right now, it will fail.

7. Go into Settings in Magisk Manager and enable MagiskHide.

8. Reboot into TWRP, and flash the Magisk 13.2 SafetyNet Fix, attached. Reboot.

9. Now if you check SafetyNet, it should pass.

STEP 3: GET OTAS (EXPERIMENTAL)

There are still issues with B19 to B25 upgrades with Magisk using OTA packages, (such as those by DrakenFX).

Prior to the SafetyNet update (Magisk 13.0 beta), users reported partial success - if they installed Magisk successfully on B19, and gave root permission as needed, they could upgrade to B25 and retain old root permissions but NOT add new permissions for apps. I have not seen it tested whether this is still true after the SafetyNet update (Magisk 13.2).

----------

(Previous Original Guide - DO NOT USE)

If you are only here for Magisk: Despite all the horror trying to get it to work with 12.0 and earlier versions, it should flash fairly easily using versions later than the 20170520 beta and 13.0 beta Magisk Manager.. But since the 20170520 files are the only version I've tested, I can only vouch for those files and they are specifically mentioned in the guide.

NOTE: This assumes you are starting at B25, but the instructions should work for any B version number, since MiFlash is going to force us to B19.including how to install Magisk successfully - only new beta versions will install, and I've only tested the 20170520 build with Magisk 13.0 beta, but it worked entirely as intended. Below are the steps needed, and below that is my old post (hidden) for posterity in case it helps troubleshoot later if something breaks.

STEP 1: FLASHING FROM B25 TO B19 USING EDL MODE:

1. Install MiFlash using the EDL thread

2. Install the QUALCOMM drivers linked in the same thread.

3. Download "B19-NOUGAT_FULL (Nougat 7.1.1)" from the same thread.

4. Extract the ZIP file.

5. Open MiFlash, selected on the named sub-folder from the ZIP

6. Connect Axon 7 via a USB cable, and hold VOL-UP/VOL-DOWN/POWER until the screen goes black and the red notification LED blinks very intermittently (~1 time per 4 seconds) to get it in EDL mode.

7. Hit Refresh in MiFlash and confirm device is shown in list.

8. Hit Flash in MiFlash to flash it. (This rolled back my B25 device to B19 stock)

9. Then do the same process again with "B19-NOUGAT_TWRP (Nougat 7.1.1)," found in the same EDL thread (to get TWRP). ALTERNATIVELY, you can use the Toolkit to install TWRP, or via ADB, or any other method.

Note that first I just downloaded the TWRP version, and TWRP successfully installed and I could boot into TWRP, but it would totally freeze before loading the OS ROM every time. You MUST flash the B19 FULL first to avoid this.

Also, if any of these steps fail, install the Toolkit and use the same operations in the Toolkit. I used v. 1.2.0 for both the EDL flashing and to install TWRP as well, since on a later A2017U, the button restart method appeared to put me in a halfway-EDL mode which was visible from MiFlash, but did not allow flashing. In that case, a software EDL reset ("adb reboot edl" or "reboot edl" in the TWRP console) was the only way to get MiFlash to allow it to flash. The Toolkit does this nicely.

STEP 2: INSTALLING MAGISK 13.0 BETA WITH ROOT AND SAFETYNET PASS

1. Make sure you have a clean image with NO SU (PHH or MagiskSU or otherwise), and NO Magisk/Magisk Manager installed.

2. Enable Settings->Security->Unknown Sources in stock.

3. Download Magisk Manager 20170520 13.0 beta and Magisk 20170520 (here, and attached for convenience) (full beta thread here if needed), and copy them to your device.

4. Install Magisk Manager 20170520 13.0 beta via File Manager direct as an APK.

5. Go to TWRP, and install the Magisk 20170520 beta (here, and attached for convenience)

6. Reboot into stock, and open Magisk Manager 13.0. You should see both Magisk and Root installed (Root as "Magisksu"). If you try SafetyNet right now, it will fail.

7. Go into Settings in Magisk Manager and enable MagiskHide.

8. Now if you check SafetyNet, it should pass.

Note that the temporary beta builds appear to only be available for a short time, so either use the files attached, or go ahead and try the latest beta build. The first build I tried, 20170520, worked. Again, my guess is all beta builds or full builds after 20170520 will work with the instructions above, but feel free to test.

STEP 3: GET UPDATES / GO TO B25: I have not tested yet to ensure Magisk doesn't break, but I believe you should be able to download OTA packages, such as those by DrakenFX and flash them. However, users are reporting some bugs upgrading beyond B19, so OTAs are a work in progress. Please make a TWRP backup before attempting this and be ready to roll back if needed.

6bolt2g reports he had success moving from B19 (rooted) to B25, with the following steps: (a) flash "the DrakenFX B25 flashable zip's and the no-verity zip to keep TWRP"; and (b) follow STEP 2 above. However, 6bolt2g and StickMonster report that after upgrading to B25, you may experience problems with adding apps not previously whitelisted. Again, this is not verified by me but reporting it in the first thread for convenience.

For now, applying OTAs beyond B19 should be considered experimental - please be aware of the risk and have a backup before trying, and share your results here.

Changelog

Edit 5/21/2017: Added additional steps to Magisk to show process after flashing in TWRP.

Edit 5/23/2017: Added 6bolt2g report re: moving from B19 to B25.

Edit 5/24/2017: Added additional updates re: OTAs.

Edit 7/17/2017: Revised based on new ~7/12 Google SafetyNet changes, new Magisk from 5/15, and SafetyNet fix

Edit 9/3/2017: Added additional alternate solutions and troubleshooting advice.

Edit 9/4/2017: Revised process for B32, Magisk 13.6 Beta.

Edit 9/10/2017: Revised process for Magisk 14.0.

Edit 9/17/2017: Added King1990's alternate method.