Updates
The bundle (scripts/bundle.sh) is a phigros++ <native> <version> <platform>:<game>... line followed by every core file in load order, words.txt and mods/, read by phigrospp/bundle.c:
| File | |
|---|---|
phigrospp/VERSION | The Phigros++ version, of the bundle and of the release |
phigrospp/NATIVE | Bumped when the C changes anything the Lua sees: a bundle runs only on the native code it lists |
phigrospp/GAMES | The game versions the Lua works on, one android:4.0.1.2 or ios:4.0.3 per line, each platform's newest last: a bundle runs only on a game it lists for its platform |
phigrospp/release.pub | The release key every build trusts |
The charts key is a separate one: it signs the official custom charts and nothing else, and it lives in mods/charts.lua (Custom charts).
The catalog key is a third one, in phigrospp/lua/mods.lua: it signs registry.txt, the mods of the catalog and their authors' keys (Publishing a mod). After merging a pull request on the registry, scripts/registry.sh signs it with the seed in ~/.config/phigrospp/catalog.key and sends it to phigros.tools, its first line the time it was published: the game keeps the newest one it saw and refuses an older one. phigros.tools only serves it, along with a listing the game doesn't trust: a mod is shown when the signed registry names it, and installed when its release is signed by its author's key of the registry. A mod installed from a link has no such check, and says so.
On start, the game reads the phigrospp.version of the latest GitHub release (ggmolly/PhigrosPlusPlus), its bundle's first line. A newer bundle for this app and game is offered in a toast on the chapter screen, which waits on nobody: tapped, it opens a popup whose Update downloads the bundle under a progress bar, then the game reloads into it. A release that needs a newer app (another native, or a newer game) is offered the same way and opens the release page. Skip keeps that version out of the toasts, the Phigros++ tab still offers it.
A downloaded bundle is phigros++/bundle, its Ed25519 signature first. The C side runs it only when the signature is the release key's, its native and game match the app's and it's newer than the one built in, else the built-in one runs. The signature protects the download: a tampered release file, a hijacked mirror or someone who can upload release files but has no key can't run code on players' devices. What's already in phigros++/ (mods/, core/) is trusted as before, since anything that can write there could add a mod.
Releasing a bundle is pushing a v<VERSION> tag: .github/workflows/release.yml signs it with the release environment's key and publishes it. A new app (C changes or a game update) is built locally and its APKs attached to the release before it's published. scripts/release.sh --keygen makes a new key: its seed goes to stdout, the public key to phigrospp/release.pub. A new key needs a new app, since every build trusts the one it was built with.
A release also carries phigrospp.ios, what phigros.tools patches the iOS game's IPA with (Development), signed like the bundle. phigros.tools keeps the latest release's, and the page checks the release key's signature before patching with it.
keystore.jks signs the APKs, so players update the app in place keeping their data. Keep it safe and out of the repo: whoever has it can make an app that installs over every player's game, and without it every player must uninstall.