Skip to content

Commit

Permalink
feat: 规则维护更新 (#291)
Browse files Browse the repository at this point in the history
* feat(YouTube): 自动翻译评论

* fix(微信): 订阅号文章广告

* feat(支付宝): 关闭免密支付开关

* feat(微信): 订阅号文章广告

* perf: 全局规则-开屏广告

* feat(X): 信息流广告

* feat(知乎): 首页信息流广告

* feat(哔哩哔哩): 搜索结果广告
  • Loading branch information
aoguai authored Oct 7, 2024
1 parent 2456262 commit 4405ba7
Show file tree
Hide file tree
Showing 7 changed files with 90 additions and 17 deletions.
4 changes: 3 additions & 1 deletion src/apps/com.eg.android.AlipayGphone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,14 @@ export default defineGkdApp({
{
fastQuery: true,
activityIds: 'com.alipay.android.msp.ui.views.MspContainerActivity',
matches: '@[checked=true] < * - [text$="免密支付"]',
matches:
'@[checked=true] < FrameLayout - [text*="免密"][text$="支付"]',
exampleUrls:
'https://m.gkd.li/57941037/1e3a5f01-c42b-4d41-9d7d-21ff96c0075f',
snapshotUrls: [
'https://i.gkd.li/i/14630824', // 关闭前
'https://i.gkd.li/i/14630825', // 关闭后
'https://i.gkd.li/i/17107841',
],
},
],
Expand Down
18 changes: 18 additions & 0 deletions src/apps/com.google.android.youtube.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,23 @@ export default defineGkdApp({
'ViewGroup[desc="免费试用 1 个月"] < * - * > ViewGroup[text="不用了,谢谢"]', // 缺少英文快照
snapshotUrls: 'https://i.gkd.li/import/13797512',
},
{
key: 4,
name: '功能类-自动翻译评论',
desc: '评论区自动点击[翻译成中文]',
rules: [
{
fastQuery: true,
activityIds:
'com.google.android.apps.youtube.app.watchwhile.MainActivity',
matches:
'@Button[desc^="翻译成中文"][clickable=true][visibleToUser=true] <<n [vid="results"]',
snapshotUrls: [
'https://i.gkd.li/i/17068544', // 翻译前
'https://i.gkd.li/i/17068647', // 翻译后
],
},
],
},
],
});
40 changes: 27 additions & 13 deletions src/apps/com.tencent.mm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,12 @@ export default defineGkdApp({
{
key: 6,
name: '分段广告-订阅号文章广告',
desc: '自动点击关闭',
desc: '点击下拉框-[关闭此广告]/[不感兴趣]-[与我无关]',
enable: false,
activityIds: [
'com.tencent.mm.plugin.brandservice.ui.timeline.preload.ui.TmplWebView', //调整为TmplWebView, 同时兼容多种ID
'com.tencent.mm.plugin.brandservice.ui.timeline.preload.ui.TmplWebViewMMUI',
'com.tencent.mm.plugin.brandservice.ui.timeline.preload.ui.TmplWebViewTooLMpUI',
'com.tencent.mm.plugin.webview.ui.tools.fts.MMSosWebViewUI',
'.plugin.brandservice.ui.timeline.preload.ui.TmplWebView', //调整为TmplWebView, 同时兼容多种ID
'.plugin.webview.ui.tools.fts.MMSosWebViewUI',
'.plugin.webview.ui.tools.MMWebViewUI',
],
rules: [
{
Expand All @@ -253,11 +252,13 @@ export default defineGkdApp({
'https://i.gkd.li/import/12700183',
'https://i.gkd.li/import/12714424',
'https://i.gkd.li/import/14293295',
'https://i.gkd.li/i/17093010', // com.tencent.mm.plugin.webview.ui.tools.MMWebViewUI
'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
],
excludeSnapshotUrls: [
'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 @@ -266,15 +267,16 @@ export default defineGkdApp({
'https://i.gkd.li/import/14006203', // 防误触
'https://i.gkd.li/import/12701503', // 防误触, 事件完成后,采用[childCount=1]进行限定,防止频繁触发规则
'https://i.gkd.li/import/14292844', // 防误触, 出现反馈菜单后应该不匹配
'https://i.gkd.li/i/15198464', // 防止在文章末尾广告关闭后误触
],
},
{
key: 1,
preKeys: [0],
name: '点击「不感兴趣」或「关闭此广告」',
key: 1,
name: '点击「关闭此广告」',
excludeMatches: '[text="感谢你的反馈"][visibleToUser=true]',
matches:
'[text*="广告"&&text.length<5] <n View < View >n [text="不感兴趣"||text="关闭此广告"][visibleToUser=true]',
'[text*="广告"&&text.length<5] <n View < View >n [text="关闭此广告"][visibleToUser=true]',
snapshotUrls: [
'https://i.gkd.li/import/12745280',
'https://i.gkd.li/import/14293434',
Expand All @@ -284,21 +286,33 @@ export default defineGkdApp({
'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防止在文章末尾广告关闭后误触
'https://i.gkd.li/i/16796729', // 内容中部广告
],
},
{
preKeys: [0],
key: 2,
preKeys: [0, 1],
name: '点击「不感兴趣」',
excludeMatches: '[text="感谢你的反馈"][visibleToUser=true]',
matches:
'[text*="广告"&&text.length<5] <n View < View >n [text="不感兴趣"][visibleToUser=true]',
snapshotUrls: [
'https://i.gkd.li/i/17113565', // 在某些情况下,点击“不感兴趣”会导致无法执行下一步操作
],
},
{
preKeys: [0, 1, 2],
key: 10,
name: '点击「与我无关」',
matches:
'[text*="广告"&&text.length<5] <n View < View >n [text="与我无关"][visibleToUser=true]',
snapshotUrls: [
'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
],
excludeSnapshotUrls: [
'https://i.gkd.li/i/15061424', // 使用excludeMatches防止在文章末尾广告关闭后误触
'https://i.gkd.li/i/16798658', // clickable=false,使用clickable=true避免误触
],
},
Expand Down
1 change: 1 addition & 0 deletions src/apps/com.twitter.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export default defineGkdApp({
snapshotUrls: [
'https://i.gkd.li/import/12813235',
'https://i.gkd.li/i/14782897',
'https://i.gkd.li/i/17182889',
'https://i.gkd.li/import/12825969', // com.twitter.tweetdetail.TweetDetailActivity
'https://i.gkd.li/import/12847584', // com.twitter.android.search.implementation.results.SearchActivity
'https://i.gkd.li/import/12882676', // com.twitter.tweetdetail.TweetDetailActivity
Expand Down
23 changes: 20 additions & 3 deletions src/apps/com.zhihu.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,15 @@ export default defineGkdApp({
},
{
key: 2,
matches: '@[vid="menu"][visibleToUser=true] < * - * > [text^="广告"]',
matches:
'@[vid="menu"][visibleToUser=true] < * - * > [text^="广告"|| text$="商品介绍"]',
snapshotUrls: [
'https://i.gkd.li/import/14321041',
'https://i.gkd.li/import/14296163',
'https://i.gkd.li/i/14468152',
'https://i.gkd.li/i/17237944',
],
excludeSnapshotUrls: [
'https://i.gkd.li/i/14558110', // 防误触
],
},
Expand All @@ -62,11 +66,24 @@ export default defineGkdApp({
matches: '@ViewGroup[clickable=true] <3 * < * -2 * >2 [text$="广告"]',
snapshotUrls: 'https://i.gkd.li/import/14332161',
},
{
key: 4,
matches: '@[vid="remove"] - [vid="subtitle"][text*="广告"]',
snapshotUrls: [
'https://i.gkd.li/i/17268845',
'https://i.gkd.li/i/17268869',
],
},
{
key: 90,
preKeys: [0, 1, 2, 3],
matches: '@[clickable=true] >3 [text$="不感兴趣"]',
snapshotUrls: 'https://i.gkd.li/import/13849689',
matches:
'@[clickable=true] >(1,3) [text$="不感兴趣"|| text^="屏蔽作者"]',
snapshotUrls: [
'https://i.gkd.li/import/13849689',
'https://i.gkd.li/i/17237940',
'https://i.gkd.li/i/17268849',
],
},
{
key: 91,
Expand Down
20 changes: 20 additions & 0 deletions src/apps/tv.danmaku.bili.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,5 +140,25 @@ export default defineGkdApp({
},
],
},
{
key: 9,
name: '分段广告-搜索结果广告',
desc: '点击右下角[菜单]-点击[不感兴趣]',
fastQuery: true,
activityIds: 'com.bilibili.search2.main.BiliMainSearchActivity',
rules: [
{
key: 1,
matches:
'@[vid="more"][clickable=true][visibleToUser=true] -3 [vid="tag_layout"] > [vid="ad_tag_with_dot"]',
snapshotUrls: 'https://i.gkd.li/i/17269053',
},
{
preKeys: [1],
matches: '@[clickable=true] > [text="不感兴趣"]',
snapshotUrls: 'https://i.gkd.li/i/17269055',
},
],
},
],
});
1 change: 1 addition & 0 deletions src/globalGroups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export default defineGkdGlobalGroups([
'[text*="搜索"][text.length<6][visibleToUser=true]',
'[(text*="搜索" && text.length<6) || vid~="(?is).*search.*" || (desc*="搜索" && desc.length<6)][visibleToUser=true]',
],
action: 'clickCenter',
matches:
'FrameLayout[visibleToUser=true][height>0&&width>0][childCount>=2] > FrameLayout[visibleToUser=true][height>0&&width>0][childCount>2] > @View[clickable=true][height>0&&width>0][visibleToUser=true] + TextView[clickable=true][height>0&&width>0][visibleToUser=true]', // 字节 SDK
},
Expand Down

0 comments on commit 4405ba7

Please sign in to comment.