6.6.2 - Alpha3 - 升级 Gradle Compile 版本 34 -> 35

This commit is contained in:
SuperMonster003
2025-03-04 14:55:29 +08:00
parent 870049d250
commit 88446bab09
44 changed files with 194 additions and 173 deletions

View File

@@ -1057,18 +1057,20 @@ open class UiSelector : UiObjectActions, StringReadable {
2 -> types.find { it is Array<*> }?.let { type: Any ->
val t = type as Array<*>
when {
t[0] == cDouble && t[1] == cDouble -> tmp::class.java
.getMethod(key, cDouble, cDouble)
.invoke(tmp, *value.map { it.toString().toDouble() }.toTypedArray())
t[0] == cBoolean && t[1] == cDouble -> tmp::class.java
.getMethod(key, cBoolean, cDouble)
.invoke(tmp, *value.mapIndexed { index, any ->
when (index) {
0 -> any.toString().toBoolean()
1 -> any.toString().toDouble()
else -> throw Exception("UiSelector: $key($value)")
}
}.toTypedArray())
t[0] == cDouble && t[1] == cDouble -> {
val doubleArg0 = value[0].toString().toDouble()
val doubleArg1 = value[1].toString().toDouble()
tmp::class.java
.getMethod(key, cDouble, cDouble)
.invoke(tmp, doubleArg0, doubleArg1)
}
t[0] == cBoolean && t[1] == cDouble -> {
val booleanArg0 = value[0].toString().toBoolean()
val doubleArg1 = value[1].toString().toDouble()
tmp::class.java
.getMethod(key, cBoolean, cDouble)
.invoke(tmp, booleanArg0, doubleArg1)
}
else -> throw Exception("UiSelector: $key($value)")
}
} ?: throw Exception("UiSelector: $key($value)")

View File

@@ -33,7 +33,7 @@ open class QuickContactBadgeAttributes(scriptRuntime: ScriptRuntime, resourcePar
.put("groupMembership", CommonDataKinds.GroupMembership.CONTENT_ITEM_TYPE)
.put("groups", ContactsContract.Groups.CONTENT_ITEM_TYPE)
.put("identity", CommonDataKinds.Identity.CONTENT_ITEM_TYPE)
.put("im", CommonDataKinds.Im.CONTENT_ITEM_TYPE)
.put("im", @Suppress("DEPRECATION") CommonDataKinds.Im.CONTENT_ITEM_TYPE)
.put("nickname", CommonDataKinds.Nickname.CONTENT_ITEM_TYPE)
.put("note", CommonDataKinds.Note.CONTENT_ITEM_TYPE)
.put("organization", CommonDataKinds.Organization.CONTENT_ITEM_TYPE)
@@ -42,7 +42,7 @@ open class QuickContactBadgeAttributes(scriptRuntime: ScriptRuntime, resourcePar
.put("rawContacts", ContactsContract.RawContacts.CONTENT_ITEM_TYPE)
.put("relation", CommonDataKinds.Relation.CONTENT_ITEM_TYPE)
.put("settings", ContactsContract.Settings.CONTENT_ITEM_TYPE)
.put("sipAddress", CommonDataKinds.SipAddress.CONTENT_ITEM_TYPE)
.put("sipAddress", @Suppress("DEPRECATION") CommonDataKinds.SipAddress.CONTENT_ITEM_TYPE)
.put("statusUpdates", ContactsContract.StatusUpdates.CONTENT_ITEM_TYPE)
.put("structuredName", CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE)
.put("structuredPostal", CommonDataKinds.StructuredPostal.CONTENT_ITEM_TYPE)

View File

@@ -280,7 +280,7 @@ class AppUtils(context: Context, @get:ScriptInterface val fileProviderAuthority:
Build.VERSION.SDK_INT >= Build.VERSION_CODES.P -> packageInfo.longVersionCode
else -> @Suppress("DEPRECATION") packageInfo.versionCode.toLong()
}
val versionName = packageInfo.versionName
val versionName = packageInfo.versionName ?: "Unknown"
SimpleVersionInfo(versionName, versionCode)
}.getOrNull()

View File

@@ -133,7 +133,7 @@ class App(scriptRuntime: ScriptRuntime) : Augmentable(scriptRuntime) {
checkDualProperty(options) -> startDualActivity(scriptRuntime, args)
checkRootProperty(options) && RootUtils.isRootAvailable() -> {
val tmpIntent = configuredIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
Shell.execCommand(scriptRuntime, arrayOf("am start ${intentToShellRhino(tmpIntent)}", /* withRoot = */ true)).throwIfError()
Shell.execCommand(scriptRuntime, arrayOf<Any>("am start ${intentToShellRhino(tmpIntent)}", /* withRoot = */ true)).throwIfError()
}
checkShizukuProperty(options) && WrappedShizuku.isOperational() -> {
val tmpIntent = configuredIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
@@ -158,7 +158,7 @@ class App(scriptRuntime: ScriptRuntime) : Augmentable(scriptRuntime) {
checkDualProperty(opt) -> startDualActivity(scriptRuntime, args)
checkRootProperty(opt) && RootUtils.isRootAvailable() -> {
val tmpIntent = intentRhinoWithRuntime(scriptRuntime, opt).apply { addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) }
Shell.execCommand(scriptRuntime, arrayOf("am start ${intentToShellRhino(tmpIntent)}", /* withRoot = */ true)).throwIfError()
Shell.execCommand(scriptRuntime, arrayOf<Any>("am start ${intentToShellRhino(tmpIntent)}", /* withRoot = */ true)).throwIfError()
}
checkShizukuProperty(opt) && WrappedShizuku.isOperational() -> {
val tmpIntent = intentRhinoWithRuntime(scriptRuntime, opt).apply { addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) }
@@ -376,7 +376,7 @@ class App(scriptRuntime: ScriptRuntime) : Augmentable(scriptRuntime) {
when {
o is NativeObject && checkRootProperty(o) -> {
@Suppress("SpellCheckingInspection")
Shell.execCommand(scriptRuntime, arrayOf(/* cmd = */ "am startservice ${intentToShellRhino(o)}", /* withRoot = */ true))
Shell.execCommand(scriptRuntime, arrayOf<Any>(/* cmd = */ "am startservice ${intentToShellRhino(o)}", /* withRoot = */ true))
}
else -> globalContext.startService(intentRhinoWithRuntime(scriptRuntime, o))
}
@@ -435,7 +435,7 @@ class App(scriptRuntime: ScriptRuntime) : Augmentable(scriptRuntime) {
}
else -> when {
o is NativeObject && checkRootProperty(o) -> {
Shell.execCommand(scriptRuntime, arrayOf("am broadcast ${intentToShellRhino(o)}", /* withRoot = */ true))
Shell.execCommand(scriptRuntime, arrayOf<Any>("am broadcast ${intentToShellRhino(o)}", /* withRoot = */ true))
}
else -> globalContext.sendBroadcast(intentRhinoWithRuntime(scriptRuntime, o))
}
@@ -742,9 +742,9 @@ class App(scriptRuntime: ScriptRuntime) : Augmentable(scriptRuntime) {
val packageName = getPackageName(scriptRuntime, argList) ?: return@ensureArgumentsLength false
val command = "am force-stop $packageName"
when {
RootUtils.isRootAvailable() -> Shell.execCommand(scriptRuntime, arrayOf(command, /* withRoot = */ true))
RootUtils.isRootAvailable() -> Shell.execCommand(scriptRuntime, arrayOf<Any>(command, /* withRoot = */ true))
WrappedShizuku.isOperational() -> WrappedShizuku.execCommand(command)
else -> Shell.execCommand(scriptRuntime, arrayOf(command, /* withRoot = */ false))
else -> Shell.execCommand(scriptRuntime, arrayOf<Any>(command, /* withRoot = */ false))
}.code == 0
}
@@ -883,9 +883,9 @@ class App(scriptRuntime: ScriptRuntime) : Augmentable(scriptRuntime) {
if (currentUserIdentifier != processUserIdentifier) {
val niceCommand = "$command --user $currentUserIdentifier"
when {
withRoot && RootUtils.isRootAvailable() -> Shell.execCommand(scriptRuntime, arrayOf(niceCommand, /* withRoot = */ true))
withRoot && RootUtils.isRootAvailable() -> Shell.execCommand(scriptRuntime, arrayOf<Any>(niceCommand, /* withRoot = */ true))
withShizuku && WrappedShizuku.isOperational() -> WrappedShizuku.execCommand(niceCommand)
else -> Shell.execCommand(scriptRuntime, arrayOf(niceCommand, /* withRoot = */ false))
else -> Shell.execCommand(scriptRuntime, arrayOf<Any>(niceCommand, /* withRoot = */ false))
}.throwIfError()
}
}