1
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:
Tim 2015-06-01 07:15:14 +01:00
parent 97bda0ac40
commit cd0d091eb0

View File

@ -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);
}
}
}
}