Detailed question about uninstall preinstalled apps possibility

Hey,

Intro / background ... skip if not interested

I installed iodeOS these days on my Fairphone5, mainly because there are not much alternatives yet and a second reason was the possibility to easy uninstall preinstalled apps (which I could not do easily with /e/OS … started to disable a lot of apps there).

A couple of messages were flagged/removed in the /e/OS Forum, as I probably mentioned iodeOS to often :grimacing:

I didn’t wanna talk or judge or compare these 2 ROMs against each other, it is just that iodéOS fits better for my personal needs right now.

Back to iodéOS:
I also rooted it → rooting method, so I could also use root to completely uninstall packages, but why go for this effort if the ROM has such a feature on board.

As I have my Apps I like to use (K9 for Mail; Mull as Browser; Aves Libre as Gallery; etc. etc.) I uninstalled a lot of preinstalled apps during the first setup. So all this is fine but, …

I would like to know the details of this uninstallation possibilities. As re-install is possible as well, I guess “something” will stay on the device of all these apps.

  • Can one elaborate what this “something” is?
    • Is it only the APKs of these apps in a system partition?
  • How is the uninstall and reinstall technically done? (is it like described here in the /e/OS Forum? or some code snippets below)

I know this blog-post - Why you should have the freedom to uninstall preinstalled apps and how to do so with iodéOS - but it does not go into technical details .

Thx

## here an uncritical system app (all the preinstalled / shipped with ROM apps are system Apps):
:/ # pm list package -s | grep egg
package:com.android.egg

:/ $ pm uninstall --user 0 com.android.egg                                                                                                                
Success

## could not be uninstalled completely without having more privs of course
:/ $ pm uninstall com.android.egg                                                                                                                         
Failure [DELETE_FAILED_INTERNAL_ERROR]

## and after the user 0 uninstall, it is still visible/stays e.g. here:
:/ $ ls /system/app
...
EasterEgg
...

:/ $ cmd package install-existing com.android.egg                                                                                                       
Package com.android.egg installed for user: 0
## the same as? 'pm install-existing --user 0 com.android.egg'

The app removing mechanism of iodéOS is performed by low level system functionalities (bind mount). The system partitions are not modified, the APKs are still present, but the files are completely hidden to the system. If you look at a directory of one of these apps after uninstalling it, like /system/product/app/ExactCalculator for the calculator, you’ll see it empty.
Please note that this may enter in conflict with Magisk, which is not supported.
You cannot remove apps in the system partitions with ‘pm uninstall’ : this command can only remove user apps, installed in the userdata partition.

Interesting. Thx for sharing.


Please note that this may enter in conflict with Magisk, which is not supported.

You mean as Magisk does something similar with it’s overlay approach? ( Developer Guides | Magisk ) So far I don’t have any issues, but I also don’t do something in addition with these specific apps and Magisk (to uninstall or hide folders or so)


Yeah I think so too, so we should differ between what iodéOS is doing (whatever command or code is used to do it) and these commands which is another way to do something with installed apps but only in a user context and what pm is capable of (disable/enable/uninstall/install apps for a user).