update 发表朋友圈任务
This commit is contained in:
@@ -22,6 +22,8 @@ object Constant {
|
|||||||
var autoReply = SPUtils.getInstance().getInt("autoReply", 1)
|
var autoReply = SPUtils.getInstance().getInt("autoReply", 1)
|
||||||
var groupStrict = false
|
var groupStrict = false
|
||||||
var friendRemarkStrict = false
|
var friendRemarkStrict = false
|
||||||
|
var pushImage = false
|
||||||
|
var autoPublishComment = false
|
||||||
var robotId: String
|
var robotId: String
|
||||||
get() = SPUtils.getInstance().getString("robotId", SPUtils.getInstance().getString("LISTEN_CHANNEL_ID", ""))
|
get() = SPUtils.getInstance().getString("robotId", SPUtils.getInstance().getString("LISTEN_CHANNEL_ID", ""))
|
||||||
set(value) {
|
set(value) {
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ object WeworkLoopImpl {
|
|||||||
mainLoopRunning = true
|
mainLoopRunning = true
|
||||||
try {
|
try {
|
||||||
while (mainLoopRunning) {
|
while (mainLoopRunning) {
|
||||||
if (!isAtHome() && WeworkRoomUtil.getRoomType(false) != WeworkMessageBean.ROOM_TYPE_UNKNOWN) {
|
if (!isAtHome()) {
|
||||||
LogUtils.d("当前在房间: ")
|
LogUtils.d("当前在房间: ")
|
||||||
getChatMessageList()
|
getChatMessageList()
|
||||||
if (mainLoopRunning) {
|
if (mainLoopRunning) {
|
||||||
@@ -116,7 +116,7 @@ object WeworkLoopImpl {
|
|||||||
if (titleList.contains("对方正在输入…")) {
|
if (titleList.contains("对方正在输入…")) {
|
||||||
titleList = WeworkRoomUtil.getFriendName()
|
titleList = WeworkRoomUtil.getFriendName()
|
||||||
}
|
}
|
||||||
if (titleList.size > 0) {
|
if (roomType != WeworkMessageBean.ROOM_TYPE_UNKNOWN && titleList.size > 0) {
|
||||||
val title = titleList.joinToString()
|
val title = titleList.joinToString()
|
||||||
LogUtils.v("聊天: $title")
|
LogUtils.v("聊天: $title")
|
||||||
log("聊天: $title")
|
log("聊天: $title")
|
||||||
@@ -208,6 +208,20 @@ object WeworkLoopImpl {
|
|||||||
LogUtils.e("未找到聊天消息列表")
|
LogUtils.e("未找到聊天消息列表")
|
||||||
error("未找到聊天消息列表")
|
error("未找到聊天消息列表")
|
||||||
}
|
}
|
||||||
|
} else if (Constant.autoPublishComment && WeworkController.weworkService.currentClass == "com.tencent.wework.moments.controller.MomentsIndexListActivity") {
|
||||||
|
LogUtils.d("自动发表朋友圈")
|
||||||
|
val tvGoPublish = AccessibilityUtil.findOneByText(getRoot(), "去发表", exact = true)
|
||||||
|
if (tvGoPublish != null) {
|
||||||
|
AccessibilityUtil.performClick(tvGoPublish)
|
||||||
|
AccessibilityExtraUtil.loadingPage("MomentsEnterpriseNotificationListActivity")
|
||||||
|
val tvPublishList = AccessibilityUtil.findAllByText(getRoot(), "发表", exact = true)
|
||||||
|
LogUtils.d("发现${tvPublishList.size}条待发送")
|
||||||
|
for (tvPublish in tvPublishList) {
|
||||||
|
AccessibilityUtil.performClick(tvPublish)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
LogUtils.v("退出非聊天房间 ${WeworkController.weworkService.currentClass}")
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@@ -454,7 +468,7 @@ object WeworkLoopImpl {
|
|||||||
}
|
}
|
||||||
if (SPUtils.getInstance("noSyncMessage").getString(title) != lastSyncMessage) {
|
if (SPUtils.getInstance("noSyncMessage").getString(title) != lastSyncMessage) {
|
||||||
LogUtils.e("发现不一致消息: $tvList")
|
LogUtils.e("发现不一致消息: $tvList")
|
||||||
error("发现不一致消息: $tvList")
|
error("发现不一致消息: $tvList $lastSyncMessage")
|
||||||
SPUtils.getInstance("noSyncMessage").put(title, lastSyncMessage)
|
SPUtils.getInstance("noSyncMessage").put(title, lastSyncMessage)
|
||||||
if (AccessibilityUtil.performClick(item)) {
|
if (AccessibilityUtil.performClick(item)) {
|
||||||
//进入聊天页 下一步 getChatMessageList
|
//进入聊天页 下一步 getChatMessageList
|
||||||
@@ -523,7 +537,7 @@ object WeworkLoopImpl {
|
|||||||
}
|
}
|
||||||
message = WeworkMessageBean.SubMessageBean(0, textType, itemMessageList, nameList)
|
message = WeworkMessageBean.SubMessageBean(0, textType, itemMessageList, nameList)
|
||||||
//图片类型特殊处理
|
//图片类型特殊处理
|
||||||
if (textType == 2) {
|
if (Constant.pushImage && textType == 2) {
|
||||||
val lastPicCreateTime = MultiFileObserver.lastPicCreateTime
|
val lastPicCreateTime = MultiFileObserver.lastPicCreateTime
|
||||||
val lastPicPath = MultiFileObserver.lastPicPath
|
val lastPicPath = MultiFileObserver.lastPicPath
|
||||||
LogUtils.d("发现图片类型应该点击")
|
LogUtils.d("发现图片类型应该点击")
|
||||||
|
|||||||
Reference in New Issue
Block a user