Skip to content

Commit

Permalink
EZBlocker 1.8
Browse files Browse the repository at this point in the history
- Enhance ad detection logic
- Podcasts are no longer muted
- Remove unused dependencies
  • Loading branch information
Xeroday committed Oct 31, 2021
1 parent a985319 commit 85c47bb
Show file tree
Hide file tree
Showing 48 changed files with 87 additions and 431 deletions.
4 changes: 1 addition & 3 deletions .gitignore
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,4 @@ $RECYCLE.BIN/
.DS_Store

#Private files
#EZBlocker/EZBlocker/AudioUtilities.cs#
#EZBlocker/EZBlocker/Volume.cs
signing.txt
signing.txt
Empty file modified EZBlocker/EZBlocker.sln
100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions EZBlocker/EZBlocker/Analytics.cs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Globalization;
using System.Net.Http;
using System.Threading.Tasks;
using System.Management;

namespace EZBlocker
{
Expand Down
20 changes: 10 additions & 10 deletions EZBlocker/EZBlocker/App.config
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="EZBlocker.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
<section name="EZBlocker.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
</startup>
<userSettings>
<EZBlocker.Properties.Settings>
<setting name="CID" serializeAs="String">
<value />
<value/>
</setting>
<setting name="UpdateSettings" serializeAs="String">
<value>True</value>
Expand All @@ -23,27 +23,27 @@
<value>True</value>
</setting>
<setting name="LastPatched" serializeAs="String">
<value />
<value/>
</setting>
<setting name="SpotifyPath" serializeAs="String">
<value />
<value/>
</setting>
</EZBlocker.Properties.Settings>
</userSettings>
<appSettings>
<add key="EnableWindowsFormsHighDpiAutoResizing" value="true" />
<add key="ClientSettingsProvider.ServiceUri" value="" />
<add key="EnableWindowsFormsHighDpiAutoResizing" value="true"/>
<add key="ClientSettingsProvider.ServiceUri" value=""/>
</appSettings>
<system.web>
<membership defaultProvider="ClientAuthenticationMembershipProvider">
<providers>
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri=""/>
</providers>
</membership>
<roleManager defaultProvider="ClientRoleProvider" enabled="true">
<providers>
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400"/>
</providers>
</roleManager>
</system.web>
</configuration>
</configuration>
Empty file modified EZBlocker/EZBlocker/AudioUtils.cs
100644 → 100755
Empty file.
40 changes: 17 additions & 23 deletions EZBlocker/EZBlocker/EZBlocker.csproj
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>EZBlocker</RootNamespace>
<AssemblyName>EZBlocker</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<IsWebBootstrapper>false</IsWebBootstrapper>
Expand Down Expand Up @@ -75,14 +75,7 @@
<SignManifests>false</SignManifests>
</PropertyGroup>
<ItemGroup>
<Reference Include="Costura, Version=1.6.2.0, Culture=neutral, PublicKeyToken=9919ef960d84173d, processorArchitecture=MSIL">
<HintPath>..\packages\Costura.Fody.1.6.2\lib\dotnet\Costura.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ICSharpCode.SharpZipLib, Version=0.86.0.518, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL">
<HintPath>..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" />
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Drawing" />
Expand Down Expand Up @@ -111,19 +104,16 @@
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SpotifyHook.cs" />
<Compile Include="SpotifyPatcher.cs" />
<EmbeddedResource Include="EZBlockerMain.resx">
<DependentUpon>EZBlockerMain.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Properties\strings.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>strings.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<None Include="app.manifest" />
<None Include="packages.config">
<SubType>Designer</SubType>
</None>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
Expand All @@ -138,7 +128,6 @@
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<None Include="FodyWeavers.xml" />
<Content Include="my_music.ico" />
</ItemGroup>
<ItemGroup>
Expand Down Expand Up @@ -167,16 +156,21 @@
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Windows.SDK.Contracts">
<Version>10.0.22000.196</Version>
</PackageReference>
<PackageReference Include="System.Runtime.InteropServices.WindowsRuntime">
<Version>4.3.0</Version>
</PackageReference>
<PackageReference Include="System.Runtime.WindowsRuntime">
<Version>4.6.0</Version>
</PackageReference>
<PackageReference Include="System.Runtime.WindowsRuntime.UI.Xaml">
<Version>4.6.0</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Fody.2.0.0\build\dotnet\Fody.targets" Condition="Exists('..\packages\Fody.2.0.0\build\dotnet\Fody.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Fody.2.0.0\build\dotnet\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.2.0.0\build\dotnet\Fody.targets'))" />
<Error Condition="!Exists('..\packages\Costura.Fody.1.6.2\build\dotnet\Costura.Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.1.6.2\build\dotnet\Costura.Fody.targets'))" />
</Target>
<Import Project="..\packages\Costura.Fody.1.6.2\build\dotnet\Costura.Fody.targets" Condition="Exists('..\packages\Costura.Fody.1.6.2\build\dotnet\Costura.Fody.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
10 changes: 0 additions & 10 deletions EZBlocker/EZBlocker/EZBlockerMain.Designer.cs
100644 → 100755

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 2 additions & 22 deletions EZBlocker/EZBlocker/EZBlockerMain.cs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ public partial class Main : Form
private Analytics a;
private DateTime lastRequest;
private string lastAction = "";
private SpotifyPatcher patcher;
private Listener listener;
private SpotifyHook hook;

public Main()
Expand Down Expand Up @@ -72,7 +70,7 @@ private void MainTimer_Tick(object sender, EventArgs e)
{
if (muted)
{
Thread.Sleep(500); // Give extra time for ad to change out
Thread.Sleep(200); // Give extra time for ad to change out
Mute(false);
}
if (MainTimer.Interval != 200) MainTimer.Interval = 200;
Expand Down Expand Up @@ -244,10 +242,6 @@ private void Main_Load(object sender, EventArgs e)
// Start Spotify hook
hook = new SpotifyHook();

/* Start EZBlocker listener
listener = new Listener();
Task.Run(() => listener.Listen()); */

MainTimer.Enabled = true;

LogAction("/launch");
Expand Down Expand Up @@ -405,21 +399,6 @@ private void websiteToolStripMenuItem_Click(object sender, EventArgs e)
Process.Start(website);
}

private void undoPatchToolStripMenuItem_Click(object sender, EventArgs e)
{
Properties.Settings.Default.LastPatched = "";
Properties.Settings.Default.Save();

if (patcher.Restore())
{
MessageBox.Show(Properties.strings.UndoPatchOKMessageBox, "EZBlocker");
}
else
{
MessageBox.Show(Properties.strings.UndoPatchFailMessageBox, "EZBlocker");
}
}

protected override void OnFormClosing(FormClosingEventArgs e)
{
if (!MainTimer.Enabled) return; // Still setting up UI
Expand All @@ -441,5 +420,6 @@ protected override void OnFormClosing(FormClosingEventArgs e)

[DllImport("shell32.dll")]
public static extern bool IsUserAnAdmin();

}
}
Loading

0 comments on commit 85c47bb

Please sign in to comment.