diff --git a/app/src/main/java/org/yameida/worktool/service/WeworkLoopImpl.kt b/app/src/main/java/org/yameida/worktool/service/WeworkLoopImpl.kt index 8b7d522..2f6bbff 100644 --- a/app/src/main/java/org/yameida/worktool/service/WeworkLoopImpl.kt +++ b/app/src/main/java/org/yameida/worktool/service/WeworkLoopImpl.kt @@ -38,7 +38,7 @@ object WeworkLoopImpl { while (mainLoopRunning) { // 如果正在等待回复,跳过新消息检测,避免多消息处理混乱 if (WeworkController.waitingForReply) { - LogUtils.d("等待回复中,暂停检测新消息...") + // LogUtils.d("等待回复中,暂停检测新消息...") sleep(Constant.POP_WINDOW_INTERVAL) continue } @@ -46,11 +46,10 @@ object WeworkLoopImpl { LogUtils.d("当前在房间: ") getChatMessageList() if (mainLoopRunning) { - // 如果不是等待回复状态,则返回主页 if (!WeworkController.waitingForReply) { goHome() } else { - LogUtils.d("等待回复中,保持当前页面...") + // LogUtils.d("等待回复中,保持当前页面...") } } continue @@ -143,7 +142,7 @@ object WeworkLoopImpl { val childCount = item.parent?.parent?.parent?.childCount if (childCount == 4 || childCount == 5) { if (item.parent != null && item.parent.childCount > 1) { - LogUtils.d("通讯录有红点") + // LogUtils.d("通讯录有红点") AccessibilityUtil.performClick(item) val hasRecommendFriend = AccessibilityUtil.findOneByText(getRoot(), "可能的同事", exact = true, timeout = Constant.POP_WINDOW_INTERVAL) if (hasRecommendFriend != null) { @@ -184,7 +183,7 @@ object WeworkLoopImpl { LogUtils.d("未发现待添加客户") } } else { - LogUtils.v("通讯录无红点") + // LogUtils.v("通讯录无红点") } } } @@ -584,7 +583,7 @@ object WeworkLoopImpl { if (!isAtHome()) { goHome() } if (logIndex++ % 30 == 0) { - LogUtils.d("读取首页聊天列表") + // LogUtils.d("读取首页聊天列表") if (logIndex % 120 == 0) log("读取首页聊天列表") } @@ -626,7 +625,7 @@ object WeworkLoopImpl { //消息不一致 return true } else { - LogUtils.v("未发现新消息或无提示消息") + // LogUtils.v("未发现新消息或无提示消息") } } } else { @@ -637,7 +636,7 @@ object WeworkLoopImpl { //让企微切换页面使APP保持活跃 goHomeTab("通讯录") goHomeTab("消息") - LogUtils.d("检查最近列表") + //LogUtils.d("检查最近列表") log("检查最近列表") if (hasNewMessage()) { return false @@ -743,7 +742,7 @@ object WeworkLoopImpl { if (tvList[2].contains("(退出了外部群)|(移出了群聊)|(邀请你加入了)|(修改群名为)|(此群为外部群)|(加入了外部群)".toRegex())) { val interval = System.currentTimeMillis() / 1000 - SPUtils.getInstance("noTipMessage").getLong(tvList[0], 0) if (interval > 3600) { - LogUtils.i("发现无提示消息: $tvList") + // LogUtils.i("发现无提示消息: $tvList") log("发现无提示消息: $tvList") if (AccessibilityUtil.performClick(item)) { //进入聊天页 下一步 getChatMessageList @@ -753,11 +752,11 @@ object WeworkLoopImpl { SPUtils.getInstance("noTipMessage").put(tvList[0], System.currentTimeMillis() / 1000) return 1 } else { - LogUtils.v("发现无提示消息: $tvList 消息在 $interval 秒前已被查看") + // LogUtils.v("发现无提示消息: $tvList 消息在 $interval 秒前已被查看") } } } else { - LogUtils.v("未发现无提示消息: ${tvList[1]}") + // LogUtils.v("未发现无提示消息: ${tvList[1]}") return -1 } } @@ -791,7 +790,7 @@ object WeworkLoopImpl { continue } if (SPUtils.getInstance("noSyncMessage").getString(title) != lastSyncMessage) { - LogUtils.e("发现不一致消息: $tvList $lastSyncMessage") + // LogUtils.e("发现不一致消息: $tvList $lastSyncMessage") error("发现不一致消息: $tvList $lastSyncMessage") SPUtils.getInstance("noSyncMessage").put(title, lastSyncMessage) if (AccessibilityUtil.performClick(item)) { @@ -801,10 +800,10 @@ object WeworkLoopImpl { } return 1 } else { - LogUtils.v("消息多次不一致: $tvList") + // LogUtils.v("消息多次不一致: $tvList") } } else { - LogUtils.v("未发现不一致消息: ${tvList[1]}") + // LogUtils.v("未发现不一致消息: ${tvList[1]}") return -1 } }