mirror of https://github.com/2dust/v2rayN
Added Enable Mixin parameter
parent
8a19128e7f
commit
8a29e147d3
|
@ -128,7 +128,7 @@ namespace ServiceLib.Services.CoreConfig
|
||||||
//Mixin
|
//Mixin
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
MixinContent(fileContent, node);
|
await MixinContent(fileContent, node);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
@ -158,20 +158,21 @@ namespace ServiceLib.Services.CoreConfig
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void MixinContent(Dictionary<string, object> fileContent, ProfileItem node)
|
private async Task MixinContent(Dictionary<string, object> fileContent, ProfileItem node)
|
||||||
{
|
{
|
||||||
//if (!_config.clashUIItem.enableMixinContent)
|
if (!_config.ClashUIItem.EnableMixinContent)
|
||||||
//{
|
|
||||||
// return;
|
|
||||||
//}
|
|
||||||
|
|
||||||
var path = Utils.GetConfigPath(Global.ClashMixinConfigFileName);
|
|
||||||
if (!File.Exists(path))
|
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var txtFile = File.ReadAllText(Utils.GetConfigPath(Global.ClashMixinConfigFileName));
|
var path = Utils.GetConfigPath(Global.ClashMixinConfigFileName);
|
||||||
|
if (!File.Exists(path))
|
||||||
|
{
|
||||||
|
var mixin = EmbedUtils.GetEmbedText(Global.ClashMixinYaml);
|
||||||
|
await File.AppendAllTextAsync(path, mixin);
|
||||||
|
}
|
||||||
|
|
||||||
|
var txtFile = await File.ReadAllTextAsync(Utils.GetConfigPath(Global.ClashMixinConfigFileName));
|
||||||
|
|
||||||
var mixinContent = YamlUtils.FromYaml<Dictionary<string, object>>(txtFile);
|
var mixinContent = YamlUtils.FromYaml<Dictionary<string, object>>(txtFile);
|
||||||
if (mixinContent == null)
|
if (mixinContent == null)
|
||||||
|
|
Loading…
Reference in New Issue