update 优化字符串匹配
This commit is contained in:
@@ -190,11 +190,11 @@ object WeworkLoopImpl {
|
|||||||
}
|
}
|
||||||
AccessibilityUtil.findTextAndClick(getRoot(), "通过验证")
|
AccessibilityUtil.findTextAndClick(getRoot(), "通过验证")
|
||||||
var textNode = AccessibilityUtil.findOneByText(getRoot(), "完成", "发消息", "添加请求已过期,添加失败", exact = true)
|
var textNode = AccessibilityUtil.findOneByText(getRoot(), "完成", "发消息", "添加请求已过期,添加失败", exact = true)
|
||||||
if (textNode?.text == "完成") {
|
if (textNode?.text?.toString() == "完成") {
|
||||||
AccessibilityUtil.performClick(textNode)
|
AccessibilityUtil.performClick(textNode)
|
||||||
}
|
}
|
||||||
textNode = AccessibilityUtil.findOneByText(getRoot(), "发消息", "添加请求已过期,添加失败", exact = true)
|
textNode = AccessibilityUtil.findOneByText(getRoot(), "发消息", "添加请求已过期,添加失败", exact = true)
|
||||||
if (textNode?.text == "添加请求已过期,添加失败") {
|
if (textNode?.text?.toString() == "添加请求已过期,添加失败") {
|
||||||
LogUtils.d("添加好友失败")
|
LogUtils.d("添加好友失败")
|
||||||
} else {
|
} else {
|
||||||
val weworkMessageBean = WeworkMessageBean()
|
val weworkMessageBean = WeworkMessageBean()
|
||||||
|
|||||||
@@ -1615,7 +1615,7 @@ object WeworkOperationImpl {
|
|||||||
if (AccessibilityUtil.findTextInput(getRoot(), content, append = append)) {
|
if (AccessibilityUtil.findTextInput(getRoot(), content, append = append)) {
|
||||||
AccessibilityUtil.findOneByText(getRoot(), "发送", exact = true, timeout = 2000)
|
AccessibilityUtil.findOneByText(getRoot(), "发送", exact = true, timeout = 2000)
|
||||||
val sendButton = AccessibilityUtil.findAllByClazz(getRoot(), Views.Button)
|
val sendButton = AccessibilityUtil.findAllByClazz(getRoot(), Views.Button)
|
||||||
.firstOrNull { it.text == "发送" }
|
.firstOrNull { it.text?.toString() == "发送" }
|
||||||
if (sendButton != null) {
|
if (sendButton != null) {
|
||||||
LogUtils.d("发送消息: \n$content")
|
LogUtils.d("发送消息: \n$content")
|
||||||
log("发送消息: \n$content")
|
log("发送消息: \n$content")
|
||||||
@@ -1808,7 +1808,7 @@ object WeworkOperationImpl {
|
|||||||
val text = child.text
|
val text = child.text
|
||||||
val selected = child.isSelected
|
val selected = child.isSelected
|
||||||
LogUtils.v("text: $text selected: $selected")
|
LogUtils.v("text: $text selected: $selected")
|
||||||
if (tagList.count { it == text } > 0) {
|
if (tagList.count { it == text?.toString() } > 0) {
|
||||||
if (!selected) {
|
if (!selected) {
|
||||||
AccessibilityUtil.performClick(child)
|
AccessibilityUtil.performClick(child)
|
||||||
}
|
}
|
||||||
@@ -1824,7 +1824,7 @@ object WeworkOperationImpl {
|
|||||||
sleep(Constant.POP_WINDOW_INTERVAL)
|
sleep(Constant.POP_WINDOW_INTERVAL)
|
||||||
//可能有两次确定 另一次为添加新tag
|
//可能有两次确定 另一次为添加新tag
|
||||||
val textNode = AccessibilityUtil.findOneByText(getRoot(), "确定", "个人信息")
|
val textNode = AccessibilityUtil.findOneByText(getRoot(), "确定", "个人信息")
|
||||||
if (textNode?.text == "确定") {
|
if (textNode?.text?.toString() == "确定") {
|
||||||
AccessibilityUtil.performClick(textNode)
|
AccessibilityUtil.performClick(textNode)
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
|
|||||||
Reference in New Issue
Block a user