MCPcopy Create free account
hub / github.com/FongMi/TV / exec

Method exec

catvod/src/main/java/com/github/catvod/utils/Shell.java:12–25  ·  view source on GitHub ↗
(String command)

Source from the content-addressed store, hash-verified

10 private static final String TAG = Shell.class.getSimpleName();
11
12 public static String exec(String command) {
13 try {
14 StringBuilder sb = new StringBuilder();
15 Process p = Runtime.getRuntime().exec(command);
16 BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
17 String line;
18 while ((line = br.readLine()) != null) sb.append(line).append("\n");
19 Logger.t(TAG).d("Shell command '%s' with exit code '%s'", command, p.waitFor());
20 return Util.substring(sb.toString());
21 } catch (Exception e) {
22 e.printStackTrace();
23 return "";
24 }
25 }
26}

Callers 15

getSerialMethod · 0.95
createMethod · 0.95
BFunction · 0.80
FFunction · 0.80
HrFunction · 0.80
rFunction · 0.80
iFunction · 0.80
BFunction · 0.80
FFunction · 0.80
rFunction · 0.80
iFunction · 0.80
tlFunction · 0.80

Calls 4

substringMethod · 0.95
readLineMethod · 0.80
appendMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected