feat: do not enforce package name regex check (#230)

Update Readme
Bump version number
This commit is contained in:
BinTianqi
2026-01-27 12:56:08 +08:00
parent 40a1841c8b
commit ac2a90dbca
4 changed files with 15 additions and 20 deletions

View File

@@ -57,7 +57,7 @@ java.lang.IllegalStateException: Not allowed to set the device owner because the
> [!NOTE] > [!NOTE]
> 一些系统有应用克隆、儿童空间等功能,它们通常是用户。 > 一些系统有应用克隆、儿童空间等功能,它们通常是用户。
#### Device owner 已存在 ### Device owner 已存在
```text ```text
java.lang.IllegalStateException: Trying to set the device owner (com.bintianqi.owndroid/.Receiver), but device owner (xxx) is already set. 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) [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. > 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.
> >

View File

@@ -57,7 +57,7 @@ Solutions:
> [!NOTE] > [!NOTE]
> Some systems have features such as app cloning and children space, which are usually users. > 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 ```text
java.lang.IllegalStateException: Trying to set the device owner (com.bintianqi.owndroid/.Receiver), but device owner (xxx) is already set. 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) [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. > 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.
> >

View File

@@ -26,8 +26,8 @@ android {
applicationId = "com.bintianqi.owndroid" applicationId = "com.bintianqi.owndroid"
minSdk = 23 minSdk = 23
targetSdk = 36 targetSdk = 36
versionCode = 41 versionCode = 42
versionName = "7.2" versionName = "7.3"
multiDexEnabled = false multiDexEnabled = false
} }

View File

@@ -180,6 +180,7 @@ fun PackageNameTextField(
Icon(Icons.AutoMirrored.Default.List, null) Icon(Icons.AutoMirrored.Default.List, null)
} }
}, },
isError = value.isNotEmpty() && !value.isValidPackageName,
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Ascii, imeAction = ImeAction.Done), keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Ascii, imeAction = ImeAction.Done),
keyboardActions = KeyboardActions { fm.clearFocus() } keyboardActions = KeyboardActions { fm.clearFocus() }
) )
@@ -384,7 +385,7 @@ fun PermissionsManagerScreen(
verticalAlignment = Alignment.CenterVertically, verticalAlignment = Alignment.CenterVertically,
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.clickable(packageName.isValidPackageName) { .clickable {
selectedPermission = index selectedPermission = index
} }
.padding(8.dp) .padding(8.dp)
@@ -467,8 +468,7 @@ fun ClearAppStorageScreen(
Modifier.padding(vertical = 8.dp)) { packageName = it } Modifier.padding(vertical = 8.dp)) { packageName = it }
Button( Button(
{ dialog = true }, { dialog = true },
Modifier.fillMaxWidth(), Modifier.fillMaxWidth()
packageName.isValidPackageName
) { ) {
Text(stringResource(R.string.clear)) Text(stringResource(R.string.clear))
} }
@@ -532,8 +532,7 @@ fun UninstallAppScreen(
Modifier.padding(vertical = 8.dp)) { packageName = it } Modifier.padding(vertical = 8.dp)) { packageName = it }
Button( Button(
{ dialog = true }, { dialog = true },
Modifier.fillMaxWidth(), Modifier.fillMaxWidth()
packageName.isValidPackageName
) { ) {
Text(stringResource(R.string.uninstall)) Text(stringResource(R.string.uninstall))
} }
@@ -607,8 +606,7 @@ fun InstallExistingAppScreen(
{ {
context.showOperationResultToast(onInstall(packageName)) context.showOperationResultToast(onInstall(packageName))
}, },
Modifier.fillMaxWidth(), Modifier.fillMaxWidth()
packageName.isValidPackageName
) { ) {
Text(stringResource(R.string.install)) Text(stringResource(R.string.install))
} }
@@ -663,8 +661,7 @@ fun CredentialManagerPolicyScreen(
setCmPackage(inputPackages, true) setCmPackage(inputPackages, true)
input = "" input = ""
}, },
Modifier.fillMaxWidth(), Modifier.fillMaxWidth()
inputPackages.all { it.isValidPackageName }
) { ) {
Text(stringResource(R.string.add)) Text(stringResource(R.string.add))
} }
@@ -721,8 +718,7 @@ fun PermittedAsAndImPackages(
}, },
Modifier Modifier
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = HorizontalPadding), .padding(horizontal = HorizontalPadding)
inputPackages.all { it.isValidPackageName }
) { ) {
Text(stringResource(R.string.add)) Text(stringResource(R.string.add))
} }
@@ -894,7 +890,6 @@ fun PackageFunctionScreen(
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = HorizontalPadding) .padding(horizontal = HorizontalPadding)
.padding(bottom = 10.dp), .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)) Text(stringResource(R.string.add))
@@ -1096,7 +1091,7 @@ fun EditAppGroupScreen(
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = HorizontalPadding) .padding(horizontal = HorizontalPadding)
.padding(bottom = 10.dp), .padding(bottom = 10.dp),
inputPackages.all { it.isValidPackageName && it !in list } inputPackages.all { it !in list }
) { ) {
Text(stringResource(R.string.add)) Text(stringResource(R.string.add))
} }