diff --git a/Release_Tool/Program.cs b/Release_Tool/Program.cs deleted file mode 100644 index e4c4e70..0000000 --- a/Release_Tool/Program.cs +++ /dev/null @@ -1,134 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.IO.Compression; - -namespace Release_Tool -{ - internal class Program - { - static List files = new List(); - public static string globalTimestamp = null; - public static string releaseFolder = "debug_release"; - public static string releaseFileName = "currentRelease"; - public static string fileending = ".zip"; - public static string destFolder = null; - public static bool success = true; - public static bool Contains(string source, string toCheck, StringComparison comp) - { - return source?.IndexOf(toCheck, comp) >= 0; - } - public static void Main(string[] args) - { - var lines = File.ReadAllLines(".\\WeeXnes\\Core\\Globals.cs"); - string versionLine = ""; - foreach (var line in lines) - { - if (Contains(line, "public static string version", StringComparison.OrdinalIgnoreCase)) - { - versionLine = line; - } - } - Console.WriteLine(versionLine); - string versionnr = - versionLine.Substring(versionLine.IndexOf("\""), versionLine.Length - versionLine.IndexOf("\"")); - versionnr = versionnr.Substring(1, versionnr.Length - 1); - versionnr = versionnr.Substring(0, versionnr.IndexOf("\"")); - string VersionNumber = versionnr; - releaseFileName = releaseFileName + "_" + versionnr + fileending; - Console.WriteLine("Packing " + releaseFileName); - Console.Title = "WeeXnes Automated Release Tool"; - SetTimestamp(); - SetPaths(); - Console.WriteLine("Folder -> " + globalTimestamp); - CheckDirectories(); - GetFiles(); - PackFiles(); - if (!success) - { - Console.WriteLine("Something went wrong"); - Console.ReadLine(); - } - else - { - PackIntoZip(); - Console.WriteLine("Build succeeded | " + globalTimestamp); - Console.ReadLine(); - } - } - - private static void PackIntoZip() - { - try - { - if(File.Exists(Path.Combine(releaseFolder, releaseFileName))) - { - File.Delete(Path.Combine(releaseFolder, "currentRelease.zip")); - ZipFile.CreateFromDirectory(destFolder, Path.Combine(releaseFolder, releaseFileName)); - } - else - { - ZipFile.CreateFromDirectory(destFolder, Path.Combine(releaseFolder, releaseFileName)); - } - - }catch (Exception ex) - { - Console.WriteLine(ex); - Console.ReadLine(); - } - } - - private static void SetPaths() - { - destFolder = Path.Combine(releaseFolder, globalTimestamp); - } - - private static void CheckDirectories() - { - if (!Directory.Exists(releaseFolder)) - { - Directory.CreateDirectory(releaseFolder); - } - if(!Directory.Exists(destFolder)) - { - Directory.CreateDirectory(destFolder); - } - } - - private static void SetTimestamp() - { - string date = DateTime.Now.ToString("dd.MM.yyyy"); - string time = DateTime.Now.ToString("HH.mm.ss"); - string timestamp = date + " - " + time; - globalTimestamp = timestamp; - } - - private static void PackFiles() - { - foreach(file fileobj in files) - { - try - { - File.Copy(fileobj.path, Path.Combine(destFolder, fileobj.newfilename)); - Console.WriteLine("Copied " + fileobj.path); - } - catch (Exception ex) - { - Console.WriteLine("Coudnt find " + fileobj.path + "| ->" + ex.GetType()); - success = false; - } - } - } - - private static void GetFiles() - { - files.Add(new file(@"WeeXnes\bin\Release\WeeXnes.exe", "WeeXnes.exe")); - files.Add(new file(@"WeeXnes_UAC\bin\Release\WeeXnes_UAC.exe", "WeeXnes_UAC.exe")); - files.Add(new file(@"WeeXnes\bin\Release\DiscordRPC.dll", "DiscordRPC.dll")); - files.Add(new file(@"WeeXnes\bin\Release\Newtonsoft.Json.dll", "Newtonsoft.Json.dll")); - files.Add(new file(@"Autostart\bin\Release\Autostart.exe", "Autostart.exe")); - files.Add(new file(@"Update\bin\Release\Update.exe", "Update.exe")); - - } - } -} \ No newline at end of file diff --git a/Release_Tool/Properties/AssemblyInfo.cs b/Release_Tool/Properties/AssemblyInfo.cs deleted file mode 100644 index be20910..0000000 --- a/Release_Tool/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Release_Tool")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Release_Tool")] -[assembly: AssemblyCopyright("Copyright © 2022")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("4C09AD12-B48E-40ED-B418-CF868889E317")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/Release_Tool/Release_Tool.csproj b/Release_Tool/Release_Tool.csproj deleted file mode 100644 index 1bcae78..0000000 --- a/Release_Tool/Release_Tool.csproj +++ /dev/null @@ -1,60 +0,0 @@ - - - - - Debug - AnyCPU - {4C09AD12-B48E-40ED-B418-CF868889E317} - Exe - Properties - Release_Tool - Release_Tool - v4.8 - 512 - true - wicns.ico - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - diff --git a/Release_Tool/file.cs b/Release_Tool/file.cs deleted file mode 100644 index 6760032..0000000 --- a/Release_Tool/file.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace Release_Tool -{ - public class file - { - public string path { get; set; } - public string newfilename { get; set; } - public file(string _path, string _newfilename) - { - this.path = _path; - this.newfilename = _newfilename; - } - } -} \ No newline at end of file diff --git a/Release_Tool/wicns.ico b/Release_Tool/wicns.ico deleted file mode 100644 index b575d2d..0000000 Binary files a/Release_Tool/wicns.ico and /dev/null differ diff --git a/WeeXnes.sln b/WeeXnes.sln index ab20f29..7fe69c6 100644 --- a/WeeXnes.sln +++ b/WeeXnes.sln @@ -6,8 +6,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Autostart", "Autostart\Auto EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WeeXnes_UAC", "WeeXnes_UAC\WeeXnes_UAC.csproj", "{2DCC0DCD-7843-4719-9FDD-1786924CF941}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Release_Tool", "Release_Tool\Release_Tool.csproj", "{4C09AD12-B48E-40ED-B418-CF868889E317}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Update", "Update\Update.csproj", "{133FF515-D605-4856-BA2E-5841BF47EC2F}" EndProject Global @@ -28,10 +26,6 @@ Global {2DCC0DCD-7843-4719-9FDD-1786924CF941}.Debug|Any CPU.Build.0 = Debug|Any CPU {2DCC0DCD-7843-4719-9FDD-1786924CF941}.Release|Any CPU.ActiveCfg = Release|Any CPU {2DCC0DCD-7843-4719-9FDD-1786924CF941}.Release|Any CPU.Build.0 = Release|Any CPU - {4C09AD12-B48E-40ED-B418-CF868889E317}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4C09AD12-B48E-40ED-B418-CF868889E317}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4C09AD12-B48E-40ED-B418-CF868889E317}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4C09AD12-B48E-40ED-B418-CF868889E317}.Release|Any CPU.Build.0 = Release|Any CPU {133FF515-D605-4856-BA2E-5841BF47EC2F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {133FF515-D605-4856-BA2E-5841BF47EC2F}.Debug|Any CPU.Build.0 = Debug|Any CPU {133FF515-D605-4856-BA2E-5841BF47EC2F}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/WeeXnes/App.xaml.cs b/WeeXnes/App.xaml.cs index c6d66c6..1642c08 100644 --- a/WeeXnes/App.xaml.cs +++ b/WeeXnes/App.xaml.cs @@ -148,7 +148,7 @@ namespace WeeXnes ); newItem.Filename = file.Name; KeyManagerView.Data.KeyItemsList.Add(newItem); - WeeXnes.Core.CustomConsole.WriteLineVerbose(file.Name + " loaded"); + WeeXnes.Core.CustomConsole.WriteLine(file.Name + " loaded"); } catch (Exception ex) diff --git a/WeeXnes/Core/Global.cs b/WeeXnes/Core/Global.cs index f476e7b..721d24f 100644 --- a/WeeXnes/Core/Global.cs +++ b/WeeXnes/Core/Global.cs @@ -8,7 +8,7 @@ namespace WeeXnes.Core { public class Information { - public const string Version = "4.3.5"; + public const string Version = "4.4.0"; public const string EncryptionHash = "8zf5#RdyQ]$4x4_"; public const string ApiUrl = "https://api.github.com/repos/weexnes/weexnessuite/releases/latest"; } diff --git a/WeeXnes/MainWindow.xaml b/WeeXnes/MainWindow.xaml index feb6a95..b5f59c8 100644 --- a/WeeXnes/MainWindow.xaml +++ b/WeeXnes/MainWindow.xaml @@ -8,6 +8,7 @@ xmlns:keymanager="clr-namespace:WeeXnes.Views.KeyManager" xmlns:settings="clr-namespace:WeeXnes.Views.Settings" xmlns:discordrpc="clr-namespace:WeeXnes.Views.DiscordRPC" + xmlns:passwordGenerator="clr-namespace:WeeXnes.Views.PasswordGenerator" mc:Ignorable="d" Height="400" Width="500" @@ -68,11 +69,6 @@ PageTag="home" Name="ButtonHome" PageType="{x:Type home:HomeView}"/> - + + + + + + + diff --git a/WeeXnes/Views/PasswordGenerator/PasswordGenView.xaml.cs b/WeeXnes/Views/PasswordGenerator/PasswordGenView.xaml.cs new file mode 100644 index 0000000..4e248ca --- /dev/null +++ b/WeeXnes/Views/PasswordGenerator/PasswordGenView.xaml.cs @@ -0,0 +1,67 @@ +using System; +using System.Windows; +using System.Windows.Controls; +using WeeXnes.Core; + +namespace WeeXnes.Views.PasswordGenerator +{ + public partial class PasswordGenView : Page + { + public static Random random = new Random(); + private class PasswordBuilderStrings + { + public static string alphabetical_lc = "abcdefghijklmnopqrstuvwxyz"; + public static string alphabetical_caps = "ABCDEFGHIJKLMNOPQRSTUVQXYZ"; + public static string numerical = "1234567890"; + public static string special = "!#$%&()*+,-<>=?"; + } + public PasswordGenView() + { + InitializeComponent(); + } + + private void GeneratePasword() + { + if(toggle_alpha.IsChecked == false) + if(toggle_numeric.IsChecked == false) + if(toggle_special.IsChecked == false) + return; + + + string CustomPasswordBuilderString = ""; + + if (toggle_alpha.IsChecked == true) + CustomPasswordBuilderString += PasswordBuilderStrings.alphabetical_lc; + + if (toggle_caps.IsChecked == true) + CustomPasswordBuilderString += PasswordBuilderStrings.alphabetical_caps; + + if (toggle_numeric.IsChecked == true) + CustomPasswordBuilderString += PasswordBuilderStrings.numerical; + + if (toggle_special.IsChecked == true) + CustomPasswordBuilderString += PasswordBuilderStrings.special; + + + CustomConsole.WriteLine("Generating Password from: " + CustomPasswordBuilderString); + //MessageBox.Show(CustomPasswordBuilderString); + + string generatedPassword = ""; + + + for (int i = 0; i < numbox_pwCount.Value; i++) + { + int randomNr = random.Next(0, CustomPasswordBuilderString.Length); + generatedPassword = generatedPassword + CustomPasswordBuilderString[randomNr]; + } + + SavePasswordView.GeneratedPassword = generatedPassword; + NavigationService.Navigate(new Uri("/Views/PasswordGenerator/SavePasswordView.xaml",UriKind.Relative)); + } + + private void ButtonBase_OnClick(object sender, RoutedEventArgs e) + { + GeneratePasword(); + } + } +} \ No newline at end of file diff --git a/WeeXnes/Views/PasswordGenerator/SavePasswordView.xaml b/WeeXnes/Views/PasswordGenerator/SavePasswordView.xaml new file mode 100644 index 0000000..0301ebe --- /dev/null +++ b/WeeXnes/Views/PasswordGenerator/SavePasswordView.xaml @@ -0,0 +1,20 @@ + + + + + + diff --git a/WeeXnes/Views/PasswordGenerator/SavePasswordView.xaml.cs b/WeeXnes/Views/PasswordGenerator/SavePasswordView.xaml.cs new file mode 100644 index 0000000..4b5ba21 --- /dev/null +++ b/WeeXnes/Views/PasswordGenerator/SavePasswordView.xaml.cs @@ -0,0 +1,33 @@ +using System; +using System.Windows; +using System.Windows.Controls; + +namespace WeeXnes.Views.PasswordGenerator +{ + public partial class SavePasswordView : Page + { + public static string GeneratedPassword = ""; + public SavePasswordView() + { + InitializeComponent(); + } + + private void SavePasswordView_OnLoaded(object sender, RoutedEventArgs e) + { + displayPassword.Content = GeneratedPassword; + } + + private void CloseDialog(object sender, RoutedEventArgs e) + { + NavigationService.Navigate(new Uri("/Views/PasswordGenerator/PasswordGenView.xaml",UriKind.Relative)); + } + private void CopyToClipboard(object sender, RoutedEventArgs e) + { + Clipboard.SetText(GeneratedPassword); + } + private void SaveToKeyManager(object sender, RoutedEventArgs e) + { + NavigationService.Navigate(new Uri("/Views/PasswordGenerator/SaveToKeyManagerView.xaml",UriKind.Relative)); + } + } +} \ No newline at end of file diff --git a/WeeXnes/Views/PasswordGenerator/SaveToKeyManagerView.xaml b/WeeXnes/Views/PasswordGenerator/SaveToKeyManagerView.xaml new file mode 100644 index 0000000..c69f971 --- /dev/null +++ b/WeeXnes/Views/PasswordGenerator/SaveToKeyManagerView.xaml @@ -0,0 +1,17 @@ + + + + + + diff --git a/WeeXnes/Views/PasswordGenerator/SaveToKeyManagerView.xaml.cs b/WeeXnes/Views/PasswordGenerator/SaveToKeyManagerView.xaml.cs new file mode 100644 index 0000000..c107b3c --- /dev/null +++ b/WeeXnes/Views/PasswordGenerator/SaveToKeyManagerView.xaml.cs @@ -0,0 +1,35 @@ +using System; +using System.Windows; +using System.Windows.Controls; +using WeeXnes.Core; +using WeeXnes.Views.KeyManager; + +namespace WeeXnes.Views.PasswordGenerator +{ + public partial class SaveToKeyManagerView : Page + { + public SaveToKeyManagerView() + { + InitializeComponent(); + } + private void SavePassword(object sender, RoutedEventArgs e) + { + try + { + KeyItem newKey = new KeyItem( + tb_keyname.Text, + SavePasswordView.GeneratedPassword + ); + WXFile wxFile = new WXFile( + Global.AppDataPathKEY.Value + "\\" + newKey.Filename); + WXFile.Methods.WriteFile(newKey, wxFile); + KeyManagerView.Data.KeyItemsList.Add(newKey); + } + catch (Exception ex) + { + Console.WriteLine(ex.Message); + } + NavigationService.Navigate(new Uri("/Views/PasswordGenerator/PasswordGenView.xaml",UriKind.Relative)); + } + } +} \ No newline at end of file diff --git a/WeeXnes/WeeXnes.csproj b/WeeXnes/WeeXnes.csproj index e719ef6..7fc099b 100644 --- a/WeeXnes/WeeXnes.csproj +++ b/WeeXnes/WeeXnes.csproj @@ -4,7 +4,7 @@ Debug AnyCPU - 4.3.5 + 4.4.0 {4B33CEE7-C74D-43B9-B99A-8B273D5195BC} WinExe WeeXnes @@ -94,6 +94,15 @@ KeyManagerView.xaml + + PasswordGenView.xaml + + + SavePasswordView.xaml + + + SaveToKeyManagerView.xaml + ChangePathsView.xaml @@ -129,6 +138,9 @@ + + +