mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-19 21:06:09 +00:00
c4f4e18f871edea69bf8f5fa45878f45ce53a0e7
10
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
6ed281f78d |
feat(xbox): install MSIXVC2 back-compat titles from their content boxes (#2851)
* feat(xbox): install MSIXVC2 packages from their encrypted content boxes * feat(xbox): run a package's custom install actions once per prefix * fix(xbox): launch the program a launcher menu names instead of the menu * fix(xbox): check free space before an MSIXVC2 install starts * fix(xbox): keep a forwarded launch path relative when the install folder is reached through a link * fix(xbox): rebuild the MSIXVC2 patch on the final legacy install * fix(xbox): keep a backup whose release fails, and test an interrupted restore * fix(xbox): verify resumed msixvc2 files, contain writes, decode install action arguments * fix(xbox): keep one completion record per msixvc2 file, never follow a linked install state * fix(xbox): drop a torn msixvc2 completion record before appending to it * fix(xbox): repair a torn msixvc2 record from its tail instead of rereading it |
||
|
|
a5d8abeab4 |
feat(xbox): install legacy EAppx titles through Windows Update (on main) (#2825)
* feat(xbox): install legacy EAppx titles through Windows Update A legacy Store title does not ship as MSIXVC. It ships as an encrypted EAppx bundle, which streaming rejects, so the store could list the game and never install it. Accept EAPPX and EAPPXBUNDLE beside MSIXVC, carry the format through the catalogue, the install record and the cached library, and dispatch legacy-install for those formats. Two backend patches do the work: - droiddeck-legacy-packages.patch lets the plan, license and extract verbs handle a legacy package, and expands a bundle in place (nesting bounded at three), decrypting each inner EAppx with the same keys. - droiddeck-legacy-install.patch adds legacy-install: resolve, license, download, extract, hoist AppxManifest.xml to the game root. Resolution asks the Xbox content service first and Windows Update second, because some legacy products return no files from the content service at all. The WU endpoint needs no Xbox credential but chains to Microsoft's ECC Product Root CA 2018, which Android's CA bundle does not carry, so that one public root is pinned for those requests. The manifest reader accepts AppxManifest.xml as well as MicrosoftGame.config, since a legacy package carries only the former. Running it against a real title exposed four things that only show up at full size: - A licence names a key by its 16-byte content id, while a bundle header names it as a (content id, package id) pair. Reading the 16-byte id yields a different pair, so a complete key file reported every key missing and no bundle could be opened. Keys are now aligned against the header's own ids before the header is judged. - Windows Update answers with several updates whose PackageContentId differs from the bundle's own. Licensing used to take the first and fail with content-http 400; every candidate is now tried in order, preferring the one the container is named after. - A container already in .xodus-container is reused rather than fetched again, so a failed run does not cost another download of tens of gigabytes. The space preflight no longer counts a container twice for the same reason. - A bundle that carries add-on packages unpacks each into its own folder, leaving the manifest one level down. Hoisting lifts the largest folder that holds a manifest, so the game still lands at the root beside its add-ons. Unpacking now reports bytes written, so the install bubble fills while a package is decrypted instead of holding a single unchanging word. * fix(xbox): unpack a legacy package across cores and report the bytes Unpacking one title ran as a single thread on a saturated core at about 40 MB/s. Files sit at independent offsets, so each worker now opens its own handle and takes every Nth file, with a 1 MiB read buffer in place of the 8 KiB default that turned one 64 KiB block into eight reads. Measured on the Forza Horizon 4 bundle, writes went from 40 MB/s to about 200 MB/s. Two things the first full-size run exposed: - The container was deleted only after the whole nested tree was unpacked, so a title that holds its package as one member held the archive and the decrypted copy at once. On this device that runs out of space partway through the second stage. The container is now deleted once its members are on disk, which frees the archive before they are decrypted. - A bundle member is written as a single file, so a counter that advances when a file finishes stays at zero for the whole of the longest stage. The reported figure now also follows the growth of the destination while that is the case, and never moves backwards when the container is freed. Progress is exact during the per-file stage: each file's declared length is added as it lands, instead of walking the whole destination every tick. * docs(xbox): record the completed legacy install The evidence section said a finished legacy install and its decrypted contents were unverified, because the first run was still unpacking when it was written. That install has now completed on the same device: the 85,219,173,025-byte container produced 79.3 GB at the game root with AppxManifest.xml and the package DLLs directly beneath it, and the launcher lists the title as installed. It also records what unpacking costs, since that decided the change: one thread held a core at 100% for about 40 MB/s and four reach about 200 MB/s, and releasing each container once its members are on disk is what keeps the peak footprint at one package rather than the archive plus its contents. The launch is not part of this evidence, and the entry says so. * fix(xbox): place the 64-bit framework beside a legacy title A Windows Update framework category lists one package per architecture under identifier-only names. The first package was unpacked, which on this device was the x86 build, so a 64-bit title got 32-bit DLLs and every load failed with STATUS_INVALID_IMAGE_FORMAT. Candidates are unpacked now and only the one whose manifest declares ProcessorArchitecture="x64" is kept. The framework folder was also never created, so a finished download failed at the move with "no such file or directory". unzip.rs belongs to this patch: legacy-install calls it and the recipe left it out, so a rebuild from the pinned source could not compile. * feat(xbox): report a UWP entry point at launch An unpacked package can name a COM class as its entry point instead of Windows.FullTrustApplication. That class is a UWP application, which expects the app model to activate a view; Wine has no host for it, so the launch died inside the loader with no explanation. The launch now reads the entry point and reports uwp-entry-point, and full-trust packages are unaffected. Forza Horizon 4 is such a package: its manifest names Forza.App. Its frameworks are installed and the loader is clean before that point. * fix(xbox): report why a launch was refused A failed prepare replaced the backend message with a fixed sign-in hint, so a title that was not installed or a runtime that refused all read as a bad account. The reason is kept, with paths and URLs dropped, and written to the store log. * fix(adb): dismiss the keyboard on Search and Go Search and Go were terminal IME actions but were not handled, so focus stayed in the field and the keyboard covered the results it had just fetched. * fix(xbox): keep a cache row without a legacy format plain Decoding added a format key with an empty value to every cached title, so a library restored from storage no longer matched the one that was saved. * test(ui): match the manifest message a legacy package reports The message covers both a MicrosoftGame.config and an AppxManifest, so the assertion follows the text the content dialog now prints. * fix(xbox): refuse to start a title that needs the Windows app model A legacy package that names an entry point other than Windows.FullTrustApplication is a UWP application. Wine has no app-model host, so starting its executable crashes inside the loader and the launch looks like nothing happened. Read the entry point from the manifest the installer already parses and stop the Play action with a message instead. Forza Horizon 4 names Forza.App, so it installs and reports as installed but cannot be started here yet. * fix(xbox): dispatch on the container format of the chosen package The catalogue records the format of the first installable desktop package, and the picker only replaced the content id. An offer that lists MSIXVC and a legacy container would then hand the legacy id to streaming, or the streamed id to legacy-install, and the install failed after resolution had succeeded. The choice now carries its own format and the catalogue value only fills a gap. * fix(xbox): keep an extraction reason that the sanitizer rewrote The extraction sanitizer replaces anything outside letters, digits, space, dot, underscore and dash with a question mark, so a reason such as "(os error 28)" arrived as "?os error 28?" and the allowlist dropped the line. The failure then showed only the stage code, with no cause. Add that replacement character to the class the allowlist accepts. * fix(xbox): print the reason a launch was refused The account channel sends a reason with a refusal, and the guest replaced it with a fixed sign-in message, so a title that was never installed still read as a bad account. The guest now shows the reason it was given, and a token holding a path is dropped whole instead of having its slashes removed and its directory names kept. * build(xbox): leave RUST_TEST_THREADS unset when the host has no value The recipe always passed the variable, empty when the host had none, and the pinned test harness rejects an empty count. On an ARM64 host that runs cargo test, so the default local build failed before compiling. * fix(xbox): rebuild the backend patches from the tree that ran The two patches in this branch were not the ones the verified install ran, and one of them did not compile. `unzip.rs` inflates deflated entries but the dependency that provides the inflater was never added, so `prepare.py` produced a tree that failed at `flate2::read::DeflateDecoder`. Anything else missing fell into the same gap: the install stage reported no bytes, so the bar held one value for the whole unpack, and a container a stopped run had finished was downloaded again. Rebuilt from the patched source, and fixed the defects a review of the patch found: - Unpacking reports bytes again: the workers count each file's declared length, and for the single-file bundle member the folder's growth stands in, which is what the device run showed. - A finished container is reused, so a retry after a failure past the download does not spend hours fetching it again. The space preflight counts it as reclaimable, since the retry truncates it first. - An install over a folder that already has a manifest replaces the old files instead of leaving the new package nested and reporting success. A first install still refuses to merge into an existing target. - The manifest search looks at the depth a nested bundle writes, not only one level down. - `withdraw_libraries` removes only the DLLs `copy_libraries` recorded copying, so a framework replacement cannot delete a library the title owns. - ZIP64 sizes and offsets stay `u64`; truncating them to `u32` read the wrong local header past 4 GiB. - The extraction checks the blockmap length against the footer's before writing, which the crate only does when asked. - The container being unpacked is never treated as a nested member, so `extract-eappx title.eappx .` no longer re-enters and deletes its own input. - `flate2` is declared and the lock is updated. `prepare.py` reproduces this from a pristine checkout and `cargo test` passes on it. * fix(xbox): apply the legacy install patch over the Nexus 0.2.15 backend * fix(xbox): install only the newest x64 build of a legacy title and size the space check at its real peak * fix(xbox): install a store package that is a plain archive instead of an XVD * fix(xbox): refuse a package entry that ends before its recorded size * fix(xbox): credit only complete staged containers toward the free space a legacy install needs * fix(xbox): bound each package entry to its data and check ZIP64 decoded sizes * fix(xbox): refuse duplicate package names and clear an unfinished download before measuring space * fix(xbox): bound package entries by the next header and stage a plain package until it validates * fix(xbox): hold the install folder lock through a legacy install * fix(xbox): fall back to an older build when Microsoft refuses the newest one a license * fix(xbox): keep the registered device across sign-out * feat(xbox): explain device-limit and license refusals, with a link to manage devices * fix(xbox): locate each build only once licensed, roll back a failed package swap, report the final license answer * fix(xbox): skip trial and preorder packages, read runtime behavior, keep licensing timeouts * fix(xbox): keep a failed package swap recoverable, size bundles up front, report key-write and framework errors cleanly * fix(xbox): drop a pending manifest check on any newer launch, keep committed backups out of restores, match the app-model order * fix(xbox): cancel pending launch checks on a new intent, remember entries a rollback could not remove * fix(xbox): clear the removal list before a restore moves old files back --------- Co-authored-by: TimmyCraft <46533729+TimmyTurner51@users.noreply.github.com> |
||
|
|
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). |
||
|
|
7dedf945c2 | fix(xbox): send delegation-compact device tickets to licensing in the licensing wire form (#2598) | ||
|
|
c5d7cdc058 |
Xbox Cloud Gaming: stream from the store and Games tab, native player with DroidDeck frame generation (#1531)
Xbox Cloud Gaming: stream from the store and Games tab, native player with DroidDeck frame generation Stream Xbox games with Xbox Cloud Gaming (Game Pass) from DroidDeck, outside the Linux session. - Backend: `xodus-cli cloud-token` (tools/xbox/droiddeck-cloud-token.patch) gets the streaming tokens; they stay in memory. - Web player (default): the Greenlight player page (tools/xcloud-player, MIT) in a WebView, plus Microsoft's own xbox.com/play player. In-stream menu with screen effects (sharpen, colour, deband, FXAA, CRT, NTSC, Toon, fps cap), stream quality, performance overlay (level, layout, top right / top left) and rumble. - Native player (opt-in, Android 10+, Player engine: Native): Google's WebRTC (io.github.webrtc-sdk 125.6422.07, BSD) with the Greenlight protocol ported to Kotlin, in its own process (:xcloudnative) with its own instance of DroidDeck's compositor. Decoded frames reach the compositor as AHardwareBuffers (new stream mode, VK_ANDROID_external_memory_android_ hardware_buffer import), so DDFG 2x and LSFG 2x/3x/4x run on them. Live frame generation, frame-rate target (presets and a 10-165 fps slider, even pacing), zero-copy picture, small network buffer, fast decoder, instant controller input, overlay with engine and on-screen fps, background end, restart and web fallback. It takes the main process's tokens through XboxCloudTokenService; they are fetched ahead while a cloud game is shown. - The compositor requests the dma-buf import extensions only where the driver has them (the system driver has none). - Catalog: cloud availability, Game Pass plan CFQ7TTC0K6L8 counted, library filter All / Owned / Game Pass / Cloud, Stream and Add to Games on the store page, stream-only Games-tab entries (Stream + Download / Play + Stream). - Xbox games get VC++ 2015-2022 and the ARM64 runtime registry entries (vcredist2022_arm64, built in until the catalog has it) before each launch. - Controller focus reaches pickers opened from a game page (install location, uninstall); Add / Remove from Games keep the focus. Credits: Greenlight by UnknownSKL (Jim Kroon), MIT, player and protocol; Better xCloud for the resolution / OS mapping; MGamer404's Bannerlator #627 for the ARM64 runtime approach. Ported from the412banner's Bannerlator. |
||
|
|
5ca1f610ab |
Xbox: fix sign-in on phones with a slow StrongBox Keystore (#1521)
On some phones (tester: Honor BKQ-N49, Android 17) Xbox sign-in stopped with "the Xbox helper stopped with exit code 1" before Microsoft's page opened. The backend asks the app to read and save credentials over a socket and waits 10 s for each reply. The app sealed credentials with a StrongBox-backed Keystore key, and each StrongBox operation took 7-15 s on that phone, so the backend gave up. The app still finished those saves afterwards, leaving a record without a username that every later attempt had to read back slowly. - Seal new store credentials with a TEE Keystore key (v2 envelopes); v1 envelopes still open with the old key and move to v2 on their next write. - A sign-in discards an Xbox record without a username (an unfinished sign-in) before starting the backend. - The backend waits 30 s for the app's credential reply. - The backend names the failing step instead of only credential-io (socket connect/exchange, session lock, missing socket name/port/key), and falls back to a keyed 127.0.0.1 port when the abstract socket is refused. - The app's credential listener logs and retries accept errors, serves each connection on its own thread, and logs slow requests with per-stage times. Refs #1337, #1300 Co-authored-by: KeegantheVeganat0r <58369898+KeegantheVeganat0r@users.noreply.github.com> |
||
|
|
0663593920 | Fix Game Pass library sync when subscription plan rows are omitted (#1193) | ||
|
|
80a62cd0f0 | Restore Xbox launches from Steam (#1170) | ||
|
|
7eae6ca3e7 |
Restrict Xbox credential IPC and address launch review findings (#1164)
* Restrict Xbox credentials to host backends and lease game launches * Verify mapped PRoot backend images and retry lease heartbeat timeouts * Bound Xbox backend shutdown and isolate service socket lifetimes * Keep unique Xbox service sockets within Unix address limits * Own licensed launch directories and recover abandoned views safely * Serialize Xbox account revocation with sign-in commits and launch authorization |
||
|
|
a63f3b1fbc | Add experimental Xbox and PC Game Pass store support (#1156) |