main.js 447 B

12345678910111213
  1. const { app, safeStorage, ipcMain } = require('electron');
  2. const { promises: fs } = require('fs');
  3. const path = require('path');
  4. const pathToEncryptedString = path.resolve(__dirname, '..', 'encrypted.txt');
  5. const readFile = fs.readFile;
  6. app.whenReady().then(async () => {
  7. const encryptedString = await readFile(pathToEncryptedString);
  8. const decrypted = safeStorage.decryptString(encryptedString);
  9. console.log(decrypted);
  10. app.quit();
  11. });