GeneralUpdate.Avalonia is a repository focused on update capabilities for Avalonia applications. Its current core module, GeneralUpdate.Avalonia.Android, provides a UI-free Android auto-update pipeline targeting net8.0-android for Avalonia 12+ apps.
The project uses composable abstractions so you can replace version comparison, downloading, hash validation, installer launching, logging, and event dispatching based on your application architecture.
- UI-free Android update core: Host applications fully control dialogs, progress, and error presentation.
- End-to-end update flow: validation → resumable download → SHA-256 verification → installer launch.
- Extensible architecture:
IVersionComparer,IUpdateDownloader,IHashValidator,IApkInstaller, and more are replaceable. - Resumable downloading: sidecar metadata + streaming writes for better reliability on unstable networks.
- Unified event model: built-in validation, progress, completion, and failure events for UI/log integration.
- .NET SDK:
8.0+ - Platform:
Android (net8.0-android) - Avalonia:
12+ - Git:
2.30+
- Clone the repository
git clone https://github.com/GeneralLibrary/GeneralUpdate.Avalonia.git
cd GeneralUpdate.Avalonia- Install dependencies (NuGet package consumption)
dotnet add package GeneralUpdate.Avalonia.Android- Build and test locally (repository development)
dotnet test tests/GeneralUpdate.Avalonia.Android.Tests/GeneralUpdate.Avalonia.Android.Tests.csprojusing GeneralUpdate.Avalonia.Android;
using GeneralUpdate.Avalonia.Android.Models;
var cacheDirPath = Android.App.Application.Context.CacheDir?.AbsolutePath
?? Path.GetTempPath();
var options = new AndroidUpdateOptions
{
DownloadDirectoryPath = Path.Combine(cacheDirPath, "update"),
FileProviderAuthority = "com.example.app.generalupdate.fileprovider"
};
using var bootstrap = GeneralUpdateBootstrap.CreateDefault(options);
var packageInfo = new UpdatePackageInfo
{
Version = "2.3.0",
DownloadUrl = "https://example.com/app-release.apk",
Sha256 = "REPLACE_WITH_ACTUAL_SHA256_HASH",
FileName = "app-release.apk"
};
var check = await bootstrap.ValidateAsync(packageInfo, "2.2.1", CancellationToken.None);
if (check.UpdateFound)
{
var prepared = await bootstrap.DownloadAndVerifyAsync(packageInfo, CancellationToken.None);
if (prepared.Success && prepared.FilePath is not null)
{
await bootstrap.LaunchInstallerAsync(packageInfo, prepared.FilePath, CancellationToken.None);
}
}GeneralUpdate.Avalonia/
├── src/
│ └── GeneralUpdate.Avalonia.Android/ # Android auto-update core library
├── tests/
│ └── GeneralUpdate.Avalonia.Android.Tests/ # Unit tests
├── README.md
├── README-EN.md
└── LICENSE
Contributions are welcome through the standard GitHub workflow:
- Fork this repository and create a branch from
main:feature/{{short-description}}. - Keep changes focused and follow existing style and naming conventions.
- Run the existing tests before submitting:
dotnet test tests/GeneralUpdate.Avalonia.Android.Tests/GeneralUpdate.Avalonia.Android.Tests.csproj - Open a Pull Request describing motivation, implementation details, and compatibility impact.
- Iterate based on review feedback, then merge and delete the branch.
This project is licensed under the Apache License 2.0. See LICENSE for details.