gpt4 book ai didi

macos - 提交 Electron App 到 Mac App Store : Error "Invalid Signature"

转载 作者:行者123 更新时间:2023-12-02 05:58:46 25 4
gpt4 key购买 nike

我正在尝试将基于 Electron 的应用程序提交到 Mac App Store。要签署我正在使用此脚本的应用程序(根据 https://github.com/atom/electron/blob/master/docs/tutorial/mac-app-store-submission-guide.md ):

#!/bin/bash
# Name of your app.
APP="MyApp"
# The path of you app to sign.
APP_PATH="MyApp.app"
# The path to the location you want to put the signed package.
RESULT_PATH="$APP.pkg"
# The name of certificates you requested.
APP_KEY="3rd Party Mac Developer Application: MYCOMPANY (XXX)"
INSTALLER_KEY="3rd Party Mac Developer Installer: MYCOMPANY (XXX)"

FRAMEWORKS_PATH="$APP_PATH/Contents/Frameworks"

codesign --deep -fs "$APP_KEY" --entitlements child.plist "$FRAMEWORKS_PATH/Electron Framework.framework/Versions/A"
codesign --deep -fs "$APP_KEY" --entitlements child.plist "$FRAMEWORKS_PATH/$APP Helper.app/"
codesign --deep -fs "$APP_KEY" --entitlements child.plist "$FRAMEWORKS_PATH/$APP Helper EH.app/"
codesign --deep -fs "$APP_KEY" --entitlements child.plist "$FRAMEWORKS_PATH/$APP Helper NP.app/"
codesign --deep -fs "$APP_KEY" --entitlements child.plist "$FRAMEWORKS_PATH/$APP Framework.framework/Libraries/libnode.dylib"
codesign --deep -fs "$APP_KEY" --entitlements child.plist "$FRAMEWORKS_PATH/$APP Framework.framework/Electron Framework"

# Signage of terminal-notifier
codesign --deep -fs "$APP_KEY" --entitlements child.plist "$APP_PATH/Contents/Resources/app/node_modules/node-notifier/vendor/terminal-notifier.app"

if [ -d "$FRAMEWORKS_PATH/Squirrel.framework/Versions/A" ]; then
# Signing a non-MAS build.
codesign --deep -fs "$APP_KEY" --entitlements child.plist "$FRAMEWORKS_PATH/Mantle.framework/Versions/A"
codesign --deep -fs "$APP_KEY" --entitlements child.plist "$FRAMEWORKS_PATH/ReactiveCocoa.framework/Versions/A"
codesign --deep -fs "$APP_KEY" --entitlements child.plist "$FRAMEWORKS_PATH/Squirrel.framework/Versions/A"
fi
codesign -fs "$APP_KEY" --entitlements parent.plist "$APP_PATH"

productbuild --component "$APP_PATH" /Applications --sign "$INSTALLER_KEY" "$RESULT_PATH"

使用两个授权文件:child.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.inherit</key>
<true/>
</dict>
</plist>

parent.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
</dict>
</plist>

运行脚本后,我使用应用程序加载器将 PKG 文件提交给 MAS。到目前为止它的工作。但是在提交过程之后,我收到了一封来自 Apple 的邮件,其中包含以下错误:

Invalid Signature - This error occurs when you have signed your app's installer incorrectly. There are two certs required for this process: the "3rd Party Mac Developer Application" cert and the "3rd Party Mac Developer Installer" cert. When signing your package, you need to ensure that you are using the Installer cert to sign your package. Ensure that you are specifying this cert when submitting your app via the Xcode Organizer or when running productbuild from the command line.

我使用“3rd Party Mac Developer Installer”证书对包进行签名。我该如何解决这个问题?

最佳答案

在你通过 electron-packager 生成包之后。
您应该编辑包中的 info.plist。在 info.plist 中添加一对 (key,value)。键是“ElectronTeamId”,值是您的团队 ID。
要找到您的团队 ID,请登录 Apple Developer Center,然后单击边栏中的成员资格。您的团队 ID 显示在团队名称下方的成员(member)信息部分。

关于macos - 提交 Electron App 到 Mac App Store : Error "Invalid Signature",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36402071/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com