[Treble-Enabled Device Guides, News, & Discussion] rendroid15:
Hi Guys,

I have finally successfully flashed a phh AOSP 8.1 provided in the following thread to Lenovoz5

Before proceeding, here are the basics,

Do not Ever ever ever EVER flash zui_3.9.075_Z5_L78011_multi

Bootloader needs to be unlocked only if you wantto flash custom Android 9.0 Pie roms,

If you want to stick to stock Lenovo rom, then you do not need to unlock bootloader.

If you start your phone and it says "Your device is corrupt" then your phone has zui_3.9.075_Z5_L78011_multi.

This rom is a dirty version of stock rom, that Chinese sellers sells your phone with. This is not the original rom.

Always use "L78011_CN_OPEN_USER_Q00016.0_O_ZUI_3.9.075_ST_180605_qpst" for unlocking bootloader, 075, this version is the only version that allows unlocking bootloader.

With other versions like L78011_CN_OPEN_USER_Q00016.0_O_ZUI_4.0.390_ST_180809_qpst, L78011_CN_OPEN_USER_Q00016.0_O_ZUI_4.0.200_ST_180809_qpst

This option is hidden by manufacturer under Developer options.

If you start your phone and you dont get option to activate via Wifi or Network, then your phone doesnt have stock rom and it has been tweaked by your seller.

Here is the download link for stock rom, do not use the rom that has _multi in its name.

https://mega.nz/#F!9953xR6a!76EEVKmW3LtjE7tYPF2Z1Q

If you get Sahara error when flashing through QFIL

1) Make sure your phone is in edl mode, follow the video for that

2) Make sure the config is correctly set in Settings within QFIL

3) Try changing USB ports on your PC, It only works on USB 2.0, will throw error on USB 3.0 and 3.1

Make sure you go through this thread, each and every question is answered already.

If you have any questions, make sure to list out everything you did and what you are trying to do,

My phone doesnt start

I cant proceed

I cant flash

I am stuck

I cant unlock bootloader

This doesnt help, please post full description with screenshots , what you have done to your phone after your received it from your seller, what you want,

Google the basics, bootloader unlocking, stock rom, custom rom, Android 8.0, Android 9.0 etc

I have created Lenovo z5 group on telegram, pls post there if you have any questions, i dont check xda, but i will respond on telegram whenever i can.

Check out this video on how to flash using qfil

https://youtu.be/TdkNaKpiiUw

Go through this thread and read all the posts, most of your questions is probably already answered.

I would recommend if you are not good at flashing then back up all partitions on external sd card. (WIFI and data working now :))

To backup stock partitions,

1. Unlock bootloader

2. Flash TWRP through fastboot

3. Boot to TWRP and do a full back up of all partitions.

https://xdaforums.com/project-trebl...-development/experimental-phh-treble-t3709659

All the credits for the rom goes to developers in that thread, i have only flashed it to Lenovo z5.

Flashing guide for Android 8.1: (Everything is working on Android 9.0, check out second post in this thread.)

What you will need:

ADB: https://www.mediafire.com/file/8j84x6j1g2xb8z6/adb.zip/file

TWRP.img https://drive.google.com/open?id=1yj9Vu-1YqR8kxMReP5pZerpLa-PKnZ1z

boot.img - This is the same boot.img in stock qpst from L78011_CN_OPEN_USER_Q00016.0_O_ZUI_3.9.200_ST_1807 21_qpst

or get it from here https://drive.google.com/open?id=14WNBcstAB3A40fafEhI2NWMAhGBtJge_

vbmeta.img https://drive.google.com/open?id=1dTIuxwKnfZFrE7HFtYSMqUx6gItXvxEB

ROM - system-arm64-ab-gapps-su.img from the above link

superuser flash file (To be flashed through TWRP recovery) https://drive.google.com/open?id=1w0PHZFvfYvExBAEnyDyqBpBjMGLBoLes

superuser apk(not necessary to install) https://drive.google.com/open?id=1XU9pydDRPOZ2weq14j6S-hveM98C8zHe

Procedure to Flash custom rom on Lenovo Z5:

Step 1: Flash stock version L78011_CN_OPEN_USER_Q00016.0_O_ZUI_3.9.075_ST_180605_qpst using qfil mentioned earlier in this thread

(After flashing this stock rom, if your phone goes in to boot loop then don't worry about it, continue with the rest of the process)

Step 2:Unlock bootloader (This will void your warranty) (unlocking command: fastboot flashing unlock)

Step 3: boot to bootloader

Flash with the following commands.

1. adb reboot bootloader

2. fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img

3. fastboot flash boot_a boot.img

4. fastboot flash boot_b boot.img

5. fastboot -w flash system_a system-arm64-ab-gapps-su.img

6. fastboot -w flash system_b system-arm64-ab-gapps-su.img

7. fastboot flash boot twrp.img

8. Once twrp is flashed, do not turn off or restart your phone, press volume down twice, select option boot to recovery

9. Flash superuser flash file(mentioned above)

10. Do not clear any data or cache, we already did that, Start and Enjoy!

After completing these steps please wait for about 25 to 30 mins

(My logs when i flashed the rom)

c:\adb>adb reboot bootloader

c:\adb>fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img

Sending 'vbmeta' (4 KB) OKAY [ 0.018s]

Writing 'vbmeta' OKAY [ 0.037s]

Finished. Total time: 0.079s

c:\adb>fastboot flash boot_a boot.img

Sending 'boot_a' (52261 KB) OKAY [ 1.795s]

Writing 'boot_a' OKAY [ 0.037s]

Finished. Total time: 1.842s

c:\adb>fastboot flash boot_b boot.img

Sending 'boot_b' (52261 KB) OKAY [ 1.798s]

Writing 'boot_b' OKAY [ 0.036s]

Finished. Total time: 1.843s

c:\adb>fastboot flash system_a system-arm64-ab-gapps-su.img

Sending sparse 'system_a' 1/3 (524284 KB) OKAY [ 18.954s]

Writing sparse 'system_a' 1/3 OKAY [ 0.006s]

Sending sparse 'system_a' 2/3 (488160 KB) OKAY [ 20.940s]

Writing sparse 'system_a' 2/3 OKAY [ 0.005s]

Sending sparse 'system_a' 3/3 (514508 KB) OKAY [ 21.349s]

Writing sparse 'system_a' 3/3 OKAY [ 0.010s]

Finished. Total time: 68.562s

c:\adb>fastboot flash system_b system-arm64-ab-gapps-su.img

mke2fs 1.44.3 (10-July-2018)

Creating filesystem with 12466167 4k blocks and 3121152 inodes

Filesystem UUID: 98e2d366-b46f-11e8-9d3d-3d9d543f2291

Superblock backups stored on blocks:

32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,

4096000, 7962624, 11239424

Allocating group tables: done

Writing inode tables: done

Creating journal (65536 blocks): done

Writing superblocks and filesystem accounting information: done

Sending sparse 'system_b' 1/3 (524284 KB) OKAY [ 19.159s]

Writing sparse 'system_b' 1/3 OKAY [ 0.037s]

Sending sparse 'system_b' 2/3 (488160 KB) OKAY [ 20.708s]

Writing sparse 'system_b' 2/3 OKAY [ 0.007s]

Sending sparse 'system_b' 3/3 (514508 KB) OKAY [ 21.250s]

Writing sparse 'system_b' 3/3 OKAY [ 0.007s]

Erasing 'userdata' OKAY [ 3.849s]

Sending 'userdata' (4348 KB) OKAY [ 0.167s]

Writing 'userdata' OKAY [ 0.007s]

Finished. Total time: 73.993s

c:\adb>fastboot flash boot twrp.img

Sending 'boot_a' (58524 KB) OKAY [ 2.021s]

Writing 'boot_a' OKAY [ 0.007s]

Finished. Total time: 2.041s

c:\adb>adb reboot bootloader

c:\adb>fastboot erase cache

Erasing 'cache' FAILED (remote: 'Check device console.')

Finished. Total time: 0.013s

Not working:

Notification LED (Thanks to DarkerMaster)

Pictures taken by camera are always 90 degrees rotated

Google Camera app is crashing

Working on Android 8.1:

Call

Camera

Fingerprint reader

WIFI

Mobile data ...

Almost everything

I am still testing the device. I will post details later.

Android 8.1

https://drive.google.com/open?id=1k1bgp3sLedy-e5vqYKZF47WXRIVfO-tN

https://drive.google.com/open?id=11RAiDNS-1_bv7ceYJDLriOuGtMIkfbXt

https://drive.google.com/open?id=1hDrJHaKKHhowWJSvVUN3Y9scZeCMMLIz

https://drive.google.com/open?id=1bvKErzYwF9qH87Leie_acnwElINM8qxQ

https://drive.google.com/open?id=1Sg5mHLgm6_Bl4xz3ZBrgq7sLDbrveGWg

https://drive.google.com/open?id=1XxaiVKaImXZ64mH-TwuXcXNEFaTn2ydK

https://drive.google.com/open?id=1ABII2x3hWMKwgTr8mVxI-cYTiej1lVlN

https://drive.google.com/open?id=1rn7CXYnhiiiDBYoF_K1us9vXjgTMOigq

Imp:

If you have flashed one of these Roms, and you can boot in to it successfully, please do not use Factory reset. If you do, then the rom wont boot, since Magisk/SU is installed.

If you still do, then boot to Bootloader, flash vbmeta, boot_a, boot_b, twrp, Magisk(Android 9)/SU(Android 8).

If you have unlocked bootloader, do not relock it, ever

Special Thanks to phhusson for his [AOSP 8.1] [2018-08-16] Phh-Treble

Experimental:

Zui FM Radio app (Not working yet!)

Please note this is still under development, i am only posting it here, if anyone wants to work on it.

https://drive.google.com/open?id=1raHCHhMxOQVM8L0rbSjoKeTVLmbtBSIc

Don't forget to hit that Thanks button !

Cheers :)