On Wednesday, July 13, 2011 4:03:46 PM UTC-4, Zhao Wang wrote:

So these lead me into suspecting that whether my application has the 
> true root permission as I do in the shell. Even if I use an exec("su") 
> beforehand and the process's return shows that it succeeded getting 
> super user, I still get nothing from the "maps" file under other 
> processes. 
>

There is no means by which a running android application - or for that 
matter an application on a more ordinary unix-like OS - can become root.  
Unlike with other unixes, it's also extraordinarily difficult and 
inefficient to start an android application initially running as root.

Basically, you aren't "supposed" to do things that require root permission, 
and on a consumer ("secured") device you cannot do so.

On a development or "rooted" device, you may be able to launch a helper 
process as root and have that do something for you.  Often people will 
launch a root copy of the shell or a built in command using a hacked "su" 
command that has been made available to applications, possibly after some 
gatekeeper code.  The key thing to realize though is that "su" is not 
"sticky" - only the command run by "su" runs as root.  Typically, depending 
on the capabilities of your su program you would either pass it the name of 
the command to run (such as 'cat') and its arguments, or just the name of 
the command and pipe the arguments into the stdin of the resulting process.
 

-- 
unsubscribe: android-kernel+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-kernel

Reply via email to