This commit is contained in:
arm64v8a 2023-06-09 21:21:02 +09:00
parent bad4e3a06a
commit 12d260c6d7
8 changed files with 14 additions and 18 deletions

View File

@ -21,6 +21,9 @@ public class TuicBean extends AbstractBean {
public Boolean reduceRTT; public Boolean reduceRTT;
public Integer mtu; public Integer mtu;
public String sni; public String sni;
// TUIC zep
public Boolean fastConnect; public Boolean fastConnect;
public Boolean allowInsecure; public Boolean allowInsecure;
@ -45,7 +48,7 @@ public class TuicBean extends AbstractBean {
if (fastConnect == null) fastConnect = false; if (fastConnect == null) fastConnect = false;
if (allowInsecure == null) allowInsecure = false; if (allowInsecure == null) allowInsecure = false;
if (customJSON == null) customJSON = ""; if (customJSON == null) customJSON = "";
if (protocolVersion == null) protocolVersion = 4; if (protocolVersion == null) protocolVersion = 5;
if (uuid == null) uuid = ""; if (uuid == null) uuid = "";
} }

View File

@ -56,7 +56,8 @@ fun TuicBean.buildTuicConfigV5(port: Int, cacheFile: (() -> File)?): JSONObject
} }
put("congestion_control", congestionController) put("congestion_control", congestionController)
put("disable_sni", disableSNI) put("disable_sni", disableSNI)
put("zero_rtt_handshake", disableSNI) put("zero_rtt_handshake", reduceRTT)
if (allowInsecure) put("allow_insecure", true)
}) })
put("local", JSONObject().apply { put("local", JSONObject().apply {
put("server", "127.0.0.1:$port") put("server", "127.0.0.1:$port")

View File

@ -73,18 +73,15 @@ class TuicSettingsActivity : ProfileSettingsActivity<TuicBean>() {
val uuid = findPreference<EditTextPreference>(Key.SERVER_USERNAME)!! val uuid = findPreference<EditTextPreference>(Key.SERVER_USERNAME)!!
val mtu = findPreference<EditTextPreference>(Key.SERVER_MTU)!! val mtu = findPreference<EditTextPreference>(Key.SERVER_MTU)!!
val fastConnect = findPreference<SwitchPreference>(Key.SERVER_FAST_CONNECT)!! val fastConnect = findPreference<SwitchPreference>(Key.SERVER_FAST_CONNECT)!!
val allowInsecure = findPreference<SwitchPreference>(Key.SERVER_ALLOW_INSECURE)!!
fun updateVersion(v: Int) { fun updateVersion(v: Int) {
if (v == 5) { if (v == 5) {
uuid.isVisible = true uuid.isVisible = true
mtu.isVisible = false mtu.isVisible = false
fastConnect.isVisible = false fastConnect.isVisible = false
allowInsecure.isVisible = false
} else { } else {
uuid.isVisible = false uuid.isVisible = false
mtu.isVisible = true mtu.isVisible = true
fastConnect.isVisible = true fastConnect.isVisible = true
allowInsecure.isVisible = true
} }
} }
findPreference<SimpleMenuPreference>(Key.SERVER_PROTOCOL)!!.setOnPreferenceChangeListener { _, newValue -> findPreference<SimpleMenuPreference>(Key.SERVER_PROTOCOL)!!.setOnPreferenceChangeListener { _, newValue ->

View File

@ -465,7 +465,7 @@
<string name="use_selector">启用 selector (免重载切换节点)</string> <string name="use_selector">启用 selector (免重载切换节点)</string>
<string name="front_proxy">前置代理</string> <string name="front_proxy">前置代理</string>
<string name="landing_proxy">落地代理</string> <string name="landing_proxy">落地代理</string>
<string name="shadowtls_version">ShadowTLS 版本</string> <string name="protocol_version">协议版本</string>
<string name="share_subscription">分享订阅</string> <string name="share_subscription">分享订阅</string>
<string name="show_group_in_notification">在通知中显示组名</string> <string name="show_group_in_notification">在通知中显示组名</string>
<string name="reset_connections">重置连接</string> <string name="reset_connections">重置连接</string>

View File

@ -387,13 +387,8 @@
</string-array> </string-array>
<string-array name="tuic_version"> <string-array name="tuic_version">
<item>v4</item>
<item>v5</item>
</string-array>
<string-array name="tuic_version_value">
<item>4</item>
<item>5</item> <item>5</item>
<item>4</item>
</string-array> </string-array>
<string-array name="socks_versions"> <string-array name="socks_versions">

View File

@ -506,7 +506,7 @@ Anyone can write advanced plugins, which can control NekoBox. please download an
<string name="front_proxy">Front proxy</string> <string name="front_proxy">Front proxy</string>
<string name="landing_proxy">Landing Proxy</string> <string name="landing_proxy">Landing Proxy</string>
<string name="action_shadowtls" translatable="false">ShadowTLS</string> <string name="action_shadowtls" translatable="false">ShadowTLS</string>
<string name="shadowtls_version">ShadowTLS Version</string> <string name="protocol_version">Protocol Version</string>
<string name="share_subscription">Share Subscription</string> <string name="share_subscription">Share Subscription</string>
<string name="show_group_in_notification">Show group name in in notification</string> <string name="show_group_in_notification">Show group name in in notification</string>
<string name="reset_connections">Reset Connections</string> <string name="reset_connections">Reset Connections</string>

View File

@ -21,7 +21,7 @@
app:entryValues="@array/shadowtls_version_value" app:entryValues="@array/shadowtls_version_value"
app:icon="@drawable/ic_baseline_update_24" app:icon="@drawable/ic_baseline_update_24"
app:key="version" app:key="version"
app:title="@string/shadowtls_version" app:title="@string/protocol_version"
app:useSimpleSummaryProvider="true" /> app:useSimpleSummaryProvider="true" />
<EditTextPreference <EditTextPreference
app:dialogLayout="@layout/layout_password_dialog" app:dialogLayout="@layout/layout_password_dialog"

View File

@ -7,12 +7,12 @@
app:useSimpleSummaryProvider="true" /> app:useSimpleSummaryProvider="true" />
<moe.matsuri.nb4a.ui.SimpleMenuPreference <moe.matsuri.nb4a.ui.SimpleMenuPreference
app:defaultValue="4" app:defaultValue="5"
app:entries="@array/tuic_version" app:entries="@array/tuic_version"
app:entryValues="@array/tuic_version_value" app:entryValues="@array/tuic_version"
app:icon="@drawable/ic_baseline_nfc_24" app:icon="@drawable/ic_baseline_update_24"
app:key="serverProtocol" app:key="serverProtocol"
app:title="@string/app_version" app:title="@string/protocol_version"
app:useSimpleSummaryProvider="true" /> app:useSimpleSummaryProvider="true" />
<PreferenceCategory app:title="@string/proxy_cat"> <PreferenceCategory app:title="@string/proxy_cat">