fix
All checks were successful
Deploy on Master Change / deploy (push) Successful in 53s

This commit is contained in:
2026-07-03 17:59:02 +07:00
parent 0fa4a9aae2
commit 96391b0706
13 changed files with 10448 additions and 100 deletions

View File

@@ -12,34 +12,163 @@ import (
)
var systemAllowed = map[string]bool{
"finder": true,
"terminal": true,
"iterm": true,
"iterm2": true,
"bash": true,
"zsh": true,
"sh": true,
"wails": true,
"code": true,
"cursor": true,
"windsurf": true,
"goland": true,
"idea": true,
"clion": true,
"webstorm": true,
"pycharm": true,
"rider": true,
"studio": true,
"eclipse": true,
"sublime_text": true,
"git": true,
"docker": true,
"system events": true,
"osascript": true,
"client": true,
"simple_care_v1.0": true,
}
// ── Core macOS Desktop Infrastructure ─────────────────────────────────────
"finder": true, // macOS file manager / desktop
"dock": true, // macOS Dock — kill = dock disappears
"windowserver": true, // WindowServer — kill = instant logout
"loginwindow": true, // Login/session manager — kill = logout
"systemuiserver": true, // Menu bar icons (volume, wifi, battery, clock)
"controlcenter": true, // macOS Control Center (Monterey+)
"notificationcenter": true, // Notification Center
"spotlight": true, // Spotlight search
"launchpad": true,
"mission control": true,
"exposé": true,
"universalaccessd": true,
"accessibilityuiagent": true, // Accessibility helper
// ── Input Methods & Language (critical — kill = can't type) ───────────────
"inputmethodkit": true,
"ibus": true,
"hiragana kakomi input": true,
"kinput2": true,
"squirrel": true, // Rime input method
"scim": true,
"kotoeri": true, // Japanese IME
"pinyin - simplified": true, // macOS Chinese Pinyin
"zhuyin - traditional": true,
"vietnamese": true, // macOS built-in Vietnamese IME
"abc": true, // macOS ABC keyboard input
// ── Security / Keychain / Authentication ──────────────────────────────────
"securityagent": true, // macOS security agent — kill breaks sudo GUI, Keychain prompts
"keychain": true, // Keychain access
"keychainservicesagent": true,
"trustd": true,
"opendirectoryd": true,
"authorizationhost": true, // Authorization host — UAC equivalent
"securityd": true,
"coreauthenticationd": true,
"biometricd": true,
"touchidd": true,
// ── Audio / Media ─────────────────────────────────────────────────────────
"coreaudiod": true, // Core Audio daemon — kill = no sound
"audioundockhelper": true,
"audio midi setup": true,
"noiseremoval": true,
// ── Networking / VPN ──────────────────────────────────────────────────────
"networkd": true,
"nesessionmanager": true, // Network Extension — kill drops VPN
"scutil": true,
"configd": true,
"mDNSResponder": true, // Bonjour DNS
// ── Spotlight / File Indexing ──────────────────────────────────────────────
"mds": true, // Spotlight metadata server
"mds_stores": true,
"mdworker": true, // prefix match covers mdworker_shared
"mdworker_shared": true,
// ── iCloud / Apple Services ───────────────────────────────────────────────
"bird": true, // iCloud Drive daemon
"cloudd": true,
"com.apple.icloud": true, // prefix
"cloudphotod": true,
"nsurlsessiond": true,
// ── System Preferences / Settings ─────────────────────────────────────────
"system preferences": true, // macOS System Preferences (pre-Ventura)
"system settings": true, // macOS System Settings (Ventura+)
"software update": true,
"app store": true,
// ── Screen / Display ──────────────────────────────────────────────────────
"screensaver engine": true, // Screensaver
"com.apple.screensaver": true,
"colorsyncd": true,
"colorsync utility": true,
"nightshift": true,
"display menu": true,
// ── Clipboard / Pasteboard ────────────────────────────────────────────────
"pboard": true, // Pasteboard daemon — kill breaks copy/paste
// ── Printing ─────────────────────────────────────────────────────────────
"printingproxy": true,
"cupsd": true,
// ── Crash Reporting / Diagnostics ─────────────────────────────────────────
"crashreporter": true,
"diagnosticsd": true,
"spindump": true,
"reportmemoryexception": true,
// ── Webkit / App subprocesses ─────────────────────────────────────────────
"webkit": true, // prefix
"com.apple.webkit": true, // prefix
"com.apple.webkit.networking": true,
// ── Remote support ────────────────────────────────────────────────────────
"applescriptkit": true,
"applescript runner": true,
"rustdesk": true,
"anydesk": true,
"teamviewer": true,
"screen sharing": true,
"screensharingd": true, // macOS Screen Sharing
// ── Terminals ─────────────────────────────────────────────────────────────
"terminal": true, // macOS Terminal
"iterm": true,
"iterm2": true,
"wezterm": true,
"kitty": true,
"alacritty": true,
"hyper": true,
// ── Shells ────────────────────────────────────────────────────────────────
"bash": true,
"zsh": true,
"sh": true,
"fish": true,
// ── AppleScript / Automation ──────────────────────────────────────────────
"system events": true, // AppleScript System Events (used by our blocker itself)
"osascript": true, // AppleScript runner (used by our getVisibleProcesses)
// ── Git & Credential Helpers ──────────────────────────────────────────────
"git": true,
"git-credential-manager": true,
"git-credential-osxkeychain": true,
"github desktop": true,
"sourcetree": true,
"fork": true,
// ── Docker ───────────────────────────────────────────────────────────────
"docker": true,
"docker desktop": true,
"com.docker": true, // prefix
// ── Our app + IDE/dev tools ────────────────────────────────────────────────
"client": true,
"simple_care_v1.0": true,
"simple_care": true,
"wails": true,
"code": true, // VSCode
"cursor": true,
"windsurf": true,
"goland": true,
"idea": true,
"clion": true,
"webstorm": true,
"pycharm": true,
"rider": true,
"studio": true, // Android Studio
"eclipse": true,
"sublime text": true,
}
type ProcessInfo struct {
Name string
BundleID string

View File

@@ -12,44 +12,216 @@ import (
)
var systemAllowed = map[string]bool{
"gnome-shell": true,
"mutter": true,
"xterm": true,
"gnome-terminal": true,
"konsole": true,
"ptyxis": true, // Ubuntu terminal
"bash": true,
"zsh": true,
"sh": true,
"wails": true,
"code": true,
"cursor": true,
"windsurf": true,
"goland": true,
"idea": true,
"client": true,
"simple_care_v1.0": true,
"xwayland": true,
"mutter-x11-fram": true,
"ibus-x11": true,
"ibus-daemon": true,
"gsd-": true, // prefix
"ibus-": true, // prefix
"xdg-": true, // prefix
"at-spi": true, // prefix
"evolution-": true, // prefix
"goa-daemon": true,
"gjs": true,
"snapd-": true, // prefix
"systemd": true,
"webkit": true, // WebKit subprocesses
"glycin": true, // GNOME image helper
"zenity": true, // Dialog utility
"rustdesk": true, // Remote support safety
"rustdesk-bin": true,
"anydesk": true,
"teamviewer": true,
"remmina": true,
// ── Display servers / Compositors ─────────────────────────────────────────
"gnome-shell": true,
"mutter": true,
"mutter-x11-fram": true, // prefix match too
"xwayland": true,
"xorg": true,
"Xorg": true,
"x11": true,
"kwin_wayland": true, // KDE compositor
"kwin_x11": true,
"plasmashell": true, // KDE Plasma shell
"hyprland": true, // Hyprland Wayland compositor
"sway": true, // Sway compositor
"wayfire": true, // Wayfire compositor
"river": true, // River compositor
"labwc": true, // LabWC compositor
"openbox": true,
"i3": true,
"i3bar": true,
"awesome": true,
"bspwm": true,
"xfwm4": true,
"marco": true, // MATE wm
"compiz": true,
"picom": true,
"compton": true,
// ── Wayland session tools ─────────────────────────────────────────────────
"wl-paste": true,
"wl-copy": true,
"wlr-randr": true,
"kanshi": true, // output manager
"wlsunset": true,
"gammastep": true,
"swaylock": true,
"swayidle": true,
"swaybg": true,
"swaync": true, // SwayNotificationCenter
"waybar": true, // Wayland statusbar
"eww": true, // ElKowar's wacky widgets
"ags": true, // Aylur's GTK Shell
"rofi": true, // app launcher (used in many WMs)
"wofi": true, // Wayland rofi
"fuzzel": true, // Wayland launcher
"tofi": true,
"dmenu": true,
"bemenu": true,
// ── Session / Login managers ──────────────────────────────────────────────
"gdm": true,
"gdm3": true,
"sddm": true,
"lightdm": true,
"lxdm": true,
"slim": true,
"greetd": true,
"gnome-session": true,
"gnome-session-bi": true, // prefix matches binary
"lxsession": true,
"startx": true,
"xinit": true,
// ── Terminals ─────────────────────────────────────────────────────────────
"xterm": true,
"gnome-terminal": true,
"gnome-terminal-": true, // prefix for server process
"ptyxis": true,
"konsole": true,
"kitty": true,
"alacritty": true,
"wezterm": true,
"wezterm-gui": true,
"foot": true,
"xfce4-terminal": true,
"tilix": true,
"terminator": true,
"urxvt": true,
"rxvt": true,
"sakura": true,
"st": true,
// ── Shells ────────────────────────────────────────────────────────────────
"bash": true,
"zsh": true,
"sh": true,
"fish": true,
"dash": true,
"ksh": true,
// ── Input methods (critical — killing these breaks Vietnamese typing) ─────
"ibus-daemon": true,
"ibus-x11": true,
"ibus-": true, // prefix: ibus-extension-, ibus-portal, ibus-engine-...
"fcitx5": true,
"fcitx": true,
"fcitx-": true, // prefix
"uim": true,
"scim": true,
"sogou-qimpanel": true,
"gcin": true,
"kimpanel": true,
// ── GNOME core services ───────────────────────────────────────────────────
"gjs": true,
"gsd-": true, // prefix: gsd-keyboard, gsd-media-keys, gsd-power, gsd-color...
"goa-daemon": true,
"goa-identity-ser": true,
"evolution-": true, // prefix: evolution-calendar, evolution-addressbook...
"gnome-keyring-d": true,
"gnome-keyring": true,
"polkit-gnome-au": true,
"polkitd": true,
"gnome-settings-d": true,
"gnome-initial-se": true,
"gnome-control-ce": true,
"gvfsd": true,
"gvfsd-": true, // prefix
"tracker-miner-": true, // prefix
"tracker3": true,
"zeitgeist": true,
"zeitgeist-": true,
"accounts-daemon": true,
"colord": true,
"power-profiles-": true,
"fprintd": true,
"fwupd": true,
"udisksd": true,
"upowerd": true,
"packagekitd": true,
"nm-dispatcher": true,
// ── D-Bus / XDG / AT-SPI ─────────────────────────────────────────────────
"xdg-": true, // prefix: xdg-desktop-portal, xdg-permission-store...
"at-spi": true, // prefix
"at-spi-bus-laun": true,
"at-spi2-registr": true,
"dbus-daemon": true,
"dbus-launch": true,
// ── System services (often have GTK tray icons) ───────────────────────────
"systemd": true, // prefix match handles systemd-*
"snapd-": true, // prefix
"snapd": true,
// ── Network/Bluetooth tray (critical for connectivity UI) ─────────────────
"nm-applet": true, // NetworkManager tray — if killed, students lose wifi UI
"nm-tray": true,
"network-manager-": true, // prefix
"blueman-applet": true, // Bluetooth tray — kills BT management
"blueman-tray": true,
"blueman-manager": true,
"kdeconnectd": true, // KDE Connect daemon
"kdeconnect-indi": true, // KDE Connect indicator
// ── Notification daemons ──────────────────────────────────────────────────
"dunst": true,
"mako": true,
"notify-osd": true,
"xfce4-notifyd": true,
"fnott": true,
// ── Polkit authentication agents ─────────────────────────────────────────
"lxqt-policykit-": true,
"xfce-polkit": true,
"mate-polkit": true,
"pkttyagent": true,
// ── Clipboard managers (killing breaks copy/paste) ────────────────────────
"copyq": true,
"clipit": true,
"xclip": true,
"xsel": true,
"clipman": true,
"greenclip": true,
// ── GTK/GNOME image helpers ───────────────────────────────────────────────
"glycin": true,
"zenity": true,
"yad": true,
"kdialog": true,
// ── Screensaver / Lock ────────────────────────────────────────────────────
"gnome-screensave": true,
"xscreensaver": true,
"xlock": true,
"i3lock": true,
// ── WebKit subprocesses (used by many GTK apps) ───────────────────────────
"webkit": true, // prefix
"webkit2gtk": true,
"WebKitWebProcess": true,
"WebKitNetworkPro": true, // prefix
// ── Remote support tools (safety) ────────────────────────────────────────
"rustdesk": true,
"rustdesk-bin": true,
"anydesk": true,
"teamviewer": true,
"remmina": true,
// ── Our app + dev tools ───────────────────────────────────────────────────
"wails": true,
"code": true,
"cursor": true,
"windsurf": true,
"goland": true,
"idea": true,
"client": true,
"simple_care_v1.0": true,
"simple_care": true,
}
func isSystemAllowed(name string) bool {

View File

@@ -187,34 +187,156 @@ func EnumerateGUIWindows() ([]WindowInfo, map[uint32]uint32, error) {
}
var systemAllowed = map[string]bool{
"explorer.exe": true,
"taskmgr.exe": true,
"cmd.exe": true,
"powershell.exe": true,
"conhost.exe": true,
"client.exe": true, // App Wails của ta
"simple_care_v1.0.exe": true,
"wails.exe": true,
"msedgewebview2.exe": true, // WebView2 runtime của Wails
"code.exe": true, // VSCode
"cursor.exe": true, // Cursor
"windsurf.exe": true, // Windsurf
"goland.exe": true, // GoLand
"goland64.exe": true, // GoLand
"idea64.exe": true, // IntelliJ IDEA
"clion64.exe": true, // CLion
"webstorm64.exe": true, // WebStorm
"pycharm64.exe": true, // PyCharm
"rider64.exe": true, // Rider
"studio64.exe": true, // Android Studio
"eclipse.exe": true, // Eclipse
"sublime_text.exe": true, // Sublime Text
"notepad++.exe": true, // Notepad++
"devenv.exe": true, // Visual Studio
"git-bash.exe": true, // Git Bash
"bash.exe": true, // Bash
// ── Windows Shell & Explorer ───────────────────────────────────────────────
"explorer.exe": true, // Windows Explorer / desktop shell
"shellexperiencehost.exe": true, // Start menu, Action Center shell
"startmenuexperiencehost.exe": true, // Start menu host
"searchhost.exe": true, // Windows Search UI
"searchapp.exe": true, // Windows Search (older)
"searchindexer.exe": true,
"sihost.exe": true, // Shell Infrastructure Host (taskbar, notification icons)
"taskhostw.exe": true, // Task Host Window
"taskbar.exe": true,
"lockapp.exe": true, // Lock screen
"logonui.exe": true, // Login/Logon UI
"winlogon.exe": true, // Windows Logon Process
"userinit.exe": true,
"dwm.exe": true, // Desktop Window Manager — kill = black screen
"csrss.exe": true, // Client Server Runtime — kill = BSOD
// ── UWP / Modern App Infrastructure ───────────────────────────────────────
"applicationframehost.exe": true, // Host for ALL UWP apps (Camera, Calculator, Photos...)
"runtimebroker.exe": true, // UWP permission broker
"backgroundtaskhost.exe": true, // UWP background tasks
"wwahost.exe": true, // Web app host
"microsoftedgecp.exe": true, // Edge content process (older)
"textinputhost.exe": true, // Touch keyboard / handwriting panel
// ── Input Methods & Language ───────────────────────────────────────────────
"ctfmon.exe": true, // Collaborative Translation Framework — input method manager
"chsime.exe": true, // Chinese IME
"imetip.exe": true, // IME tip
"imecmnt.exe": true,
"googlepinyin.exe": true,
"baidu.exe": true, // Baidu IME
"openkey.exe": true, // OpenKey Vietnamese IME
"openkey64.exe": true,
"gotiengviet.exe": true, // GoTiengViet
"unikeyvnt.exe": true, // Unikey
"unikey.exe": true,
// ── Security / Credential / UAC ───────────────────────────────────────────
"consent.exe": true, // UAC consent dialog — kill breaks all elevation
"credentialuibroker.exe": true, // Credential UI
"smartscreen.exe": true, // Windows SmartScreen
"securityhealthsystray.exe": true, // Windows Security tray icon
"securityhealthservice.exe": true,
"wscsvc.exe": true,
"msseces.exe": true, // Microsoft Security Essentials tray
"msmpeng.exe": true, // Windows Defender engine (has no GUI but safety)
"nisSrv.exe": true,
"antimalware service executable": true, // Window title of Defender
// ── Notifications & Action Center ─────────────────────────────────────────
"notificationplatformcontroller": true,
// ── System Tray / Taskbar helpers ─────────────────────────────────────────
"systemsettings.exe": true, // Windows Settings
"settingssynchostservice.exe": true,
"settingssynchost.exe": true,
"regsvc.exe": true,
"spoolsv.exe": true,
"tabtip.exe": true, // Touch keyboard
"tabtip32.exe": true,
"onedrive.exe": true, // OneDrive tray (common, safe to keep)
"onedriveupdater.exe": true,
// ── Accessibility ─────────────────────────────────────────────────────────
"narrator.exe": true,
"magnify.exe": true,
"osk.exe": true, // On-Screen Keyboard
// ── Audio ─────────────────────────────────────────────────────────────────
"audiodg.exe": true, // Windows Audio Device Graph — kill = no sound
"sndvol.exe": true, // Volume mixer
"cmediaaudiocontrolpanel.exe": true, // C-Media audio panel
// ── Windows Update / Store ─────────────────────────────────────────────────
"wuauclt.exe": true, // Windows Update
"musnotifyicon.exe": true, // Update tray notification
"windowsstore.exe": true,
"winstore.app.exe": true,
// ── Drivers / Hardware UI ──────────────────────────────────────────────────
"nvdisplay.container.exe": true, // NVIDIA display container
"nvcontainer.exe": true,
"nvinject.exe": true,
"nvtelemetrycontainer.exe": true,
"nvvsvc.exe": true,
"nvspcaps64.exe": true,
"geforce experience.exe": true,
"radeonsoftware.exe": true, // AMD Radeon Software
"amddvr.exe": true,
"igfxtray.exe": true, // Intel graphics tray
"igfxem.exe": true,
"igfxhk.exe": true,
"hkcmd.exe": true,
"atk hub.exe": true, // ASUS ATK
"atkex.exe": true,
"asusoptimization.exe": true,
// ── Antivirus trays (common, prevent false-kill) ───────────────────────────
"avastui.exe": true,
"avgui.exe": true,
"mbam.exe": true, // Malwarebytes
"mbamtray.exe": true,
"bdagent.exe": true, // Bitdefender
"uiseagnt.exe": true, // Trend Micro
"eguiproxy.exe": true, // ESET
// ── Task Manager & System tools ────────────────────────────────────────────
"taskmgr.exe": true,
"resmon.exe": true, // Resource Monitor
"perfmon.exe": true,
"mmc.exe": true, // Management Console
// ── Terminal / Shell ───────────────────────────────────────────────────────
"cmd.exe": true,
"powershell.exe": true,
"pwsh.exe": true, // PowerShell Core
"conhost.exe": true, // Console Host
"windowsterminal.exe": true, // Windows Terminal
"wt.exe": true,
"bash.exe": true,
"git-bash.exe": true,
"mintty.exe": true, // Git Bash window
"wsl.exe": true,
"wslhost.exe": true,
// ── Our app + IDE/dev tools ────────────────────────────────────────────────
"client.exe": true,
"simple_care_v1.0.exe": true,
"simple_care.exe": true,
"wails.exe": true,
"msedgewebview2.exe": true, // WebView2 runtime (Wails renderer)
"code.exe": true,
"cursor.exe": true,
"windsurf.exe": true,
"goland.exe": true,
"goland64.exe": true,
"idea64.exe": true,
"clion64.exe": true,
"webstorm64.exe": true,
"pycharm64.exe": true,
"rider64.exe": true,
"studio64.exe": true,
"eclipse.exe": true,
"sublime_text.exe": true,
"notepad++.exe": true,
"devenv.exe": true,
}
func isDescendant(pid, targetPid uint32, parentMap map[uint32]uint32) bool {
curr := pid
for i := 0; i < 16; i++ {