From f3c24fd96f7dd64f1badd331f7e8b11d63101e95 Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Mon, 5 Mar 2012 22:43:20 +0100 Subject: [PATCH] Mac OS X build fixes of shared code from iOS. [FIXED] Build problems with code shared from the iOS project in the Mac project. --- MasterPassword-Mac.xcodeproj/project.pbxproj | 12 +++++ MasterPassword-iOS.xcodeproj/project.pbxproj | 46 +++++++++++-------- .../MasterPassword (App Store).xcscheme | 4 +- MasterPassword/MPAppDelegate_Key.h | 1 - MasterPassword/MPAppDelegate_Key.m | 32 ++++++++----- MasterPassword/MPTypes.h | 2 +- MasterPassword/Mac/MPAppDelegate.h | 6 --- MasterPassword/Mac/MPAppDelegate.m | 15 ++---- .../Mac/MPPasswordWindowController.m | 4 +- MasterPassword/iOS/MPAppDelegate.m | 14 +++--- MasterPassword/iOS/MPMainViewController.m | 22 ++++----- MasterPassword/iOS/MPSearchDelegate.m | 4 +- MasterPassword/iOS/MPUnlockViewController.m | 2 +- 13 files changed, 89 insertions(+), 75 deletions(-) diff --git a/MasterPassword-Mac.xcodeproj/project.pbxproj b/MasterPassword-Mac.xcodeproj/project.pbxproj index 1c2e9d71..354218fc 100644 --- a/MasterPassword-Mac.xcodeproj/project.pbxproj +++ b/MasterPassword-Mac.xcodeproj/project.pbxproj @@ -9,6 +9,8 @@ /* Begin PBXBuildFile section */ DA600BEB150420AC008E9AB6 /* MPPasswordWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = DA600BE9150420AC008E9AB6 /* MPPasswordWindowController.m */; }; DA600BEC150420AC008E9AB6 /* MPPasswordWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = DA600BEA150420AC008E9AB6 /* MPPasswordWindowController.xib */; }; + DA600C2D150565FC008E9AB6 /* MPConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = DA600C2A150565FC008E9AB6 /* MPConfig.m */; }; + DA600C2E150565FC008E9AB6 /* MPAppDelegate_Key.m in Sources */ = {isa = PBXBuildFile; fileRef = DA600C2B150565FC008E9AB6 /* MPAppDelegate_Key.m */; }; DAB8D98D150374AD00CED3BC /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DAB8D98C150374AD00CED3BC /* Cocoa.framework */; }; DAB8D9C8150375C800CED3BC /* MasterPassword.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = DAB8D9B2150375C800CED3BC /* MasterPassword.xcdatamodeld */; }; DAB8D9C9150375C800CED3BC /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = DAB8D9B5150375C800CED3BC /* Credits.rtf */; }; @@ -773,6 +775,10 @@ DA600BE8150420AC008E9AB6 /* MPPasswordWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPPasswordWindowController.h; sourceTree = ""; }; DA600BE9150420AC008E9AB6 /* MPPasswordWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPPasswordWindowController.m; sourceTree = ""; }; DA600BEA150420AC008E9AB6 /* MPPasswordWindowController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MPPasswordWindowController.xib; sourceTree = ""; }; + DA600C29150565FC008E9AB6 /* MPConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MPConfig.h; path = MasterPassword/MPConfig.h; sourceTree = SOURCE_ROOT; }; + DA600C2A150565FC008E9AB6 /* MPConfig.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MPConfig.m; path = MasterPassword/MPConfig.m; sourceTree = SOURCE_ROOT; }; + DA600C2B150565FC008E9AB6 /* MPAppDelegate_Key.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MPAppDelegate_Key.m; path = MasterPassword/MPAppDelegate_Key.m; sourceTree = SOURCE_ROOT; }; + DA600C2C150565FC008E9AB6 /* MPAppDelegate_Key.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MPAppDelegate_Key.h; path = MasterPassword/MPAppDelegate_Key.h; sourceTree = SOURCE_ROOT; }; DAB8D988150374AD00CED3BC /* MasterPassword.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MasterPassword.app; sourceTree = BUILT_PRODUCTS_DIR; }; DAB8D98C150374AD00CED3BC /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; DAB8D98F150374AD00CED3BC /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; @@ -2013,6 +2019,10 @@ children = ( DAB8D9B2150375C800CED3BC /* MasterPassword.xcdatamodeld */, DAB8D9B4150375C800CED3BC /* Mac */, + DA600C2B150565FC008E9AB6 /* MPAppDelegate_Key.m */, + DA600C2C150565FC008E9AB6 /* MPAppDelegate_Key.h */, + DA600C29150565FC008E9AB6 /* MPConfig.h */, + DA600C2A150565FC008E9AB6 /* MPConfig.m */, DAB8D9C0150375C800CED3BC /* MPElementStoredEntity.m */, DAB8D9C1150375C800CED3BC /* MPTypes.m */, DAB8D9C2150375C800CED3BC /* MPElementEntity.h */, @@ -4163,6 +4173,8 @@ DAB8D9D1150375C800CED3BC /* MPElementEntity.m in Sources */, DAB8D9D2150375C800CED3BC /* MPElementGeneratedEntity.m in Sources */, DA600BEB150420AC008E9AB6 /* MPPasswordWindowController.m in Sources */, + DA600C2D150565FC008E9AB6 /* MPConfig.m in Sources */, + DA600C2E150565FC008E9AB6 /* MPAppDelegate_Key.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/MasterPassword-iOS.xcodeproj/project.pbxproj b/MasterPassword-iOS.xcodeproj/project.pbxproj index b6967f90..e5bcec40 100644 --- a/MasterPassword-iOS.xcodeproj/project.pbxproj +++ b/MasterPassword-iOS.xcodeproj/project.pbxproj @@ -3824,6 +3824,7 @@ GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( + "TESTFLIGHT=1", "DEBUG=1", "$(inherited)", ); @@ -3847,6 +3848,10 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_PREPROCESSOR_DEFINITIONS = ( + "TESTFLIGHT=1", + "$(inherited)", + ); GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; @@ -3917,7 +3922,7 @@ }; name = Release; }; - DA95D60914DF3F3B008D1B94 /* Production */ = { + DA95D60914DF3F3B008D1B94 /* AppStore */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -3925,7 +3930,10 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_PREPROCESSOR_DEFINITIONS = "PRODUCTION=1"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "APPSTORE=1", + "$(inherited)", + ); GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; @@ -3938,9 +3946,9 @@ TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; - name = Production; + name = AppStore; }; - DA95D60A14DF3F3B008D1B94 /* Production */ = { + DA95D60A14DF3F3B008D1B94 /* AppStore */ = { isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_OBJC_ARC = YES; @@ -3956,9 +3964,9 @@ PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; - name = Production; + name = AppStore; }; - DA95D60B14DF3F3B008D1B94 /* Production */ = { + DA95D60B14DF3F3B008D1B94 /* AppStore */ = { isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_OBJC_ARC = NO; @@ -3970,9 +3978,9 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; }; - name = Production; + name = AppStore; }; - DA95D60C14DF3F3B008D1B94 /* Production */ = { + DA95D60C14DF3F3B008D1B94 /* AppStore */ = { isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_OBJC_ARC = NO; @@ -3982,9 +3990,9 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; }; - name = Production; + name = AppStore; }; - DA95D60D14DF3F3B008D1B94 /* Production */ = { + DA95D60D14DF3F3B008D1B94 /* AppStore */ = { isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_OBJC_ARC = NO; @@ -3994,9 +4002,9 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; }; - name = Production; + name = AppStore; }; - DA95D60E14DF3F3B008D1B94 /* Production */ = { + DA95D60E14DF3F3B008D1B94 /* AppStore */ = { isa = XCBuildConfiguration; buildSettings = { DSTROOT = /tmp/InAppSettingsKit.dst; @@ -4004,7 +4012,7 @@ PRODUCT_NAME = InAppSettingsKit; SKIP_INSTALL = YES; }; - name = Production; + name = AppStore; }; DAC632661486805C0075AEA5 /* Debug */ = { isa = XCBuildConfiguration; @@ -4090,7 +4098,7 @@ buildConfigurations = ( DA5BFA6B147E415C00F98B1E /* Debug */, DA5BFA6C147E415C00F98B1E /* Release */, - DA95D60914DF3F3B008D1B94 /* Production */, + DA95D60914DF3F3B008D1B94 /* AppStore */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -4100,7 +4108,7 @@ buildConfigurations = ( DA5BFA6E147E415C00F98B1E /* Debug */, DA5BFA6F147E415C00F98B1E /* Release */, - DA95D60A14DF3F3B008D1B94 /* Production */, + DA95D60A14DF3F3B008D1B94 /* AppStore */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -4110,7 +4118,7 @@ buildConfigurations = ( DA95D5A514DF063C008D1B94 /* Debug */, DA95D5A614DF063C008D1B94 /* Release */, - DA95D60E14DF3F3B008D1B94 /* Production */, + DA95D60E14DF3F3B008D1B94 /* AppStore */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -4120,7 +4128,7 @@ buildConfigurations = ( DAC632661486805C0075AEA5 /* Debug */, DAC632671486805C0075AEA5 /* Release */, - DA95D60C14DF3F3B008D1B94 /* Production */, + DA95D60C14DF3F3B008D1B94 /* AppStore */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -4130,7 +4138,7 @@ buildConfigurations = ( DAC63275148680650075AEA5 /* Debug */, DAC63276148680650075AEA5 /* Release */, - DA95D60D14DF3F3B008D1B94 /* Production */, + DA95D60D14DF3F3B008D1B94 /* AppStore */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -4140,7 +4148,7 @@ buildConfigurations = ( DAC77CB5148291A600BCF976 /* Debug */, DAC77CB6148291A600BCF976 /* Release */, - DA95D60B14DF3F3B008D1B94 /* Production */, + DA95D60B14DF3F3B008D1B94 /* AppStore */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/MasterPassword-iOS.xcodeproj/xcshareddata/xcschemes/MasterPassword (App Store).xcscheme b/MasterPassword-iOS.xcodeproj/xcshareddata/xcschemes/MasterPassword (App Store).xcscheme index 01106d4b..9abaafb4 100644 --- a/MasterPassword-iOS.xcodeproj/xcshareddata/xcschemes/MasterPassword (App Store).xcscheme +++ b/MasterPassword-iOS.xcodeproj/xcshareddata/xcschemes/MasterPassword (App Store).xcscheme @@ -63,14 +63,14 @@ shouldUseLaunchSchemeArgsEnv = "YES" savedToolIdentifier = "" useCustomWorkingDirectory = "NO" - buildConfiguration = "Release" + buildConfiguration = "Production" debugDocumentVersioning = "YES"> diff --git a/MasterPassword/MPAppDelegate_Key.h b/MasterPassword/MPAppDelegate_Key.h index c1689629..23511954 100644 --- a/MasterPassword/MPAppDelegate_Key.h +++ b/MasterPassword/MPAppDelegate_Key.h @@ -6,7 +6,6 @@ // Copyright (c) 2011 Lyndir. All rights reserved. // -#import #import "MPAppDelegate.h" @interface MPAppDelegate () diff --git a/MasterPassword/MPAppDelegate_Key.m b/MasterPassword/MPAppDelegate_Key.m index 79505960..5c40aa50 100644 --- a/MasterPassword/MPAppDelegate_Key.m +++ b/MasterPassword/MPAppDelegate_Key.m @@ -6,11 +6,9 @@ // Copyright (c) 2011 Lyndir. All rights reserved. // +#import "MPConfig.h" #import "MPAppDelegate_Key.h" -#import "MPMainViewController.h" -#import "IASKSettingsReader.h" - @implementation MPAppDelegate (Key) static NSDictionary *keyQuery() { @@ -44,7 +42,7 @@ static NSDictionary *keyHashQuery() { [PearlKeyChain deleteItemForQuery:keyHashQuery()]; [[NSNotificationCenter defaultCenter] postNotificationName:MPNotificationKeyForgotten object:self]; -#ifndef PRODUCTION +#ifdef TESTFLIGHT [TestFlight passCheckpoint:MPTestFlightCheckpointMPForgotten]; #endif } @@ -56,7 +54,7 @@ static NSDictionary *keyHashQuery() { - (void)loadStoredKey { - if ([[MPiOSConfig get].storeKey boolValue]) { + if ([[MPConfig get].storeKey boolValue]) { // Key is stored in keychain. Load it. dbg(@"Loading key from key chain."); [self updateKey:[PearlKeyChain dataOfItemForQuery:keyQuery()]]; @@ -65,15 +63,21 @@ static NSDictionary *keyHashQuery() { // Key should not be stored in keychain. Delete it. dbg(@"Deleting key from key chain."); [PearlKeyChain deleteItemForQuery:keyQuery()]; -#ifndef PRODUCTION +#ifdef TESTFLIGHT [TestFlight passCheckpoint:MPTestFlightCheckpointMPUnstored]; #endif } } + (MPAppDelegate *)get { - - return (MPAppDelegate *)[super get]; + +#ifdef __IPHONE_OS_VERSION_MIN_REQUIRED + return (MPAppDelegate *)[UIApplication sharedApplication].delegate; +#elif defined (__MAC_OS_X_VERSION_MIN_REQUIRED) + return (MPAppDelegate *)[NSApplication sharedApplication].delegate; +#else +#error Unsupported OS. +#endif } - (BOOL)tryMasterPassword:(NSString *)tryPassword { @@ -92,13 +96,13 @@ static NSDictionary *keyHashQuery() { if (![keyHash isEqual:tryKeyHash]) { dbg(@"Key phrase hash mismatch. Expected: %@, answer: %@.", keyHash, tryKeyHash); -#ifndef PRODUCTION +#ifdef TESTFLIGHT [TestFlight passCheckpoint:MPTestFlightCheckpointMPMismatch]; #endif return NO; } -#ifndef PRODUCTION +#ifdef TESTFLIGHT [TestFlight passCheckpoint:MPTestFlightCheckpointMPAsked]; #endif @@ -123,18 +127,22 @@ static NSDictionary *keyHashQuery() { [PearlKeyChain addOrUpdateItemForQuery:keyHashQuery() withAttributes:[NSDictionary dictionaryWithObjectsAndKeys: self.keyHash, (__bridge id)kSecValueData, +#ifdef __IPHONE_OS_VERSION_MIN_REQUIRED kSecAttrAccessibleWhenUnlocked, (__bridge id)kSecAttrAccessible, +#endif nil]]; - if ([[MPiOSConfig get].storeKey boolValue]) { + if ([[MPConfig get].storeKey boolValue]) { dbg(@"Storing key in key chain."); [PearlKeyChain addOrUpdateItemForQuery:keyQuery() withAttributes:[NSDictionary dictionaryWithObjectsAndKeys: key, (__bridge id)kSecValueData, +#ifdef __IPHONE_OS_VERSION_MIN_REQUIRED kSecAttrAccessibleWhenUnlocked, (__bridge id)kSecAttrAccessible, +#endif nil]]; } -#ifndef PRODUCTION +#ifdef TESTFLIGHT [TestFlight passCheckpoint:[NSString stringWithFormat:MPTestFlightCheckpointSetKeyphraseLength, key.length]]; #endif } diff --git a/MasterPassword/MPTypes.h b/MasterPassword/MPTypes.h index b4ad1bf5..c73b94ef 100644 --- a/MasterPassword/MPTypes.h +++ b/MasterPassword/MPTypes.h @@ -32,7 +32,7 @@ typedef enum { MPElementTypeStoredDevicePrivate = MPElementTypeClassStored | 0x02, } MPElementType; -#ifndef PRODUCTION +#ifdef TESTFLIGHT #define MPTestFlightCheckpointAction @"MPTestFlightCheckpointAction" #define MPTestFlightCheckpointHelpChapter @"MPTestFlightCheckpointHelpChapter_%@" #define MPTestFlightCheckpointCopyToPasteboard @"MPTestFlightCheckpointCopyToPasteboard" diff --git a/MasterPassword/Mac/MPAppDelegate.h b/MasterPassword/Mac/MPAppDelegate.h index 0efbe403..9b336673 100644 --- a/MasterPassword/Mac/MPAppDelegate.h +++ b/MasterPassword/Mac/MPAppDelegate.h @@ -17,15 +17,9 @@ @property (readonly, strong, nonatomic) NSManagedObjectModel *managedObjectModel; @property (readonly, strong, nonatomic) NSManagedObjectContext *managedObjectContext; -@property (readonly, strong, nonatomic) MPPasswordWindowController *passwordWindow; -@property (readonly, strong, nonatomic) NSData *keyPhrase; -@property (readonly, strong, nonatomic) NSString *keyPhraseHashHex; - -+ (MPAppDelegate *)get; + (NSManagedObjectModel *)managedObjectModel; + (NSManagedObjectContext *)managedObjectContext; - (IBAction)saveAction:(id)sender; -- (NSData *)keyPhraseWithLength:(NSUInteger)keyLength; @end diff --git a/MasterPassword/Mac/MPAppDelegate.m b/MasterPassword/Mac/MPAppDelegate.m index e8ca5e1e..d5202000 100644 --- a/MasterPassword/Mac/MPAppDelegate.m +++ b/MasterPassword/Mac/MPAppDelegate.m @@ -6,7 +6,7 @@ // Copyright (c) 2012 Lyndir. All rights reserved. // -#import "MPAppDelegate.h" +#import "MPAppDelegate_Key.h" @interface MPAppDelegate () @@ -20,12 +20,10 @@ @synthesize managedObjectModel = __managedObjectModel; @synthesize managedObjectContext = __managedObjectContext; @synthesize passwordWindow; -@synthesize keyPhrase; -+ (MPAppDelegate *)get { - - return (MPAppDelegate *)[NSApplication sharedApplication].delegate; -} +@synthesize key; +@synthesize keyHash; +@synthesize keyHashHex; + (NSManagedObjectContext *)managedObjectContext { @@ -54,11 +52,6 @@ return [appSupportURL URLByAppendingPathComponent:@"com.lyndir.lhunath.MasterPassword"]; } -- (NSData *)keyPhraseWithLength:(NSUInteger)keyLength { - - return [self.keyPhrase subdataWithRange:NSMakeRange(0, MIN(keyLength, self.keyPhrase.length))]; -} - #pragma mark - Core Data stack - (NSManagedObjectModel *)managedObjectModel { diff --git a/MasterPassword/Mac/MPPasswordWindowController.m b/MasterPassword/Mac/MPPasswordWindowController.m index 9dc27bb4..6be59f96 100644 --- a/MasterPassword/Mac/MPPasswordWindowController.m +++ b/MasterPassword/Mac/MPPasswordWindowController.m @@ -7,7 +7,7 @@ // #import "MPPasswordWindowController.h" -#import "MPAppDelegate.h" +#import "MPAppDelegate_Key.h" @interface MPPasswordWindowController () @@ -46,7 +46,7 @@ fetchRequestFromTemplateWithName:@"MPElements" substitutionVariables:[NSDictionary dictionaryWithObjectsAndKeys: query, @"query", - [MPAppDelegate get].keyPhraseHashHex, @"mpHashHex", + [MPAppDelegate get].keyHashHex, @"mpHashHex", nil]]; return [NSArray arrayWithObjects:@"cow", @"milk", @"hippopotamus", nil]; diff --git a/MasterPassword/iOS/MPAppDelegate.m b/MasterPassword/iOS/MPAppDelegate.m index eba5c7ce..2d44f44b 100644 --- a/MasterPassword/iOS/MPAppDelegate.m +++ b/MasterPassword/iOS/MPAppDelegate.m @@ -40,7 +40,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { -#ifndef PRODUCTION +#ifdef TESTFLIGHT @try { [TestFlight takeOff:@"bd44885deee7adce0645ce8e5498d80a_NDQ5NDQyMDExLTEyLTAyIDExOjM1OjQ4LjQ2NjM4NA"]; [TestFlight setOptions:[NSDictionary dictionaryWithObjectsAndKeys: @@ -124,7 +124,7 @@ [self loadKey:YES]; }]; -#ifndef PRODUCTION +#ifdef TESTFLIGHT [PearlAlert showAlertWithTitle:@"Welcome, tester!" message: @"Thank you for taking the time to test Master Password.\n\n" @"Please provide any feedback, however minor it may seem, via the Feedback action item accessible from the top right.\n\n" @@ -149,7 +149,7 @@ else [self loadKey:NO]; -#ifndef PRODUCTION +#ifdef TESTFLIGHT [TestFlight passCheckpoint:MPTestFlightCheckpointActivated]; #endif } @@ -158,7 +158,7 @@ [self.navigationController performSegueWithIdentifier:@"MP_Guide" sender:self]; -#ifndef PRODUCTION +#ifdef TESTFLIGHT [TestFlight passCheckpoint:MPTestFlightCheckpointShowGuide]; #endif } @@ -193,7 +193,7 @@ if (![[MPiOSConfig get].rememberKey boolValue]) [self updateKey:nil]; -#ifndef PRODUCTION +#ifdef TESTFLIGHT [TestFlight passCheckpoint:MPTestFlightCheckpointDeactivated]; #endif } @@ -202,7 +202,7 @@ [self saveContext]; -#ifndef PRODUCTION +#ifdef TESTFLIGHT [TestFlight passCheckpoint:MPTestFlightCheckpointTerminated]; #endif } @@ -298,7 +298,7 @@ [[NSFileManager defaultManager] removeItemAtURL:storeURL error:nil]; #endif -#ifndef PRODUCTION +#ifdef TESTFLIGHT [TestFlight passCheckpoint:MPTestFlightCheckpointStoreIncompatible]; #endif diff --git a/MasterPassword/iOS/MPMainViewController.m b/MasterPassword/iOS/MPMainViewController.m index e76e5ae1..3ebb7d29 100644 --- a/MasterPassword/iOS/MPMainViewController.m +++ b/MasterPassword/iOS/MPMainViewController.m @@ -216,7 +216,7 @@ - (void)setHelpChapter:(NSString *)chapter { -#ifndef PRODUCTION +#ifdef TESTFLIGHT [TestFlight passCheckpoint:[NSString stringWithFormat:MPTestFlightCheckpointHelpChapter, chapter]]; #endif @@ -280,7 +280,7 @@ [self showContentTip:@"Copied!" withIcon:nil]; -#ifndef PRODUCTION +#ifdef TESTFLIGHT [TestFlight passCheckpoint:MPTestFlightCheckpointCopyToPasteboard]; #endif } @@ -295,7 +295,7 @@ ++((MPElementGeneratedEntity *) self.activeElement).counter; }]; -#ifndef PRODUCTION +#ifdef TESTFLIGHT [TestFlight passCheckpoint:MPTestFlightCheckpointIncrementPasswordCounter]; #endif } @@ -323,7 +323,7 @@ [self.contentField becomeFirstResponder]; } -#ifndef PRODUCTION +#ifdef TESTFLIGHT [TestFlight passCheckpoint:MPTestFlightCheckpointEditPassword]; #endif } @@ -336,7 +336,7 @@ self.alertBody.text = nil; }]; -#ifndef PRODUCTION +#ifdef TESTFLIGHT [TestFlight passCheckpoint:MPTestFlightCheckpointCloseAlert]; #endif } @@ -365,7 +365,7 @@ [self.navigationController pushViewController:settingsVC animated:YES]; break; } -#ifndef PRODUCTION +#ifdef TESTFLIGHT case 4: [TestFlight openFeedbackView]; break; @@ -380,13 +380,13 @@ } } -#ifndef PRODUCTION +#ifdef TESTFLIGHT [TestFlight passCheckpoint:MPTestFlightCheckpointAction]; #endif } cancelTitle:[PearlStrings get].commonButtonCancel destructiveTitle:nil otherTitles: [self isHelpVisible]? @"Hide Help": @"Show Help", @"FAQ", @"Tutorial", @"Settings", -#ifndef PRODUCTION +#ifdef TESTFLIGHT @"Feedback", #endif @"Sign Out", @@ -418,7 +418,7 @@ self.activeElement.type = type; -#ifndef PRODUCTION +#ifdef TESTFLIGHT [TestFlight passCheckpoint:[NSString stringWithFormat:MPTestFlightCheckpointSelectType, NSStringFromMPElementType(type)]]; #endif @@ -436,7 +436,7 @@ [self.searchDisplayController setActive:NO animated:YES]; self.searchDisplayController.searchBar.text = self.activeElement.name; -#ifndef PRODUCTION +#ifdef TESTFLIGHT [TestFlight passCheckpoint:MPTestFlightCheckpointSelectElement]; #endif } @@ -474,7 +474,7 @@ navigationType:(UIWebViewNavigationType)navigationType { if (navigationType == UIWebViewNavigationTypeLinkClicked) { -#ifndef PRODUCTION +#ifdef TESTFLIGHT [TestFlight passCheckpoint:MPTestFlightCheckpointExternalLink]; #endif diff --git a/MasterPassword/iOS/MPSearchDelegate.m b/MasterPassword/iOS/MPSearchDelegate.m index e0b033fc..4a938fd6 100644 --- a/MasterPassword/iOS/MPSearchDelegate.m +++ b/MasterPassword/iOS/MPSearchDelegate.m @@ -54,7 +54,7 @@ - (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar { -#ifndef PRODUCTION +#ifdef TESTFLIGHT [TestFlight passCheckpoint:MPTestFlightCheckpointCancelSearch]; #endif @@ -302,7 +302,7 @@ MPElementEntity *element = [self.fetchedResultsController objectAtIndexPath:indexPath]; [self.fetchedResultsController.managedObjectContext deleteObject:element]; -#ifndef PRODUCTION +#ifdef TESTFLIGHT [TestFlight passCheckpoint:MPTestFlightCheckpointDeleteElement]; #endif }]; diff --git a/MasterPassword/iOS/MPUnlockViewController.m b/MasterPassword/iOS/MPUnlockViewController.m index 79a0f4e2..4f1c705e 100644 --- a/MasterPassword/iOS/MPUnlockViewController.m +++ b/MasterPassword/iOS/MPUnlockViewController.m @@ -214,7 +214,7 @@ typedef enum { [[MPAppDelegate get] loadKey:YES]; -#ifndef PRODUCTION +#ifdef TESTFLIGHT [TestFlight passCheckpoint:MPTestFlightCheckpointMPChanged]; #endif }