mirror of
https://github.com/hicccc77/WeFlow.git
synced 2026-04-26 07:26:46 +00:00
修复文案描述与添加hardlink备份支持
This commit is contained in:
@@ -9,7 +9,7 @@ import { wcdbService } from './wcdbService'
|
|||||||
import { expandHomePath } from '../utils/pathUtils'
|
import { expandHomePath } from '../utils/pathUtils'
|
||||||
import { decryptDatViaNative, encryptDatViaNative, type NativeDatMeta } from './nativeImageDecrypt'
|
import { decryptDatViaNative, encryptDatViaNative, type NativeDatMeta } from './nativeImageDecrypt'
|
||||||
|
|
||||||
type BackupDbKind = 'session' | 'contact' | 'emoticon' | 'message' | 'media' | 'sns'
|
type BackupDbKind = 'session' | 'contact' | 'emoticon' | 'message' | 'media' | 'sns' | 'hardlink'
|
||||||
type BackupPhase = 'preparing' | 'scanning' | 'exporting' | 'packing' | 'inspecting' | 'restoring' | 'done' | 'failed'
|
type BackupPhase = 'preparing' | 'scanning' | 'exporting' | 'packing' | 'inspecting' | 'restoring' | 'done' | 'failed'
|
||||||
type BackupResourceKind = 'image' | 'video' | 'file'
|
type BackupResourceKind = 'image' | 'video' | 'file'
|
||||||
const TEMP_MARKER = '.weflow-backup-temp'
|
const TEMP_MARKER = '.weflow-backup-temp'
|
||||||
@@ -497,7 +497,7 @@ export class BackupService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private buildDbId(kind: BackupDbKind, index: number, dbPath: string): string {
|
private buildDbId(kind: BackupDbKind, index: number, dbPath: string): string {
|
||||||
if (kind === 'session' || kind === 'contact' || kind === 'emoticon' || kind === 'sns') return kind
|
if (kind === 'session' || kind === 'contact' || kind === 'emoticon' || kind === 'sns' || kind === 'hardlink') return kind
|
||||||
return `${kind}-${index}-${safeName(basename(dbPath)).slice(0, 80)}`
|
return `${kind}-${index}-${safeName(basename(dbPath)).slice(0, 80)}`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -521,6 +521,7 @@ export class BackupService {
|
|||||||
if (kind === 'contact') return 'contact/contact.db'
|
if (kind === 'contact') return 'contact/contact.db'
|
||||||
if (kind === 'emoticon') return 'emoticon/emoticon.db'
|
if (kind === 'emoticon') return 'emoticon/emoticon.db'
|
||||||
if (kind === 'sns') return 'sns/sns.db'
|
if (kind === 'sns') return 'sns/sns.db'
|
||||||
|
if (kind === 'hardlink') return 'hardlink/hardlink.db'
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -570,12 +571,19 @@ export class BackupService {
|
|||||||
join(dirname(dbStorage), 'sns', 'sns.db')
|
join(dirname(dbStorage), 'sns', 'sns.db')
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
|
if (kind === 'hardlink') {
|
||||||
|
return this.findFirstExisting([
|
||||||
|
join(dbStorage, 'hardlink', 'hardlink.db'),
|
||||||
|
join(dbStorage, 'hardlink.db'),
|
||||||
|
join(dirname(dbStorage), 'hardlink.db')
|
||||||
|
])
|
||||||
|
}
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
|
|
||||||
private async collectDatabases(dbStorage: string): Promise<Array<Omit<BackupDbEntry, 'tables'>>> {
|
private async collectDatabases(dbStorage: string): Promise<Array<Omit<BackupDbEntry, 'tables'>>> {
|
||||||
const result: Array<Omit<BackupDbEntry, 'tables'>> = []
|
const result: Array<Omit<BackupDbEntry, 'tables'>> = []
|
||||||
for (const kind of ['session', 'contact', 'emoticon', 'sns'] as const) {
|
for (const kind of ['session', 'contact', 'emoticon', 'sns', 'hardlink'] as const) {
|
||||||
const dbPath = this.resolveKnownDbPath(kind, dbStorage)
|
const dbPath = this.resolveKnownDbPath(kind, dbStorage)
|
||||||
result.push({
|
result.push({
|
||||||
id: kind,
|
id: kind,
|
||||||
|
|||||||
@@ -707,7 +707,7 @@ export class KeyServiceMac {
|
|||||||
}
|
}
|
||||||
if (code === 'HOOK_FAILED') {
|
if (code === 'HOOK_FAILED') {
|
||||||
if (normalizedDetail.includes('HOOK_TIMEOUT')) {
|
if (normalizedDetail.includes('HOOK_TIMEOUT')) {
|
||||||
return 'Hook 已安装,但在等待时间内未触发目标函数。请保持微信前台并执行一次会话/数据库访问后重试。'
|
return 'Hook 已安装,但在等待时间内未触发登录流程。请退出微信账号后重新登录,或在未登录状态下直接登录微信,完成一次登录流程后重试。'
|
||||||
}
|
}
|
||||||
if (normalizedDetail.includes('attach_wait_timeout')) {
|
if (normalizedDetail.includes('attach_wait_timeout')) {
|
||||||
return '附加调试器超时,未能进入 Hook 阶段。请确认微信处于可交互状态并重试。'
|
return '附加调试器超时,未能进入 Hook 阶段。请确认微信处于可交互状态并重试。'
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2
src/types/electron.d.ts
vendored
2
src/types/electron.d.ts
vendored
@@ -58,7 +58,7 @@ export interface BackupManifest {
|
|||||||
options?: BackupOptions
|
options?: BackupOptions
|
||||||
databases: Array<{
|
databases: Array<{
|
||||||
id: string
|
id: string
|
||||||
kind: 'session' | 'contact' | 'emoticon' | 'message' | 'media' | 'sns'
|
kind: 'session' | 'contact' | 'emoticon' | 'message' | 'media' | 'sns' | 'hardlink'
|
||||||
dbPath: string
|
dbPath: string
|
||||||
relativePath: string
|
relativePath: string
|
||||||
tables: Array<{
|
tables: Array<{
|
||||||
|
|||||||
Reference in New Issue
Block a user