Skip to content

Commit

Permalink
Merge pull request #6 from HakuSystems/Indevelopment
Browse files Browse the repository at this point in the history
2.0.6.2
  • Loading branch information
HakuSystems authored Sep 15, 2024
2 parents eac5d78 + bc1cbf9 commit 4744438
Show file tree
Hide file tree
Showing 38 changed files with 1,522 additions and 693 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ public class ConfigModel
{
public string AppTitle { get; set; } = "EasyExtractUnitypackage";
public ApplicationTheme ApplicationTheme { get; set; } = ApplicationTheme.Dark;
public bool EasterEggHeader { get; set; } = true;
public bool UwUModeActive { get; set; } = false;
public bool ContextMenuToggle { get; set; } = true;
public bool IntroLogoAnimation { get; set; } = false;
public RunsModel Runs { get; set; } = new();
public bool DiscordRpc { get; set; } = true;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows.Media;
using Wpf.Ui.Controls;

namespace EasyExtract.Config;

public class ExtractedUnitypackageModel : INotifyPropertyChanged
{
private int base64DetectionCount;
private InfoBarSeverity detailsSeverity = InfoBarSeverity.Informational;

private int linkDetectionCount;
private int malicousDiscordWebhookCount;

private bool packageIsChecked;
private List<ExtractedFiles> subdirectoryItems = new();
private string unitypackageDetails = "No Details Available";
Expand Down Expand Up @@ -35,12 +41,35 @@ public class ExtractedUnitypackageModel : INotifyPropertyChanged
private int unitypackageTotalScriptCount;
private int unitypackageTotalShaderCount;

private string linkDetectionCountMessage =>
LinkDetectionCount > 0
? $"Possible Link(s) Detected: {LinkDetectionCount}"
: "No Links Detected";

private string malicousDiscordWebhookCountMessage =>
MalicousDiscordWebhookCount > 0
? $"Possible Malicious Discord Webhook(s): {MalicousDiscordWebhookCount}"
: "No Malicious Discord Webhooks Found";


private string unitypackageTotalFileCountMessage =>
$"Total Files: {UnitypackageTotalFileCount:N2} / Package Size: {UnitypackageSize}";

public string LinkDetectionCountMessage => linkDetectionCountMessage;
public string MalicousDiscordWebhookCountMessage => malicousDiscordWebhookCountMessage;

public string UnitypackageTotalFileCountMessage => unitypackageTotalFileCountMessage;


public SolidColorBrush GetCurrentLinkDetectionColor => LinkDetectionCount > 0
? new SolidColorBrush(Colors.Red)
: new SolidColorBrush(Colors.Green);

public SolidColorBrush GetCurrentMalicousDiscordWebhookColor => MalicousDiscordWebhookCount > 0
? new SolidColorBrush(Colors.Red)
: new SolidColorBrush(Colors.Green);


public bool PackageIsChecked
{
get => packageIsChecked;
Expand Down Expand Up @@ -71,6 +100,26 @@ public InfoBarSeverity DetailsSeverity
}
}

public int MalicousDiscordWebhookCount
{
get => malicousDiscordWebhookCount;
set
{
malicousDiscordWebhookCount = value;
OnPropertyChanged();
}
}

public int LinkDetectionCount
{
get => linkDetectionCount;
set
{
linkDetectionCount = value;
OnPropertyChanged();
}
}

public int UnitypackageTotalFileCount
{
get => unitypackageTotalFileCount;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<Application x:Class="EasyExtract.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
xmlns:customDesign="clr-namespace:EasyExtract.CustomDesign"
Startup="App_OnStartup"
StartupUri="MainWindow.xaml">
<Application
x:Class="EasyExtract.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:customDesign="clr-namespace:EasyExtract.CustomDesign"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
Startup="App_OnStartup"
StartupUri="/UI/Initial/MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace EasyExtract;
/// </summary>
public partial class App : Application
{
private readonly ConfigHelper _configHelper = new();
private readonly BetterLogger _logger = new();

private async void Application_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
Expand All @@ -31,8 +32,17 @@ private void App_OnStartup(object sender, StartupEventArgs e)
DispatcherUnhandledException += Application_DispatcherUnhandledException;
Exit += App_OnExit;

// Run the program logic directly
var program = new Program();
program.Run(e.Args);
if (_configHelper.Config.ContextMenuToggle)
{
// Run the program logic directly
var program = new Program();
program.Run(e.Args);
}
else
{
var program = new Program();
program.DeleteContextMenu();
InitializeComponent();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace EasyExtract;

public class Program
{
private readonly ConfigHelper _configHelper = new();
private readonly BetterLogger _logger = new();

public async void Run(string[] args)
Expand All @@ -20,7 +21,8 @@ public async void Run(string[] args)
await _logger.LogAsync($"Run method invoked with arguments: {string.Join(", ", args)}", "Program.cs",
Importance.Info);

if (!Debugger.IsAttached) // Only check for admin rights if not debugging
if (!Debugger.IsAttached && _configHelper.Config.ContextMenuToggle)
// Only check for admin rights if not debugging and ContextMenuToggle is active
if (!IsRunningAsAdmin() && !args.Contains("--elevated"))
{
KillAllProcesses(Assembly.GetExecutingAssembly().GetName().Name);
Expand All @@ -44,7 +46,8 @@ await _logger.LogAsync($"Run method invoked with arguments: {string.Join(", ", a
}

DeleteContextMenu();
RegisterContextMenu();
if (_configHelper.Config.ContextMenuToggle) RegisterContextMenu();

var app = new App();
app.InitializeComponent();
app.Run();
Expand All @@ -59,9 +62,10 @@ await _logger.LogAsync($"Run method invoked with arguments: {string.Join(", ", a
}
}

private async void DeleteContextMenu()
public async void DeleteContextMenu()
{
const string contextMenuPath = @"*\shell\ExtractWithEasyExtract";
if (Registry.ClassesRoot.OpenSubKey(contextMenuPath) == null) return;

try
{
Expand Down
160 changes: 0 additions & 160 deletions EasyExtractUnitypackageRework/EasyExtract/Dashboard.xaml

This file was deleted.

Loading

0 comments on commit 4744438

Please sign in to comment.