Skip to content

Commit

Permalink
update 兼容群名获取
Browse files Browse the repository at this point in the history
  • Loading branch information
gallonyin committed Sep 11, 2023
1 parent cb2e640 commit 3d0f235
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,11 @@ object WeworkGetImpl {
val weworkMessageBean = WeworkMessageBean()
weworkMessageBean.type = WeworkMessageBean.GET_GROUP_INFO
val tvManagerFlag = AccessibilityUtil.findOneByText(getRoot(), "全部群成员", "微信用户创建", timeout = 2000)
if (tvManagerFlag != null && tvManagerFlag.text.contains("微信用户创建")) {
val button = AccessibilityUtil.findFrontNode(tvManagerFlag)
if (tvManagerFlag?.text?.toString()?.contains("微信用户创建") == true) {
var button = AccessibilityUtil.findFrontNode(tvManagerFlag)
if (button?.className == Views.ImageView) {
button = AccessibilityUtil.findFrontNode(button)
}
val tvGroupName = AccessibilityUtil.findOnceByClazz(button, Views.TextView)
if (tvGroupName != null && tvGroupName.text != null) {
LogUtils.d("群名: " + tvGroupName.text)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2286,7 +2286,7 @@ object WeworkOperationImpl {
if (WeworkRoomUtil.intoGroupManager()) {
val textView = AccessibilityUtil.findOneByText(getRoot(), "全部群成员", "微信用户创建")
?: return false
if (textView.text.contains("微信用户创建")) {
if (textView.text?.toString()?.contains("微信用户创建") == true) {
var button = AccessibilityUtil.findFrontNode(textView)
if (button?.className == Views.ImageView) {
button = AccessibilityUtil.findFrontNode(button)
Expand Down Expand Up @@ -3087,7 +3087,7 @@ object WeworkOperationImpl {
(WeworkRoomUtil.intoRoom(groupName) && WeworkRoomUtil.intoGroupManager())) {
val tvList = AccessibilityUtil.findAllOnceByClazz(getRoot(), Views.TextView)
tvList.forEachIndexed { index, tv ->
if (tv.text != null && tv.text.contains("微信用户创建")) {
if (tv.text?.toString()?.contains("微信用户创建") == true) {
if (index + 1 < tvList.size) {
val tvQr = tvList[index + 1]
AccessibilityUtil.performClick(tvQr)
Expand Down

0 comments on commit 3d0f235

Please sign in to comment.