mirror of
https://github.com/kvorschk/Magisk.git
synced 2026-12-04 19:10:47 -05:00
Refactor SettingsScreen and SettingsViewModel to adhere to modern Unidirectional Data Flow (UDF) patterns. Hoist all preference settings, environment visibility flags, and modal dialog states into an immutable SettingsUiState collected via collectAsStateWithLifecycle. Decompose SettingsScreen into a pure stateless SettingsContent composable with configuration-resilient, validated dialogs. Keep localized strings out of SettingsUiState and resolve them during composition, so they follow per-app locale changes even though the ViewModel outlives the recreated Activity. Refresh device security and environment flags whenever the screen resumes. Eliminate Activity memory leaks caused by passing ActivityExtension lambdas into retained ViewModels. Introduce rememberBiometricAuth scoped to Composable lifecycles using rememberLauncherForActivityResult with RequestAuthentication contract. Remove authenticate callback properties from SettingsViewModel, SuperuserViewModel, and SuperuserGrantViewModel, and invoke biometric authentication at call-time in the UI layer. Assisted-by: Gemini 4 Argon Assisted-by: Claude Opus 5.5