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

使用普通 Apple 开发者账户为 Electron 配置 autoUpdater #22

Open
CyanSalt opened this issue Aug 5, 2019 · 1 comment
Open

Comments

@CyanSalt
Copy link
Owner

CyanSalt commented Aug 5, 2019


path: free-apple-electron-autoupdater


在 macOS 下,autoUpdater 使用的 Squirrel.Mac 要求应用必须进行代码签名,否则 macOS 出于安全性原因无法判断程序的修改是否来自攻击者
electron-osx-sign 支持在 macOS 为 electron 应用进行签名,electron-packager 内置了这一功能,只需指定 osxSign: true 即可。但是这种情况下,electron-osx-sign 默认只会使用 Developer ID 类型的代码签名,这类签名只有 Apple Developer Program 的年费会员才能签出。
普通的 Apple 开发者账户可以签出 Mac Developer 类型的签名用于调试。这种情况下可以手动指定签名给 electron-osx-sign

  1. 确保在 XCode 中签出过 Mac Developer 类型的签名。可以通过 security find-identity -p codesigning -v 命令确认
  2. 执行 spctl --master-disable 禁用默认的逻辑
  3. electron-packager 的选项中指定 osxSign: {identity: 'Mac Developer: [name] ([hash])'}

参考:electron-userland/electron-builder#890

@CyanSalt
Copy link
Owner Author

CyanSalt commented Jan 9, 2020

补充:macOS Catalina 之后,XCode 不再生成 Mac Developer 类型的签名,而是使用 Apple Development 代替,其他不变

@CyanSalt CyanSalt transferred this issue from another repository Feb 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant