You've already forked Magisk
mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-09-06 06:36:58 +00:00
27 lines
929 B
Java
27 lines
929 B
Java
package com.topjohnwu.magisk.receivers;
|
|
|
|
import android.content.BroadcastReceiver;
|
|
import android.content.Context;
|
|
import android.content.Intent;
|
|
import android.content.SharedPreferences;
|
|
import android.preference.PreferenceManager;
|
|
import android.widget.Toast;
|
|
|
|
import com.topjohnwu.magisk.Global;
|
|
import com.topjohnwu.magisk.R;
|
|
import com.topjohnwu.magisk.utils.Async;
|
|
|
|
public class BootReceiver extends BroadcastReceiver {
|
|
|
|
@Override
|
|
public void onReceive(Context context, Intent intent) {
|
|
Global.initSuAccess();
|
|
Global.updateMagiskInfo();
|
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
|
if (prefs.getBoolean("magiskhide", false) && !Global.Info.disabled && Global.Info.magiskVersion > 10.3) {
|
|
Toast.makeText(context, R.string.start_magiskhide, Toast.LENGTH_SHORT).show();
|
|
new Async.MagiskHide(true).enable();
|
|
}
|
|
}
|
|
}
|