Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d757bf455c | ||
|
|
40d42a4d99 | ||
|
|
7bb417c86c | ||
|
|
d3f85d3425 | ||
|
|
058ae8be0c | ||
|
|
e19fb2c761 | ||
|
|
2b4b9f9e37 | ||
|
|
c49c9b66ad | ||
|
|
004f813255 | ||
|
|
53f6395939 | ||
|
|
80518a9e93 | ||
|
|
6d2c43eb11 | ||
|
|
b75ca75b70 | ||
|
|
b1c8213e3e | ||
|
|
e93839b45b | ||
|
|
904183956c | ||
|
|
d2a2799180 | ||
|
|
f5f1f7500d | ||
|
|
e5a952f221 | ||
|
|
c7be52fd7b | ||
|
|
a0d7e69509 | ||
|
|
97f6465d27 | ||
|
|
4903caf607 | ||
|
|
6cbb364c47 | ||
|
|
e140792243 | ||
|
|
45bbb923ca | ||
|
|
e41df5dcc6 | ||
|
|
67d63c9cb6 | ||
|
|
55e654508d | ||
|
|
20edc6db9c | ||
|
|
f8426f7c73 | ||
|
|
09f2aa86c9 | ||
|
|
e8594214a6 | ||
|
|
e3481ba30f | ||
|
|
5841794413 | ||
|
|
549872d581 | ||
|
|
89d356040d | ||
|
|
02601a6696 | ||
|
|
9216224da7 | ||
|
|
70b05d585e | ||
|
|
2760ba162a | ||
|
|
3d5661f1a4 | ||
|
|
10feef0941 | ||
|
|
4e2119ac22 | ||
|
|
2e2bae31f3 | ||
|
|
7ccefe55da | ||
|
|
a76516a5d3 | ||
|
|
1b12719e11 | ||
|
|
3a62cd55b6 |
No files matched your search
@@ -0,0 +1,189 @@
|
||||
name: Android
|
||||
|
||||
# Arcade's own Android APKs, with the whole library for offline play, for an
|
||||
# Arcade release (node-arcade-VERSION). Game updates starts this on the new
|
||||
# release's tag; started by hand on master, it fills in the APKs of the
|
||||
# release master is at. Three signed editions are attached: arcade-VERSION.apk
|
||||
# and arcade-VERSION-fdroid.apk hold no Google library, arcade-VERSION-gplay.apk
|
||||
# is the only one with Play Billing.
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: Arcade release version; empty uses VERSION at the chosen ref
|
||||
required: false
|
||||
type: string
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
concurrency:
|
||||
group: arcade-android-${{ github.ref }}
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
outputs:
|
||||
version: ${{ steps.release.outputs.version }}
|
||||
due: ${{ steps.release.outputs.due }}
|
||||
toolchain: ${{ steps.release.outputs.toolchain }}
|
||||
shovey: ${{ steps.release.outputs.shovey }}
|
||||
steps:
|
||||
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
|
||||
- name: Find the release and its locked dependencies
|
||||
id: release
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
REQUESTED: ${{ inputs.version }}
|
||||
run: |
|
||||
set -eu
|
||||
version=$(cat VERSION)
|
||||
if [ -n "$REQUESTED" ] && [ "$REQUESTED" != "$version" ]; then
|
||||
echo "::error::$GITHUB_REF is at Arcade $version, not $REQUESTED"
|
||||
exit 1
|
||||
fi
|
||||
# The APKs carry exactly the release's catalog and games.
|
||||
gh release view "node-arcade-$version" --json name > /dev/null
|
||||
assets=$(gh release view "node-arcade-$version" --json assets --jq '.assets[].name')
|
||||
due=false
|
||||
for name in "arcade-$version.apk" "arcade-$version-fdroid.apk" "arcade-$version-gplay.apk"; do
|
||||
printf '%s\n' "$assets" | grep -qxF "$name" || due=true
|
||||
done
|
||||
if [ "$due" = false ]; then
|
||||
echo "::notice title=Android::Arcade $version already has its APKs"
|
||||
fi
|
||||
python3 - <<'PY' >> "$GITHUB_OUTPUT"
|
||||
import json
|
||||
lock = json.load(open('ziran.lock'))
|
||||
shovey = lock['root']['dependencies']['shovey']
|
||||
print('toolchain=' + lock['toolchain']['commit'])
|
||||
print('shovey=' + next(p['commit'] for p in lock['packages'] if p['id'] == shovey))
|
||||
PY
|
||||
echo "version=$version" >> "$GITHUB_OUTPUT"
|
||||
echo "due=$due" >> "$GITHUB_OUTPUT"
|
||||
|
||||
build:
|
||||
needs: release
|
||||
if: needs.release.outputs.due == 'true'
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 90
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
edition: [direct, fdroid, gplay]
|
||||
defaults:
|
||||
run:
|
||||
working-directory: waozixyz/arcade
|
||||
steps:
|
||||
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
|
||||
with:
|
||||
path: waozixyz/arcade
|
||||
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
|
||||
with:
|
||||
repository: ziranlang/ziran
|
||||
ref: ${{ needs.release.outputs.toolchain }}
|
||||
path: ziranlang/ziran
|
||||
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
|
||||
with:
|
||||
repository: waozixyz/shovey
|
||||
ref: ${{ needs.release.outputs.shovey }}
|
||||
path: waozixyz/shovey
|
||||
# Only the Google Play edition may name a Google library, in its build
|
||||
# files as in its APK.
|
||||
- name: Keep Google libraries out of the normal and F-Droid build files
|
||||
if: matrix.edition != 'gplay'
|
||||
uses: kryonlabs/kryon/.github/actions/google-free@7217475dfa7f462939e47e3f0bc918aef248b179
|
||||
with:
|
||||
source: waozixyz/arcade
|
||||
- name: Install build dependencies
|
||||
working-directory: .
|
||||
run: |
|
||||
sh ziranlang/ziran/scripts/ci_packages.sh build-essential cmake pkg-config python3-pil python3-numpy python3-cryptography
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: '21'
|
||||
- name: Install the Android SDK parts Kryon's Android host needs
|
||||
working-directory: .
|
||||
run: |
|
||||
sdkmanager="$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager"
|
||||
yes | "$sdkmanager" --licenses > /dev/null
|
||||
"$sdkmanager" --install 'ndk;28.2.13676358' 'build-tools;36.0.0' 'platforms;android-36' 'cmake;3.22.1' > /dev/null
|
||||
- name: Build the locked toolchain and fetch packages
|
||||
run: |
|
||||
make -j2 -C ../../ziranlang/ziran
|
||||
echo "$GITHUB_WORKSPACE/ziranlang/ziran/build/bin" >> "$GITHUB_PATH"
|
||||
# The game is generated in its own checkout at the locked release.
|
||||
printf '[overrides]\nshovey = "../shovey"\nziran = "../../ziranlang/ziran"\n' > ziran.local.toml
|
||||
../../ziranlang/ziran/build/bin/ziran fetch
|
||||
- name: Build the APK
|
||||
env:
|
||||
EDITION: ${{ matrix.edition }}
|
||||
run: |
|
||||
make -C ../shovey levels landscape
|
||||
if [ "$EDITION" = direct ]; then make android; else make "android-$EDITION"; fi
|
||||
- name: Keep Google libraries out of the normal and F-Droid APK
|
||||
if: matrix.edition != 'gplay'
|
||||
uses: kryonlabs/kryon/.github/actions/google-free@7217475dfa7f462939e47e3f0bc918aef248b179
|
||||
with:
|
||||
packages: waozixyz/arcade/build/android/arcade*-unsigned.apk
|
||||
source: ''
|
||||
# The check must still recognise Play Billing, or its passes on the
|
||||
# other editions prove nothing.
|
||||
- name: Find Play Billing in the Google Play APK
|
||||
if: matrix.edition == 'gplay'
|
||||
uses: kryonlabs/kryon/.github/actions/google-free@7217475dfa7f462939e47e3f0bc918aef248b179
|
||||
with:
|
||||
packages: waozixyz/arcade/build/android/arcade-gplay-unsigned.apk
|
||||
source: ''
|
||||
expect-google: 'true'
|
||||
- name: Sign and check the APK
|
||||
env:
|
||||
KEYSTORE: ${{ secrets.ARCADE_ANDROID_KEYSTORE }}
|
||||
PASSWORD: ${{ secrets.ARCADE_ANDROID_KEYSTORE_PASSWORD }}
|
||||
VERSION: ${{ needs.release.outputs.version }}
|
||||
EDITION: ${{ matrix.edition }}
|
||||
run: |
|
||||
set -eu
|
||||
umask 077
|
||||
suffix=$([ "$EDITION" = direct ] && echo '' || echo "-$EDITION")
|
||||
printf '%s' "$KEYSTORE" | base64 -d > "$RUNNER_TEMP/arcade-release.p12"
|
||||
printf '%s\n' "$PASSWORD" > "$RUNNER_TEMP/password"
|
||||
python3 scripts/android-release.py sign "build/android/arcade$suffix-unsigned.apk" \
|
||||
--edition "$EDITION" --version "$VERSION" \
|
||||
--keystore "$RUNNER_TEMP/arcade-release.p12" --password-file "$RUNNER_TEMP/password" \
|
||||
--output "build/downloads/arcade-$VERSION$suffix.apk"
|
||||
rm -f "$RUNNER_TEMP/arcade-release.p12" "$RUNNER_TEMP/password"
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: arcade-android-${{ matrix.edition }}
|
||||
path: waozixyz/arcade/build/downloads/*.apk
|
||||
if-no-files-found: error
|
||||
retention-days: 7
|
||||
|
||||
publish:
|
||||
needs: [release, build]
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
pattern: arcade-android-*
|
||||
path: build/downloads
|
||||
merge-multiple: true
|
||||
- name: Check and attach the APKs to the release
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
VERSION: ${{ needs.release.outputs.version }}
|
||||
run: |
|
||||
set -eu
|
||||
for edition in direct fdroid gplay; do
|
||||
suffix=$([ "$edition" = direct ] && echo '' || echo "-$edition")
|
||||
python3 scripts/android-release.py verify "build/downloads/arcade-$VERSION$suffix.apk" \
|
||||
--edition "$edition" --version "$VERSION"
|
||||
done
|
||||
gh release upload "node-arcade-$VERSION" "build/downloads/arcade-$VERSION.apk" \
|
||||
"build/downloads/arcade-$VERSION-fdroid.apk" "build/downloads/arcade-$VERSION-gplay.apk" --clobber
|
||||
@@ -15,6 +15,7 @@ on:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
actions: write
|
||||
|
||||
concurrency:
|
||||
group: arcade-node-release
|
||||
@@ -127,6 +128,13 @@ jobs:
|
||||
--target "$SHA" --title "Arcade $VERSION" \
|
||||
--notes 'Arcade downloads the selected game separately and preserves earned progress.'
|
||||
echo "Arcade $VERSION is ready for the node: sha256 $(sha256sum build/node-apps/arcade.zx | cut -d' ' -f1)"
|
||||
# Arcade's own APKs build from the release's tag and join its release.
|
||||
- name: Start the Android build
|
||||
if: steps.updates.outputs.changed == 'true'
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
VERSION: ${{ steps.release.outputs.version }}
|
||||
run: gh workflow run android.yml -R "$GITHUB_REPOSITORY" --ref "node-arcade-$VERSION" -f version="$VERSION"
|
||||
# Breeze's node follower signs this release and publishes it to the
|
||||
# node now, not at its next timer. RELEASE_FOLLOW_TOKEN may only start
|
||||
# workflows in Arcade and Breeze; the follower takes no input and
|
||||
|
||||
@@ -10,6 +10,7 @@ on:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
actions: write
|
||||
|
||||
concurrency:
|
||||
group: arcade-node-release
|
||||
@@ -104,4 +105,6 @@ jobs:
|
||||
gh release create "$tag" build/node-apps/arcade.zx build/node-apps/arcade.games.tar build/games/wurm.zx \
|
||||
--target "$GITHUB_SHA" --title "Arcade $version" \
|
||||
--notes 'Arcade downloads the selected game separately and preserves earned progress.'
|
||||
# Arcade's own APKs build from the release's tag and join its release.
|
||||
gh workflow run android.yml -R "$GITHUB_REPOSITORY" --ref "$tag" -f version="$version"
|
||||
fi
|
||||
@@ -48,7 +48,7 @@ jobs:
|
||||
node-version: 22
|
||||
- name: Install build dependencies
|
||||
working-directory: .
|
||||
run: sh ziranlang/ziran/scripts/ci_packages.sh build-essential cmake pkg-config
|
||||
run: sh ziranlang/ziran/scripts/ci_packages.sh build-essential cmake pkg-config python3-pil
|
||||
- uses: mymindstorm/setup-emsdk@v14
|
||||
with:
|
||||
version: '6.0.6'
|
||||
@@ -68,12 +68,15 @@ jobs:
|
||||
-q '[.[] | select(.isDraft | not) | .tagName | select(startswith("node-arcade-"))][0]')
|
||||
test -n "$tag"
|
||||
mkdir -p build/published
|
||||
gh release download "$tag" --repo waozixyz/arcade --pattern arcade.zx --dir build/published
|
||||
# Its game archive holds the library art the site serves itself.
|
||||
gh release download "$tag" --repo waozixyz/arcade --pattern arcade.zx \
|
||||
--pattern arcade.games.tar --dir build/published
|
||||
# The Apps library that release packs, by the digest its own commit trusts.
|
||||
git show "$tag:apps-controller.sha256" > build/published/apps-controller.sha256
|
||||
echo "version=${tag#node-arcade-}" >> "$GITHUB_OUTPUT"
|
||||
- name: Build the browser edition
|
||||
run: |
|
||||
python3 tests/web_library_art_test.py
|
||||
python3 scripts/build-entity.py
|
||||
python3 scripts/build-apps.py --output build/apps-ui
|
||||
python3 scripts/build-web.py --bundle build/published/arcade.zx \
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/build/
|
||||
/backup/
|
||||
/work/
|
||||
/ziran.local.toml
|
||||
__pycache__/
|
||||
*.pyc
|
||||
|
||||
@@ -1,5 +1,101 @@
|
||||
# Arcade changelog
|
||||
|
||||
## 0.7.111
|
||||
|
||||
- Apfelwurm 0.2.27: Earn coins for every level you clear and spend them on new skins.
|
||||
- Apfelwurm 0.2.27: Claim a daily reward from the chest on the title: 30 days of coins, two new skins and rare Dew on days 10 and 25.
|
||||
- Apfelwurm 0.2.27: The title has painted Shop, Profile, Leaderboard and Settings icons, with your coins and Dew beside the Shop.
|
||||
- Apfelwurm 0.2.27: The Shop has Skins, Coins and Dew tabs: buy coin packs with Dew and top up Dew without leaving it.
|
||||
- Apfelwurm 0.2.27: Browse thirteen skins with slimmer bodies, closer segments, clean edges and matching leaderboard pictures.
|
||||
- Apfelwurm 0.2.27: Open the level editor directly from the title. Settings previews both touch control styles, or shows the steering keys on a computer.
|
||||
- Apfelwurm 0.2.27: The level editor has its own title screen. Start a **New level** in any landscape you have reached, or copy one **From a level**.
|
||||
- Apfelwurm 0.2.27: Keep your levels in **My levels**, in collections you can name and reorder. They stay private to you.
|
||||
- Apfelwurm 0.2.27: Share a collection with your friends or everyone, and find other players' collections in **Community**. Added collections become your own private copies.
|
||||
- Apfelwurm 0.2.27: Campaign levels you changed before still play as you made them; **Campaign changes** lists them so you can reset each one.
|
||||
- Apfelwurm 0.2.27: Open the editor as its own **Apfelwurm Editor** app in Arcade.
|
||||
- Apfelwurm 0.2.27: Play local desktop rounds with two to four players, separate bottom entrances and four keyboard control sets.
|
||||
- Apfelwurm 0.2.27: Name each local player and pick their skin; start local rounds from Settings. Each open entrance has rock posts beside it.
|
||||
- Apfelwurm 0.2.27: Play every level in the same layout in portrait and landscape, shaped after the portrait, with roomier portrait boards.
|
||||
- Apfelwurm 0.2.27: Your own portrait level now also shapes its landscape until you save a landscape of your own.
|
||||
- Apfelwurm 0.2.27: On a computer, play starts without asking how to steer, also inside Breeze and Arcade, and the keyboard steers without an on-screen pad.
|
||||
- Apfelwurm 0.2.27: Level 19 is roomier: every side passage is wide enough to turn and come back out.
|
||||
|
||||
## 0.7.110
|
||||
|
||||
- Arcade is available as an Android app that plays every game offline, in normal, F-Droid and Google Play editions.
|
||||
- On arcade.waozi.xyz the game covers appear sooner, as smaller WebP pictures from the site itself.
|
||||
- Editors can share level collections through Arcade's signed-in Entity account.
|
||||
- Shovey 0.6.163: Keep named collections in the Editor, share them with friends or everyone, and add new private collections from Explore.
|
||||
- Shovey 0.6.163: Mirror and laser names and the level heading display correctly in every language.
|
||||
|
||||
## 0.7.109
|
||||
|
||||
- On a computer, games start without asking how to move, also inside Breeze.
|
||||
- Shovey 0.6.162: Coloured pits have new artwork.
|
||||
- Shovey 0.6.162: On a computer, play starts without asking how to move.
|
||||
|
||||
## 0.7.108
|
||||
|
||||
- Every game runs in Inner Breeze 2.1.61's smaller app format.
|
||||
- Shovey 0.6.160, Editor 0.2.145 and Island 0.4.8, and Apfelwurm 0.2.26 with newly painted skins that have calm, plain bodies.
|
||||
|
||||
## 0.7.107
|
||||
|
||||
- Apfelwurm 0.2.24: Keep the entrance area free of enemies: none start there or wander in, so nothing vanishes when you lose a life.
|
||||
- Apfelwurm 0.2.24: Restart Profile and Leaderboard by themselves if they stop, or say why instead of showing an empty page.
|
||||
|
||||
## 0.7.106
|
||||
|
||||
- Apfelwurm 0.2.23: Move a little faster throughout the campaign, with a consistent pace across Meadow.
|
||||
|
||||
## 0.7.105
|
||||
|
||||
- Apfelwurm 0.2.22: Keep the leaderboard visible when you or a friend uses a special Wurm skin.
|
||||
|
||||
## 0.7.104
|
||||
|
||||
- Apfelwurm 0.2.12: Download the Google Play edition as a separate `-gplay.apk`. The standard and F-Droid APKs exclude Google libraries and keep Monero top-ups.
|
||||
|
||||
## 0.7.103
|
||||
|
||||
- Apfelwurm 0.2.11: Buy a small 10 Dew pack in the Google Play edition and see each larger pack’s savings per Dew.
|
||||
|
||||
## 0.7.102
|
||||
|
||||
- Update Apfelwurm and Shovey with a small 10 Dew pack and visible larger-pack savings in their Google Play editions.
|
||||
|
||||
## 0.7.101
|
||||
|
||||
- Apfelwurm 0.2.10: Keep signed-in progress and unfinished runs after closing or updating Apfelwurm inside Arcade and Breeze.
|
||||
- Apfelwurm 0.2.10: Restore earned unlocks from older account saves without changing completed levels or the current run.
|
||||
- Apfelwurm 0.2.10: Give Apfelwurm its own Android launcher icon.
|
||||
|
||||
## 0.7.100
|
||||
|
||||
- Apfelwurm 0.2.9: More portal rooms in the mountains: five more boards have a walled corner room whose doorway closes, so a ring is the only way in, and boards there that bring portals use their room. Seven of the last twenty boards now have a portal room.
|
||||
|
||||
## 0.7.99
|
||||
|
||||
- Shovey 0.6.158: In the Google Play version, buy Dew in Profile through Google Play.
|
||||
- Shovey 0.6.158: Pip explains wooden doors when Shovey walks up to one, rather than when the level starts.
|
||||
- Apfelwurm 0.2.8: After the meadow, a new idea arrives every few dozen levels and keeps coming back: squirrels that dash and sit from level 45, hedgehogs that curl into a spiky ball as you come close from 85, keys that open a gate from 101, frogs that hop two tiles from 125, switch stones that open and close a gate from 141, rolling stones from 165 and portal rooms, reached only through a ring, from 181.
|
||||
- Apfelwurm 0.2.8: Each new idea takes every other board for ten levels. After that, the ideas you have met take turns, with no more than two plain boards in a row.
|
||||
- Apfelwurm 0.2.8: A gate closes a doorway up to four tiles wide. Its key opens it for good and is worth 2 points; a switch stone flips it each time you arrive on it. Boards with a gate or a portal room score more.
|
||||
- Apfelwurm 0.2.8: New pictures for the squirrel, hedgehog, frog, rolling stone, key, switch stone and gate.
|
||||
|
||||
## 0.7.98
|
||||
|
||||
- Shovey 0.6.158: In the Google Play version, buy Dew in Profile through Google Play.
|
||||
- Shovey 0.6.158: Pip explains wooden doors when Shovey walks up to one, rather than when the level starts.
|
||||
|
||||
## 0.7.97
|
||||
|
||||
- Apfelwurm 0.2.6: Glowing portals arrive from level 61: first on a few boards, then more often, with two pairs late in the mountains. Steer into one ring to come out of its partner, keeping your direction. Each ring stands in open ground, so you can always go around it.
|
||||
- Apfelwurm 0.2.6: See your best run on the Profile leaderboard: the furthest level you reached and your highest score, as separate Level and Score columns ranked against your friends.
|
||||
- Apfelwurm 0.2.6: Sign in once for every waozi.xyz site: a profile signed in on Arcade, Dew or here is used by the others in the same browser.
|
||||
- Apfelwurm 0.2.6: Buy Dew inside the Google Play version through Google Play, priced in your own currency. The direct download and F-Droid versions keep buying Dew with Monero.
|
||||
- Apfelwurm 0.2.6: The privacy page explains Google Play purchases and how to delete your account.
|
||||
|
||||
## 0.7.96
|
||||
|
||||
- Shovey 0.6.157: Pip's tips keep what he points at in view: his card moves under the top bar when it would cover it, such as the home in level 1.
|
||||
|
||||
@@ -61,6 +61,7 @@ test: all
|
||||
python3 tests/publisher_test.py
|
||||
python3 tests/apps_controller_test.py
|
||||
python3 tests/startup_art_test.py
|
||||
python3 tests/web_library_art_test.py
|
||||
./build/arcade --list
|
||||
sh tests/chess_engine_zi_test.sh '$(ZIRAN)'
|
||||
sh tests/chess_app_test.sh '$(ZIRAN)'
|
||||
@@ -133,6 +134,26 @@ install: all install-arcade
|
||||
install -m 0644 build/shovey-icon.png '$(DATA_DIR)/icons/hicolor/256x256/apps/xyz.waozi.shovey.png'
|
||||
install -m 0644 packaging/xyz.waozi.arcade.desktop packaging/xyz.waozi.shovey.desktop '$(DATA_DIR)/applications/'
|
||||
|
||||
# Arcade's own APK opens its whole library offline. Each builds an unsigned
|
||||
# release APK in build/android/; only -gplay carries a Google library.
|
||||
# scripts/android-release.py signs and checks them.
|
||||
.PHONY: android android-fdroid android-gplay
|
||||
android: collection
|
||||
python3 scripts/build-android.py --product arcade --release
|
||||
|
||||
android-fdroid: collection
|
||||
python3 scripts/build-android.py --product arcade --release --edition fdroid
|
||||
|
||||
android-gplay: collection
|
||||
python3 scripts/build-android.py --product arcade --release --edition gplay
|
||||
|
||||
# The collection make android packed opens every game offline (desktop host).
|
||||
.PHONY: android-offline-ui-test
|
||||
android-offline-ui-test: build/arcade build/entity.zx
|
||||
env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS \
|
||||
-u SESSION_MANAGER -u GDK_DISPLAY YUE_DESKTOP_RECOVERY=0 SDL_AUDIODRIVER=dummy \
|
||||
timeout 240s xvfb-run -a -n 400 -s '-screen 0 1280x1000x24' python3 tests/android_offline_ui_test.py --binary '$(CURDIR)/build/arcade' --inbe-source '$(INBE_SOURCE)'
|
||||
|
||||
.PHONY: android-shovey android-shovey-release android-shovey-bundle
|
||||
android-shovey: collection
|
||||
python3 scripts/build-android.py
|
||||
|
||||
@@ -123,8 +123,28 @@ make
|
||||
Desktop builds need SDL2, Cairo, FreeType, Fontconfig and Pango development
|
||||
packages, a C compiler, Python 3 and Ziran. `make install` installs the command
|
||||
and desktop-menu entry for the current user; it does not publish a release.
|
||||
Harmony registry delivery and Android builds are not implemented in this first
|
||||
desktop version.
|
||||
|
||||
## Android
|
||||
|
||||
Arcade's APK opens the whole library offline: `make android` packs the
|
||||
collection with every game, its art and the Apps controller, and builds an
|
||||
unsigned release APK in `build/android/`. `make android-fdroid` and
|
||||
`make android-gplay` build the other editions; only `-gplay` carries a Google
|
||||
library (Play Billing). Builds need the Android SDK with NDK 28.2.13676358,
|
||||
build-tools 36.0.0, platform 36 and CMake 3.22.1, and Java 21.
|
||||
|
||||
```sh
|
||||
make android
|
||||
python3 scripts/android-release.py sign build/android/arcade-unsigned.apk --version "$(cat VERSION)"
|
||||
make android-offline-ui-test
|
||||
```
|
||||
|
||||
The release key is `backup/android-signing/arcade-release.p12` (ignored) and
|
||||
the GitHub secrets `ARCADE_ANDROID_KEYSTORE` and
|
||||
`ARCADE_ANDROID_KEYSTORE_PASSWORD`; `packaging/android/certificate.pem` is its
|
||||
public certificate. The Android workflow attaches `arcade-VERSION.apk`,
|
||||
`arcade-VERSION-fdroid.apk` and `arcade-VERSION-gplay.apk` to each
|
||||
`node-arcade-VERSION` release; Game updates starts it for every new release.
|
||||
|
||||
Game packages are registered in `games.json`; each declares its apps in its
|
||||
`apps.json`. `scripts/build-games.py` generates the catalog and bundles
|
||||
@@ -192,8 +212,8 @@ in the person's private data directory.
|
||||
|
||||
## Shovey
|
||||
|
||||
[Shovey](https://github.com/waozixyz/shovey) has its own repository: Classic,
|
||||
Island and Editor, their artwork, puzzles and tests live there. Arcade builds
|
||||
[Shovey](https://github.com/waozixyz/shovey) has its own repository: Classic
|
||||
and the Editor, their artwork, puzzles and tests live there. Arcade builds
|
||||
Shovey from that package and offers it as a separate download. Opening Classic
|
||||
or Editor goes straight to its own screen; Levels lets you replay any unlocked
|
||||
puzzle. Shovey also runs as its own desktop app.
|
||||
|
||||
@@ -1 +1 @@
|
||||
a81eb5b14d2066925d19c3fd922865af40c90673cf54fb11bd7f9bf89a29cb98
|
||||
e41f568fade6b2fc1d622d42d57340ad4743c0cea281f410764b79fcefdf4ec0
|
||||
@@ -1,5 +1,9 @@
|
||||
# Chess changelog
|
||||
|
||||
## [1.2.1] - 2026-10-29
|
||||
|
||||
- Runs in Inner Breeze 2.1.61's smaller app format.
|
||||
|
||||
## [1.2.0] - 2026-10-18
|
||||
|
||||
- Paste one PGN game or a FEN position into the study board.
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"kind": "game",
|
||||
"contract_version": 1,
|
||||
"module_api": 2,
|
||||
"host_api": 12,
|
||||
"host_api": 41,
|
||||
"save_schema": 1,
|
||||
"harnesses": ["arcade", "inbe"],
|
||||
"entry": "chess:Main",
|
||||
|
||||
@@ -1,49 +1,49 @@
|
||||
{
|
||||
"host_api": 12,
|
||||
"oldest_host_api": 12,
|
||||
"host_api": 41,
|
||||
"oldest_host_api": 41,
|
||||
"module_api": 2,
|
||||
"node_apps": {
|
||||
"chess": {
|
||||
"id": "inbe.chess",
|
||||
"title": "Chess",
|
||||
"version": "1.2.0",
|
||||
"sequence": 5,
|
||||
"host_api": 12
|
||||
"version": "1.2.1",
|
||||
"sequence": 6,
|
||||
"host_api": 41
|
||||
},
|
||||
"shovey": {
|
||||
"id": "arcade.shovey",
|
||||
"title": "Shovey",
|
||||
"version": "0.6.157",
|
||||
"sequence": 165,
|
||||
"host_api": 12
|
||||
},
|
||||
"shovey-island": {
|
||||
"id": "arcade.shovey-island",
|
||||
"title": "Shovey Island \u2014 Coming Soon",
|
||||
"version": "0.4.7",
|
||||
"sequence": 11,
|
||||
"host_api": 12
|
||||
"version": "0.6.163",
|
||||
"sequence": 170,
|
||||
"host_api": 41
|
||||
},
|
||||
"shovey-editor": {
|
||||
"id": "arcade.shovey-editor",
|
||||
"title": "Shovey Editor",
|
||||
"version": "0.2.144",
|
||||
"sequence": 146,
|
||||
"host_api": 12
|
||||
"version": "0.2.147",
|
||||
"sequence": 149,
|
||||
"host_api": 41
|
||||
},
|
||||
"arcade": {
|
||||
"id": "inbe.arcade",
|
||||
"title": "Arcade",
|
||||
"version": "0.7.96",
|
||||
"sequence": 175,
|
||||
"host_api": 36
|
||||
"version": "0.7.111",
|
||||
"sequence": 190,
|
||||
"host_api": 41
|
||||
},
|
||||
"wurm": {
|
||||
"id": "xyz.waozi.wurm",
|
||||
"title": "Apfelwurm",
|
||||
"version": "0.2.4",
|
||||
"sequence": 10,
|
||||
"host_api": 12
|
||||
"version": "0.2.27",
|
||||
"sequence": 22,
|
||||
"host_api": 41
|
||||
},
|
||||
"wurm-editor": {
|
||||
"id": "xyz.waozi.wurm-editor",
|
||||
"title": "Apfelwurm Editor",
|
||||
"version": "0.1.0",
|
||||
"sequence": 1,
|
||||
"host_api": 41
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
@@ -9,7 +9,7 @@
|
||||
"source_sha256": "bf0bbeb15249f3d73c1b410e9737f7fd207310dcb5f28b7c3ce45401b77c8f9e"
|
||||
},
|
||||
"shovey-editor-preview": {
|
||||
"source_sha256": "1846b823110fffe82a3dbb319960ce768eefc16699d507d48b8608151eaff430"
|
||||
"source_sha256": "bcbf63563187f9dcdb6c7580f638e2fb2770b221240ee5699e54dc3c00be172c"
|
||||
},
|
||||
"shovey-landscape": {
|
||||
"source_sha256": "40c01eb8300e4c5db52b2d75373e17cdaf7f68140c33c0a225613fc174660747"
|
||||
@@ -21,7 +21,16 @@
|
||||
"source_sha256": "ddcbf989eab5971157d8cdc73494ed03660bb4c7a7679543248f45be260777e3"
|
||||
},
|
||||
"shovey-preview": {
|
||||
"source_sha256": "b1f2e5662cb96f2f5062cb0e5a8cd8ede153173ebc32ad17e26b404f3baf5924"
|
||||
"source_sha256": "96db251f36835c76cd03cd0104a6e1b5096e4c442d410960457edcd8e2377a38"
|
||||
},
|
||||
"wurm-editor-landscape": {
|
||||
"source_sha256": "670255e43a6fd232951fb3d1ce0d62d098d663230d731e7c447c44a944a907d3"
|
||||
},
|
||||
"wurm-editor-portrait": {
|
||||
"source_sha256": "f3475185324e4f4bfa37561f09422546eab5595ab3887d26e684128b2ac9480b"
|
||||
},
|
||||
"wurm-editor-preview": {
|
||||
"source_sha256": "670255e43a6fd232951fb3d1ce0d62d098d663230d731e7c447c44a944a907d3"
|
||||
},
|
||||
"wurm-landscape": {
|
||||
"source_sha256": "472773b7c106325e12777a81a29209496e22e0853782ca76955b6587824b1b30"
|
||||
|
||||
|
After Width: | Height: | Size: 97 KiB |
|
After Width: | Height: | Size: 80 KiB |
|
After Width: | Height: | Size: 114 KiB |
@@ -22,6 +22,18 @@ def ledger = new groovy.json.JsonSlurper().parse(file('../../apps/versions.json'
|
||||
def appRelease = ledger.node_apps[standaloneShovey ? 'shovey' : 'arcade']
|
||||
|
||||
def appCodegen = envOrProp('KRYON_PROJECT_CODEGEN', 'app.codegen') ?: 'c99'
|
||||
// Kryon's three editions: -Papp.edition=direct (the default), fdroid or gplay.
|
||||
// Only the Google Play edition carries a Google library: Kryon's
|
||||
// android-gplay.gradle adds Play Billing (kryon/play_billing), so Entity sells
|
||||
// Dew through Google Play; it needs Android 6 and AndroidX
|
||||
// (-Pandroid.useAndroidX=true). Native code sees GOOGLE_PLAY or FDROID.
|
||||
def appEdition = (project.findProperty('app.edition') ?:
|
||||
(project.findProperty('app.googlePlay') == 'true' ? 'gplay' : 'direct')).toString()
|
||||
if (!(appEdition in ['direct', 'fdroid', 'gplay'])) {
|
||||
throw new GradleException('app.edition must be direct, fdroid or gplay')
|
||||
}
|
||||
def googlePlay = appEdition == 'gplay'
|
||||
def requestedMinSdk = Integer.parseInt((project.findProperty('app.minSdk') ?: '21').toString())
|
||||
def verificationOutput = project.findProperty('app.outputDir')
|
||||
if (verificationOutput != null) { buildDir = file(verificationOutput) }
|
||||
|
||||
@@ -32,11 +44,11 @@ android {
|
||||
|
||||
defaultConfig {
|
||||
applicationId project.findProperty('app.id') ?: (standaloneShovey ? 'xyz.waozi.shovey' : 'xyz.waozi.arcade')
|
||||
minSdk Integer.parseInt((project.findProperty('app.minSdk') ?: '21').toString())
|
||||
minSdk googlePlay ? Math.max(requestedMinSdk, 23) : requestedMinSdk
|
||||
targetSdk 36
|
||||
versionCode Integer.parseInt((project.findProperty('app.versionCode') ?: appRelease.sequence).toString())
|
||||
versionName project.findProperty('app.versionName') ?: appRelease.version
|
||||
manifestPlaceholders = [appLabel: standaloneShovey ? 'Shovey' : 'Arcade', appIcon: standaloneShovey ? '@mipmap/ic_launcher' : '@android:drawable/sym_def_app_icon', zxPlayer: (appCodegen == 'zx').toString(),
|
||||
manifestPlaceholders = [appLabel: standaloneShovey ? 'Shovey' : 'Arcade', appIcon: '@mipmap/ic_launcher', zxPlayer: (appCodegen == 'zx').toString(),
|
||||
nativeLaunchMode: appCodegen == 'zx' ? 'singleTask' : 'standard']
|
||||
ndk {
|
||||
abiFilters += androidAbis
|
||||
@@ -48,7 +60,7 @@ android {
|
||||
'-DRAYLIB_DIR=' + raylibDir,
|
||||
'-DAPP_CODEGEN=' + appCodegen,
|
||||
'-DSHOVEY_STANDALONE=' + (standaloneShovey ? 'ON' : 'OFF'),
|
||||
'-DGOOGLE_PLAY=' + (project.findProperty('app.googlePlay') == 'true' ? 'ON' : 'OFF')
|
||||
'-DAPP_EDITION=' + appEdition
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -62,11 +74,10 @@ android {
|
||||
}
|
||||
|
||||
sourceSets.main.assets.srcDir "${rootProject.projectDir}/../build/entity-assets"
|
||||
// Arcade's collection and receipt, staged by make android.
|
||||
// The collection, its receipt and the launcher icon, staged by make android
|
||||
// (scripts/build-android.py).
|
||||
sourceSets.main.assets.srcDir "${rootProject.projectDir}/../build/${standaloneShovey ? 'android-shovey-assets' : 'android-assets'}"
|
||||
if (standaloneShovey) {
|
||||
sourceSets.main.res.srcDir "${rootProject.projectDir}/../build/android-shovey-res"
|
||||
}
|
||||
sourceSets.main.res.srcDir "${rootProject.projectDir}/../build/${standaloneShovey ? 'android-shovey-res' : 'android-res'}"
|
||||
|
||||
if (appCodegen == 'zx') {
|
||||
sourceSets.main.assets.srcDir "${rootProject.projectDir}/../build/android/zx-assets"
|
||||
@@ -81,6 +92,10 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
if (googlePlay) {
|
||||
apply from: new File(kryonDir, 'templates/android-gplay.gradle')
|
||||
}
|
||||
|
||||
// The shared profile is a host asset, never a child of a game collection.
|
||||
tasks.register('prepareEntity', Exec) {
|
||||
workingDir file('../..')
|
||||
|
||||
@@ -26,8 +26,11 @@ set(APP_ZIRAN_DEFINES --define ANDROID_BUILD)
|
||||
if(SHOVEY_STANDALONE)
|
||||
list(APPEND APP_ZIRAN_DEFINES --define SHOVEY_STANDALONE)
|
||||
endif()
|
||||
if(GOOGLE_PLAY)
|
||||
# The app's edition (build.gradle app.edition): Google Play or F-Droid.
|
||||
if(APP_EDITION STREQUAL "gplay")
|
||||
list(APPEND APP_ZIRAN_DEFINES --define GOOGLE_PLAY)
|
||||
elseif(APP_EDITION STREQUAL "fdroid")
|
||||
list(APPEND APP_ZIRAN_DEFINES --define FDROID)
|
||||
endif()
|
||||
if(NOT DEFINED APP_CODEGEN)
|
||||
set(APP_CODEGEN c99)
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIFBzCCAu+gAwIBAgIIV4HQ6go6XYwwDQYJKoZIhvcNAQEMBQAwMTELMAkGA1UE
|
||||
BhMCUFkxEjAQBgNVBAoTCXdhb3ppLnh5ejEOMAwGA1UEAxMFV2FvemkwIBcNMjYx
|
||||
MDI5MjIwNzU3WhgPMjA3NjEwMjgyMjA3NTdaMDExCzAJBgNVBAYTAlBZMRIwEAYD
|
||||
VQQKEwl3YW96aS54eXoxDjAMBgNVBAMTBVdhb3ppMIICIjANBgkqhkiG9w0BAQEF
|
||||
AAOCAg8AMIICCgKCAgEAxuar9BhVOeDtMIY1xUFfiEFZZlV+kiTDNWgW/3omykxd
|
||||
tPz4Y28FgqkV2SX7eEqzMzrsjJ6Z8U2QD1TsY1cTrxjih1f8yhNP5poZAgD6DhHb
|
||||
ra1DYHXMRJTCJlASUnoZj5xr4M7ha428xit4Fz0IR88TpN6NZsNNwCy5xQSj/cIX
|
||||
fCTo9n/3itJIGpiKas2J4xancfVSXoLpGBaXf/Vaf/w0UfTxIgImam/U/mx366M+
|
||||
Vv23XPLBa6csT1EjKTOTB6Oyj3fxDJ/HI7T0pm86eA7hvu+LrQ1v2q1I7DwUg5RG
|
||||
HoAeFsNnsHSEluVdnuD+7ESnKTkoNlQe8cAiBXvlpcw6uDdpp/2oMktdrd4xt1tU
|
||||
ozVqiPrvvF/G0Ki1MCS9PXJ6FERBQVjaklPYVa8c2tuXvTcX6VNCpcyFqgNo6AUk
|
||||
nNkhOhPJ2R0OhQGloG5CcdkjHY1W60gudQKK9MMLjf2+or7ewl/nOkHKhPUKjBQO
|
||||
UjTlRG6M+hOzZ/rI+LIJsxCZD4xAP6g2oyH0ROR8SXm3x7l+VZ7r9qW0i8cKxOvC
|
||||
IlX/JQfUkAwcyK0HPQVUPutvtySiMSefZTczvvi+YmiDqr+cxW0T9388SxV+lKQz
|
||||
Rz+6Tby6OyRDM6bJtXaqZTH+lSdmrAI/lbBx5+Yx8+xgHcfgGbpU2h+WOnqwtCEC
|
||||
AwEAAaMhMB8wHQYDVR0OBBYEFPTOgtLO/ZKqfXFOQshN7JHi5yVyMA0GCSqGSIb3
|
||||
DQEBDAUAA4ICAQCxiEH8bPrJlkin92zESDrwXqyfNc7VuoFrANxCD4Mu6/rGU+4V
|
||||
UIVz3BPhDFZV281ztD0eSJef+P5UX/k4Y0pVIzw82iKAjaMiu8wFZghcFsaADQQn
|
||||
YEqrU9158++2H2nsxSL2uSen8qPOea7IMll9SUtg+YqAkXqEToqIv60SDFZUpKnb
|
||||
O3W/NYzVqNKYCk7/HcOYuNf5r76EGVYz6aPHP1CgEpnXNC8NotbH24ZNF3Zgy+UP
|
||||
ypoNx1jffUK+wQbXkE+IadBhw7B1vPIzCZji1zz54sBxhqvTAKCWE10fMEllSu3v
|
||||
HRB0x4feOs4tfuX38UdUrFHDxG7vrrNrCRDwnQ6k6FWUVpJRM9CV9jbUe0bcBQfP
|
||||
SpqJfQMOXPVET799rC4lW4HMGIhfoTkPymYuWZAZx4pF3SYLHor7cQv05a3RuvjP
|
||||
46xkz9ZA9HNU6P2+mgpRuuFSbxyxi5uyT9z5J/vrU45wq2UjwdNn8J/3o4ITcT9o
|
||||
jP20JOHovIrprLi8Wzpb/0o1BagRuqlfVoCJrRNCpoZY98ynAM9swlgL+s5O9LVo
|
||||
mTTtZdDoTyMN+IXxark7oHjUHhWgd/VThTXJu1rQ++vSh/GajYRSOKDjxayGHBp2
|
||||
rjWy9esT5/VdzFlMfOZefeEjSol8tZdjNCCmWRFuOqF+zw7Lc4I5fXqK8g==
|
||||
-----END CERTIFICATE-----
|
||||
@@ -0,0 +1,119 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Sign and verify Arcade's Android APKs: the normal and F-Droid editions,
|
||||
which hold no Google library, and the Google Play edition, the only one with
|
||||
Play Billing. Each carries the whole library for offline play."""
|
||||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
import zipfile
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
ABIS = ['arm64-v8a', 'armeabi-v7a']
|
||||
|
||||
|
||||
def build_tools():
|
||||
sdk = Path(os.environ.get('ANDROID_SDK_ROOT') or os.environ.get('ANDROID_HOME') or Path.home() / 'Android/Sdk')
|
||||
folders = sorted((sdk / 'build-tools').glob('*'), key=lambda p: tuple(int(n) for n in re.findall(r'\d+', p.name)))
|
||||
return next(p for p in reversed(folders) if all((p / name).is_file() for name in ('aapt', 'apksigner', 'zipalign')))
|
||||
|
||||
|
||||
def verify(apk, version, tools, edition='direct'):
|
||||
assert re.fullmatch(r'\d+\.\d+\.\d+', version), 'A numeric release version is required'
|
||||
changelog = (ROOT / 'CHANGELOG.md').read_text()
|
||||
assert re.search(r'^## \[?' + re.escape(version) + r'\]?\s', changelog, re.M), 'Release version is absent from the changelog'
|
||||
badging = subprocess.check_output([str(tools / 'aapt'), 'dump', 'badging', str(apk)], text=True)
|
||||
package = re.search(r"^package: name='([^']+)' versionCode='(\d+)' versionName='([^']+)'", badging, re.M)
|
||||
assert package and package[1] == 'xyz.waozi.arcade' and package[3] == version, 'APK identity or version differs'
|
||||
assert "application-label:'Arcade'" in badging, 'The APK is not labelled Arcade'
|
||||
# Release builds shorten resource names; the manifest names the icon.
|
||||
icon = re.search(r"^application: label='Arcade' icon='(res/[^']+\.png)'", badging, re.M)
|
||||
assert icon, "Arcade's launcher icon is missing"
|
||||
assert 'application-debuggable' not in badging, 'A debug build cannot be published'
|
||||
google_play = edition == 'gplay'
|
||||
assert ("'com.android.vending.BILLING'" in badging) == google_play, \
|
||||
'Only the Google Play edition may ask for Play Billing'
|
||||
certificate = subprocess.check_output(['openssl', 'x509', '-in', str(ROOT / 'packaging/android/certificate.pem'), '-outform', 'DER'])
|
||||
expected = hashlib.sha256(certificate).hexdigest()
|
||||
signature = subprocess.check_output([str(tools / 'apksigner'), 'verify', '--verbose', '--print-certs', str(apk)], text=True)
|
||||
actual = re.findall(r'^(?:Signer #\d+|V[\d.]+ Signer:) certificate SHA-256 digest: ([0-9a-f]+)$', signature, re.M)
|
||||
assert 'Number of signers: 1' in signature and set(actual) == {expected}, 'APK signer differs from the Arcade release certificate'
|
||||
subprocess.run([str(tools / 'zipalign'), '-c', '-P', '16', '4', str(apk)], check=True, capture_output=True)
|
||||
with zipfile.ZipFile(apk) as archive:
|
||||
names = archive.namelist()
|
||||
abis = sorted(p.split('/')[1] for p in names if re.fullmatch(r'lib/[^/]+/libmain\.so', p))
|
||||
assert abis == ABIS, 'Both supported ARM architectures must be present'
|
||||
assert icon[1] in names, "Arcade's launcher icon is missing"
|
||||
metadata = json.loads(archive.read('assets/arcade.json'))
|
||||
payload = archive.read('assets/arcade.zx')
|
||||
assert metadata['id'] == 'inbe.arcade' and metadata['version'] == version
|
||||
assert metadata['sha256'] == hashlib.sha256(payload).hexdigest(), 'Embedded collection differs from its receipt'
|
||||
# Offline play: every game in the catalog is packed into the collection.
|
||||
assert metadata.get('games') == 'packed' and 'art' not in metadata and metadata['children'], \
|
||||
'The collection must pack its games and art'
|
||||
for child in metadata['children']:
|
||||
assert child['bundle'].encode() in payload, f"{child['id']} is not packed for offline play"
|
||||
dex = b''.join(archive.read(name) for name in names if re.fullmatch(r'classes\d*\.dex', name))
|
||||
for marker in (b'Lorg/kryonlabs/play/PlayBilling;', b'Lcom/android/billingclient/'):
|
||||
assert (marker in dex) == google_play, 'Only the Google Play edition may include Play Billing'
|
||||
return dict(version=version, version_code=int(package[2]), package=package[1], abis=abis, edition=edition,
|
||||
sha256=hashlib.sha256(apk.read_bytes()).hexdigest(), certificate_sha256=expected,
|
||||
payload_sha256=metadata['sha256'], games=[child['id'] for child in metadata['children']],
|
||||
bytes=apk.stat().st_size)
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('action', choices=('sign', 'verify'))
|
||||
parser.add_argument('apk', type=Path)
|
||||
parser.add_argument('--version', required=True)
|
||||
parser.add_argument('--edition', choices=('direct', 'fdroid', 'gplay'), default='direct')
|
||||
parser.add_argument('--output', type=Path, help='Signed APK; build/android/arcade-VERSION[-EDITION].apk by default')
|
||||
parser.add_argument('--keystore', type=Path, default=ROOT / 'backup/android-signing/arcade-release.p12')
|
||||
parser.add_argument('--password-file', type=Path, default=ROOT / 'backup/android-signing/password')
|
||||
parser.add_argument('--alias', default='arcade')
|
||||
args = parser.parse_args()
|
||||
tools = build_tools()
|
||||
apk = args.apk.resolve(strict=True)
|
||||
if args.action == 'verify':
|
||||
verify(apk, args.version, tools, args.edition)
|
||||
print(f'Arcade {args.version} {args.edition}: APK identity, signer, alignment and offline games verified')
|
||||
return
|
||||
suffix = '' if args.edition == 'direct' else '-' + args.edition
|
||||
output = (args.output or ROOT / f'build/android/arcade-{args.version}{suffix}.apk').resolve()
|
||||
output.parent.mkdir(parents=True, exist_ok=True)
|
||||
aligned = output.with_name(output.stem + '.aligned-unsigned.apk')
|
||||
temporary = output.with_name(output.stem + '.new.apk')
|
||||
if subprocess.run([str(tools / 'zipalign'), '-c', '-P', '16', '4', str(apk)], capture_output=True).returncode == 0:
|
||||
shutil.copyfile(apk, aligned)
|
||||
else:
|
||||
subprocess.run([str(tools / 'zipalign'), '-P', '16', '-f', '4', str(apk), str(aligned)], check=True)
|
||||
try:
|
||||
# Keep the aligned entries as they are, so a rebuild from source can
|
||||
# take this signature unchanged.
|
||||
subprocess.run([str(tools / 'apksigner'), 'sign', '--alignment-preserved',
|
||||
'--ks', str(args.keystore.resolve(strict=True)), '--ks-key-alias', args.alias,
|
||||
'--ks-pass', 'file:' + str(args.password_file.resolve(strict=True)),
|
||||
'--out', str(temporary), str(aligned)], check=True)
|
||||
finally:
|
||||
aligned.unlink(missing_ok=True)
|
||||
try:
|
||||
result = verify(temporary, args.version, tools, args.edition)
|
||||
except BaseException:
|
||||
temporary.unlink(missing_ok=True)
|
||||
raise
|
||||
temporary.replace(output)
|
||||
temporary.with_name(temporary.name + '.idsig').unlink(missing_ok=True)
|
||||
result['apk'] = str(output)
|
||||
records = ROOT / 'backup/android-release'
|
||||
records.mkdir(parents=True, exist_ok=True)
|
||||
(records / f'verification{suffix}.json').write_text(json.dumps(result, indent=2) + '\n')
|
||||
print(f'Arcade {args.version} {args.edition}: signed {output}; identity, signer, alignment and offline games verified')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Package Arcade's existing native host with the standalone Shovey collection."""
|
||||
"""Package Arcade's native Android host: Arcade with its whole library offline,
|
||||
or the older standalone Shovey collection."""
|
||||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
@@ -14,15 +15,51 @@ ROOT = Path(__file__).resolve().parents[1]
|
||||
def package(name):
|
||||
return Path(subprocess.check_output([str(ROOT / 'scripts/ziran.sh'), 'pkg', 'path', name], cwd=ROOT, text=True).strip())
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('--release', action='store_true', help='Build an unsigned release APK for the release signer')
|
||||
parser.add_argument('--bundle', action='store_true', help='Build an unsigned release Android App Bundle for Google Play')
|
||||
parser.add_argument('--application-id', help='Use an isolated package for device tests')
|
||||
parser.add_argument('--abis', default='arm64-v8a,armeabi-v7a', help='Native ABIs to build')
|
||||
parser.add_argument('--build-dir', type=Path, help='Separate Gradle and CMake output for verification')
|
||||
args = parser.parse_args()
|
||||
subprocess.run(['make', 'build/entity.zx'], cwd=ROOT, check=True)
|
||||
def ziran_bundle(*arguments):
|
||||
# A local checkout overrides packages in ziran.local.toml, as make does.
|
||||
locked = [] if (ROOT / 'ziran.local.toml').exists() else ['--locked']
|
||||
subprocess.run([str(ROOT / 'scripts/ziran.sh'), 'bundle', '--project', *locked, *arguments],
|
||||
cwd=ROOT, check=True)
|
||||
|
||||
def launcher_icon(source, resources):
|
||||
"""Density variants are mechanical packaging of the original logo."""
|
||||
icon = Image.open(source).convert('RGBA')
|
||||
if resources.exists():
|
||||
shutil.rmtree(resources)
|
||||
for density, size in (('mdpi', 48), ('hdpi', 72), ('xhdpi', 96), ('xxhdpi', 144), ('xxxhdpi', 192)):
|
||||
folder = resources / ('mipmap-' + density)
|
||||
folder.mkdir(parents=True)
|
||||
icon.resize((size, size), Image.Resampling.LANCZOS).save(folder / 'ic_launcher.png')
|
||||
|
||||
def stage_arcade():
|
||||
"""Pack the staged collection with its games, art and Apps controller, so
|
||||
the APK opens the whole library offline. Returns Arcade's release."""
|
||||
collection = ROOT / 'build/collection'
|
||||
receipt = json.loads((collection / 'receipt.json').read_text())
|
||||
release = json.loads((ROOT / 'apps/versions.json').read_text())['node_apps']['arcade']
|
||||
if receipt['version'] != release['version'] or receipt['version'] != (ROOT / 'VERSION').read_text().strip():
|
||||
raise ValueError('The Arcade version changed; rebuild the collection first')
|
||||
controller = (collection / 'assets/apps/apps.zx').read_bytes()
|
||||
if hashlib.sha256(controller).hexdigest() != receipt['apps_sha256']:
|
||||
raise ValueError('The staged Apps controller differs from the receipt')
|
||||
assets = ROOT / 'build/android-assets'
|
||||
if assets.exists():
|
||||
shutil.rmtree(assets)
|
||||
assets.mkdir(parents=True)
|
||||
ziran_bundle('--root', str(ROOT / 'src'), '--entry', 'collection:Main',
|
||||
'--asset-dir', 'assets=' + str(collection / 'assets'), '-o', str(assets / 'arcade.zx'),
|
||||
str(ROOT / 'src/collection.zi'))
|
||||
# The library packs its games and art: the host downloads nothing.
|
||||
offline = {key: value for key, value in receipt.items() if key != 'art'} | {'games': 'packed'}
|
||||
offline['sha256'] = hashlib.sha256((assets / 'arcade.zx').read_bytes()).hexdigest()
|
||||
(assets / 'arcade.json').write_text(json.dumps(offline, indent=2) + '\n')
|
||||
# Android before 10 has no font lookup; the Windows build ships the same font.
|
||||
shutil.copyfile(package('kryon') / 'assets/fonts/LiberationSans-Regular.ttf', assets / 'kryon-font.ttf')
|
||||
launcher_icon(ROOT / 'site/icon-512.png', ROOT / 'build/android-res')
|
||||
return release
|
||||
|
||||
def stage_shovey():
|
||||
"""Shovey's standalone collection from Arcade's staging. Returns its release."""
|
||||
metadata = json.loads((ROOT / 'build/shovey.json').read_text())
|
||||
payload = (ROOT / 'build/shovey.zx').read_bytes()
|
||||
if hashlib.sha256(payload).hexdigest() != metadata['sha256']:
|
||||
@@ -34,27 +71,45 @@ def main():
|
||||
assets.mkdir(parents=True, exist_ok=True)
|
||||
for suffix in ('zx', 'json'):
|
||||
shutil.copyfile(ROOT / f'build/shovey.{suffix}', assets / f'arcade.{suffix}')
|
||||
# Android before 10 has no font lookup; the Windows build ships the same font.
|
||||
shutil.copyfile(package('kryon') / 'assets/fonts/LiberationSans-Regular.ttf', assets / 'kryon-font.ttf')
|
||||
# Density variants are mechanical packaging of the original generated logo.
|
||||
icon = Image.open(package('shovey') / 'assets/branding/shovey-icon.png').convert('RGBA')
|
||||
resources = ROOT / 'build/android-shovey-res'
|
||||
for density, size in (('mdpi', 48), ('hdpi', 72), ('xhdpi', 96), ('xxhdpi', 144), ('xxxhdpi', 192)):
|
||||
folder = resources / ('mipmap-' + density)
|
||||
folder.mkdir(parents=True, exist_ok=True)
|
||||
icon.resize((size, size), Image.Resampling.LANCZOS).save(folder / 'ic_launcher.png')
|
||||
launcher_icon(package('shovey') / 'assets/branding/shovey-icon.png', ROOT / 'build/android-shovey-res')
|
||||
return release
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('--product', choices=('shovey', 'arcade'), default='shovey',
|
||||
help='arcade: Arcade with its whole library; shovey: the standalone Shovey collection')
|
||||
parser.add_argument('--release', action='store_true', help='Build an unsigned release APK for the release signer')
|
||||
parser.add_argument('--edition', choices=('direct', 'fdroid', 'gplay'), default='direct',
|
||||
help='The APK edition; only gplay carries a Google library')
|
||||
parser.add_argument('--bundle', action='store_true',
|
||||
help="Build the Google Play edition's unsigned release Android App Bundle")
|
||||
parser.add_argument('--application-id', help='Use an isolated package for device tests')
|
||||
parser.add_argument('--abis', default='arm64-v8a,armeabi-v7a', help='Native ABIs to build')
|
||||
parser.add_argument('--build-dir', type=Path, help='Separate Gradle and CMake output for verification')
|
||||
args = parser.parse_args()
|
||||
arcade = args.product == 'arcade'
|
||||
if arcade and args.bundle:
|
||||
parser.error('Arcade builds APKs; the App Bundle is the standalone Shovey one')
|
||||
subprocess.run(['make', 'build/entity.zx'], cwd=ROOT, check=True)
|
||||
release = stage_arcade() if arcade else stage_shovey()
|
||||
sdk = Path(os.environ.get('ANDROID_SDK_ROOT') or os.environ.get('ANDROID_HOME') or Path.home() / 'Android/Sdk')
|
||||
env = {key: value for key, value in os.environ.items() if key not in ('DISPLAY', 'WAYLAND_DISPLAY', 'XAUTHORITY', 'DBUS_SESSION_BUS_ADDRESS')}
|
||||
env.update(ANDROID_HOME=str(sdk), ANDROID_SDK_ROOT=str(sdk),
|
||||
LIBOQS_DIR=str(package('liboqs')), MONOCYPHER_DIR=str(package('monocypher')))
|
||||
command = ['sh', str(ROOT / 'droid/gradlew'), '-p', str(ROOT / 'droid'), '--no-daemon', '--max-workers=2',
|
||||
'-Papp.product=shovey', '-Papp.abis=' + args.abis,
|
||||
'-Papp.googlePlay=' + ('true' if args.bundle else 'false'),
|
||||
'-Papp.product=' + args.product, '-Papp.abis=' + args.abis,
|
||||
'-Pkryon.dir=' + str(package('kryon')), '-Pziran.dir=' + str(package('ziran')),
|
||||
'-Praylib.dir=' + str(package('raylib') / 'src'),
|
||||
'-Papp.versionName=' + metadata['version'], '-Papp.versionCode=' + str(release['sequence']),
|
||||
'-Papp.versionName=' + release['version'], '-Papp.versionCode=' + str(release['sequence']),
|
||||
'-Pandroid.aapt2FromMavenOverride=' + str(sdk / 'build-tools/36.0.0/aapt2'),
|
||||
'bundleRelease' if args.bundle else 'assembleRelease' if args.release else 'assembleDebug']
|
||||
# Kryon's Google Play edition adds Play Billing, so Dew is bought through Play.
|
||||
edition = 'gplay' if args.bundle else args.edition
|
||||
if edition == 'gplay':
|
||||
command[-1:-1] = ['-Papp.edition=gplay', '-Pandroid.useAndroidX=true']
|
||||
elif edition == 'fdroid':
|
||||
command.insert(-1, '-Papp.edition=fdroid')
|
||||
if args.application_id:
|
||||
command.insert(-1, '-Papp.id=' + args.application_id)
|
||||
if args.build_dir:
|
||||
@@ -69,6 +124,13 @@ def main():
|
||||
return
|
||||
apk = app_output / ('outputs/apk/release/app-release-unsigned.apk' if args.release else
|
||||
'outputs/apk/debug/app-debug.apk')
|
||||
if arcade:
|
||||
suffix = '' if edition == 'direct' else '-' + edition
|
||||
output = ROOT / 'build/android' / (f'arcade{suffix}-unsigned.apk' if args.release else f'arcade{suffix}.apk')
|
||||
output.parent.mkdir(parents=True, exist_ok=True)
|
||||
shutil.copyfile(apk, output)
|
||||
print(f'Arcade APK: {output}')
|
||||
return
|
||||
output = ROOT / ('build/shovey-test-unsigned.apk' if args.application_id else
|
||||
'build/shovey-unsigned.apk' if args.release else 'build/shovey.apk')
|
||||
shutil.copyfile(apk, output)
|
||||
|
||||
@@ -42,8 +42,9 @@ def stage(root, controller, expected_controller_digest, output):
|
||||
if not re.fullmatch(r"[0-9a-f]{64}", expected_controller_digest):
|
||||
raise ValueError("An exact trusted Apps controller SHA-256 is required")
|
||||
controller_bytes = controller.read_bytes()
|
||||
if hashlib.sha256(controller_bytes).hexdigest() != expected_controller_digest:
|
||||
raise ValueError("Apps controller differs from the trusted SHA-256")
|
||||
controller_digest = hashlib.sha256(controller_bytes).hexdigest()
|
||||
if controller_digest != expected_controller_digest:
|
||||
raise ValueError(f"Apps controller differs from the trusted SHA-256: {controller_digest} != {expected_controller_digest}")
|
||||
packages = declared_packages(root)
|
||||
arcade = packages[0]
|
||||
if not 1 <= sum(len(package["apps"]) for package in packages) <= MAX_GAMES:
|
||||
|
||||
@@ -99,9 +99,18 @@ def build(ziran, lock_flags):
|
||||
generated.mkdir(parents=True, exist_ok=True)
|
||||
if descriptor.get('prepare_assets'):
|
||||
prepare = Path(descriptor['prepare_assets'])
|
||||
if prepare.is_absolute() or '..' in prepare.parts or prepare.suffix != '.py':
|
||||
if prepare.is_absolute() or '..' in prepare.parts or prepare.suffix not in ('.py', '.zi'):
|
||||
raise ValueError('Invalid game asset preparation script')
|
||||
subprocess.run(['python3', str(source / prepare), str(resources), str(generated)], check=True)
|
||||
if prepare.suffix == '.zi':
|
||||
# A Ziran preparation program builds with Arcade's compiler and
|
||||
# runs from the game's checkout, where its own files are.
|
||||
tool = ROOT / 'build/game-tools' / name
|
||||
subprocess.run([str(compiler), 'build', '--target=c', '--exe', '--root', str((source / prepare).parent),
|
||||
'--module-path', 'std=' + str(toolchain / 'std'), '--entry', prepare.stem + ':main',
|
||||
'-o', str(tool), str(source / prepare)], cwd=ROOT, check=True)
|
||||
subprocess.run([str(tool / prepare.stem), str(resources), str(generated)], cwd=source, check=True)
|
||||
else:
|
||||
subprocess.run(['python3', str(source / prepare), str(resources), str(generated)], check=True)
|
||||
shared = share_resources(app, apps, resources, ROOT / 'build/game-assets')
|
||||
metadata = ROOT / 'build/games' / (name + '-resources.json')
|
||||
metadata.parent.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
@@ -12,19 +12,155 @@ Shovey download's own shovey.zx, shovey.json and entity.zx, unchanged, on the
|
||||
page files --site names. Their programs, and the game and Apps controller
|
||||
packed in shovey.zx, are compiled into the page, so they run as fast as a
|
||||
native build of them; the page still opens those exact bytes.
|
||||
|
||||
The library's pictures come from the site too (stage_web_library_art), so
|
||||
the covers never wait for the art bundle from api.waozi.xyz.
|
||||
"""
|
||||
import argparse
|
||||
import gzip
|
||||
import hashlib
|
||||
import io
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import re
|
||||
import shutil
|
||||
import struct
|
||||
import subprocess
|
||||
import sys
|
||||
import tarfile
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
ZIRAN = str(ROOT / 'scripts/ziran.sh')
|
||||
ART_LIMIT = 64 * 1024 * 1024
|
||||
# The committed library copies are at most this large (scripts/library-art.py).
|
||||
PICTURE_LONGEST = 640
|
||||
COVER_QUALITY = 80
|
||||
|
||||
|
||||
def bundle_assets(data):
|
||||
"""The files embedded in a ZX v26 bundle by path; never runs it."""
|
||||
if data[:8] != b'ZX\0\0\x1a\0\0\0' or len(data) > ART_LIMIT:
|
||||
raise ValueError('unsupported bundle')
|
||||
at = 8
|
||||
|
||||
def take(size):
|
||||
nonlocal at
|
||||
if at + size > len(data):
|
||||
raise ValueError('truncated bundle')
|
||||
value = data[at:at + size]
|
||||
at += size
|
||||
return value
|
||||
|
||||
def number():
|
||||
return struct.unpack('<I', take(4))[0]
|
||||
|
||||
def text():
|
||||
return take(number())
|
||||
|
||||
text(); text()
|
||||
for _ in range(number()):
|
||||
text(); text()
|
||||
for _ in range(number()):
|
||||
for _ in range(7):
|
||||
text()
|
||||
take(8); text(); take(4)
|
||||
for _ in range(number()):
|
||||
for _ in range(3):
|
||||
text()
|
||||
take(number())
|
||||
assets = {}
|
||||
for _ in range(number()):
|
||||
path = text().decode()
|
||||
if path in assets:
|
||||
raise ValueError('duplicate bundle file')
|
||||
assets[path] = take(number())
|
||||
if at != len(data):
|
||||
raise ValueError('trailing bundle bytes')
|
||||
return assets
|
||||
|
||||
|
||||
def published_art(folder, digest):
|
||||
"""The art bundle a collection names, from the release's game archive
|
||||
beside it or a local build's arcade.games folder."""
|
||||
built = folder / 'arcade.games' / f'{digest}.zx'
|
||||
if built.is_file():
|
||||
return built.read_bytes()
|
||||
archive = folder / 'arcade.games.tar'
|
||||
if archive.is_file():
|
||||
with tarfile.open(archive) as games:
|
||||
member = next((entry for entry in games if entry.name == f'{digest}.zx'), None)
|
||||
if member is not None and member.isfile() and member.size <= ART_LIMIT:
|
||||
return games.extractfile(member).read()
|
||||
raise ValueError('The collection\'s art bundle is not beside it')
|
||||
|
||||
|
||||
def web_picture(data, exact):
|
||||
"""(bytes, suffix) of the page's copy of one verified library picture: a
|
||||
WebP, lossless when exact (pixel-art previews), unless the original is
|
||||
smaller. Transparency is kept; nothing is larger than PICTURE_LONGEST."""
|
||||
from PIL import Image
|
||||
image = Image.open(io.BytesIO(data))
|
||||
image.load()
|
||||
original = '.' + image.format.lower().replace('jpeg', 'jpg')
|
||||
alpha = 'A' in image.getbands() or 'transparency' in image.info
|
||||
image = image.convert('RGBA' if alpha else 'RGB')
|
||||
scale = min(1.0, PICTURE_LONGEST / max(image.size))
|
||||
if scale < 1.0:
|
||||
size = (max(1, round(image.width * scale)), max(1, round(image.height * scale)))
|
||||
image = image.resize(size, Image.Resampling.LANCZOS)
|
||||
output = io.BytesIO()
|
||||
if exact:
|
||||
image.save(output, 'WEBP', lossless=True, method=6)
|
||||
else:
|
||||
image.save(output, 'WEBP', quality=COVER_QUALITY, method=6)
|
||||
if scale == 1.0 and len(data) <= output.tell():
|
||||
return data, original
|
||||
return output.getvalue(), '.webp'
|
||||
|
||||
|
||||
def stage_web_library_art(bundle, output):
|
||||
"""Serve the collection's separate library art from the site.
|
||||
|
||||
The art bundle must have the exact digest and size the collection's
|
||||
signed catalog names. Its pictures go to output/library as small WebP
|
||||
copies, named by content and listed in library.json under that digest;
|
||||
the exact bundle goes beside them for browsers that cannot draw WebP.
|
||||
Returns the listing, or None when the collection packs its own art.
|
||||
"""
|
||||
assets = bundle_assets(bundle.read_bytes())
|
||||
catalog = json.loads(assets['assets/apps/catalog.json'])
|
||||
art = catalog.get('art')
|
||||
if art is None:
|
||||
return None
|
||||
digest, size = art.get('sha256', ''), art.get('bytes')
|
||||
if not re.fullmatch(r'[0-9a-f]{64}', digest) or not isinstance(size, int):
|
||||
raise ValueError('Invalid art in the collection catalog')
|
||||
data = published_art(bundle.parent, digest)
|
||||
if len(data) != size or hashlib.sha256(data).hexdigest() != digest:
|
||||
raise ValueError('The art bundle differs from the collection catalog')
|
||||
pictures = bundle_assets(data)
|
||||
previews = {child[key] for child in catalog['children'] for key in ('preview', 'icon') if child.get(key)}
|
||||
covers = {path for child in catalog['children'] for key, path in child.get('cover', {}).items()
|
||||
if key in ('portrait', 'landscape', 'logo')}
|
||||
copies = {}
|
||||
for path in sorted(previews | covers):
|
||||
if path not in pictures:
|
||||
raise ValueError(f'The art bundle lacks {path}')
|
||||
copies[path] = web_picture(pictures[path], path in previews)
|
||||
library = output / 'library'
|
||||
if library.exists():
|
||||
shutil.rmtree(library)
|
||||
library.mkdir(parents=True)
|
||||
(library / f'{digest}.zx').write_bytes(data)
|
||||
listed = {}
|
||||
for path, (contents, suffix) in copies.items():
|
||||
name = hashlib.sha256(contents).hexdigest()
|
||||
(library / (name + suffix)).write_bytes(contents)
|
||||
listed[path] = dict(file=f'library/{name}{suffix}', sha256=name, bytes=len(contents))
|
||||
manifest = dict(art=digest, bytes=size, pictures=listed)
|
||||
(output / 'library.json').write_text(json.dumps(manifest, indent=2) + '\n')
|
||||
return manifest
|
||||
|
||||
|
||||
def package(name):
|
||||
@@ -47,7 +183,7 @@ def version_assets(output, receipt):
|
||||
if '__ARCADE_ASSET_REVISION__' not in html:
|
||||
return
|
||||
digest = hashlib.sha256()
|
||||
for name in ('runtime.js', 'runtime.wasm', 'runtime.data', 'arcade.json', 'apps.zx'):
|
||||
for name in ('runtime.js', 'runtime.wasm', 'runtime.data', 'arcade.json', 'apps.zx', 'library.json'):
|
||||
path = output / name
|
||||
if path.is_file():
|
||||
digest.update(name.encode() + b'\0')
|
||||
@@ -114,6 +250,8 @@ def main():
|
||||
compress(output / 'apps.zx')
|
||||
else:
|
||||
print('No matching Apps controller beside the collection; it must pack its own')
|
||||
if not args.shovey and stage_web_library_art(bundle, output) is None:
|
||||
print('The collection packs its own library art')
|
||||
version_assets(output, receipt)
|
||||
print(f'{"Shovey" if args.shovey else "Arcade"} {args.version} for the browser in {output}')
|
||||
|
||||
|
||||
@@ -11,6 +11,11 @@ ROOT = Path(__file__).resolve().parents[1]
|
||||
def check():
|
||||
standard = json.loads((ROOT / 'standards/game-v1.json').read_text())
|
||||
ledger = json.loads((ROOT / 'apps/versions.json').read_text())
|
||||
# Arcade's own players refuse games newer than GAME_HOST_API, so it moves
|
||||
# with the standard and the ledger whenever the host interface does.
|
||||
player = re.search(r'^GAME_HOST_API :: (\d+)$', (ROOT / 'src/game_contract.zi').read_text(), re.M)
|
||||
assert player and int(player[1]) == standard['host_api'] == ledger['host_api'], \
|
||||
'src/game_contract.zi GAME_HOST_API, standards/game-v1.json and apps/versions.json must name the same host interface'
|
||||
for app in declared_apps(ROOT):
|
||||
source, manifest, game = app['source'], app['manifest'], app['descriptor']
|
||||
for field in ['contract_version', 'module_api', 'host_api']:
|
||||
@@ -27,7 +32,9 @@ def check():
|
||||
assert component['sequence'] > 0
|
||||
required = set()
|
||||
for file in manifest.parent.glob('*.zi'):
|
||||
required.update(re.findall(r'"(' + re.escape(game['locale_prefix']) + r'[a-z0-9_]+)"', file.read_text()))
|
||||
# Module names in #import lines share the prefix but are not text keys.
|
||||
code = re.sub(r'^\s*#import\s+"[^"\n]*"', '', file.read_text(), flags=re.M)
|
||||
required.update(re.findall(r'"(' + re.escape(game['locale_prefix']) + r'[a-z0-9_]+)"', code))
|
||||
locales = {}
|
||||
for file in (source / game['locales']).glob('*.txt'):
|
||||
text = file.read_text()
|
||||
|
||||
@@ -132,6 +132,12 @@ def changelog(ziran):
|
||||
current = re.search(r'^## (\d+)\.(\d+)\.(\d+)\s*$', text, re.M)
|
||||
if current is None:
|
||||
raise SystemExit('CHANGELOG.md needs a numeric release entry')
|
||||
# Arcade's own changes wait under Unreleased; this release ships them.
|
||||
pending = re.search(r'^## \[Unreleased\]\s*$', text[:current.start()], re.M)
|
||||
if pending is not None:
|
||||
lines = [line for line in text[pending.end():current.start()].splitlines() if line.startswith('- ')] + lines
|
||||
text = text[:pending.start()] + text[current.start():]
|
||||
current = re.search(r'^## (\d+)\.(\d+)\.(\d+)\s*$', text, re.M)
|
||||
version = f'{current[1]}.{current[2]}.{int(current[3]) + 1}'
|
||||
entry = f'## {version}\n\n' + '\n'.join(lines) + '\n\n'
|
||||
path.write_text(text[:current.start()] + entry + text[current.start():])
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
#loading .failed { display: none; color: #ffb4a8; text-align: center; padding: 0 24px; }
|
||||
#loading.error .failed { display: block; }
|
||||
#loading.error .track { display: none; }
|
||||
#loading.error { opacity: 1; pointer-events: auto; }
|
||||
#loading button { border: 0; border-radius: 12px; padding: 14px 24px; background: #ffd166; color: #111223; font: inherit; cursor: pointer; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
@@ -38,7 +40,8 @@
|
||||
<!-- MingCute game_2 gamepad, Apache-2.0 -->
|
||||
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 9v3M13.5 10.5h3M7 5c1 0 3 1 5 1s4-1 5-1c3 0 7 14 3 14-3 0-4.5-4-8-4s-5 4-8 4C0 19 4 5 7 5Zm3 5.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z"/></svg>
|
||||
<div class="track"><div class="bar"></div></div>
|
||||
<p class="failed">Arcade could not start. Reload the page to try again.</p>
|
||||
<p class="failed">Arcade stopped while opening an app. Your saved games are kept.</p>
|
||||
<button class="failed" id="retry" type="button">Return to library</button>
|
||||
</div>
|
||||
<script>
|
||||
(function () {
|
||||
@@ -50,10 +53,12 @@
|
||||
url.searchParams.set('v', assetRevision);
|
||||
return url.href;
|
||||
}
|
||||
function failed() { loading.classList.add('error'); }
|
||||
// Arcade's Profile reports ready once the library is about to draw.
|
||||
function failed() { loading.classList.remove('done'); loading.classList.add('error'); }
|
||||
document.getElementById('retry').addEventListener('click', function () { location.reload(); });
|
||||
// Keep watching after startup: a later game failure also needs recovery.
|
||||
function watch() {
|
||||
if (window.Module && Module.profileReady) { loading.classList.add('done'); return; }
|
||||
if (window.Module && Module.arcadeFailed) { failed(); return; }
|
||||
if (window.Module && Module.profileReady) loading.classList.add('done');
|
||||
requestAnimationFrame(watch);
|
||||
}
|
||||
window.Module = {
|
||||
@@ -87,6 +92,58 @@
|
||||
.pipeThrough(new DecompressionStream('gzip'))).arrayBuffer();
|
||||
}).catch(function () { return plain(name); });
|
||||
}
|
||||
function hex(buffer) {
|
||||
return Array.prototype.map.call(new Uint8Array(buffer), function (byte) {
|
||||
return (byte < 16 ? '0' : '') + byte.toString(16);
|
||||
}).join('');
|
||||
}
|
||||
function file(name) {
|
||||
return fetch(assetUrl(name)).then(function (response) {
|
||||
if (!response.ok) throw new Error(response.status);
|
||||
return response.arrayBuffer();
|
||||
});
|
||||
}
|
||||
// The library's pictures come from this site, never api.waozi.xyz:
|
||||
// small copies of the collection's signed art (library.json), each
|
||||
// checked against its digest, or the exact art bundle for a browser
|
||||
// that cannot draw WebP or check them. The host verifies that bundle.
|
||||
function library() {
|
||||
return fetch(assetUrl('library.json')).then(function (response) {
|
||||
return response.ok ? response.json() : null;
|
||||
}).then(function (listing) {
|
||||
if (!listing) return null;
|
||||
var paths = Object.keys(listing.pictures);
|
||||
return Promise.all(paths.map(function (path) {
|
||||
var picture = listing.pictures[path];
|
||||
return file(picture.file).then(function (bytes) {
|
||||
return crypto.subtle.digest('SHA-256', bytes).then(function (digest) {
|
||||
if (hex(digest) !== picture.sha256) throw new Error(path);
|
||||
return bytes;
|
||||
});
|
||||
});
|
||||
})).then(function (copies) {
|
||||
var webp = paths.findIndex(function (path) { return /\.webp$/.test(listing.pictures[path].file); });
|
||||
var drawn = webp < 0 ? Promise.resolve() : createImageBitmap(new Blob([copies[webp]])).then(function (bitmap) { bitmap.close(); });
|
||||
return drawn.then(function () { return { art: listing.art, paths: paths, copies: copies }; });
|
||||
}).catch(function () {
|
||||
return file('library/' + listing.art + '.zx').then(function (bundle) {
|
||||
return { art: listing.art, bundle: bundle };
|
||||
});
|
||||
});
|
||||
}).catch(function () { return null; });
|
||||
}
|
||||
function writeLibrary(pictures) {
|
||||
if (pictures.bundle) {
|
||||
FS.mkdirTree('/packages');
|
||||
FS.writeFile('/packages/' + pictures.art + '.zx', new Uint8Array(pictures.bundle));
|
||||
return;
|
||||
}
|
||||
pictures.paths.forEach(function (path, index) {
|
||||
var name = '/library/' + pictures.art + '/' + path;
|
||||
FS.mkdirTree(name.slice(0, name.lastIndexOf('/')));
|
||||
FS.writeFile(name, new Uint8Array(pictures.copies[index]));
|
||||
});
|
||||
}
|
||||
// The build receipt names the collection's digest and its trusted Apps
|
||||
// library; Arcade's own copy of that library goes in beside it.
|
||||
Promise.all([
|
||||
@@ -95,12 +152,14 @@
|
||||
return response.text();
|
||||
}),
|
||||
bundle('apps.zx'),
|
||||
bundle('runtime.data')
|
||||
bundle('runtime.data'),
|
||||
library()
|
||||
]).then(function (loaded) {
|
||||
Module.arcadeReceipt = loaded[0];
|
||||
if (loaded[1]) {
|
||||
Module.preRun = [function () { FS.writeFile('/apps.zx', new Uint8Array(loaded[1])); }];
|
||||
}
|
||||
Module.preRun = [function () {
|
||||
if (loaded[1]) FS.writeFile('/apps.zx', new Uint8Array(loaded[1]));
|
||||
if (loaded[3]) writeLibrary(loaded[3]);
|
||||
}];
|
||||
// The runtime's file package, already here, is not fetched again.
|
||||
if (loaded[2]) {
|
||||
Module.getPreloadedPackage = function () { return loaded[2]; };
|
||||
|
||||
@@ -9,13 +9,12 @@ Game :: struct {
|
||||
enabled: bool
|
||||
}
|
||||
|
||||
GameCount :: 5
|
||||
GameCount :: 4
|
||||
|
||||
GameAt :: (index: s32) -> Game {
|
||||
if index == 0 { return Game.{.id = "inbe.chess", .name = "chess", .title = "Chess", .bundle = "chess.zx", .preview = "chess-preview.png", .package = "self", .enabled = false} }
|
||||
if index == 1 { return Game.{.id = "arcade.shovey", .name = "shovey", .title = "Shovey", .bundle = "shovey.zx", .preview = "shovey-preview.png", .package = "shovey", .enabled = true} }
|
||||
if index == 2 { return Game.{.id = "arcade.shovey-island", .name = "shovey-island", .title = "Shovey Island", .bundle = "shovey-island.zx", .preview = "shovey-island-preview.png", .package = "shovey", .enabled = false} }
|
||||
if index == 3 { return Game.{.id = "arcade.shovey-editor", .name = "shovey-editor", .title = "Shovey Editor", .bundle = "shovey-editor.zx", .preview = "shovey-editor-preview.png", .package = "shovey", .enabled = true} }
|
||||
if index == 4 { return Game.{.id = "xyz.waozi.wurm", .name = "wurm", .title = "Apfelwurm", .bundle = "wurm.zx", .preview = "wurm-preview.png", .package = "wurm", .enabled = true} }
|
||||
if index == 2 { return Game.{.id = "arcade.shovey-editor", .name = "shovey-editor", .title = "Shovey Editor", .bundle = "shovey-editor.zx", .preview = "shovey-editor-preview.png", .package = "shovey", .enabled = true} }
|
||||
if index == 3 { return Game.{.id = "xyz.waozi.wurm", .name = "wurm", .title = "Apfelwurm", .bundle = "wurm.zx", .preview = "wurm-preview.png", .package = "wurm", .enabled = true} }
|
||||
return Game.{}
|
||||
}
|
||||
@@ -25,6 +25,9 @@ CollectionPackage :: struct {
|
||||
collection_packages: *CollectionPackage;
|
||||
collection_package_result: string;
|
||||
collection_package_files: *AppFiles;
|
||||
// Packages the platform already holds, read-only and verified like a
|
||||
// download: the website's own copy of the library art. "" for none.
|
||||
collection_package_folder: string;
|
||||
package_c :: #system_library "c";
|
||||
PackageFree :: (memory: *void) #foreign package_c "free";
|
||||
CollectionDownloadsOpen :: (files: *AppFiles) { collection_package_files = files }
|
||||
@@ -61,6 +64,20 @@ CollectionPackageFor :: (entry: *AppEntry) -> *CollectionPackage {
|
||||
package.bytes = ""
|
||||
package.failed = true
|
||||
}
|
||||
if package.bytes == "" && collection_package_folder != "" {
|
||||
held: Vec(u8)
|
||||
BuilderPrint(*held, "%/%.zx", collection_package_folder, TextUntilNul(package.digest[:]))
|
||||
path := BuilderFinish(held)
|
||||
package.bytes = CollectionReadPackage(path)
|
||||
AppFileFree(path)
|
||||
if package.bytes != "" && CollectionPackageValid(package) {
|
||||
package.failed = false
|
||||
} else if package.bytes != "" {
|
||||
AppFileFree(package.bytes)
|
||||
package.bytes = ""
|
||||
package.failed = true
|
||||
}
|
||||
}
|
||||
package.next = collection_packages
|
||||
collection_packages = package
|
||||
return package
|
||||
|
||||
@@ -26,6 +26,9 @@
|
||||
#import "kryon/app_files"
|
||||
#import "kryon/app_protocol"
|
||||
#import "kryon/app_context_host"
|
||||
#if !#defined(PLATFORM_DESKTOP) && !#defined(ANDROID_BUILD) && !#defined(PLATFORM_WEB) {
|
||||
CollectionHost :: #import "kryon/app_context";
|
||||
}
|
||||
#import "kryon/key_input"
|
||||
#import "kryon/system_clipboard"
|
||||
#import "apps/host"
|
||||
@@ -38,8 +41,10 @@ Node :: #import "apps/node_types";
|
||||
Codec :: #import "apps/node_codec";
|
||||
#import "platform"
|
||||
#import, file "collection_downloads.zi";
|
||||
#import, file "game_contract.zi";
|
||||
#import "sound"
|
||||
#import "entity_host"
|
||||
#import "entity/publications"
|
||||
#import "entity/publications_read"
|
||||
#import "entity/entity_records"
|
||||
#import "entity/entity_dew"
|
||||
@@ -91,12 +96,23 @@ collection_leave_to_library: bool;
|
||||
// 2 not answered yet.
|
||||
collection_updates: s32 = -1;
|
||||
|
||||
CollectionTouchFirst :: () -> bool {
|
||||
#if #defined(PLATFORM_DESKTOP) {
|
||||
return false
|
||||
// Whether the device's main input is a keyboard and mouse. A native build
|
||||
// knows its platform; the collection running as a bundle inside Breeze asks
|
||||
// Breeze (Kryon's kryon.input.desktop), and passes the answer to its games.
|
||||
CollectionInputDesktop :: () -> bool {
|
||||
#if #defined(PLATFORM_DESKTOP) && !#defined(ANDROID_BUILD) && !#defined(PLATFORM_WEB) {
|
||||
return true
|
||||
} else {
|
||||
#if #defined(ANDROID_BUILD) || #defined(PLATFORM_WEB) {
|
||||
return false
|
||||
} else {
|
||||
return CollectionHost.AppSupports(COLLECTION_INPUT_DESKTOP)
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
COLLECTION_INPUT_DESKTOP :: "kryon.input.desktop"
|
||||
|
||||
CollectionTouchFirst :: () -> bool { return !CollectionInputDesktop() }
|
||||
|
||||
CollectionRecordsFor :: (id: string) -> *CollectionRecords {
|
||||
saved := collection_records
|
||||
@@ -133,8 +149,10 @@ CollectionAllows :: (context: *void, node: *AppNode, name: string) -> bool {
|
||||
name == "SmoothFramesHost" || name == "AppLocaleHost" || name == "AppSoundHost" ||
|
||||
name == "tile_map.sampling" || name == "arcade.controls" || name == "arcade.sound" || name == "arcade.navigation" ||
|
||||
name == "arcade.updates" ||
|
||||
name == PUBLICATIONS_READ_SERVICE || name == ENTITY_RECORDS_SERVICE || name == ENTITY_DEW_SERVICE ||
|
||||
name == "entity.profile" || name == "leaderboard"
|
||||
name == PUBLICATIONS_SERVICE || name == PUBLICATIONS_READ_SERVICE ||
|
||||
name == ENTITY_RECORDS_SERVICE || name == ENTITY_DEW_SERVICE ||
|
||||
name == "entity.profile" || name == "leaderboard" ||
|
||||
(name == COLLECTION_INPUT_DESKTOP && CollectionInputDesktop())
|
||||
}
|
||||
|
||||
CollectionCall :: (context: *void, node: *AppNode, module: *u8, function: *u8,
|
||||
@@ -184,6 +202,12 @@ CollectionCall :: (context: *void, node: *AppNode, module: *u8, function: *u8,
|
||||
return 1
|
||||
}
|
||||
// Public level collections, such as a game's live campaign.
|
||||
if service == PUBLICATIONS_SERVICE {
|
||||
// Publications sign as this device's native Entity account.
|
||||
EntityPump()
|
||||
result.* = AppHostText(PublicationsAnswer(request))
|
||||
return 1
|
||||
}
|
||||
if service == PUBLICATIONS_READ_SERVICE {
|
||||
result.* = AppHostText(PublicationsReadAnswer(request))
|
||||
return 1
|
||||
@@ -287,14 +311,47 @@ CollectionCall :: (context: *void, node: *AppNode, module: *u8, function: *u8,
|
||||
return 0
|
||||
}
|
||||
|
||||
// The website's small copies of a collection's separate library art, under
|
||||
// its signed catalog's art digest. The page writes only copies whose digests
|
||||
// match its library.json (scripts/build-web.py); "" on other hosts.
|
||||
collection_thumbnails: string;
|
||||
|
||||
CollectionThumbnail :: (node: *AppNode, path: string) -> string {
|
||||
if collection_thumbnails == "" || node == null || !node.collection ||
|
||||
node.catalog.art_sha256[0] == 0 || !AppAssetPathValid(path) { return "" }
|
||||
copy: Vec(u8)
|
||||
BuilderPrint(*copy, "%/%/%", collection_thumbnails, TextUntilNul(node.catalog.art_sha256[:]), path)
|
||||
thumbnail := BuilderFinish(copy)
|
||||
file := OpenRead(thumbnail)
|
||||
if file.valid { unused CloseFile(file); return thumbnail }
|
||||
AppFileFree(thumbnail)
|
||||
return ""
|
||||
}
|
||||
|
||||
// The website names where its page writes the library's pictures: small
|
||||
// copies, or the exact art bundle for a browser that cannot draw them.
|
||||
CollectionWebLibrary :: (thumbnails: string, packages: string) {
|
||||
collection_thumbnails = thumbnails
|
||||
collection_package_folder = packages
|
||||
}
|
||||
|
||||
CollectionAssetAllowed :: (path: string) -> bool {
|
||||
return path == "" || (collection_widget_node != null && (AppHostAsset(collection_widget_node, path).found ||
|
||||
AppHostAssetPending(collection_widget_node, path)))
|
||||
if path == "" { return true }
|
||||
if collection_widget_node == null { return false }
|
||||
// Checked first: asking for the art itself starts its download.
|
||||
thumbnail := CollectionThumbnail(collection_widget_node, path)
|
||||
if thumbnail != "" { AppFileFree(thumbnail); return true }
|
||||
return AppHostAsset(collection_widget_node, path).found || AppHostAssetPending(collection_widget_node, path)
|
||||
}
|
||||
|
||||
CollectionAssetPath :: (path: string) -> string {
|
||||
if path == "" { return "" }
|
||||
if collection_widget_node == null { return "" }
|
||||
thumbnail := CollectionThumbnail(collection_widget_node, path)
|
||||
if thumbnail != "" {
|
||||
if !VecPush(collection_frame_paths, thumbnail) { AppFileFree(thumbnail); return "" }
|
||||
return thumbnail
|
||||
}
|
||||
asset := AppHostAsset(collection_widget_node, path)
|
||||
if !asset.found { collection_pictures_missing = true; return "" }
|
||||
relative := Join(TextUntilNul(collection_widget_node.entry.sha256[:]), path)
|
||||
@@ -425,8 +482,10 @@ CollectionController :: (context: *void) -> HostedAsset {
|
||||
return controller
|
||||
}
|
||||
|
||||
// packed: the collection carries every game and its art, as the Android APK
|
||||
// does, so nothing is downloaded.
|
||||
CollectionOpen :: (bundle: string, digest: string, harness_digest: string,
|
||||
data: string, locale: string) -> bool {
|
||||
data: string, locale: string, packed: bool) -> bool {
|
||||
if collection_ready { return false }
|
||||
leaderboard_installed = CollectionLeaderboardInstalled
|
||||
collection_directory = data
|
||||
@@ -436,10 +495,14 @@ CollectionOpen :: (bundle: string, digest: string, harness_digest: string,
|
||||
CollectionDownloadsOpen(*collection_resources)
|
||||
platform := AppPlatform.{.allows = CollectionAllows, .call = CollectionCall,
|
||||
.widgets = CollectionWidgets, .save = CollectionSave, .state = CollectionState,
|
||||
.effect = CollectionEffect,
|
||||
.bundle = CollectionBundle, .download = CollectionDownload, .fetch = CollectionFetch,
|
||||
.effect = CollectionEffect, .host_api = GAME_HOST_API,
|
||||
// Covers show only the art; the download dialog names the size.
|
||||
.controller = CollectionController, .presentation = AppPresentation.{.cover_grid = true, .hide_sizes = true}}
|
||||
if !packed {
|
||||
platform.bundle = CollectionBundle
|
||||
platform.download = CollectionDownload
|
||||
platform.fetch = CollectionFetch
|
||||
}
|
||||
collection_ready = AppHostStart(*collection_host, bundle, "arcade.local", "inbe.arcade",
|
||||
"arcade", digest, "local", platform, harness_digest, locale)
|
||||
if !collection_ready { Report("Arcade: the shared Apps host refused the collection") }
|
||||
@@ -469,6 +532,7 @@ CollectionOpenBytes :: (bytes: string, metadata: string, data: string) -> bool {
|
||||
id: [128]u8
|
||||
digest: [65]u8
|
||||
harness: [65]u8
|
||||
games: [16]u8
|
||||
if !AppsReadText(metadata, 0, "id", id[:]) || TextUntilNul(id[:]) != "inbe.arcade" ||
|
||||
!AppsReadText(metadata, 0, "sha256", digest[:]) ||
|
||||
!AppsReadText(metadata, 0, "apps_sha256", harness[:]) {
|
||||
@@ -477,7 +541,8 @@ CollectionOpenBytes :: (bytes: string, metadata: string, data: string) -> bool {
|
||||
}
|
||||
locale := EnvironmentText("LANG")
|
||||
language := ifx locale.count >= 2 then locale[:2] else "en"
|
||||
return CollectionOpen(bytes, TextUntilNul(digest[:]), TextUntilNul(harness[:]), data, language)
|
||||
packed := AppsReadText(metadata, 0, "games", games[:]) && TextUntilNul(games[:]) == "packed"
|
||||
return CollectionOpen(bytes, TextUntilNul(digest[:]), TextUntilNul(harness[:]), data, language, packed)
|
||||
}
|
||||
|
||||
// The standalone player needs only Shovey's own payload and metadata. Its
|
||||
@@ -517,7 +582,7 @@ CollectionOpenShoveyBytes :: (bytes: string, metadata: string, data: string) ->
|
||||
language := ifx locale.count >= 2 then locale[:2] else "en"
|
||||
platform := AppPlatform.{.allows = CollectionAllows, .call = CollectionCall,
|
||||
.widgets = CollectionWidgets, .save = CollectionSave, .state = CollectionState,
|
||||
.effect = CollectionEffect}
|
||||
.effect = CollectionEffect, .host_api = GAME_HOST_API}
|
||||
collection_ready = AppHostStart(*collection_host, bytes, "arcade.local", "arcade.shovey-player",
|
||||
"shovey", TextUntilNul(digest[:]), "local", platform, TextUntilNul(harness[:]), language)
|
||||
return collection_ready
|
||||
|
||||
@@ -43,9 +43,6 @@ EntityShoveyTokens :: () {
|
||||
|
||||
EntityOpen :: (bytes: string, data: string, shovey: bool = false) -> bool {
|
||||
entity_shovey = shovey
|
||||
#if #defined(GOOGLE_PLAY) {
|
||||
EntityHostAllowFunding(false)
|
||||
}
|
||||
if shovey { EntityShoveyTokens() }
|
||||
root := Join(data, "entity")
|
||||
defer { EntityFree(root) }
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
// The game standard every Arcade game implements (standards/game-v1.json).
|
||||
// GAME_HOST_API is the newest host interface Arcade's players run; a game
|
||||
// that declares a newer one is refused. scripts/check-games.py fails while it
|
||||
// differs from the standard and the ledger.
|
||||
GAME_CONTRACT_VERSION :: 1
|
||||
GAME_HOST_API :: 41
|
||||
@@ -1,6 +1,7 @@
|
||||
// Runs the registered game bundles. The host owns files and input;
|
||||
// each game owns its rules and screens. Chess also runs in Inbe.
|
||||
#import "std/file"
|
||||
#import, file "game_contract.zi";
|
||||
#import "std/bundle_host"
|
||||
#import "std/byte_text_linux"
|
||||
#import "std/date_time_linux"
|
||||
@@ -19,8 +20,6 @@
|
||||
|
||||
using HostValueKind;
|
||||
|
||||
GAME_CONTRACT_VERSION :: 1
|
||||
GAME_HOST_API :: 12
|
||||
|
||||
GameHost :: struct {
|
||||
app: HostedApp
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Classic, Island and Editor keep independent verified identities.
|
||||
// Classic and the Editor keep independent verified identities.
|
||||
#import "kryon/app_context"
|
||||
#import "kryon/app_protocol"
|
||||
|
||||
|
||||
@@ -82,6 +82,9 @@ main :: () -> s32 {
|
||||
controller, controller_found := ReadEntireFile("/apps.zx")
|
||||
if controller_found { collection_controller = controller } else { AppFileFree(controller) }
|
||||
if !found || !profile_found || receipt == "" { return 1 }
|
||||
// The page writes the library's pictures from this site: small copies
|
||||
// under /library, or else the exact art bundle under /packages.
|
||||
CollectionWebLibrary("/library", "/packages")
|
||||
shovey := CollectionShoveyReceipt(receipt)
|
||||
opened := ifx shovey then CollectionOpenShoveyBytes(bytes, receipt, data) else CollectionOpenBytes(bytes, receipt, data)
|
||||
if !opened { return 1 }
|
||||
@@ -89,12 +92,19 @@ main :: () -> s32 {
|
||||
session := SessionOpen()
|
||||
if !SessionValid(session) { unused CollectionClose(); return 1 }
|
||||
defer { SessionClose(session) }
|
||||
WebSet(WebGetObject(WebGlobal, WebName("Module")), WebName("profileReady"), WebBool(true))
|
||||
saved := PageNow()
|
||||
ok := true
|
||||
while ok && PollCanvas() {
|
||||
scope := WebScope()
|
||||
ok = ArcadeFrame(session)
|
||||
// main returning does not notify Emscripten's onExit unless its
|
||||
// runtime exits too. Tell the page explicitly, so a failed game can
|
||||
// never leave an apparently live library with no input loop.
|
||||
if !ok {
|
||||
WebSet(WebGetObject(WebGlobal, WebName("Module")), WebName("arcadeFailed"), WebBool(true))
|
||||
} else {
|
||||
WebSet(WebGetObject(WebGlobal, WebName("Module")), WebName("profileReady"), WebBool(true))
|
||||
}
|
||||
// Saves reach the browser's storage about once a second.
|
||||
if PageNow() - saved >= 1000.0 {
|
||||
unused BundleStorageSync(false)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "kryon-node-app",
|
||||
"contract_version": 1,
|
||||
"module_api": 2,
|
||||
"host_api": 12,
|
||||
"host_api": 41,
|
||||
"identity": "Stable signed package ID; moving source must not rename installed games",
|
||||
"frames": {
|
||||
"matching": "Fields match by name",
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
"""Check that the APK's collection opens Arcade's whole library offline.
|
||||
|
||||
The collection make android packs (build/android-assets) is opened by the
|
||||
desktop host from a private folder, as the Android host opens it from the
|
||||
APK's assets: no controller beside it and no reachable download origin, so
|
||||
every game and the art must come from the collection itself."""
|
||||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
import time
|
||||
|
||||
LEVEL_UPDATES = 'Download new levels when they come out?'
|
||||
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('--binary', type=Path, required=True)
|
||||
parser.add_argument('--inbe-source', type=Path, required=True)
|
||||
args = parser.parse_args()
|
||||
assert int(os.environ['DISPLAY'].split(':')[-1].split('.')[0]) >= 400
|
||||
assert os.environ['YUE_DESKTOP_RECOVERY'] == '0'
|
||||
root = Path(__file__).resolve().parents[1]
|
||||
assets = root / 'build/android-assets'
|
||||
receipt = json.loads((assets / 'arcade.json').read_text())
|
||||
assert receipt['id'] == 'inbe.arcade' and receipt['games'] == 'packed' and 'art' not in receipt
|
||||
assert receipt['sha256'] == hashlib.sha256((assets / 'arcade.zx').read_bytes()).hexdigest()
|
||||
sys.path.insert(0, str(args.inbe_source / 'tests'))
|
||||
from ui_driver import UiDriver
|
||||
output = root / 'build/android-offline-ui-test'
|
||||
output.mkdir(parents=True, exist_ok=True)
|
||||
driver = UiDriver(output / 'driver')
|
||||
|
||||
with tempfile.TemporaryDirectory(prefix='arcade-offline-') as temporary:
|
||||
install = Path(temporary) / 'app'
|
||||
install.mkdir()
|
||||
shutil.copy2(args.binary, install / 'arcade')
|
||||
for name in ('arcade.zx', 'arcade.json'):
|
||||
shutil.copyfile(assets / name, install / name)
|
||||
# The shared profile, which the APK also carries.
|
||||
shutil.copyfile(root / 'build/entity.zx', install / 'entity.zx')
|
||||
profile = Path(temporary) / 'profile'
|
||||
log_path = output / 'arcade.log'
|
||||
with log_path.open('w') as log:
|
||||
# Port 9 (discard) refuses connections: any download would fail.
|
||||
child = subprocess.Popen([str(install / 'arcade')], cwd=install,
|
||||
env=os.environ | driver.environment() |
|
||||
{'ARCADE_DATA': str(profile), 'ENTITY_DATA': str(profile / 'entity'),
|
||||
'LANG': 'en_US.UTF-8', 'ARCADE_PACKAGE_ORIGIN': 'http://127.0.0.1:9'},
|
||||
stdout=log, stderr=subprocess.STDOUT)
|
||||
driver.attach(child, log_path)
|
||||
try:
|
||||
for title in ('Shovey', 'Shovey Editor', 'Apfelwurm'):
|
||||
driver.wait(label=title, role='button', timeout=60)
|
||||
covers = [node for node in driver.find(role='image', visible=True)
|
||||
if node['width'] >= 100 and node['height'] >= 140]
|
||||
assert len(covers) >= 2, 'The packed library art must draw without a download'
|
||||
if driver.find(label=LEVEL_UPDATES, role='text'):
|
||||
driver.press(label='Not now', role='button')
|
||||
driver.wait_gone(label=LEVEL_UPDATES, role='text')
|
||||
driver.press(label='Shovey', role='button')
|
||||
deadline = time.monotonic() + 30
|
||||
while True:
|
||||
assert not driver.find(label='Download', role='button'), 'A packed game must not ask to download'
|
||||
assert not driver.find(label='Try again', role='button'), 'A packed game must not download'
|
||||
if driver.find(label=LEVEL_UPDATES, role='text'):
|
||||
driver.press(label='Not now', role='button')
|
||||
driver.wait_gone(label=LEVEL_UPDATES, role='text')
|
||||
if [node for node in driver.tree() if str(node.get('label', '')).startswith('Level 1 / ')]:
|
||||
break
|
||||
assert time.monotonic() < deadline, 'Shovey did not start from the packed collection'
|
||||
time.sleep(0.05)
|
||||
assert not list((profile / 'resources').rglob('*.zx')), 'Nothing may be downloaded'
|
||||
finally:
|
||||
if child.poll() is None:
|
||||
child.terminate()
|
||||
child.wait(timeout=10)
|
||||
print('The Android collection opens every game and its art offline')
|
||||
@@ -20,7 +20,7 @@ assert chess["kind"] == "game"
|
||||
assert (ROOT / "apps/chess/engine.zi").is_file(), "Arcade must own the game"
|
||||
assert not (inbe / "apps/chess").exists(), "Inbe must consume Chess, not own another copy"
|
||||
assert chess["contract_version"] == 1 and chess["module_api"] == 2
|
||||
assert chess["host_api"] == 12 and chess["save_schema"] == 1
|
||||
assert chess["host_api"] == 41 and chess["save_schema"] == 1
|
||||
assert (ROOT / chess["preview"]).is_file()
|
||||
env = {key: value for key, value in os.environ.items()
|
||||
if key not in {"DISPLAY", "WAYLAND_DISPLAY", "XAUTHORITY", "DBUS_SESSION_BUS_ADDRESS"}}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
#import, file "../src/collection_host.zi";
|
||||
#import "entity/publications"
|
||||
#import "entity/publications_read"
|
||||
#import "std/bundle_host"
|
||||
#import "hosted_values"
|
||||
#import "std/byte_text_linux"
|
||||
|
||||
using HostValueKind;
|
||||
|
||||
CopyText :: (text: string, bytes: []u8) -> bool {
|
||||
if text.count >= bytes.count { return false }
|
||||
for byte, at: text { bytes[at] = byte }
|
||||
bytes[text.count] = 0
|
||||
return true
|
||||
}
|
||||
|
||||
TextValue :: (text: string) -> HostValue {
|
||||
return HostValue.{.kind = cast(s32)HostString, .type_name = HostTextData("string"),
|
||||
.data = HostTextData(text), .length = cast(usize)text.count}
|
||||
}
|
||||
|
||||
BorrowedText :: (value: HostValue) -> string {
|
||||
return TextFromBytes(BytesFromPointer(value.data, cast(u64)value.length))
|
||||
}
|
||||
|
||||
#program_export
|
||||
Check :: () -> s32 {
|
||||
if !CollectionAllows(null, null, PUBLICATIONS_SERVICE) { return 1 }
|
||||
if !CollectionAllows(null, null, PUBLICATIONS_READ_SERVICE) { return 2 }
|
||||
function: [32]u8
|
||||
if !CopyText("AppServiceHost", function[:]) { return 3 }
|
||||
arguments: [2]HostValue
|
||||
arguments[0] = TextValue(PUBLICATIONS_SERVICE)
|
||||
arguments[1] = TextValue("{\"operation\":\"fetch\",\"id\":\"fixture\"}")
|
||||
result: HostValue
|
||||
if CollectionCall(null, null, null, *function[0], *arguments[0], 2, *result) != 1 { return 4 }
|
||||
if result.kind != cast(s32)HostString { return 5 }
|
||||
if BorrowedText(result) != "{\"status\":\"rejected\",\"error\":\"signed-out\"}" { return 6 }
|
||||
return 42
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
"""Check that Arcade routes writable publications through Entity's account gate."""
|
||||
import fcntl
|
||||
import os
|
||||
from pathlib import Path
|
||||
import shutil
|
||||
import subprocess
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
WORK = ROOT / "build/collection-publications-host-test"
|
||||
ENVIRONMENT = {
|
||||
key: value for key, value in os.environ.items()
|
||||
if key not in {"DISPLAY", "WAYLAND_DISPLAY", "XAUTHORITY", "DBUS_SESSION_BUS_ADDRESS"}
|
||||
}
|
||||
|
||||
|
||||
def run(program, *arguments):
|
||||
return subprocess.run([program, *arguments], cwd=ROOT, check=True,
|
||||
env=ENVIRONMENT, text=True)
|
||||
|
||||
|
||||
def main():
|
||||
generated = WORK / "c"
|
||||
binary = WORK / "test"
|
||||
for path in (binary, binary.with_suffix(".new")):
|
||||
if path.is_dir():
|
||||
shutil.rmtree(path)
|
||||
elif path.exists():
|
||||
path.unlink()
|
||||
if generated.exists():
|
||||
shutil.rmtree(generated)
|
||||
generated.mkdir(parents=True)
|
||||
ziran = str(ROOT / "scripts/ziran.sh")
|
||||
lock = [] if (ROOT / "ziran.local.toml").exists() else ["--locked"]
|
||||
run(ziran, "build", "--project", *lock, "--target=c", "--no-main",
|
||||
"--define", "PLATFORM_DESKTOP", "--entry",
|
||||
"collection_publications_host_behavior:Check", "-o", str(generated),
|
||||
"tests/collection_publications_host_behavior.zi")
|
||||
main_c = generated / "main.c"
|
||||
main_c.write_text('#include "collection_publications_host_behavior.h"\n'
|
||||
'int main(void) { return Check(); }\n')
|
||||
toolchain = Path(subprocess.check_output(
|
||||
[ziran, "pkg", "path", "ziran", *lock], cwd=ROOT, text=True,
|
||||
env=ENVIRONMENT).strip())
|
||||
runtime = ROOT / "build/ziran/libziran.a"
|
||||
if not runtime.exists():
|
||||
run("make", "-j1", str(runtime))
|
||||
|
||||
def package(name):
|
||||
return Path(subprocess.check_output(
|
||||
[ziran, "pkg", "path", name, *lock], cwd=ROOT, text=True,
|
||||
env=ENVIRONMENT).strip())
|
||||
|
||||
oqs_source = package("liboqs")
|
||||
oqs = WORK / ("oqs-" + oqs_source.name)
|
||||
oqs.parent.mkdir(parents=True, exist_ok=True)
|
||||
with open(oqs.with_name(oqs.name + ".lock"), "w") as exclusive:
|
||||
fcntl.flock(exclusive, fcntl.LOCK_EX)
|
||||
run("cmake", "-S", str(oqs_source), "-B", str(oqs),
|
||||
"-DCMAKE_BUILD_TYPE=MinSizeRel", "-DBUILD_SHARED_LIBS=OFF",
|
||||
"-DOQS_BUILD_ONLY_LIB=ON", "-DOQS_USE_OPENSSL=OFF",
|
||||
"-DOQS_DIST_BUILD=OFF", "-DOQS_OPT_TARGET=generic",
|
||||
"-DOQS_MINIMAL_BUILD=SIG_ml_dsa_44")
|
||||
run("cmake", "--build", str(oqs), "--target", "oqs", "--", "-j1")
|
||||
libraries = subprocess.check_output(
|
||||
["pkg-config", "--libs", "sdl2", "cairo", "freetype2", "fontconfig",
|
||||
"pangocairo", "gtk+-3.0"], text=True, env=ENVIRONMENT).split()
|
||||
monocypher = package("monocypher")
|
||||
includes = [item for path in generated.rglob("*") if path.is_dir()
|
||||
for item in ("-iquote", str(path))]
|
||||
temporary = binary.with_suffix(".new")
|
||||
run(os.environ.get("CC", "cc"), "-std=c11", "-O2", "-ffunction-sections",
|
||||
"-fdata-sections", "-I" + str(toolchain / "include"), "-iquote",
|
||||
str(generated), *includes, *map(str, generated.rglob("*.c")),
|
||||
str(ROOT / "build/ziran/libziran.a"), "-I" + str(monocypher / "src"),
|
||||
str(monocypher / "src/monocypher.c"),
|
||||
str(monocypher / "src/optional/monocypher-ed25519.c"),
|
||||
str(oqs / "lib/liboqs.a"), "-Wl,--gc-sections", *libraries,
|
||||
"-lX11", "-l:libcurl.so.4", "-lz", "-lm", "-lpthread", "-o", str(temporary))
|
||||
temporary.replace(binary)
|
||||
result = subprocess.run([binary], cwd=ROOT, env=ENVIRONMENT |
|
||||
{"SDL_AUDIODRIVER": "dummy"})
|
||||
if result.returncode != 42:
|
||||
raise SystemExit(
|
||||
f"collection publications host check returned {result.returncode}")
|
||||
print("Arcade publications host: writable service dispatches through Entity's account gate")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -54,37 +54,158 @@ class CollectionTests(unittest.TestCase):
|
||||
def stage(self):
|
||||
return builder.stage(self.root, self.controller, self.controller_digest, self.output)[0]
|
||||
|
||||
def assert_children_match_declarations(self, catalog, packages, payload_root):
|
||||
declarations = builder.declared_packages(self.root)
|
||||
ledger = json.loads((self.root / "apps/versions.json").read_text())["node_apps"]
|
||||
expected_children = []
|
||||
for app in (app for package in declarations for app in package["apps"] if app["enabled"]):
|
||||
descriptor = app["descriptor"]
|
||||
cover = app["cover"] or {}
|
||||
expected_children.append((
|
||||
descriptor["id"], descriptor["title"], descriptor["name"],
|
||||
ledger[descriptor["name"]]["version"], cover.get("caption", ""),
|
||||
cover.get("action"), tuple(app["requires"]), app["shared_code"],
|
||||
))
|
||||
self.assertEqual([(
|
||||
child["id"], child["title"], child["expected_id"], child["version"],
|
||||
child.get("cover", {}).get("caption", ""), child.get("cover", {}).get("action"),
|
||||
tuple(child.get("dependencies", [])), child.get("shared_code", False),
|
||||
) for child in catalog["children"]], expected_children)
|
||||
self.assertEqual([(p["name"], p["id"], p["children"]) for p in packages],
|
||||
[(package["name"], package["id"],
|
||||
[app["descriptor"]["id"] for app in package["apps"] if app["enabled"]])
|
||||
for package in declarations[1:]])
|
||||
library = payload_root / "assets/arcade/library"
|
||||
for child in catalog["children"]:
|
||||
name = child["expected_id"]
|
||||
source = payload_root / f"build/games/{name}.zx"
|
||||
packed = self.output / child["bundle"]
|
||||
self.assertEqual(packed.read_bytes(), source.read_bytes())
|
||||
self.assertEqual(builder.digest(packed), child["sha256"])
|
||||
self.assertEqual(child["bytes"], source.stat().st_size)
|
||||
self.assertEqual(child["protocol"], "node/2")
|
||||
expected_preview = next(library.glob(f"{name}-preview.*"))
|
||||
self.assertEqual(child["preview"], child["icon"])
|
||||
self.assertEqual(child["preview"], f"assets/arcade/previews/{name}{expected_preview.suffix}")
|
||||
self.assertEqual((self.output / child["preview"]).read_bytes(), expected_preview.read_bytes())
|
||||
for key in ("portrait", "landscape", "logo"):
|
||||
if key not in child.get("cover", {}):
|
||||
continue
|
||||
expected_cover = next(library.glob(f"{name}-{key}.*"))
|
||||
self.assertEqual(child["cover"][key],
|
||||
f"assets/arcade/covers/{name}-{key}{expected_cover.suffix}")
|
||||
self.assertEqual((self.output / child["cover"][key]).read_bytes(),
|
||||
expected_cover.read_bytes())
|
||||
|
||||
def add_library_copy(self, name, key, data):
|
||||
library = self.root / "assets/arcade/library"
|
||||
sources = json.loads((library / "sources.json").read_text())
|
||||
contents, suffix = artist.small_copy(data, key)
|
||||
copy = library / f"{name}-{key}{suffix}"
|
||||
copy.write_bytes(contents)
|
||||
sources[f"{name}-{key}"] = {"source_sha256": hashlib.sha256(data).hexdigest()}
|
||||
(library / "sources.json").write_text(json.dumps(sources))
|
||||
|
||||
def stage_four_leaf_wurm_fixture(self):
|
||||
source = self.root / "fixture-packages/wurm"
|
||||
(source / "editor").mkdir(parents=True)
|
||||
(source / "assets").mkdir()
|
||||
|
||||
def image(color, path):
|
||||
picture = Image.new("RGB", (640, 480), color)
|
||||
picture.save(path)
|
||||
return path.read_bytes()
|
||||
|
||||
(source / "catalog.json").write_text(json.dumps({
|
||||
"id": "xyz.waozi.wurm", "name": "wurm", "title": "Apfelwurm",
|
||||
"kind": "game", "contract_version": 1, "module_api": 2, "host_api": 41,
|
||||
"harnesses": ["arcade"], "preview": "assets/wurm-preview.png",
|
||||
}))
|
||||
(source / "editor/catalog.json").write_text(json.dumps({
|
||||
"id": "xyz.waozi.wurm-editor", "name": "wurm-editor", "title": "Apfelwurm Editor",
|
||||
"kind": "game", "contract_version": 1, "module_api": 2, "host_api": 41,
|
||||
"harnesses": ["arcade"], "preview": "assets/wurm-editor-preview.png",
|
||||
}))
|
||||
images = {
|
||||
"wurm-preview": image((255, 0, 0), source / "assets/wurm-preview.png"),
|
||||
"wurm-portrait": image((0, 255, 0), source / "assets/wurm-portrait.png"),
|
||||
"wurm-editor-preview": image((0, 0, 255), source / "assets/wurm-editor-preview.png"),
|
||||
"wurm-editor-portrait": image((255, 255, 0), source / "assets/wurm-editor-portrait.png"),
|
||||
}
|
||||
(source / "apps.json").write_text(json.dumps({
|
||||
"id": "xyz.waozi.wurm-player", "title": "Apfelwurm", "apps": [
|
||||
{"manifest": "catalog.json", "cover": {
|
||||
"portrait": "assets/wurm-portrait.png", "caption": "Classic", "action": "play"}},
|
||||
{"manifest": "editor/catalog.json",
|
||||
"requires": ["xyz.waozi.wurm"], "cover": {
|
||||
"portrait": "assets/wurm-editor-portrait.png", "caption": "Editor", "action": "open"}},
|
||||
],
|
||||
}))
|
||||
games = self.root / "build/games"
|
||||
for name, prefix in (("wurm", b"synthetic wurm payload\n"),
|
||||
("wurm-editor", b"synthetic wurm editor payload\n")):
|
||||
(games / f"{name}.zx").write_bytes(prefix + name.encode())
|
||||
preview_name = f"{name}-preview.png"
|
||||
(games / preview_name).write_bytes(images[f"{name}-preview"])
|
||||
(games / "wurm-editor-resources.json").write_text(json.dumps({
|
||||
"dependencies": ["xyz.waozi.wurm"],
|
||||
"resources": [{"dependency": "xyz.waozi.wurm", "path": "assets/wurm/classic/",
|
||||
"source": "assets/wurm-preview.png"}],
|
||||
}))
|
||||
for name, key in (("wurm", "preview"), ("wurm", "portrait"),
|
||||
("wurm-editor", "preview"), ("wurm-editor", "portrait")):
|
||||
self.add_library_copy(name, key, images[f"{name}-{key}"])
|
||||
ledger_path = self.root / "apps/versions.json"
|
||||
ledger = json.loads(ledger_path.read_text())
|
||||
ledger["node_apps"]["wurm-editor"] = {
|
||||
"id": "xyz.waozi.wurm-editor", "title": "Apfelwurm Editor", "version": "0.1.0",
|
||||
"sequence": 1, "host_api": 41,
|
||||
}
|
||||
ledger_path.write_text(json.dumps(ledger))
|
||||
resolver = self.root / "scripts/ziran.sh"
|
||||
resolver.write_text(
|
||||
f'#!/bin/sh\n'
|
||||
f'if [ "$1" = pkg ] && [ "$2" = path ] && [ "$3" = wurm ]; then\n'
|
||||
f' printf \'%s\\n\' {shlex.quote(str(source))}\n'
|
||||
f' exit 0\n'
|
||||
f'fi\n'
|
||||
f'cd {shlex.quote(str(ROOT))} && exec ./scripts/ziran.sh "$@"\n'
|
||||
)
|
||||
|
||||
def test_unchanged_games_keep_canonical_identity_and_version(self):
|
||||
catalog, packages = builder.stage(self.root, self.controller, self.controller_digest, self.output)
|
||||
self.assertEqual(catalog["id"], "inbe.arcade")
|
||||
# Inbe draws the launcher icon from the collection's own assets.
|
||||
self.assertEqual((self.output / "assets/arcade/sidebar.shape").read_bytes(),
|
||||
(ROOT / "assets/arcade/sidebar.shape").read_bytes())
|
||||
# The ledger also versions Arcade itself, which is not one of its games.
|
||||
ledger = json.loads((ROOT / "apps/versions.json").read_text())["node_apps"]
|
||||
self.assertEqual({c["id"] for c in catalog["children"]},
|
||||
{"arcade.shovey", "arcade.shovey-editor", "xyz.waozi.wurm"})
|
||||
# Each leaf keeps the cover its own package declares.
|
||||
self.assertEqual([c["cover"].get("caption", "") for c in catalog["children"]], ["Classic", "Editor", ""])
|
||||
self.assertEqual([(p["name"], p["id"], p["children"]) for p in packages],
|
||||
[("shovey", "arcade.shovey-player", ["arcade.shovey", "arcade.shovey-editor"]),
|
||||
("wurm", "xyz.waozi.wurm-player", ["xyz.waozi.wurm"])])
|
||||
for child in catalog["children"]:
|
||||
name = child["expected_id"]
|
||||
packed = self.output / child["bundle"]
|
||||
self.assertEqual(packed.read_bytes(), (ROOT / f"build/games/{name}.zx").read_bytes())
|
||||
self.assertEqual(builder.digest(packed), child["sha256"])
|
||||
self.assertEqual(child["version"], ledger[name]["version"])
|
||||
self.assertEqual(child["protocol"], "node/2")
|
||||
# The library packs its own small copy of each game's art.
|
||||
self.assertEqual((self.output / child["preview"]).read_bytes(),
|
||||
artist.copy_path(f"{name}-preview").read_bytes())
|
||||
for key, path in child["cover"].items():
|
||||
if key in ("portrait", "landscape", "logo"):
|
||||
self.assertEqual((self.output / path).read_bytes(),
|
||||
artist.copy_path(f"{name}-{key}").read_bytes())
|
||||
# Expected identities and versions come from each package's declarations.
|
||||
self.assert_children_match_declarations(catalog, packages, ROOT)
|
||||
self.assertEqual((self.output / catalog["harness"]).read_bytes(), self.controller.read_bytes())
|
||||
|
||||
pinned_ledger = json.loads((ROOT / "apps/versions.json").read_text())["node_apps"]
|
||||
wurm_version = pinned_ledger["wurm"]["version"]
|
||||
self.stage_four_leaf_wurm_fixture()
|
||||
catalog, packages = builder.stage(self.root, self.controller, self.controller_digest, self.output)
|
||||
self.assert_children_match_declarations(catalog, packages, self.root)
|
||||
self.assertEqual([child["id"] for child in catalog["children"]],
|
||||
["arcade.shovey", "arcade.shovey-editor",
|
||||
"xyz.waozi.wurm", "xyz.waozi.wurm-editor"])
|
||||
self.assertEqual(packages[-1]["children"], ["xyz.waozi.wurm", "xyz.waozi.wurm-editor"])
|
||||
children = {child["id"]: child for child in catalog["children"]}
|
||||
self.assertEqual(children["xyz.waozi.wurm"]["version"], wurm_version)
|
||||
self.assertEqual(children["xyz.waozi.wurm-editor"]["version"], "0.1.0")
|
||||
self.assertEqual(children["xyz.waozi.wurm"]["cover"]["caption"], "Classic")
|
||||
self.assertEqual(children["xyz.waozi.wurm-editor"]["cover"]["caption"], "Editor")
|
||||
self.assertEqual(children["xyz.waozi.wurm-editor"]["dependencies"], ["xyz.waozi.wurm"])
|
||||
self.assertFalse(children["xyz.waozi.wurm-editor"].get("shared_code", False))
|
||||
self.assertEqual(children["xyz.waozi.wurm-editor"]["resources"], [{
|
||||
"dependency": "xyz.waozi.wurm", "path": "assets/wurm/classic/",
|
||||
"source": "assets/wurm-preview.png"}])
|
||||
self.assertEqual(children["xyz.waozi.wurm"]["expected_id"], "wurm")
|
||||
self.assertEqual(children["xyz.waozi.wurm-editor"]["expected_id"], "wurm-editor")
|
||||
self.assertNotEqual(children["xyz.waozi.wurm"]["bundle"],
|
||||
children["xyz.waozi.wurm-editor"]["bundle"])
|
||||
|
||||
def test_changed_game_art_needs_fresh_library_copies(self):
|
||||
sources = self.root / "assets/arcade/library/sources.json"
|
||||
value = json.loads(sources.read_text())
|
||||
|
||||
@@ -310,8 +310,10 @@ def main():
|
||||
assert not driver.find(label='Pause', role='button'), 'Unverified bytes must never run'
|
||||
server['corrupt_wurm'] = False
|
||||
primary_download('Try again')
|
||||
# The cover is its title: Apfelwurm asks once how to move, then plays.
|
||||
driver.wait(label='How do you want to move?', role='text', timeout=60)
|
||||
# The hosted player opens its title before its first steering choice.
|
||||
driver.wait(label='Play', role='button', timeout=60)
|
||||
driver.press(label='Play', role='button')
|
||||
driver.wait(label='How do you want to move?', role='text')
|
||||
driver.press(label='Swipe', role='button')
|
||||
driver.wait(label='Pause', role='button')
|
||||
capture(child, 'wurm-playing')
|
||||
@@ -320,7 +322,7 @@ def main():
|
||||
driver.press(label='Back to title', role='button')
|
||||
driver.wait(label='Play', role='button')
|
||||
capture(child, 'wurm-title')
|
||||
driver.press(label='Back', role='button')
|
||||
driver.key('escape')
|
||||
driver.wait(label='Shovey', role='button')
|
||||
for entry in json.loads((root / 'build/arcade.json').read_text())['children']:
|
||||
path = profile / 'resources/downloads' / (entry['sha256'] + '.zx')
|
||||
|
||||
@@ -104,6 +104,24 @@ class GameUpdates(unittest.TestCase):
|
||||
def test_local_override_cannot_publish_wrong_game(self):
|
||||
self.follow('ahead', wrong_commit=True)
|
||||
|
||||
def test_release_ships_unreleased_notes(self):
|
||||
with tempfile.TemporaryDirectory(prefix='arcade-release-notes-') as temporary:
|
||||
root = Path(temporary)
|
||||
game = root / 'game'
|
||||
game.mkdir()
|
||||
(game / 'apps.json').write_text(json.dumps({'title': 'Apfelwurm', 'apps': [{'manifest': 'catalog.json'}]}))
|
||||
(game / 'CHANGELOG.md').write_text('## [Unreleased]\n\n- Later.\n\n## [0.2.1] - 2026-10-29\n\n- Faster.\n')
|
||||
(root / 'CHANGELOG.md').write_text('# Arcade changelog\n\n## [Unreleased]\n\n- Keyboard first.\n\n'
|
||||
'## 0.7.1\n\n- Older.\n')
|
||||
updates = root / 'updates.json'
|
||||
updates.write_text(json.dumps([{'name': 'wurm'}]))
|
||||
with patch.object(follower, 'ROOT', root), patch.object(follower, 'UPDATES', updates), \
|
||||
patch.object(follower.subprocess, 'check_output', return_value=str(game) + '\n'):
|
||||
follower.changelog('ziran')
|
||||
self.assertEqual((root / 'CHANGELOG.md').read_text(),
|
||||
'# Arcade changelog\n\n## 0.7.2\n\n- Keyboard first.\n'
|
||||
'- Apfelwurm 0.2.1: Faster.\n\n## 0.7.1\n\n- Older.\n')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
@@ -0,0 +1,191 @@
|
||||
"""The website serves small verified copies of the collection's library art."""
|
||||
import hashlib
|
||||
import importlib.util
|
||||
import io
|
||||
import json
|
||||
from pathlib import Path
|
||||
import struct
|
||||
import tarfile
|
||||
import tempfile
|
||||
import unittest
|
||||
|
||||
from PIL import Image
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
spec = importlib.util.spec_from_file_location('build_web', ROOT / 'scripts/build-web.py')
|
||||
web = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(web)
|
||||
|
||||
|
||||
def bundle(files):
|
||||
"""A minimal ZX v26 bundle: empty program sections, then its files."""
|
||||
def text(value):
|
||||
return struct.pack('<I', len(value)) + value
|
||||
data = b'ZX\0\0\x1a\0\0\0' + text(b'art') + text(b'Main') + struct.pack('<IIII', 0, 0, 0, 0)
|
||||
data += struct.pack('<I', len(files))
|
||||
for path in sorted(files):
|
||||
data += text(path.encode()) + text(files[path])
|
||||
return data
|
||||
|
||||
|
||||
def png(image):
|
||||
output = io.BytesIO()
|
||||
image.save(output, 'PNG', optimize=True)
|
||||
return output.getvalue()
|
||||
|
||||
|
||||
def jpeg(image):
|
||||
output = io.BytesIO()
|
||||
image.save(output, 'JPEG', quality=85)
|
||||
return output.getvalue()
|
||||
|
||||
|
||||
def gradient(width, height):
|
||||
image = Image.new('RGB', (width, height))
|
||||
image.putdata([(x * 255 // width, y * 255 // height, (x * y) % 256)
|
||||
for y in range(height) for x in range(width)])
|
||||
return image
|
||||
|
||||
|
||||
def decoded(data):
|
||||
image = Image.open(io.BytesIO(data))
|
||||
image.load()
|
||||
return image
|
||||
|
||||
|
||||
class WebLibraryArtTests(unittest.TestCase):
|
||||
def setUp(self):
|
||||
work = ROOT / 'build/scratch'
|
||||
work.mkdir(parents=True, exist_ok=True)
|
||||
self.temporary = tempfile.TemporaryDirectory(prefix='web-art-', dir=work)
|
||||
self.root = Path(self.temporary.name)
|
||||
self.published = self.root / 'published'
|
||||
self.published.mkdir()
|
||||
self.site = self.root / 'site'
|
||||
self.site.mkdir()
|
||||
# A photographic cover, larger than any library copy should be.
|
||||
self.portrait = jpeg(gradient(800, 1200))
|
||||
self.landscape = jpeg(gradient(640, 427))
|
||||
logo = gradient(512, 180).convert('RGBA')
|
||||
logo.putalpha(Image.new('L', logo.size, 0))
|
||||
logo.paste(gradient(300, 100), (100, 40))
|
||||
self.logo = png(logo)
|
||||
# Pixel art with a palette, which must stay exact.
|
||||
pixels = Image.new('P', (48, 32))
|
||||
pixels.putpalette([value for index in range(16) for value in (index * 16, 255 - index * 16, index * 8)])
|
||||
pixels.putdata([(x // 4 + y // 4) % 16 for y in range(32) for x in range(48)])
|
||||
self.preview = png(pixels)
|
||||
self.art = bundle({
|
||||
'assets/arcade/covers/wurm-portrait.jpg': self.portrait,
|
||||
'assets/arcade/covers/wurm-landscape.jpg': self.landscape,
|
||||
'assets/arcade/covers/wurm-logo.png': self.logo,
|
||||
'assets/arcade/previews/wurm.png': self.preview,
|
||||
})
|
||||
|
||||
def tearDown(self):
|
||||
self.temporary.cleanup()
|
||||
|
||||
def collection(self, art=None, archive=True):
|
||||
art = self.art if art is None else art
|
||||
catalog = dict(schema=1, id='inbe.arcade', title='Arcade', harness='assets/apps/apps.zx',
|
||||
art=dict(sha256=hashlib.sha256(self.art).hexdigest(), bytes=len(self.art)),
|
||||
children=[dict(id='xyz.waozi.wurm', title='Apfelwurm',
|
||||
preview='assets/arcade/previews/wurm.png',
|
||||
icon='assets/arcade/previews/wurm.png',
|
||||
cover=dict(portrait='assets/arcade/covers/wurm-portrait.jpg',
|
||||
landscape='assets/arcade/covers/wurm-landscape.jpg',
|
||||
logo='assets/arcade/covers/wurm-logo.png',
|
||||
caption='Play'))])
|
||||
path = self.published / 'arcade.zx'
|
||||
path.write_bytes(bundle({'assets/apps/catalog.json': json.dumps(catalog).encode()}))
|
||||
digest = catalog['art']['sha256']
|
||||
if archive:
|
||||
# The release's game archive, as the website workflow downloads it.
|
||||
with tarfile.open(self.published / 'arcade.games.tar', 'w') as games:
|
||||
for name, data in ((f'{digest}.zx', art), ('0' * 64 + '.zx', b'ZX\0\0game')):
|
||||
entry = tarfile.TarInfo(name)
|
||||
entry.size = len(data)
|
||||
games.addfile(entry, io.BytesIO(data))
|
||||
else:
|
||||
(self.published / 'arcade.games').mkdir()
|
||||
(self.published / 'arcade.games' / f'{digest}.zx').write_bytes(art)
|
||||
return path, digest
|
||||
|
||||
def test_small_webp_copies_keep_alpha_pixels_and_the_exact_art(self):
|
||||
path, digest = self.collection()
|
||||
listing = web.stage_web_library_art(path, self.site)
|
||||
self.assertEqual(listing['art'], digest)
|
||||
self.assertEqual(json.loads((self.site / 'library.json').read_text()), listing)
|
||||
# The exact signed bundle stays beside the copies, for the fallback.
|
||||
self.assertEqual((self.site / 'library' / f'{digest}.zx').read_bytes(), self.art)
|
||||
pictures = listing['pictures']
|
||||
self.assertEqual(set(pictures), {'assets/arcade/covers/wurm-portrait.jpg',
|
||||
'assets/arcade/covers/wurm-landscape.jpg',
|
||||
'assets/arcade/covers/wurm-logo.png',
|
||||
'assets/arcade/previews/wurm.png'})
|
||||
copies = {}
|
||||
for name, picture in pictures.items():
|
||||
data = (self.site / picture['file']).read_bytes()
|
||||
self.assertEqual(hashlib.sha256(data).hexdigest(), picture['sha256'])
|
||||
self.assertEqual(len(data), picture['bytes'])
|
||||
self.assertEqual(picture['file'], f'library/{picture["sha256"]}' + Path(picture['file']).suffix)
|
||||
copies[name] = data
|
||||
portrait = decoded(copies['assets/arcade/covers/wurm-portrait.jpg'])
|
||||
self.assertEqual(portrait.format, 'WEBP')
|
||||
self.assertEqual(portrait.size, (427, 640))
|
||||
landscape = copies['assets/arcade/covers/wurm-landscape.jpg']
|
||||
self.assertEqual(decoded(landscape).format, 'WEBP')
|
||||
self.assertLess(len(landscape), len(self.landscape))
|
||||
logo = decoded(copies['assets/arcade/covers/wurm-logo.png'])
|
||||
self.assertEqual((logo.format, logo.mode, logo.size), ('WEBP', 'RGBA', (512, 180)))
|
||||
self.assertEqual(logo.getpixel((5, 5))[3], 0)
|
||||
self.assertEqual(logo.getpixel((200, 80))[3], 255)
|
||||
preview = copies['assets/arcade/previews/wurm.png']
|
||||
if decoded(preview).format == 'WEBP':
|
||||
self.assertLess(len(preview), len(self.preview))
|
||||
self.assertEqual(decoded(preview).convert('RGB').tobytes(),
|
||||
decoded(self.preview).convert('RGB').tobytes())
|
||||
else:
|
||||
# WebP is no smaller: the verified original goes as it is.
|
||||
self.assertEqual(preview, self.preview)
|
||||
|
||||
def test_a_local_build_folder_also_supplies_the_art(self):
|
||||
path, digest = self.collection(archive=False)
|
||||
self.assertEqual(web.stage_web_library_art(path, self.site)['art'], digest)
|
||||
|
||||
def test_corrupt_or_resized_art_is_refused_before_anything_is_written(self):
|
||||
corrupt = bytearray(self.art)
|
||||
corrupt[-1] ^= 1
|
||||
for art in (bytes(corrupt), self.art + b'\0'):
|
||||
path, _ = self.collection(art)
|
||||
with self.assertRaisesRegex(ValueError, 'differs from the collection catalog'):
|
||||
web.stage_web_library_art(path, self.site)
|
||||
self.assertFalse((self.site / 'library.json').exists())
|
||||
self.assertFalse((self.site / 'library').exists())
|
||||
|
||||
def test_missing_art_or_pictures_are_refused(self):
|
||||
path, _ = self.collection()
|
||||
(self.published / 'arcade.games.tar').unlink()
|
||||
with self.assertRaisesRegex(ValueError, 'not beside it'):
|
||||
web.stage_web_library_art(path, self.site)
|
||||
self.art = bundle({'assets/arcade/previews/wurm.png': self.preview})
|
||||
path, _ = self.collection()
|
||||
with self.assertRaisesRegex(ValueError, 'lacks assets/arcade/covers'):
|
||||
web.stage_web_library_art(path, self.site)
|
||||
self.assertFalse((self.site / 'library.json').exists())
|
||||
|
||||
def test_a_collection_that_packs_its_art_needs_no_copies(self):
|
||||
catalog = dict(schema=1, id='inbe.arcade', children=[])
|
||||
path = self.published / 'arcade.zx'
|
||||
path.write_bytes(bundle({'assets/apps/catalog.json': json.dumps(catalog).encode()}))
|
||||
self.assertIsNone(web.stage_web_library_art(path, self.site))
|
||||
self.assertEqual(list(self.site.iterdir()), [])
|
||||
|
||||
def test_truncated_or_trailing_bundles_are_refused(self):
|
||||
for data in (self.art[:-3], self.art + b'x', b'PK' + self.art[2:]):
|
||||
with self.assertRaises(ValueError):
|
||||
web.bundle_assets(data)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
@@ -1,5 +1,8 @@
|
||||
// Open Arcade's browser edition in a private headless browser and require
|
||||
// its library to draw without a failed frame. Usage: node tests/web_site_test.mjs SITE_DIR
|
||||
// install, play, reopen and recover from a failed saved-record read. The
|
||||
// library's art never comes from api.waozi.xyz: those requests are refused,
|
||||
// and the covers must draw from the site's own copies or its exact art.
|
||||
// Usage: node tests/web_site_test.mjs SITE_DIR
|
||||
import { spawn } from 'node:child_process';
|
||||
import { createServer } from 'node:http';
|
||||
import { access, mkdtemp, readFile, rm } from 'node:fs/promises';
|
||||
@@ -8,9 +11,16 @@ import { extname, join, normalize } from 'node:path';
|
||||
import { setTimeout as delay } from 'node:timers/promises';
|
||||
|
||||
const site = process.argv[2];
|
||||
const game = process.env.ARCADE_TEST_GAME || 'Apfelwurm';
|
||||
if (!site) throw new Error('Usage: node tests/web_site_test.mjs SITE_DIR');
|
||||
const types = { '.html': 'text/html', '.js': 'text/javascript', '.wasm': 'application/wasm', '.json': 'application/json',
|
||||
'.svg': 'image/svg+xml', '.png': 'image/png', '.jpg': 'image/jpeg', '.webmanifest': 'application/manifest+json' };
|
||||
'.svg': 'image/svg+xml', '.png': 'image/png', '.jpg': 'image/jpeg', '.webp': 'image/webp',
|
||||
'.webmanifest': 'application/manifest+json' };
|
||||
const library = JSON.parse(await readFile(join(site, 'library.json'), 'utf8').catch(() => 'null'));
|
||||
// 'site' serves the library as built; 'corrupt' damages every small copy;
|
||||
// 'missing' also withholds the exact art bundle.
|
||||
let libraryMode = 'site';
|
||||
const served = { pictures: 0, art: 0 }, refusedArt = [];
|
||||
const server = createServer(async (request, response) => {
|
||||
const url = new URL(request.url, 'http://x');
|
||||
const path = normalize(decodeURIComponent(url.pathname)).replace(/^\/+/, '') || 'index.html';
|
||||
@@ -22,7 +32,26 @@ const server = createServer(async (request, response) => {
|
||||
response.end('console.error("Stale cached Arcade runtime"); Module.onAbort();');
|
||||
return;
|
||||
}
|
||||
const body = await readFile(join(site, path));
|
||||
let body = await readFile(join(site, path));
|
||||
if (library && path.startsWith('library/')) {
|
||||
if (path.endsWith('.zx')) {
|
||||
served.art++;
|
||||
if (libraryMode === 'missing') throw new Error('withheld');
|
||||
} else {
|
||||
served.pictures++;
|
||||
if (libraryMode !== 'site') body[body.length - 1] ^= 1;
|
||||
}
|
||||
}
|
||||
if (path === 'index.html') {
|
||||
// Enable only the existing widget-tree reader in this disposable page.
|
||||
// Input still travels through the browser's real pointer and key events.
|
||||
body = Buffer.from(body.toString().replace('document.body.appendChild(script);', `
|
||||
Module.preRun = (Module.preRun || []).concat(function () {
|
||||
FS.mkdir('/arcade-test');
|
||||
ENV.KRYON_TEST_DRIVER = '/arcade-test';
|
||||
});
|
||||
document.body.appendChild(script);`));
|
||||
}
|
||||
response.writeHead(200, { 'Content-Type': types[extname(path)] || 'application/octet-stream' });
|
||||
response.end(body);
|
||||
} catch { response.writeHead(404); response.end(); }
|
||||
@@ -31,15 +60,19 @@ await new Promise(resolve => server.listen(0, '127.0.0.1', resolve));
|
||||
const profile = await mkdtemp(join(process.env.TMPDIR || tmpdir(), 'arcade-web-'));
|
||||
const env = { ...process.env };
|
||||
for (const key of ['DISPLAY', 'WAYLAND_DISPLAY', 'XAUTHORITY', 'DBUS_SESSION_BUS_ADDRESS']) delete env[key];
|
||||
env.YUE_DESKTOP_RECOVERY = '0';
|
||||
const browser = spawn(process.env.CHROMIUM || 'chromium', ['--headless=new', '--no-sandbox', '--use-gl=swiftshader',
|
||||
'--enable-unsafe-swiftshader', '--no-first-run', '--remote-debugging-port=0', `--user-data-dir=${profile}`, 'about:blank'],
|
||||
{ env, detached: true, stdio: 'ignore' });
|
||||
let socket, sequence = 0;
|
||||
const pending = new Map(), console_lines = [];
|
||||
const command = (method, params = {}) => new Promise((resolve, reject) => {
|
||||
const id = ++sequence; pending.set(id, { resolve, reject }); socket.send(JSON.stringify({ id, method, params }));
|
||||
const id = ++sequence;
|
||||
const timeout = setTimeout(() => { pending.delete(id); reject(new Error(method + ' timed out')); }, 15000);
|
||||
pending.set(id, { resolve, reject, timeout }); socket.send(JSON.stringify({ id, method, params }));
|
||||
});
|
||||
let failure = '';
|
||||
let expectedDiagnostics = 0;
|
||||
try {
|
||||
const started = Date.now();
|
||||
while (true) {
|
||||
@@ -53,14 +86,28 @@ try {
|
||||
await new Promise((resolve, reject) => { socket.onopen = resolve; socket.onerror = reject; });
|
||||
socket.onmessage = event => {
|
||||
const message = JSON.parse(event.data);
|
||||
if (message.method === 'Fetch.requestPaused') {
|
||||
const { requestId, request } = message.params;
|
||||
const refuse = library && request.url.includes(library.art);
|
||||
if (refuse) refusedArt.push(request.url);
|
||||
socket.send(JSON.stringify(refuse
|
||||
? { id: ++sequence, method: 'Fetch.failRequest', params: { requestId, errorReason: 'BlockedByClient' } }
|
||||
: { id: ++sequence, method: 'Fetch.continueRequest', params: { requestId } }));
|
||||
return;
|
||||
}
|
||||
if (message.method === 'Runtime.consoleAPICalled')
|
||||
console_lines.push(message.params.args.map(arg => arg.value ?? arg.description ?? '').join(' '));
|
||||
if (message.method === 'Runtime.exceptionThrown')
|
||||
console_lines.push(message.params.exceptionDetails.exception?.description || message.params.exceptionDetails.text);
|
||||
const request = pending.get(message.id);
|
||||
if (!request) return;
|
||||
pending.delete(message.id);
|
||||
clearTimeout(request.timeout);
|
||||
message.error ? request.reject(new Error(JSON.stringify(message.error))) : request.resolve(message.result);
|
||||
};
|
||||
await command('Runtime.enable'); await command('Page.enable');
|
||||
// Games still download from the API; only its art requests are refused.
|
||||
await command('Fetch.enable', { patterns: [{ urlPattern: '*://api.waozi.xyz/*' }] });
|
||||
await command('Emulation.setDeviceMetricsOverride', { width: 1280, height: 800, deviceScaleFactor: 1, mobile: false });
|
||||
await command('Page.navigate', { url: `http://127.0.0.1:${server.address().port}/` });
|
||||
let ready = false;
|
||||
@@ -90,9 +137,202 @@ try {
|
||||
}
|
||||
// Let the library draw several frames before judging them.
|
||||
await delay(3000);
|
||||
const failed = console_lines.find(line => /frame failed|portable execution failed/.test(line));
|
||||
if (ready && !failure) {
|
||||
const evaluate = async expression => {
|
||||
const value = await command('Runtime.evaluate', { expression, returnByValue: true, awaitPromise: true });
|
||||
if (value.exceptionDetails) throw new Error(value.exceptionDetails.exception?.description || value.exceptionDetails.text);
|
||||
return value.result?.value;
|
||||
};
|
||||
let serial = 0;
|
||||
const tree = async () => {
|
||||
await evaluate(`FS.writeFile('/arcade-test/command', ${JSON.stringify(++serial + '\ttree\n')})`);
|
||||
const end = Date.now() + 10000;
|
||||
while (Date.now() < end) {
|
||||
const failed = console_lines.slice(expectedDiagnostics).find(line => /frame failed|portable execution failed|RuntimeError/.test(line));
|
||||
if (failed) throw new Error(failed);
|
||||
const reply = await evaluate(`FS.analyzePath('/arcade-test/reply').exists ? FS.readFile('/arcade-test/reply', {encoding:'utf8'}) : ''`);
|
||||
if (reply) {
|
||||
await evaluate(`FS.unlink('/arcade-test/reply')`);
|
||||
return JSON.parse(reply).nodes;
|
||||
}
|
||||
await delay(100);
|
||||
}
|
||||
throw new Error('Arcade stopped drawing frames');
|
||||
};
|
||||
const click = async node => {
|
||||
const position = { x: node.visible_x + node.visible_width / 2, y: node.visible_y + node.visible_height / 2 };
|
||||
await command('Input.dispatchMouseEvent', { type: 'mouseMoved', ...position });
|
||||
await command('Input.dispatchMouseEvent', { type: 'mousePressed', ...position, button: 'left', buttons: 1, clickCount: 1 });
|
||||
await delay(80);
|
||||
await command('Input.dispatchMouseEvent', { type: 'mouseReleased', ...position, button: 'left', buttons: 0, clickCount: 1 });
|
||||
await delay(250);
|
||||
};
|
||||
const button = (nodes, label) => nodes.find(node => node.kind === 'button' && node.label === label && node.visible);
|
||||
const waitButton = async label => {
|
||||
let nodes;
|
||||
for (const end = Date.now() + 60000; Date.now() < end;) {
|
||||
nodes = await tree();
|
||||
const found = button(nodes, label);
|
||||
if (found) return found;
|
||||
await delay(150);
|
||||
}
|
||||
throw new Error('Game did not show ' + label + ': ' + nodes.filter(node => node.kind === 'button').map(node => node.label).join(', '));
|
||||
};
|
||||
const pageReady = async () => {
|
||||
for (const end = Date.now() + 60000; Date.now() < end;) {
|
||||
if (await evaluate('!!(window.Module && Module.profileReady)')) return;
|
||||
await delay(150);
|
||||
}
|
||||
throw new Error('The library did not reopen');
|
||||
};
|
||||
// The covers' own pixels: art has far more colours than an empty tile.
|
||||
const coverColours = async () => {
|
||||
const covers = (await tree()).filter(node => node.kind === 'button' && node.visible &&
|
||||
node.visible_width >= 100 && node.visible_height >= 100);
|
||||
return evaluate(`(() => {
|
||||
const canvas = document.getElementById('canvas'), context = canvas.getContext('2d');
|
||||
const scale = canvas.width / canvas.clientWidth;
|
||||
return ${JSON.stringify(covers)}.map(node => {
|
||||
const pixels = context.getImageData(Math.round(node.visible_x * scale), Math.round(node.visible_y * scale),
|
||||
Math.round(node.visible_width * scale), Math.round(node.visible_height * scale)).data;
|
||||
const colours = new Set();
|
||||
for (let at = 0; at < pixels.length; at += 8) colours.add(pixels[at] << 16 | pixels[at + 1] << 8 | pixels[at + 2]);
|
||||
return colours.size;
|
||||
});
|
||||
})()`);
|
||||
};
|
||||
const DRAWN = 1500;
|
||||
const coversDrawn = async () => {
|
||||
let colours = [];
|
||||
for (const end = Date.now() + 15000; Date.now() < end;) {
|
||||
colours = await coverColours();
|
||||
if (colours.length && colours.every(count => count >= DRAWN)) return colours;
|
||||
await delay(250);
|
||||
}
|
||||
throw new Error('The library covers did not draw: ' + JSON.stringify(colours));
|
||||
};
|
||||
const libraryFetched = async () => evaluate(`performance.getEntriesByType('resource').map(entry => entry.name)
|
||||
.filter(name => /\\/library\\//.test(new URL(name).pathname) || name.includes(${JSON.stringify(library?.art || '-')}))`);
|
||||
if (library) {
|
||||
// The first visit draws every cover from the small copies alone.
|
||||
const colours = await coversDrawn();
|
||||
const fetched = await libraryFetched();
|
||||
if (served.art || refusedArt.length || served.pictures !== Object.keys(library.pictures).length ||
|
||||
fetched.some(name => !/\.webp\?v=/.test(name) && !Object.values(library.pictures).some(picture => name.includes(picture.file))))
|
||||
throw new Error('The covers did not come from the small copies alone: ' + JSON.stringify({ served, refusedArt, fetched }));
|
||||
console.log(`Covers drew from ${served.pictures} small copies (${Object.values(library.pictures).reduce((sum, picture) => sum + picture.bytes, 0)} bytes, art ${library.bytes} bytes); colours ${colours}`);
|
||||
}
|
||||
const cover = button(await tree(), game);
|
||||
if (!cover) throw new Error('Game cover missing');
|
||||
await click(cover);
|
||||
const download = (await tree()).findLast(node => node.kind === 'button' && node.label === 'Download');
|
||||
if (!download) throw new Error('The cover did not offer its download');
|
||||
await click(download);
|
||||
await waitButton(game === 'Apfelwurm' ? 'Play' : 'Back');
|
||||
const play = button(await tree(), 'Play');
|
||||
if (play) await click(play);
|
||||
const swipe = button(await tree(), 'Swipe');
|
||||
if (swipe) await click(swipe);
|
||||
if (game === 'Apfelwurm') await waitButton('Pause');
|
||||
// Flush the actual control record before a cold restart.
|
||||
await evaluate(`new Promise((resolve,reject) => FS.syncfs(false,error => error ? reject(error) : resolve(true)))`);
|
||||
await command('Page.reload');
|
||||
await pageReady();
|
||||
const reloaded = await tree();
|
||||
const installed = button(reloaded, game);
|
||||
if (!installed) throw new Error('Installed cover missing after reload');
|
||||
await click(installed);
|
||||
await waitButton(game === 'Apfelwurm' ? 'Play' : 'Back');
|
||||
console.log(game + ' downloaded, opened its game and reopened from its installed cover');
|
||||
if (game === 'Apfelwurm') {
|
||||
await command('Page.reload');
|
||||
await pageReady();
|
||||
const installed = button(await tree(), game);
|
||||
const saved = await evaluate(`(() => {
|
||||
const root='/kryon-apps/arcade/games';
|
||||
for (const name of FS.readdir(root)) {
|
||||
const path=root+'/'+name+'/records/controls.dat';
|
||||
if (FS.analyzePath(path).exists) return {path,text:FS.readFile(path,{encoding:'utf8'})};
|
||||
}
|
||||
return null;
|
||||
})()`);
|
||||
if (!saved) throw new Error('Playing did not retain the control choice');
|
||||
await evaluate(`(() => {
|
||||
const original=FS.open;
|
||||
FS.open=function(path,...args) {
|
||||
if (String(path).includes('/games/') && String(path).includes('/records/') && !String(path).endsWith('/.lock')) {
|
||||
FS.open=original;
|
||||
throw new FS.ErrnoError(29);
|
||||
}
|
||||
return original.call(this,path,...args);
|
||||
};
|
||||
})()`);
|
||||
await click(installed);
|
||||
// Depending on the game version it first reads records on its title
|
||||
// or on Play. Either path must expose a usable recovery control.
|
||||
if (!await evaluate('!!Module.arcadeFailed')) {
|
||||
try {
|
||||
const play=button(await tree(),'Play');
|
||||
if (play) await click(play);
|
||||
} catch (error) {
|
||||
// The first game frame can fail between sampling the flag and
|
||||
// asking for its tree. Require the runtime's failure signal.
|
||||
let failed=false;
|
||||
for (const end=Date.now()+1000; Date.now()<end;) {
|
||||
failed=await evaluate('!!Module.arcadeFailed');
|
||||
if (failed) break;
|
||||
await delay(50);
|
||||
}
|
||||
if (!failed) throw error;
|
||||
}
|
||||
}
|
||||
let recovered=false;
|
||||
for (const end=Date.now()+15000; Date.now()<end;) {
|
||||
recovered=await evaluate(`!!Module.arcadeFailed && document.getElementById('loading').classList.contains('error') && getComputedStyle(document.getElementById('loading')).opacity==='1'`);
|
||||
if (recovered) break;
|
||||
await delay(100);
|
||||
}
|
||||
if (!recovered) throw new Error('A failed game left the library frozen without recovery');
|
||||
if (!console_lines.some(line=>/portable execution failed in ReadLevel/.test(line)))
|
||||
throw new Error('The fixture did not reproduce the reported saved-record failure');
|
||||
expectedDiagnostics=console_lines.length;
|
||||
const retry=await evaluate(`(() => {const r=document.getElementById('retry').getBoundingClientRect();return {visible_x:r.x,visible_y:r.y,visible_width:r.width,visible_height:r.height};})()`);
|
||||
await click(retry);
|
||||
await pageReady();
|
||||
if (await evaluate(`FS.readFile(${JSON.stringify(saved.path)},{encoding:'utf8'})`) !== saved.text)
|
||||
throw new Error('Recovering from a failed game changed its saved record');
|
||||
await click(button(await tree(),game));
|
||||
await waitButton('Play');
|
||||
console.log('The reported ReadLevel failure showed recovery; returning reopened the installed game and retained its saved record');
|
||||
}
|
||||
if (library) {
|
||||
// Damaged copies are refused; the exact art from the site draws instead.
|
||||
libraryMode = 'corrupt'; served.pictures = served.art = 0;
|
||||
await command('Page.reload');
|
||||
await pageReady();
|
||||
const colours = await coversDrawn();
|
||||
if (served.art !== 1 || refusedArt.length)
|
||||
throw new Error('Damaged copies did not fall back to the site\'s exact art: ' + JSON.stringify({ served, refusedArt }));
|
||||
console.log(`Damaged copies were refused and the site's exact art drew the covers; colours ${colours}`);
|
||||
// Without the site's art the covers stay empty and Arcade asks the API.
|
||||
libraryMode = 'missing';
|
||||
await command('Page.reload');
|
||||
await pageReady();
|
||||
await delay(3000);
|
||||
const empty = await coverColours();
|
||||
if (!refusedArt.length || !empty.length || empty.some(count => count >= DRAWN))
|
||||
throw new Error('The cover check did not tell empty covers apart: ' + JSON.stringify({ empty, refusedArt }));
|
||||
console.log(`Without the site's art the covers stayed empty (colours ${empty}) and the API art request was refused`);
|
||||
libraryMode = 'site';
|
||||
}
|
||||
}
|
||||
const failed = console_lines.slice(expectedDiagnostics).find(line => /frame failed|portable execution failed/.test(line));
|
||||
if (!failure && failed) failure = failed;
|
||||
} catch (error) {
|
||||
console.error(console_lines.slice(-20).join('\n'));
|
||||
throw error;
|
||||
} finally {
|
||||
socket?.close();
|
||||
try { process.kill(-browser.pid, 'SIGTERM'); } catch {}
|
||||
server.close();
|
||||
await rm(profile, { recursive: true, force: true }).catch(() => {});
|
||||
|
||||
@@ -20,20 +20,37 @@
|
||||
},
|
||||
{
|
||||
"commit": "d74348c2e288ac55740461f7e106cda365b4db4a",
|
||||
"dependencies": {"apps": "pfb2b063c26a84c8b", "crypto": "pc23fbf455e97614d", "curl": "p1ca0e8d3c19dbe4c", "daochi_client": "p9972fcdd2d5ba999", "entity": "p6a3a2bd6315ab909", "game2d": "pf2f54c7603f6e861", "kryon": "p974af619ca377b85", "kss": "p1b13dda539ed2a39", "liboqs": "pecdb097af6ab16f7", "mingcute": "pe1027b9d16704793", "monocypher": "p809b4d31a48625a3", "oqs": "p7098ac9cd92f7e5f", "plot": "pab5377a2950368a2", "practices": "p9079dde0fcc11248", "qrcode": "p0dfa70137405b096", "rini": "p09fa77e94b0dfc6c", "sqlite": "p1d80baafaa5fa18a"},
|
||||
"dependencies": {"apps": "p9928fc15e7b93288", "crypto": "pc23fbf455e97614d", "curl": "p1ca0e8d3c19dbe4c", "daochi_client": "p7de54c8ad98fe034", "entity": "pb6d17ac2aeb5844f", "game2d": "pf2f54c7603f6e861", "kryon": "p43481d12b77897ce", "kss": "p1b13dda539ed2a39", "liboqs": "p1aaef6f156781e69", "mingcute": "pe1027b9d16704793", "monocypher": "p809b4d31a48625a3", "oqs": "p7098ac9cd92f7e5f", "plot": "pab5377a2950368a2", "practices": "p9079dde0fcc11248", "qrcode": "p0dfa70137405b096", "rini": "p09fa77e94b0dfc6c", "sqlite": "p1d80baafaa5fa18a"},
|
||||
"id": "p183b01bccc6424e7",
|
||||
"name": "Inbe",
|
||||
"ref": "master",
|
||||
"url": "https://github.com/waozixyz/inbe.git"
|
||||
},
|
||||
{
|
||||
"commit": "a9ad1876e14c2be093a538aca41fd3468fe3cf19",
|
||||
"dependencies": {},
|
||||
"id": "p1aaef6f156781e69",
|
||||
"name": "liboqs",
|
||||
"ref": "main",
|
||||
"source": true,
|
||||
"url": "https://github.com/open-quantum-safe/liboqs.git"
|
||||
},
|
||||
{
|
||||
"commit": "1cb9df183089a77c8a16448a556186f30b261a98",
|
||||
"dependencies": {"kryon": "p974af619ca377b85"},
|
||||
"dependencies": {"kryon": "p43481d12b77897ce"},
|
||||
"id": "p1b13dda539ed2a39",
|
||||
"name": "Kss",
|
||||
"ref": "master",
|
||||
"url": "https://github.com/kryonlabs/kss.git"
|
||||
},
|
||||
{
|
||||
"commit": "da1a7f9b7ed54abaa2ac7c08ecfaaa3b09b842fd",
|
||||
"dependencies": {"apps": "p9928fc15e7b93288", "curl": "p1ca0e8d3c19dbe4c", "entity": "pb6d17ac2aeb5844f", "kryon": "p43481d12b77897ce", "mingcute": "pe1027b9d16704793"},
|
||||
"id": "p1b5832789c5a5053",
|
||||
"name": "Shovey",
|
||||
"ref": "da1a7f9b7ed54abaa2ac7c08ecfaaa3b09b842fd",
|
||||
"url": "https://github.com/waozixyz/shovey.git"
|
||||
},
|
||||
{
|
||||
"commit": "19b299005fbe2d895f4ad525cfdae62a2220c3ea",
|
||||
"dependencies": {},
|
||||
@@ -52,6 +69,14 @@
|
||||
"source": true,
|
||||
"url": "https://github.com/sqlite/sqlite.git"
|
||||
},
|
||||
{
|
||||
"commit": "e1c1135dbd731560964ce26dc4529014eefcec5c",
|
||||
"dependencies": {"raylib": "p5a77c9c35110e925"},
|
||||
"id": "p43481d12b77897ce",
|
||||
"name": "kryon",
|
||||
"ref": "master",
|
||||
"url": "https://github.com/kryonlabs/kryon.git"
|
||||
},
|
||||
{
|
||||
"commit": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e",
|
||||
"dependencies": {},
|
||||
@@ -61,22 +86,22 @@
|
||||
"source": true,
|
||||
"url": "https://github.com/raysan5/raylib.git"
|
||||
},
|
||||
{
|
||||
"commit": "90cee1066a51e1f8961de06515f6e50bdaaf4490",
|
||||
"dependencies": {"daochi_client": "p9972fcdd2d5ba999", "kryon": "p974af619ca377b85", "monocypher": "p809b4d31a48625a3", "qrcode": "p0dfa70137405b096"},
|
||||
"id": "p6a3a2bd6315ab909",
|
||||
"name": "Entity",
|
||||
"ref": "master",
|
||||
"url": "https://github.com/waozixyz/entity.git"
|
||||
},
|
||||
{
|
||||
"commit": "22d2ddbdc236796953c905a05a2cebf5ab1b4ff3",
|
||||
"dependencies": {"liboqs": "pecdb097af6ab16f7"},
|
||||
"dependencies": {"liboqs": "p1aaef6f156781e69"},
|
||||
"id": "p7098ac9cd92f7e5f",
|
||||
"name": "Oqs",
|
||||
"ref": "master",
|
||||
"url": "https://github.com/ziranlang/oqs.git"
|
||||
},
|
||||
{
|
||||
"commit": "8250ece58a03f4d9c07cd8434780d659b54f5d7f",
|
||||
"dependencies": {"crypto": "pc23fbf455e97614d", "oqs": "p7098ac9cd92f7e5f"},
|
||||
"id": "p7de54c8ad98fe034",
|
||||
"name": "DaochiClient",
|
||||
"ref": "master",
|
||||
"url": "https://github.com/ziranlang/daochi-client.git"
|
||||
},
|
||||
{
|
||||
"commit": "f5f0a19a5dc6c14a49adb3cd63ea79a60f6ba77b",
|
||||
"dependencies": {},
|
||||
@@ -96,29 +121,37 @@
|
||||
"url": "https://github.com/waozixyz/practices.git"
|
||||
},
|
||||
{
|
||||
"commit": "3fad22341997f7c58ed1b11b1e88217358e51af5",
|
||||
"dependencies": {"raylib": "p5a77c9c35110e925"},
|
||||
"id": "p974af619ca377b85",
|
||||
"name": "kryon",
|
||||
"commit": "5b67236a8e355e67ce4f8cc0389b9ce3805b874b",
|
||||
"dependencies": {"crypto": "pc23fbf455e97614d", "kryon": "p43481d12b77897ce"},
|
||||
"id": "p9928fc15e7b93288",
|
||||
"name": "Apps",
|
||||
"ref": "master",
|
||||
"url": "https://github.com/kryonlabs/kryon.git"
|
||||
},
|
||||
{
|
||||
"commit": "25d9f649c43a8de44a5fea602d2835e33e6ca999",
|
||||
"dependencies": {"crypto": "pc23fbf455e97614d", "oqs": "p7098ac9cd92f7e5f"},
|
||||
"id": "p9972fcdd2d5ba999",
|
||||
"name": "DaochiClient",
|
||||
"ref": "master",
|
||||
"url": "https://github.com/ziranlang/daochi-client.git"
|
||||
"url": "https://github.com/waozixyz/apps.git"
|
||||
},
|
||||
{
|
||||
"commit": "3f888653b6b97010163d824c4cc72476be3214f3",
|
||||
"dependencies": {"kryon": "p974af619ca377b85"},
|
||||
"dependencies": {"kryon": "p43481d12b77897ce"},
|
||||
"id": "pab5377a2950368a2",
|
||||
"name": "plot",
|
||||
"ref": "master",
|
||||
"url": "https://github.com/kryonlabs/plot.git"
|
||||
},
|
||||
{
|
||||
"commit": "99d9ad777325e9dfc15cd8610056948819dc1f07",
|
||||
"dependencies": {"apps": "p9928fc15e7b93288", "crypto": "pc23fbf455e97614d", "entity": "pb6d17ac2aeb5844f", "kryon": "p43481d12b77897ce", "mingcute": "pe1027b9d16704793"},
|
||||
"id": "pb4256918f4b7855d",
|
||||
"name": "Apfelwurm",
|
||||
"ref": "99d9ad777325e9dfc15cd8610056948819dc1f07",
|
||||
"url": "https://github.com/waozixyz/wurm.git"
|
||||
},
|
||||
{
|
||||
"commit": "33e54462886507cfb355f86e6d2d93cef7b2331c",
|
||||
"dependencies": {"daochi_client": "p7de54c8ad98fe034", "kryon": "p43481d12b77897ce", "monocypher": "p809b4d31a48625a3", "qrcode": "p0dfa70137405b096"},
|
||||
"id": "pb6d17ac2aeb5844f",
|
||||
"name": "Entity",
|
||||
"ref": "master",
|
||||
"url": "https://github.com/waozixyz/entity.git"
|
||||
},
|
||||
{
|
||||
"commit": "944826f70779a6b6cd53f6b06a75b36f4d8a2558",
|
||||
"dependencies": {},
|
||||
@@ -135,54 +168,21 @@
|
||||
"ref": "master",
|
||||
"url": "https://github.com/kryonlabs/mingcute.git"
|
||||
},
|
||||
{
|
||||
"commit": "b9ca6de322881b40139ba6d19a0744eda1128db0",
|
||||
"dependencies": {"apps": "pfb2b063c26a84c8b", "entity": "p6a3a2bd6315ab909", "kryon": "p974af619ca377b85", "mingcute": "pe1027b9d16704793"},
|
||||
"id": "pe8259811ea138316",
|
||||
"name": "Apfelwurm",
|
||||
"ref": "b9ca6de322881b40139ba6d19a0744eda1128db0",
|
||||
"url": "https://github.com/waozixyz/wurm.git"
|
||||
},
|
||||
{
|
||||
"commit": "4778aa5044bf119c30df54219fa89357080af27f",
|
||||
"dependencies": {},
|
||||
"id": "pecdb097af6ab16f7",
|
||||
"name": "liboqs",
|
||||
"ref": "main",
|
||||
"source": true,
|
||||
"url": "https://github.com/open-quantum-safe/liboqs.git"
|
||||
},
|
||||
{
|
||||
"commit": "cee04692f3461dcb098833472f071c434980debb",
|
||||
"dependencies": {"kryon": "p974af619ca377b85"},
|
||||
"dependencies": {"kryon": "p43481d12b77897ce"},
|
||||
"id": "pf2f54c7603f6e861",
|
||||
"name": "Game2D",
|
||||
"ref": "master",
|
||||
"url": "https://github.com/kryonlabs/game2d.git"
|
||||
},
|
||||
{
|
||||
"commit": "2419a7c645d3e2cfe904fc98763e06ee57cabbde",
|
||||
"dependencies": {"apps": "pfb2b063c26a84c8b", "entity": "p6a3a2bd6315ab909", "kryon": "p974af619ca377b85", "mingcute": "pe1027b9d16704793"},
|
||||
"id": "pf9aaac00f44c39f6",
|
||||
"name": "Shovey",
|
||||
"ref": "2419a7c645d3e2cfe904fc98763e06ee57cabbde",
|
||||
"url": "https://github.com/waozixyz/shovey.git"
|
||||
},
|
||||
{
|
||||
"commit": "dc6b743b5299318fa74bd32854b0eff0046d24a2",
|
||||
"dependencies": {"crypto": "pc23fbf455e97614d", "kryon": "p974af619ca377b85"},
|
||||
"id": "pfb2b063c26a84c8b",
|
||||
"name": "Apps",
|
||||
"ref": "master",
|
||||
"url": "https://github.com/waozixyz/apps.git"
|
||||
}
|
||||
],
|
||||
"root": {
|
||||
"dependencies": {"apps": "pfb2b063c26a84c8b", "entity": "p6a3a2bd6315ab909", "inbe": "p183b01bccc6424e7", "kryon": "p974af619ca377b85", "mingcute": "pe1027b9d16704793", "shovey": "pf9aaac00f44c39f6", "wurm": "pe8259811ea138316"},
|
||||
"dependencies": {"apps": "p9928fc15e7b93288", "entity": "pb6d17ac2aeb5844f", "inbe": "p183b01bccc6424e7", "kryon": "p43481d12b77897ce", "mingcute": "pe1027b9d16704793", "shovey": "p1b5832789c5a5053", "wurm": "pb4256918f4b7855d"},
|
||||
"name": "Arcade"
|
||||
},
|
||||
"toolchain": {
|
||||
"commit": "2e2fea84d91ead3c5af4a105c7d716cfa8bb6a31",
|
||||
"commit": "a97e88b5b0a956c9c9977cce593ea4ecdb7ad72b",
|
||||
"ref": "master",
|
||||
"url": "https://github.com/ziranlang/ziran.git"
|
||||
}
|
||||
|
||||
@@ -34,12 +34,12 @@ ref = "master"
|
||||
[dependencies.apps]
|
||||
git = "https://github.com/waozixyz/apps.git"
|
||||
# Use the shared controller reviewed with the supported collection host.
|
||||
ref = "master"
|
||||
ref = "5b67236a8e355e67ce4f8cc0389b9ce3805b874b"
|
||||
|
||||
# Shovey's editions and editor are available as separate downloads.
|
||||
[dependencies.shovey]
|
||||
git = "https://github.com/waozixyz/shovey.git"
|
||||
ref = "2419a7c645d3e2cfe904fc98763e06ee57cabbde"
|
||||
ref = "da1a7f9b7ed54abaa2ac7c08ecfaaa3b09b842fd"
|
||||
|
||||
# Compatibility tooling runs Inner Breeze's host checks; releases check its publisher pins.
|
||||
[dependencies.inbe]
|
||||
@@ -56,4 +56,4 @@ ref = "master"
|
||||
|
||||
[dependencies.wurm]
|
||||
git = "https://github.com/waozixyz/wurm.git"
|
||||
ref = "b9ca6de322881b40139ba6d19a0744eda1128db0"
|
||||
ref = "99d9ad777325e9dfc15cd8610056948819dc1f07"
|
||||