Command Line Interface and APIs for SureFox

SureFox uses a BroadcastReceiver to allow 3rd party applications to send specific commands to SureFox. Command can be send using Intent. (See examples below). To execute any command Administrator password is necessary.

Currently, SureFox supports the following commands:

Launch_surefox:

final Intent intent = new Intent("com.gears42.surefox.COMMUNICATOR");
intent.putExtra("command","launch_surefox");
intent.putExtra("sender", context.getPackageName()); //optional
this.sendBroadcast(intent);

Exit_Surefox:

final Intent intent = new Intent("com.gears42.surefox.COMMUNICATOR");
intent.putExtra("command","exit_surefox");
intent.putExtra("sender", context.getPackageName()); //optional
intent.putExtra("password", "surefoxPassword");
this.sendBroadcast(intent);

apply_settings:

final Intent intent = new Intent("com.gears42.surefox.COMMUNICATOR");
intent.putExtra("command","apply_settings");
intent.putExtra("sender", context.getPackageName()); //optional
intent.putExtra("password", "surefoxPassword");
intent.putExtra("setting_xml", "pathToSureFoxSettingsFile");
context.sendBroadcast(intent);

force_apply_settings:

final Intent intent = new Intent("com.gears42.surefox.COMMUNICATOR");
intent.putExtra("command","force_apply_settings");
intent.putExtra("sender", context.getPackageName()); // optional
intent.putExtra("password", "surefoxPassword");
intent.putExtra("settings_path", "pathToSureFoxSettingsFile");
context.sendBroadcast(intent);

change_password:

final Intent intent = new Intent("com.gears42.surefox.COMMUNICATOR");
intent.putExtra("command","change_password");
intent.putExtra("sender", context.getPackageName()); // optional
intent.putExtra("password", "surefoxPassword");
intent.putExtra("new_password", "newsurefoxPassword");
context.sendBroadcast(intent);

You can also send SureFox commands from Command Line Interface:

Examples:

launch SureFox :

am broadcast -a com.gears42.surefox.COMMUNICATOR -e "password" "0000" -e "command" "launch_surefox"

exit SureFox :

am broadcast -a com.gears42.surefox.COMMUNICATOR -e "password" "0000" -e "command" "exit_surefox"

change_password :

am broadcast -a com.gears42.surefox.COMMUNICATOR -e "command" "change_password" -e "password" "0000" -e "new_password" "1111"

apply Settings :

am broadcast -a com.gears42.surefox.COMMUNICATOR -e "command" "apply_settings" -e "password" "0000" -e "settings_path" "/sdcard/SureFox.settings"

force_apply Settings :

am broadcast -a com.gears42.surefox.COMMUNICATOR -e "command" "force_apply_settings" -e "password" "0000" -e "settings_path" "/sdcard/SureFox.settings"

To know more, visit http://www.42gears.com or contact us on info@42gears.com

 

Leave a Comment