MCPcopy Index your code
hub / github.com/cSploit/android / root

Method root

cSploit/src/org/csploit/android/core/ExecChecker.java:65–83  ·  view source on GitHub ↗

test if root can execute stuff inside a directory @param dir the directory to check @return true if root can create executable files inside dir

(String dir)

Source from the content-addressed store, hash-verified

63 * @return true if root can create executable files inside {@code dir}
64 */
65 private boolean root(String dir) {
66
67 if(dir==null)
68 return false;
69
70 try {
71 String tmpname;
72 do {
73 tmpname = dir + "/" + UUID.randomUUID().toString();
74 } while (System.getTools().raw.run(String.format("test -f '%s'", tmpname))==0);
75
76 return System.getTools().shell.run(
77 String.format("touch '%1$s' && chmod %2$o '%1$s' && test -x '%1$s' && rm '%1$s'",
78 tmpname, 0755)) == 0;
79 } catch (Exception e) {
80 Logger.error(e.getMessage());
81 }
82 return false;
83 }
84
85 private static void updateFuseBinds() {
86 try {

Callers 1

canExecuteInDirMethod · 0.95

Calls 5

getToolsMethod · 0.95
errorMethod · 0.95
formatMethod · 0.80
toStringMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected