使用codesign -d --entitlements - 应用路径
我们可以查看.ipa的代码签名授权。
例如,来自AppStore的Instagram应用。
</array>
<key>application-identifier</key>
<string>MH9GU9K5PX.com.burbn.instagram</string>
<key>com.apple.developer.ubiquity-kvstore-identifier</key>
<string>777W53UFB2.com.burbn.instagram</string>
<key>com.apple.developer.team-identifier</key>
<string>777W53UFB2</string>
<key>aps-environment</key>
<string>production</string>
<key>com.apple.developer.icloud-container-environment</key>
<string>Production</string>
<key>com.apple.developer.associated-domains</key>
<array>
在运行时检索com.apple.developer.team-identifier的方法有吗?使用以下代码片段:
+ (NSString *)bundleSeedID {
NSDictionary *query = [NSDictionary dictionaryWithObjectsAndKeys:
(__bridge NSString *)kSecClassGenericPassword, (__bridge NSString *)kSecClass,
@"bundleSeedID", kSecAttrAccount,
@"", kSecAttrService,
(id)kCFBooleanTrue, kSecReturnAttributes,
nil];
CFDictionaryRef result = nil;
OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)query, (CFTypeRef *)&result);
if (status == errSecItemNotFound)
status = SecItemAdd((__bridge CFDictionaryRef)query, (CFTypeRef *)&result);
if (status != errSecSuccess)
return nil;
NSString *accessGroup = [(__bridge NSDictionary *)result objectForKey:(__bridge NSString *)kSecAttrAccessGroup];
NSArray *components = [accessGroup componentsSeparatedByString:@"."];
NSString *bundleSeedID = [[components objectEnumerator] nextObject];
CFRelease(result);
return bundleSeedID;
}
我们将获取应用程序前缀ID(有时应用程序前缀ID可能与团队ID不同。
如何在我的应用程序中访问com.apple.developer.team-identifier?