From 4eac3662d7ae6af28df779ac9a8b0571afebba39 Mon Sep 17 00:00:00 2001 From: gallonyin Date: Wed, 24 May 2023 20:19:36 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E6=8A=95=E5=B1=8F=E5=92=8Canr?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/yameida/worktool/service/GlobalMethod.kt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/src/main/java/org/yameida/worktool/service/GlobalMethod.kt b/app/src/main/java/org/yameida/worktool/service/GlobalMethod.kt index 4dfd5b6..0bc51ef 100644 --- a/app/src/main/java/org/yameida/worktool/service/GlobalMethod.kt +++ b/app/src/main/java/org/yameida/worktool/service/GlobalMethod.kt @@ -123,6 +123,18 @@ fun getRoot(ignoreCheck: Boolean): AccessibilityNodeInfo { return root } else { LogUtils.e("当前不在企业微信: ${root.packageName}") + if (root.packageName == "com.android.systemui") { + if (AccessibilityUtil.findTextAndClick(root, "立即开始", exact = true, timeout = 0)) { + LogUtils.i("点击立即开始投屏") + log("点击立即开始投屏") + } + } + if (root.packageName == "android") { + if (AccessibilityUtil.findTextAndClick(root, "关闭应用", exact = true, timeout = 0)) { + LogUtils.e("点击关闭应用ANR") + error("点击关闭应用ANR") + } + } WeworkController.weworkService.currentPackage = root.packageName?.toString() ?: "" if (System.currentTimeMillis() % 30 == 0L) { error("当前不在企业微信: ${root.packageName}")