Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove an app with active device admin enabled on Android?

I wrote an app with device admin enabled (DevicePolicyManager) and installed. But when I want to uninstall it, it returns failed with this message

WARN/PackageManager(69): Not removing package com.mypackage.test: has active device admin

How can I uninstall it, or uninstall it programmically? Thanks.

like image 851
shiami Avatar asked Mar 22 '11 06:03

shiami


People also ask

How do I delete unauthorized apps?

YOU CAN TRY (1ST PROCESS) "SETTINGS>APPS>(LOOK FOR AN UNIDENTIFIED APP)>UNINSTALL".

What will happen if I activate device admin app?

Like other MDM software, Device Administrator applications can set policies on usage of the phone. They can enforce password complexity requirements, automatically lock the device, disable installed applications, and even wipe the device, all without any confirmation or approval from the user.


2 Answers

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.

like image 145
Atmaram Avatar answered Oct 25 '22 01:10

Atmaram


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

like image 41
Reed Avatar answered Oct 24 '22 23:10

Reed