This is what i had to do.
A) The JSON Payload format When creating the QR Code, to use the native Google DPC, the most basic JSON payload (if we leave aside embedding the WiFi creds for a moment), needs to resemble the following :
{ "android.app.extra.PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME": "com.google.android.apps.work.clouddpc/.receivers.CloudDeviceAdminReceiver", "android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION": "https://play.google.com/managed/downloadManagingApp?identifier=setup", "android.app.extra.PROVISIONING_DEVICE_ADMIN_SIGNATURE_CHECKSUM": "I5YvS0O5hXY46mb01BlRjq4oJJGs2kuUcHvVkAPEXlg", "android.app.extra.PROVISIONING_ADMIN_EXTRAS_BUNDLE": { "com.google.android.apps.work.clouddpc.EXTRA_ENROLLMENT_TOKEN": "XXXXXXXXXXXXXXXXXXXX" } }
B) How the checksum is derived.
How is the checksum "I5YvS0O5hXY46mb01BlRjq4oJJGs2kuUcHvVkAPEXlg" calculated? This string does appear in the AMAPI documentation at https://developers.google.com/android/management/provision-device, though I am unsure as to how often the Google DPC (and the documentation on this) is updated.Therefore, I think it is useful to understand how this checksum can be derived.
a) First, you need to download the Java Development Kit (JDK) (the latest at the time of writing is jdk-23) b)If you browse to the Download location at "https://play.google.com/managed/downloadManagingApp?identifier=setup" , your browser will download an apk file with a long, random-looking, name. c) The JDK contains a file called 'toolkit' which can be used to calculate the (SHA 256) checksum . d) assuming you have a Windows PC, open up the Command Prompt. e) In CMD Line : cd "C:\Program Files\Java\jdk-23\bin" (or whatever version of JDK you have) keytool -printcert -jarfile "The Full Path to the Apk file you downloaded .apk"
f) Two checksums will be produced - it is the SHA256 one we need (NB this is only valid until Dec 19th 2024 18:16 GMT - after that you will have to repeat this procedure (or hope that Google have updated their documentation). g) Please note that the Checksum is in Hex form. You will have to use an online converter (Or ChatGPT et al) to convert it to a URL-safe Base64 encoded string. h) If you perform this procedure before Dec 19th 18:16 GMT, you should get "I5YvS0O5hXY46mb01BlRjq4oJJGs2kuUcHvVkAPEXlg". If you do this AFTER that date/time (when I assume a new version of Google DPC will be issued), you should a different, but valid, answer. (Hopefully Google will have updated their documentation to reflect this anyway).
C) How to get the QR Code from the JSON Payload.
There are many libraries you could use. The one I advise to use is ZXing.Net. (https://github.com/micjahn/ZXing.Net) There is an excellent article by Luis Llamas at https://www.luisllamas.es/en/csharp-zxing/ which explains how to generate the QR Code.
D) Things to watch out for: