there is f-droid privilege extension
https://f-droid.org/en/packages/org.fdroid.fdroid.privileged.ota/
with it you should be able to install apps without having to enable "unknown source".
there are two ways to install. one using sideload. another using adb root. i will explain both below.
if done correctly fdroid with the privilege extension should even survive a reset to factory settings. it is a part of the system then.
preparations for both install methods
download the f-droid privilege extension from f-droid website to your pc.
https://f-droid.org/en/packages/org.fdroid.fdroid.privileged.ota/
to download you need to scroll down then download the latest zip. the filename should be something like this: org.fdroid.fdroid.privileged.ota_2110.zip
install adb on your pc and enable "usb debugging" on your device. search the internet for how to do that.
adb is a command line tool so open a terminal. then navigate to the directory where the privileged extension zip file is located.
connect the device to your pc using an usb cable.
verify that the device is recognized using the command adb devices
.
it should show something like this:
$ adb devices
List of devices attached
<some number> device
if it says unauthorized
or anything else you need to debug your connection. search the internet for how to do that.
the sideload method
for this you need a custom recovery which allows sideload installed on your device.
if you have lineageos installed you typically already have a suitable custom recovery. otherwise download and install twrp (https://twrp.me/).
connect your device to pc with usb cable. verify device is listed under
adb devices
boot your device to sideload
adb reboot sideload
OR: boot your device to recovery
adb reboot recovery
then on your device in recovery set the device to sideload. in the lineageos recovery this is called "apply update" then "apply from ADB".
install privilege extension by sideload
adb sideload org.fdroid.fdroid.privileged.ota_2110.zip
reboot device back to android.
adb reboot
OR: click on reboot in the recovery menu
check if privilege extension is enabled. see below for how to do that.
more information:
the adb root method
for this you also need "rooted debugging" enabled on your device (alongside "usb debugging").
it seems "rooted debugging" is only available if you have a custom rom like lineageos installed.
unzip the downloaded privilege extension.
now run the following adb commands one by one
adb root
adb remount
adb push F-DroidPrivilegedExtension.apk /system/priv-app/
adb push permissions_org.fdroid.fdroid.privileged.xml /system/etc/permissions/
adb push F-Droid.apk /system/app/
adb push 80-fdroid.sh /system/addon.d/
adb reboot
verify that there are no error messages after each step. except adb remount
which seems to be unnecessary on recent lineageos versions. but no harm done (as far as i understand) so continue anyway.
after reboot check if privilege extension is enabled.
more information:
how to check if the privilege extension is enabled
- open f-droid
- go to settings
- scroll all the way down
- enable expert mode (will open more settings to the bottom)
- scroll all the way down again
- if you see a green checkmark beside "privileged extension" then it is enabled.
"privileged extension" is the very last option in the settings page. if you have scrolled all the way to the bottom and the last option is not "privileged extension" then the privileged extension is not enabled. also probably not correctly installed.
notes:
i have installed many fdroid with privilege extensions on many lineageos on many devices. often there were hiccups along the way and it does not work for reasons that i do not understand.
most of the time i managed to get it working after some searching on the internet and some tinkering. sometimes it seems just dumb luck getting the right command combination by coincidence to get it to work.
sometimes it just does not work. sorry that i cannot help you further then.