mirror of
https://codeberg.org/timelimit/timelimit-android.git
synced 2025-10-03 09:49:25 +02:00
Block parent key mode setup if timelimit is device owner
This commit is contained in:
parent
e2ad0333ae
commit
734c43e482
3 changed files with 9 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* TimeLimit Copyright <C> 2019 - 2023 Jonas Lochmann
|
* TimeLimit Copyright <C> 2019 - 2024 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -22,6 +22,7 @@ import io.timelimit.android.coroutines.executeAndWait
|
||||||
import io.timelimit.android.crypto.Curve25519
|
import io.timelimit.android.crypto.Curve25519
|
||||||
import io.timelimit.android.data.Database
|
import io.timelimit.android.data.Database
|
||||||
import io.timelimit.android.integration.platform.PlatformIntegration
|
import io.timelimit.android.integration.platform.PlatformIntegration
|
||||||
|
import io.timelimit.android.integration.platform.ProtectionLevel
|
||||||
import io.timelimit.android.logic.AppLogic
|
import io.timelimit.android.logic.AppLogic
|
||||||
import io.timelimit.android.ui.manage.device.manage.permission.PermissionScreenContent
|
import io.timelimit.android.ui.manage.device.manage.permission.PermissionScreenContent
|
||||||
import io.timelimit.android.ui.model.ActivityCommand
|
import io.timelimit.android.ui.model.ActivityCommand
|
||||||
|
@ -89,7 +90,11 @@ object SetupLocalModePermissions {
|
||||||
confirm = { launch {
|
confirm = { launch {
|
||||||
updateState { it.copy(currentDialog = null) }
|
updateState { it.copy(currentDialog = null) }
|
||||||
|
|
||||||
|
if (logic.platformIntegration.getCurrentProtectionLevel() == ProtectionLevel.DeviceOwner) {
|
||||||
|
snackbarHostState.showSnackbar(logic.context.getString(R.string.setup_select_mode_parent_key_error_owner))
|
||||||
|
} else {
|
||||||
setupParentKeyMode(logic.database)
|
setupParentKeyMode(logic.database)
|
||||||
|
}
|
||||||
} },
|
} },
|
||||||
cancel = { updateState { it.copy(currentDialog = null) } }
|
cancel = { updateState { it.copy(currentDialog = null) } }
|
||||||
) else null,
|
) else null,
|
||||||
|
|
|
@ -1557,6 +1557,7 @@
|
||||||
TimeLimit schränkt dieses Gerät nicht ein. Es wird als zusätzlicher Schlüssel bei einem anderen Gerät im lokalen Mdous verwendet,
|
TimeLimit schränkt dieses Gerät nicht ein. Es wird als zusätzlicher Schlüssel bei einem anderen Gerät im lokalen Mdous verwendet,
|
||||||
um dort die Einstellungen von TimeLimit zu entsperren. Am anderen Gerät kann auch jederzeit ein Passwort verwendet werden.
|
um dort die Einstellungen von TimeLimit zu entsperren. Am anderen Gerät kann auch jederzeit ein Passwort verwendet werden.
|
||||||
</string>
|
</string>
|
||||||
|
<string name="setup_select_mode_parent_key_error_owner">TimeLimit ist Gerätebesitzer und kann nicht als Schlüssel eingerichtet werden.</string>
|
||||||
|
|
||||||
<string name="setup_select_mode_uninstall_title">TimeLimit entfernen</string>
|
<string name="setup_select_mode_uninstall_title">TimeLimit entfernen</string>
|
||||||
<string name="setup_select_mode_uninstall_text">
|
<string name="setup_select_mode_uninstall_text">
|
||||||
|
|
|
@ -1597,6 +1597,7 @@
|
||||||
unlock the settings of TimeLimit at an other device which uses the local mode (there is always
|
unlock the settings of TimeLimit at an other device which uses the local mode (there is always
|
||||||
a password to unlock the settings).
|
a password to unlock the settings).
|
||||||
</string>
|
</string>
|
||||||
|
<string name="setup_select_mode_parent_key_error_owner">TimeLimit is device owner and can not be configured as a key.</string>
|
||||||
|
|
||||||
<string name="setup_select_mode_uninstall_title">uninstall TimeLimit</string>
|
<string name="setup_select_mode_uninstall_title">uninstall TimeLimit</string>
|
||||||
<string name="setup_select_mode_uninstall_text">
|
<string name="setup_select_mode_uninstall_text">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue