From e60c32b2c16a01aa730f0644c9e46d159b98cfc2 Mon Sep 17 00:00:00 2001 From: William Newman Date: Thu, 18 Feb 2021 09:44:37 -0700 Subject: [PATCH 1/4] [FIX] Android - fallback to default auth challenge handling when no cert is provided * If a certificate auth challenge is requested on Android the webview will hang if no certificate is loaded. To prevent this, fallback to default Android behavior and cancel the challenge with request.cancel() --- patches/react-native-webview+10.3.2.patch | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/patches/react-native-webview+10.3.2.patch b/patches/react-native-webview+10.3.2.patch index 68412ee27d..3fc4ab5aa1 100644 --- a/patches/react-native-webview+10.3.2.patch +++ b/patches/react-native-webview+10.3.2.patch @@ -1,5 +1,5 @@ diff --git a/node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java b/node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java -index ab869cf..2aa7a9e 100644 +index ab869cf..b1da7cc 100644 --- a/node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java +++ b/node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java @@ -84,6 +84,12 @@ import java.util.Map; @@ -44,7 +44,7 @@ index ab869cf..2aa7a9e 100644 } @Override -@@ -742,12 +754,54 @@ public class RNCWebViewManager extends SimpleViewManager { +@@ -742,12 +754,56 @@ public class RNCWebViewManager extends SimpleViewManager { protected static class RNCWebViewClient extends WebViewClient { @@ -93,6 +93,8 @@ index ab869cf..2aa7a9e 100644 + } + }; + task.execute(); ++ } else { ++ request.cancel(); + } + } + From 40c1496557965a03a20f1d155afc866186b35c01 Mon Sep 17 00:00:00 2001 From: William Newman Date: Thu, 18 Feb 2021 12:47:13 -0700 Subject: [PATCH 2/4] No client certificate case defaults to super implementation --- patches/react-native-webview+10.3.2.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/react-native-webview+10.3.2.patch b/patches/react-native-webview+10.3.2.patch index 3fc4ab5aa1..08b0e97212 100644 --- a/patches/react-native-webview+10.3.2.patch +++ b/patches/react-native-webview+10.3.2.patch @@ -1,5 +1,5 @@ diff --git a/node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java b/node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java -index ab869cf..b1da7cc 100644 +index ab869cf..08ce7ce 100644 --- a/node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java +++ b/node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java @@ -84,6 +84,12 @@ import java.util.Map; @@ -94,7 +94,7 @@ index ab869cf..b1da7cc 100644 + }; + task.execute(); + } else { -+ request.cancel(); ++ super.onReceivedClientCertRequest(view, request); + } + } + From 46f3780c7b526d34d97fd947668aee554f0f3db4 Mon Sep 17 00:00:00 2001 From: Gerzon Z Date: Fri, 19 Feb 2021 14:26:04 -0400 Subject: [PATCH 3/4] Update react-native-webview --- package.json | 2 +- yarn.lock | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 71bfdbc1e9..577ae9d104 100644 --- a/package.json +++ b/package.json @@ -111,7 +111,7 @@ "react-native-ui-lib": "RocketChat/react-native-ui-lib#minor-improvements", "react-native-unimodules": "0.10.1", "react-native-vector-icons": "7.0.0", - "react-native-webview": "10.3.2", + "react-native-webview": "^10.3.2", "react-redux": "7.2.0", "reactotron-react-native": "5.0.0", "redux": "4.0.5", diff --git a/yarn.lock b/yarn.lock index 4a577acf4c..4c556be433 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13162,10 +13162,10 @@ react-native-vector-icons@7.0.0: prop-types "^15.7.2" yargs "^15.0.2" -react-native-webview@10.3.2: - version "10.3.2" - resolved "https://registry.yarnpkg.com/react-native-webview/-/react-native-webview-10.3.2.tgz#c634946152099c95d521a3abc71065d1d642e192" - integrity sha512-4A8FKL/puonkqQ1FOKd+iPulqRXCG4inmIK4pQ60zv9Ua+YkBKLxxofQiCvRwIXSSgAXYT+AE3rOHr3bx4A/cw== +react-native-webview@^10.3.2: + version "10.10.2" + resolved "https://registry.yarnpkg.com/react-native-webview/-/react-native-webview-10.10.2.tgz#13208aef17c9ccfd28355363688f4cbe2143f10a" + integrity sha512-98Dh7q1gEflicFZ8KNL3nK5XRjx50OZXqw87jHofVjKfjbK0LKmvI5X8ymgUMGg61JVgI3AF+g8qpDvqjgQsfg== dependencies: escape-string-regexp "2.0.0" invariant "2.2.4" @@ -13832,8 +13832,6 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: rn-extensions-share@RocketChat/rn-extensions-share: version "2.4.1" resolved "https://codeload.github.com/RocketChat/rn-extensions-share/tar.gz/4d7c0e4c2f300e4fb116af7b7cc0dbbc8169150c" - dependencies: - react-native "^0.63.1" rn-fetch-blob@0.12.0: version "0.12.0" From a2ccc181308f13c41e34ab913fd79bc9f991d42d Mon Sep 17 00:00:00 2001 From: Gerzon Z Date: Fri, 19 Feb 2021 16:50:12 -0400 Subject: [PATCH 4/4] Downgrade to previous dependency version --- package.json | 2 +- yarn.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 577ae9d104..71bfdbc1e9 100644 --- a/package.json +++ b/package.json @@ -111,7 +111,7 @@ "react-native-ui-lib": "RocketChat/react-native-ui-lib#minor-improvements", "react-native-unimodules": "0.10.1", "react-native-vector-icons": "7.0.0", - "react-native-webview": "^10.3.2", + "react-native-webview": "10.3.2", "react-redux": "7.2.0", "reactotron-react-native": "5.0.0", "redux": "4.0.5", diff --git a/yarn.lock b/yarn.lock index 4c556be433..c16c631859 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13162,10 +13162,10 @@ react-native-vector-icons@7.0.0: prop-types "^15.7.2" yargs "^15.0.2" -react-native-webview@^10.3.2: - version "10.10.2" - resolved "https://registry.yarnpkg.com/react-native-webview/-/react-native-webview-10.10.2.tgz#13208aef17c9ccfd28355363688f4cbe2143f10a" - integrity sha512-98Dh7q1gEflicFZ8KNL3nK5XRjx50OZXqw87jHofVjKfjbK0LKmvI5X8ymgUMGg61JVgI3AF+g8qpDvqjgQsfg== +react-native-webview@10.3.2: + version "10.3.2" + resolved "https://registry.yarnpkg.com/react-native-webview/-/react-native-webview-10.3.2.tgz#c634946152099c95d521a3abc71065d1d642e192" + integrity sha512-4A8FKL/puonkqQ1FOKd+iPulqRXCG4inmIK4pQ60zv9Ua+YkBKLxxofQiCvRwIXSSgAXYT+AE3rOHr3bx4A/cw== dependencies: escape-string-regexp "2.0.0" invariant "2.2.4" @@ -13189,7 +13189,7 @@ react-native-windows@^0.62.0-0: uuid "^3.3.2" xml-parser "^1.2.1" -react-native@RocketChat/react-native#0.63.4, react-native@^0.63.1: +react-native@RocketChat/react-native#0.63.4: version "0.63.4" resolved "https://codeload.github.com/RocketChat/react-native/tar.gz/616299bbc01eeb56cb7d5b52e543051e1ad2d136" dependencies: