[GUIDE][TREBLE][PIE][9.0] Axon 7 path to HavocOS 2.0 Pie GSI via EDL and TWRP

EBeatFLA

Senior Member
Aug 2, 2017
623
560
103
North Hollywood, CA

YOUR WARRANTY WILL BE VOID

I AM NOT responsible for anything that may happen to your phone while attempting to follow this guide.
You are doing so at your own risk, and you take full responsibility for your decisions and actions.
You are not to blame me or XDA, or any of it's respected developers.

Anyways, now that that is out of the way. Those of us who have been in the Axon 7 forums know that information is quite scattered about. So it can be difficult for any newcomers to find everything they need before making any leaps or dives with their device. This guide’s purpose is to centralize the quickest and easiest steps to follow in order to get Treblized and to get on a stable Pie GSI build that can be used as a home base before experimenting further with other ROMs and/or GSIs.
Even if you are not satisfied with the Havoc Pie GSI, your device will still be in an optimal state to try the latest Oreo 8.1 ROMs, such as LOS 15.1 or DotOS 2.5, or to try any of the other Pie GSIs in the Treble forums.

Things you will sacrifice:
No VOLTE
No Encryption
No Dolby
No Daydream
No AK4490 DAC (will default to AK4491)
Camera Flash out of sync (Use OpenCamera for flash shots)
Not able to set password for Hotspot (Open connection only)

Again, if you don't find using a Pie GSI worth these sacrifices after trying it out, you can easily move to an Oreo ROM like LOS 15.1 or DotOS 2.5, which have more functioning features.

----------------------------------------
DOWNLOAD
----------------------------------------

(NOTE: The below setup will be fluid as discussion in this thread finds more stability with newer vendor builds and newer HavocOS 2.0 GSI builds)​

After completion of this guide, your device will be setup with the following (might as well download everything):
Oki's TWRP 3.2.3.0 Lab's Mod v1.3
B20 Bootstack by DrakenFX - Modified by Verequies (Splash or NoSplash)
Oreo Modem (U, G, or Chinese)
DotOS 2.5 boot.img (This also contains the DotOS vendor, if you wish to use it)
LOS 15.1 vendor (20181110) build
HavocOS 2.0 Pie GSI (20181027) build - NOTE: Most GSIs are provided compressed. You must extract the .img file from the downloaded file.
Your preferred GApps ( https://opengapps.org/ ) (ARM64, 9.0, Micro or below only)

Also download OrdenKrieger's TWRP 3.2.3.0, going to need it handy to flash the vendor img.
And the NFC_Hotspot Fix by Kountry83 (You will need this for almost every GSI you try)

----------------------------------------
FAQ
----------------------------------------​

WHATS UP WITH THE BOOTSTACKS?
The bootstacks that are currently available for the Axon are somewhat of a mess, if not careful, you can easily brick your device.
For Pie GSI setups, I recommend the B20 bootstack by DrakenFX that has been modified by Verequies, Splash version.

Verequies has asked that I also link the NoSplash version in case some users have issues with the Splash version, but many testers have had no problems with the Splash version on this setup.

Unlike the DrakenFX B20 bootstack, these modified versions do not flash the modem, so there is no need to flash modem again when switching between them. Sometimes will need to Unlock Password in TWRP when switching though, it will say not recognized.

Splash
Ability to have Read/Write access in system.
Nice three logo splash screen, replacing bootloader warning screen.
No bootloader warning screen means not able hit volume button during boot to get menu for Recovery, Fastboot, etc.
Which also means you will have to use power button + volume up combo to enter Recovery, or reboot to recovery from the ROM.
No EDL three button combo.
Can't charge without booting system or TWRP.

NoSplash
Read Only access in system. (Which will break Magisk)
Ugly bootloader warning screen.
Able hit volume button during boot to get menu for Recovery, Fastboot, etc.
Able to use EDL three button combo.
Allows offline charging without booting into system.


WHY EDL?
Starting out with Oki’s LOS 15.1 EDL package just makes it easier for everyone. It’s easier for you because there will be less steps needed to get treblized, which will also mean less room for error. It’s easier for me because it makes for a much shorter guide, and it’s easier to find answers to issues if we all started on the same page. However, if there are enough requests, I’ll make a longer guide without the use of EDL.
If you are already treblized you won’t necessarily need to EDL (in most cases), but if you run into issues please don’t comment until you’ve tried starting with first step.

----------------------------------------
GUIDE
----------------------------------------​

STEP 1:
Please follow Oki’s Easy Guide to EDL LOS15.1
IT IS IMPORTANT TO FOLLOW EVERY STEP
Try not to boot into system while going through the steps if possible, but it’s ok if you do.
You can use @djkuz Axon 7 EDL Tool, instead of MiFlash, if you are more familiar with that.
Also, in step 12, it states to format to F2FS, but I recommend to format to EXT4 for the best compatibility with GSIs. As a precaution, to make sure your partitions will read correctly, format the partitions to F2FS per the instructions, then format them back to EXT4.
You can always test if F2FS works for you later.
Thank you @Oki for this wonderful starting point for new Treble users.​

CONGRATULATIONS - You are now TREBLIZED and should never have to do Step 1 again.

STEP 2:
Once done with Oki’s guide, stay in TWRP
Wipe Dalvik, Cache, Vendor, System and Data.
Flash the bootstack you chose.
Flash the appropriate modem for your variant.

CONGRATULATIONS - You should never have to flash those again, unless changing bootstack for whatever reason.

STEP 3:
In TWRP make sure System and Vendor partitions are mounted.
Flash the DotOS Vendor flashable.
(It doesn’t have DotOS in the file name, so it should be named something like “Vendor_Flashable_GSI…”)
In TWRP go to Install and in the bottom right select Install Image
Now we flash the Havoc GSI image you extracted, selecting the System partition.

DO NOT BOOT TO SYSTEM - We need to use OrdenKrieger’s TWRP 3.2.3.0 to flash the LOS 15.1 vendor.img
(If you wish to use the DotOS vendor, you can skip to Step 5. You will still need to reboot to Recovery, so don't skip that.)

STEP 4:
Flash TWRP 3.2.3.0 to Recovery partition and then reboot to Recovery
You should now be in TWRP 3.2.3.0
Flash the LOS 15.1 vendor.img to the Vendor partition

DO NOT BOOT TO SYSTEM - We need to restore Oki’s TWRP and flash GApps.

STEP 5:
Flash Oki’s TWRP 3.2.3.0 Lab’s Mod to Recovery partition and then reboot to Recovery
You should now be in Oki’s TWRP 3.2.3.0 Lab’s Mod
Flash GApps
Make sure System and Vendor are mounted
Flash the NFC_Hotspot Fix

NOW BOOT SYSTEM

I will wait here while you setup your device.

DONE? GOOD. Lets set up Magisk and pass SafetyNet

STEP 5:
At this time I recommend Magisk 17.2
Find it, download it, and flash it in TWRP
Once booted, in Magisk search for the module “MagiskHide Props Config” and install it.
Then search for BusyBox module by Osmosis and install it.
Reboot
Using a terminal app (not in TWRP) like Termux, type “su”
Grant root privileges
Then type “props”
You should be greeted with a menu
Select 1 to Edit fingerprint
Select F to Pick a Certified fingerprint
Then follow the menu to select ZTE and Axon 7
Then yes and yes to reboot.

Everything should be good to go now. ENJOY!!

To add just a few more options to your setup without overdoing it with a heavy launcher, I highly recommend:
Lean Launcher Optimized

I will surely be adding to this guide and modifying it as the situation evolves. So feel free to give me any input on how to improve it.

----------------------------------------
THANKS
----------------------------------------​

Thanks to @raystef66 and all of the testers in the [SUMMARY][PIE] BEST PIE ROMS to TRY thread, as well everyone in the "Axon7 (s)GSI trebleSHOOT" Telegram group, for testing, "trebleSHOOTing" and reporting your findings.
Thanks to @Oki again for his easy guide and LOS 15.1 EDL package.
Thanks to @Unjustified Dev for uploading separate vendors for us GSI users, and for all of the work he's done on LOS and his help in the LOS threads.
Thanks to @Verequies for creating the two modified versions of @DrakenFX 's B20 bootstacks, and of course @DrakenFX for his B20 and B12 bootstacks.
Thanks to @SaintZ93 for his work on DotOS and for providing a flashable for boot and vendor only.
Thanks to @SaintZ93 and @Skrem339 for their great work on the Schwifty kernel.
And thanks to @hundeva for his work on Lean Launcher.
 
Last edited:

EBeatFLA

Senior Member
Aug 2, 2017
623
560
103
North Hollywood, CA
----------------------------------------
GUIDE EDIT LOG
----------------------------------------​

11/22 - Updated that it is optional to stay with DotOS vendor and skip a step.

11/30 - Changed Step 1 to recommend EXT4 for best compatibility. Also to format from EXT4 to F2FS, then back to EXT4, to avoid internal storage error some are getting.

12/10 - Props Config module now requires BusyBox module, updated Step 5.
 
Last edited:
  • Like
Reactions: kitcostantino

JKSurf

Senior Member
Jul 15, 2015
157
48
0
Los Angeles
Thanks for the guide!

On step 4, The vendor partition doesn't show up on orden's twrp. You probably already know you can't flash with Okis twrp. Skipped this step and it booted anyway.

Don't beat me up about this but for those of us with the 50% battery bug, it happens with this method.
 

EBeatFLA

Senior Member
Aug 2, 2017
623
560
103
North Hollywood, CA
Thanks for the guide!

On step 4, The vendor partition doesn't show up on orden's twrp. You probably already know you can't flash with Okis twrp. Skipped this step and it booted anyway.

Don't beat me up about this but for those of us with the 50% battery bug, it happens with this method.
Please make sure you redownload Ordens TWRP. There are two of them with the same name out there. The one I linked should allow you to see Vendor partition. I should list this step as optional, as the DotOS vendor works, Ive just found the LOS vendor to show improvement personally. I also wanted to teach how to flash vendor.img, as there is only one way atm, using Ordens TWRP.

The vendor setup in this guide is all based off LOS sources, so any issues LOS is having that are vendor related will carry over to this setup. Sorry.
 
Last edited:

Mousman

Senior Member
Feb 21, 2011
62
5
0
Really nice guide, sadly I just flashed but one thing that I like is that you try to explain why you choose what you choose and I would really like if you could elaborate more on that for example why DotOS boot image and kernel or why LOS 15.1 vendor.

And also is there a way for me (or anyone on havoc), already on havoc but got there differently, to painlessly migrate to your setup?
 

Kleva94

Senior Member
Sep 2, 2016
68
29
0
I am using this gsi for a week and I like it a lot. It has better battery life than LOS 16 right now and you can customise so much.
And btw for me daydream works normally and I installed the ported pixel camera with night sight, which seems to work normal, too.
 

EBeatFLA

Senior Member
Aug 2, 2017
623
560
103
North Hollywood, CA
Really nice guide, sadly I just flashed but one thing that I like is that you try to explain why you choose what you choose and I would really like if you could elaborate more on that for example why DotOS boot image and kernel or why LOS 15.1 vendor.

And also is there a way for me (or anyone on havoc), already on havoc but got there differently, to painlessly migrate to your setup?
I found minor things to work better with the LOS vendor, such as GPS locking and Bluetooth not freezing display data in my car. Of course this can vary from user to user. And my preference changes as well when I find improvements with other vendors.

The DotOS vendor flashable is provided as it's the easiest way to get an up to date vendor. Otherwise you would have to download and flash an entire ROM, or extract the boot.img from that ROM, or modify the install script. Unjustified didn't provide the LOS vendor in combo with the boot.img, so the DotOS flashable is the best option as of now.

If you're already on the Havoc GSI, then you can just flash the bootstack, wipe vendor, flash DotOS vendor flashable, flash LOS vendor.img if you want (using Ordens TWRP), flash Magisk. Then boot.
It will feel like a dirty flash, but it's not, thanks to Treble.

Please do a full backup before doing so, as I think if your vendor partition was created differently, pulled from data, it might not work.
 

EBeatFLA

Senior Member
Aug 2, 2017
623
560
103
North Hollywood, CA
I am using this gsi for a week and I like it a lot. It has better battery life than LOS 16 right now and you can customise so much.
And btw for me daydream works normally and I installed the ported pixel camera with night sight, which seems to work normal, too.
I don't use Daydream, I only know what was reported by others. If more people want to test and report that it's working, I'll gladly remove it from the sacrifices.
 

piet8stevens

Senior Member
Jun 15, 2009
789
270
83
Lanaken
I don't use Daydream, I only know what was reported by others. If more people want to test and report that it's working, I'll gladly remove it from the sacrifices.
Re. sacrificing encryption, I thought LOS 15.1 vendor supports it. Is that not enough?

In other words, do you need vendor + system + rom for encryption to work? Or just system + rom? Or...?

Thx for all your work.
 

EBeatFLA

Senior Member
Aug 2, 2017
623
560
103
North Hollywood, CA
Re. sacrificing encryption, I thought LOS 15.1 vendor supports it. Is that not enough?

In other words, do you need vendor + system + rom for encryption to work? Or just system + rom? Or...?

Thx for all your work.
This particular setup will sacrifice encryption. Getting encryption on a GSI would be another path. The TWRP and bootstack options we have for our device play a part in why I find encryption to be a mess right now, and chose to move forward without it.
 

g0dzstar

Senior Member
Jan 10, 2016
96
18
0
I'm kinda having issues flashing LOS 15.1 vendor.img. I flashed Ordens TWRP, the one you provided but I do not get an option to flash to vendor partition when I choose to flash that LOS 15.1 vendor.img
 
Last edited:

EBeatFLA

Senior Member
Aug 2, 2017
623
560
103
North Hollywood, CA
I'm kinda having issues flashing LOS 15.1 vendor.img. I flashed Ordens TWRP, the one you provided but I do not get an option to flash to vendor partition when I choose to flash that LOS 15.1 vendor.img
Thanks for the guide!

On step 4, The vendor partition doesn't show up on orden's twrp. You probably already know you can't flash with Okis twrp. Skipped this step and it booted anyway.

Don't beat me up about this but for those of us with the 50% battery bug, it happens with this method.
OMG guys, so sorry, was linking to the wrong TWRP. Link updated. It's not on AFH, so if you don't trust it's a legit link and want to check, it's the same link in the LOS16 op.
Thanks for testing.
 
Last edited:
  • Like
Reactions: JKSurf

Reakleases

Member
Dec 6, 2016
23
1
0
Did everything from guide, but it seems like i don't have access to internal storage in havoc os and still accesible in twrp. Any suggestion what i did wrong?
 

juniorD

Senior Member
Oct 15, 2012
98
15
0
Nassau
Having an issue flashing the DotOS vendor file. Getting the error 7. Edited the file with Notepadd ++ and took out the assert line and deleted the empty line. Resaved and recompressed zip and tried to flash and still getting the error. Followed all the steps to this point no issues.
 

EBeatFLA

Senior Member
Aug 2, 2017
623
560
103
North Hollywood, CA
Having an issue flashing the DotOS vendor file. Getting the error 7. Edited the file with Notepadd ++ and took out the assert line and deleted the empty line. Resaved and recompressed zip and tried to flash and still getting the error. Followed all the steps to this point no issues.
Make sure system and vendor are mounted before flashing.
 

Predatorhaze

Senior Member
Feb 18, 2016
1,191
208
0
Gelderland
Having an issue flashing the DotOS vendor file. Getting the error 7. Edited the file with Notepadd ++ and took out the assert line and deleted the empty line. Resaved and recompressed zip and tried to flash and still getting the error. Followed all the steps to this point no issues.
Wrong bootstack,flash bootstack again!
Also i read in previous post,people are not wiping correctly the system with clean flash
 

juniorD

Senior Member
Oct 15, 2012
98
15
0
Nassau
Wrong bootstack,flash bootstack again!
Also i read in previous post,people are not wiping correctly the system with clean flash
Thanks for the reply.

I flashed the bootstack in the EDL package uploaded in the guide using MiFlash went through fine. Also did a clean wipe of everything and formatted my Internal Storage before I flashed the package.

---------- Post added at 07:51 AM ---------- Previous post was at 07:50 AM ----------

Make sure system and vendor are mounted before flashing.
Yup did that and checked a second time to make sure I did. They were mounted. :confused:

---------- Post added at 07:52 AM ---------- Previous post was at 07:51 AM ----------

Make sure system and vendor are mounted before flashing.
Yup did that and checked a second time to make sure I did. They were mounted. :confused: