-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
72 changed files
with
8,667 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//DON'T USE THIS, onefile causes the file to be considered a trojan by some anti-viruses. | ||
pyinstaller task_manager.py --onefile | ||
|
||
pyinstaller task_manager.py | ||
pyinstaller get_process_icon.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import base64 | ||
from io import BytesIO | ||
import win32ui | ||
import win32gui | ||
import win32con | ||
import win32api | ||
from PIL import Image | ||
from sys import argv | ||
import socketio | ||
import eventlet | ||
|
||
sio = socketio.Server() | ||
app = socketio.WSGIApp(sio) | ||
|
||
|
||
@sio.on('get_process_icon') | ||
def get_process_icon(sid, data): | ||
try: | ||
ico_x = win32api.GetSystemMetrics(win32con.SM_CXICON) | ||
ico_y = win32api.GetSystemMetrics(win32con.SM_CYICON) | ||
try: | ||
large, small = win32gui.ExtractIconEx(data, 0) | ||
except: | ||
pass | ||
if len(large) == 0 or len(small) == 0: | ||
pass | ||
win32gui.DestroyIcon(small[0]) | ||
hdc = win32ui.CreateDCFromHandle(win32gui.GetDC(0)) | ||
hbmp = win32ui.CreateBitmap() | ||
hbmp.CreateCompatibleBitmap(hdc, ico_x, ico_x) | ||
hdc = hdc.CreateCompatibleDC() | ||
hdc.SelectObject(hbmp) | ||
hdc.DrawIcon((0, 0), large[0]) | ||
bmpstr = hbmp.GetBitmapBits(True) | ||
icon = Image.frombuffer( | ||
'RGBA', | ||
(ico_x, ico_y), | ||
bmpstr, 'raw', 'BGRA', 0, 1 | ||
) | ||
if (ico_x > 49): | ||
icon = icon.resize((50, 50)) | ||
icon = icon.resize((50, 50)) | ||
buffered = BytesIO() | ||
icon.save(buffered, format="PNG") | ||
a = buffered.getvalue() | ||
img_str = base64.b64encode(buffered.getvalue()) | ||
img_str = img_str.decode("utf-8") | ||
sio.emit('process_icon', {"process": data, "icon": img_str}) | ||
except Exception as c: | ||
sio.emit('process_icon', {"process": data, "icon": None}) | ||
|
||
|
||
if __name__ == '__main__': | ||
# Run the SocketIO server using eventlet | ||
eventlet.wsgi.server(eventlet.listen(('0.0.0.0', 6511)), app) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
############################################################################### | ||
# Set default behavior to automatically normalize line endings. | ||
############################################################################### | ||
* text=auto | ||
|
||
############################################################################### | ||
# Set default behavior for command prompt diff. | ||
# | ||
# This is need for earlier builds of msysgit that does not have it on by | ||
# default for csharp files. | ||
# Note: This is only used by command line | ||
############################################################################### | ||
#*.cs diff=csharp | ||
|
||
############################################################################### | ||
# Set the merge driver for project and solution files | ||
# | ||
# Merging from the command prompt will add diff markers to the files if there | ||
# are conflicts (Merging from VS is not affected by the settings below, in VS | ||
# the diff markers are never inserted). Diff markers may cause the following | ||
# file extensions to fail to load in VS. An alternative would be to treat | ||
# these files as binary and thus will always conflict and require user | ||
# intervention with every merge. To do so, just uncomment the entries below | ||
############################################################################### | ||
#*.sln merge=binary | ||
#*.csproj merge=binary | ||
#*.vbproj merge=binary | ||
#*.vcxproj merge=binary | ||
#*.vcproj merge=binary | ||
#*.dbproj merge=binary | ||
#*.fsproj merge=binary | ||
#*.lsproj merge=binary | ||
#*.wixproj merge=binary | ||
#*.modelproj merge=binary | ||
#*.sqlproj merge=binary | ||
#*.wwaproj merge=binary | ||
|
||
############################################################################### | ||
# behavior for image files | ||
# | ||
# image files are treated as binary by default. | ||
############################################################################### | ||
#*.jpg binary | ||
#*.png binary | ||
#*.gif binary | ||
|
||
############################################################################### | ||
# diff behavior for common document formats | ||
# | ||
# Convert binary document formats to text before diffing them. This feature | ||
# is only available from the command line. Turn it on by uncommenting the | ||
# entries below. | ||
############################################################################### | ||
#*.doc diff=astextplain | ||
#*.DOC diff=astextplain | ||
#*.docx diff=astextplain | ||
#*.DOCX diff=astextplain | ||
#*.dot diff=astextplain | ||
#*.DOT diff=astextplain | ||
#*.pdf diff=astextplain | ||
#*.PDF diff=astextplain | ||
#*.rtf diff=astextplain | ||
#*.RTF diff=astextplain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
|
||
Copyright 2023 Hedi Hadi | ||
|
||
MIT License with Additional Restrictions | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to privately modify and use the Software, but not to distribute the Software or use it for commercial purposes. | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS," WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Zal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.6.33829.357 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Zal", "Zal\Zal.csproj", "{ABE23427-C720-41C8-92BD-DF87181FF3D0}" | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{2DB0CF01-2D3A-4CA1-A291-E2A3161EE683}" | ||
ProjectSection(SolutionItems) = preProject | ||
LICENSE.md = LICENSE.md | ||
EndProjectSection | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{ABE23427-C720-41C8-92BD-DF87181FF3D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{ABE23427-C720-41C8-92BD-DF87181FF3D0}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{ABE23427-C720-41C8-92BD-DF87181FF3D0}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{ABE23427-C720-41C8-92BD-DF87181FF3D0}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {5C8A664D-D750-4BDF-B4D1-46D658B0CE96} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<configuration> | ||
<configSections> | ||
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" > | ||
<section name="Zal.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> | ||
</sectionGroup> | ||
</configSections> | ||
<userSettings> | ||
<Zal.Settings> | ||
<setting name="primaryNetwork" serializeAs="String"> | ||
<value>0</value> | ||
</setting> | ||
<setting name="gpu" serializeAs="String"> | ||
<value>0</value> | ||
</setting> | ||
<setting name="runOnStartup" serializeAs="String"> | ||
<value>True</value> | ||
</setting> | ||
</Zal.Settings> | ||
</userSettings> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<Application x:Class="Zal.App" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="clr-namespace:Zal" | ||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" | ||
StartupUri="MainWindow.xaml"> | ||
|
||
<Application.Resources> | ||
|
||
<ResourceDictionary> | ||
<Style TargetType="{x:Type Window}"> | ||
<Setter Property="FontFamily" Value="Roboto" /> | ||
</Style> | ||
<ResourceDictionary.MergedDictionaries> | ||
<materialDesign:BundledTheme BaseTheme="Dark" PrimaryColor="DeepPurple" SecondaryColor="Lime" /> | ||
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" /> | ||
<ResourceDictionary Source="CustomTheme.xaml" /> | ||
</ResourceDictionary.MergedDictionaries> | ||
</ResourceDictionary> | ||
</Application.Resources> | ||
|
||
</Application> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using Firebase.Auth.Providers; | ||
using Firebase.Auth.Repository; | ||
using Firebase.Auth.UI; | ||
using System.Threading; | ||
using System.Windows; | ||
|
||
namespace Zal | ||
{ | ||
/// <summary> | ||
/// Interaction logic for App.xaml | ||
/// </summary> | ||
public partial class App : Application | ||
{ | ||
private static Mutex _mutex = null; | ||
protected override void OnStartup(StartupEventArgs e) | ||
{ | ||
const string appName = "Zal"; | ||
bool createdNew; | ||
|
||
_mutex = new Mutex(true, appName, out createdNew); | ||
|
||
if (!createdNew) | ||
{ | ||
//app is already running! Exiting the application | ||
Application.Current.Shutdown(); | ||
} | ||
|
||
base.OnStartup(e); | ||
} | ||
public App() | ||
{ | ||
|
||
FirebaseUI.Initialize(new FirebaseUIConfig | ||
{ | ||
ApiKey = "AIzaSyDSj8N7DH3jtMOAa4hd7ytqMq2H_8iprmc", | ||
AuthDomain = "zal1-353509.firebaseapp.com", | ||
Providers = new FirebaseAuthProvider[] | ||
{ | ||
new GoogleProvider(), | ||
|
||
new EmailProvider() | ||
}, | ||
PrivacyPolicyUrl = "https://github.com/step-up-labs/firebase-authentication-dotnet", | ||
TermsOfServiceUrl = "https://github.com/step-up-labs/firebase-database-dotnet", | ||
IsAnonymousAllowed = false, | ||
AutoUpgradeAnonymousUsers = true, | ||
UserRepository = new FileUserRepository("FirebaseSample"), | ||
// Func called when upgrade of anonymous user fails because the user already exists | ||
// You should grab any data created under your anonymous user, sign in with the pending credential | ||
// and copy the existing data to the new user | ||
// see details here: https://github.com/firebase/firebaseui-web#upgrading-anonymous-users | ||
AnonymousUpgradeConflict = conflict => conflict.SignInWithPendingCredentialAsync(true) | ||
}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using System.Windows; | ||
|
||
[assembly: ThemeInfo( | ||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located | ||
//(used if a resource is not found in the page, | ||
// or application resource dictionaries) | ||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located | ||
//(used if a resource is not found in the page, | ||
// app, or any theme specific resource dictionaries) | ||
)] |
Oops, something went wrong.