├── GoodbyeDPI_UI ├── Assets │ ├── favicon.ico │ ├── Icons │ │ ├── Edit.ico │ │ ├── Edit.png │ │ ├── Help.ico │ │ ├── Proxy.ico │ │ ├── Store.png │ │ ├── GoodCheck.ico │ │ ├── GoodCheck.png │ │ ├── DragReorder.png │ │ ├── Edit-68x68.png │ │ ├── Pseudoconsole.ico │ │ └── Pseudoconsole.png │ ├── StoreLogo.png │ ├── Store │ │ ├── byedpi.png │ │ ├── empty.png │ │ ├── zapret.png │ │ ├── spoofdpi.png │ │ └── goodbyedpi.png │ ├── SplashScreen.scale-200.png │ ├── Ad │ │ └── EasyConvertFromBatAd.png │ ├── LockScreenLogo.scale-200.png │ ├── Square44x44Logo.scale-200.png │ ├── Wallpaper │ │ └── Kislovodsk │ │ │ └── 1.jpeg │ ├── Wide310x150Logo.scale-200.png │ ├── Square150x150Logo.scale-200.png │ └── Square44x44Logo.targetsize-24_altform-unplated.png ├── Views │ ├── CreateConfigUtil │ │ ├── GoodCheckWorkPage.xaml.cs │ │ └── MainPage.xaml.cs │ ├── SetupProxy │ │ ├── ProxySetupCompletePage.xaml.cs │ │ ├── ProxySetupCompletePage.xaml │ │ ├── MainPage.xaml.cs │ │ ├── MainPage.xaml │ │ └── SetupProxyForSystem.xaml │ ├── UtilsPage.xaml.cs │ └── Store │ │ └── LibraryPage.xaml ├── Properties │ ├── launchSettings.json │ └── Resources.Designer.cs ├── nuget.config ├── Converters │ ├── BoolToVisibilityConverter.cs │ └── InverseBooleanConverter.cs ├── ViewModels │ └── RelayCommand.cs ├── Controls │ ├── Dialogs │ │ ├── CreateConfigHelper │ │ │ ├── CreateCompleteDialog.xaml │ │ │ ├── CreateCompleteDialog.xaml.cs │ │ │ ├── ImportConfigFromFileDialog.xaml.cs │ │ │ ├── EditConfigVarValueDialog.xaml │ │ │ ├── ChooseGroupModeContentDialog.xaml │ │ │ ├── SelectUsedFilesForConfigContentDialog.xaml │ │ │ ├── RecentGoodCheckSelectionsContentDialog.xaml │ │ │ ├── EditConfigVarValueDialog.xaml.cs │ │ │ ├── ImportConfigFromFileDialog.xaml │ │ │ ├── SelectConfigToEditContentDialog.xaml │ │ │ └── ChooseGroupModeContentDialog.xaml.cs │ │ ├── Universal │ │ │ ├── MarkdownTextViewContentDialog.xaml │ │ │ ├── MarkdownTextViewContentDialog.xaml.cs │ │ │ ├── FontSettingsContentDialog.xaml │ │ │ └── FontSettingsContentDialog.xaml.cs │ │ ├── Store │ │ │ ├── SubItemInstallAskContentDialog.xaml.cs │ │ │ ├── AcceptLicenseContentDialog.xaml │ │ │ ├── AcceptLicenseContentDialog.xaml.cs │ │ │ └── SubItemInstallAskContentDialog.xaml │ │ └── ComponentSettings │ │ │ ├── ViewApplyArgsContentDialog.xaml.cs │ │ │ └── ViewApplyArgsContentDialog.xaml │ ├── Universal │ │ ├── IconButton.xaml │ │ └── SitelistButton.xaml │ ├── ProxySetup │ │ └── ApplicationUserControl.xaml │ ├── MainPage │ │ ├── QuickSettingWidget.xaml │ │ └── QuickSettingWidget.xaml.cs │ ├── ComponentSettings │ │ ├── SettingTile.xaml │ │ ├── SettingTileControlElement.xaml │ │ └── SettingTile.xaml.cs │ ├── CreateConfigHelper │ │ ├── ComponentSettingUserControl.xaml │ │ ├── ConditionUserControl.xaml │ │ ├── FileConfigInspectUserControl.xaml │ │ ├── GoodCheckReportStrategyUserControl.xaml │ │ └── VariableUserControl.xaml │ ├── Store │ │ ├── StoreItemLinkButton.xaml │ │ ├── StoreAskForSubItemInstallUserControl.xaml │ │ ├── StoreCategoryButton.xaml.cs │ │ ├── StoreItemLinkButton.xaml.cs │ │ └── StoreItemMicroButton.xaml │ └── GoodCheck │ │ ├── GoodCheckSitelistButton.xaml.cs │ │ ├── GoodCheckSitelistStrategyChooserControl.xaml │ │ └── GoodCheckSitelistButton.xaml ├── RemoveLanguageFolders.targets ├── Helper │ ├── AutoStartManager.cs │ ├── NativeHelper.cs │ ├── UrlOpenHelper.cs │ ├── Items │ │ ├── ComponentItemsLoaderHelper.cs │ │ ├── ComponentHelper.cs │ │ └── CompatibilityCheckHelper.cs │ ├── ApplicationTaskMonitor.cs │ ├── MsiInstallerHelper.cs │ └── Static │ │ ├── TitleBarHelper.cs │ │ └── RegeditHelper.cs ├── Common │ ├── FileLoader.cs │ └── Win32.cs ├── app.manifest ├── Template │ └── Settings │ │ └── Settings.xml ├── Package.appxmanifest ├── DataModel │ └── IconsDataSource.cs └── Windows │ ├── OfflineHelpWindow.xaml.cs │ ├── Service │ └── PrepareWindow.xaml │ ├── ViewGoodCheckOutputWindow.xaml │ ├── ProxySetupUtilWindow.xaml │ ├── OfflineHelpWindow.xaml │ └── CreateConfigUtilWindow.xaml ├── CDPIUI_TrayIcon ├── Assets │ ├── trayLogoError.ico │ ├── trayLogoNormal.ico │ ├── trayLogoStarted.ico │ └── trayLogoStopped.ico ├── CDPIUI_TrayIcon.csproj ├── Helper │ ├── Utils.cs │ ├── Settings │ │ └── AutoStartManager.cs │ └── Basic │ │ └── RegeditHelper.cs └── app.manifest ├── Update ├── packages.config ├── App.config ├── Properties │ ├── Settings.settings │ ├── Settings.Designer.cs │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── app.manifest └── Program.cs ├── .editorconfig └── .gitattributes /GoodbyeDPI_UI/Assets/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Storik4pro/cdpiui/HEAD/GoodbyeDPI_UI/Assets/favicon.ico -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Assets/Icons/Edit.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Storik4pro/cdpiui/HEAD/GoodbyeDPI_UI/Assets/Icons/Edit.ico -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Assets/Icons/Edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Storik4pro/cdpiui/HEAD/GoodbyeDPI_UI/Assets/Icons/Edit.png -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Assets/Icons/Help.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Storik4pro/cdpiui/HEAD/GoodbyeDPI_UI/Assets/Icons/Help.ico -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Assets/StoreLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Storik4pro/cdpiui/HEAD/GoodbyeDPI_UI/Assets/StoreLogo.png -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Assets/Icons/Proxy.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Storik4pro/cdpiui/HEAD/GoodbyeDPI_UI/Assets/Icons/Proxy.ico -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Assets/Icons/Store.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Storik4pro/cdpiui/HEAD/GoodbyeDPI_UI/Assets/Icons/Store.png -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Assets/Store/byedpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Storik4pro/cdpiui/HEAD/GoodbyeDPI_UI/Assets/Store/byedpi.png -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Assets/Store/empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Storik4pro/cdpiui/HEAD/GoodbyeDPI_UI/Assets/Store/empty.png -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Assets/Store/zapret.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Storik4pro/cdpiui/HEAD/GoodbyeDPI_UI/Assets/Store/zapret.png -------------------------------------------------------------------------------- /CDPIUI_TrayIcon/Assets/trayLogoError.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Storik4pro/cdpiui/HEAD/CDPIUI_TrayIcon/Assets/trayLogoError.ico -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Assets/Icons/GoodCheck.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Storik4pro/cdpiui/HEAD/GoodbyeDPI_UI/Assets/Icons/GoodCheck.ico -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Assets/Icons/GoodCheck.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Storik4pro/cdpiui/HEAD/GoodbyeDPI_UI/Assets/Icons/GoodCheck.png -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Assets/Store/spoofdpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Storik4pro/cdpiui/HEAD/GoodbyeDPI_UI/Assets/Store/spoofdpi.png -------------------------------------------------------------------------------- /CDPIUI_TrayIcon/Assets/trayLogoNormal.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Storik4pro/cdpiui/HEAD/CDPIUI_TrayIcon/Assets/trayLogoNormal.ico -------------------------------------------------------------------------------- /CDPIUI_TrayIcon/Assets/trayLogoStarted.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Storik4pro/cdpiui/HEAD/CDPIUI_TrayIcon/Assets/trayLogoStarted.ico -------------------------------------------------------------------------------- /CDPIUI_TrayIcon/Assets/trayLogoStopped.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Storik4pro/cdpiui/HEAD/CDPIUI_TrayIcon/Assets/trayLogoStopped.ico -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Assets/Icons/DragReorder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Storik4pro/cdpiui/HEAD/GoodbyeDPI_UI/Assets/Icons/DragReorder.png -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Assets/Icons/Edit-68x68.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Storik4pro/cdpiui/HEAD/GoodbyeDPI_UI/Assets/Icons/Edit-68x68.png -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Assets/Store/goodbyedpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Storik4pro/cdpiui/HEAD/GoodbyeDPI_UI/Assets/Store/goodbyedpi.png -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Assets/Icons/Pseudoconsole.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Storik4pro/cdpiui/HEAD/GoodbyeDPI_UI/Assets/Icons/Pseudoconsole.ico -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Assets/Icons/Pseudoconsole.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Storik4pro/cdpiui/HEAD/GoodbyeDPI_UI/Assets/Icons/Pseudoconsole.png -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Assets/SplashScreen.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Storik4pro/cdpiui/HEAD/GoodbyeDPI_UI/Assets/SplashScreen.scale-200.png -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Assets/Ad/EasyConvertFromBatAd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Storik4pro/cdpiui/HEAD/GoodbyeDPI_UI/Assets/Ad/EasyConvertFromBatAd.png -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Assets/LockScreenLogo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Storik4pro/cdpiui/HEAD/GoodbyeDPI_UI/Assets/LockScreenLogo.scale-200.png -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Assets/Square44x44Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Storik4pro/cdpiui/HEAD/GoodbyeDPI_UI/Assets/Square44x44Logo.scale-200.png -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Assets/Wallpaper/Kislovodsk/1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Storik4pro/cdpiui/HEAD/GoodbyeDPI_UI/Assets/Wallpaper/Kislovodsk/1.jpeg -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Assets/Wide310x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Storik4pro/cdpiui/HEAD/GoodbyeDPI_UI/Assets/Wide310x150Logo.scale-200.png -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Assets/Square150x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Storik4pro/cdpiui/HEAD/GoodbyeDPI_UI/Assets/Square150x150Logo.scale-200.png -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Views/CreateConfigUtil/GoodCheckWorkPage.xaml.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Storik4pro/cdpiui/HEAD/GoodbyeDPI_UI/Views/CreateConfigUtil/GoodCheckWorkPage.xaml.cs -------------------------------------------------------------------------------- /Update/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Assets/Square44x44Logo.targetsize-24_altform-unplated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Storik4pro/cdpiui/HEAD/GoodbyeDPI_UI/Assets/Square44x44Logo.targetsize-24_altform-unplated.png -------------------------------------------------------------------------------- /Update/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "CDPI_UI (Package)": { 4 | "commandName": "MsixPackage" 5 | }, 6 | "CDPI_UI (Unpackaged)": { 7 | "commandName": "Project" 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | [*.cs] 2 | 3 | # CS8602: Dereference of a possibly null reference. 4 | dotnet_diagnostic.CS8602.severity = suggestion 5 | 6 | # CS8600: Converting null literal or possible null value to non-nullable type. 7 | dotnet_diagnostic.CS8600.severity = none 8 | -------------------------------------------------------------------------------- /Update/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/nuget.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Converters/BoolToVisibilityConverter.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.UI.Xaml; 2 | using Microsoft.UI.Xaml.Data; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace CDPI_UI.Converters 10 | { 11 | public class BoolToVisibilityConverter : IValueConverter 12 | { 13 | public object Convert(object value, Type targetType, object parameter, string language) 14 | { 15 | if (value is bool b && b) 16 | return Visibility.Visible; 17 | return Visibility.Collapsed; 18 | } 19 | 20 | public object ConvertBack(object value, Type targetType, object parameter, string language) 21 | { 22 | throw new NotSupportedException(); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/ViewModels/RelayCommand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows.Input; 7 | 8 | namespace CDPI_UI.ViewModels 9 | { 10 | public class RelayCommand : ICommand 11 | { 12 | private Action execute; 13 | private Func canExecute; 14 | public event EventHandler CanExecuteChanged; 15 | public RelayCommand(Action executeAction, Func canExecuteFunc = null) 16 | { 17 | execute = executeAction; 18 | canExecute = canExecuteFunc; 19 | } 20 | public bool CanExecute(object parameter) => canExecute == null || canExecute(parameter); 21 | public void Execute(object parameter) => execute(parameter); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Controls/Dialogs/CreateConfigHelper/CreateCompleteDialog.xaml: -------------------------------------------------------------------------------- 1 | 2 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Converters/InverseBooleanConverter.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.UI.Xaml.Data; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Globalization; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace CDPI_UI.Converters 10 | { 11 | public class InverseBooleanConverter : IValueConverter 12 | { 13 | public object Convert(object value, Type targetType, object parameter, string language) 14 | { 15 | if (value is bool booleanValue) 16 | { 17 | return !booleanValue; 18 | } 19 | return value; 20 | } 21 | 22 | public object ConvertBack(object value, Type targetType, object parameter, string language) 23 | { 24 | if (value is bool booleanValue) 25 | { 26 | return !booleanValue; 27 | } 28 | return value; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Controls/Dialogs/CreateConfigHelper/CreateCompleteDialog.xaml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.UI.Xaml; 2 | using Microsoft.UI.Xaml.Controls; 3 | using Microsoft.UI.Xaml.Controls.Primitives; 4 | using Microsoft.UI.Xaml.Data; 5 | using Microsoft.UI.Xaml.Input; 6 | using Microsoft.UI.Xaml.Media; 7 | using Microsoft.UI.Xaml.Navigation; 8 | using System; 9 | using System.Collections.Generic; 10 | using System.IO; 11 | using System.Linq; 12 | using System.Runtime.InteropServices.WindowsRuntime; 13 | using Windows.Foundation; 14 | using Windows.Foundation.Collections; 15 | 16 | // To learn more about WinUI, the WinUI project structure, 17 | // and more about our project templates, see: http://aka.ms/winui-project-info. 18 | 19 | namespace CDPI_UI.Controls.Dialogs.CreateConfigHelper 20 | { 21 | public sealed partial class CreateCompleteDialog : ContentDialog 22 | { 23 | public CreateCompleteDialog() 24 | { 25 | InitializeComponent(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Controls/Dialogs/CreateConfigHelper/ImportConfigFromFileDialog.xaml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.UI.Xaml; 2 | using Microsoft.UI.Xaml.Controls; 3 | using Microsoft.UI.Xaml.Controls.Primitives; 4 | using Microsoft.UI.Xaml.Data; 5 | using Microsoft.UI.Xaml.Input; 6 | using Microsoft.UI.Xaml.Media; 7 | using Microsoft.UI.Xaml.Navigation; 8 | using System; 9 | using System.Collections.Generic; 10 | using System.IO; 11 | using System.Linq; 12 | using System.Runtime.InteropServices.WindowsRuntime; 13 | using Windows.Foundation; 14 | using Windows.Foundation.Collections; 15 | 16 | // To learn more about WinUI, the WinUI project structure, 17 | // and more about our project templates, see: http://aka.ms/winui-project-info. 18 | 19 | namespace CDPI_UI.Controls.Dialogs.CreateConfigHelper 20 | { 21 | public sealed partial class ImportConfigFromFileDialog : ContentDialog 22 | { 23 | public ImportConfigFromFileDialog() 24 | { 25 | InitializeComponent(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Update/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Update.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/RemoveLanguageFolders.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | @(LanguageItems->'$(OutDir)%(Identity)\*.mui') 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Controls/Dialogs/Universal/MarkdownTextViewContentDialog.xaml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 15 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Helper/AutoStartManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace CDPI_UI.Helper 9 | { 10 | public static class AutoStartManager 11 | { 12 | public static void AddToAutorun() 13 | { 14 | try 15 | { 16 | _ = PipeClient.Instance.SendMessage("SETTINGS:ADD_TO_AUTORUN"); 17 | 18 | SettingsManager.Instance.SetValue("SYSTEM", "autorun", true); 19 | } 20 | catch (Exception ex) 21 | { 22 | Debug.WriteLine($"Autorun error: {ex.Message}"); 23 | } 24 | } 25 | 26 | public static void RemoveFromAutorun() 27 | { 28 | try 29 | { 30 | _ = PipeClient.Instance.SendMessage("SETTINGS:REMOVE_FROM_AUTORUN"); 31 | 32 | 33 | SettingsManager.Instance.SetValue("SYSTEM", "autorun", false); 34 | } 35 | catch (Exception ex) 36 | { 37 | Debug.WriteLine($"Autorun error: {ex.Message}"); 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Helper/NativeHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.InteropServices; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace CDPI_UI.Helper 9 | { 10 | internal class NativeHelper 11 | { 12 | public const int ERROR_SUCCESS = 0; 13 | public const int ERROR_INSUFFICIENT_BUFFER = 122; 14 | public const int APPMODEL_ERROR_NO_PACKAGE = 15700; 15 | 16 | [DllImport("api-ms-win-appmodel-runtime-l1-1-1", SetLastError = true)] 17 | [return: MarshalAs(UnmanagedType.U4)] 18 | internal static extern uint GetCurrentPackageId(ref int pBufferLength, out byte pBuffer); 19 | 20 | public static bool IsAppPackaged 21 | { 22 | get 23 | { 24 | int bufferSize = 0; 25 | byte byteBuffer = 0; 26 | uint lastError = NativeHelper.GetCurrentPackageId(ref bufferSize, out byteBuffer); 27 | bool isPackaged = true; 28 | 29 | if (lastError == NativeHelper.APPMODEL_ERROR_NO_PACKAGE) 30 | { 31 | isPackaged = false; 32 | } 33 | return isPackaged; 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Common/FileLoader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Windows.Storage; 6 | using CDPI_UI.Helper; 7 | using System.IO; 8 | using System.Reflection; 9 | 10 | namespace CDPI_UI.Common 11 | { 12 | internal class FileLoader 13 | { 14 | public static async Task LoadText(string relativeFilePath) 15 | { 16 | StorageFile file = null; 17 | if (!NativeHelper.IsAppPackaged) 18 | { 19 | var sourcePath = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), relativeFilePath)); 20 | file = await StorageFile.GetFileFromPathAsync(sourcePath); 21 | 22 | } 23 | else 24 | { 25 | Uri sourceUri = new Uri("ms-appx:///" + relativeFilePath); 26 | file = await StorageFile.GetFileFromApplicationUriAsync(sourceUri); 27 | 28 | } 29 | return await FileIO.ReadTextAsync(file); 30 | } 31 | 32 | public static async Task> LoadLines(string relativeFilePath) 33 | { 34 | string fileContents = await LoadText(relativeFilePath); 35 | return fileContents.Split(Environment.NewLine).ToList(); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Update/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | using System.Xml.Linq; 7 | 8 | namespace Update 9 | { 10 | internal static class Program 11 | { 12 | [STAThread] 13 | static void Main(string[] args) 14 | { 15 | string extractFileName = null; 16 | string destinationPath = null; 17 | for (int i = 0; i < args.Length; i++) 18 | { 19 | if (args[i] == "--directory-to-zip" && i + 1 < args.Length) 20 | { 21 | extractFileName = args[++i]; 22 | } 23 | else if (args[i] == "--destination-directory" && i + 1 < args.Length) 24 | { 25 | destinationPath = args[++i]; 26 | } 27 | } 28 | if (!string.IsNullOrEmpty(extractFileName) && !string.IsNullOrEmpty(destinationPath)) 29 | { 30 | InstallHelper.Instance.Init(extractFileName, destinationPath, "CDPIUI_TrayIcon.exe"); 31 | 32 | 33 | Application.EnableVisualStyles(); 34 | Application.SetCompatibleTextRenderingDefault(false); 35 | Application.Run(new MainWindow()); 36 | } 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/app.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | PerMonitorV2 24 | 25 | 26 | -------------------------------------------------------------------------------- /Update/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Update")] 9 | [assembly: AssemblyDescription("Update helper for CDPIUI application")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Update")] 13 | [assembly: AssemblyCopyright("Copyright ©Storik4 2025")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("67bf18a2-09c8-46ad-ac72-a45c3f276166")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | [assembly: AssemblyVersion("1.1.0.0")] 33 | [assembly: AssemblyFileVersion("1.1.0.0")] 34 | -------------------------------------------------------------------------------- /CDPIUI_TrayIcon/CDPIUI_TrayIcon.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | WinExe 5 | net8.0-windows10.0.17763.0 6 | 10.0 7 | enable 8 | true 9 | embedded 10 | enable 11 | app.manifest 12 | Assets\trayLogoNormal.ico 13 | x64 14 | 1.3.0.0 15 | 1.3.0.0 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | Never 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Controls/Universal/IconButton.xaml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Template/Settings/Settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Helper/UrlOpenHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace CDPI_UI.Helper 8 | { 9 | public static class UrlOpenHelper 10 | { 11 | public static string MainRepoUrl = "https://github.com/Storik4pro/cdpiui"; 12 | public static string LicenseUrl = "https://github.com/Storik4pro/cdpiui/blob/main/LICENSE.txt"; 13 | public static async void LaunchReportUrl() 14 | { 15 | _ = await Windows.System.Launcher.LaunchUriAsync(new Uri("https://github.com/Storik4pro/cdpiui/issues")); 16 | } 17 | public static async void LaunchMainRepoUrl() 18 | { 19 | _ = await Windows.System.Launcher.LaunchUriAsync(new Uri(MainRepoUrl)); 20 | } 21 | public static async void LaunchWikiUrl() 22 | { 23 | _ = await Windows.System.Launcher.LaunchUriAsync(new Uri("https://storik4pro.github.io/cdpiui/")); 24 | } 25 | public static async void LaunchLicenseUrl() 26 | { 27 | _ = await Windows.System.Launcher.LaunchUriAsync(new Uri(LicenseUrl)); 28 | } 29 | public static async void LaunchDonateUrl() 30 | { 31 | _ = await Windows.System.Launcher.LaunchUriAsync(new Uri("https://pay.cloudtips.ru/p/5bb7ff74")); 32 | } 33 | public static async void LaunchTelegramUrl() 34 | { 35 | _ = await Windows.System.Launcher.LaunchUriAsync(new Uri("https://t.me/storik4dev")); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Controls/Dialogs/Store/SubItemInstallAskContentDialog.xaml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.UI.Xaml; 2 | using Microsoft.UI.Xaml.Controls; 3 | using Microsoft.UI.Xaml.Controls.Primitives; 4 | using Microsoft.UI.Xaml.Data; 5 | using Microsoft.UI.Xaml.Input; 6 | using Microsoft.UI.Xaml.Media; 7 | using Microsoft.UI.Xaml.Navigation; 8 | using System; 9 | using System.Collections.Generic; 10 | using System.Collections.ObjectModel; 11 | using System.IO; 12 | using System.Linq; 13 | using System.Runtime.InteropServices.WindowsRuntime; 14 | using Windows.Foundation; 15 | using Windows.Foundation.Collections; 16 | 17 | // To learn more about WinUI, the WinUI project structure, 18 | // and more about our project templates, see: http://aka.ms/winui-project-info. 19 | 20 | namespace CDPI_UI.Controls.Dialogs.Store 21 | { 22 | public class SubItemModel 23 | { 24 | public string Id { get; set; } 25 | public string Name { get; set; } 26 | public string Description { get; set; } 27 | public string Developer { get; set; } 28 | public string Category { get; set; } 29 | public string ImageSource { get; set; } 30 | } 31 | public sealed partial class SubItemInstallAskContentDialog : ContentDialog 32 | { 33 | private ObservableCollection items = []; 34 | public SubItemInstallAskContentDialog(List _items) 35 | { 36 | InitializeComponent(); 37 | 38 | ItemsListView.ItemsSource = items; 39 | 40 | foreach (SubItemModel item in _items) 41 | { 42 | items.Add(item); 43 | } 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Controls/Dialogs/Universal/MarkdownTextViewContentDialog.xaml.cs: -------------------------------------------------------------------------------- 1 | using CommunityToolkit.Labs.WinUI.MarkdownTextBlock; 2 | using CDPI_UI.Controls.Store; 3 | using Microsoft.UI.Xaml; 4 | using Microsoft.UI.Xaml.Controls; 5 | using Microsoft.UI.Xaml.Controls.Primitives; 6 | using Microsoft.UI.Xaml.Data; 7 | using Microsoft.UI.Xaml.Input; 8 | using Microsoft.UI.Xaml.Media; 9 | using Microsoft.UI.Xaml.Navigation; 10 | using System; 11 | using System.Collections.Generic; 12 | using System.IO; 13 | using System.Linq; 14 | using System.Runtime.InteropServices.WindowsRuntime; 15 | using Windows.Foundation; 16 | using Windows.Foundation.Collections; 17 | 18 | // To learn more about WinUI, the WinUI project structure, 19 | // and more about our project templates, see: http://aka.ms/winui-project-info. 20 | 21 | namespace CDPI_UI.Controls.Dialogs.Universal; 22 | 23 | public sealed partial class MarkdownTextViewContentDialog : ContentDialog 24 | { 25 | 26 | private MarkdownConfig _config; 27 | 28 | public MarkdownConfig MarkdownConfig 29 | { 30 | get => _config; 31 | set => _config = value; 32 | } 33 | 34 | public MarkdownTextViewContentDialog() 35 | { 36 | InitializeComponent(); 37 | _config = new MarkdownConfig(); 38 | } 39 | 40 | public string Text 41 | { 42 | get { return (string)GetValue(TextProperty); } 43 | set { SetValue(TextProperty, value); } 44 | } 45 | 46 | public static readonly DependencyProperty TextProperty = 47 | DependencyProperty.Register( 48 | nameof(Text), typeof(string), typeof(MarkdownTextViewContentDialog), new PropertyMetadata(string.Empty) 49 | ); 50 | } 51 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Controls/ProxySetup/ApplicationUserControl.xaml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Controls/Dialogs/CreateConfigHelper/EditConfigVarValueDialog.xaml: -------------------------------------------------------------------------------- 1 | 2 | 15 | 16 | 17 | 18 | 19 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Controls/MainPage/QuickSettingWidget.xaml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Controls/Dialogs/Store/AcceptLicenseContentDialog.xaml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Controls/ComponentSettings/SettingTile.xaml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Views/SetupProxy/ProxySetupCompletePage.xaml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.UI.Xaml; 2 | using Microsoft.UI.Xaml.Controls; 3 | using Microsoft.UI.Xaml.Controls.Primitives; 4 | using Microsoft.UI.Xaml.Data; 5 | using Microsoft.UI.Xaml.Input; 6 | using Microsoft.UI.Xaml.Media; 7 | using Microsoft.UI.Xaml.Media.Animation; 8 | using Microsoft.UI.Xaml.Navigation; 9 | using System; 10 | using System.Collections.Generic; 11 | using System.IO; 12 | using System.Linq; 13 | using System.Runtime.InteropServices.WindowsRuntime; 14 | using Windows.Foundation; 15 | using Windows.Foundation.Collections; 16 | using Windows.Foundation.Metadata; 17 | 18 | // To learn more about WinUI, the WinUI project structure, 19 | // and more about our project templates, see: http://aka.ms/winui-project-info. 20 | 21 | namespace CDPI_UI.Views.SetupProxy 22 | { 23 | /// 24 | /// An empty page that can be used on its own or navigated to within a Frame. 25 | /// 26 | public sealed partial class ProxySetupCompletePage : Page 27 | { 28 | public ProxySetupCompletePage() 29 | { 30 | InitializeComponent(); 31 | } 32 | 33 | protected override void OnNavigatedTo(NavigationEventArgs e) 34 | { 35 | base.OnNavigatedTo(e); 36 | 37 | var anim = ConnectedAnimationService.GetForCurrentView().GetAnimation("ForwardConnectedAnimation"); 38 | if (anim != null) 39 | { 40 | anim.TryStart(ActionButtonsGrid); 41 | } 42 | } 43 | 44 | private void ExitButton_Click(object sender, RoutedEventArgs e) 45 | { 46 | ((App)Application.Current).CloseWindow(); 47 | } 48 | 49 | private void GetHelpButton_Click(object sender, RoutedEventArgs e) 50 | { 51 | // TODO: open help 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Controls/Dialogs/Store/AcceptLicenseContentDialog.xaml.cs: -------------------------------------------------------------------------------- 1 | using CDPI_UI.Helper; 2 | using CDPI_UI.Helper.LScript; 3 | using CDPI_UI.Helper.Static; 4 | using Microsoft.UI.Xaml; 5 | using Microsoft.UI.Xaml.Controls; 6 | using Microsoft.UI.Xaml.Controls.Primitives; 7 | using Microsoft.UI.Xaml.Data; 8 | using Microsoft.UI.Xaml.Input; 9 | using Microsoft.UI.Xaml.Media; 10 | using Microsoft.UI.Xaml.Navigation; 11 | using System; 12 | using System.Collections.Generic; 13 | using System.Collections.ObjectModel; 14 | using System.IO; 15 | using System.Linq; 16 | using System.Runtime.InteropServices.WindowsRuntime; 17 | using Windows.Foundation; 18 | using Windows.Foundation.Collections; 19 | using static CDPI_UI.Helper.StoreHelper; 20 | 21 | // To learn more about WinUI, the WinUI project structure, 22 | // and more about our project templates, see: http://aka.ms/winui-project-info. 23 | 24 | namespace CDPI_UI.Controls.Dialogs.Store 25 | { 26 | public sealed partial class AcceptLicenseContentDialog : ContentDialog 27 | { 28 | public List Licenses = []; 29 | 30 | public AcceptLicenseContentDialog() 31 | { 32 | InitializeComponent(); 33 | this.DataContext = this; 34 | 35 | 36 | } 37 | 38 | private void HyperlinkButton_Click(object sender, RoutedEventArgs e) 39 | { 40 | HyperlinkButton _sender = sender as HyperlinkButton; 41 | string url = _sender.Tag.ToString(); 42 | 43 | if (url.StartsWith("$OPENINBROWSER")) 44 | { 45 | _ = Windows.System.Launcher.LaunchUriAsync(new Uri(LScriptLangHelper.GetArgumentsFromScript(url))); 46 | } 47 | else 48 | { 49 | string _url = LScriptLangHelper.ExecuteScriptUnsafe(url); 50 | Utils.OpenFileInDefaultApp(_url); 51 | } 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Package.appxmanifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 14 | 15 | 16 | 17 | 18 | CDPI UI 19 | serst 20 | Assets\StoreLogo.png 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 36 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/DataModel/IconsDataSource.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text.Json; 4 | using System.Text.Json.Serialization; 5 | using System.Threading.Tasks; 6 | using CDPI_UI.Common; 7 | 8 | namespace CDPI_UI.DesktopWap.DataModel 9 | { 10 | public class IconData 11 | { 12 | public string Name { get; set; } 13 | public string Code { get; set; } 14 | public string[] Tags { get; set; } = []; 15 | 16 | public string Character => char.ConvertFromUtf32(Convert.ToInt32(Code, 16)); 17 | public string CodeGlyph => "\\u" + Code; 18 | public string TextGlyph => "&#x" + Code + ";"; 19 | } 20 | [JsonSourceGenerationOptions(PropertyNameCaseInsensitive = true)] 21 | [JsonSerializable(typeof(List))] 22 | internal partial class IconDataListContext : JsonSerializerContext 23 | { 24 | } 25 | 26 | internal class IconsDataSource 27 | { 28 | public static IconsDataSource Instance { get; } = new(); 29 | 30 | public static List Icons => Instance.icons; 31 | 32 | private List icons = new(); 33 | 34 | private IconsDataSource() { } 35 | 36 | public object _lock = new(); 37 | 38 | public async Task> LoadIcons() 39 | { 40 | lock (_lock) 41 | { 42 | if (icons.Count != 0) 43 | { 44 | return icons; 45 | } 46 | } 47 | var jsonText = await FileLoader.LoadText("DataModel/IconsData.json"); 48 | lock (_lock) 49 | { 50 | if (icons.Count == 0) 51 | { 52 | icons = JsonSerializer.Deserialize(jsonText, typeof(List), IconDataListContext.Default) as List; 53 | } 54 | return icons; 55 | } 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Controls/Dialogs/Store/SubItemInstallAskContentDialog.xaml: -------------------------------------------------------------------------------- 1 | 2 | 15 | 16 | 17 | 19 | 20 | 21 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Controls/Universal/SitelistButton.xaml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Controls/CreateConfigHelper/ComponentSettingUserControl.xaml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Views/SetupProxy/ProxySetupCompletePage.xaml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Controls/Dialogs/ComponentSettings/ViewApplyArgsContentDialog.xaml.cs: -------------------------------------------------------------------------------- 1 | using CDPI_UI.Helper; 2 | using Microsoft.UI.Xaml; 3 | using Microsoft.UI.Xaml.Controls; 4 | using Microsoft.UI.Xaml.Controls.Primitives; 5 | using Microsoft.UI.Xaml.Data; 6 | using Microsoft.UI.Xaml.Input; 7 | using Microsoft.UI.Xaml.Media; 8 | using Microsoft.UI.Xaml.Navigation; 9 | using System; 10 | using System.Collections.Generic; 11 | using System.IO; 12 | using System.Linq; 13 | using System.Runtime.InteropServices.WindowsRuntime; 14 | using Windows.Foundation; 15 | using Windows.Foundation.Collections; 16 | 17 | // To learn more about WinUI, the WinUI project structure, 18 | // and more about our project templates, see: http://aka.ms/winui-project-info. 19 | 20 | namespace CDPI_UI.Controls.Dialogs 21 | { 22 | public sealed partial class ViewApplyArgsContentDialog : ContentDialog 23 | { 24 | public string DialogTitle { get; set; } 25 | public string MessageToShow { get; set; } 26 | public List Args { get; set; } 27 | public FontFamily ArgsFontFamily { get; set; } 28 | public double ArgsFontSize { get; set; } 29 | public Visibility SeparationTextVisible { get; set; } = Visibility.Visible; 30 | public string SeparationText { get; set; } = "--new"; 31 | 32 | public ViewApplyArgsContentDialog() 33 | { 34 | InitializeComponent(); 35 | 36 | this.DataContext = this; 37 | this.Style = Application.Current.Resources["DefaultContentDialogStyle"] as Style; 38 | 39 | ArgsFontFamily = new FontFamily(SettingsManager.Instance.GetValue("PSEUDOCONSOLE", "fontFamily")); 40 | ArgsFontSize = SettingsManager.Instance.GetValue("PSEUDOCONSOLE", "fontSize"); 41 | 42 | DialogTitleTextBlock.Visibility = !string.IsNullOrEmpty(SeparationText) ? Visibility.Visible : Visibility.Collapsed; 43 | } 44 | 45 | private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) 46 | { 47 | 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Controls/Dialogs/Universal/FontSettingsContentDialog.xaml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Helper/Items/ComponentItemsLoaderHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace CDPI_UI.Helper.Items 9 | { 10 | public class ComponentItemsLoaderHelper 11 | { 12 | 13 | private List Components = new List(); 14 | 15 | private static ComponentItemsLoaderHelper _instance; 16 | private static readonly object _lock = new(); 17 | public static ComponentItemsLoaderHelper Instance 18 | { 19 | get 20 | { 21 | lock (_lock) 22 | { 23 | if (_instance == null) 24 | _instance = new ComponentItemsLoaderHelper(); 25 | return _instance; 26 | } 27 | } 28 | } 29 | 30 | private ComponentItemsLoaderHelper() 31 | { 32 | Init(); 33 | } 34 | 35 | public void Init() 36 | { 37 | Components.Clear(); 38 | List configItems = DatabaseHelper.Instance.GetItemsByType("component"); 39 | 40 | foreach (DatabaseStoreItem item in configItems) 41 | { 42 | if (!Path.Exists(item.Directory) || !File.Exists(Path.Combine(item.Directory, item.Executable + ".exe"))) 43 | continue; 44 | 45 | ComponentHelper componentHelper = new(item.Id); 46 | Components.Add(componentHelper); 47 | } 48 | } 49 | 50 | public List GetComponentHelpers() 51 | { 52 | return Components; 53 | } 54 | 55 | public ComponentHelper GetComponentHelperFromId(string id) 56 | { 57 | foreach (ComponentHelper componentHelper in Components) 58 | { 59 | if (componentHelper.Id == id) 60 | return componentHelper; 61 | } 62 | return null; 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Controls/GoodCheck/GoodCheckSitelistButton.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Runtime.InteropServices.WindowsRuntime; 6 | using Windows.Foundation; 7 | using Windows.Foundation.Collections; 8 | using Microsoft.UI.Xaml; 9 | using Microsoft.UI.Xaml.Controls; 10 | using Microsoft.UI.Xaml.Controls.Primitives; 11 | using Microsoft.UI.Xaml.Data; 12 | using Microsoft.UI.Xaml.Input; 13 | using Microsoft.UI.Xaml.Media; 14 | using Microsoft.UI.Xaml.Navigation; 15 | using CDPI_UI.Helper.Static; 16 | 17 | // To learn more about WinUI, the WinUI project structure, 18 | // and more about our project templates, see: http://aka.ms/winui-project-info. 19 | 20 | namespace CDPI_UI; 21 | 22 | public sealed partial class GoodCheckSitelistButton : UserControl 23 | { 24 | public Action RemoveElement; 25 | 26 | public string FilePath = string.Empty; 27 | 28 | public GoodCheckSitelistButton() 29 | { 30 | InitializeComponent(); 31 | } 32 | 33 | public string Title 34 | { 35 | get { return (string)GetValue(TitleProperty); } 36 | set { SetValue(TitleProperty, value); } 37 | } 38 | 39 | public static readonly DependencyProperty TitleProperty = 40 | DependencyProperty.Register( 41 | nameof(Title), typeof(string), typeof(GoodCheckSitelistButton), new PropertyMetadata(string.Empty) 42 | ); 43 | 44 | public string PackName 45 | { 46 | get { return (string)GetValue(PackNameProperty); } 47 | set { SetValue(PackNameProperty, value); } 48 | } 49 | 50 | public static readonly DependencyProperty PackNameProperty = 51 | DependencyProperty.Register( 52 | nameof(PackName), typeof(string), typeof(GoodCheckSitelistButton), new PropertyMetadata(string.Empty) 53 | ); 54 | 55 | private void EditButton_Click(object sender, RoutedEventArgs e) 56 | { 57 | Utils.OpenFileInDefaultApp(FilePath); 58 | } 59 | 60 | private void RemoveButton_Click(object sender, RoutedEventArgs e) 61 | { 62 | RemoveElement?.Invoke(); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Windows/OfflineHelpWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using CDPI_UI.Helper.Static; 2 | using Microsoft.UI.Xaml; 3 | using Microsoft.UI.Xaml.Controls; 4 | using Microsoft.UI.Xaml.Controls.Primitives; 5 | using Microsoft.UI.Xaml.Data; 6 | using Microsoft.UI.Xaml.Input; 7 | using Microsoft.UI.Xaml.Media; 8 | using Microsoft.UI.Xaml.Navigation; 9 | using System; 10 | using System.Collections.Generic; 11 | using System.IO; 12 | using System.Linq; 13 | using System.Runtime.InteropServices.WindowsRuntime; 14 | using Windows.Foundation; 15 | using Windows.Foundation.Collections; 16 | using WinUI3Localizer; 17 | 18 | // To learn more about WinUI, the WinUI project structure, 19 | // and more about our project templates, see: http://aka.ms/winui-project-info. 20 | 21 | namespace CDPI_UI 22 | { 23 | /// 24 | /// An empty window that can be used on its own or navigated to within a Frame. 25 | /// 26 | public sealed partial class OfflineHelpWindow : Window 27 | { 28 | private ILocalizer localizer = Localizer.Get(); 29 | public OfflineHelpWindow() 30 | { 31 | InitializeComponent(); 32 | SetTitleBar(WindowMoveAera); 33 | this.Title = UIHelper.GetWindowName(localizer.GetLocalizedString("OfflineHelpWindowTitle")); 34 | this.ExtendsContentIntoTitleBar = true; 35 | } 36 | 37 | public void NavigateToPage(string uri) 38 | { 39 | // ContentFrame.Navigate(page.GetType()); 40 | } 41 | 42 | private void BackButton_PointerEntered(object sender, PointerRoutedEventArgs e) 43 | { 44 | AnimatedIcon.SetState(this.SearchAnimatedIcon, "PointerOver"); 45 | } 46 | 47 | private void BackButton_PointerExited(object sender, PointerRoutedEventArgs e) 48 | { 49 | AnimatedIcon.SetState(this.SearchAnimatedIcon, "Normal"); 50 | } 51 | 52 | private void BackButton_Click(object sender, RoutedEventArgs e) 53 | { 54 | /* 55 | if (ContentFrame.CanGoBack) 56 | { 57 | ContentFrame.GoBack(); 58 | } 59 | */ 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /CDPIUI_TrayIcon/Helper/Utils.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reflection; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace CDPIUI_TrayIcon.Helper 9 | { 10 | public class Utils 11 | { 12 | public static Assembly Assembly = Assembly.GetExecutingAssembly(); 13 | 14 | public static string GetDataDirectory() 15 | { 16 | try 17 | { 18 | var procPath = Environment.ProcessPath; 19 | return Path.GetDirectoryName(procPath)!; 20 | } 21 | catch (Exception ex) 22 | { 23 | return ""; 24 | } 25 | } 26 | 27 | public static string GetSettingsFile() 28 | { 29 | string filePath = Path.Combine(GetDataDirectory(), "Settings", "Settings.xml"); 30 | 31 | if (File.Exists(filePath)) 32 | { 33 | return filePath; 34 | } 35 | else 36 | { 37 | var localAppData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); 38 | var targetFolder = Path.Combine(localAppData, "CDPIUI"); 39 | string localAppDataFile = Path.Combine(targetFolder, "Settings", "Settings.xml"); 40 | 41 | if (File.Exists(localAppDataFile)) 42 | { 43 | return localAppDataFile; 44 | } 45 | 46 | return filePath; 47 | } 48 | } 49 | 50 | public static void StartUpdate(string targetFile) 51 | { 52 | if (Path.GetExtension(targetFile).ToLower() == ".msi") 53 | { 54 | RunHelper.Run("msiexec.exe", $"/i \"{targetFile}\" /qn+"); 55 | _ = PipeServer.Instance.SendMessage("MAIN:EXIT_ALL"); 56 | Application.Exit(); 57 | } 58 | else 59 | { 60 | RunHelper.Run(Path.Combine(GetDataDirectory(), "Update.exe"), $"--directory-to-zip \"{targetFile}\" --destination-directory \"{GetDataDirectory()}\""); 61 | } 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Controls/GoodCheck/GoodCheckSitelistStrategyChooserControl.xaml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Controls/Dialogs/CreateConfigHelper/ChooseGroupModeContentDialog.xaml: -------------------------------------------------------------------------------- 1 | 2 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Controls/Dialogs/CreateConfigHelper/SelectUsedFilesForConfigContentDialog.xaml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 28 | 29 | 30 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Controls/Dialogs/CreateConfigHelper/RecentGoodCheckSelectionsContentDialog.xaml: -------------------------------------------------------------------------------- 1 | 2 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 26 | 27 | 28 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Controls/ComponentSettings/SettingTileControlElement.xaml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 24 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 100 40 | 200 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Views/UtilsPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Runtime.InteropServices.WindowsRuntime; 6 | using Windows.Foundation; 7 | using Windows.Foundation.Collections; 8 | using Microsoft.UI.Xaml; 9 | using Microsoft.UI.Xaml.Controls; 10 | using Microsoft.UI.Xaml.Controls.Primitives; 11 | using Microsoft.UI.Xaml.Data; 12 | using Microsoft.UI.Xaml.Input; 13 | using Microsoft.UI.Xaml.Media; 14 | using Microsoft.UI.Xaml.Navigation; 15 | using CDPI_UI.Helper; 16 | 17 | // To learn more about WinUI, the WinUI project structure, 18 | // and more about our project templates, see: http://aka.ms/winui-project-info. 19 | 20 | namespace CDPI_UI.Views 21 | { 22 | /// 23 | /// An empty page that can be used on its own or navigated to within a Frame. 24 | /// 25 | public sealed partial class UtilsPage : Page 26 | { 27 | public UtilsPage() 28 | { 29 | this.InitializeComponent(); 30 | 31 | CreateConfigUtilSettingsCard.IsEnabled = DatabaseHelper.Instance.IsItemInstalled(StateHelper.Instance.FindKeyByValue("GoodCheck")); 32 | } 33 | 34 | private void PseudoconsoleSettingsCard_Click(object sender, RoutedEventArgs e) 35 | { 36 | _ = ((App)Application.Current).SafeCreateNewWindow(); 37 | } 38 | 39 | private void StoreSettingsCard_Click(object sender, RoutedEventArgs e) 40 | { 41 | _ = ((App)Application.Current).SafeCreateNewWindow(); 42 | } 43 | 44 | private void CreateConfigUtilSettingsCard_Click(object sender, RoutedEventArgs e) 45 | { 46 | _ = ((App)Application.Current).SafeCreateNewWindow(); 47 | } 48 | 49 | private void CreateConfigHelperSettingsCard_Click(object sender, RoutedEventArgs e) 50 | { 51 | _ = ((App)Application.Current).SafeCreateNewWindow(); 52 | } 53 | 54 | private void OfflineHelpSettingsCard_Click(object sender, RoutedEventArgs e) 55 | { 56 | 57 | } 58 | 59 | private void ProxySettingsCard_Click(object sender, RoutedEventArgs e) 60 | { 61 | _ = ((App)Application.Current).SafeCreateNewWindow(); 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Helper/ApplicationTaskMonitor.cs: -------------------------------------------------------------------------------- 1 | using CDPI_UI.Helper.CreateConfigUtil.GoodCheck; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace CDPI_UI.Helper 9 | { 10 | public class ApplicationTaskMonitor 11 | { 12 | public Action StoreStateChanged; 13 | 14 | private static ApplicationTaskMonitor _instance; 15 | private static readonly object _lock = new object(); 16 | 17 | public static ApplicationTaskMonitor Instance 18 | { 19 | get 20 | { 21 | lock (_lock) 22 | { 23 | if (_instance == null) 24 | _instance = new ApplicationTaskMonitor(); 25 | return _instance; 26 | } 27 | } 28 | } 29 | 30 | private ApplicationTaskMonitor() 31 | { 32 | StoreHelper.Instance.ItemActionsStopped += StoreHelper_ItemActionsStopped; 33 | StoreHelper.Instance.NowProcessItemActions += StoreHelper_NowProcessItemActions; 34 | } 35 | 36 | private void StoreHelper_NowProcessItemActions(string obj) 37 | { 38 | if (!IsStoreWorking()) 39 | { 40 | StoreStateChanged?.Invoke(false); 41 | } 42 | else 43 | { 44 | StoreStateChanged?.Invoke(true); 45 | } 46 | } 47 | 48 | private void StoreHelper_ItemActionsStopped(string obj) 49 | { 50 | if (!IsStoreWorking() || StoreHelper.Instance.GetQueue().Count == 0) 51 | { 52 | StoreStateChanged?.Invoke(false); 53 | } 54 | else 55 | { 56 | StoreStateChanged?.Invoke(true); 57 | } 58 | } 59 | 60 | public static bool IsComponentProcessRunned() 61 | { 62 | return ProcessManager.Instance.processState; 63 | } 64 | 65 | public static bool IsGoodCheckRunned() 66 | { 67 | return GoodCheckProcessHelper.Instance.IsRunned(); 68 | } 69 | 70 | public static bool IsStoreWorking() 71 | { 72 | return StoreHelper.Instance.IsNowUpdatesChecked || !string.IsNullOrEmpty(StoreHelper.Instance.GetCurrentQueueOperationId()); 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Controls/GoodCheck/GoodCheckSitelistButton.xaml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 34 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Helper/MsiInstallerHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading; 6 | using System.Threading.Tasks; 7 | 8 | namespace CDPI_UI.Helper 9 | { 10 | public class MsiInstallerHelper 11 | { 12 | public enum MsiState 13 | { 14 | GettingReady, 15 | Installing, 16 | Complete, 17 | CompleteRestartRequest, 18 | ExceptionHappens 19 | } 20 | public class MsiCallback 21 | { 22 | public string operationId; 23 | public MsiState State; 24 | } 25 | 26 | private TaskCompletionSource _tcs; 27 | public Action callbackAction; 28 | private readonly string _operationId; 29 | private readonly string _filename; 30 | private MsiState _state; 31 | 32 | public MsiInstallerHelper(string operationId, string filename) 33 | { 34 | _operationId = operationId; 35 | _filename = filename; 36 | } 37 | 38 | public async Task Run(CancellationToken ct = default) 39 | { 40 | _tcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); 41 | 42 | using var cts = CancellationTokenSource.CreateLinkedTokenSource(ct); 43 | using (cts.Token.Register(() => _tcs.TrySetCanceled())) 44 | { 45 | PipeClient.Instance.SendMsiInstallMessage(_operationId, _filename, this); 46 | await _tcs.Task.ConfigureAwait(false); 47 | return new MsiCallback() 48 | { 49 | operationId = _operationId, 50 | State = _state, 51 | }; 52 | } 53 | 54 | } 55 | 56 | public void OnResponse(MsiState state) 57 | { 58 | callbackAction?.Invoke(new() 59 | { 60 | operationId = _operationId, 61 | State = state 62 | }); 63 | Logger.Instance.CreateDebugLog(nameof(MsiInstallerHelper), $"STATE {state}"); 64 | _state = state; 65 | 66 | if (state == MsiState.Complete || state == MsiState.CompleteRestartRequest || state == MsiState.ExceptionHappens) 67 | _tcs.TrySetResult(string.Empty); 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Helper/Static/TitleBarHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | using CDPI_UI.Helper; 8 | using Windows.Storage; 9 | using Windows.Storage.Pickers; 10 | using Windows.System; 11 | using Microsoft.UI; 12 | using Microsoft.UI.Xaml; 13 | using Microsoft.UI.Xaml.Controls; 14 | using Microsoft.UI.Xaml.Input; 15 | using Microsoft.UI.Xaml.Navigation; 16 | using WinRT; 17 | using System.Runtime.InteropServices; 18 | using CDPI_UI; 19 | 20 | namespace CDPI_UI.DesktopWap.Helper 21 | { 22 | internal class TitleBarHelper 23 | { 24 | // workaround as Appwindow titlebar doesn't update caption button colors correctly when changed while app is running 25 | // https://task.ms/44172495 26 | 27 | public static Windows.UI.Color ApplySystemThemeToCaptionButtons(Window window) 28 | { 29 | var frame = (Application.Current as CDPI_UI.App).GetRootFrame() as FrameworkElement; 30 | Windows.UI.Color color; 31 | if (frame.ActualTheme == ElementTheme.Dark) 32 | { 33 | color = Colors.White; 34 | } 35 | else 36 | { 37 | color = Colors.Black; 38 | } 39 | SetCaptionButtonColors(window, color); 40 | return color; 41 | } 42 | 43 | public static void SetCaptionButtonColors(Window window, Windows.UI.Color color) 44 | { 45 | var res = Application.Current.Resources; 46 | res["WindowCaptionForeground"] = color; 47 | window.AppWindow.TitleBar.ButtonForegroundColor = color; 48 | } 49 | 50 | public static void SetCaptionButtonBackgroundColors(Window window, Windows.UI.Color? color) 51 | { 52 | var titleBar = window.AppWindow.TitleBar; 53 | titleBar.ButtonBackgroundColor = color; 54 | } 55 | 56 | public static void SetForegroundColor(Window window, Windows.UI.Color? color) 57 | { 58 | var titleBar = window.AppWindow.TitleBar; 59 | titleBar.ForegroundColor = color; 60 | } 61 | 62 | public static void SetBackgroundColor(Window window, Windows.UI.Color? color) 63 | { 64 | var titleBar = window.AppWindow.TitleBar; 65 | titleBar.BackgroundColor = color; 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Controls/Dialogs/CreateConfigHelper/EditConfigVarValueDialog.xaml.cs: -------------------------------------------------------------------------------- 1 | using CDPI_UI.Helper.Items; 2 | using Microsoft.UI.Xaml; 3 | using Microsoft.UI.Xaml.Controls; 4 | using Microsoft.UI.Xaml.Controls.Primitives; 5 | using Microsoft.UI.Xaml.Data; 6 | using Microsoft.UI.Xaml.Input; 7 | using Microsoft.UI.Xaml.Media; 8 | using Microsoft.UI.Xaml.Navigation; 9 | using System; 10 | using System.Collections.Generic; 11 | using System.IO; 12 | using System.Linq; 13 | using System.Runtime.InteropServices.WindowsRuntime; 14 | using Windows.Foundation; 15 | using Windows.Foundation.Collections; 16 | using WinUI3Localizer; 17 | 18 | // To learn more about WinUI, the WinUI project structure, 19 | // and more about our project templates, see: http://aka.ms/winui-project-info. 20 | 21 | namespace CDPI_UI.Controls.Dialogs 22 | { 23 | public sealed partial class EditConfigVarValueDialog : ContentDialog 24 | { 25 | public string VarValue { get; private set; } = string.Empty; 26 | 27 | private ILocalizer localizer = Localizer.Get(); 28 | 29 | public EditConfigVarValueDialog(string varName, string varValue, AvailableVarValues varValues) 30 | { 31 | InitializeComponent(); 32 | this.Title = string.Format(localizer.GetLocalizedString("EditVariableContentDialogTitle"), varName); 33 | VarValueTextBox.Text = varValue; 34 | 35 | DescriptionTextBlock.Text = varValues?.Comment ?? localizer.GetLocalizedString("DescriptionNotProvided"); 36 | 37 | if (varValues != null && varValues.Values.Count > 0) 38 | { 39 | VarValueComboBox.ItemsSource = varValues.Values; 40 | VarValueComboBox.SelectedItem = varValue; 41 | TemplateSelectorStackPanel.Visibility = Visibility.Visible; 42 | } 43 | else 44 | { 45 | TemplateSelectorStackPanel.Visibility = Visibility.Collapsed; 46 | } 47 | } 48 | 49 | private void VarValueComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) 50 | { 51 | string selectedValue = VarValueComboBox.SelectedItem as string; 52 | if (selectedValue != null) 53 | { 54 | VarValueTextBox.Text = selectedValue; 55 | } 56 | } 57 | 58 | private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) 59 | { 60 | VarValue = VarValueTextBox.Text; 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Controls/Store/StoreAskForSubItemInstallUserControl.xaml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 37 | 38 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Windows/Service/PrepareWindow.xaml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Controls/Dialogs/CreateConfigHelper/ImportConfigFromFileDialog.xaml: -------------------------------------------------------------------------------- 1 | 2 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Controls/Store/StoreCategoryButton.xaml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.UI.Input; 2 | using Microsoft.UI.Xaml; 3 | using Microsoft.UI.Xaml.Controls; 4 | using Microsoft.UI.Xaml.Controls.Primitives; 5 | using Microsoft.UI.Xaml.Data; 6 | using Microsoft.UI.Xaml.Input; 7 | using Microsoft.UI.Xaml.Media; 8 | using Microsoft.UI.Xaml.Navigation; 9 | using System; 10 | using System.Collections.Generic; 11 | using System.IO; 12 | using System.Linq; 13 | using System.Runtime.InteropServices.WindowsRuntime; 14 | using Windows.Foundation; 15 | using Windows.Foundation.Collections; 16 | 17 | // To learn more about WinUI, the WinUI project structure, 18 | // and more about our project templates, see: http://aka.ms/winui-project-info. 19 | 20 | namespace CDPI_UI; 21 | 22 | public sealed partial class StoreCategoryButton : UserControl 23 | { 24 | public Action Click; 25 | public UIElement textElement; 26 | 27 | public StoreCategoryButton() 28 | { 29 | InitializeComponent(); 30 | 31 | this.ProtectedCursor = InputSystemCursor.Create(InputSystemCursorShape.Hand); 32 | 33 | PART_BackgroundRect.Visibility = Visibility.Collapsed; 34 | AnimToPrimary.Begin(); 35 | 36 | textElement = MainTextBlock; 37 | } 38 | public string Text 39 | { 40 | get { return (string)GetValue(TextProperty); } 41 | set { SetValue(TextProperty, value); } 42 | } 43 | 44 | public static readonly DependencyProperty TextProperty = 45 | DependencyProperty.Register( 46 | nameof(Text), typeof(string), typeof(StoreCategoryButton), new PropertyMetadata(string.Empty) 47 | ); 48 | 49 | public string Id 50 | { 51 | get { return (string)GetValue(IdProperty); } 52 | set { SetValue(IdProperty, value); } 53 | } 54 | 55 | public static readonly DependencyProperty IdProperty = 56 | DependencyProperty.Register( 57 | nameof(Id), typeof(string), typeof(StoreCategoryButton), new PropertyMetadata(string.Empty) 58 | ); 59 | 60 | private void Button_PointerEntered(object sender, PointerRoutedEventArgs e) 61 | { 62 | PART_BackgroundRect.Visibility = Visibility.Visible; 63 | AnimToPrimary.Stop(); 64 | AnimToSecondary.Begin(); 65 | 66 | } 67 | 68 | private void Button_PointerExited(object sender, PointerRoutedEventArgs e) 69 | { 70 | PART_BackgroundRect.Visibility = Visibility.Collapsed; 71 | AnimToSecondary.Stop(); 72 | AnimToPrimary.Begin(); 73 | 74 | } 75 | 76 | private void PART_Button_Click(object sender, RoutedEventArgs e) 77 | { 78 | Click?.Invoke(this); 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Controls/Store/StoreItemLinkButton.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Runtime.InteropServices.WindowsRuntime; 6 | using Windows.Foundation; 7 | using Windows.Foundation.Collections; 8 | using Microsoft.UI.Xaml; 9 | using Microsoft.UI.Xaml.Controls; 10 | using Microsoft.UI.Xaml.Controls.Primitives; 11 | using Microsoft.UI.Xaml.Data; 12 | using Microsoft.UI.Xaml.Input; 13 | using Microsoft.UI.Xaml.Media; 14 | using Microsoft.UI.Xaml.Navigation; 15 | 16 | // To learn more about WinUI, the WinUI project structure, 17 | // and more about our project templates, see: http://aka.ms/winui-project-info. 18 | 19 | namespace CDPI_UI; 20 | 21 | public sealed partial class StoreItemLinkButton : UserControl 22 | { 23 | public StoreItemLinkButton() 24 | { 25 | InitializeComponent(); 26 | } 27 | 28 | public string Text 29 | { 30 | get { return (string)GetValue(TextProperty); } 31 | set { SetValue(TextProperty, value); } 32 | } 33 | 34 | public static readonly DependencyProperty TextProperty = 35 | DependencyProperty.Register( 36 | nameof(Text), typeof(string), typeof(StoreItemLinkButton), new PropertyMetadata(string.Empty) 37 | ); 38 | 39 | public string Url 40 | { 41 | get { return (string)GetValue(UrlProperty); } 42 | set { SetValue(UrlProperty, value); } 43 | } 44 | 45 | public static readonly DependencyProperty UrlProperty = 46 | DependencyProperty.Register( 47 | nameof(Url), typeof(string), typeof(StoreItemLinkButton), new PropertyMetadata(string.Empty) 48 | ); 49 | 50 | public string SiteIcon 51 | { 52 | get { return (string)GetValue(SiteIconProperty); } 53 | set { SetValue(SiteIconProperty, value); } 54 | } 55 | 56 | public static readonly DependencyProperty SiteIconProperty = 57 | DependencyProperty.Register( 58 | nameof(SiteIcon), typeof(string), typeof(StoreItemLinkButton), new PropertyMetadata("\uE774") 59 | ); 60 | 61 | public string ActionIcon 62 | { 63 | get { return (string)GetValue(ActionIconProperty); } 64 | set { SetValue(ActionIconProperty, value); } 65 | } 66 | 67 | public static readonly DependencyProperty ActionIconProperty = 68 | DependencyProperty.Register( 69 | nameof(ActionIcon), typeof(string), typeof(StoreItemLinkButton), new PropertyMetadata("\uE8A7") 70 | ); 71 | 72 | private async void Button_Click(object sender, RoutedEventArgs e) 73 | { 74 | _ = await Windows.System.Launcher.LaunchUriAsync(new Uri(Url)); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Controls/Dialogs/ComponentSettings/ViewApplyArgsContentDialog.xaml: -------------------------------------------------------------------------------- 1 | 2 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 30 | 31 | 33 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /CDPIUI_TrayIcon/app.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 42 | 50 | 51 | 52 | 53 | 54 | 55 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Windows/ViewGoodCheckOutputWindow.xaml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 46 | 47 | 48 | 49 | 57 | 58 | 59 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /CDPIUI_TrayIcon/Helper/Settings/AutoStartManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using Microsoft.Win32.TaskScheduler; 8 | 9 | namespace CDPIUI_TrayIcon.Helper 10 | { 11 | public static class AutoStartManager 12 | { 13 | private const string TaskName = "CDPIUI_Autostart"; 14 | 15 | public static bool AddToAutorun() 16 | { 17 | try 18 | { 19 | string? executablePath = Environment.ProcessPath; 20 | if (executablePath == null) 21 | return false; 22 | 23 | using (TaskService taskService = new TaskService()) 24 | { 25 | Microsoft.Win32.TaskScheduler.Task existingTask = taskService.GetTask(TaskName); 26 | if (existingTask != null) 27 | { 28 | taskService.RootFolder.DeleteTask(TaskName); 29 | } 30 | 31 | TaskDefinition taskDefinition = taskService.NewTask(); 32 | taskDefinition.RegistrationInfo.Description = "Starting CDPI UI with highest rights when user logs in."; 33 | taskDefinition.RegistrationInfo.Author = "CDPI UI Tray Icon"; 34 | 35 | LogonTrigger trigger = new LogonTrigger 36 | { 37 | UserId = System.Security.Principal.WindowsIdentity.GetCurrent().Name, 38 | }; 39 | taskDefinition.Triggers.Add(trigger); 40 | 41 | taskDefinition.Actions.Add(new ExecAction(executablePath, "--autorun", null)); 42 | 43 | taskDefinition.Principal.RunLevel = TaskRunLevel.Highest; 44 | 45 | taskDefinition.Principal.UserId = System.Security.Principal.WindowsIdentity.GetCurrent().Name; 46 | taskDefinition.Principal.LogonType = TaskLogonType.InteractiveToken; 47 | 48 | taskService.RootFolder.RegisterTaskDefinition(TaskName, taskDefinition); 49 | } 50 | return true; 51 | } 52 | catch (Exception ex) 53 | { 54 | Logger.Instance.CreateErrorLog(nameof(AutoStartManager), $"Autorun error: {ex.Message}"); 55 | } 56 | return false; 57 | } 58 | 59 | public static bool RemoveFromAutorun() 60 | { 61 | try 62 | { 63 | using (TaskService taskService = new TaskService()) 64 | { 65 | taskService.RootFolder.DeleteTask(TaskName, false); 66 | } 67 | return true; 68 | } 69 | catch (Exception ex) 70 | { 71 | Logger.Instance.CreateErrorLog(nameof(AutoStartManager), $"Autorun error: {ex}"); 72 | } 73 | return false; 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Controls/Store/StoreItemMicroButton.xaml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 18 | 19 | 20 | 21 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Helper/Items/ComponentHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace CDPI_UI.Helper.Items 9 | { 10 | public class ComponentHelper 11 | { 12 | public readonly string Id; 13 | 14 | private string ExecutablePath; 15 | private string Directory; 16 | private DatabaseStoreItem DatabaseStoreItem; 17 | 18 | private readonly ConfigHelper ConfigHelper; 19 | 20 | public Action ConfigListUpdated; 21 | 22 | public ComponentHelper(string id) 23 | { 24 | Id = id; 25 | 26 | DatabaseStoreItem = DatabaseHelper.Instance.GetItemById(Id); 27 | 28 | Directory = DatabaseStoreItem.Directory; 29 | ExecutablePath = Path.Combine(DatabaseStoreItem.Directory, DatabaseStoreItem.Executable + ".exe"); 30 | 31 | ConfigHelper = new(id); 32 | ConfigHelper.Init(); 33 | } 34 | 35 | public void ReInitConfigs() 36 | { 37 | ConfigHelper.Init(); 38 | ConfigListUpdated?.Invoke(); 39 | } 40 | 41 | public ConfigHelper GetConfigHelper() 42 | { 43 | return ConfigHelper; 44 | } 45 | 46 | public string GetExecutablePath() 47 | { 48 | if (File.Exists(ExecutablePath)) 49 | return ExecutablePath; 50 | 51 | return TryGetNewPath(); 52 | } 53 | 54 | public string GetDirectory() 55 | { 56 | if (File.Exists(Directory)) 57 | return Directory; 58 | 59 | return TryGetNewDirectory(); 60 | } 61 | 62 | public string GetStartupParams() 63 | { 64 | string configId = SettingsManager.Instance.GetValue(["CONFIGS", Id], "configId"); 65 | string configFile = SettingsManager.Instance.GetValue(["CONFIGS", Id], "configFile"); 66 | 67 | return ConfigHelper.GetStartupParameters(configFile, configId); 68 | } 69 | 70 | private string TryGetNewPath() 71 | { 72 | string localAppData = StateHelper.GetDataDirectory(); 73 | string localItemsFolder = Path.Combine( 74 | localAppData, StateHelper.StoreDirName, StateHelper.StoreItemsDirName); 75 | ExecutablePath = Path.Combine(localItemsFolder, Id, DatabaseStoreItem.Executable + ".exe"); 76 | return File.Exists(ExecutablePath) ? ExecutablePath : null; 77 | } 78 | private string TryGetNewDirectory() 79 | { 80 | string localAppData = StateHelper.GetDataDirectory(); 81 | string localItemsFolder = Path.Combine( 82 | localAppData, StateHelper.StoreDirName, StateHelper.StoreItemsDirName); 83 | Directory = Path.Combine(localItemsFolder, Id); 84 | return Path.Exists(Directory) ? Directory : null; 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace CDPI_UI.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CDPI_UI.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Update/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Update.Properties 12 | { 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// Returns the cached ResourceManager instance used by this class. 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Update.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// Overrides the current thread's CurrentUICulture property for all 56 | /// resource lookups using this strongly typed resource class. 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Helper/Static/RegeditHelper.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Win32; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel; 5 | using System.Linq; 6 | using System.Runtime.InteropServices; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace CDPI_UI.Helper.Static 11 | { 12 | public static class RegeditHelper 13 | { 14 | public const string InternetSettingsKeyPath = @"Software\Microsoft\Windows\CurrentVersion\Internet Settings"; 15 | private const int INTERNET_OPTION_SETTINGS_CHANGED = 39; 16 | private const int INTERNET_OPTION_REFRESH = 37; 17 | 18 | [DllImport("wininet.dll", SetLastError = true)] 19 | private static extern bool InternetSetOption(IntPtr hInternet, int dwOption, IntPtr lpBuffer, int dwBufferLength); 20 | 21 | public static Dictionary ReadProxySettings() 22 | { 23 | var result = new Dictionary(StringComparer.OrdinalIgnoreCase) 24 | { 25 | ["ProxyServer"] = string.Empty, 26 | ["ProxyOverride"] = string.Empty 27 | }; 28 | 29 | using (var key = Registry.CurrentUser.OpenSubKey(InternetSettingsKeyPath, writable: false)) 30 | { 31 | if (key != null) 32 | { 33 | var proxyServer = key.GetValue("ProxyServer") as string ?? string.Empty; 34 | var proxyOverride = key.GetValue("ProxyOverride") as string ?? string.Empty; 35 | 36 | result["ProxyServer"] = proxyServer; 37 | result["ProxyOverride"] = proxyOverride; 38 | } 39 | } 40 | 41 | return result; 42 | } 43 | 44 | public static void SaveProxySettings(string proxyServer, string proxyOverride, int proxyEnable) 45 | { 46 | if (proxyEnable != 0 && proxyEnable != 1) 47 | throw new ArgumentOutOfRangeException(nameof(proxyEnable), "ERR_REGEDIT_HELPER_INTERNAL"); 48 | 49 | using (var key = Registry.CurrentUser.CreateSubKey(InternetSettingsKeyPath)) 50 | { 51 | if (key == null) 52 | throw new InvalidOperationException("ERR_REGISTRY_WRITE"); 53 | 54 | key.SetValue("ProxyServer", proxyServer ?? string.Empty, RegistryValueKind.String); 55 | key.SetValue("ProxyOverride", proxyOverride ?? string.Empty, RegistryValueKind.String); 56 | key.SetValue("ProxyEnable", proxyEnable, RegistryValueKind.DWord); 57 | } 58 | 59 | if (!InternetSetOption(IntPtr.Zero, INTERNET_OPTION_SETTINGS_CHANGED, IntPtr.Zero, 0)) 60 | { 61 | throw new Win32Exception(Marshal.GetLastWin32Error(), "ERR_WININET_CALL"); 62 | } 63 | 64 | if (!InternetSetOption(IntPtr.Zero, INTERNET_OPTION_REFRESH, IntPtr.Zero, 0)) 65 | { 66 | throw new Win32Exception(Marshal.GetLastWin32Error(), "ERR_WININET_CALL"); 67 | } 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Controls/Dialogs/CreateConfigHelper/SelectConfigToEditContentDialog.xaml: -------------------------------------------------------------------------------- 1 | 2 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 38 | 39 | 40 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Views/SetupProxy/MainPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using CDPI_UI.Helper; 2 | using CDPI_UI.Messages; 3 | using Microsoft.UI.Xaml; 4 | using Microsoft.UI.Xaml.Controls; 5 | using Microsoft.UI.Xaml.Controls.Primitives; 6 | using Microsoft.UI.Xaml.Data; 7 | using Microsoft.UI.Xaml.Input; 8 | using Microsoft.UI.Xaml.Media; 9 | using Microsoft.UI.Xaml.Media.Animation; 10 | using Microsoft.UI.Xaml.Navigation; 11 | using System; 12 | using System.Collections.Generic; 13 | using System.IO; 14 | using System.Linq; 15 | using System.Runtime.InteropServices.WindowsRuntime; 16 | using Windows.Foundation; 17 | using Windows.Foundation.Collections; 18 | using Windows.Foundation.Metadata; 19 | 20 | // To learn more about WinUI, the WinUI project structure, 21 | // and more about our project templates, see: http://aka.ms/winui-project-info. 22 | 23 | namespace CDPI_UI.Views.SetupProxy; 24 | 25 | /// 26 | /// An empty page that can be used on its own or navigated to within a Frame. 27 | /// 28 | public sealed partial class MainPage : Page 29 | { 30 | public MainPage() 31 | { 32 | InitializeComponent(); 33 | } 34 | 35 | protected override void OnNavigatedTo(NavigationEventArgs e) 36 | { 37 | base.OnNavigatedTo(e); 38 | var anim = ConnectedAnimationService.GetForCurrentView().GetAnimation("BackwardConnectedAnimation"); 39 | if (anim != null) 40 | { 41 | anim.TryStart(ActionButtonsGrid); 42 | } 43 | } 44 | 45 | private void SetupForSystemCard_Click(object sender, RoutedEventArgs e) 46 | { 47 | Navigate(); 48 | } 49 | 50 | private void Navigate() where T : Page 51 | { 52 | var anim = ConnectedAnimationService.GetForCurrentView().PrepareToAnimate("ForwardConnectedAnimation", ActionButtonsGrid); 53 | 54 | if (ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 7)) 55 | { 56 | anim.Configuration = new DirectConnectedAnimationConfiguration(); 57 | } 58 | 59 | Frame.Navigate(typeof(T), null, new SlideNavigationTransitionInfo() { Effect = SlideNavigationTransitionEffect.FromRight }); 60 | } 61 | 62 | private void CancelButton_Click(object sender, RoutedEventArgs e) 63 | { 64 | ((App)Application.Current).CloseWindow(); 65 | } 66 | 67 | private void GetHelpButton_Click(object sender, RoutedEventArgs e) 68 | { 69 | // TODO: Open help link 70 | } 71 | 72 | private void SetupManuallyCard_Click(object sender, RoutedEventArgs e) 73 | { 74 | Navigate(); 75 | } 76 | 77 | private async void ProxiFyreCard_Click(object sender, RoutedEventArgs e) 78 | { 79 | if (!DatabaseHelper.Instance.IsItemInstalled("ASPEWK002")) 80 | { 81 | var window = await ((App)Application.Current).SafeCreateNewWindow(); 82 | window.SetItemToViewId("ASPEWK002"); 83 | } 84 | else 85 | { 86 | Navigate(); 87 | } 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Views/Store/LibraryPage.xaml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 41 | 42 | 43 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Views/CreateConfigUtil/MainPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using CDPI_UI.Helper; 2 | using Microsoft.UI.Xaml; 3 | using Microsoft.UI.Xaml.Controls; 4 | using Microsoft.UI.Xaml.Controls.Primitives; 5 | using Microsoft.UI.Xaml.Data; 6 | using Microsoft.UI.Xaml.Input; 7 | using Microsoft.UI.Xaml.Media; 8 | using Microsoft.UI.Xaml.Media.Animation; 9 | using Microsoft.UI.Xaml.Navigation; 10 | using System; 11 | using System.Collections.Generic; 12 | using System.Collections.ObjectModel; 13 | using System.IO; 14 | using System.Linq; 15 | using System.Runtime.InteropServices.WindowsRuntime; 16 | using Windows.Foundation; 17 | using Windows.Foundation.Collections; 18 | 19 | // To learn more about WinUI, the WinUI project structure, 20 | // and more about our project templates, see: http://aka.ms/winui-project-info. 21 | 22 | namespace CDPI_UI.Views.CreateConfigUtil 23 | { 24 | /// 25 | /// An empty page that can be used on its own or navigated to within a Frame. 26 | /// 27 | public sealed partial class MainPage : Page 28 | { 29 | private ObservableCollection items = []; 30 | private List supportedComponents = ["Zapret", "GoodbyeDPI", "ByeDPI"]; 31 | public MainPage() 32 | { 33 | InitializeComponent(); 34 | ComponentChooseComboBox.ItemsSource = items; 35 | GetReadyVariants(); 36 | 37 | } 38 | private void GetReadyVariants() 39 | { 40 | items.Clear(); 41 | foreach (var item in DatabaseHelper.Instance.GetItemsByType("component")) 42 | { 43 | ComboBoxItem comboBoxItem = new() 44 | { 45 | Content = item.ShortName, 46 | Tag = item.Id 47 | }; 48 | items.Add(comboBoxItem); 49 | } 50 | if (items.Count > 0) 51 | { 52 | ComponentChooseComboBox.SelectedIndex = 0; 53 | } 54 | else 55 | { 56 | GoodCheckSelectionPanel.Visibility = Visibility.Collapsed; 57 | } 58 | } 59 | 60 | private void CancelButton_Click(object sender, RoutedEventArgs e) 61 | { 62 | CreateConfigUtilWindow.Instance.Close(); 63 | } 64 | 65 | private void BeginNewSelectionButton_Click(object sender, RoutedEventArgs e) 66 | { 67 | Frame.Navigate(typeof(CreateViaGoodCheck), ((ComboBoxItem)ComponentChooseComboBox.SelectedItem).Tag, new SuppressNavigationTransitionInfo()); 68 | } 69 | 70 | private void GetHelpButton_Click(object sender, RoutedEventArgs e) 71 | { 72 | 73 | } 74 | 75 | private void ComponentChooseComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) 76 | { 77 | if (!supportedComponents.Contains(((ComboBoxItem)ComponentChooseComboBox.SelectedItem).Content)) 78 | { 79 | GoodCheckSelectionPanel.Visibility = Visibility.Collapsed; 80 | } 81 | else 82 | { 83 | GoodCheckSelectionPanel.Visibility = Visibility.Visible; 84 | } 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /CDPIUI_TrayIcon/Helper/Basic/RegeditHelper.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Win32; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel; 5 | using System.Linq; 6 | using System.Runtime.InteropServices; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace CDPIUI_TrayIcon.Helper 11 | { 12 | public static class RegeditHelper 13 | { 14 | public const string InternetSettingsKeyPath = @"Software\Microsoft\Windows\CurrentVersion\Internet Settings"; 15 | private const int INTERNET_OPTION_SETTINGS_CHANGED = 39; 16 | private const int INTERNET_OPTION_REFRESH = 37; 17 | 18 | [DllImport("wininet.dll", SetLastError = true)] 19 | private static extern bool InternetSetOption(IntPtr hInternet, int dwOption, IntPtr lpBuffer, int dwBufferLength); 20 | 21 | public static Dictionary ReadProxySettings() 22 | { 23 | var result = new Dictionary(StringComparer.OrdinalIgnoreCase) 24 | { 25 | ["ProxyServer"] = string.Empty, 26 | ["ProxyOverride"] = string.Empty 27 | }; 28 | 29 | using (var key = Registry.CurrentUser.OpenSubKey(InternetSettingsKeyPath, writable: false)) 30 | { 31 | if (key != null) 32 | { 33 | var proxyServer = key.GetValue("ProxyServer") as string ?? string.Empty; 34 | var proxyOverride = key.GetValue("ProxyOverride") as string ?? string.Empty; 35 | 36 | result["ProxyServer"] = proxyServer; 37 | result["ProxyOverride"] = proxyOverride; 38 | } 39 | } 40 | 41 | return result; 42 | } 43 | 44 | public static void SaveProxySettings(string proxyServer, string proxyOverride, int proxyEnable) 45 | { 46 | if (proxyEnable != 0 && proxyEnable != 1) 47 | throw new ArgumentOutOfRangeException(nameof(proxyEnable), "ERR_REGEDIT_HELPER_INTERNAL"); 48 | 49 | using (var key = Registry.CurrentUser.CreateSubKey(InternetSettingsKeyPath)) 50 | { 51 | if (key == null) 52 | throw new InvalidOperationException("ERR_REGISTRY_WRITE"); 53 | 54 | if (!string.IsNullOrEmpty(proxyServer)) 55 | key.SetValue("ProxyServer", proxyServer ?? string.Empty, RegistryValueKind.String); 56 | 57 | if (!string.IsNullOrEmpty(proxyOverride)) 58 | key.SetValue("ProxyOverride", proxyOverride ?? string.Empty, RegistryValueKind.String); 59 | 60 | key.SetValue("ProxyEnable", proxyEnable, RegistryValueKind.DWord); 61 | } 62 | 63 | if (!InternetSetOption(IntPtr.Zero, INTERNET_OPTION_SETTINGS_CHANGED, IntPtr.Zero, 0)) 64 | { 65 | throw new Win32Exception(Marshal.GetLastWin32Error(), "ERR_WININET_CALL"); 66 | } 67 | 68 | if (!InternetSetOption(IntPtr.Zero, INTERNET_OPTION_REFRESH, IntPtr.Zero, 0)) 69 | { 70 | throw new Win32Exception(Marshal.GetLastWin32Error(), "ERR_WININET_CALL"); 71 | } 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Controls/Dialogs/Universal/FontSettingsContentDialog.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Runtime.InteropServices.WindowsRuntime; 6 | using Windows.Foundation; 7 | using Windows.Foundation.Collections; 8 | using Microsoft.UI.Xaml; 9 | using Microsoft.UI.Xaml.Controls; 10 | using Microsoft.UI.Xaml.Controls.Primitives; 11 | using Microsoft.UI.Xaml.Data; 12 | using Microsoft.UI.Xaml.Input; 13 | using Microsoft.UI.Xaml.Media; 14 | using Microsoft.UI.Xaml.Navigation; 15 | using System.Windows.Forms; 16 | using CDPI_UI.Helper; 17 | using Application = Microsoft.UI.Xaml.Application; 18 | using TextBox = Microsoft.UI.Xaml.Controls.TextBox; 19 | using CDPI_UI.Helper.Static; 20 | 21 | // To learn more about WinUI, the WinUI project structure, 22 | // and more about our project templates, see: http://aka.ms/winui-project-info. 23 | 24 | namespace CDPI_UI.Controls.Dialogs; 25 | 26 | public sealed partial class FontSettingsContentDialog : ContentDialog 27 | { 28 | public string FontName { get; set; } 29 | public new int FontSize { get; set; } 30 | 31 | public FontSettingsContentDialog() 32 | { 33 | InitializeComponent(); 34 | 35 | this.Style = Application.Current.Resources["DefaultContentDialogStyle"] as Style; 36 | 37 | List monoFonts = new List 38 | { 39 | "Consolas", 40 | "Courier New", 41 | "Lucida Console", 42 | "Cascadia Code", 43 | "Cascadia Mono" 44 | }; 45 | 46 | List fontSize = new() 47 | { 48 | "8", "9", "10", "11", "12", "14", "16", "18", "20", "24", "28", "36", "48", "72" 49 | }; 50 | 51 | FontChooseComboBox.ItemsSource = monoFonts; 52 | FontChooseComboBox.SelectedItem = SettingsManager.Instance.GetValue("PSEUDOCONSOLE", "fontFamily"); 53 | FontSizeComboBox.ItemsSource = fontSize; 54 | FontSizeComboBox.SelectedValue = SettingsManager.Instance.GetValue("PSEUDOCONSOLE", "fontSize").ToString(); 55 | } 56 | 57 | private void ContentDialog_SecondaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) 58 | { 59 | this.Hide(); 60 | } 61 | 62 | private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) 63 | { 64 | bool result = int.TryParse(FontSizeComboBox.SelectedItem.ToString(), out int size); 65 | FontName = FontChooseComboBox.SelectedItem.ToString(); 66 | FontSize = (int)SettingsManager.Instance.GetValue("PSEUDOCONSOLE", "fontSize"); 67 | 68 | if (!result) 69 | { 70 | WarningText.Visibility = Visibility.Visible; 71 | return; 72 | } 73 | 74 | 75 | FontSize = size; 76 | } 77 | 78 | private void FontSizeComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) 79 | { 80 | bool result = int.TryParse(FontSizeComboBox.SelectedItem.ToString(), out int size); 81 | 82 | if (!result) 83 | { 84 | WarningText.Visibility = Visibility.Visible; 85 | IsPrimaryButtonEnabled = false; 86 | return; 87 | } 88 | IsPrimaryButtonEnabled = true; 89 | WarningText.Visibility = Visibility.Collapsed; 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Controls/CreateConfigHelper/ConditionUserControl.xaml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 48 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Common/Win32.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | using static CDPI_UI.App; 4 | 5 | namespace CDPI_UI 6 | { 7 | internal static class Win32 8 | { 9 | [DllImport("user32.dll", CharSet = CharSet.Auto)] 10 | public static extern IntPtr SendMessage(IntPtr hWnd, int Msg, int wParam, IntPtr lParam); 11 | 12 | [DllImport("user32.dll")] 13 | public static extern IntPtr LoadIcon(IntPtr hInstance, IntPtr lpIconName); 14 | 15 | [DllImport("user32.dll")] 16 | public static extern IntPtr GetActiveWindow(); 17 | 18 | [DllImport("kernel32.dll", CharSet = CharSet.Auto)] 19 | public static extern IntPtr GetModuleHandle(IntPtr moduleName); 20 | 21 | [DllImport("User32.dll")] 22 | internal static extern int GetDpiForWindow(IntPtr hwnd); 23 | 24 | [DllImport("user32.dll", EntryPoint = "SetWindowLong")] 25 | internal static extern int SetWindowLong32(IntPtr hWnd, WindowLongIndexFlags nIndex, WinProc newProc); 26 | 27 | [DllImport("user32.dll", EntryPoint = "SetWindowLongPtr")] 28 | internal static extern IntPtr SetWindowLongPtr64(IntPtr hWnd, WindowLongIndexFlags nIndex, WinProc newProc); 29 | 30 | [DllImport("user32.dll")] 31 | internal static extern IntPtr CallWindowProc(IntPtr lpPrevWndFunc, IntPtr hWnd, WindowMessage Msg, IntPtr wParam, IntPtr lParam); 32 | 33 | [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)] 34 | private static extern uint GetCurrentThreadId(); 35 | 36 | [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)] 37 | private static extern int SetWindowsHookEx(int idHook, HookProc lpfn, IntPtr hInstance, int threadId); 38 | 39 | [DllImport("User32.dll", SetLastError = true, CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)] 40 | public static extern int CallNextHookEx(int idHook, int nCode, IntPtr wParam, IntPtr lParam); 41 | 42 | 43 | public static int SetWindowKeyHook(HookProc hookProc) 44 | { 45 | return SetWindowsHookEx(WH_KEYBOARD, hookProc, GetModuleHandle(IntPtr.Zero), (int)GetCurrentThreadId()); 46 | } 47 | 48 | public static bool IsKeyDownHook(IntPtr lWord) 49 | { 50 | // The 30th bit tells what the previous key state is with 0 being the "UP" state 51 | // For more info see https://learn.microsoft.com/windows/win32/winmsg/keyboardproc#lparam-in 52 | return (lWord >> 30 & 1) == 0; 53 | } 54 | 55 | public const int WM_ACTIVATE = 0x0006; 56 | public const int WA_ACTIVE = 0x01; 57 | public const int WA_INACTIVE = 0x00; 58 | public const int WH_KEYBOARD = 2; 59 | public const int WM_KEYDOWN = 0x0104; 60 | 61 | public const int WM_SETICON = 0x0080; 62 | public const int ICON_SMALL = 0; 63 | public const int ICON_BIG = 1; 64 | 65 | internal delegate IntPtr WinProc(IntPtr hWnd, WindowMessage Msg, IntPtr wParam, IntPtr lParam); 66 | public delegate int HookProc(int nCode, IntPtr wParam, IntPtr lParam); 67 | 68 | [Flags] 69 | internal enum WindowLongIndexFlags : int 70 | { 71 | GWL_WNDPROC = -4, 72 | } 73 | 74 | internal enum WindowMessage : int 75 | { 76 | WM_GETMINMAXINFO = 0x0024, 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Controls/ComponentSettings/SettingTile.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Runtime.InteropServices.WindowsRuntime; 6 | using Windows.Foundation; 7 | using Windows.Foundation.Collections; 8 | using Microsoft.UI.Xaml; 9 | using Microsoft.UI.Xaml.Controls; 10 | using Microsoft.UI.Xaml.Controls.Primitives; 11 | using Microsoft.UI.Xaml.Data; 12 | using Microsoft.UI.Xaml.Input; 13 | using Microsoft.UI.Xaml.Media; 14 | using Microsoft.UI.Xaml.Navigation; 15 | using Microsoft.UI.Xaml.Markup; 16 | 17 | // To learn more about WinUI, the WinUI project structure, 18 | // and more about our project templates, see: http://aka.ms/winui-project-info. 19 | 20 | namespace CDPI_UI; 21 | 22 | public sealed partial class SettingTile : UserControl 23 | { 24 | public SettingTile() 25 | { 26 | InitializeComponent(); 27 | } 28 | 29 | public string Title 30 | { 31 | get { return (string)GetValue(TitleProperty); } 32 | set 33 | { 34 | SetValue(TitleProperty, value); 35 | if (!string.IsNullOrEmpty(value)) 36 | { 37 | TitleTextBlock.Visibility = Visibility.Visible; 38 | } 39 | else 40 | { 41 | TitleTextBlock.Visibility = Visibility.Collapsed; 42 | } 43 | } 44 | } 45 | 46 | public static readonly DependencyProperty TitleProperty = 47 | DependencyProperty.Register( 48 | nameof(Title), typeof(string), typeof(SettingTile), new PropertyMetadata(string.Empty) 49 | ); 50 | 51 | public string Description 52 | { 53 | get { return (string)GetValue(DescriptionProperty); } 54 | set { 55 | SetValue(DescriptionProperty, value); 56 | if (!string.IsNullOrEmpty(value)) 57 | { 58 | DescriptionTextBlock.Visibility = Visibility.Visible; 59 | } 60 | else 61 | { 62 | DescriptionTextBlock.Visibility = Visibility.Collapsed; 63 | } 64 | } 65 | } 66 | 67 | public static readonly DependencyProperty DescriptionProperty = 68 | DependencyProperty.Register( 69 | nameof(Description), typeof(string), typeof(SettingTile), new PropertyMetadata(string.Empty) 70 | ); 71 | 72 | public string IconGlyph 73 | { 74 | get { return (string)GetValue(IconGlyphProperty); } 75 | set { 76 | SetValue(IconGlyphProperty, value); 77 | if (!string.IsNullOrEmpty(value)) 78 | { 79 | FontIcon.Visibility = Visibility.Visible; 80 | } 81 | else 82 | { 83 | FontIcon.Visibility = Visibility.Collapsed; 84 | } 85 | } 86 | } 87 | 88 | public static readonly DependencyProperty IconGlyphProperty = 89 | DependencyProperty.Register( 90 | nameof(IconGlyph), typeof(string), typeof(SettingTile), new PropertyMetadata(string.Empty) 91 | ); 92 | 93 | public object InnerContent 94 | { 95 | get { return (object)GetValue(InnerContentProperty); } 96 | set { SetValue(InnerContentProperty, value); } 97 | } 98 | 99 | public static readonly DependencyProperty InnerContentProperty = 100 | DependencyProperty.Register(nameof(InnerContent), typeof(object), typeof(SettingTile), new PropertyMetadata(null)); 101 | 102 | 103 | } 104 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Controls/Dialogs/CreateConfigHelper/ChooseGroupModeContentDialog.xaml.cs: -------------------------------------------------------------------------------- 1 | using CDPI_UI.Helper; 2 | using Microsoft.UI.Xaml; 3 | using Microsoft.UI.Xaml.Controls; 4 | using Microsoft.UI.Xaml.Controls.Primitives; 5 | using Microsoft.UI.Xaml.Data; 6 | using Microsoft.UI.Xaml.Input; 7 | using Microsoft.UI.Xaml.Media; 8 | using Microsoft.UI.Xaml.Navigation; 9 | using System; 10 | using System.Collections.Generic; 11 | using System.Collections.ObjectModel; 12 | using System.IO; 13 | using System.Linq; 14 | using System.Runtime.InteropServices.WindowsRuntime; 15 | using Windows.Foundation; 16 | using Windows.Foundation.Collections; 17 | using WinUI3Localizer; 18 | using static CDPI_UI.Controls.Dialogs.CreateConfigHelper.ChooseGroupModeContentDialog; 19 | 20 | // To learn more about WinUI, the WinUI project structure, 21 | // and more about our project templates, see: http://aka.ms/winui-project-info. 22 | 23 | namespace CDPI_UI.Controls.Dialogs.CreateConfigHelper; 24 | 25 | public class ByeDPIModeComboBoxItem 26 | { 27 | public ByeDPIGroupModes Mode; 28 | public string DisplayName; 29 | public string DisplayTip; 30 | } 31 | 32 | public sealed partial class ChooseGroupModeContentDialog : ContentDialog 33 | { 34 | public enum ByeDPIGroupModes 35 | { 36 | Torst, 37 | Redirect, 38 | SslErr, 39 | None 40 | } 41 | 42 | private ObservableCollection _modes = []; 43 | 44 | private ILocalizer localizer = Localizer.Get(); 45 | 46 | public List Result { get; private set; } = []; 47 | 48 | public ChooseGroupModeContentDialog(List modes) 49 | { 50 | InitializeComponent(); 51 | 52 | QHelpTextBlock.FontFamily = new FontFamily(SettingsManager.Instance.GetValue("PSEUDOCONSOLE", "fontFamily")); 53 | QHelpTextBlock.FontSize = SettingsManager.Instance.GetValue("PSEUDOCONSOLE", "fontSize"); 54 | 55 | ModeTokenView.ItemsSource = _modes; 56 | 57 | _modes.Add(new() 58 | { 59 | Mode = ByeDPIGroupModes.Torst, 60 | DisplayName = "TORST", 61 | DisplayTip = localizer.GetLocalizedString("/Flashlight/TORST") 62 | }); 63 | _modes.Add(new() 64 | { 65 | Mode = ByeDPIGroupModes.Redirect, 66 | DisplayName = "REDIRECT", 67 | DisplayTip = localizer.GetLocalizedString("/Flashlight/REDIRECT") 68 | }); 69 | _modes.Add(new() 70 | { 71 | Mode = ByeDPIGroupModes.SslErr, 72 | DisplayName = "SSLERR", 73 | DisplayTip = localizer.GetLocalizedString("/Flashlight/SSLERR") 74 | }); 75 | _modes.Add(new() 76 | { 77 | Mode = ByeDPIGroupModes.None, 78 | DisplayName = "NONE", 79 | DisplayTip = localizer.GetLocalizedString("/Flashlight/NONE") 80 | }); 81 | 82 | foreach (var mode in modes) 83 | { 84 | ModeTokenView.SelectRange(new ItemIndexRange(_modes.IndexOf(_modes.FirstOrDefault(x=> x.Mode == mode)), 1)); 85 | } 86 | 87 | 88 | 89 | this.Closing += ChooseGroupModeContentDialog_Closing; 90 | } 91 | 92 | private void ChooseGroupModeContentDialog_Closing(ContentDialog sender, ContentDialogClosingEventArgs args) 93 | { 94 | this.Closing -= ChooseGroupModeContentDialog_Closing; 95 | 96 | foreach (var item in ModeTokenView.SelectedItems) 97 | { 98 | Result.Add(((ByeDPIModeComboBoxItem)item).Mode); 99 | } 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Controls/CreateConfigHelper/FileConfigInspectUserControl.xaml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 58 | 65 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Helper/Items/CompatibilityCheckHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace CDPI_UI.Helper.Items 9 | { 10 | public class CompatibilityCheckHelper 11 | { 12 | private static CompatibilityCheckHelper _instance; 13 | private static readonly object _lock = new(); 14 | public static CompatibilityCheckHelper Instance 15 | { 16 | get 17 | { 18 | lock (_lock) 19 | { 20 | if (_instance == null) 21 | _instance = new CompatibilityCheckHelper(); 22 | return _instance; 23 | } 24 | } 25 | } 26 | public CompatibilityCheckHelper() { } 27 | 28 | public bool isCheckActive = false; 29 | public async Task BeginCheck() 30 | { 31 | if (isCheckActive) return; 32 | isCheckActive = true; 33 | try 34 | { 35 | List outdatedComponents = []; 36 | var components = ComponentItemsLoaderHelper.Instance.GetComponentHelpers(); 37 | 38 | foreach (var component in components) 39 | { 40 | ConfigHelper configHelper = component.GetConfigHelper(); 41 | 42 | foreach (var config in configHelper.GetConfigItems()) 43 | { 44 | if (config.target != null && config.target.Count == 2) 45 | { 46 | var databaseItem = DatabaseHelper.Instance.GetItemById(config.target[0]); 47 | 48 | string curV = databaseItem.CurrentVersion; 49 | if (databaseItem.CurrentVersion.Split(".").Length <= 3) 50 | { 51 | curV += ".0"; 52 | } 53 | string serV = config.target[1]; 54 | if (config.target[1].Split(".").Length <= 3) 55 | { 56 | serV += ".0"; 57 | } 58 | 59 | Version requiredVersion = new Version(config.target[1].Replace("v", "")); 60 | Version installedVersion = new Version(databaseItem.CurrentVersion.Replace("v", "")); 61 | 62 | if (requiredVersion > installedVersion) 63 | { 64 | if (!outdatedComponents.Contains(config.target[0])) 65 | { 66 | outdatedComponents.Add(config.target[0]); 67 | } 68 | } 69 | } 70 | } 71 | } 72 | 73 | foreach (var component in outdatedComponents) 74 | { 75 | await PipeClient.Instance.SendMessage($"NOTIFY:CCA({StateHelper.Instance.ComponentIdPairs.FirstOrDefault(x => x.Key == component).Value})"); 76 | } 77 | } 78 | catch (Exception ex) 79 | { 80 | Logger.Instance.CreateWarningLog(nameof(CompatibilityCheckHelper), $"Cannot begin check: {ex.Message}"); 81 | } 82 | string[] arguments = Environment.GetCommandLineArgs(); 83 | if (arguments.Contains("--exit-after-action")) Process.GetCurrentProcess().Kill(); // FIX: Possible issue when process take too more time 84 | 85 | isCheckActive = false; 86 | } 87 | } 88 | 89 | } 90 | -------------------------------------------------------------------------------- /Update/Properties/app.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 50 | 58 | 59 | 73 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Windows/ProxySetupUtilWindow.xaml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 25 | 26 | 27 | 28 | 29 | 30 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 58 | 65 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Controls/CreateConfigHelper/GoodCheckReportStrategyUserControl.xaml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 47 | 48 | 49 | 50 | 51 | 53 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Views/SetupProxy/MainPage.xaml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 30 | 31 | 32 | 33 | 34 | 38 | 39 | 40 | 41 | 42 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 64 | 65 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 60 | 66 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Views/SetupProxy/SetupProxyForSystem.xaml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 64 | 65 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 61 | 68 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /GoodbyeDPI_UI/Controls/CreateConfigHelper/VariableUserControl.xaml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 22 | 23 | 27 | 28 | 29 | 30 | 34 | 35 | 37 | 38 | 39 | 45 | 51 | 54 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | --------------------------------------------------------------------------------