/** * @file This script is auto-generated by create-nitro-module and should not be edited. * * @description This script applies a workaround for Android by modifying the 'OnLoad.cpp' file. * It reads the file content and removes the 'margelo/nitro/' string from it. This enables support for custom package names. * * @module create-nitro-module */ const path = require('node:path') const { writeFile, readFile } = require('node:fs/promises') const androidWorkaround = async () => { const androidOnLoadFile = path.join( process.cwd(), 'nitrogen/generated/android', 'InappbrowserNitroOnLoad.cpp' ) const str = await readFile(androidOnLoadFile, { encoding: 'utf8' }) await writeFile(androidOnLoadFile, str.replace(/margelo\/nitro\//g, '')) } androidWorkaround()