Skip to content
This repository has been archived by the owner on May 18, 2024. It is now read-only.

Commit

Permalink
Have the same implementation as latest RN to handle webview crash
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaPahilwaniGroww committed Nov 4, 2022
1 parent 3f3869a commit 76cb15c
Show file tree
Hide file tree
Showing 16 changed files with 36 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,20 +138,18 @@ protected void doInBackgroundGuarded(Void... params) {
// https://bugs.chromium.org/p/chromium/issues/detail?id=559720
return null;
} catch (Exception exception) {
String message = exception.getMessage();
// We cannot catch MissingWebViewPackageException as it is in a private / system API
// class. This validates the exception's message to ensure we are only handling this
// specific exception.
// https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/webkit/WebViewFactory.java#348
if (message != null
&& exception
.getClass()
.getCanonicalName()
.contains("MissingWebViewPackageException")) {
return null;
} else {
throw exception;
}
// Ideally we would like to catch a `MissingWebViewPackageException` here.
// That API is private so we can't access it.
// Historically we used string matching on the error message to understand
// if the exception was a Missing Webview One.
// OEMs have been customizing that message making really hard to catch it.
// Therefore we result to returning null as a default instead of rethrowing
// the exception as it will result in a app crash at runtime.
// a) We will return null for all the other unhandled conditions when a webview provider is
// not found.
// b) We already have null checks in place for `getCookieManager()` calls.
// c) We have annotated the method as @Nullable to notify future devs about our return type.
return null;
}
}

Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
793eb8bdac11afa8955658ac375239b6
0d911fee80aca3458be84ac6a56bec32
Original file line number Diff line number Diff line change
@@ -1 +1 @@
c1d38381b865c6b9499d73dfe77db42f2fd8989d
a22eef7bea890d37e004e72c5ed428e944738544
Original file line number Diff line number Diff line change
@@ -1 +1 @@
24f1e40ad03551d9c54a31e76af436cc5f795d2ca9428ea0b1eb3bf12e8f1509
3ec9f6b936edf6e8fc9e86dc40e75bbe92ef709d3286005426e358eb06d37997
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2d6bbd8fc8f13d95d24252443c6d7b94be271b034dd2ef1ee7f4353fa6aa0a08674c203d43ac437d3634f6991630d249ee66c3b111d02b2681d5af88ef4c5c80
e8a214e17ce5959d1aa9e4e7c6336c36fabb1f3c7a1047f3df96efd145fb5639825d8faee676d5308e62814ff4991ab39c043c0c73bfc1514e67ca07c715a37a
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"createdBy": {
"gradle": {
"version": "6.9",
"buildId": "pfgdewas7jcztg5lu3xewozuv4"
"buildId": "ovxnrhjebvhx7owsnuhzmzjalq"
}
},
"variants": [
Expand Down Expand Up @@ -134,11 +134,11 @@
{
"name": "react-native-0.66.4.aar",
"url": "react-native-0.66.4.aar",
"size": 17689494,
"sha512": "2d6bbd8fc8f13d95d24252443c6d7b94be271b034dd2ef1ee7f4353fa6aa0a08674c203d43ac437d3634f6991630d249ee66c3b111d02b2681d5af88ef4c5c80",
"sha256": "24f1e40ad03551d9c54a31e76af436cc5f795d2ca9428ea0b1eb3bf12e8f1509",
"sha1": "c1d38381b865c6b9499d73dfe77db42f2fd8989d",
"md5": "793eb8bdac11afa8955658ac375239b6"
"size": 17689318,
"sha512": "e8a214e17ce5959d1aa9e4e7c6336c36fabb1f3c7a1047f3df96efd145fb5639825d8faee676d5308e62814ff4991ab39c043c0c73bfc1514e67ca07c715a37a",
"sha256": "3ec9f6b936edf6e8fc9e86dc40e75bbe92ef709d3286005426e358eb06d37997",
"sha1": "a22eef7bea890d37e004e72c5ed428e944738544",
"md5": "0d911fee80aca3458be84ac6a56bec32"
}
]
},
Expand Down Expand Up @@ -261,11 +261,11 @@
{
"name": "react-native-0.66.4.aar",
"url": "react-native-0.66.4.aar",
"size": 17689494,
"sha512": "2d6bbd8fc8f13d95d24252443c6d7b94be271b034dd2ef1ee7f4353fa6aa0a08674c203d43ac437d3634f6991630d249ee66c3b111d02b2681d5af88ef4c5c80",
"sha256": "24f1e40ad03551d9c54a31e76af436cc5f795d2ca9428ea0b1eb3bf12e8f1509",
"sha1": "c1d38381b865c6b9499d73dfe77db42f2fd8989d",
"md5": "793eb8bdac11afa8955658ac375239b6"
"size": 17689318,
"sha512": "e8a214e17ce5959d1aa9e4e7c6336c36fabb1f3c7a1047f3df96efd145fb5639825d8faee676d5308e62814ff4991ab39c043c0c73bfc1514e67ca07c715a37a",
"sha256": "3ec9f6b936edf6e8fc9e86dc40e75bbe92ef709d3286005426e358eb06d37997",
"sha1": "a22eef7bea890d37e004e72c5ed428e944738544",
"md5": "0d911fee80aca3458be84ac6a56bec32"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2371d6456371df60679a2eb399e8aa9d
ad1e49c0d0162bc0bb1d1af8dce63e6a
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9af4eca0dc257f5c0502925820606e3a34183e5f
268ca8e5dea7007d88ca0e07ce698c2a3bf66734
Original file line number Diff line number Diff line change
@@ -1 +1 @@
f3124bc69a6db8d22c5bcbd1c99e7f3246285d1a0c8275a4630584a67a9caf98
0a50e65f5e1ef7289f8d78c1af8b74af07585a95122b6d8930a0d2e8006618eb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
681b5636ddce741eb2f1b9f0ed10dee0f30e28ade2a9ed224ffd0f411be174207baa8171fa987dd7aa23eeb64d1fb7b8e3f2d7b5b29fe7072517e2fa88e7c506
11ada08776b353bc4564b4bd41db4a1a529d91b56f953d4b24b58f840e7200f10b7b8686c6c0efb9c3e8e92fb907eaef594d045f5e852fc3bdee682c15975c52
2 changes: 1 addition & 1 deletion android/com/facebook/react/react-native/maven-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
<versions>
<version>0.66.4</version>
</versions>
<lastUpdated>20221104115340</lastUpdated>
<lastUpdated>20221104131724</lastUpdated>
</versioning>
</metadata>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
13cceb315c3acfd192fc9c70befd17fb
8a6020b71138beec859d0bba252bae64
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6b3766ec47b0f74a9df3cd5df074d2181dee002c
48a5ed0aaec7c65b9603fb6c8ce034193d194e89
Original file line number Diff line number Diff line change
@@ -1 +1 @@
88b7488ba8c53cc8c69b574b1792a6b69a065e435b51a297e9d133a571d39e14
48a07b98168da2859b9c422c51253940320a955b791876844a9c349093fb5bfc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5af0db320e03a37908322898fa71bfa3ae74efdf5de5492d800cca997a771c8380e246b811a6e7b819dddf3f521d1c78f4a5044de51be79d842454965e37769b
abb3c7d750dffaf44949d5eba70c2e78cd03e08437ed43f0297b88ef7ac1c4b13d9a7e2131db4ed48431847d5bdd53c1d34ede9226d351f82820016531906bab

0 comments on commit 76cb15c

Please sign in to comment.