mirror of
https://github.com/rapid7/metasploit-payloads
synced 2024-12-21 05:35:54 +01:00
Land #38, fix thread race condition
This commit is contained in:
commit
e4af7abf22
@ -68,18 +68,20 @@ public class AndroidMeterpreter extends Meterpreter {
|
|||||||
final Handler handler = new Handler(Looper.getMainLooper());
|
final Handler handler = new Handler(Looper.getMainLooper());
|
||||||
handler.post(new Runnable() {
|
handler.post(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
|
||||||
context = (Context) currentApplication.invoke(null, (Object[]) null);
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
synchronized (contextWaiter) {
|
synchronized (contextWaiter) {
|
||||||
|
try {
|
||||||
|
context = (Context) currentApplication.invoke(null, (Object[]) null);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
contextWaiter.notify();
|
contextWaiter.notify();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
synchronized (contextWaiter) {
|
synchronized (contextWaiter) {
|
||||||
contextWaiter.wait();
|
if (context == null) {
|
||||||
|
contextWaiter.wait(100);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user