From a588f27c65c8857edbeb206ecd918b766a9d0174 Mon Sep 17 00:00:00 2001 From: Frederic Jacobs Date: Wed, 30 Jul 2014 02:05:36 -0400 Subject: [PATCH 1/5] Transitioning off custom preference files --- Signal.xcodeproj/project.pbxproj | 14 +- Signal/Signal-Info.plist | 4 +- Signal/src/AppDelegate.m | 34 +++- .../processing/DesiredBufferDepthController.m | 4 +- Signal/src/environment/Environment.h | 39 +++-- Signal/src/environment/Environment.m | 54 ++++--- Signal/src/environment/PreferencesUtil.h | 9 -- Signal/src/environment/PreferencesUtil.m | 54 +------ .../src/environment/PropertyListPreferences.h | 7 +- .../src/environment/PropertyListPreferences.m | 54 +------ Signal/src/environment/Release.m | 6 +- Signal/src/environment/VersionMigrations.h | 15 ++ Signal/src/environment/VersionMigrations.m | 39 +++++ .../PhoneNumberDirectoryFilterManager.m | 2 +- Signal/src/util/DateUtil.m | 8 +- .../PreferenceListViewController.h | 26 ---- .../PreferenceListViewController.m | 67 -------- .../view controllers/SettingsViewController.h | 8 - .../view controllers/SettingsViewController.m | 65 +------- .../xibs/SettingsViewController.xib | 145 ------------------ .../translations/en.lproj/Localizable.strings | 2 +- 21 files changed, 160 insertions(+), 496 deletions(-) create mode 100644 Signal/src/environment/VersionMigrations.h create mode 100644 Signal/src/environment/VersionMigrations.m delete mode 100644 Signal/src/view controllers/PreferenceListViewController.h delete mode 100644 Signal/src/view controllers/PreferenceListViewController.m diff --git a/Signal.xcodeproj/project.pbxproj b/Signal.xcodeproj/project.pbxproj index eb820004f..83c3f5351 100644 --- a/Signal.xcodeproj/project.pbxproj +++ b/Signal.xcodeproj/project.pbxproj @@ -48,8 +48,6 @@ 765052B3182BF839008313E1 /* HelveticaNeueLTStd-Th.otf in Resources */ = {isa = PBXBuildFile; fileRef = 765052B1182BF839008313E1 /* HelveticaNeueLTStd-Th.otf */; }; 768A1A2B17FC9CD300E00ED8 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 768A1A2A17FC9CD300E00ED8 /* libz.dylib */; }; 76919BF71805D190008C664A /* ContactManagerTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 76919BF61805D190008C664A /* ContactManagerTest.m */; }; - 76B8189E182C39460088060E /* PreferenceListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 76B8189C182C39460088060E /* PreferenceListViewController.m */; }; - 76B8189F182C39460088060E /* PreferenceListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 76B8189C182C39460088060E /* PreferenceListViewController.m */; }; 76B818A1182C39460088060E /* PreferenceListViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76B8189D182C39460088060E /* PreferenceListViewController.xib */; }; 76C87F13181EE11C00C4ACAB /* InboxFeedFooterCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 76C87F12181EE11C00C4ACAB /* InboxFeedFooterCell.m */; }; 76C87F14181EE11C00C4ACAB /* InboxFeedFooterCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 76C87F12181EE11C00C4ACAB /* InboxFeedFooterCell.m */; }; @@ -380,6 +378,7 @@ A1C32D5017A06538000A904E /* AddressBookUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A1C32D4F17A06537000A904E /* AddressBookUI.framework */; }; A1C32D5117A06544000A904E /* AddressBook.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A1C32D4D17A0652C000A904E /* AddressBook.framework */; }; AA0C8E498E2046B0B81EEE6E /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8313AE91B4954215858A5662 /* libPods.a */; }; + B60C16651988999D00E97A6C /* VersionMigrations.m in Sources */ = {isa = PBXBuildFile; fileRef = B60C16641988999D00E97A6C /* VersionMigrations.m */; }; B67EBF5D19194AC60084CCFD /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = B67EBF5C19194AC60084CCFD /* Settings.bundle */; }; B69CD25119773E79005CE69A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B69CD25019773E79005CE69A /* XCTest.framework */; }; B6B1013C196D213F007E3930 /* SGNKeychainUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B1013B196D213F007E3930 /* SGNKeychainUtil.m */; }; @@ -719,8 +718,6 @@ 765052B1182BF839008313E1 /* HelveticaNeueLTStd-Th.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "HelveticaNeueLTStd-Th.otf"; sourceTree = ""; }; 768A1A2A17FC9CD300E00ED8 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; 76919BF61805D190008C664A /* ContactManagerTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ContactManagerTest.m; path = contact/ContactManagerTest.m; sourceTree = ""; }; - 76B8189B182C39460088060E /* PreferenceListViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PreferenceListViewController.h; sourceTree = ""; }; - 76B8189C182C39460088060E /* PreferenceListViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PreferenceListViewController.m; sourceTree = ""; }; 76B8189D182C39460088060E /* PreferenceListViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = PreferenceListViewController.xib; path = ../PreferenceListViewController.xib; sourceTree = ""; }; 76C87F11181EE11C00C4ACAB /* InboxFeedFooterCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InboxFeedFooterCell.h; sourceTree = ""; }; 76C87F12181EE11C00C4ACAB /* InboxFeedFooterCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InboxFeedFooterCell.m; sourceTree = ""; }; @@ -1102,6 +1099,8 @@ A1C32D4D17A0652C000A904E /* AddressBook.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AddressBook.framework; path = System/Library/Frameworks/AddressBook.framework; sourceTree = SDKROOT; }; A1C32D4F17A06537000A904E /* AddressBookUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AddressBookUI.framework; path = System/Library/Frameworks/AddressBookUI.framework; sourceTree = SDKROOT; }; A1FDCBEE16DAA6C300868894 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; + B60C16631988999D00E97A6C /* VersionMigrations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VersionMigrations.h; sourceTree = ""; }; + B60C16641988999D00E97A6C /* VersionMigrations.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VersionMigrations.m; sourceTree = ""; }; B657DDC91911A40500F45B0C /* Signal.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = Signal.entitlements; sourceTree = ""; }; B67EBF5C19194AC60084CCFD /* Settings.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = Settings.bundle; path = SettingsBundle/Settings.bundle; sourceTree = SOURCE_ROOT; }; B69CD25019773E79005CE69A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; @@ -1686,6 +1685,8 @@ 76EB041B18170B33006006FC /* Release.m */, B6B1013A196D213F007E3930 /* SGNKeychainUtil.h */, B6B1013B196D213F007E3930 /* SGNKeychainUtil.m */, + B60C16631988999D00E97A6C /* VersionMigrations.h */, + B60C16641988999D00E97A6C /* VersionMigrations.m */, ); path = environment; sourceTree = ""; @@ -2123,8 +2124,6 @@ 76EB050E18170B33006006FC /* LeftSideMenuViewController.m */, 76EB050F18170B33006006FC /* NextResponderScrollView.h */, 76EB051018170B33006006FC /* NextResponderScrollView.m */, - 76B8189B182C39460088060E /* PreferenceListViewController.h */, - 76B8189C182C39460088060E /* PreferenceListViewController.m */, 76EB051518170B33006006FC /* RegisterViewController.h */, 76EB051618170B33006006FC /* RegisterViewController.m */, 76EB051718170B33006006FC /* SettingsViewController.h */, @@ -3038,6 +3037,7 @@ 76EB066218170B34006006FC /* SettingsViewController.m in Sources */, 76EB054818170B33006006FC /* CancelTokenSource.m in Sources */, 76EB05AC18170B33006006FC /* SrtpSocket.m in Sources */, + B60C16651988999D00E97A6C /* VersionMigrations.m in Sources */, 76EB062A18170B33006006FC /* BadState.m in Sources */, B97940271832BD2400BD66CB /* UIUtil.m in Sources */, 76EB05BE18170B33006006FC /* ConfirmPacket.m in Sources */, @@ -3098,7 +3098,6 @@ 76EB058218170B33006006FC /* Environment.m in Sources */, 76EB064418170B33006006FC /* ThreadManager.m in Sources */, 70B8011A190C55660042E3F0 /* UnknownFieldSet.m in Sources */, - 76B8189E182C39460088060E /* PreferenceListViewController.m in Sources */, 70B80114190C55660042E3F0 /* Field.m in Sources */, E197B61E18BBEC6D00F073E5 /* AudioRouter.m in Sources */, E197B60D18BBEC1A00F073E5 /* AudioSocket.m in Sources */, @@ -3232,7 +3231,6 @@ 76EB05BF18170B33006006FC /* ConfirmPacket.m in Sources */, 76EB05E518170B33006006FC /* UdpSocket.m in Sources */, 76EB05BD18170B33006006FC /* ConfirmAckPacket.m in Sources */, - 76B8189F182C39460088060E /* PreferenceListViewController.m in Sources */, 76EB05DB18170B33006006FC /* LowLatencyConnector.m in Sources */, 76EB060F18170B33006006FC /* DecayingSampleEstimator.m in Sources */, 76EB055318170B33006006FC /* TimeoutFailure.m in Sources */, diff --git a/Signal/Signal-Info.plist b/Signal/Signal-Info.plist index d5b995c51..91f847381 100644 --- a/Signal/Signal-Info.plist +++ b/Signal/Signal-Info.plist @@ -29,11 +29,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.0.2 + 1.0.3 CFBundleSignature ???? CFBundleVersion - 1.0.2 + 1.0.3 LSApplicationCategoryType LSRequiresIPhoneOS diff --git a/Signal/src/AppDelegate.m b/Signal/src/AppDelegate.m index c87e947cd..403eddc16 100644 --- a/Signal/src/AppDelegate.m +++ b/Signal/src/AppDelegate.m @@ -16,6 +16,7 @@ #import "Util.h" #import #import "Environment.h" +#import "VersionMigrations.h" #define kSignalVersionKey @"SignalUpdateVersionKey" @@ -47,18 +48,39 @@ [Environment setCurrent:[Release releaseEnvironmentWithLogging:nil]]; [Environment resetAppData]; // We clean previous keychain entries in case their are some entries remaining. } else if ([currentVersion compare:previousVersion options:NSNumericSearch] == NSOrderedDescending){ - // The application was updated - DDLogWarn(@"Application was updated from %@ to %@", previousVersion, currentVersion); + // Application was updated, let's see if we have a migration scheme for it. + + if ([previousVersion isEqualToString:@"1.0.2"]) { + + } + } [[NSUserDefaults standardUserDefaults] setObject:currentVersion forKey:kSignalVersionKey]; [[NSUserDefaults standardUserDefaults] synchronize]; } -#pragma mark Disable cloud/iTunes syncing of call log -- (void)disableCallLogBackup{ - NSString *preferencesPath = [[NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) objectAtIndex:0] stringByAppendingString:@"/Preferences"]; +/** + * Protects the preference and logs file with disk encryption and prevents them to leak to iCloud. + */ + +- (void)protectPreferenceFiles{ + + // We have two kind of data to deal with for now, preference files (/Library/Preferences), logs (/Library/Caches) and pr + + NSString *path = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) objectAtIndex:0]; + NSLog(@"PATH: %@", path); + + NSString *path2 = [NSHomeDirectory() stringByAppendingString:@"/Documents"]; + + NSArray *directoryEnum = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:path2 error:nil]; + + NSLog(@"%@",directoryEnum); + + NSLog(@"%@ vs %@", NSHomeDirectory(), [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) objectAtIndex:0]); + + NSString *preferencesPath = [NSHomeDirectory() stringByAppendingString:@"/Library/Preferences"]; NSString *userDefaultsString = [NSString stringWithFormat:@"%@/%@.plist", preferencesPath,[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleIdentifier"]]; NSURL *userDefaultsURL = [NSURL fileURLWithPath:userDefaultsString]; @@ -81,7 +103,7 @@ [DDLog addLogger:self.fileLogger]; [self performUpdateCheck]; - [self disableCallLogBackup]; + [self protectPreferenceFiles]; self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; self.notificationTracker = [NotificationTracker notificationTracker]; diff --git a/Signal/src/audio/incall_audio/processing/DesiredBufferDepthController.m b/Signal/src/audio/incall_audio/processing/DesiredBufferDepthController.m index 42bc0bdef..3064696a7 100644 --- a/Signal/src/audio/incall_audio/processing/DesiredBufferDepthController.m +++ b/Signal/src/audio/incall_audio/processing/DesiredBufferDepthController.m @@ -17,7 +17,7 @@ NSTimeInterval audioDurationPerPacket = (NSTimeInterval)(AUDIO_FRAMES_PER_PACKET*[SpeexCodec frameSizeInSamples]) / SAMPLE_RATE; - double initialDesiredBufferDepth = [[Environment preferences] getCachedOrDefaultDesiredBufferDepth]; + double initialDesiredBufferDepth = [[[Environment getCurrent]preferences] getCachedOrDefaultDesiredBufferDepth]; DropoutTracker* dropoutTracker = [DropoutTracker dropoutTrackerWithAudioDurationPerPacket:audioDurationPerPacket]; @@ -59,7 +59,7 @@ } -(void) terminate { - [[Environment preferences] setCachedDesiredBufferDepth:[decayingDesiredBufferDepth currentEstimate]]; + [[[Environment getCurrent]preferences] setCachedDesiredBufferDepth:[decayingDesiredBufferDepth currentEstimate]]; } @end diff --git a/Signal/src/environment/Environment.h b/Signal/src/environment/Environment.h index 125ea46a0..99f250370 100644 --- a/Signal/src/environment/Environment.h +++ b/Signal/src/environment/Environment.h @@ -9,7 +9,7 @@ * 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. - * + * **/ #define SAMPLE_RATE 8000 @@ -24,7 +24,6 @@ @class PhoneNumberDirectoryFilterManager; @interface Environment : NSObject -@property (nonatomic, readonly) PropertyListPreferences* preferences; @property (nonatomic, readonly) in_port_t serverPort; @property (nonatomic, readonly) id logging; @property (nonatomic, readonly) SecureEndPoint* masterServerSecureEndPoint; @@ -46,27 +45,25 @@ +(SecureEndPoint*) getSecureEndPointToDefaultRelayServer; +(SecureEndPoint*) getSecureEndPointToSignalingServerNamed:(NSString*)name; -+(Environment*) environmentWithPreferences:(PropertyListPreferences*)preferences - andLogging:(id)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; ++(Environment*) environmentWithLogging:(id)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; +(Environment*) getCurrent; +(void) setCurrent:(Environment*)curEnvironment; -+(PropertyListPreferences*) preferences; +(id) logging; +(NSString*) relayServerNameToHostName:(NSString*)name; +(ErrorHandlerBlock) errorNoter; @@ -74,6 +71,8 @@ +(bool) hasEnabledTestingOrLegacyOption:(NSString*)flag; +(PhoneManager*) phoneManager; +-(PropertyListPreferences*)preferences; + +(BOOL)isRegistered; +(void)setRegistered:(BOOL)status; +(void)resetAppData; diff --git a/Signal/src/environment/Environment.m b/Signal/src/environment/Environment.m index 5c70fd8b9..2484da6cd 100644 --- a/Signal/src/environment/Environment.m +++ b/Signal/src/environment/Environment.m @@ -16,22 +16,21 @@ static Environment* environment = nil; @implementation Environment @synthesize testingAndLegacyOptions, - currentRegionCodeForPhoneNumbers, - errorNoter, - keyAgreementProtocolsInDescendingPriority, - logging, - masterServerSecureEndPoint, - preferences, - defaultRelayName, - relayServerHostNameSuffix, - certificate, - serverPort, - zrtpClientId, - zrtpVersionId, - phoneManager, - recentCallManager, - contactsManager, - phoneDirectoryManager; +currentRegionCodeForPhoneNumbers, +errorNoter, +keyAgreementProtocolsInDescendingPriority, +logging, +masterServerSecureEndPoint, +defaultRelayName, +relayServerHostNameSuffix, +certificate, +serverPort, +zrtpClientId, +zrtpVersionId, +phoneManager, +recentCallManager, +contactsManager, +phoneDirectoryManager; +(NSString*) currentRegionCodeForPhoneNumbers { return [[self getCurrent] currentRegionCodeForPhoneNumbers]; @@ -71,8 +70,7 @@ static Environment* environment = nil; return [SecureEndPoint secureEndPointForHost:location identifiedByCertificate:env.certificate]; } - +(Environment*) environmentWithPreferences:(PropertyListPreferences*)preferences - andLogging:(id)logging ++(Environment*) environmentWithLogging:(id)logging andErrorNoter:(ErrorHandlerBlock)errorNoter andServerPort:(in_port_t)serverPort andMasterServerHostName:(NSString*)masterServerHostName @@ -88,8 +86,8 @@ static Environment* environment = nil; andZrtpVersionId:(NSData*)zrtpVersionId andContactsManager:(ContactsManager *)contactsManager andPhoneDirectoryManager:(PhoneNumberDirectoryFilterManager*)phoneDirectoryManager { + require(errorNoter != nil); - require(preferences != nil); require(zrtpClientId != nil); require(zrtpVersionId != nil); require(testingAndLegacyOptions != nil); @@ -98,14 +96,13 @@ static Environment* environment = nil; require([keyAgreementProtocolsInDescendingPriority all:^int(id p) { return [p conformsToProtocol:@protocol(KeyAgreementProtocol)]; }]); - + // must support DH3k require([keyAgreementProtocolsInDescendingPriority any:^int(id p) { return [p isKindOfClass:[DH3KKeyAgreementProtocol class]]; }]); - + Environment* e = [Environment new]; - e->preferences = preferences; e->errorNoter = errorNoter; e->logging = logging; e->testingAndLegacyOptions = testingAndLegacyOptions; @@ -124,7 +121,7 @@ static Environment* environment = nil; e->zrtpClientId = zrtpClientId; e->zrtpVersionId = zrtpVersionId; e->contactsManager = contactsManager; - + // @todo: better place for this? if (recentCallManager != nil) { [recentCallManager watchForCallsThrough:phoneManager @@ -132,13 +129,10 @@ static Environment* environment = nil; [recentCallManager watchForContactUpdatesFrom:contactsManager untillCancelled:nil]; } - + return e; - } - -+(PropertyListPreferences*) preferences { - return [[Environment getCurrent] preferences]; } + +(PhoneManager*) phoneManager { return [[Environment getCurrent] phoneManager]; } @@ -165,6 +159,10 @@ static Environment* environment = nil; [[NSUserDefaults standardUserDefaults] setObject:status?@YES:@NO forKey:isRegisteredUserDefaultString]; } +-(PropertyListPreferences*)preferences{ + return [[PropertyListPreferences alloc]init]; +} + +(void)resetAppData{ [SGNKeychainUtil wipeKeychain]; [NSUserDefaults resetStandardUserDefaults]; diff --git a/Signal/src/environment/PreferencesUtil.h b/Signal/src/environment/PreferencesUtil.h index cf2d48f10..5cf08547f 100644 --- a/Signal/src/environment/PreferencesUtil.h +++ b/Signal/src/environment/PreferencesUtil.h @@ -12,24 +12,15 @@ -(void) setSavedPhoneNumberDirectory:(PhoneNumberDirectoryFilter*)phoneNumberDirectoryFilter; -(NSTimeInterval) getCachedOrDefaultDesiredBufferDepth; -(void) setCachedDesiredBufferDepth:(double)value; --(void) setSettingsRowExpandedPrefs:(NSArray *)prefs; --(NSArray *) getOrGenerateSettingsRowExpandedPrefs; --(NSArray *) getAvailableDateFormats; -(BOOL) getFreshInstallTutorialsEnabled; -(BOOL) getContactImagesEnabled; -(BOOL) getAutocorrectEnabled; -(BOOL) getHistoryLogEnabled; --(BOOL) getAnonymousFeedbackEnabled; --(NSString *) getDateFormat; --(void) setDateFormat:(NSString *)format; -(void) setFreshInstallTutorialsEnabled:(BOOL)enabled; -(void) setContactImagesEnabled:(BOOL)enabled; -(void) setAutocorrectEnabled:(BOOL)enabled; -(void) setHistoryLogEnabled:(BOOL)enabled; --(void) setAnonymousFeedbackEnabled:(BOOL)enabled; - --(NSString *)getDateFormatKey; @end diff --git a/Signal/src/environment/PreferencesUtil.m b/Signal/src/environment/PreferencesUtil.m index 7a965c86e..8f9b18354 100644 --- a/Signal/src/environment/PreferencesUtil.m +++ b/Signal/src/environment/PreferencesUtil.m @@ -20,15 +20,6 @@ #define CONTACT_IMAGES_ENABLED_KEY @"Contact Images Enabled Key" #define AUTOCORRECT_ENABLED_KEY @"Autocorrect Enabled Key" #define HISTORY_LOG_ENABLED_KEY @"History Log Enabled Key" -#define ANONYMOUS_FEEDBACK_ENABLED_KEY @"Anonymous Feedback Enabled Key" - -#define DATE_FORMAT_KEY @"Date Format Key" -#define DATE_FORMAT_1 @"dd-MM-yyyy" -#define DATE_FORMAT_2 @"yyyy-MM-dd" -#define DATE_FORMAT_3 @"MM-dd-yyyy" -#define DATE_FORMAT_4 @"dd/MM/yyyy" -#define DATE_FORMAT_5 @"yyyy/MM/dd" -#define DATE_FORMAT_6 @"MM/dd/yyyy" @implementation PropertyListPreferences (PropertyUtil) @@ -42,7 +33,6 @@ andExpirationDate:expiration]; } -(void) setSavedPhoneNumberDirectory:(PhoneNumberDirectoryFilter*)phoneNumberDirectoryFilter { - // note: clearing before setting so that torn reads can be detected [self setValueForKey:PHONE_DIRECTORY_BLOOM_FILTER_DATA_KEY toValue:nil]; [self setValueForKey:PHONE_DIRECTORY_BLOOM_FILTER_HASH_COUNT_KEY toValue:nil]; [self setValueForKey:PHONE_DIRECTORY_EXPIRATION toValue:nil]; @@ -71,34 +61,6 @@ [self setValueForKey:CALL_STREAM_DES_BUFFER_LEVEL_KEY toValue:[NSNumber numberWithDouble:value]]; } --(void) setSettingsRowExpandedPrefs:(NSArray *)prefs { - [self setValueForKey:SETTINGS_EXPANDED_ROW_PREF_DICT_KEY toValue:prefs]; -} - --(NSArray *) getOrGenerateSettingsRowExpandedPrefs { - NSArray *prefs = [self tryGetValueForKey:SETTINGS_EXPANDED_ROW_PREF_DICT_KEY]; - if (!prefs) { - prefs = @[[NSNumber numberWithBool:true], [NSNumber numberWithBool:true], [NSNumber numberWithBool:true], [NSNumber numberWithBool:true]]; - } - return prefs; -} - --(NSArray *) getAvailableDateFormats { - return @[DATE_FORMAT_1, DATE_FORMAT_2, DATE_FORMAT_3, DATE_FORMAT_4, DATE_FORMAT_5, DATE_FORMAT_6]; -} - -- (NSString *)getDateFormat { - NSString *format = [self tryGetValueForKey:DATE_FORMAT_KEY]; - if (format) { - return format; - } else { - return DATE_FORMAT_1; - } -} - -- (NSString *)getDateFormatKey { - return DATE_FORMAT_KEY; -} -(BOOL) getFreshInstallTutorialsEnabled { NSNumber *preference = [self tryGetValueForKey:FRESH_INSTALL_TUTORIALS_ENABLED_KEY]; if (preference) { @@ -131,18 +93,6 @@ return YES; } } --(BOOL) getAnonymousFeedbackEnabled { - NSNumber *preference = [self tryGetValueForKey:ANONYMOUS_FEEDBACK_ENABLED_KEY]; - if (preference) { - return [preference boolValue]; - } else { - return NO; - } -} - --(void) setDateFormat:(NSString *)format { - [self setValueForKey:DATE_FORMAT_KEY toValue:format]; -} -(void) setFreshInstallTutorialsEnabled:(BOOL)enabled { [self setValueForKey:FRESH_INSTALL_TUTORIALS_ENABLED_KEY toValue:[NSNumber numberWithBool:enabled]]; @@ -156,7 +106,5 @@ -(void) setHistoryLogEnabled:(BOOL)enabled { [self setValueForKey:HISTORY_LOG_ENABLED_KEY toValue:[NSNumber numberWithBool:enabled]]; } --(void) setAnonymousFeedbackEnabled:(BOOL)enabled { - [self setValueForKey:ANONYMOUS_FEEDBACK_ENABLED_KEY toValue:[NSNumber numberWithBool:enabled]]; -} + @end diff --git a/Signal/src/environment/PropertyListPreferences.h b/Signal/src/environment/PropertyListPreferences.h index 6aba72c30..8bf828e79 100644 --- a/Signal/src/environment/PropertyListPreferences.h +++ b/Signal/src/environment/PropertyListPreferences.h @@ -1,11 +1,6 @@ #import -@interface PropertyListPreferences : NSObject { -@private NSMutableDictionary* dictionary; -@private NSString* plistName; -} - -+(PropertyListPreferences*) propertyListPreferencesWithName:(NSString*)name; +@interface PropertyListPreferences : NSObject -(id) tryGetValueForKey:(NSString*)key; -(void) setValueForKey:(NSString*)key toValue:(id)value; diff --git a/Signal/src/environment/PropertyListPreferences.m b/Signal/src/environment/PropertyListPreferences.m index 735d7429e..2ee224627 100644 --- a/Signal/src/environment/PropertyListPreferences.m +++ b/Signal/src/environment/PropertyListPreferences.m @@ -4,63 +4,25 @@ @implementation PropertyListPreferences -+(PropertyListPreferences*) propertyListPreferencesWithName:(NSString*)name { - PropertyListPreferences* p = [PropertyListPreferences new]; - p->plistName = name; - p->dictionary = [[PropertyListPreferences readPlist:name] mutableCopy]; - return p; -} - -(void) clear { @synchronized(self) { - dictionary = [NSMutableDictionary dictionary]; - [PropertyListPreferences writePlist:dictionary withName:plistName]; + NSString *appDomain = [[NSBundle mainBundle] bundleIdentifier]; + [[NSUserDefaults standardUserDefaults] removePersistentDomainForName:appDomain]; } } -+(NSDictionary*) readPlist:(NSString*)name {require(name != nil); - NSString* documentsDirectory = [NSHomeDirectory() stringByAppendingPathComponent:@"/Documents/"]; - NSString *path = [NSString stringWithFormat:@"%@/%@.plist", documentsDirectory, name]; - - NSData *plistData = [NSData dataWithContentsOfFile:path]; - // assume empty dictionary, if no data - if (plistData == nil) return @{}; - - NSString *error; - NSPropertyListFormat format; - id plist = [NSPropertyListSerialization propertyListFromData:plistData mutabilityOption:NSPropertyListImmutable format:&format errorDescription:&error]; - checkOperationDescribe(plist != nil, ([NSString stringWithFormat:@"Error parsing plist data: %@", error])); - checkOperationDescribe([plist isKindOfClass:[NSDictionary class]], @"Plist file didn't contain a dictionary"); - - return plist; -} -+(void) writePlist:(NSDictionary*)plist withName:(NSString*)name { - NSString *errorDesc; - NSData* xmlData = [NSPropertyListSerialization dataFromPropertyList:plist format:NSPropertyListXMLFormat_v1_0 errorDescription:&errorDesc]; - checkOperationDescribe(xmlData != nil, ([NSString stringWithFormat:@"Error serializing plist: %@", errorDesc])); - - NSError* error; - NSString* documentsDirectory = [NSHomeDirectory() stringByAppendingPathComponent:@"/Documents/"]; - NSString *path = [NSString stringWithFormat:@"%@/%@.plist",documentsDirectory,name]; - bool written = [xmlData writeToFile:path options:NSDataWritingAtomic error:&error]; - checkOperationDescribe(written, ([NSString stringWithFormat:@"Error atomically writing plist to file: %@", error])); -} -(id) tryGetValueForKey:(NSString *)key { require(key != nil); @synchronized(self) { - return [dictionary objectForKey:key]; + return [[NSUserDefaults standardUserDefaults] objectForKey:key]; } } -(void) setValueForKey:(NSString *)key toValue:(id)value { require(key != nil); @synchronized(self) { - if (value == nil) { - [dictionary removeObjectForKey:key]; - DDLogWarn(@"Removing object for key: %@ ", key); - } else { - [dictionary setObject:value forKey:key]; - } - [PropertyListPreferences writePlist:dictionary withName:plistName]; + NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; + [userDefaults setObject:value forKey:key]; + [userDefaults synchronize]; } } -(id) adjustAndTryGetNewValueForKey:(NSString *)key afterAdjuster:(id (^)(id))adjuster { @@ -74,7 +36,7 @@ } } -#pragma mark KeyChain store +#pragma mark KeyChain store -(void) secureTrySetValueForKey:(NSString *)key toValue:(id)value { require(key != nil); @@ -125,7 +87,7 @@ @synchronized(self) { NSString *oldValue = [self secureTryGetStringForKey:key]; NSString *newValue = adjuster(oldValue); - [UICKeyChainStore setString:newValue forKey:key]; + [UICKeyChainStore setString:newValue forKey:key]; return newValue; } } diff --git a/Signal/src/environment/Release.m b/Signal/src/environment/Release.m index 33490c2d0..68ef5b92a 100644 --- a/Signal/src/environment/Release.m +++ b/Signal/src/environment/Release.m @@ -49,8 +49,7 @@ static unsigned char DH3K_PRIME[]={ //ErrorHandlerBlock errorDiscarder = ^(id error, id relatedInfo, bool causedTermination) {}; ErrorHandlerBlock errorNoter = ^(id error, id relatedInfo, bool causedTermination) { DDLogError(@"%@: %@, %d", error, relatedInfo, causedTermination); }; - return [Environment environmentWithPreferences:[PropertyListPreferences propertyListPreferencesWithName:@"RedPhone-Data"] - andLogging:logging + return [Environment environmentWithLogging:logging andErrorNoter:errorNoter andServerPort:31337 andMasterServerHostName:@"master.whispersystems.org" @@ -69,8 +68,7 @@ static unsigned char DH3K_PRIME[]={ } +(Environment*) unitTestEnvironment:(NSArray*)testingAndLegacyOptions { - return [Environment environmentWithPreferences:[PropertyListPreferences propertyListPreferencesWithName:@"RedPhone-Test-Data"] - andLogging:[DiscardingLog discardingLog] + return [Environment environmentWithLogging:[DiscardingLog discardingLog] andErrorNoter:^(id error, id relatedInfo, bool causedTermination) {} andServerPort:31337 andMasterServerHostName:@"testing.whispersystems.org" diff --git a/Signal/src/environment/VersionMigrations.h b/Signal/src/environment/VersionMigrations.h new file mode 100644 index 000000000..dd4cec48d --- /dev/null +++ b/Signal/src/environment/VersionMigrations.h @@ -0,0 +1,15 @@ +// +// VersionMigrations.h +// Signal +// +// Created by Frederic Jacobs on 29/07/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import + +@interface VersionMigrations : NSObject + ++ (void)migrationFrom1Dot0Dot2toLarger; + +@end diff --git a/Signal/src/environment/VersionMigrations.m b/Signal/src/environment/VersionMigrations.m new file mode 100644 index 000000000..474643418 --- /dev/null +++ b/Signal/src/environment/VersionMigrations.m @@ -0,0 +1,39 @@ +// +// VersionMigrations.m +// Signal +// +// Created by Frederic Jacobs on 29/07/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "VersionMigrations.h" + +@implementation VersionMigrations + ++ (void)migrationFrom1Dot0Dot2toLarger{ + // Read everything in preference file, drop into NSUserDefaults + + NSString* documentsDirectory = [NSHomeDirectory() stringByAppendingPathComponent:@"/Documents/"]; + NSString *path = [NSString stringWithFormat:@"%@/%@.plist", documentsDirectory, @"RedPhone-Data"]; + + NSData *plistData = [NSData dataWithContentsOfFile:path]; + + NSString *error; + NSPropertyListFormat format; + NSDictionary *dict = [NSPropertyListSerialization propertyListFromData:plistData mutabilityOption:NSPropertyListImmutable format:&format errorDescription:&error]; + + NSLog(@"%@", dict); + NSArray *entries = [dict allKeys]; + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + + for (NSUInteger i = 0; i < [entries count]; i++) { + NSString *key = [entries objectAtIndex:i]; + [defaults setObject:[dict objectForKey:key] forKey:key]; + } + + [defaults synchronize]; + + // delete +} + +@end diff --git a/Signal/src/phone/signaling/number directory/PhoneNumberDirectoryFilterManager.m b/Signal/src/phone/signaling/number directory/PhoneNumberDirectoryFilterManager.m index 2024ae1dd..06b104f37 100644 --- a/Signal/src/phone/signaling/number directory/PhoneNumberDirectoryFilterManager.m +++ b/Signal/src/phone/signaling/number directory/PhoneNumberDirectoryFilterManager.m @@ -103,7 +103,7 @@ @synchronized(self) { phoneNumberDirectoryFilter = directory; } - [[Environment preferences] setSavedPhoneNumberDirectory:directory]; + [[[Environment getCurrent]preferences] setSavedPhoneNumberDirectory:directory]; [[NSNotificationCenter defaultCenter] postNotificationName:NOTIFICATION_DIRECTORY_WAS_UPDATED object:nil]; [self scheduleUpdate]; }]; diff --git a/Signal/src/util/DateUtil.m b/Signal/src/util/DateUtil.m index be77b7438..92e220086 100644 --- a/Signal/src/util/DateUtil.m +++ b/Signal/src/util/DateUtil.m @@ -12,20 +12,20 @@ static NSString *const DATE_FORMAT_HOUR_MINUTE = @"h:mm a "; + (NSDateFormatter *)dateFormatter { NSDateFormatter *formatter = [NSDateFormatter new]; - [formatter setDateFormat:[[[Environment getCurrent] preferences] getDateFormat]]; -return formatter; + [formatter setTimeStyle:NSDateFormatterShortStyle]; + return formatter; } + (NSDateFormatter *)weekdayFormatter { NSDateFormatter *formatter = [NSDateFormatter new]; [formatter setDateFormat:DATE_FORMAT_WEEKDAY]; -return formatter; + return formatter; } + (NSDateFormatter *)timeFormatter { NSDateFormatter *formatter = [NSDateFormatter new]; [formatter setDateFormat:DATE_FORMAT_HOUR_MINUTE]; -return formatter; + return formatter; } + (BOOL)dateIsOlderThanOneDay:(NSDate *)date { diff --git a/Signal/src/view controllers/PreferenceListViewController.h b/Signal/src/view controllers/PreferenceListViewController.h deleted file mode 100644 index 622025a2f..000000000 --- a/Signal/src/view controllers/PreferenceListViewController.h +++ /dev/null @@ -1,26 +0,0 @@ -#import - -/** - * - * PreferenceListViewController displays a list of options and highlights a selected one indicated by selectedValueBlock. - * When selected, the selected block is called and the value should be updated manually. - * - */ - -typedef void (^SelectedBlock) (NSString *newValue); -typedef NSString* (^GetSelectedValueBlock) (); - -@interface PreferenceListViewController : UIViewController { - @private SelectedBlock selectedBlock; - @private GetSelectedValueBlock getSelectedValueBlock; - @private NSString *settingsValue; -} - -@property (nonatomic, strong) IBOutlet UITableView *optionTableView; -@property (nonatomic, strong) NSArray *options; - -+ (PreferenceListViewController *)preferenceListViewControllerForSelectedValue:(GetSelectedValueBlock)selectedValueBlock - andOptions:(NSArray *)options - andSelectedBlock:(SelectedBlock)block; - -@end diff --git a/Signal/src/view controllers/PreferenceListViewController.m b/Signal/src/view controllers/PreferenceListViewController.m deleted file mode 100644 index 5ceb4d7ea..000000000 --- a/Signal/src/view controllers/PreferenceListViewController.m +++ /dev/null @@ -1,67 +0,0 @@ -#import "Environment.h" -#import "PreferencesUtil.h" -#import "PreferenceListTableViewCell.h" -#import "PreferenceListViewController.h" -#import "Util.h" - -static NSString *const PREFERENCE_LIST_TABLE_VIEW_CELL = @"PreferenceListTableViewCell"; - -@implementation PreferenceListViewController - -+ (PreferenceListViewController *)preferenceListViewControllerForSelectedValue:(GetSelectedValueBlock)selectedValueBlock - andOptions:(NSArray *)options - andSelectedBlock:(SelectedBlock)block { - require(selectedValueBlock != nil); - require(block != nil); - - PreferenceListViewController *vc = [PreferenceListViewController new]; - vc.options = options; - vc->selectedBlock = block; - vc->getSelectedValueBlock = selectedValueBlock; - return vc; -} - -- (void)viewDidLoad { - [super viewDidLoad]; - self.navigationController.navigationBar.barTintColor = [UIUtil darkBackgroundColor]; - self.navigationController.navigationBar.tintColor = [UIColor whiteColor]; - self.navigationController.navigationBar.translucent = NO; - - settingsValue = getSelectedValueBlock(); - [_optionTableView reloadData]; -} - -#pragma mark - UITableViewDelegate - -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - return (NSInteger)[_options count]; -} - -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - PreferenceListTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:PREFERENCE_LIST_TABLE_VIEW_CELL]; - if (!cell) { - cell = [[PreferenceListTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault - reuseIdentifier:PREFERENCE_LIST_TABLE_VIEW_CELL]; - } - - if ([settingsValue isEqualToString:_options[(NSUInteger)indexPath.row]]) { - cell.accessoryType = UITableViewCellAccessoryCheckmark; - } else { - cell.accessoryType = UITableViewCellAccessoryNone; - } - - NSString *date = _options[(NSUInteger)indexPath.row]; - cell.preferenceTextLabel.text = [date lowercaseString]; - - return cell; -} - -- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - [tableView deselectRowAtIndexPath:indexPath animated:YES]; - - selectedBlock(_options[(NSUInteger)indexPath.row]); - settingsValue = getSelectedValueBlock(); - [_optionTableView reloadData]; -} - -@end diff --git a/Signal/src/view controllers/SettingsViewController.h b/Signal/src/view controllers/SettingsViewController.h index d4f170dcb..50950e2ac 100644 --- a/Signal/src/view controllers/SettingsViewController.h +++ b/Signal/src/view controllers/SettingsViewController.h @@ -18,7 +18,6 @@ @property (nonatomic, strong) IBOutlet UITableView *settingsTableView; @property (nonatomic, strong) IBOutlet UILabel *phoneNumberLabel; -@property (nonatomic, strong) IBOutlet UILabel *currentDateFormatLabel; @property (nonatomic, strong) IBOutlet UILabel *titleLabel; @property (nonatomic, strong) IBOutlet SettingsTableHeaderView *privacyAndSecurityHeaderView; @@ -31,14 +30,9 @@ @property (nonatomic, strong) IBOutlet UIButton *disableAutocorrectButton; @property (nonatomic, strong) IBOutlet UIButton *disableHistoryButton; -@property (nonatomic, strong) IBOutlet SettingsTableHeaderView *locationOverridesHeaderView; -@property (nonatomic, strong) IBOutlet UITableViewCell *dateFormatCell; - @property (nonatomic, strong) IBOutlet SettingsTableHeaderView *callQualityHeaderView; -@property (nonatomic, strong) IBOutlet UITableViewCell *feedbackCell; @property (nonatomic, strong) IBOutlet UITableViewCell *directoryUpdateCell; -@property (nonatomic, strong) IBOutlet UIButton *sendFeedbackButton; @property (nonatomic, strong) IBOutlet UITableViewCell *sendDebugLog; @property (nonatomic, assign) FutureSource *apnId; @@ -51,8 +45,6 @@ - (IBAction)disableAutocorrectButtonTapped; - (IBAction)disableHistoryButtonTapped; -- (IBAction)sendFeedbackButtonTapped; - - (IBAction)menuButtonTapped; @end diff --git a/Signal/src/view controllers/SettingsViewController.m b/Signal/src/view controllers/SettingsViewController.m index dcec07103..b4de6ebcf 100644 --- a/Signal/src/view controllers/SettingsViewController.m +++ b/Signal/src/view controllers/SettingsViewController.m @@ -4,7 +4,6 @@ #import "Operation.h" #import "PreferencesUtil.h" #import "PhoneNumber.h" -#import "PreferenceListViewController.h" #import "RecentCallManager.h" #import "RegisterViewController.h" #import "SettingsViewController.h" @@ -15,8 +14,7 @@ #define SECTION_HEADER_VIEW_HEIGHT 27 #define PRIVACY_SECTION_INDEX 0 -#define LOCALIZATION_SECTION_INDEX 1 -#define CALL_QUALITY_SECTION_INDEX 2 +#define CALL_QUALITY_SECTION_INDEX 1 static NSString *const CHECKBOX_CHECKMARK_IMAGE_NAME = @"checkbox_checkmark"; static NSString *const CHECKBOX_EMPTY_IMAGE_NAME = @"checkbox_empty"; @@ -24,7 +22,6 @@ static NSString *const CHECKBOX_EMPTY_IMAGE_NAME = @"checkbox_empty"; @interface SettingsViewController () { NSArray *_sectionHeaderViews; NSArray *_privacyTableViewCells; - NSArray *_localizationTableViewCells; NSArray *_callQualityTableViewCells; NSString *gistURL; @@ -37,8 +34,7 @@ static NSString *const CHECKBOX_EMPTY_IMAGE_NAME = @"checkbox_empty"; - (void)viewDidLoad { [super viewDidLoad]; - _sectionHeaderViews = @[_privacyAndSecurityHeaderView, - _locationOverridesHeaderView]; + _sectionHeaderViews = @[_privacyAndSecurityHeaderView]; _titleLabel.text = SETTINGS_NAV_BAR_TITLE; } @@ -101,8 +97,7 @@ static NSString *const CHECKBOX_EMPTY_IMAGE_NAME = @"checkbox_empty"; - (void)configureCheckboxPreferences { NSArray *buttons = @[_hideContactImagesButton, _disableAutocorrectButton, - _disableHistoryButton, - _sendFeedbackButton]; + _disableHistoryButton]; for (UIButton *button in buttons) { [button setImage:[UIImage imageNamed:CHECKBOX_EMPTY_IMAGE_NAME] @@ -115,22 +110,11 @@ static NSString *const CHECKBOX_EMPTY_IMAGE_NAME = @"checkbox_empty"; _hideContactImagesButton.selected = ![prefs getContactImagesEnabled]; _disableAutocorrectButton.selected = ![prefs getAutocorrectEnabled]; _disableHistoryButton.selected = ![prefs getHistoryLogEnabled]; - _sendFeedbackButton.selected = [prefs getAnonymousFeedbackEnabled]; } - (void)configureAllCells { - PropertyListPreferences *prefs = [[Environment getCurrent] preferences]; - NSArray *expandedSectionPrefs = [prefs getOrGenerateSettingsRowExpandedPrefs]; - - BOOL privacyExpanded = [expandedSectionPrefs[PRIVACY_SECTION_INDEX] boolValue]; - _privacyTableViewCells = privacyExpanded ? [self privacyAndSecurityCells] : nil; - [_privacyAndSecurityHeaderView setColumnStateExpanded:privacyExpanded andIsAnimated:NO]; - - BOOL localizationExpanded = [expandedSectionPrefs[LOCALIZATION_SECTION_INDEX] boolValue]; - _localizationTableViewCells = localizationExpanded ? [self localizationCells] : nil; - [_locationOverridesHeaderView setColumnStateExpanded:localizationExpanded andIsAnimated:NO]; - - _currentDateFormatLabel.text = [[prefs getDateFormat] lowercaseString]; + _privacyTableViewCells = [self privacyAndSecurityCells]; + [_privacyAndSecurityHeaderView setColumnStateExpanded:YES andIsAnimated:NO]; } - (void)saveExpandedSectionPreferences { @@ -139,8 +123,6 @@ static NSString *const CHECKBOX_EMPTY_IMAGE_NAME = @"checkbox_empty"; NSNumber *numberBoolNo = [NSNumber numberWithBool:NO]; [expandedSectionPrefs addObject:(_privacyTableViewCells ? numberBoolYes : numberBoolNo)]; - [expandedSectionPrefs addObject:(_localizationTableViewCells ? numberBoolYes : numberBoolNo)]; - [[[Environment getCurrent] preferences] setSettingsRowExpandedPrefs:expandedSectionPrefs]; } #pragma mark - Table View Helpers @@ -153,10 +135,6 @@ static NSString *const CHECKBOX_EMPTY_IMAGE_NAME = @"checkbox_empty"; _sendDebugLog]; } -- (NSArray *)localizationCells { - return @[_dateFormatCell]; -} - - (NSArray *)indexPathsForCells:(NSArray *)cells forRow:(NSInteger)row { NSMutableArray *indexPaths = [NSMutableArray array]; for (NSUInteger i = 0; i < [cells count]; i++) { @@ -169,8 +147,6 @@ static NSString *const CHECKBOX_EMPTY_IMAGE_NAME = @"checkbox_empty"; - (NSArray *)cellsForRow:(NSInteger)row { if (row == PRIVACY_SECTION_INDEX) { return [self privacyAndSecurityCells]; - } else if(row == LOCALIZATION_SECTION_INDEX) { - return [self localizationCells]; } else { return @[]; } @@ -189,12 +165,6 @@ static NSString *const CHECKBOX_EMPTY_IMAGE_NAME = @"checkbox_empty"; [_privacyAndSecurityHeaderView setColumnStateExpanded:columnExpanded andIsAnimated:YES]; } -- (void)localizationTapped { - [self toggleCells:&_localizationTableViewCells forRow:LOCALIZATION_SECTION_INDEX]; - BOOL columnExpanded = _localizationTableViewCells != nil; - [_locationOverridesHeaderView setColumnStateExpanded:columnExpanded andIsAnimated:YES]; -} - - (void)toggleCells:(NSArray *__strong*)cells forRow:(NSInteger)row { [_settingsTableView beginUpdates]; if (*cells) { @@ -224,11 +194,6 @@ static NSString *const CHECKBOX_EMPTY_IMAGE_NAME = @"checkbox_empty"; [[[Environment getCurrent] preferences] setHistoryLogEnabled:!_disableHistoryButton.selected]; } -- (IBAction)sendFeedbackButtonTapped { - _sendFeedbackButton.selected = !_sendFeedbackButton.selected; - [[[Environment getCurrent] preferences] setAnonymousFeedbackEnabled:_sendFeedbackButton.selected]; -} - - (void)clearHistory { [[[Environment getCurrent] recentCallManager] clearRecentCalls]; UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:SETTINGS_LOG_CLEAR_TITLE @@ -239,18 +204,6 @@ static NSString *const CHECKBOX_EMPTY_IMAGE_NAME = @"checkbox_empty"; [alertView show]; } -- (void)showDateFormatPicker { - NSArray *dateFormats = [[[Environment getCurrent] preferences] getAvailableDateFormats]; - - PreferenceListViewController *prefPicker = [PreferenceListViewController preferenceListViewControllerForSelectedValue:^NSString *{ - return [[Environment preferences] getDateFormat]; - } andOptions:dateFormats andSelectedBlock:^(NSString *newValue) { - [[Environment preferences] setDateFormat:newValue]; - }]; - - [self.navigationController pushViewController:prefPicker animated:YES]; -} - #pragma mark - UITableViewDelegate - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { @@ -269,8 +222,6 @@ static NSString *const CHECKBOX_EMPTY_IMAGE_NAME = @"checkbox_empty"; UIView *headerView = _sectionHeaderViews[(NSUInteger)section]; if (headerView == _privacyAndSecurityHeaderView) { return (NSInteger)[_privacyTableViewCells count]; - } else if (headerView == _locationOverridesHeaderView) { - return (NSInteger)[_localizationTableViewCells count]; } else { return 0; } @@ -281,10 +232,7 @@ static NSString *const CHECKBOX_EMPTY_IMAGE_NAME = @"checkbox_empty"; UITableViewCell *cell = nil; if (headerView == _privacyAndSecurityHeaderView) { cell = _privacyTableViewCells[(NSUInteger)indexPath.row]; - } else if (headerView == _locationOverridesHeaderView) { - cell = _localizationTableViewCells[(NSUInteger)indexPath.row]; } - [self findAndLocalizeLabelsForView:cell]; return cell; @@ -297,9 +245,6 @@ static NSString *const CHECKBOX_EMPTY_IMAGE_NAME = @"checkbox_empty"; if (cell == _clearHistoryLogCell) { [self clearHistory]; } - if (cell == _dateFormatCell) { - [self showDateFormatPicker]; - } if (cell == _sendDebugLog) { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:SETTINGS_SENDLOG_WAITING diff --git a/Signal/src/view controllers/xibs/SettingsViewController.xib b/Signal/src/view controllers/xibs/SettingsViewController.xib index 8f9e0665d..259d9202d 100644 --- a/Signal/src/view controllers/xibs/SettingsViewController.xib +++ b/Signal/src/view controllers/xibs/SettingsViewController.xib @@ -8,21 +8,16 @@ - - - - - @@ -298,45 +293,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -411,58 +367,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -484,55 +388,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Signal/translations/en.lproj/Localizable.strings b/Signal/translations/en.lproj/Localizable.strings index 5afd605a8..b7badc459 100644 --- a/Signal/translations/en.lproj/Localizable.strings +++ b/Signal/translations/en.lproj/Localizable.strings @@ -125,7 +125,7 @@ "SETTINGS_PRIVACY_AND_SECURITY" = "Privacy and Security"; "SETTINGS_RINGTONE" = "Ringtone"; "SETTINGS_SENDLOG" = "Submit Debug Log"; -"SETTINGS_SENDLOGS_WAITING" = "Sending anonymized log file\n Please wait..."; +"SETTINGS_SENDLOGS_WAITING" = "Sending log file\n Please wait..."; "SETTINGS_SENDLOG_ALERT_BODY" = "Bugs can be reported by email or by copying the log in a GitHub Issue (advanced)."; "SETTINGS_SENDLOG_ALERT_PASTE" = "Email"; "SETTINGS_SENDLOG_ALERT_EMAIL" = "GitHub Issue"; From b21c1ee1f17a5f62982584525c7750ad0643061a Mon Sep 17 00:00:00 2001 From: Frederic Jacobs Date: Wed, 30 Jul 2014 20:01:17 -0400 Subject: [PATCH 2/5] Closes #67 --- Podfile | 2 +- Podspecs/UICKeyChainStore.podspec | 18 ++++++++++++++++++ Signal/src/environment/SGNKeychainUtil.m | 3 +-- 3 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 Podspecs/UICKeyChainStore.podspec diff --git a/Podfile b/Podfile index ad0f4f337..f24c6de03 100644 --- a/Podfile +++ b/Podfile @@ -2,7 +2,7 @@ platform :ios, '7.0' link_with ["Signal", "SignalTests"] -pod 'UICKeyChainStore', '~> 1.0.5' +pod 'UICKeyChainStore', :podspec => 'Podspecs/UICKeyChainStore.podspec' pod 'OpenSSL', '~> 1.0.108' pod 'MMDrawerController', '~> 0.5.0' pod 'libPhoneNumber-iOS', '~> 0.7' diff --git a/Podspecs/UICKeyChainStore.podspec b/Podspecs/UICKeyChainStore.podspec new file mode 100644 index 000000000..f87d2f0e0 --- /dev/null +++ b/Podspecs/UICKeyChainStore.podspec @@ -0,0 +1,18 @@ +Pod::Spec.new do |s| + s.name = "UICKeyChainStore" + s.version = "1.0.6" + 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 diff --git a/Signal/src/environment/SGNKeychainUtil.m b/Signal/src/environment/SGNKeychainUtil.m index 90f3300c4..5f0f7c367 100644 --- a/Signal/src/environment/SGNKeychainUtil.m +++ b/Signal/src/environment/SGNKeychainUtil.m @@ -35,9 +35,7 @@ [self storeData:[CryptoTools generateSecureRandomData:SIGNALING_MAC_KEY_LENGTH] forKey:SIGNALING_MAC_KEY]; [self storeData:[CryptoTools generateSecureRandomData:SIGNALING_CIPHER_KEY_LENGTH] forKey:SIGNALING_CIPHER_KEY]; [self storeData:[CryptoTools generateSecureRandomData:SIGNALING_EXTRA_KEY_LENGTH] forKey:SIGNALING_EXTRA_KEY]; - [self storeData:[CryptoTools generateSecureRandomData:ZID_LENGTH] forKey:ZID_KEY]; - } +(void)wipeKeychain{ @@ -136,6 +134,7 @@ +(BOOL)storeString:(NSString*)string forKey:(NSString*)key{ BOOL success = [UICKeyChainStore setString:string forKey:key]; + if (!success) { DDLogError(@"Failed to set value for key: %@", key); } From afd5be4c31fc6d2267e3fca296a31610b6d82059 Mon Sep 17 00:00:00 2001 From: Frederic Jacobs Date: Wed, 30 Jul 2014 20:36:07 -0400 Subject: [PATCH 3/5] Closes #75 --- Signal.xcodeproj/project.pbxproj | 64 ++----------------- Signal/test/async/AsyncUtilTest.h | 5 -- Signal/test/async/AsyncUtilTest.m | 6 +- Signal/test/async/FutureSourceTest.h | 5 -- Signal/test/async/FutureSourceTest.m | 6 +- Signal/test/async/ObservableTest.h | 5 -- Signal/test/async/ObservableTest.m | 6 +- Signal/test/audio/AudioFrameTest.h | 5 -- Signal/test/audio/AudioFrameTest.m | 6 +- Signal/test/audio/AudioRemoteIOTest.h | 5 -- Signal/test/audio/AudioRemoteIOTest.m | 6 +- Signal/test/audio/AudioStretcherTest.h | 5 -- Signal/test/audio/AudioStretcherTest.m | 6 +- Signal/test/audio/JitterQueueTest.h | 5 -- Signal/test/audio/JitterQueueTest.m | 6 +- Signal/test/audio/SpeexCodecTest.h | 5 -- Signal/test/audio/SpeexCodecTest.m | 6 +- Signal/test/network/IpAddressTest.h | 5 -- Signal/test/network/IpAddressTest.m | 6 +- Signal/test/network/IpEndPointTest.h | 5 -- Signal/test/network/IpEndPointTest.m | 6 +- Signal/test/network/dns/DnsManagerTest.h | 5 -- Signal/test/network/dns/DnsManagerTest.m | 6 +- Signal/test/network/rtp/RtpPacketTests.h | 6 -- Signal/test/network/rtp/RtpPacketTests.m | 6 +- .../test/network/rtp/srtp/SecureStreamTest.h | 5 -- .../test/network/rtp/srtp/SecureStreamTest.m | 6 +- .../network/rtp/srtp/SequenceCounterTest.h | 5 -- .../network/rtp/srtp/SequenceCounterTest.m | 6 +- Signal/test/network/rtp/zrtp/DH3KAgreerTest.h | 13 ---- Signal/test/network/rtp/zrtp/DH3KAgreerTest.m | 10 --- .../network/rtp/zrtp/HandshakePacketTest.h | 5 -- .../network/rtp/zrtp/HandshakePacketTest.m | 6 +- Signal/test/network/rtp/zrtp/HashChainTest.h | 5 -- Signal/test/network/rtp/zrtp/HashChainTest.m | 6 +- .../test/network/rtp/zrtp/MasterSecretTest.h | 5 -- .../test/network/rtp/zrtp/MasterSecretTest.m | 6 +- .../ShortAuthenticationStringGeneratorTest.h | 5 -- .../ShortAuthenticationStringGeneratorTest.m | 6 +- .../network/tcp/LowLatencyConnectorTest.h | 5 -- .../network/tcp/LowLatencyConnectorTest.m | 6 +- .../test/network/tcp/tls/NetworkStreamTest.h | 5 -- .../test/network/tcp/tls/NetworkStreamTest.m | 6 +- .../test/network/tcp/tls/SecureEndPointTest.h | 5 -- .../test/network/tcp/tls/SecureEndPointTest.m | 6 +- Signal/test/phone/PhoneNumberTest.h | 5 -- Signal/test/phone/PhoneNumberTest.m | 6 +- .../phone/signaling/SessionDescriptorTest.m | 4 +- .../profiling/DecayingSampleEstimatorTest.h | 5 -- .../profiling/DecayingSampleEstimatorTest.m | 6 +- Signal/test/profiling/EventWindowTest.h | 5 -- Signal/test/profiling/EventWindowTest.m | 6 +- 52 files changed, 127 insertions(+), 229 deletions(-) delete mode 100644 Signal/test/async/AsyncUtilTest.h delete mode 100644 Signal/test/async/FutureSourceTest.h delete mode 100644 Signal/test/async/ObservableTest.h delete mode 100644 Signal/test/audio/AudioFrameTest.h delete mode 100644 Signal/test/audio/AudioRemoteIOTest.h delete mode 100644 Signal/test/audio/AudioStretcherTest.h delete mode 100644 Signal/test/audio/JitterQueueTest.h delete mode 100644 Signal/test/audio/SpeexCodecTest.h delete mode 100644 Signal/test/network/IpAddressTest.h delete mode 100644 Signal/test/network/IpEndPointTest.h delete mode 100644 Signal/test/network/dns/DnsManagerTest.h delete mode 100644 Signal/test/network/rtp/RtpPacketTests.h delete mode 100644 Signal/test/network/rtp/srtp/SecureStreamTest.h delete mode 100644 Signal/test/network/rtp/srtp/SequenceCounterTest.h delete mode 100644 Signal/test/network/rtp/zrtp/DH3KAgreerTest.h delete mode 100644 Signal/test/network/rtp/zrtp/DH3KAgreerTest.m delete mode 100644 Signal/test/network/rtp/zrtp/HandshakePacketTest.h delete mode 100644 Signal/test/network/rtp/zrtp/HashChainTest.h delete mode 100644 Signal/test/network/rtp/zrtp/MasterSecretTest.h delete mode 100644 Signal/test/network/rtp/zrtp/ShortAuthenticationStringGeneratorTest.h delete mode 100644 Signal/test/network/tcp/LowLatencyConnectorTest.h delete mode 100644 Signal/test/network/tcp/tls/NetworkStreamTest.h delete mode 100644 Signal/test/network/tcp/tls/SecureEndPointTest.h delete mode 100644 Signal/test/phone/PhoneNumberTest.h delete mode 100644 Signal/test/profiling/DecayingSampleEstimatorTest.h delete mode 100644 Signal/test/profiling/EventWindowTest.h diff --git a/Signal.xcodeproj/project.pbxproj b/Signal.xcodeproj/project.pbxproj index 83c3f5351..1706361fd 100644 --- a/Signal.xcodeproj/project.pbxproj +++ b/Signal.xcodeproj/project.pbxproj @@ -343,7 +343,6 @@ A157076117F0CD6D007C2BD6 /* RtpPacketTests.m in Sources */ = {isa = PBXBuildFile; fileRef = A157070D17F0CD6D007C2BD6 /* RtpPacketTests.m */; }; A157076217F0CD6D007C2BD6 /* SecureStreamTest.m in Sources */ = {isa = PBXBuildFile; fileRef = A157071017F0CD6D007C2BD6 /* SecureStreamTest.m */; }; A157076317F0CD6D007C2BD6 /* SequenceCounterTest.m in Sources */ = {isa = PBXBuildFile; fileRef = A157071217F0CD6D007C2BD6 /* SequenceCounterTest.m */; }; - A157076417F0CD6D007C2BD6 /* DH3KAgreerTest.m in Sources */ = {isa = PBXBuildFile; fileRef = A157071517F0CD6D007C2BD6 /* DH3KAgreerTest.m */; }; A157076517F0CD6D007C2BD6 /* HandshakePacketTest.m in Sources */ = {isa = PBXBuildFile; fileRef = A157071717F0CD6D007C2BD6 /* HandshakePacketTest.m */; }; A157076617F0CD6D007C2BD6 /* HashChainTest.m in Sources */ = {isa = PBXBuildFile; fileRef = A157071917F0CD6D007C2BD6 /* HashChainTest.m */; }; A157076717F0CD6D007C2BD6 /* MasterSecretTest.m in Sources */ = {isa = PBXBuildFile; fileRef = A157071B17F0CD6D007C2BD6 /* MasterSecretTest.m */; }; @@ -1010,65 +1009,39 @@ 76EB053F18170B33006006FC /* CallLogTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CallLogTableViewCell.xib; sourceTree = ""; }; 8313AE91B4954215858A5662 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; A11CD70C17FA230600A2D1B1 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; - A15706EC17F0CD6D007C2BD6 /* AsyncUtilTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AsyncUtilTest.h; sourceTree = ""; }; A15706ED17F0CD6D007C2BD6 /* AsyncUtilTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AsyncUtilTest.m; sourceTree = ""; }; - A15706EE17F0CD6D007C2BD6 /* FutureSourceTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FutureSourceTest.h; sourceTree = ""; }; A15706EF17F0CD6D007C2BD6 /* FutureSourceTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FutureSourceTest.m; sourceTree = ""; }; - A15706F017F0CD6D007C2BD6 /* ObservableTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObservableTest.h; sourceTree = ""; }; A15706F117F0CD6D007C2BD6 /* ObservableTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ObservableTest.m; sourceTree = ""; }; - A15706F317F0CD6D007C2BD6 /* AudioFrameTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioFrameTest.h; sourceTree = ""; }; A15706F417F0CD6D007C2BD6 /* AudioFrameTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AudioFrameTest.m; sourceTree = ""; }; - A15706F517F0CD6D007C2BD6 /* AudioRemoteIOTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioRemoteIOTest.h; sourceTree = ""; }; A15706F617F0CD6D007C2BD6 /* AudioRemoteIOTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AudioRemoteIOTest.m; sourceTree = ""; }; - A15706F717F0CD6D007C2BD6 /* AudioStretcherTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioStretcherTest.h; sourceTree = ""; }; A15706F817F0CD6D007C2BD6 /* AudioStretcherTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AudioStretcherTest.m; sourceTree = ""; }; - A15706F917F0CD6D007C2BD6 /* JitterQueueTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JitterQueueTest.h; sourceTree = ""; }; A15706FA17F0CD6D007C2BD6 /* JitterQueueTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JitterQueueTest.m; sourceTree = ""; }; - A15706FB17F0CD6D007C2BD6 /* SpeexCodecTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpeexCodecTest.h; sourceTree = ""; }; A15706FC17F0CD6D007C2BD6 /* SpeexCodecTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SpeexCodecTest.m; sourceTree = ""; }; - A157070217F0CD6D007C2BD6 /* DnsManagerTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DnsManagerTest.h; sourceTree = ""; }; A157070317F0CD6D007C2BD6 /* DnsManagerTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DnsManagerTest.m; sourceTree = ""; }; A157070517F0CD6D007C2BD6 /* HttpRequestResponseTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpRequestResponseTest.h; sourceTree = ""; }; A157070617F0CD6D007C2BD6 /* HttpRequestResponseTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HttpRequestResponseTest.m; sourceTree = ""; }; - A157070717F0CD6D007C2BD6 /* IpAddressTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IpAddressTest.h; sourceTree = ""; }; A157070817F0CD6D007C2BD6 /* IpAddressTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IpAddressTest.m; sourceTree = ""; }; - A157070917F0CD6D007C2BD6 /* IpEndPointTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IpEndPointTest.h; sourceTree = ""; }; A157070A17F0CD6D007C2BD6 /* IpEndPointTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IpEndPointTest.m; sourceTree = ""; }; - A157070C17F0CD6D007C2BD6 /* RtpPacketTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RtpPacketTests.h; sourceTree = ""; }; A157070D17F0CD6D007C2BD6 /* RtpPacketTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RtpPacketTests.m; sourceTree = ""; }; - A157070F17F0CD6D007C2BD6 /* SecureStreamTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SecureStreamTest.h; sourceTree = ""; }; A157071017F0CD6D007C2BD6 /* SecureStreamTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SecureStreamTest.m; sourceTree = ""; }; - A157071117F0CD6D007C2BD6 /* SequenceCounterTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SequenceCounterTest.h; sourceTree = ""; }; A157071217F0CD6D007C2BD6 /* SequenceCounterTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SequenceCounterTest.m; sourceTree = ""; }; - A157071417F0CD6D007C2BD6 /* DH3KAgreerTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DH3KAgreerTest.h; sourceTree = ""; }; - A157071517F0CD6D007C2BD6 /* DH3KAgreerTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DH3KAgreerTest.m; sourceTree = ""; }; - A157071617F0CD6D007C2BD6 /* HandshakePacketTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HandshakePacketTest.h; sourceTree = ""; }; A157071717F0CD6D007C2BD6 /* HandshakePacketTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HandshakePacketTest.m; sourceTree = ""; }; - A157071817F0CD6D007C2BD6 /* HashChainTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HashChainTest.h; sourceTree = ""; }; A157071917F0CD6D007C2BD6 /* HashChainTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HashChainTest.m; sourceTree = ""; }; - A157071A17F0CD6D007C2BD6 /* MasterSecretTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MasterSecretTest.h; sourceTree = ""; }; A157071B17F0CD6D007C2BD6 /* MasterSecretTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MasterSecretTest.m; sourceTree = ""; }; - A157071C17F0CD6D007C2BD6 /* ShortAuthenticationStringGeneratorTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShortAuthenticationStringGeneratorTest.h; sourceTree = ""; }; A157071D17F0CD6D007C2BD6 /* ShortAuthenticationStringGeneratorTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShortAuthenticationStringGeneratorTest.m; sourceTree = ""; }; A157071F17F0CD6D007C2BD6 /* PregeneratedKeyAgreementParticipantProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PregeneratedKeyAgreementParticipantProtocol.h; sourceTree = ""; }; A157072017F0CD6D007C2BD6 /* PregeneratedKeyAgreementParticipantProtocol.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PregeneratedKeyAgreementParticipantProtocol.m; sourceTree = ""; }; A157072117F0CD6D007C2BD6 /* ZrtpTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZrtpTest.h; sourceTree = ""; }; A157072217F0CD6D007C2BD6 /* ZrtpTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZrtpTest.m; sourceTree = ""; }; - A157072417F0CD6D007C2BD6 /* LowLatencyConnectorTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LowLatencyConnectorTest.h; sourceTree = ""; }; A157072517F0CD6D007C2BD6 /* LowLatencyConnectorTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LowLatencyConnectorTest.m; sourceTree = ""; }; - A157072717F0CD6D007C2BD6 /* NetworkStreamTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkStreamTest.h; sourceTree = ""; }; A157072817F0CD6D007C2BD6 /* NetworkStreamTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NetworkStreamTest.m; sourceTree = ""; }; - A157072917F0CD6D007C2BD6 /* SecureEndPointTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SecureEndPointTest.h; sourceTree = ""; }; A157072A17F0CD6D007C2BD6 /* SecureEndPointTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SecureEndPointTest.m; sourceTree = ""; }; A157072C17F0CD6D007C2BD6 /* UdpSocketTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UdpSocketTest.h; sourceTree = ""; }; A157072D17F0CD6D007C2BD6 /* UdpSocketTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UdpSocketTest.m; sourceTree = ""; }; - A157072F17F0CD6D007C2BD6 /* PhoneNumberTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PhoneNumberTest.h; sourceTree = ""; }; A157073017F0CD6D007C2BD6 /* PhoneNumberTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PhoneNumberTest.m; sourceTree = ""; }; A157073217F0CD6D007C2BD6 /* SessionDescriptorTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SessionDescriptorTest.h; sourceTree = ""; }; A157073317F0CD6D007C2BD6 /* SessionDescriptorTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SessionDescriptorTest.m; sourceTree = ""; }; - A157073517F0CD6D007C2BD6 /* DecayingSampleEstimatorTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DecayingSampleEstimatorTest.h; sourceTree = ""; }; A157073617F0CD6D007C2BD6 /* DecayingSampleEstimatorTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DecayingSampleEstimatorTest.m; sourceTree = ""; }; - A157073717F0CD6D007C2BD6 /* EventWindowTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventWindowTest.h; sourceTree = ""; }; A157073817F0CD6D007C2BD6 /* EventWindowTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EventWindowTest.m; sourceTree = ""; }; A157073A17F0CD6D007C2BD6 /* SignalTests-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "SignalTests-Info.plist"; sourceTree = ""; }; A157073B17F0CD6D007C2BD6 /* TestUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestUtil.h; sourceTree = ""; }; @@ -2233,11 +2206,8 @@ A15706EB17F0CD6D007C2BD6 /* async */ = { isa = PBXGroup; children = ( - A15706EC17F0CD6D007C2BD6 /* AsyncUtilTest.h */, A15706ED17F0CD6D007C2BD6 /* AsyncUtilTest.m */, - A15706EE17F0CD6D007C2BD6 /* FutureSourceTest.h */, A15706EF17F0CD6D007C2BD6 /* FutureSourceTest.m */, - A15706F017F0CD6D007C2BD6 /* ObservableTest.h */, A15706F117F0CD6D007C2BD6 /* ObservableTest.m */, ); path = async; @@ -2246,15 +2216,10 @@ A15706F217F0CD6D007C2BD6 /* audio */ = { isa = PBXGroup; children = ( - A15706F317F0CD6D007C2BD6 /* AudioFrameTest.h */, A15706F417F0CD6D007C2BD6 /* AudioFrameTest.m */, - A15706F517F0CD6D007C2BD6 /* AudioRemoteIOTest.h */, A15706F617F0CD6D007C2BD6 /* AudioRemoteIOTest.m */, - A15706F717F0CD6D007C2BD6 /* AudioStretcherTest.h */, A15706F817F0CD6D007C2BD6 /* AudioStretcherTest.m */, - A15706F917F0CD6D007C2BD6 /* JitterQueueTest.h */, A15706FA17F0CD6D007C2BD6 /* JitterQueueTest.m */, - A15706FB17F0CD6D007C2BD6 /* SpeexCodecTest.h */, A15706FC17F0CD6D007C2BD6 /* SpeexCodecTest.m */, ); path = audio; @@ -2265,9 +2230,7 @@ children = ( A157070117F0CD6D007C2BD6 /* dns */, A157070417F0CD6D007C2BD6 /* http */, - A157070717F0CD6D007C2BD6 /* IpAddressTest.h */, A157070817F0CD6D007C2BD6 /* IpAddressTest.m */, - A157070917F0CD6D007C2BD6 /* IpEndPointTest.h */, A157070A17F0CD6D007C2BD6 /* IpEndPointTest.m */, A157070B17F0CD6D007C2BD6 /* rtp */, A157072317F0CD6D007C2BD6 /* tcp */, @@ -2279,7 +2242,6 @@ A157070117F0CD6D007C2BD6 /* dns */ = { isa = PBXGroup; children = ( - A157070217F0CD6D007C2BD6 /* DnsManagerTest.h */, A157070317F0CD6D007C2BD6 /* DnsManagerTest.m */, ); path = dns; @@ -2297,7 +2259,6 @@ A157070B17F0CD6D007C2BD6 /* rtp */ = { isa = PBXGroup; children = ( - A157070C17F0CD6D007C2BD6 /* RtpPacketTests.h */, A157070D17F0CD6D007C2BD6 /* RtpPacketTests.m */, A157070E17F0CD6D007C2BD6 /* srtp */, A157071317F0CD6D007C2BD6 /* zrtp */, @@ -2308,9 +2269,7 @@ A157070E17F0CD6D007C2BD6 /* srtp */ = { isa = PBXGroup; children = ( - A157070F17F0CD6D007C2BD6 /* SecureStreamTest.h */, A157071017F0CD6D007C2BD6 /* SecureStreamTest.m */, - A157071117F0CD6D007C2BD6 /* SequenceCounterTest.h */, A157071217F0CD6D007C2BD6 /* SequenceCounterTest.m */, ); path = srtp; @@ -2319,15 +2278,9 @@ A157071317F0CD6D007C2BD6 /* zrtp */ = { isa = PBXGroup; children = ( - A157071417F0CD6D007C2BD6 /* DH3KAgreerTest.h */, - A157071517F0CD6D007C2BD6 /* DH3KAgreerTest.m */, - A157071617F0CD6D007C2BD6 /* HandshakePacketTest.h */, A157071717F0CD6D007C2BD6 /* HandshakePacketTest.m */, - A157071817F0CD6D007C2BD6 /* HashChainTest.h */, A157071917F0CD6D007C2BD6 /* HashChainTest.m */, - A157071A17F0CD6D007C2BD6 /* MasterSecretTest.h */, A157071B17F0CD6D007C2BD6 /* MasterSecretTest.m */, - A157071C17F0CD6D007C2BD6 /* ShortAuthenticationStringGeneratorTest.h */, A157071D17F0CD6D007C2BD6 /* ShortAuthenticationStringGeneratorTest.m */, A157071E17F0CD6D007C2BD6 /* utilities */, A157072117F0CD6D007C2BD6 /* ZrtpTest.h */, @@ -2349,7 +2302,6 @@ A157072317F0CD6D007C2BD6 /* tcp */ = { isa = PBXGroup; children = ( - A157072417F0CD6D007C2BD6 /* LowLatencyConnectorTest.h */, A157072517F0CD6D007C2BD6 /* LowLatencyConnectorTest.m */, A157072617F0CD6D007C2BD6 /* tls */, ); @@ -2359,9 +2311,7 @@ A157072617F0CD6D007C2BD6 /* tls */ = { isa = PBXGroup; children = ( - A157072717F0CD6D007C2BD6 /* NetworkStreamTest.h */, A157072817F0CD6D007C2BD6 /* NetworkStreamTest.m */, - A157072917F0CD6D007C2BD6 /* SecureEndPointTest.h */, A157072A17F0CD6D007C2BD6 /* SecureEndPointTest.m */, ); path = tls; @@ -2379,7 +2329,6 @@ A157072E17F0CD6D007C2BD6 /* phone */ = { isa = PBXGroup; children = ( - A157072F17F0CD6D007C2BD6 /* PhoneNumberTest.h */, A157073017F0CD6D007C2BD6 /* PhoneNumberTest.m */, A157073117F0CD6D007C2BD6 /* signaling */, ); @@ -2398,9 +2347,7 @@ A157073417F0CD6D007C2BD6 /* profiling */ = { isa = PBXGroup; children = ( - A157073517F0CD6D007C2BD6 /* DecayingSampleEstimatorTest.h */, A157073617F0CD6D007C2BD6 /* DecayingSampleEstimatorTest.m */, - A157073717F0CD6D007C2BD6 /* EventWindowTest.h */, A157073817F0CD6D007C2BD6 /* EventWindowTest.m */, ); path = profiling; @@ -3299,7 +3246,6 @@ 76EB063B18170B33006006FC /* FunctionalUtil.m in Sources */, A157076217F0CD6D007C2BD6 /* SecureStreamTest.m in Sources */, A157076317F0CD6D007C2BD6 /* SequenceCounterTest.m in Sources */, - A157076417F0CD6D007C2BD6 /* DH3KAgreerTest.m in Sources */, 76EB062318170B33006006FC /* CyclicalBuffer.m in Sources */, A157076517F0CD6D007C2BD6 /* HandshakePacketTest.m in Sources */, 76EB054918170B33006006FC /* CancelTokenSource.m in Sources */, @@ -3533,7 +3479,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = C71793B33D9C45079F74487E /* Pods.xcconfig */; buildSettings = { - CODE_SIGN_IDENTITY = ""; + CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CURRENT_PROJECT_VERSION = 1; FRAMEWORK_SEARCH_PATHS = ( @@ -3573,7 +3519,7 @@ LLVM_LTO = NO; OTHER_LDFLAGS = "$(inherited)"; PRODUCT_NAME = Signal; - PROVISIONING_PROFILE = "B26CF658-AD7F-4F4C-B94F-74884941DF87"; + PROVISIONING_PROFILE = ""; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = 1; TEST_AFTER_BUILD = YES; @@ -3770,7 +3716,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = C71793B33D9C45079F74487E /* Pods.xcconfig */; buildSettings = { - CODE_SIGN_IDENTITY = ""; + CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CURRENT_PROJECT_VERSION = 1; FRAMEWORK_SEARCH_PATHS = ( @@ -3822,7 +3768,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = C71793B33D9C45079F74487E /* Pods.xcconfig */; buildSettings = { - CODE_SIGN_IDENTITY = ""; + CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CURRENT_PROJECT_VERSION = 1; FRAMEWORK_SEARCH_PATHS = ( @@ -3857,7 +3803,7 @@ LLVM_LTO = NO; OTHER_LDFLAGS = "$(inherited)"; PRODUCT_NAME = Signal; - PROVISIONING_PROFILE = "7214A823-1F7A-4460-82D8-D89CA511CEA6"; + PROVISIONING_PROFILE = ""; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = 1; TEST_AFTER_BUILD = YES; diff --git a/Signal/test/async/AsyncUtilTest.h b/Signal/test/async/AsyncUtilTest.h deleted file mode 100644 index e368891b5..000000000 --- a/Signal/test/async/AsyncUtilTest.h +++ /dev/null @@ -1,5 +0,0 @@ -#import - -@interface AsyncUtilTest : XCTestCase - -@end diff --git a/Signal/test/async/AsyncUtilTest.m b/Signal/test/async/AsyncUtilTest.m index 9054ded33..524dc19f6 100644 --- a/Signal/test/async/AsyncUtilTest.m +++ b/Signal/test/async/AsyncUtilTest.m @@ -1,4 +1,4 @@ -#import "AsyncUtilTest.h" +#import #import "TestUtil.h" #import "AsyncUtil.h" #import "FutureSource.h" @@ -6,6 +6,10 @@ #import "CancelledToken.h" #import "ThreadManager.h" +@interface AsyncUtilTest : XCTestCase + +@end + @implementation AsyncUtilTest -(void) testRaceCancellableOperations_Winner { diff --git a/Signal/test/async/FutureSourceTest.h b/Signal/test/async/FutureSourceTest.h deleted file mode 100644 index 0843ed791..000000000 --- a/Signal/test/async/FutureSourceTest.h +++ /dev/null @@ -1,5 +0,0 @@ -#import - -@interface FutureSourceTest : XCTestCase - -@end diff --git a/Signal/test/async/FutureSourceTest.m b/Signal/test/async/FutureSourceTest.m index dcd31c7be..6c71fafdc 100644 --- a/Signal/test/async/FutureSourceTest.m +++ b/Signal/test/async/FutureSourceTest.m @@ -1,8 +1,12 @@ -#import "FutureSourceTest.h" +#import #import "TestUtil.h" #import "FutureSource.h" #import "Util.h" +@interface FutureSourceTest:XCTestCase + +@end + @implementation FutureSourceTest -(void) testConstructors { diff --git a/Signal/test/async/ObservableTest.h b/Signal/test/async/ObservableTest.h deleted file mode 100644 index 6690477fc..000000000 --- a/Signal/test/async/ObservableTest.h +++ /dev/null @@ -1,5 +0,0 @@ -#import - -@interface ObservableTest : XCTestCase - -@end diff --git a/Signal/test/async/ObservableTest.m b/Signal/test/async/ObservableTest.m index 0e334a8a9..a0c54c881 100644 --- a/Signal/test/async/ObservableTest.m +++ b/Signal/test/async/ObservableTest.m @@ -1,8 +1,12 @@ -#import "ObservableTest.h" +#import #import "ObservableValue.h" #import "TestUtil.h" #import "CancelTokenSource.h" +@interface ObservableTest : XCTestCase + +@end + @implementation ObservableTest -(void) testObservableAddRemove { diff --git a/Signal/test/audio/AudioFrameTest.h b/Signal/test/audio/AudioFrameTest.h deleted file mode 100644 index 90d6c9b70..000000000 --- a/Signal/test/audio/AudioFrameTest.h +++ /dev/null @@ -1,5 +0,0 @@ -#import - -@interface AudioFrameTest : XCTestCase - -@end diff --git a/Signal/test/audio/AudioFrameTest.m b/Signal/test/audio/AudioFrameTest.m index f3503f357..d16e318a9 100644 --- a/Signal/test/audio/AudioFrameTest.m +++ b/Signal/test/audio/AudioFrameTest.m @@ -1,7 +1,11 @@ -#import "AudioFrameTest.h" +#import #import "EncodedAudioPacket.h" #import "TestUtil.h" +@interface AudioFrameTest : XCTestCase + +@end + @implementation AudioFrameTest -(void) testTrivial { NSData* d2 = [NSMutableData dataWithLength:6]; diff --git a/Signal/test/audio/AudioRemoteIOTest.h b/Signal/test/audio/AudioRemoteIOTest.h deleted file mode 100644 index e032f3943..000000000 --- a/Signal/test/audio/AudioRemoteIOTest.h +++ /dev/null @@ -1,5 +0,0 @@ -#import - -@interface AudioRemoteIOTest : XCTestCase - -@end diff --git a/Signal/test/audio/AudioRemoteIOTest.m b/Signal/test/audio/AudioRemoteIOTest.m index 71db7a75a..46a130370 100644 --- a/Signal/test/audio/AudioRemoteIOTest.m +++ b/Signal/test/audio/AudioRemoteIOTest.m @@ -1,9 +1,13 @@ -#import "AudioRemoteIOTest.h" +#import #import "RemoteIOAudio.h" #import "AnonymousAudioCallbackHandler.h" #import "TestUtil.h" #import "CancelTokenSource.h" +@interface AudioRemoteIOTest : XCTestCase + +@end + @implementation AudioRemoteIOTest -(void) ______REMOVE_THIS_PREFIX_TO_ENABLE_ACTUAL_AUDIO_TEST______testPlaysAndRecordsAudio { diff --git a/Signal/test/audio/AudioStretcherTest.h b/Signal/test/audio/AudioStretcherTest.h deleted file mode 100644 index 9be2d7731..000000000 --- a/Signal/test/audio/AudioStretcherTest.h +++ /dev/null @@ -1,5 +0,0 @@ -#import - -@interface AudioStretcherTest : XCTestCase - -@end diff --git a/Signal/test/audio/AudioStretcherTest.m b/Signal/test/audio/AudioStretcherTest.m index 50cf84489..17ca0e979 100644 --- a/Signal/test/audio/AudioStretcherTest.m +++ b/Signal/test/audio/AudioStretcherTest.m @@ -1,7 +1,11 @@ -#import "AudioStretcherTest.h" +#import #import "TestUtil.h" #import "AudioStretcher.h" +@interface AudioStretcherTest : XCTestCase + +@end + @implementation AudioStretcherTest -(void) testStretchAudioStretches { for (NSNumber* s in @[@0.5, @1.0, @1.5]) { diff --git a/Signal/test/audio/JitterQueueTest.h b/Signal/test/audio/JitterQueueTest.h deleted file mode 100644 index d749245f5..000000000 --- a/Signal/test/audio/JitterQueueTest.h +++ /dev/null @@ -1,5 +0,0 @@ -#import - -@interface JitterQueueTest : XCTestCase - -@end diff --git a/Signal/test/audio/JitterQueueTest.m b/Signal/test/audio/JitterQueueTest.m index be5780c44..b0223f09c 100644 --- a/Signal/test/audio/JitterQueueTest.m +++ b/Signal/test/audio/JitterQueueTest.m @@ -1,4 +1,4 @@ -#import "JitterQueueTest.h" +#import #import "JitterQueue.h" #import "TestUtil.h" #import "EncodedAudioPacket.h" @@ -15,6 +15,10 @@ #define testLoggedDiscard(q, sequenceNumber, oldReadHeadSequenceNumber, newReadHeadSequenceNumber) testLogged(q, ([NSString stringWithFormat:@"discard %d,%d,%d", sequenceNumber, oldReadHeadSequenceNumber, newReadHeadSequenceNumber])) #define testLoggedResync(q, oldReadHeadSequenceNumber, newReadHeadSequenceNumber) testLogged(q, ([NSString stringWithFormat:@"resync %d to %d", oldReadHeadSequenceNumber,newReadHeadSequenceNumber])) +@interface JitterQueueTest : XCTestCase + +@end + @implementation JitterQueueTest -(void) testJitterStartsFromAnyIndex { diff --git a/Signal/test/audio/SpeexCodecTest.h b/Signal/test/audio/SpeexCodecTest.h deleted file mode 100644 index a56692ca9..000000000 --- a/Signal/test/audio/SpeexCodecTest.h +++ /dev/null @@ -1,5 +0,0 @@ -#import - -@interface SpeexCodecTest : XCTestCase - -@end diff --git a/Signal/test/audio/SpeexCodecTest.m b/Signal/test/audio/SpeexCodecTest.m index 915828c06..59d14c5e2 100644 --- a/Signal/test/audio/SpeexCodecTest.m +++ b/Signal/test/audio/SpeexCodecTest.m @@ -1,8 +1,12 @@ -#import "SpeexCodecTest.h" +#import #import "SpeexCodec.h" #import "TestUtil.h" #import "Util.h" +@interface SpeexCodecTest : XCTestCase + +@end + @implementation SpeexCodecTest -(void) testSpeexConstantBitRate { NSMutableData* x1 = [NSMutableData dataWithLength:320]; diff --git a/Signal/test/network/IpAddressTest.h b/Signal/test/network/IpAddressTest.h deleted file mode 100644 index a42286d42..000000000 --- a/Signal/test/network/IpAddressTest.h +++ /dev/null @@ -1,5 +0,0 @@ -#import - -@interface IpAddressTest : XCTestCase - -@end diff --git a/Signal/test/network/IpAddressTest.m b/Signal/test/network/IpAddressTest.m index 88db391c0..39785835b 100644 --- a/Signal/test/network/IpAddressTest.m +++ b/Signal/test/network/IpAddressTest.m @@ -1,7 +1,11 @@ -#import "IpAddressTest.h" +#import #import "TestUtil.h" #import "IpAddress.h" +@interface IpAddressTest : XCTestCase + +@end + @implementation IpAddressTest -(void) testFromString { testThrows([IpAddress ipAddressFromString:nil]); diff --git a/Signal/test/network/IpEndPointTest.h b/Signal/test/network/IpEndPointTest.h deleted file mode 100644 index 9acbbad8c..000000000 --- a/Signal/test/network/IpEndPointTest.h +++ /dev/null @@ -1,5 +0,0 @@ -#import - -@interface IpEndPointTest : XCTestCase - -@end diff --git a/Signal/test/network/IpEndPointTest.m b/Signal/test/network/IpEndPointTest.m index 0a5692f07..d59d7cc64 100644 --- a/Signal/test/network/IpEndPointTest.m +++ b/Signal/test/network/IpEndPointTest.m @@ -1,8 +1,12 @@ -#import "IpEndPointTest.h" +#import #import "TestUtil.h" #import "IpEndPoint.h" #import "IpAddress.h" +@interface IpEndPointTest : XCTestCase + +@end + @implementation IpEndPointTest -(void) testTrivial { IpAddress* a = [IpAddress localhost]; diff --git a/Signal/test/network/dns/DnsManagerTest.h b/Signal/test/network/dns/DnsManagerTest.h deleted file mode 100644 index 70049edc6..000000000 --- a/Signal/test/network/dns/DnsManagerTest.h +++ /dev/null @@ -1,5 +0,0 @@ -#import - -@interface DnsManagerTest : XCTestCase - -@end diff --git a/Signal/test/network/dns/DnsManagerTest.m b/Signal/test/network/dns/DnsManagerTest.m index 6149bc9ef..38dcfd8ed 100644 --- a/Signal/test/network/dns/DnsManagerTest.m +++ b/Signal/test/network/dns/DnsManagerTest.m @@ -1,4 +1,4 @@ -#import "DnsManagerTest.h" +#import #import "DnsManager.h" #import "TestUtil.h" #import "Util.h" @@ -13,6 +13,10 @@ #define nonExistentHostname [NSString stringWithFormat:@"%@kfurmtludehntlgihmvnduyebntiinvbudydepqowudyfnrkt.com", \ [[CryptoTools generateSecureRandomData:10] encodedAsBase64]] +@interface DnsManagerTest : XCTestCase + +@end + @implementation DnsManagerTest -(void) testQueryAddresses_Sequential { diff --git a/Signal/test/network/rtp/RtpPacketTests.h b/Signal/test/network/rtp/RtpPacketTests.h deleted file mode 100644 index 23cbca2bc..000000000 --- a/Signal/test/network/rtp/RtpPacketTests.h +++ /dev/null @@ -1,6 +0,0 @@ -#import -#import "RtpPacket.h" - -@interface RtpPacketTests : XCTestCase - -@end diff --git a/Signal/test/network/rtp/RtpPacketTests.m b/Signal/test/network/rtp/RtpPacketTests.m index ffb323337..4195d0aac 100644 --- a/Signal/test/network/rtp/RtpPacketTests.m +++ b/Signal/test/network/rtp/RtpPacketTests.m @@ -1,7 +1,11 @@ -#import "RtpPacketTests.h" +#import #import "TestUtil.h" #import "Util.h" +@interface RtpPacketTests : XCTestCase + +@end + @implementation RtpPacketTests -(void) testRawDataSimple { diff --git a/Signal/test/network/rtp/srtp/SecureStreamTest.h b/Signal/test/network/rtp/srtp/SecureStreamTest.h deleted file mode 100644 index 43d03a50d..000000000 --- a/Signal/test/network/rtp/srtp/SecureStreamTest.h +++ /dev/null @@ -1,5 +0,0 @@ -#import - -@interface SecureStreamTest : XCTestCase - -@end diff --git a/Signal/test/network/rtp/srtp/SecureStreamTest.m b/Signal/test/network/rtp/srtp/SecureStreamTest.m index 74b5d13ef..a52f748aa 100644 --- a/Signal/test/network/rtp/srtp/SecureStreamTest.m +++ b/Signal/test/network/rtp/srtp/SecureStreamTest.m @@ -1,8 +1,12 @@ -#import "SecureStreamTest.h" +#import #import "SrtpStream.h" #import "Util.h" #import "TestUtil.h" +@interface SecureStreamTest : XCTestCase + +@end + @implementation SecureStreamTest -(void) testPerturbedRoundTrip { for (int repeat = 0; repeat < 10; repeat++) { diff --git a/Signal/test/network/rtp/srtp/SequenceCounterTest.h b/Signal/test/network/rtp/srtp/SequenceCounterTest.h deleted file mode 100644 index c162853fe..000000000 --- a/Signal/test/network/rtp/srtp/SequenceCounterTest.h +++ /dev/null @@ -1,5 +0,0 @@ -#import - -@interface SequenceCounterTest : XCTestCase - -@end diff --git a/Signal/test/network/rtp/srtp/SequenceCounterTest.m b/Signal/test/network/rtp/srtp/SequenceCounterTest.m index 2d1f461c1..2d9d7698f 100644 --- a/Signal/test/network/rtp/srtp/SequenceCounterTest.m +++ b/Signal/test/network/rtp/srtp/SequenceCounterTest.m @@ -1,7 +1,11 @@ -#import "SequenceCounterTest.h" +#import #import "SequenceCounter.h" #import "TestUtil.h" +@interface SequenceCounterTest : XCTestCase + +@end + @implementation SequenceCounterTest -(void)testCountingForwards { SequenceCounter* s = [SequenceCounter sequenceCounter]; diff --git a/Signal/test/network/rtp/zrtp/DH3KAgreerTest.h b/Signal/test/network/rtp/zrtp/DH3KAgreerTest.h deleted file mode 100644 index 72362b180..000000000 --- a/Signal/test/network/rtp/zrtp/DH3KAgreerTest.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// DH3KAgreerTest.h -// RedPhone -// -// Created by Twisted Oak Studios Mac Mini on 2013-03-21. -// Copyright (c) 2013 Twisted Oak Studios. All rights reserved. -// - -#import - -@interface DH3KAgreerTest : XCTestCase - -@end diff --git a/Signal/test/network/rtp/zrtp/DH3KAgreerTest.m b/Signal/test/network/rtp/zrtp/DH3KAgreerTest.m deleted file mode 100644 index 942e3a0c8..000000000 --- a/Signal/test/network/rtp/zrtp/DH3KAgreerTest.m +++ /dev/null @@ -1,10 +0,0 @@ -#import "DH3KAgreerTest.h" -#import "DH3KKeyAgreementProtocol.h" -#import "DH3KKeyAgreementParticipant.h" -#import "Conversions.h" -#import "CryptoTools.h" -#import "Util.h" -#import "TestUtil.h" - -@implementation DH3KAgreerTest -@end diff --git a/Signal/test/network/rtp/zrtp/HandshakePacketTest.h b/Signal/test/network/rtp/zrtp/HandshakePacketTest.h deleted file mode 100644 index a605b31f9..000000000 --- a/Signal/test/network/rtp/zrtp/HandshakePacketTest.h +++ /dev/null @@ -1,5 +0,0 @@ -#import - -@interface HandshakePacketTest : XCTestCase - -@end diff --git a/Signal/test/network/rtp/zrtp/HandshakePacketTest.m b/Signal/test/network/rtp/zrtp/HandshakePacketTest.m index 3f35efb34..04d91f74e 100644 --- a/Signal/test/network/rtp/zrtp/HandshakePacketTest.m +++ b/Signal/test/network/rtp/zrtp/HandshakePacketTest.m @@ -1,9 +1,13 @@ -#import "HandshakePacketTest.h" +#import #import "HelloPacket.h" #import "TestUtil.h" #import "Util.h" #import "Crc32.h" +@interface HandshakePacketTest : XCTestCase + +@end + @implementation HandshakePacketTest -(void) testHelloPacket { [Environment setCurrent:testEnv]; diff --git a/Signal/test/network/rtp/zrtp/HashChainTest.h b/Signal/test/network/rtp/zrtp/HashChainTest.h deleted file mode 100644 index 9eecdc0bb..000000000 --- a/Signal/test/network/rtp/zrtp/HashChainTest.h +++ /dev/null @@ -1,5 +0,0 @@ -#import - -@interface HashChainTest : XCTestCase - -@end diff --git a/Signal/test/network/rtp/zrtp/HashChainTest.m b/Signal/test/network/rtp/zrtp/HashChainTest.m index ac134e928..fe5c3f015 100644 --- a/Signal/test/network/rtp/zrtp/HashChainTest.m +++ b/Signal/test/network/rtp/zrtp/HashChainTest.m @@ -1,9 +1,13 @@ -#import "HashChainTest.h" +#import #import "HashChain.h" #import "Util.h" #import "CryptoTools.h" #import "TestUtil.h" +@interface HashChainTest : XCTestCase + +@end + @implementation HashChainTest -(void) testHashChainKnown { testThrows([HashChain hashChainWithSeed:nil]); diff --git a/Signal/test/network/rtp/zrtp/MasterSecretTest.h b/Signal/test/network/rtp/zrtp/MasterSecretTest.h deleted file mode 100644 index 889231ebc..000000000 --- a/Signal/test/network/rtp/zrtp/MasterSecretTest.h +++ /dev/null @@ -1,5 +0,0 @@ -#import - -@interface MasterSecretTest : XCTestCase - -@end diff --git a/Signal/test/network/rtp/zrtp/MasterSecretTest.m b/Signal/test/network/rtp/zrtp/MasterSecretTest.m index 1c6d681d6..81694f90d 100644 --- a/Signal/test/network/rtp/zrtp/MasterSecretTest.m +++ b/Signal/test/network/rtp/zrtp/MasterSecretTest.m @@ -1,8 +1,12 @@ -#import "MasterSecretTest.h" +#import #import "MasterSecret.h" #import "Util.h" #import "TestUtil.h" +@interface MasterSecretTest : XCTestCase + +@end + @implementation MasterSecretTest -(void) testKnownCalculateSharedSecret { NSData* dhResult = [NSMutableData dataWithLength:384]; diff --git a/Signal/test/network/rtp/zrtp/ShortAuthenticationStringGeneratorTest.h b/Signal/test/network/rtp/zrtp/ShortAuthenticationStringGeneratorTest.h deleted file mode 100644 index 05ccee8a8..000000000 --- a/Signal/test/network/rtp/zrtp/ShortAuthenticationStringGeneratorTest.h +++ /dev/null @@ -1,5 +0,0 @@ -#import - -@interface ShortAuthenticationStringGeneratorTest : XCTestCase - -@end diff --git a/Signal/test/network/rtp/zrtp/ShortAuthenticationStringGeneratorTest.m b/Signal/test/network/rtp/zrtp/ShortAuthenticationStringGeneratorTest.m index 9ea788d8e..8b3ea6be4 100644 --- a/Signal/test/network/rtp/zrtp/ShortAuthenticationStringGeneratorTest.m +++ b/Signal/test/network/rtp/zrtp/ShortAuthenticationStringGeneratorTest.m @@ -1,8 +1,12 @@ -#import "ShortAuthenticationStringGeneratorTest.h" +#import #import "ShortAuthenticationStringGenerator.h" #import "Util.h" #import "TestUtil.h" +@interface ShortAuthenticationStringGeneratorTest : XCTestCase + +@end + @implementation ShortAuthenticationStringGeneratorTest -(void) testSAS { test([[ShortAuthenticationStringGenerator generateFromData:[(@[@0,@0]) toUint8Data]] isEqualToString:@"aardvark adroitness"]); diff --git a/Signal/test/network/tcp/LowLatencyConnectorTest.h b/Signal/test/network/tcp/LowLatencyConnectorTest.h deleted file mode 100644 index 3353f7c01..000000000 --- a/Signal/test/network/tcp/LowLatencyConnectorTest.h +++ /dev/null @@ -1,5 +0,0 @@ -#import - -@interface LowLatencyConnectorTest : XCTestCase - -@end diff --git a/Signal/test/network/tcp/LowLatencyConnectorTest.m b/Signal/test/network/tcp/LowLatencyConnectorTest.m index 50f8821ae..241b0edf2 100644 --- a/Signal/test/network/tcp/LowLatencyConnectorTest.m +++ b/Signal/test/network/tcp/LowLatencyConnectorTest.m @@ -1,4 +1,4 @@ -#import "LowLatencyConnectorTest.h" +#import #import "LowLatencyConnector.h" #import "NetworkStream.h" #import "Util.h" @@ -8,6 +8,10 @@ #import "CancelledToken.h" #import "ThreadManager.h" +@interface LowLatencyConnectorTest : XCTestCase + +@end + @implementation LowLatencyConnectorTest -(void) testLowLatencyConnect_example { diff --git a/Signal/test/network/tcp/tls/NetworkStreamTest.h b/Signal/test/network/tcp/tls/NetworkStreamTest.h deleted file mode 100644 index 3e3abf749..000000000 --- a/Signal/test/network/tcp/tls/NetworkStreamTest.h +++ /dev/null @@ -1,5 +0,0 @@ -#import - -@interface NetworkStreamTest : XCTestCase - -@end diff --git a/Signal/test/network/tcp/tls/NetworkStreamTest.m b/Signal/test/network/tcp/tls/NetworkStreamTest.m index 4e9d075ea..b0a3e26f0 100644 --- a/Signal/test/network/tcp/tls/NetworkStreamTest.m +++ b/Signal/test/network/tcp/tls/NetworkStreamTest.m @@ -1,4 +1,4 @@ -#import "NetworkStreamTest.h" +#import #import "NetworkStream.h" #import "TestUtil.h" #import "Util.h" @@ -15,6 +15,10 @@ #define TEST_SERVER_INCORRECT_CERT_PATH @"whisperTest" #define TEST_SERVER_INCORRECT_CERT_TYPE @"der" +@interface NetworkStreamTest : XCTestCase + +@end + @implementation NetworkStreamTest -(void) testReplies { diff --git a/Signal/test/network/tcp/tls/SecureEndPointTest.h b/Signal/test/network/tcp/tls/SecureEndPointTest.h deleted file mode 100644 index cd0606d5f..000000000 --- a/Signal/test/network/tcp/tls/SecureEndPointTest.h +++ /dev/null @@ -1,5 +0,0 @@ -#import - -@interface SecureEndPointTest : XCTestCase - -@end diff --git a/Signal/test/network/tcp/tls/SecureEndPointTest.m b/Signal/test/network/tcp/tls/SecureEndPointTest.m index d3237afc0..e6aecad70 100644 --- a/Signal/test/network/tcp/tls/SecureEndPointTest.m +++ b/Signal/test/network/tcp/tls/SecureEndPointTest.m @@ -1,8 +1,12 @@ -#import "SecureEndPointTest.h" +#import #import "SecureEndPoint.h" #import "TestUtil.h" #import "IpEndPoint.h" +@interface SecureEndPointTest : XCTestCase + +@end + @implementation SecureEndPointTest -(void) testCert { diff --git a/Signal/test/phone/PhoneNumberTest.h b/Signal/test/phone/PhoneNumberTest.h deleted file mode 100644 index a37777c94..000000000 --- a/Signal/test/phone/PhoneNumberTest.h +++ /dev/null @@ -1,5 +0,0 @@ -#import - -@interface PhoneNumberTest : XCTestCase - -@end diff --git a/Signal/test/phone/PhoneNumberTest.m b/Signal/test/phone/PhoneNumberTest.m index a22b4011b..7c2ef7ff4 100644 --- a/Signal/test/phone/PhoneNumberTest.m +++ b/Signal/test/phone/PhoneNumberTest.m @@ -1,7 +1,11 @@ -#import "PhoneNumberTest.h" +#import #import "TestUtil.h" #import "PhoneNumber.h" +@interface PhoneNumberTest : XCTestCase + +@end + @implementation PhoneNumberTest -(void) testE164 { diff --git a/Signal/test/phone/signaling/SessionDescriptorTest.m b/Signal/test/phone/signaling/SessionDescriptorTest.m index 772fa0a29..7057995a6 100644 --- a/Signal/test/phone/signaling/SessionDescriptorTest.m +++ b/Signal/test/phone/signaling/SessionDescriptorTest.m @@ -34,8 +34,8 @@ }; [Environment setCurrent:testEnv]; - [[Environment preferences] setValueForKey:@"Signaling Mac Key" toValue:[@"0000000000000000000000000000000000000000" decodedAsHexString]]; - [[Environment preferences] setValueForKey:@"Signaling Cipher Key" toValue:[@"00000000000000000000000000000000" decodedAsHexString]]; + [[[Environment getCurrent] preferences] setValueForKey:@"Signaling Mac Key" toValue:[@"0000000000000000000000000000000000000000" decodedAsHexString]]; + [[[Environment getCurrent]preferences] setValueForKey:@"Signaling Cipher Key" toValue:[@"00000000000000000000000000000000" decodedAsHexString]]; ResponderSessionDescriptor* d = [ResponderSessionDescriptor responderSessionDescriptorFromEncryptedRemoteNotification:notification]; diff --git a/Signal/test/profiling/DecayingSampleEstimatorTest.h b/Signal/test/profiling/DecayingSampleEstimatorTest.h deleted file mode 100644 index a19dcc45e..000000000 --- a/Signal/test/profiling/DecayingSampleEstimatorTest.h +++ /dev/null @@ -1,5 +0,0 @@ -#import - -@interface DecayingSampleEstimatorTest : XCTestCase - -@end diff --git a/Signal/test/profiling/DecayingSampleEstimatorTest.m b/Signal/test/profiling/DecayingSampleEstimatorTest.m index 69928249c..440a6cacd 100644 --- a/Signal/test/profiling/DecayingSampleEstimatorTest.m +++ b/Signal/test/profiling/DecayingSampleEstimatorTest.m @@ -1,7 +1,11 @@ -#import "DecayingSampleEstimatorTest.h" +#import #import "DecayingSampleEstimator.h" #import "TestUtil.h" +@interface DecayingSampleEstimatorTest : XCTestCase + +@end + @implementation DecayingSampleEstimatorTest -(void) testDecayingSampleEstimator { DecayingSampleEstimator* e = [DecayingSampleEstimator decayingSampleEstimatorWithInitialEstimate:1.0 andDecayPerUnitSample:0.5]; diff --git a/Signal/test/profiling/EventWindowTest.h b/Signal/test/profiling/EventWindowTest.h deleted file mode 100644 index 4f49c1f40..000000000 --- a/Signal/test/profiling/EventWindowTest.h +++ /dev/null @@ -1,5 +0,0 @@ -#import - -@interface EventWindowTest : XCTestCase - -@end diff --git a/Signal/test/profiling/EventWindowTest.m b/Signal/test/profiling/EventWindowTest.m index b3954906f..1d6a0cff5 100644 --- a/Signal/test/profiling/EventWindowTest.m +++ b/Signal/test/profiling/EventWindowTest.m @@ -1,7 +1,11 @@ -#import "EventWindowTest.h" +#import #import "EventWindow.h" #import "TestUtil.h" +@interface EventWindowTest : XCTestCase + +@end + @implementation EventWindowTest -(void) testEventWindow { EventWindow* w = [EventWindow eventWindowWithWindowDuration:5]; From 004030946faae249d0838969109b5f7c04181f9f Mon Sep 17 00:00:00 2001 From: Frederic Jacobs Date: Wed, 30 Jul 2014 20:39:55 -0400 Subject: [PATCH 4/5] Adding App Store Link --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index e777a582c..1159c1850 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ Signal allows you to make private phone calls and we are working on bringing secure messaging to it soon. +[![Available on the AppStore](http://cl.ly/WouG/Download_on_the_App_Store_Badge_US-UK_135x40.svg)](https://itunes.apple.com/app/id874139669) + ## Building 1) Clone the repo to a working directory From 91dadcc48ca565c454ae406efe7e6c4e2b22813e Mon Sep 17 00:00:00 2001 From: Frederic Jacobs Date: Wed, 30 Jul 2014 20:45:30 -0400 Subject: [PATCH 5/5] Add translation link --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 1159c1850..4e675aee9 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,10 @@ sudo gem update 3) Open the `Signal.xcworkspace` in Xcode. Build and Run and you are ready to go! +## Translation + +Help us translate Signal! The translation effort happens on [Transifex](https://www.transifex.com/projects/p/signal-ios/) + ## Interoperability Signal works with [RedPhone on Android](https://github.com/WhisperSystems/Redphone).