Repository Public
1# Code signing23This page describes how the release build of ORIX DJ is signed, as implemented by `project.yml` and `Scripts/sign.sh`. The signing run for version 1.0.0 has not happened yet: the procedure below is what the scripts do, and the places where real output will be recorded are marked with result placeholders.45Related pages: [notarization](notarization.md), [distribution](distribution.md), [release checklist](checklist.md), [development setup](../development/setup.md), [security report](../reports/security.md).67## Summary89| Item | Value | Where it is defined |10|---|---|---|11| Distribution channel | Developer ID, outside the Mac App Store | `project.yml` (Release), scripts |12| Identity | `Developer ID Application: Simon-Pierre Boucher (3YM54G49SN)` (present in the keychain of the build machine) | selected by `CODE_SIGN_IDENTITY: "Developer ID Application"` and `DEVELOPMENT_TEAM: 3YM54G49SN` |13| Signing style | Manual in Release (`CODE_SIGN_STYLE: Manual`), automatic in Debug | `project.yml` |14| Hardened Runtime | Enabled (`ENABLE_HARDENED_RUNTIME: YES`, project-wide) | `project.yml` |15| Secure timestamp | `OTHER_CODE_SIGN_FLAGS: "--timestamp"` | `project.yml` (Release) |16| Entitlements | None. No `.entitlements` file exists and no `CODE_SIGN_ENTITLEMENTS` is set | repository |17| Base entitlements injection | Off (`CODE_SIGN_INJECT_BASE_ENTITLEMENTS: NO`), so no `get-task-allow` | `project.yml` (Release) |18| App Sandbox | Not enabled | follows from the absence of entitlements |19| Architectures | arm64 only (`ARCHS: arm64`) | `project.yml` (Release) |20| Bundle identifier | `ai.spboucher.orix.dj` | `project.yml` |21| Version / build | `MARKETING_VERSION` 1.0.0 / `CURRENT_PROJECT_VERSION` 1 | `project.yml` |2223## Who signs what2425Signing of the application is done by Xcode during the Release build, not by a separate `codesign` call on the app. `Scripts/sign.sh` runs `xcodebuild` with the Release configuration; Xcode signs the bundle with the identity matching "Developer ID Application" for team `3YM54G49SN`, with the Hardened Runtime flag (from `ENABLE_HARDENED_RUNTIME`) and a secure timestamp (from `OTHER_CODE_SIGN_FLAGS`).2627The only explicit `codesign --sign` call in the repository is in `Scripts/package.sh`, for the disk image:2829```sh30codesign --force --timestamp --sign "$IDENTITY" "$DMG"31```3233`$IDENTITY` is not hard-coded there: it is read back from the signed app (`codesign -dvv` on `dist/ORIX DJ.app`, first `Authority=Developer ID Application: ...` line), so the disk image is always signed with the same identity as the application it contains. See [distribution](distribution.md).3435The ZIP archive is not signed itself (a ZIP cannot carry a signature); it contains the signed, stapled application.3637## Entitlements and Hardened Runtime exceptions3839There is no entitlements file. Consequences, all visible in the repository:4041- No App Sandbox. The app reads audio files anywhere the user points it to, and keeps its library in `~/Library/Application Support/ORIX DJ/` in the real user Library, not in a container (see [persistence](../architecture/persistence.md)).42- No Hardened Runtime exception is requested: no `com.apple.security.cs.allow-jit`, `allow-unsigned-executable-memory`, `disable-library-validation` or `allow-dyld-environment-variables`. The app loads no third-party dynamic library; the engine package declares a plain library product (no dynamic `type:` in `Package.swift`), and `Scripts/sign.sh` lists any nested `*.dylib`, `*.framework` or `*.bundle` it finds so that an unexpected one would be noticed.43- No device entitlement (`com.apple.security.device.audio-input` and similar). The app declares no audio input and has no usage-description key in its Info.plist. Audio output and CoreMIDI need no entitlement outside the sandbox.44- No network entitlement is needed outside the sandbox. Outgoing HTTPS to the Anthropic API is the only network use, and `Scripts/check.sh` enforces that network APIs appear only in the Anthropic client and its two UI folders.4546Whether the absence of exceptions holds at run time under the Hardened Runtime (for example Metal shader compilation and AVFoundation decoding in the signed Release build) has not been verified yet, because no signed Release build has been launched. It is a gate in the [checklist](checklist.md).4748## `Scripts/sign.sh` step by step4950The script runs from the repository root with `set -euo pipefail`. It uploads nothing.5152| Step | Command (abridged) | Failure behaviour |53|---|---|---|54| 1. Identity present | `security find-identity -v -p codesigning` piped to `grep -q "Developer ID Application"` | exits 1 with "no Developer ID Application identity in the keychain" |55| 2. String catalog | `/usr/bin/python3 Scripts/localize.py` | rebuilds `App/Resources/Localizable.xcstrings` from the latest build's extracted strings; keeps an existing catalog if no build data exists; exits non-zero if neither exists |56| 3. Project | `xcodegen generate --quiet` | |57| 4. Clean product | `rm -rf build/DerivedDataRelease/Build/Products/Release/ORIX DJ.app` | |58| 5. Release build | `xcodebuild -project ORIXDJ.xcodeproj -scheme ORIXDJ -configuration Release -derivedDataPath build/DerivedDataRelease -destination 'platform=macOS,arch=arm64' build`, output reduced to `error:` and `** BUILD` lines | a failed build stops the script (pipefail); a missing product prints "Release build failed" |59| 6. Copy | `rm -rf dist && mkdir -p dist`, then `ditto` of the product to `dist/ORIX DJ.app` | note that the whole `dist/` directory is erased first |60| 7. Verify signature | `codesign --verify --deep --strict --verbose=2 "dist/ORIX DJ.app"` | non-zero status stops the script |61| 8. Architectures | `lipo -archs` on `Contents/MacOS/ORIX DJ` | printed |62| 9. Signature details | `codesign -dvv`, keeping `Identifier`, `Authority`, `TeamIdentifier`, `Timestamp`, `Runtime Version` | printed |63| 10. Hardened Runtime | flags from `codesign -dv`; must contain `runtime` | exits 1 with "Hardened Runtime is not enabled" |64| 11. No debug entitlement | `codesign -d --entitlements - --xml`; must not contain `get-task-allow` | exits 1 with "get-task-allow present" |65| 12. Entitlements dump | the same output converted to JSON with `plutil`, or `{}` | printed |66| 13. Nested code | `find` for `*.dylib`, `*.framework`, `*.bundle` up to depth 4 | printed (first 20) |67| 14. Icon | `Contents/Resources/AppIcon.icns` must exist | exits 1 with "the app has no icon" |68| 15. Offline documentation | `Contents/Resources/orix-script/manifest.json` must exist | exits 1 with "the offline documentation is not in the bundle" |69| 16. Version | `CFBundleShortVersionString` and `CFBundleVersion` read with PlistBuddy | printed |7071The last line states the result precisely: `RESULT: dist/ORIX DJ.app is built and signed. It is NOT notarized yet (Scripts/notarize.sh).`7273Step 2 has a side effect worth knowing: `localize.py` writes into the source tree (`App/Resources/Localizable.xcstrings`) before the Release build. At the time of writing neither that catalog nor `Scripts/translations-fr-CA.json` exists in the repository, so the first release run will create a catalog without French values from whatever Debug or Release build data is present, or stop if there is none. This should be resolved before the release; it is listed in the [checklist](checklist.md).7475## What a correct result looks like7677The script itself only enforces steps 1, 5, 7, 10, 11, 14 and 15. The printed details must be read by a person and compared with the expected values:7879| Field | Expected |80|---|---|81| `Identifier` | `ai.spboucher.orix.dj` |82| `Authority` (first line) | `Developer ID Application: Simon-Pierre Boucher (3YM54G49SN)` |83| `Authority` chain | Developer ID Certification Authority, Apple Root CA |84| `TeamIdentifier` | `3YM54G49SN` |85| `Timestamp` | a date (a secure timestamp is present); absence means the build was not timestamped and notarization will refuse it |86| `flags` | contains `runtime` |87| architectures | `arm64` |88| entitlements | `{}` |89| nested code | none expected |9091Recorded output of the release run:9293Release run of 2026-11-21 (outputs re-captured the same day on the stapled bundle; the certificate holder name and team identifier are omitted here).9495```text96codesign --verify --deep --strict --verbose=2 "dist/ORIX DJ.app"97```9899```text100dist/ORIX DJ.app: valid on disk101dist/ORIX DJ.app: satisfies its Designated Requirement102```103104```text105Identifier / Authority / TeamIdentifier / Timestamp / Runtime Version / flags / architectures / entitlements / version106```107108```text109Identifier=ai.spboucher.orix.dj110Format=app bundle with Mach-O thin (arm64)111CodeDirectory v=20500 size=42016 flags=0x10000(runtime) hashes=1306+3 location=embedded112Authority=Developer ID Application: (owner) (TEAMID)113Authority=Developer ID Certification Authority114Authority=Apple Root CA115Timestamp=Nov 21, 2026 at 12:00:16 PM116TeamIdentifier=(owner team, omitted)117Runtime Version=27.2.0118119arm64120entitlements: none ({})121version 1.0.0 (1)122```123124## Verifying by hand125126The same checks can be repeated at any time on `dist/ORIX DJ.app` or on a copy installed from the disk image:127128```sh129codesign --verify --deep --strict --verbose=2 "dist/ORIX DJ.app"130codesign -dvv "dist/ORIX DJ.app"131codesign -d --entitlements - --xml "dist/ORIX DJ.app"132lipo -archs "dist/ORIX DJ.app/Contents/MacOS/ORIX DJ"133```134135A Gatekeeper assessment (`spctl --assess`) is only meaningful after notarization; before it, the expected answer for a Developer ID build is a rejection for lack of a notarization ticket. `Scripts/finalize.sh` runs the assessment at the right moment; see [notarization](notarization.md) and [distribution](distribution.md).136137## Credentials138139- The Developer ID private key stays in the login keychain of the build machine. No script exports, creates or prints a certificate or key.140- `.gitignore` excludes `*.p12`, `*.p8`, `*.cer`, provisioning profiles, keychains, `.env*`, `asc.env`, `notary*.json` and `AuthKey_*`; `Scripts/check.sh` fails if such a file, a private-key block or a key-shaped string is visible to git.141- The UI-test bundle is signed separately with automatic signing and an "Apple Development" identity (`project.yml`); it is never part of a release artifact.142143## Debug builds144145Debug builds (`Scripts/build.sh debug` or `app`) use automatic signing with the same team and also have the Hardened Runtime enabled, since `ENABLE_HARDENED_RUNTIME` is set at project level. They are not suitable for distribution and are not checked by `sign.sh`.146