更新到1.6.0后,执行requestScreenCapture(true)报错,可以帮看看是咋回事不?

已存档

执行脚本如下:
if (!requestScreenCapture(true)) {
toastLog('没有授予 Hamibot 屏幕截图权限');
hamibot.exit();
}

报错信息如下:
08:36:38.991/E: The method 'boolean java.lang.Object.equals(java.lang.Object)' was expected to be of type interface but instead was found to be of type virtual (declaration of 'org.mozilla.javascript.ScriptRuntime' appears in /data/app/com.hamibot.hamibot-MNs0EYJYKQhibGeYlt8jmA==/base.apk)

java.lang.IncompatibleClassChangeError: The method 'boolean java.lang.Object.equals(java.lang.Object)' was expected to be of type interface but instead was found to be of type virtual (declaration of 'org.mozilla.javascript.ScriptRuntime' appears in /data/app/com.hamibot.hamibot-MNs0EYJYKQhibGeYlt8jmA==/base.apk)
at org.mozilla.javascript.ScriptRuntime.jsDelegatesTo(Unknown Source:6)
at org.mozilla.javascript.BaseFunction.hasInstance(Unknown Source:12)
at org.mozilla.javascript.ScriptRuntime.instanceOf(Unknown Source:14)
at org.mozilla.javascript.Interpreter.doInOrInstanceof(Unknown Source:35)
at org.mozilla.javascript.Interpreter.interpretLoop(Unknown Source:1053)
at org.mozilla.javascript.Interpreter.interpret(Unknown Source:62)
at org.mozilla.javascript.InterpretedFunction.call(Unknown Source:20)
at org.mozilla.javascript.ContextFactory.doTopCall(Unknown Source:0)
at org.mozilla.javascript.ScriptRuntime.doTopCall(Unknown Source:33)
at org.mozilla.javascript.InterpretedFunction.exec(Unknown Source:22)
at com.stardust.autojs.engine.RhinoJavaScriptEngine.doExecution(Unknown Source:59)
at com.stardust.autojs.engine.JavaScriptEngine.execute(Unknown Source:15)
at com.stardust.autojs.engine.LoopBasedJavaScriptEngine.access$001(Unknown Source:0)
at com.stardust.autojs.engine.LoopBasedJavaScriptEngine.lambda$execute$0(Unknown Source:2)
at com.stardust.autojs.engine.-$$Lambda$LoopBasedJavaScriptEngine$ffoqWCRm35mszUY9lWNMZL1Mntg.run(Unknown Source:6)
at android.os.Handler.handleCallback(Handler.java:808)
at android.os.Handler.dispatchMessage(Handler.java:101)
at android.os.Looper.loop(Looper.java:166)
at com.stardust.autojs.engine.LoopBasedJavaScriptEngine.execute(Unknown Source:27)
at com.stardust.autojs.engine.LoopBasedJavaScriptEngine.execute(Unknown Source:1)
at com.stardust.autojs.execution.LoopedBasedJavaScriptExecution.doExecution(Unknown Source:55)
at com.stardust.autojs.execution.RunnableScriptExecution.execute(Unknown Source:4)
at com.stardust.autojs.execution.RunnableScriptExecution.execute(Unknown Source:31)
at com.stardust.autojs.execution.RunnableScriptExecution.run(Unknown Source:45)
at java.lang.Thread.run(Thread.java:784)

yeah8888 · 4 个月前
第 1 条补充
·
4 个月前

更新到1.6.1还是报同样的错呢

第 2 条补充
·
4 个月前

toastLog("程序开始运行");
setScreenMetrics(1080,2160);//mix2s
auto.waitFor();
if (!requestScreenCapture(true)) {
toastLog('没有授予 Hamibot 屏幕截图权限');
hamibot.exit();
}

第 3 条补充
·
4 个月前

我实际运行环境是华为nova的手机,可以用华为手机测试看能复现吗?确实是到了requestScreenCapture这个就报错了

第 4 条补充
·
4 个月前

我用的EMUI8.0.0的系统。。。手机太旧升级不了鸿蒙。。可以给个1.5.1版本的官方链接下载不?

回答

神秘机师
249
· 4 个月前

MIUI 13 没有报错,可能不是这段代码引起的
鸿蒙 4.0 没有报错


https://dl.hamibot.com/Hamibot_1.5.1.apk

0
yeah8888 · 4 个月前

更新到1.6.1还是报同样的错呢
最小代码如下
toastLog("程序开始运行");
setScreenMetrics(1080,2160);//mix2s
auto.waitFor();
if (!requestScreenCapture(true)) {
toastLog('没有授予 Hamibot 屏幕截图权限');
hamibot.exit();
}
我实际运行环境是华为nova的手机,可以用华为手机测试看能复现吗?确实是到了requestScreenCapture这个就报错了

我用的EMUI8.0.0的系统。。。手机太旧升级不了鸿蒙。。可以给个1.5.1版本的官方链接下载不?

0