File tree Expand file tree Collapse file tree 1 file changed +29
-7
lines changed
V2rayNG/app/src/main/java/com/v2ray/ang/handler Expand file tree Collapse file tree 1 file changed +29
-7
lines changed Original file line number Diff line number Diff line change @@ -1297,15 +1297,37 @@ object V2rayConfigManager {
12971297 )
12981298 quicParams.congestion = if (quicParams.brutalUp != null || quicParams.brutalDown != null ) " brutal" else null
12991299 if (profileItem.portHopping.isNotNullEmpty()) {
1300- val rawInterval = profileItem.portHoppingInterval
1301- val parsedInterval = rawInterval?.trim()?.toIntOrNull()
1302- quicParams.udpHop = StreamSettingsBean .FinalMaskBean .QuicParamsBean .UdpHopBean (
1303- ports = profileItem.portHopping,
1304- interval = if (parsedInterval != null && parsedInterval < 5 ) {
1305- " 30"
1300+ val rawInterval = profileItem.portHoppingInterval?.trim().nullIfBlank()
1301+ val interval = if (rawInterval == null ) {
1302+ " 30"
1303+ } else {
1304+ val singleValue = rawInterval.toIntOrNull()
1305+ if (singleValue != null ) {
1306+ if (singleValue < 5 ) {
1307+ " 30"
1308+ } else {
1309+ rawInterval
1310+ }
13061311 } else {
1307- rawInterval
1312+ val parts = rawInterval.split(' -' )
1313+ if (parts.size == 2 ) {
1314+ val start = parts[0 ].trim().toIntOrNull()
1315+ val end = parts[1 ].trim().toIntOrNull()
1316+ if (start != null && end != null ) {
1317+ val minStart = maxOf(5 , start)
1318+ val minEnd = maxOf(minStart, end)
1319+ " $minStart -$minEnd "
1320+ } else {
1321+ " 30"
1322+ }
1323+ } else {
1324+ " 30"
1325+ }
13081326 }
1327+ }
1328+ quicParams.udpHop = StreamSettingsBean .FinalMaskBean .QuicParamsBean .UdpHopBean (
1329+ ports = profileItem.portHopping,
1330+ interval = interval
13091331 )
13101332 }
13111333 val finalmask = StreamSettingsBean .FinalMaskBean (
You can’t perform that action at this time.
0 commit comments