0

I programmatically gave my android application Device Administration access. I can now successfully enable and disable admin access through my application. But my app is showing in android settings-> Security -> Device Administrators. Through that also my application is able to enable and disable. Please help me to provide a way to hide my app in Device Administrators so that i can enable and disable my application's admin access only through application.

  • you can hide your application from launcher, and you only know that application is there and after hiding also it will show in apps inside settings and it will show in device administrator also. – Hanuman Jul 02 '15 at 08:37

3 Answers3

3

But my app is showing in android settings-> Security -> Device Administrators.

Which is totally normal.

You can't. And that would be a security issue if you could "hide an administrator application"...

shkschneider
  • 17,833
  • 13
  • 59
  • 112
  • Thanks for replying.. Yahe I know its for security reason.. but for my entrprise build i should not allow anyone to uninstall my application at anycost.. please suggest one solution for this.. there are applications like facebook which is coming with phone which cannot remove from phone and not showing in device administrator... – Afsal B Bavummal Jul 02 '15 at 09:35
  • **You can't** "disallow anyone to uninstall your application"... What were you expecting, come on. The only way around, if in a in-house distribution, would be to install the application as system, but then it *obviously* won't be hidden from `settings-> Security -> Device Administrators`. – shkschneider Jul 02 '15 at 09:38
  • Can you suggest any other way to make my app uninstallable... :) – Afsal B Bavummal Jul 02 '15 at 09:42
  • 1
    I just did: the only way is to have it *system*. Otherwise: **you can't**, again, for obvious reasons... Imagine everyone spreading apps to Google Play that are *uninstallable* lol... – shkschneider Jul 02 '15 at 09:44
  • Ha ha... you are right... I know that... to make system app we need to root our phone right? is there any way with out rooting... thanks for replying... I'm really stuck in it.. – Afsal B Bavummal Jul 02 '15 at 09:47
  • No you don't have the privileges to write to system partition as non-root. You either get root and make your application root (but again, it could be visible and deactivate from device administrators), or build a custom ROM lol – shkschneider Jul 02 '15 at 11:43
0

We can disable administrator privilege in order to hide the app from there.But the app can not access device administrator feature like detect wrong password entered, password succeeded, lock screen, disable camera etc.

atifali
  • 193
  • 16
0

Of course you can't hide the device administrator itself in the setting but you can set an password+disable device administrator notification when the user attempt to disable it from the setting. They will only allow to disable the device administrator if they know the password. Simple :)