繁体   English   中英

未知管理员:ComponentInfo。 设备所有者无法使用命令dpm set-device-owner进行设置

[英]Unknown admin: ComponentInfo. Device owner not able to set using command dpm set-device-owner

我已完成设置设备管理员所需的一切。 但是当我运行“ dpm set-device-owner”时,总是得到未知的管理员:组件信息。 我要执行以下代码。 每当我在以下代码下运行时,遇到安全异常

   DevicePolicyManager deviceManager = ((DevicePolicyManager) getSystemService(Context.DEVICE_POLICY_SERVICE));
   deviceManager.installCaCert(localComponent, ret);

从您的问题中,我看到您指的是两种不同的东西:设备管理员和设备所有者。

  1. “我已完成设置设备管理员所需的一切”

什么意思 您从代码中询问,是否如本例所示那样做意图并等待响应? 这是通过onActivityResult从设备管理器获取响应的正确方法

您是否尝试过adb中的命令:dpm set-active-admin com.your.package / .your.device.admin.receiver?

  1. “但是当我运行“ dpm set-device-owner”时,总是得到未知的管理员:组件信息”

这是具有更高权限的设备管理员的顶部。 您无需成为设备所有者即可安装证书,可以通过请求用户按如下所示批准它来完成:以编程方式添加证书颁发机构,同时保留Android系统SSL证书或使用供应商提供的api,例如Samsung Knox或LG。

通过执行dpm set-active-owner com.your.package / .your.device.admin.receiver,您可以始终(如果设备允许,仅用于测试)将您的应用启用为设备所有者

https://developers.google.com/android/work/prov-devices-有关如何在没有ADB的情况下向具有设备所有者的设备进行配置的文档(最终用户设备)

DPM actions:

usage: dpm [subcommand] [options]
usage: dpm set-active-admin [ --user <USER_ID> ] <COMPONENT>
usage: dpm set-device-owner <COMPONENT>
usage: dpm set-profile-owner [ --user <USER_ID> ] <COMPONENT>

dpm set-active-admin: Sets the given component as active admin for an existing user.

dpm set-device-owner: Sets the given component as active admin, and its
  package as device owner.

dpm set-profile-owner: Sets the given component as active admin and profile  owner for an existing user.

暂无
暂无

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

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