这是一个Cr4zY快速修复,仅在您真的很着急时使用(就像我现在一样,Ship or Die!) ...
使用 0xED http://www.suavetech.com/0xed/之类的工具将二进制文件中的uniqueIdentifier
部分更改为. (注意!必须有相同的长度,否则会很硬!!!)libspotify
uniqueXdentifier
UIDevice
然后在您的项目中为 ie添加一个类似这样的类别方法(使用与更改为相同的名称)
static NSString *alternativeUniqueIdentifier = nil;
#define DEFAULTS_KEY @"heartbreakridge" // "Improvise, adapt, overcome" - Clint Eastwood in DEFAULTS_KEY
@interface UIDevice (CrazyFix)
- (NSString *)uniqueXdentifier;
@end
@implementation UIDevice (CrazyFix)
- (NSString *)uniqueXdentifier
{
if (!alternativeUniqueIdentifier) {
@synchronized(self) {
alternativeUniqueIdentifier = [[NSUserDefaults standardUserDefaults] stringForKey:DEFAULTS_KEY];
if (!alternativeUniqueIdentifier) {
// XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX (capital hex)
CFUUIDRef uuidRef = CFUUIDCreate(kCFAllocatorDefault);
CFStringRef uuidStringRef = CFUUIDCreateString(NULL, uuidRef);
CFRelease(uuidRef);
alternativeUniqueIdentifier = [(NSString*)CFBridgingRelease(uuidStringRef) lowercaseString];
alternativeUniqueIdentifier = [alternativeUniqueIdentifier stringByReplacingOccurrencesOfString:@"-" withString:@""];
alternativeUniqueIdentifier = [NSString stringWithFormat:@"%@%@", [alternativeUniqueIdentifier substringToIndex:8], alternativeUniqueIdentifier];
[[NSUserDefaults standardUserDefaults] setValue:alternativeUniqueIdentifier forKey:DEFAULTS_KEY];
[[NSUserDefaults standardUserDefaults] synchronize];
}
}
}
return alternativeUniqueIdentifier;
}
@end