I was experimenting with some shell commands on a rooted Nexus 7 tablet and I found that only the commands that seem like they wouldn't need root privilege are being executed.
For example, if I call:
Process process = Runtime.getRuntime().exec("su -c mkdir /sdcard/test");
the directory is created. But if I call:
Process process = Runtime.getRuntime().exec("su -c mkdir /system/test");
Nothing happens.
(I have tried all sorts of commands, and tried all sorts of different syntax in case something was off, but only commands that I wouldn't need root access for get executed)
When I try to execute this command, I get the popup from SuperUser and grant my application root privilege but is there something else that I am missing? I have looked all around and as far as I can tell this should work.
Thanks.