/** * Ensures root declares xmlns:tools so tools:replace on JPUSH_* meta-data merges. * Idempotent: if xmlns:tools is already present, does nothing (avoids edit-config conflicts at plugin add). */ 'use strict'; const fs = require('fs'); const path = require('path'); const TOOLS_NS = 'xmlns:tools="http://schemas.android.com/tools"'; function hasToolsNamespace(xml) { return /\bxmlns:tools\s*=\s*["']http:\/\/schemas\.android\.com\/tools["']/.test(xml); } function ensureToolsNamespace(xml) { if (hasToolsNamespace(xml)) { return xml; } return xml.replace(/