georgehuan1994 / DingDing-Automatic-Clock-in

钉钉全自动打卡脚本,基于auto.js,免root,适用于蓝牙考勤机
851 stars 223 forks source link

auto.js运行脚本报错,安卓10 #31

Closed G-chunyang closed 2 years ago

G-chunyang commented 3 years ago

更改了对应的配置信息如的dingding账号密码等之类的,测试运行一下DingDing-Automatic-Clock-in.js 却发现报错了。麻烦看一下是啥原因?


[/storage/emulated/0/脚本/DingDing-Automatic-Clock-in.js]运行结束,用时0.070000秒 20:44:30.083/V: 开始运行[/storage/emulated/0/脚本/DingDing-Automatic-Clock-in.js] 20:44:30.130/D: { major: 4, minor: 1, revision: 0, buildType: 100, build: 1 } { major: 4, minor: 1, revision: 1, buildType: 0, build: 2 } 20:44:30.142/E: Wrapped java.lang.NullPointerException: Attempt to read from field 'int android.accessibilityservice.AccessibilityServiceInfo.flags' on a null object reference (/storage/emulated/0/脚本/DingDing-Automatic-Clock-in.js#72) Wrapped java.lang.NullPointerException: Attempt to read from field 'int android.accessibilityservice.AccessibilityServiceInfo.flags' on a null object reference at /storage/emulated/0/脚本/DingDing-Automatic-Clock-in.js:72:0

20:44:30.143/V:

georgehuan1994 commented 3 years ago

注意事项里的第二条操作一下: 运行脚本前,请在AutoJs菜单栏中(从屏幕左边划出),开启 「通知读取权限」

G-chunyang commented 3 years ago

注意事项里的第二个操作运行一下: 脚本前,请在AutoJs出条菜单)(触发从屏幕划线划,「通知读取权限」)

确认运行前已打开通知读取权限,重启手机再运行就不会出现报错了。感谢解答

G-chunyang commented 3 years ago

运行脚本时还是有报错。麻烦看一下呗?

17:56:42.207/D: 发送QQ消息 17:56:42.208/D: 唤醒设备 17:56:42.377/I: 设备已唤醒 17:56:43.382/I: 设备已唤醒 17:56:44.391/D: 解锁屏幕 17:56:44.401/I: 屏幕已解锁 17:56:51.364/E: length=3; index=8

java.lang.StringIndexOutOfBoundsException: length=3; index=8 at java.lang.String.substring(String.java:1897) at com.stardust.autojs.runtime.api.Events.lambda$onKeyEvent$1(Events.java:312) at com.stardust.autojs.runtime.api.-$$Lambda$Events$9pFwY1VjzPwJDmD4kCJKyYiTM-A.run(lambda) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at com.stardust.autojs.engine.LoopBasedJavaScriptEngine.execute(LoopBasedJavaScriptEngine.java:65) at com.stardust.autojs.engine.LoopBasedJavaScriptEngine.execute(LoopBasedJavaScriptEngine.java:38) at com.stardust.autojs.execution.LoopedBasedJavaScriptExecution.doExecution(LoopedBasedJavaScriptExecution.java:42) at com.stardust.autojs.execution.RunnableScriptExecution.execute(RunnableScriptExecution.java:43) at com.stardust.autojs.execution.RunnableScriptExecution.execute(RunnableScriptExecution.java:37) at com.stardust.autojs.execution.RunnableScriptExecution.run(RunnableScriptExecution.java:31) at java.lang.Thread.run(Thread.java:761) 17:56:51.372/V:

2021-08-13-Friday-log.txt

georgehuan1994 commented 3 years ago

字符串下标越界,可能是读到了tasker发出的通知:

17:59:01.134/V: net.dinglisch.android.taskerm 17:59:01.136/V: null 17:59:01.138/V: null

可以自己做个判断处理一下