How to get rid of the file manager preinstalled app

@JBNCK I’m doing some tests to better understand the way “adb shell pm” works.

Before trying to uninstall the system preinstalled file system explorer I’d try to disable it and so I started making test with “adb pm enable” and “adb pm disable”.

I tried to enable the Faircom app that I had previously disabled using the system “setting” app.

pm enable com.fairphone.myfairphone

It worked as expected, the app reappeared in my list of available apps.

Then I tried to disable it again by running

pm disable com.fairphone.myfairphone

This time I had a Java runtime error:

Security exception: Shell cannot change component state for com.fairphone.myfairphone/null to 2

However, I can still disable it using the shortcut “app info” that appears when I tap on it.

I tried to restart the server through

adb kill-server
adb shell

but it didn’t solved the problem.

Apparently I can enable an app through “adb pm” but not disabling it.

Can you understand what happened?

Thanks.

Ciao,
Max

Try pm disable-user --user 0 com.fairphone.myfairphone

1 Like

It worked, now it reads:

Package com.fairphone.myfairphone new state: disabled-user

and the app is no longer visible in the app panel.

According to “pm list users” there is only one user, user 0, and it’s me. So what’s the difference between “pm disable” and “pm disable-user --user 0”?

The former disables the App, and it seems the user is not allowed to do this by default. The internet tells me the ADB shell needs root for this (perhaps a case for Android OSes which let you root the ADB shell via Rooted debugging without rooting the whole system).

The latter reads like it would instead disable the user for the App, which in practice disables the App for the user, and apparently the user is allowed to do this.

2 Likes

Thanks guys, I solved the problem using

pm disable-user --user 0  com.google.android.documentsui

And I also succeeded in have it reappearing through

pm enable com.google.android.documentsui

Ciao,
Max

2 Likes

So I got rid of the preinstalled file manager app but I can’t get the SimpleTools one the default.

When I’m in WhatsApp and I try to attached a file the file explorer that opens is the internal one, WhatsApp’s one (which could be OK, the app chose to open its own) but if I click on the top WhatsApp line saying “Browse other docs” I get the error message “you may not have a proper app for viewing this content”. If I do the same thing when the preinstalled file browser is enabled I have WhatsApp starting the preinstalled file browser without complaining.

What I guess is that somewhere in the system it’s written which is the default app to be used for file browsing. I succeded in disabling the preinstalled app but I can’t tell the phone to use the other one.

Any help?

1 Like

Sorry that I didn’t reply that fast because school. It looks like the problem is solved though. Also, if you ever wanted to uninstall a system app (not only disable) you could do:

adb shell pm uninstall --user 0 packagename

And to reinstall:

adb shell pm install-existing packagename

If you are rooted, you could delete the application file via root explorer. It should be somewhere in one of these directories:

  • /system/app/
  • /system/priv-app/
  • /product/app/
  • /product/priv-app/
  • /vendor/app/

Uninstalling does a bit more than disabling and it can be handy sometimes.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.