6.6.1 - Alpha2 - 更新构建脚本版本信息及 Android Studio 版本信息

This commit is contained in:
SuperMonster003
2024-12-13 16:48:08 +08:00
parent 111592b25c
commit 7c62902429
11 changed files with 54 additions and 20 deletions

View File

@@ -632,7 +632,7 @@ open class ConsoleImpl(val uiHandler: UiHandler) : AbstractConsole() {
fun getContentTextSize() = getFloatingConsoleView()?.textSize ?: 0f
@ScriptInterface
fun setContentTextColors(colors: Array<out Int?>) = runWithWindow({ configurator.setContentTextColors(colors) }) {
fun setContentTextColors(colors: Array<out Int>) = runWithWindow({ configurator.setContentTextColors(colors) }) {
getFloatingConsoleView()?.setTextColors(colors)
}
@@ -859,7 +859,7 @@ open class ConsoleImpl(val uiHandler: UiHandler) : AbstractConsole() {
private set
@Volatile
var contentTextColors: Array<out Int?>? = null
var contentTextColors: Array<out Int>? = null
private set
@Volatile
@@ -923,7 +923,7 @@ open class ConsoleImpl(val uiHandler: UiHandler) : AbstractConsole() {
contentTextSize = size
}
fun setContentTextColors(colors: Array<out Int?>) = also {
fun setContentTextColors(colors: Array<out Int>) = also {
contentTextColors = colors
}

View File

@@ -38,6 +38,13 @@ class ScriptExecuteActivity : AppCompatActivity() {
private lateinit var mScriptExecution: ActivityScriptExecution
private var mRuntime: ScriptRuntime? = null
@ScriptInterface
val emitter: EventEmitter?
get() = when {
::eventEmitter.isInitialized -> eventEmitter
else -> null
}
@ScriptInterface
lateinit var eventEmitter: EventEmitter
private set
@@ -199,7 +206,9 @@ class ScriptExecuteActivity : AppCompatActivity() {
}
fun emit(event: String?, vararg args: Any?) {
event ?: return
try {
mRuntime?.events?.emit(event, *args)
eventEmitter.emit(event, *args)
} catch (e: Exception) {
mRuntime?.exit(e)

View File

@@ -54,6 +54,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import static android.app.Activity.RESULT_OK;
import static org.autojs.autojs.util.RhinoUtils.isMainThread;
import static org.autojs.autojs.util.StringUtils.str;
@@ -196,7 +197,7 @@ public class Images {
mScreenCaptureRequester.request(contextForRequest, new ScreenCaptureRequester.Callback() {
@Override
public void onRequestResult(int resultCode, @Nullable Intent intent) {
if (resultCode == -1 && intent != null) {
if (resultCode == RESULT_OK && intent != null) {
try {
ScreenCapturer.Options options = new ScreenCapturer.Options(
width, height, orientation, ScreenMetrics.getDeviceScreenDensity(), isAsync

View File

@@ -413,7 +413,7 @@ class Console(scriptRuntime: ScriptRuntime) : AugmentableProxy(scriptRuntime) {
scriptRuntime.console.setContentTextColors(o.map { S13n.color(arrayOf(it)) }.toTypedArray())
}
is NativeObject -> {
val tmp = Array<Int?>(6) { null }
val tmp = Array(6) { 0 }
listOf("verbose", "log", "info", "warn", "error", "assert").forEachIndexed { index, key ->
if (o.hasProp(key)) {
tmp[index] = S13n.color(arrayOf(o.prop(key)))

View File

@@ -46,6 +46,7 @@ class LogActivity : BaseActivity() {
return true
}
@Deprecated("Deprecated in Java")
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)