Fix and improve port hopping interval handling

https://github.com/2dust/v2rayNG/issues/5171
This commit is contained in:
2dust
2026-01-16 15:21:19 +08:00
parent 379266f205
commit 02ac57a4c6
2 changed files with 6 additions and 2 deletions
@@ -1227,7 +1227,11 @@ object V2rayConfigManager {
if (profileItem.portHopping.isNotNullEmpty()) {
hysteriaSetting.udphop = StreamSettingsBean.HysteriaSettingsBean.HysteriaUdpHopBean(
port = profileItem.portHopping,
interval = profileItem.portHoppingInterval?.ifEmpty { "30" }.orEmpty().toInt()
interval = profileItem.portHoppingInterval
?.trim()
?.toIntOrNull()
?.takeIf { it >= 5 }
?: 30
)
}
streamSettings.hysteriaSettings = hysteriaSetting