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

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

  1. [转载]iOS Provisioning Profile(Certificate)与Code Signing详解

    原文:http://blog.csdn.net/phunxm/article/details/42685597 引言 关于开发证书配置(Certificates & Identifiers & ...

  2. iOS Provisioning Profile(Certificate)与Code Signing详解

    引言 关于开发证书配置(Certificates & Identifiers & Provisioning Profiles),相信做 iOS 开发的同学没少被折腾.对于一个 iOS ...

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

    译者:Jestery 发表时间:2010-04-24浏览量:21082评论数:0挑错数:0 了解并解决代码签名问题 (为保持跟开发环境以及APPLE开发者社区网站结构对应,一些名词未作翻译) 绝大多数 ...

  4. (译)iOS Code Signing: 解惑

    子龙山人 Learning,Sharing,Improving! (译)iOS Code Signing: 解惑 免责申明(必读!):本博客提供的所有教程的翻译原稿均来自于互联网,仅供学习交流之用,切 ...

  5. 【转】iOS Provisioning Profile(Certificate)与Code Signing详解 -- 待看

    原文网址:http://blog.sina.com.cn/s/blog_82c8198f0102vy4j.html 引言 关于开发证书配置(Certificates & Identifiers ...

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

    原文:http://blog.csdn.net/phunxm/article/details/42685597 引言 关于开发证书配置(Certificates & Identifiers & ...

  7. iOS Code Signing: 解惑详解

    iPhone开发的代码签名 代码签名确保代码的真实以及明确识别代码的来源.在代码运行在一个开发系统以前,以及在代码提交到Apple发布以前,Apple要求所有的的应用程序都必须进行数字签名.另外,Ap ...

  8. 微软推荐的Get a code signing certificate流程和链接

    Get a code signing certificate   Before you can establish a Windows Dev Center hardware dashboard ac ...

  9. os.path.join合并 os.path.dirname返回上一级目录 os.path.exists(path) os.stat('path/filename')获取文件/目录信息

    import os str1 = "grsdgfd" str2 = "wddf" str3 = "gddgs" # print(str1 + ...

随机推荐

  1. 【每周一译】愚蠢的指标:Java中使用最多的关键字

    此翻译纯属个人爱好,由于水平所限,翻译质量可能较低.网络上可能存在其它翻译版本,原文地址:http://blog.jooq.org/2013/08/26/silly-metrics-the-most- ...

  2. POJ 1679:The Unique MST(次小生成树&&Kruskal)

    The Unique MST Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 19941   Accepted: 6999 D ...

  3. HTTP初步注解

    搜集了一下网上的资源和自己看过的一些书,小小总结了一波HTTP,现在也只是很肤浅的了解,期望以后深入理解后能写出更有营养的笔记. HTTP协议的主要特点 + 支持客户/服务器模式.+ 简单快速:客户向 ...

  4. DevOps探索

    devops最近随着docker的升温而被越来越多的人所吸引!最近因项目所需投身到devops的项目当中,经过初步的实践搞出一套 paas平台的devops,这个平台现在还需要检验! 作为一个dev, ...

  5. 求新的集合 A=AUB(顺序表)

    #include<stdio.h> typedef int A; const int LIST_INIT_SIZE=100; const int LISTINCREMENT=10; typ ...

  6. Codeforces 116C - Party(dfs)

    n个人,每个人之多有一个上司.“上司”关系具有传递性.求最少将人分成多少组,每组中的每个人的上司或者间接上司都不在该组.拿到题就用树的直径wa了一炮... 正解是有向无环森林的最长路.从每个跟节点df ...

  7. 模拟JQUERY的延迟方法绑定

    模拟JQUERY的延迟方法绑定, 对于延迟方法绑定,各种语言都有不同的描述 什么回调啊,函数指针啊,委托啊,事件啊等,其实也就是那么大回事,不过用好这些特性,对于扩展和架构是非常有好处的, 好处自然就 ...

  8. Windows下Python中的中文路径和中文输出问题

    这几天有个项目需要写一点类似于脚本的小程序,就用Python写了,涉及到中文路径和中文输出的问题,整理一下. 有一个问题我觉得需要先强调一下,在写Python程序的时候,一定保证编码是utf-8,然后 ...

  9. 【双模卡的相关知识】解SIM卡前需要知道的信息(SIM年分和厂商识别)

    <ignore_js_op> 二.SIM版本问题SIM卡的版本有两种说法,一是有些是制造厂制定的,二是电信公司的制定.下面以移动为例,目前我们手里的SIM有几种版本:v0.v1.v2.v3 ...

  10. vs2012-vs2013编译出来的程序不能在xp上运行解决方法

    在链接标志中加入参数: /SUBSYSTEM:WINDOWS,"5.01" 在ide环境下: 项目属性-常规-平台工具集-Visual Studio 2013 - Windows ...