Compare commits

...

9 Commits

Author SHA1 Message Date
achiez 16f0cc2b2d chore: update AssemblyVersion to 1.8.5 and add changelog for new features and fixes 2026-06-20 00:49:26 +03:00
achiez cd0416705f fix: add missing SignAt scheme in Proxy Assignment 2026-06-19 23:36:04 +03:00
Achies 2d06cb81f9 Merge pull request #30 from achiez/feat/website-links
feat(links): fetch website and docs URLs from GitHub at startup
2026-06-19 22:36:21 +03:00
achiez ed5d3c2eda feat(links): fetch website and docs URLs from GitHub at startup
- Add links.json to repo (alongside update.xml) with Website and Documentation URLs.
- Add LinksManager to support link fetching on startup via raw.githubusercontent.com
- Suppress TimeAligner failure instead of blocking app launch
2026-06-19 22:34:37 +03:00
Achies 07eb9f15a9 Merge pull request #29 from achiez/feat/login-again-on-session-expired
feat(session): show LoginAgainDialog on permanent session expiry
2026-06-19 22:06:44 +03:00
achiez c39660fc55 feat(session): show LoginAgainDialog on permanent session expiry
- Replace snackbar with interactive LoginAgainDialog when session cannot be   recovered automatically on user-initiated actions
- Show proxy warning hint in dialog when no proxy assigned to account or set as default
- Pass allowInteractiveLogin: false from MAACRequestHandler to skip dialog in  automated MAAC confirmations
2026-06-19 22:05:49 +03:00
Achies 038f62b4db Merge pull request #28 from achiez/feat/export-zip-and-improvements
feat(export): add zip export, export-all, and login:password input parsing
2026-06-19 21:21:51 +03:00
achiez 5029f78247 feat(export): add zip export, export-all, and login:password input parsing 2026-06-19 21:18:34 +03:00
Achies b9452c4baf Merge pull request #27 from achiez/feat/dialog-header
feat(ui): add DialogHeader component and restyle dialog headers
2026-06-19 20:45:30 +03:00
23 changed files with 320 additions and 76 deletions
+4
View File
@@ -0,0 +1,4 @@
{
"Website": "https://achiefy.pro/?nebula=true",
"Documentation": "https://achiefy-project.gitbook.io/nebulaauth"
}
+60
View File
@@ -0,0 +1,60 @@
{
"version": "1.8.5",
"date": "2026-06-19",
"changes": [
{
"type": "NEW",
"text": "Bulk proxy assignment: assign proxies to multiple accounts at once via flexible login:proxy, login:ID or login-only input",
"link": "https://github.com/achiez/NebulaAuth-Steam-Desktop-Authenticator-by-Achies/pull/22"
},
{
"type": "NEW",
"text": "Import dialog now allows assigning imported mafiles to a group directly; added option to skip confirmation when no conflicts are detected",
"link": "https://github.com/achiez/NebulaAuth-Steam-Desktop-Authenticator-by-Achies/pull/24"
},
{
"type": "NEW",
"text": "Assign random free proxy to the account from context menu",
"link": "https://github.com/achiez/NebulaAuth-Steam-Desktop-Authenticator-by-Achies/pull/22"
},
{
"type": "NEW",
"text": "Export: added ZIP archive output, export-all mode when the input field is empty, and support for login:password input format",
"link": "https://github.com/achiez/NebulaAuth-Steam-Desktop-Authenticator-by-Achies/pull/28"
},
{
"type": "IMPROVEMENT",
"text": "When a session permanently expires during a user-initiated action, a login dialog is now shown instead of a generic error notification",
"link": "https://github.com/achiez/NebulaAuth-Steam-Desktop-Authenticator-by-Achies/pull/29"
},
{
"type": "IMPROVEMENT",
"text": "Proxy manager: account count badges now show how many accounts are assigned to each proxy entry",
"link": "https://github.com/achiez/NebulaAuth-Steam-Desktop-Authenticator-by-Achies/pull/22"
},
{
"type": "IMPROVEMENT",
"text": "Added login:pass@ip:port proxy format support",
"link": "https://github.com/achiez/NebulaAuth-Steam-Desktop-Authenticator-by-Achies/pull/25"
},
{
"type": "IMPROVEMENT",
"text": "Improved dialog header design",
"link": "https://github.com/achiez/NebulaAuth-Steam-Desktop-Authenticator-by-Achies/pull/27"
},
{
"type": "IMPROVEMENT",
"text": "Website and Documentation links are now available from the links window",
"link": "https://github.com/achiez/NebulaAuth-Steam-Desktop-Authenticator-by-Achies/pull/30"
},
{
"type": "FIX",
"text": "Application no longer fails to start when Steam time synchronization is unavailable (network issues, firewall)"
},
{
"type": "FIX",
"text": "Fixed incorrect Steam Guard error message shown in the Mafile Mover dialog",
"link": "https://github.com/achiez/NebulaAuth-Steam-Desktop-Authenticator-by-Achies/pull/23"
}
]
}
@@ -77,6 +77,10 @@ public partial class HintBox : UserControl
IconKind = PackIconKind.ErrorOutline; IconKind = PackIconKind.ErrorOutline;
IconBrush = (Brush) Application.Current.FindResource("ErrorBrush")!; IconBrush = (Brush) Application.Current.FindResource("ErrorBrush")!;
break; break;
case HintBoxSeverity.Warning:
IconKind = PackIconKind.WarningOutline;
IconBrush = (Brush) Application.Current.FindResource("WarningBrush")!;
break;
default: default:
IconKind = PackIconKind.InfoCircleOutline; IconKind = PackIconKind.InfoCircleOutline;
IconBrush = (Brush) Application.Current.FindResource("InfoBrush")!; IconBrush = (Brush) Application.Current.FindResource("InfoBrush")!;
@@ -94,5 +98,6 @@ public partial class HintBox : UserControl
public enum HintBoxSeverity public enum HintBoxSeverity
{ {
Info, Info,
Warning,
Error Error
} }
+4 -2
View File
@@ -15,13 +15,15 @@ namespace NebulaAuth.Core;
public static class DialogsController public static class DialogsController
{ {
public static async Task<LoginAgainVM?> ShowLoginAgainDialog(string username, string? currentPassword = null) public static async Task<LoginAgainVM?> ShowLoginAgainDialog(string username, string? currentPassword = null,
bool showNoProxyWarning = false)
{ {
var vm = new LoginAgainVM var vm = new LoginAgainVM
{ {
UserName = username, UserName = username,
Password = currentPassword ?? string.Empty, Password = currentPassword ?? string.Empty,
SavePassword = PHandler.IsPasswordSet SavePassword = PHandler.IsPasswordSet,
ShowNoProxyWarning = showNoProxyWarning
}; };
var content = new LoginAgainDialog var content = new LoginAgainDialog
{ {
+33
View File
@@ -0,0 +1,33 @@
using System;
using System.Net.Http;
using System.Threading.Tasks;
using NebulaAuth.Model;
using Newtonsoft.Json;
namespace NebulaAuth.Core;
public static class LinksManager
{
private const string LINKS_URL =
"https://raw.githubusercontent.com/achiez/NebulaAuth-Steam-Desktop-Authenticator-by-Achies/master/NebulaAuth/links.json";
private static readonly HttpClient HttpClient = new();
public static string? WebsiteUrl { get; private set; }
public static string? DocumentationUrl { get; private set; }
public static async Task FetchAsync()
{
try
{
var json = await HttpClient.GetStringAsync(LINKS_URL).ConfigureAwait(false);
var links = JsonConvert.DeserializeObject<RemoteLinks>(json);
WebsiteUrl = links?.Website;
DocumentationUrl = links?.Documentation;
}
catch (Exception ex)
{
Shell.Logger.Debug(ex, "Failed to fetch remote links");
}
}
}
@@ -196,6 +196,16 @@
"es": "Grupo", "es": "Grupo",
"tr": "Grup", "tr": "Grup",
"kk": "Топ" "kk": "Топ"
},
"ExportToZip": {
"ru": "Экспортировать в ZIP архив",
"en": "Export to ZIP archive",
"uk": "Експортувати в ZIP архів",
"fr": "Exporter en archive ZIP",
"zh": "导出为 ZIP 压缩包",
"es": "Exportar a archivo ZIP",
"tr": "ZIP arşivine aktar",
"kk": "ZIP мұрағатқа экспорттау"
} }
}, },
"Tooltips": { "Tooltips": {
@@ -288,17 +298,27 @@
"es": "Incluir datos de grupo compatibles con Nebula.", "es": "Incluir datos de grupo compatibles con Nebula.",
"tr": "Nebula uyumlu grup verilerini dahil et.", "tr": "Nebula uyumlu grup verilerini dahil et.",
"kk": "Nebula үйлесімді топ деректерін қосу." "kk": "Nebula үйлесімді топ деректерін қосу."
},
"ExportToZip": {
"ru": "Экспортировать в ZIP архив вместо папки. Архив будет сохранён в выбранной директории с именем вида N_timestamp.zip.",
"en": "Export to a ZIP archive instead of a folder. The archive will be saved in the selected directory as N_timestamp.zip.",
"uk": "Експортувати в ZIP архів замість папки. Архів буде збережено у вибраній директорії з назвою N_timestamp.zip.",
"fr": "Exporter dans une archive ZIP plutôt que dans un dossier. L'archive sera enregistrée dans le répertoire sélectionné sous le nom N_timestamp.zip.",
"zh": "导出为 ZIP 压缩包而非文件夹。压缩包将保存在所选目录中,名称格式为 N_timestamp.zip。",
"es": "Exportar a un archivo ZIP en lugar de una carpeta. El archivo se guardará en el directorio seleccionado como N_timestamp.zip.",
"tr": "Klasör yerine ZIP arşivine aktar. Arşiv, seçilen dizine N_timestamp.zip adıyla kaydedilecektir.",
"kk": "Қалта орнына ZIP мұрағатына экспорттау. Мұрағат таңдалған каталогта N_timestamp.zip атауымен сақталады."
} }
}, },
"ExportAccountsPlaceholder": { "ExportAccountsPlaceholder": {
"ru": "Введите логины аккаунтов или SteamID (по одному на строку) для экспорта в выбранную директорию.", "ru": "Введите логины или SteamID (по одному на строку). Поддерживается формат логин:пароль — пароль будет проигнорирован. Оставьте пустым для экспорта всех аккаунтов.",
"en": "Enter account logins or SteamIDs (one per line) to export to the selected directory.", "en": "Enter logins or SteamIDs (one per line). Supports login:password format — the password will be ignored. Leave empty to export all accounts.",
"uk": "Введіть логіни акаунтів або SteamID (по одному на рядок) для експорту у вибрану директорію.", "uk": "Введіть логіни або SteamID (по одному на рядок). Підтримується формат логін:пароль — пароль буде проігноровано. Залиште порожнім для експорту всіх акаунтів.",
"fr": "Entrez les identifiants de compte ou les SteamID (un par ligne) pour exporter vers le répertoire sélectionné.", "fr": "Entrez les identifiants ou SteamID (un par ligne). Supporte le format login:mot_de_passe — le mot de passe sera ignoré. Laissez vide pour exporter tous les comptes.",
"zh": "输入要导出到所选目录的账户登录名或 SteamID(每行一个)。", "zh": "输入登录名或 SteamID(每行一个)。支持 login:password 格式——密码将被忽略。留空则导出所有账户。",
"es": "Introduce los logins de las cuentas o SteamID (uno por línea) para exportarlos al directorio seleccionado.", "es": "Introduce logins o SteamID (uno por línea). Soporta el formato login:contraseña — la contraseña será ignorada. Déjalo vacío para exportar todas las cuentas.",
"tr": "Seçilen dizine dışa aktarmak için hesap girişlerini veya SteamIDleri (her satıra bir tane) girin.", "tr": "Girişleri veya SteamIDleri girin (her satıra bir tane). login:şifre formatı desteklenir — şifre yok sayılır. Tüm hesapları dışa aktarmak için boş bırakın.",
"kk": "Таңдалған каталогқа экспорттау үшін аккаунт логиндерін немесе SteamID (әр жолға біреуден) енгізіңіз." "kk": "Логиндерді немесе SteamID (әр жолға біреуден) енгізіңіз. логин:құпиясөз форматы қолданылады — құпиясөз еленбейді. Барлық аккаунттарды экспорттау үшін бос қалдырыңыз."
} }
} }
} }
@@ -79,6 +79,16 @@
"es": "Pulsa 'DEL' para eliminar", "es": "Pulsa 'DEL' para eliminar",
"tr": "Silmek için 'DEL' tuşuna bas", "tr": "Silmek için 'DEL' tuşuna bas",
"kk": "Жою үшін 'DEL' пернесін басыңыз" "kk": "Жою үшін 'DEL' пернесін басыңыз"
},
"NoProxyWarning": {
"en": "No proxy is assigned",
"ru": "Прокси не установлен",
"zh": "未分配代理",
"uk": "Проксі не призначено",
"fr": "Aucun proxy assigné",
"es": "No hay ningún proxy asignado",
"tr": "Proxy atanmamış",
"kk": "Прокси тағайындалмаған"
} }
} }
} }
@@ -82,7 +82,7 @@ public static class MAACRequestHandler
{ {
return withSessionHandler return withSessionHandler
? Result<T>.Success(await SessionHandler.Handle(req, client.Mafile, client.Chp(), ? Result<T>.Success(await SessionHandler.Handle(req, client.Mafile, client.Chp(),
GetTimerPrefix(client.Mafile))) GetTimerPrefix(client.Mafile), false))
: Result<T>.Success(await req()); : Result<T>.Success(await req());
} }
catch (SessionInvalidException ex) catch (SessionInvalidException ex)
@@ -13,4 +13,5 @@ public class MafileExportTemplate
public bool IncludeNebulaPassword { get; set; } public bool IncludeNebulaPassword { get; set; }
public bool IncludeNebulaGroup { get; set; } public bool IncludeNebulaGroup { get; set; }
public string? Path { get; set; } public string? Path { get; set; }
public bool ExportToZip { get; set; }
} }
@@ -1,6 +1,9 @@
using System.Collections.Generic; using System;
using System.Collections.Generic;
using System.IO; using System.IO;
using System.IO.Compression;
using System.Linq; using System.Linq;
using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using AchiesUtilities.Extensions; using AchiesUtilities.Extensions;
using NebulaAuth.Core; using NebulaAuth.Core;
@@ -36,48 +39,79 @@ public static class MafileExporter
return new ExportResult(LocManager.GetCodeBehindOrDefault("AccessDenied", "MafileExporter.AccessDenied")); return new ExportResult(LocManager.GetCodeBehindOrDefault("AccessDenied", "MafileExporter.AccessDenied"));
} }
var exported = new Dictionary<Mafile, string>(); var exported = new Dictionary<Mafile, string>();
var notFound = new List<string>(); var notFound = new List<string>();
var conflict = new List<string>(); var conflict = new List<string>();
var toExport = new List<(string key, Mafile mafile)>();
foreach (var key in keys) foreach (var key in keys)
{ {
SteamId? steamId = null; SteamId? steamId = null;
if (SteamId64.TryParse(key, out var id64)) if (SteamId64.TryParse(key, out var id64))
{
steamId = id64; steamId = id64;
}
var maf = Storage.MaFiles.FirstOrDefault(m => m.AccountName.EqualsIgnoreCase(key) || m.SteamId == steamId); var maf = Storage.MaFiles.FirstOrDefault(m => m.AccountName.EqualsIgnoreCase(key) || m.SteamId == steamId);
if (maf != null) if (maf != null)
toExport.Add((key, maf));
else
notFound.Add(key);
}
if (template.ExportToZip)
{
if (toExport.Count > 0)
{ {
var fileName = await ExportMafile(template.Path, template, maf); var timestamp = DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss");
if (fileName == null) var zipName = $"{toExport.Count}_{timestamp}.zip";
var zipPath = Path.Combine(template.Path, zipName);
await using var zipStream = File.Create(zipPath);
using var archive = new ZipArchive(zipStream, ZipArchiveMode.Create);
var addedEntries = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
foreach (var (key, maf) in toExport)
{
var (content, fileName) = BuildMafileContent(template, maf);
if (!addedEntries.Add(fileName))
{
conflict.Add(key);
continue;
}
var entry = archive.CreateEntry(fileName);
await using var entryStream = entry.Open();
await using var writer = new StreamWriter(entryStream, Encoding.UTF8);
await writer.WriteAsync(content);
exported[maf] = fileName;
}
}
}
else
{
foreach (var (key, maf) in toExport)
{
var (content, fileName) = BuildMafileContent(template, maf);
var fullPath = Path.Combine(template.Path, fileName);
if (File.Exists(fullPath))
{ {
conflict.Add(key); conflict.Add(key);
continue; continue;
} }
exported[maf] = fileName; await File.WriteAllTextAsync(fullPath, content);
} exported[maf] = fullPath;
else
{
notFound.Add(key);
} }
} }
return new ExportResult(exported, notFound, conflict); return new ExportResult(exported, notFound, conflict);
} }
private static async Task<string?> ExportMafile(string path, MafileExportTemplate template, Mafile mafile) private static (string content, string fileName) BuildMafileContent(MafileExportTemplate template, Mafile mafile)
{ {
// We preserve SteamId even if other info is not included
var session = template.IncludeSessionData var session = template.IncludeSessionData
? mafile.SessionData ? mafile.SessionData
: new MobileSessionData(null!, mafile.SteamId, default, null, tokens: null); : new MobileSessionData(null!, mafile.SteamId, default, null, tokens: null);
var serializeMaf = new Mafile var serializeMaf = new Mafile
{ {
SharedSecret = template.IncludeSharedSecret ? mafile.SharedSecret : null!, SharedSecret = template.IncludeSharedSecret ? mafile.SharedSecret : null!,
@@ -102,14 +136,7 @@ public static class MafileExporter
var serialized = NebulaSerializer.SerializeMafile(serializeMaf); var serialized = NebulaSerializer.SerializeMafile(serializeMaf);
var strategy = template.UseLoginAsMafileName ? MafileNamingStrategy.Login : MafileNamingStrategy.SteamId; var strategy = template.UseLoginAsMafileName ? MafileNamingStrategy.Login : MafileNamingStrategy.SteamId;
var fileName = strategy.GetMafileName(serializeMaf); var fileName = strategy.GetMafileName(serializeMaf);
var fullPath = Path.Combine(path, fileName); return (serialized, fileName);
if (File.Exists(fullPath))
{
return null;
}
await File.WriteAllTextAsync(fullPath, serialized);
return fullPath;
} }
private static bool PathIsValid(string path) private static bool PathIsValid(string path)
+7
View File
@@ -0,0 +1,7 @@
namespace NebulaAuth.Model;
public class RemoteLinks
{
public string? Website { get; set; }
public string? Documentation { get; set; }
}
@@ -6,7 +6,9 @@ using AchiesUtilities.Web.Models;
using MaterialDesignThemes.Wpf; using MaterialDesignThemes.Wpf;
using NebulaAuth.Core; using NebulaAuth.Core;
using NebulaAuth.Model.Entities; using NebulaAuth.Model.Entities;
using NebulaAuth.Utility;
using NebulaAuth.View.Dialogs; using NebulaAuth.View.Dialogs;
using NebulaAuth.ViewModel.Other;
using SteamLib.Exceptions.Authorization; using SteamLib.Exceptions.Authorization;
namespace NebulaAuth.Model; namespace NebulaAuth.Model;
@@ -16,13 +18,13 @@ public static partial class SessionHandler
private static readonly SemaphoreSlim Semaphore = new(1, 1); private static readonly SemaphoreSlim Semaphore = new(1, 1);
public static async Task<T> Handle<T>(Func<Task<T>> func, Mafile mafile, public static async Task<T> Handle<T>(Func<Task<T>> func, Mafile mafile,
HttpClientHandlerPair? chp = null, string? snackbarPrefix = null) HttpClientHandlerPair? chp = null, string? snackbarPrefix = null, bool allowInteractiveLogin = true)
{ {
chp ??= MaClient.GetHttpClientHandlerPair(mafile); chp ??= MaClient.GetHttpClientHandlerPair(mafile);
await Semaphore.WaitAsync(); await Semaphore.WaitAsync();
try try
{ {
return await HandleInternal(func, chp.Value, mafile, snackbarPrefix); return await HandleInternal(func, chp.Value, mafile, snackbarPrefix, allowInteractiveLogin);
} }
finally finally
{ {
@@ -31,7 +33,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, HttpClientHandlerPair chp, Mafile mafile,
string? snackbarPrefix = null) string? snackbarPrefix = null, bool allowInteractiveLogin = true)
{ {
using var scope = Shell.Logger.PushScopeProperty("Scope", "SessionHandler"); using var scope = Shell.Logger.PushScopeProperty("Scope", "SessionHandler");
Exception? currentException = null; Exception? currentException = null;
@@ -86,6 +88,32 @@ public static partial class SessionHandler
} }
} }
if (allowInteractiveLogin && !DialogHost.IsDialogOpen(null))
{
var noProxy = mafile.Proxy == null && MaClient.DefaultProxy == null;
var currentPassword = GetPassword(mafile);
Task<LoginAgainVM?> dialogTask = null!;
Application.Current.Dispatcher.Invoke(() =>
{
dialogTask = DialogsController.ShowLoginAgainDialog(mafile.AccountName, currentPassword, noProxy);
});
var vm = await dialogTask;
if (vm != null)
{
Shell.Logger.Info("User provided credentials interactively for {name}, attempting login",
mafile.AccountName);
var logged = await LoginAgainInternal(chp, mafile, vm.Password, vm.SavePassword);
if (logged)
{
Shell.Logger.Debug("Interactive login for {name} succeeded, retrying operation",
mafile.AccountName);
return await func();
}
}
}
throw new SessionPermanentlyExpiredException(SessionPermanentlyExpiredException.SESSION_EXPIRED_MSG, throw new SessionPermanentlyExpiredException(SessionPermanentlyExpiredException.SESSION_EXPIRED_MSG,
currentException); currentException);
} }
@@ -118,6 +146,7 @@ public static partial class SessionHandler
{ {
Shell.Logger.Debug(ex, "Failed to relogin mafile {name} {steamid}", mafile.AccountName, Shell.Logger.Debug(ex, "Failed to relogin mafile {name} {steamid}", mafile.AccountName,
mafile.SessionData?.SteamId); mafile.SessionData?.SteamId);
ExceptionHandler.Handle(ex);
return false; return false;
} }
finally finally
+3 -2
View File
@@ -3,7 +3,6 @@ using System.IO;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using NebulaAuth.Core; using NebulaAuth.Core;
using NebulaAuth.Model.Exceptions;
using NebulaAuth.Model.MAAC; using NebulaAuth.Model.MAAC;
using NebulaAuth.Model.MafileExport; using NebulaAuth.Model.MafileExport;
using NebulaAuth.Model.Mafiles; using NebulaAuth.Model.Mafiles;
@@ -40,7 +39,8 @@ public static class Shell
} }
catch (Exception ex) catch (Exception ex)
{ {
throw new CantAlignTimeException("", ex); Logger.Error(ex, "Failed to align time with Steam");
TimeAligner.SetTimeDifference(0);
} }
var threads = Environment.ProcessorCount > 0 ? Environment.ProcessorCount : 1; var threads = Environment.ProcessorCount > 0 ? Environment.ProcessorCount : 1;
@@ -48,6 +48,7 @@ public static class Shell
ProxyAssignmentCache.Initialize(Storage.MaFiles); ProxyAssignmentCache.Initialize(Storage.MaFiles);
MAACStorage.Initialize(); MAACStorage.Initialize();
MafileExporterStorage.Initialize(); MafileExporterStorage.Initialize();
_ = LinksManager.FetchAsync();
ExtensionsLogger.LogDebug("Application started"); ExtensionsLogger.LogDebug("Application started");
} }
+1 -1
View File
@@ -10,7 +10,7 @@
<SatelliteResourceLanguages>en;ru;ua</SatelliteResourceLanguages> <SatelliteResourceLanguages>en;ru;ua</SatelliteResourceLanguages>
<ApplicationIcon>Theme\lock.ico</ApplicationIcon> <ApplicationIcon>Theme\lock.ico</ApplicationIcon>
<SupportedOSPlatformVersion>7.0</SupportedOSPlatformVersion> <SupportedOSPlatformVersion>7.0</SupportedOSPlatformVersion>
<AssemblyVersion>1.8.4</AssemblyVersion> <AssemblyVersion>1.8.5</AssemblyVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup> </PropertyGroup>
+1 -1
View File
@@ -93,7 +93,7 @@ public static class ExceptionHandler
} }
case LoginException e: case LoginException e:
{ {
return "LoginException".GetCodeBehindLocalization() + ": " + return "LoginException".GetCodeBehindLocalization() +
ErrorTranslatorHelper.TranslateLoginError(e.Error); ErrorTranslatorHelper.TranslateLoginError(e.Error);
} }
case UnsupportedAuthTypeException e: case UnsupportedAuthTypeException e:
@@ -25,24 +25,30 @@
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<TextBox TabIndex="0" Text="{Binding Password, UpdateSourceTrigger=PropertyChanged}" <nebulaAuth:HintBox Grid.Row="0"
Margin="10,10,10,0"
Severity="Warning"
FontSize="14"
Visibility="{Binding ShowNoProxyWarning, Converter={StaticResource BooleanToVisibilityConverter}}"
Text="{Tr LoginAgainDialog.NoProxyWarning}" />
<TextBox TabIndex="0" Grid.Row="1" Text="{Binding Password, UpdateSourceTrigger=PropertyChanged}"
materialDesign:TextFieldAssist.HasClearButton="True" materialDesign:TextFieldAssist.HasClearButton="True"
Padding="10" Padding="10"
FontSize="15" FontSize="15"
Margin="10,10,10,0" Margin="10,10,10,0"
Grid.Row="0"
Style="{StaticResource MaterialDesignOutlinedTextBox}" Style="{StaticResource MaterialDesignOutlinedTextBox}"
materialDesign:HintAssist.Hint="{Tr LoginAgainDialog.PasswordBox}" materialDesign:HintAssist.Hint="{Tr LoginAgainDialog.PasswordBox}"
materialDesign:HintAssist.IsFloating="False" materialDesign:HintAssist.IsFloating="False"
materialDesign:TextFieldAssist.LeadingIcon="Key" materialDesign:TextFieldAssist.LeadingIcon="Key"
materialDesign:TextFieldAssist.HasLeadingIcon="True" /> materialDesign:TextFieldAssist.HasLeadingIcon="True" />
<CheckBox FontSize="15" Grid.Row="1" Margin="10,5,10,0" <CheckBox FontSize="15" Grid.Row="2" Margin="10,5,10,0"
IsEnabled="{Binding Source={x:Static model:PHandler.IsPasswordSet}}" IsEnabled="{Binding Source={x:Static model:PHandler.IsPasswordSet}}"
IsChecked="{Binding SavePassword}" Content="{Tr LoginAgainDialog.SaveEncryptedPassword}" /> IsChecked="{Binding SavePassword}" Content="{Tr LoginAgainDialog.SaveEncryptedPassword}" />
<Grid Grid.Row="2" Margin="10,10,10,0"> <Grid Grid.Row="3" Margin="10,10,10,0">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition /> <ColumnDefinition />
<ColumnDefinition /> <ColumnDefinition />
+11 -6
View File
@@ -8,7 +8,8 @@
d:DesignHeight="450" d:DesignWidth="800" d:DesignHeight="450" d:DesignWidth="800"
TextElement.Foreground="{DynamicResource BaseContentBrush}" TextElement.Foreground="{DynamicResource BaseContentBrush}"
Background="Transparent" Background="Transparent"
RenderOptions.BitmapScalingMode="HighQuality"> RenderOptions.BitmapScalingMode="HighQuality"
Loaded="LinksView_Loaded">
<materialDesign:Card Padding="24" HorizontalAlignment="Center" VerticalAlignment="Center" UniformCornerRadius="12"> <materialDesign:Card Padding="24" HorizontalAlignment="Center" VerticalAlignment="Center" UniformCornerRadius="12">
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center"> <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
@@ -49,16 +50,20 @@
</StackPanel> </StackPanel>
</Button> </Button>
<Button Margin="0,0,0,5" FontSize="18" Style="{StaticResource MaterialDesignFlatButton}" <Button x:Name="WebsiteButton" Margin="0,0,0,5" FontSize="18"
Click="Website_Click" IsEnabled="False"> Style="{StaticResource MaterialDesignFlatButton}"
IsEnabled="False"
Click="Website_Click">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<materialDesign:PackIcon Kind="Web" Width="24" Height="24" Margin="0 0 8 0" /> <materialDesign:PackIcon Kind="Web" Width="24" Height="24" Margin="0 0 8 0" />
<TextBlock Text="Web-site" VerticalAlignment="Center" /> <TextBlock Text="Achiefy" VerticalAlignment="Center" />
</StackPanel> </StackPanel>
</Button> </Button>
<Button Margin="0,0,0,5" FontSize="18" Style="{StaticResource MaterialDesignFlatButton}" <Button x:Name="DocumentationButton" Margin="0,0,0,5" FontSize="18"
Click="Documentation_Click" IsEnabled="False"> Style="{StaticResource MaterialDesignFlatButton}"
IsEnabled="False"
Click="Documentation_Click">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<Viewbox Width="22" Height="22" Margin="0 0 8 0"> <Viewbox Width="22" Height="22" Margin="0 0 8 0">
<Canvas Width="22" Height="22"> <Canvas Width="22" Height="22">
+11 -3
View File
@@ -1,4 +1,4 @@
using System.Diagnostics; using System.Diagnostics;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using MaterialDesignThemes.Wpf; using MaterialDesignThemes.Wpf;
@@ -13,6 +13,12 @@ public partial class LinksView : UserControl
InitializeComponent(); InitializeComponent();
} }
private void LinksView_Loaded(object sender, RoutedEventArgs e)
{
WebsiteButton.IsEnabled = LinksManager.WebsiteUrl != null;
DocumentationButton.IsEnabled = LinksManager.DocumentationUrl != null;
}
private void Telegram_Click(object sender, RoutedEventArgs e) private void Telegram_Click(object sender, RoutedEventArgs e)
{ {
Process.Start(new ProcessStartInfo("https://t.me/nebulaauth") {UseShellExecute = true}); Process.Start(new ProcessStartInfo("https://t.me/nebulaauth") {UseShellExecute = true});
@@ -26,12 +32,14 @@ public partial class LinksView : UserControl
private void Website_Click(object sender, RoutedEventArgs e) private void Website_Click(object sender, RoutedEventArgs e)
{ {
Process.Start(new ProcessStartInfo("https://yourwebsite.com") {UseShellExecute = true}); if (LinksManager.WebsiteUrl != null)
Process.Start(new ProcessStartInfo(LinksManager.WebsiteUrl) {UseShellExecute = true});
} }
private void Documentation_Click(object sender, RoutedEventArgs e) private void Documentation_Click(object sender, RoutedEventArgs e)
{ {
Process.Start(new ProcessStartInfo("https://yourwebsite.com") {UseShellExecute = true}); if (LinksManager.DocumentationUrl != null)
Process.Start(new ProcessStartInfo(LinksManager.DocumentationUrl) {UseShellExecute = true});
} }
private void CheckForUpdates_Click(object sender, RoutedEventArgs e) private void CheckForUpdates_Click(object sender, RoutedEventArgs e)
+8 -2
View File
@@ -9,8 +9,8 @@
mc:Ignorable="d" mc:Ignorable="d"
TextElement.Foreground="{DynamicResource BaseContentBrush}" TextElement.Foreground="{DynamicResource BaseContentBrush}"
FontFamily="{materialDesign:MaterialDesignFont}" FontFamily="{materialDesign:MaterialDesignFont}"
MinWidth="400" MinWidth="500"
MaxWidth="400" MaxWidth="500"
Background="{DynamicResource WindowBackground}" Background="{DynamicResource WindowBackground}"
d:DataContext="{d:DesignInstance other:MafileExporterVM}" d:DataContext="{d:DesignInstance other:MafileExporterVM}"
d:Background="#141119" d:Background="#141119"
@@ -113,6 +113,12 @@
IsEnabled="{Binding CurrentTemplate, Converter={StaticResource NullableToBooleanConverter}}"> IsEnabled="{Binding CurrentTemplate, Converter={StaticResource NullableToBooleanConverter}}">
<StackPanel> <StackPanel>
<CheckBox IsChecked="{Binding CurrentTemplate.ExportToZip, FallbackValue=False}"
Margin="3,0,0,3"
Content="{Tr ExportDialog.ExportOptions.ExportToZip}"
ToolTipService.InitialShowDelay="200"
ToolTip="{Tr ExportDialog.Tooltips.ExportToZip}" />
<TextBlock FontWeight="DemiBold" <TextBlock FontWeight="DemiBold"
Text="{Tr ExportDialog.ExportSettingsCommon}" /> Text="{Tr ExportDialog.ExportSettingsCommon}" />
@@ -11,5 +11,7 @@ public partial class LoginAgainVM : ObservableObject
[ObservableProperty] private bool _savePassword; [ObservableProperty] private bool _savePassword;
[ObservableProperty] private bool _showNoProxyWarning;
[ObservableProperty] private string _userName = null!; [ObservableProperty] private string _userName = null!;
} }
@@ -1,4 +1,4 @@
using System; using System;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Collections.Specialized; using System.Collections.Specialized;
using System.ComponentModel; using System.ComponentModel;
@@ -10,6 +10,7 @@ using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input; using CommunityToolkit.Mvvm.Input;
using NebulaAuth.Core; using NebulaAuth.Core;
using NebulaAuth.Model.MafileExport; using NebulaAuth.Model.MafileExport;
using NebulaAuth.Model.Mafiles;
namespace NebulaAuth.ViewModel.Other; namespace NebulaAuth.ViewModel.Other;
@@ -24,8 +25,7 @@ public partial class MafileExporterVM : ObservableObject
public ObservableCollection<MafileExportTemplateVM> Templates { get; } public ObservableCollection<MafileExportTemplateVM> Templates { get; }
[ObservableProperty] [NotifyCanExecuteChangedFor(nameof(ExportCommand))] [ObservableProperty] private string? _accountsText;
private string? _accountsText;
private string? _cachedName; private string? _cachedName;
private MafileExportTemplateVM? _currentTemplate; private MafileExportTemplateVM? _currentTemplate;
@@ -160,6 +160,7 @@ public partial class MafileExporterVM : ObservableObject
IncludeNebulaProxy = true, IncludeNebulaProxy = true,
IncludeNebulaPassword = true, IncludeNebulaPassword = true,
IncludeNebulaGroup = true, IncludeNebulaGroup = true,
ExportToZip = false,
Path = null Path = null
}; };
MafileExporterStorage.AddTemplate(template); MafileExporterStorage.AddTemplate(template);
@@ -211,21 +212,26 @@ public partial class MafileExporterVM : ObservableObject
} }
} }
[RelayCommand(CanExecute = nameof(ExportCanExecute))] [RelayCommand(CanExecute = nameof(CurrentTemplateNotNull))]
private async Task Export() private async Task Export()
{ {
var lines = AccountsText;
var template = CurrentTemplate; var template = CurrentTemplate;
if (string.IsNullOrWhiteSpace(lines) || template == null) if (template == null) return;
{
return;
}
var split = Regex string[] split;
.Split(lines, "\r\n|\r|\n") if (string.IsNullOrWhiteSpace(AccountsText))
.Select(x => x.Trim()) {
.Where(x => !string.IsNullOrWhiteSpace(x)) split = Storage.MaFiles.Select(m => m.AccountName).ToArray();
.ToArray(); }
else
{
split = Regex
.Split(AccountsText, "\r\n|\r|\n")
.Select(x => x.Trim())
.Where(x => !string.IsNullOrWhiteSpace(x))
.Select(ExtractLogin)
.ToArray();
}
ResetHintText(); ResetHintText();
ExportResult res; ExportResult res;
@@ -268,6 +274,14 @@ public partial class MafileExporterVM : ObservableObject
AccountsText = text; AccountsText = text;
} }
// Strips the password part from "login:password" input lines.
// SteamId64 values contain no colon, so any colon signals the login:password format.
private static string ExtractLogin(string line)
{
var idx = line.IndexOf(':');
return idx > 0 ? line[..idx] : line;
}
private void SetHintText(string? text, HintBoxSeverity severity = HintBoxSeverity.Error) private void SetHintText(string? text, HintBoxSeverity severity = HintBoxSeverity.Error)
{ {
HintText = text; HintText = text;
@@ -281,12 +295,6 @@ public partial class MafileExporterVM : ObservableObject
#region CanExecute #region CanExecute
private bool ExportCanExecute()
{
return CurrentTemplateNotNull() && !string.IsNullOrWhiteSpace(AccountsText);
}
private bool CurrentTemplateNotNull() private bool CurrentTemplateNotNull()
{ {
return CurrentTemplate != null; return CurrentTemplate != null;
@@ -307,6 +315,7 @@ public partial class MafileExporterVM : ObservableObject
public partial class MafileExportTemplateVM : ObservableObject public partial class MafileExportTemplateVM : ObservableObject
{ {
[ObservableProperty] private bool _exportToZip;
[ObservableProperty] private bool _includeIdentitySecret; [ObservableProperty] private bool _includeIdentitySecret;
[ObservableProperty] private bool _includeNebulaGroup; [ObservableProperty] private bool _includeNebulaGroup;
[ObservableProperty] private bool _includeNebulaPassword; [ObservableProperty] private bool _includeNebulaPassword;
@@ -334,6 +343,7 @@ public partial class MafileExportTemplateVM : ObservableObject
IncludeNebulaProxy = x.IncludeNebulaProxy, IncludeNebulaProxy = x.IncludeNebulaProxy,
IncludeNebulaPassword = x.IncludeNebulaPassword, IncludeNebulaPassword = x.IncludeNebulaPassword,
IncludeNebulaGroup = x.IncludeNebulaGroup, IncludeNebulaGroup = x.IncludeNebulaGroup,
ExportToZip = x.ExportToZip,
Path = x.Path Path = x.Path
}; };
} }
@@ -352,6 +362,7 @@ public partial class MafileExportTemplateVM : ObservableObject
IncludeNebulaProxy = IncludeNebulaProxy, IncludeNebulaProxy = IncludeNebulaProxy,
IncludeNebulaPassword = IncludeNebulaPassword, IncludeNebulaPassword = IncludeNebulaPassword,
IncludeNebulaGroup = IncludeNebulaGroup, IncludeNebulaGroup = IncludeNebulaGroup,
ExportToZip = ExportToZip,
Path = Path Path = Path
}; };
} }
@@ -368,6 +379,7 @@ public partial class MafileExportTemplateVM : ObservableObject
model.IncludeNebulaProxy = IncludeNebulaProxy; model.IncludeNebulaProxy = IncludeNebulaProxy;
model.IncludeNebulaPassword = IncludeNebulaPassword; model.IncludeNebulaPassword = IncludeNebulaPassword;
model.IncludeNebulaGroup = IncludeNebulaGroup; model.IncludeNebulaGroup = IncludeNebulaGroup;
model.ExportToZip = ExportToZip;
model.Path = Path; model.Path = Path;
} }
} }
@@ -80,7 +80,7 @@ public partial class ProxyManagerVM
resolvedProxy = new MaProxy(parsedId, byId); resolvedProxy = new MaProxy(parsedId, byId);
} }
else if (ProxyStorage.DefaultScheme.TryParse(proxyPart, out var parsedProxy)) else if (ProxyStorage.DefaultScheme.TryParse(proxyPart, out var parsedProxy) || ProxyStorage.SignAtScheme.TryParse(proxyPart, out parsedProxy))
{ {
// Mode: login:proxy_string — find existing or add // Mode: login:proxy_string — find existing or add
resolvedProxy = FindOrAddProxy(parsedProxy); resolvedProxy = FindOrAddProxy(parsedProxy);
@@ -80,4 +80,10 @@ public static class TimeAligner
client.Dispose(); client.Dispose();
} }
} }
public static void SetTimeDifference(int timeDifference)
{
_timeDifference = timeDifference;
_aligned = true;
}
} }