首页 > 其他分享 >解决苹果钥匙串-34018错误: A required entitlement isn't present.

解决苹果钥匙串-34018错误: A required entitlement isn't present.

时间:2022-09-19 17:22:45浏览次数:95  
标签:34018 entitlement required 钥匙 isn present

        最近破解了一个苹果版本关键软件,在跳过各种检测延长试用时间之后发现无法保存钥匙串数据了。调试后发现SecItemAdd无法添加钥匙串,返回值-34018,搜寻后发现是因为缺少权限导致的。

       

Unable to add password to the keychain. A required entitlement isn't present.

      关于这个问题的描述,苹果官方有说明,可以参考:https://developer.apple.com/forums/thread/114456

      经过我的分析,是因为该软件设置了两个钥匙串属性导致的:

// 参考:https://opensource.apple.com/source/Security/Security-57740.1.18/OSX/libsecurity_keychain/lib/SecItemConstants.c
// 是否使用数据保护
kSecAttrNoLegacy = "nleg"
// 是否跨设备
kSecAttrSynchronizable = "sync"

       所以我们要做的就是给这两个属性设置成false,或者直接跳过添加这两个属性的代码即可。

 

标签:34018,entitlement,required,钥匙,isn,present
From: https://www.cnblogs.com/bodong/p/16708355.html

相关文章