Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 规则维护更新 #323

Merged
merged 10 commits into from
Nov 17, 2024
2 changes: 2 additions & 0 deletions src/apps/com.alicloud.databox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,10 @@ export default defineGkdApp({
{
key: 0,
name: '首页',
excludeMatches: '[vid="layoutBanner"] > [text$=">>"]',
matches: ['[id="com.alicloud.databox:id/ivTitleAction"]'],
snapshotUrls: 'https://i.gkd.li/import/14161399',
excludeSnapshotUrls: 'https://i.gkd.li/i/17556779',
},
{
key: 1,
Expand Down
1 change: 1 addition & 0 deletions src/apps/com.coolapk.market.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export default defineGkdApp({
name: '分段广告-卡片广告',
desc: '点击卡片右上角按钮->免广告-点击关闭->选择关闭原因-点击不感兴趣',
enable: false,
matchRoot: true,
fastQuery: true,
activityIds: [
'com.coolapk.market.view.main.MainActivity', // 缺少快照
Expand Down
7 changes: 6 additions & 1 deletion src/apps/com.miui.packageinstaller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,22 @@ export default defineGkdApp({
key: 13,
name: '功能类-自动安装/更新应用',
desc: '该规则仅适配关闭小米系统[安全守护]的情况',
matchRoot: true,
fastQuery: true,
rules: [
{
key: 0,
name: '点击[安装]/[更新]',
activityIds: 'com.miui.packageInstaller.NewInstallerPrepareActivity',
activityIds: [
'com.miui.packageInstaller.NewInstallerPrepareActivity',
'com.miui.packageInstaller.ui.InstallPrepareAlertActivity',
],
matches:
'@FrameLayout[clickable=true] > LinearLayout[childCount=1] > [text^="继续"][text.length=4]',
snapshotUrls: [
'https://i.gkd.li/i/16487278',
'https://i.gkd.li/i/16487282',
'https://i.gkd.li/i/17691996',
],
},
{
Expand Down
8 changes: 8 additions & 0 deletions src/apps/com.miui.player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ export default defineGkdApp({
matches: 'ViewGroup > @ViewGroup + ViewGroup[childCount=5]',
snapshotUrls: ['https://i.gkd.li/import/13304343'],
},
{
key: 3,
name: '免费试听弹窗',
fastQuery: true,
matches:
'@ViewGroup[clickable=true][childCount=0][visibleToUser=true] < ViewGroup[childCount=1] < ViewGroup[childCount=2] < FrameLayout < FrameLayout < [vid="webview_container"]',
snapshotUrls: 'https://i.gkd.li/i/17783777',
},
],
},
{
Expand Down
6 changes: 0 additions & 6 deletions src/apps/com.mosoink.teach.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ export default defineGkdApp({
'com.bytedance.sdk.openadsdk.stub.activity.Stub_Standard_Portrait_Activity',
],
rules: [
{
key: 1,
matches:
'TextView - View <1 FrameLayout - FrameLayout >1 FrameLayout > ImageView < FrameLayout',
snapshotUrls: 'https://i.gkd.li/import/13784406',
},
{
key: 2,
matches: '@Image[text.length=0] < View <n * > [text="反馈"]',
Expand Down
3 changes: 2 additions & 1 deletion src/apps/com.tencent.mm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ export default defineGkdApp({
desc: '自动点击[查看原图]/[查看原视频]按钮',
enable: false,
fastQuery: true,
activityIds: '.ui.chatting.gallery.ImageGalleryUI',
activityIds: ['.ui.chatting.gallery.ImageGalleryUI', '.ui.LauncherUI'],
rules: {
anyMatches: [
'[text^="查看原图"][clickable=true][visibleToUser=true]',
Expand All @@ -358,6 +358,7 @@ export default defineGkdApp({
'https://i.gkd.li/import/13523031',
'https://i.gkd.li/i/14661736',
'https://i.gkd.li/i/16833732',
'https://i.gkd.li/i/17698956',
],
},
{
Expand Down
47 changes: 0 additions & 47 deletions src/apps/com.xyhui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,53 +9,6 @@ export default defineGkdApp({
name: '全屏广告-弹窗广告',
enable: false,
rules: [
{
key: 1,
name: '腾讯广告',
activityIds: [
'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',
snapshotUrls: [
'https://i.gkd.li/import/12642482',
'https://i.gkd.li/import/12646519',
'https://i.gkd.li/import/12868369',
'https://i.gkd.li/import/12646541', // 华为手机的快照,activityId = 'com.huawei.permissioncontroller.hwcust.appjump.AppJumpActivity'
'https://i.gkd.li/import/13695488',
'https://i.gkd.li/import/12643276',
'https://i.gkd.li/import/12868503',
'https://i.gkd.li/import/12646420',
'https://i.gkd.li/import/13259194',
'https://i.gkd.li/import/12793180',
'https://i.gkd.li/import/12646347',
'https://i.gkd.li/import/12793157',
'https://i.gkd.li/import/12793177',
'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: '快手广告',
fastQuery: true,
activityIds: [
'com.xyhui.start.PUMainActivity',
'com.xyhui.start.LoadingActivity',
],
matches:
'ImageView < @ViewGroup[clickable=true] < * <2 * +n * >(1,3) [text="广告"]',
snapshotUrls: [
'https://i.gkd.li/import/13259198',
'https://i.gkd.li/i/16837806',
'https://i.gkd.li/i/13259196',
],
},
{
key: 3,
name: '字节广告',
Expand Down
13 changes: 13 additions & 0 deletions src/apps/tv.danmaku.bili.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,19 @@ export default defineGkdApp({
'https://i.gkd.li/i/14729855',
'https://i.gkd.li/i/17690786',
'https://i.gkd.li/i/17690800',
'https://i.gkd.li/i/17675629',
],
},
{
preKeys: [0],
key: 49,
fastQuery: true,
name: '点击[我不想看]',
matches: '[vid="recycler"] >n [text="我不想看"]',
snapshotUrls: ['https://i.gkd.li/i/17786751'],
},
{
preKeys: [0, 49],
key: 50,
fastQuery: true,
name: '点击[不感兴趣]',
Expand All @@ -73,6 +82,10 @@ export default defineGkdApp({
'https://i.gkd.li/i/14059882',
'https://i.gkd.li/i/13625309',
'https://i.gkd.li/i/12642261',
'https://i.gkd.li/i/17676025',
'https://i.gkd.li/i/17676149',
'https://i.gkd.li/i/17677147',
'https://i.gkd.li/i/17786753',
],
},
{
Expand Down
86 changes: 70 additions & 16 deletions src/globalGroups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,29 +73,23 @@ export default defineGkdGlobalGroups([
{
key: 0,
name: '开屏广告',
desc: '关闭打开应用时的开屏广告',
order: OPEN_AD_ORDER,
matchRoot: true,
actionMaximum: 2,
matchTime: 10000,
fastQuery: true,
resetMatch: 'app',
actionMaximumKey: 0,
rules: [
{
key: 0,
excludeMatches: [
// 防止在应用的搜索页面误触
'[text*="搜索"][text.length<6][visibleToUser=true]',
'[(text*="搜索" && text.length<6) || vid~="(?is).*search.*" || (desc*="搜索" && desc.length<6)][visibleToUser=true]',
],
excludeMatches: '[text*="搜索"][text.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).*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,
excludeMatches: [
// 防止在应用的搜索页面误触
'[text*="搜索"][text.length<6][visibleToUser=true]',
'[(text*="搜索" && text.length<6) || vid~="(?is).*search.*" || (desc*="搜索" && desc.length<6)][visibleToUser=true]',
],
excludeMatches: '[text*="搜索"][text.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 All @@ -107,6 +101,7 @@ export default defineGkdGlobalGroups([
{
key: 1,
name: '全屏广告',
desc: '关闭通用的全屏广告弹窗',
enable: false,
order: FULLSCREEN_AD,
matchTime: 10000,
Expand All @@ -127,29 +122,81 @@ export default defineGkdGlobalGroups([
key: 2,
name: '快手SDK-类型3',
matches: `[text="广告"] <<n ViewGroup +2 ViewGroup[childCount=3][checked=false] >n ImageView${COMMON_PREFIX}`,
snapshotUrls: ['https://i.gkd.li/i/13625303'],
},
{
key: 3,
name: '快手SDK-类型4',
matches:
'ImageView[childCount=0][text=null] < @ViewGroup[childCount=1][clickable=true][visibleToUser=true] <<(1, 3) ViewGroup +(1, 2, 4) ViewGroup[childCount=2] >(1,3) [text="广告"]',
snapshotUrls: [
'https://i.gkd.li/import/13259198',
'https://i.gkd.li/i/16837806',
'https://i.gkd.li/i/13259196',
'https://i.gkd.li/i/15362927',
],
},
{
key: 4,
name: '字节SDK-类型1',
matches: `[id~="(?is).*tt_reward_full_count_down_after_close"]${COMMON_PREFIX}`,
},
{
key: 4,
key: 5,
name: '字节SDK-类型2',
matches: `[vid~="(?is).*ad_flag_source_layout"] + [vid~="(?is).*iv_close"]${COMMON_PREFIX}`,
},
{
key: 5,
key: 6,
name: '美数SDK-类型1',
matches: `[vid~="(?is).*ms_activity_sdk_interstitial_cacel"]${COMMON_PREFIX}`,
},
{
key: 7,
name: '腾讯广告-类型1',
matches:
'ImageView[childCount=0][text=null][desc=null][id=null][visibleToUser=true][width<90 && height<90] < @FrameLayout[index=1||index=2][text=null][desc=null][id=null] <<n FrameLayout > [name$="FrameLayout"||name$="ImageView"][index=parent.childCount.minus(1)] -(1, 2) FrameLayout[childCount>=2] >(2, 3) [text^="立即" || text="查看详情" || text="了解更多" || text="去逛逛" || text="去微信看看" || text$="应用" || text="进入小程序" || text="领取优惠" || text="跳转微信"]',
snapshotUrls: [
'https://i.gkd.li/import/12642482',
'https://i.gkd.li/import/12646519',
'https://i.gkd.li/import/12868369',
'https://i.gkd.li/import/12646541', // 华为手机的快照,activityId = 'com.huawei.permissioncontroller.hwcust.appjump.AppJumpActivity'
'https://i.gkd.li/import/13695488',
'https://i.gkd.li/import/12643276',
'https://i.gkd.li/import/12868503',
'https://i.gkd.li/import/12646420',
'https://i.gkd.li/import/13259194',
'https://i.gkd.li/import/12793180',
'https://i.gkd.li/import/12646347',
'https://i.gkd.li/import/12793157',
'https://i.gkd.li/import/12793177',
'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',
'https://i.gkd.li/i/13264383',
'https://i.gkd.li/i/13852448',
'https://i.gkd.li/i/14318236',
'https://i.gkd.li/i/15400143',
'https://i.gkd.li/i/13348663',
'https://i.gkd.li/i/13343675',
'https://i.gkd.li/i/16670372',
'https://i.gkd.li/i/17689929',
'https://i.gkd.li/i/14345580',
'https://i.gkd.li/i/13246786',
'https://i.gkd.li/i/14783306',
'https://i.gkd.li/i/15173845',
'https://i.gkd.li/import/13784406',
],
},
],
// 将 Set 转换为数组,并设置 enable 为 false
apps: diabledAppIds.map((id) => ({ id, enable: false })),
},
{
key: 2,
name: '局部广告',
desc: '关闭通用的局部广告弹窗',
enable: false,
order: PARTIAL_AD,
matchTime: 10000,
Expand Down Expand Up @@ -215,6 +262,7 @@ export default defineGkdGlobalGroups([
{
key: 3,
name: '更新提示',
desc: '关闭通用的更新提示弹窗',
enable: false,
order: UPDATE_PROMPT,
actionMaximum: 2,
Expand All @@ -226,42 +274,46 @@ export default defineGkdGlobalGroups([
{
key: 0,
matches: [
`${COMMON_PREFIX}[(text*="内测"||text*="测试版"||text*="新版"||text*="更新"||text*="升级"||text*="体验"||text*="內測"||text*="測試版"||text*="升級"||text*="體驗"||text~="(?is).*Update.*"||text~="(?is).*Upgrade.*"||text~="(?is).*Experience.*")&&text!*="自动"&&text!*="自動"&&(text!*="成功"&&text!*="失败"&&text!*="失敗"&&(text!*="已"||text*="已知")&&text!*="检查更新")]`,
`${COMMON_PREFIX}[(text*="内测"||text*="测试版"||text*="新版"||text*="更新"||text*="升级"||text*="体验"||text*="內測"||text*="測試版"||text*="升級"||text*="體驗"||text~="(?is).*Update.*"||text~="(?is).*Upgrade.*"||text~="(?is).*Experience.*")&&text!*="自动"&&text!*="自動"&&(text!*="成功"&&text!*="失败"&&text!*="失敗"&&(text!*="已"||text*="已知")&&text!*="检查更新"&&text!*="卸载")]`,
`${COMMON_PREFIX}[((((text*="立即"||text*="马上"||text*="并"||text*="现在"||text*="立刻"||text*="抢先")&&(text*="更新"||text*="下载"||text*="安装"||text*="升级"||text*="查看"||text*="体验"))||text="更新"||text="下载"||text="安装"||text="升级"||text="确定"||text="好,升级")&&text.length<6)||((text~="(?is).*(更新.*?)(\\\\(|()\\\\d+(\\\\.\\\\d+)?(K|M|G|KB|MB|GB)(\\\\)|))")&&text.length<15)]`,
`${NEGATION_PART_RULE_TEXT}`,
],
},
{
key: 1,
matches: [
`${COMMON_PREFIX}[(desc*="内测"||desc*="测试版"||desc*="新版"||desc*="更新"||desc*="升级"||desc*="体验"||desc*="內測"||desc*="測試版"||desc*="升級"||desc*="體驗"||desc~="(?is).*Update.*"||desc~="(?is).*Upgrade.*"||desc~="(?is).*Experience.*")&&desc!*="自动"&&desc!*="自動"&&(desc!*="成功"&&desc!*="失败"&&desc!*="失敗"&&(desc!*="已"||desc*="已知")&&desc!*="检查更新")]`,
`${COMMON_PREFIX}[(desc*="内测"||desc*="测试版"||desc*="新版"||desc*="更新"||desc*="升级"||desc*="体验"||desc*="內測"||desc*="測試版"||desc*="升級"||desc*="體驗"||desc~="(?is).*Update.*"||desc~="(?is).*Upgrade.*"||desc~="(?is).*Experience.*")&&desc!*="自动"&&desc!*="自動"&&(desc!*="成功"&&desc!*="失败"&&desc!*="失敗"&&(desc!*="已"||desc*="已知")&&desc!*="检查更新"&&desc!*="卸载")]`,
`${COMMON_PREFIX}[((((desc*="立即"||desc*="马上"||desc*="并"||desc*="现在"||desc*="立刻"||desc*="抢先")&&(desc*="更新"||desc*="下载"||desc*="安装"||desc*="升级"||desc*="查看"||desc*="体验"))||desc="更新"||desc="下载"||desc="安装"||desc="升级"||desc="确定"||desc="好,升级")&&desc.length<6)||((desc~="(?is).*(更新.*?)(\\\\(|()\\\\d+(\\\\.\\\\d+)?(K|M|G|KB|MB|GB)(\\\\)|))")&&desc.length<15)]`,
`${NEGATION_PART_RULE_DESC}`,
],
},
{
key: 2,
matches: [
`${COMMON_PREFIX}[(text*="内测"||text*="测试版"||text*="新版"||text*="更新"||text*="升级"||text*="体验"||text*="內測"||text*="測試版"||text*="升級"||text*="體驗"||text~="(?is).*Update.*"||text~="(?is).*Upgrade.*"||text~="(?is).*Experience.*")&&text!*="自动"&&text!*="自動"&&(text!*="成功"&&text!*="失败"&&text!*="失敗"&&(text!*="已"||text*="已知")&&text!*="检查更新")]`,
`${COMMON_PREFIX}[(text*="内测"||text*="测试版"||text*="新版"||text*="更新"||text*="升级"||text*="体验"||text*="內測"||text*="測試版"||text*="升級"||text*="體驗"||text~="(?is).*Update.*"||text~="(?is).*Upgrade.*"||text~="(?is).*Experience.*")&&text!*="自动"&&text!*="自動"&&(text!*="成功"&&text!*="失败"&&text!*="失敗"&&(text!*="已"||text*="已知")&&text!*="检查更新"&&text!*="卸载")]`,
`${COMMON_PREFIX}[((((text*="立即"||text*="马上"||text*="并"||text*="现在"||text*="立刻"||text*="抢先")&&(text*="更新"||text*="下载"||text*="安装"||text*="升级"||text*="查看"||text*="体验"))||text="更新"||text="下载"||text="安装"||text="升级"||text="确定"||text="好,升级")&&text.length<6)||((text~="(?is).*(更新.*?)(\\\\(|()\\\\d+(\\\\.\\\\d+)?(K|M|G|KB|MB|GB)(\\\\)|))")&&text.length<15)]`,
`${NEGATION_PART_RULE_BUTTON}`,
],
},
{
key: 3,
matches: [
`${COMMON_PREFIX}[(desc*="内测"||desc*="测试版"||desc*="新版"||desc*="更新"||desc*="升级"||desc*="体验"||desc*="內測"||desc*="測試版"||desc*="升級"||desc*="體驗"||desc~="(?is).*Update.*"||desc~="(?is).*Upgrade.*"||desc~="(?is).*Experience.*")&&desc!*="自动"&&desc!*="自動"&&(desc!*="成功"&&desc!*="失败"&&desc!*="失敗"&&(desc!*="已"||desc*="已知")&&desc!*="检查更新")]`,
`${COMMON_PREFIX}[(desc*="内测"||desc*="测试版"||desc*="新版"||desc*="更新"||desc*="升级"||desc*="体验"||desc*="內測"||desc*="測試版"||desc*="升級"||desc*="體驗"||desc~="(?is).*Update.*"||desc~="(?is).*Upgrade.*"||desc~="(?is).*Experience.*")&&desc!*="自动"&&desc!*="自動"&&(desc!*="成功"&&desc!*="失败"&&desc!*="失敗"&&(desc!*="已"||desc*="已知")&&desc!*="检查更新"&&desc!*="卸载")]`,
`${COMMON_PREFIX}[((((desc*="立即"||desc*="马上"||desc*="并"||desc*="现在"||desc*="立刻"||desc*="抢先")&&(desc*="更新"||desc*="下载"||desc*="安装"||desc*="升级"||desc*="查看"||desc*="体验"))||desc="更新"||desc="下载"||desc="安装"||desc="升级"||desc="确定"||desc="好,升级")&&desc.length<6)||((desc~="(?is).*(更新.*?)(\\\\(|()\\\\d+(\\\\.\\\\d+)?(K|M|G|KB|MB|GB)(\\\\)|))")&&desc.length<15)]`,
`${NEGATION_PART_RULE_BUTTON}`,
],
},
],
excludeSnapshotUrls: [
'https://i.gkd.li/i/17710149', // text!*="卸载"
],
// 将 Set 转换为数组,并设置 enable 为 false
apps: [...uniqueAppIdsUP].map((id) => ({ id, enable: false })),
},
{
key: 4,
name: '评价提示',
desc: '关闭通用的评价提示弹窗',
enable: false,
order: REVIEW_PROMPT,
actionMaximum: 2,
Expand Down Expand Up @@ -309,6 +361,7 @@ export default defineGkdGlobalGroups([
{
key: 5,
name: '通知提示',
desc: '! 该规则会自动拒绝 APP 一些申请通知提示,如果有影响请关闭',
enable: false,
order: NOTIFICATION_PROMPT,
matchTime: 10000,
Expand Down Expand Up @@ -354,6 +407,7 @@ export default defineGkdGlobalGroups([
{
key: 6,
name: '青少年模式',
desc: '关闭通用的青少年模式提示弹窗',
enable: false,
order: YOUTH_MODE,
actionMaximum: 2,
Expand Down
Loading