具有COSU的WSO2 EMM代理未使用NFC [英] WSO2 EMM Agent with COSU not using NFC

查看:134
本文介绍了具有COSU的WSO2 EMM代理未使用NFC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经构建了最新版本的wso2 emm android代理(cdmf-agent-android v3.1.30),并在IoT服务器3.1.0的BYOD模式下进行了一些初始测试

I have built the latest version of wso2 emm android agent (cdmf-agent-android v3.1.30) and got some initial tests working in BYOD mode with IoT server 3.1.0

为COSU构建时,它正在等待通过NFC与另一台设备进行供应.但是我想提供没有NFC的设备.我有什么选择?我可以以编程方式触发自定义设置选项吗?

When built for COSU it is waiting for provisioning with another device via NFC. But I want to provision devices without NFC. What options do I have? Could I trigger programmatically a custom provisioning option?

推荐答案

有一些选项可以执行此操作,具体取决于您的android版本.

There are some options to do this, depending on your android version.

我将从最简单的选项开始.如果您使用的是Android 7+,则可以使用QR码设置,该过程与NFC设置完全相同.您可以从Google查看有关的一些规范.

I will start with the simplest option. If you have Android 7+ you can use QR Code provisioning, this follows the exact same process as NFC provisioning. You can see some specifications from Google regarding this.

第二个选项比较棘手,并且需要一些自定义开发人员.使您的设备成为设备所有者的第一件事(对于COSU模式,这是必需的,请阅读有关设备所有者的信息这里).使用命令:adb shell dpm set-device-owner org.wso2.iot.agent/org.wso2.iot.agent.services.AgentDeviceAdminReceiver

The second option is a bit trickier and requires some custom dev on your side. First thing to to make your device a Device Owner (Which is needed for COSU mode, read up about Device Owner here). Using the command: adb shell dpm set-device-owner org.wso2.iot.agent/org.wso2.iot.agent.services.AgentDeviceAdminReceiver

注意:只能设置一个设备所有者,要删除设备所有者,必须将设备恢复出厂设置.

Note: Only one device owner can be set, to remove a device owner the device has to be factory reset.

完成此操作后,您可以使用adb shell am start -n "org.wso2.iot.agent/org.wso2.iot.agent.activities.SplashActivity"启动应用.

Once this is done you can launch your app using adb shell am start -n "org.wso2.iot.agent/org.wso2.iot.agent.activities.SplashActivity".

以上内容可以使您的应用正常运行,但现在它必须进行身份验证才能与服务器进行通信.使用NFC设置时,访问令牌作为"android.app.extra.token"作为额外的捆绑包提供在您的附加捆绑包中,您可以按以下步骤在启动意向中插入此附加令牌:adb shell am start -n "org.wso2.iot.agent/org.wso2.iot.agent.activities.SplashActivity" --es android.app.extra.token generated_access_token.您将必须编辑SpashActivity类以接受此令牌,并遵循应用程序中内置的常规身份验证过程.

The above will get your app to run correctly but now it has to authenticate itself to communicate to the server. When using NFC provisioning an Access Token is delivered in the Extra Bundle as 'android.app.extra.token', you can insert this extra in the launch intent as follows: adb shell am start -n "org.wso2.iot.agent/org.wso2.iot.agent.activities.SplashActivity" --es android.app.extra.token generated_access_token. You will have to edit the SpashActivity class to accept this token and follow the general authentication processes built into the app.

这可能会晚一点,但我希望它还是有帮助的!

This may be a little bit late but I hope it is still helpful!

您可能会喜欢一些额外的信息,这是所使用的NFC消息的字符串表示形式,以下是NFC设置应用中设置的规范:

Some extra information you may appreciate, here is a string representation of the NFC message used, these are the specifications set in the NFC Provisioning App:

`

#Thu Apr 12 13:42:11 GMT+02:00 2018
android.app.extra.PROVISIONING_LOCAL_TIME=1523533331087
android.app.extra.PROVISIONING_TIME_ZONE=Asia/Colombo
android.app.extra.PROVISIONING_SKIP_ENCRYPTION=true
android.app.extra.PROVISIONING_WIFI_SECURITY_TYPE=WPA
android.app.extra.PROVISIONING_WIFI_PASSWORD=PASSWORD
android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION=LOCATION_OF_APK
android.app.extra.PROVISIONING_WIFI_SSID="WIFI_SSID_NAME"
android.app.extra.PROVISIONING_LOCALE=en_US
android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_CHECKSUM=E8PtiqUOcqKi5IXeRBF-5Br0zXg
android.app.extra.PROVISIONING_ADMIN_EXTRAS_BUNDLE=\#admin extras bundle\n\#Thu Apr 12 13\:42\:11 GMT+02\:00 2018\nandroid.app.extra.token\=GENERATED_ACCESS_TOKEN\n
android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME=org.wso2.iot.agent

`

QR码表示的示例为:

An example of a QR Code representation would be:

`

{
"android.app.extra.PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME": "org.wso2.iot.agent/org.wso2.iot.agent.services.AgentDeviceAdminReceiver",
"android.app.extra.PROVISIONING_DEVICE_ADMIN_SIGNATURE_CHECKSUM": "CSGeivCEHdJrPT0qy4W67LZSy32Fus7GyUn0jE5o028",
"android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION": "APK_DOWNLOAD_LOCATION",
    "android.app.extra.PROVISIONING_SKIP_ENCRYPTION": false,
    "android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME": "org.wso2.iot.agent",
    "android.app.extra.PROVISIONING_ADMIN_EXTRAS_BUNDLE": {
        "android.app.extra.token":"GENERATED_ACCESS_TOKEN"
    }
}

`

这篇关于具有COSU的WSO2 EMM代理未使用NFC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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