feat: order

This commit is contained in:
lisonge 2024-01-29 11:01:55 +08:00
parent b604e7c8ac
commit dcd0623766
3 changed files with 6 additions and 2 deletions

View File

@ -1,5 +1,6 @@
import apps from './rawApps';
import type { RawGlobalGroup } from './types';
import { OPEN_AD_ORDER } from './utils';
const diabledAppIds = [
'com.android.systemui', // 通知栏界面
@ -31,7 +32,7 @@ const globalGroups: RawGlobalGroup[] = [
{
key: 0,
name: '开屏广告',
order: -1,
order: OPEN_AD_ORDER,
actionMaximum: 2,
matchTime: 10000,
resetMatch: 'app',

View File

@ -5,6 +5,7 @@ import picocolors from 'picocolors';
import { pinyin } from 'pinyin-pro';
import { walk } from './file';
import type { RawApp } from './types';
import { OPEN_AD_ORDER } from './utils';
const rawApps: RawApp[] = [];
for await (const tsFp of walk(process.cwd() + '/src/apps')) {
@ -26,7 +27,7 @@ for await (const tsFp of walk(process.cwd() + '/src/apps')) {
if (!g.name.startsWith('开屏广告')) {
g.enable = false;
} else {
g.order = -1;
g.order = OPEN_AD_ORDER;
}
});
rawApps.push(appConfig);

View File

@ -5,3 +5,5 @@ export const tryRun = <T>(fc: () => T, fallbackFc: (e: unknown) => T) => {
return fallbackFc(e);
}
};
export const OPEN_AD_ORDER = -10;