diff --git a/platform-darwin/External/Pearl b/platform-darwin/External/Pearl index 6dc768f6..d0225646 160000 --- a/platform-darwin/External/Pearl +++ b/platform-darwin/External/Pearl @@ -1 +1 @@ -Subproject commit 6dc768f629339f45f0a287b80ba49c257d8c8205 +Subproject commit d02256465aeaae87f21803195ba246cb114ca2ae diff --git a/platform-darwin/MasterPassword-iOS.xcodeproj/project.pbxproj b/platform-darwin/MasterPassword-iOS.xcodeproj/project.pbxproj index 08390d19..aada6200 100644 --- a/platform-darwin/MasterPassword-iOS.xcodeproj/project.pbxproj +++ b/platform-darwin/MasterPassword-iOS.xcodeproj/project.pbxproj @@ -3688,7 +3688,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = "/bin/sh -e"; - shellScript = "cd External/libsodium\n[[ -d libsodium-ios ]] && return\n\n# Xcode misinterpretes autogen.sh's stderr output as errors so we try to silence it.\n[[ -e configure ]] || { err=$(./autogen.sh 2>&1 >&3); } 3>&1 || { x=$?; echo >&2 \"$err\"; exit $x; }\n./dist-build/ios.sh"; + shellScript = "cd External/libsodium\n[[ -d libsodium-ios ]] && exit\n\n# Xcode misinterpretes autogen.sh's stderr output as errors so we try to silence it.\n[[ -e configure ]] || { err=$(./autogen.sh 2>&1 >&3); } 3>&1 || { x=$?; echo >&2 \"$err\"; exit $x; }\n./dist-build/ios.sh"; showEnvVarsInLog = 0; }; DA6556E314D55F3000841C99 /* Run Script: GIT version -> Info.plist */ = { diff --git a/platform-darwin/MasterPassword-macOS.xcodeproj/project.pbxproj b/platform-darwin/MasterPassword-macOS.xcodeproj/project.pbxproj index 734ee60a..7edb7774 100644 --- a/platform-darwin/MasterPassword-macOS.xcodeproj/project.pbxproj +++ b/platform-darwin/MasterPassword-macOS.xcodeproj/project.pbxproj @@ -2345,7 +2345,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = "/bin/sh -e"; - shellScript = "cd External/libsodium\n[[ -d libsodium-osx ]] && return\n\n# Xcode misinterpretes autogen.sh's stderr output as errors so we try to silence it.\n[[ -e configure ]] || { err=$(./autogen.sh 2>&1 >&3); } 3>&1 || { x=$?; echo >&2 \"$err\"; exit $x; }\n./dist-build/osx.sh"; + shellScript = "cd External/libsodium\n[[ -d libsodium-osx ]] && exit\n\n# Xcode misinterpretes autogen.sh's stderr output as errors so we try to silence it.\n[[ -e configure ]] || { err=$(./autogen.sh 2>&1 >&3); } 3>&1 || { x=$?; echo >&2 \"$err\"; exit $x; }\n./dist-build/osx.sh"; showEnvVarsInLog = 0; }; DA4EF9CB19FD4B600032ECB5 /* Run Script: genassets */ = { diff --git a/platform-darwin/Source/Mac/MPPasswordWindowController.m b/platform-darwin/Source/Mac/MPPasswordWindowController.m index 001892e8..d844bdea 100644 --- a/platform-darwin/Source/Mac/MPPasswordWindowController.m +++ b/platform-darwin/Source/Mac/MPPasswordWindowController.m @@ -17,6 +17,7 @@ //============================================================================== #import +#import #import "MPPasswordWindowController.h" #import "MPMacAppDelegate.h" #import "MPAppDelegate_Store.h" @@ -535,30 +536,33 @@ fuzzyRE = [NSRegularExpression regularExpressionWithPattern:@"(.)" options:0 error:nil]; } ); + prof_new( @"updateSites" ); NSString *queryString = self.siteField.stringValue; - NSString *queryPattern; - if ([queryString length] < 13) - queryPattern = [queryString stringByReplacingMatchesOfExpression:fuzzyRE withTemplate:@"*$1*"]; - else - // If query is too long, a wildcard per character makes the CoreData fetch take excessively long. - queryPattern = strf( @"*%@*", queryString ); + NSString *queryPattern = [[queryString stringByReplacingMatchesOfExpression:fuzzyRE withTemplate:@"*$1"] stringByAppendingString:@"*"]; + prof_rewind( @"queryPattern" ); NSMutableArray *fuzzyGroups = [NSMutableArray new]; [fuzzyRE enumerateMatchesInString:queryString options:0 range:NSMakeRange( 0, queryString.length ) usingBlock:^(NSTextCheckingResult *result, NSMatchingFlags flags, BOOL *stop) { [fuzzyGroups addObject:[queryString substringWithRange:result.range]]; }]; + prof_rewind( @"fuzzyRE" ); [MPMacAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *context) { + prof_rewind( @"moc" ); + NSFetchRequest *fetchRequest = [NSFetchRequest fetchRequestWithEntityName:NSStringFromClass( [MPSiteEntity class] )]; fetchRequest.sortDescriptors = @[ [[NSSortDescriptor alloc] initWithKey:@"lastUsed" ascending:NO] ]; fetchRequest.predicate = [NSPredicate predicateWithFormat:@"(%@ == '' OR name LIKE[cd] %@) AND user == %@", queryPattern, queryPattern, [MPMacAppDelegate get].activeUserOID]; + prof_rewind( @"fetchRequest" ); NSError *error = nil; NSArray *siteResults = [context executeFetchRequest:fetchRequest error:&error]; if (!siteResults) { + prof_finish( @"executeFetchRequest: %@ // %@", fetchRequest.predicate, [error fullDescription] ); err( @"While fetching sites for completion: %@", [error fullDescription] ); return; } + prof_rewind( @"executeFetchRequest: %@", fetchRequest.predicate ); BOOL exact = NO; NSMutableArray *newSites = [NSMutableArray arrayWithCapacity:[siteResults count]]; @@ -566,10 +570,12 @@ [newSites addObject:[[MPSiteModel alloc] initWithEntity:site fuzzyGroups:fuzzyGroups]]; exact |= [site.name isEqualToString:queryString]; } + prof_rewind( @"newSites: %u, exact: %d", (uint)[siteResults count], exact ); if (!exact && [queryString length]) { MPUserEntity *activeUser = [[MPAppDelegate_Shared get] activeUserInContext:context]; [newSites addObject:[[MPSiteModel alloc] initWithName:queryString forUser:activeUser]]; } + prof_finish( @"newSites: %@", newSites ); dbg( @"newSites: %@", newSites ); if (![newSites isEqualToArray:self.sites]) diff --git a/platform-darwin/Source/Mac/MPSiteModel.m b/platform-darwin/Source/Mac/MPSiteModel.m index e586ea74..9673757a 100644 --- a/platform-darwin/Source/Mac/MPSiteModel.m +++ b/platform-darwin/Source/Mac/MPSiteModel.m @@ -80,7 +80,6 @@ self.uses = entity.uses_; self.counter = [entity isKindOfClass:[MPGeneratedSiteEntity class]]? [(MPGeneratedSiteEntity *)entity counter]: 0; self.loginGenerated = entity.loginGenerated; - NSLog( @"%@: loginGenerated: %d", self.name, self.loginGenerated ); // Find all password types and the index of the current type amongst them. [self updateContent:entity]; @@ -276,7 +275,6 @@ PearlMainQueue( ^{ self.loginName = loginName; - NSLog( @"%@: loginGenerated: %d, loginName: %@", self.name, self.loginGenerated, loginName ); } ); } diff --git a/platform-darwin/Source/Pearl/Pearl-Prefix.pch b/platform-darwin/Source/Pearl/Pearl-Prefix.pch index 272d59ea..ac530244 100644 --- a/platform-darwin/Source/Pearl/Pearl-Prefix.pch +++ b/platform-darwin/Source/Pearl/Pearl-Prefix.pch @@ -5,24 +5,21 @@ #ifdef __OBJC__ #import -#define PEARL_WITH_SCRYPT #define PEARL_WITH_MESSAGEUI #define PEARL #define PEARL_CRYPTO -#ifdef __IPHONE_OS_VERSION_MIN_REQUIRED +#if TARGET_OS_IOS #define PEARL_UIKIT -#endif -#ifdef __MAC_OS_X_VERSION_MIN_REQUIRED +#elif TARGET_OS_OSX #define PEARL_COCOA #endif #import "Pearl.h" #import "Pearl-Crypto.h" -#ifdef __IPHONE_OS_VERSION_MIN_REQUIRED +#if TARGET_OS_IOS #import "Pearl-UIKit.h" -#endif -#ifdef __MAC_OS_X_VERSION_MIN_REQUIRED +#elif TARGET_OS_OSX #import "Pearl-Cocoa.h" #endif #endif