简体   繁体   English

Android 设备所有者模式由应用程序签名使用平台密钥(或使用签名的应用程序自定义设备策略)

[英]Android Device Owner Mode by App Signed with platform key (or use signed App for custom device policy)

I have application signed by platform key and I need to move device to kiosk mode.我有平台密钥签名的应用程序,我需要将设备移动到信息亭模式。

What kiosk mode mean in my case:在我的情况下,信息亭模式意味着什么:

  • Set user restrictions (change default activities, set VPN etc...)设置用户限制(更改默认活动、设置 VPN 等...)
  • Prevent user access to third party apps, some system apps etc...阻止用户访问第三方应用程序、某些系统应用程序等...
  • Set custom Activity as Home activity without user interaction将自定义活动设置为主页活动,无需用户交互
  • Move application to lock task mode将应用程序移动到锁定任务模式

I know that DevicePolicyManager could do that.我知道 DevicePolicyManager 可以做到这一点。 But device doesn't have any google's provisioning system (like NFC or QR).但设备没有任何谷歌的配置系统(如 NFC 或 QR)。 Is exist any way to set device owner using application signed by platform key or use such application with benefits of device owner App?是否存在使用平台密钥签名的应用程序设置设备所有者或使用具有设备所有者应用程序优势的此类应用程序的任何方法?

I find out that application with system privileges could do al lot of thing that could be done with DevicePolicyManager.我发现具有系统权限的应用程序可以做很多可以用 DevicePolicyManager 完成的事情。 But some of functionality provided as hide API:但是作为隐藏 API 提供的一些功能:

  1. Set user restrictions - could be done with UserManager设置用户限制 - 可以通过 UserManager 完成
  2. Prevent user access to third party apps - could be done be disabling such apps with package manager防止用户访问第三方应用程序 - 可以使用 package 管理器禁用此类应用程序
  3. Set custom Activity as Home activity without user interaction - could be done with PackageManager将自定义活动设置为主页活动,无需用户交互 - 可以使用 PackageManager 完成
  4. Move application to lock task mode - could be done by disabling UI components in status bar and system navigation bar with StatusBarService将应用程序移动到锁定任务模式 - 可以通过使用 StatusBarService 禁用状态栏和系统导航栏中的 UI 组件来完成

The platform key only gives you certain permissions to take a certain role or to make some system settings, but for your task you are mainly right with the DevicePolicyManager.平台密钥仅授予您某些权限以担任某个角色或进行某些系统设置,但对于您的任务,您主要使用 DevicePolicyManager。 I do not see why you need NFC or QR for that, you could implement a simple code to unlock the kiosk mode.我不明白你为什么需要 NFC 或 QR,你可以实现一个简单的代码来解锁 kiosk 模式。

There are of course finished applications to do that and you would not need to re-invent the wheel as this kind of application is not trivial.当然有完成的应用程序可以做到这一点,您不需要重新发明轮子,因为这种应用程序并非微不足道。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM