Files
DroidDeck/tools/xbox/droiddeck-licensing-device-ticket.patch
T
The412Banner 81e238b92e 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).
2026-11-15 20:55:42 -05:00

68 lines
3.2 KiB
Diff

diff --git a/crates/xodus-cli/src/license.rs b/crates/xodus-cli/src/license.rs
index d1a5600..661fd38 100644
--- a/crates/xodus-cli/src/license.rs
+++ b/crates/xodus-cli/src/license.rs
@@ -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(_) => {
@@ -415,6 +411,18 @@ async fn fetch_online(
Ok(OnlineLicense { key, leases, lease_documents })
}
+// 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<String, String> {
+ 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 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 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 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);
+ }
+ }
use base64::{Engine, prelude::BASE64_STANDARD};
use xodus::models::secrets::Device;
#[test]