+ try {
+ rootcmd = Runtime.getRuntime().exec(new String[]{"su","-c","sh"});
+ } catch (java.io.IOException e) {
+ throw new NotRootedException();
+ }
+
+ try {
+ DataOutputStream sh = new DataOutputStream(rootcmd.getOutputStream());
+ sh.writeBytes(command + "\n");
+ sh.writeBytes("exit\n");
+ sh.flush();
+ sh.close();
+ } catch (java.io.IOException e) {
+ throw new ShellException();
+ }
+
+ try {
+ if (rootcmd.waitFor() != 0)
+ throw new ShellException();
+ } catch (java.lang.InterruptedException e) {
+ throw new ShellException();
+ }