Your Android need not to have root access for truly disabling an app, if you've version 4.4.x or above. All you need is adb setup in PC and USB debugging enabled in a non-rooted device, or a terminal emulator app for a rooted device (you can use adb too).
If you check Package Manger's (pm
) usage, you would see
pm block [--user USER_ID] PACKAGE_OR_COMPONENT")
pm unblock [--user USER_ID] PACKAGE_OR_COMPONENT")
For Lollipop, it would be
pm hide [--user USER_ID] PACKAGE_OR_COMPONENT")
pm unhide [--user USER_ID] PACKAGE_OR_COMPONENT")
In order to block or hide a package (it is safe), simply do
pm block PACKAGE # for KitKat
pm hide PACKAGE # for Lollipop
To unblock or unhide the package, do
pm unblock PACKAGE #for KitKat
pm unhide PACKAGE # for Lollipop
PACKAGE
→ package name of an app. To know the package name of an app:
Append adb shell
before very command to execute them from PC.
The function behind hide has the following comment inside the source code
Puts the package in a hidden state, which is almost like an uninstalled state, making the package unavailable, but it doesn't remove the data or the actual package file. Application can be unhidden by either resetting the hidden state or by installing it
Similar commenting is done for block here.
In order to verify the claim, you can use some system services such as meminfo
, procstats
and activity
using the dumpsys tool or even list all the processes using ps
. You won't find an active presence of the blocked/hidden app.
The same goes for a lot of system apps disabled using GUI or pm disable
but not for every app since even a disabled app can receive broadcasts it has registered for, which can only be done if it is loaded into the memory1. Nevertheless, a disabled app cannot act on its own, neither can it be executed by any other app.
I've argued some of the differences between hide/block and disable on my question pm hide VS pm disable -- the identity crisis. It provides only supplementary info to this answer so you may skip it.
EDIT:
It appears that the technique doesn't work for all apps on Android KitKat. In that case, simply revoke read permission from app's APK or remove the extension .APK from the file name of the app (latter suggested by Jaskaranbir once), followed by a soft/full reboot. This is same as deleting an app from system, with only difference that all files would remain at their place.
Both of the steps can be executed using any root file manager app. The command line way is:
adb shell su -c 'chmod 000 /data/app/PACKAGE*' # 000 means no read-write-executable permission to user,group and others.
adb shell su -c 'mv /data/app/PACKAGE* /data/app/PACKAGE' # doing renaming by moving the file
adb reboot
1: Lacking technical evidence to support the fact
block/hide
) which makes me wonder what's causing the app to be loaded now. It is another matter that while it was loaded in the memory you can observe its superficial absence by lack of background, themes, status bar and more. Perhaps, a new question can be forged out of this..apk
and data behind" – so the app gets "completely unregistered and invisible to everything but the file manager", so other apps are no longer able to call its intents as they can't find them.