From 84cfb569129c65b1daebc70ad47a8025465c9c8a Mon Sep 17 00:00:00 2001 From: Piotr Tomasik Date: Sun, 11 May 2014 03:52:28 -0700 Subject: [PATCH] Changed CFBundleShortVersionString to CFBundleVersion for validation --- VerifyStoreReceipt/VerifyStoreReceipt.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/VerifyStoreReceipt/VerifyStoreReceipt.m b/VerifyStoreReceipt/VerifyStoreReceipt.m index 26f1d91..07b4f81 100644 --- a/VerifyStoreReceipt/VerifyStoreReceipt.m +++ b/VerifyStoreReceipt/VerifyStoreReceipt.m @@ -500,7 +500,7 @@ BOOL verifyReceiptAtPath(NSString *receiptPath) { // it turns out, it's a bad idea, to use these two NSBundle methods in your app: // - // bundleVersion = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"]; + // bundleVersion = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]; // bundleIdentifier = [[NSBundle mainBundle] bundleIdentifier]; // // http://www.craftymind.com/2011/01/06/mac-app-store-hacked-how-developers-can-better-protect-themselves/ @@ -511,8 +511,8 @@ BOOL verifyReceiptAtPath(NSString *receiptPath) { NSString *bundleIdentifier = (NSString*)global_bundleIdentifier; // avoid making stupid mistakes --> check again - NSCAssert([bundleVersion isEqualToString:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"]], - @"whoops! check the hard-coded CFBundleShortVersionString!"); + NSCAssert([bundleVersion isEqualToString:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]], + @"whoops! check the hard-coded CFBundleVersion!"); NSCAssert([bundleIdentifier isEqualToString:[[NSBundle mainBundle] bundleIdentifier]], @"whoops! check the hard-coded bundle identifier!"); NSDictionary *receipt = dictionaryWithAppStoreReceipt(receiptPath);