From 81e238b92e05476763d3599af5374846c3d14f19 Mon Sep 17 00:00:00 2001 From: The412Banner <205237651+The412Banner@users.noreply.github.com> Date: Sun, 15 Nov 2026 20:55:42 -0500 Subject: [PATCH] feat(xbox): Nexus backend 0.2.15, Nexus runtime 11.0-20261102 and DLC mounting (#2696) Nexus moved its Xodus changes from patch files in xodus-nexus into a backend fork (domsvoboda/nexus-backend, GPL-3.0). prepare.py now fetches that fork at backend-v0.2.15 (e7884a27, same Xodus base 53ea781d, same Rust 1.99.0) and applies the DroidDeck patches, rebased onto it: - droiddeck-credentials, -launch-view, -library-subscriptions: same rebase as Bannerlator's 0.2.15 update (identical patches before and after). - droiddeck-credential-fallback, -credential-diagnostics: applied unchanged. - droiddeck-cloud-token: session::prepare now also returns the account snapshot; the ticket checks it like upstream's profile/social commands. - droiddeck-licensing-device-ticket: upstream 0.2.15 already formats delegation-compact device tickets for Store license tokens (27c335e), so only the content licensing path is patched. Upstream now writes compact JWE delegation tickets as t=, so the d= prefix check is replaced by the token type, the same rule as upstream's store_license.rs. droiddeck-xbox-ticket.patch is dropped: upstream sends compact JWE delegation tickets to Xbox Live sign-in in a form it accepts, with tests. Runtime: domsvoboda/nexus-runtime runtime-11.0-20261102-g76c6dd13 (was xodus-nexus runtime-11.0-20261018). Same six modules at the same path; xgameruntime.dll is the C++ implementation (nexus-xgameruntime 455b1ba9). Archive sha512 from the release's .sha512sum, source sha256 from its candidate.json, module sha256 from the extracted files. The PlayFab Game Saves proxy is a newer build at the same path and still passes droiddeck-xbox's export checks; its license moved to share/doc/nexus-runtime/. DLC mounting: the C++ runtime mounts downloadable content only inside a host-managed workspace named by XODUS_MOUNT_ROOT (src/System/Package/Mount.h returns E_NOTIMPL without it). DroidDeck starts Wine itself (droiddeck:prepare), so droiddeck-dlc-mount.patch (ported from Bannerlator) creates the workspace in the launch directory for the prepare session and reports it as mountRoot; XboxRuntime passes it in the xbox-prepare reply and droiddeck-xbox sets XODUS_MOUNT_ROOT to its Z: path. XODUS_CONTENT_ROOTS is unchanged and still read by the runtime. Upstream fixes since the old pins include sign-in for some accounts, offline play, cloud-save conflict handling, DLC mounting, duplicate token requests and per-game fixes (Ori, AoE, MSFS, Forza Motorsport). --- README.md | 2 +- .../launcher/stores/xbox/XboxRuntime.kt | 2 +- .../overlay/usr/local/bin/droiddeck-xbox | 4 + tools/tests/test_xbox_launch.py | 4 +- tools/xbox/README.md | 29 +- tools/xbox/backend.lock.json | 229 +--------------- tools/xbox/droiddeck-cloud-token.patch | 70 ++--- .../droiddeck-credential-diagnostics.patch | 12 +- .../xbox/droiddeck-credential-fallback.patch | 6 +- tools/xbox/droiddeck-credentials.patch | 258 +++++++++--------- tools/xbox/droiddeck-dlc-mount.patch | 30 ++ tools/xbox/droiddeck-launch-view.patch | 34 +-- .../droiddeck-library-subscriptions.patch | 16 +- .../droiddeck-licensing-device-ticket.patch | 167 ++++-------- tools/xbox/droiddeck-xbox-ticket.patch | 75 ----- tools/xbox/prepare.py | 22 +- tools/xbox/runtime.lock.json | 29 +- 17 files changed, 350 insertions(+), 639 deletions(-) create mode 100644 tools/xbox/droiddeck-dlc-mount.patch delete mode 100644 tools/xbox/droiddeck-xbox-ticket.patch diff --git a/README.md b/README.md index a6b4a1db2f..caea20aafe 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@ DroidDeck is [GPL-3.0](LICENSE). Steam and Proton belong to Valve Corporation. V - Battle.net installs drive Blizzard's Agent the way [@barncastle](https://github.com/barncastle)'s [Battle.Net-Installer](https://github.com/barncastle/Battle.Net-Installer) does, with requests from [wowdev.wiki](https://wowdev.wiki/Agent). Read without taking code: [@mubaraknumann](https://github.com/mubaraknumann)'s [unifideck](https://github.com/mubaraknumann/unifideck), [@djmittens](https://github.com/djmittens)'s [neo-mittens](https://github.com/djmittens/neo-mittens) `bnetswitch`, [@BCD1210](https://github.com/BCD1210)'s [soju](https://github.com/BCD1210/soju) and [Lutris](https://github.com/lutris/lutris)'s `product.db` reader. - World of Warcraft addon imports replace an addon's folder from a temporary copy, as [WowUp](https://github.com/WowUp/WowUp) does, and read flavour folders the way [WoWDeck](https://github.com/sigboe/wowdeck) does. No code from either is used. - The World of Warcraft addon Download window searches [WoWInterface](https://www.wowinterface.com) through its MMOUI API. [CurseForge](https://www.curseforge.com/wow) opens in the user's browser, with no API and no key. -- Xbox games load [@domsvoboda](https://github.com/domsvoboda)'s [xodus-nexus](https://github.com/domsvoboda/xodus-nexus) modules (LGPL-2.1-or-later), including `wintypes.dll`. Content licensing sends delegation-compact device tickets in the licensing wire form, following the [nexus-backend](https://github.com/domsvoboda/nexus-backend) commit `27c335e`. Minecraft's GameInput setup was checked against [@Wyze3306](https://github.com/Wyze3306)'s [BedrockOnLinux](https://github.com/Wyze3306/BedrockOnLinux) (MIT). +- The Xbox store runs [@domsvoboda](https://github.com/domsvoboda)'s [nexus-backend](https://github.com/domsvoboda/nexus-backend) 0.2.15 (GPL-3.0, a fork of [Xodus](https://github.com/xodus-gaming/xodus)), and Xbox games load the Windows modules of his [nexus-runtime](https://github.com/domsvoboda/nexus-runtime) (LGPL-2.1-or-later), including the C++ [nexus-xgameruntime](https://github.com/domsvoboda/nexus-xgameruntime) and `wintypes.dll`. Content licensing sends delegation-compact device tickets in the licensing wire form, as nexus-backend's Store license path (commit `27c335e`) does. Minecraft's GameInput setup was checked against [@Wyze3306](https://github.com/Wyze3306)'s [BedrockOnLinux](https://github.com/Wyze3306/BedrockOnLinux) (MIT). - The Xbox Cloud Gaming player uses the WebRTC client of [@unknownskl](https://github.com/unknownskl)'s [Greenlight](https://github.com/unknownskl/greenlight) (MIT), and its offer tweaks and sharpening follow [@redphx](https://github.com/redphx)'s [Better xCloud](https://github.com/redphx/better-xcloud) (MIT). See `tools/xcloud-player/NOTICE.md`. - The itch.io butler pack ships butler's `7z.so`, itch.io's build of [7-Zip](https://www.7-zip.org) by Igor Pavlov (LGPL-2.1, unRAR restriction on RAR code), unmodified. Other archives use Apache Commons Compress and the runtime's bsdtar (libarchive). - The Store uses [Flatpak](https://github.com/flatpak/flatpak) (LGPL-2.1) through DroidDeck's own bubblewrap shim. Chromium and Electron apps start directly, since [zypak](https://github.com/refi64/zypak) by [@refi64](https://github.com/refi64) (BSD-3-Clause) always uses Flatpak's spawn portal. diff --git a/app/src/main/java/com/droiddeck/launcher/stores/xbox/XboxRuntime.kt b/app/src/main/java/com/droiddeck/launcher/stores/xbox/XboxRuntime.kt index d1ba4a52e7..bcdc7da954 100644 --- a/app/src/main/java/com/droiddeck/launcher/stores/xbox/XboxRuntime.kt +++ b/app/src/main/java/com/droiddeck/launcher/stores/xbox/XboxRuntime.kt @@ -61,7 +61,7 @@ internal object XboxRuntime { val view = result.get(90, java.util.concurrent.TimeUnit.SECONDS) check(renew(app, id, token) && synchronized(state) { generation == current }) { "Xbox launch was cancelled" } return JSONObject().put("ok", true).put("socket", socket.path).put("lease", token) - .put("exe", view.getString("exe")).put("playfab", view.opt("playfab")) + .put("exe", view.getString("exe")).put("playfab", view.opt("playfab")).put("mountRoot", view.opt("mountRoot")) } catch (e: Exception) { released(token); throw e } } diff --git a/tools/linuxfs/overlay/usr/local/bin/droiddeck-xbox b/tools/linuxfs/overlay/usr/local/bin/droiddeck-xbox index 5a9f2578ca..6e27070bcd 100755 --- a/tools/linuxfs/overlay/usr/local/bin/droiddeck-xbox +++ b/tools/linuxfs/overlay/usr/local/bin/droiddeck-xbox @@ -409,6 +409,10 @@ def launch(command, env): owned_env.pop(name, None) if reply.get('playfab'): owned_env['XODUS_XSTS_PLAYFAB'] = reply['playfab'] + # The runtime mounts DLC only inside this backend-owned workspace (E_NOTIMPL without it). + mount_root = reply.get('mountRoot') + if isinstance(mount_root, str) and mount_root.startswith('/'): + owned_env['XODUS_MOUNT_ROOT'] = 'Z:' + mount_root.replace('/', '\\') content = folder / '.xbox-content' roots = [] if content.is_dir(): diff --git a/tools/tests/test_xbox_launch.py b/tools/tests/test_xbox_launch.py index 76137248e6..0e3fd2eca7 100644 --- a/tools/tests/test_xbox_launch.py +++ b/tools/tests/test_xbox_launch.py @@ -49,7 +49,8 @@ class XboxLaunchTest(unittest.TestCase): (runtime / name).write_bytes(b'MZ') store = {'find_store_game': lambda argv: (root, {'store': 'xbox', 'id': 'GAME'}), 'ask': unittest.mock.Mock(return_value={'ok': True, 'socket': '/service', 'lease': 'lease-1', - 'exe': '/private/Game.exe', 'playfab': 'game-token'})} + 'exe': '/private/Game.exe', 'playfab': 'game-token', + 'mountRoot': '/launch/xodus-mounts-1'})} close = unittest.mock.Mock() with patch('runpy.run_path', return_value=store), patch.dict(xbox['launch'].__globals__, RUNTIME=runtime.parent), \ patch.dict(xbox['launch'].__globals__, bridge=lambda path: (1234, 'key', close)), \ @@ -64,6 +65,7 @@ class XboxLaunchTest(unittest.TestCase): for name in ('DROIDDECK_XBOX_CREDENTIAL_SOCKET', 'DROIDDECK_XBOX_CREDENTIAL_PORT', 'DROIDDECK_XBOX_CREDENTIAL_KEY'): self.assertNotIn(name, env) self.assertEqual(env['XODUS_XSTS_PLAYFAB'], 'game-token') + self.assertEqual(env['XODUS_MOUNT_ROOT'], 'Z:\\launch\\xodus-mounts-1') close.assert_called_once() self.assertEqual(store['ask'].call_args.args[1], {'op': 'xbox-released', 'lease': 'lease-1'}) diff --git a/tools/xbox/README.md b/tools/xbox/README.md index 73afef3803..0f106585bc 100644 --- a/tools/xbox/README.md +++ b/tools/xbox/README.md @@ -2,10 +2,12 @@ DroidDeck uses the Nexus backend protocol with a native Linux AArch64 CLI and service. It does not install the Nexus desktop launcher or x86 Linux Wine. -`backend.lock.json` pins Xodus, the Nexus commit, Rust, and the ordered patch -checksums. `runtime.lock.json` pins the Nexus Windows runtime release and each -extracted PE DLL. `prepare.py` verifies both source revisions and all Nexus patch -checksums before applying the local transport, launch and library patches. +`backend.lock.json` pins the Nexus backend (domsvoboda/nexus-backend, a fork of +Xodus that carries Nexus's changes as commits), its Xodus base, Rust and the +Cargo.lock checksum. `runtime.lock.json` pins the Nexus Windows runtime release +(domsvoboda/nexus-runtime) and each extracted PE DLL. `prepare.py` verifies the +source revision and Cargo.lock before applying the local transport, launch and +library patches. `droiddeck-cloud-token.patch` adds `xodus-cli cloud-token`: the stored account's Xbox Cloud Gaming sign-in (XSTS for `http://gssv.xboxlive.com/`, then the streaming @@ -42,10 +44,15 @@ uses a keyed loopback port the app also listens on; some devices refuse the abst from inside PRoot. The key is passed in the backend's environment only. `droiddeck-licensing-device-ticket.patch` sends a delegation-compact device ticket to content -licensing and Store license tokens in the licensing wire form (`t=` or a bare compact JWE), as -user tickets already are. A plain compact device ticket is sent unchanged. The rule follows -[@domsvoboda](https://github.com/domsvoboda)'s nexus-backend commit `27c335e` and -xodus-gaming/xodus#238. +licensing in the licensing wire form (`t=` or a bare compact JWE), as user tickets already are; +a plain compact device ticket is sent unchanged. Store license tokens already do this in +nexus-backend 0.2.15 ([@domsvoboda](https://github.com/domsvoboda)'s commit `27c335e`); the +content licensing path does not yet (xodus-gaming/xodus#238). + +`droiddeck-dlc-mount.patch`: the C++ XGameRuntime mounts downloadable content only inside a +host-owned workspace named by `XODUS_MOUNT_ROOT`. DroidDeck starts Wine itself, so the +`droiddeck:prepare` session creates that workspace in its launch directory, reports it as +`mountRoot`, and removes it when the session ends; `droiddeck-xbox` passes it to the game. `droiddeck-credential-diagnostics.patch` names the step behind a `credential-io` failure: the session lock (`lock-dir-owner`, `lock-file-mode`, `lock-flock-`, ...), a socket or loopback @@ -117,8 +124,10 @@ contributions to Xodus. Sources and licenses: -- Xodus: https://github.com/xodus-gaming/xodus (GPL-3.0, `LICENSE.xodus`). -- Nexus patches: https://github.com/domsvoboda/xodus-nexus (MIT, `LICENSE.nexus`). +- Nexus backend: https://github.com/domsvoboda/nexus-backend, a fork of Xodus + https://github.com/xodus-gaming/xodus (GPL-3.0, `LICENSE.xodus`). +- Nexus launcher and runtime compatibility files: https://github.com/domsvoboda/nexus-launcher + (formerly xodus-nexus; MIT, `LICENSE.nexus`, `LICENSE.runtime-compat`). - XGameRuntime/Wine modules: the exact source archive is identified in `runtime.lock.json` (LGPL-2.1, `LICENSE.LGPL-2.1`). - `libnghttp2.dll`: nghttp2, MIT; its license is retained in the runtime source diff --git a/tools/xbox/backend.lock.json b/tools/xbox/backend.lock.json index 86a1c807e3..1e1024b1f8 100644 --- a/tools/xbox/backend.lock.json +++ b/tools/xbox/backend.lock.json @@ -1,221 +1,14 @@ { - "schema": 1, - "version": "0.2.12", - "repository": "https://github.com/xodus-gaming/xodus.git", - "commit": "53ea781dcd073e31d7ea68e894134e9c959bff04", + "schema": 2, + "version": "0.2.15", + "repository": "https://github.com/domsvoboda/nexus-backend.git", + "commit": "e7884a27f698c7447b96b431b2935f9ed50677f5", + "tag": "backend-v0.2.15", + "upstream": { + "repository": "https://github.com/xodus-gaming/xodus.git", + "commit": "53ea781dcd073e31d7ea68e894134e9c959bff04" + }, "rust": "1.99.0", - "cargoLockSha256": "2259b343e00dadc263018beb7664b12e9d58a0b73bff502ad566f5f8619ce28a", - "patchId": "linux-run-v54", - "compatibility": "linux-run-v25", - "patches": [ - { - "file": "xodus-linux-run.patch", - "sha256": "68f260ec2c6e9264c47ed1a650868511f5412a756725d4000a865804f4712e8b" - }, - { - "file": "xodus-offline-mirror.patch", - "sha256": "c865fc2559c43a5b3eb2bc841035c076eae5c42a90fe488f90514384aa916986" - }, - { - "file": "xodus-account-status.patch", - "sha256": "e2a718d16957733d140891fcdd26cc8cb3db0636307e6ff6e9ffbfa41a2d393c" - }, - { - "file": "xodus-streaming-cache-flush.patch", - "sha256": "4dd7a129ab9b3aac74d46f926efe26f163741d50fe2853a07f292240ab522b05" - }, - { - "file": "xodus-launch-chain.patch", - "sha256": "22dfbfc5cec911091351bb2d648f4b16bd274aa276ee4524be738a357c8b219a" - }, - { - "file": "xodus-memfd-path.patch", - "sha256": "905cfda813f0a434a2c13fd2db973385f0311cbec5c86bc3549737a7838f49fd" - }, - { - "file": "xodus-real-launch-images.patch", - "sha256": "95fc642e3adfa50414648e40df6ee94262964f5eea0f3762a34765f56d7824b7" - }, - { - "file": "xodus-store-license.patch", - "sha256": "99a89821e15ba144126515b5e8ec70b0673caf694d9295f16cd6661564b7c579" - }, - { - "file": "xodus-store-updates.patch", - "sha256": "554e3849122c8cd3c64c7f5904ac06931a088bc8fb4c522ec2c55b972b72ea8e" - }, - { - "file": "xodus-streaming-progress.patch", - "sha256": "b5e22d8eb595502776c4d6f2a5451403647e31754fc6358bc4f338cab72642a0" - }, - { - "file": "xodus-case-insensitive-paths.patch", - "sha256": "53dbfd6f734db100fff958e4a311155cad2cb374db456f73544ad76e3799ac8d" - }, - { - "file": "xodus-account-profile.patch", - "sha256": "135166ff0cf9f95af92dad6fd1c958b6c57e939fbb5b398b5a603b730541554a" - }, - { - "file": "xodus-subscription-login.patch", - "sha256": "6c3f32c905039948b3ff95a0ceaba9b2a09a9417606653bce9b741c8bba43eb0" - }, - { - "file": "xodus-external-auth.patch", - "sha256": "0a22d5a84d328780e6f13ac07f8e1db6359ec70139ad4262e4c1ee988973e20e" - }, - { - "file": "xodus-keyring-activation.patch", - "sha256": "8c71928e0b365f4770532ef968322450f1ebab3a1199e7a10d894119c48c925e" - }, - { - "file": "xodus-package-selection.patch", - "sha256": "28a2b566afdc1a572cd5ec52027fb48cc1823a25e8f304f282d9bf61e8d46463" - }, - { - "file": "xodus-package-metadata.patch", - "sha256": "43fccfbb2ea2a9809e7f0b3d9e2f506213e6245d3bbd4c1c631149a67bb2d661" - }, - { - "file": "xodus-license-sku.patch", - "sha256": "b7c93b6ead7120c5b2af3616e80c0dadf56326a8bc81a2526a5e1f2700f58e20" - }, - { - "file": "xodus-keyring-credentials.patch", - "sha256": "8b354f95b864ffd7eadb02f0d54eb1361bb92fde14ff8696fabfea5c43d03811" - }, - { - "file": "xodus-library-resilience.patch", - "sha256": "0136157efe8a1419f91243c496656c4d043422e126c40e4a552e769c53de3545" - }, - { - "file": "xodus-game-activity.patch", - "sha256": "89bfd422f951515dd393eb479901ff9613441c627d139918c233a19ec21f1e06" - }, - { - "file": "xodus-achievements.patch", - "sha256": "55e4b56b943f491da4c9836a5d6655417ed63ab6383576a8e0f153ec986039b0" - }, - { - "file": "xodus-session-recovery.patch", - "sha256": "fa67d768214247a5955716b9691616b45330ebda504703bf372fdda2252b0831" - }, - { - "file": "xodus-content-response.patch", - "sha256": "e9997951526cfa08e3dd8c5fc4c383bf630e7ab8992d9e211acee40fdc6422a4" - }, - { - "file": "xodus-streaming-recovery.patch", - "sha256": "7e8550d7b50faf3b3cb7cfcf6e47cff35a0369737d421ef454d4dcf0c9c8ffad" - }, - { - "file": "xodus-download-bandwidth.patch", - "sha256": "4655c51eb93811ea41500be05062a4ff0f64dde3d819dddde12e48d91b075293" - }, - { - "file": "xodus-ticket-diagnostics.patch", - "sha256": "6559c77e06f3c7f29caac95ed979b7644bd4082f9ff777f66713888969c3905e" - }, - { - "file": "xodus-auth-consistency.patch", - "sha256": "930dd88e5ecef2628973ebb4f1652f6888951d71e6531dda7d5d7a258eb435dd" - }, - { - "file": "xodus-metadata-recovery.patch", - "sha256": "b72c473615f2e5d359101cb5fae404aa3b54a34a73118b1c7f99238bd16860e3" - }, - { - "file": "xodus-streaming-handoff.patch", - "sha256": "3be60b5dbca7fae0cb97e18e64665662620b9527c4c1340acfb4c2e2d497e648" - }, - { - "file": "xodus-store-ticket.patch", - "sha256": "5302a699a06208c9b51809eea31261a2a53facce1af3177611ecfc050abb4eb5" - }, - { - "file": "xodus-keyring-encoding.patch", - "sha256": "fa6a0d4ce87f39fdb74950248f1dfd6ccecc4724c76773f5cbf84a8a003729b8" - }, - { - "file": "xodus-encrypted-resume.patch", - "sha256": "73629791cbd91e93664cd77908640484298fa0a17e42a5c1b94b71b2298e8e2c" - }, - { - "file": "xodus-launch-image-errors.patch", - "sha256": "180a4c094a81a6da55044fdc5be7be834575148c12e6789d11f67960d9a22ecf" - }, - { - "file": "xodus-keyring-unlock.patch", - "sha256": "7762a87353d4c1a25133c8c541678cec7e233a6f67589e3d16f66b4738975baa" - }, - { - "file": "xodus-keyring-session-stop.patch", - "sha256": "864e9e427f6298afa012cbbf7586b627e788bcbdc75cabf493274947dce0e8cd" - }, - { - "file": "xodus-keyring-persistence.patch", - "sha256": "78782b557ec3f5457b6e697bb9262ad2403497691d8f23814b42fdd9300b7b46" - }, - { - "file": "xodus-keyring-create.patch", - "sha256": "c79a46f387f7de54e3d3004d646f9e9b141c4d498eebd69a47144450b15442e6" - }, - { - "file": "xodus-bundle-membership.patch", - "sha256": "a5eacc683d006b40247fbf124a62078080685b814cb09a33756083ab99adb72d" - }, - { - "file": "xodus-licensing-jwe.patch", - "sha256": "6f0087e657f225e9a770405fbb34c2317f840615742c89b62f241f1b65c590ca" - }, - { - "file": "xodus-hosted-signin.patch", - "sha256": "f52b16944ca7dfc837337e0257be380467f01872706252d7c2e981db0c57a8bc" - }, - { - "file": "xodus-durable-content.patch", - "sha256": "3d2310fffb020396a68b99e217a81ae1b82920bfa425bf6fd8024c9ea1af6a55" - }, - { - "file": "xodus-conditional-entitlements.patch", - "sha256": "8acc3e079d6f8242d364e5d6cd88bddda7004016c12ed4c48bb353499b95f347" - }, - { - "file": "xodus-content-device-limit.patch", - "sha256": "d6a7115a6efd5d2acaf600590c61e38802632c7afad083639884212984fbccb7" - }, - { - "file": "xodus-authenticated-account-metadata.patch", - "sha256": "1c3845c44efcb4afa49d6618b89e15f39e06804182f281a975f2df14e5a2164d" - }, - { - "file": "xodus-social.patch", - "sha256": "c1571a719715df08fde865a4ec88e359dbeccf27ef3d990310692eb953d01484" - }, - { - "file": "xodus-social-send-receipt.patch", - "sha256": "5b1db84e7d5754b4d2f56771c6d931ecc0579e3a00f7678b4f870fe713d60bc0" - }, - { - "file": "xodus-social-session.patch", - "sha256": "96862af0bb672d6c7ed9575a21412ac68764b5c554f3aa9a380fba7b1fce235a" - }, - { - "file": "xodus-launch-filesystem.patch", - "sha256": "8c898a5756149e2205ad9091203d0953506256bb84bba9080308db840d3ad030" - }, - { - "file": "xodus-plain-launch-entry.patch", - "sha256": "6106f03e38d57f6d62f6662b3567dd5599a3e95b09d653d48e99eb5bba3d3fb8" - }, - { - "file": "xodus-package-storage.patch", - "sha256": "76c2c805a62cc3b424bd5b91c26402a1aee46f21efbd785402aa52aea7784510" - }, - { - "file": "xodus-social-stdout.patch", - "sha256": "9386eedd91d6ac48fd7c369565bb3c2f7c22688a87239ef434d3c6aeb45cf115" - } - ], - "nexusCommit": "ba0e191e1eb8088d00eee7bfe8da80f0a8c5ec72" + "cargoLockSha256": "c0fc4c3de2f0f42af45489c769b25c62410e3599bed560cafd802e192b7bebff", + "compatibility": "linux-run-v25" } diff --git a/tools/xbox/droiddeck-cloud-token.patch b/tools/xbox/droiddeck-cloud-token.patch index 97493f4a05..c18cd912f0 100644 --- a/tools/xbox/droiddeck-cloud-token.patch +++ b/tools/xbox/droiddeck-cloud-token.patch @@ -1,43 +1,21 @@ +diff --git a/crates/xodus-cli/src/commands.rs b/crates/xodus-cli/src/commands.rs +index 4f1b211..088a6d0 100644 --- a/crates/xodus-cli/src/commands.rs +++ b/crates/xodus-cli/src/commands.rs -@@ -6,6 +6,7 @@ - pub mod login; +@@ -7,6 +7,7 @@ pub mod login; pub mod logout; + pub mod offline_pc; pub mod profile; +pub mod cloud_token; pub mod social; pub mod game_activity; pub mod achievements; ---- a/crates/xodus-cli/src/main.rs -+++ b/crates/xodus-cli/src/main.rs -@@ -70,6 +70,8 @@ - #[arg(long, default_value_t = false)] - json: bool, - }, -+ #[command(about = "Get an Xbox Cloud Gaming streaming token for the stored account")] -+ CloudToken, - #[command(about = "Read Xbox gamertag and gamerpic for the stored account")] - Profile { - #[arg(long, default_value_t = false)] -@@ -251,6 +253,7 @@ - args.command, - SubCommand::Account { .. } - | SubCommand::Profile { .. } -+ | SubCommand::CloudToken - | SubCommand::Social { .. } - | SubCommand::GameActivity { .. } - | SubCommand::Achievements { .. } -@@ -317,6 +320,7 @@ - } - }, - SubCommand::Profile { json } => commands::profile::run(&tokens, json).await, -+ SubCommand::CloudToken => commands::cloud_token::run(&tokens).await, - SubCommand::Social { .. } => commands::social::run(&tokens).await, - SubCommand::GameActivity { title_id, json } => commands::game_activity::run(&tokens, title_id, json).await, - SubCommand::Achievements { title_id, json } => commands::achievements::run(&tokens, title_id, json).await, +diff --git a/crates/xodus-cli/src/commands/cloud_token.rs b/crates/xodus-cli/src/commands/cloud_token.rs +new file mode 100644 +index 0000000..03e4553 --- /dev/null +++ b/crates/xodus-cli/src/commands/cloud_token.rs -@@ -0,0 +1,226 @@ +@@ -0,0 +1,227 @@ +use std::{process::ExitCode, time::Duration}; +use serde_json::{Value, json}; +use xodus::{models::{live::ExchangeUserTokenOutcome, secrets::Token, soap}, tokens::TokenManager}; @@ -46,13 +24,14 @@ +const OFFERINGS: [&str; 2] = ["xgpuweb", "xgpuwebf2p"]; + +async fn ticket(tokens: &TokenManager, client: &reqwest::Client, target: &str, policy: soap::PolicyReference) -> Result<(String, String), &'static str> { -+ let (account, device, user) = super::session::prepare(tokens, client).await.map_err(|stage| { ++ let (account, device, user, snapshot) = super::session::prepare(tokens, client).await.map_err(|stage| { + super::session::diagnostic(stage); stage + })?; + let outcome = super::session::exchange(|| async { xodus::api::live::exchange_user_token(client, user.clone(), account.clone(), device.clone(), + None, Some("Silent".into()), "{d6d5a677-0872-4ab0-9442-bb792fce85c5}".into(), + &[(target.into(), Some(policy.clone()))]) + .await.map_err(|error| super::session::classify(&error)) }).await?; ++ tokens.validate_user_token_snapshot(&snapshot).map_err(|_| "account-changed")?; + let response = match outcome { + ExchangeUserTokenOutcome::Issued(soap::BodyContent::RequestSecurityTokenResponseCollection(mut collection)) if !collection.security_tokens.is_empty() => collection.security_tokens.remove(0), + ExchangeUserTokenOutcome::Issued(soap::BodyContent::RequestSecurityTokenResponse(response)) => *response, @@ -264,3 +243,32 @@ + } + +} +diff --git a/crates/xodus-cli/src/main.rs b/crates/xodus-cli/src/main.rs +index 290d586..b2a3383 100644 +--- a/crates/xodus-cli/src/main.rs ++++ b/crates/xodus-cli/src/main.rs +@@ -86,6 +86,8 @@ enum SubCommand { + #[arg(long, default_value_t = false)] + json: bool, + }, ++ #[command(about = "Get an Xbox Cloud Gaming streaming token for the stored account")] ++ CloudToken, + #[command(about = "Read Xbox gamertag and gamerpic for the stored account")] + Profile { + #[arg(long, default_value_t = false)] +@@ -304,6 +306,7 @@ async fn main() -> ExitCode { + SubCommand::Account { .. } + | SubCommand::SavedAccounts { .. } + | SubCommand::Profile { .. } ++ | SubCommand::CloudToken + | SubCommand::Social { .. } + | SubCommand::NativeSocial { .. } + | SubCommand::GameActivity { .. } +@@ -381,6 +384,7 @@ async fn main() -> ExitCode { + }, + SubCommand::Profile { json, license } => commands::profile::run(&tokens, json, license).await, + SubCommand::NativeSocial { action } => commands::native_social::run(&tokens,action).await, ++ SubCommand::CloudToken => commands::cloud_token::run(&tokens).await, + SubCommand::Social { .. } => commands::social::run(&tokens).await, + SubCommand::GameActivity { title_id, json } => commands::game_activity::run(&tokens, title_id, json).await, + SubCommand::Achievements { title_id, json } => commands::achievements::run(&tokens, title_id, json).await, diff --git a/tools/xbox/droiddeck-credential-diagnostics.patch b/tools/xbox/droiddeck-credential-diagnostics.patch index f1d441d3b2..724ce78a59 100644 --- a/tools/xbox/droiddeck-credential-diagnostics.patch +++ b/tools/xbox/droiddeck-credential-diagnostics.patch @@ -1,8 +1,8 @@ diff --git a/crates/xodus/src/tokens/backend/keychain.rs b/crates/xodus/src/tokens/backend/keychain.rs -index 19480da..dc8f136 100644 +index 98aa6db..e0bc627 100644 --- a/crates/xodus/src/tokens/backend/keychain.rs +++ b/crates/xodus/src/tokens/backend/keychain.rs -@@ -13,29 +13,22 @@ pub struct KeychainBackend; +@@ -12,29 +12,22 @@ pub struct KeychainBackend; // keyed loopback port the app also listens on is used for the rest of the process. static LOOPBACK: AtomicBool = AtomicBool::new(false); static REPORTED: AtomicBool = AtomicBool::new(false); @@ -45,7 +45,7 @@ index 19480da..dc8f136 100644 if let Some(key) = prefix { stream.write_all(key.as_bytes())?; stream.write_all(b"\n")?; -@@ -45,6 +38,7 @@ fn exchange(mut stream: S, prefix: Option<&str>, value: &Value) +@@ -44,6 +37,7 @@ fn exchange(mut stream: S, prefix: Option<&str>, value: &Value) let mut bytes = Vec::new(); std::io::BufReader::new(stream).take(2_097_153).read_until(b'\n', &mut bytes)?; if bytes.len() > 2_097_152 || bytes.last() != Some(&b'\n') { @@ -53,7 +53,7 @@ index 19480da..dc8f136 100644 return Err(std::io::Error::other("Invalid Android credential response").into()); } let response: Value = serde_json::from_slice(&bytes)?; -@@ -56,28 +50,36 @@ fn exchange(mut stream: S, prefix: Option<&str>, value: &Value) +@@ -55,28 +49,36 @@ fn exchange(mut stream: S, prefix: Option<&str>, value: &Value) } fn loopback(value: &Value) -> Result { @@ -178,10 +178,10 @@ index 38c4b2b..254c14f 100644 } } diff --git a/crates/xodus/src/tokens/store.rs b/crates/xodus/src/tokens/store.rs -index 78b73d0..15cbff0 100644 +index cef630a..cc47974 100644 --- a/crates/xodus/src/tokens/store.rs +++ b/crates/xodus/src/tokens/store.rs -@@ -50,3 +50,49 @@ impl TokenStoreError { +@@ -70,3 +70,49 @@ impl TokenStoreError { eprintln!("{self}"); } } diff --git a/tools/xbox/droiddeck-credential-fallback.patch b/tools/xbox/droiddeck-credential-fallback.patch index 4dec0d7e69..8597fe1a5b 100644 --- a/tools/xbox/droiddeck-credential-fallback.patch +++ b/tools/xbox/droiddeck-credential-fallback.patch @@ -1,5 +1,5 @@ diff --git a/crates/xodus/src/tokens/backend/keychain.rs b/crates/xodus/src/tokens/backend/keychain.rs -index 1903638..19480da 100644 +index e6717e1..98aa6db 100644 --- a/crates/xodus/src/tokens/backend/keychain.rs +++ b/crates/xodus/src/tokens/backend/keychain.rs @@ -1,20 +1,45 @@ @@ -108,5 +108,5 @@ index 1903638..19480da 100644 +} + impl TokenBackend for KeychainBackend { - fn get(&self, key: &str) -> Result>, TokenStoreError> { - let response = request(json!({"op":"get", "key":key}))?; + #[cfg(unix)] + fn mutation_lock(&self) -> Result, TokenStoreError> { diff --git a/tools/xbox/droiddeck-credentials.patch b/tools/xbox/droiddeck-credentials.patch index 7a94928b40..6ee73eaaec 100644 --- a/tools/xbox/droiddeck-credentials.patch +++ b/tools/xbox/droiddeck-credentials.patch @@ -1,3 +1,111 @@ +diff --git a/crates/xodus-cli/src/main.rs b/crates/xodus-cli/src/main.rs +index 998709b..290d586 100644 +--- a/crates/xodus-cli/src/main.rs ++++ b/crates/xodus-cli/src/main.rs +@@ -20,24 +20,6 @@ mod webview; + + #[derive(Subcommand)] + enum SubCommand { +- #[cfg(target_os = "linux")] +- #[command(about = "Gracefully stop only a Nexus-owned session keyring without accessing credentials")] +- KeyringSessionStop { +- #[arg(long)] +- provider_pid: u32, +- }, +- #[cfg(target_os = "linux")] +- #[command(about = "Create the first default wallet using the provider's password dialog")] +- KeyringCreate { +- #[arg(long, default_value = "")] +- window_id: String, +- }, +- #[cfg(target_os = "linux")] +- #[command(about = "Unlock the default system wallet without reading credentials or signing in")] +- KeyringUnlock { +- #[arg(long, default_value = "")] +- window_id: String, +- }, + #[command(about = "Resolve public Store packages without sign-in or downloading")] + ResolvePackage { + product: String, +@@ -290,29 +272,6 @@ async fn main() -> ExitCode { + .build() + .unwrap(); + let args = CliArgs::parse(); +- #[cfg(target_os = "linux")] +- if let SubCommand::KeyringSessionStop { provider_pid } = &args.command { +- let state = xodus::keyring_session::stop_session_provider(*provider_pid); +- println!("{}", serde_json::json!({"schema": 1, "state": state.as_str()})); +- return if state == xodus::keyring_session::StopState::Unavailable { ExitCode::FAILURE } else { ExitCode::SUCCESS }; +- } +- #[cfg(target_os = "linux")] +- if let SubCommand::KeyringUnlock { window_id } | SubCommand::KeyringCreate { window_id } = &args.command { +- use std::sync::{Arc, atomic::{AtomicBool, Ordering}}; +- let cancelled = Arc::new(AtomicBool::new(false)); +- let signal = cancelled.clone(); +- let state = if ctrlc::set_handler(move || { signal.store(true, Ordering::SeqCst); }).is_err() { +- xodus::keyring_unlock::UnlockState::Unavailable +- } else { +- if matches!(&args.command, SubCommand::KeyringCreate { .. }) { +- xodus::keyring_unlock::create_default(window_id, &cancelled) +- } else { +- xodus::keyring_unlock::unlock_default(window_id, &cancelled) +- } +- }; +- println!("{}", serde_json::json!({"schema": 1, "state": state.as_str()})); +- return ExitCode::SUCCESS; +- } + #[cfg(not(feature = "native-webview"))] + if args.external_webview_stdio { + webview::enable_stdio(); +@@ -383,12 +342,6 @@ async fn main() -> ExitCode { + } + + let code = match args.command { +- #[cfg(target_os = "linux")] +- SubCommand::KeyringSessionStop { .. } => unreachable!(), +- #[cfg(target_os = "linux")] +- SubCommand::KeyringUnlock { .. } => unreachable!(), +- #[cfg(target_os = "linux")] +- SubCommand::KeyringCreate { .. } => unreachable!(), + SubCommand::ResolvePackage { .. } => unreachable!(), + SubCommand::Download { + product, +diff --git a/crates/xodus/Cargo.toml b/crates/xodus/Cargo.toml +index 773e8f7..47ef9b1 100644 +--- a/crates/xodus/Cargo.toml ++++ b/crates/xodus/Cargo.toml +@@ -43,9 +43,9 @@ libc = "=0.2.189" + smbios-lib = "0.9.4" + + [target.'cfg(target_os = "linux")'.dependencies] +-dbus = "=0.9.12" +-x11-dl = "=2.21.0" +-dbus-secret-service-keyring-store = { version = "1.0.1", features = ["crypto-openssl"]} ++dbus = { version = "=0.9.12", optional = true } ++x11-dl = { version = "=2.21.0", optional = true } ++dbus-secret-service-keyring-store = { version = "1.0.1", features = ["crypto-openssl"], optional = true} + + [target.'cfg(target_os = "macos")'.dependencies] + apple-native-keyring-store = { version = "1.0.2", features = ["keychain"]} +diff --git a/crates/xodus/src/lib.rs b/crates/xodus/src/lib.rs +index a811bae..133a2ed 100644 +--- a/crates/xodus/src/lib.rs ++++ b/crates/xodus/src/lib.rs +@@ -2,12 +2,6 @@ pub mod api; + pub mod auth; + pub mod clep; + pub mod hardware; +-#[cfg(target_os = "linux")] +-mod keyring_persistence; +-#[cfg(target_os = "linux")] +-pub mod keyring_session; +-#[cfg(target_os = "linux")] +-pub mod keyring_unlock; + pub mod licensing; + pub mod models; + pub mod secrets; +diff --git a/crates/xodus/src/secrets.rs b/crates/xodus/src/secrets.rs +index 50cd884..2b258c0 100644 --- a/crates/xodus/src/secrets.rs +++ b/crates/xodus/src/secrets.rs @@ -1,73 +1,14 @@ @@ -58,13 +166,7 @@ - // On failure, Store::new below still returns the genuine keyring error. - let _: Result<(u32,), _> = bus.method_call("org.freedesktop.DBus", "StartServiceByName", ("org.kde.secretservicecompat", 0u32)); - } -+pub struct Entry(String); -+pub fn get_entry(user: &str) -> Result { Ok(Entry(user.into())) } -+impl Entry { -+ pub fn get_secret(&self) -> Result, TokenStoreError> { KeychainBackend.get(&self.0)?.ok_or(TokenStoreError::NotFound) } -+ pub fn set_secret(&self, value: &[u8]) -> Result<(), TokenStoreError> { KeychainBackend.set(&self.0, value) } -+ pub fn delete_credential(&self) -> Result<(), TokenStoreError> { KeychainBackend.remove(&self.0) } - } +-} - -pub fn get_entry(user: &str) -> Result { - keyring_core::Entry::new(SERVICE_NAME, user) @@ -81,15 +183,28 @@ - .map(std::path::PathBuf::from) - .unwrap_or_else(std::env::temp_dir) - .join(".xodus-keyring.ron") --} ++pub struct Entry(String); ++pub fn get_entry(user: &str) -> Result { Ok(Entry(user.into())) } ++impl Entry { ++ pub fn get_secret(&self) -> Result, TokenStoreError> { KeychainBackend.get(&self.0)?.ok_or(TokenStoreError::NotFound) } ++ pub fn set_secret(&self, value: &[u8]) -> Result<(), TokenStoreError> { KeychainBackend.set(&self.0, value) } ++ pub fn delete_credential(&self) -> Result<(), TokenStoreError> { KeychainBackend.remove(&self.0) } + } +pub fn destroy_secrets() {} +diff --git a/crates/xodus/src/tokens/backend/keychain.rs b/crates/xodus/src/tokens/backend/keychain.rs +index a97bd70..e6717e1 100644 --- a/crates/xodus/src/tokens/backend/keychain.rs +++ b/crates/xodus/src/tokens/backend/keychain.rs -@@ -1,131 +1,43 @@ +@@ -1,43 +1,31 @@ -use base64::{Engine as _, engine::general_purpose::STANDARD}; - use crate::tokens::store::{TokenBackend, TokenStoreError}; -- ++use serde_json::{Value, json}; ++use std::io::{BufRead, Read, Write}; ++use std::os::linux::net::SocketAddrExt; ++use std::os::unix::net::{SocketAddr, UnixStream}; ++use std::time::Duration; + -// GNOME Keyring's passwordless textual format writes secrets with -// g_key_file_set_value but reads them with g_key_file_get_string. Backslash -// escapes in JSON (notably XML token attributes) can therefore be rejected or @@ -116,21 +231,13 @@ - None => Ok(bytes), - } -} -- ++pub struct KeychainBackend; + -fn deletion_result(result: Result<(), keyring_core::Error>) -> Result<(), TokenStoreError> { - match result { - Ok(()) | Err(keyring_core::Error::NoEntry) => Ok(()), - Err(error) => Err(error.into()), - } --} -+use serde_json::{Value, json}; -+use std::io::{BufRead, Read, Write}; -+use std::os::linux::net::SocketAddrExt; -+use std::os::unix::net::{SocketAddr, UnixStream}; -+use std::time::Duration; - - pub struct KeychainBackend; - +fn request(value: Value) -> Result { + let name = std::env::var("DROIDDECK_XBOX_CREDENTIAL_SOCKET") + .map_err(|_| std::io::Error::other("Android credential host is unavailable"))?; @@ -148,9 +255,16 @@ + let response: Value = serde_json::from_slice(&bytes)?; + if response["ok"] != true { return Err(std::io::Error::other("Android credential storage unavailable").into()); } + Ok(response) -+} -+ + } + +-pub struct KeychainBackend; +- impl TokenBackend for KeychainBackend { + #[cfg(unix)] + fn mutation_lock(&self) -> Result, TokenStoreError> { +@@ -47,92 +35,16 @@ impl TokenBackend for KeychainBackend { + Ok(Box::new(crate::tokens::transaction::lock_at(&root, std::time::Duration::from_secs(15))?)) + } fn get(&self, key: &str) -> Result>, TokenStoreError> { - let entry = crate::secrets::get_entry(key)?; - match entry.get_secret() { @@ -246,103 +360,3 @@ - )); - } -} ---- a/crates/xodus/Cargo.toml -+++ b/crates/xodus/Cargo.toml -@@ -43,9 +43,9 @@ - smbios-lib = "0.9.4" - - [target.'cfg(target_os = "linux")'.dependencies] --dbus = "=0.9.12" --x11-dl = "=2.21.0" --dbus-secret-service-keyring-store = { version = "1.0.1", features = ["crypto-openssl"]} -+dbus = { version = "=0.9.12", optional = true } -+x11-dl = { version = "=2.21.0", optional = true } -+dbus-secret-service-keyring-store = { version = "1.0.1", features = ["crypto-openssl"], optional = true} - - [target.'cfg(target_os = "macos")'.dependencies] - apple-native-keyring-store = { version = "1.0.2", features = ["keychain"]} ---- a/crates/xodus/src/lib.rs -+++ b/crates/xodus/src/lib.rs -@@ -2,12 +2,6 @@ - pub mod auth; - pub mod clep; - pub mod hardware; --#[cfg(target_os = "linux")] --mod keyring_persistence; --#[cfg(target_os = "linux")] --pub mod keyring_session; --#[cfg(target_os = "linux")] --pub mod keyring_unlock; - pub mod licensing; - pub mod models; - pub mod secrets; ---- a/crates/xodus-cli/src/main.rs -+++ b/crates/xodus-cli/src/main.rs -@@ -18,24 +18,6 @@ - - #[derive(Subcommand)] - enum SubCommand { -- #[cfg(target_os = "linux")] -- #[command(about = "Gracefully stop only a Nexus-owned session keyring without accessing credentials")] -- KeyringSessionStop { -- #[arg(long)] -- provider_pid: u32, -- }, -- #[cfg(target_os = "linux")] -- #[command(about = "Create the first default wallet using the provider's password dialog")] -- KeyringCreate { -- #[arg(long, default_value = "")] -- window_id: String, -- }, -- #[cfg(target_os = "linux")] -- #[command(about = "Unlock the default system wallet without reading credentials or signing in")] -- KeyringUnlock { -- #[arg(long, default_value = "")] -- window_id: String, -- }, - #[command(about = "Resolve public Store packages without sign-in or downloading")] - ResolvePackage { - product: String, -@@ -238,29 +220,6 @@ - .build() - .unwrap(); - let args = CliArgs::parse(); -- #[cfg(target_os = "linux")] -- if let SubCommand::KeyringSessionStop { provider_pid } = &args.command { -- let state = xodus::keyring_session::stop_session_provider(*provider_pid); -- println!("{}", serde_json::json!({"schema": 1, "state": state.as_str()})); -- return if state == xodus::keyring_session::StopState::Unavailable { ExitCode::FAILURE } else { ExitCode::SUCCESS }; -- } -- #[cfg(target_os = "linux")] -- if let SubCommand::KeyringUnlock { window_id } | SubCommand::KeyringCreate { window_id } = &args.command { -- use std::sync::{Arc, atomic::{AtomicBool, Ordering}}; -- let cancelled = Arc::new(AtomicBool::new(false)); -- let signal = cancelled.clone(); -- let state = if ctrlc::set_handler(move || { signal.store(true, Ordering::SeqCst); }).is_err() { -- xodus::keyring_unlock::UnlockState::Unavailable -- } else { -- if matches!(&args.command, SubCommand::KeyringCreate { .. }) { -- xodus::keyring_unlock::create_default(window_id, &cancelled) -- } else { -- xodus::keyring_unlock::unlock_default(window_id, &cancelled) -- } -- }; -- println!("{}", serde_json::json!({"schema": 1, "state": state.as_str()})); -- return ExitCode::SUCCESS; -- } - #[cfg(not(feature = "native-webview"))] - if args.external_webview_stdio { - webview::enable_stdio(); -@@ -308,12 +267,6 @@ - } - - let code = match args.command { -- #[cfg(target_os = "linux")] -- SubCommand::KeyringSessionStop { .. } => unreachable!(), -- #[cfg(target_os = "linux")] -- SubCommand::KeyringUnlock { .. } => unreachable!(), -- #[cfg(target_os = "linux")] -- SubCommand::KeyringCreate { .. } => unreachable!(), - SubCommand::ResolvePackage { .. } => unreachable!(), - SubCommand::Download { - product, diff --git a/tools/xbox/droiddeck-dlc-mount.patch b/tools/xbox/droiddeck-dlc-mount.patch new file mode 100644 index 0000000000..48ce8ea4f4 --- /dev/null +++ b/tools/xbox/droiddeck-dlc-mount.patch @@ -0,0 +1,30 @@ +diff --git a/crates/xodus-cli/src/commands/run.rs b/crates/xodus-cli/src/commands/run.rs +index 72a2c97..c3d5774 100644 +--- a/crates/xodus-cli/src/commands/run.rs ++++ b/crates/xodus-cli/src/commands/run.rs +@@ -1043,14 +1043,25 @@ pub async fn run( + if wine == "droiddeck:prepare" { + use std::io::Write; + if !materialize_chain { return ExitCode::FAILURE; } ++ // The app starts Wine itself, so the DLC mount workspace the runtime requires (XODUS_MOUNT_ROOT) is ++ // made here in TMPDIR, the launch directory, and lives as long as this prepare session. ++ let mount_workspace = Builder::new().prefix(MOUNT_WORKSPACE_PREFIX.trim_start_matches('.')) ++ .permissions(std::fs::Permissions::from_mode(0o700)).tempdir() ++ .and_then(|directory| DlcMountWorkspace::from_view(LaunchView::new(directory))) ++ .inspect_err(|error| eprintln!("could not prepare downloadable content workspace: {error}")) ++ .ok(); ++ let mount_root = mount_workspace.as_ref().and_then(|workspace| workspace.view.as_ref()) ++ .map(|view| view.path().to_string_lossy().into_owned()); + let ready = serde_json::json!({ + "exe": stub_path, + "playfab": playfab_auth_header(client, tokens).await, ++ "mountRoot": mount_root, + }); + println!("DROIDDECK_LAUNCH_V1 {}", ready); + let _ = std::io::stdout().flush(); + let mut release = String::new(); + let _ = std::io::stdin().read_line(&mut release); ++ drop(mount_workspace); + drop(launch_mirror); + cleanup().await; + return ExitCode::SUCCESS; diff --git a/tools/xbox/droiddeck-launch-view.patch b/tools/xbox/droiddeck-launch-view.patch index d3ca2d3df8..891dba3f07 100644 --- a/tools/xbox/droiddeck-launch-view.patch +++ b/tools/xbox/droiddeck-launch-view.patch @@ -1,6 +1,8 @@ +diff --git a/crates/xodus-cli/src/commands/run.rs b/crates/xodus-cli/src/commands/run.rs +index 70667df..72a2c97 100644 --- a/crates/xodus-cli/src/commands/run.rs +++ b/crates/xodus-cli/src/commands/run.rs -@@ -146,6 +146,7 @@ +@@ -410,6 +410,7 @@ fn launch_file_maps( launch_image: &Path, materialize_chain: bool, ) -> (String, String) { @@ -8,7 +10,7 @@ let source_nt = source.to_string_lossy().replace('/', "\\"); let source_nt = source_nt.trim_end_matches('\\'); let mirror_unix = mirror_nt_prefix.map(|prefix| prefix.replace('\\', "/")); -@@ -303,9 +304,7 @@ +@@ -590,9 +591,7 @@ fn create_launch_chain_mirror( let entry_path = checked_relative_path(entry_suffix)?; let mut decrypted = HashMap::new(); for (name, fd) in fds { @@ -19,17 +21,17 @@ } if !decrypted.contains_key(&entry_path) { return Err(std::io::Error::new( -@@ -325,7 +324,8 @@ +@@ -612,7 +611,8 @@ fn create_launch_chain_mirror( } } let decrypted_files: HashSet = decrypted.keys().cloned().collect(); - let mirror = launch_view_directory(source_root, ".xodus-chain-")?; -+ let mirror = Builder::new().prefix("droiddeck-xbox-") -+ .permissions(std::os::unix::fs::PermissionsExt::from_mode(0o700)).tempdir()?; ++ let mirror = LaunchView::new(Builder::new().prefix("droiddeck-xbox-") ++ .permissions(std::os::unix::fs::PermissionsExt::from_mode(0o700)).tempdir()?); populate_launch_view( source_root, mirror.path(), -@@ -725,6 +725,22 @@ +@@ -1040,6 +1040,22 @@ pub async fn run( ); } @@ -49,10 +51,10 @@ + return ExitCode::SUCCESS; + } + - let mut command = Command::new(wine); - command - .arg(&stub_path) -@@ -831,21 +847,15 @@ + let mount_workspace = DlcMountWorkspace::new(&out_absolute) + .inspect_err(|error| eprintln!("could not prepare downloadable content workspace: {error}")) + .ok(); +@@ -1332,21 +1348,15 @@ mod tests { } #[test] @@ -77,10 +79,11 @@ } #[test] -@@ -945,6 +955,44 @@ +@@ -1700,6 +1710,44 @@ mod tests { + assert_eq!(std::fs::read(nested.join("Shipping.exe")).unwrap(), b"encrypted child"); } - #[test] ++ #[test] + fn launch_view_materializes_encrypted_dlls_in_private_storage() { + let root = tempfile::tempdir().unwrap(); + std::fs::write(root.path().join("Game.exe"), b"encrypted").unwrap(); @@ -112,17 +115,16 @@ + let exe = String::from("Game.exe"); + let dll = String::from("Bad.dll"); + let images = [(&exe, exe_image.as_raw_fd()), (&dll, dll_image.as_raw_fd())]; -+ let error = create_launch_chain_mirror(root.path(), &exe, &images).unwrap_err(); ++ let error = create_launch_chain_mirror(root.path(), &exe, &images).err().expect("a non-PE library image is rejected"); + assert_eq!(error.kind(), std::io::ErrorKind::InvalidData); + assert_eq!(std::fs::read(root.path().join("Game.exe")).unwrap(), b"encrypted executable"); + assert_eq!(std::fs::read(root.path().join("Bad.dll")).unwrap(), b"encrypted library"); + } + -+ #[test] + #[test] fn launch_chain_rejects_parent_path_components() { assert!(checked_relative_path("..\\outside.exe").is_err()); - } -@@ -961,16 +1009,20 @@ +@@ -1717,16 +1765,20 @@ mod tests { assert_eq!(name, "Bin\\MINECRAFT.WINDOWS.EXE"); assert!(!fcntl_getfd(file.as_fd()).unwrap().contains(FdFlags::CLOEXEC)); let dll_name = String::from("Encrypted.dll"); diff --git a/tools/xbox/droiddeck-library-subscriptions.patch b/tools/xbox/droiddeck-library-subscriptions.patch index 833fab085d..fca8696fb6 100644 --- a/tools/xbox/droiddeck-library-subscriptions.patch +++ b/tools/xbox/droiddeck-library-subscriptions.patch @@ -1,9 +1,11 @@ +diff --git a/crates/xodus-cli/src/commands/library.rs b/crates/xodus-cli/src/commands/library.rs +index 0c88129..36191bf 100644 --- a/crates/xodus-cli/src/commands/library.rs +++ b/crates/xodus-cli/src/commands/library.rs -@@ -96,6 +96,48 @@ +@@ -99,6 +99,48 @@ fn diagnostic(stage: &'static str, status: u16, count: usize) { eprintln!("NEXUS_LIBRARY_DIAGNOSTIC_V1 {stage} {status} {count}"); } - + +const SUBSCRIPTION_PLANS: &[&str] = &[ + "CFQ7TTC0KGQ8", "CFQ7TTC0KHS0", "CFQ7TTC0P85B", + "CFQ7TTC0K5DJ", "CFQ7TTC0K6L8", "CFQ7TTC10QFD", @@ -49,15 +51,13 @@ async fn query(tokens: &TokenManager, market: &str) -> Result { if market.len() != 2 || !market.bytes().all(|b| b.is_ascii_uppercase()) { return Err("market"); -@@ -155,6 +197,7 @@ +@@ -158,12 +200,13 @@ async fn query(tokens: &TokenManager, market: &str) -> Result 0 { "partial" } else { "complete" }, 0, all.skipped); return Ok(json!({"schema":1,"account":account,"market":market, @@ -66,7 +66,7 @@ "entitlements":all.entries.into_values().collect::>()})); } } -@@ -200,6 +243,26 @@ +@@ -201,6 +244,26 @@ pub async fn run(tokens: &TokenManager, json_output: bool, market: String) -> Ex #[cfg(test)] mod tests { use super::*; diff --git a/tools/xbox/droiddeck-licensing-device-ticket.patch b/tools/xbox/droiddeck-licensing-device-ticket.patch index ffd5edbfa9..84ee1e9e5d 100644 --- a/tools/xbox/droiddeck-licensing-device-ticket.patch +++ b/tools/xbox/droiddeck-licensing-device-ticket.patch @@ -1,136 +1,67 @@ diff --git a/crates/xodus-cli/src/license.rs b/crates/xodus-cli/src/license.rs -index 4518c22..5a12753 100644 +index d1a5600..661fd38 100644 --- a/crates/xodus-cli/src/license.rs +++ b/crates/xodus-cli/src/license.rs -@@ -58,6 +58,7 @@ pub async fn get_license( - let Token::Compact(ms_device_token) = ms_device_token else { - return Err("Unsupported token".to_string()); - }; -+ let ms_device_token = xodus::models::secrets::licensing_device_ticket(ms_device_token); +@@ -358,11 +358,7 @@ async fn fetch_online( + ) + })?; + +- let ms_device_token = +- Token::try_from(ms_device_token).map_err(|error| other(error.to_string()))?; +- let Token::Compact(ms_device_token) = ms_device_token else { +- return Err(other("Unsupported token".to_string())); +- }; ++ let ms_device_token = content_device_ticket(ms_device_token).map_err(other)?; let user_token: Token = match user_token { ExchangeUserTokenOutcome::Fault(_) => { -diff --git a/crates/xodus-service/src/store_license.rs b/crates/xodus-service/src/store_license.rs -index e6b4c58..abede2e 100644 ---- a/crates/xodus-service/src/store_license.rs -+++ b/crates/xodus-service/src/store_license.rs -@@ -63,8 +63,7 @@ async fn issue(context: &SimpleContext, request: StoreLicenseTokenRequest) -> Re - let device_response = xodus::api::live::exchange_device_token(&context.client, device.clone(), - client_id.into(), "www.microsoft.com".into(), Some(soap::PolicyReference::mbi_ssl())) - .await.map_err(|_| FAIL)?; -- if device_response.token_type != "urn:passport:compact" { return Err(FAIL) } -- let Token::Compact(device_token) = Token::try_from(device_response).map_err(|_| FAIL)? else { return Err(FAIL) }; -+ let device_token = device_license_ticket(device_response)?; - let user_response = xodus::api::live::exchange_user_token(&context.client, user_sts, - account.username, device, None, Some("Silent".into()), client_id.into(), - &[("www.microsoft.com".into(), Some(soap::PolicyReference::mbi_ssl()))]) -@@ -98,6 +97,13 @@ async fn issue(context: &SimpleContext, request: StoreLicenseTokenRequest) -> Re - Ok(response.license_token) +@@ -415,6 +411,18 @@ async fn fetch_online( + Ok(OnlineLicense { key, leases, lease_documents }) } -+fn device_license_ticket(response: soap::RequestSecurityTokenResponse) -> Result { -+ if !user_ticket_type(&response.token_type) { return Err(FAIL) } -+ let Token::Compact(ticket) = Token::try_from(response).map_err(|_| FAIL)? else { return Err(FAIL) }; -+ if ticket.is_empty() || ticket == "d=" { return Err(FAIL) } -+ Ok(xodus::models::secrets::licensing_device_ticket(ticket)) ++// Content licensing rejects a delegation-compact device ticket in the d= form ++// (HTTP 401); it takes the same licensing form as the user ticket, as ++// xodus-service store_license does for Store license tokens. Plain compact ++// device tickets are sent unchanged. ++fn content_device_ticket(response: soap::RequestSecurityTokenResponse) -> Result { ++ let delegation = response.token_type == "urn:passport:delegationcompact"; ++ let Token::Compact(ticket) = Token::try_from(response).map_err(|error| error.to_string())? else { ++ return Err("Unsupported token".to_string()); ++ }; ++ Ok(if delegation { xodus::models::secrets::licensing_ticket(ticket) } else { ticket }) +} + - fn user_ticket_type(token_type: &str) -> bool { - matches!(token_type, "urn:passport:compact" | "urn:passport:delegationcompact") - } -@@ -134,6 +140,45 @@ mod tests { - } - } - -+ fn device_response(kind: &str, value: Option<&str>) -> soap::RequestSecurityTokenResponse { -+ soap::RequestSecurityTokenResponse { -+ token_type: kind.into(), -+ applies_to: soap::AppliesTo { endpoint_reference: soap::EndpointReference { address: "synthetic.invalid".into() } }, -+ lifetime: soap::Timestamp { id: None, created: "2000-01-01T00:00:00Z".into(), expires: "2099-01-01T00:00:00Z".into() }, -+ requested_security_token: soap::RequestedSecurityToken { encrypted_data: None, -+ binary_security_token: value.map(|value| soap::BinarySecurityTokenRes { -+ id: "synthetic".into(), value: value.into(), value_type: None }) }, -+ requested_proof_token: None, -+ } + fn license_material(tokens: &TokenManager, block: &str) -> Result<(DeviceKey, SPLicense), String> { + let game_splicense = SPLicense::parse_base64(block).map_err(|_| { + eprintln!("NEXUS_CONTENT_LICENSE_DIAGNOSTIC_V1 content-license-blob 0"); +@@ -438,6 +446,30 @@ fn license_material(tokens: &TokenManager, block: &str) -> Result<(DeviceKey, SP + #[cfg(test)] + mod tests { + use super::*; ++ ++ fn device_response(kind: &str, value: &str) -> soap::RequestSecurityTokenResponse { ++ serde_json::from_value(serde_json::json!({ ++ "TokenType": kind, ++ "AppliesTo": {"EndpointReference": {"Address": "www.microsoft.com"}}, ++ "Lifetime": {"Created": "2026-10-22T00:00:00Z", "Expires": "2026-10-23T00:00:00Z"}, ++ "RequestedSecurityToken": {"BinarySecurityToken": {"@Id": "fixture", "$value": value}} ++ })).unwrap() + } + + #[test] -+ fn store_license_device_compact_tickets_are_sent_unchanged() { -+ let raw = "eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2In0..aXY.Y2lwaGVy_dGV4dA.dGFn"; -+ for value in ["t=opaque-device&p=", "opaque-device", raw] { -+ assert_eq!(device_license_ticket(device_response("urn:passport:compact", Some(value))), Ok(value.to_string())); -+ } ++ fn content_device_ticket_delegation_forms_use_the_licensing_wire_form() { ++ let raw = "eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0..c3ludGhldGljLWl2.c3ludGhldGljLWNpcGhlcnRleHQ.c3ludGhldGljLXRhZw"; ++ assert_eq!(content_device_ticket(device_response("urn:passport:delegationcompact", raw)).unwrap(), raw); ++ assert_eq!(content_device_ticket(device_response("urn:passport:delegationcompact", "opaque-device")).unwrap(), ++ "t=opaque-device"); + } + + #[test] -+ fn store_license_device_delegation_tickets_use_the_licensing_wire_form() { -+ let raw = "eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2In0..aXY.Y2lwaGVy_dGV4dA.dGFn"; -+ assert_eq!(device_license_ticket(device_response("urn:passport:delegationcompact", Some(raw))), Ok(raw.to_string())); -+ assert_eq!(device_license_ticket(device_response("urn:passport:delegationcompact", Some("opaque-device"))), -+ Ok("t=opaque-device".to_string())); -+ } -+ -+ #[test] -+ fn store_license_device_unknown_missing_and_empty_tickets_fail_closed() { -+ for kind in ["urn:passport:legacy", "urn:passport:unknown"] { -+ assert_eq!(device_license_ticket(device_response(kind, Some("opaque-device"))), Err(FAIL)); -+ } -+ for kind in ["urn:passport:compact", "urn:passport:delegationcompact"] { -+ assert_eq!(device_license_ticket(device_response(kind, None)), Err(FAIL)); -+ assert_eq!(device_license_ticket(device_response(kind, Some(""))), Err(FAIL)); ++ fn content_device_ticket_plain_compact_forms_stay_byte_exact() { ++ for value in ["t=opaque-device&p=", "opaque-device"] { ++ assert_eq!(content_device_ticket(device_response("urn:passport:compact", value)).unwrap(), value); + } + } -+ - fn request(ids: &[&str]) -> StoreLicenseTokenRequest { - StoreLicenseTokenRequest { parent_product_id: "9N4PT8HGCDHQ".into(), - product_ids: ids.iter().map(|s| s.to_string()).collect(), custom_developer_string: "nonce<&>".into() } -diff --git a/crates/xodus/src/models/licensing_ticket_tests.rs b/crates/xodus/src/models/licensing_ticket_tests.rs -index 10ff57e..6db9ff1 100644 ---- a/crates/xodus/src/models/licensing_ticket_tests.rs -+++ b/crates/xodus/src/models/licensing_ticket_tests.rs -@@ -1,5 +1,5 @@ - //! Public synthetic data only, no account, keyring or network access. --use super::{Token, licensing_ticket, store_ticket, xbox_ticket}; -+use super::{Token, licensing_device_ticket, licensing_ticket, store_ticket, xbox_ticket}; - use crate::models::soap; - use base64::{Engine, engine::general_purpose::URL_SAFE_NO_PAD}; - use serde_json::json; -@@ -109,3 +109,23 @@ fn credential_xbox_ticket_opaque_and_malformed_tokens_are_preserved() { - } - for ticket in cases { assert_eq!(xbox_ticket(ticket.clone()), ticket); } - } -+ -+#[test] -+fn credential_licensing_device_ticket_delegation_forms_use_the_licensing_wire_form() { -+ for raw in [ -+ jwe(json!({"alg":"dir","enc":"A128CBC-HS256"}), ""), -+ jwe(json!({"alg":"RSA-OAEP-256","enc":"A256GCM"}), "a2V5"), -+ ] { -+ let Token::Compact(original) = delegation(&raw) else { panic!("fixture"); }; -+ assert_eq!(licensing_device_ticket(original), raw); -+ } -+ assert_eq!(licensing_device_ticket("d=opaque-device".into()), "t=opaque-device"); -+} -+ -+#[test] -+fn credential_licensing_device_ticket_plain_compact_forms_stay_byte_exact() { -+ let raw = jwe(json!({"alg":"dir","enc":"A256GCM"}), ""); -+ for ticket in ["t=opaque-device&p=".to_string(), "opaque-device".into(), "".into(), raw.clone(), format!("t={raw}")] { -+ assert_eq!(licensing_device_ticket(ticket.clone()), ticket); -+ } -+} -diff --git a/crates/xodus/src/models/secrets.rs b/crates/xodus/src/models/secrets.rs -index 1ad97be..9de6eea 100644 ---- a/crates/xodus/src/models/secrets.rs -+++ b/crates/xodus/src/models/secrets.rs -@@ -102,6 +102,10 @@ pub fn licensing_ticket(ticket: String) -> String { - if is_compact_jwe(bare) { bare.to_string() } else { store_ticket(ticket) } - } - -+pub fn licensing_device_ticket(ticket: String) -> String { -+ if ticket.starts_with("d=") { licensing_ticket(ticket) } else { ticket } -+} -+ - // This recognizes wire encoding, not authenticity or entitlement. Microsoft - // still validates the entire ticket. Never decrypt, log or rewrite its payload. - fn is_compact_jwe(value: &str) -> bool { + use base64::{Engine, prelude::BASE64_STANDARD}; + use xodus::models::secrets::Device; + #[test] diff --git a/tools/xbox/droiddeck-xbox-ticket.patch b/tools/xbox/droiddeck-xbox-ticket.patch deleted file mode 100644 index bb8f5d08f4..0000000000 --- a/tools/xbox/droiddeck-xbox-ticket.patch +++ /dev/null @@ -1,75 +0,0 @@ ---- a/crates/xodus/src/models/secrets.rs -+++ b/crates/xodus/src/models/secrets.rs -@@ -80,9 +80,13 @@ - } - } - --/// Store and licensing services reject delegation-compact tickets in the "d=" --/// form that Xbox Live sign-in needs (InvalidMsaTicketFormat) and accept the --/// same value as "t=". Convert only where a ticket is sent to those services. -+pub fn xbox_ticket(ticket: String) -> String { -+ match ticket.strip_prefix("d=") { -+ Some(raw) if is_compact_jwe(raw) => raw.to_owned(), -+ _ => ticket, -+ } -+} -+ - pub fn store_ticket(ticket: String) -> String { - match ticket.strip_prefix("d=") { - Some(value) => format!("t={value}"), ---- a/crates/xodus/src/models/licensing_ticket_tests.rs -+++ b/crates/xodus/src/models/licensing_ticket_tests.rs -@@ -1,5 +1,5 @@ - //! Public synthetic data only, no account, keyring or network access. --use super::{Token, licensing_ticket, store_ticket}; -+use super::{Token, licensing_ticket, store_ticket, xbox_ticket}; - use crate::models::soap; - use base64::{Engine, engine::general_purpose::URL_SAFE_NO_PAD}; - use serde_json::json; -@@ -77,3 +77,35 @@ - let long_header = jwe(json!({"alg":"dir","enc":"A256GCM","kid":"a".repeat(9000)}), ""); - assert_eq!(licensing_ticket(format!("d={long_header}")), format!("t={long_header}")); - } -+ -+#[test] -+fn credential_xbox_ticket_compact_jwe_uses_bare_wire_format_without_changing_store_conversion() { -+ for raw in [ -+ jwe(json!({"alg":"dir","enc":"A128CBC-HS256"}), ""), -+ jwe(json!({"alg":"RSA-OAEP-256","enc":"A256GCM"}), "a2V5"), -+ ] { -+ let Token::Compact(original) = delegation(&raw) else { panic!("fixture"); }; -+ assert_eq!(original, format!("d={raw}")); -+ assert_eq!(store_ticket(original.clone()), format!("t={raw}")); -+ assert_eq!(xbox_ticket(original), raw); -+ assert_eq!(xbox_ticket(raw.clone()), raw); -+ assert_eq!(xbox_ticket(format!("t={raw}")), format!("t={raw}")); -+ } -+} -+ -+#[test] -+fn credential_xbox_ticket_opaque_and_malformed_tokens_are_preserved() { -+ let valid = jwe(json!({"alg":"dir","enc":"A256GCM"}), ""); -+ let mut cases = vec!["d=opaque".to_string(), "opaque".into(), "".into(), "d=".into(), -+ "d=opaque..iv.ciphertext.tag".into(), "d=eyJ..a.b.c".into(), -+ format!("d={valid}.extra"), format!("d={}", valid.replace("..", ".+.")), -+ format!("d={}", jwe(json!({"alg":"dir"}), "")), -+ format!("d={}", jwe(json!({"alg":"dir","enc":""}), "")), -+ format!("d={}", jwe(json!({"alg":"dir","enc":"A256GCM","kid":"a".repeat(9000)}), ""))]; -+ let mut parts: Vec<_> = valid.split('.').map(str::to_string).collect(); -+ for index in [2, 3, 4] { -+ let old = parts[index].clone(); parts[index].clear(); -+ cases.push(format!("d={}", parts.join("."))); parts[index] = old; -+ } -+ for ticket in cases { assert_eq!(xbox_ticket(ticket.clone()), ticket); } -+} ---- a/crates/xodus/src/api/xbox/auth.rs -+++ b/crates/xodus/src/api/xbox/auth.rs -@@ -12,7 +12,7 @@ - properties: UserAuthProperties { - auth_method: "RPS".to_string(), - site_name: "user.auth.xboxlive.com".to_string(), -- rps_ticket, -+ rps_ticket: crate::models::secrets::xbox_ticket(rps_ticket), - }, - }; - diff --git a/tools/xbox/prepare.py b/tools/xbox/prepare.py index 222b887606..3066d9edda 100755 --- a/tools/xbox/prepare.py +++ b/tools/xbox/prepare.py @@ -9,28 +9,20 @@ recipe = Path(__file__).resolve().parent cache = Path(sys.argv[1]).resolve() lock = json.loads((recipe / 'backend.lock.json').read_text()) local_patches = ['droiddeck-credentials.patch', 'droiddeck-launch-view.patch', 'droiddeck-library-subscriptions.patch', - 'droiddeck-credential-fallback.patch', 'droiddeck-credential-diagnostics.patch', 'droiddeck-cloud-token.patch', 'droiddeck-xbox-ticket.patch', - 'droiddeck-licensing-device-ticket.patch'] + 'droiddeck-credential-fallback.patch', 'droiddeck-credential-diagnostics.patch', 'droiddeck-cloud-token.patch', + 'droiddeck-licensing-device-ticket.patch', 'droiddeck-dlc-mount.patch'] identity = hashlib.sha256((recipe / 'backend.lock.json').read_bytes() + b''.join((recipe / name).read_bytes() for name in local_patches)).hexdigest() source = cache / ('source-' + identity[:16]) if not (source / '.prepared').is_file(): if source.exists(): raise RuntimeError('Incomplete Xbox source directory; inspect it before retrying: ' + str(source)) source.mkdir(parents=True) - nexus = cache / ('nexus-' + lock['nexusCommit']) - for directory, remote, commit in ((source, lock['repository'], lock['commit']), - (nexus, 'https://github.com/domsvoboda/xodus-nexus.git', lock['nexusCommit'])): - directory.mkdir(parents=True, exist_ok=True) - if not (directory / '.git').is_dir(): - subprocess.run(['git', 'init', '-q', str(directory)], check=True) - subprocess.run(['git', '-C', str(directory), 'fetch', '-q', '--depth', '1', remote, commit], check=True) - subprocess.run(['git', '-C', str(directory), 'checkout', '-q', '--detach', 'FETCH_HEAD'], check=True) - assert subprocess.check_output(['git', '-C', str(directory), 'rev-parse', 'HEAD'], text=True).strip() == commit + # Nexus keeps its Xodus changes as commits in its backend fork (since 0.2.15), not as patch files. + subprocess.run(['git', 'init', '-q', str(source)], check=True) + subprocess.run(['git', '-C', str(source), 'fetch', '-q', '--depth', '1', lock['repository'], lock['commit']], check=True) + subprocess.run(['git', '-C', str(source), 'checkout', '-q', '--detach', 'FETCH_HEAD'], check=True) + assert subprocess.check_output(['git', '-C', str(source), 'rev-parse', 'HEAD'], text=True).strip() == lock['commit'] assert hashlib.sha256((source / 'Cargo.lock').read_bytes()).hexdigest() == lock['cargoLockSha256'] - for patch in lock['patches']: - file = nexus / 'assets' / patch['file'] - assert hashlib.sha256(file.read_bytes()).hexdigest() == patch['sha256'] - subprocess.run(['git', '-C', str(source), 'apply', str(file)], check=True) for name in local_patches: subprocess.run(['git', '-C', str(source), 'apply', str(recipe / name)], check=True) (source / '.prepared').write_text(identity + '\n') diff --git a/tools/xbox/runtime.lock.json b/tools/xbox/runtime.lock.json index e99520de78..5b8fc329ba 100644 --- a/tools/xbox/runtime.lock.json +++ b/tools/xbox/runtime.lock.json @@ -1,26 +1,27 @@ { - "repository": "domsvoboda/xodus-nexus", - "tag": "runtime-11.0-20261018-gf291f544", - "archive": "xodus-nexus-runtime-11.0-20261018-gf291f544-x86_64.tar.xz", - "sha512": "8e16634dc4d75ead4b7f48712624e107cfdc29a31a2da1b32624af25a6e3e8938636a6701e076a9dee08eb0c5b36b549342598313971f5fceb5de1e483c43578", + "repository": "domsvoboda/nexus-runtime", + "tag": "runtime-11.0-20261102-g76c6dd13", + "archive": "nexus-runtime-11.0-experimental-g76c6dd13-x86_64.tar.xz", + "sha512": "ed6bf55af56128d831ec78ce223770978250d8a4692ea1f24f26258e9d5460c8106e9e6000f554665c91cfcf2abdd235e018d845d8f0cbbed0daaa3d50e61b62", "source": { - "name": "xodus-nexus-runtime-11.0-20261018-gf291f544-source.tar.xz", - "sha256": "58b5d35d23b61f73f771b733fde43ea75096fe8b60f2ddc660949af3d8d87baf" + "name": "nexus-runtime-11.0-experimental-g76c6dd13-source.tar.xz", + "sha256": "9fd3ce24d0c9032fc2237df828c69f07e3de67f6c7008c89881ae7b805f953f5" }, + "xgameruntime": "455b1ba9c59984f9478af062fa1aec496bc58ccc", "dlls": { - "twinapi.appcore.dll": "c203bbd707d521c68719b42a0a81db2b4838cc41be83fc76bfd87bf33e507336", - "windows.web.dll": "1a510c73ca31475b163692337d3cf37fef3381078df9729662095fc92b2e4e83", - "libnghttp2.dll": "2b171eba9296b207fe6016560e5381bc6e7405f3ad5ee5cd4add316358204ec0", - "xgameruntime.dll": "060120e0ec6bccfbab516128315a0658b11d3e316f62a917c653daf1a1dd3e05", - "winhttp.dll": "81e1da7a731d83fbd24dbe2fa2ecb8f155bd477a9f9b6f4cc3932063cc326c27", - "wintypes.dll": "7d06083e3d8b3a7e11555a91e7918f11c7d444a74755d41c8d1990db3697c895" + "twinapi.appcore.dll": "a9e640dee244a900a2d629ea62f2794e8ff973f916871b32b8f3b0f385e70006", + "windows.web.dll": "c0b3c78c0d61f0df5387f8bbf6b6b1090d27db07ebdf6f941dce51b02dd28faa", + "libnghttp2.dll": "a9c265b965d9af735886eb51e01afde905bc7ea53ed3dcc9ae18e2aebd45d8d0", + "xgameruntime.dll": "90b4fd26bd52924a38b720840a3ad1cd9281a9aa64a91c0b52b650d096f1a883", + "winhttp.dll": "e8e4e8a91834b481e305a0b6ae83894378ed6a1e83d5a1200605ca7526a46d45", + "wintypes.dll": "0583b241fcbf2817a5088373875212f8f2c06bc84d854bc7fc4eb3b5cf75e126" }, "compat": { "files/share/xodus-nexus/compat/PlayFabGameSave.dll": [ "compat/PlayFabGameSave.dll", - "29b1ab5e54b35e40ee5b376237f4ab642e1d0f3d7614e3e46208e9ad8a6e0a79" + "83b4e9985244558b8449a92aafad64681182073d92d60e7bf3536bbac74d7e03" ], - "files/share/doc/xodus-nexus-runtime/runtime-compat-LICENSE": [ + "files/share/doc/nexus-runtime/runtime-compat-LICENSE": [ "LICENSE.runtime-compat", "639b735fd2f65779b82c4aab471f1fcdf927e10e1c21250911f75d44d136ff11" ]