Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android uninstall device administrator using adb [duplicate]

Tags:

android

adb

I have installed quick heal mobile security on my android device(Micromax Canvas A110) android version 4.1.4. I am trying to uninstall it, but not able to do so. After further googling, I found out that we would have to deactivate it from device administrator menu in settings. I tried doing it, only to find that the window with options "cancel" and "deactivate" does not go away on clicking the "deactivate" button.

I tried to uninstall the app using the adb uninstall command after finding out the installed packages using: adb shell pm list packages which gave quick heal's package name as com.quickheal.platform.

But adb uninstall com.quickheal.platform command gives Failure

So how do I do it using adb?

like image 622
rahulserver Avatar asked Oct 25 '14 09:10

rahulserver


3 Answers

just execute this code in your app!

DevicePolicyManager mDPM = (DevicePolicyManager) this.getSystemService(Context.DEVICE_POLICY_SERVICE);
mDPM.clearDeviceOwnerApp(getPackage());
like image 32
midi Avatar answered Nov 14 '22 23:11

midi


I'm afraid there is no way to deactivate the device admin via adb. There has been made a proposal to open the device admin settings for quicker access in this post:

adb shell am start -S "com.android.settings/.Settings\$DeviceAdminSettingsActivity"

... however there is still some interaction needed.

On some devices the device administrator activity is not properly updated after confirmation in the dialog. So try to exit the settings menu completely and check whether it was just an UI issue.

Addition: according to comments below, it is possible to remove the device admin, if android:testOnly="true" or is missing from the AndroidManifest.xml file. Thx for the note!

like image 135
Trinimon Avatar answered Nov 14 '22 22:11

Trinimon


This is possible, although it requires a rooted device (su access), and is a little messy. It involves doing a search for the app via its fully qualified name, and manually removing (rm -f) each found entry.

See articulated answer here: https://stackoverflow.com/a/29093349/3063884

like image 2
CJBS Avatar answered Nov 14 '22 23:11

CJBS