Improve Android OpenPGP, drafts and release builds

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-11-17 22:11:05 +02:00
co-authored by Copilot
parent d0e2ce26bc
commit 96c7b6966b
28 changed files with 747 additions and 187 deletions
+9 -2
View File
@@ -537,8 +537,15 @@ export function createAndroidPgp({ EpMail, getAccount, confirm = globalThis.conf
await persist(data);
return { key: publicInfo(entry), revocationCertificate: generated.revocationCertificate };
},
async importKey({ armoredKey, passphrase, accountId = null }) {
if (!armoredKey) armoredKey = prompt('Paste an ASCII-armored OpenPGP private key (up to 200 KB):') || '';
async importKey({ armoredKey, passphrase, accountId = null, source = 'paste' }) {
if (!armoredKey && source === 'file') {
const selected = await EpMail.pickPgpPrivateKey();
if (selected.canceled) return { canceled: true };
armoredKey = selected.armoredKey;
if (typeof armoredKey !== 'string' || !armoredKey.trim()) throw new Error('That key file is empty.');
} else if (!armoredKey) {
armoredKey = prompt('Paste an ASCII-armored OpenPGP private key (up to 200 KB):') || '';
}
const armored = String(armoredKey).trim();
if (!armored || armored.length > MAX_KEY_LENGTH) throw new Error('That key file is empty or too large.');
if (typeof passphrase !== 'string' || passphrase.length < 8) throw new Error('Use a passphrase of at least 8 characters.');