mirror of
https://github.com/achiez/NebulaAuth-Steam-Desktop-Authenticator-by-Achies.git
synced 2026-07-25 06:14:31 +00:00
1.4.7
This commit is contained in:
@@ -12,6 +12,15 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NebulaAuth.LegacyConverter"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SteamLibForked", "SteamLibForked\SteamLibForked.csproj", "{09F02072-F91D-4DAA-87BC-A34D3E150570}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "changelog", "changelog", "{161BFADE-FCF3-45D1-82EA-8A1B187529F7}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
changelog\1.3.4.html = changelog\1.3.4.html
|
||||
changelog\1.4.4.html = changelog\1.4.4.html
|
||||
changelog\1.4.5.html = changelog\1.4.5.html
|
||||
changelog\1.4.6.html = changelog\1.4.6.html
|
||||
changelog\1.4.7.html = changelog\1.4.7.html
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
||||
@@ -20,7 +20,7 @@ public static class TrayManager
|
||||
_notifyIcon = new NotifyIcon();
|
||||
_notifyIcon.Text = "NebulaAuth";
|
||||
|
||||
Stream iconStream = Application.GetResourceStream(new Uri("pack://application:,,,/Theme/nebula lock.ico"))!.Stream;
|
||||
Stream iconStream = Application.GetResourceStream(new Uri("pack://application:,,,/Theme/lock.ico"))!.Stream;
|
||||
_notifyIcon.Icon = new Icon(iconStream);
|
||||
|
||||
_notifyIcon.MouseDoubleClick += NotifyIcon_MouseDoubleClick;
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
<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" w:FontScaleWindow.ResizeFont="True" Grid.RowSpan="3" Visibility="Hidden" VerticalAlignment="Center" HorizontalAlignment="Center">
|
||||
<TextBlock FontWeight="Bold" Foreground="#9a65b8">Отпустите, чтобы добавить mafile</TextBlock>
|
||||
<TextBlock FontWeight="Bold" Foreground="#9a65b8" Text="{Tr MainWindow.Global.DragNDropHint}"/>
|
||||
<md:PackIcon Foreground="#9a65b8" HorizontalAlignment="Center" Width="36" Height="36" Kind="FileReplaceOutline" />
|
||||
</StackPanel>
|
||||
<ToolBarTray IsLocked="True" Grid.Row="0">
|
||||
@@ -96,7 +96,13 @@
|
||||
<KeyBinding Key="Delete" Command="{Binding RemoveProxyCommand}" />
|
||||
</UIElement.InputBindings>
|
||||
</ComboBox>
|
||||
<md:PackIcon Kind="StopAlert" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="#FFFF0000" Margin="3" ToolTip="{Tr MainWindow.AppBar.Proxy.ProxyAlert.MafileProxyInUse}" ToolTipService.InitialShowDelay="600">
|
||||
<md:PackIcon Kind="StopAlert" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="#FFFF0000" Margin="3" ToolTipService.InitialShowDelay="300">
|
||||
<md:PackIcon.ToolTip>
|
||||
<TextBlock>
|
||||
<Run Text="{Tr MainWindow.AppBar.Proxy.ProxyAlert.MafileProxyInUse, IsDynamic=False}"/>
|
||||
<Run Text=" "/><Run Text="{Binding SelectedMafile.Proxy.Data, FallbackValue='', Mode=OneWay}"/>
|
||||
</TextBlock>
|
||||
</md:PackIcon.ToolTip>
|
||||
<UIElement.Visibility>
|
||||
<Binding Path="ProxyExist">
|
||||
<Binding.Converter>
|
||||
@@ -108,7 +114,7 @@
|
||||
</Binding>
|
||||
</UIElement.Visibility>
|
||||
</md:PackIcon>
|
||||
<md:PackIcon Kind="StopAlert" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="#FFFFA500" Margin="3" ToolTip="{Tr MainWindow.AppBar.Proxy.ProxyAlert.DefaultInUse}" ToolTipService.InitialShowDelay="600" Visibility="{Binding IsDefaultProxy, Converter={StaticResource BooleanToVisibilityConverter}}" />
|
||||
<md:PackIcon Kind="StopAlert" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="#FFFFA500" Margin="3" ToolTip="{Tr MainWindow.AppBar.Proxy.ProxyAlert.DefaultInUse}" ToolTipService.InitialShowDelay="300" Visibility="{Binding IsDefaultProxy, Converter={StaticResource BooleanToVisibilityConverter}}" ></md:PackIcon>
|
||||
<CheckBox FontSize="14" Style="{StaticResource MaterialDesignFilterChipSecondaryCheckBox}" IsChecked="{Binding TradeTimerEnabled}" Content="{Tr MainWindow.AppBar.TradeTimerHint}"/>
|
||||
<CheckBox FontSize="14" Style="{StaticResource MaterialDesignFilterChipSecondaryCheckBox}" IsChecked="{Binding MarketTimerEnabled}" Content="{Tr MainWindow.AppBar.MarketTimerHint}"/>
|
||||
<TextBox w:FontScaleWindow.Scale="0.8" w:FontScaleWindow.ResizeFont="True" md:HintAssist.Hint="{Tr Common.Abbreviations.Time.Seconds}" Margin="10,0,0,0" MinWidth="30" Style="{StaticResource MaterialDesignFloatingHintTextBox}" Text="{Binding TimerCheckSeconds, UpdateSourceTrigger=PropertyChanged, Delay=700}" PreviewTextInput="UIElement_OnPreviewTextInput" />
|
||||
@@ -119,12 +125,12 @@
|
||||
<ColumnDefinition Width="0.4*" />
|
||||
<ColumnDefinition Width="0.6*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid>
|
||||
<Grid Grid.Column="0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<ListBox w:FontScaleWindow.Scale="0.8" w:FontScaleWindow.ResizeFont="True" Margin="10,15,10,15" DisplayMemberPath="AccountName" ItemsSource="{Binding MaFiles}" SelectedValue="{Binding SelectedMafile}">
|
||||
<ListBox Grid.Row="0" w:FontScaleWindow.Scale="0.8" w:FontScaleWindow.ResizeFont="True" Margin="10,15,10,15" DisplayMemberPath="AccountName" ItemsSource="{Binding MaFiles}" SelectedValue="{Binding SelectedMafile}">
|
||||
<FrameworkElement.ContextMenu>
|
||||
<ContextMenu>
|
||||
<MenuItem Header="{Tr MainWindow.ContextMenus.Mafile.AddToGroup}" ItemsSource="{Binding Groups}">
|
||||
|
||||
@@ -22,7 +22,7 @@ public partial class Settings : ObservableObject
|
||||
[ObservableProperty] private LocalizationLanguage _language = LocalizationLanguage.English;
|
||||
[ObservableProperty] private bool _legacyMode = true;
|
||||
[ObservableProperty] private bool _allowAutoUpdate;
|
||||
|
||||
[ObservableProperty] private bool _useAccountNameAsMafileName;
|
||||
#endregion
|
||||
|
||||
public static Settings Instance { get; }
|
||||
|
||||
@@ -32,6 +32,7 @@ public static class Shell
|
||||
throw new CantAlignTimeException("", ex);
|
||||
}
|
||||
ExtensionsLogger.LogDebug("Application started");
|
||||
Logger.Info("Test");
|
||||
}
|
||||
|
||||
private static void CurrentDomainOnUnhandledException(object sender, UnhandledExceptionEventArgs e)
|
||||
|
||||
+111
-23
@@ -1,6 +1,9 @@
|
||||
using NebulaAuth.Model.Entities;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using SteamLib;
|
||||
using SteamLib.Account;
|
||||
using SteamLib.Exceptions;
|
||||
using SteamLib.SteamMobile;
|
||||
using SteamLib.Utility.MaFiles;
|
||||
using System;
|
||||
@@ -8,8 +11,6 @@ using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using SteamLib.Exceptions;
|
||||
|
||||
namespace NebulaAuth.Model;
|
||||
|
||||
@@ -22,7 +23,7 @@ public static class Storage
|
||||
public static string RemovedMafileFolder { get; } = Path.GetFullPath(REMOVED_F);
|
||||
|
||||
public static ObservableCollection<Mafile> MaFiles { get; } = new();
|
||||
|
||||
public static readonly int DuplicateFound;
|
||||
static Storage()
|
||||
{
|
||||
if (Directory.Exists(MafileFolder) == false)
|
||||
@@ -36,12 +37,25 @@ public static class Storage
|
||||
}
|
||||
|
||||
var files = Directory.GetFiles(MafileFolder);
|
||||
foreach (var file in files)
|
||||
var hashNames = new HashSet<string>();
|
||||
var hashIds = new HashSet<SteamId>();
|
||||
var comparer = new MafileNameComparer(Settings.Instance.UseAccountNameAsMafileName);
|
||||
var ordered = files.Order(comparer).ToList();
|
||||
foreach (var file in ordered)
|
||||
{
|
||||
if (Path.GetExtension(file).Equals(".mafile", StringComparison.InvariantCultureIgnoreCase) == false) continue;
|
||||
if (Path.GetExtension(file).Equals(".mafile", StringComparison.OrdinalIgnoreCase) == false) continue;
|
||||
try
|
||||
{
|
||||
var data = ReadMafile(file);
|
||||
|
||||
if (hashNames.Contains(data.AccountName) || (data.SessionData != null && hashIds.Contains(data.SessionData.SteamId)))
|
||||
{
|
||||
DuplicateFound++;
|
||||
Shell.Logger.Error("Duplicate mafile {file}", Path.GetFileName(file));
|
||||
continue;
|
||||
}
|
||||
hashNames.Add(data.AccountName);
|
||||
if (data.SessionData != null) hashIds.Add(data.SessionData.SteamId);
|
||||
MaFiles.Add(data);
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -87,7 +101,7 @@ public static class Storage
|
||||
};
|
||||
|
||||
|
||||
if (overwrite == false && File.Exists(GetMafilePath(data)))
|
||||
if (overwrite == false && File.Exists(CreatePathForMafile(data)))
|
||||
{
|
||||
throw new IOException("File already exist and overwrite is False");
|
||||
}
|
||||
@@ -113,21 +127,25 @@ public static class Storage
|
||||
}
|
||||
|
||||
public static string SerializeMafile(Mafile data)
|
||||
{
|
||||
var props = new Dictionary<string, object?>
|
||||
{
|
||||
{nameof(Mafile.Proxy), data.Proxy},
|
||||
{nameof(Mafile.Group), data.Group},
|
||||
{nameof(Mafile.Password), data.Password}
|
||||
};
|
||||
return SerializeMafile(data, props);
|
||||
}
|
||||
|
||||
public static string SerializeMafile(MobileDataExtended data, Dictionary<string, object?>? properties)
|
||||
{
|
||||
if (Settings.Instance.LegacyMode)
|
||||
{
|
||||
var props = new Dictionary<string, object?>
|
||||
{
|
||||
{nameof(Mafile.Proxy), data.Proxy},
|
||||
{nameof(Mafile.Group), data.Group},
|
||||
{nameof(Mafile.Password), data.Password}
|
||||
};
|
||||
return MafileSerializer.SerializeLegacy(data, Formatting.Indented, props);
|
||||
|
||||
return MafileSerializer.SerializeLegacy(data, Formatting.Indented, properties);
|
||||
}
|
||||
else
|
||||
{
|
||||
return MafileSerializer.Serialize(data);
|
||||
return MafileSerializer.Serialize(data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,8 +167,7 @@ public static class Storage
|
||||
|
||||
public static void SaveMafile(Mafile data)
|
||||
{
|
||||
|
||||
var path = GetMafilePath(data);
|
||||
var path = CreatePathForMafile(data);
|
||||
var str = SerializeMafile(data);
|
||||
File.WriteAllText(Path.GetFullPath(path), str);
|
||||
|
||||
@@ -168,14 +185,14 @@ public static class Storage
|
||||
|
||||
public static void UpdateMafile(Mafile data)
|
||||
{
|
||||
var path = GetMafilePath(data);
|
||||
var path = CreatePathForMafile(data);
|
||||
var str = SerializeMafile(data);
|
||||
File.WriteAllText(Path.GetFullPath(path), str);
|
||||
}
|
||||
|
||||
public static void RemoveMafile(Mafile data)
|
||||
{
|
||||
var path = GetMafilePath(data);
|
||||
var path = CreatePathForMafile(data);
|
||||
if (File.Exists(path))
|
||||
{
|
||||
File.Delete(path);
|
||||
@@ -184,7 +201,7 @@ public static class Storage
|
||||
}
|
||||
public static void MoveToRemoved(Mafile data)
|
||||
{
|
||||
var path = GetMafilePath(data);
|
||||
var path = CreatePathForMafile(data);
|
||||
var copyPath = Path.Combine(REMOVED_F, data.SessionData!.SteamId + ".mafile");
|
||||
var copyPathCompleted = copyPath;
|
||||
var i = 0;
|
||||
@@ -197,14 +214,85 @@ public static class Storage
|
||||
File.Delete(path);
|
||||
MaFiles.Remove(data);
|
||||
}
|
||||
private static string GetMafilePath(Mafile data)
|
||||
|
||||
private static string CreatePathForMafile(Mafile data)
|
||||
{
|
||||
if (data.SessionData == null)
|
||||
throw new NullReferenceException("SessionData was null can't retrieve SteamId");
|
||||
var fileName = data.SessionData.SteamId + ".mafile";
|
||||
throw new NullReferenceException("SessionData was null can't retrieve SteamId"); //TODO: handle with login
|
||||
|
||||
var useAccountName = Settings.Instance.UseAccountNameAsMafileName;
|
||||
if (!useAccountName && (data.SessionData.SteamId.Steam64 == 0 || data.SessionData.SteamId.Steam64 == SteamId64.SEED))
|
||||
{
|
||||
useAccountName = true;
|
||||
}
|
||||
|
||||
var fileName = useAccountName ? CreateFileNameWithAccountName(data.AccountName) : CreateFileNameWithSteamId(data.SessionData.SteamId);
|
||||
|
||||
return Path.Combine(MafileFolder, fileName);
|
||||
}
|
||||
|
||||
private static string CreateFileNameWithAccountName(string accountName) => accountName + ".mafile";
|
||||
private static string CreateFileNameWithSteamId(SteamId steamId) => steamId.Steam64.Id + ".mafile";
|
||||
|
||||
public static string? TryFindMafilePath(Mafile data)
|
||||
//FIXME: write mode to mafile instead of searching it. Search sometimes represents not actual mafile (in case of duplicate steamId + accountName)
|
||||
{
|
||||
var pathFileName = Path.Combine(MafileFolder, CreateFileNameWithAccountName(data.AccountName));
|
||||
string? pathSteamId = null;
|
||||
if (data.SessionData != null)
|
||||
{
|
||||
pathSteamId = Path.Combine(MafileFolder, CreateFileNameWithSteamId(data.SessionData.SteamId));
|
||||
}
|
||||
|
||||
var steamIdExist = pathSteamId != null && File.Exists(pathSteamId);
|
||||
var accountNameExist = File.Exists(pathFileName);
|
||||
|
||||
if (steamIdExist && accountNameExist)
|
||||
{
|
||||
return Settings.Instance.UseAccountNameAsMafileName ? pathFileName : pathSteamId;
|
||||
}
|
||||
if (steamIdExist ^ accountNameExist)
|
||||
{
|
||||
return steamIdExist ? pathSteamId : pathFileName;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
internal class MafileNameComparer : IComparer<string>
|
||||
{
|
||||
public bool MafileNameMode { get; }
|
||||
private const string MAF_64_START = "765";
|
||||
private static readonly IComparer<string> _defaultComparer = Comparer<string>.Default;
|
||||
public MafileNameComparer(bool mafileNameMode)
|
||||
{
|
||||
MafileNameMode = mafileNameMode;
|
||||
}
|
||||
|
||||
|
||||
public int Compare(string? x, string? y)
|
||||
{
|
||||
if (x == null && y == null) return 0;
|
||||
if (x == null) return -1;
|
||||
if (y == null) return 1;
|
||||
|
||||
|
||||
bool xisSteamId = Path.GetFileName(x).StartsWith(MAF_64_START);
|
||||
bool yisSteamId = Path.GetFileName(y).StartsWith(MAF_64_START);
|
||||
|
||||
if (xisSteamId ^ yisSteamId)
|
||||
{
|
||||
if (MafileNameMode)
|
||||
{
|
||||
return xisSteamId ? 1 : -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return yisSteamId ? 1 : -1;
|
||||
}
|
||||
}
|
||||
|
||||
return _defaultComparer.Compare(x, y);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,15 +8,14 @@
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<SatelliteResourceLanguages>en;ru;ua</SatelliteResourceLanguages>
|
||||
<ApplicationIcon>Theme\nebula lock.ico</ApplicationIcon>
|
||||
<ApplicationIcon>Theme\lock.ico</ApplicationIcon>
|
||||
<SupportedOSPlatformVersion>7.0</SupportedOSPlatformVersion>
|
||||
<AssemblyVersion>1.4.6</AssemblyVersion>
|
||||
<AssemblyVersion>1.4.7</AssemblyVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="Theme\Background.jpg" />
|
||||
<None Remove="Theme\nebula lock.ico" />
|
||||
<None Remove="Theme\nebula.ico" />
|
||||
<None Remove="Theme\lock.ico" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -37,8 +36,7 @@
|
||||
<Resource Include="Theme\Background.jpg">
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</Resource>
|
||||
<Resource Include="Theme\nebula lock.ico" />
|
||||
<Resource Include="Theme\nebula.ico" />
|
||||
<Resource Include="Theme\lock.ico" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 906 KiB |
@@ -44,10 +44,10 @@
|
||||
<ComboBox Style="{StaticResource MaterialDesignOutlinedComboBox}" FontSize="16" ItemsSource="{Binding BackgroundModes}" DisplayMemberPath="Value" SelectedValuePath="Key" SelectedValue="{Binding BackgroundMode}" materialDesign:HintAssist.Hint="{Tr SettingsDialog.BackgroundHint}" ></ComboBox>
|
||||
<ComboBox Style="{StaticResource MaterialDesignFloatingHintComboBox}" Margin="0,20,0,0" FontSize="16" ItemsSource="{Binding Languages}" DisplayMemberPath="Value" SelectedValuePath="Key" SelectedValue="{Binding Language}" materialDesign:HintAssist.Hint="{Tr LanguageWord}" ></ComboBox>
|
||||
<CheckBox Margin="0,20,0,0" FontSize="16" IsChecked="{Binding DisableTimersOnChange}" Content="{Tr SettingsDialog.DisableTimersOnSwitch}"/>
|
||||
<CheckBox Margin="0,20,0,0" FontSize="16" IsChecked="{Binding HideToTray}" Content="{Tr SettingsDialog.MinimizeToTray}"/>
|
||||
<CheckBox Margin="0,20,0,0" FontSize="16" IsChecked="{Binding UseIcon}" Content="{Tr SettingsDialog.UseIndicator}"/>
|
||||
<CheckBox Margin="0,10,0,0" FontSize="16" IsChecked="{Binding HideToTray}" Content="{Tr SettingsDialog.MinimizeToTray}"/>
|
||||
<CheckBox Margin="0,10,0,0" FontSize="16" IsChecked="{Binding UseIcon}" Content="{Tr SettingsDialog.UseIndicator}"/>
|
||||
<materialDesign:ColorPicker IsEnabled="{Binding UseIcon}" Color="{Binding IconColor, Delay=50}" />
|
||||
<CheckBox Margin="0,20,0,0" FontSize="16" IsChecked="{Binding UseBackground}" Content="{Tr SettingsDialog.UseCustomColor}"/>
|
||||
<CheckBox Margin="0,10,0,5" FontSize="16" IsChecked="{Binding UseBackground}" Content="{Tr SettingsDialog.UseCustomColor}"/>
|
||||
|
||||
<materialDesign:ColorPicker Height="100" IsEnabled="{Binding UseBackground}" Color="{Binding BackgroundColor, Delay=50}" />
|
||||
<Grid>
|
||||
@@ -61,8 +61,11 @@
|
||||
materialDesign:HintAssist.HelperText="{Tr SettingsDialog.PasswordBox.Hint}"></PasswordBox>
|
||||
<Button Command="{Binding SetPasswordCommand}" Margin="5,0,0,0" VerticalAlignment="Bottom" Grid.Column="1"> <materialDesign:PackIcon Kind="ContentSave"/></Button>
|
||||
</Grid>
|
||||
<CheckBox Margin="0,25,0,0" FontSize="16" IsChecked="{Binding LegacyMode}" Content="{Tr SettingsDialog.LegacyMafileMode}" ToolTip="{Tr SettingsDialog.LegacyMafileModeHint}"/>
|
||||
<CheckBox Margin="0,20,0,0" FontSize="16" IsChecked="{Binding AllowAutoUpdate}" Content="{Tr SettingsDialog.AllowAutoUpdate}"/>
|
||||
<CheckBox Margin="0,20,0,0" FontSize="16" IsChecked="{Binding LegacyMode}" Content="{Tr SettingsDialog.LegacyMafileMode}" ToolTip="{Tr SettingsDialog.LegacyMafileModeHint}"/>
|
||||
<CheckBox Margin="0,10,0,0" FontSize="16" IsChecked="{Binding AllowAutoUpdate}" Content="{Tr SettingsDialog.AllowAutoUpdate}"/>
|
||||
<CheckBox Margin="0,10,0,0" FontSize="16" IsChecked="{Binding UseAccountNameAsMafileName}" >
|
||||
<TextBlock TextWrapping="WrapWithOverflow" Text="{Tr SettingsDialog.UseAccountName}" />
|
||||
</CheckBox>
|
||||
|
||||
|
||||
</StackPanel>
|
||||
|
||||
@@ -42,6 +42,12 @@ public partial class MainVM : ObservableObject
|
||||
SessionHandler.LoginStarted += SessionHandlerOnLoginStarted;
|
||||
SessionHandler.LoginCompleted += SessionHandlerOnLoginCompleted;
|
||||
UpdateManager.CheckForUpdates();
|
||||
if (Storage.DuplicateFound > 0)
|
||||
{
|
||||
SnackbarController.SendSnackbar(
|
||||
GetLocalizationOrDefault("DuplicateMafilesFound") + " " + Storage.DuplicateFound,
|
||||
TimeSpan.FromSeconds(3));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -139,7 +145,7 @@ public partial class MainVM : ObservableObject
|
||||
{
|
||||
if (await DialogsController.ShowConfirmCancelDialog(GetLocalizationOrDefault("ConfirmRemovingAuthenticator")))
|
||||
{
|
||||
var result = await SessionHandler.Handle(() => MaClient.RemoveAuthenticator(SelectedMafile), SelectedMafile);
|
||||
var result = await SessionHandler.Handle(() => MaClient.RemoveAuthenticator(selectedMafile), selectedMafile);
|
||||
SnackbarController.SendSnackbar(
|
||||
result.Success ? GetLocalizationOrDefault("AuthenticatorRemoved") : GetLocalizationOrDefault("AuthenticatorNotRemoved"));
|
||||
|
||||
|
||||
@@ -27,19 +27,29 @@ public partial class MainVM //File //TODO: Refactor
|
||||
|
||||
[RelayCommand]
|
||||
private void OpenMafileFolder()
|
||||
{ var mafile = SelectedMafile;
|
||||
{
|
||||
var mafile = SelectedMafile;
|
||||
|
||||
var path = Storage.MafileFolder;
|
||||
if (mafile?.SessionData != null)
|
||||
string? mafilePath = null;
|
||||
if (mafile != null)
|
||||
{
|
||||
var mafPath = Path.Combine(Storage.MafileFolder, mafile.SessionData.SteamId.Steam64 + ".maFile");
|
||||
if (File.Exists(mafPath))
|
||||
{
|
||||
path = $"/e, /select, \"{mafPath}\""; ;
|
||||
}
|
||||
mafilePath = Storage.TryFindMafilePath(mafile);
|
||||
}
|
||||
if (mafilePath != null)
|
||||
{
|
||||
path = $"/select, \"{mafilePath}\""; ;
|
||||
}
|
||||
|
||||
Process.Start("explorer", path);
|
||||
try
|
||||
{
|
||||
var processStartInfo = new ProcessStartInfo("explorer.exe", path);
|
||||
Process.Start(processStartInfo);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SnackbarController.SendSnackbar(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -163,13 +173,12 @@ public partial class MainVM //File //TODO: Refactor
|
||||
}
|
||||
var result = data.SessionData != null;
|
||||
if (!result) return result;
|
||||
var existed = MaFiles.FirstOrDefault(m => m.AccountName == data.AccountName); //TODO: more elegant way to handle overwrite
|
||||
if (existed != null)
|
||||
Storage.SaveMafile(data);
|
||||
{
|
||||
MaFiles.Remove(existed);
|
||||
}
|
||||
MaFiles.Add(data);
|
||||
SelectedMafile = data;
|
||||
ResetQuery();
|
||||
SearchText = data.AccountName ?? string.Empty;
|
||||
SelectedMafile = data;
|
||||
} //As this operation used only for 1 mafile at time, we can safely assume that we can select it for convenience
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ public partial class MainVM //Groups
|
||||
set
|
||||
{
|
||||
if (SetProperty(ref _selectedGroup, value))
|
||||
PerformSearch();
|
||||
PerformQuery();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public partial class MainVM //Groups
|
||||
set
|
||||
{
|
||||
if(SetProperty(ref _searchText, value))
|
||||
PerformSearch();
|
||||
PerformQuery();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -67,7 +67,7 @@ public partial class MainVM //Groups
|
||||
mafile.Group = group;
|
||||
Storage.UpdateMafile(mafile);
|
||||
QueryGroups();
|
||||
PerformSearch();
|
||||
PerformQuery();
|
||||
OnPropertyChanged(nameof(SelectedMafile));
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ public partial class MainVM //Groups
|
||||
{
|
||||
SelectedGroup = null;
|
||||
}
|
||||
PerformSearch();
|
||||
PerformQuery();
|
||||
}
|
||||
|
||||
|
||||
@@ -99,7 +99,10 @@ public partial class MainVM //Groups
|
||||
|
||||
Groups = new ObservableCollection<string>(groups!);
|
||||
}
|
||||
private void PerformSearch()
|
||||
|
||||
|
||||
|
||||
private void PerformQuery()
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(SelectedGroup) && string.IsNullOrWhiteSpace(SearchText))
|
||||
{
|
||||
@@ -126,6 +129,9 @@ public partial class MainVM //Groups
|
||||
{
|
||||
SelectedMafile = MaFiles.FirstOrDefault();
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
bool SearchPredicate(Mafile mafile)
|
||||
{
|
||||
if (!mafile.AccountName.Contains(SearchText, StringComparison.CurrentCultureIgnoreCase))
|
||||
@@ -136,4 +142,10 @@ public partial class MainVM //Groups
|
||||
}
|
||||
}
|
||||
|
||||
private void ResetQuery()
|
||||
{
|
||||
_selectedGroup = null;
|
||||
_searchText = string.Empty;
|
||||
PerformQuery();
|
||||
}
|
||||
}
|
||||
@@ -26,6 +26,7 @@ using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using NebulaAuth.Core;
|
||||
using SteamLib.Utility.MaFiles;
|
||||
|
||||
namespace NebulaAuth.ViewModel.Other;
|
||||
|
||||
@@ -326,8 +327,7 @@ public partial class LinkAccountVM : ObservableObject, IEmailProvider, IPhoneNum
|
||||
{
|
||||
Directory.CreateDirectory("mafiles_backup");
|
||||
}
|
||||
|
||||
var json = JsonConvert.SerializeObject(data, Formatting.Indented);
|
||||
var json = Storage.SerializeMafile(data, null);
|
||||
File.WriteAllText(Path.Combine("mafiles_backup", data.AccountName + ".mafile"), json);
|
||||
}
|
||||
|
||||
|
||||
@@ -109,6 +109,12 @@ public partial class SettingsVM : ObservableObject
|
||||
set => Settings.AllowAutoUpdate = value;
|
||||
}
|
||||
|
||||
public bool UseAccountNameAsMafileName
|
||||
{
|
||||
get => Settings.UseAccountNameAsMafileName;
|
||||
set => Settings.UseAccountNameAsMafileName = value;
|
||||
}
|
||||
|
||||
[ObservableProperty] private string _password;
|
||||
|
||||
|
||||
|
||||
@@ -58,6 +58,18 @@
|
||||
}
|
||||
},
|
||||
"MainWindow": {
|
||||
"Global": {
|
||||
"DragNDropHint": {
|
||||
"en": "Release to import mafiles",
|
||||
"ru": "Отпустите для импорта мафайлов",
|
||||
"ua": "Відпустіть для імпорту мафайлів"
|
||||
},
|
||||
"LoadingHint":{
|
||||
"en": "Loading...",
|
||||
"ru": "Загрузка...",
|
||||
"ua": "Завантаження..."
|
||||
}
|
||||
},
|
||||
"Menu": {
|
||||
"File": {
|
||||
"Caption": {
|
||||
@@ -297,8 +309,8 @@
|
||||
},
|
||||
"Hint": {
|
||||
"en": "Doesn't saved on disk",
|
||||
"ru": "Не сохраняется в файл",
|
||||
"ua": "Не зберігається у файлах"
|
||||
"ru": "Не сохраняется в системе",
|
||||
"ua": "Не зберігається у системі"
|
||||
}
|
||||
},
|
||||
"LegacyMafileMode": {
|
||||
@@ -315,6 +327,11 @@
|
||||
"en": "Allow auto update",
|
||||
"ru": "Разрешить автообновление",
|
||||
"ua": "Дозволити автооновлення"
|
||||
},
|
||||
"UseAccountName": {
|
||||
"en": "Use account name on mafiles",
|
||||
"ru": "Использовать имя аккаунта на мафайлах",
|
||||
"ua": "Використовувати ім'я акаунта на мафайлах"
|
||||
}
|
||||
},
|
||||
"LoginAgainDialog": {
|
||||
@@ -574,6 +591,11 @@
|
||||
"ru": "Слишком быстрый таймер.",
|
||||
"en": "Too fast timer.",
|
||||
"ua": "Занадто швидкий таймер."
|
||||
},
|
||||
"DuplicateMafilesFound": {
|
||||
"en": "Duplicate mafile(s) found and were not loaded. Check log to get lists of duplicate files.",
|
||||
"ru": "Найдены дубликаты мафайлов, они не были загружены. Проверьте лог чтобы получить списки дубликатов.",
|
||||
"ua": "Знайдено дублікати мафайлів, вони не були завантажені. Перевірте лог щоб отримати списки дублікатів."
|
||||
}
|
||||
},
|
||||
"ErrorTranslator": {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>1.4.6.0</version>
|
||||
<url>https://github.com/achiez/NebulaAuth-Steam-Desktop-Authenticator-by-Achies/releases/download/1.4.6/NebulaAuth.1.4.6.zip</url>
|
||||
<changelog>https://achiez.github.io/NebulaAuth-Steam-Desktop-Authenticator-by-Achies/changelog/1.4.6.html</changelog>
|
||||
<version>1.4.7.0</version>
|
||||
<url>https://github.com/achiez/NebulaAuth-Steam-Desktop-Authenticator-by-Achies/releases/download/1.4.7/NebulaAuth.1.4.7.zip</url>
|
||||
<changelog>https://achiez.github.io/NebulaAuth-Steam-Desktop-Authenticator-by-Achies/changelog/1.4.7.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
</item>
|
||||
@@ -1,7 +1,5 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Xml;
|
||||
using Formatting = Newtonsoft.Json.Formatting;
|
||||
|
||||
namespace SteamLib.Utility.MaFiles;
|
||||
|
||||
@@ -47,7 +45,7 @@ public static partial class MafileSerializer //Write
|
||||
|
||||
}
|
||||
|
||||
public static string SerializeLegacy(MobileData mobileData, Formatting formatting, Dictionary<string, object?>? additionalProperties = null, bool sign = true, MafileCredits? credits = null)
|
||||
public static string SerializeLegacy(MobileData mobileData, Formatting formatting, Dictionary<string, object?>? additionalProperties = null, bool sign = true, MafileCredits? credits = null)
|
||||
{
|
||||
var result = new LegacyMafile
|
||||
{
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<<<<<<< HEAD
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
@@ -75,4 +76,83 @@ body {
|
||||
</div>
|
||||
|
||||
</body>
|
||||
=======
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Changelog</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
||||
background-color: #eeeeee;
|
||||
color: #333;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.changelog-container {
|
||||
background-color: #fff;
|
||||
border-radius: 10px;
|
||||
padding: 25px;
|
||||
margin: 25px auto;
|
||||
max-width: 800px;
|
||||
box-shadow: 0 5px 15px rgba(0,0,0,0.2);
|
||||
}
|
||||
|
||||
.change {
|
||||
margin-bottom: 20px;
|
||||
padding: 0;
|
||||
border-left: 4px solid #a50ec7;
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
.version {
|
||||
font-weight: 600;
|
||||
font-size: 1.5em;
|
||||
color: #a50ec7;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.date {
|
||||
font-style: italic;
|
||||
color: #888;
|
||||
margin-bottom: 10px;
|
||||
margin-left: 15px;
|
||||
}
|
||||
|
||||
.description {
|
||||
font-size: 1em;
|
||||
padding: 0 15px;
|
||||
}
|
||||
|
||||
.description ul {
|
||||
list-style: inside square;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 600px) {
|
||||
.changelog-container {
|
||||
width: 90%;
|
||||
margin: 25px auto;
|
||||
padding: 25px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="changelog-container">
|
||||
<!-- Changelog entry -->
|
||||
<div class="change">
|
||||
<div class="version">Version 1.4.6</div>
|
||||
<div class="date">2024-02-04</div>
|
||||
<div class="description">
|
||||
- Added proxy support for log-in process while importing mafile with outdated/unsupported session<br>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
>>>>>>> 1.4.7
|
||||
</html>
|
||||
@@ -0,0 +1,83 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Changelog</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
||||
background-color: #eeeeee;
|
||||
color: #333;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.changelog-container {
|
||||
background-color: #fff;
|
||||
border-radius: 10px;
|
||||
padding: 25px;
|
||||
margin: 25px auto;
|
||||
max-width: 800px;
|
||||
box-shadow: 0 5px 15px rgba(0,0,0,0.2);
|
||||
}
|
||||
|
||||
.change {
|
||||
margin-bottom: 20px;
|
||||
padding: 0;
|
||||
border-left: 4px solid #a50ec7;
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
.version {
|
||||
font-weight: 600;
|
||||
font-size: 1.5em;
|
||||
color: #a50ec7;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.date {
|
||||
font-style: italic;
|
||||
color: #888;
|
||||
margin-bottom: 10px;
|
||||
margin-left: 15px;
|
||||
}
|
||||
|
||||
.description {
|
||||
font-size: 1em;
|
||||
padding: 0 15px;
|
||||
}
|
||||
|
||||
.description ul {
|
||||
list-style: inside square;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 600px) {
|
||||
.changelog-container {
|
||||
width: 90%;
|
||||
margin: 25px auto;
|
||||
padding: 25px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="changelog-container">
|
||||
<!-- Changelog entry -->
|
||||
<div class="change">
|
||||
<div class="version">Version 1.4.7</div>
|
||||
<div class="date">16.02.2024</div>
|
||||
<div class="description">
|
||||
- Fixed account list was missing imported mafile when import was through login dialog<br>
|
||||
- Duplicate mafiles now will be not loaded to application and shows warning at start. Previously, it could cause crashes<br>
|
||||
- Added support to save mafile with Account name instead of SteamId. (This may creates duplicates if mafile already saved with SteamId. Not critical')<br/>
|
||||
- Mafile backups now will be serialized in current compability mode (legacy or Nebula specific)<br/>
|
||||
- Icon updated to more elegant<br/>
|
||||
- Red proxy indicator now displays proxy IP and port from mafile<br/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user