# Whole-distribution composition and platform limits

This page separates three deliverables: a Function Package, a prebuilt Lanlet runtime, and a whole client with selected packages preinstalled. Package authors usually need only the first. The owner-approved composition workflow consumes reviewed package bytes plus a reviewed runtime; it does not turn a package author into the Lanlet publisher.

## Inputs and first-run choices

Record each input package's ID, version and SHA-256. Choose either the normal library as first run or one preinstalled package ID. Repeating `--pack` defines the complete initial package set; omitting it uses the product's reviewed official set. Android opens the selected package only on a fresh installation after its local Host is ready. Linux does so only on first use of a fresh profile. A Windows portable EXE is an explicit launcher: each launch asks the current user's Lanlet instance to open its selected target; the standard EXE opens the library. Preinstallation must not downgrade a newer installed package, restore a package a user removed, or make Android/Linux repeatedly force-open a game after upgrade.

Product-maintainer examples, run only in the reviewed product checkout. Android third-party composition must name the publisher's own application ID and provide all four signing values; the script refuses the official ID/test key combination for a third party. Read secrets from the publisher's protected secret store rather than committing them or placing literal passwords in shell history.

```sh
export LANLET_RELEASE_KEYSTORE=/secure/publisher-release.jks
export LANLET_RELEASE_KEY_ALIAS=publisher-release
read -rsp 'Keystore password: ' LANLET_RELEASE_STORE_PASSWORD; export LANLET_RELEASE_STORE_PASSWORD
read -rsp 'Key password: ' LANLET_RELEASE_KEY_PASSWORD; export LANLET_RELEASE_KEY_PASSWORD
./mobile/tool/build-apk.sh --application-id org.example.publisher.score \
  --pack /verified/friends.score.lanlet --first-launch friends.score \
  --build-number 1 --output build/apk/Publisher-Score.apk

python3 tools/build-portable.py --platform windows --version 0.4.7 \
  --runtime /verified/windows-0.4.7-runtime \
  --pack /verified/friends.score.lanlet --first-launch friends.score \
  --output build/portable/Lanlet-Score-Windows-x64.exe

python3 tools/build-portable.py --platform linux --version 0.4.7 \
  --runtime /verified/linux-0.4.7-runtime \
  --pack /verified/friends.score.lanlet --first-launch friends.score \
  --output build/portable/Lanlet-Score-Linux-x64.tar.gz
```

These commands describe the verified handoff method. The [public product repository](https://github.com/lanlet/lanlet) carries the reviewed implementation source and its Android, Windows and Linux build/test instructions; runtime directories remain build inputs rather than website downloads. `--runtime` reuses a native runtime and avoids Dart recompilation. Windows assembly still requires Windows or WSL with Windows interop and the system .NET Framework x64 C# compiler; Linux assembly requires a matching Linux x64 runtime. Android has no no-recompile composition mode in this handoff: it requires Flutter, JDK 21, Android SDK 36 and the reviewed source checkout. Use the public creator CLI for normal package creation. A third-party whole-client publisher needs an authorized runtime/toolchain, its own product identity and signing process. The desktop builder retains Lanlet product identity and is therefore only for an owner-authorized Lanlet distribution, not a generic third-party rebrand.

## Platform-specific acceptance

- Android: third-party distributions use their own application ID and signing key. Do not reuse `dev.lanlet.app`, the official test certificate or an automatically generated production key. An incompatible signing-key change cannot update an existing installation. Do not tell users to erase real data to work around it.
- Windows: current 0.4.7 handoff EXEs are not Authenticode signed. Keep SmartScreen, Smart App Control, antivirus and administrator policy enabled. Verify the exact SHA-256 and signing status; if policy blocks execution, report that result. Never instruct a recipient to disable or bypass safeguards.
- Linux: the portable tarball is x64 and is unpacked before `./Launch-Lanlet`. Login startup uses the user's service manager when available and remains an explicit setting. Archive extraction permissions and the selected desktop environment can affect launching.
- All platforms: first run, return to the library, repeated launch, package export, same-ID update, local storage retention and removal need acceptance on the actual deliverable. Report emulator, WSL or software-renderer testing as such; do not present it as physical-device performance.

## Identity, provenance and signing

SHA-256 proves byte identity, not publisher identity. Record the runtime version, application/package ID, package manifest identities, asset hashes, certificate or signing status, build environment and rights notices. Official release URLs are added only after the corresponding approval group is published through an official GitHub Release. A package may be approved independently from Android, desktop or developer-tool batches.

## Phase 2 forks and compatible implementations

For a Phase 2 whole-client fork, run `git clone https://github.com/lanlet/lanlet.git`, run the repository tests and the target-platform build from its README, then replace application/package IDs, desktop integration identifiers, branding and signing configuration. A compatible client may instead be built independently from [Function Package 1.0](spec/pack.md), [Host Service 1.0](spec/host.md) and [Host Discovery 1.0](spec/discovery.md). Minimum acceptance for either route is original-byte import/export, stable per-ID origins, same-ID higher-version state retention, a fresh-recipient test, path/archive rejection and truthful capability reporting. WebSocket, shared files, access control, discovery and publisher-specific composition are separable capabilities. The MIT source grant does not grant trademarks, official package names, signing identities, independent games or promotional media.

[简体中文](distribution.zh.md)
