Teo Choong Ping
Teo Choong Ping

Reputation: 12808

Run shell script -- doesn't seems to take effect

So I have a need to modify the Xoom tablet iptables rules and I created a shell script to do that, and it works if I run it directly from the shell but doesn't seems to work if I have an (Java) activity run it.

I must be missing something, can you guys give me some clue?

Upvotes: 2

Views: 465

Answers (1)

Ravi
Ravi

Reputation: 3766

adb shell has root permissions, whereas Java doesn't.

in adb:

# id
uid=0(root) gid=0(root)

You can get your user id in Java to see what you're running as.

If you have access to the OS build, then you can raise your application level to system, but that still won't give you root. Here's an SO post on that if you're interested.

Upvotes: 1

Related Questions