feat(百度贴吧): 规则优化 (#544)

* 优化规则

* chore(百度贴吧): 移除k=4规则组

---------

Co-authored-by: lisonge <i@songe.li>
This commit is contained in:
Kun Jinkao
2023-10-02 23:37:02 +08:00
committed by GitHub
parent 67f7bf0cdc
commit 006a5b1252

View File

@@ -13,19 +13,29 @@ export default defineAppConfig({
'com.baidu.tieba.pb.pb.main.PbActivity', 'com.baidu.tieba.pb.pb.main.PbActivity',
], ],
rules: [ rules: [
'TextView[text*=`广告`] - TextView[text^=`跳过`]',
'[id=`com.kwad.dy.sdk:id/ksad_splash_circle_skip_view`] TextView[text=`跳过`]',
'[id=`com.byted.pangle:id/tt_splash_skip_btn`]',
{ {
key: 0,
matches:
'[id="com.kwad.dy.sdk:id/ksad_splash_circle_skip_view"] TextView[text="跳过"]', // 需要补充快照
},
{ key: 1, matches: '[id="com.byted.pangle:id/tt_splash_skip_btn"]' }, // 需要补充快照
{
key: 2,
matches: 'TextView[text*="广告"] - TextView[text^="跳过"]',
snapshotUrls: 'https://gkd-kit.songe.li/import/12775906',
},
{
key: 3,
matches: '@TextView[text="跳过"] + TextView[text.length=1]', matches: '@TextView[text="跳过"] + TextView[text.length=1]',
snapshotUrls: 'https://gkd-kit.gitee.io/import/12566191', snapshotUrls: ['https://gkd-kit.gitee.io/import/12566191'],
}, },
], ],
}, },
{ {
key: 1, key: 1,
name: '任意界面-选择不喜欢理由-不感兴趣', name: '任意界面-选择不喜欢理由-不感兴趣',
rules: '@View[text=null] - TextView[text=`选择不喜欢理由`][index=0]', rules: '@View[text=null] - TextView[text="选择不喜欢理由"][index=0]',
snapshotUrls: 'https://gkd-kit.songe.li/import/12775914',
}, },
{ {
key: 2, key: 2,
@@ -35,7 +45,12 @@ export default defineAppConfig({
'com.baidu.tieba.frs.FrsActivity', 'com.baidu.tieba.frs.FrsActivity',
], ],
rules: [ rules: [
'ImageView < @FrameLayout < LinearLayout < RelativeLayout <n LinearLayout < RelativeLayout + LinearLayout > RelativeLayout > TextView[text$=`广告`]', {
key: 0,
matches:
'TextView[text$="广告"] < RelativeLayout <n LinearLayout - RelativeLayout > LinearLayout > FrameLayout +n RelativeLayout > LinearLayout',
snapshotUrls: 'https://gkd-kit.songe.li/import/12775930',
},
], ],
}, },
{ {
@@ -47,23 +62,37 @@ export default defineAppConfig({
'com.baidu.tieba.pb.pb.main.PbActivity', 'com.baidu.tieba.pb.pb.main.PbActivity',
], ],
rules: rules:
'TextView[text=`广告`] <n FrameLayout <n LinearLayout - RelativeLayout @FrameLayout > ImageView', 'TextView[text=`广告`] <n FrameLayout <n LinearLayout - RelativeLayout @FrameLayout > ImageView', // 需要补充快照
},
{
key: 4,
name: '帖子评论区内部广告卡片',
activityIds: 'com.baidu.tieba.frs.FrsActivity',
rules:
'ImageView < @FrameLayout < LinearLayout < RelativeLayout <n LinearLayout < RelativeLayout + LinearLayout[id=`com.baidu.tieba:id/obfuscated`] TextView[text=`广告`]',
}, },
// key=4 的规则组已经删除, 后续不可添加 key=4 的规则组
{ {
key: 5, key: 5,
name: '帖子评论区广告卡片', name: '帖子评论区广告卡片',
activityIds: 'com.baidu.tieba.pb.pb.main.PbActivity', activityIds: [
'com.baidu.tieba.pb.pb.main.PbActivity',
'com.baidu.tieba.frs.FrsActivity',
],
rules: [ rules: [
'TextView[text=`广告`] <n FrameLayout +n RelativeLayout[id=`com.baidu.tieba:id/obfuscated`] ImageView', {
'TextView[text$=`广告`] +n FrameLayout[id=`com.baidu.tieba:id/obfuscated`] ImageView[id=null]', key: 0,
'TextView[text$=`广告`] < RelativeLayout <n LinearLayout - RelativeLayout ImageView[id=null][desc=null]', matches:
'TextView[text="广告"] <n FrameLayout +n RelativeLayout[id="com.baidu.tieba:id/obfuscated"] >n ImageView',
},
{
key: 1,
matches:
'TextView[text$="广告"] +n FrameLayout[id="com.baidu.tieba:id/obfuscated"] >n ImageView[id=null]',
snapshotUrls: 'https://gkd-kit.songe.li/import/12775913',
},
{
key: 2,
matches:
'TextView[text$="广告"] < RelativeLayout <n LinearLayout - RelativeLayout >n @FrameLayout > ImageView[id=null][desc=null]',
snapshotUrls: [
'https://gkd-kit.songe.li/import/12775916',
'https://gkd-kit.songe.li/import/12775892', // 指定点击目标为具备 clickable=true 属性的 @FrameLayout防止在这个快照误触点击收藏
],
},
], ],
}, },
{ {
@@ -81,5 +110,13 @@ export default defineAppConfig({
rules: '[text="稍后再说"]', rules: '[text="稍后再说"]',
snapshotUrls: 'https://gkd-kit.gitee.io/import/12496934', snapshotUrls: 'https://gkd-kit.gitee.io/import/12496934',
}, },
{
key: 8,
name: '帖子底部广告卡片',
activityIds: 'com.baidu.tieba.pb.pb.main.PbActivity',
rules:
'LinearLayout > RelativeLayout > ImageView[id=null][clickable=true]',
snapshotUrls: 'https://gkd-kit.songe.li/import/12775882',
},
], ],
}); });