libspotify causing Apple App store rejection

拥有回忆 提交于 2019-12-01 08:57:15

Here is a Cr4zY quick-fix, use only if you are in a real hurry (like I am right now, Ship or Die!)...

Use a tool like 0xED http://www.suavetech.com/0xed/ to change the uniqueIdentifier parts in the libspotify binary to something like uniqueXdentifier. (Note! Has to have same length or it will break hard!!!)

Then add a category method for UIDevice i.e. like this in your project (using same name as was changed to)

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

A hot-fix has been released, removing the usage of uniqueIdentifier:

http://devnews.spotify.com/2013/05/16/libspotify-12-ios-hot-fix/

Disclaimer: I work for Spotify

We're aware of the issue and working on making a hot-fix for iOS which removes the need for UDID access. Hang tight!

Edit: Hot-fix is out! Grab it at http://developer.spotify.com/technologies/libspotify . A corresponding release of cocoalibspotify is coming soon, but in the meantime it can be easily changed to support a different version number of libspotify.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!