You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/i18n/en/docusaurus-plugin-content-docs/current/quickstart/Avalonia Android cookbook.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,9 @@
1
1
---
2
2
sidebar_position: 4
3
-
title: Avalonia Android Update Quickstart
3
+
title: Avalonia Android Cookbook
4
4
---
5
5
6
-
# GeneralUpdate.Avalonia.Android Quickstart
6
+
# GeneralUpdate.Avalonia.Android Cookbook
7
7
8
8
This guide is for developers who need to integrate Android APK auto-update into their Avalonia applications. The goal is to complete the "check update → download APK → verify SHA256 → launch installer" workflow with minimal code.
Copy file name to clipboardExpand all lines: website/i18n/en/docusaurus-plugin-content-docs/current/quickstart/GeneralUpdate.PacketTool.md
+48-7Lines changed: 48 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ dotnet run --project GeneralUpdate.Tools.csproj
26
26
27
27
Go to [GeneralUpdate.Tools Releases](https://github.com/GeneralLibrary/GeneralUpdate.Tools/releases) and download the executable for your platform.
28
28
29
-
> The Simulation module internally runs `dotnet publish` to build test apps, so you need the .NET SDK for that feature. Patch / Extension / OSS / Config / Mobile modules work without the SDK. However, Mobile's Project Mode (Build & Locate) does require the .NET SDK.
29
+
> The Simulation module internally runs `dotnet publish` to build test apps, so you need the .NET SDK for that feature. The Mobile module's Project Mode (Build & Locate) also runs `dotnet publish`, which requires the .NET SDK too. Patch / Extension / OSS / Config modules and Mobile's File Mode work without the SDK.
30
30
31
31
## Seven modules at a glance
32
32
@@ -353,12 +353,48 @@ Supports two modes:
353
353
### What the tool does internally
354
354
355
355
1.**Format detection**: Identifies package format via file extension (`.apk` / `.aab`) and ZIP internal structure (AndroidManifest.xml location).
356
-
2.**Metadata parsing**: Uses `AxmlParser` to read binary `AndroidManifest.xml` from the ZIP, extracting `package`, `versionName`, `versionCode`.
357
-
3.**SHA256 computation**: Computes SHA256 hash of the full file.
358
-
4.**File size**: Reads file length and formats it for human-readable display (KB/MB/GB).
359
-
5.**Project build** (Project mode only): Runs `dotnet publish -c Release -o {publishDir}`, then auto-locates the output APK/AAB.
360
-
6.**Upload**: Sends file and form fields (Name, Version, Hash, Format, Size, Platform, ProductId, IsForcibly) via HTTP multipart/form-data.
361
-
7.**Version record export**: Generates `mobile_version_{timestamp}.json` with full version metadata after successful upload.
356
+
- APK detection: Opens the ZIP file and checks for `AndroidManifest.xml` at the root.
357
+
- AAB detection: Opens the ZIP file and checks for `base/manifest/AndroidManifest.xml`.
358
+
- If the format is neither `.apk` nor `.aab`, the detector returns Unknown.
359
+
360
+
2.**Metadata parsing**: Uses `AxmlParser` to parse the binary AXML (Android Binary XML) format from the ZIP's `AndroidManifest.xml`. The parsing process works as follows:
361
+
-**String pool extraction**: Reads AXML chunk headers, locates the StringPool chunk (type `0x0001`), and extracts all UTF-16LE encoded strings.
362
+
-**Attribute value extraction**: Walks through Start Element chunks (type `0x0102`), parses the attribute block (20 bytes per attribute), matches attribute names by their string pool index to find `package` and `versionName`, then resolves values via `rawValueIndex` from the string pool.
363
+
-**versionCode extraction**: versionCode is stored as a typed integer attribute (type `0x10` = INT_DEC or `0x11` = INT_HEX), read directly from the `typedValueData` field (offset +16, 4 bytes) as a signed integer.
3.**SHA256 computation**: Computes SHA256 hash of the full file, output as a lowercase hex string.
367
+
368
+
4.**File size**: Reads file length and formats it for human-readable display (B / KB / MB / GB).
369
+
370
+
5.**Project build** (Project mode only): Selecting a `.csproj` triggers:
371
+
-`MobileCsprojParser.Parse()` reads the `.csproj` XML to extract `TargetFramework` (supports single and multi-TFM; auto-selects the one containing `-android`), `ApplicationId` (mapped to PackageName), `ApplicationDisplayVersion` (mapped to VersionName), `ApplicationVersion` (mapped to VersionCode), `UseMaui` (identifies MAUI projects), `AndroidPackageFormat`, and `AssemblyName`.
|`IsForcibly`| Force update toggle |`true` / `false`|
389
+
390
+
The upload service supports the following configuration:
391
+
-**Server URL**: Server base address
392
+
-**Upload Endpoint**: API path, defaults to `/Packet/Create`
393
+
-**Timeout**: Timeout in seconds
394
+
-**Retry Count**: Retry attempts on failure (exponential backoff)
395
+
-**Auth**: Authentication configuration, supports Basic / Bearer Token / API Key modes (credentials stored encrypted via DPAPI)
396
+
397
+
7.**Version record export**: After a successful upload, generates `mobile_version_{timestamp}.json` with full version metadata. You can also use **Export Record Only** to generate the record without uploading — the URL field will be `"manual"`.
362
398
363
399
### Output
364
400
@@ -447,6 +483,11 @@ Use the Mobile module for Android app releases:
447
483
| Simulation port conflict | Change `ServerPort` or free up local port 5000 |
448
484
| Hash mismatch after client download | Re-compute hash on the file that was actually uploaded to CDN/OSS; check for proxy re-compression |
449
485
| Upgrade process doesn't start | Verify `updateAppName` and `updatePath` in `generalupdate.manifest.json` match the publish directory structure |
486
+
| Mobile analysis shows "Metadata extraction warning" | AXML parser could not find the expected attributes. Common causes: the APK uses resource ID references instead of direct string values; or the APK has been packed/obfuscated and the AndroidManifest.xml structure was modified. You can fill in PackageName, VersionName, and VersionCode manually |
487
+
| Mobile Project Mode Build & Locate fails | Verify that the .NET SDK is installed and supports the target framework. Ensure the `.csproj` contains an `-android` target framework. Make sure the output directory `bin/Release/{tfm}/publish/` is not write-protected |
488
+
| Mobile Project Mode "Build output not found" |`dotnet publish` succeeded but no `.apk`/`.aab` was found in the expected directory. Check the `AndroidPackageFormat` setting in `.csproj` (default `aab;apk` produces APK first), and verify that the TFM was resolved correctly |
489
+
| Mobile upload fails | Check that the server URL and endpoint path are configured correctly. Verify the server authentication method (Basic / Bearer / API Key) matches the tool configuration. Review the tool logs for the HTTP status code and error message |
490
+
| Mobile client update fails after upload | Confirm that the version record JSON returned by the server has `Platform` set to `4` (Android), and the `Format` field matches the APK/AAB format the client expects |
Copy file name to clipboardExpand all lines: website/i18n/en/docusaurus-plugin-content-docs/current/quickstart/Maui Android cookbook.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,9 @@
1
1
---
2
2
sidebar_position: 5
3
-
title: MAUI Android Update Quickstart
3
+
title: MAUI Android Cookbook
4
4
---
5
5
6
-
# GeneralUpdate.Maui.Android Quickstart
6
+
# GeneralUpdate.Maui.Android Cookbook
7
7
8
8
This guide is for developers who need to integrate Android APK auto-update into their .NET MAUI applications. The goal is to complete the "check update → download APK → verify SHA256 → launch installer" workflow with minimal code.
0 commit comments