hooks/lib/android/manifestWriter.js
function writePreferences(cordovaContext, pluginPreferences) {
  var pathToManifest = path.join(cordovaContext.opts.projectRoot, 'platforms', 'android', 'AndroidManifest.xml');
  var manifestSource = xmlHelper.readXmlAsJson(pathToManifest);
  var cleanManifest;
  var updatedManifest;

  // remove old intent-filters
  cleanManifest = removeOldOptions(manifestSource);

  // inject intent-filters based on plugin preferences
  updatedManifest = injectOptions(cleanManifest, pluginPreferences);

  // save new version of the AndroidManifest
  xmlHelper.writeJsonAsXml(updatedManifest, pathToManifest);
}
function writePreferences(cordovaContext, pluginPreferences) {
  var pathToManifest = path.join(cordovaContext.opts.projectRoot, 'platforms', 'android', 'AndroidManifest.xml');
  var manifestSource = xmlHelper.readXmlAsJson(pathToManifest);
  var cleanManifest;
  var updatedManifest;

  // remove old intent-filters
  cleanManifest = removeOldOptions(manifestSource);

  // inject intent-filters based on plugin preferences
  updatedManifest = injectOptions(cleanManifest, pluginPreferences);

  // save new version of the AndroidManifest
  xmlHelper.writeJsonAsXml(updatedManifest, pathToManifest);
}
function writePreferences ( cordovaContext , pluginPreferences ) { var pathToManifest = path . join ( cordovaContext . opts . projectRoot , 'platforms' , 'android' , 'AndroidManifest.xml' ) ; var manifestSource = xmlHelper . readXmlAsJson ( pathToManifest ) ; var cleanManifest ; var updatedManifest ; // remove old intent-filters cleanManifest = removeOldOptions ( manifestSource ) ; // inject intent-filters based on plugin preferences updatedManifest = injectOptions ( cleanManifest , pluginPreferences ) ; // save new version of the AndroidManifest xmlHelper . writeJsonAsXml ( updatedManifest , pathToManifest ) ; }
region Public API 
Inject preferences into AndroidManifest.xml file.

@param {Object} cordovaContext - cordova context object
@param {Object} pluginPreferences - plugin preferences as JSON object; already parsed
region Public API Inject preferences into AndroidManifest . xml file .