diff --git a/CHANGES.rst b/CHANGES.rst index b9f98beeb..786b986de 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,7 +4,11 @@ Changes in 0.12.0 (2020-xx-xx) Improvements: * Update deployment target to iOS 11.0. Required for Jitsi > 2.8.x. * Theme: Customize UISearchBar with new iOS 13 properties (#3270). - + * PushNotificationService: Move all notification related code to a new class (PR #3100). + * Cross-signing: Bootstrap cross-sign on registration (and login if applicable). This action is now invisible to the user (#3292). + * Authentication: Redirect the webview (SSO) javascript logs to iOS native logs. + * Timeline: Hide encrypted history (pre-invite) (#3239). + Bug fix: * Xcode11: Fix content change error when dragging start chat page (PR #3075). * Xcode11: Fix status bar styles for many screens (PR #3077). diff --git a/Riot/AppDelegate.m b/Riot/AppDelegate.m index 336e8ff41..931303e9b 100644 --- a/Riot/AppDelegate.m +++ b/Riot/AppDelegate.m @@ -1826,6 +1826,9 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni // Get modular widget events in rooms histories [[MXKAppSettings standardAppSettings] addSupportedEventTypes:@[kWidgetMatrixEventTypeString, kWidgetModularEventTypeString]]; + // Hide undecryptable messages that were sent while the user was not in the room + [MXKAppSettings standardAppSettings].hidePreJoinedUndecryptableEvents = YES; + // Enable long press on event in bubble cells [MXKRoomBubbleTableViewCell disableLongPressGestureOnEvent:NO]; diff --git a/Riot/Modules/Authentication/AuthenticationViewController.m b/Riot/Modules/Authentication/AuthenticationViewController.m index ddefb8e75..36527cba2 100644 --- a/Riot/Modules/Authentication/AuthenticationViewController.m +++ b/Riot/Modules/Authentication/AuthenticationViewController.m @@ -1146,28 +1146,66 @@ [session.crypto setOutgoingKeyRequestsEnabled:NO onComplete:nil]; [session.crypto.crossSigning refreshStateWithSuccess:^(BOOL stateUpdated) { - - if (session.crypto.crossSigning.state == MXCrossSigningStateCrossSigningExists) + + NSLog(@"[AuthenticationVC] sessionStateDidChange: crossSigning.state: %@", @(session.crypto.crossSigning.state)); + + switch (session.crypto.crossSigning.state) { - dispatch_async(dispatch_get_main_queue(), ^{ + case MXCrossSigningStateNotBootstrapped: + { +#ifdef NEW_CROSS_SIGNING_FLOW + // Bootstrap cross-signing on user's account + // We do it for both registration and new login as long as cross-signing does not exist yet + if (self.authInputsView.password.length) + { + NSLog(@"[AuthenticationVC] sessionStateDidChange: Bootstrap with password"); + + [session.crypto.crossSigning bootstrapWithPassword:self.authInputsView.password success:^{ + NSLog(@"[AuthenticationVC] sessionStateDidChange: Bootstrap succeeded"); + [self dismiss]; + } failure:^(NSError * _Nonnull error) { + NSLog(@"[AuthenticationVC] sessionStateDidChange: Bootstrap failed. Error: %@", error); + [session.crypto setOutgoingKeyRequestsEnabled:YES onComplete:nil]; + [self dismiss]; + }]; + } + else + { + NSLog(@"[AuthenticationVC] sessionStateDidChange: Do not know how to bootstrap cross-signing. Skip it."); + + [session.crypto setOutgoingKeyRequestsEnabled:YES onComplete:nil]; + [self dismiss]; + } +#else + [session.crypto setOutgoingKeyRequestsEnabled:YES onComplete:nil]; + [self dismiss]; +#endif + break; + } + case MXCrossSigningStateCrossSigningExists: + { + NSLog(@"[AuthenticationVC] sessionStateDidChange: Complete security"); + // Ask the user to verify this session self.userInteractionEnabled = YES; [self.authenticationActivityIndicator stopAnimating]; [self presentCompleteSecurityWithSession:session]; - }); - } - else - { - [session.crypto setOutgoingKeyRequestsEnabled:YES onComplete:nil]; - [self dismiss]; + break; + } + + default: + NSLog(@"[AuthenticationVC] sessionStateDidChange: Nothing to do"); + + [session.crypto setOutgoingKeyRequestsEnabled:YES onComplete:nil]; + [self dismiss]; + break; } } failure:^(NSError * _Nonnull error) { - NSLog(@"[AuthenticationVC] Fail to refresh crypto state with error: %@", error); - dispatch_async(dispatch_get_main_queue(), ^{ - [self dismiss]; - }); + NSLog(@"[AuthenticationVC] sessionStateDidChange: Fail to refresh crypto state with error: %@", error); + [session.crypto setOutgoingKeyRequestsEnabled:YES onComplete:nil]; + [self dismiss]; }]; } else diff --git a/Riot/Modules/Home/Fallback/AuthFallBackViewController.m b/Riot/Modules/Home/Fallback/AuthFallBackViewController.m index 102ef2c5c..9b807b996 100644 --- a/Riot/Modules/Home/Fallback/AuthFallBackViewController.m +++ b/Riot/Modules/Home/Fallback/AuthFallBackViewController.m @@ -56,6 +56,9 @@ NSString *FallBackViewControllerJavascriptOnLogin = @"window.matrixLogin.onLogin { [super viewDidLoad]; + // Catch js logs + [self enableDebug]; + // Due to https://developers.googleblog.com/2016/08/modernizing-oauth-interactions-in-native-apps.html, we hack // the user agent to bypass the limitation of Google, as a quick fix (a proper solution will be to use the SSO SDK) webView.customUserAgent = @"Mozilla/5.0"; diff --git a/Riot/Modules/Settings/Security/SecurityViewController.m b/Riot/Modules/Settings/Security/SecurityViewController.m index 845671aa8..299735113 100644 --- a/Riot/Modules/Settings/Security/SecurityViewController.m +++ b/Riot/Modules/Settings/Security/SecurityViewController.m @@ -425,7 +425,6 @@ UIDocumentInteractionControllerDelegate> { case MXCrossSigningStateNotBootstrapped: // Action: Bootstrap case MXCrossSigningStateCanCrossSign: // Action: Reset - case MXCrossSigningStateCanCrossSignAsynchronously: // Action: Reset numberOfRowsInCrossSigningSection = CROSSSIGNING_FIRST_ACTION + 1; break; case MXCrossSigningStateCrossSigningExists: // Actions: Verify this session, Reset @@ -454,7 +453,6 @@ UIDocumentInteractionControllerDelegate> crossSigningInformation = [NSBundle mxk_localizedStringForKey:@"security_settings_crosssigning_info_trusted"]; break; case MXCrossSigningStateCanCrossSign: - case MXCrossSigningStateCanCrossSignAsynchronously: crossSigningInformation = [NSBundle mxk_localizedStringForKey:@"security_settings_crosssigning_info_ok"]; break; } @@ -489,7 +487,6 @@ UIDocumentInteractionControllerDelegate> [self setUpcrossSigningButtonCellForBootstrap:buttonCell]; break; case MXCrossSigningStateCanCrossSign: // Action: Reset - case MXCrossSigningStateCanCrossSignAsynchronously: // Action: Reset [self setUpcrossSigningButtonCellForReset:buttonCell]; break; case MXCrossSigningStateCrossSigningExists: // Actions: Verify this session, Reset