Browse Source

新增主号批量转发

yangyang 4 months ago
parent
commit
ed750be789

+ 2 - 2
app/build.gradle

@@ -9,8 +9,8 @@ android {
         applicationId "com.rk.worktool"
         applicationId "com.rk.worktool"
         minSdkVersion 24
         minSdkVersion 24
         targetSdkVersion 30
         targetSdkVersion 30
-        versionCode 20250617
-        versionName "2.9.7"
+        versionCode 20250730
+        versionName "2.9.9"
     }
     }
 
 
     buildTypes {
     buildTypes {

+ 1 - 1
app/src/main/java/org/yameida/worktool/activity/ListenActivity.kt

@@ -341,6 +341,7 @@ class ListenActivity : AppCompatActivity() , HttpCallback {
             packageManager.getLaunchIntentForPackage(Constant.PACKAGE_NAMES)?.apply {
             packageManager.getLaunchIntentForPackage(Constant.PACKAGE_NAMES)?.apply {
                 this.flags = Intent.FLAG_ACTIVITY_NEW_TASK
                 this.flags = Intent.FLAG_ACTIVITY_NEW_TASK
                 startActivity(this)
                 startActivity(this)
+                SPUtils.getInstance().put("weCom", 1)
                 if (SPUtils.getInstance().getInt("num") == 1) {
                 if (SPUtils.getInstance().getInt("num") == 1) {
                     WeworkController.weworkService.webSocketManager.send(
                     WeworkController.weworkService.webSocketManager.send(
                         WeworkMessageBean(
                         WeworkMessageBean(
@@ -360,7 +361,6 @@ class ListenActivity : AppCompatActivity() , HttpCallback {
                                 if (firstAppNode != null) {
                                 if (firstAppNode != null) {
                                     AccessibilityUtil.performClick(firstAppNode)
                                     AccessibilityUtil.performClick(firstAppNode)
                                 }
                                 }
-                                SPUtils.getInstance().put("weCom", 1)
                                 WeworkController.weworkService.webSocketManager.send(
                                 WeworkController.weworkService.webSocketManager.send(
                                     WeworkMessageBean(
                                     WeworkMessageBean(
                                         WeworkMessageBean.WE_COM_TYPE,
                                         WeworkMessageBean.WE_COM_TYPE,

+ 2 - 0
app/src/main/java/org/yameida/worktool/model/ExecCallbackBean.kt

@@ -113,6 +113,8 @@ data class ExecCallbackBean(
         //机器人其他未知错误
         //机器人其他未知错误
         const val ERROR_OTHER = 501000
         const val ERROR_OTHER = 501000
 
 
+        const val ERROR_CRASH = 601000
+
     }
     }
 
 
     override fun equals(other: Any?): Boolean {
     override fun equals(other: Any?): Boolean {

+ 8 - 1
app/src/main/java/org/yameida/worktool/model/WeworkMessageBean.java

@@ -69,6 +69,8 @@ public class WeworkMessageBean {
     public static final int ABNORMALITY_GROUP = 104;
     public static final int ABNORMALITY_GROUP = 104;
     public static final int ABNORMALITY_CONTACTS = 105;
     public static final int ABNORMALITY_CONTACTS = 105;
 
 
+    public static final int ANR = 106;
+
     public static final int STOP_AND_GO_HOME = 201;
     public static final int STOP_AND_GO_HOME = 201;
     public static final int LOOP_RECEIVE_NEW_MESSAGE = 202;
     public static final int LOOP_RECEIVE_NEW_MESSAGE = 202;
     public static final int SEND_MESSAGE = 203;
     public static final int SEND_MESSAGE = 203;
@@ -341,12 +343,17 @@ public class WeworkMessageBean {
         this.log = log;
         this.log = log;
     }
     }
 
 
-    public WeworkMessageBean(Integer type,String weWorkVersion, String appVersionName) {
+    public WeworkMessageBean(Integer type, String weWorkVersion, String appVersionName) {
         this.type = type;
         this.type = type;
         this.weWorkVersion = weWorkVersion;
         this.weWorkVersion = weWorkVersion;
         this.appVersionName = appVersionName;
         this.appVersionName = appVersionName;
     }
     }
 
 
+    public WeworkMessageBean(Integer type, String id) {
+        this.type = type;
+        this.id = id;
+    }
+
     //消息类型
     //消息类型
     public Integer type = 0;
     public Integer type = 0;
 
 

+ 35 - 22
app/src/main/java/org/yameida/worktool/service/GlobalMethod.kt

@@ -174,6 +174,15 @@ fun getRoot(ignoreCheck: Boolean, share: Boolean = false): AccessibilityNodeInfo
                         LogUtils.e("点击ANR确定")
                         LogUtils.e("点击ANR确定")
                         AccessibilityUtil.performClick(findOnceByText)
                         AccessibilityUtil.performClick(findOnceByText)
                         error("点击关闭确定")
                         error("点击关闭确定")
+                        sleep(Constant.BASE_CHANGE_PAGE_INTERVAL)
+                        // 重启
+//                        jump()
+                        WeworkController.weworkService.webSocketManager.send(
+                            WeworkMessageBean(
+                                WeworkMessageBean.ANR,
+                                Constant.robotId
+                            )
+                        )
                     } else {
                     } else {
                         LogUtils.v("tvANR=:null----tvANRTow=:null")
                         LogUtils.v("tvANR=:null----tvANRTow=:null")
                     }
                     }
@@ -189,28 +198,7 @@ fun getRoot(ignoreCheck: Boolean, share: Boolean = false): AccessibilityNodeInfo
                         if (!FloatWindowHelper.isPause) {
                         if (!FloatWindowHelper.isPause) {
                             LogUtils.e("当前不在企业微信: ${root.packageName}\n尝试跳转到企业微信")
                             LogUtils.e("当前不在企业微信: ${root.packageName}\n尝试跳转到企业微信")
                             ToastUtils.show("当前不在企业微信: ${root.packageName}\n尝试跳转到企业微信")
                             ToastUtils.show("当前不在企业微信: ${root.packageName}\n尝试跳转到企业微信")
-                            Utils.getApp().packageManager.getLaunchIntentForPackage(Constant.PACKAGE_NAMES)
-                                ?.apply {
-                                    this.flags = Intent.FLAG_ACTIVITY_NEW_TASK
-                                    Utils.getApp().startActivity(this)
-                                    //TODO 点击跳转
-                                    if (SPUtils.getInstance().getInt("num") == 2) {
-                                        sleep(Constant.BASE_GENERAL_INTERVAL)
-                                        val rootNode =
-                                            WeworkController.weworkService.rootInActiveWindow
-                                        var findAllByClazz = AccessibilityUtil.findAllByClazz(
-                                            rootNode,
-                                            Views.ImageView
-                                        )
-                                        if (findAllByClazz.size == 2) {
-                                            if (SPUtils.getInstance().getInt("weCom") == 1) {
-                                                AccessibilityUtil.performClick(findAllByClazz.firstOrNull())
-                                            } else {
-                                                AccessibilityUtil.performClick(findAllByClazz.lastOrNull())
-                                            }
-                                        }
-                                    }
-                                }
+                            jump()
                         }
                         }
                     }
                     }
                 }
                 }
@@ -223,6 +211,31 @@ fun getRoot(ignoreCheck: Boolean, share: Boolean = false): AccessibilityNodeInfo
     }
     }
 }
 }
 
 
+fun jump(){
+    Utils.getApp().packageManager.getLaunchIntentForPackage(Constant.PACKAGE_NAMES)
+        ?.apply {
+            this.flags = Intent.FLAG_ACTIVITY_NEW_TASK
+            Utils.getApp().startActivity(this)
+            //TODO 点击跳转
+            if (SPUtils.getInstance().getInt("num") == 2) {
+                sleep(Constant.BASE_GENERAL_INTERVAL)
+                val rootNode =
+                    WeworkController.weworkService.rootInActiveWindow
+                var findAllByClazz = AccessibilityUtil.findAllByClazz(
+                    rootNode,
+                    Views.ImageView
+                )
+                if (findAllByClazz.size == 2) {
+                    if (SPUtils.getInstance().getInt("weCom") == 1) {
+                        AccessibilityUtil.performClick(findAllByClazz.firstOrNull())
+                    } else {
+                        AccessibilityUtil.performClick(findAllByClazz.lastOrNull())
+                    }
+                }
+            }
+        }
+}
+
 /**
 /**
  * 后退
  * 后退
  */
  */

+ 7 - 0
app/src/main/java/org/yameida/worktool/service/WeworkOperationImpl.kt

@@ -2599,6 +2599,13 @@ object WeworkOperationImpl {
                                 return false
                                 return false
                             }
                             }
                         } else {
                         } else {
+                            AccessibilityUtil.scrollAndFindByText(
+                                WeworkController.weworkService,
+                                getRoot(),
+                                originalContent,
+                                exact = true
+                            )
+                            sleep(500)
                             if (WeworkTextUtil.longClickMyMessageItem(
                             if (WeworkTextUtil.longClickMyMessageItem(
                                     //聊天消息列表 1ListView 0RecycleView xViewGroup
                                     //聊天消息列表 1ListView 0RecycleView xViewGroup
                                     AccessibilityUtil.findOneByClazz(getRoot(), Views.ListView),
                                     AccessibilityUtil.findOneByClazz(getRoot(), Views.ListView),

+ 120 - 27
app/src/main/java/org/yameida/worktool/utils/AccessibilityUtil.kt

@@ -70,9 +70,14 @@ object AccessibilityUtil {
     }
     }
 
 
     //编辑EditView(粘贴 不推荐)
     //编辑EditView(粘贴 不推荐)
-    fun sendTextForEditText(context: Context, nodeInfo: AccessibilityNodeInfo?, text: String): Boolean {
+    fun sendTextForEditText(
+        context: Context,
+        nodeInfo: AccessibilityNodeInfo?,
+        text: String
+    ): Boolean {
         val nodeInfo: AccessibilityNodeInfo = nodeInfo ?: return false
         val nodeInfo: AccessibilityNodeInfo = nodeInfo ?: return false
-        val clipboard: ClipboardManager = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
+        val clipboard: ClipboardManager =
+            context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
         val clip = ClipData.newPlainText("text", text)
         val clip = ClipData.newPlainText("text", text)
         clipboard.setPrimaryClip(clip)
         clipboard.setPrimaryClip(clip)
         nodeInfo.performAction(AccessibilityNodeInfo.ACTION_FOCUS)
         nodeInfo.performAction(AccessibilityNodeInfo.ACTION_FOCUS)
@@ -93,31 +98,42 @@ object AccessibilityUtil {
     }
     }
 
 
     //寻找第一个文本匹配(关键词)并点击
     //寻找第一个文本匹配(关键词)并点击
-    fun findTextAndClick(nodeInfo: AccessibilityNodeInfo?,
+    fun findTextAndClick(
+        nodeInfo: AccessibilityNodeInfo?,
         vararg textList: String,
         vararg textList: String,
         exact: Boolean = false,
         exact: Boolean = false,
         timeout: Long = 5000,
         timeout: Long = 5000,
         root: Boolean = true
         root: Boolean = true
     ): Boolean {
     ): Boolean {
-        val textView = findOneByText(nodeInfo, *textList, exact = exact, timeout = timeout, root = root) ?: return false
+        val textView =
+            findOneByText(nodeInfo, *textList, exact = exact, timeout = timeout, root = root)
+                ?: return false
         performClick(textView)
         performClick(textView)
         return true
         return true
     }
     }
 
 
     //寻找第一个描述匹配(关键词)并点击
     //寻找第一个描述匹配(关键词)并点击
-    fun findDescAndClick(nodeInfo: AccessibilityNodeInfo?,
-                         vararg textList: String,
-                         exact: Boolean = false,
-                         timeout: Long = 5000,
-                         root: Boolean = true
+    fun findDescAndClick(
+        nodeInfo: AccessibilityNodeInfo?,
+        vararg textList: String,
+        exact: Boolean = false,
+        timeout: Long = 5000,
+        root: Boolean = true
     ): Boolean {
     ): Boolean {
-        val textView = findOneByDesc(nodeInfo, *textList, exact = exact, timeout = timeout, root = root) ?: return false
+        val textView =
+            findOneByDesc(nodeInfo, *textList, exact = exact, timeout = timeout, root = root)
+                ?: return false
         performClick(textView)
         performClick(textView)
         return true
         return true
     }
     }
 
 
     //寻找第一个EditView编辑框并输入文本
     //寻找第一个EditView编辑框并输入文本
-    fun findTextInput(nodeInfo: AccessibilityNodeInfo?, text: String, root: Boolean = true, append: Boolean = false): Boolean {
+    fun findTextInput(
+        nodeInfo: AccessibilityNodeInfo?,
+        text: String,
+        root: Boolean = true,
+        append: Boolean = false
+    ): Boolean {
         val editText = if (root) {
         val editText = if (root) {
             findOneByClazz(nodeInfo, "android.widget.EditText") ?: return false
             findOneByClazz(nodeInfo, "android.widget.EditText") ?: return false
         } else {
         } else {
@@ -137,7 +153,11 @@ object AccessibilityUtil {
 
 
     //寻找第一个列表并点击指定条目(默认点击第一个条目)
     //寻找第一个列表并点击指定条目(默认点击第一个条目)
     fun findListOneAndClick(nodeInfo: AccessibilityNodeInfo, index: Int = 0): Boolean {
     fun findListOneAndClick(nodeInfo: AccessibilityNodeInfo, index: Int = 0): Boolean {
-        val list = findOnceByClazz(nodeInfo, "androidx.recyclerview.widget.RecyclerView", "android.widget.ListView")
+        val list = findOnceByClazz(
+            nodeInfo,
+            "androidx.recyclerview.widget.RecyclerView",
+            "android.widget.ListView"
+        )
         if (list != null && list.childCount > index) {
         if (list != null && list.childCount > index) {
             return performClick(list.getChild(index))
             return performClick(list.getChild(index))
         }
         }
@@ -408,6 +428,20 @@ object AccessibilityUtil {
         return false
         return false
     }
     }
 
 
+    /**
+     * 对某个节点或子节点进行长按
+     */
+    fun performLongClickWithSon2(nodeInfo: AccessibilityNodeInfo?): Boolean {
+        var nodeInfo: AccessibilityNodeInfo? = nodeInfo ?: return false
+        if (nodeInfo != null) {
+//            nodeInfo.performAction(AccessibilityNodeInfo.ACTION_LONG_CLICK)
+            longClickByNode(WeworkController.weworkService, nodeInfo)
+            LogUtils.d("performLongClickWithSon: text: ${nodeInfo.text} desc: ${nodeInfo.contentDescription}")
+            return true
+        }
+        return false
+    }
+
     //对某个节点向上滚动
     //对某个节点向上滚动
     fun performScrollUp(nodeInfo: AccessibilityNodeInfo?): Boolean {
     fun performScrollUp(nodeInfo: AccessibilityNodeInfo?): Boolean {
         var nodeInfo: AccessibilityNodeInfo? = nodeInfo ?: return false
         var nodeInfo: AccessibilityNodeInfo? = nodeInfo ?: return false
@@ -537,7 +571,14 @@ object AccessibilityUtil {
         timeout: Long = 5000,
         timeout: Long = 5000,
         root: Boolean = true
         root: Boolean = true
     ): AccessibilityNodeInfo? {
     ): AccessibilityNodeInfo? {
-        return findOneByText(node, *textList, exact = exact, timeout = timeout, root = root, desc = true)
+        return findOneByText(
+            node,
+            *textList,
+            exact = exact,
+            timeout = timeout,
+            root = root,
+            desc = true
+        )
     }
     }
 
 
     /**
     /**
@@ -571,7 +612,15 @@ object AccessibilityUtil {
         root: Boolean = true,
         root: Boolean = true,
         minSize: Int = 1
         minSize: Int = 1
     ): List<AccessibilityNodeInfo> {
     ): List<AccessibilityNodeInfo> {
-        return findAllByText(node, *textList, exact = exact, timeout = timeout, root = root, minSize = minSize, desc = true)
+        return findAllByText(
+            node,
+            *textList,
+            exact = exact,
+            timeout = timeout,
+            root = root,
+            minSize = minSize,
+            desc = true
+        )
     }
     }
 
 
     /**
     /**
@@ -701,7 +750,10 @@ object AccessibilityUtil {
             }
             }
             currentTime = System.currentTimeMillis()
             currentTime = System.currentTimeMillis()
         }
         }
-        Log.e(tag, "findOneByText ${if (desc) "desc" else "text"}: not found: ${textList.joinToString()}")
+        Log.e(
+            tag,
+            "findOneByText ${if (desc) "desc" else "text"}: not found: ${textList.joinToString()}"
+        )
         return null
         return null
     }
     }
 
 
@@ -773,7 +825,10 @@ object AccessibilityUtil {
             }
             }
             currentTime = System.currentTimeMillis()
             currentTime = System.currentTimeMillis()
         }
         }
-        Log.e(tag, "findAllByText ${if (desc) "desc" else "text"}: not found: ${textList.joinToString()}")
+        Log.e(
+            tag,
+            "findAllByText ${if (desc) "desc" else "text"}: not found: ${textList.joinToString()}"
+        )
         return arrayListOf()
         return arrayListOf()
     }
     }
 
 
@@ -888,7 +943,14 @@ object AccessibilityUtil {
         val startTime = System.currentTimeMillis()
         val startTime = System.currentTimeMillis()
         var currentTime = startTime
         var currentTime = startTime
         while (currentTime - startTime <= timeout) {
         while (currentTime - startTime <= timeout) {
-            val result = findOnceByClazz(node, *clazzList, limitDepth = limitDepth, depth = depth, minChildCount = minChildCount, firstChildClazz = firstChildClazz)
+            val result = findOnceByClazz(
+                node,
+                *clazzList,
+                limitDepth = limitDepth,
+                depth = depth,
+                minChildCount = minChildCount,
+                firstChildClazz = firstChildClazz
+            )
             LogUtils.v("clazz: ${clazzList.joinToString()} result == null: ${result == null}")
             LogUtils.v("clazz: ${clazzList.joinToString()} result == null: ${result == null}")
             if (result != null) return result
             if (result != null) return result
             sleep(SHORT_INTERVAL)
             sleep(SHORT_INTERVAL)
@@ -923,13 +985,23 @@ object AccessibilityUtil {
         if (node == null) return null
         if (node == null) return null
         if (node.className in clazzList) {
         if (node.className in clazzList) {
             if ((limitDepth == null || limitDepth == depth) && node.childCount >= minChildCount)
             if ((limitDepth == null || limitDepth == depth) && node.childCount >= minChildCount)
-                if (firstChildClazz == null || (node.childCount > 0 && firstChildClazz == node.getChild(0).className)) {
+                if (firstChildClazz == null || (node.childCount > 0 && firstChildClazz == node.getChild(
+                        0
+                    ).className)
+                ) {
                     return node
                     return node
                 }
                 }
         }
         }
         for (i in 0 until node.childCount) {
         for (i in 0 until node.childCount) {
             if (limitDepth == null || limitDepth > depth) {
             if (limitDepth == null || limitDepth > depth) {
-                val result = findOnceByClazz(node.getChild(i), *clazzList, limitDepth = limitDepth, depth = depth + 1, minChildCount = minChildCount, firstChildClazz = firstChildClazz)
+                val result = findOnceByClazz(
+                    node.getChild(i),
+                    *clazzList,
+                    limitDepth = limitDepth,
+                    depth = depth + 1,
+                    minChildCount = minChildCount,
+                    firstChildClazz = firstChildClazz
+                )
                 if (result != null) return result
                 if (result != null) return result
             }
             }
         }
         }
@@ -958,7 +1030,8 @@ object AccessibilityUtil {
         val startTime = System.currentTimeMillis()
         val startTime = System.currentTimeMillis()
         var currentTime = startTime
         var currentTime = startTime
         while (currentTime - startTime <= timeout) {
         while (currentTime - startTime <= timeout) {
-            val result = findAllOnceByClazz(node, *clazzList, limitDepth = limitDepth, depth = depth)
+            val result =
+                findAllOnceByClazz(node, *clazzList, limitDepth = limitDepth, depth = depth)
             LogUtils.v("clazz: ${clazzList.joinToString()} count: " + result.size)
             LogUtils.v("clazz: ${clazzList.joinToString()} count: " + result.size)
             if (result.size >= minSize) return result
             if (result.size >= minSize) return result
             sleep(SHORT_INTERVAL)
             sleep(SHORT_INTERVAL)
@@ -988,10 +1061,18 @@ object AccessibilityUtil {
         list: ArrayList<AccessibilityNodeInfo> = ArrayList()
         list: ArrayList<AccessibilityNodeInfo> = ArrayList()
     ): ArrayList<AccessibilityNodeInfo> {
     ): ArrayList<AccessibilityNodeInfo> {
         if (node == null) return list
         if (node == null) return list
-        if ((limitDepth == null || limitDepth == depth) && node.className in clazzList) list.add(node)
+        if ((limitDepth == null || limitDepth == depth) && node.className in clazzList) list.add(
+            node
+        )
         for (i in 0 until node.childCount) {
         for (i in 0 until node.childCount) {
             if (limitDepth == null || limitDepth > depth) {
             if (limitDepth == null || limitDepth > depth) {
-                findAllOnceByClazz(node.getChild(i), *clazzList, limitDepth = limitDepth, depth = depth + 1, list = list)
+                findAllOnceByClazz(
+                    node.getChild(i),
+                    *clazzList,
+                    limitDepth = limitDepth,
+                    depth = depth + 1,
+                    list = list
+                )
             }
             }
         }
         }
         return list
         return list
@@ -1001,7 +1082,10 @@ object AccessibilityUtil {
      * 查找节点的前兄弟节点 直到该节点满足子节点数
      * 查找节点的前兄弟节点 直到该节点满足子节点数
      * @param node 节点
      * @param node 节点
      */
      */
-    fun findFrontNode(node: AccessibilityNodeInfo?, minChildCount: Int = 0): AccessibilityNodeInfo? {
+    fun findFrontNode(
+        node: AccessibilityNodeInfo?,
+        minChildCount: Int = 0
+    ): AccessibilityNodeInfo? {
         var findFrontNode = findFrontNode(node) ?: return null
         var findFrontNode = findFrontNode(node) ?: return null
         while (findFrontNode.childCount < minChildCount) {
         while (findFrontNode.childCount < minChildCount) {
             findFrontNode = findFrontNode(findFrontNode) ?: return null
             findFrontNode = findFrontNode(findFrontNode) ?: return null
@@ -1088,7 +1172,8 @@ object AccessibilityUtil {
         for (i in 0 until depth) {
         for (i in 0 until depth) {
             s += "---"
             s += "---"
         }
         }
-        val temp = "$s depth: $depth className: " + node.className + " isClickable: " + node.isClickable
+        val temp =
+            "$s depth: $depth className: " + node.className + " isClickable: " + node.isClickable
         Log.d(tag, temp)
         Log.d(tag, temp)
         sb.append(temp).append("\n")
         sb.append(temp).append("\n")
         var text = ""
         var text = ""
@@ -1295,7 +1380,10 @@ object AccessibilityUtil {
             }
             }
             currentTime = System.currentTimeMillis()
             currentTime = System.currentTimeMillis()
         }
         }
-        Log.e(tag, "waitForTextMissing ${if (desc) "desc" else "text"}: found: ${textList.joinToString()}")
+        Log.e(
+            tag,
+            "waitForTextMissing ${if (desc) "desc" else "text"}: found: ${textList.joinToString()}"
+        )
         return false
         return false
     }
     }
 
 
@@ -1338,7 +1426,9 @@ object AccessibilityUtil {
         val startTime = System.currentTimeMillis()
         val startTime = System.currentTimeMillis()
         var currentTime = startTime
         var currentTime = startTime
         while (currentTime - startTime <= timeout) {
         while (currentTime - startTime <= timeout) {
-            if (service.currentClass in clazzList || service.currentClass.split(".").last() in clazzList) {
+            if (service.currentClass in clazzList || service.currentClass.split(".")
+                    .last() in clazzList
+            ) {
             } else {
             } else {
                 Log.v(tag, "pageMissing: ${clazzList.joinToString()}")
                 Log.v(tag, "pageMissing: ${clazzList.joinToString()}")
                 return true
                 return true
@@ -1346,7 +1436,10 @@ object AccessibilityUtil {
             sleep(SHORT_INTERVAL)
             sleep(SHORT_INTERVAL)
             currentTime = System.currentTimeMillis()
             currentTime = System.currentTimeMillis()
         }
         }
-        Log.e(tag, "pageMissing: not found: ${clazzList.joinToString()} current: ${service.currentClass}")
+        Log.e(
+            tag,
+            "pageMissing: not found: ${clazzList.joinToString()} current: ${service.currentClass}"
+        )
         return false
         return false
     }
     }
 
 

+ 11 - 11
app/src/main/java/org/yameida/worktool/utils/WeworkTextUtil.kt

@@ -620,15 +620,15 @@ object WeworkTextUtil {
                             )
                             )
                         }
                         }
                     }
                     }
-                    val textNode =
-                        AccessibilityUtil.findOnceByText(frontNode, replyContent, exact = true)
-                    if (textNode != null && replyContent.isNotEmpty()) {
-                        return longClickMyMessageItem(
-                            item,
-                            WeworkMessageBean.ROOM_TYPE_INTERNAL_CONTACT,
-                            key
-                        )
-                    }
+                }
+                val textNode =
+                    AccessibilityUtil.findOnceByText(frontNode, replyContent, exact = true)
+                if (textNode != null && replyContent.isNotEmpty()) {
+                    return longClickMyMessageItem(
+                        item,
+                        WeworkMessageBean.ROOM_TYPE_INTERNAL_CONTACT,
+                        key
+                    )
                 }
                 }
             }
             }
         }
         }
@@ -667,8 +667,8 @@ object WeworkTextUtil {
         if (key == "单击") {
         if (key == "单击") {
             return AccessibilityUtil.clickByNode(WeworkController.weworkService, frontNode)
             return AccessibilityUtil.clickByNode(WeworkController.weworkService, frontNode)
         }
         }
-        AccessibilityUtil.performLongClickWithSon(frontNode)
-        sleep(Constant.POP_WINDOW_INTERVAL)
+        AccessibilityUtil.performLongClickWithSon2(frontNode)
+        sleep(Constant.BASE_GENERAL_INTERVAL)
         val optionRvList = findAllByClazz(getRoot(), Views.RecyclerView, Views.ViewGroup)
         val optionRvList = findAllByClazz(getRoot(), Views.RecyclerView, Views.ViewGroup)
         for (optionRv in optionRvList) {
         for (optionRv in optionRvList) {
             val keyTv = AccessibilityUtil.findOnceByText(optionRv, key, exact = true)
             val keyTv = AccessibilityUtil.findOnceByText(optionRv, key, exact = true)