2017-01-29 16:52:43 +08:00
|
|
|
package com.topjohnwu.magisk.receivers;
|
|
|
|
|
|
|
|
import android.content.BroadcastReceiver;
|
|
|
|
import android.content.Context;
|
|
|
|
import android.content.Intent;
|
2017-02-01 23:54:32 +08:00
|
|
|
import android.content.SharedPreferences;
|
|
|
|
import android.preference.PreferenceManager;
|
|
|
|
import android.widget.Toast;
|
2017-01-29 16:52:43 +08:00
|
|
|
|
|
|
|
import com.topjohnwu.magisk.Global;
|
2017-02-01 23:54:32 +08:00
|
|
|
import com.topjohnwu.magisk.R;
|
|
|
|
import com.topjohnwu.magisk.utils.Async;
|
2017-01-29 16:52:43 +08:00
|
|
|
|
|
|
|
public class BootReceiver extends BroadcastReceiver {
|
|
|
|
@Override
|
|
|
|
public void onReceive(Context context, Intent intent) {
|
2017-02-01 23:54:32 +08:00
|
|
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
2017-01-29 16:52:43 +08:00
|
|
|
Global.initSuAccess();
|
2017-02-01 23:54:32 +08:00
|
|
|
if (prefs.getBoolean("magiskhide", false)) {
|
|
|
|
Toast.makeText(context, R.string.start_magiskhide, Toast.LENGTH_SHORT).show();
|
|
|
|
new Async.MagiskHide().enable();
|
|
|
|
}
|
2017-01-29 16:52:43 +08:00
|
|
|
}
|
|
|
|
}
|