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)