mirror of
https://github.com/AIsouler/GKD_subscription.git
synced 2025-12-20 16:54:43 +08:00
feat: 全局规则自动禁用
This commit is contained in:
@@ -1,5 +1,22 @@
|
||||
import apps from './rawApps';
|
||||
import type { RawGlobalGroup } from './types';
|
||||
|
||||
const diabledAppIds = [
|
||||
'com.android.systemui',
|
||||
'com.miui.aod',
|
||||
'com.miui.home',
|
||||
'com.android.launcher.Launcher',
|
||||
'com.bbk.launcher2.Launcher',
|
||||
'com.huawei.android.launcher.unihome.UniHomeLauncher',
|
||||
];
|
||||
|
||||
// 如果应用规则已有开屏广告一类的规则, 则在全局规则禁用此应用
|
||||
diabledAppIds.push(
|
||||
...apps
|
||||
.filter((a) => a.groups.some((g) => g.name.startsWith('开屏广告')))
|
||||
.map((a) => a.id),
|
||||
);
|
||||
|
||||
const globalGroups: RawGlobalGroup[] = [
|
||||
{
|
||||
key: 0,
|
||||
@@ -23,20 +40,7 @@ const globalGroups: RawGlobalGroup[] = [
|
||||
action: 'clickCenter',
|
||||
},
|
||||
],
|
||||
apps: [
|
||||
{
|
||||
id: 'com.android.systemui',
|
||||
enable: false,
|
||||
},
|
||||
{
|
||||
id: 'com.miui.aod',
|
||||
enable: false,
|
||||
},
|
||||
{
|
||||
id: 'com.miui.home',
|
||||
enable: false,
|
||||
},
|
||||
],
|
||||
apps: diabledAppIds.map((id) => ({ id, enable: false })),
|
||||
},
|
||||
];
|
||||
export default globalGroups;
|
||||
|
||||
Reference in New Issue
Block a user