• 得到bundle seed id


    - (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;

    }

  • 相关阅读:
    Python中下划线---完全解读(转)
    数字、基数及表示
    实现二叉排序树的各种算法
    shell脚本 空格
    Linux中执行shell脚本的4种方法
    vim常用命令总结
    Linux 奇技淫巧
    排序算法之二分治法
    二分查找
    排序算法之一插入排序
  • 原文地址:https://www.cnblogs.com/wudan7/p/4143486.html
Copyright © 2020-2023  润新知