Adding system (priv-)app after installation

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 (ro option; 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/dm5 is 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).

Person from the links here :wink:
I never got this working, so I’m also still very interested in a solution!

I had the same need as you to have F-Droid and Aurora store as priv-apps. I now build a custom ROM for my device with this included, which works fine for me, but I understand why you are not keen on the idea.

Before I built my custom ROM, I used NanoDroid to install a variety of things, including F-Droid and Aurora Store. This post gives details of how I used it to install a working version of MicroG in place of /e/OS’s fork. Full documentation available here

If you only want F-Droid and Aurora Store, then you don’t need to flash the whole package, just flash the ’ NanoDroid-fdroid module. I’m pretty sure that if you flash that zip file (via adb sideload) immediately after installing /e/OS, without first booting into /e/OS, then you should get what you want. Definitely worth a try anyway. Once installed, F-Droid will keep them up to date.

Good luck! :slight_smile:

As discussed in the previous topic, this (NanoDroid) doesn’t/didn’t work on a Fairphone 3 (and presumably, Fairphone 4). Are you saying that you tried this on a Fairphone and it worked?

Sorry - I haven’t read that topic in over a year :slight_smile:

That may or may not be true. But it is worth a try I would have thought

No, I’m not saying that: me devices are all Sony Xperias. But I still think it is worth trying NanoDroid on FP4. If it still doesn’t work, then we at least know a bit more :slight_smile:

Worth checking out this post in the Fairphone forums, which suggest that a working (but unofficial) TWRP does exist:

Also worth looking at this recent tutorial for installing MicroG on FP4 using NanoDroid. The same approach may work to install F-Droid etc. (No need/point to root, and install Magisk though - just flashing the zip should work. If it doesn’t then installing via Magisk is unlikley to either. And signature spoofing is already enabled - for system apps - in /e/OS so no need for that step either)

Fair enough – I was getting my hopes up there ever so slightly :smiley:

1 Like

Alright, I have access to a Fairphone 4 now, so I can definitely confirm that the same issue exists there as well and NanoDroid doesn’t work either. As for other options, OP (@fflori) already tested and confirmed that those don’t work on FP4.

This would all be so much simpler if /e/ just included the F-Droid Privileged Extension in the normal ROM!