mirror of
https://github.com/topjohnwu/Magisk.git
synced 2026-01-14 05:47:07 -08:00
Move denylist fragment to settings
This commit is contained in:
@@ -60,7 +60,6 @@ open class MainActivity : BaseUIActivity<MainViewModel, ActivityMainMd2Binding>(
|
||||
R.id.homeFragment,
|
||||
R.id.modulesFragment,
|
||||
R.id.superuserFragment,
|
||||
R.id.denyFragment,
|
||||
R.id.logFragment -> true
|
||||
else -> false
|
||||
}
|
||||
@@ -182,7 +181,6 @@ open class MainActivity : BaseUIActivity<MainViewModel, ActivityMainMd2Binding>(
|
||||
R.id.modulesFragment -> MainDirections.actionModuleFragment()
|
||||
R.id.superuserFragment -> MainDirections.actionSuperuserFragment()
|
||||
R.id.logFragment -> MainDirections.actionLogFragment()
|
||||
R.id.denyFragment -> MainDirections.actionDenylistFragment()
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
@@ -253,7 +253,7 @@ object Magisk : BaseSettingsItem.Section() {
|
||||
}
|
||||
|
||||
object DenyList : BaseSettingsItem.Toggle() {
|
||||
override val title = R.string.denylist.asText()
|
||||
override val title = R.string.settings_denylist_title.asText()
|
||||
override val description = R.string.settings_denylist_summary.asText()
|
||||
override var value = Info.env.denyListEnforced
|
||||
set(value) = setV(value, field, { field = it }) {
|
||||
@@ -262,9 +262,15 @@ object DenyList : BaseSettingsItem.Toggle() {
|
||||
if (cb.isSuccess) Info.env.denyListEnforced = it
|
||||
else field = !it
|
||||
}
|
||||
DenyListConfig.isEnabled = it
|
||||
}
|
||||
}
|
||||
|
||||
object DenyListConfig : BaseSettingsItem.Blank() {
|
||||
override val title = R.string.settings_denylist_config_title.asText()
|
||||
override val description = R.string.settings_denylist_config_summary.asText()
|
||||
}
|
||||
|
||||
// --- Superuser
|
||||
|
||||
object Superuser : BaseSettingsItem.Section() {
|
||||
|
||||
@@ -73,7 +73,7 @@ class SettingsViewModel(
|
||||
SystemlessHosts
|
||||
))
|
||||
if (Const.Version.isCanary()) {
|
||||
list.add(DenyList)
|
||||
list.addAll(listOf(DenyList, DenyListConfig))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,6 +105,7 @@ class SettingsViewModel(
|
||||
is DownloadPath -> withExternalRW(callback)
|
||||
is Biometrics -> authenticate(callback)
|
||||
is Theme -> SettingsFragmentDirections.actionSettingsFragmentToThemeFragment().navigate()
|
||||
is DenyListConfig -> SettingsFragmentDirections.actionSettingsFragmentToDenyFragment().navigate()
|
||||
is ClearRepoCache -> clearRepoCache()
|
||||
is SystemlessHosts -> createHosts()
|
||||
is Restore -> HideAPK.restore(view.activity)
|
||||
|
||||
Reference in New Issue
Block a user