mirror of
https://github.com/2dust/v2rayN.git
synced 2025-08-26 04:46:56 +00:00
Add mieru support (#7828)
This commit is contained in:
parent
45c987fd86
commit
3eb49aa24c
5 changed files with 34 additions and 6 deletions
|
@ -15,5 +15,6 @@ public enum ECoreType
|
|||
brook = 27,
|
||||
overtls = 28,
|
||||
shadowquic = 29,
|
||||
mieru = 30,
|
||||
v2rayN = 99
|
||||
}
|
||||
|
|
|
@ -560,6 +560,7 @@ public class Global
|
|||
{ ECoreType.brook, "txthinking/brook" },
|
||||
{ ECoreType.overtls, "ShadowsocksR-Live/overtls" },
|
||||
{ ECoreType.shadowquic, "spongebob888/shadowquic" },
|
||||
{ ECoreType.mieru, "enfein/mieru" },
|
||||
{ ECoreType.v2rayN, "2dust/v2rayN" },
|
||||
};
|
||||
|
||||
|
|
|
@ -80,6 +80,10 @@ public sealed class CoreInfoManager
|
|||
Url = GetCoreUrl(ECoreType.v2fly),
|
||||
Match = "V2Ray",
|
||||
VersionArg = "-version",
|
||||
Environment = new Dictionary<string, string?>()
|
||||
{
|
||||
{ Global.V2RayLocalAsset, Utils.GetBinPath("") },
|
||||
},
|
||||
},
|
||||
|
||||
new CoreInfo
|
||||
|
@ -90,6 +94,10 @@ public sealed class CoreInfoManager
|
|||
Url = GetCoreUrl(ECoreType.v2fly_v5),
|
||||
Match = "V2Ray",
|
||||
VersionArg = "version",
|
||||
Environment = new Dictionary<string, string?>()
|
||||
{
|
||||
{ Global.V2RayLocalAsset, Utils.GetBinPath("") },
|
||||
},
|
||||
},
|
||||
|
||||
new CoreInfo
|
||||
|
@ -107,6 +115,11 @@ public sealed class CoreInfoManager
|
|||
DownloadUrlOSXArm64 = urlXray + "/download/{0}/Xray-macos-arm64-v8a.zip",
|
||||
Match = "Xray",
|
||||
VersionArg = "-version",
|
||||
Environment = new Dictionary<string, string?>()
|
||||
{
|
||||
{ Global.XrayLocalAsset, Utils.GetBinPath("") },
|
||||
{ Global.XrayLocalCert, Utils.GetBinPath("") },
|
||||
},
|
||||
},
|
||||
|
||||
new CoreInfo
|
||||
|
@ -205,12 +218,24 @@ public sealed class CoreInfoManager
|
|||
new CoreInfo
|
||||
{
|
||||
CoreType = ECoreType.shadowquic,
|
||||
CoreExes = [ "shadowquic", "shadowquic"],
|
||||
CoreExes = [ "shadowquic" ],
|
||||
Arguments = "-c {0}",
|
||||
Url = GetCoreUrl(ECoreType.shadowquic),
|
||||
AbsolutePath = false,
|
||||
}
|
||||
},
|
||||
|
||||
new CoreInfo
|
||||
{
|
||||
CoreType = ECoreType.mieru,
|
||||
CoreExes = [ "mieru" ],
|
||||
Arguments = "run",
|
||||
Url = GetCoreUrl(ECoreType.mieru),
|
||||
AbsolutePath = false,
|
||||
Environment = new Dictionary<string, string?>()
|
||||
{
|
||||
{ "MIERU_CONFIG_JSON_FILE", "{0}" },
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -22,10 +22,6 @@ public class CoreManager
|
|||
_config = config;
|
||||
_updateFunc = updateFunc;
|
||||
|
||||
Environment.SetEnvironmentVariable(Global.V2RayLocalAsset, Utils.GetBinPath(""), EnvironmentVariableTarget.Process);
|
||||
Environment.SetEnvironmentVariable(Global.XrayLocalAsset, Utils.GetBinPath(""), EnvironmentVariableTarget.Process);
|
||||
Environment.SetEnvironmentVariable(Global.XrayLocalCert, Utils.GetBinPath(""), EnvironmentVariableTarget.Process);
|
||||
|
||||
//Copy the bin folder to the storage location (for init)
|
||||
if (Environment.GetEnvironmentVariable(Global.LocalAppData) == "1")
|
||||
{
|
||||
|
@ -277,6 +273,10 @@ public class CoreManager
|
|||
StandardErrorEncoding = displayLog ? Encoding.UTF8 : null,
|
||||
}
|
||||
};
|
||||
foreach (var kv in coreInfo.Environment)
|
||||
{
|
||||
proc.StartInfo.Environment[kv.Key] = string.Format(kv.Value, coreInfo.AbsolutePath ? Utils.GetBinConfigPath(configPath).AppendQuotes() : configPath);
|
||||
}
|
||||
|
||||
if (displayLog)
|
||||
{
|
||||
|
|
|
@ -17,4 +17,5 @@ public class CoreInfo
|
|||
public string? Match { get; set; }
|
||||
public string? VersionArg { get; set; }
|
||||
public bool AbsolutePath { get; set; }
|
||||
public IDictionary<string, string?> Environment { get; set; } = new Dictionary<string, string?>();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue