Commit 02ed9ec
committed
fix: replace wmic with Windows API to prevent antivirus false positives
Replace wmic-based battery detection with direct kernel32.dll API calls
to avoid Trojan:Win32/Wacatac false positive detections by Windows Defender.
Changes:
- Use GetSystemPowerStatus() P/Invoke instead of spawning wmic process
- Add SYSTEM_POWER_STATUS struct for native Windows API
- Maintain same functionality with zero behavioral changes
- macOS and Linux implementations unchanged
This resolves antivirus detection issues while preserving power management
functionality across all platforms.1 parent cb12e04 commit 02ed9ec
2 files changed
+22
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
122 | 114 | | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
| 115 | + | |
| 116 | + | |
128 | 117 | | |
129 | 118 | | |
130 | 119 | | |
131 | 120 | | |
132 | 121 | | |
133 | 122 | | |
134 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
135 | 139 | | |
136 | 140 | | |
137 | 141 | | |
| |||
0 commit comments