首页 文章

将Electron App提交到Mac App Store:错误“无效签名”

提问于
浏览
1

我'm trying to submit an Electron based app to the Mac App Store. To sign the app I' m使用此脚本(根据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>

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

签名无效 - 如果您错误地签署了应用程序的安装程序,则会出现此错误 . 此过程需要两个证书:“第三方Mac开发人员应用程序”证书和“第三方Mac开发人员安装程序”证书 . 签署包时,您需要确保使用安装程序证书对包进行签名 . 通过Xcode Organizer提交应用程序或从命令行运行productbuild时,请确保指定此证书 .

我使用“第三方Mac开发者安装程序”证书对包裹进行签名 . 我怎么解决这个问题?

2 回答

  • 0

    通过electron-packager生成包后 .
    你应该编辑包中的info.plist . 将一对(键,值)添加到info.plist . 关键是"ElectronTeamId",值是您的团队ID .
    要找到您的团队ID,请登录Apple开发人员中心,然后单击侧栏中的“成员身份” . 您的团队ID显示在团队名称下的“成员身份信息”部分中 .

  • -1

    我建议检查electron-osx-sign . 从您的签名脚本的摘录中,'s slightly uncertain to tell where the process went wrong. So with this module, all you' ll必须做的是:

    $ electron-osx-sign path/to/my.app

    其余的设置权利和签署不同版本的包含框架可以为您完成 .

相关问题