mirror of
https://github.com/pompurin404/mihomo-party.git
synced 2024-11-16 11:42:19 +08:00
fix macos encrypt error
This commit is contained in:
parent
c61e1a0859
commit
32a1ea5cfb
|
@ -125,7 +125,7 @@ export function registerIpcMainHandlers(): void {
|
|||
ipcMain.handle('restartCore', ipcErrorWrapper(restartCore))
|
||||
ipcMain.handle('triggerSysProxy', (_e, enable) => ipcErrorWrapper(triggerSysProxy)(enable))
|
||||
ipcMain.handle('isEncryptionAvailable', isEncryptionAvailable)
|
||||
ipcMain.handle('encryptString', (_e, str) => safeStorage.encryptString(str))
|
||||
ipcMain.handle('encryptString', (_e, str) => encryptString(str))
|
||||
ipcMain.handle('manualGrantCorePermition', ipcErrorWrapper(manualGrantCorePermition))
|
||||
ipcMain.handle('getFilePath', (_e, ext) => getFilePath(ext))
|
||||
ipcMain.handle('readTextFile', (_e, filePath) => ipcErrorWrapper(readTextFile)(filePath))
|
||||
|
@ -146,3 +146,7 @@ export function registerIpcMainHandlers(): void {
|
|||
})
|
||||
ipcMain.handle('quitApp', () => app.quit())
|
||||
}
|
||||
|
||||
function encryptString(str: string): number[] {
|
||||
return safeStorage.encryptString(str).toJSON().data
|
||||
}
|
||||
|
|
|
@ -201,7 +201,7 @@ export async function isEncryptionAvailable(): Promise<boolean> {
|
|||
return ipcErrorWrapper(await window.electron.ipcRenderer.invoke('isEncryptionAvailable'))
|
||||
}
|
||||
|
||||
export async function encryptString(str: string): Promise<Buffer> {
|
||||
export async function encryptString(str: string): Promise<number[]> {
|
||||
return ipcErrorWrapper(await window.electron.ipcRenderer.invoke('encryptString', str))
|
||||
}
|
||||
|
||||
|
|
2
src/shared/types.d.ts
vendored
2
src/shared/types.d.ts
vendored
|
@ -213,7 +213,7 @@ interface IAppConfig {
|
|||
userAgent?: string
|
||||
delayTestUrl?: string
|
||||
delayTestTimeout?: number
|
||||
encryptedPassword?: Buffer
|
||||
encryptedPassword?: number[]
|
||||
controlDns?: boolean
|
||||
controlSniff?: boolean
|
||||
useDockIcon?: boolean
|
||||
|
|
Loading…
Reference in New Issue
Block a user