mirror of
https://github.com/hicccc77/WeFlow.git
synced 2026-03-24 23:06:51 +00:00
修复打包
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { wcdbService } from './wcdbService'
|
import { wcdbService } from './wcdbService'
|
||||||
import { ConfigService } from './config'
|
import { ConfigService } from './config'
|
||||||
import { ContactCacheService } from './contactCacheService'
|
import { ContactCacheService } from './contactCacheService'
|
||||||
import { existsSync, mkdirSync } from 'fs'
|
import { existsSync, mkdirSync } from 'fs'
|
||||||
@@ -335,9 +335,19 @@ class SnsService {
|
|||||||
if (key && String(key).trim().length > 0) {
|
if (key && String(key).trim().length > 0) {
|
||||||
try {
|
try {
|
||||||
console.log(`[SnsService] 使用 WASM Isaac64 解密视频... Key: ${key}`)
|
console.log(`[SnsService] 使用 WASM Isaac64 解密视频... Key: ${key}`)
|
||||||
const wasmService = WasmService.getInstance()
|
const keyText = String(key).trim()
|
||||||
// 只需要前 128KB (131072 bytes) 用于解密头部
|
let keystream: Buffer
|
||||||
const keystream = await wasmService.getKeystream(String(key), 131072)
|
|
||||||
|
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)
|
const decryptLen = Math.min(keystream.length, raw.length)
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
},
|
},
|
||||||
"//": "二改不应改变此处的作者与应用信息",
|
"//": "二改不应改变此处的作者与应用信息",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "echo 'No native modules to rebuild'",
|
"postinstall": "electron-builder install-app-deps",
|
||||||
"rebuild": "electron-rebuild",
|
"rebuild": "electron-rebuild",
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "tsc && vite build && electron-builder",
|
"build": "tsc && vite build && electron-builder",
|
||||||
@@ -107,6 +107,10 @@
|
|||||||
{
|
{
|
||||||
"from": "public/icon.ico",
|
"from": "public/icon.ico",
|
||||||
"to": "icon.ico"
|
"to": "icon.ico"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": "electron/assets/wasm/",
|
||||||
|
"to": "assets/wasm/"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"files": [
|
"files": [
|
||||||
|
|||||||
Reference in New Issue
Block a user