[ROM][Treble][microG]LineageOS 16.0 for HUAWEI P9

NervReaper

Senior Member
May 19, 2015
95
38
18
Weird, I can engage the AP and make a network appear on my computer's WLAN scanner when I'm using Phh-Treble. Haven't tried other GSIs. Shame that the "Open"Kirin guys are so secretive, if they weren't like that we would already be running all the ROMs we wanted to with few issues, but alas they have all the right to withhold their work from us. I'm about to release a joint fix ZIP that will make Pie ROMs bearable in the meantime that fixes offline charging, NFC, ROM features and adds the device overlay, if you flash it between the GSI and the gapps then it should behave like the OK ROM.

Also, modern Treble ROMs only modify the system partition. The vendor partition and the kernel are separate and stay untouched by the OS.
SafetyNet it's ok for you? Last time I've tried phh-treble, i didn't make it pass. Safety net and the battery drain are the only reasons cause i prefer stock over GSI.

Sent from my Huawei P9 using XDA Labs
 

Wattsensi

Senior Member
May 13, 2018
221
34
0
Talca
Yeah. On the P9. EVA-L09. Firmware 8.0.0.540 Patch02. Oreo vendor. Hotspot working, on Phh-Treble v119 downloaded from the release tag. I don't have enough computer power to build Android for ARM64 myself, unfortunately

---------- Post added at 15:58 ---------- Previous post was at 15:52 ----------

SafetyNet it's ok for you? Last time I've tried phh-treble, i didn't make it pass. Safety net and the battery drain are the only reasons cause i prefer stock over GSI.

Sent from my Huawei P9 using XDA Labs
Unfortunately I know no way to get it to pass myself.
 
Last edited:

zgfg

Senior Member
Oct 10, 2016
4,419
1,899
233
Last edited:

Wattsensi

Senior Member
May 13, 2018
221
34
0
Talca
SafetyNet it's ok for you? Last time I've tried phh-treble, i didn't make it pass. Safety net and the battery drain are the only reasons cause i prefer stock over GSI.

Sent from my Huawei P9 using XDA Labs
Solve the battery drain by disabling USB debugging, it's broken on Android and I can't debug it either.
 

MSe1969

Senior Member
Dec 16, 2016
1,411
2,575
133
Frankfurt Rhine-Main metropolitan region
New build with September 2020 ASB patches

Hi all,
a new build is available for download (install instructions, see OP):
https://sourceforge.net/projects/li..._a_lineage16_20200912_system.img.zip/download
  • ASB Security string 2020-09-01
  • Bromite Webview on 85.0.4183.86
  • Added eSpeak TTS engine (FOSS TTS solution)
  • Added P9 overlay with proper power profile & battery stats (thanks @Wattsensi)

If you make sure to switch off 'Android debugging', when you don't need it, the device now has a good battery behavior.
The only still open issue known to me is the WiFi Hotspot (still working on it).

Happy flashing, regards, M.
 

NervReaper

Senior Member
May 19, 2015
95
38
18
Spoof props from the official EVA-AL10c00b550:
https://forum.xda-developers.com/showpost.php?p=83338777&postcount=3921

Use e.g. MHPC Magisk module (that thread is about).
Use its option for fingerprint and navigte to Huawei P9 Android 8 b550 (or how is it named there) for the above fingerprint and sec. patch date.
Doesn't work for me. I flash Andy Yan's LOS 16 and did what you said, even try some tips from here unsuccessfully. ctsProfile and basicintegrity shows as false.

---------- Post added at 01:07 AM ---------- Previous post was at 12:56 AM ----------

Hi all,
a new build is available for download (install instructions, see OP):
https://sourceforge.net/projects/li..._a_lineage16_20200912_system.img.zip/download
  • ASB Security string 2020-09-01
  • Bromite Webview on 85.0.4183.86
  • Added eSpeak TTS engine (FOSS TTS solution)
  • Added P9 overlay with proper power profile & battery stats (thanks @Wattsensi)

If you make sure to switch off 'Android debugging', when you don't need it, the device now has a good battery behavior.
The only still open issue known to me is the WiFi Hotspot (still working on it).

Happy flashing, regards, M.
I tried this Andy Yan's LOS 16 unofficial build today from this thread and Wifi Hotspot works perfectly (tested using my laptop).
 

zgfg

Senior Member
Oct 10, 2016
4,419
1,899
233
Doesn't work for me. I flash Andy Yan's LOS 16 and did what you said, even try some tips from here unsuccessfully. ctsProfile and basicintegrity shows as false.
I looked to what you linked. I'm not familiar with GSI but your system is not read-only hence you don't need systemless changes - you can setup the props by:
https://play.google.com/store/apps/details?id=by4a.setedit22

or simply from Terminal, with su:
Code:
setprop ro.build.fingerprint HUAWEI/EVA-AL10/HWEVA:8.0.0/HUAWEIEVA-AL10/550(C00):user/release-keys

setprop ro.build.version.security_patch 2020-07-01

setprop ro.product.model EVA-AL10
As that, it should be permanent and not depending on timing issues at boot

Maybe it needs one or two more props but at the end, passing Safety Net if no suspicious modules are installed, depends only on spoofing the props

Check them upon rebooting, to make sure they were actually applied:
Code:
getprop ro.build.fingerprint

getprop ro.build.version.security_patch

getprop ro.product.model
 
Last edited:

md sabuj

Senior Member
Apr 5, 2015
66
4
0
Dhaka
www.facebook.com
Hi all,
a new build is available for download (install instructions, see OP):
https://sourceforge.net/projects/li..._a_lineage16_20200912_system.img.zip/download
  • ASB Security string 2020-09-01
  • Bromite Webview on 85.0.4183.86
  • Added eSpeak TTS engine (FOSS TTS solution)
  • Added P9 overlay with proper power profile & battery stats (thanks @Wattsensi)

If you make sure to switch off 'Android debugging', when you don't need it, the device now has a good battery behavior.
The only still open issue known to me is the WiFi Hotspot (still working on it).

Happy flashing, regards, M.
Thanks
 
Last edited:

MSe1969

Senior Member
Dec 16, 2016
1,411
2,575
133
Frankfurt Rhine-Main metropolitan region
I tried this Andy Yan's LOS 16 unofficial build today from this thread and Wifi Hotspot works perfectly (tested using my laptop).
I have double-checked the v119 build indicated by @Wattsensi with the exact build manifest and could not see any forgotten patch. I have had two suspicions with vendor/interfaces and vendor/vndk, where I tried to revert some commits, but no success. Also tried to look at the logs, but no obvious entries (except for the entries stating that the AP interface could not be established).
So for me, two possible reasons remain:
- The v119 is one year old, so maybe Andy Yan has some additional patch (will check later)
- One of my additional specific hardening measures needs some adaptation in regards to the treble/vendor setup

As said, any hint appreciated, so if one of you detects something in the logs and has any idea, I'll be grateful.

(E.g., I tried already, what @Wattsensi did with the overlay, but I was too impatient, and did not wait at least 45 minutes to let the battery stat build up and thought it would not work after ten minutes and reverted again. Only because he said it worked, I let it for some hours on my device for testing purposes, and it finally worked.
So maybe I have also overlooked something obvious in regards to the hotspot, when looking into the logcat...?)
 

Nightwish1976

Senior Member
Aug 9, 2011
453
67
0
Hi.
I'm trying to add a Google account to my Outlook for Android and I'm getting an error message like: "Adding accounts is not available now". It allows me to add non-google accounts.
Any idea what can I do?
LE: I managed to do it, just ignore the previous message.
PS: thank you for this ROM, the user experience is superior to everything else I tried recently.
 
Last edited:

MSe1969

Senior Member
Dec 16, 2016
1,411
2,575
133
Frankfurt Rhine-Main metropolitan region
@Wattsensi: Good news - I managed to fix the wifi hot spot issue - in the next build it'll work :highfive:

EDIT: @All - is there interest to upload a new build before the next regular build with October ASB patches included?
New features would be:
- Fixed WiFi hot spot
- Updated microG version with Exposure Notification API (would allow to run Covid tracing apps making use of that API)
 
Last edited:

xaweryp

Member
Aug 3, 2020
13
0
1
EDIT: @All - is there interest to upload a new build before the next regular build with October ASB patches included?
[/QUOTE]

This issue was actually blocking me from using it as a daily driver so great to hear it's gone now! :)

Would that fix also potentially apply for Lineage 17 as well? If got it right - on 17th the camera is still an issue, right?
 

Nightwish1976

Senior Member
Aug 9, 2011
453
67
0
That's great news indeed, especially about the hotspot.
Regarding the new build, I'm sure you know better when you have the time to work on this.
I have some issues with my phone. I'm pretty sure they aren't ROM related, but I would like to read your opinion on this anyway.
So, on this ROM, there is a large number of apps not available for my device on the Aurora Store. You mentioned something about Google doing google things to Aurora Store, but I think is more than that. I downloaded an app called Family Link for Parents (by Google). I've installed it and, when I opened it, I received the message "Family Link is no longer supported on Android 4.4 (Kitkat)".
I'm sure it's not connected to your ROM, as exactly the same thing happened while I was on the Havoc OS GSI (Android 10). That particular app had the same behaviour and, similarly, a lot of apps were not available for my P9 on Google Play .
So, I'm not sure what to do. What on my phone tells apps and app stores that the phone is running Kitkat? Is it related to the vendor? To the fact I have TWRP installed and no encryption?
I would like some opinions...
 

Wattsensi

Senior Member
May 13, 2018
221
34
0
Talca
@Wattsensi: Good news - I managed to fix the wifi hot spot issue - in the next build it'll work :highfive:
Nice! Now all we need to fix is the USB debugging, it currently is activated automatically on every boot and hogs all the CPU, and doesn't work.

Oh and include the NFC fixes so it works out of the box please. By doing that, you will finish the perfect daily driver ROM for this unfortunate device.

EDIT: @All - is there interest to upload a new build before the next regular build with October ASB patches included?
New features would be:
- Fixed WiFi hot spot
- Updated microG version with Exposure Notification API (would allow to run Covid tracing apps making use of that API)
October is a few days ahead, I'm sure they can wait. You should just prepare the October build for now.
 

MSe1969

Senior Member
Dec 16, 2016
1,411
2,575
133
Frankfurt Rhine-Main metropolitan region
That's great news indeed, especially about the hotspot.
Regarding the new build, I'm sure you know better when you have the time to work on this.
I have some issues with my phone. I'm pretty sure they aren't ROM related, but I would like to read your opinion on this anyway.
So, on this ROM, there is a large number of apps not available for my device on the Aurora Store. You mentioned something about Google doing google things to Aurora Store, but I think is more than that. I downloaded an app called Family Link for Parents (by Google). I've installed it and, when I opened it, I received the message "Family Link is no longer supported on Android 4.4 (Kitkat)".
I'm sure it's not connected to your ROM, as exactly the same thing happened while I was on the Havoc OS GSI (Android 10). That particular app had the same behaviour and, similarly, a lot of apps were not available for my P9 on Google Play .
So, I'm not sure what to do. What on my phone tells apps and app stores that the phone is running Kitkat? Is it related to the vendor? To the fact I have TWRP installed and no encryption?
I would like some opinions...
In fact, there are multiple things to look at:

1. AuroraStore in general
Google is continuously evolving their PlayStore infrastructure, and apps like AuroraStore need to be maintained to cope. There are some slight "glitches" sometimes to work around . . . (see own AuroraStore support thread or their Telegram chat)

2. AuroraStore on GSI builds
For whatever reason, on GSI builds, AuroraStore behaves worse - also on my P9, I can't find some apps, which are no problem on my other devices. I don't have a good solution for that, except for obtaining them alternatively (e.g. extract from other device, or APKmirror.com, ...)

3. Installed apps on this build
Once the app has been installed, the job of AuroraStore is done. So if an app behaves weird after install, it is related to the app and the environment, in which it finds itself.
This build for example has microG installed, and not the original Google Play services (I tend to call them Spy-Services, as this reflects the reality better). microG aims at providing compatibility to apps having Google play dependencies (for example, push messaging), but it is not designed and also not able to cover everything of the original Play services - this is partly intended (as nobody really needs all the advertising infrastructure and Spyware of the genuine Play services), and partly too difficult to achieve (Play services are closed source and difficult to reverse-engineer).
Especially apps directly developed by Google usually deeply integrate with the Play services and often expect to find the full range of play services functionality. So if a Google-developped app complains, I would not be too surprised.
It could therefore be (but I don't know), that the "KitKat" message is simply the result of the lack of a certain API function, this app is expecting to find on the device. Or the result of bad programming: if some check fails and instead of giving the proper details of the issue, the developer has made an "assumption" that "such things could only be possible in KitKat" . . .
 

MSe1969

Senior Member
Dec 16, 2016
1,411
2,575
133
Frankfurt Rhine-Main metropolitan region
Nice! Now all we need to fix is the USB debugging, it currently is activated automatically on every boot and hogs all the CPU, and doesn't work.
??? - Not on my P9. USB debugging just works fine and when I switch it off, it remains switched off, also after reboot.
Could you please provide more details?

Oh and include the NFC fixes so it works out of the box please. By doing that, you will finish the perfect daily driver ROM for this unfortunate device.
Honestly, I haven't tested NFC, yet - will do. But what NFC fixes are you talking about? Where could I find "the NFC fixes" ?

October is a few days ahead, I'm sure they can wait. You should just prepare the October build for now.
Usually ("usually" means: don't take it for granted!), Google publishes their ASB in the afternoon (Western US time zone) of the 1st Monday each month - that would be the 5th October 2020 next time.
Usually, one or two days later, the tags and source code links are published (rarely, it could take a couple of days longer).
Give it another day until the patches are picked and uploaded to the LineageOS Gerrit by the LineageOS community, from where I finally could pick them and do my own test builds.
This effectively means - that the earliest you could see an updated build with October ASB patches would be around the 10th October - assuming all goes well and - more important - I find the time . . .
(So this is no ETA! Just for information to better understand the context)
 

Wattsensi

Senior Member
May 13, 2018
221
34
0
Talca
??? - Not on my P9. USB debugging just works fine and when I switch it off, it remains switched off, also after reboot.
Could you please provide more details?
On my P9 it doesn't work. adb devices reports no permissions for me. It is well configured, I use it everyday on other devices. It doesn't hog CPU unlike Phh-Treble AOSP 9.0 though. Perhaps it's your newer build though.

Honestly, I haven't tested NFC, yet - will do. But what NFC fixes are you talking about? Where could I find "the NFC fixes" ?
This fix, it pretty much adds some permissions, tells the framework to expose NFC and installs an APK along with some binary blobs.
https://forum.xda-developers.com/showpost.php?p=81021365&postcount=26

---------- Post added at 13:41 ---------- Previous post was at 13:35 ----------

I have some issues with my phone. I'm pretty sure they aren't ROM related, but I would like to read your opinion on this anyway.
So, on this ROM, there is a large number of apps not available for my device on the Aurora Store.
Flash the amend patch for GSI ROMs. This takes care of that. Phhusson-based GSI ROMs all lack a necessary system file detailing Play Store app compatibility so they're all missing. You need to re-add it by flashing my amend patch on top of the ROM. It also fixes Bluetooth settings.
/system/etc/sysconfig/features_eva.xml
Credit: @lo_ol

@MSe1969 Please study this ZIP and add some changes into your ROM so offline charging, NFC and Aurora Store catalog can work out of the box

https://drive.google.com/drive/folders/1rpCeajjRfozMrTBgSvKELgtb9GwOeXfh
 
Last edited: