Merge branch '2.0' into master-temp

This commit is contained in:
Achies
2025-05-03 00:42:36 +03:00
committed by GitHub
30 changed files with 409 additions and 128 deletions
+68 -13
View File
@@ -8,9 +8,6 @@
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<SolidColorBrush x:Key="MaterialDesignPaper">#1E2025</SolidColorBrush>
<FontFamily x:Key="Roboto">pack://application:,,,/Fonts/Roboto/#Roboto</FontFamily>
<FontFamily x:Key="RobotoSymbols">pack://application:,,,/Fonts/Roboto/#Roboto Symbols</FontFamily>
<converters:CoefficientConverter x:Key="CoefficientConverter" />
<converters:ReverseBooleanConverter x:Key="ReverseBooleanConverter" />
<converters:ProxyTextConverter x:Key="ProxyTextConverter" />
@@ -19,30 +16,88 @@
<converters:ColorToBrushConverter x:Key="ColorToBrushConverter" />
<converters:AnyMafilesToVisibilityConverter x:Key="AnyMafilesToVisibilityConverter" />
<converters:PortableMaClientStatusToColorConverter x:Key="PortableMaClientStatusToColorConverter" />
<converters:NullableToBooleanConverter x:Key="NullableToBooleanConverter" />
<!-- Background converters-->
<background:BackgroundImageVisibleConverter x:Key="BackgroundImageVisibleConverter" />
<background:BackgroundSourceConverter x:Key="BackgroundSourceConverter" />
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<materialDesign:NullableToVisibilityConverter x:Key="NullableToVisibilityConverter" />
<system:Boolean x:Key="True">True</system:Boolean>
<system:Boolean x:Key="False">False</system:Boolean>
<ResourceDictionary.MergedDictionaries>
<materialDesign:BundledTheme BaseTheme="Dark" PrimaryColor="LightGreen" SecondaryColor="Purple" />
<ResourceDictionary
Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
<ResourceDictionary
Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/materialdesigntheme.snackbar.xaml" />
<ResourceDictionary
Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/materialdesigntheme.Dark.xaml" />
<!-- Theme-->
<ResourceDictionary Source="Theme/Brushes.xaml" />
<ResourceDictionary Source="Theme/WindowStyle/WindowStyle.xaml" />
<ResourceDictionary
Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesign3.Defaults.xaml" />
<!--primary color-->
<ResourceDictionary>
<!--include your primary palette-->
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Theme/Brushes.xaml" />
</ResourceDictionary.MergedDictionaries>
<SolidColorBrush x:Key="MaterialDesign.Brush.Primary.Light" Color="{StaticResource PrimaryColor}" />
<SolidColorBrush x:Key="MaterialDesign.Brush.Primary.Light.Foreground"
Color="{StaticResource BaseContentColor}" />
<SolidColorBrush x:Key="MaterialDesign.Brush.Primary" Color="{StaticResource PrimaryColor}" />
<SolidColorBrush x:Key="MaterialDesign.Brush.Primary.Foreground"
Color="{StaticResource BaseContentColor}" />
<SolidColorBrush x:Key="MaterialDesign.Brush.Primary.Dark" Color="{StaticResource PrimaryColor}" />
<SolidColorBrush x:Key="MaterialDesign.Brush.Primary.Dark.Foreground"
Color="{StaticResource BaseContentColor}" />
<SolidColorBrush x:Key="MaterialDesign.Brush.Card.Background" Color="{StaticResource Base100Color}" />
<SolidColorBrush x:Key="MaterialDesign.Brush.Background" Color="{StaticResource BackgroundColor}" />
<SolidColorBrush x:Key="MaterialDesign.Brush.Foreground" Color="{StaticResource BaseContentColor}" />
<SolidColorBrush x:Key="MaterialDesign.Brush.ToolBar.Item.Background"
Color="{StaticResource Base300Color}" />
<SolidColorBrush x:Key="MaterialDesign.Brush.ToolBar.Item.Foreground"
Color="{StaticResource BaseContentColor}" />
</ResourceDictionary>
<!--secondary colour-->
<ResourceDictionary>
<!--include your secondary pallette-->
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Theme/Brushes.xaml" />
</ResourceDictionary.MergedDictionaries>
<SolidColorBrush x:Key="MaterialDesign.Brush.Secondary.Light"
Color="{StaticResource SecondaryColor}" />
<SolidColorBrush x:Key="MaterialDesign.Brush.Secondary.Light.Foreground"
Color="{StaticResource BaseContentColor}" />
<SolidColorBrush x:Key="MaterialDesign.Brush.Secondary" Color="{StaticResource SecondaryColor}" />
<SolidColorBrush x:Key="MaterialDesign.Brush.Secondary.Foreground"
Color="{StaticResource BaseContentColor}" />
<SolidColorBrush x:Key="MaterialDesign.Brush.Secondary.Dark"
Color="{StaticResource SecondaryColor}" />
<SolidColorBrush x:Key="MaterialDesign.Brush.Secondary.Dark.Foreground"
Color="{StaticResource BaseContentColor}" />
</ResourceDictionary>
<!--Controls-->
<ResourceDictionary
Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/materialdesigntheme.snackbar.xaml" />
<ResourceDictionary Source="View/ConfirmationTemplates.xaml" />
<!--Theme-->
<ResourceDictionary Source="Theme/WindowStyle/WindowStyle.xaml" />
<ResourceDictionary Source="Theme/MaterialDesignThemes.Overrides.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
@@ -0,0 +1,18 @@
using System;
using System.Globalization;
using System.Windows.Data;
namespace NebulaAuth.Converters;
public class NullableToBooleanConverter : IValueConverter
{
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
return value != null;
}
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{
throw new NotSupportedException();
}
}
+22 -1
View File
@@ -2,6 +2,9 @@
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Windows;
using System.Windows.Interop;
using System.Windows.Media;
@@ -61,9 +64,27 @@ public static class ThemeManager
private static void UpdateBackground()
{
var color = Settings.Instance.BackgroundColor ?? DefaultBackgroundColor;
Application.Current.Resources["WindowBackground"] = new SolidColorBrush(color);
Application.Current.Resources["Background"] = color;
ApplyTheme();
}
private static void ApplyTheme()
{
var keysToGenerate = Application.Current.Resources.Keys
.OfType<string>()
.Where(k => Application.Current.Resources[k] is System.Windows.Media.Color);
foreach (var key in keysToGenerate)
{
var brushKey = key + "Brush"; // Генерируем имя для Brush
var color = (System.Windows.Media.Color) Application.Current.Resources[key];
Application.Current.Resources[brushKey] = new SolidColorBrush(color);
}
}
public static void InitializeTheme()
{
UpdateIcon();
+52 -37
View File
@@ -9,12 +9,16 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:entities="clr-namespace:NebulaAuth.Model.Entities"
xmlns:viewModel="clr-namespace:NebulaAuth.ViewModel"
xmlns:controls="clr-namespace:NebulaAuth.Theme.Controls"
WindowStartupLocation="CenterScreen"
MinHeight="500" MinWidth="500" DefaultFontSize="18" ScaleCoefficient="0.4"
Title="NebulaAuth" Height="800" Width="730" Style="{StaticResource MainWindow}"
Title="NebulaAuth" Height="800" Width="730"
Style="{StaticResource MainWindow}"
RenderOptions.BitmapScalingMode="HighQuality" Foreground="#FFF5F5F5"
FontFamily="{md:MaterialDesignFont}"
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
TextElement.Foreground="{DynamicResource BaseContentBrush}"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance viewModel:MainVM}">
<b:Interaction.Behaviors>
@@ -40,8 +44,8 @@
VerticalAlignment="Center"
Visibility="{Binding Settings.BackgroundMode, Converter={StaticResource BackgroundImageVisibleConverter}}"
Source="{Binding Settings.BackgroundMode, Mode=OneWay, Converter={StaticResource BackgroundSourceConverter}}" />
<Rectangle Grid.Row="0" Grid.RowSpan="2" Opacity="0.5" Fill="#FF1F1D1D"
Visibility="{Binding Settings.BackgroundMode, Converter={StaticResource BackgroundImageVisibleConverter}}" />
<!--<Rectangle Grid.Row="0" Grid.RowSpan="2" Opacity="0.5" Fill="#FF1F1D1D" Visibility="{Binding Settings.BackgroundMode, Converter={StaticResource BackgroundImageVisibleConverter}}" />-->
<Rectangle Name="DragNDropOverlay" Grid.Row="0" Grid.RowSpan="3" Panel.ZIndex="1" Fill="#242123"
Opacity="0.9" Visibility="Hidden" />
<StackPanel Name="DragNDropPanel" Grid.Row="0" ZIndex="2" w:FontScaleWindow.Scale="1"
@@ -53,9 +57,12 @@
</StackPanel>
<ToolBarTray IsLocked="True" Grid.Row="0">
<ToolBarTray.Background>
<SolidColorBrush Opacity="0.6" Color="#FF1A1C25" />
<!--<SolidColorBrush Opacity="0.6" Color="{DynamicResource Base300Color}" />-->
<SolidColorBrush Opacity="1" Color="{DynamicResource Base300Color}" />
</ToolBarTray.Background>
<ToolBar Background="#00FFFFFF" ClipToBounds="False" Style="{StaticResource MaterialDesignToolBar}"
<ToolBar ClipToBounds="False" Style="{StaticResource MaterialDesignToolBar}"
w:FontScaleWindow.Scale="0.68" w:FontScaleWindow.ResizeFont="True">
<Menu w:FontScaleWindow.Scale="0.68" w:FontScaleWindow.ResizeFont="True">
<MenuItem Header="{Tr MainWindow.Menu.File.Caption}">
@@ -114,6 +121,7 @@
md:HintAssist.Hint="{Tr MainWindow.AppBar.Proxy.ProxyHint}"
md:ComboBoxAssist.ShowSelectedItem="False"
SelectedValue="{Binding SelectedProxy}"
ItemsSource="{Binding Proxies}">
<ItemsControl.ItemTemplate>
<DataTemplate DataType="{x:Type entities:MaProxy}">
@@ -158,7 +166,6 @@
ToolTipService.InitialShowDelay="300"
Visibility="{Binding IsDefaultProxy, Converter={StaticResource BooleanToVisibilityConverter}}" />
<ToggleButton ToolTip="{Tr MainWindow.AppBar.MarketTimerHint}"
Foreground="{DynamicResource PrimaryHueDarkForegroundBrush}"
IsEnabled="{Binding IsMafileSelected}" Margin="2"
Style="{StaticResource MaterialDesignFlatToggleButton}"
IsChecked="{Binding MarketTimerEnabled}">
@@ -175,7 +182,6 @@
</FrameworkElement.ContextMenu>
</ToggleButton>
<ToggleButton ToolTip="{Tr MainWindow.AppBar.TradeTimerHint}"
Foreground="{DynamicResource PrimaryHueDarkForegroundBrush}"
IsEnabled="{Binding IsMafileSelected}" Margin="2"
Style="{StaticResource MaterialDesignFlatToggleButton}"
IsChecked="{Binding TradeTimerEnabled}">
@@ -233,11 +239,10 @@
<TextBlock HorizontalAlignment="Stretch" Text="{Binding AccountName}">
<TextBlock.Foreground>
<Binding Mode="OneWay" Path="LinkedClient.IsError"
Converter="{StaticResource PortableMaClientStatusToColorConverter}">
<Binding.FallbackValue>
<SolidColorBrush Color="WhiteSmoke" />
</Binding.FallbackValue>
</Binding>
Converter="{StaticResource PortableMaClientStatusToColorConverter}"
FallbackValue="{StaticResource PrimaryContentBrush}" />
</TextBlock.Foreground>
</TextBlock>
<StackPanel
@@ -298,6 +303,7 @@
<MenuItem Header="{Tr MainWindow.ContextMenus.Mafile.CopyPassword}"
Command="{Binding Path=CopyPasswordCommand}"
CommandParameter="{Binding Path=PlacementTarget.SelectedValue, RelativeSource={RelativeSource AncestorType={x:Type ContextMenu}}}" />
</ContextMenu>
</FrameworkElement.ContextMenu>
@@ -316,15 +322,14 @@
md:HintAssist.Hint="{Tr MainWindow.LeftPart.SearchBoxHint}"
Text="{Binding SearchText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
</Grid>
<md:Card Grid.Column="1" Margin="10,10,15,10" UniformCornerRadius="15">
<Control.Background>
<SolidColorBrush Color="#FF1A1D25" Opacity="0.6" />
</Control.Background>
<md:Card BorderThickness="1" Style="{StaticResource MaterialDesignOutlinedCard}" Grid.Column="1"
Margin="10,10,15,10" UniformCornerRadius="15">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition />
<RowDefinition Height="115*" />
<RowDefinition Height="436*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid Row="0">
@@ -334,25 +339,24 @@
</Grid.RowDefinitions>
<TextBox w:FontScaleWindow.Scale="1.1" w:FontScaleWindow.ResizeFont="True"
IsReadOnly="True" HorizontalContentAlignment="Center" Background="#00FFFFFF"
Style="{StaticResource MaterialDesignFilledTextBox}"
Style="{StaticResource MaterialDesignTextBox}"
Text="{Binding Code, FallbackValue=Code}">
<TextBox.InputBindings>
<MouseBinding Gesture="LeftClick" Command="{Binding CopyCodeCommand}" />
</TextBox.InputBindings>
</TextBox>
<Grid Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<ProgressBar Margin="5" Foreground="#FF9932CC" Height="15"
md:TransitionAssist.DisableTransitions="True"
Value="{Binding CodeProgress}" />
</Grid>
<controls:CodeProgressBar
Visibility="{Binding SelectedMafile, Converter={StaticResource NullableToVisibilityConverter}}"
Grid.Row="1" Height="4" Style="{StaticResource MaterialDesignLinearProgressBar}"
MaxTime="30" TimeRemaining="{Binding CodeProgress, Mode=OneWay}" />
</Grid>
<Button IsEnabled="{Binding IsMafileSelected}" w:FontScaleWindow.Scale="0.7"
w:FontScaleWindow.ResizeFont="True" Grid.Row="1"
Style="{StaticResource MaterialDesignOutlinedButton}" Margin="10"
Style="{StaticResource MaterialDesignOutlinedButton}" Margin="82,10,82,10"
Command="{Binding GetConfirmationsCommand}"
Width="{Binding Path=ActualWidth, Converter={StaticResource CoefficientConverter}, ConverterParameter=0.6, RelativeSource={RelativeSource AncestorType=md:Card}}">
<TextBlock TextWrapping="Wrap" TextTrimming="WordEllipsis"
@@ -360,21 +364,27 @@
</Button>
<ItemsControl md:RippleAssist.IsDisabled="True" Focusable="False" Grid.Row="2"
w:FontScaleWindow.Scale="0.72" w:FontScaleWindow.ResizeFont="True"
Margin="10"
Margin="10,10,10,10"
Visibility="{Binding ConfirmationsVisible, Converter={StaticResource BooleanToVisibilityConverter}}"
ItemsSource="{Binding Confirmations}" />
<Button Grid.Row="3" Margin="1,0,1,3" w:FontScaleWindow.Scale="0.8"
w:FontScaleWindow.ResizeFont="True" Command="{Binding ConfirmLoginCommand}"
ItemsSource="{Binding Confirmations}" Grid.RowSpan="2" />
<Button Style="{StaticResource MaterialDesignFlatButton}" Grid.Row="4" Margin="1,0,1,3"
w:FontScaleWindow.Scale="0.8" w:FontScaleWindow.ResizeFont="True"
Command="{Binding ConfirmLoginCommand}"
Content="{Tr MainWindow.RightPart.ConfirmLogin}" />
</Grid>
</md:Card>
</Grid>
<Border Grid.Row="2" BorderBrush="#FF696969">
<Border Grid.Row="2" BorderBrush="{DynamicResource Base100Brush}">
<Border.Background>
<SolidColorBrush Opacity="0.5" Color="DimGray" />
<SolidColorBrush Opacity="0.5" Color="{DynamicResource Base300Color}" />
</Border.Background>
<Grid>
<ToolBarPanel Orientation="Horizontal" Margin="5" w:FontScaleWindow.Scale="0.73"
<ToolBarPanel TextElement.Foreground="{DynamicResource BaseContentBrush}"
Orientation="Horizontal" Margin="5" w:FontScaleWindow.Scale="0.73"
w:FontScaleWindow.ResizeFont="True">
<TextBlock FontWeight="Bold" Text="{Tr MainWindow.Footer.Account}" />
<TextBlock Text="{Binding SelectedMafile.AccountName}" />
@@ -382,12 +392,17 @@
<TextBlock FontWeight="Bold" Text="{Tr MainWindow.Footer.Group}" />
<TextBlock FontWeight="Normal"
Text="{Binding SelectedMafile.Group, TargetNullValue=' ', FallbackValue=' ', Mode=OneWay}" />
<Button Command="{Binding DebugCommand}">Debug</Button>
</ToolBarPanel>
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Right" w:FontScaleWindow.Scale="0.7"
w:FontScaleWindow.ResizeFont="True" Margin="0,0,10,0">
<Hyperlink
NavigateUri="https://github.com/achiez/NebulaAuth-Steam-Desktop-Authenticator-by-Achies"
Foreground="{DynamicResource PrimaryHueMidBrush}"
Foreground="{DynamicResource PrimaryBrush}"
RequestNavigate="Hyperlink_OnRequestNavigate">
by achies
</Hyperlink>
@@ -8,7 +8,6 @@ using System.Threading.Tasks;
using AchiesUtilities.Extensions;
using NebulaAuth.Core;
using NebulaAuth.Model.Entities;
using NLog;
namespace NebulaAuth.Model.MAAC;
@@ -60,7 +59,7 @@ public static class MultiAccountAutoConfirmer
private static async Task TimerConfirmInternal()
{
var clients = Lock.ReadLock(() => Clients.ToArray());
var enabledClients = clients.Where(x => x.LinkedClient is { IsError: false }).ToArray();
var enabledClients = clients.Where(x => x.LinkedClient is {IsError: false}).ToArray();
enabledClients = DistributeEvenly(enabledClients).ToArray();
var confirmed = 0;
await Task.Run(async () =>
+2 -1
View File
@@ -17,6 +17,7 @@ using SteamLib.Authentication;
using SteamLib.Core.Interfaces;
using SteamLib.Exceptions;
using SteamLib.SteamMobile.Confirmations;
using SteamLib.Utility;
using SteamLib.Web;
namespace NebulaAuth.Model.MAAC;
@@ -26,7 +27,7 @@ public partial class PortableMaClient : ObservableObject, IDisposable
private const string LOC_PATH = "MAAC";
public Mafile Mafile { get; }
private HttpClient Client { get; }
private HttpClientHandler ClientHandler { get; }
private SocketsHttpHandler ClientHandler { get; }
private DynamicProxy Proxy { get; }
private readonly CancellationTokenSource _cts = new();
+3 -1
View File
@@ -12,13 +12,14 @@ using SteamLib.Core.Interfaces;
using SteamLib.Exceptions;
using SteamLib.ProtoCore.Services;
using SteamLib.SteamMobile.Confirmations;
using SteamLib.Utility;
using SteamLib.Web;
namespace NebulaAuth.Model;
public static class MaClient
{
private static HttpClientHandler ClientHandler { get; }
private static SocketsHttpHandler ClientHandler { get; }
private static HttpClient Client { get; }
@@ -26,6 +27,7 @@ public static class MaClient
public static ProxyData? DefaultProxy { get; set; }
static MaClient()
{
Proxy = new DynamicProxy();
+1 -1
View File
@@ -79,7 +79,7 @@ public static class PHandler
return decryptedText;
}
public static string? DecryptPassword(string? encryptedPassword)
public static string? DecryptPassword(string? encryptedPassword)
{
if (string.IsNullOrWhiteSpace(encryptedPassword)) return null;
try
+6 -4
View File
@@ -8,6 +8,8 @@ using NebulaAuth.Core;
using NebulaAuth.Model.Entities;
using NebulaAuth.View.Dialogs;
using SteamLib.Exceptions;
using SteamLib.Utility;
namespace NebulaAuth.Model;
@@ -16,7 +18,7 @@ public static partial class SessionHandler
private static readonly SemaphoreSlim Semaphore = new(1, 1);
public static async Task<T> Handle<T>(Func<Task<T>> func, Mafile mafile,
HttpClientHandlerPair? chp = null, string? snackbarPrefix = null)
SocketsClientHandlerPair? chp = null, string? snackbarPrefix = null)
{
chp ??= MaClient.GetHttpClientHandlerPair(mafile);
await Semaphore.WaitAsync();
@@ -30,7 +32,7 @@ public static partial class SessionHandler
}
}
private static async Task<T> HandleInternal<T>(Func<Task<T>> func, HttpClientHandlerPair chp, Mafile mafile,
private static async Task<T> HandleInternal<T>(Func<Task<T>> func, SocketsClientHandlerPair chp, Mafile mafile,
string? snackbarPrefix = null)
{
using var scope = Shell.Logger.PushScopeProperty("Scope", "SessionHandler");
@@ -135,7 +137,7 @@ public static partial class SessionHandler
}
private static async Task<bool> RefreshInternal(HttpClientHandlerPair chp, Mafile mafile)
private static async Task<bool> RefreshInternal(SocketsClientHandlerPair chp, Mafile mafile)
{
try
{
@@ -150,7 +152,7 @@ public static partial class SessionHandler
}
}
private static async Task<bool> LoginAgainInternal(HttpClientHandlerPair chp, Mafile mafile, string password,
private static async Task<bool> LoginAgainInternal(SocketsClientHandlerPair chp, Mafile mafile, string password,
bool savePassword)
{
var t = Task.Run(OnLoginStarted);
+5 -2
View File
@@ -1,4 +1,5 @@
using System.Threading.Tasks;
using AchiesUtilities.Web.Models;
using NebulaAuth.Model.Entities;
using SteamLib.Account;
@@ -7,12 +8,14 @@ using SteamLib.Authentication;
using SteamLib.Authentication.LoginV2;
using SteamLib.Exceptions;
using SteamLib.SteamMobile;
using SteamLib.Utility;
namespace NebulaAuth.Model;
public partial class SessionHandler //API
{
public static async Task RefreshMobileToken(HttpClientHandlerPair chp, Mafile mafile)
public static async Task RefreshMobileToken(SocketsClientHandlerPair chp, Mafile mafile)
{
if (mafile.SessionData is not {RefreshToken.IsExpired: false})
throw new SessionPermanentlyExpiredException(SessionInvalidException.SESSION_NULL_MSG);
@@ -32,7 +35,7 @@ public partial class SessionHandler //API
chp.Handler.CookieContainer.SetSteamMobileCookiesWithMobileToken(mafile.SessionData);
}
public static async Task LoginAgain(HttpClientHandlerPair chp, Mafile mafile, string password, bool savePassword)
public static async Task LoginAgain(SocketsClientHandlerPair chp, Mafile mafile, string password, bool savePassword)
{
var sgGenerator = new SteamGuardCodeGenerator(mafile.SharedSecret);
var options = new LoginV2ExecutorOptions(LoginV2Executor.NullConsumer, chp.Client)
+38 -38
View File
@@ -14,35 +14,35 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<None Remove="Theme\1140x641.jpg" />
<None Remove="Theme\Background.jpg" />
<None Remove="Theme\lock.ico" />
<None Remove="Theme\SplashScreen.png" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Autoupdater.NET.Official" Version="1.9.2" />
<PackageReference Include="CodingSeb.Localization.JsonFileLoader" Version="1.3.1" />
<PackageReference Include="CodingSeb.Localization.WPF" Version="1.3.3" />
<PackageReference Include="CodingSebLocalization.Fody" Version="1.3.1" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.3.2" />
<PackageReference Include="MaterialDesignColors" Version="2.1.4" />
<PackageReference Include="MaterialDesignThemes" Version="4.9.0" />
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.122" />
<PackageReference Include="NLog" Version="5.3.4" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.3.14" />
</ItemGroup>
<ItemGroup>
<Resource Include="Theme\Background.jpg">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</Resource>
<Resource Include="Theme\lock.ico" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SteamLibForked\SteamLibForked.csproj" />
<None Remove="Theme\1140x641.jpg" />
<None Remove="Theme\Background.jpg" />
<None Remove="Theme\lock.ico" />
<None Remove="Theme\SplashScreen.png" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Autoupdater.NET.Official" Version="1.9.2" />
<PackageReference Include="CodingSeb.Localization.JsonFileLoader" Version="1.3.1" />
<PackageReference Include="CodingSeb.Localization.WPF" Version="1.3.3" />
<PackageReference Include="CodingSebLocalization.Fody" Version="1.3.1" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
<PackageReference Include="MaterialDesignThemes" Version="5.2.1" />
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.135" />
<PackageReference Include="NLog" Version="5.4.0" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.4.0" />
</ItemGroup>
<ItemGroup>
<Resource Include="Theme\Background.jpg">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</Resource>
<Resource Include="Theme\lock.ico" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SteamLibForked\SteamLibForked.csproj" />
</ItemGroup>
<ItemGroup>
@@ -50,19 +50,19 @@
</ItemGroup>
<ItemGroup>
<Compile Update="View\Dialogs\LoginAgainOnImportDialog.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="View\Dialogs\LoginAgainOnImportDialog.xaml.cs">
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<None Update="NLog.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="localization.loc.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<None Update="NLog.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="localization.loc.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
+5 -1
View File
@@ -6,4 +6,8 @@
• Добавить запоминание пароля при привязке мафайла
• Функция переноса гуарда с мобильного устройства на ПК с созданием мафайла
• Добавить полное шифрование мафайлов по аналогии с SDA
• Сделать автоматический билд и загрузку обновления на Github при изменении в мастер ветке
• Сделать автоматический билд и загрузку обновления на Github при изменении в мастер ветке
• Антик-окно как в MarketApp, возможность сразу открыть браузер напр. на CefSharp с залогиненым аккаунтом
• Стабильность авто-подтверждений, возможность задать пользователю порог времени когда льются ошибки и только тогда выключать авто-подтверждение
• Безопасное сохранение мафайлов через .tmp / .bak
• Создание механизма накопления ошибок, чтобы исправить Patch Tuesday, условно аккаунт может игнорировать ошибки 1-2 часа (настриавемо)
+58 -2
View File
@@ -1,9 +1,65 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Color x:Key="PrimaryColor">#794DFF</Color>
<Color x:Key="PrimaryContentColor">#eae7ff</Color>
<Color x:Key="SecondaryColor">#76717f</Color>
<Color x:Key="SecondaryContentColor">#ffffff</Color>
<Color x:Key="AccentColor">#3b82f6</Color>
<Color x:Key="AccentContentColor">#dbeafe</Color>
<Color x:Key="NeutralColor">#928f9e</Color>
<Color x:Key="NeutralContentColor">#141119</Color>
<Color x:Key="Base100Color">#282332</Color>
<Color x:Key="Base200Color">#1d1a26</Color>
<Color x:Key="Base300Color">#4a4456</Color>
<Color x:Key="BackgroundColor">#231f2c</Color>
<Color x:Key="BaseContentColor">#b8b6c0</Color>
<Color x:Key="BaseShadowColor">#1e1e24</Color>
<Color x:Key="InfoColor">#06b6d4</Color>
<Color x:Key="InfoContentColor">#cffafe</Color>
<Color x:Key="SuccessColor">#02ca4b</Color>
<Color x:Key="SuccessContentColor">#e1faf1</Color>
<Color x:Key="WarningColor">#fcaa1d</Color>
<Color x:Key="WarningContentColor">#fffae8</Color>
<Color x:Key="ErrorColor">#fb4141</Color>
<Color x:Key="ErrorContentColor">#fff5ed</Color>
<Color x:Key="DummyColor">#d66d1c</Color>
<!--Theme-->
<SolidColorBrush x:Key="PrimaryBrush" Color="{DynamicResource PrimaryColor}" />
<SolidColorBrush x:Key="PrimaryContentBrush" Color="{DynamicResource PrimaryContentColor}" />
<SolidColorBrush x:Key="SecondaryBrush" Color="{DynamicResource SecondaryColor}" />
<SolidColorBrush x:Key="SecondaryContentBrush" Color="{DynamicResource SecondaryContentColor}" />
<SolidColorBrush x:Key="AccentBrush" Color="{DynamicResource AccentColor}" />
<SolidColorBrush x:Key="AccentContentBrush" Color="{DynamicResource AccentContentColor}" />
<SolidColorBrush x:Key="NeutralBrush" Color="{DynamicResource NeutralColor}" />
<SolidColorBrush x:Key="NeutralContentBrush" Color="{DynamicResource NeutralContentColor}" />
<SolidColorBrush x:Key="Base100Brush" Color="{DynamicResource Base100Color}" />
<SolidColorBrush x:Key="Base200Brush" Color="{DynamicResource Base200Color}" />
<SolidColorBrush x:Key="Base300Brush" Color="{DynamicResource Base300Color}" />
<SolidColorBrush x:Key="BackgroundBrush" Color="{DynamicResource BackgroundColor}" />
<!--BackgroundBrush conflict-->
<SolidColorBrush x:Key="BaseContentBrush" Color="{DynamicResource BaseContentColor}" />
<SolidColorBrush x:Key="BaseShadowBrush" Color="{DynamicResource BaseShadowColor}" />
<SolidColorBrush x:Key="InfoBrush" Color="{DynamicResource InfoColor}" />
<SolidColorBrush x:Key="InfoContentBrush" Color="{DynamicResource InfoContentColor}" />
<SolidColorBrush x:Key="SuccessBrush" Color="{DynamicResource SuccessColor}" />
<SolidColorBrush x:Key="SuccessContentBrush" Color="{DynamicResource SuccessContentColor}" />
<SolidColorBrush x:Key="WarningBrush" Color="{DynamicResource WarningColor}" />
<SolidColorBrush x:Key="WarningContentBrush" Color="{DynamicResource WarningContentColor}" />
<SolidColorBrush x:Key="ErrorBrush" Color="{DynamicResource ErrorColor}" />
<SolidColorBrush x:Key="ErrorContentBrush" Color="{DynamicResource ErrorContentColor}" />
<SolidColorBrush x:Key="DummyBrush" Color="{DynamicResource DummyColor}" />
<!--Card-->
<SolidColorBrush x:Key="MaterialDesignCardBackground" Color="#26292E" />
<SolidColorBrush x:Key="PrimaryHueMidBrush" Color="#FF9056B1" />
<!--<SolidColorBrush x:Key="MaterialDesignCardBackground" Color="#26292E" />-->
<!--<SolidColorBrush x:Key="PrimaryHueMidBrush" Color="#FF9056B1" />
<SolidColorBrush x:Key="PrimaryHueLightBrush" Color="#FF9C70B5" />
<SolidColorBrush x:Key="PrimaryHueDarkForegroundBrush" Color="#FF851BC1" />
<SolidColorBrush x:Key="MaterialDesign.Brush.Card.Background" Color="{DynamicResource Base100}"></SolidColorBrush>
<SolidColorBrush x:Key="DynamicResource MaterialDesign.Brush.Card.Border" Color="#b8b6c0"></SolidColorBrush>-->
</ResourceDictionary>
@@ -0,0 +1,53 @@
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media.Animation;
namespace NebulaAuth.Theme.Controls;
public class CodeProgressBar : ProgressBar
{
public static readonly DependencyProperty TimeRemainingProperty =
DependencyProperty.Register(nameof(TimeRemaining), typeof(double), typeof(CodeProgressBar),
new PropertyMetadata(-1.0, OnTimeRemainingChanged));
public static readonly DependencyProperty MaxTimeProperty =
DependencyProperty.Register(nameof(MaxTime), typeof(double), typeof(CodeProgressBar),
new PropertyMetadata(30.0)); // По умолчанию 30 сек
public double TimeRemaining
{
get => (double) GetValue(TimeRemainingProperty);
set => SetValue(TimeRemainingProperty, value);
}
public double MaxTime
{
get => (double) GetValue(MaxTimeProperty);
set => SetValue(MaxTimeProperty, value);
}
private static void OnTimeRemainingChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
if (d is CodeProgressBar progressBar)
{
var newValue = (double) e.NewValue;
progressBar.StartProgressAnimation(newValue);
}
}
private void StartProgressAnimation(double timeRemaining)
{
if (timeRemaining <= 0 || MaxTime <= 0) return;
var progress = (1 - timeRemaining / MaxTime) * 100;
var animation = new DoubleAnimation
{
From = progress,
To = 100,
Duration = TimeSpan.FromSeconds(timeRemaining)
};
BeginAnimation(ValueProperty, animation);
}
}
@@ -0,0 +1,17 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style BasedOn="{StaticResource MaterialDesignLinearProgressBar}" TargetType="{x:Type ProgressBar}">
<Setter Property="Background" Value="{DynamicResource Base200Brush}" />
<Setter Property="BorderThickness" Value="0" />
</Style>
<Style x:Key="MaterialDesignLinearProgressBar" BasedOn="{StaticResource MaterialDesignLinearProgressBar}"
TargetType="{x:Type ProgressBar}">
<Setter Property="Background" Value="{DynamicResource Base200Brush}" />
<Setter Property="BorderThickness" Value="0" />
</Style>
<!--If style is not default like above, x:key must be provided (the same as BasedOn)-->
</ResourceDictionary>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 365 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.
@@ -17,7 +17,8 @@
Margin="{x:Static local:WindowChromeHelper.LayoutOffsetThickness}"
BorderBrush="Transparent"
BorderThickness="1"
Background="{DynamicResource WindowBackground}">
Background="{DynamicResource BackgroundBrush}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
@@ -26,11 +27,12 @@
<Grid x:Name="TitleBar"
Grid.Row="0"
Height="28"
Background="{DynamicResource WindowBackground}">
Background="{DynamicResource Base100Brush}">
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center"
Foreground="{DynamicResource PrimaryHueMidBrush}"
Foreground="{DynamicResource PrimaryBrush}"
Text="{Binding RelativeSource={RelativeSource AncestorType=Window}, Path=Title}"
FontSize="17" />
<!-- Window Buttons -->
<StackPanel
HorizontalAlignment="Right"
Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 906 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 906 KiB

@@ -1,4 +1,4 @@
<UserControl x:Class="NebulaAuth.View.Dialogs.SetCryptPasswordDialog"
<UserControl x:Class="NebulaAuth.View.Dialogs.SetCryptPasswordDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
@@ -7,9 +7,8 @@
xmlns:theme="clr-namespace:NebulaAuth.Theme"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
mc:Ignorable="d"
Foreground="WhiteSmoke"
d:DataContext="{d:DesignInstance other:LoginAgainVM}"
Background="{DynamicResource WindowBackground}">
d:DataContext="{d:DesignInstance other:LoginAgainVM}">
<Grid MinHeight="100" MinWidth="300" MaxWidth="400" Margin="20">
<Grid.RowDefinitions>
+1 -2
View File
@@ -7,13 +7,12 @@
xmlns:other="clr-namespace:NebulaAuth.ViewModel.Other"
mc:Ignorable="d"
d:DesignHeight="500" d:DesignWidth="400"
Foreground="WhiteSmoke"
FontFamily="{md:MaterialDesignFont}"
MinHeight="500"
MinWidth="400"
MaxHeight="550"
d:DataContext="{d:DesignInstance other:ProxyManagerVM}"
Background="{DynamicResource WindowBackground}">
Background="{DynamicResource BackgroundBrush1}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
+10
View File
@@ -51,6 +51,16 @@ public partial class MainVM : ObservableObject
}
}
[RelayCommand]
public void Debug()
{
var ph = new PaletteHelper();
var t = new MaterialDesignThemes.Wpf.Theme();
var cur = ph.GetTheme();
t.SetDarkTheme();
ph.SetTheme(t);
}
private void SetMafile(Mafile? mafile)
{
+17 -12
View File
@@ -22,6 +22,7 @@ public partial class MainVM
[MemberNotNull(nameof(_codeTimer))]
private void CreateCodeTimer()
{
CodeProgress = CalculateCodeProgress();
_codeTimer = new Timer(UpdateCode, null, 0, 1000);
}
@@ -30,24 +31,28 @@ public partial class MainVM
{
var currentTime = TimeAligner.GetSteamTime();
var untilChange = currentTime % 30;
var codeProgress = untilChange / 30D * 100;
string? code = null;
if (untilChange == 0 && SelectedMafile != null)
{
code = SteamGuardCodeGenerator.GenerateCode(SelectedMafile!.SharedSecret);
}
if (untilChange != 0) return;
if (Application.Current == null) return;
Application.Current.Dispatcher.BeginInvoke((string? c) =>
Application.Current.Dispatcher.BeginInvoke(() =>
{
CodeProgress = -1;
CodeProgress = 30;
if (Application.Current.MainWindow?.WindowState == WindowState.Minimized) return;
CodeProgress = codeProgress;
if (c != null) Code = c;
}, DispatcherPriority.DataBind, code);
if (SelectedMafile == null) return;
Code = SteamGuardCodeGenerator.GenerateCode(SelectedMafile.SharedSecret);
}, DispatcherPriority.DataBind);
}
private long CalculateCodeProgress()
{
var currentTime = TimeAligner.GetSteamTime();
var untilChange = currentTime % 30;
return 30 - untilChange;
}
[RelayCommand(AllowConcurrentExecutions = false)]
private async Task CopyCode()
{
+2 -1
View File
@@ -37,12 +37,13 @@ public partial class MainVM
}
if (!system && SelectedMafile != null)
{
SelectedMafile.Proxy = SelectedProxy;
Storage.UpdateMafile(SelectedMafile);
}
CheckProxyExist();
}
[RelayCommand]
@@ -364,6 +364,7 @@ public partial class LinkAccountVM : ObservableObject, IEmailProvider, IPhoneNum
private static HttpClient Client { get; }
private static HttpClientHandler Handler { get; }
private static DynamicProxy Proxy { get; }
public ObservableDictionary<int, ProxyData> Proxies => ProxyStorage.Proxies;