Device Ownership
What is Device Owner?
Device Owner is an advanced Android management mode. When Chastify is set as Device Owner, Android gives the app stronger policy controls than normal Device Admin. Chastify uses it for optional protections against uninstalling the app and changing selected Android settings during Device Control.
In Chastify this is optional. Most users should not need it.
Device Owner is an advanced Android administration mode that you enable yourself through ADB. Only use it on a phone where you understand the setup, the possible OEM side effects, and how to recover or reset the device if something goes wrong. Chastify provides the tools to apply and clear its own restrictions where Android allows it, but you are responsible for choosing to enable Device Owner on your device. For most users, standard Device Control plus Device Admin and optional Secure Settings recovery is enough.
Test the protections and Device Owner removal before starting a control session. Check the Android features you depend on using the actual phone and software version you intend to use; a successful emulator setup does not establish compatibility with that phone.
Device Owner can allow Chastify to:
- Block safe mode on supported Android versions
- Block ADB/debugging features when explicitly enabled
- Prevent factory reset from Android Settings
- Prevent uninstalling Chastify
- Block force-stopping Chastify and clearing its app data on Android 11 or newer
- Require automatic time during Device Control, and prevent manual timezone changes on Android 9 or newer
- Clear these restrictions again from Chastify when recovery is allowed
Device Owner does not make a phone impossible to bypass. Its protections depend on Android, the device manufacturer, and the options you enable.
Automatic date and time
While Device Control is enabled, Chastify uses Device Owner policies to enable automatic time and timezone detection. On Android 9 or newer, Android also prevents manual date, time, and timezone changes. Automatic adjustments for travel and summer/winter time remain available; Chastify does not force a fixed timezone. Android still needs an available time or location signal to update automatically.
The requirement is removed when Device Control is disabled or Device Owner is removed through Chastify. On Android 7 and 8, the older policy requires automatic time but cannot prevent manual timezone changes. This protection only applies when Chastify is Device Owner.
Important limitations
Device Owner is designed for managed phones, kiosks, and enterprise devices. It is not a normal app permission.
Possible side effects include:
- Some OEM services may stop working while Chastify is Device Owner.
- Android Studio or ADB workflows may become harder if debugging restrictions are enabled.
- App reinstall/redeploy behavior can be different from normal app updates.
- Removing accounts or factory resetting may be required before Android allows Device Owner setup.
- Some restrictions may require a reboot before Android fully reflects the change.
Before you begin
Back up the phone before changing its management setup. Complete this setup and test recovery before starting a Device Control session; the setup page is locked during active keyholder control or self-control.
Device Owner does not determine when a self-control session may end. Review Self-Control & Release Locks separately before adding a timer or session-based release condition.
- Install the Chastify Android app and Android SDK Platform Tools on your computer.
- On the phone, enable Developer options, then USB debugging.
- Connect the phone by USB, unlock it, and accept the computer's debugging authorization.
- Run
adb devices -lon the computer. The phone should appear asdevice, rather thanunauthorizedoroffline.
If adb is not found, open a terminal in the Platform Tools folder and use ./adb on macOS/Linux or .\adb.exe on Windows. See Android's ADB connection instructions.
The installed package must be net.chastify.app. Android may refuse provisioning while accounts, another device manager, or additional users/profiles exist. Read the error before changing anything. Device Owner is optional; do not reset your everyday phone simply to complete this guide.
Check accounts before setup
Android often refuses Device Owner setup if accounts already exist on the device.
List accounts with:
adb shell dumpsys account | grep "Account {" | grep -v "Session"
On Windows, or to inspect the full result, use:
adb shell dumpsys account
Then inspect the output for remaining accounts. Account dumps can contain personal information; remove it before sharing diagnostic output with Support.
Set Chastify as Device Owner
With the intended phone connected, run this on your computer:
adb shell dpm set-device-owner net.chastify.app/.AdminReceiver
On macOS with the default Android SDK path:
~/Library/Android/sdk/platform-tools/adb shell dpm set-device-owner net.chastify.app/.AdminReceiver
If multiple phones or emulators are connected, select the correct serial from adb devices -l by using adb -s SERIAL shell ... for each command below. Replace SERIAL with that device's actual serial.
ADB command reference
Set Chastify as Device Owner:
adb shell dpm set-device-owner net.chastify.app/.AdminReceiver
List Device Owner and Profile Owner state:
adb shell dpm list-owners
Remove Chastify as an active Device Admin in debug/test builds:
adb shell dpm remove-active-admin net.chastify.app/.AdminReceiver
On some Android versions, include the user:
adb shell dpm remove-active-admin --user 0 net.chastify.app/.AdminReceiver
Android requires the app to declare testOnly for remove-active-admin. A debug build is not automatically eligible. For the normal Chastify app, use Turn off Device Owner when available, or contact Support if removal fails. See the Android device-policy command reference.
Verify Device Owner
Use:
adb shell dpm list-owners
If your Android build does not support that command, inspect device policy state:
adb shell dumpsys device_policy
Look for net.chastify.app/.AdminReceiver as Device Owner. If it only appears under Enabled Device Admins, then Chastify is Device Admin but not Device Owner. Return to the setup page and refresh Status to confirm what Chastify detects.
Configure restrictions in Chastify
After Device Owner is set:
- Open Chastify.
- Go to Device Control.
- Open Device Owner hardening.
- Enable only the restrictions you actually want.
Chastify currently exposes these as separate options:
- Block safe mode
- Block ADB/debugging
- Block factory reset from Settings
- Block uninstalling Chastify
- Block force-stop and clearing Chastify data — requires Android 11 or newer and an updated app; applies to Chastify itself.
Each phone needs its own Device Owner setup. These Android protections are separate from the shared session rules described in Multi-Device Support.
Leave Block ADB/debugging off while testing. If you enable it and later need to debug the device, you may have to remove the restriction from inside Chastify. After the restriction is removed, Android may still require you to manually turn USB debugging on again in Developer options before ADB works.
Android backups
Android disables its backup service by default when a Device Owner is configured. Chastify's Enable Android backups switch lets you allow that service while keeping Chastify as Device Owner and keeping your other protections in place. It requires Android 8 or newer.
To enable it on the managed phone:
- Open the Chastify Android app and go to Device Control → Device Owner hardening.
- Confirm that Status shows Chastify as Device Owner.
- Under Android backups, turn on Enable Android backups and wait for confirmation.
- Open the phone's Android backup settings to configure the backup account and options, and check when a backup last completed. The location and available options depend on the phone and Android version.
Like the other settings on this page, the switch cannot be changed during active keyholder control or self-control, or while Chastify cannot verify the session state. Configure it before starting control. Each phone has its own setting.
There are three separate things to check:
- Service allowed: This switch permits Android's backup and restore service to operate. Turning it off disables that service again.
- Backups configured: Android's own backup settings determine whether and how backups run. Enabling the service does not configure a backup account or start a backup immediately.
- Backup completed: Check Android's backup settings for completion. Chastify's Backups enabled — Active status only reports that the service is allowed; it does not confirm a successful backup or that all phone data is included. The keyholder's status display updates after the phone next reports its state.
This setting does not control Chastify's server backups or export your Chastify data. Remove optional protections leaves this backup setting unchanged. Turning off Device Owner attempts to re-enable the Android backup service as part of cleanup.
If a change fails, check the displayed error and refresh Status. Updating the Android app may be necessary if its installed native version does not support the setting. See Android's backup-service policy documentation for the platform behavior.
Clearing Device Owner
When no Device Control session is active, open Device Owner hardening. There are two different actions:
- Remove optional protections turns off the protections listed above and keeps Chastify's Device Owner role. Installation blocking and session uninstall rules can remain in effect.
- Turn off Device Owner removes Chastify's Device Owner role and its Android policy restrictions. It does not factory-reset the phone, erase your data, or uninstall Chastify.
The cleanup sequence attempts to:
- Remove the debugging restriction
- Restore ADB if Secure Settings was granted
- Remove the safe mode restriction
- Remove the factory reset restriction
- Remove uninstall, force-stop/data-clear, and remaining installation/uninstallation policies
- Attempt to restore Android backups
- Clear Chastify as Device Owner and verify removal
Refresh Status afterward. If Android rejects removal, do not assume the role or restrictions were cleared.
The local setup page is locked while a keyholder Device Control session or self-control session is active, and also if the app cannot verify the session state. Contact Support if local recovery fails. Support can request removal for a specific phone, but that phone must reconnect and successfully process the request.
Removing Device Owner is separate from ending Device Control. A remotely recovered phone can still be in its control session, with controls that use Accessibility or other permissions still active.
Xiaomi, Redmi, and MIUI notes
Developer-option names vary across Xiaomi, Redmi, MIUI, and HyperOS versions. Start with ordinary USB debugging. If an ADB command reports a manufacturer-specific permission problem, check the phone's own instructions for options such as:
- USB debugging
- USB debugging (Security settings)
- Install via USB
If your version requires a Mi account for an additional developer option, that can conflict with Android's account restrictions for Device Owner provisioning. Follow the exact error and the manufacturer's guidance rather than repeatedly adding/removing accounts or enabling every developer option.
If setup fails
Common reasons:
- Existing accounts are still on the device
- Another device or profile owner already manages the phone
- The installed app/package does not match the command
- Multiple users/profiles exist on the device
- ADB is targeting the wrong emulator or device
- OEM security settings block ADB policy commands
Use:
adb devices -l
adb shell dpm list-owners
adb shell dumpsys device_policy
Record the exact command and error, Android version, and phone model when asking for help. Some phones need a fresh setup before Android permits Device Owner. Only consider a reset after backing up and understanding the manufacturer's recovery process; normal Device Control remains available without this optional role.