Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2dd57b90e5 | ||
|
|
18453dd2d3
|
||
|
|
179e94e128
|
||
|
|
f243521e20
|
||
|
|
2a3ec3976f |
No files matched your search
@@ -11,7 +11,8 @@ on:
|
||||
branches: [master]
|
||||
workflow_dispatch:
|
||||
|
||||
permissions: read-all
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
analysis:
|
||||
|
||||
@@ -41,7 +41,7 @@ jobs:
|
||||
SHA256: 8aca8db96f1b94770f1b0d72b6dddcb1ebb8123cb3712530b08cc387b349a3d8
|
||||
run: |
|
||||
archive="actionlint_${VERSION}_linux_amd64.tar.gz"
|
||||
curl -fsSLo "$archive" "https://github.com/rhysd/actionlint/releases/download/v${VERSION}/${archive}"
|
||||
curl --proto '=https' --tlsv1.2 -fsSLo "$archive" "https://github.com/rhysd/actionlint/releases/download/v${VERSION}/${archive}"
|
||||
echo "${SHA256} ${archive}" | sha256sum --check --strict
|
||||
tar -xzf "$archive" actionlint
|
||||
|
||||
|
||||
+10
-1
@@ -8,6 +8,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [2.0.2] - 2026-10-22
|
||||
|
||||
Security hardening from a static analysis review (SonarQube Cloud). Settings, profiles and sessions are unchanged.
|
||||
|
||||
### Security
|
||||
|
||||
- When AutoClick runs as administrator, links, files and folders are now opened with the Explorer of the Windows folder. Before, Explorer was looked up by name, so a program called `explorer.exe` placed in the AutoClick folder could have been started with administrator rights.
|
||||
|
||||
## [2.0.1] - 2026-10-16
|
||||
|
||||
Fixes for the Dark theme. Settings, profiles and sessions are unchanged.
|
||||
@@ -358,7 +366,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.1...HEAD
|
||||
[Unreleased]: https://github.com/poli0981/autoclick/compare/v2.0.2...HEAD
|
||||
[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.3.4]: https://github.com/poli0981/autoclick/compare/v1.3.3...v1.3.4
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<!-- Single source of truth for the product version (release tags must match it). -->
|
||||
<PropertyGroup>
|
||||
<Version>2.0.1</Version>
|
||||
<Version>2.0.2</Version>
|
||||
<AssemblyVersion>$(Version).0</AssemblyVersion>
|
||||
<FileVersion>$(Version).0</FileVersion>
|
||||
<InformationalVersion>$(Version)</InformationalVersion>
|
||||
|
||||
@@ -116,7 +116,9 @@ public sealed class ClickSession : IDisposable
|
||||
internal void Start()
|
||||
{
|
||||
_logger.LogInformation("Auto-click started for {Process} ({Points} steps)", _info.ProcessName, _info.Points.Count);
|
||||
Completion = Task.Run(RunAsync);
|
||||
// Not the session token: a stop requested before the loop starts would cancel the task
|
||||
// without running it, and the session would never report that it stopped.
|
||||
Completion = Task.Run(RunAsync, CancellationToken.None);
|
||||
}
|
||||
|
||||
public void Pause()
|
||||
|
||||
@@ -34,6 +34,7 @@ public sealed class SingleInstance : IDisposable
|
||||
|
||||
/// <summary>Same names as v1, so v1 and v2 never run side by side.</summary>
|
||||
[SuppressMessage("Security", "CA5350:Do Not Use Weak Cryptographic Algorithms", Justification = "Not security related: the hash only reproduces v1's object names.")]
|
||||
[SuppressMessage("Security", "S4790:Weak hashing algorithms should not be used", Justification = "Not security related: the hash only reproduces v1's object names.")]
|
||||
private static string UserKey { get; } =
|
||||
Convert.ToHexString(SHA1.HashData(Encoding.UTF8.GetBytes(Environment.UserName ?? "default")))[..16];
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Runtime.InteropServices;
|
||||
using AutoClick.Core.Abstractions;
|
||||
using Microsoft.Win32.SafeHandles;
|
||||
@@ -91,6 +92,7 @@ public sealed class ElevationService : IElevationService
|
||||
}
|
||||
}
|
||||
|
||||
[SuppressMessage("Security", "S6640:Unsafe code blocks should not be used", Justification = "Reviewed: CsWin32 has no safe overload; the struct has the size passed to the call.")]
|
||||
private static bool GetOwnElevation()
|
||||
{
|
||||
using var token = OpenOwnToken();
|
||||
@@ -120,6 +122,7 @@ public sealed class ElevationService : IElevationService
|
||||
}
|
||||
|
||||
/// <summary>The integrity level RID (e.g. 0x2000 medium, 0x3000 high), or -1.</summary>
|
||||
[SuppressMessage("Security", "S6640:Unsafe code blocks should not be used", Justification = "Reviewed: CsWin32 has no safe overloads; the buffer has the size the first call reports and stays pinned while it is read.")]
|
||||
private static unsafe int GetIntegrityLevel(SafeHandle token)
|
||||
{
|
||||
PInvoke.GetTokenInformation(token, TOKEN_INFORMATION_CLASS.TokenIntegrityLevel, null, 0, out var size);
|
||||
|
||||
@@ -7,6 +7,10 @@ namespace AutoClick.Win32;
|
||||
/// <summary>Opens URLs, files and folders with their default handler.</summary>
|
||||
public sealed class ShellLauncher(IElevationService elevation)
|
||||
{
|
||||
// A full path: a bare "explorer.exe" is searched in AutoClick's own folder first, which
|
||||
// the user can write to, and would then run with administrator rights.
|
||||
private static string ExplorerPath => Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Windows), "explorer.exe");
|
||||
|
||||
/// <summary>
|
||||
/// When AutoClick runs elevated, the target is opened through Explorer so the browser or
|
||||
/// editor does not inherit administrator rights.
|
||||
@@ -16,7 +20,7 @@ public sealed class ShellLauncher(IElevationService elevation)
|
||||
try
|
||||
{
|
||||
var startInfo = elevation.IsCurrentProcessElevated
|
||||
? new ProcessStartInfo("explorer.exe") { ArgumentList = { target }, UseShellExecute = false }
|
||||
? new ProcessStartInfo(ExplorerPath) { ArgumentList = { target }, UseShellExecute = false }
|
||||
: new ProcessStartInfo(target) { UseShellExecute = true };
|
||||
using var process = Process.Start(startInfo);
|
||||
return true;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Windows.Win32;
|
||||
using Windows.Win32.UI.Accessibility;
|
||||
|
||||
@@ -7,6 +8,7 @@ namespace AutoClick.Win32;
|
||||
/// Out-of-context WinEvent hook. Callbacks arrive on the thread that created the watcher
|
||||
/// (it must pump messages, e.g. the WPF UI thread).
|
||||
/// </summary>
|
||||
[SuppressMessage("Reliability", "S3453:Classes should not have only \"private\" constructors", Justification = "Instances come from the static factories below.")]
|
||||
public sealed class WinEventWatcher : IDisposable
|
||||
{
|
||||
private const uint WinEventOutOfContext = 0x0000;
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using AutoClick.Core.Models;
|
||||
|
||||
namespace AutoClick.Core.Tests;
|
||||
|
||||
[SuppressMessage("Security", "S2245:Pseudorandom number generators (PRNGs) should not be used in security contexts", Justification = "Seeded Random keeps the tests reproducible.")]
|
||||
public class TimingAndColorTests
|
||||
{
|
||||
[Fact]
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using AutoClick.Core.Abstractions;
|
||||
using AutoClick.Core.Models;
|
||||
using AutoClick.Core.Sessions;
|
||||
@@ -13,6 +14,7 @@ public class ClickEngineTests
|
||||
private readonly FakeWindowInspector _window = new();
|
||||
private readonly FakePixelReader _pixels = new();
|
||||
|
||||
[SuppressMessage("Security", "S2245:Pseudorandom number generators (PRNGs) should not be used in security contexts", Justification = "Seeded Random keeps the tests reproducible.")]
|
||||
private ClickEngine CreateEngine() =>
|
||||
new(_input, _window, _pixels, _time, TestLog.For<ClickEngine>(), () => new Random(7));
|
||||
|
||||
|
||||
@@ -7,16 +7,18 @@ internal static class StaThread
|
||||
{
|
||||
public static void Run(Action action)
|
||||
{
|
||||
Exception? failure = null;
|
||||
// The task carries the outcome back; GetResult rethrows a failure with its original stack.
|
||||
var outcome = new TaskCompletionSource();
|
||||
var thread = new Thread(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
action();
|
||||
outcome.SetResult();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
failure = ex;
|
||||
outcome.SetException(ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -26,10 +28,7 @@ internal static class StaThread
|
||||
thread.SetApartmentState(ApartmentState.STA);
|
||||
thread.Start();
|
||||
Assert.True(thread.Join(TimeSpan.FromSeconds(30)), "STA test thread timed out.");
|
||||
if (failure is not null)
|
||||
{
|
||||
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Capture(failure).Throw();
|
||||
}
|
||||
outcome.Task.GetAwaiter().GetResult();
|
||||
}
|
||||
|
||||
/// <summary>Pumps messages until <paramref name="task"/> completes (or the timeout elapses).</summary>
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace AutoClick.Win32.Tests;
|
||||
|
||||
public class StaThreadTests
|
||||
{
|
||||
[Fact]
|
||||
public void Run_TestCodeThrows_RethrowsTheSameException()
|
||||
{
|
||||
var failure = Assert.Throws<InvalidOperationException>(() => StaThread.Run(() => throw new InvalidOperationException("boom")));
|
||||
|
||||
Assert.Equal("boom", failure.Message);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user