| 16 | const ADMOB_PLUGIN_DIR = "admob"; |
| 17 | |
| 18 | function isPaidVersion() { |
| 19 | const configPath = path.join(__dirname, "../config.xml"); |
| 20 | let config; |
| 21 | |
| 22 | try { |
| 23 | config = fs.readFileSync(configPath, "utf8"); |
| 24 | } catch (error) { |
| 25 | throw new Error(`Unable to read config.xml at ${configPath}.`, { |
| 26 | cause: error, |
| 27 | }); |
| 28 | } |
| 29 | |
| 30 | const widgetId = /<widget[^>]*?\sid=["']([^"']+)["']/.exec(config)?.[1]; |
| 31 | |
| 32 | return widgetId === ID_PAID; |
| 33 | } |
| 34 | |
| 35 | function getPackageManager() { |
| 36 | const userAgent = process.env.npm_config_user_agent; |