From cc43c9f460e615dbae18fd01f438376d1474b54e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Loureiro?= <1649425+jpcloureiro@users.noreply.github.com> Date: Wed, 20 Mar 2024 06:11:01 +0000 Subject: [PATCH] patch: (webview upgrade) Android filename validation when downloading from browser (#8654) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## **Description** This change is part of the file react-native-webview+11.13.0.patch, a collection of patches that we need to apply on top of react-native-webview. Original Pull Request: [#6844](https://github.com/MetaMask/metamask-mobile/pull/6844) Webview changes can be reviewed here: [MetaMask/react-native-webview-mm#7](https://github.com/MetaMask/react-native-webview-mm/pull/7) ``` Scenario: Download file with invalid file name Navigate to websites using browser address bar. Given the app displayed the splash animation And I have imported my wallet And I tap No Thanks on the Enable security check screen And I tap No thanks on the onboarding welcome tutorial And I navigate to the browser And I have 1 browser tab displayed When I download a file with invalid filename Then an error message should appear And the file is not download ``` ## **Screenshots/Recordings** ### **Before** https://github.com/MetaMask/metamask-mobile/assets/1649425/aa7d07a8-ab95-4f36-9325-bdcd6760dcd0 ### **After** https://github.com/MetaMask/metamask-mobile/assets/1649425/3e3fd1cf-5593-4afb-8045-4666cad494cd ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've clearly explained what problem this PR is solving and how it is solved. - [ ] I've linked related issues - [ ] I've included manual testing steps - [ ] I've included screenshots/recordings if applicable - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. - [ ] I’ve properly set the pull request status: - [ ] In case it's not yet "ready for review", I've set it to "draft". - [ ] In case it's "ready for review", I've changed it from "draft" to "non-draft". ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --- package.json | 2 +- yarn.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 7af419a31d0a..99e501987e62 100644 --- a/package.json +++ b/package.json @@ -315,7 +315,7 @@ "react-native-vector-icons": "6.4.2", "react-native-video": "5.2.1", "react-native-view-shot": "^3.1.2", - "react-native-webview": "https://github.com/MetaMask/react-native-webview-mm#9386bb762e8c740b676d31e2ef5c20e34421c36a", + "react-native-webview": "https://github.com/MetaMask/react-native-webview-mm#c9242686e32c876e8028c447c2fe94ad0529968a", "react-native-webview-invoke": "^0.6.2", "react-redux": "7.2.4", "readable-stream": "2.3.7", diff --git a/yarn.lock b/yarn.lock index 66c503e7468f..28a5eee4d820 100644 --- a/yarn.lock +++ b/yarn.lock @@ -24168,9 +24168,9 @@ react-native-webview-invoke@^0.6.2: resolved "https://registry.yarnpkg.com/react-native-webview-invoke/-/react-native-webview-invoke-0.6.2.tgz#75cc27ef98ea1cbc9386269347d3aafe90d33aa3" integrity sha512-PCzP7Zl3XwHU10JYS8nR0gwuR8XiOO0MhC8y9ZuPPI+HeISn95GvNYhOXxeLgfbdbUcpNWh1HqxPDySlfCIqxg== -"react-native-webview@https://github.com/MetaMask/react-native-webview-mm#9386bb762e8c740b676d31e2ef5c20e34421c36a": +"react-native-webview@https://github.com/MetaMask/react-native-webview-mm#c9242686e32c876e8028c447c2fe94ad0529968a": version "13.6.3" - resolved "https://github.com/MetaMask/react-native-webview-mm#9386bb762e8c740b676d31e2ef5c20e34421c36a" + resolved "https://github.com/MetaMask/react-native-webview-mm#c9242686e32c876e8028c447c2fe94ad0529968a" dependencies: escape-string-regexp "2.0.0" invariant "2.2.4"