Skip to content

StreamVault is a TV-first free IPTV player for Android TV built with Kotlin, Jetpack Compose, Room, Hilt, and Media3.

Merge PR 127: provider URL protocol detection

David Nashash2564d407d072
diff --cc data/src/main/java/com/streamvault/data/repository/ProviderRepositoryImpl.kt
index c07b0f5b,c9268045..dbaba7cd
--- a/data/src/main/java/com/streamvault/data/repository/ProviderRepositoryImpl.kt
+++ b/data/src/main/java/com/streamvault/data/repository/ProviderRepositoryImpl.kt
@@@ -494,12 -376,11 +496,12 @@@ class ProviderRepositoryImpl @Inject co
val normalizedDeviceId = ProviderInputSanitizer.normalizeStalkerDeviceId(deviceId)
val normalizedDeviceId2 = ProviderInputSanitizer.normalizeStalkerDeviceId(deviceId2)
val normalizedSignature = ProviderInputSanitizer.normalizeStalkerSignature(signature)
+ val normalizedAdvancedOptionsJson = stalkerAdvancedOptionsJson.trim()
- ProviderInputSanitizer.validateUrl(normalizedPortalUrl)?.let { message ->
+ ProviderInputSanitizer.validateUrl(resolvedPortalUrl)?.let { message ->
return Result.error(message)
}
- UrlSecurityPolicy.validateStalkerPortalUrl(normalizedPortalUrl)?.let { message ->
+ UrlSecurityPolicy.validateStalkerPortalUrl(resolvedPortalUrl)?.let { message ->
return Result.error(message)
}
if (normalizedMacAddress.isNotBlank()) {
@@@ -554,11 -432,9 +556,11 @@@
val updated = authResult.data.copy(
id = existingProvider.id,
name = normalizedName.ifBlank { existingProvider.name },
- serverUrl = normalizedPortalUrl,
+ serverUrl = resolvedPortalUrl,
username = normalizedUsername,
password = effectivePassword,
+ httpUserAgent = httpUserAgent,
+ httpHeaders = httpHeaders,
stalkerMacAddress = normalizedMacAddress,
stalkerDeviceProfile = normalizedDeviceProfile,
stalkerDeviceTimezone = normalizedTimezone,
@@@ -582,11 -457,9 +584,11 @@@
} else {
val newData = authResult.data.copy(
name = normalizedName.ifBlank { authResult.data.name },
- serverUrl = normalizedPortalUrl,
+ serverUrl = resolvedPortalUrl,
username = normalizedUsername,
password = effectivePassword,
+ httpUserAgent = httpUserAgent,
+ httpHeaders = httpHeaders,
stalkerMacAddress = normalizedMacAddress,
stalkerDeviceProfile = normalizedDeviceProfile,
stalkerDeviceTimezone = normalizedTimezone,