Compare commits

..

2 Commits

Author SHA1 Message Date
Memory
e20e46aebe
fix: correct split logic in parseSubinfo (#960) 2025-08-15 20:21:18 +08:00
Memory
a23e23a697
fx: only detect mihomo (#958) 2025-08-15 13:56:59 +08:00
2 changed files with 2 additions and 2 deletions

View File

@ -226,7 +226,7 @@ function parseFilename(str: string): string {
// subscription-userinfo: upload=1234; download=2234; total=1024000; expire=2218532293 // subscription-userinfo: upload=1234; download=2234; total=1024000; expire=2218532293
function parseSubinfo(str: string): ISubscriptionUserInfo { function parseSubinfo(str: string): ISubscriptionUserInfo {
const parts = str.split('; ') const parts = str.split(/\s*;\s*/)
const obj = {} as ISubscriptionUserInfo const obj = {} as ISubscriptionUserInfo
parts.forEach((part) => { parts.forEach((part) => {
const [key, value] = part.split('=') const [key, value] = part.split('=')

View File

@ -522,7 +522,7 @@ async function checkHighPrivilegeMihomoProcess(): Promise<boolean> {
const processJson = JSON.parse(processInfo) const processJson = JSON.parse(processInfo)
await managerLogger.info(`Process ${pid} info: ${processInfo.substring(0, 200)}`) await managerLogger.info(`Process ${pid} info: ${processInfo.substring(0, 200)}`)
if (processJson.Name === "mihomo" && processJson.Path === null) { if (processJson.Name.includes('mihomo') && processJson.Path === null) {
return true return true
} }
} catch (error) { } catch (error) {