mirror of
https://github.com/hicccc77/WeFlow.git
synced 2026-03-20 06:14:33 +08:00
@@ -1,4 +1,4 @@
|
||||
import { wcdbService } from './wcdbService'
|
||||
import { wcdbService } from './wcdbService'
|
||||
import { ConfigService } from './config'
|
||||
import { ContactCacheService } from './contactCacheService'
|
||||
import { existsSync, mkdirSync } from 'fs'
|
||||
@@ -335,9 +335,19 @@ class SnsService {
|
||||
if (key && String(key).trim().length > 0) {
|
||||
try {
|
||||
console.log(`[SnsService] 使用 WASM Isaac64 解密视频... Key: ${key}`)
|
||||
const wasmService = WasmService.getInstance()
|
||||
// 只需要前 128KB (131072 bytes) 用于解密头部
|
||||
const keystream = await wasmService.getKeystream(String(key), 131072)
|
||||
const keyText = String(key).trim()
|
||||
let keystream: Buffer
|
||||
|
||||
try {
|
||||
const wasmService = WasmService.getInstance()
|
||||
// 只需要前 128KB (131072 bytes) 用于解密头部
|
||||
keystream = await wasmService.getKeystream(keyText, 131072)
|
||||
} catch (wasmErr) {
|
||||
// 打包漏带 wasm 或 wasm 初始化异常时,回退到纯 TS ISAAC64
|
||||
console.warn(`[SnsService] WASM 解密不可用,回退 Isaac64: ${wasmErr}`)
|
||||
const isaac = new Isaac64(keyText)
|
||||
keystream = isaac.generateKeystream(131072)
|
||||
}
|
||||
|
||||
const decryptLen = Math.min(keystream.length, raw.length)
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
},
|
||||
"//": "二改不应改变此处的作者与应用信息",
|
||||
"scripts": {
|
||||
"postinstall": "echo 'No native modules to rebuild'",
|
||||
"postinstall": "electron-builder install-app-deps",
|
||||
"rebuild": "electron-rebuild",
|
||||
"dev": "vite",
|
||||
"build": "tsc && vite build && electron-builder",
|
||||
@@ -107,6 +107,10 @@
|
||||
{
|
||||
"from": "public/icon.ico",
|
||||
"to": "icon.ico"
|
||||
},
|
||||
{
|
||||
"from": "electron/assets/wasm/",
|
||||
"to": "assets/wasm/"
|
||||
}
|
||||
],
|
||||
"files": [
|
||||
|
||||
Reference in New Issue
Block a user