MacOS 现在要求所有应用程序都经过强化、签名和公证。如何使用 PyInstaller 这样的工具对在 XCode 之外创建的应用程序进行签名和公证?
.app我已经整理了在 XTools 之外创建的文件的签名和公证。这里有一个非常有用的线程,展示了如何添加一个entitlements.plist来实现 PyInstaller 文件的强化.app。我相信这也适用于命令行实用程序,但可能会丢失一些东西。提交.dmg包含 a 的.app文件进行公证使用altool将通过测试并由 Apple 进行公证。
使用相同流程提交单个命令行实用程序也将通过公证,但不会出现在其他计算机上的 GateKeeper 功能上的签名或公证。Info.plist我认为这与 PyInstaller 二进制文件中未包含有效文件有关,如这篇有关为 Catalina 构建和交付命令行工具的博客文章中详细介绍的。
使用检查签名文件的签名codesign -dvv表明该Info.plist文件“未绑定”。
$ codesign -dvv ./dist/helloworld
Executable=/Users/aaronciuffo/Documents/src/toy/codesign/dist/helloworld
Identifier=helloworld
Format=Mach-O thin (x86_64)
CodeDirectory v=20500 size=72086 flags=0x10000(runtime) hashes=2244+5 location=embedded
Signature size=9054
Authority=Developer ID Application: Aaron Ciuffo (4H9P6Q65AM)
Authority=Developer ID Certification Authority
Authority=Apple Root CA
Timestamp=Nov 2, 2020 at 9:03:30 …Run Code Online (Sandbox Code Playgroud) 我在使用 GitHub Actions 时遇到问题。当我打电话时,productsign工作就挂起了。在搜索互联网时,该作业似乎试图要求用户输入密码,但我没有从日志中收到任何错误或反馈。这项工作永远悬而未决。当在我自己的计算机上运行时,一切都按预期运行并且 .pkg 已签名。
我的工作流程步骤如下
- name: Build & Sign Installer
run: |
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
(cd fastlane && ./decrypt_secret.sh)
carthage update --use-xcframeworks --platform macOS
bundle exec fastlane set_release_version
bundle exec fastlane mac install_certificates
bundle exec fastlane mac build_main_app
bundle exec fastlane mac build_updater
bundle exec fastlane mac build_installer
(cd installer && productsign --sign <identity> app-1.0.0.pkg app-1.0.0-signed.pkg)
Run Code Online (Sandbox Code Playgroud)
我尝试了很多不同的解决方案,但没有任何效果
security import ${P12_FILE} -k ${KEYCHAIN_PATH} -P ${P12_PASSWORD} -Asecurity import ${P12_FILE} -k ${KEYCHAIN_PATH} -P ${P12_PASSWORD} -T /usr/bin/productsign …