diff --git a/Actions.cs b/Actions.cs index 20cda86..8d1601b 100644 --- a/Actions.cs +++ b/Actions.cs @@ -15,7 +15,7 @@ public static class Actions //This endpoint is no longer up/used //"stats.unity3d.com" - private static string[] analyticsURLs = new string[] + private static readonly string[] analyticsURLs = new string[] { "api.amplitude.com", //This is VRChat specific "api.uca.cloud.unity3d.com", @@ -26,15 +26,15 @@ public static class Actions "data-optout-service.uca.cloud.unity3d.com" }; - private static string HostsFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "drivers/etc/"); - private static string HostsFile = Path.Combine(HostsFolder, "hosts"); + private static readonly string HostsFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "drivers/etc/"); + private static readonly string HostsFile = Path.Combine(HostsFolder, "hosts"); public static void ModifyAnalyticsBlocking(bool isBlocking) { Output.WriteLine("===================================================================================="); try { - List hostsFile = getHostsFile(); + List hostsFile = GetHostsFile(); List hostsFileEdited = new List(hostsFile); if (isBlocking) @@ -42,7 +42,7 @@ public static void ModifyAnalyticsBlocking(bool isBlocking) else UnblockAnalytics(hostsFile, ref hostsFileEdited); - saveHostsFile(hostsFileEdited); + SaveHostsFile(hostsFileEdited); } catch(Exception e) { @@ -151,13 +151,13 @@ public static void UnblockAnalytics(List hostsFile, ref List hos } } - private static void saveHostsFile(List lines) + private static void SaveHostsFile(List lines) { File.WriteAllLines(HostsFile, lines); Output.WriteLine(ConsoleColor.Green, $"\nSaved 'hosts' file"); } - private static List getHostsFile() + private static List GetHostsFile() { if (Directory.Exists(HostsFolder)) { diff --git a/VRChat Analytics Blocker.csproj b/VRChat Analytics Blocker.csproj index ed61cd7..418d8ac 100644 --- a/VRChat Analytics Blocker.csproj +++ b/VRChat Analytics Blocker.csproj @@ -41,6 +41,9 @@ dubya.ico + + VRChat_Analytics_Blocker.Runner + ..\packages\Costura.Fody.4.1.0\lib\net40\Costura.dll