From 3d0f2354dc6a5592a383dfa5821187f45b856c43 Mon Sep 17 00:00:00 2001 From: gallonyin Date: Mon, 11 Sep 2023 22:39:04 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E5=85=BC=E5=AE=B9=E7=BE=A4=E5=90=8D?= =?UTF-8?q?=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/yameida/worktool/service/WeworkGetImpl.kt | 7 +++++-- .../org/yameida/worktool/service/WeworkOperationImpl.kt | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/yameida/worktool/service/WeworkGetImpl.kt b/app/src/main/java/org/yameida/worktool/service/WeworkGetImpl.kt index 8b3fd11..659cd16 100644 --- a/app/src/main/java/org/yameida/worktool/service/WeworkGetImpl.kt +++ b/app/src/main/java/org/yameida/worktool/service/WeworkGetImpl.kt @@ -316,8 +316,11 @@ object WeworkGetImpl { val weworkMessageBean = WeworkMessageBean() weworkMessageBean.type = WeworkMessageBean.GET_GROUP_INFO val tvManagerFlag = AccessibilityUtil.findOneByText(getRoot(), "全部群成员", "微信用户创建", timeout = 2000) - if (tvManagerFlag != null && tvManagerFlag.text.contains("微信用户创建")) { - val button = AccessibilityUtil.findFrontNode(tvManagerFlag) + if (tvManagerFlag?.text?.toString()?.contains("微信用户创建") == true) { + var button = AccessibilityUtil.findFrontNode(tvManagerFlag) + if (button?.className == Views.ImageView) { + button = AccessibilityUtil.findFrontNode(button) + } val tvGroupName = AccessibilityUtil.findOnceByClazz(button, Views.TextView) if (tvGroupName != null && tvGroupName.text != null) { LogUtils.d("群名: " + tvGroupName.text) 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 7d4a7ab..994afcc 100644 --- a/app/src/main/java/org/yameida/worktool/service/WeworkOperationImpl.kt +++ b/app/src/main/java/org/yameida/worktool/service/WeworkOperationImpl.kt @@ -2286,7 +2286,7 @@ object WeworkOperationImpl { if (WeworkRoomUtil.intoGroupManager()) { val textView = AccessibilityUtil.findOneByText(getRoot(), "全部群成员", "微信用户创建") ?: return false - if (textView.text.contains("微信用户创建")) { + if (textView.text?.toString()?.contains("微信用户创建") == true) { var button = AccessibilityUtil.findFrontNode(textView) if (button?.className == Views.ImageView) { button = AccessibilityUtil.findFrontNode(button) @@ -3087,7 +3087,7 @@ object WeworkOperationImpl { (WeworkRoomUtil.intoRoom(groupName) && WeworkRoomUtil.intoGroupManager())) { val tvList = AccessibilityUtil.findAllOnceByClazz(getRoot(), Views.TextView) tvList.forEachIndexed { index, tv -> - if (tv.text != null && tv.text.contains("微信用户创建")) { + if (tv.text?.toString()?.contains("微信用户创建") == true) { if (index + 1 < tvList.size) { val tvQr = tvList[index + 1] AccessibilityUtil.performClick(tvQr)