Skip to content

Commit

Permalink
v2.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
msasanmh committed Jun 2, 2023
1 parent a1f5615 commit 10cd3d5
Show file tree
Hide file tree
Showing 7 changed files with 131 additions and 76 deletions.
142 changes: 90 additions & 52 deletions SecureDNSClient/Forms/FormMain.Designer.cs

Large diffs are not rendered by default.

56 changes: 36 additions & 20 deletions SecureDNSClient/Forms/FormMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ public partial class FormMain : Form
private bool IsDNSConnected = false;
private bool IsDoHConnected = false;
private bool IsDPIActive = false;
private bool IsProxyDPIActive = false;
private bool IsGoodbyeDPIActive = false;
private bool IsDNSSet = false;
private bool IsSharing = false;
private bool IsProxySet = false;
Expand Down Expand Up @@ -401,12 +403,15 @@ private void UpdateBools()
// Update bool IsProxySet
IsProxySet = UpdateBoolIsProxySet();

// Update bool IsProxyDPIActive
IsProxyDPIActive = (HTTPProxy != null && HTTPProxy.IsRunning && HTTPProxy.IsDpiActive);

// Update bool IsGoodbyeDPIActive
IsGoodbyeDPIActive = ProcessManager.FindProcessByID(PIDGoodbyeDPI);

// Update bool IsDPIActive
if (ProcessManager.FindProcessByID(PIDGoodbyeDPI) ||
(HTTPProxy != null && HTTPProxy.IsRunning && HTTPProxy.IsDpiActive))
IsDPIActive = true;
else
IsDPIActive = false;
IsDPIActive = (IsProxyDPIActive || IsGoodbyeDPIActive);

};
updateBoolsTimer.Start();
}
Expand Down Expand Up @@ -615,12 +620,19 @@ private void UpdateStatus()
this.InvokeIt(() => CustomRichTextBoxStatusIsDNSSet.AppendText("Is DNS Set: ", ForeColor));
this.InvokeIt(() => CustomRichTextBoxStatusIsDNSSet.AppendText(textDNS, colorDNS));

// Update Status IsDpiActive
string textDPI = IsDPIActive ? "Yes" : "No";
Color colorDPI = IsDPIActive ? Color.MediumSeaGreen : Color.IndianRed;
this.InvokeIt(() => CustomRichTextBoxStatusIsDPIActive.ResetText());
this.InvokeIt(() => CustomRichTextBoxStatusIsDPIActive.AppendText("Is DPI Active: ", ForeColor));
this.InvokeIt(() => CustomRichTextBoxStatusIsDPIActive.AppendText(textDPI, colorDPI));
// Update Status IsProxyDPIActive
string textProxyDPI = IsProxyDPIActive ? "Active" : "Inactive";
Color colorProxyDPI = IsProxyDPIActive ? Color.MediumSeaGreen : Color.IndianRed;
this.InvokeIt(() => CustomRichTextBoxStatusProxyDpiBypass.ResetText());
this.InvokeIt(() => CustomRichTextBoxStatusProxyDpiBypass.AppendText("Proxy DPI Bypass: ", ForeColor));
this.InvokeIt(() => CustomRichTextBoxStatusProxyDpiBypass.AppendText(textProxyDPI, colorProxyDPI));

// Update Status IsGoodbyeDPIActive
string textGoodbyeDPI = IsGoodbyeDPIActive ? "Active" : "Inactive";
Color colorGoodbyeDPI = IsGoodbyeDPIActive ? Color.MediumSeaGreen : Color.IndianRed;
this.InvokeIt(() => CustomRichTextBoxStatusGoodbyeDPI.ResetText());
this.InvokeIt(() => CustomRichTextBoxStatusGoodbyeDPI.AppendText("GoodbyeDPI: ", ForeColor));
this.InvokeIt(() => CustomRichTextBoxStatusGoodbyeDPI.AppendText(textGoodbyeDPI, colorGoodbyeDPI));

// Update Status IsSharing
string textSharing = IsSharing ? "Yes" : "No";
Expand Down Expand Up @@ -977,7 +989,7 @@ private async Task CheckServers()
// Warn users to deactivate DPI before checking servers
if (IsDPIActive)
{
string msg = "It's better to not check servers while DPI is active.\nStart checking servers?";
string msg = "It's better to not check servers while DPI Bypass is active.\nStart checking servers?";
var resume = CustomMessageBox.Show(msg, "DPI is active", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
if (resume == DialogResult.No) return;
}
Expand Down Expand Up @@ -2301,6 +2313,7 @@ void HTTPProxy_OnErrorOccurred(object? sender, EventArgs e)
{
// Update bool
IsSharing = false;
IsProxyDPIActive = false;

// Write deactivated message to log
string msgDiactivated = $"HTTP Proxy Server deactivated.{NL}";
Expand Down Expand Up @@ -2424,7 +2437,7 @@ private async void ApplyPDpiChanges()
int fragmentDelay = int.Parse(CustomNumericUpDownPDpiFragDelay.Value.ToString());

DPIBypass.Mode bypassMode = enableDpiBypass ? DPIBypass.Mode.Program : DPIBypass.Mode.Disable;
IsDPIActive = DPIBypassProgram.DPIBypassMode == DPIBypass.Mode.Program;
IsProxyDPIActive = DPIBypassProgram.DPIBypassMode == DPIBypass.Mode.Program;

DPIBypassProgram.Set(bypassMode, dataLength, fragmentSize, fragmentChunks, fragmentDelay);
DPIBypassProgram.DontChunkTheBiggestRequest = dontChunkBigdata;
Expand All @@ -2434,7 +2447,7 @@ private async void ApplyPDpiChanges()
// Check DPI Works
if (CustomCheckBoxPDpiEnableDpiBypass.Checked && HTTPProxy.IsRunning)
{
IsDPIActive = true;
IsProxyDPIActive = true;
Task.Delay(100).Wait();
// Get and check blocked domain is valid
bool isBlockedDomainValid = SecureDNS.IsBlockedDomainValid(CustomTextBoxSettingCheckDPIHost, CustomRichTextBoxLog, out string blockedDomain);
Expand Down Expand Up @@ -2552,8 +2565,8 @@ private async void DPIBasic()
// Update Groupbox Status
UpdateStatus();

// Set DPI Active true
IsDPIActive = true;
// Set IsGoodbyeDPIActive true
IsGoodbyeDPIActive = true;

// Go to SetDNS Tab if it's not already set
if (ConnectAllClicked && !IsDNSSet)
Expand Down Expand Up @@ -2763,8 +2776,8 @@ private async void DPIAdvanced()
// Update Groupbox Status
UpdateStatus();

// Set DPI Active true
IsDPIActive = true;
// Set IsGoodbyeDPIActive true
IsGoodbyeDPIActive = true;

// Go to SetDNS Tab if it's not already set
if (ConnectAllClicked && !IsDNSSet)
Expand Down Expand Up @@ -2802,6 +2815,9 @@ private void DPIDeactive()
}
else
{
// Set IsGoodbyeDPIActive False
IsGoodbyeDPIActive = false;

string msgDC = "DPI bypass deactivated." + NL;
this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msgDC, Color.LightGray));
}
Expand Down Expand Up @@ -2834,7 +2850,7 @@ private async Task CheckDPIWorks(string host, int timeoutSec = 30) //Default tim
string url = $"https://{host}/";
Uri uri = new(url, UriKind.Absolute);

if (HTTPProxy != null && HTTPProxy.IsRunning && HTTPProxy.IsDpiActive && IsSharing)
if (IsProxyDPIActive)
{
string proxyScheme = $"http://{IPAddress.Loopback}:{LastProxyPort}";
using SocketsHttpHandler socketsHttpHandler = new();
Expand Down Expand Up @@ -2909,7 +2925,7 @@ void msgFailed(HttpResponseMessage r)
{
// Write activate DPI first to log
string msgDPI1 = $"DPI Check: ";
string msgDPI2 = $"Activate DPI to check.{NL}";
string msgDPI2 = $"Activate DPI Bypass to check.{NL}";
this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msgDPI1, Color.LightGray));
this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msgDPI2, Color.IndianRed));
StopWatchCheckDPIWorks.Stop();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public HTTPProxyServer()
{
// Captive Portal
BlackList.Add("ipv6.msftconnecttest.com:80");
BlackList.Add("msedge.b.tlu.dl.delivery.mp.microsoft.com:80");
BlackList.Add("detectportal.firefox.com:80");
BlackList.Add("gstatic.com:80");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<History>True|2023-06-02T12:45:42.7452611Z;True|2023-05-30T17:58:01.2450123+04:30;True|2023-05-29T20:36:32.5291896+04:30;True|2023-05-29T20:18:12.2031439+04:30;True|2023-05-29T19:44:46.0704739+04:30;True|2023-05-27T17:25:56.0498058+04:30;True|2023-05-27T14:50:19.0862471+04:30;True|2023-05-26T00:33:02.8133052+04:30;True|2023-05-26T00:22:55.5762345+04:30;True|2023-05-19T21:55:55.2053137+04:30;True|2023-05-04T21:14:13.1959990+04:30;True|2023-05-03T18:38:41.0925495+04:30;True|2023-05-03T18:22:56.1278337+04:30;True|2023-04-07T19:23:03.7575436+04:30;True|2023-04-07T19:01:53.8374192+04:30;True|2023-04-07T18:56:48.3465035+04:30;True|2023-02-23T19:42:36.6931238+03:30;True|2023-02-21T23:02:29.4417103+03:30;True|2023-02-21T22:58:29.4403662+03:30;True|2023-02-21T22:48:24.4128535+03:30;True|2023-02-21T22:27:17.9388815+03:30;True|2023-02-20T17:48:08.6532315+03:30;True|2023-02-16T01:42:22.8837631+03:30;True|2023-02-16T01:39:16.7954793+03:30;True|2023-02-15T21:24:18.8085514+03:30;True|2023-02-15T21:18:04.1969211+03:30;True|2023-02-15T21:15:01.3739223+03:30;True|2023-02-08T06:22:33.0414550+03:30;True|2023-02-08T05:20:18.9270105+03:30;True|2023-02-08T05:15:17.5374116+03:30;True|2023-02-08T05:03:44.0882459+03:30;True|2023-02-08T04:53:40.5516012+03:30;True|2023-02-08T02:23:19.0633758+03:30;</History>
<History>True|2023-06-02T16:21:04.1304394Z;True|2023-06-02T20:25:56.5067353+04:30;True|2023-06-02T20:22:14.1787902+04:30;True|2023-06-02T17:15:42.7452611+04:30;True|2023-05-30T17:58:01.2450123+04:30;True|2023-05-29T20:36:32.5291896+04:30;True|2023-05-29T20:18:12.2031439+04:30;True|2023-05-29T19:44:46.0704739+04:30;True|2023-05-27T17:25:56.0498058+04:30;True|2023-05-27T14:50:19.0862471+04:30;True|2023-05-26T00:33:02.8133052+04:30;True|2023-05-26T00:22:55.5762345+04:30;True|2023-05-19T21:55:55.2053137+04:30;True|2023-05-04T21:14:13.1959990+04:30;True|2023-05-03T18:38:41.0925495+04:30;True|2023-05-03T18:22:56.1278337+04:30;True|2023-04-07T19:23:03.7575436+04:30;True|2023-04-07T19:01:53.8374192+04:30;True|2023-04-07T18:56:48.3465035+04:30;True|2023-02-23T19:42:36.6931238+03:30;True|2023-02-21T23:02:29.4417103+03:30;True|2023-02-21T22:58:29.4403662+03:30;True|2023-02-21T22:48:24.4128535+03:30;True|2023-02-21T22:27:17.9388815+03:30;True|2023-02-20T17:48:08.6532315+03:30;True|2023-02-16T01:42:22.8837631+03:30;True|2023-02-16T01:39:16.7954793+03:30;True|2023-02-15T21:24:18.8085514+03:30;True|2023-02-15T21:18:04.1969211+03:30;True|2023-02-15T21:15:01.3739223+03:30;True|2023-02-08T06:22:33.0414550+03:30;True|2023-02-08T05:20:18.9270105+03:30;True|2023-02-08T05:15:17.5374116+03:30;True|2023-02-08T05:03:44.0882459+03:30;True|2023-02-08T04:53:40.5516012+03:30;True|2023-02-08T02:23:19.0633758+03:30;</History>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion SecureDNSClient/SecureDNSClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<ApplicationManifest>app.manifest</ApplicationManifest>
<Copyright>MSasanMH</Copyright>
<Product>SDC - Secure DNS Client</Product>
<Version>$(VersionPrefix)2.1.4</Version>
<Version>$(VersionPrefix)2.1.5</Version>
<PackageIcon>SecureDNSClient.png</PackageIcon>
<ApplicationIcon>SecureDNSClientMulti.ico</ApplicationIcon>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<History>True|2023-06-02T12:44:48.5208600Z;True|2023-05-30T17:57:19.0001069+04:30;True|2023-05-29T20:17:44.2223328+04:30;True|2023-05-29T19:43:15.8911213+04:30;True|2023-05-27T17:25:27.9631407+04:30;True|2023-05-27T14:50:40.9938592+04:30;True|2023-05-26T00:22:04.4226759+04:30;True|2023-05-19T21:55:03.6988953+04:30;True|2023-05-04T21:13:44.0531282+04:30;True|2023-05-03T18:20:58.6158351+04:30;True|2023-04-07T19:22:18.1443242+04:30;True|2023-04-07T19:01:23.1687551+04:30;True|2023-04-07T18:56:25.8534493+04:30;True|2023-02-23T19:42:03.7111255+03:30;True|2023-02-21T22:26:35.4429594+03:30;True|2023-02-20T17:47:25.0792312+03:30;True|2023-02-16T01:42:37.6467629+03:30;True|2023-02-15T22:16:38.0474815+03:30;True|2023-02-15T21:50:25.4952184+03:30;True|2023-02-15T21:49:01.8562159+03:30;</History>
<History>True|2023-06-02T16:20:27.6325136Z;True|2023-06-02T20:25:16.8004627+04:30;True|2023-06-02T20:21:33.2641926+04:30;True|2023-06-02T17:14:48.5208600+04:30;True|2023-05-30T17:57:19.0001069+04:30;True|2023-05-29T20:17:44.2223328+04:30;True|2023-05-29T19:43:15.8911213+04:30;True|2023-05-27T17:25:27.9631407+04:30;True|2023-05-27T14:50:40.9938592+04:30;True|2023-05-26T00:22:04.4226759+04:30;True|2023-05-19T21:55:03.6988953+04:30;True|2023-05-04T21:13:44.0531282+04:30;True|2023-05-03T18:20:58.6158351+04:30;True|2023-04-07T19:22:18.1443242+04:30;True|2023-04-07T19:01:23.1687551+04:30;True|2023-04-07T18:56:25.8534493+04:30;True|2023-02-23T19:42:03.7111255+03:30;True|2023-02-21T22:26:35.4429594+03:30;True|2023-02-20T17:47:25.0792312+03:30;True|2023-02-16T01:42:37.6467629+03:30;True|2023-02-15T22:16:38.0474815+03:30;True|2023-02-15T21:50:25.4952184+03:30;True|2023-02-15T21:49:01.8562159+03:30;</History>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion SecureDNSClientPortable/SecureDNSClientPortable.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
<ApplicationIcon>SecureDNSClientMulti.ico</ApplicationIcon>
<Version>$(VersionPrefix)2.1.4</Version>
<Version>$(VersionPrefix)2.1.5</Version>
<Copyright>MSasanMH</Copyright>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
Expand Down

0 comments on commit 10cd3d5

Please sign in to comment.