Skip to content

Commit

Permalink
feat: 规则维护更新 (#260)
Browse files Browse the repository at this point in the history
* fix: 全局规则-开屏广告

* feat(小米音乐): banner 广告

* feat(微信): 订阅号文章广告,订阅号消息页面广告

* feat(支付宝): 弹窗广告

* fix(京东): 广告弹窗

* fix(QQ): 消息页面顶部广告

* feat(QQ邮箱): 开屏广告

* chore(actions): check_format_lint

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
aoguai and github-actions[bot] authored Aug 31, 2024
1 parent 9842a3f commit b11ad8d
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 13 deletions.
22 changes: 22 additions & 0 deletions src/apps/com.eg.android.AlipayGphone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,5 +198,27 @@ export default defineGkdApp({
},
],
},
{
key: 16,
name: '全屏广告-弹窗广告',
desc: '点击X',
rules: [
{
key: 0,
activityIds: 'com.eg.android.AlipayGphone.AlipayLogin',
matches:
'RelativeLayout[childCount=2][desc="全屏广告"] ImageView[desc="关闭"]',
snapshotUrls: 'https://i.gkd.li/i/14034152',
},
{
key: 1,
activityIds:
'com.alipay.mobile.nebulax.integration.mpaas.activity.NebulaActivity$Main',
matches:
'WebView > View > View > View > View > @TextView[clickable=true][visibleToUser=true][text=""] <<n [id="com.alipay.mobile.nebula:id/h5_pc_container"]',
snapshotUrls: 'https://i.gkd.li/i/16812751',
},
],
},
],
});
10 changes: 7 additions & 3 deletions src/apps/com.jingdong.app.mall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,17 @@ export default defineGkdApp({
'com.jingdong.app.mall.MainFrameActivity',
'com.jd.lib.jshop.jshop.JshopMainShopActivity',
],
matches: 'RelativeLayout > ImageView[desc*="关闭"]',
excludeMatches: 'ImageView[desc="关闭页面"] - [text="优惠券"]',
excludeMatches: [
'ImageView[desc="关闭页面"] - [text="优惠券"]',
'TextView[text="退换/售后"][id=null]',
],
matches: 'RelativeLayout[childCount=2] > ImageView[desc*="关闭"]',
snapshotUrls: [
'https://i.gkd.li/import/13258996',
'https://i.gkd.li/import/13336847', // 增加excludeMatches: 'ImageView[desc="关闭页面"] - [text="优惠券"]', 避免在该快照误触
'https://i.gkd.li/i/15416926',
'https://i.gkd.li/i/15862131',
'https://i.gkd.li/import/13336847', // 增加excludeMatches: 'ImageView[desc="关闭页面"] - [text="优惠券"]', 避免在该快照误触
'https://i.gkd.li/i/16818580', // 增加excludeMatches: 'TextView[text="退换/售后"]', 避免在刚刚打开该快照页面时误触(此时activityId并未改变)
],
},
{
Expand Down
18 changes: 14 additions & 4 deletions src/apps/com.miui.player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,22 @@ export default defineGkdApp({
},
{
key: 11,
name: '局部广告-我的页面顶部 banner 广告',
name: '局部广告-banner 广告',
activityIds: 'com.tencent.qqmusiclite.activity.MainActivity',
fastQuery: true,
rules:
'[id="com.miui.player:id/banner_image"] + [id="com.miui.player:id/close_banner"]',
snapshotUrls: 'https://i.gkd.li/import/12700984',
rules: [
{
key: 0,
matches:
'[id="com.miui.player:id/banner_image"] + [id="com.miui.player:id/close_banner"]',
snapshotUrls: 'https://i.gkd.li/import/12700984',
},
{
key: 1,
matches: '[visibleToUser=true][vid="ad_close"]',
snapshotUrls: 'https://i.gkd.li/i/16773614',
},
],
},
{
enable: false,
Expand Down
3 changes: 2 additions & 1 deletion src/apps/com.tencent.androidqqmail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ export default defineGkdApp({
preKeys: [0, 1], // https://github.com/gkd-kit/subscription/issues/1776
key: 9,
name: '点击[不感兴趣]',
matches: '[text="赞助商提供的广告"] < * < * >2 [text="不感兴趣"]',
matches: '[text="不感兴趣"]',
snapshotUrls: [
'https://i.gkd.li/import/12775862',
'https://i.gkd.li/i/15051479',
'https://i.gkd.li/i/16824453',
],
},
],
Expand Down
22 changes: 19 additions & 3 deletions src/apps/com.tencent.mm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ export default defineGkdApp({
{
key: 0,
name: '点击「广告」按钮',
excludeMatches: '[text="感谢你的反馈"][visibleToUser=true]',
matches: [
'[name$=".View"||name$=".TextView"][text^="广告"][visibleToUser=true] <n @View < View[childCount=1] <<3 View[childCount=1] <<2 View[childCount=1]',
],
Expand All @@ -249,8 +250,10 @@ export default defineGkdApp({
'https://i.gkd.li/import/12714424',
'https://i.gkd.li/import/14293295',
'https://i.gkd.li/i/14802057',
'https://i.gkd.li/i/16798663',
'https://i.gkd.li/i/15198413', // 无id
'https://i.gkd.li/i/15198455', // 无id
'https://i.gkd.li/i/15198455', // 无id
'https://i.gkd.li/import/12678937', // 防误触, 文章未浏览至页面底部,广告反馈按钮不可见,使用 [visibleToUser=true] 进行限定,防止打开文章就频繁触发规则
'https://i.gkd.li/import/12646837', // 防误触, 事件完成后,反馈按钮仍然存在,使用 View[childCount=1] 进行限定,防止频繁触发规则
'https://i.gkd.li/import/12642234', // 防误触, 出现反馈菜单后应该不匹配
Expand All @@ -265,6 +268,7 @@ export default defineGkdApp({
key: 1,
preKeys: [0],
name: '点击「不感兴趣」或「关闭此广告」',
excludeMatches: '[text="感谢你的反馈"][visibleToUser=true]',
matches:
'[text*="广告"&&text.length<5] <n View < View >n [text="不感兴趣"||text="关闭此广告"][visibleToUser=true]',
snapshotUrls: [
Expand All @@ -273,8 +277,11 @@ export default defineGkdApp({
'https://i.gkd.li/import/12700191',
'https://i.gkd.li/i/14633366',
'https://i.gkd.li/i/14834975',
'https://i.gkd.li/i/16798661',
'https://i.gkd.li/i/15198422', // 无id
'https://i.gkd.li/i/15198459', // 无id
'https://i.gkd.li/i/15198459', // 无id
'https://i.gkd.li/i/15061424', // 使用excludeMatches防止在文章末尾广告关闭后误触
],
},
{
Expand All @@ -287,6 +294,8 @@ export default defineGkdApp({
'https://i.gkd.li/import/12642238',
'https://i.gkd.li/import/14006206', // com.tencent.mm.plugin.webview.ui.tools.fts.MMSosWebViewUI
'https://i.gkd.li/i/15198461', // 无id
'https://i.gkd.li/i/15198461', // 无id
'https://i.gkd.li/i/16798658', // clickable=false,使用clickable=true避免误触
],
},
],
Expand Down Expand Up @@ -492,15 +501,22 @@ export default defineGkdApp({
preKeys: 0,
key: 1,
name: '点击[不喜欢此类视频]',
matches: '[desc="不喜欢此类视频"][clickable=true]',
snapshotUrls: 'https://i.gkd.li/i/14444654',
matches:
'[desc="不喜欢此类视频"||desc="不看此类内容"][clickable=true]',
snapshotUrls: [
'https://i.gkd.li/i/14444654',
'https://i.gkd.li/i/14549566',
],
},
{
preKeys: 1,
key: 2,
name: '点击[确定]',
matches: '[desc="确定"][clickable=true]',
snapshotUrls: 'https://i.gkd.li/i/14436190',
snapshotUrls: [
'https://i.gkd.li/i/14436190',
'https://i.gkd.li/i/14549567',
],
},
],
},
Expand Down
1 change: 1 addition & 0 deletions src/apps/com.tencent.mobileqq.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export default defineGkdApp({
excludeMatches: [
'[id^="com.tencent.mobileqq.qzone"]', // QQ空间
'[text="互动标识"]', // 侧滑抽屉
'[text="群标签"]', // 群资料
],
snapshotUrls: [
'https://i.gkd.li/import/13426912',
Expand Down
3 changes: 1 addition & 2 deletions src/globalGroups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,12 @@ export default defineGkdGlobalGroups([
rules: [
{
key: 0,
action: 'clickCenter',
excludeMatches: [
// 防止在应用的搜索页面误触
'[text*="搜索"][text.length<6][visibleToUser=true]',
'[(text*="搜索" && text.length<6) || vid~="(?is).*search.*" || (desc*="搜索" && desc.length<6)][visibleToUser=true]',
],
matches: `${COMMON_PREFIX}[(text.length<10&&(text*="跳过"||text*="跳過"||text~="(?is).*skip.*"))||id~="(?is).*tt_splash_skip_btn"||vid~="(?is).*skip.*"||(vid~="(?is).*count.*"&&vid~="(?is).*down.*"&&!(vid~="(?is).*load.*")&&!(vid~="(?is).*hour.*")&&!(vid~="(?is).*minute.*")&&!(vid~="(?is).*add.*")&&!(vid~="(?is).*ead.*"))||desc*="跳过"||desc~="(?is).*skip.*"][!(text~="([01]?[0-9]|2[0-3])[::][0-5][0-9]")][!(desc~="([01]?[0-9]|2[0-3])[::][0-5][0-9]")]`,
matches: `${COMMON_PREFIX}[(text.length<10&&(text*="跳过"||text*="跳過"||text~="(?is).*skip.*"))||id~="(?is).*tt_splash_skip_btn"||vid~="(?is).*skip.*"||(vid~="(?is).*count.*"&&vid~="(?is).*down.*"&&!(vid~="(?is).*load.*")&&!(vid~="(?is).*hour.*")&&!(vid~="(?is).*minute.*")&&!(vid~="(?is).*timing.*")&&!(vid~="(?is).*add.*")&&!(vid~="(?is).*ead.*"))||desc*="跳过"||desc~="(?is).*skip.*"][!(text~="([01]?[0-9]|2[0-3])[::][0-5][0-9]")][!(desc~="([01]?[0-9]|2[0-3])[::][0-5][0-9]")]`,
},
{
key: 1,
Expand Down

0 comments on commit b11ad8d

Please sign in to comment.