diff --git a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/util/V2rayConfigUtil.kt b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/util/V2rayConfigUtil.kt index 2f61c2abe..a2222fd82 100644 --- a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/util/V2rayConfigUtil.kt +++ b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/util/V2rayConfigUtil.kt @@ -581,10 +581,21 @@ object V2rayConfigUtil { tag = TAG_FRAGMENT, mux = null ) + + var packets = settingsStorage?.decodeString(AppConfig.PREF_FRAGMENT_PACKETS) ?: "tlshello" + if (v2rayConfig.outbounds[0].streamSettings?.security == V2rayConfig.REALITY + && packets == "tlshello" + ) { + packets = "1-3" + } else if (v2rayConfig.outbounds[0].streamSettings?.security == V2rayConfig.TLS + && packets != "tlshello" + ) { + packets = "tlshello" + } + fragmentOutbound.settings = V2rayConfig.OutboundBean.OutSettingsBean( fragment = V2rayConfig.OutboundBean.OutSettingsBean.FragmentBean( - packets = settingsStorage?.decodeString(AppConfig.PREF_FRAGMENT_PACKETS) - ?: "tlshello", + packets = packets, length = settingsStorage?.decodeString(AppConfig.PREF_FRAGMENT_LENGTH) ?: "50-100", interval = settingsStorage?.decodeString(AppConfig.PREF_FRAGMENT_INTERVAL) diff --git a/V2rayNG/app/src/main/res/values/arrays.xml b/V2rayNG/app/src/main/res/values/arrays.xml index c64f0fb39..a10330e4b 100644 --- a/V2rayNG/app/src/main/res/values/arrays.xml +++ b/V2rayNG/app/src/main/res/values/arrays.xml @@ -62,6 +62,9 @@ tlshello + 1-2 + 1-3 + 1-5