update 自动群发
This commit is contained in:
@@ -346,6 +346,37 @@ object WeworkLoopImpl {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (titleList.size > 0) {
|
||||||
|
val title = titleList[0]
|
||||||
|
if (title == "群发助手") {
|
||||||
|
LogUtils.d("使用功能: 群发助手")
|
||||||
|
val list = AccessibilityUtil.findOneByClazz(getRoot(), Views.ListView)
|
||||||
|
if (list != null) {
|
||||||
|
val childCount = list.childCount
|
||||||
|
for (i in 0 until list.childCount) {
|
||||||
|
val item = list.getChild(childCount - 1 - i)
|
||||||
|
if (item != null && item.childCount > 0) {
|
||||||
|
LogUtils.d("点击群发")
|
||||||
|
AccessibilityUtil.printNodeClazzTree(item)
|
||||||
|
AccessibilityUtil.clickByNode(WeworkController.weworkService, AccessibilityUtil.findOnceByClazz(item, Views.FrameLayout))
|
||||||
|
if (AccessibilityExtraUtil.loadingPage("EnterpriseCustomerEnterpriseMassMessageDetailActivity")) {
|
||||||
|
AccessibilityUtil.findOneByText(getRoot(), "发送")
|
||||||
|
if (AccessibilityUtil.findOnceByText(getRoot(), "已发送", exact = true) != null) {
|
||||||
|
LogUtils.d("该条群发已发送")
|
||||||
|
backPress()
|
||||||
|
} else {
|
||||||
|
if (AccessibilityUtil.findTextAndClick(getRoot(), "发送", exact = true)) {
|
||||||
|
LogUtils.d("发送该条群发")
|
||||||
|
AccessibilityUtil.findOneByText(getRoot(), "已发送", exact = true)
|
||||||
|
}
|
||||||
|
backPress()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
LogUtils.v("退出非聊天房间 ${WeworkController.weworkService.currentClass}")
|
LogUtils.v("退出非聊天房间 ${WeworkController.weworkService.currentClass}")
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
|||||||
@@ -29,13 +29,13 @@ object AccessibilityExtraUtil {
|
|||||||
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) {
|
||||||
Log.v(tag, "loadingPage: $clazzList")
|
Log.v(tag, "loadingPage: ${clazzList.joinToString()}")
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
sleep(SHORT_INTERVAL)
|
sleep(SHORT_INTERVAL)
|
||||||
currentTime = System.currentTimeMillis()
|
currentTime = System.currentTimeMillis()
|
||||||
}
|
}
|
||||||
Log.e(tag, "loadingPage: not found: $clazzList current: ${service.currentClass}")
|
Log.e(tag, "loadingPage: not found: ${clazzList.joinToString()} current: ${service.currentClass}")
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,4 +15,5 @@ public class Views {
|
|||||||
public static String ProgressBar = "android.widget.ProgressBar";
|
public static String ProgressBar = "android.widget.ProgressBar";
|
||||||
public static String ScrollView = "android.widget.ScrollView";
|
public static String ScrollView = "android.widget.ScrollView";
|
||||||
public static String CheckBox = "android.widget.CheckBox";
|
public static String CheckBox = "android.widget.CheckBox";
|
||||||
|
public static String FrameLayout = "android.widget.FrameLayout";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user