Improve Android OpenPGP, drafts and release builds
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -17,6 +17,7 @@ const androidPgpConfirmationGate = fs.readFileSync(path.join(root, 'android', 'a
|
||||
const productivity = fs.readFileSync(path.join(root, 'productivity.js'), 'utf8');
|
||||
const androidBridge = fs.readFileSync(path.join(root, 'scripts', 'android-bridge.js'), 'utf8');
|
||||
const androidPgp = fs.readFileSync(path.join(root, 'scripts', 'android-pgp.js'), 'utf8');
|
||||
const pgpUi = fs.readFileSync(path.join(root, 'pgp-ui.js'), 'utf8');
|
||||
const pgpMailUi = fs.readFileSync(path.join(root, 'pgp-mail-ui.js'), 'utf8');
|
||||
const packageJson = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8'));
|
||||
const packageLock = JSON.parse(fs.readFileSync(path.join(root, 'package-lock.json'), 'utf8'));
|
||||
@@ -39,6 +40,14 @@ test('mobile layout removes desktop minimum width and provides a compact reader
|
||||
assert.match(app, /if\(!m\)\{state\.activeMessage=null;document\.body\.classList\.remove\('reader-open'\);return;\}/);
|
||||
});
|
||||
|
||||
test('key settings cards keep key details readable and actions wrapped', () => {
|
||||
assert.match(pgpUi, /compose-modal attachments-modal pgp-keys-modal/);
|
||||
assert.match(styles, /\.pgp-keys-modal \.attachment-list\{grid-template-columns:minmax\(0,1fr\)\}/);
|
||||
assert.match(styles, /\.pgp-keys-modal \.attachment-row-info\{flex:1 0 100%\}/);
|
||||
assert.match(styles, /\.pgp-keys-modal \.attachment-row-info small\{[^}]*white-space:normal;overflow-wrap:anywhere/);
|
||||
assert.match(styles, /\.pgp-keys-modal \.pgp-actions\{flex-wrap:wrap\}/);
|
||||
});
|
||||
|
||||
test('mailbox setup exposes ports and TLS modes and submits them to Android', () => {
|
||||
for (const id of ['mail-account-imap-port', 'mail-account-imap-secure', 'mail-account-smtp-port', 'mail-account-smtp-secure']) {
|
||||
assert.ok(mailUi.includes(`id="${id}"`), `missing account field ${id}`);
|
||||
@@ -91,6 +100,15 @@ test('Android app lock is native-enforced and requires a secure device credentia
|
||||
assert.match(mainActivity, /FLAG_SECURE/);
|
||||
});
|
||||
|
||||
test('Android private-key picker preserves WebView restrictions and checks app lock', () => {
|
||||
assert.match(plugin, /fun pickPgpPrivateKey\(call: PluginCall\)/);
|
||||
assert.match(plugin, /AndroidAccountVault\.appLockEnabled\(\)/);
|
||||
assert.match(plugin, /Intent\.ACTION_OPEN_DOCUMENT/);
|
||||
assert.match(plugin, /uri\.scheme != "content"/);
|
||||
assert.match(plugin, /BoundedInputReader\.read\(it, 200001\)/);
|
||||
assert.match(plugin, /bytes\.isEmpty\(\) \|\| bytes\.size > 200000/);
|
||||
});
|
||||
|
||||
test('Android biometric PGP unlock keeps secrets behind an authentication-bound Keystore key', () => {
|
||||
assert.match(plugin, /fun setPgpBiometricUnlock/);
|
||||
assert.match(plugin, /fun getPgpBiometricPassphrase/);
|
||||
@@ -172,7 +190,7 @@ test('Android OpenPGP uses the encrypted vault and queues only built MIME data',
|
||||
assert.match(androidBridge, /buildOutgoing\(message\)/);
|
||||
assert.match(androidBridge, /rawBase64, envelope: \{ from, to \}, text: '', attachments: \[\]/);
|
||||
assert.match(androidMailService, /validateOpenPgpMime\(message\)/);
|
||||
assert.match(androidMailService, /private fun validateOpenPgpMime/);
|
||||
assert.match(androidMailService, /internal fun validateOpenPgpMime/);
|
||||
assert.match(androidMailService, /"send" -> send\(account, data\)/);
|
||||
assert.match(androidMailService, /private fun isEncryptedMessage/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user