From 01fc76991ccb808ca15e0dc631bac6f9e680a90d Mon Sep 17 00:00:00 2001 From: gallonyin Date: Sat, 16 Sep 2023 21:49:27 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E5=A4=9A=E8=BD=AC=E5=8F=91=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../worktool/service/WeworkOperationImpl.kt | 54 +++++++++++++------ 1 file changed, 39 insertions(+), 15 deletions(-) diff --git a/app/src/main/java/org/yameida/worktool/service/WeworkOperationImpl.kt b/app/src/main/java/org/yameida/worktool/service/WeworkOperationImpl.kt index 994afcc..709b6e8 100644 --- a/app/src/main/java/org/yameida/worktool/service/WeworkOperationImpl.kt +++ b/app/src/main/java/org/yameida/worktool/service/WeworkOperationImpl.kt @@ -484,11 +484,19 @@ object WeworkOperationImpl { return false } if (relaySelectTarget(titleList, extraText, timeout = 10000)) { - val stayButton = AccessibilityUtil.findOneByText(getRoot(), "留在企业微信") - AccessibilityUtil.performClick(stayButton) - uploadCommandResult(message, ExecCallbackBean.SUCCESS, "", startTime, titleList, listOf()) - goHome() - return true + if (titleList.size > 1) { + AccessibilityExtraUtil.loadingPage("CommonSelectActivity") + AccessibilityUtil.waitForPageMissing("CommonSelectActivity") + uploadCommandResult(message, ExecCallbackBean.SUCCESS, "", startTime, titleList, listOf()) + goHome() + return true + } else { + val stayButton = AccessibilityUtil.findOneByText(getRoot(), "留在企业微信") + AccessibilityUtil.performClick(stayButton) + uploadCommandResult(message, ExecCallbackBean.SUCCESS, "", startTime, titleList, listOf()) + goHome() + return true + } } else { LogUtils.e("微盘文件转发失败: $objectName") if (retryCount > 0) { @@ -766,11 +774,19 @@ object WeworkOperationImpl { return false } if (relaySelectTarget(titleList, extraText, timeout = 10000)) { - val stayButton = AccessibilityUtil.findOneByText(getRoot(), "留在企业微信") - AccessibilityUtil.performClick(stayButton) - uploadCommandResult(message, ExecCallbackBean.SUCCESS, "", startTime, titleList, listOf()) - goHome() - return true + if (titleList.size > 1) { + AccessibilityExtraUtil.loadingPage("CommonSelectActivity") + AccessibilityUtil.waitForPageMissing("CommonSelectActivity") + uploadCommandResult(message, ExecCallbackBean.SUCCESS, "", startTime, titleList, listOf()) + goHome() + return true + } else { + val stayButton = AccessibilityUtil.findOneByText(getRoot(), "留在企业微信") + AccessibilityUtil.performClick(stayButton) + uploadCommandResult(message, ExecCallbackBean.SUCCESS, "", startTime, titleList, listOf()) + goHome() + return true + } } else { LogUtils.e("文件转发失败: $objectName") if (retryCount > 0) { @@ -848,11 +864,19 @@ object WeworkOperationImpl { return false } if (relaySelectTarget(titleList, extraText, timeout = 10000)) { - val stayButton = AccessibilityUtil.findOneByText(getRoot(), "留在企业微信") - AccessibilityUtil.performClick(stayButton) - uploadCommandResult(message, ExecCallbackBean.SUCCESS, "", startTime, titleList, listOf()) - goHome() - return true + if (titleList.size > 1) { + AccessibilityExtraUtil.loadingPage("CommonSelectActivity") + AccessibilityUtil.waitForPageMissing("CommonSelectActivity") + uploadCommandResult(message, ExecCallbackBean.SUCCESS, "", startTime, titleList, listOf()) + goHome() + return true + } else { + val stayButton = AccessibilityUtil.findOneByText(getRoot(), "留在企业微信") + AccessibilityUtil.performClick(stayButton) + uploadCommandResult(message, ExecCallbackBean.SUCCESS, "", startTime, titleList, listOf()) + goHome() + return true + } } else { LogUtils.e("文件转发失败: $objectName") if (retryCount > 0) {