From c4bf4a8f50dec8a0fb942147d162fde057cd4c6d Mon Sep 17 00:00:00 2001 From: Frederic Jacobs Date: Fri, 14 Aug 2015 00:19:29 +0200 Subject: [PATCH] Preliminary iOS9 support and upgrading to CocoaLumberjack 2.0 --- Podfile | 12 +++--- Podfile.lock | 43 ++++++++++--------- Pods | 2 +- Signal/Signal-Prefix.pch | 6 +-- .../src/textsecure/Storage/TSDatabaseView.m | 11 +++-- Signal/src/util/constraints/Constraints.h | 2 +- .../CodeVerificationViewController.m | 4 +- .../FingerprintViewController.m | 8 ++-- .../src/view controllers/InboxTableViewCell.m | 1 - .../MessageComposeTableViewController.m | 4 +- .../view controllers/MessagesViewController.m | 8 ++-- .../view controllers/NewGroupViewController.m | 4 +- .../PrivacySettingsTableViewController.m | 5 +-- .../ScanIdentityBarcodeViewController.m | 2 +- 14 files changed, 56 insertions(+), 56 deletions(-) diff --git a/Podfile b/Podfile index 260b617a6..fadbf171e 100644 --- a/Podfile +++ b/Podfile @@ -5,15 +5,15 @@ inhibit_all_warnings! link_with ["Signal", "SignalTests"] pod 'OpenSSL', '~> 1.0.204' -pod 'libPhoneNumber-iOS', '~> 0.8.5' +pod 'libPhoneNumber-iOS', '~> 0.8.7' pod 'AxolotlKit', '~> 0.7' -pod 'PastelogKit', '~> 1.2' +pod 'PastelogKit', '~> 1.3' pod 'TwistedOakCollapsingFutures','~> 1.0' -pod 'AFNetworking', '~> 2.5.3' -pod 'Mantle', '~> 2.0.2' -pod 'FFCircularProgressView', '>= 0.1' +pod 'AFNetworking', '~> 2.5.4' +pod 'Mantle', '~> 2.0.4' +pod 'FFCircularProgressView', '~> 0.5' pod 'SCWaveformView', '~> 1.0' -pod 'YapDatabase/SQLCipher', '~> 2.6.4' +pod 'YapDatabase/SQLCipher', '~> 2.7' pod 'SSKeychain' pod 'DJWActionSheet' diff --git a/Podfile.lock b/Podfile.lock index af6709e9f..31883ae18 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -26,24 +26,27 @@ PODS: - 25519 (~> 2.0.1) - HKDFKit (~> 0.0.3) - ProtocolBuffers (~> 1.9.8) - - CocoaLumberjack (1.9.2): - - CocoaLumberjack/Extensions (= 1.9.2) - - CocoaLumberjack/Core (1.9.2) - - CocoaLumberjack/Extensions (1.9.2): + - CocoaLumberjack (2.0.1): + - CocoaLumberjack/Default (= 2.0.1) + - CocoaLumberjack/Extensions (= 2.0.1) + - CocoaLumberjack/Core (2.0.1) + - CocoaLumberjack/Default (2.0.1): - CocoaLumberjack/Core + - CocoaLumberjack/Extensions (2.0.1): + - CocoaLumberjack/Default - DJWActionSheet (1.0.4) - FFCircularProgressView (0.5) - HKDFKit (0.0.3) - JSQMessagesViewController (7.1.0): - JSQSystemSoundPlayer (~> 2.0.1) - JSQSystemSoundPlayer (2.0.1) - - libPhoneNumber-iOS (0.8.5) - - Mantle (2.0.2): - - Mantle/extobjc (= 2.0.2) - - Mantle/extobjc (2.0.2) + - libPhoneNumber-iOS (0.8.7) + - Mantle (2.0.4): + - Mantle/extobjc (= 2.0.4) + - Mantle/extobjc (2.0.4) - OpenSSL (1.0.204) - - PastelogKit (1.2): - - CocoaLumberjack (~> 1.9) + - PastelogKit (1.3): + - CocoaLumberjack (~> 2.0) - ProtocolBuffers (1.9.8) - SCWaveformView (1.0.0) - SocketRocket (0.3.1-beta2) @@ -55,8 +58,8 @@ PODS: - UnionFind (~> 1.0) - UICKeyChainStore (1.0.7) - UnionFind (1.0.1) - - YapDatabase/SQLCipher (2.6.4): - - CocoaLumberjack (~> 1) + - YapDatabase/SQLCipher (2.7): + - CocoaLumberjack (~> 2) - SQLCipher/fts DEPENDENCIES: @@ -71,14 +74,14 @@ DEPENDENCIES: - libPhoneNumber-iOS (~> 0.8.5) - Mantle (~> 2.0.2) - OpenSSL (~> 1.0.204) - - PastelogKit (~> 1.2) + - PastelogKit (~> 1.3) - SCWaveformView (~> 1.0) - SocketRocket (from `https://github.com/FredericJacobs/SocketRocket.git`, commit `f1567f1be7ce49ecf2c9d284ead8ea7c422ee99b`) - SSKeychain - TwistedOakCollapsingFutures (~> 1.0) - UICKeyChainStore (from `Podspecs/UICKeyChainStore.podspec`) - - YapDatabase/SQLCipher (~> 2.6.4) + - YapDatabase/SQLCipher (~> 2.7) EXTERNAL SOURCES: APDropDownNavToolbar: @@ -109,16 +112,16 @@ SPEC CHECKSUMS: AFNetworking: 05edc0ac4c4c8cf57bcf4b84be5b0744b6d8e71e APDropDownNavToolbar: 5d0c3f363208543d20e86ddb4630927c28cdfd4b AxolotlKit: 8652fca51f4bc8225cbda791b0026c21e912b694 - CocoaLumberjack: 628fca2e88ef06f7cf6817309aa405f325d9a6fa + CocoaLumberjack: 019d1361244274a6138c788c6cb80baabc13fb8f DJWActionSheet: 2fe54b1298a7f0fe44462233752c76a530e0cd80 FFCircularProgressView: 683a4ab1e1bd613246a3dffa61503ffdebcde8d8 HKDFKit: c058305d6f64b84f28c50bd7aa89574625bcb62a JSQMessagesViewController: ca11f86fa68ca70835f05e169df9244147c1dc40 JSQSystemSoundPlayer: c5850e77a4363ffd374cd851154b9af93264ed8d - libPhoneNumber-iOS: b8ccd23576379caca37c7cbdd554addf384459ed - Mantle: 967fd31ea0220890b2e76589198996b534bb3fb1 + libPhoneNumber-iOS: 1bccd3288375d954b0b904e26061cecaa0fb83d6 + Mantle: 6bee68168423948be0c0c5924832bf3af188e099 OpenSSL: 576b352e6e6e60793ca133c6785736e3cbc31a09 - PastelogKit: c73795b8c0bbf33ea45d3b6a5eabb373be3d5955 + PastelogKit: 7b475be4cf577713506a943dd940bcc0499c8bca ProtocolBuffers: 9a4a171c0c7cc8f21dd29aeca4f9ac775d84a880 SCWaveformView: 52a96750255d817e300565a80c81fb643e233e07 SocketRocket: 70df1983148525857ced17c57207bfb939bc6b8e @@ -127,6 +130,6 @@ SPEC CHECKSUMS: TwistedOakCollapsingFutures: f359b90f203e9ab13dfb92c9ff41842a7fe1cd0c UICKeyChainStore: d4c0f4e313d67b2f23b6614adca55351accac15a UnionFind: c33be5adb12983981d6e827ea94fc7f9e370f52d - YapDatabase: f9051e178a38f48d0f3a78562423a5bc969f1ca3 + YapDatabase: 9ec61885759a832d41f965e27f7ee08a06d4c441 -COCOAPODS: 0.37.2 +COCOAPODS: 0.38.2 diff --git a/Pods b/Pods index 5b3686139..c36469aa9 160000 --- a/Pods +++ b/Pods @@ -1 +1 @@ -Subproject commit 5b3686139b80eb4eb2bc0817e1c899d862afccf4 +Subproject commit c36469aa9cc7ea2cc8c343065dfbf0353c0b5791 diff --git a/Signal/Signal-Prefix.pch b/Signal/Signal-Prefix.pch index 2339cb234..2b6601300 100644 --- a/Signal/Signal-Prefix.pch +++ b/Signal/Signal-Prefix.pch @@ -7,12 +7,12 @@ #ifdef __OBJC__ #import #import - #import + #import #ifdef DEBUG - static const int ddLogLevel = LOG_LEVEL_VERBOSE; + static const NSUInteger ddLogLevel = DDLogLevelAll; #else - static const int ddLogLevel = LOG_LEVEL_WARN; + static const NSUInteger ddLogLevel = DDLogLevelWarning; #endif #import "iOSVersions.h" diff --git a/Signal/src/textsecure/Storage/TSDatabaseView.m b/Signal/src/textsecure/Storage/TSDatabaseView.m index a8e5ea4de..e0dd10ce4 100644 --- a/Signal/src/textsecure/Storage/TSDatabaseView.m +++ b/Signal/src/textsecure/Storage/TSDatabaseView.m @@ -31,7 +31,7 @@ NSString *TSUnreadDatabaseViewExtensionName = @"TSUnreadDatabaseViewExtensionNa return YES; } - YapDatabaseViewGrouping *viewGrouping = [YapDatabaseViewGrouping withObjectBlock:^NSString *(NSString *collection, NSString *key, id object) { + YapDatabaseViewGrouping *viewGrouping = [YapDatabaseViewGrouping withObjectBlock:^NSString *(YapDatabaseReadTransaction *transaction, NSString *collection, NSString *key, id object) { if ([object isKindOfClass:[TSIncomingMessage class]]){ TSIncomingMessage *message = (TSIncomingMessage*)object; if (message.read == NO){ @@ -61,7 +61,7 @@ NSString *TSUnreadDatabaseViewExtensionName = @"TSUnreadDatabaseViewExtensionNa return YES; } - YapDatabaseViewGrouping *viewGrouping = [YapDatabaseViewGrouping withObjectBlock:^NSString *(NSString *collection, NSString *key, id object) { + YapDatabaseViewGrouping *viewGrouping = [YapDatabaseViewGrouping withObjectBlock:^NSString *(YapDatabaseReadTransaction *transaction, NSString *collection, NSString *key, id object) { if ([object isKindOfClass:[TSThread class]]){ TSThread *thread = (TSThread*)object; if (thread.archivalDate) { @@ -96,7 +96,7 @@ NSString *TSUnreadDatabaseViewExtensionName = @"TSUnreadDatabaseViewExtensionNa return YES; } - YapDatabaseViewGrouping *viewGrouping = [YapDatabaseViewGrouping withObjectBlock:^NSString *(NSString *collection, NSString *key, id object) { + YapDatabaseViewGrouping *viewGrouping = [YapDatabaseViewGrouping withObjectBlock:^NSString *(YapDatabaseReadTransaction *transaction, NSString *collection, NSString *key, id object) { if ([object isKindOfClass:[TSInteraction class]]){ return ((TSInteraction *)object).uniqueThreadId; } @@ -140,7 +140,7 @@ NSString *TSUnreadDatabaseViewExtensionName = @"TSUnreadDatabaseViewExtensionNa } + (YapDatabaseViewSorting*)threadSorting { - return [YapDatabaseViewSorting withObjectBlock:^NSComparisonResult(NSString *group, NSString *collection1, NSString *key1, id object1, NSString *collection2, NSString *key2, id object2) { + return [YapDatabaseViewSorting withObjectBlock:^NSComparisonResult(YapDatabaseReadTransaction *transaction, NSString *group, NSString *collection1, NSString *key1, id object1, NSString *collection2, NSString *key2, id object2) { if ([group isEqualToString:TSArchiveGroup] || [group isEqualToString:TSInboxGroup]) { if ([object1 isKindOfClass:[TSThread class]] && [object2 isKindOfClass:[TSThread class]]){ TSThread *thread1 = (TSThread*)object1; @@ -155,8 +155,7 @@ NSString *TSUnreadDatabaseViewExtensionName = @"TSUnreadDatabaseViewExtensionNa } + (YapDatabaseViewSorting*)messagesSorting { - return [YapDatabaseViewSorting withObjectBlock:^NSComparisonResult(NSString *group, NSString *collection1, NSString *key1, id object1, NSString *collection2, NSString *key2, id object2) { - + return [YapDatabaseViewSorting withObjectBlock:^NSComparisonResult(YapDatabaseReadTransaction *transaction, NSString *group, NSString *collection1, NSString *key1, id object1, NSString *collection2, NSString *key2, id object2) { if ([object1 isKindOfClass:[TSInteraction class]] && [object2 isKindOfClass:[TSInteraction class]]) { TSInteraction *message1 = (TSInteraction*)object1; TSInteraction *message2 = (TSInteraction*)object2; diff --git a/Signal/src/util/constraints/Constraints.h b/Signal/src/util/constraints/Constraints.h index 82ed18e3c..0e7059846 100644 --- a/Signal/src/util/constraints/Constraints.h +++ b/Signal/src/util/constraints/Constraints.h @@ -2,7 +2,7 @@ #import "BadArgument.h" #import "SecurityFailure.h" #import "BadState.h" -#import +#import /// 'require(X)' is used to indicate parameter-related preconditions that callers must satisfy. /// Failure to satisfy indicates a bug in the caller. #define require(expr) if (!(expr)){ NSString *reason = [NSString stringWithFormat:@"require %@ (in %s at line %d)", (@#expr), __FILE__, __LINE__]; DDLogError(@"%@", reason);[BadArgument raise:reason];}; diff --git a/Signal/src/view controllers/CodeVerificationViewController.m b/Signal/src/view controllers/CodeVerificationViewController.m index b88c7162d..9a6668ebe 100644 --- a/Signal/src/view controllers/CodeVerificationViewController.m +++ b/Signal/src/view controllers/CodeVerificationViewController.m @@ -107,10 +107,10 @@ - (void)showAlertForError:(NSError *)error { if (error == nil) { - DDLogCError(@"%@: Error condition, but no NSError to display", self.class); + DDLogError(@"%@: Error condition, but no NSError to display", self.class); return; } else if (error.localizedDescription.length == 0) { - DDLogCError(@"%@: Unable to display error because localizedDescription was not set: %@", self.class, error); + DDLogError(@"%@: Unable to display error because localizedDescription was not set: %@", self.class, error); return; } diff --git a/Signal/src/view controllers/FingerprintViewController.m b/Signal/src/view controllers/FingerprintViewController.m index 6fd0d8a18..f3d46fb54 100644 --- a/Signal/src/view controllers/FingerprintViewController.m +++ b/Signal/src/view controllers/FingerprintViewController.m @@ -114,10 +114,10 @@ static NSString* const kScanIdentityBarcodeViewSegue = @"ScanIdentityBarcodeView tapBlock:^(DJWActionSheet *actionSheet, NSInteger tappedButtonIndex) { _isPresentingDialog = NO; if (tappedButtonIndex == actionSheet.cancelButtonIndex) { - DDLogCDebug(@"User Cancelled"); + DDLogDebug(@"User Cancelled"); } else if (tappedButtonIndex == actionSheet.destructiveButtonIndex) { - DDLogCDebug(@"Destructive button tapped"); - }else { + DDLogDebug(@"Destructive button tapped"); + } else { switch (tappedButtonIndex) { case 0: [self shredKeyingMaterial]; @@ -157,7 +157,7 @@ static NSString* const kScanIdentityBarcodeViewSegue = @"ScanIdentityBarcodeView - (IBAction)unwindIdentityVerificationCancel:(UIStoryboardSegue *)segue{ - DDLogCDebug(@"action cancelled"); + DDLogDebug(@"action cancelled"); // Can later be used to mark identity key as verified if we want step above TOFU in UX } diff --git a/Signal/src/view controllers/InboxTableViewCell.m b/Signal/src/view controllers/InboxTableViewCell.m index 1481130b5..d27722126 100644 --- a/Signal/src/view controllers/InboxTableViewCell.m +++ b/Signal/src/view controllers/InboxTableViewCell.m @@ -27,7 +27,6 @@ owner:self options:nil][0]; - if (self) { _scrollView.contentSize = CGSizeMake(CGRectGetWidth(_contentContainerView.bounds), CGRectGetHeight(_scrollView.frame)); diff --git a/Signal/src/view controllers/MessageComposeTableViewController.m b/Signal/src/view controllers/MessageComposeTableViewController.m index ca14d92e1..9501c335d 100644 --- a/Signal/src/view controllers/MessageComposeTableViewController.m +++ b/Signal/src/view controllers/MessageComposeTableViewController.m @@ -303,7 +303,7 @@ style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) { - DDLogCDebug(@"Cancel action"); + DDLogDebug(@"Cancel action"); }]; UIAlertAction *okAction = [UIAlertAction @@ -355,7 +355,7 @@ } case MessageComposeResultSent: { [self dismissViewControllerAnimated:NO completion:^{ - DDLogCDebug(@"view controller dismissed"); + DDLogDebug(@"view controller dismissed"); }]; UIAlertView *successAlert = [[UIAlertView alloc] initWithTitle:@"" message:NSLocalizedString(@"SEND_SMS_INVITE_SUCCESS", @"") delegate:nil cancelButtonTitle:NSLocalizedString(@"OK", @"") otherButtonTitles:nil]; [successAlert show]; diff --git a/Signal/src/view controllers/MessagesViewController.m b/Signal/src/view controllers/MessagesViewController.m index 43ae8f0d9..f4974db44 100644 --- a/Signal/src/view controllers/MessagesViewController.m +++ b/Signal/src/view controllers/MessagesViewController.m @@ -627,7 +627,7 @@ typedef enum : NSUInteger { return [self loadErrorMessageCellForMessage:msg atIndexPath:indexPath]; default: - DDLogCError(@"Something went wrong"); + DDLogError(@"Something went wrong"); return nil; } } @@ -928,7 +928,7 @@ typedef enum : NSUInteger { NSError *error; _audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:attStream.mediaURL error:&error]; if (error) { - DDLogCError(@"error: %@", error); + DDLogError(@"error: %@", error); } [_audioPlayer prepareToPlay]; [_audioPlayer play]; @@ -1067,7 +1067,7 @@ typedef enum : NSUInteger { [self dismissKeyBoard]; [DJWActionSheet showInView:self.parentViewController.view withTitle:nil cancelButtonTitle:NSLocalizedString(@"TXT_CANCEL_TITLE", @"") destructiveButtonTitle:NSLocalizedString(@"TXT_DELETE_TITLE", @"") otherButtonTitles:@[NSLocalizedString(@"SEND_AGAIN_BUTTON", @"")] tapBlock:^(DJWActionSheet *actionSheet, NSInteger tappedButtonIndex) { if (tappedButtonIndex == actionSheet.cancelButtonIndex) { - DDLogCDebug(@"User Cancelled"); + DDLogDebug(@"User Cancelled"); } else if (tappedButtonIndex == actionSheet.destructiveButtonIndex) { [self.editingDatabaseConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction){ [message removeWithTransaction:transaction]; @@ -1107,7 +1107,7 @@ typedef enum : NSUInteger { [DJWActionSheet showInView:self.parentViewController.view withTitle:messageString cancelButtonTitle:NSLocalizedString(@"TXT_CANCEL_TITLE", @"") destructiveButtonTitle:NSLocalizedString(@"TXT_DELETE_TITLE", @"") otherButtonTitles:actions tapBlock:^(DJWActionSheet *actionSheet, NSInteger tappedButtonIndex) { if (tappedButtonIndex == actionSheet.cancelButtonIndex) { - DDLogCDebug(@"User Cancelled"); + DDLogDebug(@"User Cancelled"); } else if (tappedButtonIndex == actionSheet.destructiveButtonIndex) { [self.editingDatabaseConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction){ [message removeWithTransaction:transaction]; diff --git a/Signal/src/view controllers/NewGroupViewController.m b/Signal/src/view controllers/NewGroupViewController.m index 171a041b8..4e1134924 100644 --- a/Signal/src/view controllers/NewGroupViewController.m +++ b/Signal/src/view controllers/NewGroupViewController.m @@ -158,9 +158,9 @@ static NSString* const kUnwindToMessagesViewSegue = @"UnwindToMessagesViewSegue" tapBlock:^(DJWActionSheet *actionSheet, NSInteger tappedButtonIndex) { if (tappedButtonIndex == actionSheet.cancelButtonIndex) { - DDLogCDebug(@"User Cancelled"); + DDLogDebug(@"User Cancelled"); } else if (tappedButtonIndex == actionSheet.destructiveButtonIndex) { - DDLogCDebug(@"Destructive button tapped"); + DDLogDebug(@"Destructive button tapped"); }else { switch (tappedButtonIndex) { case 0: diff --git a/Signal/src/view controllers/PrivacySettingsTableViewController.m b/Signal/src/view controllers/PrivacySettingsTableViewController.m index cb2b86836..ec78436d6 100644 --- a/Signal/src/view controllers/PrivacySettingsTableViewController.m +++ b/Signal/src/view controllers/PrivacySettingsTableViewController.m @@ -149,12 +149,11 @@ tapBlock:^(DJWActionSheet *actionSheet, NSInteger tappedButtonIndex) { [self.tableView deselectRowAtIndexPath:indexPath animated:YES]; if (tappedButtonIndex == actionSheet.cancelButtonIndex) { - DDLogCDebug(@"User Cancelled"); - + DDLogDebug(@"User Cancelled"); } else if (tappedButtonIndex == actionSheet.destructiveButtonIndex){ [[TSStorageManager sharedManager] deleteThreadsAndMessages]; } else { - DDLogCDebug(@"The user tapped button at index: %li", (long)tappedButtonIndex); + DDLogDebug(@"The user tapped button at index: %li", (long)tappedButtonIndex); } }]; diff --git a/Signal/src/view controllers/ScanIdentityBarcodeViewController.m b/Signal/src/view controllers/ScanIdentityBarcodeViewController.m index fd934e4d7..5833e7b9a 100644 --- a/Signal/src/view controllers/ScanIdentityBarcodeViewController.m +++ b/Signal/src/view controllers/ScanIdentityBarcodeViewController.m @@ -33,7 +33,7 @@ if (self.input) { [self.session addInput:self.input]; } else { - DDLogCDebug(@"Error: %@", error); + DDLogDebug(@"Error: %@", error); } self.output = [[AVCaptureMetadataOutput alloc] init];