mirror of
https://github.com/netchx/netch.git
synced 2026-05-11 23:45:06 +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();
|
var data = new VMess();
|
||||||
|
|
||||||
V2rayNSharing vmess;
|
string s;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
vmess = JsonSerializer.Deserialize<V2rayNSharing>(ShareLink.URLSafeBase64Decode(text.Substring(8)));
|
s = ShareLink.URLSafeBase64Decode(text.Substring(8));
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
return V2rayUtils.ParseVUri(text);
|
return V2rayUtils.ParseVUri(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
V2rayNSharing vmess = JsonSerializer.Deserialize<V2rayNSharing>(s)!;
|
||||||
|
|
||||||
data.Remark = vmess.ps;
|
data.Remark = vmess.ps;
|
||||||
data.Hostname = vmess.add;
|
data.Hostname = vmess.add;
|
||||||
data.Port = ushort.Parse(vmess.port);
|
data.Port = ushort.Parse(vmess.port);
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ namespace Netch.Utils
|
|||||||
{
|
{
|
||||||
public static bool Open(string path)
|
public static bool Open(string path)
|
||||||
{
|
{
|
||||||
|
if (Global.Testing)
|
||||||
|
return true;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Process.Start(new ProcessStartInfo
|
Process.Start(new ProcessStartInfo
|
||||||
|
|||||||
Reference in New Issue
Block a user