Fix the issue that installation configs won't stick

This commit is contained in:
topjohnwu 2017-12-29 03:21:51 +08:00
parent 26038a0a07
commit 96650c06f0
3 changed files with 11 additions and 11 deletions

View File

@ -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();

View File

@ -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<String> 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) {

View File

@ -34,6 +34,7 @@ public class SplashActivity extends Activity {
MagiskManager mm = getMagiskManager();
mm.loadMagiskInfo();
mm.getDefaultInstallFlags();
Utils.loadPrefs();
// Dynamic detect all locales