Compare commits

...
Author SHA1 Message Date
poli0981 7ba2d69214 Merge pull request #69 from poli0981/chore/dotnet-10.0.14
chore(deps): .NET 10.0.14 security update and dependency refresh (2.0.3)
2026-10-26 17:18:14 +07:00
poli0981andClaude Opus 5.5 e8671d8f0a chore(release): 2.0.3
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 17:12:33 +07:00
poli0981andClaude Opus 5.5 8065b091df test: cover the CsWin32 SafeHandle paths of elevation and WinEvent hooks
The CsWin32 update changed how SafeHandles are initialized from native
handles. IsCurrentProcessElevated opens the token of the
GetCurrentProcess pseudo-handle (-1) and is compared with the runtime's
Environment.IsPrivilegedProcess; WinEventWatcher is checked to report a
window move and to stop after Dispose (fails if the hook is not
released).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 17:12:33 +07:00
poli0981andClaude Opus 5.5 238a68763e chore(actions): CodeQL 4.39.1, markdownlint-cli2-action 25.0.0, zizmor 1.31.1
zizmor-action 0.7.1 -> 0.8.0 and the pinned zizmor 1.31.0 -> 1.31.1,
which fixes ignore comments no longer applying to dangerous-triggers.
Dependabot does not update the version input. markdownlint-cli2 0.24.0
reports no issues on the repository.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 17:12:32 +07:00
poli0981andClaude Opus 5.5 1a6ed965a5 chore(deps): .NET 10.0.14 security update, CsWin32 0.3.367
- SDK 10.0.402 -> 10.0.403: the self-contained app now bundles the
  10.0.14 runtime (out-of-band fix for CVE-2026-111497 in the Brotli
  decoder; completes CVE-2026-70197 in SocketAsyncEventArgs).
- Microsoft.Extensions.Hosting and Logging.Abstractions 10.0.13 -> 10.0.14.
- Microsoft.Windows.CsWin32 0.3.363 -> 0.3.367: SafeHandle conversions
  no longer overflow on sign-extended handles; CreateCompatibleBitmap's
  SafeHandle overload gets its own type (not used here).
- Issue template placeholders name the current SDK.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 17:12:32 +07:00
poli0981 c227fcf673 Merge pull request #68 from poli0981/test/shell-launcher
test: cover ShellLauncher's start info, including the elevated path
2026-10-22 19:43:17 +07:00
poli0981andClaude Opus 5.5 e39e613cf7 test: cover ShellLauncher's start info, including the elevated path
The 2.0.2 fix (Explorer by its full path when elevated) had no test, and
its two lines were the only uncovered new code that kept SonarQube
Cloud's quality gate red (coverage on new code 33.3% < 80%).
StartInfo is now a pure function: one test checks that the elevated
path starts explorer.exe from the Windows folder by its full path, the
other that TryOpen returns false for a missing file (not elevated, no
UI, nothing is launched).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 19:36:37 +07:00
poli0981andClaude Opus 5.5 ac378452a8 ci: send the product version to SonarQube Cloud (#67)
Without a project version every analysis reports "not provided", so the
"previous version" new-code period never moves past the first analysis:
the master quality gate measured coverage on all code changed since
2026-10-16 (33.3% < 80%). The scan now passes the version from
Directory.Build.props (eng/Get-BuildInfo.ps1), so new code starts at the
last version change.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 12:28:46 +00:00
dependabot[bot] 280253c3ba chore(actions): Bump zizmorcore/zizmor-action (#66)
Bumps the actions group with 1 update: [zizmorcore/zizmor-action](https://github.com/zizmorcore/zizmor-action).


Updates `zizmorcore/zizmor-action` from 0.7.0 to 0.7.1
- [Release notes](https://github.com/zizmorcore/zizmor-action/releases)
- [Commits](https://github.com/zizmorcore/zizmor-action/compare/f9597c869b2e67095f9b527070297a13a6efe928...85b2b9fb8e3325e7a23d7d0a9d7ba5ae0f999e3e)

---
updated-dependencies:
- dependency-name: zizmorcore/zizmor-action
  dependency-version: 0.7.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-22 12:16:34 +00:00
dependabot[bot] abb6b4ae20 chore(sdk): Bump dotnet-sdk from 10.0.401 to 10.0.402 (#65)
Bumps [dotnet-sdk](https://github.com/dotnet/sdk) from 10.0.401 to 10.0.402.
- [Release notes](https://github.com/dotnet/sdk/releases)
- [Commits](https://github.com/dotnet/sdk/compare/v10.0.401...v10.0.402)

---
updated-dependencies:
- dependency-name: dotnet-sdk
  dependency-version: 10.0.402
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-22 12:13:35 +00:00
poli0981 6db1b4c2a1 Merge pull request #63 from poli0981/ci/sonarcloud-scanner
ci: SonarQube Cloud analysis in CI with SonarScanner for .NET
2026-10-22 19:07:21 +07:00
14 changed files with 121 additions and 19 deletions

No files matched your search

+1 -1
View File
@@ -135,6 +135,6 @@ body:
attributes:
label: IDE / Build Environment
description: If you built from source, which IDE and .NET SDK version? (optional)
placeholder: "JetBrains Rider 2026.2 / .NET SDK 10.0.401"
placeholder: "JetBrains Rider 2026.2 / .NET SDK 10.0.403"
validations:
required: false
+1 -1
View File
@@ -107,6 +107,6 @@ body:
attributes:
label: IDE / Build Environment
description: If relevant, your IDE and .NET SDK version (optional).
placeholder: "JetBrains Rider 2026.2 / .NET SDK 10.0.401"
placeholder: "JetBrains Rider 2026.2 / .NET SDK 10.0.403"
validations:
required: false
+2 -2
View File
@@ -56,7 +56,7 @@ jobs:
global-json-file: global.json
- name: Initialize CodeQL
uses: github/codeql-action/init@6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee # v4.39.0
uses: github/codeql-action/init@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
@@ -67,6 +67,6 @@ jobs:
run: dotnet build AutoClick.slnx -c Release -p:UseSharedCompilation=false
- name: Analyze
uses: github/codeql-action/analyze@6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee # v4.39.0
uses: github/codeql-action/analyze@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
with:
category: /language:${{ matrix.language }}
+1 -1
View File
@@ -35,7 +35,7 @@ jobs:
persist-credentials: false
- name: markdownlint
uses: DavidAnson/markdownlint-cli2-action@21c1be1b93ad9ed58fa840aacc3f279cde2a72ff # v24.2.0
uses: DavidAnson/markdownlint-cli2-action@696eb3f2509270d7b882d2aa68347bc676e7af34 # v25.0.0
with:
globs: '**/*.md'
+1 -1
View File
@@ -36,7 +36,7 @@ jobs:
publish_results: true
- name: Upload to code scanning
uses: github/codeql-action/upload-sarif@6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee # v4.39.0
uses: github/codeql-action/upload-sarif@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
with:
sarif_file: results.sarif
category: scorecard
+9 -1
View File
@@ -49,12 +49,20 @@ jobs:
dotnet tool restore
dotnet restore AutoClick.slnx
- name: Build info
id: info
shell: pwsh
run: ./eng/Get-BuildInfo.ps1
# The product version lets the "previous version" new-code period start at the last version
# change; without it, new code would count from the project's first analysis.
# The scanner provisions its own Java runtime. Build output and restore files are not sources.
- name: Begin analysis
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
VERSION: ${{ steps.info.outputs.version }}
run: >-
dotnet sonarscanner begin /k:poli0981_autoclick /o:poli0981
dotnet sonarscanner begin /k:poli0981_autoclick /o:poli0981 /v:"$env:VERSION"
/d:sonar.host.url=https://sonarcloud.io /d:sonar.token="$env:SONAR_TOKEN"
"/d:sonar.cs.cobertura.reportsPaths=artifacts/test-results/**/*.cobertura.xml"
"/d:sonar.exclusions=**/bin/**,**/obj/**,artifacts/**"
+2 -2
View File
@@ -59,9 +59,9 @@ jobs:
persist-credentials: false
- name: Run zizmor
uses: zizmorcore/zizmor-action@f9597c869b2e67095f9b527070297a13a6efe928 # v0.7.0
uses: zizmorcore/zizmor-action@53290badfa369cb0bf7ad16342cb62c2fa47ac7b # v0.8.0
with:
version: 1.31.0
version: 1.31.1
# Fail the job on findings instead of uploading them to code scanning.
advanced-security: false
persona: regular
+14 -1
View File
@@ -8,6 +8,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
## [Unreleased]
## [2.0.3] - 2026-10-26
Security update of the bundled .NET runtime. Settings, profiles and sessions are unchanged.
### Security
- AutoClick now ships with the .NET 10.0.14 runtime, an out-of-band security update from Microsoft. It fixes an out-of-bounds write in the Brotli decoder (CVE-2026-111497) and completes the October fix for a memory corruption in socket operations (CVE-2026-70197).
### Changed
- Dependencies: Microsoft.Extensions.Hosting 10.0.14 and Microsoft.Windows.CsWin32 0.3.367 (the Win32 interop code generator).
## [2.0.2] - 2026-10-22
Security hardening from a static analysis review (SonarQube Cloud). Settings, profiles and sessions are unchanged.
@@ -366,7 +378,8 @@ Platform bridge release: no feature or data-format changes, so it is safe to upd
- `ManualResetEventSlim` for pause/resume, `CancellationToken` for stop
- `DispatcherTimer` for UI refresh and process monitoring
[Unreleased]: https://github.com/poli0981/autoclick/compare/v2.0.2...HEAD
[Unreleased]: https://github.com/poli0981/autoclick/compare/v2.0.3...HEAD
[2.0.3]: https://github.com/poli0981/autoclick/compare/v2.0.2...v2.0.3
[2.0.2]: https://github.com/poli0981/autoclick/compare/v2.0.1...v2.0.2
[2.0.1]: https://github.com/poli0981/autoclick/compare/v2.0.0...v2.0.1
[2.0.0]: https://github.com/poli0981/autoclick/compare/v1.3.4...v2.0.0
+1 -1
View File
@@ -2,7 +2,7 @@
<!-- Single source of truth for the product version (release tags must match it). -->
<PropertyGroup>
<Version>2.0.2</Version>
<Version>2.0.3</Version>
<AssemblyVersion>$(Version).0</AssemblyVersion>
<FileVersion>$(Version).0</FileVersion>
<InformationalVersion>$(Version)</InformationalVersion>
+3 -3
View File
@@ -12,9 +12,9 @@
<PackageVersion Include="LiveChartsCore" Version="2.0.5" />
<PackageVersion Include="LiveChartsCore.SkiaSharpView" Version="2.0.5" />
<PackageVersion Include="LiveChartsCore.SkiaSharpView.WPF" Version="2.0.5" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="10.0.13" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.13" />
<PackageVersion Include="Microsoft.Windows.CsWin32" Version="0.3.363" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="10.0.14" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.14" />
<PackageVersion Include="Microsoft.Windows.CsWin32" Version="0.3.367" />
<PackageVersion Include="Serilog" Version="4.4.0" />
<PackageVersion Include="Serilog.Extensions.Hosting" Version="10.0.0" />
<PackageVersion Include="Serilog.Sinks.Async" Version="2.1.0" />
+1 -1
View File
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "10.0.401",
"version": "10.0.403",
"rollForward": "latestFeature"
},
"test": {
+6 -4
View File
@@ -19,10 +19,7 @@ public sealed class ShellLauncher(IElevationService elevation)
{
try
{
var startInfo = elevation.IsCurrentProcessElevated
? new ProcessStartInfo(ExplorerPath) { ArgumentList = { target }, UseShellExecute = false }
: new ProcessStartInfo(target) { UseShellExecute = true };
using var process = Process.Start(startInfo);
using var process = Process.Start(StartInfo(target, elevation.IsCurrentProcessElevated));
return true;
}
catch (Exception ex) when (ex is Win32Exception or InvalidOperationException)
@@ -30,4 +27,9 @@ public sealed class ShellLauncher(IElevationService elevation)
return false;
}
}
internal static ProcessStartInfo StartInfo(string target, bool elevated) =>
elevated
? new ProcessStartInfo(ExplorerPath) { ArgumentList = { target }, UseShellExecute = false }
: new ProcessStartInfo(target) { UseShellExecute = true };
}
@@ -0,0 +1,37 @@
using System.IO;
using AutoClick.Core.Abstractions;
namespace AutoClick.Win32.Tests;
public class ShellLauncherTests
{
[Fact]
public void StartInfo_Elevated_StartsExplorerByItsFullPath()
{
var startInfo = ShellLauncher.StartInfo("https://example.com", elevated: true);
// A bare "explorer.exe" would be searched in AutoClick's own, user-writable folder first.
Assert.True(Path.IsPathFullyQualified(startInfo.FileName));
Assert.Equal(Environment.GetFolderPath(Environment.SpecialFolder.Windows), Path.GetDirectoryName(startInfo.FileName), ignoreCase: true);
Assert.Equal("explorer.exe", Path.GetFileName(startInfo.FileName), ignoreCase: true);
Assert.True(File.Exists(startInfo.FileName));
Assert.Equal("https://example.com", Assert.Single(startInfo.ArgumentList));
Assert.False(startInfo.UseShellExecute);
}
[Fact]
public void TryOpen_MissingFile_ReturnsFalse()
{
// Not elevated: the default handler reports the missing file without showing any UI.
var launcher = new ShellLauncher(new NotElevated());
Assert.False(launcher.TryOpen(Path.Combine(Path.GetTempPath(), $"{Guid.NewGuid():N}.autoclick-missing")));
}
private sealed class NotElevated : IElevationService
{
public bool IsCurrentProcessElevated => false;
public ElevationState GetRelativeElevation(int processId) => ElevationState.SameOrLower;
}
}
@@ -23,6 +23,13 @@ public class WindowAndSystemTests
Assert.Equal(ElevationState.Unknown, new ElevationService().GetRelativeElevation(int.MaxValue - 1));
}
[Fact]
public void Elevation_CurrentProcess_MatchesTheRuntime()
{
// Opens the token of the GetCurrentProcess pseudo-handle (-1) through CsWin32's SafeHandle overloads.
Assert.Equal(Environment.IsPrivilegedProcess, new ElevationService().IsCurrentProcessElevated);
}
[Fact]
public void Inspector_InvalidHandle_IsGone()
{
@@ -78,6 +85,41 @@ public class WindowAndSystemTests
});
}
[Fact]
public void WinEventWatcher_LocationChange_ReportsMovesUntilDisposed()
{
StaThread.Run(() =>
{
var window = CreateWindow(Colors.Black);
try
{
var handle = new WindowInteropHelper(window).Handle;
var moved = new TaskCompletionSource();
var moves = 0;
using (WinEventWatcher.LocationChange(handle, Environment.ProcessId, () =>
{
moves++;
moved.TrySetResult();
}))
{
window.Left += 30;
StaThread.PumpUntil(moved.Task, TimeSpan.FromSeconds(5));
Assert.True(moved.Task.IsCompleted, "No location change event arrived.");
}
// Disposing the watcher unhooks it: later moves are not reported.
var reported = moves;
window.Left += 30;
StaThread.PumpFor(TimeSpan.FromMilliseconds(300));
Assert.Equal(reported, moves);
}
finally
{
window.Close();
}
});
}
[Fact]
public void Hotkeys_RegisterReportsConflictsAndReservedKeys()
{