Temporary fix for arm64 grpc issues

pull/3677/head
2dust 2023-04-10 11:28:53 +08:00
parent cc3d1ff7de
commit 6114e4ff55
3 changed files with 42 additions and 21 deletions

View File

@ -1,4 +1,5 @@
using System.Windows;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Threading;
using v2rayN.Handler;
using v2rayN.Mode;
@ -64,6 +65,10 @@ namespace v2rayN
Environment.Exit(0);
return;
}
if (RuntimeInformation.ProcessArchitecture != Architecture.X86 && RuntimeInformation.ProcessArchitecture != Architecture.X64)
{
_config.guiItem.enableStatistics = false;
}
}
private void App_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
{

View File

@ -200,9 +200,9 @@ namespace v2rayN.Handler
coreType = ECoreType.v2rayN,
coreUrl = Global.NUrl,
coreReleaseApiUrl = Global.NUrl.Replace(Global.githubUrl, Global.githubApiUrl),
coreDownloadUrl32 = Global.NUrl + "/download/{0}/v2rayN.zip",
coreDownloadUrl32 = Global.NUrl + "/download/{0}/v2rayN-32.zip",
coreDownloadUrl64 = Global.NUrl + "/download/{0}/v2rayN.zip",
coreDownloadUrlArm64= Global.NUrl + "/download/{0}/v2rayN.zip"
coreDownloadUrlArm64 = Global.NUrl + "/download/{0}/v2rayN-arm64.zip"
});
coreInfos.Add(new CoreInfo
@ -214,7 +214,7 @@ namespace v2rayN.Handler
coreReleaseApiUrl = Global.v2flyCoreUrl.Replace(Global.githubUrl, Global.githubApiUrl),
coreDownloadUrl32 = Global.v2flyCoreUrl + "/download/{0}/v2ray-windows-{1}.zip",
coreDownloadUrl64 = Global.v2flyCoreUrl + "/download/{0}/v2ray-windows-{1}.zip",
coreDownloadUrlArm64= Global.v2flyCoreUrl + "/download/{0}/v2ray-windows-{1}.zip",
coreDownloadUrlArm64 = Global.v2flyCoreUrl + "/download/{0}/v2ray-windows-{1}.zip",
match = "V2Ray",
versionArg = "-version",
redirectInfo = true,

View File

@ -443,11 +443,18 @@ namespace v2rayN.Handler
{
curVersion = "v" + getCoreVersion(type);
message = string.Format(ResUI.IsLatestCore, curVersion);
string osBit = Environment.Is64BitProcess ? "64" : "32";
if (RuntimeInformation.ProcessArchitecture == Architecture.Arm64)
string osBit = "64";
switch (RuntimeInformation.ProcessArchitecture)
{
case Architecture.Arm64:
osBit = "arm64-v8a";
break;
case Architecture.X86:
osBit = "32";
break;
default:
osBit = "64";
break;
}
url = string.Format(coreInfo.coreDownloadUrl64, version, osBit);
@ -458,29 +465,38 @@ namespace v2rayN.Handler
{
curVersion = getCoreVersion(type);
message = string.Format(ResUI.IsLatestCore, curVersion);
if (Environment.Is64BitProcess)
{
url = string.Format(coreInfo.coreDownloadUrl64, version);
}
else
{
url = string.Format(coreInfo.coreDownloadUrl32, version);
}
if (RuntimeInformation.ProcessArchitecture == Architecture.Arm64)
switch (RuntimeInformation.ProcessArchitecture)
{
case Architecture.Arm64:
url = string.Format(coreInfo.coreDownloadUrlArm64, version);
break;
case Architecture.X86:
url = string.Format(coreInfo.coreDownloadUrl32, version);
break;
default:
url = string.Format(coreInfo.coreDownloadUrl64, version);
break;
}
break;
}
case ECoreType.v2rayN:
{
curVersion = FileVersionInfo.GetVersionInfo(Utils.GetExePath()).FileVersion.ToString();
message = string.Format(ResUI.IsLatestN, curVersion);
switch (RuntimeInformation.ProcessArchitecture)
{
case Architecture.Arm64:
url = string.Format(coreInfo.coreDownloadUrlArm64, version);
break;
case Architecture.X86:
url = string.Format(coreInfo.coreDownloadUrl32, version);
break;
default:
url = string.Format(coreInfo.coreDownloadUrl64, version);
break;
}
break;
}
default:
throw new ArgumentException("Type");
}