25 lines
832 B
JavaScript
25 lines
832 B
JavaScript
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.');
|