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

Method async

cSploit/src/org/csploit/android/core/ChildManager.java:81–106  ·  view source on GitHub ↗

spawn a child asynchronously @param handler name of the handler @param cmd arguments for the child @param env custom environment variables @param receiver receiver for events fired by the child @return the spawned org.csploit.android.core.Child @throws ChildNotStartedExceptio

(String handler, String cmd, String[] env, EventReceiver receiver)

Source from the content-addressed store, hash-verified

79 * @throws ChildNotStartedException when cannot start a child.
80 */
81 public static Child async(String handler, String cmd, String[] env, EventReceiver receiver) throws ChildNotStartedException {
82 Child c;
83
84 c = new Child();
85
86 c.id = Client.StartCommand(handler, cmd, env);
87 if (c.id == -1) {
88 Logger.debug(String.format("{ handler='%s', cmd='%s' } => FAILED", handler, cmd));
89 throw new ChildNotStartedException();
90 }
91
92 Logger.debug(String.format("{ handler='%s', cmd='%s' } => %d", handler, cmd, c.id));
93
94 c.running = true;
95 c.receiver = receiver;
96
97 if(c.receiver!=null)
98 c.receiver.onStart(cmd);
99
100 synchronized (children) {
101 children.add(c);
102 children.notifyAll();
103 }
104
105 return c;
106 }
107
108 public static Child async(String handler, String cmd) throws ChildNotStartedException {
109 return async(handler, cmd, null, null);

Callers 3

asyncMethod · 0.95
execMethod · 0.95
notifyNativeErrorMethod · 0.45

Calls 5

StartCommandMethod · 0.95
debugMethod · 0.95
formatMethod · 0.80
onStartMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected