Skip to content

Commit

Permalink
Properly migrate update channels when repackaging
Browse files Browse the repository at this point in the history
  • Loading branch information
topjohnwu committed Oct 23, 2019
1 parent 6378abf commit 0d31e5c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/src/main/java/com/topjohnwu/magisk/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,6 @@ object Config : PreferenceModel, DBConfig {
fun initialize() = prefs.edit {
parsePrefs(this)

if (!prefs.contains(Key.UPDATE_CHANNEL))
putString(Key.UPDATE_CHANNEL, defaultChannel.toString())

// Get actual state
putBoolean(Key.COREONLY, Const.MAGISK_DISABLE_FILE.exists())

Expand All @@ -144,6 +141,9 @@ object Config : PreferenceModel, DBConfig {
putString(Key.SU_MNT_NS, suMntNamespaceMode.toString())
putString(Key.SU_MULTIUSER_MODE, suMultiuserMode.toString())
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 {
Expand Down

0 comments on commit 0d31e5c

Please sign in to comment.