Android security implementation Phase 3.1

This commit is contained in:
2026-11-03 18:05:14 +02:00
parent d165fdc4b4
commit e3b3a9bb52
14 changed files with 224 additions and 48 deletions
+7 -1
View File
@@ -31,7 +31,13 @@ if (Capacitor.isNativePlatform() && Capacitor.getPlatform() === 'android') {
saveAttachment: details => EpMail.saveAttachment(details),
openExternal: url => EpMail.openExternal({ url }),
send: async message => {
if (!message?.pgp || (!message.pgp.encrypt && !message.pgp.sign)) return EpMail.send(message);
if (!message?.pgp || (!message.pgp.encrypt && !message.pgp.sign)) {
if (message?.pgp?.plaintextFallback) {
const { pgp: _options, ...plainMessage } = message;
return EpMail.send({ ...plainMessage, pgpRequested: true });
}
return EpMail.send(message);
}
try {
const { rawBase64, to, from } = await daybreakMail.pgp.buildOutgoing(message);
const { pgp: _options, text: _text, attachments: _attachments, ...headers } = message;
+2 -2
View File
@@ -182,11 +182,11 @@ export function createAndroidPgp({ EpMail, getAccount }) {
if (Number.isFinite(savedMinutes) && savedMinutes >= 0 && savedMinutes <= 1440) cacheMinutes = Math.round(savedMinutes);
return value;
}).catch(error => { storePromise = null; throw error; });
return storePromise;
return storePromise.then(value => JSON.parse(JSON.stringify(value)));
}
async function persist(value) {
await EpMail.pgpSaveStore({ store: value });
storePromise = value;
storePromise = Promise.resolve(JSON.parse(JSON.stringify(value)));
}
function cache(fingerprint, passphrase) {
if (!cacheMinutes) { passphrases.delete(fingerprint); return; }