From cb3f56444643c8613856498cd99de0a8caf01732 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Tue, 17 Jan 2017 16:01:19 -0500 Subject: [PATCH 1/4] Fix web socket issue. // FREEBIE --- Podfile | 3 ++- Podfile.lock | 8 ++++---- Signal/src/AppDelegate.m | 10 +++++++--- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Podfile b/Podfile index 69ef648f8..2f59635e8 100644 --- a/Podfile +++ b/Podfile @@ -4,7 +4,8 @@ source 'https://github.com/CocoaPods/Specs.git' target 'Signal' do pod 'SocketRocket', :git => 'https://github.com/facebook/SocketRocket.git' pod 'AxolotlKit', git: 'https://github.com/WhisperSystems/SignalProtocolKit.git' - pod 'SignalServiceKit', git: 'https://github.com/WhisperSystems/SignalServiceKit.git', branch: 'master' + #pod 'SignalServiceKit', git: 'https://github.com/WhisperSystems/SignalServiceKit.git', branch: 'master' + pod 'SignalServiceKit', git: 'https://github.com/WhisperSystems/SignalServiceKit.git', branch: 'feature/fixWebsocket2' #pod 'SignalServiceKit', path: '../SignalServiceKit' pod 'OpenSSL' pod 'PastelogKit', '~> 1.3' diff --git a/Podfile.lock b/Podfile.lock index 8408db4e7..9947afcfb 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -121,7 +121,7 @@ DEPENDENCIES: - OpenSSL - PastelogKit (~> 1.3) - SCWaveformView (~> 1.0) - - SignalServiceKit (from `https://github.com/WhisperSystems/SignalServiceKit.git`, branch `master`) + - SignalServiceKit (from `https://github.com/WhisperSystems/SignalServiceKit.git`, branch `feature/fixWebsocket2`) - SocketRocket (from `https://github.com/facebook/SocketRocket.git`) - ZXingObjC @@ -129,7 +129,7 @@ EXTERNAL SOURCES: AxolotlKit: :git: https://github.com/WhisperSystems/SignalProtocolKit.git SignalServiceKit: - :branch: master + :branch: feature/fixWebsocket2 :git: https://github.com/WhisperSystems/SignalServiceKit.git SocketRocket: :git: https://github.com/facebook/SocketRocket.git @@ -139,7 +139,7 @@ CHECKOUT OPTIONS: :commit: 714f5ebe199ecc999b33c6f97a4bb57e2db90e75 :git: https://github.com/WhisperSystems/SignalProtocolKit.git SignalServiceKit: - :commit: 7b7b338075f3b4615755fcc1f1fb8a8c67b0bd0a + :commit: b629ccada25319c346f6d4e4972c2199171f387d :git: https://github.com/WhisperSystems/SignalServiceKit.git SocketRocket: :commit: 41b57bb2fc292a814f758441a05243eb38457027 @@ -170,6 +170,6 @@ SPEC CHECKSUMS: YapDatabase: b1e43555a34a5298e23a045be96817a5ef0da58f ZXingObjC: bf15b3814f7a105b6d99f47da2333c93a063650a -PODFILE CHECKSUM: cb24c78080551874a45d1a20de4a1bef7427b41f +PODFILE CHECKSUM: 3d4c32ed0f6ca96f14d097b7075bd43400307722 COCOAPODS: 1.0.1 diff --git a/Signal/src/AppDelegate.m b/Signal/src/AppDelegate.m index 13a1aecb6..a50174637 100644 --- a/Signal/src/AppDelegate.m +++ b/Signal/src/AppDelegate.m @@ -1,3 +1,7 @@ +// +// Copyright (c) 2017 Open Whisper Systems. All rights reserved. +// + #import "AppDelegate.h" #import "AppStoreRating.h" #import "CategorizingLogger.h" @@ -256,10 +260,10 @@ static NSString *const kURLHostVerifyPrefix = @"verify"; dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ if ([TSAccountManager isRegistered]) { dispatch_sync(dispatch_get_main_queue(), ^{ - [self protectScreen]; - [[[Environment getCurrent] signalsViewController] updateInboxCountLabel]; + [self protectScreen]; + [[[Environment getCurrent] signalsViewController] updateInboxCountLabel]; + [TSSocketManager resignActivity]; }); - [TSSocketManager resignActivity]; } [application endBackgroundTask:bgTask]; From 9c4eda54f14e7377c9c605a4b5292eeaa68123ba Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Tue, 17 Jan 2017 16:31:28 -0500 Subject: [PATCH 2/4] Respond to CR. // FREEBIE --- Podfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Podfile.lock b/Podfile.lock index 9947afcfb..8cd69f49f 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -139,7 +139,7 @@ CHECKOUT OPTIONS: :commit: 714f5ebe199ecc999b33c6f97a4bb57e2db90e75 :git: https://github.com/WhisperSystems/SignalProtocolKit.git SignalServiceKit: - :commit: b629ccada25319c346f6d4e4972c2199171f387d + :commit: 26d181dfb23228cf445439b7b810041b6884fc68 :git: https://github.com/WhisperSystems/SignalServiceKit.git SocketRocket: :commit: 41b57bb2fc292a814f758441a05243eb38457027 From a023d02ae20da54f8cc0a66516a882408b8cab9f Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Tue, 17 Jan 2017 17:10:57 -0500 Subject: [PATCH 3/4] Respond to CR. // FREEBIE --- Podfile.lock | 2 +- Signal/src/AppDelegate.m | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Podfile.lock b/Podfile.lock index 8cd69f49f..264cd6db8 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -139,7 +139,7 @@ CHECKOUT OPTIONS: :commit: 714f5ebe199ecc999b33c6f97a4bb57e2db90e75 :git: https://github.com/WhisperSystems/SignalProtocolKit.git SignalServiceKit: - :commit: 26d181dfb23228cf445439b7b810041b6884fc68 + :commit: fd98158c838c75ea0612ba6d1a98d0720417e2b2 :git: https://github.com/WhisperSystems/SignalServiceKit.git SocketRocket: :commit: 41b57bb2fc292a814f758441a05243eb38457027 diff --git a/Signal/src/AppDelegate.m b/Signal/src/AppDelegate.m index a50174637..f37bd5e08 100644 --- a/Signal/src/AppDelegate.m +++ b/Signal/src/AppDelegate.m @@ -47,7 +47,13 @@ static NSString *const kURLHostVerifyPrefix = @"verify"; #pragma mark Detect updates - perform migrations +- (void)applicationDidEnterBackground:(UIApplication *)application { + DDLogWarn(@"%@ applicationDidEnterBackground.", self.tag); +} + - (void)applicationWillEnterForeground:(UIApplication *)application { + DDLogWarn(@"%@ applicationWillEnterForeground.", self.tag); + [[UIApplication sharedApplication] setApplicationIconBadgeNumber:0]; } @@ -231,6 +237,8 @@ static NSString *const kURLHostVerifyPrefix = @"verify"; } - (void)applicationDidBecomeActive:(UIApplication *)application { + DDLogWarn(@"%@ applicationDidBecomeActive.", self.tag); + if (getenv("runningTests_dontStartApp")) { return; } @@ -252,6 +260,8 @@ static NSString *const kURLHostVerifyPrefix = @"verify"; } - (void)applicationWillResignActive:(UIApplication *)application { + DDLogWarn(@"%@ applicationWillResignActive.", self.tag); + UIBackgroundTaskIdentifier __block bgTask = UIBackgroundTaskInvalid; bgTask = [application beginBackgroundTaskWithExpirationHandler:^{ @@ -331,6 +341,7 @@ static NSString *const kURLHostVerifyPrefix = @"verify"; - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo { [[PushManager sharedManager] application:application didReceiveRemoteNotification:userInfo]; } + - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler { From ec1601638605a6ecc4d90f10ab4a003478871c20 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Tue, 17 Jan 2017 17:51:19 -0500 Subject: [PATCH 4/4] Update to reflect merged SSK branch. --- Podfile | 3 +-- Podfile.lock | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Podfile b/Podfile index 2f59635e8..69ef648f8 100644 --- a/Podfile +++ b/Podfile @@ -4,8 +4,7 @@ source 'https://github.com/CocoaPods/Specs.git' target 'Signal' do pod 'SocketRocket', :git => 'https://github.com/facebook/SocketRocket.git' pod 'AxolotlKit', git: 'https://github.com/WhisperSystems/SignalProtocolKit.git' - #pod 'SignalServiceKit', git: 'https://github.com/WhisperSystems/SignalServiceKit.git', branch: 'master' - pod 'SignalServiceKit', git: 'https://github.com/WhisperSystems/SignalServiceKit.git', branch: 'feature/fixWebsocket2' + pod 'SignalServiceKit', git: 'https://github.com/WhisperSystems/SignalServiceKit.git', branch: 'master' #pod 'SignalServiceKit', path: '../SignalServiceKit' pod 'OpenSSL' pod 'PastelogKit', '~> 1.3' diff --git a/Podfile.lock b/Podfile.lock index 264cd6db8..ca54d11cd 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -121,7 +121,7 @@ DEPENDENCIES: - OpenSSL - PastelogKit (~> 1.3) - SCWaveformView (~> 1.0) - - SignalServiceKit (from `https://github.com/WhisperSystems/SignalServiceKit.git`, branch `feature/fixWebsocket2`) + - SignalServiceKit (from `https://github.com/WhisperSystems/SignalServiceKit.git`, branch `master`) - SocketRocket (from `https://github.com/facebook/SocketRocket.git`) - ZXingObjC @@ -129,7 +129,7 @@ EXTERNAL SOURCES: AxolotlKit: :git: https://github.com/WhisperSystems/SignalProtocolKit.git SignalServiceKit: - :branch: feature/fixWebsocket2 + :branch: master :git: https://github.com/WhisperSystems/SignalServiceKit.git SocketRocket: :git: https://github.com/facebook/SocketRocket.git @@ -139,7 +139,7 @@ CHECKOUT OPTIONS: :commit: 714f5ebe199ecc999b33c6f97a4bb57e2db90e75 :git: https://github.com/WhisperSystems/SignalProtocolKit.git SignalServiceKit: - :commit: fd98158c838c75ea0612ba6d1a98d0720417e2b2 + :commit: 45391cadd32df2fd8e3ee6b63d294d11bff45077 :git: https://github.com/WhisperSystems/SignalServiceKit.git SocketRocket: :commit: 41b57bb2fc292a814f758441a05243eb38457027 @@ -170,6 +170,6 @@ SPEC CHECKSUMS: YapDatabase: b1e43555a34a5298e23a045be96817a5ef0da58f ZXingObjC: bf15b3814f7a105b6d99f47da2333c93a063650a -PODFILE CHECKSUM: 3d4c32ed0f6ca96f14d097b7075bd43400307722 +PODFILE CHECKSUM: cb24c78080551874a45d1a20de4a1bef7427b41f COCOAPODS: 1.0.1