mirror of
https://github.com/netchx/netch.git
synced 2026-03-14 17:43:18 +08:00
throw right exception when Deserialize v2rayN ShareLink
This commit is contained in:
@@ -75,16 +75,18 @@ namespace Netch.Servers.VMess
|
||||
{
|
||||
var data = new VMess();
|
||||
|
||||
V2rayNSharing vmess;
|
||||
string s;
|
||||
try
|
||||
{
|
||||
vmess = JsonSerializer.Deserialize<V2rayNSharing>(ShareLink.URLSafeBase64Decode(text.Substring(8)));
|
||||
s = ShareLink.URLSafeBase64Decode(text.Substring(8));
|
||||
}
|
||||
catch
|
||||
{
|
||||
return V2rayUtils.ParseVUri(text);
|
||||
}
|
||||
|
||||
V2rayNSharing vmess = JsonSerializer.Deserialize<V2rayNSharing>(s)!;
|
||||
|
||||
data.Remark = vmess.ps;
|
||||
data.Hostname = vmess.add;
|
||||
data.Port = ushort.Parse(vmess.port);
|
||||
|
||||
@@ -21,6 +21,8 @@ namespace Netch.Utils
|
||||
{
|
||||
public static bool Open(string path)
|
||||
{
|
||||
if (Global.Testing)
|
||||
return true;
|
||||
try
|
||||
{
|
||||
Process.Start(new ProcessStartInfo
|
||||
|
||||
Reference in New Issue
Block a user