Alternative installation guide for the ZTE Axon 7 (proposal)

Hello!

Having recently heard of /e/ OS through a friend, and this being what I had been looking for, I bought a ZTE Axon 7 to install it. The installation procedure seemed straightforward enough (https://doc.e.foundation/devices/axon7/install), so I sat down one evening to set up my new phone (as far as I can tell, there is no easy-installer for this device yet). Long story short, it took me a day and a half and I had to fight every step of the way (I even thought I’d hard-bricked my device at some point). Although I do not install custom Android OSes every other day, I have “hacked” every tablet and smartphone I have ever owned – admittedly not many, but I reinstall custom OSes from time to time – so I do have some experience and I never encountered so many problems following installation instructions.

The solution, for me, was to unlock the bootloader and install TWRP recovery using a program developed by XDA’s djkuz that uses Qualcomm’s Emergency Download mode (EDL): Axon 7 EDL Tool (https://forum.xda-developers.com/axon-7/development/axon-7-edl-tool-flash-backup-restore-t3750759); this nifty little program requires no install and worked like a charm. However, this is a windows-based solution so it will not suit every user. I then used TWRP recovery’s sideloading feature with GNU/Linux to flash the ROM. Now my phone works fine and I am delighted to have /e/ OS on it.

I would therefore like to propose a new installation guide – or at least (since this procedure requires Windows) an alternative one, for those who might encounter similar problems (there are at least two users who opened topics on the forum relating to issues I address in my proposal). I have compiled these instructions in a text file but cannot attach them at this time (new user). If anybody is interested, should I post them here in a follow-up post or should I e-mail them to a specific address for reviewing?

However, I did not anticipate the ordeal I went through when I began, so I only wrote them down after the fact, from memory. And now that my phone is finally working, I am not keen on resetting it on purpose. I did check everything I could short of reinstalling, but it would probably be better if someone went through the process to make sure it works, not least because I took the long route, with lots of back-and-forths and hits and misses, so there is always a chance that I forgot something or that one of the things I did changed something on the way (and also to check that these instructions work with a different computer and phone). Would somebody with a spare (or new) Axon 7 phone be willing to test these instructions (and document any errors so that I can try to troubleshoot them and update this installation guide accordingly)?

Thank you for your attention!

LCNR

Hi @LCNR you can post the guide here in this thread so that other users of the Axon 7 can also validate it. Once it is validated we will add it to the documentation site.

Hello!

@Manoj: Thank you for your reply. I will be posting the proposed instructions in my next post.

NOTA: The proposed guide naturally includes a lot of links, so I’m not quite sure how they will appear (as I understand it, I’m not allowed more than two links per post at this time). Also, it includes some personal comments which should of course be removed prior to publishing. And finally, formatting is very basic at this point as I wrote it in a basic text editor (gedit), but I intend to improve it once it is finalised.

Once (if) validated, I can provide a French translation (and possibly a German one, too, subject to doing some terminology-related research first).

Thanks!

INSTALLING /E/ OS USING XDA’S DJKUZ’S AXON 7 EDL TOOL ON A WINDOWS-BASED SYSTEM AND THEN ADB SIDELOAD ON ANY SYSTEM

  • First, read djkuz’s post carefully ([link]) and make sure you understand what you’re getting into and the risks associated with fiddling around with your phone. Especially be aware that you might brick your device (though be sure not to give up straight away if you think you might’ve bricked it: it might just be stuck in a certain mode and still be recoverable.)

  • Then read through the entire set of instructions at least once before you start to make sure you understand what you’re doing and to get an idea of the whole process.

  • Understand that you are proceeding at your own risk and under your own responsibility.

A) DOWNLOADING THE REQUIRED SOFTWARE

  1. Download the Axon 7 EDL Tool from the link at the end of the first post ([link]), then extract the ZIP file and copy the folder to root (usually in C:\ or D:). (While you’re at it, also download the stock firmware from the link towards the middle of the post. Click the “Click to show content” button and select the firmware for your device. This will be helpful if something goes awry and you need to revert to stock ROM/recovery.)
  • NOTA: There is another toolkit available on XDA (that I’m aware of), bkores’s Axon7Toolkit ([link]). I haven’t used it though, because djkuz’s tool more than covered my needs. Moreover, bkores’s toolkit requires installing whereas djkuz’s is portable.
  1. Download a compatible version of TWRP recovery. I used XDA’s NFound’s TWRP Exclusive ([link]); it’s customized towards the Axon 7 and offers a lot of useful features (including removing the warning message you otherwise get each time you reboot after unlocking the bootloader). There are probably other (including more recent) TWRP options you can use that will do the work just as well or maybe even better, but for me that one worked (and at that point I was inclined to say that if it ain’t broke and /e/ OS is installed, don’t fix it). Make sure you download version 3.2.1-7 (for Nougat).

  2. Download the /e/ ROM’s latest build from here: [link]

  3. If they aren’t already installed on your system, download and install the ADB and Fastboot tools (you will find guides on the web or the XDA forums, for example here: [link]).

  4. OPTIONAL: If you intend to root your phone using Magisk, download both the Magisk package and the Magisk Manager APK here: [link]

B) INSTALLING TWRP RECOVERY ON YOUR PHONE USING DJKUZ’S AXON 7 EDL TOOL ON A WINDOWS-BASED SYSTEM

  1. If you have a working phone, turn it on and, once the system has loaded, plug it into your computer running Windows to make sure the drivers are installed.

  2. Turn your phone off and boot it into Factory Test Mode (FTM) by pressing and holding the Power button and the Volume Down button at the same time. If it isn’t already, plug it into your computer.

  3. Launch the Axon 7 EDL Tool as an administrator by opening the folder, right-clicking on “Axon7_EDL_Tool.bat” and selecting “Run as administrator”.

  4. After reading the Warning and the Information, press “Y” for Yes. The program should find your phone after a short “Wait”; a “Phone is connected” message will appear in a banner near the top of the window (listing the connection’s Port, Name, Settings, and Mode) and you will be presented with the Main Menu. If your phone isn’t recognized (a “Phone not found” message will appear in the banner instead and the connection’s listing will show “no data”), check that it is in FTM and correctly plugged in to the computer (if you’ve just plugged it in, wait a little bit to give the computer time to recognize it) and then press any key in the program to search for the phone again. If your phone still isn’t recognized by the program, reboot it into FTM (Power button + Volume Down button) and then press any key in the program.

  5. Now your phone is recognized by the Axon 7 EDL Tool, let’s first do a full backup of all partitions. In the Main Menu, press “2” for Backup. In the Backup menu, press “1” for Backup all partitions and then, when asked “Do you want to start backup?”, on “Y” for yes, then wait for the process to complete, which might take a little while. You should get a “Done” and then a “Success” message. For safety’s sake, copy the contents of “Axon7_EDL_Tool\backup\all” to another location (so you have a copy if you accidentally delete the tool’s folder without backing up the backup first).

  6. Copy the TWRP IMG file to “Axon7_EDL_Tool\flash\recovery” and rename it to “recovery.img”.

  7. Back in the program, in the Main Menu, press “1” for Flash and then, in the Flash menu, press “3” for Flash Recovery. When asked “Do you want to start flash?”, press “Y” for yes and then wait for the process to complete. You should get a “Done” and then a “Success” message if all goes well.

  8. Quit the program and reboot your phone into recovery by pressing and holding the Power and Volume Up buttons together.

  9. When prompted, swipe to allow TWRP to do modifications to your device (otherwise it might get replaced by the stock recovery at the next start-up); you can tick the “Do not ask again” box if you want to permanently allow modifications to the system, otherwise you’ll have to confirm this every time you boot into recovery during the /e/ OS installation process.

  10. Go back to the Home menu and tap “Reboot” then “Power off”.

C) UNLOCKING THE BOOTLOADER USING DJKUZ’S AXON 7 EDL TOOL ON A WINDOWS-BASED SYSTEM

  1. Start your phone in FTM by pressing and holding the Power and Volume Down buttons together. If it isn’t already, plug it into your computer.

  2. Launch the Axon 7 EDL Tool as an administrator by opening the folder, right-clicking on “Axon7_EDL_Tool.bat” and selecting “Run as administrator”.

  3. After reading the Warning and the Information, press “Y” for Yes. The program should find your phone after a short “Wait”; a “Phone is connected” message will appear in a banner near the top of the window (listing the connection’s Port, Name, Settings, and Mode) and you will be presented with the Main Menu. If your phone isn’t recognized (a “Phone not found” message will appear in the banner instead and the connection’s listing will show “no data”), check that it is in FTM and correctly plugged in to the computer (if you’ve just plugged it in, wait a little bit to give the computer time to recognize it) and then press any key in the program to search for the phone again. If your phone still isn’t recognized by the program, reboot it into FTM (Power button + Volume Down button) and then press any key in the program.

  4. Now the program has found your phone, in the Main Menu, press “4” for Unlock. In the Unlock menu, press “1” for Bootloader Unlock and then follow the instructions until the process is complete. If something goes wrong during the process, try again.

  5. Press “Y” to reboot your phone. If evertything went well, you should get a “bootloader unlocked” warning when booting normally (if you don’t, it means your phone isn’t unlocked). As soon as you see this message, press one of the volume buttons to enter a menu. Press one of the volume buttons until “Reboot into recovery” is displayed then confirm by pressing Power.

  6. OPTIONAL: Once back in recovery, you can remove the bootlocker warning on startup by tapping “Advanced”, “More…”, “Del inscription” and then swiping.

D) INSTALLING /E/ OS ON YOUR PHONE USING ADB SIDELOAD ON ANY SYSTEM

  1. If you sideload the /e/ ROM you downloaded as is, you probably will get an code 7 error message; this means the program believes the OS you are trying to sideload is not suited for your phone model. However, the file available from the link above should contain the correct OS so, in our case, it is a false positive (due, as I understand it, to the name of the phone model being omitted in the file the installation program invokes to check the package’s compatibility). To circumvent this, we have to edit a file in the package:
  • a) Open the ROM’s ZIP file and navigate to the “/META-INF/com/google/android/” folder.

  • b) Make a backup copy of the “update-script” file.

  • c) Open the update-script file with a text editor (if using GNU/Linux, open it with root access – i.e., using the “sudo” command in a terminal – so you can save the changes).

  • d) Delete any lines beginning with “assert” (they are usually towards the top of the script), from and including the word “assert” to the closing “;”.

  • e) Save the changes and close the file. (In Windows, make sure there is no “txt” extension after the filename. If there is, remove it.)

  1. Boot your phone into recovery mode by pressing the Power and Volume Up buttons at the same time. If it isn’t already, plug it into your computer.

  2. Tap Wipe then Format Data. Type in “yes” and confirm.

  3. Go back to the Wipe menu and tap Advanced Wipe. Select System and Cache by tapping on them, then swipe to wipe.

  4. In the Home menu, tap “Advanced”, “ADB Sideload”, then swipe to enter ADB sideload mode.

    • LINUX: Open a terminal (CTRL+ALT+T) and navigate to the folder where the /e/ ROM ZIP file is located using the “cd” command.
    • WINDOWS: Copy the /e/ ROM ZIP file to the folder where the ADB and Fastboot exe files are located, then open a command-line interface by pressing WIN+R then typing “cmd” and pressing enter. In the command line, navigate to the ADB and Fastboot folder with the “cd” command (e.g., “cd C:\folder\adb_and_fastboot_folder”).
  1. To make sure your phone is detected, type in “adb devices”. Your device’s ID number should be displayed followed by “sideload”.

  2. Type in “adb sideload filename.zip” (where “filename” is the name of the /e/ ROM file). The file should start sideloading (you will see a progress meter on the computer and a progress bar on your phone). Wait until the process is completed, which sould be when the progress bar on the phone is full and the progress meter on the computer reaches (around) 47 %. You will know if the file has been successfully sideloaded because you will get the following messages “adb: failed to read command: Success” and “Total xfer: x1.00”. Anything different means the transfer has probably failed; in that case, just go back to step 1 and retry sideloading (it took me three tries before it worked).

  • NOTA: You might notice the sideload appears to progress about twice as fast on your phone than on your computer (as I understand it, this is because Google files, for which the sideloading tool was originally developed, are transferred approximately 2.2 times, whereas other files, including this one, are copied over only once). Therefore, when your phone indicates sideloading is complete, your computer will show the transfer at around 47 % complete. THIS IS NORMAL AND EXPECTED, provided you get the messages mentioned above.
  1. Once sideloading has completed successfully, tap “Reboot system” (or go back to the Home menu, tap “Reboot” and then “System”). You might get a “No OS installed” warning, but disregard it if sideloading has completed successfully. Swipe to confirm.

  2. After the ZTE logo, the “e” logo with the bouncing dot should appear. Be patient, first system start-up should last quite a while (I counted about 200 bounces).

  3. If you get the setup wizard, you’re done. However, more probably than not, right after the “My data is MY data” message, you will get the following message: “To start Android, enter your password” (this is apparently due to the forced encryption of the data partition under Android from Nougat onwards). Of course, since this is a clean install, no password has been set so you can’t get past it. Just type in any string of at least five characters and confirm.

  4. You should now get a “Decryption unsuccessful” message informing you that you must perform a factory reset in order to resume using your phone. Tap “Reset”: the phone will in fact just reboot.

  5. When the screen goes black, press and hold the Volume Up button to boot into recovery.

  6. Once in recovery, tap “Wipe”, then, just to be sure, select “Format Data” and swipe.

  • NOTA: XDA’s NFound’s TWRP Exclusive version 3.2.1-7 includes a dm-verity removal tool. As I understand it, this is supposed to remove the forced encryption which causes the phone to ask you for a decryption password. It did not work for me, but maybe that is because I did not use activate the option at the right time. Before you go to the next step, you can try removing dm-verity by going back to the Home menu, tapping “Advanced”, “More…”, “No dm-verity”, swiping to remove dm-verity, them rebooting your phone into system. If you get to the setup wizard without being asked for a password, that means it has worked. Otherwise, go back to step 10 and carry on to the end of these instructions.
  1. Go back to the Wipe menu, tap “Advanced Wipe”, select the Data partition by tapping “Data”, then tap “Repair or Change File System”, “Change file system”, “EXT4”, and swipe to change.

  2. Reboot your phone into the system. This time, it should boot straight into system without asking you for a password (though it might take some time again; just be patient).

  • NOTA: When I tried changing the filesystem back to F2FS in recovery after booting into the system in EXT4, I got the encryption password request again, so I had to revert to EXT4. This might be related to my not removing dm-verity at the appropriate time (see the NOTA under step 13). I have not investigated this issue further as my phone is working fine with EXT4.
  1. Follow the setup wizard and enjoy your new /e/ OS phone! :smiley:

E) OPTIONAL: ROOTING YOUR PHONE WITH MAGISK

To root your phone, you can use either SuperSU or Magisk. For an overview and the pros and cons, do a web search (for example, on XDA: [link]). Magisk is the more recent rooting option, however, and seems to have superseded SuperSU. In this case, we will be rooting the Axon 7 with Magisk.

  • NOTA: If you have installed XDA’s NFound’s TWRP Exclusive, do not use TWRP to root your phone as it will install an older version of Magisk that is not compatible with the newer versions of Magisk Manager.
  1. Boot into /e/ OS.

  2. Go to Settings>Security and allow the installation of apps from unknown sources by activating “Unknown sources”.

  3. Plug your phone to your computer, put it into File Transfer mode and copy the Magisk Manager APK to the location of your choice on the phone.

  4. On your phone, using a file manager, navigate to the folder where the Magisk Manager APK is located and tap the file.

  5. Install Magisk Manager.

  6. Open Magisk Manager. (If you experience problems such as flickering or crashing, try rebooting your phone.)

  7. When prompted, follow the instructions to install Magisk, thereby rooting your phone (the first two lines on Magisk Manager’s home page should be ticked in green).

Thanks @LCNR!
With the help of your installation guide I was able to install /e/ OS 0.14-n-2021013099019.
I did not follow your guide from start to finish because I found it to late. After a few hours of trying to get into fastboot, unlocking the boorloader and installing TWRP following the official guide and trying a lot of other things including EDL tool etc. I began installing /e/ OS but it gave an error 7.

Starting ADB sideload feature…
Installing zip file ‘/sideload/package.zip’
Unmounting System…
Checking for TZ version TZ.BF.4.0.1-00315
assert failed: axon7.verify_trustzone(“TZ.BF.4.0.1-00315”) == “1”
Updater process ended with ERROR: 7

I was able to finish the install by editing the “update-script” file (step D 0 in the guide). But after the phone rebooted and the e with the bouncing dot appeared I got a black screen after a few bounces. (I was never asked to enter a password)

Then I rebooted again in TWRP and changed the filesystem of the data partition to EXT4 (step D 14 in the guide).

And now my phone booted with the /e/ OS.

A belated welcome to /e/ on the Axon 7. Always nice to see folks trying out the OS on this device.