iOS Hacker Keychain相关The executable was signed with invalid entitlements
生活随笔
收集整理的這篇文章主要介紹了
iOS Hacker Keychain相关The executable was signed with invalid entitlements
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
添加鑰匙串文件KeychainAccessGroups.plist,然后新建Array, 新建String,填寫要名稱之后,在iOS8測(cè)試運(yùn)行是沒有問題的,但是在iOS10下運(yùn)行提示如下錯(cuò)誤
The executable was signed with invalid entitlements.
The entitlements specified in your application’s Code Signing Entitlements file do not match those specified in your provisioning profile. (0xE8008016).
如果把工程設(shè)置里的Code_Sign_Entitlements給去掉的話,可以運(yùn)行,但是肯定是訪問不了Keychain。搞了一整天,終于研究出了解決方法
解決方法:選擇工程->Capabilities->Keychain Sharing開啟,這時(shí)會(huì)自動(dòng)生成一個(gè)entitlements的文件,打開這個(gè)文件可以看到Keychain Access Groups里有一個(gè)值是$(AppIdentifierPrefix)younrame.testproject。我們?cè)诖a修改KeychainItemWrapper里accessGroup的值$(AppIdentifierPrefix)younrame.testproject,現(xiàn)在有一個(gè)疑問AppIdentifierPrefix的值是什么呢?這是開發(fā)者ID的前綴,但是具體是什么值我們并不知道,可以通過代碼來獲取。如下: - (NSString *)GetAppIdentifierPrefix {NSDictionary *query = [NSDictionary dictionaryWithObjectsAndKeys:kSecClassGenericPassword, kSecClass,@"bundleSeedID", kSecAttrAccount,@"", kSecAttrService,(id)kCFBooleanTrue, kSecReturnAttributes,nil];CFDictionaryRef result = nil;OSStatus status = SecItemCopyMatching((CFDictionaryRef)query, (CFTypeRef *)&result);if (status == errSecItemNotFound)status = SecItemAdd((CFDictionaryRef)query, (CFTypeRef *)&result);if (status != errSecSuccess)return nil;NSString *accessGroup = [(NSDictionary *)result objectForKey:kSecAttrAccessGroup];NSArray *components = [accessGroup componentsSeparatedByString:@"."];NSString *strAppIdentifierPrefix = [[components objectEnumerator] nextObject];CFRelease(result);return strAppIdentifierPrefix; }
The executable was signed with invalid entitlements.
The entitlements specified in your application’s Code Signing Entitlements file do not match those specified in your provisioning profile. (0xE8008016).
如果把工程設(shè)置里的Code_Sign_Entitlements給去掉的話,可以運(yùn)行,但是肯定是訪問不了Keychain。搞了一整天,終于研究出了解決方法
解決方法:選擇工程->Capabilities->Keychain Sharing開啟,這時(shí)會(huì)自動(dòng)生成一個(gè)entitlements的文件,打開這個(gè)文件可以看到Keychain Access Groups里有一個(gè)值是$(AppIdentifierPrefix)younrame.testproject。我們?cè)诖a修改KeychainItemWrapper里accessGroup的值$(AppIdentifierPrefix)younrame.testproject,現(xiàn)在有一個(gè)疑問AppIdentifierPrefix的值是什么呢?這是開發(fā)者ID的前綴,但是具體是什么值我們并不知道,可以通過代碼來獲取。如下: - (NSString *)GetAppIdentifierPrefix {NSDictionary *query = [NSDictionary dictionaryWithObjectsAndKeys:kSecClassGenericPassword, kSecClass,@"bundleSeedID", kSecAttrAccount,@"", kSecAttrService,(id)kCFBooleanTrue, kSecReturnAttributes,nil];CFDictionaryRef result = nil;OSStatus status = SecItemCopyMatching((CFDictionaryRef)query, (CFTypeRef *)&result);if (status == errSecItemNotFound)status = SecItemAdd((CFDictionaryRef)query, (CFTypeRef *)&result);if (status != errSecSuccess)return nil;NSString *accessGroup = [(NSDictionary *)result objectForKey:kSecAttrAccessGroup];NSArray *components = [accessGroup componentsSeparatedByString:@"."];NSString *strAppIdentifierPrefix = [[components objectEnumerator] nextObject];CFRelease(result);return strAppIdentifierPrefix; }
總結(jié)
以上是生活随笔為你收集整理的iOS Hacker Keychain相关The executable was signed with invalid entitlements的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: iOS Hacker 使用Reveal分
- 下一篇: iOS Hacker Xcode玩转ar