mattermost-mobile/patches/react-native+0.61.2.patch
Miguel Alatzar 1efb01deda
[MM-16593] Upgrade to RN 0.61.2 (#3455)
* [MM-16593] [MM-17175] [MM-17164] [MM-17189] [MM-17181] Android - Upgrade to RN 0.60 (#3145)

* Upgrade to react-native 0.60

* Use @sentry/react-native

* Manually link @sentry/react-native

* Address review comments

* Jetify after install

* Call jetify from node_modules

* [MM-17785] iOS - Upgrade to RN 0.60 (#3153)

* Upgrade to react-native 0.60

* Use @sentry/react-native

* Manually link @sentry/react-native

* Address review comments

* Jetify after install

* Call jetify from node_modules

* Get app building for iOS

* Revert react-native-image-picker upgrade

* Minor version upgrade of react-native-image-picker

* [MM-17142] Convert all string refs to callbacks (#3217)

* Replace string refs

* Fix tests

* Don't use inline functions

* Fix mattermost-redux reversion from master merge

* [MM-18336] Upload Sentry debug symbols only when SENTRY_ENABLED is true (#3227)

* Upgrade @sentry/react-native

* Run Sentry gradle tasks only when enabled

* Upgrade @sentry/react-native and remove extra Sentry build phase

* [MM-17144] Use Hermes (#3226)

* Replace string refs

* Fix tests

* Don't use inline functions

* Fix mattermost-redux reversion from master merge

* Use Hermes

* bundleCommand ram-bundle no longer needed

* Require harmony-reflect only for Android

* Fix failing test

* Path react-native's splitLayoutProps (#3337)

* [MM-18867] [MM-17186] [MM-18866] [MM-19447] [MM-18967] Upgrade to RN 0.61.2 (#3423)

* Upgrade to RN 0.61.2

* Update rn-fetch-blob commit hash

* Update react-native-keyboard-tracking-view commit hash

* Use react-native-youtube with AVPlayer fix

* Fix jest mocks

* Use updated document picker API

* Remove unnecessary linking

* Revert "MM-17759 Add code highlighting (#3072)"

This reverts commit 26b999e885.

* Fix share extension

* Revert "Revert "MM-17759 Add code highlighting (#3072)""

This reverts commit 52aca776b12dee3abe8646d0c90480f8528e86c1.

* Address PR reviews

* Rename patch to match version

* Update react-native-youtube patch

* Update dependencies

* Fix RNDocViewer reference

* Update tests and revert to redux-persist 4.10.2

* Revert "Revert "Revert "MM-17759 Add code highlighting (#3072)"""

This reverts commit 5ef383be2619b1be6167c23f128ecb4b4ad25df9.

* Android fixes after dep upgrades

* Use fresco 2.0.0

* Use mattermost forks

* Use React-Core in Mattermost.scheme instead of react

* Remove packager (#3452)

* Remove Pods from source control

* Fix unit tests

* Add new line before entering the keystore in gradle.properties

* set ios as working directory for cocoapods

* Cache cocoapods on circleCI builds

* set ios as working dir

* fix cocoapods cache key

* Unify fastlane and npm dependencies command

* Use package-lock.json checksum for npm cache

* Fix package.json and use the checksum as the cache key

* Fix package.json and use the checksum as the cache key

* changes to circleci.yaml fastlane and removing pods from git

* Fix Mattermost.xcodeproj

* Update coocoapods to 1.7.5 and fix xcode header search paths

* Update package-lock.json

* Remove unused tooltip component

* Fix incorrect ref

* Disable Hermes (#3460)

* Revert "Remove packager (#3452)"

This reverts commit b2a79e184b3242124dfdb91ae095f6ce3f4eb986.

* Disable Hermes :'(

* Update preloaded modules

* Fix packages moduleNames and modulePaths, update snapshots and update mm-redux (ts version)

* remove document picker from modulePaths

* Fix package-lock.json

* Add eslint disable rules
2019-10-28 15:04:24 -07:00

152 lines
7.4 KiB
Diff

diff --git a/node_modules/react-native/Libraries/Lists/VirtualizedList.js b/node_modules/react-native/Libraries/Lists/VirtualizedList.js
index 7dffc17..548e7bb 100644
--- a/node_modules/react-native/Libraries/Lists/VirtualizedList.js
+++ b/node_modules/react-native/Libraries/Lists/VirtualizedList.js
@@ -8,6 +8,7 @@
* @format
*/
'use strict';
+const Platform = require('../Utilities/Platform');
const Batchinator = require('../Interaction/Batchinator');
const FillRateHelper = require('./FillRateHelper');
@@ -1965,7 +1966,7 @@ class VirtualizedCellWrapper extends React.Component<{
const styles = StyleSheet.create({
verticallyInverted: {
- transform: [{scaleY: -1}],
+ ...Platform.select({android: {transform: [{perspective: 1}, {scaleY: -1}]}, ios: {transform: [{scaleY: -1}]}}),
},
horizontallyInverted: {
transform: [{scaleX: -1}],
diff --git a/node_modules/react-native/Libraries/WebSocket/RCTSRWebSocket.h b/node_modules/react-native/Libraries/WebSocket/RCTSRWebSocket.h
index 1b17cff..9efa98e 100644
--- a/node_modules/react-native/Libraries/WebSocket/RCTSRWebSocket.h
+++ b/node_modules/react-native/Libraries/WebSocket/RCTSRWebSocket.h
@@ -54,13 +54,14 @@ extern NSString *const RCTSRHTTPResponseErrorKey;
@property (nonatomic, readonly) RCTSRReadyState readyState;
@property (nonatomic, readonly, strong) NSURL *url;
+@property (nonatomic, readonly, strong) NSString *certificate;
// This returns the negotiated protocol.
// It will be nil until after the handshake completes.
@property (nonatomic, readonly, copy) NSString *protocol;
// Protocols should be an array of strings that turn into Sec-WebSocket-Protocol.
-- (instancetype)initWithURLRequest:(NSURLRequest *)request protocols:(NSArray<NSString *> *)protocols NS_DESIGNATED_INITIALIZER;
+- (instancetype)initWithURLRequest:(NSURLRequest *)request protocols:(NSArray<NSString *> *)protocols certificate:(NSString *)certificate NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithURLRequest:(NSURLRequest *)request;
// Some helper constructors.
@@ -88,6 +89,8 @@ extern NSString *const RCTSRHTTPResponseErrorKey;
// Send Data (can be nil) in a ping message.
- (void)sendPing:(NSData *)data;
+// Get the certificate identity from the keyChain by name
+- (SecIdentityRef) GetIdentityByName:(NSString *)name;
@end
#pragma mark - RCTSRWebSocketDelegate
diff --git a/node_modules/react-native/Libraries/WebSocket/RCTSRWebSocket.m b/node_modules/react-native/Libraries/WebSocket/RCTSRWebSocket.m
index a134d2e..e815938 100644
--- a/node_modules/react-native/Libraries/WebSocket/RCTSRWebSocket.m
+++ b/node_modules/react-native/Libraries/WebSocket/RCTSRWebSocket.m
@@ -231,7 +231,7 @@ @implementation RCTSRWebSocket
RCTSRIOConsumerPool *_consumerPool;
}
-- (instancetype)initWithURLRequest:(NSURLRequest *)request protocols:(NSArray<NSString *> *)protocols
+- (instancetype)initWithURLRequest:(NSURLRequest *)request protocols:(NSArray<NSString *> *)protocols certificate:(NSString *)certificate
{
RCTAssertParam(request);
@@ -241,6 +241,10 @@ - (instancetype)initWithURLRequest:(NSURLRequest *)request protocols:(NSArray<NS
_requestedProtocols = [protocols copy];
+ if (![certificate isKindOfClass:[NSNull class]]) {
+ _certificate = certificate;
+ }
+
[self _RCTSR_commonInit];
}
return self;
@@ -250,7 +254,7 @@ - (instancetype)initWithURLRequest:(NSURLRequest *)request protocols:(NSArray<NS
- (instancetype)initWithURLRequest:(NSURLRequest *)request;
{
- return [self initWithURLRequest:request protocols:nil];
+ return [self initWithURLRequest:request protocols:nil certificate:self.certificate];
}
- (instancetype)initWithURL:(NSURL *)URL;
@@ -277,7 +281,7 @@ - (instancetype)initWithURL:(NSURL *)URL protocols:(NSArray<NSString *> *)protoc
NSArray<NSHTTPCookie *> *cookies = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookiesForURL:components.URL];
[request setAllHTTPHeaderFields:[NSHTTPCookie requestHeaderFieldsWithCookies:cookies]];
}
- return [self initWithURLRequest:request protocols:protocols];
+ return [self initWithURLRequest:request protocols:protocols certificate:self.certificate];
}
- (void)_RCTSR_commonInit;
@@ -518,6 +522,24 @@ - (void)_initializeStreams;
RCTLogInfo(@"SocketRocket: In debug mode. Allowing connection to any root cert");
#endif
+ if (_certificate) {
+ SecIdentityRef identity = [self GetIdentityByName:_certificate];
+ if (identity != nil) {
+ SecCertificateRef certificate = NULL;
+ OSStatus status = SecIdentityCopyCertificate(identity, &certificate);
+ if (!status) {
+ NSArray *myCerts = [[NSArray alloc] initWithObjects:(__bridge id)identity, (__bridge id)certificate, nil];
+
+ [SSLOptions setObject:[NSNumber numberWithBool:NO] forKey:(NSString *)kCFStreamSSLValidatesCertificateChain];
+ [SSLOptions setObject:[NSString stringWithFormat:@"%@:%d", host, port] forKey:(NSString *)kCFStreamSSLPeerName];
+ [SSLOptions setObject:(NSString *)kCFStreamSocketSecurityLevelNegotiatedSSL forKey:(NSString*)kCFStreamSSLLevel];
+ [SSLOptions setObject:(NSString *)kCFStreamSocketSecurityLevelNegotiatedSSL forKey:(NSString*)kCFStreamPropertySocketSecurityLevel];
+ [SSLOptions setObject:myCerts forKey:(NSString *)kCFStreamSSLCertificates];
+ [SSLOptions setObject:[NSNumber numberWithBool:NO] forKey:(NSString *)kCFStreamSSLIsServer];
+ }
+ }
+ }
+
[_outputStream setProperty:SSLOptions
forKey:(__bridge id)kCFStreamPropertySSLSettings];
}
diff --git a/node_modules/react-native/Libraries/WebSocket/RCTWebSocketModule.m b/node_modules/react-native/Libraries/WebSocket/RCTWebSocketModule.m
index d9387c4..93481be 100644
--- a/node_modules/react-native/Libraries/WebSocket/RCTWebSocketModule.m
+++ b/node_modules/react-native/Libraries/WebSocket/RCTWebSocketModule.m
@@ -81,7 +81,7 @@ - (void)invalidate
[request addValue:[RCTConvert NSString:value] forHTTPHeaderField:key];
}];
- RCTSRWebSocket *webSocket = [[RCTSRWebSocket alloc] initWithURLRequest:request protocols:protocols];
+ RCTSRWebSocket *webSocket = [[RCTSRWebSocket alloc] initWithURLRequest:request protocols:protocols certificate:options[@"certificate"]];
[webSocket setDelegateDispatchQueue:_methodQueue];
webSocket.delegate = self;
webSocket.reactTag = socketID;
diff --git a/node_modules/react-native/Libraries/WebSocket/WebSocket.js b/node_modules/react-native/Libraries/WebSocket/WebSocket.js
index 35f0757..a0205fc 100644
--- a/node_modules/react-native/Libraries/WebSocket/WebSocket.js
+++ b/node_modules/react-native/Libraries/WebSocket/WebSocket.js
@@ -92,7 +92,7 @@ class WebSocket extends (EventTarget(...WEBSOCKET_EVENTS): any) {
protocols = [protocols];
}
- const {headers = {}, ...unrecognized} = options || {};
+ const {headers = {}, certificate = {}, ...unrecognized} = options || {};
// Preserve deprecated backwards compatibility for the 'origin' option
/* $FlowFixMe(>=0.68.0 site=react_native_fb) This comment suppresses an
@@ -129,7 +129,7 @@ class WebSocket extends (EventTarget(...WEBSOCKET_EVENTS): any) {
this._eventEmitter = new NativeEventEmitter(NativeWebSocketModule);
this._socketId = nextWebSocketId++;
this._registerEvents();
- NativeWebSocketModule.connect(url, protocols, {headers}, this._socketId);
+ NativeWebSocketModule.connect(url, protocols, {headers, certificate}, this._socketId);
}
get binaryType(): ?BinaryType {