adb shell pmhide execution error

Asked 2 years ago, Updated 2 years ago, 151 views

Run the adb shell pm hide and command on the Android 5.1.1 tablet device on a Windows 10 PC.

Error: java.lang.SecurityException:Neither user2000 nor current process has android.permission.MANAGE_USERS.

The error message appears.

Is the setting wrong?
I would appreciate it if you could let me know.
 

android adb

2022-09-30 19:01

2 Answers

In conclusion, you cannot do it unless you take root.

Error: java.lang.SecurityException:Neither user2000 nor current process has android.permission.MANAGE_USERS.

As shown in the log in , you have requested a permission for MANAGE_USERS.

As shown below, MANAGE_USERS can only be given to pre-installed apps.

https://android.googlesource.com/platform/frameworks/base/+/master/core/res/AndroidManifest.xml#1708

<permission android:name="android.permission.MANAGE_USERS"
    android:protectionLevel="signature|privileged"/>

Also, the permission of MANAGE_USERS has been removed for Shell due to the following security measures.
https://android.googlesource.com/platform/frameworks/base/+/f5cea03eb036c05cacc711ff90c97a48ffb2bc17%5E%21/

As this is a security patch (if the manufacturer supports it), the above patches should be applied regardless of the OS version.


2022-09-30 19:01

The PackageManager hide command format is as follows, so I think the commands in the questionnaire exactly specify the package or component name in the executed command.

pm hide [--userUSER_ID] PACKAGE_OR_COMPONENT

Error: java.lang.SecurityException:Neither user2000 no current
process has android.permission.MANAGE_USERS.

This error indicates that a user with a UID of 2000 (uid=2000(shell)) or the process running the command, or the shell process, is not given permission of android.permission.MANAGE_USERS, resulting in a security error and cannot execute the command.

Run the following command to verify that shell has the appropriate permissions:
You cannot execute the command without permission.

adb shell dumpsys package com.android.shell

Supplemental

The pmhide command was executable on the following terminals:

  • Nexus 5 (Android 5.1.1)
  • Xperia Performance (Android 6.0.1)

As H.H. said, I think devices prior to Android 6.0.1 will depend on the manufacturer's implementation.
Announcement of Android security patches
CVE information


2022-09-30 19:01

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.