Privileged Extension OTA package broken for Android 10 / LineageOS 17.1?

So, I have upgraded my system from LineageOS 16 to 17.1 (Android 9 to 10) and it seems that the Privileged Extension OTA package is no longer working properly. I flashed the package directly aftter the upgrade via ADB sideload. The TWRP log shows that the Privileged Extension has been installed but after booting up the system it is nowhere to be found. Apps have to be installed manually. F-Droid itself is working fine though. The Magisk OTA package installed just fine. Installing the Privileged Extension as Magisk module works fine too.

Maybe the install script has to be revised for Android 10/LineageOS 17.1?

2 Likes

Hi,
this seems me right. :slight_smile:
Maybe
– source code:

android:minSdkVersion="8"       
android:targetSdkVersion="25" (aka: Android 7.0)

This is probably similar to this issue: UnifiedNlp not working on LineageOS 17.0 Beta · Issue #11 · WeAreFairphone/flashable-zip_microG · GitHub

1 Like

Try with the Magisk module instead, if Magisk works on LOS that is.

I’m using LOS 17.1 and I’ve installed the Privileged Extension OTA package using the LOS recovery as well as the F-Droid Privileged Extension Magisk Module and F-Droid package. Afterward F-Droid installs still require manual approval. Both package and module install without error. App info for the F-Droid Privileged Extension shows it only using 86.02 kB of storage on LOS 17.1 which seems low. My LOS 16 device shows F-Droid Privileged Extension using 217 kB.

Have seen glitches with the Magisk module too.

Try to remove the module, leave F-Droid installed, then reboot, install module, reboot, retry

Not sure if the order of install has an issue.

Eg. I had it not work before, had to reinstall whole system and now works fine.

There seems to be an on-going issue: Installation went fine in TWRP, but not working to install from F-Droid silently (#47) · Issues · F-Droid / privileged-extension · GitLab

I’m now building Los17.1 for SonyXZ1 and have F-DroidPrivilegedExtension working fine:
@CryptGoat can you check via twrp for (/system) /system/priv-app/F-DroidPrivilegedExtension and etc/permissions/permissions_org.fdroid.fdroid.privileged.xml ?

jic, I’ve myself also added some redundant, in etc/sysconfig/*.xml

<config>
  <system-user-whitelisted-app package="org.fdroid.fdroid.privileged"/>
  <hidden-api-whitelisted-app package="org.fdroid.fdroid.privileged"/>
</config>

(As for F-Droid apk, it came in /system/product/app/)

I second this. I attempted to reinstall the ota, without succeeding at first (lineage recovery).
Installing unifiednlp by pushing to /system-priv worked, so I am tempted to perform the same thing. (I don’t recall the exact procedure, could have been an OTA).

@oF2pks I do not have these files on my system after sideloading the ota.

I dug a bit more. Attached is a full log: recovery-log.zip (6.6 KB) .
The blame might be on lineage side this time: after mounting /system, /system/bin isn’t a folder anymore, and that’s the one used in the $PATH As such, no command can be executed as soon as /system is mounted. Moreover, I cannot use /system/bin/ as it then complains of “too many symbolic links encountered”. I also tried copying /system/bin into /tmp to have the executables (these didn’t seem to be symlinks), but I get the same issue (if anybody has an explanation, I’d be glad to hear it):
/system/bin/sh: /tmp/bin/ls: Too many symbolic links encountered.
I’m tired now, but it nows appear ls is a symlink to toybox, like busybox would be. Unsure why it didn’t show up previously.

I don’t know whether my device uses /system as root, getprop ro.build.system_root_image returns nothing.

I will try to ask the lineage devs if I can. There seems to be something funky going on with the recovery, or something else. I previously tried with the 16.0 recovery, this was with the 17.1. The recovery mounts the system partition under /mnt/system when asked. So I remounted it rw with mount -o remount,rw /mnt/system, and changed the SYSTEM variable in the f-droid install script to SYSTEM="/mnt/system/system", as well as commenting the mount /system line. That worked. But it is far from optimal, so it remains to be investigated. It might just be the lineage recovery putting its binaries in /system/bin instead of /system/system/bin, thereby causing all these issues.

It’s 2 am, I’m going to bed :slight_smile:

edit: I tried to attach the updated zip, but it’s 2BM too big.

Takeaway: a lot more tests are needed in the install script, with better error messages. I might contribute them.

For both F-DroidPrivilegedExtension & MicroG/UnifiedNlp you should never change system/bin that can lead to softbrick(s). Only accessible standard /system locations

/system/priv-app
/etc/sysconfig
/etc/permissions

Yeah, of course. But to cp files, I need to use $PATH/cp, and when $PATH is /system/bin instead of /system/system/bin, and the symlinks are wrong, the OTA script cannot use cp, mv, grep, chmod, getprop, rm, or anything else really, after mounting /system:confused:

I assume this might be device-specificc, but that was at least the case on mine.

I try to ask about this on lineage’s reddit, but haven’t received an answer for now. I’ll try with their freenode, when matrix.org lets me join…

Basically either you use risky TWRP/Advanced/FileManager, either you use reversible systemlessly Magisk module to perform /system modifications…

If TWRP/Advanced/ FileManager doesn’t mount well, you should report in your device twrp thread.

Well, in the worst case you can just reflash /system, but it’s kind of off-topic here: The issue is that the OTA package is broken.
I found the root cause, at least on my device: the OTA mounts /system, which shadows the aforementioned binaries, and therefore prevents the rest of the script form working.

I don’t even use TWRP (Lineage Recovery 17.1 instead) or a file manager that comes with the recovery, though I get you point. I poked around using adb, and changed the OTA script accordingly.

Okay, I’ve got what you mean, you should find safe answers here : scripts: fixes for Tegra partition naming + bootsigner on Android 10 · topjohnwu/Magisk@f2d2f28 · GitHub

and here Fixup mounting system on Lineage Recovery · topjohnwu/Magisk@ab9442d · GitHub

Check also openGapps: opengapps/scripts/inc.installer.sh at 0bfe62576a57fb68974b8136da19bfba086bacf2 · opengapps/opengapps · GitHub

1 Like

Linking here the not-so-elegant-but-working solution we rolled at WeAreFairphone/flashable-zip_microG:

Hello there,
I’m not a developer nor an IT expert; can anybody tell me if there is an easy and maintainable solution for the issue described here?
I’m comfortable with flashing the privileged extension any time I flash an update to my ROM, but I need a well-defined process to adapt to the recently discovered issue here. At the moment, I am lost with the information given above … :frowning:
Regards

I ended up using the F-Droid Priviliged Extension Magisk Module, instead of the zip installer, to get it working. Maybe that can work for you @species007 as well until it gets fixed.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.