update 精确匹配文案
This commit is contained in:
@@ -9,8 +9,8 @@ android {
|
|||||||
applicationId "org.yameida.worktool"
|
applicationId "org.yameida.worktool"
|
||||||
minSdkVersion 23
|
minSdkVersion 23
|
||||||
targetSdkVersion 30
|
targetSdkVersion 30
|
||||||
versionCode 221
|
versionCode 223
|
||||||
versionName "2.2.1"
|
versionName "2.2.3"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ object WeworkGetImpl {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (weworkMessageBean.groupName.isNullOrEmpty()) {
|
if (weworkMessageBean.groupName.isNullOrEmpty()) {
|
||||||
val groupNameTv = AccessibilityUtil.findOnceByText(getRoot(), "群聊名称")
|
val groupNameTv = AccessibilityUtil.findOnceByText(getRoot(), "群聊名称", exact = true)
|
||||||
if (groupNameTv != null) {
|
if (groupNameTv != null) {
|
||||||
val tvList = AccessibilityUtil.findAllOnceByClazz(
|
val tvList = AccessibilityUtil.findAllOnceByClazz(
|
||||||
groupNameTv.parent.parent.parent,
|
groupNameTv.parent.parent.parent,
|
||||||
@@ -175,14 +175,14 @@ object WeworkGetImpl {
|
|||||||
weworkMessageBean.groupOwner = tvOwnerName.text.toString()
|
weworkMessageBean.groupOwner = tvOwnerName.text.toString()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val tvCountFlag = AccessibilityUtil.findOnceByText(getRoot(), "查看全部群成员")
|
val tvCountFlag = AccessibilityUtil.findOnceByText(getRoot(), "查看全部群成员", exact = true)
|
||||||
val tvCount = AccessibilityUtil.findBackNode(tvCountFlag)
|
val tvCount = AccessibilityUtil.findBackNode(tvCountFlag)
|
||||||
if (tvCount != null && tvCount.text != null) {
|
if (tvCount != null && tvCount.text != null) {
|
||||||
LogUtils.d("群成员: " + tvCount.text)
|
LogUtils.d("群成员: " + tvCount.text)
|
||||||
val count = tvCount.text.toString().replace("人", "")
|
val count = tvCount.text.toString().replace("人", "")
|
||||||
weworkMessageBean.groupNumber = count.toIntOrNull()
|
weworkMessageBean.groupNumber = count.toIntOrNull()
|
||||||
}
|
}
|
||||||
val tvAnnouncementFlag = AccessibilityUtil.findOnceByText(getRoot(), "群公告")
|
val tvAnnouncementFlag = AccessibilityUtil.findOnceByText(getRoot(), "群公告", exact = true)
|
||||||
val tvAnnouncement = AccessibilityUtil.findBackNode(tvAnnouncementFlag)
|
val tvAnnouncement = AccessibilityUtil.findBackNode(tvAnnouncementFlag)
|
||||||
if (tvAnnouncement != null && tvAnnouncement.text != null) {
|
if (tvAnnouncement != null && tvAnnouncement.text != null) {
|
||||||
LogUtils.d("群公告: " + tvAnnouncement.text)
|
LogUtils.d("群公告: " + tvAnnouncement.text)
|
||||||
|
|||||||
@@ -185,7 +185,7 @@ object WeworkLoopImpl {
|
|||||||
//回到上一页
|
//回到上一页
|
||||||
var retry = 5
|
var retry = 5
|
||||||
while (retry-- > 0 && !isAtHome()) {
|
while (retry-- > 0 && !isAtHome()) {
|
||||||
val textView = AccessibilityUtil.findOnceByText(getRoot(), "新的客户", "新的居民")
|
val textView = AccessibilityUtil.findOnceByText(getRoot(), "新的客户", "新的居民", exact = true)
|
||||||
if (textView == null) {
|
if (textView == null) {
|
||||||
backPress()
|
backPress()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -225,7 +225,7 @@ object WeworkOperationImpl {
|
|||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||||
AccessibilityUtil.performClick(node)
|
AccessibilityUtil.performClick(node)
|
||||||
sleep(Constant.POP_WINDOW_INTERVAL)
|
sleep(Constant.POP_WINDOW_INTERVAL)
|
||||||
if (AccessibilityUtil.findOnceByText(getRoot(), "微盘") != null) {
|
if (AccessibilityUtil.findOnceByText(getRoot(), "微盘", exact = true) != null) {
|
||||||
AccessibilityUtil.clickByNode(WeworkController.weworkService, node)
|
AccessibilityUtil.clickByNode(WeworkController.weworkService, node)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -275,7 +275,7 @@ object WeworkOperationImpl {
|
|||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||||
AccessibilityUtil.performClick(node)
|
AccessibilityUtil.performClick(node)
|
||||||
sleep(Constant.POP_WINDOW_INTERVAL)
|
sleep(Constant.POP_WINDOW_INTERVAL)
|
||||||
if (AccessibilityUtil.findOnceByText(getRoot(), "微盘") != null) {
|
if (AccessibilityUtil.findOnceByText(getRoot(), "微盘", exact = true) != null) {
|
||||||
AccessibilityUtil.clickByNode(WeworkController.weworkService, node)
|
AccessibilityUtil.clickByNode(WeworkController.weworkService, node)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -406,7 +406,7 @@ object WeworkOperationImpl {
|
|||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||||
AccessibilityUtil.performClick(button)
|
AccessibilityUtil.performClick(button)
|
||||||
sleep(Constant.POP_WINDOW_INTERVAL)
|
sleep(Constant.POP_WINDOW_INTERVAL)
|
||||||
if (AccessibilityUtil.findOnceByText(list, "添加客户", "添加居民", "加微信") != null) {
|
if (AccessibilityUtil.findOnceByText(list, "添加客户", "添加居民", "加微信", exact = true) != null) {
|
||||||
AccessibilityUtil.clickByNode(WeworkController.weworkService, button)
|
AccessibilityUtil.clickByNode(WeworkController.weworkService, button)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -426,12 +426,12 @@ object WeworkOperationImpl {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
if (AccessibilityUtil.findOneByText(getRoot(), "标签", "电话") != null) {
|
if (AccessibilityUtil.findOneByText(getRoot(), "标签", "电话") != null) {
|
||||||
var markTv = AccessibilityUtil.findOnceByText(getRoot(), "设置备注和描述")
|
var markTv = AccessibilityUtil.findOnceByText(getRoot(), "设置备注和描述", exact = true)
|
||||||
if (markTv == null) {
|
if (markTv == null) {
|
||||||
markTv = AccessibilityUtil.findOnceByText(getRoot(), "企业")
|
markTv = AccessibilityUtil.findOnceByText(getRoot(), "企业", exact = true)
|
||||||
}
|
}
|
||||||
if (markTv == null) {
|
if (markTv == null) {
|
||||||
markTv = AccessibilityUtil.findOnceByText(getRoot(), "描述")
|
markTv = AccessibilityUtil.findOnceByText(getRoot(), "描述", exact = true)
|
||||||
}
|
}
|
||||||
//设置备注
|
//设置备注
|
||||||
if (markTv != null && (friend.markName != null
|
if (markTv != null && (friend.markName != null
|
||||||
@@ -480,7 +480,7 @@ object WeworkOperationImpl {
|
|||||||
LogUtils.d("发送添加邀请成功: " + friend.phone)
|
LogUtils.d("发送添加邀请成功: " + friend.phone)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (AccessibilityUtil.findOnceByText(getRoot(), "发消息") != null) {
|
if (AccessibilityUtil.findOnceByText(getRoot(), "发消息", exact = true) != null) {
|
||||||
LogUtils.e("已经添加联系人,请勿重复添加")
|
LogUtils.e("已经添加联系人,请勿重复添加")
|
||||||
} else {
|
} else {
|
||||||
LogUtils.e("未找到添加为联系人")
|
LogUtils.e("未找到添加为联系人")
|
||||||
@@ -603,7 +603,7 @@ object WeworkOperationImpl {
|
|||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||||
AccessibilityUtil.performClick(node)
|
AccessibilityUtil.performClick(node)
|
||||||
sleep(Constant.POP_WINDOW_INTERVAL)
|
sleep(Constant.POP_WINDOW_INTERVAL)
|
||||||
if (AccessibilityUtil.findOnceByText(getRoot(), "客户群", "居民群") != null) {
|
if (AccessibilityUtil.findOnceByText(getRoot(), "客户群", "居民群", exact = true) != null) {
|
||||||
if (AccessibilityUtil.clickByNode(WeworkController.weworkService, node)) {
|
if (AccessibilityUtil.clickByNode(WeworkController.weworkService, node)) {
|
||||||
LogUtils.d("进入客户群应用")
|
LogUtils.d("进入客户群应用")
|
||||||
val textView =
|
val textView =
|
||||||
@@ -805,7 +805,7 @@ object WeworkOperationImpl {
|
|||||||
private fun groupChangeAnnouncement(groupAnnouncement: String? = null): Boolean {
|
private fun groupChangeAnnouncement(groupAnnouncement: String? = null): Boolean {
|
||||||
if (groupAnnouncement == null) return true
|
if (groupAnnouncement == null) return true
|
||||||
if (WeworkRoomUtil.intoGroupManager()) {
|
if (WeworkRoomUtil.intoGroupManager()) {
|
||||||
val textView = AccessibilityUtil.findOneByText(getRoot(), "群公告")
|
val textView = AccessibilityUtil.findOneByText(getRoot(), "群公告", exact = true)
|
||||||
if (textView != null) {
|
if (textView != null) {
|
||||||
AccessibilityUtil.performClick(textView)
|
AccessibilityUtil.performClick(textView)
|
||||||
val editButton = AccessibilityUtil.findOneByText(getRoot(), "编辑", timeout = 2000, exact = true)
|
val editButton = AccessibilityUtil.findOneByText(getRoot(), "编辑", timeout = 2000, exact = true)
|
||||||
|
|||||||
Reference in New Issue
Block a user