From 9ff670231db0b2f84f45e7d87a60199a2af6b4ec Mon Sep 17 00:00:00 2001 From: BinTianqi Date: Mon, 10 Jun 2024 10:41:41 +0000 Subject: [PATCH] update some strings --- .../com/bintianqi/owndroid/dpm/Network.kt | 20 +++++----- .../com/bintianqi/owndroid/dpm/Password.kt | 34 +++++++++-------- .../com/bintianqi/owndroid/dpm/Permissions.kt | 10 ++--- app/src/main/res/values-zh-rCN/strings.xml | 38 +++++++++---------- app/src/main/res/values/strings.xml | 32 ++++++++-------- 5 files changed, 68 insertions(+), 66 deletions(-) diff --git a/app/src/main/java/com/bintianqi/owndroid/dpm/Network.kt b/app/src/main/java/com/bintianqi/owndroid/dpm/Network.kt index 3edf72b..c57e577 100644 --- a/app/src/main/java/com/bintianqi/owndroid/dpm/Network.kt +++ b/app/src/main/java/com/bintianqi/owndroid/dpm/Network.kt @@ -128,8 +128,8 @@ fun Network(navCtrl: NavHostController) { composable(route = "MinWifiSecurityLevel") { WifiSecLevel() } composable(route = "WifiSsidPolicy") { WifiSsidPolicy() } composable(route = "PrivateDNS") { PrivateDNS() } - composable(route = "NetLog") { NetLog() } - composable(route = "WifiKeypair") { WifiKeypair() } + composable(route = "NetworkLog") { NetworkLog() } + composable(route = "WifiAuthKeypair") { WifiAuthKeypair() } composable(route = "APN") { APN() } } } @@ -174,10 +174,10 @@ private fun Home(navCtrl:NavHostController, scrollState: ScrollState, wifiMacDia SubPageItem(R.string.private_dns, "", R.drawable.dns_fill0) { navCtrl.navigate("PrivateDNS") } } if(VERSION.SDK_INT >= 26&&(isDeviceOwner(dpm) || (isProfileOwner(dpm) && dpm.isManagedProfile(receiver)))) { - SubPageItem(R.string.retrieve_net_logs, "", R.drawable.description_fill0) { navCtrl.navigate("NetLog") } + SubPageItem(R.string.retrieve_net_logs, "", R.drawable.description_fill0) { navCtrl.navigate("NetworkLog") } } if(VERSION.SDK_INT >= 31 && (isDeviceOwner(dpm) || isProfileOwner(dpm))) { - SubPageItem(R.string.wifi_keypair, "", R.drawable.key_fill0) { navCtrl.navigate("WifiKeypair") } + SubPageItem(R.string.wifi_auth_keypair, "", R.drawable.key_fill0) { navCtrl.navigate("WifiAuthKeypair") } } if(VERSION.SDK_INT >= 28 && isDeviceOwner(dpm)) { SubPageItem(R.string.apn_settings, "", R.drawable.cell_tower_fill0) { navCtrl.navigate("APN") } @@ -200,7 +200,7 @@ private fun Switches() { ) } if(VERSION.SDK_INT>=30 && (isDeviceOwner(dpm) || dpm.isOrgProfile(receiver))) { - SwitchItem(R.string.wifi_lockdown, "", R.drawable.wifi_password_fill0, + SwitchItem(R.string.lockdown_admin_configured_network, "", R.drawable.wifi_password_fill0, { dpm.hasLockdownAdminConfiguredNetworks(receiver) }, { dpm.setConfiguredNetworksLockdownState(receiver,it) } ) } @@ -431,7 +431,7 @@ private fun PrivateDNS() { @SuppressLint("NewApi") @Composable -private fun NetLog() { +private fun NetworkLog() { val context = LocalContext.current val dpm = context.getSystemService(ComponentActivity.DEVICE_POLICY_SERVICE) as DevicePolicyManager val receiver = ComponentName(context,Receiver::class.java) @@ -447,10 +447,10 @@ private fun NetLog() { onClick = { val log = dpm.retrieveNetworkLogs(receiver,1234567890) if(log != null) { - for(i in log) { Log.d("NetLog",i.toString()) } + for(i in log) { Log.d("NetworkLog",i.toString()) } Toast.makeText(context, R.string.success, Toast.LENGTH_SHORT).show() }else{ - Log.d("NetLog",context.getString(R.string.none)) + Log.d("NetworkLog",context.getString(R.string.none)) Toast.makeText(context, R.string.none, Toast.LENGTH_SHORT).show() } }, @@ -463,14 +463,14 @@ private fun NetLog() { @SuppressLint("NewApi") @Composable -private fun WifiKeypair() { +private fun WifiAuthKeypair() { val context = LocalContext.current val dpm = context.getSystemService(ComponentActivity.DEVICE_POLICY_SERVICE) as DevicePolicyManager val focusMgr = LocalFocusManager.current Column(modifier = Modifier.fillMaxSize().padding(horizontal = 8.dp).verticalScroll(rememberScrollState())) { var keyPair by remember { mutableStateOf("") } Spacer(Modifier.padding(vertical = 10.dp)) - Text(text = stringResource(R.string.wifi_keypair), style = typography.headlineLarge) + Text(text = stringResource(R.string.wifi_auth_keypair), style = typography.headlineLarge) Spacer(Modifier.padding(vertical = 5.dp)) OutlinedTextField( value = keyPair, diff --git a/app/src/main/java/com/bintianqi/owndroid/dpm/Password.kt b/app/src/main/java/com/bintianqi/owndroid/dpm/Password.kt index 7e29191..fcc2dfd 100644 --- a/app/src/main/java/com/bintianqi/owndroid/dpm/Password.kt +++ b/app/src/main/java/com/bintianqi/owndroid/dpm/Password.kt @@ -67,7 +67,7 @@ fun Password(navCtrl: NavHostController) { composable(route = "ResetPasswordToken") { ResetPasswordToken() } composable(route = "ResetPassword") { ResetPassword() } composable(route = "RequirePasswordComplexity") { PasswordComplexity() } - composable(route = "KeyguardDisabledFeatures") { KeyguardDisabledFeatures() } + composable(route = "DisableKeyguardFeatures") { DisableKeyguardFeatures() } composable(route = "MaxTimeToLock") { ScreenTimeout() } composable(route = "PasswordTimeout") { PasswordExpiration() } composable(route = "MaxPasswordFail") { MaxFailedPasswordForWipe() } @@ -99,13 +99,15 @@ private fun Home(navCtrl:NavHostController,scrollState: ScrollState) { if(VERSION.SDK_INT >= 31 && (isDeviceOwner(dpm) || isProfileOwner(dpm))) { SubPageItem(R.string.required_password_complexity, "", R.drawable.password_fill0) { navCtrl.navigate("RequirePasswordComplexity") } } - if(isDeviceOwner(dpm)) { - SubPageItem(R.string.keyguard_disabled_features, "", R.drawable.screen_lock_portrait_fill0) { navCtrl.navigate("KeyguardDisabledFeatures") } + if(dpm.isAdminActive(receiver)) { + SubPageItem(R.string.disable_keyguard_features, "", R.drawable.screen_lock_portrait_fill0) { navCtrl.navigate("DisableKeyguardFeatures") } } if(isDeviceOwner(dpm)) { SubPageItem(R.string.max_time_to_lock, "", R.drawable.schedule_fill0) { navCtrl.navigate("MaxTimeToLock") } SubPageItem(R.string.pwd_timeout, "", R.drawable.lock_clock_fill0) { navCtrl.navigate("PasswordTimeout") } SubPageItem(R.string.max_pwd_fail, "", R.drawable.no_encryption_fill0) { navCtrl.navigate("MaxPasswordFail") } + } + if(dpm.isAdminActive(receiver)){ SubPageItem(R.string.pwd_history, "", R.drawable.history_fill0) { navCtrl.navigate("PasswordHistoryLength") } } if(VERSION.SDK_INT >= 26 && (isDeviceOwner(dpm) || isProfileOwner(dpm))) { @@ -519,7 +521,7 @@ private fun PasswordHistoryLength() { } @Composable -private fun KeyguardDisabledFeatures() { +private fun DisableKeyguardFeatures() { val context = LocalContext.current val dpm = context.getSystemService(ComponentActivity.DEVICE_POLICY_SERVICE) as DevicePolicyManager val receiver = ComponentName(context,Receiver::class.java) @@ -562,26 +564,26 @@ private fun KeyguardDisabledFeatures() { } Column(modifier = Modifier.fillMaxSize().padding(horizontal = 8.dp).verticalScroll(rememberScrollState())) { Spacer(Modifier.padding(vertical = 10.dp)) - Text(text = stringResource(R.string.keyguard_disabled_features), style = typography.headlineLarge) + Text(text = stringResource(R.string.disable_keyguard_features), style = typography.headlineLarge) Spacer(Modifier.padding(vertical = 5.dp)) RadioButtonItem(stringResource(R.string.enable_all), state == 0, { state = 0 }) RadioButtonItem(stringResource(R.string.disable_all), state == 1, { state = 1 }) RadioButtonItem(stringResource(R.string.custom), state == 2 , { state = 2 }) AnimatedVisibility(state==2) { Column { - CheckBoxItem(stringResource(R.string.keyguard_disabled_features_widgets), widgets, { widgets = it }) - CheckBoxItem(stringResource(R.string.keyguard_disabled_features_camera), camera, { camera = it }) - CheckBoxItem(stringResource(R.string.keyguard_disabled_features_notification), notification, { notification = it }) - CheckBoxItem(stringResource(R.string.keyguard_disabled_features_unredacted_notification), unredacted, { unredacted = it }) - CheckBoxItem(stringResource(R.string.keyguard_disabled_features_trust_agents), agents, { agents = it }) - CheckBoxItem(stringResource(R.string.keyguard_disabled_features_fingerprint), fingerprint, { fingerprint = it }) - if(VERSION.SDK_INT >= 24) { CheckBoxItem(stringResource(R.string.keyguard_disabled_features_remote_input), remote , { remote = it }) } + CheckBoxItem(stringResource(R.string.disable_keyguard_features_widgets), widgets, { widgets = it }) + CheckBoxItem(stringResource(R.string.disable_keyguard_features_camera), camera, { camera = it }) + CheckBoxItem(stringResource(R.string.disable_keyguard_features_notification), notification, { notification = it }) + CheckBoxItem(stringResource(R.string.disable_keyguard_features_unredacted_notification), unredacted, { unredacted = it }) + CheckBoxItem(stringResource(R.string.disable_keyguard_features_trust_agents), agents, { agents = it }) + CheckBoxItem(stringResource(R.string.disable_keyguard_features_fingerprint), fingerprint, { fingerprint = it }) + if(VERSION.SDK_INT >= 24) { CheckBoxItem(stringResource(R.string.disable_keyguard_features_remote_input), remote , { remote = it }) } if(VERSION.SDK_INT >= 28) { - CheckBoxItem(stringResource(R.string.keyguard_disabled_features_face), face, { face = it }) - CheckBoxItem(stringResource(R.string.keyguard_disabled_features_iris), iris, { iris = it }) - CheckBoxItem(stringResource(R.string.keyguard_disabled_features_biometrics), biometrics, { biometrics = it }) + CheckBoxItem(stringResource(R.string.disable_keyguard_features_face), face, { face = it }) + CheckBoxItem(stringResource(R.string.disable_keyguard_features_iris), iris, { iris = it }) + CheckBoxItem(stringResource(R.string.disable_keyguard_features_biometrics), biometrics, { biometrics = it }) } - if(VERSION.SDK_INT >= 34) { CheckBoxItem(stringResource(R.string.keyguard_disabled_features_shortcuts), shortcuts, { shortcuts = it }) } + if(VERSION.SDK_INT >= 34) { CheckBoxItem(stringResource(R.string.disable_keyguard_features_shortcuts), shortcuts, { shortcuts = it }) } } } Spacer(Modifier.padding(vertical = 5.dp)) diff --git a/app/src/main/java/com/bintianqi/owndroid/dpm/Permissions.kt b/app/src/main/java/com/bintianqi/owndroid/dpm/Permissions.kt index c223453..f59037a 100644 --- a/app/src/main/java/com/bintianqi/owndroid/dpm/Permissions.kt +++ b/app/src/main/java/com/bintianqi/owndroid/dpm/Permissions.kt @@ -72,7 +72,7 @@ fun DpmPermissions(navCtrl:NavHostController) { composable(route = "DeviceInfo") { DeviceInfo() } composable(route = "SpecificID") { SpecificID() } composable(route = "OrgName") { OrgName() } - composable(route = "NoManagementAccount") { NoManageAccount() } + composable(route = "DisableAccountManagement") { DisableAccountManagement() } composable(route = "LockScreenInfo") { LockScreenInfo() } composable(route = "SupportMsg") { SupportMsg() } composable(route = "TransformOwnership") { TransformOwnership() } @@ -116,7 +116,7 @@ private fun Home(localNavCtrl:NavHostController,listScrollState:ScrollState) { SubPageItem(R.string.org_name, "", R.drawable.corporate_fare_fill0) { localNavCtrl.navigate("OrgName") } } if(isDeviceOwner(dpm) || isProfileOwner(dpm)) { - SubPageItem(R.string.account_types_management_disabled, "", R.drawable.account_circle_fill0) { localNavCtrl.navigate("NoManagementAccount") } + SubPageItem(R.string.disable_account_management, "", R.drawable.account_circle_fill0) { localNavCtrl.navigate("NoManagementAccount") } } if(VERSION.SDK_INT >= 24&&isDeviceOwner(dpm)) { SubPageItem(R.string.device_owner_lock_screen_info, "", R.drawable.screen_lock_portrait_fill0) { localNavCtrl.navigate("LockScreenInfo") } @@ -449,14 +449,14 @@ private fun SupportMsg() { } @Composable -private fun NoManageAccount() { +private fun DisableAccountManagement() { val context = LocalContext.current val dpm = context.getSystemService(ComponentActivity.DEVICE_POLICY_SERVICE) as DevicePolicyManager val receiver = ComponentName(context,Receiver::class.java) val focusMgr = LocalFocusManager.current Column(modifier = Modifier.fillMaxSize().verticalScroll(rememberScrollState()).padding(horizontal = 8.dp)) { Spacer(Modifier.padding(vertical = 10.dp)) - Text(text = stringResource(R.string.account_types_management_disabled), style = typography.headlineLarge) + Text(text = stringResource(R.string.disable_account_management), style = typography.headlineLarge) Text(stringResource(R.string.unknown_effect)) var accountList by remember{ mutableStateOf("") } val refreshList = { @@ -475,7 +475,7 @@ private fun NoManageAccount() { OutlinedTextField( value = inputText, onValueChange = { inputText = it }, - label = { Text(stringResource(R.string.account_types)) }, + label = { Text(stringResource(R.string.account_types_is)) }, modifier = Modifier.fillMaxWidth().padding(vertical = 4.dp), keyboardOptions = KeyboardOptions(imeAction = ImeAction.Done), keyboardActions = KeyboardActions(onDone = { focusMgr.clearFocus() }) diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index fbfad0c..697cb55 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -73,8 +73,8 @@ 设备唯一标识码 需要设置组织ID 组织名称 - 不受管理的账号 - 账号类型 + 不受管理的账号 + 账号类型 转移所有权 把Device owner或Profile owner权限转移到另一个应用 (目标必须是Device admin) 目标包名 @@ -141,9 +141,9 @@ 自动拒绝 MTE策略 MTE:内存标记拓展,安卓14和ARMv9的高端功能 - 附近App共享 - 附近共享策略 - 附近通知共享 + 附近应用传输 + 附近流式传输策略 + 附近通知传输 在足够安全时启用 锁定任务功能 禁用全部 @@ -204,7 +204,7 @@ 最小WiFi安全等级 开放 优先网络服务 - WiFi锁定 + 锁定由管理员配置的网络 WiFi SSID策略 SSID列表: 不能为空 @@ -220,7 +220,7 @@ 设置DNS主机 收集网络日志 收集 - WiFi密钥对 + WiFi密钥对 密钥对 APN设置 一共有%1$s个APN设置 @@ -484,19 +484,19 @@ 重置密码(弃用) 密码复杂度要求 要求设置新密码 - 锁屏功能 + 锁屏功能 启用全部 - 禁用小工具(安卓5以下) - 禁用相机 - 禁用通知 - 禁用未经编辑的通知 - 禁用可信代理 - 禁用指纹解锁 - 禁止远程输入(弃用) - 禁用人脸解锁 - 禁用虹膜解锁(?) - 禁用生物识别 - 禁用快捷方式 + 禁用小工具(安卓5以下) + 禁用相机 + 禁用通知 + 禁用未经编辑的通知 + 禁用可信代理 + 禁用指纹解锁 + 禁止远程输入(弃用) + 禁用人脸解锁 + 禁用虹膜解锁(?) + 禁用生物识别 + 禁用快捷方式 未指定 需要密码或图案,不管复杂度 至少1个字母 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 46b9f71..dff6f9c 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -80,8 +80,8 @@ Enrollment specific ID Require organization ID Organization name - Account types with management disabled - Account types: + Account types with management disabled + Account types: Transform Ownership Transform device owner or profile owner privilege to another app. The target app must be a device admin. Target package name @@ -215,7 +215,7 @@ Min WiFi security level Open Preferential network service - WiFi lockdown + Lockdown admin configured network WiFi SSID policy SSID list: Cannot be empty @@ -231,7 +231,7 @@ Set DNS host Network logs Retrieve - WiFi keypair + WiFi keypair Keypair APN settings APN settings amount: %1$s @@ -500,19 +500,19 @@ Reset password Required password complexity Request to set a new password - Keyguard features + Keyguard features Enable all - Disable widget - Disable camera - Disable notification - Disable unredacted notification - Disable trust agents - Disable fingerprint - Disable remote input - Disable face - Disable iris - Disable biometrics - Disable shortcuts + Disable widget + Disable camera + Disable notification + Disable unredacted notification + Disable trust agents + Disable fingerprint + Disable remote input + Disable face + Disable iris + Disable biometrics + Disable shortcuts Unspecified Password required (No limitation for complexity) Alphabetic