Created
March 23, 2012 13:43
-
-
Save n00neimp0rtant/2170717 to your computer and use it in GitHub Desktop.
detect a cracked app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(BOOL)appIsCracked | |
{ | |
BOOL cracked = NO; | |
NSString* bundlePath = [[NSBundle mainBundle] bundlePath]; | |
NSString* resourcePath = [[NSBundle mainBundle] resourcePath]; | |
NSFileManager* fileManager = [NSFileManager defaultManager]; | |
NSDictionary* iTunesMetadata = [NSDictionary dictionaryWithContentsOfFile:[NSString stringWithFormat:@"%@/iTunesMetadata.plist", bundlePath]]; | |
if([(NSString*)[iTunesMetadata objectForKey:@"appleId"] isEqualToString:@"[email protected]"]) | |
cracked = YES; | |
if(![fileManager fileExistsAtPath:[NSString stringWithFormat:@"%@/_CodeSignature", resourcePath]]) | |
cracked = YES; | |
if(![fileManager fileExistsAtPath:[NSString stringWithFormat:@"%@/ResourceRules.plist", resourcePath]]) | |
cracked = YES; | |
return cracked; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment