diff --git a/v2rayN/ServiceLib/Handler/Fmt/TuicFmt.cs b/v2rayN/ServiceLib/Handler/Fmt/TuicFmt.cs index b17b1ef2..9532001c 100644 --- a/v2rayN/ServiceLib/Handler/Fmt/TuicFmt.cs +++ b/v2rayN/ServiceLib/Handler/Fmt/TuicFmt.cs @@ -53,6 +53,6 @@ public class TuicFmt : BaseFmt dicQuery.Add("congestion_control", item.HeaderType); - return ToUri(EConfigType.TUIC, item.Address, item.Port, $"{item.Password}:{item.GetProtocolExtra().Username ?? ""}", dicQuery, remark); + return ToUri(EConfigType.TUIC, item.Address, item.Port, $"{item.GetProtocolExtra().Username ?? ""}:{item.Password}", dicQuery, remark); } } diff --git a/v2rayN/ServiceLib/Manager/AppManager.cs b/v2rayN/ServiceLib/Manager/AppManager.cs index 867a4990..034dbce4 100644 --- a/v2rayN/ServiceLib/Manager/AppManager.cs +++ b/v2rayN/ServiceLib/Manager/AppManager.cs @@ -326,6 +326,14 @@ public sealed class AppManager HopInterval = _config.HysteriaItem.HopInterval }; break; + case EConfigType.TUIC: + extra = extra with + { + Username = item.Id, + }; + item.Id = item.Security; + item.Password = item.Security; + break; case EConfigType.WireGuard: extra = extra with { diff --git a/v2rayN/ServiceLib/Services/CoreConfig/Singbox/SingboxOutboundService.cs b/v2rayN/ServiceLib/Services/CoreConfig/Singbox/SingboxOutboundService.cs index d6b88ed8..127b09a5 100644 --- a/v2rayN/ServiceLib/Services/CoreConfig/Singbox/SingboxOutboundService.cs +++ b/v2rayN/ServiceLib/Services/CoreConfig/Singbox/SingboxOutboundService.cs @@ -175,8 +175,8 @@ public partial class CoreConfigSingboxService } case EConfigType.TUIC: { - outbound.uuid = node.Password; - outbound.password = protocolExtra.Username; + outbound.uuid = protocolExtra.Username; + outbound.password = node.Password; outbound.congestion_control = node.HeaderType; break; } diff --git a/v2rayN/v2rayN.Desktop/Views/AddServerWindow.axaml.cs b/v2rayN/v2rayN.Desktop/Views/AddServerWindow.axaml.cs index 63ce754b..e5f96a10 100644 --- a/v2rayN/v2rayN.Desktop/Views/AddServerWindow.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/AddServerWindow.axaml.cs @@ -152,8 +152,8 @@ public partial class AddServerWindow : WindowBase break; case EConfigType.TUIC: - this.Bind(ViewModel, vm => vm.SelectedSource.Password, v => v.txtId8.Text).DisposeWith(disposables); - this.Bind(ViewModel, vm => vm.Username, v => v.txtSecurity8.Text).DisposeWith(disposables); + this.Bind(ViewModel, vm => vm.Username, v => v.txtId8.Text).DisposeWith(disposables); + this.Bind(ViewModel, vm => vm.SelectedSource.Password, v => v.txtSecurity8.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.SelectedSource.HeaderType, v => v.cmbHeaderType8.SelectedValue).DisposeWith(disposables); break; diff --git a/v2rayN/v2rayN/Views/AddServerWindow.xaml.cs b/v2rayN/v2rayN/Views/AddServerWindow.xaml.cs index 4a31f194..c3c403c0 100644 --- a/v2rayN/v2rayN/Views/AddServerWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/AddServerWindow.xaml.cs @@ -147,8 +147,8 @@ public partial class AddServerWindow break; case EConfigType.TUIC: - this.Bind(ViewModel, vm => vm.SelectedSource.Password, v => v.txtId8.Text).DisposeWith(disposables); - this.Bind(ViewModel, vm => vm.Username, v => v.txtSecurity8.Text).DisposeWith(disposables); + this.Bind(ViewModel, vm => vm.Username, v => v.txtId8.Text).DisposeWith(disposables); + this.Bind(ViewModel, vm => vm.SelectedSource.Password, v => v.txtSecurity8.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.SelectedSource.HeaderType, v => v.cmbHeaderType8.Text).DisposeWith(disposables); break;