When a device is enrolled and given to temporary users who are not knowledge workers and allowed to do anything on the device without any restrictions. e.g. Devices are given to patients in the hospital. The users may download the files (which can be private), and apps, and set up WhatsApp and Facebook accounts (Personal).
In this case, when they hand over the devices to the Admin, once they are discharged, the Administrator currently has to factory reset the device to remove all the personal and private content.
The device administrators wouldn’t want to set up all the devices freshly by doing a factory reset when a device is re-assigned from one user to another. This is a time-consuming process. So the approach proposed here will help them to delete all the user data, accounts, and files from the devices without factory resetting when changing the ownership from one user to another.
The below suggested solutions can be used in conjunction to achieve the above:
The process involves the steps of creating runscript job on the SureMDM console and below are the steps for the same.
- Login to the SureMDM Console
- Navigate to Jobs
- Click New Job and select Android platform
- Click on Run Script
- Enter the Job Name
- Enter the script
- Click OK to save the job
SCRIPT TO CLEAR USER APP DATA
Note: This script will clear all user-downloaded application app data except for SureMDM Agent/ SureLock/SureFox/SureVideo
SCRIPT TO DELETE THE ACCOUNTS
The account_type examples
Gmail > com.google.android.gm
Facebook > com.facebook.katana
WhatsApp > com.whatsapp
- Package names may vary at times based on the model. Check on the device end and enter the correct package name
- PFW accounts should be excluded since they are needed for DO & PO enrollment.
CLEAR SD CARD DATA
- Delete all files inside the “test folder” with extensions
rm -r /mnt/sdcard/test/*
- Remove all the data from the SD card, including SureProduct data
rm -r /mnt/sdcard/*
RUNSCRIPT TO RESET THE HOME SCREEN AND LOCK SCREEN WALLPAPERS TO DEFAULT
Home screen wallpaper
Lock screen wallpaper
Image position can be: fill, fit, Stretch
Note: The wallpaper file should be sent to the device as part of the file transfer job after clearing the data specified in the above section.
Once all the runscript jobs are created, the admin can create a composite job and apply it to the devices to take immediate effect.