1
votes

I am working on implementing the WSO2 IoT server in my organisation. I can already enroll BYOD devices and everything works fine. Now, I also want to be able to enroll COPE-devices, so I can use operations such as upgrading firmware and factory resetting a device.

I'm working on Windows 10.

  • Android Studio version: 3.1.3
  • WSO2 IoT version: 3.3.0
  • IOT runs on Ubuntu Linux 18.04
  • The lowest android version I want to enroll: 6.0.1

I tried to use the following documentation, but I'm having trouble understanding some of the steps.

https://docs.wso2.com/display/IoTS330/Integrating+the+Android+System+Service+Application

Step 1b:

Replace the android.jar file that is in the //platforms/android- directory with the android.jar file. You can get the new jar file using one of the following options:

Download the Android Open Source Project (AOSP) and build the source code to get the jar file for the required SDK level.

Use a pre-built jar file from a third party developer. You can find it here.

Make sure to use the jar file that matches the compileSdkVersion of the WSO2 Android agent. Currently, the compileSdkVersion is 25.

I know how to replace the android.jar file, but I'm not sure which API level I should be working with. We have a lot of different devices, with different android versions (the lowest being 6.0.1). Can I just build the APK with the lowest android version, so that newer android versions can work with that APK?

Step 1c:

Open the system service application source code via Android Studio and clean build it as a usual Android application.

I don't really understand this one. What do they mean with clean building the application? Are there steps I can follow to do this, or do they expect me to know how to build the application myself? I'm not very experienced with programming and I never worked with Android Studio. I downloaded the source code, but I don't know if and what I have to change to make COPE enrollment possible. Do I have to know how to build applications so I can build the right APK?

I have more questions about the other steps, but I'll leave it at this for now. I think that if I know how to correctly build the APK which is able to let a device be enrolled as COPE, I can get a lot further.

Thanks in advance!

By the way, this is my first time posting on Stackoverflow. Please let me know if I'm doing something wrong here :).

Edit: So I kind of figured out how to generate an apk file. Now i only need to know what directory in the IOT source code I should be editing and how I should edit it. Has anyone ever build the Android Agent application so that the device can be registered as a COPE-Device? I feel like they expect me to know how to build Android apps to be able to accomplish this. Is this the case? If so, (how) can I build the application, if I don't have any Android app programming experience? Also, how exactly are the android.jar and the SDK files related to the APK file I should be building?

2

2 Answers

0
votes

Good one about system service application WSO2 signing system service app

Seems that system service app is not for us. I would be OK with options 1 or 2. No need for firmware update as you mentioned.

My devices are rooted so maybe I would be able to use it. WSO2 IoT Server - Device Owner in COPE scenario "You need to get the system application signed by you vendor or root the device and provide the system user privileges to the system application in order to archive the full functionality of COPE enrollment like firmware upgrade "

0
votes

Also, from https://github.com/wso2/cdmf-agent-android/issues/69

"For the earlier Android versions where the Device-owner concept doesn't supports, you have to go with 'generic agent' plug 'system-app' collaboration to fulfill COPE level features like silent app installation."

Seems that it matters which Android version is your device running.