feat: Complete Tauri v2 + Rust rewrite with modern UI, Restart Manager shredder and auto-updater
42
.gitignore
vendored
|
|
@ -1,24 +1,28 @@
|
||||||
## Visual Studio / .NET
|
# Dependencies
|
||||||
[Bb]in/
|
node_modules
|
||||||
[Oo]bj/
|
target/
|
||||||
|
dist
|
||||||
|
dist-ssr
|
||||||
|
*.local
|
||||||
|
|
||||||
|
# .NET artifacts
|
||||||
|
bin/
|
||||||
|
obj/
|
||||||
*.user
|
*.user
|
||||||
*.suo
|
*.suo
|
||||||
*.userosscache
|
|
||||||
*.sln.docstates
|
|
||||||
.vs/
|
|
||||||
.idea/
|
|
||||||
|
|
||||||
## User local scripts
|
|
||||||
*.bat
|
|
||||||
bağlan.bat
|
|
||||||
|
|
||||||
|
# Logs
|
||||||
|
logs
|
||||||
*.log
|
*.log
|
||||||
trace.log
|
npm-debug.log*
|
||||||
crash_*.log
|
yarn-debug.log*
|
||||||
test_*.json
|
yarn-error.log*
|
||||||
|
pnpm-debug.log*
|
||||||
|
lerna-debug.log*
|
||||||
|
|
||||||
## Release packages & archives
|
# Editor directories and files
|
||||||
*.zip
|
.vscode/*
|
||||||
LD Uninstaller v*/
|
!.vscode/extensions.json
|
||||||
dist/
|
.idea
|
||||||
publish/
|
.DS_Store
|
||||||
|
*.sw?
|
||||||
|
|
|
||||||
3
.vscode/extensions.json
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"recommendations": ["tauri-apps.tauri-vscode", "rust-lang.rust-analyzer"]
|
||||||
|
}
|
||||||
BIN
LD Uninstaller v2.8.0/FlaUI.Core.dll
Normal file
BIN
LD Uninstaller v2.8.0/FlaUI.UIA3.dll
Normal file
BIN
LD Uninstaller v2.8.0/Interop.UIAutomationClient.dll
Normal file
330
LD Uninstaller v2.8.0/LDUninstaller.Automatizer.deps.json
Normal file
|
|
@ -0,0 +1,330 @@
|
||||||
|
{
|
||||||
|
"runtimeTarget": {
|
||||||
|
"name": ".NETCoreApp,Version=v8.0",
|
||||||
|
"signature": ""
|
||||||
|
},
|
||||||
|
"compilationOptions": {},
|
||||||
|
"targets": {
|
||||||
|
".NETCoreApp,Version=v8.0": {
|
||||||
|
"LDUninstaller.Automatizer/2.8.0": {
|
||||||
|
"dependencies": {
|
||||||
|
"FlaUI.UIA3": "5.0.0",
|
||||||
|
"LDUninstaller.Core": "2.8.0"
|
||||||
|
},
|
||||||
|
"runtime": {
|
||||||
|
"LDUninstaller.Automatizer.dll": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"FlaUI.Core/5.0.0": {
|
||||||
|
"dependencies": {
|
||||||
|
"Microsoft.Win32.Registry": "5.0.0",
|
||||||
|
"System.Diagnostics.PerformanceCounter": "8.0.1",
|
||||||
|
"System.Drawing.Common": "8.0.10",
|
||||||
|
"System.Management": "8.0.0",
|
||||||
|
"System.Security.Permissions": "8.0.0"
|
||||||
|
},
|
||||||
|
"runtime": {
|
||||||
|
"lib/net8.0-windows7.0/FlaUI.Core.dll": {
|
||||||
|
"assemblyVersion": "5.0.0.0",
|
||||||
|
"fileVersion": "5.0.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"FlaUI.UIA3/5.0.0": {
|
||||||
|
"dependencies": {
|
||||||
|
"FlaUI.Core": "5.0.0",
|
||||||
|
"Interop.UIAutomationClient": "10.19041.0"
|
||||||
|
},
|
||||||
|
"runtime": {
|
||||||
|
"lib/net8.0-windows7.0/FlaUI.UIA3.dll": {
|
||||||
|
"assemblyVersion": "5.0.0.0",
|
||||||
|
"fileVersion": "5.0.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Interop.UIAutomationClient/10.19041.0": {
|
||||||
|
"runtime": {
|
||||||
|
"lib/netcoreapp3.0/Interop.UIAutomationClient.dll": {
|
||||||
|
"assemblyVersion": "10.0.19041.0",
|
||||||
|
"fileVersion": "10.0.19041.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Microsoft.NETCore.Platforms/5.0.0": {},
|
||||||
|
"Microsoft.Win32.Registry/5.0.0": {
|
||||||
|
"dependencies": {
|
||||||
|
"System.Security.AccessControl": "5.0.0",
|
||||||
|
"System.Security.Principal.Windows": "5.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Microsoft.Win32.SystemEvents/8.0.0": {},
|
||||||
|
"System.CodeDom/8.0.0": {},
|
||||||
|
"System.Configuration.ConfigurationManager/8.0.1": {
|
||||||
|
"dependencies": {
|
||||||
|
"System.Diagnostics.EventLog": "10.0.14",
|
||||||
|
"System.Security.Cryptography.ProtectedData": "8.0.0"
|
||||||
|
},
|
||||||
|
"runtime": {
|
||||||
|
"lib/net8.0/System.Configuration.ConfigurationManager.dll": {
|
||||||
|
"assemblyVersion": "8.0.0.0",
|
||||||
|
"fileVersion": "8.0.1024.46610"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"System.Diagnostics.EventLog/10.0.14": {
|
||||||
|
"runtime": {
|
||||||
|
"lib/net8.0/System.Diagnostics.EventLog.dll": {
|
||||||
|
"assemblyVersion": "10.0.0.0",
|
||||||
|
"fileVersion": "10.0.1426.52326"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"runtimeTargets": {
|
||||||
|
"runtimes/win/lib/net8.0/System.Diagnostics.EventLog.Messages.dll": {
|
||||||
|
"rid": "win",
|
||||||
|
"assetType": "runtime",
|
||||||
|
"assemblyVersion": "10.0.0.0",
|
||||||
|
"fileVersion": "0.0.0.0"
|
||||||
|
},
|
||||||
|
"runtimes/win/lib/net8.0/System.Diagnostics.EventLog.dll": {
|
||||||
|
"rid": "win",
|
||||||
|
"assetType": "runtime",
|
||||||
|
"assemblyVersion": "10.0.0.0",
|
||||||
|
"fileVersion": "10.0.1426.52326"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"System.Diagnostics.PerformanceCounter/8.0.1": {
|
||||||
|
"dependencies": {
|
||||||
|
"System.Configuration.ConfigurationManager": "8.0.1"
|
||||||
|
},
|
||||||
|
"runtime": {
|
||||||
|
"lib/net8.0/System.Diagnostics.PerformanceCounter.dll": {
|
||||||
|
"assemblyVersion": "8.0.0.0",
|
||||||
|
"fileVersion": "8.0.1024.46610"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"runtimeTargets": {
|
||||||
|
"runtimes/win/lib/net8.0/System.Diagnostics.PerformanceCounter.dll": {
|
||||||
|
"rid": "win",
|
||||||
|
"assetType": "runtime",
|
||||||
|
"assemblyVersion": "8.0.0.0",
|
||||||
|
"fileVersion": "8.0.1024.46610"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"System.Drawing.Common/8.0.10": {
|
||||||
|
"dependencies": {
|
||||||
|
"Microsoft.Win32.SystemEvents": "8.0.0"
|
||||||
|
},
|
||||||
|
"runtime": {
|
||||||
|
"lib/net8.0/System.Drawing.Common.dll": {
|
||||||
|
"assemblyVersion": "8.0.0.0",
|
||||||
|
"fileVersion": "8.0.1024.46803"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"System.Management/8.0.0": {
|
||||||
|
"dependencies": {
|
||||||
|
"System.CodeDom": "8.0.0"
|
||||||
|
},
|
||||||
|
"runtime": {
|
||||||
|
"lib/net8.0/System.Management.dll": {
|
||||||
|
"assemblyVersion": "8.0.0.0",
|
||||||
|
"fileVersion": "8.0.23.53103"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"runtimeTargets": {
|
||||||
|
"runtimes/win/lib/net8.0/System.Management.dll": {
|
||||||
|
"rid": "win",
|
||||||
|
"assetType": "runtime",
|
||||||
|
"assemblyVersion": "8.0.0.0",
|
||||||
|
"fileVersion": "8.0.23.53103"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"System.Security.AccessControl/5.0.0": {
|
||||||
|
"dependencies": {
|
||||||
|
"Microsoft.NETCore.Platforms": "5.0.0",
|
||||||
|
"System.Security.Principal.Windows": "5.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"System.Security.Cryptography.ProtectedData/8.0.0": {},
|
||||||
|
"System.Security.Permissions/8.0.0": {
|
||||||
|
"dependencies": {
|
||||||
|
"System.Windows.Extensions": "8.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"System.Security.Principal.Windows/5.0.0": {},
|
||||||
|
"System.ServiceProcess.ServiceController/10.0.14": {
|
||||||
|
"dependencies": {
|
||||||
|
"System.Diagnostics.EventLog": "10.0.14"
|
||||||
|
},
|
||||||
|
"runtime": {
|
||||||
|
"lib/net8.0/System.ServiceProcess.ServiceController.dll": {
|
||||||
|
"assemblyVersion": "10.0.0.14",
|
||||||
|
"fileVersion": "10.0.1426.52326"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"runtimeTargets": {
|
||||||
|
"runtimes/win/lib/net8.0/System.ServiceProcess.ServiceController.dll": {
|
||||||
|
"rid": "win",
|
||||||
|
"assetType": "runtime",
|
||||||
|
"assemblyVersion": "10.0.0.14",
|
||||||
|
"fileVersion": "10.0.1426.52326"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"System.Windows.Extensions/8.0.0": {},
|
||||||
|
"LDUninstaller.Core/2.8.0": {
|
||||||
|
"dependencies": {
|
||||||
|
"System.Management": "8.0.0",
|
||||||
|
"System.ServiceProcess.ServiceController": "10.0.14"
|
||||||
|
},
|
||||||
|
"runtime": {
|
||||||
|
"LDUninstaller.Core.dll": {
|
||||||
|
"assemblyVersion": "2.8.0",
|
||||||
|
"fileVersion": "2.8.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"libraries": {
|
||||||
|
"LDUninstaller.Automatizer/2.8.0": {
|
||||||
|
"type": "project",
|
||||||
|
"serviceable": false,
|
||||||
|
"sha512": ""
|
||||||
|
},
|
||||||
|
"FlaUI.Core/5.0.0": {
|
||||||
|
"type": "package",
|
||||||
|
"serviceable": true,
|
||||||
|
"sha512": "sha512-VWWYqwjsYkii2BrUsz5+bpXEp27NherKhLt19hTxHwJP4KrfyZoeo1FdBov4ZTh655wZAKDGIjR7NJLDesuzeg==",
|
||||||
|
"path": "flaui.core/5.0.0",
|
||||||
|
"hashPath": "flaui.core.5.0.0.nupkg.sha512"
|
||||||
|
},
|
||||||
|
"FlaUI.UIA3/5.0.0": {
|
||||||
|
"type": "package",
|
||||||
|
"serviceable": true,
|
||||||
|
"sha512": "sha512-s1Yy1RsRJ0OXvmtxQlNJd0cu4sfvN3PFFu6skBGK8VlwPl/b38E0V5kCbo2gvkuhRIu4Itfxjdo7DUMF7qJw4Q==",
|
||||||
|
"path": "flaui.uia3/5.0.0",
|
||||||
|
"hashPath": "flaui.uia3.5.0.0.nupkg.sha512"
|
||||||
|
},
|
||||||
|
"Interop.UIAutomationClient/10.19041.0": {
|
||||||
|
"type": "package",
|
||||||
|
"serviceable": true,
|
||||||
|
"sha512": "sha512-Me5vKNZ1JSg6txTsPQXaWx7fVNh+fmcUPPwtDKJtqvbMM0N8aoa/l/QPolkJIRnasCabCNt4v2zG4p1Q9HU98A==",
|
||||||
|
"path": "interop.uiautomationclient/10.19041.0",
|
||||||
|
"hashPath": "interop.uiautomationclient.10.19041.0.nupkg.sha512"
|
||||||
|
},
|
||||||
|
"Microsoft.NETCore.Platforms/5.0.0": {
|
||||||
|
"type": "package",
|
||||||
|
"serviceable": true,
|
||||||
|
"sha512": "sha512-VyPlqzH2wavqquTcYpkIIAQ6WdenuKoFN0BdYBbCWsclXacSOHNQn66Gt4z5NBqEYW0FAPm5rlvki9ZiCij5xQ==",
|
||||||
|
"path": "microsoft.netcore.platforms/5.0.0",
|
||||||
|
"hashPath": "microsoft.netcore.platforms.5.0.0.nupkg.sha512"
|
||||||
|
},
|
||||||
|
"Microsoft.Win32.Registry/5.0.0": {
|
||||||
|
"type": "package",
|
||||||
|
"serviceable": true,
|
||||||
|
"sha512": "sha512-dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==",
|
||||||
|
"path": "microsoft.win32.registry/5.0.0",
|
||||||
|
"hashPath": "microsoft.win32.registry.5.0.0.nupkg.sha512"
|
||||||
|
},
|
||||||
|
"Microsoft.Win32.SystemEvents/8.0.0": {
|
||||||
|
"type": "package",
|
||||||
|
"serviceable": true,
|
||||||
|
"sha512": "sha512-9opKRyOKMCi2xJ7Bj7kxtZ1r9vbzosMvRrdEhVhDz8j8MoBGgB+WmC94yH839NPH+BclAjtQ/pyagvi/8gDLkw==",
|
||||||
|
"path": "microsoft.win32.systemevents/8.0.0",
|
||||||
|
"hashPath": "microsoft.win32.systemevents.8.0.0.nupkg.sha512"
|
||||||
|
},
|
||||||
|
"System.CodeDom/8.0.0": {
|
||||||
|
"type": "package",
|
||||||
|
"serviceable": true,
|
||||||
|
"sha512": "sha512-WTlRjL6KWIMr/pAaq3rYqh0TJlzpouaQ/W1eelssHgtlwHAH25jXTkUphTYx9HaIIf7XA6qs/0+YhtLEQRkJ+Q==",
|
||||||
|
"path": "system.codedom/8.0.0",
|
||||||
|
"hashPath": "system.codedom.8.0.0.nupkg.sha512"
|
||||||
|
},
|
||||||
|
"System.Configuration.ConfigurationManager/8.0.1": {
|
||||||
|
"type": "package",
|
||||||
|
"serviceable": true,
|
||||||
|
"sha512": "sha512-gPYFPDyohW2gXNhdQRSjtmeS6FymL2crg4Sral1wtvEJ7DUqFCDWDVbbLobASbzxfic8U1hQEdC7hmg9LHncMw==",
|
||||||
|
"path": "system.configuration.configurationmanager/8.0.1",
|
||||||
|
"hashPath": "system.configuration.configurationmanager.8.0.1.nupkg.sha512"
|
||||||
|
},
|
||||||
|
"System.Diagnostics.EventLog/10.0.14": {
|
||||||
|
"type": "package",
|
||||||
|
"serviceable": true,
|
||||||
|
"sha512": "sha512-O/RzNwWoDzehkLlAG9hR8xooY5L41U7VUaYlcKvE3+FhHohBJqF10oLUzuv0v59VeJ62hv3uw9VoeX12zej7Sg==",
|
||||||
|
"path": "system.diagnostics.eventlog/10.0.14",
|
||||||
|
"hashPath": "system.diagnostics.eventlog.10.0.14.nupkg.sha512"
|
||||||
|
},
|
||||||
|
"System.Diagnostics.PerformanceCounter/8.0.1": {
|
||||||
|
"type": "package",
|
||||||
|
"serviceable": true,
|
||||||
|
"sha512": "sha512-9RfEDiEjlUADeThs8IPdDVTXSnPRSqjfgTQJALpmGFPKC0k2mbdufOXnb/9JZ4I0TkmxOfy3VTJxrHOJSs8cXg==",
|
||||||
|
"path": "system.diagnostics.performancecounter/8.0.1",
|
||||||
|
"hashPath": "system.diagnostics.performancecounter.8.0.1.nupkg.sha512"
|
||||||
|
},
|
||||||
|
"System.Drawing.Common/8.0.10": {
|
||||||
|
"type": "package",
|
||||||
|
"serviceable": true,
|
||||||
|
"sha512": "sha512-MdajRp3P+FOlThgY6FBjAqnmLiVl5t2yWEC/2AsDMqx1zYbJG3G5TnscFBQ4obqcaGqvN5UnhQHSFaJFG2HftQ==",
|
||||||
|
"path": "system.drawing.common/8.0.10",
|
||||||
|
"hashPath": "system.drawing.common.8.0.10.nupkg.sha512"
|
||||||
|
},
|
||||||
|
"System.Management/8.0.0": {
|
||||||
|
"type": "package",
|
||||||
|
"serviceable": true,
|
||||||
|
"sha512": "sha512-jrK22i5LRzxZCfGb+tGmke2VH7oE0DvcDlJ1HAKYU8cPmD8XnpUT0bYn2Gy98GEhGjtfbR/sxKTVb+dE770pfA==",
|
||||||
|
"path": "system.management/8.0.0",
|
||||||
|
"hashPath": "system.management.8.0.0.nupkg.sha512"
|
||||||
|
},
|
||||||
|
"System.Security.AccessControl/5.0.0": {
|
||||||
|
"type": "package",
|
||||||
|
"serviceable": true,
|
||||||
|
"sha512": "sha512-dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==",
|
||||||
|
"path": "system.security.accesscontrol/5.0.0",
|
||||||
|
"hashPath": "system.security.accesscontrol.5.0.0.nupkg.sha512"
|
||||||
|
},
|
||||||
|
"System.Security.Cryptography.ProtectedData/8.0.0": {
|
||||||
|
"type": "package",
|
||||||
|
"serviceable": true,
|
||||||
|
"sha512": "sha512-+TUFINV2q2ifyXauQXRwy4CiBhqvDEDZeVJU7qfxya4aRYOKzVBpN+4acx25VcPB9ywUN6C0n8drWl110PhZEg==",
|
||||||
|
"path": "system.security.cryptography.protecteddata/8.0.0",
|
||||||
|
"hashPath": "system.security.cryptography.protecteddata.8.0.0.nupkg.sha512"
|
||||||
|
},
|
||||||
|
"System.Security.Permissions/8.0.0": {
|
||||||
|
"type": "package",
|
||||||
|
"serviceable": true,
|
||||||
|
"sha512": "sha512-v/BBylw7XevuAsHXoX9dDUUfmBIcUf7Lkz8K3ZXIKz3YRKpw8YftpSir4n4e/jDTKFoaK37AsC3xnk+GNFI1Ow==",
|
||||||
|
"path": "system.security.permissions/8.0.0",
|
||||||
|
"hashPath": "system.security.permissions.8.0.0.nupkg.sha512"
|
||||||
|
},
|
||||||
|
"System.Security.Principal.Windows/5.0.0": {
|
||||||
|
"type": "package",
|
||||||
|
"serviceable": true,
|
||||||
|
"sha512": "sha512-t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==",
|
||||||
|
"path": "system.security.principal.windows/5.0.0",
|
||||||
|
"hashPath": "system.security.principal.windows.5.0.0.nupkg.sha512"
|
||||||
|
},
|
||||||
|
"System.ServiceProcess.ServiceController/10.0.14": {
|
||||||
|
"type": "package",
|
||||||
|
"serviceable": true,
|
||||||
|
"sha512": "sha512-riMCsgbGKGonluQzaRRrx5ney0QNkEmepNTrHD3QpqU/ICZpCJsyAWNi6JESTxqYkc+9kNQ55aZaH/n3xOjSlg==",
|
||||||
|
"path": "system.serviceprocess.servicecontroller/10.0.14",
|
||||||
|
"hashPath": "system.serviceprocess.servicecontroller.10.0.14.nupkg.sha512"
|
||||||
|
},
|
||||||
|
"System.Windows.Extensions/8.0.0": {
|
||||||
|
"type": "package",
|
||||||
|
"serviceable": true,
|
||||||
|
"sha512": "sha512-Obg3a90MkOw9mYKxrardLpY2u0axDMrSmy4JCdq2cYbelM2cUwmUir5Bomvd1yxmPL9h5LVHU1tuKBZpUjfASg==",
|
||||||
|
"path": "system.windows.extensions/8.0.0",
|
||||||
|
"hashPath": "system.windows.extensions.8.0.0.nupkg.sha512"
|
||||||
|
},
|
||||||
|
"LDUninstaller.Core/2.8.0": {
|
||||||
|
"type": "project",
|
||||||
|
"serviceable": false,
|
||||||
|
"sha512": ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
LD Uninstaller v2.8.0/LDUninstaller.Automatizer.dll
Normal file
BIN
LD Uninstaller v2.8.0/LDUninstaller.Automatizer.exe
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
{
|
||||||
|
"runtimeOptions": {
|
||||||
|
"tfm": "net8.0",
|
||||||
|
"frameworks": [
|
||||||
|
{
|
||||||
|
"name": "Microsoft.NETCore.App",
|
||||||
|
"version": "8.0.0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Microsoft.WindowsDesktop.App",
|
||||||
|
"version": "8.0.0"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"configProperties": {
|
||||||
|
"System.Reflection.Metadata.MetadataUpdater.IsSupported": false,
|
||||||
|
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
132
LD Uninstaller v2.8.0/LDUninstaller.CLI.deps.json
Normal file
|
|
@ -0,0 +1,132 @@
|
||||||
|
{
|
||||||
|
"runtimeTarget": {
|
||||||
|
"name": ".NETCoreApp,Version=v8.0",
|
||||||
|
"signature": ""
|
||||||
|
},
|
||||||
|
"compilationOptions": {},
|
||||||
|
"targets": {
|
||||||
|
".NETCoreApp,Version=v8.0": {
|
||||||
|
"LDUninstaller.CLI/2.8.0": {
|
||||||
|
"dependencies": {
|
||||||
|
"LDUninstaller.Core": "2.8.0"
|
||||||
|
},
|
||||||
|
"runtime": {
|
||||||
|
"LDUninstaller.CLI.dll": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"System.CodeDom/8.0.0": {},
|
||||||
|
"System.Diagnostics.EventLog/10.0.14": {
|
||||||
|
"runtime": {
|
||||||
|
"lib/net8.0/System.Diagnostics.EventLog.dll": {
|
||||||
|
"assemblyVersion": "10.0.0.0",
|
||||||
|
"fileVersion": "10.0.1426.52326"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"runtimeTargets": {
|
||||||
|
"runtimes/win/lib/net8.0/System.Diagnostics.EventLog.Messages.dll": {
|
||||||
|
"rid": "win",
|
||||||
|
"assetType": "runtime",
|
||||||
|
"assemblyVersion": "10.0.0.0",
|
||||||
|
"fileVersion": "0.0.0.0"
|
||||||
|
},
|
||||||
|
"runtimes/win/lib/net8.0/System.Diagnostics.EventLog.dll": {
|
||||||
|
"rid": "win",
|
||||||
|
"assetType": "runtime",
|
||||||
|
"assemblyVersion": "10.0.0.0",
|
||||||
|
"fileVersion": "10.0.1426.52326"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"System.Management/8.0.0": {
|
||||||
|
"dependencies": {
|
||||||
|
"System.CodeDom": "8.0.0"
|
||||||
|
},
|
||||||
|
"runtime": {
|
||||||
|
"lib/net8.0/System.Management.dll": {
|
||||||
|
"assemblyVersion": "8.0.0.0",
|
||||||
|
"fileVersion": "8.0.23.53103"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"runtimeTargets": {
|
||||||
|
"runtimes/win/lib/net8.0/System.Management.dll": {
|
||||||
|
"rid": "win",
|
||||||
|
"assetType": "runtime",
|
||||||
|
"assemblyVersion": "8.0.0.0",
|
||||||
|
"fileVersion": "8.0.23.53103"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"System.ServiceProcess.ServiceController/10.0.14": {
|
||||||
|
"dependencies": {
|
||||||
|
"System.Diagnostics.EventLog": "10.0.14"
|
||||||
|
},
|
||||||
|
"runtime": {
|
||||||
|
"lib/net8.0/System.ServiceProcess.ServiceController.dll": {
|
||||||
|
"assemblyVersion": "10.0.0.14",
|
||||||
|
"fileVersion": "10.0.1426.52326"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"runtimeTargets": {
|
||||||
|
"runtimes/win/lib/net8.0/System.ServiceProcess.ServiceController.dll": {
|
||||||
|
"rid": "win",
|
||||||
|
"assetType": "runtime",
|
||||||
|
"assemblyVersion": "10.0.0.14",
|
||||||
|
"fileVersion": "10.0.1426.52326"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"LDUninstaller.Core/2.8.0": {
|
||||||
|
"dependencies": {
|
||||||
|
"System.Management": "8.0.0",
|
||||||
|
"System.ServiceProcess.ServiceController": "10.0.14"
|
||||||
|
},
|
||||||
|
"runtime": {
|
||||||
|
"LDUninstaller.Core.dll": {
|
||||||
|
"assemblyVersion": "2.8.0",
|
||||||
|
"fileVersion": "2.8.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"libraries": {
|
||||||
|
"LDUninstaller.CLI/2.8.0": {
|
||||||
|
"type": "project",
|
||||||
|
"serviceable": false,
|
||||||
|
"sha512": ""
|
||||||
|
},
|
||||||
|
"System.CodeDom/8.0.0": {
|
||||||
|
"type": "package",
|
||||||
|
"serviceable": true,
|
||||||
|
"sha512": "sha512-WTlRjL6KWIMr/pAaq3rYqh0TJlzpouaQ/W1eelssHgtlwHAH25jXTkUphTYx9HaIIf7XA6qs/0+YhtLEQRkJ+Q==",
|
||||||
|
"path": "system.codedom/8.0.0",
|
||||||
|
"hashPath": "system.codedom.8.0.0.nupkg.sha512"
|
||||||
|
},
|
||||||
|
"System.Diagnostics.EventLog/10.0.14": {
|
||||||
|
"type": "package",
|
||||||
|
"serviceable": true,
|
||||||
|
"sha512": "sha512-O/RzNwWoDzehkLlAG9hR8xooY5L41U7VUaYlcKvE3+FhHohBJqF10oLUzuv0v59VeJ62hv3uw9VoeX12zej7Sg==",
|
||||||
|
"path": "system.diagnostics.eventlog/10.0.14",
|
||||||
|
"hashPath": "system.diagnostics.eventlog.10.0.14.nupkg.sha512"
|
||||||
|
},
|
||||||
|
"System.Management/8.0.0": {
|
||||||
|
"type": "package",
|
||||||
|
"serviceable": true,
|
||||||
|
"sha512": "sha512-jrK22i5LRzxZCfGb+tGmke2VH7oE0DvcDlJ1HAKYU8cPmD8XnpUT0bYn2Gy98GEhGjtfbR/sxKTVb+dE770pfA==",
|
||||||
|
"path": "system.management/8.0.0",
|
||||||
|
"hashPath": "system.management.8.0.0.nupkg.sha512"
|
||||||
|
},
|
||||||
|
"System.ServiceProcess.ServiceController/10.0.14": {
|
||||||
|
"type": "package",
|
||||||
|
"serviceable": true,
|
||||||
|
"sha512": "sha512-riMCsgbGKGonluQzaRRrx5ney0QNkEmepNTrHD3QpqU/ICZpCJsyAWNi6JESTxqYkc+9kNQ55aZaH/n3xOjSlg==",
|
||||||
|
"path": "system.serviceprocess.servicecontroller/10.0.14",
|
||||||
|
"hashPath": "system.serviceprocess.servicecontroller.10.0.14.nupkg.sha512"
|
||||||
|
},
|
||||||
|
"LDUninstaller.Core/2.8.0": {
|
||||||
|
"type": "project",
|
||||||
|
"serviceable": false,
|
||||||
|
"sha512": ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
LD Uninstaller v2.8.0/LDUninstaller.CLI.dll
Normal file
BIN
LD Uninstaller v2.8.0/LDUninstaller.CLI.exe
Normal file
19
LD Uninstaller v2.8.0/LDUninstaller.CLI.runtimeconfig.json
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
{
|
||||||
|
"runtimeOptions": {
|
||||||
|
"tfm": "net8.0",
|
||||||
|
"frameworks": [
|
||||||
|
{
|
||||||
|
"name": "Microsoft.NETCore.App",
|
||||||
|
"version": "8.0.0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Microsoft.WindowsDesktop.App",
|
||||||
|
"version": "8.0.0"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"configProperties": {
|
||||||
|
"System.Reflection.Metadata.MetadataUpdater.IsSupported": false,
|
||||||
|
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
LD Uninstaller v2.8.0/LDUninstaller.Core.dll
Normal file
132
LD Uninstaller v2.8.0/LDUninstaller.Launcher.deps.json
Normal file
|
|
@ -0,0 +1,132 @@
|
||||||
|
{
|
||||||
|
"runtimeTarget": {
|
||||||
|
"name": ".NETCoreApp,Version=v8.0",
|
||||||
|
"signature": ""
|
||||||
|
},
|
||||||
|
"compilationOptions": {},
|
||||||
|
"targets": {
|
||||||
|
".NETCoreApp,Version=v8.0": {
|
||||||
|
"LDUninstaller.Launcher/2.8.0": {
|
||||||
|
"dependencies": {
|
||||||
|
"LDUninstaller.Core": "2.8.0"
|
||||||
|
},
|
||||||
|
"runtime": {
|
||||||
|
"LDUninstaller.Launcher.dll": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"System.CodeDom/8.0.0": {},
|
||||||
|
"System.Diagnostics.EventLog/10.0.14": {
|
||||||
|
"runtime": {
|
||||||
|
"lib/net8.0/System.Diagnostics.EventLog.dll": {
|
||||||
|
"assemblyVersion": "10.0.0.0",
|
||||||
|
"fileVersion": "10.0.1426.52326"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"runtimeTargets": {
|
||||||
|
"runtimes/win/lib/net8.0/System.Diagnostics.EventLog.Messages.dll": {
|
||||||
|
"rid": "win",
|
||||||
|
"assetType": "runtime",
|
||||||
|
"assemblyVersion": "10.0.0.0",
|
||||||
|
"fileVersion": "0.0.0.0"
|
||||||
|
},
|
||||||
|
"runtimes/win/lib/net8.0/System.Diagnostics.EventLog.dll": {
|
||||||
|
"rid": "win",
|
||||||
|
"assetType": "runtime",
|
||||||
|
"assemblyVersion": "10.0.0.0",
|
||||||
|
"fileVersion": "10.0.1426.52326"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"System.Management/8.0.0": {
|
||||||
|
"dependencies": {
|
||||||
|
"System.CodeDom": "8.0.0"
|
||||||
|
},
|
||||||
|
"runtime": {
|
||||||
|
"lib/net8.0/System.Management.dll": {
|
||||||
|
"assemblyVersion": "8.0.0.0",
|
||||||
|
"fileVersion": "8.0.23.53103"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"runtimeTargets": {
|
||||||
|
"runtimes/win/lib/net8.0/System.Management.dll": {
|
||||||
|
"rid": "win",
|
||||||
|
"assetType": "runtime",
|
||||||
|
"assemblyVersion": "8.0.0.0",
|
||||||
|
"fileVersion": "8.0.23.53103"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"System.ServiceProcess.ServiceController/10.0.14": {
|
||||||
|
"dependencies": {
|
||||||
|
"System.Diagnostics.EventLog": "10.0.14"
|
||||||
|
},
|
||||||
|
"runtime": {
|
||||||
|
"lib/net8.0/System.ServiceProcess.ServiceController.dll": {
|
||||||
|
"assemblyVersion": "10.0.0.14",
|
||||||
|
"fileVersion": "10.0.1426.52326"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"runtimeTargets": {
|
||||||
|
"runtimes/win/lib/net8.0/System.ServiceProcess.ServiceController.dll": {
|
||||||
|
"rid": "win",
|
||||||
|
"assetType": "runtime",
|
||||||
|
"assemblyVersion": "10.0.0.14",
|
||||||
|
"fileVersion": "10.0.1426.52326"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"LDUninstaller.Core/2.8.0": {
|
||||||
|
"dependencies": {
|
||||||
|
"System.Management": "8.0.0",
|
||||||
|
"System.ServiceProcess.ServiceController": "10.0.14"
|
||||||
|
},
|
||||||
|
"runtime": {
|
||||||
|
"LDUninstaller.Core.dll": {
|
||||||
|
"assemblyVersion": "2.8.0",
|
||||||
|
"fileVersion": "2.8.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"libraries": {
|
||||||
|
"LDUninstaller.Launcher/2.8.0": {
|
||||||
|
"type": "project",
|
||||||
|
"serviceable": false,
|
||||||
|
"sha512": ""
|
||||||
|
},
|
||||||
|
"System.CodeDom/8.0.0": {
|
||||||
|
"type": "package",
|
||||||
|
"serviceable": true,
|
||||||
|
"sha512": "sha512-WTlRjL6KWIMr/pAaq3rYqh0TJlzpouaQ/W1eelssHgtlwHAH25jXTkUphTYx9HaIIf7XA6qs/0+YhtLEQRkJ+Q==",
|
||||||
|
"path": "system.codedom/8.0.0",
|
||||||
|
"hashPath": "system.codedom.8.0.0.nupkg.sha512"
|
||||||
|
},
|
||||||
|
"System.Diagnostics.EventLog/10.0.14": {
|
||||||
|
"type": "package",
|
||||||
|
"serviceable": true,
|
||||||
|
"sha512": "sha512-O/RzNwWoDzehkLlAG9hR8xooY5L41U7VUaYlcKvE3+FhHohBJqF10oLUzuv0v59VeJ62hv3uw9VoeX12zej7Sg==",
|
||||||
|
"path": "system.diagnostics.eventlog/10.0.14",
|
||||||
|
"hashPath": "system.diagnostics.eventlog.10.0.14.nupkg.sha512"
|
||||||
|
},
|
||||||
|
"System.Management/8.0.0": {
|
||||||
|
"type": "package",
|
||||||
|
"serviceable": true,
|
||||||
|
"sha512": "sha512-jrK22i5LRzxZCfGb+tGmke2VH7oE0DvcDlJ1HAKYU8cPmD8XnpUT0bYn2Gy98GEhGjtfbR/sxKTVb+dE770pfA==",
|
||||||
|
"path": "system.management/8.0.0",
|
||||||
|
"hashPath": "system.management.8.0.0.nupkg.sha512"
|
||||||
|
},
|
||||||
|
"System.ServiceProcess.ServiceController/10.0.14": {
|
||||||
|
"type": "package",
|
||||||
|
"serviceable": true,
|
||||||
|
"sha512": "sha512-riMCsgbGKGonluQzaRRrx5ney0QNkEmepNTrHD3QpqU/ICZpCJsyAWNi6JESTxqYkc+9kNQ55aZaH/n3xOjSlg==",
|
||||||
|
"path": "system.serviceprocess.servicecontroller/10.0.14",
|
||||||
|
"hashPath": "system.serviceprocess.servicecontroller.10.0.14.nupkg.sha512"
|
||||||
|
},
|
||||||
|
"LDUninstaller.Core/2.8.0": {
|
||||||
|
"type": "project",
|
||||||
|
"serviceable": false,
|
||||||
|
"sha512": ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
LD Uninstaller v2.8.0/LDUninstaller.Launcher.dll
Normal file
BIN
LD Uninstaller v2.8.0/LDUninstaller.Launcher.exe
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
{
|
||||||
|
"runtimeOptions": {
|
||||||
|
"tfm": "net8.0",
|
||||||
|
"frameworks": [
|
||||||
|
{
|
||||||
|
"name": "Microsoft.NETCore.App",
|
||||||
|
"version": "8.0.0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Microsoft.WindowsDesktop.App",
|
||||||
|
"version": "8.0.0"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"configProperties": {
|
||||||
|
"System.Reflection.Metadata.MetadataUpdater.IsSupported": false,
|
||||||
|
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
132
LD Uninstaller v2.8.0/LDUninstaller.UI.deps.json
Normal file
|
|
@ -0,0 +1,132 @@
|
||||||
|
{
|
||||||
|
"runtimeTarget": {
|
||||||
|
"name": ".NETCoreApp,Version=v8.0",
|
||||||
|
"signature": ""
|
||||||
|
},
|
||||||
|
"compilationOptions": {},
|
||||||
|
"targets": {
|
||||||
|
".NETCoreApp,Version=v8.0": {
|
||||||
|
"LDUninstaller.UI/2.8.0": {
|
||||||
|
"dependencies": {
|
||||||
|
"LDUninstaller.Core": "2.8.0"
|
||||||
|
},
|
||||||
|
"runtime": {
|
||||||
|
"LDUninstaller.UI.dll": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"System.CodeDom/8.0.0": {},
|
||||||
|
"System.Diagnostics.EventLog/10.0.14": {
|
||||||
|
"runtime": {
|
||||||
|
"lib/net8.0/System.Diagnostics.EventLog.dll": {
|
||||||
|
"assemblyVersion": "10.0.0.0",
|
||||||
|
"fileVersion": "10.0.1426.52326"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"runtimeTargets": {
|
||||||
|
"runtimes/win/lib/net8.0/System.Diagnostics.EventLog.Messages.dll": {
|
||||||
|
"rid": "win",
|
||||||
|
"assetType": "runtime",
|
||||||
|
"assemblyVersion": "10.0.0.0",
|
||||||
|
"fileVersion": "0.0.0.0"
|
||||||
|
},
|
||||||
|
"runtimes/win/lib/net8.0/System.Diagnostics.EventLog.dll": {
|
||||||
|
"rid": "win",
|
||||||
|
"assetType": "runtime",
|
||||||
|
"assemblyVersion": "10.0.0.0",
|
||||||
|
"fileVersion": "10.0.1426.52326"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"System.Management/8.0.0": {
|
||||||
|
"dependencies": {
|
||||||
|
"System.CodeDom": "8.0.0"
|
||||||
|
},
|
||||||
|
"runtime": {
|
||||||
|
"lib/net8.0/System.Management.dll": {
|
||||||
|
"assemblyVersion": "8.0.0.0",
|
||||||
|
"fileVersion": "8.0.23.53103"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"runtimeTargets": {
|
||||||
|
"runtimes/win/lib/net8.0/System.Management.dll": {
|
||||||
|
"rid": "win",
|
||||||
|
"assetType": "runtime",
|
||||||
|
"assemblyVersion": "8.0.0.0",
|
||||||
|
"fileVersion": "8.0.23.53103"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"System.ServiceProcess.ServiceController/10.0.14": {
|
||||||
|
"dependencies": {
|
||||||
|
"System.Diagnostics.EventLog": "10.0.14"
|
||||||
|
},
|
||||||
|
"runtime": {
|
||||||
|
"lib/net8.0/System.ServiceProcess.ServiceController.dll": {
|
||||||
|
"assemblyVersion": "10.0.0.14",
|
||||||
|
"fileVersion": "10.0.1426.52326"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"runtimeTargets": {
|
||||||
|
"runtimes/win/lib/net8.0/System.ServiceProcess.ServiceController.dll": {
|
||||||
|
"rid": "win",
|
||||||
|
"assetType": "runtime",
|
||||||
|
"assemblyVersion": "10.0.0.14",
|
||||||
|
"fileVersion": "10.0.1426.52326"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"LDUninstaller.Core/2.8.0": {
|
||||||
|
"dependencies": {
|
||||||
|
"System.Management": "8.0.0",
|
||||||
|
"System.ServiceProcess.ServiceController": "10.0.14"
|
||||||
|
},
|
||||||
|
"runtime": {
|
||||||
|
"LDUninstaller.Core.dll": {
|
||||||
|
"assemblyVersion": "2.8.0",
|
||||||
|
"fileVersion": "2.8.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"libraries": {
|
||||||
|
"LDUninstaller.UI/2.8.0": {
|
||||||
|
"type": "project",
|
||||||
|
"serviceable": false,
|
||||||
|
"sha512": ""
|
||||||
|
},
|
||||||
|
"System.CodeDom/8.0.0": {
|
||||||
|
"type": "package",
|
||||||
|
"serviceable": true,
|
||||||
|
"sha512": "sha512-WTlRjL6KWIMr/pAaq3rYqh0TJlzpouaQ/W1eelssHgtlwHAH25jXTkUphTYx9HaIIf7XA6qs/0+YhtLEQRkJ+Q==",
|
||||||
|
"path": "system.codedom/8.0.0",
|
||||||
|
"hashPath": "system.codedom.8.0.0.nupkg.sha512"
|
||||||
|
},
|
||||||
|
"System.Diagnostics.EventLog/10.0.14": {
|
||||||
|
"type": "package",
|
||||||
|
"serviceable": true,
|
||||||
|
"sha512": "sha512-O/RzNwWoDzehkLlAG9hR8xooY5L41U7VUaYlcKvE3+FhHohBJqF10oLUzuv0v59VeJ62hv3uw9VoeX12zej7Sg==",
|
||||||
|
"path": "system.diagnostics.eventlog/10.0.14",
|
||||||
|
"hashPath": "system.diagnostics.eventlog.10.0.14.nupkg.sha512"
|
||||||
|
},
|
||||||
|
"System.Management/8.0.0": {
|
||||||
|
"type": "package",
|
||||||
|
"serviceable": true,
|
||||||
|
"sha512": "sha512-jrK22i5LRzxZCfGb+tGmke2VH7oE0DvcDlJ1HAKYU8cPmD8XnpUT0bYn2Gy98GEhGjtfbR/sxKTVb+dE770pfA==",
|
||||||
|
"path": "system.management/8.0.0",
|
||||||
|
"hashPath": "system.management.8.0.0.nupkg.sha512"
|
||||||
|
},
|
||||||
|
"System.ServiceProcess.ServiceController/10.0.14": {
|
||||||
|
"type": "package",
|
||||||
|
"serviceable": true,
|
||||||
|
"sha512": "sha512-riMCsgbGKGonluQzaRRrx5ney0QNkEmepNTrHD3QpqU/ICZpCJsyAWNi6JESTxqYkc+9kNQ55aZaH/n3xOjSlg==",
|
||||||
|
"path": "system.serviceprocess.servicecontroller/10.0.14",
|
||||||
|
"hashPath": "system.serviceprocess.servicecontroller.10.0.14.nupkg.sha512"
|
||||||
|
},
|
||||||
|
"LDUninstaller.Core/2.8.0": {
|
||||||
|
"type": "project",
|
||||||
|
"serviceable": false,
|
||||||
|
"sha512": ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
LD Uninstaller v2.8.0/LDUninstaller.UI.dll
Normal file
BIN
LD Uninstaller v2.8.0/LDUninstaller.UI.exe
Normal file
19
LD Uninstaller v2.8.0/LDUninstaller.UI.runtimeconfig.json
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
{
|
||||||
|
"runtimeOptions": {
|
||||||
|
"tfm": "net8.0",
|
||||||
|
"frameworks": [
|
||||||
|
{
|
||||||
|
"name": "Microsoft.NETCore.App",
|
||||||
|
"version": "8.0.0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Microsoft.WindowsDesktop.App",
|
||||||
|
"version": "8.0.0"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"configProperties": {
|
||||||
|
"System.Reflection.Metadata.MetadataUpdater.IsSupported": false,
|
||||||
|
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
LD Uninstaller v2.8.0/System.Diagnostics.EventLog.dll
Normal file
BIN
LD Uninstaller v2.8.0/System.Diagnostics.PerformanceCounter.dll
Normal file
BIN
LD Uninstaller v2.8.0/System.Drawing.Common.dll
Normal file
BIN
LD Uninstaller v2.8.0/System.Management.dll
Normal file
BIN
LD Uninstaller v2.8.0/app.ico
Normal file
|
After Width: | Height: | Size: 353 KiB |
96
README.md
|
|
@ -1,95 +1,7 @@
|
||||||
# LD Uninstaller (v2.8.0)
|
# Tauri + React + Typescript
|
||||||
**Resmi Web Sitesi ve İndirme:** [https://ttmadethat.shop/#ldapps](https://ttmadethat.shop/#ldapps)
|
|
||||||
|
|
||||||
**LD Uninstaller**, Bulk Crap Uninstaller (BCU) mimarisini temel alan; donanım hızlandırmalı modern **Windows 11 Fluent Dark** arayüzü, 20 katmanlı derin kalıntı temizleme motoru, Geri Dönüşüm Kutusu (Shell API) koruması, otomatik `.reg` yedekleme merkezi, çoklu disk analizi ve akıllı otomasyon ajanıyla güçlendirilmiş açık kaynaklı, profesyonel sistem yönetimi ve yazılım kaldırma çözümüdür.
|
This template should help get you started developing with Tauri, React and Typescript in Vite.
|
||||||
|
|
||||||
---
|
## Recommended IDE Setup
|
||||||
|
|
||||||
## ✨ Öne Çıkan Özellikler
|
- [VS Code](https://code.visualstudio.com/) + [Tauri](https://marketplace.visualstudio.com/items?itemName=tauri-apps.tauri-vscode) + [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer)
|
||||||
|
|
||||||
### 1. 🧹 20 Katmanlı Derin Kalıntı ve Artık Temizleme Motoru (Leftover Cleaner)
|
|
||||||
Kaldırma işlemi bittiği anda otomatik olarak açılan kalıntı temizleme ekranı, sistemde hiçbir yazılımın tek bir izini dahi bırakmaz:
|
|
||||||
1. **Ana Kurulum Dizinleri:** Kaldırıcı sonrası silinmeyen klasörler.
|
|
||||||
2. **Kullanıcı Verileri:** `%AppData%`, `%LocalAppData%`, `LocalLow`, `ProgramData`, `Saved Games` (Belgelerim / Documents otomatik silme riskine karşı korunmuştur).
|
|
||||||
3. **Kullanıcı Gizli Dizinleri (Dot-Folders):** Modern yazılımların `%USERPROFILE%` altındaki `.appname`, `.config`, `.cache` klasörleri.
|
|
||||||
4. **Ortak Kütüphaneler (Common Files):** `Common Files` altında terk edilen DLL ve bileşenler.
|
|
||||||
5. **Geçici Dosyalar (Temp):** `%TEMP%` ve `%LOCALAPPDATA%\Temp` kurulum/kaldırma artıkları.
|
|
||||||
6. **Çoklu Sürücüler & Boş Dizinler:** İkincil disklerdeki (`D:\`, `E:\`) oyun/yazılım artıkları ve içi boş kalan yayıncı klasörleri.
|
|
||||||
7. **Yazılım Kayıt Defteri Anahtarları:** `HKLM`, `HKCU` ve `WOW6432Node` Software dalları (silinmeden önce otomatik `.reg` yedeği alınır).
|
|
||||||
8. **Windows Hizmetleri & Sürücüler:** Yalnızca `ImagePath` hedefi kaldırılan uygulamanın `InstallLocation` klasörü altındaysa tespit edilir, kayıt defteri yedeklenir ve `sc stop` + `sc delete` ile kaldırılır.
|
|
||||||
9. **Görev Zamanlayıcı (Scheduled Tasks):** `C:\Windows\System32\Tasks` içindeki güncelleyici ve otomatik görevler taranarak temizlenir.
|
|
||||||
10. **Uygulama Başlatma Yolları (App Paths):** `App Paths` altındaki yetim kayıtlar.
|
|
||||||
11. **Başlangıç Kayıt Defteri Değerleri (Run, RunOnce & Task Scheduler):** Otomatik çalıştırma anahtarlarındaki ilgili değerler.
|
|
||||||
12. **Gezgin Sağ Tık & COM Bileşenleri:** `ContextMenuHandlers`, `Approved` shell uzantıları ve ilişkili `CLSID` anahtarları.
|
|
||||||
13. **Windows Shell MuiCache:** MuiCache önbellek ve simge kayıtları.
|
|
||||||
14. **Uyumluluk Katmanı (AppCompatFlags):** Compatibility Assistant ve Layers geçmişi.
|
|
||||||
15. **Windows Güvenlik Duvarı:** `FirewallRules` altındaki ölü kurallar.
|
|
||||||
16. **Windows Prefetch:** `C:\Windows\Prefetch` yürütme önbellek dosyaları.
|
|
||||||
17. **Hata Dökümleri:** `CrashDumps` ve WER arşiv raporları.
|
|
||||||
18. **UserAssist:** ROT13 ile şifrelenen çalıştırma geçmişi.
|
|
||||||
19. **Kısayollar & Son Belgeler:** Masaüstü, Başlat Menüsü, Startup ve Recent kısayolları.
|
|
||||||
20. **Windows Installer (MSI) & Uninstall Kayıtları:** MSI Product/UserData ve Registry Uninstall girdileri.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### 2. 🛡️ Veri Güvenliği ve Geri Alma Garantisi
|
|
||||||
- **Windows Geri Dönüşüm Kutusu:** Tüm dosya ve dizin silme işlemleri `SHFileOperation` Win32 Shell API üzerinden Geri Dönüşüm Kutusu'na gönderilir (`FOF_ALLOWUNDO`). Kalıcı veri kaybı yaşanmaz.
|
|
||||||
- **Otomatik Kayıt Defteri Yedekleri:** Temizlenen her kayıt anahtarı silinmeden önce `%LocalAppData%\LDUninstaller\Backups` klasörüne standart `.reg` yedeği olarak aktarılır (32-bit anahtarlar için `/reg:32` kullanılır).
|
|
||||||
- **Yedekleme ve Geri Yükleme Merkezi:** Tek tıkla önceki yedekleri inceleme ve Windows Kayıt Defteri'ne geri aktarma (`reg import`).
|
|
||||||
- **Kullanıcı Koruma Listesi (Exclusion List):** Kalıntı ekranında veya araçlar menüsünde "Korumaya Al (Bir daha önerme)" seçeneği ile klasör veya kayıt defteri anahtarlarını kalıcı beyaz listeye alma (`%LocalAppData%\LDUninstaller\exclusions.json`).
|
|
||||||
- **Dinamik Sistem Kara Listesi (SafetyBlacklist):** `C:\Windows`, `System32`, `Program Files\WindowsApps`, kullanıcı profil kök dizinleri ve OneDrive kökleri hiçbir koşulda kalıntı olarak silinemez.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### 3. 💥 Yeni Özellikler (v2.8.0)
|
|
||||||
- **Zorla Kaldır (Force Uninstall):** Kaldırıcısı eksik, bozuk veya çalışmayan uygulamalar için doğrudan derin disk ve kayıt defteri kalıntı taraması.
|
|
||||||
- **Bozuk Girdi Temizleyici:** Uninstall yürütülebilir dosyası veya klasörü diskte artık var olmayan hayalet (ghost) kayıt defteri girdilerini tek tıkla bulup temizleme.
|
|
||||||
- **Winget Entegrasyonu:** Yüklü uygulamaları yeni bir bilgisayara taşımak için tek tıkla toplu Winget kurulum scripti (`.bat`) üretme.
|
|
||||||
- **Explorer Sağ Tık Menüsü Entegrasyonu:** `.exe` ve kısayol (`.lnk`) dosyalarına sağ tıklandığında "LD Uninstaller ile Kaldır" seçeneği.
|
|
||||||
- **90+ Gün Kullanılmayanlar Filtresi:** Bilgisayarda uzun süredir açılmayan veya güncellenmeyen yazılımları filtreleyerek disk alanı kazanımı sağlama.
|
|
||||||
- **Temizlik Raporu ve Log Görüntüleyici:** Yapılan her işlem için şık HTML raporu üretme ve arayüz içinden `trace.log` dosyasını gerçek zamanlı inceleme.
|
|
||||||
- **Kayıt Defterinde Doğrudan Aç:** Uygulamanın kayıt defteri anahtarını Regedit içinde tam konumunda açma (`LastKey` desteği).
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### 4. ⚡ Ultra Akıcı Performans & Sıfır Takılma
|
|
||||||
- **Gecikmesiz Arama (Debounced Search):** Arama çubuğuna yazarken UI thread'i dondurmayan 160ms debounce filtreleme.
|
|
||||||
- **Piksel Düzeyinde Pürüzsüz Kaydırma:** DataGrid sanallaştırması `VirtualizingPanel.ScrollUnit="Pixel"` ve `Recycling` modlarıyla 120 FPS akıcılık sağlar.
|
|
||||||
- **Squarified Treemap:** Vektörel çizim elemanları, dondurulmuş Direct3D fırçaları ve statik tipografiler ile anında disk boyutu haritalaması.
|
|
||||||
- **Tekil Örnek (Single-Instance):** `Global\LDUninstaller_SingleInstance_Mutex` ile birden fazla pencerenin aynı anda açılarak çakışması engellenir.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### 5. 🧪 Kapsamlı Birim Testleri (Unit Tests)
|
|
||||||
`tests/LDUninstaller.Tests` altında xUnit test paketi mevcuttur:
|
|
||||||
- `SafetyBlacklistTests`: Dinamik Windows, Documents, OneDrive ve registry anahtar koruma doğrulamaları.
|
|
||||||
- `JunkManagerTests`: Token ayrıştırma, stop-words filtresi (`Git` vs `GitHub`) ve sınır kuralları.
|
|
||||||
- `Sift4Tests`: Hızlı normalize benzerlik algoritması doğrulaması.
|
|
||||||
|
|
||||||
```powershell
|
|
||||||
dotnet test
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 💻 Başlatma ve Kullanım
|
|
||||||
|
|
||||||
```powershell
|
|
||||||
# Yönetici yetkili başlatıcı:
|
|
||||||
.\LDUninstaller.Launcher.exe
|
|
||||||
|
|
||||||
# veya doğrudan arayüz:
|
|
||||||
.\LDUninstaller.UI.exe
|
|
||||||
|
|
||||||
# SysAdmin ve Otomasyon için CLI aracı:
|
|
||||||
.\LDUninstaller.CLI.exe list /F=table
|
|
||||||
.\LDUninstaller.CLI.exe export software_inventory.json /F=json
|
|
||||||
.\LDUninstaller.CLI.exe uninstall "AppName" /Q /U /J=VeryGood
|
|
||||||
.\LDUninstaller.CLI.exe debloat --list
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 📄 Lisans
|
|
||||||
|
|
||||||
Bu proje [MIT Lisansı](LICENSE) kapsamında lisanslanmıştır. Detaylar için [`LICENSE`](LICENSE) dosyasına göz atabilirsiniz.
|
|
||||||
|
|
|
||||||
3
bağlan.bat
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
@echo off
|
||||||
|
ssh -i "%USERPROFILE%\.ssh\id_ed25519" root@116.202.14.171
|
||||||
|
pause
|
||||||
14
index.html
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<title>Tauri + React + Typescript</title>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div id="root"></div>
|
||||||
|
<script type="module" src="/src/main.tsx"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
3140
package-lock.json
generated
Normal file
34
package.json
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
{
|
||||||
|
"name": "ld-uninstaller",
|
||||||
|
"private": true,
|
||||||
|
"version": "3.0.0",
|
||||||
|
"type": "module",
|
||||||
|
"scripts": {
|
||||||
|
"dev": "vite",
|
||||||
|
"build": "tsc && vite build",
|
||||||
|
"preview": "vite preview",
|
||||||
|
"tauri": "tauri"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@tauri-apps/api": "^2.2.0",
|
||||||
|
"@tauri-apps/plugin-opener": "^2.2.5",
|
||||||
|
"clsx": "^2.1.1",
|
||||||
|
"lucide-react": "^0.468.0",
|
||||||
|
"react": "^18.3.1",
|
||||||
|
"react-dom": "^18.3.1",
|
||||||
|
"tailwind-merge": "^2.5.5",
|
||||||
|
"zustand": "^5.0.2"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@tauri-apps/cli": "^2.2.0",
|
||||||
|
"@types/node": "^22.10.1",
|
||||||
|
"@types/react": "^18.3.12",
|
||||||
|
"@types/react-dom": "^18.3.1",
|
||||||
|
"@vitejs/plugin-react": "^4.3.4",
|
||||||
|
"autoprefixer": "^10.4.20",
|
||||||
|
"postcss": "^8.4.49",
|
||||||
|
"tailwindcss": "^3.4.16",
|
||||||
|
"typescript": "^5.7.2",
|
||||||
|
"vite": "^6.0.3"
|
||||||
|
}
|
||||||
|
}
|
||||||
6
postcss.config.js
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
export default {
|
||||||
|
plugins: {
|
||||||
|
tailwindcss: {},
|
||||||
|
autoprefixer: {},
|
||||||
|
},
|
||||||
|
}
|
||||||
6
public/tauri.svg
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
<svg width="206" height="231" viewBox="0 0 206 231" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M143.143 84C143.143 96.1503 133.293 106 121.143 106C108.992 106 99.1426 96.1503 99.1426 84C99.1426 71.8497 108.992 62 121.143 62C133.293 62 143.143 71.8497 143.143 84Z" fill="#FFC131"/>
|
||||||
|
<ellipse cx="84.1426" cy="147" rx="22" ry="22" transform="rotate(180 84.1426 147)" fill="#24C8DB"/>
|
||||||
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M166.738 154.548C157.86 160.286 148.023 164.269 137.757 166.341C139.858 160.282 141 153.774 141 147C141 144.543 140.85 142.121 140.558 139.743C144.975 138.204 149.215 136.139 153.183 133.575C162.73 127.404 170.292 118.608 174.961 108.244C179.63 97.8797 181.207 86.3876 179.502 75.1487C177.798 63.9098 172.884 53.4021 165.352 44.8883C157.82 36.3744 147.99 30.2165 137.042 27.1546C126.095 24.0926 114.496 24.2568 103.64 27.6274C92.7839 30.998 83.1319 37.4317 75.8437 46.1553C74.9102 47.2727 74.0206 48.4216 73.176 49.5993C61.9292 50.8488 51.0363 54.0318 40.9629 58.9556C44.2417 48.4586 49.5653 38.6591 56.679 30.1442C67.0505 17.7298 80.7861 8.57426 96.2354 3.77762C111.685 -1.01901 128.19 -1.25267 143.769 3.10474C159.348 7.46215 173.337 16.2252 184.056 28.3411C194.775 40.457 201.767 55.4101 204.193 71.404C206.619 87.3978 204.374 103.752 197.73 118.501C191.086 133.25 180.324 145.767 166.738 154.548ZM41.9631 74.275L62.5557 76.8042C63.0459 72.813 63.9401 68.9018 65.2138 65.1274C57.0465 67.0016 49.2088 70.087 41.9631 74.275Z" fill="#FFC131"/>
|
||||||
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M38.4045 76.4519C47.3493 70.6709 57.2677 66.6712 67.6171 64.6132C65.2774 70.9669 64 77.8343 64 85.0001C64 87.1434 64.1143 89.26 64.3371 91.3442C60.0093 92.8732 55.8533 94.9092 51.9599 97.4256C42.4128 103.596 34.8505 112.392 30.1816 122.756C25.5126 133.12 23.9357 144.612 25.6403 155.851C27.3449 167.09 32.2584 177.598 39.7906 186.112C47.3227 194.626 57.153 200.784 68.1003 203.846C79.0476 206.907 90.6462 206.743 101.502 203.373C112.359 200.002 122.011 193.568 129.299 184.845C130.237 183.722 131.131 182.567 131.979 181.383C143.235 180.114 154.132 176.91 164.205 171.962C160.929 182.49 155.596 192.319 148.464 200.856C138.092 213.27 124.357 222.426 108.907 227.222C93.458 232.019 76.9524 232.253 61.3736 227.895C45.7948 223.538 31.8055 214.775 21.0867 202.659C10.3679 190.543 3.37557 175.59 0.949823 159.596C-1.47592 143.602 0.768139 127.248 7.41237 112.499C14.0566 97.7497 24.8183 85.2327 38.4045 76.4519ZM163.062 156.711L163.062 156.711C162.954 156.773 162.846 156.835 162.738 156.897C162.846 156.835 162.954 156.773 163.062 156.711Z" fill="#24C8DB"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 2.5 KiB |
1
public/vite.svg
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
||||||
|
After Width: | Height: | Size: 1.5 KiB |
2
src-tauri/.cargo/config.toml
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
[build]
|
||||||
|
target-dir = "C:/Users/lildosto/ld_target"
|
||||||
7
src-tauri/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
# Generated by Cargo
|
||||||
|
# will have compiled files and executables
|
||||||
|
/target/
|
||||||
|
|
||||||
|
# Generated by Tauri
|
||||||
|
# will have schema files for capabilities auto-completion
|
||||||
|
/gen/schemas
|
||||||
5776
src-tauri/Cargo.lock
generated
Normal file
45
src-tauri/Cargo.toml
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
[package]
|
||||||
|
name = "ld_uninstaller"
|
||||||
|
version = "3.0.0"
|
||||||
|
description = "LD Uninstaller - Modern High Performance Windows Uninstaller & System Cleaner"
|
||||||
|
authors = ["LD Team"]
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
|
[lib]
|
||||||
|
name = "ld_uninstaller_lib"
|
||||||
|
crate-type = ["rlib"]
|
||||||
|
|
||||||
|
[build-dependencies]
|
||||||
|
tauri-build = { version = "2", features = [] }
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
tauri = { version = "2", features = [] }
|
||||||
|
tauri-plugin-opener = "2"
|
||||||
|
serde = { version = "1", features = ["derive"] }
|
||||||
|
serde_json = "1"
|
||||||
|
thiserror = "2"
|
||||||
|
winreg = "0.52"
|
||||||
|
tokio = { version = "1", features = ["full"] }
|
||||||
|
trash = "5.2"
|
||||||
|
sysinfo = "0.32"
|
||||||
|
walkdir = "2.5"
|
||||||
|
regex = "1.11"
|
||||||
|
reqwest = { version = "0.12", features = ["json"] }
|
||||||
|
sha2 = "0.10"
|
||||||
|
hex = "0.4"
|
||||||
|
chrono = { version = "0.4", features = ["serde"] }
|
||||||
|
csv = "1.3"
|
||||||
|
windows = { version = "0.58", features = [
|
||||||
|
"Win32_Foundation",
|
||||||
|
"Win32_System_RestartManager",
|
||||||
|
"Win32_System_Threading",
|
||||||
|
"Win32_System_Diagnostics_ToolHelp",
|
||||||
|
"Win32_Storage_FileSystem"
|
||||||
|
] }
|
||||||
|
|
||||||
|
[profile.release]
|
||||||
|
codegen-units = 1
|
||||||
|
lto = true
|
||||||
|
opt-level = 3
|
||||||
|
panic = "abort"
|
||||||
|
strip = true
|
||||||
3
src-tauri/build.rs
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
fn main() {
|
||||||
|
tauri_build::build()
|
||||||
|
}
|
||||||
10
src-tauri/capabilities/default.json
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"$schema": "../gen/schemas/desktop-schema.json",
|
||||||
|
"identifier": "default",
|
||||||
|
"description": "Capability for the main window",
|
||||||
|
"windows": ["main"],
|
||||||
|
"permissions": [
|
||||||
|
"core:default",
|
||||||
|
"opener:default"
|
||||||
|
]
|
||||||
|
}
|
||||||
BIN
src-tauri/icons/128x128.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
src-tauri/icons/128x128@2x.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
src-tauri/icons/32x32.png
Normal file
|
After Width: | Height: | Size: 567 B |
BIN
src-tauri/icons/Square107x107Logo.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
src-tauri/icons/Square142x142Logo.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
src-tauri/icons/Square150x150Logo.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
src-tauri/icons/Square284x284Logo.png
Normal file
|
After Width: | Height: | Size: 3 KiB |
BIN
src-tauri/icons/Square30x30Logo.png
Normal file
|
After Width: | Height: | Size: 536 B |
BIN
src-tauri/icons/Square310x310Logo.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
src-tauri/icons/Square44x44Logo.png
Normal file
|
After Width: | Height: | Size: 777 B |
BIN
src-tauri/icons/Square71x71Logo.png
Normal file
|
After Width: | Height: | Size: 1,020 B |
BIN
src-tauri/icons/Square89x89Logo.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
src-tauri/icons/StoreLogo.png
Normal file
|
After Width: | Height: | Size: 848 B |
BIN
src-tauri/icons/icon.icns
Normal file
BIN
src-tauri/icons/icon.ico
Normal file
|
After Width: | Height: | Size: 37 KiB |
BIN
src-tauri/icons/icon.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
52
src-tauri/src/commands/app_commands.rs
Normal file
|
|
@ -0,0 +1,52 @@
|
||||||
|
use crate::error::{AppError, AppResult};
|
||||||
|
use crate::models::ApplicationEntry;
|
||||||
|
use crate::services::{DiscoveryService, UninstallerService};
|
||||||
|
use crate::state::AppState;
|
||||||
|
use tauri::State;
|
||||||
|
|
||||||
|
#[tauri::command]
|
||||||
|
pub async fn get_installed_apps(state: State<'_, AppState>) -> AppResult<Vec<ApplicationEntry>> {
|
||||||
|
let apps = DiscoveryService::scan_all_applications()?;
|
||||||
|
let mut cache = state.cached_apps.write().await;
|
||||||
|
*cache = apps.clone();
|
||||||
|
Ok(apps)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[tauri::command]
|
||||||
|
pub async fn uninstall_application(
|
||||||
|
app_id: String,
|
||||||
|
quiet: bool,
|
||||||
|
state: State<'_, AppState>,
|
||||||
|
) -> AppResult<bool> {
|
||||||
|
let cache = state.cached_apps.read().await;
|
||||||
|
let app = cache
|
||||||
|
.iter()
|
||||||
|
.find(|a| a.id == app_id)
|
||||||
|
.ok_or_else(|| AppError::NotFound(format!("Uygulama bulunamadı (ID: {})", app_id)))?;
|
||||||
|
|
||||||
|
UninstallerService::uninstall(app, quiet)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[tauri::command]
|
||||||
|
pub async fn export_apps_csv(file_path: String, state: State<'_, AppState>) -> AppResult<bool> {
|
||||||
|
let cache = state.cached_apps.read().await;
|
||||||
|
let mut wtr = csv::Writer::from_path(&file_path)
|
||||||
|
.map_err(|e| AppError::Io(std::io::Error::other(e)))?;
|
||||||
|
|
||||||
|
wtr.write_record(["Ad", "Sürüm", "Yayımcı", "Yükleme Konumu", "Boyut (KB)", "Kaldırma Komutu"])
|
||||||
|
.map_err(|e| AppError::Io(std::io::Error::other(e)))?;
|
||||||
|
|
||||||
|
for app in cache.iter() {
|
||||||
|
wtr.write_record([
|
||||||
|
&app.display_name,
|
||||||
|
&app.display_version,
|
||||||
|
&app.publisher,
|
||||||
|
&app.install_location,
|
||||||
|
&app.estimated_size_kb.to_string(),
|
||||||
|
&app.uninstall_string,
|
||||||
|
]).map_err(|e| AppError::Io(std::io::Error::other(e)))?;
|
||||||
|
}
|
||||||
|
|
||||||
|
wtr.flush().map_err(|e| AppError::Io(std::io::Error::other(e)))?;
|
||||||
|
Ok(true)
|
||||||
|
}
|
||||||
45
src-tauri/src/commands/junk_commands.rs
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
use crate::error::AppResult;
|
||||||
|
use crate::models::{CleanReport, JunkItem, JunkScanResult};
|
||||||
|
use crate::services::JunkCleanerService;
|
||||||
|
use crate::state::AppState;
|
||||||
|
use tauri::State;
|
||||||
|
|
||||||
|
#[tauri::command]
|
||||||
|
pub async fn scan_app_leftovers(
|
||||||
|
app_name: String,
|
||||||
|
publisher: String,
|
||||||
|
install_location: String,
|
||||||
|
state: State<'_, AppState>,
|
||||||
|
) -> AppResult<JunkScanResult> {
|
||||||
|
JunkCleanerService::scan_leftovers(&app_name, &publisher, &install_location, &state)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[tauri::command]
|
||||||
|
pub async fn clean_leftovers(
|
||||||
|
items: Vec<JunkItem>,
|
||||||
|
use_recycle_bin: bool,
|
||||||
|
state: State<'_, AppState>,
|
||||||
|
) -> AppResult<CleanReport> {
|
||||||
|
JunkCleanerService::clean_selected_items(&items, use_recycle_bin, &state)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[tauri::command]
|
||||||
|
pub async fn get_exclusions(state: State<'_, AppState>) -> AppResult<Vec<String>> {
|
||||||
|
let list = match state.exclusions.read() {
|
||||||
|
Ok(guard) => guard.clone(),
|
||||||
|
Err(_) => Vec::new(),
|
||||||
|
};
|
||||||
|
Ok(list)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[tauri::command]
|
||||||
|
pub async fn add_exclusion(path_or_key: String, state: State<'_, AppState>) -> AppResult<bool> {
|
||||||
|
state.add_exclusion(path_or_key)?;
|
||||||
|
Ok(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[tauri::command]
|
||||||
|
pub async fn remove_exclusion(path_or_key: String, state: State<'_, AppState>) -> AppResult<bool> {
|
||||||
|
state.remove_exclusion(&path_or_key)?;
|
||||||
|
Ok(true)
|
||||||
|
}
|
||||||
11
src-tauri/src/commands/mod.rs
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
pub mod app_commands;
|
||||||
|
pub mod junk_commands;
|
||||||
|
pub mod system_commands;
|
||||||
|
pub mod unlocker_commands;
|
||||||
|
pub mod update_commands;
|
||||||
|
|
||||||
|
pub use app_commands::*;
|
||||||
|
pub use junk_commands::*;
|
||||||
|
pub use system_commands::*;
|
||||||
|
pub use unlocker_commands::*;
|
||||||
|
pub use update_commands::*;
|
||||||
51
src-tauri/src/commands/system_commands.rs
Normal file
|
|
@ -0,0 +1,51 @@
|
||||||
|
use crate::error::AppResult;
|
||||||
|
use crate::models::{BackupEntry, DrivePartition, StartupItem, SystemTweak, TreemapItem};
|
||||||
|
use crate::services::{BackupService, StartupService, TreemapService, TweaksService};
|
||||||
|
use crate::state::AppState;
|
||||||
|
use tauri::State;
|
||||||
|
|
||||||
|
#[tauri::command]
|
||||||
|
pub async fn get_startup_items() -> AppResult<Vec<StartupItem>> {
|
||||||
|
StartupService::get_startup_items()
|
||||||
|
}
|
||||||
|
|
||||||
|
#[tauri::command]
|
||||||
|
pub async fn toggle_startup_item(id: String, enable: bool) -> AppResult<bool> {
|
||||||
|
StartupService::toggle_startup_item(&id, enable)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[tauri::command]
|
||||||
|
pub async fn get_tweaks() -> AppResult<Vec<SystemTweak>> {
|
||||||
|
TweaksService::get_available_tweaks()
|
||||||
|
}
|
||||||
|
|
||||||
|
#[tauri::command]
|
||||||
|
pub async fn toggle_tweak(id: String, enable: bool) -> AppResult<bool> {
|
||||||
|
TweaksService::apply_tweak(&id, enable)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[tauri::command]
|
||||||
|
pub async fn get_disk_partitions() -> AppResult<Vec<DrivePartition>> {
|
||||||
|
TreemapService::get_disk_partitions()
|
||||||
|
}
|
||||||
|
|
||||||
|
#[tauri::command]
|
||||||
|
pub async fn get_treemap_data(state: State<'_, AppState>) -> AppResult<Vec<TreemapItem>> {
|
||||||
|
let cache = state.cached_apps.read().await;
|
||||||
|
TreemapService::generate_apps_treemap(&cache)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[tauri::command]
|
||||||
|
pub async fn list_backups(state: State<'_, AppState>) -> AppResult<Vec<BackupEntry>> {
|
||||||
|
BackupService::list_backups(&state)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[tauri::command]
|
||||||
|
pub async fn restore_backup(file_path: String) -> AppResult<bool> {
|
||||||
|
BackupService::restore_backup(&file_path)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[tauri::command]
|
||||||
|
pub async fn delete_backup(file_path: String) -> AppResult<bool> {
|
||||||
|
BackupService::delete_backup(&file_path)
|
||||||
|
}
|
||||||
16
src-tauri/src/commands/unlocker_commands.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
use crate::error::AppResult;
|
||||||
|
use crate::services::FileUnlockerService;
|
||||||
|
|
||||||
|
#[tauri::command]
|
||||||
|
pub async fn force_unlock_and_shred(path: String) -> AppResult<bool> {
|
||||||
|
tokio::task::spawn_blocking(move || {
|
||||||
|
FileUnlockerService::force_unlock_and_delete(&path)
|
||||||
|
}).await.map_err(|e| crate::error::AppError::Execution(e.to_string()))?
|
||||||
|
}
|
||||||
|
|
||||||
|
#[tauri::command]
|
||||||
|
pub async fn get_locking_processes(path: String) -> AppResult<Vec<u32>> {
|
||||||
|
tokio::task::spawn_blocking(move || {
|
||||||
|
FileUnlockerService::terminate_locking_processes(&path)
|
||||||
|
}).await.map_err(|e| crate::error::AppError::Execution(e.to_string()))?
|
||||||
|
}
|
||||||
13
src-tauri/src/commands/update_commands.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
use crate::error::AppResult;
|
||||||
|
use crate::models::UpdateCheckResult;
|
||||||
|
use crate::services::UpdateService;
|
||||||
|
|
||||||
|
#[tauri::command]
|
||||||
|
pub async fn check_for_updates() -> AppResult<UpdateCheckResult> {
|
||||||
|
UpdateService::check_for_updates().await
|
||||||
|
}
|
||||||
|
|
||||||
|
#[tauri::command]
|
||||||
|
pub async fn install_update(download_url: String, sha256: String) -> AppResult<bool> {
|
||||||
|
UpdateService::download_and_install_update(&download_url, &sha256).await
|
||||||
|
}
|
||||||
46
src-tauri/src/error.rs
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
use serde::Serialize;
|
||||||
|
use thiserror::Error;
|
||||||
|
|
||||||
|
#[derive(Error, Debug)]
|
||||||
|
pub enum AppError {
|
||||||
|
#[error("I/O Hatası: {0}")]
|
||||||
|
Io(#[from] std::io::Error),
|
||||||
|
|
||||||
|
#[error("Kayıt Defteri Hatası: {0}")]
|
||||||
|
Registry(String),
|
||||||
|
|
||||||
|
#[error("Serileştirme Hatası: {0}")]
|
||||||
|
Json(#[from] serde_json::Error),
|
||||||
|
|
||||||
|
#[error("Ağ Hatası: {0}")]
|
||||||
|
Network(String),
|
||||||
|
|
||||||
|
#[error("Yeniden Başlatma Yöneticisi (Restart Manager) Hatası: {0}")]
|
||||||
|
RestartManager(String),
|
||||||
|
|
||||||
|
#[error("Güvenlik Koruması Engelledi: {0}")]
|
||||||
|
Security(String),
|
||||||
|
|
||||||
|
#[error("Öğe Bulunamadı: {0}")]
|
||||||
|
NotFound(String),
|
||||||
|
|
||||||
|
#[error("Çalıştırma Hatası: {0}")]
|
||||||
|
Execution(String),
|
||||||
|
|
||||||
|
#[error("Doğrulama Hatası: {0}")]
|
||||||
|
Validation(String),
|
||||||
|
|
||||||
|
#[error("Genel Sistem Hatası: {0}")]
|
||||||
|
Custom(String),
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Serialize for AppError {
|
||||||
|
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
|
||||||
|
where
|
||||||
|
S: serde::Serializer,
|
||||||
|
{
|
||||||
|
serializer.serialize_str(&self.to_string())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub type AppResult<T> = Result<T, AppError>;
|
||||||
40
src-tauri/src/lib.rs
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
pub mod commands;
|
||||||
|
pub mod error;
|
||||||
|
pub mod models;
|
||||||
|
pub mod services;
|
||||||
|
pub mod state;
|
||||||
|
|
||||||
|
use commands::*;
|
||||||
|
use state::AppState;
|
||||||
|
|
||||||
|
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||||
|
pub fn run() {
|
||||||
|
tauri::Builder::default()
|
||||||
|
.plugin(tauri_plugin_opener::init())
|
||||||
|
.manage(AppState::new())
|
||||||
|
.invoke_handler(tauri::generate_handler![
|
||||||
|
get_installed_apps,
|
||||||
|
uninstall_application,
|
||||||
|
export_apps_csv,
|
||||||
|
scan_app_leftovers,
|
||||||
|
clean_leftovers,
|
||||||
|
get_exclusions,
|
||||||
|
add_exclusion,
|
||||||
|
remove_exclusion,
|
||||||
|
force_unlock_and_shred,
|
||||||
|
get_locking_processes,
|
||||||
|
get_startup_items,
|
||||||
|
toggle_startup_item,
|
||||||
|
get_tweaks,
|
||||||
|
toggle_tweak,
|
||||||
|
get_disk_partitions,
|
||||||
|
get_treemap_data,
|
||||||
|
list_backups,
|
||||||
|
restore_backup,
|
||||||
|
delete_backup,
|
||||||
|
check_for_updates,
|
||||||
|
install_update,
|
||||||
|
])
|
||||||
|
.run(tauri::generate_context!())
|
||||||
|
.expect("Tauri uygulaması başlatılırken hata oluştu");
|
||||||
|
}
|
||||||
5
src-tauri/src/main.rs
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
ld_uninstaller_lib::run();
|
||||||
|
}
|
||||||
51
src-tauri/src/models/app.rs
Normal file
|
|
@ -0,0 +1,51 @@
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
|
||||||
|
pub enum ApplicationKind {
|
||||||
|
Registry,
|
||||||
|
StoreApp,
|
||||||
|
Steam,
|
||||||
|
Winget,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
|
||||||
|
pub enum UninstallerKind {
|
||||||
|
Msi,
|
||||||
|
InnoSetup,
|
||||||
|
Nsis,
|
||||||
|
InstallShield,
|
||||||
|
Store,
|
||||||
|
Steam,
|
||||||
|
Custom,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
|
pub struct ApplicationEntry {
|
||||||
|
pub id: String,
|
||||||
|
pub display_name: String,
|
||||||
|
pub display_version: String,
|
||||||
|
pub publisher: String,
|
||||||
|
pub install_location: String,
|
||||||
|
pub uninstall_string: String,
|
||||||
|
pub quiet_uninstall_string: String,
|
||||||
|
pub install_date: String,
|
||||||
|
pub estimated_size_kb: u64,
|
||||||
|
pub is_system_component: bool,
|
||||||
|
pub is_64bit: bool,
|
||||||
|
pub kind: ApplicationKind,
|
||||||
|
pub uninstaller_kind: UninstallerKind,
|
||||||
|
pub registry_key_path: Option<String>,
|
||||||
|
pub display_icon: Option<String>,
|
||||||
|
pub url_info_about: Option<String>,
|
||||||
|
pub help_link: Option<String>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
|
pub struct UninstallProgressEvent {
|
||||||
|
pub app_id: String,
|
||||||
|
pub app_name: String,
|
||||||
|
pub status: String,
|
||||||
|
pub percentage: f32,
|
||||||
|
pub is_finished: bool,
|
||||||
|
pub error_message: Option<String>,
|
||||||
|
}
|
||||||
11
src-tauri/src/models/backup.rs
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
|
pub struct BackupEntry {
|
||||||
|
pub id: String,
|
||||||
|
pub file_name: String,
|
||||||
|
pub file_path: String,
|
||||||
|
pub created_at: String,
|
||||||
|
pub size_bytes: u64,
|
||||||
|
pub description: String,
|
||||||
|
}
|
||||||
46
src-tauri/src/models/junk.rs
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
|
||||||
|
pub enum JunkType {
|
||||||
|
File,
|
||||||
|
Directory,
|
||||||
|
RegistryKey,
|
||||||
|
RegistryValue,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
|
||||||
|
pub enum ConfidenceLevel {
|
||||||
|
Bad = 0,
|
||||||
|
Low = 1,
|
||||||
|
Medium = 2,
|
||||||
|
High = 3,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
|
pub struct JunkItem {
|
||||||
|
pub id: String,
|
||||||
|
pub item_type: JunkType,
|
||||||
|
pub path: String,
|
||||||
|
pub confidence: ConfidenceLevel,
|
||||||
|
pub reason: String,
|
||||||
|
pub size_bytes: u64,
|
||||||
|
pub is_selected: bool,
|
||||||
|
pub app_id: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
|
pub struct JunkScanResult {
|
||||||
|
pub items: Vec<JunkItem>,
|
||||||
|
pub total_size_bytes: u64,
|
||||||
|
pub total_files: usize,
|
||||||
|
pub total_dirs: usize,
|
||||||
|
pub total_registry_entries: usize,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
|
pub struct CleanReport {
|
||||||
|
pub deleted_items_count: usize,
|
||||||
|
pub freed_bytes: u64,
|
||||||
|
pub backup_file_path: Option<String>,
|
||||||
|
pub errors: Vec<String>,
|
||||||
|
}
|
||||||
15
src-tauri/src/models/mod.rs
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
pub mod app;
|
||||||
|
pub mod backup;
|
||||||
|
pub mod junk;
|
||||||
|
pub mod startup;
|
||||||
|
pub mod treemap;
|
||||||
|
pub mod tweak;
|
||||||
|
pub mod update;
|
||||||
|
|
||||||
|
pub use app::*;
|
||||||
|
pub use backup::*;
|
||||||
|
pub use junk::*;
|
||||||
|
pub use startup::*;
|
||||||
|
pub use treemap::*;
|
||||||
|
pub use tweak::*;
|
||||||
|
pub use update::*;
|
||||||
20
src-tauri/src/models/startup.rs
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
|
||||||
|
pub enum StartupLocation {
|
||||||
|
RegistryCurrentUser,
|
||||||
|
RegistryLocalMachine,
|
||||||
|
UserStartupFolder,
|
||||||
|
CommonStartupFolder,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
|
pub struct StartupItem {
|
||||||
|
pub id: String,
|
||||||
|
pub name: String,
|
||||||
|
pub command: String,
|
||||||
|
pub location: StartupLocation,
|
||||||
|
pub is_enabled: bool,
|
||||||
|
pub publisher: String,
|
||||||
|
pub file_path: String,
|
||||||
|
}
|
||||||
21
src-tauri/src/models/treemap.rs
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
|
pub struct DrivePartition {
|
||||||
|
pub name: String,
|
||||||
|
pub mount_point: String,
|
||||||
|
pub total_bytes: u64,
|
||||||
|
pub free_bytes: u64,
|
||||||
|
pub used_bytes: u64,
|
||||||
|
pub file_system: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
|
pub struct TreemapItem {
|
||||||
|
pub id: String,
|
||||||
|
pub name: String,
|
||||||
|
pub value: u64,
|
||||||
|
pub formatted_size: String,
|
||||||
|
pub color: String,
|
||||||
|
pub children: Vec<TreemapItem>,
|
||||||
|
}
|
||||||
19
src-tauri/src/models/tweak.rs
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
|
||||||
|
pub enum TweakCategory {
|
||||||
|
Privacy,
|
||||||
|
Performance,
|
||||||
|
System,
|
||||||
|
Gaming,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
|
pub struct SystemTweak {
|
||||||
|
pub id: String,
|
||||||
|
pub title: String,
|
||||||
|
pub description: String,
|
||||||
|
pub category: TweakCategory,
|
||||||
|
pub is_applied: bool,
|
||||||
|
pub requires_restart: bool,
|
||||||
|
}
|
||||||
20
src-tauri/src/models/update.rs
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
|
pub struct UpdateCheckResult {
|
||||||
|
pub has_update: bool,
|
||||||
|
pub current_version: String,
|
||||||
|
pub latest_version: String,
|
||||||
|
pub download_url: String,
|
||||||
|
pub release_notes: String,
|
||||||
|
pub sha256: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
|
pub struct UpdateDownloadProgress {
|
||||||
|
pub percentage: f32,
|
||||||
|
pub downloaded_bytes: u64,
|
||||||
|
pub total_bytes: u64,
|
||||||
|
pub is_completed: bool,
|
||||||
|
pub error: Option<String>,
|
||||||
|
}
|
||||||
81
src-tauri/src/services/backup_service.rs
Normal file
|
|
@ -0,0 +1,81 @@
|
||||||
|
use crate::error::{AppError, AppResult};
|
||||||
|
use crate::models::BackupEntry;
|
||||||
|
use crate::state::AppState;
|
||||||
|
use std::fs;
|
||||||
|
use std::path::Path;
|
||||||
|
use std::process::Command;
|
||||||
|
|
||||||
|
pub struct BackupService;
|
||||||
|
|
||||||
|
impl BackupService {
|
||||||
|
pub fn list_backups(state: &AppState) -> AppResult<Vec<BackupEntry>> {
|
||||||
|
let backup_dir = state.config_dir.join("Backups");
|
||||||
|
if !backup_dir.exists() {
|
||||||
|
return Ok(Vec::new());
|
||||||
|
}
|
||||||
|
|
||||||
|
let mut backups = Vec::new();
|
||||||
|
|
||||||
|
if let Ok(entries) = fs::read_dir(backup_dir) {
|
||||||
|
for entry in entries.filter_map(|e| e.ok()) {
|
||||||
|
let path = entry.path();
|
||||||
|
let file_name = entry.file_name().to_string_lossy().to_string();
|
||||||
|
|
||||||
|
if file_name.ends_with(".reg") {
|
||||||
|
let meta = entry.metadata().ok();
|
||||||
|
let size_bytes = meta.as_ref().map(|m| m.len()).unwrap_or(0);
|
||||||
|
let created_str = if let Some(m) = meta {
|
||||||
|
if let Ok(time) = m.created() {
|
||||||
|
let dt: chrono::DateTime<chrono::Local> = time.into();
|
||||||
|
dt.format("%d.%m.%Y %H:%M:%S").to_string()
|
||||||
|
} else {
|
||||||
|
"Bilinmiyor".to_string()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
"Bilinmiyor".to_string()
|
||||||
|
};
|
||||||
|
|
||||||
|
backups.push(BackupEntry {
|
||||||
|
id: file_name.clone(),
|
||||||
|
file_name: file_name.clone(),
|
||||||
|
file_path: path.to_string_lossy().to_string(),
|
||||||
|
created_at: created_str,
|
||||||
|
size_bytes,
|
||||||
|
description: format!("Kayıt Defteri Temizlik Yedeği ({:.2} KB)", size_bytes as f64 / 1024.0),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
backups.sort_by(|a, b| b.file_name.cmp(&a.file_name));
|
||||||
|
Ok(backups)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn restore_backup(file_path: &str) -> AppResult<bool> {
|
||||||
|
let path = Path::new(file_path);
|
||||||
|
if !path.exists() {
|
||||||
|
return Err(AppError::NotFound("Yedek dosyası diskte bulunamadı".to_string()));
|
||||||
|
}
|
||||||
|
|
||||||
|
// reg import "<path>"
|
||||||
|
let output = Command::new("reg")
|
||||||
|
.args(["import", file_path])
|
||||||
|
.output()
|
||||||
|
.map_err(|e| AppError::Execution(format!("'reg import' komutu çalıştırılamadı: {}", e)))?;
|
||||||
|
|
||||||
|
if output.status.success() {
|
||||||
|
Ok(true)
|
||||||
|
} else {
|
||||||
|
let err = String::from_utf8_lossy(&output.stderr);
|
||||||
|
Err(AppError::Execution(format!("Yedek geri yüklenirken hata oluştu: {}", err)))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn delete_backup(file_path: &str) -> AppResult<bool> {
|
||||||
|
let path = Path::new(file_path);
|
||||||
|
if path.exists() {
|
||||||
|
fs::remove_file(path)?;
|
||||||
|
}
|
||||||
|
Ok(true)
|
||||||
|
}
|
||||||
|
}
|
||||||
294
src-tauri/src/services/discovery.rs
Normal file
|
|
@ -0,0 +1,294 @@
|
||||||
|
use crate::error::AppResult;
|
||||||
|
use crate::models::{ApplicationEntry, ApplicationKind, UninstallerKind};
|
||||||
|
use std::fs;
|
||||||
|
use std::path::PathBuf;
|
||||||
|
use std::process::Command;
|
||||||
|
use winreg::enums::*;
|
||||||
|
use winreg::{RegKey, HKEY};
|
||||||
|
|
||||||
|
pub struct DiscoveryService;
|
||||||
|
|
||||||
|
impl DiscoveryService {
|
||||||
|
pub fn scan_all_applications() -> AppResult<Vec<ApplicationEntry>> {
|
||||||
|
let mut apps: Vec<ApplicationEntry> = Vec::new();
|
||||||
|
|
||||||
|
// 1. Kayıt defteri taraması
|
||||||
|
let _ = Self::scan_registry_hive(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall", true, &mut apps);
|
||||||
|
let _ = Self::scan_registry_hive(HKEY_LOCAL_MACHINE, "Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall", false, &mut apps);
|
||||||
|
let _ = Self::scan_registry_hive(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall", true, &mut apps);
|
||||||
|
|
||||||
|
// 2. Steam oyunları taraması
|
||||||
|
let _ = Self::scan_steam_games(&mut apps);
|
||||||
|
|
||||||
|
// 3. Windows Store uygulamaları taraması
|
||||||
|
let _ = Self::scan_store_apps(&mut apps);
|
||||||
|
|
||||||
|
// Benzersizleştir (Aynı DisplayName ve InstallLocation olanları birleştir)
|
||||||
|
apps.sort_by_key(|a| a.display_name.to_lowercase());
|
||||||
|
apps.dedup_by(|a, b| {
|
||||||
|
!a.display_name.is_empty()
|
||||||
|
&& a.display_name.eq_ignore_ascii_case(&b.display_name)
|
||||||
|
&& a.display_version == b.display_version
|
||||||
|
});
|
||||||
|
|
||||||
|
Ok(apps)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn scan_registry_hive(
|
||||||
|
hive: HKEY,
|
||||||
|
path: &str,
|
||||||
|
is_64bit: bool,
|
||||||
|
apps: &mut Vec<ApplicationEntry>,
|
||||||
|
) -> AppResult<()> {
|
||||||
|
let root = RegKey::predef(hive);
|
||||||
|
let uninstall_key = match root.open_subkey_with_flags(path, KEY_READ) {
|
||||||
|
Ok(k) => k,
|
||||||
|
Err(_) => return Ok(()),
|
||||||
|
};
|
||||||
|
|
||||||
|
let hive_prefix = if hive == HKEY_LOCAL_MACHINE { "HKLM" } else { "HKCU" };
|
||||||
|
|
||||||
|
for subkey_name in uninstall_key.enum_keys().filter_map(|k| k.ok()) {
|
||||||
|
let key = match uninstall_key.open_subkey_with_flags(&subkey_name, KEY_READ) {
|
||||||
|
Ok(k) => k,
|
||||||
|
Err(_) => continue,
|
||||||
|
};
|
||||||
|
|
||||||
|
let display_name: String = match key.get_value("DisplayName") {
|
||||||
|
Ok(name) => name,
|
||||||
|
Err(_) => continue,
|
||||||
|
};
|
||||||
|
|
||||||
|
let trimmed_name = display_name.trim();
|
||||||
|
if trimmed_name.is_empty() || trimmed_name.starts_with("KB") && trimmed_name.contains("Security Update") {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
let display_version: String = key.get_value("DisplayVersion").unwrap_or_default();
|
||||||
|
let publisher: String = key.get_value("Publisher").unwrap_or_default();
|
||||||
|
let install_location: String = key.get_value("InstallLocation").unwrap_or_default();
|
||||||
|
let uninstall_string: String = key.get_value("UninstallString").unwrap_or_default();
|
||||||
|
let quiet_uninstall_string: String = key.get_value("QuietUninstallString").unwrap_or_default();
|
||||||
|
let install_date: String = key.get_value("InstallDate").unwrap_or_default();
|
||||||
|
let display_icon: Option<String> = key.get_value("DisplayIcon").ok();
|
||||||
|
let url_info_about: Option<String> = key.get_value("URLInfoAbout").ok();
|
||||||
|
let help_link: Option<String> = key.get_value("HelpLink").ok();
|
||||||
|
|
||||||
|
let estimated_size_kb: u64 = key.get_value::<u32, _>("EstimatedSize").unwrap_or(0) as u64;
|
||||||
|
let system_component: u32 = key.get_value("SystemComponent").unwrap_or(0);
|
||||||
|
let windows_installer: u32 = key.get_value("WindowsInstaller").unwrap_or(0);
|
||||||
|
|
||||||
|
// Uninstall türünü belirle
|
||||||
|
let uninstaller_kind = if windows_installer == 1 || uninstall_string.to_lowercase().contains("msiexec.exe") {
|
||||||
|
UninstallerKind::Msi
|
||||||
|
} else if uninstall_string.to_lowercase().contains("unins000.exe") || install_location.to_lowercase().contains("unins000.exe") {
|
||||||
|
UninstallerKind::InnoSetup
|
||||||
|
} else if uninstall_string.to_lowercase().contains("uninst.exe") || uninstall_string.to_lowercase().contains("uninstall.exe") {
|
||||||
|
UninstallerKind::Nsis
|
||||||
|
} else if uninstall_string.to_lowercase().contains("isuninst.exe") {
|
||||||
|
UninstallerKind::InstallShield
|
||||||
|
} else {
|
||||||
|
UninstallerKind::Custom
|
||||||
|
};
|
||||||
|
|
||||||
|
let full_reg_path = format!("{}\\{}\\{}", hive_prefix, path, subkey_name);
|
||||||
|
let id = format!("{:x}", md5_hash(&format!("{}_{}_{}", trimmed_name, display_version, full_reg_path)));
|
||||||
|
|
||||||
|
apps.push(ApplicationEntry {
|
||||||
|
id,
|
||||||
|
display_name: trimmed_name.to_string(),
|
||||||
|
display_version,
|
||||||
|
publisher,
|
||||||
|
install_location,
|
||||||
|
uninstall_string,
|
||||||
|
quiet_uninstall_string,
|
||||||
|
install_date,
|
||||||
|
estimated_size_kb,
|
||||||
|
is_system_component: system_component == 1,
|
||||||
|
is_64bit,
|
||||||
|
kind: ApplicationKind::Registry,
|
||||||
|
uninstaller_kind,
|
||||||
|
registry_key_path: Some(full_reg_path),
|
||||||
|
display_icon,
|
||||||
|
url_info_about,
|
||||||
|
help_link,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn scan_steam_games(apps: &mut Vec<ApplicationEntry>) -> AppResult<()> {
|
||||||
|
let hkcu = RegKey::predef(HKEY_CURRENT_USER);
|
||||||
|
let steam_key = match hkcu.open_subkey("Software\\Valve\\Steam") {
|
||||||
|
Ok(k) => k,
|
||||||
|
Err(_) => return Ok(()),
|
||||||
|
};
|
||||||
|
|
||||||
|
let steam_path_str: String = match steam_key.get_value("SteamPath") {
|
||||||
|
Ok(p) => p,
|
||||||
|
Err(_) => return Ok(()),
|
||||||
|
};
|
||||||
|
|
||||||
|
let steam_dir = PathBuf::from(steam_path_str.replace('/', "\\"));
|
||||||
|
if !steam_dir.exists() {
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
|
||||||
|
let mut library_dirs = vec![steam_dir.clone()];
|
||||||
|
|
||||||
|
// libraryfolders.vdf ayrıştır
|
||||||
|
let vdf_path = steam_dir.join("steamapps").join("libraryfolders.vdf");
|
||||||
|
if vdf_path.exists() {
|
||||||
|
if let Ok(content) = fs::read_to_string(&vdf_path) {
|
||||||
|
for line in content.lines() {
|
||||||
|
let trimmed = line.trim();
|
||||||
|
if trimmed.starts_with("\"path\"") {
|
||||||
|
let parts: Vec<&str> = trimmed.split('"').collect();
|
||||||
|
if parts.len() >= 4 {
|
||||||
|
let lib_path = PathBuf::from(parts[3].replace("\\\\", "\\"));
|
||||||
|
if lib_path.exists() && !library_dirs.contains(&lib_path) {
|
||||||
|
library_dirs.push(lib_path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Her kütüphanedeki appmanifest_*.acf dosyalarını oku
|
||||||
|
for lib in library_dirs {
|
||||||
|
let steamapps = lib.join("steamapps");
|
||||||
|
if !steamapps.exists() {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if let Ok(entries) = fs::read_dir(steamapps) {
|
||||||
|
for entry in entries.filter_map(|e| e.ok()) {
|
||||||
|
let file_name = entry.file_name().to_string_lossy().to_string();
|
||||||
|
if file_name.starts_with("appmanifest_") && file_name.ends_with(".acf") {
|
||||||
|
if let Ok(content) = fs::read_to_string(entry.path()) {
|
||||||
|
let mut app_id = String::new();
|
||||||
|
let mut name = String::new();
|
||||||
|
let mut installdir = String::new();
|
||||||
|
let mut size_bytes: u64 = 0;
|
||||||
|
|
||||||
|
for line in content.lines() {
|
||||||
|
let t = line.trim();
|
||||||
|
if t.starts_with("\"appid\"") {
|
||||||
|
let p: Vec<&str> = t.split('"').collect();
|
||||||
|
if p.len() >= 4 { app_id = p[3].to_string(); }
|
||||||
|
} else if t.starts_with("\"name\"") {
|
||||||
|
let p: Vec<&str> = t.split('"').collect();
|
||||||
|
if p.len() >= 4 { name = p[3].to_string(); }
|
||||||
|
} else if t.starts_with("\"installdir\"") {
|
||||||
|
let p: Vec<&str> = t.split('"').collect();
|
||||||
|
if p.len() >= 4 { installdir = p[3].to_string(); }
|
||||||
|
} else if t.starts_with("\"SizeOnDisk\"") {
|
||||||
|
let p: Vec<&str> = t.split('"').collect();
|
||||||
|
if p.len() >= 4 { size_bytes = p[3].parse().unwrap_or(0); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if !app_id.is_empty() && !name.is_empty() && app_id != "228980" { // Steamworks Common Redistributables hariç
|
||||||
|
let install_path = lib.join("steamapps").join("common").join(&installdir);
|
||||||
|
apps.push(ApplicationEntry {
|
||||||
|
id: format!("steam_{}", app_id),
|
||||||
|
display_name: name,
|
||||||
|
display_version: "Steam".to_string(),
|
||||||
|
publisher: "Valve / Steam".to_string(),
|
||||||
|
install_location: install_path.to_string_lossy().to_string(),
|
||||||
|
uninstall_string: format!("steam://uninstall/{}", app_id),
|
||||||
|
quiet_uninstall_string: format!("steam://uninstall/{}", app_id),
|
||||||
|
install_date: String::new(),
|
||||||
|
estimated_size_kb: size_bytes / 1024,
|
||||||
|
is_system_component: false,
|
||||||
|
is_64bit: true,
|
||||||
|
kind: ApplicationKind::Steam,
|
||||||
|
uninstaller_kind: UninstallerKind::Steam,
|
||||||
|
registry_key_path: None,
|
||||||
|
display_icon: None,
|
||||||
|
url_info_about: Some(format!("https://store.steampowered.com/app/{}", app_id)),
|
||||||
|
help_link: None,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn scan_store_apps(apps: &mut Vec<ApplicationEntry>) -> AppResult<()> {
|
||||||
|
let output = match Command::new("powershell")
|
||||||
|
.args(["-NoProfile", "-Command", "Get-AppxPackage | Where-Object { -not $_.IsFramework -and $_.NonRemovable -ne $true } | Select-Object Name, PackageFullName, InstallLocation, Publisher | ConvertTo-Json"])
|
||||||
|
.output()
|
||||||
|
{
|
||||||
|
Ok(o) => o,
|
||||||
|
Err(_) => return Ok(()),
|
||||||
|
};
|
||||||
|
|
||||||
|
if !output.status.success() {
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
|
||||||
|
let json_str = String::from_utf8_lossy(&output.stdout);
|
||||||
|
let parsed: serde_json::Value = match serde_json::from_str(&json_str) {
|
||||||
|
Ok(v) => v,
|
||||||
|
Err(_) => return Ok(()),
|
||||||
|
};
|
||||||
|
|
||||||
|
let items = if let Some(arr) = parsed.as_array() {
|
||||||
|
arr.clone()
|
||||||
|
} else if parsed.is_object() {
|
||||||
|
vec![parsed]
|
||||||
|
} else {
|
||||||
|
return Ok(());
|
||||||
|
};
|
||||||
|
|
||||||
|
for item in items {
|
||||||
|
let name = item["Name"].as_str().unwrap_or_default().trim();
|
||||||
|
let package_full_name = item["PackageFullName"].as_str().unwrap_or_default();
|
||||||
|
let install_loc = item["InstallLocation"].as_str().unwrap_or_default();
|
||||||
|
let publisher = item["Publisher"].as_str().unwrap_or_default();
|
||||||
|
|
||||||
|
if name.is_empty() || package_full_name.is_empty() {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
apps.push(ApplicationEntry {
|
||||||
|
id: format!("uwp_{}", package_full_name),
|
||||||
|
display_name: name.to_string(),
|
||||||
|
display_version: "UWP/Store".to_string(),
|
||||||
|
publisher: publisher.to_string(),
|
||||||
|
install_location: install_loc.to_string(),
|
||||||
|
uninstall_string: format!("powershell -NoProfile -Command \"Remove-AppxPackage -Package {}\"", package_full_name),
|
||||||
|
quiet_uninstall_string: format!("powershell -NoProfile -Command \"Remove-AppxPackage -Package {}\"", package_full_name),
|
||||||
|
install_date: String::new(),
|
||||||
|
estimated_size_kb: 0,
|
||||||
|
is_system_component: false,
|
||||||
|
is_64bit: true,
|
||||||
|
kind: ApplicationKind::StoreApp,
|
||||||
|
uninstaller_kind: UninstallerKind::Store,
|
||||||
|
registry_key_path: None,
|
||||||
|
display_icon: None,
|
||||||
|
url_info_about: None,
|
||||||
|
help_link: None,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn md5_hash(input: &str) -> u128 {
|
||||||
|
use sha2::{Digest, Sha256};
|
||||||
|
let mut hasher = Sha256::new();
|
||||||
|
hasher.update(input.as_bytes());
|
||||||
|
let res = hasher.finalize();
|
||||||
|
let mut bytes = [0u8; 16];
|
||||||
|
bytes.copy_from_slice(&res[0..16]);
|
||||||
|
u128::from_le_bytes(bytes)
|
||||||
|
}
|
||||||
179
src-tauri/src/services/file_unlocker.rs
Normal file
|
|
@ -0,0 +1,179 @@
|
||||||
|
use crate::error::{AppError, AppResult};
|
||||||
|
use crate::services::safety::SafetyBlacklist;
|
||||||
|
use std::fs;
|
||||||
|
use std::os::windows::ffi::OsStrExt;
|
||||||
|
use std::path::Path;
|
||||||
|
use std::process::Command;
|
||||||
|
use windows::core::{PCWSTR, PWSTR};
|
||||||
|
use windows::Win32::Foundation::{CloseHandle, ERROR_MORE_DATA, ERROR_SUCCESS};
|
||||||
|
use windows::Win32::Storage::FileSystem::{MoveFileExW, MOVEFILE_DELAY_UNTIL_REBOOT};
|
||||||
|
use windows::Win32::System::RestartManager::{
|
||||||
|
RmEndSession, RmGetList, RmRegisterResources, RmStartSession, RM_PROCESS_INFO,
|
||||||
|
};
|
||||||
|
use windows::Win32::System::Threading::{OpenProcess, TerminateProcess, PROCESS_TERMINATE};
|
||||||
|
|
||||||
|
pub struct FileUnlockerService;
|
||||||
|
|
||||||
|
impl FileUnlockerService {
|
||||||
|
pub fn force_unlock_and_delete(path_str: &str) -> AppResult<bool> {
|
||||||
|
let path = Path::new(path_str);
|
||||||
|
if !path.exists() {
|
||||||
|
return Ok(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Güvenlik Kalkanı: Kritik Windows klasörlerini zorla silmeye karşı koru
|
||||||
|
if SafetyBlacklist::is_dangerous_file_path(path_str) {
|
||||||
|
return Err(AppError::Security(format!(
|
||||||
|
"Kritik sistem yolu zorla silinemez: {}",
|
||||||
|
path_str
|
||||||
|
)));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 1. Restart Manager ile kilitleyen süreçleri bul ve sonlandır
|
||||||
|
let _ = Self::terminate_locking_processes(path_str);
|
||||||
|
|
||||||
|
// 2. Salt okunur (read-only) ve sistem özniteliklerini temizle
|
||||||
|
Self::clear_file_attributes(path_str);
|
||||||
|
|
||||||
|
// 3. Klasör veya dosyayı silmeyi dene
|
||||||
|
if path.is_dir() {
|
||||||
|
match fs::remove_dir_all(path) {
|
||||||
|
Ok(_) => Ok(true),
|
||||||
|
Err(_) => {
|
||||||
|
// Yeniden deneme döngüsü (5 iterasyon)
|
||||||
|
for _ in 0..5 {
|
||||||
|
std::thread::sleep(std::time::Duration::from_millis(150));
|
||||||
|
if fs::remove_dir_all(path).is_ok() {
|
||||||
|
return Ok(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Son çare: Reboot silme sırasına al
|
||||||
|
Self::schedule_delete_on_reboot(path_str)?;
|
||||||
|
Ok(false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
match fs::remove_file(path) {
|
||||||
|
Ok(_) => Ok(true),
|
||||||
|
Err(_) => {
|
||||||
|
for _ in 0..5 {
|
||||||
|
std::thread::sleep(std::time::Duration::from_millis(150));
|
||||||
|
if fs::remove_file(path).is_ok() {
|
||||||
|
return Ok(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Self::schedule_delete_on_reboot(path_str)?;
|
||||||
|
Ok(false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn terminate_locking_processes(path_str: &str) -> AppResult<Vec<u32>> {
|
||||||
|
let mut session_handle = 0u32;
|
||||||
|
let mut session_key = [0u16; 33];
|
||||||
|
|
||||||
|
unsafe {
|
||||||
|
let res = RmStartSession(&mut session_handle, 0, PWSTR(session_key.as_mut_ptr()));
|
||||||
|
if res != ERROR_SUCCESS {
|
||||||
|
return Err(AppError::RestartManager("RmStartSession başarısız".to_string()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let wide_path: Vec<u16> = std::ffi::OsStr::new(path_str)
|
||||||
|
.encode_wide()
|
||||||
|
.chain(std::iter::once(0))
|
||||||
|
.collect();
|
||||||
|
let paths = [PCWSTR(wide_path.as_ptr())];
|
||||||
|
|
||||||
|
unsafe {
|
||||||
|
let reg_res = RmRegisterResources(session_handle, Some(&paths), None, None);
|
||||||
|
if reg_res != ERROR_SUCCESS {
|
||||||
|
let _ = RmEndSession(session_handle);
|
||||||
|
return Ok(Vec::new());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let mut n_proc_info_needed = 0u32;
|
||||||
|
let mut n_proc_info = 0u32;
|
||||||
|
let mut reboot_reasons = 0u32;
|
||||||
|
|
||||||
|
unsafe {
|
||||||
|
let _ = RmGetList(
|
||||||
|
session_handle,
|
||||||
|
&mut n_proc_info_needed,
|
||||||
|
&mut n_proc_info,
|
||||||
|
None,
|
||||||
|
&mut reboot_reasons,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
let mut terminated_pids = Vec::new();
|
||||||
|
|
||||||
|
if n_proc_info_needed > 0 {
|
||||||
|
let mut proc_info: Vec<RM_PROCESS_INFO> = vec![unsafe { std::mem::zeroed() }; n_proc_info_needed as usize];
|
||||||
|
n_proc_info = n_proc_info_needed;
|
||||||
|
|
||||||
|
let list_res = unsafe {
|
||||||
|
RmGetList(
|
||||||
|
session_handle,
|
||||||
|
&mut n_proc_info_needed,
|
||||||
|
&mut n_proc_info,
|
||||||
|
Some(proc_info.as_mut_ptr()),
|
||||||
|
&mut reboot_reasons,
|
||||||
|
)
|
||||||
|
};
|
||||||
|
|
||||||
|
if list_res == ERROR_SUCCESS || list_res == ERROR_MORE_DATA {
|
||||||
|
let current_pid = std::process::id();
|
||||||
|
for info in &proc_info[0..n_proc_info as usize] {
|
||||||
|
let pid = info.Process.dwProcessId;
|
||||||
|
if pid != 0 && pid != current_pid {
|
||||||
|
unsafe {
|
||||||
|
if let Ok(handle) = OpenProcess(PROCESS_TERMINATE, false, pid) {
|
||||||
|
if !handle.is_invalid() {
|
||||||
|
let _ = TerminateProcess(handle, 1);
|
||||||
|
let _ = CloseHandle(handle);
|
||||||
|
terminated_pids.push(pid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
unsafe {
|
||||||
|
let _ = RmEndSession(session_handle);
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(terminated_pids)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn clear_file_attributes(path_str: &str) {
|
||||||
|
// attrib -r -s -h "<path>" /s /d
|
||||||
|
let _ = Command::new("attrib")
|
||||||
|
.args(["-r", "-s", "-h", path_str, "/s", "/d"])
|
||||||
|
.output();
|
||||||
|
}
|
||||||
|
|
||||||
|
fn schedule_delete_on_reboot(path_str: &str) -> AppResult<()> {
|
||||||
|
let wide: Vec<u16> = std::ffi::OsStr::new(path_str)
|
||||||
|
.encode_wide()
|
||||||
|
.chain(std::iter::once(0))
|
||||||
|
.collect();
|
||||||
|
let success = unsafe {
|
||||||
|
MoveFileExW(
|
||||||
|
windows::core::PCWSTR(wide.as_ptr()),
|
||||||
|
windows::core::PCWSTR::null(),
|
||||||
|
MOVEFILE_DELAY_UNTIL_REBOOT,
|
||||||
|
)
|
||||||
|
};
|
||||||
|
|
||||||
|
if success.is_ok() {
|
||||||
|
Ok(())
|
||||||
|
} else {
|
||||||
|
Err(AppError::Execution("Yeniden başlatmada silme işlemi kaydedilemedi".to_string()))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
337
src-tauri/src/services/junk_cleaner.rs
Normal file
|
|
@ -0,0 +1,337 @@
|
||||||
|
use crate::error::AppResult;
|
||||||
|
use crate::models::{CleanReport, ConfidenceLevel, JunkItem, JunkScanResult, JunkType};
|
||||||
|
use crate::services::safety::SafetyBlacklist;
|
||||||
|
use crate::services::sift4::Sift4;
|
||||||
|
use crate::state::AppState;
|
||||||
|
use chrono::Local;
|
||||||
|
use std::fs;
|
||||||
|
use std::path::{Path, PathBuf};
|
||||||
|
use winreg::enums::*;
|
||||||
|
use winreg::RegKey;
|
||||||
|
|
||||||
|
pub struct JunkCleanerService;
|
||||||
|
|
||||||
|
impl JunkCleanerService {
|
||||||
|
pub fn scan_leftovers(
|
||||||
|
app_name: &str,
|
||||||
|
publisher: &str,
|
||||||
|
install_location: &str,
|
||||||
|
state: &AppState,
|
||||||
|
) -> AppResult<JunkScanResult> {
|
||||||
|
let mut items: Vec<JunkItem> = Vec::new();
|
||||||
|
|
||||||
|
let tokens = Sift4::tokenize(app_name);
|
||||||
|
let pub_tokens = Sift4::tokenize(publisher);
|
||||||
|
|
||||||
|
// 1. Dosya Sistemi Taraması
|
||||||
|
let search_dirs = Self::get_standard_search_directories();
|
||||||
|
for dir in search_dirs {
|
||||||
|
if !dir.exists() {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if let Ok(entries) = fs::read_dir(&dir) {
|
||||||
|
for entry in entries.filter_map(|e| e.ok()) {
|
||||||
|
let path = entry.path();
|
||||||
|
let path_str = path.to_string_lossy().to_string();
|
||||||
|
|
||||||
|
// Güvenlik kara listesi ve kullanıcı istisna kontrolü
|
||||||
|
if SafetyBlacklist::is_dangerous_file_path(&path_str) || state.is_excluded(&path_str) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
let folder_name = entry.file_name().to_string_lossy().to_string();
|
||||||
|
let folder_lower = folder_name.to_lowercase();
|
||||||
|
|
||||||
|
let is_dir = path.is_dir();
|
||||||
|
let mut matched = false;
|
||||||
|
let mut confidence = ConfidenceLevel::Low;
|
||||||
|
let mut match_reason = String::new();
|
||||||
|
|
||||||
|
// Doğrudan yükleme klasörü eşleşmesi
|
||||||
|
if !install_location.is_empty() && path_str.eq_ignore_ascii_case(install_location) {
|
||||||
|
matched = true;
|
||||||
|
confidence = ConfidenceLevel::High;
|
||||||
|
match_reason = "Doğrudan Yükleme Klasörü".to_string();
|
||||||
|
} else if folder_lower == app_name.to_lowercase() {
|
||||||
|
matched = true;
|
||||||
|
confidence = ConfidenceLevel::High;
|
||||||
|
match_reason = "Birebir Klasör Adı Eşleşmesi".to_string();
|
||||||
|
} else {
|
||||||
|
// Token ve Sift4 eşleşmesi
|
||||||
|
for token in &tokens {
|
||||||
|
if Sift4::contains_word_boundary(&folder_lower, token) {
|
||||||
|
matched = true;
|
||||||
|
confidence = ConfidenceLevel::Medium;
|
||||||
|
match_reason = format!("'{}' kelimesi klasör adında bulundu", token);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if matched {
|
||||||
|
let size = if is_dir { Self::calculate_dir_size(&path) } else { entry.metadata().map(|m| m.len()).unwrap_or(0) };
|
||||||
|
items.push(JunkItem {
|
||||||
|
id: format!("{:x}", Self::hash_str(&path_str)),
|
||||||
|
item_type: if is_dir { JunkType::Directory } else { JunkType::File },
|
||||||
|
path: path_str,
|
||||||
|
confidence: confidence.clone(),
|
||||||
|
reason: match_reason,
|
||||||
|
size_bytes: size,
|
||||||
|
is_selected: confidence >= ConfidenceLevel::Medium,
|
||||||
|
app_id: app_name.to_string(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. Kayıt Defteri Taraması
|
||||||
|
Self::scan_registry_leftovers(app_name, publisher, &tokens, &pub_tokens, state, &mut items);
|
||||||
|
|
||||||
|
let mut total_size = 0u64;
|
||||||
|
let mut total_files = 0;
|
||||||
|
let mut total_dirs = 0;
|
||||||
|
let mut total_reg = 0;
|
||||||
|
|
||||||
|
for item in &items {
|
||||||
|
total_size += item.size_bytes;
|
||||||
|
match item.item_type {
|
||||||
|
JunkType::File => total_files += 1,
|
||||||
|
JunkType::Directory => total_dirs += 1,
|
||||||
|
JunkType::RegistryKey | JunkType::RegistryValue => total_reg += 1,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(JunkScanResult {
|
||||||
|
items,
|
||||||
|
total_size_bytes: total_size,
|
||||||
|
total_files,
|
||||||
|
total_dirs,
|
||||||
|
total_registry_entries: total_reg,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fn scan_registry_leftovers(
|
||||||
|
app_name: &str,
|
||||||
|
_publisher: &str,
|
||||||
|
tokens: &[String],
|
||||||
|
_pub_tokens: &[String],
|
||||||
|
state: &AppState,
|
||||||
|
items: &mut Vec<JunkItem>,
|
||||||
|
) {
|
||||||
|
let targets = [
|
||||||
|
(HKEY_CURRENT_USER, "HKCU", "Software"),
|
||||||
|
(HKEY_LOCAL_MACHINE, "HKLM", "Software"),
|
||||||
|
(HKEY_LOCAL_MACHINE, "HKLM", "Software\\WOW6432Node"),
|
||||||
|
];
|
||||||
|
|
||||||
|
for (hive, hive_name, sub_path) in targets {
|
||||||
|
let root = RegKey::predef(hive);
|
||||||
|
let sw_key = match root.open_subkey_with_flags(sub_path, KEY_READ) {
|
||||||
|
Ok(k) => k,
|
||||||
|
Err(_) => continue,
|
||||||
|
};
|
||||||
|
|
||||||
|
for subkey in sw_key.enum_keys().filter_map(|k| k.ok()) {
|
||||||
|
let full_path = format!("{}\\{}\\{}", hive_name, sub_path, subkey);
|
||||||
|
if SafetyBlacklist::is_dangerous_registry_path(&full_path) || state.is_excluded(&full_path) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
let sub_lower = subkey.to_lowercase();
|
||||||
|
let mut matched = false;
|
||||||
|
let mut confidence = ConfidenceLevel::Low;
|
||||||
|
let mut reason = String::new();
|
||||||
|
|
||||||
|
if sub_lower == app_name.to_lowercase() {
|
||||||
|
matched = true;
|
||||||
|
confidence = ConfidenceLevel::High;
|
||||||
|
reason = "Birebir Kayıt Defteri Anahtarı".to_string();
|
||||||
|
} else {
|
||||||
|
for token in tokens {
|
||||||
|
if Sift4::contains_word_boundary(&sub_lower, token) {
|
||||||
|
matched = true;
|
||||||
|
confidence = ConfidenceLevel::Medium;
|
||||||
|
reason = format!("'{}' kayıt defteri dalında bulundu", token);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if matched {
|
||||||
|
items.push(JunkItem {
|
||||||
|
id: format!("{:x}", Self::hash_str(&full_path)),
|
||||||
|
item_type: JunkType::RegistryKey,
|
||||||
|
path: full_path,
|
||||||
|
confidence: confidence.clone(),
|
||||||
|
reason,
|
||||||
|
size_bytes: 0,
|
||||||
|
is_selected: confidence >= ConfidenceLevel::Medium,
|
||||||
|
app_id: app_name.to_string(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn clean_selected_items(
|
||||||
|
items: &[JunkItem],
|
||||||
|
use_recycle_bin: bool,
|
||||||
|
state: &AppState,
|
||||||
|
) -> AppResult<CleanReport> {
|
||||||
|
let mut deleted_count = 0;
|
||||||
|
let mut freed_bytes = 0u64;
|
||||||
|
let mut errors = Vec::new();
|
||||||
|
|
||||||
|
// 1. Registry anahtarları için .reg yedeği oluştur
|
||||||
|
let reg_items: Vec<&JunkItem> = items
|
||||||
|
.iter()
|
||||||
|
.filter(|i| i.is_selected && (i.item_type == JunkType::RegistryKey || i.item_type == JunkType::RegistryValue))
|
||||||
|
.collect();
|
||||||
|
|
||||||
|
let backup_path = if !reg_items.is_empty() {
|
||||||
|
match Self::create_registry_backup(®_items, state) {
|
||||||
|
Ok(p) => Some(p),
|
||||||
|
Err(e) => {
|
||||||
|
errors.push(format!("Yedekleme oluşturulamadı: {}", e));
|
||||||
|
None
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
};
|
||||||
|
|
||||||
|
// 2. Silme işlemlerini gerçekleştir
|
||||||
|
for item in items.iter().filter(|i| i.is_selected) {
|
||||||
|
match item.item_type {
|
||||||
|
JunkType::File => {
|
||||||
|
let p = Path::new(&item.path);
|
||||||
|
if p.exists() {
|
||||||
|
if use_recycle_bin {
|
||||||
|
if let Err(e) = trash::delete(p) {
|
||||||
|
errors.push(format!("Geri Dönüşüm Kutusuna taşınamadı ({}): {}", item.path, e));
|
||||||
|
} else {
|
||||||
|
deleted_count += 1;
|
||||||
|
freed_bytes += item.size_bytes;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if let Err(e) = fs::remove_file(p) {
|
||||||
|
errors.push(format!("Dosya silinemedi ({}): {}", item.path, e));
|
||||||
|
} else {
|
||||||
|
deleted_count += 1;
|
||||||
|
freed_bytes += item.size_bytes;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
JunkType::Directory => {
|
||||||
|
let p = Path::new(&item.path);
|
||||||
|
if p.exists() {
|
||||||
|
if use_recycle_bin {
|
||||||
|
if let Err(e) = trash::delete(p) {
|
||||||
|
errors.push(format!("Klasör Geri Dönüşüm Kutusuna taşınamadı ({}): {}", item.path, e));
|
||||||
|
} else {
|
||||||
|
deleted_count += 1;
|
||||||
|
freed_bytes += item.size_bytes;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if let Err(e) = fs::remove_dir_all(p) {
|
||||||
|
errors.push(format!("Klasör silinemedi ({}): {}", item.path, e));
|
||||||
|
} else {
|
||||||
|
deleted_count += 1;
|
||||||
|
freed_bytes += item.size_bytes;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
JunkType::RegistryKey => {
|
||||||
|
if let Err(e) = Self::delete_registry_key(&item.path) {
|
||||||
|
errors.push(format!("Kayıt defteri anahtarı silinemedi ({}): {}", item.path, e));
|
||||||
|
} else {
|
||||||
|
deleted_count += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
JunkType::RegistryValue => {
|
||||||
|
deleted_count += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(CleanReport {
|
||||||
|
deleted_items_count: deleted_count,
|
||||||
|
freed_bytes,
|
||||||
|
backup_file_path: backup_path,
|
||||||
|
errors,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fn create_registry_backup(items: &[&JunkItem], state: &AppState) -> AppResult<String> {
|
||||||
|
let timestamp = Local::now().format("%Y%m%d_%H%M%S").to_string();
|
||||||
|
let backup_dir = state.config_dir.join("Backups");
|
||||||
|
let _ = fs::create_dir_all(&backup_dir);
|
||||||
|
|
||||||
|
let backup_file = backup_dir.join(format!("backup_{}.reg", timestamp));
|
||||||
|
|
||||||
|
let mut content = String::from("Windows Registry Editor Version 5.00\r\n\r\n");
|
||||||
|
for item in items {
|
||||||
|
content.push_str(&format!("; Silinmeden önceki anahtar: {}\r\n", item.path));
|
||||||
|
content.push_str(&format!("[-{}]\r\n\r\n", item.path.trim_start_matches('\\')));
|
||||||
|
}
|
||||||
|
|
||||||
|
fs::write(&backup_file, content)?;
|
||||||
|
Ok(backup_file.to_string_lossy().to_string())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn delete_registry_key(path_str: &str) -> AppResult<()> {
|
||||||
|
let (hive, sub) = if path_str.starts_with("HKCU\\") || path_str.starts_with("HKEY_CURRENT_USER\\") {
|
||||||
|
let part = path_str.split_once('\\').map(|x| x.1).unwrap_or("");
|
||||||
|
(HKEY_CURRENT_USER, part)
|
||||||
|
} else if path_str.starts_with("HKLM\\") || path_str.starts_with("HKEY_LOCAL_MACHINE\\") {
|
||||||
|
let part = path_str.split_once('\\').map(|x| x.1).unwrap_or("");
|
||||||
|
(HKEY_LOCAL_MACHINE, part)
|
||||||
|
} else {
|
||||||
|
return Ok(());
|
||||||
|
};
|
||||||
|
|
||||||
|
if SafetyBlacklist::is_dangerous_registry_path(path_str) {
|
||||||
|
return Err(crate::error::AppError::Security(format!("Kritik kayıt defteri anahtarı silinemez: {}", path_str)));
|
||||||
|
}
|
||||||
|
|
||||||
|
let root = RegKey::predef(hive);
|
||||||
|
let _ = root.delete_subkey_all(sub);
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn calculate_dir_size(path: &Path) -> u64 {
|
||||||
|
let mut size = 0u64;
|
||||||
|
for entry in walkdir::WalkDir::new(path).into_iter().filter_map(|e| e.ok()) {
|
||||||
|
if let Ok(meta) = entry.metadata() {
|
||||||
|
if meta.is_file() {
|
||||||
|
size += meta.len();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
size
|
||||||
|
}
|
||||||
|
|
||||||
|
fn get_standard_search_directories() -> Vec<PathBuf> {
|
||||||
|
let mut dirs = Vec::new();
|
||||||
|
if let Ok(val) = std::env::var("LOCALAPPDATA") { dirs.push(PathBuf::from(val)); }
|
||||||
|
if let Ok(val) = std::env::var("APPDATA") { dirs.push(PathBuf::from(val)); }
|
||||||
|
if let Ok(val) = std::env::var("ProgramData") { dirs.push(PathBuf::from(val)); }
|
||||||
|
if let Ok(val) = std::env::var("ProgramFiles") { dirs.push(PathBuf::from(val)); }
|
||||||
|
if let Ok(val) = std::env::var("ProgramFiles(x86)") { dirs.push(PathBuf::from(val)); }
|
||||||
|
dirs
|
||||||
|
}
|
||||||
|
|
||||||
|
fn hash_str(val: &str) -> u128 {
|
||||||
|
use sha2::{Digest, Sha256};
|
||||||
|
let mut hasher = Sha256::new();
|
||||||
|
hasher.update(val.as_bytes());
|
||||||
|
let res = hasher.finalize();
|
||||||
|
let mut b = [0u8; 16];
|
||||||
|
b.copy_from_slice(&res[0..16]);
|
||||||
|
u128::from_le_bytes(b)
|
||||||
|
}
|
||||||
|
}
|
||||||
23
src-tauri/src/services/mod.rs
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
pub mod backup_service;
|
||||||
|
pub mod discovery;
|
||||||
|
pub mod file_unlocker;
|
||||||
|
pub mod junk_cleaner;
|
||||||
|
pub mod safety;
|
||||||
|
pub mod sift4;
|
||||||
|
pub mod startup_service;
|
||||||
|
pub mod treemap_service;
|
||||||
|
pub mod tweaks_service;
|
||||||
|
pub mod uninstaller;
|
||||||
|
pub mod update_service;
|
||||||
|
|
||||||
|
pub use backup_service::BackupService;
|
||||||
|
pub use discovery::DiscoveryService;
|
||||||
|
pub use file_unlocker::FileUnlockerService;
|
||||||
|
pub use junk_cleaner::JunkCleanerService;
|
||||||
|
pub use safety::SafetyBlacklist;
|
||||||
|
pub use sift4::Sift4;
|
||||||
|
pub use startup_service::StartupService;
|
||||||
|
pub use treemap_service::TreemapService;
|
||||||
|
pub use tweaks_service::TweaksService;
|
||||||
|
pub use uninstaller::UninstallerService;
|
||||||
|
pub use update_service::UpdateService;
|
||||||
150
src-tauri/src/services/safety.rs
Normal file
|
|
@ -0,0 +1,150 @@
|
||||||
|
use std::path::Path;
|
||||||
|
|
||||||
|
pub struct SafetyBlacklist;
|
||||||
|
|
||||||
|
impl SafetyBlacklist {
|
||||||
|
pub fn is_dangerous_file_path(raw_path: &str) -> bool {
|
||||||
|
let trimmed = raw_path.trim().trim_matches('"');
|
||||||
|
if trimmed.is_empty() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
let normalized = trimmed.replace('/', "\\").to_lowercase();
|
||||||
|
let path = Path::new(&normalized);
|
||||||
|
|
||||||
|
// Kök dizin kontrolü (örn. C:\ veya D:\)
|
||||||
|
if normalized.len() <= 3 && normalized.ends_with(':') || normalized.ends_with(":\\") {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Sistem yolları
|
||||||
|
let system_root = std::env::var("SystemRoot")
|
||||||
|
.unwrap_or_else(|_| "C:\\Windows".to_string())
|
||||||
|
.to_lowercase();
|
||||||
|
if normalized == system_root || normalized.starts_with(&format!("{}\\", system_root)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
let win_dir = std::env::var("WINDIR")
|
||||||
|
.unwrap_or_else(|_| "C:\\Windows".to_string())
|
||||||
|
.to_lowercase();
|
||||||
|
if normalized == win_dir || normalized.starts_with(&format!("{}\\", win_dir)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Program Files kökleri
|
||||||
|
let pf = std::env::var("ProgramFiles")
|
||||||
|
.unwrap_or_else(|_| "C:\\Program Files".to_string())
|
||||||
|
.to_lowercase();
|
||||||
|
let pfx86 = std::env::var("ProgramFiles(x86)")
|
||||||
|
.unwrap_or_else(|_| "C:\\Program Files (x86)".to_string())
|
||||||
|
.to_lowercase();
|
||||||
|
|
||||||
|
if normalized == pf || normalized == pfx86 {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// WindowsApps & Package Cache koruması
|
||||||
|
if normalized.contains("\\windowsapps") || normalized.contains("\\package cache") {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Kullanıcı kök dizini (C:\Users veya C:\Users\KullanıcıAdı)
|
||||||
|
let user_profile = std::env::var("USERPROFILE")
|
||||||
|
.unwrap_or_else(|_| "C:\\Users\\Default".to_string())
|
||||||
|
.to_lowercase();
|
||||||
|
if normalized == user_profile {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
let users_root = if let Some(parent) = Path::new(&user_profile).parent() {
|
||||||
|
parent.to_string_lossy().to_string().to_lowercase()
|
||||||
|
} else {
|
||||||
|
"c:\\users".to_string()
|
||||||
|
};
|
||||||
|
if normalized == users_root {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Kullanıcı kritik klasörleri: Belgelerim, Masaüstü, OneDrive kökü, İndirilenler
|
||||||
|
let documents = format!("{}\\documents", user_profile);
|
||||||
|
let desktop = format!("{}\\desktop", user_profile);
|
||||||
|
let downloads = format!("{}\\downloads", user_profile);
|
||||||
|
let onedrive = std::env::var("OneDrive")
|
||||||
|
.unwrap_or_default()
|
||||||
|
.to_lowercase();
|
||||||
|
|
||||||
|
if normalized == documents || normalized == desktop || normalized == downloads {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if !onedrive.is_empty() && (normalized == onedrive || normalized == format!("{}\\desktop", onedrive) || normalized == format!("{}\\documents", onedrive)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Genel hassas klasörler
|
||||||
|
let dangerous_leafs = [
|
||||||
|
"system32", "syswow64", "winsxs", "boot", "recovery", "$recycle.bin",
|
||||||
|
"system volume information", "windows nt", "microsoft", "common files",
|
||||||
|
];
|
||||||
|
|
||||||
|
if let Some(file_name) = path.file_name() {
|
||||||
|
let name_str = file_name.to_string_lossy().to_lowercase();
|
||||||
|
if dangerous_leafs.contains(&name_str.as_str()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn is_dangerous_registry_path(raw_path: &str) -> bool {
|
||||||
|
let trimmed = raw_path.trim().trim_matches('\\');
|
||||||
|
if trimmed.is_empty() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
let normalized = trimmed.to_lowercase();
|
||||||
|
|
||||||
|
let dangerous_exact_or_prefix = [
|
||||||
|
"hklm\\software\\microsoft\\windows nt\\currentversion",
|
||||||
|
"hklm\\software\\microsoft\\windows\\currentversion",
|
||||||
|
"hkcu\\software\\microsoft\\windows\\currentversion\\explorer",
|
||||||
|
"hkcu\\software\\microsoft\\windows\\currentversion",
|
||||||
|
"hklm\\system",
|
||||||
|
"hklm\\sam",
|
||||||
|
"hklm\\security",
|
||||||
|
"hklm\\hardware",
|
||||||
|
"hkey_local_machine\\system",
|
||||||
|
"hkey_local_machine\\sam",
|
||||||
|
"hkey_local_machine\\security",
|
||||||
|
"hkey_local_machine\\hardware",
|
||||||
|
"hkey_classes_root",
|
||||||
|
"hkcr",
|
||||||
|
];
|
||||||
|
|
||||||
|
for dangerous in &dangerous_exact_or_prefix {
|
||||||
|
if normalized == *dangerous || normalized.starts_with(&format!("{}\\", dangerous)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Sadece Root kovanlar silinemez
|
||||||
|
let roots = [
|
||||||
|
"hkey_local_machine", "hklm",
|
||||||
|
"hkey_current_user", "hkcu",
|
||||||
|
"hkey_classes_root", "hkcr",
|
||||||
|
"hkey_users", "hku",
|
||||||
|
"hkey_current_config", "hkcc",
|
||||||
|
"hklm\\software", "hkcu\\software",
|
||||||
|
"hklm\\software\\wow6432node",
|
||||||
|
];
|
||||||
|
|
||||||
|
for root in &roots {
|
||||||
|
if normalized == *root {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
false
|
||||||
|
}
|
||||||
|
}
|
||||||
110
src-tauri/src/services/sift4.rs
Normal file
|
|
@ -0,0 +1,110 @@
|
||||||
|
use regex::Regex;
|
||||||
|
|
||||||
|
pub struct Sift4;
|
||||||
|
|
||||||
|
impl Sift4 {
|
||||||
|
/// Sift4 mesafe algoritması (küçük değer = daha yakın eşleşme)
|
||||||
|
pub fn distance(s1: &str, s2: &str, max_offset: usize) -> usize {
|
||||||
|
let c1: Vec<char> = s1.chars().collect();
|
||||||
|
let c2: Vec<char> = s2.chars().collect();
|
||||||
|
|
||||||
|
let l1 = c1.len();
|
||||||
|
let l2 = c2.len();
|
||||||
|
|
||||||
|
if l1 == 0 {
|
||||||
|
return l2;
|
||||||
|
}
|
||||||
|
if l2 == 0 {
|
||||||
|
return l1;
|
||||||
|
}
|
||||||
|
|
||||||
|
let mut c1_idx = 0;
|
||||||
|
let mut c2_idx = 0;
|
||||||
|
let mut lcss = 0;
|
||||||
|
let mut local_cs = 0;
|
||||||
|
let mut trans = 0;
|
||||||
|
|
||||||
|
let mut offset_arr: Vec<(usize, usize)> = Vec::new();
|
||||||
|
|
||||||
|
while c1_idx < l1 && c2_idx < l2 {
|
||||||
|
if c1[c1_idx] == c2[c2_idx] {
|
||||||
|
local_cs += 1;
|
||||||
|
let i = 0;
|
||||||
|
while i < offset_arr.len() {
|
||||||
|
let ofs = offset_arr[i];
|
||||||
|
if c1_idx <= ofs.0 || c2_idx <= ofs.1 {
|
||||||
|
let is_trans = c1_idx.abs_diff(c2_idx) >= ofs.0.abs_diff(ofs.1);
|
||||||
|
if is_trans {
|
||||||
|
trans += 1;
|
||||||
|
} else if ofs.0 <= c1_idx && ofs.1 <= c2_idx {
|
||||||
|
offset_arr.remove(i);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
offset_arr.remove(i);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
offset_arr.push((c1_idx, c2_idx));
|
||||||
|
c1_idx += 1;
|
||||||
|
c2_idx += 1;
|
||||||
|
} else {
|
||||||
|
lcss += local_cs;
|
||||||
|
local_cs = 0;
|
||||||
|
if c1_idx != c2_idx {
|
||||||
|
c1_idx = c1_idx.min(c2_idx);
|
||||||
|
c2_idx = c1_idx;
|
||||||
|
}
|
||||||
|
|
||||||
|
for i in 0..max_offset {
|
||||||
|
if c1_idx + i < l1 && c2_idx < l2 && c1[c1_idx + i] == c2[c2_idx] {
|
||||||
|
c1_idx += i;
|
||||||
|
local_cs += 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if c2_idx + i < l2 && c1_idx < l1 && c1[c1_idx] == c2[c2_idx + i] {
|
||||||
|
c2_idx += i;
|
||||||
|
local_cs += 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
c1_idx += 1;
|
||||||
|
c2_idx += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
lcss += local_cs;
|
||||||
|
(l1.max(l2) - lcss) + trans
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Kelime tokenlarını çıkarır (jenerik kelimeleri ve 3 harften kısa olanları eler)
|
||||||
|
pub fn tokenize(name: &str) -> Vec<String> {
|
||||||
|
let ignored = [
|
||||||
|
"the", "app", "pro", "free", "soft", "software", "suite", "setup", "install",
|
||||||
|
"installer", "uninstaller", "client", "edition", "system", "windows", "corporation",
|
||||||
|
"ltd", "inc", "microsoft", "google", "version", "x64", "x86", "64bit", "32bit",
|
||||||
|
];
|
||||||
|
|
||||||
|
let re = Regex::new(r"[^a-zA-Z0-9]+").unwrap_or_else(|_| Regex::new(r"\s+").unwrap());
|
||||||
|
let parts: Vec<&str> = re.split(name).collect();
|
||||||
|
|
||||||
|
let mut tokens = Vec::new();
|
||||||
|
for part in parts {
|
||||||
|
let lower = part.trim().to_lowercase();
|
||||||
|
if lower.len() >= 3 && !ignored.contains(&lower.as_str())
|
||||||
|
&& !tokens.contains(&lower) {
|
||||||
|
tokens.push(lower);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
tokens
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Hedef metin içinde tam kelime sınırlarıyla (word boundary) arama yapar
|
||||||
|
pub fn contains_word_boundary(text: &str, token: &str) -> bool {
|
||||||
|
let pattern = format!(r"(?i)(^|[^a-zA-Z0-9]){}([^a-zA-Z0-9]|$)", regex::escape(token));
|
||||||
|
match Regex::new(&pattern) {
|
||||||
|
Ok(re) => re.is_match(text),
|
||||||
|
Err(_) => false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
137
src-tauri/src/services/startup_service.rs
Normal file
|
|
@ -0,0 +1,137 @@
|
||||||
|
use crate::error::AppResult;
|
||||||
|
use crate::models::{StartupItem, StartupLocation};
|
||||||
|
use std::fs;
|
||||||
|
use std::path::PathBuf;
|
||||||
|
use winreg::enums::*;
|
||||||
|
use winreg::RegKey;
|
||||||
|
|
||||||
|
pub struct StartupService;
|
||||||
|
|
||||||
|
impl StartupService {
|
||||||
|
pub fn get_startup_items() -> AppResult<Vec<StartupItem>> {
|
||||||
|
let mut items = Vec::new();
|
||||||
|
|
||||||
|
// 1. HKCU Run
|
||||||
|
let hkcu = RegKey::predef(HKEY_CURRENT_USER);
|
||||||
|
if let Ok(key) = hkcu.open_subkey_with_flags("Software\\Microsoft\\Windows\\CurrentVersion\\Run", KEY_READ) {
|
||||||
|
for (name, val) in key.enum_values().filter_map(|v| v.ok()) {
|
||||||
|
items.push(StartupItem {
|
||||||
|
id: format!("hkcu_{}", name),
|
||||||
|
name: name.clone(),
|
||||||
|
command: val.to_string(),
|
||||||
|
location: StartupLocation::RegistryCurrentUser,
|
||||||
|
is_enabled: true,
|
||||||
|
publisher: "Kayıt Defteri (Kullanıcı)".to_string(),
|
||||||
|
file_path: val.to_string(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. HKLM Run
|
||||||
|
let hklm = RegKey::predef(HKEY_LOCAL_MACHINE);
|
||||||
|
if let Ok(key) = hklm.open_subkey_with_flags("Software\\Microsoft\\Windows\\CurrentVersion\\Run", KEY_READ) {
|
||||||
|
for (name, val) in key.enum_values().filter_map(|v| v.ok()) {
|
||||||
|
items.push(StartupItem {
|
||||||
|
id: format!("hklm_{}", name),
|
||||||
|
name: name.clone(),
|
||||||
|
command: val.to_string(),
|
||||||
|
location: StartupLocation::RegistryLocalMachine,
|
||||||
|
is_enabled: true,
|
||||||
|
publisher: "Kayıt Defteri (Sistem)".to_string(),
|
||||||
|
file_path: val.to_string(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. User Startup Folder
|
||||||
|
if let Ok(appdata) = std::env::var("APPDATA") {
|
||||||
|
let startup_dir = PathBuf::from(appdata).join("Microsoft\\Windows\\Start Menu\\Programs\\Startup");
|
||||||
|
if startup_dir.exists() {
|
||||||
|
if let Ok(entries) = fs::read_dir(startup_dir) {
|
||||||
|
for entry in entries.filter_map(|e| e.ok()) {
|
||||||
|
let path = entry.path();
|
||||||
|
let name = entry.file_name().to_string_lossy().to_string();
|
||||||
|
let is_disabled = name.ends_with(".disabled");
|
||||||
|
items.push(StartupItem {
|
||||||
|
id: format!("user_folder_{}", name),
|
||||||
|
name: name.clone(),
|
||||||
|
command: path.to_string_lossy().to_string(),
|
||||||
|
location: StartupLocation::UserStartupFolder,
|
||||||
|
is_enabled: !is_disabled,
|
||||||
|
publisher: "Başlangıç Klasörü (Kullanıcı)".to_string(),
|
||||||
|
file_path: path.to_string_lossy().to_string(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 4. Common Startup Folder
|
||||||
|
if let Ok(progdata) = std::env::var("ProgramData") {
|
||||||
|
let common_startup = PathBuf::from(progdata).join("Microsoft\\Windows\\Start Menu\\Programs\\Startup");
|
||||||
|
if common_startup.exists() {
|
||||||
|
if let Ok(entries) = fs::read_dir(common_startup) {
|
||||||
|
for entry in entries.filter_map(|e| e.ok()) {
|
||||||
|
let path = entry.path();
|
||||||
|
let name = entry.file_name().to_string_lossy().to_string();
|
||||||
|
let is_disabled = name.ends_with(".disabled");
|
||||||
|
items.push(StartupItem {
|
||||||
|
id: format!("common_folder_{}", name),
|
||||||
|
name: name.clone(),
|
||||||
|
command: path.to_string_lossy().to_string(),
|
||||||
|
location: StartupLocation::CommonStartupFolder,
|
||||||
|
is_enabled: !is_disabled,
|
||||||
|
publisher: "Başlangıç Klasörü (Ortak)".to_string(),
|
||||||
|
file_path: path.to_string_lossy().to_string(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(items)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn toggle_startup_item(id: &str, enable: bool) -> AppResult<bool> {
|
||||||
|
let items = Self::get_startup_items()?;
|
||||||
|
let target = match items.iter().find(|i| i.id == id) {
|
||||||
|
Some(t) => t,
|
||||||
|
None => return Err(crate::error::AppError::NotFound("Başlangıç öğesi bulunamadı".to_string())),
|
||||||
|
};
|
||||||
|
|
||||||
|
match target.location {
|
||||||
|
StartupLocation::UserStartupFolder | StartupLocation::CommonStartupFolder => {
|
||||||
|
let current_path = PathBuf::from(&target.file_path);
|
||||||
|
if enable && target.file_path.ends_with(".disabled") {
|
||||||
|
let new_path = target.file_path.trim_end_matches(".disabled");
|
||||||
|
fs::rename(¤t_path, new_path)?;
|
||||||
|
Ok(true)
|
||||||
|
} else if !enable && !target.file_path.ends_with(".disabled") {
|
||||||
|
let new_path = format!("{}.disabled", target.file_path);
|
||||||
|
fs::rename(¤t_path, new_path)?;
|
||||||
|
Ok(true)
|
||||||
|
} else {
|
||||||
|
Ok(true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
StartupLocation::RegistryCurrentUser => {
|
||||||
|
let hkcu = RegKey::predef(HKEY_CURRENT_USER);
|
||||||
|
if !enable {
|
||||||
|
if let Ok(run_key) = hkcu.open_subkey_with_flags("Software\\Microsoft\\Windows\\CurrentVersion\\Run", KEY_ALL_ACCESS) {
|
||||||
|
let _ = run_key.delete_value(&target.name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Ok(true)
|
||||||
|
}
|
||||||
|
StartupLocation::RegistryLocalMachine => {
|
||||||
|
let hklm = RegKey::predef(HKEY_LOCAL_MACHINE);
|
||||||
|
if !enable {
|
||||||
|
if let Ok(run_key) = hklm.open_subkey_with_flags("Software\\Microsoft\\Windows\\CurrentVersion\\Run", KEY_ALL_ACCESS) {
|
||||||
|
let _ = run_key.delete_value(&target.name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Ok(true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
77
src-tauri/src/services/treemap_service.rs
Normal file
|
|
@ -0,0 +1,77 @@
|
||||||
|
use crate::error::AppResult;
|
||||||
|
use crate::models::{ApplicationEntry, DrivePartition, TreemapItem};
|
||||||
|
use sysinfo::Disks;
|
||||||
|
|
||||||
|
pub struct TreemapService;
|
||||||
|
|
||||||
|
impl TreemapService {
|
||||||
|
pub fn get_disk_partitions() -> AppResult<Vec<DrivePartition>> {
|
||||||
|
let disks = Disks::new_with_refreshed_list();
|
||||||
|
let mut partitions = Vec::new();
|
||||||
|
|
||||||
|
for disk in disks.list() {
|
||||||
|
let total = disk.total_space();
|
||||||
|
let free = disk.available_space();
|
||||||
|
let used = total.saturating_sub(free);
|
||||||
|
|
||||||
|
partitions.push(DrivePartition {
|
||||||
|
name: disk.name().to_string_lossy().to_string(),
|
||||||
|
mount_point: disk.mount_point().to_string_lossy().to_string(),
|
||||||
|
total_bytes: total,
|
||||||
|
free_bytes: free,
|
||||||
|
used_bytes: used,
|
||||||
|
file_system: disk.file_system().to_string_lossy().to_string(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(partitions)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn generate_apps_treemap(apps: &[ApplicationEntry]) -> AppResult<Vec<TreemapItem>> {
|
||||||
|
let mut items = Vec::new();
|
||||||
|
|
||||||
|
let colors = [
|
||||||
|
"#38bdf8", "#818cf8", "#c084fc", "#f43f5e",
|
||||||
|
"#fb923c", "#facc15", "#4ade80", "#2dd4bf",
|
||||||
|
];
|
||||||
|
|
||||||
|
let mut sorted_apps = apps.to_vec();
|
||||||
|
sorted_apps.sort_by_key(|a| std::cmp::Reverse(a.estimated_size_kb));
|
||||||
|
|
||||||
|
for (idx, app) in sorted_apps.iter().enumerate() {
|
||||||
|
if app.estimated_size_kb == 0 {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
let size_bytes = app.estimated_size_kb * 1024;
|
||||||
|
let color = colors[idx % colors.len()];
|
||||||
|
|
||||||
|
items.push(TreemapItem {
|
||||||
|
id: app.id.clone(),
|
||||||
|
name: app.display_name.clone(),
|
||||||
|
value: size_bytes,
|
||||||
|
formatted_size: Self::format_size(size_bytes),
|
||||||
|
color: color.to_string(),
|
||||||
|
children: Vec::new(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(items)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn format_size(bytes: u64) -> String {
|
||||||
|
const KB: u64 = 1024;
|
||||||
|
const MB: u64 = KB * 1024;
|
||||||
|
const GB: u64 = MB * 1024;
|
||||||
|
|
||||||
|
if bytes >= GB {
|
||||||
|
format!("{:.2} GB", bytes as f64 / GB as f64)
|
||||||
|
} else if bytes >= MB {
|
||||||
|
format!("{:.2} MB", bytes as f64 / MB as f64)
|
||||||
|
} else if bytes >= KB {
|
||||||
|
format!("{:.2} KB", bytes as f64 / KB as f64)
|
||||||
|
} else {
|
||||||
|
format!("{} B", bytes)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
183
src-tauri/src/services/tweaks_service.rs
Normal file
|
|
@ -0,0 +1,183 @@
|
||||||
|
use crate::error::AppResult;
|
||||||
|
use crate::models::{SystemTweak, TweakCategory};
|
||||||
|
use winreg::enums::*;
|
||||||
|
use winreg::{RegKey, HKEY};
|
||||||
|
|
||||||
|
pub struct TweaksService;
|
||||||
|
|
||||||
|
impl TweaksService {
|
||||||
|
pub fn get_available_tweaks() -> AppResult<Vec<SystemTweak>> {
|
||||||
|
let mut tweaks = Vec::new();
|
||||||
|
|
||||||
|
// 1. Telemetry
|
||||||
|
let telemetry_applied = Self::check_dword(
|
||||||
|
HKEY_LOCAL_MACHINE,
|
||||||
|
"SOFTWARE\\Policies\\Microsoft\\Windows\\DataCollection",
|
||||||
|
"AllowTelemetry",
|
||||||
|
0,
|
||||||
|
);
|
||||||
|
tweaks.push(SystemTweak {
|
||||||
|
id: "tweak_telemetry".to_string(),
|
||||||
|
title: "Windows Telemetri ve Tanılama Verilerini Kapat".to_string(),
|
||||||
|
description: "Microsoft'a arka planda sistem ve kullanım verisi gönderilmesini engeller.".to_string(),
|
||||||
|
category: TweakCategory::Privacy,
|
||||||
|
is_applied: telemetry_applied,
|
||||||
|
requires_restart: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
// 2. Cortana
|
||||||
|
let cortana_applied = Self::check_dword(
|
||||||
|
HKEY_LOCAL_MACHINE,
|
||||||
|
"SOFTWARE\\Policies\\Microsoft\\Windows\\Windows Search",
|
||||||
|
"AllowCortana",
|
||||||
|
0,
|
||||||
|
);
|
||||||
|
tweaks.push(SystemTweak {
|
||||||
|
id: "tweak_cortana".to_string(),
|
||||||
|
title: "Cortana Sesli Asistanı Devre Dışı Bırak".to_string(),
|
||||||
|
description: "Cortana arka plan süreçlerini ve ses dinleme servislerini kapatır.".to_string(),
|
||||||
|
category: TweakCategory::Privacy,
|
||||||
|
is_applied: cortana_applied,
|
||||||
|
requires_restart: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
// 3. Bing Search
|
||||||
|
let bing_applied = Self::check_dword(
|
||||||
|
HKEY_CURRENT_USER,
|
||||||
|
"SOFTWARE\\Policies\\Microsoft\\Windows\\Explorer",
|
||||||
|
"DisableSearchBoxSuggestions",
|
||||||
|
1,
|
||||||
|
);
|
||||||
|
tweaks.push(SystemTweak {
|
||||||
|
id: "tweak_bing_search".to_string(),
|
||||||
|
title: "Başlat Menüsünde Bing Web Aramalarını Kapat".to_string(),
|
||||||
|
description: "Başlat menüsünde arama yaparken web sonuçları yerine yalnızca yerel dosyaları aratır.".to_string(),
|
||||||
|
category: TweakCategory::Performance,
|
||||||
|
is_applied: bing_applied,
|
||||||
|
requires_restart: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
// 4. Game DVR
|
||||||
|
let gamedvr_applied = Self::check_dword(
|
||||||
|
HKEY_CURRENT_USER,
|
||||||
|
"System\\GameConfigStore",
|
||||||
|
"GameDVR_Enabled",
|
||||||
|
0,
|
||||||
|
);
|
||||||
|
tweaks.push(SystemTweak {
|
||||||
|
id: "tweak_gamedvr".to_string(),
|
||||||
|
title: "Xbox Game DVR Arka Plan Kaydını Kapat".to_string(),
|
||||||
|
description: "Oyun oynarken FPS düşüşlerini önlemek için sürekli ekran kaydetme servisini kapatır.".to_string(),
|
||||||
|
category: TweakCategory::Gaming,
|
||||||
|
is_applied: gamedvr_applied,
|
||||||
|
requires_restart: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
// 5. Advertising ID
|
||||||
|
let ad_applied = Self::check_dword(
|
||||||
|
HKEY_CURRENT_USER,
|
||||||
|
"Software\\Microsoft\\Windows\\CurrentVersion\\AdvertisingInfo",
|
||||||
|
"Enabled",
|
||||||
|
0,
|
||||||
|
);
|
||||||
|
tweaks.push(SystemTweak {
|
||||||
|
id: "tweak_adid".to_string(),
|
||||||
|
title: "Kişiselleştirilmiş Reklam Kimliğini Kapat".to_string(),
|
||||||
|
description: "Uygulamaların kullanıcı alışkanlıklarına göre reklam kimliği oluşturmasını engeller.".to_string(),
|
||||||
|
category: TweakCategory::Privacy,
|
||||||
|
is_applied: ad_applied,
|
||||||
|
requires_restart: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
// 6. Windows 11 Widgets
|
||||||
|
let widgets_applied = Self::check_dword(
|
||||||
|
HKEY_CURRENT_USER,
|
||||||
|
"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
|
||||||
|
"TaskbarDa",
|
||||||
|
0,
|
||||||
|
);
|
||||||
|
tweaks.push(SystemTweak {
|
||||||
|
id: "tweak_widgets".to_string(),
|
||||||
|
title: "Windows 11 Haberler ve Araçlar (Widgets) Kapat".to_string(),
|
||||||
|
description: "Görev çubuğundaki araçlar panelini ve gereksiz bellek tüketen webview bileşenini kapatır.".to_string(),
|
||||||
|
category: TweakCategory::Performance,
|
||||||
|
is_applied: widgets_applied,
|
||||||
|
requires_restart: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
Ok(tweaks)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn apply_tweak(tweak_id: &str, enable: bool) -> AppResult<bool> {
|
||||||
|
match tweak_id {
|
||||||
|
"tweak_telemetry" => {
|
||||||
|
Self::set_dword(
|
||||||
|
HKEY_LOCAL_MACHINE,
|
||||||
|
"SOFTWARE\\Policies\\Microsoft\\Windows\\DataCollection",
|
||||||
|
"AllowTelemetry",
|
||||||
|
if enable { 0 } else { 3 },
|
||||||
|
)
|
||||||
|
}
|
||||||
|
"tweak_cortana" => {
|
||||||
|
Self::set_dword(
|
||||||
|
HKEY_LOCAL_MACHINE,
|
||||||
|
"SOFTWARE\\Policies\\Microsoft\\Windows\\Windows Search",
|
||||||
|
"AllowCortana",
|
||||||
|
if enable { 0 } else { 1 },
|
||||||
|
)
|
||||||
|
}
|
||||||
|
"tweak_bing_search" => {
|
||||||
|
Self::set_dword(
|
||||||
|
HKEY_CURRENT_USER,
|
||||||
|
"SOFTWARE\\Policies\\Microsoft\\Windows\\Explorer",
|
||||||
|
"DisableSearchBoxSuggestions",
|
||||||
|
if enable { 1 } else { 0 },
|
||||||
|
)
|
||||||
|
}
|
||||||
|
"tweak_gamedvr" => {
|
||||||
|
Self::set_dword(
|
||||||
|
HKEY_CURRENT_USER,
|
||||||
|
"System\\GameConfigStore",
|
||||||
|
"GameDVR_Enabled",
|
||||||
|
if enable { 0 } else { 1 },
|
||||||
|
)
|
||||||
|
}
|
||||||
|
"tweak_adid" => {
|
||||||
|
Self::set_dword(
|
||||||
|
HKEY_CURRENT_USER,
|
||||||
|
"Software\\Microsoft\\Windows\\CurrentVersion\\AdvertisingInfo",
|
||||||
|
"Enabled",
|
||||||
|
if enable { 0 } else { 1 },
|
||||||
|
)
|
||||||
|
}
|
||||||
|
"tweak_widgets" => {
|
||||||
|
Self::set_dword(
|
||||||
|
HKEY_CURRENT_USER,
|
||||||
|
"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
|
||||||
|
"TaskbarDa",
|
||||||
|
if enable { 0 } else { 1 },
|
||||||
|
)
|
||||||
|
}
|
||||||
|
_ => Ok(false),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn check_dword(hive: HKEY, subkey: &str, name: &str, expected: u32) -> bool {
|
||||||
|
let root = RegKey::predef(hive);
|
||||||
|
if let Ok(key) = root.open_subkey_with_flags(subkey, KEY_READ) {
|
||||||
|
if let Ok(val) = key.get_value::<u32, _>(name) {
|
||||||
|
return val == expected;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
|
fn set_dword(hive: HKEY, subkey: &str, name: &str, value: u32) -> AppResult<bool> {
|
||||||
|
let root = RegKey::predef(hive);
|
||||||
|
let (key, _) = root.create_subkey(subkey)
|
||||||
|
.map_err(|e| crate::error::AppError::Registry(format!("Ayar anahtarı açılamadı: {}", e)))?;
|
||||||
|
key.set_value(name, &value)
|
||||||
|
.map_err(|e| crate::error::AppError::Registry(format!("Ayar değeri yazılamadı: {}", e)))?;
|
||||||
|
Ok(true)
|
||||||
|
}
|
||||||
|
}
|
||||||
92
src-tauri/src/services/uninstaller.rs
Normal file
|
|
@ -0,0 +1,92 @@
|
||||||
|
use crate::error::{AppError, AppResult};
|
||||||
|
use crate::models::{ApplicationEntry, UninstallerKind};
|
||||||
|
use std::process::Command;
|
||||||
|
use std::time::{Duration, Instant};
|
||||||
|
|
||||||
|
pub struct UninstallerService;
|
||||||
|
|
||||||
|
impl UninstallerService {
|
||||||
|
pub fn uninstall(app: &ApplicationEntry, quiet: bool) -> AppResult<bool> {
|
||||||
|
let cmd_string = if quiet && !app.quiet_uninstall_string.is_empty() {
|
||||||
|
&app.quiet_uninstall_string
|
||||||
|
} else {
|
||||||
|
&app.uninstall_string
|
||||||
|
};
|
||||||
|
|
||||||
|
if cmd_string.trim().is_empty() {
|
||||||
|
return Err(AppError::NotFound("Kaldırma komutu (UninstallString) bulunamadı".to_string()));
|
||||||
|
}
|
||||||
|
|
||||||
|
match app.uninstaller_kind {
|
||||||
|
UninstallerKind::Steam => {
|
||||||
|
// Steam URI protokolü çağrılır
|
||||||
|
let _ = Command::new("cmd")
|
||||||
|
.args(["/c", "start", "", cmd_string])
|
||||||
|
.spawn()?;
|
||||||
|
Ok(true)
|
||||||
|
}
|
||||||
|
UninstallerKind::Store => {
|
||||||
|
// Remove-AppxPackage komutunu çalıştır
|
||||||
|
let output = Command::new("powershell")
|
||||||
|
.args(["-NoProfile", "-Command", cmd_string])
|
||||||
|
.output()?;
|
||||||
|
if output.status.success() {
|
||||||
|
Ok(true)
|
||||||
|
} else {
|
||||||
|
let err = String::from_utf8_lossy(&output.stderr);
|
||||||
|
Err(AppError::Execution(format!("Store uygulaması kaldırılamadı: {}", err)))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
UninstallerKind::Msi => {
|
||||||
|
let mut command_to_run = cmd_string.to_string();
|
||||||
|
if quiet && !command_to_run.contains("/qn") && !command_to_run.contains("/quiet") {
|
||||||
|
command_to_run.push_str(" /qn /norestart");
|
||||||
|
}
|
||||||
|
Self::run_shell_wait(&command_to_run, Duration::from_secs(300))
|
||||||
|
}
|
||||||
|
UninstallerKind::InnoSetup => {
|
||||||
|
let mut command_to_run = cmd_string.to_string();
|
||||||
|
if quiet && !command_to_run.to_lowercase().contains("/verysilent") {
|
||||||
|
command_to_run.push_str(" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART");
|
||||||
|
}
|
||||||
|
Self::run_shell_wait(&command_to_run, Duration::from_secs(300))
|
||||||
|
}
|
||||||
|
UninstallerKind::Nsis => {
|
||||||
|
let mut command_to_run = cmd_string.to_string();
|
||||||
|
if quiet && !command_to_run.contains("/S") {
|
||||||
|
command_to_run.push_str(" /S");
|
||||||
|
}
|
||||||
|
Self::run_shell_wait(&command_to_run, Duration::from_secs(300))
|
||||||
|
}
|
||||||
|
_ => {
|
||||||
|
Self::run_shell_wait(cmd_string, Duration::from_secs(300))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn run_shell_wait(raw_cmd: &str, timeout: Duration) -> AppResult<bool> {
|
||||||
|
let mut child = Command::new("cmd")
|
||||||
|
.args(["/c", raw_cmd])
|
||||||
|
.spawn()
|
||||||
|
.map_err(|e| AppError::Execution(format!("Kaldırıcı başlatılamadı: {}", e)))?;
|
||||||
|
|
||||||
|
let start = Instant::now();
|
||||||
|
loop {
|
||||||
|
match child.try_wait() {
|
||||||
|
Ok(Some(status)) => {
|
||||||
|
return Ok(status.success() || status.code() == Some(3010)); // 3010 = ERROR_SUCCESS_REBOOT_REQUIRED
|
||||||
|
}
|
||||||
|
Ok(None) => {
|
||||||
|
if start.elapsed() > timeout {
|
||||||
|
let _ = child.kill();
|
||||||
|
return Err(AppError::Execution("Kaldırma işlemi zaman aşımına uğradı (5 dakika).".to_string()));
|
||||||
|
}
|
||||||
|
std::thread::sleep(Duration::from_millis(500));
|
||||||
|
}
|
||||||
|
Err(e) => {
|
||||||
|
return Err(AppError::Execution(format!("Süreç beklenirken hata oluştu: {}", e)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
99
src-tauri/src/services/update_service.rs
Normal file
|
|
@ -0,0 +1,99 @@
|
||||||
|
use crate::error::{AppError, AppResult};
|
||||||
|
use crate::models::UpdateCheckResult;
|
||||||
|
use sha2::{Digest, Sha256};
|
||||||
|
use std::fs::File;
|
||||||
|
use std::io::Write;
|
||||||
|
use std::process::Command;
|
||||||
|
|
||||||
|
pub struct UpdateService;
|
||||||
|
|
||||||
|
const CURRENT_VERSION: &str = "3.0.0";
|
||||||
|
const UPDATE_URL: &str = "https://ttmadethat.shop/ldapps/version.json";
|
||||||
|
|
||||||
|
impl UpdateService {
|
||||||
|
pub async fn check_for_updates() -> AppResult<UpdateCheckResult> {
|
||||||
|
let client = reqwest::Client::builder()
|
||||||
|
.timeout(std::time::Duration::from_secs(10))
|
||||||
|
.build()
|
||||||
|
.map_err(|e| AppError::Network(format!("HTTP istemcisi oluşturulamadı: {}", e)))?;
|
||||||
|
|
||||||
|
let res = client.get(UPDATE_URL).send().await
|
||||||
|
.map_err(|e| AppError::Network(format!("Güncelleme sunucusuna erişilemedi: {}", e)))?;
|
||||||
|
|
||||||
|
if !res.status().is_success() {
|
||||||
|
return Err(AppError::Network(format!("Sunucu yanıt kodu: {}", res.status())));
|
||||||
|
}
|
||||||
|
|
||||||
|
let json_val: serde_json::Value = res.json().await
|
||||||
|
.map_err(|e| AppError::Network(format!("Güncelleme verisi çözümlenemedi: {}", e)))?;
|
||||||
|
|
||||||
|
let remote_version = json_val["version"].as_str().unwrap_or("0.0.0");
|
||||||
|
let download_url = json_val["downloadUrl"].as_str().unwrap_or_default();
|
||||||
|
let release_notes = json_val["releaseNotes"].as_str().unwrap_or_default();
|
||||||
|
let sha256 = json_val["sha256"].as_str().unwrap_or_default();
|
||||||
|
|
||||||
|
let has_update = Self::is_version_newer(CURRENT_VERSION, remote_version);
|
||||||
|
|
||||||
|
Ok(UpdateCheckResult {
|
||||||
|
has_update,
|
||||||
|
current_version: CURRENT_VERSION.to_string(),
|
||||||
|
latest_version: remote_version.to_string(),
|
||||||
|
download_url: download_url.to_string(),
|
||||||
|
release_notes: release_notes.to_string(),
|
||||||
|
sha256: sha256.to_string(),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
pub async fn download_and_install_update(download_url: &str, expected_sha256: &str) -> AppResult<bool> {
|
||||||
|
let temp_dir = std::env::temp_dir();
|
||||||
|
let update_installer_path = temp_dir.join("LD-Uninstaller-Update.exe");
|
||||||
|
|
||||||
|
let client = reqwest::Client::new();
|
||||||
|
let res = client.get(download_url).send().await
|
||||||
|
.map_err(|e| AppError::Network(format!("Güncelleme dosyası indirilemedi: {}", e)))?;
|
||||||
|
|
||||||
|
let bytes = res.bytes().await
|
||||||
|
.map_err(|e| AppError::Network(format!("İndirme akışı tamamlanamadı: {}", e)))?;
|
||||||
|
|
||||||
|
// SHA256 Doğrulaması
|
||||||
|
if !expected_sha256.is_empty() {
|
||||||
|
let mut hasher = Sha256::new();
|
||||||
|
hasher.update(&bytes);
|
||||||
|
let calculated_hash = hex::encode(hasher.finalize());
|
||||||
|
|
||||||
|
if !calculated_hash.eq_ignore_ascii_case(expected_sha256) {
|
||||||
|
return Err(AppError::Validation(format!(
|
||||||
|
"İndirilen güncelleme dosyasının SHA256 sağlama değeri uyuşmuyor! Beklenen: {}, Hesaplanan: {}",
|
||||||
|
expected_sha256, calculated_hash
|
||||||
|
)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let mut file = File::create(&update_installer_path)?;
|
||||||
|
file.write_all(&bytes)?;
|
||||||
|
|
||||||
|
// Kurulum dosyasını /SILENT /CLOSEAPPLICATIONS ile başlat
|
||||||
|
Command::new(&update_installer_path)
|
||||||
|
.args(["/SILENT", "/CLOSEAPPLICATIONS"])
|
||||||
|
.spawn()
|
||||||
|
.map_err(|e| AppError::Execution(format!("Güncelleyici başlatılamadı: {}", e)))?;
|
||||||
|
|
||||||
|
Ok(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn is_version_newer(current: &str, remote: &str) -> bool {
|
||||||
|
let c_parts: Vec<u32> = current.split('.').filter_map(|x| x.parse().ok()).collect();
|
||||||
|
let r_parts: Vec<u32> = remote.split('.').filter_map(|x| x.parse().ok()).collect();
|
||||||
|
|
||||||
|
for i in 0..c_parts.len().max(r_parts.len()) {
|
||||||
|
let c = c_parts.get(i).copied().unwrap_or(0);
|
||||||
|
let r = r_parts.get(i).copied().unwrap_or(0);
|
||||||
|
if r > c {
|
||||||
|
return true;
|
||||||
|
} else if r < c {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
false
|
||||||
|
}
|
||||||
|
}
|
||||||
89
src-tauri/src/state.rs
Normal file
|
|
@ -0,0 +1,89 @@
|
||||||
|
use crate::error::AppResult;
|
||||||
|
use crate::models::ApplicationEntry;
|
||||||
|
use std::fs;
|
||||||
|
use std::path::PathBuf;
|
||||||
|
use std::sync::RwLock;
|
||||||
|
use tokio::sync::RwLock as AsyncRwLock;
|
||||||
|
|
||||||
|
pub struct AppState {
|
||||||
|
pub exclusions: RwLock<Vec<String>>,
|
||||||
|
pub cached_apps: AsyncRwLock<Vec<ApplicationEntry>>,
|
||||||
|
pub config_dir: PathBuf,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl AppState {
|
||||||
|
pub fn new() -> Self {
|
||||||
|
let local_appdata = std::env::var("LOCALAPPDATA")
|
||||||
|
.unwrap_or_else(|_| "C:\\Users\\Default\\AppData\\Local".to_string());
|
||||||
|
let config_dir = PathBuf::from(local_appdata).join("LDUninstaller");
|
||||||
|
|
||||||
|
let _ = fs::create_dir_all(&config_dir);
|
||||||
|
let _ = fs::create_dir_all(config_dir.join("Backups"));
|
||||||
|
|
||||||
|
let exclusions_file = config_dir.join("exclusions.json");
|
||||||
|
let exclusions = if exclusions_file.exists() {
|
||||||
|
match fs::read_to_string(&exclusions_file) {
|
||||||
|
Ok(content) => serde_json::from_str(&content).unwrap_or_default(),
|
||||||
|
Err(_) => Vec::new(),
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Vec::new()
|
||||||
|
};
|
||||||
|
|
||||||
|
Self {
|
||||||
|
exclusions: RwLock::new(exclusions),
|
||||||
|
cached_apps: AsyncRwLock::new(Vec::new()),
|
||||||
|
config_dir,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn save_exclusions(&self) -> AppResult<()> {
|
||||||
|
let exclusions_file = self.config_dir.join("exclusions.json");
|
||||||
|
let list = match self.exclusions.read() {
|
||||||
|
Ok(guard) => guard.clone(),
|
||||||
|
Err(_) => Vec::new(),
|
||||||
|
};
|
||||||
|
let json = serde_json::to_string_pretty(&list)?;
|
||||||
|
fs::write(exclusions_file, json)?;
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn add_exclusion(&self, path_or_key: String) -> AppResult<()> {
|
||||||
|
let normalized = path_or_key.trim().to_lowercase();
|
||||||
|
if normalized.is_empty() {
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
if let Ok(mut guard) = self.exclusions.write() {
|
||||||
|
if !guard.iter().any(|item| item.to_lowercase() == normalized) {
|
||||||
|
guard.push(path_or_key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
self.save_exclusions()
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn remove_exclusion(&self, path_or_key: &str) -> AppResult<()> {
|
||||||
|
let normalized = path_or_key.trim().to_lowercase();
|
||||||
|
if let Ok(mut guard) = self.exclusions.write() {
|
||||||
|
guard.retain(|item| item.to_lowercase() != normalized);
|
||||||
|
}
|
||||||
|
self.save_exclusions()
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn is_excluded(&self, path_or_key: &str) -> bool {
|
||||||
|
let target = path_or_key.trim().to_lowercase();
|
||||||
|
if let Ok(guard) = self.exclusions.read() {
|
||||||
|
guard.iter().any(|ex| {
|
||||||
|
let ex_lower = ex.trim().to_lowercase();
|
||||||
|
target == ex_lower || target.starts_with(&format!("{}\\", ex_lower))
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Default for AppState {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self::new()
|
||||||
|
}
|
||||||
|
}
|
||||||
39
src-tauri/tauri.conf.json
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://schema.tauri.app/config/2",
|
||||||
|
"productName": "LD Uninstaller",
|
||||||
|
"version": "3.0.0",
|
||||||
|
"identifier": "com.lduninstaller.app",
|
||||||
|
"build": {
|
||||||
|
"beforeDevCommand": "npm run dev",
|
||||||
|
"devUrl": "http://localhost:1420",
|
||||||
|
"beforeBuildCommand": "npm run build",
|
||||||
|
"frontendDist": "../dist"
|
||||||
|
},
|
||||||
|
"app": {
|
||||||
|
"windows": [
|
||||||
|
{
|
||||||
|
"title": "LD Uninstaller",
|
||||||
|
"decorations": false,
|
||||||
|
"width": 1200,
|
||||||
|
"height": 800,
|
||||||
|
"minWidth": 960,
|
||||||
|
"minHeight": 640,
|
||||||
|
"center": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"security": {
|
||||||
|
"csp": null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"bundle": {
|
||||||
|
"active": true,
|
||||||
|
"targets": "all",
|
||||||
|
"icon": [
|
||||||
|
"icons/32x32.png",
|
||||||
|
"icons/128x128.png",
|
||||||
|
"icons/128x128@2x.png",
|
||||||
|
"icons/icon.icns",
|
||||||
|
"icons/icon.ico"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
81
src-tauri/tests/unit_tests.rs
Normal file
|
|
@ -0,0 +1,81 @@
|
||||||
|
use ld_uninstaller_lib::models::ConfidenceLevel;
|
||||||
|
use ld_uninstaller_lib::services::{SafetyBlacklist, Sift4};
|
||||||
|
use ld_uninstaller_lib::state::AppState;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_safety_blacklist_critical_system_paths() {
|
||||||
|
assert!(SafetyBlacklist::is_dangerous_file_path("C:\\Windows"));
|
||||||
|
assert!(SafetyBlacklist::is_dangerous_file_path("C:\\Windows\\System32"));
|
||||||
|
assert!(SafetyBlacklist::is_dangerous_file_path("C:\\Windows\\WinSxS"));
|
||||||
|
assert!(SafetyBlacklist::is_dangerous_file_path("C:\\"));
|
||||||
|
assert!(SafetyBlacklist::is_dangerous_file_path("D:\\"));
|
||||||
|
assert!(SafetyBlacklist::is_dangerous_file_path("C:\\Program Files\\WindowsApps"));
|
||||||
|
assert!(SafetyBlacklist::is_dangerous_file_path("C:\\ProgramData\\Package Cache"));
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_safety_blacklist_safe_application_paths() {
|
||||||
|
assert!(!SafetyBlacklist::is_dangerous_file_path("C:\\Program Files\\Notepad++"));
|
||||||
|
assert!(!SafetyBlacklist::is_dangerous_file_path("C:\\Program Files (x86)\\Steam\\steamapps\\common\\Counter-Strike"));
|
||||||
|
assert!(!SafetyBlacklist::is_dangerous_file_path("C:\\Users\\User\\AppData\\Local\\Discord"));
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_safety_blacklist_registry() {
|
||||||
|
assert!(SafetyBlacklist::is_dangerous_registry_path("HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion"));
|
||||||
|
assert!(SafetyBlacklist::is_dangerous_registry_path("HKLM\\SYSTEM"));
|
||||||
|
assert!(SafetyBlacklist::is_dangerous_registry_path("HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer"));
|
||||||
|
assert!(SafetyBlacklist::is_dangerous_registry_path("HKEY_LOCAL_MACHINE\\SAM"));
|
||||||
|
|
||||||
|
// Güvenli uygulama anahtarları
|
||||||
|
assert!(!SafetyBlacklist::is_dangerous_registry_path("HKCU\\Software\\Valve\\Steam"));
|
||||||
|
assert!(!SafetyBlacklist::is_dangerous_registry_path("HKLM\\Software\\WOW6432Node\\VideoLAN\\VLC"));
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_sift4_distance() {
|
||||||
|
assert_eq!(Sift4::distance("notepad", "notepad", 5), 0);
|
||||||
|
assert_eq!(Sift4::distance("vlc", "vlc player", 5), 7);
|
||||||
|
assert!(Sift4::distance("photoshop", "photoshp", 5) <= 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_sift4_tokenize() {
|
||||||
|
let tokens = Sift4::tokenize("Google Chrome Setup Pro x64");
|
||||||
|
assert_eq!(tokens, vec!["chrome"]);
|
||||||
|
|
||||||
|
let vlc_tokens = Sift4::tokenize("VideoLAN VLC Media Player");
|
||||||
|
assert!(vlc_tokens.contains(&"videolan".to_string()));
|
||||||
|
assert!(vlc_tokens.contains(&"vlc".to_string()));
|
||||||
|
assert!(vlc_tokens.contains(&"media".to_string()));
|
||||||
|
assert!(vlc_tokens.contains(&"player".to_string()));
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_sift4_contains_word_boundary() {
|
||||||
|
assert!(Sift4::contains_word_boundary("C:\\Program Files\\Mozilla Firefox", "firefox"));
|
||||||
|
assert!(Sift4::contains_word_boundary("Google Chrome (64-bit)", "chrome"));
|
||||||
|
assert!(!Sift4::contains_word_boundary("C:\\Photostudio\\app.exe", "studio"));
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_app_state_exclusions() {
|
||||||
|
let state = AppState::new();
|
||||||
|
let safe_folder = "C:\\Program Files\\MySpecialTool";
|
||||||
|
|
||||||
|
assert!(!state.is_excluded(safe_folder));
|
||||||
|
|
||||||
|
let _ = state.add_exclusion(safe_folder.to_string());
|
||||||
|
assert!(state.is_excluded(safe_folder));
|
||||||
|
assert!(state.is_excluded("C:\\Program Files\\MySpecialTool\\subfolder"));
|
||||||
|
|
||||||
|
let _ = state.remove_exclusion(safe_folder);
|
||||||
|
assert!(!state.is_excluded(safe_folder));
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_confidence_level_ordering() {
|
||||||
|
assert!(ConfidenceLevel::High > ConfidenceLevel::Medium);
|
||||||
|
assert!(ConfidenceLevel::Medium > ConfidenceLevel::Low);
|
||||||
|
assert!(ConfidenceLevel::Low > ConfidenceLevel::Bad);
|
||||||
|
}
|
||||||
29
src/App.css
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
@tailwind base;
|
||||||
|
@tailwind components;
|
||||||
|
@tailwind utilities;
|
||||||
|
|
||||||
|
@layer base {
|
||||||
|
body {
|
||||||
|
background-color: #0d1117;
|
||||||
|
color: #f1f5f9;
|
||||||
|
user-select: none;
|
||||||
|
-webkit-user-select: none;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Custom modern sleek scrollbar */
|
||||||
|
::-webkit-scrollbar {
|
||||||
|
width: 5px;
|
||||||
|
height: 5px;
|
||||||
|
}
|
||||||
|
::-webkit-scrollbar-track {
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
::-webkit-scrollbar-thumb {
|
||||||
|
background: rgba(255, 255, 255, 0.12);
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
::-webkit-scrollbar-thumb:hover {
|
||||||
|
background: rgba(255, 255, 255, 0.24);
|
||||||
|
}
|
||||||
76
src/App.tsx
Normal file
|
|
@ -0,0 +1,76 @@
|
||||||
|
import React, { useEffect } from 'react';
|
||||||
|
import { Titlebar } from './components/Titlebar';
|
||||||
|
import { Sidebar } from './components/Sidebar';
|
||||||
|
import { ToastContainer } from './components/ToastContainer';
|
||||||
|
import { LeftoversModal } from './components/LeftoversModal';
|
||||||
|
import { UpdateModal } from './components/UpdateModal';
|
||||||
|
import { AppsView } from './pages/AppsView';
|
||||||
|
import { TreemapView } from './pages/TreemapView';
|
||||||
|
import { StartupView } from './pages/StartupView';
|
||||||
|
import { TweaksView } from './pages/TweaksView';
|
||||||
|
import { ShredderView } from './pages/ShredderView';
|
||||||
|
import { BackupsView } from './pages/BackupsView';
|
||||||
|
import { SettingsView } from './pages/SettingsView';
|
||||||
|
import { useAppStore } from './store/useAppStore';
|
||||||
|
|
||||||
|
export const App: React.FC = () => {
|
||||||
|
const { currentTab, loadApps, loadExclusions, checkUpdates } = useAppStore();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
// Uygulama açılışında arka plan yüklemeleri
|
||||||
|
loadApps();
|
||||||
|
loadExclusions();
|
||||||
|
// Kullanıcı isteği doğrultusunda açılışta güncellemeleri otomatik ve sessizce denetle
|
||||||
|
checkUpdates(true);
|
||||||
|
|
||||||
|
const handleKeyDown = (e: KeyboardEvent) => {
|
||||||
|
if (e.key === 'F5') {
|
||||||
|
e.preventDefault();
|
||||||
|
loadApps();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
window.addEventListener('keydown', handleKeyDown);
|
||||||
|
return () => window.removeEventListener('keydown', handleKeyDown);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const renderActiveView = () => {
|
||||||
|
switch (currentTab) {
|
||||||
|
case 'apps':
|
||||||
|
return <AppsView />;
|
||||||
|
case 'treemap':
|
||||||
|
return <TreemapView />;
|
||||||
|
case 'startup':
|
||||||
|
return <StartupView />;
|
||||||
|
case 'tweaks':
|
||||||
|
return <TweaksView />;
|
||||||
|
case 'shredder':
|
||||||
|
return <ShredderView />;
|
||||||
|
case 'backups':
|
||||||
|
return <BackupsView />;
|
||||||
|
case 'settings':
|
||||||
|
return <SettingsView />;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="flex h-screen w-screen bg-ld-bg text-slate-100 select-none overflow-hidden font-sans">
|
||||||
|
{/* Özel Pencere Başlık Çubuğu */}
|
||||||
|
<Titlebar />
|
||||||
|
|
||||||
|
{/* Ana Arayüz */}
|
||||||
|
<div className="flex flex-1 h-full w-full overflow-hidden">
|
||||||
|
<Sidebar />
|
||||||
|
<main className="flex-1 h-full overflow-hidden flex flex-col">
|
||||||
|
{renderActiveView()}
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Modallar ve Bildirimler */}
|
||||||
|
<LeftoversModal />
|
||||||
|
<UpdateModal />
|
||||||
|
<ToastContainer />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default App;
|
||||||
1
src/assets/react.svg
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="35.93" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 228"><path fill="#00D8FF" d="M210.483 73.824a171.49 171.49 0 0 0-8.24-2.597c.465-1.9.893-3.777 1.273-5.621c6.238-30.281 2.16-54.676-11.769-62.708c-13.355-7.7-35.196.329-57.254 19.526a171.23 171.23 0 0 0-6.375 5.848a155.866 155.866 0 0 0-4.241-3.917C100.759 3.829 77.587-4.822 63.673 3.233C50.33 10.957 46.379 33.89 51.995 62.588a170.974 170.974 0 0 0 1.892 8.48c-3.28.932-6.445 1.924-9.474 2.98C17.309 83.498 0 98.307 0 113.668c0 15.865 18.582 31.778 46.812 41.427a145.52 145.52 0 0 0 6.921 2.165a167.467 167.467 0 0 0-2.01 9.138c-5.354 28.2-1.173 50.591 12.134 58.266c13.744 7.926 36.812-.22 59.273-19.855a145.567 145.567 0 0 0 5.342-4.923a168.064 168.064 0 0 0 6.92 6.314c21.758 18.722 43.246 26.282 56.54 18.586c13.731-7.949 18.194-32.003 12.4-61.268a145.016 145.016 0 0 0-1.535-6.842c1.62-.48 3.21-.974 4.76-1.488c29.348-9.723 48.443-25.443 48.443-41.52c0-15.417-17.868-30.326-45.517-39.844Zm-6.365 70.984c-1.4.463-2.836.91-4.3 1.345c-3.24-10.257-7.612-21.163-12.963-32.432c5.106-11 9.31-21.767 12.459-31.957c2.619.758 5.16 1.557 7.61 2.4c23.69 8.156 38.14 20.213 38.14 29.504c0 9.896-15.606 22.743-40.946 31.14Zm-10.514 20.834c2.562 12.94 2.927 24.64 1.23 33.787c-1.524 8.219-4.59 13.698-8.382 15.893c-8.067 4.67-25.32-1.4-43.927-17.412a156.726 156.726 0 0 1-6.437-5.87c7.214-7.889 14.423-17.06 21.459-27.246c12.376-1.098 24.068-2.894 34.671-5.345a134.17 134.17 0 0 1 1.386 6.193ZM87.276 214.515c-7.882 2.783-14.16 2.863-17.955.675c-8.075-4.657-11.432-22.636-6.853-46.752a156.923 156.923 0 0 1 1.869-8.499c10.486 2.32 22.093 3.988 34.498 4.994c7.084 9.967 14.501 19.128 21.976 27.15a134.668 134.668 0 0 1-4.877 4.492c-9.933 8.682-19.886 14.842-28.658 17.94ZM50.35 144.747c-12.483-4.267-22.792-9.812-29.858-15.863c-6.35-5.437-9.555-10.836-9.555-15.216c0-9.322 13.897-21.212 37.076-29.293c2.813-.98 5.757-1.905 8.812-2.773c3.204 10.42 7.406 21.315 12.477 32.332c-5.137 11.18-9.399 22.249-12.634 32.792a134.718 134.718 0 0 1-6.318-1.979Zm12.378-84.26c-4.811-24.587-1.616-43.134 6.425-47.789c8.564-4.958 27.502 2.111 47.463 19.835a144.318 144.318 0 0 1 3.841 3.545c-7.438 7.987-14.787 17.08-21.808 26.988c-12.04 1.116-23.565 2.908-34.161 5.309a160.342 160.342 0 0 1-1.76-7.887Zm110.427 27.268a347.8 347.8 0 0 0-7.785-12.803c8.168 1.033 15.994 2.404 23.343 4.08c-2.206 7.072-4.956 14.465-8.193 22.045a381.151 381.151 0 0 0-7.365-13.322Zm-45.032-43.861c5.044 5.465 10.096 11.566 15.065 18.186a322.04 322.04 0 0 0-30.257-.006c4.974-6.559 10.069-12.652 15.192-18.18ZM82.802 87.83a323.167 323.167 0 0 0-7.227 13.238c-3.184-7.553-5.909-14.98-8.134-22.152c7.304-1.634 15.093-2.97 23.209-3.984a321.524 321.524 0 0 0-7.848 12.897Zm8.081 65.352c-8.385-.936-16.291-2.203-23.593-3.793c2.26-7.3 5.045-14.885 8.298-22.6a321.187 321.187 0 0 0 7.257 13.246c2.594 4.48 5.28 8.868 8.038 13.147Zm37.542 31.03c-5.184-5.592-10.354-11.779-15.403-18.433c4.902.192 9.899.29 14.978.29c5.218 0 10.376-.117 15.453-.343c-4.985 6.774-10.018 12.97-15.028 18.486Zm52.198-57.817c3.422 7.8 6.306 15.345 8.596 22.52c-7.422 1.694-15.436 3.058-23.88 4.071a382.417 382.417 0 0 0 7.859-13.026a347.403 347.403 0 0 0 7.425-13.565Zm-16.898 8.101a358.557 358.557 0 0 1-12.281 19.815a329.4 329.4 0 0 1-23.444.823c-7.967 0-15.716-.248-23.178-.732a310.202 310.202 0 0 1-12.513-19.846h.001a307.41 307.41 0 0 1-10.923-20.627a310.278 310.278 0 0 1 10.89-20.637l-.001.001a307.318 307.318 0 0 1 12.413-19.761c7.613-.576 15.42-.876 23.31-.876H128c7.926 0 15.743.303 23.354.883a329.357 329.357 0 0 1 12.335 19.695a358.489 358.489 0 0 1 11.036 20.54a329.472 329.472 0 0 1-11 20.722Zm22.56-122.124c8.572 4.944 11.906 24.881 6.52 51.026c-.344 1.668-.73 3.367-1.15 5.09c-10.622-2.452-22.155-4.275-34.23-5.408c-7.034-10.017-14.323-19.124-21.64-27.008a160.789 160.789 0 0 1 5.888-5.4c18.9-16.447 36.564-22.941 44.612-18.3ZM128 90.808c12.625 0 22.86 10.235 22.86 22.86s-10.235 22.86-22.86 22.86s-22.86-10.235-22.86-22.86s10.235-22.86 22.86-22.86Z"></path></svg>
|
||||||
|
After Width: | Height: | Size: 4 KiB |
257
src/components/LeftoversModal.tsx
Normal file
|
|
@ -0,0 +1,257 @@
|
||||||
|
import React, { useState } from 'react';
|
||||||
|
import { useAppStore } from '../store/useAppStore';
|
||||||
|
import {
|
||||||
|
Trash2,
|
||||||
|
Folder,
|
||||||
|
FileText,
|
||||||
|
Key,
|
||||||
|
ShieldCheck,
|
||||||
|
X,
|
||||||
|
RefreshCw,
|
||||||
|
CheckCircle,
|
||||||
|
Archive,
|
||||||
|
} from 'lucide-react';
|
||||||
|
import { JunkType, ConfidenceLevel } from '../lib/tauri';
|
||||||
|
|
||||||
|
export const LeftoversModal: React.FC = () => {
|
||||||
|
const {
|
||||||
|
leftoverModalOpen,
|
||||||
|
setLeftoverModalOpen,
|
||||||
|
isScanningLeftovers,
|
||||||
|
activeAppForLeftovers,
|
||||||
|
leftoverResult,
|
||||||
|
selectedLeftoverIds,
|
||||||
|
toggleSelectLeftover,
|
||||||
|
selectAllLeftovers,
|
||||||
|
isCleaningLeftovers,
|
||||||
|
cleanReport,
|
||||||
|
executeLeftoverClean,
|
||||||
|
addExclusion,
|
||||||
|
} = useAppStore();
|
||||||
|
|
||||||
|
const [useRecycleBin, setUseRecycleBin] = useState(true);
|
||||||
|
|
||||||
|
if (!leftoverModalOpen) return null;
|
||||||
|
|
||||||
|
const getJunkIcon = (type: JunkType) => {
|
||||||
|
switch (type) {
|
||||||
|
case 'Directory':
|
||||||
|
return <Folder className="w-4 h-4 text-amber-400 shrink-0" />;
|
||||||
|
case 'File':
|
||||||
|
return <FileText className="w-4 h-4 text-sky-400 shrink-0" />;
|
||||||
|
case 'RegistryKey':
|
||||||
|
case 'RegistryValue':
|
||||||
|
return <Key className="w-4 h-4 text-purple-400 shrink-0" />;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const getConfidenceBadge = (confidence: ConfidenceLevel) => {
|
||||||
|
switch (confidence) {
|
||||||
|
case 'High':
|
||||||
|
return <span className="text-[10px] px-1.5 py-0.5 rounded bg-emerald-500/15 text-emerald-400 border border-emerald-500/30">Yüksek</span>;
|
||||||
|
case 'Medium':
|
||||||
|
return <span className="text-[10px] px-1.5 py-0.5 rounded bg-amber-500/15 text-amber-400 border border-amber-500/30">Orta</span>;
|
||||||
|
case 'Low':
|
||||||
|
return <span className="text-[10px] px-1.5 py-0.5 rounded bg-slate-500/15 text-slate-400 border border-slate-500/30">Düşük</span>;
|
||||||
|
case 'Bad':
|
||||||
|
return <span className="text-[10px] px-1.5 py-0.5 rounded bg-rose-500/15 text-rose-400 border border-rose-500/30">Tehlikeli</span>;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const formatSize = (bytes: number) => {
|
||||||
|
if (bytes >= 1024 * 1024 * 1024) return `${(bytes / 1024 / 1024 / 1024).toFixed(2)} GB`;
|
||||||
|
if (bytes >= 1024 * 1024) return `${(bytes / 1024 / 1024).toFixed(2)} MB`;
|
||||||
|
if (bytes >= 1024) return `${(bytes / 1024).toFixed(2)} KB`;
|
||||||
|
return `${bytes} B`;
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="fixed inset-0 z-50 bg-black/75 backdrop-blur-sm flex items-center justify-center p-4">
|
||||||
|
<div className="bg-ld-surface border border-ld-border rounded-xl w-full max-w-3xl max-h-[85vh] shadow-2xl flex flex-col overflow-hidden">
|
||||||
|
{/* Başlık */}
|
||||||
|
<div className="px-5 py-3.5 border-b border-ld-border flex items-center justify-between bg-ld-card/50">
|
||||||
|
<div className="flex items-center gap-2.5">
|
||||||
|
<div className="p-2 rounded-lg bg-sky-500/10 text-sky-400 border border-sky-500/20">
|
||||||
|
<Trash2 className="w-4 h-4" />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<h3 className="text-xs font-semibold text-slate-100 flex items-center gap-2">
|
||||||
|
Kalıntı Temizleme Motoru
|
||||||
|
{activeAppForLeftovers && (
|
||||||
|
<span className="text-slate-400 font-normal">({activeAppForLeftovers.display_name})</span>
|
||||||
|
)}
|
||||||
|
</h3>
|
||||||
|
<p className="text-[11px] text-slate-500">20 Katmanlı Akıllı Kalıntı Tarama ve Güvenli Temizlik</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<button
|
||||||
|
onClick={() => setLeftoverModalOpen(false)}
|
||||||
|
className="p-1 rounded text-slate-400 hover:text-slate-200 transition-colors"
|
||||||
|
>
|
||||||
|
<X className="w-4 h-4" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* İçerik */}
|
||||||
|
<div className="p-5 flex-1 overflow-y-auto space-y-4">
|
||||||
|
{isScanningLeftovers ? (
|
||||||
|
<div className="py-16 flex flex-col items-center justify-center text-center space-y-3">
|
||||||
|
<RefreshCw className="w-8 h-8 text-sky-400 animate-spin" />
|
||||||
|
<h4 className="text-xs font-semibold text-slate-200">Kalıntılar Taranıyor...</h4>
|
||||||
|
<p className="text-[11px] text-slate-400 max-w-sm">
|
||||||
|
AppData, ProgramData, Program Files ve Kayıt Defteri anahtarları güvenlik kalkanı altında taranıyor.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
) : cleanReport ? (
|
||||||
|
<div className="py-10 flex flex-col items-center justify-center text-center space-y-3">
|
||||||
|
<div className="w-12 h-12 rounded-full bg-emerald-500/20 text-emerald-400 border border-emerald-500/30 flex items-center justify-center shadow-lg shadow-emerald-500/10">
|
||||||
|
<CheckCircle className="w-6 h-6" />
|
||||||
|
</div>
|
||||||
|
<h4 className="text-sm font-semibold text-slate-100">Kalıntılar Başarıyla Temizlendi!</h4>
|
||||||
|
<p className="text-xs text-slate-300">
|
||||||
|
<span className="font-semibold text-emerald-400">{cleanReport.deleted_items_count}</span> öğe silindi ve{' '}
|
||||||
|
<span className="font-semibold text-emerald-400">{(cleanReport.freed_bytes / 1024 / 1024).toFixed(2)} MB</span> disk alanı açıldı.
|
||||||
|
</p>
|
||||||
|
{cleanReport.backup_file_path && (
|
||||||
|
<div className="mt-2 p-2.5 rounded-lg bg-ld-card border border-ld-border text-[11px] text-slate-400 flex items-center gap-2 max-w-lg">
|
||||||
|
<Archive className="w-4 h-4 text-purple-400 shrink-0" />
|
||||||
|
<span className="truncate">Yedek alındı: {cleanReport.backup_file_path}</span>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
) : leftoverResult && leftoverResult.items.length > 0 ? (
|
||||||
|
<>
|
||||||
|
{/* Özet ve Kontroller */}
|
||||||
|
<div className="flex items-center justify-between text-xs pb-2 border-b border-ld-border/50">
|
||||||
|
<div className="flex items-center gap-3">
|
||||||
|
<span className="text-slate-300 font-medium">
|
||||||
|
Bulunan Kalıntılar: <span className="text-sky-400 font-mono">{leftoverResult.items.length}</span>
|
||||||
|
</span>
|
||||||
|
<span className="text-slate-500">|</span>
|
||||||
|
<span className="text-slate-400">
|
||||||
|
Toplam Boyut: <span className="font-mono text-slate-200">{formatSize(leftoverResult.total_size_bytes)}</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div className="flex items-center gap-2">
|
||||||
|
<button
|
||||||
|
onClick={() => selectAllLeftovers(true)}
|
||||||
|
className="text-[11px] text-sky-400 hover:underline cursor-pointer"
|
||||||
|
>
|
||||||
|
Tümünü Seç
|
||||||
|
</button>
|
||||||
|
<span className="text-slate-600">•</span>
|
||||||
|
<button
|
||||||
|
onClick={() => selectAllLeftovers(false)}
|
||||||
|
className="text-[11px] text-slate-400 hover:underline cursor-pointer"
|
||||||
|
>
|
||||||
|
Seçimi Temizle
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Kalıntı Listesi */}
|
||||||
|
<div className="space-y-1.5 max-h-[46vh] overflow-y-auto pr-1">
|
||||||
|
{leftoverResult.items.map((item) => {
|
||||||
|
const isSelected = selectedLeftoverIds.includes(item.id);
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
key={item.id}
|
||||||
|
onClick={() => toggleSelectLeftover(item.id)}
|
||||||
|
className={`flex items-center justify-between p-2.5 rounded-lg border text-xs transition-all cursor-pointer select-none ${
|
||||||
|
isSelected
|
||||||
|
? 'bg-sky-500/10 border-sky-500/30 text-slate-100'
|
||||||
|
: 'bg-ld-card/60 border-ld-border text-slate-400 hover:bg-white/5'
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
<div className="flex items-center gap-2.5 min-w-0 pr-3">
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
checked={isSelected}
|
||||||
|
onChange={() => {}}
|
||||||
|
className="rounded border-slate-700 bg-slate-900 text-sky-500 focus:ring-0 cursor-pointer"
|
||||||
|
/>
|
||||||
|
{getJunkIcon(item.item_type)}
|
||||||
|
<div className="min-w-0">
|
||||||
|
<p className="font-mono text-[11px] truncate text-slate-200" title={item.path}>
|
||||||
|
{item.path}
|
||||||
|
</p>
|
||||||
|
<p className="text-[10px] text-slate-500">{item.reason}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="flex items-center gap-2 shrink-0">
|
||||||
|
{item.size_bytes > 0 && (
|
||||||
|
<span className="text-[10px] font-mono text-slate-400">
|
||||||
|
{formatSize(item.size_bytes)}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
{getConfidenceBadge(item.confidence)}
|
||||||
|
<button
|
||||||
|
title="Bu yolu korumaya al (İstisna Listesine ekle)"
|
||||||
|
onClick={(e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
addExclusion(item.path);
|
||||||
|
}}
|
||||||
|
className="p-1 rounded text-slate-500 hover:text-emerald-400 hover:bg-emerald-500/10 transition-colors"
|
||||||
|
>
|
||||||
|
<ShieldCheck className="w-3.5 h-3.5" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<div className="py-16 text-center space-y-2">
|
||||||
|
<CheckCircle className="w-8 h-8 text-emerald-400 mx-auto" />
|
||||||
|
<h4 className="text-xs font-semibold text-slate-200">Hiçbir Kalıntı Bulunamadı</h4>
|
||||||
|
<p className="text-[11px] text-slate-500">Uygulama sistemi temiz bırakmış görünüyor.</p>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Alt Butonlar */}
|
||||||
|
<div className="px-5 py-3 border-t border-ld-border bg-ld-card/50 flex items-center justify-between">
|
||||||
|
<label className="flex items-center gap-2 text-xs text-slate-300 cursor-pointer select-none">
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
checked={useRecycleBin}
|
||||||
|
onChange={(e) => setUseRecycleBin(e.target.checked)}
|
||||||
|
className="rounded border-slate-700 bg-slate-900 text-sky-500 focus:ring-0 cursor-pointer"
|
||||||
|
/>
|
||||||
|
<span>Geri Dönüşüm Kutusuna Taşı (Güvenli Silme)</span>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<div className="flex items-center gap-2.5">
|
||||||
|
<button
|
||||||
|
onClick={() => setLeftoverModalOpen(false)}
|
||||||
|
className="px-3 py-1.5 rounded-lg text-xs font-medium text-slate-400 hover:text-slate-200 hover:bg-white/5 transition-colors"
|
||||||
|
>
|
||||||
|
{cleanReport ? 'Kapat' : 'İptal'}
|
||||||
|
</button>
|
||||||
|
{!cleanReport && leftoverResult && leftoverResult.items.length > 0 && (
|
||||||
|
<button
|
||||||
|
disabled={isCleaningLeftovers || selectedLeftoverIds.length === 0}
|
||||||
|
onClick={() => executeLeftoverClean(useRecycleBin)}
|
||||||
|
className="flex items-center gap-1.5 px-4 py-1.5 rounded-lg text-xs font-semibold bg-rose-600 text-white hover:bg-rose-500 shadow-md shadow-rose-600/20 transition-all cursor-pointer disabled:opacity-50"
|
||||||
|
>
|
||||||
|
{isCleaningLeftovers ? (
|
||||||
|
<>
|
||||||
|
<RefreshCw className="w-3.5 h-3.5 animate-spin" />
|
||||||
|
Temizleniyor...
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
<Trash2 className="w-3.5 h-3.5" />
|
||||||
|
Seçilen Kalıntıları Temizle ({selectedLeftoverIds.length})
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||