Skip to content

Commit

Permalink
chore: TUIC udp_relay_mode
Browse files Browse the repository at this point in the history
  • Loading branch information
arm64v8a committed Aug 28, 2023
1 parent 556cf11 commit fe8248b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 16 deletions.
6 changes: 4 additions & 2 deletions app/src/main/java/io/nekohasekai/sagernet/fmt/tuic/TuicFmt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ fun parseTuic(url: String): TuicBean {
if (it == "1") allowInsecure = true
}
link.queryParameter("disable_sni")?.let {
if (it == "1") disableSNI =true
if (it == "1") disableSNI = true
}
}
}
Expand Down Expand Up @@ -70,7 +70,9 @@ fun buildSingBoxOutboundTuicBean(bean: TuicBean): SingBoxOptions.Outbound_TUICOp
uuid = bean.uuid
password = bean.token
congestion_control = bean.congestionController
udp_relay_mode = bean.udpRelayMode
when (bean.udpRelayMode) {
"quic" -> udp_relay_mode = "quic"
}
zero_rtt_handshake = bean.reduceRTT
tls = SingBoxOptions.OutboundTLSOptions().apply {
if (bean.sni.isNotBlank()) {
Expand Down
12 changes: 0 additions & 12 deletions app/src/main/res/values/arrays.xml
Original file line number Diff line number Diff line change
Expand Up @@ -477,23 +477,11 @@
<item>randomized</item>
</string-array>

<string-array name="tuic_udp_relay_mode_entry">
<item>NATIVE</item>
<item>QUIC</item>
</string-array>

<string-array name="tuic_udp_relay_mode_value">
<item>native</item>
<item>quic</item>
</string-array>

<string-array name="tuic_congestion_controller_entry">
<item>CUBIC</item>
<item>NEW RENO</item>
<item>BBR</item>
</string-array>


<string-array name="tuic_congestion_controller_value">
<item>cubic</item>
<item>new_reno</item>
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/xml/tuic_preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@
app:useSimpleSummaryProvider="true" />
<moe.matsuri.nb4a.ui.SimpleMenuPreference
app:defaultValue="https"
app:entries="@array/tuic_udp_relay_mode_entry"
app:entries="@array/tuic_udp_relay_mode_value"
app:entryValues="@array/tuic_udp_relay_mode_value"
app:icon="@drawable/ic_baseline_add_road_24"
app:key="serverUDPRelayMode"
app:title="@string/tuic_udp_relay_mode"
app:useSimpleSummaryProvider="true" />
<moe.matsuri.nb4a.ui.SimpleMenuPreference
app:defaultValue="https"
app:entries="@array/tuic_congestion_controller_entry"
app:entries="@array/tuic_congestion_controller_value"
app:entryValues="@array/tuic_congestion_controller_value"
app:icon="@drawable/ic_baseline_compare_arrows_24"
app:key="serverCongestionController"
Expand Down

0 comments on commit fe8248b

Please sign in to comment.