customizable packet fragmentation settings (#9597)

* first changes

* fix: use ItemsSource for fragment packets ComboBox so value saves correctly

* feat: add customizable packet fragmentation for Xray-core

- Add fragment settings in Core tab: Packets (dropdown), Length (range), Interval (range), MaxSplit (0-10000)
- Support both 'from-to' (e.g., 50-100) and single value (e.g., 50) formats for Length, Interval, and MaxSplit
- Validation with shortened error message: 'Invalid range format. Use from-to (e.g., 50-100).'
- UI in PopupBox (materialDesign) visible only when EnableFragment is checked
- Only Xray-core supported (Mihomo/sing-box fragment code removed)
- Localization updated for 8 languages

* fix: address 2dust review feedback

- Move FragmentPacketsOptions to Global class
- Remove default values from Fragment4RayItem model (set in ConfigHandler)
- Fix Avalonia bindings: move ItemsSource and SelectedItem to code-behind
- Update ViewModel to use Global.FragmentPacketsOptions
- Remove defaults from model properties

* Adjust ui

---------

Co-authored-by: 2dust <31833384+2dust@users.noreply.github.com>
This commit is contained in:
Enqvy
2026-06-22 11:30:13 +03:30
committed by GitHub
parent f1b88ccf2a
commit 81c118c9b2
21 changed files with 713 additions and 5 deletions
+33
View File
@@ -1104,6 +1104,39 @@
<data name="TbSettingsEnableFragment" xml:space="preserve">
<value>Aktifkan fragment</value>
</data>
<data name="TbSettingsFragmentPackets" xml:space="preserve">
<value>Paket Fragment</value>
</data>
<data name="TbSettingsFragmentPacketsTip" xml:space="preserve">
<value>Paket untuk difragmentasikan: tlshello (TLS ClientHello) atau 1-1 s.d. 1-5 (N paket TCP pertama)</value>
</data>
<data name="TbSettingsFragmentLength" xml:space="preserve">
<value>Panjang Fragment</value>
</data>
<data name="TbSettingsFragmentLengthTip" xml:space="preserve">
<value>Rentang ukuran fragment (byte), cth: 50-100. Nilai pertama harus ≤ kedua. Kosong = default.</value>
</data>
<data name="TbSettingsFragmentInterval" xml:space="preserve">
<value>Interval Fragment</value>
</data>
<data name="TbSettingsFragmentIntervalTip" xml:space="preserve">
<value>Jeda antar fragment (ms), cth: 10-20. Rentang 1-100. Nilai pertama harus ≤ kedua. Kosong = default.</value>
</data>
<data name="TbSettingsFragmentMaxSplit" xml:space="preserve">
<value>Maks Split</value>
</data>
<data name="TbSettingsFragmentMaxSplitTip" xml:space="preserve">
<value>Maks jumlah split (0 = unlimited, 0-10000). Hanya Xray-core. Kosong = default.</value>
</data>
<data name="TbSettingsFragmentFallbackDelay" xml:space="preserve">
<value>Fallback Delay</value>
</data>
<data name="TbSettingsFragmentFallbackDelayTip" xml:space="preserve">
<value>Delay fallback untuk TLS fragment. Hanya sing-box. Kosong = default.</value>
</data>
<data name="FillFragmentParameterError" xml:space="preserve">
<value>Format range tidak valid. Gunakan 'from-to' (cth: 50-100).</value>
</data>
<data name="TbSettingsEnableCacheFile4Sbox" xml:space="preserve">
<value>Aktifkan file cache untuk sing-box (file ruleset)</value>
</data>