HOW-TO Firmware updates directly from your (web) server using intents

Explanation

The purpose of this How-To is to help people installing firmware remotely with the use of an EMM like SOTI MobiControl, SureMDM and others. While normally you would sync the firmware to your device first, these intents described below will let your terminal download the firmware from a (web) server. More off a pull principle instead of a push principle.

Intent for downloading and installing the firmware with Datalogic OEMConfig

Below the Scan2deploy intents to instruct OEMConfig to download and install the firmware. After the installation a (manual) reboot is necessary.

Adb:

am broadcast -a datalogic.scan2deploy.intent.action.START_SERVICE -n "com.datalogic.scan2deploy/.S2dServiceReceiver" --es encoding json --es data "{\"global\":{\"oemconfig\":true},\"app-config\":{\"com.datalogic.settings.oemconfig\":{\"key_ota_update_bundle\":{\"key_ota_update_reset_type\":\"0\",\"key_ota_update_file_name\":\"%URL%\"}}}}"

SOTI MobiControl:

sendIntent -b "intent:#Intent;component=com.datalogic.scan2deploy/.S2dServiceReceiver;action=datalogic.scan2deploy.intent.action.START_SERVICE;S.encoding=json;S.data={\"global\":{\"oemconfig\":true},\"app-config\":{\"com.datalogic.settings.oemconfig\":{\"key_ota_update_bundle\":{\"key_ota_update_reset_type\":\"0\",\"key_ota_update_file_name\":\"%URL%\"}}}};end"

Where %URL% fill in your download location. For example: https://download.server.com/firmware.zip

Scan2deploy agent and OEMConfig are necesarry to be installed on the device (Default)

Intent for downloading and installing via Scan2Deploy only

This intent will let you download the firmware with Scan2Deploy. It is a bit harder to setup since you need to specify host and path specifically. Advantage is that you can do an automatic reboot at the end.

Adb:

am broadcast -a datalogic.scan2deploy.intent.action.START_SERVICE -n "com.datalogic.scan2deploy/.S2dServiceReceiver" --es encoding json --es data "{\"global\":{\"script\":[\"[Install]\",\"COPY /sdcard/Download/scan2deploy.archive /sdcard/Download/targetFW.zip true\",\"SHELL am startservice -n com.datalogic.systemupdate/.SystemUpgradeService --ei action 2 --es path /sdcard/Download/targetFW.zip --ei reboot 1 --ei reset 0 --ei force_update 1\"],\"action\":\"close\"},\"deployment\":{\"scheme\":\"https\",\"host\":\"%HOST%\",\"port\":443,\"path\":\"/%PATH% \"}}"

SOTI MobiControl:

sendIntent -b "intent:#Intent;component=com.datalogic.scan2deploy/.S2dServiceReceiver;action=datalogic.scan2deploy.intent.action.START_SERVICE;S.encoding=json;S.data={\"global\":{\"script\":[\"[Install]\",\"COPY /sdcard/Download/scan2deploy.archive /sdcard/Download/targetFW.zip true\",\"SHELL am startservice -n com.datalogic.systemupdate/.SystemUpgradeService --ei action 2  --es path /sdcard/Download/targetFW.zip --ei reboot 1 --ei reset 0 --ei force_update 1\"],\"action\":\"close\"},\"deployment\":{\"scheme\":\"https\",\"host\":\"%HOST%\",\"port\":443,\"path\":\"/%PATH%\"}};end"

Example is based on a https file server. Fill in your host server where %HOST% is (for example download.server.com) and the file location where %PATH% is.
For example: /download/firmware/firmware.zip
Downloading and installing happens in the background. To check if the file is being downloaded use the Files application and check in the Internal Storage\Download folder on the Scan2Deploy archive file to grow.

Intent for downloading firmware without installation

In case you want to separate the download and install of the firmware below the intents to do it separately. In this script the firmware will end up in the Download directory with the name targetFW.zip.

Adb:

am broadcast -a datalogic.scan2deploy.intent.action.START_SERVICE -n "com.datalogic.scan2deploy/.S2dServiceReceiver" --es encoding json --es data "{\"global\":{\"script\":[\"[Install]\",\"COPY /sdcard/Download/scan2deploy.archive /sdcard/Download/targetFW.zip true\"],\"action\":\"close\"},\"deployment\":{\"scheme\":\"https\",\"host\":\"%HOST%\",\"port\":443,\"path\":\"/%PATH%\"}}"

SOTI MobiControl:

sendIntent -b "intent:#Intent;component=com.datalogic.scan2deploy/.S2dServiceReceiver;action=datalogic.scan2deploy.intent.action.START_SERVICE;S.encoding=json;S.data= {\"global\":{\"script\":[\"[Install]\",\"COPY /sdcard/Download/scan2deploy.archive /sdcard/Download/targetFW.zip true\"],\"action\":\"close\"},\"deployment\":{\"scheme\":\"https\",\"host\":\"%HOST% \",\"port\":443,\"path\":\"/%PATH%\"}};end"

Intents for installing the firmware

For the completeness of this How-To below the intents to start the installation of the firmware downloaded in the last step.

Adb:

am broadcast -a com.datalogic.systemupdate.action.FIRMWARE_UPDATE -n com.datalogic.systemupdate/.SystemUpgradeReceiver -e path /sdcard/Download/targetFW.zip  -ei reset 0 --ei reboot 1

Soti:

sendintent -s "intent:#Intent;component=com.datalogic.systemupdate/com.datalogic.systemupdate.SystemUpgradeService;i.action=2;S.path=/sdcard/Download/targetFW.zip;i.reset=0;i.reboot=1;i.force_update=1;end"

Disclaimer:
This how-to describes some undocumented features that may or may not work in future software releases. Above intents are tested with Scan2Deploy agent 2.6.1 and above and Oemconfig version 2.11.1

1 Like