实现图片解密设置页

This commit is contained in:
电摇小子
2026-07-14 11:07:35 +08:00
parent f1ceef0e5e
commit 7b54b611d3
24 changed files with 1541 additions and 42 deletions
+71
View File
@@ -0,0 +1,71 @@
export type ImageKeySource = 'secure-storage' | 'legacy-settings' | 'environment' | 'none'
export type ImageResourceState = 'available' | 'unavailable' | 'unknown'
export interface ImageKeyConfigResult {
success: boolean
configured: boolean
saved: boolean
encryptionAvailable: boolean
source: ImageKeySource
accountId?: string
resourceRoot: string
xorKey?: string
aesKey?: string
updatedAt?: number
error?: string
}
export interface ImageResourceCheck {
state: ImageResourceState
detail: string
}
export interface ImageDecryptionStatus {
configured: boolean
saved: boolean
encryptionAvailable: boolean
source: ImageKeySource
accountId?: string
resourceRoot: string
updatedAt?: number
platform: NodeJS.Platform
autoDetectSupported: boolean
wechatRunning: boolean
accountIdentified: boolean
cacheState: 'normal' | 'unavailable'
resources: {
imageIndex: ImageResourceCheck
imageDirectory: ImageResourceCheck
thumbnail: ImageResourceCheck
original: ImageResourceCheck
sticker: ImageResourceCheck
video: ImageResourceCheck
}
}
export interface SaveImageKeyRequest {
resourceRoot: string
xorKey: string
aesKey: string
}
export interface TestImageDecryptionRequest extends SaveImageKeyRequest {
userMd5: string
}
export interface ImageDecryptionTestResult {
success: boolean
code?:
| 'NOT_CONFIGURED'
| 'NO_CONVERSATION'
| 'NO_IMAGE_MESSAGE'
| 'FILE_NOT_FOUND'
| 'DECRYPT_FAILED'
| 'ACCOUNT_MISMATCH'
| 'UNKNOWN'
error?: string
fileFound: boolean
decrypted: boolean
readable: boolean
isThumbnail?: boolean
}