diff --git a/USBHelperInjector/Contracts/IInjectorService.cs b/USBHelperInjector/IPC/IInjectorService.cs similarity index 97% rename from USBHelperInjector/Contracts/IInjectorService.cs rename to USBHelperInjector/IPC/IInjectorService.cs index 12abcd5..18bf24f 100644 --- a/USBHelperInjector/Contracts/IInjectorService.cs +++ b/USBHelperInjector/IPC/IInjectorService.cs @@ -1,6 +1,6 @@ using System.ServiceModel; -namespace USBHelperInjector.Contracts +namespace USBHelperInjector.IPC { [ServiceContract] public interface IInjectorService diff --git a/USBHelperInjector/Contracts/ILauncherService.cs b/USBHelperInjector/IPC/ILauncherService.cs similarity index 57% rename from USBHelperInjector/Contracts/ILauncherService.cs rename to USBHelperInjector/IPC/ILauncherService.cs index c0adde2..c18f80c 100644 --- a/USBHelperInjector/Contracts/ILauncherService.cs +++ b/USBHelperInjector/IPC/ILauncherService.cs @@ -1,7 +1,7 @@ -using System.ServiceModel; -using System.Threading.Tasks; +using System; +using System.ServiceModel; -namespace USBHelperInjector.Contracts +namespace USBHelperInjector.IPC { [ServiceContract] public interface ILauncherService @@ -10,6 +10,6 @@ public interface ILauncherService void SetKeySite(string site, string url); [OperationContract] - void SendInjectorSettings(); + void SendInjectorSettings(Uri uri); } } diff --git a/USBHelperInjector/IPC/IPCType.cs b/USBHelperInjector/IPC/IPCType.cs new file mode 100644 index 0000000..bd53b47 --- /dev/null +++ b/USBHelperInjector/IPC/IPCType.cs @@ -0,0 +1,12 @@ +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace USBHelperInjector.IPC +{ + [JsonConverter(typeof(StringEnumConverter))] + public enum IPCType + { + NamedPipe, + TCP + } +} diff --git a/USBHelperInjector/IPC/IPCUtil.cs b/USBHelperInjector/IPC/IPCUtil.cs new file mode 100644 index 0000000..a3cd265 --- /dev/null +++ b/USBHelperInjector/IPC/IPCUtil.cs @@ -0,0 +1,79 @@ +using System; +using System.ComponentModel; +using System.Linq; +using System.ServiceModel; +using System.ServiceModel.Channels; +using System.ServiceModel.Description; + +namespace USBHelperInjector.IPC +{ + public class IPCUtil + { + public static ServiceHost CreateService(IPCType ipcType, Type serviceType, Type contractType, out Uri uri) + { + switch (ipcType) + { + case IPCType.NamedPipe: + return CreateNamedPipeService(serviceType, contractType, out uri); + case IPCType.TCP: + return CreateTcpService(serviceType, contractType, out uri); + default: + throw new InvalidEnumArgumentException(nameof(ipcType), (int)ipcType, ipcType.GetType()); + } + } + + public static ServiceHost CreateNamedPipeService(Type serviceType, Type contractType, out Uri uri) + { + var guid = Guid.NewGuid().ToString("D"); + var host = new ServiceHost(serviceType, new Uri($"net.pipe://localhost/{guid}")); + host.AddServiceEndpoint(contractType, new NetNamedPipeBinding(""), ""); + host.Open(); + uri = host.ChannelDispatchers.First().Listener.Uri; + return host; + } + + public static ServiceHost CreateTcpService(Type serviceType, Type contractType, out Uri uri) + { + var localUri = new Uri("net.tcp://127.0.0.1"); + var host = new ServiceHost(serviceType, localUri); + var binding = new NetTcpBinding("") + { + Security = + { + Mode = SecurityMode.None + } + }; + var endpoint = host.AddServiceEndpoint(contractType, binding, "", localUri); + endpoint.ListenUriMode = ListenUriMode.Unique; + host.Open(); + uri = host.ChannelDispatchers.First().Listener.Uri; + return host; + } + + + public static TContract CreateChannel(IPCType ipcType, string address) + { + Binding binding; + switch (ipcType) + { + case IPCType.NamedPipe: + binding = new NetNamedPipeBinding(""); + break; + case IPCType.TCP: + binding = new NetTcpBinding("") + { + Security = + { + Mode = SecurityMode.None + } + }; + break; + default: + throw new InvalidEnumArgumentException(nameof(ipcType), (int)ipcType, ipcType.GetType()); + } + + var factory = new ChannelFactory(binding, address); + return factory.CreateChannel(); + } + } +} diff --git a/USBHelperInjector/InjectorService.cs b/USBHelperInjector/InjectorService.cs index 3df6a49..5e08f87 100644 --- a/USBHelperInjector/InjectorService.cs +++ b/USBHelperInjector/InjectorService.cs @@ -6,11 +6,12 @@ using System.Reflection; using System.Security.Cryptography.X509Certificates; using System.ServiceModel; -using USBHelperInjector.Contracts; +using USBHelperInjector.IPC; using USBHelperInjector.Patches.Attributes; namespace USBHelperInjector { + [ServiceBehavior(AddressFilterMode = AddressFilterMode.Any)] public class InjectorService : IInjectorService { public static Harmony Harmony { get; private set; } @@ -27,14 +28,19 @@ public class InjectorService : IInjectorService public static void Init() { - var factory = new ChannelFactory(new NetNamedPipeBinding(""), "net.pipe://localhost/LauncherService"); - LauncherService = factory.CreateChannel(); + var args = Environment.GetCommandLineArgs(); + var ipcType = (IPCType)Enum.Parse(typeof(IPCType), args[2]); + var launcherUri = args[3]; - ServiceHost host = new ServiceHost(typeof(InjectorService), new Uri("net.pipe://localhost/InjectorService")); - host.AddServiceEndpoint(typeof(IInjectorService), new NetNamedPipeBinding(""), ""); - host.Open(); + IPCUtil.CreateService( + ipcType, + typeof(InjectorService), + typeof(IInjectorService), + out var serviceUri + ); - LauncherService.SendInjectorSettings(); + LauncherService = IPCUtil.CreateChannel(ipcType, launcherUri); + LauncherService.SendInjectorSettings(serviceUri); Harmony = new Harmony("me.failedshack.usbhelperinjector"); var assembly = Assembly.GetExecutingAssembly(); diff --git a/USBHelperInjector/ModuleInitInjectedAttribute.cs b/USBHelperInjector/ModuleInitInjectedAttribute.cs new file mode 100644 index 0000000..7195bd5 --- /dev/null +++ b/USBHelperInjector/ModuleInitInjectedAttribute.cs @@ -0,0 +1,15 @@ +using System; + +namespace USBHelperInjector +{ + [AttributeUsage(AttributeTargets.Assembly)] + public class ModuleInitInjectedAttribute : Attribute + { + public string Version { get; } + + public ModuleInitInjectedAttribute(string version) + { + Version = version; + } + } +} diff --git a/USBHelperInjector/Patches/CommandLineArgsPatch.cs b/USBHelperInjector/Patches/CommandLineArgsPatch.cs new file mode 100644 index 0000000..9771586 --- /dev/null +++ b/USBHelperInjector/Patches/CommandLineArgsPatch.cs @@ -0,0 +1,21 @@ + +using System.Linq; +using System.Reflection; +using HarmonyLib; + +namespace USBHelperInjector.Patches +{ + [HarmonyPatch] + class CommandLineArgsPatch + { + static MethodBase TargetMethod() + { + return ReflectionHelper.EntryPoint; + } + + static void Prefix(ref string[] __0) + { + __0 = __0.Take(1).ToArray(); + } + } +} diff --git a/USBHelperInjector/Patches/DownloadManagerOverlayPatch.cs b/USBHelperInjector/Patches/DownloadManagerOverlayPatch.cs new file mode 100644 index 0000000..11275df --- /dev/null +++ b/USBHelperInjector/Patches/DownloadManagerOverlayPatch.cs @@ -0,0 +1,30 @@ +using System.Diagnostics; +using System.Linq; +using System.Reflection; +using HarmonyLib; +using USBHelperInjector.Patches.Attributes; + +namespace USBHelperInjector.Patches +{ + [Optional] + [HarmonyPatch] + class DownloadManagerOverlayPatch + { + static MethodBase TargetMethod() + { + return AccessTools.DeclaredProperty(ReflectionHelper.Settings, "ShowDownloadManagerTip").GetGetMethod(true); + } + + static bool Prefix(ref bool __result) + { + // Check if RivaTuner hooks are loaded into the process; RivaTuner can sometimes break d3d9 + var modules = Process.GetCurrentProcess().Modules.Cast(); + if (modules.Any(m => m.ModuleName.ToLowerInvariant().StartsWith("rtsshooks"))) + { + __result = false; + return false; + } + return true; + } + } +} diff --git a/USBHelperInjector/Patches/InvalidConfigPatch.cs b/USBHelperInjector/Patches/InvalidConfigPatch.cs new file mode 100644 index 0000000..a2fbb43 --- /dev/null +++ b/USBHelperInjector/Patches/InvalidConfigPatch.cs @@ -0,0 +1,40 @@ +using System; +using System.Configuration; +using System.IO; +using System.Reflection; +using System.Windows.Forms; +using System.Xml; +using HarmonyLib; +using USBHelperInjector.Patches.Attributes; + +namespace USBHelperInjector.Patches +{ + [Optional] + [HarmonyPatch] + class InvalidConfigPatch + { + static MethodBase TargetMethod() + { + return ReflectionHelper.Settings.GetConstructor(Type.EmptyTypes); + } + + static void Postfix() + { + try + { + // try to load user.config + ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.PerUserRoamingAndLocal); + } + catch (ConfigurationErrorsException e) when (e.GetBaseException() is XmlException) + { + // can't use `ConfigurationManager.OpenExeConfiguration` for getting the config path here, + // as it would preload the file and throw again + var configPathsType = Assembly.GetAssembly(typeof(Configuration)).GetType("System.Configuration.ClientConfigPaths"); + var configPaths = AccessTools.Property(configPathsType, "Current").GetValue(null); + var fileName = (string)AccessTools.Property(configPathsType, "LocalConfigFilename").GetValue(configPaths); + File.Delete(fileName); + MessageBox.Show("The configuration file has been corrupted. You'll need to go through the setup again.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + } + } +} diff --git a/USBHelperInjector/USBHelperInjector.csproj b/USBHelperInjector/USBHelperInjector.csproj index 9532962..63714ef 100644 --- a/USBHelperInjector/USBHelperInjector.csproj +++ b/USBHelperInjector/USBHelperInjector.csproj @@ -52,11 +52,15 @@ - + + + + + @@ -65,7 +69,9 @@ + + @@ -81,7 +87,7 @@ - + diff --git a/USBHelperLauncher/App.config b/USBHelperLauncher/App.config index 29cb102..c968351 100644 --- a/USBHelperLauncher/App.config +++ b/USBHelperLauncher/App.config @@ -8,6 +8,9 @@ + + + \ No newline at end of file diff --git a/USBHelperLauncher/Configuration/Settings.cs b/USBHelperLauncher/Configuration/Settings.cs index 8e42a1a..75f8a49 100644 --- a/USBHelperLauncher/Configuration/Settings.cs +++ b/USBHelperLauncher/Configuration/Settings.cs @@ -3,6 +3,7 @@ using System.IO; using System.Linq; using System.Reflection; +using USBHelperInjector.IPC; using USBHelperLauncher.Net; namespace USBHelperLauncher.Configuration @@ -92,6 +93,9 @@ private static List> Properties [Setting("Injector", true)] public static bool SplitUnpackDirectories { get; set; } + [Setting("Launcher", IPCType.TCP)] + public static IPCType IPCType { get; set; } + public static void Save() { DoNotModify = Program.GetVersion(); diff --git a/USBHelperLauncher/Emulator/Package.cs b/USBHelperLauncher/Emulator/Package.cs index 649a725..0fc1a19 100644 --- a/USBHelperLauncher/Emulator/Package.cs +++ b/USBHelperLauncher/Emulator/Package.cs @@ -93,7 +93,6 @@ public async Task Download(WebClient client, string path) string fileName = await GetFileName(); string file = Path.Combine(path, fileName); ServicePointManager.Expect100Continue = true; - ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; // Use non-browser user agent to avoid being redirected to HTML page (e.g. SourceForge) client.Headers.Add("User-Agent", "USBHelperLauncher"); await client.DownloadFileTaskAsync(uri, file); diff --git a/USBHelperLauncher/Emulator/Project64Configuration.cs b/USBHelperLauncher/Emulator/Project64Configuration.cs index b44f7e9..56bf963 100644 --- a/USBHelperLauncher/Emulator/Project64Configuration.cs +++ b/USBHelperLauncher/Emulator/Project64Configuration.cs @@ -20,7 +20,6 @@ public async Task GetPackageAsync() using (WebClient client = new WebClient()) { ServicePointManager.Expect100Continue = true; - ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; client.Headers.Add("User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2;)"); try { diff --git a/USBHelperLauncher/LauncherService.cs b/USBHelperLauncher/LauncherService.cs index 368fa3d..b18266c 100644 --- a/USBHelperLauncher/LauncherService.cs +++ b/USBHelperLauncher/LauncherService.cs @@ -1,10 +1,12 @@ -using Fiddler; +using System; +using Fiddler; using System.ServiceModel; -using USBHelperInjector.Contracts; +using USBHelperInjector.IPC; using USBHelperLauncher.Configuration; namespace USBHelperLauncher { + [ServiceBehavior(AddressFilterMode = AddressFilterMode.Any)] class LauncherService : ILauncherService { public void SetKeySite(string site, string url) @@ -13,11 +15,10 @@ public void SetKeySite(string site, string url) Settings.Save(); } - public void SendInjectorSettings() + public void SendInjectorSettings(Uri uri) { - Program.Logger.WriteLine("Sending information to injector..."); - var factory = new ChannelFactory(new NetNamedPipeBinding(""), "net.pipe://localhost/InjectorService"); - var channel = factory.CreateChannel(); + Program.Logger.WriteLine($"Sending information to injector ({uri})..."); + var channel = IPCUtil.CreateChannel(Settings.IPCType, uri.ToString()); if (Program.OverridePublicKey) { channel.SetDonationKey(Program.GenerateDonationKey()); diff --git a/USBHelperLauncher/Logger.cs b/USBHelperLauncher/Logger.cs index 03f7239..9cd2867 100644 --- a/USBHelperLauncher/Logger.cs +++ b/USBHelperLauncher/Logger.cs @@ -19,6 +19,8 @@ public Logger() override public void Write(string output) { + var timestamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"); + output = $"[{timestamp}] {output}"; // Capture the output and also send it to StdOut Captured.Write(output); stdOutWriter.Write(output); @@ -26,9 +28,7 @@ override public void Write(string output) override public void WriteLine(string output) { - // Capture the output and also send it to StdOut - Captured.WriteLine(output); - stdOutWriter.WriteLine(output); + Write(output + Environment.NewLine); } public string GetLog() diff --git a/USBHelperLauncher/ModuleInitInjector.cs b/USBHelperLauncher/ModuleInitInjector.cs index b71a002..9e1a75e 100644 --- a/USBHelperLauncher/ModuleInitInjector.cs +++ b/USBHelperLauncher/ModuleInitInjector.cs @@ -1,7 +1,9 @@ -using dnlib.DotNet; +using System.IO; +using dnlib.DotNet; using dnlib.DotNet.Emit; using dnlib.DotNet.Writer; using System.Linq; +using USBHelperInjector; namespace USBHelperLauncher { @@ -14,6 +16,22 @@ public ModuleInitInjector(string path) this.path = path; } + public bool RequiresInject(string outputPath) + { + if (!File.Exists(outputPath)) + { + return true; + } + using (var module = ModuleDefMD.Load(outputPath)) + { + // skip injection if file already exists and is up-to-date + var attr = module.Assembly.CustomAttributes.FirstOrDefault( + a => a.TypeFullName == typeof(ModuleInitInjectedAttribute).FullName + ); + return attr == null || (attr.ConstructorArguments[0].Value as UTF8String).String != Program.GetVersion(); + } + } + public void Inject(string outputPath) { using (var module = ModuleDefMD.Load(path)) @@ -52,6 +70,15 @@ public void Inject(string outputPath) cctor.Body.Instructions.Insert(0, OpCodes.Call.ToInstruction(testMethodRef)); } + // add injected ModuleInitInjected attribute + var injectAttrDef = typeof(ModuleInitInjectedAttribute).GetConstructor(new[] { typeof(string) }); + var injectAttrRef = module.Import(injectAttrDef); + var newAttribute = new CustomAttribute(injectAttrRef as MemberRef, new[] + { + new CAArgument(injectAttrRef.GetParam(0), Program.GetVersion()) + }); + module.Assembly.CustomAttributes.Add(newAttribute); + // write new file var options = new ModuleWriterOptions(module); options.MetadataOptions.PreserveHeapOrder(module, true); diff --git a/USBHelperLauncher/Net/Proxy.cs b/USBHelperLauncher/Net/Proxy.cs index 13a4165..5055960 100644 --- a/USBHelperLauncher/Net/Proxy.cs +++ b/USBHelperLauncher/Net/Proxy.cs @@ -25,7 +25,6 @@ class Proxy : IDisposable new RegistrationEndpoint(), new CloudEndpoint(), new SiteEndpoint(), - new WiiUShopEndpoint(), new TitlekeysWiiUEndpoint(), new Titlekeys3DSEndpoint() }; @@ -69,9 +68,20 @@ public void Start() policy.RevocationMode = X509RevocationMode.NoCheck; policy.VerificationFlags = X509VerificationFlags.AllowUnknownCertificateAuthority; policy.ExtraStore.AddRange(CertificateStore); - if (chain.Build(remoteChain.ChainElements[0].Certificate)) + + if (!chain.Build(remoteChain.ChainElements[0].Certificate)) + { + return; + } + var chainRoot = chain.ChainElements[chain.ChainElements.Count - 1].Certificate; + foreach (var trusted in CertificateStore) { + if (!chainRoot.RawData.SequenceEqual(trusted.RawData)) + { + continue; + } args.ValidityState = CertificateValidity.ForceValid; + break; } }; FiddlerApplication.Prefs.SetBoolPref("fiddler.certmaker.CleanupServerCertsOnExit", true); diff --git a/USBHelperLauncher/Net/WiiUShopEndpoint.cs b/USBHelperLauncher/Net/WiiUShopEndpoint.cs deleted file mode 100644 index 6a66c0c..0000000 --- a/USBHelperLauncher/Net/WiiUShopEndpoint.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Fiddler; - -namespace USBHelperLauncher.Net -{ - class WiiUShopEndpoint : Endpoint - { - public WiiUShopEndpoint() : base("ccs.cdn.wup.shop.nintendo.net") { } - - protected WiiUShopEndpoint(string hostName) : base(hostName) { } - - [Request("/*")] - public void Get(Session oS) - { - oS.utilCreateResponseAndBypassServer(); - oS.oResponse.headers.SetStatus(307, "Redirect"); - oS.oResponse["Location"] = "http://ccs.cdn.c.shop.nintendowifi.net" + oS.PathAndQuery; - Proxy.LogRequest(oS, this, "Redirecting to http://ccs.cdn.c.shop.nintendowifi.net" + oS.PathAndQuery); - } - } -} diff --git a/USBHelperLauncher/Program.cs b/USBHelperLauncher/Program.cs index 925f78c..2739549 100644 --- a/USBHelperLauncher/Program.cs +++ b/USBHelperLauncher/Program.cs @@ -13,14 +13,13 @@ using System.Reflection; using System.Runtime.InteropServices; using System.Security.Cryptography; -using System.ServiceModel; using System.Text; using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; using System.Windows.Forms; using System.Windows.Threading; -using USBHelperInjector.Contracts; +using USBHelperInjector.IPC; using USBHelperLauncher.Configuration; using USBHelperLauncher.Emulator; using USBHelperLauncher.Utils; @@ -68,6 +67,10 @@ static void Main(string[] args) case "showconsole": showConsole = true; break; + case "portable": + Settings.Portable = true; + Settings.Save(); + break; } } } @@ -200,9 +203,14 @@ static void Main(string[] args) Environment.Exit(-1); } - if (!File.Exists("ver") || !File.Exists("WiiU_USB_Helper.exe")) + if (!File.Exists("WiiU_USB_Helper.exe")) { - MessageBox.Show("Could not find Wii U USB Helper, please make sure this executable is in the correct folder.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show( + File.Exists("ver") + ? $"Could not find Wii U USB Helper, your Antivirus software probably deleted it. Try adding the install directory ({GetLauncherPath()}) to your Antivirus' exclusions or disable your Antivirus, then reinstall USB Helper." + : "Could not find Wii U USB Helper, please make sure you unpacked the launcher's files (e.g. USBHelperLauncher.exe) and Wii U USB Helper's files (e.g. WiiU_USB_Helper.exe) into the same directory.", + "Error", MessageBoxButtons.OK, MessageBoxIcon.Error + ); Environment.Exit(-1); } HelperVersion = File.ReadAllLines("ver")[0]; @@ -243,7 +251,8 @@ static void Main(string[] args) string executable = Path.Combine(GetLauncherPath(), "WiiU_USB_Helper.exe"); - var running = Process.GetProcessesByName("Patched").FirstOrDefault(p => p.GetMainModuleFileName().StartsWith(GetLauncherPath(), StringComparison.OrdinalIgnoreCase)); + var running = Process.GetProcessesByName("WiiU_USB_Helper_") + .FirstOrDefault(p => p.GetMainModuleFileName().StartsWith(GetLauncherPath(), StringComparison.OrdinalIgnoreCase)); if (running != default(Process)) { @@ -255,6 +264,9 @@ static void Main(string[] args) running.Kill(); } + // The target .NET version (4.5) only uses TLS 1.0 and 1.1 by default + ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12; + Proxy.Start(); // Update translations @@ -281,9 +293,13 @@ static void Main(string[] args) } }).Wait(); - ServiceHost host = new ServiceHost(typeof(LauncherService), new Uri("net.pipe://localhost/LauncherService")); - host.AddServiceEndpoint(typeof(ILauncherService), new NetNamedPipeBinding(""), ""); - host.Open(); + IPCUtil.CreateService( + Settings.IPCType, + typeof(LauncherService), + typeof(ILauncherService), + out var serviceUri + ); + Logger.WriteLine($"WCF host uri: {serviceUri}"); // Patching dialog.Invoke(new Action(() => @@ -294,8 +310,15 @@ static void Main(string[] args) })); var injector = new ModuleInitInjector(executable); executable = Path.Combine(GetLauncherPath(), "WiiU_USB_Helper_.exe"); - injector.Inject(executable); - Logger.WriteLine("Injected module initializer."); + if (injector.RequiresInject(executable)) + { + injector.Inject(executable); + Logger.WriteLine("Injected module initializer."); + } + else + { + Logger.WriteLine("Module initializer already injected."); + } dialog.Invoke(new Action(() => dialog.Close())); if (OverridePublicKey) @@ -313,7 +336,7 @@ static void Main(string[] args) var startInfo = new ProcessStartInfo() { FileName = executable, - Arguments = HelperVersion, + Arguments = string.Join(" ", HelperVersion, Settings.IPCType, serviceUri), UseShellExecute = false, RedirectStandardError = true, StandardErrorEncoding = Encoding.Default diff --git a/USBHelperLauncher/USBHelperLauncher.csproj b/USBHelperLauncher/USBHelperLauncher.csproj index 5ea9459..b69328a 100644 --- a/USBHelperLauncher/USBHelperLauncher.csproj +++ b/USBHelperLauncher/USBHelperLauncher.csproj @@ -132,7 +132,6 @@ - diff --git a/USBHelperLauncher/Utils/CitraRepoUtil.cs b/USBHelperLauncher/Utils/CitraRepoUtil.cs index 4b1d3a7..ab6c0c1 100644 --- a/USBHelperLauncher/Utils/CitraRepoUtil.cs +++ b/USBHelperLauncher/Utils/CitraRepoUtil.cs @@ -18,7 +18,6 @@ public static async Task GetPackageAsync(string branch, string platform using (WebClient client = new WebClient()) { ServicePointManager.Expect100Continue = true; - ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; client.Headers.Add("User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2;)"); try { diff --git a/USBHelperLauncher/Utils/GithubUtil.cs b/USBHelperLauncher/Utils/GithubUtil.cs index f8008c0..bf79d4b 100644 --- a/USBHelperLauncher/Utils/GithubUtil.cs +++ b/USBHelperLauncher/Utils/GithubUtil.cs @@ -13,7 +13,6 @@ public static async Task GetRelease(string user, string repo, string re using (WebClient client = new WebClient()) { ServicePointManager.Expect100Continue = true; - ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; client.Headers.Add("User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2;)"); try { diff --git a/USBHelperLauncher/Utils/SourceforgeUtil.cs b/USBHelperLauncher/Utils/SourceforgeUtil.cs index 8842357..40db950 100644 --- a/USBHelperLauncher/Utils/SourceforgeUtil.cs +++ b/USBHelperLauncher/Utils/SourceforgeUtil.cs @@ -13,7 +13,6 @@ public static async Task GetLatestRelease(string project, string platfor using (WebClient client = new WebClient()) { ServicePointManager.Expect100Continue = true; - ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; client.Headers.Add("User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2;)"); try { diff --git a/USBHelperLauncher/WiiU_USB_Helper_.exe.config b/USBHelperLauncher/WiiU_USB_Helper_.exe.config index 2c03b64..c605c0a 100644 --- a/USBHelperLauncher/WiiU_USB_Helper_.exe.config +++ b/USBHelperLauncher/WiiU_USB_Helper_.exe.config @@ -20,6 +20,9 @@ + + + \ No newline at end of file