With most MDM/EMM solutions you are limited to whatever options are available in the GUI (I’m looking at you, AirWatch). SOTI in this regard looks weird, since the number of settings is not particularly rich, which makes it seem limited. However, SOTI has the super-awesome SOTIscript, and SOTIscript has a number of super-awesome (but barely documented) script commands.
Today, we will take a look at how to use those commands to change (virtually) any Android OS setting available on your device via SOTI MDM.
The SOTIscript commands we will be using are
- watchsettings [on | off]
- This enables OS settings change tracking.
- writesecuresetting [-sys | -sec | -glo ]
- This actually changes stuff
Unfortunately, I don’t have access to SOTI console right now to make nice screens, but I think by now you get, where this is going…
1. Push a script with watchsettings on to enable settings tracking on the test device.
- You may do it anyway you like: Send Script command, install package, etc..
2. Change a setting, and look into the selected device Log section in SOTI GUI. You will see a message like
Custom log ( URI:content://settings/system SETTING:accelerometer_rotation VALUE:0 )
This gives you all the info you need to work with this setting:
- Setting type System. There can also be Global and Secure.
- Setting name: accelerometer_rotation
- Setting value: 0. Sometimes, the values will look really complicated. But for our purposes we don’t care. All you need to do is to copy the value verbatim into the next command. Neat?
Here is couple more examples. Can you figure out what they do?
- content://settings/secure SETTING: install_non_market_apps VALUE:1
- content://settings/global SETTING: adb_enabled VALUE:0
- content://settings/global SETTING: wifi_on VALUE:1
- content://settings/global SETTING: device_name VALUE:MyDevice
3. Create a script that will push the value using writesecuresetting
- writesecuresetting [-sys | -sec | -glo]
- writesecuresetting -sys accelerometer_rotation 0
- I am not sure about -sec and -glo (could be -secure and -global) – please write in comments if this doesn’t work. As I said, no SOTI instance spinning right now ☹
4. Push the script to the device in whatever way you like. Profit!
You now should be able to change virtually any Android OS setting! Nice?
There are some precautions though:
- Sometimes you may need a restart (or cycling a component, such as BT radio).
- Some settings will not work, as OS protects them: not for use by 3rd party apps.
- Changing some settings will do NOTHING, because the OS ignores them (they are just there to prevent legacy app crashes). But you won’t see those using watchsettings – more likely, you are using advanced ADB commands to view the complete list of settings.
If you are wondering, what all those System/Secure/Global means, how to see the full list of settings, and why is it all so complicated – wait until the next post!
Hope this will come useful. What do you think?