update electron android adb over browser
This commit is contained in:
parent
21109e4bf9
commit
f6295a9c2f
26 changed files with 1551 additions and 172 deletions
22
client-electron/electron/keychain.ts
Normal file
22
client-electron/electron/keychain.ts
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import { findCredentials, getPassword, setPassword } from '@postman/node-keytar'
|
||||
|
||||
export function eventGetKeyChain(icpMain: Electron.IpcMain) {
|
||||
icpMain.on('get-keyChain', (event, serviceName, account) => {
|
||||
getPassword(serviceName, account).then(password => {
|
||||
event.returnValue = password
|
||||
})
|
||||
})
|
||||
|
||||
icpMain.on('set-keyChain', (_event, serviceName, account, password) => {
|
||||
setPassword(serviceName, account, password)
|
||||
})
|
||||
|
||||
icpMain.on('delete-keyChain', (_event, serviceName, account) => {
|
||||
setPassword(serviceName, account, '')
|
||||
})
|
||||
|
||||
icpMain.handle('keyChainSync', async (_event, serviceName) => {
|
||||
const credentials = await findCredentials(serviceName)
|
||||
return credentials
|
||||
})
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue