mirror of
https://github.com/2dust/v2rayN.git
synced 2026-09-27 17:12:09 +03:00
Remove global AllowInsecure and MuxEnabled (#9473)
* Remove global AllowInsecure * Remove global MuxEnabled * Fix core config * Centralize AllowInsecure handling * Warn insecure configuration --------- Co-authored-by: 2dust <31833384+2dust@users.noreply.github.com>
This commit is contained in:
@@ -8,6 +8,12 @@ public class AddServerViewModel : MyReactiveObject
|
||||
[Reactive]
|
||||
public string? CoreType { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public bool AllowInsecure { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public bool MuxEnabled { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string Cert { get; set; }
|
||||
|
||||
@@ -273,8 +279,10 @@ public class AddServerViewModel : MyReactiveObject
|
||||
SelectedSource = JsonUtils.DeepCopy(profileItem);
|
||||
}
|
||||
CoreType = SelectedSource?.CoreType?.ToString();
|
||||
Cert = SelectedSource?.Cert?.ToString() ?? string.Empty;
|
||||
CertSha = SelectedSource?.CertSha?.ToString() ?? string.Empty;
|
||||
AllowInsecure = SelectedSource?.GetAllowInsecure() == true;
|
||||
MuxEnabled = SelectedSource?.MuxEnabled == true;
|
||||
Cert = SelectedSource?.Cert ?? string.Empty;
|
||||
CertSha = SelectedSource?.CertSha ?? string.Empty;
|
||||
|
||||
var protocolExtra = SelectedSource?.GetProtocolExtra() ?? new();
|
||||
var transport = SelectedSource?.GetTransportExtra() ?? new();
|
||||
@@ -352,7 +360,9 @@ public class AddServerViewModel : MyReactiveObject
|
||||
return;
|
||||
}
|
||||
}
|
||||
SelectedSource.CoreType = CoreType.IsNullOrEmpty() ? null : (ECoreType)Enum.Parse(typeof(ECoreType), CoreType);
|
||||
SelectedSource.CoreType = CoreType.IsNullOrEmpty() ? null : Enum.Parse<ECoreType>(CoreType);
|
||||
SelectedSource.AllowInsecure = AllowInsecure ? Global.StringTrue : Global.StringFalse;
|
||||
SelectedSource.MuxEnabled = MuxEnabled;
|
||||
SelectedSource.Cert = Cert.IsNullOrEmpty() ? string.Empty : Cert;
|
||||
SelectedSource.CertSha = CertSha.IsNullOrEmpty() ? string.Empty : CertSha;
|
||||
if (!Global.Networks.Contains(SelectedSource.Network))
|
||||
|
||||
Reference in New Issue
Block a user