Back to top

How to create a QR code to enroll a device into Android Enterprise Device Owner (DO) mode

Environment

  • Android Enterprise
  • Device Owner

Overview

This article provides information on how to create a QR code for provisioning an Android device into Android Enterprise’s device owner mode.

The following parameters are used to generate a QR code:

  1. android.app.extra.PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME — Specifies the device admin component name of your application that you want to set as device owner.

  2. android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_CHECKSUM — Specifies the package checksum of your app that you want to set as device owner. To generate the package checksum, you can use openssl as specified below:

    cat name-of-APK.apk | openssl dgst -binary -sha256 | openssl base64 | tr '+/' '-_' | tr -d '='
    
  3. android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION — Specifies the location/address where the device owner app is stored.

  4. android.app.extra.PROVISIONING_SKIP_ENCRYPTION — Optional parameter used to skip encryption while provisioning the device into device owner mode.

  5. android.app.extra.PROVISIONING_LEAVE_ALL_SYSTEM_APPS_ENABLED — Optional parameter used to enable/disable all system apps depending on the value specified.

  6. android.app.extra.PROVISIONING_ADMIN_EXTRAS_BUNDLE — Optional parameter. You can specify a list of parameters depending on what the device owner app supports. This bundle is delivered to the device owner app.

For example, if you have downloaded a Knox SDK sample app and want to make that app a device owner, the following can be used to generate a QR code:

{
    "android.app.extra.PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME":
    "com.samsung.knox.example.knoxsdk/com.samsung.knox.example.knoxsdk.DeviceAdminReceiver",

    "android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_CHECKSUM":
    "PACKAGE_CHECKSUM",

    "android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION":
    "PACKAGE_DOWNLOAD_LOCATION",
    "android.app.extra.PROVISIONING_SKIP_ENCRYPTION": true,

    "android.app.extra.PROVISIONING_LEAVE_ALL_SYSTEM_APPS_ENABLED":true,
    "android.app.extra.PROVISIONING_ADMIN_EXTRAS_BUNDLE": {
    }
}

Enter the PACKAGE_CHECKSUM and PACKAGE_DOWNLOAD_LOCATION to complete the QR code. Any third-party QR code generator can be used to generate the QR code.

Additional information

For more details on how to enroll and provision a device in Device Owner (DO), see the Android Management API documentation.

To read more about the Knox SDK, refer to the Knox SDK API reference.

Back to KBAs

Is this page helpful?