Skip to content

Commit

Permalink
Replace SSKeychian with SAMKeychain
Browse files Browse the repository at this point in the history
  • Loading branch information
Aufree committed Oct 28, 2016
1 parent 46a8d1a commit 9d6a211
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions PHPHub/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#import "JpushHandler.h"
#import "LaunchScreenAdHandler.h"
#import "ExceptionHandler.h"
#import "SSKeychain.h"
#import "SAMKeychain.h"

@interface AppDelegate ()

Expand Down Expand Up @@ -98,7 +98,7 @@ - (void)basicSetup {
[SVProgressHUD setMinimumDismissTimeInterval:1];

// Setup SSKeyChain
[SSKeychain setAccessibilityType:kSecAttrAccessibleWhenUnlocked];
[SAMKeychain setAccessibilityType:kSecAttrAccessibleWhenUnlocked];
}

#pragma mark - APNs
Expand Down
4 changes: 2 additions & 2 deletions PHPHub/BaseClasses/CurrentUser.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#import "AccessTokenHandler.h"
#import "JpushHandler.h"
#import "NotificationModel.h"
#import "SSKeychain.h"
#import "SAMKeychain.h"

@implementation CurrentUser
+ (CurrentUser *)Instance {
Expand Down Expand Up @@ -68,7 +68,7 @@ - (void)checkNoticeCount {
}

- (void)logOut {
[SSKeychain deletePasswordForService:KeyChainService account:KeyChainAccount];
[SAMKeychain deletePasswordForService:KeyChainService account:KeyChainAccount];
[GVUserDefaults standardUserDefaults].currentUserId = nil;
[JpushHandler sendEmptyAlias];
}
Expand Down
8 changes: 4 additions & 4 deletions PHPHub/Handlers/AccessTokenHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

#import "AccessTokenHandler.h"
#import "SSKeychain.h"
#import "SAMKeychain.h"

@implementation AccessTokenHandler
#pragma mark - Client Grant
Expand Down Expand Up @@ -62,17 +62,17 @@ + (void)fetchClientGrantTokenWithRetryTimes:(NSInteger)times callback:(BaseResul
#pragma mark - Password Grant

+ (NSString *)getLoginTokenGrantAccessToken {
NSString *token = [SSKeychain passwordForService:KeyChainService account:KeyChainAccount];
NSString *token = [SAMKeychain passwordForService:KeyChainService account:KeyChainAccount];
return [NSString stringWithFormat:@"Bearer %@", token];
}

+ (void)storeLoginTokenGrantAccessToken:(NSString *)token {
[SSKeychain setPassword:token forService:KeyChainService account:KeyChainAccount];
[SAMKeychain setPassword:token forService:KeyChainService account:KeyChainAccount];
[[BaseApi loginTokenGrantInstance] setUpLoginTokenGrantRequest];
}

+ (void)clearToken {
[SSKeychain deletePasswordForService:KeyChainService account:KeyChainAccount];
[SAMKeychain deletePasswordForService:KeyChainService account:KeyChainAccount];
[GVUserDefaults standardUserDefaults].userClientToken = nil;
}

Expand Down
2 changes: 1 addition & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ target "PHPHub" do
pod 'DZNEmptyDataSet'
pod 'WebViewJavascriptBridge'
pod 'JTSImageViewController'
pod 'SSKeychain'
pod 'SAMKeychain'
end
8 changes: 4 additions & 4 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ PODS:
- HappyDNS (~> 0.2)
- QRCodeReaderViewController (3.5.2)
- Reachability (3.2)
- SAMKeychain (1.5.2)
- SDWebImage (3.7.3):
- SDWebImage/Core (= 3.7.3)
- SDWebImage/Core (3.7.3)
- SSKeychain (1.2.3)
- SVProgressHUD (2.0.3)
- UIActionSheet+Blocks (0.9)
- UIActivityIndicator-for-SDWebImage (1.2):
Expand Down Expand Up @@ -98,8 +98,8 @@ DEPENDENCIES:
- Qiniu
- QRCodeReaderViewController (from `https://github.com/zhengjinghua/MQRCodeReaderViewController.git`)
- Reachability
- SAMKeychain
- SDWebImage
- SSKeychain
- SVProgressHUD (= 2.0.3)
- UIActionSheet+Blocks
- UIActivityIndicator-for-SDWebImage
Expand Down Expand Up @@ -148,8 +148,8 @@ SPEC CHECKSUMS:
Qiniu: d899770cc7b9a7abb3bff9fd993adc93c9475d45
QRCodeReaderViewController: 557e3291d8fe8adf20d62b7f6bd79a3941f8ec31
Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96
SAMKeychain: 1865333198217411f35327e8da61b43de79b635b
SDWebImage: 1d2b1a1efda1ade1b00b6f8498865f8ddedc8a84
SSKeychain: 3f42991739c6c60a9cf1bbd4dff6c0d3694bcf3d
SVProgressHUD: b0830714205bea1317ea1a2ebc71e5633af334d4
UIActionSheet+Blocks: e180b7dad0a721ab7f212ac9742af799008bb358
UIActivityIndicator-for-SDWebImage: 7bf7ebbf0ed1747dedc0d6e949c4603a6d0f9e0c
Expand All @@ -159,6 +159,6 @@ SPEC CHECKSUMS:
UMengSocial: 85882abe5b20aa38ad558ece71360e16b5d50909
WebViewJavascriptBridge: f10ac16f2cd3adf2b941bd79477c55a8f6e01044

PODFILE CHECKSUM: 5efc83d717d9a17f203cbbd2b71f45398143d8b2
PODFILE CHECKSUM: 218f28d4935673973e859ea6da2ea60ad76d0c63

COCOAPODS: 1.1.1

0 comments on commit 9d6a211

Please sign in to comment.