Skip to content

Commit f934362

Browse files
authored
Adds a codesigning script. (#136)
1 parent 5593389 commit f934362

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/bash
2+
# Invoke this script with a relative '.app' path, for example:
3+
# codesign-electron.sh "darwin-x64/Electron.app"
4+
5+
# 1. Run the following command to get a list of identities:
6+
# security find-identity
7+
8+
# 2. Now set the value of the identity variable below to the identity you want to use:
9+
identity=$REACTOTRON_CODESIDE_IDENTITY
10+
11+
app="$PWD/$1"
12+
13+
echo "Signing..."
14+
# When you sign frameworks, you have to sign a specific version.
15+
# For example, you have to sign "Electron Framework.framework/Versions/A"
16+
# Signing the top level folder ("Electron Framework.framework") will fail.
17+
# Signing "Electron Framework.framework/Versions/Current" will also fail (because it is a symbolic link).
18+
# Apple recommends NOT using --deep, but rather signing each item explictly (which is how XCode does it).
19+
# Other scripts sometimes resign items multiple times in the process because of --deep which is slow.
20+
# The following signs the bare minimum needed to get Gatekeeper acceptance.
21+
# If you renamed "Electron Helper.app", "Electron Helper EH.app" and "Electron Helper NP.app" then rename below.
22+
codesign --verbose --sign "$identity" "$app/Contents/Frameworks/Electron Framework.framework/Versions/A"
23+
codesign --verbose --sign "$identity" "$app/Contents/Frameworks/Reactotron Helper EH.app"
24+
codesign --verbose --sign "$identity" "$app/Contents/Frameworks/Reactotron Helper NP.app"
25+
codesign --verbose --sign "$identity" "$app/Contents/Frameworks/Reactotron Helper.app"
26+
codesign --verbose --sign "$identity" "$app/Contents/Frameworks/Mantle.framework/Versions/A"
27+
codesign --verbose --sign "$identity" "$app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A"
28+
codesign --verbose --sign "$identity" "$app/Contents/Frameworks/Squirrel.framework/Versions/A"
29+
codesign --verbose --sign "$identity" "$app"
30+
31+
# This will often pass, even if Gatekeeper fails.
32+
echo ""
33+
echo "Verifying signatures..."
34+
codesign --verify --deep --display --verbose=4 "$app"
35+
36+
# This is what really counts and what the user will see.
37+
echo ""
38+
echo "Veriyfing Gatekeeper acceptance..."
39+
spctl --ignore-cache --no-cache --assess --type execute --verbose=4 "$app"

packages/reactotron-app/package.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const DEFAULT_OPTS = {
2121
dir: './',
2222
name: appName,
2323
asar: shouldUseAsar,
24+
'app-bundle-id': 'com.reactotron.app',
2425
ignore: [
2526
'^/test($|/)',
2627
'^/release($|/)',
@@ -47,7 +48,7 @@ if (version) {
4748
// use the same version as the currently-installed electron-prebuilt
4849
exec('npm list electron-prebuilt --dev', (err, stdout) => {
4950
if (err) {
50-
DEFAULT_OPTS.version = '1.2.0'
51+
DEFAULT_OPTS.version = '1.3.2'
5152
} else {
5253
DEFAULT_OPTS.version = stdout.split('electron-prebuilt@')[1].replace(/\s/g, '')
5354
}

0 commit comments

Comments
 (0)