session-ios/Signal/src/environment/Environment.h

96 lines
4.3 KiB
C
Raw Normal View History

2014-05-06 19:41:08 +02:00
#import <Foundation/Foundation.h>
#import "Logging.h"
#import "PropertyListPreferences.h"
#import "PacketHandler.h"
#import "SecureEndPoint.h"
#import "TSGroupModel.h"
#import "TSStorageHeaders.h"
iOS 9 Support - Fixing size classes rendering bugs. - Supporting native iOS San Francisco font. - Quick Reply - Settings now slide to the left as suggested in original designed opposed to modal. - Simplification of restraints on many screens. - Full-API compatiblity with iOS 9 and iOS 8 legacy support. - Customized AddressBook Permission prompt when restrictions are enabled. If user installed Signal previously and already approved access to Contacts, don't bugg him again. - Fixes crash in migration for users who installed Signal <2.1.3 but hadn't signed up yet. - Xcode 7 / iOS 9 Travis Support - Bitcode Support is disabled until it is better understood how exactly optimizations are performed. In a first time, we will split out the crypto code into a separate binary to make it easier to optimize the non-sensitive code. Blog post with more details coming. - Partial ATS support. We are running our own Certificate Authority at Open Whisper Systems. Signal is doing certificate pinning to verify that certificates were signed by our own CA. Unfortunately Apple's App Transport Security requires to hand over chain verification to their framework with no control over the trust store. We have filed a radar to get ATS features with pinned certificates. In the meanwhile, ATS is disabled on our domain. We also followed Amazon's recommendations for our S3 domain we use to upload/download attachments. (#891) - Implement a unified `AFSecurityOWSPolicy` pinning strategy accross libraries (AFNetworking RedPhone/TextSecure & SocketRocket).
2015-09-01 19:22:08 +02:00
static NSString* const kCallSegue = @"2.0_6.0_Call_Segue";
2014-05-06 19:41:08 +02:00
/**
*
* Environment is a data and data accessor class.
* It handles application-level component wiring in order to support mocks for testing.
* It also handles network configuration for testing/deployment server configurations.
*
2014-05-06 19:41:08 +02:00
**/
#define SAMPLE_RATE 8000
#define ENVIRONMENT_TESTING_OPTION_LOSE_CONF_ACK_ON_PURPOSE @"LoseConfAck"
#define ENVIRONMENT_TESTING_OPTION_ALLOW_NETWORK_STREAM_TO_NON_SECURE_END_POINTS @"AllowTcpWithoutTls"
#define ENVIRONMENT_LEGACY_OPTION_RTP_PADDING_BIT_IMPLIES_EXTENSION_BIT_AND_TWELVE_EXTRA_ZERO_BYTES_IN_HEADER @"LegacyAndroidInterop_1"
#define TESTING_OPTION_USE_DH_FOR_HANDSHAKE @"DhKeyAgreementOnly"
2014-05-06 19:41:08 +02:00
@class RecentCallManager;
@class ContactsManager;
@class PhoneManager;
@class PhoneNumberDirectoryFilterManager;
@class SignalsViewController;
2014-05-06 19:41:08 +02:00
@interface Environment : NSObject
@property (nonatomic, readonly) in_port_t serverPort;
@property (nonatomic, readonly) id<Logging> logging;
@property (nonatomic, readonly) SecureEndPoint* masterServerSecureEndPoint;
@property (nonatomic, readonly) NSString* defaultRelayName;
@property (nonatomic, readonly) Certificate* certificate;
@property (nonatomic, readonly) NSString* relayServerHostNameSuffix;
@property (nonatomic, readonly) NSArray* keyAgreementProtocolsInDescendingPriority;
@property (nonatomic, readonly) ErrorHandlerBlock errorNoter;
@property (nonatomic, readonly) NSString* currentRegionCodeForPhoneNumbers;
@property (nonatomic, readonly) PhoneManager* phoneManager;
@property (nonatomic, readonly) RecentCallManager *recentCallManager;
@property (nonatomic, readonly) NSArray* testingAndLegacyOptions;
@property (nonatomic, readonly) NSData* zrtpClientId;
@property (nonatomic, readonly) NSData* zrtpVersionId;
@property (nonatomic, readonly) ContactsManager *contactsManager;
@property (nonatomic, readonly) PhoneNumberDirectoryFilterManager* phoneDirectoryManager;
@property (nonatomic, readonly) SignalsViewController *signalsViewController;
@property (nonatomic, readonly, weak) UINavigationController *signUpFlowNavigationController;
2014-05-06 19:41:08 +02:00
+(SecureEndPoint*) getMasterServerSecureEndPoint;
+(SecureEndPoint*) getSecureEndPointToDefaultRelayServer;
+(SecureEndPoint*) getSecureEndPointToSignalingServerNamed:(NSString*)name;
+(Environment*) environmentWithLogging:(id<Logging>)logging
andErrorNoter:(ErrorHandlerBlock)errorNoter
andServerPort:(in_port_t)serverPort
andMasterServerHostName:(NSString*)masterServerHostName
andDefaultRelayName:(NSString*)defaultRelayName
andRelayServerHostNameSuffix:(NSString*)relayServerHostNameSuffix
andCertificate:(Certificate*)certificate
andCurrentRegionCodeForPhoneNumbers:(NSString*)currentRegionCodeForPhoneNumbers
andSupportedKeyAgreementProtocols:(NSArray*)keyAgreementProtocolsInDescendingPriority
andPhoneManager:(PhoneManager*)phoneManager
andRecentCallManager:(RecentCallManager *)recentCallManager
andTestingAndLegacyOptions:(NSArray*)testingAndLegacyOptions
andZrtpClientId:(NSData*)zrtpClientId
andZrtpVersionId:(NSData*)zrtpVersionId
andContactsManager:(ContactsManager *)contactsManager
andPhoneDirectoryManager:(PhoneNumberDirectoryFilterManager*)phoneDirectoryManager;
2014-05-06 19:41:08 +02:00
+(Environment*) getCurrent;
+(void) setCurrent:(Environment*)curEnvironment;
+(id<Logging>) logging;
+(NSString*) relayServerNameToHostName:(NSString*)name;
+(ErrorHandlerBlock) errorNoter;
+(NSString*) currentRegionCodeForPhoneNumbers;
+(bool) hasEnabledTestingOrLegacyOption:(NSString*)flag;
+(PhoneManager*) phoneManager;
+(PropertyListPreferences*)preferences;
+(BOOL)isRedPhoneRegistered;
2014-07-11 00:33:51 +02:00
+(void)resetAppData;
- (void)initCallListener;
- (void)setSignalsViewController:(SignalsViewController *)signalsViewController;
- (void)setSignUpFlowNavigationController:(UINavigationController *)signUpFlowNavigationController;
+ (void)messageThreadId:(NSString*)threadId;
+ (void)messageIdentifier:(NSString*)identifier withCompose:(BOOL)compose;
+ (void)messageGroupModel:(TSGroupModel*)model withCompose:(BOOL)compose;
2014-05-06 19:41:08 +02:00
@end