Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] 支持规则延迟执行 #13

Closed
lisonge opened this issue Sep 5, 2023 · 1 comment
Closed

[feat] 支持规则延迟执行 #13

lisonge opened this issue Sep 5, 2023 · 1 comment

Comments

@lisonge
Copy link
Member

lisonge commented Sep 5, 2023

zfdang/Android-Touch-Helper#65 (comment) 得到的快照 https://gkd-kit.gitee.io/import/12522881 为例

使用如下规则点击广告弹窗右上角x图标,大概率误触广告导致直接跳转APP

{
  id: 'com.miaoying.appmy.cs',
  name: '新小财神影视',
  groups: [
    {
      key: 0,
      name: '内部广告',
      activityIds: [
        'com.miaoying.appmy.cs.MainActivity',
        'com.miui.home.launcher.Launcher',
      ],
      rules: [
        {
          matches: [
            'TextView[text="立即抢购"]',
            'ImageView + FrameLayout + @FrameLayout > ImageView',
          ],
          snapshotUrls: 'https://gkd-kit.gitee.io/import/12522881',
        },
      ],
    },
  ],
}

控制台输出

args[0] = TextView[text='立即抢购']
args[1] = ImageView + FrameLayout + @FrameLayout > ImageView
args[2] = AttrInfo(id=null, name=android.widget.FrameLayout, text=null, desc=null, clickable=false, focusable=false, checkable=false, checked=false, visibleToUser=true, left=1048, top=496, right=1108, bottom=556, width=60, height=60, index=2, depth=6, childCount=1)
args[3] = (50%, 50%)

可以发现实际点击节点 top=496 ,而快照中的是 top=414

猜测是由于弹窗在播放动画的时候节点信息已经完全匹配,发起点击的同时弹窗动画也在持续,由于节点全部都是不可点击,APP 使用屏幕坐标点击,导致点击的时候位置发生了变换点击到了弹窗触发了广告

也可能是弹窗的点击关闭事件是在动画关闭之后添加的,导致提前点击触发的是广告跳转

@lisonge
Copy link
Member Author

lisonge commented Sep 9, 2023

@lisonge lisonge closed this as completed Sep 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant