feat: 全局规则系统应用启用名单

This commit is contained in:
AIsouler
2024-03-16 15:59:32 +08:00
parent b69f673853
commit 8dd43eefd1

View File

@@ -79,21 +79,36 @@ function filterAppsByGroup(apps: any[], groupNamePrefix: string): string[] {
} }
// 设置单独禁用 // 设置单独禁用
const uniqueAppIdsAD = new Set([ const diabledAppIdsAD = new Set([
...diabledAppIds, ...diabledAppIds,
'com.taptap', // TapTap 'com.taptap', // TapTap
...filterAppsByGroup(apps, '开屏广告'), ...filterAppsByGroup(apps, '开屏广告'),
]); ]);
const uniqueAppIdsUP = new Set([ const diabledAppIdsUP = new Set([
...diabledAppIds, ...diabledAppIds,
...filterAppsByGroup(apps, '更新提示'), ...filterAppsByGroup(apps, '更新提示'),
]); ]);
const uniqueAppIdsYM = new Set([ const diabledAppIdsYM = new Set([
...diabledAppIds, ...diabledAppIds,
'xxx.pornhub.fuck', // JavDB 'xxx.pornhub.fuck', // JavDB
...filterAppsByGroup(apps, '青少年模式'), ...filterAppsByGroup(apps, '青少年模式'),
]); ]);
// 系统软件全局启用
const enabledAppIds: string[] = [
// 在一些系统软件中启用
];
// 设置系统软件单独启用
const enabledAppIdsAD = new Set([
...enabledAppIds,
'com.bbk.theme', // i 主题
'com.sec.android.app.samsungapps', // 三星应用商店
'com.bbk.appstore', // vivo应用商店
]);
const enabledAppIdsUP = new Set([...enabledAppIds]);
const enabledAppIdsYM = new Set([...enabledAppIds]);
const globalGroups: RawGlobalGroup[] = [ const globalGroups: RawGlobalGroup[] = [
{ {
key: 0, key: 0,
@@ -116,7 +131,10 @@ const globalGroups: RawGlobalGroup[] = [
'[childCount=0][visibleToUser=true][(text.length<10 && (text*="跳过" || text*="跳過" || text*="skip" || text*="Skip")) || id$="tt_splash_skip_btn" || vid*="skip" || vid*="Skip" || desc*="跳过" || desc*="skip" || (vid*="count" && vid*="down" && vid!*="countdown" && vid!*="load" && vid!*="add" && vid!*="ead" && vid!*="time")]', '[childCount=0][visibleToUser=true][(text.length<10 && (text*="跳过" || text*="跳過" || text*="skip" || text*="Skip")) || id$="tt_splash_skip_btn" || vid*="skip" || vid*="Skip" || desc*="跳过" || desc*="skip" || (vid*="count" && vid*="down" && vid!*="countdown" && vid!*="load" && vid!*="add" && vid!*="ead" && vid!*="time")]',
}, },
], ],
apps: [...uniqueAppIdsAD].map((id) => ({ id, enable: false })), apps: [...diabledAppIdsAD].map(
(id) => ({ id, enable: false }),
[...enabledAppIdsAD].map((id) => ({ id, enable: true })),
),
}, },
{ {
key: 1, key: 1,
@@ -137,7 +155,10 @@ const globalGroups: RawGlobalGroup[] = [
], ],
}, },
], ],
apps: [...uniqueAppIdsUP].map((id) => ({ id, enable: false })), apps: [...diabledAppIdsUP].map(
(id) => ({ id, enable: false }),
[...enabledAppIdsUP].map((id) => ({ id, enable: true })),
),
}, },
{ {
key: 2, key: 2,
@@ -155,7 +176,10 @@ const globalGroups: RawGlobalGroup[] = [
], ],
}, },
], ],
apps: [...uniqueAppIdsYM].map((id) => ({ id, enable: false })), apps: [...diabledAppIdsYM].map(
(id) => ({ id, enable: false }),
[...enabledAppIdsYM].map((id) => ({ id, enable: true })),
),
}, },
]; ];
export default globalGroups; export default globalGroups;