1
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:
Brent Cook 2016-10-10 23:36:50 -05:00
commit 4cf8f6df1f
No known key found for this signature in database
GPG Key ID: 1FFAA0B24B708F96
3 changed files with 8 additions and 2 deletions

View File

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

View File

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

View File

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