Permalink
Browse files

Working on CocoaPods 1.0 and Xcode 8 support

  • Loading branch information...
1 parent 2dbac38 commit 0148296b4d6f81bf77d50778da36568eda868822 @chrisballinger chrisballinger committed Sep 13, 2016
Oops, something went wrong.
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "0730"
+ LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "0730"
+ LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "0730"
+ LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -11,7 +11,7 @@
#import "OTREncryptionManager.h"
#import "OTRLog.h"
#import "OTRDatabaseView.h"
-#import <SSKeychain/SSKeychain.h>
+#import <SAMKeychain/SAMKeychain.h>
#import "OTRConstants.h"
#import "OTRXMPPAccount.h"
#import "OTRXMPPTorAccount.h"
@@ -235,9 +235,9 @@ - (void) setDatabasePassphrase:(NSString *)passphrase remember:(BOOL)rememeber e
{
if (rememeber) {
self.inMemoryPassphrase = nil;
- [SSKeychain setPassword:passphrase forService:kOTRServiceName account:OTRYapDatabasePassphraseAccountName error:error];
+ [SAMKeychain setPassword:passphrase forService:kOTRServiceName account:OTRYapDatabasePassphraseAccountName error:error];
} else {
- [SSKeychain deletePasswordForService:kOTRServiceName account:OTRYapDatabasePassphraseAccountName];
+ [SAMKeychain deletePasswordForService:kOTRServiceName account:OTRYapDatabasePassphraseAccountName];
self.inMemoryPassphrase = passphrase;
}
}
@@ -253,7 +253,7 @@ - (NSString *)databasePassphrase
return self.inMemoryPassphrase;
}
else {
- return [SSKeychain passwordForService:kOTRServiceName account:OTRYapDatabasePassphraseAccountName];
+ return [SAMKeychain passwordForService:kOTRServiceName account:OTRYapDatabasePassphraseAccountName];
}
}
@@ -75,12 +75,6 @@ - (void) populateSettings
[newSettingsDictionary setObject:deletedDisconnectedConversations forKey:kOTRSettingKeyDeleteOnDisconnect];
- OTRBoolSetting *showDisconnectionWarning = [[OTRBoolSetting alloc] initWithTitle:DISCONNECTION_WARNING_TITLE_STRING
- description:DISCONNECTION_WARNING_DESC_STRING
- settingsKey:kOTRSettingKeyShowDisconnectionWarning];
- showDisconnectionWarning.defaultValue = @(NO);
- [newSettingsDictionary setObject:showDisconnectionWarning forKey:kOTRSettingKeyShowDisconnectionWarning];
-
OTRBoolSetting *opportunisticOtrSetting = [[OTRBoolSetting alloc] initWithTitle:OPPORTUNISTIC_OTR_SETTING_TITLE
description:OPPORTUNISTIC_OTR_SETTING_DESCRIPTION
settingsKey:kOTRSettingKeyOpportunisticOtr];
@@ -110,7 +104,7 @@ - (void) populateSettings
NSArray * securitySettings;
- chatSettings = [NSArray arrayWithObjects:deletedDisconnectedConversations, showDisconnectionWarning, nil];
+ chatSettings = [NSArray arrayWithObjects:deletedDisconnectedConversations, nil];
OTRSettingsGroup *chatSettingsGroup = [[OTRSettingsGroup alloc] initWithTitle:CHAT_STRING settings:chatSettings];
[self.settingsGroups addObject:chatSettingsGroup];
@@ -497,6 +497,7 @@ - (BOOL)connectWithJID:(NSString*) myJID password:(NSString*)myPassword;
}
- (void) disconnectSocketOnly:(BOOL)socketOnly {
+ DDLogVerbose(@"%@: %@ %d", THIS_FILE, THIS_METHOD, socketOnly);
if (socketOnly) {
[self.xmppStream disconnect];
self.connectionStatus = OTRProtocolConnectionStatusDisconnected;
@@ -7,7 +7,7 @@
//
#import "OTRAccount.h"
-#import <SSKeychain/SSKeychain.h>
+#import <SAMKeychain/SAMKeychain.h>
#import "OTRLog.h"
#import "OTRConstants.h"
@@ -99,14 +99,14 @@ - (void)setPassword:(NSString *) password {
if (!password.length || !self.rememberPassword) {
NSError *error = nil;
- [SSKeychain deletePasswordForService:kOTRServiceName account:self.uniqueId error:&error];
+ [SAMKeychain deletePasswordForService:kOTRServiceName account:self.uniqueId error:&error];
if (error) {
DDLogError(@"Error deleting password from keychain: %@%@", [error localizedDescription], [error userInfo]);
}
return;
}
NSError *error = nil;
- [SSKeychain setPassword:password forService:kOTRServiceName account:self.uniqueId error:&error];
+ [SAMKeychain setPassword:password forService:kOTRServiceName account:self.uniqueId error:&error];
if (error) {
DDLogError(@"Error saving password to keychain: %@%@", [error localizedDescription], [error userInfo]);
}
@@ -117,7 +117,7 @@ - (NSString *)password {
return nil;
}
NSError *error = nil;
- NSString *password = [SSKeychain passwordForService:kOTRServiceName account:self.uniqueId error:&error];
+ NSString *password = [SAMKeychain passwordForService:kOTRServiceName account:self.uniqueId error:&error];
if (error) {
DDLogError(@"Error retreiving password from keychain: %@%@", [error localizedDescription], [error userInfo]);
error = nil;
@@ -7,7 +7,7 @@
//
#import "OTROAuthXMPPAccount.h"
-#import <SSKeychain/SSKeychain.h>
+#import <SAMKeychain/SAMKeychain.h>
#import "OTRLog.h"
#import "OTRConstants.h"
@@ -38,7 +38,7 @@ -(void)setOAuthTokenDictionary:(NSDictionary *)oAuthTokenDictionary
else {
NSError *error = nil;
- SSKeychainQuery * keychainQuery = [self baseKeychainQuery];
+ SAMKeychainQuery * keychainQuery = [self baseKeychainQuery];
keychainQuery.passwordObject = oAuthTokenDictionary;
@@ -55,7 +55,7 @@ - (NSDictionary *)oAuthTokenDictionary
NSError * error = nil;
NSDictionary *dictionary = nil;
- SSKeychainQuery * keychainQuery = [self baseKeychainQuery];
+ SAMKeychainQuery * keychainQuery = [self baseKeychainQuery];
[keychainQuery fetch:&error];
if (error) {
@@ -68,9 +68,9 @@ - (NSDictionary *)oAuthTokenDictionary
return dictionary;
}
--(SSKeychainQuery *)baseKeychainQuery
+-(SAMKeychainQuery *)baseKeychainQuery
{
- SSKeychainQuery * keychainQuery = [[SSKeychainQuery alloc] init];
+ SAMKeychainQuery * keychainQuery = [[SAMKeychainQuery alloc] init];
keychainQuery.service = kOTRServiceName;
keychainQuery.account = self.uniqueId;
return keychainQuery;
@@ -13,7 +13,7 @@ import YapDatabase.YapDatabaseActionManager
case Delete
}
-@objc public class BuddyAction: OTRYapDatabaseObject, YapActionable {
+public class BuddyAction: OTRYapDatabaseObject, YapActionable {
public var action:BuddyActionType = .Delete
public var buddy:OTRBuddy?
@@ -61,4 +61,4 @@ import YapDatabase.YapDatabaseActionManager
}
}
-}
+}
@@ -21,7 +21,6 @@
// along with ChatSecure. If not, see <http://www.gnu.org/licenses/>.
@import UIKit;
-@import HockeySDK_Source;
@class OTRTheme;
@class OTRSettingsViewController;
@@ -30,6 +29,7 @@
@class PushController;
@class PushOTRListener;
@protocol OTRThreadOwner;
+#import <HockeySDK_Source/HockeySDK.h>
@interface OTRAppDelegate : UIResponder <UIApplicationDelegate, BITHockeyManagerDelegate>
@@ -36,7 +36,7 @@
#import "OTRSettingsManager.h"
#import "OTRSecrets.h"
#import "OTRDatabaseManager.h"
-#import <SSKeychain/SSKeychain.h>
+#import <SAMKeychain/SAMKeychain.h>
#import "OTRLog.h"
#import "DDTTYLogger.h"
@@ -88,7 +88,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
_theme = [[[self themeClass] alloc] init];
[self.theme setupGlobalTheme];
- [SSKeychain setAccessibilityType:kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly];
+ [SAMKeychain setAccessibilityType:kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly];
UIViewController *rootViewController = nil;
@@ -297,8 +297,9 @@ - (void)applicationDidEnterBackground:(UIApplication *)application
self.backgroundTask = [application beginBackgroundTaskWithExpirationHandler: ^{
dispatch_async(dispatch_get_main_queue(), ^{
- DDLogInfo(@"Background task expired");
- if (self.backgroundTimer)
+ DDLogInfo(@"Background task expired, disconnecting all accounts. Remaining: %f", application.backgroundTimeRemaining);
+ [[OTRProtocolManager sharedInstance] disconnectAllAccountsSocketOnly:YES];
+ if (self.backgroundTimer)
{
[self.backgroundTimer invalidate];
self.backgroundTimer = nil;
@@ -315,34 +316,8 @@ - (void)applicationDidEnterBackground:(UIApplication *)application
- (void) timerUpdate:(NSTimer*)timer {
UIApplication *application = [UIApplication sharedApplication];
-
NSTimeInterval timeRemaining = application.backgroundTimeRemaining;
DDLogVerbose(@"Timer update, background time left: %f", timeRemaining);
-
- if (timeRemaining < 60 && !self.didShowDisconnectionWarning && [OTRSettingsManager boolForOTRSettingKey:kOTRSettingKeyShowDisconnectionWarning])
- {
- UILocalNotification *localNotif = [[UILocalNotification alloc] init];
- if (localNotif) {
- localNotif.alertBody = EXPIRATION_STRING;
- localNotif.alertAction = OK_STRING;
- localNotif.soundName = UILocalNotificationDefaultSoundName;
- [application presentLocalNotificationNow:localNotif];
- }
- self.didShowDisconnectionWarning = YES;
- }
- if (timeRemaining < 3)
- {
- // Clean up here
- [self.backgroundTimer invalidate];
- self.backgroundTimer = nil;
-
- [[OTRProtocolManager sharedInstance] disconnectAllAccountsSocketOnly:YES];
-
- dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
- [application endBackgroundTask:self.backgroundTask];
- self.backgroundTask = UIBackgroundTaskInvalid;
- });
- }
}
/** Doesn't stop autoLogin if previous crash when it's a background launch */
@@ -7,8 +7,8 @@
//
#import "OTRCertificatePinning.h"
-#import <SSKeychain/SSKeychain.h>
-#import "SSKeychainQuery.h"
+#import <SAMKeychain/SAMKeychain.h>
+#import "SAMKeychainQuery.h"
#import "GCDAsyncSocket.h"
#import "AFSecurityPolicy.h"
#import "XMPPStream.h"
@@ -125,7 +125,7 @@ + (void)addCertificate:(SecCertificateRef)cert withHostName:(NSString *)hostname
NSData * certData = [OTRCertificatePinning dataForCertificate:cert];
if ([hostname length] && [certData length]) {
- SSKeychainQuery * keychainQuery = [[SSKeychainQuery alloc] init];
+ SAMKeychainQuery * keychainQuery = [[SAMKeychainQuery alloc] init];
keychainQuery.service = kOTRCertificateServiceName;
keychainQuery.account = hostname;
@@ -157,7 +157,7 @@ + (void)addCertificate:(SecCertificateRef)cert withHostName:(NSString *)hostname
+ (NSArray *)storedCertificatesWithHostName:(NSString *)hostname {
NSArray * certificateArray = nil;
- SSKeychainQuery * keychainQuery = [self keychainQueryForHostName:hostname];
+ SAMKeychainQuery * keychainQuery = [self keychainQueryForHostName:hostname];
NSError * error =nil;
[keychainQuery fetch:&error];
@@ -214,13 +214,13 @@ +(NSString*)sha256FingerprintForCertificate:(SecCertificateRef)certificate {
+ (NSDictionary *)allCertificates {
NSMutableDictionary * resultsDictionary = [NSMutableDictionary dictionary];
- NSArray * allCertificatesArray = [SSKeychain accountsForService:kOTRCertificateServiceName];
+ NSArray * allCertificatesArray = [SAMKeychain accountsForService:kOTRCertificateServiceName];
if ([allCertificatesArray count]) {
[allCertificatesArray enumerateObjectsUsingBlock:^(NSDictionary * keychainProperties, NSUInteger idx, BOOL *stop) {
- NSString * domain = keychainProperties[kSSKeychainAccountKey];
+ NSString * domain = keychainProperties[kSAMKeychainAccountKey];
NSArray * certs = [self storedCertificatesWithHostName:domain];
resultsDictionary[domain] = certs;
}];
@@ -231,8 +231,8 @@ + (NSDictionary *)allCertificates {
}
-+ (SSKeychainQuery *)keychainQueryForHostName:(NSString *)hostname {
- SSKeychainQuery * keychainQuery = [[SSKeychainQuery alloc] init];
++ (SAMKeychainQuery *)keychainQueryForHostName:(NSString *)hostname {
+ SAMKeychainQuery * keychainQuery = [[SAMKeychainQuery alloc] init];
keychainQuery.service = kOTRCertificateServiceName;
keychainQuery.account = hostname;
@@ -241,13 +241,13 @@ + (SSKeychainQuery *)keychainQueryForHostName:(NSString *)hostname {
+ (void)deleteAllCertificatesWithHostName:(NSString *)hostname {
NSError * error = nil;
- [SSKeychain deletePasswordForService:kOTRCertificateServiceName account:hostname error:&error];
+ [SAMKeychain deletePasswordForService:kOTRCertificateServiceName account:hostname error:&error];
if (error) {
DDLogError(@"Error deleting all certificates: %@", error);
}
}
+ (void)deleteCertificate:(SecCertificateRef)cert withHostName:(NSString *)hostname {
- SSKeychainQuery * keychainQuery = [self keychainQueryForHostName:hostname];
+ SAMKeychainQuery * keychainQuery = [self keychainQueryForHostName:hostname];
NSError * error = nil;
View
@@ -1,4 +1,4 @@
source "https://rubygems.org"
-gem "cocoapods", "0.39.0"
-gem "activesupport", "~> 4.2.6"
+gem "cocoapods", "1.1.0.rc.1"
+#gem "activesupport", "~> 4.2.6"
Oops, something went wrong.

0 comments on commit 0148296

Please sign in to comment.