[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] MSe1969:
This thread is dedicated to provide Lineage-OS 16.0 builds with microG included for the HUAWEI P9 with current security patches.

It is a treble build, therefore it could also work on other devices, but I haven't tested. And yes, the camera works!

(Although it is based on the work of phhusson's GSI builds, some specific adaptations have been made, so I guess, it is worth a try for further Huawei devices based on EMUI 8, but that's it...)

Features of this ROM

Download here

Pre-installed microG and F-Droid like the LineageOS for microG project (own fork)

Pre-installed AuroraStore see section "Space restrictions on the /system partition"

Root included (switch on in dev. settings)

Backported Audio balance (accessibility settings) from Android 10

Additional security hardening features listed below

Access to /proc/net blocked for user apps

Bundled netmonitor app to allow network monitoring

Enhanced Privacy Guard: Switches for motion sensors and other sensors

Cloudflare as default DNS (instead of Google)

Privacy-preferred default settings

Optional blocking of Facebook- and Google-Tracking

Optional disabling of captive portal detection

Firewall UI

No submission of IMSI/phone number to Google when GPS is in use

Default hosts file with many blocked ad/tracking sites

Privacy-enhanced Bromite SystemWebViewMulch Webview

Additional restrictions for secondary users

Increased password length

Hardened bionic lib and constified JNI method tables

Huawei Stock Camera

Current release levels

Custom build release 2024-07-01

Security string: 2022-01-01

AOSP tag: 9.0.0_r46

Mulch System Webview: M121 *

Source-code and build instructions

Device config.: https://github.com/lin16-microg/device_phh_treble/tree/lin-16.0-eva-p9

Build manifest: https://github.com/lin16-microg/local_manifests/tree/lin-16.0-treble

Installation Instructions

YOU ARE RESPONSIBLE SOLELY YOURSELF FOR ANY ACTIONS YOU DO WITH YOUR DEVICE !!!

Please note - I won't explain any single aspect (e.g. how to install 'fastboot' on your PC or troubleshoot USB connectivity issues under Windows). Search the net and consult the search engine of your choice or look here in XDA, there is plenty of information available.

Pre-Requisites

Have fastboot and adb installed on your PC and make sure, you can connect via USB to your device in fastboot mode and via adb

Know the key combinations to get your phone into fastboot mode and recovery mode

An unlocked bootloader

EMUI 8.0 firmware

Have the

Huawei Stock recovery

installed (not TWRP)

ONLY

, If the above pre-requisites are met, download and unpack the linked ZIP file, and flash the .img file via fastboot (EMUI 8.0 is the tricky pre-requisite - see further below).

Get your device into fastboot mode and connect to your PC via USB - the screen should look like below, indicating "PHONE Unlocked"

View attachment 5408049

Flash the ROM with the command fastboot flash system <name of the rom img file>.img

View attachment 5408051

Afterwards, enter the command fastboot reboot

Hold Power+Vol.Up to get into the Stock recovery:

View attachment 5408091

Choose the option "wipe data/factory reset"

Don't 'panic' if the operation stops at a percentage significantly lower than 100% and you see a red exclamation mark, all is fine

Next, choose "wipe cache partition"

Finally choose "reboot system now"

Some hints:

If you come from an EMUI 8.0 stock ROM or a different treble build (which means, you are already on EMUI 8.0), don't forget the factory reset as described.

If you update one of my builds from this thread, you don't need to wipe anything, so you can skip everything after the 'fastboot reboot' step!

On some (but not all) PCs, you may have to run fastboot as Admin (Windows) or root/sudo (Linux)

If the above pre-requisites are NOT met, you will have some extra-rounds to perform, until you get there:

Unlocked Bootloader

Huawei has stopped providing unlock keys, so if you haven't got one, this thread, this link and/or of course the search-engine of your choice may be helpful. I was lucky enough to obtain an official unlock key on the last day of HUAWEI's unlock page, so I have no experience with the unofficial unlock methods - good luck!

EMUI 8.0 firmware

Get back to Stock ROM, if you use a Custom ROM. On Stock, if not yet done, apply all updates offered to you by the Stock ROM updater, until you are on the latest officially offered Android 7 (Nougat) EMUI 5.x release.

Huawei has shut down however their update servers for older devices and older software releases, so this may become difficult, if you are e.g. still on Android 6 - I

don't

have a good advice for you in this case.

Once you are on Android 7 (aka Nougat), please visit this thread, which really explains step-by-step, what needs to be done. Really carefully read everything and follow ALL the steps,

especially, don't forget at the very end to flash the Stock EMUI recovery

!

IMPORTANT UPDATE:

The linked thread, as well as the Openkirin documentation point - via a Russian firmware site - to the domain 'hicloud.com' for the firmware download, which seems to be down. As suggested by @zgfg you can try either his Mega link or e.g. https://androidhost.ru/search.html

Update:

See this post to obtain the firmware!

Update 2:

See also here

You need your unlock key handy: During this process, the bootloader will be automatically locked several times, so you need the key a couple of times to unlock again!

A hint for Linux users: The HWOTA tool is in fact a windows wrapper around Linux shell scripts, so there is no real need to use Windows, if you have a working Linux installation (however, make sure to replace the 'mkdir' commands in hwota_eng.sh with 'mkdir -p').

Android 10, 11, 12 or 13 builds?​

Simple answer: There won't be any coming from my end (my aim is to provide daily-driver capable builds and not to boot an experimental GSI with lots of issues and a non-working camera) - so stop wasting everybody's time by repeatedly asking!

Space restrictions on the /system partition​

The /system partition in the P9's partition scheme is quite small with ~ 1,88GB. In order to gain back some space to be able to make the build, a couple of normally shipped apps are not packaged. In other cases, only older versions are shipped, as the new versions take too much space.

In both cases, the respective apps can easily be installed as regular "user apps" - you can download and install the respective apk files from here:

lin16-microG - Browse /treble_p9eva/APP_Files at SourceForge.net

sourceforge.net

eSpeakTTS.apk

A simple Text-to-Speech app - was shipped before as part of the ROM.

Exchange2.apk

Was part of LineageOS shipment - if you need to connect to a Microsoft Exchange server to fetch e-mails. Pretty sure most of you won't even miss that one, but in case you really need it, here we go. Please note, that this apk file has been signed with this ROM's signature, recommended to be used only with this ROM.

LockClock.apk

The ROM still ships a simply desk clock widget. The LockClock app is the extended clock widget offering to show weather information (if you use a weather plugin) and calendar alerts. Please note, that LineageOS has in later releases abandonned its development. Nevertheless, if you still need/want it, you can simply install. Also not, that this app is signed with this ROM's signing key, so if you really want to use it, only use the linked apk.

AuroraStore.apk

Please download from its official source here: Install and choose "AuroraServices" as install method.

microG updates *​

Above space restrictions limit the shipped microG to the 0.3.0 release. To update, please visit this link and download the newest Gms*.apk file to your phone and then install it as update (please note, that you can't update from F-Droid or the official microG site, due to a signature mismatch!). Afterwards, apply the update to the "microG Companion app" for the same version number(!) from the official microG F-Droid repository.

Webview updates *​

Above space restrictions limit the shipped Webview to the M121 release. To update, please use the shipped F-Droid app and add the Divest-OS F-Droid repo.

Bug reports:

If you have a problem, please create a post with these informations:

Build Date:

And try to get log as described here

Please note that I can't and won't support issues with builds using a different kernel or Xposed.

In regards to microG, I will try my best to help when it is related to this ROM (I use it myself), but any questions of the type "the YXZ-app can't do <some sort of fancy xyz Google functionality> properly" are better asked in the respective microG forums.

Credits

AOSP project

LineageOS project

openkirin.net

phhusson

AndyYan

Tecalote

microG project

Graphene OS project

csagan5 (Bromite)

WhyOrean (Aurora)

zgfg (for very helpful contributions in this thread)

XDA:DevDB Information

[ROM][Treble][microG]LineageOS 16.0 for HUAWEI P9, ROM for the Huawei P9

Contributors

MSe1969

Source Code: https://github.com/lin16-microg/device_phh_treble/tree/lin-16.0-eva-p9

ROM OS Version: 9.x Pie

ROM Kernel: Linux 4.x

ROM Firmware Required: EMUI 8 firmware

Based On: LineageOS

Version Information

Status: Stable

Stable Release Date: 2024-07-17

Created 2020-04-06

Last Updated 2024-07-17