Handle MagiskHide at boot

This commit is contained in:
topjohnwu
2017-02-01 23:54:32 +08:00
parent 0efb4da0ee
commit 99ef0b8cb4
17 changed files with 49 additions and 73 deletions
@@ -3,12 +3,22 @@ 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) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
Global.initSuAccess();
if (prefs.getBoolean("magiskhide", false)) {
Toast.makeText(context, R.string.start_magiskhide, Toast.LENGTH_SHORT).show();
new Async.MagiskHide().enable();
}
}
}