IBM Worklight/MobileFirst 6.x/7.0 - "Code object is not signed at all." 脚本错误 buildtime.sh

IBM Worklight/MobileFirst 6.x/7.0 - "Code object is not signed at all." error with buildtime.sh script

我在将我的 Worklight 应用程序上传到 iTunes 时遇到错误。

应用程序验证失败,出现以下错误:

Invalid Signature. Code object is not signed at all. The binary at path [MyApp.app/buildtime.sh] contains an invalid signature. Make sure you have signed your application with a distribution certificate, not an ad hoc certificate or a development certificate. Verify that the code signing settings in Xcode are correct at the target level (which override any values at the project level). Additionally, make sure the bundle you are uploading was built using a Release target in Xcode, not a Simulator target. If you are certain your code signing settings are correct, choose "Clean All" in Xcode, delete the "build" directory in the Finder, and rebuild your release target. For more information, please consult https://developer.apple.com/library/ios/documentation/Security/Conceptual/CodeSigningGuide/Introduction/Introduction.html

我的问题是我在 2 周前提交了相同的申请并且它工作正常。今天的版本只改了www/文件夹内容,失败报这个错。

我用谷歌搜索了这个问题,找到了 Codesign of Dropbox API fails in Xcode 4.6.3: "code object is not signed at all",但我尝试添加 --deep 选项,但这对我不起作用。

这与 buildtime.sh 脚本有关吗?在我阅读它时,它似乎只是更新 worklight.plist 文件中的构建时间值:

#!/bin/bash
# Licensed Materials - Property of IBM
# 5725-I43 (C) Copyright IBM Corp. 2006, 2013. All Rights Reserved.
# US Government Users Restricted Rights - Use, duplication or
# disclosure restricted by GSA ADP Schedule Contract with IBM Corp.

# Update buildtime in project 
echo -n ${TARGET_BUILD_DIR}/${PRODUCT_NAME}.app/worklight.plist | xargs -0
/usr/libexec/PlistBuddy -c "Set :buildtime `date +\"%s\"`"

此外,在谷歌搜索问题时,我发现了一些类似的问题: https://github.com/AppGyver/steroids/issues/918 他们似乎使用带有 sh 脚本的混合应用程序,这让我相信这个问题与 buildtime.sh 脚本有关。

我删除了构建时脚本,并在我的 Xcode 项目中删除了 运行 脚本阶段,这次没有报错。

这样做安全吗?

有人在 Worklight 项目中遇到过同样的错误吗?它与 buildtime.sh 脚本或新的 Apple 政策有关吗?

在 MFP 开发人员中心关于此问题的博客 post:https://developer.ibm.com/mobilefirstplatform/2015/05/01/recent-changes-in-apples-app-submission-process/

问题是 Apple 现在也在检查应用程序包(.ipa 文件)中包含的 .sh 文件是否已签名。

在一个 Worklight/MobileFirst 基于平台的应用程序中,恰好有一个这样的 .sh 文件,buildtime.sh,它被添加到包中。此文件没有理由包含在生成的包中。该文件仅在构建时需要,运行 时不需要。

有一个简单的解决方法:删除删除)buildtime.sh文件从目标配置中Xcode(在构建阶段>复制捆绑资源)。

还有可用的 iFixes(IBM APAR PI39826,仅 Worklight/MFP Studio/CLI;无需更改服务器)来自 IBM Fix Central

  • 6.0.0.2-IF201504301500
  • 6.1.0.2-IF201504301501
  • 6.2.0.1-IF201504301522
  • 6.3.0.0-IF201504301455
  • 7.0.0.0-IF201504301556

此 iFix 仅适用于:

  • 新创建的应用程序
  • 本机文件夹被删除并重新生成的应用程序

通过使用 iFix,这些应用程序将不会在目标配置中包含 buildtime.sh 文件。

现有应用程序只需简单地从目标配置中删除 .sh 文件,然后在 Xcode 中重新构建。