WSO2 EMM Agent with COSU not using NFC

ikusi-makusi

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

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?

Jason Lee

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

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.

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.

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".

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!

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

`

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"
    }
}

`

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

WSO2 EMM - What is purpose iOS Agent?

From Dev

WSO2EMM rebuilding the mobile agent fails

From Dev

WSO2 EMM provides API for development?

From Dev

Clustering of WSO2 EMM with redundant database

From Dev

WSO2 EMM - operation not working

From Dev

WSO2 EMM - WIFI operation not working

From Dev

WSO2 EMM - Usage limitations

From Dev

WSO2 EMM - Device Name

From Dev

What framework used in WSO2 Emm?

From Dev

How to run WSO2 EMM Jaggery Web App in a WSO2 EMM Carbon Server?

From Dev

Does wso2 emm provide space isolation?

From Dev

wso2 emm - unable to connect via external IP

From Dev

WSo2 EMM - App Management Database Bug

From Dev

Managing iOS devices from wso2 emm console

From Dev

WSO2 EMM: A way to expose API for a native app building?

From Dev

wso2 emm multiple tenants how to support themes

From Dev

Cannot access WSO2 EMM Store/Publisher on localhost

From Dev

WSO2 EMM - How can I add new report?

From Dev

WSo2 EMM - App Management Database Bug

From Dev

Auto Updating feature in WSO2 Appmanager and EMM

From Dev

WSO2 EMM Error occurred while registering the OAuth application : emm

From Dev

WSO2 EMM Error occurred while registering the OAuth application : emm

From Dev

WSO2 : Rebuild the Android agent application

From Dev

Android WSO2 EMM jks keystore Error prevents service from running

From Dev

which product should I use between wso2 emm and mdm roadmap

From Dev

Problems enrolling Windows Phone 8.1 client in WSO2 EMM 2.0

From Dev

WSO2 agent compilation error with Android Studio 2.1.3

From Dev

wso2 using the response and conditional

From Dev

Using WSO2 FHIR Connector