1

I've built a tasker like app called Condi. In order to enable disable airplane mode in the latest Jellybeans and higher I use this terminal command:

settings put global airplane_mode_on 1

this works well but on some phones the settings command is missing. when it's present you can find it at /system/bin/settings (the problem is not the path, it's just missing entirely)

here's a copy of "settings" (the commands it performs):

# Script to start "settings" on the device
#
base=/system
export CLASSPATH=$base/framework/settings.jar
exec app_process $base/bin com.android.commands.settings.SettingsCmd "$@"

so what i tried is to run it directly by doing

export CLASSPATH=/system/framework/settings.jar
exec app_process /system/bin com.android.commands.settings.SettingsCmd put global airplane_mode_on 1

which worked on my phone (with settings present in the first place) but the two volunteer testers (without settings) both claim doing this in a terminal emulator app - crashes without doing it's thing.

does anyone know how it can / should be done properly ?

thanks!

Anton Wolkov
  • 133
  • 10
  • What happens if you copy the settings executable into your assets folder and try to execute it from there? – Phantômaxx Feb 07 '14 at 15:26
  • for now i just asked the testers to copy it to the downloads folder and chmod 777 it but the permission didn't stick. i think sdcard is mounted with no-execute flag. what asset folder can i use for this that will give me exec permissions? – Anton Wolkov Feb 07 '14 at 15:28
  • Sincerely, I don't know much about permissions. But you could do so: from the app's assets folder, copy (if not already existing) the file to your ... /bin(?) system executable folder. Then execute the settings program from there (as you would do normally). It should work (maybe, a chmod could be necessary). – Phantômaxx Feb 07 '14 at 15:32
  • A rooted device is needed to copy a file to /bin. – FD_ Feb 07 '14 at 15:58
  • root is not an issue. you mean /system/bin right? is there a folder i can test this in that doesn't need a remount? – Anton Wolkov Feb 07 '14 at 17:11

0 Answers0