You've already forked Magisk
mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-09-06 06:36:58 +00:00
Whoop whoop
This commit is contained in:
@@ -6,6 +6,7 @@ import android.content.Intent;
|
||||
import android.util.Log;
|
||||
|
||||
import com.topjohnwu.magisk.services.MonitorService;
|
||||
import com.topjohnwu.magisk.utils.PrefHelper;
|
||||
import com.topjohnwu.magisk.utils.Utils;
|
||||
|
||||
public class AutoStartReceiver extends BroadcastReceiver {
|
||||
@@ -14,7 +15,13 @@ public class AutoStartReceiver extends BroadcastReceiver {
|
||||
Log.d("Magisk", "Received Boot call, attempting to start service");
|
||||
Intent myIntent = new Intent(context, MonitorService.class);
|
||||
context.startService(myIntent);
|
||||
Utils.SetupQuickSettingsTile(context);
|
||||
if (PrefHelper.CheckBool("keep_root_off")) {
|
||||
Utils.toggleRoot(false);
|
||||
}
|
||||
if (PrefHelper.CheckBool("enable_quicktile")) {
|
||||
Utils.SetupQuickSettingsTile(context);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.topjohnwu.magisk.receivers;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.util.Log;
|
||||
|
||||
import com.topjohnwu.magisk.services.TileService;
|
||||
|
||||
public class TileReceiver extends BroadcastReceiver {
|
||||
private static final String TAG = "MainReceiver";
|
||||
public TileReceiver() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
Log.d(TAG,"RECEIVED");
|
||||
String action = intent.getAction();
|
||||
|
||||
if (action.equals(Intent.ACTION_BOOT_COMPLETED) || action.equals(Intent.ACTION_USER_PRESENT) || action.equals(Intent.ACTION_SCREEN_ON)) {
|
||||
context.startService(new Intent(context,TileService.class));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user