Skip to content

Installation of Privileged-Extension Failed (Insights on update-binary)

Not really an expert in scripts n stuff but here's some weird things I noticed in the update-binary file of the zip

mount_system() {
  mount /system

  # Modern devices use /system as root ("/")
  system_as_root=`getprop ro.build.system_root_image`
  if [ "$system_as_root" == "true" ]; then
    SYSTEM="/system/system"
  fi
}

cd /tmp
mkdir fdroid
cd fdroid
unzip -o "$3"

mount_system

For my device Sony Kirin, $system_as_root is true as reflected by the prop, however the system partition is mounted as /system, or is /system/system just a mount point for /system?? in twrp It's basically the same thing everyone realised, F-Droid apks are simply not installed.

To get things working I refered to the 80-fdroid.sh and came up with a script which I tried to execute in adb shell in twrp after mounting /system manually, which failed...

#!/bin/bash
mkdir /system/app/F-Droid
mkdir /system/priv-app/F-DroidPrivilegedExtension
cp F-Droid.apk /system/app/F-Droid.apk
cp F-Droid.apk /system/app/F-Droid/F-Droid.apk
cp F-DroidPrivilegedExtension.apk /system/priv-app/F-DroidPrivilegedExtension/F-DroidPrivilegedExtension.apk
cp F-DroidPrivilegedExtension.apk /system/priv-app/F-DroidPrivilegedExtension.apk
cp permissions_org.fdroid.fdroid.privileged.xml /system/etc/permissions/permissions_org.fdroid.fdroid.privileged.xml

Basically just copy pasting the files placed in the same folder as the script. Well, in the end I just executed the commands one by one and got the priviledge extension to work.

I'm thinking of modifying the update-binary to take note of a/b devices n devices which uses system as root but still have /system at /system? And possibly just give some feedbacks on the installation screen if there are errors with executing the commands, i.e. failing to mount /system Actually I'm not sure if F-droid was installed in the other system partition (since mine is a a/b device)

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information