How to apply Datalogic Scan2Deploy profiles through intents.

Apply a Scan2Deploy profiles though intents.

Scan2Deploy Studio is the tool crated by Datalogic do dramatically improve the device FWUpdate and Staging activities for the Datalogic Mobile Computers running Android 8 and above.
It is installable on 64-bit Windows 7/8/10 PCs, and its main features include:

  • configure the device Wi-Fi network,
  • distribute and apply device Firmware updates,
  • configure the device ScanEngine (general behaviors, barcode symbologiyes, etc.)
  • easily program special barcode manipulation (Visual Formatter)
  • control all the other device inner system settings (e.g. the lock-screen enabled state),
  • download a data archive from a HTTP/HTTPS server and unpack it to the device,
  • install/update/control custom and system applications, 
  • run scripts (to perform any additional setup).

For all the detail, see: https://datalogic.github.io/scan2deploy/studio/

The basic operativity with Scan2Deploy consist in visually creating a configuration profile, that generates a QR code and automatically publish on an internal (or external) server all the required resurces.
By reading that QR code from a Datalogic Android device (even without any other prior configuration), the device will adapt its configuration to reflect all the settings contained in the profile, and if necessary connect via Wi-Fi, download the optional files and finalize all installations.

 Screenshot    

In some cases, it may be required to automate the application of Scan2Deploy profiles.

This can be accomplished through TWO specific intents that allow all necessary information to be sent to the Scan2Deploy Activity or to the underlying Scan2Deploy Service, as if a user had manually read a barcode.

Start Activity Intent 

If you want the Scan2Deploy UI to be visible, you can starting the following activity:

  • Component/class: com.datalogic.scan2deploy/.MainActivity 

and add to the intent these two extras:

  • data: to include all the barcode data exported by Scan2Deploy Studio
  • encoding: to specify if the content of 'data' is encoded with any Scan2Deploy's encryption algorithm (values “v1”, “v2” or “v3”) or if it is an unencrypted plain text (value “json”)

ADB Shell example:

adb shell am start -S -n com.datalogic.scan2deploy/.MainActivity --es encoding v1 --es data Bm9uiYc//NWOnA0ZtIrgJ/qy0DCvHR+a1XwUz1sTne8s0KEM9ANwTS0XD4NbIOf/hV0+MM7cOFiZMbUDtO1L4sb4vnJluFbQOEM3phIuCRiBuMtpnh85

or:

adb shell am start -S -n com.datalogic.scan2deploy/.MainActivity --es encoding v2 --es data 
Ps74eypbLW7e3V2c+2JHBPo+C/F8/4JrzS+6VsgQbUvL7zCS4eqeUl/OAWWxK9alT/26PQErgJTP/gZRHSE6WATij7KXljRYQCcqo1ZFEj6995p32SZTEpTewNQQ34xIrrHUQFdtPAIqHAneGCCzx60r0ktkyMsGyu8lIpsaClnBspob6Euu/swNip2enyqdf6wg/0myvgJe3iGYdU/0OLqg0Il3oSbe2k/4z0ptRAuzzjR9S37bJoOoFlXTD7B+PqP18dXKeP7B7pH1aHRxci4hZ0UC8HNLLbxyVk70T86uhJLEdbNOojqp0Vn6rUh3Jetab+RO4QhzoPGpv/ZVd0+htofvVFC1EUgeLV+4eCR0Xxm14CcSmJ83fYoHvVPi

or:

adb shell am start -S -n com.datalogic.scan2deploy/.MainActivity --es encoding json --es data "{\"global\":{\"action\":\"reset\"}}"

 

Broadcast Intent 

If you prefer to silently broadcast an intent to apply Scan2Deploy profiles without showing the Scan2Deploy UI (activity), you can use the following broadcast intent:

  • Broadcast action: datalogic.scan2deploy.intent.action.START_SERVICE
  • Broadcast receiver: com.datalogic.scan2deploy.S2dServiceReceiver

and add to the same intent this two extra:

  • data: to include all the barcode data exported by Scan2Deploy Studio
  • encoding: to specify if the content of 'data' is encoded with any Scan2Deploy's encryption algorithm (values “v1”, “v2” or “v3”) or if it is an unencrypted plain text (value “json”)

ADB Shell example:

adb shell am broadcast -a datalogic.scan2deploy.intent.action.START_SERVICE -n "com.datalogic.scan2deploy/.S2dServiceReceiver" --es encoding v1 --es data Bm9uiYc//NWOnA0ZtIrgJ/qy0DCvHR+a1XwUz1sTne8s0KEM9ANwTS0XD4NbIOf/hV0+MM7cOFiZMbUDtO1L4sb4vnJluFbQOEM3phIuCRiBuMtpnh85

or:

adb shell am broadcast -a datalogic.scan2deploy.intent.action.START_SERVICE -n "com.datalogic.scan2deploy/.S2dServiceReceiver" --es encoding v2 --es data
Ps74eypbLW7e3V2c+2JHBPo+C/F8/4JrzS+6VsgQbUvL7zCS4eqeUl/OAWWxK9alT/26PQErgJTP/gZRHSE6WATij7KXljRYQCcqo1ZFEj6995p32SZTEpTewNQQ34xIrrHUQFdtPAIqHAneGCCzx60r0ktkyMsGyu8lIpsaClnBspob6Euu/swNip2enyqdf6wg/0myvgJe3iGYdU/0OLqg0Il3oSbe2k/4z0ptRAuzzjR9S37bJoOoFlXTD7B+PqP18dXKeP7B7pH1aHRxci4hZ0UC8HNLLbxyVk70T86uhJLEdbNOojqp0Vn6rUh3Jetab+RO4QhzoPGpv/ZVd0+htofvVFC1EUgeLV+4eCR0Xxm14CcSmJ83fYoHvVPi

or:

adb shell am broadcast -a datalogic.scan2deploy.intent.action.START_SERVICE -n "com.datalogic.scan2deploy/.S2dServiceReceiver" --es encoding json --es data '{\"global\":{\"action\":\"reset\"}}'

Fore more information, see the official Scan2Deploy's documentation page at this link.