安装特权帮助工具失败- kSMErrorDomainFramework



在我的应用程序中,我使用EvenBetterAuthorizationSample的代码,除了AppDelegate和.xib文件。我已经平衡了项目和目标设置。此外,还完成了对自述文件的调整。示例安装特权工具,但在我的应用程序中SMJobBless失败,错误kSMErrorDomainFramework代码4,这意味着授权权问题。但是我找不到原因/解决办法。不管我怎么试都没用。

我在这里写下我的答案,因为它为我解决了完全相同的问题。

证书验证码似乎是针对Developer ID类型的证书,而对开发证书无效。我使用了技术说明TN2319中的iOS证书验证字符串,它也适用于我的Mac开发者证书。因此,下载EvenBetterAuthorizationSample后的过程为:

App/App- info文件。plist and app - sandbox/XPCService/XPCService- info .plist:

anchor apple generic and identifier "com.example.apple-samplecode.EBAS.HelperTool" and (certificate leaf[field.1.2.840.113635.100.6.1.9] /* exists */ or certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = SKMME9E2Y8)

应修改为

anchor apple generic and identifier "com.example.apple-samplecode.EBAS.HelperTool" and certificate 1[field.1.2.840.113635.100.6.2.1] /* exists */ and (certificate leaf[field.1.2.840.113635.100.6.1.2] /* exists */ or certificate leaf[field.1.2.840.113635.100.6.1.4] /* exists */) and certificate leaf[subject.OU] = SKMME9E2Y8

在文件HelperTool/HelperTool- info .plist:

anchor apple generic and identifier "com.example.apple-samplecode.EBAS.App" and (certificate leaf[field.1.2.840.113635.100.6.1.9] /* exists */ or certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = SKMME9E2Y8)

应修改为

anchor apple generic and identifier "com.example.apple-samplecode.EBAS.App" and certificate 1[field.1.2.840.113635.100.6.2.1] /* exists */ and (certificate leaf[field.1.2.840.113635.100.6.1.2] /* exists */ or certificate leaf[field.1.2.840.113635.100.6.1.4] /* exists */) and certificate leaf[subject.OU] = SKMME9E2Y8

anchor apple generic and identifier "com.example.apple-samplecode.EBAS.XPCService" and (certificate leaf[field.1.2.840.113635.100.6.1.9] /* exists */ or certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = SKMME9E2Y8)

应修改为

anchor apple generic and identifier "com.example.apple-samplecode.EBAS.XPCService" and certificate 1[field.1.2.840.113635.100.6.2.1] /* exists */ and (certificate leaf[field.1.2.840.113635.100.6.1.2] /* exists */ or certificate leaf[field.1.2.840.113635.100.6.1.4] /* exists */) and certificate leaf[subject.OU] = SKMME9E2Y8
在此之后,您仍然需要在所有这四个位置将SKMME9E2Y8修改为您的组织单元。通过选择Mac Developer证书并从右键菜单中选择Get Info,可以很容易地从Keychain Access中检查这一点。正确的值应在组织单位后的主题名称下。做这些事情应该会很顺利。 编辑:

请注意,这仍然是一种黑客,为了正确的应用程序分发,你需要从苹果开发者网站上获得开发者ID证书。使用该证书进行开发有点过度,甚至可能不适合多个开发人员,所以使用上面的hack应该可以让任何人开始。

相关内容

  • 没有找到相关文章

最新更新