mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-27 20:15:29 +00:00
Move denylist fragment to settings
This commit is contained in:
parent
65b0ea792e
commit
16de4674ec
@ -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)
|
||||
|
@ -38,7 +38,7 @@
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_marginStart="@dimen/l1"
|
||||
android:layout_marginEnd="@dimen/l1"
|
||||
android:layout_marginBottom="72dp"
|
||||
android:layout_marginBottom="@dimen/l1"
|
||||
app:backgroundTint="?colorSurfaceSurfaceVariant"
|
||||
app:layout_fitsSystemWindowsInsets="bottom"
|
||||
app:srcCompat="@drawable/ic_search_md2"
|
||||
|
@ -14,12 +14,6 @@
|
||||
android:title="@string/superuser"
|
||||
tools:showAsAction="always" />
|
||||
|
||||
<item
|
||||
android:id="@+id/denyFragment"
|
||||
android:icon="@drawable/ic_hide_md2"
|
||||
android:title="@string/denylist"
|
||||
tools:showAsAction="always" />
|
||||
|
||||
<item
|
||||
android:id="@+id/logFragment"
|
||||
android:icon="@drawable/ic_bug_md2"
|
||||
|
@ -104,6 +104,14 @@
|
||||
app:popEnterAnim="@anim/fragment_enter_pop"
|
||||
app:popExitAnim="@anim/fragment_exit_pop" />
|
||||
|
||||
<action
|
||||
android:id="@+id/action_settingsFragment_to_denyFragment"
|
||||
app:destination="@id/denyFragment"
|
||||
app:enterAnim="@anim/fragment_enter"
|
||||
app:exitAnim="@anim/fragment_exit"
|
||||
app:popEnterAnim="@anim/fragment_enter_pop"
|
||||
app:popExitAnim="@anim/fragment_exit_pop" />
|
||||
|
||||
</fragment>
|
||||
|
||||
<fragment
|
||||
@ -164,13 +172,4 @@
|
||||
app:popExitAnim="@anim/fragment_exit_pop"
|
||||
app:popUpTo="@id/homeFragment" />
|
||||
|
||||
<action
|
||||
android:id="@+id/action_denylistFragment"
|
||||
app:destination="@id/denyFragment"
|
||||
app:enterAnim="@anim/fragment_enter"
|
||||
app:exitAnim="@anim/fragment_exit"
|
||||
app:popEnterAnim="@anim/fragment_enter_pop"
|
||||
app:popExitAnim="@anim/fragment_exit_pop"
|
||||
app:popUpTo="@id/homeFragment"/>
|
||||
|
||||
</navigation>
|
||||
|
@ -147,7 +147,10 @@
|
||||
<string name="settings_update_beta">Beta</string>
|
||||
<string name="settings_update_custom">Custom Channel</string>
|
||||
<string name="settings_update_custom_msg">Insert a custom URL</string>
|
||||
<string name="settings_denylist_title">Enforce DenyList</string>
|
||||
<string name="settings_denylist_summary">Processes on the denylist will have all Magisk modifications reverted</string>
|
||||
<string name="settings_denylist_config_title">Configure DenyList</string>
|
||||
<string name="settings_denylist_config_summary">Select the processes to be included on the denylist</string>
|
||||
<string name="settings_hosts_title">Systemless hosts</string>
|
||||
<string name="settings_hosts_summary">Systemless hosts support for Adblock apps</string>
|
||||
<string name="settings_hosts_toast">Added systemless hosts module</string>
|
||||
|
Loading…
Reference in New Issue
Block a user