Skip to content

Commit

Permalink
feat: 规则维护更新 (#318)
Browse files Browse the repository at this point in the history
* feat(京东): 悬浮广告

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

* perf(应用包管理组件): 放弃开启安全守护, 自动安装/更新应用, 自动允许应用安装软件

* feat(哔哩哔哩): 视频卡片广告

* feat(支付宝): 支付后自动点击完成
  • Loading branch information
aoguai authored Nov 10, 2024
1 parent 6503426 commit 39f541c
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 203 deletions.
6 changes: 5 additions & 1 deletion src/apps/com.eg.android.AlipayGphone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,15 @@ export default defineGkdApp({
rules: [
{
activityIds: 'com.alipay.android.msp.ui.views.MspContainerActivity',
matches: ['[text="支付成功" || text="充值成功"]', '[text="完成"]'],
matches: [
'[text="支付成功" || text="充值成功" || text="提交成功"]',
'[text="完成"]',
],
snapshotUrls: [
'https://i.gkd.li/import/14008852',
'https://i.gkd.li/i/17503266',
'https://i.gkd.li/i/16328809',
'https://i.gkd.li/i/17686972',
],
},
],
Expand Down
5 changes: 3 additions & 2 deletions src/apps/com.jingdong.app.mall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@ export default defineGkdApp({
key: 2,
name: '首页广告',
matches:
'RelativeLayout >n * > [desc^="关闭浮层"][clickable=true][visibleToUser=true]',
'RelativeLayout >n * > [desc^="关闭"][clickable=true][visibleToUser=true]',
snapshotUrls: [
'https://i.gkd.li/import/13165659',
'https://i.gkd.li/import/12837870',
'https://i.gkd.li/import/13072091',
'https://i.gkd.li/import/12837870',
'https://i.gkd.li/i/15077913', // 防止误触
'https://i.gkd.li/i/17690650',
],
excludeSnapshotUrls: 'https://i.gkd.li/i/15077913',
},
{
key: 3,
Expand Down
208 changes: 36 additions & 172 deletions src/apps/com.miui.packageinstaller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,212 +5,76 @@ export default defineGkdApp({
name: '应用包管理组件',
groups: [
{
enable: false,
key: 9,
name: '功能类-自动第三方安装应用',
desc: '自动允许第三方应用调用安装,安装应用',
key: 7,
name: '功能类-放弃开启安全守护',
fastQuery: true,
activityIds:
'com.miui.packageInstaller.ui.normalmode.InstallProgressActivity',
rules: [
{
key: 0,
activityIds: [],
matches:
'TextView[text*="尝试安装应用"] < LinearLayout +2n LinearLayout > Button[text="继续"]',
snapshotUrls: 'https://i.gkd.li/import/12874746',
matches: '[text="30天内不再提示"][checked=false]',
snapshotUrls: 'https://i.gkd.li/i/16487140',
},
{
preKeys: [0],
key: 1,
activityIds: [
'com.miui.packageInstaller.ui.InstallPrepareAlertActivity',
'com.miui.packageInstaller.NewInstallerPrepareActivity',
],
matches: '@[text="允许"] + [text="禁止"]',
snapshotUrls: [
'https://i.gkd.li/import/13054478',
'https://i.gkd.li/import/13399425',
],
matches: '[text="放弃"]',
snapshotUrls: 'https://i.gkd.li/i/16487142',
},
],
},
{
key: 10,
name: '功能类-自动安装应用',
desc: '启用后安装高风险应用将自动完成,请自行评估风险决定是否启用',
enable: false,
key: 13,
name: '功能类-自动安装/更新应用',
desc: '该规则仅适配关闭小米系统[安全守护]的情况',
fastQuery: true,
rules: [
// 正常安装
{
key: 0,
name: '点击【继续安装】',
activityIds: [
'com.miui.packageInstaller.ui.InstallPrepareAlertActivity',
'com.miui.packageInstaller.NewInstallerPrepareActivity',
],
matches: ['[text="取消安装"]', '[text="继续安装"]'],
snapshotUrls: [
'https://i.gkd.li/import/12818034',
'https://i.gkd.li/import/12818054',
'https://i.gkd.li/i/12889120',
],
},
{
key: 1,
name: '点击【继续】',
activityIds: 'com.miui.packageInstaller.NewInstallerPrepareActivity',
matches: '[text="取消"] - @*[clickable=true] >2 [text="继续"]',
snapshotUrls: 'https://i.gkd.li/i/14392314',
},
// 需勾选【已了解此应用未经安全检测】才能继续安装
{
key: 2,
name: '勾选【已了解此应用未经安全检测】',
activityIds: 'com.miui.packageInstaller.NewInstallerPrepareActivity',
matches: '[text^="已了解此"][checked=false]',
snapshotUrls: [
'https://i.gkd.li/import/12888410', // 未勾选
'https://i.gkd.li/import/12889120', // 已勾选
'https://i.gkd.li/i/16171390',
],
},

// 需勾选【已了解此应用存在高风险】才能继续安装
{
key: 3,
name: '点击【了解风险】',
activityIds: 'com.miui.packageInstaller.NewInstallerPrepareActivity',
matches: '@[text="了解风险"] + [text="取消安装"]',
snapshotUrls: 'https://i.gkd.li/import/12889135',
},
{
preKeys: 3,
key: 4,
name: '勾选【已了解此应用存在高风险】',
name: '点击[安装]/[更新]',
activityIds: 'com.miui.packageInstaller.NewInstallerPrepareActivity',
matches:
'[id="com.miui.packageinstaller:id/install_checked"][checked=false]',
snapshotUrls: [
'https://i.gkd.li/import/12889137', // 未勾选
'https://i.gkd.li/import/12889148', // 已勾选
],
},
{
preKeys: 4,
key: 5,
name: '点击【仍然安装】',
activityIds: [
'com.miui.packageInstaller.NewInstallerPrepareActivity',
'com.miui.packageInstaller.ui.InstallPrepareAlertActivity',
],
matches: '[text="仍然安装"]',
'@FrameLayout[clickable=true] > LinearLayout[childCount=1] > [text^="继续"][text.length=4]',
snapshotUrls: [
'https://i.gkd.li/import/12889148',
'https://i.gkd.li/i/16187625',
'https://i.gkd.li/i/16487278',
'https://i.gkd.li/i/16487282',
],
},

// 安装完成
{
key: 6,
name: '点击【完成】',
activityIds: [
// preKeys: [0], 有概率不触发
key: 1,
name: '点击[完成]',
activityIds:
'com.miui.packageInstaller.ui.normalmode.InstallProgressActivity',
'com.miui.packageInstaller.InstallProgressActivity',
'com.miui.packageInstaller.ui.securemode.PureInstallProgressActivity',
],
matches:
'[id="com.miui.packageinstaller:id/done_layout"] > [text="完成"]',
snapshotUrls: [
'https://i.gkd.li/import/12818044', // com.miui.packageInstaller.ui.normalmode.InstallProgressActivity
'https://i.gkd.li/import/13229404', // com.miui.packageInstaller.InstallProgressActivity
'https://i.gkd.li/import/13501872', // com.miui.packageInstaller.ui.securemode.PureInstallProgressActivity
],
matches: '[text="完成"]',
snapshotUrls: 'https://i.gkd.li/i/16487274',
},
],
},
{
enable: false,
key: 11,
name: '功能类-自动更新应用',
key: 14,
name: '功能类-自动允许应用安装软件',
fastQuery: true,
activityIds: 'com.miui.packageInstaller.ui.InstallPrepareAlertActivity',
rules: [
// 正常更新
{
key: 0,
name: '点击【继续更新】',
activityIds: [
'com.miui.packageInstaller.ui.InstallPrepareAlertActivity',
'com.miui.packageInstaller.NewInstallerPrepareActivity',
],
matches: ['[text="取消更新"]', '[text="继续更新"]'],
snapshotUrls: [
'https://i.gkd.li/import/12817988',
'https://i.gkd.li/import/12910080',
'https://i.gkd.li/i/14392274',
],
},
{
key: 1,
name: '点击【继续更新】-2',
activityIds: 'com.miui.packageInstaller.NewInstallerPrepareActivity',
matches: '@[text="继续更新"] + [text="取消更新"]',
snapshotUrls: [
'https://i.gkd.li/import/13024731',
'https://i.gkd.li/import/13038465',
],
},

// 需勾选【已了解此安装包未经安全检测】才能继续更新
{
key: 2,
name: '勾选【已了解此安装包未经安全检测】',
activityIds: [
'com.miui.packageInstaller.ui.InstallPrepareAlertActivity',
'com.miui.packageInstaller.NewInstallerPrepareActivity',
name: '点击[记住我的选择]',
matches: [
'[text$="安装应用?"]',
'CheckBox[text="记住我的选择"][checked=false]',
],
matches: '[text="已了解此安装包未经安全检测"][checked=false]',
snapshotUrls: [
'https://i.gkd.li/import/13024730', // 未勾选
'https://i.gkd.li/import/13024731', // 已勾选
'https://i.gkd.li/i/16171390',
'https://i.gkd.li/i/16487366',
'https://i.gkd.li/i/16487389',
],
},

// 更新完成
{
key: 3,
name: '点击【完成】',
activityIds: [
'com.miui.packageInstaller.ui.normalmode.InstallProgressActivity',
'com.miui.packageInstaller.InstallProgressActivity',
],
matches:
'[id="com.miui.packageinstaller:id/done_layout"] > [text="完成"]',
snapshotUrls: [
'https://i.gkd.li/import/12817999',
'https://i.gkd.li/import/13255733',
],
},
],
},
{
key: 12,
name: '功能类-放弃开启安全守护',
enable: false,
fastQuery: true,
activityIds:
'com.miui.packageInstaller.ui.normalmode.InstallProgressActivity',
rules: [
{
key: 0,
matches: '[text="30天内不再提示"][checked=false]',
exampleUrls: 'https://e.gkd.li/fe6682cd-a27a-4183-8717-15fd373bafcf',
snapshotUrls: 'https://i.gkd.li/i/16487140',
},
{
preKeys: [0],
key: 1,
matches: '[text="放弃"]',
exampleUrls: 'https://e.gkd.li/859dac99-62ca-4876-bdfb-c84795254111',
snapshotUrls: 'https://i.gkd.li/i/16487142',
name: '点击[允许]',
matches: '[text="允许"]',
snapshotUrls: 'https://i.gkd.li/i/16487365',
},
],
},
Expand Down
21 changes: 19 additions & 2 deletions src/apps/com.xyhui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,27 @@ export default defineGkdApp({
key: 4,
name: '倍孜广告',
fastQuery: true,
activityIds:
activityIds: [
'com.beizi.ad.internal.activity.BeiZiInterstitialActivity',
'.lut.act.LutMainActivity',
],
matches: '[vid="beizi_interstitial_ad_close_iv"]',
snapshotUrls: ['https://i.gkd.li/i/17391799'],
snapshotUrls: [
'https://i.gkd.li/i/17391799',
'https://i.gkd.li/i/17690662',
],
},
{
key: 5,
name: '拼多多广告',
fastQuery: true,
activityIds: ['.lut.act.LutMainActivity'],
matches:
'@ImageView[desc.length=null][clickable=false] < ViewGroup[childCount=1] <<(36,37) [id="com.kwad.dy.sdk:id/ksad_tk_view"]',
snapshotUrls: [
'https://i.gkd.li/i/17690703',
'https://i.gkd.li/i/17690704',
],
},
],
},
Expand Down
41 changes: 15 additions & 26 deletions src/apps/tv.danmaku.bili.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default defineGkdApp({
{
key: 4,
name: '分段广告-视频卡片广告',
desc: '包括 视频底部与评论区中间卡片式广告, 首页推荐视频卡片广告',
desc: '包括 视频底部与评论区中间卡片式广告, 视频详情页下方推广, 首页推荐视频卡片广告',
enable: false,
activityIds: [
'tv.danmaku.bili.MainActivityV2',
Expand All @@ -41,58 +41,47 @@ export default defineGkdApp({
key: 0,
name: '点击广告卡片右侧菜单图标',
matches:
'[(desc*="广告"||desc*="来自淘宝")&&desc*="查看"][visibleToUser=true] >n * >n [id^="tv.danmaku.bili:id/more"][visibleToUser=true] > ImageView[visibleToUser=true]',
'[((desc*="广告"||desc*="来自淘宝")&&desc*="查看")||desc$=",,轻点两下查看详情"][visibleToUser=true] >(2,3,4) @ImageView[visibleToUser=true] < [vid$="more"][visibleToUser=true]',
snapshotUrls: [
'https://i.gkd.li/import/12642260', // n = 2
'https://i.gkd.li/import/12705266', // n = 3
'https://i.gkd.li/import/12776568', // id="tv.danmaku.bili:id/more_layout"
'https://i.gkd.li/import/12707070', // 由于 activityId 切换延迟导致规则仍然运行, 使用 FrameLayout 避免误触
'https://i.gkd.li/i/14083540',
'https://i.gkd.li/i/14059876',
'https://i.gkd.li/i/14059876', // n = 4
'https://i.gkd.li/i/14588315',
'https://i.gkd.li/i/14729855',
'https://i.gkd.li/i/17690786',
'https://i.gkd.li/i/17690800',
],
},
{
preKeys: 0,
preKeys: [0],
key: 50,
fastQuery: true,
name: '点击[不感兴趣]',
matches: '@[clickable=true] > [text="不感兴趣"]',
matches:
'@[clickable=true] > [text="不感兴趣" || text="相似内容过多" || text="up主不感兴趣"]',
snapshotUrls: [
'https://i.gkd.li/import/13495649',
'https://i.gkd.li/i/13742257',
'https://i.gkd.li/i/13256605',
'https://i.gkd.li/i/14155801',
'https://i.gkd.li/i/13742257',
],
},
{
preKeys: 0,
key: 51,
name: '点击[相似内容过多]',
fastQuery: true,
matches: '@[clickable=true] > [text="相似内容过多"]',
exampleUrls:
'https://m.gkd.li/57941037/acd89b46-45fc-459f-8d17-3913d98dcbad',
snapshotUrls: [
'https://i.gkd.li/i/13945597',
'https://i.gkd.li/i/14155272',
'https://i.gkd.li/i/14059882',
'https://i.gkd.li/i/13625309',
'https://i.gkd.li/i/12642261',
],
},
{
preKeys: 0,
key: 52,
name: '点击[up主不感兴趣]',
preKeys: [50],
key: 51,
name: '点击关闭',
fastQuery: true,
matches: '@[clickable=true] > [text="up主不感兴趣"]',
exampleUrls:
'https://m.gkd.li/57941037/9c2f42d7-c262-4e06-b3c6-40f0908e7a94',
snapshotUrls: [
'https://i.gkd.li/i/13625309',
'https://i.gkd.li/i/12642261',
],
matches: '[vid="close_dislike"]',
snapshotUrls: 'https://i.gkd.li/i/17675894',
},
],
},
Expand Down

0 comments on commit 39f541c

Please sign in to comment.