Refactoring signup flow, storage, contacts.

- Signal preferences and keying material moved to the unified storage
- Set up for staging environment to try out the new APIs
- Changes in the push registration flow to send token to RP & TS
This commit is contained in:
Frederic Jacobs 2014-11-21 00:51:23 +01:00
parent d876d8a156
commit 6dd04a49fe
39 changed files with 324 additions and 313 deletions

View File

@ -12,7 +12,7 @@ pod 'AxolotlKit', '~> 0.1'
pod 'PastelogKit', '~> 1.2'
pod 'TwistedOakCollapsingFutures','~> 1.0'
pod 'YapDatabase/SQLCipher'
pod 'AFNetworking', '~> 2.4'
pod 'AFNetworking', '~> 2.5'
pod 'Mantle', '~> 1.5'
pod 'JSQMessagesViewController', :git => 'https://github.com/dtsbourg/JSQMessagesViewController', :branch => 'JSignalQ'

View File

@ -58,7 +58,7 @@ PODS:
- YapDatabase/common
DEPENDENCIES:
- AFNetworking (~> 2.4)
- AFNetworking (~> 2.5)
- AxolotlKit (~> 0.1)
- DJWActionSheet
- JSQMessagesViewController (from `https://github.com/dtsbourg/JSQMessagesViewController`, branch `JSignalQ`)

2
Pods

@ -1 +1 @@
Subproject commit 5f331e11627a49c73b1f7b6b8b55c97a78008bfe
Subproject commit bc9ebd5dc7fb4100c78e5bb4dda15cfcc3b6734a

View File

@ -153,7 +153,7 @@
76EB05FC18170B33006006FC /* CallConnectUtil_Server.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04A218170B33006006FC /* CallConnectUtil_Server.m */; };
76EB05FD18170B33006006FC /* CallConnectUtil_Server.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04A218170B33006006FC /* CallConnectUtil_Server.m */; };
76EB05FE18170B33006006FC /* InitiateSignal.pb.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04A418170B33006006FC /* InitiateSignal.pb.m */; settings = {COMPILER_FLAGS = "-w"; }; };
76EB05FF18170B33006006FC /* InitiateSignal.pb.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04A418170B33006006FC /* InitiateSignal.pb.m */; };
76EB05FF18170B33006006FC /* InitiateSignal.pb.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04A418170B33006006FC /* InitiateSignal.pb.m */; settings = {COMPILER_FLAGS = "-w"; }; };
76EB060118170B33006006FC /* InitiateSignal.proto in Resources */ = {isa = PBXBuildFile; fileRef = 76EB04A518170B33006006FC /* InitiateSignal.proto */; };
76EB060218170B33006006FC /* InitiatorSessionDescriptor.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04A718170B33006006FC /* InitiatorSessionDescriptor.m */; };
76EB060318170B33006006FC /* InitiatorSessionDescriptor.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04A718170B33006006FC /* InitiatorSessionDescriptor.m */; };
@ -420,6 +420,10 @@
B684A46D19C3446200B11029 /* PushManagerTest.m in Sources */ = {isa = PBXBuildFile; fileRef = B684A46C19C3446200B11029 /* PushManagerTest.m */; };
B6850E5A1995A4710068E715 /* whisperFake.cer in Resources */ = {isa = PBXBuildFile; fileRef = B6850E591995A4710068E715 /* whisperFake.cer */; };
B69CD25119773E79005CE69A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B69CD25019773E79005CE69A /* XCTest.framework */; };
B6AE33B91A1EB0AF003DF39D /* DemoDataFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = B6AE33B61A1EB0AF003DF39D /* DemoDataFactory.m */; };
B6AE33BA1A1EB0AF003DF39D /* DemoDataModel.m in Sources */ = {isa = PBXBuildFile; fileRef = B6AE33B81A1EB0AF003DF39D /* DemoDataModel.m */; };
B6AE33BD1A1EB121003DF39D /* GroupModel.m in Sources */ = {isa = PBXBuildFile; fileRef = B6AE33BC1A1EB121003DF39D /* GroupModel.m */; };
B6AE33C01A1EB2DD003DF39D /* Socket.m in Sources */ = {isa = PBXBuildFile; fileRef = B6AE33BF1A1EB2DD003DF39D /* Socket.m */; };
B6B095E41A1D25C5008BFAA6 /* CryptographyTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = B6B095DE1A1D25C5008BFAA6 /* CryptographyTests.mm */; };
B6B095E51A1D25C5008BFAA6 /* TextSecureKitTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B095DF1A1D25C5008BFAA6 /* TextSecureKitTests.m */; };
B6B095E61A1D25C5008BFAA6 /* TSMessageStorageTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B095E01A1D25C5008BFAA6 /* TSMessageStorageTests.m */; };
@ -476,7 +480,7 @@
B6B096931A1D25ED008BFAA6 /* NSData+messagePadding.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B0965C1A1D25ED008BFAA6 /* NSData+messagePadding.m */; };
B6B096941A1D25ED008BFAA6 /* NSString+escape.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B0965E1A1D25ED008BFAA6 /* NSString+escape.m */; };
B6B096951A1D25ED008BFAA6 /* NSURLSessionDataTask+StatusCode.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B096601A1D25ED008BFAA6 /* NSURLSessionDataTask+StatusCode.m */; };
B6B1013C196D213F007E3930 /* SGNKeychainUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B1013B196D213F007E3930 /* SGNKeychainUtil.m */; };
B6B1013C196D213F007E3930 /* SignalKeyingStorage.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B1013B196D213F007E3930 /* SignalKeyingStorage.m */; };
B6B9ECFC198B31BA00C620D3 /* PushManager.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B9ECFB198B31BA00C620D3 /* PushManager.m */; };
B6C93C4E199567AD00EDF894 /* DebugLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = B6C93C4D199567AD00EDF894 /* DebugLogger.m */; };
B90418E6183E9DD40038554A /* DateUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = B90418E5183E9DD40038554A /* DateUtil.m */; };
@ -572,15 +576,12 @@
FC31962A1A067D8F0094C78E /* MessageComposeTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FC3196291A067D8F0094C78E /* MessageComposeTableViewController.m */; };
FC31962D1A06A2190094C78E /* FingerprintViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FC31962C1A06A2190094C78E /* FingerprintViewController.m */; };
FC3196301A0814130094C78E /* SettingsTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FC31962F1A0814130094C78E /* SettingsTableViewController.m */; };
FC4FA0231A1B8A8D00DA100A /* Socket.m in Sources */ = {isa = PBXBuildFile; fileRef = FC4FA0221A1B8A8D00DA100A /* Socket.m */; };
FC4FA0261A1B9DC600DA100A /* SignalsNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = FC4FA0251A1B9DC600DA100A /* SignalsNavigationController.m */; };
FC4FA0331A1D46AE00DA100A /* InitialViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FC4FA0321A1D46AE00DA100A /* InitialViewController.m */; };
FCAC963519FEF4E20046DFC5 /* Storyboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FCAC963419FEF4E20046DFC5 /* Storyboard.storyboard */; };
FCAC963C19FEF9280046DFC5 /* SignalsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FCAC963B19FEF9280046DFC5 /* SignalsViewController.m */; };
FCAC964019FEF99A0046DFC5 /* TableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = FCAC963E19FEF99A0046DFC5 /* TableViewCell.m */; };
FCAC964119FEF99A0046DFC5 /* TableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = FCAC963F19FEF99A0046DFC5 /* TableViewCell.xib */; };
FCAC964419FEFD8B0046DFC5 /* DemoDataFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = FCAC964319FEFD8B0046DFC5 /* DemoDataFactory.m */; };
FCAC964719FEFE1A0046DFC5 /* DemoDataModel.m in Sources */ = {isa = PBXBuildFile; fileRef = FCAC964619FEFE1A0046DFC5 /* DemoDataModel.m */; };
FCAC964019FEF99A0046DFC5 /* InboxTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = FCAC963E19FEF99A0046DFC5 /* InboxTableViewCell.m */; };
FCAC964119FEF99A0046DFC5 /* InboxTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = FCAC963F19FEF99A0046DFC5 /* InboxTableViewCell.xib */; };
FCAC965119FF0A6E0046DFC5 /* MessagesViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FCAC965019FF0A6E0046DFC5 /* MessagesViewController.m */; };
FCAFC33F1A0F948F00AE5136 /* ActionContactDetailCell.m in Sources */ = {isa = PBXBuildFile; fileRef = FCAFC33E1A0F948F00AE5136 /* ActionContactDetailCell.m */; };
FCB11D8A1A1284BB002F93FB /* SettingsTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = FCB11D891A1284BB002F93FB /* SettingsTableViewCell.m */; };
@ -590,7 +591,6 @@
FCF72A131A02D27F006BC849 /* ContactDetailTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FCF72A111A02D27F006BC849 /* ContactDetailTableViewController.m */; };
FCF72A161A02D2BB006BC849 /* ContactDetailCell.m in Sources */ = {isa = PBXBuildFile; fileRef = FCF72A151A02D2BB006BC849 /* ContactDetailCell.m */; };
FCFD256F1A151BCB00F4C644 /* NewGroupViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FCFD256E1A151BCB00F4C644 /* NewGroupViewController.m */; };
FCFD25721A1524DB00F4C644 /* GroupModel.m in Sources */ = {isa = PBXBuildFile; fileRef = FCFD25711A1524DB00F4C644 /* GroupModel.m */; };
FCFD257F1A154B2C00F4C644 /* RegistrationViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FCFD257E1A154B2C00F4C644 /* RegistrationViewController.m */; };
FCFD25821A154B3800F4C644 /* CodeVerificationViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FCFD25811A154B3800F4C644 /* CodeVerificationViewController.m */; };
/* End PBXBuildFile section */
@ -1123,6 +1123,14 @@
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 = "<group>"; };
B69CD25019773E79005CE69A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
B6AE33B51A1EB0AF003DF39D /* DemoDataFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DemoDataFactory.h; sourceTree = "<group>"; };
B6AE33B61A1EB0AF003DF39D /* DemoDataFactory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DemoDataFactory.m; sourceTree = "<group>"; };
B6AE33B71A1EB0AF003DF39D /* DemoDataModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DemoDataModel.h; sourceTree = "<group>"; };
B6AE33B81A1EB0AF003DF39D /* DemoDataModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DemoDataModel.m; sourceTree = "<group>"; };
B6AE33BB1A1EB121003DF39D /* GroupModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GroupModel.h; sourceTree = "<group>"; };
B6AE33BC1A1EB121003DF39D /* GroupModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GroupModel.m; sourceTree = "<group>"; };
B6AE33BE1A1EB2DD003DF39D /* Socket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Socket.h; sourceTree = "<group>"; };
B6AE33BF1A1EB2DD003DF39D /* Socket.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Socket.m; sourceTree = "<group>"; };
B6B095DE1A1D25C5008BFAA6 /* CryptographyTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CryptographyTests.mm; sourceTree = "<group>"; };
B6B095DF1A1D25C5008BFAA6 /* TextSecureKitTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TextSecureKitTests.m; sourceTree = "<group>"; };
B6B095E01A1D25C5008BFAA6 /* TSMessageStorageTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSMessageStorageTests.m; sourceTree = "<group>"; };
@ -1231,8 +1239,8 @@
B6B0965E1A1D25ED008BFAA6 /* NSString+escape.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+escape.m"; sourceTree = "<group>"; };
B6B0965F1A1D25ED008BFAA6 /* NSURLSessionDataTask+StatusCode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSURLSessionDataTask+StatusCode.h"; sourceTree = "<group>"; };
B6B096601A1D25ED008BFAA6 /* NSURLSessionDataTask+StatusCode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSURLSessionDataTask+StatusCode.m"; sourceTree = "<group>"; };
B6B1013A196D213F007E3930 /* SGNKeychainUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SGNKeychainUtil.h; sourceTree = "<group>"; };
B6B1013B196D213F007E3930 /* SGNKeychainUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SGNKeychainUtil.m; sourceTree = "<group>"; };
B6B1013A196D213F007E3930 /* SignalKeyingStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SignalKeyingStorage.h; sourceTree = "<group>"; };
B6B1013B196D213F007E3930 /* SignalKeyingStorage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SignalKeyingStorage.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>"; };
B6C93C4C199567AD00EDF894 /* DebugLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DebugLogger.h; sourceTree = "<group>"; };
@ -1350,8 +1358,6 @@
FC31962C1A06A2190094C78E /* FingerprintViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FingerprintViewController.m; sourceTree = "<group>"; };
FC31962E1A0814130094C78E /* SettingsTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SettingsTableViewController.h; sourceTree = "<group>"; };
FC31962F1A0814130094C78E /* SettingsTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SettingsTableViewController.m; sourceTree = "<group>"; };
FC4FA0211A1B8A8D00DA100A /* Socket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Socket.h; sourceTree = "<group>"; };
FC4FA0221A1B8A8D00DA100A /* Socket.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Socket.m; sourceTree = "<group>"; };
FC4FA0241A1B9DC600DA100A /* SignalsNavigationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SignalsNavigationController.h; sourceTree = "<group>"; };
FC4FA0251A1B9DC600DA100A /* SignalsNavigationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SignalsNavigationController.m; sourceTree = "<group>"; };
FC4FA0311A1D46AE00DA100A /* InitialViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InitialViewController.h; sourceTree = "<group>"; };
@ -1359,13 +1365,9 @@
FCAC963419FEF4E20046DFC5 /* Storyboard.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Storyboard.storyboard; path = Signal/src/Storyboard/Storyboard.storyboard; sourceTree = SOURCE_ROOT; };
FCAC963A19FEF9280046DFC5 /* SignalsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SignalsViewController.h; path = UITests/SignalsViewController.h; sourceTree = "<group>"; };
FCAC963B19FEF9280046DFC5 /* SignalsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SignalsViewController.m; path = UITests/SignalsViewController.m; sourceTree = "<group>"; };
FCAC963D19FEF99A0046DFC5 /* TableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TableViewCell.h; sourceTree = "<group>"; };
FCAC963E19FEF99A0046DFC5 /* TableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TableViewCell.m; sourceTree = "<group>"; };
FCAC963F19FEF99A0046DFC5 /* TableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = TableViewCell.xib; sourceTree = "<group>"; };
FCAC964219FEFD8B0046DFC5 /* DemoDataFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DemoDataFactory.h; sourceTree = "<group>"; };
FCAC964319FEFD8B0046DFC5 /* DemoDataFactory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DemoDataFactory.m; sourceTree = "<group>"; };
FCAC964519FEFE1A0046DFC5 /* DemoDataModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DemoDataModel.h; sourceTree = "<group>"; };
FCAC964619FEFE1A0046DFC5 /* DemoDataModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DemoDataModel.m; sourceTree = "<group>"; };
FCAC963D19FEF99A0046DFC5 /* InboxTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InboxTableViewCell.h; sourceTree = "<group>"; };
FCAC963E19FEF99A0046DFC5 /* InboxTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InboxTableViewCell.m; sourceTree = "<group>"; };
FCAC963F19FEF99A0046DFC5 /* InboxTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = InboxTableViewCell.xib; sourceTree = "<group>"; };
FCAC964F19FF0A6E0046DFC5 /* MessagesViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MessagesViewController.h; sourceTree = "<group>"; };
FCAC965019FF0A6E0046DFC5 /* MessagesViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MessagesViewController.m; sourceTree = "<group>"; };
FCAFC33D1A0F948F00AE5136 /* ActionContactDetailCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ActionContactDetailCell.h; sourceTree = "<group>"; };
@ -1383,8 +1385,6 @@
FCF72A151A02D2BB006BC849 /* ContactDetailCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ContactDetailCell.m; sourceTree = "<group>"; };
FCFD256D1A151BCB00F4C644 /* NewGroupViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NewGroupViewController.h; sourceTree = "<group>"; };
FCFD256E1A151BCB00F4C644 /* NewGroupViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NewGroupViewController.m; sourceTree = "<group>"; };
FCFD25701A1524DB00F4C644 /* GroupModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GroupModel.h; sourceTree = "<group>"; };
FCFD25711A1524DB00F4C644 /* GroupModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GroupModel.m; sourceTree = "<group>"; };
FCFD257D1A154B2C00F4C644 /* RegistrationViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegistrationViewController.h; sourceTree = "<group>"; };
FCFD257E1A154B2C00F4C644 /* RegistrationViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RegistrationViewController.m; sourceTree = "<group>"; };
FCFD25801A154B3800F4C644 /* CodeVerificationViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CodeVerificationViewController.h; sourceTree = "<group>"; };
@ -1584,8 +1584,8 @@
76EB041918170B33006006FC /* PropertyListPreferences.m */,
76EB041A18170B33006006FC /* Release.h */,
76EB041B18170B33006006FC /* Release.m */,
B6B1013A196D213F007E3930 /* SGNKeychainUtil.h */,
B6B1013B196D213F007E3930 /* SGNKeychainUtil.m */,
B6B1013A196D213F007E3930 /* SignalKeyingStorage.h */,
B6B1013B196D213F007E3930 /* SignalKeyingStorage.m */,
B60C16631988999D00E97A6C /* VersionMigrations.h */,
B60C16641988999D00E97A6C /* VersionMigrations.m */,
);
@ -2743,6 +2743,21 @@
name = Requests;
sourceTree = "<group>";
};
B6AE33B41A1EB0A0003DF39D /* temp */ = {
isa = PBXGroup;
children = (
B6AE33BB1A1EB121003DF39D /* GroupModel.h */,
B6AE33BC1A1EB121003DF39D /* GroupModel.m */,
B6AE33B51A1EB0AF003DF39D /* DemoDataFactory.h */,
B6AE33B61A1EB0AF003DF39D /* DemoDataFactory.m */,
B6AE33B71A1EB0AF003DF39D /* DemoDataModel.h */,
B6AE33B81A1EB0AF003DF39D /* DemoDataModel.m */,
B6AE33BE1A1EB2DD003DF39D /* Socket.h */,
B6AE33BF1A1EB2DD003DF39D /* Socket.m */,
);
name = temp;
sourceTree = "<group>";
};
B6B095DD1A1D25C5008BFAA6 /* textsecure */ = {
isa = PBXGroup;
children = (
@ -3221,7 +3236,7 @@
FCAC963919FEF8A00046DFC5 /* UI Tests */ = {
isa = PBXGroup;
children = (
FCAC964819FEFE210046DFC5 /* DemoData */,
B6AE33B41A1EB0A0003DF39D /* temp */,
FCAC964E19FF061C0046DFC5 /* ViewControllers */,
FCAC964D19FF06110046DFC5 /* Views */,
);
@ -3229,29 +3244,14 @@
path = "view controllers";
sourceTree = "<group>";
};
FCAC964819FEFE210046DFC5 /* DemoData */ = {
isa = PBXGroup;
children = (
FCAC964219FEFD8B0046DFC5 /* DemoDataFactory.h */,
FCAC964319FEFD8B0046DFC5 /* DemoDataFactory.m */,
FCAC964519FEFE1A0046DFC5 /* DemoDataModel.h */,
FCAC964619FEFE1A0046DFC5 /* DemoDataModel.m */,
FCFD25701A1524DB00F4C644 /* GroupModel.h */,
FCFD25711A1524DB00F4C644 /* GroupModel.m */,
FC4FA0211A1B8A8D00DA100A /* Socket.h */,
FC4FA0221A1B8A8D00DA100A /* Socket.m */,
);
name = DemoData;
sourceTree = "<group>";
};
FCAC964D19FF06110046DFC5 /* Views */ = {
isa = PBXGroup;
children = (
FCF72A141A02D2BB006BC849 /* ContactDetailCell.h */,
FCF72A151A02D2BB006BC849 /* ContactDetailCell.m */,
FCAC963D19FEF99A0046DFC5 /* TableViewCell.h */,
FCAC963E19FEF99A0046DFC5 /* TableViewCell.m */,
FCAC963F19FEF99A0046DFC5 /* TableViewCell.xib */,
FCAC963D19FEF99A0046DFC5 /* InboxTableViewCell.h */,
FCAC963E19FEF99A0046DFC5 /* InboxTableViewCell.m */,
FCAC963F19FEF99A0046DFC5 /* InboxTableViewCell.xib */,
FCAFC33D1A0F948F00AE5136 /* ActionContactDetailCell.h */,
FCAFC33E1A0F948F00AE5136 /* ActionContactDetailCell.m */,
FCB11D881A1284BB002F93FB /* SettingsTableViewCell.h */,
@ -3514,7 +3514,7 @@
B633C5D91A1D190B0059AC12 /* settings.png in Resources */,
B633C5FB1A1D190B0059AC12 /* volume_high.png in Resources */,
B633C5971A1D190B0059AC12 /* delete@2x.png in Resources */,
FCAC964119FEF99A0046DFC5 /* TableViewCell.xib in Resources */,
FCAC964119FEF99A0046DFC5 /* InboxTableViewCell.xib in Resources */,
B633C5E21A1D190B0059AC12 /* speaker_icon@2x.png in Resources */,
B633C5A91A1D190B0059AC12 /* icon_favourites.png in Resources */,
B66DBF4A19D5BBC8006EA940 /* Images.xcassets in Resources */,
@ -3718,6 +3718,7 @@
76EB063E18170B33006006FC /* Operation.m in Sources */,
76EB05F618170B33006006FC /* CallConnectUtil.m in Sources */,
76EB061218170B33006006FC /* LoggingUtil.m in Sources */,
B6AE33B91A1EB0AF003DF39D /* DemoDataFactory.m in Sources */,
76EB060E18170B33006006FC /* DecayingSampleEstimator.m in Sources */,
76EB05BA18170B33006006FC /* CommitPacket.m in Sources */,
76EB060218170B33006006FC /* InitiatorSessionDescriptor.m in Sources */,
@ -3750,6 +3751,7 @@
B6B9ECFC198B31BA00C620D3 /* PushManager.m in Sources */,
76EB05D618170B33006006FC /* ZrtpResponder.m in Sources */,
7095B7B018F46D35002C66E2 /* PhoneNumberUtil.m in Sources */,
B6AE33C01A1EB2DD003DF39D /* Socket.m in Sources */,
B6B096791A1D25ED008BFAA6 /* TSRecipientPrekeyRequest.m in Sources */,
E197B61618BBEC1A00F073E5 /* StretchFactorController.m in Sources */,
FCFD257F1A154B2C00F4C644 /* RegistrationViewController.m in Sources */,
@ -3767,6 +3769,7 @@
76EB05F218170B33006006FC /* PhoneNumber.m in Sources */,
E197B61718BBEC1A00F073E5 /* AnonymousAudioCallbackHandler.m in Sources */,
76EB05BC18170B33006006FC /* ConfirmAckPacket.m in Sources */,
B6AE33BA1A1EB0AF003DF39D /* DemoDataModel.m in Sources */,
76EB060C18170B33006006FC /* CategorizingLogger.m in Sources */,
76EB058A18170B33006006FC /* Release.m in Sources */,
76EB061018170B33006006FC /* EventWindow.m in Sources */,
@ -3780,6 +3783,7 @@
76EB065A18170B34006006FC /* NextResponderScrollView.m in Sources */,
76EB062618170B33006006FC /* Queue.m in Sources */,
D221A09A169C9E5E00537ABF /* main.m in Sources */,
B6AE33BD1A1EB121003DF39D /* GroupModel.m in Sources */,
76EB061618170B33006006FC /* AnonymousOccurrenceLogger.m in Sources */,
76EB063018170B33006006FC /* Conversions.m in Sources */,
FCAFC33F1A0F948F00AE5136 /* ActionContactDetailCell.m in Sources */,
@ -3821,9 +3825,8 @@
B6B096851A1D25ED008BFAA6 /* TSSocketManager.m in Sources */,
76EB057618170B33006006FC /* Contact.m in Sources */,
B6B0968F1A1D25ED008BFAA6 /* TSYapDatabaseObject.m in Sources */,
FCAC964719FEFE1A0046DFC5 /* DemoDataModel.m in Sources */,
E197B61118BBEC1A00F073E5 /* AudioProcessor.m in Sources */,
FCAC964019FEF99A0046DFC5 /* TableViewCell.m in Sources */,
FCAC964019FEF99A0046DFC5 /* InboxTableViewCell.m in Sources */,
76EB05EA18170B33006006FC /* CallProgress.m in Sources */,
76EB05C218170B33006006FC /* DhPacketSharedSecretHashes.m in Sources */,
B6B096701A1D25ED008BFAA6 /* TSInfoMessage.m in Sources */,
@ -3836,7 +3839,6 @@
E197B60C18BBEC1A00F073E5 /* AudioPacker.m in Sources */,
E197B61218BBEC1A00F073E5 /* AudioStretcher.m in Sources */,
76EB05A218170B33006006FC /* IpEndPoint.m in Sources */,
FCFD25721A1524DB00F4C644 /* GroupModel.m in Sources */,
E197B61A18BBEC1A00F073E5 /* SpeexCodec.m in Sources */,
B6B0967F1A1D25ED008BFAA6 /* TSRequestAttachmentId.m in Sources */,
76EB05F018170B33006006FC /* PhoneManager.m in Sources */,
@ -3857,7 +3859,6 @@
B6B096881A1D25ED008BFAA6 /* TSStorageManager+keyFromIntLong.m in Sources */,
76EB059018170B33006006FC /* IgnoredPacketFailure.m in Sources */,
765052AF182AC9B5008313E1 /* DialerButtonView.m in Sources */,
FCAC964419FEFD8B0046DFC5 /* DemoDataFactory.m in Sources */,
76EB05D418170B33006006FC /* ZrtpManager.m in Sources */,
76EB058E18170B33006006FC /* HostNameEndPoint.m in Sources */,
B6B096841A1D25ED008BFAA6 /* TSNetworkManager.m in Sources */,
@ -3885,7 +3886,6 @@
FCFD256F1A151BCB00F4C644 /* NewGroupViewController.m in Sources */,
76EB059E18170B33006006FC /* HttpSocket.m in Sources */,
E197B60E18BBEC1A00F073E5 /* CallAudioManager.m in Sources */,
FC4FA0231A1B8A8D00DA100A /* Socket.m in Sources */,
76EB054018170B33006006FC /* AppDelegate.m in Sources */,
76EB05D018170B33006006FC /* ZrtpHandshakeSocket.m in Sources */,
B63761EF19E1FBE8005735D1 /* HttpResponse.m in Sources */,
@ -3900,7 +3900,7 @@
76EB057218170B33006006FC /* RecentCall.m in Sources */,
76EB060418170B33006006FC /* PhoneNumberDirectoryFilter.m in Sources */,
B97CBFA818860EA3008E0DE9 /* CountryCodeViewController.m in Sources */,
B6B1013C196D213F007E3930 /* SGNKeychainUtil.m in Sources */,
B6B1013C196D213F007E3930 /* SignalKeyingStorage.m in Sources */,
B6B0967E1A1D25ED008BFAA6 /* TSRequestAttachment.m in Sources */,
76EB059218170B33006006FC /* UnrecognizedRequestFailure.m in Sources */,
76EB05F818170B33006006FC /* CallConnectUtil_Initiator.m in Sources */,
@ -4606,6 +4606,7 @@
"$(inherited)",
);
PRODUCT_NAME = SignalTests;
PROVISIONING_PROFILE = "a377b8e6-d43e-485d-8830-bc7bfa3d1731";
TEST_HOST = "$(BUNDLE_LOADER)";
VALID_ARCHS = "arm64 armv7s armv7 i386 x86_64";
};
@ -4892,6 +4893,7 @@
"$(inherited)",
);
PRODUCT_NAME = SignalTests;
PROVISIONING_PROFILE = "a377b8e6-d43e-485d-8830-bc7bfa3d1731";
TEST_HOST = "$(BUNDLE_LOADER)";
VALID_ARCHS = "arm64 armv7s armv7 i386 x86_64";
};
@ -4939,6 +4941,7 @@
"$(inherited)",
);
PRODUCT_NAME = SignalTests;
PROVISIONING_PROFILE = "a377b8e6-d43e-485d-8830-bc7bfa3d1731";
TEST_HOST = "$(BUNDLE_LOADER)";
VALID_ARCHS = "arm64 armv7s armv7 i386 x86_64";
};

View File

@ -48,8 +48,6 @@
<string>remote-notification</string>
<string>voip</string>
</array>
<key>UILaunchStoryboardName</key>
<string>Storyboard</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6250" systemVersion="14A388a" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="kts-vO-ui1">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6250" systemVersion="14B25" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="kts-vO-ui1">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6244"/>
<capability name="Alignment constraints with different attributes" minToolsVersion="5.1"/>
@ -1441,6 +1441,7 @@ Lorem ipsum : Quick explanation of Fingerprints</string>
</barButtonItem>
</navigationItem>
<connections>
<outlet property="contactTableView" destination="GqA-oC-CJa" id="7n8-SC-J1z"/>
<segue destination="0XE-hu-8cu" kind="show" identifier="DetailSegue" id="nHU-Zk-VvG"/>
</connections>
</tableViewController>
@ -2253,9 +2254,6 @@ Lorem ipsum : Quick explanation of Fingerprints</string>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Neb-cr-TuQ">
<rect key="frame" x="0.0" y="0.0" width="240" height="128"/>
<variation key="heightClass=regular-widthClass=compact" misplaced="YES">
<rect key="frame" x="0.0" y="0.0" width="400" height="800"/>
</variation>
</imageView>
</subviews>
<constraints>
@ -2287,8 +2285,7 @@ Lorem ipsum : Quick explanation of Fingerprints</string>
<exclude reference="wCF-r0-Mcy"/>
</mask>
</variation>
<variation key="heightClass=regular-widthClass=compact" misplaced="YES">
<rect key="frame" x="0.0" y="0.0" width="400" height="800"/>
<variation key="heightClass=regular-widthClass=compact">
<mask key="subviews">
<include reference="Neb-cr-TuQ"/>
</mask>
@ -2371,14 +2368,14 @@ Lorem ipsum : Quick explanation of Fingerprints</string>
<exclude reference="wrt-Gs-Awk"/>
</mask>
<mask key="constraints">
<exclude reference="Roc-JQ-f9y"/>
<exclude reference="ZDj-at-031"/>
<exclude reference="rPg-Hq-Xxk"/>
<exclude reference="YbI-cl-hOB"/>
<exclude reference="qxF-m3-YlM"/>
<exclude reference="3F7-s6-l2J"/>
<exclude reference="Ept-m4-iN0"/>
<exclude reference="lve-Jx-YbD"/>
<exclude reference="YbI-cl-hOB"/>
<exclude reference="qxF-m3-YlM"/>
<exclude reference="Roc-JQ-f9y"/>
<exclude reference="ZDj-at-031"/>
<exclude reference="rPg-Hq-Xxk"/>
</mask>
</variation>
<variation key="heightClass=regular-widthClass=compact">
@ -2388,14 +2385,14 @@ Lorem ipsum : Quick explanation of Fingerprints</string>
<include reference="wrt-Gs-Awk"/>
</mask>
<mask key="constraints">
<include reference="Roc-JQ-f9y"/>
<include reference="ZDj-at-031"/>
<include reference="rPg-Hq-Xxk"/>
<include reference="YbI-cl-hOB"/>
<include reference="qxF-m3-YlM"/>
<include reference="3F7-s6-l2J"/>
<include reference="Ept-m4-iN0"/>
<include reference="lve-Jx-YbD"/>
<include reference="YbI-cl-hOB"/>
<include reference="qxF-m3-YlM"/>
<include reference="Roc-JQ-f9y"/>
<include reference="ZDj-at-031"/>
<include reference="rPg-Hq-Xxk"/>
</mask>
</variation>
</view>

View File

@ -9,7 +9,7 @@
#import "ContactsManager.h"
#import "PreferencesUtil.h"
#import "PhoneNumberDirectoryFilterManager.h"
#import "SGNKeychainUtil.h"
#import "SignalKeyingStorage.h"
#define isRegisteredUserDefaultString @"isRegistered"
@ -149,10 +149,10 @@ phoneDirectoryManager;
+(BOOL)isRegistered{
// Attributes that need to be set
NSData *signalingKey = SGNKeychainUtil.signalingCipherKey;
NSData *macKey = SGNKeychainUtil.signalingMacKey;
NSData *extra = SGNKeychainUtil.signalingExtraKey;
NSString *serverAuth = SGNKeychainUtil.serverAuthPassword;
NSData *signalingKey = SignalKeyingStorage.signalingCipherKey;
NSData *macKey = SignalKeyingStorage.signalingMacKey;
NSData *extra = SignalKeyingStorage.signalingExtraKey;
NSString *serverAuth = SignalKeyingStorage.serverAuthPassword;
BOOL registered = [[NSUserDefaults.standardUserDefaults objectForKey:isRegisteredUserDefaultString] boolValue];
return signalingKey && macKey && extra && serverAuth && registered;
@ -167,7 +167,7 @@ phoneDirectoryManager;
}
+(void)resetAppData{
[SGNKeychainUtil wipeKeychain];
[SignalKeyingStorage wipeKeychain];
[Environment.preferences clear];
if (self.preferences.loggingIsEnabled) {
[DebugLogger.sharedInstance wipeLogs];

View File

@ -1,6 +1,9 @@
#import "PropertyListPreferences.h"
#import "Constraints.h"
#import <UICKeyChainStore/UICKeyChainStore.h>
#import "TSStorageManager.h"
#define SignalDatabaseCollection @"SignalPreferences"
@implementation PropertyListPreferences
@ -11,21 +14,16 @@
}
}
-(id) tryGetValueForKey:(NSString *)key {
- (id)tryGetValueForKey:(NSString *)key {
require(key != nil);
@synchronized(self) {
return [NSUserDefaults.standardUserDefaults objectForKey:key];
}
return [TSStorageManager.sharedManager objectForKey:key inCollection:SignalDatabaseCollection];
}
-(void) setValueForKey:(NSString *)key toValue:(id)value {
- (void)setValueForKey:(NSString *)key toValue:(id)value {
require(key != nil);
@synchronized(self) {
NSUserDefaults *userDefaults = NSUserDefaults.standardUserDefaults;
[userDefaults setObject:value forKey:key];
[userDefaults synchronize];
}
[TSStorageManager.sharedManager setObject:value forKey:key inCollection:SignalDatabaseCollection];
}
-(id) adjustAndTryGetNewValueForKey:(NSString *)key afterAdjuster:(id (^)(id))adjuster {
- (id)adjustAndTryGetNewValueForKey:(NSString *)key afterAdjuster:(id (^)(id))adjuster {
require(key != nil);
require(adjuster != nil);
@synchronized(self) {

View File

@ -46,13 +46,13 @@ static unsigned char DH3K_PRIME[]={
+(Environment*) releaseEnvironmentWithLogging:(id<Logging>)logging {
//ErrorHandlerBlock errorDiscarder = ^(id error, id relatedInfo, bool causedTermination) {};
ErrorHandlerBlock errorNoter = ^(id error, id relatedInfo, bool causedTermination) { DDLogError(@"%@: %@, %d", error, relatedInfo, causedTermination); };
ErrorHandlerBlock errorNoter = ^(id error, id relatedInfo, bool causedTermination) {DDLogError(@"%@: %@, %d", error, relatedInfo, causedTermination); };
return [Environment environmentWithLogging:logging
andErrorNoter:errorNoter
andServerPort:31337
andMasterServerHostName:@"master.whispersystems.org"
andDefaultRelayName:@"relay"
andMasterServerHostName:@"testing.whispersystems.org"
andDefaultRelayName:@"testing"
andRelayServerHostNameSuffix:@"whispersystems.org"
andCertificate:[Certificate certificateFromResourcePath:@"whisperReal" ofType:@"cer"]
andCurrentRegionCodeForPhoneNumbers:[(NSLocale*)NSLocale.currentLocale objectForKey:NSLocaleCountryCode]

View File

@ -1,5 +1,5 @@
//
// SGNKeychainUtil.h
// SignalKeyingStorage.h
// Signal
//
// Created by Frederic Jacobs on 09/07/14.
@ -10,7 +10,7 @@
#import "PhoneNumber.h"
#import "Zid.h"
@interface SGNKeychainUtil : NSObject
@interface SignalKeyingStorage : NSObject
+(void)generateSignaling;
+(void)generateServerAuthPassword;

View File

@ -1,15 +1,15 @@
//
// SGNKeychainUtil.m
// SignalKeyingStorage.m
// Signal
//
// Created by Frederic Jacobs on 09/07/14.
// Copyright (c) 2014 Open Whisper Systems. All rights reserved.
//
#import "CryptoTools.h"
#import "SGNKeychainUtil.h"
#import <UICKeyChainStore/UICKeyChainStore.h>
#import "SignalKeyingStorage.h"
#import "Constraints.h"
#import "Util.h"
#import "TSStorageManager.h"
#define LOCAL_NUMBER_KEY @"Number"
#define PASSWORD_COUNTER_KEY @"PasswordCounter"
@ -20,12 +20,14 @@
#define ZID_LENGTH 12
#define SIGNALING_EXTRA_KEY @"Signaling Extra Key"
#define SignalKeyingCollection @"SignalKeyingCollection"
#define SIGNALING_MAC_KEY_LENGTH 20
#define SIGNALING_CIPHER_KEY_LENGTH 16
#define SAVED_PASSWORD_LENGTH 18
#define SIGNALING_EXTRA_KEY_LENGTH 4
@implementation SGNKeychainUtil
@implementation SignalKeyingStorage
+ (void)generateServerAuthPassword{
[self storeString:[[CryptoTools generateSecureRandomData:SAVED_PASSWORD_LENGTH] encodedAsBase64] forKey:SAVED_PASSWORD_KEY];
@ -39,12 +41,12 @@
}
+(void)wipeKeychain{
[UICKeyChainStore removeAllItems];
[TSStorageManager.sharedManager purgeCollection:SignalKeyingCollection];
}
+(int64_t) getAndIncrementOneTimeCounter {
__block int64_t oldCounter;
oldCounter = [[UICKeyChainStore stringForKey:PASSWORD_COUNTER_KEY] longLongValue];
oldCounter = [[self stringForKey:PASSWORD_COUNTER_KEY] longLongValue];
int64_t newCounter = (oldCounter == INT64_MAX)?INT64_MIN:(oldCounter + 1);
[self storeString:[@(newCounter) stringValue] forKey:PASSWORD_COUNTER_KEY];
return newCounter;
@ -98,12 +100,8 @@
#pragma mark Keychain wrapper methods
+(BOOL)storeData:(NSData*)data forKey:(NSString*)key{
BOOL success = [UICKeyChainStore setData:data forKey:key];
if (!success) {
DDLogError(@"Failed to set value for key: %@", key);
}
return success;
+(void)storeData:(NSData*)data forKey:(NSString*)key{
[TSStorageManager.sharedManager setObject:data forKey:key inCollection:SignalKeyingCollection];
}
+(NSData*)dataForKey:(NSString*)key andVerifyLength:(uint)length{
@ -117,28 +115,15 @@
}
+(NSData*)dataForKey:(NSString*)key{
NSData *data = [UICKeyChainStore dataForKey:key];
if (!data) {
DDLogError(@"Failed to get value for key: %@", key);
}
return data;
return [TSStorageManager.sharedManager dataForKey:key inCollection:SignalKeyingCollection];
}
+(NSString*)stringForKey:(NSString*)key{
NSString *string = [UICKeyChainStore stringForKey:key];
if (!string) {
DDLogError(@"Failed to get value for key: %@", key);
}
return string;
return [TSStorageManager.sharedManager stringForKey:key inCollection:SignalKeyingCollection];
}
+(BOOL)storeString:(NSString*)string forKey:(NSString*)key{
BOOL success = [UICKeyChainStore setString:string forKey:key];
if (!success) {
DDLogError(@"Failed to set value for key: %@", key);
}
return success;
+(void)storeString:(NSString*)string forKey:(NSString*)key{
[TSStorageManager.sharedManager setObject:string forKey:key inCollection:SignalKeyingCollection];
}
@end

View File

@ -9,6 +9,7 @@
#import "PushManager.h"
#import "Environment.h"
#import "RPServerRequestsManager.h"
#import "TSAccountManager.h"
@interface PushManager ()

View File

@ -2,7 +2,7 @@
#import "Constraints.h"
#import "PreferencesUtil.h"
#import "Util.h"
#import "SGNKeychainUtil.h"
#import "SignalKeyingStorage.h"
@implementation HttpRequest (HttpRequestUtil)
@ -18,8 +18,8 @@
return [HttpRequest httpRequestWithBasicAuthenticationAndMethod:method
andLocation:location
andOptionalBody:optionalBody
andLocalNumber:SGNKeychainUtil.localNumber
andPassword:SGNKeychainUtil.serverAuthPassword];
andLocalNumber:SignalKeyingStorage.localNumber
andPassword:SignalKeyingStorage.serverAuthPassword];
}
+(HttpRequest*)httpRequestWithOtpAuthenticationAndMethod:(NSString*)method
andLocation:(NSString*)location {
@ -33,9 +33,9 @@
return [HttpRequest httpRequestWithOtpAuthenticationAndMethod:method
andLocation:location
andOptionalBody:optionalBody
andLocalNumber:SGNKeychainUtil.localNumber
andPassword:SGNKeychainUtil.serverAuthPassword
andCounter:[SGNKeychainUtil getAndIncrementOneTimeCounter]];
andLocalNumber:SignalKeyingStorage.localNumber
andPassword:SignalKeyingStorage.serverAuthPassword
andCounter:[SignalKeyingStorage getAndIncrementOneTimeCounter]];
}
+(HttpRequest*)httpRequestUnauthenticatedWithMethod:(NSString*)method
andLocation:(NSString*)location {

View File

@ -11,7 +11,7 @@
#import "PhoneNumber.h"
#import "RPAPICall.h"
#import "SignalUtil.h"
#import "SGNKeychainUtil.h"
#import "SignalKeyingStorage.h"
#import "Util.h"
#define CLAIMED_INTEROP_VERSION_IN_INITIATE_SIGNAL 1
@ -36,7 +36,7 @@
+ (RPAPICall*)requestVerificationCode {
[SGNKeychainUtil generateServerAuthPassword];
[SignalKeyingStorage generateServerAuthPassword];
RPAPICall *apiCall = [self defaultAPICall];
apiCall.method = HTTP_GET;
apiCall.endPoint = @"/users/verification";
@ -51,14 +51,13 @@
+ (RPAPICall*)verifyVerificationCode:(NSString*)verificationCode {
RPAPICall *apiCall = [self defaultAPICall];
[SGNKeychainUtil generateSignaling];
[SignalKeyingStorage generateSignaling];
apiCall.method = HTTP_PUT;
apiCall.endPoint = [NSString stringWithFormat:@"/users/verification/%@", SGNKeychainUtil.localNumber];
apiCall.endPoint = [NSString stringWithFormat:@"/users/verification/%@", SignalKeyingStorage.localNumber];
NSData* signalingCipherKey = SGNKeychainUtil.signalingCipherKey;
NSData* signalingMacKey = SGNKeychainUtil.signalingMacKey;
NSData* signalingExtraKeyData = SGNKeychainUtil.signalingCipherKey;
NSData* signalingCipherKey = SignalKeyingStorage.signalingCipherKey;
NSData* signalingMacKey = SignalKeyingStorage.signalingMacKey;
NSData* signalingExtraKeyData = SignalKeyingStorage.signalingCipherKey;
NSString* encodedSignalingKey = @[signalingCipherKey, signalingMacKey, signalingExtraKeyData].ows_concatDatas.encodedAsBase64;
apiCall.parameters = @{@"key" : encodedSignalingKey, @"challenge" : verificationCode};
@ -138,13 +137,13 @@
+ (AFHTTPRequestSerializer*)basicAuthenticationSerializer {
AFHTTPRequestSerializer *serializer = [AFJSONRequestSerializer serializerWithWritingOptions:0];
[serializer setValue:[self computeBasicAuthorizationTokenForLocalNumber:SGNKeychainUtil.localNumber andPassword:SGNKeychainUtil.serverAuthPassword]forHTTPHeaderField:@"Authorization"];
[serializer setValue:[self computeBasicAuthorizationTokenForLocalNumber:SignalKeyingStorage.localNumber andPassword:SignalKeyingStorage.serverAuthPassword]forHTTPHeaderField:@"Authorization"];
return serializer;
}
+ (AFHTTPRequestSerializer*)otpAuthenticationSerializer {
AFHTTPRequestSerializer *serializer = [AFJSONRequestSerializer serializerWithWritingOptions:0];
[serializer setValue:[self computeOtpAuthorizationTokenForLocalNumber:SGNKeychainUtil.localNumber andCounterValue:[SGNKeychainUtil getAndIncrementOneTimeCounter] andPassword:SGNKeychainUtil.serverAuthPassword] forHTTPHeaderField:@"Authorization"];
[serializer setValue:[self computeOtpAuthorizationTokenForLocalNumber:SignalKeyingStorage.localNumber andCounterValue:[SignalKeyingStorage getAndIncrementOneTimeCounter] andPassword:SignalKeyingStorage.serverAuthPassword] forHTTPHeaderField:@"Authorization"];
return serializer;
}

View File

@ -12,7 +12,7 @@
#import "DataUtil.h"
#import "Environment.h"
#import "HostNameEndPoint.h"
#import "SGNKeychainUtil.h"
#import "SignalKeyingStorage.h"
#import "Util.h"
#import "AFHTTPSessionManager+SignalMethods.h"

View File

@ -7,7 +7,7 @@
#import "Util.h"
#import "ZrtpInitiator.h"
#import "PreferencesUtil.h"
#import "SGNKeychainUtil.h"
#import "SignalKeyingStorage.h"
#define DHRS1_LENGTH 8
#define DHRS2_LENGTH 8
@ -24,7 +24,7 @@
s->allowedKeyAgreementProtocols = Environment.getCurrent.keyAgreementProtocolsInDescendingPriority;
s->dhSharedSecretHashes = [DhPacketSharedSecretHashes dhPacketSharedSecretHashesRandomized];
s->zid = [SGNKeychainUtil zid];
s->zid = [SignalKeyingStorage zid];
s->confirmIv = [CryptoTools generateSecureRandomData:IV_LENGTH];
s->hashChain = [HashChain hashChainWithSecureGeneratedData];
s->badPacketLogger = [Environment.logging getOccurrenceLoggerForSender:self withKey:@"Bad Packet"];

View File

@ -8,7 +8,7 @@
#import "ZrtpResponder.h"
#import "HelloAckPacket.h"
#import "ConfirmAckPacket.h"
#import "SGNKeychainUtil.h"
#import "SignalKeyingStorage.h"
#define DHRS1_LENGTH 8
#define DHRS2_LENGTH 8
@ -30,7 +30,7 @@
s->badPacketLogger = [Environment.logging getOccurrenceLoggerForSender:self withKey:@"Bad Packet"];
s->localHello = [HelloPacket helloPacketWithDefaultsAndHashChain:s->hashChain
andZid:[SGNKeychainUtil zid]
andZid:[SignalKeyingStorage zid]
andKeyAgreementProtocols:s->allowedKeyAgreementProtocols];
s->packetExpectation = EXPECTING_HELLO;
s->callController = callController;

View File

@ -5,7 +5,7 @@
#import "PreferencesUtil.h"
#import "Util.h"
#import "InitiateSignal.pb.h"
#import "SGNKeychainUtil.h"
#import "SignalKeyingStorage.h"
#define MessagePropertyKey @"m"
#define RelayPortKey @"p"
@ -89,7 +89,7 @@
checkOperation(data.length >= HMAC_TRUNCATED_SIZE);
NSData* includedMac = [data takeLast:HMAC_TRUNCATED_SIZE];
NSData* payload = [data skipLast:HMAC_TRUNCATED_SIZE];
NSData* signalingMacKey = SGNKeychainUtil.signalingMacKey;
NSData* signalingMacKey = SignalKeyingStorage.signalingMacKey;
require(signalingMacKey != nil);
NSData* computedMac = [[payload hmacWithSha1WithKey:signalingMacKey] takeLast:HMAC_TRUNCATED_SIZE];
checkOperation([includedMac isEqualToData_TimingSafe:computedMac]);
@ -98,7 +98,7 @@
+(NSData*) decryptRemoteNotificationData:(NSData*)data {
require(data != nil);
checkOperation(data.length >= VERSION_SIZE + IV_SIZE);
NSData* cipherKey = SGNKeychainUtil.signalingCipherKey;
NSData* cipherKey = SignalKeyingStorage.signalingCipherKey;
require(cipherKey != nil);
NSData* iv = [data subdataWithRange:NSMakeRange(VERSION_SIZE, IV_SIZE)];
NSData* cipherText = [data skip:VERSION_SIZE+IV_SIZE];

View File

@ -4,7 +4,7 @@
#import "Environment.h"
#import "PreferencesUtil.h"
#import "Util.h"
#import "SGNKeychainUtil.h"
#import "SignalKeyingStorage.h"
#define CLAIMED_INTEROP_VERSION_IN_INITIATE_SIGNAL 1
@ -80,13 +80,14 @@
+(HttpRequest*) httpRequestToVerifyAccessToPhoneNumberWithChallenge:(NSString*)challenge {
require(challenge != nil);
PhoneNumber* localPhoneNumber = SGNKeychainUtil.localNumber;
PhoneNumber* localPhoneNumber = SignalKeyingStorage.localNumber;
NSString* query = [NSString stringWithFormat:@"/users/verification/%@", localPhoneNumber.toE164];
[SGNKeychainUtil generateSignaling];
[SignalKeyingStorage generateSignaling];
NSData* signalingCipherKey = SignalKeyingStorage.signalingCipherKey;
NSData* signalingMacKey = SignalKeyingStorage.signalingMacKey;
NSData* signalingExtraKeyData = SignalKeyingStorage.signalingCipherKey;
NSData* signalingCipherKey = SGNKeychainUtil.signalingCipherKey;
NSData* signalingMacKey = SGNKeychainUtil.signalingMacKey;
NSData* signalingExtraKeyData = SGNKeychainUtil.signalingCipherKey;
NSString* encodedSignalingKey = @[signalingCipherKey, signalingMacKey, signalingExtraKeyData].ows_concatDatas.encodedAsBase64;
NSString* body = @{@"key" : encodedSignalingKey, @"challenge" : challenge}.encodedAsJson;

View File

@ -67,8 +67,6 @@
return registrationID;
}
#if TARGET_OS_IPHONE
+ (void)registerForPushNotifications:(NSData *)pushToken success:(successCompletionBlock)success failure:(failedVerificationBlock)failureBlock{
NSString *stringToken = [[pushToken description] stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"<> "]];
@ -91,13 +89,11 @@
}
+ (void)registerWithRedPhoneToken:(NSString*)tsToken pushToken:(NSData*)pushToken success:(successCompletionBlock)successBlock failure:(failedVerificationBlock)failureBlock{
NSLog(@"PushToken:%@ TStoken: %@", pushToken, tsToken);
NSString *authToken = [self generateNewAccountAuthenticationToken];
NSString *signalingKey = [self generateNewSignalingKeyToken];
NSString *phoneNumber = [[tsToken componentsSeparatedByString:@":"] objectAtIndex:0];
NSLog(@"Phone Number %@", phoneNumber);
require(phoneNumber != nil);
require(signalingKey != nil);
require(authToken != nil);
@ -113,21 +109,28 @@
if (statuscode == 200 || statuscode == 204) {
[TSStorageManager storeServerToken:authToken signalingKey:signalingKey phoneNumber:phoneNumber];
[self registerPreKeys:successBlock failure:failureBlock];
[self registerForPushNotifications:pushToken success:^{
successBlock();
} failure:^(TSRegistrationFailure failureType) {
failureBlock(kTSRegistrationFailureNetwork);
}];
} else{
failureBlock(kTSRegistrationFailureNetwork);
}
} failure:^(NSURLSessionDataTask *task, NSError *error) {
//TODO: Cover all error types: https://github.com/WhisperSystems/TextSecure-Server/wiki/API-Protocol
failureBlock(kTSRegistrationFailureNetwork);
}];
}
+ (void)registerPreKeysAfterPush:(NSData*)pushToken
success:(successCompletionBlock)successBlock
failure:(failedVerificationBlock)failureBlock
{
[self registerForPushNotifications:pushToken success:^{
[self registerPreKeys:successBlock
failure:failureBlock];
} failure:failureBlock];
}
+ (void)registerPreKeys:(successCompletionBlock)successBlock failure:(failedVerificationBlock)failureBlock {
[TSPreKeyManager registerPreKeysWithSuccess:^{
[TSAccountManager setRegistered:YES];
@ -135,7 +138,6 @@
} failure:failureBlock];
}
#pragma mark Server keying material
+ (NSString*)generateNewAccountAuthenticationToken {
@ -152,6 +154,4 @@
}
#endif
@end

View File

@ -25,7 +25,24 @@
- (BOOL)isGroupThread;
@property (getter=isBlocked) BOOL blocked;
@property (nonatomic, copy) NSDate *lastMessageDate;
/**
* Returns the name of the thread.
*
* @return name of the thread
*/
- (NSString*)name;
/**
* Returns the image representing the thread. Nil if not available.
*
* @return UIImage of the thread, or nil.
*/
- (UIImage*)image;
@property (getter=isBlocked) BOOL blocked;
@property (nonatomic) uint64_t lastMessageId;
- (NSDate*)lastMessageDate;
@end

View File

@ -34,5 +34,4 @@ extern const struct TSMessageEdges {
#pragma mark Utility Method
+ (NSString*)stringFromTimeStamp:(uint64_t)timestamp;
@end

View File

@ -12,4 +12,4 @@
- (id)initWithHashesArray:(NSArray*)hashes;
@end
@end

View File

@ -20,6 +20,7 @@ static NSString * keychainDBPassAccount = @"TSDatabasePass";
@interface TSStorageManager ()
@property YapDatabase *database;
@property YapDatabaseConnection *dbConnection;
@end
@ -34,6 +35,40 @@ static NSString * keychainDBPassAccount = @"TSDatabasePass";
return sharedMyManager;
}
- (instancetype)init {
self = [super init];
if (self) {
self.database = [self newDatabaseInit];
self.dbConnection = self.databaseConnection;
}
return self;
}
- (YapDatabase*)newDatabaseInit{
YapDatabaseOptions *options = [[YapDatabaseOptions alloc] init];
options.corruptAction = YapDatabaseCorruptAction_Fail;
options.passphraseBlock = ^{
return [self databasePassword];
};
return [[YapDatabase alloc] initWithPath:[self dbPath]
objectSerializer:NULL
objectDeserializer:NULL
metadataSerializer:NULL
metadataDeserializer:NULL
objectSanitizer:NULL
metadataSanitizer:NULL
options:options];
}
- (YapDatabaseConnection *)databaseConnection {
return self.database.newConnection;
}
- (BOOL)userSetPassword {
return FALSE;
}
@ -80,70 +115,30 @@ static NSString * keychainDBPassAccount = @"TSDatabasePass";
return dbPassword;
}
- (instancetype)init {
self = [super init];
if (self) {
self.database = [self newDatabaseInit];
}
return self;
}
- (YapDatabase*)newDatabaseInit{
YapDatabaseOptions *options = [[YapDatabaseOptions alloc] init];
options.corruptAction = YapDatabaseCorruptAction_Fail;
options.passphraseBlock = ^{
return [self databasePassword];
};
return [[YapDatabase alloc] initWithPath:[self dbPath]
objectSerializer:NULL
objectDeserializer:NULL
metadataSerializer:NULL
metadataDeserializer:NULL
objectSanitizer:NULL
metadataSanitizer:NULL
options:options];
}
- (YapDatabaseConnection *)databaseConnection {
return self.database.newConnection;
}
#pragma mark convenience methods
- (void)purgeCollection:(NSString*)collection {
YapDatabaseConnection *dbConn = [self databaseConnection];
[dbConn readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
[self.dbConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
[transaction removeAllObjectsInCollection:collection];
}];
}
- (void)setObject:(id)object forKey:(NSString*)key inCollection:(NSString*)collection {
YapDatabaseConnection *dbConn = [self databaseConnection];
[dbConn readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
[self.dbConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
[transaction setObject:object forKey:key inCollection:collection];
}];
}
- (void)removeObjectForKey:(NSString*)string inCollection:(NSString *)collection{
YapDatabaseConnection *dbConn = [self databaseConnection];
[dbConn readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
[self.dbConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
[transaction removeObjectForKey:string inCollection:collection];
}];
}
- (id)objectForKey:(NSString*)key inCollection:(NSString *)collection {
YapDatabaseConnection *dbConn = [self databaseConnection];
__block NSString *object;
[dbConn readWithBlock:^(YapDatabaseReadTransaction *transaction) {
[self.dbConnection readWithBlock:^(YapDatabaseReadTransaction *transaction) {
object = [transaction objectForKey:key inCollection:collection];
}];
@ -151,10 +146,9 @@ static NSString * keychainDBPassAccount = @"TSDatabasePass";
}
- (NSDictionary*)dictionaryForKey:(NSString*)key inCollection:(NSString *)collection {
YapDatabaseConnection *dbConn = [self databaseConnection];
__block NSDictionary *object;
[dbConn readWithBlock:^(YapDatabaseReadTransaction *transaction) {
[self.dbConnection readWithBlock:^(YapDatabaseReadTransaction *transaction) {
object = [transaction objectForKey:key inCollection:collection];
}];
@ -216,6 +210,7 @@ static NSString * keychainDBPassAccount = @"TSDatabasePass";
}
self.database = [self newDatabaseInit];
self.dbConnection = self.databaseConnection;
}
@end

View File

@ -49,7 +49,7 @@
}
#pragma - mark Class Methods
#pragma mark Class Methods
+ (NSString *)collection{
return NSStringFromClass([self class]);

View File

@ -29,7 +29,7 @@ typedef enum {
#define textSecureHTTPTimeOut 10
#define textSecureWebSocketAPI @"wss://textsecure-service.whispersystems.org/v1/websocket/"
#define textSecureWebSocketAPI @"wss://textsecure-service-staging.whispersystems.org/v1/websocket/"
//#define textSecureServerURL @"https://textsecure-service.whispersystems.org/"
#define textSecureServerURL @"https://textsecure-service-staging.whispersystems.org/"

View File

@ -11,7 +11,7 @@
#import "RPServerRequestsManager.h"
#import "LocalizableText.h"
#import "PushManager.h"
#import "SGNKeychainUtil.h"
#import "SignalKeyingStorage.h"
#import "TSAccountManager.h"
@interface CodeVerificationViewController ()
@ -36,19 +36,32 @@
- (IBAction)verifyChallengeAction:(id)sender {
[_challengeTextField resignFirstResponder];
//TODO: Lock UI interactions
[self registerWithSuccess:^{
[self performSegueWithIdentifier:@"verifiedSegue" sender:self];
} failure:^{
// TODO: Unlock UI
NSLog(@"Failed to register");
}];
}
- (void)registerWithSuccess:(void(^)())success failure:(void(^)())failure{
//TODO: Refactor this to use futures? Better error handling needed. Good enough for PoC
[[RPServerRequestsManager sharedInstance] performRequest:[RPAPICall verifyVerificationCode:_challengeTextField.text] success:^(NSURLSessionDataTask *task, id responseObject) {
[PushManager.sharedManager registrationAndRedPhoneTokenRequestWithSuccess:^(NSData *pushToken, NSString *signupToken) {
[TSAccountManager registerWithRedPhoneToken:signupToken pushToken:pushToken success:^{
[self performSegueWithIdentifier:@"verifiedSegue" sender:self];
success();
} failure:^(TSRegistrationFailure failureType) {
NSLog(@":(");
failure();
}];
} failure:^{
failure();
}];
} failure:^(NSURLSessionDataTask *task, NSError *error) {
NSString *alertTitle = NSLocalizedString(@"REGISTRATION_ERROR", @"");
@ -65,6 +78,7 @@
}];
}
#pragma mark - Keyboard notifications
- (void)initializeKeyboardHandlers{
@ -77,14 +91,4 @@
[self.view endEditing:NO];
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end

View File

@ -10,4 +10,6 @@
@interface ContactsTableViewController : UITableViewController
@property (nonatomic, strong) IBOutlet UITableView *contactTableView;
@end

View File

@ -15,24 +15,26 @@
#import "Environment.h"
#import "Contact.h"
#import "ContactsManager.h"
#import "LocalizableText.h"
#import "PhoneNumberDirectoryFilterManager.h"
#import "DemoDataFactory.h"
#import "NotificationManifest.h"
#import <AddressBook/AddressBook.h>
#define REFRESH_TIMEOUT 20
static NSString *const CONTACT_BROWSE_TABLE_CELL_IDENTIFIER = @"ContactTableViewCell";
@interface ContactsTableViewController () <UISearchBarDelegate, UISearchResultsUpdating>
{
NSMutableDictionary *latestAlphabeticalContacts;
NSArray *latestSortedAlphabeticalContactKeys;
NSArray * latestContacts;
NSArray * searchResults;
NSDictionary *latestAlphabeticalContacts;
NSArray *searchResults;
}
@property NSArray *latestSortedAlphabeticalContactKeys;
@property NSArray *latestContacts;
@property (nonatomic, strong) UISearchController *searchController;
@end
@ -44,13 +46,19 @@ static NSString *const CONTACT_BROWSE_TABLE_CELL_IDENTIFIER = @"ContactTableView
self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
//Hide search bar
[[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];
self.refreshControl = refreshControl;
[self.contactTableView addSubview:self.refreshControl];
self.tableView.contentOffset = CGPointMake(0, 44);
[self initializeSearch];
[self setupContacts];
searchResults = latestContacts;
[self.tableView reloadData];
}
@ -105,45 +113,24 @@ static NSString *const CONTACT_BROWSE_TABLE_CELL_IDENTIFIER = @"ContactTableView
- (void)filterContentForSearchText:(NSString*)searchText scope:(NSString*)scope
{
NSPredicate *resultPredicate = [NSPredicate predicateWithFormat:@"fullName contains[c] %@", searchText];
searchResults = [latestContacts filteredArrayUsingPredicate:resultPredicate];
if (!searchResults.count && _searchController.searchBar.text.length == 0) searchResults = latestContacts;
searchResults = [self.latestContacts filteredArrayUsingPredicate:resultPredicate];
if (!searchResults.count && _searchController.searchBar.text.length == 0) searchResults = self.latestContacts;
}
#pragma mark - Contact functions
- (void)setupContacts {
// ObservableValue *observableContacts = Environment.getCurrent.contactsManager.getObservableWhisperUsers;
//
// [observableContacts watchLatestValue:^(NSArray *latestContacts) {
// _latestContacts = latestContacts;
// } onThread:NSThread.mainThread untilCancelled:nil];
latestContacts = [DemoDataFactory makeFakeContacts];
NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"firstName" ascending:YES];
NSArray *sortDescriptors = [NSArray arrayWithObject:sortDescriptor];
latestSortedAlphabeticalContactKeys = [latestContacts sortedArrayUsingDescriptors:sortDescriptors];
latestAlphabeticalContacts = [self alphabetDictionaryInit];
for (Contact*contact in latestContacts)
{
NSString * firstLetter = [contact.firstName substringToIndex:1];
NSMutableArray * mutArray = [[latestAlphabeticalContacts objectForKey:firstLetter] mutableCopy];
if (![mutArray containsObject:contact])
[mutArray addObject:contact];
[latestAlphabeticalContacts setObject:mutArray forKey:firstLetter];
}
latestSortedAlphabeticalContactKeys = [[latestAlphabeticalContacts allKeys]sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)];
ObservableValue *observableContacts = Environment.getCurrent.contactsManager.getObservableWhisperUsers;
[observableContacts watchLatestValue:^(NSArray *latestContacts) {
_latestContacts = latestContacts;
[self onSearchOrContactChange:nil];
} onThread:NSThread.mainThread untilCancelled:nil];
}
- (NSArray *)contactsForSectionIndex:(NSUInteger)index {
return [latestAlphabeticalContacts valueForKey:latestSortedAlphabeticalContactKeys[index]];
return [latestAlphabeticalContacts valueForKey:self.latestSortedAlphabeticalContactKeys[index]];
}
@ -177,8 +164,7 @@ static NSString *const CONTACT_BROWSE_TABLE_CELL_IDENTIFIER = @"ContactTableView
@"W": @[],
@"X": @[],
@"Y": @[],
@"Z": @[],
@"Z": @[]
};
return [dic mutableCopy];
@ -198,7 +184,7 @@ static NSString *const CONTACT_BROWSE_TABLE_CELL_IDENTIFIER = @"ContactTableView
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
if ([[self contactsForSectionIndex:(NSUInteger)section] count]) {
return latestSortedAlphabeticalContactKeys[(NSUInteger)section];
return self.latestSortedAlphabeticalContactKeys[(NSUInteger)section];
} else {
return nil;
}
@ -216,6 +202,7 @@ static NSString *const CONTACT_BROWSE_TABLE_CELL_IDENTIFIER = @"ContactTableView
if (self.searchController.active) {
return 1;
} else {
NSLog(@"Sections contacts %@", latestAlphabeticalContacts);
return (NSInteger)[[latestAlphabeticalContacts allKeys] count];
}
}
@ -223,7 +210,7 @@ static NSString *const CONTACT_BROWSE_TABLE_CELL_IDENTIFIER = @"ContactTableView
- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView
{
tableView.sectionIndexBackgroundColor = [UIColor clearColor];
return latestSortedAlphabeticalContactKeys;
return _latestSortedAlphabeticalContactKeys;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
@ -231,7 +218,7 @@ static NSString *const CONTACT_BROWSE_TABLE_CELL_IDENTIFIER = @"ContactTableView
if (!cell) {
cell = [[ContactTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:CONTACT_BROWSE_TABLE_CELL_IDENTIFIER];
reuseIdentifier:CONTACT_BROWSE_TABLE_CELL_IDENTIFIER];
}
@ -255,6 +242,7 @@ static NSString *const CONTACT_BROWSE_TABLE_CELL_IDENTIFIER = @"ContactTableView
} else {
NSArray *contactSection = [self contactsForSectionIndex:(NSUInteger)indexPath.section];
contact = contactSection[(NSUInteger)indexPath.row];
NSLog(@"Contact: %@", contact);
}
return contact;
@ -292,8 +280,7 @@ static NSString *const CONTACT_BROWSE_TABLE_CELL_IDENTIFIER = @"ContactTableView
DialerViewController * dialer = [DialerViewController new];
UINavigationController *navigationController = [[UINavigationController alloc]
initWithRootViewController:dialer];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:dialer];
navigationController.tabBarController.hidesBottomBarWhenPushed = NO;
dialer.phoneNumber = nil;
@ -304,9 +291,34 @@ static NSString *const CONTACT_BROWSE_TABLE_CELL_IDENTIFIER = @"ContactTableView
navigationController.hidesBottomBarWhenPushed = YES;
navigationController.navigationBarHidden=YES;
[self.tabBarController presentViewController:navigationController animated:YES completion:^(){
[self.tabBarController presentViewController:navigationController animated:YES completion:nil];
}
#pragma mark - Refresh controls
- (void)onSearchOrContactChange:(NSString *)searchTerm {
if (_latestContacts) {
latestAlphabeticalContacts = [ContactsManager groupContactsByFirstLetter:_latestContacts
matchingSearchString:searchTerm];
}];
NSArray *contactKeys = [latestAlphabeticalContacts allKeys];
_latestSortedAlphabeticalContactKeys = [contactKeys sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
[_contactTableView reloadData];
}
}
- (void)refreshContacts{
[Environment.getCurrent.phoneDirectoryManager forceUpdate];
}
- (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.refreshControl endRefreshing];
}
@end

View File

@ -121,7 +121,7 @@
BOOL shouldTryCall = [Environment.getCurrent.phoneDirectoryManager.getCurrentFilter containsPhoneNumber:phoneNumber] || [Environment.getCurrent.recentCallManager isPhoneNumberPresentInRecentCalls:phoneNumber];
if( shouldTryCall){
if (shouldTryCall){
[self initiateCallToPhoneNumber:phoneNumber];
}else if(phoneNumber.isValid){
[self promptToInvitePhoneNumber:phoneNumber];

View File

@ -15,15 +15,16 @@ typedef enum : NSUInteger {
kInboxState,
} CellState;
@class TableViewCell;
@class InboxTableViewCell;
@protocol TableViewCellDelegate <NSObject>
- (void)tableViewCellTappedDelete:(TableViewCell *)cell;
- (void)tableViewCellTappedArchive:(TableViewCell *)cell;
- (void)tableViewCellTappedDelete:(InboxTableViewCell *)cell;
- (void)tableViewCellTappedArchive:(InboxTableViewCell *)cell;
@end
@interface TableViewCell : UITableViewCell <UIScrollViewDelegate>
@interface InboxTableViewCell : UITableViewCell <UIScrollViewDelegate>
@property (nonatomic, strong) IBOutlet UIImageView* lastActionImageView;

View File

@ -6,7 +6,7 @@
// Copyright (c) 2014 Open Whisper Systems. All rights reserved.
//
#import "TableViewCell.h"
#import "InboxTableViewCell.h"
#import "Util.h"
#define ARCHIVE_IMAGE_VIEW_WIDTH 22.0f
@ -15,7 +15,7 @@
#define DATE_LABEL_SIZE 13
@implementation TableViewCell
@implementation InboxTableViewCell
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
self = [NSBundle.mainBundle loadNibNamed:NSStringFromClass(self.class)
@ -33,7 +33,6 @@
_deleteImageView.image = [_deleteImageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
_archiveImageView.image = [_archiveImageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
}
return self;
}

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6250" systemVersion="14A388a" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6250" systemVersion="14B25" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6244"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
@ -7,7 +7,7 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="TableViewCell" rowHeight="72" id="axX-Rb-kiK" customClass="TableViewCell">
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="TableViewCell" rowHeight="72" id="axX-Rb-kiK" customClass="InboxTableViewCell">
<rect key="frame" x="0.0" y="0.0" width="400" height="72"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" multipleTouchEnabled="YES" contentMode="center" tableViewCell="axX-Rb-kiK" id="BRG-hJ-lRa">

View File

@ -19,7 +19,7 @@
#import "PushManager.h"
#import "RPServerRequestsManager.h"
#import "SignalUtil.h"
#import "SGNKeychainUtil.h"
#import "SignalKeyingStorage.h"
#import "ThreadManager.h"
#import "Util.h"
@ -71,7 +71,7 @@
[_phoneNumberTextField resignFirstResponder];
[SGNKeychainUtil setLocalNumberTo:localNumber];
[SignalKeyingStorage setLocalNumberTo:localNumber];
[[RPServerRequestsManager sharedInstance]performRequest:[RPAPICall requestVerificationCode] success:^(NSURLSessionDataTask *task, id responseObject) {
[self performSegueWithIdentifier:@"codeSent" sender:self];

View File

@ -6,7 +6,7 @@
// Copyright (c) 2014 Open Whisper Systems. All rights reserved.
//
#include "TableViewCell.h"
#include "InboxTableViewCell.h"
#import <UIKit/UIKit.h>
#import "GroupModel.h"

View File

@ -8,7 +8,7 @@
#import "AppDelegate.h"
#import "DemoDataFactory.h"
#import "TableViewCell.h"
#import "InboxTableViewCell.h"
#import "MessagesViewController.h"
#import "SignalsViewController.h"
@ -73,7 +73,7 @@ static NSString *const kSegueIndentifier = @"showSegue";
return (NSInteger)numberOfCells;
}
- (TableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
- (InboxTableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
return [self inboxFeedCellForIndexPath:indexPath];
}
@ -81,13 +81,13 @@ static NSString *const kSegueIndentifier = @"showSegue";
return CELL_HEIGHT;
}
-(TableViewCell*)inboxFeedCellForIndexPath:(NSIndexPath *)indexPath {
-(InboxTableViewCell*)inboxFeedCellForIndexPath:(NSIndexPath *)indexPath {
TableViewCell *cell = [self._tableView dequeueReusableCellWithIdentifier:kCellNibName];
InboxTableViewCell *cell = [self._tableView dequeueReusableCellWithIdentifier:kCellNibName];
if (!cell) {
cell = [[TableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
cell = [[InboxTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:kCellNibName];
cell.delegate = self;
}
@ -102,11 +102,11 @@ static NSString *const kSegueIndentifier = @"showSegue";
#pragma mark - HomeFeedTableViewCellDelegate
- (void)tableViewCellTappedDelete:(TableViewCell *)cell {
- (void)tableViewCellTappedDelete:(InboxTableViewCell*)cell {
NSLog(@"Delete");
}
- (void)tableViewCellTappedArchive:(TableViewCell *)cell {
- (void)tableViewCellTappedArchive:(InboxTableViewCell*)cell {
NSLog(@"Archive");
}

View File

@ -109,7 +109,7 @@
<constraint firstItem="rKW-B9-eAC" firstAttribute="bottom" secondItem="z0U-dT-qTX" secondAttribute="bottom" constant="-4" id="xru-yK-ID7"/>
</constraints>
</view>
<view contentMode="scaleToFill" horizontalCompressionResistancePriority="1000" verticalCompressionResistancePriority="1000" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="UNK-zX-eBo" userLabel="Button 1" customClass="DialerButtonView">
<view contentMode="scaleToFill" horizontalCompressionResistancePriority="1000" verticalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="UNK-zX-eBo" userLabel="Button 1" customClass="DialerButtonView">
<rect key="frame" x="33" y="75" width="75" height="77"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" showsTouchWhenHighlighted="YES" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="LNY-2Q-z2w">
@ -164,7 +164,7 @@
<outlet property="numberLabel" destination="roV-EL-ndH" id="hVU-9n-kbu"/>
</connections>
</view>
<view contentMode="scaleToFill" horizontalCompressionResistancePriority="1000" verticalCompressionResistancePriority="1000" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="nH4-4u-iep" userLabel="Button 3" customClass="DialerButtonView">
<view contentMode="scaleToFill" horizontalCompressionResistancePriority="1000" verticalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="nH4-4u-iep" userLabel="Button 3" customClass="DialerButtonView">
<rect key="frame" x="211" y="75" width="76" height="77"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" showsTouchWhenHighlighted="YES" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="dew-Iu-sVI">
@ -219,7 +219,7 @@
<outlet property="numberLabel" destination="F6Z-OF-f5h" id="ppZ-dj-PFh"/>
</connections>
</view>
<view contentMode="scaleToFill" horizontalCompressionResistancePriority="1000" verticalCompressionResistancePriority="1000" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="82K-Nd-cmI" userLabel="Button 2" customClass="DialerButtonView">
<view contentMode="scaleToFill" horizontalCompressionResistancePriority="1000" verticalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="82K-Nd-cmI" userLabel="Button 2" customClass="DialerButtonView">
<rect key="frame" x="123" y="75" width="74" height="77"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" showsTouchWhenHighlighted="YES" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="1XT-Tr-yuE">
@ -604,7 +604,7 @@
<outlet property="numberLabel" destination="J3B-Zg-DgR" id="1Tx-cs-Unb"/>
</connections>
</view>
<view contentMode="scaleToFill" horizontalCompressionResistancePriority="1000" verticalCompressionResistancePriority="1000" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="T7H-JR-Beb" userLabel="Button *" customClass="DialerButtonView">
<view contentMode="scaleToFill" horizontalCompressionResistancePriority="1000" verticalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="T7H-JR-Beb" userLabel="Button *" customClass="DialerButtonView">
<rect key="frame" x="33" y="328" width="75" height="77"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" showsTouchWhenHighlighted="YES" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="jQH-w4-imN">
@ -658,7 +658,7 @@
<outlet property="numberLabel" destination="325-Sb-hA5" id="gxO-5s-17q"/>
</connections>
</view>
<view contentMode="scaleToFill" horizontalCompressionResistancePriority="1000" verticalCompressionResistancePriority="1000" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="97j-3K-zxA" userLabel="Button 0" customClass="DialerButtonView">
<view contentMode="scaleToFill" horizontalCompressionResistancePriority="1000" verticalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="97j-3K-zxA" userLabel="Button 0" customClass="DialerButtonView">
<rect key="frame" x="123" y="328" width="74" height="77"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" showsTouchWhenHighlighted="YES" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ynu-j8-rAV">
@ -712,7 +712,7 @@
<outlet property="numberLabel" destination="hKX-df-8oI" id="qKJ-sl-JSm"/>
</connections>
</view>
<view contentMode="scaleToFill" horizontalCompressionResistancePriority="1000" verticalCompressionResistancePriority="1000" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="4UG-he-mMF" userLabel="Button #" customClass="DialerButtonView">
<view contentMode="scaleToFill" horizontalCompressionResistancePriority="1000" verticalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="4UG-he-mMF" userLabel="Button #" customClass="DialerButtonView">
<rect key="frame" x="211" y="328" width="76" height="77"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" showsTouchWhenHighlighted="YES" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="bdz-8Z-3vp">
@ -764,11 +764,11 @@
<outlet property="numberLabel" destination="byT-uY-L8H" id="MLp-Uv-nKS"/>
</connections>
</view>
<view contentMode="scaleToFill" horizontalCompressionResistancePriority="1" verticalCompressionResistancePriority="1" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="gJH-91-Zx5">
<view contentMode="scaleToFill" horizontalCompressionResistancePriority="1" verticalCompressionResistancePriority="1" translatesAutoresizingMaskIntoConstraints="NO" id="gJH-91-Zx5">
<rect key="frame" x="0.0" y="404" width="320" height="9"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
<view contentMode="scaleToFill" horizontalCompressionResistancePriority="1" verticalCompressionResistancePriority="1" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="8db-9r-Y2f">
<view contentMode="scaleToFill" horizontalCompressionResistancePriority="1" verticalCompressionResistancePriority="1" translatesAutoresizingMaskIntoConstraints="NO" id="8db-9r-Y2f">
<rect key="frame" x="0.0" y="320" width="320" height="8"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
@ -776,7 +776,7 @@
<rect key="frame" x="0.0" y="238" width="320" height="8"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
<view contentMode="scaleToFill" horizontalCompressionResistancePriority="1" verticalCompressionResistancePriority="1" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="m52-xI-oom">
<view contentMode="scaleToFill" horizontalCompressionResistancePriority="1" verticalCompressionResistancePriority="1" translatesAutoresizingMaskIntoConstraints="NO" id="m52-xI-oom">
<rect key="frame" x="0.0" y="151" width="320" height="8"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>

View File

@ -5,7 +5,7 @@
#import "HttpRequestUtil.h"
#import "PreferencesUtil.h"
#import "SignalUtil.h"
#import "SGNKeychainUtil.h"
#import "SignalKeyingStorage.h"
#import <UICKeyChainStore/UICKeyChainStore.h>
@interface HttpRequestResponseTest : XCTestCase
@ -18,7 +18,7 @@
//-(void) testRequestToInitiate {
// [Environment setCurrent:testEnv];
// [SGNKeychainUtil setLocalNumberTo:[PhoneNumber phoneNumberFromE164:@"+12211231235"]];
// [SignalKeyingStorage setLocalNumberTo:[PhoneNumber phoneNumberFromE164:@"+12211231235"]];
// [UICKeyChainStore setString:@"shall_not_password" forKey:@"Password"];
// [Environment.preferences setValueForKey:@"PasswordCounter" toValue:@2357];
// HttpRequest* h = [HttpRequest httpRequestToInitiateToRemoteNumber:[PhoneNumber phoneNumberFromE164:@"+19023334444"]];
@ -37,7 +37,7 @@
}
//-(void) testRequestToRing {
// [Environment setCurrent:testEnv];
// [SGNKeychainUtil setLocalNumberTo:[PhoneNumber phoneNumberFromE164:@"+19025555555"]];
// [SignalKeyingStorage setLocalNumberTo:[PhoneNumber phoneNumberFromE164:@"+19025555555"]];
// [UICKeyChainStore setString:@"shall_not_password" forKey:@"Password"];
// [UICKeyChainStore setString:[@0 stringValue] forKey:@"PasswordCounter"];
// HttpRequest* h = [HttpRequest httpRequestToRingWithSessionId:458847238];

View File

@ -10,7 +10,7 @@
#import "ConfirmAckPacket.h"
#import "HostNameEndPoint.h"
#import "IpAddress.h"
#import "SGNKeychainUtil.h"
#import "SignalKeyingStorage.h"
bool pm(HandshakePacket* p1, HandshakePacket* p2);
bool pm(HandshakePacket* p1, HandshakePacket* p2) {
@ -28,7 +28,7 @@ bool pm(HandshakePacket* p1, HandshakePacket* p2) {
- (void)setUp{
[Environment setCurrent:[Release unitTestEnvironment:@[]]];
[SGNKeychainUtil generateSignaling];
[SignalKeyingStorage generateSignaling];
[Environment setCurrent:testEnv];
}