diff --git a/Signal.xcodeproj/project.pbxproj b/Signal.xcodeproj/project.pbxproj index e0327dbe63..c5f1c40513 100644 --- a/Signal.xcodeproj/project.pbxproj +++ b/Signal.xcodeproj/project.pbxproj @@ -379,13 +379,13 @@ AA0C8E498E2046B0B81EEE6E /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8313AE91B4954215858A5662 /* libPods.a */; }; B60C16651988999D00E97A6C /* VersionMigrations.m in Sources */ = {isa = PBXBuildFile; fileRef = B60C16641988999D00E97A6C /* VersionMigrations.m */; }; B621B079198C69A100D36C3D /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = B621B017198C69A100D36C3D /* Localizable.strings */; }; - B624C4E6198FD2830009264A /* whisperFake.cer in Resources */ = {isa = PBXBuildFile; fileRef = B624C4E5198FD2830009264A /* whisperFake.cer */; }; - B624C4E7198FD3910009264A /* whisperFake.cer in Resources */ = {isa = PBXBuildFile; fileRef = B624C4E5198FD2830009264A /* whisperFake.cer */; }; B67ADDC41989FF8700E1A773 /* CallServerRequestsManager.m in Sources */ = {isa = PBXBuildFile; fileRef = B67ADDC31989FF8700E1A773 /* CallServerRequestsManager.m */; }; B67EBF5D19194AC60084CCFD /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = B67EBF5C19194AC60084CCFD /* Settings.bundle */; }; + B69B6305199573970072E805 /* whisperFake.cer in Resources */ = {isa = PBXBuildFile; fileRef = B69B6304199573970072E805 /* whisperFake.cer */; }; B69CD25119773E79005CE69A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B69CD25019773E79005CE69A /* XCTest.framework */; }; B6B1013C196D213F007E3930 /* SGNKeychainUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B1013B196D213F007E3930 /* SGNKeychainUtil.m */; }; B6B9ECFC198B31BA00C620D3 /* PushManager.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B9ECFB198B31BA00C620D3 /* PushManager.m */; }; + B6C93C4E199567AD00EDF894 /* DebugLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = B6C93C4D199567AD00EDF894 /* DebugLogger.m */; }; B90418E6183E9DD40038554A /* DateUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = B90418E5183E9DD40038554A /* DateUtil.m */; }; B90418E7183E9DD40038554A /* DateUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = B90418E5183E9DD40038554A /* DateUtil.m */; }; B942EB0E183A9633000887BB /* SearchBarTitleView.m in Sources */ = {isa = PBXBuildFile; fileRef = B942EB0D183A9633000887BB /* SearchBarTitleView.m */; }; @@ -1111,17 +1111,19 @@ B621B069198C69A100D36C3D /* zh_CN */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = zh_CN; path = Localizable.strings; sourceTree = ""; }; B621B06C198C69A100D36C3D /* zh_TW.Big5 */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = zh_TW.Big5; path = Localizable.strings; sourceTree = ""; }; B621B06F198C69A100D36C3D /* zh_TW */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = zh_TW; path = Localizable.strings; sourceTree = ""; }; - B624C4E5198FD2830009264A /* whisperFake.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = whisperFake.cer; path = Signal/test/whisperFake.cer; sourceTree = SOURCE_ROOT; }; B657DDC91911A40500F45B0C /* Signal.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = Signal.entitlements; sourceTree = ""; }; B661C211198EE2EA00548CA1 /* iOSVersions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = iOSVersions.h; path = src/environment/iOSVersions.h; sourceTree = ""; }; B67ADDC21989FF8700E1A773 /* CallServerRequestsManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallServerRequestsManager.h; sourceTree = ""; }; B67ADDC31989FF8700E1A773 /* CallServerRequestsManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CallServerRequestsManager.m; sourceTree = ""; }; B67EBF5C19194AC60084CCFD /* Settings.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = Settings.bundle; path = SettingsBundle/Settings.bundle; sourceTree = SOURCE_ROOT; }; + B69B6304199573970072E805 /* whisperFake.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = whisperFake.cer; sourceTree = ""; }; B69CD25019773E79005CE69A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; B6B1013A196D213F007E3930 /* SGNKeychainUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SGNKeychainUtil.h; sourceTree = ""; }; B6B1013B196D213F007E3930 /* SGNKeychainUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SGNKeychainUtil.m; sourceTree = ""; }; B6B9ECFA198B31BA00C620D3 /* PushManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PushManager.h; sourceTree = ""; }; B6B9ECFB198B31BA00C620D3 /* PushManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PushManager.m; sourceTree = ""; }; + B6C93C4C199567AD00EDF894 /* DebugLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DebugLogger.h; sourceTree = ""; }; + B6C93C4D199567AD00EDF894 /* DebugLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DebugLogger.m; sourceTree = ""; }; B90418E4183E9DD40038554A /* DateUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DateUtil.h; sourceTree = ""; }; B90418E5183E9DD40038554A /* DateUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DateUtil.m; sourceTree = ""; }; B942EB0C183A9633000887BB /* SearchBarTitleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SearchBarTitleView.h; sourceTree = ""; }; @@ -1683,6 +1685,8 @@ children = ( 76EB041218170B33006006FC /* Environment.h */, 76EB041318170B33006006FC /* Environment.m */, + B6C93C4C199567AD00EDF894 /* DebugLogger.h */, + B6C93C4D199567AD00EDF894 /* DebugLogger.m */, 76EB041418170B33006006FC /* LocalizableText.h */, 76EB041518170B33006006FC /* LocalizableText.m */, 76EB041618170B33006006FC /* PreferencesUtil.h */, @@ -2228,6 +2232,7 @@ A15706EA17F0CD6D007C2BD6 /* test */ = { isa = PBXGroup; children = ( + B69B6304199573970072E805 /* whisperFake.cer */, 76919BF51805D169008C664A /* contact */, A15706EB17F0CD6D007C2BD6 /* async */, A15706F217F0CD6D007C2BD6 /* audio */, @@ -2881,7 +2886,6 @@ D221A09B169C9E5E00537ABF /* Signal-Prefix.pch */, B661C211198EE2EA00548CA1 /* iOSVersions.h */, E1C407C117F0C246007BEE65 /* whisperReal.cer */, - B624C4E5198FD2830009264A /* whisperFake.cer */, ); name = "Supporting Files"; sourceTree = ""; @@ -3278,7 +3282,6 @@ E1370BE418A0686C00826894 /* outring.mp3 in Resources */, E1370BE518A0686C00826894 /* r.caf in Resources */, E1370BE618A0686C00826894 /* sonarping.mp3 in Resources */, - B624C4E7198FD3910009264A /* whisperFake.cer in Resources */, E148751218A06AFD002CC4F3 /* HelveticaNeueLTStd-Bd.otf in Resources */, E148751318A06AFD002CC4F3 /* HelveticaNeueLTStd-Th.otf in Resources */, E148751418A06AFD002CC4F3 /* HelveticaNeueLTStd-Lt.otf in Resources */, @@ -3306,7 +3309,7 @@ 76EB067918170B34006006FC /* InCallViewController.xib in Resources */, 76EB068318170B34006006FC /* SettingsViewController.xib in Resources */, 76EB068118170B34006006FC /* RegisterViewController.xib in Resources */, - B624C4E6198FD2830009264A /* whisperFake.cer in Resources */, + B69B6305199573970072E805 /* whisperFake.cer in Resources */, B97CBFB218861023008E0DE9 /* CountryCodeTableViewCell.xib in Resources */, B9A578B5183D610300C17105 /* FavouriteTableViewCell.xib in Resources */, B9B89C58185A2B7000A24465 /* LeftSideMenuCell.xib in Resources */, @@ -3507,6 +3510,7 @@ 76EB065818170B34006006FC /* LeftSideMenuViewController.m in Sources */, 76EB05EA18170B33006006FC /* CallProgress.m in Sources */, 76EB05C218170B33006006FC /* DhPacketSharedSecretHashes.m in Sources */, + B6C93C4E199567AD00EDF894 /* DebugLogger.m in Sources */, 76EB063218170B33006006FC /* Crc32.m in Sources */, E197B62418BBF5BB00F073E5 /* SoundPlayer.m in Sources */, E197B61018BBEC1A00F073E5 /* EncodedAudioPacket.m in Sources */, @@ -4499,7 +4503,10 @@ GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "Signal/Signal-Prefix.pch"; - GCC_PREPROCESSOR_DEFINITIONS = HAVE_CONFIG_H; + GCC_PREPROCESSOR_DEFINITIONS = ( + HAVE_CONFIG_H, + "RELEASE=1", + ); GCC_STRICT_ALIASING = NO; GCC_WARN_MULTIPLE_DEFINITION_TYPES_FOR_SELECTOR = NO; GCC_WARN_STRICT_SELECTOR_MATCH = YES; diff --git a/Signal/Signal-Info.plist b/Signal/Signal-Info.plist index 731a56035e..6cad132deb 100644 --- a/Signal/Signal-Info.plist +++ b/Signal/Signal-Info.plist @@ -29,11 +29,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.0.3 + 1.0.4 CFBundleSignature ???? CFBundleVersion - 1.0.3 + 1.0.4 LSApplicationCategoryType LSRequiresIPhoneOS diff --git a/Signal/src/AppDelegate.h b/Signal/src/AppDelegate.h index dcb2b102d1..dd17a2be2a 100644 --- a/Signal/src/AppDelegate.h +++ b/Signal/src/AppDelegate.h @@ -1,14 +1,8 @@ #import #import "FutureSource.h" -#pragma mark Logging - Production logging wants us to write some logs to a file in case we need it for debugging. - -#import -#import - @interface AppDelegate : UIResponder @property (strong, nonatomic) UIWindow *window; -@property (nonatomic, readonly) DDFileLogger *fileLogger; @end diff --git a/Signal/src/AppDelegate.m b/Signal/src/AppDelegate.m index c4b9c74a45..e47e609617 100644 --- a/Signal/src/AppDelegate.m +++ b/Signal/src/AppDelegate.m @@ -2,12 +2,14 @@ #import "AppAudioManager.h" #import "CallLogViewController.h" #import "CategorizingLogger.h" +#import "DebugLogger.h" #import "DialerViewController.h" #import "DiscardingLog.h" #import "Environment.h" #import "InCallViewController.h" #import "LeftSideMenuViewController.h" #import "MMDrawerController.h" +#import "PreferencesUtil.h" #import "NotificationTracker.h" #import "PushManager.h" #import "PriorityQueue.h" @@ -28,7 +30,6 @@ @property (nonatomic, strong) MMDrawerController *drawerController; @property (nonatomic, strong) NotificationTracker *notificationTracker; -@property (nonatomic) DDFileLogger *fileLogger; @end @@ -38,8 +39,8 @@ - (void)performUpdateCheck{ // We check if NSUserDefaults key for version exists. - NSString *previousVersion = [[NSUserDefaults standardUserDefaults] objectForKey:kSignalVersionKey]; - NSString *currentVersion = [NSString stringWithFormat:@"%@", [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"]]; + NSString *previousVersion = [[Environment preferences] lastRanVersion]; + NSString *currentVersion = [[Environment preferences] setAndGetCurrentVersion]; if (!previousVersion) { DDLogError(@"No previous version found. Possibly first launch since install."); @@ -52,9 +53,6 @@ } } - - [[NSUserDefaults standardUserDefaults] setObject:currentVersion forKey:kSignalVersionKey]; - [[NSUserDefaults standardUserDefaults] synchronize]; } @@ -63,15 +61,23 @@ */ - (void)protectPreferenceFiles{ - NSMutableArray *pathsToExclude = [NSMutableArray array]; - [pathsToExclude addObject:[[[NSHomeDirectory() stringByAppendingString:@"/Library/Preferences/"] stringByAppendingString:[[NSBundle mainBundle] bundleIdentifier]] stringByAppendingString:@".plist"]]; + NSMutableArray *pathsToExclude = [NSMutableArray array]; + NSString *preferencesPath =[NSHomeDirectory() stringByAppendingString:@"/Library/Preferences/"]; NSError *error; + NSDictionary *attrs = [NSDictionary dictionaryWithObject:NSFileProtectionComplete forKey:NSFileProtectionKey]; + [[NSFileManager defaultManager] setAttributes:attrs ofItemAtPath:preferencesPath error:&error]; + + [pathsToExclude addObject:[[preferencesPath stringByAppendingString:[[NSBundle mainBundle] bundleIdentifier]] stringByAppendingString:@".plist"]]; + NSString *logPath = [NSHomeDirectory() stringByAppendingString:@"/Library/Caches/Logs/"]; NSArray *logsFiles = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:logPath error:&error]; + attrs = [NSDictionary dictionaryWithObject:NSFileProtectionComplete forKey:NSFileProtectionKey]; + [[NSFileManager defaultManager] setAttributes:attrs ofItemAtPath:logPath error:&error]; + for (NSUInteger i = 0; i < [logsFiles count]; i++) { [pathsToExclude addObject:[logPath stringByAppendingString:[logsFiles objectAtIndex:i]]]; } @@ -85,7 +91,6 @@ DDLogError(@"Error while removing log files from backup: %@", error.description); UIAlertView *alert = [[UIAlertView alloc]initWithTitle:NSLocalizedString(@"WARNING", @"") message:NSLocalizedString(@"DISABLING_BACKUP_FAILED", @"") delegate:nil cancelButtonTitle:NSLocalizedString(@"OK", @"") otherButtonTitles:nil, nil]; [alert show]; - return; } @@ -93,11 +98,19 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - [DDLog addLogger:[DDTTYLogger sharedInstance]]; - self.fileLogger = [[DDFileLogger alloc] init]; //Logging to file, because it's in the Cache folder, they are not uploaded in iTunes/iCloud backups. - self.fileLogger.rollingFrequency = 60 * 60 * 24; // 24 hour rolling. - self.fileLogger.logFileManager.maximumNumberOfLogFiles = 3; // Keep three days of logs. - [DDLog addLogger:self.fileLogger]; + BOOL loggingIsEnabled; + +#ifdef DEBUG + loggingIsEnabled = TRUE; + [[DebugLogger sharedInstance] enableTTYLogging]; + +#elif RELEASE + loggingIsEnabled = [[Environment preferences] loggingIsEnabled]; +#endif + + if (loggingIsEnabled) { + [[DebugLogger sharedInstance] enableFileLogging]; + } [self performUpdateCheck]; [self protectPreferenceFiles]; diff --git a/Signal/src/contact/ContactsManager.m b/Signal/src/contact/ContactsManager.m index 6357f1a683..fc7e146bc7 100644 --- a/Signal/src/contact/ContactsManager.m +++ b/Signal/src/contact/ContactsManager.m @@ -2,6 +2,7 @@ #import "FutureSource.h" #import "FutureUtil.h" #import +#import #import "Constraints.h" #import "Environment.h" #import "NotificationManifest.h" @@ -180,6 +181,8 @@ void onAddressBookChanged(ABAddressBookRef notifyAddressBook, CFDictionaryRef in (void*)(unsigned long)ABPersonGetSortOrdering()); NSArray *sortedPeople = (__bridge_transfer NSArray *)allPeopleMutable; + + // This predicate returns all contacts from the addressbook having at least one phone number NSPredicate* predicate = [NSPredicate predicateWithBlock: ^BOOL(id record, NSDictionary *bindings) { ABMultiValueRef phoneNumbers = ABRecordCopyValue( (__bridge ABRecordRef)record, kABPersonPhoneProperty); @@ -285,8 +288,8 @@ void onAddressBookChanged(ABAddressBookRef notifyAddressBook, CFDictionaryRef in NSMutableArray *numbers = [NSMutableArray array]; - for (CFIndex i = 0; i < (NSInteger)[phoneNumbers count]; i++) { - NSString *phoneNumber = phoneNumbers[(NSUInteger)i]; + for (NSUInteger i = 0; i < [phoneNumbers count]; i++) { + NSString *phoneNumber = phoneNumbers[i]; [numbers addObject:phoneNumber]; } diff --git a/Signal/src/environment/DebugLogger.h b/Signal/src/environment/DebugLogger.h new file mode 100644 index 0000000000..8cb6caf07c --- /dev/null +++ b/Signal/src/environment/DebugLogger.h @@ -0,0 +1,23 @@ +// +// DebugLogger.h +// Signal +// +// Created by Frederic Jacobs on 08/08/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import + +@interface DebugLogger : NSObject + +MacrosSingletonInterface + +- (void)enableFileLogging; + +- (void)disableFileLogging; + +- (void)enableTTYLogging; + +- (void)wipeLogs; + +@end diff --git a/Signal/src/environment/DebugLogger.m b/Signal/src/environment/DebugLogger.m new file mode 100644 index 0000000000..9ce1a5d4fe --- /dev/null +++ b/Signal/src/environment/DebugLogger.m @@ -0,0 +1,66 @@ +// +// DebugLogger.m +// Signal +// +// Created by Frederic Jacobs on 08/08/14. +// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// + +#import "DebugLogger.h" + +#pragma mark Logging - Production logging wants us to write some logs to a file in case we need it for debugging. + +#import +#import + +@interface DebugLogger () + +@property (nonatomic) DDFileLogger *fileLogger; + +@end + +@implementation DebugLogger + +MacrosSingletonImplemention + +- (void)enableFileLogging{ + self.fileLogger = [[DDFileLogger alloc] init]; //Logging to file, because it's in the Cache folder, they are not uploaded in iTunes/iCloud backups. + self.fileLogger.rollingFrequency = 60 * 60 * 24; // 24 hour rolling. + self.fileLogger.logFileManager.maximumNumberOfLogFiles = 3; // Keep three days of logs. + [DDLog addLogger:self.fileLogger]; +} + +- (void)disableFileLogging{ + [DDLog removeLogger:self.fileLogger]; + self.fileLogger = nil; +} + +- (void)enableTTYLogging{ + [DDLog addLogger:[DDTTYLogger sharedInstance]]; +} + +- (void)wipeLogs{ + BOOL reenableLogging = (self.fileLogger?YES:NO); + + if (reenableLogging) { + [self disableFileLogging]; + } + + NSError *error; + NSString *logPath = [NSHomeDirectory() stringByAppendingString:@"/Library/Caches/Logs/"]; + NSArray *logsFiles = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:logPath error:&error]; + + for (NSUInteger i = 0; i < [logsFiles count]; i++) { + [[NSFileManager defaultManager] removeItemAtPath:[logPath stringByAppendingString:[logsFiles objectAtIndex:i]] error:&error]; + } + + if (error) { + DDLogError(@"Logs couldn't be removed. %@", error.description); + } + + if (reenableLogging) { + [self enableFileLogging]; + } +} + +@end diff --git a/Signal/src/environment/Environment.m b/Signal/src/environment/Environment.m index ce2c0e7572..42a953353a 100644 --- a/Signal/src/environment/Environment.m +++ b/Signal/src/environment/Environment.m @@ -1,3 +1,4 @@ +#import "DebugLogger.h" #import "Environment.h" #import "Constraints.h" #import "FunctionalUtil.h" @@ -6,6 +7,7 @@ #import "HostNameEndPoint.h" #import "RecentCallManager.h" #import "ContactsManager.h" +#import "PreferencesUtil.h" #import "PhoneNumberDirectoryFilterManager.h" #import "SGNKeychainUtil.h" @@ -122,8 +124,9 @@ phoneDirectoryManager; e->zrtpVersionId = zrtpVersionId; e->contactsManager = contactsManager; - // @todo: better place for this? if (recentCallManager != nil) { + // recentCallManagers are nil in unit tests because they would require unnecessary allocations. Detailed explanation: https://github.com/WhisperSystems/Signal-iOS/issues/62#issuecomment-51482195 + [recentCallManager watchForCallsThrough:phoneManager untilCancelled:nil]; [recentCallManager watchForContactUpdatesFrom:contactsManager @@ -166,6 +169,10 @@ phoneDirectoryManager; +(void)resetAppData{ [SGNKeychainUtil wipeKeychain]; [[Environment preferences] clear]; + if ([[self preferences] loggingIsEnabled]) { + [[DebugLogger sharedInstance] wipeLogs]; + } + [[self preferences] setAndGetCurrentVersion]; } @end diff --git a/Signal/src/environment/PreferencesUtil.h b/Signal/src/environment/PreferencesUtil.h index e7bfc6ae50..a65ca83322 100644 --- a/Signal/src/environment/PreferencesUtil.h +++ b/Signal/src/environment/PreferencesUtil.h @@ -25,4 +25,10 @@ -(BOOL) encounteredRevokedPushPermission; -(void) setRevokedPushPermission:(BOOL)revoked; +-(BOOL)loggingIsEnabled; +-(void)setLoggingEnabled:(BOOL)flag; + +-(NSString*)lastRanVersion; +-(NSString*)setAndGetCurrentVersion; + @end diff --git a/Signal/src/environment/PreferencesUtil.m b/Signal/src/environment/PreferencesUtil.m index c91e44c521..a32f666e79 100644 --- a/Signal/src/environment/PreferencesUtil.m +++ b/Signal/src/environment/PreferencesUtil.m @@ -21,6 +21,9 @@ #define AUTOCORRECT_ENABLED_KEY @"Autocorrect Enabled Key" #define HISTORY_LOG_ENABLED_KEY @"History Log Enabled Key" #define PUSH_REVOKED_KEY @"Push Revoked Key" +#define DEBUG_IS_ENABLED_KEY @"Debugging Log Enabled Key" + +#define kSignalVersionKey @"SignalUpdateVersionKey" @implementation PropertyListPreferences (PropertyUtil) @@ -95,9 +98,19 @@ } } +- (BOOL)loggingIsEnabled{ + NSNumber *preference = [self tryGetValueForKey:DEBUG_IS_ENABLED_KEY]; + if (preference) { + return [preference boolValue]; + } else{ + return YES; + } +} + -(void) setFreshInstallTutorialsEnabled:(BOOL)enabled { [self setValueForKey:FRESH_INSTALL_TUTORIALS_ENABLED_KEY toValue:[NSNumber numberWithBool:enabled]]; } + -(void) setContactImagesEnabled:(BOOL)enabled { [self setValueForKey:CONTACT_IMAGES_ENABLED_KEY toValue:[NSNumber numberWithBool:enabled]]; } @@ -115,4 +128,21 @@ [self setValueForKey:PUSH_REVOKED_KEY toValue:[NSNumber numberWithBool:revoked]]; } +-(void) setLoggingEnabled:(BOOL)flag{ + [self setValueForKey:DEBUG_IS_ENABLED_KEY toValue:[NSNumber numberWithBool:flag]]; +} + +-(NSString*)lastRanVersion{ + return [[NSUserDefaults standardUserDefaults] objectForKey:kSignalVersionKey]; +} + +-(NSString*)setAndGetCurrentVersion{ + NSString *lastVersion = [self lastRanVersion]; + + [[NSUserDefaults standardUserDefaults] setObject:[NSString stringWithFormat:@"%@", [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"]] forKey:kSignalVersionKey]; + [[NSUserDefaults standardUserDefaults] synchronize]; + return lastVersion; +} + + @end diff --git a/Signal/src/environment/iOSVersions.h b/Signal/src/environment/iOSVersions.h index 3252f883d3..f03ccdb49c 100644 --- a/Signal/src/environment/iOSVersions.h +++ b/Signal/src/environment/iOSVersions.h @@ -81,7 +81,7 @@ Add a Singelton implementation to the .m File */ -#define MacrosSingletonImplemantion \ +#define MacrosSingletonImplemention \ + (instancetype)sharedInstance { \ \ static dispatch_once_t onceToken; \ @@ -93,4 +93,4 @@ sharedInstance = [self.class new]; \ return sharedInstance; \ } -#define CJAMacrosSingletonInterface + (instancetype)sharedInstance; +#define MacrosSingletonInterface + (instancetype)sharedInstance; diff --git a/Signal/src/network/PushManager.m b/Signal/src/network/PushManager.m index ef91ca23ce..a741d64447 100644 --- a/Signal/src/network/PushManager.m +++ b/Signal/src/network/PushManager.m @@ -104,7 +104,7 @@ } - (void)registerForPushWithToken:(NSData*)token{ - [[CallServerRequestsManager sharedManager] registerPushToken:token success:^(NSURLSessionDataTask *task, id responseObject) { + [[CallServerRequestsManager sharedInstance] registerPushToken:token success:^(NSURLSessionDataTask *task, id responseObject) { if ([task.response isKindOfClass: [NSHTTPURLResponse class]]){ NSInteger statusCode = [(NSHTTPURLResponse*) task.response statusCode]; if (statusCode == 200) { diff --git a/Signal/src/network/http/CallServerRequestsManager.h b/Signal/src/network/http/CallServerRequestsManager.h index a52e28b1ed..25c11daaac 100644 --- a/Signal/src/network/http/CallServerRequestsManager.h +++ b/Signal/src/network/http/CallServerRequestsManager.h @@ -11,7 +11,7 @@ @interface CallServerRequestsManager : NSObject -+ (instancetype)sharedManager; +MacrosSingletonInterface - (void)registerPushToken:(NSData*)deviceToken success:(void (^)(NSURLSessionDataTask *task, id responseObject))success failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure; diff --git a/Signal/src/network/http/CallServerRequestsManager.m b/Signal/src/network/http/CallServerRequestsManager.m index 8dfd565e89..181c45401c 100644 --- a/Signal/src/network/http/CallServerRequestsManager.m +++ b/Signal/src/network/http/CallServerRequestsManager.m @@ -23,14 +23,7 @@ @implementation CallServerRequestsManager -+ (instancetype)sharedManager { - static CallServerRequestsManager *sharedManager = nil; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - sharedManager = [[self alloc] init]; - }); - return sharedManager; -} +MacrosSingletonImplemention - (id)init{ self = [super init]; diff --git a/Signal/src/phone/PhoneNumber.h b/Signal/src/phone/PhoneNumber.h index d9eb18c5bb..a5023bf2d8 100644 --- a/Signal/src/phone/PhoneNumber.h +++ b/Signal/src/phone/PhoneNumber.h @@ -29,7 +29,7 @@ +(NSString*) regionCodeFromCountryCodeString:(NSString*) countryCodeString; --(NSURL*) toUrl; +-(NSURL*) toSystemDialerURL; -(NSString *)toE164; -(NSString *)localizedDescriptionForUser; -(NSNumber*)getCountryCode; diff --git a/Signal/src/phone/PhoneNumber.m b/Signal/src/phone/PhoneNumber.m index 497ade0e21..bf7d742b53 100644 --- a/Signal/src/phone/PhoneNumber.m +++ b/Signal/src/phone/PhoneNumber.m @@ -97,7 +97,6 @@ static NSString *const RPDefaultsKeyPhoneNumberCanonical = @"RPDefaultsKeyPhoneN char s[[text length]+1]; int xx = 0; for (NSUInteger i = 0; i < [text length]; i++) { - // @todo: Don't be terrible unichar x = [text characterAtIndex:i]; if (x == '+' || (x >= '0' && x <= '9')) { s[xx++] = (char)x; @@ -123,7 +122,7 @@ static NSString *const RPDefaultsKeyPhoneNumberCanonical = @"RPDefaultsKeyPhoneN } } --(NSURL*) toUrl { +-(NSURL*) toSystemDialerURL { NSString* link = [NSString stringWithFormat:@"telprompt://%@", e164]; return [NSURL URLWithString:link]; } diff --git a/Signal/src/util/SmsInvite.m b/Signal/src/util/SmsInvite.m index f55ea00007..29349eb9e9 100644 --- a/Signal/src/util/SmsInvite.m +++ b/Signal/src/util/SmsInvite.m @@ -16,7 +16,7 @@ NSString *inviteMessage = INVITE_USERS_MESSAGE; - messageController.body = [inviteMessage stringByAppendingString:@" http://appstore.com/signalprivatemessenger"]; + messageController.body = [inviteMessage stringByAppendingString:@" https://itunes.apple.com/app/id874139669"]; messageController.recipients = @[[number toE164]]; messageController.messageComposeDelegate = self; diff --git a/Signal/src/util/constraints/Constraints.h b/Signal/src/util/constraints/Constraints.h index b233442123..82ed18e3c4 100644 --- a/Signal/src/util/constraints/Constraints.h +++ b/Signal/src/util/constraints/Constraints.h @@ -2,7 +2,7 @@ #import "BadArgument.h" #import "SecurityFailure.h" #import "BadState.h" - +#import /// 'require(X)' is used to indicate parameter-related preconditions that callers must satisfy. /// Failure to satisfy indicates a bug in the caller. #define require(expr) if (!(expr)){ NSString *reason = [NSString stringWithFormat:@"require %@ (in %s at line %d)", (@#expr), __FILE__, __LINE__]; DDLogError(@"%@", reason);[BadArgument raise:reason];}; diff --git a/Signal/src/view controllers/ContactDetailViewController.m b/Signal/src/view controllers/ContactDetailViewController.m index 238fed757a..bf3f10a412 100644 --- a/Signal/src/view controllers/ContactDetailViewController.m +++ b/Signal/src/view controllers/ContactDetailViewController.m @@ -142,7 +142,7 @@ static NSString *const FAVOURITE_FALSE_ICON_NAME = @"favourite_false_icon"; - (void)openPhoneAppWithPhoneNumber:(PhoneNumber *)phoneNumber { if (phoneNumber) { - [[UIApplication sharedApplication] openURL:[phoneNumber toUrl]]; + [[UIApplication sharedApplication] openURL:[phoneNumber toSystemDialerURL]]; } } diff --git a/Signal/src/view controllers/FavouritesViewController.m b/Signal/src/view controllers/FavouritesViewController.m index d5d2c125c7..8970033488 100644 --- a/Signal/src/view controllers/FavouritesViewController.m +++ b/Signal/src/view controllers/FavouritesViewController.m @@ -89,7 +89,7 @@ static NSString *const CONTACT_TABLE_VIEW_CELL_IDENTIFIER = @"ContactTableViewCe } } - [[UIApplication sharedApplication] openURL:[contact.parsedPhoneNumbers[0] toUrl]]; + [[UIApplication sharedApplication] openURL:[contact.parsedPhoneNumbers[0] toSystemDialerURL]]; } #pragma mark - UITableViewDelegate diff --git a/Signal/src/view controllers/InboxFeedViewController.m b/Signal/src/view controllers/InboxFeedViewController.m index 8cea147a7f..09b0a0f11e 100644 --- a/Signal/src/view controllers/InboxFeedViewController.m +++ b/Signal/src/view controllers/InboxFeedViewController.m @@ -49,6 +49,7 @@ static NSString *const FOOTER_TABLE_CELL_IDENTIFIER = @"InboxFeedFooterCell"; [self setupLabelLocalizationAndStyles]; if (![Environment isRegistered]) { + [Environment resetAppData]; RegisterViewController *registerViewController = [RegisterViewController registerViewController]; [self presentViewController:registerViewController animated:NO completion:nil]; } diff --git a/Signal/src/view controllers/LeftSideMenuViewController.m b/Signal/src/view controllers/LeftSideMenuViewController.m index 2c9751e03a..1ade071f62 100644 --- a/Signal/src/view controllers/LeftSideMenuViewController.m +++ b/Signal/src/view controllers/LeftSideMenuViewController.m @@ -11,8 +11,8 @@ #define NUMBER_OF_TABLE_VIEW_SECTIONS 2 static NSString *SIDE_MENU_TABLE_CELL_IDENTIFIER = @"LeftSideMenuCell"; -static NSString *WHISPER_SYSTEMS_URL = @"http://whispersystems.org/"; -static NSString *WHISPER_SYSTEMS_BLOG_URL = @"http://whispersystems.org/blog"; +static NSString *WHISPER_SYSTEMS_URL = @"https://whispersystems.org/"; +static NSString *WHISPER_SYSTEMS_BLOG_URL = @"https://whispersystems.org/blog"; static NSString *WHISPER_SYSTEMS_BUGREPORT_URL = @"http://support.whispersystems.org"; @interface LeftSideMenuViewController () { diff --git a/Signal/src/view controllers/RegisterViewController.m b/Signal/src/view controllers/RegisterViewController.m index e3b546055b..ace6c66ec1 100644 --- a/Signal/src/view controllers/RegisterViewController.m +++ b/Signal/src/view controllers/RegisterViewController.m @@ -190,6 +190,8 @@ return; } } + _challengeButton.enabled = YES; + [_challengeActivityIndicator stopAnimating]; [Environment errorNoter](error, @"While Verifying Challenge.", NO); }]; @@ -200,16 +202,15 @@ [registered trySetResult:@YES]; [self dismissView]; [futureChallengeAcceptedSource trySetResult:result]; + _challengeButton.enabled = YES; + [_challengeActivityIndicator stopAnimating]; } failure:^{ UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:REGISTER_ERROR_ALERT_VIEW_TITLE message:REGISTER_ERROR_ALERT_VIEW_BODY delegate:nil cancelButtonTitle:REGISTER_ERROR_ALERT_VIEW_DISMISS otherButtonTitles:nil, nil]; [alertView show]; + _challengeButton.enabled = YES; + [_challengeActivityIndicator stopAnimating]; }]; }]; - - [futureDone finallyDo:^(Future *completed) { - _challengeButton.enabled = YES; - [_challengeActivityIndicator stopAnimating]; - }]; } - (void)showViewNumber:(NSInteger)viewNumber { diff --git a/Signal/src/view controllers/SettingsViewController.h b/Signal/src/view controllers/SettingsViewController.h index b356782510..896c1a8e65 100644 --- a/Signal/src/view controllers/SettingsViewController.h +++ b/Signal/src/view controllers/SettingsViewController.h @@ -21,28 +21,31 @@ @property (nonatomic, strong) IBOutlet UILabel *titleLabel; @property (nonatomic, strong) IBOutlet SettingsTableHeaderView *privacyAndSecurityHeaderView; +@property (nonatomic, strong) IBOutlet SettingsTableHeaderView *debuggingHeaderView; @property (nonatomic, strong) IBOutlet UITableViewCell *hideContactImagesCell; @property (nonatomic, strong) IBOutlet UITableViewCell *disableAutocorrectCell; @property (nonatomic, strong) IBOutlet UITableViewCell *disableHistoryCell; @property (nonatomic, strong) IBOutlet UITableViewCell *clearHistoryLogCell; +@property (nonatomic, strong) IBOutlet UITableViewCell *disableLogsCell; @property (nonatomic, strong) IBOutlet UIButton *hideContactImagesButton; @property (nonatomic, strong) IBOutlet UIButton *disableAutocorrectButton; @property (nonatomic, strong) IBOutlet UIButton *disableHistoryButton; - -@property (nonatomic, strong) IBOutlet SettingsTableHeaderView *callQualityHeaderView; -@property (nonatomic, strong) IBOutlet UITableViewCell *directoryUpdateCell; +@property (nonatomic, strong) IBOutlet UIButton *disableDebugLogsButton; @property (nonatomic, strong) IBOutlet UITableViewCell *sendDebugLog; - (IBAction)registerTapped; - (IBAction)privacyAndSecurityTapped; +- (IBAction)debuggingTapped:(id)sender; - (IBAction)hideContactImagesButtonTapped; - (IBAction)disableAutocorrectButtonTapped; - (IBAction)disableHistoryButtonTapped; +- (IBAction)disableLogTapped:(id)sender; + - (IBAction)menuButtonTapped; @end diff --git a/Signal/src/view controllers/SettingsViewController.m b/Signal/src/view controllers/SettingsViewController.m index 89c3239674..bc94acebe1 100644 --- a/Signal/src/view controllers/SettingsViewController.m +++ b/Signal/src/view controllers/SettingsViewController.m @@ -1,3 +1,4 @@ +#import "DebugLogger.h" #import "Environment.h" #import "FutureUtil.h" #import "LocalizableText.h" @@ -14,7 +15,7 @@ #define SECTION_HEADER_VIEW_HEIGHT 27 #define PRIVACY_SECTION_INDEX 0 -#define CALL_QUALITY_SECTION_INDEX 1 +#define DEBUG_SECTION_INDEX 1 static NSString *const CHECKBOX_CHECKMARK_IMAGE_NAME = @"checkbox_checkmark"; static NSString *const CHECKBOX_EMPTY_IMAGE_NAME = @"checkbox_empty"; @@ -22,7 +23,7 @@ static NSString *const CHECKBOX_EMPTY_IMAGE_NAME = @"checkbox_empty"; @interface SettingsViewController () { NSArray *_sectionHeaderViews; NSArray *_privacyTableViewCells; - NSArray *_callQualityTableViewCells; + NSArray *_debuggingTableViewCells; NSString *gistURL; } @@ -33,9 +34,9 @@ static NSString *const CHECKBOX_EMPTY_IMAGE_NAME = @"checkbox_empty"; - (void)viewDidLoad { [super viewDidLoad]; - - _sectionHeaderViews = @[_privacyAndSecurityHeaderView]; - + + _sectionHeaderViews = @[_privacyAndSecurityHeaderView , self.debuggingHeaderView]; + _titleLabel.text = SETTINGS_NAV_BAR_TITLE; } @@ -49,11 +50,11 @@ static NSString *const CHECKBOX_EMPTY_IMAGE_NAME = @"checkbox_empty"; - (void)viewWillDisappear:(BOOL)animated { [self saveExpandedSectionPreferences]; - + if ([self.navigationController.viewControllers count] > 1) { [self.navigationController setNavigationBarHidden:NO animated:YES]; } - + [super viewWillDisappear:animated]; } @@ -75,17 +76,17 @@ static NSString *const CHECKBOX_EMPTY_IMAGE_NAME = @"checkbox_empty"; - (NSAttributedString *)localNumberAttributedStringForNumber:(PhoneNumber *)number { NSString *numberPrefixString = SETTINGS_NUMBER_PREFIX; NSString *localNumberString = [number toE164]; - + NSString *displayString = [NSString stringWithFormat:@"%@ %@", numberPrefixString, localNumberString]; NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:displayString]; - + UIFont *prefixFont = [UIUtil helveticaNeueLTStdLightFontWithSize:_phoneNumberLabel.font.pointSize]; UIFont *numberFont = [UIUtil helveticaNeueLTStdBoldFontWithSize:_phoneNumberLabel.font.pointSize]; - + [attributedString addAttribute:NSFontAttributeName value:prefixFont range:NSMakeRange(0, [numberPrefixString length])]; - + [attributedString addAttribute:NSFontAttributeName value:numberFont range:NSMakeRange([numberPrefixString length] + 1, [localNumberString length])]; @@ -97,8 +98,9 @@ static NSString *const CHECKBOX_EMPTY_IMAGE_NAME = @"checkbox_empty"; - (void)configureCheckboxPreferences { NSArray *buttons = @[_hideContactImagesButton, _disableAutocorrectButton, - _disableHistoryButton]; - + _disableHistoryButton, + _disableDebugLogsButton]; + for (UIButton *button in buttons) { [button setImage:[UIImage imageNamed:CHECKBOX_EMPTY_IMAGE_NAME] forState:UIControlStateNormal]; @@ -106,22 +108,25 @@ static NSString *const CHECKBOX_EMPTY_IMAGE_NAME = @"checkbox_empty"; [button setImage:[UIImage imageNamed:CHECKBOX_CHECKMARK_IMAGE_NAME] forState:UIControlStateSelected]; } - PropertyListPreferences *prefs = [Environment preferences]; - _hideContactImagesButton.selected = ![prefs getContactImagesEnabled]; + PropertyListPreferences *prefs = [Environment preferences]; + _hideContactImagesButton.selected = ![prefs getContactImagesEnabled]; _disableAutocorrectButton.selected = ![prefs getAutocorrectEnabled]; - _disableHistoryButton.selected = ![prefs getHistoryLogEnabled]; + _disableHistoryButton.selected = ![prefs getHistoryLogEnabled]; + _disableLogsCell.selected = ![prefs loggingIsEnabled]; } - (void)configureAllCells { - _privacyTableViewCells = [self privacyAndSecurityCells]; + _privacyTableViewCells = [self privacyAndSecurityCells]; + _debuggingTableViewCells = [self debugCells]; [_privacyAndSecurityHeaderView setColumnStateExpanded:YES andIsAnimated:NO]; + [_debuggingHeaderView setColumnStateExpanded:YES andIsAnimated:NO]; } - (void)saveExpandedSectionPreferences { NSMutableArray *expandedSectionPrefs = [NSMutableArray array]; NSNumber *numberBoolYes = [NSNumber numberWithBool:YES]; NSNumber *numberBoolNo = [NSNumber numberWithBool:NO]; - + [expandedSectionPrefs addObject:(_privacyTableViewCells ? numberBoolYes : numberBoolNo)]; } @@ -131,8 +136,18 @@ static NSString *const CHECKBOX_EMPTY_IMAGE_NAME = @"checkbox_empty"; return @[_hideContactImagesCell, _disableAutocorrectCell, _disableHistoryCell, - _clearHistoryLogCell, - _sendDebugLog]; + _clearHistoryLogCell]; +} + +- (NSArray *)debugCells{ + + NSMutableArray *cells = [@[_disableLogsCell] mutableCopy]; + + if ([[Environment preferences] loggingIsEnabled]) { + [cells addObject:_sendDebugLog]; + } + + return cells; } - (NSArray *)indexPathsForCells:(NSArray *)cells forRow:(NSInteger)row { @@ -147,7 +162,9 @@ static NSString *const CHECKBOX_EMPTY_IMAGE_NAME = @"checkbox_empty"; - (NSArray *)cellsForRow:(NSInteger)row { if (row == PRIVACY_SECTION_INDEX) { return [self privacyAndSecurityCells]; - } else { + } else if (row == DEBUG_SECTION_INDEX){ + return [self debugCells]; + }else { return @[]; } } @@ -165,6 +182,12 @@ static NSString *const CHECKBOX_EMPTY_IMAGE_NAME = @"checkbox_empty"; [_privacyAndSecurityHeaderView setColumnStateExpanded:columnExpanded andIsAnimated:YES]; } +- (void)debuggingTapped:(id)sender{ + [self toggleCells:&_debuggingTableViewCells forRow:DEBUG_SECTION_INDEX]; + BOOL columnExpanded = _debuggingTableViewCells != nil; + [_debuggingHeaderView setColumnStateExpanded:columnExpanded andIsAnimated:YES]; +} + - (void)toggleCells:(NSArray *__strong*)cells forRow:(NSInteger)row { [_settingsTableView beginUpdates]; if (*cells) { @@ -194,6 +217,23 @@ static NSString *const CHECKBOX_EMPTY_IMAGE_NAME = @"checkbox_empty"; [[Environment preferences] setHistoryLogEnabled:!_disableHistoryButton.selected]; } +- (IBAction)disableLogTapped:(id)sender{ + _disableDebugLogsButton.selected = !_disableDebugLogsButton.selected; + + BOOL loggingEnabled = !_disableDebugLogsButton.selected; + + if (!loggingEnabled) { + [[DebugLogger sharedInstance] disableFileLogging]; + [[DebugLogger sharedInstance] wipeLogs]; + } else{ + [[DebugLogger sharedInstance] enableFileLogging]; + } + + [[Environment preferences] setLoggingEnabled:loggingEnabled]; + _debuggingTableViewCells = [self debugCells]; + [_settingsTableView reloadData]; +} + - (void)clearHistory { [[[Environment getCurrent] recentCallManager] clearRecentCalls]; UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:SETTINGS_LOG_CLEAR_TITLE @@ -222,7 +262,9 @@ static NSString *const CHECKBOX_EMPTY_IMAGE_NAME = @"checkbox_empty"; UIView *headerView = _sectionHeaderViews[(NSUInteger)section]; if (headerView == _privacyAndSecurityHeaderView) { return (NSInteger)[_privacyTableViewCells count]; - } else { + } else if (headerView == _debuggingHeaderView){ + return (NSInteger)[_debuggingTableViewCells count]; + }else { return 0; } } @@ -232,24 +274,26 @@ static NSString *const CHECKBOX_EMPTY_IMAGE_NAME = @"checkbox_empty"; UITableViewCell *cell = nil; if (headerView == _privacyAndSecurityHeaderView) { cell = _privacyTableViewCells[(NSUInteger)indexPath.row]; + } else if (headerView ==_debuggingHeaderView){ + cell = _debuggingTableViewCells[(NSUInteger)indexPath.row]; } [self findAndLocalizeLabelsForView:cell]; - + return cell; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [tableView deselectRowAtIndexPath:indexPath animated:YES]; - + UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; if (cell == _clearHistoryLogCell) { [self clearHistory]; } if (cell == _sendDebugLog) { - UIAlertView *alert = [[UIAlertView alloc] initWithTitle:SETTINGS_SENDLOG_WAITING - message:nil delegate:self cancelButtonTitle:nil otherButtonTitles: nil]; + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:SETTINGS_SENDLOG_WAITING + message:nil delegate:self cancelButtonTitle:nil otherButtonTitles: nil]; [alert show]; [Pastelog submitLogsWithCompletion:^(NSError *error, NSString *urlString) { diff --git a/Signal/src/view controllers/xibs/SettingsViewController.xib b/Signal/src/view controllers/xibs/SettingsViewController.xib index 259d9202db..daa92994bd 100644 --- a/Signal/src/view controllers/xibs/SettingsViewController.xib +++ b/Signal/src/view controllers/xibs/SettingsViewController.xib @@ -6,13 +6,14 @@ - - + + + @@ -265,7 +266,7 @@ - + @@ -367,51 +368,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -436,12 +392,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - diff --git a/Signal/test/audio/AudioRemoteIOTest.m b/Signal/test/audio/AudioRemoteIOTest.m index 46a130370b..59b99124b6 100644 --- a/Signal/test/audio/AudioRemoteIOTest.m +++ b/Signal/test/audio/AudioRemoteIOTest.m @@ -10,7 +10,7 @@ @implementation AudioRemoteIOTest --(void) ______REMOVE_THIS_PREFIX_TO_ENABLE_ACTUAL_AUDIO_TEST______testPlaysAndRecordsAudio { +-(void) testPlaysAndRecordsAudio { __block RemoteIOAudio* a = nil; __block double t = 0; diff --git a/Signal/test/util/QueueTest.m b/Signal/test/util/QueueTest.m index cafa6d094f..7a0be6a52e 100644 --- a/Signal/test/util/QueueTest.m +++ b/Signal/test/util/QueueTest.m @@ -3,6 +3,7 @@ #import "TestUtil.h" @implementation QueueTest + -(void) queueTest { Queue* q = [Queue new]; test([q count] == 0); @@ -26,4 +27,5 @@ testThrows([q peek]); testThrows([q dequeue]); } + @end diff --git a/Signal/translations/en.lproj/Localizable.strings b/Signal/translations/en.lproj/Localizable.strings index 7b33a3781a..31e85d61b4 100644 --- a/Signal/translations/en.lproj/Localizable.strings +++ b/Signal/translations/en.lproj/Localizable.strings @@ -108,15 +108,10 @@ "REGISTRATION_ERROR" = "Registration Error"; "REGISTRATION_BODY" = "We couldn't reach the Signal server. Please try again."; "REJECT_CALL_BUTTON_TITLE" = "Reject"; -"SETTINGS_CALL_QUALITY" = "Call Quality"; -"SETTINGS_CHANGE_VOLUME" = "Change Volume With Buttons"; "SETTINGS_CLEAR_HISTORY_LOG" = "Clear History Log"; -"SETTINGS_DATE_FORMAT" = "Date Format"; "SETTINGS_DISABLE_AUTOCORRECT" = "Disable Autocorrect"; "SETTINGS_DISABLE_HISTORY_LOG" = "Disable History Log"; "SETTINGS_HIDE_CONTACT_IMAGES" = "Hide Contact Images"; -"SETTINGS_LOCALIZATION_OVERRIDE" = "Localization Override"; -"SETTINGS_LOCALIZATION_OVERRIDES" = "Localization Overrides"; "SETTINGS_LOG_CLEAR_MESSAGE" = "Call History Cleared"; "SETTINGS_LOG_CLEAR_TITLE" = "Operation Completed"; "SETTINGS_NAV_BAR_TITLE" = "Settings"; @@ -124,6 +119,8 @@ "SETTINGS_NUMBER_PREFIX" = "Your Number:"; "SETTINGS_PRIVACY_AND_SECURITY" = "Privacy and Security"; "SETTINGS_RINGTONE" = "Ringtone"; +"SETTINGS_DEBUGGING" = "Debugging"; +"SETTINGS_DISABLE_LOGS" = "Disable debugging logs"; "SETTINGS_SENDLOG" = "Submit Debug Log"; "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).";