Skip to content

Commit 100842e

Browse files
committed
Use ad-hoc signing in release builds
Better to self-sign than to not sign at all
1 parent 85a9cc5 commit 100842e

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,10 @@ Download and execute the installer from the [releases page](https://github.com/p
156156
<details>
157157
<summary>Click to expand</summary>
158158

159-
Download the ZIP file from the [releases page](https://github.com/pol-rivero/github-desktop-plus/releases/latest) and extract it. To run the installer, execute the file `GitHub Desktop Plus.app/Contents/MacOS/GitHub Desktop`.
159+
Download and extract the ZIP file from the [releases page](https://github.com/pol-rivero/github-desktop-plus/releases/latest). Click the app file to run it.
160+
161+
> [!INFO]
162+
> If you encounter the error "Apple could not verify this app is free of malware", go to System Settings > Privacy & Security > Scroll down to Security and click Open Anyway on "GitHub Desktop Plus".
160163
161164
| **64-bit x86** | **64-bit ARM (Apple Silicon)** |
162165
| --- | --- |

script/build.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,16 @@ import {
5050
} from 'fs'
5151
import { copySync } from 'fs-extra'
5252

53+
// Always use ad-hoc code signing ('-'), even for published builds, to avoid "app is damaged" error.
54+
// This is the friendliest non-paid option.
55+
// https://wiki.freepascal.org/Code_Signing_for_macOS#Ad_hoc_signing
56+
const isGitHubDesktopPlus = true
5357
const isPublishableBuild = isPublishable()
5458
const isDevelopmentBuild = getChannel() === 'development'
59+
const useAdHocSigning = isGitHubDesktopPlus || isDevelopmentBuild
5560

5661
const projectRoot = path.join(__dirname, '..')
57-
const entitlementsSuffix = isDevelopmentBuild ? '-dev' : ''
62+
const entitlementsSuffix = useAdHocSigning ? '-dev' : ''
5863
const entitlementsPath = `${projectRoot}/script/entitlements${entitlementsSuffix}.plist`
5964
const extendInfoPath = `${projectRoot}/script/info.plist`
6065
const outRoot = path.join(projectRoot, 'out')
@@ -197,13 +202,13 @@ function packageApp() {
197202
hardenedRuntime: true,
198203
entitlements: entitlementsPath,
199204
}),
200-
type: isPublishableBuild ? 'distribution' : 'development',
205+
type: useAdHocSigning ? 'development' : 'distribution',
201206
// For development, we will use '-' as the identifier so that codesign
202207
// will sign the app to run locally. We need to disable 'identity-validation'
203208
// or otherwise it will replace '-' with one of the regular codesigning
204209
// identities in our system.
205-
identity: isDevelopmentBuild ? '-' : undefined,
206-
identityValidation: !isDevelopmentBuild,
210+
identity: useAdHocSigning ? '-' : undefined,
211+
identityValidation: !useAdHocSigning,
207212
},
208213
osxNotarize,
209214
protocols: [

0 commit comments

Comments
 (0)