
build: add import/order eslint rule (#44085) * build: add import/order eslint rule * chore: run lint:js --fix
17 lines
540 B
JavaScript
17 lines
540 B
JavaScript
const { app, safeStorage } = require('electron');
|
|
|
|
const { promises: fs } = require('node:fs');
|
|
const path = require('node:path');
|
|
|
|
const pathToEncryptedString = path.resolve(__dirname, '..', 'encrypted.txt');
|
|
const readFile = fs.readFile;
|
|
|
|
app.whenReady().then(async () => {
|
|
if (process.platform === 'linux') {
|
|
safeStorage.setUsePlainTextEncryption(true);
|
|
}
|
|
const encryptedString = await readFile(pathToEncryptedString);
|
|
const decrypted = safeStorage.decryptString(encryptedString);
|
|
console.log(decrypted);
|
|
app.quit();
|
|
});
|