- (NSString *)bundleSeedID {

    NSDictionary *query = [NSDictionary dictionaryWithObjectsAndKeys:

                           (__bridge id)(kSecClassGenericPassword), 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 id)(kSecAttrAccessGroup)];

    NSArray *components = [accessGroup componentsSeparatedByString:@"."];

    NSString *bundleSeedID = [[components objectEnumerator] nextObject];

    CFRelease(result);

    return bundleSeedID;

}

相关文章:

  • 2021-05-29
  • 2021-08-24
  • 2021-12-21
  • 2022-02-07
  • 2022-12-23
  • 2022-01-15
  • 2021-07-10
  • 2021-10-10
猜你喜欢
  • 2021-09-26
  • 2021-10-12
  • 2021-07-31
  • 2022-12-23
  • 2021-11-07
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案