mirror of
https://wget.la/https://github.com/Wxw-Gu/WechatExplorer
synced 2026-08-18 12:07:01 +08:00
实现图片解密设置页
This commit is contained in:
@@ -21,3 +21,21 @@ export async function isWindowsWechatRunning(): Promise<boolean> {
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
export async function isWechatRunning(): Promise<boolean> {
|
||||
if (process.platform === 'win32') return isWindowsWechatRunning()
|
||||
if (process.platform !== 'darwin') return false
|
||||
|
||||
for (const args of [
|
||||
['-x', 'WeChat'],
|
||||
['-f', 'WeChat.app/Contents/MacOS/WeChat']
|
||||
]) {
|
||||
try {
|
||||
const { stdout } = await execFileAsync('/usr/bin/pgrep', args)
|
||||
if (stdout.trim()) return true
|
||||
} catch {
|
||||
// Try the next macOS process lookup strategy.
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user