mirror of
https://github.com/AChep/keyguard-app.git
synced 2025-02-01 14:56:49 +01:00
fix: Do not use Domain match detection for Android and iOS apps URIs
This commit is contained in:
parent
ed90a65b14
commit
6768a31800
@ -23,6 +23,7 @@ class CipherUrlCheckImpl(
|
|||||||
) : CipherUrlCheck {
|
) : CipherUrlCheck {
|
||||||
companion object {
|
companion object {
|
||||||
private const val PROTOCOL_ANDROID_APP = "androidapp://"
|
private const val PROTOCOL_ANDROID_APP = "androidapp://"
|
||||||
|
private const val PROTOCOL_IOS_APP = "iosapp://"
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(directDI: DirectDI) : this(
|
constructor(directDI: DirectDI) : this(
|
||||||
@ -37,9 +38,14 @@ class CipherUrlCheckImpl(
|
|||||||
): IO<Boolean> {
|
): IO<Boolean> {
|
||||||
return when (uri.match ?: defaultMatchDetection) {
|
return when (uri.match ?: defaultMatchDetection) {
|
||||||
DSecret.Uri.MatchType.Domain -> {
|
DSecret.Uri.MatchType.Domain -> {
|
||||||
when {
|
val shouldUseHostMatchInstead = uri.uri.startsWith(PROTOCOL_ANDROID_APP) ||
|
||||||
uri.uri.startsWith(PROTOCOL_ANDROID_APP) -> ::checkUrlMatchByHost
|
url.startsWith(PROTOCOL_ANDROID_APP) ||
|
||||||
else -> ::checkUrlMatchByDomain
|
uri.uri.startsWith(PROTOCOL_IOS_APP) ||
|
||||||
|
url.startsWith(PROTOCOL_IOS_APP)
|
||||||
|
if (shouldUseHostMatchInstead) {
|
||||||
|
::checkUrlMatchByHost
|
||||||
|
} else {
|
||||||
|
::checkUrlMatchByDomain
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user