@lvce-editor/main-process 6.37.12 → 6.37.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mainProcessMain.js +7 -0
- package/package.json +1 -1
package/dist/mainProcessMain.js
CHANGED
|
@@ -5837,13 +5837,20 @@ const stop = id => {
|
|
|
5837
5837
|
|
|
5838
5838
|
const Base64 = 'base64';
|
|
5839
5839
|
|
|
5840
|
+
const ensureEncryptionAvailable = () => {
|
|
5841
|
+
if (!safeStorage.isEncryptionAvailable() && isLinux) {
|
|
5842
|
+
safeStorage.setUsePlainTextEncryption(true);
|
|
5843
|
+
}
|
|
5844
|
+
};
|
|
5840
5845
|
const isEncryptionAvailable = () => {
|
|
5841
5846
|
return safeStorage.isEncryptionAvailable();
|
|
5842
5847
|
};
|
|
5843
5848
|
const encrypt = plainText => {
|
|
5849
|
+
ensureEncryptionAvailable();
|
|
5844
5850
|
return safeStorage.encryptString(plainText).toString(Base64);
|
|
5845
5851
|
};
|
|
5846
5852
|
const decrypt = encrypted => {
|
|
5853
|
+
ensureEncryptionAvailable();
|
|
5847
5854
|
const buffer = Buffer.from(encrypted, Base64);
|
|
5848
5855
|
return safeStorage.decryptString(buffer);
|
|
5849
5856
|
};
|