我试图在SMJobKit框架的帮助下通过SMJobBless执行特权帮助程序,但是当我尝试安装该服务时,抛出此错误Error Domain=SMJobKit.SMJError Code=4 "(null)"
当我运行函数checkForProblems时,它会在源代码中抛出[SMJobKit.SMJError.BadBundleCodeSigningDictionary]
,此行有一条评论:"kSecCodeInfoPList was not a dictionary"
应用程序的结构类似于主应用程序(沙盒) - > XPC服务 - >特权助手
代码签名设置为Mac Developer:...
在plist中我有......
允许客户添加和删除工具
anchor apple generic and identifier "*XPC SERVICE IDENTIFIER*" 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] = *DEVELOPER ID*)
安装后拥有的工具
anchor apple generic and identifier "*HELPER IDENTIFIER*" 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] = *DEVELOPER ID*)
由SMJobBless python脚本生成
作为一个例子我使用了更好的授权样本但没有运气