[Huawei P9 Guides, News, & Discussion] zgfg:
AL10c00b540 Patch02 OTA, Magisk, etc

I had b535 Patch02 (latest official/approved at the time) and received OTA b540 pop-up (it must be same/similar for those who e.g. manually installed b539 or even b540 - latter receiving OTA for only b540 Patch02):

https://xdaforums.com/showpost.php?p=78759219&postcount=1401

To prepare for OTA (keep Automatic WLAN update Off in System Update before ready), I had to:

- uninstall Magisk (and revert back to stock Ramdisk)

- revert back to stock Kernel (because of using ECO kernel)

- revert back to stock Recovery

(all three, stock Ramdisk, Kernel and Recovery can be flashed one after another from TWRP or Fastboot, then reboot to System and start OTA)

OTA to b540 started with differential update of 585 MB but it failed, it rebooted to System and automatically started to download full 2.52 GB OTA which was then successfully installed

Immediately after, OTA Patch02 for b540 with 3 MB followed

Since update did not trigger hard reset, Bootloader remained unlocked as well as all my apps and settings - incl. GBoard and Playstore - I had it manually installed (not using Playstore patch) as user app from:

https://www.apkmirror.com/apk/google-inc/google-play-store/

Installed Oreo TWRP and before applying any patches or rooting, disk-dumped stock Ramdisk and Kernel partitions from TWRP, see:

https://xdaforums.com/showpost.php?p=78774472&postcount=1412

NW patch successfully applied. Not using Face Unlock but its patch should also work

Installed Magisk Manager v6 01, it immediately offers to install Magisk v18:

- decline and make sure both Preserve Encryption and AVB are checked-in

- then push Install and take it to patch that previously disk-dumped Ramdisk (it saves to Internal memory, naming it as patched-boot - name does not matter but move it to SD card to be visible for TWRP)

- reboot to TWRP and flash the just patched Ramdisk

- reboot to System and Magisk/root is installed with SafetyNet showing all green

Instead of disk-dumping and patching yourself, you can download from my Mega: https://mega.nz/#F!JwkVyRya!Rb7OUE0z3PEpXBRxGOM-vQ

Make sure that Magisk Manager is manually granted Auto-start, Secundary start and Stay in background, under Phone Manager / Auto-launch

Some apps 'remember' they previously had root access - but now new root is installed:

- e.g., for MiXplorer, in Settings / Apps, open Storage and Clear Data, then open MiXplorer, click to root and grant it Root permission

To get Device Certified in Pkaystore:

- enable AirPlane mode

- open Settings / Apps, enable System processes

- for Google Play Services, Google Services Framework and Google app (if installed) open Storage and Clear Cache

- for Google Play Store app open Storage and Clear Data

- reboot, switch off Airplane, make sure it connects to WLAN, open Playstore and enable Play Protect, it must show green

- I had to reboot again, open Playstore and its Settings, and Device Certified was finally shown (you may turn off Play Protect now)

Installed BusyBox (do not forget to take MiXplorer, root, to manually create system/xbin subfolder before installing BusyBox) and Vanced YouTube (do not forget to uninstall YouTube app in Playstore and disable its automatic updates)

Installed also ECO kernel v4.4.171_01.19.19_lin_B539-B540, forcing blu_active governors for LITTLE and big clusters:

https://xdaforums.com/p9/development/kernel-ecokernel-starter-v0-1-t3857029

NOTE:

With latest OTA Patch02 (I had the same with b535 Patch02), Huawei enforces DM Verity:

- for that reason, Preserve AVB must be checked-in in Magisk Manager

- in fact, without Magisk, SafetyNet fails complaining for CTS profile and Bootloader unlocked (once installed, Magisk successfully hides, making SafetyNet to fully pass)

Of course, you must not attempt to re-lock Bootloader - it will trigger hard reset removing all settings (incl. NW patch), even worse it may brick the phone with non-stock Ramdisk, Kernel or Recovery