Aar*_*ffo 11 macos xcode pyinstaller
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 PM
Info.plist=not bound
TeamIdentifier=4H9P6Q65AM
Runtime Version=10.11.0
Sealed Resources=none
Internal requirements count=1 size=172
Run Code Online (Sandbox Code Playgroud)
一种建议的解决方案是使用 Go gon 包Info.plist
,但据我所知,gon 不包括添加所需的内容。
是否有工作流程或应用程序可以对此提供帮助?如何在 XCode 之外创建 CL 应用程序并成功对其进行签名?
Aar*_*ffo 17
Apple 要求所有分发的二进制文件都使用付费 Apple 开发者帐户进行签名和公证。对于使用 PyInstaller 等工具创建的二进制文件或使用 gcc 编译的二进制文件,可以使用命令行工具来完成此操作。
下面链接的脚本允许您使用项目特定.ini
文件自动执行此过程。
如果您已有开发者帐户并Developer ID Application
在Developer ID Installer
XCode 中配置了证书,请跳过此步骤
+
左下角的Apple ID
+
左下角 ,选择开发者ID申请+
左下角 并选择Developer ID InstallerKeyChain Access
注意!额外的参数,例如--add-data
构建功能二进制文件可能需要的参数
pyinstaller --onefile myapp.py
security find-identity -p basic -v
1) ABC123 "Apple Development: aaronciuffonl@gmail.com ()"
2) XYZ234 "Developer ID Installer: Aaron Ciuffo ()"
3) QRS333 "Developer ID Application: Aaron Ciuffo ()"
4) LMN343 "Developer ID Application: Aaron Ciuffo ()"
5) ZPQ234 "Apple Development: aaron.ciuffo@gmail.com ()"
6) ASD234 "Developer ID Application: Aaron Ciuffo ()"
7) 01010A "Developer ID Application: Aaron Ciuffo ()"
7 valid identities found
Run Code Online (Sandbox Code Playgroud)
codesign --deep --force --options=runtime --entitlements ./entitlements.plist --sign "HASH_OF_DEVELOPER_ID APPLICATION" --timestamp ./dist/foo.app
mkdir /tmp/myapp
ditto /path/to/myapp /tmp/myapp/path/to/install/location
/Applications/
目标上使用:ditto ~/src/whiz_bang/dist/whizBang /tmp/whiz_bang/Applications/
productbuild --identifier "com.your.pkgname.pkg" --sign "HASH_OF_INSTALLER_ID" --timestamp --root /tmp/myapp / myapp.pkg
--root
选项的格式如下:--root
<ditto path>
<relative path on target system to install from>
<signed .pkg file>
xcrun altool --notarize-app --primary-bundle-id "com.foobar.fooapp" --username="developer@foo.com" --password "@keychain:Developer-altool" --file ./myapp.pkg
xcrun altool --notarization-history 0 -u "developer@***" -p "@keychain:Developer-altool"
xcrun altool --notarization-info "Your-Request-UUID" \
--username "username@example.com" \
--password "@keychain:Developer-altool"
Run Code Online (Sandbox Code Playgroud)
xcrun stapler staple ghostscript64.pkg
-p "@keychain:Key"
交换机工作entitlements.plist
到签名过程
归档时间: |
|
查看次数: |
7114 次 |
最近记录: |