Skip to content

Commit 0f51989

Browse files
CopilotJusterZhu
andauthored
Rewrite bilingual README docs with repository-specific, fully rendered content (#9)
* Initial plan * docs: rewrite bilingual readmes with repository-specific content Co-authored-by: JusterZhu <11714536+JusterZhu@users.noreply.github.com> Agent-Logs-Url: https://github.com/GeneralLibrary/GeneralUpdate.Maui/sessions/c7678fab-a114-4a5a-a4db-70d1141161b9 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: JusterZhu <11714536+JusterZhu@users.noreply.github.com>
1 parent 1c375f5 commit 0f51989

2 files changed

Lines changed: 109 additions & 94 deletions

File tree

README-EN.md

Lines changed: 55 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,59 @@
11
# GeneralUpdate.Maui
22

3-
[![Stars](https://img.shields.io/github/stars/{{GitHub Owner}}/{{Repository Name}}?style=flat-square)](https://github.com/{{GitHub Owner}}/{{Repository Name}}/stargazers)
4-
[![Forks](https://img.shields.io/github/forks/{{GitHub Owner}}/{{Repository Name}}?style=flat-square)](https://github.com/{{GitHub Owner}}/{{Repository Name}}/network/members)
5-
[![License](https://img.shields.io/github/license/{{GitHub Owner}}/{{Repository Name}}?style=flat-square)](./LICENSE)
6-
[![Version](https://img.shields.io/badge/version-{{Version}}-blue?style=flat-square)](https://github.com/{{GitHub Owner}}/{{Repository Name}}/releases)
3+
[![GitHub Stars](https://img.shields.io/github/stars/GeneralLibrary/GeneralUpdate.Maui?style=flat-square)](https://github.com/GeneralLibrary/GeneralUpdate.Maui/stargazers)
4+
[![GitHub Forks](https://img.shields.io/github/forks/GeneralLibrary/GeneralUpdate.Maui?style=flat-square)](https://github.com/GeneralLibrary/GeneralUpdate.Maui/network/members)
5+
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg?style=flat-square)](./LICENSE)
6+
[![NuGet](https://img.shields.io/nuget/v/GeneralUpdate.Maui.Android?style=flat-square)](https://www.nuget.org/packages/GeneralUpdate.Maui.Android/)
77

88
[简体中文](./README.md)
99

1010
---
1111

1212
## Introduction
1313

14-
**GeneralUpdate.Maui** is an auto-update capability library for the .NET MAUI ecosystem, designed to provide a standardized, extensible, and maintainable update workflow.
14+
`GeneralUpdate.Maui` is an update capabilities repository for .NET MAUI applications. Its current core module, `GeneralUpdate.Maui.Android`, provides a UI-free Android auto-update orchestration pipeline targeting `net10.0-android` for .NET MAUI apps.
1515

16-
The project currently focuses on Android and provides a UI-less update orchestration core that can be integrated into enterprise apps, utility libraries, component libraries, and business systems.
16+
The project breaks the update workflow into composable abstractions, so you can replace version comparison, downloading, hash validation, installer launching, logging, and event dispatching based on your architecture.
1717

1818
## Core Features
1919

20-
- **Update validation**: Supports version checks and update eligibility validation.
21-
- **Resumable download**: Implements resumable package downloads based on HTTP Range.
22-
- **Integrity verification**: Built-in SHA256 verification for package integrity and safety.
23-
- **Installer triggering**: Supports Android `FileProvider` and system installer intents.
24-
- **Event-driven workflow**: Exposes lifecycle and download-statistics events for monitoring and extension.
20+
- **UI-free Android update core**: Host applications fully control dialogs, progress, and error presentation.
21+
- **End-to-end update flow**: validation → resumable download → SHA-256 verification → installer launch.
22+
- **Extensible architecture**: `IVersionComparer`, `IUpdateDownloader`, `IHashValidator`, `IApkInstaller`, and more are replaceable.
23+
- **Resumable downloading**: sidecar metadata + streaming writes for better reliability on unstable networks.
24+
- **Unified event model**: built-in validation, progress, completion, and failure events for UI/log integration.
2525

2626
## Quick Start
2727

28-
### 1. Prerequisites
28+
### Prerequisites
2929

30-
- .NET SDK: `{{.NET SDK Version}}` (recommended `10.0` or later)
31-
- Target platform: `{{Target Platform}}` (for example, `Android`)
32-
- Optional IDE: `{{IDE}}` (for example, Visual Studio / JetBrains Rider)
30+
- .NET SDK: `10.0+`
31+
- Platform: `Android (net10.0-android)`
32+
- .NET MAUI: `10.0+`
33+
- Git: `2.30+`
3334

34-
### 2. Installation
35+
### Installation
36+
37+
1. Clone the repository
3538

3639
```bash
37-
dotnet add {{Project Path}} package {{Package Name}} --version {{Package Version}}
40+
git clone https://github.com/GeneralLibrary/GeneralUpdate.Maui.git
41+
cd GeneralUpdate.Maui
3842
```
3943

40-
Or use your project's standard dependency management command:
44+
2. Install dependencies (NuGet package consumption)
4145

4246
```bash
43-
{{Installation Command}}
47+
dotnet add package GeneralUpdate.Maui.Android
4448
```
4549

46-
### 3. Basic Usage
50+
3. Build and test locally (repository development)
51+
52+
```bash
53+
dotnet test src/GeneralUpdate.Maui.Android.Tests/GeneralUpdate.Maui.Android.Tests.csproj -p:TargetFramework=net10.0 -p:TargetFrameworks=net10.0
54+
```
55+
56+
### Basic Usage
4757

4858
```csharp
4959
using GeneralUpdate.Maui.Android.Models;
@@ -58,20 +68,20 @@ bootstrap.AddListenerValidate += (_, e) =>
5868

5969
var package = new UpdatePackageInfo
6070
{
61-
Version = "{{Target Version}}",
62-
VersionName = "{{Target Version Name}}",
63-
ReleaseNotes = "{{Release Notes}}",
64-
DownloadUrl = "{{Download Url}}",
65-
Sha256 = "{{SHA256 Value}}",
66-
PackageSize = {{Package Size}}
71+
Version = "2.3.0",
72+
VersionName = "2.3.0",
73+
ReleaseNotes = "Fixes known issues and improves stability.",
74+
DownloadUrl = "https://example.com/app-release.apk",
75+
Sha256 = "REPLACE_WITH_ACTUAL_SHA256_HASH",
76+
PackageSize = 1024 * 1024 * 50
6777
};
6878

6979
var options = new UpdateOptions
7080
{
71-
CurrentVersion = "{{Current Version}}",
81+
CurrentVersion = "2.2.1",
7282
InstallOptions = new AndroidInstallOptions
7383
{
74-
FileProviderAuthority = "{{FileProvider Authority}}"
84+
FileProviderAuthority = "com.example.app.generalupdate.fileprovider"
7585
}
7686
};
7787

@@ -85,37 +95,34 @@ if (check.IsUpdateAvailable)
8595
## Directory Structure
8696

8797
```text
88-
{{Repository Name}}/
98+
GeneralUpdate.Maui/
99+
├── src/
100+
│ ├── GeneralUpdate.Maui.Android/ # Android auto-update core library
101+
│ └── GeneralUpdate.Maui.Android.Tests/ # Unit tests
89102
├── README.md
90103
├── README-EN.md
91-
├── LICENSE
92-
└── src/
93-
├── GeneralUpdate.Maui.Android/
94-
└── GeneralUpdate.Maui.Android.Tests/
104+
└── LICENSE
95105
```
96106

97107
## Contributing
98108

99-
Contributions are welcome through the standard GitHub collaboration workflow:
100-
101-
1. Fork this repository.
102-
2. Create a feature branch: `git checkout -b feature/{{feature-name}}`.
103-
3. Follow the project coding standards and complete required tests.
104-
4. Commit your changes: `git commit -m "feat: {{change summary}}"`.
105-
5. Push your branch and open a Pull Request.
106-
107-
Before submitting a PR, please make sure:
109+
Contributions are welcome through the standard GitHub workflow:
108110

109-
- your change scope is clear and focused;
110-
- related docs and examples are updated;
111-
- no new security risks or breaking behavior are introduced.
111+
1. Fork this repository and create a branch from `main`: `feature/your-change`.
112+
2. Keep changes focused and follow existing style and naming conventions.
113+
3. Run the existing tests before submitting:
114+
```bash
115+
dotnet test src/GeneralUpdate.Maui.Android.Tests/GeneralUpdate.Maui.Android.Tests.csproj -p:TargetFramework=net10.0 -p:TargetFrameworks=net10.0
116+
```
117+
4. Open a Pull Request describing motivation, implementation details, and compatibility impact.
118+
5. Iterate based on review feedback, then merge and delete the branch.
112119

113120
## License
114121

115122
This project is licensed under the **Apache License 2.0**. See [LICENSE](./LICENSE) for details.
116123

117124
## Contact
118125

119-
- Maintainer: `{{Maintainer Name}}`
120-
- Email: `{{Contact Email}}`
121-
- Issue Tracker: <https://github.com/{{GitHub Owner}}/{{Repository Name}}/issues>
126+
- Repository: https://github.com/GeneralLibrary/GeneralUpdate.Maui
127+
- Issue Tracker: https://github.com/GeneralLibrary/GeneralUpdate.Maui/issues
128+
- Discussions: https://github.com/GeneralLibrary/GeneralUpdate.Maui/discussions

README.md

Lines changed: 54 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,59 @@
11
# GeneralUpdate.Maui
22

3-
[![GitHub Stars](https://img.shields.io/github/stars/GeneralLibrary/GeneralUpdate.Avalonia?style=flat-square)](https://github.com/GeneralLibrary/GeneralUpdate.Avalonia/stargazers)
4-
[![GitHub Forks](https://img.shields.io/github/forks/GeneralLibrary/GeneralUpdate.Avalonia?style=flat-square)](https://github.com/GeneralLibrary/GeneralUpdate.Avalonia/network/members)
3+
[![GitHub Stars](https://img.shields.io/github/stars/GeneralLibrary/GeneralUpdate.Maui?style=flat-square)](https://github.com/GeneralLibrary/GeneralUpdate.Maui/stargazers)
4+
[![GitHub Forks](https://img.shields.io/github/forks/GeneralLibrary/GeneralUpdate.Maui?style=flat-square)](https://github.com/GeneralLibrary/GeneralUpdate.Maui/network/members)
55
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg?style=flat-square)](./LICENSE)
6-
[![NuGet](https://img.shields.io/nuget/v/GeneralUpdate.Avalonia.Android?style=flat-square)](https://www.nuget.org/packages/GeneralUpdate.Avalonia.Android/)
6+
[![NuGet](https://img.shields.io/nuget/v/GeneralUpdate.Maui.Android?style=flat-square)](https://www.nuget.org/packages/GeneralUpdate.Maui.Android/)
77

88
[English](./README-EN.md)
99

1010
---
1111

1212
## 项目简介
1313

14-
**GeneralUpdate.Maui** 是一个面向 .NET MAUI 生态的自动更新能力库,用于帮助项目实现标准化、可扩展且可维护的应用更新流程
14+
`GeneralUpdate.Maui` 是面向 .NET MAUI 应用的更新能力仓库。当前核心模块为 `GeneralUpdate.Maui.Android`,提供 Android 平台自动更新流程编排能力(无 UI),适配 `net10.0-android`,适用于 .NET MAUI 应用
1515

16-
项目当前聚焦 Android 场景,提供无 UI 依赖的更新流程核心能力,可集成至企业应用、工具库、组件库或业务系统中
16+
项目将更新流程拆分为可组合的抽象接口,便于在不同业务场景下替换版本比较、下载、哈希校验、安装拉起、日志与事件分发实现
1717

1818
## 核心特性
1919

20-
- **更新信息校验**支持版本检测与更新条件验证。
21-
- **断点续传下载**基于 HTTP Range 的可恢复下载机制。
22-
- **完整性校验**内置 SHA256 校验,确保安装包安全可靠。
23-
- **安装流程触发**:支持 Android `FileProvider` 与系统安装意图。
24-
- **事件驱动设计**提供更新生命周期与下载统计事件,便于监控与扩展。
20+
- **Android 更新核心(无 UI)**宿主应用可完全控制弹窗、进度和错误展示。
21+
- **完整更新链路**版本校验 → 断点续传下载 → SHA-256 校验 → 安装器拉起。
22+
- **可扩展架构**`IVersionComparer``IUpdateDownloader``IHashValidator``IApkInstaller` 等均可替换。
23+
- **断点续传下载**:支持 sidecar 元数据与流式写入,提升弱网场景稳定性。
24+
- **统一事件通知**提供验证、进度、完成、失败等事件用于 UI/日志集成。
2525

2626
## 快速开始
2727

28-
### 1. 环境准备
28+
### 环境准备
2929

30-
- .NET SDK:`{{.NET SDK Version}}`(建议 `10.0` 或更高版本)
31-
- 目标平台:`{{Target Platform}}`(例如 `Android`
32-
- 可选工具:`{{IDE}}`(例如 Visual Studio / JetBrains Rider)
30+
- .NET SDK:`10.0+`
31+
- 平台:`Android (net10.0-android)`
32+
- .NET MAUI:`10.0+`
33+
- Git:`2.30+`
3334

34-
### 2. 安装步骤
35+
### 安装步骤
36+
37+
1. 克隆仓库
3538

3639
```bash
37-
dotnet add {{Project Path}} package {{Package Name}} --version {{Package Version}}
40+
git clone https://github.com/GeneralLibrary/GeneralUpdate.Maui.git
41+
cd GeneralUpdate.Maui
3842
```
3943

40-
或使用你所在项目的标准依赖管理命令:
44+
2. 安装依赖(以 NuGet 包方式使用)
4145

4246
```bash
43-
{{Installation Command}}
47+
dotnet add package GeneralUpdate.Maui.Android
4448
```
4549

46-
### 3. 基础使用示例
50+
3. 本地构建与测试(仓库开发)
51+
52+
```bash
53+
dotnet test src/GeneralUpdate.Maui.Android.Tests/GeneralUpdate.Maui.Android.Tests.csproj -p:TargetFramework=net10.0 -p:TargetFrameworks=net10.0
54+
```
55+
56+
### 基本使用示例
4757

4858
```csharp
4959
using GeneralUpdate.Maui.Android.Models;
@@ -58,20 +68,20 @@ bootstrap.AddListenerValidate += (_, e) =>
5868

5969
var package = new UpdatePackageInfo
6070
{
61-
Version = "{{Target Version}}",
62-
VersionName = "{{Target Version Name}}",
63-
ReleaseNotes = "{{Release Notes}}",
64-
DownloadUrl = "{{Download Url}}",
65-
Sha256 = "{{SHA256 Value}}",
66-
PackageSize = {{Package Size}}
71+
Version = "2.3.0",
72+
VersionName = "2.3.0",
73+
ReleaseNotes = "修复已知问题并优化稳定性。",
74+
DownloadUrl = "https://example.com/app-release.apk",
75+
Sha256 = "REPLACE_WITH_ACTUAL_SHA256_HASH",
76+
PackageSize = 1024 * 1024 * 50
6777
};
6878

6979
var options = new UpdateOptions
7080
{
71-
CurrentVersion = "{{Current Version}}",
81+
CurrentVersion = "2.2.1",
7282
InstallOptions = new AndroidInstallOptions
7383
{
74-
FileProviderAuthority = "{{FileProvider Authority}}"
84+
FileProviderAuthority = "com.example.app.generalupdate.fileprovider"
7585
}
7686
};
7787

@@ -85,36 +95,34 @@ if (check.IsUpdateAvailable)
8595
## 目录结构
8696

8797
```text
88-
{{Repository Name}}/
98+
GeneralUpdate.Maui/
99+
├── src/
100+
│ ├── GeneralUpdate.Maui.Android/ # Android 自动更新核心库
101+
│ └── GeneralUpdate.Maui.Android.Tests/ # 单元测试
89102
├── README.md
90103
├── README-EN.md
91-
├── LICENSE
92-
└── src/
93-
├── GeneralUpdate.Maui.Android/
94-
└── GeneralUpdate.Maui.Android.Tests/
104+
└── LICENSE
95105
```
96106

97107
## 贡献指南
98108

99109
欢迎通过 GitHub 协作流程参与贡献:
100110

101-
1. Fork 本仓库。
102-
2. 创建特性分支:`git checkout -b feature/{{feature-name}}`
103-
3. 遵循项目代码规范并完成必要测试。
104-
4. 提交变更:`git commit -m "feat: {{change summary}}"`
105-
5. 推送分支并发起 Pull Request。
106-
107-
在提交 PR 前,请确保:
108-
109-
- 变更范围清晰且聚焦;
110-
- 相关文档与示例已同步更新;
111-
- 不引入新的安全风险或破坏性行为。
111+
1. Fork 本仓库并从 `main` 创建分支:`feature/your-change`
112+
2. 保持变更聚焦,并遵循现有代码风格与命名规范。
113+
3. 提交前运行现有测试:
114+
```bash
115+
dotnet test src/GeneralUpdate.Maui.Android.Tests/GeneralUpdate.Maui.Android.Tests.csproj -p:TargetFramework=net10.0 -p:TargetFrameworks=net10.0
116+
```
117+
4. 提交 Pull Request,说明动机、实现方案和兼容性影响。
118+
5. 根据评审反馈迭代,合并后删除分支。
112119

113120
## 许可证
114121

115-
本项目采用 **Apache License 2.0** 开源协议。详情请参见 [LICENSE](./LICENSE)
122+
本项目采用 **Apache License 2.0**。详情请见 [LICENSE](./LICENSE)
116123

117124
## 联系方式
118125

119-
- 维护者:`Juster Zhu`
120-
- 问题反馈:<https://github.com/{{GitHub Owner}}/{{Repository Name}}/issues>
126+
- 仓库地址:https://github.com/GeneralLibrary/GeneralUpdate.Maui
127+
- 问题反馈:https://github.com/GeneralLibrary/GeneralUpdate.Maui/issues
128+
- 讨论交流:https://github.com/GeneralLibrary/GeneralUpdate.Maui/discussions

0 commit comments

Comments
 (0)