【发布时间】:2021-02-15 12:46:38
【问题描述】:
MacOS 现在要求所有应用程序都经过强化、签名和公证。如何使用 PyInstaller 之类的工具对在 XCode 之外创建的应用程序进行签名和公证?
我已经整理好了在 XTools 之外创建的 .app 文件的签名和公证。有一个非常有用的线程 here 展示了如何添加一个 entitlements.plist 来完成 PyInstaller .app 文件的强化。我相信这也适用于命令行实用程序,但可能会丢失一些东西。使用altool 提交包含.app 的.dmg 进行公证将通过测试并由Apple 公证。
使用相同过程提交单个命令行实用程序也将通过公证,但不会在其他机器上显示为 GateKeeper 功能签名或公证。我认为这与 this blog post about building and delivering command line tools for Catalina 中详述的 PyInstaller 二进制文件中不包含有效的 Info.plist 文件有关。
使用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 PM
Info.plist=not bound
TeamIdentifier=4H9P6Q65AM
Runtime Version=10.11.0
Sealed Resources=none
Internal requirements count=1 size=172
一个suggested solution is using the Go gon package,但据我所知,gon 不包括添加所需的Info.plist。
是否有可以帮助解决此问题的工作流程或应用程序?如何在 XCode 之外创建 CL 应用程序并成功对其进行签名?
【问题讨论】:
标签: xcode macos pyinstaller