From 2cefb425598aed2b2bf0d742c93a2b8f8ce2ba6b Mon Sep 17 00:00:00 2001 From: Julien Bouquillon Date: Thu, 10 Mar 2016 18:17:42 +0100 Subject: [PATCH] fix issue with app_name containing apostrophes --- bin/templates/cordova/lib/prepare.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/templates/cordova/lib/prepare.js b/bin/templates/cordova/lib/prepare.js index 474ffd62..f4e5b85f 100644 --- a/bin/templates/cordova/lib/prepare.js +++ b/bin/templates/cordova/lib/prepare.js @@ -120,7 +120,7 @@ function updateProjectAccordingTo(platformConfig, locations) { // Update app name by editing res/values/strings.xml var name = platformConfig.name(); var strings = xmlHelpers.parseElementtreeSync(locations.strings); - strings.find('string[@name="app_name"]').text = name; + strings.find('string[@name="app_name"]').text = name.replace(/\'/g, '\\\''); fs.writeFileSync(locations.strings, strings.write({indent: 4}), 'utf-8'); events.emit('verbose', 'Wrote out Android application name to "' + name + '"');