| Applies to: | |
| Product | SureLock |
| Platform | Android |
SureLock API
exit_surelock - This command exits the device from lock down mode.
apply_settings - Apply SureLock settings using XML data.
change_password - Change SureLock password required to enter into Admin Settings.
force_apply_settings - force applies SureLock settings.
reset_idletimeout - resets idle timeout.
activate - activates SureLock license.
deactivate - deactivates SureLock license.
forceknox - forces the user to activate KNOX
hidebottombar - hides bottom bar of the device
showbottombar - shows bottom bar of the device
add_application - adds a new application to the allowed list (application should already be installed on the device)
remove_ application - removes application from the allowed list
wifi_settings - applies WiFi settings on the device
public synchronized void exitSurelock() { /* Intent Action MUST be 'com.gears42.surelock.COMMUNICATOR' */ final Intent intent = new Intent("com.gears42.surelock.COMMUNICATOR"); /* the command to execute is 'exit_surelock' */ intent.putExtra("command","exit_surelock"); /* optional parameter to identify the sender application */ intent.putExtra("sender", "com.gears42.test.kill_surelock"); /* SureLock's password. Command will NOT execute if password mismatches */ intent.putExtra("password", editText.getText().toString()); intent.setPackage("com.gears42.surelock"); this.sendBroadcast(intent); }
final Intent intent = new Intent("com.gears42.surelock.COMMUNICATOR"); intent.putExtra("command","apply_settings"); intent.putExtra("sender", context.getPackageName()); // optional intent.putExtra("password", surelockPassword); intent.putExtra("setting_xml", surelockSettingFileContents); intent.setPackage("com.gears42.surelock"); context.sendBroadcast(intent);
final Intent intent = new Intent("com.gears42.surelock.COMMUNICATOR"); intent.putExtra("command","change_password"); intent.putExtra("sender", context.getPackageName()); // optional intent.putExtra("password", surelockPassword); intent.putExtra("new_password", newSureLockPassword); intent.setPackage("com.gears42.surelock"); context.sendBroadcast(intent);
final Intent intent = new Intent("com.gears42.surelock.COMMUNICATOR"); intent.putExtra("command","force_apply_settings"); intent.putExtra("sender", context.getPackageName()); // optional intent.putExtra("password", surelockPassword); intent.putExtra("settings_path", pathToSurelockSettingsFile); intent.setPackage("com.gears42.surelock"); context.sendBroadcast(intent);
final Intent intent = new Intent("com.gears42.surelock.COMMUNICATOR"); intent.putExtra("command","reset_idletimeout"); intent.putExtra("sender", context.getPackageName()); // optional intent.putExtra("password", surelockPassword); intent.setPackage("com.gears42.surelock"); context.sendBroadcast(intent);
final Intent intent = new Intent("com.gears42.surelock.COMMUNICATOR"); intent.putExtra("command","activate"); intent.putExtra("sender", context.getPackageName()); // optional intent.putExtra("activation_code",activationcode); intent.putExtra("password", surelockPassword); intent.setPackage("com.gears42.surelock"); context.sendBroadcast(intent);
final Intent intent = new Intent("com.gears42.surelock.COMMUNICATOR"); intent.putExtra("command","deactivate"); intent.putExtra("sender", context.getPackageName()); // optional intent.putExtra("password", surelockPassword); intent.setPackage("com.gears42.surelock"); context.sendBroadcast(intent);
final Intent intent = new Intent("com.gears42.surelock.COMMUNICATOR"); intent.putExtra("command","force_knox"); intent.putExtra("sender", context.getPackageName()); // optional intent.putExtra("password", surelockPassword); intent.setPackage("com.gears42.surelock"); context.sendBroadcast(intent);
final Intent intent = new Intent("com.gears42.surelock.COMMUNICATOR"); intent.putExtra("command","hidebottombar"); intent.putExtra("sender", context.getPackageName()); // optional intent.putExtra("password", surelockPassword); intent.setPackage("com.gears42.surelock"); context.sendBroadcast(intent);
final Intent intent = new Intent("com.gears42.surelock.COMMUNICATOR"); intent.putExtra("command","showbottombar"); intent.putExtra("sender", context.getPackageName()); // optional intent.putExtra("password", surelockPassword); intent.setPackage("com.gears42.surelock"); context.sendBroadcast(intent);
final Intent intent = new Intent("com.gears42.surelock.COMMUNICATOR");
intent.putExtra("command","add_application"); intent.putExtra("sender",context.getPackageName()); intent.putExtra("password",surelockPassword); intent.putExtra("package_name",applicationPackageName); intent.putExtra("label",applicationLabel); // optional intent.putExtra("icon",applicationIcon); // optional intent.putExtra("app_password",applicationPassword); // optional intent.putExtra("hide_icon",True/False); // optional intent.putExtra("launch_at_startup",True/False); // optional intent.putExtra("restart_app_on_relaunch",True/False); // optional intent.putExtra("clear_app_data",True/False); // optional intent.putExtra("idle_timeout",value); // optional intent.setPackage("com.gears42.surelock"); sendBroadcast(intent); intent.putExtra("blocked_windows",childwindow1,childwindow2,childwindow3); // optional intent.putExtra("landscape_position",0/1); // optional intent.putExtra("portrait_position",0/1); // optional
final Intent intent = new Intent("com.gears42.surelock.COMMUNICATOR"); intent.putExtra("command","remove_application"); intent.putExtra("sender",context.getPackageName()); intent.putExtra("password",surelockPassword); intent.putExtra("package_name",applicationPackageName); intent.setPackage("com.gears42.surelock"); sendBroadcast(intent);
final Intent intent = new Intent("com.gears42.surelock.COMMUNICATOR"); intent.putExtra("command","wifi_settings"); intent.putExtra("sender",context.getPackageName()); intent.putExtra("password",surelockPassword); intent.putExtra("ssid",wifiSSID); intent.putExtra("wifi_password",wifiPassword); intent.putExtra("security_type",securityType); intent.setPackage("com.gears42.surelock");
sendBroadcast(intent);
SureLock Command Line Options
Examples:
To add an application -
To remove an application -
To configure Wi-Fi Settings -
To change Password -
To exit SureLock -
To force apply changes -
To reset Idle Timeout -
To activate SureLock License -
To deactivate SureLock License -
To force the user to activate KNOX -
To hide bottom bar of the device -
To show Bottom bar of the device -
am broadcast -a com.gears42.surelock.COMMUNICATOR -n com.gears42.surelock/com.gears42.surelock.service.SureLockCommunicator -e password 0000 -e command add_application -e package_name -e label-e icon -e app_password <0000>-e hide_icon -e launch_at_startup -e restart_app_on_relaunch -e blocked_windows -e idle_timeout > com.gears42.surelock
am broadcast -a com.gears42.surelock.COMMUNICATOR -n com.gears42.surelock/com.gears42.surelock.service.SureLockCommunicator -e password <0000> -e command remove_application -e package_name com.gears42.surelock
am broadcast -a com.gears42.surelock.COMMUNICATOR -n com.gears42.surelock/com.gears42.surelock.service.SureLockCommunicator -e password <0000> -e command wifi_settings -e clear_saved_network -e ssid -e wifi_password -e security_type com.gears42.surelock
am broadcast -a com.gears42.surelock.COMMUNICATOR -n com.gears42.surelock/com.gears42.surelock.service.SureLockCommunicator -e "command" "change_password" -e "password" "0000" -e "new_password" "1111" com.gears42.surelock
am broadcast -a com.gears42.surelock.COMMUNICATOR -n com.gears42.surelock/com.gears42.surelock.service.SureLockCommunicator -e "password" "0000" -e "command" "exit_surelock" com.gears42.surelock
am broadcast -a com.gears42.surelock.COMMUNICATOR -n com.gears42.surelock/com.gears42.surelock.service.SureLockCommunicator -e "command" "force_apply_settings" -e "password" "0000" -e "settings_path" "/sdcard/SureLock.settings" com.gears42.surelock
am broadcast -a com.gears42.surelock.COMMUNICATOR -n com.gears42.surelock/com.gears42.surelock.service.SureLockCommunicator -e "command" "reset_idletimeout" -e "password" "0000" com.gears42.surelock
am broadcast -a com.gears42.surelock.COMMUNICATOR -n com.gears42.surelock/com.gears42.surelock.service.SureLockCommunicator -e "command" "activate" -e "password" "0000" -e "activation_code" "Enter Code Here" com.gears42.surelock
am broadcast -a com.gears42.surelock.COMMUNICATOR -n com.gears42.surelock/com.gears42.surelock.service.SureLockCommunicator -e "command" "deactivate" -e "password" "0000" com.gears42.surelock
am broadcast -a com.gears42.surelock.COMMUNICATOR -n com.gears42.surelock/com.gears42.surelock.service.SureLockCommunicator -e "password" "0000" -e "command" "force_knox" com.gears42.surelock
am broadcast -a com.gears42.surelock.COMMUNICATOR -n com.gears42.surelock/com.gears42.surelock.service.SureLockCommunicator -e "command" "hidebottombar" -e "password" "0000" com.gears42.surelock
am broadcast -a com.gears42.surelock.COMMUNICATOR -n com.gears42.surelock/com.gears42.surelock.service.SureLockCommunicator -e "command" "showbottombar" -e "password" "0000" com.gears42.surelock
https://www.42gears.com or contact us on info@42gears.com