Skip to content

feat: add Wegame support#209

Merged
Loskh merged 7 commits into
CNfrom
wegame
May 14, 2026
Merged

feat: add Wegame support#209
Loskh merged 7 commits into
CNfrom
wegame

Conversation

@Loskh
Copy link
Copy Markdown

@Loskh Loskh commented May 14, 2026

No description provided.

Loskh added 7 commits May 14, 2026 01:24
Replace the manual SndaId+Token paste flow with an automated capture
driven by ApkalluCaller's version.dll hijacking sdologin.exe.

- Add WeGamePathValidator: identify a WeGame FFXIV install via
  rail_files/rail_game_identify.json (game_id == 2000340) and derive
  the sdologin directory.
- Add WeGameLoginCapturer: deploy version.dll (hash-compared, with
  permission-denied exception for UAC fallback), host a JSON-RPC named
  pipe (ApkalluCaller, NDJSON + SystemTextJsonFormatter), launch the
  game via wegame://StartFor=2000340, and await login.captured. Wait
  for JsonRpc.Completion before disposing so the response is flushed
  (otherwise the Rust client reads 0 bytes: "empty response").
- Add hidden WeGameLauncherPath setting caching the sdologin dir;
  prompt with a folder picker on first use or when invalidated.
- In MainWindowViewModel, split the WeGameToken case into three
  branches: manual SndaId+Token, saved AutoLoginSessionKey fast-login,
  and the new auto-capture flow with UAC-elevated copy fallback.
- Update UI hints so username/token are marked optional/auto.
- Always expose the WeGameToken entry in the login type dropdown now
  that it no longer requires manual packet capture.
- Add StreamJsonRpc 2.24.84 dependency.
- Persist captured/used WeGameToken into XivAccount.Password
  unconditionally (no longer gated on doingAutoLogin) and replay it on
  the next login via a new saved-Password branch in TryLogin's switch,
  so returning users skip the auto-capture step.
- Stop saving AutoLoginSessionKey for WeGame accounts and remove the
  AutoLoginSession fallback in the WeGameToken switch case; the session
  key returned by LoginByWeGameToken is not accepted by
  LoginBySessionKey and trying to use it just fails. Sdo flows
  unchanged.
- On LoginByWeGameToken rejection (SdoLoginException), if the failed
  credential decrypts to the same value as the saved Password, null it
  out and persist so the next attempt falls through to auto-capture
  instead of looping on an expired token. Decrypt-and-compare guards
  against wiping an unrelated account when a fresh capture happens to
  resolve to a different SndaId.
- Route startup auto-login for XivAccountType.WeGame through
  LoginType.WeGameToken (with null password) so the new saved-Password
  branch picks up the token, instead of LoginType.AutoLoginSession
  which would feed the invalid AutoLoginSessionKey to LoginBySessionKey.
- Drop the manual-token branch from the WeGameToken switch case and
  hide the LoginPassword input for that login type; the SndaId field
  remains visible (optional, captured if blank).
- In SwitchAccount, only show the PresudoPassword placeholder for a
  saved WeGame account when it actually has a Password (mirrors the
  Sdo branch).
- Add an internal-only marker comment to LoginType.AutoLoginSession.
Add ApkalluCaller as a submodule under src/ApkalluCaller and wire its
i686-pc-windows-msvc cdylib build into XIVLauncher.csproj so a normal
Visual Studio / dotnet build automatically produces and stages
Resources/version.dll for the WeGame token-capture flow.

The BuildApkalluCaller target hard-errors when the submodule is missing
or `cargo` is not on PATH (override with /p:SkipApkalluCaller=true), runs
`rustup target add` + `cargo build --release`, then copies the artifact
into Resources/version.dll. The staged DLL is gitignored so the binary
never lands in the tree.
…piry

Mirror the Sdo LoginBySessionKey hook for WeGameToken accounts so a mid-
game session expiry (-10515004) detected by DcTravelListener can be
silently recovered by re-running LoginByWeGameToken with the just-used
token, instead of forcing the user back to the launcher with the
"登录过期且未开启自动登录" error.

Gated on doingAutoLogin && dcTravelListener != null to match the Sdo
branch (user opt-in for background re-login). The token is copied into
a separate local because the surrounding `serect = null` later in
TryLogin would null out the closure capture.
…oken

Repurpose the two existing checkboxes for the WeGameToken login type so
users can explicitly control the capture/persist behavior, instead of
the previous "always save, never force" hardcoding.

- Relabel FastLoginCheckBox to "保存密码" (mirroring SdoStatic). Gate the
  token persistence and the DcTravel refresh hook on its state via
  doingAutoLogin: unchecked => the captured token is used for this
  session only and never written to accounts.json.
- Reuse ReadWeGameInfoCheckBox as "强制重新抓包". When checked, skip the
  saved-token branch in the LoginType.WeGameToken switch and go straight
  to sdologin capture, so users can refresh a stale token on demand.
- Reset the checkbox Content/ToolTip to defaults at the top of
  LoginTypeSelection_OnSelectionChanged so switching back to other login
  types restores the original labels.
Implement a confirmation dialog for users to agree to the usage terms before utilizing the WeGameToken login feature. This ensures users are informed about the functionality and security implications of the tool. The dialog includes a detailed explanation of the login process and a warning about the feature's testing status. User consent is stored in application settings to prevent repeated prompts.
@Loskh Loskh merged commit 0d20abc into CN May 14, 2026
0 of 2 checks passed
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