diff --git a/src/main/java/com/topjohnwu/magisk/MagiskFragment.java b/src/main/java/com/topjohnwu/magisk/MagiskFragment.java index 9efc95679..6aeb048ae 100644 --- a/src/main/java/com/topjohnwu/magisk/MagiskFragment.java +++ b/src/main/java/com/topjohnwu/magisk/MagiskFragment.java @@ -138,13 +138,9 @@ public class MagiskFragment extends Fragment setupExpandable(); keepVerityChkbox.setChecked(mm.keepVerity); - keepVerityChkbox.setOnCheckedChangeListener((view, isChecked) -> { - mm.keepVerity = isChecked; - }); + keepVerityChkbox.setOnCheckedChangeListener((view, checked) -> mm.keepVerity = checked); keepEncChkbox.setChecked(mm.keepEnc); - keepEncChkbox.setOnCheckedChangeListener((view, isChecked) -> { - mm.keepEnc = isChecked; - }); + keepEncChkbox.setOnCheckedChangeListener((view, checked) -> mm.keepEnc = checked); mSwipeRefreshLayout.setOnRefreshListener(this); updateUI(); diff --git a/src/main/java/com/topjohnwu/magisk/MagiskManager.java b/src/main/java/com/topjohnwu/magisk/MagiskManager.java index d5a1df870..d4c57f55c 100644 --- a/src/main/java/com/topjohnwu/magisk/MagiskManager.java +++ b/src/main/java/com/topjohnwu/magisk/MagiskManager.java @@ -212,6 +212,14 @@ public class MagiskManager extends Application { if (Utils.isValidShellResponse(ret)) bootBlock = ret.get(0); + if (suDB != null && !SuDatabaseHelper.verified) { + suDB.close(); + suDB = new SuDatabaseHelper(); + } + } + + public void getDefaultInstallFlags() { + List ret; ret = Shell.su("echo \"$DTBOIMAGE\""); if (Utils.isValidShellResponse(ret)) keepVerity = true; @@ -235,11 +243,6 @@ public class MagiskManager extends Application { if (Utils.isValidShellResponse(ret)) keepEnc = Boolean.parseBoolean(ret.get(0)); } catch (NumberFormatException ignored) {} - - if (suDB != null && !SuDatabaseHelper.verified) { - suDB.close(); - suDB = new SuDatabaseHelper(); - } } public void setPermissionGrantCallback(Runnable callback) { diff --git a/src/main/java/com/topjohnwu/magisk/SplashActivity.java b/src/main/java/com/topjohnwu/magisk/SplashActivity.java index 20e90f5cb..50d56a5e0 100644 --- a/src/main/java/com/topjohnwu/magisk/SplashActivity.java +++ b/src/main/java/com/topjohnwu/magisk/SplashActivity.java @@ -34,6 +34,7 @@ public class SplashActivity extends Activity { MagiskManager mm = getMagiskManager(); mm.loadMagiskInfo(); + mm.getDefaultInstallFlags(); Utils.loadPrefs(); // Dynamic detect all locales