mirror of
https://wget.la/https://github.com/Wxw-Gu/WechatExplorer
synced 2026-08-18 03:57:02 +08:00
feat: 支持图片密钥配置与内存扫描
This commit is contained in:
@@ -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