Skip to content

Add Square Enix account sign-in support for Final Fantasy XIV library entries - #488

Closed
wwboyer wants to merge 4 commits into
willfaust:mainfrom
wwboyer:feat/square-enix-login
Closed

wwboyer wants to merge 4 commits into
willfaust:mainfrom
wwboyer:feat/square-enix-login

Conversation

@wwboyer

@wwboyer wwboyer commented Oct 30, 2026

Copy link
Copy Markdown

Summary

Adds Square Enix sign-in support for FINAL FANTASY XIV library entries, so the game can start from Madeira without Square Enix's launcher. Square Enix's launcher doesn't run in Madeira's Wine setup (It's a CEF/WebView2 app that just shows a webpage), but the actual game itself runs incredibly well in Wine.

What it does

  • Recognizes FFXIV automatically. A library entry that names one of the game's own programs, next to its version files, gets a Square Enix section on its details page. Pressing "Play" then shows the user a sign-in sheet before launching. Everything else is identical to other library entries.
  • Signs in from a sheet on Play. The sheet runs the sign-in (server status, boot version check, credentials, session registration), shows progress and Square Enix's own error messages, and starts game/ffxiv_dx11.exe with that launch's session.
    • One-time passwords and free trial accounts are supported.
    • A refused password is not retried automatically, as repeated failures can lock the account.
    • Canceling or failing doesn't use the app run's Wine session.
  • License: Windows or Mac. The game decides which version to run by looking up Wine's wine_get_host_version, which returns Darwin under Mac OS and (obviously) doesn't exist on Windows.
    • Under Mac, the game starts with no issue, as Madeira also returns Darwin.
    • Under Windows, a small patch to the PE ntdll (build/wine-pe/patches/ntdll-hide-wine-host-version.patch, applied by build-ntdll.sh for its build only) hides that function from GetProcAddress. Load-time imports still resolve.
    • The game's Windows version then restarts itself, so a Windows-license launch always starts in the Wine desktop to prevent the Wine session from ending early.
  • Remember sign-in (opt-in). The Square Enix ID and password are stored in the iOS Keychain, on the local device only. A one-time password is never stored. Turning it off or removing the entry deletes the item.

What it doesn't do (for now)

  • No downloading: it doesn't install the game files. An existing game install must be manually copied over to drive_c.
  • No patching: when the game is outdated (the boot check or session registration says so), it stops and tells the user. It doesn't apply updates.
  • No Steam version support: the Steam version of the game has its own quirks in the sign-in flow (specifically requiring a session ticket from the Steamworks API). I do not own the game on Steam, so I cannot test this.

Downloading and patching would fit on top of this later: the boot check already parses the patch list (target version and download URL).

Details

  • Protocol and provenance: docs/SQUARE_ENIX_SIGNIN.md covers the protocol, the license findings and where every fact came from.
    • The code is an independent implementation, written from that document and first-hand observation.
    • No third-party launcher code was used or referenced for this implementation.
  • New files:
    • app/Madeira/SquareEnixSignIn.swift (the protocol; Foundation and CryptoKit only)
    • app/Madeira/SquareEnixSignInView.swift (the UI and Keychain)
    • tests/host/check-square-enix-signin.py
    • tools/sqex-signin-probe.py (runs the sign-in once from a Mac, without starting the game)
  • Other changes:
    • LibraryEntry gains three optional fields, plus a transient program next to its transient arguments.
    • Info.plist allows plain HTTP to patch-bootver.ffxiv.com only. In the login process, there is a specific boot update check that requires a GET request to an HTTP endpoint. HTTPS requests will fail, so an exception needs to be made for patch-bootver.ffxiv.com.
    • Log redaction hides DEV.TestSID.
    • The settings catalog is regenerated.
    • The arm64ec ntdll.dll, rebuilt with the patch, is committed.

Testing

  • Host tests: check-square-enix-signin.py --require-swift passes, along with check-frontend, check-epic-games, check-game-recommendations, check-runtime-settings, check-control-presets, check-config-catalog, check-log-redaction's new case and check-doc-links.
    • check-steam-games ("no Launch arguments for a Steam game") fails on main as well, and so does check-log-redaction's ntdll wiring count.
  • On an iPhone:
    • Mac license: signed in and played normally.
    • Windows license: the game ran its Windows version, starting in the Wine desktop automatically.
    • The test account has both licenses, so a refusal under the wrong setting for a single-license account hasn't been observed.

Disclosure

The code, documentation, and this pull request were written with the help of Claude Opus 5.5 (Anthropic).

… entries

A library entry that names one of FINAL FANTASY XIV's own programs gets a
Square Enix section. Play then opens a sign-in sheet that checks server
status and the boot version, signs in (one-time passwords and free trial
accounts included), registers the session and starts game/ffxiv_dx11.exe
with it. Sign-in can optionally be remembered in the iOS Keychain.

Under a Windows license, a patched arm64ec ntdll hides wine_get_host_version
from GetProcAddress, and the game starts in the Wine desktop because its
Windows version restarts itself. Under a Mac license the game starts as is.

docs/SQUARE_ENIX_SIGNIN.md records the protocol, the license findings and
where each fact came from. tools/sqex-signin-probe.py runs the sign-in once
from a Mac, and tests/host/check-square-enix-signin.py covers the protocol.

Signed-off-by: Trey Boyer <17682352+wwboyer@users.noreply.github.com>
@wwboyer
wwboyer force-pushed the feat/square-enix-login branch from 724d6c2 to f52634b Compare October 30, 2026 16:39
@wwboyer
wwboyer marked this pull request as ready for review October 30, 2026 16:48
When sign-in or the gate is closed, the message now tells the user to
check the FFXIV Lodestone for details instead of only to try again later.

Signed-off-by: Trey Boyer <17682352+wwboyer@users.noreply.github.com>
An outdated game's session registration replies 200 with a patch list
and an X-Patch-Unique-Id, so the header alone let an outdated client
launch. A reply whose body lists patches now ends the sign-in with
"The game needs an update", naming the newest target version. Found
with the probe's --save-reply for game version 2012.01.01.0000.0000.

Signed-off-by: Trey Boyer <17682352+wwboyer@users.noreply.github.com>
Session registration answers a current game with 204 and the session
ID, seen on the iPhone with the patch-list check in place; sign-in and
launch still work with both licenses.

Signed-off-by: Trey Boyer <17682352+wwboyer@users.noreply.github.com>
125hz added a commit that referenced this pull request Nov 2, 2026
Their changes are already on main as squashed commits, one per pull request,
each authored by its author, in the order the wave's integration branch merged
them: #516, #517 and #515 (125hz), #512, #484, #490, #491, #493, #511, #485,
#494, #499, #475, #489 and #498 (insertfloppy), #510 (alantangok), #501 and
#486 (Jelly-RayTian), #477 (intraducine), #505 (llamajose), #496
(g6c8jfntbc-dotcom) and #521 (125hz). #473's entitlement fix is on main as its
one commit; the rest of that branch is stacked on another PR's branch and
already on main through #476 and #483. This merge only adds the pull requests'
heads as parents (the ours strategy changes no files), so GitHub shows them as
merged.

Three maintainer commits sit between them: the dxmt and FEX pins after the
submodule merges, the background keep-alive leaving an endpoint iOS stopped
alone (#498 follow-up), the frame generation fix with the rebuilt arm64ec
kernelbase.dll and d3d9.dll, and the Settings pages for the sections this wave
adds (#521 follow-up).

The submodule pins were fast-forwarded onto their branches so the pinned commits
stay as they are: willfaust/wine#69 and #67 (madeira-lgpl), willfaust/FEX#37 and
#36 (ios-port-2607), willfaust/dxmt#53, #52 and #54 (ios-port) and
willfaust/madeira-dock#8 (main). The tree is the one the wave's IPA was built
from and tested on device.

Not in this wave: #518, #519, #520, #523 and #524 came in after the device test
and wait for the next one; #488 waits for a decision; #522 conflicts.

Pull requests: #516 #517 #515 #512 #510 #501 #486 #477 #484 #490 #491 #493 #505 #511 #485 #494 #496 #499 #475 #489 #498 #521

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wwboyer

wwboyer commented Nov 2, 2026

Copy link
Copy Markdown
Author

Closing this for now - I got a lot closer to a full download and patching system much more quickly than I thought I would given that I'm no longer trying to utilize code from other projects, so I'm going to continue working on that and open a PR for a complete solution rather than have this half-baked one merged.

@wwboyer wwboyer closed this Nov 2, 2026
@wwboyer
wwboyer deleted the feat/square-enix-login branch November 2, 2026 03:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant