Skip to content

Commit

Permalink
feat: 规则维护更新 (#268)
Browse files Browse the repository at this point in the history
* feat(百度贴吧): 帖子推广

* feat(微信): 自动查看原图/原视频

* feat(PU口袋校园): 弹窗广告

* feat(百度贴吧): 信息流广告, 帖子底部浮窗广告

* feat(QQ音乐): 高品质音质弹窗

* feat(PU口袋校园): 弹窗广告

* feat(QQ): 弹窗广告

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
aoguai and github-actions[bot] authored Sep 8, 2024
1 parent a4218de commit f2d7df4
Show file tree
Hide file tree
Showing 5 changed files with 141 additions and 64 deletions.
157 changes: 104 additions & 53 deletions src/apps/com.baidu.tieba.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,54 +23,98 @@ export default defineGkdApp({
{
key: 2,
name: '分段广告-信息流广告',
desc: '推荐帖子列表, 评论区列表, 关闭时弹窗选原因',
desc: '关闭广告、直播推广',
enable: false,
fastQuery: true,
forcedTime: 10000,
activityIds: [
'com.baidu.tieba.pb.pb.main.PbActivity',
'com.baidu.tieba.frs.FrsActivity',
'com.baidu.tieba.tblauncher.MainTabActivity',
'com.baidu.tieba.forum.ForumActivity',
],
rules: [
{
key: 0,
name: '点击广告【x】',
matches: [
'RelativeLayout > TextView[text$="广告"][clickable=true]',
'LinearLayout[clickable=true][childCount=1] > @FrameLayout[clickable=true][childCount=1][desc=null] > ImageView',
activityIds: [
'com.baidu.tieba.tblauncher.MainTabActivity',
'com.baidu.tieba.forum.ForumActivity',
],
matches:
'@ImageView[clickable=true][visibleToUser=true] <(1,2) LinearLayout <4 RelativeLayout +2 RelativeLayout >2 [text="直播中"]',
snapshotUrls: [
'https://i.gkd.li/import/12775913', // 此3条应算卡片式广告
'https://i.gkd.li/import/13043133', // 此3条应算卡片式广告
'https://i.gkd.li/import/13054256', // 此3条应算卡片式广告
'https://i.gkd.li/import/12775930',
'https://i.gkd.li/import/12840951',
'https://i.gkd.li/import/12775916',
'https://i.gkd.li/import/12775892', // 指定点击目标为具备 clickable=true 属性的 @FrameLayout,防止在这个快照误触点击收藏
'https://i.gkd.li/import/13328300', // 指定点击目标为具备 desc=null 属性的 @FrameLayout,防止在这个快照误触点击【更多】
'https://i.gkd.li/import/13402610', // 指定LinearLayout[clickable=true] 、 activityIds: 'com.baidu.tieba.forum.ForumActivity',
'https://i.gkd.li/import/13459289',
'https://i.gkd.li/i/16595137',
'https://i.gkd.li/i/16596473',
],
},
{
key: 1,
fastQuery: true,
activityIds: [
'com.baidu.tieba.forum.ForumActivity',
'com.baidu.tieba.pb.pb.main.PbActivity',
'com.baidu.tieba.tblauncher.MainTabActivity',
],
matches:
'@FrameLayout[clickable=true][visibleToUser=true] < LinearLayout < RelativeLayout <3 LinearLayout < RelativeLayout + LinearLayout >2 [text$="广告"]',
snapshotUrls: [
'https://i.gkd.li/i/16595127',
'https://i.gkd.li/i/16595515',
'https://i.gkd.li/i/16596130',
],
},
{
key: 2,
activityIds: 'com.baidu.tieba.pb.pb.main.PbActivity',
matches:
'@FrameLayout[clickable=true][visibleToUser=true] < LinearLayout < FrameLayout -(1,2) [text$="广告"]',
snapshotUrls: [
'https://i.gkd.li/i/16595120',
'https://i.gkd.li/i/16595133',
],
},
{
key: 3,
activityIds: 'com.baidu.tieba.pb.pb.main.PbActivity',
matches:
'@ImageView[clickable=true][visibleToUser=true] -3 [text="直播中"]',
snapshotUrls: 'https://i.gkd.li/i/16596210',
},
{
key: 4,
activityIds: 'com.baidu.tieba.pb.pb.main.PbActivity',
matches:
'@[clickable=true][vid="obfuscated"][visibleToUser=true] <(1,2) RelativeLayout <(1,4) RelativeLayout[childCount>1] >(3,4) [text="广告"]',
snapshotUrls: [
'https://i.gkd.li/i/16595124',
'https://i.gkd.li/i/16596297',
'https://i.gkd.li/i/16632851', // [childCount>1] 防止误触
],
},
{
key: 5,
activityIds: [
'com.baidu.tieba.tblauncher.MainTabActivity',
'com.baidu.tieba.pb.pb.main.PbActivity',
'com.baidu.tieba.forum.ForumActivity',
'com.baidu.tieba.tblauncher.MainTabActivity',
],
matches:
'@FrameLayout[clickable=true] <n RelativeLayout + * [text="广告"]',
'@FrameLayout[clickable=true][visibleToUser=true] <4 RelativeLayout + FrameLayout >7 [text="广告"]',
snapshotUrls: [
'https://i.gkd.li/i/16038470',
'https://i.gkd.li/i/16038471',
'https://i.gkd.li/i/16038472',
'https://i.gkd.li/i/16595301',
'https://i.gkd.li/i/16596195',
'https://i.gkd.li/i/16596775',
],
},
{
preKeys: [0, 1],
preKeys: [0, 1, 2, 3, 4, 5],
key: 10,
name: '关闭原因-【不感兴趣】',
activityIds: [
'com.baidu.tieba.tblauncher.MainTabActivity',
'com.baidu.tieba.pb.pb.main.PbActivity',
'com.baidu.tieba.forum.ForumActivity',
],
matches:
'@View[text=null] - TextView[text="选择不喜欢理由"][index=0]',
snapshotUrls: 'https://i.gkd.li/import/12775914',
'@View[clickable=true][visibleToUser=true] - [text^="选择不喜欢"]',
snapshotUrls: [
'https://i.gkd.li/i/16595134',
'https://i.gkd.li/i/16595511',
'https://i.gkd.li/i/16595113',
],
},
],
},
Expand All @@ -92,28 +136,6 @@ export default defineGkdApp({
},
],
},
{
key: 8,
name: '分段广告-帖子底部内容推荐卡片',
desc: '关闭时弹窗选原因',
enable: false,
activityIds: 'com.baidu.tieba.pb.pb.main.PbActivity',
rules: [
{
key: 0,
matches:
'LinearLayout > RelativeLayout[id!=null][clickable=false] > ImageView[id=null][clickable=true]',
snapshotUrls: 'https://i.gkd.li/import/12775882',
},
{
preKeys: 0,
name: '关闭原因-不感兴趣',
matches:
'@View[text=null] - TextView[text="选择不喜欢理由"][index=0]',
snapshotUrls: 'https://i.gkd.li/import/12775914',
},
],
},
{
key: 9,
name: '全屏广告-广告弹窗',
Expand Down Expand Up @@ -226,11 +248,15 @@ export default defineGkdApp({
name: '局部广告-帖子底部浮窗广告',
activityIds: 'com.baidu.tieba.pb.pb.main.PbActivity',
rules:
'View + @ImageView[clickable=true] <<6 RelativeLayout[childCount>2] > ImageView[clickable=false]',
'* + @ImageView[clickable=true] <<(6,7,8) RelativeLayout[childCount>=2] > [name="android.widget.LinearLayout"||name="android.widget.ImageView"][index=1][clickable=false]',
snapshotUrls: [
'https://i.gkd.li/import/13322337',
'https://i.gkd.li/import/13328738',
'https://i.gkd.li/i/14571741',
'https://i.gkd.li/i/14586847',
'https://i.gkd.li/i/16595234',
'https://i.gkd.li/i/16619736',
'https://i.gkd.li/i/16647874',
],
},
{
Expand Down Expand Up @@ -265,5 +291,30 @@ export default defineGkdApp({
},
],
},
{
key: 13,
name: '局部广告-帖子推广',
desc: '关闭首页、吧内游戏推广帖子',
rules: [
{
fastQuery: true,
activityIds: [
'com.baidu.tieba.forum.ForumActivity',
'com.baidu.tieba.tblauncher.MainTabActivity',
],
// 防止误触标题以“游戏”开头的帖子,此页面推广帖子和正常帖子节点没有区别;[childCount=2]区分是否在热门页面
excludeMatches: 'RelativeLayout[childCount=2] > [text="热门"]',
matches:
'@ImageView[clickable=true][visibleToUser=true] < LinearLayout <4 RelativeLayout + FrameLayout > [text^="游戏"]',
snapshotUrls: [
'https://i.gkd.li/i/16828309',
'https://i.gkd.li/i/16828230',
'https://i.gkd.li/i/16828318',
'https://i.gkd.li/i/16828401',
'https://i.gkd.li/i/16828436',
],
},
],
},
],
});
14 changes: 10 additions & 4 deletions src/apps/com.tencent.mm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,15 +320,21 @@ export default defineGkdApp({
},
{
key: 9,
name: '功能类-自动查看原图',
desc: '自动点击底部左侧[查看原图]按钮',
name: '功能类-自动查看原图/原视频',
desc: '自动点击[查看原图]/[查看原视频]按钮',
enable: false,
fastQuery: true,
activityIds: 'com.tencent.mm.ui.chatting.gallery.ImageGalleryUI',
rules: '[text^="查看原图"][clickable=true]',
activityIds: '.ui.chatting.gallery.ImageGalleryUI',
rules: {
anyMatches: [
'[text^="查看原图"][clickable=true][visibleToUser=true]',
'[text^="查看原视频"][clickable=true][visibleToUser=true]',
],
},
snapshotUrls: [
'https://i.gkd.li/import/13523031',
'https://i.gkd.li/i/14661736',
'https://i.gkd.li/i/16833732',
],
},
{
Expand Down
11 changes: 8 additions & 3 deletions src/apps/com.tencent.mobileqq.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,20 @@ export default defineGkdApp({
key: 3,
matchTime: 10000,
actionMaximum: 1,
resetMatch: 'app',
resetMatch: 'activity',
name: '推广游戏广告弹窗',
activityIds:
activityIds: [
'com.tencent.mobileqq.activity.QPublicTransFragmentActivity',
matches:
'cooperation.vip.ad.UserLeadingActivity',
],
anyMatches: [
'ViewGroup[childCount=2] > ViewGroup[childCount=3][index=1] > ViewGroup[clickable=true][visibleToUser=true][index=1][childCount=0]',
'Button[text.length>0][visibleToUser=true] < * -n * > [text*="欢迎回来"][visibleToUser=true] +n ImageView[visibleToUser=true]',
],
snapshotUrls: [
'https://i.gkd.li/import/13797876',
'https://i.gkd.li/i/15981784',
'https://i.gkd.li/i/16922256',
],
},
{
Expand Down
10 changes: 9 additions & 1 deletion src/apps/com.tencent.qqmusic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export default defineGkdApp({
},
{
key: 5,
name: '全屏广告-推荐开启高品质音质弹窗',
name: '全屏广告-高品质音质弹窗',
desc: '点击关闭',
enable: false,
rules: [
Expand All @@ -141,6 +141,14 @@ export default defineGkdApp({
'[text^="推荐您开启臻品音质"] -3 [desc="关闭"][clickable=true]',
snapshotUrls: 'https://i.gkd.li/i/14549936',
},
{
key: 1,
activityIds:
'com.tencent.qqmusic.business.playernew.view.NewPlayerActivity',
matches:
'[id="android:id/content"] >4 FrameLayout[childCount=6] > FrameLayout[childCount=1][text=null][index=1] > ImageView[visibleToUser=true][childCount=0]',
snapshotUrls: 'https://i.gkd.li/i/16914135',
},
],
},
{
Expand Down
13 changes: 10 additions & 3 deletions src/apps/com.xyhui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export default defineGkdApp({
'com.xyhui.start.PUMainActivity',
'com.xyhui.start.LoadingActivity',
'com.huawei.permissioncontroller.hwcust.appjump.AppJumpActivity',
'.lut.act.LutMainActivity',
],
matches:
'[id="android:id/content"] >(4,5) @FrameLayout[index=1] > ImageView',
Expand All @@ -36,17 +37,23 @@ export default defineGkdApp({
'https://i.gkd.li/import/12868157', // com.xyhui.start.LoadingActivity
'https://i.gkd.li/import/13348807', // com.bbk.launcher2.Launcher
'https://i.gkd.li/i/14766902',
'https://i.gkd.li/i/16921838',
],
},
{
key: 2,
name: '快手广告',
activityIds: 'com.xyhui.start.LoadingActivity',
fastQuery: true,
activityIds: [
'com.xyhui.start.PUMainActivity',
'com.xyhui.start.LoadingActivity',
],
matches:
'ImageView < @ViewGroup[clickable=true] < * <2 * + * >3 [text="广告"]',
'ImageView < @ViewGroup[clickable=true] < * <2 * +n * >(1,3) [text="广告"]',
snapshotUrls: [
'https://i.gkd.li/import/13259196',
'https://i.gkd.li/import/13259198',
'https://i.gkd.li/i/16837806',
'https://i.gkd.li/i/13259196',
],
},
{
Expand Down

0 comments on commit f2d7df4

Please sign in to comment.