From 45654672877f527a3c11ebb2508d06d6264a10da Mon Sep 17 00:00:00 2001 From: Kent Sutherland Date: Thu, 7 Dec 2017 17:32:28 -0600 Subject: [PATCH 1/2] Shell script fixes (warnings flagged by shellcheck) Don't call codesign in set-agent-signing if the identity is "-" --- Configurations/set-agent-signing.sh | 4 ++-- Configurations/set-ats-exceptions-test-app.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Configurations/set-agent-signing.sh b/Configurations/set-agent-signing.sh index 47ace115..f485a16a 100755 --- a/Configurations/set-agent-signing.sh +++ b/Configurations/set-agent-signing.sh @@ -1,8 +1,8 @@ #!/bin/sh -AGENT_PATH="${TARGET_BUILD_DIR}"/"${CONTENTS_FOLDER_PATH}"/"MacOS/${SPARKLE_INSTALLER_PROGRESS_TOOL_NAME}.app" +AGENT_PATH="${TARGET_BUILD_DIR}"/"${CONTENTS_FOLDER_PATH}"/MacOS/"${SPARKLE_INSTALLER_PROGRESS_TOOL_NAME}".app #Only sign the agent app if we have code signing enabled (as we do with adhoc signatures in Debug builds for testing sandboxing) -if ! [ -z ${CODE_SIGN_IDENTITY}] ; then +if [ ! -z "${CODE_SIGN_IDENTITY}" -a "${CODE_SIGN_IDENTITY}" != "-" ] ; then codesign --verbose -f -s "${CODE_SIGN_IDENTITY}" "${AGENT_PATH}" fi diff --git a/Configurations/set-ats-exceptions-test-app.sh b/Configurations/set-ats-exceptions-test-app.sh index 685f4915..53ccfc36 100755 --- a/Configurations/set-ats-exceptions-test-app.sh +++ b/Configurations/set-ats-exceptions-test-app.sh @@ -2,11 +2,11 @@ # We should make sure ATS is off for the test app -DOWNLOADER_INFO_PLIST="${TARGET_BUILD_DIR}"/"${CONTENTS_FOLDER_PATH}"/"XPCServices"/"${DOWNLOADER_BUNDLE_ID}.xpc"/"Contents"/"Info.plist" +DOWNLOADER_INFO_PLIST="${TARGET_BUILD_DIR}"/"${CONTENTS_FOLDER_PATH}"/XPCServices/"${DOWNLOADER_BUNDLE_ID}".xpc/Contents/Info.plist #Only alter bundles if code signing is off, else we'll invalidate the signature on them #If code signing is enabled (as in debug mode), then we rely on another script for turning ATS exceptions on for these services #In release mode however, those services do not have ATS exceptions set up which is why we have to set up exceptions *here* -if [ -z ${CODE_SIGN_IDENTITY}] ; then +if [ -z "${CODE_SIGN_IDENTITY}" ] ; then /usr/libexec/PlistBuddy -c "Set :NSAppTransportSecurity:NSAllowsArbitraryLoads YES" "${DOWNLOADER_INFO_PLIST}" fi From f42ceec378d35becd6be702f8219ee0a537da03c Mon Sep 17 00:00:00 2001 From: Kent Sutherland Date: Thu, 7 Dec 2017 19:07:02 -0600 Subject: [PATCH 2/2] Check for a signing identity of "-" when building Sparkle Test App --- Configurations/set-ats-exceptions-test-app.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Configurations/set-ats-exceptions-test-app.sh b/Configurations/set-ats-exceptions-test-app.sh index 53ccfc36..eea714a9 100755 --- a/Configurations/set-ats-exceptions-test-app.sh +++ b/Configurations/set-ats-exceptions-test-app.sh @@ -7,6 +7,6 @@ DOWNLOADER_INFO_PLIST="${TARGET_BUILD_DIR}"/"${CONTENTS_FOLDER_PATH}"/XPCService #Only alter bundles if code signing is off, else we'll invalidate the signature on them #If code signing is enabled (as in debug mode), then we rely on another script for turning ATS exceptions on for these services #In release mode however, those services do not have ATS exceptions set up which is why we have to set up exceptions *here* -if [ -z "${CODE_SIGN_IDENTITY}" ] ; then +if [ -z "${CODE_SIGN_IDENTITY}" -o "${CODE_SIGN_IDENTITY}" == "-" ] ; then /usr/libexec/PlistBuddy -c "Set :NSAppTransportSecurity:NSAllowsArbitraryLoads YES" "${DOWNLOADER_INFO_PLIST}" fi