You've already forked Magisk
mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-09-06 06:36:58 +00:00
Remove Auto Root Code
Revert this commit after things are sorted out
This commit is contained in:
@@ -1,27 +0,0 @@
|
||||
package com.topjohnwu.magisk.receivers;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.util.Log;
|
||||
|
||||
import com.topjohnwu.magisk.services.MonitorService;
|
||||
import com.topjohnwu.magisk.utils.Utils;
|
||||
|
||||
public class AutoStartReceiver extends BroadcastReceiver {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
Log.d("Magisk", "Received Boot call, attempting to start service");
|
||||
Intent myIntent = new Intent(context, MonitorService.class);
|
||||
context.startService(myIntent);
|
||||
if (PreferenceManager.getDefaultSharedPreferences(context).getBoolean("keep_root_off", false)) {
|
||||
Utils.toggleRoot(false, context);
|
||||
}
|
||||
if (PreferenceManager.getDefaultSharedPreferences(context).getBoolean("enable_quicktile", false)) {
|
||||
Utils.setupQuickSettingsTile(context);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
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.utils.Utils;
|
||||
|
||||
/**
|
||||
* Receiver for click events on the custom M Quick Settings tile
|
||||
*/
|
||||
public final class PrivateBroadcastReceiver extends BroadcastReceiver {
|
||||
public static final String ACTION_AUTOROOT = "com.topjohnwu.magisk.CUSTOMTILE_ACTION_AUTOROOT";
|
||||
public static final String ACTION_DISABLEROOT = "com.topjohnwu.magisk.CUSTOMTILE_ACTION_DISABLEROOT";
|
||||
public static final String ACTION_ENABLEROOT = "com.topjohnwu.magisk.CUSTOMTILE_ACTION_ENABLEROOT";
|
||||
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
final String action = intent.getAction();
|
||||
Log.d("Magisk","Broadcast Receiver, Made it this far! We're trying to " + action);
|
||||
if (ACTION_AUTOROOT.equals(action)) {
|
||||
Utils.toggleAutoRoot(!Utils.autoToggleEnabled(context),context);
|
||||
}
|
||||
if (ACTION_ENABLEROOT.equals(action)) {
|
||||
Utils.toggleAutoRoot(false, context);
|
||||
Utils.toggleRoot(true, context);
|
||||
}
|
||||
if (ACTION_DISABLEROOT.equals(action)) {
|
||||
Utils.toggleAutoRoot(false, context);
|
||||
Utils.toggleRoot(false, context);
|
||||
}
|
||||
|
||||
Utils.setupQuickSettingsTile(context);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user