mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
feat: expose safestorage backend information on linux (#38873)
* feat: expose safestorage backend information on linux * Remove gnome-keyring Refs https://chromium-review.googlesource.com/c/chromium/src/+/4609704
This commit is contained in:
@@ -6,6 +6,9 @@ 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);
|
||||
|
||||
@@ -6,6 +6,9 @@ const pathToEncryptedString = path.resolve(__dirname, '..', 'encrypted.txt');
|
||||
const writeFile = fs.writeFile;
|
||||
|
||||
app.whenReady().then(async () => {
|
||||
if (process.platform === 'linux') {
|
||||
safeStorage.setUsePlainTextEncryption(true);
|
||||
}
|
||||
const encrypted = safeStorage.encryptString('plaintext');
|
||||
await writeFile(pathToEncryptedString, encrypted);
|
||||
app.quit();
|
||||
|
||||
Reference in New Issue
Block a user