]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blobdiff - app/src/main/java/com/stoutner/privacybrowser/coroutines/GetHostIpAddressesCoroutine.kt
Update Guide > User Agent. https://redmine.stoutner.com/issues/896
[PrivacyBrowserAndroid.git] / app / src / main / java / com / stoutner / privacybrowser / coroutines / GetHostIpAddressesCoroutine.kt
index cc10176f8b4321978c705d1596a91acecc896fc9..985bc506c0c2229a0fc4024f78a3481c1b454715 100644 (file)
@@ -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)
-        }
     }
 }