-
Notifications
You must be signed in to change notification settings - Fork 104
ADB Reference
-
Android 1.6 (Donut): Pm.java / commandline.c
- Android 2.1.0 (Eclair): Pm.java / commandline.c
- Android 2.2.3 (Froyo): Pm.java / commandline.c
- Android 2.3.7 (Gingerbread): Pm.java / commandline.c
- Android 3.2.6 (Honeycomb): Pm.java / commandline.c (didn't find a tag for the release)
- Android 4.0.4 (Ice Cream Sandwich): Pm.java / commandline.c
- Android 4.3.1 (Jelly Bean): Pm.java / commandline.c
- Android 4.4.4 (KitKat) : Pm.java / commandline.c
- Android 5.1.1 (Lollipop): Pm.java / commandline.c
- Android 6.0.1 (Marshmallow): Pm.java / commandline.cpp
- Android 7.1.2 (Nougat): Pm.java / commandline.cpp
- Android 8.1 (Oreo): Pm.java / commandline.cpp
- Android 9.0 (Pie): PackageManagerShellCommand.java / commandline.cpp
- Android 10.0: PackageManagerShellCommand.java / commandline.cpp
- Android 11.0: PackageManagerShellCommand.java / commandline.cpp
- Android 12.0: PackageManagerShellCommand.java / commandline.cpp
-
AOSP master branch: PackageManagerShellCommand.java / commandline.cpp
-
pm disable-user
is supported since Android 4.0 (SDK API 14) but root privileges is needed before Android 6.0. - I was surprised to see that the multi-user system was already a thing since Android 4.2 (SDK API 17). This means we can use
pm disable-user [--user USER_ID]
(but with root). -
pm block/unblock [--user USER_ID]
only exists on Android 4.4 (SDK API 19-20) -
pm hide/unhide [--user USER_ID]
has been introduced in Android 5.0 (SDK API 20/21) and is a replacement ofpm block/unblock
. Needs root since Android 6.0
Puts the package in a blocked state, which is almost like an uninstalled state making the package unavailable, but it doesn't remove the data or the actual package file.
The adb command calls the runSetBlockedSetting(boolean state)
private method (ref) which then calls the setApplicationBlockedSettingAsUser(...)
method of the package manager (ref)
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
The adb command calls the runSetHiddenSetting(boolean state)
private method (ref) which then calls the setApplicationHiddenSettingAsUser(...)
method of the package manager (ref)
The user has explicitly disabled the application, regardless of what it has specified in its manifest. Because this is due to the user's request, they may re-enable it if desired through the appropriate system UI. Source
The adb commands calls runSetEnabledSetting(PackageManager.COMPONENT_ENABLED_STATE_DISABLED_USER)
(ref) which then calls the setComponentEnabledSetting(...)
method of the package manager to enforce the new state. (ref)