MESSENGER-3861 Security fix, set lastActiveTime only when pinUnlocked state is reached

This commit is contained in:
Frank Rotermund
2022-11-21 07:52:29 +01:00
parent 2c2f0fa51a
commit 21e3e38979
3 changed files with 14 additions and 3 deletions
@@ -258,6 +258,8 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
*/
@property (nonatomic, assign, getter=isClearingCache) BOOL clearingCache;
@property (nonatomic, assign) BOOL isPinUnlocked;
@end
@implementation LegacyAppDelegate
@@ -572,6 +574,10 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
self.setPinCoordinatorBridgePresenter.delegate = self;
[self.setPinCoordinatorBridgePresenter presentWithMainAppWindow:self.window];
}
if (self.isPinUnlocked) {
[self.localAuthenticationService setLastActiveTime];
}
}
- (void)applicationDidEnterBackground:(UIApplication *)application
@@ -657,6 +663,7 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
}
if (createIfRequired)
{
self.isPinUnlocked = false;
self.setPinCoordinatorBridgePresenter = [[SetPinCoordinatorBridgePresenter alloc] initWithSession:mxSessionArray.firstObject viewMode:SetPinCoordinatorViewModeUnlock];
self.setPinCoordinatorBridgePresenter.delegate = self;
[self.setPinCoordinatorBridgePresenter presentWithMainAppWindow:self.window];
@@ -762,6 +769,8 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
[BWIAnalytics.sharedTracker trackEvent:@"Session" action:@"PinLogin"];
self.isPinUnlocked = true;
[_masterTabBarController bwiOnUnlockedByPin];
[self.delegate legacyAppDelegateDidUnlockPin:self];