fix: disable pin lock

This commit is contained in:
Zane Schepke 2024-06-01 05:51:28 -04:00
parent 571fb1b12c
commit 8bbe81d294
3 changed files with 21 additions and 17 deletions

View File

@ -49,7 +49,8 @@ class WireGuardAutoTunnel : Application() {
)
} else Timber.plant(ReleaseTree())
applicationScope.launch(ioDispatcher) {
PinManager.initialize(this@WireGuardAutoTunnel)
//TODO disable pin lock for now
//PinManager.initialize(this@WireGuardAutoTunnel)
if (!isRunningOnAndroidTv()) localLogCollector.start()
}
}

View File

@ -202,7 +202,9 @@ class MainActivity : AppCompatActivity() {
NavHost(
navController,
startDestination =
(if (PinManager.pinExists()) Screen.Lock.route else Screen.Main.route),
//TODO disable pin lock
//(if (PinManager.pinExists()) Screen.Lock.route else Screen.Main.route),
Screen.Main.route,
modifier =
Modifier
.padding(padding)

View File

@ -103,7 +103,7 @@ fun SettingsScreen(
val scope = rememberCoroutineScope()
val scrollState = rememberScrollState()
val interactionSource = remember { MutableInteractionSource() }
val pinExists = remember { mutableStateOf(PinManager.pinExists()) }
//val pinExists = remember { mutableStateOf(PinManager.pinExists()) }
val uiState by viewModel.uiState.collectAsStateWithLifecycle()
val kernelSupport by viewModel.kernelSupport.collectAsStateWithLifecycle()
@ -652,20 +652,21 @@ fun SettingsScreen(
onCheckChanged = { viewModel.onToggleShortcutsEnabled() },
)
}
ConfigurationToggle(
stringResource(R.string.enable_app_lock),
enabled = true,
checked = pinExists.value,
padding = screenPadding,
onCheckChanged = {
if (pinExists.value) {
PinManager.clearPin()
pinExists.value = PinManager.pinExists()
} else {
navController.navigate(Screen.Lock.route)
}
},
)
// TODO disable for now
// ConfigurationToggle(
// stringResource(R.string.enable_app_lock),
// enabled = true,
// checked = pinExists.value,
// padding = screenPadding,
// onCheckChanged = {
// if (pinExists.value) {
// PinManager.clearPin()
// pinExists.value = PinManager.pinExists()
// } else {
// navController.navigate(Screen.Lock.route)
// }
// },
// )
if (!WireGuardAutoTunnel.isRunningOnAndroidTv()) {
Row(
verticalAlignment = Alignment.CenterVertically,