1
0

2 Revīzijas a790b876c3 ... 690f850fac

Autors SHA1 Ziņojums Datums
  yangyang 690f850fac 跨主体拉群 1 mēnesi atpakaļ
  yangyang 4fa86aa6bb 代码提交 3 mēneši atpakaļ

+ 2 - 2
app/build.gradle

@@ -9,8 +9,8 @@ android {
         applicationId "com.rk.worktool"
         minSdkVersion 24
         targetSdkVersion 30
-        versionCode 20250822
-        versionName "3.0.1"
+        versionCode 20251128
+        versionName "3.0.2"
     }
 
     buildTypes {

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

@@ -54,7 +54,7 @@ object Constant {
     var POP_WINDOW_INTERVAL = BASE_POP_WINDOW_INTERVAL
 
 //    private const val DEFAULT_HOST = "wss://assistant.flowbb.top/"
-//    private const val DEFAULT_HOST = "ws://192.168.2.36:9059/"
+//    private const val DEFAULT_HOST = "ws://192.168.2.128:9059/"
     private const val DEFAULT_HOST = "wss://www.mooger8.com/"
     var version = Int.MAX_VALUE
     var myName = ""

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

@@ -74,6 +74,9 @@ data class ExecCallbackBean(
         //创建群达到上限/限制
         const val ERROR_CREATE_GROUP_LIMIT = 201018
 
+        //退出群聊失败
+        const val ERROR_GROUP_EXIT = 201019
+
         //查找聊天窗失败
         const val ERROR_INTO_ROOM = 201101
 

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

@@ -326,6 +326,8 @@ public class WeworkMessageBean {
 
     public boolean isRelay;
 
+    public boolean isExit;
+
     public WeworkMessageBean() {
     }
 

+ 41 - 1
app/src/main/java/org/yameida/worktool/service/WeworkOperationImpl.kt

@@ -703,6 +703,18 @@ object WeworkOperationImpl {
             )
             return false
         }
+        if (!exitGroup(message.isExit)) {
+            uploadCommandResult(
+                message,
+                ExecCallbackBean.ERROR_GROUP_EXIT,
+                "进入房间成功 群改名成功 群拉人成功 群公告成功 群备注成功 禁止改群名成功 退出群聊失败",
+                startTime,
+                listOf(),
+                listOf(groupName),
+                metaJson = GsonUtils.toJson(metaJson)
+            )
+            return false
+        }
         saveToContract()
 //        getGroupQrcode(groupName, groupRemark)
         uploadCommandResult(
@@ -2591,7 +2603,11 @@ object WeworkOperationImpl {
             if (WeworkRoomUtil.intoRoom(title) || WeworkRoomUtil.intoRoom(title, fastIn = false)) {
                 var hasOpenMulti = false
                 // 倒序排序
-                val reversedList = messageList.reversed()
+               val reversedList = if ("M2007J17C" == DeviceUtils.getModel()) {
+                    messageList
+                } else {
+                    messageList.reversed()
+                }
                 for (subMessageBean in reversedList) {
                     val receivedName = subMessageBean.nameList?.firstOrNull()
                     val textType = subMessageBean.textType
@@ -5023,6 +5039,30 @@ object WeworkOperationImpl {
         return false
     }
 
+    private fun exitGroup(isExit: Boolean): Boolean {
+        if (!isExit) {
+            return true
+        }
+        if (WeworkRoomUtil.intoGroupManager()) {
+            val node = AccessibilityUtil.scrollAndFindByText(
+                WeworkController.weworkService,
+                getRoot(),
+                "退出群聊",
+                exact = true
+            )
+            if (node != null) {
+                AccessibilityUtil.performClick(node)
+                sleep(Constant.POP_WINDOW_INTERVAL)
+                val textView = AccessibilityUtil.findOneByText(getRoot(), "退出", exact = true)
+                if (textView != null) {
+                    AccessibilityUtil.performClick(textView)
+                    return true
+                }
+            }
+        }
+        return false
+    }
+
     /**
      * 修改群模板
      */