-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
似乎是线程方面的问题,经过测试,这个报错在很多脚本都会出现。在早些版本比如4.1.1和6.0.0不会出现。
详细报错:02:46:02.669/E: No Context associated with current Thread
java.lang.Exception: No Context associated with current Thread
at org.autojs.autojs.runtime.ScriptRuntime$Companion.popException(ScriptRuntime.kt:844)
at org.autojs.autojs.tool.CrashHandler.uncaughtException(CrashHandler.kt:49)
at org.chromium.base.JavaExceptionReporter.uncaughtException(HwWebview-14.0.2.309.11263:6)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1073)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1068)
-------———————————
会触发报错的脚本示例:
function isScriptRunning(scriptName) {
let engines66 = engines.all();//.slice();
let enginesString = JSON.stringify(engines66);
log(engines66);
return enginesString.includes(scriptName);
}
function startScript(scriptName) {
engines.execScriptFile(scriptName);
}
log("开始进程守护");
if (!isScriptRunning("web闹钟")) {
log("需要守护");
startScript("/sdcard/脚本/web闹钟.js");
}else{
log("不需要守护");
}
exit();