mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-25 09:57:39 +00:00
Properly migrate update channels when repackaging
This commit is contained in:
parent
6378abf454
commit
0d31e5c8b1
@ -133,9 +133,6 @@ object Config : PreferenceModel, DBConfig {
|
|||||||
fun initialize() = prefs.edit {
|
fun initialize() = prefs.edit {
|
||||||
parsePrefs(this)
|
parsePrefs(this)
|
||||||
|
|
||||||
if (!prefs.contains(Key.UPDATE_CHANNEL))
|
|
||||||
putString(Key.UPDATE_CHANNEL, defaultChannel.toString())
|
|
||||||
|
|
||||||
// Get actual state
|
// Get actual state
|
||||||
putBoolean(Key.COREONLY, Const.MAGISK_DISABLE_FILE.exists())
|
putBoolean(Key.COREONLY, Const.MAGISK_DISABLE_FILE.exists())
|
||||||
|
|
||||||
@ -144,6 +141,9 @@ object Config : PreferenceModel, DBConfig {
|
|||||||
putString(Key.SU_MNT_NS, suMntNamespaceMode.toString())
|
putString(Key.SU_MNT_NS, suMntNamespaceMode.toString())
|
||||||
putString(Key.SU_MULTIUSER_MODE, suMultiuserMode.toString())
|
putString(Key.SU_MULTIUSER_MODE, suMultiuserMode.toString())
|
||||||
putBoolean(Key.SU_FINGERPRINT, FingerprintHelper.useFingerprint())
|
putBoolean(Key.SU_FINGERPRINT, FingerprintHelper.useFingerprint())
|
||||||
|
}.also {
|
||||||
|
if (!prefs.contains(Key.UPDATE_CHANNEL))
|
||||||
|
prefs.edit().putString(Key.UPDATE_CHANNEL, defaultChannel.toString()).apply()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun parsePrefs(editor: SharedPreferences.Editor) = editor.apply {
|
private fun parsePrefs(editor: SharedPreferences.Editor) = editor.apply {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user