My question is general, but here is also my more specific goal: I'm trying to install f-droid privileged extension and aurora services as system apps, so that I can queue the apps I want to install/update instead of having to tap "install", approve the installation, wait for it to finish, before moving on with the next app. I'm using a Fairphone 4, for which TWRP doesn't seem to exist.
I'm aware of the following: forum topic (and the previous question from the same person), gitlab issue, and the related questions/proposals linked from there (sorry, I have a limit of 2 links per post) however none of these fully answers the question.
I tried the following methods:
- Using the recovery with
adb sideload("Apply update"). The app is correcly copied into the
/mnt/system/priv-app/, however this is a mountpoint for
/dev/block/dm2, which is not mounted after a "regular" boot.
- After a regular boot, it is possible to use adb with root permissions. This shows that, the system directory is inside the root partition, sitting in
/dev/block/dm5. However it is mounted in read-only mode (
rooption; this is normal in Android and its forks), and trying to remount it in read-write mode (
mount / -o remount,rw) fails with an error. Also trying to mount it (in read-write mode) to a different location fails.
- Using the adb shell in the recovery doesn't work either, since
/dev/block/dm5is not available there.
So my actual questions are:
- Did I do something wrong? Based on the other questions it doesn't look likely, but I may have misunderstood.
- Is there any way, other than building a custom system (which I would rather avoid, since it would prevent system updates to happen without a new cycle of unlock bootloader-flash-lock bootloader and its consequent data loss due to factory reset), to install an app as system app?
- Would it be possible to "flash" it just after the system from the bootloader? And if it is the case, would it be erased by the factory reset when locking the bootloader? The answer to the last question is no, to my understanding, but I'm not really an android expert (yet).
Note that, as I stated in the beginning, TWRP is not available in my specific case, and even if it were, I would be interested in the question "Can it be done without it?". Rooting is probably not an answer, since the installation of magisk may suffer of the same probems (besides, I have gained root access from adb and this has got me nowhere).