Repository navigation
Enrollment and Provisioning
There are two ways a device becomes managed: direct enrollment (sign in and it registers), and token provisioning (pre-register by IMEI, then the device claims a token).
When a user signs into the app, EnrollmentManager:
- Derives a stable hardware ID (IMEI → serial → Android ID, then cached so it never changes).
- Writes/updates
/devices/{hardwareId}with model, OS,deviceUid(the signed-in UID), andlastSeen. - If the document doesn't exist yet, it's created with
ownerId= the signing-in user. If it exists, only non-ownership fields are updated (so an admin-assignedownerIdis preserved).
Note (fixed in v0.3.2): a brand-new device's first
update()can come back asPERMISSION_DENIEDrather thanNOT_FOUND(the update rule can't read a doc that doesn't exist). The app now treats that as "create", so new devices enroll correctly.
After enrollment the device appears in the owner's console and MdmCommandService begins listening.
For controlled rollouts, the super-admin can pre-register devices and hand out one-time tokens.
-
device_inventory/{imei}— a pre-provisioning record with anenrollmentStatus(PENDING→ENROLLED→DISENROLLED) and token fields. -
enrollment_tokens/{token}— the 32-char random token is the secret; any signed-in device can look it up, only the super-admin can create one, and the device deletes it after use.
- Super-admin opens the Admin panel → pre-register a device by IMEI, which issues a token.
- The token is delivered to the device (QR/manual).
- The device verifies the token client-side and marks its inventory record
ENROLLED(the rules allow exactly thatPENDING → ENROLLEDtransition). - The device consumes (deletes) the token.
Issue/copy token, renew token, mark enrolled/disenrolled, block/unblock, delete record.
- IMEI/serial need privileged access (Device Owner); without it the app falls back to Android ID.
- The derived ID is cached in SharedPreferences so it's stable across permission/reboot changes and is used as the Firestore document ID.
-
Firestore Data Model —
device_inventory,enrollment_tokensschemas - Security Rules — who can read/write tokens and inventory
- Device Owner Setup — QR/NFC provisioning as Device Owner
CORE MDM — Repository · Console · Releases · Beta
Getting started
Using it
- Web Console Guide
- Commands and Command Queue
- Policies Reference
- App Management
- Content Filter and DNS
- Kiosk Mode
- PIN and Security
- Enrollment and Provisioning
How it works
Operations
Help