Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(mac): Add option to enable hardened-runtime #3858

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions packages/app-builder-lib/scheme.json
Original file line number Diff line number Diff line change
Expand Up @@ -1847,6 +1847,11 @@
"description": "Whether a dark mode is supported. If your app does have a dark mode, you can make your app follow the system-wide dark mode setting.",
"type": "boolean"
},
"hardenedRuntime": {
"default": false,
"description": "Whether your app has to be signed with hardened runtime.",
"type": "boolean"
},
"detectUpdateChannel": {
"default": true,
"description": "Whether to infer update channel from application version pre-release components. e.g. if version `0.12.1-alpha.1`, channel will be set to `alpha`. Otherwise to `latest`.",
Expand Down Expand Up @@ -2332,6 +2337,11 @@
"description": "Whether a dark mode is supported. If your app does have a dark mode, you can make your app follow the system-wide dark mode setting.",
"type": "boolean"
},
"hardenedRuntime": {
"default": false,
"description": "Whether your app has to be signed with hardened runtime.",
"type": "boolean"
},
"detectUpdateChannel": {
"default": true,
"description": "Whether to infer update channel from application version pre-release components. e.g. if version `0.12.1-alpha.1`, channel will be set to `alpha`. Otherwise to `latest`.",
Expand Down
3 changes: 2 additions & 1 deletion packages/app-builder-lib/src/macPackager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ export default class MacPackager extends PlatformPackager<MacConfiguration> {
keychain: keychainName || undefined,
binaries: (isMas && masOptions != null ? masOptions.binaries : macOptions.binaries) || undefined,
requirements: isMas || macOptions.requirements == null ? undefined : await this.getResource(macOptions.requirements),
"gatekeeper-assess": appleCertificatePrefixes.find(it => identity!.name.startsWith(it)) != null
"gatekeeper-assess": appleCertificatePrefixes.find(it => identity!.name.startsWith(it)) != null,
"hardened-runtime": macOptions.hardenedRuntime
}

await this.adjustSignOptions(signOptions, masOptions)
Expand Down
6 changes: 6 additions & 0 deletions packages/app-builder-lib/src/options/macOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ export interface MacConfiguration extends PlatformSpecificBuildOptions {
* Extra files to put in archive. Not applicable for `tar.*`.
*/
readonly extraDistFiles?: Array<string> | string | null

/**
* Whether your app has to be signed with hardened runtime.
* @default: false
*/
readonly hardenedRuntime?: boolean
}

export interface DmgOptions extends TargetSpecificOptions {
Expand Down
4 changes: 2 additions & 2 deletions test/out/__snapshots__/BuildTest.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1099,7 +1099,7 @@ Object {
"size": 1069,
},
"index.js": Object {
"size": 4770,
"size": 4826,
},
"package.json": Object {
"size": 524,
Expand Down Expand Up @@ -1231,7 +1231,7 @@ Object {
"size": 1079,
},
"rc.js": Object {
"size": 2339,
"size": 2477,
},
"util.js": Object {
"size": 3034,
Expand Down