需要密码code禁用Android设备管理器 [英] Require Pass-code to Disable Android Device Administrator

查看:291
本文介绍了需要密码code禁用Android设备管理器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在想的安全应用程序,这将有装置管理员权限。我想看看是否有可能需要密码code当用户试图取消该应用程序为根据设置 - >安全 - >设备管理员的管理员。这会增加一个路障,以不轻易允许用户卸载应用程序,因为他们首先需要从应用程序(为此,他们需要用密码进行身份验证)中删除管理员权限,然后他们可以卸载。我们的想法是为父母安装在他们孩子的手机安全应用程序,没有孩子很容易将其卸载。请问这样的事情有可能没​​有root访问权限?

I was thinking of a security app which will have device administrator privileges. I wanted to see if it was possible to require a pass-code when the user tries to uncheck the app as an administrator under Settings->Security->Device Administrators. This would add a roadblock to not easily allow the user to uninstall the app as they would first need to remove the admin privileges from the app (for which they would need to authenticate with a password) and then they could uninstall. The idea is for parents to install a security app on their kids' phones and not have the kids uninstall it easily. Would something like this be possible without root access?

推荐答案

启动密码code活性onDisableRequested()方法(DeviceAdminReceiver的覆盖方法)

Start the pass-code activity in onDisableRequested() method (an override method of DeviceAdminReceiver)

在的Andr​​oid 2.3 只要点击按钮开启或关闭您的活动将被打开。

In Android 2.3 As soon as deactivate button is clicked your activity will open.

这是Android的4.x版 经过大约5-10秒会打开该活动被点击按钮开启或关闭时。 所以,你可以锁定来自onDisabled设备()方法,而不是onDisableRequested()。

From Android 4.x The activity opens after around 5-10 secs when deactivate button is clicked. So you can lock the device from onDisabled() method instead onDisableRequested().

这篇关于需要密码code禁用Android设备管理器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆