Skip to content

Commit

Permalink
perf: some rules
Browse files Browse the repository at this point in the history
  • Loading branch information
AIsouler committed Dec 7, 2024
1 parent 3961ea7 commit 953b691
Show file tree
Hide file tree
Showing 40 changed files with 418 additions and 344 deletions.
12 changes: 11 additions & 1 deletion src/appDeprecatedKeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ const appDeprecatedKeys: RawDeprecatedKeysSetting[] = [
{
id: 'cn.wps.moffice_eng',
name: 'WPS',
deprecatedKeys: [0],
deprecatedKeys: [0, 7],
},
{
id: 'cn.xiaochuankeji.tieba',
Expand Down Expand Up @@ -832,6 +832,16 @@ const appDeprecatedKeys: RawDeprecatedKeysSetting[] = [
name: '胖乖生活',
deprecatedKeys: [0],
},
{
id: 'cn.lezhi.speedtest',
name: '网速管家',
deprecatedKeys: [1],
},
{
id: 'io.iftech.android.box',
name: '小组件盒子',
deprecatedKeys: [1],
},
];

const map: Map<string, number[]> = new Map();
Expand Down
6 changes: 2 additions & 4 deletions src/apps/air.tv.douyu.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ export default defineGkdApp({
name: '右下方悬浮广告-1',
matches:
'ViewGroup[childCount=8] > ViewGroup[index=5] >4 RelativeLayout[visibleToUser=true] > ImageView[clickable=true][index=1]',
snapshotUrls: [
'https://i.gkd.li/i/13948990',
'https://i.gkd.li/i/14310474', // 避免在此页面误触
],
snapshotUrls: 'https://i.gkd.li/i/13948990',
excludeSnapshotUrls: 'https://i.gkd.li/i/14310474',
},
{
key: 6,
Expand Down
1 change: 1 addition & 0 deletions src/apps/android.zhibo8.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export default defineGkdApp({
],
},
{
preKeys: [0],
key: 1,
name: '点击不感兴趣',
matches: '@[clickable=true] >3 [text="不感兴趣"]',
Expand Down
6 changes: 5 additions & 1 deletion src/apps/cmb.pb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,13 @@ export default defineGkdApp({
resetMatch: 'app',
rules: [
{
activityIds: [
'.app.h5container.webviewcontainer.PBWebContainerActivity',
'.app.search.PBSearchWebActivity',
'com.pb.marketing.PopupWindowActivity',
],
matches: '@[desc="关闭"] - * > [text*="开启"][text*="定位"]',
snapshotUrls: [
'https://i.gkd.li/i/12706029',
'https://i.gkd.li/i/13248893',
'https://i.gkd.li/i/13897345',
'https://i.gkd.li/i/14208717',
Expand Down
14 changes: 11 additions & 3 deletions src/apps/cn.com.hkgt.gasapp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,17 @@ export default defineGkdApp({
{
key: 1,
name: '全屏广告-弹窗广告',
activityIds: 'cn.com.hkgt.gasapp.dialog.BannerDialog',
rules: 'ImageView[id="cn.com.hkgt.gasapp:id/exit"][clickable=true]',
snapshotUrls: 'https://i.gkd.li/i/12744270',
fastQuery: true,
matchTime: 10000,
actionMaximum: 1,
resetMatch: 'app',
rules: [
{
activityIds: 'cn.com.hkgt.gasapp.dialog.BannerDialog',
matches: 'ImageView[id="cn.com.hkgt.gasapp:id/exit"][clickable=true]',
snapshotUrls: 'https://i.gkd.li/i/12744270',
},
],
},
],
});
8 changes: 6 additions & 2 deletions src/apps/cn.com.ruijie.magicbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@ export default defineGkdApp({
actionMaximum: 1,
resetMatch: 'app',
rules: [
'@ImageView[id="cn.com.ruijie.magicbox:id/imageView_close"] +(2) RelativeLayout > LinearLayout > [text*="新版本"]',
{
activityIds: 'cn.com.ruijie.wifibox.activity.MainActivity',
matches:
'@ImageView[id="cn.com.ruijie.magicbox:id/imageView_close"] +(2) RelativeLayout > LinearLayout > [text*="新版本"]',
snapshotUrls: 'https://i.gkd.li/i/12642359',
},
],
snapshotUrls: 'https://i.gkd.li/i/12642359',
},
],
});
9 changes: 7 additions & 2 deletions src/apps/cn.com.spdb.mobilebank.per.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,13 @@ export default defineGkdApp({
matchTime: 10000,
actionMaximum: 1,
resetMatch: 'app',
rules: '[text="去开启"] + View > Image[text.length=0]',
snapshotUrls: 'https://i.gkd.li/i/13458535',
rules: [
{
activityIds: '.activity.web.stage.StageCommonWebActivity',
matches: '[text="去开启"] + View > Image[text.length=0]',
snapshotUrls: 'https://i.gkd.li/i/13458535',
},
],
},
],
});
7 changes: 5 additions & 2 deletions src/apps/cn.damai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,15 @@ export default defineGkdApp({
{
key: 1,
name: '全屏广告-弹窗广告',
fastQuery: true,
matchTime: 10000,
actionMaximum: 1,
resetMatch: 'app',
rules: [
{
key: 0,
activityIds: 'cn.damai.homepage.MainActivity',
matches:
'[id="cn.damai:id/homepage_popup_window_image"] + [id="cn.damai:id/homepage_popup_window_close_btn"]',
matches: '[id="cn.damai:id/homepage_popup_window_close_btn"]',
snapshotUrls: 'https://i.gkd.li/i/13627900',
},
],
Expand Down
10 changes: 5 additions & 5 deletions src/apps/cn.edu.buaa.wxwork.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ export default defineGkdApp({
desc: '点击[确认登录]',
matchTime: 10000,
actionMaximum: 1,
activityIds: [
'com.tencent.wework.common.web.JsWebActivity',
'com.tencent.wework.launch.WwMainActivity',
],
rules: [
{
activityIds: [
'com.tencent.wework.common.web.JsWebActivity',
'com.tencent.wework.launch.WwMainActivity',
],
matches: '[desc="确认登录"][clickable=true]',
exampleUrls: 'https://e.gkd.li/501ba684-b4a5-40e8-9e24-c61048569667',
snapshotUrls: [
'https://i.gkd.li/i/16784272',
'https://i.gkd.li/i/16784259',
],
exampleUrls: 'https://e.gkd.li/501ba684-b4a5-40e8-9e24-c61048569667',
},
],
},
Expand Down
11 changes: 8 additions & 3 deletions src/apps/cn.emagsoftware.gamehall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,14 @@ export default defineGkdApp({
matchTime: 10000,
actionMaximum: 1,
resetMatch: 'app',
rules:
'[id="cn.emagsoftware.gamehall:id/btn_update"] -2 [id="cn.emagsoftware.gamehall:id/btn_cancle"]',
snapshotUrls: 'https://i.gkd.li/i/13448894',
rules: [
{
activityIds: 'com.migugame.home_module.ui.activity.HomeActivity',
matches:
'[id="cn.emagsoftware.gamehall:id/btn_update"] -2 [id="cn.emagsoftware.gamehall:id/btn_cancle"]',
snapshotUrls: 'https://i.gkd.li/i/13448894',
},
],
},
],
});
12 changes: 9 additions & 3 deletions src/apps/cn.gov.pbc.dcep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,17 @@ export default defineGkdApp({
key: 1,
name: '更新提示',
fastQuery: true,
matchTime: 10000,
actionMaximum: 1,
resetMatch: 'app',
rules: '[vid="upgrade_dialog_cancel"][text!="退出应用"]',
snapshotUrls: 'https://i.gkd.li/i/13840408',
excludeSnapshotUrls: 'https://i.gkd.li/i/17607391',
rules: [
{
activityIds: '.main.activity.MainActivity',
matches: '[vid="upgrade_dialog_cancel"][text!="退出应用"]',
snapshotUrls: 'https://i.gkd.li/i/13840408',
excludeSnapshotUrls: 'https://i.gkd.li/i/17607391',
},
],
},
],
});
10 changes: 0 additions & 10 deletions src/apps/cn.lezhi.speedtest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,5 @@ export default defineGkdApp({
},
],
},
{
key: 1,
name: '更新提示',
matchTime: 10000,
actionMaximum: 1,
resetMatch: 'app',
rules:
'[id="cn.lezhi.speedtest:id/rl_update_dialog_layout"] >2 [id="cn.lezhi.speedtest:id/iv_close"]',
snapshotUrls: 'https://i.gkd.li/i/12727619',
},
],
});
15 changes: 11 additions & 4 deletions src/apps/cn.net.shizheng.study.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,17 @@ export default defineGkdApp({
{
key: 1,
name: '全屏广告-首页弹窗广告',
activityIds: 'cn.dingwei.cloud_classroom.MainActivity',
rules:
'View[childCount=2] > ImageView[id=""] + Button[id=""][clickable=true]',
snapshotUrls: 'https://i.gkd.li/i/12708731',
matchTime: 10000,
actionMaximum: 1,
resetMatch: 'app',
rules: [
{
activityIds: 'cn.dingwei.cloud_classroom.MainActivity',
matches:
'View[childCount=2] > ImageView[id=""] + Button[id=""][clickable=true]',
snapshotUrls: 'https://i.gkd.li/i/12708731',
},
],
},
],
});
18 changes: 13 additions & 5 deletions src/apps/cn.soulapp.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ export default defineGkdApp({
{
key: 2,
name: '局部广告-广场页卡片广告',
fastQuery: true,
activityIds: 'cn.soulapp.android.component.startup.main.MainActivity',
rules: [
{
fastQuery: true,
activityIds: 'cn.soulapp.android.component.startup.main.MainActivity',
matches:
'[id="cn.soulapp.android:id/sl_ad_root"] >n [id="cn.soulapp.android:id/fl_tag_container"]',
snapshotUrls: 'https://i.gkd.li/i/12838000',
Expand All @@ -39,12 +39,13 @@ export default defineGkdApp({
{
key: 3,
name: '评价提示-app评分',
fastQuery: true,
matchTime: 10000,
actionMaximum: 1,
resetMatch: 'app',
fastQuery: true,
rules: [
{
activityIds: '.component.chat.ConversationActivity',
matches:
'[id="cn.soulapp.android:id/score_message"] +3 [id="cn.soulapp.android:id/cancel"]',
snapshotUrls: 'https://i.gkd.li/i/13425057',
Expand All @@ -59,6 +60,7 @@ export default defineGkdApp({
actionMaximum: 1,
resetMatch: 'app',
actionMaximumKey: 0,
activityIds: '.component.startup.main.MainActivity',
rules: [
{
key: 0,
Expand All @@ -77,10 +79,16 @@ export default defineGkdApp({
key: 5,
name: '权限提示-通知权限',
fastQuery: true,
matchTime: 10000,
actionMaximum: 1,
resetMatch: 'app',
rules: '[text="消息通知显示消息内容"] +3 [vid="img_close"]',
snapshotUrls: 'https://i.gkd.li/i/14332334',
rules: [
{
activityIds: '.component.startup.main.MainActivity',
matches: '[text="消息通知显示消息内容"] +3 [vid="img_close"]',
snapshotUrls: 'https://i.gkd.li/i/14332334',
},
],
},
{
key: 6,
Expand Down
26 changes: 19 additions & 7 deletions src/apps/cn.speedtest.lite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,29 @@ export default defineGkdApp({
matchTime: 10000,
actionMaximum: 1,
resetMatch: 'app',
rules:
'@[id="cn.speedtest.lite:id/iv_close"] - [id="cn.speedtest.lite:id/ll_main_pane"] >2 [id="cn.speedtest.lite:id/tv_upgrade_content"]',
snapshotUrls: 'https://i.gkd.li/i/12715483',
rules: [
{
activityIds: '.main.MainActivity',
matches:
'@[id="cn.speedtest.lite:id/iv_close"] - [id="cn.speedtest.lite:id/ll_main_pane"] >2 [id="cn.speedtest.lite:id/tv_upgrade_content"]',
snapshotUrls: 'https://i.gkd.li/i/12715483',
},
],
},
{
key: 10,
name: '全屏广告-新人专享优惠弹窗',
activityIds: 'cn.speedtest.lite.main.MainActivity',
rules:
'@[id="cn.speedtest.lite:id/iv_close"] - RelativeLayout >n [id="cn.speedtest.lite:id/ad_banner"]',
snapshotUrls: 'https://i.gkd.li/i/12715511',
matchTime: 10000,
actionMaximum: 1,
resetMatch: 'app',
rules: [
{
activityIds: 'cn.speedtest.lite.main.MainActivity',
matches:
'@[id="cn.speedtest.lite:id/iv_close"] - RelativeLayout >n [id="cn.speedtest.lite:id/ad_banner"]',
snapshotUrls: 'https://i.gkd.li/i/12715511',
},
],
},
],
});
Loading

0 comments on commit 953b691

Please sign in to comment.