How to set SecureTask as phone device owner
In order to use the following actions with SecureTask, you need to set the app as device onwer:
- Freeze apps (Android 7+)
- Kill apps (Android 7+)
- Block uninstall apps (Android 5+)
- Hide apps (Android 5+)
- Reboot (Android 7+)
- Change lock screen info (Android 7+)
- Remove and set Keyguard (Android 6+)
- Install/Uninstall apps silently (Android 6+)
- Set/Reset PIN/password (needed device owner only for Android 7+)
- Change apps permissions policy
- Change system update policy
- APN settings (Android 9+)
- Clear data and cache apps (Android 9+)
- Block mobile access for each app (Android 9+)
- Set time and timezone (Android 9+)
- Network usage (needed device owner only for Android 10+)
- Private DNS (Android 10+)
- Read phone identifiers (needed device owner only for Android 10+)
- Change apps permissions (Android 6+)
Case 1: you already have a Google account setup on your phone and device is not rooted
- Install SecureTask from Play Store on your phone
- Install ADB on your pc
- Enable developer options on your device and connect it to the pc
- You need the APK on your pc, you can get the APK wherever you want but I suggest you to download it from Play Store and then extract SecureTask APK from your phone,
because it's more secure and SecureTask has a lot of priviliges so it's better to download it only from Play Store. To extract the APK you can use the commands:
- Take the path where SecureTask is installed using this command adb shell pm path com.balda.securetask
- Take a shell using the command adb shell
- Copy the apk in your root folder so you can see it with any file manager, using the path of the previous point. The destination folder can change according to your device type: cp <path> /storage/primary/self
- Copy the apk on your pc
- Backup your data
- Open your device settings and remove any security you have for the lock screen
- Once that's done, you need to remove any and all Google Accounts from the phone or tablet. That's also done in the settings — look for a section labeled Accounts. With an account selected, look for a delete or remove option, usually hidden behind the three little dots in the top corner of the screen
- When you've made sure all of the Google accounts have been erased, you can then factory reset your phone or tablet through the device settings
- Factory reset your device (see notes)
- Don't set any account when the phone restart, just set the wifi
- Install the apk using the command: adb install securetask.apk
- Open SecureTask and press on device admin button granting permissions
- Use the command from pc: adb shell dpm set-device-owner com.balda.securetask/.receivers.AdminReceiver
- Add your Google account and restore backup
Case 2: you DON'T already have a Google account setup on your phone and device is not rooted
- Install SecureTask from Play Store on your phone
- Install ADB on your pc
- Open SecureTask and press on device admin button granting permissions
- Use the command from pc: adb shell dpm set-device-owner com.balda.securetask/.receivers.AdminReceiver
- Add your Google account (if any)
Case 3: you have a rooted phone
- Install SecureTask from Play Store on your phone
- Enable SecureTask as device admin in your Android security settings
- Open SecureTask and press on device admin button granting permissions
- Install ADB on your pc
- Create a file device_owner.xml with following content:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<device-owner package="com.balda.securetask" name="SecureTask" />
- Push the file on your device storage: adb push device_owner.xml /sdcard/
- adb shell
- su
- cp /sdcard/device_owner.xml /data/system/
- cd /data/system/
- chown system:system device_owner.xml
- Now reboot your phone
Note: Before rebooting device, make sure that you installed the application, which you are trying to make device owner. If you will not do, you will get boot animation for infinite time.
After the installation, you can't disable or uninstall normally the app but you can use the uninstall button in the app.
IMPORTANT NOTES
According to your phone model/manufacturer, the precedure could work or not, for example:
- It has been reported that the root way it doesn't work on most phones with Android 8+, use the solution 1 in this case;
- It has been reported by some users with a Samsung phone that the no-root procedure works without factory reset, but it didn't work for others;
- It has been reported by some users that "case 2" worked without factory reset, simply removing all accounts and then adding back again after the precedure.