phigros.tools
Sync is off until the player turns on "Sync to phigros.tools", on the game settings' Profile page, above its TapTap login. Phigros++ then draws 16 random bytes: the player's key on phigros.tools. They are hashed (SHA-512) into an Ed25519 key and shown in a dialog as 16 words of phigrospp/words.txt, one per byte: they are the password that brings the profile to another device. Once the player says they saved them, the key is registered and kept in the app's private folder (phigros++.identity), which no other app can read. The site reads the same word list.
The key is registered under the name the player has in Phigros (their TapTap nickname, or the name set on the profile screen), and the server gives it a number: name#0042, unique per name and never chosen by the game. The first 12 hex characters of the key are the player's ID, and their page is phigros.tools/players/<id>. Their self-introduction (none when they kept the game's placeholder), avatar and background go along, and any change in the game follows on phigros.tools, a rename keeping the number when it's free.
Another device joins the profile two ways, both from "Sign in to my profile", shown on a device without a profile ("Sign out", in red, forgets this device's key and removes it from the profile when it joined with a code). The 16 words bring the profile's own key back: only their first 4 letters count, and the key is checked with the server before it replaces the device's. Or "Sign in another device" on a signed-in device (or Devices on phigros.tools) shows an 8 character code, valid once for 10 minutes: the new device types it and joins with a key of its own, named after its model, which the profile's Devices list can remove. Such a device has no recovery phrase to show. A browser signs in the same way, and "Open in browser" opens phigros.tools with the code already in.
While sync is on, the profile card shows the number after the name, a Share button next to the profile's Edit opens Android's share sheet with the profile's link, and the page also shows "Force sync" (sends the profile, every record the game has, marked imported on the site since only replays prove a score, any kept replay of a record's exact score, the save if it's uploaded, and what waits in the outbox), the recovery phrase, and what goes to phigros.tools:
| Toggle | Default | |
|---|---|---|
| Upload my save | on | The whole save, as the game's cloud save makes it, after each song: phigros.tools reads it like a TapTap one |
| Upload replays | on | The replay of each play beating the chart's record |
| Upload play stats | on | A summary of every finished song (chart, score, judgements, length), for the player's stats on the site |
| Upload over mobile data | on | Off, uploads wait for Wi-Fi. Only on devices with a mobile network |
| Unlisted profile | off | Left out of the leaderboards, the profile's link still opens |
The profile is kept in phigros++/profile.lua.
Requests go through the game's UnityWebRequest (phigrospp/lua/net.lua). This Unity has no SetRequestHeader, so a signed request is its body behind the public key, an Ed25519 signature of <METHOD> <path>\n<time><body> and the time in ms, which the server checks in web/server/auth.ts.
With sync on, a play that beats the chart's record sends its replay to POST /api/replays (phigrospp/lua/sync.lua). Every play is still kept on the device, unsigned, and a replay is signed with the player's key when it's sent. A replay the server didn't get waits in phigros++/outbox and goes again at every scene change.
The trophy next to the chapter screen's settings shows the leaderboard without sync (GET /api/players, phigrospp/lua/leaderboard.lua): the players by RKS 50 at a time, counting every record or verified replays only, and a player's row opens their page.
The tab next to it lists the rooms players play charts together in (Rooms), which take a profile.
Mods run with everything Phigros++ has (the game through il2cpp, files, the key's functions), so a mod can read the key: install only mods you trust.
The official custom charts are served from phigros.tools/chapters/<code>/ (web/server/routes/chapters/): a signed manifest, the Opus music, the covers and the .phc charts, published by web/scripts/publish-charts.ts into the server's data/chapters/ without a deploy (Custom charts).