diff --git a/Sources/iKeyMonApp.swift b/Sources/iKeyMonApp.swift index 16965e7..d981e87 100644 --- a/Sources/iKeyMonApp.swift +++ b/Sources/iKeyMonApp.swift @@ -6,9 +6,20 @@ // import SwiftUI +#if os(macOS) +import AppKit +#endif @main struct iKeyMonApp: App { + init() { + #if os(macOS) + if let customIcon = NSImage(named: "AppIcon") { + NSApplication.shared.applicationIconImage = customIcon + } + #endif + } + var body: some Scene { WindowGroup { MainView() diff --git a/iKeyMon.xcodeproj/project.pbxproj b/iKeyMon.xcodeproj/project.pbxproj index ea58889..9a83700 100644 --- a/iKeyMon.xcodeproj/project.pbxproj +++ b/iKeyMon.xcodeproj/project.pbxproj @@ -49,12 +49,12 @@ isa = PBXGroup; children = ( 52A9B8BE2ECB68B5004DD4A2 /* Sources */, - 52A9B8BA2ECA35FB004DD4A2 /* NOTES.md */, 52A9B7872EC8E7EE004DD4A2 /* Assets.xcassets */, 52A9B7882EC8E7EE004DD4A2 /* iKeyMon.entitlements */, 52A9B8F72ECB6B8A004DD4A2 /* Preview Content */, 5203C24E2D997D2800576D4A /* Products */, 52A9B8212EC8FA8A004DD4A2 /* CHANGELOG.md */, + 52A9B8BA2ECA35FB004DD4A2 /* NOTES.md */, 52A9B9712ECF751C004DD4A2 /* signing.env.example */, ); sourceTree = ""; diff --git a/scripts/build_release.sh b/scripts/build_release.sh index 2e277a3..6183ed0 100755 --- a/scripts/build_release.sh +++ b/scripts/build_release.sh @@ -21,6 +21,7 @@ xcodebuild \ -scheme "$SCHEME" \ -configuration Release \ -derivedDataPath "$BUILD_DIR" \ + CODE_SIGNING_ALLOWED=NO \ clean build APP_PATH="$BUILD_DIR/Build/Products/Release/iKeyMon.app" @@ -29,6 +30,20 @@ if [[ ! -d "$APP_PATH" ]]; then exit 1 fi +if [[ -n "${CODESIGN_IDENTITY:-}" ]]; then + echo "🔏 Codesigning app with identity: $CODESIGN_IDENTITY" + codesign \ + --deep \ + --force \ + --options runtime \ + --timestamp \ + --entitlements "$ROOT_DIR/iKeyMon.entitlements" \ + --sign "$CODESIGN_IDENTITY" \ + "$APP_PATH" +else + echo "⚠️ Skipping codesign (CODESIGN_IDENTITY not set)." +fi + STAGING_DIR=$(mktemp -d) mkdir -p "$STAGING_DIR" cp -R "$APP_PATH" "$STAGING_DIR/" @@ -36,13 +51,6 @@ ln -s /Applications "$STAGING_DIR/Applications" mkdir -p "$STAGING_DIR/.background" cp "$ROOT_DIR/Assets/dmg_background.png" "$STAGING_DIR/.background/background.png" -if [[ -n "${CODESIGN_IDENTITY:-}" ]]; then - echo "🔏 Codesigning app with identity: $CODESIGN_IDENTITY" - codesign --deep --force --options runtime --sign "$CODESIGN_IDENTITY" "$APP_PATH" -else - echo "⚠️ Skipping codesign (CODESIGN_IDENTITY not set)." -fi - VERSION=$(xcodebuild \ -project "$ROOT_DIR/$PROJECT" \ -scheme "$SCHEME" \ diff --git a/signing.env.example b/signing.env.example index 81f3d69..6097d50 100644 --- a/signing.env.example +++ b/signing.env.example @@ -2,4 +2,3 @@ CODESIGN_IDENTITY="Developer ID Application: Your Name (TEAMID1234)" NOTARY_APPLE_ID="appleid@example.com" NOTARY_TEAM_ID="TEAMID1234" NOTARY_PASSWORD="app-specific-password" -3