yashsingh1/xdaforums huggingface dataset:
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] MSe1969:
Thanks for the feedback and your hints.

In regards to A-GPS

I see that in the linked flashable zip in your repo, there in fact is an apk (from Huawei) with libs to be flashed. I'll have to analyze the original stock ROM to find out more, but maybe you have some more information for me?

I don't want to mess with any other partition that /system (so if really files need to appear on other partitions, I would have to 'overlay' them with a bind mount...)

Regarding locked bootloader

Is that really possible? (I know to to lock/unlock the BL, but I am not sure whether the ROM would still boot...?) Also, wouldn't that mean having to unlock it again for every update?

(and I explicitly do not want to run the "securize" option in the treble app...)

Regarding Safetynet

I see in your repo, that the "SafetyNet" option, which you have privided in your fork of the treble app simply sets a property 'persist.sys.phh.safetynet', which, if activated, simply force-resets a bunch of ro.* properties - is it really that "easy"? And won't those properties also have an impact on how the OS behaves?

Looking forward to your feedback - many thanks
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] AltairFR:
I don't speak English well, I'm French so I'll give a fairly short answer. You can contact me privately if you want more information:

SafetyNet and bootloader :

Yes it's as simple as that, then you have to have the right properties 😀 on emui8. On emui9 you must modify attestations by patch frameworks

A-GPS

This is the most complicated patch I had to do because first you have to move a huawei gnss library from vendor to system. Then you have to install my apk supl20. I modified the original huawei apk to work on android 11 and above. It makes the link between huawei services and huawei phone system
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] MSe1969:
Let's see... - for the time being, I think "Mulch" is a good choice...
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] AltairFR:
For agps, i think you can read and keep this patch for android 13

AGPS Patch · Iceows/huawei-creator@704f47c

Transform AB to A-Only and AB to VNDK-lite for Huavei device - AGPS Patch · Iceows/huawei-creator@704f47c

github.com
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] MSe1969:
D'accord - merci. À bientôt donc... :)
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] AltairFR:
For the unlock of the bootloader, in fact it's just properties which indicate that it is locked but it doesn't really have it. The properties are persistent and are stored in the data partition, so with each update it works
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] AltairFR:
Tu es français aussi ?
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] MSe1969:
Allemand, mais je parle français...
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] AltairFR:
Ok so I'm going to write in French if we discuss in private. it will be easier for me :)
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] AltairFR:
As you are in lineage 16, I think you can use the original version of the supl20.apk and for the gnss_watchlssd_thirdparty service maybe it works from vendor under lineage 16
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] AltairFR:
Use ps -ef | grep gnss to list process

You must have 4 gnss_* process
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] MSe1969:
New build with back-ported April '23 ASB patches available

Hi all,

a new build is available for download (update instructions, see OP):

https://sourceforge.net/projects/lin16-microg/files/treble_p9eva/treble_arm64_a_lineage16_20230418_system.img.zip/download

Custom build release 2023-04-01

Mulch Webview 112.0.5615.101

Happy flashing!

Regards, M.
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] hjh70526:
Hi,thanks for your rom,it works perfectly most time.

But I got problem using volte,ims seem not work on my device or China mobile
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] MSe1969:
VoLTE does not work at all with this build.
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] lo_ol:
Ims service is not included but can be installed separately. https://xdaforums.com/t/hwims-volte-for-hi6250.3911374/ (Requires lucky patcher - toolbox – android patch – uncheck dalvik only - check disable packet manager signature check to allow app install on this build and reversal after installation since this breaks some features such as trust)

Volte works flawless on your build. Audio quality is superb and call setup almost instant. Works at least on rebranded european P9.

Many thanks for everything you do btw MSe1969(y)(y)

ImsCall : callSessionStarted :: session=[ImsCallSession objId:117788875 state:ESTABLISHED callId:slot0id1] profile={ serviceType=1, callType=1, restrictCause=0, mediaProfile={ audioQuality=0, audioDirection=3, videoQuality=0, videoDirection=-1, rttMode=0 } } ImsCall=[ImsCall objId:65237160 onHold:N mute:N mCallProfile:{ serviceType=1, callType=1, restrictCause=0, mediaProfile={ audioQuality=0, audioDirection=3, videoQuality=0, videoDirection=-1, rttMode=0 } } tech: updateRequest:NONE merging:N merge action pending:N merged:N multiParty:N confHost:N buried term:N isVideo: N wasVideo: N isWifi: N session:[ImsCallSession objId:117788875 state:ESTABLISHED callId:slot0id1] transientSession:null]
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] P9_User:
Magenta Austria will shut down 3G within 2024. So if LTE is not available it will use GSM instead then. Guess thats the end of the P9. : (

Regarding your latest version, usually after unzip container I had a .img

Now its folders and files... Did I missed anything?
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] MSe1969:
The P9 of course supports LTE for data, but not VoLTE ("Voice over LTE")
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] P9_User:
Hm, maybe I got something wrong...

And about the .img? Any suggestion? Probably some hickups while unzip. Everything fine now.
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] MSe1969:
I'll have a look at the link posted by @lo_ol
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] P9_User:
Just talked with that person who told me about 3G shutwown and yes, it is about VoLTE support. Would be great if you can include it into any further rom/img. Thanks in advance.
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] MSe1969:
I will have a look, but I don't understand your panic - 3G has already been shut down in Germany and this is no issue, I can normally make phone calls with the P9, it uses, as always, GSM for voice calls.
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] MSe1969:
New build with back-ported May '23 ASB patches available

Hi all,

a new build is available for download (update instructions, see OP):

https://sourceforge.net/projects/lin16-microg/files/treble_p9eva/treble_arm64_a_lineage16_20230510_system.img.zip/download

Custom build release 2023-05-01

Mulch Webview 113.0.5672.77

Regarding some other topics being discussed here, like slow A-GPS fix, Safetynet tweaking or VoLTE, I unfortunately didn't find time to do some research etc. - can't promise anything, trying to have a look at those however, soon.

Happy flashing!

Regards, M.
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] kundifon:
This rom is pre-rooted. That's fine and handy.

If you want install and use banking apps, they can complain and doesn't want to run (depens on bank, if interfering in things that are absolutely none of the bank's business. Rooting is user's choice!)

What I have to delete to loose root and satisfy bank app? Or hide root?

If I need root later, maybe I will (temporarily) install magisk. (or try somehow hide root. I haven't experience yet.)

@MSe1969 maybe some advice? Danke voraus.
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] AltairFR:
Try this script, it remove all su binary and magisk
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] kundifon:
Appreciate your quick answer. But how to apply this script? Just leave me a path that I can search for further instructions. If I knew how, I wouldn't ask.

Alternatively, may I manually delete those files/folders with twrp file manager? (This I know how...)

rm $SYSTEM/xbin/su
rm $SYSTEM/bin/phh-su
rm $SYSTEM/etc/init/su.rc
rm $SYSTEM/bin/phh-securize.sh
rm -Rf $SYSTEM/{app,priv-app}/me.phh.superuser/
rm -Rf /data/su || true

And what with folowing? Create empy files and folders?

touch $SYSTEM/phh/secure
mkdir /metadata/phh
touch /metadata/phh/secure
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] AltairFR:
Just start an adb shell in root mode

Copy the script on the phone, for example in /tmp and start it with cmd

./phh-securize.sh
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] AltairFR:
Your phone have emui 8 or 9 ?
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] kundifon:
P9 eva is on EMUI 8 firmware
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] MSe1969:
In a nutshell: The root detection methods of the various banking apps vary significantly. Some methods simply look for the existence of a su binary, others rely on G* Safety net and others go even as far as considering a phone with a custom ROM as "rooted".

So you may have luck with some apps by purging the su binary and associated files, but it's not guaranteed to work.

It also depends on the reaction of your banking app: Does it refuse to run, does it switch to a read-only mode or does it only complain and force you to confirm some nasty popups?

My general advice is:

Don't use your mobile phone for money transfer (has nothing to do with rooted or not).
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] kkgodygah:
I hope VoLTE will work as soon as possible. The reason is that 2G&3G be shut dowm both,just like CTCC
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] AltairFR:
This patch securize phone, just install it in twrp https://sourceforge.net/projects/al...10-Huawei-Securize-A-v1.0-signed.zip/download
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] MSe1969:
In my build, there is the Phh treble app shipped, the securize script is an option within, I have however never tried it.
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] AltairFR:
Yes and the option start the script phh-securize.sh. But i have also make a twrp patch with the .sh
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] kundifon:
I tried yesterday with Phh treble app (root enabled, reboot system, then try app), but didn't do anything. It seems so, advanced root cheker shows the same things as befor and root switch is stil in developer menu.

I will try with .sh script during the weekend.
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] AltairFR:
Use the twrp patch
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] lo_ol:
Easiest way to unroot is to disable root in developer options, boot twrp, mount /system and run 'sh /system/bin/phh-securize.sh'

Reason why its better to disable inbuilt root first is because sensitive apps usually fail to launch if property persist.sys.root_access is still set to 1 or 3 even if no su binary is present
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] kundifon:
Thaks you are awesome :) I used twrp patch because that's the way I know how. It worked.

Little offtopic. Firstly I had to replaced very weared battery

I'm wondering why phone with this rom drain the battery even when is completly turn off - system shoot down. It's difference comparing to stock rom. Therefore is bad idea to have it as backup phone (not in daily use), because after few days or week battery percentage drop a lot ~20%

By second Huawei P9 and booth replaced battery I'm pretty sure, that this is fact not my feelings.
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] 0ldsoul:
I have Huawei P9 with EMUI 4.1 unlocked bootloader and twrp working. How can I update the device to MIUI 8 with correct region if Huawei already shutdown their website?

Also, is there a way to backup my current stock rom in case something went wrong?
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] MSe1969:
Difficult... In the provided links (see OP), there is also some Android 7 original firmware.

You would need to do some research, I remember, that there is also a way to place the firmware file into a specific directory on the SD card and reboot to recovery (which means, you need the stock recovery and not TWRP) to trigger an upgrade to EMUI 5. But I am afraid that I can't help you further on this.

To my knowledge no.
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] MSe1969:
I don't object, I tend to have the same impression...
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] MSe1969:
New build with backported June '23 ASB patches available

Hi all,

a new build is available for download (update instructions, see OP):

https://sourceforge.net/projects/lin16-microg/files/treble_p9eva/treble_arm64_a_lineage16_20230619_system.img.zip/download

Custom build release 2023-06-01

Mulch Webview 114.0.5735.131

microG updated to 0.2.28.231657-5

FakeStore updated to 0.2.0

PLEASE READ CAREFULLY - IMPORTANT INFORMATION FOLLOWS

a. Rework of microG - Coarse location providers

The coarse location functionality of microG has been rewritten. microG no longer uses external "plugin" modules for location determination, but instead provides internally this functionality, currently only by fetching data from Mozilla. See here for further information.

b. Space restrictions on the /system partition

The /system partition in the P9's partition scheme is quite small with ~ 1,88GB. (The original treble design of Stock OS has foreseen, that certain apps in fact land in the /product partition - this of course is not really feasible with a treble build, as we need to leave the "original" /vendor , /product, /odm, ... etc. partitions intact and have to concentrate only on the /system partition.) Long story short: With the last May build, the partition size was already 98% used and with this build, the maximum partition size would have been exceeded, so I have received build errors. In order to gain back some space, I have therefore removed a couple of shipped apps, which can easily be installed again 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

(Just a side note, I could only remove un-privileged apps - just in case you wonder, why it is those four apps, which I have picked)

AuroraStore.apk

The AuroraStore in its newest version 4.2.3 - you can alternatively also download from its official source here:

Simply install, choose "AuroraServices" as install method and continue using as before.

eSpeakTTS.apk

A simple Text-to-Speech app - was shipped before as part of the ROM. (In the OP/Install description, you'll find soon some more information and also alternatives)

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 continue using it, only use the linked apk.

Happy flashing!

Regards, M.
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] lo_ol:
Thanks for the update!

Regarding the space issue (or lack thereof) I noticed that /system/app/webview eats up around 233Mb within the image while the actual webview.apk file is in fact only 9mb in size

I don't really understand how that comes about but it's not a joke:D

If /system/app/webview is removed from the device, it actually frees up 233mb that can be used otherwise. If webview.apk is copied back in place, then that process still freed up around 225Mb

I assume 233Mb is approximately the size of the full browser package that somehow gets fully reserved, rather than just the webview implementation? Maybe this can get corrected in some way?

tl;dr apparently webview currently fills up roughly 10% of the available space with zeros
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] MSe1969:
Thanks for your feedback - I am fully aware, that webview uses 233 MB. Some weeks back, with a major version upgrade, the webviews have doubled their size, LineageOS suffers from the same issue and finally had to convert their repo to git-lfs. You cannot have a ROM without, this is the internet rendering engine.

And it indeed uses that much space, your observation seems more some malfunction of your Windows app somehow "interpreting" the apk file as an ordinary ZIP and maybe "optimizes" things away. If you stay within Linux, you'll see it.

View attachment 5936115

If you run unzip -l webview.apk from a linux shell, you will see a file listing and see, that there is no "air" in it. It in fact is the entire chromium, but without an own browser frontend - apps in need to render web content as well as lightweight browser front ends, such as Jelly shipped from LineageOS make use of it.
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] lo_ol:
Thanks for the reply. See the image browser also shows the wrong size in the screenshot above as it does on the device itself, that is the point i'm trying to make.

However that’s not the correct file size. I'll attach the apk from today’s build, as you can see XDA confirms it's only 9mb in fact :D

You'd need to copy the file to another location first to get correct file size

I've triple checked via diskfree on the device too
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] MSe1969:
I think you did not get my point ;)

Your file manager seems to "think" (wrongly though), it can somehow "optimize" the file size and therefore seems to "extract" the parts, it "considers" relevant, with the result of a destroyed and corrupted file (instead of simply copying the whole file without "optimizing" it). I have downloaded your attached shrinked webview to my PC, and this is the result, when I try to list its contents:

View attachment 5936183

Whilst listing the contents of the "large" webview.apk on my build server works:

View attachment 5936189

Of course, please feel free to replace the shipped 233MB webview with your 9MB webview on your device and then e.g. start the LineageOS Jelly browser (but be prepared having to enter fastboot with the hardware keys to flash the ROM again and don't be cross with me, whatever happens...) - just kidding, better don't, that'll be a recipe for trouble!
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] lo_ol:
Okay thanks for clarification:)
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] P9_User:
Hi. Using mapy.cz as navigation map app.

microG notification is popping up until doing deactivation.

Any suggestion?
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] P9_User:
double
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] MSe1969:
My next build comes with a fix of microG. I have quickly tested mapy.cz on my new build and not observed any error, so I assume, the new build will have fixed it.
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] MSe1969:
New build with backported July '23 ASB patches available

Hi all,

a new build is available for download (update instructions, see OP):

https://sourceforge.net/projects/lin16-microg/files/treble_p9eva/treble_arm64_a_lineage16_20230710_system.img.zip/download

Custom build release 2023-07-01

Mulch Webview 114.0.5735.196

microG 0.2.28.231657 - "Original" included now (see comments)

I have started to rework my microG approach:

With the recent change to include the Mozilla Localtion services (MLS) directly into the microG code also comes the requirement to obtain an API key for MLS, which I don't have right now (I have requested one, but I am not sure

whether

and if yes, when I would get it). I have therefore included the original microG apk and use the now foreseen way to specify certain default settings, so one of the two reasons for me to build from source has gone.

Happy flashing!

Regards, M.
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] P9_User:
Did not work for me. made the latest update, re-installed mapy.cz app but still haveing this pop up notification. Any thing I can try to find out what is the reason for this behavior? I am using this app quiet a lot, other alternative maps are no option for me.

Thanks in advance.
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] MSe1969:
As indicated before, I can't reproduce the behavior on my own device.

I also assume, that you haven't tampered with any other partition on the device, you only flashed the system.img and you did not flash any "cool" stuff out there... (If yes, that could be a hot candidate)

So I propose to first check the following:

- Location globally enabled?

- Location functionality all enabled in microG?

- All permissions granted to microG app?

- Force-stop microG app once

Next, if that won't help, a log is needed, so connect your device via USB to your computer, enable debugging in the dev. options (you may have to also enable USB data transfer / MTP) and create an adb logcat: Enter adb logcat > logcat.txt on your PC, then start mapy.cz and wait until the crash popup appears, then stop the recording with [Ctrl+C] on your PC and send me the logcat.txt file.

You can also attach it in a post as a file here, if you like, but keep in mind, that the log may contain data, which you would like to keep private, so you may want to delete some lines etc.
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] P9_User:
Hi. Nothing fancy with my P9, using it as it is.

Figured out now, this microG notification is only popping up if "location" is deactivated. This is pretty new since I was mostly using mapy.cz offline and without location enabled.

Checked permissions, seems to be fine, of course I tried force-stop microG already, did not make a difference.

View attachment 5952505

Recent access is grayed out, does it mean anything?
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] MSe1969:
Thanks for confirming - normally, when mapy.cz app tries to determine the location, you will see it under recent (this is at least on my device - however, I have explicitly tested in my house to make sure, that the phone is forced to use coarse location, as it won't get any satellite like that).
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] P9_User:
Hi. Seem like the "location" function is not working propperly anymore. Not on Googlemaps browser version, not with mapy.cz app. Also sitting in a house.

Any advice? Logfiles now?

Edit: Tried a GPS-Satelite app, found slowly three sats from my window but could not lock. Also the microG notification popped up once I deactivated "location". So its not the map app, its the location function obviously.
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] MSe1969:
I can only repeat, that on my device, all is fine. I also do not experience the app closure popups, when I disable location in microG.

Could you please try to create a log?

What about you other readers of this thread? Anybody else experiencing the described issue?

FYI: I have the firmware/EMUI version EVA-AL 10.8.0.0.552(C00) on my device.
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] P9_User:
Logfile sent. Firmware is one release below, can not remember but when I set up the phone years ao, this was the latest release I was able to put on the P9. EVA-AL 10.8.0.0.540(C00)
[Huawei P9 ROMs, Kernels, Recoveries, & Other Devel] MSe1969:
Thanks for the logfile, will probably not be able to look before Monday. Firmware update is painful, you would have to reset the device and either flash Stock and let Stock ROM offer the update (full!) or more or less repeat the steps to get to EMUI 8 with newer FW.