mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-06-08 00:39:54 +00:00
Improve: Ask for root only when clicked(Closes #82)
This commit is contained in:
parent
a6cd0f1ff4
commit
b10fd0725e
@ -185,9 +185,13 @@ class SettingsFragment : ScreenFragment() {
|
||||
preferences[Preferences.Key.ProxyHost]?.setEnabled(enabled)
|
||||
preferences[Preferences.Key.ProxyPort]?.setEnabled(enabled)
|
||||
}
|
||||
preferences[Preferences.Key.RootPermission]?.setEnabled(
|
||||
Shell.getCachedShell()?.isRoot ?: Shell.getShell().isRoot
|
||||
)
|
||||
if (key != null && !(Shell.getCachedShell()?.isRoot ?: Shell.getShell().isRoot)
|
||||
) {
|
||||
Preferences[Preferences.Key.RootPermission] = false
|
||||
preferences[Preferences.Key.RootPermission]?.setEnabled(false)
|
||||
} else if (Shell.getCachedShell()?.isRoot ?: Shell.getShell().isRoot) {
|
||||
preferences[Preferences.Key.RootPermission]?.setEnabled(true)
|
||||
}
|
||||
if (key == Preferences.Key.Theme) {
|
||||
requireActivity().recreate()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user