diff --git a/scripts/build-app.sh b/scripts/build-app.sh index 1c7b0c303..90ba8a748 100755 --- a/scripts/build-app.sh +++ b/scripts/build-app.sh @@ -94,7 +94,9 @@ if [ -f "$CHROMIUM_PLIST" ]; then if [ -f "$CHROMIUM_STRINGS" ]; then # InfoPlist.strings may be binary plist, convert to xml first plutil -convert xml1 "$CHROMIUM_STRINGS" 2>/dev/null || true - sed -i '' "s/Google Chrome for Testing/$APP_NAME/g" "$CHROMIUM_STRINGS" 2>/dev/null || true + # Escape sed replacement metachars (& / \) in $APP_NAME so unusual names can't break or inject into the s/// command. + APP_NAME_SED_ESCAPED=$(printf '%s' "$APP_NAME" | sed 's/[&/\]/\\&/g') + sed -i '' "s/Google Chrome for Testing/${APP_NAME_SED_ESCAPED}/g" "$CHROMIUM_STRINGS" 2>/dev/null || true fi # Replace Chromium's icon with ours so the Dock shows the GStack icon # (Chromium's process owns the Dock icon, not our launcher)