diff --git a/.editorconfig b/.editorconfig
deleted file mode 100644
index 4902924..0000000
--- a/.editorconfig
+++ /dev/null
@@ -1,201 +0,0 @@
-# Удалите строку ниже, если вы хотите наследовать параметры .editorconfig из каталогов, расположенных выше в иерархии
-root = true
-
-# Файлы C#
-[*.cs]
-
-#### Основные параметры EditorConfig ####
-
-# Отступы и интервалы
-indent_size = 4
-indent_style = tab
-tab_width = 4
-
-# Предпочтения для новых строк
-end_of_line = crlf
-insert_final_newline = false
-
-#### Рекомендации по написанию кода .NET ####
-
-# Упорядочение Using
-dotnet_separate_import_directive_groups = false
-dotnet_sort_system_directives_first = false
-file_header_template = unset
-
-# Предпочтения для this. и Me.
-dotnet_style_qualification_for_event = false:silent
-dotnet_style_qualification_for_field = false:silent
-dotnet_style_qualification_for_method = false:silent
-dotnet_style_qualification_for_property = false:silent
-
-# Параметры использования ключевых слов языка и типов BCL
-dotnet_style_predefined_type_for_locals_parameters_members = true:silent
-dotnet_style_predefined_type_for_member_access = true:silent
-
-# Предпочтения для скобок
-dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
-dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
-dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
-dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
-
-# Предпочтения модификатора
-dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
-
-# Выражения уровень предпочтения
-dotnet_style_coalesce_expression = true:suggestion
-dotnet_style_collection_initializer = true:suggestion
-dotnet_style_explicit_tuple_names = true:suggestion
-dotnet_style_null_propagation = true:suggestion
-dotnet_style_object_initializer = true:suggestion
-dotnet_style_operator_placement_when_wrapping = beginning_of_line
-dotnet_style_prefer_auto_properties = true:silent
-dotnet_style_prefer_compound_assignment = true:suggestion
-dotnet_style_prefer_conditional_expression_over_assignment = true:silent
-dotnet_style_prefer_conditional_expression_over_return = true:silent
-dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
-dotnet_style_prefer_inferred_tuple_names = true:suggestion
-dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
-dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
-dotnet_style_prefer_simplified_interpolation = true:suggestion
-
-# Предпочтения для полей
-dotnet_style_readonly_field = true:suggestion
-
-# Настройки параметров
-dotnet_code_quality_unused_parameters = all:suggestion
-
-#### Рекомендации по написанию кода C# ####
-
-# Предпочтения var
-csharp_style_var_elsewhere = false:silent
-csharp_style_var_for_built_in_types = false:silent
-csharp_style_var_when_type_is_apparent = false:silent
-
-# Члены, заданные выражениями
-csharp_style_expression_bodied_accessors = true:silent
-csharp_style_expression_bodied_constructors = false:silent
-csharp_style_expression_bodied_indexers = true:silent
-csharp_style_expression_bodied_lambdas = true:silent
-csharp_style_expression_bodied_local_functions = false:silent
-csharp_style_expression_bodied_methods = false:silent
-csharp_style_expression_bodied_operators = false:silent
-csharp_style_expression_bodied_properties = true:silent
-
-# Настройки соответствия шаблонов
-csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
-csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
-csharp_style_prefer_switch_expression = true:suggestion
-
-# Настройки проверки на null
-csharp_style_conditional_delegate_call = true:suggestion
-
-# Предпочтения модификатора
-csharp_prefer_static_local_function = true:suggestion
-csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:silent
-
-# Предпочтения для блоков кода
-csharp_prefer_braces = true:silent
-csharp_prefer_simple_using_statement = true:suggestion
-
-# Выражения уровень предпочтения
-csharp_prefer_simple_default_expression = true:suggestion
-csharp_style_deconstructed_variable_declaration = true:suggestion
-csharp_style_inlined_variable_declaration = true:suggestion
-csharp_style_pattern_local_over_anonymous_function = true:suggestion
-csharp_style_prefer_index_operator = true:suggestion
-csharp_style_prefer_range_operator = true:suggestion
-csharp_style_throw_expression = true:suggestion
-csharp_style_unused_value_assignment_preference = discard_variable:suggestion
-csharp_style_unused_value_expression_statement_preference = discard_variable:silent
-
-# предпочтения для директивы using
-csharp_using_directive_placement = outside_namespace:silent
-
-#### Правила форматирования C# ####
-
-# Предпочтения для новых строк
-csharp_new_line_before_catch = true
-csharp_new_line_before_else = true
-csharp_new_line_before_finally = true
-csharp_new_line_before_members_in_anonymous_types = true
-csharp_new_line_before_members_in_object_initializers = true
-csharp_new_line_before_open_brace = all
-csharp_new_line_between_query_expression_clauses = true
-
-# Предпочтения для отступов
-csharp_indent_block_contents = true
-csharp_indent_braces = false
-csharp_indent_case_contents = true
-csharp_indent_case_contents_when_block = true
-csharp_indent_labels = one_less_than_current
-csharp_indent_switch_labels = true
-
-# Предпочтения для интервалов
-csharp_space_after_cast = false
-csharp_space_after_colon_in_inheritance_clause = true
-csharp_space_after_comma = true
-csharp_space_after_dot = false
-csharp_space_after_keywords_in_control_flow_statements = true
-csharp_space_after_semicolon_in_for_statement = true
-csharp_space_around_binary_operators = before_and_after
-csharp_space_around_declaration_statements = false
-csharp_space_before_colon_in_inheritance_clause = true
-csharp_space_before_comma = false
-csharp_space_before_dot = false
-csharp_space_before_open_square_brackets = false
-csharp_space_before_semicolon_in_for_statement = false
-csharp_space_between_empty_square_brackets = false
-csharp_space_between_method_call_empty_parameter_list_parentheses = false
-csharp_space_between_method_call_name_and_opening_parenthesis = false
-csharp_space_between_method_call_parameter_list_parentheses = false
-csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
-csharp_space_between_method_declaration_name_and_open_parenthesis = false
-csharp_space_between_method_declaration_parameter_list_parentheses = false
-csharp_space_between_parentheses = false
-csharp_space_between_square_brackets = false
-
-# Предпочтения переноса
-csharp_preserve_single_line_blocks = true
-csharp_preserve_single_line_statements = true
-
-#### Стили именования ####
-
-# Правила именования
-
-dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
-dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
-dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
-
-dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
-dotnet_naming_rule.types_should_be_pascal_case.symbols = types
-dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
-
-dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
-dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
-dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
-
-# Спецификации символов
-
-dotnet_naming_symbols.interface.applicable_kinds = interface
-dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
-dotnet_naming_symbols.interface.required_modifiers =
-
-dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
-dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
-dotnet_naming_symbols.types.required_modifiers =
-
-dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
-dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
-dotnet_naming_symbols.non_field_members.required_modifiers =
-
-# Стили именования
-
-dotnet_naming_style.pascal_case.required_prefix =
-dotnet_naming_style.pascal_case.required_suffix =
-dotnet_naming_style.pascal_case.word_separator =
-dotnet_naming_style.pascal_case.capitalization = pascal_case
-
-dotnet_naming_style.begins_with_i.required_prefix = I
-dotnet_naming_style.begins_with_i.required_suffix =
-dotnet_naming_style.begins_with_i.word_separator =
-dotnet_naming_style.begins_with_i.capitalization = pascal_case
diff --git a/.gitignore b/.gitignore
index bf86047..4721ffe 100644
--- a/.gitignore
+++ b/.gitignore
@@ -35,6 +35,7 @@ obj/
# Visual Studio 2015/2017 cache/options directory
.vs/
+.idea/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
diff --git a/.vs/OlibKey/DesignTimeBuild/.dtbcache.v2 b/.vs/OlibKey/DesignTimeBuild/.dtbcache.v2
deleted file mode 100644
index 875cc6e..0000000
Binary files a/.vs/OlibKey/DesignTimeBuild/.dtbcache.v2 and /dev/null differ
diff --git a/.vs/OlibKey/v16/.suo b/.vs/OlibKey/v16/.suo
deleted file mode 100644
index 2bd014d..0000000
Binary files a/.vs/OlibKey/v16/.suo and /dev/null differ
diff --git a/App.axaml b/App.axaml
index 98915c7..e368cab 100644
--- a/App.axaml
+++ b/App.axaml
@@ -10,7 +10,7 @@
-
+
@@ -22,7 +22,6 @@
-
-
@@ -106,6 +101,9 @@
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/App.axaml.cs b/App.axaml.cs
index 57f64fe..5973dac 100644
--- a/App.axaml.cs
+++ b/App.axaml.cs
@@ -3,13 +3,11 @@
using Avalonia.Markup.Xaml;
using Avalonia.Markup.Xaml.Styling;
using Avalonia.Threading;
-using OlibKey.Structures;
using OlibKey.Views.Controls;
using OlibKey.Views.Windows;
using System;
using System.Diagnostics;
using System.Globalization;
-using System.IO;
using System.Net;
using System.Reflection;
@@ -17,13 +15,12 @@ namespace OlibKey
{
public class App : Application
{
- public static Settings Settings { get; set; }
-
public static DispatcherTimer Autosave { get; set; }
public static DispatcherTimer Autoblock { get; set; }
+ public static DispatcherTimer ClearingClipboard { get; set; }
- private static string ResultCheckUpdate;
- private static string ErrorResult;
+ private static string _resultCheckUpdate;
+ private static string _errorResult;
public static MainWindow MainWindow { get; set; }
public static MainWindowViewModel MainWindowViewModel { get; set; }
@@ -33,14 +30,10 @@ public override void Initialize()
{
AvaloniaXamlLoader.Load(this);
- Settings = File.Exists(AppDomain.CurrentDomain.BaseDirectory + "settings.xml")
- ? Core.SaveAndLoadSettings.LoadSettings()
- : new Settings();
-
- Current.Styles[2] = !string.IsNullOrEmpty(Settings.Theme)
+ Current.Styles[2] = !string.IsNullOrEmpty(Program.Settings.Theme)
? new StyleInclude(new Uri("resm:Styles?assembly=OlibKey"))
{
- Source = new Uri($"avares://OlibKey/Assets/Themes/{Settings.Theme}.axaml")
+ Source = new Uri($"avares://OlibKey/Assets/Themes/{Program.Settings.Theme}.axaml")
}
: new StyleInclude(new Uri("resm:Styles?assembly=OlibKey"))
{
@@ -49,32 +42,39 @@ public override void Initialize()
Autosave = new DispatcherTimer();
Autoblock = new DispatcherTimer();
+ ClearingClipboard = new DispatcherTimer();
- Autosave.Tick += (s, d) =>
+ Autosave.Tick += (_, __) =>
{
- foreach (TabItem item in MainWindowViewModel.TabItems) MainWindowViewModel.SaveDatabase((DatabaseControl)item.Content);
+ for (var i = 0; i < MainWindowViewModel.TabItems.Count; i++)
+ MainWindowViewModel.SaveDatabase((DatabaseControl) MainWindowViewModel.TabItems[i].Content);
};
+ ClearingClipboard.Tick += (_, __) =>
+ {
+ ClearingClipboard.Stop();
+ Current.Clipboard.ClearAsync();
+ MainWindow.MessageStatusBar((string)Current.FindResource("ClipboardIsCleared"));
+ };
- Autosave.Interval = new TimeSpan(0, Settings.AutosaveDuration, 0);
- Autoblock.Interval = new TimeSpan(0, Settings.BlockDuration, 0);
-
+ Autosave.Interval = new TimeSpan(0, Program.Settings.AutosaveDuration, 0);
+ Autoblock.Interval = new TimeSpan(0, Program.Settings.BlockDuration, 0);
- if (Settings.FirstRun)
+ if (Program.Settings.FirstRun)
{
- Settings.Language = $"{CultureInfo.CurrentCulture}";
- Settings.FirstRun = false;
+ Program.Settings.Language = $"{CultureInfo.CurrentCulture}";
+ Program.Settings.FirstRun = false;
}
try
{
Current.Styles[4] = new StyleInclude(new Uri("resm:Styles?assembly=OlibKey"))
{
- Source = new Uri($"avares://OlibKey/Assets/Local/lang.{Settings.Language}.axaml")
+ Source = new Uri($"avares://OlibKey/Assets/Local/lang.{Program.Settings.Language}.axaml")
};
}
catch
{
- Settings.Language = null;
+ Program.Settings.Language = null;
Current.Styles[4] = new StyleInclude(new Uri("resm:Styles?assembly=OlibKey"))
{
Source = new Uri($"avares://OlibKey/Assets/Local/lang.en-US.axaml")
@@ -91,53 +91,50 @@ public static async void CheckUpdate(bool b)
try
{
using WebClient wb = new WebClient();
- wb.DownloadStringCompleted += (s, args) =>
+ wb.DownloadStringCompleted += (_, args) =>
{
if (args.Error != null)
{
- ErrorResult = args.Error.ToString();
+ _errorResult = args.Error.ToString();
return;
}
- ResultCheckUpdate = args.Result;
+ _resultCheckUpdate = args.Result;
};
await wb.DownloadStringTaskAsync(new Uri(
"https://raw.githubusercontent.com/MagnificentEagle/OlibKey/master/ForRepository/version.txt"));
- float latest = float.Parse(ResultCheckUpdate.Replace(".", ""));
+ float latest = float.Parse(_resultCheckUpdate.Replace(".", ""));
float current =
- float.Parse(Assembly.GetExecutingAssembly().GetName().Version.ToString().Replace(".", ""));
+ float.Parse(Assembly.GetExecutingAssembly().GetName().Version?.ToString().Replace(".", "")!);
+
if (!(latest > current) && b)
{
- _ = await MessageBox.Show(MainWindow,
+ await MessageBox.Show(MainWindow,
null, (string)Current.FindResource("MB8"), (string)Current.FindResource("Message"),
MessageBox.MessageBoxButtons.Ok, MessageBox.MessageBoxIcon.Information);
return;
}
+
if (!(latest > current)) return;
if (await MessageBox.Show(MainWindow,
null, (string)Current.FindResource("MB4"), (string)Current.FindResource("Message"),
MessageBox.MessageBoxButtons.YesNo,
MessageBox.MessageBoxIcon.Question) == MessageBox.MessageBoxResult.Yes)
{
- ProcessStartInfo psi = new ProcessStartInfo
+ Process.Start(new ProcessStartInfo
{
FileName = "https://github.com/MagnificentEagle/OlibKey/releases",
UseShellExecute = true
- };
- Process.Start(psi);
+ });
}
}
catch (Exception ex)
{
if (b)
{
- if (ErrorResult != null)
- _ = await MessageBox.Show(MainWindow, ErrorResult,
+ await MessageBox.Show(MainWindow, _errorResult ?? ex.ToString(),
(string)Current.FindResource("MB5"), (string)Current.FindResource("Error"), MessageBox.MessageBoxButtons.Ok,
MessageBox.MessageBoxIcon.Error);
- else _ = await MessageBox.Show(MainWindow, ex.ToString(),
- (string)Current.FindResource("MB5"), (string)Current.FindResource("Error"), MessageBox.MessageBoxButtons.Ok,
- MessageBox.MessageBoxIcon.Error);
}
}
}
diff --git a/Assets/Images/Icons.axaml b/Assets/Images/Icons.axaml
index 17b8c9c..ae2c7ef 100644
--- a/Assets/Images/Icons.axaml
+++ b/Assets/Images/Icons.axaml
@@ -107,232 +107,143 @@
-
-
-
+
-
-
-
-
-
-
-
-
+
-
-
-
+
-
-
-
+
-
-
-
+
-
-
-
+
-
-
-
+
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
+
-
-
-
+
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
+
-
-
-
+
-
-
-
+
-
-
-
+
-
-
-
+
-
-
-
+
-
-
-
+
-
-
-
+
-
-
-
-
+
-
-
-
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Assets/Local/lang.de-DE.axaml b/Assets/Local/lang.de-DE.axaml
index 925a95d..c958550 100644
--- a/Assets/Local/lang.de-DE.axaml
+++ b/Assets/Local/lang.de-DE.axaml
@@ -11,6 +11,7 @@
Sicher speichern
Speichern Sie alle Tresore
Login hinzufügen
+ Korb
Einstellungen
Melden Sie sich von OlibKey ab
Passwortgenerator
@@ -19,12 +20,19 @@
Auf Update prüfen
OlibKey-Datenbankdatei
+ Leer
+ Nicht gefunden
+
Suche
Alle Artikel
Ordner
Nicht ausgewählt
Deaktivieren Sie
Artikelname
+
+ Erinnerungen ausführen
+ Alphabetisch sortieren
+ Favoriten
OlibKey auf GitHub
OlibKey auf VK
@@ -33,6 +41,9 @@
Bereit
Artikel:
Geöffnete Basen:
+ Reinigung erfolgt
+ Ordner:
+ Entfernt:
Zusammenbruch
Erweitern
@@ -55,7 +66,10 @@
Verschließen Sie alle Tresore
Speicher entsperren
Schalte alle Tresore frei
- Zeigen OlibKey
+
+ Очистить корзину
+ Удалить выбранное
+ Вернуть выбранное
Sie müssen zuerst Speicher hochladen oder erstellen!
Fehler
@@ -67,6 +81,7 @@
Sie können keine Zeichen aus einer leeren Zeichenfolge verlangen!
Keine Häkchen ausgewählt oder Passwortlänge angegeben!
Derzeit gibt es keine neuen Updates.
+ Sind Sie sicher, dass Sie Ihren Müll leeren möchten?
Erfolgreich!
@@ -79,6 +94,9 @@
Alle Tresore wurden erfolgreich gesperrt!
Alle Tresore wurden erfolgreich entsperrt!
Tresor erfolgreich gesperrt:
+ In die Zwischenablage kopiert!
+ Die Zwischenablage wird gelöscht!
+ Wird geladen...
Kleinbuchstaben (abc)
Großbuchstaben (ABC)
@@ -99,10 +117,18 @@
Auswählen
Anzahl der Iterationen:
Anzahl der Verschlüsselungsverfahren:
+ Verwenden Sie die Komprimierung
+ Verwenden Sie Müll
In Feldern mit einem numerischen Eintrag müssen Werte Zahlen enthalten und dürfen nicht Null sein!
Sie haben keinen Repository-Pfad ausgewählt oder kein Hauptkennwort angegeben!
Sie können keinen Tresor erstellen, wenn dieser Tresor bereits geöffnet ist!
+ Überprüfen schwacher Passwörter
+ Gesamtkomplexität:
+ Fix
+ Wählen Sie Alle
+ Hier sind schwache Passwörter, die Sie ersetzen können. Wählen Sie diejenigen aus, die Sie ändern möchten, und klicken Sie auf die Schaltfläche Fix. Der Austausch erfolgt gemäß den Einstellungen des Passwortgenerators.
+
Öffnen
Geben Sie das Master-Passwort ein
@@ -116,10 +142,14 @@
Allgemeines
Gewölbe
Automatisch speichern über:
- Blockieren Sie alle Datenbanken (außer mit einer Erinnerung) durch:
+ Blockieren Sie alle Datenbanken (außer mit einer laufenden Erinnerung) durch:
Dauer der Nachrichtenanzeige:
Sekunden
Protokoll
+ Tage
+ Hardwarebeschleunigung (Neustart erforderlich)
+ Entfernen Sie einen Artikel automatisch aus dem Papierkorb über:
+ Zwischenablage nach dem Kopieren löschen über:
Blendend
Düster
diff --git a/Assets/Local/lang.en-US.axaml b/Assets/Local/lang.en-US.axaml
index 139122c..40914e6 100644
--- a/Assets/Local/lang.en-US.axaml
+++ b/Assets/Local/lang.en-US.axaml
@@ -11,6 +11,7 @@
Save storage
Save all storages
Add log in
+ Trash
Settings
Exit from OlibKey
Password generator
@@ -19,12 +20,19 @@
Check for Updates
OlibKey Database File
+ Empty
+ Not found
+
Search
All items
Folder
Not chosen
Remove selection
Item name
+
+ Running reminders
+ Sort alphabetically
+ Favorites
OlibKey on GitHub
OlibKey on VK
@@ -33,6 +41,9 @@
Ready
Elements:
Opened bases:
+ Cleaning done
+ Folders:
+ Removed:
Collapse
Expand
@@ -55,7 +66,10 @@
Lock all storages
Unlock storage
Unlock all storages
- Show OlibKey
+
+ Empty trash
+ Delete selected
+ Return selected
You must first upload or create storage!
Error
@@ -67,6 +81,7 @@
You cannot require characters from an empty string!
No checkmarks selected or password length specified!
There are no new updates at this time.
+ Are you sure you want to empty your trash?
Successfully!
@@ -79,6 +94,9 @@
All storages are locked successfully!
All storages have been successfully unlocked!
Storage locked successfully:
+ Copied to the clipboard!
+ Clipboard is cleared!
+ Loading...
Lowercase (abc)
Uppercase (ABC)
@@ -99,10 +117,18 @@
Select
Number of iterations:
Number of encryption procedures:
+ Use compression
+ Use trash
In fields with a numeric entry, values must contain numbers and cannot be zero!
You did not select a repository path or did not provide a master password!
You cannot create a vault if this vault is already open!
+ Checking weak passwords
+ Overall complexity:
+ Fix
+ Select all
+ Here are weak passwords that you can replace. Select the ones you want to change and click on the Fix button. The replacement will take place according to the password generator settings.
+
Open
Enter Master Password
@@ -116,10 +142,14 @@
General
Storage
Autosave via:
- Block all databases (except with a reminder) through:
+ Block all databases (except with a running reminder) through:
Message display duration:
seconds
minutes
+ days
+ Hardware acceleration (reboot required)
+ Automatically remove an item from the trash via:
+ Clear clipboard after copying via:
Dazzling
Gloomy
diff --git a/Assets/Local/lang.fr-FR.axaml b/Assets/Local/lang.fr-FR.axaml
index c512f5b..b2315c3 100644
--- a/Assets/Local/lang.fr-FR.axaml
+++ b/Assets/Local/lang.fr-FR.axaml
@@ -11,6 +11,7 @@
Enregistrer le stockage
Enregistrer tous les coffres
Ajouter une connexion
+ Panier
Paramètres
Déconnectez-vous d'OlibKey
Générateur de mot de passe
@@ -19,12 +20,19 @@
Vérifier les mises à jour
Fichier de base de données OlibKey
+ Vide
+ Pas trouvé
+
Chercher
Tous les articles
Dossier
Non sélectionné
Désélectionner
Nom de l'article
+
+ Rappels en cours d'exécution
+ Trier par ordre alphabétique
+ Favoris
OlibKey sur GitHub
OlibKey sur VK
@@ -33,6 +41,9 @@
Prêt
Articles:
Bases ouvertes:
+ Nettoyage terminé
+ Dossiers:
+ Supprimé:
Réduire
Développer
@@ -55,7 +66,10 @@
Verrouiller tous les stockages
Déverrouillez le stockage
Déverrouiller tous les stockages
- Afficher OlibKey
+
+ Poubelle vide
+ Supprimer sélectionnée
+ Retour sélectionné
Vous devez d'abord télécharger ou créer du stockage!
Erreur
@@ -67,6 +81,7 @@
Vous ne pouvez pas exiger des caractères d'une chaîne vide!
Aucune coche sélectionnée ou longueur de mot de passe spécifiée!
Il n'y a aucune nouvelle mise à jour pour le moment.
+ Voulez-vous vraiment vider votre corbeille?
Avec succès!
@@ -79,6 +94,9 @@
Tous les stockage ont été verrouillés avec succès!
Tous les stockage ont été déverrouillés avec succès!
Stockage verrouillé avec succès:
+ Copié dans le presse-papiers!
+ Le presse-papiers est effacé!
+ Chargement...
Minuscules (abc)
Majuscules (ABC)
@@ -99,10 +117,18 @@
Sélectionnez
Nombre d'itérations:
Nombre de procédures de cryptage:
+ Utiliser la compression
+ Utiliser la poubelle
Dans les champs avec une entrée numérique, les valeurs doivent contenir des nombres et ne peuvent pas être zéro!
Vous n'avez pas sélectionné de chemin de référentiel ou n'avez pas fourni de mot de passe principal!
Vous ne pouvez pas créer de coffre-fort si ce coffre-fort est déjà ouvert!
+ Vérification des mots de passe faibles
+ Complexité globale:
+ Réparer
+ Tout sélectionner
+ Voici les mots de passe faibles que vous pouvez remplacer. Sélectionnez ceux que vous souhaitez modifier et cliquez sur le bouton Réparer. Le remplacement aura lieu selon les paramètres du générateur de mot de passe.
+
Ouverte
Entrez le mot de passe principal
@@ -116,10 +142,14 @@
Général
Voûte
Sauvegarde automatique via:
- Bloquez toutes les bases de données (sauf avec un rappel) via:
+ Bloquez toutes les bases de données (sauf avec un rappel en cours) via:
Durée d'affichage des messages:
secondes
minutes
+ journées
+ Accélération matérielle (redémarrage requis)
+ Supprimer automatiquement un élément de la corbeille via:
+ Effacer le presse-papiers après la copie via:
Éblouissant
Sombre
diff --git a/Assets/Local/lang.hy-AM.axaml b/Assets/Local/lang.hy-AM.axaml
index ad4d332..a9fc9cd 100644
--- a/Assets/Local/lang.hy-AM.axaml
+++ b/Assets/Local/lang.hy-AM.axaml
@@ -11,6 +11,7 @@
Պահպանել պահեստ
Պահպանեք բոլոր պահոցները
Ավելացնել լոգին
+ Զամբյուղ
Կարգավորումներ
Դուրս գալ OlibKey-ից
Գաղտնաբառի գեներատոր
@@ -19,12 +20,19 @@
Ստուգել թարմացումները
OlibKey տվյալների շտեմարան
+ Դատարկ
+ Չի գտնվել
+
Որոնել
Բոլոր իրերը
Թղթապանակ
Ընտրված չէ
Elնջել
Նյութի անվանումը
+
+ Գործարկման հիշեցումներ
+ Դասավորեք այբբենական կարգով
+ Ընտրյալներ
OlibKey- ը GitHub- ում
OlibKey- ը VK- ում
@@ -33,6 +41,9 @@
Պատրաստ է
Նյութեր:
Բացված հիմքերը:
+ Մաքրումը կատարվում է
+ Թղթապանակներ:
+ Հեռացված:
Փլուզվել
Ընդլայնել
@@ -55,7 +66,10 @@
Կողպեք բոլոր պահոցները
Բացել պահեստը
Բացել բոլոր պահոցները
- Ուցադրել OlibKey
+
+ Դատարկ աղբարկղ
+ Ջնջել ընտրված
+ Վերադարձնել ընտրված
Առաջինը, դուք պետք էք բեռնել կամ ստեղծել պահեստ
Սխալ
@@ -67,6 +81,7 @@
Դուք չեք կարող պահանջել նիշ դատարկ տողից:
Ընտրված չէ նշման նշան կամ գաղտնաբառի երկարություն:
Այս պահին նոր թարմացումներ չկան:
+ Вы дейстивтельно хотите очистить корзину?
Հաջող!
@@ -79,6 +94,9 @@
Բոլոր պահոցները հաջողությամբ կողպվել են:
Բոլոր պահոցները հաջողությամբ բացվել են:
Հիմքը հաջողությամբ արգելափակված է.
+ Պատճենահանվեց clipboard- ին:
+ Տեսահոլովակը մաքրված է:
+ Բեռնվում է...
Փոքրատառ (abc)
Մեծատառ (ABC)
@@ -99,9 +117,17 @@
Ընտրել
Կրկնությունների քանակը.
Գաղտնագրման ընթացակարգերի քանակը.
+ Օգտագործեք սեղմում
+ Օգտագործեք զամբյուղը
Թվային մուտքագրման դաշտերում արժեքները պետք է պարունակեն թվեր և չեն կարող զրո լինել:
Դուք չեք ընտրել պահեստային ուղի կամ չեք տրամադրել վարպետ գաղտնաբառ:
Դուք չեք կարող ստեղծել պահոց, եթե այս կամարն արդեն բաց է:
+
+ Ստուգում են թույլ գաղտնաբառերը
+ Ընդհանուր դժվարություն.
+ Ուղղել
+ Ընտրել բոլորը
+ Ահա թույլ գաղտնաբառերը, որոնք կարող եք փոխարինել: Ընտրեք դրանք, որոնք ցանկանում եք փոխել և կտտացրեք ամրագրման կոճակին: Փոխումը տեղի է ունենալու ըստ գաղտնաբառի գեներատորի պարամետրերի:
Բացել
Գրեք վարպետության գաղտնաբառը
@@ -116,10 +142,14 @@
Գեներալ
Պահոց
Ավտոմատ խնայողություն միջոցով ՝
- Արգելափակել բոլոր տվյալների բազաները (բացառությամբ հիշեցմամբ) ՝
+ Արգելափակել բոլոր տվյալների բազաները (բացառությամբ գործարկման հիշեցման) միջոցով ՝
Հաղորդագրության ցուցադրման տևողությունը.
վայրկյան
րոպեներ
+ օրեր
+ Սարքավորումների արագացում (անհրաժեշտ է վերաբեռնումը)
+ Ավտոմատ կերպով հանեք իրը զամբյուղից ՝
+ Մաքրել clipboard միջոցով պատճենելուց հետո ՝
Զարմանալի
Մռայլ
diff --git a/Assets/Local/lang.ru-RU.axaml b/Assets/Local/lang.ru-RU.axaml
index 57d5b73..4919b19 100644
--- a/Assets/Local/lang.ru-RU.axaml
+++ b/Assets/Local/lang.ru-RU.axaml
@@ -11,6 +11,7 @@
Сохранить хранилище
Сохранить все хранилища
Добавить логин
+ Корзина
Настройки
Выйти из OlibKey
Генератор паролей
@@ -19,12 +20,19 @@
Проверить наличие обновлении
Файл базы данных OlibKey
+ Пусто
+ Не найдено
+
Поиск
Все элементы
Папка
Не выбрано
Снять выделение
Название элемента
+
+ Запущенные напоминания
+ Сортировка по алфавиту
+ Избранное
OlibKey на GitHub
OlibKey во ВКонтакте
@@ -33,6 +41,9 @@
Готов
Элементов:
Открыто баз:
+ Произведена очистка
+ Папки:
+ Удалён:
Свернуть
Развернуть
@@ -55,7 +66,10 @@
Заблокировать все хранилища
Разблокировать хранилище
Разблокировать все хранилища
- Показать OlibKey
+
+ Очистить корзину
+ Удалить выбранное
+ Вернуть выбранное
Сначала вы должны загрузить или создать хранилище!
Ошибка
@@ -67,6 +81,7 @@
Вы не можете требовать символы из пустой строки!
Не выбрано ни одной галочки или не указана длина пароля!
На данный момент нет новых обновлений
+ Вы действительно хотите очистить корзину?
Успешно!
@@ -79,6 +94,9 @@
Все хранилища успешно заблокированы!
Все хранилища успешно разблокированы!
Успешно разблокировано хранилище:
+ Скопировано в буфер обмена!
+ Буфер обмена очищен!
+ Идёт загрузка...
Строчные (abc)
Заглавные (ABC)
@@ -99,9 +117,17 @@
Выбрать
Количество итерации:
Количество процедур шифрования:
+ Использовать сжатие
+ Использовать корзину
В полях с вводом цифровых значении должны содержать числа и не могут быть равны нулю!
Вы не выбрали путь хранилища или не указали мастер-пароль!
Вы не сможете создать хранилище, оно уже открыто!
+
+ Проверка слабых паролей
+ Общая сложность:
+ Исправить
+ Выделить все
+ Здесь представлены слабые пароли, которые можно заменить. Выберите те, которые вы хотите изменить, и нажмите на кнопку Исправить. Замена будет происходить согласно настройкам генератора паролей.
Открыть
Введите мастер-пароль
@@ -116,10 +142,14 @@
Общее
Хранилище
Автосохранение через:
- Заблокировать все базы (кроме с напоминанием) через:
+ Заблокировать все базы (кроме с запущенным напоминанием) через:
Длительность показа сообщения:
секунд
минут
+ дней
+ Аппаратное ускорение (требуется перезагрузка)
+ Автоматически удалять элемент из корзины через:
+ Очищать буфер обмена после копирования через:
Ослепительная
Мрачная
diff --git a/Assets/Local/lang.uk-UA.axaml b/Assets/Local/lang.uk-UA.axaml
index 12577bb..ea9b055 100644
--- a/Assets/Local/lang.uk-UA.axaml
+++ b/Assets/Local/lang.uk-UA.axaml
@@ -11,6 +11,7 @@
Зберегти сховище
Зберегти всі сховища
Додати логін
+ Кошик
Налаштування
Вийти з OlibKey
Генератор паролей
@@ -19,12 +20,19 @@
Перевірити наявність оновленні
Файл бази даних OlibKey
+ Пусто
+ Не знайдено
+
Пошук
Всі елементи
Тека
Не вибрано
Зняти виділення
Назва елемента
+
+ Запущені нагадування
+ Сортування за алфавітом
+ Вибране
OlibKey на GitHub
OlibKey у ВКонтакте
@@ -33,6 +41,9 @@
Готовий
Елементів:
Відкрито баз:
+ Очищено
+ Папки:
+ Вилучений:
Згорнути
Розгорнути
@@ -55,7 +66,10 @@
Заблокувати всі сховища
Розблокувати сховище
Розблокувати все сховища
- Показати OlibKey
+
+ Очистить корзину
+ Удалить выбранное
+ Вернуть выбранное
Спочатку ви повинні завантажити або створити сховище!
Помилка
@@ -67,6 +81,7 @@
Ви не можете вимагати символи з порожнього рядка!
Не вибрано жодної галочки або не зазначена довжина пароля!
На даний момент немає нових оновлень
+ Ви дійсно хочете очистити кошик?
Успішно!
@@ -79,6 +94,9 @@
Всі сховища успішно заблоковані!
Всі сховища успішно розблоковані!
Успішно розблоковано сховище:
+ Скопійовано в буфер обміну!
+ Буфер обміну очищений!
+ Іде завантаження...
Рядкові (abc)
Заголовні (ABC)
@@ -99,9 +117,17 @@
Вибрати
Кількість ітерації:
Кількість процедур шифрування:
+ Використовувати стиснення
+ Використовувати кошик
У полях з введенням цифрових значенні повинні містити числа і не можуть бути рівними нулю!
Ви не обрали шлях сховища або не вказали майстер-пароль!
Ви не зможете створити сховище, якщо це сховище вже відкрито!
+
+ Перевірка слабких паролів
+ Загальна складність:
+ Виправити
+ Виділити все
+ Тут представлені слабкі паролі, які можна замінити. Виберіть ті, які ви хочете змінити, і натисніть на кнопку Виправити. Заміна відбуватиметься згідно налаштувань генератора паролів.
Відкрити
Введіть майстер-пароль
@@ -116,10 +142,14 @@
Загальна
Сховище
Автозбереження через:
- Заблокувати всі бази (крім з нагадуванням) через:
+ Заблокувати всі бази (крім з запущеним нагадуванням) через:
Тривалість показу повідомлення:
секунд
хвилин
+ днів
+ Апаратне прискорення (потрібне перезавантаження)
+ Автоматично видаляти елемент з кошика через:
+ Очищати буфер обміну після копіювання через:
Сліпуча
Похмура
diff --git a/Assets/Themes/Dazzling.axaml b/Assets/Themes/Dazzling.axaml
index 517d004..ccd9f31 100644
--- a/Assets/Themes/Dazzling.axaml
+++ b/Assets/Themes/Dazzling.axaml
@@ -9,7 +9,7 @@
#FFA5A5A5
#FFE3E3E3
#FFFFFFFF
- #FFEAEAEA
+ #FFEDEDED
#FF931D60
#FF231E1B
#FF333333
diff --git a/Assets/Themes/Gloomy.axaml b/Assets/Themes/Gloomy.axaml
index a1f957e..d054e59 100644
--- a/Assets/Themes/Gloomy.axaml
+++ b/Assets/Themes/Gloomy.axaml
@@ -6,7 +6,7 @@
#FF000000
#FFFFFFFF
#FF777777
- #FFA5A5A5
+ #FF525252
#FF2B2B2B
#FFFFFFFF
#FF1C1C1C
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 42eb056..d208c27 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
+## [3.2.0] - 2020-08-26
+### Added
+- Added new window "Check for weak passwords"
+- You can now mark items as favorites
+- Added sorting in search
+- Now you can compress the database to save disk space, the option is enabled by default
+- Added "Hardware acceleration" option, disabled by default
+- Added logging
+- Added trash
+- Now automatically clears the clipboard after copying
+
+### Changed
+- Moving to .NET 5 Preview 8
+- Migrating to Avalonia 0.10.999-cibuild0010094-beta
+- Application icons changed
+- Search algorithm rewritten
+- ProgressBar changed due to overflow
+- In Windows, when Program Files is detected, the program will automatically start with administrator rights
+- Context menu buttons for folders in search are now deactivated if a folder is not selected
+- Modals run in the middle of the native, not in the middle of the screen
+- Improved performance
+
+### Fixed
+- Fixed crash on some OS when opening a database: if there are no selected databases, the program terminates abnormally
+- Fixed MessageBox with an exception: it shouldn't stretch to the sides
+- Fixed list virtualization for folders
+
## [3.1.1] - 2020-08-06
### Fixed
- Fixed crash of the program when loading an icon for login, but there are no network connections
diff --git a/Core/Archiving.cs b/Core/Archiving.cs
new file mode 100644
index 0000000..9dd552d
--- /dev/null
+++ b/Core/Archiving.cs
@@ -0,0 +1,44 @@
+using System;
+using System.IO;
+using System.IO.Compression;
+using System.Text;
+
+namespace OlibKey.Core
+{
+ public static class Compressing
+ {
+ public static string Compress(string text)
+ {
+ byte[] buffer = Encoding.UTF8.GetBytes(text);
+ MemoryStream memoryStream = new MemoryStream();
+ using (GZipStream gZipStream = new GZipStream(memoryStream, CompressionMode.Compress, true))
+ gZipStream.Write(buffer, 0, buffer.Length);
+
+ memoryStream.Position = 0;
+
+ byte[] compressedData = new byte[memoryStream.Length];
+ memoryStream.Read(compressedData, 0, compressedData.Length);
+
+ byte[] gZipBuffer = new byte[compressedData.Length + 4];
+ Buffer.BlockCopy(compressedData, 0, gZipBuffer, 4, compressedData.Length);
+ Buffer.BlockCopy(BitConverter.GetBytes(buffer.Length), 0, gZipBuffer, 0, 4);
+
+ return Convert.ToBase64String(gZipBuffer);
+ }
+ public static string Decompress(string text)
+ {
+ byte[] gZipBuffer = Convert.FromBase64String(text);
+ using MemoryStream memoryStream = new MemoryStream();
+ int dataLength = BitConverter.ToInt32(gZipBuffer, 0);
+ memoryStream.Write(gZipBuffer, 4, gZipBuffer.Length - 4);
+
+ byte[] buffer = new byte[dataLength];
+
+ memoryStream.Position = 0;
+ using (GZipStream gZipStream = new GZipStream(memoryStream, CompressionMode.Decompress))
+ gZipStream.Read(buffer, 0, buffer.Length);
+
+ return Encoding.UTF8.GetString(buffer);
+ }
+ }
+}
diff --git a/Core/Encryptor.cs b/Core/Encryptor.cs
index 71f5457..b6a1ac6 100644
--- a/Core/Encryptor.cs
+++ b/Core/Encryptor.cs
@@ -96,16 +96,12 @@ public static string EncryptString(string text, DatabaseControl db)
encryptString = Convert.ToBase64String(baEncrypted);
}
- return db.ViewModel.Iterations + ":" + db.ViewModel.NumberOfEncryptionProcedures + ":" + encryptString;
+ return encryptString;
}
- public static string DecryptString(string text, DatabaseControl db)
+ public static string DecryptString(string text, DatabaseControl db, int iterations, int numberOfEncryptionProcedures)
{
-
- string[] split = text.Split(':');
- int iterations = int.Parse(split[0]);
- int numberOfEncryptionProcedures = int.Parse(split[1]);
- string result = split[2];
+ string result = text;
byte[] baPwdHash = SHA256.Create().ComputeHash(Encoding.UTF8.GetBytes(db.ViewModel.MasterPassword));
diff --git a/Core/Log.cs b/Core/Log.cs
new file mode 100644
index 0000000..aa61611
--- /dev/null
+++ b/Core/Log.cs
@@ -0,0 +1,58 @@
+using System;
+using System.IO;
+using System.Text;
+
+namespace OlibKey.Core
+{
+ public class Log
+ {
+ private static readonly object Sync = new object();
+
+ public enum Type
+ {
+ Info,
+ Warning,
+ Error
+ }
+
+ public static void WriteFatal(Exception ex)
+ {
+ try
+ {
+ string pathToLog = Path.Combine(AppDomain.CurrentDomain.BaseDirectory! , "Log");
+ if(!Directory.Exists(pathToLog)) Directory.CreateDirectory(pathToLog);
+
+ if (ex.TargetSite != null)
+ {
+ lock (Sync)
+ File.AppendAllText(Path.Combine(pathToLog,
+ $"{AppDomain.CurrentDomain.FriendlyName}_{DateTime.Now:dd.MM.yyy}.log"),
+ $"[{DateTime.Now:dd.MM.yyy HH:mm:ss.fff}] | Fatal | [{ex.TargetSite.DeclaringType}.{ex.TargetSite.Name}()] {ex}\r\n",
+ Encoding.UTF8);
+ }
+ }
+ catch
+ {
+ // ignored
+ }
+ }
+ public static void Write(string message, Type type)
+ {
+ try
+ {
+ string pathToLog = Path.Combine(AppDomain.CurrentDomain.BaseDirectory!, "Log");
+ if(!Directory.Exists(pathToLog)) Directory.CreateDirectory(pathToLog);
+
+ lock (Sync)
+ File.AppendAllText(Path.Combine(pathToLog,
+ $"{AppDomain.CurrentDomain.FriendlyName}_{DateTime.Now:dd.MM.yyy}.log"),
+ $"[{DateTime.Now:dd.MM.yyy HH:mm:ss.fff}] | {type} | {message}\r\n", Encoding.UTF8);
+
+ }
+ catch
+ {
+ // ignored
+ }
+ }
+ }
+}
diff --git a/Core/PasswordGenerator.cs b/Core/PasswordGenerator.cs
new file mode 100644
index 0000000..7da9e69
--- /dev/null
+++ b/Core/PasswordGenerator.cs
@@ -0,0 +1,45 @@
+namespace OlibKey.Core
+{
+ public static class PasswordGenerator
+ {
+ public static string RandomPassword()
+ {
+ const string lower = "abcdefghijklmnopqrstuvwxyz";
+ const string upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ const string number = "0123456789";
+ const string special = @"~!@#$%^&*():;[]{}<>,.?/\|";
+ string other = Program.Settings.GeneratorTextOther;
+
+ string allowed = "";
+ string password = "";
+ if (Program.Settings.GeneratorAllowLowercase) allowed += lower;
+ if (Program.Settings.GeneratorAllowUppercase) allowed += upper;
+ if (Program.Settings.GeneratorAllowNumber) allowed += number;
+ if (Program.Settings.GeneratorAllowSpecial) allowed += special;
+ if (Program.Settings.GeneratorAllowUnderscore && password.IndexOfAny("_".ToCharArray()) == -1)
+ {
+ allowed += "_";
+ password += "_";
+ }
+ if (Program.Settings.GeneratorAllowOther) allowed += other;
+ int minChars = int.Parse(Program.Settings.GenerationCount);
+ int numChars = Encryptor.RandomInteger(minChars, minChars);
+ while (password.Length < numChars)
+ password += allowed.Substring(Encryptor.RandomInteger(0, allowed.Length - 1), 1);
+ password = RandomizeString(password);
+ return password;
+ }
+ private static string RandomizeString(string str)
+ {
+ string result = "";
+ while (str.Length > 0)
+ {
+ int i = Encryptor.RandomInteger(0, str.Length - 1);
+ result += str.Substring(i, 1);
+ str = str.Remove(i, 1);
+ }
+
+ return result;
+ }
+ }
+}
diff --git a/Core/PasswordUtils.cs b/Core/PasswordUtils.cs
index 47b6e66..cb9e3b9 100644
--- a/Core/PasswordUtils.cs
+++ b/Core/PasswordUtils.cs
@@ -64,7 +64,7 @@ public static int CheckPasswordStrength(string password)
{"[!,@#\\$%\\^&\\*?_~=;:'\"<>[]()~`\\\\|/]", 0.4},
{@"[¶©]", 0.5}
};
- foreach ((string key, double value) in patterns)
+ foreach ((string key, double value) in patterns)
if (Regex.Matches(password, key).Count > 0)
multi2 += value;
if (password.Length > 2) multi3 += 0;
diff --git a/Core/SaveAndLoadDatabase.cs b/Core/SaveAndLoadDatabase.cs
index a585664..6ccee50 100644
--- a/Core/SaveAndLoadDatabase.cs
+++ b/Core/SaveAndLoadDatabase.cs
@@ -7,14 +7,49 @@ namespace OlibKey.Core
{
public class SaveAndLoadDatabase
{
- public static Database LoadFiles(DatabaseControl db) => (Database)new XmlSerializer(typeof(Database)).Deserialize(new StringReader(Encryptor.DecryptString(File.ReadAllText(db.ViewModel.PathDatabase), db)));
+ public static Database LoadFiles(DatabaseControl db)
+ {
+ string s = File.ReadAllText(db.ViewModel.PathDatabase);
+
+ string[] split = s.Split(':');
+ int iterations = int.Parse(split[0]);
+ int numberOfEncryptionProcedures = int.Parse(split[1]);
+ string encryptString = split[2];
+
+ if (split.Length > 3)
+ {
+ bool useArchiving = bool.Parse(split[3]);
+
+ if (useArchiving)
+ s = Compressing.Decompress(Encryptor.DecryptString(encryptString, db, iterations, numberOfEncryptionProcedures));
+
+
+ db.ViewModel.UseCompression = useArchiving;
+ }
+ else
+ {
+ s = Encryptor.DecryptString(encryptString, db, iterations, numberOfEncryptionProcedures);
+ db.ViewModel.UseCompression = false;
+ }
+
+ if (split.Length > 4)
+ db.ViewModel.UseTrash = bool.Parse(split[4]);
+
+ return (Database)new XmlSerializer(typeof(Database)).Deserialize(new StringReader(s));
+ }
public static void SaveFiles(DatabaseControl db)
{
+ string file = db.ViewModel.Iterations + ":" + db.ViewModel.NumberOfEncryptionProcedures + ":";
+
using StringWriter writer = new StringWriter();
new XmlSerializer(typeof(Database)).Serialize(writer, db.ViewModel.Database);
- File.WriteAllText(db.ViewModel.PathDatabase, Encryptor.EncryptString(writer.ToString(), db));
+ string s = Encryptor.EncryptString(db.ViewModel.UseCompression ? Compressing.Compress(writer.ToString()) : writer.ToString(), db);
+
+ file += s + ":" + db.ViewModel.UseCompression + ":" + db.ViewModel.UseTrash;
+
+ File.WriteAllText(db.ViewModel.PathDatabase, file);
}
}
}
diff --git a/Core/SaveAndLoadSettings.cs b/Core/SaveAndLoadSettings.cs
index 52c6857..222c24a 100644
--- a/Core/SaveAndLoadSettings.cs
+++ b/Core/SaveAndLoadSettings.cs
@@ -1,6 +1,7 @@
using OlibKey.Structures;
using System;
using System.IO;
+using System.Security.Permissions;
using System.Xml.Serialization;
namespace OlibKey.Core
@@ -18,11 +19,10 @@ public static Settings LoadSettings()
return new Settings();
}
}
-
public static void SaveSettings()
{
using StringWriter writer = new StringWriter();
- new XmlSerializer(typeof(Settings)).Serialize(writer, App.Settings);
+ new XmlSerializer(typeof(Settings)).Serialize(writer, Program.Settings);
File.WriteAllText(AppDomain.CurrentDomain.BaseDirectory + "settings.xml", writer.ToString());
}
diff --git a/ForRepository/ScreenProgram.png b/ForRepository/ScreenProgram.png
index 4c8f177..c68cbab 100644
Binary files a/ForRepository/ScreenProgram.png and b/ForRepository/ScreenProgram.png differ
diff --git a/ForRepository/screenshot1.png b/ForRepository/screenshot1.png
new file mode 100644
index 0000000..9f0c5d0
Binary files /dev/null and b/ForRepository/screenshot1.png differ
diff --git a/MainWindow.axaml b/MainWindow.axaml
index 192c366..e7bde9e 100644
--- a/MainWindow.axaml
+++ b/MainWindow.axaml
@@ -10,7 +10,7 @@
Title="OlibKey"
WindowStartupLocation="CenterScreen"
Icon="avares://OlibKey/app.ico"
- DragDrop.AllowDrop="{Binding IsActivateDnD}"
+ DragDrop.AllowDrop="True"
Background="{DynamicResource ThemeWindowBackgroundBrush}"
MinWidth="500" MinHeight="350">
@@ -25,6 +25,8 @@
+
+
@@ -42,6 +44,7 @@
+
@@ -52,7 +55,8 @@
-
+
+
@@ -69,7 +73,11 @@
diff --git a/Views/Controls/CustomFolderListItem.axaml.cs b/Views/Controls/FolderListItem.axaml.cs
similarity index 64%
rename from Views/Controls/CustomFolderListItem.axaml.cs
rename to Views/Controls/FolderListItem.axaml.cs
index 4ccf1a1..e7040f1 100644
--- a/Views/Controls/CustomFolderListItem.axaml.cs
+++ b/Views/Controls/FolderListItem.axaml.cs
@@ -1,4 +1,5 @@
-using Avalonia.Controls;
+using Avalonia;
+using Avalonia.Controls;
using Avalonia.Input;
using Avalonia.Markup.Xaml;
using OlibKey.Structures;
@@ -10,9 +11,22 @@ public class FolderListItem : UserControl
{
public TextBox _tbName;
private TextBlock _textName;
+ private TextBlock _tbDeleteDate;
+ public CheckBox SelectedItem;
public Folder FolderContext => DataContext as Folder;
public FolderListItem() => InitializeComponent();
+ public FolderListItem(Folder f)
+ {
+ InitializeComponent();
+ DataContext = f;
+
+ if (!string.IsNullOrEmpty(FolderContext.DeleteDate))
+ {
+ _tbDeleteDate.IsVisible = true;
+ _tbDeleteDate.Text = $"{(string)Application.Current.FindResource("Removed")} {FolderContext.DeleteDate}";
+ }
+ }
private void InitializeComponent()
{
@@ -20,6 +34,8 @@ private void InitializeComponent()
_tbName = this.FindControl("tbName");
_textName = this.FindControl("textName");
+ SelectedItem = this.FindControl("selectedItem");
+ _tbDeleteDate = this.FindControl("tbDeleteDate");
_tbName.Focus();
_tbName.LostFocus += (s, e) => { _tbName.IsVisible = false; FolderContext.Name = _tbName.Text; _textName.Text = FolderContext.Name; };
diff --git a/Views/Controls/LoginListItem.axaml b/Views/Controls/LoginListItem.axaml
index 28fdac7..9762a0d 100644
--- a/Views/Controls/LoginListItem.axaml
+++ b/Views/Controls/LoginListItem.axaml
@@ -8,19 +8,20 @@
Background="Transparent"
Height="40"
x:Class="OlibKey.Views.Controls.LoginListItem">
-
-
-
-
-
-
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Views/Controls/LoginListItem.axaml.cs b/Views/Controls/LoginListItem.axaml.cs
index e70ce74..44ebb9f 100644
--- a/Views/Controls/LoginListItem.axaml.cs
+++ b/Views/Controls/LoginListItem.axaml.cs
@@ -6,14 +6,18 @@
using OlibKey.Structures;
using OlibKey.Views.Windows;
using System;
+using Avalonia.Controls.Primitives;
namespace OlibKey.Views.Controls
{
public class LoginListItem : UserControl
{
public Image IconLogin;
+ public CheckBox SelectedItem;
+ public ToggleButton IsFavorite;
private readonly TextBlock _tbLoginName;
private readonly TextBlock _tbUsername;
+ private TextBlock _tbDeleteDate;
public string LoginID { get; set; }
@@ -30,6 +34,9 @@ public LoginListItem(Login Login)
IconLogin = this.FindControl("imageIconWebSite");
_tbLoginName = this.FindControl("tbLoginName");
_tbUsername = this.FindControl("tbUsername");
+ SelectedItem = this.FindControl("selectedItem");
+ IsFavorite = this.FindControl("isFavorite");
+ _tbDeleteDate = this.FindControl("tbDeleteDate");
LoginItem = Login;
@@ -49,22 +56,42 @@ public LoginListItem(Login Login)
break;
}
- if (LoginItem.Type == 0 && string.IsNullOrEmpty(Login.Username)) _tbUsername.Text = Login.Email;
+ _tbUsername.Text = LoginItem.Type switch
+ {
+ 0 when string.IsNullOrEmpty(Login.Username) => Login.Email,
+ 4 => LoginItem.TimeCreate,
+ _ => _tbUsername.Text
+ };
+
+ if (!string.IsNullOrEmpty(LoginItem.DeleteDate))
+ {
+ _tbDeleteDate.IsVisible = true;
+ _tbDeleteDate.Text = $"{(string)Application.Current.FindResource("Removed")} {LoginItem.DeleteDate}";
+ Height = 60;
+ }
+
+ IsFavorite.IsChecked = LoginItem.Favorite;
+
+ IsFavorite.Checked += IsFavoriteChecking;
+ IsFavorite.Unchecked += IsFavoriteChecking;
- if (LoginItem.Type == 4) _tbUsername.Text = LoginItem.TimeCreate;
}
- private void InitializeComponent() => AvaloniaXamlLoader.Load(this);
+ private void IsFavoriteChecking(object sender, Avalonia.Interactivity.RoutedEventArgs e) => LoginItem.Favorite = ((ToggleButton)sender).IsChecked ?? false;
+
+ private void InitializeComponent() => AvaloniaXamlLoader.Load(this);
public void EditedLogin()
{
if (LoginItem == null) return;
_tbLoginName.Text = LoginItem.Name;
- _tbUsername.Text = LoginItem.Username;
-
- if (LoginItem.Type == 0 && string.IsNullOrEmpty(LoginItem.Username)) _tbUsername.Text = LoginItem.Email;
- if (LoginItem.Type == 4) _tbUsername.Text = LoginItem.TimeCreate;
+ _tbUsername.Text = LoginItem.Type switch
+ {
+ 0 when string.IsNullOrEmpty(LoginItem.Username) => LoginItem.Email,
+ 4 => LoginItem.TimeCreate,
+ _ => LoginItem.Username
+ };
}
public async void GetIconElement()
diff --git a/Views/Pages/CreateLoginPage.axaml b/Views/Pages/CreateLoginPage.axaml
index ccd2f37..cd91504 100644
--- a/Views/Pages/CreateLoginPage.axaml
+++ b/Views/Pages/CreateLoginPage.axaml
@@ -6,12 +6,7 @@
xmlns:c="clr-namespace:OlibKey.Core;assembly=OlibKey"
Background="{DynamicResource ThemeWindowBackgroundBrush}"
x:Class="OlibKey.Views.Pages.CreateLoginPage">
-
-
-
-
-
-
+
@@ -188,7 +183,7 @@
-
+
@@ -196,8 +191,8 @@
-
-
+
+
diff --git a/Views/Pages/CreateLoginPage.axaml.cs b/Views/Pages/CreateLoginPage.axaml.cs
index 535d2b0..5aa24f0 100644
--- a/Views/Pages/CreateLoginPage.axaml.cs
+++ b/Views/Pages/CreateLoginPage.axaml.cs
@@ -85,16 +85,16 @@ private void SectionChanged(object sender, SelectionChangedEventArgs e)
}
}
- private void CheckedPassword(object sender, RoutedEventArgs e) => _txtPassword.PasswordChar = ((CheckBox)sender).IsChecked == true ? '\0' : '•';
+ private void CheckedPassword(object sender, RoutedEventArgs e) => _txtPassword.PasswordChar = ((CheckBox)sender).IsChecked ?? false ? '\0' : '•';
- private void CheckedSecurityCode(object sender, RoutedEventArgs e) => _txtSecurityCode.PasswordChar = ((CheckBox)sender).IsChecked == true ? '\0' : '•';
+ private void CheckedSecurityCode(object sender, RoutedEventArgs e) => _txtSecurityCode.PasswordChar = ((CheckBox)sender).IsChecked ?? false ? '\0' : '•';
private void TimeZeroing(object sender, RoutedEventArgs e) => _txtStartTime.Text = DateTime.Now.ToString(CultureInfo.CurrentCulture);
private async void GeneratePassword(object sender, RoutedEventArgs e)
{
- PasswordGeneratorWindow a = new PasswordGeneratorWindow { _saveButton = { IsVisible = true } };
- if (await a.ShowDialog(App.MainWindow)) _txtPassword.Text = a._tbPassword.Text;
+ App.MainWindowViewModel.PasswordGenerator = new PasswordGeneratorWindow { _saveButton = { IsVisible = true } };
+ if (await App.MainWindowViewModel.PasswordGenerator.ShowDialog(App.MainWindow)) _txtPassword.Text = App.MainWindowViewModel.PasswordGenerator._tbPassword.Text;
}
}
}
diff --git a/Views/Pages/EditLoginPage.axaml b/Views/Pages/EditLoginPage.axaml
index 2cb35c9..acc6549 100644
--- a/Views/Pages/EditLoginPage.axaml
+++ b/Views/Pages/EditLoginPage.axaml
@@ -5,12 +5,7 @@
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
Background="{DynamicResource ThemeWindowBackgroundBrush}"
x:Class="OlibKey.Views.Pages.EditLoginPage">
-
-
-
-
-
-
+
@@ -175,7 +170,7 @@
-
+
@@ -184,10 +179,10 @@
-
-
+
+
-
+
diff --git a/Views/Pages/EditLoginPage.axaml.cs b/Views/Pages/EditLoginPage.axaml.cs
index 3cc5132..e643ecd 100644
--- a/Views/Pages/EditLoginPage.axaml.cs
+++ b/Views/Pages/EditLoginPage.axaml.cs
@@ -33,14 +33,14 @@ private void InitializeComponent()
_txtPassword.GetObservable(TextBox.TextProperty).Subscribe(value => PasswordUtils.DeterminingPasswordComplexity(_pbHard, _txtPassword));
}
- private void CheckedPassword(object sender, RoutedEventArgs e) => _txtPassword.PasswordChar = ((CheckBox)sender).IsChecked == true ? '\0' : '•';
+ private void CheckedPassword(object sender, RoutedEventArgs e) => _txtPassword.PasswordChar = ((CheckBox)sender).IsChecked ?? false ? '\0' : '•';
- private void CheckedSecurityCode(object sender, RoutedEventArgs e) => _txtSecurityCode.PasswordChar = ((CheckBox)sender).IsChecked == true ? '\0' : '•';
+ private void CheckedSecurityCode(object sender, RoutedEventArgs e) => _txtSecurityCode.PasswordChar = ((CheckBox)sender).IsChecked ?? false ? '\0' : '•';
private async void GeneratePassword(object sender, RoutedEventArgs e)
{
- PasswordGeneratorWindow a = new PasswordGeneratorWindow { _saveButton = { IsVisible = true } };
- if (await a.ShowDialog(App.MainWindow)) _txtPassword.Text = a._tbPassword.Text;
+ App.MainWindowViewModel.PasswordGenerator = new PasswordGeneratorWindow { _saveButton = { IsVisible = true } };
+ if (await App.MainWindowViewModel.PasswordGenerator.ShowDialog(App.MainWindow)) _txtPassword.Text = App.MainWindowViewModel.PasswordGenerator._tbPassword.Text;
}
}
}
diff --git a/Views/Pages/LoginInformationPage.axaml b/Views/Pages/LoginInformationPage.axaml
index a937fd0..df89f42 100644
--- a/Views/Pages/LoginInformationPage.axaml
+++ b/Views/Pages/LoginInformationPage.axaml
@@ -10,12 +10,7 @@
-
-
-
-
-
-
+
@@ -28,20 +23,20 @@
-
+
-
+
-
+
@@ -54,7 +49,7 @@
-
+
@@ -62,7 +57,7 @@
-
+
@@ -74,19 +69,19 @@
-
+
-
+
-
+
@@ -96,79 +91,79 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -192,11 +187,9 @@
-
-
-
-
-
+
+
+
@@ -211,9 +204,7 @@
-
-
-
+
\ No newline at end of file
diff --git a/Views/Pages/LoginInformationPage.axaml.cs b/Views/Pages/LoginInformationPage.axaml.cs
index 4b2ae27..56392f9 100644
--- a/Views/Pages/LoginInformationPage.axaml.cs
+++ b/Views/Pages/LoginInformationPage.axaml.cs
@@ -32,8 +32,8 @@ private void InitializeComponent()
PasswordUtils.DeterminingPasswordComplexity(_pbHard, _txtPassword));
}
- private void CheckedPassword(object sender, RoutedEventArgs e) => _txtPassword.PasswordChar = ((CheckBox)sender).IsChecked == true ? '\0' : '•';
+ private void CheckedPassword(object sender, RoutedEventArgs e) => _txtPassword.PasswordChar = ((CheckBox)sender).IsChecked ?? false ? '\0' : '•';
- private void CheckedSecurityCode(object sender, RoutedEventArgs e) => _txtSecurityCode.PasswordChar = ((CheckBox)sender).IsChecked == true ? '\0' : '•';
+ private void CheckedSecurityCode(object sender, RoutedEventArgs e) => _txtSecurityCode.PasswordChar = ((CheckBox)sender).IsChecked ?? false ? '\0' : '•';
}
}
\ No newline at end of file
diff --git a/Views/Windows/AboutWindow.axaml b/Views/Windows/AboutWindow.axaml
index 3e454f4..d777504 100644
--- a/Views/Windows/AboutWindow.axaml
+++ b/Views/Windows/AboutWindow.axaml
@@ -4,7 +4,9 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="450" d:DesignHeight="400"
x:Class="OlibKey.Views.Windows.AboutWindow"
- WindowStartupLocation="CenterScreen"
+ WindowStartupLocation="CenterOwner"
+ WindowState="Normal"
+ ShowInTaskbar="False"
Icon="avares://OlibKey/app.ico"
Background="{StaticResource ThemeWindowBackgroundBrush}"
Title="{StaticResource AboutPrograms}" Height="400" Width="450" CanResize="False">
@@ -14,7 +16,7 @@
-
+
diff --git a/Views/Windows/AboutWindow.axaml.cs b/Views/Windows/AboutWindow.axaml.cs
index 806b16a..b56c9a4 100644
--- a/Views/Windows/AboutWindow.axaml.cs
+++ b/Views/Windows/AboutWindow.axaml.cs
@@ -3,59 +3,37 @@
using Avalonia.Markup.Xaml;
using System;
using System.Diagnostics;
+using System.Reflection;
using System.Runtime.InteropServices;
namespace OlibKey.Views.Windows
{
public class AboutWindow : Window
{
- private TextBox _tbInformation;
- private Button _bClose;
- private Button _bGitHub;
- private Button _bVK;
- private Button _bFacebook;
-
public AboutWindow() => InitializeComponent();
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
- _tbInformation = this.FindControl("tbInformation");
- _bClose = this.FindControl