release: harden Android network security
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { cpSync, existsSync, mkdirSync } from 'node:fs';
|
||||
import { dirname, resolve } from 'node:path';
|
||||
|
||||
const projectRoot = resolve(import.meta.dirname, '..');
|
||||
const mappings = [
|
||||
[
|
||||
resolve(projectRoot, 'AndroidManifest.xml'),
|
||||
resolve(projectRoot, 'dist/build/app/AndroidManifest.xml')
|
||||
],
|
||||
[
|
||||
resolve(projectRoot, 'nativeResources/android/res/xml/network_security_config.xml'),
|
||||
resolve(projectRoot, 'dist/build/app/nativeResources/android/res/xml/network_security_config.xml')
|
||||
]
|
||||
];
|
||||
|
||||
for (const [source, destination] of mappings) {
|
||||
if (!existsSync(source)) {
|
||||
throw new Error(`Missing required native App resource: ${source}`);
|
||||
}
|
||||
mkdirSync(dirname(destination), { recursive: true });
|
||||
cpSync(source, destination);
|
||||
}
|
||||
|
||||
console.log('Android native manifest and network security resources synchronized.');
|
||||
Reference in New Issue
Block a user