Skip to content

Commit 5b15f65

Browse files
committed
Enable hardened runtime for release signing
1 parent 85af693 commit 5b15f65

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

scripts/release/build_release.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ BUILD_DIR="${BUILD_DIR:-${ROOT_DIR}/build/release}"
66
ARCHIVE_PATH="${ARCHIVE_PATH:-${BUILD_DIR}/Core-Monitor.xcarchive}"
77
EXPORT_DIR="${EXPORT_DIR:-${BUILD_DIR}/export}"
88
APP_PATH="${EXPORT_DIR}/Core-Monitor.app"
9+
HELPER_PATH="${APP_PATH}/Contents/Library/LaunchServices/ventaphobia.smc-helper"
910
ZIP_PATH="${ZIP_PATH:-${BUILD_DIR}/Core-Monitor.app.zip}"
1011
DERIVED_DATA_PATH="${DERIVED_DATA_PATH:-${ROOT_DIR}/build/DerivedData/release}"
1112
DEVELOPMENT_TEAM="${DEVELOPMENT_TEAM:-6VDP675K4L}"
1213
RELEASE_CODE_SIGN_IDENTITY="${RELEASE_CODE_SIGN_IDENTITY:-Developer ID Application}"
1314
RELEASE_PROVISIONING_PROFILE_SPECIFIER="${RELEASE_PROVISIONING_PROFILE_SPECIFIER:-Mac Team Direct Provisioning Profile: CoreTools.Core-Monitor}"
15+
APP_ENTITLEMENTS="${APP_ENTITLEMENTS:-${ROOT_DIR}/Core-Monitor-WeatherKit.entitlements}"
1416
EXPORT_OPTIONS_PLIST="${EXPORT_OPTIONS_PLIST:-${BUILD_DIR}/exportOptions.plist}"
1517
RELEASE_ARCHS="${RELEASE_ARCHS:-arm64}"
1618

@@ -60,6 +62,11 @@ xcodebuild \
6062
-exportPath "${EXPORT_DIR}" \
6163
-exportOptionsPlist "${EXPORT_OPTIONS_PLIST}"
6264

65+
if [[ -f "${HELPER_PATH}" ]]; then
66+
codesign --force --timestamp --options runtime --sign "${RELEASE_CODE_SIGN_IDENTITY}" "${HELPER_PATH}"
67+
fi
68+
69+
codesign --force --timestamp --options runtime --entitlements "${APP_ENTITLEMENTS}" --sign "${RELEASE_CODE_SIGN_IDENTITY}" "${APP_PATH}"
6370
codesign --verify --deep --strict --verbose=2 "${APP_PATH}"
6471
ditto -c -k --keepParent --sequesterRsrc --zlibCompressionLevel 9 "${APP_PATH}" "${ZIP_PATH}"
6572

0 commit comments

Comments
 (0)