# Argus publication requirements for Ikar Android

This repository follows the shared Argus publication instruction:

`G:\Repos\Marketplace\ARGUS_PUBLICATION.md`

That file is the source of truth for publishing any new Ikar Android version to Argus.

## Current rules

- Argus is a read-only public catalog for clients.
- Do not use an HTTP admin API, upload endpoint, token, or browser form for publication.
- Publish only through SSH to the Argus server.
- Store release files under `/srv/argus-data/Packages`.
- Store release metadata in SQLite database `/srv/argus-data/argus.db`.
- Update clients must call only the public manifest endpoint:
  `GET https://argus.kusoft.xyz/api/apps/{slug}/manifest?platform={platform}&channel={channel}`.

## Ikar Android values

- `slug`: `ikar-android`
- `channel`: `stable`
- `platform`: `android`
- `packageKind`: `apk`
- public base URL: `https://argus.kusoft.xyz`

## Local workflow

1. Build and stage a signed APK:

   ```powershell
   .\scripts\prepare-argus-publication.ps1
   ```

2. Publish the staged APK through SSH/SQLite:

   ```powershell
   .\scripts\publish-release.ps1 `
     -SshPassword "<ssh-password>" `
     -Slug "ikar-android" `
     -Name "Ikar" `
     -Summary "<summary>" `
     -Description "<description>" `
     -Version "<semantic-version>" `
     -PackagePath "<path-to-apk>"
   ```

3. Verify the public manifest:

   ```text
   https://argus.kusoft.xyz/api/apps/ikar-android/manifest?platform=android&channel=stable
   ```

## Client update behavior

The Ikar Android updater must:

- treat HTTP 404 from the manifest endpoint as "no compatible release";
- compare the installed app version to `release.version`;
- build the download URL as `https://argus.kusoft.xyz` plus `release.downloadPath` unless `downloadPath` is already absolute;
- download the APK to a temporary/cache file;
- verify the downloaded file with `release.sha256`;
- delete and reject the download on SHA-256 mismatch;
- submit the APK to the Android package installer;
- record the new installed version only after Android reports a successful install.
