From 5e8863277589508e7a538811026292851582fa51 Mon Sep 17 00:00:00 2001 From: kp-said-rehouni <109279805+kp-said-rehouni@users.noreply.github.com> Date: Thu, 9 Nov 2023 16:38:16 +0100 Subject: [PATCH] Fix compiler errors on xcode15 (#6) --- .../regions/internals/MessageVerificator.kt | 2 +- .../privateinternetaccess/regions/internals/PingPerformer.kt | 2 +- .../regions/internals/RegionHttpClient.kt | 5 ++--- .../regions/internals/MessageVerificator.kt | 2 +- .../privateinternetaccess/regions/internals/PingPerformer.kt | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/regions/src/iosMain/kotlin/com/privateinternetaccess/regions/internals/MessageVerificator.kt b/regions/src/iosMain/kotlin/com/privateinternetaccess/regions/internals/MessageVerificator.kt index e926362..0d008d8 100644 --- a/regions/src/iosMain/kotlin/com/privateinternetaccess/regions/internals/MessageVerificator.kt +++ b/regions/src/iosMain/kotlin/com/privateinternetaccess/regions/internals/MessageVerificator.kt @@ -28,7 +28,7 @@ import platform.Security.* import platform.posix.memcpy @OptIn(kotlinx.cinterop.ExperimentalForeignApi::class) -actual object MessageVerificator { +internal actual object MessageVerificator { actual fun verifyMessage(message: String, key: String): Boolean { val publicKeyData = NSData.create( diff --git a/regions/src/iosMain/kotlin/com/privateinternetaccess/regions/internals/PingPerformer.kt b/regions/src/iosMain/kotlin/com/privateinternetaccess/regions/internals/PingPerformer.kt index c0f8678..817ce45 100644 --- a/regions/src/iosMain/kotlin/com/privateinternetaccess/regions/internals/PingPerformer.kt +++ b/regions/src/iosMain/kotlin/com/privateinternetaccess/regions/internals/PingPerformer.kt @@ -19,7 +19,7 @@ package com.privateinternetaccess.regions.internals */ -actual class PingPerformer { +internal actual class PingPerformer { companion object { private const val REGIONS_PING_PORT = 443 diff --git a/regions/src/iosMain/kotlin/com/privateinternetaccess/regions/internals/RegionHttpClient.kt b/regions/src/iosMain/kotlin/com/privateinternetaccess/regions/internals/RegionHttpClient.kt index c19495b..525b9ed 100644 --- a/regions/src/iosMain/kotlin/com/privateinternetaccess/regions/internals/RegionHttpClient.kt +++ b/regions/src/iosMain/kotlin/com/privateinternetaccess/regions/internals/RegionHttpClient.kt @@ -21,9 +21,8 @@ package com.privateinternetaccess.regions.internals import com.privateinternetaccess.regions.internals.Regions.Companion.REQUEST_TIMEOUT_MS import io.ktor.client.HttpClient import io.ktor.client.engine.darwin.* -import io.ktor.client.engine.ios.Ios -import io.ktor.client.plugins.* import io.ktor.client.engine.ios.* +import io.ktor.client.plugins.* import kotlinx.cinterop.* import platform.CoreFoundation.* import platform.Foundation.* @@ -36,7 +35,7 @@ internal actual object RegionHttpClient { certificate: String?, pinnedEndpoint: Pair? ): Pair { - return Pair(HttpClient(Ios) { + return Pair(HttpClient(Darwin) { expectSuccess = false install(HttpTimeout) { requestTimeoutMillis = REQUEST_TIMEOUT_MS diff --git a/regions/src/tvosMain/kotlin/com/privateinternetaccess/regions/internals/MessageVerificator.kt b/regions/src/tvosMain/kotlin/com/privateinternetaccess/regions/internals/MessageVerificator.kt index e926362..0d008d8 100644 --- a/regions/src/tvosMain/kotlin/com/privateinternetaccess/regions/internals/MessageVerificator.kt +++ b/regions/src/tvosMain/kotlin/com/privateinternetaccess/regions/internals/MessageVerificator.kt @@ -28,7 +28,7 @@ import platform.Security.* import platform.posix.memcpy @OptIn(kotlinx.cinterop.ExperimentalForeignApi::class) -actual object MessageVerificator { +internal actual object MessageVerificator { actual fun verifyMessage(message: String, key: String): Boolean { val publicKeyData = NSData.create( diff --git a/regions/src/tvosMain/kotlin/com/privateinternetaccess/regions/internals/PingPerformer.kt b/regions/src/tvosMain/kotlin/com/privateinternetaccess/regions/internals/PingPerformer.kt index c0f8678..817ce45 100644 --- a/regions/src/tvosMain/kotlin/com/privateinternetaccess/regions/internals/PingPerformer.kt +++ b/regions/src/tvosMain/kotlin/com/privateinternetaccess/regions/internals/PingPerformer.kt @@ -19,7 +19,7 @@ package com.privateinternetaccess.regions.internals */ -actual class PingPerformer { +internal actual class PingPerformer { companion object { private const val REGIONS_PING_PORT = 443