5

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?

rahulserver
  • 10,411
  • 24
  • 90
  • 164
  • first you have to disable the admin mode then you will be able to uninstall app. to remove active admin first you run this command adb shell dpm remove-active-admin com.kiosk.example/com.kiosk.example.MyDeviceAdminReceiver (com.kiosk.example) is package name replace it with your own. when this command give success then you can uninstall app. or run this command to uninstall adb uninstall com.kiosk.example. – Mudassir Khan Apr 29 '19 at 07:32

3 Answers3

5

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!

Trinimon
  • 13,839
  • 9
  • 44
  • 60
  • The option is disabled in that settings screen for me. I mean I can see my app but I can't uncheck the option. – sorin.silaghi Aug 09 '17 at 21:56
  • 2
    Actually, it can be done with: adb shell dpm remove-active-admin "component.name/DeviceOwner". Found this here: https://stackoverflow.com/questions/49128293/how-to-remove-set-device-owner-in-android-dpm – Stephen M -on strike- Jul 27 '18 at 21:52
  • 2
    It should be noted, my comment above only works if android:testOnly="true" or is missing from the AndroidManifest.xml file. Otherwise Android (6.0 at least) gets cranky and won't let you make the app not an active admin. – Stephen M -on strike- Jul 30 '18 at 22:34
4

just execute this code in your app!

DevicePolicyManager mDPM = (DevicePolicyManager) this.getSystemService(Context.DEVICE_POLICY_SERVICE);
mDPM.clearDeviceOwnerApp(getPackage());
Alex P.
  • 30,437
  • 17
  • 118
  • 169
midi
  • 3,128
  • 5
  • 30
  • 47
2

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

Community
  • 1
  • 1
CJBS
  • 15,147
  • 6
  • 86
  • 135
  • why would some one root a device if they are the device owner? – amalBit Jun 29 '16 at 13:55
  • @amalBit Device Owners cannot do everything that root can. For instance, replacing the boot/start up animations. – Stephen M -on strike- Jul 27 '18 at 21:51
  • @StephenM That's the point. If you have root access, you can do everything. Thereby, you don't need device owner permission. However, Device owner permission is used mostly in a corporate setup, where they want to enable BYOD or COSU(corporate owned single-use device | used for single purpose, receiving a booking(cab aggregation), kiosk apps etc). In the second usecase, no one wants to void their warranty. – amalBit Jul 28 '18 at 07:47
  • 1
    @amalBit Ah... I misread you post. Thanks for the clarification. – Stephen M -on strike- Jul 30 '18 at 13:42