mirror of
https://wget.la/https://github.com/Wxw-Gu/WechatExplorer
synced 2026-12-01 01:05:30 +08:00
feat: 支持图片密钥配置与内存扫描
This commit is contained in:
1 parent
8f2d83dead
commit
383ace8474
11 files changed
+490
-67
No files matched your search
@@ -8,6 +8,9 @@ export interface AppSettings {
|
||||
apiEnabled: boolean
|
||||
apiHost: string
|
||||
apiPort: number
|
||||
imageKeyRoot: string
|
||||
imageXorKey: string
|
||||
imageAesKey: string
|
||||
}
|
||||
|
||||
function getDefaultDbRoot(): string {
|
||||
@@ -102,11 +105,16 @@ function isUsableDbRoot(candidate?: string): boolean {
|
||||
}
|
||||
}
|
||||
|
||||
const defaultDbRoot = getDefaultDbRoot()
|
||||
|
||||
const DEFAULT_SETTINGS: AppSettings = {
|
||||
dbRoot: getDefaultDbRoot(),
|
||||
dbRoot: defaultDbRoot,
|
||||
apiEnabled: true,
|
||||
apiHost: '127.0.0.1',
|
||||
apiPort: 6131
|
||||
apiPort: 6131,
|
||||
imageKeyRoot: defaultDbRoot,
|
||||
imageXorKey: process.env.VITE_IMAGE_XOR_KEY || '',
|
||||
imageAesKey: process.env.VITE_IMAGE_AES_KEY || ''
|
||||
}
|
||||
|
||||
const SETTINGS_FILE = path.join(
|
||||
@@ -129,6 +137,9 @@ export function loadSettings(): AppSettings {
|
||||
if (process.platform === 'win32' && !isUsableDbRoot(cache.dbRoot)) {
|
||||
cache.dbRoot = getDefaultDbRoot()
|
||||
}
|
||||
if (!cache.imageKeyRoot) {
|
||||
cache.imageKeyRoot = cache.dbRoot
|
||||
}
|
||||
return cache
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
Reference in new issue
Block a user