Skip to content

Commit 32402f6

Browse files
authored
Merge pull request #7 from GeneralLibrary/copilot/write-readme-files
Add bilingual root README docs (Chinese + English) with standardized OSS structure
2 parents afa7181 + 616b3ef commit 32402f6

2 files changed

Lines changed: 240 additions & 17 deletions

File tree

README-EN.md

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# GeneralUpdate.Maui
2+
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)
7+
8+
[简体中文](./README.md)
9+
10+
---
11+
12+
## Introduction
13+
14+
**GeneralUpdate.Maui** is an auto-update capability library for the .NET MAUI ecosystem, designed to provide a standardized, extensible, and maintainable update workflow.
15+
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.
17+
18+
## Core Features
19+
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.
25+
26+
## Quick Start
27+
28+
### 1. Prerequisites
29+
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)
33+
34+
### 2. Installation
35+
36+
```bash
37+
dotnet add {{Project Path}} package {{Package Name}} --version {{Package Version}}
38+
```
39+
40+
Or use your project's standard dependency management command:
41+
42+
```bash
43+
{{Installation Command}}
44+
```
45+
46+
### 3. Basic Usage
47+
48+
```csharp
49+
using GeneralUpdate.Maui.Android.Models;
50+
using GeneralUpdate.Maui.Android.Services;
51+
52+
var bootstrap = GeneralUpdateBootstrap.CreateDefault();
53+
54+
bootstrap.AddListenerValidate += (_, e) =>
55+
{
56+
Console.WriteLine($"New version detected: {e.PackageInfo.Version}");
57+
};
58+
59+
var package = new UpdatePackageInfo
60+
{
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}}
67+
};
68+
69+
var options = new UpdateOptions
70+
{
71+
CurrentVersion = "{{Current Version}}",
72+
InstallOptions = new AndroidInstallOptions
73+
{
74+
FileProviderAuthority = "{{FileProvider Authority}}"
75+
}
76+
};
77+
78+
var check = await bootstrap.ValidateAsync(package, options, CancellationToken.None);
79+
if (check.IsUpdateAvailable)
80+
{
81+
await bootstrap.ExecuteUpdateAsync(package, options, CancellationToken.None);
82+
}
83+
```
84+
85+
## Directory Structure
86+
87+
```text
88+
{{Repository Name}}/
89+
├── README.md
90+
├── README-EN.md
91+
├── LICENSE
92+
└── src/
93+
├── GeneralUpdate.Maui.Android/
94+
└── GeneralUpdate.Maui.Android.Tests/
95+
```
96+
97+
## Contributing
98+
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:
108+
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.
112+
113+
## License
114+
115+
This project is licensed under the **Apache License 2.0**. See [LICENSE](./LICENSE) for details.
116+
117+
## Contact
118+
119+
- Maintainer: `{{Maintainer Name}}`
120+
- Email: `{{Contact Email}}`
121+
- Issue Tracker: <https://github.com/{{GitHub Owner}}/{{Repository Name}}/issues>

README.md

Lines changed: 119 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,121 @@
11
# GeneralUpdate.Maui
22

3-
This project is a subproject of GeneralUpdate, designed to be compatible with .NET MAUI.
4-
5-
| Platform | Support | Framework version |
6-
| -------- | ------- | ----------------- |
7-
| Android | Yes | .NET10 |
8-
| Windows | - | - |
9-
| iOS | - | - |
10-
| Mac | - | - |
11-
12-
## Projects
13-
14-
- `GeneralUpdate.Maui.Android`: UI-less Android auto-update core for .NET MAUI, including:
15-
- Update discovery from external metadata
16-
- Resumable APK download via `HttpClient` and HTTP range requests
17-
- SHA256 integrity verification
18-
- Android package installation triggering via `FileProvider` and system installer intent
19-
- Workflow state and event notifications for update lifecycle and download statistics
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)
7+
8+
[English](./README-EN.md)
9+
10+
---
11+
12+
## 项目简介
13+
14+
**GeneralUpdate.Maui** 是一个面向 .NET MAUI 生态的自动更新能力库,用于帮助项目实现标准化、可扩展且可维护的应用更新流程。
15+
16+
项目当前聚焦 Android 场景,提供无 UI 依赖的更新流程核心能力,可集成至企业应用、工具库、组件库或业务系统中。
17+
18+
## 核心特性
19+
20+
- **更新信息校验**:支持版本检测与更新条件验证。
21+
- **断点续传下载**:基于 HTTP Range 的可恢复下载机制。
22+
- **完整性校验**:内置 SHA256 校验,确保安装包安全可靠。
23+
- **安装流程触发**:支持 Android `FileProvider` 与系统安装意图。
24+
- **事件驱动设计**:提供更新生命周期与下载统计事件,便于监控与扩展。
25+
26+
## 快速开始
27+
28+
### 1. 环境准备
29+
30+
- .NET SDK:`{{.NET SDK Version}}`(建议 `10.0` 或更高版本)
31+
- 目标平台:`{{Target Platform}}`(例如 `Android`
32+
- 可选工具:`{{IDE}}`(例如 Visual Studio / JetBrains Rider)
33+
34+
### 2. 安装步骤
35+
36+
```bash
37+
dotnet add {{Project Path}} package {{Package Name}} --version {{Package Version}}
38+
```
39+
40+
或使用你所在项目的标准依赖管理命令:
41+
42+
```bash
43+
{{Installation Command}}
44+
```
45+
46+
### 3. 基础使用示例
47+
48+
```csharp
49+
using GeneralUpdate.Maui.Android.Models;
50+
using GeneralUpdate.Maui.Android.Services;
51+
52+
var bootstrap = GeneralUpdateBootstrap.CreateDefault();
53+
54+
bootstrap.AddListenerValidate += (_, e) =>
55+
{
56+
Console.WriteLine($"发现新版本: {e.PackageInfo.Version}");
57+
};
58+
59+
var package = new UpdatePackageInfo
60+
{
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}}
67+
};
68+
69+
var options = new UpdateOptions
70+
{
71+
CurrentVersion = "{{Current Version}}",
72+
InstallOptions = new AndroidInstallOptions
73+
{
74+
FileProviderAuthority = "{{FileProvider Authority}}"
75+
}
76+
};
77+
78+
var check = await bootstrap.ValidateAsync(package, options, CancellationToken.None);
79+
if (check.IsUpdateAvailable)
80+
{
81+
await bootstrap.ExecuteUpdateAsync(package, options, CancellationToken.None);
82+
}
83+
```
84+
85+
## 目录结构
86+
87+
```text
88+
{{Repository Name}}/
89+
├── README.md
90+
├── README-EN.md
91+
├── LICENSE
92+
└── src/
93+
├── GeneralUpdate.Maui.Android/
94+
└── GeneralUpdate.Maui.Android.Tests/
95+
```
96+
97+
## 贡献指南
98+
99+
欢迎通过 GitHub 协作流程参与贡献:
100+
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+
- 不引入新的安全风险或破坏性行为。
112+
113+
## 许可证
114+
115+
本项目采用 **Apache License 2.0** 开源协议。详情请参见 [LICENSE](./LICENSE)
116+
117+
## 联系方式
118+
119+
- 维护者:`{{Maintainer Name}}`
120+
- 邮箱:`{{Contact Email}}`
121+
- 问题反馈:<https://github.com/{{GitHub Owner}}/{{Repository Name}}/issues>

0 commit comments

Comments
 (0)