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()) } else Timber.plant(ReleaseTree())
applicationScope.launch(ioDispatcher) { applicationScope.launch(ioDispatcher) {
PinManager.initialize(this@WireGuardAutoTunnel) //TODO disable pin lock for now
//PinManager.initialize(this@WireGuardAutoTunnel)
if (!isRunningOnAndroidTv()) localLogCollector.start() if (!isRunningOnAndroidTv()) localLogCollector.start()
} }
} }

View File

@ -202,7 +202,9 @@ class MainActivity : AppCompatActivity() {
NavHost( NavHost(
navController, navController,
startDestination = 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 =
Modifier Modifier
.padding(padding) .padding(padding)

View File

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