From 9b8ff7ad0c4b434d6e206b8031b3d3fa3cac6c54 Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Mon, 13 Apr 2020 21:33:28 -0400 Subject: [PATCH] Kill debug code. --- platform-darwin/Source/MPAppDelegate_InApp.m | 9 --- platform-darwin/Source/MPAppDelegate_Store.m | 6 +- platform-darwin/Source/Mac/MPMacAppDelegate.m | 17 +++--- .../Source/iOS/MPCombinedViewController.m | 2 - platform-darwin/Source/iOS/MPiOSAppDelegate.m | 56 +++---------------- 5 files changed, 19 insertions(+), 71 deletions(-) diff --git a/platform-darwin/Source/MPAppDelegate_InApp.m b/platform-darwin/Source/MPAppDelegate_InApp.m index ca84e18e..023692e0 100644 --- a/platform-darwin/Source/MPAppDelegate_InApp.m +++ b/platform-darwin/Source/MPAppDelegate_InApp.m @@ -172,21 +172,13 @@ PearlAssociatedObjectProperty( NSMutableArray*, ProductObservers, productObserve #endif } -- (void)requestDidFinish:(SKRequest *)request { - - dbg( @"StoreKit request (%@) finished.", request ); -} - #pragma mark - SKPaymentTransactionObserver - (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions { for (SKPaymentTransaction *transaction in transactions) { - dbg( @"transaction updated: %@ -> %d", transaction.payment.productIdentifier, (int)(transaction.transactionState) ); - switch (transaction.transactionState) { case SKPaymentTransactionStatePurchased: { - inf( @"Purchased: %@", transaction.payment.productIdentifier ); NSMutableDictionary *attributes = [NSMutableDictionary new]; if ([transaction.payment.productIdentifier isEqualToString:MPProductFuel]) { @@ -220,7 +212,6 @@ PearlAssociatedObjectProperty( NSMutableArray*, ProductObservers, productObserve break; } case SKPaymentTransactionStateRestored: { - inf( @"Restored: %@", transaction.payment.productIdentifier ); [[NSUserDefaults standardUserDefaults] setObject:transaction.transactionIdentifier forKey:transaction.payment.productIdentifier]; [queue finishTransaction:transaction]; diff --git a/platform-darwin/Source/MPAppDelegate_Store.m b/platform-darwin/Source/MPAppDelegate_Store.m index e263dfde..2aaa19b4 100644 --- a/platform-darwin/Source/MPAppDelegate_Store.m +++ b/platform-darwin/Source/MPAppDelegate_Store.m @@ -643,7 +643,6 @@ PearlAssociatedObjectProperty( NSNumber*, StoreCorrupted, storeCorrupted ); user.avatar = importUser->avatar; user.defaultType = importUser->defaultType; user.lastUsed = [NSDate dateWithTimeIntervalSince1970:MAX( user.lastUsed.timeIntervalSince1970, importUser->lastUsed )]; - dbg( @"Importing user: %@", [user debugDescription] ); // Update or create sites. for (size_t s = 0; s < importUser->sites_count; ++s) { @@ -657,10 +656,8 @@ PearlAssociatedObjectProperty( NSNumber*, StoreCorrupted, storeCorrupted ); return MPError( error, @"Lookup of existing sites failed for site: %@, user: %@", @(importSite->siteName), user.userID ); if ([existingSites count]) // Update existing site. - for (MPSiteEntity *site in existingSites) { + for (MPSiteEntity *site in existingSites) [self importSite:importSite protectedByKey:importKey intoSite:site usingKey:userKey]; - dbg( @"Updated site: %@", [site debugDescription] ); - } else { // Create new site. id algorithm = MPAlgorithmForVersion( importSite->algorithm ); @@ -673,7 +670,6 @@ PearlAssociatedObjectProperty( NSNumber*, StoreCorrupted, storeCorrupted ); site.user = user; [self importSite:importSite protectedByKey:importKey intoSite:site usingKey:userKey]; - dbg( @"Created site: %@", [site debugDescription] ); } } diff --git a/platform-darwin/Source/Mac/MPMacAppDelegate.m b/platform-darwin/Source/Mac/MPMacAppDelegate.m index 35649ac2..f56d5ea9 100644 --- a/platform-darwin/Source/Mac/MPMacAppDelegate.m +++ b/platform-darwin/Source/Mac/MPMacAppDelegate.m @@ -70,18 +70,19 @@ static OSStatus MPHotKeyHander(EventHandlerCallRef nextHandler, EventRef theEven @try { // Sentry [SentrySDK initWithOptions:@{ - @"dsn" : NilToNSNull( decrypt( sentryDSN ) ), + @"dsn" : NilToNSNull( decrypt( sentryDSN ) ), #ifdef DEBUG - @"debug" : @(YES), - @"environment": @"Development", + @"debug" : @(YES), + @"environment" : @"Development", #elif PUBLIC - @"debug" : @(NO), - @"environment": @"Public", + @"debug" : @(NO), + @"environment" : @"Public", #else - @"debug" : @(NO), - @"environment": @"Private", + @"debug" : @(NO), + @"environment" : @"Private", #endif - @"enabled" : [MPMacConfig get].sendInfo, + @"enabled" : [MPMacConfig get].sendInfo, + @"enableAutoSessionTracking": @(YES), }]; [[PearlLogger get] registerListener:^BOOL(PearlLogMessage *message) { PearlLogLevel level = PearlLogLevelWarn; diff --git a/platform-darwin/Source/iOS/MPCombinedViewController.m b/platform-darwin/Source/iOS/MPCombinedViewController.m index a0970e4e..d8fca3be 100644 --- a/platform-darwin/Source/iOS/MPCombinedViewController.m +++ b/platform-darwin/Source/iOS/MPCombinedViewController.m @@ -102,8 +102,6 @@ #pragma mark - Actions - (IBAction)unwindToCombined:(UIStoryboardSegue *)sender { - - dbg( @"unwindToCombined:%@", sender ); } #pragma mark - State diff --git a/platform-darwin/Source/iOS/MPiOSAppDelegate.m b/platform-darwin/Source/iOS/MPiOSAppDelegate.m index 3b33486d..abaef72c 100644 --- a/platform-darwin/Source/iOS/MPiOSAppDelegate.m +++ b/platform-darwin/Source/iOS/MPiOSAppDelegate.m @@ -30,7 +30,6 @@ @property(nonatomic, strong) UIDocumentInteractionController *interactionController; @property(nonatomic, strong) PearlHangDetector *hangDetector; - @end @implementation MPiOSAppDelegate @@ -45,18 +44,19 @@ @try { // Sentry [SentrySDK initWithOptions:@{ - @"dsn" : NilToNSNull( decrypt( sentryDSN ) ), + @"dsn" : NilToNSNull( decrypt( sentryDSN ) ), #ifdef DEBUG - @"debug" : @(YES), - @"environment": @"Development", + @"debug" : @(YES), + @"environment" : @"Development", #elif PUBLIC - @"debug" : @(NO), - @"environment": @"Public", + @"debug" : @(NO), + @"environment" : @"Public", #else - @"debug" : @(NO), - @"environment": @"Private", + @"debug" : @(NO), + @"environment" : @"Private", #endif - @"enabled" : [MPiOSConfig get].sendInfo, + @"enabled" : [MPiOSConfig get].sendInfo, + @"enableAutoSessionTracking": @(YES), }]; [[PearlLogger get] registerListener:^BOOL(PearlLogMessage *message) { PearlLogLevel level = PearlLogLevelWarn; @@ -387,44 +387,6 @@ [self.hangDetector stop]; -// self.task = [application beginBackgroundTaskWithExpirationHandler:^{ -// [application endBackgroundTask:self.task]; -// dbg( @"background expiring" ); -// }]; -// PearlNotMainQueueOperation( ^{ -// NSString *pbstring = [UIPasteboard generalPasteboard].string; -// while (YES) { -// NSString *newString = [UIPasteboard generalPasteboard].string; -// if (![newString isEqualToString:pbstring]) { -// dbg( @"pasteboard changed to: %@", newString ); -// pbstring = newString; -// NSURL *url = [NSURL URLWithString:pbstring]; -// if (url) { -// NSString *siteName = [url host]; -// } -// MPKey *key = [MPiOSAppDelegate get].key; -// if (key) -// [MPiOSAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *context) { -// NSFetchRequest -// *fetchRequest = [NSFetchRequest fetchRequestWithEntityName:NSStringFromClass( [MPSiteEntity class] )]; -// fetchRequest.sortDescriptors = @[ -// [[NSSortDescriptor alloc] initWithKey:NSStringFromSelector( @selector( lastUsed ) ) ascending:NO] -// ]; -// fetchRequest.fetchBatchSize = 2; -// fetchRequest.predicate = [NSPredicate predicateWithFormat:@"(name LIKE[cd] %@) AND user == %@", siteName, -// [[MPiOSAppDelegate get] activeUserOID]]; -// NSError *error = nil; -// NSArray *results = [fetchRequest execute:&error]; -// dbg( @"site search, error: %@, results:\n%@", error, results ); -// if ([results count]) { -// [UIPasteboard generalPasteboard].string = [[results firstObject] resolvePasswordUsingKey:key]; -// } -// }]; -// } -// [NSThread sleepForTimeInterval:5]; -// } -// } ); - [super applicationDidEnterBackground:application]; }