gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-29 02:29:25 25 4
gpt4 key购买 nike

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

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

最佳答案

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


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


到底是什么意思您从代码中询问,是否如本例所示那样做意图并等待响应? Is it a proper way to get the response from Device Admin by onActivityResult

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


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


这是具有更高权限的设备管理员的顶部。您无需成为设备所有者即可安装证书,可以通过以下方法请求用户批准它:Programmatically add a certificate authority while keeping Android system SSL certificates或使用来自供应商(如Samsung Knox或LG)的api来完成。

通过执行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.

关于android - 未知管理员:ComponentInfo。设备所有者无法使用命令dpm set-device-owner进行设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50448390/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com