mirror of
https://wget.la/https://github.com/Wxw-Gu/WechatExplorer
synced 2026-10-06 13:54:10 +08:00
feat: mac发送能力重构为libtmwechat
- 发送改走本地host, 在微信登录时触发 - 删除旧OneBot及对应UI控制面
This commit is contained in:
@@ -53,7 +53,7 @@ describe('sticker HTTP failures', () => {
|
||||
})
|
||||
|
||||
describe('personal WeChat runtime security invariants', () => {
|
||||
it('waits for sender termination during application shutdown', () => {
|
||||
it('waits for the macOS native runtime to detach during application shutdown', () => {
|
||||
const mainSource = readFileSync(resolve('src/main/index.ts'), 'utf8')
|
||||
const shutdownStart = mainSource.indexOf("app.on('before-quit'")
|
||||
const shutdownEnd = mainSource.indexOf('function showMainWindow', shutdownStart)
|
||||
@@ -62,39 +62,16 @@ describe('personal WeChat runtime security invariants', () => {
|
||||
expect(shutdownStart).toBeGreaterThanOrEqual(0)
|
||||
expect(shutdownEnd).toBeGreaterThan(shutdownStart)
|
||||
expect(shutdownSource).toContain('await Promise.all([')
|
||||
expect(shutdownSource).toContain('personalWechatSendService.terminate()')
|
||||
expect(shutdownSource).not.toContain('personalWechatSendService.stop()')
|
||||
|
||||
const senderSource = readFileSync(
|
||||
resolve('src/main/services/personal-wechat-send-service.ts'),
|
||||
'utf8'
|
||||
)
|
||||
expect(senderSource).toContain("process.kill(pid, 'SIGTERM')")
|
||||
expect(senderSource).toContain("process.kill(pid, 'SIGKILL')")
|
||||
expect(senderSource).toContain('const trackedPid = this.child?.pid')
|
||||
expect(shutdownSource).toContain('macWechatRuntimeManager.shutdown()')
|
||||
})
|
||||
|
||||
it('does not install Python packages while preparing the sender runtime', () => {
|
||||
const runtimeManagerSource = readFileSync(
|
||||
resolve('src/main/services/personal-wechat-runtime-manager.ts'),
|
||||
'utf8'
|
||||
)
|
||||
it('does not install Python packages while preparing the native runtime', () => {
|
||||
const preparationScriptSource = readFileSync(
|
||||
resolve('scripts/prepare-wechat-chatter-runtime.cjs'),
|
||||
resolve('scripts/prepare-wechat-native-runtime.cjs'),
|
||||
'utf8'
|
||||
)
|
||||
|
||||
for (const source of [runtimeManagerSource, preparationScriptSource]) {
|
||||
expect(source).not.toContain('pilk==')
|
||||
expect(source).not.toMatch(/['"]pip['"]/)
|
||||
expect(source).toContain('voiceAudioDataAddr = Memory.alloc(audioLen + 1);')
|
||||
expect(source).toContain('上传前按语音长度重新分配')
|
||||
}
|
||||
|
||||
const senderSource = readFileSync(
|
||||
resolve('src/main/services/personal-wechat-send-service.ts'),
|
||||
'utf8'
|
||||
)
|
||||
expect(senderSource).toContain('buildPersonalWechatRuntimeEnvironment(preflight.runtime.root)')
|
||||
expect(preparationScriptSource).not.toContain('pilk==')
|
||||
expect(preparationScriptSource).not.toMatch(/['"]pip['"]/)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user