mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-03-06 16:30:55 +00:00
Access and save keychain data with always access
This helps if an app is running in the background and the device is still locked
This commit is contained in:
@@ -209,7 +209,7 @@ NSString *bit_appAnonID(void) {
|
||||
andPassword:appAnonID
|
||||
forServiceName:bit_keychainHockeySDKServiceName()
|
||||
updateExisting:YES
|
||||
accessibility:kSecAttrAccessibleWhenUnlockedThisDeviceOnly
|
||||
accessibility:kSecAttrAccessibleAlwaysThisDeviceOnly
|
||||
error:&error];
|
||||
});
|
||||
}
|
||||
|
||||
@@ -391,7 +391,7 @@ bitstadium_info_t bitstadium_library_info __attribute__((section("__TEXT,__bit_h
|
||||
andPassword:value
|
||||
forServiceName:bit_keychainHockeySDKServiceName()
|
||||
updateExisting:YES
|
||||
accessibility:kSecAttrAccessibleWhenUnlockedThisDeviceOnly
|
||||
accessibility:kSecAttrAccessibleAlwaysThisDeviceOnly
|
||||
error:&error];
|
||||
} else {
|
||||
updateType = @"delete";
|
||||
|
||||
@@ -123,7 +123,7 @@ static NSString *BITKeychainUtilsErrorDomain = @"BITKeychainUtilsErrorDomain";
|
||||
}
|
||||
|
||||
+ (BOOL) storeUsername: (NSString *) username andPassword: (NSString *) password forServiceName: (NSString *) serviceName updateExisting: (BOOL) updateExisting error: (NSError **) error {
|
||||
return [self storeUsername:username andPassword:password forServiceName:serviceName updateExisting:updateExisting accessibility:kSecAttrAccessibleWhenUnlocked error:error];
|
||||
return [self storeUsername:username andPassword:password forServiceName:serviceName updateExisting:updateExisting accessibility:kSecAttrAccessibleAlways error:error];
|
||||
}
|
||||
|
||||
+ (BOOL) storeUsername: (NSString *) username andPassword: (NSString *) password forServiceName: (NSString *) serviceName updateExisting: (BOOL) updateExisting accessibility:(CFTypeRef) accessibility error: (NSError **) error
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
andPassword:@"PanThisDeviceOnly"
|
||||
forServiceName:@"Test"
|
||||
updateExisting:YES
|
||||
accessibility:kSecAttrAccessibleWhenUnlockedThisDeviceOnly
|
||||
accessibility:kSecAttrAccessibleAlwaysThisDeviceOnly
|
||||
error:nil];
|
||||
assertThatBool(success, equalToBool(YES));
|
||||
NSString *pass = [BITKeychainUtils getPasswordForUsername:@"Peter"
|
||||
|
||||
Reference in New Issue
Block a user