Support for `supportsVOIP` attribute.
- Deprecates RedPhone upgrade flow. - Adds a generic upgrade dialog. - Upgrades dependencies. - Reorganizes `TSStorageManager` & TSNetworkManager imports.
This commit is contained in:
parent
f0eada2658
commit
ada07351e1
1
Podfile
1
Podfile
|
@ -20,4 +20,3 @@ pod 'DJWActionSheet'
|
|||
pod 'SocketRocket', :git => 'https://github.com/FredericJacobs/SocketRocket.git', :commit => 'f1567f1be7ce49ecf2c9d284ead8ea7c422ee99b'
|
||||
pod 'JSQMessagesViewController', :git => 'https://github.com/WhisperSystems/JSQMessagesViewController', :commit => 'e5582fef8a6b3e35f8070361ef37237222da712b'
|
||||
pod 'APDropDownNavToolbar', :git => 'https://github.com/corbett/APDropDownNavToolbar.git', :branch => 'master'
|
||||
pod 'UICKeyChainStore', :podspec => 'Podspecs/UICKeyChainStore.podspec'
|
||||
|
|
17
Podfile.lock
17
Podfile.lock
|
@ -56,23 +56,22 @@ PODS:
|
|||
- SSKeychain (1.2.3)
|
||||
- TwistedOakCollapsingFutures (1.0.0):
|
||||
- UnionFind (~> 1.0)
|
||||
- UICKeyChainStore (1.0.7)
|
||||
- UnionFind (1.0.1)
|
||||
- YapDatabase/SQLCipher (2.7):
|
||||
- YapDatabase/SQLCipher (2.7.1):
|
||||
- CocoaLumberjack (~> 2)
|
||||
- SQLCipher/fts
|
||||
|
||||
DEPENDENCIES:
|
||||
- AFNetworking (~> 2.5.3)
|
||||
- AFNetworking (~> 2.5.4)
|
||||
- APDropDownNavToolbar (from `https://github.com/corbett/APDropDownNavToolbar.git`,
|
||||
branch `master`)
|
||||
- AxolotlKit (~> 0.7)
|
||||
- DJWActionSheet
|
||||
- FFCircularProgressView (>= 0.1)
|
||||
- FFCircularProgressView (~> 0.5)
|
||||
- JSQMessagesViewController (from `https://github.com/WhisperSystems/JSQMessagesViewController`,
|
||||
commit `e5582fef8a6b3e35f8070361ef37237222da712b`)
|
||||
- libPhoneNumber-iOS (~> 0.8.5)
|
||||
- Mantle (~> 2.0.2)
|
||||
- libPhoneNumber-iOS (~> 0.8.7)
|
||||
- Mantle (~> 2.0.4)
|
||||
- OpenSSL (~> 1.0.204)
|
||||
- PastelogKit (~> 1.3)
|
||||
- SCWaveformView (~> 1.0)
|
||||
|
@ -80,7 +79,6 @@ DEPENDENCIES:
|
|||
`f1567f1be7ce49ecf2c9d284ead8ea7c422ee99b`)
|
||||
- SSKeychain
|
||||
- TwistedOakCollapsingFutures (~> 1.0)
|
||||
- UICKeyChainStore (from `Podspecs/UICKeyChainStore.podspec`)
|
||||
- YapDatabase/SQLCipher (~> 2.7)
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
|
@ -93,8 +91,6 @@ EXTERNAL SOURCES:
|
|||
SocketRocket:
|
||||
:commit: f1567f1be7ce49ecf2c9d284ead8ea7c422ee99b
|
||||
:git: https://github.com/FredericJacobs/SocketRocket.git
|
||||
UICKeyChainStore:
|
||||
:podspec: Podspecs/UICKeyChainStore.podspec
|
||||
|
||||
CHECKOUT OPTIONS:
|
||||
APDropDownNavToolbar:
|
||||
|
@ -128,8 +124,7 @@ SPEC CHECKSUMS:
|
|||
SQLCipher: c44fcca49c31483c2489cfb79aa7a69407f3794a
|
||||
SSKeychain: 3f42991739c6c60a9cf1bbd4dff6c0d3694bcf3d
|
||||
TwistedOakCollapsingFutures: f359b90f203e9ab13dfb92c9ff41842a7fe1cd0c
|
||||
UICKeyChainStore: d4c0f4e313d67b2f23b6614adca55351accac15a
|
||||
UnionFind: c33be5adb12983981d6e827ea94fc7f9e370f52d
|
||||
YapDatabase: 9ec61885759a832d41f965e27f7ee08a06d4c441
|
||||
YapDatabase: e9ff9a189e99268a331575411e8462e4c6df2bc3
|
||||
|
||||
COCOAPODS: 0.38.2
|
||||
|
|
2
Pods
2
Pods
|
@ -1 +1 @@
|
|||
Subproject commit c36469aa9cc7ea2cc8c343065dfbf0353c0b5791
|
||||
Subproject commit c43d25e93c1b3d25a866e618ff1b45f3a940f332
|
|
@ -1,18 +0,0 @@
|
|||
Pod::Spec.new do |s|
|
||||
s.name = "UICKeyChainStore"
|
||||
s.version = "1.0.7"
|
||||
s.summary = "UICKeyChainStore is a simple wrapper for Keychain on iOS and OS X. Makes using Keychain APIs as easy as NSUserDefaults."
|
||||
s.homepage = "https://github.com/kishikawakatsumi/UICKeyChainStore"
|
||||
s.social_media_url = "https://twitter.com/k_katsumi"
|
||||
s.license = { :type => "MIT", :file => "LICENSE" }
|
||||
s.author = { "kishikawa katsumi" => "kishikawakatsumi@mac.com" }
|
||||
s.source = { :git => "https://github.com/FredericJacobs/UICKeyChainStore.git", :tag => "v#{s.version}" }
|
||||
|
||||
s.ios.deployment_target = "4.3"
|
||||
s.osx.deployment_target = "10.6"
|
||||
s.requires_arc = true
|
||||
|
||||
s.source_files = "Lib/*"
|
||||
|
||||
s.framework = "Security"
|
||||
end
|
|
@ -274,7 +274,6 @@
|
|||
A547DD741A70A87800103EC7 /* DJWActionSheet+OWS.m in Sources */ = {isa = PBXBuildFile; fileRef = A547DD721A70A87800103EC7 /* DJWActionSheet+OWS.m */; };
|
||||
A5509ECA1A69AB8B00ABA4BC /* Storyboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A5509EC91A69AB8B00ABA4BC /* Storyboard.storyboard */; };
|
||||
A5509ECD1A69B1D600ABA4BC /* CountryCodeTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A5509ECC1A69B1D600ABA4BC /* CountryCodeTableViewCell.m */; };
|
||||
A5578C721A646E5300704A25 /* VersionMigrationsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = A5578C711A646E5300704A25 /* VersionMigrationsTests.m */; };
|
||||
A56977911A351BC400173BF2 /* ScanIdentityBarcodeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A569778E1A351BC400173BF2 /* ScanIdentityBarcodeViewController.m */; };
|
||||
A56977921A351BC400173BF2 /* PresentIdentityQRCodeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A569778F1A351BC400173BF2 /* PresentIdentityQRCodeViewController.m */; };
|
||||
A5988A811A8A70D0002AD6BE /* UIButton+OWS.m in Sources */ = {isa = PBXBuildFile; fileRef = A5988A801A8A70D0002AD6BE /* UIButton+OWS.m */; };
|
||||
|
@ -341,6 +340,7 @@
|
|||
B66B9F7D1AEAF40500E2E609 /* NotificationSettingsOptionsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B66B9F7C1AEAF40500E2E609 /* NotificationSettingsOptionsViewController.m */; };
|
||||
B66DBF4A19D5BBC8006EA940 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B66DBF4919D5BBC8006EA940 /* Images.xcassets */; };
|
||||
B671B2461A93B238002BBD9D /* GroupContactsResult.m in Sources */ = {isa = PBXBuildFile; fileRef = B671B2451A93B238002BBD9D /* GroupContactsResult.m */; };
|
||||
B675C16C1B891B3900A7A87A /* TSAttributes.m in Sources */ = {isa = PBXBuildFile; fileRef = B675C16B1B891B3900A7A87A /* TSAttributes.m */; };
|
||||
B67ADDC41989FF8700E1A773 /* RPServerRequestsManager.m in Sources */ = {isa = PBXBuildFile; fileRef = B67ADDC31989FF8700E1A773 /* RPServerRequestsManager.m */; };
|
||||
B67EBF5D19194AC60084CCFD /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = B67EBF5C19194AC60084CCFD /* Settings.bundle */; };
|
||||
B68112EA1A4D9EC400BA82FF /* UIImage+normalizeImage.m in Sources */ = {isa = PBXBuildFile; fileRef = B68112E91A4D9EC400BA82FF /* UIImage+normalizeImage.m */; };
|
||||
|
@ -394,6 +394,8 @@
|
|||
B6B1013C196D213F007E3930 /* SignalKeyingStorage.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B1013B196D213F007E3930 /* SignalKeyingStorage.m */; };
|
||||
B6B50AAB1A4192C500F8F607 /* TSMessagesManager+attachments.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B50AAA1A4192C500F8F607 /* TSMessagesManager+attachments.m */; };
|
||||
B6B9ECFC198B31BA00C620D3 /* PushManager.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B9ECFB198B31BA00C620D3 /* PushManager.m */; };
|
||||
B6BADBE41B88CB940086A80D /* TSUpdateAttributesRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B6BADBE31B88CB940086A80D /* TSUpdateAttributesRequest.m */; };
|
||||
B6BADBE71B88D1AC0086A80D /* LockInteractionController.m in Sources */ = {isa = PBXBuildFile; fileRef = B6BADBE61B88D1AC0086A80D /* LockInteractionController.m */; };
|
||||
B6BE7EED1AB100250038D0C8 /* BloomFilterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B6BE7EEC1AB100250038D0C8 /* BloomFilterTests.m */; };
|
||||
B6C6AE551A305ED1006BAF8F /* redphone.cer in Resources */ = {isa = PBXBuildFile; fileRef = B6C6AE531A305ED1006BAF8F /* redphone.cer */; };
|
||||
B6C6AE561A305ED1006BAF8F /* textsecure.cer in Resources */ = {isa = PBXBuildFile; fileRef = B6C6AE541A305ED1006BAF8F /* textsecure.cer */; };
|
||||
|
@ -832,7 +834,6 @@
|
|||
A5509EC91A69AB8B00ABA4BC /* Storyboard.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Storyboard.storyboard; path = Storyboard/Storyboard.storyboard; sourceTree = "<group>"; };
|
||||
A5509ECB1A69B1D600ABA4BC /* CountryCodeTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CountryCodeTableViewCell.h; sourceTree = "<group>"; };
|
||||
A5509ECC1A69B1D600ABA4BC /* CountryCodeTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CountryCodeTableViewCell.m; sourceTree = "<group>"; };
|
||||
A5578C711A646E5300704A25 /* VersionMigrationsTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VersionMigrationsTests.m; sourceTree = "<group>"; };
|
||||
A569778D1A351BC400173BF2 /* ScanIdentityBarcodeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScanIdentityBarcodeViewController.h; sourceTree = "<group>"; };
|
||||
A569778E1A351BC400173BF2 /* ScanIdentityBarcodeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ScanIdentityBarcodeViewController.m; sourceTree = "<group>"; };
|
||||
A569778F1A351BC400173BF2 /* PresentIdentityQRCodeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PresentIdentityQRCodeViewController.m; sourceTree = "<group>"; };
|
||||
|
@ -946,6 +947,9 @@
|
|||
B66DBF4919D5BBC8006EA940 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
|
||||
B671B2441A93B238002BBD9D /* GroupContactsResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GroupContactsResult.h; sourceTree = "<group>"; };
|
||||
B671B2451A93B238002BBD9D /* GroupContactsResult.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GroupContactsResult.m; sourceTree = "<group>"; };
|
||||
B675C16A1B891B3900A7A87A /* TSAttributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSAttributes.h; sourceTree = "<group>"; };
|
||||
B675C16B1B891B3900A7A87A /* TSAttributes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSAttributes.m; sourceTree = "<group>"; };
|
||||
B675C16F1B891D6800A7A87A /* TSStorageHeaders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TSStorageHeaders.h; path = ../TSStorageHeaders.h; sourceTree = "<group>"; };
|
||||
B676BCEF1AA544E7009637B8 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = translations/de.lproj/Localizable.strings; sourceTree = "<group>"; };
|
||||
B676BCF01AA544F5009637B8 /* el_GR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = el_GR; path = translations/el_GR.lproj/Localizable.strings; sourceTree = "<group>"; };
|
||||
B676BCF11AA5451E009637B8 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = translations/es.lproj/Localizable.strings; sourceTree = "<group>"; };
|
||||
|
@ -1066,6 +1070,10 @@
|
|||
B6B50AAA1A4192C500F8F607 /* TSMessagesManager+attachments.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "TSMessagesManager+attachments.m"; sourceTree = "<group>"; };
|
||||
B6B9ECFA198B31BA00C620D3 /* PushManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PushManager.h; sourceTree = "<group>"; };
|
||||
B6B9ECFB198B31BA00C620D3 /* PushManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PushManager.m; sourceTree = "<group>"; };
|
||||
B6BADBE21B88CB940086A80D /* TSUpdateAttributesRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSUpdateAttributesRequest.h; sourceTree = "<group>"; };
|
||||
B6BADBE31B88CB940086A80D /* TSUpdateAttributesRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSUpdateAttributesRequest.m; sourceTree = "<group>"; };
|
||||
B6BADBE51B88D1AC0086A80D /* LockInteractionController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LockInteractionController.h; sourceTree = "<group>"; };
|
||||
B6BADBE61B88D1AC0086A80D /* LockInteractionController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LockInteractionController.m; sourceTree = "<group>"; };
|
||||
B6BC3D0C1AA544B100C2907F /* da */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = da; path = translations/da.lproj/Localizable.strings; sourceTree = "<group>"; };
|
||||
B6BE7EEC1AB100250038D0C8 /* BloomFilterTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BloomFilterTests.m; sourceTree = "<group>"; };
|
||||
B6C6AE531A305ED1006BAF8F /* redphone.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = redphone.cer; sourceTree = "<group>"; };
|
||||
|
@ -1850,6 +1858,8 @@
|
|||
76EB04FE18170B33006006FC /* view controllers */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
B6BADBE51B88D1AC0086A80D /* LockInteractionController.h */,
|
||||
B6BADBE61B88D1AC0086A80D /* LockInteractionController.m */,
|
||||
FCFD25791A1543D500F4C644 /* Signup */,
|
||||
FC3196321A08142D0094C78E /* Signals */,
|
||||
FC3196311A08141D0094C78E /* Settings */,
|
||||
|
@ -2180,6 +2190,8 @@
|
|||
B63AF5BF1A1F757900D01AAD /* TSSubmitMessageRequest.m */,
|
||||
B63AF5AE1A1F757900D01AAD /* TSUnregisterAccountRequest.h */,
|
||||
B63AF5AF1A1F757900D01AAD /* TSUnregisterAccountRequest.m */,
|
||||
B6BADBE21B88CB940086A80D /* TSUpdateAttributesRequest.h */,
|
||||
B6BADBE31B88CB940086A80D /* TSUpdateAttributesRequest.m */,
|
||||
);
|
||||
path = Requests;
|
||||
sourceTree = "<group>";
|
||||
|
@ -2208,7 +2220,6 @@
|
|||
isa = PBXGroup;
|
||||
children = (
|
||||
B65031CE1A7862AA002EBBBD /* SignedPreKeyDeletionTests.m */,
|
||||
A5578C711A646E5300704A25 /* VersionMigrationsTests.m */,
|
||||
B6B095DE1A1D25C5008BFAA6 /* CryptographyTests.mm */,
|
||||
B6B095DF1A1D25C5008BFAA6 /* TextSecureKitTests.m */,
|
||||
B6B095E01A1D25C5008BFAA6 /* TSMessageStorageTests.m */,
|
||||
|
@ -2239,6 +2250,8 @@
|
|||
B6B095EB1A1D25ED008BFAA6 /* Account */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
B675C16A1B891B3900A7A87A /* TSAttributes.h */,
|
||||
B675C16B1B891B3900A7A87A /* TSAttributes.m */,
|
||||
B6B095EC1A1D25ED008BFAA6 /* TSAccountManager.h */,
|
||||
B6B095ED1A1D25ED008BFAA6 /* TSAccountManager.m */,
|
||||
B6B095F01A1D25ED008BFAA6 /* TSPreKeyManager.h */,
|
||||
|
@ -2341,6 +2354,7 @@
|
|||
B6B0963F1A1D25ED008BFAA6 /* AxolotlStore */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
B675C16F1B891D6800A7A87A /* TSStorageHeaders.h */,
|
||||
B6B096401A1D25ED008BFAA6 /* TSStorageManager+IdentityKeyStore.h */,
|
||||
B6B096411A1D25ED008BFAA6 /* TSStorageManager+IdentityKeyStore.m */,
|
||||
B6B096421A1D25ED008BFAA6 /* TSStorageManager+keyFromIntLong.h */,
|
||||
|
@ -2969,6 +2983,7 @@
|
|||
76EB060218170B33006006FC /* InitiatorSessionDescriptor.m in Sources */,
|
||||
76EB05FC18170B33006006FC /* CallConnectUtil_Server.m in Sources */,
|
||||
76EB062418170B33006006FC /* PriorityQueue.m in Sources */,
|
||||
B6BADBE71B88D1AC0086A80D /* LockInteractionController.m in Sources */,
|
||||
76EB061A18170B33006006FC /* DiscardingLog.m in Sources */,
|
||||
B63AF5C71A1F757900D01AAD /* TSContactsIntersectionRequest.m in Sources */,
|
||||
B6B0968B1A1D25ED008BFAA6 /* TSStorageManager+SignedPreKeyStore.m in Sources */,
|
||||
|
@ -3034,6 +3049,7 @@
|
|||
76EB05A618170B33006006FC /* RtpPacket.m in Sources */,
|
||||
76EB064218170B33006006FC /* StringUtil.m in Sources */,
|
||||
A547DD741A70A87800103EC7 /* DJWActionSheet+OWS.m in Sources */,
|
||||
B6BADBE41B88CB940086A80D /* TSUpdateAttributesRequest.m in Sources */,
|
||||
76EB065A18170B34006006FC /* NextResponderScrollView.m in Sources */,
|
||||
76EB062618170B33006006FC /* Queue.m in Sources */,
|
||||
D221A09A169C9E5E00537ABF /* main.m in Sources */,
|
||||
|
@ -3058,6 +3074,7 @@
|
|||
76EB05E418170B33006006FC /* UdpSocket.m in Sources */,
|
||||
B6B096931A1D25ED008BFAA6 /* NSData+messagePadding.m in Sources */,
|
||||
B63AF5CE1A1F757900D01AAD /* TSAttachmentRequest.m in Sources */,
|
||||
B675C16C1B891B3900A7A87A /* TSAttributes.m in Sources */,
|
||||
76EB058218170B33006006FC /* Environment.m in Sources */,
|
||||
76EB064418170B33006006FC /* ThreadManager.m in Sources */,
|
||||
E197B61E18BBEC6D00F073E5 /* AudioRouter.m in Sources */,
|
||||
|
@ -3280,7 +3297,6 @@
|
|||
76EB05CF18170B33006006FC /* ZrtpHandshakeResult.m in Sources */,
|
||||
76EB060518170B33006006FC /* PhoneNumberDirectoryFilter.m in Sources */,
|
||||
A157076817F0CD6D007C2BD6 /* ShortAuthenticationStringGeneratorTest.m in Sources */,
|
||||
A5578C721A646E5300704A25 /* VersionMigrationsTests.m in Sources */,
|
||||
76EB065718170B34006006FC /* InCallViewController.m in Sources */,
|
||||
A157076917F0CD6D007C2BD6 /* PregeneratedKeyAgreementParticipantProtocol.m in Sources */,
|
||||
76EB062918170B33006006FC /* BadArgument.m in Sources */,
|
||||
|
@ -3519,7 +3535,7 @@
|
|||
CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES;
|
||||
CLANG_WARN__ARC_BRIDGE_CAST_NONARC = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
CODE_SIGN_IDENTITY = "iPhone Distribution";
|
||||
COPY_PHASE_STRIP = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_GENERATE_TEST_COVERAGE_FILES = NO;
|
||||
|
@ -3571,8 +3587,6 @@
|
|||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
|
@ -3626,8 +3640,6 @@
|
|||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>2.1.2</string>
|
||||
<string>2.1.3</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleURLTypes</key>
|
||||
|
@ -40,7 +40,7 @@
|
|||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>2.1.65</string>
|
||||
<string>2.1.70</string>
|
||||
<key>LOGS_EMAIL</key>
|
||||
<string>support@whispersystems.org</string>
|
||||
<key>LOGS_URL</key>
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
#import "TSPreKeyManager.h"
|
||||
#import "TSMessagesManager.h"
|
||||
#import "TSSocketManager.h"
|
||||
#import "TSStorageManager.h"
|
||||
#import "VersionMigrations.h"
|
||||
#import "CodeVerificationViewController.h"
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#import "Contact.h"
|
||||
#import "ContactsManager.h"
|
||||
#import "TSStorageManager.h"
|
||||
#import "Environment.h"
|
||||
#import "TSRecipient.h"
|
||||
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
#import "PacketHandler.h"
|
||||
#import "SecureEndPoint.h"
|
||||
#import "TSGroupModel.h"
|
||||
#import "TSStorageHeaders.h"
|
||||
|
||||
/**
|
||||
*
|
||||
* Environment is a data and data accessor class.
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
#import "SignalsViewController.h"
|
||||
#import "TSContactThread.h"
|
||||
#import "TSGroupThread.h"
|
||||
#import "TSStorageManager.h"
|
||||
|
||||
static NSString* const kCallSegue = @"2.0_6.0_Call_Segue";
|
||||
#define isRegisteredUserDefaultString @"isRegistered"
|
||||
|
|
|
@ -211,7 +211,6 @@
|
|||
return currentVersion;
|
||||
}
|
||||
|
||||
|
||||
#pragma mark Notification Preferences
|
||||
|
||||
- (BOOL)soundInForeground {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#import "PropertyListPreferences.h"
|
||||
#import "Constraints.h"
|
||||
#import "TSStorageManager.h"
|
||||
#import "TSStorageHeaders.h"
|
||||
|
||||
#define SignalDatabaseCollection @"SignalPreferences"
|
||||
|
||||
|
|
|
@ -13,6 +13,5 @@
|
|||
@interface VersionMigrations : NSObject
|
||||
|
||||
+ (void)performUpdateCheck;
|
||||
+ (BOOL)isMigrating;
|
||||
|
||||
@end
|
||||
|
|
|
@ -9,18 +9,17 @@
|
|||
#import "VersionMigrations.h"
|
||||
|
||||
#import "Environment.h"
|
||||
#import "LockInteractionController.h"
|
||||
#import "PhoneNumberDirectoryFilterManager.h"
|
||||
#import "PreferencesUtil.h"
|
||||
#import "PushManager.h"
|
||||
#import "TSAccountManager.h"
|
||||
#import "TSNetworkManager.h"
|
||||
#import "RecentCallManager.h"
|
||||
#import "SignalKeyingStorage.h"
|
||||
#import "UICKeyChainStore.h"
|
||||
|
||||
#define IS_MIGRATING_FROM_1DOT0_TO_LARGER_KEY @"Migrating from 1.0 to Larger"
|
||||
#define NEEDS_TO_REGISTER_PUSH_KEY @"Register For Push"
|
||||
|
||||
|
||||
#define NEEDS_TO_REGISTER_ATTRIBUTES @"Register Attributes"
|
||||
|
||||
@interface SignalKeyingStorage(VersionMigrations)
|
||||
|
||||
|
@ -35,45 +34,30 @@
|
|||
+ (void)performUpdateCheck{
|
||||
NSString *previousVersion = Environment.preferences.lastRanVersion;
|
||||
NSString *currentVersion = [Environment.preferences setAndGetCurrentVersion];
|
||||
BOOL isCurrentlyMigrating = [VersionMigrations isMigratingTo2Dot0];
|
||||
BOOL needsToRegisterPush = [VersionMigrations needsRegisterPush];
|
||||
BOOL VOIPRegistration = [[PushManager sharedManager] supportsVOIPPush]
|
||||
&& ![Environment.preferences hasRegisteredVOIPPush];
|
||||
|
||||
if (!previousVersion) {
|
||||
DDLogError(@"No previous version found. Possibly first launch since install.");
|
||||
return;
|
||||
}
|
||||
|
||||
if(([self isVersion:previousVersion atLeast:@"1.0.2" andLessThan:@"2.0"]) || isCurrentlyMigrating) {
|
||||
[VersionMigrations migrateFrom1Dot0Dot2ToVersion2Dot0];
|
||||
}
|
||||
|
||||
if(([self isVersion:previousVersion atLeast:@"2.0.0" andLessThan:@"2.0.18"])) {
|
||||
[VersionMigrations migrateBloomFilter];
|
||||
}
|
||||
|
||||
if ([self isVersion:previousVersion atLeast:@"2.0.0" andLessThan:@"2.0.21"] || needsToRegisterPush) {
|
||||
[self clearVideoCache];
|
||||
[self blockingPushRegistration];
|
||||
if(([self isVersion:previousVersion atLeast:@"1.0.2" andLessThan:@"2.0"])) {
|
||||
// We don't migrate from RedPhone anymore, too painful to maintain.
|
||||
// Resetting the app data and quitting.
|
||||
[Environment resetAppData];
|
||||
exit(0);
|
||||
}
|
||||
|
||||
// VOIP Push might need to be enabled because 1) user ran old version 2) Update to compatible iOS version
|
||||
if (VOIPRegistration && [TSAccountManager isRegistered]) {
|
||||
[PushManager.sharedManager registrationAndRedPhoneTokenRequestWithSuccess:^(NSData *pushToken, NSData *voipToken, NSString *signupToken) {
|
||||
[TSAccountManager registerWithRedPhoneToken:signupToken
|
||||
pushToken:pushToken
|
||||
voipToken:voipToken
|
||||
success:^{[Environment.preferences setHasRegisteredVOIPPush:YES];}
|
||||
failure:^(NSError *error) {
|
||||
DDLogError(@"Couldn't register with TextSecure server: %@", error.debugDescription);
|
||||
}];
|
||||
} failure:^(NSError *error) {
|
||||
DDLogError(@"Couldn't register with RedPhone server.");
|
||||
}];
|
||||
}
|
||||
[self nonBlockingPushRegistration];
|
||||
}
|
||||
|
||||
+ (BOOL)isMigrating{
|
||||
return [self isMigratingTo2Dot0];
|
||||
if ([self isVersion:previousVersion atLeast:@"2.0.0" andLessThan:@"2.1.70"] || [self needsRegisterAttributes]) {
|
||||
[self clearVideoCache];
|
||||
[self blockingAttributesUpdate];
|
||||
}
|
||||
}
|
||||
|
||||
+ (BOOL) isVersion:(NSString *)thisVersionString atLeast:(NSString *)openLowerBoundVersionString andLessThan:(NSString *)closedUpperBoundVersionString {
|
||||
|
@ -88,196 +72,55 @@
|
|||
return [thisVersionString compare:thatVersionString options:NSNumericSearch] == NSOrderedAscending;
|
||||
}
|
||||
|
||||
+ (void)clearUserDefaults{
|
||||
NSString *appDomain = [[NSBundle mainBundle] bundleIdentifier];
|
||||
[[NSUserDefaults standardUserDefaults] removePersistentDomainForName:appDomain];
|
||||
|
||||
[Environment.preferences setAndGetCurrentVersion];
|
||||
[[NSUserDefaults standardUserDefaults] setObject:@YES forKey:IS_MIGRATING_FROM_1DOT0_TO_LARGER_KEY];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
}
|
||||
|
||||
#pragma mark 2.0.1
|
||||
|
||||
+ (void)migrateBloomFilter {
|
||||
// The bloom filter had to be moved to the cache folder after rejection of the 2.0.1
|
||||
NSString *oldBloomKey = @"Directory Bloom Data";
|
||||
[[Environment preferences] setValueForKey:oldBloomKey toValue:nil];
|
||||
return;
|
||||
}
|
||||
|
||||
#pragma mark 2.0
|
||||
|
||||
+ (void)migrateFrom1Dot0Dot2ToVersion2Dot0 {
|
||||
|
||||
if (!([self wasRedPhoneRegistered] || [self isMigratingTo2Dot0])) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ([self wasRedPhoneRegistered]) {
|
||||
[self migrateRecentCallsToVersion2Dot0];
|
||||
[self migrateKeyingStorageToVersion2Dot0];
|
||||
[self clearUserDefaults];
|
||||
}
|
||||
|
||||
[UIApplication.sharedApplication setNetworkActivityIndicatorVisible:YES];
|
||||
|
||||
UIAlertController *waitingController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"REGISTER_TEXTSECURE_COMPONENT", nil)
|
||||
message:nil
|
||||
preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
||||
[[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:waitingController animated:YES completion:nil];
|
||||
|
||||
[PushManager.sharedManager registrationAndRedPhoneTokenRequestWithSuccess:^(NSData *pushToken, NSData *voipToken, NSString *signupToken) {
|
||||
[TSAccountManager registerWithRedPhoneToken:signupToken pushToken:pushToken voipToken:voipToken success:^{
|
||||
[UIApplication.sharedApplication setNetworkActivityIndicatorVisible:NO];
|
||||
[self clearMigrationFlag];
|
||||
Environment *env = [Environment getCurrent];
|
||||
PhoneNumberDirectoryFilterManager *manager = [env phoneDirectoryManager];
|
||||
[manager forceUpdate];
|
||||
[waitingController dismissViewControllerAnimated:YES completion:nil];
|
||||
} failure:^(NSError *error) {
|
||||
[self refreshLock:waitingController];
|
||||
DDLogError(@"Couldn't register with TextSecure server: %@", error.debugDescription);
|
||||
}];
|
||||
} failure:^(NSError *error) {
|
||||
[self refreshLock:waitingController];
|
||||
DDLogError(@"Couldn't register with RedPhone server.");
|
||||
}];
|
||||
}
|
||||
|
||||
+ (void)refreshLock:(UIAlertController*)waitingController {
|
||||
[UIApplication.sharedApplication setNetworkActivityIndicatorVisible:NO];
|
||||
[waitingController dismissViewControllerAnimated:NO completion:^{
|
||||
UIAlertController *retryController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"REGISTER_TEXTSECURE_FAILED_TITLE", nil)
|
||||
message:NSLocalizedString(@"REGISTER_TEXTSECURE_FAILED", nil)
|
||||
preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
||||
[retryController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"REGISTER_FAILED_TRY_AGAIN", nil)
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction *action) {
|
||||
[self migrateFrom1Dot0Dot2ToVersion2Dot0];
|
||||
}]];
|
||||
|
||||
[[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:retryController animated:YES completion:nil];
|
||||
}];
|
||||
}
|
||||
|
||||
+ (void) migrateRecentCallsToVersion2Dot0 {
|
||||
NSUserDefaults *defaults = NSUserDefaults.standardUserDefaults;
|
||||
NSData *encodedData = [defaults objectForKey:RECENT_CALLS_DEFAULT_KEY];
|
||||
id data = [NSKeyedUnarchiver unarchiveObjectWithData:encodedData];
|
||||
|
||||
if(![data isKindOfClass:NSArray.class]) {
|
||||
return;
|
||||
} else {
|
||||
NSMutableArray *allRecents = [NSMutableArray arrayWithArray:data];
|
||||
|
||||
for (RecentCall* recentCall in allRecents) {
|
||||
[Environment.getCurrent.recentCallManager addRecentCall:recentCall];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+(BOOL)wasRedPhoneRegistered{
|
||||
BOOL hasLocalNumber = [UICKeyChainStore stringForKey:LOCAL_NUMBER_KEY]!=nil;
|
||||
BOOL hasPassKey = [UICKeyChainStore stringForKey:SAVED_PASSWORD_KEY]!=nil;
|
||||
BOOL hasSignaling = [UICKeyChainStore dataForKey:SIGNALING_MAC_KEY]!=nil;
|
||||
BOOL hasCipherKey = [UICKeyChainStore dataForKey:SIGNALING_CIPHER_KEY]!=nil;
|
||||
BOOL hasZIDKey = [UICKeyChainStore dataForKey:ZID_KEY]!=nil;
|
||||
BOOL hasSignalingExtra = [UICKeyChainStore dataForKey:SIGNALING_EXTRA_KEY]!=nil;
|
||||
|
||||
BOOL registered = [[NSUserDefaults.standardUserDefaults objectForKey:@"isRegistered"] boolValue];
|
||||
|
||||
return registered && hasLocalNumber && hasPassKey && hasSignaling
|
||||
&& hasCipherKey && hasZIDKey && hasSignalingExtra;
|
||||
}
|
||||
|
||||
+ (void)migrateKeyingStorageToVersion2Dot0{
|
||||
// if statements ensure that if this migration is called more than once for whatever reason, the original data isn't rewritten the second time
|
||||
if([UICKeyChainStore stringForKey:LOCAL_NUMBER_KEY]!=nil) {
|
||||
[SignalKeyingStorage storeString:[UICKeyChainStore stringForKey:LOCAL_NUMBER_KEY] forKey:LOCAL_NUMBER_KEY];
|
||||
}
|
||||
if([UICKeyChainStore stringForKey:PASSWORD_COUNTER_KEY]!=nil) {
|
||||
[SignalKeyingStorage storeString:[UICKeyChainStore stringForKey:PASSWORD_COUNTER_KEY] forKey:PASSWORD_COUNTER_KEY];
|
||||
}
|
||||
if([UICKeyChainStore stringForKey:SAVED_PASSWORD_KEY]!=nil) {
|
||||
[SignalKeyingStorage storeString:[UICKeyChainStore stringForKey:SAVED_PASSWORD_KEY] forKey:SAVED_PASSWORD_KEY];
|
||||
}
|
||||
if([UICKeyChainStore dataForKey:SIGNALING_MAC_KEY]!=nil) {
|
||||
[SignalKeyingStorage storeData:[UICKeyChainStore dataForKey:SIGNALING_MAC_KEY] forKey:SIGNALING_MAC_KEY];
|
||||
}
|
||||
if([UICKeyChainStore dataForKey:SIGNALING_CIPHER_KEY]!=nil) {
|
||||
[SignalKeyingStorage storeData:[UICKeyChainStore dataForKey:SIGNALING_CIPHER_KEY] forKey:SIGNALING_CIPHER_KEY];
|
||||
}
|
||||
if([UICKeyChainStore dataForKey:ZID_KEY]!=nil) {
|
||||
[SignalKeyingStorage storeData:[UICKeyChainStore dataForKey:ZID_KEY] forKey:ZID_KEY];
|
||||
}
|
||||
if([UICKeyChainStore dataForKey:SIGNALING_EXTRA_KEY]!=nil) {
|
||||
[SignalKeyingStorage storeData:[UICKeyChainStore dataForKey:SIGNALING_EXTRA_KEY] forKey:SIGNALING_EXTRA_KEY];
|
||||
}
|
||||
// Erasing keys in the old key chain store
|
||||
[UICKeyChainStore removeItemForKey:LOCAL_NUMBER_KEY];
|
||||
[UICKeyChainStore removeItemForKey:PASSWORD_COUNTER_KEY];
|
||||
[UICKeyChainStore removeItemForKey:SAVED_PASSWORD_KEY];
|
||||
[UICKeyChainStore removeItemForKey:SIGNALING_MAC_KEY];
|
||||
[UICKeyChainStore removeItemForKey:SIGNALING_CIPHER_KEY];
|
||||
[UICKeyChainStore removeItemForKey:ZID_KEY];
|
||||
[UICKeyChainStore removeItemForKey:SIGNALING_EXTRA_KEY];
|
||||
}
|
||||
|
||||
+ (BOOL)isMigratingTo2Dot0{
|
||||
return [self userDefaultsBoolForKey:IS_MIGRATING_FROM_1DOT0_TO_LARGER_KEY];
|
||||
}
|
||||
|
||||
+ (void)clearMigrationFlag{
|
||||
[[NSUserDefaults standardUserDefaults] removeObjectForKey:IS_MIGRATING_FROM_1DOT0_TO_LARGER_KEY];
|
||||
}
|
||||
|
||||
#pragma mark Upgrading to 2.1 - Needs to register VOIP token + Removing video cache folder
|
||||
|
||||
+ (void)nonBlockingPushRegistration{
|
||||
__block failedVerificationBlock failedBlock = ^(NSError *error) {
|
||||
DDLogError(@"Failed to register VOIP push token: %@", error.debugDescription);
|
||||
};
|
||||
[[PushManager sharedManager] requestPushTokenWithSuccess:^(NSData *pushToken, NSData *voipToken) {
|
||||
[TSAccountManager registerForPushNotifications:pushToken voipToken:voipToken success:^{
|
||||
DDLogWarn(@"Registered for VOIP Push.");
|
||||
} failure:failedBlock];
|
||||
} failure:failedBlock];
|
||||
|
||||
}
|
||||
|
||||
+ (void)blockingPushRegistration{
|
||||
[UIApplication.sharedApplication setNetworkActivityIndicatorVisible:YES];
|
||||
LIControllerBlockingOperation blockingOperation = ^BOOL(void){
|
||||
[[NSUserDefaults standardUserDefaults] setObject:@YES forKey:NEEDS_TO_REGISTER_PUSH_KEY];
|
||||
|
||||
UIAlertController *waitingController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"Upgrading Signal ...", nil)
|
||||
message:nil
|
||||
preferredStyle:UIAlertControllerStyleAlert];
|
||||
__block dispatch_semaphore_t sema = dispatch_semaphore_create(0);
|
||||
|
||||
[[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:waitingController
|
||||
animated:YES
|
||||
completion:nil];
|
||||
__block BOOL success;
|
||||
|
||||
__block failedPushRegistrationBlock failure = ^(NSError *error) {
|
||||
[self refreshPushLock:waitingController];
|
||||
__block failedVerificationBlock failedBlock = ^(NSError *error) {
|
||||
success = NO;
|
||||
dispatch_semaphore_signal(sema);
|
||||
};
|
||||
|
||||
[[PushManager sharedManager] requestPushTokenWithSuccess:^(NSData *pushToken, NSData *voipToken) {
|
||||
[TSAccountManager registerForPushNotifications:pushToken voipToken:voipToken success:^{
|
||||
[UIApplication.sharedApplication setNetworkActivityIndicatorVisible:NO];
|
||||
success = YES;
|
||||
dispatch_semaphore_signal(sema);
|
||||
} failure:failedBlock];
|
||||
} failure:failedBlock];
|
||||
|
||||
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
|
||||
|
||||
return success;
|
||||
};
|
||||
|
||||
LIControllerRetryBlock retryBlock = [LockInteractionController defaultNetworkRetry];
|
||||
|
||||
[LockInteractionController performBlock:blockingOperation
|
||||
completionBlock:^{
|
||||
[[NSUserDefaults standardUserDefaults] removeObjectForKey:NEEDS_TO_REGISTER_PUSH_KEY];
|
||||
[waitingController dismissViewControllerAnimated:YES completion:nil];
|
||||
} failure:failure];
|
||||
} failure:failure];
|
||||
DDLogWarn(@"Successfully migrated to 2.1");
|
||||
}
|
||||
retryBlock:retryBlock
|
||||
usesNetwork:YES];
|
||||
|
||||
+ (void)refreshPushLock:(UIAlertController*)waitingController {
|
||||
[UIApplication.sharedApplication setNetworkActivityIndicatorVisible:NO];
|
||||
[waitingController dismissViewControllerAnimated:NO completion:^{
|
||||
UIAlertController *retryController = [UIAlertController alertControllerWithTitle:@"Upgrading Signal failed"
|
||||
message:@"An error occured while upgrading, please try again."
|
||||
preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
||||
[retryController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"REGISTER_FAILED_TRY_AGAIN", nil)
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction *action) {
|
||||
[self blockingPushRegistration];
|
||||
}]];
|
||||
|
||||
[[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:retryController
|
||||
animated:YES
|
||||
completion:nil];
|
||||
}];
|
||||
}
|
||||
|
||||
+ (BOOL)needsRegisterPush {
|
||||
|
@ -293,9 +136,56 @@
|
|||
if([[NSFileManager defaultManager] fileExistsAtPath:basePath]){
|
||||
[NSFileManager.defaultManager removeItemAtPath:basePath error:&error];
|
||||
}
|
||||
|
||||
if (error) {
|
||||
DDLogError(@"An error occured while removing the videos cache folder from old location: %@",
|
||||
error.debugDescription);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark Upgrading to 2.1.3 - Adding VOIP flag on TS Server
|
||||
|
||||
+ (BOOL)needsRegisterAttributes {
|
||||
return [self userDefaultsBoolForKey:NEEDS_TO_REGISTER_ATTRIBUTES];
|
||||
}
|
||||
|
||||
+ (void)blockingAttributesUpdate {
|
||||
LIControllerBlockingOperation blockingOperation = ^BOOL(void){
|
||||
[[NSUserDefaults standardUserDefaults] setObject:@YES forKey:NEEDS_TO_REGISTER_ATTRIBUTES];
|
||||
|
||||
__block dispatch_semaphore_t sema = dispatch_semaphore_create(0);
|
||||
|
||||
__block BOOL success;
|
||||
|
||||
TSUpdateAttributesRequest *request = [[TSUpdateAttributesRequest alloc] initWithUpdatedAttributes];
|
||||
[[TSNetworkManager sharedManager] queueAuthenticatedRequest:request success:^(NSURLSessionDataTask *task, id responseObject) {
|
||||
success = YES;
|
||||
dispatch_semaphore_signal(sema);
|
||||
} failure:^(NSURLSessionDataTask *task, NSError *error) {
|
||||
success = NO;
|
||||
DDLogError(@"Updating attributess failed with error: %@", error.description);
|
||||
dispatch_semaphore_signal(sema);
|
||||
}];
|
||||
|
||||
|
||||
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
|
||||
|
||||
return success;
|
||||
};
|
||||
|
||||
LIControllerRetryBlock retryBlock = [LockInteractionController defaultNetworkRetry];
|
||||
|
||||
[LockInteractionController performBlock:blockingOperation
|
||||
completionBlock:^{
|
||||
[[NSUserDefaults standardUserDefaults] removeObjectForKey:NEEDS_TO_REGISTER_ATTRIBUTES];
|
||||
DDLogWarn(@"Successfully updated attributes.");
|
||||
}
|
||||
retryBlock:retryBlock
|
||||
usesNetwork:YES];
|
||||
|
||||
}
|
||||
|
||||
#pragma mark Util
|
||||
|
||||
+ (BOOL)userDefaultsBoolForKey:(NSString*)key {
|
||||
NSNumber *num = [[NSUserDefaults standardUserDefaults] objectForKey:key];
|
||||
|
|
|
@ -7,8 +7,7 @@
|
|||
#import "PreferencesUtil.h"
|
||||
#import "RPServerRequestsManager.h"
|
||||
#import "ThreadManager.h"
|
||||
#import "TSContactsIntersectionRequest.h"
|
||||
#import "TSStorageManager.h"
|
||||
#import "TSNetworkManager.h"
|
||||
#import "TSRecipient.h"
|
||||
#import "Util.h"
|
||||
|
||||
|
|
|
@ -18,9 +18,6 @@
|
|||
#import "TSSocketManager.h"
|
||||
#import "TSStorageManager+keyingMaterial.h"
|
||||
#import "TSPreKeyManager.h"
|
||||
#import "TSRegisterForPushRequest.h"
|
||||
#import "TSRegisterWithTokenRequest.h"
|
||||
#import "TSUnregisterAccountRequest.h"
|
||||
|
||||
@interface TSAccountManager ()
|
||||
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// TSAttributes.h
|
||||
// Signal
|
||||
//
|
||||
// Created by Frederic Jacobs on 22/08/15.
|
||||
// Copyright (c) 2015 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface TSAttributes : NSObject
|
||||
|
||||
+ (NSDictionary*)attributesFromStorage;
|
||||
+ (NSDictionary*)attributesWithSignalingKey:(NSString*)signalingKey
|
||||
serverAuthToken:(NSString*)authToken;
|
||||
|
||||
@end
|
|
@ -0,0 +1,33 @@
|
|||
//
|
||||
// TSAttributes.m
|
||||
// Signal
|
||||
//
|
||||
// Created by Frederic Jacobs on 22/08/15.
|
||||
// Copyright (c) 2015 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
|
||||
#import "TSAttributes.h"
|
||||
|
||||
#import "TSAccountManager.h"
|
||||
#import "TSStorageHeaders.h"
|
||||
|
||||
@implementation TSAttributes
|
||||
|
||||
|
||||
+ (NSDictionary*)attributesFromStorage {
|
||||
return [self attributesWithSignalingKey:[TSStorageManager signalingKey]
|
||||
serverAuthToken:[TSStorageManager serverAuthToken]];
|
||||
}
|
||||
|
||||
+ (NSDictionary*)attributesWithSignalingKey:(NSString*)signalingKey
|
||||
serverAuthToken:(NSString*)authToken
|
||||
|
||||
{
|
||||
return @{@"signalingKey" : signalingKey,
|
||||
@"AuthKey" : authToken,
|
||||
@"voice" : @YES,
|
||||
@"registrationId": [NSString stringWithFormat:@"%i",[TSAccountManager getOrGenerateRegistrationId]]
|
||||
};
|
||||
}
|
||||
|
||||
@end
|
|
@ -8,14 +8,8 @@
|
|||
|
||||
#import "TSPreKeyManager.h"
|
||||
|
||||
#import "TSAvailablePreKeysCountRequest.h"
|
||||
#import "TSCurrentSignedPreKeyRequest.h"
|
||||
#import "TSStorageManager.h"
|
||||
#import "TSStorageManager+PreKeyStore.h"
|
||||
#import "TSStorageManager+SignedPreKeyStore.h"
|
||||
#import "TSStorageManager+IdentityKeyStore.h"
|
||||
#import "TSStorageHeaders.h"
|
||||
#import "TSNetworkManager.h"
|
||||
#import "TSRegisterPrekeysRequest.h"
|
||||
|
||||
#define EPHEMERAL_PREKEYS_MINIMUM 15
|
||||
|
||||
|
|
|
@ -11,9 +11,7 @@
|
|||
|
||||
#import "Cryptography.h"
|
||||
|
||||
#import "TSAllocAttachmentRequest.h"
|
||||
#import "TSAttachmentPointer.h"
|
||||
#import "TSAttachmentRequest.h"
|
||||
#import "TSInfoMessage.h"
|
||||
#import "TSMessagesManager+attachments.h"
|
||||
#import "TSMessagesManager+sendMessages.h"
|
||||
|
|
|
@ -17,18 +17,12 @@
|
|||
#import "PreferencesUtil.h"
|
||||
#import "NSData+messagePadding.h"
|
||||
#import "TSStorageManager.h"
|
||||
#import "TSStorageManager+SessionStore.h"
|
||||
#import "TSStorageManager+IdentityKeyStore.h"
|
||||
#import "TSStorageManager+PreKeyStore.h"
|
||||
#import "TSStorageManager+SignedPreKeyStore.h"
|
||||
|
||||
#import "PreKeyBundle+jsonDict.h"
|
||||
#import "SignalKeyingStorage.h"
|
||||
|
||||
#import "TSNetworkManager.h"
|
||||
#import "TSServerMessage.h"
|
||||
#import "TSSubmitMessageRequest.h"
|
||||
#import "TSRecipientPrekeyRequest.h"
|
||||
|
||||
#import "TSInfoMessage.h"
|
||||
|
||||
|
|
|
@ -18,11 +18,7 @@
|
|||
#import "TSInfoMessage.h"
|
||||
|
||||
#import "TSDatabaseView.h"
|
||||
#import "TSStorageManager+keyingMaterial.h"
|
||||
#import "TSStorageManager+IdentityKeyStore.h"
|
||||
#import "TSStorageManager+SessionStore.h"
|
||||
#import "TSStorageManager+SignedPreKeyStore.h"
|
||||
#import "TSStorageManager+PreKeyStore.h"
|
||||
#import "TSStorageManager.h"
|
||||
#import "TSMessagesManager+attachments.h"
|
||||
|
||||
#import "SignalKeyingStorage.h"
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
|
||||
#import "TSRequest.h"
|
||||
|
||||
#import "TSNetworkManager.h"
|
||||
|
||||
@interface TSContactsIntersectionRequest : TSRequest
|
||||
|
||||
- (id)initWithHashesArray:(NSArray*)hashes;
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
@interface TSRegisterWithTokenRequest : TSRequest
|
||||
|
||||
- (TSRequest*) initWithVerificationToken:(NSString*)verificationCode signalingKey:(NSString*)signalingKey authKey:(NSString*)authKey number:(NSString*)number;
|
||||
- (instancetype)initWithVerificationToken:(NSString*)verificationCode signalingKey:(NSString*)signalingKey authKey:(NSString*)authKey number:(NSString*)number;
|
||||
|
||||
@property NSString *numberToValidate;
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
#import "TSConstants.h"
|
||||
#import "TSAccountManager.h"
|
||||
#import "TSAttributes.h"
|
||||
#import "TSRegisterWithTokenRequest.h"
|
||||
|
||||
@implementation TSRegisterWithTokenRequest
|
||||
|
@ -21,10 +22,9 @@
|
|||
|
||||
self.numberToValidate = number;
|
||||
|
||||
[self.parameters addEntriesFromDictionary:@{@"signalingKey": signalingKey,
|
||||
@"AuthKey": authKey,
|
||||
@"supportsSMS": @"0",
|
||||
@"registrationId": [NSString stringWithFormat:@"%i",[TSAccountManager getOrGenerateRegistrationId]]}];
|
||||
NSDictionary *attributes = [TSAttributes attributesWithSignalingKey:signalingKey serverAuthToken:authKey];
|
||||
|
||||
[self.parameters addEntriesFromDictionary:attributes];
|
||||
|
||||
[self setHTTPMethod:@"PUT"];
|
||||
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
//
|
||||
// TSUpdateAttributesRequest.h
|
||||
// Signal
|
||||
//
|
||||
// Created by Frederic Jacobs on 22/08/15.
|
||||
// Copyright (c) 2015 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
|
||||
#import "TSRequest.h"
|
||||
|
||||
@interface TSUpdateAttributesRequest : TSRequest
|
||||
|
||||
- (instancetype)initWithUpdatedAttributes;
|
||||
|
||||
@end
|
|
@ -0,0 +1,28 @@
|
|||
//
|
||||
// TSUpdateAttributesRequest.m
|
||||
// Signal
|
||||
//
|
||||
// Created by Frederic Jacobs on 22/08/15.
|
||||
// Copyright (c) 2015 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
|
||||
#import "TSConstants.h"
|
||||
#import "TSUpdateAttributesRequest.h"
|
||||
#import "TSAttributes.h"
|
||||
|
||||
@implementation TSUpdateAttributesRequest
|
||||
|
||||
- (instancetype)initWithUpdatedAttributes
|
||||
{
|
||||
NSString *endPoint = [textSecureAccountsAPI stringByAppendingString:textSecureAttributesAPI];
|
||||
self = [super initWithURL:[NSURL URLWithString:endPoint]];
|
||||
|
||||
if (self) {
|
||||
[self setHTTPMethod:@"PUT"];
|
||||
[self.parameters addEntriesFromDictionary:[TSAttributes attributesFromStorage]];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
|
@ -6,9 +6,26 @@
|
|||
// Copyright (c) 2013 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
|
||||
/**
|
||||
* TSNetworkManager imports all TSRequests to prevent massive imports
|
||||
in classes that call TSNetworkManager
|
||||
*/
|
||||
#import "TSAllocAttachmentRequest.h"
|
||||
#import "TSAttachmentRequest.h"
|
||||
#import "TSAvailablePreKeysCountRequest.h"
|
||||
#import "TSContactsIntersectionRequest.h"
|
||||
#import "TSCurrentSignedPreKeyRequest.h"
|
||||
#import "TSRecipientPrekeyRequest.h"
|
||||
#import "TSRegisterForPushRequest.h"
|
||||
#import "TSRegisterPrekeysRequest.h"
|
||||
#import "TSRegisterWithTokenRequest.h"
|
||||
#import "TSSubmitMessageRequest.h"
|
||||
#import "TSUnregisterAccountRequest.h"
|
||||
#import "TSUpdateAttributesRequest.h"
|
||||
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <AFNetworking/AFHTTPRequestOperationManager.h>
|
||||
#import "TSRequest.h"
|
||||
|
||||
@interface TSNetworkManager : NSObject
|
||||
|
||||
|
|
|
@ -5,13 +5,15 @@
|
|||
// Created by Frederic Jacobs on 06/11/14.
|
||||
// Copyright (c) 2014 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
#import "TSStorageManager+IdentityKeyStore.h"
|
||||
|
||||
|
||||
#import "TSStorageManager+SignedPreKeyStore.h"
|
||||
#import "TSStorageManager+IdentityKeyStore.h"
|
||||
#import "TSStorageManager+keyFromIntLong.h"
|
||||
|
||||
#import <AxolotlKit/AxolotlExceptions.h>
|
||||
#import <25519/Ed25519.h>
|
||||
#import <AxolotlKit/NSData+keyVersionByte.h>
|
||||
#import "TSStorageManager+keyFromIntLong.h"
|
||||
|
||||
|
||||
@implementation TSStorageManager (SignedPreKeyStore)
|
||||
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
//
|
||||
// TSStorageHeaders.h
|
||||
// Signal
|
||||
//
|
||||
// Created by Frederic Jacobs on 22/08/15.
|
||||
// Copyright (c) 2015 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef Signal_TSStorageHeaders_h
|
||||
#define Signal_TSStorageHeaders_h
|
||||
|
||||
#import "TSStorageManager.h"
|
||||
|
||||
#import "TSStorageManager+keyingMaterial.h"
|
||||
#import "TSStorageManager+messageIDs.h"
|
||||
#import "TSStorageManager+PreKeyStore.h"
|
||||
#import "TSStorageManager+SessionStore.h"
|
||||
#import "TSStorageManager+keyFromIntLong.h"
|
||||
#import "TSStorageManager+IdentityKeyStore.h"
|
||||
#import "TSStorageManager+SignedPreKeyStore.h"
|
||||
|
||||
#endif
|
|
@ -37,6 +37,8 @@ typedef enum {
|
|||
|
||||
#define textSecureGeneralAPI @"v1"
|
||||
#define textSecureAccountsAPI @"v1/accounts"
|
||||
#define textSecureAttributesAPI @"/attributes/"
|
||||
|
||||
#define textSecureMessagesAPI @"v1/messages/"
|
||||
#define textSecureKeysAPI @"v2/keys"
|
||||
#define textSecureSignedKeysAPI @"v2/keys/signed"
|
||||
|
|
|
@ -11,14 +11,12 @@
|
|||
#import <AxolotlKit/NSData+keyVersionByte.h>
|
||||
#import <25519/Curve25519.h>
|
||||
#import "DJWActionSheet+OWS.h"
|
||||
#import "TSStorageManager.h"
|
||||
#import "TSStorageManager+IdentityKeyStore.h"
|
||||
#import "TSStorageManager+SessionStore.h"
|
||||
#import "PresentIdentityQRCodeViewController.h"
|
||||
#import "ScanIdentityBarcodeViewController.h"
|
||||
#import "SignalsNavigationController.h"
|
||||
|
||||
#import "TSFingerprintGenerator.h"
|
||||
#import "TSStorageHeaders.h"
|
||||
|
||||
@interface FingerprintViewController ()
|
||||
@property TSContactThread *thread;
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
//
|
||||
// LockInteractionController.h
|
||||
// Signal
|
||||
//
|
||||
// Created by Frederic Jacobs on 22/08/15.
|
||||
// Copyright (c) 2015 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface LockInteractionController : NSObject
|
||||
|
||||
typedef void (^LIControllerCompletionBlock)();
|
||||
typedef BOOL (^LIControllerBlockingOperation)();
|
||||
typedef void (^LIControllerRetryBlock)(LIControllerBlockingOperation operationBlock, LIControllerCompletionBlock completionBlock);
|
||||
|
||||
+ (void)performBlock:(LIControllerBlockingOperation)blockingOperation
|
||||
completionBlock:(LIControllerCompletionBlock)completionBlock
|
||||
retryBlock:(LIControllerRetryBlock)retryBlock
|
||||
usesNetwork:(BOOL)networkFlag;
|
||||
|
||||
+ (LIControllerRetryBlock)defaultNetworkRetry;
|
||||
|
||||
@end
|
|
@ -0,0 +1,85 @@
|
|||
//
|
||||
// LockInteractionController.m
|
||||
// Signal
|
||||
//
|
||||
// Created by Frederic Jacobs on 22/08/15.
|
||||
// Copyright (c) 2015 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
|
||||
#import "LockInteractionController.h"
|
||||
|
||||
@interface LockInteractionController ()
|
||||
@property UIAlertController *alertController;
|
||||
@end
|
||||
|
||||
@implementation LockInteractionController
|
||||
|
||||
MacrosSingletonImplemention
|
||||
|
||||
+ (void)performBlock:(LIControllerBlockingOperation)blockingOperation
|
||||
completionBlock:(LIControllerCompletionBlock)completionBlock
|
||||
retryBlock:(LIControllerRetryBlock)retryBlock
|
||||
usesNetwork:(BOOL)networkFlag
|
||||
|
||||
{
|
||||
|
||||
|
||||
if (networkFlag) {
|
||||
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:networkFlag];
|
||||
}
|
||||
|
||||
LockInteractionController *sharedInstance = [LockInteractionController sharedInstance];
|
||||
sharedInstance.alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"Upgrading Signal ...", nil)
|
||||
message:nil
|
||||
preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
||||
[[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:sharedInstance.alertController
|
||||
animated:YES
|
||||
completion:nil];
|
||||
|
||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
||||
BOOL success = blockingOperation();
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[sharedInstance.alertController dismissViewControllerAnimated:YES completion:^{
|
||||
if (networkFlag) {
|
||||
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];
|
||||
}
|
||||
|
||||
if (!success) {
|
||||
retryBlock(blockingOperation, completionBlock);
|
||||
} else {
|
||||
completionBlock();
|
||||
}
|
||||
}];
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
+ (LIControllerRetryBlock)defaultNetworkRetry
|
||||
{
|
||||
LIControllerRetryBlock retryBlock = ^void(LIControllerBlockingOperation blockingOperation, LIControllerCompletionBlock completionBlock) {
|
||||
UIAlertController *retryController = [UIAlertController alertControllerWithTitle:@"Upgrading Signal failed"
|
||||
message:@"An network error occured while upgrading, please check your connectivity and try again."
|
||||
preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
||||
[retryController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"REGISTER_FAILED_TRY_AGAIN", nil)
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction *action) {
|
||||
[self performBlock:blockingOperation
|
||||
completionBlock:completionBlock
|
||||
retryBlock:[LockInteractionController defaultNetworkRetry]
|
||||
usesNetwork:YES];
|
||||
}]];
|
||||
|
||||
[[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:retryController
|
||||
animated:YES
|
||||
completion:nil];
|
||||
};
|
||||
|
||||
return retryBlock;
|
||||
}
|
||||
|
||||
@end
|
|
@ -24,7 +24,6 @@
|
|||
#import "DJWActionSheet+OWS.h"
|
||||
#import <MobileCoreServices/UTCoreTypes.h>
|
||||
|
||||
#import "TSStorageManager.h"
|
||||
#import "TSDatabaseView.h"
|
||||
#import "UIButton+OWS.h"
|
||||
#import <YapDatabase/YapDatabaseView.h>
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#import "Environment.h"
|
||||
#import "PreferencesUtil.h"
|
||||
#import "TSFingerprintGenerator.h"
|
||||
#import "TSStorageManager+IdentityKeyStore.h"
|
||||
#import "UIUtil.h"
|
||||
|
||||
@interface PrivacySettingsTableViewController ()
|
||||
|
|
|
@ -92,7 +92,7 @@ static NSString* const kShowSignupFlowSegue = @"showSignupFlow";
|
|||
[super viewWillAppear:animated];
|
||||
[self checkIfEmptyView];
|
||||
|
||||
if (![TSAccountManager isRegistered] && ![VersionMigrations isMigrating]){
|
||||
if (![TSAccountManager isRegistered]){
|
||||
[self performSegueWithIdentifier:kShowSignupFlowSegue sender:self];
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,130 +0,0 @@
|
|||
//
|
||||
// VersionMigrationsTests.m
|
||||
// TextSecureKit
|
||||
//
|
||||
// Created by Frederic Jacobs on 06/11/14.
|
||||
// Copyright (c) 2014 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
|
||||
#import <XCTest/XCTest.h>
|
||||
#import "VersionMigrations.h"
|
||||
|
||||
#import "CategorizingLogger.h"
|
||||
#import "Cryptography.h"
|
||||
#import "Environment.h"
|
||||
#import "TSStorageManager.h"
|
||||
#import "RecentCall.h"
|
||||
#import "RecentCallManager.h"
|
||||
#import "Release.h"
|
||||
#import "TestUtil.h"
|
||||
#import "TSCall.h"
|
||||
#import "TSDatabaseView.h"
|
||||
#import "SignalKeyingStorage.h"
|
||||
#import "UICKeyChainStore.h"
|
||||
|
||||
|
||||
@interface VersionMigrations(Testing)
|
||||
+(void) migrateRecentCallsToVersion2Dot0;
|
||||
+(void) migrateKeyingStorageToVersion2Dot0;
|
||||
@end
|
||||
|
||||
|
||||
@interface SignalKeyingStorage(Testing)
|
||||
+(void)storeData:(NSData*)data forKey:(NSString*)key;
|
||||
+(NSData*)dataForKey:(NSString*)key;
|
||||
+(void)storeString:(NSString*)string forKey:(NSString*)key;
|
||||
+(NSString*)stringForKey:(NSString*)key;
|
||||
@end
|
||||
|
||||
@interface TSDatabaseView(Testing)
|
||||
+ (BOOL)threadShouldBeInInbox:(TSThread*)thread;
|
||||
@end
|
||||
|
||||
|
||||
@interface VersionMigrationsTests : XCTestCase
|
||||
@property (nonatomic,strong) NSString* localNumber;
|
||||
@property (nonatomic,strong) NSString* passwordCounter;
|
||||
@property (nonatomic,strong) NSString* savedPassword;
|
||||
|
||||
@property (nonatomic,strong) NSData* signalingMacKey;
|
||||
@property (nonatomic,strong) NSData* signalingCipherKey;
|
||||
@property (nonatomic,strong) NSData* zidKey;
|
||||
@property (nonatomic,strong) NSData* signalingExtraKey;
|
||||
@property (nonatomic,strong) NSMutableArray* recentCalls;
|
||||
@end
|
||||
|
||||
@implementation VersionMigrationsTests
|
||||
|
||||
- (void)setUp {
|
||||
[super setUp];
|
||||
[Environment setCurrent:[Release unitTestEnvironment:@[]]];
|
||||
|
||||
|
||||
_localNumber = @"+123456789";
|
||||
_passwordCounter = @"20";
|
||||
_savedPassword = @"muchlettersverysecure";
|
||||
_signalingMacKey = [Cryptography generateRandomBytes:8];
|
||||
_signalingCipherKey = [Cryptography generateRandomBytes:8];
|
||||
_zidKey = [Cryptography generateRandomBytes:8];
|
||||
_signalingExtraKey = [Cryptography generateRandomBytes:8];
|
||||
|
||||
// setup the keys
|
||||
[UICKeyChainStore setString:_localNumber forKey:LOCAL_NUMBER_KEY];
|
||||
[UICKeyChainStore setString:_passwordCounter forKey:PASSWORD_COUNTER_KEY];
|
||||
[UICKeyChainStore setString:_savedPassword forKey:SAVED_PASSWORD_KEY];
|
||||
[UICKeyChainStore setData:_signalingMacKey forKey:SIGNALING_MAC_KEY];
|
||||
[UICKeyChainStore setData:_signalingCipherKey forKey:SIGNALING_CIPHER_KEY];
|
||||
[UICKeyChainStore setData:_zidKey forKey:ZID_KEY];
|
||||
[UICKeyChainStore setData:_signalingExtraKey forKey:SIGNALING_EXTRA_KEY];
|
||||
|
||||
// setup the recent calls
|
||||
RecentCall* r1 = [RecentCall recentCallWithContactID:123
|
||||
andNumber:testPhoneNumber1
|
||||
andCallType:RPRecentCallTypeIncoming];
|
||||
RecentCall* r2 = [RecentCall recentCallWithContactID:456
|
||||
andNumber:testPhoneNumber2
|
||||
andCallType:RPRecentCallTypeMissed];
|
||||
|
||||
r2.isArchived = YES;
|
||||
|
||||
_recentCalls = [[NSMutableArray alloc] initWithObjects:r1,r2,nil];
|
||||
|
||||
NSUserDefaults *defaults = NSUserDefaults.standardUserDefaults;
|
||||
NSData *saveData = [NSKeyedArchiver archivedDataWithRootObject:_recentCalls.copy];
|
||||
[defaults setObject:saveData forKey:RECENT_CALLS_DEFAULT_KEY];
|
||||
[defaults synchronize];
|
||||
|
||||
}
|
||||
|
||||
- (void)tearDown {
|
||||
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
||||
[super tearDown];
|
||||
}
|
||||
|
||||
- (void)testMigrateKeyingStorageToVersion2Dot0 {
|
||||
// migrate keying storage
|
||||
[VersionMigrations migrateKeyingStorageToVersion2Dot0];
|
||||
|
||||
// checking that everything is migrated correctly
|
||||
XCTAssert([[SignalKeyingStorage stringForKey:LOCAL_NUMBER_KEY] isEqualToString:_localNumber]);
|
||||
XCTAssert([[SignalKeyingStorage stringForKey:PASSWORD_COUNTER_KEY] isEqualToString:_passwordCounter]);
|
||||
XCTAssert([[SignalKeyingStorage stringForKey:SAVED_PASSWORD_KEY] isEqualToString:_savedPassword]);
|
||||
|
||||
XCTAssert([[SignalKeyingStorage dataForKey:SIGNALING_MAC_KEY] isEqualToData:_signalingMacKey]);
|
||||
XCTAssert([[SignalKeyingStorage dataForKey:SIGNALING_CIPHER_KEY] isEqualToData:_signalingCipherKey]);
|
||||
XCTAssert([[SignalKeyingStorage dataForKey:ZID_KEY] isEqualToData:_zidKey]);
|
||||
XCTAssert([[SignalKeyingStorage dataForKey:SIGNALING_EXTRA_KEY] isEqualToData:_signalingExtraKey]);
|
||||
|
||||
// checking that the old storage is empty
|
||||
XCTAssert([UICKeyChainStore stringForKey:LOCAL_NUMBER_KEY] == nil);
|
||||
XCTAssert([UICKeyChainStore stringForKey:PASSWORD_COUNTER_KEY] == nil);
|
||||
XCTAssert([UICKeyChainStore stringForKey:SAVED_PASSWORD_KEY] == nil);
|
||||
|
||||
XCTAssert([UICKeyChainStore dataForKey:SIGNALING_MAC_KEY] == nil);
|
||||
XCTAssert([UICKeyChainStore dataForKey:SIGNALING_CIPHER_KEY] == nil);
|
||||
XCTAssert([UICKeyChainStore dataForKey:ZID_KEY] == nil);
|
||||
XCTAssert([UICKeyChainStore dataForKey:SIGNALING_EXTRA_KEY] == nil);
|
||||
|
||||
}
|
||||
|
||||
@end
|
Loading…
Reference in New Issue