// Point the JS bundle at one tier before a build. // node tools/set-variant.mjs lite -> src/provariant.ts has IS_PRO_BUILD = false // node tools/set-variant.mjs pro -> src/provariant.ts has IS_PRO_BUILD = true // The gradle flavor (assembleLiteRelease / assembleProRelease) sets the package // name and label; this file is what entitlement.ts reads. Run the matching pair, // or you ship a Pro apk that thinks it is Lite. `npm run apk:lite|apk:pro` does both. import { writeFileSync } from 'node:fs'; const tier = process.argv[2]; if (tier !== 'lite' && tier !== 'pro') { throw new Error('usage: node tools/set-variant.mjs lite|pro'); } writeFileSync( new URL('../src/provariant.ts', import.meta.url), `// Generated by tools/set-variant.mjs - do not edit by hand.\n// false = Lite apk (free, PRO looks are preview-only), true = Pro apk (sold as-is).\nexport const IS_PRO_BUILD = ${tier === 'pro'};\n` ); console.log('src/provariant.ts ->', tier);