From ac2a90dbca6ee3718f768c95c91ac976ae5a646c Mon Sep 17 00:00:00 2001 From: BinTianqi Date: Tue, 27 Jan 2026 12:56:08 +0800 Subject: [PATCH] feat: do not enforce package name regex check (#230) Update Readme Bump version number --- Readme-zh_CN.md | 4 ++-- Readme.md | 4 ++-- app/build.gradle.kts | 4 ++-- .../bintianqi/owndroid/dpm/Applications.kt | 23 ++++++++----------- 4 files changed, 15 insertions(+), 20 deletions(-) diff --git a/Readme-zh_CN.md b/Readme-zh_CN.md index 01e7af0..349d306 100644 --- a/Readme-zh_CN.md +++ b/Readme-zh_CN.md @@ -57,7 +57,7 @@ java.lang.IllegalStateException: Not allowed to set the device owner because the > [!NOTE] > 一些系统有应用克隆、儿童空间等功能,它们通常是用户。 -#### Device owner 已存在 +### Device owner 已存在 ```text java.lang.IllegalStateException: Trying to set the device owner (com.bintianqi.owndroid/.Receiver), but device owner (xxx) is already set. @@ -142,7 +142,7 @@ context.sendBroadcast(intent) [License.md](LICENSE.md) -> Copyright (C) 2024 BinTianqi +> Copyright (C) 2026 BinTianqi > > 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 the Free Software Foundation, either version 3 of the License, or (at your option) any later version. > diff --git a/Readme.md b/Readme.md index 2a2b9a0..a462f4d 100644 --- a/Readme.md +++ b/Readme.md @@ -57,7 +57,7 @@ Solutions: > [!NOTE] > Some systems have features such as app cloning and children space, which are usually users. -#### Device owner is already set +### Device owner is already set ```text java.lang.IllegalStateException: Trying to set the device owner (com.bintianqi.owndroid/.Receiver), but device owner (xxx) is already set. @@ -144,7 +144,7 @@ You can use Gradle in command line to build OwnDroid. [License.md](LICENSE.md) -> Copyright (C) 2024 BinTianqi +> Copyright (C) 2026 BinTianqi > > 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 the Free Software Foundation, either version 3 of the License, or (at your option) any later version. > diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 9ee1a2c..fa9225d 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -26,8 +26,8 @@ android { applicationId = "com.bintianqi.owndroid" minSdk = 23 targetSdk = 36 - versionCode = 41 - versionName = "7.2" + versionCode = 42 + versionName = "7.3" multiDexEnabled = false } diff --git a/app/src/main/java/com/bintianqi/owndroid/dpm/Applications.kt b/app/src/main/java/com/bintianqi/owndroid/dpm/Applications.kt index 6d678e4..1f501dd 100644 --- a/app/src/main/java/com/bintianqi/owndroid/dpm/Applications.kt +++ b/app/src/main/java/com/bintianqi/owndroid/dpm/Applications.kt @@ -180,6 +180,7 @@ fun PackageNameTextField( Icon(Icons.AutoMirrored.Default.List, null) } }, + isError = value.isNotEmpty() && !value.isValidPackageName, keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Ascii, imeAction = ImeAction.Done), keyboardActions = KeyboardActions { fm.clearFocus() } ) @@ -384,7 +385,7 @@ fun PermissionsManagerScreen( verticalAlignment = Alignment.CenterVertically, modifier = Modifier .fillMaxWidth() - .clickable(packageName.isValidPackageName) { + .clickable { selectedPermission = index } .padding(8.dp) @@ -467,8 +468,7 @@ fun ClearAppStorageScreen( Modifier.padding(vertical = 8.dp)) { packageName = it } Button( { dialog = true }, - Modifier.fillMaxWidth(), - packageName.isValidPackageName + Modifier.fillMaxWidth() ) { Text(stringResource(R.string.clear)) } @@ -532,8 +532,7 @@ fun UninstallAppScreen( Modifier.padding(vertical = 8.dp)) { packageName = it } Button( { dialog = true }, - Modifier.fillMaxWidth(), - packageName.isValidPackageName + Modifier.fillMaxWidth() ) { Text(stringResource(R.string.uninstall)) } @@ -607,8 +606,7 @@ fun InstallExistingAppScreen( { context.showOperationResultToast(onInstall(packageName)) }, - Modifier.fillMaxWidth(), - packageName.isValidPackageName + Modifier.fillMaxWidth() ) { Text(stringResource(R.string.install)) } @@ -663,8 +661,7 @@ fun CredentialManagerPolicyScreen( setCmPackage(inputPackages, true) input = "" }, - Modifier.fillMaxWidth(), - inputPackages.all { it.isValidPackageName } + Modifier.fillMaxWidth() ) { Text(stringResource(R.string.add)) } @@ -721,8 +718,7 @@ fun PermittedAsAndImPackages( }, Modifier .fillMaxWidth() - .padding(horizontal = HorizontalPadding), - inputPackages.all { it.isValidPackageName } + .padding(horizontal = HorizontalPadding) ) { Text(stringResource(R.string.add)) } @@ -894,8 +890,7 @@ fun PackageFunctionScreen( .fillMaxWidth() .padding(horizontal = HorizontalPadding) .padding(bottom = 10.dp), - inputPackages.all { it.isValidPackageName } && - packages.none { it.name in inputPackages } + packages.none { it.name in inputPackages } ) { Text(stringResource(R.string.add)) } @@ -1096,7 +1091,7 @@ fun EditAppGroupScreen( .fillMaxWidth() .padding(horizontal = HorizontalPadding) .padding(bottom = 10.dp), - inputPackages.all { it.isValidPackageName && it !in list } + inputPackages.all { it !in list } ) { Text(stringResource(R.string.add)) }