Hide MagiskHide pre Kitkat

This commit is contained in:
topjohnwu 2020-09-13 03:55:12 -07:00
parent 8a61ae621d
commit 8a338de696
2 changed files with 9 additions and 3 deletions

View File

@ -72,6 +72,10 @@ class SettingsViewModel(
Magisk,
MagiskHide, SystemlessHosts
))
if (Build.VERSION.SDK_INT < 19) {
// MagiskHide is only available on 4.4+
list.remove(MagiskHide)
}
}
// Superuser

View File

@ -1,6 +1,7 @@
package com.topjohnwu.magisk.ui.superuser
import android.content.res.Resources
import android.os.Build
import androidx.databinding.ObservableArrayList
import androidx.lifecycle.viewModelScope
import com.topjohnwu.magisk.BR
@ -35,9 +36,10 @@ class SuperuserViewModel(
private val itemsHelpers = ObservableArrayList<TextItem>()
val adapter = adapterOf<ComparableRvItem<*>>()
val items = MergeObservableList<ComparableRvItem<*>>()
.insertItem(TappableHeadlineItem.Hide)
.insertList(itemsHelpers)
val items = MergeObservableList<ComparableRvItem<*>>().apply {
if (Build.VERSION.SDK_INT >= 19)
insertItem(TappableHeadlineItem.Hide)
}.insertList(itemsHelpers)
.insertList(itemsPolicies)
val itemBinding = itemBindingOf<ComparableRvItem<*>> {
it.bindExtra(BR.listener, this)