Files
AIsouler-GKD_subscription/src/globalGroups.ts
2024-03-11 22:31:36 +08:00

162 lines
6.7 KiB
TypeScript

import apps from './rawApps';
import { RawGlobalGroup } from '@gkd-kit/api';
import * as utils from './utils';
// 全局禁用
const diabledAppIds: string[] = [
// 在一些非系统应用中禁用
'com.tencent.mm', // 微信
'li.songe.gkd', // GKD
'com.eg.android.AlipayGphone', //支付宝
'com.tencent.wetype', // 微信输入法
'com.tmri.app.main', // 交管12123
'com.github.android', // GitHub
'org.telegram.messenger', // Telegram
'com.twitter.android', // X(推特)
'com.aistra.hail', // 雹
'com.heyanle.easybangumi4', // 纯纯看番
'com.perol.pixez', // PixEz
'com.perol.play.pixez', // PixEz Google Play版
'com.magicalstory.videos', // 奇妙影视
'com.guozhigq.pilipala', // PiliPala
'com.salt.music', // Salt Player
'com.xuncorp.qinalt.music', // 青盐云听
'com.github.wgh136.pica_comic', // Pica Comic
'com.yenaly.han1meviewer', // Han1meViewer
'ru.zdevs.zarchiver', // ZArchiver
'ru.zdevs.zarchiver.pro', // ZArchiver Pro
'me.zhanghai.android.files', // 质感文件
'com.xjcheng.musictageditor', // 音乐标签
'com.lalilu.lmusic', // LMusic
'com.ktls.fileinfo', // 存储空间清理
'idm.internet.download.manager', // 1DM
'idm.internet.download.manager.plus', // 1DM+
'com.mxtech.videoplayer', // MX播放器
'com.mxtech.videoplayer.pro', // MX播放器专业版
'com.github.kr328.clash', // Clash for Android
'com.x8bit.bitwarden', // Bitwarden
'org.localsend.localsend_app', // LocalSend
'moe.shizuku.privileged.api', // Shizuku
'com.ktls.automation', // 自动点击工具
'com.deepl.mobiletranslator', // DeepL
'com.accessibilitymanager', // 无障碍管理器
'me.tasy5kg.cutegif', // 小萌GIF
'com.absinthe.libchecker', // LibChecker
'com.github.metacubex.clash.meta', // Clash Meta for Android
'io.github.jd1378.otphelper', // 短信验证码自动复制
'com.valvesoftware.android.steam.community', // Steam
'io.legado.app.release', // 阅读
'com.getsurfboard', // Surfboard
'moe.nb4a', // NekoBox
'com.v2ray.ang', // v2rayNG
'com.xiaoyv.bangumi', // Bangumi for Android
'com.funny.translation', // 译站
'com.looker.droidify', // Droid-ify
'app.eleven.com.fastfiletransfer', // 文件闪传
'com.idaodan.clean.master', // 雪豹速清
'com.samsung.agc.gcam84', // 相机
'com.wsw.cospa', // 异次元
'app.mihon', // Mihon
// https://github.com/gkd-kit/gkd/issues/451
'mark.via', // via浏览器
'mark.via.gp', // via浏览器Google Play版
'com.mmbox.xbrowser', // X浏览器
'com.mmbox.xbrowser.pro', // X浏览器Google Play版
'com.mycompany.app.soulbrowser', // soul浏览器
];
// 如果应用规则已有全局规则中的某一类的规则, 则在对应全局规则禁用此应用
function filterAppsByGroup(apps: any[], groupNamePrefix: string): string[] {
return apps
.filter(
(a) =>
a.groups.filter((g: { name: string }) =>
g.name.startsWith(groupNamePrefix),
).length > 0,
)
.map((a) => a.id);
}
// 设置单独禁用
const uniqueAppIdsAD = new Set([
...diabledAppIds,
'com.taptap', // TapTap
...filterAppsByGroup(apps, '开屏广告'),
]);
const uniqueAppIdsUP = new Set([
...diabledAppIds,
...filterAppsByGroup(apps, '更新提示'),
]);
const uniqueAppIdsYM = new Set([
...diabledAppIds,
'xxx.pornhub.fuck', // JavDB
...filterAppsByGroup(apps, '青少年模式'),
]);
const globalGroups: RawGlobalGroup[] = [
{
key: 0,
name: '开屏广告',
order: utils.OPEN_AD_ORDER,
matchTime: 10000,
actionMaximum: 2,
resetMatch: 'app',
actionCdKey: 0,
actionMaximumKey: 0,
rules: [
{
key: 0,
quickFind: true,
matches: '[text*="跳过"][text.length<10][visibleToUser=true]',
},
{
key: 1,
matches:
'[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")]',
},
],
apps: [...uniqueAppIdsAD].map((id) => ({ id, enable: false })),
},
{
key: 1,
name: '更新提示',
order: utils.UPDATE_ORDER,
matchTime: 10000,
actionMaximum: 1,
resetMatch: 'app',
actionCdKey: 0,
actionMaximumKey: 0,
rules: [
{
key: 0,
matches: [
'[name!$=".CheckBox"][childCount=0][visibleToUser=true][height>0 && width>0][(text*="内测" || text*="测试版" || text*="新版" || text*="更新" || text*="升级" || text*="体验" || text*="內測" || text*="測試版" || text*="升級" || text*="體驗" || text*="Update" || text*="Upgrade" || text*="Experience") && text!*="自动" && text!*="自動" && (text!*="成功" && text!*="失败" && text!*="失敗" && (text!*="已" || text*="已知") && text!*="检查更新")]',
'[name!$=".CheckBox"][childCount=0][visibleToUser=true][height>0 && width>0][(((text*="立即" || text*="马上" || text*="并" || text*="现在" || text*="立刻" || text*="抢先" || text*="在线")&&(text*="更新" || text*="下载" || text*="安装" || text*="升级" || text*="查看" || text*="体验")) || text="更新" || text="下载" || text="安装" || text="升级" || text="确定" || text="好,升级") && text.length<6]',
'[name!$=".CheckBox"][childCount=0][visibleToUser=true][height>0 && width>0][text^="不再" || text$="再说" || text$="拒绝" || text$="再想想" || text^="忽略" || text^="暂不" || text^="放弃" || text^="取消" || text$="不要" || text$="再說" || text$="暫不" || text$="拒絕" || text$="Later" || text^="Ignore" || text^="Not now" || text^="Cancel" || vid^="close" || vid^="Close" || vid^="closeIv" || vid*="_close" || vid*="_Close" || vid$="close" || vid$="Close" || vid$="cancel" || vid$="Cancel" || vid$="cancle" || vid$="Cancle"]',
],
},
],
apps: [...uniqueAppIdsUP].map((id) => ({ id, enable: false })),
},
{
key: 2,
name: '青少年模式',
order: utils.YOUNG_ORDER,
matchTime: 10000,
actionMaximum: 1,
resetMatch: 'app',
rules: [
{
key: 0,
matches: [
'[name!$=".CheckBox"][childCount=0][visibleToUser=true][height>0 && width>0][((text*="青少年" || text*="未成年") && text*="模式" || text*="儿童模式") && text.length<15 || ((desc*="青少年" || desc*="未成年") && desc*="模式") && desc.length<15]',
'[name!$=".CheckBox"][childCount=0][visibleToUser=true][height>0 && width>0][text*="知道了" || text*="关闭" || text="我已知晓" || desc*="知道了" || desc*="关闭"]',
],
},
],
apps: [...uniqueAppIdsYM].map((id) => ({ id, enable: false })),
},
];
export default globalGroups;