mirror of
https://github.com/MatsuriDayo/NekoBoxForAndroid.git
synced 2025-12-20 07:00:05 +08:00
fix tuic
This commit is contained in:
parent
bad4e3a06a
commit
12d260c6d7
@ -21,6 +21,9 @@ public class TuicBean extends AbstractBean {
|
||||
public Boolean reduceRTT;
|
||||
public Integer mtu;
|
||||
public String sni;
|
||||
|
||||
// TUIC zep
|
||||
|
||||
public Boolean fastConnect;
|
||||
public Boolean allowInsecure;
|
||||
|
||||
@ -45,7 +48,7 @@ public class TuicBean extends AbstractBean {
|
||||
if (fastConnect == null) fastConnect = false;
|
||||
if (allowInsecure == null) allowInsecure = false;
|
||||
if (customJSON == null) customJSON = "";
|
||||
if (protocolVersion == null) protocolVersion = 4;
|
||||
if (protocolVersion == null) protocolVersion = 5;
|
||||
if (uuid == null) uuid = "";
|
||||
}
|
||||
|
||||
|
||||
@ -56,7 +56,8 @@ fun TuicBean.buildTuicConfigV5(port: Int, cacheFile: (() -> File)?): JSONObject
|
||||
}
|
||||
put("congestion_control", congestionController)
|
||||
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("server", "127.0.0.1:$port")
|
||||
|
||||
@ -73,18 +73,15 @@ class TuicSettingsActivity : ProfileSettingsActivity<TuicBean>() {
|
||||
val uuid = findPreference<EditTextPreference>(Key.SERVER_USERNAME)!!
|
||||
val mtu = findPreference<EditTextPreference>(Key.SERVER_MTU)!!
|
||||
val fastConnect = findPreference<SwitchPreference>(Key.SERVER_FAST_CONNECT)!!
|
||||
val allowInsecure = findPreference<SwitchPreference>(Key.SERVER_ALLOW_INSECURE)!!
|
||||
fun updateVersion(v: Int) {
|
||||
if (v == 5) {
|
||||
uuid.isVisible = true
|
||||
mtu.isVisible = false
|
||||
fastConnect.isVisible = false
|
||||
allowInsecure.isVisible = false
|
||||
} else {
|
||||
uuid.isVisible = false
|
||||
mtu.isVisible = true
|
||||
fastConnect.isVisible = true
|
||||
allowInsecure.isVisible = true
|
||||
}
|
||||
}
|
||||
findPreference<SimpleMenuPreference>(Key.SERVER_PROTOCOL)!!.setOnPreferenceChangeListener { _, newValue ->
|
||||
|
||||
@ -465,7 +465,7 @@
|
||||
<string name="use_selector">启用 selector (免重载切换节点)</string>
|
||||
<string name="front_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="show_group_in_notification">在通知中显示组名</string>
|
||||
<string name="reset_connections">重置连接</string>
|
||||
|
||||
@ -387,13 +387,8 @@
|
||||
</string-array>
|
||||
|
||||
<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>4</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="socks_versions">
|
||||
|
||||
@ -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="landing_proxy">Landing Proxy</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="show_group_in_notification">Show group name in in notification</string>
|
||||
<string name="reset_connections">Reset Connections</string>
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
app:entryValues="@array/shadowtls_version_value"
|
||||
app:icon="@drawable/ic_baseline_update_24"
|
||||
app:key="version"
|
||||
app:title="@string/shadowtls_version"
|
||||
app:title="@string/protocol_version"
|
||||
app:useSimpleSummaryProvider="true" />
|
||||
<EditTextPreference
|
||||
app:dialogLayout="@layout/layout_password_dialog"
|
||||
|
||||
@ -7,12 +7,12 @@
|
||||
app:useSimpleSummaryProvider="true" />
|
||||
|
||||
<moe.matsuri.nb4a.ui.SimpleMenuPreference
|
||||
app:defaultValue="4"
|
||||
app:defaultValue="5"
|
||||
app:entries="@array/tuic_version"
|
||||
app:entryValues="@array/tuic_version_value"
|
||||
app:icon="@drawable/ic_baseline_nfc_24"
|
||||
app:entryValues="@array/tuic_version"
|
||||
app:icon="@drawable/ic_baseline_update_24"
|
||||
app:key="serverProtocol"
|
||||
app:title="@string/app_version"
|
||||
app:title="@string/protocol_version"
|
||||
app:useSimpleSummaryProvider="true" />
|
||||
|
||||
<PreferenceCategory app:title="@string/proxy_cat">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user