{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/datalogic-scan2deploy-android/latest.json",
  "title": "Android-Scan2Deploy Schema",
  "description": "Schema to validate Android JSON files given as input to DL-Config to generate Scan2Deploy barcodes",
  "x-lintel": {
    "source": "https://www.schemastore.org/datalogic-scan2deploy-android.json",
    "sourceSha256": "49bb50415501a42e877d125e055a729de57268107dc57f17d4785348e02e2210",
    "fileMatch": [
      ".dla.json"
    ],
    "parsers": [
      "json"
    ]
  },
  "type": "object",
  "properties": {
    "layout": {
      "properties": {
        "description": {
          "maxLength": 350,
          "type": "string",
          "title": "Description Schema",
          "default": "none",
          "examples": [
            "This is for our Android devices"
          ]
        },
        "enroll": {
          "examples": [
            true
          ],
          "type": "boolean",
          "title": "Enroll Schema",
          "default": false
        }
      },
      "type": "object",
      "title": "Layout Schema"
    },
    "padlock": {
      "properties": {
        "valid-until": {
          "examples": [
            "20991231235959"
          ],
          "type": "string",
          "title": "Valid-Until Schema",
          "description": "Specifies the expiration date of the barcode sequence. Device date must be synchronized/configured for expiration date to work properly.",
          "default": "20991231235959"
        },
        "key": {
          "examples": [
            "ihavenomouthandimustscream"
          ],
          "type": "string",
          "title": "Key Schema",
          "description": "Padlock key to be used. If value doesn't match the device, the barcode is rejected. Empty string means no key.",
          "default": ""
        },
        "state": {
          "examples": [
            "locked"
          ],
          "type": "string",
          "enum": [
            "locked",
            "unlocked"
          ],
          "title": "State Schema",
          "description": "Configures the padlock state",
          "default": "undefined"
        },
        "hide-from-launcher": {
          "examples": [
            false
          ],
          "type": "boolean",
          "title": "Hide-From-Launcher Schema",
          "description": "Indicates if Scan2Deploy should be disabled after staging is complete. Once disabled, factory reset required to re-enable.",
          "default": false
        }
      },
      "type": "object",
      "title": "Padlock Schema",
      "description": "Section used to configure the staging locking feature"
    },
    "global": {
      "properties": {
        "target-path": {
          "examples": [
            "/mnt/sdcard/airwatch"
          ],
          "type": "string",
          "title": "Target-Path Schema",
          "description": "Base destination folder where any archive/fill will be inflated/written. Default is device internal SD-card root"
        },
        "install-path": {
          "examples": [
            "/mnt/sdcard/airwatch"
          ],
          "type": "string",
          "title": "Install-Path Schema",
          "description": "Folder where the application expects auto-installed/auto-updated APKs to be found. Default is value specified in 'target path'."
        },
        "update-path": {
          "examples": [
            "/mnt/sdcard/airwatch"
          ],
          "type": "string",
          "title": "Update-Path Schema",
          "description": "Folder where the application expects auto-updated OTA packages to be found. Default is value specified in 'target path'."
        },
        "purge-target-path": {
          "examples": [
            true
          ],
          "type": "boolean",
          "title": "Purge-Target-Path Schema",
          "description": "Indicates if target specified in 'target-path' needs to be purged (deleted) prior to inflation of the deployment archive",
          "default": true
        },
        "auto-scan": {
          "examples": [
            true
          ],
          "type": "boolean",
          "title": "Auto-Scan Schema",
          "description": "Enables/Disables the auto-update of APKs and OTA packages",
          "default": false
        },
        "download-preinstalled": {
          "examples": [
            false
          ],
          "type": "boolean",
          "title": "Download-Preinstalled Schema",
          "description": "Used to force the downgrade of pre-installed application (even System app), if required",
          "default": false
        },
        "script": {
          "examples": [
            "setup.s"
          ],
          "type": [
            "string",
            "array"
          ],
          "title": "Script Schema",
          "description": "A string specifying the absolute/relative path of a file, or a JSON array of strings describing the file content line-by-line. The script file will be interpreted last in staging process.",
          "items": {
            "examples": [
              "[Install]",
              "INSTALL /sdcard/Download/fa.apk",
              "[Post-Install]",
              "SHELL am start -a android.intent.action.MAIN -n com.example.mchew.fakeapp/.MainActivity"
            ],
            "type": "string",
            "title": "Items Schema",
            "default": ""
          },
          "default": ""
        },
        "action": {
          "examples": [
            "close"
          ],
          "type": "string",
          "enum": [
            "none",
            "close",
            "enterprise-reset",
            "factory-reset",
            "reset"
          ],
          "title": "Action Schema",
          "description": "Specifies the final action performed by the application at the end of the staging process.",
          "default": "none"
        },
        "backup-to-enterprise": {
          "examples": [
            true
          ],
          "type": "boolean",
          "title": "Backup-To-Enterprise Schema",
          "description": "Activates the enterprise backup persistence for the staging data, resulting in both the staging script and archive being copied to the enterprise partition",
          "default": false
        }
      },
      "type": "object",
      "title": "Global Schema",
      "description": "Section used to configure application scoped settings"
    },
    "settings": {
      "properties": {
        "date-time": {
          "examples": [
            "Thu, 19 Apr 2018 07:51:37 GMT"
          ],
          "type": "string",
          "title": "Date-Time Schema",
          "description": "String representation in RFC-1123 format of the date to be set",
          "default": "null"
        },
        "auto-time": {
          "examples": [
            false
          ],
          "type": "boolean",
          "title": "Auto-Time Schema",
          "description": "Controls the 'Date & Time' automatic date-time adjustment setting",
          "default": true
        },
        "auto-time-zone": {
          "examples": [
            false
          ],
          "type": "boolean",
          "title": "Auto-Time-Zone Schema",
          "description": "Controls the 'Date & Time' automatic time-zone adjustment setting",
          "default": true
        },
        "auto-time-server": {
          "examples": [
            "pool.ntp.org"
          ],
          "type": "string",
          "title": "Auto-Time-Server Schema",
          "description": "Address of the NTP server to be used for date-time synchronization",
          "default": "null"
        },
        "debug-bridge": {
          "examples": [
            false
          ],
          "type": "boolean",
          "title": "Debug-Bridge Schema",
          "description": "Controls the state of 'Android Debug Bridge'",
          "default": true
        },
        "lock-screen": {
          "examples": [
            false
          ],
          "type": "boolean",
          "title": " Lock-Screen Schema",
          "description": "Controls the state of Android's lock-screen, requiring the user to swipe the display to unlock the device",
          "default": true
        },
        "status-bar": {
          "examples": [
            false
          ],
          "type": "boolean",
          "title": "Status-Bar Schema",
          "description": "Controls the display of the top status-bar. Note: hiding the status-bar will make notification disappear.",
          "default": true
        },
        "navigation-bar": {
          "examples": [
            true
          ],
          "type": "boolean",
          "title": "Navigation-Bar Schema",
          "description": "Controls the display of the bottom navigation-bar",
          "default": true
        },
        "charge-threshold": {
          "maximum": 100,
          "type": "integer",
          "title": "Charge-Threshold Schema",
          "description": "Indicates the charge threshold a battery exhausted device needs to reach to automatically boot when recharging",
          "default": 5,
          "examples": [
            0
          ],
          "minimum": 0
        },
        "usb-profile": {
          "examples": [
            "NONE"
          ],
          "type": "string",
          "enum": [
            "NONE",
            "BOTH",
            "DATA",
            "CHARGE"
          ],
          "title": "Usb-Profile Schema",
          "description": "USB communication profile in use",
          "default": "BOTH"
        },
        "usb-function": {
          "examples": [
            "CHARGING"
          ],
          "type": "string",
          "enum": [
            "MTP",
            "PTP",
            "CHARGING"
          ],
          "title": "Usb-Function Schema",
          "description": "USB communication function in use",
          "default": "CHARGING"
        }
      },
      "type": "object",
      "title": "Settings Schema",
      "description": "Section used to control inner device settings that typically need to be changed from the Android defaults"
    },
    "network": {
      "then": {
        "required": [
          "mode-key"
        ]
      },
      "type": "object",
      "title": "Network Schema",
      "description": "Section used to configure the device Wi-Fi network",
      "properties": {
        "essid": {
          "examples": [
            "TESTTKIP"
          ],
          "type": "string",
          "title": "Essid Schema",
          "description": "Wireless network ESSID",
          "default": "tsunami"
        },
        "hidden": {
          "examples": [
            false
          ],
          "type": "boolean",
          "title": "Hidden Schema",
          "description": "Indicates if the wireless network is using a hidden ESSID",
          "default": false
        },
        "mode": {
          "examples": [
            "wpa-psk"
          ],
          "type": "string",
          "enum": [
            "open",
            "wep-40",
            "wep-104",
            "wpa-psk",
            "wpa2-psk",
            "wpa-eap",
            "wpa2-eap"
          ],
          "title": "Mode Schema",
          "description": "Wireless connection mode",
          "default": "open"
        },
        "mode-key": {
          "examples": [
            "datalogic"
          ],
          "type": "string",
          "title": "Mode-Key Schema",
          "description": "Wireless network key, if needed",
          "default": ""
        },
        "mode-key-encrypted": {
          "examples": [
            false
          ],
          "type": "boolean",
          "title": "Mode-Key-Encrypted Schema",
          "description": "Indicates if 'mode-key' is written in plain-text or encrypted with a custom encryption algorithm",
          "default": false
        },
        "eap-method": {
          "examples": [
            "none"
          ],
          "type": "string",
          "enum": [
            "none",
            "peap",
            "tls",
            "ttls",
            "pwd",
            "sim",
            "aka",
            "aka-prime"
          ],
          "title": "Eap-Method Schema",
          "description": "Configures the EAP authentication method",
          "default": "none"
        },
        "eap-phase2": {
          "examples": [
            "none"
          ],
          "type": "string",
          "enum": [
            "none",
            "pap",
            "mschap",
            "mschapv2",
            "gtc"
          ],
          "title": "Eap-Phase2 Schema",
          "description": "Configures the EAP phase 2 authentication method",
          "default": "none"
        },
        "eap-identity": {
          "examples": [
            ""
          ],
          "type": "string",
          "title": "Eap-Identity Schema",
          "description": "Indicates the EAP identity",
          "default": ""
        },
        "eap-anonymous-identity": {
          "examples": [
            ""
          ],
          "type": "string",
          "title": "Eap-Anonymous-Identity Schema",
          "description": "Indicates the EAP anonymous identity, used as the unencrypted identity with certain EAP types",
          "default": ""
        },
        "eap-password": {
          "examples": [
            ""
          ],
          "type": "string",
          "title": "Eap-Password Schema",
          "description": "EAP password, if needed",
          "default": ""
        },
        "eap-password-encrypted": {
          "examples": [
            false
          ],
          "type": "boolean",
          "title": "Eap-Password-Encrypted Schema",
          "description": "Indicates if the 'eap-password' is encrypted with a custom encryption algorithm",
          "default": false
        },
        "eap-certificate": {
          "examples": [
            ""
          ],
          "type": "string",
          "title": "Eap-Certificate Schema",
          "description": "Base64 representation of the EAP certificate to use",
          "default": ""
        },
        "proxy-host": {
          "examples": [
            ""
          ],
          "type": "string",
          "title": "Proxy-Host Schema",
          "description": "Server name or IP address of the proxy to be used for HTTP/HTTPS communications",
          "default": ""
        },
        "proxy-port": {
          "maximum": 65535,
          "type": "integer",
          "title": "Proxy-Port Schema",
          "description": "Server IP port of the proxy for HTTP/HTTPS communications",
          "default": 0,
          "examples": [
            0
          ],
          "minimum": 0
        },
        "purge": {
          "examples": [
            true
          ],
          "type": "boolean",
          "title": "Purge Schema",
          "description": "Indicates if any currently configured wireless network needs to be removed. Can be useful to avoid profile roaming.",
          "default": true
        },
        "reconfigure": {
          "examples": [
            false
          ],
          "type": "boolean",
          "title": "Reconfigure Schema",
          "description": "If true, will reconfigure any existing and matching network. If false, will leave existing network untouched. Setting used when 'purge' is set to false.",
          "default": true
        },
        "sleep-policy": {
          "maximum": 2,
          "type": "integer",
          "title": "Sleep-Policy Schema",
          "description": "Wireless sleep policy for Android's Settings.Global parameter (0-WIFI_SLEEP_POLICY_DEFAULT, 1-WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED, 2-WIFI_SLEEP_POLICY_NEVER)",
          "default": 2,
          "examples": [
            2
          ],
          "minimum": 0
        },
        "frequency-band": {
          "examples": [
            "auto"
          ],
          "type": "string",
          "enum": [
            "auto",
            "5ghz",
            "2ghz"
          ],
          "title": "Frequency-Band Schema",
          "description": "Controls the frequency bands supported by the device",
          "default": "auto"
        },
        "save-to-file": {
          "examples": [
            ""
          ],
          "type": "string",
          "title": "Save-To-File Schema",
          "description": "Absolute path to the file where the current network configuration will be saved, empty string indicates network configuration won't be serialized to a file",
          "default": ""
        },
        "ephemeral": {
          "examples": [
            false
          ],
          "type": "boolean",
          "title": "Ephemeral Schema",
          "description": "If true, wireless connection profile will be used during staging process, then deleted after staging. If false, wireless connection profile will still be present after staging process.",
          "default": true
        },
        "wait-for-connection": {
          "examples": [
            true
          ],
          "type": "boolean",
          "title": "Wait-For-Connection Schema",
          "description": "Indicates whether a valid Wi-Fi connection has to be waited once the network configuration is complete. Can be useful when device needs to be configured but a valid Wi-Fi connection is not ready yet.",
          "default": true
        }
      },
      "if": {
        "properties": {
          "mode": {
            "enum": [
              "wpa-psk",
              "wpa2-psk",
              "wep-40",
              "wep-104"
            ]
          }
        }
      }
    },
    "deployment": {
      "required": [
        "host"
      ],
      "type": "object",
      "title": "Deployment Schema",
      "description": "Section can be used to download a ZIP archive from a server and inflate it to the 'target-path' folder",
      "properties": {
        "scheme": {
          "examples": [
            "http"
          ],
          "type": "string",
          "enum": [
            "http",
            "https"
          ],
          "title": "Scheme Schema",
          "description": "Deployment download scheme to use",
          "default": "http"
        },
        "host": {
          "examples": [
            "172.19.0.77"
          ],
          "type": "string",
          "title": "Host Schema",
          "description": "Host-name or internet-protocol address of the server from which the resource is to be fetched"
        },
        "port": {
          "maximum": 65535,
          "type": "integer",
          "title": "Port Schema",
          "description": "TCP/IP port to be used to contact the server",
          "default": 80,
          "examples": [
            8080
          ],
          "minimum": 0
        },
        "path": {
          "examples": [
            "/airwatch.zip"
          ],
          "type": "string",
          "title": "Path Schema",
          "description": "Path to the server resource to download, complete with query string if needed",
          "default": ""
        },
        "fetch-timeout": {
          "examples": [
            60000
          ],
          "type": "integer",
          "title": "Fetch-Timeout Schema",
          "description": "The timeout value used when fetching resource from host",
          "default": 60000
        },
        "check-timeout": {
          "examples": [
            1000
          ],
          "type": "integer",
          "title": "Check-Timeout Schema",
          "description": "The timeout value used when attempting to reach the host server",
          "default": 1000
        },
        "working-archive": {
          "examples": [
            "/mnt/sdcard/target.zip"
          ],
          "type": "string",
          "title": "Working-Archive Schema",
          "description": "String representation of the archive path-file name, once downloaded",
          "default": "/mnt/sdcard/scan2deploy.archive"
        },
        "skip-inflation": {
          "examples": [
            true
          ],
          "type": "boolean",
          "title": "Skip-Inflation Schema",
          "description": "Instructs the application not to inflate the deployment archive once downloaded, can be useful to speed the OTA update process up",
          "default": false
        }
      }
    },
    "blobs": {
      "items": {
        "properties": {
          "file": {
            "examples": [
              "/mnt/sdcard/airwatch/credentials.bin"
            ],
            "type": "string",
            "title": "File Schema",
            "description": "Path to the file to be created. Can be either absolute or relative to the global/target-path parameter value. During file de-serialization, any required (parent) path is automatically created."
          },
          "content": {
            "examples": [
              "fd09B1iL/k4jRWrjrP0/sO44teY+B3UafBLsMsCEqd1KOv6b6JYBXLVv70FmHdZhIVoEOQvHu7O4PUJStpZQ+4PYjPqCO+NQr81M7GOF421Ke8L2u4EYyqDE5qXfLy2shEgaRwRpr2f35/38WZkh6edyiWZQJjyLeZcuI7WiaJPpw7Jcw7ye7mb7Rl+ePNFmfvUrpeRFtN+5kUsx/SbB1v0gDyOOuoep"
            ],
            "type": "string",
            "title": "Content Schema",
            "description": "Base64 representation of the actual file content"
          }
        },
        "type": "object",
        "title": "Items Schema",
        "required": [
          "file",
          "content"
        ]
      },
      "type": "array",
      "title": "Blobs Schema",
      "description": "Section used to transfer binary data to newly created file on device"
    }
  },
  "$defs": {}
}
