fix 客户名称过长识别问题
This commit is contained in:
@@ -143,8 +143,10 @@ fun getRoot(ignoreCheck: Boolean, share: Boolean = false): AccessibilityNodeInfo
|
||||
if (!share) {
|
||||
WeworkController.weworkService.currentPackage = root.packageName?.toString() ?: ""
|
||||
if (System.currentTimeMillis() % 30 == 0L) {
|
||||
LogUtils.e("当前不在企业微信: ${root.packageName}")
|
||||
error("当前不在企业微信: ${root.packageName}")
|
||||
if (!FloatWindowHelper.isPause) {
|
||||
LogUtils.e("当前不在企业微信: ${root.packageName}\n尝试跳转到企业微信")
|
||||
ToastUtils.show("当前不在企业微信: ${root.packageName}\n尝试跳转到企业微信")
|
||||
Utils.getApp().packageManager.getLaunchIntentForPackage(Constant.PACKAGE_NAMES)
|
||||
?.apply {
|
||||
|
||||
@@ -164,6 +164,7 @@ object WeworkLoopImpl {
|
||||
val roomType = WeworkRoomUtil.getRoomType()
|
||||
var titleList = WeworkRoomUtil.getRoomTitle()
|
||||
if (titleList.count { it.endsWith("…") } > 0) {
|
||||
LogUtils.d("title too long... try get full name")
|
||||
if (roomType == WeworkMessageBean.ROOM_TYPE_INTERNAL_CONTACT || roomType == WeworkMessageBean.ROOM_TYPE_EXTERNAL_CONTACT) {
|
||||
titleList = WeworkRoomUtil.getFriendName()
|
||||
} else if (Constant.fullGroupName
|
||||
|
||||
@@ -184,7 +184,7 @@ object WeworkRoomUtil {
|
||||
* @return true 成功进入好友详情页
|
||||
*/
|
||||
fun intoFriendDetail(): Boolean {
|
||||
if (AccessibilityUtil.findOneByText(getRoot(), "设置聊天背景") != null) {
|
||||
if (AccessibilityUtil.findOnceByText(getRoot(), "设置聊天背景") != null) {
|
||||
return true
|
||||
}
|
||||
//同群详情列表
|
||||
@@ -217,10 +217,13 @@ object WeworkRoomUtil {
|
||||
for (textView in tvList) {
|
||||
if (textView.text != null) {
|
||||
titleList.add(textView.text.toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
backPress()
|
||||
}
|
||||
}
|
||||
}
|
||||
LogUtils.d("获取好友名称成功 ${titleList.joinToString()}")
|
||||
} else {
|
||||
LogUtils.e("获取好友名称失败")
|
||||
}
|
||||
return titleList
|
||||
}
|
||||
@@ -251,7 +254,7 @@ object WeworkRoomUtil {
|
||||
*/
|
||||
private fun checkRoom(title: String, strict: Boolean = false): Boolean {
|
||||
LogUtils.d("checkRoom(): $title")
|
||||
val titleList = getRoomTitle(false)
|
||||
val titleList = getRoomTitle(print = false)
|
||||
val roomType = getRoomType()
|
||||
if (roomType != WeworkMessageBean.ROOM_TYPE_UNKNOWN
|
||||
&& (titleList.count {
|
||||
|
||||
Reference in New Issue
Block a user