shell - Android root commands not working in application -
i experimenting shell commands on rooted nexus 7 tablet , found commands seem wouldn't need root privilege being executed.
for example, if call:
process process = runtime.getruntime().exec("su -c mkdir /sdcard/test");
the directory created. if call:
process process = runtime.getruntime().exec("su -c mkdir /system/test");
nothing happens.
(i have tried sorts of commands, , tried sorts of different syntax in case off, commands wouldn't need root access executed)
when try execute command, popup superuser , grant application root privilege there else missing? have looked around , far can tell should work.
thanks.
you must quote argument
mkdir
, otherwisesu
assume/system/test
user name , fail run.process process = runtime.getruntime().exec("su -c \"mkdir /path/to/test\"");
some areas of filesystem, such
/system
, read due way filesystem organized/mounted. root access won't change that, command still fail.
to verify whether you're trying possible, install terminal emulator on device , run command hand first.
Comments
Post a Comment