# Technical Guide

### Suite Installer <a href="#suite-installer" id="suite-installer"></a>

The BlueFletch Suite Installer is an application to assist clients in installing the BlueFletch Enterprise product line. This application will download, install, and if desired, start BlueFletch Enterprise products. The major benefit of this application is to give application permissions, and it will do all the work in the background (silently).

> **Note:** Suite Installer is currently available and supported on Zebra devices only.

### Flow A - Downloaded Config File <a href="#flow-a-downloaded-config-file" id="flow-a-downloaded-config-file"></a>

This flow allows for installing a configuration file that contains the appropriate commands for installing BlueFletch Enterprise applications.

1. Install the **Suite Installer** using your favorite MDM.
2. Invoke the Silent Initialzation.
3. Install a Suite JSON file.
4. Invoke the Silent Install.

#### Installation <a href="#installation" id="installation"></a>

Get the APK from BlueFletch and install to your device using your MDM.

**Example ADB Command**

```
adb install suiteinstaller-1.0.1.apk
```

#### Silent Initialzation <a href="#silent-initialzation" id="silent-initialzation"></a>

Invoke the application with the following information:

**Package:** com.bluefletch.ems.suite.installer\
**Class:** com.bluefletch.ems.suite.installer.SilentActivity

**Example ADB Command**

```
adb shell am start -n com.bluefletch.ems.suite.installer/com.bluefletch.ems.suite.installer.SilentActivity
```

**Example AirWatch Command**

```
mode=explicit,action=android.action.intent.MAIN,package=com.bluefletch.ems.suite.installer,class=com.bluefletch.ems.suite.installer.SilentActivity,broadcast=false
```

#### Install a Suite JSON file <a href="#install-a-suite-json-file" id="install-a-suite-json-file"></a>

Install a Suite.JSON file to this location:

```
/sdcard/Android/data/com.bluefletch.ems.suite.installer/files/emssuite/suite.json
```

#### Invoke the Silent Install <a href="#invoke-the-silent-install" id="invoke-the-silent-install"></a>

Invoke the application with the following information:

**Package:** com.bluefletch.ems.suite.installer\
**Class:** com.bluefletch.ems.suite.installer.SilentActivity\
**Extras:** action=install

**Example ADB Command**

```
adb shell am start -n com.bluefletch.ems.suite.installer/com.bluefletch.ems.suite.installer.SilentActivity -e action install
```

**Example AirWatch Command**

```
mode=explicit,action=android.action.intent.MAIN,package=com.bluefletch.ems.suite.installer,class=com.bluefletch.ems.suite.installer.SilentActivity,extraString=action=install,broadcast=false
```

**Example SOTI Command**

```
sendintent -a "intent:#Intent;action=android.intent.action.MAIN;component=com.bluefletch.ems.suite.installer/com.bluefletch.ems.suite.installer.SilentActivity;S.action=install;end;"
```

### Flow B - Pass Configuration as URL <a href="#flow-b-pass-configuration-as-url" id="flow-b-pass-configuration-as-url"></a>

This flow allows for hosting the configuration file on a server and having the Suite Installer first download the configuration, then install BlueFletch Enterprise applications.

1. Install the **Suite Installer** using your favorite MDM.
2. Invoke the Silent Install passing the Suite JSON as URL Parameter.

#### Invoke the Silent Install <a href="#invoke-the-silent-install_1" id="invoke-the-silent-install_1"></a>

Invoke the application with the following information:

**Package:** com.bluefletch.ems.suite.installer\
**Class:** com.bluefletch.ems.suite.installer.SilentActivity\
**Extras:** url=URL POINTING TO A Suite JSON File

**Example ADB Command**

```
adb shell am start -n com.bluefletch.ems.suite.installer/com.bluefletch.ems.suite.installer.SilentActivity -e url https://somewhere.com/suite.json
```

**Example AirWatch Command**

```
mode=explicit,action=android.action.intent.MAIN,package=com.bluefletch.ems.suite.installer,class=com.bluefletch.ems.suite.installer.SilentActivity,extraString=url=https://somewhere.com/suite.json,broadcast=false |
```

### Flow C - Install individual APKs <a href="#flow-c-install-individual-apks" id="flow-c-install-individual-apks"></a>

This flow allows for installing individual BlueFletch Enterprise product APKs, but it uses a URL to point to the APK hosted on a download server.

1. Install the **Suite Installer** using your favorite MDM.
2. Invoke the Silent Install using a File parameter that points to an APK.

#### Invoke the Silent Install <a href="#invoke-the-silent-install_2" id="invoke-the-silent-install_2"></a>

Invoke the application with the following information:

**Package:**: com.bluefletch.ems.suite.installer\
**Class:** com.bluefletch.ems.suite.installer.SilentActivity\
**Extras:** file=URL POINTING TO APK TO INSTALL

**Example ADB Command**

```json
adb shell am start -n com.bluefletch.ems.suite.installer/com.bluefletch.ems.suite.installer.SilentActivity -e file https://somewhere.com/this.apk
```

**Example AirWatch Command**

```json
mode=explicit,action=android.action.intent.MAIN,package=com.bluefletch.ems.suite.installer,class=com.bluefletch.ems.suite.installer.SilentActivity,extraString=file=https://somewhere.com/this.apk,broadcast=false
```

### Configuration <a href="#configuration" id="configuration"></a>

#### Base Configuration <a href="#base-configuration" id="base-configuration"></a>

| Field   | Description                                               |
| ------- | --------------------------------------------------------- |
| version | Free Formatted Configuration Version, informational only. |
| files   | A collection of File Objects. Required                    |

#### File Object <a href="#file-object" id="file-object"></a>

| Field     | Description                                                                         |
| --------- | ----------------------------------------------------------------------------------- |
| url       | Download url for the Application. Required                                          |
| version   | Version of the Package to install. Optional                                         |
| package   | Name of the Package. Optional (required for uninstall feature)                      |
| uninstall | boolean indicating if should uninstall the package (defaults to false)              |
| intent    | Intent object describing the intent to fire once application is installed. Optional |

#### Intent Object <a href="#intent-object" id="intent-object"></a>

| Field   | Description                        |
| ------- | ---------------------------------- |
| action  | Package Action to invoke. Required |
| package | Name of the Package. Required      |
| class   | Class name to invoked. Required    |

**Example Configuration**

```json
{
  "version": "lastest-2020-12-12",
  "files": [
      {
         "package" : "io.optiko.agent",
         "uninstall": true
       },
      {
          "url": "https://www.somewhere.com/apk/supportApplication-5.3.3-prod.apk",
          "version" : "5.3.3",
          "package" : "com.bluefletch.ems.support",
          "intent" : {
              "action": "android.intent.action.MAIN",
              "package": "com.bluefletch.ems.support",
              "class" : "com.bluefletch.ems.support.features.ui.hidden.SilentInitActivity"
          }
      },
      {
          "url": "https://www.somewhere.com/apk/emsMessaging-2.3.1.apk",
          "version" : "2.3.1",
          "package" : "com.bluefletch.ems.messaging"
      },
      {
          "url": "https://www.somewhere.com/apk/emsauth_okta-1.3.7.apk",
          "version" : "1.3.7",
          "package" : "com.bluefletch.ems.auth"
      },
      {
          "url": "https://www.somewhere.com/apk/bluelauncher-production-2.9.2.apk",
          "version" : "2.9.2",
          "package" : "com.bluefletch.launcher",
          "intent" : {
              "action": "android.intent.action.MAIN",
              "package": "com.bluefletch.launcher",
              "class" : "com.bluefletch.launcher.Launcher"
          }
      }
  ]
}js
```
