Skip to content
This repository has been archived by the owner on Apr 30, 2020. It is now read-only.

Commit

Permalink
Moved skipProxy into the settings parser function
Browse files Browse the repository at this point in the history
  • Loading branch information
friendlyanon committed Nov 22, 2017
1 parent 2bad3ad commit 9cc6ae6
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions CFW2OFW Helper/Program.cs
Expand Up @@ -49,7 +49,6 @@ static class G
static public bool withoutEm = false;
static public bool iconNotSet = true;
static public bool cleanPatchesFolderUp = false;
static public bool skipProxy = true;
#pragma warning restore S2223
static public int Exit(string msg)
{
Expand Down Expand Up @@ -1080,6 +1079,7 @@ static void ParseSettings()
{
string[] keys = { "CopyFiles", "PauseAfterConversion", "UseGenericEbootCID", "SkipSystemProxySettings", "CheckForExclusiveMethod", "DeletePatchPkgAfterExtraction" };
var Ini = new IniFile();
bool skipProxy = true;

string key = keys[0];
if (Ini.KeyExists(key))
Expand Down Expand Up @@ -1108,11 +1108,18 @@ static void ParseSettings()
key = keys[3];
if (Ini.KeyExists(key))
{
if (Ini.Read(key).Contains("false")) G.skipProxy = false;
if (Ini.Read(key).Contains("false")) skipProxy = false;
}
else
Ini.Write(key, "True");

if (skipProxy)
{
ServicePointManager.ServerCertificateValidationCallback += delegate { return true; };
WebRequest.DefaultWebProxy = null;
G.wc.Proxy = null;
}

key = keys[4];
if (Ini.KeyExists(key))
{
Expand Down Expand Up @@ -1214,12 +1221,6 @@ static int Main(string[] args)
if (G.NoCheck)
{
ParseSettings();
if (G.skipProxy)
{
ServicePointManager.ServerCertificateValidationCallback += delegate { return true; };
WebRequest.DefaultWebProxy = null;
G.wc.Proxy = null;
}
Console.WriteLine(" --- CFW2OFW Helper v9 ---\n// https://github.com/friendlyanon/CFW2OFW-Helper/");
}
switch (args.Length)
Expand Down

0 comments on commit 9cc6ae6

Please sign in to comment.