Add Android security Phase 0
This commit is contained in:
@@ -1,52 +1,52 @@
|
||||
const fs = require('node:fs/promises');
|
||||
const path = require('node:path');
|
||||
const esbuild = require('esbuild');
|
||||
|
||||
const root = path.resolve(__dirname, '..');
|
||||
const output = path.join(root, 'www');
|
||||
const assets = [
|
||||
'index.html',
|
||||
'styles.css',
|
||||
const fs = require('node:fs/promises');
|
||||
const path = require('node:path');
|
||||
const esbuild = require('esbuild');
|
||||
|
||||
const root = path.resolve(__dirname, '..');
|
||||
const output = path.join(root, 'www');
|
||||
const assets = [
|
||||
'index.html',
|
||||
'styles.css',
|
||||
'branding.css',
|
||||
'platform-bridge-loader.js',
|
||||
'renderer-state.js',
|
||||
'mail-content-security.js',
|
||||
'renderer-mail-api.js',
|
||||
'app.js',
|
||||
'mail-ui.js',
|
||||
'productivity.js',
|
||||
'account-ui.js',
|
||||
'dav-ui.js',
|
||||
'shortcuts.js',
|
||||
'attachments.js',
|
||||
'pgp-ui.js',
|
||||
'pgp-mail-ui.js',
|
||||
'icon.svg',
|
||||
'logo-ep-daylight.svg',
|
||||
'logo-ep-wasteland.svg',
|
||||
'manifest.webmanifest',
|
||||
'service-worker.js',
|
||||
'snooze-ui.js'
|
||||
];
|
||||
|
||||
async function prepare() {
|
||||
await fs.rm(output, { recursive: true, force: true });
|
||||
await fs.mkdir(output, { recursive: true });
|
||||
for (const asset of assets) {
|
||||
await fs.copyFile(path.join(root, asset), path.join(output, asset));
|
||||
}
|
||||
const bridgePath = path.join(root, 'platform-bridge.js');
|
||||
await esbuild.build({
|
||||
entryPoints: [path.join(root, 'scripts', 'android-bridge.js')],
|
||||
outfile: bridgePath,
|
||||
bundle: true,
|
||||
platform: 'browser',
|
||||
format: 'iife'
|
||||
});
|
||||
await fs.copyFile(bridgePath, path.join(output, 'platform-bridge.js'));
|
||||
}
|
||||
|
||||
prepare().catch(error => {
|
||||
console.error('Could not prepare Android web assets:', error);
|
||||
process.exitCode = 1;
|
||||
});
|
||||
'mail-ui.js',
|
||||
'productivity.js',
|
||||
'account-ui.js',
|
||||
'dav-ui.js',
|
||||
'shortcuts.js',
|
||||
'attachments.js',
|
||||
'pgp-ui.js',
|
||||
'pgp-mail-ui.js',
|
||||
'icon.svg',
|
||||
'logo-ep-daylight.svg',
|
||||
'logo-ep-wasteland.svg',
|
||||
'manifest.webmanifest',
|
||||
'service-worker.js',
|
||||
'snooze-ui.js'
|
||||
];
|
||||
|
||||
async function prepare() {
|
||||
await fs.rm(output, { recursive: true, force: true });
|
||||
await fs.mkdir(output, { recursive: true });
|
||||
for (const asset of assets) {
|
||||
await fs.copyFile(path.join(root, asset), path.join(output, asset));
|
||||
}
|
||||
const bridgePath = path.join(root, 'platform-bridge.js');
|
||||
await esbuild.build({
|
||||
entryPoints: [path.join(root, 'scripts', 'android-bridge.js')],
|
||||
outfile: bridgePath,
|
||||
bundle: true,
|
||||
platform: 'browser',
|
||||
format: 'iife'
|
||||
});
|
||||
await fs.copyFile(bridgePath, path.join(output, 'platform-bridge.js'));
|
||||
}
|
||||
|
||||
prepare().catch(error => {
|
||||
console.error('Could not prepare Android web assets:', error);
|
||||
process.exitCode = 1;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user