[
  {
    "path": ".gitignore",
    "content": "## Ignore Visual Studio temporary files, build results, and\n## files generated by popular Visual Studio add-ons.\n##\n## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore\n\n# User-specific files\n*.rsuser\n*.suo\n*.user\n*.userosscache\n*.sln.docstates\n\n# User-specific files (MonoDevelop/Xamarin Studio)\n*.userprefs\n\n# Mono auto generated files\nmono_crash.*\n\n# Build results\n[Dd]ebug/\n[Dd]ebugPublic/\n[Rr]elease/\n[Rr]eleases/\nx64/\nx86/\n[Ww][Ii][Nn]32/\n[Aa][Rr][Mm]/\n[Aa][Rr][Mm]64/\nbld/\n[Bb]in/\n[Oo]bj/\n[Oo]ut/\n[Ll]og/\n[Ll]ogs/\n\n# Visual Studio 2015/2017 cache/options directory\n.vs/\n# Uncomment if you have tasks that create the project's static files in wwwroot\n#wwwroot/\n\n# Visual Studio 2017 auto generated files\nGenerated\\ Files/\n\n# MSTest test Results\n[Tt]est[Rr]esult*/\n[Bb]uild[Ll]og.*\n\n# NUnit\n*.VisualState.xml\nTestResult.xml\nnunit-*.xml\n\n# Build Results of an ATL Project\n[Dd]ebugPS/\n[Rr]eleasePS/\ndlldata.c\n\n# Benchmark Results\nBenchmarkDotNet.Artifacts/\n\n# .NET Core\nproject.lock.json\nproject.fragment.lock.json\nartifacts/\n\n# ASP.NET Scaffolding\nScaffoldingReadMe.txt\n\n# StyleCop\nStyleCopReport.xml\n\n# Files built by Visual Studio\n*_i.c\n*_p.c\n*_h.h\n*.ilk\n*.meta\n*.obj\n*.iobj\n*.pch\n*.pdb\n*.ipdb\n*.pgc\n*.pgd\n*.rsp\n*.sbr\n*.tlb\n*.tli\n*.tlh\n*.tmp\n*.tmp_proj\n*_wpftmp.csproj\n*.log\n*.vspscc\n*.vssscc\n.builds\n*.pidb\n*.svclog\n*.scc\n\n# Chutzpah Test files\n_Chutzpah*\n\n# Visual C++ cache files\nipch/\n*.aps\n*.ncb\n*.opendb\n*.opensdf\n*.sdf\n*.cachefile\n*.VC.db\n*.VC.VC.opendb\n\n# Visual Studio profiler\n*.psess\n*.vsp\n*.vspx\n*.sap\n\n# Visual Studio Trace Files\n*.e2e\n\n# TFS 2012 Local Workspace\n$tf/\n\n# Guidance Automation Toolkit\n*.gpState\n\n# ReSharper is a .NET coding add-in\n_ReSharper*/\n*.[Rr]e[Ss]harper\n*.DotSettings.user\n\n# TeamCity is a build add-in\n_TeamCity*\n\n# DotCover is a Code Coverage Tool\n*.dotCover\n\n# AxoCover is a Code Coverage Tool\n.axoCover/*\n!.axoCover/settings.json\n\n# Coverlet is a free, cross platform Code Coverage Tool\ncoverage*.json\ncoverage*.xml\ncoverage*.info\n\n# Visual Studio code coverage results\n*.coverage\n*.coveragexml\n\n# NCrunch\n_NCrunch_*\n.*crunch*.local.xml\nnCrunchTemp_*\n\n# MightyMoose\n*.mm.*\nAutoTest.Net/\n\n# Web workbench (sass)\n.sass-cache/\n\n# Installshield output folder\n[Ee]xpress/\n\n# DocProject is a documentation generator add-in\nDocProject/buildhelp/\nDocProject/Help/*.HxT\nDocProject/Help/*.HxC\nDocProject/Help/*.hhc\nDocProject/Help/*.hhk\nDocProject/Help/*.hhp\nDocProject/Help/Html2\nDocProject/Help/html\n\n# Click-Once directory\npublish/\n\n# Publish Web Output\n*.[Pp]ublish.xml\n*.azurePubxml\n# Note: Comment the next line if you want to checkin your web deploy settings,\n# but database connection strings (with potential passwords) will be unencrypted\n*.pubxml\n*.publishproj\n\n# Microsoft Azure Web App publish settings. Comment the next line if you want to\n# checkin your Azure Web App publish settings, but sensitive information contained\n# in these scripts will be unencrypted\nPublishScripts/\n\n# NuGet Packages\n*.nupkg\n# NuGet Symbol Packages\n*.snupkg\n# The packages folder can be ignored because of Package Restore\n**/[Pp]ackages/*\n# except build/, which is used as an MSBuild target.\n!**/[Pp]ackages/build/\n# Uncomment if necessary however generally it will be regenerated when needed\n#!**/[Pp]ackages/repositories.config\n# NuGet v3's project.json files produces more ignorable files\n*.nuget.props\n*.nuget.targets\n\n# Microsoft Azure Build Output\ncsx/\n*.build.csdef\n\n# Microsoft Azure Emulator\necf/\nrcf/\n\n# Windows Store app package directories and files\nAppPackages/\nBundleArtifacts/\nPackage.StoreAssociation.xml\n_pkginfo.txt\n*.appx\n*.appxbundle\n*.appxupload\n\n# Visual Studio cache files\n# files ending in .cache can be ignored\n*.[Cc]ache\n# but keep track of directories ending in .cache\n!?*.[Cc]ache/\n\n# Others\nClientBin/\n~$*\n*~\n*.dbmdl\n*.dbproj.schemaview\n*.jfm\n*.pfx\n*.publishsettings\norleans.codegen.cs\n\n# Including strong name files can present a security risk\n# (https://github.com/github/gitignore/pull/2483#issue-259490424)\n#*.snk\n\n# Since there are multiple workflows, uncomment next line to ignore bower_components\n# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)\n#bower_components/\n\n# RIA/Silverlight projects\nGenerated_Code/\n\n# Backup & report files from converting an old project file\n# to a newer Visual Studio version. Backup files are not needed,\n# because we have git ;-)\n_UpgradeReport_Files/\nBackup*/\nUpgradeLog*.XML\nUpgradeLog*.htm\nServiceFabricBackup/\n*.rptproj.bak\n\n# SQL Server files\n*.mdf\n*.ldf\n*.ndf\n\n# Business Intelligence projects\n*.rdl.data\n*.bim.layout\n*.bim_*.settings\n*.rptproj.rsuser\n*- [Bb]ackup.rdl\n*- [Bb]ackup ([0-9]).rdl\n*- [Bb]ackup ([0-9][0-9]).rdl\n\n# Microsoft Fakes\nFakesAssemblies/\n\n# GhostDoc plugin setting file\n*.GhostDoc.xml\n\n# Node.js Tools for Visual Studio\n.ntvs_analysis.dat\nnode_modules/\n\n# Visual Studio 6 build log\n*.plg\n\n# Visual Studio 6 workspace options file\n*.opt\n\n# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)\n*.vbw\n\n# Visual Studio LightSwitch build output\n**/*.HTMLClient/GeneratedArtifacts\n**/*.DesktopClient/GeneratedArtifacts\n**/*.DesktopClient/ModelManifest.xml\n**/*.Server/GeneratedArtifacts\n**/*.Server/ModelManifest.xml\n_Pvt_Extensions\n\n# Paket dependency manager\n.paket/paket.exe\npaket-files/\n\n# FAKE - F# Make\n.fake/\n\n# CodeRush personal settings\n.cr/personal\n\n# Python Tools for Visual Studio (PTVS)\n__pycache__/\n*.pyc\n\n# Cake - Uncomment if you are using it\n# tools/**\n# !tools/packages.config\n\n# Tabs Studio\n*.tss\n\n# Telerik's JustMock configuration file\n*.jmconfig\n\n# BizTalk build output\n*.btp.cs\n*.btm.cs\n*.odx.cs\n*.xsd.cs\n\n# OpenCover UI analysis results\nOpenCover/\n\n# Azure Stream Analytics local run output\nASALocalRun/\n\n# MSBuild Binary and Structured Log\n*.binlog\n\n# NVidia Nsight GPU debugger configuration file\n*.nvuser\n\n# MFractors (Xamarin productivity tool) working folder\n.mfractor/\n\n# Local History for Visual Studio\n.localhistory/\n\n# BeatPulse healthcheck temp database\nhealthchecksdb\n\n# Backup folder for Package Reference Convert tool in Visual Studio 2017\nMigrationBackup/\n\n# Ionide (cross platform F# VS Code tools) working folder\n.ionide/\n\n# Fody - auto-generated XML schema\nFodyWeavers.xsd"
  },
  {
    "path": "App.xaml",
    "content": "﻿<Application x:Class=\"OFGB.App\"\n             xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n             StartupUri=\"MainWindow.xaml\">\n    <Application.Resources>\n        <ResourceDictionary>\n            <ResourceDictionary.MergedDictionaries>\n                <ResourceDictionary Source=\"dark.xaml\" />\n            </ResourceDictionary.MergedDictionaries>\n        </ResourceDictionary>\n    </Application.Resources>\n</Application>\n"
  },
  {
    "path": "App.xaml.cs",
    "content": "﻿using System.Windows;\n\nnamespace OFGB\n{\n    /// <summary>\n    /// Interaction logic for App.xaml\n    /// </summary>\n    public partial class App : Application\n    {\n\n    }\n}\n"
  },
  {
    "path": "AssemblyInfo.cs",
    "content": "using System.Windows;\n\n[assembly: ThemeInfo(\n    ResourceDictionaryLocation.None,\n    ResourceDictionaryLocation.SourceAssembly\n)]\n"
  },
  {
    "path": "LICENSE",
    "content": "This is free and unencumbered software released into the public domain.\n\nAnyone is free to copy, modify, publish, use, compile, sell, or\ndistribute this software, either in source code form or as a compiled\nbinary, for any purpose, commercial or non-commercial, and by any\nmeans.\n\nIn jurisdictions that recognize copyright laws, the author or authors\nof this software dedicate any and all copyright interest in the\nsoftware to the public domain. We make this dedication for the benefit\nof the public at large and to the detriment of our heirs and\nsuccessors. We intend this dedication to be an overt act of\nrelinquishment in perpetuity of all present and future rights to this\nsoftware under copyright law.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR\nOTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,\nARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n\nFor more information, please refer to <https://unlicense.org>\n"
  },
  {
    "path": "MainWindow.xaml",
    "content": "﻿<Window x:Class=\"OFGB.MainWindow\"\n        xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n        xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n        xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n        xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n        mc:Ignorable=\"d\"\n        Background=\"#1E1E2E\"\n        ResizeMode=\"NoResize\"\n        WindowStartupLocation=\"CenterScreen\"\n        WindowStyle=\"None\"\n        Title=\"OFGB\"\n        SizeToContent=\"WidthAndHeight\">\n    <WindowChrome.WindowChrome>\n        <WindowChrome\n            CaptionHeight=\"32\"\n            CornerRadius=\"0\"\n            GlassFrameThickness=\"0\"\n            UseAeroCaptionButtons=\"False\" />\n    </WindowChrome.WindowChrome>\n    <Grid>\n        <Image Source=\"/Assets/OFGB.png\" SnapsToDevicePixels=\"True\" Panel.ZIndex=\"1\" Margin=\"8,8,0,0\" Height=\"16\" VerticalAlignment=\"Top\" HorizontalAlignment=\"Left\" />\n        <Button Content=\"&#xe8bb;\" x:Name=\"close\" FontSize=\"10\" Panel.ZIndex=\"1\" Width=\"40\" Click=\"Close\" Height=\"32\" WindowChrome.IsHitTestVisibleInChrome=\"True\" />\n\n        <CheckBox x:Name=\"cb1\"  Margin=\"8,32,0,0\"  Checked=\"Checked\" Unchecked=\"Unchecked\" Content=\"Disable File Explorer Ads\" />\n        <CheckBox x:Name=\"cb2\"  Margin=\"8,52,0,0\"  Checked=\"Checked\" Unchecked=\"Unchecked\" Content=\"Disable Lock Screen Tips and Ads\" />\n        <CheckBox x:Name=\"cb3\"  Margin=\"8,72,0,0\"  Checked=\"Checked\" Unchecked=\"Unchecked\" Content=\"Disable Settings Ads\" />\n        <CheckBox x:Name=\"cb4\"  Margin=\"8,92,0,0\"  Checked=\"Checked\" Unchecked=\"Unchecked\" Content=\"Disable General Tips and Ads\" /> \n        <CheckBox x:Name=\"cb5\"  Margin=\"8,112,0,0\" Checked=\"Checked\" Unchecked=\"Unchecked\" Content=\"Disable &quot;Finish Setup&quot; Ads\" />\n        <CheckBox x:Name=\"cb6\"  Margin=\"8,132,0,0\" Checked=\"Checked\" Unchecked=\"Unchecked\" Content=\"Disable &quot;Welcome Experience&quot; Ads\" />\n        <CheckBox x:Name=\"cb7\"  Margin=\"8,152,0,0\" Checked=\"Checked\" Unchecked=\"Unchecked\" Content=\"Disable Personalized Ads\" />\n        <CheckBox x:Name=\"cb8\"  Margin=\"8,172,0,0\" Checked=\"Checked\" Unchecked=\"Unchecked\" Content=\"Disable &quot;Tailored Experiences&quot;\" />\n        <CheckBox x:Name=\"cb9\"  Margin=\"8,192,0,0\" Checked=\"Checked\" Unchecked=\"Unchecked\" Content=\"Disable Start Menu Ads\" />\n        <CheckBox x:Name=\"cb10\" Margin=\"8,212,0,0\" Checked=\"Checked\" Unchecked=\"Unchecked\" Content=\"Disable &quot;Notification Suggestions&quot;\" />\n\n        <Rectangle HorizontalAlignment=\"Stretch\" Margin=\"8,234,8,0\" Fill=\"Gray\" Height=\"0.9\" VerticalAlignment=\"Top\" />\n        <TextBlock Foreground=\"#F5C2E7\" Width=\"210\" Margin=\"9,240,0,0\" Text=\"These require running as admin.\"/>\n\n        <CheckBox x:Name=\"cb11\" Margin=\"8,262,0,0\" Checked=\"Checked\" Unchecked=\"Unchecked\" Content=\"Disable Bing Results In Search\" />\n        <CheckBox x:Name=\"cb12\" Margin=\"8,282,0,0\" Checked=\"Checked\" Unchecked=\"Unchecked\" Padding=\"4,-1,10,23\"  Content=\"Disable Edge Search Bar Widget\" />\n\n        <TextBlock Foreground=\"Gray\" FontSize=\"12\" HorizontalAlignment=\"Right\" VerticalAlignment=\"Bottom\" TextAlignment=\"Left\" Margin=\"0,0,8,5\" TextWrapping=\"Wrap\" Text=\"v0.4\"/>\n    </Grid>\n</Window>\n"
  },
  {
    "path": "MainWindow.xaml.cs",
    "content": "﻿using Microsoft.Win32;\nusing System;\nusing System.Windows;\nusing System.Windows.Interop;\nusing System.Runtime.InteropServices;\nusing System.Windows.Controls;\nusing System.Security.Principal;\n\nnamespace OFGB\n{\n    /// <summary>\n    /// Interaction logic for MainWindow.xaml\n    /// </summary>\n\n    public partial class MainWindow : Window\n    {\n        [LibraryImport(\"dwmapi.dll\", EntryPoint = \"DwmSetWindowAttribute\")]\n        internal static partial int DwmSetWindowAttribute(IntPtr hwnd, int attr, [In] int[] attrValue, int attrSize);\n\n        const string cur_ver = \"Software\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\\";\n\n        public MainWindow()\n        {\n            InitializeComponent();\n            InitializeKeys();\n\n            DwmSetWindowAttribute(new WindowInteropHelper(Application.Current.MainWindow).EnsureHandle(), 33, [2], sizeof(int));\n        }\n\n        private void InitializeKeys()\n        {\n            // Sync provider notifications in File Explorer\n            bool key1 = CreateKey(cur_ver + \"Explorer\\\\Advanced\", \"ShowSyncProviderNotifications\");\n            cb1.IsChecked = key1;\n\n            // Get fun facts, tips, tricks, and more on your lock screen\n            bool key2 = CreateKey(cur_ver + \"ContentDeliveryManager\", \"RotatingLockScreenOverlayEnabled\");\n            bool key3 = CreateKey(cur_ver + \"ContentDeliveryManager\", \"SubscribedContent-338387Enabled\");\n            cb2.IsChecked = key2 && key3;\n\n            // Show suggested content in Settings app\n            bool key4 = CreateKey(cur_ver + \"ContentDeliveryManager\", \"SubscribedContent-338393Enabled\");\n            bool key5 = CreateKey(cur_ver + \"ContentDeliveryManager\", \"SubscribedContent-353694Enabled\");\n            bool key6 = CreateKey(cur_ver + \"ContentDeliveryManager\", \"SubscribedContent-353696Enabled\");\n            cb3.IsChecked = key4 && key5 && key6;\n\n            // Get tips and suggestions when using Windows\n            bool key7 = CreateKey(cur_ver + \"ContentDeliveryManager\", \"SubscribedContent-338389Enabled\");\n            cb4.IsChecked = key7;\n\n            // Suggest ways to get the most out of Windows and finish setting up this device\n            bool key8 = CreateKey(cur_ver + \"UserProfileEngagement\", \"ScoobeSystemSettingEnabled\");\n            cb5.IsChecked = key8;\n\n            // Show me the Windows welcome experience after updates and occasionally when I sign in to highlight what's new and suggested\n            bool key9 = CreateKey(cur_ver + \"ContentDeliveryManager\", \"SubscribedContent-310093Enabled\");\n            cb6.IsChecked = key9;\n\n            // Let apps show me personalized ads by using my advertising ID\n            bool key10 = CreateKey(cur_ver + \"AdvertisingInfo\", \"Enabled\");\n            cb7.IsChecked = key10;\n\n            // Tailored experiences\n            bool key11 = CreateKey(cur_ver + \"Privacy\", \"TailoredExperiencesWithDiagnosticDataEnabled\");\n            cb8.IsChecked = key11;\n\n            // \"Show recommendations for tips, shortcuts, new apps, and more\" on Start\n            bool key12 = CreateKey(cur_ver + \"Explorer\\\\Advanced\", \"Start_IrisRecommendations\");\n            cb9.IsChecked = key12;\n\n            // \"Turn off notifications from <app>? We noticed you haven't opened these in a while.\"\n            bool key13 = CreateKey(cur_ver + \"Notifications\\\\Settings\\\\Windows.ActionCenter.SmartOptOut\", \"Enabled\");\n            cb10.IsChecked = key13;\n\n            // These Need To Be Run As Administrator\n            if (IsRunningAsAdministrator())\n            {\n                // Show Bing Results in Windows Search (Inverted, 1 == Disabled)\n                bool key14 = CreateKey(\"Software\\\\Policies\\\\Microsoft\\\\Windows\\\\Explorer\", \"DisableSearchBoxSuggestions\");\n                bool key15 = CreateKey(cur_ver + \"Search\", \"BingSearchEnabled\");\n                cb11.IsChecked = !key14 && key15;\n\n                // Disable Edge desktop search widget bar\n                bool key16 = CreateKey(\"Software\\\\Policies\\\\Microsoft\\\\Edge\", \"WebWidgetAllowed\");\n                cb12.IsChecked = key16;\n            }\n            else\n            {\n                cb11.IsEnabled = false;\n                cb12.IsEnabled = false;\n            }\n        }\n\n        private static bool CreateKey(string loc, string key)\n        {\n            RegistryKey? keyRef;\n            bool value;\n\n            if (Registry.CurrentUser.OpenSubKey(loc, true) is not null)\n            {\n                keyRef = Registry.CurrentUser.OpenSubKey(loc, true);\n            }\n            else\n            {\n                keyRef = Registry.CurrentUser.CreateSubKey(loc);\n                keyRef.SetValue(key, 0);\n            }\n\n            if (keyRef is null)\n            {\n                MessageBox.Show(\"Failed to create a registry subkey during initialization!\", \"OFGB: Fatal Error\", MessageBoxButton.OK, MessageBoxImage.Error);\n                throw new InvalidOperationException(\"OFGB: Failed to create subkey during initialization!\");\n            }\n\n            value = Convert.ToBoolean(keyRef.GetValue(key));\n            keyRef.Close();\n\n            return value;\n        }\n\n        private static void ToggleOptions(string checkboxName, bool enable)\n        {\n            switch (checkboxName)\n            {\n                case \"cb1\":\n                    Registry.SetValue(\"HKEY_CURRENT_USER\\\\\" + cur_ver + \"Explorer\\\\Advanced\\\\\", \"ShowSyncProviderNotifications\", Convert.ToInt32(!enable));\n                    break;\n                case \"cb2\":\n                    Registry.SetValue(\"HKEY_CURRENT_USER\\\\\" + cur_ver + \"ContentDeliveryManager\", \"RotatingLockScreenOverlayEnabled\", Convert.ToInt32(!enable));\n                    Registry.SetValue(\"HKEY_CURRENT_USER\\\\\" + cur_ver + \"ContentDeliveryManager\", \"SubscribedContent-338387Enabled\", Convert.ToInt32(!enable));\n                    break;\n                case \"cb3\":\n                    Registry.SetValue(\"HKEY_CURRENT_USER\\\\\" + cur_ver + \"ContentDeliveryManager\", \"SubscribedContent-338393Enabled\", Convert.ToInt32(!enable));\n                    Registry.SetValue(\"HKEY_CURRENT_USER\\\\\" + cur_ver + \"ContentDeliveryManager\", \"SubscribedContent-353694Enabled\", Convert.ToInt32(!enable));\n                    Registry.SetValue(\"HKEY_CURRENT_USER\\\\\" + cur_ver + \"ContentDeliveryManager\", \"SubscribedContent-353696Enabled\", Convert.ToInt32(!enable));\n                    break;\n                case \"cb4\":\n                    Registry.SetValue(\"HKEY_CURRENT_USER\\\\\" + cur_ver + \"ContentDeliveryManager\", \"SubscribedContent-338389Enabled\", Convert.ToInt32(!enable));\n                    break;\n                case \"cb5\":\n                    Registry.SetValue(\"HKEY_CURRENT_USER\\\\\" + cur_ver + \"UserProfileEngagement\", \"ScoobeSystemSettingEnabled\", Convert.ToInt32(!enable));\n                    break;\n                case \"cb6\":\n                    Registry.SetValue(\"HKEY_CURRENT_USER\\\\\" + cur_ver + \"ContentDeliveryManager\", \"SubscribedContent-310093Enabled\", Convert.ToInt32(!enable));\n                    break;\n                case \"cb7\":\n                    Registry.SetValue(\"HKEY_CURRENT_USER\\\\\" + cur_ver + \"AdvertisingInfo\", \"Enabled\", Convert.ToInt32(!enable));\n                    break;\n                case \"cb8\":\n                    Registry.SetValue(\"HKEY_CURRENT_USER\\\\\" + cur_ver + \"Privacy\", \"TailoredExperiencesWithDiagnosticDataEnabled\", Convert.ToInt32(!enable));\n                    break;\n                case \"cb9\":\n                    Registry.SetValue(\"HKEY_CURRENT_USER\\\\\" + cur_ver + \"Explorer\\\\Advanced\", \"Start_IrisRecommendations\", Convert.ToInt32(!enable));\n                    break;\n                case \"cb10\":\n                    Registry.SetValue(\"HKEY_CURRENT_USER\\\\\" + cur_ver + \"Notifications\\\\Settings\\\\Windows.ActionCenter.SmartOptOut\", \"Enabled\", Convert.ToInt32(!enable));\n                    break;\n                case \"cb11\":\n                    Registry.SetValue(\"HKEY_CURRENT_USER\\\\Software\\\\Policies\\\\Microsoft\\\\Windows\\\\Explorer\", \"DisableSearchBoxSuggestions\", Convert.ToInt32(enable)); // <- Inverted\n                    Registry.SetValue(\"HKEY_CURRENT_USER\\\\\" + cur_ver + \"Search\", \"BingSearchEnabled\", Convert.ToInt32(!enable));\n                    break;\n                case \"cb12\":\n                    Registry.SetValue(\"HKEY_CURRENT_USER\\\\Software\\\\Policies\\\\Microsoft\\\\Edge\", \"WebWidgetAllowed\", Convert.ToInt32(!enable));\n                    break;\n            }\n        }\n\n        public static bool IsRunningAsAdministrator()\n        {\n            return new WindowsPrincipal(WindowsIdentity.GetCurrent()).IsInRole(WindowsBuiltInRole.Administrator);\n        }\n\n        private void Checked(object sender, RoutedEventArgs e)\n        {\n            ToggleOptions(((CheckBox)sender).Name, true);\n        }\n\n        private void Unchecked(object sender, RoutedEventArgs e)\n        {\n            ToggleOptions(((CheckBox)sender).Name, false);\n        }\n\n        private void Close(object sender, RoutedEventArgs e)\n        {\n            Close();\n        }\n    }\n}\n"
  },
  {
    "path": "OFGB.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n  <PropertyGroup>\n    <OutputType>WinExe</OutputType>\n    <TargetFramework>net8.0-windows7.0</TargetFramework>\n    <Nullable>enable</Nullable>\n    <UseWPF>true</UseWPF>\n    <SupportedOSPlatformVersion>7.0</SupportedOSPlatformVersion>\n    <ApplicationIcon>Assets\\icon.ico</ApplicationIcon>\n\t<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>\n\t<SelfContained>true</SelfContained>\n\t<DebugType>None</DebugType>\n\t<DebugSymbols>False</DebugSymbols>\n\t<AllowUnsafeBlocks>true</AllowUnsafeBlocks>\n  </PropertyGroup>\n  <ItemGroup>\n    <None Remove=\"Assets\\OFGB.png\" />\n    <None Remove=\"ofgb.png\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Content Include=\"Assets\\icon.ico\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Resource Include=\"Assets\\OFGB.png\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </Resource>\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": "OFGB.sln",
    "content": "Microsoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio Version 17\nVisualStudioVersion = 17.6.33815.320\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"OFGB\", \"OFGB.csproj\", \"{493D1790-F67D-45E3-9CD8-D880FB1E05E3}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Any CPU = Debug|Any CPU\n\t\tRelease|Any CPU = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{493D1790-F67D-45E3-9CD8-D880FB1E05E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{493D1790-F67D-45E3-9CD8-D880FB1E05E3}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{493D1790-F67D-45E3-9CD8-D880FB1E05E3}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{493D1790-F67D-45E3-9CD8-D880FB1E05E3}.Release|Any CPU.Build.0 = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\n\tGlobalSection(ExtensibilityGlobals) = postSolution\n\t\tSolutionGuid = {27FFC424-4579-463D-8E36-F5404D07E39B}\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "README.md",
    "content": "<p align=\"center\">\n    <img src=\"https://i.ibb.co/ZYgBD06/ofgbF.png\" alt=\"A screenshot of OFGB\"/>\n</p>\n\n# OFGB (Oh Frick Go Back)\nOn April 23, 2024, Microsoft released an [update](https://support.microsoft.com/en-us/topic/april-23-2024-kb5036980-os-builds-22621-3527-and-22631-3527-preview-5a0d6c49-e42e-4eb4-8541-33a7139281ed) for Windows 11 that added ads all across the OS, including the File Explorer, Start Menu, and more. This tool changes certain keys in the [Windows Registry](https://en.wikipedia.org/wiki/Windows_Registry) to disable those ads. It's written in C# and uses [WPF](https://en.wikipedia.org/wiki/Windows_Presentation_Foundation).\n\n## First things first, credits:\n- [Registry keys, comments about their function](https://github.com/xM4ddy/OFGB/blob/92756276178137bb78d7c563733dde0d24f13aff/MainWindow.xaml.cs#L33) and the inspiration for this project were all from [Shawn Brink](https://www.elevenforum.com/members/brink.2/) and [his awesome script](https://www.elevenforum.com/t/disable-ads-in-windows-11.8004/).\n- [A good bit of the theme used for the app](https://github.com/xM4ddy/OFGB/blob/main/dark.xaml) is from a cool project called [DarkNet](https://github.com/Aldaviva/DarkNet) by [Aldaviva](https://github.com/Aldaviva).\n\n## Downloads\nTo download the latest version of OFGB, [click here](https://github.com/xM4ddy/OFGB/releases/latest) or click the \"Releases\" tab at the right of the page.\n\n## Building\nTo build OFGB, you will need [Visual Studio](https://visualstudio.microsoft.com/) and the [.NET 8.0 SDK](https://dotnet.microsoft.com/download/dotnet/8.0).\n\n1. Clone/download the repository, either with `git clone https://github.com/xM4ddy/OFGB` or by downloading the ZIP file.\n2. Open the solution file in Visual Studio.\n3. Build the solution by pressing `Ctrl + Shift + B` or by going to `Build > Build Solution`.\n\n## Contributions\nIf you find any bugs or have any suggestions, feel free to [open an issue](https://github.com/xM4ddy/OFGB/issues) or [start a discussion](https://github.com/xM4ddy/OFGB/discussions).\n\n## Other Notes\n- Thanks for checking out the project, and for all of the support! ❤️\n\n- GitHub is the only place I am sharing this program! I am not affiliated with any other websites that may share this app, thus I cannot guarantee the safety of any downloads from outside of GitHub.\n\n- Want to avoid all this mess? Try Linux!\n"
  },
  {
    "path": "dark.xaml",
    "content": "﻿<ResourceDictionary xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\">\n\n    <Style x:Key=\"labelStyleCommon\" TargetType=\"Label\">\n        <Setter Property=\"HorizontalAlignment\" Value=\"Center\" />\n        <Setter Property=\"VerticalAlignment\" Value=\"Center\" />\n    </Style>\n\n    <Style x:Key=\"checkBoxStyleCommon\" TargetType=\"CheckBox\">\n        <Setter Property=\"VerticalAlignment\" Value=\"Top\" />\n        <Setter Property=\"HorizontalAlignment\" Value=\"Left\" />\n        <Setter Property=\"Margin\" Value=\"0,86,0,0\" />\n    </Style>\n\n    <Style TargetType=\"{x:Type Button}\">\n        <Setter Property=\"Foreground\" Value=\"#757473\" />\n        <Setter Property=\"Background\" Value=\"#00000000\" />\n        <Setter Property=\"FontFamily\" Value=\"Segoe Fluent Icons\" />\n        <Setter Property=\"VerticalAlignment\" Value=\"Top\" />\n        <Setter Property=\"HorizontalAlignment\" Value=\"Right\" />\n        <Setter Property=\"Template\">\n            <Setter.Value>\n                <ControlTemplate TargetType=\"{x:Type Button}\">\n                    <Border x:Name=\"buttonBorder\" Background=\"{TemplateBinding Background}\"\n                        BorderThickness=\"0.0\" BorderBrush=\"Transparent\">\n                        <ContentPresenter HorizontalAlignment=\"Center\" VerticalAlignment=\"Center\" />\n                    </Border>\n                    <ControlTemplate.Triggers>\n                        <Trigger Property=\"IsMouseOver\" Value=\"True\">\n                            <Setter Property=\"BorderBrush\" Value=\"#5593FE\" TargetName=\"buttonBorder\" />\n                        </Trigger>\n                    </ControlTemplate.Triggers>\n                </ControlTemplate>\n            </Setter.Value>\n        </Setter>\n        <Style.Triggers>\n            <Trigger Property=\"IsMouseOver\" Value=\"True\">\n                <Setter Property=\"Background\" Value=\"#F5C2E7\" />\n                <Setter Property=\"Foreground\" Value=\"#1E1E2E\" />\n            </Trigger>\n            <Trigger Property=\"IsPressed\" Value=\"True\">\n                <Setter Property=\"Background\" Value=\"#585B70\" />\n                <Setter Property=\"Foreground\" Value=\"#11111b\" />\n            </Trigger>\n        </Style.Triggers>\n    </Style>\n\n    <Style TargetType=\"TextBlock\">\n        <Setter Property=\"VerticalAlignment\" Value=\"Top\" />\n        <Setter Property=\"HorizontalAlignment\" Value=\"Left\" />\n    </Style>\n\n    <Style TargetType=\"Label\" BasedOn=\"{StaticResource labelStyleCommon}\">\n        <Setter Property=\"Foreground\" Value=\"White\" />\n    </Style>\n\n    <Style x:Key=\"FocusVisual\">\n        <Setter Property=\"Control.Template\">\n            <Setter.Value>\n                <ControlTemplate>\n                    <Rectangle Margin=\"2\" StrokeDashArray=\"1 2\"\n                        Stroke=\"{DynamicResource {x:Static SystemColors.ControlLightBrushKey}}\"\n                        SnapsToDevicePixels=\"true\" StrokeThickness=\"1\" />\n                </ControlTemplate>\n            </Setter.Value>\n        </Setter>\n    </Style>\n    <Style x:Key=\"OptionMarkFocusVisual\">\n        <Setter Property=\"Control.Template\">\n            <Setter.Value>\n                <ControlTemplate>\n                    <Rectangle Margin=\"14,0,0,0\" StrokeDashArray=\"1 2\"\n                        Stroke=\"{DynamicResource {x:Static SystemColors.ControlLightBrushKey}}\"\n                        SnapsToDevicePixels=\"true\" StrokeThickness=\"1\" />\n                </ControlTemplate>\n            </Setter.Value>\n        </Setter>\n    </Style>\n    <SolidColorBrush x:Key=\"OptionMark.Static.Background\" Color=\"Transparent\" />\n    <SolidColorBrush x:Key=\"OptionMark.Static.Border\" Color=\"#585B70\" />\n    <SolidColorBrush x:Key=\"OptionMark.Static.Glyph\" Color=\"#F5C2E7\" />\n    <SolidColorBrush x:Key=\"OptionMark.MouseOver.Background\" Color=\"Transparent\" />\n    <SolidColorBrush x:Key=\"OptionMark.MouseOver.Border\" Color=\"#89B4FA\" />\n    <SolidColorBrush x:Key=\"OptionMark.MouseOver.Glyph\" Color=\"#f9c5eb\" />\n    <SolidColorBrush x:Key=\"OptionMark.Pressed.Background\" Color=\"Transparent\" />\n    <SolidColorBrush x:Key=\"OptionMark.Pressed.Border\" Color=\"#89B4FA\" />\n    <SolidColorBrush x:Key=\"OptionMark.Pressed.Glyph\" Color=\"#b791ad\" />\n    <SolidColorBrush x:Key=\"OptionMark.Disabled.Background\" Color=\"#585B70\" />\n    <SolidColorBrush x:Key=\"OptionMark.Disabled.Foreground\" Color=\"black\" />\n    <SolidColorBrush x:Key=\"OptionMark.Disabled.Border\" Color=\"Transparent\" />\n    <SolidColorBrush x:Key=\"OptionMark.Disabled.Glyph\" Color=\"#FF64505E\" />\n    <Style TargetType=\"{x:Type CheckBox}\" BasedOn=\"{StaticResource checkBoxStyleCommon}\">\n        <Setter Property=\"FocusVisualStyle\" Value=\"{StaticResource FocusVisual}\" />\n        <Setter Property=\"Background\" Value=\"{StaticResource OptionMark.Static.Background}\" />\n        <Setter Property=\"BorderBrush\" Value=\"{StaticResource OptionMark.Static.Border}\" />\n        <Setter Property=\"Foreground\" Value=\"#CDD6F4\" />\n        <Setter Property=\"BorderThickness\" Value=\"1.3\" />\n        <Setter Property=\"Template\">\n            <Setter.Value>\n                <ControlTemplate TargetType=\"{x:Type CheckBox}\">\n                    <Grid x:Name=\"templateRoot\" Background=\"Transparent\" SnapsToDevicePixels=\"True\">\n                        <Grid.ColumnDefinitions>\n                            <ColumnDefinition Width=\"Auto\" />\n                            <ColumnDefinition Width=\"*\" />\n                        </Grid.ColumnDefinitions>\n                        <Border x:Name=\"checkBoxBorder\" Background=\"{TemplateBinding Background}\"\n                            BorderBrush=\"{TemplateBinding BorderBrush}\"\n                            BorderThickness=\"{TemplateBinding BorderThickness}\"\n                            HorizontalAlignment=\"{TemplateBinding HorizontalContentAlignment}\"\n                            Margin=\"1\"\n                            VerticalAlignment=\"{TemplateBinding VerticalContentAlignment}\">\n                            <Grid x:Name=\"markGrid\">\n                                <Path x:Name=\"optionMark\"\n                                    Data=\"F1 M 9.97498,1.22334L 4.6983,9.09834L 4.52164,9.09834L 0,5.19331L 1.27664,3.52165L 4.255,6.08833L 8.33331,1.52588e-005L 9.97498,1.22334 Z \"\n                                    Fill=\"{StaticResource OptionMark.Static.Glyph}\" Margin=\"1\"\n                                    Opacity=\"0\" Stretch=\"None\" />\n                                <Rectangle x:Name=\"indeterminateMark\"\n                                    Fill=\"{StaticResource OptionMark.Static.Glyph}\" Margin=\"2\"\n                                    Opacity=\"0\" />\n                            </Grid>\n                        </Border>\n                        <ContentPresenter x:Name=\"contentPresenter\" Grid.Column=\"1\"\n                            Focusable=\"False\"\n                            HorizontalAlignment=\"{TemplateBinding HorizontalContentAlignment}\"\n                            Margin=\"{TemplateBinding Padding}\" RecognizesAccessKey=\"True\"\n                            SnapsToDevicePixels=\"{TemplateBinding SnapsToDevicePixels}\"\n                            VerticalAlignment=\"{TemplateBinding VerticalContentAlignment}\" />\n                    </Grid>\n                    <ControlTemplate.Triggers>\n                        <Trigger Property=\"HasContent\" Value=\"true\">\n                            <Setter Property=\"FocusVisualStyle\"\n                                Value=\"{StaticResource OptionMarkFocusVisual}\" />\n                            <Setter Property=\"Padding\" Value=\"4, -1, 10, 0\" />\n                        </Trigger>\n                        <Trigger Property=\"IsMouseOver\" Value=\"true\">\n                            <Setter Property=\"Background\" TargetName=\"checkBoxBorder\"\n                                Value=\"{StaticResource OptionMark.MouseOver.Background}\" />\n                            <Setter Property=\"BorderBrush\" TargetName=\"checkBoxBorder\"\n                                Value=\"{StaticResource OptionMark.MouseOver.Border}\" />\n                            <Setter Property=\"Fill\" TargetName=\"optionMark\"\n                                Value=\"{StaticResource OptionMark.MouseOver.Glyph}\" />\n                            <Setter Property=\"Fill\" TargetName=\"indeterminateMark\"\n                                Value=\"{StaticResource OptionMark.MouseOver.Glyph}\" />\n                        </Trigger>\n                        <Trigger Property=\"IsEnabled\" Value=\"false\">\n                            <Setter Property=\"Background\" TargetName=\"checkBoxBorder\"\n                                Value=\"{StaticResource OptionMark.Disabled.Background}\" />\n                            <Setter Property=\"BorderBrush\" TargetName=\"checkBoxBorder\"\n                                Value=\"{StaticResource OptionMark.Disabled.Border}\" />\n                            <Setter Property=\"Fill\" TargetName=\"optionMark\"\n                                Value=\"{StaticResource OptionMark.Disabled.Glyph}\" />\n                            <Setter Property=\"Fill\" TargetName=\"indeterminateMark\"\n                                Value=\"{StaticResource OptionMark.Disabled.Glyph}\" />\n                        </Trigger>\n                        <Trigger Property=\"IsPressed\" Value=\"true\">\n                            <Setter Property=\"Background\" TargetName=\"checkBoxBorder\"\n                                Value=\"{StaticResource OptionMark.Pressed.Background}\" />\n                            <Setter Property=\"BorderBrush\" TargetName=\"checkBoxBorder\"\n                                Value=\"{StaticResource OptionMark.Pressed.Border}\" />\n                            <Setter Property=\"Fill\" TargetName=\"optionMark\"\n                                Value=\"{StaticResource OptionMark.Pressed.Glyph}\" />\n                            <Setter Property=\"Fill\" TargetName=\"indeterminateMark\"\n                                Value=\"{StaticResource OptionMark.Pressed.Glyph}\" />\n                        </Trigger>\n                        <Trigger Property=\"IsChecked\" Value=\"true\">\n                            <Setter Property=\"Opacity\" TargetName=\"optionMark\" Value=\"1\" />\n                            <Setter Property=\"Opacity\" TargetName=\"indeterminateMark\" Value=\"0\" />\n                        </Trigger>\n                        <Trigger Property=\"IsChecked\" Value=\"{x:Null}\">\n                            <Setter Property=\"Opacity\" TargetName=\"optionMark\" Value=\"0\" />\n                            <Setter Property=\"Opacity\" TargetName=\"indeterminateMark\" Value=\"1\" />\n                        </Trigger>\n                    </ControlTemplate.Triggers>\n                </ControlTemplate>\n            </Setter.Value>\n        </Setter>\n    </Style>\n\n</ResourceDictionary>\n"
  }
]