An update on OS X Code Signing(OS X代码签名)

There has recently been updates to the OS X code signing process. These updates also affect Qt applications signed for distribution, both on and outside the App Store.

OS X 10.9 Mavericks introduced version 2 signatures. As of OS X 10.9.5 and 10.10 Yosemite, v2 signatures are now required. We’ve recently spent some time updating Qt to be v2 compliant and Qt 5.4 will be the first compliant release. This includes patches to qmake and the macdeployqt deployment utility. Manually correcting the signing errors is possible if you are using an older version of Qt.

The Apple documentation is quite comprehensive on this topic, in particular see Code Signing Guide and TN2206 OS X Code Signing In Depth. The Qt tracking bug for this issue is QTBUG-32896.

Required changes to Qt

The required changes falls in three categories: updating the framework and application bundle structure, updating Info.plist contents, and special Qt Quick imports handling.

Updating the framework and application bundle structure

The Info.plist file must be placed in Versions/5/Resources/Info.plist. Updated symlink structure: “Current” symlink points to the actual version (“4” or “5”). The framework must be “clean” at code signing time, with for example no QtCore.prl at the root. This is currently enforced by macdeployqt. As an example, the QtCore.framework structure should look like this:

QtCore.framework/ QtCore -> Versions/Current/QtCore Resources -> Versions/Current/Resources Versions/ Current -> 5 5/ QtCore Resources/ Info.plist And a typical app bundle:

foo.app/ Contents/ Frameworks/ QtCore.framework/ Info.plist MacOS/ foo PkgInfo/ PlugIns/ Resources/ Update Info.plist contents The Info.plist files as generated by current qmake versions are missing some required keys:

CFBundleIdentifier (“org.qt-project.QtCore”) CFBundleVersion (“5.4.0″) Split Qt Quick imports into code and data in the application bundle

This is a v2 code signing requirement which affects applications with Qt Quick imports that contain both binary code (.dylib) and data (.qml) files.

Previous versions macdeployqt would deploy all files to Resources/, but as of v2 binary code in Resources/ is now prohibited. This is solved deploying .dylib files to PlugIns/ and then placing a symlink in Resources/ pointing to the .dylib.

Code signing flow and checkpoints

The following outlines a typical code signing process, with notes on where a current 4.8/5.3 Qt install may fail. The focus is on using the command line tools. Code signing using Xcode is possible but not covered here. The process is incremental: Some steps can be verified by any developer locally, while others require developer account admin access.

  1. Signing and verifying the app bundle.

    sign: codesign --deep foo.app -s MyCertificate or: macdeployqt foo.app -codesign=MyCertificate verify: codesign —verify foo.app The -deep option signs the app bundle recursively, including contained frameworks. While convenient to use, –deep is documented for “emergency repairs and temporary adjustments only“. As of Qt 5.4 macdeployqt has a -codesign option that recursively signs the app bundle without using –deep.

Common errors at this stage include “bundle format unrecognized, invalid, or unsuitable”, and/or “bar.dylib: code object is not signed at all”, which indicates that the framework structure is not correct or that some contained binary was not signed.

At this point which certificate you use does not matter. You can use a self-signed one created in Keychain Access for development and testing purposes.

2a) Distribution outside the App Store Verify that GateKeeper will allow the app:

spctl --assess --type execute foo.app

spctl outputs nothing on success. Common errors include “Rejected”. The bundle must be signed with the correct “Developer ID Application” production certificate for this check to work. The certificate is available for download to the Team Agent in the Mac Dev Center.

2b) App Store distribution May trigger additional errors:

ERROR ITMS-9000 The application bundle contains a tool or framework
foo.app/Contents/Frameworks/QtCore.framework that is missing the
bundle identifier.

This is currently a pending task for Qt 5.4. You can edit the plist files manually and add a bundle identifiers.

Availability

The updates are/will be available for three Qt versions:

5.3 source code (not packaged) 5.4 release. The updates will be be a part of the 5.4 source and binary release. 4.8 patches: https://codereview.qt-project.org/#/c/95572, with the intention that this will be a part of a future 4.8.x release. TODO list

The fixes for some issues are currently in progress:

Adding CFBundleIdentifier for the Qt frameworks Changing the location of .prl files Do you have corrections or additional info? Hit the comments section!

http://www.heilqt.com/topic/5454f72fa8c1c22d30bb1ac5

时间: 2024-08-01 17:39:08

An update on OS X Code Signing(OS X代码签名)的相关文章

iOS Code Signing: 解惑详解

原文链接地址:http://www.cnblogs.com/andyque/archive/2011/08/30/2159086.html iPhone开发的代码签名 代码签名确保代码的真实以及明确识别代码的来源.在代码运行在一个开发系统以前,以及在代码提交到Apple发布以前,Apple要求所有的的应用程序都必须进行数字签名.另外,Apple在发布每一个应用程序之前都要添加他自己的数字签名. 数字签名和签名标识 Apple要求所有的iphone应用程序都需要使用apple提供给已注册的ipho

iOS Provisioning Profile(Certificate)与Code Signing详解

摘自:http://blog.csdn.net/phunxm/article/details/42685597 引言 关于开发证书配置(Certificates & Identifiers & Provisioning Profiles),相信做 iOS 开发的同学没少被折腾.对于一个 iOS 开发小白.半吊子(比如像我自己)抑或老兵,或多或少会有或曾有过以下不详.疑问.疑惑甚至困惑: 什么是App ID?Explicit/Wildcard App ID有何区别?什么是App Group

iOS Code Signing 学习笔记<转写>

最近看了objc.io上第17期中的文章 <Inside Code Signing> 对应的中文翻译版 <代码签名探析> ,受益颇深,对iOS代码签名机制有了进一步的认识.想了解详细内容建议大家还是去看原文好了. 下面是对此文章的理解再结合自己之前对该部分的认识写出的学习笔记.本文的前提是已经对非对称加密有了一定的了解. 一.数字签名(digital signature) 对指定信息使用哈希算法,得到一个固定长度的信息摘要,然后再使用 私钥 (注意必须是私钥)对该摘要加密,就得到了

(译)iOS Code Signing: 解惑

子龙山人 Learning,Sharing,Improving! (译)iOS Code Signing: 解惑 免责申明(必读!):本博客提供的所有教程的翻译原稿均来自于互联网,仅供学习交流之用,切勿进行商业传播.同时,转载时不要移除本申明.如产生任何纠纷,均与本博客所有人.发表该翻译稿之人无任何关系.谢谢合作! 原文链接地址:http://www.raywenderlich.com/2915/ios-code-signing-under-the-hood 注:本文由翻译团队成员skingTr

iPhone OS 开发 - 了解并解决代码签名问题

译者:Jestery 发表时间:2010-04-24浏览量:21082评论数:0挑错数:0 了解并解决代码签名问题 (为保持跟开发环境以及APPLE开发者社区网站结构对应,一些名词未作翻译) 绝大多数iPhone Developer/Distribution 的代码签名生成错误是因为证书和Provisioning profiles没有在开发系统上正确安装引起的. .. 了解并解决代码签名问题 (为保持跟开发环境以及APPLE开发者社区网站结构对应,一些名词未作翻译) 绝大多数iPhone Dev

【转】 iOS Provisioning Profile(Certificate)与Code Signing详解

原文:http://blog.csdn.net/phunxm/article/details/42685597 引言 关于开发证书配置(Certificates & Identifiers & Provisioning Profiles),相信做iOS开发的同学没少被折腾.对于一个iOS开发小白.半吊子(比如像我自己)抑或老兵,或多或少会有或曾有过以下不详.疑问.疑惑甚至困惑: 什么是App ID?Explicit/Wildcard App ID有何区别?什么是App Group ID?

iOS Code Signing: 解惑

注:本文由翻译团队成员skingTree翻译. 教程截图: 下面是一篇有澳洲墨尔本的一名全职iOS开发者提供的文章.他在论坛上是一个很摩登的年轻人 – Adam Eberbach. ·Bundle identifier ·provisioning profiles ·App ID ·certificate signing request 对于新手,的确很难一口气搞清楚这些东东到底有什么区别. 下面我们来揭开它们的神秘面纱,在读完这篇文章后,你应该可以把这些东西联系起来,你能够理解它们是怎么工作,

iOS Code Signing:感悟

关于代码签名: 原文链接地址:http://www.raywenderlich.com/2915/ios-code-signing-under-the-hood 教程截图: 下面是一篇有澳洲墨尔本的一名全职iOS开发者提供的文章.他在论坛上是一个很摩登的年轻人 – Adam Eberbach. ·Bundle identifier ·provisioning profiles ·App ID ·certificate signing request 对于新手,的确很难一口气搞清楚这些东东到底有什

在Mac OS X上利用Spotlight搜索代码

用grep来搜代码和方便,最原生态了,常用的: ? ~ grep 'NuPlayer' -iInr --color ./aosp 其中`i`表示大小写忽略:`I`表示忽略binary文件:`n`显示搜索结果的行号:`r`表示递归搜索子目录 不过grep搜索有点慢,网上也很多通过建立索引加快搜索速度的方法:"other grep-like tools and indexing tools" 一向用户体验著称的Mac指定不会缺少这个,`Spotlight`就是系统自带的基于索引搜索工具,使