Add DirectBoot support to receivers and SuRequestActivity

Close #1032, courtesy of @vvb2060
This commit is contained in:
topjohnwu
2019-02-04 01:58:04 -05:00
parent f620ac769f
commit 81a0cddb9e
6 changed files with 23 additions and 12 deletions
@@ -6,6 +6,7 @@ import android.os.Bundle;
import android.text.TextUtils;
import com.topjohnwu.magisk.components.BaseActivity;
import com.topjohnwu.magisk.database.RepoDatabaseHelper;
import com.topjohnwu.magisk.tasks.UpdateRepos;
import com.topjohnwu.magisk.uicomponents.Notifications;
import com.topjohnwu.magisk.uicomponents.Shortcuts;
@@ -67,6 +68,9 @@ public class SplashActivity extends BaseActivity {
// Setup shortcuts
Shortcuts.setup(this);
// Create repo database
app.repoDB = new RepoDatabaseHelper(this);
// Magisk working as expected
if (Shell.rootAccess() && Config.magiskVersionCode > 0) {
// Load modules
@@ -21,6 +21,7 @@ import com.topjohnwu.magisk.components.BaseActivity;
import com.topjohnwu.magisk.container.Policy;
import com.topjohnwu.magisk.utils.FingerprintHelper;
import com.topjohnwu.magisk.utils.SuConnector;
import com.topjohnwu.magisk.utils.Utils;
import java.io.IOException;
@@ -75,7 +76,7 @@ public class SuRequestActivity extends BaseActivity {
PackageManager pm = getPackageManager();
app.mDB.clearOutdated();
timeoutPrefs = getSharedPreferences("su_timeout", 0);
timeoutPrefs = Utils.getDEContext().getSharedPreferences("su_timeout", 0);
// Get policy
Intent intent = getIntent();