From e885877913a6f706b70d817c6888a86cf13e847c Mon Sep 17 00:00:00 2001 From: lisonge Date: Tue, 29 Aug 2023 11:28:27 +0800 Subject: [PATCH] chore: sync --- dist/gkd.json | 29 +++++++++++++++-------------- package.json | 7 +++++-- pnpm-lock.yaml | 17 +++++++++++++---- src/apps/air.tv.douyu.android.ts | 2 ++ src/apps/com.kwai.videoeditor.ts | 3 ++- src/main.ts | 14 +++++++++++++- 6 files changed, 50 insertions(+), 22 deletions(-) diff --git a/dist/gkd.json b/dist/gkd.json index ac3c78f8..6aa1fbe0 100644 --- a/dist/gkd.json +++ b/dist/gkd.json @@ -1,7 +1,7 @@ { "id": 0, "name": "默认订阅", - "version": 30, + "version": 31, "author": "lisonge", "supportUrl": "https://github.com/gkd-kit/subscription", "apps": [ @@ -16,6 +16,7 @@ "miuix.appcompat.app.m" ], "rules": [ + "@TextView[text^='跳过'] + LinearLayout TextView[text*=\"跳转\"]", "[text^='跳过'] + * >2 TextView[text*='跳转']" ] }, @@ -30,19 +31,6 @@ } ] }, - { - "id": "air.tv.douyu.android", - "groups": [ - { - "key": 0, - "name": "快影-开屏广告", - "activityIds": "com.kwai.videoeditor.activity.splash.InnerVideoSplashActivity", - "rules": [ - "Button[text=\"跳过\"]" - ] - } - ] - }, { "id": "cmb.pb", "groups": [ @@ -591,6 +579,19 @@ } ] }, + { + "id": "com.kwai.videoeditor", + "groups": [ + { + "key": 0, + "name": "快影-开屏广告", + "activityIds": "com.kwai.videoeditor.activity.splash.InnerVideoSplashActivity", + "rules": [ + "Button[text=\"跳过\"]" + ] + } + ] + }, { "id": "com.mihoyo.hyperion", "groups": [ diff --git a/package.json b/package.json index 6c30b1d6..53119a31 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@gkd-kit/subscription", "type": "module", - "version": "0.0.30", + "version": "0.0.31", "main": "./dist/gkd.json", "unpkg": "./dist/gkd.json", "jsdelivr": "./dist/gkd.json", @@ -12,7 +12,7 @@ "build": "tsx ./src/main.ts" }, "devDependencies": { - "@gkd-kit/selector": "0.0.10", + "@gkd-kit/selector": "0.0.11", "@types/lodash": "^4.14.195", "@types/node": "^20.4.2", "@types/prettier": "2.7.3", @@ -38,5 +38,8 @@ }, "volta": { "node": "20.5.0" + }, + "dependencies": { + "picocolors": "1.0.0" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4f137aa7..5ffe71c8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,10 +4,15 @@ settings: autoInstallPeers: false excludeLinksFromLockfile: false +dependencies: + picocolors: + specifier: 1.0.0 + version: 1.0.0 + devDependencies: '@gkd-kit/selector': - specifier: 0.0.10 - version: 0.0.10 + specifier: 0.0.11 + version: 0.0.11 '@types/lodash': specifier: ^4.14.195 version: 4.14.195 @@ -266,8 +271,8 @@ packages: dev: true optional: true - /@gkd-kit/selector@0.0.10: - resolution: {integrity: sha512-k9kE8ZrqJ6CoNSXqjlxZ0EbdwSsNXwkQJ1TwZ33Yxh1ujITyOGJk0D+gwaNzOCj6qRfAomdTXPXXk44YVVWqCA==} + /@gkd-kit/selector@0.0.11: + resolution: {integrity: sha512-WqerYbOBOnVQkDgiqhjSFWfZZdJwPNiM1faFFVHrUCL0cwtpi0QZa0MEknd66i82kTs2bBwqmD8y21syNZaNDg==} dev: true /@tootallnate/once@1.1.2: @@ -862,6 +867,10 @@ packages: through: 2.3.8 dev: true + /picocolors@1.0.0: + resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} + dev: false + /prelude-ls@1.1.2: resolution: {integrity: sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==} engines: {node: '>= 0.8.0'} diff --git a/src/apps/air.tv.douyu.android.ts b/src/apps/air.tv.douyu.android.ts index a80f2579..3ee11c23 100644 --- a/src/apps/air.tv.douyu.android.ts +++ b/src/apps/air.tv.douyu.android.ts @@ -11,6 +11,8 @@ export default { `miuix.appcompat.app.m`, ], rules: [ + // https://gkd-kit.gitee.io/import/38517192/50c858ee-d331-4d5a-b5db-5eb17323c5ff + `@TextView[text^='跳过'] + LinearLayout TextView[text*="跳转"]`, `[text^='跳过'] + * >2 TextView[text*='跳转']`, // 1686970245243, 1686970188866 ], }, diff --git a/src/apps/com.kwai.videoeditor.ts b/src/apps/com.kwai.videoeditor.ts index 443270ae..2ada0b61 100644 --- a/src/apps/com.kwai.videoeditor.ts +++ b/src/apps/com.kwai.videoeditor.ts @@ -1,12 +1,13 @@ import type { AppConfig } from '../types'; export default { - id: 'air.tv.douyu.android', + id: 'com.kwai.videoeditor', groups: [ { key: 0, name: `快影-开屏广告`, activityIds: `com.kwai.videoeditor.activity.splash.InnerVideoSplashActivity`, + // https://gkd-kit.gitee.io/import/38517192/d12c3b08-8233-4584-b2b9-595ebb4ce665 rules: [`Button[text="跳过"]`], }, ], diff --git a/src/main.ts b/src/main.ts index c8d782bd..8f94140c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,11 +1,23 @@ import { relativePath, walk, writeConfig } from './file'; import { AppConfig, AppConfigMudule } from './types'; import url from 'node:url'; +import path from 'node:path'; +import picocolors from 'picocolors'; const apps: AppConfig[] = []; for await (const tsFp of walk(relativePath('./apps'))) { const mod: AppConfigMudule = await import(url.pathToFileURL(tsFp).href); - apps.push(mod.default); + const appConfig = mod.default; + if (path.basename(tsFp, `.ts`) != appConfig.id) { + throw new Error( + `${picocolors.blue( + tsFp, + )} file basename is not equal to its app id ${picocolors.blue( + appConfig.id, + )} `, + ); + } + apps.push(appConfig); } // a,b,c,d