# SNYT Van Release Guide

The application uses the same public identifier on both platforms:

- Android package ID: `xyz.snyt.vanapp`
- iOS bundle ID: `xyz.snyt.vanapp`

The current version is read from `pubspec.yaml`; documentation does not hard-code it.

## Permanent release builder

Run exactly one version mode from the project root:

```bash
./tool/release.sh patch
./tool/release.sh minor
./tool/release.sh major
./tool/release.sh build
```

- `patch`: increments the patch version and build number.
- `minor`: increments the minor version, resets patch to zero, and increments the build number.
- `major`: increments the major version, resets minor/patch to zero, and increments the build number.
- `build`: preserves the semantic version and increments only the build number.

Every successful release increments the build number. Existing release directories are never overwritten.

## Safety sequence

Before changing `pubspec.yaml`, the builder runs `flutter analyze` and `flutter test`, then creates a timestamped source snapshot under `project_backups/releases/`. It records the old version, runs dependency resolution, and builds both platforms. A failed release restores the original pubspec version and preserves its build log in a timestamped failed-release directory.

## Outputs

Successful releases are stored under:

```text
releases/<version+build>/
  SNYT-Van-<version+build>-android.apk
  SNYT-Van-<version+build>-ios-unsigned.ipa
  checksums.txt
  release-info.txt
  build.log
```

The Android APK uses the existing permanent keystore configuration and is verified with Android `apksigner`. No new keystore is generated.

The iOS artifact is built with `--no-codesign` and packaged as `Payload/Runner.app`. It is deliberately marked **UNSIGNED** and cannot be installed on a normal iPhone/iPad until signed with a valid Apple identity and provisioning profile. This Mac currently reports zero valid signing identities.

## Android runtime host

The launcher is `xyz.snyt.vanapp.MainActivity`, implemented with Flutter embedding v2 at `android/app/src/main/kotlin/xyz/snyt/vanapp/MainActivity.kt`. The manifest, Gradle namespace, and application ID must remain aligned with that package.

## Release checklist

- Confirm the application launches on the physical Android device.
- Confirm session restore, Dashboard, Returns, Customers, and Catalog.
- Confirm no current fatal exception in Android logs.
- Run the appropriate release command.
- Verify `checksums.txt` and `release-info.txt`.
- Treat the IPA as unsigned until Apple signing is completed.
