Compare commits

...
Author SHA1 Message Date
Kurt Himebauch 4de28717f1 feat: guide shared-screen co-op through Steam Link 2026-10-24 19:49:52 -04:00
Kurt Himebauch de104f64a2 feat: prototype offline local LAN setup 2026-10-24 19:34:15 -04:00
maxjivi05 74a6a88df8 fix(desktop): keep the Desktop actions and Settings handle on small phones 2026-10-24 18:58:45 -04:00
maxjivi05 c9493993af fix(desktop): keep the Desktop page from overlapping on phones 2026-10-24 18:58:45 -04:00
MaxsTechReview dc08385411 Stop the library helper when the KDE Steam client exits (#1519) 2026-10-24 17:57:59 -04:00
MaxsTechReview 49b6a0739d Present games from the KDE Steam client through software WSI (#1518) 2026-10-24 17:56:40 -04:00
MaxsTechReview 8471682b1c Collect only the Steam log lines a session wrote (#1505) 2026-10-24 14:47:21 -04:00
MaxsTechReview 4dda1c1e52 fix(epic): a paused install keeps what it downloaded (#1504) 2026-10-24 14:47:18 -04:00
Thomas Lee 8156a9649d perf: reuse Steam artwork directory scans (#1466) 2026-10-24 14:35:14 -04:00
FX1922 7b518d7e6a itch.io: platform and tag filters (#1497) 2026-10-24 13:39:57 -04:00
maxjivi05 8d66570d33 Steam file dialog: keep spaces in the chosen path, cancel when GTK 3 is missing or the bridge reconnects 2026-10-24 13:18:04 -04:00
maxjivi05 5a56d9f785 fix(steam): Browse buttons open a file chooser on the ARM64 client
Steam's ARM64 client has no desktop-portal file chooser, so
SteamClient.System.OpenFileDialog failed at once and every Browse button
(Add a Non-Steam Game, shortcut target, library folder) did nothing.
The Steam UI bridge now answers it with a GTK file chooser run under
Steam's reaper, so gamescope shows it over Steam.
2026-10-24 13:18:04 -04:00
MaxsTechReview 77e23cb397 itch.io: browse the Store tab by sort and price, with paging and a disk cache (#1473)
## What this does

The itch.io Store tab used to show only four fixed shelves. This is the
first of a series of PRs that rework it. It adds real browsing: pick an
order and a price filter, and the tab loads itch's own listing for that
choice and keeps loading as you scroll. Login, the library, downloads
and installs are unchanged.

Platform and tag filters, the game page with the install picker, updates
and collections are not in this PR. They come in the following ones.

## How it works

itch serves every listing page as an RSS feed if you add `.xml` to the
address. The app already reads those feeds for the shelves, so browsing
reuses the same parser (`ItchShelves.parse`). Nothing here needs the API
key.

The address is built the way itch builds its own links: sort, then
price, then `platform-<name>`, then `tag-<slug>`.

| Choice | Address |
|---|---|
| Popular (default) | `https://itch.io/games` |
| New & popular | `/games/new-and-popular` |
| Top sellers | `/games/top-sellers` |
| Top rated | `/games/top-rated` |
| Most recent | `/games/newest` |
| Free | `/games/free` |
| On sale | `/games/on-sale` |
| Paid | `/games/store` |
| $5 or less | `/games/5-dollars-or-less` |
| $15 or less | `/games/15-dollars-or-less` |

Choices combine, for example `/games/top-rated/free`, then `.xml` for
the feed. Page 2 and later add `?page=N`.

## Changes

**`stores/itch/ItchBrowse.kt` (new)**
- `BrowseQuery` holds sort, price, platforms and tags. The default query
is the front page, which keeps the existing shelves.
- `ItchBrowse.path` and `url` build the addresses above. Only the
spellings listed above are used. Platforms and tags are already accepted
by the builder, ready for the next PR.
- `ItchBrowse.page` loads one page of results:
- Disk cache under `cacheDir/itch-browse`, keyed by the SHA-1 of the
address, fresh for 3 hours.
  - Requests are made one at a time, at least 1.2 s apart.
  - A 429 answer waits 8 s and tries once more.
- Each request is written to the store log (address, status, number of
games).
- `ItchBrowseState` is the Compose state for the tab: the query, the
games loaded so far, and the loading, ended and failed flags. A
generation counter discards answers that arrive after the user has
changed the query. Paging skips games it has already shown.

**`ui/ItchBrowseBar.kt` (new)**
- A sort chip row and a price chip row, plus a load-more trigger at the
end of the grid.
- Chips are selectable, work with the controller (`controllerConfirm`)
and use the same glide border as the rest of the app.

**`ui/StoresPage.kt`**
- The storefront shows the chip bar for itch.io and, when a non-default
choice is active, the browse results in the existing grid instead of the
shelves.
- Games you already own are marked as owned in the results.
- Empty and failed states have their own messages.

**`stores/itch/ItchShelves.kt`**
- `open(url)` is now `internal` so browsing can reuse it.

**`stores/StoresState.kt`**
- `detailItem` also looks in the browse results for itch.io, so tapping
a result opens its detail page.

**Strings**
- 13 new strings (sort names, price names, "Load more", "Couldn't load
games"), translated in all 33 locales.

**Docs and tests**
- `docs/development/itch-browse.md` explains the address scheme, the
cache and the paging.
- `ItchBrowseTest` checks the addresses the code builds against the ones
listed above.

## Testing

I checked every address with `.xml` added, and all of them load without
errors:
- Every sort, every price filter and every platform on its own.
- Combinations: `top-rated/free`, `top-rated/on-sale`,
`top-rated/store`, `top-rated/5-dollars-or-less`,
`top-rated/free/platform-windows` and
`top-rated/free/platform-windows/tag-pixel-art`.
- Paging: `?page=2` and `top-rated.xml?page=2`.

The unit test locks those addresses in.

## Not in this PR

- Platform and tag filters in the UI, and search.
- The game page, the version picker and install for free games.
- Updates for installed games and itch collections.
- Android builds will link out to the itch.io page. Butler patching
comes last, as an add-on pack.
2026-10-24 11:33:47 -04:00
maxjivi05 1883a8c7cf itch.io browse: drop code comments 2026-10-24 11:15:35 -04:00
maxjivi05 aefd8a3b60 fix(xbox): report a failed class registration in the launch log 2026-10-24 11:14:20 -04:00
maxjivi05 fee8ce91f3 fix(xbox): register the runtime's WinRT classes and load its wintypes so Minecraft starts 2026-10-24 11:14:20 -04:00
maxjivi05 bcb18e3fb7 fix(xbox): match only the 401 rejection Xodus prints 2026-10-24 09:07:13 -04:00
maxjivi05 6855dd4467 fix(xbox): say to sign in again when Microsoft rejects the download's licenses 2026-10-24 09:07:13 -04:00
maxjivi05 a66d7d74a4 fix: Steam Input mouse clicks, scrolling and pointer moves reach games again 2026-10-24 09:07:04 -04:00
Kurt Himebauch 2bd279a0f3 fix: read Steam shader settings off the main thread 2026-10-24 08:54:41 -04:00
maxjivi05 0790cb4390 fix: keep a Proton's originals when its folder could not be fully removed 2026-10-24 08:22:00 -04:00
maxjivi05 ad6d8d824a fix: removing a Proton also deletes its stored component originals 2026-10-24 08:22:00 -04:00
maxjivi05 0b671b2144 fix: match an annotated overlay header and keep the settings file's mode 2026-10-24 06:27:46 -04:00
maxjivi05 31cead9b32 fix: keep blank lines inside the overlay section and stage settings under a unique name 2026-10-24 06:27:46 -04:00
maxjivi05 26c3dcc885 fix: turn off the Ubisoft Connect overlay so Ubisoft games stop crashing at start 2026-10-24 06:27:46 -04:00
FX192 dc57f367e1 itch.io browse: don't re-fire the load-more trigger when a page is appended 2026-10-24 13:07:16 +03:00
FX192 5838587639 itch.io browse: let a failed page be retried instead of ending the list 2026-10-24 13:02:17 +03:00
FX192 7e87cdacb5 Merge remote-tracking branch 'upstream/main' into feat/itch-browse 2026-10-24 12:46:26 +03:00
FX192 dbcbf0b6fa itch.io browse: use itch's own sort, price and platform paths
The sort and price chips now cover everything itch's browse page offers, with the
paths copied from its links: new-and-popular, top-sellers, top-rated and newest
for sorts; free, on-sale, store, 5-dollars-or-less and 15-dollars-or-less for
prices; platform-windows, -osx, -linux, -android, -ios, -web and -mobile-web.
The guessed alternative spelling of the free filter is gone, so a query is one
address. The tests assert the addresses itch itself uses.

New and reworded strings in all 33 locales.
2026-10-24 09:27:49 +03:00
maxjivi05 476642be71 chore: drop the added comments 2026-10-24 01:42:20 -04:00
Nikolay Nadorichev 8c86b718a0 fix: find the signed-in Steam account when loginusers.vdf has no MostRecent
droiddeck-steam-shortcuts and AddedGames.accountConfig took the account
marked "MostRecent" in loginusers.vdf, else the only userdata folder.
The arm64 client here writes no MostRecent, so with two accounts in one
install nothing was picked: no added or store game reached
shortcuts.vdf ("no signed-in account yet; nothing written") and Steam
answered their launch with "App configuration unavailable".

Without MostRecent, take the account marked AutoLogin, then the one with
the latest timestamp. Both sides use the same order so the app reads the
config the guest script writes.
2026-10-24 01:42:20 -04:00
maxjivi05 473ac666b3 Take over Steam's Default startup movie pick 2026-10-24 01:41:08 -04:00
FX192 cc0a4f5aa9 itch.io: browse the Store tab by sort and price, with paging and a disk cache
The Store tab only had four fixed shelves and a title search. A row of sort
(Popular, New, Top rated, Top sellers) and price (Any, Free, On sale) chips now
sets a BrowseQuery; anything but the defaults swaps the shelves for that query's
games, loaded page by page as the grid scrolls.

ItchBrowse builds itch's listing-feed URL (platform and tag segments are in the
builder for the next change), tries each spelling of a price filter until one
answers, spaces requests 1.2 s apart, backs off once on a 429, and keeps pages
in the app cache for three hours. Every request is logged with its status and
game count so a wrong URL guess can be fixed from a device. Owned games replace
their browse copy so Install and the owned markers are right, and the detail
page finds browse results.

Strings for all 33 locales; URL-builder tests; docs/development/itch-browse.md.
2026-10-24 07:49:05 +03:00
maxjivi05 f89dc04072 fix: Proton's EasyAntiCheat and BattlEye runtimes are not listed as games
Steam installs Proton EasyAntiCheat Runtime (1826330) and Proton BattlEye Runtime (1161040) as tool depots. The launcher's Games tab and the desktop's game entries now skip them like the other runtimes.
2026-10-24 00:47:45 -04:00
maxjivi05 dd79f44b3a fix: the Steam download monitor no longer stalls the main thread on a long content log
The content log was read with RandomAccessFile.readLine, one byte per read, on the main thread. A 4 MB log took about 2 s on the first poll, enough for an ANR on slower devices while a download runs. It is now read through a buffered reader with the same Latin-1 lines and offset, and the per-line regexes only run on lines that can match.
2026-10-24 00:27:22 -04:00
maxjivi05 b0e405ebf3 fix: Epic client imports get the launch command, versioned installs need a matching manifest build
Games the Epic client installed now carry their LaunchCommand arguments too, split by a new launch.split op. A doubled quote inside a quoted argument is one literal quote, and an install with a version ignores a manifest without the same build.
2026-10-23 23:59:37 -04:00
maxjivi05 42026b382f fix: keep manifest launch arguments to the installed build and their own additions
The manifest's arguments apply only when its build matches the installed version, only arguments the merge inserted are tracked as its own, escaped quotes split like a Windows command line, and the REDprelauncher rule needs Cyberpunk2077.exe beside it.
2026-10-23 23:59:37 -04:00
maxjivi05 8209a707f4 fix: Caravan SandWitch and Cyberpunk 2077 run at D3D12 feature level 12_1
Feature level 12_2 makes vkd3d-proton report mesh shaders and ray tracing that Turnip doesn't provide. Caravan SandWitch (Unreal Engine 5) then builds mesh shader pipelines without a pipeline layout and the driver crashes; Cyberpunk 2077 stops at ray tracing initialization. Only these two games get 12_1, and a value set in a game's own settings still wins.
2026-10-23 23:59:37 -04:00
maxjivi05 46cd8e1777 fix: Epic games get their manifest launch command
Epic manifests carry a launch command next to the launch executable, which the Epic launcher passes to the game. It was read and dropped, so Caravan SandWitch never got -PCStore=EGS and quit with "started outside of any known PC store". The manifest's launch command now joins the game's arguments, including for games already installed.
2026-10-23 23:59:37 -04:00
maxjivi05 6e1621fe53 fix: Steam's Ubisoft games install Ubisoft Connect again
The redistributable seeder marked every process in a game's install scripts as already run, so the Ubisoft Connect installer that Ubisoft games list was skipped and they stopped with "Unable to locate Uplay PC". It is now left to run like the Vulkan runtime installer, and a marker an earlier seeding wrote is taken back out.
2026-10-23 23:58:39 -04:00
XxJSONDeruloxX 546574e982 fix(xbox): enable proot fast path in Xodus 2026-10-23 23:56:24 -04:00
XxJSONDeruloxX b1ab55856e fix(ui): clear search focus and use store accents 2026-10-23 23:56:24 -04:00
XxJSONDeruloxX 4a0eb14d1f fix(xbox): mount selected SD library in Xodus 2026-10-23 23:56:24 -04:00
XxJSONDeruloxX 2c8ae3753c fix(xbox): mount external storage for downloads 2026-10-23 23:56:24 -04:00
Kurt Himebauch fcfbb74068 fix: one refused thermal or power query no longer drops the others from the session report (#991) 2026-10-23 23:43:01 -04:00
MaxsTechReview 0340be5a7d Steam client download: resumes, retries, shows megabytes, and isn't paused out of sight (#587)
A user's first Steam setup never finished on an Honor Pad (Snapdragon 6
Gen 1, metered Wi-Fi with a 14 Mbit/s link). Their log stops at
`downloading Steam: bins_linuxarm64_linuxarm64 (2/17)`. The log was
shared 31 s into the session, so nothing had failed yet. The way the
download works explains why it never got further.

## Why

- **The session pauses the download.** With the default background
behavior (Manual), a session pauses as soon as DroidDeck is hidden or
the screen turns off. In the user's log that happened one second after
start, before the download had begun.
- "Keep downloads running" doesn't help. It's off by default, and it
only recognizes Steam's own game downloads, not the runtime fetching the
client.
- A first run shows nothing for minutes, so leaving the app or letting
the screen time out is exactly what people do.
- **The download is bigger than the screen says.** The client is about
360 MB in 17 parts, and part 2 alone is 110 MB. The loading screen said
"~1-2 min" and counted parts, not bytes, so on a slow link it looks
frozen at about 5%.
- **Nothing handles a bad connection.** Each part was a plain `curl
-fsSL` with no timeout, no retry and no progress output.
  - A stalled connection could wait forever.
- A failed one ended the session and threw away everything fetched, so
the next try started from part 1.

## What changes

- **`droiddeck-steam-install`**:
- Parts go to `package/droiddeck-download` and stay there until the
client is installed.
  - Each part resumes from the bytes on disk (`curl -C -`).
  - A transfer under 4 KB/s for a minute is dropped and resumed.
- Attempts that make no progress back off 5–30 s, then give up with a
clear error. Whatever arrived is kept.
  - A finished part is marked unpacked, so a later session skips it.
- Bytes that fail their checksum are fetched whole again. A server that
won't resume starts the part over. Parts left over from another client
version are dropped.
- A repair redoes every part once, and keeps what an interrupted repair
already redid.
- Every 5 s the step line also carries megabytes overall: `… (2/17), 45
of 360 MB`.
- **Loading screen** (`LoadingState`): shows `Downloading the Steam
client · 45 / 360 MB`, with the bar following the bytes. Older runtimes
still show the part name.
- **`SessionService`**: until the session's first frame, the download
watch also checks whether the client is still to be fetched (no install
stamp or client binary, or a repair requested). While it is:
- the session stays awake with its wake and Wi-Fi locks, whatever the
downloads setting says;
  - the notification shows "Steam download active" with **Suspend now**;
  - a `steam.client_download` event marks start and end.
- The watch is set up before the first suspend decision, so a session
started with the screen off isn't paused first. Once the client is
there, the chosen behavior applies again.
- **`droiddeck-session`**: the step no longer promises 1–2 minutes.

## Testing

- `python3 -m unittest discover -s tools/tests -p 'test_*.py'`: 497 OK,
1 skipped.
- `test_steam_install.py` gets a fake curl that drops connections,
refuses to resume or fails on cue.
- New cases cover: megabyte progress; resuming after a dropped
connection; keeping finished and partial parts across a failed session;
restarting a part the server won't resume; re-fetching bad bytes;
dropping another version's parts; a repair resumed once.
- Kotlin: `:app:testDebugUnitTest --tests
'com.droiddeck.launcher.session.*'` passes. That includes the new
`LoadingStateTest` and the `clientInstallPending` cases in
`SteamDownloadMonitorTest`.
- RedMagic NP06J, with Background behavior set to Manual and "Keep
downloads running" off (the user's settings), and a client repair
requested:
- Started Steam and sent DroidDeck to the background straight away. The
client download stayed active for 30 s with no pause, and all 360 MB
arrived. Then the session paused as Manual should.
- Stopped a second repair during part 2. Part 1 was marked unpacked, the
110 MB part 2 was kept, and the repair marker stayed.
- Started again: it resumed at 110 of 360 MB, unpacked part 2 without
fetching it again, finished, and Steam started normally.
- The loading screen showed `Downloading the Steam client · 248 / 360
MB`.

Retested 2026-10-23 on the REDMAGIC tablet after merging main, which
brought in the stable-channel fallback. Background behavior was set to
Manual with "Keep downloads running" off. A client repair was forced,
then Home was pressed right after Start:

| Build | Session while hidden | Client download |
|---|---|---|
| main | suspended 1 s after Home | stuck at part 3/17 after 90 s |
| this PR | kept awake until the client was in | all 17 parts, 362 MB in
46 s with MB progress; suspended once done |

`tools.tests.test_steam_install` (22), `SteamDownloadMonitorTest` and
`LoadingStateTest` pass.

## Not changed

- **The download is the plain zips.** Valve's manifest also lists `.vz`
(LZMA) versions, 228 MB instead of 360 MB. Using them needs a VZ decoder
in the guest; that could be a follow-up.
- **The stall and retry path** is covered by the tests but wasn't forced
on the device.
2026-10-23 23:28:05 -04:00
maxjivi05 132f40ac97 fix: install step progress cannot overflow 2026-10-23 23:11:34 -04:00
maxjivi05 5981bbb1e2 fix: an oversized install step count falls back to the step text 2026-10-23 22:51:28 -04:00
maxjivi05 7419ba114f fix: the client install stays awake until Steam's first frame and its end is recorded 2026-10-23 22:22:14 -04:00
maxjivi05 96e2bf992d fix: an HTTP 4xx part hands over to the next CDN at once 2026-10-23 21:20:50 -04:00
Kurt Himebauch ad9eb8eb29 xbox backend x86 to arm cross compilation (#1440) 2026-10-23 21:02:20 -04:00
MaxsTechReview 116d0e4f1a fix: a game started from another launcher returns to that launcher (#1438)
A game started from another launcher (ES-DE, a `droiddeck://game/` link,
a pinned shortcut) should send the player back to that launcher when it
closes. Instead DroidDeck always opened the Android home screen, which
is a different place whenever that launcher isn't the default Home app.

## Cause
The link is handled by `FrontEndActivity`, which starts the session in
its own task and stays behind it in a second DroidDeck task. When the
session ended, DroidDeck started `CATEGORY_HOME` to cover that leftover
task, so the player always landed on the system Home.

## Fix
When a link-launched session ends, `SessionActivity` removes the task
that handled the link (a `FrontEndActivity` task whose base intent is a
game link), then removes its own task. Android then shows whatever was
underneath: ES-DE, any other app that launched the game, or Home when
Home launched it.

Sessions started from DroidDeck's own Games tab are unchanged.

## Testing
On a REDMAGIC NP06J, with the `droiddeck://game/945360` link started
using ES-DE's flags (`NEW_TASK | CLEAR_TASK`). Among Us was closed and
"Return to launcher after a game" was on.

| Launched from | main | this branch |
|---|---|---|
| Calculator (stands in for a non-Home frontend) | Android home |
Calculator |
| Home | Android home | Android home |
| DroidDeck's Games tab | DroidDeck | DroidDeck |

## Credits
Reported on Discord by whatsupbros.
2026-10-23 20:45:32 -04:00
maxjivi05 4a57c6f6f1 chore: drop the comments this change added 2026-10-23 20:45:14 -04:00
maxjivi05 2d9d4dbeb0 Merge branch 'main' into fix/steam-client-download
# Conflicts:
#	tools/linuxfs/overlay/usr/local/bin/droiddeck-steam-install
#	tools/tests/test_steam_install.py
2026-10-23 20:23:44 -04:00
MaxsTechReview 866551e797 fix: Snapdragon 8 Gen 2 no longer pins Steam to one core by default (#1441)
## Summary

Since 0.5.0, Snapdragon 8 Gen 2 devices (Retroid Pocket 6, Galaxy S23,
AYN Thor) pin the Steam client, its UI helper and gamescope to the
single prime core whenever the core settings were never touched. The
Steam menu and overlay lag on those devices, and games launched from
Steam get CPU-starved.

This drops that default, so 8 Gen 2 behaves like 0.4.0 and every other
chip: Android schedules Steam on all cores. Core choices users saved in
Performance are kept, and the all-core restore for games launched from a
pinned Steam client stays.

## Evidence

The device reports attached to both bug reports show the default in
effect:

| Device | SoC | Client core override | Client cores |
|---|---|---|---|
| Retroid Pocket 6 | QCS8550 | true (never set) | 7 |
| Galaxy S23 | SM8550 | true (never set) | 7 |

Both reporters say 0.4.0, which left Steam on all 8 cores, was smooth.
The PR that added the default did not benchmark it.

Tablet bench (REDMAGIC, SM8850): the 8 Gen 2 default was reproduced by
pinning Steam to one prime core (7) and games to cores 0-3. The test
scrolls the Big Picture library with the d-pad for 20 s and records
frame pacing. Two runs each:

| Steam client | UI fps | 1% low | p99 frame | off-cadence |
|---|---|---|---|---|
| all cores (this PR) | 114.4 / 115.2 | **62.5 / 62.5** | 16 ms | 4.7 /
4.0 % |
| one core (old default) | 109.7 / 110.9 | 41.7 / 41.7 | 24 ms | 8.0 /
7.0 % |

Among Us ran the same either way (58.9 vs 59.0 fps).

## Tests

`CoreAllocationPrefsTest`: absent preferences leave every core to the
scheduler, and saved choices are kept.

## Credits

- shanume (RP6) and Kacper (S23): reports, and the 8-cores-vs-1 finding.
- Kurt Himebauch (#654): the core allocation work this keeps, apart from
the default.
2026-10-23 20:22:23 -04:00
maxjivi05 a0c6545e77 fix: a link that joins DroidDeck's open task still returns to the caller 2026-10-23 20:22:05 -04:00
maxjivi05 c7bcd82782 fix: Snapdragon 8 Gen 2 no longer pins Steam to one core by default 2026-10-23 19:47:41 -04:00
maxjivi05 caaf6b3a01 fix: keep the link task id when an in-app resume reaches the session 2026-10-23 19:47:32 -04:00
superboo07 8123d5b361 xbox backend x86 to arm cross compilation 2026-10-23 23:40:49 +00:00
Kurt Himebauch 2b4bba63c5 docs: add the Trendshift #1 daily and weekly badges to the README (#1435) 2026-10-23 19:18:00 -04:00
maxjivi05 69b2b8fcdf fix: only close the game-link task that started the session 2026-10-23 19:17:08 -04:00
MaxsTechReview 0d8b5a7cf2 fix: stored components can be deleted after a Proton update (#1434)
After a Proton update, stored DXVK / VKD3D / FEX packages can't be
deleted. Components says they're "in use" by a Proton that's gone
(`DroidDeck-Proton_11-9.1` after updating to 11-11.1) or by a bare
number (`4005446849`).

## Cause
`deletePackage` and the Storage page's in-use check count every recorded
selection:
- **Removed Protons:** swaps on Protons that are no longer installed.
- **Out-of-date swaps:** swaps from before the Proton's version changed.
The launcher already ignores these.
- **Game profiles:** a per-game pick blocked the delete with the "swap
that Proton" message, naming the game's id.

## Fix
- **Out-of-date selections:** a selection only counts while its Proton
is installed and at the version the swap was made on. That's the rule
launches already use. Deleting a package removes its stale entries.
- **Profile picks:** deleting a package also clears it from any game's
component profile, so those games go back to the Proton's own copy.
Storage cleanup still keeps profile picks.
- **Live swaps:** a package swapped into an installed Proton is still
blocked. The message now shows the Proton's name rather than its id.

No new strings.

## Testing
On a REDMAGIC NP06J, with the state from the reports recreated:

| Case | main | this branch |
|---|---|---|
| DXVK swapped into a removed `DroidDeck-Proton_11-9.1` | Deleting
failed: in use in DroidDeck-Proton_11-9.1 | Deleted, stale entry removed
|
| FEX picked in game profile `4005446849` | Deleting failed: in use in
4005446849 | Deleted, profile cleared |
| DXVK swapped into installed Proton Experimental | blocked | blocked:
in use in Proton Experimental (ARM64) |

<img
src="https://raw.githubusercontent.com/maxjivi05/DroidDeck/pr-media/1434/main-stale-proton.jpg"
width="420"> <img
src="https://raw.githubusercontent.com/maxjivi05/DroidDeck/pr-media/1434/main-game-profile.jpg"
width="420">
<img
src="https://raw.githubusercontent.com/maxjivi05/DroidDeck/pr-media/1434/fix-game-profile.jpg"
width="420"> <img
src="https://raw.githubusercontent.com/maxjivi05/DroidDeck/pr-media/1434/fix-live-blocked.jpg"
width="420">

`ComponentsSelectionTest` covers removed, out-of-date and live
selections.

## Credits
Reported on Discord by Siigonis, Bado and woodrow1712.
2026-10-23 19:13:29 -04:00
maxjivi05 7261b26264 fix: a game started from another launcher returns to that launcher 2026-10-23 18:56:44 -04:00
maxjivi05 db9aae7b87 fix: delete the package before saving, and match Protons the same way 2026-10-23 18:56:24 -04:00
maxjivi05 70b8ec5de4 docs: add the Trendshift #1 daily and weekly badges to the README 2026-10-23 18:36:24 -04:00
maxjivi05 94b530ecb2 fix: stored components can be deleted after a Proton update 2026-10-23 18:28:35 -04:00
MaxsTechReview 906e0d1f7d fix: other apps can record game audio (#1430)
Fixes #1314.

Screen recorders and apps that use `AudioPlaybackCapture`
(MediaProjection) get silence from DroidDeck. The app targets SDK 28,
and Android blocks playback capture for apps below SDK 29 unless they
opt in. That was a side effect of the target SDK, not a choice.
`android:allowAudioPlaybackCapture="true"` opts in. Game audio already
plays with `AAUDIO_USAGE_GAME`, a usage that capture allows.

REDMAGIC NP06J with Among Us running, `dumpsys media.audio_policy`
("Allow playback capture log"); the game's streams are AAudio
`USAGE_GAME` with no capture-blocking flags:

| Build | |
| --- | --- |
| main | `uid=10494, allowPlaybackCapture=false,
packageName=com.droiddeck.launcher` |
| this PR | `uid=10494, allowPlaybackCapture=true,
packageName=com.droiddeck.launcher` |

## Credits
Requested and diagnosed by @WilsonNet in #1314.
2026-10-23 18:01:24 -04:00
maxjivi05 992912fdf8 fix: other apps can record game audio 2026-10-23 17:43:44 -04:00
MaxsTechReview 4ff4be2371 fix: keep a slightly early vsync tick for frame pacing (#1405)
Gamescope paces from the presentation timestamp. The Choreographer tick
is often still slightly ahead of the render thread, and that tick was
thrown away, so the draw time was reported instead.

A tick within one refresh of the draw is now kept, whether it is
slightly ahead or slightly behind. A missing tick, or one more than a
refresh away, still falls back to the draw time.
2026-10-23 17:00:32 -04:00
maxjivi05 06946fe8ae chore: drop comments 2026-10-23 16:01:41 -04:00
0x1Nawaf 53c63b6dc2 fix: keep a slightly early vsync tick for frame pacing 2026-10-23 15:43:52 +00:00
Kurt Himebauch a25081df7c Merge branch 'main' into fix/steam-client-download 2026-10-23 10:16:19 -04:00
Kurt Himebauch 958446ab7c Merge current main into PR #991 2026-10-22 13:11:05 -04:00
Kurt Himebauch bde9ca733f Merge current main into PR #587 2026-10-22 13:11:02 -04:00
Kurt Himebauch 495ff952d2 Merge current main into PR #991 2026-10-22 12:13:48 -04:00
Kurt Himebauch 0819aa725d Merge current main into PR #587 2026-10-22 12:13:46 -04:00
ovurrsl 430e77178e fix: one refused thermal or power query no longer drops the others from the session report
Thermal status, thermal headroom and power saver are now read one by
one, so a vendor that throws on one of them still gets the other two
lines, and the refused one shows as unknown.
2026-10-22 18:48:39 +03:00
xXJsonDeruloXx c8cc17bf3a Merge main into Steam client download PR 2026-10-22 10:01:34 -04:00
xXJsonDeruloXx 6d105c1649 chore: merge main to catch up with 0.5.0 2026-10-18 17:05:49 -04:00
MaxsTechReview 11bd604dfd Merge branch 'main' into fix/steam-client-download 2026-10-11 15:53:38 -04:00
MaxsTechReview b834a92244 Merge branch 'main' into fix/steam-client-download 2026-10-11 15:51:21 -04:00
maxjivi05 0cd7f07725 fix: a first run's Steam client download is not paused out of sight
With the default background behavior (Manual), a session pauses as soon
as DroidDeck is hidden or the screen turns off - one second after start in
the report this came from, before the download had begun. "Keep downloads
running" did not help: it is off by default, and it only recognizes the
client's own game downloads, not the runtime fetching the client itself.

Until the session shows its first frame, the download watch now also
asks whether the client is still to be fetched (no install stamp or no
client binary, or a repair asked for). While it is, the session is kept
awake with its wake and Wi-Fi locks whatever the downloads setting says,
the notification reads "Steam download active" with Suspend now, and a
steam.client_download event marks start and end. The watch is set up
before the first suspend decision, so a session started with the screen
off is not paused first. Once the client is there, the chosen behavior
applies again.
2026-10-11 14:45:57 -04:00
maxjivi05 342d2e7f20 fix: the Steam client download resumes, retries and shows megabytes
A first run downloads the native client, about 360 MB in 17 parts, before
anything is on screen. The script ran plain `curl -fsSL` per part: no
timeout, no retry, no progress. A stalled connection could wait for ever
on "downloading Steam: bins_linuxarm64_linuxarm64 (2/17)" (a 110 MB part),
a failed one ended the session and threw away everything fetched, and
the loading screen said "~1-2 min" while counting parts, not bytes.

Parts now go to package/droiddeck-download and stay there until the client
is installed. Each one resumes from the bytes on disk (curl -C -), a
transfer under 4 KB/s for a minute is dropped and resumed, attempts
without progress back off 5-30 s before giving up, and a finished part is
marked unpacked so a later session skips it. Bytes that fail their
checksum are fetched whole again; a server that will not resume starts the
part over; parts left for another client version are dropped. A repair
redoes every part once and keeps what an interrupted repair redid.

Every 5 s the step line carries megabytes overall ("(2/17), 45 of 360
MB"), which the loading screen shows as "45 / 360 MB" with the bar
following the bytes. The session's step no longer promises 1-2 minutes.
2026-10-11 14:45:57 -04:00
132 changed files with 4620 additions and 355 deletions

No files matched your search

+13 -1
View File
@@ -9,6 +9,16 @@ DroidDeck brings the SteamOS experience to Android: Valve's Steam client in Big
<p align="center"><a href="https://discord.gg/JRGAvawjsm"><img src="https://img.shields.io/badge/Discord-Join%20the%20community-5865F2?logo=discord&logoColor=white" alt="Join the DroidDeck Discord"></a></p>
<p align="center">
<a href="https://trendshift.io/repositories/267852?utm_source=trendshift-badge&amp;utm_medium=badge&amp;utm_campaign=badge-trendshift-267852" target="_blank" rel="noopener noreferrer"><img src="https://trendshift.io/api/badge/trendshift/repositories/267852/daily?language=C" alt="Droid-Deck%2FDroidDeck | Trendshift" width="250" height="55"/></a>
<a href="https://trendshift.io/repositories/267852?utm_source=trendshift-badge&amp;utm_medium=badge&amp;utm_campaign=badge-trendshift-267852" target="_blank" rel="noopener noreferrer"><img src="https://trendshift.io/api/badge/trendshift/repositories/267852/daily?language=Kotlin" alt="Droid-Deck%2FDroidDeck | Trendshift" width="250" height="55"/></a>
</p>
<p align="center">
<a href="https://trendshift.io/repositories/267852?utm_source=trendshift-badge&amp;utm_medium=badge&amp;utm_campaign=badge-trendshift-267852" target="_blank" rel="noopener noreferrer"><img src="https://trendshift.io/api/badge/trendshift/repositories/267852/weekly?language=C" alt="Droid-Deck%2FDroidDeck | Trendshift" width="250" height="55"/></a>
<a href="https://trendshift.io/repositories/267852?utm_source=trendshift-badge&amp;utm_medium=badge&amp;utm_campaign=badge-trendshift-267852" target="_blank" rel="noopener noreferrer"><img src="https://trendshift.io/api/badge/trendshift/repositories/267852/weekly?language=Kotlin" alt="Droid-Deck%2FDroidDeck | Trendshift" width="250" height="55"/></a>
</p>
<p align="center"><img src="docs/releases/media/0.2.0/launch-into-steam.gif" width="80%" alt="Tapping DroidDeck on the Android home screen and landing in Steam Big Picture"></p>
> Note: DroidDeck does not have a stand-alone website. Do not click on any download links from websites claiming to be the DroidDeck team.
@@ -47,7 +57,7 @@ Compatibility and performance vary by device; hardware validation is limited. De
## Credits and licence
GPL-3.0. Runtime, shim, input, and controller work build on WinNative and Bannerlator (maxjivi05). Epic Games and GOG support build on [Phobos’s](https://github.com/phobos665) adaptation of [Legendary](https://github.com/legendary-gl/legendary) and [gogdl](https://github.com/Heroic-Games-Launcher/heroic-gogdl), respectively. The registry entries a GOG game's install script (`goggame-<id>.script`) sets are read the way [Heroic Games Launcher](https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher)'s GOG setup (GPL-3.0) reads them. LSFG frame generation is from the work of Camille LaVey and the [Eden](https://eden-emu.dev) emulator project, following [lsfg-vk](https://github.com/PancakeTAS/lsfg-vk), ported to WinNative and DroidDeck by [@maxjivi05](https://github.com/maxjivi05); it needs your own copy of [Lossless Scaling](https://store.steampowered.com/app/993090/) and ships none of its shaders. x86 AppImages, and any whose own runtime cannot unpack them, are unpacked with [uruntime](https://github.com/VHSgunzo/uruntime) by VHSgunzo (MIT), shipped unmodified with its licence, which also starts the arm64 emulator AppImages whose own runtime cannot run its extractor on Android. The Steam client's audio goes through [@The412Banner](https://github.com/The412Banner)'s [DirectAudio](https://github.com/The412Banner/directaudio) PulseAudio sink (LGPL-2.1-or-later), built from `tools/directaudio/sink` with its request size kept to its ring so clients are not asked to queue 100 ms ahead. mmap ring-buffer controller input was developed by ribbit384 ([WinNative #345](https://github.com/WinNative-Emu/WinNative/pull/345)). Why the x86-64 Steam client refused the arm64 client's sign-in was checked by reading Steam's saved token with the `ConnectCache` format from [deadlock-api-ingest](https://github.com/deadlock-api/deadlock-api-ingest). x86 programs that link OpenSSL 3 under FEX use the copy in the [Steam Linux Runtime 4.0](https://gitlab.steamos.cloud/steamrt/steamrt) platform. Hooks written with `WriteProcessMemory` into code [FEX](https://github.com/FEX-Emu/FEX) has translated go through `/proc/<pid>/mem` again when the kernel refuses `process_vm_writev`, as [Wine](https://gitlab.winehq.org/wine/wine)'s `server/ptrace.c` wrote them before Wine 11. x86 Linux games under FEX get the same `/etc/asound.conf` that [pressure-vessel](https://gitlab.steamos.cloud/steamrt/steam-runtime-tools) writes into the Steam Linux Runtime, so ALSA plays through PulseAudio. Games render with [Mesa](https://gitlab.freedesktop.org/mesa/mesa) Turnip's own per-render-pass choice between tile memory and system memory, while the Steam client keeps `TU_DEBUG=sysmem`; [FEX](https://github.com/FEX-Emu/FEX)'s code disk cache was checked in its source and is already on through Proton. The proot fast path picks the guest name of a host file bound under several names in the order [PRoot](https://github.com/proot-me/proot)'s `path/binding.c` (GPL-2.0-or-later) sorts its bindings, so links and `/proc/self/fd` read back as they do through proot. The session's [PipeWire](https://gitlab.freedesktop.org/pipewire/pipewire) (MIT) opens its sockets with the per-socket access settings documented in its `module-access.c`, and [WirePlumber](https://gitlab.freedesktop.org/pipewire/wireplumber) (MIT) keeps those clients at full permissions through its `access.rules`. Wine write watches use the userfaultfd support in [Proton](https://github.com/ValveSoftware/wine)'s `dlls/ntdll/unix/virtual.c` (LGPL-2.1-or-later): libblsession gives it the arm64 syscall number and answers its `PAGEMAP_SCAN` from `/proc/self/pagemap` where Android refuses the ioctl. Wine on arm64 sets a thread's full context by raising `SIGUSR2` from `syscall_dispatcher_return_slowpath` in [Wine](https://gitlab.winehq.org/wine/wine)'s `dlls/ntdll/unix/signal_arm64.c` (LGPL-2.1-or-later); libblsession runs that handler in place on a frame laid out as the [Linux](https://github.com/torvalds/linux) kernel's `arch/arm64/kernel/signal.c` builds it and returns through `rt_sigreturn`, so proot does not stop the thread for it. Wine's process list reads each process's memory counters from `/proc/<pid>/status` in `fill_vm_counters` ([Wine](https://gitlab.winehq.org/wine/wine) `dlls/ntdll/unix/process.c`, LGPL-2.1-or-later), so libblsession gives those reads the kernel's file instead of a copy with `TracerPid` cleared. droiddeck-ntsync is checked against the object, wait and error semantics documented for the [Linux](https://github.com/torvalds/linux) ntsync driver in `Documentation/userspace-api/ntsync.rst` (GPL-2.0). See [LICENSE](LICENSE). Steam and Proton belong to Valve Corporation; this project is not affiliated with Valve.
GPL-3.0. Runtime, shim, input, and controller work build on WinNative and Bannerlator (maxjivi05). Epic Games and GOG support build on [Phobos’s](https://github.com/phobos665) adaptation of [Legendary](https://github.com/legendary-gl/legendary) and [gogdl](https://github.com/Heroic-Games-Launcher/heroic-gogdl), respectively. The registry entries a GOG game's install script (`goggame-<id>.script`) sets are read the way [Heroic Games Launcher](https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher)'s GOG setup (GPL-3.0) reads them. LSFG frame generation is from the work of Camille LaVey and the [Eden](https://eden-emu.dev) emulator project, following [lsfg-vk](https://github.com/PancakeTAS/lsfg-vk), ported to WinNative and DroidDeck by [@maxjivi05](https://github.com/maxjivi05); it needs your own copy of [Lossless Scaling](https://store.steampowered.com/app/993090/) and ships none of its shaders. x86 AppImages, and any whose own runtime cannot unpack them, are unpacked with [uruntime](https://github.com/VHSgunzo/uruntime) by VHSgunzo (MIT), shipped unmodified with its licence, which also starts the arm64 emulator AppImages whose own runtime cannot run its extractor on Android. The Steam client's audio goes through [@The412Banner](https://github.com/The412Banner)'s [DirectAudio](https://github.com/The412Banner/directaudio) PulseAudio sink (LGPL-2.1-or-later), built from `tools/directaudio/sink` with its request size kept to its ring so clients are not asked to queue 100 ms ahead. mmap ring-buffer controller input was developed by ribbit384 ([WinNative #345](https://github.com/WinNative-Emu/WinNative/pull/345)). Why the x86-64 Steam client refused the arm64 client's sign-in was checked by reading Steam's saved token with the `ConnectCache` format from [deadlock-api-ingest](https://github.com/deadlock-api/deadlock-api-ingest). x86 programs that link OpenSSL 3 under FEX use the copy in the [Steam Linux Runtime 4.0](https://gitlab.steamos.cloud/steamrt/steamrt) platform. Hooks written with `WriteProcessMemory` into code [FEX](https://github.com/FEX-Emu/FEX) has translated go through `/proc/<pid>/mem` again when the kernel refuses `process_vm_writev`, as [Wine](https://gitlab.winehq.org/wine/wine)'s `server/ptrace.c` wrote them before Wine 11. x86 Linux games under FEX get the same `/etc/asound.conf` that [pressure-vessel](https://gitlab.steamos.cloud/steamrt/steam-runtime-tools) writes into the Steam Linux Runtime, so ALSA plays through PulseAudio. Games render with [Mesa](https://gitlab.freedesktop.org/mesa/mesa) Turnip's own per-render-pass choice between tile memory and system memory, while the Steam client keeps `TU_DEBUG=sysmem`; [FEX](https://github.com/FEX-Emu/FEX)'s code disk cache was checked in its source and is already on through Proton. The proot fast path picks the guest name of a host file bound under several names in the order [PRoot](https://github.com/proot-me/proot)'s `path/binding.c` (GPL-2.0-or-later) sorts its bindings, so links and `/proc/self/fd` read back as they do through proot. The session's [PipeWire](https://gitlab.freedesktop.org/pipewire/pipewire) (MIT) opens its sockets with the per-socket access settings documented in its `module-access.c`, and [WirePlumber](https://gitlab.freedesktop.org/pipewire/wireplumber) (MIT) keeps those clients at full permissions through its `access.rules`. Wine write watches use the userfaultfd support in [Proton](https://github.com/ValveSoftware/wine)'s `dlls/ntdll/unix/virtual.c` (LGPL-2.1-or-later): libblsession gives it the arm64 syscall number and answers its `PAGEMAP_SCAN` from `/proc/self/pagemap` where Android refuses the ioctl. Wine on arm64 sets a thread's full context by raising `SIGUSR2` from `syscall_dispatcher_return_slowpath` in [Wine](https://gitlab.winehq.org/wine/wine)'s `dlls/ntdll/unix/signal_arm64.c` (LGPL-2.1-or-later); libblsession runs that handler in place on a frame laid out as the [Linux](https://github.com/torvalds/linux) kernel's `arch/arm64/kernel/signal.c` builds it and returns through `rt_sigreturn`, so proot does not stop the thread for it. Wine's process list reads each process's memory counters from `/proc/<pid>/status` in `fill_vm_counters` ([Wine](https://gitlab.winehq.org/wine/wine) `dlls/ntdll/unix/process.c`, LGPL-2.1-or-later), so libblsession gives those reads the kernel's file instead of a copy with `TracerPid` cleared. droiddeck-ntsync is checked against the object, wait and error semantics documented for the [Linux](https://github.com/torvalds/linux) ntsync driver in `Documentation/userspace-api/ntsync.rst` (GPL-2.0). Xbox games load the Windows modules of [@domsvoboda](https://github.com/domsvoboda)'s [xodus-nexus](https://github.com/domsvoboda/xodus-nexus) runtime (LGPL-2.1-or-later), including its `wintypes.dll`, whose `ApiInformation` answer Minecraft for Windows needs to start; how Minecraft installs GameInput under Wine was checked against [@Wyze3306](https://github.com/Wyze3306)'s [BedrockOnLinuLine truncated
XR glasses support builds on WinNative's VITURE glasses work. VITURE protocol details were checked against [XRLinuxDriver](https://github.com/wheaney/XRLinuxDriver) by [@wheaney](https://github.com/wheaney), including the VITURE protocol header it ships, [ar-drivers-rs](https://github.com/badicsalex/ar-drivers-rs) by [@badicsalex](https://github.com/badicsalex) and the [go-macos/iokit VITURE package](https://pkg.go.dev/github.com/go-macos/iokit/viture); the optional VITURE SDK belongs to VITURE and is not included. RayNeo support adapts [@informalTechCode](https://github.com/informalTechCode)'s [RayNeo-Air-Series-3DoF-Scaffold](https://github.com/informalTechCode/RayNeo-Air-Series-3DoF-Scaffold) (Apache-2.0) and references [@verncat](https://github.com/verncat)'s [RayNeo-Air-3S-Pro-OpenVR](https://github.com/verncat/RayNeo-Air-3S-Pro-OpenVR) (MIT) and [Monado](https://gitlab.freedesktop.org/monado/monado) (BSL-1.0); see [docs/third-party/rayneo](docs/third-party/rayneo/README.md). XREAL 1S support references [XRLinuxDriver](https://github.com/wheaney/XRLinuxDriver) and [xrealOneDeviceKit](https://github.com/wheaney/xrealOneDeviceKit) by @wheaney, [xreal_one_driver](https://github.com/rohitsangwan01/xreal_one_driver) by [@rohitsangwan01](https://github.com/rohitsangwan01) (MIT) and [xr-tools](https://github.com/0xcaff/xr-tools) by [@0xcaff](https://github.com/0xcaff). Rokid support follows the Rokid protocol notes in [ar-drivers-rs](https://github.com/badicsalex/ar-drivers-rs) and @badicsalex's [Void Computing write-ups](https://voidcomputing.hu/blog/worse-better-prettier/), and [Monado](https://gitlab.freedesktop.org/monado/monado)'s Rokid driver. The REDMAGIC glasses-display findings draw on [@mekhontsev](https://github.com/mekhontsev)'s [MagicDesk investigation](https://github.com/mekhontsev/magicdesk/blob/main/docs/xr-resolution-fix.md) and [@Coding-BR](https://github.com/Coding-BR)'s [decompiled Nubia kernel](https://github.com/Coding-BR/android_kernel_nubia_sm8850_qwjujube). VITURE, RayNeo, XREAL, Rokid and REDMAGIC are trademarks of their owners; this project is not affiliated with them.
@@ -56,3 +66,5 @@ Joy-Con VR controllers port the arm model of Google's [Google VR SDK for Unity](
Camera hand tracking runs Google's [MediaPipe](https://github.com/google-ai-edge/mediapipe) Tasks Vision library with its Pose Landmarker (Lite) model, BlazePose GHUM 3D, and its Hand Landmarker model (all Apache-2.0), on frames from AndroidX [CameraX](https://developer.android.com/jetpack/androidx/releases/camera) (Apache-2.0); MediaPipe's usage reports are switched off. The design was checked against [@F8LEFT](https://github.com/F8LEFT)'s [JoyConVr](https://github.com/F8LEFT/JoyConVr) camera app (MIT), and the short Joy-Con movements follow the accelerometer mode of the [Google VR SDK for Unity](https://github.com/googlevr/gvr-unity-sdk)'s arm model, Eric Foxlin's zero-velocity updates and Frosio, Pedersini and Borghese's accelerometer autocalibration, and the camera and Joy-Con are joined by a Kalman filter (R. E. Kalman, 1960). Bare camera hands take their gestures after [ALVR](https://github.com/alvr-org/ALVR)'s `hand_gestures.rs` (MIT) and Meta Quest's menu pinch, with distances checked on photos from the [HaGRID](https://github.com/hukenovs/hagrid) gesture set (CC BY-SA 4.0, not included), fit the palm with Horn's quaternion method (1987) and smooth it with the 1€ filter (Casiez, Roussel and Vogel, 2012); the white glove model follows Valve's OpenVR render model reference and Index controller poses, is meshed with surface nets (Gibson, 1998; Mikola Lysenko) and blends and shades it with Inigo Quilez's smooth minimum and distance-field ambient occlusion, porting his polygon distance (MIT); see [docs/third-party/handtracking](docs/third-party/handtracking/README.md).
The Store installs and runs apps with [Flatpak](https://github.com/flatpak/flatpak) (LGPL-2.1). Its sandbox goes through DroidDeck's own bubblewrap shim, which follows how Flatpak hands bwrap its environment. Chromium and Electron apps from Flathub start their browser processes through [zypak](https://github.com/refi64/zypak) by [@refi64](https://github.com/refi64) (BSD-3-Clause); its source was read to see that it always spawns them through Flatpak's spawn portal, which is why DroidDeck starts them directly without Chromium's sandbox instead.
Steam's Browse buttons open a GTK 3 file chooser through PyGObject (LGPL-2.1-or-later). It runs under Steam's own `reaper` with Steam's app ID, which [gamescope](https://github.com/ValveSoftware/gamescope) (BSD-2-Clause) reads from the process tree (`GetAppIdFromReaper` in `src/Utils/Process.cpp`) to show it over Steam.
+7
View File
@@ -29,11 +29,16 @@
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
<uses-feature android:name="android.hardware.vr.headtracking" android:version="1" android:required="false" />
<queries>
<package android:name="com.valvesoftware.steamlink" />
</queries>
<application
android:name=".App"
android:localeConfig="@xml/locales_config"
android:networkSecurityConfig="@xml/network_security_config"
android:allowBackup="false"
android:allowAudioPlaybackCapture="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme"
@@ -44,6 +49,8 @@
android:isGame="true">
<meta-data android:name="android.game_mode_config" android:resource="@xml/game_mode_config" />
<activity android:name=".lan.LocalLanActivity" android:exported="false" />
<service android:name=".lan.LocalHotspotService" android:exported="false" />
<service android:name=".glasses.LumaRgbCaptureService" android:exported="false"
android:process=":rgb_diagnostic" />
<meta-data android:name="com.oculus.supportedDevices" android:value="quest2|quest3|quest3s" />
@@ -808,10 +808,14 @@ static uint32_t nominal_refresh_ns(void) {
}
static int64_t presented_ns(int64_t render_ns) {
if (!g_tick_vsync_ns || render_ns - g_last_vsync_ns > (int64_t)nominal_refresh_ns() ||
render_ns < g_tick_vsync_ns)
int64_t tick = g_tick_vsync_ns;
int64_t refresh = (int64_t)nominal_refresh_ns();
if (!tick || render_ns - g_last_vsync_ns > refresh)
return render_ns;
return g_tick_vsync_ns;
int64_t delta = render_ns - tick;
if (delta > refresh || -delta > refresh)
return render_ns;
return tick;
}
static void feedback_present_all(struct wl_list *list, int64_t t) {
@@ -120,7 +120,7 @@ class FrontEndActivity : ComponentActivity() {
private var glThread by mutableStateOf(true)
private var noGlError by mutableStateOf(true)
private var returnAfterGame by mutableStateOf(true)
private var shaderPrecache by mutableStateOf(true)
private var shaderPrecache by mutableStateOf<Boolean?>(null)
private var steamRepairQueued by mutableStateOf(false)
private var mangoapp by mutableStateOf(true)
private var steamController by mutableStateOf(SessionPrefs.CONTROLLER_DECK)
@@ -544,12 +544,12 @@ class FrontEndActivity : ComponentActivity() {
}
startActivity(Intent(this, SessionActivity::class.java).setAction(SessionService.ACTION_RESUME)
.putExtra(SessionActivity.EXTRA_STEAMVR, steamVr)
.putExtra(SessionActivity.EXTRA_RETURN_HOME, returnHome)
.returnTo(returnHome)
.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP))
return true
}
return startSession(Intent(this, SessionActivity::class.java)
.putExtra(SessionActivity.EXTRA_RETURN_HOME, returnHome)
.returnTo(returnHome)
.apply {
if (game.gameIdString == com.droiddeck.launcher.gpu.SteamVr.APP_ID) {
putExtra(SessionActivity.EXTRA_STEAMVR, true)
@@ -560,6 +560,12 @@ class FrontEndActivity : ComponentActivity() {
}, steamSession = true)
}
private fun Intent.returnTo(returnHome: Boolean): Intent {
val task = taskId
return putExtra(SessionActivity.EXTRA_RETURN_HOME, returnHome)
.apply { if (returnHome) putExtra(SessionActivity.EXTRA_LINK_TASK, task) }
}
private fun launchWithoutSteam(game: Library.SteamGame, returnHome: Boolean): Boolean {
val app = applicationContext
Thread({
@@ -573,7 +579,7 @@ class FrontEndActivity : ComponentActivity() {
}
com.droiddeck.launcher.session.NoSteamLaunch.remember(command)
val next = Intent(this, SessionActivity::class.java)
.putExtra(SessionActivity.EXTRA_RETURN_HOME, returnHome)
.returnTo(returnHome)
.putExtra(SessionService.EXTRA_MODE, SessionService.MODE_RUN)
.putExtra(SessionService.EXTRA_PROGRAM, command.program)
.putExtra(SessionService.EXTRA_PROGRAM_ARGS, command.args.toTypedArray())
@@ -582,7 +588,7 @@ class FrontEndActivity : ComponentActivity() {
SessionState.stopRequested -> android.widget.Toast.makeText(this, R.string.game_link_session_busy, android.widget.Toast.LENGTH_LONG).show()
SessionState.mode == SessionService.MODE_RUN && SessionState.program == command.program && SessionState.programArgs == command.args ->
startActivity(Intent(this, SessionActivity::class.java).setAction(SessionService.ACTION_RESUME)
.putExtra(SessionActivity.EXTRA_RETURN_HOME, returnHome)
.returnTo(returnHome)
.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP))
else -> pendingSwitch = next
}
@@ -1727,7 +1733,7 @@ class FrontEndActivity : ComponentActivity() {
onSteamClientArch = { id ->
SessionPrefs.setSteamClientArch(this, id)
steamClientArch = id
shaderPrecache = SessionPrefs.shaderPrecache(this)
loadShaderPrecache(mode)
refresh()
},
onMangoapp = { on -> SessionPrefs.setMangoapp(this, on); mangoapp = on },
@@ -1889,6 +1895,19 @@ class FrontEndActivity : ComponentActivity() {
private var pipAutoEnter by mutableStateOf(false)
private var unfoldedControls by mutableStateOf(false)
private var unfoldedControlsWithController by mutableStateOf(false)
private var shaderPrecacheGeneration = 0
private fun loadShaderPrecache(mode: String) {
val generation = ++shaderPrecacheGeneration
shaderPrecache = null
if (mode != SessionService.MODE_STEAM) return
Thread({
val precache = SessionPrefs.shaderPrecache(this)
ui.post {
if (!isDestroyed && generation == shaderPrecacheGeneration) shaderPrecache = precache
}
}, "shader-precache").start()
}
private fun loadModeSettings(mode: String) {
pipAutoEnter = SessionPrefs.pipAutoEnter(this)
@@ -1904,7 +1923,7 @@ class FrontEndActivity : ComponentActivity() {
steamRepairQueued = SteamRepair.queued(this)
mangoapp = SessionPrefs.mangoapp(this)
returnAfterGame = SessionPrefs.returnAfterGame(this)
shaderPrecache = SessionPrefs.shaderPrecache(this)
loadShaderPrecache(mode)
steamController = SessionPrefs.steamController(this)
runSteamAtStartup = SessionPrefs.runSteamAtStartup(this)
loadBootMovie()
@@ -1926,6 +1926,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
SessionState.relaunch?.let { next ->
SessionState.relaunch = null
next.putExtra(EXTRA_RETURN_HOME, intent.getBooleanExtra(EXTRA_RETURN_HOME, false))
next.putExtra(EXTRA_LINK_TASK, intent.getIntExtra(EXTRA_LINK_TASK, -1))
setIntent(next)
recreate()
return@runOnUiThread
@@ -3027,6 +3028,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
return
}
if (this.intent.getBooleanExtra(EXTRA_RETURN_HOME, false)) intent.putExtra(EXTRA_RETURN_HOME, true)
if (!intent.hasExtra(EXTRA_LINK_TASK)) intent.putExtra(EXTRA_LINK_TASK, this.intent.getIntExtra(EXTRA_LINK_TASK, -1))
setIntent(intent)
if (intent.getBooleanExtra(EXTRA_STEAMVR, false) && SessionState.mode == SessionService.MODE_STEAM) {
SessionState.steamVr = true
@@ -3549,17 +3551,33 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
}
return
}
super.finish()
if (!closeAtOnce && intent.getBooleanExtra(EXTRA_RETURN_HOME, false)) {
com.droiddeck.launcher.ui.QuitFlood.take()
com.droiddeck.launcher.ui.LaunchOrigin.flooding = null
startActivity(Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_HOME)
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK))
}
closeLinkTasks()
if (!isTaskRoot) moveTaskToBack(true)
super.finishAndRemoveTask()
} else super.finish()
if (quitFlooded) overridePendingTransition(0, 0)
else overridePendingTransition(R.anim.session_hold, R.anim.session_sink)
}
private fun closeLinkTasks() {
val linkTask = intent.getIntExtra(EXTRA_LINK_TASK, -1)
if (linkTask == -1) return
val tasks = runCatching { getSystemService(android.app.ActivityManager::class.java)?.appTasks }.getOrNull().orEmpty()
for (task in tasks) {
runCatching {
val info = task.taskInfo
@Suppress("DEPRECATION")
val id = if (android.os.Build.VERSION.SDK_INT >= 29) info.taskId else info.persistentId
val base = info.baseIntent
if (id == linkTask && base.component?.className == FrontEndActivity::class.java.name &&
com.droiddeck.launcher.frontend.GameLaunchIntent.accepts(base.action)) task.finishAndRemoveTask()
}
}
}
private fun completeLeave() {
if (isFinishing) return
val signal = com.droiddeck.launcher.ui.Themes.current(this).signal
@@ -3571,6 +3589,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
companion object {
const val EXTRA_RETURN_HOME = "returnHome"
const val EXTRA_LINK_TASK = "linkTask"
const val EXTRA_STEAMVR = "steamVr"
const val EXTRA_REPAIR_RUNTIME = "repairRuntime"
private const val LEAVE_TIMEOUT_MS = 1_500L
@@ -1,27 +0,0 @@
package com.droiddeck.launcher.core
import com.droiddeck.launcher.gpu.GpuInfo
import com.droiddeck.launcher.gpu.SocNames
object CpuAllocationDefaults {
data class Allocation(val client: String, val game: String)
val device: Allocation? by lazy {
forDevice(SocNames.model(), GpuInfo.systemProperty("ro.board.platform"),
CpuCores.all.associateWith(CpuCores::maxGhz))
}
fun forDevice(model: String, platform: String, frequencies: Map<Int, Double?>): Allocation? {
val chip = model.trim().uppercase().substringBefore('-')
val gen2 = chip in setOf("SM8550", "QCS8550") ||
(chip.isEmpty() && platform.trim().equals("kalama", ignoreCase = true))
if (!gen2 || frequencies.size != 8 || frequencies.keys.any { it < 0 } ||
frequencies.values.any { it == null || !it.isFinite() || it <= 0.0 }) return null
val clusters = frequencies.entries.groupBy { it.value }.toSortedMap(compareBy { it ?: 0.0 }).values.toList()
if (clusters.map { it.size } != listOf(3, 4, 1)) return null
return Allocation(
client = CpuCores.format(clusters[2].map { it.key }.toSet()),
game = CpuCores.format(clusters[1].map { it.key }.toSet()),
)
}
}
@@ -152,13 +152,17 @@ object DeviceReport {
k("RAM total", FileUtils.sizeToString(mi.totalMem))
k("RAM available", FileUtils.sizeToString(mi.availMem))
}
runCatching {
val pm = context.getSystemService(Context.POWER_SERVICE) as PowerManager
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) k("Thermal status", thermalStatusName(pm.currentThermalStatus))
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
k("Thermal headroom (10 s)", pm.getThermalHeadroom(10).let { if (it.isNaN()) "not reported" else String.format(Locale.US, "%.2f", it) })
val pm = runCatching { context.getSystemService(Context.POWER_SERVICE) as? PowerManager }.getOrNull()
if (pm != null) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
k("Thermal status", runCatching { thermalStatusName(pm.currentThermalStatus) }.getOrNull())
}
k("Power saver", pm.isPowerSaveMode)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
k("Thermal headroom (10 s)", runCatching {
pm.getThermalHeadroom(10).let { if (it.isNaN()) "not reported" else String.format(Locale.US, "%.2f", it) }
}.getOrNull())
}
k("Power saver", runCatching { pm.isPowerSaveMode }.getOrNull())
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
val rate = runCatching { context.getSystemService(PerformanceHintManager::class.java)?.preferredUpdateRateNanos }.getOrNull()
@@ -387,11 +387,17 @@ object AddedGames {
}
}
private class LoginUser(val id: String, val mostRecent: Boolean, val autoLogin: Boolean, val timestamp: Long)
internal fun accountConfig(root: File): File? {
val users = runCatching { File(root, "config/loginusers.vdf").readText() }.getOrDefault("")
val recent = Regex(""""(\d{5,})"\s*\{([^}]*)\}""").findAll(users)
.lastOrNull { Regex(""""MostRecent"\s*"1"""").containsMatchIn(it.groupValues[2]) }
val account = recent?.groupValues?.get(1)?.toLongOrNull()?.let { (it - 76561197960265728L).toString() }
val recent = Regex(""""(\d{5,})"\s*\{([^}]*)\}""").findAll(users).map {
val body = it.groupValues[2]
LoginUser(it.groupValues[1], Regex(""""MostRecent"\s*"1"""").containsMatchIn(body), Regex(""""AutoLogin"\s*"1"""").containsMatchIn(body),
Regex(""""timestamp"\s*"(\d+)"""").find(body)?.groupValues?.get(1)?.toLongOrNull() ?: 0L)
}.filter { it.mostRecent || it.autoLogin || it.timestamp > 0 }.toList().asReversed()
.maxWithOrNull(compareBy<LoginUser>({ it.mostRecent }, { it.autoLogin }, { it.timestamp }))
val account = recent?.id?.toLongOrNull()?.let { (it - 76561197960265728L).toString() }
?: File(root, "userdata").list()?.filter { it.isNotEmpty() && it.all(Char::isDigit) && it != "0" }?.singleOrNull()
return account?.let { File(root, "userdata/$it/config") }
}
@@ -46,12 +46,14 @@ object Library {
1054830,
1070560,
1113280,
1161040,
1245040,
1391110,
1420170,
1493710,
1580130,
1628350,
1826330,
1887720,
2180100,
228980,
@@ -121,8 +123,9 @@ object Library {
val name = NAME.find(text)?.groupValues?.get(1)?.trim().orEmpty()
val flags = STATE.find(text)?.groupValues?.get(1)?.toIntOrNull() ?: 0
if (name.isEmpty() || flags and 4 == 0) return@forEach
val art = steamCacheImage(cache, appId, STEAM_CAPSULES)
val hero = steamCacheImage(cache, appId, STEAM_HEROES)
val images = SteamCacheImages(File(cache, appId.toString()))
val art = images.find(STEAM_CAPSULES)
val hero = images.find(STEAM_HEROES)
val lastPlayed = LAST_PLAYED.find(text)?.groupValues?.get(1)?.toLongOrNull() ?: 0L
val installDir = INSTALL_DIR.find(text)?.groupValues?.get(1)?.trim()
?.takeIf { it.isNotEmpty() && it != "." && it != ".." && '/' !in it && '\\' !in it }
@@ -131,9 +134,8 @@ object Library {
appId, name, art, label, hero = hero, lastPlayed = lastPlayed,
gameFiles = gameFiles,
protonPrefix = protonPrefix(context, appId.toLong(), library, roots),
icon = steamCacheImage(cache, appId, listOf("icon.jpg", "icon.png"))
?: File(cache, appId.toString()).listFiles()?.firstOrNull { it.isFile && STEAM_ICON.matches(it.name) },
logo = steamCacheImage(cache, appId, STEAM_LOGOS),
icon = images.icon(),
logo = images.find(STEAM_LOGOS),
))
}
}
@@ -210,13 +212,19 @@ object Library {
)
}
internal fun steamCacheImage(cache: File, appId: Int, names: List<String>): File? {
val appDir = File(cache, appId.toString())
val dirs = listOf(appDir) + appDir.listFiles()
.orEmpty().filter { it.isDirectory }.sortedBy { it.name }
return names.asSequence()
internal fun steamCacheImage(cache: File, appId: Int, names: List<String>): File? =
SteamCacheImages(File(cache, appId.toString())).find(names)
internal class SteamCacheImages(appDir: File) {
private val entries = appDir.listFiles().orEmpty()
private val dirs = listOf(appDir) + entries.filter { it.isDirectory }.sortedBy { it.name }
fun find(names: List<String>): File? = names.asSequence()
.flatMap { name -> dirs.asSequence().map { File(it, name) } }
.firstOrNull { it.isFile && it.length() > 0L }
fun icon(): File? = find(listOf("icon.jpg", "icon.png"))
?: entries.firstOrNull { it.isFile && STEAM_ICON.matches(it.name) }
}
private class Spec(val id: String, val name: String, val system: String, val program: String, val folders: List<String>, val exts: Set<String>, val atPanel: Boolean = false)
@@ -0,0 +1,127 @@
package com.droiddeck.launcher.lan
import android.Manifest
import android.app.Notification
import android.app.NotificationChannel
import android.app.NotificationManager
import android.app.PendingIntent
import android.app.Service
import android.content.Context
import android.content.Intent
import android.content.pm.PackageManager
import android.location.LocationManager
import android.net.wifi.WifiManager
import android.os.Build
import android.os.Handler
import android.os.IBinder
import android.os.Looper
import com.droiddeck.launcher.R
class LocalHotspotService : Service() {
private var reservation: WifiManager.LocalOnlyHotspotReservation? = null
private var requesting = false
private var alive = false
override fun onBind(intent: Intent?): IBinder? = null
override fun onCreate() {
super.onCreate()
alive = true
val notifications = getSystemService(NotificationManager::class.java)
notifications.createNotificationChannel(NotificationChannel(CHANNEL, getString(R.string.lan_title), NotificationManager.IMPORTANCE_LOW))
val open = PendingIntent.getActivity(this, 0, Intent(this, LocalLanActivity::class.java), PendingIntent.FLAG_IMMUTABLE)
val stop = PendingIntent.getService(this, 0, Intent(this, LocalHotspotService::class.java).setAction(STOP), PendingIntent.FLAG_IMMUTABLE)
startForeground(1842, Notification.Builder(this, CHANNEL)
.setSmallIcon(R.drawable.ic_stat_session)
.setContentTitle(getString(R.string.lan_title))
.setContentText(getString(R.string.lan_notification))
.setContentIntent(open).setOngoing(true)
.addAction(Notification.Action.Builder(null, getString(R.string.lan_stop), stop).build())
.build())
}
@Suppress("DEPRECATION")
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
if (intent?.action == STOP) {
stopSelf()
return START_NOT_STICKY
}
if (requesting || reservation != null) return START_NOT_STICKY
if (checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
fail(R.string.lan_permission_needed)
return START_NOT_STICKY
}
if (Build.VERSION.SDK_INT >= 28 && !getSystemService(LocationManager::class.java).isLocationEnabled) {
fail(R.string.lan_location_needed)
return START_NOT_STICKY
}
requesting = true
LocalLan.hotspotState.value = HotspotState(starting = true)
try {
val wifi = applicationContext.getSystemService(Context.WIFI_SERVICE) as? WifiManager
if (wifi == null) fail(R.string.lan_failed)
else wifi.startLocalOnlyHotspot(object : WifiManager.LocalOnlyHotspotCallback() {
override fun onStarted(ready: WifiManager.LocalOnlyHotspotReservation) {
if (!alive) {
ready.close()
return
}
requesting = false
reservation = ready
val ssid: String?
val password: String?
if (Build.VERSION.SDK_INT >= 30) {
ssid = ready.softApConfiguration.ssid
password = ready.softApConfiguration.passphrase
} else {
ssid = ready.wifiConfiguration?.SSID
password = ready.wifiConfiguration?.preSharedKey
}
if (ssid.isNullOrEmpty() || password.isNullOrEmpty()) fail(R.string.lan_failed)
else LocalLan.hotspotState.value = HotspotState(ssid = ssid, password = password)
}
override fun onStopped() {
if (!alive) return
LocalLan.hotspotState.value = HotspotState()
stopSelf()
}
override fun onFailed(reason: Int) {
if (alive) fail(when (reason) {
ERROR_INCOMPATIBLE_MODE -> R.string.lan_incompatible
ERROR_TETHERING_DISALLOWED -> R.string.lan_disallowed
ERROR_NO_CHANNEL -> R.string.lan_no_channel
else -> R.string.lan_failed
})
}
}, Handler(Looper.getMainLooper()))
} catch (_: SecurityException) {
fail(R.string.lan_permission_needed)
} catch (_: IllegalStateException) {
fail(R.string.lan_incompatible)
} catch (_: UnsupportedOperationException) {
fail(R.string.lan_failed)
}
return START_NOT_STICKY
}
private fun fail(message: Int) {
LocalLan.hotspotState.value = HotspotState(error = message)
stopSelf()
}
override fun onDestroy() {
alive = false
reservation?.close()
reservation = null
requesting = false
LocalLan.hotspotState.value = HotspotState(error = LocalLan.hotspot.value.error)
super.onDestroy()
}
companion object {
private const val CHANNEL = "local-lan"
private const val STOP = "com.droiddeck.launcher.lan.STOP"
}
}
@@ -0,0 +1,61 @@
package com.droiddeck.launcher.lan
import android.content.Context
import android.net.wifi.WifiManager
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.asStateFlow
import java.net.Inet4Address
import java.net.InetAddress
import java.net.NetworkInterface
import java.net.SocketException
data class LanAddress(val address: InetAddress, val prefixLength: Int)
data class LanInterface(
val name: String,
val index: Int,
val mtu: Int,
val addresses: List<LanAddress>,
)
data class HotspotState(val starting: Boolean = false, val ssid: String? = null, val password: String? = null, val error: Int? = null)
object LocalLan {
private val selection = MutableStateFlow<String?>(null)
val selected = selection.asStateFlow()
internal val hotspotState = MutableStateFlow(HotspotState())
val hotspot = hotspotState.asStateFlow()
private var multicast: WifiManager.MulticastLock? = null
@Synchronized fun select(name: String?, context: Context? = null) {
multicast?.let { if (it.isHeld) it.release() }
multicast = null
if (name != null && context != null) {
val wifi = context.applicationContext.getSystemService(Context.WIFI_SERVICE) as? WifiManager
multicast = wifi?.createMulticastLock("droiddeck-lan")?.apply {
setReferenceCounted(false)
acquire()
}
}
selection.value = name
}
fun interfaces(): List<LanInterface> = try {
NetworkInterface.getNetworkInterfaces()?.toList().orEmpty().mapNotNull { network ->
val addresses = network.interfaceAddresses.filter {
it.address is Inet4Address && usableAddress(it.address as Inet4Address, it.networkPrefixLength.toInt())
}.map { LanAddress(it.address, it.networkPrefixLength.toInt()) }
if (!network.isUp || network.isLoopback || network.isPointToPoint || addresses.isEmpty() || network.index <= 1) null
else LanInterface(network.name, network.index, network.mtu.coerceAtLeast(576), addresses)
}.sortedBy { it.name }
} catch (_: SocketException) {
emptyList()
} catch (_: SecurityException) {
emptyList()
}
internal fun usableAddress(address: Inet4Address, prefix: Int) =
(address.isSiteLocalAddress || address.isLinkLocalAddress) && prefix in 1..32
internal fun selectedInterface() = selected.value?.let { name -> interfaces().firstOrNull { it.name == name } }
}
@@ -0,0 +1,162 @@
package com.droiddeck.launcher.lan
import android.Manifest
import android.content.Context
import android.content.Intent
import android.content.pm.PackageManager
import android.os.Bundle
import android.provider.Settings
import androidx.activity.ComponentActivity
import androidx.activity.compose.rememberLauncherForActivityResult
import androidx.activity.compose.setContent
import androidx.activity.result.contract.ActivityResultContracts
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.text.selection.SelectionContainer
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.droiddeck.launcher.R
import com.droiddeck.launcher.SessionActivity
import com.droiddeck.launcher.core.AppLanguage
import com.droiddeck.launcher.session.SessionPrefs
import com.droiddeck.launcher.session.SessionService
import com.droiddeck.launcher.session.SessionState
import com.droiddeck.launcher.ui.ActionRow
import com.droiddeck.launcher.ui.DroidDeckTheme
import com.droiddeck.launcher.ui.Note
import com.droiddeck.launcher.ui.PrimaryButton
import com.droiddeck.launcher.ui.SecondaryButton
import com.droiddeck.launcher.ui.SettingsGroup
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.withContext
class LocalLanActivity : ComponentActivity() {
private var clientInstalled by mutableStateOf(false)
private var hostRunning by mutableStateOf(false)
override fun attachBaseContext(base: Context) = super.attachBaseContext(AppLanguage.wrap(base))
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
DroidDeckTheme(SessionPrefs.theme(this)) {
Surface(Modifier.fillMaxSize()) { LanSetup() }
}
}
}
override fun onResume() {
super.onResume()
clientInstalled = SteamLinkCoop.clientIntent(this) != null
hostRunning = SessionState.running && SessionState.mode == SessionService.MODE_STEAM
}
@Composable
private fun LanSetup() {
val hotspot by LocalLan.hotspot.collectAsState()
val selected by LocalLan.selected.collectAsState()
var interfaces by remember { mutableStateOf(emptyList<LanInterface>()) }
var denied by remember { mutableStateOf(false) }
val permission = rememberLauncherForActivityResult(ActivityResultContracts.RequestPermission()) { granted ->
denied = !granted
if (granted) startHotspot()
}
LaunchedEffect(Unit) {
while (true) {
interfaces = withContext(Dispatchers.IO) { LocalLan.interfaces() }
hostRunning = SessionState.running && SessionState.mode == SessionService.MODE_STEAM
delay(2000)
}
}
Column(Modifier.verticalScroll(rememberScrollState()).padding(20.dp), verticalArrangement = Arrangement.spacedBy(12.dp)) {
Text(stringResource(R.string.lan_title), style = MaterialTheme.typography.headlineSmall)
Note(stringResource(R.string.lan_experimental))
SteamLinkCoopPanel(
hostAddress = interfaces.firstOrNull { it.name == selected }?.addresses?.firstOrNull()?.address?.hostAddress,
hostRunning = hostRunning,
clientInstalled = clientInstalled,
onHost = {
if (SessionState.running && SessionState.mode == SessionService.MODE_STEAM) {
startActivity(Intent(this@LocalLanActivity, SessionActivity::class.java)
.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT))
} else finish()
},
onClient = {
if (!SteamLinkCoop.openClientOrStore(this@LocalLanActivity)) {
android.widget.Toast.makeText(this@LocalLanActivity, R.string.lan_coop_client_unavailable, android.widget.Toast.LENGTH_LONG).show()
}
},
)
SettingsGroup(stringResource(R.string.lan_wireless)) {
Column(Modifier.padding(14.dp), verticalArrangement = Arrangement.spacedBy(10.dp)) {
Text(stringResource(R.string.lan_wireless_help))
if (hotspot.ssid != null) {
SelectionContainer { Text(stringResource(R.string.lan_credentials, hotspot.ssid!!, hotspot.password.orEmpty())) }
}
if (hotspot.starting || hotspot.ssid != null) {
SecondaryButton(stringResource(R.string.lan_stop)) { stopService(Intent(this@LocalLanActivity, LocalHotspotService::class.java)) }
} else {
PrimaryButton(stringResource(R.string.lan_host)) {
denied = false
if (checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) startHotspot()
else permission.launch(Manifest.permission.ACCESS_FINE_LOCATION)
}
}
if (hotspot.starting) Text(stringResource(R.string.lan_starting))
hotspot.error?.let { Text(stringResource(it), color = MaterialTheme.colorScheme.error) }
if (denied) {
Text(stringResource(R.string.lan_permission_needed))
SecondaryButton(stringResource(R.string.lan_app_settings)) {
openSettings(Settings.ACTION_APPLICATION_DETAILS_SETTINGS, android.net.Uri.parse("package:$packageName"))
}
}
SecondaryButton(stringResource(R.string.lan_wifi_settings)) { openSettings(Settings.ACTION_WIFI_SETTINGS) }
SecondaryButton(stringResource(R.string.lan_location_settings)) { openSettings(Settings.ACTION_LOCATION_SOURCE_SETTINGS) }
}
}
SettingsGroup(stringResource(R.string.lan_wired)) {
Column(Modifier.padding(14.dp), verticalArrangement = Arrangement.spacedBy(10.dp)) {
Text(stringResource(R.string.lan_wired_help))
SecondaryButton(stringResource(R.string.lan_network_settings)) { openSettings(Settings.ACTION_WIRELESS_SETTINGS) }
}
}
SettingsGroup(stringResource(R.string.lan_interface)) {
Column(Modifier.padding(14.dp), verticalArrangement = Arrangement.spacedBy(10.dp)) {
Text(stringResource(R.string.lan_interface_help))
if (interfaces.isEmpty()) Text(stringResource(R.string.lan_no_interfaces))
if (selected != null && interfaces.none { it.name == selected }) Text(stringResource(R.string.lan_interface_lost, selected!!), color = MaterialTheme.colorScheme.error)
}
interfaces.forEach { network ->
ActionRow(network.name, network.addresses.joinToString { it.address.hostAddress.orEmpty() },
stringResource(if (selected == network.name) R.string.lan_selected else R.string.lan_use), onClick = { LocalLan.select(network.name, this@LocalLanActivity) })
}
ActionRow(stringResource(R.string.lan_default), null,
stringResource(if (selected == null) R.string.lan_selected else R.string.lan_use), onClick = { LocalLan.select(null) })
}
SecondaryButton(stringResource(R.string.common_back)) { finish() }
}
}
private fun startHotspot() = startForegroundService(Intent(this, LocalHotspotService::class.java))
private fun openSettings(action: String, data: android.net.Uri? = null) {
val intent = Intent(action, data)
if (intent.resolveActivity(packageManager) != null) startActivity(intent)
}
}
@@ -0,0 +1,31 @@
package com.droiddeck.launcher.lan
import android.content.ActivityNotFoundException
import android.content.Context
import android.content.Intent
import android.net.Uri
object SteamLinkCoop {
const val PACKAGE = "com.valvesoftware.steamlink"
private const val STORE_URL = "https://play.google.com/store/apps/details?id=$PACKAGE"
fun clientIntent(context: Context): Intent? = context.packageManager.getLaunchIntentForPackage(PACKAGE)
?: context.packageManager.getLeanbackLaunchIntentForPackage(PACKAGE)
fun openClientOrStore(context: Context): Boolean {
val choices = listOfNotNull(
clientIntent(context),
Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=$PACKAGE")),
Intent(Intent.ACTION_VIEW, Uri.parse(STORE_URL)),
)
for (intent in choices) {
try {
context.startActivity(intent)
return true
} catch (_: ActivityNotFoundException) {
} catch (_: SecurityException) {
}
}
return false
}
}
@@ -0,0 +1,40 @@
package com.droiddeck.launcher.lan
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.text.selection.SelectionContainer
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.droiddeck.launcher.R
import com.droiddeck.launcher.ui.PrimaryButton
import com.droiddeck.launcher.ui.SecondaryButton
import com.droiddeck.launcher.ui.SettingsGroup
@Composable
internal fun SteamLinkCoopPanel(
hostAddress: String?,
hostRunning: Boolean,
clientInstalled: Boolean,
onHost: () -> Unit,
onClient: () -> Unit,
) {
SettingsGroup(stringResource(R.string.lan_coop_title)) {
Column(Modifier.padding(14.dp), verticalArrangement = Arrangement.spacedBy(12.dp)) {
Text(stringResource(R.string.lan_coop_overview))
Text(stringResource(R.string.lan_coop_network))
Text(stringResource(R.string.lan_coop_host))
SecondaryButton(stringResource(if (hostRunning) R.string.lan_coop_return_host else R.string.lan_coop_open_launcher), onClick = onHost)
if (hostAddress != null) {
SelectionContainer { Text(stringResource(R.string.lan_coop_host_address, hostAddress)) }
} else Text(stringResource(R.string.lan_coop_find_host))
Text(stringResource(R.string.lan_coop_client))
PrimaryButton(stringResource(if (clientInstalled) R.string.lan_coop_open_client else R.string.lan_coop_get_client), onClick = onClient)
Text(stringResource(R.string.lan_coop_controllers))
Text(stringResource(R.string.lan_coop_offline))
}
}
}
@@ -19,6 +19,9 @@ import android.provider.Settings
import android.util.Log
import com.droiddeck.launcher.core.SessionPart
import com.droiddeck.launcher.core.WifiDiscovery
import com.droiddeck.launcher.lan.LanInterface
import com.droiddeck.launcher.lan.LanAddress
import com.droiddeck.launcher.lan.LocalLan
import java.io.File
import java.io.IOException
import java.net.Inet4Address
@@ -29,6 +32,7 @@ import org.json.JSONObject
class LinuxNetworkLinkComponent(
context: Context,
private val rootDir: File,
private val lanInterface: () -> LanInterface? = LocalLan::selectedInterface,
) : SessionPart() {
private val appContext = context.applicationContext
private val connectivity =
@@ -43,9 +47,16 @@ class LinuxNetworkLinkComponent(
private var wifiReceiver: BroadcastReceiver? = null
private var scanRequestStamp = 0L
private var lastScanRequest = -SCAN_INTERVAL_MS
private var publishedLanSelection: String? = null
private var publishedLanInterface: LanInterface? = null
@Volatile private var lastNamesAllowed = false
private val scanRequests = object : Runnable {
override fun run() {
val selection = LocalLan.selected.value
val lan = lanInterface()
synchronized(lock) {
if (selection != publishedLanSelection || lan != publishedLanInterface) write(currentProperties, currentCapabilities)
}
if (canReadWifiNames() != lastNamesAllowed) {
synchronized(lock) { writeNetworkState(currentProperties, currentCapabilities) }
requestWifiScan()
@@ -153,11 +164,16 @@ class LinuxNetworkLinkComponent(
private fun write(properties: LinkProperties?, capabilities: NetworkCapabilities?) {
val file = File(rootDir, LINK_FILE)
synchronized(lock) {
val selection = LocalLan.selected.value
val lan = lanInterface()
try {
file.parentFile?.mkdirs()
val staged = File(file.path + ".staged")
staged.writeText(describe(properties))
staged.writeText(if (selection == null) describe(properties)
else if (lan != null) describe(null, lan) else "")
if (!staged.renameTo(file)) throw IOException("Could not replace $file")
publishedLanSelection = selection
publishedLanInterface = lan
} catch (e: IOException) {
Log.w(TAG, "Could not publish the network link", e)
}
@@ -167,13 +183,18 @@ class LinuxNetworkLinkComponent(
}
@Suppress("DEPRECATION")
private fun writeNetworkState(properties: LinkProperties?, capabilities: NetworkCapabilities?) {
private fun writeNetworkState(defaultProperties: LinkProperties?, defaultCapabilities: NetworkCapabilities?) {
val selection = LocalLan.selected.value
val lan = if (selection != null) lanInterface() else null
val properties = if (selection == null) defaultProperties else null
val capabilities = if (selection == null) defaultCapabilities else null
val namesAllowed = canReadWifiNames()
lastNamesAllowed = namesAllowed
val scans = if (namesAllowed && wifiManager?.isWifiEnabled == true) {
try { wifiManager.scanResults.orEmpty() } catch (e: SecurityException) { emptyList() }
} else emptyList()
val transport = when {
lan != null -> "other"
capabilities == null -> "none"
capabilities.hasTransport(NetworkCapabilities.TRANSPORT_WIFI) -> "wifi"
capabilities.hasTransport(NetworkCapabilities.TRANSPORT_CELLULAR) -> "cellular"
@@ -183,9 +204,10 @@ class LinuxNetworkLinkComponent(
}
val state = JSONObject().apply {
put("transport", transport)
put("interface", properties?.interfaceName ?: "android")
put("mtu", properties?.mtu?.takeIf { it > 0 } ?: DEFAULT_MTU)
put("connected", properties != null && capabilities != null)
put("interface", lan?.name ?: properties?.interfaceName ?: "android")
put("mtu", lan?.mtu ?: properties?.mtu?.takeIf { it > 0 } ?: DEFAULT_MTU)
put("connected", lan != null || (properties != null && capabilities != null))
put("localLan", selection != null)
put("validated", capabilities?.hasCapability(NetworkCapabilities.NET_CAPABILITY_VALIDATED) == true)
put("captivePortal", capabilities?.hasCapability(NetworkCapabilities.NET_CAPABILITY_CAPTIVE_PORTAL) == true)
put("metered", capabilities?.let { !it.hasCapability(NetworkCapabilities.NET_CAPABILITY_NOT_METERED) })
@@ -205,7 +227,7 @@ class LinuxNetworkLinkComponent(
}
})
put("addresses", JSONArray().apply {
properties?.linkAddresses.orEmpty().forEach {
(lan?.addresses ?: properties?.linkAddresses.orEmpty().map { LanAddress(it.address, it.prefixLength) }).forEach {
put(JSONObject().put("address", it.address.hostAddress?.substringBefore('%')).put("prefix", it.prefixLength))
}
})
@@ -277,13 +299,14 @@ class LinuxNetworkLinkComponent(
}
}
private fun describe(properties: LinkProperties?): String {
val addresses = properties?.linkAddresses.orEmpty()
private fun describe(properties: LinkProperties?, lan: LanInterface? = null): String {
val addresses = (lan?.addresses ?: properties?.linkAddresses.orEmpty().map { LanAddress(it.address, it.prefixLength) })
.filter { it.address is Inet4Address || it.address is Inet6Address }
val name = properties?.interfaceName?.takeIf { addresses.isNotEmpty() } ?: OFFLINE_NAME
val mtu = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) properties?.mtu ?: 0 else 0
val name = (lan?.name ?: properties?.interfaceName)?.takeIf { addresses.isNotEmpty() } ?: OFFLINE_NAME
val mtu = lan?.mtu ?: if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) properties?.mtu ?: 0 else 0
return buildString {
append("if $name $LINK_INDEX ${if (mtu > 0) mtu else DEFAULT_MTU}\n")
append("if $name ${lan?.index ?: LINK_INDEX} ${if (mtu > 0) mtu else DEFAULT_MTU}\n")
if (lan != null) append("selected 1\n")
append("mac ${seededMac()}\n")
if (addresses.isEmpty()) {
append("addr $OFFLINE_ADDRESS\n")
@@ -110,6 +110,11 @@ public final class LinuxRuntime {
File root = rootDir(context);
List<String> binds = binds(context, sessionRoot, runtimeDir, externalStorage, extraBinds);
if (sessionRoot != null) lastBinds = binds;
return commandWithBinds(context, root, binds, guestCommand);
}
public static List<String> commandWithBinds(Context context, File root, List<String> binds,
List<String> guestCommand) {
List<String> cmd = prootPrefix(context, root, "/root");
for (String spec : binds) bind(cmd, spec);
cmd.addAll(guestCommand);
@@ -51,7 +51,7 @@ object BootMovie {
SessionPrefs.setBootMovieApplyNext(context, true)
BootMovieReport.note(context, "picked $id here; Steam names ${SessionFiles.startupMoviePath(BootMovieLibrary.steamConfig(context))}")
// Whatever Steam names right now is about to be replaced, so it is not a pick to adopt later.
SessionFiles.startupMoviePath(BootMovieLibrary.steamConfig(context))?.let { SessionPrefs.setBootMovieSteamSeen(context, it) }
SessionFiles.startupMovieLocalPath(BootMovieLibrary.steamConfig(context))?.let { SessionPrefs.setBootMovieSteamSeen(context, it) }
}
fun customName(context: Context): String? =
@@ -167,10 +167,12 @@ object BootMovie {
* that movie becomes the choice here. Steam already plays it, so nothing is staged over it. True when the choice changed.
*/
fun syncFromSteam(context: Context): Boolean {
val path = SessionFiles.startupMoviePath(BootMovieLibrary.steamConfig(context)) ?: return false
if (path == SessionPrefs.bootMovieSteamSeen(context)) return false
SessionPrefs.setBootMovieSteamSeen(context, path)
if (path == SessionFiles.BOOT_MOVIE_PATH) return false
val named = SessionFiles.startupMovieLocalPath(BootMovieLibrary.steamConfig(context)) ?: return false
val seen = SessionPrefs.bootMovieSteamSeen(context)
if (named == seen) return false
SessionPrefs.setBootMovieSteamSeen(context, named)
if (named == SessionFiles.BOOT_MOVIE_PATH || (named.isEmpty() && seen == null)) return false
val path = named.ifEmpty { "/movies/steam_os_startup.webm" }
val prefix = "/uioverrides/movies/"
// The list names a bought movie from the Steam folder (/config/communityitemscache/...), Steam's config from its config folder.
val id = if (path.startsWith(prefix)) BootMovieLibrary.idOf(path.removePrefix(prefix)) else {
@@ -79,8 +79,9 @@ object BootMovieLibrary {
return customMovieDirs(context).map { File(it, name) }.firstOrNull { it.isFile && it.length() > 0L }
}
private fun isMovie(file: File) = file.isFile && file.length() > 0L && file.name.endsWith(".webm", ignoreCase = true) &&
file.name !in STAGED && !file.name.startsWith(".")
private fun isMovie(file: File) = isWebm(file) && file.name !in STAGED
private fun isWebm(file: File) = file.isFile && file.length() > 0L && file.name.endsWith(".webm", ignoreCase = true) && !file.name.startsWith(".")
private fun readMeta(context: Context): JSONObject =
runCatching { JSONObject(metaFile(context).readText()) }.getOrDefault(JSONObject())
@@ -136,7 +137,7 @@ object BootMovieLibrary {
}
val bought = HashMap<String, String>()
for (root in steamRoots(context)) {
File(root, "steamui/movies").listFiles { f -> isMovie(f) && f.nameWithoutExtension.lowercase() in NATIVE }.orEmpty()
File(root, "steamui/movies").listFiles { f -> isWebm(f) && f.nameWithoutExtension.lowercase() in NATIVE }.orEmpty()
.sortedBy { it.name.lowercase() }.forEach { steam.putIfAbsent(STEAM_PREFIX + "/movies/" + it.name, it) }
val scan = pointShopMovies(root)
bought.putAll(scan.titles)
@@ -144,8 +145,8 @@ object BootMovieLibrary {
}
val seen = HashSet<String>()
for ((id, file) in steam) {
if (file.name in STAGED || !seen.add(file.canonicalPath)) continue
val native = file.nameWithoutExtension.lowercase() in NATIVE
if ((file.name in STAGED && !native) || !seen.add(file.canonicalPath)) continue
// Steam names a bought movie by an item number and a hash; the points shop's own title is shown when Steam has it.
val title = if (native) NATIVE[file.nameWithoutExtension.lowercase()] ?: file.nameWithoutExtension else bought[file.path] ?: boughtId(file)?.let { "#$it" } ?: file.nameWithoutExtension
out.add(Entry(id, title, if (native) SOURCE_STEAM else SOURCE_POINTSHOP, file, removable = false))
@@ -153,8 +154,11 @@ object BootMovieLibrary {
return out
}
/** The three startup movies Steam ships with; Steam's movies folder holds many more videos that are not startup movies. */
private val NATIVE = mapOf("deck_startup" to "Deck startup", "oled_startup" to "Oled startup", "startup_machine" to "Machine startup")
/** The four startup movies Steam ships with; Steam's movies folder holds many more videos that are not startup movies. */
private val NATIVE = mapOf(
"deck_startup" to "Deck startup", "oled_startup" to "Oled startup", "startup_machine" to "Machine startup",
"steam_os_startup" to "SteamOS startup",
)
private val skippedFolders = setOf("uioverrides", "steamapps", "librarycache", "httpcache", "logs", "compatdata", "shadercache")
@@ -721,13 +721,19 @@ object ComponentsManager {
class StoredOriginal(val protonId: String, val protonName: String?, val comp: String, val protonVersion: String, val size: Long, val kept: Boolean)
class Stored(val packages: List<StoredPackage>, val originals: List<StoredOriginal>)
private fun packagesInUse(state: JSONObject): Set<String> {
internal fun liveSelection(key: String, entry: JSONObject, proton: Proton?): Boolean =
proton != null && (key == "queued" || entry.optString("protonVersion") == proton.version)
private fun packagesInUse(state: JSONObject, installed: Map<String, Proton>): Set<String> {
val names = HashSet<String>()
for (key in listOf("active", "queued")) {
val byProton = state.optJSONObject(key) ?: continue
for (pid in byProton.keys()) {
val comps = byProton.optJSONObject(pid) ?: continue
for (comp in comps.keys()) comps.optJSONObject(comp)?.optString("file")?.takeIf { it.isNotEmpty() }?.let(names::add)
for (comp in comps.keys()) {
val entry = comps.optJSONObject(comp) ?: continue
if (liveSelection(key, entry, installed[pid])) entry.optString("file").takeIf { it.isNotEmpty() }?.let(names::add)
}
}
}
val profiles = state.optJSONObject("profiles")
@@ -747,8 +753,8 @@ object ComponentsManager {
fun stored(context: Context): Stored = synchronized(lock) {
val state = loadState(context)
val used = packagesInUse(state)
val installed = protons(context).associateBy { it.id }
val installed = protons(context).distinctBy { it.id }.associateBy { it.id }
val used = packagesInUse(state, installed)
val originals = originalsDir(context).listFiles()?.filter { it.isDirectory }?.flatMap { proton ->
proton.listFiles()?.filter { it.isDirectory }?.flatMap { version ->
COMPONENTS.mapNotNull { comp ->
@@ -774,27 +780,50 @@ object ComponentsManager {
true
}
fun forgetProton(context: Context, dirName: String) {
synchronized(lock) {
val id = safeName(dirName)
if (protons(context).any { it.id == id }) return
val state = loadState(context)
val selected = listOf("active", "queued").map { state.sub(it).remove(id) != null }.any { it }
if (selected && runCatching { saveState(context, state) }.onFailure { Log.w(TAG, "forget $id", it) }.isFailure) return
File(originalsDir(context), id).deleteRecursively()
}
}
fun deletePackage(context: Context, file: String): String = synchronized(lock) {
val name = safeName(file)
val state = loadState(context)
val queued = state.sub("queued")
for (pid in queued.keys()) {
val comps = queued.optJSONObject(pid) ?: continue
for (comp in comps.keys()) check(comps.optJSONObject(comp)?.optString("file") != name) { context.getString(R.string.cmgr_package_in_use, name, pid) }
}
val active = state.sub("active")
for (pid in active.keys()) {
val comps = active.optJSONObject(pid) ?: continue
for (comp in comps.keys()) check(comps.optJSONObject(comp)?.optString("file") != name) { context.getString(R.string.cmgr_package_in_use, name, pid) }
}
val profiles = state.sub("profiles")
for (scope in profiles.keys()) {
val profile = profiles.optJSONObject(scope) ?: continue
check(COMPONENTS.none { profile.optString(it) == name }) { context.getString(R.string.cmgr_package_in_use, name, scope) }
val installed = protons(context).distinctBy { it.id }.associateBy { it.id }
var changed = false
for (key in listOf("queued", "active")) {
val byProton = state.sub(key)
for (pid in byProton.keys().asSequence().toList()) {
val comps = byProton.optJSONObject(pid) ?: continue
for (comp in comps.keys().asSequence().toList()) {
val entry = comps.optJSONObject(comp) ?: continue
if (entry.optString("file") != name) continue
check(!liveSelection(key, entry, installed[pid])) { context.getString(R.string.cmgr_package_in_use, name, installed[pid]?.name ?: pid) }
comps.remove(comp)
changed = true
}
if (comps.length() == 0) byProton.remove(pid)
}
}
val f = File(packagesDir(context), name)
check(f.isFile) { context.getString(R.string.cmgr_package_not_stored, name) }
f.delete()
val profiles = state.sub("profiles")
for (scope in profiles.keys().asSequence().toList()) {
val profile = profiles.optJSONObject(scope) ?: continue
for (comp in COMPONENTS.filter { profile.optString(it) == name }) {
rememberProfiledComponent(state, comp)
profile.remove(comp)
changed = true
}
if (profile.length() == 0) profiles.remove(scope)
}
check(f.delete()) { name }
if (changed) saveState(context, state)
context.getString(R.string.cmgr_deleted, name)
}
@@ -87,11 +87,10 @@ class LoadingState(context: Context, private val steam: Boolean = true) {
if (line.startsWith("== STEP ")) {
stepAt = at
stepText = line.substringAfter("== STEP ").substringAfter(' ')
val m = INSTALL_COUNT.find(line)
if (m != null) {
clientDownload(line)?.let { (what, percent) ->
clientDownloadAt = at
clientDownload = m.groupValues[1]
clientPercent = m.groupValues[2].toInt() * 100 / maxOf(1, m.groupValues[3].toInt())
clientDownload = what
clientPercent = percent
}
} else {
val m = UPDATE_PROGRESS.find(line)
@@ -132,6 +131,19 @@ class LoadingState(context: Context, private val steam: Boolean = true) {
}
}
internal fun clientDownload(line: String): Pair<String, Int>? {
val count = INSTALL_COUNT.find(line) ?: return null
val mb = INSTALL_MEGABYTES.find(line.substring(count.range.last + 1))
val done = mb?.groupValues?.get(1)?.toLongOrNull()
val total = mb?.groupValues?.get(2)?.toLongOrNull()
if (done != null && total != null && total > 0) {
return "$done / $total MB" to (done * 100 / total).toInt().coerceIn(0, 100)
}
val part = count.groupValues[2].toIntOrNull() ?: return null
val all = count.groupValues[3].toIntOrNull() ?: return null
return count.groupValues[1] to (part.toLong() * 100 / maxOf(1, all)).coerceIn(0L, 100L).toInt()
}
internal fun readableScriptStep(scriptStep: String): Boolean {
val t = scriptStep.lowercase()
return t.startsWith("download") || t.startsWith("checking the linux") || t.startsWith("unpacking") || t.startsWith("installing")
@@ -140,5 +152,6 @@ class LoadingState(context: Context, private val steam: Boolean = true) {
private const val TAIL_BYTES = 48L * 1024
private val UPDATE_PROGRESS = Regex("""Downloading update \((\d+) of (\d+) KB\)""")
private val INSTALL_COUNT = Regex("""downloading Steam: (\S+) \((\d+)/(\d+)\)""")
private val INSTALL_MEGABYTES = Regex("""^, (\d+) of (\d+) MB""")
}
}
@@ -136,11 +136,13 @@ object ProtonExtras {
fun remove(context: Context, tool: Tool, dir: String? = null) {
val name = if (dir != null) dir.takeIf { it in installedAll(context, tool) } ?: return else installed(context, tool) ?: return
File(toolsDir(context), name).deleteRecursively()
if (File(toolsDir(context), name).deleteRecursively()) ComponentsManager.forgetProton(context, name)
}
fun removeOlder(context: Context, tool: Tool) {
installedAll(context, tool).dropLast(1).forEach { File(toolsDir(context), it).deleteRecursively() }
installedAll(context, tool).dropLast(1).forEach {
if (File(toolsDir(context), it).deleteRecursively()) ComponentsManager.forgetProton(context, it)
}
}
@Synchronized
@@ -200,22 +200,86 @@ object SessionArtifacts {
internal fun recordedClient(dir: File): String? =
runCatching { File(dir, CLIENT_FILE).readText().trim() }.getOrNull()?.takeIf { it == "arm64" || it == "x86_64" }
private const val LOG_MARKS = "steam-log-marks.txt"
private const val MAX_STEAM_LOG = 8L * 1024 * 1024
private const val HEAD = 4096L
private class Mark(val size: Long, val head: String)
fun markSteamLogs(dir: File, logs: File) {
val lines = logs.listFiles { f -> f.isFile }?.mapNotNull { f ->
val size = f.length()
head(f, size)?.let { "$size\t$it\t${f.name}" }
} ?: return
runCatching { File(dir, LOG_MARKS).writeText(lines.joinToString("") { "$it\n" }) }
}
private fun head(f: File, length: Long): String? = runCatching {
val buf = ByteArray(minOf(length, HEAD).toInt())
f.inputStream().use { input ->
var off = 0
while (off < buf.size) {
val n = input.read(buf, off, buf.size - off)
if (n < 0) return@runCatching null
off += n
}
}
java.security.MessageDigest.getInstance("SHA-1").digest(buf).joinToString("") { "%02x".format(it) }
}.getOrNull()
private fun steamLogMarks(dir: File): List<Mark>? = runCatching {
File(dir, LOG_MARKS).readLines().mapNotNull { line ->
val parts = line.split('\t', limit = 3)
parts.getOrNull(0)?.toLongOrNull()?.let { size -> parts.getOrNull(1)?.let { Mark(size, it) } }
}
}.getOrNull()
private fun startOf(src: File, size: Long, marks: List<Mark>): Long {
val heads = HashMap<Long, String?>()
return marks.filter { it.size <= size }.sortedByDescending { it.size }
.firstOrNull { m -> heads.getOrPut(minOf(m.size, HEAD)) { head(src, m.size) } == m.head }?.size ?: 0L
}
private fun copySteamLogs(context: Context, dir: File, record: Record, steamArch: String? = null) {
val logs = File(steamArch?.let { SessionPrefs.steamRoot(context, it) } ?: SessionPrefs.activeSteamRoot(context), "logs")
if (!logs.isDirectory) return
val out = File(dir, "steam").apply { mkdirs() }
logs.listFiles { f -> f.isFile && f.length() < 8L * 1024 * 1024 }?.forEach { src ->
copySessionLogs(logs, dir, out).forEach { dst -> record.files[dst] = Scrubbed(dst.length(), dst.lastModified()) }
Log.i(TAG, "collected ${out.listFiles()?.size ?: 0} Steam log(s), scrubbed, into $out")
}
internal fun copySessionLogs(logs: File, dir: File, out: File): List<File> {
val marks = steamLogMarks(dir)
val copied = ArrayList<File>()
logs.listFiles { f -> f.isFile }?.forEach { src ->
val size = src.length()
val from = marks?.let { startOf(src, size, it) } ?: 0L
if (marks != null && from == size || size - from >= MAX_STEAM_LOG) return@forEach
try {
val dst = File(out, src.name)
dst.bufferedWriter().use { w ->
src.forEachLine { line -> w.write(LogRedactor.redact(line)); w.newLine() }
src.inputStream().buffered().use { input ->
var left = if (from > 0) from - 1 else 0L
while (left > 0) {
val skipped = input.skip(left)
if (skipped <= 0) break
left -= skipped
}
if (from > 0 && input.read() != '\n'.code) {
while (true) {
val c = input.read()
if (c < 0 || c == '\n'.code) break
}
}
dst.bufferedWriter().use { w ->
input.bufferedReader().forEachLine { line -> w.write(LogRedactor.redact(line)); w.newLine() }
}
}
record.files[dst] = Scrubbed(dst.length(), dst.lastModified())
copied.add(dst)
} catch (e: Exception) {
Log.w(TAG, "could not scrub ${src.name}", e)
}
}
Log.i(TAG, "collected ${out.listFiles()?.size ?: 0} Steam log(s), scrubbed, into $out")
return copied
}
@Synchronized
@@ -390,10 +390,12 @@ object SessionFiles {
private fun activeStartupMovie(text: String): VdfBlock? = customizationMovie(text) ?: olderMovie(text)
/** The movie Steam's config selects, as a path like `/uioverrides/movies/x.webm`; null when none is named. */
internal fun startupMoviePath(config: File): String? {
internal fun startupMoviePath(config: File): String? = startupMovieLocalPath(config)?.takeIf { it.isNotEmpty() }
internal fun startupMovieLocalPath(config: File): String? {
val text = runCatching { config.readText() }.getOrNull() ?: return null
val movie = activeStartupMovie(text) ?: return null
return scalar(text.substring(movie.keyStart, movie.close + 1), "LocalPath")?.takeIf { it.isNotEmpty() }
return scalar(text.substring(movie.keyStart, movie.close + 1), "LocalPath")
}
/** Both `StartupMovie` sections of Steam's config as written there, for the report; null when there is none. */
@@ -4,7 +4,6 @@ import android.content.Context
import android.content.pm.ActivityInfo
import androidx.annotation.StringRes
import com.droiddeck.launcher.R
import com.droiddeck.launcher.core.CpuAllocationDefaults
import com.droiddeck.launcher.core.GameEnvironment
import com.droiddeck.launcher.core.TextureFiltering
import com.droiddeck.launcher.gpu.Cardboard
@@ -382,30 +381,19 @@ object SessionPrefs {
prefs(context).edit().putBoolean("wifiDiscoveryAsked", true).apply()
}
internal data class CoreAllocation(val clientOverride: Boolean, val clientCpus: String, val gameCpus: String)
internal fun coreAllocation(context: Context, defaults: CpuAllocationDefaults.Allocation? = CpuAllocationDefaults.device): CoreAllocation {
val saved = prefs(context)
return CoreAllocation(
saved.getBoolean("clientCpusOverride", defaults != null && !saved.contains("clientCpus")),
saved.getString("clientCpus", defaults?.client.orEmpty()).orEmpty(),
saved.getString("gameCpus", defaults?.game.orEmpty()).orEmpty(),
)
}
fun clientCpusOverride(context: Context): Boolean = coreAllocation(context).clientOverride
fun clientCpusOverride(context: Context): Boolean = prefs(context).getBoolean("clientCpusOverride", false)
fun setClientCpusOverride(context: Context, on: Boolean) {
prefs(context).edit().putBoolean("clientCpusOverride", on).apply()
}
fun clientCpus(context: Context): String = coreAllocation(context).clientCpus
fun clientCpus(context: Context): String = prefs(context).getString("clientCpus", "").orEmpty()
fun setClientCpus(context: Context, list: String) {
prefs(context).edit().putString("clientCpus", list).apply()
}
fun gameCpus(context: Context): String = coreAllocation(context).gameCpus
fun gameCpus(context: Context): String = prefs(context).getString("gameCpus", "").orEmpty()
fun setGameCpus(context: Context, list: String) {
prefs(context).edit().putString("gameCpus", list).apply()
@@ -71,6 +71,7 @@ class SessionService : Service() {
private val steamDownloadMonitor = SteamDownloadMonitor()
private var downloadMonitorTask: Runnable? = null
private var downloadActive = false
private var clientInstallActive = false
@Volatile private var steamLibraryMounts = emptyMap<String, File>()
private var suspendDownloadNow = false
private var suspendPolicy = SessionPrefs.SUSPEND_MANUAL
@@ -321,6 +322,7 @@ class SessionService : Service() {
suspendDownloadNow = false
steamDownloadMonitor.reset()
downloadActive = false
clientInstallActive = false
steamSleepToken = null
completeNativeSleep()
suspendOperationPending = false
@@ -640,8 +642,8 @@ class SessionService : Service() {
}
},
)
mainHandler.post { updateSuspendPolicy() }
updateDownloadMonitoring()
mainHandler.post { updateSuspendPolicy() }
}
}
@@ -708,7 +710,10 @@ class SessionService : Service() {
SessionState.steamClientArch = if (steamHere) SessionPrefs.steamClientArch(this) else null
SessionState.steamClientArch?.let { arch ->
guest.add("BL_STEAM_CLIENT_ARCH=$arch")
SessionPaths.current()?.let { SessionArtifacts.recordClient(it, arch) }
SessionPaths.current()?.let {
SessionArtifacts.recordClient(it, arch)
SessionArtifacts.markSteamLogs(it, File(SessionPrefs.steamRoot(this, arch), "logs"))
}
if (arch == "x86_64") FexCatalog.cached(this)?.let { guest.addAll(FexCatalog.environment(it)) }
}
if (SessionState.mode == MODE_STEAM) {
@@ -1413,8 +1418,7 @@ class SessionService : Service() {
private fun updateSuspendPolicy() {
if (!SessionState.running) return
val hidden = !hasVisibleSurface
val downloadsBlockingSuspend = steamDownloadsInBackground && SessionState.mode == MODE_STEAM &&
suspendPolicy != SessionPrefs.SUSPEND_NEVER && hidden && downloadActive && !suspendDownloadNow
val downloadsBlockingSuspend = downloadsKeepAwake() && hidden && !suspendDownloadNow
if (suspendPolicy == SessionPrefs.SUSPEND_MANUAL && hidden && !downloadsBlockingSuspend) {
manualPauseRequested = true
} else if (!hidden && !SessionState.suspended) {
@@ -1828,8 +1832,7 @@ class SessionService : Service() {
.setContentText(getString(
when {
SessionState.suspended -> R.string.session_notification_paused
downloadActive && steamDownloadsInBackground &&
suspendPolicy != SessionPrefs.SUSPEND_NEVER -> R.string.session_notification_downloads
downloadsKeepAwake() -> R.string.session_notification_downloads
else -> R.string.session_notification
}
))
@@ -1837,8 +1840,7 @@ class SessionService : Service() {
.apply {
if (SessionState.suspended) {
addAction(Notification.Action.Builder(null, getString(R.string.resume_session), resume).build())
} else if (downloadActive && steamDownloadsInBackground &&
suspendPolicy != SessionPrefs.SUSPEND_NEVER) {
} else if (downloadsKeepAwake()) {
val suspend = PendingIntent.getService(
this@SessionService, 3,
Intent(this@SessionService, SessionService::class.java).setAction(ACTION_SUSPEND_NOW),
@@ -1858,33 +1860,50 @@ class SessionService : Service() {
getSystemService(NotificationManager::class.java)?.notify(NOTIFICATION_ID, buildNotification())
}
private fun downloadsKeepAwake(): Boolean =
downloadActive && (steamDownloadsInBackground || clientInstallActive) &&
SessionState.mode == MODE_STEAM && suspendPolicy != SessionPrefs.SUSPEND_NEVER
private fun downloadWatchWanted(): Boolean =
SessionState.running && SessionState.mode == MODE_STEAM && suspendPolicy != SessionPrefs.SUSPEND_NEVER &&
(steamDownloadsInBackground || !SessionState.firstFrameSeen)
private fun updateDownloadMonitoring() {
val enabled = SessionState.running && SessionState.mode == MODE_STEAM &&
steamDownloadsInBackground && suspendPolicy != SessionPrefs.SUSPEND_NEVER
if (!enabled) {
if (!downloadWatchWanted()) {
val wasActive = downloadActive
downloadMonitorTask?.let(mainHandler::removeCallbacks)
downloadMonitorTask = null
steamDownloadMonitor.reset()
downloadActive = false
if (clientInstallActive) SessionEvents.record("steam.client_download", mapOf("active" to false))
clientInstallActive = false
if (wasActive) refreshNotification()
return
}
if (downloadMonitorTask != null) return
val poll = object : Runnable {
override fun run() {
if (downloadMonitorTask !== this || !SessionState.running ||
SessionState.mode != MODE_STEAM || !steamDownloadsInBackground ||
suspendPolicy == SessionPrefs.SUSPEND_NEVER) {
if (downloadMonitorTask !== this) return
if (!downloadWatchWanted()) {
downloadMonitorTask = null
updateDownloadMonitoring()
updateSuspendPolicy()
return
}
val root = LinuxRuntime.rootDir(this@SessionService)
val wasActive = downloadActive
downloadActive = steamDownloadMonitor.poll(
LinuxRuntime.rootDir(this@SessionService),
val wasInstalling = clientInstallActive
clientInstallActive = !SessionState.firstFrameSeen &&
(clientInstallActive || SteamDownloadMonitor.clientInstallPending(root))
downloadActive = clientInstallActive || steamDownloadsInBackground && steamDownloadMonitor.poll(
root,
receivedBytes = TrafficStats.getUidRxBytes(android.os.Process.myUid()),
client = SessionState.steamClientArch,
mounts = steamLibraryMounts,
)
if (wasInstalling != clientInstallActive) {
SessionEvents.record("steam.client_download", mapOf("active" to clientInstallActive))
}
if (wasActive != downloadActive) refreshNotification()
updateSuspendPolicy()
mainHandler.postDelayed(this, DOWNLOAD_POLL_MS)
@@ -1,7 +1,7 @@
package com.droiddeck.launcher.session
import java.io.File
import java.io.RandomAccessFile
import java.io.FileInputStream
internal class SteamDownloadMonitor {
private data class ManifestState(
@@ -63,16 +63,17 @@ internal class SteamDownloadMonitor {
lastContentActivityAt = 0L
}
runCatching {
RandomAccessFile(log, "r").use { input ->
input.seek(contentLogOffset)
FileInputStream(log).use { input ->
input.channel.position(contentLogOffset)
val reader = input.bufferedReader(Charsets.ISO_8859_1)
while (true) {
val line = input.readLine() ?: break
val line = reader.readLine() ?: break
when {
"Client version:" in line -> {
activeContentUpdates.clear()
lastContentActivityAt = 0L
}
CONTENT_UPDATE.find(line)?.let { match ->
" update changed : " in line && CONTENT_UPDATE.find(line)?.let { match ->
val appId = match.groupValues[1]
val updateType = match.groupValues[2]
val state = match.groupValues[3]
@@ -85,14 +86,15 @@ internal class SteamDownloadMonitor {
}
true
} == true -> Unit
CURRENT_RATE.find(line)?.groupValues?.get(1)?.toDoubleOrNull()?.let { it > 0.0 } == true ->
"Current download rate: " in line &&
CURRENT_RATE.find(line)?.groupValues?.get(1)?.toDoubleOrNull()?.let { it > 0.0 } == true ->
lastContentActivityAt = now
"Downloading " in line && " chunks for depot " in line ->
lastContentActivityAt = now
}
if (activeContentUpdates.isNotEmpty()) lastContentActivityAt = now
}
contentLogOffset = input.filePointer
contentLogOffset = input.channel.position()
}
}
return activeContentUpdates.isNotEmpty() && lastContentActivityAt > 0L &&
@@ -138,13 +140,21 @@ internal class SteamDownloadMonitor {
private fun value(text: String, key: String): String? =
Regex("\"$key\"\\s+\"([^\"]*)\"").find(text)?.groupValues?.get(1)
private companion object {
const val MANIFEST_PROGRESS_GRACE_MS = 8_000L
const val CONTENT_ACTIVITY_GRACE_MS = 90_000L
const val MIN_RECEIVE_BYTES_PER_SEC = 64L * 1024L
val PATH = Regex("\"path\"\\s+\"([^\"]+)\"")
val STEAM_HOMES = listOf("root/.local/share/Steam", "root/.droiddeck-x64/.local/share/Steam")
val CONTENT_UPDATE = Regex("""AppID (\d+) (App|Workshop|Shader) update changed : (.*)""")
val CURRENT_RATE = Regex("""Current download rate: ([\d.]+) Mbps""")
companion object {
fun clientInstallPending(runtimeRoot: File): Boolean {
val home = File(runtimeRoot, "root")
val steam = File(home, ".local/share/Steam")
val stamped = File(steam, "package/droiddeck-installed").isFile ||
File(steam, "package/bannerlator-installed").isFile
return !(stamped && File(steam, "steamrtarm64/steam").isFile) || File(home, ".bl-steam-repair").exists()
}
private const val MANIFEST_PROGRESS_GRACE_MS = 8_000L
private const val CONTENT_ACTIVITY_GRACE_MS = 90_000L
private const val MIN_RECEIVE_BYTES_PER_SEC = 64L * 1024L
private val PATH = Regex("\"path\"\\s+\"([^\"]+)\"")
private val STEAM_HOMES = listOf("root/.local/share/Steam", "root/.droiddeck-x64/.local/share/Steam")
private val CONTENT_UPDATE = Regex("""AppID (\d+) (App|Workshop|Shader) update changed : (.*)""")
private val CURRENT_RATE = Regex("""Current download rate: ([\d.]+) Mbps""")
}
}
@@ -104,6 +104,29 @@ object StoreInstallRoot {
.map { it to guestFor(context, it) }
}
/** Xodus has its own PRoot mount table and cannot see the selected Steam library's SD bind. */
fun externalRootsForXodus(context: Context): List<Pair<File, String>> {
val roots = externalRoots(context).toMutableList()
val selectedLibrary = GameStorage.effective(context)?.let { File(it.path, ON_VOLUME) }
?.takeUnless { isInternal(context, it) }
if (selectedLibrary != null && roots.none { it.first.absolutePath == selectedLibrary.absolutePath }) {
roots += selectedLibrary to guestFor(context, selectedLibrary)
}
return roots
}
fun externalBindSpecs(context: Context): List<String> = externalBindSpecs(externalRoots(context), LinuxRuntime.rootDir(context))
fun externalBindSpecsForXodus(context: Context): List<String> =
externalBindSpecs(externalRootsForXodus(context), LinuxRuntime.rootDir(context))
internal fun externalBindSpecs(roots: List<Pair<File, String>>, guestRoot: File): List<String> =
roots.mapNotNull { (host, guest) ->
if (!host.isDirectory || !host.canRead()) return@mapNotNull null
val target = File(guestRoot, guest.removePrefix("/"))
if (target.isDirectory || target.mkdirs()) "${host.path}:$guest" else null
}
private fun guestFor(context: Context, root: File): String {
val sm = context.getSystemService(StorageManager::class.java)
val uuid = runCatching { sm?.getStorageVolume(root)?.uuid }.getOrNull()?.takeIf { it.isNotBlank() }?.replace(Regex("[^A-Za-z0-9-]"), "")
@@ -114,11 +137,21 @@ object StoreInstallRoot {
fun isInternal(context: Context, root: File): Boolean = root.absolutePath == internalRoot(context).absolutePath
fun externalGuestPath(context: Context, host: File): String? {
return externalGuestPath(host, externalRoots(context))
}
fun guestPath(context: Context, host: File): String = externalGuestPath(context, host) ?: host.path
fun guestPathForXodus(context: Context, host: File): String =
externalGuestPath(host, externalRootsForXodus(context)) ?: host.path
internal fun externalGuestPath(host: File, roots: List<Pair<File, String>>): String? {
val path = host.absolutePath
for ((root, guest) in externalRoots(context)) {
val dir = root.absolutePath
for ((root, guest) in roots.sortedByDescending { it.first.absolutePath.length }) {
val dir = root.absolutePath.trimEnd(File.separatorChar)
if (path == dir) return guest
if (path.startsWith("$dir/")) return guest + "/" + path.removePrefix("$dir/")
val prefix = dir + File.separator
if (path.startsWith(prefix)) return guest + "/" + path.removePrefix(prefix).replace(File.separatorChar, '/')
}
return null
}
@@ -126,7 +126,9 @@ object StoresState {
fun installedGame(store: Store, id: String): InstalledStoreGame? = installed.firstOrNull { it.sidecar.store == store && it.sidecar.id == id }
fun detailItem(store: Store, id: String): CatalogItem? = detailCatalogItem(
store, id, library[store].orEmpty(), found[store].orEmpty(), shelves[store],
store, id, library[store].orEmpty(),
found[store].orEmpty() + if (store == Store.ITCH) com.droiddeck.launcher.stores.itch.ItchBrowseState.items else emptyList(),
shelves[store],
)
fun open(context: Context, store: Store, force: Boolean = false) {
@@ -251,7 +251,7 @@ internal object EpicClientLibrary {
SessionPrefs.addedGameStoredAppId(app, oldFolder.path)?.let { SteamLiveShortcuts.remove(app, it) }
changed = true
}
val next = StoreGameSidecar(
val next = withLaunchArgs(StoreGameSidecar(
Store.EPIC, appName, item.optString("DisplayName").ifEmpty { appName }, exe,
installVersion = item.optString("AppVersionString"), installedAt = existing?.installedAt?.takeIf { it > 0 } ?: folder.lastModified(),
cover = existing?.cover, hero = existing?.hero,
@@ -260,7 +260,7 @@ internal object EpicClientLibrary {
epic = existing?.epic ?: com.droiddeck.launcher.stores.EpicOptions(),
cloud = existing?.cloud ?: true,
launcher = StoreLaunch.LAUNCHER,
)
), commandArgs(item.optString("LaunchCommand")))
val sidecarChanged = existing?.toJson()?.toString(2) != next.toJson().toString(2)
val launcher = File(folder, StoreLaunch.LAUNCHER)
if (sidecarChanged || runCatching { launcher.readText() }.getOrNull() != StoreLaunch.launcherText(next)) {
@@ -328,6 +328,7 @@ internal object EpicClientLibrary {
.put("CatalogItemId", record.optString("itemId"))
.put("InstallLocation", dir)
.put("LaunchExecutable", record.optString("launchExecutable"))
.put("LaunchCommand", record.optString("launchCommand"))
.put("AppVersionString", record.optString("version"))
.put("SidecarDeploymentId", record.optJSONObject("sidecar")?.optString("deploymentId").orEmpty())
.put("DisplayName", title?.takeIf(String::isNotBlank) ?: dir.substringAfterLast('/'))
@@ -358,7 +359,11 @@ internal object EpicClientLibrary {
write(File(manifests, "$guid.item"), item(install, tags, ownership == true).toString(2))
runCatching { egstore(install, guid) { token } }.onFailure { Log.w(TAG, "${install.appName}: .egstore not written (${it.javaClass.simpleName})") }
after.put(install.appName, JSONObject().put("guid", guid).put("signature", install.signature).apply { if (ownership != null) put("ownership", ownership) })
StoreGameSidecar.read(install.folder)?.let { StoreLaunch.refreshLauncher(install.folder, it) }
StoreGameSidecar.read(install.folder)?.let { sidecar ->
val next = runCatching { manifestArgs(install, guid) }.getOrNull()?.let { withLaunchArgs(sidecar, it) } ?: sidecar
if (next !== sidecar) next.write(install.folder)
StoreLaunch.refreshLauncher(install.folder, next)
}
}
for (name in before.keys().asSequence().toList()) {
if (after.has(name)) continue
@@ -376,6 +381,33 @@ internal object EpicClientLibrary {
return changed
}
private const val LAUNCH_ARGS = "launchArgs"
private fun manifestArgs(install: Install, guid: String): List<String>? {
val manifest = File(install.folder, ".egstore/$guid.manifest").takeIf { it.isFile } ?: return null
val launch = EpicNative.inspect(manifest.readBytes(), JSONObject().put("op", "launch")) ?: return null
val build = launch.optString("buildVersion")
if (install.version.isNotEmpty() && build != install.version) return null
val args = launch.optJSONArray("args") ?: return null
return List(args.length()) { args.optString(it) }.filter { it.isNotEmpty() }
}
private fun commandArgs(command: String): List<String> {
if (command.isBlank()) return emptyList()
val args = EpicNative.call("launch.split", JSONObject().put("command", command))?.optJSONArray("args") ?: return emptyList()
return List(args.length()) { args.optString(it) }.filter { it.isNotEmpty() }
}
internal fun withLaunchArgs(sidecar: StoreGameSidecar, args: List<String>): StoreGameSidecar {
val previous = sidecar.extra[LAUNCH_ARGS]?.split('\n')?.filter { it.isNotEmpty() }.orEmpty()
val kept = sidecar.args.filterNot { it in previous }
val added = args.filterNot { it in kept }
val next = kept + added
val extra = LinkedHashMap(sidecar.extra).apply { if (added.isEmpty()) remove(LAUNCH_ARGS) else put(LAUNCH_ARGS, added.joinToString("\n")) }
if (next == sidecar.args && extra == sidecar.extra) return sidecar
return sidecar.copy(args = next, extra = extra)
}
private fun ownershipToken(token: String, install: Install): Boolean? =
runCatching { EpicApiClient.getCustomAttribute(token, install.namespace, install.catalogItemId, "OwnershipToken") }
.getOrNull()?.trim()?.lowercase()?.let { it == "true" }
@@ -0,0 +1,176 @@
package com.droiddeck.launcher.stores.itch
import android.content.Context
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import com.droiddeck.launcher.stores.CatalogItem
import com.droiddeck.launcher.stores.StoresState
import org.json.JSONArray
import java.io.File
import java.security.MessageDigest
internal data class BrowseQuery(
val sort: String = ItchBrowse.SORT_POPULAR,
val price: String = ItchBrowse.PRICE_ANY,
val platforms: Set<String> = emptySet(),
val tags: List<String> = emptyList(),
) {
val isDefault: Boolean get() = this == BrowseQuery()
}
internal class BrowsePage(val items: List<CatalogItem>, val code: Int, val cached: Boolean)
internal object ItchBrowse {
const val SORT_POPULAR = "popular"
const val SORT_NEW_POPULAR = "new-and-popular"
const val SORT_TOP_SELLERS = "top-sellers"
const val SORT_TOP_RATED = "top-rated"
const val SORT_NEWEST = "newest"
val sorts = listOf(SORT_POPULAR, SORT_NEW_POPULAR, SORT_TOP_SELLERS, SORT_TOP_RATED, SORT_NEWEST)
const val PRICE_ANY = "any"
const val PRICE_FREE = "free"
const val PRICE_SALE = "on-sale"
const val PRICE_PAID = "store"
const val PRICE_UNDER_5 = "5-dollars-or-less"
const val PRICE_UNDER_15 = "15-dollars-or-less"
val prices = listOf(PRICE_ANY, PRICE_FREE, PRICE_SALE, PRICE_PAID, PRICE_UNDER_5, PRICE_UNDER_15)
val platformNames = listOf("windows", "osx", "linux", "android", "ios", "web", "mobile-web")
private const val BASE = "https://itch.io/games"
private const val FRESH_MS = 3 * 60 * 60 * 1000L
private const val GAP_MS = 1_200L
private const val RETRY_MS = 8_000L
private const val FOLDER = "itch-browse"
@Volatile private var lastRequestAt = 0L
private val lock = Any()
private fun sortSegment(sort: String): String? = sort.takeIf { it != SORT_POPULAR && it in sorts }
private fun priceSegment(price: String): String? = price.takeIf { it != PRICE_ANY && it in prices }
fun path(query: BrowseQuery): String {
val segments = listOfNotNull(sortSegment(query.sort), priceSegment(query.price)) +
platformNames.filter { it in query.platforms }.map { "platform-$it" } +
query.tags.map { "tag-" + tagSlug(it) }
return if (segments.isEmpty()) BASE else BASE + "/" + segments.joinToString("/")
}
fun url(query: BrowseQuery, page: Int): String = path(query) + ".xml" + if (page > 1) "?page=$page" else ""
fun tagSlug(tag: String): String = tag.trim().lowercase().replace(Regex("[^a-z0-9]+"), "-").trim('-')
fun page(context: Context, query: BrowseQuery, page: Int, force: Boolean = false): BrowsePage {
val app = context.applicationContext
val url = url(query, page)
if (!force) read(app, url)?.let { return BrowsePage(it, 200, true) }
val (status, body) = fetch(url)
val items = if (status in 200..299 && body != null) ItchShelves.parse(body) else emptyList()
StoresState.logLine("itch.io browse: $url answered $status with ${items.size} games")
if (items.isNotEmpty()) write(app, url, items)
return BrowsePage(items, status, false)
}
private fun fetch(url: String): Pair<Int, String?> {
synchronized(lock) {
pause()
var answer = ItchShelves.open(url)
if (answer.first == 429) {
StoresState.logLine("itch.io browse: 429, waiting before one more try")
Thread.sleep(RETRY_MS)
pause()
answer = ItchShelves.open(url)
}
lastRequestAt = System.currentTimeMillis()
return answer
}
}
private fun pause() {
val gap = GAP_MS - (System.currentTimeMillis() - lastRequestAt)
if (gap > 0) Thread.sleep(gap)
}
private fun file(context: Context, url: String): File {
val digest = MessageDigest.getInstance("SHA-1").digest(url.toByteArray()).joinToString("") { "%02x".format(it) }
return File(File(context.cacheDir, FOLDER), "$digest.json")
}
private fun read(context: Context, url: String): List<CatalogItem>? {
val file = file(context, url)
if (!file.isFile || System.currentTimeMillis() - file.lastModified() > FRESH_MS) return null
return runCatching { ItchCatalog.list(JSONArray(file.readText())) }.getOrNull()?.takeIf { it.isNotEmpty() }
}
private fun write(context: Context, url: String, items: List<CatalogItem>) {
val file = file(context, url)
runCatching {
file.parentFile?.mkdirs()
file.writeText(ItchCatalog.array(items).toString())
}
}
}
internal object ItchBrowseState {
var query by mutableStateOf(BrowseQuery())
private set
var items by mutableStateOf<List<CatalogItem>>(emptyList())
private set
var loading by mutableStateOf(false)
private set
var ended by mutableStateOf(false)
private set
var failed by mutableStateOf(false)
private set
private var next = 1
private var generation = 0
val active: Boolean get() = !query.isDefault
fun choose(context: Context, wanted: BrowseQuery) {
if (wanted == query) return
generation++
query = wanted
items = emptyList()
ended = false
failed = false
loading = false
next = 1
if (active) more(context)
}
fun more(context: Context, retry: Boolean = false) {
if (loading || ended || !active || (failed && !retry)) return
loading = true
failed = false
val app = context.applicationContext
val mine = generation
val asked = query
val page = next
Thread({
val answer = runCatching { ItchBrowse.page(app, asked, page) }.getOrNull()
StoresState.post {
if (mine != generation) return@post
loading = false
if (answer == null || answer.code !in 200..299) {
failed = true
return@post
}
if (answer.items.isEmpty()) {
ended = true
return@post
}
val known = items.mapTo(HashSet()) { it.id }
val fresh = answer.items.filter { known.add(it.id) }
if (fresh.isEmpty()) ended = true else {
items = items + fresh
next = page + 1
}
}
}, "itch-browse").start()
}
}
@@ -108,7 +108,7 @@ internal object ItchShelves {
return shelves.takeUnless { it.isEmpty }
}
private fun open(url: String): Pair<Int, String?> {
internal fun open(url: String): Pair<Int, String?> {
var conn: HttpURLConnection? = null
return try {
conn = (URL(url).openConnection() as HttpURLConnection).apply {
@@ -39,11 +39,17 @@ internal class XboxInstaller(private val app: Context, private val item: Catalog
var sequence = -1L
try {
val source = if (content) selected else item.id
val guestFolder = StoreInstallRoot.guestPathForXodus(app, folder)
val selection = if (content) emptyList() else listOf("--selected-content-id", selected)
Xodus.start(app, listOf("streaming", source, folder.path, "--market", market,
Xodus.start(app, listOf("streaming", source, guestFolder, "--market", market,
"--progress-json", "--control-stdin") + selection).use { process ->
child = process
val diagnostics = Xodus.diagnostics(process)
val rejected = AtomicBoolean(false)
val rejectedLine = Regex(Xodus.SIGN_IN_REJECTED)
val diagnostics = Xodus.diagnostics(process) { line ->
StoresState.logLine("Xbox: $line")
if (line.matches(rejectedLine)) rejected.set(true)
}
if (cancelled.get()) process.process.destroy()
process.process.inputStream.bufferedReader().useLines { lines -> lines.forEach { line ->
if (line.startsWith("NEXUS_PROGRESS ")) {
@@ -62,6 +68,7 @@ internal class XboxInstaller(private val app: Context, private val item: Catalog
check(process.process.waitFor(15, TimeUnit.SECONDS)) { "Xbox installer did not exit." }
diagnostics.join(2000)
if (cancelled.get()) return null
check(!rejected.get()) { app.getString(com.droiddeck.launcher.R.string.stores_xbox_sign_in_again) }
check(process.process.exitValue() == 0 && complete) { "Xbox download did not complete. Resume to retry with fresh licenses." }
}
if (content) {
@@ -46,7 +46,7 @@ internal object XboxRuntime {
val market = game.second.extra["market"]?.takeIf { it.matches(Regex("[A-Z]{2}")) } ?: Xodus.market()
val directory = views.create(app.filesDir)
val process = try {
Xodus.start(app, listOf("run", game.first.path, "droiddeck:prepare", "--exe", game.second.exe,
Xodus.start(app, listOf("run", StoreInstallRoot.guestPathForXodus(app, game.first), "droiddeck:prepare", "--exe", game.second.exe,
"--materialize-chain", "--market", market), launchDirectory = directory, credentialGeneration = credentials)
} catch (e: Exception) { XboxLaunchViews.remove(directory); throw e }
if (!launches.attach(token, process)) { process.close(); error("Xbox launch was cancelled") }
@@ -5,7 +5,9 @@ import android.os.Environment
import com.droiddeck.launcher.core.AddonPack
import com.droiddeck.launcher.runtime.LinuxNetworkLinkComponent
import com.droiddeck.launcher.runtime.LinuxRuntime
import com.droiddeck.launcher.runtime.ProotFastPath
import com.droiddeck.launcher.session.SessionPrefs
import com.droiddeck.launcher.stores.StoreInstallRoot
import org.json.JSONObject
import java.io.Closeable
import java.io.File
@@ -79,10 +81,24 @@ internal object Xodus {
networkLink.publish()
networkLink.start()
val runtime = (runtimeDirectory ?: File(app.filesDir, "xbox-runtime")).apply { mkdirs() }
val command = LinuxRuntime.command(app, null, null, Environment.getExternalStorageDirectory(), listOf(
val root = LinuxRuntime.rootDir(app)
val external = Environment.getExternalStorageDirectory()
val extraBinds = StoreInstallRoot.externalBindSpecsForXodus(app)
val binds = LinuxRuntime.binds(app, null, null, external, extraBinds)
val fastPathPreloaded = runCatching {
File(root, "etc/ld.so.preload").useLines { lines -> lines.any { it.trim() == ProotFastPath.LIBRARY } }
}.getOrDefault(false)
val fastPathKey = if (ProotFastPath.enabled(app) && fastPathPreloaded &&
File(root, ProotFastPath.LIBRARY.removePrefix("/")).isFile) ProotFastPath.key(root, binds) else null
val guestCommand = mutableListOf(
"/usr/bin/env", "HOME=/root", "XODUS_LOG=off", "RUST_LOG=off",
"XDG_RUNTIME_DIR=${runtime.path}", "DROIDDECK_XBOX_CREDENTIAL_SOCKET=${credentials.name}", binary,
) + args)
)
fastPathKey?.let { key ->
guestCommand.addAll(guestCommand.lastIndex, ProotFastPath.guestEnv(root, binds, key))
}
guestCommand.addAll(args)
val command = LinuxRuntime.commandWithBinds(app, root, binds, guestCommand)
val builder = ProcessBuilder(command).directory(LinuxRuntime.rootDir(app))
if (launchDirectory != null) builder.environment()["TMPDIR"] = launchDirectory.path
builder.environment().apply {
@@ -90,6 +106,7 @@ internal object Xodus {
put("PROOT_LOADER", LinuxRuntime.prootLoader(app).path)
put("PROOT_TMP_DIR", LinuxRuntime.prootTempDir(app).path)
if (SessionPrefs.prootNoSeccomp(app)) put("PROOT_NO_SECCOMP", "1")
fastPathKey?.let { ProotFastPath.hostEnv(it).let { (key, value) -> put(key, value) } }
LinuxRuntime.prootLibraryPath(app).takeIf { it.isNotEmpty() }?.let { put("LD_LIBRARY_PATH", it) }
}
val digest = java.security.MessageDigest.getInstance("SHA-256")
@@ -133,11 +150,13 @@ internal object Xodus {
}
}
const val SIGN_IN_REJECTED = "Microsoft content licensing rejected sign-in \\(HTTP 401\\)\\. Sign in again in Settings\\."
/** Passes the backend's known stderr diagnostics to [report]; other stderr text never leaves the process. */
fun diagnostics(child: Child, report: (String) -> Unit = { com.droiddeck.launcher.stores.StoresState.logLine("Xbox: $it") }): Thread = Thread({
runCatching {
child.process.errorStream.bufferedReader().useLines { lines -> lines.forEach { line ->
if (line.matches(Regex("NEXUS_CREDENTIAL_ERROR_V1 [a-z-]{1,48}|NEXUS_LIBRARY_DIAGNOSTIC_V1 [a-z-]{1,48} [0-9]{1,3} [0-9]{1,6}|NEXUS_SESSION_DIAGNOSTIC_V1 [a-z-]{1,64}|Account library unavailable \\([a-z-]{1,64}\\); credentials and installed games are unchanged\\.|Account library timed out; installed games are unchanged\\.|Xbox profile is temporarily unavailable \\([a-z-]{1,48}\\); stored account is unchanged\\.|Xbox profile request timed out; stored account is unchanged\\.")))
if (line.matches(Regex("NEXUS_CREDENTIAL_ERROR_V1 [a-z-]{1,48}|NEXUS_LIBRARY_DIAGNOSTIC_V1 [a-z-]{1,48} [0-9]{1,3} [0-9]{1,6}|NEXUS_SESSION_DIAGNOSTIC_V1 [a-z-]{1,64}|Account library unavailable \\([a-z-]{1,64}\\); credentials and installed games are unchanged\\.|Account library timed out; installed games are unchanged\\.|Xbox profile is temporarily unavailable \\([a-z-]{1,48}\\); stored account is unchanged\\.|Xbox profile request timed out; stored account is unchanged\\.|NEXUS_CONTENT_LICENSE_DIAGNOSTIC_V1 [a-z-]{1,48} [0-9]{3}|$SIGN_IN_REJECTED")))
report(line)
} }
}
@@ -676,14 +676,15 @@ private fun MoviePreview(url: String, modifier: Modifier = Modifier) {
/** A dialog with one text box, for a search term or a page number; the Android keyboard comes up with it. */
@Composable
private fun TextEntryDialog(
internal fun TextEntryDialog(
title: String, initial: String, number: Boolean, confirm: String, onSubmit: (String) -> Unit, onDismiss: () -> Unit,
id: String = "boot-movie-entry",
) {
val shown = rememberShown(onDismiss)
val close = { shown.targetState = false }
var text by remember { mutableStateOf(initial) }
val submit = { onSubmit(text.trim()); close() }
AppDialog(shown, close, "boot-movie-entry", wide = false, maxWidth = 460.dp) {
AppDialog(shown, close, id, wide = false, maxWidth = 460.dp) {
DialogTitleRow(title, close)
AdbTextField(
value = text, onValueChange = { text = it }, label = "", keyboardType = if (number) KeyboardType.Number else KeyboardType.Text,
@@ -70,6 +70,7 @@ import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.layout.boundsInRoot
import androidx.compose.ui.layout.onGloballyPositioned
import androidx.compose.ui.platform.LocalConfiguration
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.res.painterResource
@@ -102,6 +103,7 @@ internal fun DesktopPage(s: FrontEndState, a: FrontEndActions, modifier: Modifie
val ctx = LocalContext.current
val density = LocalDensity.current
val narrow = LocalNarrowPane.current
val short = compactDesktop()
val colors = MaterialTheme.colorScheme
LaunchedEffect(Unit) { UserAppsState.refresh(ctx) }
LaunchedEffect(s.ready) { com.droiddeck.launcher.store.StoreState.refresh(ctx) }
@@ -120,7 +122,7 @@ internal fun DesktopPage(s: FrontEndState, a: FrontEndActions, modifier: Modifie
key = "desktop", tabs = tabs,
onOpen = a.onDesktopSettings, onPrimary = a.onDesktop,
modifier = modifier.clipToBounds(),
start = if (narrow) 20.dp else 44.dp, bottom = if (narrow) 20.dp else 44.dp,
start = if (narrow) 20.dp else 44.dp, bottom = 44.dp,
background = {
DesktopWall(installed.map { it.iconRes } + apps.mapNotNull { it.icon })
},
@@ -132,8 +134,8 @@ internal fun DesktopPage(s: FrontEndState, a: FrontEndActions, modifier: Modifie
},
words = {
Column(verticalArrangement = Arrangement.spacedBy(8.dp)) {
Text(
stringResource(R.string.rail_desktop), fontSize = if (narrow) 30.sp else 42.sp, lineHeight = if (narrow) 34.sp else 46.sp,
if (LocalConfiguration.current.screenHeightDp >= 400) Text(
stringResource(R.string.rail_desktop), fontSize = if (short) 30.sp else 42.sp, lineHeight = if (short) 34.sp else 46.sp,
fontWeight = FontWeight.Black, color = colors.onBackground,
)
BusyChip(s)
@@ -143,11 +145,12 @@ internal fun DesktopPage(s: FrontEndState, a: FrontEndActions, modifier: Modifie
PrimaryButton(open, enabled = !s.busy, main = true, large = true, icon = Icons.Outlined.DesktopWindows, onClick = click)
},
beside = {
Column(verticalArrangement = Arrangement.spacedBy(10.dp)) {
Row(horizontalArrangement = Arrangement.spacedBy(10.dp)) {
HeroIconButton(Icons.Outlined.Storefront, stringResource(R.string.flathub_name), FlathubTeal, "desktop:flathub") { at -> openFrom(at, null, "store") }
HeroIconButton(Icons.Filled.Add, stringResource(R.string.user_apps_add), null, "desktop:add") { if (!s.busy) adding = true }
}
Row(
horizontalArrangement = Arrangement.spacedBy(10.dp), verticalAlignment = Alignment.CenterVertically,
modifier = Modifier.horizontalScroll(rememberScrollState()),
) {
HeroIconButton(Icons.Outlined.Storefront, stringResource(R.string.flathub_name), FlathubTeal, "desktop:flathub") { at -> openFrom(at, null, "store") }
HeroIconButton(Icons.Filled.Add, stringResource(R.string.user_apps_add), null, "desktop:add") { if (!s.busy) adding = true }
if (s.desktopPresent) UninstallDesktop(enabled = !s.runtimeActionsBlocked, onUninstall = a.onRemoveDesktop)
}
},
@@ -159,6 +162,9 @@ internal fun DesktopPage(s: FrontEndState, a: FrontEndActions, modifier: Modifie
if (adding && !s.busy) AddAppDialog(s.ready, onDismiss = { adding = false }) { request, label -> UserAppsState.add(ctx, request, label) }
}
@Composable
private fun compactDesktop() = LocalNarrowPane.current || LocalConfiguration.current.screenHeightDp < 600
@Composable
private fun DesktopDock(
s: FrontEndState, a: FrontEndActions, installed: List<Library.Emulator>, apps: List<UserApps.App>,
@@ -177,7 +183,7 @@ private fun DesktopDock(
LaunchedEffect(Unit) { mounted[0] = true }
val scroll = rememberScrollState()
if (keys.isEmpty() && available.isEmpty() && UserAppsState.working == null && UserAppsState.lastError == null) return
Column(Modifier.fillMaxWidth().padding(top = if (narrow) 14.dp else 22.dp)) {
Column(Modifier.fillMaxWidth().padding(top = if (compactDesktop()) 14.dp else 22.dp)) {
Text(
stringResource(R.string.user_apps_section).uppercase(), fontSize = 11.sp, fontWeight = FontWeight.Bold, letterSpacing = 1.6.sp,
color = colors.onSurfaceVariant, modifier = Modifier.padding(start = if (narrow) 20.dp else 44.dp, bottom = 8.dp),
@@ -335,6 +335,11 @@ internal fun SetupPanel(
}
}
SettingsGroup(stringResource(R.string.setup_runtime)) { runtimeCheck(false) }
SettingsGroup(stringResource(R.string.lan_title)) {
ActionRow(stringResource(R.string.lan_title), stringResource(R.string.lan_setup_hint), stringResource(R.string.setup_manage), onClick = {
ctx.startActivity(android.content.Intent(ctx, com.droiddeck.launcher.lan.LocalLanActivity::class.java))
})
}
}
1 -> {
val controller = s.controller
@@ -0,0 +1,145 @@
package com.droiddeck.launcher.ui
import androidx.compose.foundation.LocalIndication
import androidx.compose.foundation.background
import androidx.compose.foundation.horizontalScroll
import androidx.compose.foundation.hoverable
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.selection.selectable
import androidx.compose.foundation.selection.selectableGroup
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.LinearProgressIndicator
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.Role
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.droiddeck.launcher.R
import com.droiddeck.launcher.stores.itch.ItchBrowse
import com.droiddeck.launcher.stores.itch.ItchBrowseState
@Composable
internal fun ItchBrowseBar() {
val ctx = LocalContext.current
val query = ItchBrowseState.query
var picking by remember { mutableStateOf(false) }
Column(Modifier.fillMaxWidth().padding(top = 6.dp, bottom = 8.dp), verticalArrangement = Arrangement.spacedBy(6.dp)) {
ChipRow {
for (sort in ItchBrowse.sorts) BrowseChip(sortLabel(sort), query.sort == sort) { ItchBrowseState.choose(ctx, query.copy(sort = sort)) }
}
ChipRow {
for (price in ItchBrowse.prices) BrowseChip(priceLabel(price), query.price == price) { ItchBrowseState.choose(ctx, query.copy(price = price)) }
}
ChipRow {
BrowseChip(stringResource(R.string.stores_itch_platform_any), query.platforms.isEmpty()) { ItchBrowseState.choose(ctx, query.copy(platforms = emptySet())) }
for (platform in ItchBrowse.platformNames) {
val on = platform in query.platforms
BrowseChip(platformLabel(platform), on) { ItchBrowseState.choose(ctx, query.copy(platforms = if (on) query.platforms - platform else query.platforms + platform)) }
}
}
ChipRow {
for (tag in query.tags) BrowseChip("$tag ✕", true) { ItchBrowseState.choose(ctx, query.copy(tags = query.tags - tag)) }
BrowseChip(stringResource(R.string.stores_itch_tag_add), false) { picking = true }
}
}
if (picking) TextEntryDialog(
stringResource(R.string.stores_itch_tag_title), "", number = false, confirm = stringResource(R.string.common_ok),
onSubmit = { value -> ItchBrowse.tagSlug(value).takeIf { it.isNotEmpty() }?.let { ItchBrowseState.choose(ctx, query.copy(tags = (query.tags + it).distinct())) } },
onDismiss = { picking = false }, id = "itch-tag",
)
}
@Composable
internal fun ItchLoadMore() {
val ctx = LocalContext.current
val count = ItchBrowseState.items.size
LaunchedEffect(Unit) { ItchBrowseState.more(ctx) }
if (ItchBrowseState.loading) LinearProgressIndicator(Modifier.fillMaxWidth().padding(vertical = 12.dp))
else if (ItchBrowseState.failed) Box(Modifier.fillMaxWidth().padding(vertical = 8.dp), contentAlignment = Alignment.Center) {
BrowseChip(stringResource(R.string.stores_dl_retry), false) { ItchBrowseState.more(ctx, retry = true) }
}
else if (!ItchBrowseState.ended && count > 0) Box(Modifier.fillMaxWidth().padding(vertical = 8.dp), contentAlignment = Alignment.Center) {
BrowseChip(stringResource(R.string.stores_itch_load_more), false) { ItchBrowseState.more(ctx) }
}
}
@Composable
private fun ChipRow(content: @Composable () -> Unit) {
Row(
horizontalArrangement = Arrangement.spacedBy(6.dp), verticalAlignment = Alignment.CenterVertically,
modifier = Modifier.fillMaxWidth().horizontalScroll(rememberScrollState()).selectableGroup(),
) { content() }
}
@Composable
private fun BrowseChip(label: String, selected: Boolean, onClick: () -> Unit) {
val colors = MaterialTheme.colorScheme
val pal = LocalPalette.current
val shape = RoundedCornerShape(8.dp)
val src = remember { MutableInteractionSource() }
val hot = rememberHot(src)
Text(
label, fontSize = 13.sp, fontWeight = FontWeight.SemiBold, maxLines = 1,
color = if (selected) pal.onSignal else if (hot) colors.onBackground else colors.onSurfaceVariant,
modifier = Modifier.clip(shape).background(if (selected) pal.signal else colors.surfaceVariant)
.glideBorder(hot, shape, pal.signal)
.hoverable(src).selectable(selected = selected, interactionSource = src, indication = LocalIndication.current, role = Role.Tab, onClick = onClick)
.controllerConfirm(onClick = onClick)
.padding(horizontal = 12.dp, vertical = 7.dp),
)
}
@Composable
private fun sortLabel(sort: String): String = stringResource(
when (sort) {
ItchBrowse.SORT_NEW_POPULAR -> R.string.stores_itch_sort_new_popular
ItchBrowse.SORT_TOP_SELLERS -> R.string.stores_itch_sort_top_sellers
ItchBrowse.SORT_TOP_RATED -> R.string.stores_itch_sort_top_rated
ItchBrowse.SORT_NEWEST -> R.string.stores_itch_sort_new
else -> R.string.stores_itch_sort_popular
},
)
@Composable
private fun platformLabel(platform: String): String = stringResource(
when (platform) {
"windows" -> R.string.stores_itch_platform_windows
"osx" -> R.string.stores_itch_platform_macos
"linux" -> R.string.stores_itch_platform_linux
"android" -> R.string.stores_itch_platform_android
"ios" -> R.string.stores_itch_platform_ios
"web" -> R.string.stores_itch_platform_web
else -> R.string.stores_itch_platform_mobile_web
},
)
@Composable
private fun priceLabel(price: String): String = stringResource(
when (price) {
ItchBrowse.PRICE_FREE -> R.string.stores_itch_price_free
ItchBrowse.PRICE_SALE -> R.string.stores_itch_price_sale
ItchBrowse.PRICE_PAID -> R.string.stores_itch_price_paid
ItchBrowse.PRICE_UNDER_5 -> R.string.stores_itch_price_under_5
ItchBrowse.PRICE_UNDER_15 -> R.string.stores_itch_price_under_15
else -> R.string.stores_itch_price_any
},
)
@@ -128,6 +128,7 @@ import androidx.compose.ui.graphics.lerp
import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalFocusManager
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.Role
import androidx.compose.ui.semantics.contentDescription
@@ -145,6 +146,7 @@ import com.droiddeck.launcher.R
import com.droiddeck.launcher.frontend.Library
import com.droiddeck.launcher.session.SessionPrefs
import com.droiddeck.launcher.stores.CatalogItem
import com.droiddeck.launcher.stores.itch.ItchBrowseState
import com.droiddeck.launcher.stores.Store
import com.droiddeck.launcher.stores.StoreTab
import com.droiddeck.launcher.stores.StoresState
@@ -172,6 +174,7 @@ private data class PaneKey(val chip: String, val tab: String, val signedIn: Bool
@Composable
internal fun StoresPage(s: FrontEndState, a: FrontEndActions, modifier: Modifier) {
val ctx = LocalContext.current
val focusManager = LocalFocusManager.current
com.droiddeck.launcher.stores.xbox.XboxContent.plan?.let { content ->
androidx.compose.material3.AlertDialog(
onDismissRequest = { com.droiddeck.launcher.stores.xbox.XboxContent.dismiss() },
@@ -279,7 +282,7 @@ internal fun StoresPage(s: FrontEndState, a: FrontEndActions, modifier: Modifier
val heroFocus = remember { androidx.compose.ui.focus.FocusRequester() }
var detailFocused by remember { mutableStateOf(false) }
fun move(kind: String) { focusMove = kind to (focusMove?.second ?: 0) + 1 }
fun open(key: String) { lastOpened = key; openGame = key; move("detail") }
fun open(key: String) { focusManager.clearFocus(force = true); lastOpened = key; openGame = key; move("detail") }
fun closeGame() { openGame = null; move("card") }
fun switchTab(to: String) { tab = to; move("first") }
val pickChip: (String) -> Unit = { id ->
@@ -477,7 +480,11 @@ internal fun StoresPage(s: FrontEndState, a: FrontEndActions, modifier: Modifier
androidx.compose.material3.LinearProgressIndicator(Modifier.fillMaxWidth().height(3.dp))
}
!k.signedIn -> Box(Modifier.fillMaxWidth().verticalScroll(scroll).padding(top = 4.dp, bottom = 16.dp)) { SignInCard(st, viewportH - 20.dp) }
else -> Storefront(st, k.tab, query, s, a, grids.getOrPut(k) { LazyGridState() }, onQuery = { query = it }, onOpen = { open(it) }, onTab = { switchTab(it) })
else -> Storefront(
st, k.tab, query, s, a, grids.getOrPut(k) { LazyGridState() },
clearSearchFocus = openGame != null,
onQuery = { query = it }, onOpen = { open(it) }, onTab = { switchTab(it) },
)
}
}
}
@@ -538,7 +545,7 @@ internal fun StoresPage(s: FrontEndState, a: FrontEndActions, modifier: Modifier
seenActive.clear(); seenActive.addAll(activeKeys)
if (fresh.isNotEmpty()) StoresMotion.takeInstall()?.let { StoresMotion.fly(it) }
}
StoresState.pendingInstall?.let { item -> InstallWhere(item) }
StoresState.pendingInstall?.let { item -> StoreTheme(item.store) { InstallWhere(item) } }
}
@Composable
@@ -937,6 +944,7 @@ internal fun StoreLogo(store: Store, size: Dp) {
private fun Storefront(
store: Store, tab: String, query: String, s: FrontEndState, a: FrontEndActions,
grid: LazyGridState,
clearSearchFocus: Boolean,
onQuery: (String) -> Unit, onOpen: (String) -> Unit, onTab: (String) -> Unit,
) {
val ctx = LocalContext.current
@@ -954,7 +962,8 @@ private fun Storefront(
val everything = remember(library, shelves, found) { (found + library + (shelves?.all ?: emptyList())).distinctBy { it.id } }
LaunchedEffect(store, q) { StoresState.search(ctx, store, q) }
val loaded = StoresState.library.containsKey(store)
val showGrid = tab != "store" || q.isNotEmpty()
val browsing = store == Store.ITCH && tab == "store" && q.isEmpty() && ItchBrowseState.active
val showGrid = tab != "store" || q.isNotEmpty() || browsing
val sort = s.storesSort
val lastPlayedFor = remember(s.steamGames) {
val byKey = s.steamGames.associate { "${it.source}:${it.storeId}" to it.lastPlayed }
@@ -967,8 +976,13 @@ private fun Storefront(
lookup
}
val isSizeSort = tab == "library" && (sort == "sizeAsc" || sort == "sizeDesc")
val candidates = remember(library, everything, tab, q, s.storesShowMature) {
if (tab == "library") library.filter(::matches) else everything.filter { matches(it) && shown(it) }
val browseItems = if (browsing) ItchBrowseState.items else emptyList()
val candidates = remember(library, everything, tab, q, s.storesShowMature, browsing, browseItems) {
if (tab == "library") library.filter(::matches)
else if (browsing) {
val owned = library.associateBy { it.id }
browseItems.map { owned[it.id] ?: it }.filter(::shown)
} else everything.filter { matches(it) && shown(it) }
}
val candidateKeys = remember(candidates) { candidates.map { it.key } }
var resolvedSizeSortKey by remember(store, tab) { mutableStateOf<List<String>?>(null) }
@@ -1006,6 +1020,8 @@ private fun Storefront(
}
val empty = stringResource(when {
tab == "library" && library.isEmpty() && StoresState.status[store] != null -> R.string.stores_library_loading
browsing && ItchBrowseState.loading -> R.string.stores_shelves_loading
browsing && ItchBrowseState.failed -> R.string.stores_itch_browse_failed
else -> R.string.stores_nothing_matches
})
var firstPlaced = false
@@ -1016,8 +1032,9 @@ private fun Storefront(
// A bar only where the tab has nothing else on it: shelves, the shelf of owned games, or a grid still loading.
val gridEmpty = if (showGrid) visible.isEmpty() else (shelves == null || shelves.isEmpty) && library.isEmpty()
val barLine = StoresState.status[store]?.takeIf { gridEmpty && syncCount(it) != null }
val itchBar = store == Store.ITCH && tab == "store" && q.isEmpty()
val headerItems = 1 + (if (sizeSortPending) 1 else 0) + (if (barLine != null) 1 else 0) +
(if (StoresState.problems[store] != null) 1 else 0)
(if (StoresState.problems[store] != null) 1 else 0) + (if (itchBar) 1 else 0)
val listMode = s.storesView == "list" && tab == "library"
val capsules = s.storesView == "capsules" && tab == "library"
val tileWidth = if (capsules) CapsuleWidth else CardWidth
@@ -1072,6 +1089,7 @@ private fun Storefront(
libraryLabel,
query, onQuery,
placeholder = if (tab == "store") stringResource(R.string.stores_search_catalog, store.label) else stringResource(R.string.stores_search_library),
clearSearchFocus = clearSearchFocus,
lead = if (tabs.size < 2) null else { {
val labels = tabs.map { if (it == "store") stringResource(R.string.stores_tab_store) else libraryLabel }
HeaderTabs(labels, tabs.indexOf(tab).coerceAtLeast(0)) { onTab(tabs[it]) }
@@ -1102,6 +1120,7 @@ private fun Storefront(
}
barLine?.let { line -> item(key = "sync", span = { GridItemSpan(maxLineSpan) }) { Rise(3) { SyncBar(line) } } }
StoresState.problems[store]?.let { line -> item(key = "problem", span = { GridItemSpan(maxLineSpan) }) { Rise(3) { Box(Modifier.padding(bottom = 8.dp)) { Note(line) } } } }
if (itchBar) item(key = "itch-browse-bar", span = { GridItemSpan(maxLineSpan) }) { ItchBrowseBar() }
when (tab) {
"library" -> if (!loaded) Unit
else if (split == 0) storeGrid(visible, empty, card)
@@ -1112,8 +1131,10 @@ private fun Storefront(
storeGrid(visible.drop(split), empty, card)
}
else -> {
if (q.isNotEmpty()) storeGrid(visible, empty, card)
else {
if (q.isNotEmpty() || browsing) {
storeGrid(visible, empty, card)
if (browsing) item(key = "itch-more", span = { GridItemSpan(maxLineSpan) }) { ItchLoadMore() }
} else {
item(key = "shelves", span = { GridItemSpan(maxLineSpan) }) {
Column {
Shelf(stringResource(R.string.stores_shelf_new), shelf(shelves?.whatsNew), card)
@@ -1172,6 +1193,7 @@ private fun HeaderTabs(labels: List<String>, selected: Int, onSelect: (Int) -> U
@Composable
internal fun ModeHeader(
title: String, query: String, onQuery: (String) -> Unit, placeholder: String,
clearSearchFocus: Boolean = false,
lead: (@Composable () -> Unit)? = null, trailing: @Composable () -> Unit,
) {
val colors = MaterialTheme.colorScheme
@@ -1193,6 +1215,7 @@ internal fun ModeHeader(
AdbTextField(
value = query, onValueChange = onQuery, label = "", keyboardType = KeyboardType.Text, imeAction = ImeAction.Search,
placeholder = placeholder, compact = true, focusOnShow = focusOnOpen,
clearFocus = clearSearchFocus,
onFocusChange = { focused -> if (!focused && query.isEmpty()) { searching = false; focusOnOpen = false } },
)
}
@@ -356,6 +356,7 @@ internal fun AdbTextField(
placeholder: String? = null,
compact: Boolean = false,
onFocusChange: (Boolean) -> Unit = {},
clearFocus: Boolean = false,
onNext: (() -> Unit)? = null,
onDone: (() -> Unit)? = null,
focusOnShow: Boolean = false,
@@ -444,6 +445,11 @@ internal fun AdbTextField(
?.showSoftInput(editText, android.view.inputmethod.InputMethodManager.SHOW_IMPLICIT)
}
}
if (clearFocus && editText.hasFocus()) {
editText.clearFocus()
(editText.context.getSystemService(android.content.Context.INPUT_METHOD_SERVICE) as? android.view.inputmethod.InputMethodManager)
?.hideSoftInputFromWindow(editText.windowToken, 0)
}
editText.setTextColor(colors.onBackground.toArgb())
editText.setHintTextColor(colors.onSurfaceVariant.toArgb())
editText.hint = placeholder
+18
View File
@@ -2088,6 +2088,23 @@
<string name="stores_itch_no_exe">لم يتم العثور على لعبة Windows في التنزيل</string>
<string name="stores_itch_extract_failed">تعذر استخراج التنزيل (رمز الخروج %1$d)</string>
<string name="stores_itch_no_catalog">لم يستجب itch.io</string>
<string name="stores_itch_sort_popular">الأكثر شعبية</string>
<string name="stores_itch_sort_new">الأحدث</string>
<string name="stores_itch_sort_new_popular">جديد ورائج</string>
<string name="stores_itch_price_paid">مدفوع</string>
<string name="stores_itch_price_under_5">5 دولارات أو أقل</string>
<string name="stores_itch_price_under_15">15 دولارًا أو أقل</string>
<string name="stores_itch_sort_top_rated">الأعلى تقييمًا</string>
<string name="stores_itch_sort_top_sellers">الأكثر مبيعًا</string>
<string name="stores_itch_price_any">أي سعر</string>
<string name="stores_itch_price_free">مجاني</string>
<string name="stores_itch_price_sale">مخفّض</string>
<string name="stores_itch_load_more">تحميل المزيد</string>
<string name="stores_itch_platform_any">أي منصة</string>
<string name="stores_itch_platform_mobile_web">ويب الجوال</string>
<string name="stores_itch_tag_add">إضافة وسم</string>
<string name="stores_itch_tag_title">التصفية حسب الوسم</string>
<string name="stores_itch_browse_failed">تعذّر تحميل الألعاب من itch.io</string>
<string name="stores_itch_archive">أرشيفات %1$s غير مدعومة</string>
<string name="stores_itch_download_failed">استجاب itch.io بـ HTTP %1$d</string>
<string name="stores_free">مجاني</string>
@@ -2242,6 +2259,7 @@
<string name="stores_login_close">إغلاق</string>
<string name="stores_login_retry">حاوِل مرة أخرى</string>
<string name="stores_login_finishing">جارٍ إنهاء تسجيل الدخول…</string>
<string name="stores_xbox_sign_in_again">رفضت Microsoft تسجيل الدخول إلى Xbox. سجّل الخروج من Xbox في المتاجر، ثم سجّل الدخول مجددًا، ثم استأنف.</string>
<string name="stores_login_error_network">تعذّر تحميل صفحة تسجيل الدخول: %1$s</string>
<string name="stores_login_error_idp_blocked">يرفض هذا المزوّد تسجيل الدخول من صفحة مضمَّنة. سجِّل الدخول باستخدام كلمة مرور المتجر بدلاً من ذلك.</string>
<string name="stores_login_error_http">استجابت صفحة تسجيل الدخول بخطأ (HTTP %1$d).</string>
@@ -2194,6 +2194,7 @@
<string name="stores_login_close">Cerrar</string>
<string name="stores_login_retry">Reintentar</string>
<string name="stores_login_finishing">Terminando de iniciar sesión…</string>
<string name="stores_xbox_sign_in_again">Microsoft rechazó el inicio de sesión de Xbox. Cierra sesión de Xbox en Tiendas, vuelve a iniciar sesión y luego reanuda.</string>
<string name="stores_login_error_network">No se pudo cargar la página de inicio de sesión: %1$s</string>
<string name="stores_login_error_idp_blocked">Este proveedor no permite iniciar sesión desde una página integrada. Inicia sesión con la contraseña de la tienda.</string>
<string name="stores_login_error_http">La página de inicio de sesión respondió con un error (HTTP %1$d).</string>
@@ -2771,6 +2772,23 @@
<string name="stores_itch_no_exe">No se encontró un juego de Windows en la descarga</string>
<string name="stores_itch_extract_failed">No se pudo extraer la descarga (salida %1$d)</string>
<string name="stores_itch_no_catalog">itch.io no respondió</string>
<string name="stores_itch_sort_popular">Populares</string>
<string name="stores_itch_sort_new">Más recientes</string>
<string name="stores_itch_sort_new_popular">Nuevos y populares</string>
<string name="stores_itch_price_paid">De pago</string>
<string name="stores_itch_price_under_5">$5 o menos</string>
<string name="stores_itch_price_under_15">$15 o menos</string>
<string name="stores_itch_sort_top_rated">Mejor valorados</string>
<string name="stores_itch_sort_top_sellers">Más vendidos</string>
<string name="stores_itch_price_any">Cualquier precio</string>
<string name="stores_itch_price_free">Gratis</string>
<string name="stores_itch_price_sale">En oferta</string>
<string name="stores_itch_load_more">Cargar más</string>
<string name="stores_itch_platform_any">Cualquier plataforma</string>
<string name="stores_itch_platform_mobile_web">Web móvil</string>
<string name="stores_itch_tag_add">Agregar una etiqueta</string>
<string name="stores_itch_tag_title">Filtrar por etiqueta</string>
<string name="stores_itch_browse_failed">No se pudieron cargar los juegos de itch.io</string>
<string name="stores_itch_archive">Los archivos %1$s no son compatibles</string>
<string name="stores_itch_download_failed">itch.io respondió HTTP %1$d</string>
<string name="glasses_experimental">Cámaras Luma Ultra — Experimental</string>
+18
View File
@@ -2004,6 +2004,23 @@
<string name="stores_itch_no_exe">В изтеглянето не е намерена игра за Windows</string>
<string name="stores_itch_extract_failed">Изтеглянето не можа да бъде разархивирано (код %1$d)</string>
<string name="stores_itch_no_catalog">itch.io не отговори</string>
<string name="stores_itch_sort_popular">Популярни</string>
<string name="stores_itch_sort_new">Най-нови</string>
<string name="stores_itch_sort_new_popular">Нови и популярни</string>
<string name="stores_itch_price_paid">Платени</string>
<string name="stores_itch_price_under_5">До $5</string>
<string name="stores_itch_price_under_15">До $15</string>
<string name="stores_itch_sort_top_rated">Най-високо оценени</string>
<string name="stores_itch_sort_top_sellers">Най-продавани</string>
<string name="stores_itch_price_any">Всякаква цена</string>
<string name="stores_itch_price_free">Безплатни</string>
<string name="stores_itch_price_sale">С намаление</string>
<string name="stores_itch_load_more">Зареди още</string>
<string name="stores_itch_platform_any">Всяка платформа</string>
<string name="stores_itch_platform_mobile_web">Мобилен уеб</string>
<string name="stores_itch_tag_add">Добавяне на таг</string>
<string name="stores_itch_tag_title">Филтриране по таг</string>
<string name="stores_itch_browse_failed">Игрите от itch.io не можаха да се заредят</string>
<string name="stores_itch_archive">Архивите %1$s не се поддържат</string>
<string name="stores_itch_download_failed">itch.io отговори HTTP %1$d</string>
<string name="stores_free">Безплатна</string>
@@ -2158,6 +2175,7 @@
<string name="stores_login_close">Затвори</string>
<string name="stores_login_retry">Опитай отново</string>
<string name="stores_login_finishing">Завършване на входа…</string>
<string name="stores_xbox_sign_in_again">Microsoft отхвърли входа в Xbox. Излезте от Xbox в Магазини, влезте отново и след това продължете.</string>
<string name="stores_login_error_network">Страницата за вход не можа да се зареди: %1$s</string>
<string name="stores_login_error_idp_blocked">Този доставчик отказва вход от вградена страница. Впиши се с паролата си за магазина.</string>
<string name="stores_login_error_http">Страницата за вход отговори с грешка (HTTP %1$d).</string>
+18
View File
@@ -2046,6 +2046,23 @@
<string name="stores_itch_no_exe">Ve stahování nebyla nalezena hra pro Windows</string>
<string name="stores_itch_extract_failed">Stažený soubor nelze rozbalit (kód %1$d)</string>
<string name="stores_itch_no_catalog">itch.io neodpovědělo</string>
<string name="stores_itch_sort_popular">Populární</string>
<string name="stores_itch_sort_new">Nejnovější</string>
<string name="stores_itch_sort_new_popular">Nové a populární</string>
<string name="stores_itch_price_paid">Placené</string>
<string name="stores_itch_price_under_5">Do $5</string>
<string name="stores_itch_price_under_15">Do $15</string>
<string name="stores_itch_sort_top_rated">Nejlépe hodnocené</string>
<string name="stores_itch_sort_top_sellers">Nejprodávanější</string>
<string name="stores_itch_price_any">Jakákoli cena</string>
<string name="stores_itch_price_free">Zdarma</string>
<string name="stores_itch_price_sale">Ve slevě</string>
<string name="stores_itch_load_more">Načíst další</string>
<string name="stores_itch_platform_any">Libovolná platforma</string>
<string name="stores_itch_platform_mobile_web">Mobilní web</string>
<string name="stores_itch_tag_add">Přidat štítek</string>
<string name="stores_itch_tag_title">Filtrovat podle štítku</string>
<string name="stores_itch_browse_failed">Hry z itch.io se nepodařilo načíst</string>
<string name="stores_itch_archive">Archivy %1$s nejsou podporovány</string>
<string name="stores_itch_download_failed">itch.io odpovědělo HTTP %1$d</string>
<string name="stores_free">Zdarma</string>
@@ -2200,6 +2217,7 @@
<string name="stores_login_close">Zavřít</string>
<string name="stores_login_retry">Zkusit znovu</string>
<string name="stores_login_finishing">Dokončování přihlášení…</string>
<string name="stores_xbox_sign_in_again">Microsoft odmítl přihlášení k Xboxu. V Obchodech se z Xboxu odhlaste, znovu se přihlaste a pak pokračujte.</string>
<string name="stores_login_error_network">Přihlašovací stránku se nepodařilo načíst: %1$s</string>
<string name="stores_login_error_idp_blocked">Tento poskytovatel odmítá přihlášení ze vložené stránky. Přihlaste se místo toho heslem k obchodu.</string>
<string name="stores_login_error_http">Přihlašovací stránka odpověděla chybou (HTTP %1$d).</string>
+18
View File
@@ -2004,6 +2004,23 @@
<string name="stores_itch_no_exe">Der blev ikke fundet et Windows-spil i downloaden</string>
<string name="stores_itch_extract_failed">Downloaden kunne ikke udpakkes (kode %1$d)</string>
<string name="stores_itch_no_catalog">itch.io svarede ikke</string>
<string name="stores_itch_sort_popular">Populære</string>
<string name="stores_itch_sort_new">Seneste</string>
<string name="stores_itch_sort_new_popular">Nye og populære</string>
<string name="stores_itch_price_paid">Betalt</string>
<string name="stores_itch_price_under_5">$5 eller mindre</string>
<string name="stores_itch_price_under_15">$15 eller mindre</string>
<string name="stores_itch_sort_top_rated">Bedst bedømte</string>
<string name="stores_itch_sort_top_sellers">Mest solgte</string>
<string name="stores_itch_price_any">Alle priser</string>
<string name="stores_itch_price_free">Gratis</string>
<string name="stores_itch_price_sale">På tilbud</string>
<string name="stores_itch_load_more">Indlæs flere</string>
<string name="stores_itch_platform_any">Alle platforme</string>
<string name="stores_itch_platform_mobile_web">Mobilweb</string>
<string name="stores_itch_tag_add">Tilføj et tag</string>
<string name="stores_itch_tag_title">Filtrer efter tag</string>
<string name="stores_itch_browse_failed">Kunne ikke hente spil fra itch.io</string>
<string name="stores_itch_archive">%1$s-arkiver understøttes ikke</string>
<string name="stores_itch_download_failed">itch.io svarede HTTP %1$d</string>
<string name="stores_free">Gratis</string>
@@ -2158,6 +2175,7 @@
<string name="stores_login_close">Luk</string>
<string name="stores_login_retry">Forsøg igen</string>
<string name="stores_login_finishing">Afslutter login…</string>
<string name="stores_xbox_sign_in_again">Microsoft afviste Xbox-login. Log ud af Xbox under Butikker, log ind igen, og genoptag derefter.</string>
<string name="stores_login_error_network">Loginsiden kunne ikke indlæses: %1$s</string>
<string name="stores_login_error_idp_blocked">Denne udbyder afviser login fra en indlejret side. Log i stedet ind med din butikskodeord.</string>
<string name="stores_login_error_http">Loginsiden svarede med en fejl (HTTP %1$d).</string>
+18
View File
@@ -1996,6 +1996,23 @@
<string name="stores_itch_no_exe">Im Download wurde kein Windows-Spiel gefunden</string>
<string name="stores_itch_extract_failed">Download konnte nicht entpackt werden (Code %1$d)</string>
<string name="stores_itch_no_catalog">itch.io hat nicht geantwortet</string>
<string name="stores_itch_sort_popular">Beliebt</string>
<string name="stores_itch_sort_new">Neueste</string>
<string name="stores_itch_sort_new_popular">Neu und beliebt</string>
<string name="stores_itch_price_paid">Kostenpflichtig</string>
<string name="stores_itch_price_under_5">5 $ oder weniger</string>
<string name="stores_itch_price_under_15">15 $ oder weniger</string>
<string name="stores_itch_sort_top_rated">Bestbewertet</string>
<string name="stores_itch_sort_top_sellers">Meistverkauft</string>
<string name="stores_itch_price_any">Beliebiger Preis</string>
<string name="stores_itch_price_free">Kostenlos</string>
<string name="stores_itch_price_sale">Im Angebot</string>
<string name="stores_itch_load_more">Mehr laden</string>
<string name="stores_itch_platform_any">Beliebige Plattform</string>
<string name="stores_itch_platform_mobile_web">Mobiles Web</string>
<string name="stores_itch_tag_add">Tag hinzufügen</string>
<string name="stores_itch_tag_title">Nach Tag filtern</string>
<string name="stores_itch_browse_failed">Spiele von itch.io konnten nicht geladen werden</string>
<string name="stores_itch_archive">%1$s-Archive werden nicht unterstützt</string>
<string name="stores_itch_download_failed">itch.io antwortete mit HTTP %1$d</string>
<string name="stores_free">Kostenlos</string>
@@ -2147,6 +2164,7 @@
<string name="stores_login_close">Schließen</string>
<string name="stores_login_retry">Erneut versuchen</string>
<string name="stores_login_finishing">Anmeldung wird abgeschlossen…</string>
<string name="stores_xbox_sign_in_again">Microsoft hat die Xbox-Anmeldung abgelehnt. Melde dich unter Stores von Xbox ab, melde dich erneut an und setze dann fort.</string>
<string name="stores_login_error_network">Die Anmeldeseite konnte nicht geladen werden: %1$s</string>
<string name="stores_login_error_idp_blocked">Dieser Anbieter lässt keine Anmeldung über eine eingebettete Seite zu. Melde dich stattdessen mit deinem Store-Passwort an.</string>
<string name="stores_login_error_http">Die Anmeldeseite antwortete mit einem Fehler (HTTP %1$d).</string>
+18
View File
@@ -2004,6 +2004,23 @@
<string name="stores_itch_no_exe">Δεν βρέθηκε παιχνίδι Windows στη λήψη</string>
<string name="stores_itch_extract_failed">Δεν ήταν δυνατή η αποσυμπίεση της λήψης (κωδικός %1$d)</string>
<string name="stores_itch_no_catalog">Το itch.io δεν απάντησε</string>
<string name="stores_itch_sort_popular">Δημοφιλή</string>
<string name="stores_itch_sort_new">Πιο πρόσφατα</string>
<string name="stores_itch_sort_new_popular">Νέα και δημοφιλή</string>
<string name="stores_itch_price_paid">Επί πληρωμή</string>
<string name="stores_itch_price_under_5">$5 ή λιγότερο</string>
<string name="stores_itch_price_under_15">$15 ή λιγότερο</string>
<string name="stores_itch_sort_top_rated">Κορυφαία βαθμολογία</string>
<string name="stores_itch_sort_top_sellers">Μπεστ σέλερ</string>
<string name="stores_itch_price_any">Οποιαδήποτε τιμή</string>
<string name="stores_itch_price_free">Δωρεάν</string>
<string name="stores_itch_price_sale">Σε προσφορά</string>
<string name="stores_itch_load_more">Φόρτωση περισσότερων</string>
<string name="stores_itch_platform_any">Οποιαδήποτε πλατφόρμα</string>
<string name="stores_itch_platform_mobile_web">Mobile web</string>
<string name="stores_itch_tag_add">Προσθήκη ετικέτας</string>
<string name="stores_itch_tag_title">Φιλτράρισμα ανά ετικέτα</string>
<string name="stores_itch_browse_failed">Δεν ήταν δυνατή η φόρτωση παιχνιδιών από το itch.io</string>
<string name="stores_itch_archive">Τα αρχεία %1$s δεν υποστηρίζονται</string>
<string name="stores_itch_download_failed">Το itch.io απάντησε HTTP %1$d</string>
<string name="stores_free">Δωρεάν</string>
@@ -2158,6 +2175,7 @@
<string name="stores_login_close">Κλείσιμο</string>
<string name="stores_login_retry">Δοκιμάστε ξανά</string>
<string name="stores_login_finishing">Ολοκλήρωση σύνδεσης…</string>
<string name="stores_xbox_sign_in_again">Η Microsoft απέρριψε τη σύνδεση στο Xbox. Αποσυνδεθείτε από το Xbox στα Καταστήματα, συνδεθείτε ξανά και μετά συνεχίστε.</string>
<string name="stores_login_error_network">Δεν ήταν δυνατή η φόρτωση της σελίδας σύνδεσης: %1$s</string>
<string name="stores_login_error_idp_blocked">Αυτός ο πάροχος αρνείται να συνδεθεί από μια ενσωματωμένη σελίδα. Συνδεθείτε με τον κωδικό πρόσβασης του καταστήματός σας αντ\' αυτού.</string>
<string name="stores_login_error_http">Η σελίδα σύνδεσης απάντησε με σφάλμα (HTTP %1$d).</string>
+18
View File
@@ -2027,6 +2027,23 @@
<string name="stores_itch_no_exe">No se ha encontrado un juego de Windows en la descarga</string>
<string name="stores_itch_extract_failed">No se ha podido extraer la descarga (código %1$d)</string>
<string name="stores_itch_no_catalog">itch.io no respondió</string>
<string name="stores_itch_sort_popular">Populares</string>
<string name="stores_itch_sort_new">Más recientes</string>
<string name="stores_itch_sort_new_popular">Nuevos y populares</string>
<string name="stores_itch_price_paid">De pago</string>
<string name="stores_itch_price_under_5">5 $ o menos</string>
<string name="stores_itch_price_under_15">15 $ o menos</string>
<string name="stores_itch_sort_top_rated">Mejor valorados</string>
<string name="stores_itch_sort_top_sellers">Más vendidos</string>
<string name="stores_itch_price_any">Cualquier precio</string>
<string name="stores_itch_price_free">Gratis</string>
<string name="stores_itch_price_sale">En oferta</string>
<string name="stores_itch_load_more">Cargar más</string>
<string name="stores_itch_platform_any">Cualquier plataforma</string>
<string name="stores_itch_platform_mobile_web">Web móvil</string>
<string name="stores_itch_tag_add">Añadir una etiqueta</string>
<string name="stores_itch_tag_title">Filtrar por etiqueta</string>
<string name="stores_itch_browse_failed">No se pudieron cargar los juegos de itch.io</string>
<string name="stores_itch_archive">Los archivos %1$s no son compatibles</string>
<string name="stores_itch_download_failed">itch.io respondió HTTP %1$d</string>
<string name="stores_free">Gratis</string>
@@ -2178,6 +2195,7 @@
<string name="stores_login_close">Cerrar</string>
<string name="stores_login_retry">Reintentar</string>
<string name="stores_login_finishing">Terminando de iniciar sesión…</string>
<string name="stores_xbox_sign_in_again">Microsoft ha rechazado el inicio de sesión de Xbox. Cierra sesión de Xbox en Tiendas, vuelve a iniciar sesión y reanuda.</string>
<string name="stores_login_error_network">No se pudo cargar la página de inicio de sesión: %1$s</string>
<string name="stores_login_error_idp_blocked">Este proveedor no permite iniciar sesión desde una página integrada. Inicia sesión con la contraseña de la tienda.</string>
<string name="stores_login_error_http">La página de inicio de sesión respondió con un error (HTTP %1$d).</string>
+18
View File
@@ -2004,6 +2004,23 @@
<string name="stores_itch_no_exe">Latauksesta ei löytynyt Windows-peliä</string>
<string name="stores_itch_extract_failed">Latausta ei voitu purkaa (koodi %1$d)</string>
<string name="stores_itch_no_catalog">itch.io ei vastannut</string>
<string name="stores_itch_sort_popular">Suositut</string>
<string name="stores_itch_sort_new">Uusimmat</string>
<string name="stores_itch_sort_new_popular">Uudet ja suositut</string>
<string name="stores_itch_price_paid">Maksulliset</string>
<string name="stores_itch_price_under_5">Enintään 5 $</string>
<string name="stores_itch_price_under_15">Enintään 15 $</string>
<string name="stores_itch_sort_top_rated">Parhaiten arvioidut</string>
<string name="stores_itch_sort_top_sellers">Myydyimmät</string>
<string name="stores_itch_price_any">Mikä tahansa hinta</string>
<string name="stores_itch_price_free">Ilmaiset</string>
<string name="stores_itch_price_sale">Alennuksessa</string>
<string name="stores_itch_load_more">Lataa lisää</string>
<string name="stores_itch_platform_any">Mikä tahansa alusta</string>
<string name="stores_itch_platform_mobile_web">Mobiiliweb</string>
<string name="stores_itch_tag_add">Lisää tunniste</string>
<string name="stores_itch_tag_title">Suodata tunnisteella</string>
<string name="stores_itch_browse_failed">Pelien lataaminen itch.io:sta epäonnistui</string>
<string name="stores_itch_archive">%1$s-arkistot eivät ole tuettuja</string>
<string name="stores_itch_download_failed">itch.io vastasi HTTP %1$d</string>
<string name="stores_free">Ilmainen</string>
@@ -2158,6 +2175,7 @@
<string name="stores_login_close">Sulje</string>
<string name="stores_login_retry">Yritä uudelleen</string>
<string name="stores_login_finishing">Viimeistellään kirjautumista…</string>
<string name="stores_xbox_sign_in_again">Microsoft hylkäsi Xbox-kirjautumisen. Kirjaudu ulos Xboxista Kaupoissa, kirjaudu uudelleen sisään ja jatka sitten.</string>
<string name="stores_login_error_network">Kirjautumissivua ei voitu latata: %1$s</string>
<string name="stores_login_error_idp_blocked">Tämä palveluntarjoaja ei salli kirjautumista upotetulta sivulta. Kirjaudu sisään kaupan salasanalla sen sijaan.</string>
<string name="stores_login_error_http">Kirjautumissivu vastasi virheellä (HTTP %1$d).</string>
+18
View File
@@ -2027,6 +2027,23 @@
<string name="stores_itch_no_exe">Aucun jeu Windows trouvé dans le téléchargement</string>
<string name="stores_itch_extract_failed">Impossible d\'extraire le téléchargement (code %1$d)</string>
<string name="stores_itch_no_catalog">itch.io n\'a pas répondu</string>
<string name="stores_itch_sort_popular">Populaires</string>
<string name="stores_itch_sort_new">Plus récents</string>
<string name="stores_itch_sort_new_popular">Nouveautés populaires</string>
<string name="stores_itch_price_paid">Payants</string>
<string name="stores_itch_price_under_5">5 $ ou moins</string>
<string name="stores_itch_price_under_15">15 $ ou moins</string>
<string name="stores_itch_sort_top_rated">Les mieux notés</string>
<string name="stores_itch_sort_top_sellers">Meilleures ventes</string>
<string name="stores_itch_price_any">Tous les prix</string>
<string name="stores_itch_price_free">Gratuits</string>
<string name="stores_itch_price_sale">En promotion</string>
<string name="stores_itch_load_more">Charger plus</string>
<string name="stores_itch_platform_any">Toute plateforme</string>
<string name="stores_itch_platform_mobile_web">Web mobile</string>
<string name="stores_itch_tag_add">Ajouter un tag</string>
<string name="stores_itch_tag_title">Filtrer par tag</string>
<string name="stores_itch_browse_failed">Impossible de charger les jeux d\'itch.io</string>
<string name="stores_itch_archive">Les archives %1$s ne sont pas prises en charge</string>
<string name="stores_itch_download_failed">itch.io a répondu HTTP %1$d</string>
<string name="stores_free">Gratuit</string>
@@ -2178,6 +2195,7 @@
<string name="stores_login_close">Fermer</string>
<string name="stores_login_retry">Réessayer</string>
<string name="stores_login_finishing">Finalisation de la connexion…</string>
<string name="stores_xbox_sign_in_again">Microsoft a refusé la connexion Xbox. Déconnectez-vous de Xbox dans Boutiques, reconnectez-vous, puis reprenez.</string>
<string name="stores_login_error_network">Impossible de charger la page de connexion : %1$s</string>
<string name="stores_login_error_idp_blocked">Ce fournisseur refuse la connexion depuis une page intégrée. Connectez-vous plutôt avec le mot de passe de la boutique.</string>
<string name="stores_login_error_http">La page de connexion a renvoyé une erreur (HTTP %1$d).</string>
+18
View File
@@ -2004,6 +2004,23 @@
<string name="stores_itch_no_exe">डाउनलोड में कोई Windows गेम नहीं मिला</string>
<string name="stores_itch_extract_failed">डाउनलोड एक्सट्रैक्ट नहीं हो सका (कोड %1$d)</string>
<string name="stores_itch_no_catalog">itch.io ने जवाब नहीं दिया</string>
<string name="stores_itch_sort_popular">लोकप्रिय</string>
<string name="stores_itch_sort_new">सबसे हाल के</string>
<string name="stores_itch_sort_new_popular">नए और लोकप्रिय</string>
<string name="stores_itch_price_paid">सशुल्क</string>
<string name="stores_itch_price_under_5">$5 या कम</string>
<string name="stores_itch_price_under_15">$15 या कम</string>
<string name="stores_itch_sort_top_rated">सबसे ऊँची रेटिंग</string>
<string name="stores_itch_sort_top_sellers">सबसे ज़्यादा बिकने वाले</string>
<string name="stores_itch_price_any">कोई भी कीमत</string>
<string name="stores_itch_price_free">मुफ़्त</string>
<string name="stores_itch_price_sale">सेल में</string>
<string name="stores_itch_load_more">और लोड करें</string>
<string name="stores_itch_platform_any">कोई भी प्लेटफ़ॉर्म</string>
<string name="stores_itch_platform_mobile_web">मोबाइल वेब</string>
<string name="stores_itch_tag_add">टैग जोड़ें</string>
<string name="stores_itch_tag_title">टैग के अनुसार फ़िल्टर करें</string>
<string name="stores_itch_browse_failed">itch.io से गेम लोड नहीं हो सके</string>
<string name="stores_itch_archive">%1$s आर्काइव समर्थित नहीं हैं</string>
<string name="stores_itch_download_failed">itch.io ने HTTP %1$d लौटाया</string>
<string name="stores_free">फ़्री</string>
@@ -2158,6 +2175,7 @@
<string name="stores_login_close">बंद करें</string>
<string name="stores_login_retry">फिर कोशिश करें</string>
<string name="stores_login_finishing">साइन-इन पूरा हो रहा है…</string>
<string name="stores_xbox_sign_in_again">Microsoft ने Xbox साइन-इन अस्वीकार कर दिया। स्टोर्स में Xbox से साइन आउट करें, फिर से साइन इन करें, फिर जारी रखें।</string>
<string name="stores_login_error_network">साइन-इन पेज लोड नहीं हो सका: %1$s</string>
<string name="stores_login_error_idp_blocked">यह प्रोवाइडर एम्बेडेड पेज से साइन इन करने से मना करता है। इसके बदले अपने स्टोर पासवर्ड से साइन इन करें।</string>
<string name="stores_login_error_http">साइन-इन पेज ने एक एरर के साथ जवाब दिया (HTTP %1$d)।</string>
+18
View File
@@ -2004,6 +2004,23 @@
<string name="stores_itch_no_exe">A letöltésben nem található Windows-játék</string>
<string name="stores_itch_extract_failed">A letöltés nem bontható ki (kód: %1$d)</string>
<string name="stores_itch_no_catalog">Az itch.io nem válaszolt</string>
<string name="stores_itch_sort_popular">Népszerű</string>
<string name="stores_itch_sort_new">Legfrissebb</string>
<string name="stores_itch_sort_new_popular">Új és népszerű</string>
<string name="stores_itch_price_paid">Fizetős</string>
<string name="stores_itch_price_under_5">Legfeljebb 5 $</string>
<string name="stores_itch_price_under_15">Legfeljebb 15 $</string>
<string name="stores_itch_sort_top_rated">Legjobbra értékelt</string>
<string name="stores_itch_sort_top_sellers">Legkelendőbb</string>
<string name="stores_itch_price_any">Bármilyen ár</string>
<string name="stores_itch_price_free">Ingyenes</string>
<string name="stores_itch_price_sale">Akciós</string>
<string name="stores_itch_load_more">Továbbiak betöltése</string>
<string name="stores_itch_platform_any">Bármely platform</string>
<string name="stores_itch_platform_mobile_web">Mobilweb</string>
<string name="stores_itch_tag_add">Címke hozzáadása</string>
<string name="stores_itch_tag_title">Szűrés címke szerint</string>
<string name="stores_itch_browse_failed">Nem sikerült betölteni a játékokat az itch.io-ról</string>
<string name="stores_itch_archive">A(z) %1$s archívumok nem támogatottak</string>
<string name="stores_itch_download_failed">Az itch.io HTTP %1$d választ adott</string>
<string name="stores_free">Ingyenes</string>
@@ -2158,6 +2175,7 @@
<string name="stores_login_close">Bezárás</string>
<string name="stores_login_retry">Próbálja újra</string>
<string name="stores_login_finishing">A bejelentkezés befejezése…</string>
<string name="stores_xbox_sign_in_again">A Microsoft elutasította az Xbox-bejelentkezést. Az Áruházakban jelentkezz ki az Xboxból, jelentkezz be újra, majd folytasd.</string>
<string name="stores_login_error_network">Nem sikerült betölteni a bejelentkezési oldalt: %1$s</string>
<string name="stores_login_error_idp_blocked">Ez a szolgáltató nem engedi a bejelentkezést egy beágyazott oldalról. Jelentkezzen be helyette az áruház jelszavával.</string>
<string name="stores_login_error_http">A bejelentkezési oldal hibával válaszolt (HTTP %1$d).</string>
+18
View File
@@ -1983,6 +1983,23 @@
<string name="stores_itch_no_exe">Tidak ada game Windows di unduhan</string>
<string name="stores_itch_extract_failed">Tidak dapat mengekstrak unduhan (kode %1$d)</string>
<string name="stores_itch_no_catalog">itch.io tidak menjawab</string>
<string name="stores_itch_sort_popular">Populer</string>
<string name="stores_itch_sort_new">Terbaru</string>
<string name="stores_itch_sort_new_popular">Baru dan populer</string>
<string name="stores_itch_price_paid">Berbayar</string>
<string name="stores_itch_price_under_5">$5 atau kurang</string>
<string name="stores_itch_price_under_15">$15 atau kurang</string>
<string name="stores_itch_sort_top_rated">Rating tertinggi</string>
<string name="stores_itch_sort_top_sellers">Terlaris</string>
<string name="stores_itch_price_any">Harga apa saja</string>
<string name="stores_itch_price_free">Gratis</string>
<string name="stores_itch_price_sale">Diskon</string>
<string name="stores_itch_load_more">Muat lebih banyak</string>
<string name="stores_itch_platform_any">Platform apa saja</string>
<string name="stores_itch_platform_mobile_web">Web seluler</string>
<string name="stores_itch_tag_add">Tambah tag</string>
<string name="stores_itch_tag_title">Filter berdasarkan tag</string>
<string name="stores_itch_browse_failed">Tidak dapat memuat game dari itch.io</string>
<string name="stores_itch_archive">Arsip %1$s tidak didukung</string>
<string name="stores_itch_download_failed">itch.io menjawab HTTP %1$d</string>
<string name="stores_free">Gratis</string>
@@ -2137,6 +2154,7 @@
<string name="stores_login_close">Tutup</string>
<string name="stores_login_retry">Coba lagi</string>
<string name="stores_login_finishing">Menyelesaikan proses masuk…</string>
<string name="stores_xbox_sign_in_again">Microsoft menolak masuk Xbox. Keluar dari Xbox di Toko, masuk lagi, lalu lanjutkan.</string>
<string name="stores_login_error_network">Halaman masuk tidak dapat dimuat: %1$s</string>
<string name="stores_login_error_idp_blocked">Penyedia ini menolak proses masuk dari halaman tersemat. Masuk dengan kata sandi toko Anda sebagai gantinya.</string>
<string name="stores_login_error_http">Halaman masuk merespons dengan kesalahan (HTTP %1$d).</string>
+18
View File
@@ -2017,6 +2017,23 @@
<string name="stores_itch_no_exe">Nessun gioco Windows trovato nel download</string>
<string name="stores_itch_extract_failed">Impossibile estrarre il download (codice %1$d)</string>
<string name="stores_itch_no_catalog">itch.io non ha risposto</string>
<string name="stores_itch_sort_popular">Popolari</string>
<string name="stores_itch_sort_new">Più recenti</string>
<string name="stores_itch_sort_new_popular">Nuovi e popolari</string>
<string name="stores_itch_price_paid">A pagamento</string>
<string name="stores_itch_price_under_5">5 $ o meno</string>
<string name="stores_itch_price_under_15">15 $ o meno</string>
<string name="stores_itch_sort_top_rated">I più votati</string>
<string name="stores_itch_sort_top_sellers">I più venduti</string>
<string name="stores_itch_price_any">Qualsiasi prezzo</string>
<string name="stores_itch_price_free">Gratis</string>
<string name="stores_itch_price_sale">In offerta</string>
<string name="stores_itch_load_more">Carica altri</string>
<string name="stores_itch_platform_any">Qualsiasi piattaforma</string>
<string name="stores_itch_platform_mobile_web">Web mobile</string>
<string name="stores_itch_tag_add">Aggiungi un tag</string>
<string name="stores_itch_tag_title">Filtra per tag</string>
<string name="stores_itch_browse_failed">Impossibile caricare i giochi da itch.io</string>
<string name="stores_itch_archive">Gli archivi %1$s non sono supportati</string>
<string name="stores_itch_download_failed">itch.io ha risposto HTTP %1$d</string>
<string name="stores_free">Gratis</string>
@@ -2168,6 +2185,7 @@
<string name="stores_login_close">Chiudi</string>
<string name="stores_login_retry">Riprova</string>
<string name="stores_login_finishing">Completamento dell\'accesso…</string>
<string name="stores_xbox_sign_in_again">Microsoft ha rifiutato l\'accesso a Xbox. Esci da Xbox in Negozi, accedi di nuovo, poi riprendi.</string>
<string name="stores_login_error_network">Impossibile caricare la pagina di accesso: %1$s</string>
<string name="stores_login_error_idp_blocked">Questo provider non consente l\'accesso da una pagina incorporata. Accedi invece con la password del negozio.</string>
<string name="stores_login_error_http">La pagina di accesso ha risposto con un errore (HTTP %1$d).</string>
+18
View File
@@ -1985,6 +1985,23 @@
<string name="stores_itch_no_exe">ダウンロードに Windows 版のゲームが見つかりません</string>
<string name="stores_itch_extract_failed">ダウンロードを展開できませんでした (終了コード %1$d)</string>
<string name="stores_itch_no_catalog">itch.io から応答がありません</string>
<string name="stores_itch_sort_popular">人気</string>
<string name="stores_itch_sort_new">新着順</string>
<string name="stores_itch_sort_new_popular">新着&人気</string>
<string name="stores_itch_price_paid">有料</string>
<string name="stores_itch_price_under_5">5ドル以下</string>
<string name="stores_itch_price_under_15">15ドル以下</string>
<string name="stores_itch_sort_top_rated">高評価</string>
<string name="stores_itch_sort_top_sellers">売れ筋</string>
<string name="stores_itch_price_any">すべての価格</string>
<string name="stores_itch_price_free">無料</string>
<string name="stores_itch_price_sale">セール中</string>
<string name="stores_itch_load_more">さらに読み込む</string>
<string name="stores_itch_platform_any">すべてのプラットフォーム</string>
<string name="stores_itch_platform_mobile_web">モバイルWeb</string>
<string name="stores_itch_tag_add">タグを追加</string>
<string name="stores_itch_tag_title">タグで絞り込む</string>
<string name="stores_itch_browse_failed">itch.io のゲームを読み込めませんでした</string>
<string name="stores_itch_archive">%1$s 形式のアーカイブには対応していません</string>
<string name="stores_itch_download_failed">itch.io が HTTP %1$d を返しました</string>
<string name="stores_free">無料</string>
@@ -2139,6 +2156,7 @@
<string name="stores_login_close">閉じる</string>
<string name="stores_login_retry">再試行</string>
<string name="stores_login_finishing">ログインを完了しています…</string>
<string name="stores_xbox_sign_in_again">Microsoft が Xbox のサインインを拒否しました。ストアで Xbox からサインアウトし、もう一度サインインしてから再開してください。</string>
<string name="stores_login_error_network">ログインページを読み込めませんでした:%1$s</string>
<string name="stores_login_error_idp_blocked">このプロバイダーは埋め込みページからのログインを拒否しています。代わりにストアのパスワードでログインしてください。</string>
<string name="stores_login_error_http">ログインページがエラーを返しました(HTTP %1$d)。</string>
+18
View File
@@ -1985,6 +1985,23 @@
<string name="stores_itch_no_exe">다운로드에서 Windows 게임을 찾을 수 없습니다</string>
<string name="stores_itch_extract_failed">다운로드한 파일의 압축을 풀 수 없습니다(코드 %1$d)</string>
<string name="stores_itch_no_catalog">itch.io가 응답하지 않았습니다</string>
<string name="stores_itch_sort_popular">인기</string>
<string name="stores_itch_sort_new">최신순</string>
<string name="stores_itch_sort_new_popular">신규 및 인기</string>
<string name="stores_itch_price_paid">유료</string>
<string name="stores_itch_price_under_5">$5 이하</string>
<string name="stores_itch_price_under_15">$15 이하</string>
<string name="stores_itch_sort_top_rated">평점 높은 순</string>
<string name="stores_itch_sort_top_sellers">베스트셀러</string>
<string name="stores_itch_price_any">모든 가격</string>
<string name="stores_itch_price_free">무료</string>
<string name="stores_itch_price_sale">할인 중</string>
<string name="stores_itch_load_more">더 불러오기</string>
<string name="stores_itch_platform_any">모든 플랫폼</string>
<string name="stores_itch_platform_mobile_web">모바일 웹</string>
<string name="stores_itch_tag_add">태그 추가</string>
<string name="stores_itch_tag_title">태그로 필터링</string>
<string name="stores_itch_browse_failed">itch.io에서 게임을 불러오지 못했습니다</string>
<string name="stores_itch_archive">%1$s 압축 파일은 지원하지 않습니다</string>
<string name="stores_itch_download_failed">itch.io가 HTTP %1$d을(를) 반환했습니다</string>
<string name="stores_free">무료</string>
@@ -2139,6 +2156,7 @@
<string name="stores_login_close">닫기</string>
<string name="stores_login_retry">다시 시도</string>
<string name="stores_login_finishing">로그인 완료 중…</string>
<string name="stores_xbox_sign_in_again">Microsoft에서 Xbox 로그인을 거부했습니다. 스토어에서 Xbox 로그아웃 후 다시 로그인한 다음 재개하세요.</string>
<string name="stores_login_error_network">로그인 페이지를 불러올 수 없습니다: %1$s</string>
<string name="stores_login_error_idp_blocked">이 제공업체는 앱에 포함된 페이지에서 로그인을 허용하지 않습니다. 대신 스토어 비밀번호로 로그인하세요.</string>
<string name="stores_login_error_http">로그인 페이지에서 오류를 반환했습니다(HTTP %1$d).</string>
+18
View File
@@ -1983,6 +1983,23 @@
<string name="stores_itch_no_exe">Tiada permainan Windows ditemui dalam muat turun</string>
<string name="stores_itch_extract_failed">Tidak dapat mengekstrak muat turun (kod %1$d)</string>
<string name="stores_itch_no_catalog">itch.io tidak menjawab</string>
<string name="stores_itch_sort_popular">Popular</string>
<string name="stores_itch_sort_new">Terkini</string>
<string name="stores_itch_sort_new_popular">Baharu dan popular</string>
<string name="stores_itch_price_paid">Berbayar</string>
<string name="stores_itch_price_under_5">$5 atau kurang</string>
<string name="stores_itch_price_under_15">$15 atau kurang</string>
<string name="stores_itch_sort_top_rated">Penilaian tertinggi</string>
<string name="stores_itch_sort_top_sellers">Terlaris</string>
<string name="stores_itch_price_any">Sebarang harga</string>
<string name="stores_itch_price_free">Percuma</string>
<string name="stores_itch_price_sale">Diskaun</string>
<string name="stores_itch_load_more">Muat lagi</string>
<string name="stores_itch_platform_any">Mana-mana platform</string>
<string name="stores_itch_platform_mobile_web">Web mudah alih</string>
<string name="stores_itch_tag_add">Tambah tag</string>
<string name="stores_itch_tag_title">Tapis mengikut tag</string>
<string name="stores_itch_browse_failed">Tidak dapat memuatkan permainan daripada itch.io</string>
<string name="stores_itch_archive">Arkib %1$s tidak disokong</string>
<string name="stores_itch_download_failed">itch.io menjawab HTTP %1$d</string>
<string name="stores_free">Percuma</string>
@@ -2137,6 +2154,7 @@
<string name="stores_login_close">Tutup</string>
<string name="stores_login_retry">Cuba lagi</string>
<string name="stores_login_finishing">Menyelesaikan log masuk…</string>
<string name="stores_xbox_sign_in_again">Microsoft menolak log masuk Xbox. Log keluar daripada Xbox di Kedai, log masuk semula, kemudian sambung.</string>
<string name="stores_login_error_network">Halaman log masuk tidak dapat dimuatkan: %1$s</string>
<string name="stores_login_error_idp_blocked">Penyedia ini menolak log masuk daripada halaman terbenam. Log masuk dengan kata laluan kedai anda sebaliknya.</string>
<string name="stores_login_error_http">Halaman log masuk menjawab dengan ralat (HTTP %1$d).</string>
+18
View File
@@ -2004,6 +2004,23 @@
<string name="stores_itch_no_exe">Fant ikke noe Windows-spill i nedlastingen</string>
<string name="stores_itch_extract_failed">Kunne ikke pakke ut nedlastingen (kode %1$d)</string>
<string name="stores_itch_no_catalog">itch.io svarte ikke</string>
<string name="stores_itch_sort_popular">Populære</string>
<string name="stores_itch_sort_new">Nyeste</string>
<string name="stores_itch_sort_new_popular">Nye og populære</string>
<string name="stores_itch_price_paid">Betalt</string>
<string name="stores_itch_price_under_5">$5 eller mindre</string>
<string name="stores_itch_price_under_15">$15 eller mindre</string>
<string name="stores_itch_sort_top_rated">Best vurdert</string>
<string name="stores_itch_sort_top_sellers">Mest solgt</string>
<string name="stores_itch_price_any">Alle priser</string>
<string name="stores_itch_price_free">Gratis</string>
<string name="stores_itch_price_sale">På salg</string>
<string name="stores_itch_load_more">Last inn flere</string>
<string name="stores_itch_platform_any">Alle plattformer</string>
<string name="stores_itch_platform_mobile_web">Web på mobil</string>
<string name="stores_itch_tag_add">Legg til en tagg</string>
<string name="stores_itch_tag_title">Filtrer etter tagg</string>
<string name="stores_itch_browse_failed">Kunne ikke laste spill fra itch.io</string>
<string name="stores_itch_archive">%1$s-arkiver støttes ikke</string>
<string name="stores_itch_download_failed">itch.io svarte HTTP %1$d</string>
<string name="stores_free">Gratis</string>
@@ -2158,6 +2175,7 @@
<string name="stores_login_close">Lukk</string>
<string name="stores_login_retry">Prøv igjen</string>
<string name="stores_login_finishing">Fullfører innlogging…</string>
<string name="stores_xbox_sign_in_again">Microsoft avviste Xbox-påloggingen. Logg ut av Xbox under Butikker, logg på igjen, og fortsett deretter.</string>
<string name="stores_login_error_network">Innloggingssiden kunne ikke lastes: %1$s</string>
<string name="stores_login_error_idp_blocked">Denne leverandøren tillater ikke innlogging fra en innebygd side. Logg inn med butikkpassordet ditt i stedet.</string>
<string name="stores_login_error_http">Innloggingssiden svarte med en feil (HTTP %1$d).</string>
+18
View File
@@ -2004,6 +2004,23 @@
<string name="stores_itch_no_exe">Geen Windows-game gevonden in de download</string>
<string name="stores_itch_extract_failed">Download kan niet worden uitgepakt (code %1$d)</string>
<string name="stores_itch_no_catalog">itch.io gaf geen antwoord</string>
<string name="stores_itch_sort_popular">Populair</string>
<string name="stores_itch_sort_new">Meest recent</string>
<string name="stores_itch_sort_new_popular">Nieuw en populair</string>
<string name="stores_itch_price_paid">Betaald</string>
<string name="stores_itch_price_under_5">$5 of minder</string>
<string name="stores_itch_price_under_15">$15 of minder</string>
<string name="stores_itch_sort_top_rated">Hoogst beoordeeld</string>
<string name="stores_itch_sort_top_sellers">Bestverkocht</string>
<string name="stores_itch_price_any">Elke prijs</string>
<string name="stores_itch_price_free">Gratis</string>
<string name="stores_itch_price_sale">In de aanbieding</string>
<string name="stores_itch_load_more">Meer laden</string>
<string name="stores_itch_platform_any">Elk platform</string>
<string name="stores_itch_platform_mobile_web">Mobiel web</string>
<string name="stores_itch_tag_add">Tag toevoegen</string>
<string name="stores_itch_tag_title">Filteren op tag</string>
<string name="stores_itch_browse_failed">Games van itch.io konden niet worden geladen</string>
<string name="stores_itch_archive">%1$s-archieven worden niet ondersteund</string>
<string name="stores_itch_download_failed">itch.io antwoordde HTTP %1$d</string>
<string name="stores_free">Gratis</string>
@@ -2158,6 +2175,7 @@
<string name="stores_login_close">Sluiten</string>
<string name="stores_login_retry">Probeer het opnieuw</string>
<string name="stores_login_finishing">Aanmelden afronden…</string>
<string name="stores_xbox_sign_in_again">Microsoft heeft de Xbox-aanmelding geweigerd. Meld je af bij Xbox in Winkels, meld je opnieuw aan en hervat daarna.</string>
<string name="stores_login_error_network">De aanmeldpagina kon niet worden geladen: %1$s</string>
<string name="stores_login_error_idp_blocked">Deze provider staat geen aanmelding via een ingesloten pagina toe. Meld je in plaats daarvan aan met je winkelwachtwoord.</string>
<string name="stores_login_error_http">De aanmeldpagina gaf een foutmelding (HTTP %1$d).</string>
+18
View File
@@ -2046,6 +2046,23 @@
<string name="stores_itch_no_exe">W pobranych plikach nie znaleziono gry na Windows</string>
<string name="stores_itch_extract_failed">Nie można rozpakować pobranego pliku (kod %1$d)</string>
<string name="stores_itch_no_catalog">itch.io nie odpowiedziało</string>
<string name="stores_itch_sort_popular">Popularne</string>
<string name="stores_itch_sort_new">Najnowsze</string>
<string name="stores_itch_sort_new_popular">Nowe i popularne</string>
<string name="stores_itch_price_paid">Płatne</string>
<string name="stores_itch_price_under_5">Do 5 $</string>
<string name="stores_itch_price_under_15">Do 15 $</string>
<string name="stores_itch_sort_top_rated">Najwyżej oceniane</string>
<string name="stores_itch_sort_top_sellers">Najlepiej sprzedające się</string>
<string name="stores_itch_price_any">Dowolna cena</string>
<string name="stores_itch_price_free">Za darmo</string>
<string name="stores_itch_price_sale">Na wyprzedaży</string>
<string name="stores_itch_load_more">Wczytaj więcej</string>
<string name="stores_itch_platform_any">Dowolna platforma</string>
<string name="stores_itch_platform_mobile_web">Web mobilny</string>
<string name="stores_itch_tag_add">Dodaj tag</string>
<string name="stores_itch_tag_title">Filtruj według tagu</string>
<string name="stores_itch_browse_failed">Nie udało się wczytać gier z itch.io</string>
<string name="stores_itch_archive">Archiwa %1$s nie są obsługiwane</string>
<string name="stores_itch_download_failed">itch.io odpowiedziało HTTP %1$d</string>
<string name="stores_free">Bezpłatna</string>
@@ -2203,6 +2220,7 @@
<string name="stores_login_close">Zamknij</string>
<string name="stores_login_retry">Spróbuj ponownie</string>
<string name="stores_login_finishing">Kończenie logowania…</string>
<string name="stores_xbox_sign_in_again">Microsoft odrzucił logowanie do Xbox. Wyloguj się z Xbox w Sklepach, zaloguj się ponownie, a potem wznów.</string>
<string name="stores_login_error_network">Nie udało się wczytać strony logowania: %1$s</string>
<string name="stores_login_error_idp_blocked">Ten dostawca odmawia logowania z osadzonej strony. Zaloguj się za pomocą hasła do sklepu.</string>
<string name="stores_login_error_http">Strona logowania odpowiedziała błędem (HTTP %1$d).</string>
@@ -2017,6 +2017,23 @@
<string name="stores_itch_no_exe">Não foi encontrado nenhum jogo para Windows na transferência</string>
<string name="stores_itch_extract_failed">Não foi possível extrair a transferência (código %1$d)</string>
<string name="stores_itch_no_catalog">O itch.io não respondeu</string>
<string name="stores_itch_sort_popular">Populares</string>
<string name="stores_itch_sort_new">Mais recentes</string>
<string name="stores_itch_sort_new_popular">Novos e populares</string>
<string name="stores_itch_price_paid">Pagos</string>
<string name="stores_itch_price_under_5">5 $ ou menos</string>
<string name="stores_itch_price_under_15">15 $ ou menos</string>
<string name="stores_itch_sort_top_rated">Mais bem avaliados</string>
<string name="stores_itch_sort_top_sellers">Mais vendidos</string>
<string name="stores_itch_price_any">Qualquer preço</string>
<string name="stores_itch_price_free">Grátis</string>
<string name="stores_itch_price_sale">Em promoção</string>
<string name="stores_itch_load_more">Carregar mais</string>
<string name="stores_itch_platform_any">Qualquer plataforma</string>
<string name="stores_itch_platform_mobile_web">Web móvel</string>
<string name="stores_itch_tag_add">Adicionar uma etiqueta</string>
<string name="stores_itch_tag_title">Filtrar por etiqueta</string>
<string name="stores_itch_browse_failed">Não foi possível carregar os jogos do itch.io</string>
<string name="stores_itch_archive">Ficheiros %1$s não são suportados</string>
<string name="stores_itch_download_failed">O itch.io respondeu HTTP %1$d</string>
<string name="stores_free">Grátis</string>
@@ -2168,6 +2185,7 @@
<string name="stores_login_close">Fechar</string>
<string name="stores_login_retry">Tentar novamente</string>
<string name="stores_login_finishing">A concluir o início de sessão…</string>
<string name="stores_xbox_sign_in_again">A Microsoft recusou o início de sessão da Xbox. Termine a sessão da Xbox em Lojas, inicie sessão novamente e retome.</string>
<string name="stores_login_error_network">Não foi possível carregar a página de início de sessão: %1$s</string>
<string name="stores_login_error_idp_blocked">Este fornecedor recusa o início de sessão a partir de uma página incorporada. Inicie sessão com a palavra-passe da loja.</string>
<string name="stores_login_error_http">A página de início de sessão respondeu com um erro (HTTP %1$d).</string>
+18
View File
@@ -2017,6 +2017,23 @@
<string name="stores_itch_no_exe">Nenhum jogo para Windows encontrado no download</string>
<string name="stores_itch_extract_failed">Não foi possível extrair o download (código %1$d)</string>
<string name="stores_itch_no_catalog">O itch.io não respondeu</string>
<string name="stores_itch_sort_popular">Populares</string>
<string name="stores_itch_sort_new">Mais recentes</string>
<string name="stores_itch_sort_new_popular">Novos e populares</string>
<string name="stores_itch_price_paid">Pagos</string>
<string name="stores_itch_price_under_5">US$ 5 ou menos</string>
<string name="stores_itch_price_under_15">US$ 15 ou menos</string>
<string name="stores_itch_sort_top_rated">Mais bem avaliados</string>
<string name="stores_itch_sort_top_sellers">Mais vendidos</string>
<string name="stores_itch_price_any">Qualquer preço</string>
<string name="stores_itch_price_free">Grátis</string>
<string name="stores_itch_price_sale">Em promoção</string>
<string name="stores_itch_load_more">Carregar mais</string>
<string name="stores_itch_platform_any">Qualquer plataforma</string>
<string name="stores_itch_platform_mobile_web">Web mobile</string>
<string name="stores_itch_tag_add">Adicionar uma tag</string>
<string name="stores_itch_tag_title">Filtrar por tag</string>
<string name="stores_itch_browse_failed">Não foi possível carregar os jogos do itch.io</string>
<string name="stores_itch_archive">Arquivos %1$s não são suportados</string>
<string name="stores_itch_download_failed">O itch.io respondeu HTTP %1$d</string>
<string name="stores_free">Grátis</string>
@@ -2168,6 +2185,7 @@
<string name="stores_login_close">Fechar</string>
<string name="stores_login_retry">Tentar de novo</string>
<string name="stores_login_finishing">Concluindo o login…</string>
<string name="stores_xbox_sign_in_again">A Microsoft recusou o login do Xbox. Saia do Xbox em Lojas, entre novamente e depois retome.</string>
<string name="stores_login_error_network">Não foi possível carregar a página de login: %1$s</string>
<string name="stores_login_error_idp_blocked">Este provedor não permite login a partir de uma página incorporada. Faça login com a senha da loja.</string>
<string name="stores_login_error_http">A página de login respondeu com um erro (HTTP %1$d).</string>
+18
View File
@@ -2025,6 +2025,23 @@
<string name="stores_itch_no_exe">Nu s-a găsit niciun joc Windows în descărcare</string>
<string name="stores_itch_extract_failed">Descărcarea nu a putut fi extrasă (cod %1$d)</string>
<string name="stores_itch_no_catalog">itch.io nu a răspuns</string>
<string name="stores_itch_sort_popular">Populare</string>
<string name="stores_itch_sort_new">Cele mai recente</string>
<string name="stores_itch_sort_new_popular">Noi și populare</string>
<string name="stores_itch_price_paid">Cu plată</string>
<string name="stores_itch_price_under_5">5 $ sau mai puțin</string>
<string name="stores_itch_price_under_15">15 $ sau mai puțin</string>
<string name="stores_itch_sort_top_rated">Cele mai bine cotate</string>
<string name="stores_itch_sort_top_sellers">Cele mai vândute</string>
<string name="stores_itch_price_any">Orice preț</string>
<string name="stores_itch_price_free">Gratuite</string>
<string name="stores_itch_price_sale">La reducere</string>
<string name="stores_itch_load_more">Încarcă mai multe</string>
<string name="stores_itch_platform_any">Orice platformă</string>
<string name="stores_itch_platform_mobile_web">Web mobil</string>
<string name="stores_itch_tag_add">Adaugă o etichetă</string>
<string name="stores_itch_tag_title">Filtrează după etichetă</string>
<string name="stores_itch_browse_failed">Nu s-au putut încărca jocurile de pe itch.io</string>
<string name="stores_itch_archive">Arhivele %1$s nu sunt acceptate</string>
<string name="stores_itch_download_failed">itch.io a răspuns HTTP %1$d</string>
<string name="stores_free">Gratuit</string>
@@ -2179,6 +2196,7 @@
<string name="stores_login_close">Închide</string>
<string name="stores_login_retry">Încearcă din nou</string>
<string name="stores_login_finishing">Se finalizează autentificarea…</string>
<string name="stores_xbox_sign_in_again">Microsoft a respins conectarea la Xbox. Deconectează-te de la Xbox în Magazine, conectează-te din nou, apoi reia.</string>
<string name="stores_login_error_network">Pagina de autentificare nu a putut fi încărcată: %1$s</string>
<string name="stores_login_error_idp_blocked">Acest furnizor refuză autentificarea dintr-o pagină încorporată. Autentifică-te cu parola magazinului în schimb.</string>
<string name="stores_login_error_http">Pagina de autentificare a răspuns cu o eroare (HTTP %1$d).</string>
+18
View File
@@ -2048,6 +2048,23 @@
<string name="stores_itch_no_exe">В загрузке не найдена игра для Windows</string>
<string name="stores_itch_extract_failed">Не удалось распаковать загрузку (код %1$d)</string>
<string name="stores_itch_no_catalog">itch.io не ответил</string>
<string name="stores_itch_sort_popular">Популярные</string>
<string name="stores_itch_sort_new">Самые новые</string>
<string name="stores_itch_sort_new_popular">Новые и популярные</string>
<string name="stores_itch_price_paid">Платные</string>
<string name="stores_itch_price_under_5">До $5</string>
<string name="stores_itch_price_under_15">До $15</string>
<string name="stores_itch_sort_top_rated">С лучшими оценками</string>
<string name="stores_itch_sort_top_sellers">Бестселлеры</string>
<string name="stores_itch_price_any">Любая цена</string>
<string name="stores_itch_price_free">Бесплатные</string>
<string name="stores_itch_price_sale">Со скидкой</string>
<string name="stores_itch_load_more">Загрузить ещё</string>
<string name="stores_itch_platform_any">Любая платформа</string>
<string name="stores_itch_platform_mobile_web">Мобильный веб</string>
<string name="stores_itch_tag_add">Добавить тег</string>
<string name="stores_itch_tag_title">Фильтр по тегу</string>
<string name="stores_itch_browse_failed">Не удалось загрузить игры с itch.io</string>
<string name="stores_itch_archive">Архивы %1$s не поддерживаются</string>
<string name="stores_itch_download_failed">itch.io ответил HTTP %1$d</string>
<string name="stores_free">Бесплатно</string>
@@ -2199,6 +2216,7 @@
<string name="stores_login_close">Закрыть</string>
<string name="stores_login_retry">Повторить</string>
<string name="stores_login_finishing">Завершение входа…</string>
<string name="stores_xbox_sign_in_again">Microsoft отклонила вход в Xbox. Выйдите из Xbox в разделе «Магазины», войдите снова и продолжите.</string>
<string name="stores_login_error_network">Не удалось загрузить страницу входа: %1$s</string>
<string name="stores_login_error_idp_blocked">Этот сервис не разрешает вход со встроенной страницы. Войдите с паролем от магазина.</string>
<string name="stores_login_error_http">Страница входа вернула ошибку (HTTP %1$d).</string>
+18
View File
@@ -2004,6 +2004,23 @@
<string name="stores_itch_no_exe">Inget Windows-spel hittades i nedladdningen</string>
<string name="stores_itch_extract_failed">Det gick inte att packa upp nedladdningen (kod %1$d)</string>
<string name="stores_itch_no_catalog">itch.io svarade inte</string>
<string name="stores_itch_sort_popular">Populära</string>
<string name="stores_itch_sort_new">Senaste</string>
<string name="stores_itch_sort_new_popular">Nya och populära</string>
<string name="stores_itch_price_paid">Betalda</string>
<string name="stores_itch_price_under_5">$5 eller mindre</string>
<string name="stores_itch_price_under_15">$15 eller mindre</string>
<string name="stores_itch_sort_top_rated">Högst betyg</string>
<string name="stores_itch_sort_top_sellers">Mest sålda</string>
<string name="stores_itch_price_any">Alla priser</string>
<string name="stores_itch_price_free">Gratis</string>
<string name="stores_itch_price_sale">På rea</string>
<string name="stores_itch_load_more">Ladda fler</string>
<string name="stores_itch_platform_any">Alla plattformar</string>
<string name="stores_itch_platform_mobile_web">Mobilwebb</string>
<string name="stores_itch_tag_add">Lägg till en tagg</string>
<string name="stores_itch_tag_title">Filtrera efter tagg</string>
<string name="stores_itch_browse_failed">Det gick inte att läsa in spel från itch.io</string>
<string name="stores_itch_archive">%1$s-arkiv stöds inte</string>
<string name="stores_itch_download_failed">itch.io svarade HTTP %1$d</string>
<string name="stores_free">Gratis</string>
@@ -2158,6 +2175,7 @@
<string name="stores_login_close">Stäng</string>
<string name="stores_login_retry">Försök igen</string>
<string name="stores_login_finishing">Slutför inloggningen…</string>
<string name="stores_xbox_sign_in_again">Microsoft avvisade Xbox-inloggningen. Logga ut från Xbox under Butiker, logga in igen och återuppta sedan.</string>
<string name="stores_login_error_network">Inloggningssidan kunde inte läsas in: %1$s</string>
<string name="stores_login_error_idp_blocked">Den här leverantören vägrar logga in från en inbäddad sida. Logga in med ditt butikslösenord istället.</string>
<string name="stores_login_error_http">Inloggningssidan svarade med ett fel (HTTP %1$d).</string>
+18
View File
@@ -1983,6 +1983,23 @@
<string name="stores_itch_no_exe">ไม่พบเกม Windows ในไฟล์ที่ดาวน์โหลด</string>
<string name="stores_itch_extract_failed">แตกไฟล์ที่ดาวน์โหลดไม่ได้ (รหัส %1$d)</string>
<string name="stores_itch_no_catalog">itch.io ไม่ตอบสนอง</string>
<string name="stores_itch_sort_popular">ยอดนิยม</string>
<string name="stores_itch_sort_new">ล่าสุด</string>
<string name="stores_itch_sort_new_popular">ใหม่และยอดนิยม</string>
<string name="stores_itch_price_paid">เสียเงิน</string>
<string name="stores_itch_price_under_5">ไม่เกิน $5</string>
<string name="stores_itch_price_under_15">ไม่เกิน $15</string>
<string name="stores_itch_sort_top_rated">คะแนนสูงสุด</string>
<string name="stores_itch_sort_top_sellers">ขายดี</string>
<string name="stores_itch_price_any">ทุกราคา</string>
<string name="stores_itch_price_free">ฟรี</string>
<string name="stores_itch_price_sale">ลดราคา</string>
<string name="stores_itch_load_more">โหลดเพิ่มเติม</string>
<string name="stores_itch_platform_any">ทุกแพลตฟอร์ม</string>
<string name="stores_itch_platform_mobile_web">เว็บมือถือ</string>
<string name="stores_itch_tag_add">เพิ่มแท็ก</string>
<string name="stores_itch_tag_title">กรองตามแท็ก</string>
<string name="stores_itch_browse_failed">โหลดเกมจาก itch.io ไม่ได้</string>
<string name="stores_itch_archive">ไม่รองรับไฟล์ %1$s</string>
<string name="stores_itch_download_failed">itch.io ตอบกลับ HTTP %1$d</string>
<string name="stores_free">ฟรี</string>
@@ -2137,6 +2154,7 @@
<string name="stores_login_close">ปิด</string>
<string name="stores_login_retry">ลองใหม่</string>
<string name="stores_login_finishing">กำลังเสร็จสิ้นการลงชื่อเข้าใช้…</string>
<string name="stores_xbox_sign_in_again">Microsoft ปฏิเสธการลงชื่อเข้าใช้ Xbox ลงชื่อออกจาก Xbox ในสโตร์ ลงชื่อเข้าใช้อีกครั้ง แล้วดำเนินการต่อ</string>
<string name="stores_login_error_network">ไม่สามารถโหลดหน้าลงชื่อเข้าใช้ได้: %1$s</string>
<string name="stores_login_error_idp_blocked">ผู้ให้บริการนี้ปฏิเสธการลงชื่อเข้าใช้จากหน้าที่ฝังอยู่ ให้ลงชื่อเข้าใช้ด้วยรหัสผ่านของสโตร์แทน</string>
<string name="stores_login_error_http">หน้าลงชื่อเข้าใช้ตอบกลับด้วยข้อผิดพลาด (HTTP %1$d)</string>
+18
View File
@@ -1998,6 +1998,23 @@
<string name="stores_itch_no_exe">İndirmede Windows oyunu bulunamadı</string>
<string name="stores_itch_extract_failed">İndirme ayıklanamadı (kod %1$d)</string>
<string name="stores_itch_no_catalog">itch.io yanıt vermedi</string>
<string name="stores_itch_sort_popular">Popüler</string>
<string name="stores_itch_sort_new">En yeniler</string>
<string name="stores_itch_sort_new_popular">Yeni ve popüler</string>
<string name="stores_itch_price_paid">Ücretli</string>
<string name="stores_itch_price_under_5">$5 veya altı</string>
<string name="stores_itch_price_under_15">$15 veya altı</string>
<string name="stores_itch_sort_top_rated">En yüksek puanlı</string>
<string name="stores_itch_sort_top_sellers">En çok satanlar</string>
<string name="stores_itch_price_any">Herhangi bir fiyat</string>
<string name="stores_itch_price_free">Ücretsiz</string>
<string name="stores_itch_price_sale">İndirimde</string>
<string name="stores_itch_load_more">Daha fazla yükle</string>
<string name="stores_itch_platform_any">Herhangi bir platform</string>
<string name="stores_itch_platform_mobile_web">Mobil web</string>
<string name="stores_itch_tag_add">Etiket ekle</string>
<string name="stores_itch_tag_title">Etikete göre filtrele</string>
<string name="stores_itch_browse_failed">itch.io oyunları yüklenemedi</string>
<string name="stores_itch_archive">%1$s arşivleri desteklenmiyor</string>
<string name="stores_itch_download_failed">itch.io HTTP %1$d yanıtı verdi</string>
<string name="stores_free">Ücretsiz</string>
@@ -2149,6 +2166,7 @@
<string name="stores_login_close">Kapat</string>
<string name="stores_login_retry">Yeniden dene</string>
<string name="stores_login_finishing">Oturum açma tamamlanıyor…</string>
<string name="stores_xbox_sign_in_again">Microsoft, Xbox oturum açmayı reddetti. Mağazalar\'da Xbox oturumunu kapatın, yeniden oturum açın ve devam edin.</string>
<string name="stores_login_error_network">Oturum açma sayfası yüklenemedi: %1$s</string>
<string name="stores_login_error_idp_blocked">Bu sağlayıcı yerleşik bir sayfadan oturum açmayı reddediyor. Bunun yerine mağaza parolanızla oturum açın.</string>
<string name="stores_login_error_http">Oturum açma sayfası bir hatayla yanıt verdi (HTTP %1$d).</string>
+18
View File
@@ -2046,6 +2046,23 @@
<string name="stores_itch_no_exe">У завантаженні не знайдено гри для Windows</string>
<string name="stores_itch_extract_failed">Не вдалося розпакувати завантаження (код %1$d)</string>
<string name="stores_itch_no_catalog">itch.io не відповів</string>
<string name="stores_itch_sort_popular">Популярні</string>
<string name="stores_itch_sort_new">Найновіші</string>
<string name="stores_itch_sort_new_popular">Нові й популярні</string>
<string name="stores_itch_price_paid">Платні</string>
<string name="stores_itch_price_under_5">До $5</string>
<string name="stores_itch_price_under_15">До $15</string>
<string name="stores_itch_sort_top_rated">З найвищими оцінками</string>
<string name="stores_itch_sort_top_sellers">Бестселери</string>
<string name="stores_itch_price_any">Будь-яка ціна</string>
<string name="stores_itch_price_free">Безкоштовні</string>
<string name="stores_itch_price_sale">Зі знижкою</string>
<string name="stores_itch_load_more">Завантажити ще</string>
<string name="stores_itch_platform_any">Будь-яка платформа</string>
<string name="stores_itch_platform_mobile_web">Мобільний веб</string>
<string name="stores_itch_tag_add">Додати тег</string>
<string name="stores_itch_tag_title">Фільтр за тегом</string>
<string name="stores_itch_browse_failed">Не вдалося завантажити ігри з itch.io</string>
<string name="stores_itch_archive">Архіви %1$s не підтримуються</string>
<string name="stores_itch_download_failed">itch.io відповів HTTP %1$d</string>
<string name="stores_free">Безкоштовно</string>
@@ -2200,6 +2217,7 @@
<string name="stores_login_close">Закрити</string>
<string name="stores_login_retry">Спробувати ще раз</string>
<string name="stores_login_finishing">Завершення входу…</string>
<string name="stores_xbox_sign_in_again">Microsoft відхилила вхід у Xbox. Вийдіть з Xbox у розділі «Магазини», увійдіть знову й продовжте.</string>
<string name="stores_login_error_network">Не вдалося завантажити сторінку входу: %1$s</string>
<string name="stores_login_error_idp_blocked">Цей провайдер не дозволяє вхід із вбудованої сторінки. Увійдіть за допомогою пароля магазину.</string>
<string name="stores_login_error_http">Сторінка входу відповіла помилкою (HTTP %1$d).</string>
+18
View File
@@ -1983,6 +1983,23 @@
<string name="stores_itch_no_exe">Không tìm thấy trò chơi Windows trong bản tải xuống</string>
<string name="stores_itch_extract_failed">Không thể giải nén bản tải xuống (mã %1$d)</string>
<string name="stores_itch_no_catalog">itch.io không phản hồi</string>
<string name="stores_itch_sort_popular">Phổ biến</string>
<string name="stores_itch_sort_new">Mới nhất</string>
<string name="stores_itch_sort_new_popular">Mới và phổ biến</string>
<string name="stores_itch_price_paid">Trả phí</string>
<string name="stores_itch_price_under_5">Từ $5 trở xuống</string>
<string name="stores_itch_price_under_15">Từ $15 trở xuống</string>
<string name="stores_itch_sort_top_rated">Đánh giá cao nhất</string>
<string name="stores_itch_sort_top_sellers">Bán chạy nhất</string>
<string name="stores_itch_price_any">Mọi mức giá</string>
<string name="stores_itch_price_free">Miễn phí</string>
<string name="stores_itch_price_sale">Đang giảm giá</string>
<string name="stores_itch_load_more">Tải thêm</string>
<string name="stores_itch_platform_any">Mọi nền tảng</string>
<string name="stores_itch_platform_mobile_web">Web di động</string>
<string name="stores_itch_tag_add">Thêm thẻ</string>
<string name="stores_itch_tag_title">Lọc theo thẻ</string>
<string name="stores_itch_browse_failed">Không tải được game từ itch.io</string>
<string name="stores_itch_archive">Không hỗ trợ tệp %1$s</string>
<string name="stores_itch_download_failed">itch.io trả về HTTP %1$d</string>
<string name="stores_free">Miễn phí</string>
@@ -2137,6 +2154,7 @@
<string name="stores_login_close">Đóng</string>
<string name="stores_login_retry">Thử lại</string>
<string name="stores_login_finishing">Đang hoàn tất đăng nhập…</string>
<string name="stores_xbox_sign_in_again">Microsoft đã từ chối đăng nhập Xbox. Hãy đăng xuất Xbox trong Cửa hàng game, đăng nhập lại rồi tiếp tục.</string>
<string name="stores_login_error_network">Không thể tải trang đăng nhập: %1$s</string>
<string name="stores_login_error_idp_blocked">Nhà cung cấp này từ chối đăng nhập từ một trang nhúng. Hãy đăng nhập bằng mật khẩu store của bạn thay vào đó.</string>
<string name="stores_login_error_http">Trang đăng nhập trả về lỗi (HTTP %1$d).</string>
@@ -2062,6 +2062,23 @@
<string name="stores_itch_no_exe">下载内容中未找到 Windows 游戏</string>
<string name="stores_itch_extract_failed">无法解压下载内容(代码 %1$d)</string>
<string name="stores_itch_no_catalog">itch.io 没有响应</string>
<string name="stores_itch_sort_popular">热门</string>
<string name="stores_itch_sort_new">最新发布</string>
<string name="stores_itch_sort_new_popular">新品与热门</string>
<string name="stores_itch_price_paid">付费</string>
<string name="stores_itch_price_under_5">5 美元以下</string>
<string name="stores_itch_price_under_15">15 美元以下</string>
<string name="stores_itch_sort_top_rated">评分最高</string>
<string name="stores_itch_sort_top_sellers">热销</string>
<string name="stores_itch_price_any">任意价格</string>
<string name="stores_itch_price_free">免费</string>
<string name="stores_itch_price_sale">特价</string>
<string name="stores_itch_load_more">加载更多</string>
<string name="stores_itch_platform_any">任意平台</string>
<string name="stores_itch_platform_mobile_web">移动网页</string>
<string name="stores_itch_tag_add">添加标签</string>
<string name="stores_itch_tag_title">按标签筛选</string>
<string name="stores_itch_browse_failed">无法从 itch.io 加载游戏</string>
<string name="stores_itch_archive">不支持 %1$s 压缩包</string>
<string name="stores_itch_download_failed">itch.io 返回 HTTP %1$d</string>
<string name="stores_free">免费</string>
@@ -2213,6 +2230,7 @@
<string name="stores_login_close">关闭</string>
<string name="stores_login_retry">重试</string>
<string name="stores_login_finishing">正在完成登录…</string>
<string name="stores_xbox_sign_in_again">Microsoft 拒绝了 Xbox 登录。请在游戏商店中退出 Xbox,重新登录,然后继续。</string>
<string name="stores_login_error_network">无法加载登录页面:%1$s</string>
<string name="stores_login_error_idp_blocked">该第三方登录方式不允许在内嵌页面中登录。请改用商店密码登录。</string>
<string name="stores_login_error_http">登录页面返回了错误(HTTP %1$d)。</string>
@@ -1986,6 +1986,23 @@
<string name="stores_itch_no_exe">下載內容中找不到 Windows 遊戲</string>
<string name="stores_itch_extract_failed">無法解壓下載內容(代碼 %1$d)</string>
<string name="stores_itch_no_catalog">itch.io 沒有回應</string>
<string name="stores_itch_sort_popular">熱門</string>
<string name="stores_itch_sort_new">最新發布</string>
<string name="stores_itch_sort_new_popular">新品與熱門</string>
<string name="stores_itch_price_paid">付費</string>
<string name="stores_itch_price_under_5">5 美元以下</string>
<string name="stores_itch_price_under_15">15 美元以下</string>
<string name="stores_itch_sort_top_rated">評分最高</string>
<string name="stores_itch_sort_top_sellers">熱賣</string>
<string name="stores_itch_price_any">任何價格</string>
<string name="stores_itch_price_free">免費</string>
<string name="stores_itch_price_sale">特價</string>
<string name="stores_itch_load_more">載入更多</string>
<string name="stores_itch_platform_any">任何平台</string>
<string name="stores_itch_platform_mobile_web">行動網頁</string>
<string name="stores_itch_tag_add">新增標籤</string>
<string name="stores_itch_tag_title">按標籤篩選</string>
<string name="stores_itch_browse_failed">無法從 itch.io 載入遊戲</string>
<string name="stores_itch_archive">不支援 %1$s 壓縮檔</string>
<string name="stores_itch_download_failed">itch.io 回應 HTTP %1$d</string>
<string name="stores_free">免費</string>
@@ -2140,6 +2157,7 @@
<string name="stores_login_close">關閉</string>
<string name="stores_login_retry">再試一次</string>
<string name="stores_login_finishing">正在完成登入…</string>
<string name="stores_xbox_sign_in_again">Microsoft 拒絕了 Xbox 登入。請在商店中登出 Xbox,重新登入,然後繼續。</string>
<string name="stores_login_error_network">無法載入登入頁面:%1$s</string>
<string name="stores_login_error_idp_blocked">此提供者不允許從內嵌頁面登入。請改用商店密碼登入。</string>
<string name="stores_login_error_http">登入頁面回應錯誤(HTTP %1$d)。</string>
@@ -1986,6 +1986,23 @@
<string name="stores_itch_no_exe">下載內容中找不到 Windows 遊戲</string>
<string name="stores_itch_extract_failed">無法解壓縮下載內容(代碼 %1$d)</string>
<string name="stores_itch_no_catalog">itch.io 沒有回應</string>
<string name="stores_itch_sort_popular">熱門</string>
<string name="stores_itch_sort_new">最新發布</string>
<string name="stores_itch_sort_new_popular">新品與熱門</string>
<string name="stores_itch_price_paid">付費</string>
<string name="stores_itch_price_under_5">5 美元以下</string>
<string name="stores_itch_price_under_15">15 美元以下</string>
<string name="stores_itch_sort_top_rated">評分最高</string>
<string name="stores_itch_sort_top_sellers">熱銷</string>
<string name="stores_itch_price_any">任何價格</string>
<string name="stores_itch_price_free">免費</string>
<string name="stores_itch_price_sale">特價</string>
<string name="stores_itch_load_more">載入更多</string>
<string name="stores_itch_platform_any">任何平台</string>
<string name="stores_itch_platform_mobile_web">行動網頁</string>
<string name="stores_itch_tag_add">新增標籤</string>
<string name="stores_itch_tag_title">依標籤篩選</string>
<string name="stores_itch_browse_failed">無法從 itch.io 載入遊戲</string>
<string name="stores_itch_archive">不支援 %1$s 壓縮檔</string>
<string name="stores_itch_download_failed">itch.io 回應 HTTP %1$d</string>
<string name="stores_free">免費</string>
@@ -2140,6 +2157,7 @@
<string name="stores_login_close">關閉</string>
<string name="stores_login_retry">再試一次</string>
<string name="stores_login_finishing">正在完成登入…</string>
<string name="stores_xbox_sign_in_again">Microsoft 拒絕了 Xbox 登入。請在遊戲商店中登出 Xbox,重新登入,然後繼續。</string>
<string name="stores_login_error_network">無法載入登入頁面:%1$s</string>
<string name="stores_login_error_idp_blocked">此提供者拒絕從內嵌頁面登入。請改用商店密碼登入。</string>
<string name="stores_login_error_http">登入頁面回應錯誤(HTTP %1$d)。</string>
+46
View File
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="lan_title">Local multiplayer · Experimental</string>
<string name="lan_setup_hint">LAN connections and shared-screen co-op with Steam Link</string>
<string name="lan_experimental">Choose LAN play with a game on each device, or shared-screen co-op with one game running on the host. The game must support the chosen multiplayer mode. Device testing is still needed.</string>
<string name="lan_wireless">Wireless LAN</string>
<string name="lan_wireless_help">Host creates a password-protected local network without a router or internet. It may disconnect your current Wi-Fi. On the other device, join using Android Wi-Fi settings and choose to stay connected without internet. For separate-copy LAN games, select the LAN interface below on both devices; for Steam Link, select it on the host only. If cellular takes priority, turn mobile data off while playing.</string>
<string name="lan_host">Host offline hotspot</string>
<string name="lan_stop">Stop hotspot</string>
<string name="lan_starting">Starting hotspot…</string>
<string name="lan_notification">Offline hotspot requested. Tap to manage LAN.</string>
<string name="lan_credentials">Network: %1$s\nPassword: %2$s</string>
<string name="lan_failed">Android could not start a usable hotspot on this device.</string>
<string name="lan_incompatible">Turn off any existing hotspot or Wi-Fi Direct connection, then try again.</string>
<string name="lan_disallowed">Hotspots are disabled by this device’s policy.</string>
<string name="lan_no_channel">No Wi-Fi channel is available. Check Wi-Fi and airplane mode, then retry.</string>
<string name="lan_permission_needed">Hosting needs precise location permission for this app’s Android compatibility level. Enable it in App settings, then retry.</string>
<string name="lan_location_needed">Turn on Android Location services, then retry hosting.</string>
<string name="lan_app_settings">App settings</string>
<string name="lan_wifi_settings">Join in Wi-Fi settings</string>
<string name="lan_location_settings">Location settings</string>
<string name="lan_wired">USB-C / Ethernet LAN</string>
<string name="lan_wired_help">Connect a data-capable USB-C cable and enable USB tethering on one device in Android settings. This only works if the other device supports the USB network driver and host role. If no LAN interface appears, try reversing the cable’s host/device roles or use USB Ethernet adapters. Charging or file-transfer mode alone does not create a LAN. DroidDeck cannot enable USB tethering itself.</string>
<string name="lan_network_settings">Android network settings</string>
<string name="lan_interface">Host / game LAN interface</string>
<string name="lan_interface_help">Select the interface whose IP belongs to your local connection. For separate-copy LAN games, do this on both devices. For Steam Link, only the DroidDeck host needs this selection. Set it before launching Steam or the game. This does not change Android routing. Selection lasts until the app process exits or you return to the default below.</string>
<string name="lan_no_interfaces">No local IPv4 interfaces are visible yet. Connect the devices first.</string>
<string name="lan_interface_lost">%1$s is unavailable. Reconnect or choose another interface.</string>
<string name="lan_use">Use for games</string>
<string name="lan_selected">Selected</string>
<string name="lan_default">Android default network</string>
<string name="lan_coop_title">Shared-screen co-op · Steam Link</string>
<string name="lan_coop_overview">The host runs one copy of a game with local co-op or split-screen support. Both devices see the same picture and each can provide a controller. Steam Link handles the client’s video, audio, and input.</string>
<string name="lan_coop_network">1. Connect both devices to the same Wi-Fi, or create an offline hotspot below and join it from the second device. Select the host’s LAN interface below before starting Steam.</string>
<string name="lan_coop_host">2. On the host, start Steam in DroidDeck, then enable Settings → Remote Play → Enable Remote Play. Keep DroidDeck’s host controls enabled. Return to the host to approve the pairing PIN when Steam Link asks.</string>
<string name="lan_coop_return_host">Return to host Steam</string>
<string name="lan_coop_open_launcher">Back to DroidDeck to start Steam</string>
<string name="lan_coop_host_address">Selected LAN address: %1$s\nIf discovery fails, add this host address in Steam Link on the second device.</string>
<string name="lan_coop_find_host">If Steam Link cannot find the host, select the host’s LAN interface below to see its address.</string>
<string name="lan_coop_client">3. On the second device, open Steam Link, pair with the host, and start streaming. Connect that player’s controller to the second device, or enable Steam Link’s touch controller. The second device does not need to run a DroidDeck Linux session.</string>
<string name="lan_coop_open_client">Open Steam Link on this device</string>
<string name="lan_coop_get_client">Get Steam Link for this device</string>
<string name="lan_coop_controllers">4. Launch the game through the host’s Steam and join its local multiplayer mode. Keep the host’s controller and the Steam Link controller as separate gamepads. If both control the same player, check Steam’s controller order and the game’s controller settings. Keyboard and mouse input may be shared instead of creating another player.</string>
<string name="lan_coop_offline">Install, sign in, and pair while online before travel. A local hotspot provides the network, but first-time pairing and fully offline Steam Link play still need testing on this setup. No ADB, Shizuku, or root setup is required by this integration.</string>
<string name="lan_coop_client_unavailable">No Steam Link app, app store, or browser could be opened. Install Steam Link on the second device and retry.</string>
</resources>
+24
View File
@@ -2081,6 +2081,29 @@
<string name="stores_itch_no_exe">No Windows game found in the download</string>
<string name="stores_itch_extract_failed">Could not extract the download (exit %1$d)</string>
<string name="stores_itch_no_catalog">itch.io did not answer</string>
<string name="stores_itch_sort_popular">Popular</string>
<string name="stores_itch_sort_new">Most recent</string>
<string name="stores_itch_sort_new_popular">New &amp; popular</string>
<string name="stores_itch_price_paid">Paid</string>
<string name="stores_itch_price_under_5">$5 or less</string>
<string name="stores_itch_price_under_15">$15 or less</string>
<string name="stores_itch_sort_top_rated">Top rated</string>
<string name="stores_itch_sort_top_sellers">Top sellers</string>
<string name="stores_itch_price_any">Any price</string>
<string name="stores_itch_price_free">Free</string>
<string name="stores_itch_price_sale">On sale</string>
<string name="stores_itch_load_more">Load more</string>
<string name="stores_itch_platform_any">Any platform</string>
<string name="stores_itch_platform_mobile_web">Mobile web</string>
<string name="stores_itch_tag_add">Add a tag</string>
<string name="stores_itch_tag_title">Filter by tag</string>
<string name="stores_itch_platform_windows" translatable="false">Windows</string>
<string name="stores_itch_platform_macos" translatable="false">macOS</string>
<string name="stores_itch_platform_linux" translatable="false">Linux</string>
<string name="stores_itch_platform_android" translatable="false">Android</string>
<string name="stores_itch_platform_ios" translatable="false">iOS</string>
<string name="stores_itch_platform_web" translatable="false">Web</string>
<string name="stores_itch_browse_failed">Could not load games from itch.io</string>
<string name="stores_itch_archive">%1$s archives are not supported</string>
<string name="stores_itch_download_failed">itch.io answered HTTP %1$d</string>
<string name="stores_free">Free</string>
@@ -2249,6 +2272,7 @@
<string name="stores_login_close">Close</string>
<string name="stores_login_retry">Try again</string>
<string name="stores_login_finishing">Finishing sign-in…</string>
<string name="stores_xbox_sign_in_again">Microsoft rejected the Xbox sign-in. Sign out of Xbox in Stores, sign in again, then resume.</string>
<string name="stores_login_error_network">The sign-in page could not be loaded: %1$s</string>
<string name="stores_login_error_idp_blocked">This provider refuses to sign in from an embedded page. Sign in with your store password instead.</string>
<string name="stores_login_error_http">The sign-in page answered with an error (HTTP %1$d).</string>
+4 -2
View File
@@ -160,13 +160,15 @@ synchronous on the calling thread (network calls block: call them off the main t
| `cloud.list` | `accessToken`, `accountId`, `appName` | `files[]` of `name`, `modified` (ms, -1 unknown), `hash`, `readLink` |
| `cloud.writeLinks` | `accessToken`, `accountId`, `appName`, `names[]` | `links`: name → write link |
| `launch.args` | `displayName`, `accountId`, `namespace`, `locale`, `appName`, `deploymentId`, `additional` | `args[]` |
| `launch.split` | `command` | `args[]` |
| `locale` | `language`, `region` | `key`, `tags[]`, `launchLocale` |
`nativeFetch` ops: `manifest.download` (`info`, optional `cdns`) → the manifest bytes;
`cloud.read` (`url`) → the file. `null` = failed. `nativeSend` op: `cloud.write` (`url`) with the
body → `{"ok": true}` or an error. `nativeInspect` parses manifest bytes: `{"op":"summary"}` →
`buildVersion`, `launchExe`, `prereqName`, `prereqPath`, `prereqRead`, `files[]` (`path`, `size`,
`tags`); `{"op":"select","tags":[…]}` → `indices[]` of the files an install with those tags gets.
`tags`); `{"op":"select","tags":[…]}` → `indices[]` of the files an install with those tags gets;
`{"op":"launch"}` → the manifest's `buildVersion`, its `command` line and the `args[]` split from it.
### `nativeInstall`
@@ -196,7 +198,7 @@ completes.
On-disk protocol: game files are staged in `<gameDir>/.droiddeck-epic-staging/*.stage` (owner
marker `owner` = `DroidDeck Epic staging v1\n`) and renamed over their destination after size and
SHA-1 checks; reusable chunks live, decompressed, as `<GUID>` (extra copies `<GUID>.<n>`, writes via
SHA-1 checks; a paused run keeps each unfinished file there as `*.part` with its written parts in `*.part.list`; reusable chunks live, decompressed, as `<GUID>` (extra copies `<GUID>.<n>`, writes via
`.part`) in `<gameDir>/.chunks` or the scratch directory.
## `com.droiddeck.launcher.stores.amazon.AmazonNative`
@@ -5,7 +5,7 @@ pub mod space;
pub mod staging;
pub mod writer;
use std::collections::HashMap;
use std::collections::{HashMap, HashSet};
use std::fs;
use std::path::{Path, PathBuf};
use std::sync::atomic::{AtomicBool, Ordering};
@@ -140,6 +140,17 @@ pub fn fetch_manifest(info: &BuildInfo, log: &dyn Fn(&str)) -> Result<Manifest,
})
}
fn resume_from(stage: &Path, parts: &[PlanPart], size: u64) -> Option<HashSet<u64>> {
let meta = fs::symlink_metadata(stage).ok()?;
if !meta.is_file() || meta.len() > size {
return None;
}
let list = fs::read_to_string(staging::list_path(stage)).ok()?;
let kept: HashSet<u64> = list.lines().map(|l| l.parse().ok()).collect::<Option<_>>()?;
let fits = |o: &u64| parts.iter().any(|p| p.file_offset == *o && p.file_offset + p.size as u64 <= meta.len());
(!kept.is_empty() && kept.iter().all(fits)).then_some(kept)
}
pub fn run(req: &Request, cancel: &AtomicBool, ev: &dyn Events) -> Result<Finished, Stop> {
let failed = |m: String| Stop::Failed(m);
ev.status("Downloading the manifest…");
@@ -191,6 +202,7 @@ pub fn run(req: &Request, cancel: &AtomicBool, ev: &dyn Events) -> Result<Finish
}
let pending_bytes: u64 = pending.iter().map(|&(i, _)| manifest.files[i].size).sum();
ev.sizes(pending_bytes, disk_bytes);
let mut partials = staging::partials(&stage_dir);
let mut finished = Finished {
build_version: manifest.build_version.clone(),
@@ -211,6 +223,9 @@ pub fn run(req: &Request, cancel: &AtomicBool, ev: &dyn Events) -> Result<Finish
staging::remove_if_idle(&stage_dir);
};
if pending.is_empty() {
for stale in partials.values() {
staging::remove_partial(stale);
}
ev.log("every selected file is already up to date");
clean_caches();
ev.installing(disk_bytes, disk_bytes, total_selected, total_selected);
@@ -219,6 +234,8 @@ pub fn run(req: &Request, cancel: &AtomicBool, ev: &dyn Events) -> Result<Finish
let mut plan_files = Vec::with_capacity(pending.len());
let mut engine_files = Vec::with_capacity(pending.len());
let mut resumed_bytes = 0u64;
let mut kept_sizes = Vec::with_capacity(pending.len());
for &(i, old_size) in &pending {
let f = &manifest.files[i];
let mut parts = Vec::with_capacity(f.parts.len());
@@ -234,6 +251,22 @@ pub fn run(req: &Request, cancel: &AtomicBool, ev: &dyn Events) -> Result<Finish
parts.push(PlanPart { chunk: c as u32, chunk_offset: part.offset, size: part.size, file_offset: offset });
offset += part.size as u64;
}
let mut resume = None;
let mut kept_size = 0u64;
if let Some(stage) = partials.remove(&staging::partial_name(&f.path, f.size, f.sha1)) {
match resume_from(&stage, &parts, f.size).filter(|_| f.sha1.is_some()) {
Some(kept) => {
let bytes: u64 = parts.iter().filter(|p| kept.contains(&p.file_offset)).map(|p| p.size as u64).sum();
ev.log(&format!("resuming {} with {bytes} of {} bytes written", f.path, f.size));
resumed_bytes += bytes;
kept_size = bytes;
parts.retain(|p| !kept.contains(&p.file_offset));
resume = Some(writer::Resume { stage, kept: kept.into_iter().collect() });
}
None => staging::remove_partial(&stage),
}
}
kept_sizes.push(kept_size);
plan_files.push(PlanFile { size: f.size, parts: parts.clone() });
engine_files.push(writer::EngineFile {
path: f.path.clone(),
@@ -242,8 +275,14 @@ pub fn run(req: &Request, cancel: &AtomicBool, ev: &dyn Events) -> Result<Finish
sha1: f.sha1,
replacing: old_size > 0,
parts,
resume,
});
}
for stale in partials.values() {
staging::remove_partial(stale);
}
let fresh = pending.iter().all(|&(_, old_size)| old_size == 0);
let progress_base = resumed_bytes + if fresh { disk_bytes - pending_bytes } else { 0 };
let scratch = req
.scratch_dir
@@ -252,7 +291,8 @@ pub fn run(req: &Request, cancel: &AtomicBool, ev: &dyn Events) -> Result<Finish
.filter(|s| !space::same_volume(s, &req.game_dir));
let sizes: Vec<space::PendingSize> = pending
.iter()
.map(|&(i, old)| space::PendingSize { new_size: manifest.files[i].size, old_size: old })
.zip(&kept_sizes)
.map(|(&(i, old), kept)| space::PendingSize { new_size: manifest.files[i].size - kept, old_size: old })
.collect();
let free_game = space::free_bytes(&req.game_dir);
let scratch_space = scratch.as_ref().map(|s| space::Scratch { free: space::free_bytes(s) });
@@ -308,6 +348,8 @@ cache_budget_mib={} overlap_mib={} free_game={free_game} workers={} process_work
process_workers: req.process_workers,
ca_bundle: req.ca_bundle.clone(),
user_agent: net::user_agent(),
progress_base,
progress_total: progress_base + pending_bytes - resumed_bytes,
};
let stats = writer::run(&input, cancel, ev)?;
finished.bytes_written = stats.bytes_written;
@@ -1,12 +1,19 @@
use std::collections::HashMap;
use std::fs;
use std::io::Write;
use std::path::{Path, PathBuf};
use std::sync::atomic::{AtomicU64, Ordering};
use sha1::{Digest, Sha1};
use crate::epic::manifest::Sha1 as Hash;
pub const DIR_NAME: &str = ".droiddeck-epic-staging";
pub const OWNER_FILE: &str = "owner";
pub const OWNER_MARKER: &[u8] = b"DroidDeck Epic staging v1\n";
const SUFFIX: &str = ".stage";
pub const PARTIAL_SUFFIX: &str = ".part";
const LIST_SUFFIX: &str = ".part.list";
static SEQUENCE: AtomicU64 = AtomicU64::new(0);
@@ -15,6 +22,37 @@ pub fn conflicts(manifest_path: &str) -> bool {
first.eq_ignore_ascii_case(DIR_NAME)
}
fn hex(bytes: &[u8]) -> String {
bytes.iter().map(|b| format!("{b:02x}")).collect()
}
pub fn partial_name(path: &str, size: u64, sha1: Option<Hash>) -> String {
let id: Hash = Sha1::digest(path.as_bytes()).into();
let content = sha1.map(|h| hex(&h)).unwrap_or_else(|| "0".into());
format!("{}-{content}-{size}{PARTIAL_SUFFIX}", hex(&id[..8]))
}
pub fn list_path(partial: &Path) -> PathBuf {
let mut name = partial.as_os_str().to_owned();
name.push(".list");
PathBuf::from(name)
}
pub fn remove_partial(partial: &Path) {
let _ = fs::remove_file(partial);
let _ = fs::remove_file(list_path(partial));
}
pub fn partials(dir: &Path) -> HashMap<String, PathBuf> {
let Ok(entries) = fs::read_dir(dir) else { return HashMap::new() };
entries
.flatten()
.map(|e| e.file_name().to_string_lossy().into_owned())
.filter(|n| n.ends_with(PARTIAL_SUFFIX))
.map(|n| (n.clone(), dir.join(n)))
.collect()
}
pub fn unique_name() -> String {
let nanos = std::time::SystemTime::now()
.duration_since(std::time::UNIX_EPOCH)
@@ -82,6 +120,8 @@ pub fn recover(game_dir: &Path) -> Result<PathBuf, String> {
} else if name.ends_with(SUFFIX) {
stale.push(path);
others += 1;
} else if name.ends_with(PARTIAL_SUFFIX) || name.ends_with(LIST_SUFFIX) {
others += 1;
} else {
return refuse("it holds an unexpected file");
}
@@ -130,8 +170,13 @@ mod tests {
fs::write(dir.join("file-1.stage"), b"x").unwrap();
fs::write(dir.join("stream-1-2-3.stage"), b"y").unwrap();
fs::write(game.join("keep.stage"), b"z").unwrap();
let partial = partial_name("Game/a.pak", 10, None);
fs::write(dir.join(&partial), b"p").unwrap();
fs::write(list_path(&dir.join(&partial)), b"0\n").unwrap();
recover(&game).unwrap();
assert_eq!(fs::read_dir(&dir).unwrap().count(), 1);
assert_eq!(fs::read_dir(&dir).unwrap().count(), 3);
assert_eq!(partials(&dir).into_keys().collect::<Vec<_>>(), vec![partial.clone()]);
remove_partial(&dir.join(&partial));
assert!(game.join("keep.stage").exists());
remove_if_idle(&dir);
assert!(!dir.exists());
@@ -170,5 +215,9 @@ mod tests {
let (a, b) = (unique_name(), unique_name());
assert_ne!(a, b);
assert!(a.ends_with(".stage"));
let p = partial_name("Game/a.pak", 10, Some([0xab; 20]));
assert!(p.ends_with(&format!("-{}-10.part", "ab".repeat(20))));
assert_ne!(p, partial_name("Game/b.pak", 10, Some([0xab; 20])));
assert_ne!(p, partial_name("Game/a.pak", 10, Some([0xac; 20])));
}
}
@@ -59,6 +59,7 @@ struct Recorder {
replaced: AtomicUsize,
refuse: bool,
last_progress: Mutex<(u64, u64)>,
first_progress: Mutex<Option<(u64, u64)>>,
sizes: Mutex<(u64, u64)>,
}
@@ -72,6 +73,7 @@ impl Events for Recorder {
*self.sizes.lock().unwrap() = (pending, disk);
}
fn progress(&self, written: u64, total: u64, _f: u32, _ft: u32) {
self.first_progress.lock().unwrap().get_or_insert((written, total));
let mut p = self.last_progress.lock().unwrap();
if written >= p.0 {
*p = (written, total);
@@ -262,6 +264,85 @@ fn a_cancelled_run_reports_cancel() {
let _ = fs::remove_dir_all(&game);
}
fn place_partial(fx: &Fixture, game: &Path, data: &[u8], list: &str) -> PathBuf {
let stage = staging::recover(game).unwrap();
let a = &fx.expected[0].1;
let partial = stage.join(staging::partial_name("a.bin", 4000, Some(Sha1::digest(a).into())));
fs::write(&partial, data).unwrap();
fs::write(staging::list_path(&partial), list).unwrap();
partial
}
fn place_done_c(fx: &Fixture, game: &Path) {
fs::create_dir_all(game.join("b")).unwrap();
fs::write(game.join("b/c.bin"), &fx.expected[1].1).unwrap();
}
#[test]
fn a_paused_install_resumes_from_its_written_parts() {
let fx = fixture();
let game = temp_game("resume");
place_done_c(&fx, &game);
place_partial(&fx, &game, &fx.expected[0].1[..3000], "0\n");
let stage = game.join(staging::DIR_NAME);
fs::write(stage.join(staging::partial_name("gone.bin", 9, None)), b"old").unwrap();
let events = Recorder::default();
run(&request(&fx, &game), &AtomicBool::new(false), &events).unwrap();
for (path, bytes) in &fx.expected {
assert_eq!(&fs::read(game.join(path)).unwrap(), bytes, "{path}");
}
assert_eq!(fx.hits.load(Ordering::Relaxed), 2, "the manifest and the one chunk still missing");
assert_eq!(*events.first_progress.lock().unwrap(), Some((2096 + 3000, 6196)));
assert_eq!(*events.last_progress.lock().unwrap(), (6196, 6196));
assert!(events.logs.lock().unwrap().iter().any(|l| l == "resuming a.bin with 3000 of 4000 bytes written"));
assert!(!stage.exists());
let _ = fs::remove_dir_all(&game);
}
#[test]
fn a_part_written_out_of_order_is_kept_too() {
let fx = fixture();
let game = temp_game("resume-tail");
place_done_c(&fx, &game);
let mut data = vec![0u8; 3000];
data.extend_from_slice(&fx.expected[0].1[3000..]);
place_partial(&fx, &game, &data, "3000\n");
let events = Recorder::default();
run(&request(&fx, &game), &AtomicBool::new(false), &events).unwrap();
assert_eq!(fs::read(game.join("a.bin")).unwrap(), fx.expected[0].1);
assert_eq!(*events.first_progress.lock().unwrap(), Some((2096 + 1000, 6196)));
assert!(!game.join(staging::DIR_NAME).exists());
let _ = fs::remove_dir_all(&game);
}
#[test]
fn a_partial_that_no_longer_matches_is_dropped() {
let fx = fixture();
let game = temp_game("badpartial");
place_partial(&fx, &game, &fx.expected[0].1[..1234], "1234\n");
let events = Recorder::default();
run(&request(&fx, &game), &AtomicBool::new(false), &events).unwrap();
assert_eq!(fs::read(game.join("a.bin")).unwrap(), fx.expected[0].1);
assert_eq!(*events.first_progress.lock().unwrap(), Some((0, 6196)));
assert!(!game.join(staging::DIR_NAME).exists());
let _ = fs::remove_dir_all(&game);
}
#[test]
fn a_damaged_partial_fails_its_check_and_is_not_kept() {
let fx = fixture();
let game = temp_game("damagedpartial");
place_partial(&fx, &game, &[0u8; 3000], "0\n");
let err = run(&request(&fx, &game), &AtomicBool::new(false), &Recorder::default()).unwrap_err();
assert_eq!(err, Stop::Failed("SHA-1 mismatch for a.bin".into()));
assert!(staging::partials(&game.join(staging::DIR_NAME)).is_empty());
let retry = Recorder::default();
run(&request(&fx, &game), &AtomicBool::new(false), &retry).unwrap();
assert_eq!(fs::read(game.join("a.bin")).unwrap(), fx.expected[0].1);
let _ = fs::remove_dir_all(&game);
}
#[test]
fn guid_names_are_cache_names() {
let c = chunk(5, 10);
@@ -1,6 +1,6 @@
use std::fs::{self, File, OpenOptions};
use std::os::unix::fs::FileExt;
use std::path::PathBuf;
use std::path::{Path, PathBuf};
use std::sync::atomic::{AtomicBool, AtomicU64, AtomicUsize, Ordering};
use std::sync::{Arc, Condvar, Mutex};
use std::time::{Duration, Instant};
@@ -25,6 +25,12 @@ pub struct EngineFile {
pub sha1: Option<Hash>,
pub replacing: bool,
pub parts: Vec<PlanPart>,
pub resume: Option<Resume>,
}
pub struct Resume {
pub stage: PathBuf,
pub kept: Vec<u64>,
}
pub struct EngineInput<'a> {
@@ -40,6 +46,8 @@ pub struct EngineInput<'a> {
pub process_workers: usize,
pub ca_bundle: String,
pub user_agent: String,
pub progress_base: u64,
pub progress_total: u64,
}
#[derive(Debug, Default)]
@@ -120,7 +128,7 @@ impl<'a> Engine<'a> {
return;
}
self.events.progress(
self.written.load(Ordering::Relaxed),
self.input.progress_base + self.written.load(Ordering::Relaxed),
self.total_bytes,
self.files_done.load(Ordering::Relaxed) as u32,
self.input.files.len() as u32,
@@ -232,10 +240,14 @@ impl<'a> Engine<'a> {
.sync_all()
.map_err(|e| format!("Could not assemble or atomically replace {}: {e}", file.path))?;
let len = handle.metadata().map(|m| m.len()).unwrap_or(u64::MAX);
drop(handle);
if len != file.size {
return Err(format!("Size mismatch for {}", file.path));
}
let hash = match (hash, &file.resume) {
(None, Some(_)) if file.sha1.is_some() => Some(hash_whole(&handle, file)?),
(hash, _) => hash,
};
drop(handle);
if let (Some(expected), Some(got)) = (file.sha1, hash) {
if expected != got {
return Err(format!("SHA-1 mismatch for {}", file.path));
@@ -260,6 +272,9 @@ impl<'a> Engine<'a> {
fs::rename(&stage, &file.dest)
.map_err(|e| format!("Could not assemble or atomically replace {}: {e}", file.path))
})();
if file.resume.is_some() {
let _ = fs::remove_file(staging::list_path(&stage));
}
if let Err(e) = result {
let _ = fs::remove_file(&stage);
return Err(e);
@@ -278,13 +293,16 @@ impl<'a> Engine<'a> {
}
fn open_stage(&self, f: usize) -> Result<(), String> {
let path = self.input.stage_dir.join(staging::unique_name());
let handle = OpenOptions::new()
.read(true)
.write(true)
.create_new(true)
.open(&path)
.map_err(|e| format!("Could not stage {}: {e}", self.input.files[f].path))?;
let file = &self.input.files[f];
let (path, opened) = match &file.resume {
Some(r) => (r.stage.clone(), OpenOptions::new().read(true).write(true).open(&r.stage)),
None => {
let path = self.input.stage_dir.join(staging::unique_name());
let opened = OpenOptions::new().read(true).write(true).create_new(true).open(&path);
(path, opened)
}
};
let handle = opened.map_err(|e| format!("Could not stage {}: {e}", file.path))?;
let mut slot = self.slots[f].lock().expect("slot lock");
slot.file = Some(Arc::new(handle));
slot.stage = Some(path);
@@ -439,7 +457,7 @@ pub fn run(input: &EngineInput<'_>, stop: &AtomicBool, events: &dyn Events) -> R
stage: None,
written: vec![false; f.parts.len()],
next_hash: 0,
hasher: f.sha1.map(|_| Sha1::new()),
hasher: f.sha1.filter(|_| f.resume.is_none()).map(|_| Sha1::new()),
left: f.parts.len(),
done: false,
})
@@ -466,7 +484,7 @@ pub fn run(input: &EngineInput<'_>, stop: &AtomicBool, events: &dyn Events) -> R
started: Instant::now(),
replace_ok: Mutex::new(None),
events,
total_bytes: input.files.iter().map(|f| f.size).sum(),
total_bytes: input.progress_total,
};
for (i, p) in schedule.producers.iter().enumerate() {
if p.preloaded && remaining[i] == 0 {
@@ -503,7 +521,7 @@ pub fn run(input: &EngineInput<'_>, stop: &AtomicBool, events: &dyn Events) -> R
stream: false,
};
events.progress(0, engine.total_bytes, 0, input.files.len() as u32);
events.progress(input.progress_base, engine.total_bytes, 0, input.files.len() as u32);
let log = |line: &str| events.log(line);
let gate = |i: usize| -> bool {
engine.hint.fetch_max(i, Ordering::Relaxed);
@@ -546,12 +564,14 @@ pub fn run(input: &EngineInput<'_>, stop: &AtomicBool, events: &dyn Events) -> R
let complete = failure.is_none() && engine.files_done.load(Ordering::Relaxed) == input.files.len();
if !complete {
for slot in &engine.slots {
for (file, slot) in input.files.iter().zip(&engine.slots) {
let mut s = slot.lock().expect("slot lock");
if !s.done {
s.file.take();
if let Some(stage) = s.stage.take() {
let _ = fs::remove_file(stage);
if failure.is_some() || !keep_partial(file, &s.written, &stage, &input.stage_dir) {
let _ = fs::remove_file(stage);
}
}
}
}
@@ -588,6 +608,100 @@ fetches={} refetches={} peak_cache_mib={} hosts={}",
Err(Stop::Failed("The download ended before every file was written".into()))
}
fn hash_whole(handle: &File, file: &EngineFile) -> Result<Hash, String> {
let mut h = Sha1::new();
let mut buf = vec![0u8; 1024 * 1024];
let mut at = 0u64;
while at < file.size {
let n = buf.len().min((file.size - at) as usize);
handle
.read_exact_at(&mut buf[..n], at)
.map_err(|e| format!("Could not read back {}: {e}", file.path))?;
h.update(&buf[..n]);
at += n as u64;
}
Ok(h.finalize().into())
}
fn keep_partial(file: &EngineFile, written: &[bool], stage: &Path, dir: &Path) -> bool {
let mut kept: Vec<u64> = file.resume.as_ref().map(|r| r.kept.clone()).unwrap_or_default();
kept.extend(file.parts.iter().zip(written).filter(|(_, w)| **w).map(|(p, _)| p.file_offset));
if kept.is_empty() || file.sha1.is_none() {
return false;
}
kept.sort_unstable();
let partial = dir.join(staging::partial_name(&file.path, file.size, file.sha1));
let list: String = kept.iter().map(|o| format!("{o}\n")).collect();
let synced = OpenOptions::new().write(true).open(stage).and_then(|h| h.sync_all());
if synced.is_err() || fs::rename(stage, &partial).is_err() {
return false;
}
let resumed = file.resume.as_ref().is_some_and(|r| r.stage == partial);
let temp = dir.join(staging::unique_name());
let listed = fs::write(&temp, list).and_then(|_| fs::rename(&temp, staging::list_path(&partial))).is_ok();
if !listed {
let _ = fs::remove_file(&temp);
if !resumed {
let _ = fs::remove_file(&partial);
}
}
listed || resumed
}
fn tidy_fetch_error(message: &str) -> String {
message.strip_prefix("epic: ").unwrap_or(message).to_string()
}
#[cfg(test)]
mod tests {
use super::*;
fn part(file_offset: u64, size: u32) -> PlanPart {
PlanPart { chunk: 0, chunk_offset: 0, size, file_offset }
}
#[test]
fn a_pause_keeps_every_written_part_and_lists_them() {
let dir = std::env::temp_dir().join(format!("dd-epic-keep-{}", std::process::id()));
let _ = fs::remove_dir_all(&dir);
fs::create_dir_all(&dir).unwrap();
let file = EngineFile {
path: "Game/a.pak".into(),
dest: dir.join("a.pak"),
size: 30,
sha1: Some([1; 20]),
replacing: false,
parts: vec![part(0, 10), part(10, 10), part(20, 10)],
resume: None,
};
let kept = dir.join(staging::partial_name("Game/a.pak", 30, Some([1; 20])));
let stage = dir.join("x.stage");
fs::write(&stage, [7u8; 30]).unwrap();
assert!(!keep_partial(&file, &[false, false, false], &stage, &dir));
let unhashed = EngineFile {
path: file.path.clone(),
dest: file.dest.clone(),
size: 30,
sha1: None,
replacing: false,
parts: file.parts.clone(),
resume: None,
};
assert!(!keep_partial(&unhashed, &[true, true, true], &stage, &dir));
assert!(stage.exists());
assert!(keep_partial(&file, &[false, true, true], &stage, &dir));
assert_eq!(fs::read(&kept).unwrap(), [7u8; 30]);
assert_eq!(fs::read_to_string(staging::list_path(&kept)).unwrap(), "10\n20\n");
assert!(!stage.exists());
let resumed = EngineFile {
parts: vec![part(0, 10)],
resume: Some(Resume { stage: kept.clone(), kept: vec![20, 10] }),
..file
};
assert!(keep_partial(&resumed, &[false], &kept, &dir));
assert_eq!(fs::read_to_string(staging::list_path(&kept)).unwrap(), "10\n20\n");
let _ = fs::remove_dir_all(&dir);
}
}
@@ -39,10 +39,72 @@ pub fn arguments(d: &LaunchData) -> Vec<String> {
args
}
pub fn split_command(command: &str) -> Vec<String> {
let mut args = Vec::new();
let mut current = String::new();
let mut quoted = false;
let mut started = false;
let mut slashes = 0usize;
let mut chars = command.chars().map(|c| if c == '\t' { ' ' } else { c }).filter(|&c| c >= ' ' && c != '\u{7f}').peekable();
while let Some(c) = chars.next() {
if c == '\\' {
slashes += 1;
started = true;
continue;
}
if c == '"' {
current.extend(std::iter::repeat('\\').take(slashes / 2));
if slashes % 2 == 1 {
current.push('"');
} else if quoted && chars.peek() == Some(&'"') {
chars.next();
current.push('"');
} else {
quoted = !quoted;
}
slashes = 0;
started = true;
continue;
}
current.extend(std::iter::repeat('\\').take(slashes));
slashes = 0;
if c == ' ' && !quoted {
if started {
args.push(std::mem::take(&mut current));
started = false;
}
} else {
current.push(c);
started = true;
}
}
current.extend(std::iter::repeat('\\').take(slashes));
if started {
args.push(current);
}
args.retain(|a| !a.is_empty());
args
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn launch_command_splits_like_a_command_line() {
assert_eq!(split_command("-PCStore=EGS"), vec!["-PCStore=EGS"]);
assert_eq!(
split_command(" -a\t-b=\"c d\" \"-e f\" \"\" -g\r\n"),
vec!["-a", "-b=c d", "-e f", "-g"]
);
assert_eq!(
split_command(r#"-name="a\" b" -dir=C:\Games\ "-q=\\" -r"#),
vec![r#"-name=a" b"#, r"-dir=C:\Games\", r"-q=\", "-r"]
);
assert_eq!(split_command("-name=\"a\"\" b\" -s=\"\"\""), vec!["-name=a\" b", "-s=\""]);
assert!(split_command(" ").is_empty());
}
#[test]
fn arguments_in_order() {
let args = arguments(&LaunchData {
@@ -68,6 +68,7 @@ pub struct Manifest {
pub version: i64,
pub build_version: String,
pub launch_exe: String,
pub launch_command: String,
pub prereq_name: String,
pub prereq_path: String,
pub prereq_read: bool,
@@ -279,6 +280,7 @@ fn parse_binary(bytes: &[u8]) -> Result<Manifest, String> {
version,
build_version: meta.build_version,
launch_exe: meta.launch_exe,
launch_command: meta.launch_command,
prereq_name: meta.prereq_name,
prereq_path: meta.prereq_path,
prereq_read: meta.complete,
@@ -292,6 +294,7 @@ fn parse_binary(bytes: &[u8]) -> Result<Manifest, String> {
struct Meta {
build_version: String,
launch_exe: String,
launch_command: String,
prereq_name: String,
prereq_path: String,
complete: bool,
@@ -308,7 +311,7 @@ fn read_meta(data: &[u8]) -> Meta {
r.fstring()?;
meta.build_version = r.fstring()?;
meta.launch_exe = normalise_path(&r.fstring()?);
r.fstring()?;
meta.launch_command = r.fstring()?;
let ids = r.count(4)?;
for _ in 0..ids {
r.fstring()?;
@@ -548,6 +551,7 @@ fn parse_json(bytes: &[u8]) -> Result<Manifest, String> {
version,
build_version: str_field("BuildVersionString"),
launch_exe: normalise_path(launch),
launch_command: str_field("LaunchCommand"),
prereq_name: str_field("PrereqName"),
prereq_path: normalise_path(&str_field("PrereqPath")),
prereq_read: true,
@@ -611,7 +615,7 @@ pub mod testing {
fstring(&mut meta, "App");
fstring(&mut meta, &m.build);
fstring(&mut meta, &m.exe);
fstring(&mut meta, "");
fstring(&mut meta, "-PCStore=EGS \"-log=a b.txt\"");
if let Some((name, path)) = &m.prereq {
meta.extend_from_slice(&1i32.to_le_bytes());
fstring(&mut meta, "prereq-id");
@@ -763,6 +767,7 @@ mod tests {
assert_eq!(m.chunk_folder(), "ChunksV4");
assert_eq!(m.build_version, "1.2.3-CL-99");
assert_eq!(m.launch_exe, "Binaries/Win64/Game.exe");
assert_eq!(m.launch_command, "-PCStore=EGS \"-log=a b.txt\"");
assert_eq!(m.prereq_name, "UE4 Prerequisites (x64)");
assert_eq!(m.prereq_path, "Engine/Extras/UE4PrereqSetup_x64.exe");
assert!(m.prereq_read);
@@ -851,6 +856,7 @@ mod tests {
let doc = r#"{
"ManifestFileVersion": "013000000000",
"LaunchExeString": "Bin\\Game.exe",
"LaunchCommand": "-PCStore=EGS",
"BuildVersionString": "++Game+Release-1.0",
"PrereqName": "Redist", "PrereqPath": "Redist\\setup.exe",
"ChunkHashList": {
@@ -872,6 +878,7 @@ mod tests {
assert_eq!(m.version, 13);
assert_eq!(m.chunk_folder(), "ChunksV3");
assert_eq!(m.launch_exe, "Bin/Game.exe");
assert_eq!(m.launch_command, "-PCStore=EGS");
assert!(m.prereq_read);
assert_eq!(m.prereq_path, "Redist/setup.exe");
assert_eq!(m.chunks.len(), 2);
@@ -113,6 +113,7 @@ fn dispatch(op: &str, req: &Value) -> Value {
};
json!({ "args": launch::arguments(&data) })
}
"launch.split" => json!({ "args": launch::split_command(str_of(req, "command")) }),
"locale" => {
let key = locale::language_key(str_of(req, "language"), str_of(req, "region"));
json!({ "key": key, "tags": locale::tags_for_key(key), "launchLocale": locale::launch_locale(key) })
@@ -160,6 +161,11 @@ pub fn inspect(bytes: &[u8], request: &str) -> String {
.map(|a| a.iter().filter_map(|t| t.as_str()).map(str::to_string).collect());
json!({ "indices": locale::select(&m.files, tags.as_deref()) })
}
"launch" => json!({
"buildVersion": m.build_version,
"command": m.launch_command,
"args": launch::split_command(&m.launch_command),
}),
_ => json!({
"buildVersion": m.build_version,
"launchExe": m.launch_exe,
@@ -187,6 +193,8 @@ mod tests {
assert!(v["error"].is_string());
let v: Value = serde_json::from_str(&call("launch.args", r#"{"namespace":"ns","appName":"A"}"#)).unwrap();
assert_eq!(v["args"][0], "-EpicPortal");
let v: Value = serde_json::from_str(&call("launch.split", r#"{"command":"-PCStore=EGS \"-log=a b.txt\""}"#)).unwrap();
assert_eq!(v["args"], json!(["-PCStore=EGS", "-log=a b.txt"]));
}
#[test]
@@ -210,6 +218,10 @@ mod tests {
assert_eq!(v["files"].as_array().unwrap().len(), 2);
let v: Value = serde_json::from_str(&inspect(&bytes, r#"{"op":"select","tags":["English"]}"#)).unwrap();
assert_eq!(v["indices"], json!([0]));
let v: Value = serde_json::from_str(&inspect(&bytes, r#"{"op":"launch"}"#)).unwrap();
assert_eq!(v["buildVersion"], "b");
assert_eq!(v["command"], "-PCStore=EGS \"-log=a b.txt\"");
assert_eq!(v["args"], json!(["-PCStore=EGS", "-log=a b.txt"]));
let v: Value = serde_json::from_str(&inspect(b"nonsense", "{}")).unwrap();
assert!(v["error"].is_string());
}
@@ -1,42 +0,0 @@
package com.droiddeck.launcher.core
import org.junit.Assert.*
import org.junit.Test
class CpuAllocationDefaultsTest {
private val thor = (0..7).associateWith { when (it) { in 0..2 -> 2.016; in 3..6 -> 2.8032; else -> 3.1872 } }
@Test fun gen2UsesTheFourMiddleCoresAndOnePrime() {
for (model in listOf("SM8550", "QCS8550", "sm8550-ac")) {
assertEquals(CpuAllocationDefaults.Allocation("7", "3,4,5,6"), CpuAllocationDefaults.forDevice(model, "", thor))
}
assertEquals(CpuAllocationDefaults.Allocation("7", "3,4,5,6"), CpuAllocationDefaults.forDevice("", "kalama", thor))
}
@Test fun coreNumbersAndClockVariantsAreDetectedInsteadOfHardcoded() {
val reordered = mapOf(0 to 3.36, 1 to 2.0, 2 to 2.0, 3 to 2.0, 4 to 2.8, 5 to 2.8, 6 to 2.8, 7 to 2.8)
assertEquals(CpuAllocationDefaults.Allocation("0", "4,5,6,7"), CpuAllocationDefaults.forDevice("SM8550-AC", "kalama", reordered))
}
@Test fun anotherOrUnknownChipDoesNotAcquireThisDefault() {
assertNull(CpuAllocationDefaults.forDevice("SM8650", "pineapple", thor))
assertNull(CpuAllocationDefaults.forDevice("SM8650", "kalama", thor))
assertNull(CpuAllocationDefaults.forDevice("", "", thor))
}
@Test fun missingOrUnexpectedTopologyKeepsTheSchedulerDefault() {
assertNull(CpuAllocationDefaults.forDevice("SM8550", "kalama", thor - 7))
assertNull(CpuAllocationDefaults.forDevice("SM8550", "kalama", thor + (7 to null)))
assertNull(CpuAllocationDefaults.forDevice("SM8550", "kalama", thor + (7 to 0.0)))
assertNull(CpuAllocationDefaults.forDevice("SM8550", "kalama", thor + (7 to Double.NaN)))
assertNull(CpuAllocationDefaults.forDevice("SM8550", "kalama", (0..7).associateWith { 2.8 }))
}
@Test fun allCoreGamesUndoTheClientsInheritedRestriction() {
val all = CpuCores.listOrAll("")
assertEquals(all, CpuCores.gameLaunchList("", clientPinned = true))
assertEquals(all, CpuCores.gameLaunchList(all, clientPinned = true))
assertEquals("", CpuCores.gameLaunchList("", clientPinned = false))
assertEquals("0", CpuCores.gameLaunchList("0", clientPinned = true))
}
}
@@ -0,0 +1,43 @@
package com.droiddeck.launcher.frontend
import java.io.File
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNull
import org.junit.Rule
import org.junit.Test
import org.junit.rules.TemporaryFolder
class AddedGamesAccountTest {
@get:Rule val tmp = TemporaryFolder()
private fun steamRoot(vararg blocks: Pair<Long, Map<String, String>>): File = tmp.newFolder("Steam").also { root ->
File(root, "config").mkdirs()
File(root, "userdata/123/config").mkdirs()
File(root, "userdata/456/config").mkdirs()
val body = blocks.joinToString("") { (account, keys) ->
"\t\"${76561197960265728L + account}\"\n\t{\n" + keys.entries.joinToString("") { "\t\t\"${it.key}\"\t\t\"${it.value}\"\n" } + "\t}\n"
}
File(root, "config/loginusers.vdf").writeText("\"users\"\n{\n$body}\n")
}
@Test fun theAccountMarkedMostRecentIsUsed() {
val root = steamRoot(123L to mapOf("MostRecent" to "1", "AutoLogin" to "0", "timestamp" to "100"),
456L to mapOf("MostRecent" to "0", "AutoLogin" to "1", "timestamp" to "200"))
assertEquals(File(root, "userdata/123/config"), AddedGames.accountConfig(root))
}
@Test fun withoutMostRecentTheAccountThatSignsInIsUsed() {
val root = steamRoot(123L to mapOf("AutoLogin" to "1", "timestamp" to "100"), 456L to mapOf("AutoLogin" to "0", "timestamp" to "200"))
assertEquals(File(root, "userdata/123/config"), AddedGames.accountConfig(root))
}
@Test fun withoutEitherMarkTheAccountUsedLastIsUsed() {
val root = steamRoot(456L to mapOf("AutoLogin" to "0", "timestamp" to "100"), 123L to mapOf("AutoLogin" to "0", "timestamp" to "200"))
assertEquals(File(root, "userdata/123/config"), AddedGames.accountConfig(root))
}
@Test fun twoAccountsWithoutAnyMarkGiveNoAccount() {
val root = steamRoot(123L to mapOf("AccountName" to "a"), 456L to mapOf("AccountName" to "b"))
assertNull(AddedGames.accountConfig(root))
}
}
@@ -39,6 +39,28 @@ class GameLogoTest {
assertNull(Library.steamCacheImage(cache, 730, Library.STEAM_LOGOS))
}
@Test fun aSteamScanKeepsEveryArtworkSlotAndSeesNewHashDirectories() {
val root = SessionPrefs.steamRoot(app, "arm64")
File(root, "steamapps/appmanifest_620.acf").apply {
parentFile!!.mkdirs()
writeText("\"AppState\"\n{\n\"name\" \"Portal 2\"\n\"StateFlags\" \"4\"\n}\n")
}
val cache = File(root, "appcache/librarycache/620")
fun cached(path: String) = File(cache, path).apply {
parentFile!!.mkdirs()
writeBytes(byteArrayOf(1))
}
val cover = cached("library_capsule.jpg")
val hero = cached("hash/library_hero.jpg")
val icon = cached("${"a".repeat(40)}.jpg")
val game = Library.steamGames(app, arch = "arm64").single()
assertEquals(listOf(cover, hero, icon, null), listOf(game.art, game.hero, game.icon, game.logo))
val logo = cached("new-hash/logo.png")
val refreshed = Library.steamGames(app, arch = "arm64").single()
assertEquals(listOf(cover, hero, icon, logo), listOf(refreshed.art, refreshed.hero, refreshed.icon, refreshed.logo))
}
@Test fun aChosenLogoWinsOverSteamsAndKeepsTheRest() {
val stock = image("logo.png")
val game = Library.SteamGame(620, "Portal 2", null, "Steam library", logo = stock)
@@ -0,0 +1,72 @@
package com.droiddeck.launcher.frontend
import android.os.Looper
import com.droiddeck.launcher.FrontEndActivity
import com.droiddeck.launcher.runtime.LinuxRuntime
import com.droiddeck.launcher.session.SessionPrefs
import com.droiddeck.launcher.session.SessionService
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertNull
import org.junit.Assert.assertTrue
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.Robolectric
import org.robolectric.RobolectricTestRunner
import org.robolectric.Shadows.shadowOf
import org.robolectric.annotation.Config
import org.robolectric.annotation.LooperMode
import java.io.File
@RunWith(RobolectricTestRunner::class)
@Config(sdk = [28])
@LooperMode(LooperMode.Mode.PAUSED)
class ModeSettingsLoadingTest {
@Test fun steamPublishesItsShaderChoiceThroughTheMainQueue() {
val activity = Robolectric.buildActivity(FrontEndActivity::class.java).get()
SessionPrefs.setShaderPrecache(activity, false)
load(activity, SessionService.MODE_STEAM)
awaitRead()
assertNull(value(activity))
shadowOf(Looper.getMainLooper()).idle()
assertEquals(false, value(activity))
}
@Test fun desktopDoesNotConsumeSteamsAppliedShaderChoice() {
val activity = Robolectric.buildActivity(FrontEndActivity::class.java).get()
SessionPrefs.setShaderPrecache(activity, false)
val applied = File(LinuxRuntime.rootDir(activity), "root/.bl-shader-precache-applied")
applied.parentFile!!.mkdirs()
applied.writeText("0")
load(activity, SessionService.MODE_DESKTOP)
awaitRead()
shadowOf(Looper.getMainLooper()).idle()
assertTrue(applied.isFile)
assertNull(value(activity))
}
@Test fun switchingToDesktopDiscardsAQueuedSteamResult() {
val activity = Robolectric.buildActivity(FrontEndActivity::class.java).get()
load(activity, SessionService.MODE_STEAM)
awaitRead()
load(activity, SessionService.MODE_DESKTOP)
shadowOf(Looper.getMainLooper()).idle()
assertNull(value(activity))
}
private fun load(activity: FrontEndActivity, mode: String) {
FrontEndActivity::class.java.getDeclaredMethod("loadShaderPrecache", String::class.java)
.apply { isAccessible = true }.invoke(activity, mode)
}
private fun value(activity: FrontEndActivity): Boolean? =
FrontEndActivity::class.java.getDeclaredMethod("getShaderPrecache")
.apply { isAccessible = true }.invoke(activity) as Boolean?
private fun awaitRead() {
Thread.getAllStackTraces().keys.filter { it.name == "shader-precache" }.forEach {
it.join(5_000)
assertFalse("Shader settings read did not finish", it.isAlive)
}
}
}
@@ -0,0 +1,118 @@
package com.droiddeck.launcher.frontend
import java.io.File
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNull
import org.junit.Rule
import org.junit.Test
import org.junit.rules.TemporaryFolder
class SteamCacheImagesTest {
@get:Rule val tmp = TemporaryFolder()
private fun image(path: String, bytes: ByteArray = byteArrayOf(1)): File =
File(tmp.root, path).apply { parentFile!!.mkdirs(); writeBytes(bytes) }
private class CountingDirectory(directory: File) : File(directory.path) {
var listings = 0
private set
override fun listFiles(): Array<File>? {
listings++
return super.listFiles()?.sortedByDescending { it.name }?.toTypedArray()
}
}
@Test fun allArtworkAndTheHashIconShareOneDirectoryListing() {
val cover = image("620/library_capsule.jpg")
val hero = image("620/b/library_hero.jpg")
val logo = image("620/a/logo.png")
val icon = image("620/${"a".repeat(40)}.png")
val directory = CountingDirectory(File(tmp.root, "620"))
val images = Library.SteamCacheImages(directory)
assertEquals(cover, images.find(listOf("library_capsule.jpg", "library_600x900.jpg")))
assertEquals(hero, images.find(listOf("library_hero.jpg")))
assertEquals(logo, images.find(Library.STEAM_LOGOS))
assertEquals(icon, images.icon())
assertEquals(1, directory.listings)
}
@Test fun preferredFilenamesWinEvenWhenOnlyTheAlternativeIsInTheRoot() {
image("620/library_600x900.jpg")
val preferred = image("620/hash/library_capsule.jpg")
assertEquals(preferred, Library.steamCacheImage(
tmp.root, 620, listOf("library_capsule.jpg", "library_600x900.jpg"),
))
}
@Test fun theRootWinsOverHashDirectoriesForTheSameFilename() {
image("620/hash/logo.png")
val root = image("620/logo.png")
assertEquals(root, Library.steamCacheImage(tmp.root, 620, Library.STEAM_LOGOS))
}
@Test fun hashDirectoriesAreSearchedByNameNotListingOrder() {
image("620/z/logo.png")
val first = image("620/a/logo.png")
val directory = CountingDirectory(File(tmp.root, "620"))
assertEquals(first, Library.SteamCacheImages(directory).find(Library.STEAM_LOGOS))
assertEquals(1, directory.listings)
}
@Test fun emptyFilesAndDirectoriesAreNotArtwork() {
image("620/logo.png", byteArrayOf())
File(tmp.root, "620/a/logo.png").mkdirs()
val valid = image("620/b/logo.png")
assertEquals(valid, Library.steamCacheImage(tmp.root, 620, Library.STEAM_LOGOS))
}
@Test fun namedIconsKeepTheirFilenamePriorityOverHashIcons() {
image("620/${"a".repeat(40)}.png")
image("620/icon.png")
val preferred = image("620/hash/icon.jpg")
assertEquals(preferred, Library.SteamCacheImages(File(tmp.root, "620")).icon())
}
@Test fun hashIconsKeepTheOriginalRootListingOrderAndAllowEmptyFiles() {
image("620/${"0".repeat(40)}.jpg")
val first = image("620/${"F".repeat(40)}.png", byteArrayOf())
File(tmp.root, "620/${"z".repeat(40)}.png").mkdirs()
image("620/${"g".repeat(40)}.png")
val directory = CountingDirectory(File(tmp.root, "620"))
val images = Library.SteamCacheImages(directory)
assertEquals(first, images.icon())
assertEquals(1, directory.listings)
}
@Test fun hashIconsOutsideTheRootAndInvalidHashesAreIgnored() {
image("620/hash/${"a".repeat(40)}.jpg")
image("620/${"g".repeat(40)}.png")
image("620/${"a".repeat(39)}.png")
assertNull(Library.SteamCacheImages(File(tmp.root, "620")).icon())
}
@Test fun missingDirectoriesAreListedOnlyOnce() {
val directory = CountingDirectory(File(tmp.root, "missing"))
val images = Library.SteamCacheImages(directory)
assertNull(images.find(Library.STEAM_LOGOS))
assertNull(images.icon())
assertEquals(1, directory.listings)
}
@Test fun aNewLookupSeesHashDirectoriesAddedAfterThePreviousScan() {
image("620/unrelated.txt")
assertNull(Library.steamCacheImage(tmp.root, 620, Library.STEAM_LOGOS))
val added = image("620/new-hash/logo.png")
assertEquals(added, Library.steamCacheImage(tmp.root, 620, Library.STEAM_LOGOS))
}
}
@@ -0,0 +1,138 @@
package com.droiddeck.launcher.lan
import android.Manifest
import android.app.Application
import android.content.Intent
import android.location.LocationManager
import android.net.wifi.SoftApConfiguration
import android.net.wifi.WifiConfiguration
import android.net.wifi.WifiManager
import android.os.Handler
import com.droiddeck.launcher.R
import org.junit.After
import org.junit.Assert.*
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.Robolectric
import org.robolectric.RobolectricTestRunner
import org.robolectric.RuntimeEnvironment
import org.robolectric.Shadows.shadowOf
import org.robolectric.annotation.Config
import org.robolectric.annotation.Implementation
import org.robolectric.annotation.Implements
import org.robolectric.shadows.ShadowWifiManager
import org.robolectric.shadow.api.Shadow
@RunWith(RobolectricTestRunner::class)
@Config(sdk = [28, 34], application = Application::class, shadows = [LanWifiShadow::class, LanReservationShadow::class, LanSoftApShadow::class])
class LocalHotspotServiceTest {
private lateinit var controller: org.robolectric.android.controller.ServiceController<LocalHotspotService>
private val service get() = controller.get()
@Before fun prepare() {
LocalLan.hotspotState.value = HotspotState()
LanWifiShadow.callback = null
LanWifiShadow.requests = 0
LanWifiShadow.unsupported = false
LanReservationShadow.closes = 0
val app = RuntimeEnvironment.getApplication()
shadowOf(app).grantPermissions(Manifest.permission.ACCESS_FINE_LOCATION)
shadowOf(app.getSystemService(LocationManager::class.java)).setLocationEnabled(true)
controller = Robolectric.buildService(LocalHotspotService::class.java).create()
}
@After fun cleanUp() {
controller.destroy()
LocalLan.hotspotState.value = HotspotState()
}
private fun start() = service.onStartCommand(Intent(), 0, 1)
@Test fun repeatedStartsShareOneRequestAndDestroyReleasesTheReservation() {
start()
start()
assertEquals(1, LanWifiShadow.requests)
assertTrue(LocalLan.hotspot.value.starting)
LanWifiShadow.callback!!.onStarted(Shadow.newInstanceOf(WifiManager.LocalOnlyHotspotReservation::class.java))
assertEquals("DroidDeck-test", LocalLan.hotspot.value.ssid)
assertEquals("test-password", LocalLan.hotspot.value.password)
start()
assertEquals(1, LanWifiShadow.requests)
service.onDestroy()
assertEquals(1, LanReservationShadow.closes)
assertNull(LocalLan.hotspot.value.password)
}
@Test fun aLateReservationAfterShutdownIsClosedWithoutPublishingCredentials() {
start()
service.onDestroy()
LanWifiShadow.callback!!.onStarted(Shadow.newInstanceOf(WifiManager.LocalOnlyHotspotReservation::class.java))
assertEquals(1, LanReservationShadow.closes)
assertNull(LocalLan.hotspot.value.ssid)
assertFalse(LocalLan.hotspot.value.starting)
}
@Test fun failureExplainsIncompatibleTethering() {
start()
LanWifiShadow.callback!!.onFailed(WifiManager.LocalOnlyHotspotCallback.ERROR_INCOMPATIBLE_MODE)
assertEquals(R.string.lan_incompatible, LocalLan.hotspot.value.error)
assertTrue(shadowOf(service).isStoppedBySelf)
}
@Test fun missingPermissionDoesNotRequestWifi() {
shadowOf(RuntimeEnvironment.getApplication()).denyPermissions(Manifest.permission.ACCESS_FINE_LOCATION)
start()
assertEquals(0, LanWifiShadow.requests)
assertEquals(R.string.lan_permission_needed, LocalLan.hotspot.value.error)
}
@Test fun disabledLocationDoesNotRequestWifi() {
shadowOf(service.getSystemService(LocationManager::class.java)).setLocationEnabled(false)
start()
assertEquals(0, LanWifiShadow.requests)
assertEquals(R.string.lan_location_needed, LocalLan.hotspot.value.error)
}
@Test fun unsupportedHardwareStopsCleanly() {
LanWifiShadow.unsupported = true
start()
assertEquals(R.string.lan_failed, LocalLan.hotspot.value.error)
assertTrue(shadowOf(service).isStoppedBySelf)
}
}
@Implements(WifiManager::class)
class LanWifiShadow : ShadowWifiManager() {
@Implementation
fun startLocalOnlyHotspot(callback: WifiManager.LocalOnlyHotspotCallback, handler: Handler?) {
if (unsupported) throw UnsupportedOperationException()
requests++
Companion.callback = callback
}
companion object {
var callback: WifiManager.LocalOnlyHotspotCallback? = null
var requests = 0
var unsupported = false
}
}
@Implements(WifiManager.LocalOnlyHotspotReservation::class)
class LanReservationShadow {
@Implementation fun close() { closes++ }
@Implementation(maxSdk = 29)
fun getWifiConfiguration() = WifiConfiguration().apply { SSID = "DroidDeck-test"; preSharedKey = "test-password" }
@Implementation(minSdk = 30)
fun getSoftApConfiguration(): SoftApConfiguration = Shadow.newInstanceOf(SoftApConfiguration::class.java)
companion object { var closes = 0 }
}
@Implements(SoftApConfiguration::class, minSdk = 30)
class LanSoftApShadow {
@Implementation fun getSsid() = "DroidDeck-test"
@Implementation fun getPassphrase() = "test-password"
}
@@ -0,0 +1,129 @@
package com.droiddeck.launcher.lan
import android.app.Application
import android.net.LinkProperties
import android.net.NetworkCapabilities
import android.net.wifi.WifiManager
import android.os.Looper
import com.droiddeck.launcher.runtime.LinuxNetworkLinkComponent
import java.io.File
import java.net.Inet4Address
import java.net.InetAddress
import java.nio.file.Files
import java.time.Duration
import org.json.JSONObject
import org.junit.After
import org.junit.Assert.*
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner
import org.robolectric.RuntimeEnvironment
import org.robolectric.Shadows.shadowOf
import org.robolectric.annotation.Config
import org.robolectric.annotation.LooperMode
@RunWith(RobolectricTestRunner::class)
@Config(sdk = [26, 28, 34], application = Application::class)
@LooperMode(LooperMode.Mode.PAUSED)
class LocalLanTest {
private lateinit var root: File
private var lan: LanInterface? = null
private lateinit var component: LinuxNetworkLinkComponent
private val host = LanInterface("ap0", 23, 1400, listOf(LanAddress(InetAddress.getByName("192.168.73.1"), 24)))
@Before fun prepare() {
root = Files.createTempDirectory("lan-test").toFile()
lan = host
LocalLan.select(null)
component = LinuxNetworkLinkComponent(RuntimeEnvironment.getApplication(), root) { lan }
}
@After fun cleanUp() {
component.stop()
LocalLan.select(null)
root.deleteRecursively()
}
private fun state() = JSONObject(File(root, "etc/droiddeck-network.json").readText())
private fun link() = File(root, "etc/droiddeck-net").readText()
@Test fun selectedHotspotPublishesRealAddressAndKernelIndexWithoutPretendingInternetIsAvailable() {
LocalLan.select(host.name)
component.publish()
assertTrue(link().startsWith("if ap0 23 1400\n"))
assertTrue(link().contains("selected 1\n"))
assertTrue(link().contains("addr 192.168.73.1 24\n"))
assertFalse(link().contains("10.0.0.2"))
assertFalse(link().contains("gw "))
assertTrue(state().getBoolean("connected"))
assertTrue(state().getBoolean("localLan"))
assertFalse(state().getBoolean("validated"))
assertEquals("ap0", state().getString("interface"))
assertEquals(0, state().getJSONArray("gateways").length())
}
@Test fun disconnectClearsSelectedInterfaceAndNeverInventsAnAddress() {
LocalLan.select(host.name)
component.start()
shadowOf(Looper.getMainLooper()).idle()
lan = null
shadowOf(Looper.getMainLooper()).idleFor(Duration.ofSeconds(1))
assertEquals("", link())
assertFalse(state().getBoolean("connected"))
assertEquals(0, state().getJSONArray("addresses").length())
assertEquals(host.name, LocalLan.selected.value)
lan = host.copy(addresses = listOf(LanAddress(InetAddress.getByName("192.168.74.1"), 24)))
shadowOf(Looper.getMainLooper()).idleFor(Duration.ofSeconds(1))
assertTrue(link().contains("addr 192.168.74.1 24\n"))
}
@Test fun selectingALanHoldsMulticastUntilResetAndReleasesThePreviousLock() {
val context = RuntimeEnvironment.getApplication()
val field = LocalLan.javaClass.getDeclaredField("multicast").apply { isAccessible = true }
LocalLan.select(host.name, context)
val first = field.get(LocalLan) as WifiManager.MulticastLock
assertTrue(first.isHeld)
LocalLan.select("usb0", context)
assertFalse(first.isHeld)
val second = field.get(LocalLan) as WifiManager.MulticastLock
assertTrue(second.isHeld)
LocalLan.select(null)
assertFalse(second.isHeld)
}
@Test fun returningToDefaultRestoresExistingOfflineBehavior() {
LocalLan.select(host.name)
component.publish()
LocalLan.select(null)
component.publish()
assertTrue(link().startsWith("if eth0 2 1500\n"))
assertTrue(link().contains("addr 10.0.0.2 24\n"))
assertFalse(link().contains("selected 1"))
assertFalse(state().getBoolean("localLan"))
}
@Test fun selectedLanDoesNotInheritDefaultNetworkAddressesOrValidation() {
LocalLan.select(host.name)
val properties = LinkProperties()
val caps = NetworkCapabilities()
component.javaClass.getDeclaredMethod("write", LinkProperties::class.java, NetworkCapabilities::class.java).apply {
isAccessible = true
}.invoke(component, properties, caps)
assertEquals("192.168.73.1", state().getJSONArray("addresses").getJSONObject(0).getString("address"))
assertFalse(state().getBoolean("validated"))
assertEquals(0, state().getJSONArray("dns").length())
}
@Test fun lanCandidatesExcludePublicLoopbackAndInvalidPrefixes() {
fun usable(ip: String, prefix: Int = 24) = LocalLan.usableAddress(InetAddress.getByName(ip) as Inet4Address, prefix)
assertTrue(usable("192.168.43.1"))
assertTrue(usable("10.15.0.1"))
assertTrue(usable("172.20.0.1"))
assertTrue(usable("169.254.2.3", 16))
assertFalse(usable("127.0.0.1"))
assertFalse(usable("8.8.8.8"))
assertFalse(usable("192.168.43.1", 0))
assertFalse(usable("192.168.43.1", 33))
}
}
@@ -178,17 +178,39 @@ class BootMovieLibraryTest {
assertNull(SessionFiles.startupMoviePath(BootMovieLibrary.steamConfig(app)))
}
@Test fun onlyTheThreeStartupMoviesOfSteamAreListed() {
listOf("deck_startup", "oled_startup", "startup_machine", "controller_generic_thumbstick_move").forEach {
@Test fun onlyTheStartupMoviesOfSteamAreListed() {
listOf("deck_startup", "oled_startup", "startup_machine", "steam_os_startup", "controller_generic_thumbstick_move").forEach {
File(BootMovieLibrary.steamRoot(app), "steamui/movies/$it.webm").also { f -> f.parentFile!!.mkdirs(); f.writeText("movie") }
}
val ids = BootMovieLibrary.list(app).map { it.id }.filter { it.startsWith("steam:") }
assertEquals(
listOf("steam:/movies/deck_startup.webm", "steam:/movies/oled_startup.webm", "steam:/movies/startup_machine.webm"),
listOf(
"steam:/movies/deck_startup.webm", "steam:/movies/oled_startup.webm", "steam:/movies/startup_machine.webm",
"steam:/movies/steam_os_startup.webm",
),
ids.sorted(),
)
}
@Test fun steamsDefaultPickIsTakenOverAsItsOwnStartupMovie() {
val native = File(BootMovieLibrary.steamRoot(app), "steamui/movies/steam_os_startup.webm").also { it.parentFile!!.mkdirs(); it.writeText("movie") }
movie("a.webm")
steamPicksAt(SessionFiles.BOOT_MOVIE_PATH)
BootMovie.select(app, "file:a.webm")
steamPicksAt("")
assertTrue(BootMovie.syncFromSteam(app))
assertEquals("steam:/movies/steam_os_startup.webm", BootMovie.choice(app))
assertEquals(native, BootMovie.currentFile(app))
assertFalse(BootMovie.syncFromSteam(app))
}
@Test fun anEmptySteamPickThatWasNeverSeenChangesNothing() {
File(BootMovieLibrary.steamRoot(app), "steamui/movies/steam_os_startup.webm").also { it.parentFile!!.mkdirs(); it.writeText("movie") }
steamPicksAt("")
assertFalse(BootMovie.syncFromSteam(app))
assertEquals(BootMovie.DROIDDECK_30, BootMovie.choice(app))
}
@Test fun aMovieBoughtInThePointsShopIsListedAndAdopted() {
val file = File(BootMovieLibrary.steamRoot(app), "appcache/startupmovies/Bought.webm").also { it.parentFile!!.mkdirs(); it.writeText("movie") }
val entry = BootMovieLibrary.list(app).first { it.id == "steam:/appcache/startupmovies/Bought.webm" }
@@ -0,0 +1,32 @@
package com.droiddeck.launcher.session
import org.json.JSONObject
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner
import java.io.File
@RunWith(RobolectricTestRunner::class)
class ComponentsSelectionTest {
private val proton = ComponentsManager.Proton("DroidDeck-Proton_11-11.1", "DroidDeck-Proton 11-11.1", File("/p"), "/p", "DroidDeck-Proton-11-11.1", false)
private val entry = JSONObject().put("file", "dxvk-low-latency-arm64ec-3.1.1-2-linux.wcp").put("protonVersion", "DroidDeck-Proton-11-11.1")
@Test
fun `a package swapped into an installed Proton is in use`() {
assertTrue(ComponentsManager.liveSelection("active", entry, proton))
assertTrue(ComponentsManager.liveSelection("queued", JSONObject().put("file", "x.wcp"), proton))
}
@Test
fun `a package left on a removed Proton is not in use`() {
assertFalse(ComponentsManager.liveSelection("active", entry, null))
assertFalse(ComponentsManager.liveSelection("queued", entry, null))
}
@Test
fun `a package from before a Proton update is not in use`() {
assertFalse(ComponentsManager.liveSelection("active", JSONObject(entry.toString()).put("protonVersion", "DroidDeck-Proton-11-9.1"), proton))
}
}
@@ -1,7 +1,6 @@
package com.droiddeck.launcher.session
import android.content.Context
import com.droiddeck.launcher.core.CpuAllocationDefaults
import org.junit.Assert.*
import org.junit.Before
import org.junit.Test
@@ -14,36 +13,22 @@ import org.robolectric.annotation.Config
@Config(sdk = [33])
class CoreAllocationPrefsTest {
private val app get() = RuntimeEnvironment.getApplication()
private val defaults = CpuAllocationDefaults.Allocation("7", "3,4,5,6")
private val saved get() = app.getSharedPreferences("session", Context.MODE_PRIVATE)
@Before fun clear() { saved.edit().clear().commit() }
@Test fun absentPreferencesUseTheDeviceDefaultWithoutWritingIt() {
assertEquals(SessionPrefs.CoreAllocation(true, "7", "3,4,5,6"), SessionPrefs.coreAllocation(app, defaults))
assertTrue(saved.all.isEmpty())
assertEquals(SessionPrefs.CoreAllocation(false, "", ""), SessionPrefs.coreAllocation(app, null))
@Test fun absentPreferencesLeaveEveryCoreToTheScheduler() {
assertFalse(SessionPrefs.clientCpusOverride(app))
assertEquals("", SessionPrefs.clientCpus(app))
assertEquals("", SessionPrefs.gameCpus(app))
}
@Test fun explicitDisableAndAllCoreChoicesSurviveAnUpdate() {
saved.edit().putBoolean("clientCpusOverride", false).putString("clientCpus", "").putString("gameCpus", "").commit()
assertEquals(SessionPrefs.CoreAllocation(false, "", ""), SessionPrefs.coreAllocation(app, defaults))
}
@Test fun existingCustomMasksArePreserved() {
saved.edit().putBoolean("clientCpusOverride", true).putString("clientCpus", "0,1").putString("gameCpus", "2,7").commit()
assertEquals(SessionPrefs.CoreAllocation(true, "0,1", "2,7"), SessionPrefs.coreAllocation(app, defaults))
}
@Test fun anOldClientMaskIsNotEnabledWithoutAnOverrideChoice() {
saved.edit().putString("clientCpus", "0,1").commit()
assertEquals(SessionPrefs.CoreAllocation(false, "0,1", "3,4,5,6"), SessionPrefs.coreAllocation(app, defaults))
}
@Test fun changingOneChoiceDoesNotReplaceTheOtherDefaults() {
SessionPrefs.setGameCpus(app, "0,1,2,3,4,5,6,7")
assertEquals(SessionPrefs.CoreAllocation(true, "7", "0,1,2,3,4,5,6,7"), SessionPrefs.coreAllocation(app, defaults))
SessionPrefs.setClientCpusOverride(app, false)
assertEquals(SessionPrefs.CoreAllocation(false, "7", "0,1,2,3,4,5,6,7"), SessionPrefs.coreAllocation(app, defaults))
@Test fun savedChoicesAreKept() {
SessionPrefs.setClientCpusOverride(app, true)
SessionPrefs.setClientCpus(app, "7")
SessionPrefs.setGameCpus(app, "3,4,5,6")
assertTrue(SessionPrefs.clientCpusOverride(app))
assertEquals("7", SessionPrefs.clientCpus(app))
assertEquals("3,4,5,6", SessionPrefs.gameCpus(app))
}
}
@@ -0,0 +1,36 @@
package com.droiddeck.launcher.session
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNull
import org.junit.Test
class LoadingStateTest {
@Test fun clientDownloadCountsMegabytesWhenTheRuntimeSaysThem() {
assertEquals(
"45 / 360 MB" to 12,
LoadingState.clientDownload("== STEP 17:38:20 downloading Steam: bins_linuxarm64_linuxarm64 (2/17), 45 of 360 MB"),
)
}
@Test fun aStalledDownloadStillShowsWhereItIs() {
assertEquals(
"45 / 360 MB" to 12,
LoadingState.clientDownload(
"== STEP 17:39:20 downloading Steam: bins_linuxarm64_linuxarm64 (2/17), 45 of 360 MB" +
" - interrupted (curl exit 28), trying again in 5 s",
),
)
}
@Test fun anOlderRuntimeShowsThePartAndItsNumber() {
assertEquals(
"bins_linuxarm64_linuxarm64" to 11,
LoadingState.clientDownload("== STEP 17:38:17 downloading Steam: bins_linuxarm64_linuxarm64 (2/17)"),
)
assertEquals("a_all" to 50, LoadingState.clientDownload("== STEP 00:00:00 downloading Steam: a_all (1/2), 0 of 0 MB"))
}
@Test fun otherStepsAreNotClientDownloads() {
assertNull(LoadingState.clientDownload("== STEP 17:38:14 checking the Steam client (a first run downloads it)"))
}
}
@@ -171,4 +171,31 @@ class ProtonExtrasTest {
assertEquals(listOf("DroidDeck-Proton 11-7.10"), ProtonExtras.installedAll(context, tool("droiddeck")))
assertEquals("DroidDeck-Proton 11-7.10", ProtonExtras.installed(context, tool("droiddeck")))
}
@Test
fun removingABuildDropsItsStoredOriginalsAndSelections() {
val context = RuntimeEnvironment.getApplication()
val tools = File(LinuxRuntime.rootDir(context), "root/.local/share/Steam/compatibilitytools.d")
File(LinuxRuntime.rootDir(context), "root/.local/share/droiddeck-components").mkdirs()
installTool(tools, "GE-Proton11-7")
val kept = installTool(tools, "GE-Proton11-8").apply {
File(this, "files/lib/wine").mkdirs()
File(this, "proton").writeText("")
}
val originals = File(context.filesDir, "components/originals")
for (id in listOf("GE-Proton11-7", "GE-Proton11-8")) File(originals, "$id/$id/dxvk.wcp").apply { parentFile?.mkdirs(); writeText("x") }
val pick = JSONObject().put("dxvk", JSONObject().put("file", "dxvk.wcp").put("protonVersion", "GE-Proton11-7"))
File(context.filesDir, "components/state.json").writeText(JSONObject()
.put("active", JSONObject().put("GE-Proton11-7", pick).put("GE-Proton11-8", pick))
.put("queued", JSONObject().put("GE-Proton11-7", pick)).toString())
ProtonExtras.remove(context, tool("ge"), "GE-Proton11-7")
assertFalse(File(originals, "GE-Proton11-7").exists())
assertTrue(File(originals, "GE-Proton11-8/GE-Proton11-8/dxvk.wcp").isFile)
val state = JSONObject(File(context.filesDir, "components/state.json").readText())
assertFalse(state.getJSONObject("active").has("GE-Proton11-7"))
assertFalse(state.getJSONObject("queued").has("GE-Proton11-7"))
assertTrue(state.getJSONObject("active").has("GE-Proton11-8"))
ComponentsManager.forgetProton(context, kept.name)
assertTrue(File(originals, "GE-Proton11-8/GE-Proton11-8/dxvk.wcp").isFile)
}
}
@@ -0,0 +1,62 @@
package com.droiddeck.launcher.session
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Rule
import org.junit.Test
import org.junit.rules.TemporaryFolder
import java.io.File
class SessionSteamLogsTest {
@get:Rule val tmp = TemporaryFolder()
private fun names(files: List<File>) = files.map { it.name }.sorted()
@Test fun onlyWhatTheSessionWroteIsCollected() {
val logs = tmp.newFolder("logs")
val session = tmp.newFolder("session")
val out = tmp.newFolder("out")
File(logs, "console_log.txt").writeText("old line\n")
File(logs, "cef_log.txt").writeText("old cef\n")
File(logs, "cef_log.previous.txt").writeText("older cef\n")
File(logs, "shrunk.txt").writeText("a long old line\n")
File(logs, "untouched.txt").writeText("nothing new\n")
SessionArtifacts.markSteamLogs(session, logs)
File(logs, "console_log.txt").appendText("new line\n")
File(logs, "cef_log.previous.txt").delete()
File(logs, "cef_log.txt").renameTo(File(logs, "cef_log.previous.txt"))
File(logs, "cef_log.txt").writeText("this session's cef\n")
File(logs, "shrunk.txt").writeText("short\n")
File(logs, "content_log.txt").writeText("created this session\n")
val copied = SessionArtifacts.copySessionLogs(logs, session, out)
assertEquals(listOf("cef_log.txt", "console_log.txt", "content_log.txt", "shrunk.txt"), names(copied))
assertEquals("new line\n", File(out, "console_log.txt").readText())
assertEquals("this session's cef\n", File(out, "cef_log.txt").readText())
assertEquals("short\n", File(out, "shrunk.txt").readText())
assertFalse(File(out, "cef_log.previous.txt").exists())
assertFalse(File(out, "untouched.txt").exists())
}
@Test fun aLineCutByTheMarkIsLeftOut() {
val logs = tmp.newFolder("logs")
val session = tmp.newFolder("session")
val out = tmp.newFolder("out")
File(logs, "web.txt").writeText("old\nGET /x?sessionid=")
SessionArtifacts.markSteamLogs(session, logs)
File(logs, "web.txt").appendText("abcdef123456 200\nnext line\n")
SessionArtifacts.copySessionLogs(logs, session, out)
assertEquals("next line\n", File(out, "web.txt").readText())
}
@Test fun withoutMarksEveryLogUnderTheCapIsCollectedAndRedacted() {
val logs = tmp.newFolder("logs")
val out = tmp.newFolder("out")
File(logs, "web.txt").writeText("GET /x?sessionid=abcdef123456 200\n")
File(logs, "big.txt").outputStream().use { it.write(ByteArray(8 * 1024 * 1024)) }
val copied = SessionArtifacts.copySessionLogs(logs, tmp.newFolder("session"), out)
assertEquals(listOf("web.txt"), names(copied))
assertFalse(File(out, "web.txt").readText().contains("abcdef123456"))
}
}
@@ -101,6 +101,28 @@ class SteamDownloadMonitorTest {
}
}
@Test fun aLongLogIsFollowedFromWhereTheLastPollStopped() {
val root = Files.createTempDirectory("droiddeck-steam-download-").toFile()
try {
val contentLog = File(root, "root/.local/share/Steam/logs/content_log.txt").apply {
check(parentFile?.mkdirs() != false)
writeText(buildString {
repeat(5_000) { append("[2026-10-06 14:40:00] Detected write gap 64 MB in file \"data_$it.dat\"\r\n") }
append("[2026-10-06 14:44:17] AppID 44 App update changed : Running Update,Downloading,\r\n")
})
}
val monitor = SteamDownloadMonitor()
assertTrue(monitor.poll(root, now = 1_000L))
contentLog.appendText("[2026-10-06 14:45:03] AppID 44 App update changed : None\r\n")
assertFalse(monitor.poll(root, now = 2_000L))
contentLog.appendText("[2026-10-06 14:46:00] AppID 45 App update changed : Running Update,Downloading,\r\n")
assertTrue(monitor.poll(root, now = 3_000L))
} finally {
root.deleteRecursively()
}
}
@Test fun theOtherClientsLogIsReadFromItsStart() {
val root = Files.createTempDirectory("droiddeck-steam-download-").toFile()
try {
@@ -203,6 +225,38 @@ class SteamDownloadMonitorTest {
}
}
@Test fun theClientIsPendingUntilItIsInstalledAndStamped() {
val root = Files.createTempDirectory("droiddeck-steam-client-").toFile()
try {
val steam = File(root, "root/.local/share/Steam")
assertTrue(SteamDownloadMonitor.clientInstallPending(root))
File(steam, "steamrtarm64").mkdirs()
File(steam, "steamrtarm64/steam").writeText("client")
assertTrue(SteamDownloadMonitor.clientInstallPending(root))
File(steam, "package").mkdirs()
File(steam, "package/droiddeck-installed").writeText("1791686101\n")
assertFalse(SteamDownloadMonitor.clientInstallPending(root))
} finally {
root.deleteRecursively()
}
}
@Test fun anOlderStampCountsAndARepairRequestIsPending() {
val root = Files.createTempDirectory("droiddeck-steam-client-").toFile()
try {
val steam = File(root, "root/.local/share/Steam")
File(steam, "steamrtarm64").mkdirs()
File(steam, "steamrtarm64/steam").writeText("client")
File(steam, "package").mkdirs()
File(steam, "package/bannerlator-installed").writeText("1\n")
assertFalse(SteamDownloadMonitor.clientInstallPending(root))
File(root, "root/.bl-steam-repair").writeText("1\n")
assertTrue(SteamDownloadMonitor.clientInstallPending(root))
} finally {
root.deleteRecursively()
}
}
private fun manifest(root: File, appId: String, downloaded: Long, total: Long, flags: Int): File {
val file = File(root, "steamapps/appmanifest_$appId.acf")
check(file.parentFile?.mkdirs() != false)
@@ -38,6 +38,43 @@ class StoreInstallRootTest {
assertEquals(1, StoreInstallRoot.targets(app).size)
}
@Test fun externalStoreInstallPathsMapIntoTheirGuestMountWithoutPrefixCollisions() {
val cardRoot = File(app.filesDir, "card/Games").apply { mkdirs() }
val guestRoot = "/mnt/droiddeck-stores/card"
val roots = listOf(cardRoot to guestRoot)
assertEquals("$guestRoot/Stores/Xbox/Doom", StoreInstallRoot.externalGuestPath(
File(cardRoot, "Stores/Xbox/Doom"), roots))
assertEquals(null, StoreInstallRoot.externalGuestPath(
File(cardRoot.parentFile, "Games-old/Stores/Xbox/Doom"), roots))
}
@Test fun xodusMapsTheSelectedSteamLibraryOnAnExternalVolume() {
val library = File(app.filesDir, "card/steam").apply { mkdirs() }
val storeRoot = File(library, "Games").apply { mkdirs() }
SessionPrefs.setGameStorage(app, library.path, "Card")
val xodusRoot = StoreInstallRoot.externalRootsForXodus(app).single { it.first.absolutePath == storeRoot.absolutePath }
val gameFolder = File(storeRoot, "Xbox/Doom")
assertEquals("${xodusRoot.second}/Xbox/Doom", StoreInstallRoot.guestPathForXodus(app, gameFolder))
val bindSpecs = StoreInstallRoot.externalBindSpecsForXodus(app)
assertTrue(bindSpecs.contains("${storeRoot.path}:${xodusRoot.second}"))
assertTrue(File(LinuxRuntime.rootDir(app), xodusRoot.second.removePrefix("/")).isDirectory)
}
@Test fun externalStoreBindsCreateGuestTargetsAndSkipUnavailableVolumes() {
val host = File(app.filesDir, "card/Games").apply { mkdirs() }
val guestRoot = "/mnt/droiddeck-stores/card"
val guestFs = File(app.filesDir, "linuxfs").apply { mkdirs() }
val missing = File(app.filesDir, "missing/Games")
assertEquals(listOf("${host.path}:$guestRoot"), StoreInstallRoot.externalBindSpecs(
listOf(host to guestRoot, missing to "/mnt/droiddeck-stores/missing"), guestFs))
assertTrue(File(guestFs, "mnt/droiddeck-stores/card").isDirectory)
assertFalse(File(guestFs, "mnt/droiddeck-stores/missing").exists())
}
@Test fun anExistingInstallWinsOverAFreshFolderUnderTheChosenRoot() {
SessionPrefs.setGameStorage(app, SessionPrefs.GAME_STORAGE_OFF, "")
val existing = File(StoreInstallRoot.storeDir(StoreInstallRoot.internalRoot(app), Store.GOG), "Old Name").apply { mkdirs() }
@@ -285,6 +285,28 @@ class EpicClientTest {
assertTrue(EpicClient.loopback("http://localhost:5/launcher/authorized?code=1"))
}
@Test fun theManifestLaunchCommandJoinsTheGameArguments() {
val store = com.droiddeck.launcher.stores.Store.EPIC
val epicArgs = listOf("-EpicPortal", "-epicapp=Fig", "-epicenv=Prod")
val installed = com.droiddeck.launcher.stores.StoreGameSidecar(store, "Fig", "Fig Game", exe = "Fig.exe", args = epicArgs)
val first = EpicClientLibrary.withLaunchArgs(installed, listOf("-PCStore=EGS"))
assertEquals(epicArgs + "-PCStore=EGS", first.args)
assertTrue(EpicClientLibrary.withLaunchArgs(first, listOf("-PCStore=EGS")) === first)
val updated = EpicClientLibrary.withLaunchArgs(first, listOf("-PCStore=EGS", "-log=a b.txt"))
assertEquals(epicArgs + listOf("-PCStore=EGS", "-log=a b.txt"), updated.args)
val dropped = EpicClientLibrary.withLaunchArgs(updated, emptyList())
assertEquals(epicArgs, dropped.args)
assertFalse(dropped.extra.containsKey("launchArgs"))
val reinstalled = first.copy(args = epicArgs)
assertEquals(epicArgs + "-PCStore=EGS", EpicClientLibrary.withLaunchArgs(reinstalled, listOf("-PCStore=EGS")).args)
assertTrue(EpicClientLibrary.withLaunchArgs(installed, emptyList()) === installed)
val own = installed.copy(args = epicArgs + "-PCStore=EGS")
assertTrue(EpicClientLibrary.withLaunchArgs(own, listOf("-PCStore=EGS")) === own)
val ownUpdated = EpicClientLibrary.withLaunchArgs(own, listOf("-PCStore=EGS", "-log=a b.txt"))
assertEquals(epicArgs + listOf("-PCStore=EGS", "-log=a b.txt"), ownUpdated.args)
assertEquals(epicArgs + "-PCStore=EGS", EpicClientLibrary.withLaunchArgs(ownUpdated, emptyList()).args)
}
@Test fun itemsDescribeTheInstallForTheLauncher() {
val install = EpicClientLibrary.Install(
"Fig", "ns1", "item1", "Fig Game", "1.0.5", "Binaries/Win64/Fig.exe", "/root/Games/Stores/Epic/Fig Game",
@@ -0,0 +1,83 @@
package com.droiddeck.launcher.stores.itch
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Test
class ItchBrowseTest {
private fun path(sort: String = ItchBrowse.SORT_POPULAR, price: String = ItchBrowse.PRICE_ANY, platforms: Set<String> = emptySet(), tags: List<String> = emptyList()) =
ItchBrowse.path(BrowseQuery(sort, price, platforms, tags))
@Test fun theDefaultQueryIsTheFrontPage() {
assertTrue(BrowseQuery().isDefault)
assertFalse(BrowseQuery(sort = ItchBrowse.SORT_NEWEST).isDefault)
assertFalse(BrowseQuery(price = ItchBrowse.PRICE_FREE).isDefault)
}
@Test fun sortsUseItchsOwnPaths() {
assertEquals("https://itch.io/games", path())
assertEquals("https://itch.io/games/new-and-popular", path(sort = ItchBrowse.SORT_NEW_POPULAR))
assertEquals("https://itch.io/games/top-sellers", path(sort = ItchBrowse.SORT_TOP_SELLERS))
assertEquals("https://itch.io/games/top-rated", path(sort = ItchBrowse.SORT_TOP_RATED))
assertEquals("https://itch.io/games/newest", path(sort = ItchBrowse.SORT_NEWEST))
}
@Test fun pricesUseItchsOwnPaths() {
assertEquals("https://itch.io/games/free", path(price = ItchBrowse.PRICE_FREE))
assertEquals("https://itch.io/games/on-sale", path(price = ItchBrowse.PRICE_SALE))
assertEquals("https://itch.io/games/store", path(price = ItchBrowse.PRICE_PAID))
assertEquals("https://itch.io/games/5-dollars-or-less", path(price = ItchBrowse.PRICE_UNDER_5))
assertEquals("https://itch.io/games/15-dollars-or-less", path(price = ItchBrowse.PRICE_UNDER_15))
}
@Test fun platformsUseItchsOwnNames() {
val expected = mapOf(
"windows" to "platform-windows", "osx" to "platform-osx", "linux" to "platform-linux", "android" to "platform-android",
"ios" to "platform-ios", "web" to "platform-web", "mobile-web" to "platform-mobile-web",
)
assertEquals(expected.keys.toList(), ItchBrowse.platformNames)
for ((name, segment) in expected) assertEquals("https://itch.io/games/$segment", path(platforms = setOf(name)))
}
@Test fun aSortAPriceAndAPlatformCombineInThatOrder() {
assertEquals(
"https://itch.io/games/top-rated/free/platform-windows",
path(ItchBrowse.SORT_TOP_RATED, ItchBrowse.PRICE_FREE, setOf("windows")),
)
}
@Test fun aTagIsItsLowercaseNameWithHyphens() {
assertEquals("https://itch.io/games/tag-pixel-art", path(tags = listOf("Pixel Art")))
assertEquals("pixel-art", ItchBrowse.tagSlug(" Pixel Art "))
}
@Test fun aSortAPricePlatformAndTagCombineInThatOrder() {
assertEquals(
"https://itch.io/games/top-rated/free/platform-windows/tag-pixel-art.xml",
ItchBrowse.url(BrowseQuery(ItchBrowse.SORT_TOP_RATED, ItchBrowse.PRICE_FREE, setOf("windows"), listOf("pixel-art")), 1),
)
}
@Test fun severalPlatformsAndTagsAreAllInTheAddress() {
assertEquals(
"https://itch.io/games/platform-windows/platform-linux/tag-pixel-art/tag-2d",
path(platforms = setOf("linux", "windows"), tags = listOf("pixel-art", "2d")),
)
}
@Test fun aTypedTagBecomesItsSlug() {
assertEquals("visual-novel", ItchBrowse.tagSlug("Visual Novel!"))
assertEquals("", ItchBrowse.tagSlug(" !! "))
}
@Test fun theSamePlatformsInAnyOrderGiveTheSameAddress() {
assertEquals(path(platforms = setOf("web", "linux")), path(platforms = setOf("linux", "web")))
}
@Test fun laterPagesAskForThePageNumberAndTheFirstDoesNot() {
val query = BrowseQuery(sort = ItchBrowse.SORT_TOP_RATED)
assertEquals("https://itch.io/games/top-rated.xml", ItchBrowse.url(query, 1))
assertEquals("https://itch.io/games/top-rated.xml?page=2", ItchBrowse.url(query, 2))
}
}
@@ -0,0 +1,19 @@
package com.droiddeck.launcher.stores.xbox
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Test
class XodusDiagnosticsTest {
private val rejected = Regex(Xodus.SIGN_IN_REJECTED)
@Test fun aContentLicenseRejectionIsRecognised() {
assertTrue("Microsoft content licensing rejected sign-in (HTTP 401). Sign in again in Settings.".matches(rejected))
}
@Test fun otherStderrTextIsNotTakenForARejection() {
assertFalse("Microsoft content licensing rejected sign-in (HTTP 401). Sign in again in Settings. token=abc".matches(rejected))
assertFalse("Microsoft content licensing rejected sign-in (HTTP 403). Sign in again in Settings.".matches(rejected))
assertFalse("NEXUS_CONTENT_LICENSE_DIAGNOSTIC_V1 content-http 401".matches(rejected))
}
}
Loaded 100 of 132 files, more files were not shown because too many files have changed in this diff. Show more