Merge pull request #2889 from vfarid/more_fragment_options

More fragment options + Fix for reality configs
This commit is contained in:
2dust
2024-03-03 16:53:22 +08:00
committed by GitHub
2 changed files with 16 additions and 2 deletions

View File

@@ -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)

View File

@@ -62,6 +62,9 @@
<string-array name="fragment_packets" translatable="false">
<item>tlshello</item>
<item>1-2</item>
<item>1-3</item>
<item>1-5</item>
</string-array>
<string-array name="streamsecurity_utls" translatable="false">