{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://json.schemastore.org/datalogic-scan2deploy-android.json",
  "definitions": {},
  "description": "Schema to validate Android JSON files given as input to DL-Config to generate Scan2Deploy barcodes",
  "properties": {
    "layout": {
      "$id": "#/properties/layout",
      "type": "object",
      "title": "Layout Schema",
      "properties": {
        "description": {
          "$id": "#/properties/layout/properties/description",
          "type": "string",
          "title": "Description Schema",
          "default": "none",
          "examples": ["This is for our Android devices"],
          "maxLength": 350
        },
        "enroll": {
          "$id": "#/properties/layout/properties/enroll",
          "type": "boolean",
          "title": "Enroll Schema",
          "default": false,
          "examples": [true]
        }
      }
    },
    "padlock": {
      "$id": "#/properties/padlock",
      "type": "object",
      "title": "Padlock Schema",
      "description": "Section used to configure the staging locking feature",
      "properties": {
        "valid-until": {
          "$id": "#/properties/padlock/properties/valid-until",
          "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",
          "examples": ["20991231235959"]
        },
        "key": {
          "$id": "#/properties/padlock/properties/key",
          "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": "",
          "examples": ["ihavenomouthandimustscream"]
        },
        "state": {
          "$id": "#/properties/padlock/properties/state",
          "type": "string",
          "enum": ["locked", "unlocked"],
          "title": "State Schema",
          "description": "Configures the padlock state",
          "default": "undefined",
          "examples": ["locked"]
        },
        "hide-from-launcher": {
          "$id": "#/properties/padlock/properties/hide-from-launcher",
          "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,
          "examples": [false]
        }
      }
    },
    "global": {
      "$id": "#/properties/global",
      "type": "object",
      "title": "Global Schema",
      "description": "Section used to configure application scoped settings",
      "properties": {
        "target-path": {
          "$id": "#/properties/global/properties/target-path",
          "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",
          "examples": ["/mnt/sdcard/airwatch"]
        },
        "install-path": {
          "$id": "#/properties/global/properties/install-path",
          "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'.",
          "examples": ["/mnt/sdcard/airwatch"]
        },
        "update-path": {
          "$id": "#/properties/global/properties/update-path",
          "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'.",
          "examples": ["/mnt/sdcard/airwatch"]
        },
        "purge-target-path": {
          "$id": "#/properties/global/properties/purge-target-path",
          "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,
          "examples": [true]
        },
        "auto-scan": {
          "$id": "#/properties/global/properties/auto-scan",
          "type": "boolean",
          "title": "Auto-Scan Schema",
          "description": "Enables/Disables the auto-update of APKs and OTA packages",
          "default": false,
          "examples": [true]
        },
        "download-preinstalled": {
          "$id": "#/properties/global/properties/download-preinstalled",
          "type": "boolean",
          "title": "Download-Preinstalled Schema",
          "description": "Used to force the downgrade of pre-installed application (even System app), if required",
          "default": false,
          "examples": [false]
        },
        "script": {
          "$id": "#/properties/global/properties/script",
          "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": {
            "$id": "#/properties/global/properties/script/items",
            "type": "string",
            "title": "Items Schema",
            "default": "",
            "examples": [
              "[Install]",
              "INSTALL /sdcard/Download/fa.apk",
              "[Post-Install]",
              "SHELL am start -a android.intent.action.MAIN -n com.example.mchew.fakeapp/.MainActivity"
            ]
          },
          "default": "",
          "examples": ["setup.s"]
        },
        "action": {
          "$id": "#/properties/global/properties/action",
          "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",
          "examples": ["close"]
        },
        "backup-to-enterprise": {
          "$id": "#/properties/global/properties/backup-to-enterprise",
          "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,
          "examples": [true]
        }
      }
    },
    "settings": {
      "$id": "#/properties/settings",
      "type": "object",
      "title": "Settings Schema",
      "description": "Section used to control inner device settings that typically need to be changed from the Android defaults",
      "properties": {
        "date-time": {
          "$id": "#/properties/settings/properties/date-time",
          "type": "string",
          "title": "Date-Time Schema",
          "description": "String representation in RFC-1123 format of the date to be set",
          "default": "null",
          "examples": ["Thu, 19 Apr 2018 07:51:37 GMT"]
        },
        "auto-time": {
          "$id": "#/properties/settings/properties/auto-time",
          "type": "boolean",
          "title": "Auto-Time Schema",
          "description": "Controls the 'Date & Time' automatic date-time adjustment setting",
          "default": true,
          "examples": [false]
        },
        "auto-time-zone": {
          "$id": "#/properties/settings/properties/auto-time-zone",
          "type": "boolean",
          "title": "Auto-Time-Zone Schema",
          "description": "Controls the 'Date & Time' automatic time-zone adjustment setting",
          "default": true,
          "examples": [false]
        },
        "auto-time-server": {
          "$id": "#/properties/settings/properties/auto-time-server",
          "type": "string",
          "title": "Auto-Time-Server Schema",
          "description": "Address of the NTP server to be used for date-time synchronization",
          "default": "null",
          "examples": ["pool.ntp.org"]
        },
        "debug-bridge": {
          "$id": "#/properties/settings/properties/debug-bridge",
          "type": "boolean",
          "title": "Debug-Bridge Schema",
          "description": "Controls the state of 'Android Debug Bridge'",
          "default": true,
          "examples": [false]
        },
        "lock-screen": {
          "$id": "#/properties/settings/properties/lock-screen",
          "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,
          "examples": [false]
        },
        "status-bar": {
          "$id": "#/properties/settings/properties/status-bar",
          "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,
          "examples": [false]
        },
        "navigation-bar": {
          "$id": "#/properties/settings/properties/navigation-bar",
          "type": "boolean",
          "title": "Navigation-Bar Schema",
          "description": "Controls the display of the bottom navigation-bar",
          "default": true,
          "examples": [true]
        },
        "charge-threshold": {
          "$id": "#/properties/settings/properties/charge-threshold",
          "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,
          "maximum": 100
        },
        "usb-profile": {
          "$id": "#/properties/settings/properties/usb-profile",
          "type": "string",
          "enum": ["NONE", "BOTH", "DATA", "CHARGE"],
          "title": "Usb-Profile Schema",
          "description": "USB communication profile in use",
          "default": "BOTH",
          "examples": ["NONE"]
        },
        "usb-function": {
          "$id": "#/properties/settings/properties/usb-function",
          "type": "string",
          "enum": ["MTP", "PTP", "CHARGING"],
          "title": "Usb-Function Schema",
          "description": "USB communication function in use",
          "default": "CHARGING",
          "examples": ["CHARGING"]
        }
      }
    },
    "network": {
      "$id": "#/properties/network",
      "type": "object",
      "title": "Network Schema",
      "description": "Section used to configure the device Wi-Fi network",
      "properties": {
        "essid": {
          "$id": "#/properties/network/properties/essid",
          "type": "string",
          "title": "Essid Schema",
          "description": "Wireless network ESSID",
          "default": "tsunami",
          "examples": ["TESTTKIP"]
        },
        "hidden": {
          "$id": "#/properties/network/properties/hidden",
          "type": "boolean",
          "title": "Hidden Schema",
          "description": "Indicates if the wireless network is using a hidden ESSID",
          "default": false,
          "examples": [false]
        },
        "mode": {
          "$id": "#/properties/network/properties/mode",
          "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",
          "examples": ["wpa-psk"]
        },
        "mode-key": {
          "$id": "#/properties/network/properties/mode-key",
          "type": "string",
          "title": "Mode-Key Schema",
          "description": "Wireless network key, if needed",
          "default": "",
          "examples": ["datalogic"]
        },
        "mode-key-encrypted": {
          "$id": "#/properties/network/properties/mode-key-encrypted",
          "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,
          "examples": [false]
        },
        "eap-method": {
          "$id": "#/properties/network/properties/eap-method",
          "type": "string",
          "enum": [
            "none",
            "peap",
            "tls",
            "ttls",
            "pwd",
            "sim",
            "aka",
            "aka-prime"
          ],
          "title": "Eap-Method Schema",
          "description": "Configures the EAP authentication method",
          "default": "none",
          "examples": ["none"]
        },
        "eap-phase2": {
          "$id": "#/properties/network/properties/eap-phase2",
          "type": "string",
          "enum": ["none", "pap", "mschap", "mschapv2", "gtc"],
          "title": "Eap-Phase2 Schema",
          "description": "Configures the EAP phase 2 authentication method",
          "default": "none",
          "examples": ["none"]
        },
        "eap-identity": {
          "$id": "#/properties/network/properties/eap-identity",
          "type": "string",
          "title": "Eap-Identity Schema",
          "description": "Indicates the EAP identity",
          "default": "",
          "examples": [""]
        },
        "eap-anonymous-identity": {
          "$id": "#/properties/network/properties/eap-anonymous-identity",
          "type": "string",
          "title": "Eap-Anonymous-Identity Schema",
          "description": "Indicates the EAP anonymous identity, used as the unencrypted identity with certain EAP types",
          "default": "",
          "examples": [""]
        },
        "eap-password": {
          "$id": "#/properties/network/properties/eap-password",
          "type": "string",
          "title": "Eap-Password Schema",
          "description": "EAP password, if needed",
          "default": "",
          "examples": [""]
        },
        "eap-password-encrypted": {
          "$id": "#/properties/network/properties/eap-password-encrypted",
          "type": "boolean",
          "title": "Eap-Password-Encrypted Schema",
          "description": "Indicates if the 'eap-password' is encrypted with a custom encryption algorithm",
          "default": false,
          "examples": [false]
        },
        "eap-certificate": {
          "$id": "#/properties/network/properties/eap-certificate",
          "type": "string",
          "title": "Eap-Certificate Schema",
          "description": "Base64 representation of the EAP certificate to use",
          "default": "",
          "examples": [""]
        },
        "proxy-host": {
          "$id": "#/properties/network/properties/proxy-host",
          "type": "string",
          "title": "Proxy-Host Schema",
          "description": "Server name or IP address of the proxy to be used for HTTP/HTTPS communications",
          "default": "",
          "examples": [""]
        },
        "proxy-port": {
          "$id": "#/properties/network/properties/proxy-port",
          "type": "integer",
          "title": "Proxy-Port Schema",
          "description": "Server IP port of the proxy for HTTP/HTTPS communications",
          "default": 0,
          "examples": [0],
          "minimum": 0,
          "maximum": 65535
        },
        "purge": {
          "$id": "#/properties/network/properties/purge",
          "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,
          "examples": [true]
        },
        "reconfigure": {
          "$id": "#/properties/network/properties/reconfigure",
          "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,
          "examples": [false]
        },
        "sleep-policy": {
          "$id": "#/properties/network/properties/sleep-policy",
          "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,
          "maximum": 2
        },
        "frequency-band": {
          "$id": "#/properties/network/properties/frequency-band",
          "type": "string",
          "enum": ["auto", "5ghz", "2ghz"],
          "title": "Frequency-Band Schema",
          "description": "Controls the frequency bands supported by the device",
          "default": "auto",
          "examples": ["auto"]
        },
        "save-to-file": {
          "$id": "#/properties/network/properties/save-to-file",
          "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": "",
          "examples": [""]
        },
        "ephemeral": {
          "$id": "#/properties/network/properties/ephemeral",
          "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,
          "examples": [false]
        },
        "wait-for-connection": {
          "$id": "#/properties/network/properties/wait-for-connection",
          "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,
          "examples": [true]
        }
      },
      "if": {
        "properties": {
          "mode": {
            "enum": ["wpa-psk", "wpa2-psk", "wep-40", "wep-104"]
          }
        }
      },
      "then": {
        "required": ["mode-key"]
      }
    },
    "deployment": {
      "$id": "#/properties/deployment",
      "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": {
          "$id": "#/properties/deployment/properties/scheme",
          "type": "string",
          "enum": ["http", "https"],
          "title": "Scheme Schema",
          "description": "Deployment download scheme to use",
          "default": "http",
          "examples": ["http"]
        },
        "host": {
          "$id": "#/properties/deployment/properties/host",
          "type": "string",
          "title": "Host Schema",
          "description": "Host-name or internet-protocol address of the server from which the resource is to be fetched",
          "examples": ["172.19.0.77"]
        },
        "port": {
          "$id": "#/properties/deployment/properties/port",
          "type": "integer",
          "title": "Port Schema",
          "description": "TCP/IP port to be used to contact the server",
          "default": 80,
          "examples": [8080],
          "minimum": 0,
          "maximum": 65535
        },
        "path": {
          "$id": "#/properties/deployment/properties/path",
          "type": "string",
          "title": "Path Schema",
          "description": "Path to the server resource to download, complete with query string if needed",
          "default": "",
          "examples": ["/airwatch.zip"]
        },
        "fetch-timeout": {
          "$id": "#/properties/deployment/properties/fetch-timeout",
          "type": "integer",
          "title": "Fetch-Timeout Schema",
          "description": "The timeout value used when fetching resource from host",
          "default": 60000,
          "examples": [60000]
        },
        "check-timeout": {
          "$id": "#/properties/deployment/properties/check-timeout",
          "type": "integer",
          "title": "Check-Timeout Schema",
          "description": "The timeout value used when attempting to reach the host server",
          "default": 1000,
          "examples": [1000]
        },
        "working-archive": {
          "$id": "#/properties/deployment/properties/working-archive",
          "type": "string",
          "title": "Working-Archive Schema",
          "description": "String representation of the archive path-file name, once downloaded",
          "default": "/mnt/sdcard/scan2deploy.archive",
          "examples": ["/mnt/sdcard/target.zip"]
        },
        "skip-inflation": {
          "$id": "#/properties/deployment/properties/skip-inflation",
          "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,
          "examples": [true]
        }
      },
      "required": ["host"]
    },
    "blobs": {
      "$id": "#/properties/blobs",
      "type": "array",
      "title": "Blobs Schema",
      "description": "Section used to transfer binary data to newly created file on device",
      "items": {
        "$id": "#/properties/blobs/items",
        "type": "object",
        "title": "Items Schema",
        "required": ["file", "content"],
        "properties": {
          "file": {
            "$id": "#/properties/blobs/items/properties/file",
            "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.",
            "examples": ["/mnt/sdcard/airwatch/credentials.bin"]
          },
          "content": {
            "$id": "#/properties/blobs/items/properties/content",
            "type": "string",
            "title": "Content Schema",
            "description": "Base64 representation of the actual file content",
            "examples": [
              "fd09B1iL/k4jRWrjrP0/sO44teY+B3UafBLsMsCEqd1KOv6b6JYBXLVv70FmHdZhIVoEOQvHu7O4PUJStpZQ+4PYjPqCO+NQr81M7GOF421Ke8L2u4EYyqDE5qXfLy2shEgaRwRpr2f35/38WZkh6edyiWZQJjyLeZcuI7WiaJPpw7Jcw7ye7mb7Rl+ePNFmfvUrpeRFtN+5kUsx/SbB1v0gDyOOuoep"
            ]
          }
        }
      }
    }
  },
  "title": "Android-Scan2Deploy Schema",
  "type": "object"
}
