Temporary fix for arm64 grpc issues

This commit is contained in:
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 System.Windows.Threading;
using v2rayN.Handler; using v2rayN.Handler;
using v2rayN.Mode; using v2rayN.Mode;
@ -64,6 +65,10 @@ namespace v2rayN
Environment.Exit(0); Environment.Exit(0);
return; return;
} }
if (RuntimeInformation.ProcessArchitecture != Architecture.X86 && RuntimeInformation.ProcessArchitecture != Architecture.X64)
{
_config.guiItem.enableStatistics = false;
}
} }
private void App_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e) private void App_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
{ {

View file

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

View file

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