如何删除在 Android 上启用了活动设备管理的应用程序?

我编写了一个启用了设备管理的应用程序(DevicePolicyManager)并安装了它。 但是当我想卸载它时,它返回失败,并且返回这个消息

WARN/PackageManager (69) : 没有删除包 com.mypackage.test: has active device admin

我如何卸载它,或卸载它的程序? 谢谢。

459379 次浏览

Go to SETTINGS->Location and Security-> Device Administrator and deselect the admin which you want to uninstall.

Now uninstall the application. If it still says you need to deactivate the application before uninstalling, you may need to Force Stop the application before uninstalling.

You could also create a new DevicePolicyManager and then use removeAdmin(adminReceiver) from an onClickListener of a button in your app

//set the onClickListener here
{
ComponentName devAdminReceiver = new ComponentName(context, deviceAdminReceiver.class);
DevicePolicyManager dpm = (DevicePolicyManager)context.getSystemService(Context.DEVICE_POLICY_SERVICE);
dpm.removeActiveAdmin(devAdminReceiver);
}

And then you can uninstall

Enter vault password and inside vault right top corner options icon is there. Press on it. In that ->settings->vault admin rites to be unselected. Work done. U can uninstall app now.

On Samsung go to "Settings" -> "Lock screen and security" -> "Other security settings" -> "Phone administrators" and deselect the admin which you want to uninstall.

The "security" word was hidden on my display, so it was not obvious that I should click on "Lock screen".

For Redmi users,

Settings -> Password & security -> Privacy -> Special app access -> Device admin apps

Click the deactivate the apps

Redmi/xiaomi user

Go to "Settings" -> "Password & security" -> "Privacy" -> "Special app access" -> "Device admin apps" and select the account which you want to uninstall.

Or Simply

go to setting -> Then search for Device admin apps -> click and select the account which you want to uninstall.

If you known the package name,with abd you can remove the device owner

adb shell dpm remove-active-admin packagename/.yourAdminReceiver

then

adb uninstall packagename

On a Samsung Galaxy S9 with Android 10 and One UI 2.0: Biometrics and security -> Other security settings -> Device admin apps.