Version: 638
Android: 33
java.lang.InterruptedException:
java.lang.reflect.UndeclaredThrowableException:
$Proxy7.call(Unknown Source)
......
Caused by:
java.lang.InterruptedException:
kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:84)
kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source:1)
kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source:1)
org.autojs.autojs.devplugin.DevPlugin$Connection.log(DevPlugin.kt:330)
org.autojs.autojs.devplugin.DevPlugin.log(DevPlugin.kt:91)
org.autojs.autojs.autojs.AutoJs$3.println(AutoJs.java:119)
com.stardust.autojs.core.console.ConsoleImpl.println(ConsoleImpl.java:137)
com.stardust.autojs.runtime.api.AbstractConsole.printf(AbstractConsole.java:26)
com.stardust.autojs.runtime.api.AbstractConsole.error(AbstractConsole.java:66)
com.stardust.autojs.core.console.ConsoleImpl.error(ConsoleImpl.java:356)
com.stardust.autojs.ScriptEngineService$1.onException(ScriptEngineService.java:71)
com.stardust.autojs.execution.ScriptExecutionObserver.onException(ScriptExecutionObserver.java:29)
com.stardust.autojs.execution.ScriptExecuteActivity.onException(ScriptExecuteActivity.kt:75)
com.stardust.autojs.execution.ScriptExecuteActivity.finish(ScriptExecuteActivity.kt:113)
com.stardust.autojs.engine.LoopBasedJavaScriptEngine.forceStop(LoopBasedJavaScriptEngine.java:82)
com.stardust.autojs.runtime.ScriptRuntime.exit(ScriptRuntime.java:378)
com.stardust.autojs.runtime.ScriptRuntime.exit(ScriptRuntime.java:387)
org.mozilla.javascript.VMBridge_custom.lambda$newInterfaceProxy$0$org-mozilla-javascript-VMBridge_custom(VMBridge_custom.java:60)
org.mozilla.javascript.VMBridge_custom$$ExternalSyntheticLambda0.invoke(Unknown Source:15)
java.lang.reflect.Proxy.invoke(Proxy.java:1006)
$Proxy7.call(Unknown Source)
com.stardust.autojs.runtime.ScriptBridges.callFunction(ScriptBridges.java:35)
com.stardust.autojs.core.eventloop.EventEmitter$Listeners.emit(EventEmitter.java:59)
com.stardust.autojs.core.eventloop.EventEmitter.emit(EventEmitter.java:140)
com.stardust.autojs.core.ui.nativeview.ViewPrototype.emit(ViewPrototype.java:206)
com.stardust.autojs.core.ui.nativeview.ViewPrototype.lambda$registerEvent$2$com-stardust-autojs-core-ui-nativeview-ViewPrototype(ViewPrototype.java:141)
com.stardust.autojs.core.ui.nativeview.ViewPrototype$$ExternalSyntheticLambda0.onClick(Unknown Source:2)
android.view.View.performClick(View.java:7559)
android.view.View.performClickInternal(View.java:7536)
android.view.View.-$$Nest$mperformClickInternal(Unknown Source:0)
android.view.View$PerformClick.run(View.java:29660)
android.os.Handler.handleCallback(Handler.java:942)
android.os.Handler.dispatchMessage(Handler.java:99)
android.os.Looper.loopOnce(Looper.java:211)
android.os.Looper.loop(Looper.java:300)
android.app.ActivityThread.main(ActivityThread.java:8343)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:559)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:954)
手机。小米10、miui 14.0
源码:
"ui";
ui.layout(
<vertical>
<appbar>
<toolbar title="悬浮窗权限无障碍服务"/>
</appbar>
<horizontal>
<Switch id="无障碍服务" text="无障碍服务" checked="{{auto.service != null}}" padding="8 8 8 8" textSize="15sp"/>
<Switch id="悬浮窗权限" text="悬浮窗权限" checked="{{floaty.checkPermission() != false}}" padding="8 8 8 8" textSize="15sp"/>
</horizontal>
<button id="start" text="启动脚本"/>
</vertical>
);
ui.无障碍服务.on("check", function(checked) {
// 用户勾选无障碍服务的选项时,跳转到页面让用户去开启
if (checked && auto.service == null) {
app.startActivity({
action: "android.settings.ACCESSIBILITY_SETTINGS"
});
}
if (!checked && auto.service != null) {
auto.service.disableSelf();
}
});
ui.悬浮窗权限.on("check", function(checked) {
//申请悬浮窗
importClass(android.content.Intent);
importClass(android.net.Uri);
importClass(android.provider.Settings);
var intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION,
Uri.parse("package:" + context.getPackageName()));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
app.startActivity(intent);
});
// 当用户回到本界面时,resume事件会被触发
ui.emitter.on("resume", function() {
// 此时根据无障碍服务的开启情况,同步开关的状态
ui.无障碍服务.checked = auto.service != null;
ui.悬浮窗权限.checked = floaty.checkPermission() != false
});
ui.start.on("click", function() {
if (floaty.checkPermission() == false) {
toast("请先开启悬浮窗权限!")
return;
}
//程序开始运行之前判断无障碍服务
if (auto.service == null) {
toast("请先开启无障碍服务!");
return;
}
/**
* 下面运行主要程序
*/
starts();
});
// var myUtils = require('zhifubao.js');
function starts(){
toast("主程序开始运行");
// myUtils.zhifubaoStart();
zhifubaoStart();
}
function zhifubaoStart() {
launch("com.eg.android.AlipayGphone");
sleep(2000);
var seach = id("home_title_search_button").findOne(6000);
console.log("seach", seach);
toast("select success ",seach);
}