Skip to content

Commit

Permalink
feat: 规则维护更新 (#341)
Browse files Browse the repository at this point in the history
* feat: 全局规则 排除 EditText

* fix(阿里云盘): 自动签到; 活动弹窗;

* feat(百度贴吧): 广告弹窗; [帖子内/吧内]底部悬浮窗;

* feat(支付宝): 关闭花呗,借呗,还款升级,推荐等弹窗

* feat(youtube): 会员广告

* feat(京东): 通知提示; 广告弹窗;

* feat(应用包管理组件): 添加 actionMaximum

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

* fix(QQ): 动态页[好友热播/为你推荐]

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

* fix(哔哩哔哩): 直播间卡片广告; 搜索结果广告;

* 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 Dec 12, 2024
1 parent d63180e commit b0048c0
Show file tree
Hide file tree
Showing 11 changed files with 136 additions and 97 deletions.
19 changes: 11 additions & 8 deletions src/apps/com.alicloud.databox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ export default defineGkdApp({
preKeys: [0],
name: '在签到后,关闭弹窗',
action: 'back',
matches: '[vid="ivCardBackBackground"][visibleToUser=true]',
anyMatches: [
'[vid="ivCardBackBackground"][visibleToUser=true]',
'[vid="ivClose"][visibleToUser=true]',
],
snapshotUrls: [
'https://i.gkd.li/i/18108340',
'https://i.gkd.li/i/15573070', // 签到前
'https://i.gkd.li/i/15573233', // 签到后
],
Expand All @@ -49,19 +53,18 @@ export default defineGkdApp({
rules: [
{
key: 0,
matches:
'WebView >3 View > Image + TextView[clickable=true&&text.length=0]',
anyMatches: [
'WebView[text!=null && text!=""] > View[id="root"] >2 View > TextView[index=parent.childCount.minus(2)]',
'WebView[text=null] > View[id="root"] >2 View > TextView[index=parent.childCount.minus(1)]',
],
snapshotUrls: [
'https://i.gkd.li/import/13228610',
'https://i.gkd.li/import/14161216',
'https://i.gkd.li/import/14235204',
'https://i.gkd.li/i/14414446',
'https://i.gkd.li/i/18108117',
],
},
{
key: 1,
matches: 'WebView >3 View > TextView[index=3][clickable=true]',
snapshotUrls: ['https://i.gkd.li/i/14414446'],
},
],
},
{
Expand Down
55 changes: 30 additions & 25 deletions src/apps/com.baidu.tieba.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,21 +156,11 @@ export default defineGkdApp({
'com.baidu.tieba.LogoActivity',
],
rules: [
{
key: 0,
name: '点击右上角x关闭',
matches:
'View[childCount=3] > @View[clickable=true][childCount=1] > Image',
snapshotUrls: [
'https://i.gkd.li/import/13060891',
'https://i.gkd.li/import/13222361', // childCount=1否则误触这里
],
},
{
key: 1,
name: '点击正下方x关闭',
matches:
'@TextView[clickable=true && text=null] - FrameLayout TextView[text="广告"]',
'@TextView[id="com.baidu.tieba:id/obfuscated"][clickable=true][childCount=0][visibleToUser=true] - FrameLayout[childCount=2][getChild(1).text="广告"] < RelativeLayout[childCount=2] < [parent=null]',
snapshotUrls: [
'https://i.gkd.li/import/13168383',
'https://i.gkd.li/import/13322120',
Expand All @@ -194,8 +184,13 @@ export default defineGkdApp({
{
key: 3,
name: '点击正下方x关闭3',
matches: '@TextView[visibleToUser=true][text=""] -2 [text="广告"]',
snapshotUrls: 'https://i.gkd.li/i/16703244',
matches:
'WebView[text!=null] > View[childCount=1] > View[childCount=3] > @[visibleToUser=true][index=2]',
snapshotUrls: [
'https://i.gkd.li/i/13060891',
'https://i.gkd.li/i/16703244',
],
excludeSnapshotUrls: ['https://i.gkd.li/i/13222361'],
},
],
},
Expand Down Expand Up @@ -255,18 +250,28 @@ export default defineGkdApp({
},
{
key: 11,
name: '局部广告-帖子底部浮窗广告',
activityIds: 'com.baidu.tieba.pb.pb.main.PbActivity',
rules:
'* + @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',
name: '局部广告-[帖子内/吧内]底部悬浮窗',
fastQuery: true,
actionMaximum: 1,
rules: [
{
key: 0,
activityIds: '.pb.pb.main.PbActivity',
matches:
'@ImageView[clickable=true][visibleToUser=true] <2 LinearLayout - * > [text$="热议中" || text^="猜你喜欢" || text*="进吧逛逛"]',
snapshotUrls: [
'https://i.gkd.li/i/16595234',
'https://i.gkd.li/i/16619736',
'https://i.gkd.li/i/16647874',
],
},
{
key: 1,
activityIds: '.forum.ForumActivity',
matches:
'@ImageView[clickable=true][visibleToUser=true] <2 LinearLayout - * > [text^="关注本吧"]',
snapshotUrls: 'https://i.gkd.li/i/17992981',
},
],
},
{
Expand Down
5 changes: 3 additions & 2 deletions src/apps/com.eg.android.AlipayGphone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ export default defineGkdApp({
groups: [
{
key: 0,
name: '通知提示-关闭花呗,借呗,还款升级,信用卡推荐弹窗',
desc: '支付成功后的包括升级,开通,推荐的弹窗',
name: '通知提示-关闭花呗,借呗,还款升级,推荐等弹窗',
desc: '自动支付成功后的包括升级,开通,推荐的弹窗',
enable: false,
actionMaximum: 1,
resetMatch: 'app',
Expand Down Expand Up @@ -37,6 +37,7 @@ export default defineGkdApp({
'https://i.gkd.li/i/16106615',
'https://i.gkd.li/i/17391739',
'https://i.gkd.li/i/17945065',
'https://i.gkd.li/i/14893122',
],
},
],
Expand Down
25 changes: 12 additions & 13 deletions src/apps/com.google.android.youtube.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,27 +51,26 @@ export default defineGkdApp({
},
{
key: 2,
name: '局部广告-首页会员广告',
activityIds:
'com.google.android.apps.youtube.app.watchwhile.WatchWhileActivity',
rules:
'ImageView < @Button < ViewGroup +3 Button[desc*="YouTube Premium"]',
snapshotUrls: 'https://i.gkd.li/import/12877357',
},
{
key: 3,
name: '全屏广告-订阅浮窗广告',
name: '全屏广告-会员广告',
desc: '包括首页信息流里的会员广告',
enable: false,
activityIds:
activityIds: [
'com.google.android.apps.youtube.app.watchwhile.MainActivity',
'com.google.android.apps.youtube.app.watchwhile.WatchWhileActivity',
],
rules:
'ViewGroup[desc="免费试用 1 个月"] < * - * > ViewGroup[text="不用了,谢谢"]', // 缺少英文快照
snapshotUrls: 'https://i.gkd.li/import/13797512',
'@[desc="不用了,谢谢" || desc="关闭"][visibleToUser=true] <<n [vid="bottom_ui_container" || vid="custom" || vid="loading_layout"]',
snapshotUrls: [
'https://i.gkd.li/import/12877357',
'https://i.gkd.li/i/13797512',
'https://i.gkd.li/i/18017075',
],
},
{
key: 4,
name: '功能类-自动翻译评论',
desc: '评论区自动点击[翻译成中文]',
enable: false,
rules: [
{
fastQuery: true,
Expand Down
5 changes: 4 additions & 1 deletion src/apps/com.jingdong.app.mall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,20 @@ export default defineGkdApp({
activityIds: [
'com.jd.lib.message.messagecenter.view.activity.MessageCenterMainActivityNew',
'com.jd.lib.ordercenter.mygoodsorderlist.view.activity.MyOrderListActivity',
'com.jd.lib.message.messagecenter3.MessageCenterActivity',
'com.jingdong.app.mall.MainFrameActivity',
],
rules: [
{
matches:
'@ImageView[clickable=true] -n TextView[text="开启消息通知"]',
'@ImageView[index=parent.childCount.minus(1)][clickable=true][visibleToUser=true] -n [text="开启消息通知"]',
snapshotUrls: [
'https://i.gkd.li/import/12839864', //com.jd.lib.message.messagecenter.view.activity.MessageCenterMainActivityNew
'https://i.gkd.li/import/13772299', //com.jd.lib.ordercenter.mygoodsorderlist.view.activity.MyOrderListActivity
'https://i.gkd.li/import/13917163', //com.jingdong.app.mall.MainFrameActivity
'https://i.gkd.li/i/13463618',
'https://i.gkd.li/i/14692570',
'https://i.gkd.li/i/18060234',
],
},
{
Expand All @@ -96,6 +98,7 @@ export default defineGkdApp({
snapshotUrls: [
'https://i.gkd.li/i/13165721',
'https://i.gkd.li/i/15364514',
'https://i.gkd.li/i/17974166',
],
},
{
Expand Down
45 changes: 44 additions & 1 deletion src/apps/com.miui.packageinstaller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export default defineGkdApp({
key: 7,
name: '功能类-放弃开启安全守护',
fastQuery: true,
actionMaximum: 1,
activityIds:
'com.miui.packageInstaller.ui.normalmode.InstallProgressActivity',
rules: [
Expand All @@ -27,9 +28,10 @@ export default defineGkdApp({
{
key: 13,
name: '功能类-自动安装/更新应用',
desc: '该规则仅适配关闭小米系统[安全守护]的情况',
desc: '该规则仅适配关闭[应用安全验证]和[安全守护]的情况,可在安装页面右上角设置里关闭,关闭后的风险自行承担',
matchRoot: true,
fastQuery: true,
actionMaximum: 1,
rules: [
{
key: 0,
Expand Down Expand Up @@ -60,7 +62,9 @@ export default defineGkdApp({
{
key: 14,
name: '功能类-自动允许应用安装软件',
desc: '!该规则存在风险,请您仅在需要且知晓风险并承担后果的情况下启用',
fastQuery: true,
actionMaximum: 1,
activityIds: 'com.miui.packageInstaller.ui.InstallPrepareAlertActivity',
rules: [
{
Expand All @@ -87,6 +91,7 @@ export default defineGkdApp({
key: 15,
name: '功能类-备案信息弹窗',
desc: '点击[继续安装]',
actionMaximum: 1,
rules: [
{
fastQuery: true,
Expand All @@ -97,5 +102,43 @@ export default defineGkdApp({
},
],
},
{
key: 16,
name: '功能类-无视风险继续安装',
desc: '!该规则存在风险,请您仅在需要且知晓风险并承担后果的情况下启用',
actionMaximum: 1,
fastQuery: true,
activityIds: 'com.miui.packageInstaller.NewInstallerPrepareActivity',
rules: [
{
key: 0,
matches: '@[clickable=true] >2 [text="无视风险继续安装"]',
exampleUrls: 'https://e.gkd.li/46f06948-5ec1-4054-8aa3-a8f39e5d1f26',
snapshotUrls: 'https://i.gkd.li/i/18002566',
},
{
preKeys: [0],
key: 1,
matches: '[text="继续"]',
exampleUrls: 'https://e.gkd.li/375fc2ec-841a-4af6-be99-9391ebeb7dc5',
snapshotUrls: 'https://i.gkd.li/i/18002704',
},
{
preKeys: [1],
key: 2,
matches:
'@[clickable=true][desc="更多"] > [vid="action_menu_item_child_icon"]',
exampleUrls: 'https://e.gkd.li/de8fb9c9-ea4e-4c03-93bd-047bf31cd4c8',
snapshotUrls: 'https://i.gkd.li/i/18002708',
},
{
preKeys: [2],
key: 3,
matches: '@[clickable=true] > [text="单次安装授权"]',
exampleUrls: 'https://e.gkd.li/0e8afdd7-04d3-46fd-9095-b61123d041b2',
snapshotUrls: 'https://i.gkd.li/i/18002712',
},
],
},
],
});
5 changes: 3 additions & 2 deletions src/apps/com.tencent.mm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,15 +306,16 @@ export default defineGkdApp({
key: 10,
name: '点击「与我无关」',
matches:
'[text*="广告"&&text.length<5] <n View < View >n [text="与我无关"][visibleToUser=true]',
'[text*="广告"&&text.length<5] <<n 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/16798658',
'https://i.gkd.li/i/18108538',
],
excludeSnapshotUrls: [
'https://i.gkd.li/i/15061424', // 使用excludeMatches防止在文章末尾广告关闭后误触
'https://i.gkd.li/i/16798658', // clickable=false,使用clickable=true避免误触
],
},
],
Expand Down
45 changes: 10 additions & 35 deletions src/apps/com.tencent.mobileqq.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,7 @@ export default defineGkdApp({
},
{
key: 5,
name: '分段广告-好友热播',
desc: '好友动态中的好友热播,自动选择“减少好友热播” - 默认关闭',
name: '分段广告-动态页[好友热播/为你推荐]',
enable: false,
fastQuery: true,
activityIds: [
Expand All @@ -272,22 +271,28 @@ export default defineGkdApp({
{
key: 0,
name: '点击[好友热播]卡片右上角菜单按钮',
matches: '@Button[clickable=true] - [text="好友热播"]',
matches:
'@[clickable=true][visibleToUser=true][childCount=0] - [text="好友热播" || text="为你推荐"]',
snapshotUrls: [
'https://i.gkd.li/import/12721427', // com.qzone.reborn.feedx.activity.QZoneFriendFeedXActivity
'https://i.gkd.li/import/12894359', // com.tencent.mobileqq.activity.SplashActivity
'https://i.gkd.li/i/14822579',
'https://i.gkd.li/i/12929620',
'https://i.gkd.li/i/13387606',
],
},
{
preKeys: [0],
key: 1,
name: '点击[减少好友热播]',
matches: '@[clickable=true] >2 [text="减少好友热播"]',
name: '点击[减少好友热播/为你推荐]',
matches:
'@[clickable=true] >2 [text="减少好友热播" || text="减少此类推荐"]',
snapshotUrls: [
'https://i.gkd.li/import/12721433', // com.qzone.reborn.feedx.activity.QZoneFriendFeedXActivity
'https://i.gkd.li/import/12894375', // com.tencent.mobileqq.activity.SplashActivity
'https://i.gkd.li/i/14822576',
'https://i.gkd.li/i/12929619',
'https://i.gkd.li/i/13387605',
],
},
],
Expand Down Expand Up @@ -465,36 +470,6 @@ export default defineGkdApp({
},
],
},
{
key: 15,
name: '分段广告-好友动态-为你推荐',
enable: false,
fastQuery: true,
activityIds: [
'com.tencent.mobileqq.activity.SplashActivity',
'com.qzone.reborn.feedx.activity.QZoneFriendFeedXActivity',
],
rules: [
{
key: 0,
matches: '@ImageView[clickable=true] - [text="为你推荐"]',
snapshotUrls: [
'https://i.gkd.li/import/12929620',
'https://i.gkd.li/import/13387606', // activityIds: 'com.qzone.reborn.feedx.activity.QZoneFriendFeedXActivity',
],
},
{
preKeys: 0,
key: 1,
matches:
'@LinearLayout[id!=null][clickable=true] > LinearLayout > [text="减少此类推荐"]',
snapshotUrls: [
'https://i.gkd.li/import/12929619',
'https://i.gkd.li/import/13387605',
],
},
],
},
{
key: 20,
name: '分段广告-钱包页卡片广告',
Expand Down
Loading

0 comments on commit b0048c0

Please sign in to comment.