diff --git a/.travis.yml b/.travis.yml index f0502d3f91..708dbc93a9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,10 @@ +before_install: +- brew update +- brew unlink xctool +- brew install xctool + language: objective-c -xcode_sdk: iphonesimulator7.1 +xcode_sdk: iphonesimulator8.0 install: true xcode_workspace: Signal.xcworkspace xcode_scheme: Signal diff --git a/Libraries/spandsp/spandsp/spandsp.xcodeproj/xcshareddata/xcschemes/spandsp.xcscheme b/Libraries/spandsp/spandsp/spandsp.xcodeproj/xcshareddata/xcschemes/spandsp.xcscheme index 60911e91cb..8e596736e7 100644 --- a/Libraries/spandsp/spandsp/spandsp.xcodeproj/xcshareddata/xcschemes/spandsp.xcscheme +++ b/Libraries/spandsp/spandsp/spandsp.xcodeproj/xcshareddata/xcschemes/spandsp.xcscheme @@ -1,6 +1,6 @@ 'Podspecs/UICKeyChainStore.podspec pod 'OpenSSL', '~> 1.0.109' pod 'MMDrawerController', '~> 0.5.7' pod 'libPhoneNumber-iOS', '~> 0.7' -pod 'PastelogKit', '~> 1.1' +pod 'PastelogKit', '~> 1.2' pod 'AFNetworking', '~> 2.4.1' pod 'TwistedOakCollapsingFutures','~> 1.0' diff --git a/Podfile.lock b/Podfile.lock index 37189c8b20..e64e5201cb 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -39,7 +39,7 @@ PODS: - MMDrawerController/Subclass (0.5.7): - MMDrawerController/Core - OpenSSL (1.0.109) - - PastelogKit (1.1): + - PastelogKit (1.2): - CocoaLumberjack (~> 1.9) - TwistedOakCollapsingFutures (1.0.0): - UnionFind (~> 1.0) @@ -51,7 +51,7 @@ DEPENDENCIES: - libPhoneNumber-iOS (~> 0.7) - MMDrawerController (~> 0.5.7) - OpenSSL (~> 1.0.109) - - PastelogKit (~> 1.1) + - PastelogKit (~> 1.2) - TwistedOakCollapsingFutures (~> 1.0) - UICKeyChainStore (from `Podspecs/UICKeyChainStore.podspec`) @@ -65,9 +65,9 @@ SPEC CHECKSUMS: libPhoneNumber-iOS: 98fc07d70c8fdb5e6a8e3442c37e97353065c20e MMDrawerController: c3ab7a318ddc7e2bcd133139c3161af08c6e1197 OpenSSL: 4810adf5c99b0e2cd20670a11a987c805e8a521c - PastelogKit: 32836ec27e587a8876326abeaf9a1b5e2bc484ea + PastelogKit: 8bab71b1d187617a83e7124cffe9eb1a600e6695 TwistedOakCollapsingFutures: 07aab84fd3958dc94d55ef705b12857d9fbe61d1 UICKeyChainStore: eef407137f0397e95a3df32cdf05f7e2ddd99647 UnionFind: 45777a8b6878d3a602af3654cc3a09b87389d356 -COCOAPODS: 0.33.1 +COCOAPODS: 0.34.1 diff --git a/Pods b/Pods index 594aa6022c..585c9e6ca1 160000 --- a/Pods +++ b/Pods @@ -1 +1 @@ -Subproject commit 594aa6022c574bd1798041dd440af1aedc4d21b5 +Subproject commit 585c9e6ca1b55e99fb5c09aa31a6d590c2be5c58 diff --git a/Signal.xcodeproj/project.pbxproj b/Signal.xcodeproj/project.pbxproj index ccc796aa63..03c5106439 100644 --- a/Signal.xcodeproj/project.pbxproj +++ b/Signal.xcodeproj/project.pbxproj @@ -86,14 +86,6 @@ 76EB059318170B33006006FC /* UnrecognizedRequestFailure.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB042718170B33006006FC /* UnrecognizedRequestFailure.m */; }; 76EB059418170B33006006FC /* HttpManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB042A18170B33006006FC /* HttpManager.m */; }; 76EB059518170B33006006FC /* HttpManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB042A18170B33006006FC /* HttpManager.m */; }; - 76EB059618170B33006006FC /* HttpRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB042C18170B33006006FC /* HttpRequest.m */; }; - 76EB059718170B33006006FC /* HttpRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB042C18170B33006006FC /* HttpRequest.m */; }; - 76EB059818170B33006006FC /* HttpRequestOrResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB042E18170B33006006FC /* HttpRequestOrResponse.m */; }; - 76EB059918170B33006006FC /* HttpRequestOrResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB042E18170B33006006FC /* HttpRequestOrResponse.m */; }; - 76EB059A18170B33006006FC /* HttpRequestUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB043018170B33006006FC /* HttpRequestUtil.m */; }; - 76EB059B18170B33006006FC /* HttpRequestUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB043018170B33006006FC /* HttpRequestUtil.m */; }; - 76EB059C18170B33006006FC /* HttpResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB043218170B33006006FC /* HttpResponse.m */; }; - 76EB059D18170B33006006FC /* HttpResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB043218170B33006006FC /* HttpResponse.m */; }; 76EB059E18170B33006006FC /* HttpSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB043418170B33006006FC /* HttpSocket.m */; }; 76EB059F18170B33006006FC /* HttpSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB043418170B33006006FC /* HttpSocket.m */; }; 76EB05A018170B33006006FC /* IpAddress.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB043618170B33006006FC /* IpAddress.m */; }; @@ -355,6 +347,11 @@ A1C32D5117A06544000A904E /* AddressBook.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A1C32D4D17A0652C000A904E /* AddressBook.framework */; }; AA0C8E498E2046B0B81EEE6E /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8313AE91B4954215858A5662 /* libPods.a */; }; B60C16651988999D00E97A6C /* VersionMigrations.m in Sources */ = {isa = PBXBuildFile; fileRef = B60C16641988999D00E97A6C /* VersionMigrations.m */; }; + B63761E319E1F487005735D1 /* AFHTTPSessionManager+SignalMethods.m in Sources */ = {isa = PBXBuildFile; fileRef = B63761E219E1F487005735D1 /* AFHTTPSessionManager+SignalMethods.m */; }; + B63761EC19E1FBE8005735D1 /* HttpRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B63761E519E1FBE8005735D1 /* HttpRequest.m */; }; + B63761ED19E1FBE8005735D1 /* HttpRequestOrResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = B63761E719E1FBE8005735D1 /* HttpRequestOrResponse.m */; }; + B63761EE19E1FBE8005735D1 /* HttpRequestUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = B63761E919E1FBE8005735D1 /* HttpRequestUtil.m */; }; + B63761EF19E1FBE8005735D1 /* HttpResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = B63761EB19E1FBE8005735D1 /* HttpResponse.m */; }; B6416FAD199A0478003C5699 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = B6416F36199A0478003C5699 /* Localizable.strings */; }; B6416FAE199A0478003C5699 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = B6416F39199A0478003C5699 /* Localizable.strings */; }; B6416FAF199A0478003C5699 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = B6416F3C199A0478003C5699 /* Localizable.strings */; }; @@ -394,7 +391,9 @@ B6416FD1199A0478003C5699 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = B6416FA2199A0478003C5699 /* Localizable.strings */; }; B6416FD2199A0478003C5699 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = B6416FA5199A0478003C5699 /* Localizable.strings */; }; B6416FD4199A0478003C5699 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = B6416FAB199A0478003C5699 /* Localizable.strings */; }; - B67ADDC41989FF8700E1A773 /* CallServerRequestsManager.m in Sources */ = {isa = PBXBuildFile; fileRef = B67ADDC31989FF8700E1A773 /* CallServerRequestsManager.m */; }; + B65EDA1219E1BE6400AAA7CB /* RPAPICall.m in Sources */ = {isa = PBXBuildFile; fileRef = B65EDA1119E1BE6400AAA7CB /* RPAPICall.m */; }; + B66DBF4A19D5BBC8006EA940 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B66DBF4919D5BBC8006EA940 /* Images.xcassets */; }; + B67ADDC41989FF8700E1A773 /* RPServerRequestsManager.m in Sources */ = {isa = PBXBuildFile; fileRef = B67ADDC31989FF8700E1A773 /* RPServerRequestsManager.m */; }; B67EBF5D19194AC60084CCFD /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = B67EBF5C19194AC60084CCFD /* Settings.bundle */; }; B684A46D19C3446200B11029 /* PushManagerTest.m in Sources */ = {isa = PBXBuildFile; fileRef = B684A46C19C3446200B11029 /* PushManagerTest.m */; }; B6850E5A1995A4710068E715 /* whisperFake.cer in Resources */ = {isa = PBXBuildFile; fileRef = B6850E591995A4710068E715 /* whisperFake.cer */; }; @@ -655,6 +654,7 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 14DDBCE302E19644A773D119 /* Pods.app store release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods.app store release.xcconfig"; path = "Pods/Target Support Files/Pods/Pods.app store release.xcconfig"; sourceTree = ""; }; 701231B318ECAA4500D456C4 /* EvpMessageDigest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EvpMessageDigest.h; sourceTree = ""; }; 701231B418ECAA4500D456C4 /* EvpMessageDigest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EvpMessageDigest.m; sourceTree = ""; }; 70377AA71916BA0500CAF501 /* InteractiveLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InteractiveLabel.h; sourceTree = ""; }; @@ -767,14 +767,6 @@ 76EB042718170B33006006FC /* UnrecognizedRequestFailure.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UnrecognizedRequestFailure.m; sourceTree = ""; }; 76EB042918170B33006006FC /* HttpManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpManager.h; sourceTree = ""; }; 76EB042A18170B33006006FC /* HttpManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HttpManager.m; sourceTree = ""; }; - 76EB042B18170B33006006FC /* HttpRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpRequest.h; sourceTree = ""; }; - 76EB042C18170B33006006FC /* HttpRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HttpRequest.m; sourceTree = ""; }; - 76EB042D18170B33006006FC /* HttpRequestOrResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpRequestOrResponse.h; sourceTree = ""; }; - 76EB042E18170B33006006FC /* HttpRequestOrResponse.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HttpRequestOrResponse.m; sourceTree = ""; }; - 76EB042F18170B33006006FC /* HttpRequestUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpRequestUtil.h; sourceTree = ""; }; - 76EB043018170B33006006FC /* HttpRequestUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HttpRequestUtil.m; sourceTree = ""; }; - 76EB043118170B33006006FC /* HttpResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpResponse.h; sourceTree = ""; }; - 76EB043218170B33006006FC /* HttpResponse.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HttpResponse.m; sourceTree = ""; }; 76EB043318170B33006006FC /* HttpSocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpSocket.h; sourceTree = ""; }; 76EB043418170B33006006FC /* HttpSocket.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HttpSocket.m; sourceTree = ""; }; 76EB043518170B33006006FC /* IpAddress.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IpAddress.h; sourceTree = ""; }; @@ -1000,6 +992,8 @@ 76EB053C18170B33006006FC /* InboxFeedTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = InboxFeedTableViewCell.xib; sourceTree = ""; }; 76EB053F18170B33006006FC /* CallLogTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CallLogTableViewCell.xib; sourceTree = ""; }; 8313AE91B4954215858A5662 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 91E46203423941C0C94D90E9 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; + 9CC6C6BD3B51923FD6317C94 /* Pods.ad-hoc distribution.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods.ad-hoc distribution.xcconfig"; path = "Pods/Target Support Files/Pods/Pods.ad-hoc distribution.xcconfig"; sourceTree = ""; }; A11CD70C17FA230600A2D1B1 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; A15706F417F0CD6D007C2BD6 /* AudioFrameTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AudioFrameTest.m; sourceTree = ""; }; A15706F617F0CD6D007C2BD6 /* AudioRemoteIOTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AudioRemoteIOTest.m; sourceTree = ""; }; @@ -1056,6 +1050,16 @@ A1FDCBEE16DAA6C300868894 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; B60C16631988999D00E97A6C /* VersionMigrations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VersionMigrations.h; sourceTree = ""; }; B60C16641988999D00E97A6C /* VersionMigrations.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VersionMigrations.m; sourceTree = ""; }; + B63761E119E1F487005735D1 /* AFHTTPSessionManager+SignalMethods.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "AFHTTPSessionManager+SignalMethods.h"; sourceTree = ""; }; + B63761E219E1F487005735D1 /* AFHTTPSessionManager+SignalMethods.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "AFHTTPSessionManager+SignalMethods.m"; sourceTree = ""; }; + B63761E419E1FBE8005735D1 /* HttpRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpRequest.h; sourceTree = ""; }; + B63761E519E1FBE8005735D1 /* HttpRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HttpRequest.m; sourceTree = ""; }; + B63761E619E1FBE8005735D1 /* HttpRequestOrResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpRequestOrResponse.h; sourceTree = ""; }; + B63761E719E1FBE8005735D1 /* HttpRequestOrResponse.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HttpRequestOrResponse.m; sourceTree = ""; }; + B63761E819E1FBE8005735D1 /* HttpRequestUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpRequestUtil.h; sourceTree = ""; }; + B63761E919E1FBE8005735D1 /* HttpRequestUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HttpRequestUtil.m; sourceTree = ""; }; + B63761EA19E1FBE8005735D1 /* HttpResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpResponse.h; sourceTree = ""; }; + B63761EB19E1FBE8005735D1 /* HttpResponse.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HttpResponse.m; sourceTree = ""; }; B6416F37199A0478003C5699 /* an */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = an; path = Localizable.strings; sourceTree = ""; }; B6416F3A199A0478003C5699 /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = Localizable.strings; sourceTree = ""; }; B6416F3D199A0478003C5699 /* be */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = be; path = Localizable.strings; sourceTree = ""; }; @@ -1096,9 +1100,12 @@ B6416FA6199A0478003C5699 /* zh_CN */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = zh_CN; path = Localizable.strings; sourceTree = ""; }; B6416FAC199A0478003C5699 /* zh_TW */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = zh_TW; path = Localizable.strings; sourceTree = ""; }; B657DDC91911A40500F45B0C /* Signal.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = Signal.entitlements; sourceTree = ""; }; + B65EDA1019E1BE6400AAA7CB /* RPAPICall.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RPAPICall.h; sourceTree = ""; }; + B65EDA1119E1BE6400AAA7CB /* RPAPICall.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RPAPICall.m; sourceTree = ""; }; B661C211198EE2EA00548CA1 /* iOSVersions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = iOSVersions.h; path = src/environment/iOSVersions.h; sourceTree = ""; }; - B67ADDC21989FF8700E1A773 /* CallServerRequestsManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallServerRequestsManager.h; sourceTree = ""; }; - B67ADDC31989FF8700E1A773 /* CallServerRequestsManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CallServerRequestsManager.m; sourceTree = ""; }; + B66DBF4919D5BBC8006EA940 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + B67ADDC21989FF8700E1A773 /* RPServerRequestsManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RPServerRequestsManager.h; sourceTree = ""; }; + B67ADDC31989FF8700E1A773 /* RPServerRequestsManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RPServerRequestsManager.m; sourceTree = ""; }; B67EBF5C19194AC60084CCFD /* Settings.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = Settings.bundle; path = SettingsBundle/Settings.bundle; sourceTree = SOURCE_ROOT; }; B684A46C19C3446200B11029 /* PushManagerTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PushManagerTest.m; path = Signal/test/push/PushManagerTest.m; sourceTree = SOURCE_ROOT; }; B6850E591995A4710068E715 /* whisperFake.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = whisperFake.cer; sourceTree = ""; }; @@ -1142,7 +1149,6 @@ BFB074C419A5611000F2947C /* FutureUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FutureUtil.m; sourceTree = ""; }; BFB074C519A5611000F2947C /* ObservableValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObservableValue.h; sourceTree = ""; }; BFB074C619A5611000F2947C /* ObservableValue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ObservableValue.m; sourceTree = ""; }; - C71793B33D9C45079F74487E /* Pods.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.xcconfig; path = Pods/Pods.xcconfig; sourceTree = ""; }; D2179CFB16BB0B3A0006F3AB /* CoreTelephony.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreTelephony.framework; path = System/Library/Frameworks/CoreTelephony.framework; sourceTree = SDKROOT; }; D2179CFD16BB0B480006F3AB /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; D221A089169C9E5E00537ABF /* Signal.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Signal.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -1156,7 +1162,6 @@ D221A0E7169DFFC500537ABF /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = ../../../../../../System/Library/Frameworks/AVFoundation.framework; sourceTree = ""; }; D24B5BD4169F568C00681372 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = ../../../../../../System/Library/Frameworks/AudioToolbox.framework; sourceTree = ""; }; D2AEACDB16C426DA00C364C0 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; }; - E108ED12187E34FD0045AEA3 /* iTunesArtwork.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = iTunesArtwork.png; sourceTree = ""; }; E108ED13187E34FD0045AEA3 /* iTunesArtwork@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "iTunesArtwork@2x.png"; sourceTree = ""; }; E1370B3018A0660300826894 /* archive_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = archive_icon.png; sourceTree = ""; }; E1370B3118A0660300826894 /* archive_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "archive_icon@2x.png"; sourceTree = ""; }; @@ -1373,6 +1378,16 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 420DEC7C09ED549B971FBF67 /* Pods */ = { + isa = PBXGroup; + children = ( + 91E46203423941C0C94D90E9 /* Pods.debug.xcconfig */, + 9CC6C6BD3B51923FD6317C94 /* Pods.ad-hoc distribution.xcconfig */, + 14DDBCE302E19644A773D119 /* Pods.app store release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; 70B8009F190C529C0042E3F0 /* Products */ = { isa = PBXGroup; children = ( @@ -1707,18 +1722,21 @@ 76EB042818170B33006006FC /* http */ = { isa = PBXGroup; children = ( - B67ADDC21989FF8700E1A773 /* CallServerRequestsManager.h */, - B67ADDC31989FF8700E1A773 /* CallServerRequestsManager.m */, + B65EDA0F19E1BE2200AAA7CB /* Requests */, + B67ADDC21989FF8700E1A773 /* RPServerRequestsManager.h */, + B67ADDC31989FF8700E1A773 /* RPServerRequestsManager.m */, + B63761E119E1F487005735D1 /* AFHTTPSessionManager+SignalMethods.h */, + B63761E219E1F487005735D1 /* AFHTTPSessionManager+SignalMethods.m */, + B63761E419E1FBE8005735D1 /* HttpRequest.h */, + B63761E519E1FBE8005735D1 /* HttpRequest.m */, + B63761E619E1FBE8005735D1 /* HttpRequestOrResponse.h */, + B63761E719E1FBE8005735D1 /* HttpRequestOrResponse.m */, + B63761E819E1FBE8005735D1 /* HttpRequestUtil.h */, + B63761E919E1FBE8005735D1 /* HttpRequestUtil.m */, + B63761EA19E1FBE8005735D1 /* HttpResponse.h */, + B63761EB19E1FBE8005735D1 /* HttpResponse.m */, 76EB042918170B33006006FC /* HttpManager.h */, 76EB042A18170B33006006FC /* HttpManager.m */, - 76EB042B18170B33006006FC /* HttpRequest.h */, - 76EB042C18170B33006006FC /* HttpRequest.m */, - 76EB042D18170B33006006FC /* HttpRequestOrResponse.h */, - 76EB042E18170B33006006FC /* HttpRequestOrResponse.m */, - 76EB042F18170B33006006FC /* HttpRequestUtil.h */, - 76EB043018170B33006006FC /* HttpRequestUtil.m */, - 76EB043118170B33006006FC /* HttpResponse.h */, - 76EB043218170B33006006FC /* HttpResponse.m */, 76EB043318170B33006006FC /* HttpSocket.h */, 76EB043418170B33006006FC /* HttpSocket.m */, ); @@ -2731,6 +2749,15 @@ path = translations/zh_TW.lproj; sourceTree = ""; }; + B65EDA0F19E1BE2200AAA7CB /* Requests */ = { + isa = PBXGroup; + children = ( + B65EDA1019E1BE6400AAA7CB /* RPAPICall.h */, + B65EDA1119E1BE6400AAA7CB /* RPAPICall.m */, + ); + name = Requests; + sourceTree = ""; + }; B6B6C3C419193F5B00C0B76B /* Translations */ = { isa = PBXGroup; children = ( @@ -2789,12 +2816,12 @@ isa = PBXGroup; children = ( D221A093169C9E5E00537ABF /* Signal */, - C71793B33D9C45079F74487E /* Pods.xcconfig */, 70B800C8190C55320042E3F0 /* Libraries */, D221A08C169C9E5E00537ABF /* Frameworks */, D221A08A169C9E5E00537ABF /* Products */, 70B8009E190C529C0042E3F0 /* spandsp.xcodeproj */, 70B800A7190C54790042E3F0 /* speex.xcodeproj */, + 420DEC7C09ED549B971FBF67 /* Pods */, ); sourceTree = ""; }; @@ -2844,6 +2871,7 @@ 76EB03C118170B33006006FC /* src */, D221A094169C9E5E00537ABF /* Supporting Files */, A15706EA17F0CD6D007C2BD6 /* test */, + B66DBF4919D5BBC8006EA940 /* Images.xcassets */, ); path = Signal; sourceTree = ""; @@ -2857,7 +2885,6 @@ E1370BDB18A066F600826894 /* Default.png */, E1370BDC18A066F600826894 /* Default@2x.png */, E18AB3F318A05734001A532A /* Icons */, - E108ED12187E34FD0045AEA3 /* iTunesArtwork.png */, E108ED13187E34FD0045AEA3 /* iTunesArtwork@2x.png */, D221A099169C9E5E00537ABF /* main.m */, D221A095169C9E5E00537ABF /* Signal-Info.plist */, @@ -3019,6 +3046,7 @@ ORGANIZATIONNAME = "Open Whisper Systems"; TargetAttributes = { D221A088169C9E5E00537ABF = { + DevelopmentTeam = U68MSDN6DR; SystemCapabilities = { com.apple.DataProtection = { enabled = 1; @@ -3253,6 +3281,7 @@ E14874E118A06930002CC4F3 /* spinner_error.png in Resources */, B6416FBF199A0478003C5699 /* Localizable.strings in Resources */, B6416FB7199A0478003C5699 /* Localizable.strings in Resources */, + B66DBF4A19D5BBC8006EA940 /* Images.xcassets in Resources */, E14874E218A06930002CC4F3 /* spinner_error@2x.png in Resources */, E14874E318A06930002CC4F3 /* spinner_ringing.png in Resources */, E14874E418A06930002CC4F3 /* spinner_ringing@2x.png in Resources */, @@ -3378,7 +3407,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Pods-resources.sh\"\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n"; showEnvVarsInLog = 0; }; D221A0A8169C9E5F00537ABF /* ShellScript */ = { @@ -3406,7 +3435,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Pods-resources.sh\"\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n"; showEnvVarsInLog = 0; }; EE182B0CAFB74DD9A2D39FD3 /* Check Pods Manifest.lock */ = { @@ -3440,7 +3469,6 @@ 76EB060218170B33006006FC /* InitiatorSessionDescriptor.m in Sources */, 76EB05FC18170B33006006FC /* CallConnectUtil_Server.m in Sources */, 76EB062418170B33006006FC /* PriorityQueue.m in Sources */, - 76EB059818170B33006006FC /* HttpRequestOrResponse.m in Sources */, 76EB061A18170B33006006FC /* DiscardingLog.m in Sources */, 76EB068418170B34006006FC /* ContactDetailTableViewCell.m in Sources */, 76EB066218170B34006006FC /* SettingsViewController.m in Sources */, @@ -3454,7 +3482,7 @@ 70B80119190C55660042E3F0 /* TextFormat.m in Sources */, E197B61818BBEC1A00F073E5 /* RemoteIOAudio.m in Sources */, 70B8011C190C55660042E3F0 /* Utilities.m in Sources */, - B67ADDC41989FF8700E1A773 /* CallServerRequestsManager.m in Sources */, + B67ADDC41989FF8700E1A773 /* RPServerRequestsManager.m in Sources */, 76EB059418170B33006006FC /* HttpManager.m in Sources */, 76EB05EC18170B33006006FC /* CallState.m in Sources */, 76EB05D218170B33006006FC /* ZrtpInitiator.m in Sources */, @@ -3517,6 +3545,7 @@ 7038632818F70C0700D4A43F /* EvpSymetricUtil.m in Sources */, 76EB066418170B34006006FC /* TabBarParentViewController.m in Sources */, 76EB068618170B34006006FC /* ContactTableViewCell.m in Sources */, + B63761ED19E1FBE8005735D1 /* HttpRequestOrResponse.m in Sources */, 76EB05A018170B33006006FC /* IpAddress.m in Sources */, 70B8011B190C55660042E3F0 /* UnknownFieldSet_Builder.m in Sources */, B9A578B1183D60EE00C17105 /* FavouriteTableViewCell.m in Sources */, @@ -3532,7 +3561,6 @@ E197B61018BBEC1A00F073E5 /* EncodedAudioPacket.m in Sources */, 76C87F13181EE11C00C4ACAB /* InboxFeedFooterCell.m in Sources */, 76EB063618170B33006006FC /* DataUtil.m in Sources */, - 76EB059C18170B33006006FC /* HttpResponse.m in Sources */, E197B60C18BBEC1A00F073E5 /* AudioPacker.m in Sources */, E197B61218BBEC1A00F073E5 /* AudioStretcher.m in Sources */, 76EB05A218170B33006006FC /* IpEndPoint.m in Sources */, @@ -3566,11 +3594,11 @@ E16E5BF018AAC40200B7C403 /* EvpKeyAgreement.m in Sources */, 70B80113190C55660042E3F0 /* ExtensionRegistry.m in Sources */, B9EB5AC61884D370007CBB57 /* UnseenWhisperUserCell.m in Sources */, + B65EDA1219E1BE6400AAA7CB /* RPAPICall.m in Sources */, 76EB05DC18170B33006006FC /* StreamPair.m in Sources */, 70377AA91916BA0500CAF501 /* InteractiveLabel.m in Sources */, 76EB064618170B33006006FC /* TimeUtil.m in Sources */, 70BAFD5D190584BE00FA5E0B /* NotificationTracker.m in Sources */, - 76EB059618170B33006006FC /* HttpRequest.m in Sources */, 76EB05A418170B33006006FC /* PacketHandler.m in Sources */, E197B62118BBF12700F073E5 /* AppAudioManager.m in Sources */, 76EB068C18170B34006006FC /* InboxFeedTableViewCell.m in Sources */, @@ -3579,6 +3607,7 @@ B9B89C54185A2B5F00A24465 /* LeftSideMenuCell.m in Sources */, 76EB068E18170B34006006FC /* CallLogTableViewCell.m in Sources */, 76EB05CE18170B33006006FC /* ZrtpHandshakeResult.m in Sources */, + B63761EE19E1FBE8005735D1 /* HttpRequestUtil.m in Sources */, 76EB05B618170B33006006FC /* MasterSecret.m in Sources */, 76EB05F418170B33006006FC /* CallConnectResult.m in Sources */, 76EB059E18170B33006006FC /* HttpSocket.m in Sources */, @@ -3586,10 +3615,10 @@ 76EB065418170B34006006FC /* InboxFeedViewController.m in Sources */, 76EB054018170B33006006FC /* AppDelegate.m in Sources */, 76EB05D018170B33006006FC /* ZrtpHandshakeSocket.m in Sources */, + B63761EF19E1FBE8005735D1 /* HttpResponse.m in Sources */, E197B61518BBEC1A00F073E5 /* JitterQueue.m in Sources */, BFB074C919A5611000F2947C /* ObservableValue.m in Sources */, 76EB05C818170B33006006FC /* HelloPacket.m in Sources */, - 76EB059A18170B33006006FC /* HttpRequestUtil.m in Sources */, BFB074C719A5611000F2947C /* FutureUtil.m in Sources */, 76EB057218170B33006006FC /* RecentCall.m in Sources */, 76EB060418170B33006006FC /* PhoneNumberDirectoryFilter.m in Sources */, @@ -3598,6 +3627,7 @@ 76EB059218170B33006006FC /* UnrecognizedRequestFailure.m in Sources */, 76EB05F818170B33006006FC /* CallConnectUtil_Initiator.m in Sources */, B97CBFAE1886100E008E0DE9 /* CountryCodeTableViewCell.m in Sources */, + B63761E319E1F487005735D1 /* AFHTTPSessionManager+SignalMethods.m in Sources */, 76EB05CC18170B33006006FC /* ShortAuthenticationStringGenerator.m in Sources */, E16E5BEF18AAC40200B7C403 /* EC25KeyAgreementProtocol.m in Sources */, 76EB064018170B33006006FC /* AnonymousTerminator.m in Sources */, @@ -3606,6 +3636,7 @@ 76EB05B218170B33006006FC /* DH3KKeyAgreementProtocol.m in Sources */, 76EB066018170B34006006FC /* RegisterViewController.m in Sources */, 76EB060618170B33006006FC /* PhoneNumberDirectoryFilterManager.m in Sources */, + B63761EC19E1FBE8005735D1 /* HttpRequest.m in Sources */, 76EB060818170B33006006FC /* ResponderSessionDescriptor.m in Sources */, B90418E6183E9DD40038554A /* DateUtil.m in Sources */, 76EB05C618170B33006006FC /* HelloAckPacket.m in Sources */, @@ -3642,7 +3673,6 @@ B9EB5AC71884D370007CBB57 /* UnseenWhisperUserCell.m in Sources */, 76EB05FB18170B33006006FC /* CallConnectUtil_Responder.m in Sources */, 76EB063718170B33006006FC /* DataUtil.m in Sources */, - 76EB059718170B33006006FC /* HttpRequest.m in Sources */, 76EB05C918170B33006006FC /* HelloPacket.m in Sources */, B90418E7183E9DD40038554A /* DateUtil.m in Sources */, 76EB05CB18170B33006006FC /* RecipientUnavailable.m in Sources */, @@ -3678,7 +3708,6 @@ 76EB05B918170B33006006FC /* NegotiationFailed.m in Sources */, A157075A17F0CD6D007C2BD6 /* JitterQueueTest.m in Sources */, 76EB060318170B33006006FC /* InitiatorSessionDescriptor.m in Sources */, - 76EB059D18170B33006006FC /* HttpResponse.m in Sources */, A157075B17F0CD6D007C2BD6 /* SpeexCodecTest.m in Sources */, A157075D17F0CD6D007C2BD6 /* DnsManagerTest.m in Sources */, 76EB068518170B34006006FC /* ContactDetailTableViewCell.m in Sources */, @@ -3706,7 +3735,6 @@ 76EB063118170B33006006FC /* Conversions.m in Sources */, 76EB05F918170B33006006FC /* CallConnectUtil_Initiator.m in Sources */, A157076717F0CD6D007C2BD6 /* MasterSecretTest.m in Sources */, - 76EB059B18170B33006006FC /* HttpRequestUtil.m in Sources */, 76EB05CF18170B33006006FC /* ZrtpHandshakeResult.m in Sources */, 76EB060518170B33006006FC /* PhoneNumberDirectoryFilter.m in Sources */, 76EB065D18170B34006006FC /* CallLogViewController.m in Sources */, @@ -3733,7 +3761,6 @@ 76EB05C318170B33006006FC /* DhPacketSharedSecretHashes.m in Sources */, BF8C3D8319CE3B6A008F644C /* RecentCallTest.m in Sources */, 76EB05C718170B33006006FC /* HelloAckPacket.m in Sources */, - 76EB059918170B33006006FC /* HttpRequestOrResponse.m in Sources */, A157076F17F0CD6D007C2BD6 /* PhoneNumberTest.m in Sources */, 76EB05B518170B33006006FC /* HashChain.m in Sources */, 76C87F14181EE11C00C4ACAB /* InboxFeedFooterCell.m in Sources */, @@ -4211,15 +4238,17 @@ }; B6B9EB4E196190F5009024F0 /* Ad-Hoc Distribution */ = { isa = XCBuildConfiguration; - baseConfigurationReference = C71793B33D9C45079F74487E /* Pods.xcconfig */; + baseConfigurationReference = 9CC6C6BD3B51923FD6317C94 /* Pods.ad-hoc distribution.xcconfig */; buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; CODE_SIGN_IDENTITY = "iPhone Developer"; CURRENT_PROJECT_VERSION = 1; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)\"", ); - GCC_OPTIMIZATION_LEVEL = 0; + GCC_OPTIMIZATION_LEVEL = 3; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "Signal/Signal-Prefix.pch"; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -4252,6 +4281,7 @@ LLVM_LTO = NO; OTHER_LDFLAGS = "$(inherited)"; PRODUCT_NAME = Signal; + PROVISIONING_PROFILE = "901bceda-ae06-4214-89c0-2aeeea7190cc"; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = 1; TEST_AFTER_BUILD = YES; @@ -4262,7 +4292,7 @@ }; B6B9EB4F196190F5009024F0 /* Ad-Hoc Distribution */ = { isa = XCBuildConfiguration; - baseConfigurationReference = C71793B33D9C45079F74487E /* Pods.xcconfig */; + baseConfigurationReference = 9CC6C6BD3B51923FD6317C94 /* Pods.ad-hoc distribution.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Signal.app/Signal"; FRAMEWORK_SEARCH_PATHS = ( @@ -4440,8 +4470,10 @@ }; D221A0BD169C9E5F00537ABF /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = C71793B33D9C45079F74487E /* Pods.xcconfig */; + baseConfigurationReference = 91E46203423941C0C94D90E9 /* Pods.debug.xcconfig */; buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; CODE_SIGN_IDENTITY = "iPhone Developer"; CURRENT_PROJECT_VERSION = 1; FRAMEWORK_SEARCH_PATHS = ( @@ -4480,6 +4512,7 @@ LLVM_LTO = NO; OTHER_LDFLAGS = "$(inherited)"; PRODUCT_NAME = Signal; + PROVISIONING_PROFILE = "f9cba3ff-5957-491b-acd0-c669df5988d9"; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = 1; TEST_AFTER_BUILD = YES; @@ -4490,18 +4523,21 @@ }; D221A0BE169C9E5F00537ABF /* App Store Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = C71793B33D9C45079F74487E /* Pods.xcconfig */; + baseConfigurationReference = 14DDBCE302E19644A773D119 /* Pods.app store release.xcconfig */; buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; CODE_SIGN_IDENTITY = "iPhone Developer"; CURRENT_PROJECT_VERSION = 1; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)\"", ); - GCC_OPTIMIZATION_LEVEL = 0; + GCC_OPTIMIZATION_LEVEL = 3; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "Signal/Signal-Prefix.pch"; GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", HAVE_CONFIG_H, "RELEASE=1", ); @@ -4529,6 +4565,7 @@ LLVM_LTO = NO; OTHER_LDFLAGS = "$(inherited)"; PRODUCT_NAME = Signal; + PROVISIONING_PROFILE = "e732b249-8e64-430a-aca8-e0fccc388be5"; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = 1; TEST_AFTER_BUILD = YES; @@ -4539,7 +4576,7 @@ }; D221A0C0169C9E5F00537ABF /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = C71793B33D9C45079F74487E /* Pods.xcconfig */; + baseConfigurationReference = 91E46203423941C0C94D90E9 /* Pods.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Signal.app/Signal"; FRAMEWORK_SEARCH_PATHS = ( @@ -4586,7 +4623,7 @@ }; D221A0C1169C9E5F00537ABF /* App Store Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = C71793B33D9C45079F74487E /* Pods.xcconfig */; + baseConfigurationReference = 14DDBCE302E19644A773D119 /* Pods.app store release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Signal.app/Signal"; FRAMEWORK_SEARCH_PATHS = ( diff --git a/Signal.xcodeproj/xcshareddata/xcschemes/Signal.xcscheme b/Signal.xcodeproj/xcshareddata/xcschemes/Signal.xcscheme index def698dc13..002632c70f 100644 --- a/Signal.xcodeproj/xcshareddata/xcschemes/Signal.xcscheme +++ b/Signal.xcodeproj/xcshareddata/xcschemes/Signal.xcscheme @@ -1,6 +1,6 @@ CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIcons - - CFBundlePrimaryIcon - - CFBundleIconFiles - - AppIcon29x29 - AppIcon40x40 - AppIcon60x60 - - - + + CFBundleIcons~ipad + CFBundleIdentifier org.whispersystems.signal CFBundleInfoDictionaryVersion @@ -29,11 +21,15 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.0.5 + 1.0.6 CFBundleSignature ???? CFBundleVersion - 1.0.5 + 1.0.6.2 + LOGS_EMAIL + support@whispersystems.org + LOGS_URL + https://github.com/WhisperSystems/Signal-iOS/issues LSApplicationCategoryType public.app-category.social-networking LSRequiresIPhoneOS diff --git a/Signal/Signal-Prefix.pch b/Signal/Signal-Prefix.pch index c61d02035f..89f65c4607 100644 --- a/Signal/Signal-Prefix.pch +++ b/Signal/Signal-Prefix.pch @@ -16,4 +16,8 @@ #endif #import "iOSVersions.h" + + #define SignalAlertView(title,msg) [[[UIAlertView alloc] initWithTitle:title message:msg delegate:nil cancelButtonTitle:NSLocalizedString(@"OK", @"") otherButtonTitles:nil, nil] show] + #define SignalReportError [Pastelog reportErrorAndSubmitLogsWithAlertTitle:NSLocalizedString(@"ERROR_WAS_DETECTED_TITLE", @"") alertBody:NSLocalizedString(@"ERROR_WAS_DETECTED_SUBMIT", @"")]; + #endif diff --git a/Signal/iTunesArtwork.png b/Signal/iTunesArtwork.png deleted file mode 100644 index ef9bee54d1..0000000000 Binary files a/Signal/iTunesArtwork.png and /dev/null differ diff --git a/Signal/iTunesArtwork@2x.png b/Signal/iTunesArtwork@2x.png index ff98abeb9c..a5490a0537 100644 Binary files a/Signal/iTunesArtwork@2x.png and b/Signal/iTunesArtwork@2x.png differ diff --git a/Signal/src/AppDelegate.m b/Signal/src/AppDelegate.m index 37955a5fe1..6140a0b49c 100644 --- a/Signal/src/AppDelegate.m +++ b/Signal/src/AppDelegate.m @@ -20,6 +20,17 @@ #import "Util.h" #import "VersionMigrations.h" + + + + + +#import + + + + + #define kSignalVersionKey @"SignalUpdateVersionKey" #ifdef __APPLE__ @@ -49,6 +60,7 @@ DDLogError(@"No previous version found. Possibly first launch since install."); [Environment resetAppData]; // We clean previous keychain entries in case their are some entries remaining. } else if ([currentVersion compare:previousVersion options:NSNumericSearch] == NSOrderedDescending){ + [Environment resetAppData]; // Application was updated, let's see if we have a migration scheme for it. if ([previousVersion isEqualToString:@"1.0.2"]) { // Migrate from custom preferences to NSUserDefaults @@ -69,22 +81,22 @@ NSError *error; NSDictionary *attrs = @{NSFileProtectionKey: NSFileProtectionCompleteUntilFirstUserAuthentication}; - [[NSFileManager defaultManager] setAttributes:attrs ofItemAtPath:preferencesPath error:&error]; + [NSFileManager.defaultManager setAttributes:attrs ofItemAtPath:preferencesPath error:&error]; [pathsToExclude addObject:[[preferencesPath stringByAppendingString:NSBundle.mainBundle.bundleIdentifier] stringByAppendingString:@".plist"]]; NSString *logPath = [NSHomeDirectory() stringByAppendingString:@"/Library/Caches/Logs/"]; - NSArray *logsFiles = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:logPath error:&error]; + NSArray *logsFiles = [NSFileManager.defaultManager contentsOfDirectoryAtPath:logPath error:&error]; attrs = @{NSFileProtectionKey: NSFileProtectionCompleteUntilFirstUserAuthentication}; - [[NSFileManager defaultManager] setAttributes:attrs ofItemAtPath:logPath error:&error]; + [NSFileManager.defaultManager setAttributes:attrs ofItemAtPath:logPath error:&error]; - for (NSUInteger i = 0; i < logsFiles.count; i++) { - [pathsToExclude addObject:[logPath stringByAppendingString:logsFiles[i]]]; + for (NSString *logsFile in logsFiles) { + [pathsToExclude addObject:[logPath stringByAppendingString:logsFile]]; } - for (NSUInteger i = 0; i < pathsToExclude.count; i++) { - [[NSURL fileURLWithPath:pathsToExclude[i]] setResourceValue:@YES + for (NSString *pathToExclude in pathsToExclude) { + [[NSURL fileURLWithPath:pathToExclude] setResourceValue:@YES forKey:NSURLIsExcludedFromBackupKey error:&error]; } @@ -175,15 +187,15 @@ } - (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken { - [[PushManager sharedManager].pushNotificationFutureSource trySetResult:deviceToken]; + [PushManager.sharedManager.pushNotificationFutureSource trySetResult:deviceToken]; } - (void)application:(UIApplication*)application didFailToRegisterForRemoteNotificationsWithError:(NSError*)error { - [[PushManager sharedManager].pushNotificationFutureSource trySetFailure:error]; + [PushManager.sharedManager.pushNotificationFutureSource trySetFailure:error]; } - (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings{ - [[PushManager sharedManager].userNotificationFutureSource trySetResult:notificationSettings]; + [PushManager.sharedManager.userNotificationFutureSource trySetResult:notificationSettings]; } -(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo { diff --git a/Signal/src/NotificationManifest.h b/Signal/src/NotificationManifest.h index 4432014b8a..3e5885e424 100644 --- a/Signal/src/NotificationManifest.h +++ b/Signal/src/NotificationManifest.h @@ -7,6 +7,7 @@ #define NOTIFICATION_DIRECTORY_UPDATE @"NOTIFICATION_DIRECTORY_UPDATE" #define NOTIFICATION_DIRECTORY_WAS_UPDATED @"NOTIFICATION_DIRECTORY_WAS_UPDATED" +#define NOTIFICATION_DIRECTORY_FAILED @"NOTIFICATION_DIRECTORY_FAILED" #define NOTIFICATION_NEW_USERS_AVAILABLE @"NOTIFICATION_NEW_USERS_AVAILABLE" diff --git a/Signal/src/environment/LocalizableText.h b/Signal/src/environment/LocalizableText.h index db7019f6e7..481778d2a7 100644 --- a/Signal/src/environment/LocalizableText.h +++ b/Signal/src/environment/LocalizableText.h @@ -105,13 +105,6 @@ #define SETTINGS_SENDLOG_WAITING NSLocalizedString(@"SETTINGS_SENDLOGS_WAITING", @"") #define SETTINGS_SENDLOG_ALERT_TITLE NSLocalizedString(@"SETTINGS_SENDLOG", @"") -#define SETTINGS_SENDLOG_ALERT_BODY NSLocalizedString(@"SETTINGS_SENDLOG_ALERT_BODY",@"") -#define SETTINGS_SENDLOG_ALERT_PASTE NSLocalizedString(@"SETTINGS_SENDLOG_ALERT_PASTE", @"") -#define SETTINGS_SENDLOG_ALERT_EMAIL NSLocalizedString(@"SETTINGS_SENDLOG_ALERT_EMAIL", @"") -#define SETTINGS_SENDLOG_FAILED_TITLE NSLocalizedString(@"SETTINGS_SENDLOG_FAILED_TITLE", @"") -#define SETTINGS_SENDLOG_FAILED_BODY NSLocalizedString(@"SETTINGS_SENDLOG_FAILED_BODY", @"") -#define SETTINGS_SENDLOG_FAILED_DISMISS NSLocalizedString(@"OK", @"") - #pragma mark - Registration @@ -134,8 +127,6 @@ #define REGISTER_CHALLENGE_ALERT_VIEW_TITLE NSLocalizedString(@"REGISTER_CHALLENGE_ALERT_VIEW_TITLE", @"") #define REGISTER_CHALLENGE_ALERT_VIEW_BODY NSLocalizedString(@"REGISTER_CHALLENGE_ALERT_VIEW_BODY", @"") -#define REGISTER_CHALLENGE_ALERT_DISMISS NSLocalizedString(@"OK", @"") - #pragma mark - Invite Users #define INVITE_USERS_ACTION_SHEET_TITLE NSLocalizedString(@"INVITE_USERS_ACTION_SHEET_TITLE", @""); @@ -150,7 +141,7 @@ #pragma mark - Contact Intersection -#define TIMEOUT NSLocalizedString(@"TIMEOUT",@"") +#define TIMEOUT NSLocalizedString(@"ERROR_WAS_DETECTED_TITLE",@"") #define TIMEOUT_CONTACTS_DETAIL NSLocalizedString(@"TIMEOUT_CONTACTS_DETAIL", @"") NSDictionary* makeCallProgressLocalizedTextDictionary(void); diff --git a/Signal/src/environment/VersionMigrations.m b/Signal/src/environment/VersionMigrations.m index 616b6395f8..2cb5f24d0b 100644 --- a/Signal/src/environment/VersionMigrations.m +++ b/Signal/src/environment/VersionMigrations.m @@ -18,7 +18,7 @@ NSString* documentsDirectory = [NSHomeDirectory() stringByAppendingPathComponent:@"/Documents/"]; NSString *path = [NSString stringWithFormat:@"%@/%@.plist", documentsDirectory, @"RedPhone-Data"]; - if ([[NSFileManager defaultManager] fileExistsAtPath:path]) { + if ([NSFileManager.defaultManager fileExistsAtPath:path]) { NSData *plistData = [NSData dataWithContentsOfFile:path]; NSError *error; @@ -35,7 +35,7 @@ [defaults synchronize]; - [[NSFileManager defaultManager]removeItemAtPath:path error:&error]; + [NSFileManager.defaultManager removeItemAtPath:path error:&error]; if (error) { DDLogError(@"Error while migrating data: %@", error.description); @@ -49,7 +49,7 @@ DDLogError(@"Error re-registering on migration from 1.0.2"); }]; - [[NSFileManager defaultManager] removeItemAtPath:path error:&error]; + [NSFileManager.defaultManager removeItemAtPath:path error:&error]; if (error) { DDLogError(@"Error upgrading from 1.0.2 : %@", error.description); diff --git a/Signal/src/network/PushManager.h b/Signal/src/network/PushManager.h index 6af250ebe5..306f6652e2 100644 --- a/Signal/src/network/PushManager.h +++ b/Signal/src/network/PushManager.h @@ -6,7 +6,7 @@ // Copyright (c) 2014 Open Whisper Systems. All rights reserved. // -#import +#import #import @@ -19,7 +19,7 @@ @interface PushManager : NSObject -+ (instancetype)sharedManager; ++ (PushManager*)sharedManager; /** * Push notification token is always registered during signup. User can however revoke notifications. diff --git a/Signal/src/network/PushManager.m b/Signal/src/network/PushManager.m index bd3364721b..7311ecddff 100644 --- a/Signal/src/network/PushManager.m +++ b/Signal/src/network/PushManager.m @@ -8,8 +8,7 @@ #import "PreferencesUtil.h" #import "PushManager.h" #import "Environment.h" -#import "CallServerRequestsManager.h" -#import "FutureUtil.h" +#import "RPServerRequestsManager.h" @interface PushManager () @@ -26,60 +25,35 @@ static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ sharedManager = [self new]; - sharedManager.missingPermissionsAlertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"ACTION_REQUIRED_TITLE", @"") message:NSLocalizedString(@"PUSH_SETTINGS_MESSAGE", @"") delegate:nil cancelButtonTitle:NSLocalizedString(@"OK", @"") otherButtonTitles:nil, nil]; + sharedManager.missingPermissionsAlertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"ACTION_REQUIRED_TITLE", @"") + message:NSLocalizedString(@"PUSH_SETTINGS_MESSAGE", @"") + delegate:nil + cancelButtonTitle:NSLocalizedString(@"OK", @"") + otherButtonTitles:nil, nil]; }); return sharedManager; } + - (void)verifyPushPermissions{ - - if (SYSTEM_VERSION_LESS_THAN(_iOS_8_0)) { - - // Displaying notifications and ringing - - if ([self isMissingMandatoryNotificationTypes:[UIApplication.sharedApplication enabledRemoteNotificationTypes]]) { - - [self registrationWithSuccess:^{ - DDLogInfo(@"Push notifications were succesfully re-enabled"); - } failure:^{ - [self.missingPermissionsAlertView show]; - }]; - } - - } else{ - - // UIUserNotificationsSettings - UIUserNotificationSettings *settings = [UIApplication.sharedApplication currentUserNotificationSettings]; - - // To use Signal, it is required to have sound notifications and alert types. - - if ([self isMissingMandatoryNotificationTypes:settings.types]) { - - [self registrationForUserNotificationWithSuccess:^{ - DDLogInfo(@"User notifications were succesfully re-enabled"); - } failure:^{ - [self.missingPermissionsAlertView show]; - }]; - - } - - // Remote Notifications - if (![UIApplication.sharedApplication isRegisteredForRemoteNotifications]) { - - [self registrationForPushWithSuccess:^{ - DDLogInfo(@"Push notification were succesfully re-enabled"); - } failure:^{ - DDLogError(@"The phone could not be re-registered for push notifications."); // Push tokens are not changing on the same phone, just user notification changes so it's not very important. - }]; - - } + if (self.isMissingMandatoryNotificationTypes || self.needToRegisterForRemoteNotifications){ + [self registrationWithSuccess:^{ + DDLogError(@"Re-enabled push succesfully"); + } failure:^{ + DDLogError(@"Failed to re-enable push."); + }]; } } - (void)registrationWithSuccess:(void (^)())success failure:(void (^)())failure{ + if (!self.wantRemoteNotifications) { + success(); + return; + } + if (SYSTEM_VERSION_LESS_THAN(_iOS_8_0)) { - + // On iOS7, we just need to register for Push Notifications (user notifications are enabled with them) [self registrationForPushWithSuccess:success failure:failure]; @@ -104,20 +78,21 @@ -(TOCFuture*)registerForPushFutureWithToken:(NSData*)token{ self.registerWithServerFutureSource = [TOCFutureSource new]; - [CallServerRequestsManager.sharedInstance registerPushToken:token success:^(NSURLSessionDataTask *task, id responseObject) { + [RPServerRequestsManager.sharedInstance performRequest:[RPAPICall registerPushNotificationWithPushToken:token] success:^(NSURLSessionDataTask *task, id responseObject) { if ([task.response isKindOfClass: NSHTTPURLResponse.class]){ NSInteger statusCode = [(NSHTTPURLResponse*) task.response statusCode]; if (statusCode == 200) { [self.registerWithServerFutureSource trySetResult:@YES]; } else{ DDLogError(@"The server returned %@ instead of a 200 status code", task.response); - [self.registerWithServerFutureSource trySetFailure:@NO]; + [self.registerWithServerFutureSource trySetFailure:nil]; } } else{ - [self.registerWithServerFutureSource trySetFailure:@NO]; + [self.registerWithServerFutureSource trySetFailure:task.response]; } + } failure:^(NSURLSessionDataTask *task, NSError *error) { - [self.registerWithServerFutureSource trySetFailure:@NO]; + [self.registerWithServerFutureSource trySetFailure:error]; }]; return self.registerWithServerFutureSource.future; @@ -125,15 +100,14 @@ #pragma mark Register device for Push Notification locally --(TOCFuture*)registeriOS7PushNotificationFuture{ - self.pushNotificationFutureSource = [TOCFutureSource new]; - [UIApplication.sharedApplication registerForRemoteNotificationTypes:(UIRemoteNotificationType)[self mandatoryNotificationTypes]]; - return self.pushNotificationFutureSource.future; -} - -(TOCFuture*)registerPushNotificationFuture{ self.pushNotificationFutureSource = [TOCFutureSource new]; - [[UIApplication sharedApplication] registerForRemoteNotifications]; + + if (SYSTEM_VERSION_LESS_THAN(_iOS_8_0)) { + [UIApplication.sharedApplication registerForRemoteNotificationTypes:(UIRemoteNotificationType)self.mandatoryNotificationTypes]; + } else { + [UIApplication.sharedApplication registerForRemoteNotifications]; + } return self.pushNotificationFutureSource.future; } @@ -144,28 +118,23 @@ } - (void)registrationForPushWithSuccess:(void (^)())success failure:(void (^)())failure{ - TOCFuture *requestPushTokenFuture; - - if (SYSTEM_VERSION_LESS_THAN(_iOS_8_0)) { - requestPushTokenFuture = [self registeriOS7PushNotificationFuture]; - } else{ - requestPushTokenFuture = [self registerPushNotificationFuture]; - } + TOCFuture *requestPushTokenFuture = [self registerPushNotificationFuture]; [requestPushTokenFuture catchDo:^(id failureObj) { failure(); - if (SYSTEM_VERSION_LESS_THAN(_iOS_8_0)) { - [self.missingPermissionsAlertView show]; - } else{ - DDLogError(@"This should not happen on iOS8. No push token was provided"); - } + [self.missingPermissionsAlertView show]; + DDLogError(@"This should not happen on iOS8. No push token was provided"); }]; [requestPushTokenFuture thenDo:^(NSData* pushToken) { TOCFuture *registerPushTokenFuture = [self registerForPushFutureWithToken:pushToken]; [registerPushTokenFuture catchDo:^(id failureObj) { - UIAlertView *failureToRegisterWithServerAlert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"REGISTRATION_ERROR", @"") message:NSLocalizedString(@"REGISTRATION_BODY", nil) delegate:nil cancelButtonTitle:NSLocalizedString(@"OK", nil) otherButtonTitles:nil, nil]; + UIAlertView *failureToRegisterWithServerAlert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"REGISTRATION_ERROR", @"") + message:NSLocalizedString(@"REGISTRATION_BODY", nil) + delegate:nil + cancelButtonTitle:NSLocalizedString(@"OK", nil) + otherButtonTitles:nil, nil]; [failureToRegisterWithServerAlert show]; failure(); }]; @@ -185,7 +154,7 @@ }]; [registrerUserNotificationFuture thenDo:^(id types) { - if ([self isMissingMandatoryNotificationTypes:[UIApplication.sharedApplication currentUserNotificationSettings].types]) { + if (self.isMissingMandatoryNotificationTypes) { [self.missingPermissionsAlertView show]; failure(); } else{ @@ -194,6 +163,20 @@ }]; } +-(BOOL) needToRegisterForRemoteNotifications { + return self.wantRemoteNotifications && !UIApplication.sharedApplication.isRegisteredForRemoteNotifications; +} + +-(BOOL) wantRemoteNotifications { + BOOL isSimulator = [UIDevice.currentDevice.model.lowercaseString rangeOfString:@"simulator"].location != NSNotFound; + + if (isSimulator) { + // Simulator is used for debugging but can't receive push notifications, so don't bother trying to get them + return NO; + } + + return YES; +} -(UIUserNotificationCategory*)userNotificationsCallCategory{ UIMutableUserNotificationAction *action_accept = [UIMutableUserNotificationAction new]; @@ -218,17 +201,23 @@ return callCategory; } --(BOOL)isMissingMandatoryNotificationTypes:(int)notificationTypes{ - int mandatoryTypes = [self mandatoryNotificationTypes]; - return ((mandatoryTypes & notificationTypes) == mandatoryTypes)?NO:YES; +-(BOOL)isMissingMandatoryNotificationTypes { + int mandatoryTypes = self.mandatoryNotificationTypes; + int currentTypes; + if (SYSTEM_VERSION_LESS_THAN(_iOS_8_0)) { + currentTypes = UIApplication.sharedApplication.enabledRemoteNotificationTypes; + } else { + currentTypes = UIApplication.sharedApplication.currentUserNotificationSettings.types; + } + return (mandatoryTypes & currentTypes) != mandatoryTypes; } -(int)allNotificationTypes{ - return (UIUserNotificationTypeAlert | UIUserNotificationTypeSound | UIUserNotificationTypeBadge); + return UIUserNotificationTypeAlert | UIUserNotificationTypeSound | UIUserNotificationTypeBadge; } -(int)mandatoryNotificationTypes{ - return (UIUserNotificationTypeAlert | UIUserNotificationTypeSound); + return UIUserNotificationTypeAlert | UIUserNotificationTypeSound; } @end diff --git a/Signal/src/network/http/AFHTTPSessionManager+SignalMethods.h b/Signal/src/network/http/AFHTTPSessionManager+SignalMethods.h new file mode 100644 index 0000000000..cdbf285d8b --- /dev/null +++ b/Signal/src/network/http/AFHTTPSessionManager+SignalMethods.h @@ -0,0 +1,23 @@ +// +// AFHTTPSessionManager+SignalMethods.h +// Signal +// +// Created by Frederic Jacobs on 05/10/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "AFHTTPSessionManager.h" + +@interface AFHTTPSessionManager (SignalMethods) + +- (NSURLSessionDataTask *)BUSY:(NSString *)URLString + parameters:(id)parameters + success:(void (^)(NSURLSessionDataTask *task, id responseObject))success + failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure; + +- (NSURLSessionDataTask *)RING:(NSString *)URLString + parameters:(id)parameters + success:(void (^)(NSURLSessionDataTask *task, id responseObject))success + failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure; + +@end diff --git a/Signal/src/network/http/AFHTTPSessionManager+SignalMethods.m b/Signal/src/network/http/AFHTTPSessionManager+SignalMethods.m new file mode 100644 index 0000000000..a8b72f1359 --- /dev/null +++ b/Signal/src/network/http/AFHTTPSessionManager+SignalMethods.m @@ -0,0 +1,49 @@ +// +// AFHTTPSessionManager+SignalMethods.m +// Signal +// +// Created by Frederic Jacobs on 05/10/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "AFHTTPSessionManager+SignalMethods.h" + +@interface AFHTTPSessionManager () + +- (NSURLSessionDataTask *)dataTaskWithHTTPMethod:(NSString *)method + URLString:(NSString *)URLString + parameters:(id)parameters + success:(void (^)(NSURLSessionDataTask *, id))success + failure:(void (^)(NSURLSessionDataTask *, NSError *))failure; + +@end + +@implementation AFHTTPSessionManager (SignalMethods) + +- (NSURLSessionDataTask *)BUSY:(NSString *)URLString + parameters:(id)parameters + success:(void (^)(NSURLSessionDataTask *task, id responseObject))success + failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure{ + + NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"BUSY" URLString:URLString parameters:parameters success:success failure:failure]; + [dataTask resume]; + + return dataTask; + +} + +- (NSURLSessionDataTask *)RING:(NSString *)URLString + parameters:(id)parameters + success:(void (^)(NSURLSessionDataTask *task, id responseObject))success + failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure{ + + NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"RING" URLString:URLString parameters:parameters success:success failure:failure]; + [dataTask resume]; + + return dataTask; + +} + + + +@end diff --git a/Signal/src/network/http/CallServerRequestsManager.h b/Signal/src/network/http/CallServerRequestsManager.h deleted file mode 100644 index 25c11daaac..0000000000 --- a/Signal/src/network/http/CallServerRequestsManager.h +++ /dev/null @@ -1,18 +0,0 @@ -// -// CallServerRequests.h -// Signal -// -// Created by Frederic Jacobs on 31/07/14. -// Copyright (c) 2014 Open Whisper Systems. All rights reserved. -// - -#import -#import - -@interface CallServerRequestsManager : NSObject - -MacrosSingletonInterface - -- (void)registerPushToken:(NSData*)deviceToken success:(void (^)(NSURLSessionDataTask *task, id responseObject))success failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure; - -@end diff --git a/Signal/src/network/http/CallServerRequestsManager.m b/Signal/src/network/http/CallServerRequestsManager.m deleted file mode 100644 index fc514c8021..0000000000 --- a/Signal/src/network/http/CallServerRequestsManager.m +++ /dev/null @@ -1,62 +0,0 @@ -// -// CallServerRequests.m -// Signal -// -// Created by Frederic Jacobs on 31/07/14. -// Copyright (c) 2014 Open Whisper Systems. All rights reserved. -// -#import "HttpRequest.h" -#import "CallServerRequestsManager.h" -#import "DataUtil.h" -#import "Environment.h" -#import "HostNameEndPoint.h" -#import "SGNKeychainUtil.h" - -#define defaultRequestTimeout - -@interface CallServerRequestsManager () - -@property (nonatomic, retain)AFHTTPSessionManager *operationManager; - -@end - - -@implementation CallServerRequestsManager - -MacrosSingletonImplemention - -- (id)init{ - self = [super init]; - - if (self) { - HostNameEndPoint *endpoint = Environment.getCurrent.masterServerSecureEndPoint.hostNameEndPoint; - NSURL *endPointURL = [NSURL URLWithString:[NSString stringWithFormat:@"https://%@:%hu", endpoint.hostname, endpoint.port]]; - NSURLSessionConfiguration *sessionConf = NSURLSessionConfiguration.ephemeralSessionConfiguration; - self.operationManager = [[AFHTTPSessionManager alloc] initWithBaseURL:endPointURL sessionConfiguration:sessionConf]; - self.operationManager.responseSerializer = [AFJSONResponseSerializer serializer]; - self.operationManager.securityPolicy.allowInvalidCertificates = YES; - NSString *certPath = [NSBundle.mainBundle pathForResource:@"whisperReal" ofType:@"cer"]; - NSData *certData = [NSData dataWithContentsOfFile:certPath]; - SecCertificateRef cert = SecCertificateCreateWithData(NULL, (__bridge CFDataRef)(certData)); - self.operationManager.securityPolicy.pinnedCertificates = @[(__bridge_transfer NSData *)SecCertificateCopyData(cert)]; - self.operationManager.securityPolicy.SSLPinningMode = AFSSLPinningModePublicKey; - } - return self; -} - -- (void)registerPushToken:(NSData*)deviceToken success:(void (^)(NSURLSessionDataTask *task, id responseObject))success -failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure{ - self.operationManager.requestSerializer = [self basicAuthenticationSerializer]; - - [self.operationManager PUT:[NSString stringWithFormat:@"/apn/%@",deviceToken.encodedAsHexString] parameters:@{} success:success failure:failure]; -} - -- (AFHTTPRequestSerializer*)basicAuthenticationSerializer{ - AFHTTPRequestSerializer *serializer = [AFHTTPRequestSerializer serializer]; - [serializer setValue:[HttpRequest computeBasicAuthorizationTokenForLocalNumber:SGNKeychainUtil.localNumber - andPassword:SGNKeychainUtil.serverAuthPassword] - forHTTPHeaderField:@"Authorization"]; - return serializer; -} - -@end diff --git a/Signal/src/network/http/HttpManager.h b/Signal/src/network/http/HttpManager.h index cf256d4005..464f8af5c0 100644 --- a/Signal/src/network/http/HttpManager.h +++ b/Signal/src/network/http/HttpManager.h @@ -1,7 +1,6 @@ #import #import "NetworkEndPoint.h" #import "Logging.h" -#import "HttpRequestOrResponse.h" #import "Terminable.h" #import "Queue.h" #import "PacketHandler.h" diff --git a/Signal/src/network/http/HttpRequest.m b/Signal/src/network/http/HttpRequest.m index a835a1188f..9cfdbe12d9 100644 --- a/Signal/src/network/http/HttpRequest.m +++ b/Signal/src/network/http/HttpRequest.m @@ -38,7 +38,7 @@ if (optionalBody != nil) { headers[@"Content-Length"] = [@(optionalBody.length) stringValue]; } - + HttpRequest* s = [HttpRequest new]; s->_method = method; s->_location = location; @@ -145,10 +145,10 @@ } -(bool) isEqualToHttpRequest:(HttpRequest *)other { return [self.toHttp isEqualToString:other.toHttp] - && [self.method isEqualToString:other.method] - && [self.location isEqualToString:other.location] - && (self.optionalBody == other.optionalBody || [self.optionalBody isEqualToString:[other optionalBody]]) - && [self.headers isEqualToDictionary:other.headers]; + && [self.method isEqualToString:other.method] + && [self.location isEqualToString:other.location] + && (self.optionalBody == other.optionalBody || [self.optionalBody isEqualToString:[other optionalBody]]) + && [self.headers isEqualToDictionary:other.headers]; } -(NSString*) description { @@ -156,8 +156,9 @@ self.method, self.location, self.optionalBody == nil ? @"" - : self.optionalBody.length == 0 ? @" [empty body]" - : @" [...body...]"]; + : self.optionalBody.length == 0 ? @" [empty body]" + : @" [...body...]"]; } + @end diff --git a/Signal/src/network/http/RPAPICall.h b/Signal/src/network/http/RPAPICall.h new file mode 100644 index 0000000000..17df2e9f0e --- /dev/null +++ b/Signal/src/network/http/RPAPICall.h @@ -0,0 +1,47 @@ +// +// RedPhoneAPICall.h +// Signal +// +// Created by Frederic Jacobs on 05/10/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import +#import +@class PhoneNumber; + +@interface RPAPICall : NSObject + +typedef NS_ENUM(NSInteger, HTTPMethod) { + HTTP_GET, + HTTP_POST, + HTTP_PUT, + HTTP_DELETE, + SIGNAL_RING, + SIGNAL_BUSY +}; + +#pragma mark API Call Properties + +@property (nonatomic, readonly) NSString *endPoint; +@property (nonatomic, readonly) HTTPMethod method; +@property (nonatomic, readonly) NSDictionary *parameters; +@property (nonatomic, readonly) AFHTTPRequestSerializer *requestSerializer; +@property (nonatomic, readonly) AFHTTPResponseSerializer *responseSerializer; + +#pragma mark API Call Contstructors + ++ (RPAPICall*)requestVerificationCode; ++ (RPAPICall*)requestVerificationCodeWithVoice; ++ (RPAPICall*)verifyVerificationCode:(NSString*)verificationCode; ++ (RPAPICall*)registerPushNotificationWithPushToken:(NSData*)pushToken; ++ (RPAPICall*)unregister; + ++ (RPAPICall*)fetchBloomFilter; + +//+ (RPAPICall*)requestToOpenPortWithSessionId:(int64_t)sessionId; +//+ (RPAPICall*)requestToRingWithSessionId:(int64_t)sessionId; +//+ (RPAPICall*)requestToSignalBusyWithSessionId:(int64_t)sessionId; +//+ (RPAPICall*)requestToInitiateToRemoteNumber:(PhoneNumber*)remoteNumber; + +@end diff --git a/Signal/src/network/http/RPAPICall.m b/Signal/src/network/http/RPAPICall.m new file mode 100644 index 0000000000..b96a456172 --- /dev/null +++ b/Signal/src/network/http/RPAPICall.m @@ -0,0 +1,168 @@ +// +// RedPhoneAPICall.m +// Signal +// +// Created by Frederic Jacobs on 05/10/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "Constraints.h" +#import "CryptoTools.h" +#import "PhoneNumber.h" +#import "RPAPICall.h" +#import "SignalUtil.h" +#import "SGNKeychainUtil.h" +#import "Util.h" + +#define CLAIMED_INTEROP_VERSION_IN_INITIATE_SIGNAL 1 + +@interface RPAPICall () +@property (nonatomic, readwrite) NSString *endPoint; +@property (nonatomic, readwrite) HTTPMethod method; +@property (nonatomic, readwrite) NSDictionary *parameters; +@property (nonatomic, readwrite) AFHTTPRequestSerializer *requestSerializer; +@property (nonatomic, readwrite) AFHTTPResponseSerializer *responseSerializer; +@end + +@implementation RPAPICall + ++ (RPAPICall*)defaultAPICall { + RPAPICall *apiCall = [[RPAPICall alloc] init]; + apiCall.parameters = @{}; + apiCall.requestSerializer = [self basicAuthenticationSerializer]; + apiCall.responseSerializer = [AFHTTPResponseSerializer serializer]; + return apiCall; +} + + ++ (RPAPICall*)requestVerificationCode { + [SGNKeychainUtil generateServerAuthPassword]; + RPAPICall *apiCall = [self defaultAPICall]; + apiCall.method = HTTP_GET; + apiCall.endPoint = @"/users/verification"; + return apiCall; +} + ++ (RPAPICall*)requestVerificationCodeWithVoice { + RPAPICall *apiCall = [self requestVerificationCode]; + apiCall.endPoint = [apiCall.endPoint stringByAppendingString:@"/voice"]; + return apiCall; +} + ++ (RPAPICall*)verifyVerificationCode:(NSString*)verificationCode { + RPAPICall *apiCall = [self defaultAPICall]; + [SGNKeychainUtil generateSignaling]; + apiCall.method = HTTP_PUT; + apiCall.endPoint = [NSString stringWithFormat:@"/users/verification/%@", SGNKeychainUtil.localNumber]; + + NSData* signalingCipherKey = SGNKeychainUtil.signalingCipherKey; + NSData* signalingMacKey = SGNKeychainUtil.signalingMacKey; + NSData* signalingExtraKeyData = SGNKeychainUtil.signalingCipherKey; + NSString* encodedSignalingKey = @[signalingCipherKey, signalingMacKey, signalingExtraKeyData].concatDatas.encodedAsBase64; + apiCall.parameters = @{@"key" : encodedSignalingKey, @"challenge" : verificationCode}; + return apiCall; +} + ++ (RPAPICall*)registerPushNotificationWithPushToken:(NSData*)pushToken { + RPAPICall *apiCall = [self defaultAPICall]; + apiCall.method = HTTP_PUT; + apiCall.endPoint = [NSString stringWithFormat:@"/apn/%@", pushToken.encodedAsHexString]; + return apiCall; +} + ++ (RPAPICall*)fetchBloomFilter { + RPAPICall *apiCall = [self defaultAPICall]; + apiCall.method = HTTP_GET; + apiCall.endPoint = @"/users/directory"; + apiCall.requestSerializer = [self otpAuthenticationSerializer]; + return apiCall; +} + ++ (RPAPICall*)unregister { + RPAPICall *apiCall = [self defaultAPICall]; + apiCall.method = HTTP_GET; + apiCall.endPoint = @"/users/directory"; + apiCall.requestSerializer = [self otpAuthenticationSerializer]; + return apiCall; +} + ++ (RPAPICall*)requestToOpenPortWithSessionId:(int64_t)sessionId { + RPAPICall *apiCall = [self defaultAPICall]; + apiCall.method = HTTP_GET; + apiCall.endPoint = [NSString stringWithFormat:@"/open/%lld", sessionId]; + apiCall.requestSerializer = [self unauthenticatedSerializer]; + apiCall.responseSerializer = [AFHTTPResponseSerializer serializer]; + return apiCall; +} + ++ (RPAPICall*)requestToRingWithSessionId:(int64_t)sessionId { + RPAPICall *apiCall = [self defaultAPICall]; + apiCall.method = SIGNAL_RING; + apiCall.endPoint = [NSString stringWithFormat:@"/session/%lld", sessionId]; + apiCall.requestSerializer = [self otpAuthenticationSerializer]; + return apiCall; +} + ++ (RPAPICall*)requestToSignalBusyWithSessionId:(int64_t)sessionId { + RPAPICall *apiCall = [self defaultAPICall]; + apiCall.method = SIGNAL_BUSY; + apiCall.endPoint = [NSString stringWithFormat:@"/session/%lld", sessionId]; + apiCall.requestSerializer = [self otpAuthenticationSerializer]; + return apiCall; +} + ++ (RPAPICall*)requestToInitiateToRemoteNumber:(PhoneNumber*)remoteNumber { + RPAPICall *apiCall = [self defaultAPICall]; + + require(remoteNumber != nil); + + NSString* formattedRemoteNumber = remoteNumber.toE164; + NSString* interopVersionInsert = (CLAIMED_INTEROP_VERSION_IN_INITIATE_SIGNAL == 0)? @"" : [NSString stringWithFormat:@"/%d", CLAIMED_INTEROP_VERSION_IN_INITIATE_SIGNAL]; + + apiCall.method = HTTP_GET; + apiCall.endPoint = [NSString stringWithFormat:@"/session%@/%@", + interopVersionInsert, + formattedRemoteNumber]; + apiCall.requestSerializer = [self otpAuthenticationSerializer]; + return apiCall; +} + +#pragma mark Authorization Headers + ++ (AFHTTPRequestSerializer*)basicAuthenticationSerializer { + AFHTTPRequestSerializer *serializer = [AFJSONRequestSerializer serializer]; + [serializer setAuthorizationHeaderFieldWithUsername:SGNKeychainUtil.localNumber.toE164 password:SGNKeychainUtil.serverAuthPassword]; + return serializer; +} + ++ (AFHTTPRequestSerializer*)otpAuthenticationSerializer { + AFHTTPRequestSerializer *serializer = [AFJSONRequestSerializer serializer]; + [serializer setAuthorizationHeaderFieldWithUsername:SGNKeychainUtil.localNumber.toE164 password:SGNKeychainUtil.serverAuthPassword]; + return serializer; +} + ++ (AFHTTPRequestSerializer*)unauthenticatedSerializer { + return [AFHTTPRequestSerializer serializer]; +} + ++ (NSString*) computeOtpAuthorizationTokenForLocalNumber:(PhoneNumber*)localNumber + andCounterValue:(int64_t)counterValue + andPassword:(NSString*)password { + require(localNumber != nil); + require(password != nil); + + NSString* rawToken = [NSString stringWithFormat:@"%@:%@:%lld", + localNumber.toE164, + [CryptoTools computeOtpWithPassword:password andCounter:counterValue], + counterValue]; + return [@"OTP " stringByAppendingString:rawToken.encodedAsUtf8.encodedAsBase64]; +} + ++ (NSString*) computeBasicAuthorizationTokenForLocalNumber:(PhoneNumber*)localNumber andPassword:(NSString*)password { + NSString* rawToken = [NSString stringWithFormat:@"%@:%@", + localNumber.toE164, + password]; + return [@"Basic " stringByAppendingString:rawToken.encodedAsUtf8.encodedAsBase64]; +} + +@end diff --git a/Signal/src/network/http/RPServerRequestsManager.h b/Signal/src/network/http/RPServerRequestsManager.h new file mode 100644 index 0000000000..4b48b62b3a --- /dev/null +++ b/Signal/src/network/http/RPServerRequestsManager.h @@ -0,0 +1,24 @@ +// +// CallServerRequests.h +// Signal +// +// Created by Frederic Jacobs on 31/07/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import +#import "RPAPICall.h" + +#import + +@interface RPServerRequestsManager : NSObject + +MacrosSingletonInterface + +- (void)performRequest:(RPAPICall*)apiCall + success:(void (^)(NSURLSessionDataTask *task, id responseObject))success + failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure; + +- (TOCFuture*)futureForRequest:(RPAPICall*)apiCall; + +@end diff --git a/Signal/src/network/http/RPServerRequestsManager.m b/Signal/src/network/http/RPServerRequestsManager.m new file mode 100644 index 0000000000..8d74aa8f81 --- /dev/null +++ b/Signal/src/network/http/RPServerRequestsManager.m @@ -0,0 +1,96 @@ +// +// CallServerRequests.m +// Signal +// +// Created by Frederic Jacobs on 31/07/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// +#import "HttpRequest.h" +#import "RPServerRequestsManager.h" +#import "Constraints.h" +#import "CryptoTools.h" +#import "DataUtil.h" +#import "Environment.h" +#import "HostNameEndPoint.h" +#import "SGNKeychainUtil.h" +#import "Util.h" + +#import "AFHTTPSessionManager+SignalMethods.h" + +@interface RPServerRequestsManager () + +@property (nonatomic, retain)AFHTTPSessionManager *operationManager; + +@end + + +@implementation RPServerRequestsManager + +MacrosSingletonImplemention + +- (id)init{ + self = [super init]; + + if (self) { + HostNameEndPoint *endpoint = Environment.getCurrent.masterServerSecureEndPoint.hostNameEndPoint; + NSURL *endPointURL = [NSURL URLWithString:[NSString stringWithFormat:@"https://%@:%hu", endpoint.hostname, endpoint.port]]; + NSURLSessionConfiguration *sessionConf = NSURLSessionConfiguration.ephemeralSessionConfiguration; + self.operationManager = [[AFHTTPSessionManager alloc] initWithBaseURL:endPointURL sessionConfiguration:sessionConf]; + self.operationManager.responseSerializer = [AFJSONResponseSerializer serializer]; + self.operationManager.securityPolicy.allowInvalidCertificates = YES; + NSString *certPath = [NSBundle.mainBundle pathForResource:@"whisperReal" ofType:@"cer"]; + NSData *certData = [NSData dataWithContentsOfFile:certPath]; + SecCertificateRef cert = SecCertificateCreateWithData(NULL, (__bridge CFDataRef)(certData)); + self.operationManager.securityPolicy.pinnedCertificates = @[(__bridge_transfer NSData *)SecCertificateCopyData(cert)]; + self.operationManager.securityPolicy.SSLPinningMode = AFSSLPinningModeCertificate; + } + return self; +} + +- (void)performRequest:(RPAPICall*)apiCall success:(void (^)(NSURLSessionDataTask *task, id responseObject))success failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure{ + + self.operationManager.requestSerializer = apiCall.requestSerializer; + self.operationManager.responseSerializer = apiCall.responseSerializer; + + switch (apiCall.method) { + case HTTP_GET: + [self.operationManager GET:apiCall.endPoint parameters:apiCall.parameters success:success failure:failure]; + break; + + case HTTP_PUT: + [self.operationManager PUT:apiCall.endPoint parameters:apiCall.parameters success:success failure:failure]; + break; + + case HTTP_POST: + [self.operationManager POST:apiCall.endPoint parameters:apiCall.parameters success:success failure:failure]; + break; + + case HTTP_DELETE: + [self.operationManager DELETE:apiCall.endPoint parameters:apiCall.parameters success:success failure:failure]; + break; + + case SIGNAL_BUSY: + [self.operationManager BUSY:apiCall.endPoint parameters:apiCall.parameters success:success failure:failure]; + break; + + case SIGNAL_RING: + [self.operationManager RING:apiCall.endPoint parameters:apiCall.parameters success:success failure:failure]; + break; + } +} + +- (TOCFuture*)futureForRequest:(RPAPICall*)apiCall{ + TOCFutureSource *requestFutureSource = [TOCFutureSource new]; + + [self performRequest:apiCall success:^(NSURLSessionDataTask *task, id responseObject) { + NSLog(@"ResponseObject: %@", responseObject); + [requestFutureSource trySetResult:task.response]; + } failure:^(NSURLSessionDataTask *task, NSError *error) { + [requestFutureSource trySetFailure:error]; + }]; + + return [requestFutureSource future]; + +} + +@end diff --git a/Signal/src/phone/signaling/number directory/PhoneNumberDirectoryFilter.h b/Signal/src/phone/signaling/number directory/PhoneNumberDirectoryFilter.h index 5205a9274a..99302f0d30 100644 --- a/Signal/src/phone/signaling/number directory/PhoneNumberDirectoryFilter.h +++ b/Signal/src/phone/signaling/number directory/PhoneNumberDirectoryFilter.h @@ -1,7 +1,6 @@ #import #import "BloomFilter.h" #import "PhoneNumber.h" -#import "HttpResponse.h" /** * @@ -18,7 +17,7 @@ +(PhoneNumberDirectoryFilter*) phoneNumberDirectoryFilterDefault; +(PhoneNumberDirectoryFilter*) phoneNumberDirectoryFilterWithBloomFilter:(BloomFilter*)bloomFilter andExpirationDate:(NSDate*)expirationDate; -+(PhoneNumberDirectoryFilter*) phoneNumberDirectoryFilterFromHttpResponse:(HttpResponse*)response; ++(PhoneNumberDirectoryFilter*) phoneNumberDirectoryFilterFromURLResponse:(NSHTTPURLResponse*)response body:(NSData*)data; -(bool) containsPhoneNumber:(PhoneNumber*)phoneNumber; -(NSDate*) getExpirationDate; diff --git a/Signal/src/phone/signaling/number directory/PhoneNumberDirectoryFilter.m b/Signal/src/phone/signaling/number directory/PhoneNumberDirectoryFilter.m index bc87ada61f..3d36edc218 100644 --- a/Signal/src/phone/signaling/number directory/PhoneNumberDirectoryFilter.m +++ b/Signal/src/phone/signaling/number directory/PhoneNumberDirectoryFilter.m @@ -32,18 +32,18 @@ return expirationDate; } -+(PhoneNumberDirectoryFilter*) phoneNumberDirectoryFilterFromHttpResponse:(HttpResponse*)response { ++(PhoneNumberDirectoryFilter*) phoneNumberDirectoryFilterFromURLResponse:(NSHTTPURLResponse*)response body:(NSData*)data { require(response != nil); - checkOperation(response.isOkResponse); + checkOperation(response.statusCode == 200); - NSString* hashCountHeader = response.getHeaders[HASH_COUNT_HEADER_KEY]; + NSString* hashCountHeader = response.allHeaderFields[HASH_COUNT_HEADER_KEY]; checkOperation(hashCountHeader != nil); int hashCountValue = [hashCountHeader intValue]; checkOperation(hashCountValue > 0); - NSData* responseBody = response.getOptionalBodyData; + NSData* responseBody = data; checkOperation(responseBody.length > 0); BloomFilter* bloomFilter = [BloomFilter bloomFilterWithHashCount:(NSUInteger)hashCountValue diff --git a/Signal/src/phone/signaling/number directory/PhoneNumberDirectoryFilterManager.m b/Signal/src/phone/signaling/number directory/PhoneNumberDirectoryFilterManager.m index 27b977a2ae..30acdaeb34 100644 --- a/Signal/src/phone/signaling/number directory/PhoneNumberDirectoryFilterManager.m +++ b/Signal/src/phone/signaling/number directory/PhoneNumberDirectoryFilterManager.m @@ -3,6 +3,7 @@ #import "Environment.h" #import "NotificationManifest.h" #import "PreferencesUtil.h" +#import "RPServerRequestsManager.h" #import "SignalUtil.h" #import "ThreadManager.h" #import "Util.h" @@ -47,7 +48,9 @@ } -(void) scheduleUpdateAt:(NSDate*)date { void(^doUpdate)(void) = ^{ - [self update]; + if (Environment.isRegistered) { + [self update]; + } }; [currentUpdateLifetime cancel]; @@ -59,55 +62,28 @@ unlessCancelled:currentUpdateLifetime.token]; } --(TOCFuture*) asyncQueryCurrentDirectory { - TOCUntilOperation startAwaitDirectoryOperation = ^(TOCCancelToken* untilCancelledToken) { - HttpRequest* directoryRequest = [HttpRequest httpRequestForPhoneNumberDirectoryFilter]; - - TOCFuture* futureDirectoryResponse = [HttpManager asyncOkResponseFromMasterServer:directoryRequest - unlessCancelled:untilCancelledToken - andErrorHandler:Environment.errorNoter]; - - return [futureDirectoryResponse thenTry:^(HttpResponse* response) { - return [PhoneNumberDirectoryFilter phoneNumberDirectoryFilterFromHttpResponse:response]; - }]; - }; - - return [TOCFuture futureFromUntilOperation:[TOCFuture operationTry:startAwaitDirectoryOperation] - withOperationTimeout:DIRECTORY_UPDATE_TIMEOUT_PERIOD - until:lifetimeToken]; -} - --(PhoneNumberDirectoryFilter*) sameDirectoryWithRetryTimeout { - BloomFilter* filter = [phoneNumberDirectoryFilter bloomFilter]; - NSDate* retryDate = [NSDate dateWithTimeInterval:DIRECTORY_UPDATE_RETRY_PERIOD - sinceDate:[NSDate date]]; - return [PhoneNumberDirectoryFilter phoneNumberDirectoryFilterWithBloomFilter:filter - andExpirationDate:retryDate]; -} --(void) signalDirectoryQueryFailed:(id)failure { - NSString* desc = [NSString stringWithFormat:@"Failed to retrieve directory. Retrying in %f hours.", - DIRECTORY_UPDATE_RETRY_PERIOD/HOUR]; - Environment.errorNoter(desc, failure, false); -} --(TOCFuture*) asyncQueryCurrentDirectoryWithDefaultOnFail { - TOCFuture* futureDirectory = [self asyncQueryCurrentDirectory]; - - return [futureDirectory catchTry:^PhoneNumberDirectoryFilter*(id error) { - [self signalDirectoryQueryFailed:error]; - return [self sameDirectoryWithRetryTimeout]; - }]; -} - -(void) update { - TOCFuture* eventualDirectory = [self asyncQueryCurrentDirectoryWithDefaultOnFail]; - - [eventualDirectory thenDo:^(PhoneNumberDirectoryFilter* directory) { + [[RPServerRequestsManager sharedInstance] performRequest:[RPAPICall fetchBloomFilter] success:^(NSURLSessionDataTask *task, NSData *responseObject) { + PhoneNumberDirectoryFilter *directory = [PhoneNumberDirectoryFilter phoneNumberDirectoryFilterFromURLResponse:(NSHTTPURLResponse*)task.response body:responseObject]; + @synchronized(self) { phoneNumberDirectoryFilter = directory; } + [Environment.preferences setSavedPhoneNumberDirectory:directory]; [[NSNotificationCenter defaultCenter] postNotificationName:NOTIFICATION_DIRECTORY_WAS_UPDATED object:nil]; [self scheduleUpdate]; + + } failure:^(NSURLSessionDataTask *task, NSError *error) { + NSString* desc = [NSString stringWithFormat:@"Failed to retrieve directory. Retrying in %f hours.", + DIRECTORY_UPDATE_RETRY_PERIOD/HOUR]; + Environment.errorNoter(desc, error, false); + BloomFilter* filter = [phoneNumberDirectoryFilter bloomFilter]; + NSDate* retryDate = [NSDate dateWithTimeInterval:DIRECTORY_UPDATE_RETRY_PERIOD + sinceDate:[NSDate date]]; + [PhoneNumberDirectoryFilter phoneNumberDirectoryFilterWithBloomFilter:filter + andExpirationDate:retryDate]; + [[NSNotificationCenter defaultCenter] postNotificationName:NOTIFICATION_DIRECTORY_FAILED object:nil]; }]; } diff --git a/Signal/src/view controllers/ContactBrowseViewController.h b/Signal/src/view controllers/ContactBrowseViewController.h index 98b3ccf924..bb7a390e44 100644 --- a/Signal/src/view controllers/ContactBrowseViewController.h +++ b/Signal/src/view controllers/ContactBrowseViewController.h @@ -14,7 +14,6 @@ @property (nonatomic, strong) IBOutlet SearchBarTitleView *searchBarTitleView; @property (nonatomic, strong) IBOutlet UIView *notificationView; @property (nonatomic, retain) UIRefreshControl *refreshControl; -@property (nonatomic) NSTimer *refreshTimer; - (IBAction)notificationViewTapped:(id)sender; - (void)showNotificationForNewWhisperUsers:(NSArray *)users; diff --git a/Signal/src/view controllers/ContactBrowseViewController.m b/Signal/src/view controllers/ContactBrowseViewController.m index 57e87116fb..f0b49e18db 100644 --- a/Signal/src/view controllers/ContactBrowseViewController.m +++ b/Signal/src/view controllers/ContactBrowseViewController.m @@ -34,6 +34,7 @@ static NSString *const CONTACT_BROWSE_TABLE_CELL_IDENTIFIER = @"ContactTableView - (void)viewDidLoad { [super viewDidLoad]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(contactsDidRefresh) name:NOTIFICATION_DIRECTORY_WAS_UPDATED object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(contactRefreshFailed) name:NOTIFICATION_DIRECTORY_FAILED object:nil]; UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init]; [refreshControl addTarget:self action:@selector(refreshContacts) forControlEvents:UIControlEventValueChanged]; @@ -252,17 +253,15 @@ static NSString *const CONTACT_BROWSE_TABLE_CELL_IDENTIFIER = @"ContactTableView - (void)refreshContacts{ [Environment.getCurrent.phoneDirectoryManager forceUpdate]; - self.refreshTimer = [NSTimer scheduledTimerWithTimeInterval:REFRESH_TIMEOUT target:self selector:@selector(contactRefreshDidTimeout) userInfo:nil repeats:NO]; } -- (void)contactRefreshDidTimeout{ +- (void)contactRefreshFailed{ UIAlertView *alert = [[UIAlertView alloc] initWithTitle:TIMEOUT message:TIMEOUT_CONTACTS_DETAIL delegate:nil cancelButtonTitle:NSLocalizedString(@"OK", @"") otherButtonTitles:nil]; [alert show]; [self.refreshControl endRefreshing]; } - (void)contactsDidRefresh{ - [self.refreshTimer invalidate]; [self.refreshControl endRefreshing]; } diff --git a/Signal/src/view controllers/RegisterViewController.m b/Signal/src/view controllers/RegisterViewController.m index cc004f8399..1f0f4b014f 100644 --- a/Signal/src/view controllers/RegisterViewController.m +++ b/Signal/src/view controllers/RegisterViewController.m @@ -1,3 +1,4 @@ +#import "RPServerRequestsManager.h" #import "Environment.h" #import "HttpManager.h" #import "LocalizableText.h" @@ -8,12 +9,13 @@ #import "PreferencesUtil.h" #import "PushManager.h" #import "RegisterViewController.h" +#import "RPServerRequestsManager.h" #import "SignalUtil.h" #import "SGNKeychainUtil.h" #import "ThreadManager.h" #import "Util.h" - +#import #define REGISTER_VIEW_NUMBER 0 #define CHALLENGE_VIEW_NUMBER 1 @@ -114,32 +116,6 @@ [self presentViewController:countryCodeController animated:YES completion:nil]; } --(TOCFuture*) asyncRegister:(PhoneNumber*)phoneNumber untilCancelled:(TOCCancelToken*)cancelToken { - [SGNKeychainUtil generateServerAuthPassword]; - [SGNKeychainUtil setLocalNumberTo:phoneNumber]; - - TOCUntilOperation regStarter = ^TOCFuture *(TOCCancelToken* internalUntilCancelledToken) { - HttpRequest *registerRequest = [HttpRequest httpRequestToStartRegistrationOfPhoneNumber]; - - return [HttpManager asyncOkResponseFromMasterServer:registerRequest - unlessCancelled:internalUntilCancelledToken - andErrorHandler:Environment.errorNoter]; - }; - TOCFuture *futurePhoneRegistrationStarted = [TOCFuture futureFromUntilOperation:[TOCFuture operationTry:regStarter] - withOperationTimeout:SERVER_TIMEOUT_SECONDS - until:cancelToken]; - - return [futurePhoneRegistrationStarted thenTry:^(id _) { - [self showViewNumber:CHALLENGE_VIEW_NUMBER]; - [self.challengeNumberLabel setText:[phoneNumber description]]; - [_registerCancelButton removeFromSuperview]; - [self startVoiceVerificationCountdownTimer]; - self->futureChallengeAcceptedSource = [TOCFutureSource new]; - return futureChallengeAcceptedSource.future; - }]; - -} - - (void)registerPhoneNumberTapped { NSString *phoneNumber = [NSString stringWithFormat:@"%@%@", _countryCodeLabel.text, _phoneNumberTextField.text]; PhoneNumber* localNumber = [PhoneNumber tryParsePhoneNumberFromUserSpecifiedText:phoneNumber]; @@ -147,16 +123,21 @@ [_phoneNumberTextField resignFirstResponder]; - TOCFuture* futureFinished = [self asyncRegister:localNumber untilCancelled:life.token]; [_registerActivityIndicator startAnimating]; _registerButton.enabled = NO; - [futureFinished catchDo:^(id error) { - NSError *err = ((NSError*)error); + [SGNKeychainUtil setLocalNumberTo:localNumber]; + + [[RPServerRequestsManager sharedInstance]performRequest:[RPAPICall requestVerificationCode] success:^(NSURLSessionDataTask *task, id responseObject) { + [self showViewNumber:CHALLENGE_VIEW_NUMBER]; + [self.challengeNumberLabel setText:[phoneNumber description]]; + [_registerCancelButton removeFromSuperview]; + [self startVoiceVerificationCountdownTimer]; + } failure:^(NSURLSessionDataTask *task, NSError *error) { [_registerActivityIndicator stopAnimating]; _registerButton.enabled = YES; - DDLogError(@"Registration failed with information %@", err.description); + DDLogError(@"Registration failed with information %@", error.description); UIAlertView *registrationErrorAV = [[UIAlertView alloc]initWithTitle:REGISTER_ERROR_ALERT_VIEW_TITLE message:REGISTER_ERROR_ALERT_VIEW_BODY delegate:nil cancelButtonTitle:REGISTER_ERROR_ALERT_VIEW_DISMISS otherButtonTitles:nil, nil]; @@ -173,33 +154,10 @@ _challengeButton.enabled = NO; [_challengeActivityIndicator startAnimating]; - HttpRequest *verifyRequest = [HttpRequest httpRequestToVerifyAccessToPhoneNumberWithChallenge:_challengeTextField.text]; - TOCFuture *futureDone = [HttpManager asyncOkResponseFromMasterServer:verifyRequest - unlessCancelled:nil - andErrorHandler:Environment.errorNoter]; - - [futureDone catchDo:^(id error) { - if ([error isKindOfClass:HttpResponse.class]) { - HttpResponse* badResponse = error; - if (badResponse.getStatusCode == 401) { - UIAlertView *incorrectChallengeCodeAV = [[UIAlertView alloc]initWithTitle:REGISTER_CHALLENGE_ALERT_VIEW_TITLE message:REGISTER_CHALLENGE_ALERT_VIEW_BODY delegate:nil cancelButtonTitle:REGISTER_CHALLENGE_ALERT_DISMISS otherButtonTitles:nil, nil]; - [incorrectChallengeCodeAV show]; - _challengeButton.enabled = YES; - [_challengeActivityIndicator stopAnimating]; - return; - } - } - _challengeButton.enabled = YES; - [_challengeActivityIndicator stopAnimating]; - Environment.errorNoter(error, @"While Verifying Challenge.", NO); - }]; - - [futureDone thenDo:^(id result) { - [futureChallengeAcceptedSource trySetResult:@YES]; - }]; - - [futureChallengeAcceptedSource.future thenDo:^(id value) { + [[RPServerRequestsManager sharedInstance] performRequest:[RPAPICall verifyVerificationCode:_challengeTextField.text] success:^(NSURLSessionDataTask *task, id responseObject) { + [PushManager.sharedManager registrationWithSuccess:^{ + [futureChallengeAcceptedSource trySetResult:@YES]; [Environment setRegistered:YES]; [registered trySetResult:@YES]; [Environment.getCurrent.phoneDirectoryManager forceUpdate]; @@ -208,6 +166,27 @@ _challengeButton.enabled = YES; [_challengeActivityIndicator stopAnimating]; }]; + + } failure:^(NSURLSessionDataTask *task, NSError *error) { + NSString *alertTitle = NSLocalizedString(@"REGISTRATION_ERROR", @""); + + if ([error isKindOfClass:HttpResponse.class]) { + NSHTTPURLResponse* badResponse = (NSHTTPURLResponse*)task.response; + if (badResponse.statusCode == 401) { + SignalAlertView(alertTitle, REGISTER_CHALLENGE_ALERT_VIEW_BODY); + } else if (badResponse.statusCode == 401){ + SignalAlertView(alertTitle, NSLocalizedString(@"REGISTER_RATE_LIMITING_BODY", @"")); + } else { + NSString *alertBodyString = [NSString stringWithFormat:@"%@ %lu", NSLocalizedString(@"SERVER_CODE", @""),(unsigned long)badResponse.statusCode]; + SignalAlertView (alertTitle, alertBodyString); + } + } else{ + Environment.errorNoter(error, @"While Verifying Challenge.", NO); + SignalReportError + } + + _challengeButton.enabled = YES; + [_challengeActivityIndicator stopAnimating]; }]; } @@ -269,29 +248,17 @@ - (void) initiateVoiceVerification{ [self stopVoiceVerificationCountdownTimer]; - TOCUntilOperation callStarter = ^TOCFuture *(TOCCancelToken* internalUntilCancelledToken) { - HttpRequest* voiceVerifyReq = [HttpRequest httpRequestToStartRegistrationOfPhoneNumberWithVoice]; - - [self.voiceChallengeTextLabel setText:NSLocalizedString(@"REGISTER_CALL_CALLING", @"")]; - return [HttpManager asyncOkResponseFromMasterServer:voiceVerifyReq - unlessCancelled:internalUntilCancelledToken - andErrorHandler:Environment.errorNoter]; - }; - TOCFuture *futureVoiceVerificationStarted = [TOCFuture futureFromUntilOperation:[TOCFuture operationTry:callStarter] - withOperationTimeout:SERVER_TIMEOUT_SECONDS - until:life.token]; - [futureVoiceVerificationStarted catchDo:^(id errorId) { - HttpResponse* error = (HttpResponse*)errorId; - [self.voiceChallengeTextLabel setText:error.getStatusText]; - }]; + [self.voiceChallengeTextLabel setText:NSLocalizedString(@"REGISTER_CALL_CALLING", @"")]; - [futureVoiceVerificationStarted finallyTry:^(id _id) { + [[RPServerRequestsManager sharedInstance] performRequest:[RPAPICall requestVerificationCodeWithVoice] success:^(NSURLSessionDataTask *task, id responseObject) { + dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, VOICE_VERIFICATION_COOLDOWN_SECONDS * NSEC_PER_SEC); dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ [self.voiceChallengeTextLabel setText:NSLocalizedString(@"REGISTER_CALL_RECALL", @"")]; }); - return _id; + } failure:^(NSURLSessionDataTask *task, NSError *error) { + [self.voiceChallengeTextLabel setText:error.description]; }]; } diff --git a/Signal/src/view controllers/SettingsViewController.m b/Signal/src/view controllers/SettingsViewController.m index 886f51f733..0dc3471c2a 100644 --- a/Signal/src/view controllers/SettingsViewController.m +++ b/Signal/src/view controllers/SettingsViewController.m @@ -299,53 +299,10 @@ static NSString *const CHECKBOX_EMPTY_IMAGE_NAME = @"checkbox_empty"; } if (cell == _sendDebugLog) { - - UIAlertView *alert = [[UIAlertView alloc] initWithTitle:SETTINGS_SENDLOG_WAITING - message:nil delegate:self cancelButtonTitle:nil otherButtonTitles: nil]; - [alert show]; - - [Pastelog submitLogsWithCompletion:^(NSError *error, NSString *urlString) { - [alert dismissWithClickedButtonIndex:0 animated:YES]; - if (!error) { - gistURL = urlString; - UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:SETTINGS_SENDLOG_ALERT_TITLE message:SETTINGS_SENDLOG_ALERT_BODY delegate:self cancelButtonTitle:SETTINGS_SENDLOG_ALERT_PASTE otherButtonTitles:SETTINGS_SENDLOG_ALERT_EMAIL, nil]; - [alertView show]; - - } else{ - UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:SETTINGS_SENDLOG_FAILED_TITLE message:SETTINGS_SENDLOG_FAILED_BODY delegate:nil cancelButtonTitle:SETTINGS_SENDLOG_FAILED_DISMISS otherButtonTitles:nil, nil]; - [alertView show]; - } - }]; + [Pastelog submitLogs]; } } -- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{ - if (buttonIndex == 0) { - [self submitEmail:gistURL]; - } else{ - [self pasteBoardCopy:gistURL]; - } -} - -- (void)submitEmail:(NSString*)url{ - NSString *emailAddress; - -#ifdef ADHOC - emailAddress = @"signal-beta@fredericjacobs.com"; -#else - emailAddress = @"support@whispersystems.org"; -#endif - - NSString *urlString = [NSString stringWithString: [[NSString stringWithFormat:@"mailto:%@?subject=iOS%%20Debug%%20Log&body=", emailAddress] stringByAppendingString:[[NSString stringWithFormat:@"Log URL: %@ \n Tell us about the issue: ", url]stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding]]]; - - [UIApplication.sharedApplication openURL: [NSURL URLWithString: urlString]]; -} - -- (void)pasteBoardCopy:(NSString*)url{ - UIPasteboard *pb = [UIPasteboard generalPasteboard]; - [pb setString:url]; - [UIApplication.sharedApplication openURL:[NSURL URLWithString:@"https://github.com/WhisperSystems/Signal-iOS/issues"]]; -} - (void)findAndLocalizeLabelsForView:(UIView *)view { for (UIView *subview in view.subviews) { diff --git a/Signal/src/view controllers/xibs/FavouritesViewController.xib b/Signal/src/view controllers/xibs/FavouritesViewController.xib index 5602d43d07..e0b12a25c0 100644 --- a/Signal/src/view controllers/xibs/FavouritesViewController.xib +++ b/Signal/src/view controllers/xibs/FavouritesViewController.xib @@ -1,7 +1,8 @@ - + - + + @@ -16,9 +17,8 @@ - @@ -117,4 +108,9 @@ - \ No newline at end of file + + + + + + diff --git a/Signal/src/view controllers/xibs/InboxFeedViewController.xib b/Signal/src/view controllers/xibs/InboxFeedViewController.xib index 2434fd854b..d0e49ff4e7 100644 --- a/Signal/src/view controllers/xibs/InboxFeedViewController.xib +++ b/Signal/src/view controllers/xibs/InboxFeedViewController.xib @@ -1,7 +1,8 @@ - + - + + @@ -19,22 +20,19 @@ - + - - + - - @@ -143,4 +128,9 @@ + + + + + diff --git a/Signal/src/view controllers/xibs/RegisterViewController.xib b/Signal/src/view controllers/xibs/RegisterViewController.xib index adc05608e5..6d013eaf33 100644 --- a/Signal/src/view controllers/xibs/RegisterViewController.xib +++ b/Signal/src/view controllers/xibs/RegisterViewController.xib @@ -1,7 +1,8 @@ - + - + + @@ -278,7 +279,6 @@ ZSB0bw - @@ -286,4 +286,9 @@ ZSB0bw + + + + + diff --git a/Signal/src/views/xibs/CallLogTableViewCell.xib b/Signal/src/views/xibs/CallLogTableViewCell.xib index 23df943144..b0d7bf40cc 100644 --- a/Signal/src/views/xibs/CallLogTableViewCell.xib +++ b/Signal/src/views/xibs/CallLogTableViewCell.xib @@ -1,7 +1,8 @@ - + - + + @@ -13,58 +14,48 @@ - + - - + - - + - - + - - + - -