Skip to content

Commit

Permalink
PUSH
Browse files Browse the repository at this point in the history
-> Added logs for PATH / CACHE
-> Browser has its own files in appdata
-> App can only run once
-> Soon (Injections)
  • Loading branch information
NaysKutzu committed Sep 26, 2024
1 parent 76c1719 commit 41b8d8b
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 30 deletions.
14 changes: 0 additions & 14 deletions FrmMain.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 19 additions & 12 deletions FrmMain.cs
Original file line number Diff line number Diff line change
@@ -1,28 +1,35 @@
using System;
using CefSharp.WinForms;
using CefSharp;
using System;
using System.Windows.Forms;
using System.IO;

namespace PhpMyAdmin
{
public partial class FrmMain : Form
{
private ChromiumWebBrowser chromiumWebBrowser1;
public FrmMain()
{
InitializeComponent();
}
InitializeChromium();

private void Form1_Load(object sender, EventArgs e)
{
this.chromiumWebBrowser1.LoadUrl("https://pma.mythicalsystems.xyz");
}

private void lblclose_Click(object sender, EventArgs e)
{
Application.Exit();
}

private void lblminimize_Click(object sender, EventArgs e)
private void InitializeChromium()
{
this.WindowState = FormWindowState.Minimized;
var settings = new CefSettings();
settings.UserAgent = "PhpMyAdmin Desktop";
settings.IgnoreCertificateErrors = true;
settings.CachePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "PhpMyAdmin Desktop");
settings.RootCachePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "PhpMyAdmin Desktop");
Console.WriteLine("Cache PATH: " + settings.CachePath);
Console.WriteLine("Root PATH: " + settings.RootCachePath);
Console.WriteLine("Browser PATH: " + settings.BrowserSubprocessPath);
Cef.Initialize(settings);
chromiumWebBrowser1 = new ChromiumWebBrowser("https://pma.mythicalsystems.xyz");
this.Controls.Add(chromiumWebBrowser1);
chromiumWebBrowser1.Dock = DockStyle.Fill;
}
}
}
7 changes: 6 additions & 1 deletion PhpMyAdmin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System">
<HintPath>..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.dll</HintPath>
</Reference>
<Reference Include="System.AppContext, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>packages\System.AppContext.4.3.0\lib\net463\System.AppContext.dll</HintPath>
<Private>True</Private>
Expand Down Expand Up @@ -296,6 +298,9 @@
</ItemGroup>
<ItemGroup>
<Content Include="favicon.ico" />
<Content Include="inject.js">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.8">
Expand Down
20 changes: 17 additions & 3 deletions Program.cs
Original file line number Diff line number Diff line change
@@ -1,22 +1,36 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace PhpMyAdmin
{
internal static class Program
{

/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new FrmMain());
bool createdNew;
using (Mutex mutex = new Mutex(true, "PhpMyAdmin Desktop", out createdNew))
{
if (!createdNew)
{
// An instance is already running
MessageBox.Show("The application is already running.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return; // Exit the application
}

// Run the application if this is the first instance
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new FrmMain());
}
}
}
}
Binary file modified SetupISS/PhpMyAdmin Desktop.exe
Binary file not shown.
1 change: 1 addition & 0 deletions inject.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alert("Test");

0 comments on commit 41b8d8b

Please sign in to comment.