diff --git a/src/main/core/manager.ts b/src/main/core/manager.ts index 9378f03..664e655 100644 --- a/src/main/core/manager.ts +++ b/src/main/core/manager.ts @@ -118,11 +118,7 @@ export async function startCore(detached = false): Promise[]> { core = 'mihomo', autoSetDNS = true, diffWorkDir = false, - mihomoCpuPriority = 'PRIORITY_NORMAL', - disableLoopbackDetector = false, - disableEmbedCA = false, - disableSystemCA = false, - skipSafePathCheck = false + mihomoCpuPriority = 'PRIORITY_NORMAL' } = await getAppConfig() const { 'log-level': logLevel } = await getControledMihomoConfig() if (existsSync(path.join(dataDir(), 'core.pid'))) { @@ -167,19 +163,13 @@ export async function startCore(detached = false): Promise[]> { // 内核日志输出到独立的 core-日期.log 文件 const stdout = createWriteStream(coreLogPath(), { flags: 'a' }) const stderr = createWriteStream(coreLogPath(), { flags: 'a' }) - const env = { - DISABLE_LOOPBACK_DETECTOR: String(disableLoopbackDetector), - DISABLE_EMBED_CA: String(disableEmbedCA), - DISABLE_SYSTEM_CA: String(disableSystemCA), - SKIP_SAFE_PATH_CHECK: String(skipSafePathCheck) - } + child = spawn( corePath, ['-d', diffWorkDir ? mihomoProfileWorkDir(current) : mihomoWorkDir(), ctlParam, dynamicIpcPath], { detached: detached, - stdio: detached ? 'ignore' : undefined, - env: env + stdio: detached ? 'ignore' : undefined } ) if (process.platform === 'win32' && child.pid) { @@ -463,15 +453,12 @@ export async function quitWithoutCore(): Promise { async function checkProfile(): Promise { const { core = 'mihomo', - diffWorkDir = false, - skipSafePathCheck = false + diffWorkDir = false } = await getAppConfig() const { current } = await getProfileConfig() const corePath = mihomoCorePath(core) const execFilePromise = promisify(execFile) - const env = { - SKIP_SAFE_PATH_CHECK: String(skipSafePathCheck) - } + try { await execFilePromise(corePath, [ '-t', @@ -479,7 +466,7 @@ async function checkProfile(): Promise { diffWorkDir ? mihomoWorkConfigPath(current) : mihomoWorkConfigPath('work'), '-d', mihomoTestDir() - ], { env }) + ]) } catch (error) { await managerLogger.error('Profile check failed', error) diff --git a/src/main/utils/template.ts b/src/main/utils/template.ts index 6e50d55..2d4df0d 100644 --- a/src/main/utils/template.ts +++ b/src/main/utils/template.ts @@ -25,11 +25,7 @@ export const defaultConfig: IAppConfig = { controlSniff: true, floatingWindowCompatMode: true, disableHardwareAcceleration: false, - disableLoopbackDetector: false, hideConnectionCardWave: false, - disableEmbedCA: false, - disableSystemCA: false, - skipSafePathCheck: false, nameserverPolicy: {}, siderOrder: [ 'sysproxy', diff --git a/src/renderer/src/pages/mihomo.tsx b/src/renderer/src/pages/mihomo.tsx index f23b1dc..7212662 100644 --- a/src/renderer/src/pages/mihomo.tsx +++ b/src/renderer/src/pages/mihomo.tsx @@ -42,11 +42,8 @@ const Mihomo: React.FC = () => { smartCoreCollectData = false, smartCoreStrategy = 'sticky-sessions', maxLogDays = 7, - sysProxy, - disableLoopbackDetector, - disableEmbedCA, - disableSystemCA, - skipSafePathCheck } = appConfig || {} + sysProxy + } = appConfig || {} const { controledMihomoConfig, patchControledMihomoConfig } = useControledMihomoConfig() interface WebUIPanel { @@ -1130,42 +1127,7 @@ const Mihomo: React.FC = () => { }} /> - - { - handleConfigChangeWithRestart('disableLoopbackDetector', v) - }} - /> - - - { - handleConfigChangeWithRestart('skipSafePathCheck', v) - }} - /> - - - { - handleConfigChangeWithRestart('disableEmbedCA', v) - }} - /> - - - { - handleConfigChangeWithRestart('disableSystemCA', v) - }} - /> - +