fix: Opera add-ons does not accept the .enc file extension

pull/270/head
dessant 4 years ago
parent 29269d2526
commit 317eb95f6c

@ -211,10 +211,10 @@ function secrets(done) {
const ciphertext = CryptoJS.AES.encrypt(data, key).toString(); const ciphertext = CryptoJS.AES.encrypt(data, key).toString();
writeFileSync(path.join(distDir, 'secrets.json.enc'), ciphertext); writeFileSync(path.join(distDir, 'secrets.txt'), ciphertext);
} catch (err) { } catch (err) {
console.log( console.log(
'Secrets are missing, secrets.json.enc will not be included in the extension package.' 'Secrets are missing, secrets.txt will not be included in the extension package.'
); );
} }

@ -227,7 +227,7 @@ async function prepareAudio(audio) {
async function loadSecrets() { async function loadSecrets() {
try { try {
const ciphertext = await (await fetch('/secrets.json.enc')).text(); const ciphertext = await (await fetch('/secrets.txt')).text();
const key = sha256( const key = sha256(
(await (await fetch('/src/background/script.js')).text()) + (await (await fetch('/src/background/script.js')).text()) +

Loading…
Cancel
Save