You've already forked Magisk
mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-09-06 06:36:58 +00:00
Fixed setting custom channels and switching between official ones being broken
This commit is contained in:
@@ -12,6 +12,8 @@ import androidx.core.view.isVisible
|
||||
import androidx.preference.*
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.topjohnwu.magisk.App
|
||||
import com.topjohnwu.magisk.Config
|
||||
import com.topjohnwu.magisk.KConfig
|
||||
import com.topjohnwu.magisk.R
|
||||
import com.topjohnwu.magisk.data.repository.ModuleRepository
|
||||
import com.topjohnwu.magisk.data.repository.SettingRepository
|
||||
@@ -64,4 +66,19 @@ abstract class BasePreferenceFragment : PreferenceFragmentCompat(),
|
||||
else
|
||||
view.setPadding(0, view.paddingTop, view.paddingRight, view.paddingBottom)
|
||||
}
|
||||
|
||||
protected fun setCustomUpdateChannel(userRepo: String) {
|
||||
KConfig.customUpdateChannel = userRepo
|
||||
}
|
||||
|
||||
protected fun getChannelCompat(channel: Int): KConfig.UpdateChannel {
|
||||
return when (channel) {
|
||||
Config.Value.DEFAULT_CHANNEL -> KConfig.UpdateChannel.STABLE
|
||||
Config.Value.BETA_CHANNEL -> KConfig.UpdateChannel.BETA
|
||||
Config.Value.CANARY_CHANNEL -> KConfig.UpdateChannel.CANARY
|
||||
Config.Value.CANARY_DEBUG_CHANNEL -> KConfig.UpdateChannel.CANARY_DEBUG
|
||||
Config.Value.CUSTOM_CHANNEL -> KConfig.UpdateChannel.CUSTOM
|
||||
else -> KConfig.updateChannel
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user