X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacybrowser%2Fcoroutines%2FGetHostIpAddressesCoroutine.kt;h=985bc506c0c2229a0fc4024f78a3481c1b454715;hp=cc10176f8b4321978c705d1596a91acecc896fc9;hb=3eb8e40ff3c2d65bd450db5c80c4cd0e0f050139;hpb=0adca386378c7071f03cdd42f321a46963abb3fe diff --git a/app/src/main/java/com/stoutner/privacybrowser/coroutines/GetHostIpAddressesCoroutine.kt b/app/src/main/java/com/stoutner/privacybrowser/coroutines/GetHostIpAddressesCoroutine.kt index cc10176f..985bc506 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/coroutines/GetHostIpAddressesCoroutine.kt +++ b/app/src/main/java/com/stoutner/privacybrowser/coroutines/GetHostIpAddressesCoroutine.kt @@ -60,15 +60,17 @@ object GetHostIpAddressesCoroutine { // Store the IP addresses. nestedScrollWebView.currentIpAddresses = ipAddresses.toString() + + // Checked for pinned mismatches if there is pinned information and it is not ignored. This must be done on the UI thread because checking the pinned mismatch interacts with the WebView. + withContext(Dispatchers.Main) { + if ((nestedScrollWebView.hasPinnedSslCertificate() || nestedScrollWebView.pinnedIpAddresses.isNotEmpty()) && !nestedScrollWebView.ignorePinnedDomainInformation) { + CheckPinnedMismatchHelper.checkPinnedMismatch(nestedScrollWebView, supportFragmentManager, pinnedMismatchString) + } + } } catch (exception: UnknownHostException) { // Do nothing. } } } - - // Checked for pinned mismatches if there is pinned information and it is not ignored. - if ((nestedScrollWebView.hasPinnedSslCertificate() || nestedScrollWebView.pinnedIpAddresses != "") && !nestedScrollWebView.ignorePinnedDomainInformation) { - CheckPinnedMismatchHelper.checkPinnedMismatch(nestedScrollWebView, supportFragmentManager, pinnedMismatchString) - } } }