refactor(WeworkLoopImpl): comment out debug log statements for cleaner output
Commented out various LogUtils debug statements throughout the WeworkLoopImpl class to reduce log clutter during execution. This change aims to improve readability and maintainability of the code without affecting functionality.
This commit is contained in:
@@ -38,7 +38,7 @@ object WeworkLoopImpl {
|
|||||||
while (mainLoopRunning) {
|
while (mainLoopRunning) {
|
||||||
// 如果正在等待回复,跳过新消息检测,避免多消息处理混乱
|
// 如果正在等待回复,跳过新消息检测,避免多消息处理混乱
|
||||||
if (WeworkController.waitingForReply) {
|
if (WeworkController.waitingForReply) {
|
||||||
LogUtils.d("等待回复中,暂停检测新消息...")
|
// LogUtils.d("等待回复中,暂停检测新消息...")
|
||||||
sleep(Constant.POP_WINDOW_INTERVAL)
|
sleep(Constant.POP_WINDOW_INTERVAL)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@@ -46,11 +46,10 @@ object WeworkLoopImpl {
|
|||||||
LogUtils.d("当前在房间: ")
|
LogUtils.d("当前在房间: ")
|
||||||
getChatMessageList()
|
getChatMessageList()
|
||||||
if (mainLoopRunning) {
|
if (mainLoopRunning) {
|
||||||
// 如果不是等待回复状态,则返回主页
|
|
||||||
if (!WeworkController.waitingForReply) {
|
if (!WeworkController.waitingForReply) {
|
||||||
goHome()
|
goHome()
|
||||||
} else {
|
} else {
|
||||||
LogUtils.d("等待回复中,保持当前页面...")
|
// LogUtils.d("等待回复中,保持当前页面...")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
continue
|
continue
|
||||||
@@ -143,7 +142,7 @@ object WeworkLoopImpl {
|
|||||||
val childCount = item.parent?.parent?.parent?.childCount
|
val childCount = item.parent?.parent?.parent?.childCount
|
||||||
if (childCount == 4 || childCount == 5) {
|
if (childCount == 4 || childCount == 5) {
|
||||||
if (item.parent != null && item.parent.childCount > 1) {
|
if (item.parent != null && item.parent.childCount > 1) {
|
||||||
LogUtils.d("通讯录有红点")
|
// LogUtils.d("通讯录有红点")
|
||||||
AccessibilityUtil.performClick(item)
|
AccessibilityUtil.performClick(item)
|
||||||
val hasRecommendFriend = AccessibilityUtil.findOneByText(getRoot(), "可能的同事", exact = true, timeout = Constant.POP_WINDOW_INTERVAL)
|
val hasRecommendFriend = AccessibilityUtil.findOneByText(getRoot(), "可能的同事", exact = true, timeout = Constant.POP_WINDOW_INTERVAL)
|
||||||
if (hasRecommendFriend != null) {
|
if (hasRecommendFriend != null) {
|
||||||
@@ -184,7 +183,7 @@ object WeworkLoopImpl {
|
|||||||
LogUtils.d("未发现待添加客户")
|
LogUtils.d("未发现待添加客户")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LogUtils.v("通讯录无红点")
|
// LogUtils.v("通讯录无红点")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -584,7 +583,7 @@ object WeworkLoopImpl {
|
|||||||
if (!isAtHome()) { goHome() }
|
if (!isAtHome()) { goHome() }
|
||||||
|
|
||||||
if (logIndex++ % 30 == 0) {
|
if (logIndex++ % 30 == 0) {
|
||||||
LogUtils.d("读取首页聊天列表")
|
// LogUtils.d("读取首页聊天列表")
|
||||||
if (logIndex % 120 == 0) log("读取首页聊天列表")
|
if (logIndex % 120 == 0) log("读取首页聊天列表")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -626,7 +625,7 @@ object WeworkLoopImpl {
|
|||||||
//消息不一致
|
//消息不一致
|
||||||
return true
|
return true
|
||||||
} else {
|
} else {
|
||||||
LogUtils.v("未发现新消息或无提示消息")
|
// LogUtils.v("未发现新消息或无提示消息")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -637,7 +636,7 @@ object WeworkLoopImpl {
|
|||||||
//让企微切换页面使APP保持活跃
|
//让企微切换页面使APP保持活跃
|
||||||
goHomeTab("通讯录")
|
goHomeTab("通讯录")
|
||||||
goHomeTab("消息")
|
goHomeTab("消息")
|
||||||
LogUtils.d("检查最近列表")
|
//LogUtils.d("检查最近列表")
|
||||||
log("检查最近列表")
|
log("检查最近列表")
|
||||||
if (hasNewMessage()) {
|
if (hasNewMessage()) {
|
||||||
return false
|
return false
|
||||||
@@ -743,7 +742,7 @@ object WeworkLoopImpl {
|
|||||||
if (tvList[2].contains("(退出了外部群)|(移出了群聊)|(邀请你加入了)|(修改群名为)|(此群为外部群)|(加入了外部群)".toRegex())) {
|
if (tvList[2].contains("(退出了外部群)|(移出了群聊)|(邀请你加入了)|(修改群名为)|(此群为外部群)|(加入了外部群)".toRegex())) {
|
||||||
val interval = System.currentTimeMillis() / 1000 - SPUtils.getInstance("noTipMessage").getLong(tvList[0], 0)
|
val interval = System.currentTimeMillis() / 1000 - SPUtils.getInstance("noTipMessage").getLong(tvList[0], 0)
|
||||||
if (interval > 3600) {
|
if (interval > 3600) {
|
||||||
LogUtils.i("发现无提示消息: $tvList")
|
// LogUtils.i("发现无提示消息: $tvList")
|
||||||
log("发现无提示消息: $tvList")
|
log("发现无提示消息: $tvList")
|
||||||
if (AccessibilityUtil.performClick(item)) {
|
if (AccessibilityUtil.performClick(item)) {
|
||||||
//进入聊天页 下一步 getChatMessageList
|
//进入聊天页 下一步 getChatMessageList
|
||||||
@@ -753,11 +752,11 @@ object WeworkLoopImpl {
|
|||||||
SPUtils.getInstance("noTipMessage").put(tvList[0], System.currentTimeMillis() / 1000)
|
SPUtils.getInstance("noTipMessage").put(tvList[0], System.currentTimeMillis() / 1000)
|
||||||
return 1
|
return 1
|
||||||
} else {
|
} else {
|
||||||
LogUtils.v("发现无提示消息: $tvList 消息在 $interval 秒前已被查看")
|
// LogUtils.v("发现无提示消息: $tvList 消息在 $interval 秒前已被查看")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LogUtils.v("未发现无提示消息: ${tvList[1]}")
|
// LogUtils.v("未发现无提示消息: ${tvList[1]}")
|
||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -791,7 +790,7 @@ object WeworkLoopImpl {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if (SPUtils.getInstance("noSyncMessage").getString(title) != lastSyncMessage) {
|
if (SPUtils.getInstance("noSyncMessage").getString(title) != lastSyncMessage) {
|
||||||
LogUtils.e("发现不一致消息: $tvList $lastSyncMessage")
|
// LogUtils.e("发现不一致消息: $tvList $lastSyncMessage")
|
||||||
error("发现不一致消息: $tvList $lastSyncMessage")
|
error("发现不一致消息: $tvList $lastSyncMessage")
|
||||||
SPUtils.getInstance("noSyncMessage").put(title, lastSyncMessage)
|
SPUtils.getInstance("noSyncMessage").put(title, lastSyncMessage)
|
||||||
if (AccessibilityUtil.performClick(item)) {
|
if (AccessibilityUtil.performClick(item)) {
|
||||||
@@ -801,10 +800,10 @@ object WeworkLoopImpl {
|
|||||||
}
|
}
|
||||||
return 1
|
return 1
|
||||||
} else {
|
} else {
|
||||||
LogUtils.v("消息多次不一致: $tvList")
|
// LogUtils.v("消息多次不一致: $tvList")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LogUtils.v("未发现不一致消息: ${tvList[1]}")
|
// LogUtils.v("未发现不一致消息: ${tvList[1]}")
|
||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user