No more static crap :)

This commit is contained in:
topjohnwu
2017-02-07 02:01:32 +08:00
parent c6bf7bb9cd
commit bef5969580
28 changed files with 421 additions and 367 deletions
@@ -7,7 +7,7 @@ import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.widget.Toast;
import com.topjohnwu.magisk.Global;
import com.topjohnwu.magisk.MagiskManager;
import com.topjohnwu.magisk.R;
import com.topjohnwu.magisk.utils.Async;
@@ -15,10 +15,11 @@ public class BootReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Global.initSuAccess();
Global.updateMagiskInfo();
MagiskManager magiskManager = (MagiskManager) context.getApplicationContext();
magiskManager.initSuAccess();
magiskManager.updateMagiskInfo();
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
if (prefs.getBoolean("magiskhide", false) && !Global.Info.disabled && Global.Info.magiskVersion > 10.3) {
if (prefs.getBoolean("magiskhide", false) && !magiskManager.disabled && magiskManager.magiskVersion > 10.3) {
Toast.makeText(context, R.string.start_magiskhide, Toast.LENGTH_SHORT).show();
new Async.MagiskHide(true).enable();
}