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