question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DPC - How to test code paths for QR/Zero Touch Device Owner setup?

See original GitHub issue

Sorry to any googlers as this likely isn’t the right venue.

Can anyone explain exactly how the app is launched in Zero Touch and Device Owner QR Code enrollment? I understand that an intent is sent, and will contain the PROVISIONING_ADMIN_EXTRAS_BUNDLE - that’s all quite straightforward, but I’m not sure exactly where the intent should be handled, given that provisioning happens immediately upon device startup and it’s not feasible to debug.

Any advice - intent filter, class, etc. would be helpful.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
jscott1989commented, Oct 15, 2021

Back in Android 10, TestDPC was updated in accordance to this guide. In summary, there are 2 entry points to TestDPC: the android.app.action.GET_PROVISIONING_MODE, which requests the DPC to return the desired provisioning mode (work profile or device owner), and android.app.action.ADMIN_POLICY_COMPLIANCE, which allows the DPC to set itself up after it has been made a profile owner/device owner. This is the case for ZeroTouch and QR enrollment, and we’re migrating all of the other flows to follow this pattern as well. For managed account provisioning, pre-Android 12 it’s only launched after provisioning it’s launched via the android.app.action.PROVISIONING_SUCCESSFUL intent, and from Android 12 onward it’s started just like ZeroTouch and QR enrollment. For NFC provisioning it’s also only started via android.app.action.PROVISIONING_SUCCESSFUL, which will also be updated in the upcoming Android release to be like ZeroTouch and QR enrollment.

0reactions
jscott1989commented, Apr 20, 2022

Create a local server that serves your custom TestDPC or upload it somewhere publicly Make sure you can actually access the TestDPC apk from the phone Get the SHA-256 checksum of the apk; on Linux you can use sha256sum path/to/TestDPC.apk Create a QR code with the following content: { “android.app.extra.PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME”: “com.afwsamples.testdpc/com.afwsamples.testdpc.DeviceAdminReceiver”, “android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_CHECKSUM”: “apk checksum from step 3”, “android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION”: “url that serves your TestDPC” } From the SetupWizard Welcome screen tap 6 times to launch the QR code scanner Scan QR code

Read more comments on GitHub >

github_iconTop Results From Across the Web

Testing Device Management | Android Open Source Project
To verify the device owner was correctly setup, go to Settings > Security > Device Administrators and confirm TestDPC is in the list....
Read more >
Zero-touch enrollment for IT admins - Android Enterprise Help
On first boot, devices check to see if they've been assigned an enterprise configuration. If so, the device initiates the fully managed device...
Read more >
Device Owner with Zero Touch Enrollment Checklist - IBM
Content · Select Android in Setup > Settings> Enrollment Settings > Enrollment Programs · Configure Android Zero Touch Enrollment configuration(s) ...
Read more >
EMM integration guide | Google device provisioning services
Because zero-touch enrollment automatically downloads and installs a DPC, your DPC must be available from Google Play. We maintain a list of compatible...
Read more >
Enroll your Android Enterprise dedicated, fully managed, or ...
If device users setting up fully managed devices or corporate-owned devices with a ... Create a zero-touch configuration in the admin center ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found