Skip to content

Commit

Permalink
Removed shadow socks predefined ports
Browse files Browse the repository at this point in the history
  • Loading branch information
Pururun committed Aug 30, 2024
1 parent cbe21e7 commit c5ea6bd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import net.mullvad.mullvadvpn.compose.test.SHADOWSOCKS_PORT_ITEM_AUTOMATIC_TEST_
import net.mullvad.mullvadvpn.compose.test.SHADOWSOCKS_PORT_ITEM_X_TEST_TAG
import net.mullvad.mullvadvpn.compose.transitions.SlideInFromRightTransition
import net.mullvad.mullvadvpn.compose.util.OnNavResultValue
import net.mullvad.mullvadvpn.constant.SHADOWSOCKS_AVAILABLE_PORTS
import net.mullvad.mullvadvpn.constant.SHADOWSOCKS_PRESET_PORTS
import net.mullvad.mullvadvpn.lib.model.Constraint
import net.mullvad.mullvadvpn.lib.model.Port
Expand Down Expand Up @@ -75,7 +76,7 @@ fun ShadowsocksSettings(
context.getString(R.string.shadowsocks),
),
customPort = state.customPort,
allowedPortRanges = state.validPortRanges,
allowedPortRanges = SHADOWSOCKS_AVAILABLE_PORTS,
)
)
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package net.mullvad.mullvadvpn.constant

import net.mullvad.mullvadvpn.lib.model.Port
import net.mullvad.mullvadvpn.lib.model.PortRange

val WIREGUARD_PRESET_PORTS = listOf(Port(51820), Port(53))
val UDP2TCP_PRESET_PORTS = listOf(Port(80), Port(5001))
val SHADOWSOCKS_PRESET_PORTS = listOf(Port(80), Port(443))
val SHADOWSOCKS_PRESET_PORTS = emptyList<Port>()
val SHADOWSOCKS_AVAILABLE_PORTS =
listOf(PortRange(IntRange(0, 65535))) // Currently we consider all ports to be available
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package net.mullvad.mullvadvpn.util
import net.mullvad.mullvadvpn.lib.model.Port
import net.mullvad.mullvadvpn.lib.model.PortRange

// fun Port.in()

fun Port.inAnyOf(portRanges: List<PortRange>): Boolean =
portRanges.any { portRange -> this in portRange }

Expand Down

0 comments on commit c5ea6bd

Please sign in to comment.