mirror of
https://github.com/ILoveBingLu/CipherTalk.git
synced 2026-05-17 09:48:52 +08:00
6ef395f3c9
本次提交将应用版本更新到 4.2.0,并同步更新 package-lock、README 版本徽标和 CHANGELOG 发布说明。 主要变更: - 接入 CipherTalk 自研图片 DAT 原生解密模块,替换原先迁移自 WeFlow 的命名与资源落点。 - 新增 Windows x64 与 macOS arm64 的预编译 native addon 资源,并补充 manifest、检查脚本和同步脚本。 - 保留 native 优先、TypeScript 兜底的图片解密链路,兼容 V3/V4 图片、wxgf 后处理、缓存命中、高清图回退和实况照片提取。 - 优化图片解密服务的缓存校验、wxgf/HEVC 白图规避、耗时诊断和默认日志输出,减少线上噪音。 - 聊天消息列表改为动态高度虚拟列表,卸载屏幕外消息 DOM 与图片节点,降低长会话内存和渲染压力。 - 修复虚拟列表初始挂载时滚底与顶部历史预加载互相打架导致界面上下晃动的问题。 - 顶部历史消息改为接近顶部并向上滚动时提前加载,同时加强 prepend 后的滚动位置恢复。 - 解析图片 XML 中的宽高信息,并用于聊天图片骨架屏、未解密占位、已解密图片和图片查看器初始窗口尺寸。 - 打包清理逻辑改为按当前平台保留对应 native addon,避免安装包携带无关平台产物。 验证: - 已执行 npx tsc --noEmit,通过 TypeScript 类型检查。 - 本地未执行应用构建,发布构建交由 GitHub Actions 的 tag 发布工作流完成。
44 lines
1.4 KiB
JavaScript
44 lines
1.4 KiB
JavaScript
const fs = require('node:fs')
|
|
const path = require('node:path')
|
|
|
|
const rootDir = path.resolve(__dirname, '..')
|
|
const baseDir = path.join(rootDir, 'resources', 'wedecrypt')
|
|
const addonName = 'ciphertalk-image-native'
|
|
|
|
function resolvePlatformDir(value = process.platform) {
|
|
if (value === 'win32') return 'win32'
|
|
if (value === 'darwin' || value === 'macos') return 'macos'
|
|
if (value === 'linux') return 'linux'
|
|
throw new Error(`Unsupported platform: ${value}`)
|
|
}
|
|
|
|
function resolveArchDir(value = process.arch) {
|
|
if (value === 'x64') return 'x64'
|
|
if (value === 'arm64') return 'arm64'
|
|
throw new Error(`Unsupported arch: ${value}`)
|
|
}
|
|
|
|
function main() {
|
|
const platformDir = resolvePlatformDir(process.env.CIPHERTALK_IMAGE_NATIVE_PLATFORM || process.platform)
|
|
const archDir = resolveArchDir(process.env.CIPHERTALK_IMAGE_NATIVE_ARCH || process.arch)
|
|
const addonPath = path.join(baseDir, `${addonName}-${platformDir}-${archDir}.node`)
|
|
|
|
console.log(`[image-native-check] target: ${platformDir}/${archDir}`)
|
|
console.log(`[image-native-check] addon path: ${addonPath}`)
|
|
|
|
if (!fs.existsSync(addonPath)) {
|
|
console.error('[image-native-check] missing image native addon')
|
|
process.exit(2)
|
|
}
|
|
|
|
const stat = fs.statSync(addonPath)
|
|
if (!stat.isFile() || stat.size <= 0) {
|
|
console.error('[image-native-check] invalid image native addon')
|
|
process.exit(3)
|
|
}
|
|
|
|
console.log(`[image-native-check] ok (${stat.size} bytes)`)
|
|
}
|
|
|
|
main()
|