mirror of
https://github.com/2dust/v2rayN.git
synced 2026-03-09 18:03:09 +00:00
Compare commits
1 commit
6c3ee545cf
...
a75a6d75a8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a75a6d75a8 |
4 changed files with 5 additions and 41 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
<Project>
|
<Project>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Version>7.17.2</Version>
|
<Version>7.17.1</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
|
|
|
||||||
|
|
@ -94,28 +94,4 @@ public static class Extension
|
||||||
{
|
{
|
||||||
return configType is EConfigType.Custom or EConfigType.PolicyGroup or EConfigType.ProxyChain;
|
return configType is EConfigType.Custom or EConfigType.PolicyGroup or EConfigType.ProxyChain;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Safely adds elements from a collection to the list. Does nothing if the source is null.
|
|
||||||
/// </summary>
|
|
||||||
public static void AddRangeSafe<T>(this ICollection<T> destination, IEnumerable<T>? source)
|
|
||||||
{
|
|
||||||
ArgumentNullException.ThrowIfNull(destination);
|
|
||||||
|
|
||||||
if (source is null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (destination is List<T> list)
|
|
||||||
{
|
|
||||||
list.AddRange(source);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var item in source)
|
|
||||||
{
|
|
||||||
destination.Add(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -719,9 +719,10 @@ public class Utils
|
||||||
return Guid.TryParse(strSrc, out _);
|
return Guid.TryParse(strSrc, out _);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Dictionary<string, string> GetSystemHosts(string hostFile)
|
public static Dictionary<string, string> GetSystemHosts()
|
||||||
{
|
{
|
||||||
var systemHosts = new Dictionary<string, string>();
|
var systemHosts = new Dictionary<string, string>();
|
||||||
|
var hostFile = @"C:\Windows\System32\drivers\etc\hosts";
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (File.Exists(hostFile))
|
if (File.Exists(hostFile))
|
||||||
|
|
@ -754,19 +755,6 @@ public class Utils
|
||||||
return systemHosts;
|
return systemHosts;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Dictionary<string, string> GetSystemHosts()
|
|
||||||
{
|
|
||||||
var hosts = GetSystemHosts(@"C:\Windows\System32\drivers\etc\hosts");
|
|
||||||
var hostsIcs = GetSystemHosts(@"C:\Windows\System32\drivers\etc\hosts.ics");
|
|
||||||
|
|
||||||
foreach (var (key, value) in hostsIcs)
|
|
||||||
{
|
|
||||||
hosts[key] = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
return hosts;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static async Task<string?> GetCliWrapOutput(string filePath, string? arg)
|
public static async Task<string?> GetCliWrapOutput(string filePath, string? arg)
|
||||||
{
|
{
|
||||||
return await GetCliWrapOutput(filePath, arg != null ? new List<string>() { arg } : null);
|
return await GetCliWrapOutput(filePath, arg != null ? new List<string>() { arg } : null);
|
||||||
|
|
|
||||||
|
|
@ -218,8 +218,8 @@ public class ActionPrecheckManager
|
||||||
|
|
||||||
var childIds = new List<string>();
|
var childIds = new List<string>();
|
||||||
var subItems = await ProfileGroupItemManager.GetSubChildProfileItems(group);
|
var subItems = await ProfileGroupItemManager.GetSubChildProfileItems(group);
|
||||||
childIds.AddRangeSafe(subItems.Select(p => p.IndexId));
|
childIds.AddRange(subItems.Select(p => p.IndexId));
|
||||||
childIds.AddRangeSafe(Utils.String2List(group.ChildItems));
|
childIds.AddRange(Utils.String2List(group.ChildItems));
|
||||||
|
|
||||||
foreach (var child in childIds)
|
foreach (var child in childIds)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue