http://www.stealthcopter.com/blog/2010/01/android-requesting-root-access-in-your-app/

要点是:

  1. p = Runtime.getRuntime().exec("su");
  2. p.getOutputStream()获得和stdin相连接的OutputStream
    p.getInputStream()获得和stdout相连接的InputStream
    p.getErrorStream()获得和stderr相连接的InputStream
Advertisements