This guide explains how to create a QR code for provisioning an APK as a Mobile Device Management (MDM) application. Follow these steps to set up your APK as a device owner in Android Enterprise using a QR code.
name-of-APK.apk
).Run the following command to calculate the base64-encoded SHA-256 checksum of the APK:
cat name-of-APK.apk | openssl dgst -binary -sha256 | openssl base64 | tr '+/' '-_' | tr -d '='
This will generate a checksum similar to the following:
yU8yQt_wIndDnI8kmX-BRw1x55X6OPLJRUxaPuLbtvk
Create a JSON payload with the necessary provisioning extras. Below is an example payload:
{
"android.app.extra.PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME":
"com.kdroid.filter/.listener.AdminListener",
"android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_CHECKSUM":
"yU8yQt_wIndDnI8kmX-BRw1x55X6OPLJRUxaPuLbtvk",
"android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION":
"https://yoursite.com/app.apk",
"android.app.extra.PROVISIONING_SKIP_ENCRYPTION": true,
"android.app.extra.PROVISIONING_LEAVE_ALL_SYSTEM_APPS_ENABLED": true,
"android.app.extra.PROVISIONING_ADMIN_EXTRAS_BUNDLE": {}
}
com.kdroid.filter/.listener.AdminListener
with your app's package and admin component name.https://yoursite.com/app.apk
with the URL where your APK is hosted.For professional use, it is recommended to generate the QR code dynamically using a library such as qrose. This allows for greater flexibility and automation in scenarios requiring multiple or customized QR codes.
In this example, however, we will rely on the ZXing website:
Text
as the content type.Generate
to create the QR code.