+ }
+
+ fun checkPinnedMismatch(domainName: String, nestedScrollWebView: NestedScrollWebView, supportFragmentManager: FragmentManager, pinnedMismatchString: String) {
+ // Get the IP addresses using a coroutine.
+ CoroutineScope(Dispatchers.Main).launch {
+ // Get the IP addresses on the IO thread.
+ withContext(Dispatchers.IO) {
+ // Get an array with the IP addresses for the host.
+ try {
+ // Initialize an IP address string builder.
+ val ipAddressesStringBuilder = StringBuilder()
+
+ // Get an array with all the IP addresses for the domain.
+ val inetAddressesArray = InetAddress.getAllByName(domainName)
+
+ // Add each IP address to the string builder.
+ for (inetAddress in inetAddressesArray) {
+ // Add a line break to the string builder if this is not the first IP address.
+ if (ipAddressesStringBuilder.isNotEmpty()) {
+ ipAddressesStringBuilder.append("\n")
+ }
+
+ // Add the IP address to the string builder.
+ ipAddressesStringBuilder.append(inetAddress.hostAddress)
+ }