diff --git a/.coderabbit.yaml b/.coderabbit.yaml index ef66d13d74..c83ae0e95d 100644 --- a/.coderabbit.yaml +++ b/.coderabbit.yaml @@ -18,7 +18,7 @@ reviews: enabled: true auto_incremental_review: true auto_pause_after_reviewed_commits: 0 - drafts: false + drafts: true pre_merge_checks: docstrings: mode: "off" diff --git a/.gitattributes b/.gitattributes index 940dbb5f13..43e03c53ca 100644 --- a/.gitattributes +++ b/.gitattributes @@ -10,3 +10,6 @@ tools/mangoapp/mangoapp text eol=lf app/src/main/assets/desktop-removal/*.json text eol=lf app/src/main/assets/desktop-removal/*.txt text eol=lf *.pdf binary + +app/src/main/resources/ea/graphql/*.gql -text +app/src/main/assets/agent/* text eol=lf diff --git a/.github/trusted-test-builds.txt b/.github/trusted-test-builds.txt index 8f7b0148c5..fa4cff1104 100644 --- a/.github/trusted-test-builds.txt +++ b/.github/trusted-test-builds.txt @@ -1,5 +1,7 @@ ASEbrahim FX192 K11MCH1 +KeegantheVeganat0r kingokksa ovurrsl +KeegantheVeganat0r diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0d225b45c9..95d036381a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -127,6 +127,7 @@ jobs: name: xbox-arm64 path: app/src/main/assets/linuxfs/usr/local/lib/droiddeck-xbox retention-days: 14 + overwrite: true - uses: actions/upload-artifact@v4 with: name: xbox-corresponding-source @@ -135,6 +136,7 @@ jobs: app/build/xbox/runtime/*-source.tar.xz if-no-files-found: error retention-days: 14 + overwrite: true components-runner: needs: source @@ -195,6 +197,7 @@ jobs: !app/src/main/assets/linuxfs/i386/libfaultreport.so !app/src/main/assets/linuxfs/libblaudit.so !app/src/main/assets/linuxfs/libblfastpath.so + !app/src/main/assets/linuxfs/libddnatv-hook.so !app/src/main/assets/linuxfs/libblsession.so !app/src/main/assets/linuxfs/libfakeinput.so !app/src/main/assets/linuxfs/libssbs.so @@ -329,6 +332,7 @@ jobs: if-no-files-found: error compression-level: 0 retention-days: 14 + overwrite: true build-runner: needs: [components] @@ -555,6 +559,18 @@ jobs: SOURCE_TREE: ${{ needs.source.outputs.tree-sha }} run: python3 tools/components/prepare.py unpack --tree "$SOURCE_TREE" + - name: Ubisoft launcher service (x86_64-pc-windows-gnu) + run: | + set -euo pipefail + command -v x86_64-w64-mingw32-gcc >/dev/null || { sudo apt-get update -qq && sudo apt-get install -y -qq gcc-mingw-w64-x86-64; } + bash tools/ubisoft-launcher/build.sh + + - name: Rockstar launcher service (32-bit and 64-bit) + run: | + set -euo pipefail + command -v i686-w64-mingw32-gcc >/dev/null || { sudo apt-get update -qq && sudo apt-get install -y -qq gcc-mingw-w64-i686; } + bash tools/rockstar-launcher/build.sh + - uses: actions/download-artifact@v4 with: name: xbox-arm64 @@ -610,12 +626,11 @@ jobs: - name: Check out MaliBridge run: git submodule update --init external/MaliBridge - name: Fetch the Mali (Venus) component (tools/venus/release.env) - env: - GH_TOKEN: ${{ github.token }} run: | set -euo pipefail . tools/venus/release.env - gh release download "${VENUS_TAG}" -R "${VENUS_REPO}" -p venus.tzst -O venus.tzst + curl -fsSL --retry 5 --retry-all-errors --retry-delay 10 -o venus.tzst \ + "https://github.com/${VENUS_REPO}/releases/download/${VENUS_TAG}/venus.tzst" echo "${VENUS_SHA256} venus.tzst" | sha256sum -c - tar --use-compress-program=unzstd -xf venus.tzst -C app/src/main test -f app/src/main/jniLibs/arm64-v8a/libvirgl_test_server.so @@ -652,6 +667,7 @@ jobs: name: stores-cargo-lock path: app/src/main/rust/stores/Cargo.lock if-no-files-found: ignore + overwrite: true - name: Unit tests id: unit-tests @@ -675,6 +691,7 @@ jobs: app/build/reports/tests/testReleaseUnitTest/ if-no-files-found: ignore retention-days: 14 + overwrite: true - name: Sign with the testkey (v1 + v2 + v3) run: | @@ -712,6 +729,7 @@ jobs: if-no-files-found: error retention-days: 30 compression-level: 0 + overwrite: true - uses: actions/upload-artifact@v4 with: @@ -720,6 +738,7 @@ jobs: if-no-files-found: error retention-days: 30 compression-level: 0 + overwrite: true - name: Report on the pull request if: always() && github.event_name == 'pull_request' @@ -791,6 +810,11 @@ jobs: set -o pipefail cd app/src/main/rust/stores cargo test --locked 2>&1 | tail -60 + - name: Windows launcher service host unit tests + timeout-minutes: 10 + run: | + cargo test --locked --manifest-path tools/ubisoft-launcher/Cargo.toml + cargo test --locked --manifest-path tools/rockstar-launcher/Cargo.toml python-tests: name: Python and native regression tests @@ -891,6 +915,7 @@ jobs: uses: ./.github/workflows/scan.yml with: artifact: droiddeck-signed + variant: standard secrets: inherit packs: @@ -912,7 +937,7 @@ jobs: pull-requests: read env: CI_REPO: Droid-Deck/DroidDeck-CI - KEEP: 10 + KEEP_DAYS: 14 steps: - uses: actions/checkout@v4 with: diff --git a/.github/workflows/pr-rebuild-on-version.yml b/.github/workflows/pr-rebuild-on-version.yml new file mode 100644 index 0000000000..95abedf99f --- /dev/null +++ b/.github/workflows/pr-rebuild-on-version.yml @@ -0,0 +1,141 @@ +name: PR Rebuild On Version Bump +run-name: rebuild test builds below versionCode on main + +on: + push: + branches: [main] + paths: [app/build.gradle] + workflow_dispatch: + +permissions: + actions: write + contents: read + issues: write + pull-requests: read + +concurrency: + group: pr-rebuild-on-version + cancel-in-progress: false + queue: max + +jobs: + rebuild: + runs-on: ubuntu-24.04 + timeout-minutes: 180 + steps: + - uses: actions/checkout@v4 + with: + ref: main + fetch-depth: 2 + persist-credentials: false + - name: Rebuild open PRs whose test build Android would refuse over main + env: + GH_TOKEN: ${{ github.token }} + EVENT_NAME: ${{ github.event_name }} + BEFORE: ${{ github.event.before }} + PUSHED_AT: ${{ github.event.repository.pushed_at }} + run: | + set -euo pipefail + code() { sed -n 's/^[[:space:]]*versionCode[[:space:]][[:space:]]*\([0-9][0-9]*\)[[:space:]]*$/\1/p'; } + now=$(code < app/build.gradle) + [[ "$now" =~ ^[0-9]+$ ]] || { echo "::error::No numeric versionCode on main"; exit 1; } + if [ "$EVENT_NAME" = push ]; then + was=$(git show "$BEFORE:app/build.gradle" 2>/dev/null | code || true) + if [[ "$was" =~ ^[0-9]+$ ]] && [ "$was" -ge "$now" ]; then + echo "versionCode stayed at $now" + exit 0 + fi + fi + # This run is created right after the push, so a PR build that started earlier may have pinned the old main. + bumped=$(gh api "repos/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" --jq .created_at) + # A build can finish between the push and this run's creation; the push event carries the push time. + if [[ "${PUSHED_AT:-}" =~ ^[0-9]+$ ]]; then + pushed=$(date -u -d "@$PUSHED_AT" +%Y-%m-%dT%H:%M:%SZ) + [[ "$pushed" < "$bumped" ]] && bumped=$pushed + else + pushed=$(date -u -d "$bumped - 10 minutes" +%Y-%m-%dT%H:%M:%SZ) + fi + note() { + local number=$1 + local marker="" + gh api "repos/$GITHUB_REPOSITORY/issues/$number/comments?per_page=100" --jq '.[].body' | grep -qF "$marker" && return 0 + gh api -X POST "repos/$GITHUB_REPOSITORY/issues/$number/comments" -f body="$marker + Main is now at versionCode $now, so this PR's test build no longer installs over current DroidDeck, and its last build is too old for GitHub to re-run. Push a commit or merge main to get a new test build." >/dev/null + } + latest() { + gh api "repos/$GITHUB_REPOSITORY/actions/workflows/build.yml/runs?event=pull_request&head_sha=$1&per_page=20" \ + --jq '[.workflow_runs[] | select(.head_sha == "'"$1"'")] | sort_by(.created_at) | last // empty | [.id, .status, (.run_started_at // .created_at), .created_at, .updated_at] | @tsv' + } + consider() { + local number=$1 head=$2 built=$3 id status started created updated + IFS=$'\t' read -r id status started created updated <<<"$4" + if [[ "$started" > "$bumped" ]]; then + echo "PR #$number: build $id started after the bump" + elif ! gh api "repos/$GITHUB_REPOSITORY/pulls/$number" | + jq -e --arg head "$head" '.state == "open" and .draft == false and .base.ref == "main" and .head.sha == $head' >/dev/null; then + echo "PR #$number: moved on since the scan, its own build covers it" + elif gh run rerun "$id" -R "$GITHUB_REPOSITORY"; then + echo "PR #$number: rebuilding ${head:0:7} on main (versionCode $built -> $now)" + else + echo "::warning::PR #$number: could not rerun build $id" + # GitHub only re-runs a workflow within 30 days of its first run. + if [[ "$created" < "$(date -u -d '-30 days' +%Y-%m-%dT%H:%M:%SZ)" ]]; then + note "$number" || echo "::warning::PR #$number: could not leave a note" + fi + fi + } + pending=() + declare -A seen=() + candidates() { + gh api --paginate "repos/Droid-Deck/DroidDeck-CI/releases?per_page=100" \ + --jq '.[] | select(.tag_name | test("^pr-[0-9]+$")) | [(.tag_name | ltrimstr("pr-")), ((.body // "") | capture("(?m)^VersionCode: (?[0-9]+)").v // "0")] | @tsv' + # The latest build of every open PR: one that started before the bump and was still running at it + # may have pinned the old main. This also covers a PR's first build and fork builds. + gh api --paginate -X GET "repos/$GITHUB_REPOSITORY/pulls" -f state=open -f base=main -f per_page=100 \ + --jq '.[] | select(.draft | not) | [(.number | tostring), .head.sha] | @tsv' | + while IFS=$'\t' read -r number sha; do + run=$(latest "$sha") + [ -n "$run" ] || continue + IFS=$'\t' read -r _ status started _ updated <<<"$run" + if [[ "$started" < "$bumped" ]] && { [ "$status" != completed ] || [[ ! "$updated" < "$pushed" ]]; }; then + printf '%s\t?\n' "$number" + fi + done + } + found=$(mktemp) + candidates > "$found" + while IFS=$'\t' read -r number built; do + [ "$built" = "?" ] || [ "$built" -lt "$now" ] || continue + [ -z "${seen[$number]:-}" ] || continue + seen[$number]=1 + pr=$(gh api "repos/$GITHUB_REPOSITORY/pulls/$number") || continue + jq -e '.state == "open" and .draft == false and .base.ref == "main"' <<<"$pr" >/dev/null || continue + head=$(jq -r .head.sha <<<"$pr") + run=$(latest "$head") + if [ -z "$run" ]; then + echo "PR #$number: no build of ${head:0:7} to rerun" + elif [ "$(cut -f2 <<<"$run")" = completed ]; then + consider "$number" "$head" "$built" "$run" + else + pending+=("$number $head $built") + fi + done < "$found" + # Builds still running are polled together so one slow build cannot hold up the rest. + deadline=$((SECONDS + 150 * 60)) + while [ ${#pending[@]} -gt 0 ] && [ "$SECONDS" -lt "$deadline" ]; do + sleep 60 + left=() + for item in "${pending[@]}"; do + read -r number head built <<<"$item" + run=$(latest "$head") + if [ -n "$run" ] && [ "$(cut -f2 <<<"$run")" = completed ]; then + consider "$number" "$head" "$built" "$run" + else + left+=("$item") + fi + done + pending=(${left[@]+"${left[@]}"}) + done + for item in ${pending[@]+"${pending[@]}"}; do + echo "::warning::PR #${item%% *}: its build did not finish in time" + done diff --git a/.github/workflows/pr-release-sweep.yml b/.github/workflows/pr-release-sweep.yml index 6ea1874e27..f65777ba6d 100644 --- a/.github/workflows/pr-release-sweep.yml +++ b/.github/workflows/pr-release-sweep.yml @@ -55,3 +55,9 @@ jobs: fi done exit "$failed" + + catalog: + needs: sweep + if: ${{ always() }} + uses: ./.github/workflows/update-catalog.yml + secrets: inherit diff --git a/.github/workflows/publish-packs.yml b/.github/workflows/publish-packs.yml index ca61616d18..53e26f4ed8 100644 --- a/.github/workflows/publish-packs.yml +++ b/.github/workflows/publish-packs.yml @@ -55,7 +55,7 @@ jobs: jq -r --arg n "$2" '.assets // [] | .[] | select(.name == $n) | .digest // empty' } commit=$(gh api "repos/$GITHUB_REPOSITORY/actions/runs/$BUILD_RUN" --jq .head_sha 2>/dev/null || echo "$GITHUB_SHA") - for name in proot directaudio tracking xbox comet butler powervr; do + for name in proot directaudio tracking xbox comet butler powervr ubisoft; do file="packs/$name.tar.zst" [ -f "$file" ] || { echo "::error::$name.tar.zst is missing from Build APK run $BUILD_RUN"; exit 1; } sha=$(sha256sum "$file" | cut -d' ' -f1) diff --git a/.github/workflows/scan.yml b/.github/workflows/scan.yml index 408983955b..9790f40c7b 100644 --- a/.github/workflows/scan.yml +++ b/.github/workflows/scan.yml @@ -7,6 +7,10 @@ on: description: Prefix of the signed artifacts to scan, as passed to sign.yml type: string required: true + variant: + description: Variant to scan, as listed in tools/release/variants.txt; every variant when omitted + type: string + default: '*' fail_on_detection: type: boolean default: false @@ -27,7 +31,7 @@ jobs: - uses: actions/download-artifact@v4 with: - pattern: ${{ inputs.artifact }}-* + pattern: ${{ inputs.artifact }}-${{ inputs.variant }} merge-multiple: true path: scan diff --git a/.gitignore b/.gitignore index 0a404ef667..d0fe3ea9ea 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,4 @@ __pycache__/ app/src/main/assets/directaudio/ app/src/main/assets/hybris/ /tools/vr/out/ +app/src/main/resources/rockstar/helpers/ diff --git a/AGENTS.md b/AGENTS.md index c22c5647c0..447807615b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,3 +1,13 @@ # Rules - Comments should be rare, factual, and explain only non-obvious external constraints or business invariants. + +# Working on the device + +- `dd-lab-build` builds only committed work. Check `git status` and `gh api user` for the identity before committing; if `git config user.name` is empty, use the `gh` login's name and noreply email for this repo, never a guess. +- Do not commit or start a build in the same step: a build started next to a failed commit fails too. Commit first, check it, then build. +- Uncommitted changes in the tree may not be yours. Read `git diff` before committing them and tell the user what they do. +- If `dd-lab-build` says "could not read DroidDeck's state", loopback adb is down and `$ADB_SERIAL` is stale. Run `adb devices`; the port changes whenever wireless debugging is toggled. Ask the user to turn it on rather than retrying. +- A build that "did not start" can be adb, not the app. Read `~/.cache/dd-lab-build.json` and `.log` for the real reason; they can be stale from an earlier build, so compare their times with `date`. +- Run `dd-lab-build` with `run_in_background` and read its output file. A foreground `sleep` is blocked; wait with Monitor and an until-loop. +- The build restarts DroidDeck and ends your process. A turn that ends this way is not a failure. diff --git a/README.md b/README.md index f7ec639de3..84b6bbcd79 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ DroidDeck brings the SteamOS experience to Android: Steam Gaming Mode, full Linu

On a Retroid Pocket Duo: Play Steam from the DroidDeck launcher, open Pac-Man in Steam Big Picture and play it, exit the game, then Switch to Desktop from the Power menu

-> DroidDeck has no website. Only download it from this repository's [Releases](https://github.com/Droid-Deck/DroidDeck/releases). +> The official website is [droid-deck.dev](https://droid-deck.dev). Only download DroidDeck from this repository's [Releases](https://github.com/Droid-Deck/DroidDeck/releases).

The Library switching source chips, changing the card size and opening the Filter menu @@ -92,7 +92,9 @@ DroidDeck is [GPL-3.0](LICENSE). Steam and Proton belong to Valve Corporation. V - Epic Games and GOG build on [Phobos](https://github.com/phobos665)'s adaptation of [Legendary](https://github.com/legendary-gl/legendary) and [gogdl](https://github.com/Heroic-Games-Launcher/heroic-gogdl). GOG install script registry entries are read the way [Heroic Games Launcher](https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher) (GPL-3.0) reads them. - Epic's official Linux launcher preview runs through FEX. That setup is outside Epic's listed Linux support. +- The launcher's .deb gets the WebKitGTK and GTK 3 libraries it needs from unmodified [Debian](https://www.debian.org) 13 packages, following [@zooluis](https://github.com/zooluis)'s research in [#2268](https://github.com/Droid-Deck/DroidDeck/pull/2268). - Battle.net is by [@kayakyakr](https://github.com/kayakyakr). It runs Blizzard's own client in Proton (downloaded from Blizzard, not included) and shows key art from the [Battle.net Shop](https://shop.battle.net). Without Steam, its games see the pad as an Xbox 360 controller via `PROTON_SPOOF_STEAMINPUT_VIDPID` in [Proton](https://github.com/ValveSoftware/wine)'s `dlls/winebus.sys`. +- The EA store follows the EA app's protocols as documented by [ArmchairDevelopers](https://github.com/ArmchairDevelopers)' [Maxima](https://github.com/ArmchairDevelopers/Maxima) (GPL-3.0): sign-in, the GraphQL queries (included verbatim, since EA matches them by hash), build archives, online activation licences and the LSX game endpoint. The code is DroidDeck's own. - Battle.net installs drive Blizzard's Agent the way [@barncastle](https://github.com/barncastle)'s [Battle.Net-Installer](https://github.com/barncastle/Battle.Net-Installer) does, with requests from [wowdev.wiki](https://wowdev.wiki/Agent). Read without taking code: [@mubaraknumann](https://github.com/mubaraknumann)'s [unifideck](https://github.com/mubaraknumann/unifideck), [@djmittens](https://github.com/djmittens)'s [neo-mittens](https://github.com/djmittens/neo-mittens) `bnetswitch`, [@BCD1210](https://github.com/BCD1210)'s [soju](https://github.com/BCD1210/soju) and [Lutris](https://github.com/lutris/lutris)'s `product.db` reader. - World of Warcraft addon imports replace an addon's folder from a temporary copy, as [WowUp](https://github.com/WowUp/WowUp) does, and read flavour folders the way [WoWDeck](https://github.com/sigboe/wowdeck) does. No code from either is used. - The World of Warcraft addon Download window searches [WoWInterface](https://www.wowinterface.com) through its MMOUI API. [CurseForge](https://www.curseforge.com/wow) opens in the user's browser, with no API and no key. diff --git a/app/build.gradle b/app/build.gradle index c87e70938f..7f992a5f42 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -93,7 +93,7 @@ def trackingPack = rootProject.file('tools/packs/tracking/release.env').readLine def prootPackPin = rootProject.file('tools/packs/proot/release.env').readLines() .findAll { it.contains('=') && !it.startsWith('#') } .collectEntries { def kv = it.split('=', 2); [(kv[0].trim()): kv[1].trim()] } -def addonPacks = ['proot', 'directaudio', 'tracking', 'xbox', 'comet', 'butler', 'powervr'].collectEntries { name -> +def addonPacks = ['proot', 'directaudio', 'tracking', 'xbox', 'comet', 'butler', 'powervr', 'ubisoft'].collectEntries { name -> def pack = file("build/packs/${name}.tar.zst") if (!pack.isFile()) { if (ciBuild) throw new GradleException("Add-on pack ${pack} is missing: run tools/packs/build.sh app/build/packs") @@ -141,6 +141,7 @@ android { buildConfigField "boolean", "CI_BUILD", "${ciBuild}" buildConfigField "String", "RELEASE_SIGNER", "\"${releaseSigner}\"" buildConfigField "long", "COMMIT_TIME", "${commitTime}L * 1000L" + buildConfigField "String", "UPDATE_CATALOG_BRANCH", "\"${(System.getenv("DROIDDECK_UPDATE_CATALOG_BRANCH") ?: "main").with { it ==~ /[A-Za-z0-9._-]+/ ? it : "main" }}\"" buildConfigField "String", "VARIANT_SUFFIXES", "\"${variantSuffixes}\"" buildConfigField "String", "SGDB_API_KEY", "\"${System.getenv("SGDB_API_KEY") ?: project.findProperty("sgdbApiKey") ?: ""}\"" buildConfigField "String", "DESKTOP_KDE_TAG", "\"${desktopKde.DESKTOP_KDE_TAG}\"" @@ -205,7 +206,7 @@ android { } androidResources { - ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:.*:

_*:!CVS:!thumbs.db:!picasa.ini:!*~:droiddeck-xbox:droiddeck-comet:directaudio:hybris' + ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:.*:_*:!CVS:!thumbs.db:!picasa.ini:!*~:droiddeck-xbox:droiddeck-comet:droiddeck-ubisoft:directaudio:hybris' } packagingOptions { @@ -277,6 +278,8 @@ def stageRuntimeAssets = tasks.register('stageRuntimeAssets', Sync) { dependsOn(stageSessionScripts) from(layout.projectDirectory.dir('src/main/assets')) { exclude 'pulseaudio.tzst' } from(rootProject.file('tools/linuxfs/innoextract')) + from(rootProject.file('tools')) { include 'droiddeckctl', 'adb_device.py', 'proot_profile.py'; into('agent/ctl') } + from(rootProject.file('docs/agent-control.md')) { into('agent/ctl') } from(layout.buildDirectory.dir('prepared-assets')) into(runtimeAssetsDir) } @@ -380,6 +383,11 @@ dependencies { implementation 'androidx.activity:activity-compose:1.8.2' implementation 'androidx.compose.material:material-icons-extended' implementation 'io.coil-kt:coil-compose:2.6.0' + implementation 'io.noties.markwon:core:4.6.2' + implementation 'io.noties.markwon:ext-strikethrough:4.6.2' + implementation 'io.noties.markwon:ext-tables:4.6.2' + implementation 'io.noties.markwon:ext-tasklist:4.6.2' + implementation 'com.atlassian.commonmark:commonmark-ext-autolink:0.13.0' implementation 'com.caverock:androidsvg-aar:1.4' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3' implementation 'com.flyfishxu:kadb-android:1.2.1' @@ -387,11 +395,14 @@ dependencies { implementation 'androidx.camera:camera-camera2:1.4.2' implementation 'androidx.camera:camera-lifecycle:1.4.2' implementation 'androidx.webkit:webkit:1.12.1' + implementation 'androidx.palette:palette:1.0.0' implementation 'io.github.webrtc-sdk:android:125.6422.07' implementation("com.google.mediapipe:tasks-vision:${trackingPack.MEDIAPIPE_VERSION}") { exclude group: 'com.google.auto.value', module: 'auto-value' } implementation 'com.google.zxing:core:3.5.3' + implementation 'androidx.media3:media3-exoplayer:1.3.1' + implementation 'androidx.media3:media3-session:1.3.1' testImplementation 'junit:junit:4.13.2' testImplementation 'org.robolectric:robolectric:4.16.1' diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index d5bb0dc0d0..172da8d450 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -18,8 +18,15 @@ + + + + + + + @@ -111,6 +118,17 @@ + + + @@ -258,6 +277,7 @@ android:exported="true" android:excludeFromRecents="true" android:noHistory="true" + android:taskAffinity="${applicationId}.agent" android:permission="android.permission.DUMP" android:theme="@style/SessionTheme" /> @@ -302,6 +322,11 @@ android:configChanges="orientation|screenSize|screenLayout|smallestScreenSize|keyboard|keyboardHidden|navigation|uiMode|density" android:theme="@style/SessionTheme" /> + + + + + + + /dev/null +if [ -d "$inbox" ] && printf '%s\n' "$url" > "$inbox/open-url.part" && mv -f "$inbox/open-url.part" "$inbox/open-url"; then + i=0 + while [ $i -lt 30 ] && [ -e "$inbox/open-url" ]; do + sleep 0.2 + i=$((i + 1)) + done + if [ -e "$inbox/open-url" ]; then + rm -f "$inbox/open-url" + elif [ -e "$inbox/open-url.failed" ]; then + rm -f "$inbox/open-url.failed" + else + sleep 0.3 + [ -e "$inbox/open-url.failed" ] && rm -f "$inbox/open-url.failed" || exit 0 + fi +fi +serial=${ADB_SERIAL:-127.0.0.1:5555} +adb connect "$serial" >/dev/null 2>&1 +quoted=$(printf "%s" "$url" | sed "s/'/'\\\\''/g") +adb -s "$serial" shell "am start --display ${DD_BROWSER_DISPLAY:-0} -a android.intent.action.VIEW -d '$quoted'" >/dev/null 2>&1 || + echo "Open this on any device: $url" >&2 diff --git a/app/src/main/assets/agent/dd-gh-login b/app/src/main/assets/agent/dd-gh-login new file mode 100644 index 0000000000..f9b0b7734a --- /dev/null +++ b/app/src/main/assets/agent/dd-gh-login @@ -0,0 +1,52 @@ +#!/bin/bash +# Starts GitHub's device login, floats its code over Android's browser and opens the approval page. +url=https://github.com/login/device +inbox=${DD_AGENT_INBOX:-} + +# DroidDeck takes $inbox/device-code within a few seconds when it can float the code. +float_code() { + [ -n "$inbox" ] && [ -d "$inbox" ] || return 1 + rm -f "$inbox/device-code.result" + printf '%s %s\n' "$1" "$url" > "$inbox/device-code.part" && mv -f "$inbox/device-code.part" "$inbox/device-code" || return 1 + i=0 + while [ $i -lt 40 ] && [ -e "$inbox/device-code" ]; do + sleep 0.2 + i=$((i + 1)) + done + if [ -e "$inbox/device-code" ]; then + rm -f "$inbox/device-code" + return 1 + fi + # DroidDeck writes "ok" or "failed" once it has tried to open the page; no answer counts as failed. + i=0 + while [ $i -lt 50 ] && [ ! -e "$inbox/device-code.result" ]; do + sleep 0.2 + i=$((i + 1)) + done + result=$(cat "$inbox/device-code.result" 2>/dev/null) + rm -f "$inbox/device-code.result" + [ "$result" = ok ] +} + +coproc GH { BROWSER=true gh auth login --hostname github.com --git-protocol https --web 2>&1; } +gh_pid=$GH_PID +exec {ghout}<&"${GH[0]}" {ghin}>&"${GH[1]}" +shown= +while IFS= read -r line <&"$ghout"; do + code=$(grep -oE '[A-Z0-9]{4}-[A-Z0-9]{4}' <<<"$line" | head -1) + # gh's own prompts would push the code out of the one line the setup card shows. + case "$line" in + *"one-time code"* | *"Press Enter"* | *"Open this URL"*) ;; + *) printf '%s\n' "$line" ;; + esac + if [ -n "$code" ] && [ -z "$shown" ]; then + shown=1 + echo >&"$ghin" + printf 'GitHub device code: %s ยท github.com/login/device\n' "$code" + float_code "$code" || android-open "$url" + fi +done +wait "$gh_pid" +status=$? +[ -n "$shown" ] && [ -n "$inbox" ] && [ -d "$inbox" ] && : > "$inbox/device-code" +exit $status diff --git a/app/src/main/assets/agent/droiddeckctl b/app/src/main/assets/agent/droiddeckctl new file mode 100755 index 0000000000..a72cb2587c --- /dev/null +++ b/app/src/main/assets/agent/droiddeckctl @@ -0,0 +1,2 @@ +#!/bin/sh +exec python3 /root/.local/share/droiddeck/ctl/droiddeckctl "$@" diff --git a/app/src/main/assets/steam-startup/skip-startup.webm b/app/src/main/assets/steam-startup/skip-startup.webm new file mode 100644 index 0000000000..3853967ad7 Binary files /dev/null and b/app/src/main/assets/steam-startup/skip-startup.webm differ diff --git a/app/src/main/cpp/fakeinput_steam.cpp b/app/src/main/cpp/fakeinput_steam.cpp index 498461992f..8941abda20 100644 --- a/app/src/main/cpp/fakeinput_steam.cpp +++ b/app/src/main/cpp/fakeinput_steam.cpp @@ -2322,7 +2322,15 @@ __attribute__((visibility("hidden"))) static bool is_deck_sysfs_path(const char if (!path) return false; if (!strncmp(path, "/sys/devices/droiddeck", 22) || !strncmp(path, "/sys/class/hidraw", 17)) return true; const char *listing = deck_listing_dir(); - return listing && !strncmp(path, listing, strlen(listing)); + if (!listing) return false; + if (!strncmp(path, listing, strlen(listing))) return true; + // Without proot, a descriptor's /proc/self/fd link names the stand-in where it really is (the + // listing's parent holds devices/ and class-hidraw/), not /sys + const char *slash = strrchr(listing, '/'); + if (!slash || slash == listing) return false; + size_t root = static_cast(slash - listing); + return !strncmp(path, listing, root) && path[root] == '/' && + (!strncmp(path + root, "/devices", 8) || !strncmp(path + root, "/class-hidraw", 13)); } __attribute__((visibility("hidden"))) static bool is_deck_sysfs_fd(int fd) { diff --git a/app/src/main/cpp/waylandcomp/CMakeLists.txt b/app/src/main/cpp/waylandcomp/CMakeLists.txt index 61baf0d379..c7aa1b0eb4 100644 --- a/app/src/main/cpp/waylandcomp/CMakeLists.txt +++ b/app/src/main/cpp/waylandcomp/CMakeLists.txt @@ -1,5 +1,6 @@ add_library(droiddeckwayland SHARED src/compositor.c + src/clock_domain.c src/vk_present.c src/effects_chain.c src/cardboard.c diff --git a/app/src/main/cpp/waylandcomp/src/clock_domain.c b/app/src/main/cpp/waylandcomp/src/clock_domain.c new file mode 100644 index 0000000000..30fd73a4eb --- /dev/null +++ b/app/src/main/cpp/waylandcomp/src/clock_domain.c @@ -0,0 +1,72 @@ +#define _GNU_SOURCE +#include "clock_domain.h" + +#include +#include +#include +#include +#include +#include +#include + +static const int64_t *g_shift; +static pthread_mutex_t g_control_lock = PTHREAD_MUTEX_INITIALIZER; +static dev_t g_device; +static ino_t g_inode; + +void droiddeck_clock_domain_set_control(const char *path) { + int fd; + struct stat st; + pthread_mutex_lock(&g_control_lock); + if (!path || !*path) { + const int64_t *previous = g_shift; + g_shift = NULL; + if (previous) munmap((void *)previous, sizeof(*previous)); + pthread_mutex_unlock(&g_control_lock); + return; + } + fd = open(path, O_RDONLY | O_CLOEXEC); + if (fd < 0 || fstat(fd, &st) != 0 || st.st_size < (off_t)sizeof(int64_t)) { + if (fd >= 0) close(fd); + pthread_mutex_unlock(&g_control_lock); + return; + } + if (g_shift && st.st_dev == g_device && st.st_ino == g_inode) { + close(fd); + pthread_mutex_unlock(&g_control_lock); + return; + } + const int64_t *shift = mmap(NULL, sizeof(*shift), PROT_READ, MAP_SHARED, fd, 0); + close(fd); + if (shift != MAP_FAILED) { + g_device = st.st_dev; + g_inode = st.st_ino; + const int64_t *previous = g_shift; + g_shift = shift; + if (previous) munmap((void *)previous, sizeof(*previous)); + } + pthread_mutex_unlock(&g_control_lock); +} + +static int64_t shift_ns(void) { + pthread_mutex_lock(&g_control_lock); + const int64_t *mapping = g_shift; + int64_t shift = mapping ? __atomic_load_n(mapping, __ATOMIC_RELAXED) : 0; + pthread_mutex_unlock(&g_control_lock); + return shift > 0 ? shift : 0; +} + +int64_t droiddeck_clock_domain_adjust_ns(int64_t value) { + int64_t shift = shift_ns(); + return value > shift ? value - shift : 0; +} + +int64_t droiddeck_clock_domain_now_ns(void) { + struct timespec ts; + clock_gettime(CLOCK_MONOTONIC, &ts); + return droiddeck_clock_domain_adjust_ns((int64_t)ts.tv_sec * 1000000000LL + ts.tv_nsec); +} + +uint32_t droiddeck_clock_domain_now_ms(void) { + return (uint32_t)(droiddeck_clock_domain_now_ns() / 1000000LL); +} diff --git a/app/src/main/cpp/waylandcomp/src/clock_domain.h b/app/src/main/cpp/waylandcomp/src/clock_domain.h new file mode 100644 index 0000000000..acb7e0e174 --- /dev/null +++ b/app/src/main/cpp/waylandcomp/src/clock_domain.h @@ -0,0 +1,11 @@ +#ifndef DROIDDECK_CLOCK_DOMAIN_H +#define DROIDDECK_CLOCK_DOMAIN_H + +#include + +void droiddeck_clock_domain_set_control(const char *path); +int64_t droiddeck_clock_domain_now_ns(void); +uint32_t droiddeck_clock_domain_now_ms(void); +int64_t droiddeck_clock_domain_adjust_ns(int64_t value); + +#endif diff --git a/app/src/main/cpp/waylandcomp/src/compositor.c b/app/src/main/cpp/waylandcomp/src/compositor.c index 21ef1d23f9..3510ea29a3 100644 --- a/app/src/main/cpp/waylandcomp/src/compositor.c +++ b/app/src/main/cpp/waylandcomp/src/compositor.c @@ -36,6 +36,7 @@ #include "droiddeck_ext.h" #include "droiddeck_color.h" #include "compositor_internal.h" +#include "clock_domain.h" #define WLOGI(...) __android_log_print(ANDROID_LOG_INFO, "DroidDeckWayland", __VA_ARGS__) #define WLOGE(...) __android_log_print(ANDROID_LOG_ERROR, "DroidDeckWayland", __VA_ARGS__) @@ -727,9 +728,7 @@ static void on_pending_buffer_destroyed(struct wl_listener *l, void *data) { static void fire_frames(struct wl_list *frames) { struct wl_resource *cb, *tmp; uint32_t t; - struct timespec ts; - clock_gettime(CLOCK_MONOTONIC, &ts); - t = (uint32_t)(ts.tv_sec * 1000 + ts.tv_nsec / 1000000); + t = droiddeck_clock_domain_now_ms(); wl_resource_for_each_safe(cb, tmp, frames) { wl_callback_send_done(cb, t); wl_resource_destroy(cb); @@ -1061,6 +1060,7 @@ static int64_t presented_ns(int64_t render_ns) { static void feedback_present_all(struct wl_list *list, int64_t t) { struct wl_resource *fb, *tmp; + t = droiddeck_clock_domain_adjust_ns(t); uint64_t sec = (uint64_t)(t / 1000000000LL); uint32_t nsec = (uint32_t)(t % 1000000000LL); wl_resource_for_each_safe(fb, tmp, list) { @@ -2493,8 +2493,7 @@ static void on_vsync(int64_t frame_time_ns) { static uint32_t now_ms(void) { - struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts); - return (uint32_t)(ts.tv_sec * 1000 + ts.tv_nsec / 1000000); + return droiddeck_clock_domain_now_ms(); } static void pointer_set_cursor(struct wl_client *c, struct wl_resource *r, uint32_t serial, @@ -3114,12 +3113,10 @@ static void relative_pointers_pointer_gone(struct wl_resource *pointer) { static int send_relative_motion(struct wl_client *client, double dx, double dy) { struct relative_pointer *rp; - struct timespec ts; uint64_t ut; int sent = 0; if (dx == 0 && dy == 0) return 0; - clock_gettime(CLOCK_MONOTONIC, &ts); - ut = (uint64_t)ts.tv_sec * 1000000ULL + (uint64_t)ts.tv_nsec / 1000; + ut = (uint64_t)(droiddeck_clock_domain_now_ns() / 1000); wl_list_for_each(rp, &g_relative_pointers, link) { if (!rp->pointer || wl_resource_get_client(rp->pointer) != client) continue; zwp_relative_pointer_v1_send_relative_motion(rp->resource, (uint32_t)(ut >> 32), (uint32_t)ut, diff --git a/app/src/main/cpp/waylandcomp/src/framegen_bridge.c b/app/src/main/cpp/waylandcomp/src/framegen_bridge.c index eceb796398..d29b328a05 100644 --- a/app/src/main/cpp/waylandcomp/src/framegen_bridge.c +++ b/app/src/main/cpp/waylandcomp/src/framegen_bridge.c @@ -33,7 +33,9 @@ static PFN_vkGetInstanceProcAddr g_gipa; static VkPhysicalDevice g_pd; static VkQueue g_queue; static uint32_t g_qfam; -static int g_dev_ready, g_dev_lost, g_features_enabled; +static _Atomic int g_dev_ready, g_dev_lost; +static int g_features_enabled; +static _Atomic int g_caps_lsfg_ok, g_caps_ddfg_ok; static VkPhysicalDeviceMemoryProperties g_memprops; static struct { PFN_vkCreateImage CreateImage; @@ -141,9 +143,12 @@ static void mark_failed(int kind) { } int vkp_framegen_problem(void) { - if (!g_dev_ready) return -1; + if (!atomic_load(&g_dev_ready)) return -1; int kind = atomic_load(&g_kind); - if (!fge_caps_ok(kind)) return 1; + int caps_ok = kind == VKP_FG_ENGINE_DDFG + ? atomic_load(&g_caps_ddfg_ok) + : atomic_load(&g_caps_lsfg_ok); + if (!caps_ok) return 1; if (start_failed_for(kind)) return 2; if (g_engine_ok && g_engine_kind == kind && fge_unavailable()) return 2; return 0; @@ -179,13 +184,17 @@ void vkp_framegen_device_ready(VkDevice dev, VkQueue queue, uint32_t qfam, int f #undef R g_vk.GetPhysicalDeviceMemoryProperties(g_pd, &g_memprops); fge_device_ready(g_gipa, g_inst, g_pd, dev, queue, qfam, features_enabled); - g_dev_ready = vk.CreateImage && vk.CreateImageView && vk.CmdPipelineBarrier; + atomic_store(&g_caps_lsfg_ok, fge_caps_ok(VKP_FG_ENGINE_LSFG)); + atomic_store(&g_caps_ddfg_ok, fge_caps_ok(VKP_FG_ENGINE_DDFG)); + atomic_store(&g_dev_lost, 0); + atomic_store(&g_dev_ready, + vk.CreateImage && vk.CreateImageView && vk.CmdPipelineBarrier); FGLOG("engines ready on the compositor's device: LSFG Native %s (%s), DD-FG Native %s", fge_caps_ok(VKP_FG_ENGINE_LSFG) ? "available" : "unavailable", fge_caps_reason(), fge_caps_ok(VKP_FG_ENGINE_DDFG) ? "available" : "unavailable"); } -void vkp_framegen_device_lost(void) { g_dev_lost = 1; } +void vkp_framegen_device_lost(void) { atomic_store(&g_dev_lost, 1); } static void destroy_ring(void) { @@ -244,7 +253,12 @@ static int ensure_ring(uint32_t w, uint32_t h, VkFormat fmt, uint32_t n) { static int engine_usable(void) { int kind = atomic_load(&g_kind); - return g_dev_ready && !g_dev_lost && fge_caps_ok(kind) && !start_failed_for(kind); + int ready = atomic_load(&g_dev_ready); + int lost = atomic_load(&g_dev_lost); + int caps_ok = kind == VKP_FG_ENGINE_DDFG + ? atomic_load(&g_caps_ddfg_ok) + : atomic_load(&g_caps_lsfg_ok); + return ready && !lost && caps_ok && !start_failed_for(kind); } int vkp_framegen_format_ok(VkFormat fmt) { diff --git a/app/src/main/cpp/waylandcomp/src/framegen_jni.c b/app/src/main/cpp/waylandcomp/src/framegen_jni.c index 35c5a3de46..e5a51456ed 100644 --- a/app/src/main/cpp/waylandcomp/src/framegen_jni.c +++ b/app/src/main/cpp/waylandcomp/src/framegen_jni.c @@ -50,6 +50,12 @@ Java_com_droiddeck_launcher_wayland_WaylandCompositor_nativeFrameGenCapsReason(J return (*env)->NewStringUTF(env, r ? r : ""); } +JNIEXPORT jboolean JNICALL +Java_com_droiddeck_launcher_wayland_WaylandCompositor_nativeFrameGenActive(JNIEnv *env, jclass clazz) { + (void)env; (void)clazz; + return vkp_framegen_active() ? JNI_TRUE : JNI_FALSE; +} + JNIEXPORT jfloatArray JNICALL Java_com_droiddeck_launcher_wayland_WaylandCompositor_nativeFrameGenStats(JNIEnv *env, jclass clazz) { (void)clazz; diff --git a/app/src/main/cpp/waylandcomp/src/waylandcomp_jni.c b/app/src/main/cpp/waylandcomp/src/waylandcomp_jni.c index ffbfdfd935..25b97ae0f8 100644 --- a/app/src/main/cpp/waylandcomp/src/waylandcomp_jni.c +++ b/app/src/main/cpp/waylandcomp/src/waylandcomp_jni.c @@ -18,6 +18,7 @@ #include "cardboard.h" #include "droiddeck_color.h" #include "gpu_clock_pin.h" +#include "clock_domain.h" extern int droiddeck_wayland_run(void); extern void droiddeck_wayland_set_scale_mode(int mode, int alignment); @@ -354,6 +355,13 @@ Java_com_droiddeck_launcher_wayland_WaylandCompositor_nativeVsync(JNIEnv *env, j droiddeck_wayland_vsync((int64_t)frameTimeNanos); } +JNIEXPORT void JNICALL +Java_com_droiddeck_launcher_wayland_WaylandCompositor_nativeSetClockControl(JNIEnv *env, jclass clazz, jstring path) { + const char *value = path ? (*env)->GetStringUTFChars(env, path, NULL) : NULL; + droiddeck_clock_domain_set_control(value); + if (value) (*env)->ReleaseStringUTFChars(env, path, value); +} + JNIEXPORT void JNICALL Java_com_droiddeck_launcher_wayland_WaylandCompositor_nativeSetHideShell(JNIEnv *env, jclass clazz, jboolean hide) { g_hide_shell = hide ? 1 : 0; diff --git a/app/src/main/java/com/droiddeck/launcher/App.kt b/app/src/main/java/com/droiddeck/launcher/App.kt index 5ef39f6b6e..564e2f516d 100644 --- a/app/src/main/java/com/droiddeck/launcher/App.kt +++ b/app/src/main/java/com/droiddeck/launcher/App.kt @@ -7,8 +7,11 @@ import com.droiddeck.launcher.session.EnhancedSessionLogShare import com.droiddeck.launcher.session.GpuClockPin class App : Application() { - override fun attachBaseContext(base: android.content.Context) = + override fun attachBaseContext(base: android.content.Context) { super.attachBaseContext(com.droiddeck.launcher.core.AppLanguage.wrap(base)) + val process = if (android.os.Build.VERSION.SDK_INT >= 28) Application.getProcessName() else packageName + com.droiddeck.launcher.lab.LabOverlay.load(this, process == packageName) + } override fun onConfigurationChanged(newConfig: android.content.res.Configuration) { super.onConfigurationChanged(newConfig) @@ -39,11 +42,18 @@ class App : Application() { if (process == "$packageName:vr_recovery" || process == "$packageName:rgb_diagnostic" || process == "$packageName:shortcuts_sync" || process == "$packageName:bottom_desktop") return CrashHandler.install(this) + com.droiddeck.launcher.agent.AgentHost.refresh(this) + com.droiddeck.launcher.agent.AgentTab.load(this) + com.droiddeck.launcher.ui.NavTabs.load(this) + com.droiddeck.launcher.ui.AgentPet.install(this) + if (com.droiddeck.launcher.agent.AgentTab.visible) com.droiddeck.launcher.lab.LabNotice.openOnInstall = "agent" + com.droiddeck.launcher.lab.LabNotice.started(this) com.droiddeck.launcher.core.SteamIntegration.syncShortcutsListing(this) com.droiddeck.launcher.session.QuestExperimental.initialize(this) com.droiddeck.launcher.session.SessionPrefs.applyNtsyncDefault(this) com.droiddeck.launcher.session.SessionPrefs.settleGpuDriverMode(this) com.droiddeck.launcher.update.AppUpdates.init(this) + com.droiddeck.launcher.update.UpdateWatch.sync(this, com.droiddeck.launcher.update.AppUpdates.follow(this, null)) com.droiddeck.launcher.core.DownloadSource.init(this) prefetchAddonPacks() GpuClockPin.clearLeftover(this) @@ -61,6 +71,10 @@ class App : Application() { com.droiddeck.launcher.stores.StoresState.register(com.droiddeck.launcher.stores.xbox.XboxBackend) com.droiddeck.launcher.sync.Syncthing.init(this) com.droiddeck.launcher.stores.StoresState.register(com.droiddeck.launcher.stores.battlenet.BattleNetBackend) + com.droiddeck.launcher.stores.StoresState.register(com.droiddeck.launcher.stores.ubisoft.UbisoftBackend) + com.droiddeck.launcher.stores.ea.EaBackend.app = this + com.droiddeck.launcher.stores.StoresState.register(com.droiddeck.launcher.stores.ea.EaBackend) + com.droiddeck.launcher.stores.StoresState.register(com.droiddeck.launcher.stores.rockstar.RockstarBackend) } private fun prefetchAddonPacks() { @@ -74,6 +88,8 @@ class App : Application() { if (com.droiddeck.launcher.stores.gog.GogComet.enabled(app)) com.droiddeck.launcher.core.AddonPack.COMET.ensure(app) if (com.droiddeck.launcher.stores.StoreAccounts.signedInAs(app, com.droiddeck.launcher.stores.Store.XBOX) != null) com.droiddeck.launcher.core.AddonPack.XBOX.ensure(app) + if (com.droiddeck.launcher.stores.StoreAccounts.signedInAs(app, com.droiddeck.launcher.stores.Store.UBISOFT) != null) + com.droiddeck.launcher.session.SessionFiles.ensureUbisoftService(app) com.droiddeck.launcher.handtracking.HandTracking.load(app) }.onFailure { android.util.Log.w("App", "add-on pack prefetch failed", it) } }, "addon-packs").start() diff --git a/app/src/main/java/com/droiddeck/launcher/DeviceCodeActivity.kt b/app/src/main/java/com/droiddeck/launcher/DeviceCodeActivity.kt new file mode 100644 index 0000000000..472521fe20 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/DeviceCodeActivity.kt @@ -0,0 +1,167 @@ +package com.droiddeck.launcher + +import android.app.ActivityOptions +import android.app.PictureInPictureParams +import android.content.ClipData +import android.content.ClipboardManager +import android.content.Context +import android.content.Intent +import android.content.res.Configuration +import android.net.Uri +import android.os.Bundle +import android.util.Rational +import androidx.activity.ComponentActivity +import androidx.activity.compose.BackHandler +import androidx.activity.compose.setContent +import androidx.compose.foundation.background +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.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.widthIn +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.setValue +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import com.droiddeck.launcher.core.AppLanguage +import com.droiddeck.launcher.ui.DroidDeckTheme +import com.droiddeck.launcher.ui.FitText +import com.droiddeck.launcher.ui.LocalPalette +import com.droiddeck.launcher.ui.PrimaryButton +import com.droiddeck.launcher.ui.SecondaryButton +import java.lang.ref.WeakReference + +/** Floats a sign-in code over the browser page that asks for it. */ +class DeviceCodeActivity : ComponentActivity() { + private var code by mutableStateOf("") + private var url = "" + private var display: Int? = null + private var inPip by mutableStateOf(false) + private var openPending = false + + override fun attachBaseContext(newBase: Context) = super.attachBaseContext(AppLanguage.wrap(newBase)) + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + current = WeakReference(this) + read(intent) + openPending = savedInstanceState == null + setContent { DroidDeckTheme { Float() } } + } + + override fun onNewIntent(intent: Intent) { + super.onNewIntent(intent) + setIntent(intent) + read(intent) + openPending = true + } + + override fun onDestroy() { + if (current?.get() === this) current = null + super.onDestroy() + } + + override fun onResume() { + super.onResume() + if (!openPending) return + if (isInPictureInPictureMode) { + openPage() + return + } + enterPip() + if (!inPip) { + openPage() + finish() + } + } + + override fun onPictureInPictureModeChanged(isInPictureInPictureMode: Boolean, newConfig: Configuration) { + super.onPictureInPictureModeChanged(isInPictureInPictureMode, newConfig) + inPip = isInPictureInPictureMode + if (isInPictureInPictureMode && openPending) openPage() + } + + private fun read(intent: Intent) { + code = intent.getStringExtra(EXTRA_CODE).orEmpty() + url = intent.getStringExtra(EXTRA_URL).orEmpty() + display = intent.getIntExtra(EXTRA_DISPLAY, -1).takeIf { it > 0 } + copy() + } + + private fun copy() { + runCatching { getSystemService(ClipboardManager::class.java)?.setPrimaryClip(ClipData.newPlainText("GitHub", code)) } + } + + private fun enterPip() { + inPip = runCatching { + enterPictureInPictureMode(PictureInPictureParams.Builder().setAspectRatio(Rational(16, 9)).build()) + }.getOrDefault(false) + } + + private fun openPage() { + openPending = false + val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url)).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) + val at = display + val opened = runCatching { + if (at == null) startActivity(intent) + else startActivity(intent, ActivityOptions.makeBasic().setLaunchDisplayId(at).toBundle()) + }.recoverCatching { startActivity(intent) }.isSuccess + com.droiddeck.launcher.agent.AgentHost.deviceCodeOpened(applicationContext, opened) + } + + @androidx.compose.runtime.Composable + private fun Float() { + val colors = MaterialTheme.colorScheme + val accent = LocalPalette.current.signal + BackHandler(enabled = !inPip) { enterPip() } + Box(Modifier.fillMaxSize().background(colors.background), contentAlignment = Alignment.Center) { + Column( + Modifier.widthIn(max = 520.dp).fillMaxWidth().padding(if (inPip) 8.dp else 24.dp), + horizontalAlignment = Alignment.CenterHorizontally, + verticalArrangement = Arrangement.spacedBy(if (inPip) 2.dp else 16.dp), + ) { + Text(stringResource(R.string.agent_step_github), style = MaterialTheme.typography.labelLarge, color = colors.onSurfaceVariant) + FitText(code, maxSize = if (inPip) 40.sp else 56.sp, fontWeight = FontWeight.Bold, color = accent, + modifier = Modifier.fillMaxWidth()) + Text(Uri.parse(url).let { it.host + it.path }, style = MaterialTheme.typography.labelMedium, color = colors.onSurfaceVariant, maxLines = 1) + if (!inPip) Row(horizontalArrangement = Arrangement.spacedBy(12.dp)) { + PrimaryButton(stringResource(R.string.fm_copy), onClick = ::copy) + SecondaryButton(stringResource(R.string.common_close), onClick = ::finish) + } + } + } + } + + companion object { + private const val EXTRA_CODE = "code" + private const val EXTRA_URL = "url" + private const val EXTRA_DISPLAY = "display" + private var current: WeakReference? = null + + /** False when this device cannot float a window, so the caller opens the page itself. */ + fun show(context: Context, code: String, url: String, display: Int): Boolean { + if (!PairingGuideActivity.canFloat(context)) return false + val intent = Intent(context, DeviceCodeActivity::class.java) + .putExtra(EXTRA_CODE, code).putExtra(EXTRA_URL, url).putExtra(EXTRA_DISPLAY, display) + .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) + return runCatching { + if (display > 0) context.startActivity(intent, ActivityOptions.makeBasic().setLaunchDisplayId(display).toBundle()) + else context.startActivity(intent) + }.isSuccess + } + + fun close() { + current?.get()?.finish() + } + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/FrontEndActivity.kt b/app/src/main/java/com/droiddeck/launcher/FrontEndActivity.kt index 6bdfbbca38..b195192643 100644 --- a/app/src/main/java/com/droiddeck/launcher/FrontEndActivity.kt +++ b/app/src/main/java/com/droiddeck/launcher/FrontEndActivity.kt @@ -84,7 +84,7 @@ import com.droiddeck.launcher.session.SteamLibraries import com.droiddeck.launcher.input.SecondScreenDisplay import com.droiddeck.launcher.input.SecondScreenDisplays -class FrontEndActivity : ComponentActivity() { +class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPetHost { override fun attachBaseContext(newBase: android.content.Context) { super.attachBaseContext(newBase) com.droiddeck.launcher.core.AppLanguage.applyTo(this, newBase) @@ -179,12 +179,14 @@ class FrontEndActivity : ComponentActivity() { private var syncFallback by mutableStateOf(true) private var fsyncFirst by mutableStateOf(false) private var gamescopeRealtime by mutableStateOf(false) + private var paceCores by mutableStateOf(true) private var ramCapMb by mutableStateOf(0) private var zramClient by mutableStateOf(true) private var vramCapMb by mutableStateOf(0) private var gpuClockPin by mutableStateOf(false) private var prootNoSeccomp by mutableStateOf(false) private var prootFastPath by mutableStateOf(true) + private var nativeUserland by mutableStateOf(false) private var cursorComposite by mutableStateOf(false) private var guestHostname by mutableStateOf(SessionPrefs.DEFAULT_GUEST_HOSTNAME) private var phantomWarning by mutableStateOf(null) @@ -195,6 +197,7 @@ class FrontEndActivity : ComponentActivity() { private var stretch16x9 by mutableStateOf(false) private var orientation by mutableStateOf(android.content.pm.ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE) private var launcherOrientation by mutableStateOf(android.content.pm.ActivityInfo.SCREEN_ORIENTATION_USER) + private var homePage by mutableStateOf(com.droiddeck.launcher.core.AppUiPrefs.HOME_PAGE_STEAM) private var launcherFullscreen by mutableStateOf(true) private var downloadSource by mutableStateOf(DownloadSource.MODE_AUTO) private var downloadMirror by mutableStateOf("") @@ -204,6 +207,10 @@ class FrontEndActivity : ComponentActivity() { private var lowStorageWarning by mutableStateOf(true) private var launcherIcon by mutableStateOf(LauncherIcon.DARK) private var gameStoresEnabled by mutableStateOf(true) + private var soundtracksEnabled by mutableStateOf(true) + private var soundtracksIngame by mutableStateOf(false) + private var soundtracks by mutableStateOf>(emptyList()) + private var soundtracksLoaded by mutableStateOf(false) private var gameStoresSpeedTier by mutableStateOf("fast") private var navRequest by mutableStateOf(null) private val gameLaunchRequest = java.util.concurrent.atomic.AtomicLong() @@ -225,6 +232,11 @@ class FrontEndActivity : ComponentActivity() { refreshWifiDiscovery() } } + private val dateReceiver = object : android.content.BroadcastReceiver() { + override fun onReceive(context: android.content.Context?, intent: Intent?) { + refreshAndroidApps() + } + } private val mediaRefresh = Runnable { refresh() refreshAddedGames() @@ -592,6 +604,7 @@ class FrontEndActivity : ComponentActivity() { private var vacDiagnostics by mutableStateOf(false) private var agentCommands by mutableStateOf(false) private var graphicsLogs by mutableStateOf(false) + private var buildWatermark by mutableStateOf(true) private var steamGpuDrawing by mutableStateOf(false) private var bridgeFellBack by mutableStateOf(false) private var bridgeFellBackMemory by mutableStateOf(false) @@ -777,6 +790,11 @@ class FrontEndActivity : ComponentActivity() { private var shortcutPicker by mutableStateOf(false) private var shortcutLibraryScanning by mutableStateOf(false) @Volatile private var libraryScanGeneration = 0 + private class SoundtrackRemoval(val op: Int, var scan: Int, var settled: Boolean) + private val soundtrackRemovals = HashMap() + private var soundtrackOp = 0 + private var soundtrackAddScan = -1 + private val soundtrackWork = java.util.concurrent.Executors.newSingleThreadExecutor { r -> Thread(r, "soundtrack-work").apply { isDaemon = true } } @Volatile private var lastComponentRestore = 0L @Volatile private var componentRestoreRetry = false private val componentRestoreLock = Any() @@ -827,6 +845,10 @@ class FrontEndActivity : ComponentActivity() { private fun readGameIntent(request: Intent) { request.getStringExtra(com.droiddeck.launcher.stores.download.StoreDownloadService.EXTRA_NAV)?.let { navRequest = it; request.removeExtra(com.droiddeck.launcher.stores.download.StoreDownloadService.EXTRA_NAV) } + if (navRequest == com.droiddeck.launcher.core.AppUiPrefs.HOME_PAGE_APPS) { + homeAppSelected = HomeApp.isHomeScreenEnabled(this) && HomeApp.isDefault(this) + if (!homeAppSelected) navRequest = null + } shortcutPicker = request.action == Intent.ACTION_CREATE_SHORTCUT if (shortcutPicker) { steamGames = emptyList() @@ -835,6 +857,15 @@ class FrontEndActivity : ComponentActivity() { pendingGameLink = null gameLinkReading = false gameLinkTried = false + soundtrackLaunch = false + val soundtrackId = com.droiddeck.launcher.frontend.SoundtrackShortcuts.read(request) + if (soundtrackId != null) { + soundtrackLaunch = true + navRequest = if (SessionPrefs.soundtracksEnabled(this)) "sound:$soundtrackId" else "app:$soundtrackId" + request.data = null + request.action = Intent.ACTION_MAIN + return + } if (GameLaunchIntent.accepts(request.action)) { gameLinkReading = true com.droiddeck.launcher.ui.DualScreenPanel.hide(taskId) @@ -858,12 +889,15 @@ class FrontEndActivity : ComponentActivity() { } } - private fun launchGame(game: Library.SteamGame, returnHome: Boolean = false): Boolean { + private fun launchGame(game: Library.SteamGame, returnHome: Boolean = false, onHandled: () -> Unit = {}): Boolean { + if (!SessionPrefs.soundtracksIngame(this)) com.droiddeck.launcher.playback.SoundtrackController.pause(this) if (pkgStage != null) { + onHandled() android.widget.Toast.makeText(this, R.string.main_wait_install_game, android.widget.Toast.LENGTH_SHORT).show() return false } - if (com.droiddeck.launcher.session.NoSteamLaunch.enabled(this, game)) return launchWithoutSteam(game, returnHome) + if (com.droiddeck.launcher.session.NoSteamLaunch.enabled(this, game)) return launchWithoutSteam(game, returnHome, onHandled) + onHandled() if (SessionState.running) { if (SessionState.mode != SessionService.MODE_STEAM || SessionState.stopRequested) { android.widget.Toast.makeText(this, R.string.game_link_session_busy, android.widget.Toast.LENGTH_LONG).show() @@ -907,12 +941,13 @@ class FrontEndActivity : ComponentActivity() { .apply { if (returnHome) putExtra(SessionActivity.EXTRA_LINK_TASK, task) } } - private fun launchWithoutSteam(game: Library.SteamGame, returnHome: Boolean): Boolean { + private fun launchWithoutSteam(game: Library.SteamGame, returnHome: Boolean, onHandled: () -> Unit = {}): Boolean { val app = applicationContext Thread({ - val added = if (game.library == Library.ADDED) runCatching { com.droiddeck.launcher.session.NoSteamLaunch.addedGame(app, game) }.getOrNull() else null + val added = if (com.droiddeck.launcher.session.NoSteamLaunch.needsAddedGame(game)) runCatching { com.droiddeck.launcher.session.NoSteamLaunch.addedGame(app, game) }.getOrNull() else null val command = com.droiddeck.launcher.session.NoSteamLaunch.command(game, added) ui.post { + onHandled() if (isDestroyed) return@post if (command == null) { android.widget.Toast.makeText(this, R.string.game_link_failed, android.widget.Toast.LENGTH_LONG).show() @@ -1104,6 +1139,8 @@ class FrontEndActivity : ComponentActivity() { gameSpaceOffered = savedInstanceState?.getBoolean(STATE_GAME_SPACE_OFFERED) == true if (savedInstanceState == null) readIntegrationIntent(intent) readGameIntent(intent) + // A Lab build is usually the agent's work, so the app comes back where the agent is. + if (savedInstanceState == null && navRequest == null && com.droiddeck.launcher.lab.LabOverlay.promoted && com.droiddeck.launcher.agent.AgentTab.visible) navRequest = "agent" gameSyncFolder = GameFileSync.folder(this) displayManager = getSystemService(DISPLAY_SERVICE) as DisplayManager refreshPhantomStatus() @@ -1118,6 +1155,7 @@ class FrontEndActivity : ComponentActivity() { orientation = SessionPrefs.orientation(this) launcherOrientation = com.droiddeck.launcher.core.AppUiPrefs.orientation(this) requestedOrientation = launcherOrientation + homePage = com.droiddeck.launcher.core.AppUiPrefs.homePage(this) launcherFullscreen = SessionPrefs.launcherFullscreen(this) downloadSource = DownloadSource.mode(this) downloadMirror = DownloadSource.mirror(this) @@ -1129,6 +1167,8 @@ class FrontEndActivity : ComponentActivity() { LauncherIcon.repair(this, intent?.component) launcherIcon = LauncherIcon.current(this) gameStoresEnabled = SessionPrefs.gameStoresEnabled(this) + soundtracksEnabled = SessionPrefs.soundtracksEnabled(this) + soundtracksIngame = SessionPrefs.soundtracksIngame(this) gameStoresSpeedTier = SessionPrefs.gameStoresSpeedTier(this) storesShowMature = SessionPrefs.storesShowMature(this) storesSort = SessionPrefs.storesSort(this) @@ -1175,6 +1215,7 @@ class FrontEndActivity : ComponentActivity() { gameDebugLogsEnabled = gameDebugLogsEnabled, gameDebugLogsNeedsRestart = gameDebugLogsNeedsRestart, vacDiagnostics = vacDiagnostics, agentCommands = agentCommands, graphicsLogs = graphicsLogs, steamGpuDrawing = steamGpuDrawing, bridgeFellBack = bridgeFellBack, bridgeFellBackMemory = bridgeFellBackMemory, + buildWatermark = buildWatermark, clearCachedApps = clearCachedApps, adbPaired = adbPaired, memoryHud = memoryHud, backgroundAppLimit = backgroundAppLimit, tpUbwcMode = drivers.tpUbwcModeForDevice(), tpUbwcRestartRequired = drivers.tpUbwcRestartRequired(), canRestartApp = !runtimeChangesBlocked(), steamGames = steamGames, steamGamesX64 = steamGamesX64, emulators = emulatorList, running = runningLabel, @@ -1213,6 +1254,7 @@ class FrontEndActivity : ComponentActivity() { showPhantomGate = showPhantomGate, orientation = orientation, launcherOrientation = launcherOrientation, + homePage = homePage, launcherFullscreen = launcherFullscreen, downloadSource = downloadSource, downloadMirror = downloadMirror, @@ -1222,6 +1264,10 @@ class FrontEndActivity : ComponentActivity() { lowStorageWarning = lowStorageWarning, launcherIcon = launcherIcon, gameStoresEnabled = gameStoresEnabled, + soundtracksEnabled = soundtracksEnabled, + soundtracksIngame = soundtracksIngame, + soundtracks = soundtracks, + soundtracksLoaded = soundtracksLoaded, gameStoresSpeedTier = gameStoresSpeedTier, navigate = navRequest, addedGamesArt = addedGamesArt, @@ -1270,7 +1316,10 @@ class FrontEndActivity : ComponentActivity() { }, onEpicLauncher = { openEpicLauncher() }, onUninstallEpicLauncher = { uninstallEpicLauncher() }, - onGameShortcut = { g -> com.droiddeck.launcher.frontend.GameShortcuts.pin(this, g) }, + onGameShortcut = { g -> + if (g.soundtrack) com.droiddeck.launcher.frontend.SoundtrackShortcuts.pin(this, g) + else com.droiddeck.launcher.frontend.GameShortcuts.pin(this, g) + }, onExportGameFile = { g -> pickGameExport(g) }, onSyncGameFiles = { pickGameExport(null) }, onAddGameExe = { path -> addGameExe(path) }, @@ -1295,8 +1344,9 @@ class FrontEndActivity : ComponentActivity() { }, "game-file-stop-sync").start() }, onCopyGameLink = { g -> - (getSystemService(CLIPBOARD_SERVICE) as ClipboardManager).setPrimaryClip( - ClipData.newPlainText(g.name, com.droiddeck.launcher.frontend.GameLaunchLink.uri(g.gameIdString))) + val link = if (g.soundtrack) com.droiddeck.launcher.frontend.SoundtrackShortcuts.uri(g.appId) + else com.droiddeck.launcher.frontend.GameLaunchLink.uri(g.gameIdString) + (getSystemService(CLIPBOARD_SERVICE) as ClipboardManager).setPrimaryClip(ClipData.newPlainText(g.name, link)) android.widget.Toast.makeText(this, R.string.game_link_copied, android.widget.Toast.LENGTH_SHORT).show() }, onDesktop = { @@ -1321,6 +1371,7 @@ class FrontEndActivity : ComponentActivity() { }, onRom = { g -> val e = emulatorList.first { it.id == g.emulatorId } + if (!SessionPrefs.soundtracksIngame(this)) com.droiddeck.launcher.playback.SoundtrackController.pause(this) startActivity(Intent(this, SessionActivity::class.java) .putExtra(SessionService.EXTRA_MODE, SessionService.MODE_RUN) .putExtra(SessionService.EXTRA_PROGRAM, e.program) @@ -1413,6 +1464,11 @@ class FrontEndActivity : ComponentActivity() { SessionPrefs.setDetailedGraphicsLogs(this, !SessionPrefs.detailedGraphicsLogs(this)) graphicsLogs = SessionPrefs.detailedGraphicsLogs(this) }, + onBuildWatermark = { + SessionPrefs.setBuildWatermarkEnabled(this, !SessionPrefs.buildWatermarkEnabled(this)) + buildWatermark = SessionPrefs.buildWatermarkEnabled(this) + com.droiddeck.launcher.ui.BuildWatermark.refresh(this) + }, onVacDiagnostics = { SessionPrefs.setVacDiagnostics(this, !SessionPrefs.vacDiagnostics(this)) vacDiagnostics = SessionPrefs.vacDiagnostics(this) @@ -1484,6 +1540,15 @@ class FrontEndActivity : ComponentActivity() { }, onPageBack = { showPerformance = false; showComponents = false; showMapping = false }, onGameStoresEnabled = { on -> SessionPrefs.setGameStoresEnabled(this, on); gameStoresEnabled = on }, + onSoundtracksEnabled = { on -> SessionPrefs.setSoundtracksEnabled(this, on); soundtracksEnabled = on }, + onSoundtracksIngame = { on -> + SessionPrefs.setSoundtracksIngame(this, on) + soundtracksIngame = on + com.droiddeck.launcher.playback.SoundtrackController.setIngame(this, on) + }, + onSoundtrackAdded = { folder -> addSoundtrack(folder) }, + onSoundtracksChanged = { refreshAddedSoundtracks() }, + onSoundtrackRemoved = { g -> removeSoundtrack(g) }, onTheme = { id -> SessionPrefs.setTheme(this, id); theme = id }, onLauncherIcon = { style -> switchLauncherIcon(style) }, onLanguage = { tag -> @@ -1505,6 +1570,10 @@ class FrontEndActivity : ComponentActivity() { launcherOrientation = value requestedOrientation = value }, + onHomePage = { value -> + com.droiddeck.launcher.core.AppUiPrefs.setHomePage(this, value) + homePage = value + }, onLauncherFullscreen = { on -> SessionPrefs.setLauncherFullscreen(this, on) launcherFullscreen = on @@ -1573,6 +1642,7 @@ class FrontEndActivity : ComponentActivity() { refreshHomeAppState() } }, + onAppIconsChanged = { refreshAndroidApps() }, onAndroidApp = { app, displayId -> launchAndroidApp(app, displayId) }, onBackActionsInverted = { inverted -> SessionPrefs.setBackActionsInverted(this, inverted) @@ -1755,6 +1825,8 @@ class FrontEndActivity : ComponentActivity() { }, "finish-abandoned").start() } + override val petBlocked: Boolean get() = false + override fun onNewIntent(intent: Intent) { super.onNewIntent(intent) setIntent(intent) @@ -1770,7 +1842,10 @@ class FrontEndActivity : ComponentActivity() { startSteamAtStartupIfEnabled() } + private var soundtrackLaunch = false + private fun startSteamAtStartupIfEnabled(cold: Boolean = false) { + if (soundtrackLaunch) return if (intent.action != Intent.ACTION_MAIN && !(cold && intent.action == null)) return if (isFinishing || isDestroyed) return when (SessionPrefs.startupSession(this)) { @@ -1848,6 +1923,7 @@ class FrontEndActivity : ComponentActivity() { } override fun dispatchKeyEvent(event: KeyEvent): Boolean { + if (com.droiddeck.launcher.ui.AgentPet.handleBack(this, event)) return true if (compatLaunch != null) { if (event.keyCode == KeyEvent.KEYCODE_BACK || event.keyCode == KeyEvent.KEYCODE_BUTTON_B) { if (event.action == KeyEvent.ACTION_UP) cancelCompatLaunch() @@ -1897,6 +1973,7 @@ class FrontEndActivity : ComponentActivity() { orientation = SessionPrefs.orientation(this) launcherOrientation = com.droiddeck.launcher.core.AppUiPrefs.orientation(this) requestedOrientation = launcherOrientation + homePage = com.droiddeck.launcher.core.AppUiPrefs.homePage(this) SteamIntegration.syncShortcutsListing(this) refreshWifiDiscovery() com.droiddeck.launcher.stores.StoresState.refresh(this) @@ -1950,6 +2027,7 @@ class FrontEndActivity : ComponentActivity() { override fun onStart() { super.onStart() registerReceiver(wifiLocationReceiver, android.content.IntentFilter(android.location.LocationManager.MODE_CHANGED_ACTION)) + registerReceiver(dateReceiver, android.content.IntentFilter(Intent.ACTION_DATE_CHANGED)) registerReceiver(mediaReceiver, android.content.IntentFilter().apply { for (action in listOf(Intent.ACTION_MEDIA_MOUNTED, Intent.ACTION_MEDIA_UNMOUNTED, Intent.ACTION_MEDIA_REMOVED, Intent.ACTION_MEDIA_EJECT, Intent.ACTION_MEDIA_BAD_REMOVAL)) addAction(action) @@ -1995,8 +2073,8 @@ class FrontEndActivity : ComponentActivity() { com.droiddeck.launcher.frontend.AutoComponents.beforeLaunch(this, g, onBlocked = done) { if (request != gameLaunchRequest.get() || isFinishing || isDestroyed) { done(); return@beforeLaunch } com.droiddeck.launcher.stores.StoreLaunch.prepare(this, g) { - done() - if (request == gameLaunchRequest.get() && !isFinishing && !isDestroyed) launchGame(g) + if (request == gameLaunchRequest.get() && !isFinishing && !isDestroyed) launchGame(g, onHandled = done) + else done() } } } @@ -2016,6 +2094,7 @@ class FrontEndActivity : ComponentActivity() { override fun onStop() { if (!homeChoiceOpen) HomeApp.releaseUnusedHomeEntry(this) unregisterReceiver(wifiLocationReceiver) + unregisterReceiver(dateReceiver) unregisterReceiver(mediaReceiver) getSystemService(android.content.pm.LauncherApps::class.java).unregisterCallback(packageCallback) HomeWidgets.stopListening(this) @@ -2546,7 +2625,7 @@ class FrontEndActivity : ComponentActivity() { private fun PerformanceHost() { PerformancePage( cores = CpuCores.all.map { c -> CoreRow(c, "cpu$c" + (CpuCores.maxGhz(c)?.let { String.format(java.util.Locale.US, " ยท %.1f GHz", it) } ?: "")) }, - clientOverride = clientOverride, clientCores = clientCores, gameCores = gameCores, + clientOverride = clientOverride, clientCores = clientCores, gameCores = gameCores, paceCores = paceCores, tuSysmem = tuSysmem, zinkLazy = zinkLazy, glThread = glThread, noGlError = noGlError, noXalia = noXalia, fastSync = fastSync, syncFallback = syncFallback, @@ -2557,9 +2636,10 @@ class FrontEndActivity : ComponentActivity() { deviceRamMb = (android.app.ActivityManager.MemoryInfo() .also((getSystemService(ACTIVITY_SERVICE) as android.app.ActivityManager)::getMemoryInfo).totalMem / (1024 * 1024)).toInt(), ramCapAvailable = com.droiddeck.launcher.core.ZramSupport.supported(), - prootNoSeccomp = prootNoSeccomp, prootFastPath = prootFastPath, cursorComposite = cursorComposite, + prootNoSeccomp = prootNoSeccomp, prootFastPath = prootFastPath, nativeUserland = nativeUserland, cursorComposite = cursorComposite, guestHostname = guestHostname, phantomWarning = phantomWarning, onClientOverride = { on -> SessionPrefs.setClientCpusOverride(this, on); clientOverride = on }, + onPaceCores = { on -> SessionPrefs.setPaceCores(this, on); paceCores = on }, onTuSysmem = { on -> SessionPrefs.setTuSysmem(this, on); tuSysmem = on }, onZinkLazy = { on -> SessionPrefs.setZinkLazy(this, on); zinkLazy = on }, onGlThread = { on -> SessionPrefs.setGlThread(this, on); glThread = on }, @@ -2575,6 +2655,7 @@ class FrontEndActivity : ComponentActivity() { onVramCapMb = { mb -> SessionPrefs.setVramCapMb(this, mb); vramCapMb = mb }, onProotNoSeccomp = { on -> SessionPrefs.setProotNoSeccomp(this, on); prootNoSeccomp = on }, onProotFastPath = { on -> SessionPrefs.setProotFastPath(this, on); prootFastPath = on }, + onNativeUserland = { on -> SessionPrefs.setNativeUserland(this, on); nativeUserland = on }, onCursorComposite = { on -> SessionPrefs.setCursorComposite(this, on); cursorComposite = on }, onGuestHostname = { name -> SessionPrefs.setGuestHostname(this, name) }, onClientCore = { core, on -> @@ -2610,15 +2691,89 @@ class FrontEndActivity : ComponentActivity() { val version = (steamArtRefreshes[appId] ?: 0) + 1 steamArtRefreshes[appId] = version Thread({ - val fresh = com.droiddeck.launcher.frontend.Library.steamGames(this).firstOrNull { it.appId == appId } ?: return@Thread + val fresh = com.droiddeck.launcher.frontend.Library.steamGames(this, soundtracks = true).firstOrNull { it.appId == appId } ?: return@Thread ui.post { if (steamArtRefreshes[appId] != version) return@post - steamGames = steamGames.map { if (it.appId == appId && it.library != Library.ADDED) fresh else it } + if (fresh.soundtrack) soundtracks = soundtracks.map { if (it.appId == appId && it.library != Library.ADDED) fresh else it } + else steamGames = steamGames.map { if (it.appId == appId && it.library != Library.ADDED) fresh else it } } }, "steam-art-update").start() } + private fun addSoundtrack(folder: java.io.File) { + val op = ++soundtrackOp + soundtrackAddScan = libraryScanGeneration + soundtrackWork.execute { + val added = com.droiddeck.launcher.frontend.AddedSoundtracks.add(this, folder) + val list = com.droiddeck.launcher.frontend.AddedSoundtracks.games(this) + ui.post { + if (added) { + soundtrackRemovals[folder.path]?.takeIf { it.op < op }?.let { + soundtrackRemovals.remove(folder.path) + com.droiddeck.launcher.playback.SoundtrackController.allow(listOf(folder.path)) + } + val visible = list.filterNot { s -> s.gameFiles?.path?.let { soundtrackRemovals[it] }?.let { it.op > op } == true } + soundtracks = soundtracks.filter { it.library != Library.ADDED } + visible + } else android.widget.Toast.makeText(this, R.string.soundtracks_add_empty, android.widget.Toast.LENGTH_SHORT).show() + } + } + } + + private fun refreshAddedSoundtracks() { + val op = soundtrackOp + soundtrackWork.execute { + val list = com.droiddeck.launcher.frontend.AddedSoundtracks.games(this) + ui.post { + if (op != soundtrackOp) return@post + val visible = list.filterNot { s -> s.gameFiles?.path?.let { soundtrackRemovals[it] } != null } + soundtracks = soundtracks.filter { it.library != Library.ADDED } + visible + } + } + } + + private fun removeSoundtrack(g: Library.SteamGame) { + val path = g.gameFiles?.path + val added = g.library == Library.ADDED + val target = if (added) null else com.droiddeck.launcher.frontend.GameRemoval.steamFiles(g) ?: return + com.droiddeck.launcher.playback.SoundtrackController.stopIf(this, g.gameFiles) + val marker = SoundtrackRemoval(++soundtrackOp, libraryScanGeneration, added) + path?.let { soundtrackRemovals[it] = marker } + if (target == null) { + soundtracks = soundtracks.filterNot { it.appId == g.appId && it.library == Library.ADDED } + soundtrackWork.execute { + val removed = com.droiddeck.launcher.frontend.AddedSoundtracks.remove(this, path.orEmpty()) + val list = if (removed) emptyList() else com.droiddeck.launcher.frontend.AddedSoundtracks.games(this) + if (!removed) ui.post { + if (path != null && soundtrackRemovals[path] === marker) { + soundtrackRemovals.remove(path) + com.droiddeck.launcher.playback.SoundtrackController.allow(listOf(path)) + } + soundtracks = soundtracks.filter { it.library != Library.ADDED } + list.filterNot { s -> s.gameFiles?.path?.let { soundtrackRemovals[it] } != null } + android.widget.Toast.makeText(this, getString(R.string.gfiles_remove_failed, g.name), android.widget.Toast.LENGTH_SHORT).show() + } + } + return + } + soundtrackWork.execute { + val deleted = com.droiddeck.launcher.frontend.GameRemoval.delete(target) + ui.post { + if (deleted) { + marker.scan = libraryScanGeneration + marker.settled = true + } else { + if (path != null && soundtrackRemovals[path] === marker) { + soundtrackRemovals.remove(path) + com.droiddeck.launcher.playback.SoundtrackController.allow(listOf(path)) + } + android.widget.Toast.makeText(this, getString(R.string.gfiles_remove_failed, g.name), android.widget.Toast.LENGTH_SHORT).show() + } + refresh() + } + } + } + private fun removeGame(g: Library.SteamGame) { + if (g.soundtrack) { removeSoundtrack(g); return } val folder = g.gameFiles ?: return when (com.droiddeck.launcher.frontend.GameRemoval.kind(g)) { com.droiddeck.launcher.frontend.GameRemoval.Kind.LAUNCHER -> Unit @@ -2791,12 +2946,14 @@ class FrontEndActivity : ComponentActivity() { syncFallback = SessionPrefs.syncFallback(this) fsyncFirst = SessionPrefs.fsyncFirst(this) gamescopeRealtime = SessionPrefs.gamescopeRealtime(this) + paceCores = SessionPrefs.paceCores(this) ramCapMb = SessionPrefs.ramCapMb(this) zramClient = SessionPrefs.zramClient(this) vramCapMb = SessionPrefs.vramCapMb(this) gpuClockPin = SessionPrefs.gpuClockPin(this) prootNoSeccomp = SessionPrefs.prootNoSeccomp(this) prootFastPath = SessionPrefs.prootFastPath(this) + nativeUserland = SessionPrefs.nativeUserland(this) cursorComposite = SessionPrefs.cursorComposite(this) guestHostname = SessionPrefs.guestHostname(this) refreshPhantomStatus() @@ -2862,6 +3019,7 @@ class FrontEndActivity : ComponentActivity() { vacDiagnostics = SessionPrefs.vacDiagnostics(this) agentCommands = com.droiddeck.launcher.agent.AgentAccess.commandsEnabled(this) graphicsLogs = SessionPrefs.detailedGraphicsLogs(this) + buildWatermark = SessionPrefs.buildWatermarkEnabled(this) steamGpuDrawing = SessionPrefs.steamGpuCompositing(this) bridgeFellBack = SessionPrefs.bridgeFellBack(this) bridgeFellBackMemory = SessionPrefs.bridgeFellBackForMemory(this) @@ -2900,6 +3058,19 @@ class FrontEndActivity : ComponentActivity() { } val scannedArch = SessionPrefs.activeSteamClientArch(this) val scannedX64 = scannedArch == "x86_64" + val scannedSoundtracks = runCatching { + (if (ready || com.droiddeck.launcher.runtime.LinuxRuntime.hasRootfs(this)) Library.soundtracks(this, scannedArch) else emptyList()) + + com.droiddeck.launcher.frontend.AddedSoundtracks.games(this) + }.getOrDefault(emptyList()) + ui.post { + if (scanGeneration == libraryScanGeneration) { + val scanned = if (scanGeneration <= soundtrackAddScan) scannedSoundtracks + soundtracks.filter { cur -> cur.library == Library.ADDED && scannedSoundtracks.none { it.library == Library.ADDED && it.appId == cur.appId } } else scannedSoundtracks + val kept = scanned.filterNot { s -> s.gameFiles?.path?.let { p -> soundtrackRemovals[p]?.let { m -> !m.settled || s.library == Library.ADDED || scanGeneration <= m.scan } } == true } + com.droiddeck.launcher.playback.SoundtrackController.allow(kept.mapNotNull { it.gameFiles?.path }) + soundtracks = kept + soundtracksLoaded = true + } + } val games = if (ready || com.droiddeck.launcher.runtime.LinuxRuntime.hasRootfs(this)) Library.launchableGames(this, arch = scannedArch) else emptyList() val all = games.distinctBy { it.gameId } if (ready && scanGeneration == libraryScanGeneration) com.droiddeck.launcher.frontend.LibraryCache.save(this, all, scannedX64) @@ -3041,6 +3212,8 @@ class FrontEndActivity : ComponentActivity() { com.droiddeck.launcher.core.AppLanguage.setChosen(this, com.droiddeck.launcher.core.AppLanguage.SYSTEM) if (!ok) android.widget.Toast.makeText(this, R.string.setup_reset_settings_partial, android.widget.Toast.LENGTH_LONG).show() com.droiddeck.launcher.ui.Motion.refresh(this) + com.droiddeck.launcher.agent.AgentTab.load(this) + com.droiddeck.launcher.ui.NavTabs.load(this) if (!switchLauncherIcon(LauncherIcon.DARK)) recreate() } }, "reset-settings").start() @@ -3076,6 +3249,7 @@ class FrontEndActivity : ComponentActivity() { android.widget.Toast.makeText(this, it, android.widget.Toast.LENGTH_LONG).show() } refresh() + com.droiddeck.launcher.agent.AgentHost.refresh(this) if (ok == true && LinuxRuntime.isInstalled(this)) protons.checkUpdates() } }, "runtime-operation").start() diff --git a/app/src/main/java/com/droiddeck/launcher/HomeActivity.kt b/app/src/main/java/com/droiddeck/launcher/HomeActivity.kt index 59e10c48e7..0f3a37e83e 100644 --- a/app/src/main/java/com/droiddeck/launcher/HomeActivity.kt +++ b/app/src/main/java/com/droiddeck/launcher/HomeActivity.kt @@ -4,6 +4,7 @@ import android.app.Activity import android.content.Intent import android.os.Bundle import com.droiddeck.launcher.session.SessionService +import com.droiddeck.launcher.session.SessionState class HomeActivity : Activity() { override fun attachBaseContext(newBase: android.content.Context) { @@ -18,15 +19,22 @@ class HomeActivity : Activity() { } private fun routeHome() { - val destination = if (HomeApp.isActiveSteamSession()) { + val destination = if (HomeApp.isActiveSteamSession() && !SessionState.pipActive) { Intent(this, SessionActivity::class.java) .setAction(SessionService.ACTION_HOME_GUIDE) .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP) } else { Intent(this, FrontEndActivity::class.java) .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP) + .apply { + val page = com.droiddeck.launcher.core.AppUiPrefs.homePage(this@HomeActivity) + if (page != com.droiddeck.launcher.core.AppUiPrefs.HOME_PAGE_STEAM) { + putExtra(com.droiddeck.launcher.stores.download.StoreDownloadService.EXTRA_NAV, page) + } + } } - startActivity(destination) + if (SessionState.pipActive && destination.component?.className == FrontEndActivity::class.java.name) HomeApp.showFrontEnd(this, destination) + else startActivity(destination) finish() } } diff --git a/app/src/main/java/com/droiddeck/launcher/HomeApp.kt b/app/src/main/java/com/droiddeck/launcher/HomeApp.kt index 9a724d9044..e2096a673c 100644 --- a/app/src/main/java/com/droiddeck/launcher/HomeApp.kt +++ b/app/src/main/java/com/droiddeck/launcher/HomeApp.kt @@ -18,6 +18,7 @@ import android.net.Uri import android.os.Build import android.provider.Settings import androidx.core.graphics.drawable.toBitmap +import com.droiddeck.launcher.core.AppUiPrefs import com.droiddeck.launcher.session.SessionService import com.droiddeck.launcher.session.SessionState import kotlin.math.roundToInt @@ -41,7 +42,7 @@ object HomeApp { val userSerial: Long = 0L, ) { val component get() = ComponentName(packageName, className) - val key get() = "$packageName/$className" + if (userSerial != 0L) "#$userSerial" else "" + val key get() = appKey(packageName, className, userSerial) val work get() = userSerial != 0L } @@ -101,6 +102,9 @@ object HomeApp { ?: resolved.loadLabel(pm)?.toString()?.trim()?.takeIf { it.isNotEmpty() } } + private fun appKey(packageName: String, className: String, userSerial: Long) = + "$packageName/$className" + if (userSerial != 0L) "#$userSerial" else "" + fun roleRequestIntent(context: Context): Intent? { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) return null val roles = context.getSystemService(RoleManager::class.java) ?: return null @@ -116,13 +120,25 @@ object HomeApp { val pm = context.packageManager val own = Process.myUserHandle() val iconPx = (ICON_DP * context.resources.displayMetrics.density).roundToInt() + val densityDpi = context.resources.displayMetrics.densityDpi + val pack = IconPack.active(context) + val appColors = IconPack.appColors(context) + HomeIcons.load(context) + val overrides = HomeIcons.overrides val apps = users.userProfiles.flatMap { user -> val serial = if (user == own) 0L else users.getSerialNumberForUser(user) runCatching { launcher.getActivityList(null, user) }.getOrDefault(emptyList()).mapNotNull { info -> val component = info.componentName if (component.packageName == context.packageName && user == own) return@mapNotNull null val label = info.label?.toString()?.trim().orEmpty().ifEmpty { component.packageName } - val icon = runCatching { info.getBadgedIcon(0).toBitmap(iconPx, iconPx) }.getOrNull() + val icon = runCatching { + (overrides[appKey(component.packageName, component.className, serial)] + ?.let { IconPack.drawable(context, it.pack, it.drawable, densityDpi) } + ?: pack?.icon(component, densityDpi) + ?: pack?.plated(info.getIcon(0), iconPx, densityDpi, appColors)) + ?.let { pm.getUserBadgedIcon(it, user) } + ?.toBitmap(iconPx, iconPx) + }.getOrNull() ?: runCatching { info.getBadgedIcon(0).toBitmap(iconPx, iconPx) }.getOrNull() val app = info.applicationInfo val updated = if (user == own) runCatching { pm.getPackageInfo(component.packageName, 0).lastUpdateTime }.getOrNull() else null @Suppress("DEPRECATION") @@ -181,7 +197,10 @@ object HomeApp { } private fun syncRecents(activity: android.app.Activity) = - keepOutOfRecents(activity, activity is FrontEndActivity && !SessionState.running && isDefault(activity)) + keepOutOfRecents( + activity, + activity is FrontEndActivity && !SessionState.running && isDefault(activity) && AppUiPrefs.hideHomeFromRecents(activity), + ) internal enum class RecentsStep { HIDE, SHOW, FORGET, NONE } @@ -243,6 +262,19 @@ object HomeApp { fun isActiveSteamSession(): Boolean = SessionState.running && SessionState.mode == SessionService.MODE_STEAM + fun showFrontEnd(context: Context, intent: Intent = Intent(context, FrontEndActivity::class.java)) { + val frontEnd = FrontEndActivity::class.java.name + val tasks = runCatching { context.getSystemService(android.app.ActivityManager::class.java)?.appTasks }.getOrNull().orEmpty() + val own = tasks.firstOrNull { task -> + runCatching { task.taskInfo.let { it.baseIntent.component?.className == frontEnd && it.topActivity?.className == frontEnd } } + .getOrDefault(false) + } + val launch = Intent(intent).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP) + if (own != null && runCatching { own.startActivity(context, launch, null) }.isSuccess) return + // The session task shares the front end's affinity, so without MULTIPLE_TASK the front end lands inside the session's PiP window. + context.startActivity(launch.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_MULTIPLE_TASK)) + } + fun openSystemHomeSettings(context: Context) { try { context.startActivity(settingsIntent()) diff --git a/app/src/main/java/com/droiddeck/launcher/HomeIcons.kt b/app/src/main/java/com/droiddeck/launcher/HomeIcons.kt new file mode 100644 index 0000000000..d3a57be2b4 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/HomeIcons.kt @@ -0,0 +1,46 @@ +package com.droiddeck.launcher + +import android.content.Context +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.setValue + +object HomeIcons { + private const val PREFS = "home_launcher" + private const val KEY = "icon_overrides" + private const val SEPARATOR = '\t' + + data class Choice(val pack: String, val drawable: String) + + var overrides by mutableStateOf>(emptyMap()) + private set + @Volatile private var loaded = false + + @Synchronized + fun load(context: Context) { + if (loaded) return + overrides = context.getSharedPreferences(PREFS, Context.MODE_PRIVATE) + .getStringSet(KEY, emptySet()).orEmpty().mapNotNull(::decode).toMap() + loaded = true + } + + fun set(context: Context, key: String, pack: String, drawable: String) = save(context, overrides + (key to Choice(pack, drawable))) + + fun clear(context: Context, key: String) = save(context, overrides - key) + + fun clearAll(context: Context) = save(context, emptyMap()) + + private fun save(context: Context, next: Map) { + overrides = next + context.getSharedPreferences(PREFS, Context.MODE_PRIVATE).edit() + .putStringSet(KEY, next.map { (key, choice) -> encode(key, choice) }.toSet()).apply() + } + + internal fun encode(key: String, choice: Choice) = listOf(key, choice.pack, choice.drawable).joinToString(SEPARATOR.toString()) + + internal fun decode(entry: String): Pair? { + val parts = entry.split(SEPARATOR) + if (parts.size != 3 || parts.any { it.isEmpty() }) return null + return parts[0] to Choice(parts[1], parts[2]) + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/IconPack.kt b/app/src/main/java/com/droiddeck/launcher/IconPack.kt new file mode 100644 index 0000000000..227714277e --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/IconPack.kt @@ -0,0 +1,198 @@ +package com.droiddeck.launcher + +import android.content.ComponentName +import android.content.Context +import android.content.Intent +import android.content.pm.PackageManager +import android.content.res.Resources +import android.graphics.Bitmap +import android.graphics.Canvas +import android.graphics.Paint +import android.graphics.PorterDuff +import android.graphics.PorterDuffColorFilter +import android.graphics.PorterDuffXfermode +import android.graphics.Rect +import android.graphics.drawable.Drawable +import android.util.Xml +import androidx.core.content.res.ResourcesCompat +import androidx.core.graphics.createBitmap +import androidx.core.graphics.drawable.toBitmap +import androidx.core.graphics.drawable.toDrawable +import androidx.palette.graphics.Palette +import org.xmlpull.v1.XmlPullParser +import java.time.LocalDate +import kotlin.math.roundToInt + +object IconPack { + const val NONE = "" + private const val PREFS = "home_launcher" + private const val KEY = "icon_pack" + private const val APP_COLORS = "icon_pack_app_colors" + private const val FILTER = "appfilter" + private const val DRAWABLES = "drawable" + + private val ACTIONS = listOf("org.adw.launcher.THEMES", "com.novalauncher.THEME") + + data class Pack(val packageName: String, val label: String) + + internal data class Plate(val back: String?, val mask: String?, val upon: String?, val scale: Float) + + internal data class Filter(val icons: Map, val calendars: Map, val plate: Plate?) { + fun names(component: String, day: Int) = listOfNotNull(calendars[component]?.plus(day), icons[component]) + } + + class Loaded internal constructor( + private val resources: Resources, + internal val pack: String, + internal val updatedAt: Long, + private val filter: Filter, + ) { + fun icon(component: ComponentName, densityDpi: Int) = + filter.names(component.flattenToString(), LocalDate.now().dayOfMonth).firstNotNullOfOrNull { load(resources, pack, it, densityDpi) } + + val hasBack get() = filter.plate?.back != null + + fun plated(icon: Drawable, size: Int, densityDpi: Int, appColor: Boolean): Drawable? { + val plate = filter.plate ?: return null + fun image(name: String?) = name?.let { load(resources, pack, it, densityDpi) }?.toBitmap(size, size) + val base = icon.toBitmap(size, size) + val color = if (appColor) Palette.from(base).generate().getDominantColor(0).takeIf { it != 0 } else null + return compose(base, image(plate.back), image(plate.mask), image(plate.upon), plate.scale, color).toDrawable(resources) + } + } + + @Volatile private var cached: Loaded? = null + + fun selected(context: Context): String = + context.getSharedPreferences(PREFS, Context.MODE_PRIVATE).getString(KEY, NONE).orEmpty() + + fun select(context: Context, pack: String) { + context.getSharedPreferences(PREFS, Context.MODE_PRIVATE).edit().putString(KEY, pack).apply() + } + + fun appColors(context: Context): Boolean = + context.getSharedPreferences(PREFS, Context.MODE_PRIVATE).getBoolean(APP_COLORS, false) + + fun setAppColors(context: Context, on: Boolean) { + context.getSharedPreferences(PREFS, Context.MODE_PRIVATE).edit().putBoolean(APP_COLORS, on).apply() + } + + fun installed(context: Context): List { + val pm = context.packageManager + return ACTIONS.flatMap { pm.queryIntentActivities(Intent(it), 0) } + .map { it.activityInfo.applicationInfo } + .distinctBy { it.packageName } + .filter { app -> resources(pm, app.packageName)?.let { withXml(it, app.packageName, FILTER) { true } } == true } + .map { app -> Pack(app.packageName, app.loadLabel(pm).toString().trim().ifEmpty { app.packageName }) } + .sortedWith(compareBy(String.CASE_INSENSITIVE_ORDER) { it.label }) + } + + fun active(context: Context): Loaded? { + val pack = selected(context) + if (pack == NONE) return null + val pm = context.packageManager + val updatedAt = runCatching { pm.getPackageInfo(pack, 0).lastUpdateTime }.getOrNull() ?: return null + cached?.takeIf { it.pack == pack && it.updatedAt == updatedAt }?.let { return it } + val resources = resources(pm, pack) ?: return null + val filter = withXml(resources, pack, FILTER) { parse(it) } ?: return null + return Loaded(resources, pack, updatedAt, filter).also { cached = it } + } + + fun drawable(context: Context, pack: String, name: String, densityDpi: Int): Drawable? { + val resources = resources(context.packageManager, pack) ?: return null + return load(resources, pack, name, densityDpi) + } + + fun names(context: Context, pack: String): List { + val resources = resources(context.packageManager, pack) ?: return emptyList() + return withXml(resources, pack, DRAWABLES) { parseNames(it) }?.takeIf { it.isNotEmpty() } + ?: withXml(resources, pack, FILTER) { parse(it).icons.values.distinct().sorted() }.orEmpty() + } + + private fun resources(pm: PackageManager, pack: String): Resources? = + runCatching { pm.getResourcesForApplication(pack) }.getOrNull() + + private fun load(resources: Resources, pack: String, name: String, densityDpi: Int): Drawable? { + val id = resources.getIdentifier(name, "drawable", pack).takeIf { it != 0 } + ?: resources.getIdentifier(name, "mipmap", pack).takeIf { it != 0 } + ?: return null + return runCatching { ResourcesCompat.getDrawableForDensity(resources, id, densityDpi, null) }.getOrNull() + } + + internal fun parseNames(xml: XmlPullParser): List { + val names = LinkedHashSet() + forEachTag(xml) { if (xml.name == "item") xml.getAttributeValue(null, "drawable")?.trim()?.takeIf { it.isNotEmpty() }?.let { names.add(it) } } + return names.toList() + } + + internal fun parse(xml: XmlPullParser): Filter { + val icons = HashMap() + val calendars = HashMap() + var back: String? = null + var mask: String? = null + var upon: String? = null + var scale = 1f + fun image() = xml.getAttributeValue(null, "img1")?.trim()?.takeIf { it.isNotEmpty() } + forEachTag(xml) { + when (xml.name) { + "item" -> { + val key = componentKey(xml.getAttributeValue(null, "component")) + val drawable = xml.getAttributeValue(null, "drawable")?.trim() + if (key != null && !drawable.isNullOrEmpty()) icons.putIfAbsent(key, drawable) + } + "calendar" -> { + val key = componentKey(xml.getAttributeValue(null, "component")) + val prefix = xml.getAttributeValue(null, "prefix")?.trim() + if (key != null && !prefix.isNullOrEmpty()) calendars.putIfAbsent(key, prefix) + } + "iconback" -> back = back ?: image() + "iconmask" -> mask = mask ?: image() + "iconupon" -> upon = upon ?: image() + "scale" -> scale = xml.getAttributeValue(null, "factor")?.toFloatOrNull() ?: scale + } + } + return Filter(icons, calendars, if (back == null && mask == null && upon == null) null else Plate(back, mask, upon, scale)) + } + + internal fun compose(icon: Bitmap, back: Bitmap?, mask: Bitmap?, upon: Bitmap?, scale: Float, backColor: Int? = null): Bitmap { + val size = icon.width + val inset = (size * (1 - scale) / 2).roundToInt() + val result = createBitmap(size, size) + val canvas = Canvas(result) + val paint = Paint(Paint.ANTI_ALIAS_FLAG or Paint.FILTER_BITMAP_FLAG) + val full = Rect(0, 0, size, size) + canvas.drawBitmap(icon, null, Rect(inset, inset, size - inset, size - inset), paint) + mask?.let { + paint.xfermode = PorterDuffXfermode(PorterDuff.Mode.DST_OUT) + canvas.drawBitmap(it, null, full, paint) + } + back?.let { + paint.xfermode = PorterDuffXfermode(PorterDuff.Mode.DST_OVER) + paint.colorFilter = backColor?.let { color -> PorterDuffColorFilter(color, PorterDuff.Mode.SRC_IN) } + canvas.drawBitmap(it, null, full, paint) + } + paint.xfermode = null + paint.colorFilter = null + upon?.let { canvas.drawBitmap(it, null, full, paint) } + return result + } + + private inline fun forEachTag(xml: XmlPullParser, block: () -> Unit) { + var event = xml.eventType + while (event != XmlPullParser.END_DOCUMENT) { + if (event == XmlPullParser.START_TAG) block() + event = xml.next() + } + } + + internal fun componentKey(component: String?): String? = + component?.trim()?.removePrefix("ComponentInfo{")?.removeSuffix("}")?.let(ComponentName::unflattenFromString)?.flattenToString() + + private fun withXml(resources: Resources, pack: String, file: String, block: (XmlPullParser) -> T): T? = runCatching { + val xml = resources.getIdentifier(file, "xml", pack) + val raw = resources.getIdentifier(file, "raw", pack) + if (xml != 0) resources.getXml(xml).use(block) + else (if (raw != 0) resources.openRawResource(raw) else resources.assets.open("$file.xml")) + .use { stream -> block(Xml.newPullParser().also { it.setInput(stream, null) }) } + }.getOrNull() +} diff --git a/app/src/main/java/com/droiddeck/launcher/SessionActivity.kt b/app/src/main/java/com/droiddeck/launcher/SessionActivity.kt index 5f39d03c6c..d3e8cf877c 100644 --- a/app/src/main/java/com/droiddeck/launcher/SessionActivity.kt +++ b/app/src/main/java/com/droiddeck/launcher/SessionActivity.kt @@ -151,7 +151,7 @@ import com.droiddeck.launcher.ui.sessionDrawerPages import com.droiddeck.launcher.ui.step import kotlin.math.abs -class SessionActivity : ComponentActivity(), SurfaceHolder.Callback { +class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droiddeck.launcher.ui.AgentPetHost { override fun attachBaseContext(newBase: android.content.Context) { super.attachBaseContext(newBase) com.droiddeck.launcher.core.AppLanguage.applyTo(this, newBase) @@ -159,6 +159,8 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback { private lateinit var pip: com.droiddeck.launcher.session.SessionPipController private var pipUi by mutableStateOf(false) + + override val petBlocked: Boolean get() = drawerOpenState || pipUi || pcKeyboardOpen private var pipAutoEnter by mutableStateOf(false) private var unfoldedControls by mutableStateOf(false) private var unfoldedControlsWithController by mutableStateOf(false) @@ -452,6 +454,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback { private var drawerDefaultProton by mutableStateOf(null) private val drawerComponentMenu by lazy { ComponentsMenu(this, uiHandler) } private var drawerGameProfileId by mutableStateOf(null) + private var drawerGameProfileSelectionMade = false private var fpsLimit by mutableStateOf(SessionState.fpsLimit) private fun noSteamSession(): Boolean = (SessionState.mode == SessionService.MODE_RUN && @@ -460,7 +463,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback { com.droiddeck.launcher.session.NoSteamLaunch.BATTLENET, )) || SessionState.mode == SessionService.MODE_DESKTOP private val drawerGameInventory = GameProfileInventoryCache() - private var drawerGameInventoryRevision = 0L + @Volatile private var drawerGameInventoryRevision = 0L private var drawerGameFexPresetSaving by mutableStateOf(false) private var drawerGameNoSteamSaving by mutableStateOf(false) private val drawerGameProfileFollowState = GameProfileFollowState() @@ -556,8 +559,25 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback { if (r.resultCode == RESULT_OK) InAppFilePicker.pickedFile(r.data)?.let { importLossless(it) } } private var frameGen by mutableStateOf(FrameGen.Mode.OFF) + private var frameGenActiveGameId by mutableStateOf(null) + private var frameGenActiveGameName by mutableStateOf(null) + private var frameGenHasGameOverride by mutableStateOf(false) private var frameGenPip = false private val frameGenRequests = java.util.concurrent.atomic.AtomicInteger() + private val frameGenActivityGeneration = synchronized(frameGenGlobalLock) { + frameGenGlobalGeneration.incrementAndGet() + } + @Volatile private var frameGenActivityActive = true + private val frameGenForcePending = java.util.concurrent.atomic.AtomicBoolean() + @Volatile private var frameGenInventoryIds: Set? = null + @Volatile private var frameGenInventoryRevision = -1L + private val frameGenInventoryLock = Any() + @Volatile private var frameGenInventoryLastAttemptAt = 0L + private val frameGenInventoryRetryScheduled = java.util.concurrent.atomic.AtomicBoolean() + private val frameGenInventoryRefreshScheduled = java.util.concurrent.atomic.AtomicBoolean() + + @Volatile private var appliedFrameGenMode: FrameGen.Mode? = null + @Volatile private var appliedFrameGenHz: Float? = null private var fexPreset by mutableStateOf("") private var suspendPolicy by mutableStateOf(SessionPrefs.SUSPEND_MANUAL) private var steamDownloadsInBackground by mutableStateOf(false) @@ -674,6 +694,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) AgentGuest.readyListener = agentReadyListener + com.droiddeck.launcher.agent.AgentAttachments.gameFrame = gameFrame if (com.droiddeck.launcher.runtime.LinuxRuntimeInstaller.isRemoving() || com.droiddeck.launcher.runtime.LinuxRuntimeInstaller.isMaintaining()) { runtimeRemovalBlocked = true @@ -859,7 +880,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback { hud.attach(root, root.childCount) memoryHud = com.droiddeck.launcher.session.MemoryHud(this) hud.onPresentingWindowChanged = { - if (FrameGen.engine(this) != FrameGen.ENGINE_OFF) CompositorHost.rearmFrameGen { applyFrameGen() } + CompositorHost.rearmFrameGen { applyFrameGen(force = true) } } if (SessionState.running && SessionState.firstFrameSeen) { loading.visible = false @@ -892,8 +913,24 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback { } } glassesScope.launch { com.droiddeck.launcher.handtracking.HandTracking.settings.collect { updateHandCamera() } } glassesScope.launch { + var lastRunGameId: String? = null while (true) { updateTrackingRecovery() + if (SessionState.mode == SessionService.MODE_RUN) { + val gameId = SessionState.gameId + ?.takeIf { it.toLongOrNull() != null } + ?: intent.getStringExtra(SessionService.EXTRA_GAME_ID) + ?.takeIf { it.toLongOrNull() != null } + if (gameId != lastRunGameId) { + lastRunGameId = gameId + if (drawerGameProfileFollowState.followsSteam) { + loadFrameGenFor(gameId?.toLongOrNull()) + } + applyFrameGen() + } + } else { + lastRunGameId = null + } kotlinx.coroutines.delay(100) } } @@ -956,7 +993,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback { applyOutputPacing() if (pipUi != frameGenPip) { frameGenPip = pipUi - if (FrameGen.engine(this@SessionActivity) != FrameGen.ENGINE_OFF && ::surfaceView.isInitialized) applyFrameGen() + if (::surfaceView.isInitialized) applyFrameGen() } } androidx.compose.runtime.LaunchedEffect(AgentGuest.steamKeyboard) { updateOnScreenControls() } @@ -1032,7 +1069,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback { window.setBackgroundDrawable(android.graphics.drawable.ColorDrawable(android.graphics.Color.BLACK)) }, ) - LaunchedEffect(AgentGuest.focusRevision, secondScreenDisplays.isNotEmpty()) { + LaunchedEffect(AgentGuest.focusRevision, secondScreenDisplays.isNotEmpty(), drawerGameInventoryRevision) { val nextGame = kotlinx.coroutines.withContext(kotlinx.coroutines.Dispatchers.IO) { if (SessionState.mode == SessionService.MODE_RUN) SessionState.program?.let { "program:$it" } else { @@ -1045,11 +1082,40 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback { } } } + if (SessionState.mode == SessionService.MODE_STEAM) { + val target = kotlinx.coroutines.withContext(kotlinx.coroutines.Dispatchers.IO) { + val games = LibraryCache.load(this@SessionActivity) + val cachedIds = games.mapNotNull { it.profileKey.toLongOrNull() }.toSet() + val inventoryIds = synchronized(frameGenInventoryLock) { + frameGenInventoryIds + }.orEmpty() + val id = AgentGuest.activeSteamAppId( + this@SessionActivity, cachedIds + inventoryIds + ) + val name = id?.let { activeId -> + games.firstOrNull { it.profileKey == activeId.toString() }?.name + } + id to name + } + if (target.first != frameGenActiveGameId) { + frameGenActiveGameId = target.first + if (drawerGameProfileFollowState.followsSteam) { + loadFrameGenFor(target.first) + } + } + frameGenActiveGameName = target.second + } if (nextGame != gestureGame) { if (nextGame != null) gameStarts++ gestureGame = nextGame refreshGestureConfig() } + if ( + SessionState.mode == SessionService.MODE_STEAM && + CompositorHost.isStarted + ) { + applyFrameGen() + } if (secondScreenDisplays.isNotEmpty()) kotlinx.coroutines.withContext(kotlinx.coroutines.Dispatchers.IO) { runCatching { com.droiddeck.launcher.session.TelemetryOutput.applyAutomatic(this@SessionActivity, nextGame) } } @@ -1234,6 +1300,18 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback { textureAnisotropy = if (drawerGameProfileId == null) textureAnisotropy else drawerTextureAnisotropy, textureLodBias = if (drawerGameProfileId == null) textureLodBias else drawerTextureLodBias, frameGen = frameGen, + frameGenTargetGameId = frameGenTargetGameId()?.toString(), + frameGenTargetGameName = when { + !drawerGameProfileFollowState.followsSteam -> + drawerGameProfileRefresh.data?.profiles + ?.firstOrNull { it.first == frameGenTargetGameId() }?.second + SessionState.mode == SessionService.MODE_STEAM -> frameGenActiveGameName + SessionState.mode == SessionService.MODE_RUN -> + com.droiddeck.launcher.frontend.Library.nameForProgram(SessionState.program) + else -> drawerGameProfileRefresh.data?.profiles + ?.firstOrNull { it.first == frameGenTargetGameId() }?.second + }, + hasGameOverride = frameGenHasGameOverride, lossless = lossless, oscMode = oscMode, suspendPolicy = suspendPolicy, steamDownloadsInBackground = steamDownloadsInBackground, touchMode = touchMode, @@ -1253,7 +1331,9 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback { selectedSecondScreenDisplay = selectedSecondScreenDisplay, onHud = { on -> SessionPrefs.setHudEnabled(this@SessionActivity, on); hudOn = on; hud.refresh() }, onHudSetting = { key, value -> hudConfig = DroidDeckHudConfig.set(this@SessionActivity, key, value); hud.applyConfig() }, + onHudOrder = { switches, order -> hudConfig = DroidDeckHudConfig.choose(this@SessionActivity, switches, order); hud.applyConfig() }, onHudReset = { hudConfig = DroidDeckHudConfig.reset(this@SessionActivity); hud.applyConfig() }, + onHudOrderReset = { hudConfig = DroidDeckHudConfig.clearOrder(this@SessionActivity); hud.applyConfig() }, onHudExport = { exportHudDiagnostics() }, onUpscaler = { m -> SessionPrefs.setUpscaler(this@SessionActivity, m); upscaler = m @@ -1293,9 +1373,22 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback { applyOutputPacing() }, onFrameGenPick = { mode -> - FrameGen.set(this@SessionActivity, mode) + val appId = frameGenTargetGameId() + + if (appId == null) FrameGen.set(this@SessionActivity, mode) + else FrameGen.setForGame(this@SessionActivity, appId.toString(), mode) + loadFrameGenFor(appId) readPrefs() - applyFrameGen() + applyFrameGen(force = true) + }, + onFrameGenReset = { + val appId = frameGenTargetGameId() + + if (appId == null) FrameGen.clearGlobal(this@SessionActivity) + else FrameGen.clearGame(this@SessionActivity, appId.toString()) + loadFrameGenFor(appId) + readPrefs() + applyFrameGen(force = true) }, onImportLossless = { pickLossless.launch(InAppFilePicker.buildIntent( @@ -1628,9 +1721,35 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback { }, "drawer-components").start() } + private fun frameGenTargetGameId(): Long? { + if (!drawerGameProfileFollowState.followsSteam) { + return drawerGameProfileId + } + if (SessionState.mode == SessionService.MODE_RUN) { + return ( + SessionState.gameId?.toLongOrNull() + ?: intent.getStringExtra(SessionService.EXTRA_GAME_ID)?.toLongOrNull() + ) + } + if (SessionState.mode == SessionService.MODE_STEAM) { + return frameGenActiveGameId + } + return drawerGameProfileId + } + + private fun loadFrameGenFor(appId: Long?) { + val profileId = appId?.toString() + frameGen = FrameGen.mode(this, profileId) + frameGenHasGameOverride = appId?.let { + FrameGen.hasGameOverride(this, it.toString()) + } == true + } + private fun selectDrawerGameProfile(appId: Long?) { drawerGameProfileFollowState.selectManually() + drawerGameProfileSelectionMade = true drawerGameProfileId = appId + loadFrameGenFor(frameGenTargetGameId()) drawerGameProfileRefresh = drawerGameProfileRefresh.retrying() readDrawerTextureFiltering(appId) refreshDrawerGameProfile() @@ -1703,6 +1822,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback { if (refresh.followsSteam) { if (drawerGameProfileFollowState.followsSteam) { drawerGameProfileId = result.selectedAppId + loadFrameGenFor(result.selectedAppId) readDrawerTextureFiltering(result.selectedAppId) } } @@ -1727,6 +1847,8 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback { gameProtonId = ProtonDefault.gameSelectedId(this, game.profileKey, protons), gameComponents = ComponentsManager.gameComponents(this, game.profileKey), gameWindowsComponents = WinComponents.picks(this, game.profileKey), + frameGenMode = FrameGen.mode(this, game.profileKey), + frameGenInherited = !FrameGen.hasGameOverride(this, game.profileKey), ) } @@ -1970,7 +2092,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback { if (routedTouchMode != nextRoutedTouchMode) gestureTouchStreamGate.reset() routedTouchMode = nextRoutedTouchMode requestRelativeMouse() - frameGen = FrameGen.mode(this) + loadFrameGenFor(frameGenTargetGameId()) fexPreset = SessionPrefs.fexPreset(this) suspendPolicy = SessionPrefs.suspendPolicy(this, SessionState.mode) steamDownloadsInBackground = SessionPrefs.steamDownloadsInBackground(this) @@ -2114,11 +2236,16 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback { private fun installRuntime(): String? { val release = com.droiddeck.launcher.runtime.LinuxRuntimeInstaller.fetchRelease() - ?: return getString(R.string.session_runtime_catalog_unreachable) + if (release == null) { + SessionEvents.record("runtime.failed", mapOf("step" to "catalog", "reason" to com.droiddeck.launcher.runtime.LinuxRuntimeInstaller.catalogError())) + return getString(R.string.session_runtime_catalog_unreachable) + } runCatching { com.droiddeck.launcher.runtime.RuntimeInstallService.start(this, release) } val ok = com.droiddeck.launcher.runtime.LinuxRuntimeInstaller.install(this, release, progressFor(RUNTIME_LINES, release.size / 1_000_000)) - return if (ok) null else getString(R.string.session_runtime_install_failed) + if (ok) return null + SessionEvents.record("runtime.failed", mapOf("step" to "install", "reason" to com.droiddeck.launcher.runtime.LinuxRuntimeInstaller.installError())) + return getString(R.string.session_runtime_install_failed) } private fun installDesktop(): String? { @@ -2257,7 +2384,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback { if (resized) { cancelTouchGestures() Log.i(TAG, "surface resized to ${width}x$height - rebinding the compositor") - CompositorHost.resize(holder.surface) { applyFrameGen() } + CompositorHost.resize(holder.surface) { applyFrameGen(force = true) } resizeOutputForWindow(width, height) } } @@ -2398,17 +2525,161 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback { } } - private fun applyFrameGen() { + private fun frameGenModeForActiveGame(request: Int): FrameGen.Mode { + if (SessionState.mode == SessionService.MODE_RUN) { + val activeAppId = ( + SessionState.gameId?.takeIf { it.toLongOrNull() != null } + ?: intent.getStringExtra(SessionService.EXTRA_GAME_ID) + )?.toLongOrNull() + return FrameGen.mode(this, activeAppId?.toString()) + } + + val cachedIds = LibraryCache.load(this) + .mapNotNull { it.profileKey.toLongOrNull() } + .toSet() + + var inventoryRevision = drawerGameInventoryRevision + var ids = synchronized(frameGenInventoryLock) { + if (frameGenInventoryRevision != inventoryRevision) { + frameGenInventoryIds = null + frameGenInventoryRevision = inventoryRevision + frameGenInventoryLastAttemptAt = 0L + } + frameGenInventoryIds + } + if (ids == null) { + val now = SystemClock.elapsedRealtime() + val shouldScan = synchronized(frameGenInventoryLock) { + val currentRevision = drawerGameInventoryRevision + if (frameGenInventoryRevision != currentRevision) { + frameGenInventoryIds = null + frameGenInventoryRevision = currentRevision + frameGenInventoryLastAttemptAt = 0L + } + inventoryRevision = currentRevision + if (frameGenInventoryIds != null) { + false + } else if ( + frameGenInventoryLastAttemptAt != 0L && + now - frameGenInventoryLastAttemptAt < 15_000L + ) { + false + } else { + frameGenInventoryLastAttemptAt = now + true + } + } + + if (shouldScan) { + val currentIds = runCatching { + Library.launchableGames(this, strictRead = true) + .mapNotNull { it.profileKey.toLongOrNull() } + .toSet() + }.getOrNull() + + if (currentIds == null) { + if (frameGenInventoryRetryScheduled.compareAndSet(false, true)) { + uiHandler.postDelayed({ + frameGenInventoryRetryScheduled.set(false) + val retry = synchronized(frameGenInventoryLock) { + frameGenInventoryIds == null + } + if (retry && !isFinishing && !isDestroyed) { + applyFrameGen() + } + }, 15_000L) + } + } else { + var published = false + synchronized(frameGenInventoryLock) { + if (drawerGameInventoryRevision == inventoryRevision && + frameGenInventoryRevision == inventoryRevision + ) { + ids = cachedIds + currentIds + frameGenInventoryIds = ids + published = true + } + } + if (published) { + if (frameGenInventoryRefreshScheduled.compareAndSet(false, true)) { + uiHandler.postDelayed({ + frameGenInventoryRefreshScheduled.set(false) + if (frameGenActivityActive && !isFinishing && !isDestroyed) { + synchronized(frameGenInventoryLock) { + frameGenInventoryIds = null + frameGenInventoryLastAttemptAt = 0L + } + applyFrameGen() + } + }, 15_000L) + } + if (frameGenRequests.get() != request) { + applyFrameGen() + } + } + } + } + + if (ids == null) { + ids = synchronized(frameGenInventoryLock) { + frameGenInventoryIds + } ?: emptySet() + } + } + + val activeAppId = AgentGuest.activeSteamAppId( + this, cachedIds + (ids ?: emptySet()) + ) + if (activeAppId == null) return FrameGen.Mode.OFF + return FrameGen.mode(this, activeAppId.toString()) + } + + private fun applyFrameGen(force: Boolean = false) { + val request = synchronized(frameGenGlobalLock) { + if (force) frameGenForcePending.set(true) + frameGenRequests.incrementAndGet() + } val hz = refreshHz() val pip = pipUi && mirrorRefreshLimit() <= 0 - val request = frameGenRequests.incrementAndGet() Thread({ - val problem = synchronized(frameGenRequests) { + val mode = if (pip) FrameGen.Mode.OFF else frameGenModeForActiveGame(request) + val needsApply = synchronized(frameGenGlobalLock) { + if (frameGenActivityGeneration != frameGenGlobalGeneration.get()) return@Thread if (request != frameGenRequests.get()) return@Thread - if (pip) FrameGen.apply(this, FrameGen.Mode.OFF, hz) else FrameGen.apply(this, hz) + if (!frameGenActivityActive || isFinishing || isDestroyed) return@Thread + val lastAppliedHz = appliedFrameGenHz + frameGenForcePending.get() || appliedFrameGenMode == null || + mode != appliedFrameGenMode || lastAppliedHz == null || + kotlin.math.abs(lastAppliedHz - hz) > 0.1f + } + val prepared = if (needsApply) FrameGen.prepareApply(this, mode) else null + val problem = synchronized(frameGenGlobalLock) { + if (frameGenActivityGeneration != frameGenGlobalGeneration.get()) return@Thread + if (request != frameGenRequests.get()) return@Thread + if (!frameGenActivityActive || isFinishing || isDestroyed) return@Thread + val forcePending = frameGenForcePending.get() + val lastAppliedHz = appliedFrameGenHz + if (!forcePending && appliedFrameGenMode != null && mode == appliedFrameGenMode && + lastAppliedHz != null && kotlin.math.abs(lastAppliedHz - hz) <= 0.1f + ) { + null + } else { + val ready = prepared ?: return@Thread + frameGenForcePending.set(false) + FrameGen.applyPrepared(this, ready, hz).also { problem -> + if (problem == null) { + appliedFrameGenMode = mode + appliedFrameGenHz = hz + } else { + appliedFrameGenMode = null + appliedFrameGenHz = null + } + } + } } val state = Lossless.state(this) runOnUiThread { + if (frameGenActivityGeneration != frameGenGlobalGeneration.get()) return@runOnUiThread lossless = state if (problem != null) Toast.makeText(this, problem, Toast.LENGTH_LONG).show() } @@ -2425,12 +2696,13 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback { private fun importLossless(dll: File) { Thread({ - val message = Lossless.message(this, Lossless.import(this, dll)) + val result = Lossless.import(this, dll) + val message = Lossless.message(this, result) val state = Lossless.state(this) runOnUiThread { lossless = state Toast.makeText(this, message, Toast.LENGTH_LONG).show() - if (FrameGen.engine(this) == FrameGen.ENGINE_LSFG) applyFrameGen() + applyFrameGen(force = result == Lossless.ImportResult.UPDATED) } }, "lossless-import").start() } @@ -2637,6 +2909,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback { override fun dispatchKeyEvent(event: KeyEvent): Boolean { + if (com.droiddeck.launcher.ui.AgentPet.handleBack(this, event)) return true when (event.keyCode) { KeyEvent.KEYCODE_VOLUME_UP, KeyEvent.KEYCODE_VOLUME_DOWN, KeyEvent.KEYCODE_VOLUME_MUTE -> { val steamVolume = @@ -3492,37 +3765,46 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback { runningGame = { gestureGame }, )) - private fun captureScreenshot(onDone: (Boolean) -> Unit) { + private fun captureScreenshot(onDone: (Boolean) -> Unit) = copyGameFrame { bitmap -> + if (bitmap == null) { + onDone(false) + return@copyGameFrame + } + Thread { + val saved = com.droiddeck.launcher.session.BottomScreenshots.save(applicationContext, bitmap) + bitmap.recycle() + runOnUiThread { onDone(saved) } + }.start() + } + + private val gameFrame: ((android.graphics.Bitmap?) -> Unit) -> Unit = { copyGameFrame(it) } + + /** The game's own surface, without anything DroidDeck draws over it; the caller recycles the bitmap. */ + private fun copyGameFrame(onFrame: (android.graphics.Bitmap?) -> Unit) { val source = if (glassesOutputActive) glassesScreen?.surfaceView else if (bottomOutputActive) bottomGame?.surfaceView else if (::surfaceView.isInitialized) surfaceView else null val width = source?.width ?: 0 val height = source?.height ?: 0 if (source == null || width <= 0 || height <= 0 || source.holder.surface?.isValid != true) { - onDone(false) + onFrame(null) return } val bitmap = try { android.graphics.Bitmap.createBitmap(width, height, android.graphics.Bitmap.Config.ARGB_8888) } catch (_: OutOfMemoryError) { - onDone(false) + onFrame(null) return } try { android.view.PixelCopy.request(source, bitmap, { result -> if (result != android.view.PixelCopy.SUCCESS) { bitmap.recycle() - onDone(false) - return@request - } - Thread { - val saved = com.droiddeck.launcher.session.BottomScreenshots.save(applicationContext, bitmap) - bitmap.recycle() - runOnUiThread { onDone(saved) } - }.start() + onFrame(null) + } else onFrame(bitmap) }, uiHandler) } catch (_: IllegalArgumentException) { bitmap.recycle() - onDone(false) + onFrame(null) } } @@ -4708,12 +4990,14 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback { override fun onResume() { super.onResume() + drawerGameInventoryRevision++ com.droiddeck.launcher.input.SystemKeyCapture.attach(this, { hasWindowFocus() && !appUiOwnsPointer() && CompositorHost.isStarted }) { event -> com.droiddeck.launcher.input.GuestKeys.send(event) { code, down -> sendGuestKey(code, down, 8) } } if (refreshActivityDisplayId() && started) { SessionService.setActivityDisplay(this, sessionActivityDisplayId) } + if (CompositorHost.isStarted) applyFrameGen(force = true) applyFollowOrientation(resources.configuration) if (runtimeRemovalBlocked) return if (!SessionState.suspended) pausedFrame = null @@ -5391,7 +5675,12 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback { } override fun onDestroy() { + synchronized(frameGenGlobalLock) { + frameGenActivityActive = false + frameGenRequests.incrementAndGet() + } if (AgentGuest.readyListener === agentReadyListener) AgentGuest.readyListener = null + if (com.droiddeck.launcher.agent.AgentAttachments.gameFrame === gameFrame) com.droiddeck.launcher.agent.AgentAttachments.gameFrame = null com.droiddeck.launcher.input.HomeButtonShortcuts.detach(this) relativeMouseRequests.shutdownNow() backQamInput.cancel() @@ -5505,6 +5794,8 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback { private const val BOTTOM_RECOVERY_MS = 1_000L private const val BOTTOM_RECOVERY_TRIES = 3 private const val TAG = "SessionActivity" + private val frameGenGlobalLock = Any() + private val frameGenGlobalGeneration = java.util.concurrent.atomic.AtomicLong(0L) private var startedScreens = 0 @Volatile private var activeInstallWorker: Any? = null private const val FEX_MISSING = "droiddeck-fex: x86 Linux programs need" diff --git a/app/src/main/java/com/droiddeck/launcher/UpdatesMenu.kt b/app/src/main/java/com/droiddeck/launcher/UpdatesMenu.kt index 5eb9ff4500..ff04640e91 100644 --- a/app/src/main/java/com/droiddeck/launcher/UpdatesMenu.kt +++ b/app/src/main/java/com/droiddeck/launcher/UpdatesMenu.kt @@ -17,6 +17,7 @@ import com.droiddeck.launcher.ui.UpdatesActions import com.droiddeck.launcher.ui.UpdatesState import com.droiddeck.launcher.update.AppUpdates import com.droiddeck.launcher.update.SelfInstaller +import com.droiddeck.launcher.update.UpdateWatch internal class UpdatesMenu(private val activity: Activity, private val ui: Handler) { var catalog by mutableStateOf(null) @@ -43,6 +44,7 @@ internal class UpdatesMenu(private val activity: Activity, private val ui: Handl .onFailure { error = activity.getString(R.string.upd_unknown_apps_failed); pending = null } }, onDismissPermission = { askPermission = false; pending = null }, + onSeen = { r -> UpdateWatch.seen(activity, r) }, ) val hasUpdate: Boolean get() = AppUpdates.hasUpdate(catalog, follow) @@ -77,6 +79,7 @@ internal class UpdatesMenu(private val activity: Activity, private val ui: Handl private fun choose(f: AppUpdates.Follow) { AppUpdates.setFollow(activity, f) + UpdateWatch.sync(activity, f, catalog?.let { AppUpdates.release(it, f) }) follow = f error = null } diff --git a/app/src/main/java/com/droiddeck/launcher/agent/AgentAccess.kt b/app/src/main/java/com/droiddeck/launcher/agent/AgentAccess.kt index b755ca6466..2113161467 100644 --- a/app/src/main/java/com/droiddeck/launcher/agent/AgentAccess.kt +++ b/app/src/main/java/com/droiddeck/launcher/agent/AgentAccess.kt @@ -23,7 +23,7 @@ object AgentAccess { fun requireCommands(context: Context) { if (!commandsAllowed(context)) throw AgentException( "AGENT_COMMANDS_DISABLED", - "Debugging tools are off: turn on Setup > Diagnostics > Debugging tools on the device", + "Debugging tools are off: turn on Setup > Developer > Debugging tools on the device", ) } diff --git a/app/src/main/java/com/droiddeck/launcher/agent/AgentAdb.kt b/app/src/main/java/com/droiddeck/launcher/agent/AgentAdb.kt new file mode 100644 index 0000000000..223bb07a8c --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/agent/AgentAdb.kt @@ -0,0 +1,44 @@ +package com.droiddeck.launcher.agent + +import android.content.Context +import com.droiddeck.launcher.core.WirelessAdbFix +import com.droiddeck.launcher.runtime.LinuxRuntime +import java.io.File + +/** + * Loopback adb for the agent, so droiddeckctl in the Linux userland reaches the app. It reuses + * the Wireless debugging pairing DroidDeck already made (for the phantom process fix): the paired + * key goes to the guest as an adb vendor key, and the serial is the paired TLS connect port. + * Without a pairing it falls back to adbd on 127.0.0.1:5555, which some devices and `adb tcpip` + * leave listening. + */ +object AgentAdb { + data class Link(val serial: String, val vendorKeys: String, val paired: Boolean) + + private const val LEGACY = "127.0.0.1:5555" + private const val VENDOR_KEY = "/root/.android/droiddeck-paired.adbkey" + + /** The display the browser opens on for sign-ins: the one the agent is being used on. */ + @Volatile var browserDisplay = 0 + + /** Blocks while it looks up the connect port when none is saved; call it off the main thread. */ + fun prepare(app: Context): Link { + val key = File(app.noBackupFilesDir, "wireless-adb-key.pem") + val address = WirelessAdbFix.liveConnectAddress(app) ?: WirelessAdbFix.savedConnectionAddress(app) + if (address == null || !key.isFile) return Link(LEGACY, VENDOR_KEY, false) + val guestKey = File(LinuxRuntime.rootDir(app), VENDOR_KEY.removePrefix("/")) + runCatching { + if (!guestKey.isFile || !guestKey.readBytes().contentEquals(key.readBytes())) { + guestKey.parentFile?.mkdirs() + guestKey.writeBytes(key.readBytes()) + guestKey.setReadable(false, false) + guestKey.setReadable(true, true) + } + } + val host = address.substringBeforeLast(':') + val port = address.substringAfterLast(':').toIntOrNull() + ?: WirelessAdbFix.findConnectPort(app, host.trim('[', ']')) + ?: return Link(LEGACY, VENDOR_KEY, false) + return Link("$host:$port", VENDOR_KEY, true) + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/agent/AgentAttachments.kt b/app/src/main/java/com/droiddeck/launcher/agent/AgentAttachments.kt new file mode 100644 index 0000000000..b4f9a09dff --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/agent/AgentAttachments.kt @@ -0,0 +1,87 @@ +package com.droiddeck.launcher.agent + +import android.content.Context +import android.graphics.Bitmap +import android.net.Uri +import android.provider.OpenableColumns +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateListOf +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.setValue +import com.droiddeck.launcher.runtime.LinuxRuntime +import java.io.File + +/** + * Files the user attaches to a message, copied into the Linux userland so the agent's own tools + * can read them (Claude Code's Read shows images and PDFs to the model). + */ +object AgentAttachments { + /** Guest paths waiting to go with the next message. */ + val pending = mutableStateListOf() + + private const val NEW = "new" + private const val GUEST_DIR = "/root/.cache/droiddeck/attachments" + private val IMAGE = setOf("png", "jpg", "jpeg", "webp", "gif", "bmp") + + fun hostDir(context: Context) = File(LinuxRuntime.rootDir(context.applicationContext), GUEST_DIR.removePrefix("/")) + + fun host(context: Context, guestPath: String) = File(LinuxRuntime.rootDir(context.applicationContext), guestPath.removePrefix("/")) + + fun isImage(path: String) = path.substringAfterLast('.', "").lowercase() in IMAGE + + /** Copies [uris] for [chat] (or a new conversation) on the calling thread; returns their guest paths. */ + fun copy(context: Context, chat: String?, uris: List): List { + val app = context.applicationContext + val folder = chat ?: NEW + val dir = File(hostDir(app), folder).apply { mkdirs() } + return uris.mapNotNull { uri -> + runCatching { + val name = displayName(app, uri).replace(Regex("[^A-Za-z0-9._-]"), "_").ifEmpty { "file" } + var target = File(dir, name) + var n = 1 + while (target.exists()) target = File(dir, "${name.substringBeforeLast('.')}-${n++}${name.substringAfterLast('.', "").let { if (it.isEmpty()) "" else ".$it" }}") + app.contentResolver.openInputStream(uri)!!.use { input -> target.outputStream().use { input.copyTo(it) } } + "$GUEST_DIR/$folder/${target.name}" + }.getOrNull() + } + } + + /** Moves files attached before [chat] existed into its folder, so deleting the chat removes them; returns their new guest paths. */ + fun adopt(context: Context, chat: String, files: List): List = files.map { path -> + if (!path.startsWith("$GUEST_DIR/$NEW/")) return@map path + val dir = File(hostDir(context), chat).apply { mkdirs() } + val moved = File(dir, path.substringAfterLast('/')) + if (host(context, path).renameTo(moved)) "$GUEST_DIR/$chat/${moved.name}" else path + } + + /** Copies the running game's frame; set while a session is open. */ + var gameFrame by mutableStateOf<(((Bitmap?) -> Unit) -> Unit)?>(null) + + /** Saves [frame] for [chat] (or a new conversation) on the calling thread; returns its guest path. */ + fun saveFrame(context: Context, chat: String?, frame: Bitmap): String? = runCatching { + val folder = chat ?: NEW + val dir = File(hostDir(context), folder).apply { mkdirs() } + val target = File(dir, "game-${System.currentTimeMillis()}.jpg") + val written = target.outputStream().use { frame.compress(Bitmap.CompressFormat.JPEG, 88, it) } + if (!written) { + target.delete() + return@runCatching null + } + "$GUEST_DIR/$folder/${target.name}" + }.getOrNull() + + /** Deletes copies that will not be sent. */ + fun discard(context: Context, files: List) = files.forEach { host(context, it).delete() } + + /** The message the CLI gets: the user's text, then where the attached files are. */ + fun prompt(text: String, files: List): String { + if (files.isEmpty()) return text + val list = files.joinToString("\n") { "- $it" } + return "$text\n\nAttached files (read them with your tools):\n$list".trim() + } + + private fun displayName(context: Context, uri: Uri): String = + context.contentResolver.query(uri, arrayOf(OpenableColumns.DISPLAY_NAME), null, null, null)?.use { c -> + if (c.moveToFirst()) c.getString(0) else null + } ?: uri.lastPathSegment?.substringAfterLast('/') ?: "file" +} diff --git a/app/src/main/java/com/droiddeck/launcher/agent/AgentBridgeProvider.kt b/app/src/main/java/com/droiddeck/launcher/agent/AgentBridgeProvider.kt index c1955caa05..93922c8050 100644 --- a/app/src/main/java/com/droiddeck/launcher/agent/AgentBridgeProvider.kt +++ b/app/src/main/java/com/droiddeck/launcher/agent/AgentBridgeProvider.kt @@ -85,6 +85,10 @@ class AgentBridgeProvider : ContentProvider() { AgentAccess.requireCommands(context) guest(context, JSONObject(request.toString()).put("kind", "exec"), timeoutMs(request, 30.0, 10_000)) } + "native" -> { + AgentAccess.requireCommands(context) + AgentNative.run(context, request, timeoutMs(request, 30.0, 0)) + } "cdp" -> { AgentAccess.requireCommands(context) guest(context, JSONObject(request.toString()).put("kind", "cdp"), timeoutMs(request, 15.0, 5_000)) @@ -284,6 +288,8 @@ class AgentBridgeProvider : ContentProvider() { return JSONObject() .put("schema", SCHEMA) .put("build", BuildConfig.BUILD_LABEL) + .put("apkCommit", com.droiddeck.launcher.lab.LabOverlay.apkCommit) + .put("lab", com.droiddeck.launcher.lab.LabOverlay.active?.label ?: JSONObject.NULL) .put("appVersion", context.packageManager.getPackageInfo(context.packageName, 0).versionName) .put("runtime", JSONObject() .put("installed", LinuxRuntime.isInstalled(context)) diff --git a/app/src/main/java/com/droiddeck/launcher/agent/AgentCallReceiver.kt b/app/src/main/java/com/droiddeck/launcher/agent/AgentCallReceiver.kt index 6ef8b2d4ba..b7af5c5b1a 100644 --- a/app/src/main/java/com/droiddeck/launcher/agent/AgentCallReceiver.kt +++ b/app/src/main/java/com/droiddeck/launcher/agent/AgentCallReceiver.kt @@ -4,6 +4,7 @@ import android.content.BroadcastReceiver import android.content.Context import android.content.Intent import android.os.Bundle +import androidx.annotation.VisibleForTesting import java.io.File /** @@ -17,9 +18,17 @@ class AgentCallReceiver : BroadcastReceiver() { val id = intent.getStringExtra("id")?.takeIf { it.matches(Regex("[A-Za-z0-9_-]{1,64}")) } ?: return val arg = intent.getStringExtra("arg") val request = intent.getStringExtra(AgentBridgeProvider.EXTRA_REQUEST) - val pending = goAsync() - Thread({ - val json = try { + val app = context.applicationContext + // The caller waits for the answer file, not for the broadcast. Holding the broadcast open + // with goAsync() for a call that outlasts the broadcast timeout (10 s in the foreground) + // makes Android report the app as not responding. + Thread({ answer(app, method, id, call(app, method, arg, request)) }, "agent-call-$id").start() + } + + companion object { + @VisibleForTesting + internal var call: (Context, String, String?, String?) -> String = { context, method, arg, request -> + try { val extras = Bundle().apply { putString(AgentBridgeProvider.EXTRA_REQUEST, request) } context.contentResolver.call("${context.packageName}.agent", method, arg, extras) ?.getString(AgentBridgeProvider.RESULT_JSON) ?: """{"ok":false,"error":{"code":"NO_RESPONSE","message":"no response"}}""" @@ -27,15 +36,16 @@ class AgentCallReceiver : BroadcastReceiver() { org.json.JSONObject().put("ok", false) .put("error", org.json.JSONObject().put("code", "COMMAND_FAILED").put("message", e.message ?: e.javaClass.simpleName)).toString() } + } + + private fun answer(context: Context, method: String, id: String, json: String) { try { val dir = File(context.getExternalFilesDir(null), "agent-calls").apply { mkdirs() } File(dir, "$id.json.part").writeText(json) File(dir, "$id.json.part").renameTo(File(dir, "$id.json")) } catch (e: Exception) { android.util.Log.w("AgentCallReceiver", "could not write the answer to $method: ${e.message}") - } finally { - pending.finish() } - }, "agent-call-$id").start() + } } } diff --git a/app/src/main/java/com/droiddeck/launcher/agent/AgentChats.kt b/app/src/main/java/com/droiddeck/launcher/agent/AgentChats.kt new file mode 100644 index 0000000000..be9be4fd0e --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/agent/AgentChats.kt @@ -0,0 +1,159 @@ +package com.droiddeck.launcher.agent + +import android.content.Context +import androidx.annotation.VisibleForTesting +import com.droiddeck.launcher.agent.AgentHost.Entry +import org.json.JSONArray +import org.json.JSONObject +import java.io.File + +/** + * Conversations kept on the device, one JSON Lines file each in `files/agent/chats`: a header + * line with the harness, a line with the CLI's conversation id once it has one, then the entries. + */ +object AgentChats { + data class Chat(val id: String, val harness: String, val title: String, val updated: Long) + + class Loaded(val harness: String?, val conversation: String?, val entries: List) + + private const val MAX_OUTPUT = 24_000 + + fun dir(context: Context) = File(context.filesDir, "agent/chats") + + fun file(context: Context, id: String) = File(dir(context), "$id.jsonl") + + fun newId(context: Context): String { + var stamp = System.currentTimeMillis() + while (file(context, stamp.toString()).exists()) stamp++ + return stamp.toString() + } + + /** Newest first; chats with nothing asked yet are left out. */ + fun list(context: Context): List = dir(context).listFiles { f -> f.name.endsWith(".jsonl") }.orEmpty() + .mapNotNull { f -> + val loaded = read(f) + val title = loaded.entries.firstNotNullOfOrNull { (it as? Entry.Asked)?.text } ?: return@mapNotNull null + Chat(f.name.removeSuffix(".jsonl"), loaded.harness ?: ClaudeCode.id, title.lineSequence().first().take(120), f.lastModified()) + } + .sortedByDescending { it.updated } + + /** The chats among [chats] where the user or the agent wrote [query], ignoring case. */ + fun search(context: Context, chats: List, query: String): List { + val q = query.trim() + if (q.isEmpty()) return chats + return chats.filter { chat -> + chat.title.contains(q, ignoreCase = true) || read(file(context, chat.id)).entries.any { matches(it, q) } + } + } + + internal fun matches(entry: Entry, query: String) = when (entry) { + is Entry.Asked -> entry.text.contains(query, ignoreCase = true) + is Entry.Said -> entry.text.contains(query, ignoreCase = true) + else -> false + } + + fun delete(context: Context, id: String) { + file(context, id).delete() + File(AgentAttachments.hostDir(context), id).deleteRecursively() + } + + fun start(file: File, harness: String) { + file.parentFile?.mkdirs() + file.writeText(JSONObject().put("harness", harness).toString() + "\n") + } + + fun appendConversation(file: File, conversation: String) = + runCatching { file.appendText(JSONObject().put("conversation", conversation).toString() + "\n") } + + fun append(file: File, entry: Entry) = runCatching { file.appendText(encode(entry) + "\n") } + + /** The transcript before chats were kept, moved into the first chat. */ + fun migrate(context: Context, harness: String, conversation: String?): String? { + val old = File(context.filesDir, "agent/transcript.jsonl") + if (!old.isFile) return null + val id = newId(context) + val target = file(context, id) + start(target, harness) + conversation?.let { appendConversation(target, it) } + target.appendText(old.readText()) + old.delete() + return id + } + + @VisibleForTesting + internal fun encode(entry: Entry): String = when (entry) { + is Entry.Asked -> JSONObject().put("asked", entry.text).apply { if (entry.files.isNotEmpty()) put("files", JSONArray(entry.files)) } + is Entry.Said -> JSONObject().put("said", entry.text) + is Entry.Thought -> JSONObject().put("thought", entry.text) + is Entry.Result -> JSONObject().put("result", entry.id).put("output", entry.output).put("failed", entry.failed) + is Entry.Used -> JSONObject().put("used", entry.tool).put("detail", entry.detail).put("id", entry.id).put("input", entry.input) + .apply { if (entry.parent.isNotEmpty()) put("parent", entry.parent) } + .apply { entry.output?.let { put("output", it).put("failed", entry.failed) } } + is Entry.Finished -> JSONObject().put("finished", true).put("error", entry.error ?: JSONObject.NULL).put("stopped", entry.stopped).apply { + if (entry.planned) put("planned", true) + entry.usage?.let { + put("ms", it.durationMs).put("cost", it.costUsd).put("in", it.inputTokens).put("out", it.outputTokens) + if (it.context > 0) put("ctx", it.context).put("win", it.window) + } + } + }.toString() + + @VisibleForTesting + internal fun read(file: File): Loaded { + var harness: String? = null + var conversation: String? = null + val entries = mutableListOf() + runCatching { + file.forEachLine { line -> + val o = runCatching { JSONObject(line) }.getOrNull() ?: return@forEachLine + when { + o.has("harness") -> harness = o.getString("harness") + o.has("conversation") -> conversation = o.getString("conversation") + else -> decode(o)?.let { merge(entries, it) } + } + } + } + return Loaded(harness, conversation, entries) + } + + private fun decode(o: JSONObject): Entry? = when { + o.has("asked") -> Entry.Asked(o.getString("asked"), o.optJSONArray("files")?.let { a -> (0 until a.length()).map { a.getString(it) } }.orEmpty()) + o.has("said") -> Entry.Said(o.getString("said")) + o.has("thought") -> Entry.Thought(o.getString("thought")) + o.has("used") -> Entry.Used(o.optString("id"), o.getString("used"), o.optString("detail"), o.optString("input"), + if (o.has("output")) o.optString("output") else null, o.optBoolean("failed"), o.optString("parent")) + o.has("result") -> Entry.Result(o.getString("result"), o.optString("output"), o.optBoolean("failed")) + o.has("finished") -> Entry.Finished( + if (o.isNull("error")) null else o.optString("error"), o.optBoolean("stopped"), + if (o.has("ms")) AgentHost.Usage(o.optLong("ms"), o.optDouble("cost", 0.0), o.optLong("in"), o.optLong("out"), o.optLong("ctx"), o.optLong("win")) else null, + o.optBoolean("planned"), + ) + else -> null + } + + /** + * A tool's result is shown on the call it answers, and a call seen again (an updated todo list) + * replaces it. Only the current turn is searched: Codex numbers its items again in each process. + */ + fun merge(entries: MutableList, entry: Entry): Boolean { + val turn = entries.indexOfLast { it is Entry.Asked } + if (entry is Entry.Used && entry.id.isNotEmpty()) { + val same = entries.indexOfLast { it is Entry.Used && it.id == entry.id } + if (same > turn) { + entries[same] = entry + return true + } + } + if (entry !is Entry.Result) { + entries += entry + return true + } + val index = entries.indexOfLast { it is Entry.Used && it.id == entry.id && entry.id.isNotEmpty() } + if (index <= turn) return false + entries[index] = (entries[index] as Entry.Used).copy(output = clip(entry.output), failed = entry.failed) + return true + } + + /** Long outputs keep their end, where errors and summaries usually are. */ + fun clip(output: String) = if (output.length <= MAX_OUTPUT) output else "โ€ฆ\n" + output.takeLast(MAX_OUTPUT) +} diff --git a/app/src/main/java/com/droiddeck/launcher/agent/AgentHarness.kt b/app/src/main/java/com/droiddeck/launcher/agent/AgentHarness.kt new file mode 100644 index 0000000000..d1d58e98db --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/agent/AgentHarness.kt @@ -0,0 +1,389 @@ +package com.droiddeck.launcher.agent + +import androidx.annotation.VisibleForTesting +import org.json.JSONArray +import org.json.JSONObject +import java.io.File + +/** One coding agent CLI in the Linux userland, run one process per turn. */ +interface AgentHarness { + val id: String + val name: String + /** Absolute guest path of the CLI. */ + val binary: String + /** Guest paths of everything the CLI needs installed, [binary] included. */ + val files: List get() = listOf(binary) + /** A guest shell script that installs the CLI. */ + val install: String + /** A guest command whose exit status is 0 when the CLI is signed in. */ + val signedIn: List + /** A guest command that signs in through $BROWSER. */ + val signIn: List + /** Whether [Options.plan] means anything to this CLI. */ + val plans: Boolean + /** Reasoning effort levels the CLI accepts, lowest first; empty when it has none. */ + val efforts: List + /** Models to offer besides the CLI's default; [rootfs] is where the CLI's own files can be read. */ + fun models(rootfs: File): List + /** The guest command for one turn; [conversation] is null for the first one. */ + fun turn(message: String, conversation: String?, options: Options): List + /** One line of the CLI's output, or null when it carries nothing to show. */ + fun parse(line: String): AgentEvent? + /** Sets the CLI's own defaults in the userland before it runs; [rootfs] is the userland's root. */ + fun prepare(rootfs: File) {} + /** Context and plan limits the CLI keeps on disk rather than printing, read once a turn of [conversation] is done. */ + fun usage(rootfs: File, conversation: String?): AgentEvent? = null + + data class Model(val id: String, val label: String) + + data class Options(val model: String? = null, val plan: Boolean = false, val brief: String? = null, val effort: String? = null) + + companion object { + val all: List = listOf(ClaudeCode, Codex) + fun byId(id: String?): AgentHarness = all.firstOrNull { it.id == id } ?: ClaudeCode + } +} + +/** What one line of output carries: whole entries, or text still being written. */ +data class AgentEvent( + val conversation: String? = null, + val entries: List = emptyList(), + val text: String? = null, + val thinking: String? = null, + /** Tokens the conversation's context holds after this step. */ + val context: Long? = null, + /** Tokens the model's context can hold. */ + val window: Long? = null, + val limits: List? = null, + val usage: AgentHost.Usage? = null, +) + +/** Claude Code: `claude -p` with stream-json output, resumed by session id. */ +object ClaudeCode : AgentHarness { + override val id = "claude" + override val name = "Claude Code" + override val binary = "/root/.local/bin/claude" + override val install = "curl -fsSL https://claude.ai/install.sh | bash" + override val signedIn = listOf("sh", "-c", "$binary auth status | grep -q '\"loggedIn\": true'") + override val signIn = listOf(binary, "auth", "login", "--claudeai") + override val plans = true + override val efforts = listOf("low", "medium", "high", "xhigh", "max") + + /** + * Commits and pull requests the agent makes carry no Claude Code credit or co-author line by + * default. Only keys the user has not set are written, so their own choice stays. + */ + override fun prepare(rootfs: File) { + val file = File(rootfs, "root/.claude/settings.json") + val settings = if (file.exists()) runCatching { JSONObject(file.readText()) }.getOrNull() ?: return else JSONObject() + var changed = false + if (!settings.has("includeCoAuthoredBy")) { + settings.put("includeCoAuthoredBy", false) + changed = true + } + if (!settings.has("attribution")) { + settings.put("attribution", JSONObject().put("commit", "").put("pr", "")) + changed = true + } + if (changed) runCatching { + file.parentFile?.mkdirs() + file.writeText(settings.toString(2) + "\n") + } + } + + override fun models(rootfs: File) = listOf( + AgentHarness.Model("opus", "Opus"), AgentHarness.Model("sonnet", "Sonnet"), AgentHarness.Model("haiku", "Haiku"), + ) + + // DroidDeck runs the agent unattended on the user's own device; permission prompts have no one to answer them. + override fun turn(message: String, conversation: String?, options: AgentHarness.Options) = buildList { + addAll(listOf(binary, "-p", message, "--output-format", "stream-json", "--verbose", "--include-partial-messages")) + addAll(listOf("--permission-mode", if (options.plan) "plan" else "bypassPermissions")) + options.model?.let { addAll(listOf("--model", it)) } + options.effort?.let { addAll(listOf("--effort", it)) } + options.brief?.let { addAll(listOf("--append-system-prompt", it)) } + if (conversation != null) addAll(listOf("--resume", conversation)) + } + + override fun parse(line: String): AgentEvent? { + val o = runCatching { JSONObject(line) }.getOrNull() ?: return null + val conversation = o.optString("session_id").takeIf { it.isNotEmpty() } + // A subagent's messages carry the call that started it; only its tool calls are shown, under that call. + val parent = o.optString("parent_tool_use_id").takeIf { it.isNotEmpty() && it != "null" } + return when (o.optString("type")) { + "stream_event" -> { + if (parent != null) return null + val delta = o.optJSONObject("event")?.takeIf { it.optString("type") == "content_block_delta" }?.optJSONObject("delta") ?: return null + when (delta.optString("type")) { + "text_delta" -> AgentEvent(conversation, text = delta.optString("text")) + "thinking_delta" -> AgentEvent(conversation, thinking = delta.optString("thinking")) + else -> null + } + } + "assistant" -> { + val message = o.optJSONObject("message") + val content = message?.optJSONArray("content") ?: JSONArray() + val entries = (0 until content.length()).mapNotNull { i -> + val block = content.optJSONObject(i) ?: return@mapNotNull null + when (block.optString("type")) { + "text" -> if (parent != null) null else block.optString("text").trim().takeIf { it.isNotEmpty() }?.let { AgentHost.Entry.Said(it) } + "thinking" -> if (parent != null) null else block.optString("thinking").trim().takeIf { it.isNotEmpty() }?.let { AgentHost.Entry.Thought(it) } + "tool_use" -> { + val input = block.optJSONObject("input") + AgentHost.Entry.Used(block.optString("id"), block.optString("name"), detail(input), fullInput(block.optString("name"), input), parent = parent.orEmpty()) + } + else -> null + } + } + val usage = message?.optJSONObject("usage") + val context = usage?.let { it.optLong("input_tokens") + it.optLong("cache_read_input_tokens") + it.optLong("cache_creation_input_tokens") + it.optLong("output_tokens") } + AgentEvent(conversation, entries, context = context?.takeIf { it > 0 && parent == null }) + } + "user" -> { + val content = o.optJSONObject("message")?.optJSONArray("content") ?: return conversation?.let { AgentEvent(it) } + val results = (0 until content.length()).mapNotNull { i -> + val block = content.optJSONObject(i)?.takeIf { it.optString("type") == "tool_result" } ?: return@mapNotNull null + AgentHost.Entry.Result(block.optString("tool_use_id"), resultText(block.opt("content")), block.optBoolean("is_error")) + } + AgentEvent(conversation, results) + } + "rate_limit_event" -> AgentEvent(conversation, limits = limits(o.optJSONObject("rate_limit_info"))) + // A resumed session first answers background tasks the last run left behind; that result is not the turn's. + "result" -> if (o.optJSONObject("origin")?.optString("kind") == "task-notification") conversation?.let { AgentEvent(it) } else AgentEvent( + conversation, + listOf(AgentHost.Entry.Finished(if (o.optBoolean("is_error")) o.optString("result").ifEmpty { o.optString("subtype") } else null)), + window = window(o.optJSONObject("modelUsage")), + usage = AgentHost.Usage( + o.optLong("duration_ms"), o.optDouble("total_cost_usd", 0.0), + o.optJSONObject("usage")?.let { it.optLong("input_tokens") + it.optLong("cache_read_input_tokens") + it.optLong("cache_creation_input_tokens") } ?: 0, + o.optJSONObject("usage")?.optLong("output_tokens") ?: 0, + ), + ) + else -> conversation?.let { AgentEvent(it) } + } + } + + private val WINDOW_MINUTES = mapOf("five_hour" to 300, "seven_day" to 10_080) + + @VisibleForTesting + internal fun limits(info: JSONObject?): List? { + val windows = info?.optJSONObject("unifiedWindows") ?: return null + return WINDOW_MINUTES.mapNotNull { (key, minutes) -> + val w = windows.optJSONObject(key) ?: return@mapNotNull null + AgentHost.Limit(minutes, (w.optDouble("utilization", 0.0) * 100).toInt(), w.optLong("resetsAt")) + }.takeIf { it.isNotEmpty() } + } + + /** The context window of the model that did most of the turn; subagents may run a smaller one. */ + private fun window(models: JSONObject?): Long? { + models ?: return null + return models.keys().asSequence().mapNotNull { models.optJSONObject(it) } + .maxByOrNull { it.optDouble("costUSD", 0.0) }?.optLong("contextWindow")?.takeIf { it > 0 } + } + + private fun resultText(content: Any?): String = when (content) { + is String -> content + is JSONArray -> (0 until content.length()).mapNotNull { i -> + val part = content.optJSONObject(i) ?: return@mapNotNull null + when (part.optString("type")) { + "text" -> part.optString("text") + "image" -> "[image]" + else -> null + } + }.joinToString("\n") + null, JSONObject.NULL -> "" + else -> content.toString() + } + + private fun detail(input: JSONObject?): String { + input ?: return "" + for (key in listOf("command", "file_path", "pattern", "url", "query", "description", "prompt")) { + input.optString(key).takeIf { it.isNotEmpty() }?.let { return firstLine(it) } + } + return "" + } + + @VisibleForTesting + internal fun fullInput(tool: String, input: JSONObject?): String { + input ?: return "" + return when { + tool == "Bash" -> input.optString("command") + tool == "Edit" -> input.optString("file_path") + "\n" + lineDiff(input.optString("old_string"), input.optString("new_string")) + tool == "Write" -> input.optString("file_path") + "\n" + lineDiff("", input.optString("content")) + tool == "TodoWrite" -> todos(input.optJSONArray("todos")) + else -> input.toString(2) + } + } + + private fun todos(list: JSONArray?) = (0 until (list?.length() ?: 0)).mapNotNull { i -> + val todo = list?.optJSONObject(i) ?: return@mapNotNull null + val mark = when (todo.optString("status")) { "completed" -> "[x]"; "in_progress" -> "[~]"; else -> "[ ]" } + "$mark ${todo.optString("content")}" + }.joinToString("\n") +} + +/** OpenAI Codex: `codex exec --json`, resumed by thread id. */ +object Codex : AgentHarness { + override val id = "codex" + override val name = "Codex" + override val binary = "/root/.local/bin/codex" + // Code mode runs in a helper that each release ships as its own download. + private const val HOST = "/root/.local/bin/codex-code-mode-host" + override val files get() = listOf(binary, HOST) + override val install = """ + set -e + release=${'$'}(curl -fsSL https://api.github.com/repos/openai/codex/releases/latest) + mkdir -p /root/.local/bin + for name in codex codex-code-mode-host; do + url=${'$'}(printf '%s' "${'$'}release" | grep -o "https://[^\"]*/${'$'}name-aarch64-unknown-linux-musl.tar.gz" | head -1) + echo "Downloading ${'$'}name" + curl -fsSL "${'$'}url" | tar -xz -C /tmp + install -m755 /tmp/${'$'}name-aarch64-unknown-linux-musl /root/.local/bin/${'$'}name + done + """.trimIndent() + override val signedIn = listOf(binary, "login", "status") + override val signIn = listOf(binary, "login") + override val plans = false + override val efforts = listOf("low", "medium", "high") + + /** Codex keeps the models its account can use in `~/.codex/models_cache.json` once it has run. */ + override fun models(rootfs: File): List = runCatching { + val o = JSONObject(File(rootfs, "root/.codex/models_cache.json").readText()) + val list = o.optJSONArray("models") ?: JSONArray() + (0 until list.length()).mapNotNull { i -> + val m = list.optJSONObject(i) ?: return@mapNotNull null + val slug = m.optString("slug").ifEmpty { m.optString("id") }.takeIf { it.isNotEmpty() } ?: return@mapNotNull null + if (m.has("visibility") && m.optString("visibility") != "list") return@mapNotNull null + AgentHarness.Model(slug, m.optString("display_name").ifEmpty { slug }) + } + }.getOrDefault(emptyList()) + + // Codex's own sandbox needs Landlock and seccomp, which proot does not provide. + override fun turn(message: String, conversation: String?, options: AgentHarness.Options) = buildList { + addAll(listOf(binary, "exec")) + if (conversation != null) addAll(listOf("resume", conversation)) + addAll(listOf("--json", "--dangerously-bypass-approvals-and-sandbox", "--skip-git-repo-check")) + options.model?.let { addAll(listOf("-m", it)) } + options.effort?.let { addAll(listOf("-c", "model_reasoning_effort=\"$it\"")) } + // codex exec has no system prompt option, so a new conversation starts with the brief. + add(if (conversation == null && options.brief != null) "${options.brief}\n\n$message" else message) + } + + override fun parse(line: String): AgentEvent? { + val o = runCatching { JSONObject(line) }.getOrNull() ?: return null + val item = o.optJSONObject("item") + val id = item?.optString("id").orEmpty() + val entries = when (o.optString("type")) { + "thread.started" -> return AgentEvent(o.optString("thread_id").takeIf { it.isNotEmpty() }) + "item.started" -> when (item?.optString("type")) { + "command_execution" -> shellCommand(item.optString("command")).let { listOf(AgentHost.Entry.Used(id, "Shell", firstLine(it), it)) } + "mcp_tool_call" -> listOf(AgentHost.Entry.Used(id, item.optString("tool").ifEmpty { "Tool" }, item.optString("server"), item.optJSONObject("arguments")?.toString(2).orEmpty())) + "web_search" -> listOf(AgentHost.Entry.Used(id, "Search", item.optString("query"), item.optString("query"))) + else -> emptyList() + } + "item.updated" -> when (item?.optString("type")) { + "todo_list" -> listOf(todoEntry(id, item)) + else -> emptyList() + } + "item.completed" -> when (item?.optString("type")) { + "agent_message" -> item.optString("text").trim().takeIf { it.isNotEmpty() }?.let { listOf(AgentHost.Entry.Said(it)) }.orEmpty() + "reasoning" -> item.optString("text").trim().takeIf { it.isNotEmpty() }?.let { listOf(AgentHost.Entry.Thought(it)) }.orEmpty() + "command_execution" -> listOf(AgentHost.Entry.Result(id, item.optString("aggregated_output"), + item.has("exit_code") && !item.isNull("exit_code") && item.optInt("exit_code") != 0)) + "mcp_tool_call" -> listOf(AgentHost.Entry.Result(id, item.optJSONObject("result")?.toString(2) ?: item.optJSONObject("error")?.optString("message").orEmpty(), + item.optString("status") == "failed")) + "web_search" -> listOf(AgentHost.Entry.Result(id, "", false)) + "file_change" -> listOf( + AgentHost.Entry.Used(id, "Edit", changedFiles(item), changedFiles(item).replace(", ", "\n")), + AgentHost.Entry.Result(id, item.optString("status"), item.optString("status") == "failed"), + ) + "todo_list" -> listOf(todoEntry(id, item)) + "error" -> listOf(AgentHost.Entry.Said("โš  " + item.optString("message"))) + else -> emptyList() + } + "turn.completed" -> return AgentEvent( + entries = listOf(AgentHost.Entry.Finished(null)), + usage = o.optJSONObject("usage")?.let { AgentHost.Usage(0, 0.0, it.optLong("input_tokens") + it.optLong("cached_input_tokens"), it.optLong("output_tokens")) }, + ) + "turn.failed" -> listOf(AgentHost.Entry.Finished(o.optJSONObject("error")?.optString("message") ?: "turn failed")) + // codex reports a dropped stream it is retrying as an error event, and the turn goes on. + "error" -> o.optString("message").let { message -> + if (message.startsWith("Reconnecting...")) emptyList() else listOf(AgentHost.Entry.Finished(message.ifEmpty { "error" })) + } + else -> emptyList() + } + return if (entries.isEmpty()) null else AgentEvent(entries = entries) + } + + private const val TOKEN_COUNT = "\"payload\":{\"type\":\"token_count\"" + + /** Codex prints no limits with --json; its session log, named after the thread, has a token_count event each step. */ + override fun usage(rootfs: File, conversation: String?): AgentEvent? { + conversation ?: return null + val log = File(rootfs, "root/.codex/sessions").walkBottomUp().filter { it.isFile && it.name.endsWith("-$conversation.jsonl") } + .maxByOrNull { it.lastModified() } ?: return null + val last = runCatching { log.readLines().lastOrNull { it.contains(TOKEN_COUNT) } }.getOrNull() ?: return null + return tokenCount(last) + } + + @VisibleForTesting + internal fun tokenCount(line: String): AgentEvent? { + val payload = runCatching { JSONObject(line).optJSONObject("payload") }.getOrNull()?.takeIf { it.optString("type") == "token_count" } ?: return null + val info = payload.optJSONObject("info") + val rates = payload.optJSONObject("rate_limits") + val limits = listOf("primary", "secondary").mapNotNull { key -> + val w = rates?.optJSONObject(key) ?: return@mapNotNull null + AgentHost.Limit(w.optInt("window_minutes"), w.optDouble("used_percent", 0.0).toInt(), w.optLong("resets_at")) + } + return AgentEvent( + context = info?.optJSONObject("last_token_usage")?.optLong("total_tokens")?.takeIf { it > 0 }, + window = info?.optLong("model_context_window")?.takeIf { it > 0 }, + limits = limits.takeIf { it.isNotEmpty() }, + ) + } + + private fun todoEntry(id: String, item: JSONObject): AgentHost.Entry.Used { + val items = item.optJSONArray("items") ?: JSONArray() + val text = (0 until items.length()).mapNotNull { i -> + val todo = items.optJSONObject(i) ?: return@mapNotNull null + "${if (todo.optBoolean("completed")) "[x]" else "[ ]"} ${todo.optString("text")}" + }.joinToString("\n") + return AgentHost.Entry.Used("$id-todo", "TodoWrite", "", text, output = "") + } + + private fun changedFiles(item: JSONObject): String { + val changes = item.optJSONArray("changes") ?: return "" + return (0 until changes.length()).mapNotNull { changes.optJSONObject(it)?.optString("path") }.joinToString(", ").take(400) + } +} + +@VisibleForTesting +internal fun firstLine(text: String) = text.lineSequence().first().take(160) + +private const val DIFF_CONTEXT = 2 + +/** + * [old] against [new], one line per changed or nearby line, each led by ' ', '-' or '+'. Edits + * replace a short span, so the lines both share at the start and end are cut to [DIFF_CONTEXT]. + */ +@VisibleForTesting +internal fun lineDiff(old: String, new: String): String { + val a = if (old.isEmpty()) emptyList() else old.removeSuffix("\n").lines() + val b = if (new.isEmpty()) emptyList() else new.removeSuffix("\n").lines() + var head = 0 + while (head < a.size && head < b.size && a[head] == b[head]) head++ + var tail = 0 + while (tail < a.size - head && tail < b.size - head && a[a.size - 1 - tail] == b[b.size - 1 - tail]) tail++ + return buildList { + a.subList(maxOf(0, head - DIFF_CONTEXT), head).forEach { add(" $it") } + a.subList(head, a.size - tail).forEach { add("-$it") } + b.subList(head, b.size - tail).forEach { add("+$it") } + a.subList(a.size - tail, minOf(a.size, a.size - tail + DIFF_CONTEXT)).forEach { add(" $it") } + }.joinToString("\n") +} + +private val SHELL_WRAPPER = Regex("^/bin/(?:ba)?sh -l?c '(.*)'$", RegexOption.DOT_MATCHES_ALL) + +/** Codex runs each command as `/bin/bash -lc ''`; the command is what the user wants to read. */ +@VisibleForTesting +internal fun shellCommand(command: String) = SHELL_WRAPPER.find(command)?.groupValues?.get(1)?.replace("'\''", "'") ?: command diff --git a/app/src/main/java/com/droiddeck/launcher/agent/AgentHost.kt b/app/src/main/java/com/droiddeck/launcher/agent/AgentHost.kt new file mode 100644 index 0000000000..8200200516 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/agent/AgentHost.kt @@ -0,0 +1,696 @@ +package com.droiddeck.launcher.agent + +import android.content.Context +import android.os.Environment +import android.os.Handler +import android.os.Looper +import android.os.SystemClock +import android.util.Log +import androidx.annotation.VisibleForTesting +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableLongStateOf +import androidx.compose.runtime.mutableStateListOf +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.setValue +import com.droiddeck.launcher.R +import com.droiddeck.launcher.runtime.LinuxRuntime +import com.droiddeck.launcher.session.OrphanReaper +import com.droiddeck.launcher.session.SessionPrefs +import java.io.File +import java.nio.file.Files + +/** + * The launcher's agent: a coding agent CLI ([AgentHarness]) from the Linux userland, run headless + * one process per turn, outside any game or desktop session. Conversations are kept on disk + * ([AgentChats]), so a restart (a Lab build, a crash) continues the same one. + */ +object AgentHost { + sealed interface Entry { + data class Asked(val text: String, val files: List = emptyList()) : Entry + data class Said(val text: String) : Entry + data class Thought(val text: String) : Entry + /** A tool call; [output] stays null until its result arrives. [parent] is the subagent call it was made under, if any. */ + data class Used( + val id: String, val tool: String, val detail: String, val input: String = "", val output: String? = null, val failed: Boolean = false, + val parent: String = "", + ) : Entry + data class Result(val id: String, val output: String, val failed: Boolean) : Entry + /** [planned]: the turn ran in plan mode, so it ends on a plan that nothing has carried out yet. */ + data class Finished(val error: String?, val stopped: Boolean = false, val usage: Usage? = null, val planned: Boolean = false) : Entry + } + + /** [context] of [window] tokens is what the conversation held when the turn ended. */ + data class Usage( + val durationMs: Long, val costUsd: Double, val inputTokens: Long, val outputTokens: Long, + val context: Long = 0, val window: Long = 0, + ) + + /** A plan usage limit over a rolling window of [minutes]; [resetsAt] is in epoch seconds. */ + data class Limit(val minutes: Int, val usedPercent: Int, val resetsAt: Long) + + /** A message typed while the agent was working, sent when the turn ends. */ + data class Queued(val text: String, val files: List) + + enum class State { MISSING, IDLE, WORKING } + + private const val TAG = "AgentHost" + private const val WORKSPACE = "/root/DroidDeck" + internal const val GUEST_PATH = "/root/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + private const val TICK_MS = 1_000L + private const val IDLE_TICK_MS = 5_000L + + /** Where the agent runs and what the user sees, which no file in the checkout tells it. */ + @VisibleForTesting + internal const val BRIEF = "You run inside DroidDeck on the user's handheld, in its Linux userland (Ubuntu under proot, aarch64), " + + "and the user talks to you from DroidDeck's Agent tab, often on a small screen, so keep replies short. " + + "droiddeckctl inspects and drives the app over loopback adb (\$ADB_SERIAL); its guide is ${AgentSetup.CTL}/agent-control.md. " + + "Steam, the desktop and games run in DroidDeck's session, a separate guest from yours: a program you start here is not in it and has no screen. " + + "Reach the session through droiddeckctl: state, start steam, stop, launch, quit, focus, screenshot, logs, and guest to run a command inside it. " + + "Starting, stopping or restarting a session leaves you running. " + + "Never kill by a command-line pattern (pkill -f, pgrep -f piped to kill): your own command line holds the user's message, so the pattern matches you. " + + "End a game with droiddeckctl quit, the session with droiddeckctl stop, anything else by its pid. " + + "dd-lab-build builds the checkout as a Lab build and restarts DroidDeck on it (docs/lab-builds.md). DroidDeck runs the build in a " + + "process of its own and shows the user its progress and time left; dd-lab-build follows that build's log until it is done. " + + "Run it with run_in_background and keep checking its output, so the user can talk to you meanwhile. " + + "The restart ends this process, and this conversation continues on the new build. " + + "Files the user attaches are listed at the end of their message, under /root/.cache/droiddeck/attachments. " + + "Commits and pull requests you make are the user's own: add no co-author line, AI credit or generated-by note. " + + "To have the user pick between options, end your reply with a fenced code block whose language is choices, one short option per line, " + + "and end your turn: DroidDeck shows them as buttons and sends the one picked as the next message." + + val entries = mutableStateListOf() + val queue = mutableStateListOf() + var state by mutableStateOf(State.IDLE) + private set + var installed by mutableStateOf(false) + private set + /** The Linux runtime is there, so the agent can be set up. */ + var available by mutableStateOf(false) + private set + var harness by mutableStateOf(ClaudeCode) + private set + /** The chosen model for [harness]; null is the CLI's default. */ + var model by mutableStateOf(null) + private set + /** The chosen reasoning effort for [harness]; null is the CLI's default. */ + var effort by mutableStateOf(null) + private set + var plan by mutableStateOf(false) + private set + var chat by mutableStateOf(null) + private set + /** A reply finished since the conversation was last on screen. */ + var unseen by mutableStateOf(false) + private set + var failed by mutableStateOf(false) + private set + /** Text and thinking of the reply being written. */ + var live by mutableStateOf("") + private set + var liveThinking by mutableStateOf("") + private set + /** When the current turn started, on [SystemClock.elapsedRealtime]. */ + var turnStarted by mutableLongStateOf(0L) + private set + var now by mutableLongStateOf(0L) + private set + /** Tokens in the conversation's context after its last step. */ + var context by mutableLongStateOf(0L) + private set + /** Tokens the model's context can hold; 0 until a turn has told. */ + var window by mutableLongStateOf(0L) + private set + /** The account's plan limits as [harness] last reported them. */ + var limits by mutableStateOf>(emptyList()) + private set + var lab by mutableStateOf(null) + private set + + private class Turn(val process: Process, val pid: Int) + + private val main = Handler(Looper.getMainLooper()) + private var turn: Turn? = null + /** Counts turns, so a process that starts after its turn was stopped is not adopted by the next one. */ + private var generation = 0 + private var labProcess: Process? = null + /** The turn now running resends a message that got no reply, so it is not resent again. */ + private var retrying = false + private var resend: Runnable? = null + /** The running Lab build was asked for by the current turn, so stopping the turn stops it. */ + private var labFromTurn = false + private var conversation: String? = null + private var turnPlanned = false + private var loaded = false + private var appContext: Context? = null + + val turnPid: Int get() = turn?.pid ?: 0 + + fun seen() { + unseen = false + appContext?.let { AgentNotice.clear(it) } + } + + fun refresh(context: Context) { + val app = context.applicationContext + appContext = app + File(app.filesDir, "agent").mkdirs() + harness = AgentHarness.byId(prefs(app).getString(HARNESS_KEY, null)) + model = prefs(app).getString(modelKey(harness), null) + effort = prefs(app).getString(effortKey(harness), null)?.takeIf { it in harness.efforts } + plan = prefs(app).getBoolean(PLAN_KEY, false) + limits = decodeLimits(prefs(app).getString(limitsKey(harness), null)) + available = LinuxRuntime.hasRootfs(app) + installed = harness.files.all { guestFileExists(app, it) } + if (!installed) state = State.MISSING else if (state == State.MISSING) state = State.IDLE + if (!loaded) { + loaded = true + val migrated = AgentChats.migrate(app, harness.id, prefs(app).getString(LEGACY_CONVERSATION_KEY, null)) + if (migrated != null) prefs(app).edit().remove(LEGACY_CONVERSATION_KEY).putString(CHAT_KEY, migrated).apply() + prefs(app).getString(CHAT_KEY, null)?.let { load(app, it) } + resumeAfterRestart(app) + tick() + } + } + + private fun load(app: Context, id: String) { + val file = AgentChats.file(app, id) + if (!file.isFile) return + val loaded = AgentChats.read(file) + if (chat != id) AgentAttachments.pending.clear() + chat = id + conversation = loaded.conversation + entries.clear() + entries.addAll(loaded.entries) + val last = loaded.entries.lastOrNull { it is Entry.Finished && (it.usage?.context ?: 0) > 0 } as? Entry.Finished + context = last?.usage?.context ?: 0 + window = last?.usage?.window ?: 0 + } + + /** Opens a kept conversation, switching to the CLI it belongs to. */ + fun open(context: Context, id: String) { + val app = context.applicationContext + if (state == State.WORKING || id == chat) return + val harnessId = AgentChats.read(AgentChats.file(app, id)).harness + if (harnessId != null && harnessId != harness.id) { + if (AgentSetup.busy) return + prefs(app).edit().putString(HARNESS_KEY, harnessId).apply() + AgentSetup.forget() + refresh(app) + } + load(app, id) + prefs(app).edit().putString(CHAT_KEY, id).apply() + } + + fun delete(context: Context, id: String) { + if (id == chat) { + if (state == State.WORKING) return + forget(context) + } + AgentChats.delete(context.applicationContext, id) + } + + /** + * A Lab build restarts the app, which ends the agent's process mid-turn. dd-lab-build leaves + * [RESUME] when the app's own agent ran it, so the same conversation picks up on the new build. + */ + private fun resumeAfterRestart(app: Context) { + val marker = File(app.filesDir, RESUME) + val claimed = File(app.filesDir, "$RESUME.claimed") + if (!marker.renameTo(claimed)) return + claimed.delete() + val asked = prefs(app).getString(LAB_CHAT_KEY, null) + prefs(app).edit().remove(LAB_CHAT_KEY).apply() + if (!installed) return + // The conversation that asked for the build hears about it, even if its turn had already ended. + if (asked != null && asked != chat && AgentChats.file(app, asked).isFile) { + load(app, asked) + prefs(app).edit().putString(CHAT_KEY, asked).apply() + } + if (asked != null || interrupted(entries)) send(app, app.getString(R.string.agent_resumed)) + } + + /** True when DroidDeck restarted in the middle of one of the agent's turns. */ + fun resuming(context: Context) = File(context.applicationContext.filesDir, RESUME).isFile + + @VisibleForTesting + internal fun interrupted(entries: List) = entries.isNotEmpty() && entries.last() !is Entry.Finished + + /** Switches the agent CLI; a conversation belongs to one CLI, so a new one starts. */ + fun choose(context: Context, choice: AgentHarness) { + if (choice == harness || state == State.WORKING || AgentSetup.busy) return + forget(context) + AgentSetup.forget() + prefs(context).edit().putString(HARNESS_KEY, choice.id).apply() + refresh(context) + } + + fun chooseModel(context: Context, id: String?) { + model = id + prefs(context).edit().putString(modelKey(harness), id).apply() + } + + fun chooseEffort(context: Context, level: String?) { + effort = level + prefs(context).edit().putString(effortKey(harness), level).apply() + } + + fun choosePlan(context: Context, on: Boolean) { + plan = on + prefs(context).edit().putBoolean(PLAN_KEY, on).apply() + } + + fun models(context: Context) = harness.models(LinuxRuntime.rootDir(context.applicationContext)) + + /** Sends [text] now, or after the current turn when the agent is working. */ + fun send(context: Context, text: String, files: List = emptyList()) { + val app = context.applicationContext + val message = text.trim() + if (message.isEmpty() && files.isEmpty()) return + cancelResend() + if (state == State.WORKING) { + queue += Queued(message, files) + return + } + if (state != State.IDLE) return + val id = chat ?: AgentChats.newId(app).also { id -> + AgentChats.start(AgentChats.file(app, id), harness.id) + chat = id + conversation = null + prefs(app).edit().putString(CHAT_KEY, id).apply() + } + val attached = AgentAttachments.adopt(app, id, files) + record(app, Entry.Asked(message, attached)) + state = State.WORKING + val gen = ++generation + live = "" + liveThinking = "" + turnStarted = SystemClock.elapsedRealtime() + AgentHostService.start(app) + val current = harness + val prompt = AgentAttachments.prompt(message, attached) + turnPlanned = plan && current.plans + val command = current.turn(prompt, conversation, AgentHarness.Options(model, turnPlanned, BRIEF, effort)) + val workdir = workspace(app) + var threadConversation = conversation + Thread({ + runCatching { current.prepare(LinuxRuntime.rootDir(app)) } + runCatching { AgentSetup.installHelpers(app) } + // Without a session nothing else keeps the userland's resolver current. + runCatching { com.droiddeck.launcher.runtime.LinuxNetworkLinkComponent(app, LinuxRuntime.rootDir(app)).publish() } + val child = try { + guest(app, command, workdir).start() + } catch (e: Exception) { + Log.w(TAG, "could not start ${current.name}", e) + main.post { if (generation == gen) finish(app, e.message ?: "could not start") } + return@Thread + } + val started = Turn(child, AgentProcesses.pidOf(child)) + OrphanReaper.keep(started.pid) + main.post { if (generation == gen && state == State.WORKING && turn == null) turn = started else AgentProcesses.killTree(started.pid) } + child.outputStream.close() + var ended = false + val raw = runCatching { + val log = File(app.filesDir, TURN_LOG).apply { parentFile?.mkdirs() } + log.renameTo(File(app.filesDir, "$TURN_LOG.1")) + log.bufferedWriter() + }.getOrNull() + runCatching { + child.inputStream.bufferedReader().forEachLine { line -> + runCatching { raw?.apply { write(line); newLine(); flush() } } + val parsed = current.parse(line) ?: return@forEachLine + parsed.conversation?.let { threadConversation = it } + val done = parsed.entries.any { it is Entry.Finished } + if (done) ended = true + val event = if (!done) parsed else runCatching { current.usage(LinuxRuntime.rootDir(app), threadConversation) }.getOrNull() + ?.let { parsed.copy(context = it.context ?: parsed.context, window = it.window ?: parsed.window, limits = it.limits ?: parsed.limits) } ?: parsed + main.post { if (turn === started) apply(app, event) } + } + } + runCatching { raw?.close() } + val status = runCatching { child.waitFor() }.getOrDefault(-1) + OrphanReaper.release(started.pid) + main.post { + if (turn === started) { + turn = null + if (state == State.WORKING && !ended) finish(app, app.getString(R.string.agent_exited, current.name, status)) + } + } + }, "agent-output").start() + } + + /** Ends the turn now: its process and everything it started, a build included. */ + fun stop(context: Context) { + val app = context.applicationContext + val running = turn + turn = null + queue.clear() + if (labFromTurn && lab?.running == true) cancelLabBuild(app) + if (running != null) { + AgentProcesses.killTree(running.pid) + running.process.destroy() + } + if (state == State.WORKING) finish(app, null, stopped = true) + } + + fun unqueue(item: Queued) { + queue.remove(item) + } + + /** Sends [item] now: the running turn stops where it is, and the rest of the queue waits for the next one. */ + fun sendNow(context: Context, item: Queued) { + val app = context.applicationContext + if (!queue.remove(item)) return + val rest = queue.toList() + stop(app) + queue.addAll(rest) + send(app, item.text, item.files) + } + + /** Starts a new conversation; the current one stays in the history. */ + fun forget(context: Context) { + stop(context) + entries.clear() + if (chat != null) AgentAttachments.pending.clear() + chat = null + conversation = null + this.context = 0 + window = 0 + prefs(context).edit().remove(CHAT_KEY).apply() + state = if (installed) State.IDLE else State.MISSING + } + + /** + * A process for [command] in the Linux userland, run the way the store helpers run theirs: + * proot over the installed rootfs, without a session. Loopback adb is connected first so + * droiddeckctl reaches the app. + */ + fun guest(app: Context, command: List, workdir: String = "/root", connectAdb: Boolean = true, fakeRoot: Boolean = false): ProcessBuilder { + val adb = AgentAdb.prepare(app) + val env = listOf( + "/usr/bin/env", "HOME=/root", "PATH=$GUEST_PATH", "LANG=C.UTF-8", + "ADB_SERIAL=${adb.serial}", "ADB_VENDOR_KEYS=${adb.vendorKeys}", "DROIDDECK_PACKAGE=${app.packageName}", + "DD_AGENT=1", "DD_AGENT_INBOX=${File(app.filesDir, "agent").path}", "BROWSER=/root/.local/bin/android-open", "DD_BROWSER_DISPLAY=${AgentAdb.browserDisplay}", + ) + val shell = listOf( + "/bin/sh", "-c", + // proot ends the adb server with the command, so each command that needs adb connects it. + (if (connectAdb) "adb start-server >/dev/null 2>&1; adb connect \"\$ADB_SERIAL\" >/dev/null 2>&1; " else "") + + "cd \"$1\" 2>/dev/null; shift; exec \"$@\"", "sh", workdir, + ) + val proot = LinuxRuntime.command(app, null, null, Environment.getExternalStorageDirectory(), null, env + shell + command, fakeRoot) + return ProcessBuilder(proot).redirectErrorStream(true).apply { + environment().apply { + remove("LD_PRELOAD"); remove("LD_AUDIT"); remove("LD_LIBRARY_PATH") + put("PROOT_LOADER", LinuxRuntime.prootLoader(app).path) + put("PROOT_TMP_DIR", LinuxRuntime.prootTempDir(app).path) + if (SessionPrefs.prootNoSeccomp(app)) put("PROOT_NO_SECCOMP", "1") + LinuxRuntime.prootLibraryPath(app).takeIf { it.isNotEmpty() }?.let { put("LD_LIBRARY_PATH", it) } + } + } + } + + fun guestFileExists(context: Context, path: String): Boolean { + val file = File(LinuxRuntime.rootDir(context), path.removePrefix("/")) + return file.exists() || Files.isSymbolicLink(file.toPath()) + } + + private fun workspace(app: Context) = if (guestFileExists(app, WORKSPACE)) WORKSPACE else "/root" + + private fun apply(app: Context, event: AgentEvent) { + event.conversation?.takeIf { it != conversation }?.let { id -> + conversation = id + chat?.let { AgentChats.appendConversation(AgentChats.file(app, it), id) } + } + event.text?.let { live += it } + event.thinking?.let { liveThinking += it } + event.context?.let { context = it } + event.window?.let { window = it } + event.limits?.let { reported -> + limits = (limits.filter { old -> reported.none { it.minutes == old.minutes } } + reported).sortedBy { it.minutes } + prefs(app).edit().putString(limitsKey(harness), encodeLimits(limits)).apply() + } + for (entry in event.entries) when (entry) { + is Entry.Finished -> finish(app, entry.error, usage = event.usage) + else -> { + if (entry is Entry.Said) live = "" + if (entry is Entry.Thought) liveThinking = "" + record(app, entry) + } + } + AgentHostService.update(app) + } + + private fun finish(app: Context, error: String?, stopped: Boolean = false, usage: Usage? = null) { + if (state != State.WORKING) return + turn = null + if (!stopped) labFromTurn = false + live = "" + liveThinking = "" + val held = if (context > 0) (usage ?: Usage(0, 0.0, 0, 0)).copy(context = context, window = window) else usage + record(app, Entry.Finished(error, stopped, held, planned = turnPlanned && !stopped && error == null)) + state = State.IDLE + unseen = true + failed = error != null + AgentHostService.stop(app) + // Claude Code now and then ends a resumed turn at once without reading the message; nothing + // happened, so the message is sent once more. + val asked = entries.lastOrNull { it is Entry.Asked } as? Entry.Asked + if (!stopped && error == null && asked != null && answerless(entries) && !retrying) { + retrying = true + val retryChat = chat + resend = Runnable { + resend = null + if (state == State.IDLE && chat == retryChat) send(app, asked.text, asked.files) else retrying = false + }.also { main.postDelayed(it, RETRY_MS) } + return + } + retrying = false + if (!stopped && queue.isNotEmpty()) { + val next = queue.removeAt(0) + send(app, next.text, next.files) + } else if (!stopped) notifyEnded(app, error) + } + + private fun notifyEnded(app: Context, error: String?) { + val start = entries.indexOfLast { it is Entry.Asked } + val said = entries.subList(start + 1, entries.size).lastOrNull { it is Entry.Said } as? Entry.Said + val reply = said?.let { choices(it.text) } + val kind = when { + error != null -> AgentNotice.Kind.FAILED + !reply?.options.isNullOrEmpty() -> AgentNotice.Kind.QUESTION + else -> AgentNotice.Kind.DONE + } + AgentNotice.post(app, kind, error ?: reply?.text?.takeIf { it.isNotBlank() }?.let { firstLine(it) } ?: "") + } + + /** A message typed or retried by the user replaces the automatic resend. */ + private fun cancelResend() { + val pending = resend ?: return + main.removeCallbacks(pending) + resend = null + retrying = false + } + + private fun record(app: Context, entry: Entry) { + if (!AgentChats.merge(entries, entry)) return + chat?.let { AgentChats.append(AgentChats.file(app, it), entry) } + } + + /** The last turn ended without saying or doing anything. */ + fun answerless(entries: List): Boolean { + val start = entries.indexOfLast { it is Entry.Asked } + if (start < 0) return false + val turn = entries.subList(start + 1, entries.size) + return turn.lastOrNull() is Entry.Finished && turn.none { it is Entry.Said || it is Entry.Used || it is Entry.Thought } && + (turn.last() as Entry.Finished).let { it.error == null && !it.stopped } + } + + /** Sends the last message again, after a turn that ended without a reply. */ + fun retry(context: Context) { + val asked = entries.lastOrNull { it is Entry.Asked } as? Entry.Asked ?: return + send(context, asked.text, asked.files) + } + + /** The tool call still running in this turn, if any. */ + fun running(): Entry.Used? { + if (state != State.WORKING) return null + val start = entries.indexOfLast { it is Entry.Asked } + return entries.withIndex().lastOrNull { (i, e) -> i > start && e is Entry.Used && e.output == null }?.value as? Entry.Used + } + + /** The latest todo list the agent wrote in this conversation. */ + fun todos(): String? = entries.lastOrNull { it is Entry.Used && it.tool == "TodoWrite" && it.parent.isEmpty() }?.let { (it as Entry.Used).input } + + private fun tick() { + now = SystemClock.elapsedRealtime() + appContext?.let { app -> + claimLabRequest(app) + claimOpenUrl(app) + claimDeviceCode(app) + // proot comes from an add-on pack fetched after the app starts, so the runtime can become usable later. + if (!available && state != State.WORKING) available = LinuxRuntime.hasRootfs(app) + lab = LabProgress.read(LinuxRuntime.rootDir(app)) + AgentHostService.update(app) + } + val busy = state == State.WORKING || lab != null || AgentSetup.status.values.any { it == AgentSetup.Status.WORKING } + main.postDelayed(::tick, if (busy) TICK_MS else IDLE_TICK_MS) + } + + /** + * android-open, the userland's $BROWSER, leaves a URL here for the app to open, so sign-ins + * work without Wireless debugging. + */ + private fun claimOpenUrl(app: Context) { + val request = File(app.filesDir, OPEN_URL) + if (!request.isFile) return + val claimed = File(app.filesDir, "$OPEN_URL.claimed") + if (!request.renameTo(claimed)) return + val url = runCatching { claimed.readText().trim() }.getOrNull() + claimed.delete() + if (url == null || !(url.startsWith("https://") || url.startsWith("http://"))) return + if (!openUrl(app, url)) runCatching { File(app.filesDir, "$OPEN_URL.failed").writeText("") } + } + + /** dd-gh-login leaves " " here to float the code over the page, and an empty file when it ends. */ + private fun claimDeviceCode(app: Context) { + val request = File(app.filesDir, DEVICE_CODE) + if (!request.isFile) return + val claimed = File(app.filesDir, "$DEVICE_CODE.claimed") + if (!request.renameTo(claimed)) return + val parts = runCatching { claimed.readText().trim() }.getOrDefault("").split(' ', limit = 2) + claimed.delete() + val code = parts[0] + val url = parts.getOrNull(1)?.takeIf { it.startsWith("https://") } + if (code.isEmpty() || url == null) { + com.droiddeck.launcher.DeviceCodeActivity.close() + return + } + if (!com.droiddeck.launcher.DeviceCodeActivity.show(app, code, url, AgentAdb.browserDisplay)) deviceCodeOpened(app, openUrl(app, url)) + } + + /** Tells dd-gh-login whether the device page opened, so it can fall back to android-open. */ + fun deviceCodeOpened(app: Context, opened: Boolean) { + runCatching { + val part = File(app.filesDir, "$DEVICE_CODE.result.part") + part.writeText(if (opened) "ok" else "failed") + part.renameTo(File(app.filesDir, "$DEVICE_CODE.result")) + } + } + + private fun openUrl(app: Context, url: String): Boolean { + val intent = android.content.Intent(android.content.Intent.ACTION_VIEW, android.net.Uri.parse(url)) + .addFlags(android.content.Intent.FLAG_ACTIVITY_NEW_TASK) + val options = android.app.ActivityOptions.makeBasic().setLaunchDisplayId(AgentAdb.browserDisplay).toBundle() + return runCatching { app.startActivity(intent, options) } + .recoverCatching { app.startActivity(intent) } + .onFailure { Log.w(TAG, "could not open a sign-in link: ${it.javaClass.simpleName}") } + .isSuccess + } + + /** + * dd-lab-build run by the agent hands its build to the app: the turn's processes end with the + * turn, and a build must outlive a turn that ends early or is stopped. + */ + private fun claimLabRequest(app: Context) { + val request = File(app.filesDir, LAB_REQUEST) + if (!request.isFile) return + val claimed = File(app.filesDir, "$LAB_REQUEST.claimed") + if (!request.renameTo(claimed)) return + val o = runCatching { org.json.JSONObject(claimed.readText()) }.getOrNull() + claimed.delete() + if (o == null || labProcess?.isAlive == true) return + val args = o.optJSONArray("args")?.let { a -> (0 until a.length()).map { a.getString(it) } }.orEmpty() + val cwd = o.optString("cwd").ifEmpty { WORKSPACE } + labFromTurn = state == State.WORKING + chat?.let { prefs(app).edit().putString(LAB_CHAT_KEY, it).apply() } + AgentHostService.setupStarted(app) + Thread({ + runCatching { + val child = guest(app, listOf("sh", "-c", + "mkdir -p /root/.cache; DD_LAB_DETACHED=1 exec dd-lab-build \"\$@\" > /root/.cache/dd-lab-build.log 2>&1", "dd-lab-build") + args, cwd).start() + main.post { labProcess = child } + val pid = AgentProcesses.pidOf(child) + OrphanReaper.keep(pid) + try { + child.outputStream.close() + child.inputStream.readBytes() + child.waitFor() + } finally { + OrphanReaper.release(pid) + } + }.onFailure { Log.w(TAG, "could not run a Lab build", it) } + main.post { + labProcess = null + labFromTurn = false + AgentHostService.setupEnded(app) + } + }, "agent-lab-build").start() + } + + fun cancelLabBuild(context: Context) { + val progress = lab ?: return + LabProgress.cancel(LinuxRuntime.rootDir(context.applicationContext), progress) + lab = LabProgress.read(LinuxRuntime.rootDir(context.applicationContext)) + } + + private const val LEGACY_CONVERSATION_KEY = "session_id" + private const val HARNESS_KEY = "harness" + private const val CHAT_KEY = "chat" + private const val PLAN_KEY = "plan" + private const val RESUME = "agent/resume" + private const val LAB_REQUEST = "agent/lab-request" + private const val OPEN_URL = "agent/open-url" + private const val DEVICE_CODE = "agent/device-code" + private const val LAB_CHAT_KEY = "lab_chat" + /** The raw output of the latest turn, for working out what a CLI did when the chat shows nothing. */ + private const val TURN_LOG = "agent/turn.log" + private const val RETRY_MS = 3_000L + + private fun modelKey(harness: AgentHarness) = "model_${harness.id}" + private fun limitsKey(harness: AgentHarness) = "limits_${harness.id}" + + @VisibleForTesting + internal fun encodeLimits(list: List) = org.json.JSONArray(list.map { + org.json.JSONObject().put("minutes", it.minutes).put("used", it.usedPercent).put("resets", it.resetsAt) + }).toString() + + @VisibleForTesting + internal fun decodeLimits(text: String?): List = runCatching { + val a = org.json.JSONArray(text ?: return emptyList()) + (0 until a.length()).map { a.getJSONObject(it) }.map { Limit(it.optInt("minutes"), it.optInt("used"), it.optLong("resets")) } + }.getOrDefault(emptyList()) + private fun effortKey(harness: AgentHarness) = "effort_${harness.id}" + + internal fun prefs(context: Context) = context.getSharedPreferences("agent", Context.MODE_PRIVATE) +} + +/** A reply split into its text and the options of a trailing choices block. */ +internal data class Choices(val text: String, val options: List) + +private val FENCE = Regex("""[ \t]{0,3}(`{3,}|~{3,})(.*)""") + +/** Walks Markdown fences so a choices block counts only at the top level and only as the last thing in the reply. */ +internal fun choices(reply: String): Choices { + val lines = reply.split('\n') + var open = "" + var opener = -1 + var openChoices = false + var block: IntRange? = null + lines.forEachIndexed { i, line -> + val fence = FENCE.matchEntire(line) + if (open.isEmpty()) { + if (fence != null) { + open = fence.groupValues[1] + opener = i + openChoices = fence.groupValues[2].trim() == "choices" + block = null + } else if (line.isNotBlank()) block = null + } else if (fence != null && fence.groupValues[1][0] == open[0] && fence.groupValues[1].length >= open.length && fence.groupValues[2].isBlank()) { + block = if (openChoices) opener..i else null + open = "" + } + } + val found = block?.takeIf { open.isEmpty() } ?: return Choices(reply, emptyList()) + val options = lines.subList(found.first + 1, found.last).map { it.trim().removePrefix("- ").removePrefix("* ").trim() }.filter { it.isNotEmpty() } + return Choices(lines.subList(0, found.first).joinToString("\n").trimEnd(), options) +} diff --git a/app/src/main/java/com/droiddeck/launcher/agent/AgentHostService.kt b/app/src/main/java/com/droiddeck/launcher/agent/AgentHostService.kt new file mode 100644 index 0000000000..66fed326ee --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/agent/AgentHostService.kt @@ -0,0 +1,121 @@ +package com.droiddeck.launcher.agent + +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.os.IBinder +import android.os.SystemClock +import com.droiddeck.launcher.FrontEndActivity +import com.droiddeck.launcher.R + +/** Keeps the app process alive while the agent works, and says what it is doing, with a way to stop it. */ +class AgentHostService : Service() { + override fun onBind(intent: Intent?): IBinder? = null + + override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int { + if (intent?.action == ACTION_STOP) { + if (AgentHost.lab?.running == true) AgentHost.cancelLabBuild(this) + AgentHost.stop(this) + return START_NOT_STICKY + } + awaiting = (awaiting - 1).coerceAtLeast(0) + startForeground(NOTIFICATION_ID, build(this)) + if (!started && awaiting == 0) stopSelf() + return START_NOT_STICKY + } + + companion object { + private const val CHANNEL_ID = "agent" + private const val NOTIFICATION_ID = 4107 + private const val ACTION_STOP = "com.droiddeck.launcher.agent.STOP" + private var lastText: String? = null + @Volatile private var started = false + /** + * startForegroundService calls not yet answered by onStartCommand. Stopping the service + * before it calls startForeground crashes the app, so it then stops itself instead. + */ + private var awaiting = 0 + /** Setup steps that keep the app alive while they run, besides the agent's turn. */ + private var setupSteps = 0 + + fun start(context: Context) { + lastText = null + started = true + runCatching { context.startForegroundService(Intent(context, AgentHostService::class.java)) } + .onSuccess { awaiting++ } + } + + fun stop(context: Context) { + if (setupSteps > 0) return + started = false + if (awaiting == 0) context.stopService(Intent(context, AgentHostService::class.java)) + } + + fun setupStarted(context: Context) { + setupSteps++ + start(context) + } + + fun setupEnded(context: Context) { + setupSteps = (setupSteps - 1).coerceAtLeast(0) + if (AgentHost.state != AgentHost.State.WORKING) stop(context) + } + + /** Refreshes the notification with the current step; unchanged text is not re-posted. */ + fun update(context: Context) { + if (!started) return + val text = describe(context) + if (text == lastText) return + lastText = text + context.getSystemService(NotificationManager::class.java)?.notify(NOTIFICATION_ID, build(context)) + } + + private fun describe(context: Context): String { + val lab = AgentHost.lab?.takeIf { it.running } + if (lab != null) return context.getString(R.string.agent_lab_progress, lab.permille / 10, minutes(lab.etaSeconds.toLong().coerceAtLeast(0))) + AgentSetup.detail[AgentSetup.Step.GITHUB]?.takeIf { + AgentSetup.status[AgentSetup.Step.GITHUB] == AgentSetup.Status.WORKING && it.startsWith("GitHub device code:") + }?.let { return it } + if (AgentHost.state != AgentHost.State.WORKING) return context.getString(R.string.agent_setting_up) + val tool = AgentHost.running() + val elapsed = minutes((SystemClock.elapsedRealtime() - AgentHost.turnStarted) / 1000) + return if (tool != null) "${tool.tool} ยท ${tool.detail}".take(120) + " ยท $elapsed" else context.getString(R.string.agent_thinking_for, elapsed) + } + + private fun minutes(seconds: Long) = if (seconds < 60) "${seconds.coerceAtLeast(0)}s" else "${seconds / 60}m ${seconds % 60}s" + + private fun build(context: Context): Notification { + val manager = context.getSystemService(NotificationManager::class.java) + manager?.createNotificationChannel(NotificationChannel(CHANNEL_ID, context.getString(R.string.agent_channel_name), + NotificationManager.IMPORTANCE_LOW).apply { setShowBadge(false) }) + val open = PendingIntent.getActivity(context, 0, + Intent(context, FrontEndActivity::class.java) + .setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP or Intent.FLAG_ACTIVITY_REORDER_TO_FRONT) + .putExtra(com.droiddeck.launcher.stores.download.StoreDownloadService.EXTRA_NAV, "agent"), + PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT) + val stop = PendingIntent.getService(context, 1, Intent(context, AgentHostService::class.java).setAction(ACTION_STOP), + PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT) + val lab = AgentHost.lab?.takeIf { it.running } + return Notification.Builder(context, CHANNEL_ID) + .setSmallIcon(R.drawable.ic_stat_session) + .setContentTitle(context.getString(when { + lab?.prepare == true -> R.string.agent_lab_preparing + lab != null -> R.string.agent_lab_building + else -> R.string.agent_working + })) + .setContentText(describe(context)) + .setContentIntent(open) + .addAction(Notification.Action.Builder(null, context.getString(R.string.agent_stop), stop).build()) + .setOngoing(true) + .setOnlyAlertOnce(true) + .setShowWhen(false) + .apply { if (lab != null) setProgress(1000, lab.permille, lab.stage != "building") } + .setCategory(Notification.CATEGORY_PROGRESS) + .build() + } + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/agent/AgentNative.kt b/app/src/main/java/com/droiddeck/launcher/agent/AgentNative.kt new file mode 100644 index 0000000000..613cbe2c39 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/agent/AgentNative.kt @@ -0,0 +1,65 @@ +package com.droiddeck.launcher.agent + +import android.content.Context +import com.droiddeck.launcher.runtime.LinuxRuntime +import com.droiddeck.launcher.runtime.NativeGuest +import org.json.JSONArray +import org.json.JSONObject +import java.util.concurrent.TimeUnit + +/** Runs a guest program without proot (`droiddeckctl native`), for testing the native userland. */ +object AgentNative { + private const val OUTPUT_CAP = 256 * 1024 + + fun run(context: Context, request: JSONObject, timeoutMs: Long): JSONObject { + val root = LinuxRuntime.rootDir(context) + com.droiddeck.launcher.session.SessionFiles.stage(context, root) + // with the setting off, staging leaves the rootfs as proot wants it + if (!com.droiddeck.launcher.session.SessionPrefs.nativeUserland(context)) NativeGuest.prepare(context, root) + if (!NativeGuest.available(root)) throw AgentException("NATIVE_UNAVAILABLE", "The rootfs has no native hook or glibc loader yet; start a session once") + val argvJson = request.optJSONArray("argv") ?: throw AgentException("INVALID_REQUEST", "argv is required") + val argv = (0 until argvJson.length()).map { argvJson.getString(it) } + if (argv.isEmpty()) throw AgentException("INVALID_REQUEST", "argv is empty") + val env = linkedMapOf() + request.optJSONObject("env")?.let { obj -> obj.keys().forEach { env[it] = obj.getString(it) } } + val preload = request.optJSONArray("preload")?.let { a -> (0 until a.length()).map { a.getString(it) } } ?: emptyList() + val builder = NativeGuest.builder(root, request.optString("cwd", "/root"), argv, env, preload) + val started = System.nanoTime() + val process = builder.start() + val out = StringBuilder() + val err = StringBuilder() + val readers = listOf( + Thread { drain(process.inputStream, out) }, + Thread { drain(process.errorStream, err) }, + ).onEach { it.isDaemon = true; it.start() } + // written beside the wait: a program that never reads more than a pipe holds would block it + val input = request.optString("stdin").toByteArray() + Thread { + try { + process.outputStream.use { stdin -> if (input.isNotEmpty()) stdin.write(input) } + } catch (_: java.io.IOException) { + } + }.apply { isDaemon = true; start() } + val finished = process.waitFor(timeoutMs, TimeUnit.MILLISECONDS) + if (!finished) process.destroyForcibly().waitFor() + readers.forEach { it.join(2000) } + val code = if (finished) process.exitValue() else -1 + return JSONObject().put("ok", true).put("command", "native") + .put("exitCode", code).put("timedOut", !finished) + .put("ms", (System.nanoTime() - started) / 1_000_000) + .put("stdout", JSONObject().put("text", out.toString())) + .put("stderr", JSONObject().put("text", err.toString())) + .put("argv", JSONArray(argv)) + } + + private fun drain(input: java.io.InputStream, into: StringBuilder) { + val buffer = ByteArray(8192) + val text = java.io.ByteArrayOutputStream() + while (true) { + val n = try { input.read(buffer) } catch (e: java.io.IOException) { -1 } + if (n < 0) break + if (text.size() < OUTPUT_CAP) text.write(buffer, 0, minOf(n, OUTPUT_CAP - text.size())) + } + into.append(text.toString(Charsets.UTF_8.name())) + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/agent/AgentNotice.kt b/app/src/main/java/com/droiddeck/launcher/agent/AgentNotice.kt new file mode 100644 index 0000000000..edba77a0c8 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/agent/AgentNotice.kt @@ -0,0 +1,58 @@ +package com.droiddeck.launcher.agent + +import android.app.ActivityManager +import android.app.Notification +import android.app.NotificationChannel +import android.app.NotificationManager +import android.app.PendingIntent +import android.content.Context +import android.content.Intent +import com.droiddeck.launcher.FrontEndActivity +import com.droiddeck.launcher.R +import com.droiddeck.launcher.ui.AgentPet + +/** Tells the user a turn has ended when nothing on screen already does. */ +internal object AgentNotice { + private const val CHANNEL_ID = "agent_done" + private const val NOTIFICATION_ID = 4108 + + enum class Kind { DONE, FAILED, QUESTION } + + fun post(context: Context, kind: Kind, text: String) { + if (onScreen(context)) return + val manager = context.getSystemService(NotificationManager::class.java) ?: return + manager.createNotificationChannel(NotificationChannel(CHANNEL_ID, context.getString(R.string.agent_done_channel), NotificationManager.IMPORTANCE_DEFAULT)) + val open = PendingIntent.getActivity(context, 2, + Intent(context, FrontEndActivity::class.java) + .setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP or Intent.FLAG_ACTIVITY_REORDER_TO_FRONT) + .putExtra(com.droiddeck.launcher.stores.download.StoreDownloadService.EXTRA_NAV, "agent"), + PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT) + val title = context.getString(when (kind) { + Kind.DONE -> R.string.agent_done + Kind.FAILED -> R.string.agent_done_failed + Kind.QUESTION -> R.string.agent_done_question + }) + runCatching { + manager.notify(NOTIFICATION_ID, Notification.Builder(context, CHANNEL_ID) + .setSmallIcon(R.drawable.ic_stat_session) + .setContentTitle(title) + .setContentText(text) + .setStyle(Notification.BigTextStyle().bigText(text)) + .setContentIntent(open) + .setAutoCancel(true) + .setCategory(Notification.CATEGORY_STATUS) + .build()) + } + } + + fun clear(context: Context) { + context.getSystemService(NotificationManager::class.java)?.cancel(NOTIFICATION_ID) + } + + /** The chat in a DroidDeck window in front, or the pet, which shows the reply in its own bubble. */ + private fun onScreen(context: Context): Boolean { + if (AgentPet.floating) return true + val state = ActivityManager.RunningAppProcessInfo().also { ActivityManager.getMyMemoryState(it) } + return AgentPet.agentOnScreen > 0 && state.importance <= ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/agent/AgentProcesses.kt b/app/src/main/java/com/droiddeck/launcher/agent/AgentProcesses.kt new file mode 100644 index 0000000000..c845db6813 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/agent/AgentProcesses.kt @@ -0,0 +1,105 @@ +package com.droiddeck.launcher.agent + +import android.os.Process +import android.os.SystemClock +import androidx.annotation.VisibleForTesting +import java.io.File + +/** + * Linux userland processes, read from /proc: proot runs them as real processes under the app's + * own uid, so the app can list and end them without a shell. + */ +object AgentProcesses { + data class Proc( + val pid: Int, val ppid: Int, val name: String, val args: String, + val seconds: Long, val rssKb: Long, val cpuPercent: Int, val agent: Boolean, + ) + + private const val HZ = 100L + private var lastTicks = emptyMap() + private var lastAt = 0L + + @VisibleForTesting + internal class Stat(val pid: Int, val ppid: Int, val ticks: Long, val startTicks: Long, val rssPages: Long) + + /** Guest processes, those under [turnPid] (the agent's current turn) first. */ + @Synchronized + fun snapshot(turnPid: Int): List { + val me = Process.myPid() + val uid = Process.myUid() + val stats = HashMap() + val args = HashMap() + for (dir in File("/proc").listFiles().orEmpty()) { + val pid = dir.name.toIntOrNull() ?: continue + if (pid == me) continue + val stat = runCatching { parseStat(File(dir, "stat").readText()) }.getOrNull() ?: continue + if (!owned(dir, uid)) continue + stats[pid] = stat + args[pid] = runCatching { File(dir, "cmdline").readBytes().toString(Charsets.UTF_8).trimEnd('\u0000').replace('\u0000', ' ') }.getOrDefault("") + } + val now = SystemClock.elapsedRealtime() + val uptimeTicks = now * HZ / 1000 + val elapsed = (now - lastAt).coerceAtLeast(1) + fun isProot(pid: Int) = args[pid].orEmpty().substringBefore(' ').endsWith("proot.so") || args[pid].orEmpty().substringBefore(' ').endsWith("/proot") + fun ancestors(pid: Int) = generateSequence(stats[pid]?.ppid) { stats[it]?.ppid }.takeWhile { it > 1 }.take(64) + val out = stats.values.filter { s -> + !isProot(s.pid) && args[s.pid].orEmpty().isNotEmpty() && ancestors(s.pid).any { isProot(it) } + }.map { s -> + val full = args[s.pid].orEmpty() + val cpu = lastTicks[s.pid]?.let { ((s.ticks - it) * 1000 * 100 / HZ / elapsed).toInt().coerceIn(0, 800) } ?: 0 + Proc( + s.pid, s.ppid, full.substringBefore(' ').substringAfterLast('/'), full, + ((uptimeTicks - s.startTicks) / HZ).coerceAtLeast(0), s.rssPages * 4, cpu, + turnPid > 0 && ancestors(s.pid).any { it == turnPid }, + ) + } + lastTicks = stats.mapValues { it.value.ticks } + lastAt = now + return out.sortedWith(compareByDescending { it.agent }.thenBy { it.seconds }) + } + + /** Ends [pid] and everything it started, children first so none is left to be re-parented. */ + fun killTree(pid: Int) { + if (pid <= 0) return + val children = HashMap>() + for (dir in File("/proc").listFiles().orEmpty()) { + val child = dir.name.toIntOrNull() ?: continue + val stat = runCatching { parseStat(File(dir, "stat").readText()) }.getOrNull() ?: continue + children.getOrPut(stat.ppid) { mutableListOf() } += child + } + val order = mutableListOf() + fun walk(p: Int) { + children[p].orEmpty().forEach(::walk) + order += p + } + walk(pid) + order.forEach { runCatching { Process.sendSignal(it, Process.SIGNAL_KILL) } } + } + + fun alive(pid: Int) = pid > 0 && File("/proc/$pid").exists() + + /** Processes whose command line contains [text], for ending a build the app did not start. */ + fun find(text: String): List = File("/proc").listFiles().orEmpty().mapNotNull { dir -> + val pid = dir.name.toIntOrNull() ?: return@mapNotNull null + if (pid == Process.myPid()) return@mapNotNull null + val args = runCatching { File(dir, "cmdline").readBytes().toString(Charsets.UTF_8).replace('\u0000', ' ') }.getOrDefault("") + pid.takeIf { args.contains(text) && owned(dir, Process.myUid()) } + } + + private fun owned(dir: File, uid: Int) = runCatching { + File(dir, "status").useLines { lines -> lines.first { it.startsWith("Uid:") }.split(Regex("\\s+"))[1].toInt() == uid } + }.getOrDefault(false) + + /** `/proc//stat`: the name in parentheses may hold spaces, so fields count from its end. */ + @VisibleForTesting + internal fun parseStat(text: String): Stat { + val pid = text.substringBefore(' ').toInt() + val f = text.substring(text.lastIndexOf(')') + 2).split(' ') + return Stat(pid, f[1].toInt(), f[11].toLong() + f[12].toLong(), f[19].toLong(), f[21].toLong()) + } + + /** The pid of a [java.lang.Process] the app started. */ + fun pidOf(process: java.lang.Process): Int = + runCatching { process.javaClass.getDeclaredField("pid").apply { isAccessible = true }.getInt(process) }.getOrNull() + ?: Regex("pid=(\\d+)").find(process.toString())?.groupValues?.get(1)?.toInt() ?: 0 +} diff --git a/app/src/main/java/com/droiddeck/launcher/agent/AgentSetup.kt b/app/src/main/java/com/droiddeck/launcher/agent/AgentSetup.kt new file mode 100644 index 0000000000..1ff5475b6e --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/agent/AgentSetup.kt @@ -0,0 +1,208 @@ +package com.droiddeck.launcher.agent + +import android.content.Context +import android.os.Handler +import android.os.Looper +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateMapOf +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.setValue +import com.droiddeck.launcher.runtime.LinuxRuntime +import com.droiddeck.launcher.session.OrphanReaper +import java.io.File +import java.util.concurrent.TimeUnit + +/** + * First-run setup for the agent, as steps with a check and an action each. The first three are + * needed to talk to the agent; GitHub and the build tools are only needed to open pull requests + * and to make Lab builds on the device. + */ +object AgentSetup { + enum class Step(val required: Boolean) { CONNECTION(true), INSTALL(true), SIGN_IN(true), GITHUB(false), BUILD_TOOLS(false), PREPARE(false) } + enum class Status { UNKNOWN, DONE, TODO, WORKING, FAILED } + + val status = mutableStateMapOf() + /** The last line of output from the step that is running or just failed. */ + val detail = mutableStateMapOf() + var runtimeInstalled by mutableStateOf(true) + private set + + val ready: Boolean get() = Step.entries.filter { it.required }.all { status[it] == Status.DONE } + + /** A step's action is running; its result belongs to the harness it started for. */ + val busy: Boolean get() = status.values.any { it == Status.WORKING } + + /** Set once the required steps have all passed, so the chat opens without waiting for the checks. */ + fun completed(context: Context) = AgentHost.prefs(context).getBoolean(completedKey(AgentHost.harness), false) + + private fun completedKey(harness: AgentHarness) = "setup_completed_${harness.id}" + + private val main = Handler(Looper.getMainLooper()) + private const val REPO = "https://github.com/Droid-Deck/DroidDeck.git" + private const val CHECKOUT = "/root/DroidDeck" + private val HELPERS = listOf("android-open", "dd-gh-login", "droiddeckctl") + internal const val CTL = "/root/.local/share/droiddeck/ctl" + private const val PROBE_TIMEOUT_S = 60L + + fun check(context: Context) { + val app = context.applicationContext + runtimeInstalled = LinuxRuntime.isInstalled(app) + if (!runtimeInstalled) return + AgentHost.refresh(app) + val harness = AgentHost.harness + val probes = mutableListOf>>() + for (step in Step.entries) if (status[step] != Status.WORKING) { + when (step) { + Step.INSTALL -> set(step, if (harness.files.all { AgentHost.guestFileExists(app, it) }) Status.DONE else Status.TODO) + Step.BUILD_TOOLS -> set(step, if (buildToolsInstalled(app)) Status.DONE else Status.TODO) + Step.PREPARE -> set(step, if (prepared(app)) Status.DONE else Status.TODO) + // The install brings the userland's adb; until then the app's own pairing is all there is to check. + Step.CONNECTION -> if (!AgentHost.guestFileExists(app, "/usr/bin/adb")) { + detail.remove(step) + Thread({ + val live = com.droiddeck.launcher.core.WirelessAdbFix.liveConnectAddress(app) != null + set(step, if (live) Status.DONE else Status.TODO) + }, "agent-connection").start() + } else probes += step to listOf("sh", "-c", + "for i in 1 2 3; do adb connect \"\$ADB_SERIAL\" >/dev/null 2>&1; " + + "state=\$(adb -s \"\$ADB_SERIAL\" get-state 2>&1); echo \"\$state\"; [ \"\$state\" = device ] && exit 0; sleep 1; done; exit 1") + Step.SIGN_IN -> if (AgentHost.guestFileExists(app, harness.binary)) probes += step to harness.signedIn else set(step, Status.TODO) + Step.GITHUB -> probes += step to listOf("gh", "auth", "status") + } + } + Thread({ for ((step, command) in probes) probe(app, harness, step, command) }, "agent-checks").start() + } + + fun runsAsRoot(step: Step) = step == Step.INSTALL + + /** Runs [step]'s action. [CONNECTION] is the app's own pairing flow, so the caller opens it. */ + fun run(context: Context, step: Step) { + val app = context.applicationContext + val harness = AgentHost.harness + val command = when (step) { + Step.CONNECTION -> return + Step.INSTALL -> { + listOf("sh", "-c", "set -e; export DEBIAN_FRONTEND=noninteractive; " + + "dpkg --configure -a; apt-get update || echo 'Some package sources could not be refreshed; continuing'; apt-get -f install -y; " + + "apt-get install -y --no-install-recommends git gh adb curl ca-certificates python3; ${harness.install}") + } + Step.SIGN_IN -> harness.signIn + Step.GITHUB -> listOf("dd-gh-login") + Step.BUILD_TOOLS -> listOf("sh", "-c", "set -e; [ -d $CHECKOUT/.git ] || git clone --filter=blob:none $REPO $CHECKOUT; " + + "cd $CHECKOUT; [ -x tools/agent/setup ] || { echo 'This DroidDeck version has no tools/agent/setup yet'; exit 1; }; tools/agent/setup") + Step.PREPARE -> listOf("sh", "-c", "cd $CHECKOUT && DD_LAB_DETACHED=1 dd-lab-build --prepare") + } + set(step, Status.WORKING) + detail.remove(step) + AgentHostService.setupStarted(app) + Thread({ + val result = runCatching { + installHelpers(app) + runCatching { harness.prepare(LinuxRuntime.rootDir(app)) } + val child = AgentHost.guest(app, command, fakeRoot = runsAsRoot(step)).start() + val pid = AgentProcesses.pidOf(child) + OrphanReaper.keep(pid) + try { + child.outputStream.close() + logFile(app, step).apply { parentFile?.mkdirs() }.bufferedWriter().use { log -> + child.inputStream.bufferedReader().forEachLine { line -> + log.appendLine(line) + val text = line.trim() + if (text.isNotEmpty() && !noise(text)) main.post { + detail[step] = text.take(160) + if (step == Step.GITHUB && text.startsWith("GitHub device code:")) AgentHostService.update(app) + } + } + child.waitFor().also { log.appendLine("exit $it") } + } + } finally { + OrphanReaper.release(pid) + } + } + main.post { + AgentHostService.setupEnded(app) + if (result.getOrNull() == 0) { + detail.remove(step) + status[step] = Status.UNKNOWN + check(app) + } else { + status[step] = Status.FAILED + if (result.isFailure) detail[step] = result.exceptionOrNull()?.message ?: "failed" + } + } + }, "agent-setup-${step.name.lowercase()}").start() + } + + /** The whole output of a step's last run; the card shows only its last line. */ + fun logFile(app: Context, step: Step) = File(app.filesDir, "agent/setup-${step.name.lowercase()}.log") + + fun buildToolsInstalled(app: Context) = AgentHost.guestFileExists(app, "/root/aapt2/aapt2") && AgentHost.guestFileExists(app, "$CHECKOUT/.git") + + /** dd-lab-build compiled this install's commit, so a Lab build compiles only what changed. */ + private fun prepared(app: Context) = runCatching { + File(LinuxRuntime.rootDir(app), "root/.cache/dd-lab-build-base").readText().trim() + .startsWith(com.droiddeck.launcher.lab.LabOverlay.apkCommit.take(7)) + }.getOrDefault(false) + + /** Drops what the checks found, which belonged to the previous harness. */ + fun forget() { + status.clear() + detail.clear() + } + + private fun probe(app: Context, harness: AgentHarness, step: Step, command: List) { + var output = "" + val ok = runCatching { + val child = AgentHost.guest(app, command, connectAdb = step == Step.CONNECTION).start() + child.outputStream.close() + val reader = Thread({ output = child.inputStream.bufferedReader().readText() }, "agent-check-output").apply { isDaemon = true; start() } + val exited = child.waitFor(PROBE_TIMEOUT_S, TimeUnit.SECONDS) + if (!exited) { + AgentProcesses.killTree(AgentProcesses.pidOf(child)) + child.destroyForcibly() + } + reader.join(2_000) + exited && child.exitValue() == 0 + }.onFailure { output = it.message.orEmpty() }.getOrDefault(false) + main.post { + if (AgentHost.harness != harness) return@post + if (status[step] != Status.WORKING) status[step] = if (ok) Status.DONE else Status.TODO + val last = output.lines().lastOrNull { it.isNotBlank() && !noise(it.trim()) }?.trim()?.take(160) + when { + ok -> detail.remove(step) + step == Step.CONNECTION -> detail[step] = app.getString(com.droiddeck.launcher.R.string.agent_connection_off) + step.required && last != null -> detail[step] = last + } + if (ready) AgentHost.prefs(app).edit().putBoolean(completedKey(harness), true).apply() + } + } + + /** proot warns about its bindings on every start; that says nothing about the step. */ + private fun noise(line: String) = line.startsWith("proot warning") + + private fun set(step: Step, value: Status) { + if (Looper.myLooper() == Looper.getMainLooper()) status[step] = value else main.post { status[step] = value } + } + + /** Written before every step, so the helpers a step relies on are there and match this DroidDeck version. */ + internal fun installHelpers(app: Context) { + val root = LinuxRuntime.rootDir(app) + val bin = File(root, "root/.local/bin").apply { mkdirs() } + for (name in HELPERS) copyAsset(app, "agent/$name", File(bin, name)) + val ctl = File(root, CTL.removePrefix("/")).apply { mkdirs() } + for (name in app.assets.list("agent/ctl").orEmpty()) copyAsset(app, "agent/ctl/$name", File(ctl, name)) + unpinAdbSerial(File(root, "root/.bashrc")) + } + + /** Older tools/agent/setup pinned the adb port in .bashrc, which overrides the live port DroidDeck passes. */ + internal fun unpinAdbSerial(bashrc: File) { + val text = runCatching { bashrc.readText() }.getOrNull() ?: return + val fixed = text.replace("ADB_SERIAL=127.0.0.1:5555 ", "ADB_SERIAL=\"\${ADB_SERIAL:-127.0.0.1:5555}\" ") + if (fixed != text) runCatching { bashrc.writeText(fixed) } + } + + private fun copyAsset(app: Context, asset: String, target: File) { + app.assets.open(asset).use { input -> target.outputStream().use { input.copyTo(it) } } + target.setExecutable(true, false) + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/agent/AgentStorage.kt b/app/src/main/java/com/droiddeck/launcher/agent/AgentStorage.kt new file mode 100644 index 0000000000..9eacc4a6b6 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/agent/AgentStorage.kt @@ -0,0 +1,95 @@ +package com.droiddeck.launcher.agent + +import android.content.Context +import android.os.Handler +import android.os.Looper +import androidx.annotation.VisibleForTesting +import androidx.compose.runtime.mutableStateMapOf +import com.droiddeck.launcher.runtime.LinuxRuntime +import java.io.File +import java.io.IOException +import java.nio.file.FileVisitResult +import java.nio.file.Files +import java.nio.file.Path +import java.nio.file.SimpleFileVisitor +import java.nio.file.attribute.BasicFileAttributes + +/** + * What the agent adds to the Linux userland, measured and removable piece by piece. Sign-ins + * (~/.claude, ~/.codex, gh's config) are left alone, so removing a CLI and installing it again + * does not sign out. + */ +object AgentStorage { + enum class Item(val paths: List) { + CLAUDE_CODE(listOf("/root/.local/share/claude", "/root/.local/bin/claude", "/root/cc")), + CODEX(listOf("/root/.local/bin/codex", "/root/.local/bin/codex-code-mode-host")), + BUILD_TOOLS(listOf("/root/android-sdk", "/root/aapt2", "/root/x86root", "/root/.gradle")), + SOURCE(listOf("/root/DroidDeck")), + CACHES(listOf("/root/.cache", "/root/.npm")), + } + + /** Bytes per item; missing while it is being measured. */ + val sizes = mutableStateMapOf() + val removing = mutableStateMapOf() + + private val main = Handler(Looper.getMainLooper()) + + fun measure(context: Context) { + val root = LinuxRuntime.rootDir(context.applicationContext) + Thread({ + for (item in Item.entries) { + val bytes = item.paths.sumOf { size(File(root, it.removePrefix("/")).toPath()) } + main.post { sizes[item] = bytes } + } + }, "agent-storage").start() + } + + fun remove(context: Context, item: Item) { + val app = context.applicationContext + val root = LinuxRuntime.rootDir(app) + removing[item] = true + Thread({ + for (path in item.paths) runCatching { delete(File(root, path.removePrefix("/")).toPath()) } + main.post { + removing.remove(item) + AgentHost.refresh(app) + AgentSetup.check(app) + measure(app) + } + }, "agent-storage-remove").start() + } + + /** Walks without following links, so a link out of the rootfs (into /sdcard, say) counts and removes only itself. */ + @VisibleForTesting + internal fun size(path: Path): Long { + if (!Files.exists(path, java.nio.file.LinkOption.NOFOLLOW_LINKS)) return 0 + var total = 0L + Files.walkFileTree(path, object : SimpleFileVisitor() { + override fun visitFile(file: Path, attrs: BasicFileAttributes): FileVisitResult { + total += attrs.size() + return FileVisitResult.CONTINUE + } + override fun visitFileFailed(file: Path, exc: IOException) = FileVisitResult.CONTINUE + }) + return total + } + + @VisibleForTesting + internal fun delete(path: Path) { + if (!Files.exists(path, java.nio.file.LinkOption.NOFOLLOW_LINKS)) return + Files.walkFileTree(path, object : SimpleFileVisitor() { + override fun visitFile(file: Path, attrs: BasicFileAttributes): FileVisitResult { + Files.deleteIfExists(file) + return FileVisitResult.CONTINUE + } + override fun postVisitDirectory(dir: Path, exc: IOException?): FileVisitResult { + Files.deleteIfExists(dir) + return FileVisitResult.CONTINUE + } + override fun visitFileFailed(file: Path, exc: IOException): FileVisitResult { + runCatching { Files.deleteIfExists(file) } + return FileVisitResult.CONTINUE + } + }) + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/agent/AgentTab.kt b/app/src/main/java/com/droiddeck/launcher/agent/AgentTab.kt new file mode 100644 index 0000000000..7392473c72 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/agent/AgentTab.kt @@ -0,0 +1,23 @@ +package com.droiddeck.launcher.agent + +import android.content.Context +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.setValue +import com.droiddeck.launcher.session.SessionPrefs + +object AgentTab { + var shown by mutableStateOf(true) + private set + + val visible: Boolean get() = shown && AgentHost.available + + fun load(context: Context) { + shown = SessionPrefs.agentTab(context) + } + + fun set(context: Context, show: Boolean) { + shown = show + SessionPrefs.setAgentTab(context, show) + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/agent/AgentTools.kt b/app/src/main/java/com/droiddeck/launcher/agent/AgentTools.kt new file mode 100644 index 0000000000..9451b79c85 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/agent/AgentTools.kt @@ -0,0 +1,143 @@ +package com.droiddeck.launcher.agent + +import android.content.Context +import com.droiddeck.launcher.runtime.LinuxRuntime +import java.io.File +import java.nio.file.FileVisitResult +import java.nio.file.Files +import java.nio.file.LinkOption +import java.nio.file.Path +import java.nio.file.SimpleFileVisitor +import java.nio.file.attribute.BasicFileAttributes +import java.util.concurrent.TimeUnit + +/** Claude Code's MCP servers and skills in the userland, through its own CLI and skills folder. */ +internal object AgentTools { + data class Server(val name: String, val target: String, val status: String) { + /** Connectors come from the claude.ai account and are managed there, not by the CLI. */ + val account get() = name.startsWith("claude.ai ") + } + + data class Skill(val name: String, val description: String) + + class Result(val ok: Boolean, val output: String) + + private const val SKILLS = "root/.claude/skills" + private val SERVER = Regex("""^(.+?): (.+) - (.+)$""") + + fun servers(context: Context): List? { + val result = run(context, listOf(ClaudeCode.binary, "mcp", "list")) + if (!result.ok) return null + return parseServers(result.output) + } + + internal fun parseServers(output: String): List = output.lines().mapNotNull { line -> + SERVER.find(line.trim())?.destructured?.let { (name, target, status) -> Server(name, target, status) } + } + + /** A URL is added as an HTTP server; anything else is the command that starts a stdio server. */ + internal fun addCommand(name: String, target: String): List { + val t = target.trim() + val base = listOf(ClaudeCode.binary, "mcp", "add", "--scope", "user") + return if (t.startsWith("http://") || t.startsWith("https://")) base + listOf("--transport", "http", name.trim(), t) + else base + listOf(name.trim(), "--") + words(t) + } + + /** Splits a command line the way a shell would for quotes and backslashes, without expanding anything. */ + internal fun words(line: String): List { + val words = mutableListOf() + val word = StringBuilder() + var inWord = false + var quote: Char? = null + var i = 0 + while (i < line.length) { + val c = line[i] + when { + quote == '\'' -> if (c == '\'') quote = null else word.append(c) + c == '\\' && i + 1 < line.length && (quote == null || line[i + 1] == '"' || line[i + 1] == '\\') -> { + word.append(line[++i]) + inWord = true + } + quote == '"' -> if (c == '"') quote = null else word.append(c) + c == '\'' || c == '"' -> { + quote = c + inWord = true + } + c.isWhitespace() -> if (inWord) { + words += word.toString() + word.clear() + inWord = false + } + else -> { + word.append(c) + inWord = true + } + } + i++ + } + if (inWord) words += word.toString() + return words + } + + fun add(context: Context, name: String, target: String) = run(context, addCommand(name, target)) + + fun remove(context: Context, name: String) = run(context, listOf(ClaudeCode.binary, "mcp", "remove", name)) + + fun skills(context: Context): List = + File(LinuxRuntime.rootDir(context), SKILLS).listFiles { f -> f.isDirectory }.orEmpty().sortedBy { it.name.lowercase() }.map { dir -> + Skill(dir.name, description(File(dir, "SKILL.md"))) + } + + internal fun description(file: File): String = runCatching { + val lines = file.readLines() + if (lines.firstOrNull()?.trim() != "---") return@runCatching "" + lines.drop(1).takeWhile { it.trim() != "---" }.firstOrNull { it.startsWith("description:") } + ?.removePrefix("description:")?.trim()?.trim('"', '\'').orEmpty() + }.getOrDefault("") + + fun deleteSkill(context: Context, name: String): Boolean { + if (name.isEmpty() || name.contains('/') || name.startsWith(".")) return false + val root = File(LinuxRuntime.rootDir(context), SKILLS) + val dir = File(root, name) + if (dir.parentFile?.path != root.path) return false + return deleteTree(dir.toPath()) + } + + /** Deletes [path] and what is under it; a symbolic link is removed itself, never what it points to. */ + internal fun deleteTree(path: Path): Boolean = runCatching { + if (!Files.exists(path, LinkOption.NOFOLLOW_LINKS)) return@runCatching true + Files.walkFileTree(path, object : SimpleFileVisitor() { + override fun visitFile(file: Path, attrs: BasicFileAttributes): FileVisitResult { + Files.delete(file) + return FileVisitResult.CONTINUE + } + + override fun postVisitDirectory(dir: Path, exc: java.io.IOException?): FileVisitResult { + if (exc != null) throw exc + Files.delete(dir) + return FileVisitResult.CONTINUE + } + }) + true + }.getOrDefault(false) + + private fun run(context: Context, command: List): Result { + val child = runCatching { AgentHost.guest(context.applicationContext, command, connectAdb = false).start() } + .getOrElse { return Result(false, it.message.orEmpty()) } + val output = StringBuffer() + // The CLI can hold its output open past the deadline, so it is read beside the wait rather than before it. + val reader = Thread({ runCatching { child.inputStream.bufferedReader().forEachLine { output.append(it).append('\n') } } }, "agent-tools").apply { start() } + return try { + val ended = child.waitFor(90, TimeUnit.SECONDS) + if (!ended) child.destroyForcibly() + reader.join(2_000) + Result(ended && child.exitValue() == 0, output.toString().trim()) + } catch (e: InterruptedException) { + child.destroyForcibly() + Thread.currentThread().interrupt() + Result(false, output.toString().trim()) + } finally { + runCatching { child.inputStream.close() } + } + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/agent/LabProgress.kt b/app/src/main/java/com/droiddeck/launcher/agent/LabProgress.kt new file mode 100644 index 0000000000..ff16eeebd7 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/agent/LabProgress.kt @@ -0,0 +1,53 @@ +package com.droiddeck.launcher.agent + +import androidx.annotation.VisibleForTesting +import org.json.JSONObject +import java.io.File + +/** A Lab build in progress, as dd-lab-build reports it in `~/.cache/dd-lab-build.json`. */ +data class LabProgress( + val stage: String, val prepare: Boolean, val permille: Int, val task: String, + val done: Int, val total: Int, val etaSeconds: Int, val elapsedSeconds: Int, val pid: Int, +) { + val running get() = stage in RUNNING + val failed get() = stage == "failed" + + companion object { + private val RUNNING = setOf("checking", "fetching", "sdk", "planning", "building", "packaging", "restarting") + private const val PATH = "root/.cache/dd-lab-build.json" + /** A finished build stays on screen this long. */ + private const val SHOW_DONE_MS = 60_000L + + /** The build, while it runs and shortly after; null when there is none to show. */ + fun read(rootfs: File): LabProgress? { + val file = File(rootfs, PATH) + if (!file.isFile) return null + val parsed = parse(runCatching { file.readText() }.getOrNull() ?: return null) ?: return null + val progress = when { + !parsed.running || AgentProcesses.alive(parsed.pid) -> parsed + // The restart ends the app and the script with it, so a restart that got that far succeeded. + parsed.stage == "restarting" -> parsed.copy(stage = "ready") + else -> parsed.copy(stage = "failed", task = "stopped") + } + return progress.takeIf { it.running || System.currentTimeMillis() - file.lastModified() < SHOW_DONE_MS } + } + + /** Ends the build and Gradle's daemon, which keeps compiling after its client is gone. */ + fun cancel(rootfs: File, progress: LabProgress) { + AgentProcesses.killTree(progress.pid) + AgentProcesses.find("GradleDaemon").forEach(AgentProcesses::killTree) + runCatching { + File(rootfs, PATH).writeText(JSONObject().put("stage", "failed").put("task", "stopped").put("pid", 0).toString()) + } + } + + @VisibleForTesting + internal fun parse(json: String): LabProgress? = runCatching { + val o = JSONObject(json) + LabProgress( + o.getString("stage"), o.optString("mode") == "prepare", o.optInt("permille"), o.optString("task"), + o.optInt("done"), o.optInt("total"), o.optInt("eta", -1), o.optInt("elapsed"), o.optInt("pid"), + ) + }.getOrNull() + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/core/AddonPack.kt b/app/src/main/java/com/droiddeck/launcher/core/AddonPack.kt index 4f88d90e34..1d270abbc8 100644 --- a/app/src/main/java/com/droiddeck/launcher/core/AddonPack.kt +++ b/app/src/main/java/com/droiddeck/launcher/core/AddonPack.kt @@ -3,6 +3,7 @@ package com.droiddeck.launcher.core import android.content.Context import android.util.Log import com.droiddeck.launcher.BuildConfig +import com.droiddeck.launcher.lab.LabOverlay import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.SupervisorJob @@ -16,6 +17,7 @@ import java.io.FileInputStream internal class AddonPack( val name: String, private val sha256: String, val size: Long, private val required: List, private val reuseDeviceCopy: Boolean = sha256.isEmpty() && !BuildConfig.CI_BUILD, + private val labBuild: Boolean = LabOverlay.active != null, private val bundle: (Context) -> java.io.InputStream = { it.assets.open("packs/$name.tar.zst") }, ) { sealed interface State { @@ -29,6 +31,9 @@ internal class AddonPack( val state: StateFlow = mutableState.asStateFlow() private val lock = Any() + @Volatile var failure: String? = null + private set + val available: Boolean get() = sha256.isNotEmpty() private val tag get() = "pack-$name-${sha256.take(16)}" private val urls get() = listOfNotNull( @@ -42,7 +47,8 @@ internal class AddonPack( fun installed(context: Context): Boolean = version(context).isNotEmpty() && File(dir(context), COMPLETE).isFile - private fun version(context: Context): String = if (!reuseDeviceCopy) sha256 else deviceCopy(context).orEmpty() + private fun version(context: Context): String = + if (reuseDeviceCopy || labBuild) deviceCopy(context) ?: sha256 else sha256 private fun deviceCopy(context: Context): String? = root(context).listFiles().orEmpty() .filter { dir -> @@ -64,9 +70,13 @@ internal class AddonPack( if (installed(app)) { mutableState.value = State.Ready; return } if (mutableState.value is State.Downloading) return mutableState.value = State.Downloading(0f) + failure = null } scope.launch { - val ok = runCatching { install(app) }.onFailure { Log.w(TAG, "$name: install failed", it) }.getOrDefault(false) + val ok = runCatching { install(app) }.onFailure { + Log.w(TAG, "$name: install failed", it) + failure = it.toString() + }.getOrDefault(false) mutableState.value = if (ok) State.Ready else State.Failed if (ok) onReady(app) } @@ -90,20 +100,28 @@ internal class AddonPack( private fun install(context: Context): Boolean { if (!available) { - Log.w(TAG, if (reuseDeviceCopy) "$name: this build has no pack and none is installed" else "$name: this build has no pack") + failure = if (reuseDeviceCopy) "this build has no pack and none is installed" else "this build has no pack" + Log.w(TAG, "$name: $failure") return false } val root = root(context).apply { mkdirs() } val archive = File(root, "$sha256.tar.zst") + val problems = mutableListOf() val downloaded = bundled(context, archive) || urls.any { url -> Downloader.downloadFile(url, archive, true, sha256) { p -> mutableState.value = State.Downloading(p.coerceIn(0f, 1f)) } - .also { if (!it) archive.delete() } + .also { if (!it) { archive.delete(); Downloader.lastFailure()?.let(problems::add) } } + } + if (!downloaded) { + failure = problems.joinToString("; ").ifEmpty { "download failed" } + return false } - if (!downloaded) return false val staging = File(root, "$sha256.partial") staging.deleteRecursively() try { - if (!FileInputStream(archive).use { TarZst.extract(it, staging) }) return false + if (!FileInputStream(archive).use { TarZst.extract(it, staging) }) { + failure = "could not unpack the pack" + return false + } check(required.all { File(staging, it).isFile }) { "$name pack is incomplete" } File(staging, COMPLETE).writeText(sha256) val target = dir(context) @@ -152,5 +170,7 @@ internal class AddonPack( @JvmField val POWERVR = AddonPack("powervr", BuildConfig.PACK_POWERVR_SHA256, BuildConfig.PACK_POWERVR_SIZE, listOf("runtime.tzst", "version.txt")) + val UBISOFT = AddonPack("ubisoft", BuildConfig.PACK_UBISOFT_SHA256, BuildConfig.PACK_UBISOFT_SIZE, + listOf("droiddeck-upc.exe")) } } diff --git a/app/src/main/java/com/droiddeck/launcher/core/AppUiPrefs.kt b/app/src/main/java/com/droiddeck/launcher/core/AppUiPrefs.kt index 7b8536202d..c4c29a2369 100644 --- a/app/src/main/java/com/droiddeck/launcher/core/AppUiPrefs.kt +++ b/app/src/main/java/com/droiddeck/launcher/core/AppUiPrefs.kt @@ -27,6 +27,32 @@ object AppUiPrefs { context.getSharedPreferences("app-ui", Context.MODE_PRIVATE).edit().putInt("orientation", value).apply() } + const val HOME_PAGE_STEAM = "steam" + const val HOME_PAGE_APPS = "android-apps" + + val homePageOptions = listOf( + HOME_PAGE_STEAM to R.string.rail_steam, + HOME_PAGE_APPS to R.string.content_android_apps, + ) + + fun homePage(context: Context): String = + context.getSharedPreferences("app-ui", Context.MODE_PRIVATE) + .getString("home-page", null) + .takeIf { value -> homePageOptions.any { it.first == value } } + ?: HOME_PAGE_STEAM + + fun setHomePage(context: Context, value: String) { + require(homePageOptions.any { it.first == value }) + context.getSharedPreferences("app-ui", Context.MODE_PRIVATE).edit().putString("home-page", value).apply() + } + + fun hideHomeFromRecents(context: Context): Boolean = + context.getSharedPreferences("app-ui", Context.MODE_PRIVATE).getBoolean("hide-home-from-recents", false) + + fun setHideHomeFromRecents(context: Context, hidden: Boolean) { + context.getSharedPreferences("app-ui", Context.MODE_PRIVATE).edit().putBoolean("hide-home-from-recents", hidden).apply() + } + internal fun normalizeScale(percent: Int): Int = percent.takeIf { it in scales } ?: DEFAULT_SCALE fun scale(context: Context): Int = normalizeScale( diff --git a/app/src/main/java/com/droiddeck/launcher/core/DeviceReport.kt b/app/src/main/java/com/droiddeck/launcher/core/DeviceReport.kt index cb0b9487b8..c6dd49a4c3 100644 --- a/app/src/main/java/com/droiddeck/launcher/core/DeviceReport.kt +++ b/app/src/main/java/com/droiddeck/launcher/core/DeviceReport.kt @@ -274,10 +274,12 @@ object DeviceReport { EsyncPacks.status(LinuxRuntime.rootDir(context)).let { k("droiddeck-esync packs", "${it.installed} installed, ${it.wanted} wanted") } k("Linux x86 (FEX)", if (com.droiddeck.launcher.runtime.LinuxFex.ready(context)) "ready" else "not set up") k("gamescope realtime", SessionPrefs.gamescopeRealtime(context)) + k("pace cores", SessionPrefs.paceCores(context)) k("zRAM: compress Steam during games", SessionPrefs.zramClient(context)) k("RAM cap", SessionPrefs.ramCapMb(context).let { if (it > 0) "$it MB" else "off" }) k("VRAM cap", SessionPrefs.vramCapMb(context).let { if (it > 0) "$it MB" else "driver default" }) k("proot without seccomp", SessionPrefs.prootNoSeccomp(context)) + k("native userland (no proot)", SessionPrefs.nativeUserland(context)) k("proot fast path", SessionPrefs.prootFastPath(context)) k("proot binary", LinuxRuntime.prootSource(context) + " " + LinuxRuntime.prootBinary(context).path) k("proot fast path (eligible)", com.droiddeck.launcher.runtime.ProotFastPath.enabled(context)) diff --git a/app/src/main/java/com/droiddeck/launcher/core/Downloader.java b/app/src/main/java/com/droiddeck/launcher/core/Downloader.java index 9bd86c5719..7d5427a8cb 100644 --- a/app/src/main/java/com/droiddeck/launcher/core/Downloader.java +++ b/app/src/main/java/com/droiddeck/launcher/core/Downloader.java @@ -31,8 +31,26 @@ public final class Downloader { return thread; }); + private static final ThreadLocal LAST_FAILURE = new ThreadLocal<>(); + private Downloader() {} + public static String lastFailure() { + return LAST_FAILURE.get(); + } + + private static void failed(String url, String reason) { + String host; + try { host = new java.net.URI(url).getHost(); } catch (java.net.URISyntaxException e) { host = null; } + String entry = (host == null ? url : host) + ": " + reason; + String earlier = LAST_FAILURE.get(); + LAST_FAILURE.set(earlier == null ? entry : earlier + "; " + entry); + } + + private static String describe(Exception e) { + return e.getMessage() == null ? e.getClass().getSimpleName() : e.getClass().getSimpleName() + ": " + e.getMessage(); + } + public static final class Cancellation implements java.util.function.BooleanSupplier { private final AtomicBoolean cancelled = new AtomicBoolean(); private final AtomicReference connection = new AtomicReference<>(); @@ -87,12 +105,14 @@ public final class Downloader { public static String downloadString(String url, java.util.function.BooleanSupplier cancelled) { List sources = DownloadSource.INSTANCE.candidates(url); + LAST_FAILURE.remove(); for (int i = 0; i < sources.size(); i++) { if (isCancelled(cancelled)) return null; if (i > 0) Log.i(TAG, "retrying " + url + " via " + sources.get(i)); Fetch fetch = fetch(sources.get(i), cancelled); if (isCancelled(cancelled)) return null; if (fetch.body != null) { + LAST_FAILURE.remove(); DownloadSource.INSTANCE.succeeded(sources.get(i)); return fetch.body; } @@ -103,6 +123,7 @@ public final class Downloader { } public static String downloadDirect(String url) { + LAST_FAILURE.remove(); return fetch(url).body; } @@ -138,6 +159,7 @@ public final class Downloader { String expectedSha256, java.util.function.BooleanSupplier cancelled, java.util.function.Consumer progress) { Identity identity = loadIdentity(destination, resume, expectedSha256); + LAST_FAILURE.remove(); for (int i = 0; i < sources.size(); i++) { String source = sources.get(i); if (isCancelled(cancelled)) return false; @@ -150,12 +172,14 @@ public final class Downloader { if (isCancelled(cancelled)) return false; if (!expectedSha256.equalsIgnoreCase(actualSha256)) { Log.w(TAG, "checksum mismatch from " + source + "; trying another source"); + failed(source, "checksum mismatch"); if (!discardPartial(destination, identity)) return false; continue; } } if (isCancelled(cancelled)) return false; resumeFile(destination).delete(); + LAST_FAILURE.remove(); DownloadSource.INSTANCE.succeeded(source); if (progress != null) progress.accept(1f); return true; @@ -260,6 +284,7 @@ public final class Downloader { } if (code / 100 != 2) { Log.w(TAG, url + " -> HTTP " + code); + failed(url, "HTTP " + code); return code == HttpURLConnection.HTTP_NOT_FOUND || code == HttpURLConnection.HTTP_GONE ? Outcome.FATAL : Outcome.RETRY; } @@ -308,11 +333,15 @@ public final class Downloader { if (cancelled instanceof Cancellation) ((Cancellation) cancelled).detach(input); } if (isCancelled(cancelled)) return Outcome.CANCELLED; - if (total > 0 && written < total) return Outcome.RETRY; + if (total > 0 && written < total) { + failed(url, "connection closed after " + written + " of " + total + " bytes"); + return Outcome.RETRY; + } return Outcome.DONE; } catch (Exception e) { if (isCancelled(cancelled)) return Outcome.CANCELLED; Log.w(TAG, "download " + url, e); + failed(url, describe(e)); return Outcome.RETRY; } finally { if (connection != null) { @@ -357,6 +386,7 @@ public final class Downloader { int code = connection.getResponseCode(); if (code / 100 != 2) { Log.w(TAG, url + " -> HTTP " + code); + failed(url, "HTTP " + code); return new Fetch(null, code == HttpURLConnection.HTTP_NOT_FOUND || code == HttpURLConnection.HTTP_GONE); } try (InputStream in = connection.getInputStream(); @@ -367,6 +397,7 @@ public final class Downloader { } catch (Exception e) { if (isCancelled(cancelled)) return new Fetch(null, false); Log.w(TAG, "GET " + url, e); + failed(url, describe(e)); return new Fetch(null, false); } finally { if (connection != null) { diff --git a/app/src/main/java/com/droiddeck/launcher/core/GameEnvironment.kt b/app/src/main/java/com/droiddeck/launcher/core/GameEnvironment.kt index 26ffb499cc..53f152a60b 100644 --- a/app/src/main/java/com/droiddeck/launcher/core/GameEnvironment.kt +++ b/app/src/main/java/com/droiddeck/launcher/core/GameEnvironment.kt @@ -49,6 +49,16 @@ object GameEnvironment { return withScopeValue(config, scope, NO_STEAM, if (on) "1" else null) } + const val GAME_RESOLUTION = "DROIDDECK_GAME_RESOLUTION" + + fun gameResolution(config: Config, scope: String): GameResolution.Choice? = + if (scope.isEmpty()) null else GameResolution.parse(config.games[scope]?.get(GAME_RESOLUTION)) + + fun withGameResolution(config: Config, scope: String, choice: GameResolution.Choice?): Config { + require(scope.isNotEmpty() && validScope(scope)) + return withScopeValue(config, scope, GAME_RESOLUTION, choice?.let(GameResolution::format)) + } + fun effective(config: Config, preset: String, scope: String, forceSsbs: Boolean = false): Map = defaults(preset, forceSsbs) + config.shared + if (scope.isEmpty()) emptyMap() else config.games[scope].orEmpty() diff --git a/app/src/main/java/com/droiddeck/launcher/core/GameResolution.kt b/app/src/main/java/com/droiddeck/launcher/core/GameResolution.kt new file mode 100644 index 0000000000..0255d9616b --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/core/GameResolution.kt @@ -0,0 +1,70 @@ +package com.droiddeck.launcher.core + +object GameResolution { + sealed interface Choice + data class Fixed(val width: Int, val height: Int) : Choice + data class Scaled(val scale: Float) : Choice + + data class Aspect(val label: String, val sizes: List) + + val aspects = listOf( + Aspect("16:9", listOf(Fixed(960, 540), Fixed(1280, 720), Fixed(1600, 900), Fixed(1920, 1080), Fixed(2560, 1440))), + Aspect("16:10", listOf(Fixed(1280, 800), Fixed(1440, 900), Fixed(1680, 1050), Fixed(1920, 1200), Fixed(2560, 1600))), + Aspect("4:3", listOf(Fixed(640, 480), Fixed(800, 600), Fixed(1024, 768), Fixed(1280, 960), Fixed(1440, 1080))), + ) + + val scales = listOf(1.5f, 2f, 3f) + + const val MIN_WIDTH = 320 + const val MIN_HEIGHT = 240 + const val MAX_SIDE = 7680 + private const val SCALED_PREFIX = "/" + + fun parse(value: String?): Choice? { + val text = value?.trim().orEmpty() + if (text.startsWith(SCALED_PREFIX)) { + return text.removePrefix(SCALED_PREFIX).toFloatOrNull()?.takeIf { it > 1f && it <= 8f }?.let(::Scaled) + } + val parts = text.split('x', 'X', 'ร—').map { it.trim().toIntOrNull() } + if (parts.size != 2) return null + val (w, h) = parts + return if (w != null && h != null && valid(w, h)) Fixed(w and 1.inv(), h and 1.inv()) else null + } + + fun valid(width: Int, height: Int) = width in MIN_WIDTH..MAX_SIDE && height in MIN_HEIGHT..MAX_SIDE + + fun format(choice: Choice): String = when (choice) { + is Fixed -> "${choice.width}x${choice.height}" + is Scaled -> SCALED_PREFIX + formatScale(choice.scale) + } + + fun formatScale(scale: Float): String = + (Math.round(scale * 10) / 10f).let { if (it % 1f == 0f) it.toInt().toString() else it.toString() } + + fun resolve(choice: Choice, output: Pair): Pair = when (choice) { + is Fixed -> choice.width to choice.height + is Scaled -> (Math.round(output.first / choice.scale).coerceAtLeast(MIN_WIDTH) and 1.inv()) to + (Math.round(output.second / choice.scale).coerceAtLeast(MIN_HEIGHT) and 1.inv()) + } + + fun aspectLabel(width: Int, height: Int): String { + if (width <= 0 || height <= 0) return "" + val ratio = width.toFloat() / height + aspects.firstOrNull { a -> + val (w, h) = a.label.split(':').map(String::toFloat) + kotlin.math.abs(ratio - w / h) < 0.02f + }?.let { return it.label } + if (kotlin.math.abs(ratio - 64f / 27f) < 0.04f || kotlin.math.abs(ratio - 21f / 9f) < 0.04f) return "21:9" + val g = gcd(width, height) + return if (width / g <= 32) "${width / g}:${height / g}" else String.format(java.util.Locale.ROOT, "%.2f:1", ratio) + } + + fun sizesFor(aspect: Aspect, panel: Pair): List { + val long = maxOf(panel.first, panel.second) + val short = minOf(panel.first, panel.second) + val fit = aspect.sizes.filter { it.width <= long && it.height <= short } + return fit.ifEmpty { aspect.sizes.take(1) } + } + + private tailrec fun gcd(a: Int, b: Int): Int = if (b == 0) a else gcd(b, a % b) +} diff --git a/app/src/main/java/com/droiddeck/launcher/core/HostProcess.kt b/app/src/main/java/com/droiddeck/launcher/core/HostProcess.kt index 0757192461..114e337892 100644 --- a/app/src/main/java/com/droiddeck/launcher/core/HostProcess.kt +++ b/app/src/main/java/com/droiddeck/launcher/core/HostProcess.kt @@ -13,6 +13,11 @@ object HostProcess { @JvmStatic fun start(command: String, env: Array?, dir: File?, onExit: Consumer?, onLine: Consumer?, outputFile: File?): Int { + return start(command, env, dir, onExit, onLine, outputFile, null) + } + + @JvmStatic + fun start(command: String, env: Array?, dir: File?, onExit: Consumer?, onLine: Consumer?, outputFile: File?, onOutputComplete: Runnable?): Int { val argv = split(command) if (argv.isEmpty()) return -1 return try { @@ -35,6 +40,8 @@ object HostProcess { try { process.inputStream.bufferedReader().useLines { lines -> lines.forEach { onLine.accept(it) } } } catch (e: Exception) { + } finally { + onOutputComplete?.run() } }, "proc-out-$pid").apply { priority = Thread.NORM_PRIORITY - 1; isDaemon = true; start() } } diff --git a/app/src/main/java/com/droiddeck/launcher/core/SessionLogCapture.kt b/app/src/main/java/com/droiddeck/launcher/core/SessionLogCapture.kt index b9c0256dbf..c7b4a78c7c 100644 --- a/app/src/main/java/com/droiddeck/launcher/core/SessionLogCapture.kt +++ b/app/src/main/java/com/droiddeck/launcher/core/SessionLogCapture.kt @@ -5,6 +5,9 @@ import android.util.Log import java.io.BufferedWriter import java.io.File import java.io.FileOutputStream +import java.nio.file.Files +import java.nio.file.StandardCopyOption +import java.util.concurrent.atomic.AtomicInteger object SessionLogCapture { private const val TAG = "SessionLogCapture" @@ -104,4 +107,53 @@ object SessionLogCapture { Log.w(TAG, "could not dump the crash buffer", e) } } + + fun dumpMemoryPressure(target: File) { + var temporary: File? = null + try { + val staged = File.createTempFile(target.name, ".part", target.parentFile).also { temporary = it } + val lines = StringBuilder() + val done = java.util.concurrent.CountDownLatch(1) + val outputDone = java.util.concurrent.CountDownLatch(1) + val exitStatus = AtomicInteger(Int.MIN_VALUE) + val pid = HostProcess.start( + "/system/bin/logcat -b events -d -v threadtime -t 800", null, target.parentFile, + { status -> exitStatus.set(status); done.countDown() }, + { line -> synchronized(lines) { lines.append(line).append('\n') } }, + null, + outputDone::countDown, + ) + val deadline = System.nanoTime() + java.util.concurrent.TimeUnit.SECONDS.toNanos(10) + val finished = if (pid == -1) false else { + val exitTime = deadline - System.nanoTime() + exitTime > 0 && done.await(exitTime, java.util.concurrent.TimeUnit.NANOSECONDS) && + (deadline - System.nanoTime()).let { it > 0 && outputDone.await(it, java.util.concurrent.TimeUnit.NANOSECONDS) } + } + val body = synchronized(lines) { lines.toString() } + val status = exitStatus.get() + val pressure = runCatching { File("/proc/pressure/memory").readText() }.getOrDefault("unavailable\n") + val meminfo = runCatching { File("/proc/meminfo").readText() }.getOrDefault("unavailable\n") + val gpu = runCatching { File("/sys/class/kgsl/kgsl/page_alloc").readText() }.getOrDefault("unavailable\n") + staged.writeText( + "Android memory events:\n" + + when { + pid == -1 -> "(logcat could not be started at all)\n" + status != Int.MIN_VALUE && status != 0 -> "(logcat failed with exit status $status; no Android memory events were captured)\n" + + if (body.isEmpty()) "" else "\nlogcat command output:\n$body" + !finished -> if (body.isEmpty()) "(logcat did not finish within 10 s; nothing captured)\n" + else body + "(logcat did not finish within 10 s; later events may be missing)\n" + body.isNotEmpty() -> body + else -> "(no readable events were returned)\n" + } + + "\n/proc/pressure/memory:\n$pressure\n/proc/meminfo:\n$meminfo\n/sys/class/kgsl/kgsl/page_alloc:\n$gpu" + ) + Files.move( + staged.toPath(), target.toPath(), + StandardCopyOption.REPLACE_EXISTING, StandardCopyOption.ATOMIC_MOVE, + ) + } catch (e: Exception) { + temporary?.delete() + Log.w(TAG, "could not dump memory pressure diagnostics", e) + } + } } diff --git a/app/src/main/java/com/droiddeck/launcher/core/WirelessAdbFix.kt b/app/src/main/java/com/droiddeck/launcher/core/WirelessAdbFix.kt index fcb5d08894..784b39d748 100644 --- a/app/src/main/java/com/droiddeck/launcher/core/WirelessAdbFix.kt +++ b/app/src/main/java/com/droiddeck/launcher/core/WirelessAdbFix.kt @@ -41,6 +41,7 @@ object WirelessAdbFix { writeAtomically(context, key, identity.second) } + @Synchronized private fun writeAtomically(context: Context, destination: File, contents: ByteArray) { val temporary = File(destination.parentFile, "${destination.name}.tmp") temporary.writeBytes(contents) @@ -70,6 +71,52 @@ object WirelessAdbFix { "$host:${saved.port ?: ""}" } + /** + * The saved pairing's connect address, looked up again when it no longer answers: Wireless + * debugging moves to another port whenever it restarts. + */ + fun liveConnectAddress(context: Context): String? { + val app = context.applicationContext + val saved = savedConnection(app) ?: return null + val host = if (':' in saved.host) "[${saved.host}]" else saved.host + saved.port?.takeIf { answers(saved.host, it) }?.let { return "$host:$it" } + val loopback = runCatching { InetAddress.getByName(saved.host).isLoopbackAddress }.getOrDefault(false) + val port = if (loopback) loopbackAdbPort(app) else findConnectPort(app, saved.host, accept = { answers(saved.host, it) }) + port ?: return null + saveConnection(app, saved.host, port) + return "$host:$port" + } + + /** + * Wireless debugging's port on this device. Apps can read neither service.adb.tls.port nor the + * socket table, and mDNS often advertises nothing, so the ephemeral range Linux gives adbd is + * scanned on loopback (closed ports refuse at once) and the open ports are tried with our key. + */ + private fun loopbackAdbPort(app: Context): Int? { + val open = java.util.concurrent.ConcurrentLinkedQueue() + val workers = 32 + val range = EPHEMERAL_PORTS + (0 until workers).map { worker -> + Thread { + var port = range.first + worker + while (port <= range.last) { + if (answers(LOOPBACK, port, 150)) open += port + port += workers + } + }.apply { start() } + }.forEach { it.join() } + loadOrCreateIdentity(app) + return open.sorted().firstOrNull { port -> + runCatching { Kadb.create(LOOPBACK, port, 1_000, 3_000).use { it.shell("true").exitCode == 0 } }.getOrDefault(false) + } + } + + private val EPHEMERAL_PORTS = 32768..60999 + + private fun answers(host: String, port: Int, timeoutMs: Int = 500) = runCatching { + java.net.Socket().use { it.connect(java.net.InetSocketAddress(host, port), timeoutMs) } + }.isSuccess + private fun saveConnection(context: Context, host: String, port: Int) { writeAtomically( context, @@ -94,7 +141,8 @@ object WirelessAdbFix { .invoke(null, "service.adb.tls.port") as? String }.getOrNull()?.trim()?.toIntOrNull()?.takeIf { it in 1..65535 } - fun findConnectPort(context: Context, pairedHost: String, timeoutSeconds: Long = 12): Int? { + /** [accept] can pass over stale services that still advertise a port Wireless debugging left. */ + fun findConnectPort(context: Context, pairedHost: String, timeoutSeconds: Long = 12, accept: (Int) -> Boolean = { true }): Int? { val manager = context.applicationContext.getSystemService(Context.NSD_SERVICE) as NsdManager val paired = runCatching { InetAddress.getByName(pairedHost) }.getOrNull() ?: return null val matches: (InetAddress) -> Boolean = @@ -122,7 +170,7 @@ object WirelessAdbFix { override fun onServiceResolved(serviceInfo: NsdServiceInfo) { val address = serviceInfo.host - if (address != null && matches(address) && finished.compareAndSet(false, true)) { + if (address != null && matches(address) && accept(serviceInfo.port) && finished.compareAndSet(false, true)) { resolvedPort.set(serviceInfo.port) latch.countDown() } else { diff --git a/app/src/main/java/com/droiddeck/launcher/frontend/AddedGames.kt b/app/src/main/java/com/droiddeck/launcher/frontend/AddedGames.kt index 7057cadd39..eefe397723 100644 --- a/app/src/main/java/com/droiddeck/launcher/frontend/AddedGames.kt +++ b/app/src/main/java/com/droiddeck/launcher/frontend/AddedGames.kt @@ -97,15 +97,16 @@ object AddedGames { return File(LinuxRuntime.rootDir(context), guest.removePrefix("/")) } - fun candidates(folder: File): List = rank(folder).exes + fun candidates(folder: File, reuse: Boolean = false): List = rank(folder, reuse).exes fun rank(folder: File, reuse: Boolean = false): GameExePicker.Ranking { - val key = "${folder.path}|${folder.lastModified()}" + val declared = declaredExes(folder) + val stamp = declared.fold(0L) { hash, exe -> hash * 31 + exe.path.hashCode() } + val key = "${folder.path}|${folder.lastModified()}|$stamp" val now = System.currentTimeMillis() ranked[key]?.takeIf { now - it.first < RANK_FRESH_MS }?.let { return it.second } - if (reuse) kept?.rank(folder)?.let { return it } + if (reuse) kept?.rank(folder, stamp)?.let { return it } val guessed = GameExePicker.rank(folder) { !skipExe(it.name) } - val declared = declaredExes(folder) val preferred = declared.map { it.path }.toSet() val result = if (declared.isEmpty()) guessed else GameExePicker.Ranking( declared + guessed.exes.filter { it.path !in preferred }, @@ -115,7 +116,7 @@ object AddedGames { ) if (ranked.size > 256) ranked.clear() ranked[key] = now to result - kept?.keepRank(folder, result) + kept?.keepRank(folder, result, stamp) return result } @@ -200,8 +201,7 @@ object AddedGames { private val scanning = Any() fun scan(context: Context): List = synchronized(scanning) { - val file = File(context.filesDir, AddedGamesCache.FILE) - val cache = kept?.takeIf { it.file == file } ?: AddedGamesCache(file).also { kept = it } + val cache = cache(context) try { scanAll(context) } finally { @@ -209,6 +209,13 @@ object AddedGames { } } + private val keeping = Any() + + private fun cache(context: Context): AddedGamesCache = synchronized(keeping) { + val file = File(context.filesDir, AddedGamesCache.FILE) + kept?.takeIf { it.file == file } ?: AddedGamesCache(file).also { kept = it } + } + private fun scanAll(context: Context): List { val out = ArrayList() GamesFolderMigration.run(context) @@ -241,11 +248,17 @@ object AddedGames { return out.distinctBy { it.folder.canonicalPath } } - fun single(context: Context, folderPath: String): Game? { + fun single(context: Context, folderPath: String, reuse: Boolean = false): Game? { val folder = File(folderPath) if (!folder.isDirectory || folderPath in SessionPrefs.removedAddedGames(context)) return null val out = ArrayList(1) - scanGame(context, folder, out, single = AddedExes.list(context).firstOrNull { it.folder == folderPath }) + val entry = AddedExes.list(context).firstOrNull { it.folder == folderPath } + val cache = if (reuse) cache(context) else null + try { + scanGame(context, folder, out, single = entry, reuse = reuse) + } finally { + cache?.save() + } return out.firstOrNull() } @@ -417,7 +430,8 @@ object AddedGames { private fun scanGame(context: Context, folder: File, out: MutableList, single: AddedExes.Entry? = null, reuse: Boolean = false) { run { - val sidecar = StoreGameSidecar.read(folder) + val sidecar = StoreGameSidecar.read(folder)?.let { com.droiddeck.launcher.stores.StoreLaunch.adopt(folder, it) } + if (sidecar?.store == Store.ROCKSTAR && sidecar.launcher != com.droiddeck.launcher.stores.StoreLaunch.LAUNCHER) return sidecar?.takeIf { it.id.isNotEmpty() }?.let { SessionPrefs.followStoreGame(context, "${it.store.id}:${it.id}", folder.path) { old -> !File(old).exists() } } val ranking = rank(folder, reuse) val candidates = ranking.exes @@ -433,6 +447,7 @@ object AddedGames { val autoName = sidecar?.title ?: identifiedName(folder, found) ?: folder.name val crc = CRC32().apply { update(("\"${foundGuest.replaceFirst(Regex("^$LIBRARY/"), "$LEGACY_LIBRARY/")}\"" + autoName).toByteArray()) }.value val appId = SessionPrefs.addedGameAppId(context, folder.path, crc or 0x80000000L) + if (sidecar?.store == Store.ROCKSTAR) com.droiddeck.launcher.stores.rockstar.RockstarLaunch.applyDefaults(context, sidecar.id, appId) val config = accountConfig(SessionPrefs.activeSteamRoot(context)) val record = config?.let { shortcutRecord(it, appId) } val rev = record?.optInt("rev", 0) ?: 0 @@ -457,7 +472,11 @@ object AddedGames { steamId?.toLong() ?: ((appId shl 32) or 0x02000000L), candidates, steamId, source = sidecar?.store?.id ?: Library.ADDED, storeId = sidecar?.id, exeUncertain = sidecar == null && chosen == null && adopted == null && ranking.uncertain, - launchOptions = if (sidecar == null) SessionPrefs.addedGameLaunch(context, folder.path) else "", + launchOptions = when { + sidecar == null -> SessionPrefs.addedGameLaunch(context, folder.path) + sidecar.store == Store.UBISOFT -> com.droiddeck.launcher.stores.ubisoft.UbisoftConnect.launchOptions(context) + else -> "" + }, single = single != null)) } } @@ -523,6 +542,17 @@ object AddedGames { } } + class Listed(val appId: Long, val name: String, val launchOptions: String) + + fun listed(context: Context): List? = runCatching { + val file = File(context.filesDir, "session/added-games.json") + if (!file.isFile) return null + val entries = org.json.JSONArray(file.readText()) + (0 until entries.length()).mapNotNull { i -> + entries.optJSONObject(i)?.takeIf { it.has("appid") }?.let { Listed(it.optLong("appid") and 0xFFFFFFFFL, it.optString("name"), it.optString("launch")) } + } + }.getOrNull() + fun writeListing(context: Context, games: List, extra: List = listOfNotNull(com.droiddeck.launcher.stores.epic.EpicClient.steamListing(context))): File { val file = File(context.filesDir, "session/added-games.json").apply { parentFile?.mkdirs() } diff --git a/app/src/main/java/com/droiddeck/launcher/frontend/AddedGamesCache.kt b/app/src/main/java/com/droiddeck/launcher/frontend/AddedGamesCache.kt index c27764dfbd..497c1962b0 100644 --- a/app/src/main/java/com/droiddeck/launcher/frontend/AddedGamesCache.kt +++ b/app/src/main/java/com/droiddeck/launcher/frontend/AddedGamesCache.kt @@ -7,7 +7,7 @@ import java.io.File import java.util.concurrent.ConcurrentHashMap internal class AddedGamesCache(val file: File) { - private class Rank(val modified: Long, val at: Long, val ranking: GameExePicker.Ranking) + private class Rank(val modified: Long, val declared: Long, val at: Long, val ranking: GameExePicker.Ranking) private class Name(val name: String, val at: Long) private val ranks = ConcurrentHashMap() @@ -22,7 +22,7 @@ internal class AddedGamesCache(val file: File) { val exes = o.getJSONArray("exes") val scores = o.getJSONArray("scores") require(exes.length() > 0 && exes.length() == scores.length()) - ranks[path] = Rank(o.getLong("modified"), o.getLong("at"), GameExePicker.Ranking( + ranks[path] = Rank(o.getLong("modified"), o.optLong("declared"), o.getLong("at"), GameExePicker.Ranking( List(exes.length()) { File(exes.getString(it)) }, List(scores.length()) { scores.getInt(it) }, o.optBoolean("uncertain"), )) } @@ -32,19 +32,19 @@ internal class AddedGamesCache(val file: File) { } } - fun rank(folder: File): GameExePicker.Ranking? { + fun rank(folder: File, declared: Long = 0): GameExePicker.Ranking? { val kept = ranks[folder.path] ?: return null val age = System.currentTimeMillis() - kept.at val top = kept.ranking.exes.first() - return kept.ranking.takeIf { kept.modified == folder.lastModified() && age in 0 until KEEP_MS && top.isFile } + return kept.ranking.takeIf { kept.modified == folder.lastModified() && kept.declared == declared && age in 0 until KEEP_MS && top.isFile } } - fun keepRank(folder: File, ranking: GameExePicker.Ranking) { + fun keepRank(folder: File, ranking: GameExePicker.Ranking, declared: Long = 0) { if (ranking.exes.isEmpty()) { if (ranks.remove(folder.path) != null) changed = true return } - ranks[folder.path] = Rank(folder.lastModified(), System.currentTimeMillis(), ranking) + ranks[folder.path] = Rank(folder.lastModified(), declared, System.currentTimeMillis(), ranking) changed = true } @@ -62,7 +62,7 @@ internal class AddedGamesCache(val file: File) { val oldest = System.currentTimeMillis() - KEEP_MS val keptRanks = JSONObject() ranks.forEach { (path, r) -> - if (r.at >= oldest) keptRanks.put(path, JSONObject().put("modified", r.modified).put("at", r.at) + if (r.at >= oldest) keptRanks.put(path, JSONObject().put("modified", r.modified).put("declared", r.declared).put("at", r.at) .put("exes", JSONArray(r.ranking.exes.map { it.path })).put("scores", JSONArray(r.ranking.scores)) .put("uncertain", r.ranking.uncertain)) } diff --git a/app/src/main/java/com/droiddeck/launcher/frontend/AddedSoundtracks.kt b/app/src/main/java/com/droiddeck/launcher/frontend/AddedSoundtracks.kt new file mode 100644 index 0000000000..635941cb7a --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/frontend/AddedSoundtracks.kt @@ -0,0 +1,69 @@ +package com.droiddeck.launcher.frontend + +import android.content.Context +import org.json.JSONArray +import org.json.JSONObject +import java.io.File + +object AddedSoundtracks { + private fun file(context: Context) = File(context.filesDir, "added-soundtracks.json") + + class Entry(val path: String, val name: String, val id: Int = 0) + + internal fun assignIds(list: List): List { + val used = list.filter { it.id != 0 }.map { it.id }.toMutableSet() + return list.map { e -> + if (e.id != 0) e else { + var id = idOf(e.path) + while (id == 0 || !used.add(id)) id = (id + 1) or Int.MIN_VALUE + Entry(e.path, e.name, id) + } + } + } + + @Synchronized + fun entries(context: Context): List = runCatching { + val f = file(context).takeIf { it.isFile } ?: return emptyList() + val array = JSONArray(f.readText()) + val raw = List(array.length()) { i -> array.getJSONObject(i).let { Entry(it.getString("path"), it.getString("name"), it.optInt("id", 0)) } } + val ready = assignIds(raw) + if (raw.any { it.id == 0 }) save(context, ready) + ready + }.getOrDefault(emptyList()) + + @Synchronized + private fun save(context: Context, list: List): Boolean = + runCatching { + val array = JSONArray() + list.forEach { array.put(JSONObject().put("path", it.path).put("name", it.name).put("id", it.id)) } + val f = file(context) + val tmp = File(f.path + ".tmp") + tmp.writeText(array.toString()) + if (tmp.renameTo(f)) true else { tmp.delete(); false } + }.getOrDefault(false) + + fun add(context: Context, folder: File): Boolean { + if (!folder.isDirectory || Soundtrack.audioFiles(folder).isEmpty()) return false + return synchronized(this) { + val list = entries(context) + list.any { it.path == folder.path } || save(context, assignIds(list + Entry(folder.path, folder.name))) + } + } + + fun remove(context: Context, path: String): Boolean = + synchronized(this) { save(context, entries(context).filterNot { it.path == path }) } + + internal fun idOf(path: String): Int = path.hashCode() or Int.MIN_VALUE + + fun games(context: Context): List = entries(context).mapNotNull { e -> + val dir = File(e.path).takeIf { it.isDirectory } ?: return@mapNotNull null + game(context, e, dir, e.id) + } + + private fun game(context: Context, e: Entry, dir: File, id: Int): Library.SteamGame { + return Library.SteamGame( + appId = id, name = e.name, art = SoundtrackCollectionArt.chosen(context, id) ?: Soundtrack.firstCover(context, dir), library = Library.ADDED, gameId = id.toLong() and 0xFFFFFFFFL, + gameFiles = dir, source = Library.ADDED, soundtrack = true, + ) + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/frontend/GameRemoval.kt b/app/src/main/java/com/droiddeck/launcher/frontend/GameRemoval.kt index 388448e184..a35c71342b 100644 --- a/app/src/main/java/com/droiddeck/launcher/frontend/GameRemoval.kt +++ b/app/src/main/java/com/droiddeck/launcher/frontend/GameRemoval.kt @@ -21,7 +21,7 @@ object GameRemoval { fun steamFiles(game: Library.SteamGame): SteamFiles? { val dir = game.gameFiles ?: return null val common = dir.parentFile ?: return null - if (common.name != "common") return null + if (common.name != (if (game.soundtrack) "music" else "common")) return null val steamapps = common.parentFile ?: return null if (steamapps.name != "steamapps") return null val manifest = File(steamapps, "appmanifest_${game.appId}.acf") diff --git a/app/src/main/java/com/droiddeck/launcher/frontend/Library.kt b/app/src/main/java/com/droiddeck/launcher/frontend/Library.kt index b303ecc71e..8acbbe18b0 100644 --- a/app/src/main/java/com/droiddeck/launcher/frontend/Library.kt +++ b/app/src/main/java/com/droiddeck/launcher/frontend/Library.kt @@ -19,9 +19,10 @@ object Library { val storeId: String? = null, val logo: File? = null, val installedAt: Long = 0L, + val soundtrack: Boolean = false, ) { fun withArt(art: File?, hero: File?, icon: File?, logo: File? = this.logo) = - SteamGame(appId, name, art, library, gameId, hero, lastPlayed, gameFiles, protonPrefix, icon, source, storeId, logo, installedAt) + SteamGame(appId, name, art, library, gameId, hero, lastPlayed, gameFiles, protonPrefix, icon, source, storeId, logo, installedAt, soundtrack) val gameIdString: String get() = java.lang.Long.toUnsignedString(gameId) val launchKey: String get() = if (storeId != null) "$source:$storeId" else gameIdString @@ -38,6 +39,7 @@ object Library { const val BATTLENET_LAUNCHER = "battlenet-launcher" const val XBOX_CLOUD = "xbox-cloud" const val SOURCE_STEAM = "steam" + const val SOURCE_COLLECTION = "collection" class Rom(val name: String, val hostPath: File, val guestPath: String, val emulatorId: String, val art: File? = null) class Emulator(val id: String, val name: String, val system: String, val program: String, val installed: Boolean, val games: List) { @@ -123,9 +125,13 @@ object Library { .distinctBy { runCatching { it.canonicalPath }.getOrDefault(it.absolutePath) } } + fun soundtracks(context: Context, arch: String = SessionPrefs.activeSteamClientArch(context)): List = + steamGames(context, arch = arch, withShared = false, soundtracks = true, soundtracksOnly = true) + fun steamGames( context: Context, strictRead: Boolean = false, arch: String = SessionPrefs.activeSteamClientArch(context), - withShared: Boolean = true, + withShared: Boolean = true, soundtracks: Boolean = false, soundtracksOnly: Boolean = false, + onlyAppIds: Set? = null, ): List { val root = SessionPrefs.steamRoot(context, arch) val cache = File(root, "appcache/librarycache") @@ -138,21 +144,26 @@ object Library { if (strictRead && steamapps.isDirectory) check(manifests != null) { context.getString(R.string.game_sync_err_manifests) } manifests?.sortedBy { it.name }?.forEach { manifest -> val appId = manifest.name.removePrefix("appmanifest_").removeSuffix(".acf").toIntOrNull() ?: return@forEach - if (appId in NOT_GAMES || out.containsKey(appId)) return@forEach + if (appId in NOT_GAMES || out.containsKey(appId) || + (onlyAppIds != null && appId !in onlyAppIds) + ) return@forEach val text = try { manifest.readText() } catch (e: Exception) { if (strictRead) throw e; return@forEach } 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 installDir = INSTALL_DIR.find(text)?.groupValues?.get(1)?.trim() + ?.takeIf { it.isNotEmpty() && it != "." && it != ".." && '/' !in it && '\\' !in it } + val gameFiles = installDir?.let { File(steamapps, "common/$it").takeIf(File::isDirectory) } + val musicFiles = if (gameFiles == null) installDir?.let { File(steamapps, "music/$it").takeIf(File::isDirectory) } else null + if (musicFiles != null && !soundtracks) return@forEach + if (soundtracksOnly && musicFiles == null) return@forEach 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 } - val gameFiles = installDir?.let { File(steamapps, "common/$it").takeIf(File::isDirectory) } out[appId] = SteamGameArt.withOverrides(context, SteamGame( - appId, name, art, label, hero = hero, lastPlayed = lastPlayed, - gameFiles = gameFiles, + appId, name, art ?: musicFiles?.let { Soundtrack.firstCover(context, it) }, label, hero = hero, lastPlayed = lastPlayed, + gameFiles = gameFiles ?: musicFiles, soundtrack = musicFiles != null, protonPrefix = protonPrefix(context, appId.toLong(), library, roots), icon = images.icon(), logo = images.find(STEAM_LOGOS), @@ -161,16 +172,42 @@ object Library { } if (withShared) { val other = if (arch == "x86_64") "arm64" else "x86_64" - val shared = sharedApps(context, arch) - out.keys - if (shared.isNotEmpty()) runCatching { steamGames(context, arch = other, withShared = false) }.getOrDefault(emptyList()) - .filter { it.appId in shared }.forEach { out[it.appId] = it } + val shared = try { + sharedApps(context, arch) - out.keys + } catch (e: IllegalStateException) { + if (strictRead) throw e + emptySet() + } + if (shared.isNotEmpty()) { + val otherGames = try { + steamGames( + context, + strictRead = strictRead, + arch = other, + withShared = false, + soundtracks = soundtracks, + onlyAppIds = shared, + ) + } catch (e: Exception) { + if (strictRead) throw e + emptyList() + } + otherGames.forEach { out[it.appId] = it } + } } return out.values.toList() } internal fun sharedApps(context: Context, arch: String): Set { val view = File(LinuxRuntime.rootDir(context), "root/.droiddeck-x64/shared/${if (arch == "x86_64") "arm64" else "x86-64"}/steamapps") - return view.list().orEmpty().mapNotNull { Regex("appmanifest_(\\d+)\\.acf").matchEntire(it)?.groupValues?.get(1)?.toIntOrNull() }.toSet() + val entries = view.list() + if (entries == null) { + if (!view.exists()) return emptySet() + throw IllegalStateException("Unable to read the shared Steam library.") + } + return entries.mapNotNull { + Regex("appmanifest_(\\d+)\\.acf").matchEntire(it)?.groupValues?.get(1)?.toIntOrNull() + }.toSet() } fun steamLibraryArt(context: Context): List> { diff --git a/app/src/main/java/com/droiddeck/launcher/frontend/Soundtrack.kt b/app/src/main/java/com/droiddeck/launcher/frontend/Soundtrack.kt new file mode 100644 index 0000000000..7f66f20962 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/frontend/Soundtrack.kt @@ -0,0 +1,308 @@ +package com.droiddeck.launcher.frontend + +import android.content.Context +import android.media.MediaMetadataRetriever +import org.json.JSONArray +import org.json.JSONObject +import java.io.File + +object Soundtrack { + class Track( + val file: File, val title: String, val disc: Int, val number: Int, val durationMs: Long, val artist: String = "", + val discLabel: String = disc.toString(), + ) { + val id: String get() = file.path + } + + class Album(val disc: Map>, val artist: String, val cover: File?) { + val tracks: List get() = disc.values.flatten() + val discs: List get() = disc.keys.toList() + val multiDisc: Boolean get() = disc.size > 1 + val totalMs: Long get() = tracks.sumOf { it.durationMs } + } + + class Raw( + val file: File, val folder: String, val tagDisc: Int?, val tagTrack: Int?, val tagTitle: String?, val tagArtist: String?, + val durationMs: Long, val size: Long = file.length(), + ) + + val EXTENSIONS = setOf("mp3", "flac", "ogg", "oga", "opus", "wav", "m4a", "aac") + private val LOSSLESS = setOf("flac", "wav") + private val COVERS = listOf("AlbumArtwork", "albumartwork", "cover", "Cover", "folder", "Folder", "front", "Front", "artwork", "Artwork") + internal val COVER_EXT = listOf("png", "jpg", "jpeg", "webp") + private val LEADING = Regex("^\\s*\\d+\\s*[.\\-_)]*\\s+") + private val DIGITS = Regex("^\\s*(\\d+)") + + fun isAudio(file: File): Boolean = file.isFile && file.extension.lowercase() in EXTENSIONS + + fun cleanTitle(fileName: String): String { + val base = fileName.substringBeforeLast('.', fileName).trim() + val tail = if (" - " in base) base.substringAfterLast(" - ") else base + val stripped = tail.replace(LEADING, "").trim() + return stripped.ifEmpty { tail.ifEmpty { base } } + } + + internal fun leadingNumber(fileName: String): Int? = DIGITS.find(fileName.substringAfterLast(" - "))?.groupValues?.get(1)?.toIntOrNull() + + private fun identity(r: Raw): String { + val d = r.tagDisc + val t = r.tagTrack + if (d != null && t != null) return "n:$d:$t" + val title = (r.tagTitle?.takeIf { it.isNotBlank() } ?: cleanTitle(r.file.name)).lowercase().filter { it.isLetterOrDigit() } + return "t:$title:${leadingNumber(r.file.name)}" + } + + private fun better(a: Raw, b: Raw): Raw { + val la = a.file.extension.lowercase() in LOSSLESS + val lb = b.file.extension.lowercase() in LOSSLESS + return when { + la != lb -> if (la) a else b + a.size != b.size -> if (a.size > b.size) a else b + else -> if (a.file.path <= b.file.path) a else b + } + } + + fun group(raws: List): Map> { + if (raws.isEmpty()) return emptyMap() + val unique = LinkedHashMap() + val home = HashMap() + val disc = HashMap() + val track = HashMap() + val title = HashMap() + for (r in raws) { + val id = identity(r) + unique[id] = unique[id]?.let { better(it, r) } ?: r + if (r.folder.isNotEmpty() && home[id].isNullOrEmpty()) home[id] = r.folder + r.tagDisc?.let { disc.putIfAbsent(id, it) } + r.tagTrack?.let { track.putIfAbsent(id, it) } + r.tagTitle?.takeIf { it.isNotBlank() }?.let { title.putIfAbsent(id, it) } + } + val kept = unique.map { (id, r) -> + Raw( + r.file, home[id] ?: r.folder, disc[id] ?: r.tagDisc, track[id] ?: r.tagTrack, title[id] ?: r.tagTitle, r.tagArtist, + r.durationMs, r.size, + ) + } + val folders = kept.filter { it.tagDisc == null }.map { it.folder }.distinct().sortedWith(naturalOrder) + val discs = kept.groupBy { r -> + r.tagDisc ?: if (folders.size <= 1 && kept.none { it.tagDisc != null }) 0 else folders.indexOf(r.folder) + 1 + } + return discs.toSortedMap().mapValues { (disc, list) -> + list.sortedWith( + compareBy({ leadingNumber(it.file.name) ?: it.tagTrack ?: Int.MAX_VALUE }, { it.tagTrack ?: Int.MAX_VALUE }, { it.file.name.lowercase() }), + ).mapIndexed { i, r -> + Track( + r.file, r.tagTitle?.takeIf { it.isNotBlank() } ?: cleanTitle(r.file.name), disc, i + 1, + r.durationMs, r.tagArtist.orEmpty(), labelOf(r, disc), + ) + } + } + } + + private val FOLDER_LABEL = Regex("[0-9][0-9 +&,.\\-]*") + + private fun labelOf(r: Raw, disc: Int): String { + if (r.tagDisc != null) return disc.toString() + val name = r.folder.substringAfterLast('/') + return if (FOLDER_LABEL.matches(name)) name else disc.toString() + } + + private val naturalOrder = Comparator { a, b -> + val x = Regex("\\d+|\\D+").findAll(a.lowercase()).map { it.value }.toList() + val y = Regex("\\d+|\\D+").findAll(b.lowercase()).map { it.value }.toList() + var i = 0 + var out = 0 + while (out == 0 && i < minOf(x.size, y.size)) { + val nx = x[i].toBigIntegerOrNull() + val ny = y[i].toBigIntegerOrNull() + out = if (nx != null && ny != null) nx.compareTo(ny) else x[i].compareTo(y[i]) + i++ + } + if (out != 0) out else x.size.compareTo(y.size) + } + + fun cover(dir: File): File? { + for (name in COVERS) for (ext in COVER_EXT) File(dir, "$name.$ext").takeIf { it.isFile }?.let { return it } + return dir.listFiles()?.filter { it.isFile && it.extension.lowercase() in COVER_EXT }?.minByOrNull { it.name.lowercase() } + } + + private fun parseNumber(value: String?): Int? = value?.substringBefore('/')?.trim()?.toIntOrNull() + + private fun read(file: File, root: File): Raw { + val folder = file.parentFile?.let { parent -> + if (parent.path == root.path) "" else parent.path.removePrefix(root.path).trimStart('/') + }.orEmpty() + val retriever = MediaMetadataRetriever() + return try { + retriever.setDataSource(file.path) + Raw( + file, folder, + parseNumber(retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DISC_NUMBER)), + parseNumber(retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_CD_TRACK_NUMBER)), + retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_TITLE), + retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_ARTIST) + ?: retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_ALBUMARTIST), + retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION)?.toLongOrNull() ?: 0L, + ) + } catch (e: Exception) { + Raw(file, folder, null, null, null, null, 0L) + } finally { + runCatching { retriever.release() } + } + } + + private fun cacheFile(context: Context, root: File) = File(context.filesDir, "soundtrack-index/${root.path.hashCode().toUInt()}.json") + + private fun fromCache(context: Context, root: File, files: List): List? = runCatching { + val f = cacheFile(context, root).takeIf { it.isFile } ?: return null + val json = JSONObject(f.readText()) + if (json.optString("root") != root.path) return null + val rows = json.getJSONArray("rows") + val byPath = HashMap() + for (i in 0 until rows.length()) rows.getJSONObject(i).let { byPath[it.getString("p")] = it } + if (byPath.size != files.size) return null + files.map { file -> + val row = byPath[file.path] ?: return null + if (row.getLong("s") != file.length() || row.getLong("m") != file.lastModified()) return null + Raw( + file, row.getString("f"), row.optInt("d", -1).takeIf { it >= 0 }, row.optInt("n", -1).takeIf { it >= 0 }, + row.optString("t").takeIf { it.isNotEmpty() }, row.optString("a").takeIf { it.isNotEmpty() }, row.optLong("l"), + ) + } + }.getOrNull() + + private fun toCache(context: Context, root: File, raws: List) { + runCatching { + val rows = JSONArray() + for (r in raws) rows.put( + JSONObject().put("p", r.file.path).put("s", r.file.length()).put("m", r.file.lastModified()).put("f", r.folder) + .put("d", r.tagDisc ?: -1).put("n", r.tagTrack ?: -1).put("t", r.tagTitle.orEmpty()).put("a", r.tagArtist.orEmpty()) + .put("l", r.durationMs), + ) + val f = cacheFile(context, root) + f.parentFile?.mkdirs() + val tmp = File(f.path + ".tmp") + tmp.writeText(JSONObject().put("root", root.path).put("rows", rows).toString()) + if (!tmp.renameTo(f)) tmp.delete() + } + } + + fun audioFiles(root: File): List { + val out = ArrayList() + fun walk(dir: File, depth: Int) { + val children = dir.listFiles() ?: return + for (c in children.sortedBy { it.name.lowercase() }) { + if (c.isDirectory) { if (depth < 4) walk(c, depth + 1) } else if (isAudio(c)) out += c + } + } + walk(root, 0) + return out + } + + private fun coverCache(context: Context, root: File): File { + val digest = java.security.MessageDigest.getInstance("SHA-256").digest(root.path.toByteArray(Charsets.UTF_8)) + val key = digest.take(16).joinToString("") { "%02x".format(it) } + return File(context.filesDir, "soundtrack-index/cover-$key.jpg") + } + + fun cachedCover(context: Context, root: File): File? = coverCache(context, root).takeIf { it.isFile && it.length() > 0L } + + private fun embeddedBytes(file: File): ByteArray? = runCatching { + val retriever = MediaMetadataRetriever() + try { + retriever.setDataSource(file.path) + retriever.embeddedPicture + } finally { + runCatching { retriever.release() } + } + }.getOrNull()?.takeIf { it.isNotEmpty() } + + private fun hashOf(bytes: ByteArray): String = + java.security.MessageDigest.getInstance("SHA-256").digest(bytes).take(16).joinToString("") { "%02x".format(it) } + + private fun embeddedCover(context: Context, root: File, files: List): File? { + cachedCover(context, root)?.let { return it } + val miss = File(coverCache(context, root).path + ".none") + val probed = files.take(8) + val signature = hashOf(probed.joinToString("\n") { "${it.path}|${it.length()}|${it.lastModified()}" }.toByteArray(Charsets.UTF_8)) + if (runCatching { miss.isFile && miss.readText().trim() == signature }.getOrDefault(false)) return null + for (file in probed) { + val bytes = embeddedBytes(file) ?: continue + val out = coverCache(context, root) + runCatching { + out.parentFile?.mkdirs() + out.writeBytes(bytes) + }.onSuccess { return out } + } + runCatching { + miss.parentFile?.mkdirs() + miss.writeText(signature) + } + return null + } + + fun firstCover(context: Context, root: File): File? = cover(root) ?: embeddedCover(context, root, audioFiles(root)) + + @Synchronized + fun trackCover(context: Context, file: File): File? { + val dir = File(context.filesDir, "soundtrack-index/track-covers") + val marker = File(dir, "t-" + hashOf("${file.path}|${file.length()}|${file.lastModified()}".toByteArray(Charsets.UTF_8))) + if (marker.isFile) { + val name = runCatching { marker.readText().trim() }.getOrDefault("") + if (name.isEmpty()) return null + File(dir, name).takeIf { it.isFile && it.length() > 0L }?.let { + val now = System.currentTimeMillis() + marker.setLastModified(now) + it.setLastModified(now) + return it + } + } + val bytes = embeddedBytes(file) + return runCatching { + dir.mkdirs() + if (bytes == null) { + marker.writeText("") + prune(dir, setOf(marker.name)) + null + } else { + val out = File(dir, "c-" + hashOf(bytes) + ".jpg") + if (!out.isFile || out.length() == 0L) out.writeBytes(bytes) + marker.writeText(out.name) + prune(dir, setOf(marker.name, out.name)) + out + } + }.getOrNull() + } + + private const val TRACK_COVER_BYTES = 64L * 1024 * 1024 + private const val TRACK_COVER_FILES = 2000 + + private fun prune(dir: File, keep: Set) { + val all = dir.listFiles()?.filter { it.isFile } ?: return + var bytes = all.sumOf { it.length() } + var count = all.size + for (f in all.sortedBy { it.lastModified() }) { + if (bytes <= TRACK_COVER_BYTES && count <= TRACK_COVER_FILES) break + if (f.name in keep) continue + bytes -= f.length() + count-- + f.delete() + } + } + + fun load(context: Context, root: File, coverHint: File? = null): Album { + val files = audioFiles(root) + val raws = fromCache(context, root, files) ?: files.map { read(it, root) }.also { toCache(context, root, it) } + val disc = SoundtrackOrder.apply(context, root, group(raws)) + val artist = disc.values.flatten().map { it.artist }.filter { it.isNotBlank() }.groupingBy { it }.eachCount().maxByOrNull { it.value }?.key.orEmpty() + return Album(disc, artist, coverHint ?: cover(root) ?: embeddedCover(context, root, files)) + } + + fun formatLength(ms: Long): String { + val total = ms / 1000 + val h = total / 3600 + val m = (total % 3600) / 60 + val s = total % 60 + return if (h > 0) "%d:%02d:%02d".format(h, m, s) else "%d:%02d".format(m, s) + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/frontend/SoundtrackCollectionArt.kt b/app/src/main/java/com/droiddeck/launcher/frontend/SoundtrackCollectionArt.kt new file mode 100644 index 0000000000..44274fb55b --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/frontend/SoundtrackCollectionArt.kt @@ -0,0 +1,50 @@ +package com.droiddeck.launcher.frontend + +import android.content.Context +import java.io.File + +object SoundtrackCollectionArt { + internal fun dir(context: Context, id: Int) = File(context.filesDir, "soundtrack-art/$id") + + private fun sourceFile(context: Context, id: Int) = File(dir(context, id), "source") + + fun chosen(context: Context, id: Int): File? = dir(context, id).takeIf { it.isDirectory }?.let { AddedGameArt.chosen(it, AddedGameArt.Slot.COVER) } + + fun source(context: Context, id: Int): String = + sourceFile(context, id).takeIf { it.isFile }?.readText()?.trim().orEmpty().substringAfter('|', "") + + fun options(context: Context, id: Int, root: File?): List { + val paths = if (root != null) { + val images = root.listFiles()?.filter { it.isFile && it.extension.lowercase() in Soundtrack.COVER_EXT }?.sortedBy { it.name.lowercase() }.orEmpty() + (images + listOfNotNull(Soundtrack.firstCover(context, root))).map { it.path } + } else SoundtrackCollections.tracksOf(id).map { it.cover } + return paths.filter { it.isNotEmpty() && File(it).isFile }.distinct().map { AddedGameArt.Option(AddedGameArt.FOLDER, it, it) } + } + + fun choose(context: Context, id: Int, option: AddedGameArt.Option): Boolean { + val folder = dir(context, id) + val fresh = AddedGameArt.storeNew(folder, AddedGameArt.Slot.COVER, option) ?: return false + AddedGameArt.dropOlder(folder, AddedGameArt.Slot.COVER, fresh) + sourceFile(context, id).writeText(option.group + "|" + option.full) + return true + } + + fun reset(context: Context, id: Int) { + chosen(context, id)?.delete() + sourceFile(context, id).delete() + } + + fun describe(context: Context, id: Int, root: File? = null): List { + val own = chosen(context, id) + val state = if (own != null) AddedGameArt.SlotState(AddedGameArt.Slot.COVER, own, AddedGameArt.FILE, true) + else { + val auto = if (root != null) Soundtrack.firstCover(context, root) else SoundtrackCollections.autoCover(id) + AddedGameArt.SlotState(AddedGameArt.Slot.COVER, auto, if (auto != null) AddedGameArt.FOLDER else AddedGameArt.AUTO, false) + } + return listOf(state) + } + + fun clear(context: Context, id: Int) { + dir(context, id).deleteRecursively() + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/frontend/SoundtrackCollections.kt b/app/src/main/java/com/droiddeck/launcher/frontend/SoundtrackCollections.kt new file mode 100644 index 0000000000..d680ae0709 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/frontend/SoundtrackCollections.kt @@ -0,0 +1,191 @@ +package com.droiddeck.launcher.frontend + +import android.content.Context +import androidx.compose.runtime.mutableStateOf +import org.json.JSONArray +import org.json.JSONObject +import java.io.File +import java.util.concurrent.Executors + +object SoundtrackCollections { + const val FAVORITES_ID = 2_000_000_000 + + class TrackRef(val path: String, val title: String, val artist: String, val album: String, val durationMs: Long, val cover: String = "") + class Collection(val id: Int, val name: String, val tracks: List) + class Snapshot(val favorites: List, val collections: List) + + private val state = mutableStateOf(Snapshot(emptyList(), emptyList())) + private var loaded = false + private val writer = Executors.newSingleThreadExecutor { r -> Thread(r, "soundtrack-collections").apply { isDaemon = true } } + + val snapshot: Snapshot get() = state.value + + private fun file(context: Context) = File(context.filesDir, "soundtrack-collections.json") + + internal fun toggled(list: List, ref: TrackRef): List = + if (list.any { it.path == ref.path }) list.filterNot { it.path == ref.path } else list + ref + + internal fun merged(list: List, add: List): List { + val have = list.mapTo(HashSet()) { it.path } + return list + add.filter { have.add(it.path) } + } + + internal fun cleanName(raw: String): String = raw.trim().replace(Regex("\\s+"), " ") + + internal fun nameTaken(collections: List, name: String, except: Int? = null): Boolean = + collections.any { it.id != except && it.name.equals(name, ignoreCase = true) } + + internal fun nextId(collections: List): Int = + (collections.maxOfOrNull { it.id } ?: FAVORITES_ID).coerceAtLeast(FAVORITES_ID) + 1 + + private fun encode(s: Snapshot): String { + fun refs(list: List) = JSONArray().also { array -> + list.forEach { + array.put( + JSONObject().put("path", it.path).put("title", it.title).put("artist", it.artist).put("album", it.album) + .put("duration", it.durationMs).put("cover", it.cover), + ) + } + } + val collections = JSONArray() + s.collections.forEach { collections.put(JSONObject().put("id", it.id).put("name", it.name).put("tracks", refs(it.tracks))) } + return JSONObject().put("favorites", refs(s.favorites)).put("collections", collections).toString() + } + + private fun decode(text: String): Snapshot { + fun refs(array: JSONArray?): List = if (array == null) emptyList() else List(array.length()) { i -> + array.getJSONObject(i).let { + TrackRef(it.getString("path"), it.optString("title"), it.optString("artist"), it.optString("album"), it.optLong("duration"), it.optString("cover")) + } + } + val root = JSONObject(text) + val collections = root.optJSONArray("collections") + return Snapshot( + refs(root.optJSONArray("favorites")), + if (collections == null) emptyList() else List(collections.length()) { i -> + collections.getJSONObject(i).let { Collection(it.getInt("id"), it.getString("name"), refs(it.optJSONArray("tracks"))) } + }, + ) + } + + @Synchronized + fun load(context: Context) { + if (loaded) return + loaded = true + val f = file(context) + if (f.isFile) runCatching { state.value = decode(f.readText()) } + } + + private fun commit(context: Context, next: Snapshot) { + state.value = next + val f = file(context) + val json = encode(next) + writer.execute { + runCatching { + val tmp = File(f.path + ".tmp") + tmp.writeText(json) + if (!tmp.renameTo(f)) tmp.delete() + } + } + } + + fun tracksOf(id: Int): List = + if (id == FAVORITES_ID) snapshot.favorites else snapshot.collections.firstOrNull { it.id == id }?.tracks.orEmpty() + + fun isFavorite(path: String): Boolean = snapshot.favorites.any { it.path == path } + + @Synchronized + fun toggleFavorite(context: Context, ref: TrackRef) { + load(context) + val s = snapshot + commit(context, Snapshot(toggled(s.favorites, ref), s.collections)) + } + + @Synchronized + fun create(context: Context, rawName: String, tracks: List): Int? { + load(context) + val s = snapshot + val name = cleanName(rawName) + if (name.isEmpty() || nameTaken(s.collections, name)) return null + val id = nextId(s.collections) + commit(context, Snapshot(s.favorites, s.collections + Collection(id, name, merged(emptyList(), tracks)))) + return id + } + + @Synchronized + fun rename(context: Context, id: Int, rawName: String): Boolean { + load(context) + val s = snapshot + val name = cleanName(rawName) + if (id == FAVORITES_ID || name.isEmpty() || nameTaken(s.collections, name, id)) return false + commit(context, Snapshot(s.favorites, s.collections.map { if (it.id == id) Collection(id, name, it.tracks) else it })) + return true + } + + @Synchronized + fun delete(context: Context, id: Int) { + load(context) + val s = snapshot + if (id == FAVORITES_ID) return + commit(context, Snapshot(s.favorites, s.collections.filterNot { it.id == id })) + SoundtrackCollectionArt.clear(context, id) + } + + @Synchronized + fun add(context: Context, id: Int, tracks: List) { + load(context) + val s = snapshot + if (id == FAVORITES_ID) commit(context, Snapshot(merged(s.favorites, tracks), s.collections)) + else commit(context, Snapshot(s.favorites, s.collections.map { if (it.id == id) Collection(id, it.name, merged(it.tracks, tracks)) else it })) + } + + @Synchronized + fun remove(context: Context, id: Int, paths: Set) { + load(context) + val s = snapshot + if (id == FAVORITES_ID) commit(context, Snapshot(s.favorites.filterNot { it.path in paths }, s.collections)) + else commit(context, Snapshot(s.favorites, s.collections.map { if (it.id == id) Collection(id, it.name, it.tracks.filterNot { t -> t.path in paths }) else it })) + } + + @Synchronized + fun reorder(context: Context, id: Int, ordered: List) { + load(context) + val s = snapshot + fun arrange(list: List): List { + val byPath = list.associateBy { it.path } + val placed = ordered.mapNotNull { byPath[it] } + val named = ordered.toSet() + val rest = list.filter { it.path !in named } + return placed + rest + } + if (id == FAVORITES_ID) commit(context, Snapshot(arrange(s.favorites), s.collections)) + else commit(context, Snapshot(s.favorites, s.collections.map { if (it.id == id) Collection(id, it.name, arrange(it.tracks)) else it })) + } + + @Synchronized + fun refresh() { + state.value = Snapshot(state.value.favorites, state.value.collections) + } + + internal fun autoCover(id: Int): File? = coverOf(tracksOf(id)) + + private fun coverOf(tracks: List): File? = + tracks.firstNotNullOfOrNull { t -> t.cover.takeIf { it.isNotEmpty() }?.let { File(it) }?.takeIf { it.isFile } } + + private fun game(context: Context, id: Int, name: String, tracks: List): Library.SteamGame = Library.SteamGame( + appId = id, name = name, art = SoundtrackCollectionArt.chosen(context, id) ?: coverOf(tracks), library = Library.ADDED, gameId = id.toLong(), + source = Library.SOURCE_COLLECTION, soundtrack = true, + ) + + fun games(context: Context, favoritesLabel: String): List { + val s = snapshot + return listOf(game(context, FAVORITES_ID, favoritesLabel, s.favorites)) + s.collections.map { game(context, it.id, it.name, it.tracks) } + } + + fun album(context: Context, id: Int): Soundtrack.Album { + val tracks = tracksOf(id).filter { File(it.path).isFile }.mapIndexed { i, t -> + Soundtrack.Track(File(t.path), t.title, 1, i + 1, t.durationMs, t.artist) + } + return Soundtrack.Album(mapOf(1 to tracks), "", SoundtrackCollectionArt.chosen(context, id)) + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/frontend/SoundtrackIndex.kt b/app/src/main/java/com/droiddeck/launcher/frontend/SoundtrackIndex.kt new file mode 100644 index 0000000000..8da6a884df --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/frontend/SoundtrackIndex.kt @@ -0,0 +1,32 @@ +package com.droiddeck.launcher.frontend + +import android.content.Context + +object SoundtrackIndex { + class Hit(val ref: SoundtrackCollections.TrackRef, val game: Library.SteamGame) + + private var cacheKey = "" + private var cache: List = emptyList() + + private fun fingerprint(dir: java.io.File?): Long = + if (dir == null) 0L else Soundtrack.audioFiles(dir).fold(17L) { h, f -> 31 * (31 * (31 * h + f.path.hashCode()) + f.length()) + f.lastModified() } + + fun build(context: Context, games: List): List { + val roots = games.filter { it.gameFiles != null } + val key = roots.joinToString("|") { "${it.appId}:${it.gameFiles?.path}:${it.art?.path}:${fingerprint(it.gameFiles)}" } + synchronized(this) { if (key == cacheKey) return cache } + val hits = roots.flatMap { g -> + val dir = g.gameFiles ?: return@flatMap emptyList() + val album = Soundtrack.load(context, dir, g.art) + val cover = (g.art ?: album.cover)?.path.orEmpty() + album.tracks.map { t -> + Hit(SoundtrackCollections.TrackRef(t.file.path, t.title, t.artist.ifBlank { album.artist }, g.name, t.durationMs, cover), g) + } + } + synchronized(this) { + cacheKey = key + cache = hits + } + return hits + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/frontend/SoundtrackOrder.kt b/app/src/main/java/com/droiddeck/launcher/frontend/SoundtrackOrder.kt new file mode 100644 index 0000000000..a8018825ce --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/frontend/SoundtrackOrder.kt @@ -0,0 +1,67 @@ +package com.droiddeck.launcher.frontend + +import android.content.Context +import androidx.compose.runtime.mutableIntStateOf +import org.json.JSONArray +import org.json.JSONObject +import java.io.File +import java.util.concurrent.Executors + +object SoundtrackOrder { + private val changes = mutableIntStateOf(0) + private var cache: Map>? = null + private val writer = Executors.newSingleThreadExecutor { r -> Thread(r, "soundtrack-order").apply { isDaemon = true } } + + val version: Int get() = changes.intValue + + private fun file(context: Context) = File(context.filesDir, "soundtrack-order.json") + + @Synchronized + private fun read(context: Context): Map> { + cache?.let { return it } + val out = HashMap>() + val f = file(context) + if (f.isFile) runCatching { + val json = JSONObject(f.readText()) + for (key in json.keys()) { + val array = json.getJSONArray(key) + out[key] = List(array.length()) { array.getString(it) } + } + } + cache = out + return out + } + + @Synchronized + fun set(context: Context, root: File, paths: List) { + val next = HashMap(read(context)) + next[root.path] = paths + cache = next + val body = JSONObject().also { json -> next.forEach { (k, v) -> json.put(k, JSONArray(v)) } }.toString() + val target = file(context) + writer.execute { + val tmp = File(target.path + ".tmp") + runCatching { + tmp.writeText(body) + if (!tmp.renameTo(target)) tmp.delete() + } + } + changes.intValue++ + } + + internal fun ordered(disc: Map>, order: List): Map> { + if (order.isEmpty()) return disc + val index = HashMap() + order.forEachIndexed { i, p -> index.putIfAbsent(p, i) } + return disc.mapValues { (_, list) -> + list.sortedBy { index[it.file.path] ?: Int.MAX_VALUE }.mapIndexed { i, t -> + Soundtrack.Track(t.file, t.title, t.disc, i + 1, t.durationMs, t.artist, t.discLabel) + } + } + } + + fun apply(context: Context, root: File, disc: Map>): Map> { + val order = read(context)[root.path] ?: return disc + return ordered(disc, order) + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/frontend/SoundtrackShortcuts.kt b/app/src/main/java/com/droiddeck/launcher/frontend/SoundtrackShortcuts.kt new file mode 100644 index 0000000000..c85940cd16 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/frontend/SoundtrackShortcuts.kt @@ -0,0 +1,41 @@ +package com.droiddeck.launcher.frontend + +import android.app.Activity +import android.content.Context +import android.content.Intent +import android.content.pm.ShortcutInfo +import android.content.pm.ShortcutManager +import android.graphics.drawable.Icon +import android.net.Uri +import android.widget.Toast +import com.droiddeck.launcher.FrontEndActivity +import com.droiddeck.launcher.LauncherIcon +import com.droiddeck.launcher.R + +object SoundtrackShortcuts { + private val linkPattern = Regex("droiddeck://soundtrack/(-?[0-9]{1,11})") + + fun uri(appId: Int): String = "droiddeck://soundtrack/$appId" + + fun parse(link: String?): Int? = link?.let { linkPattern.matchEntire(it)?.groupValues?.get(1)?.toIntOrNull() } + + fun read(intent: Intent): Int? = if (intent.action == Intent.ACTION_VIEW) parse(intent.dataString) else null + + private fun info(context: Context, game: Library.SteamGame): ShortcutInfo { + val name = game.name.ifBlank { context.getString(R.string.app_name) } + val icon = GameShortcuts.iconBitmap(game)?.let(Icon::createWithBitmap) ?: Icon.createWithResource(context, R.mipmap.ic_launcher) + val intent = Intent(Intent.ACTION_VIEW, Uri.parse(uri(game.appId)), context, FrontEndActivity::class.java) + .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP) + return ShortcutInfo.Builder(context, "soundtrack:${game.appId}") + .setActivity(LauncherIcon.activity(context)) + .setShortLabel(name.take(40)).setLongLabel(name).setIcon(icon).setIntent(intent).build() + } + + fun pin(activity: Activity, game: Library.SteamGame) { + val manager = activity.getSystemService(ShortcutManager::class.java) + val requested = runCatching { + manager.isRequestPinShortcutSupported && manager.requestPinShortcut(info(activity, game), null) + }.getOrDefault(false) + if (!requested) Toast.makeText(activity, R.string.game_shortcut_unsupported, Toast.LENGTH_LONG).show() + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/frontend/SoundtrackTracks.kt b/app/src/main/java/com/droiddeck/launcher/frontend/SoundtrackTracks.kt new file mode 100644 index 0000000000..744614710d --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/frontend/SoundtrackTracks.kt @@ -0,0 +1,30 @@ +package com.droiddeck.launcher.frontend + +object SoundtrackTracks { + enum class Sort { DEFAULT, TITLE_ASC, TITLE_DESC, LONGEST, SHORTEST } + + fun sort(items: List, sort: Sort, title: (T) -> String, duration: (T) -> Long): List = when (sort) { + Sort.DEFAULT -> items + Sort.TITLE_ASC -> items.sortedWith(compareBy(String.CASE_INSENSITIVE_ORDER, title)) + Sort.TITLE_DESC -> items.sortedWith(compareByDescending(String.CASE_INSENSITIVE_ORDER, title)) + Sort.LONGEST -> items.sortedByDescending(duration) + Sort.SHORTEST -> items.sortedBy(duration) + } + + fun matches(query: String, vararg fields: String): Boolean { + val words = query.trim().lowercase().split(' ').filter { it.isNotEmpty() } + if (words.isEmpty()) return true + val haystack = fields.map { it.lowercase() } + return words.all { word -> haystack.any { it.contains(word) } } + } + + fun rank(query: String, title: String): Int { + val q = query.trim().lowercase() + val t = title.lowercase() + return when { + t == q -> 0 + t.startsWith(q) -> 1 + else -> 2 + } + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/frontend/SteamGameArt.kt b/app/src/main/java/com/droiddeck/launcher/frontend/SteamGameArt.kt index 25a3cb8fb5..d7a6522742 100644 --- a/app/src/main/java/com/droiddeck/launcher/frontend/SteamGameArt.kt +++ b/app/src/main/java/com/droiddeck/launcher/frontend/SteamGameArt.kt @@ -24,11 +24,7 @@ object SteamGameArt { val icon = chosenFile(context, game.appId, AddedGameArt.Slot.ICON) val logo = chosenFile(context, game.appId, AddedGameArt.Slot.LOGO) if (cover == null && hero == null && icon == null && logo == null) return game - return Library.SteamGame( - game.appId, game.name, cover ?: game.art, game.library, game.gameId, - hero ?: game.hero, game.lastPlayed, game.gameFiles, game.protonPrefix, icon ?: game.icon, game.source, game.storeId, - logo ?: game.logo, - ) + return game.withArt(cover ?: game.art, hero ?: game.hero, icon ?: game.icon, logo ?: game.logo) } fun chosenSource(context: Context, appId: Int, slot: AddedGameArt.Slot): Pair { diff --git a/app/src/main/java/com/droiddeck/launcher/frontend/WinCompSources.kt b/app/src/main/java/com/droiddeck/launcher/frontend/WinCompSources.kt index 22044c76d4..e9910a67df 100644 --- a/app/src/main/java/com/droiddeck/launcher/frontend/WinCompSources.kt +++ b/app/src/main/java/com/droiddeck/launcher/frontend/WinCompSources.kt @@ -9,7 +9,7 @@ import java.io.File import java.util.Locale object WinCompSources { - enum class Origin { STEAM, GOG, EPIC, AMAZON, STEAM_NAME, FOLDER, XBOX } + enum class Origin { STEAM, GOG, EPIC, AMAZON, STEAM_NAME, FOLDER, XBOX, UBISOFT } data class Finding(val component: String?, val original: String, val origin: Origin, val auto: Boolean, val args: List = emptyList()) @@ -83,6 +83,13 @@ object WinCompSources { } } + /** The prerequisite installers a Ubisoft manifest lists, with `$INSTALL_DIR` dropped. */ + internal fun ubisoftInstallRuns(setup: String?): List { + val runs = setup?.let { runCatching { org.json.JSONObject(it).optJSONArray("installRuns") }.getOrNull() } ?: return emptyList() + return (0 until runs.length()).mapNotNull { runs.optJSONObject(it)?.optString("exe") } + .map { it.replace('\\', '/').removePrefix("\$INSTALL_DIR").trimStart('/') }.filter { it.isNotEmpty() } + } + fun forGame(context: Context, game: Library.SteamGame): List { val folder = game.gameFiles val out = ArrayList() @@ -112,6 +119,12 @@ object WinCompSources { if (parts.isEmpty()) out += Finding(null, original, Origin.AMAZON, false) parts.forEach { out += Finding(it, original, Origin.AMAZON, true) } } + store == Store.UBISOFT -> ubisoftInstallRuns(sidecar?.extra?.get(com.droiddeck.launcher.stores.ubisoft.UbisoftLaunch.SETUP)).forEach { exe -> + val parts = installer(exe) + val original = exe.substringAfterLast('/') + if (parts.isEmpty()) out += Finding(null, original, Origin.UBISOFT, false) + parts.forEach { out += Finding(it, original, Origin.UBISOFT, true) } + } else -> {} } if (game.library == Library.ADDED && folder != null) SteamMatch.get(context, folder.path)?.let { match -> diff --git a/app/src/main/java/com/droiddeck/launcher/gpu/FrameGen.kt b/app/src/main/java/com/droiddeck/launcher/gpu/FrameGen.kt index c31cd348e8..1623c10106 100644 --- a/app/src/main/java/com/droiddeck/launcher/gpu/FrameGen.kt +++ b/app/src/main/java/com/droiddeck/launcher/gpu/FrameGen.kt @@ -28,12 +28,38 @@ object FrameGen { fun engine(context: Context): String = mode(context).engine - fun mode(context: Context): Mode { + fun mode(context: Context): Mode = mode(context, null) + + fun mode(context: Context, appId: String?): Mode { val prefs = context.getSharedPreferences(PREFS, Context.MODE_PRIVATE) - val engine = prefs.getString("engine", ENGINE_OFF).let { if (it == LEGACY_ENGINE_WINFG) ENGINE_DDFG else it ?: ENGINE_OFF } - val target = prefs.getInt("target", 0) + val gamePrefix = appId?.takeIf { it.isNotBlank() }?.let { "game.$it." } + ?.takeIf { prefs.contains(it + "engine") } ?: "" + val engine = prefs.getString(gamePrefix + "engine", ENGINE_OFF) + .let { if (it == LEGACY_ENGINE_WINFG) ENGINE_DDFG else it ?: ENGINE_OFF } + val target = prefs.getInt(gamePrefix + "target", 0) if (engine == ENGINE_LSFG && target in ADAPTIVE_TARGETS) return Mode(engine, target = target) - return Mode(engine, prefs.getInt("multiplier", 2).coerceIn(2, 4)) + return Mode(engine, prefs.getInt(gamePrefix + "multiplier", 2).coerceIn(2, 4)) + } + + fun hasGameOverride(context: Context, appId: String): Boolean = + context.getSharedPreferences(PREFS, Context.MODE_PRIVATE).contains("game.$appId.engine") + + fun setForGame(context: Context, appId: String, mode: Mode) { + val prefix = "game.$appId." + context.getSharedPreferences(PREFS, Context.MODE_PRIVATE).edit() + .putString(prefix + "engine", mode.engine) + .putInt(prefix + "multiplier", mode.multiplier) + .putInt(prefix + "target", mode.target) + .apply() + } + + fun clearGame(context: Context, appId: String) { + val prefix = "game.$appId." + context.getSharedPreferences(PREFS, Context.MODE_PRIVATE).edit() + .remove(prefix + "engine") + .remove(prefix + "multiplier") + .remove(prefix + "target") + .apply() } fun set(context: Context, mode: Mode) { @@ -41,6 +67,11 @@ object FrameGen { .putString("engine", mode.engine).putInt("multiplier", mode.multiplier).putInt("target", mode.target).apply() } + fun clearGlobal(context: Context) { + context.getSharedPreferences(PREFS, Context.MODE_PRIVATE).edit() + .remove("engine").remove("multiplier").remove("target").apply() + } + fun label(context: Context): String = label(context, mode(context)) fun label(context: Context, mode: Mode): String = when { @@ -50,14 +81,32 @@ object FrameGen { else -> context.getString(R.string.frame_gen_off) } - fun apply(context: Context, refreshHz: Float): String? = apply(context, mode(context), refreshHz) + data class PreparedApply internal constructor( + val mode: Mode, + internal val lsfgStatus: Int? = null, + internal val lsfgCachePath: String? = null, + ) - fun apply(context: Context, mode: Mode, refreshHz: Float): String? { + fun prepareApply(context: Context, mode: Mode): PreparedApply { + if (mode.engine != ENGINE_LSFG) return PreparedApply(mode) + val status = Lossless.sync(context) + val cachePath = Lossless.cacheFile(context)?.absolutePath + return PreparedApply(mode, status, cachePath) + } + + fun apply(context: Context, refreshHz: Float): String? = + apply(context, mode(context), refreshHz) + + fun apply(context: Context, mode: Mode, refreshHz: Float): String? = + applyPrepared(context, prepareApply(context, mode), refreshHz) + + fun applyPrepared(context: Context, prepared: PreparedApply, refreshHz: Float): String? { + val mode = prepared.mode when (mode.engine) { ENGINE_LSFG -> { - val status = Lossless.sync(context) - val cache = Lossless.cacheFile(context) - if (status != LsfgNative.STATUS_OK || cache == null) { + val status = prepared.lsfgStatus ?: LsfgNative.STATUS_NOT_INSTALLED + val cachePath = prepared.lsfgCachePath + if (status != LsfgNative.STATUS_OK || cachePath == null) { WaylandCompositor.nativeSetFrameGenArmed(false, 0, 0) val problem = context.getString( if (status == LsfgNative.STATUS_NOT_INSTALLED) R.string.lsfg_problem_missing else R.string.lsfg_problem_failed, @@ -66,7 +115,7 @@ object FrameGen { return problem } WaylandCompositor.nativeSetFrameGenEngine(WaylandCompositor.FG_ENGINE_LSFG) - WaylandCompositor.nativeSetLsfgCachePath(cache.absolutePath) + WaylandCompositor.nativeSetLsfgCachePath(cachePath) WaylandCompositor.nativeSetFrameGenTuning(FLOW_SCALE_LSFG, refreshHz) WaylandCompositor.nativeSetFrameGenArmed(true, mode.multiplier, mode.target) } diff --git a/app/src/main/java/com/droiddeck/launcher/hud/DroidDeckHudConfig.kt b/app/src/main/java/com/droiddeck/launcher/hud/DroidDeckHudConfig.kt index 8fc38a95f9..63afa4c167 100644 --- a/app/src/main/java/com/droiddeck/launcher/hud/DroidDeckHudConfig.kt +++ b/app/src/main/java/com/droiddeck/launcher/hud/DroidDeckHudConfig.kt @@ -7,15 +7,21 @@ internal object DroidDeckHudConfig { val DEFAULTS: Map = linkedMapOf( "hudSize" to "minimal", "hudLocked" to "1", "hudSnap" to "1", "hudScale" to "100", "hudDock" to "none", "hudOpacity" to "80", "hudColor" to "mid", "hudOutline" to "40", "hudOutlineAccent" to "1", - "showFPS" to "1", "showFPSGraph" to "1", "showCPUUsage" to "1", "showCPULoad" to "1", "showGPULoad" to "1", - "showVram" to "1", "showRAM" to "1", "showPower" to "1", "showTemp" to "1", "showBatteryTemp" to "1", - "showGpuTemp" to "0", "showBattery" to "0", "showLow1" to "1", "showLow01" to "1", "showLow001" to "1", "fpsDecimal" to "1", "showPerCore" to "1", - "showSwap" to "1", "showNet" to "1", "showResolution" to "1", "showProton" to "1", "showSession" to "1", - "showClock" to "1", "showEngine" to "1", "showRenderer" to "1", "showGpuModel" to "1", + "showGpuModel" to "1", "showGPULoad" to "1", "showCPUUsage" to "1", "showCPULoad" to "1", + "showPerCore" to "1", "showTemp" to "1", "showBatteryTemp" to "1", "showGpuTemp" to "0", + "showVram" to "1", "showRAM" to "1", "showSwap" to "1", "showBattery" to "0", "showBatteryTime" to "0", "showPower" to "1", + "showFPS" to "1", "showFPSGraph" to "1", "fpsDecimal" to "1", + "showLatency" to "1", "showAvg" to "1", "showLow1" to "1", "showLow01" to "1", "showLow001" to "1", + "showEngine" to "1", "showRenderer" to "1", + "showDisplay" to "1", "showHdr" to "1", "showNet" to "1", "showResolution" to "1", + "showProton" to "1", "showSession" to "1", "showClock" to "1", "hudOrder" to "", "tempUnit" to "c", "tempBands" to "1", "tempAuto" to "1", "tempRedCpu" to "90", "tempRedGpu" to "90", "tempRedBat" to "48", ) - private val TWINS = mapOf("showCPUUsage" to "showCPULoad", "showTemp" to "showBatteryTemp", "showEngine" to "showRenderer") + private val NOT_READINGS = setOf("showCPULoad", "showRenderer", "fpsDecimal") + + /** Orders saved before the GPU switch was named after the alias the HUD actually reads. */ + private val RENAMED = mapOf("showGPU" to "showGPULoad") fun load(context: Context): MutableMap { val values = LinkedHashMap(DEFAULTS) @@ -36,7 +42,31 @@ internal object DroidDeckHudConfig { val values = load(context) if (key !in DEFAULTS) return values values[key] = value - TWINS[key]?.let { values[it] = value } + SessionPrefs.setDroidDeckHudConfig(context, encode(values)) + return values + } + + /** Writes several switches and the row order in one go, so the HUD is rebuilt once. */ + fun choose(context: Context, switches: Map, order: List): Map { + val values = load(context) + for ((key, on) in switches) if (key in DEFAULTS) { + values[key] = flag(on) + } + val size = DroidDeckHudSize.from(values["hudSize"]) + val groups = sizeOrders(values).toMutableMap() + if (groups.isEmpty()) { + val legacy = legacyOrder(values) + if (legacy.isNotEmpty()) for (each in DroidDeckHudSize.values()) groups[each] = legacy.filter { it in each.rows } + } + groups[size] = order.filter { it in ORDER } + values["hudOrder"] = encodeOrders(groups) + SessionPrefs.setDroidDeckHudConfig(context, encode(values)) + return values + } + + fun clearOrder(context: Context): Map { + val values = load(context) + values["hudOrder"] = "" SessionPrefs.setDroidDeckHudConfig(context, encode(values)) return values } @@ -46,5 +76,37 @@ internal object DroidDeckHudConfig { return DEFAULTS } + /** Every metric switch, in the order the HUD lists them before the user moves any. Derived from + * [DEFAULTS], so a switch added there shows up here without a second list to keep in step. */ + val ORDER: List = DEFAULTS.keys.filter { it.startsWith("show") && it !in NOT_READINGS } + + /** Only the rows the user moved for [size], in the order they left them. */ + fun storedOrder(values: Map, size: DroidDeckHudSize): List = + sizeOrders(values)[size] ?: legacyOrder(values) + + /** Orders saved before each size kept its own: one list, applied to every size. */ + private fun legacyOrder(values: Map): List { + val raw = values["hudOrder"].orEmpty() + if (raw.isBlank() || raw.contains(':')) return emptyList() + return raw.split('|').map { RENAMED[it] ?: it }.filter { it in ORDER } + } + + private fun sizeOrders(values: Map): Map> { + val raw = values["hudOrder"].orEmpty() + if (raw.isBlank()) return emptyMap() + val groups = LinkedHashMap>() + for (group in raw.split(';')) { + val colon = group.indexOf(':') + if (colon <= 0) continue + val size = DroidDeckHudSize.values().firstOrNull { it.token == group.substring(0, colon) } ?: continue + groups[size] = group.substring(colon + 1).split('|').map { RENAMED[it] ?: it }.filter { it in ORDER } + } + return groups + } + + private fun encodeOrders(groups: Map>): String = + groups.entries.filter { it.value.isNotEmpty() } + .joinToString(";") { "${it.key.token}:${it.value.joinToString("|")}" } + private fun flag(on: Boolean) = if (on) "1" else "0" } diff --git a/app/src/main/java/com/droiddeck/launcher/hud/DroidDeckHudHost.kt b/app/src/main/java/com/droiddeck/launcher/hud/DroidDeckHudHost.kt index f612477f33..e2ddefc692 100644 --- a/app/src/main/java/com/droiddeck/launcher/hud/DroidDeckHudHost.kt +++ b/app/src/main/java/com/droiddeck/launcher/hud/DroidDeckHudHost.kt @@ -10,11 +10,9 @@ import android.view.View import android.view.animation.PathInterpolator import android.view.ViewGroup import android.widget.FrameLayout -import com.droiddeck.launcher.gpu.FrameGen import com.droiddeck.launcher.gpu.GpuInfo import com.droiddeck.launcher.runtime.LinuxRuntime import com.droiddeck.launcher.session.SessionPrefs -import com.droiddeck.launcher.session.SessionService import com.droiddeck.launcher.session.SessionState import com.droiddeck.launcher.ui.Motion import com.droiddeck.launcher.wayland.WaylandCompositor @@ -24,7 +22,7 @@ import kotlin.math.roundToInt class DroidDeckHudHost(context: Context) { private val context = context.applicationContext private val handler = Handler(Looper.getMainLooper()) - private val feed = GameFrameFeed(File(LinuxRuntime.rootDir(this.context), HudFrames.PATH)) + private val feed = GameFrameFeed.forRoot(LinuxRuntime.rootDir(this.context)) private val readings = MangoReadings(File(this.context.filesDir, "session"), LinuxRuntime.rootDir(this.context)) private var view: DroidDeckHudView? = null private var parent: ViewGroup? = null @@ -39,6 +37,8 @@ class DroidDeckHudHost(context: Context) { private var snapping = false private var previewFade: ValueAnimator? = null private var flingX = 0f + private var flingY = 0f + private var throwSpring: com.droiddeck.launcher.ui.FlingSpring? = null private var engine = "" private var gpuName = "" private var protonPid = 0 @@ -95,18 +95,22 @@ class DroidDeckHudHost(context: Context) { stopMotion(hud) shrinkPastEdge(hud, rawX, rawY) } - hud.setOnFlungListener { vx, _ -> flingX = vx } + hud.setOnFlungListener { vx, vy -> flingX = vx; flingY = vy } hud.setOnTabDraggedListener { x, y -> dragTab(hud, x, y) } hud.setOnTabDroppedListener { dropTab(hud) } hud.setOnTabDragCancelledListener { snapping = false; keepOnScreen(hud) } hud.setOnMovedListener { x, y -> wantX = x; wantY = y val vx = flingX + val vy = flingY flingX = 0f - dockEdgeFor(hud)?.let { edge -> setDock(hud, edge); return@setOnMovedListener } + flingY = 0f + // A throw only carries the strip into its tab; a floating HUD flung across goes to the other side. + val coast = hud.isStrip + dockEdgeFor(hud, if (coast) vx else 0f, if (coast) vy else 0f)?.let { edge -> setDock(hud, edge); return@setOnMovedListener } stopMotion(hud) fadeDockPreview(hud) - if (snaps && !hud.isStrip) { snapToAnchor(hud, vx); return@setOnMovedListener } + if (snaps && !hud.isStrip) { snapToAnchor(hud, vx, vy); return@setOnMovedListener } val fromX = hud.x; val fromY = hud.y keepOnScreen(hud) wantX = hud.x; wantY = hud.y @@ -179,9 +183,8 @@ class DroidDeckHudHost(context: Context) { private fun applyShown() { if (!running) return val show = !hidden && !backgrounded - val visible = show && SessionState.mode != SessionService.MODE_DESKTOP - view?.visibility = if (visible) View.VISIBLE else View.GONE - showing = visible + view?.visibility = if (show) View.VISIBLE else View.GONE + showing = show if (show != polling) { polling = show if (show) Choreographer.getInstance().postFrameCallback(frameCallback) @@ -238,28 +241,36 @@ class DroidDeckHudHost(context: Context) { } private fun presentedFps(): Float { - if (FrameGen.mode(context).engine == FrameGen.ENGINE_OFF) return 0f - val stats = runCatching { WaylandCompositor.nativeFrameGenStats() }.getOrNull() ?: return 0f + if (!runCatching { WaylandCompositor.nativeFrameGenActive() } + .getOrDefault(false)) return 0f + + val stats = runCatching { + WaylandCompositor.nativeFrameGenStats() + }.getOrNull() ?: return 0f + return if (stats.size > 3 && stats[3] > 1f) stats[3] else 0f } - private fun dockEdgeFor(v: View): DroidDeckHudDock? { - val over = overhang(v) ?: return null + /** The edge the HUD tucks into: one it hangs far enough over, or would once a throw at [vx], [vy] coasts out. */ + private fun dockEdgeFor(v: View, vx: Float = 0f, vy: Float = 0f): DroidDeckHudDock? { + val over = overhang(v, vx * com.droiddeck.launcher.ui.EdgeFling.COAST_S, vy * com.droiddeck.launcher.ui.EdgeFling.COAST_S) ?: return null return over.key.takeIf { over.value >= DOCK_OVERHANG } } - private fun overhang(v: View): Map.Entry? { + private fun overhang(v: View, dx: Float = 0f, dy: Float = 0f): Map.Entry? { val p = v.parent as? View ?: return null if (p.width <= 0 || p.height <= 0 || v.width <= 0 || v.height <= 0) return null val strip = (v as? DroidDeckHudView)?.isStrip == true val density = v.resources.displayMetrics.density val w = if (strip) minOf(v.width.toFloat(), STRIP_PULL_ACROSS_DP * density) else v.width.toFloat() val h = if (strip) maxOf(v.height.toFloat(), STRIP_PULL_OFF_DP * density) else v.height.toFloat() + val x = v.x + dx + val y = v.y + dy return mapOf( - DroidDeckHudDock.LEFT to -v.x / w, - DroidDeckHudDock.RIGHT to (v.x + v.width - p.width) / w, - DroidDeckHudDock.TOP to -v.y / h, - DroidDeckHudDock.BOTTOM to (v.y + v.height - p.height) / h, + DroidDeckHudDock.LEFT to -x / w, + DroidDeckHudDock.RIGHT to (x + v.width - p.width) / w, + DroidDeckHudDock.TOP to -y / h, + DroidDeckHudDock.BOTTOM to (y + v.height - p.height) / h, ).maxByOrNull { it.value } } @@ -294,6 +305,7 @@ class DroidDeckHudHost(context: Context) { } private fun stopMotion(hud: DroidDeckHudView) { + throwSpring?.cancel() hud.animate().setUpdateListener(null) hud.animate().cancel() } @@ -323,23 +335,21 @@ class DroidDeckHudHost(context: Context) { } } - private fun snapToAnchor(hud: DroidDeckHudView, vx: Float) { + /** Sends the HUD to a side the way a chat head goes: by where the throw would carry it, springing on from its speed. */ + private fun snapToAnchor(hud: DroidDeckHudView, vx: Float, vy: Float) { val p = hud.parent as? View ?: return val maxX = (p.width - hud.width).toFloat().coerceAtLeast(0f) val maxY = (p.height - hud.height).toFloat().coerceAtLeast(0f) - anchorX = if (hud.x + vx * FLING_REACH_S < maxX / 2f) 0f else 1f + val right = com.droiddeck.launcher.ui.EdgeFling.toRight(hud.x + hud.width / 2f, p.width.toFloat(), vx, context.resources.displayMetrics.density) + anchorX = if (right) 1f else 0f wantX = anchorX * maxX - wantY = hud.y.coerceIn(0f, maxY) + wantY = com.droiddeck.launcher.ui.EdgeFling.restY(hud.y, vy, 0f, maxY) SessionPrefs.setDroidDeckHudPosition(context, wantX, wantY) stopMotion(hud) - if (Motion.scale == 0f) { - hud.scaleX = 1f; hud.scaleY = 1f - hud.x = wantX; hud.y = wantY - return - } + hud.scaleX = 1f; hud.scaleY = 1f snapping = true - hud.animate().x(wantX).y(wantY).scaleX(1f).scaleY(1f).setDuration(Motion.ms(260).toLong()).setInterpolator(EASE) - .withEndAction { snapping = false; keepOnScreen(hud) }.start() + val spring = throwSpring ?: com.droiddeck.launcher.ui.FlingSpring { sx, sy -> hud.x = sx; hud.y = sy }.also { throwSpring = it } + spring.start(hud.x, hud.y, vx, vy, wantX, wantY) { snapping = false; keepOnScreen(hud) } } private fun shrinkPastEdge(hud: DroidDeckHudView, rawX: Float, rawY: Float) { @@ -496,10 +506,9 @@ class DroidDeckHudHost(context: Context) { companion object { private const val DOCK_OVERHANG = 0.4f - private const val FLING_REACH_S = 0.18f private const val PREVIEW_FROM = 0.55f - private const val STRIP_PULL_ACROSS_DP = 600f - private const val STRIP_PULL_OFF_DP = 150f + private const val STRIP_PULL_ACROSS_DP = 360f + private const val STRIP_PULL_OFF_DP = 100f private const val EXPAND_FADE = 0.5f private val EASE = PathInterpolator(0.2f, 0.8f, 0.2f, 1f) diff --git a/app/src/main/java/com/droiddeck/launcher/hud/DroidDeckHudModels.kt b/app/src/main/java/com/droiddeck/launcher/hud/DroidDeckHudModels.kt index b77d69772f..e88997a09b 100644 --- a/app/src/main/java/com/droiddeck/launcher/hud/DroidDeckHudModels.kt +++ b/app/src/main/java/com/droiddeck/launcher/hud/DroidDeckHudModels.kt @@ -13,6 +13,27 @@ package com.droiddeck.launcher.hud +/** + * Size modes for the DroidDeck HUD (the 4th selectable in-game overlay style). One shared color-coded + * visual language, four amounts of detail โ€” see the approved mockup. The config value is the lower-case + * token stored under the `hudSize` key; the label is the user-facing string. + */ +/** The text sizes and spacing a [DroidDeckHudSize] lays its rows out with, in sp. */ +data class DroidDeckHudStyle( + val row: Float, + val unit: Float, + val pad: Float, + val lineGap: Float, + val labelGap: Float, + val key: Float = 0f, + val sub: Float = 0f, + val foot: Float = 0f, + val band: Float = 0f, + val gutter: Float = 0f, + val tileGap: Float = 0f, + val innerPad: Float = 0f, +) + enum class DroidDeckHudSize(val token: String, val label: String) { FULL("full", "Full"), TILES("tiles", "Tiles"), @@ -26,27 +47,73 @@ enum class DroidDeckHudSize(val token: String, val label: String) { return all[(ordinal + 1) % all.size] } - fun supportedChips(): Set = when (this) { - MINIMAL -> MINIMAL_CHIPS - PILL -> PILL_CHIPS - FULL, TILES, STRIP -> STANDARD_CHIPS - MEGA -> MEGA_CHIPS - } + /** + * The rows this size draws, in the order it draws them before the user moves any. This is the single + * source of truth for both surfaces: [DroidDeckHudView] draws exactly these and the settings screen + * offers exactly these. A switch outside the set is ignored by the size, so the two cannot drift. + */ + val rows: List get() = ROWS.getValue(this) + + /** This size's rows: the ones the user moved first, then the rest in the order [rows] lists them. */ + fun rowsIn(stored: List): List = + stored.filter { it in rows } + rows.filter { it !in stored } + /** + * The numbers each size sets its text in, in sp. One table so a size's scale can be read (and changed) + * in one place instead of hunting the `sp(...)` literals scattered through its builder. + */ + val style: DroidDeckHudStyle get() = STYLE.getValue(this) + companion object { fun from(token: String?): DroidDeckHudSize = values().firstOrNull { it.token.equals(token, ignoreCase = true) } ?: FULL - val MINIMAL_CHIPS = setOf("FPS", "FPS graph", "1% low", "0.1% low", "0.01% low", "FPS .1", "Engine", "Clock") - val PILL_CHIPS = setOf("FPS", "FPS graph", "GPU", "CPU", "VRAM", "RAM", "Battery", "GPU model", "FPS .1", "Engine", "Clock") - val STANDARD_CHIPS = setOf( - "FPS", "FPS graph", "GPU", "GPU temp", "CPU", "VRAM", "RAM", "Power", "Temp", - "Battery", "GPU model", "Engine", "1% low", "0.1% low", "0.01% low", "FPS .1", "Clock", + private val EXTRAS = setOf("showClock") + + val ROWS: Map> = mapOf( + FULL to listOf( + "showFPS", "showFPSGraph", "showGpuModel", "showDisplay", "showHdr", "showGPULoad", "showGpuTemp", + "showCPUUsage", "showTemp", "showVram", "showRAM", "showBattery", "showBatteryTemp", "showBatteryTime", + "showPower", "showLatency", "showAvg", "showLow1", "showLow01", "showLow001", + ), + TILES to listOf( + "showFPS", "showFPSGraph", "showLatency", "showGPULoad", "showGpuTemp", "showCPUUsage", "showTemp", + "showVram", "showRAM", "showEngine", "showDisplay", "showHdr", "showAvg", "showLow1", + "showLow01", "showLow001", "showGpuModel", "showBattery", "showBatteryTemp", "showBatteryTime", "showPower", + ), + PILL to listOf( + "showFPS", "showFPSGraph", "showGpuModel", "showGPULoad", "showGpuTemp", "showCPUUsage", "showTemp", + "showRAM", "showBattery", "showBatteryTemp", "showBatteryTime", "showPower", "showLatency", "showDisplay", + "showVram", "showHdr", + ), + MINIMAL to listOf( + "showFPS", "showBatteryTime", "showFPSGraph", "showLow1", "showLow01", "showLow001", "showAvg", "showLatency", + "showEngine", "showDisplay", "showHdr", + ), + MEGA to DroidDeckHudConfig.ORDER.filter { it !in EXTRAS }, + STRIP to listOf( + "showFPS", "showFPSGraph", "showLow1", "showLow01", "showLow001", "showGPULoad", "showGpuTemp", + "showCPUUsage", "showTemp", "showVram", "showRAM", "showBattery", "showBatteryTemp", "showBatteryTime", + "showPower", "showDisplay", "showHdr", "showGpuModel", + ), ) - val MEGA_ONLY = setOf( - "Per-core", "Swap", "Network", "Resolution", "Proton", "Wrapper", "DX ver", "Session", + + + val STYLE: Map = mapOf( + FULL to DroidDeckHudStyle(row = 12f, unit = 12f * 0.62f, pad = 10f, lineGap = 4f, labelGap = 8f), + TILES to DroidDeckHudStyle(row = 18f, unit = 11f, pad = 9f, lineGap = 4f, labelGap = 8f, + key = 10f, sub = 10f, tileGap = 6f, innerPad = 8f), + PILL to DroidDeckHudStyle(row = 30f, unit = 30f * 0.36f, pad = 10f, lineGap = 3f, labelGap = 12f, + sub = 11.5f), + MINIMAL to DroidDeckHudStyle(row = 34f, unit = 34f * 0.32f, pad = 10f, lineGap = 4f, labelGap = 8f, + sub = 11.5f, foot = 9.5f), + MEGA to DroidDeckHudStyle(row = 11.5f, unit = 11.5f * 0.62f, pad = 10f, lineGap = 3.5f, labelGap = 7f, + band = 9.5f, gutter = 16f), + STRIP to DroidDeckHudStyle(row = 11.5f, unit = 11.5f * 0.8f, pad = 10f, lineGap = 0f, labelGap = 13f), ) - val MEGA_CHIPS = STANDARD_CHIPS + MEGA_ONLY + + fun rowsFor(size: DroidDeckHudSize, values: Map): List = + size.rowsIn(DroidDeckHudConfig.storedOrder(values, size)) } } diff --git a/app/src/main/java/com/droiddeck/launcher/hud/DroidDeckHudView.kt b/app/src/main/java/com/droiddeck/launcher/hud/DroidDeckHudView.kt index a353a6d201..f7211d69e2 100644 --- a/app/src/main/java/com/droiddeck/launcher/hud/DroidDeckHudView.kt +++ b/app/src/main/java/com/droiddeck/launcher/hud/DroidDeckHudView.kt @@ -69,6 +69,7 @@ class DroidDeckHudView(context: Context) : View(context) { private val density = resources.displayMetrics.density + private var cfg: KeyValueSet = KeyValueSet() private var size = DroidDeckHudSize.FULL private var scale = 1f private var bgOpacity = 0.8f @@ -95,13 +96,16 @@ class DroidDeckHudView(context: Context) : View(context) { private var showLow001 = true private var fpsDecimal = true private var showClockTime = true + private var showLatency = true + private var showAvg = true + private var showDisplay = true + private var showHdr = true + private var storedOrder: List = emptyList() private var showPerCore = true private var showSwap = true private var showNet = true private var showResolution = true private var showProton = true - private var showWrapper = true - private var showDxVer = true private var showSession = true private var engineLabel = "" @@ -177,7 +181,7 @@ class DroidDeckHudView(context: Context) : View(context) { fun moved(dx: Float, dy: Float) = Glyph(x + dx, baseline + dy, text, color, sizePx, glow) } private class Span(val text: String, val color: Int, val sizePx: Float, val glow: Boolean = false) - private class HudRow(val label: Span, val vals: List, val inline: Boolean = false) + private class HudRow(val key: String, val label: Span, val vals: List, val inline: Boolean = false) private val glyphs = ArrayList() private val tileRects = ArrayList() private var graphRect: RectF? = null @@ -289,41 +293,52 @@ class DroidDeckHudView(context: Context) : View(context) { private fun cycleSize() { size = size.next() + refreshOrder() onSizeCycledListener?.accept(size.token) rebuildAndInvalidate() } + private fun refreshOrder() { + storedOrder = DroidDeckHudConfig.storedOrder(mapOf("hudOrder" to cfg.get("hudOrder", "")), size) + } + + private fun switchOn(key: String): Boolean = + cfg.get(key, DroidDeckHudConfig.DEFAULTS[key] ?: "1") == "1" + fun applyConfig(configString: String?) { if (configString.isNullOrEmpty()) return - val cfg = KeyValueSet(configString) + cfg = KeyValueSet(configString) size = DroidDeckHudSize.from(cfg.get("hudSize", "minimal")) - showFPS = cfg.get("showFPS", "1") == "1" - showEngine = cfg.get("showEngine", "1") == "1" - showGpuModel = cfg.get("showGpuModel", "1") == "1" - showCPU = cfg.get("showCPUUsage", cfg.get("showCPULoad", "1")) == "1" - showGPU = cfg.get("showGPULoad", "1") == "1" - showCpuTemp = cfg.get("showTemp", "1") == "1" - showGpuTemp = cfg.get("showGpuTemp", "0") == "1" - showVram = cfg.get("showVram", "1") == "1" - showRAM = cfg.get("showRAM", "1") == "1" - showBattery = cfg.get("showBattery", "1") == "1" - showPower = cfg.get("showPower", "1") == "1" - showBatteryTemp = cfg.get("showBatteryTemp", "0") == "1" - showGraph = cfg.get("showFPSGraph", "0") == "1" - showLow1 = cfg.get("showLow1", "1") == "1" - showLow01 = cfg.get("showLow01", "1") == "1" - showLow001 = cfg.get("showLow001", "1") == "1" + showFPS = switchOn("showFPS") + showEngine = switchOn("showEngine") + showGpuModel = switchOn("showGpuModel") + showCPU = switchOn("showCPUUsage") + showGPU = switchOn("showGPULoad") + showCpuTemp = switchOn("showTemp") + showGpuTemp = switchOn("showGpuTemp") + showVram = switchOn("showVram") + showRAM = switchOn("showRAM") + showBattery = switchOn("showBattery") + showPower = switchOn("showPower") + showBatteryTemp = switchOn("showBatteryTemp") + showGraph = switchOn("showFPSGraph") + showLow001 = switchOn("showLow001") fpsDecimal = cfg.get("fpsDecimal", "1") == "1" - showClockTime = cfg.get("showClock", "1") == "1" - showPerCore = cfg.get("showPerCore", "1") == "1" - showSwap = cfg.get("showSwap", "1") == "1" - showNet = cfg.get("showNet", "1") == "1" - showResolution = cfg.get("showResolution", "1") == "1" - showProton = cfg.get("showProton", "1") == "1" - showWrapper = cfg.get("showWrapper", "1") == "1" - showDxVer = cfg.get("showDxVer", "1") == "1" - showSession = cfg.get("showSession", "1") == "1" + showClockTime = switchOn("showClock") + showLatency = switchOn("showLatency") + showAvg = switchOn("showAvg") + showLow1 = switchOn("showLow1") + showLow01 = switchOn("showLow01") + showDisplay = switchOn("showDisplay") + showHdr = switchOn("showHdr") + refreshOrder() + showPerCore = switchOn("showPerCore") + showSwap = switchOn("showSwap") + showNet = switchOn("showNet") + showResolution = switchOn("showResolution") + showProton = switchOn("showProton") + showSession = switchOn("showSession") tempDisplay = HudMetrics.TempDisplay.from(cfg) lockController.setLocked(cfg.get("hudLocked", "1") == "1") dock = DroidDeckHudDock.from(cfg.get("hudDock", "none")) @@ -458,6 +473,8 @@ class DroidDeckHudView(context: Context) : View(context) { return w } + private fun showHdrLine(): Boolean = showHdr && hdrState != DroidDeckHudHdr.NONE + private fun placeRun(startX: Float, baseline: Float, spans: List, glow: Boolean = false): Float { var x = startX for (s in spans) { @@ -539,13 +556,15 @@ class DroidDeckHudView(context: Context) : View(context) { val s = snap if (s == null) { contentW = 0f; contentH = 0f; return } if (dock != DroidDeckHudDock.NONE) { buildDockTab(); return } + if (size == DroidDeckHudSize.STRIP) { buildStrip(s); return } + buildRows(s) + if (contentW <= 0f || contentH <= 0f) return + if (size == DroidDeckHudSize.PILL) addSubtleClock(sp(10f), leftAligned = true) + val pad = sp(size.style.pad) when (size) { - DroidDeckHudSize.FULL -> { buildFull(s); intoPanel(sp(10f), header = true) } - DroidDeckHudSize.TILES -> { buildTiles(s); intoPanel(sp(9f), header = true) } - DroidDeckHudSize.PILL -> { buildPill(s); intoPanel(sp(10f), header = false) } - DroidDeckHudSize.MINIMAL -> buildMinimal(s) - DroidDeckHudSize.MEGA -> { buildMega(s); intoPanel(sp(10f), header = true) } - DroidDeckHudSize.STRIP -> buildStrip(s) + DroidDeckHudSize.MINIMAL -> intoPanel(pad, header = true, halfRound = true) + DroidDeckHudSize.PILL -> intoPanel(pad, header = false) + else -> intoPanel(pad, header = true) } } @@ -615,7 +634,12 @@ class DroidDeckHudView(context: Context) : View(context) { return Pair(dDividerTop + max(1f, density), x) } - private fun intoPanel(pad: Float, header: Boolean) { + /** + * Moves a size's content, laid out from [pad] at the origin, into the panel: under the header, or after + * the logo chip on the Pill. Lines that start on the content's left edge are lined up by their ink, so + * the logo, labels and numbers share one edge. + */ + private fun intoPanel(pad: Float, header: Boolean, halfRound: Boolean = !header) { if (contentW <= 0f || contentH <= 0f) return for (i in glyphs.indices) { val g = glyphs[i] @@ -641,7 +665,7 @@ class DroidDeckHudView(context: Context) : View(context) { val panel = RectF(panelLeft(), panelInset(), max(contentW - pad + dx, headerRight) + sp(18f), contentH - pad + dy + sp(10f) + stroke) chipRect?.let { it.offsetTo(it.left, panel.centerY() - it.height() / 2f) } - finishPanel(panel, halfRound = !header) + finishPanel(panel, halfRound = halfRound) } private fun finishPanel(panel: RectF, halfRound: Boolean) { @@ -712,316 +736,188 @@ class DroidDeckHudView(context: Context) : View(context) { contentW = max(contentW, pad + w + pad) } - private fun hasGpuStats(s: HudMetrics.Snapshot): Boolean = - s.gpuPercent != null || s.gpuTempC != null || s.gpuClockMhz != null - - private fun buildFull(s: HudMetrics.Snapshot) { - val rowPx = sp(12f); val unitPx = rowPx * 0.62f - val pad = sp(10f); val lineGap = sp(4f); val lvGap = sp(8f) - val rows = ArrayList() - - if (showGpuModel && gpuNameText().isNotBlank()) - rows.add(HudRow(Span("GPU", colGpu, rowPx), gpuModelSpans(rowPx, colValue))) - if (displayServer.isNotBlank()) - rows.add(HudRow(Span("DISP", colDisp, rowPx), listOf(Span(displayServer, colValue, rowPx)))) - if (hdrState != DroidDeckHudHdr.NONE) - rows.add(HudRow(Span("HDR", colHdr, rowPx), hdrValue(rowPx))) - if (showGPU && hasGpuStats(s)) { - val v = ArrayList() - v += numUnit(s.gpuPercent?.toString(), "%", rowPx, unitPx) - if (showGpuTemp) tempSpans(s.gpuTempC, HudMetrics.TempSensor.GPU, rowPx, unitPx) - .let { if (it.isNotEmpty()) { v += gap(unitPx); v += it } } - v += gap(unitPx); v += numUnit(s.gpuClockMhz?.toString(), "MHz", rowPx, unitPx) - rows.add(HudRow(Span("GPU", colGpu, rowPx), v)) - } - if (showCPU) { - val v = ArrayList() - v += numUnit(s.cpuPercent?.toString(), "%", rowPx, unitPx) - v += gap(unitPx); v += numUnit(s.cpuClockMhz?.toString(), "MHz", rowPx, unitPx) - if (showCpuTemp) tempSpans(s.cpuTempC, HudMetrics.TempSensor.CPU, rowPx, unitPx) - .let { if (it.isNotEmpty()) { v += gap(unitPx); v += it } } - rows.add(HudRow(Span("CPU", colCpu, rowPx), v)) - } - if (showVram && s.vramText() != null) - rows.add(HudRow(Span("VRAM", colVram, rowPx), valueUnit(s.vramText()!!, rowPx, unitPx))) - if (showRAM) { - val v = ArrayList() - v += valueUnit(s.ramUsedText(), rowPx, unitPx) - v += gap(unitPx); v += numUnit(s.ramPercent.roundToInt().toString(), "%", rowPx, unitPx) - rows.add(HudRow(Span("RAM", colRam, rowPx), v)) - } - if (showBattery || showPower || showBatteryTemp) { - val v = ArrayList(); var any = false - if (showBattery && s.battery.percent != null) { v += numUnit(s.battery.percent.toString(), "%", rowPx, unitPx); any = true } - if (showBatteryTemp) tempSpans(s.battery.tempC, HudMetrics.TempSensor.BATTERY, rowPx, unitPx) - .let { if (it.isNotEmpty()) { if (any) v += gap(unitPx); v += it; any = true } } - if (showPower && s.battery.watts > 0f) { if (any) v += gap(unitPx); v += numUnit(fmt1(s.battery.watts), "W", rowPx, unitPx); any = true } - if (any) rows.add(HudRow(Span("BAT", colBat, rowPx), v)) - } - if (showFPS) { - val v = ArrayList() - v += glowing(numUnit(fpsText(fpsNow), "FPS", rowPx, unitPx)) - v += gap(unitPx); v += numUnit(fmt1(1000f / max(fpsNow, 1f)), "ms", rowPx, unitPx) - rows.add(HudRow(Span(apiLabel(), colFps, rowPx), v)) - rows.add(HudRow(Span("AVG", colLo, rowPx), numUnit(fmt1(fpsAvg), "FPS", rowPx, unitPx))) - if (showLow1) - rows.add(HudRow(Span("1%", colLo, rowPx), numUnit(lowText(lows.low1Fps), "FPS", rowPx, unitPx))) - if (showLow01) - rows.add(HudRow(Span("0.1%", colLo, rowPx), numUnit(lowText(lows.low01Fps), "FPS", rowPx, unitPx))) - if (showLow001) - rows.add(HudRow(Span("0.01%", colLo, rowPx), numUnit(lowText(lows.low001Fps), "FPS", rowPx, unitPx))) - } - - var labelCol = 0f - for (r in rows) if (!r.inline) labelCol = max(labelCol, measure(r.label.text, rowPx)) - val h = lineH(rowPx); val asc = ascent(rowPx) - var y = pad; var maxRight = pad - for (r in rows) { - val baseline = y - asc - placeRun(pad, baseline, listOf(r.label)) - val valX = if (r.inline) pad + measure(r.label.text, rowPx) + lvGap - else pad + labelCol + lvGap - val end = placeRun(valX, baseline, r.vals) - maxRight = max(maxRight, end) - y += h + lineGap - } - - if (showFPS && showGraph) { - val ftPx = unitPx * 1.15f - val baseline = y - asc - placeRun(pad, baseline, listOf(Span("Frametime", colFps, ftPx))) - val stat = "min:${fmt1(graphMinMs)} max:${fmt1(graphMaxMs)}" - val statX = pad + max(labelCol, measure("Frametime", ftPx)) + lvGap - val end = placeRun(statX, baseline, listOf(Span(stat, colDim, unitPx))) - maxRight = max(maxRight, end) - y += h + lineGap - val gh = sp(22f) - val right = max(maxRight, pad + sp(160f)) - graphRect = RectF(pad, y, right, y + gh) - maxRight = max(maxRight, right) - y += gh - } - - contentW = maxRight + pad - contentH = y + pad - addSubtleClock(pad) + private fun switchLabel(key: String): Pair = when (key) { + "showGpuModel" -> "MODEL" to colGpu + "showGPULoad" -> "GPU" to colGpu + "showGpuTemp" -> "GPU.T" to colGpu + "showCPUUsage" -> "CPU" to colCpu + "showTemp" -> "CPU.T" to colCpu + "showBatteryTemp" -> "BAT.T" to colBat + "showPower" -> "PWR" to colBat + "showBattery" -> "BAT" to colBat + "showBatteryTime" -> "BAT TIME" to colBat + "showVram" -> "VRAM" to colVram + "showRAM" -> "RAM" to colRam + "showSwap" -> "SWP" to colRam + "showNet" -> "NET" to colFps + "showPerCore" -> "CORE" to colCpu + "showFPS" -> "FPS" to colFps + "showLatency" -> "MS" to colDim + "showAvg" -> "AVG" to colLo + "showLow1" -> "1%" to colLo + "showLow01" -> "0.1%" to colLo + "showLow001" -> "0.01%" to colLo + "showEngine" -> "API" to colFps + "showDisplay" -> "DISP" to colDisp + "showHdr" -> "HDR" to colHdr + "showResolution" -> "RES" to colDim + "showProton" -> "PROTON" to colVram + "showSession" -> "TIME" to colDim + else -> key.removePrefix("show") to colDim } - private fun buildTiles(s: HudMetrics.Snapshot) { - val keyPx = sp(10f); val valPx = sp(18f); val subPx = sp(10f); val unitPx = sp(11f) - val pad = sp(9f); val innerPad = sp(8f); val tileGap = sp(6f); val lineGap = sp(4f) - - class Tile(val key: String, val keyColor: Int, val value: List, val sub: String?, val wide: Boolean) - val tiles = ArrayList() - - if (showFPS) tiles.add(Tile("FPS", colFps, listOf(Span(fpsText(fpsNow), colValue, valPx, glow = true)), - "${fmt1(fpsAvg)} avg" + (if (showLow1) " ยท ${lowText(lows.low1Fps) ?: "โ€”"} 1%" else ""), false)) - if (showFPS) tiles.add(Tile("FRAME", colDim, numUnit(fmt1(1000f / max(fpsNow, 1f)), "ms", valPx, unitPx), - "${fmt1(graphMinMs)} โ€“ ${fmt1(graphMaxMs)}", false)) - if (showGPU && hasGpuStats(s)) tiles.add(Tile("GPU", colGpu, numUnit(s.gpuPercent?.toString(), "%", valPx, unitPx), - if (showGpuTemp && s.gpuTempC != null) HudMetrics.formatTemp(s.gpuTempC.toFloat(), tempDisplay, false) - else s.gpuClockMhz?.let { "${it}MHz" }, false)) - if (showCPU) tiles.add(Tile("CPU", colCpu, numUnit(s.cpuPercent?.toString(), "%", valPx, unitPx), - listOfNotNull(s.cpuClockMhz?.let { "${it}MHz" }, - if (showCpuTemp) s.cpuTempC?.let { HudMetrics.formatTemp(it.toFloat(), tempDisplay, false) } else null) - .joinToString(" ยท ").ifBlank { null }, false)) - if (showVram && s.vramText() != null) tiles.add(Tile("VRAM", colVram, valueUnit(s.vramText()!!, valPx, unitPx), null, false)) - if (showRAM) tiles.add(Tile("RAM", colRam, numUnit(s.ramPercent.roundToInt().toString(), "%", valPx, unitPx), - "${s.ramUsedText()} / ${s.ramTotalText()}", false)) - if (showEngine && engineLabel.isNotBlank()) - tiles.add(Tile("API", colFps, listOf(Span(engineLabel, colValue, valPx)), - dxVersion().ifBlank { null }, false)) - if (displayServer.isNotBlank()) - tiles.add(Tile("DISPLAY", colDisp, listOf(Span(displayServer, colValue, valPx)), - if (hdrState != DroidDeckHudHdr.NONE) hdrText() else null, false)) - if (showGpuModel && gpuNameText().isNotBlank()) - tiles.add(Tile("GPU", colGpu, gpuModelSpans(valPx, colValue), null, true)) - if (showBattery || showPower || showBatteryTemp) { - val parts = ArrayList(); var any = false - if (showBattery && s.battery.percent != null) { parts += numUnit(s.battery.percent.toString(), "%", valPx, unitPx); any = true } - if (showBatteryTemp && s.battery.tempC != null) { if (any) parts += Span(" ยท ", colDim, subPx); parts += tempSpans(s.battery.tempC, HudMetrics.TempSensor.BATTERY, valPx, unitPx); any = true } - if (showPower && s.battery.watts > 0f) { if (any) parts += Span(" ยท ", colDim, subPx); parts += numUnit(fmt1(s.battery.watts), "W", valPx, unitPx); any = true } - if (any) tiles.add(Tile("BAT", colBat, parts, null, true)) + private fun reading(key: String, s: HudMetrics.Snapshot, labelPx: Float, valuePx: Float, unitPx: Float): HudRow { + if (key == "showFPSGraph") return HudRow(key, Span("", colDim, 0f), emptyList()) + val (label, color) = switchLabel(key) + val values: List = when (key) { + "showGpuModel" -> if (gpuNameText().isBlank()) numUnit(null, "", valuePx, unitPx) + else gpuModelSpans(valuePx, colValue) + "showGPULoad" -> numUnit(s.gpuPercent?.toString(), "%", valuePx, unitPx) + "showGpuTemp" -> tempSpans(s.gpuTempC, HudMetrics.TempSensor.GPU, valuePx, unitPx) + "showCPUUsage" -> numUnit(s.cpuPercent?.toString(), "%", valuePx, unitPx) + "showTemp" -> tempSpans(s.cpuTempC, HudMetrics.TempSensor.CPU, valuePx, unitPx) + "showBatteryTemp" -> tempSpans(s.battery.tempC, HudMetrics.TempSensor.BATTERY, valuePx, unitPx) + "showPower" -> numUnit(if (s.battery.watts > 0f) fmt1(s.battery.watts) else null, "W", valuePx, unitPx) + "showBattery" -> numUnit(s.battery.percent?.toString(), "%", valuePx, unitPx) + "showBatteryTime" -> valueUnit(s.battery.runtimeText ?: "โ€”", valuePx, unitPx) + "showVram" -> valueUnit(s.vramText() ?: "โ€”", valuePx, unitPx) + "showRAM" -> numUnit(s.ramPercent.roundToInt().toString(), "%", valuePx, unitPx) + "showSwap" -> valueUnit(s.swapUsedText() ?: "โ€”", valuePx, unitPx) + "showNet" -> listOf( + Span("โ†“", colDim, unitPx), Span(((s.netDownBps ?: 0L) / 1024L).toString(), colValue, valuePx), + Span(" โ†‘", colDim, unitPx), Span(((s.netUpBps ?: 0L) / 1024L).toString(), colValue, valuePx), + ) + "showPerCore" -> listOf(Span(s.perCorePercent.size.toString(), colValue, valuePx)) + "showFPS" -> glowing(numUnit(fpsText(fpsNow), "", valuePx, unitPx)) + "showLatency" -> numUnit(fmt1(1000f / max(fpsNow, 1f)), "ms", valuePx, unitPx) + "showAvg" -> numUnit(fmt1(fpsAvg), "", valuePx, unitPx) + "showLow1" -> numUnit(lowText(lows.low1Fps), "", valuePx, unitPx) + "showLow01" -> numUnit(lowText(lows.low01Fps), "", valuePx, unitPx) + "showLow001" -> numUnit(lowText(lows.low001Fps), "", valuePx, unitPx) + "showEngine" -> listOf(Span(engineLabel.ifBlank { "โ€”" }, colValue, valuePx)) + "showDisplay" -> listOf(Span(displayServer.ifBlank { "โ€”" }, colDisp, valuePx)) + "showHdr" -> if (showHdrLine()) hdrValue(valuePx) else listOf(Span("off", colDim, valuePx)) + "showResolution" -> listOf(Span(resolutionString(), colValue, valuePx)) + "showProton" -> listOf(Span(wineVersion.ifBlank { "โ€”" }, colVram, valuePx)) + "showSession" -> listOf(Span(elapsedString(), colValue, valuePx)) + else -> listOf(Span("โ€”", colDim, valuePx)) } - if (tiles.isEmpty()) { contentW = 0f; contentH = 0f; return } - - val keyH = lineH(keyPx); val valH = lineH(valPx); val subH = lineH(subPx) - fun tileW(t: Tile) = max(max(measure(t.key, keyPx), runWidth(t.value)), - t.sub?.let { measure(it, subPx) } ?: 0f) + innerPad * 2 - var normalW = 0f - for (t in tiles) if (!t.wide) normalW = max(normalW, tileW(t)) - if (normalW == 0f) for (t in tiles) normalW = max(normalW, tileW(t) / 2f) - val tileH = innerPad * 2 + keyH + lineGap + valH + lineGap + subH - val fullW = normalW * 2 + tileGap - - var x = pad; var y = pad; var col = 0 - fun place(t: Tile, tx: Float, ty: Float, tw: Float) { - tileRects.add(RectF(tx, ty, tx + tw, ty + tileH)) - var by = ty + innerPad - ascent(keyPx) - placeRun(tx + innerPad, by, listOf(Span(t.key, t.keyColor, keyPx))) - by = ty + innerPad + keyH + lineGap - ascent(valPx) - placeRun(tx + innerPad, by, t.value) - if (t.sub != null) { - by = ty + innerPad + keyH + lineGap + valH + lineGap - ascent(subPx) - placeRun(tx + innerPad, by, listOf(Span(t.sub, colDim, subPx))) - } - } - for (t in tiles) { - if (t.wide) { - if (col != 0) { y += tileH + tileGap; col = 0; x = pad } - place(t, pad, y, fullW) - y += tileH + tileGap; col = 0; x = pad - } else { - place(t, x, y, normalW) - col++; x += normalW + tileGap - if (col == 2) { col = 0; x = pad; y += tileH + tileGap } - } - } - if (col != 0) y += tileH + tileGap - if (showFPS && showGraph) { - graphRect = RectF(pad, y, pad + fullW, y + sp(22f)) - y += sp(22f) + tileGap - } - contentW = pad + fullW + pad - contentH = y + (pad - tileGap) - addSubtleClock(pad) + return HudRow(key, Span(label, color, labelPx), values.ifEmpty { listOf(Span("โ€”", colDim, valuePx)) }) } - private fun buildPill(s: HudMetrics.Snapshot) { - val bigPx = sp(30f); val bigUnitPx = bigPx * 0.36f; val stkPx = sp(11.5f) - val pad = sp(10f); val midGap = sp(12f); val stkLineGap = sp(3f) + private fun buildRows(s: HudMetrics.Snapshot) { + val st = size.style + val pad = sp(st.pad); val lineGap = sp(st.lineGap); val lvGap = sp(st.labelGap) + val gutter = sp(if (st.gutter > 0f) st.gutter else 14f) + val unitPx = sp(if (st.unit > 0f) st.unit else st.row * 0.62f) + val basePx = sp(if (st.sub > 0f) st.sub else st.row) - val left = ArrayList() - val generating = differs(fpsNow) - val fpsPx = if (generating) bigPx * 0.55f else bigPx - left += Span(fpsText(fpsNow), colValue, fpsPx, glow = true) - left += Span("fps", colDim, if (generating) bigUnitPx * 0.8f else bigUnitPx) - - val stack = ArrayList>() - val gpuName = if (showGpuModel && gpuNameText().isNotBlank()) gpuModelSpans(stkPx, colDim, compact = true) else null - run { - val l = ArrayList() - if (showGPU && s.gpuPercent != null) { l += Span("GPU ${s.gpuPercent}%", colGpu, stkPx) } - if (showCPU) { if (l.isNotEmpty()) l += Span(" ยท ", colDim, stkPx); l += Span("CPU ${s.cpuPercent ?: "โ€”"}%", colCpu, stkPx) } - if (l.isNotEmpty()) stack.add(l) + val keys = size.rowsIn(storedOrder).filter { switchOn(it) } + if (keys.isEmpty()) { contentW = 0f; contentH = 0f; return } + val hero = (size == DroidDeckHudSize.PILL || size == DroidDeckHudSize.MINIMAL) && keys.firstOrNull() == "showFPS" + val tiles = size == DroidDeckHudSize.TILES + val bigPx = sp(st.row); val bigUnitPx = sp(st.unit) + val heroSpans = listOf( + Span(fpsText(fpsNow), colValue, bigPx, glow = true), + Span("fps", colDim, bigUnitPx), + ) + val listed = keys.filter { !hero || it != "showFPS" }.flatMap { key -> + val labelPx = if (tiles) sp(st.key) else basePx + val valuePx = if (tiles) sp(st.row) else basePx + if (key == "showPerCore" && size == DroidDeckHudSize.MEGA) + perCoreRows(s, labelPx, valuePx, unitPx) + else listOf(reading(key, s, labelPx, valuePx, unitPx)) } - if (showRAM) stack.add(listOf(Span("RAM ${s.ramPercent.roundToInt()}%", colRam, stkPx))) - if (showBattery || showPower || showBatteryTemp) { - val l = ArrayList() - fun part(spans: List) { - l += if (l.isEmpty()) Span("BAT ", colBat, stkPx) else Span(" ยท ", colDim, stkPx) - l += spans + val maxCols = if (size == DroidDeckHudSize.MEGA) 3 else 2 + val cols = when { + listed.size >= 9 -> maxCols + listed.size >= 4 -> minOf(2, maxCols) + else -> 1 + } + + if (tiles) { + val innerPad = sp(st.innerPad); val tileGap = sp(st.tileGap) + val keyH = lineH(sp(st.key)); val valH = lineH(sp(st.row)) + val cellW = listed.maxOf { max(measure(it.label.text, it.label.sizePx), runWidth(it.vals)) } + innerPad * 2f + val graphMin = if (listed.any { it.key == "showFPSGraph" }) sp(GRAPH_MIN_WIDTH_SP) else 0f + val cellMin = graphMin + innerPad * 2f + val cellH = innerPad * 2f + keyH + lineGap + valH + for ((i, r) in listed.withIndex()) { + val x = pad + (i % cols) * (cellW + tileGap) + val y = pad + (i / cols) * (cellH + tileGap) + tileRects.add(RectF(x, y, x + cellW, y + cellH)) + if (r.key == "showFPSGraph") { + graphRect = RectF(x + innerPad, y + innerPad, x + max(cellW, cellMin) - innerPad, y + cellH - innerPad) + continue + } + placeRun(x + innerPad, y + innerPad - ascent(r.label.sizePx), listOf(r.label)) + placeRun(x + innerPad, y + innerPad + keyH + lineGap - ascent(sp(st.row)), r.vals) } - if (showBattery && s.battery.percent != null) part(listOf(Span("${s.battery.percent}%", colBat, stkPx))) - if (showBatteryTemp && s.battery.tempC != null) - part(tempSpans(s.battery.tempC, HudMetrics.TempSensor.BATTERY, stkPx, stkPx * 0.62f)) - if (showPower && s.battery.watts > 0f) part(listOf(Span("${fmt1(s.battery.watts)}W", colDim, stkPx))) - if (l.isNotEmpty()) stack.add(l) - } - run { - val l = ArrayList() - l += Span("${fmt1(1000f / max(fpsNow, 1f))}ms", colDim, stkPx) - if (displayServer.isNotBlank()) { l += Span(" ยท ", colDim, stkPx); l += Span(displayServer, colDisp, stkPx) } - if (showVram && s.vramText() != null) { l += Span(" ยท ", colDim, stkPx); l += Span("${s.vramText()} vram", colDim, stkPx) } - stack.add(l) - } - if (hdrState != DroidDeckHudHdr.NONE) stack.add(hdrLine(stkPx)) - - var statsW = 0f - for (l in stack) statsW = max(statsW, runWidth(l)) - val nameOnTop = gpuName != null && runWidth(gpuName) > statsW - if (gpuName != null && !nameOnTop) stack.add(0, gpuName) - - val apiStr = apiLabel() - val hasApi = apiStr != "FPS" - val apiH = if (hasApi) lineH(stkPx) else 0f - val apiGap = if (hasApi) stkLineGap else 0f - - val leftW = runWidth(left); val leftH = lineH(bigPx) - val apiW = if (hasApi) measure(apiStr, stkPx) else 0f - val leftBlockW = max(leftW, apiW) - val leftColH = apiH + apiGap + leftH - val stkH = lineH(stkPx) - var stackW = 0f - for (l in stack) stackW = max(stackW, runWidth(l)) - val stackTotalH = stack.size * stkH + (stack.size - 1).coerceAtLeast(0) * stkLineGap - val innerH = max(leftColH, stackTotalH) - val topLineH = if (nameOnTop) stkH + stkLineGap else 0f - contentW = pad + leftBlockW + midGap + stackW + pad - contentH = pad + topLineH + innerH + pad - - var ly = pad + topLineH + (innerH - leftColH) / 2f - if (hasApi) { - placeRun(pad, ly - ascent(stkPx), listOf(Span(apiStr, colFps, stkPx))) - ly += apiH + apiGap - } - placeRun(pad, ly - ascent(bigPx), left) - var sy = pad + topLineH + (innerH - stackTotalH) / 2f - for (l in stack) { - placeRun(pad + leftBlockW + midGap, sy - ascent(stkPx), l) - sy += stkH + stkLineGap - } - addSubtleClock(pad, leftAligned = true) - if (nameOnTop && gpuName != null) { - val end = placeRun(pad, pad - ascent(stkPx), gpuName) - contentW = max(contentW, end + pad) + val lines = (listed.size + cols - 1) / cols + contentW = pad + cols * (cellW + tileGap) - tileGap + pad + contentH = pad + lines * (cellH + tileGap) - tileGap + pad + } else { + val columns = (0 until cols).map { c -> listed.filterIndexed { i, _ -> i % cols == c } } + val labelW = columns.map { col -> col.maxOfOrNull { measure(it.label.text, it.label.sizePx) } ?: 0f } + val colW = columns.mapIndexed { c, col -> + val body = if (col.isEmpty()) 0f else labelW[c] + lvGap + (col.maxOfOrNull { runWidth(it.vals) } ?: 0f) + val graph = if (col.any { it.key == "showFPSGraph" }) sp(GRAPH_MIN_WIDTH_SP) + labelW[c] + lvGap else 0f + max(body, graph) + } + val gaps = (0 until cols).count { columns[it].isNotEmpty() }.coerceAtLeast(1) - 1 + val bodyW = colW.sum() + gutter * gaps + var bodyH = 0f + for (col in columns) { + var y = 0f + for (r in col) y += rowHeight(r) + lineGap + if (col.isNotEmpty()) bodyH = max(bodyH, y - lineGap) + } + val heroW = if (hero) runWidth(heroSpans) else 0f + val heroH = if (hero) lineH(bigPx) else 0f + val x0 = pad + if (hero && listed.isNotEmpty()) heroW + gutter else 0f + val top = pad + (max(bodyH, heroH) - bodyH) / 2f + var x = x0 + for (c in 0 until cols) { + if (columns[c].isEmpty()) continue + var y = top + for (r in columns[c]) { + if (r.key == "showFPSGraph") { + val left = x + labelW[c] + lvGap + graphRect = RectF(left, y, max(x + colW[c], left + sp(GRAPH_MIN_WIDTH_SP)), y + sp(GRAPH_HEIGHT_SP)) + y += sp(GRAPH_HEIGHT_SP) + lineGap + continue + } + val px = maxOf(r.label.sizePx, r.vals.maxOfOrNull { it.sizePx } ?: 0f) + val baseline = y - ascent(px) + placeRun(x, baseline, listOf(r.label)) + placeRun(x + labelW[c] + lvGap, baseline, r.vals) + y += lineH(px) + lineGap + } + x += colW[c] + gutter + } + if (hero) { + val baseline = pad + (max(bodyH, heroH) - heroH) / 2f - ascent(bigPx) + placeRun(pad, baseline, heroSpans, glow = true) + } + contentW = max(x0 + bodyW, pad + heroW) + pad + contentH = pad + max(bodyH, heroH) + pad } } - private fun buildMinimal(s: HudMetrics.Snapshot) { - val bigPx = sp(34f); val bigUnitPx = bigPx * 0.32f; val subPx = sp(11.5f); val footPx = sp(9.5f) - val stroke = outlineWidth() - val left = contentLeft() - val inner = panelInset() + stroke + private fun rowHeight(r: HudRow): Float = + if (r.key == "showFPSGraph") sp(GRAPH_HEIGHT_SP) + else lineH(maxOf(r.label.sizePx, r.vals.maxOfOrNull { it.sizePx } ?: 0f)) - val minGenerating = differs(fpsNow) - val big = listOf( - Span(fpsText(fpsNow), colValue, if (minGenerating) bigPx * 0.55f else bigPx), - Span("fps", colDim, if (minGenerating) bigUnitPx * 0.8f else bigUnitPx)) - val sub = ArrayList() - fun low(label: String, value: Float) { - if (sub.isNotEmpty()) sub += Span(" ยท ", colDim, subPx) - sub += Span("$label ", colDim, subPx) - sub += Span(lowText(value) ?: "โ€”", colFps, subPx) + private fun perCoreRows(s: HudMetrics.Snapshot, labelPx: Float, valuePx: Float, unitPx: Float): List { + val pct = s.perCorePercent + val clk = s.perCoreClockMhz + return (0 until max(pct.size, clk.size)).map { i -> + val vals = ArrayList() + vals += numUnit(if (i < pct.size && pct[i] >= 0) pct[i].toString() else null, "%", valuePx, unitPx) + vals += Span(" ", colDim, unitPx) + vals += numUnit(if (i < clk.size && clk[i] > 0) clk[i].toString() else null, "MHz", valuePx, unitPx) + HudRow("showPerCore", Span("C$i", colCpu, labelPx), vals) } - if (showLow1) low("1%", lows.low1Fps) - if (showLow01) low("0.1%", lows.low01Fps) - if (showLow001) low("0.01%", lows.low001Fps) - val footerLabel = listOf(if (showEngine) engineLabel else "", displayServer) - .filter { it.isNotBlank() }.joinToString(" ยท ") - val hdr = if (hdrState != DroidDeckHudHdr.NONE) hdrLine(footPx) else emptyList() - - val (headerBottom, headerRight) = addPanelHeader(left, inner) - val x = headerRight - - val colW = maxOf(runWidth(big), runWidth(sub), x - left, - max(measure(footerLabel, footPx), runWidth(hdr)), if (showGraph) sp(120f) else 0f) - val bigBase = headerBottom + sp(8f) + capHeight(big[0].sizePx) - placeRun(left - inkLeft(big[0].text, big[0].sizePx), bigBase, big, glow = true) - var last = bigBase - if (sub.isNotEmpty()) { - last += sp(10f) + capHeight(subPx) - placeRun(left - inkLeft(sub[0].text, subPx), last, sub) - } - if (showGraph) { - val top = last + sp(9f) - graphRect = RectF(left, top, left + colW, top + sp(24f)) - last = top + sp(24f) - } - if (footerLabel.isNotBlank()) { - val base = last + sp(8f) + capHeight(footPx) - glyphs.add(Glyph(left - inkLeft(footerLabel, footPx), base, footerLabel, blend(colDim), footPx)) - last = base - } - if (hdr.isNotEmpty()) { - val base = last + sp(6f) + capHeight(footPx) - placeRun(left - inkLeft(hdr[0].text, footPx), base, hdr) - last = base - } - measurePaint.textSize = footPx - val panel = RectF(panelLeft(), panelInset(), left + colW + sp(34f), last + measurePaint.fontMetrics.descent + sp(9f) + stroke) - - finishPanel(panel, halfRound = true) } private fun buildStrip(s: HudMetrics.Snapshot) { @@ -1046,66 +942,27 @@ class DroidDeckHudView(context: Context) : View(context) { } val generating = differs(fpsNow) - val fps = ArrayList() - if (apiLabel() != "FPS") fps += Span("${apiLabel()} ", colDim, rowPx) - fps += Span(fpsText(fpsNow), colValue, if (generating) fpsPx * 0.8f else fpsPx, glow = true) - fps += Span("fps", colDim, unitPx) - x = placeRun(x, baseline, fps) + groupGap - - if (showGraph) { - val gw = sp(72f); val gh = h * 0.55f - if (x + gw <= right) { + for (key in size.rowsIn(storedOrder)) { + if (!switchOn(key)) continue + if (key == "showFPSGraph") { + val gw = sp(72f); val gh = h * 0.55f + if (x + gw > right) break graphRect = RectF(x, mid - gh / 2f, x + gw, mid + gh / 2f) x += gw + groupGap + continue } - } - - val groups = ArrayList>() - run { - val l = ArrayList() - fun low(label: String, value: Float) { - if (l.isNotEmpty()) l += Span(" ", colDim, rowPx) - l += Span("$label ", colDim, rowPx) - l += Span(lowText(value) ?: "โ€”", colFps, rowPx) + val spans = if (key == "showFPS") { + val fps = ArrayList() + if (apiLabel() != "FPS") fps += Span("${apiLabel()} ", colDim, rowPx) + fps += Span(fpsText(fpsNow), colValue, if (generating) fpsPx * 0.8f else fpsPx, glow = true) + fps += Span("fps", colDim, unitPx) + fps + } else { + val row = reading(key, s, rowPx, rowPx, unitPx) + listOf(row.label, Span(" ", colDim, rowPx)) + row.vals } - if (showLow1) low("1%", lows.low1Fps) - if (showLow01) low("0.1%", lows.low01Fps) - if (showLow001) low("0.01%", lows.low001Fps) - if (l.isNotEmpty()) groups += l - } - if (showGPU || showGpuTemp) { - val l = arrayListOf(Span("GPU", colGpu, rowPx)) - if (showGPU) l += Span(" ${s.gpuPercent ?: "โ€”"}%", colGpu, rowPx) - if (showGpuTemp && s.gpuTempC != null) { l += Span(" ", colDim, rowPx); l += tempSpans(s.gpuTempC, HudMetrics.TempSensor.GPU, rowPx, unitPx) } - groups += l - } - if (showCPU || showCpuTemp) { - val l = arrayListOf(Span("CPU", colCpu, rowPx)) - if (showCPU) l += Span(" ${s.cpuPercent ?: "โ€”"}%", colCpu, rowPx) - if (showCpuTemp && s.cpuTempC != null) { l += Span(" ", colDim, rowPx); l += tempSpans(s.cpuTempC, HudMetrics.TempSensor.CPU, rowPx, unitPx) } - groups += l - } - if (showVram) s.vramText()?.let { groups += listOf(Span("VRAM $it", colVram, rowPx)) } - if (showRAM) groups += listOf(Span("RAM ${s.ramPercent.roundToInt()}%", colRam, rowPx)) - if (showBattery || showPower || showBatteryTemp) { - val l = ArrayList() - fun part(spans: List) { - l += if (l.isEmpty()) Span("BAT ", colBat, rowPx) else Span(" ", colDim, rowPx) - l += spans - } - if (showBattery && s.battery.percent != null) part(listOf(Span("${s.battery.percent}%", colBat, rowPx))) - if (showBatteryTemp && s.battery.tempC != null) - part(tempSpans(s.battery.tempC, HudMetrics.TempSensor.BATTERY, rowPx, unitPx)) - if (showPower && s.battery.watts > 0f) part(listOf(Span("${fmt1(s.battery.watts)}W", colDim, rowPx))) - if (l.isNotEmpty()) groups += l - } - if (displayServer.isNotBlank()) groups += listOf(Span(displayServer, colDisp, rowPx)) - if (hdrState != DroidDeckHudHdr.NONE) groups += hdrLine(rowPx) - if (showGpuModel && gpuNameText().isNotBlank()) groups += gpuModelSpans(rowPx, colDim, compact = true) - - for (g in groups) { - if (x + runWidth(g) > right) break - x = placeRun(x, baseline, g) + groupGap + if (x + runWidth(spans) > right) break + x = placeRun(x, baseline, spans) + groupGap } stripRect = RectF(0f, 0f, w, h) @@ -1125,168 +982,6 @@ class DroidDeckHudView(context: Context) : View(context) { return inkRect.left.toFloat() } - private fun layoutColumn(rows: List, x: Float, y0: Float, - rowPx: Float, lineGap: Float, lvGap: Float): Pair { - if (rows.isEmpty()) return Pair(y0, x) - var labelCol = 0f - for (r in rows) if (!r.inline) labelCol = max(labelCol, measure(r.label.text, rowPx)) - val h = lineH(rowPx); val asc = ascent(rowPx) - var y = y0; var right = x - for (r in rows) { - val baseline = y - asc - placeRun(x, baseline, listOf(r.label)) - val valX = if (r.inline) x + measure(r.label.text, rowPx) + lvGap - else x + labelCol + lvGap - val end = placeRun(valX, baseline, r.vals) - right = max(right, end) - y += h + lineGap - } - return Pair(y - lineGap, right) - } - - private fun layoutWrap(fragments: List>, x: Float, y0: Float, maxWidth: Float, - px: Float, lineGap: Float): Pair { - if (fragments.isEmpty()) return Pair(y0, x) - val h = lineH(px); val asc = ascent(px) - val sepW = measure(" ยท ", px) - var cx = x; var y = y0; var right = x; var firstOnLine = true - for (frag in fragments) { - val w = runWidth(frag) - if (!firstOnLine && (cx + sepW + w - x) > maxWidth) { y += h + lineGap; cx = x; firstOnLine = true } - if (!firstOnLine) { placeRun(cx, y - asc, listOf(Span(" ยท ", colDim, px))); cx += sepW } - val end = placeRun(cx, y - asc, frag) - cx = end; right = max(right, end); firstOnLine = false - } - return Pair(y + h, right) - } - - private fun buildMega(s: HudMetrics.Snapshot) { - val rowPx = sp(11.5f); val unitPx = rowPx * 0.62f; val bandPx = sp(9.5f) - val pad = sp(10f); val lineGap = sp(3.5f); val lvGap = sp(7f); val gutter = sp(16f) - - val left = ArrayList() - if (showGpuModel && gpuNameText().isNotBlank()) - left.add(HudRow(Span("GPU", colGpu, rowPx), gpuModelSpans(rowPx, colValue))) - if (showGPU && hasGpuStats(s)) { - val v = ArrayList() - v += numUnit(s.gpuPercent?.toString(), "%", rowPx, unitPx) - if (showGpuTemp) tempSpans(s.gpuTempC, HudMetrics.TempSensor.GPU, rowPx, unitPx) - .let { if (it.isNotEmpty()) { v += gap(unitPx); v += it } } - v += gap(unitPx); v += numUnit(s.gpuClockMhz?.toString(), "MHz", rowPx, unitPx) - left.add(HudRow(Span("GPU", colGpu, rowPx), v)) - } - if (showCPU) { - val v = ArrayList() - v += numUnit(s.cpuPercent?.toString(), "%", rowPx, unitPx) - v += gap(unitPx); v += numUnit(s.cpuClockMhz?.toString(), "MHz", rowPx, unitPx) - if (showCpuTemp) tempSpans(s.cpuTempC, HudMetrics.TempSensor.CPU, rowPx, unitPx) - .let { if (it.isNotEmpty()) { v += gap(unitPx); v += it } } - left.add(HudRow(Span("CPU", colCpu, rowPx), v)) - } - if (showPerCore) { - val pct = s.perCorePercent; val clk = s.perCoreClockMhz - val n = max(pct.size, clk.size) - for (i in 0 until n) { - val v = ArrayList() - v += numUnit(if (i < pct.size && pct[i] >= 0) pct[i].toString() else null, "%", rowPx, unitPx) - v += gap(unitPx) - v += numUnit(if (i < clk.size && clk[i] > 0) clk[i].toString() else null, "MHz", rowPx, unitPx) - left.add(HudRow(Span("C$i", colCpu, rowPx), v)) - } - } - - val right = ArrayList() - if (showVram && s.vramText() != null) - right.add(HudRow(Span("VRAM", colVram, rowPx), valueUnit(s.vramText()!!, rowPx, unitPx))) - if (showRAM) { - val v = ArrayList() - v += valueUnit(s.ramUsedText(), rowPx, unitPx) - v += Span("/", colDim, unitPx); v += valueUnit(s.ramTotalText(), rowPx, unitPx) - v += gap(unitPx); v += numUnit(s.ramPercent.roundToInt().toString(), "%", rowPx, unitPx) - right.add(HudRow(Span("RAM", colRam, rowPx), v)) - } - if (showSwap && s.swapUsedText() != null) { - val v = ArrayList() - v += valueUnit(s.swapUsedText()!!, rowPx, unitPx) - s.swapTotalText()?.let { v += Span("/", colDim, unitPx); v += valueUnit(it, rowPx, unitPx) } - right.add(HudRow(Span("SWP", colRam, rowPx), v)) - } - if (showNet && s.netDownBps != null) { - val d = (s.netDownBps ?: 0L) / 1024L - val u = (s.netUpBps ?: 0L) / 1024L - val v = ArrayList() - v += Span("โ†“", colDim, unitPx); v += Span(d.toString(), colValue, rowPx) - v += Span(" โ†‘", colDim, unitPx); v += Span(u.toString(), colValue, rowPx) - v += Span("KB/s", colDim, unitPx) - right.add(HudRow(Span("NET", colFps, rowPx), v)) - } - if (showBattery || showPower || showBatteryTemp) { - val v = ArrayList(); var any = false - if (showBattery && s.battery.percent != null) { v += numUnit(s.battery.percent.toString(), "%", rowPx, unitPx); any = true } - if (showBatteryTemp) tempSpans(s.battery.tempC, HudMetrics.TempSensor.BATTERY, rowPx, unitPx) - .let { if (it.isNotEmpty()) { if (any) v += gap(unitPx); v += it; any = true } } - if (showPower && s.battery.watts > 0f) { if (any) v += gap(unitPx); v += numUnit(fmt1(s.battery.watts), "W", rowPx, unitPx); any = true } - if (any) right.add(HudRow(Span("BAT", colBat, rowPx), v)) - } - if (showFPS) { - val v = ArrayList() - v += glowing(numUnit(fpsText(fpsNow), "FPS", rowPx, unitPx)) - v += gap(unitPx); v += numUnit(fmt1(1000f / max(fpsNow, 1f)), "ms", rowPx, unitPx) - right.add(HudRow(Span(apiLabel(), colFps, rowPx), v)) - right.add(HudRow(Span("AVG", colLo, rowPx), numUnit(fmt1(fpsAvg), "FPS", rowPx, unitPx))) - if (showLow1) - right.add(HudRow(Span("1%", colLo, rowPx), numUnit(lowText(lows.low1Fps), "FPS", rowPx, unitPx))) - if (showLow01) - right.add(HudRow(Span("0.1%", colLo, rowPx), numUnit(lowText(lows.low01Fps), "FPS", rowPx, unitPx))) - if (showLow001) - right.add(HudRow(Span("0.01%", colLo, rowPx), numUnit(lowText(lows.low001Fps), "FPS", rowPx, unitPx))) - } - - val (leftBottom, leftRight) = layoutColumn(left, pad, pad, rowPx, lineGap, lvGap) - val rightX = (if (left.isEmpty()) pad else leftRight + gutter) - val (rightBottom, rightRight) = layoutColumn(right, rightX, pad, rowPx, lineGap, lvGap) - var y = max(leftBottom, rightBottom) - var maxRight = max(leftRight, rightRight) - - val band = ArrayList>() - if (showResolution) band.add(listOf(Span("RES ", colDim, bandPx), Span(resolutionString(), colValue, bandPx))) - if (displayServer.isNotBlank()) band.add(listOf(Span("DISP ", colDim, bandPx), Span(displayServer, colDisp, bandPx))) - if (hdrState != DroidDeckHudHdr.NONE) band.add(listOf(Span("HDR ", colDim, bandPx)) + hdrValue(bandPx)) - if (showProton && wineVersion.isNotBlank()) band.add(listOf(Span(wineVersion, colVram, bandPx))) - if (showSession) band.add(listOf(Span("elapsed ", colDim, bandPx), Span(elapsedString(), colValue, bandPx))) - if (band.isNotEmpty()) { - y += sp(4f) - val (bBottom, bRight) = layoutWrap(band, pad, y, max(maxRight - pad, sp(180f)), bandPx, lineGap) - y = bBottom; maxRight = max(maxRight, bRight) - } - - if (showGraph) { - y += sp(3f) - val gh = sp(22f) - val gr = max(maxRight, pad + sp(220f)) - graphRect = RectF(pad, y, gr, y + gh) - maxRight = max(maxRight, gr) - y += gh - } - - val dxLine = dxVersionLabeled() - val hasDx = showDxVer && dxLine.isNotBlank() - if (hasDx) { - y += sp(4f) - maxRight = max(maxRight, placeRun(pad, y - ascent(bandPx), listOf(Span(dxLine, colDim, bandPx)))) - y += lineH(bandPx) - } - if (showWrapper && graphicsWrapper.isNotBlank()) { - y += if (hasDx) sp(1f) else sp(4f) - maxRight = max(maxRight, placeRun(pad, y - ascent(bandPx), listOf(Span(graphicsWrapper, colDim, bandPx)))) - y += lineH(bandPx) - } - - contentW = maxRight + pad - contentH = y + pad - addSubtleClock(pad) - } - override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) { if (stripRect != null) { setMeasuredDimension(contentW.roundToInt(), resolveSize(contentH.roundToInt(), heightMeasureSpec)); return } setMeasuredDimension( @@ -1567,6 +1262,8 @@ class DroidDeckHudView(context: Context) : View(context) { const val MIN_SCALE = 0.5f const val MAX_SCALE = 2f const val GRAPH_CLIP_MS = 49.9f + const val GRAPH_HEIGHT_SP = 22f + const val GRAPH_MIN_WIDTH_SP = 160f fun parseIntOr(s: String?, d: Int): Int = try { s?.trim()?.toInt() ?: d } catch (e: Exception) { d } diff --git a/app/src/main/java/com/droiddeck/launcher/hud/GameFrames.kt b/app/src/main/java/com/droiddeck/launcher/hud/GameFrames.kt index 2aba209ded..db5f74e4cf 100644 --- a/app/src/main/java/com/droiddeck/launcher/hud/GameFrames.kt +++ b/app/src/main/java/com/droiddeck/launcher/hud/GameFrames.kt @@ -1,6 +1,7 @@ package com.droiddeck.launcher.hud import java.io.File +import java.io.RandomAccessFile import kotlin.math.roundToInt internal class FrameStats { @@ -159,7 +160,11 @@ internal class FrameStats { } } -internal class GameFrameFeed(private val file: File, val stats: FrameStats = FrameStats()) { +internal class GameFrameFeed( + private val file: File, + val stats: FrameStats = FrameStats(), + private val clockControl: File? = null, +) { private var handle = 0L private var nextOpenNs = 0L private var lastRingFrameNs = 0L @@ -171,6 +176,8 @@ internal class GameFrameFeed(private val file: File, val stats: FrameStats = Fra private var lastCompositorNs = 0L @Volatile private var compositorFrames = 0L private var seenCompositorFrames = 0L + private var clockShiftNs = 0L + private var clockShiftReadNs = Long.MIN_VALUE @Volatile var engine = "" private set @@ -199,6 +206,9 @@ internal class GameFrameFeed(private val file: File, val stats: FrameStats = Fra } val n = HudFrames.nativePoll(handle, frametimes, times) if (n > 0) { + var shift = guestClockShift(nowNs, SHIFT_NS) + if (nowNs - (times[n - 1] + shift) > LIVE_NS) shift = guestClockShift(nowNs, SHIFT_RECHECK_NS) + for (i in 0 until n) times[i] += shift if (!fromGamescope) { stats.reset() fromGamescope = true @@ -216,6 +226,16 @@ internal class GameFrameFeed(private val file: File, val stats: FrameStats = Fra return n > 0 || compositorAdded } + internal fun guestClockShift(nowNs: Long, maxAgeNs: Long): Long { + val control = clockControl ?: return 0L + if (clockShiftReadNs != Long.MIN_VALUE && nowNs - clockShiftReadNs < maxAgeNs) return clockShiftNs + clockShiftReadNs = nowNs + clockShiftNs = runCatching { + RandomAccessFile(control, "r").use { if (it.length() < Long.SIZE_BYTES) 0L else java.lang.Long.reverseBytes(it.readLong()) } + }.getOrDefault(0L).coerceAtLeast(0L) + return clockShiftNs + } + fun onCompositorFrame(nowNs: Long) { if (fromGamescope) { lastCompositorNs = 0L @@ -253,6 +273,11 @@ internal class GameFrameFeed(private val file: File, val stats: FrameStats = Fra private const val LIVE_NS = 2_000_000_000L private const val STALE_NS = 5_000_000_000L private const val INFO_NS = 500_000_000L + private const val SHIFT_NS = 1_000_000_000L + private const val SHIFT_RECHECK_NS = 100_000_000L + private const val CLOCK_CONTROL_PATH = "tmp/.bl-clock" + + fun forRoot(root: File) = GameFrameFeed(File(root, HudFrames.PATH), clockControl = File(root, CLOCK_CONTROL_PATH)) fun engineLabel(name: String): String = when (name) { "DXVK" -> "DXVK" diff --git a/app/src/main/java/com/droiddeck/launcher/hud/HudLockController.java b/app/src/main/java/com/droiddeck/launcher/hud/HudLockController.java index 98c34df7ce..b4c1cfc7ea 100644 --- a/app/src/main/java/com/droiddeck/launcher/hud/HudLockController.java +++ b/app/src/main/java/com/droiddeck/launcher/hud/HudLockController.java @@ -50,6 +50,7 @@ public class HudLockController { private final Callbacks cb; private final GestureDetector detector; private final ScaleGestureDetector scaleDetector; + private final android.view.VelocityTracker velocity = android.view.VelocityTracker.obtain(); private boolean locked = false; @@ -86,8 +87,18 @@ public class HudLockController { public boolean onTouchEvent(MotionEvent event) { scaleDetector.onTouchEvent(event); detector.onTouchEvent(event); + // The HUD moves under the finger, so the throw is measured on the screen, not in the HUD. + MotionEvent onScreen = MotionEvent.obtain(event); + onScreen.setLocation(event.getRawX(), event.getRawY()); + if (event.getActionMasked() == MotionEvent.ACTION_DOWN) velocity.clear(); + velocity.addMovement(onScreen); + onScreen.recycle(); int action = event.getActionMasked(); if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL) { + if (dragging && !locked && !pinched && action == MotionEvent.ACTION_UP) { + velocity.computeCurrentVelocity(1000); + cb.onFlung(velocity.getXVelocity(), velocity.getYVelocity()); + } if (dragging && !locked) cb.onMoved(view.getX(), view.getY()); dragging = false; } @@ -124,12 +135,6 @@ public class HudLockController { return true; } - @Override - public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { - if (dragging && !locked && !pinched) cb.onFlung(velocityX, velocityY); - return true; - } - @Override public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) { if (pinched) return true; diff --git a/app/src/main/java/com/droiddeck/launcher/hud/HudMetrics.java b/app/src/main/java/com/droiddeck/launcher/hud/HudMetrics.java index 51a4e42608..2fab8cdc14 100644 --- a/app/src/main/java/com/droiddeck/launcher/hud/HudMetrics.java +++ b/app/src/main/java/com/droiddeck/launcher/hud/HudMetrics.java @@ -14,6 +14,8 @@ package com.droiddeck.launcher.hud; +import com.droiddeck.launcher.session.BatteryRuntimeEstimator; + import android.app.ActivityManager; import android.content.Context; import android.content.Intent; @@ -560,10 +562,9 @@ public class HudMetrics { return sawSignal; } - private Double smoothedBatteryRuntimeHours = null; - private static final double MAX_RUNTIME_HOURS = 72.0; - private static final double RUNTIME_SMOOTHING_OLD_WEIGHT = 0.65; - private static final double RUNTIME_SMOOTHING_NEW_WEIGHT = 0.35; + private final BatteryRuntimeEstimator batteryRuntimeEstimator = new BatteryRuntimeEstimator(); + private Boolean lastBatteryDischarging = null; + private Boolean lastBatteryCharging = null; public Battery collectBattery() { BatteryManager bm = (BatteryManager) context.getSystemService(Context.BATTERY_SERVICE); @@ -581,11 +582,22 @@ public class HudMetrics { int st = status.getIntExtra(BatteryManager.EXTRA_STATUS, BatteryManager.BATTERY_STATUS_UNKNOWN); boolean charging = st == BatteryManager.BATTERY_STATUS_CHARGING || st == BatteryManager.BATTERY_STATUS_FULL; + boolean discharging = st == BatteryManager.BATTERY_STATUS_DISCHARGING + || st == BatteryManager.BATTERY_STATUS_NOT_CHARGING; + if (lastBatteryDischarging != null && lastBatteryDischarging.booleanValue() != discharging) { + batteryRuntimeEstimator.reset(); + } + lastBatteryDischarging = discharging; if (st == BatteryManager.BATTERY_STATUS_UNKNOWN) { Boolean sysCharging = readChargingFromPowerSupply(); if (sysCharging != null) charging = sysCharging; } - long currentMicroAmps = Math.abs(bm.getLongProperty(BatteryManager.BATTERY_PROPERTY_CURRENT_NOW)); + if (lastBatteryCharging != null + && lastBatteryCharging.booleanValue() != charging) { + batteryRuntimeEstimator.reset(); + } + lastBatteryCharging = charging; + long currentMicroAmps = BatteryRuntimeEstimator.toMicroamps(bm.getLongProperty(BatteryManager.BATTERY_PROPERTY_CURRENT_NOW)); long chargeCounter = bm.getLongProperty(BatteryManager.BATTERY_PROPERTY_CHARGE_COUNTER); int voltageMv = status.getIntExtra(BatteryManager.EXTRA_VOLTAGE, 0); @@ -606,36 +618,16 @@ public class HudMetrics { if (uw != null && uw != 0L) watts = (float) (Math.abs(uw) / 1_000_000.0); } + Double runtimeHours = !charging + ? batteryRuntimeEstimator.estimateHours(chargeCounter, Math.abs((double) currentMicroAmps)) + : null; String runtimeText; - if (charging) { - smoothedBatteryRuntimeHours = null; - runtimeText = "LEFT CHG"; - } else if (currentMicroAmps <= 0L || chargeCounter <= 0L) { - runtimeText = null; - } else { - double rawHours = (double) chargeCounter / (double) currentMicroAmps; - if (!Double.isFinite(rawHours) || rawHours <= 0.0 || rawHours > MAX_RUNTIME_HOURS) { - runtimeText = null; - } else { - double smoothed = smoothedBatteryRuntimeHours == null ? rawHours - : (smoothedBatteryRuntimeHours * RUNTIME_SMOOTHING_OLD_WEIGHT) - + (rawHours * RUNTIME_SMOOTHING_NEW_WEIGHT); - smoothedBatteryRuntimeHours = smoothed; - runtimeText = "LEFT " + formatRuntimeHours(smoothed); - } - } + if (st == BatteryManager.BATTERY_STATUS_FULL || (percent != null && percent >= 100)) runtimeText = "Full"; + else if (charging) runtimeText = "Charging"; + else runtimeText = BatteryRuntimeEstimator.formatDuration(runtimeHours); return new Battery(watts, charging, percent, tempC, runtimeText); } - private static String formatRuntimeHours(double hours) { - int totalMinutes = Math.max(1, (int) Math.round(hours * 60.0)); - int wholeHours = totalMinutes / 60; - int minutes = totalMinutes % 60; - if (wholeHours > 0 && minutes > 0) return wholeHours + "h " + minutes + "m"; - if (wholeHours > 0) return wholeHours + "h"; - return minutes + "m"; - } - private static float currentRawToAmps(long raw) { if (raw == 0L || raw == Long.MIN_VALUE) return 0f; long a = Math.abs(raw); @@ -651,15 +643,10 @@ public class HudMetrics { return currentRawToAmps(raw); } - public Integer getCpuClockMhz() { - int cores = Runtime.getRuntime().availableProcessors(); - long maxKhz = 0; - for (int i = 0; i < cores; i++) { - Long cur = readLongFromLine("/sys/devices/system/cpu/cpu" + i + "/cpufreq/scaling_cur_freq"); - if (cur != null && cur > maxKhz) maxKhz = cur; - } - if (maxKhz <= 0) return null; - return (int) (maxKhz / 1000L); + static Integer fastestCoreMhz(int[] perCoreMhz) { + int max = 0; + for (int mhz : perCoreMhz) max = Math.max(max, mhz); + return max > 0 ? max : null; } private List gpuClockPathsCache = null; @@ -809,7 +796,8 @@ public class HudMetrics { if (mango != null) return mangoSnapshot(mango); Integer cpu = getCpuUsagePercent(); Integer gpu = getGpuUsagePercent(); - Integer cpuClk = getCpuClockMhz(); + int[] perCoreClk = getPerCoreClockMhz(); + Integer cpuClk = fastestCoreMhz(perCoreClk); Integer gpuClk = getGpuClockMhz(); Integer cpuTemp = getCpuTempC(); Integer gpuTemp = getGpuTempC(); @@ -829,7 +817,6 @@ public class HudMetrics { Battery battery = collectBattery(); int[] perCorePct = readPerCorePercent(); - int[] perCoreClk = getPerCoreClockMhz(); long[] swap = getSwapBytes(); long[] net = readNetRateBps(); @@ -848,26 +835,65 @@ public class HudMetrics { Battery android = collectBattery(); MangoReadings.Battery bat = m.battery(); Battery battery = bat == null ? android : new Battery(bat.getWatts(), bat.getCharging(), - bat.getPercent() != null ? bat.getPercent() : android.percent, android.tempC, android.runtimeText); + bat.getPercent() != null ? bat.getPercent() : android.percent, android.tempC, bat.getRuntimeText()); long[] net = readNetRateBps(); - return new Snapshot(cpu != null ? cpu.getPercent() : null, m.gpuPercent(), getCpuClockMhz(), m.gpuClockMhz(), + int[] perCoreClk = getPerCoreClockMhz(); + return new Snapshot(cpu != null ? cpu.getPercent() : null, m.gpuPercent(), fastestCoreMhz(perCoreClk), m.gpuClockMhz(), m.cpuTempC(), m.gpuTempC(), used, total, total > 0 ? used * 100f / total : 0f, m.vramBytes(), battery, - cpu != null ? cpu.getPerCore() : new int[0], getPerCoreClockMhz(), + cpu != null ? cpu.getPerCore() : new int[0], perCoreClk, mem != null && mem.getSwapTotalBytes() > 0 ? mem.getSwapUsedBytes() : null, mem != null && mem.getSwapTotalBytes() > 0 ? mem.getSwapTotalBytes() : null, net == null ? null : net[0], net == null ? null : net[1]); } - public int[] getPerCoreClockMhz() { + private final java.util.Map lastTimeInState = new java.util.HashMap<>(); + + public synchronized int[] getPerCoreClockMhz() { int cores = Runtime.getRuntime().availableProcessors(); int[] out = new int[Math.max(0, cores)]; for (int i = 0; i < out.length; i++) { - Long cur = readLongFromLine("/sys/devices/system/cpu/cpu" + i + "/cpufreq/scaling_cur_freq"); - out[i] = (cur != null && cur > 0) ? (int) (cur / 1000L) : 0; + long[][] table = readTimeInState("/sys/devices/system/cpu/cpu" + i + "/cpufreq/stats/time_in_state"); + long khz = table == null ? -1L : averageKhz(lastTimeInState.put(i, table), table); + if (khz <= 0L) { + Long cur = readLongFromLine("/sys/devices/system/cpu/cpu" + i + "/cpufreq/scaling_cur_freq"); + khz = cur != null ? cur : 0L; + } + out[i] = khz > 0L ? (int) (khz / 1000L) : 0; } return out; } + static long averageKhz(long[][] before, long[][] after) { + if (before == null || after == null || !java.util.Arrays.equals(before[0], after[0])) return -1L; + long weighted = 0L, time = 0L; + for (int i = 0; i < after[0].length; i++) { + long dt = after[1][i] - before[1][i]; + if (dt <= 0L) continue; + weighted += after[0][i] * dt; + time += dt; + } + return time > 0L ? weighted / time : -1L; + } + + private static long[][] readTimeInState(String path) { + List rows = new ArrayList<>(); + try (BufferedReader r = new BufferedReader(new FileReader(path))) { + String line; + while ((line = r.readLine()) != null) { + String[] parts = line.trim().split("\\s+"); + if (parts.length < 2) continue; + try { rows.add(new long[] { Long.parseLong(parts[0]), Long.parseLong(parts[1]) }); } + catch (NumberFormatException ignored) {} + } + } catch (Exception e) { + return null; + } + if (rows.isEmpty()) return null; + long[][] table = new long[2][rows.size()]; + for (int i = 0; i < rows.size(); i++) { table[0][i] = rows.get(i)[0]; table[1][i] = rows.get(i)[1]; } + return table; + } + private long[] lastCoreTotal = null; private long[] lastCoreIdle = null; private static final int PER_CORE_STAT = 1, PER_CORE_ESTIMATE = 2; diff --git a/app/src/main/java/com/droiddeck/launcher/hud/MangoReadings.kt b/app/src/main/java/com/droiddeck/launcher/hud/MangoReadings.kt index d9fbaa4dfc..900fa12fd2 100644 --- a/app/src/main/java/com/droiddeck/launcher/hud/MangoReadings.kt +++ b/app/src/main/java/com/droiddeck/launcher/hud/MangoReadings.kt @@ -2,13 +2,18 @@ package com.droiddeck.launcher.hud import android.os.Environment import com.droiddeck.launcher.runtime.LinuxRuntime +import com.droiddeck.launcher.session.BatteryRuntimeEstimator import java.io.File +import kotlin.math.abs import kotlin.math.roundToInt internal class MangoReadings(private val sessionDir: File, private val rootDir: File) { class Cpu(val percent: Int, val perCore: IntArray) class Memory(val usedBytes: Long, val totalBytes: Long, val swapUsedBytes: Long, val swapTotalBytes: Long) - class Battery(val percent: Int?, val watts: Float, val charging: Boolean) + class Battery(val percent: Int?, val watts: Float, val charging: Boolean, val runtimeText: String?) + + private val batteryRuntimeEstimator = BatteryRuntimeEstimator() + private var lastBatteryDischarging: Boolean? = null private val cpuTimes = HashMap() private val cpuPercents = HashMap() @@ -106,32 +111,113 @@ internal class MangoReadings(private val sessionDir: File, private val rootDir: fun vramBytes(): Long? = fresh(File(rootDir, VRAM_FILE), VRAM_FRESH_MS)?.let(::readLong)?.takeIf { it > 0 } fun battery(): Battery? { - val dirs = File(sessionDir, "sys/power_supply").listFiles { f -> f.name.contains("BAT") }?.sortedBy { it.name } + val dirs = File(sessionDir, "sys/power_supply").listFiles { f -> f.name.contains("BAT") }?.sortedBy { it.name }?.take(2) if (dirs.isNullOrEmpty()) return null - var chargeNow = 0f - var chargeFull = 0f - var watts = 0f - var charging = false + + var weightedChargeNow = 0.0 + var weightedChargeFull = 0.0 + var allHaveWeightedCharge = true + val perBatteryPercents = ArrayList() + var runtimeChargeUah = 0.0 + var runtimeChargeComplete = true + var aggregateCurrentUa = 0.0 + var currentComplete = true + var watts = 0.0 + var anyDischarging = false + var anyChargingStatus = false + var allFull = true + var suppliedRuntimeSeconds: Long? = null + for (dir in dirs) { val status = runCatching { File(dir, "status").readLines().firstOrNull() }.getOrNull() - if (status == "Charging" || status == "Unknown" || status == "Full") charging = true - val now = File(dir, "charge_now").takeIf { it.exists() } ?: File(dir, "energy_now") - val full = File(dir, "charge_full").takeIf { it.exists() } ?: File(dir, "energy_full") - if (now.exists()) { - chargeNow += (readFloat(now) ?: 0f) / 1_000_000f - chargeFull += (readFloat(full) ?: 0f) / 1_000_000f - } else { - chargeNow += (readFloat(File(dir, "capacity")) ?: 0f) / 100f - chargeFull = dirs.size.toFloat() + val isDischarging = status == "Discharging" || status == "Not charging" + if (isDischarging) anyDischarging = true + if (status == "Charging" || status == "Unknown") anyChargingStatus = true + if (status != "Full") allFull = false + + val chargeNowFile = File(dir, "charge_now") + val chargeFullFile = File(dir, "charge_full") + val energyNowFile = File(dir, "energy_now") + val energyFullFile = File(dir, "energy_full") + val voltageFile = File(dir, "voltage_now") + val chargeNow = if (chargeNowFile.isFile) readFloat(chargeNowFile)?.toDouble() else null + val chargeFull = if (chargeFullFile.isFile) readFloat(chargeFullFile)?.toDouble() else null + val energyNow = if (energyNowFile.isFile) readFloat(energyNowFile)?.toDouble() else null + val energyFull = if (energyFullFile.isFile) readFloat(energyFullFile)?.toDouble() else null + val voltageUv = if (voltageFile.isFile) readFloat(voltageFile)?.toDouble() else null + + val nowForPercent: Double? = when { + chargeNow != null && chargeNow >= 0.0 -> chargeNow + energyNow != null && voltageUv != null -> BatteryRuntimeEstimator.chargeMicroampHoursFromEnergy(energyNow, voltageUv) + else -> null } - if (!charging) { - val power = File(dir, "power_now") - watts += if (power.exists()) kotlin.math.abs(readFloat(power) ?: 0f) / 1_000_000f - else kotlin.math.abs((readFloat(File(dir, "current_now")) ?: 0f) * (readFloat(File(dir, "voltage_now")) ?: 0f)) / 1e12f + val fullForPercent: Double? = when { + chargeFull != null && chargeFull > 0.0 -> chargeFull + energyFull != null && voltageUv != null -> BatteryRuntimeEstimator.chargeMicroampHoursFromEnergy(energyFull, voltageUv) + else -> null + } + if (nowForPercent != null && fullForPercent != null && fullForPercent > 0.0) { + weightedChargeNow += nowForPercent + weightedChargeFull += fullForPercent + perBatteryPercents += (nowForPercent * 100.0 / fullForPercent).roundToInt().coerceIn(0, 100) + } else { + allHaveWeightedCharge = false + readFloat(File(dir, "capacity"))?.roundToInt()?.coerceIn(0, 100)?.let { perBatteryPercents += it } + } + + when { + chargeNow != null && chargeNow >= 0.0 -> runtimeChargeUah += chargeNow + energyNow != null && voltageUv != null -> + BatteryRuntimeEstimator.chargeMicroampHoursFromEnergy(energyNow, voltageUv)?.let { runtimeChargeUah += it } + ?: run { runtimeChargeComplete = false } + else -> runtimeChargeComplete = false + } + + if (dirs.size == 1) { + suppliedRuntimeSeconds = readLong(File(dir, "time_to_empty_avg"))?.takeIf { it > 0L } + ?: readLong(File(dir, "time_to_empty_now"))?.takeIf { it > 0L } + ?: suppliedRuntimeSeconds + } + + val currentFile = File(dir, "current_now") + val powerFile = File(dir, "power_now") + val currentNow = if (currentFile.isFile) readFloat(currentFile)?.toDouble() else null + val currentForEta = when { + currentNow != null -> abs(currentNow) + powerFile.isFile && voltageUv != null -> readFloat(powerFile)?.toDouble()?.let { + BatteryRuntimeEstimator.currentMicroampsFromPower(it, voltageUv) + } + else -> null + } + if (currentForEta == null) currentComplete = false else aggregateCurrentUa += currentForEta + + if (isDischarging) { + val power = if (powerFile.isFile) readFloat(powerFile)?.toDouble() else null + if (power != null) watts += abs(power) / 1_000_000.0 + else if (currentNow != null && voltageUv != null) watts += abs(currentNow * voltageUv) / 1_000_000_000_000.0 } } - val percent = if (chargeFull > 0f) Math.round(chargeNow / chargeFull * 100f) else null - return Battery(percent, if (charging) 0f else watts, charging) + + val percent = when { + allHaveWeightedCharge && weightedChargeFull > 0.0 -> (weightedChargeNow * 100.0 / weightedChargeFull).roundToInt().coerceIn(0, 100) + perBatteryPercents.isNotEmpty() -> perBatteryPercents.average().roundToInt().coerceIn(0, 100) + else -> null + } + if (lastBatteryDischarging != null && lastBatteryDischarging != anyDischarging) { + batteryRuntimeEstimator.reset() + } + lastBatteryDischarging = anyDischarging + val estimatedHours = if (anyDischarging && runtimeChargeComplete && currentComplete) + batteryRuntimeEstimator.estimateHours(runtimeChargeUah, aggregateCurrentUa) else null + val runtimeHours = suppliedRuntimeSeconds?.let { it / 3600.0 } ?: estimatedHours + val charging = !anyDischarging && anyChargingStatus + val runtimeText = when { + anyDischarging -> BatteryRuntimeEstimator.formatDuration(runtimeHours) + charging -> "Charging" + allFull -> "Full" + else -> null + } + return Battery(percent, if (anyDischarging) watts.toFloat() else 0f, charging, runtimeText) } private fun fresh(file: File, maxAgeMs: Long = FEED_FRESH_MS): File? = diff --git a/app/src/main/java/com/droiddeck/launcher/input/PadBridge.java b/app/src/main/java/com/droiddeck/launcher/input/PadBridge.java index c7dd27a271..c75602585c 100644 --- a/app/src/main/java/com/droiddeck/launcher/input/PadBridge.java +++ b/app/src/main/java/com/droiddeck/launcher/input/PadBridge.java @@ -56,6 +56,7 @@ public final class PadBridge { private final FakeInputWriter[] playerWriters = new FakeInputWriter[SLOTS]; private final PadState[] playerStates = new PadState[SLOTS]; private final float[][] rawSticks = new float[SLOTS][4]; + private final boolean[][] keyTriggers = new boolean[SLOTS][2]; private final int[] retainedSticks = new int[SLOTS]; private final PadState effectiveState = new PadState(); private final PadState homeGuideReport = new PadState(); @@ -289,7 +290,10 @@ public final class PadBridge { } public static boolean isControllerKeyEvent(KeyEvent event) { - InputDevice device = event.getDevice(); + return isControllerKeyEvent(event, event.getDevice()); + } + + static boolean isControllerKeyEvent(KeyEvent event, InputDevice device) { if (device == null || device.isVirtual() || isSystemVirtualInputName(device.getName())) return false; if (KeyEvent.isGamepadButton(event.getKeyCode())) { return device.supportsSource(InputDevice.SOURCE_GAMEPAD) @@ -314,7 +318,10 @@ public final class PadBridge { } public static boolean isControllerMotionEvent(MotionEvent event) { - InputDevice device = event.getDevice(); + return isControllerMotionEvent(event, event.getDevice()); + } + + static boolean isControllerMotionEvent(MotionEvent event, InputDevice device) { return event.isFromSource(InputDevice.SOURCE_JOYSTICK) && device != null && !device.isVirtual() && !isSystemVirtualInputName(device.getName()) && (device.supportsSource(InputDevice.SOURCE_GAMEPAD) @@ -375,10 +382,11 @@ public final class PadBridge { } public synchronized boolean onKeyEvent(KeyEvent event) { - if (!isControllerKeyEvent(event) || excluded.test(event.getDeviceId())) return false; - int slot = slotFor(event.getDevice()); + InputDevice device = event.getDevice(); + if (!isControllerKeyEvent(event, device) || excluded.test(event.getDeviceId())) return false; + int slot = slotFor(device); if (slot < 0) return false; - int side = JoyCon.side(event.getDevice()); + int side = JoyCon.side(device); if (side >= 0 && partners[slot] != NO_CONTROLLER && JoyCon.isRail(side, event.getScanCode())) return true; long timing = InputTiming.begin(); PadState pad = stateFor(slot); @@ -400,18 +408,18 @@ public final class PadBridge { case KeyEvent.KEYCODE_HOME: case KeyEvent.KEYCODE_MOVE_HOME: pad.press(PadState.GUIDE, pressed); break; case KeyEvent.KEYCODE_BUTTON_Z: - if (isPrimary(event)) DeckControls.INSTANCE.setGrip(isNovaController(event.getDevice()) ? DeckControls.R4 : DeckControls.L4, pressed); + if (isPrimary(event)) DeckControls.INSTANCE.setGrip(isNovaController(device) ? DeckControls.R4 : DeckControls.L4, pressed); break; case KeyEvent.KEYCODE_BUTTON_C: - if (isPrimary(event)) DeckControls.INSTANCE.setGrip(isNovaController(event.getDevice()) ? DeckControls.L4 : DeckControls.R4, pressed); + if (isPrimary(event)) DeckControls.INSTANCE.setGrip(isNovaController(device) ? DeckControls.L4 : DeckControls.R4, pressed); break; case KeyEvent.KEYCODE_BUTTON_L2: pad.leftTrigger = keyTrigger(pad.leftTrigger, pressed, event.getRepeatCount(), - analogTrigger(event.getDevice(), MotionEvent.AXIS_LTRIGGER, MotionEvent.AXIS_BRAKE)); + analogTrigger(device, MotionEvent.AXIS_LTRIGGER, MotionEvent.AXIS_BRAKE), keyTriggers[slot], 0); break; case KeyEvent.KEYCODE_BUTTON_R2: pad.rightTrigger = keyTrigger(pad.rightTrigger, pressed, event.getRepeatCount(), - analogTrigger(event.getDevice(), MotionEvent.AXIS_RTRIGGER, MotionEvent.AXIS_GAS)); + analogTrigger(device, MotionEvent.AXIS_RTRIGGER, MotionEvent.AXIS_GAS), keyTriggers[slot], 1); break; case KeyEvent.KEYCODE_DPAD_UP: pad.up = pressed; break; case KeyEvent.KEYCODE_DPAD_RIGHT: pad.right = pressed; break; @@ -419,7 +427,7 @@ public final class PadBridge { case KeyEvent.KEYCODE_DPAD_LEFT: pad.left = pressed; break; default: return false; } - noteDevice(event.getDevice(), slot); + noteDevice(device, slot); if (pressed && event.getRepeatCount() == 0 && !event.isCanceled()) noteChordInput(slot); if (pressed) notePlayerInput(); statButtons++; @@ -471,6 +479,7 @@ public final class PadBridge { stateFor(slot).clear(); retainedSticks[slot] = 0; Arrays.fill(rawSticks[slot], 0f); + Arrays.fill(keyTriggers[slot], false); } private void mutateState(java.util.function.Consumer mutation) { @@ -489,16 +498,16 @@ public final class PadBridge { } public synchronized boolean onMotionEvent(MotionEvent event) { - if (!isControllerMotionEvent(event) || excluded.test(event.getDeviceId())) return false; + InputDevice device = event.getDevice(); + if (!isControllerMotionEvent(event, device) || excluded.test(event.getDeviceId())) return false; if (event.getAction() != MotionEvent.ACTION_MOVE) return false; - int slot = slotFor(event.getDevice()); + int slot = slotFor(device); if (slot < 0) return false; long timing = InputTiming.begin(); PadState pad = stateFor(slot); - noteDevice(event.getDevice(), slot); + noteDevice(device, slot); statAxes++; scheduleStats(); - InputDevice device = event.getDevice(); int side = JoyCon.side(device); if (side >= 0) { int[] stick = JoyCon.stickAxes(side, device, event.getSource()); @@ -515,7 +524,7 @@ public final class PadBridge { } float lx = event.getAxisValue(MotionEvent.AXIS_X); float ly = event.getAxisValue(MotionEvent.AXIS_Y); - boolean wired = wiredXboxLayout(event); + boolean wired = wiredXboxLayout(device, event.getSource()); float rx = event.getAxisValue(wired ? MotionEvent.AXIS_RX : MotionEvent.AXIS_Z); float ry = event.getAxisValue(wired ? MotionEvent.AXIS_RY : MotionEvent.AXIS_RZ); retainStick(slot, JoyCon.LEFT, lx, ly); @@ -525,11 +534,11 @@ public final class PadBridge { float lt = 0f; float rt = 0f; if (wired || hasAxis(device, source, MotionEvent.AXIS_LTRIGGER, MotionEvent.AXIS_BRAKE)) { - lt = leftTrigger(event, wired); + lt = axisTrigger(leftTrigger(event, wired), keyTriggers[slot], 0); pad.leftTrigger = lt; } if (wired || hasAxis(device, source, MotionEvent.AXIS_RTRIGGER, MotionEvent.AXIS_GAS)) { - rt = rightTrigger(event, wired); + rt = axisTrigger(rightTrigger(event, wired), keyTriggers[slot], 1); pad.rightTrigger = rt; } if (hasAxis(device, source, MotionEvent.AXIS_HAT_X)) { @@ -553,9 +562,27 @@ public final class PadBridge { return true; } - static float keyTrigger(float current, boolean pressed, int repeatCount, boolean analog) { - if (analog || repeatCount > 0) return current; - return pressed ? 1f : 0f; + static float keyTrigger(float current, boolean pressed, int repeatCount, boolean analog, boolean[] held, int side) { + if (repeatCount > 0) return current; + if (!analog) { + held[side] = pressed; + return pressed ? 1f : 0f; + } + if (pressed) { + if (current != 0f) return current; + held[side] = true; + return 1f; + } + if (!held[side]) return current; + held[side] = false; + return 0f; + } + + static float axisTrigger(float value, boolean[] held, int side) { + if (!held[side]) return value; + if (value == 0f) return 1f; + held[side] = false; + return value; } static boolean analogTrigger(InputDevice device, int... axes) { @@ -987,7 +1014,7 @@ public final class PadBridge { } private boolean isPrimary(KeyEvent event) { - int id = event.getDevice().getId(); + int id = event.getDeviceId(); int first = firstPlayerSlot(); return owners[first] == id || partners[first] == id; } diff --git a/app/src/main/java/com/droiddeck/launcher/input/SteamTouchConfig.kt b/app/src/main/java/com/droiddeck/launcher/input/SteamTouchConfig.kt index 1387dce25d..dc9465222e 100644 --- a/app/src/main/java/com/droiddeck/launcher/input/SteamTouchConfig.kt +++ b/app/src/main/java/com/droiddeck/launcher/input/SteamTouchConfig.kt @@ -390,7 +390,8 @@ object SteamTouchConfig { options: Options? = null, ): File? { val dir = configDir(context) ?: return null - val source = bindings.entries.fold(config.text ?: return null) { text, (ref, change) -> + val base = config.text ?: if (config.file == null && bindings.isEmpty()) "\"controller_mappings\"\n{\n\t\"controller_type\"\t\t\"controller_mobile_touch\"\n}\n" else return null + val source = bindings.entries.fold(base) { text, (ref, change) -> SteamTouchBindings.rewrite(text, ref, change) ?: text } val key = steamKey(context, appId) diff --git a/app/src/main/java/com/droiddeck/launcher/lab/LabNotice.kt b/app/src/main/java/com/droiddeck/launcher/lab/LabNotice.kt new file mode 100644 index 0000000000..85e1bab990 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/lab/LabNotice.kt @@ -0,0 +1,60 @@ +package com.droiddeck.launcher.lab + +import android.app.Notification +import android.app.NotificationChannel +import android.app.NotificationManager +import android.app.PendingIntent +import android.content.Context +import android.content.Intent +import com.droiddeck.launcher.FrontEndActivity +import com.droiddeck.launcher.R +import com.droiddeck.launcher.stores.download.StoreDownloadService + +/** + * Says what happened to a Lab build when the app starts, so a restart onto a new build does not + * look like a crash, and a build Android or the safety checks turned off is not lost silently. + */ +object LabNotice { + private const val CHANNEL_ID = "lab" + private const val NOTIFICATION_ID = 4120 + + /** Where a start that just moved a Lab build into use opens; the agent that built it sets it. */ + @Volatile var openOnInstall: String = "updates" + + fun started(context: Context) { + val app = context.applicationContext + val active = LabOverlay.active + val skipped = LabOverlay.skipped + val current = LabOverlay.current(app) + when { + LabOverlay.promoted && active != null -> + post(app, app.getString(R.string.lab_installed_title), app.getString(R.string.lab_installed_text, active.label), openOnInstall) + skipped == LabOverlay.SKIPPED_APP_IMAGE && current != null -> + post(app, app.getString(R.string.lab_paused_title), app.getString(R.string.lab_paused_text, current.label), "updates") + skipped == LabOverlay.Reason.OTHER_INSTALL.name || skipped == LabOverlay.Reason.DID_NOT_START.name -> { + val reason = if (skipped == LabOverlay.Reason.OTHER_INSTALL.name) R.string.lab_off_other_install else R.string.lab_off_did_not_start + post(app, app.getString(R.string.lab_off_title), app.getString(reason), "updates") + } + } + } + + private fun post(app: Context, title: String, text: String, nav: String) { + val manager = app.getSystemService(NotificationManager::class.java) ?: return + manager.createNotificationChannel(NotificationChannel(CHANNEL_ID, app.getString(R.string.upd_lab), NotificationManager.IMPORTANCE_DEFAULT)) + val open = PendingIntent.getActivity( + app, NOTIFICATION_ID, + Intent(app, FrontEndActivity::class.java).putExtra(StoreDownloadService.EXTRA_NAV, nav) + .addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP or Intent.FLAG_ACTIVITY_REORDER_TO_FRONT), + PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT, + ) + val notification = Notification.Builder(app, CHANNEL_ID) + .setSmallIcon(R.drawable.ic_stat_session) + .setContentTitle(title) + .setContentText(text) + .setStyle(Notification.BigTextStyle().bigText(text)) + .setContentIntent(open) + .setAutoCancel(true) + .build() + runCatching { manager.notify(NOTIFICATION_ID, notification) } + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/lab/LabOverlay.kt b/app/src/main/java/com/droiddeck/launcher/lab/LabOverlay.kt new file mode 100644 index 0000000000..7fb7f7a26d --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/lab/LabOverlay.kt @@ -0,0 +1,276 @@ +package com.droiddeck.launcher.lab + +import android.app.Activity +import android.app.Application +import android.content.Context +import android.content.Intent +import android.content.res.Resources +import android.content.res.loader.ResourcesLoader +import android.content.res.loader.ResourcesProvider +import android.os.Build +import android.os.Bundle +import android.os.Handler +import android.os.Looper +import android.os.ParcelFileDescriptor +import android.util.Log +import androidx.annotation.RequiresApi +import androidx.annotation.VisibleForTesting +import com.droiddeck.launcher.BuildConfig +import org.json.JSONObject +import java.io.File + +/** + * A Lab build: app code and resources an on-device agent built from this install's own commit, + * loaded over the installed APK at startup so it can be tried without reinstalling or re-signing. + * + * `files/lab/next` holds a build waiting for the next start and `files/lab/active` the one in use, + * each with `overlay.apk` (the build's dex files and linked resources) and `overlay.json`. A build + * that is replaced, turned off or refused moves to `files/lab/builds`, so it can be used again. + */ +object LabOverlay { + data class Info(val label: String, val baseCommit: String, val baseApk: String, val built: Long = 0) + + enum class Reason { REPLACED, TURNED_OFF, OTHER_INSTALL, DID_NOT_START, UNREADABLE } + + /** A build kept in `files/lab/builds`; [usable] when it was made for this install. */ + data class Saved(val dir: File, val info: Info?, val reason: Reason?, val usable: Boolean) + + private const val TAG = "LabOverlay" + private const val MAX_FAILED_STARTS = 2 + private const val STABLE_AFTER_MS = 10_000L + private const val KEEP_BUILDS = 12 + const val SKIPPED_APP_IMAGE = "app image present" + + /** The installed APK's commit; this class always comes from the APK, never from a Lab build. */ + val apkCommit: String = BuildConfig.SOURCE_COMMIT + + @Volatile var active: Info? = null + private set + @Volatile var skipped: String? = null + private set + /** This start moved a newly staged build into use. */ + @Volatile var promoted = false + private set + + private var loader: Any? = null + + @VisibleForTesting + internal var injectDex: (ClassLoader, File) -> Unit = ::prependDex + @VisibleForTesting + internal var openResources: (File) -> Any? = { if (Build.VERSION.SDK_INT >= 30) createLoader(it) else null } + @VisibleForTesting + internal var appImage: (Context) -> Boolean = ::hasAppImage + + fun root(context: Context) = File(context.filesDir, "lab") + + /** Called from [Application.attachBaseContext], before any class the build may change is loaded. */ + fun load(app: Application, mainProcess: Boolean) { + active = null + skipped = null + promoted = false + try { + val root = root(app) + if (mainProcess) promoted = promote(root) + val dir = File(root, "active") + val apk = File(dir, "overlay.apk") + val meta = File(dir, "overlay.json") + if (!apk.isFile || !meta.isFile) return + val info = parse(meta.readText()) ?: return refuse(root, mainProcess, Reason.UNREADABLE) + if (!madeFor(app, info)) return refuse(root, mainProcess, Reason.OTHER_INSTALL) + if (Build.VERSION.SDK_INT < 30) return skip("needs Android 11") + // Classes in an app image are loaded before attachBaseContext and would ignore the overlay; + // dd-lab-build recompiles the app without one (cmd package compile -m verify). + if (appImage(app)) return skip(SKIPPED_APP_IMAGE) + if (mainProcess) { + val starts = failedStarts(root) + 1 + if (starts > MAX_FAILED_STARTS) return refuse(root, true, Reason.DID_NOT_START) + File(root, "starts").writeText(starts.toString()) + } + apk.setReadOnly() + loader = openResources(apk) + injectDex(app.classLoader, apk) + active = info + addLoader(app.resources) + app.registerActivityLifecycleCallbacks(Callbacks(root, mainProcess)) + } catch (e: Throwable) { + Log.w(TAG, "Lab build not loaded", e) + skipped = e.message ?: e.javaClass.simpleName + } + } + + /** The APK's path changes with every install and update of the app, so it pins a build to one install. */ + fun madeFor(context: Context, info: Info) = info.baseCommit == apkCommit && info.baseApk == context.applicationInfo.sourceDir + + /** The build in `active`, whether or not this start loaded it. */ + fun current(context: Context): Info? = read(File(root(context), "active")) + + /** A build staged for the next start. */ + fun pending(context: Context): Info? = read(File(root(context), "next")) + + /** Kept builds, newest first. */ + fun saved(context: Context): List = File(root(context), "builds").listFiles().orEmpty() + .filter { File(it, "overlay.apk").isFile } + .sortedByDescending { it.name.toLongOrNull() ?: 0L } + .map { dir -> + val info = read(dir) + val reason = File(dir, "reason").takeIf { it.isFile }?.readText()?.trim()?.let { r -> Reason.entries.firstOrNull { it.name == r } } + Saved(dir, info, reason, info != null && madeFor(context, info)) + } + + /** Leaves the Lab build and restarts the app on the installed APK. */ + fun turnOff(context: Context) { + val root = root(context) + archive(root, File(root, "active"), Reason.TURNED_OFF) + archive(root, File(root, "next"), Reason.TURNED_OFF) + File(root, "next").deleteRecursively() + File(root, "starts").delete() + restart(context) + } + + /** Stages [build] for the next start and keeps a build that was waiting; the caller restarts the app. */ + fun stage(context: Context, build: Saved) { + val root = root(context) + val next = File(root, "next") + val waiting = File(root, "next.replaced").apply { deleteRecursively() } + next.renameTo(waiting) + next.deleteRecursively() + File(build.dir, "reason").delete() + if (!build.dir.renameTo(next)) { + waiting.renameTo(next) + error("could not stage ${build.dir.name}") + } + archive(root, waiting, Reason.REPLACED) + waiting.deleteRecursively() + } + + fun delete(build: Saved) { + build.dir.deleteRecursively() + } + + /** + * Android's background optimization can give the APK an app image again, which keeps a Lab + * build from loading. Recompiling without one needs a shell, which the caller provides. + */ + fun needsRecompile(context: Context) = appImage(context) + + fun recompileCommand(context: Context) = "cmd package compile -m verify -f ${context.packageName}" + + fun restart(context: Context) { + val launch = context.packageManager.getLaunchIntentForPackage(context.packageName) + ?.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK) + if (launch != null) context.startActivity(launch) + Runtime.getRuntime().exit(0) + } + + @VisibleForTesting + internal fun parse(json: String): Info? = runCatching { + val o = JSONObject(json) + Info(o.getString("label"), o.getString("baseCommit"), o.getString("baseApk"), o.optLong("built")) + }.getOrNull() + + private fun read(dir: File): Info? = File(dir, "overlay.json").takeIf { it.isFile && File(dir, "overlay.apk").isFile }?.let { parse(it.readText()) } + + /** Moves `next` into use and keeps the build it replaces. Returns whether there was one to move. */ + @VisibleForTesting + internal fun promote(root: File): Boolean { + val next = File(root, "next") + if (!File(next, "overlay.apk").isFile || !File(next, "overlay.json").isFile) return false + val active = File(root, "active") + archive(root, active, Reason.REPLACED) + active.deleteRecursively() + if (!next.renameTo(active)) return false + File(root, "starts").delete() + return true + } + + @VisibleForTesting + internal fun archive(root: File, dir: File, reason: Reason) { + if (!File(dir, "overlay.apk").isFile) return + val builds = File(root, "builds").apply { mkdirs() } + var stamp = System.currentTimeMillis() + while (File(builds, stamp.toString()).exists()) stamp++ + val target = File(builds, stamp.toString()) + if (!dir.renameTo(target)) return + File(target, "reason").writeText(reason.name) + builds.listFiles().orEmpty().sortedByDescending { it.name.toLongOrNull() ?: 0L }.drop(KEEP_BUILDS).forEach { it.deleteRecursively() } + } + + @VisibleForTesting + internal fun failedStarts(root: File) = File(root, "starts").takeIf { it.isFile }?.readText()?.trim()?.toIntOrNull() ?: 0 + + private fun refuse(root: File, mainProcess: Boolean, reason: Reason) { + skipped = reason.name + Log.w(TAG, "Lab build turned off: $reason") + if (!mainProcess) return + archive(root, File(root, "active"), reason) + File(root, "starts").delete() + File(root, "last-off-reason").writeText(reason.name) + } + + private fun skip(reason: String) { + skipped = reason + Log.w(TAG, "Lab build not loaded: $reason") + } + + private fun hasAppImage(context: Context): Boolean { + val apk = File(context.applicationInfo.sourceDir) + val oat = File(apk.parentFile, "oat") + return oat.listFiles().orEmpty().any { File(it, "${apk.nameWithoutExtension}.art").isFile } + } + + @RequiresApi(30) + private fun createLoader(apk: File): ResourcesLoader = + ParcelFileDescriptor.open(apk, ParcelFileDescriptor.MODE_READ_ONLY).use { fd -> + ResourcesLoader().apply { addProvider(ResourcesProvider.loadFromApk(fd)) } + } + + /** Gives [resources] the Lab build's resources; contexts made from them inherit it. */ + fun addLoader(resources: Resources) { + if (Build.VERSION.SDK_INT < 30) return + val current = loader as? ResourcesLoader ?: return + resources.addLoaders(current) + } + + private fun prependDex(classLoader: ClassLoader, apk: File) { + val pathList = field(Class.forName("dalvik.system.BaseDexClassLoader"), "pathList").get(classLoader)!! + val elementsField = field(pathList.javaClass, "dexElements") + @Suppress("UNCHECKED_CAST") val installed = elementsField.get(pathList) as Array + val errors = ArrayList() + val made = try { + pathList.javaClass.getDeclaredMethod("makeDexElements", List::class.java, File::class.java, List::class.java, ClassLoader::class.java) + .apply { isAccessible = true }.invoke(null, listOf(apk), null, errors, classLoader) + } catch (_: NoSuchMethodException) { + pathList.javaClass.getDeclaredMethod( + "makeDexElements", List::class.java, File::class.java, List::class.java, ClassLoader::class.java, Boolean::class.javaPrimitiveType, + ).apply { isAccessible = true }.invoke(null, listOf(apk), null, errors, classLoader, false) + } + errors.firstOrNull()?.let { throw it } + @Suppress("UNCHECKED_CAST") val added = made as Array + if (added.isEmpty()) error("no dex in ${apk.name}") + val merged = java.lang.reflect.Array.newInstance(installed.javaClass.componentType!!, added.size + installed.size) + System.arraycopy(added, 0, merged, 0, added.size) + System.arraycopy(installed, 0, merged, added.size, installed.size) + elementsField.set(pathList, merged) + } + + private fun field(type: Class<*>, name: String) = type.getDeclaredField(name).apply { isAccessible = true } + + private class Callbacks(private val root: File, private val mainProcess: Boolean) : Application.ActivityLifecycleCallbacks { + private var settled = false + + override fun onActivityPreCreated(activity: Activity, savedInstanceState: Bundle?) = addLoader(activity.resources) + + override fun onActivityResumed(activity: Activity) { + if (settled || !mainProcess) return + settled = true + Handler(Looper.getMainLooper()).postDelayed({ File(root, "starts").delete() }, STABLE_AFTER_MS) + } + + override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) = Unit + override fun onActivityStarted(activity: Activity) = Unit + override fun onActivityPaused(activity: Activity) = Unit + override fun onActivityStopped(activity: Activity) = Unit + override fun onActivitySaveInstanceState(activity: Activity, outState: Bundle) = Unit + override fun onActivityDestroyed(activity: Activity) = Unit + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/playback/SoundtrackController.kt b/app/src/main/java/com/droiddeck/launcher/playback/SoundtrackController.kt new file mode 100644 index 0000000000..7242fd6615 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/playback/SoundtrackController.kt @@ -0,0 +1,288 @@ +package com.droiddeck.launcher.playback + +import android.content.ComponentName +import android.content.Context +import android.os.Bundle +import android.net.Uri +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableLongStateOf +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.setValue +import androidx.core.content.ContextCompat +import androidx.media3.common.MediaItem +import androidx.media3.common.MediaMetadata +import androidx.media3.common.PlaybackParameters +import androidx.media3.common.Player +import androidx.media3.session.MediaController +import androidx.media3.session.SessionToken +import com.droiddeck.launcher.frontend.Soundtrack +import com.google.common.util.concurrent.ListenableFuture +import java.io.File + +object SoundtrackController { + var playing by mutableStateOf(false) + private set + var currentId by mutableStateOf(null) + private set + var title by mutableStateOf("") + private set + var shuffle by mutableStateOf(false) + private set + var repeat by mutableStateOf(Player.REPEAT_MODE_OFF) + private set + var durationMs by mutableStateOf(0L) + private set + var buffering by mutableStateOf(false) + private set + var volume by mutableStateOf(1f) + private set + + var activeCollection by mutableStateOf(null) + private set + + var sleepEndsAt by mutableLongStateOf(0L) + private set + var sleepTrackEnd by mutableStateOf(false) + private set + + private var app: Context? = null + private val removed: MutableSet = java.util.Collections.synchronizedSet(HashSet()) + private var activeRoot: String? = null + private var savedId: String? = null + private var future: ListenableFuture? = null + private var controller: MediaController? = null + private val pending = ArrayList<(MediaController) -> Unit>() + + private val listener = object : Player.Listener { + override fun onEvents(player: Player, events: Player.Events) = sync(player) + } + + private val disconnect = object : MediaController.Listener { + override fun onDisconnected(controller: MediaController) { + if (this@SoundtrackController.controller === controller) { + this@SoundtrackController.controller = null + future = null + reset() + } + } + } + + private fun reset() { + playing = false + currentId = null + title = "" + durationMs = 0L + buffering = false + volume = 1f + activeCollection = null + } + + private fun sync(player: Player) { + playing = player.isPlaying + buffering = player.playbackState == Player.STATE_BUFFERING + currentId = player.currentMediaItem?.mediaId?.takeIf { player.mediaItemCount > 0 } + title = player.mediaMetadata.title?.toString().orEmpty() + shuffle = player.shuffleModeEnabled + repeat = player.repeatMode + durationMs = player.duration.takeIf { it > 0 } ?: 0L + volume = player.volume + if (!player.playWhenReady) sleepTrackEnd = false + persistResume(player) + } + + private fun persistResume(player: Player) { + val context = app ?: return + val id = currentId ?: return + if (activeCollection != null) return + val root = activeRoot ?: SoundtrackSettings.resume(context)?.root?.takeIf { id.startsWith("$it/") }?.also { activeRoot = it } ?: return + if (id != savedId || !player.isPlaying) { + savedId = id + SoundtrackSettings.saveResume(context, root, id, if (player.playbackState == Player.STATE_ENDED) 0L else player.currentPosition) + } + } + + private fun applySettings(c: MediaController) { + val context = app ?: return + SoundtrackSettings.load(context) + c.setPlaybackParameters(PlaybackParameters(SoundtrackSettings.speed, SoundtrackSettings.pitch)) + c.sendCustomCommand(SoundtrackService.SKIP_SILENCE, Bundle().apply { putBoolean(SoundtrackService.ARG_ON, SoundtrackSettings.skipSilence) }) + sendEqualizer(c) + c.sendCustomCommand(SoundtrackService.INGAME, Bundle().apply { putBoolean(SoundtrackService.ARG_ON, com.droiddeck.launcher.session.SessionPrefs.soundtracksIngame(context)) }) + } + + private fun sendEqualizer(c: MediaController) { + c.sendCustomCommand( + SoundtrackService.EQUALIZER, + Bundle().apply { + putBoolean(SoundtrackService.ARG_ON, SoundtrackSettings.eqOn) + putIntArray(SoundtrackService.ARG_BANDS, SoundtrackSettings.bands.toIntArray()) + putInt(SoundtrackService.ARG_BASS, SoundtrackSettings.bass) + }, + ) + } + + private fun run(context: Context, block: (MediaController) -> Unit) { + app = context.applicationContext + val live = controller + if (live != null) { block(live); return } + pending += block + if (future != null) return + val app = context.applicationContext + val token = SessionToken(app, ComponentName(app, SoundtrackService::class.java)) + val built = MediaController.Builder(app, token).setListener(disconnect) + .setConnectionHints(Bundle().apply { putBoolean(SoundtrackService.HINT_OWNER, true) }).buildAsync() + future = built + built.addListener({ + val ready = runCatching { built.get() }.getOrNull() + if (ready == null) { + future = null + pending.clear() + return@addListener + } + controller = ready + ready.addListener(listener) + applySettings(ready) + sync(ready) + val queued = pending.toList() + pending.clear() + queued.forEach { it(ready) } + }, ContextCompat.getMainExecutor(app)) + } + + fun connect(context: Context) = run(context) { } + + fun position(): Long = controller?.currentPosition ?: 0L + + fun belongsCollection(id: Int): Boolean = activeCollection == id && currentId != null + + fun belongs(root: File?): Boolean { + if (activeCollection != null) return false + val id = currentId ?: return false + return root != null && id.startsWith(root.path + "/") + } + + private fun items(album: Soundtrack.Album, albumTitle: String): List { + val cover = album.cover?.let { Uri.fromFile(it) } + return album.tracks.map { t -> + MediaItem.Builder() + .setMediaId(t.file.path) + .setMediaMetadata( + MediaMetadata.Builder() + .setTitle(t.title) + .setArtist(t.artist.ifBlank { album.artist }.ifBlank { null }) + .setAlbumTitle(albumTitle) + .setTrackNumber(t.number) + .setDiscNumber(t.disc.takeIf { it > 0 }) + .setArtworkUri(cover) + .setIsPlayable(true) + .build(), + ) + .build() + } + } + + fun play( + context: Context, album: Soundtrack.Album, albumTitle: String, startId: String?, shuffled: Boolean? = null, + root: File? = null, startMs: Long = 0L, collection: Int? = null, + ) { + val list = items(album, albumTitle) + if (list.isEmpty()) return + run(context) { c -> + if (root != null && root.path in removed) return@run + val start = list.indexOfFirst { it.mediaId == startId }.coerceAtLeast(0) + root?.let { activeRoot = it.path } + activeCollection = collection + c.setMediaItems(list, start, startMs) + shuffled?.let { c.shuffleModeEnabled = it } + c.prepare() + c.play() + } + } + + fun allow(paths: Collection) { + removed.removeAll(paths.toSet()) + } + + fun toggle(context: Context, album: Soundtrack.Album, albumTitle: String, root: File?, collection: Int? = null) { + run(context) { c -> + if (root != null && root.path in removed) return@run + val mine = if (collection != null) belongsCollection(collection) else belongs(root) + if (mine && c.mediaItemCount > 0) { + if (c.isPlaying) c.pause() else { + if (c.playbackState == Player.STATE_ENDED) c.seekToDefaultPosition(0) + c.play() + } + } else { + val saved = if (collection != null) null else root?.let { r -> SoundtrackSettings.resume(context)?.takeIf { it.root == r.path && album.tracks.any { t -> t.id == it.id } } } + play(context, album, albumTitle, saved?.id ?: album.tracks.firstOrNull()?.id, root = root, startMs = saved?.positionMs ?: 0L, collection = collection) + } + } + } + + fun pause(context: Context) { + val live = controller + if (live != null) live.pause() else if (future != null) pending += { it.pause() } + } + + fun next(context: Context) = run(context) { it.seekToNext() } + fun previous(context: Context) = run(context) { c -> if (c.currentPosition > 3000L) c.seekTo(0) else c.seekToPrevious() } + fun seekTo(context: Context, ms: Long) = run(context) { it.seekTo(ms) } + fun setShuffle(context: Context, on: Boolean) = run(context) { it.shuffleModeEnabled = on } + fun cycleRepeat(context: Context) = run(context) { + it.repeatMode = when (it.repeatMode) { + Player.REPEAT_MODE_OFF -> Player.REPEAT_MODE_ALL + Player.REPEAT_MODE_ALL -> Player.REPEAT_MODE_ONE + else -> Player.REPEAT_MODE_OFF + } + } + fun setVolume(context: Context, volume: Float) = run(context) { it.volume = volume.coerceIn(0f, 1f) } + + fun setSpeed(context: Context, value: Float) { + SoundtrackSettings.load(context) + SoundtrackSettings.setSpeed(context, value) + run(context) { it.setPlaybackParameters(PlaybackParameters(SoundtrackSettings.speed, SoundtrackSettings.pitch)) } + } + + fun setPitch(context: Context, value: Float) { + SoundtrackSettings.load(context) + SoundtrackSettings.setPitch(context, value) + run(context) { it.setPlaybackParameters(PlaybackParameters(SoundtrackSettings.speed, SoundtrackSettings.pitch)) } + } + + fun setSkipSilence(context: Context, on: Boolean) { + SoundtrackSettings.load(context) + SoundtrackSettings.setSkipSilence(context, on) + run(context) { it.sendCustomCommand(SoundtrackService.SKIP_SILENCE, Bundle().apply { putBoolean(SoundtrackService.ARG_ON, on) }) } + } + + fun setEqualizer(context: Context, on: Boolean, bands: List, bass: Int) { + SoundtrackSettings.load(context) + SoundtrackSettings.setEqualizer(context, on, bands, bass) + run(context) { sendEqualizer(it) } + } + + fun setIngame(context: Context, on: Boolean) { + run(context) { it.sendCustomCommand(SoundtrackService.INGAME, Bundle().apply { putBoolean(SoundtrackService.ARG_ON, on) }) } + } + + fun setSleep(context: Context, minutes: Int) { + sleepEndsAt = if (minutes > 0) System.currentTimeMillis() + minutes * 60_000L else 0L + sleepTrackEnd = minutes < 0 + run(context) { it.sendCustomCommand(SoundtrackService.SLEEP, Bundle().apply { putInt(SoundtrackService.ARG_MINUTES, minutes) }) } + } + + fun sleepRemainingMs(): Long { + val left = sleepEndsAt - System.currentTimeMillis() + if (sleepEndsAt > 0L && left <= 0L) sleepEndsAt = 0L + return left.coerceAtLeast(0L) + } + + fun stopIf(context: Context, root: File?) { + root?.let { removed.add(it.path) } + if (root == null || currentId?.startsWith(root.path + "/") != true) return + run(context) { c -> + c.stop() + c.clearMediaItems() + } + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/playback/SoundtrackService.kt b/app/src/main/java/com/droiddeck/launcher/playback/SoundtrackService.kt new file mode 100644 index 0000000000..083b935cd5 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/playback/SoundtrackService.kt @@ -0,0 +1,282 @@ +package com.droiddeck.launcher.playback + +import android.app.PendingIntent +import android.content.Context +import android.content.Intent +import android.media.audiofx.BassBoost +import android.media.audiofx.Equalizer +import android.net.Uri +import android.os.Bundle +import android.os.Handler +import android.os.Looper +import android.os.Process +import androidx.media3.common.AudioAttributes +import androidx.media3.common.C +import androidx.media3.common.MediaItem +import androidx.media3.common.Player +import androidx.media3.exoplayer.ExoPlayer +import androidx.media3.session.CommandButton +import androidx.media3.session.DefaultMediaNotificationProvider +import androidx.media3.session.MediaSession +import androidx.media3.session.MediaSessionService +import androidx.media3.session.SessionCommand +import androidx.media3.session.SessionResult +import com.droiddeck.launcher.R +import com.droiddeck.launcher.frontend.Soundtrack +import com.google.common.collect.ImmutableList +import com.google.common.util.concurrent.Futures +import com.google.common.util.concurrent.ListenableFuture +import java.io.File + +private class EdgeButtonsProvider(context: Context) : DefaultMediaNotificationProvider(context) { + override fun getMediaButtons( + session: MediaSession, playerCommands: Player.Commands, customLayout: ImmutableList, showPauseButton: Boolean, + ): ImmutableList { + val all = super.getMediaButtons(session, playerCommands, customLayout, showPauseButton) + val custom = all.filter { it.sessionCommand != null } + if (custom.size < 2) return all + return ImmutableList.builder() + .add(custom.first()) + .addAll(all.filter { it.sessionCommand == null }) + .addAll(custom.drop(1)) + .build() + } +} + +class SoundtrackService : MediaSessionService() { + private var session: MediaSession? = null + private var exo: ExoPlayer? = null + private var equalizer: Equalizer? = null + private var bassBoost: BassBoost? = null + private var effectsSession = C.AUDIO_SESSION_ID_UNSET + private var eqOn = false + private var eqBands = IntArray(0) + private var eqBass = 0 + private var sleepAtTrackEnd = false + private val handler = Handler(Looper.getMainLooper()) + private val sleepRunnable = Runnable { session?.player?.pause() } + private val covers = java.util.concurrent.Executors.newSingleThreadExecutor { r -> Thread(r, "soundtrack-cover").apply { isDaemon = true } } + + override fun onCreate() { + super.onCreate() + val player = ExoPlayer.Builder(this) + .setAudioAttributes(mediaAttributes(), !com.droiddeck.launcher.session.SessionPrefs.soundtracksIngame(this)) + .setHandleAudioBecomingNoisy(true) + .setWakeMode(androidx.media3.common.C.WAKE_MODE_LOCAL) + .build() + exo = player + val sessionIntent = packageManager.getLaunchIntentForPackage(packageName)?.let { + PendingIntent.getActivity(this, 0, it, PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE) + } + player.addListener(object : Player.Listener { + override fun onShuffleModeEnabledChanged(shuffleModeEnabled: Boolean) = refreshButtons() + override fun onRepeatModeChanged(repeatMode: Int) = refreshButtons() + override fun onAudioSessionIdChanged(audioSessionId: Int) = applyEffects() + override fun onPlayWhenReadyChanged(playWhenReady: Boolean, reason: Int) { + if (!playWhenReady) sleepAtTrackEnd = false + } + override fun onMediaItemTransition(mediaItem: MediaItem?, reason: Int) { + refreshTrackCover(mediaItem) + val ended = reason == Player.MEDIA_ITEM_TRANSITION_REASON_AUTO || reason == Player.MEDIA_ITEM_TRANSITION_REASON_REPEAT + if (sleepAtTrackEnd && ended) { + sleepAtTrackEnd = false + player.pause() + } + } + }) + session = MediaSession.Builder(this, player).setCallback(Resolver()).apply { sessionIntent?.let { setSessionActivity(it) } }.build() + setMediaNotificationProvider(EdgeButtonsProvider(this).apply { setSmallIcon(R.drawable.ic_soundtrack) }) + } + + private fun mediaAttributes(): AudioAttributes = + AudioAttributes.Builder().setUsage(C.USAGE_MEDIA).setContentType(C.AUDIO_CONTENT_TYPE_MUSIC).build() + + private fun buttons(player: Player): ImmutableList = ImmutableList.of( + CommandButton.Builder() + .setDisplayName(getString(R.string.soundtracks_shuffle)) + .setIconResId(if (player.shuffleModeEnabled) R.drawable.ic_shuffle_on else R.drawable.ic_shuffle_off) + .setSessionCommand(SHUFFLE) + .build(), + CommandButton.Builder() + .setDisplayName( + getString( + when (player.repeatMode) { + Player.REPEAT_MODE_ALL -> R.string.soundtracks_repeat_all + Player.REPEAT_MODE_ONE -> R.string.soundtracks_repeat_one + else -> R.string.soundtracks_repeat_off + }, + ), + ) + .setIconResId( + when (player.repeatMode) { + Player.REPEAT_MODE_ALL -> R.drawable.ic_repeat_all + Player.REPEAT_MODE_ONE -> R.drawable.ic_repeat_one + else -> R.drawable.ic_repeat_off + }, + ) + .setSessionCommand(REPEAT) + .build(), + ) + + private fun hasPinnedArt(item: MediaItem): Boolean = + item.mediaMetadata.artworkUri?.path.orEmpty().let { it.contains("/steam-art/") || it.contains("/soundtrack-art/") } + + private fun refreshTrackCover(item: MediaItem?) { + val current = item ?: return + if (hasPinnedArt(current)) return + val file = File(current.mediaId) + covers.execute { + val art = Soundtrack.trackCover(this, file) ?: return@execute + handler.post { + val player = exo ?: return@post + val live = player.currentMediaItem ?: return@post + val uri = Uri.fromFile(art) + if (live.mediaId != current.mediaId || live.mediaMetadata.artworkUri == uri || hasPinnedArt(live)) return@post + player.replaceMediaItem( + player.currentMediaItemIndex, + live.buildUpon().setMediaMetadata(live.mediaMetadata.buildUpon().setArtworkUri(uri).build()).build(), + ) + } + } + } + + private fun releaseEffects() { + runCatching { equalizer?.release() } + runCatching { bassBoost?.release() } + equalizer = null + bassBoost = null + effectsSession = C.AUDIO_SESSION_ID_UNSET + } + + private fun applyEffects() { + val id = exo?.audioSessionId ?: C.AUDIO_SESSION_ID_UNSET + if (!eqOn || id == C.AUDIO_SESSION_ID_UNSET) { + releaseEffects() + return + } + if (id != effectsSession) { + releaseEffects() + effectsSession = id + equalizer = runCatching { Equalizer(0, id) }.getOrNull() + bassBoost = runCatching { BassBoost(0, id) }.getOrNull() + } + runCatching { + equalizer?.let { eq -> + val range = eq.bandLevelRange + for (band in 0 until minOf(eq.numberOfBands.toInt(), eqBands.size)) { + eq.setBandLevel(band.toShort(), eqBands[band].coerceIn(range[0].toInt(), range[1].toInt()).toShort()) + } + eq.enabled = true + } + } + runCatching { + bassBoost?.let { boost -> + if (boost.strengthSupported) boost.setStrength(eqBass.coerceIn(0, 1000).toShort()) + boost.enabled = eqBass > 0 + } + } + } + + private fun setSleep(minutes: Int) { + handler.removeCallbacks(sleepRunnable) + sleepAtTrackEnd = false + if (minutes > 0) handler.postDelayed(sleepRunnable, minutes * 60_000L) + else if (minutes < 0) sleepAtTrackEnd = true + } + + private fun refreshButtons() { + val live = session ?: return + live.setCustomLayout(buttons(live.player)) + } + + override fun onGetSession(controllerInfo: MediaSession.ControllerInfo): MediaSession? = session + + override fun onTaskRemoved(rootIntent: Intent?) { + val player = session?.player + if (player == null || !player.playWhenReady || player.mediaItemCount == 0 || player.playbackState == Player.STATE_ENDED) stopSelf() + } + + override fun onDestroy() { + handler.removeCallbacks(sleepRunnable) + covers.shutdownNow() + releaseEffects() + session?.let { + it.player.release() + it.release() + } + session = null + super.onDestroy() + } + + companion object { + const val HINT_OWNER = "droiddeck.owner" + private val SHUFFLE = SessionCommand("droiddeck.shuffle", Bundle.EMPTY) + private val REPEAT = SessionCommand("droiddeck.repeat", Bundle.EMPTY) + val SKIP_SILENCE = SessionCommand("droiddeck.skipsilence", Bundle.EMPTY) + val EQUALIZER = SessionCommand("droiddeck.equalizer", Bundle.EMPTY) + val SLEEP = SessionCommand("droiddeck.sleep", Bundle.EMPTY) + val INGAME = SessionCommand("droiddeck.ingame", Bundle.EMPTY) + const val ARG_ON = "on" + const val ARG_BANDS = "bands" + const val ARG_BASS = "bass" + const val ARG_MINUTES = "minutes" + } + + private inner class Resolver : MediaSession.Callback { + private fun isOwner(controller: MediaSession.ControllerInfo) = + controller.uid == Process.myUid() && controller.connectionHints.getBoolean(HINT_OWNER, false) + + override fun onConnect(session: MediaSession, controller: MediaSession.ControllerInfo): MediaSession.ConnectionResult = + if (controller.uid == Process.myUid() || controller.isTrusted) { + MediaSession.ConnectionResult.AcceptedResultBuilder(session) + .setAvailableSessionCommands( + MediaSession.ConnectionResult.DEFAULT_SESSION_COMMANDS.buildUpon().add(SHUFFLE).add(REPEAT).add(SKIP_SILENCE).add(EQUALIZER).add(SLEEP).add(INGAME).build(), + ) + .setCustomLayout(buttons(session.player)) + .build() + } else { + MediaSession.ConnectionResult.reject() + } + + override fun onCustomCommand( + session: MediaSession, controller: MediaSession.ControllerInfo, customCommand: SessionCommand, args: Bundle, + ): ListenableFuture { + val player = session.player + when (customCommand.customAction) { + SHUFFLE.customAction -> player.shuffleModeEnabled = !player.shuffleModeEnabled + REPEAT.customAction -> player.repeatMode = when (player.repeatMode) { + Player.REPEAT_MODE_OFF -> Player.REPEAT_MODE_ALL + Player.REPEAT_MODE_ALL -> Player.REPEAT_MODE_ONE + else -> Player.REPEAT_MODE_OFF + } + SKIP_SILENCE.customAction, EQUALIZER.customAction, SLEEP.customAction, INGAME.customAction -> { + if (!isOwner(controller)) return Futures.immediateFuture(SessionResult(SessionResult.RESULT_ERROR_PERMISSION_DENIED)) + when (customCommand.customAction) { + SKIP_SILENCE.customAction -> exo?.skipSilenceEnabled = args.getBoolean(ARG_ON) + INGAME.customAction -> exo?.setAudioAttributes(mediaAttributes(), !args.getBoolean(ARG_ON)) + EQUALIZER.customAction -> { + eqOn = args.getBoolean(ARG_ON) + eqBands = args.getIntArray(ARG_BANDS) ?: IntArray(0) + eqBass = args.getInt(ARG_BASS) + applyEffects() + } + else -> setSleep(args.getInt(ARG_MINUTES)) + } + } + else -> return Futures.immediateFuture(SessionResult(SessionResult.RESULT_ERROR_NOT_SUPPORTED)) + } + return Futures.immediateFuture(SessionResult(SessionResult.RESULT_SUCCESS)) + } + + override fun onAddMediaItems( + mediaSession: MediaSession, controller: MediaSession.ControllerInfo, mediaItems: MutableList, + ): ListenableFuture> { + if (!isOwner(controller)) return Futures.immediateFailedFuture(SecurityException("Only DroidDeck can queue soundtrack files")) + val resolved = mediaItems.mapNotNull { item -> + val file = File(item.mediaId) + if (Soundtrack.isAudio(file)) item.buildUpon().setUri(Uri.fromFile(file)).build() else null + }.toMutableList() + return Futures.immediateFuture(resolved) + } + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/playback/SoundtrackSettings.kt b/app/src/main/java/com/droiddeck/launcher/playback/SoundtrackSettings.kt new file mode 100644 index 0000000000..c34af1e32e --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/playback/SoundtrackSettings.kt @@ -0,0 +1,78 @@ +package com.droiddeck.launcher.playback + +import android.content.Context +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableFloatStateOf +import androidx.compose.runtime.mutableIntStateOf +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.setValue + +object SoundtrackSettings { + const val MIN_RATE = 0.5f + const val MAX_RATE = 2f + + var speed by mutableFloatStateOf(1f) + private set + var pitch by mutableFloatStateOf(1f) + private set + var skipSilence by mutableStateOf(false) + private set + var eqOn by mutableStateOf(false) + private set + var bands by mutableStateOf>(emptyList()) + private set + var bass by mutableIntStateOf(0) + private set + + class Resume(val root: String, val id: String, val positionMs: Long) + + private var loaded = false + + private fun prefs(context: Context) = context.applicationContext.getSharedPreferences("soundtrack_settings", Context.MODE_PRIVATE) + + @Synchronized + fun load(context: Context) { + if (loaded) return + loaded = true + val p = prefs(context) + speed = p.getFloat("speed", 1f).coerceIn(MIN_RATE, MAX_RATE) + pitch = p.getFloat("pitch", 1f).coerceIn(MIN_RATE, MAX_RATE) + skipSilence = p.getBoolean("skipSilence", false) + eqOn = p.getBoolean("eqOn", false) + bands = p.getString("bands", "").orEmpty().split(',').mapNotNull { it.trim().toIntOrNull() } + bass = p.getInt("bass", 0).coerceIn(0, 1000) + } + + fun setSpeed(context: Context, value: Float) { + speed = value.coerceIn(MIN_RATE, MAX_RATE) + prefs(context).edit().putFloat("speed", speed).apply() + } + + fun setPitch(context: Context, value: Float) { + pitch = value.coerceIn(MIN_RATE, MAX_RATE) + prefs(context).edit().putFloat("pitch", pitch).apply() + } + + fun setSkipSilence(context: Context, on: Boolean) { + skipSilence = on + prefs(context).edit().putBoolean("skipSilence", on).apply() + } + + fun setEqualizer(context: Context, on: Boolean, levels: List, bassStrength: Int) { + eqOn = on + bands = levels + bass = bassStrength.coerceIn(0, 1000) + prefs(context).edit().putBoolean("eqOn", on).putString("bands", levels.joinToString(",")).putInt("bass", bass).apply() + } + + fun resume(context: Context): Resume? { + val p = prefs(context) + val root = p.getString("resumeRoot", null) ?: return null + val id = p.getString("resumeId", null) ?: return null + return Resume(root, id, p.getLong("resumePosition", 0L)) + } + + fun saveResume(context: Context, root: String, id: String, positionMs: Long) { + prefs(context).edit().putString("resumeRoot", root).putString("resumeId", id).putLong("resumePosition", positionMs.coerceAtLeast(0L)).apply() + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/runtime/BattleNet.kt b/app/src/main/java/com/droiddeck/launcher/runtime/BattleNet.kt index a98e3d0cfa..eeab317afe 100644 --- a/app/src/main/java/com/droiddeck/launcher/runtime/BattleNet.kt +++ b/app/src/main/java/com/droiddeck/launcher/runtime/BattleNet.kt @@ -232,11 +232,24 @@ object BattleNet { } internal fun hostFolder(context: Context, path: String): File? { - val drive = Regex("""^([CcZz]):[\\/](.*)$""").matchEntire(path.trim()) ?: return null + val drive = Regex("""^([A-Za-z]):[\\/](.*)$""").matchEntire(path.trim()) ?: return null val relative = drive.groupValues[2].replace('\\', '/').trim('/') if (relative.isEmpty() || relative.split('/').any { it == ".." }) return null - return if (drive.groupValues[1].equals("c", ignoreCase = true)) File(prefix(context), "pfx/drive_c/$relative") - else com.droiddeck.launcher.frontend.AddedGames.hostPath(context, "/$relative") + val letter = drive.groupValues[1].lowercase() + if (letter == "c") return File(prefix(context), "pfx/drive_c/$relative") + val link = File(prefix(context), "pfx/dosdevices/$letter:").toPath() + val mapped = runCatching { java.nio.file.Files.readSymbolicLink(link).toString() }.getOrNull() + val target = when { + mapped == null -> if (letter == "z") "/" else return null + mapped.startsWith("/") -> mapped + else -> { + val rootfs = LinuxRuntime.rootDir(context).toPath().toAbsolutePath().normalize() + val resolved = link.toAbsolutePath().parent.resolve(mapped).normalize() + if (!resolved.startsWith(rootfs)) return null + "/" + rootfs.relativize(resolved).joinToString("/") + } + }.trimEnd('/') + return com.droiddeck.launcher.frontend.AddedGames.hostPath(context, "$target/$relative") } private val KEY = Regex("""^\[(.+)\](?:\s+\d+)?\s*$""") @@ -361,7 +374,7 @@ object BattleNet { val guestPrefix = added.guestPath(context, prefix(context)) ?: return null val crc = java.util.zip.CRC32().apply { update("\"$guestExe\"${game.name}".toByteArray()) }.value val appId = com.droiddeck.launcher.session.SessionPrefs.addedGameAppId(context, game.folder.path, crc or 0x80000000L) - val exe = added.candidates(game.folder).firstOrNull() ?: client + val exe = added.candidates(game.folder, reuse = true).firstOrNull() ?: client return com.droiddeck.launcher.frontend.AddedGames.Game( game.folder, game.name, exe, guestExe, guestDir, appId, (appId shl 32) or 0x02000000L, listOf(exe), source = com.droiddeck.launcher.stores.Store.BATTLENET.id, storeId = game.uid, diff --git a/app/src/main/java/com/droiddeck/launcher/runtime/BwrapSpawner.kt b/app/src/main/java/com/droiddeck/launcher/runtime/BwrapSpawner.kt index 2d1a9aa401..4a98fdedec 100644 --- a/app/src/main/java/com/droiddeck/launcher/runtime/BwrapSpawner.kt +++ b/app/src/main/java/com/droiddeck/launcher/runtime/BwrapSpawner.kt @@ -182,6 +182,7 @@ object BwrapSpawner { val argv = request.getJSONArray("argv").let { a -> (0 until a.length()).map { a.getString(it) } } val env = LinkedHashMap() request.optJSONObject("env")?.let { e -> e.keys().forEach { k -> env[k] = e.getString(k) } } + withoutRootfsSettings(env, rootfs) val envTool = request.optString("envTool").takeIf { it.startsWith("/") } if (envTool == null && binds.any { it.guest == "/dev" }) gpu(rootfs, root, env)?.forEach { addBind(it) } val libc = listOf("/usr/lib/aarch64-linux-gnu/libc.so.6", "/lib/aarch64-linux-gnu/libc.so.6").map { hostPath(binds, root.path, it) } @@ -191,6 +192,24 @@ object BwrapSpawner { return Plan(root, binds, request.optString("cwd", "/").ifEmpty { "/" }, argv, env, envTool ?: "/usr/bin/env") } + private val ROOTFS_PIPEWIRE = listOf("PIPEWIRE_MODULE_DIR", "SPA_PLUGIN_DIR", "PIPEWIRE_CONFIG_DIR") + + /** + * The session's Flatpak passes settings for the session's own root on: the native hook's, + * DroidDeck's PipeWire build, which a runtime does not have (its apps found no PipeWire plugins), + * and the session's video driver for SDL. + */ + internal fun withoutRootfsSettings(env: MutableMap, rootfs: String) { + env.keys.removeAll { it.startsWith("DDNATV_") } + for (key in ROOTFS_PIPEWIRE) if (env[key]?.startsWith("/usr/local/lib/droiddeck-pipewire") == true) env.remove(key) + // the session's choice of X11 for SDL, in an app that Flatpak gave Wayland and no X display + if (env["SDL_VIDEODRIVER"] == "x11" && env["DISPLAY"].isNullOrEmpty() && !env["WAYLAND_DISPLAY"].isNullOrEmpty()) env.remove("SDL_VIDEODRIVER") + env["LD_PRELOAD"]?.let { preload -> + val kept = preload.split(':').filter { it.isNotEmpty() && it != rootfs && !it.startsWith("$rootfs/") } + if (kept.isEmpty()) env.remove("LD_PRELOAD") else env["LD_PRELOAD"] = kept.joinToString(":") + } + } + private const val GPU_DIR = "/run/droiddeck-gpu" private val LIB_DIRS = listOf("usr/lib/aarch64-linux-gnu", "usr/lib") @@ -347,22 +366,201 @@ object BwrapSpawner { try { Os.chmod(f.path, mode) } catch (e: Exception) { } } + private val SANDBOX_LOADERS = listOf("/usr/lib/aarch64-linux-gnu/ld-linux-aarch64.so.1", "/usr/lib/ld-linux-aarch64.so.1", + "/lib/ld-linux-aarch64.so.1", "/lib64/ld-linux-aarch64.so.1") + private val SANDBOX_LIBCS = listOf("/usr/lib/aarch64-linux-gnu/libc.so.6", "/usr/lib/libc.so.6", "/lib/aarch64-linux-gnu/libc.so.6") + private val SANDBOX_LIB_DIRS = listOf("/app/lib/aarch64-linux-gnu", "/app/lib", "/usr/lib/aarch64-linux-gnu", "/usr/lib") + private val seccompPatched = java.util.concurrent.ConcurrentHashMap.newKeySet() + + /** + * The sandbox started by the runtime's own glibc loader with the native hook, which maps the + * sandbox's mounts; null when the runtime cannot load the hook (older glibc), so proot runs it. + */ + private fun nativeLaunch(context: Context, plan: Plan): Pair, Map>? { + val rootfs = LinuxRuntime.rootDir(context) + val sandbox = plan.root.path + fun host(guest: String) = File(hostPath(plan.binds, sandbox, guest)) + if (!hasEnvTool(plan)) { + val program = plan.argv.firstOrNull()?.takeIf { it.startsWith("/") }?.let(::host)?.canonicalFile + ?.takeIf { it.isFile && isStaticElf(it) } ?: return null + if (!linkMounts(plan)) return null + return (listOf(program.path) + plan.argv.drop(1)) to plan.env + } + val loader = SANDBOX_LOADERS.map(::host).firstOrNull { it.isFile }?.canonicalFile ?: return null + val libc = SANDBOX_LIBCS.map(::host).firstOrNull { it.isFile }?.canonicalFile ?: return null + val hook = NativeGuest.hook(rootfs) + val need = glibcMinor(hook, GLIBC_NEED) { it.maxOrNull() } ?: return null + val have = glibcMinor(libc, GLIBC_RELEASE) { it.firstOrNull() } ?: return null + if (have < need) { + Log.i(TAG, "native userland: this runtime's glibc 2.$have cannot load the hook (2.$need); proot runs the sandbox") + return null + } + for (file in listOf(loader, libc)) { + val key = "${file.path}:${file.length()}:${file.lastModified()}" + if (key in seccompPatched) continue + // an unpatched loader or libc dies under Android's filter before the hook loads: proot runs it + val patched = runCatching { ElfSeccompPatch.patchFile(file) } + .onFailure { Log.e(TAG, "native userland: could not patch $file for Android's seccomp filter; proot runs the sandbox", it) } + if (patched.isFailure) return null + seccompPatched.add("${file.path}:${file.length()}:${file.lastModified()}") + } + val program = host(plan.envTool).canonicalFile.takeIf { it.isFile } ?: return null + if (!linkMounts(plan)) return null + writeRunpathConf(plan, ::host) + val launch = listOf(loader.path, "--argv0", program.name, program.path, "-i") + + plan.env.map { (k, v) -> "$k=$v" } + plan.argv + val env = linkedMapOf( + "DDNATV_ROOT" to sandbox, + "DDNATV_LINK_ROOT" to rootfs.path, + "DDNATV_BINDS" to plan.binds.joinToString("|") { "${it.host}:${it.guest}" }, + "DDNATV_HOSTNAME" to SessionPrefs.guestHostname(context), + "LD_LIBRARY_PATH" to SANDBOX_LIB_DIRS.map(::host).filter { it.isDirectory }.joinToString(":") { it.path }, + "LD_PRELOAD" to hook.path, + ).filterValues { it.isNotEmpty() } + return (NativeGuest.simulator(rootfs)?.let { it + launch } ?: launch) to env + } + + private val runpathDirs = java.util.concurrent.ConcurrentHashMap>() + + /** + * ld.so opens a library's absolute RUNPATH (libpulse's pulseaudio/ directory) without the hook, + * on Android's own filesystem, so those directories are listed for the hook in the sandbox's + * ld.so.conf too, as [NativeGuest.syncLibraryDirs] does for the rootfs. A checkout never changes. + */ + private fun writeRunpathConf(plan: Plan, host: (String) -> File) { + val confDir = inRoot(plan.root, "/run/flatpak/ld.so.conf.d")?.takeIf { it.isDirectory } ?: return + val dirs = sortedSetOf() + for (top in listOf("/usr/lib", "/app/lib")) { + val real = host(top).takeIf { it.isDirectory }?.canonicalFile ?: continue + dirs += runpathDirs.getOrPut(real.path) { + real.walkTopDown().maxDepth(4).onEnter { !Files.isSymbolicLink(it.toPath()) } + .filter { it.isFile && ".so" in it.name && !Files.isSymbolicLink(it.toPath()) } + .flatMap { runCatching { ElfRunpath.read(it) }.getOrDefault(emptyList()) } + .filter { it.startsWith("/usr/") || it.startsWith("/app/") || it.startsWith("/lib") } + .distinct().toList() + } + } + if (dirs.isEmpty()) return + runCatching { File(confDir, "runtime-999-droiddeck-runpath.conf").writeText(dirs.joinToString("\n", postfix = "\n")) } + } + + /** A runtime extension's apply_extra runs in a sandbox with nothing but the extension itself. */ + private fun hasEnvTool(plan: Plan): Boolean = + File(hostPath(plan.binds, plan.root.path, plan.envTool)).let { it.exists() || Files.isSymbolicLink(it.toPath()) } + + internal fun isStaticElf(file: File): Boolean = try { + java.io.RandomAccessFile(file, "r").use { f -> + val head = ByteArray(64).also { f.readFully(it) } + if (head[0] != 0x7f.toByte() || head[1] != 'E'.code.toByte() || head[4] != 2.toByte() || head[5] != 1.toByte()) return false + val le = java.nio.ByteBuffer.wrap(head).order(java.nio.ByteOrder.LITTLE_ENDIAN) + val phoff = le.getLong(32) + val phentsize = le.getShort(54).toInt() and 0xffff + val phnum = le.getShort(56).toInt() and 0xffff + val entry = ByteArray(4) + (0 until phnum).none { i -> + f.seek(phoff + i.toLong() * phentsize) + f.readFully(entry) + java.nio.ByteBuffer.wrap(entry).order(java.nio.ByteOrder.LITTLE_ENDIAN).int == 3 // PT_INTERP + } + } + } catch (_: java.io.IOException) { + false + } + + /** + * The kernel follows paths the hook does not see (ld.so, symbolic links), so each top-level + * mount of the sandbox is also a link to its source in the sandbox's own root, and the + * sandbox's links with absolute guest targets are made relative, which reaches them through those. + * False when a mount's place could not be made; proot then runs the sandbox, whose mounts hide + * whatever was left at their places. + */ + private fun linkMounts(plan: Plan): Boolean { + val root = plan.root.toPath() + plan.root.walkTopDown().onEnter { !Files.isSymbolicLink(it.toPath()) }.map { it.toPath() } + .filter { Files.isSymbolicLink(it) }.toList().forEach { link -> + runCatching { + val target = Files.readSymbolicLink(link).toString() + if (!target.startsWith("/")) return@runCatching + Files.delete(link) + Files.createSymbolicLink(link, link.parent.relativize(root.resolve(target.removePrefix("/")))) + } + } + // a mount inside another mount (a GL extension at /usr/lib/aarch64-linux-gnu/GL) needs its own + // place: the links of the mounts it is in become directories of links to their entries + val entryLinks = HashSet() + for (bind in plan.binds.sortedBy { it.guest.length }) { + if (bind.guest == "/") continue + val at = try { + mountPlace(plan.root, bind.guest, entryLinks)?.also { at -> + val path = at.toPath() + if (path in entryLinks) { + Files.delete(path) + entryLinks.remove(path) + } + } + } catch (e: java.io.IOException) { + Log.e(TAG, "native userland: could not make a place for ${bind.guest}; proot runs the sandbox", e) + return false + } ?: continue + val path = at.toPath() + if (at.exists() || Files.isSymbolicLink(path)) continue + at.parentFile?.mkdirs() + runCatching { Files.createSymbolicLink(path, java.nio.file.Paths.get(bind.host)) } + } + return true + } + + private fun mountPlace(root: File, guest: String, entryLinks: MutableSet): File? { + val parts = guest.split('/').filter { it.isNotEmpty() } + var f = root + for ((i, part) in parts.withIndex()) { + if (part == "..") return null + f = File(f, part) + val path = f.toPath() + if (i == parts.lastIndex || !Files.isSymbolicLink(path)) continue + val target = Files.readSymbolicLink(path) + // a link of the sandbox's own tree, made relative above, is not a mount + if (!target.isAbsolute) return null + Files.delete(path) + entryLinks.remove(path) + Files.createDirectory(path) + target.toFile().listFiles()?.forEach { entry -> + val link = path.resolve(entry.name) + Files.createSymbolicLink(link, entry.toPath()) + entryLinks.add(link) + } + } + return f + } + private fun run(context: Context, plan: Plan, client: LocalSocket, out: DataOutputStream, id: Int) { - val cmd = LinuxRuntime.prootPrefix(context, plan.root, plan.cwd) val verbose = plan.env["DROIDDECK_PROOT_VERBOSE"]?.toIntOrNull() - if (verbose != null) { cmd.add(1, "-v"); cmd.add(2, verbose.toString()) } - plan.binds.forEach { cmd.add("-b"); cmd.add(it.spec) } - cmd.add(plan.envTool) - cmd.add("-i") - plan.env.forEach { (k, v) -> cmd.add("$k=$v") } - cmd.addAll(plan.argv) - val builder = ProcessBuilder(cmd).redirectErrorStream(true).directory(plan.root) - builder.environment().apply { - clear() - put("PROOT_LOADER", LinuxRuntime.prootLoader(context).path) - put("PROOT_TMP_DIR", LinuxRuntime.prootTempDir(context).path) - if (SessionPrefs.prootNoSeccomp(context)) put("PROOT_NO_SECCOMP", "1") - LinuxRuntime.prootLibraryPath(context).takeIf { it.isNotEmpty() }?.let { put("LD_LIBRARY_PATH", it) } + val native = if (NativeGuest.forSession(context)) nativeLaunch(context, plan) else null + val builder = if (native != null) { + ProcessBuilder(native.first).redirectErrorStream(true) + .directory(File(hostPath(plan.binds, plan.root.path, plan.cwd)).takeIf { it.isDirectory } ?: plan.root) + .also { b -> b.environment().apply { clear(); putAll(native.second) } } + } else { + val cmd = LinuxRuntime.prootPrefix(context, plan.root, plan.cwd) + if (verbose != null) { cmd.add(1, "-v"); cmd.add(2, verbose.toString()) } + plan.binds.forEach { cmd.add("-b"); cmd.add(it.spec) } + val envTool = hasEnvTool(plan) + if (envTool) { + cmd.add(plan.envTool) + cmd.add("-i") + plan.env.forEach { (k, v) -> cmd.add("$k=$v") } + } + cmd.addAll(plan.argv) + ProcessBuilder(cmd).redirectErrorStream(true).directory(plan.root).also { b -> + b.environment().apply { + clear() + if (!envTool) putAll(plan.env) + put("PROOT_LOADER", LinuxRuntime.prootLoader(context).path) + put("PROOT_TMP_DIR", LinuxRuntime.prootTempDir(context).path) + if (SessionPrefs.prootNoSeccomp(context)) put("PROOT_NO_SECCOMP", "1") + LinuxRuntime.prootLibraryPath(context).takeIf { it.isNotEmpty() }?.let { put("LD_LIBRARY_PATH", it) } + } + } } val process = builder.start() val pid = HostProcess.pidOf(process) diff --git a/app/src/main/java/com/droiddeck/launcher/runtime/ElfRunpath.kt b/app/src/main/java/com/droiddeck/launcher/runtime/ElfRunpath.kt new file mode 100644 index 0000000000..dc772c49a1 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/runtime/ElfRunpath.kt @@ -0,0 +1,72 @@ +package com.droiddeck.launcher.runtime + +import java.io.File +import java.io.RandomAccessFile +import java.nio.ByteBuffer +import java.nio.ByteOrder + +/** The absolute DT_RUNPATH and DT_RPATH directories of a 64-bit little-endian ELF object. */ +object ElfRunpath { + private const val PT_LOAD = 1 + private const val PT_DYNAMIC = 2 + private const val DT_STRTAB = 5 + private const val DT_RPATH = 15 + private const val DT_RUNPATH = 29 + + fun read(file: File): List { + if (file.length() < 64) return emptyList() + RandomAccessFile(file, "r").use { raf -> + val channel = raf.channel + val header = ByteBuffer.allocate(64).order(ByteOrder.LITTLE_ENDIAN) + channel.read(header, 0) + if (header.getInt(0) != 0x464c457f || header.get(4).toInt() != 2 || header.get(5).toInt() != 1) return emptyList() + val phoff = header.getLong(32) + val phentsize = header.getShort(54).toInt() and 0xffff + val phnum = header.getShort(56).toInt() and 0xffff + if (phnum == 0 || phnum > 128 || phentsize < 56) return emptyList() + val table = ByteBuffer.allocate(phentsize * phnum).order(ByteOrder.LITTLE_ENDIAN) + channel.read(table, phoff) + class Load(val vaddr: Long, val offset: Long, val size: Long) + val loads = ArrayList() + var dynOffset = -1L + var dynSize = 0L + for (i in 0 until phnum) { + val at = i * phentsize + val type = table.getInt(at) + val offset = table.getLong(at + 8) + val vaddr = table.getLong(at + 16) + val filesz = table.getLong(at + 32) + if (type == PT_LOAD) loads.add(Load(vaddr, offset, filesz)) + if (type == PT_DYNAMIC) { dynOffset = offset; dynSize = filesz } + } + if (dynOffset < 0 || dynSize <= 0 || dynSize > 1 shl 20) return emptyList() + val dynamic = ByteBuffer.allocate(dynSize.toInt()).order(ByteOrder.LITTLE_ENDIAN) + channel.read(dynamic, dynOffset) + var strtab = -1L + val names = ArrayList() + var at = 0 + while (at + 16 <= dynamic.capacity()) { + val tag = dynamic.getLong(at) + val value = dynamic.getLong(at + 8) + if (tag == 0L) break + if (tag == DT_STRTAB.toLong()) strtab = value + if (tag == DT_RPATH.toLong() || tag == DT_RUNPATH.toLong()) names.add(value) + at += 16 + } + if (strtab < 0 || names.isEmpty()) return emptyList() + val strtabOffset = loads.firstOrNull { strtab >= it.vaddr && strtab < it.vaddr + it.size } + ?.let { strtab - it.vaddr + it.offset } ?: return emptyList() + val result = ArrayList() + for (name in names) { + val buffer = ByteBuffer.allocate(4096) + val n = channel.read(buffer, strtabOffset + name) + if (n <= 0) continue + val bytes = buffer.array() + var end = 0 + while (end < n && bytes[end].toInt() != 0) end++ + String(bytes, 0, end, Charsets.UTF_8).split(':').filter { it.startsWith("/") }.forEach { result.add(it.trimEnd('/')) } + } + return result + } + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/runtime/ElfSeccompPatch.kt b/app/src/main/java/com/droiddeck/launcher/runtime/ElfSeccompPatch.kt new file mode 100644 index 0000000000..817cbc9757 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/runtime/ElfSeccompPatch.kt @@ -0,0 +1,85 @@ +package com.droiddeck.launcher.runtime + +import java.io.File +import java.nio.ByteBuffer +import java.nio.ByteOrder + +/** + * Android's app seccomp filter kills a process with SIGSYS for rseq, set_robust_list and clone3. glibc's + * dynamic linker makes the first two before any preloaded library (so before the hook's SIGSYS + * handler) exists, so the call sites in the rootfs's ld.so and libc answer by themselves instead: the + * `svc` after `mov x8, #nr` becomes a no-op for set_robust_list (glibc ignores the result) and + * `mov x0, #-ENOSYS` for rseq and clone3 (glibc falls back from both). Under proot the same + * answers are what proot gives. + */ +object ElfSeccompPatch { + private const val SVC = 0xd4000001.toInt() + private const val NOP = 0xd503201f.toInt() + private const val MOV_X0_ENOSYS = 0x928004a0.toInt() + private const val MOV_X8_SET_ROBUST_LIST = 0xd2800c68.toInt() + private const val MOV_X8_CLONE3 = 0xd2803668.toInt() + private const val MOV_X8_RSEQ = 0xd28024a8.toInt() + private const val WINDOW = 16 + + /** Patches [data] in place and returns the number of call sites changed. */ + fun patch(data: ByteArray): Int { + if (data.size < 64 || data[0] != 0x7f.toByte() || data[1] != 'E'.code.toByte() || data[4].toInt() != 2 || data[5].toInt() != 1) return 0 + val buffer = ByteBuffer.wrap(data).order(ByteOrder.LITTLE_ENDIAN) + if (buffer.getShort(18).toInt() != 183) return 0 + val phoff = buffer.getLong(32).toInt() + val phentsize = buffer.getShort(54).toInt() and 0xffff + val phnum = buffer.getShort(56).toInt() and 0xffff + var patched = 0 + for (i in 0 until phnum) { + val at = phoff + i * phentsize + if (at + 56 > data.size) break + if (buffer.getInt(at) != 1 || (buffer.getInt(at + 4) and 1) == 0) continue + val start = ((buffer.getLong(at + 8).toInt()) + 3) and 3.inv() + val end = minOf(data.size, buffer.getLong(at + 8).toInt() + buffer.getLong(at + 32).toInt()) and 3.inv() + var pos = start + while (pos + 4 <= end) { + val replacement = when (buffer.getInt(pos)) { + MOV_X8_SET_ROBUST_LIST -> NOP + MOV_X8_CLONE3, MOV_X8_RSEQ -> MOV_X0_ENOSYS + else -> null + } + if (replacement != null) { + var next = pos + 4 + val limit = minOf(end, pos + 4 + WINDOW * 4) + while (next < limit) { + val insn = buffer.getInt(next) + if (insn == SVC) { + buffer.putInt(next, replacement) + patched++ + break + } + // A site patched before, or x8 set again: an svc after it is another call's + // (a second run found clone3's thread exit there and turned it into -ENOSYS) + if (insn == MOV_X0_ENOSYS || (insn and 0x1f) == 8) break + next += 4 + } + } + pos += 4 + } + } + return patched + } + + /** Patches the file behind [path] (symlinks followed) if it still has unpatched call sites. */ + fun patchFile(path: File): Int { + val target = path.canonicalFile + if (!target.isFile) return 0 + val data = target.readBytes() + val count = patch(data) + if (count == 0) return 0 + val temp = File(target.parentFile, "." + target.name + ".seccomp") + temp.writeBytes(data) + temp.setExecutable(true, false) + temp.setReadable(true, false) + if (!temp.renameTo(target)) { + temp.delete() + throw java.io.IOException("could not replace ${target.path}") + } + return count + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/runtime/GuestCommand.kt b/app/src/main/java/com/droiddeck/launcher/runtime/GuestCommand.kt index 8e5769c312..0560752a31 100644 --- a/app/src/main/java/com/droiddeck/launcher/runtime/GuestCommand.kt +++ b/app/src/main/java/com/droiddeck/launcher/runtime/GuestCommand.kt @@ -35,12 +35,10 @@ object GuestCommand { SessionFiles.stage(context, root) LinuxNetworkLinkComponent(context, root).publish() val runtimeDir = File(context.filesDir, ".flatpak-rt").apply { mkdirs() } - val cmd = LinuxRuntime.prootPrefix(context, root, "/root", fakeRoot) - if (linkDir != null) cmd.add(1, "--link2symlink") val binds = LinuxRuntime.binds(context, null, runtimeDir, Environment.getExternalStorageDirectory(), extraBinds) - binds.forEach { cmd.add("-b"); cmd.add(it) } - val fastPathKey = if (fastPath && !fakeRoot && linkDir == null && ProotFastPath.enabled(context)) ProotFastPath.key(root, binds) else null - cmd += listOf( + val native = NativeGuest.forSession(context) + val fastPathKey = if (!native && fastPath && !fakeRoot && linkDir == null && ProotFastPath.enabled(context)) ProotFastPath.key(root, binds) else null + val guest = mutableListOf( "/usr/bin/env", "-i", "HOME=/root", "USER=root", "LANG=C.UTF-8", "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games", "XDG_RUNTIME_DIR=${LinuxRuntime.GUEST_RUNTIME_DIR}", "XDG_DATA_HOME=/root/.local/share", "FLATPAK_BWRAP=${FlatpakManager.BWRAP}", @@ -48,22 +46,31 @@ object GuestCommand { "XDG_DATA_DIRS=/root/.local/share/flatpak/exports/share:/usr/local/share:/usr/share", ) DownloadSource.proxyHostPort(context).takeIf { it.isNotEmpty() }?.let { hostPort -> - cmd += listOf( + guest += listOf( "http_proxy=http://$hostPort", "https_proxy=http://$hostPort", "HTTP_PROXY=http://$hostPort", "HTTPS_PROXY=http://$hostPort", "no_proxy=localhost,127.0.0.1,::1", "NO_PROXY=localhost,127.0.0.1,::1", ) } - fastPathKey?.let { cmd += ProotFastPath.guestEnv(root, binds, it) } - cmd += argv - val builder = ProcessBuilder(cmd).directory(root).redirectErrorStream(true) - builder.environment().apply { - put("PROOT_LOADER", LinuxRuntime.prootLoader(context).path) - put("PROOT_TMP_DIR", LinuxRuntime.prootTempDir(context).path) - if (linkDir != null) put("PROOT_L2S_DIR", linkDir.path) - if (SessionPrefs.prootNoSeccomp(context)) put("PROOT_NO_SECCOMP", "1") - fastPathKey?.let { ProotFastPath.hostEnv(it).let { (k, v) -> put(k, v) } } - LinuxRuntime.prootLibraryPath(context).takeIf { it.isNotEmpty() }?.let { put("LD_LIBRARY_PATH", it) } + fastPathKey?.let { guest += ProotFastPath.guestEnv(root, binds, it) } + guest += argv + val builder = if (native) { + NativeGuest.processBuilder(context, root, binds, guest).redirectErrorStream(true) + } else { + val cmd = LinuxRuntime.prootPrefix(context, root, "/root", fakeRoot) + if (linkDir != null) cmd.add(1, "--link2symlink") + binds.forEach { cmd.add("-b"); cmd.add(it) } + cmd += guest + ProcessBuilder(cmd).directory(root).redirectErrorStream(true).also { b -> + b.environment().apply { + put("PROOT_LOADER", LinuxRuntime.prootLoader(context).path) + put("PROOT_TMP_DIR", LinuxRuntime.prootTempDir(context).path) + if (linkDir != null) put("PROOT_L2S_DIR", linkDir.path) + if (SessionPrefs.prootNoSeccomp(context)) put("PROOT_NO_SECCOMP", "1") + fastPathKey?.let { ProotFastPath.hostEnv(it).let { (k, v) -> put(k, v) } } + LinuxRuntime.prootLibraryPath(context).takeIf { it.isNotEmpty() }?.let { put("LD_LIBRARY_PATH", it) } + } + } } if (cancelled?.get() == true) return 130 val process = builder.start() diff --git a/app/src/main/java/com/droiddeck/launcher/runtime/LinuxNetworkLinkComponent.kt b/app/src/main/java/com/droiddeck/launcher/runtime/LinuxNetworkLinkComponent.kt index 7081d88114..46c29aadb8 100644 --- a/app/src/main/java/com/droiddeck/launcher/runtime/LinuxNetworkLinkComponent.kt +++ b/app/src/main/java/com/droiddeck/launcher/runtime/LinuxNetworkLinkComponent.kt @@ -157,9 +157,7 @@ class LinuxNetworkLinkComponent( synchronized(lock) { try { file.parentFile?.mkdirs() - val staged = File(file.path + ".staged") - staged.writeText(describe(properties, capabilities)) - if (!staged.renameTo(file)) throw IOException("Could not replace $file") + replace(file, describe(properties, capabilities)) } catch (e: IOException) { Log.w(TAG, "Could not publish the network link", e) } @@ -241,9 +239,7 @@ class LinuxNetworkLinkComponent( } try { val file = File(rootDir, "etc/droiddeck-network.json") - val staged = File(file.path + ".staged") - staged.writeText(state.toString()) - if (!staged.renameTo(file)) throw IOException("Could not replace network state") + replace(file, state.toString()) } catch (e: IOException) { Log.w(TAG, "Could not publish the network state", e) } @@ -272,6 +268,19 @@ class LinuxNetworkLinkComponent( return Pair(servers.sortedWith(order), gateways.sortedWith(order)) } + /** + * Writes [text] to [file] through a staged copy. The copy is synced before the rename, or a + * crash or power cut can keep the rename and lose the data, leaving a file of NUL bytes. + */ + private fun replace(file: File, text: String) { + val staged = File(file.path + ".staged") + java.io.FileOutputStream(staged).use { out -> + out.write(text.toByteArray()) + out.fd.sync() + } + if (!staged.renameTo(file)) throw IOException("Could not replace $file") + } + private fun writeResolver(properties: LinkProperties?) { val own = properties?.dnsServers.orEmpty() .filter { !it.isLinkLocalAddress && !it.isLoopbackAddress && !it.isAnyLocalAddress } @@ -286,9 +295,7 @@ class LinuxNetworkLinkComponent( } try { val etc = File(rootDir, "etc") - val staged = File(etc, "resolv.conf.staged") - staged.writeText(text) - if (!staged.renameTo(File(etc, "resolv.conf"))) throw IOException("Could not replace resolv.conf") + replace(File(etc, "resolv.conf"), text) val hosts = File(etc, "hosts") if (!hosts.isFile || !hosts.readText().contains("localhost")) { hosts.writeText("127.0.0.1 localhost\n::1 localhost\n") diff --git a/app/src/main/java/com/droiddeck/launcher/runtime/LinuxRuntime.java b/app/src/main/java/com/droiddeck/launcher/runtime/LinuxRuntime.java index 3e5b0a29cb..0e5c2d6715 100644 --- a/app/src/main/java/com/droiddeck/launcher/runtime/LinuxRuntime.java +++ b/app/src/main/java/com/droiddeck/launcher/runtime/LinuxRuntime.java @@ -139,15 +139,26 @@ public final class LinuxRuntime { public static List command(Context context, File sessionRoot, File runtimeDir, File externalStorage, List extraBinds, List guestCommand) { + return command(context, sessionRoot, runtimeDir, externalStorage, extraBinds, guestCommand, false); + } + + public static List command(Context context, File sessionRoot, File runtimeDir, + File externalStorage, List extraBinds, + List guestCommand, boolean fakeRoot) { File root = rootDir(context); List binds = binds(context, sessionRoot, runtimeDir, externalStorage, extraBinds); if (sessionRoot != null) lastBinds = binds; - return commandWithBinds(context, root, binds, guestCommand); + return commandWithBinds(context, root, binds, guestCommand, fakeRoot); } public static List commandWithBinds(Context context, File root, List binds, List guestCommand) { - List cmd = prootPrefix(context, root, "/root"); + return commandWithBinds(context, root, binds, guestCommand, false); + } + + public static List commandWithBinds(Context context, File root, List binds, + List guestCommand, boolean fakeRoot) { + List cmd = fakeRoot ? rootPrefix(context, root, "/root") : prootPrefix(context, root, "/root"); for (String spec : binds) bind(cmd, spec); cmd.addAll(guestCommand); return cmd; @@ -155,6 +166,11 @@ public final class LinuxRuntime { private static volatile List lastBinds; + /** The mounts of a session started without proot, which sandboxes and root helpers see too. */ + public static void rememberSessionBinds(List binds) { + lastBinds = binds; + } + public static List lastBinds(Context context) { List binds = lastBinds; if (binds != null) return binds; @@ -165,6 +181,12 @@ public final class LinuxRuntime { return prootPrefix(context, root, cwd, false); } + public static List rootPrefix(Context context, File root, String cwd) { + List cmd = prootPrefix(context, root, cwd, true); + cmd.add(1, "--link2symlink"); + return cmd; + } + public static List prootPrefix(Context context, File root, String cwd, boolean fakeRoot) { List cmd = new ArrayList<>(); cmd.add(prootBinary(context).getPath()); @@ -306,7 +328,17 @@ public final class LinuxRuntime { private static boolean unreadablePciDevice() { File[] devices = new File("/sys/bus/pci/devices").listFiles(); - if (devices == null) return false; + if (devices == null) { + // The directory is there but the app may not list it (Android 13 on the AYN Thor): libpci then + // aborts the whole program with "Cannot open /sys/bus/pci/devices", which Chromium's GPU + // initialisation runs into. Not there at all (no PCI bus) is fine as it is. + try { + android.system.Os.stat("/sys/bus/pci/devices"); + return true; + } catch (android.system.ErrnoException e) { + return e.errno == android.system.OsConstants.EACCES; + } + } for (File device : devices) { if (!new File(device, "vendor").canRead()) return true; } diff --git a/app/src/main/java/com/droiddeck/launcher/runtime/LinuxRuntimeInstaller.java b/app/src/main/java/com/droiddeck/launcher/runtime/LinuxRuntimeInstaller.java index cf613008bb..fe853326ae 100644 --- a/app/src/main/java/com/droiddeck/launcher/runtime/LinuxRuntimeInstaller.java +++ b/app/src/main/java/com/droiddeck/launcher/runtime/LinuxRuntimeInstaller.java @@ -70,6 +70,7 @@ public final class LinuxRuntimeInstaller { volatile Step step = Step.OTHER; volatile int percent = -1; volatile boolean ok; + volatile String failure; final boolean removal; boolean maintenance; Job(boolean removal, String stage) { this.removal = removal; this.stage = stage; } @@ -78,6 +79,9 @@ public final class LinuxRuntimeInstaller { private static final Object JOB_LOCK = new Object(); private static Job running; private static volatile String removalError; + private static final ThreadLocal LAST_INSTALL = new ThreadLocal<>(); + private static final ThreadLocal CURRENT_INSTALL = new ThreadLocal<>(); + private static final ThreadLocal CATALOG_ERROR = new ThreadLocal<>(); private LinuxRuntimeInstaller() {} @@ -105,34 +109,66 @@ public final class LinuxRuntimeInstaller { } public static Release fetchRelease() { - String body = Downloader.downloadString(catalogUrl()); - if (body == null || body.isEmpty()) return null; + return fetchRelease(catalogUrl()); + } + + public static String catalogError() { return CATALOG_ERROR.get(); } + + static Release fetchRelease(String catalogUrl) { + CATALOG_ERROR.remove(); + String body = Downloader.downloadString(catalogUrl); + if (body == null) return catalogFailed(Downloader.lastFailure()); + if (body.isEmpty()) return catalogFailed("empty catalog"); try { JSONObject json = new JSONObject(body); String version = json.optString("version", ""); String url = json.optString("url", ""); String sha256 = json.optString("sha256", ""); - if (version.isEmpty() || url.isEmpty() || sha256.isEmpty()) return null; + if (version.isEmpty() || url.isEmpty() || sha256.isEmpty()) { + return catalogFailed("catalog lacks version, url or sha256"); + } return new Release(version, url, sha256, json.optLong("size", 0L)); } catch (Exception e) { - Log.w(TAG, "catalog: " + e); - return null; + return catalogFailed("invalid catalog: " + e); } } + private static Release catalogFailed(String reason) { + CATALOG_ERROR.set(reason); + Log.w(TAG, "catalog: " + reason); + return null; + } + private static final String USER_DATA = "root"; public static boolean install(Context context, Release release, ProgressListener listener) { Job job; boolean owner; synchronized (JOB_LOCK) { - if (running != null && (running.removal || running.maintenance)) return false; + if (running != null && (running.removal || running.maintenance)) { + Job rejected = new Job(false, null); + rejected.failure = running.removal ? "Runtime busy: removal in progress" : "Runtime busy: maintenance in progress"; + Log.w(TAG, rejected.failure); + LAST_INSTALL.set(rejected); + return false; + } owner = running == null; if (owner) { running = new Job(false, context.getString(R.string.user_apps_starting)); removalError = null; } job = running; if (listener != null) job.listeners.add(listener); } - if (!owner) return join(job, listener); + if (!owner) { + Boolean ok = await(job, listener); + if (ok != null) { + LAST_INSTALL.set(job); + return ok; + } + Job interrupted = new Job(false, null); + interrupted.failure = "Runtime install interrupted while waiting for the running install"; + LAST_INSTALL.set(interrupted); + return false; + } + CURRENT_INSTALL.set(job); try { Context app = context.getApplicationContext(); ProgressListener progress = new ProgressListener() { @@ -156,9 +192,10 @@ public final class LinuxRuntimeInstaller { if (job.ok && desktop) keepDesktop(app, progress); return job.ok; } finally { - synchronized (JOB_LOCK) { - running = null; - } + CURRENT_INSTALL.remove(); + LAST_INSTALL.set(job); + synchronized (JOB_LOCK) { running = null; } + if (listener != null) job.listeners.remove(listener); job.done.countDown(); } } @@ -247,6 +284,21 @@ public final class LinuxRuntimeInstaller { public static String removalError() { return removalError; } + public static String installError() { + Job job = LAST_INSTALL.get(); + return job == null ? null : job.failure; + } + + private static boolean fail(String step, String detail) { + String reason = detail == null || detail.isEmpty() ? step : step + ": " + detail; + Job job = CURRENT_INSTALL.get(); + if (job != null) job.failure = reason; + Log.w(TAG, reason); + return false; + } + + private static final String SWAP_FAILED = "Cannot replace the previous runtime"; + public static boolean hasRemovalPending(Context context) { return removalDirectory(LinuxRuntime.rootDir(context)).exists(); } @@ -266,13 +318,17 @@ public final class LinuxRuntimeInstaller { } private static boolean join(Job job, ProgressListener listener) { + return Boolean.TRUE.equals(await(job, listener)); + } + + private static Boolean await(Job job, ProgressListener listener) { try { if (listener != null) listener.onProgress(job.step, job.stage, job.percent); job.done.await(); return job.ok; } catch (InterruptedException e) { Thread.currentThread().interrupt(); - return false; + return null; } finally { if (listener != null) job.listeners.remove(listener); } @@ -329,8 +385,9 @@ public final class LinuxRuntimeInstaller { if (listener != null) listener.onProgress(Step.DOWNLOADING, downloading, 0); if (!LinuxRuntime.patchedProot(context) && !AddonPack.PROOT.await(context, () -> true, packProgress(listener, downloading)) && !SessionPrefs.allowStockProot(context)) - throw new IOException("Cannot download proot"); - if (!AddonPack.DIRECTAUDIO.await(context, () -> true, packProgress(listener, downloading))) throw new IOException("Cannot download DirectAudio"); + return fail("Cannot download proot", AddonPack.PROOT.getFailure()); + if (!AddonPack.DIRECTAUDIO.await(context, () -> true, packProgress(listener, downloading))) + return fail("Cannot download DirectAudio", AddonPack.DIRECTAUDIO.getFailure()); boolean ok = Downloader.downloadFile(release.url, archive, true, release.sha256, (fraction) -> { if (listener != null) { listener.onProgress(Step.DOWNLOADING, downloading, @@ -338,39 +395,36 @@ public final class LinuxRuntimeInstaller { } }); if (!ok) { - Log.w(TAG, "download failed"); keepPartial = true; - return false; + return fail("Cannot download the runtime", Downloader.lastFailure()); } if (listener != null) listener.onProgress(Step.VERIFYING, context.getString(R.string.rtinst_verifying), -1); String actual = Hashes.sha256(archive); - if (!release.sha256.equalsIgnoreCase(actual)) { - Log.w(TAG, "checksum mismatch: wanted " + release.sha256 + ", got " + actual); - return false; - } + if (!release.sha256.equalsIgnoreCase(actual)) + return fail("Runtime checksum mismatch", "wanted " + release.sha256 + ", got " + actual); File root = LinuxRuntime.rootDir(context); File staging = new File(root.getParentFile(), LinuxRuntime.DIR + ".new"); File old = new File(root.getParentFile(), LinuxRuntime.DIR + ".old"); recoverInterruptedSwap(root, staging, old); - if (!discard(staging, null) || !staging.mkdirs()) return false; + if (!discard(staging, null) || !staging.mkdirs()) return fail("Cannot prepare " + staging.getName(), null); if (listener != null) listener.onProgress(context.getString(R.string.rtinst_extracting), -1); if (!extract(context, archive, staging, root, listener)) { RuntimeFileTree.delete(staging, null); - return false; + return fail("Cannot unpack the runtime", null); } FileUtils.writeString(new File(staging, VERSION_FILE), release.version); if (!discard(old, null)) { discard(staging, null); - return false; + return fail(SWAP_FAILED, null); } java.util.List carryPaths = root.isDirectory() ? RuntimeFileTree.existingUserPaths(root, staging) : java.util.Collections.emptyList(); if (root.isDirectory() && !root.renameTo(old)) { RuntimeFileTree.delete(staging, null); - return false; + return fail(SWAP_FAILED, null); } File carryMarker = new File(staging, CARRY_MARKER); java.util.List encodedPaths = new java.util.ArrayList<>(); @@ -379,7 +433,7 @@ public final class LinuxRuntimeInstaller { if (old.isDirectory() && !old.renameTo(root)) Log.w(TAG, "could not restore the previous runtime; retained at " + old); discard(staging, null); - return false; + return fail(SWAP_FAILED, null); } java.util.List carried; @@ -396,7 +450,7 @@ public final class LinuxRuntimeInstaller { } else { Log.w(TAG, "incomplete rollback; retaining user data in " + staging); } - return false; + return fail("Cannot carry user data into the new runtime", e.getMessage()); } if (!staging.renameTo(root)) { @@ -407,7 +461,7 @@ public final class LinuxRuntimeInstaller { } catch (IOException e) { Log.w(TAG, "could not move all user data back after a failed swap", e); } old.renameTo(root); } - return false; + return fail(SWAP_FAILED, null); } new File(root, CARRY_MARKER).delete(); try { RuntimeFileTree.dropStaleState(root); } @@ -415,10 +469,10 @@ public final class LinuxRuntimeInstaller { discard(old, null); try { com.droiddeck.launcher.session.SessionFiles.INSTANCE.stage(context, root, false); } catch (Exception e) { Log.w(TAG, "could not stage the session files into the new runtime", e); } - return LinuxRuntime.isInstalled(context); + return LinuxRuntime.isInstalled(context) || fail("The runtime is incomplete after unpacking", null); } catch (Exception e) { Log.e(TAG, "install", e); - return false; + return fail("Install stopped", e.toString()); } finally { if (!keepPartial) archive.delete(); } diff --git a/app/src/main/java/com/droiddeck/launcher/runtime/NativeGuest.kt b/app/src/main/java/com/droiddeck/launcher/runtime/NativeGuest.kt new file mode 100644 index 0000000000..ae4106a081 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/runtime/NativeGuest.kt @@ -0,0 +1,269 @@ +package com.droiddeck.launcher.runtime + +import android.content.Context +import com.droiddeck.launcher.session.SessionPrefs +import java.io.File +import java.nio.file.Files + +/** + * Starts guest programs directly on the Android kernel, with no proot: the glibc loader of the + * rootfs runs the program and [HOOK] translates the guest's absolute paths, execs and the system + * calls Android's seccomp policy blocks, from inside the process. + */ +object NativeGuest { + private const val TAG = "NativeGuest" + const val HOOK = "usr/lib/libddnatv-hook.so" + private val LIB_DIRS = listOf("usr/lib", "usr/lib/aarch64-linux-gnu", "usr/local/lib", "usr/lib/systemd") + + /** Libraries every native program loads before the hook, as /etc/ld.so.preload does for proot. */ + fun preloadList(root: File): List { + val listed = File(root, "etc/droiddeck/native-preload").takeIf { it.isFile }?.readLines().orEmpty() + return listed.map { it.trim() }.filter { it.startsWith("/") && File(root, it.removePrefix("/")).isFile } + } + + fun enabled(context: Context): Boolean = + SessionPrefs.nativeUserland(context) && available(LinuxRuntime.rootDir(context)) + + /** The mode the running session started in; null between sessions. */ + @Volatile var sessionMode: Boolean? = null + + /** + * Whether a session's helpers (root commands, Flatpak sandboxes, installers) run natively: the + * session's own mode while one runs, as the setting can change under it and the rootfs is only + * prepared for native programs at a session's start. + */ + fun forSession(context: Context): Boolean = sessionMode ?: enabled(context) + + /** + * Development switch: etc/droiddeck/seccomp-sim names a helper (a guest path, then its arguments) + * that applies Android's app seccomp filter before the program starts, for devices that run apps + * without one (eng builds, or a permissive SELinux, where zygote skips it). Guest paths among the + * arguments are given as their places in the rootfs, as the helper runs before the hook. + */ + fun simulator(root: File): List? { + val words = File(root, "etc/droiddeck/seccomp-sim").takeIf { it.isFile }?.readText()?.trim() + ?.split(Regex("\\s+"))?.filter { it.isNotEmpty() } ?: return null + val helper = words.firstOrNull()?.takeIf { it.startsWith("/") }?.let { File(root, it.removePrefix("/")) } + ?.takeIf { it.isFile } ?: return null + return listOf(helper.path) + words.drop(1).map { if (it.startsWith("/")) File(root, it.removePrefix("/")).path else it } + } + + fun hook(root: File): File = File(root, HOOK) + + fun loader(root: File): File? = + listOf("usr/lib/ld-linux-aarch64.so.1", "lib/ld-linux-aarch64.so.1").map { File(root, it) }.firstOrNull { it.exists() } + + fun available(root: File): Boolean = hook(root).isFile && loader(root) != null + + fun libraryPath(root: File): String = LIB_DIRS.joinToString(":") { File(root, it).path } + + /** Environment every native process starts with; a guest `env -i` is re-seeded by the hook. */ + fun environment(root: File, preload: List = emptyList()): Map = linkedMapOf( + "DDNATV_ROOT" to root.path, + "LD_LIBRARY_PATH" to libraryPath(root), + "LD_PRELOAD" to (preload.map { File(root, it.removePrefix("/")).path } + hook(root).path).joinToString(":"), + ) + + /** + * The host command line for the guest program at [program] (an absolute guest path to a real + * file, not a symlink). + */ + fun command(root: File, program: String, args: List): List { + val loader = checkNotNull(loader(root)) { "no glibc loader in ${root.path}" } + val host = File(root, program.removePrefix("/")) + val launch = listOf(loader.path, "--argv0", host.name, host.path) + args + return simulator(root)?.let { it + launch } ?: launch + } + + /** The environment of the session process: the hook's root, the mounts proot used to make, the preload list. */ + fun sessionEnvironment(root: File, binds: List, hostname: String? = null): Map { + val preload = preloadList(root) + return linkedMapOf( + "DDNATV_ROOT" to root.path, + "DDNATV_HOSTNAME" to hostname.orEmpty(), + "DDNATV_BINDS" to binds.joinToString("|") { if (it.contains(':')) it else "$it:$it" }, + "DDNATV_PRELOAD" to preload.joinToString(":"), + "LD_LIBRARY_PATH" to libraryPath(root), + "LD_PRELOAD" to (preload.map { File(root, it.removePrefix("/")).path } + hook(root).path).joinToString(":"), + ).filterValues { it.isNotEmpty() } + } + + /** Where guest directory [cwd] is, through the session's mounts ([binds], "src:dst"); the rootfs if it is nowhere. */ + fun workingDirectory(root: File, binds: List, cwd: String): File = + File(BwrapSpawner.hostPath(binds.map { BwrapSpawner.Bind.parse(it) }, root.path, cwd)).takeIf { it.isDirectory } ?: root + + /** A process for [guest] (argv) started as proot would with [binds], in guest directory [cwd]. */ + fun processBuilder(context: Context, root: File, binds: List, guest: List, cwd: String = "/root"): ProcessBuilder = + ProcessBuilder(command(root, guest.first(), guest.drop(1))) + .directory(workingDirectory(root, binds, cwd)) + .also { builder -> + builder.environment().apply { + remove("LD_AUDIT") + putAll(sessionEnvironment(root, binds, SessionPrefs.guestHostname(context))) + } + } + + private const val RUNPATH_CONF = "etc/ld.so.conf.d/zz-droiddeck-native.conf" + private val SCAN_DIRS = listOf("usr/lib", "usr/local/lib", "opt") + + /** + * ld.so opens the absolute RUNPATH directories of a library itself, with system calls the hook + * cannot translate, so every one of them is also listed in ld.so.conf (which the hook maps). + * Rescanned when dpkg's state or a library directory changes. + */ + fun syncLibraryDirs(root: File) { + val conf = File(root, RUNPATH_CONF) + val signature = (listOf("var/lib/dpkg/status", "usr/lib", "usr/local/lib", "usr/lib/aarch64-linux-gnu") + .joinToString(",") { File(root, it).lastModified().toString() }) + "," + conf.parentFile.list()?.size + val stamp = File(root, "etc/droiddeck/native-runpath-signature") + if (conf.isFile && stamp.isFile && stamp.readText() == signature) return + val dirs = sortedSetOf() + for (name in SCAN_DIRS) File(root, name).walkTopDown().maxDepth(6) + .onEnter { !Files.isSymbolicLink(it.toPath()) } + .filter { it.isFile && !Files.isSymbolicLink(it.toPath()) && ".so" in it.name } + .forEach { file -> runCatching { ElfRunpath.read(file) }.getOrNull()?.let { dirs.addAll(it) } } + val kept = dirs.filter { it.startsWith("/usr") || it.startsWith("/lib") || it.startsWith("/opt") } + conf.parentFile?.mkdirs() + conf.writeText(kept.joinToString("\n", postfix = "\n")) + stamp.parentFile?.mkdirs() + stamp.writeText(signature) + } + + /** What a rootfs needs before anything runs in it natively; cheap once done. */ + fun prepare(context: Context, root: File) { + val relinked = relinkAbsoluteSymlinks(context, root) + if (relinked > 0) android.util.Log.i(TAG, "native userland: $relinked absolute symlinks made relative") + val patched = patchForSeccomp(root) + if (patched > 0) android.util.Log.i(TAG, "native userland: $patched system call sites in ld.so and libc answer Android's blocked calls") + syncLibraryDirs(root) + } + + /** See [ElfSeccompPatch]: the linker and libc must survive Android's seccomp filter before the hook loads. */ + fun patchForSeccomp(root: File): Int = + listOf("usr/lib/ld-linux-aarch64.so.1", "usr/lib/aarch64-linux-gnu/ld-linux-aarch64.so.1", + "usr/lib/aarch64-linux-gnu/libc.so.6", "usr/lib/libc.so.6") + .map { File(root, it) }.filter { it.exists() } + .distinctBy { it.canonicalPath }.sumOf { file -> + runCatching { ElfSeccompPatch.patchFile(file) }.getOrElse { + android.util.Log.e(TAG, "native userland: could not patch $file for Android's seccomp filter; programs will die with SIGSYS", it) + 0 + } + } + + private val HOST_LINK_TARGETS = listOf("/proc", "/dev", "/sys", "/sdcard", "/storage", "/data", "/system", "/vendor", "/apex", + "/system_ext", "/product", "/odm", "/linkerconfig", "/mnt") + + /** + * Symbolic links the kernel follows by itself (ld.so, Steam, anything that skips the hook) read + * their absolute target on Android's own filesystem. The image's links were made for proot, + * which reads the target inside the rootfs, so each is rewritten as a relative link, which + * resolves the same way under proot and without it. Rerun when the runtime changes. + */ + fun relinkAbsoluteSymlinks(context: Context, root: File): Int { + val stamp = File(root, "etc/droiddeck/native-symlinks") + val version = com.droiddeck.launcher.runtime.LinuxRuntimeInstaller.installedVersion(context).orEmpty() + "/2" + if (stamp.isFile && stamp.readText() == version) return 0 + val rootPath = root.toPath() + var rewritten = 0 + Files.walkFileTree(rootPath, object : java.nio.file.SimpleFileVisitor() { + override fun visitFile(file: java.nio.file.Path, attrs: java.nio.file.attribute.BasicFileAttributes): java.nio.file.FileVisitResult { + if (attrs.isSymbolicLink) { + try { + val target = Files.readSymbolicLink(file).toString() + if (target.startsWith("/") && HOST_LINK_TARGETS.none { target == it || target.startsWith("$it/") } + && !target.startsWith(root.path)) { + val relative = file.parent.relativize(rootPath.resolve(target.removePrefix("/"))) + val temp = file.resolveSibling(".relink-" + file.fileName) + Files.deleteIfExists(temp) + Files.createSymbolicLink(temp, relative) + Files.move(temp, file, java.nio.file.StandardCopyOption.REPLACE_EXISTING) + rewritten++ + } + } catch (_: java.io.IOException) { + } + } + return java.nio.file.FileVisitResult.CONTINUE + } + + override fun visitFileFailed(file: java.nio.file.Path, exc: java.io.IOException) = java.nio.file.FileVisitResult.CONTINUE + }) + stamp.parentFile?.mkdirs() + stamp.writeText(version) + return rewritten + } + + /** + * The guest path that host path [target] stands for in a session with [binds] ("src:dst"), or null + * when it is a guest path already: the rootfs, or the longest mount source holding it (the first + * such mount when several share a source). + */ + fun guestLinkTarget(target: String, root: String, binds: List): String? { + if (!target.startsWith("/")) return null + fun under(path: String, dir: String) = path == dir || path.startsWith("$dir/") + var best: Pair? = if (under(target, root)) root to "/" else null + for (spec in binds) { + val colon = spec.indexOf(':') + if (colon < 0) continue + val src = spec.substring(0, colon).trimEnd('/') + val dst = spec.substring(colon + 1).trimEnd('/').ifEmpty { "/" } + if (src.isEmpty() || src == dst || !under(target, src)) continue + if (best == null || src.length > best.first.length) best = src to dst + } + val (src, dst) = best ?: return null + val rest = target.removePrefix(src) + return if (rest.isEmpty()) dst else dst.trimEnd('/') + rest + } + + /** + * Wine prefixes' drive links (dosdevices) hold guest paths ("s:" -> /mnt/droiddeck-sd), which + * proot follows and the hook follows inside a mount. Earlier native sessions made them point at + * their real places, which proot cannot see: those are given their guest paths back. + */ + fun relinkPrefixDrives(root: File, binds: List): Int { + val compatdata = listOf(File(root, "root/.local/share/Steam/steamapps/compatdata")) + binds.mapNotNull { spec -> + val colon = spec.indexOf(':') + if (colon > 0 && spec.substring(colon + 1).trimEnd('/').endsWith("/steamapps/compatdata")) File(spec.substring(0, colon)) else null + } + var rewritten = 0 + for (prefix in compatdata.distinct().flatMap { it.listFiles()?.toList().orEmpty() }) { + val devices = File(prefix, "pfx/dosdevices").toPath() + val links = try { + Files.newDirectoryStream(devices).use { it.toList() } + } catch (e: java.nio.file.NoSuchFileException) { + continue + } catch (e: java.io.IOException) { + android.util.Log.w(TAG, "native userland: could not read the drive links of $prefix", e) + continue + } catch (e: java.nio.file.DirectoryIteratorException) { + android.util.Log.w(TAG, "native userland: could not read the drive links of $prefix", e) + continue + } + for (link in links) { + try { + if (!Files.isSymbolicLink(link)) continue + val guest = guestLinkTarget(Files.readSymbolicLink(link).toString(), root.path, binds) ?: continue + val temp = link.resolveSibling(".relink-" + link.fileName) + Files.deleteIfExists(temp) + Files.createSymbolicLink(temp, java.nio.file.Paths.get(guest)) + Files.move(temp, link, java.nio.file.StandardCopyOption.REPLACE_EXISTING) + rewritten++ + } catch (_: java.io.IOException) { + } + } + } + return rewritten + } + + fun builder(root: File, cwd: String, argv: List, env: Map, preload: List = emptyList()): ProcessBuilder { + val program = argv.first() + val cmd = command(root, program, argv.drop(1)) + val builder = ProcessBuilder(cmd).redirectErrorStream(false) + builder.directory(File(root, cwd.removePrefix("/")).takeIf { it.isDirectory } ?: root) + builder.environment().apply { + clear() + putAll(environment(root, preload)) + putAll(env) + } + return builder + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/runtime/ProotFastPath.kt b/app/src/main/java/com/droiddeck/launcher/runtime/ProotFastPath.kt index e9a9f4a72e..11265bd8ae 100644 --- a/app/src/main/java/com/droiddeck/launcher/runtime/ProotFastPath.kt +++ b/app/src/main/java/com/droiddeck/launcher/runtime/ProotFastPath.kt @@ -12,15 +12,16 @@ object ProotFastPath { const val LIBRARY = "/usr/local/lib/libblfastpath.so" const val MAX_BINDS = 256 - fun allows(preference: Boolean, noSeccomp: Boolean, source: String): Boolean = - preference && !noSeccomp && source == LinuxRuntime.PROOT_PACK + fun allows(preference: Boolean, noSeccomp: Boolean, source: String, nativeUserland: Boolean = false): Boolean = + preference && !noSeccomp && !nativeUserland && source == LinuxRuntime.PROOT_PACK fun enabled(context: Context): Boolean { val preference = SessionPrefs.prootFastPath(context) val noSeccomp = SessionPrefs.prootNoSeccomp(context) + val nativeUserland = SessionPrefs.nativeUserland(context) val source = LinuxRuntime.prootSource(context) - val on = allows(preference, noSeccomp, source) - if (preference && !noSeccomp && !on) + val on = allows(preference, noSeccomp, source, nativeUserland) + if (preference && !noSeccomp && !nativeUserland && !on) Log.i(TAG, "proot: fast path off - binary is $source, not the patched proot") return on } diff --git a/app/src/main/java/com/droiddeck/launcher/runtime/RootSpawner.kt b/app/src/main/java/com/droiddeck/launcher/runtime/RootSpawner.kt index 1138bab0de..16228be728 100644 --- a/app/src/main/java/com/droiddeck/launcher/runtime/RootSpawner.kt +++ b/app/src/main/java/com/droiddeck/launcher/runtime/RootSpawner.kt @@ -113,20 +113,25 @@ object RootSpawner { val argv = request.getJSONArray("argv").let { a -> (0 until a.length()).map { a.getString(it) } } if (argv.isEmpty()) throw IOException("no command") val cwd = request.optString("cwd", "/root").ifEmpty { "/root" } - val cmd = LinuxRuntime.prootPrefix(context, root, cwd, true) - cmd.add(1, "--link2symlink") - LinuxRuntime.lastBinds(context).filterNot { it.startsWith("/proc/self/fd/") }.forEach { cmd.add("-b"); cmd.add(it) } - cmd.add("/usr/bin/env") - cmd.add("-i") - request.optJSONObject("env")?.let { e -> e.keys().forEach { k -> cmd.add("$k=${e.getString(k)}") } } - cmd.addAll(argv) - val builder = ProcessBuilder(cmd).directory(root) - builder.environment().apply { - clear() - put("PROOT_LOADER", LinuxRuntime.prootLoader(context).path) - put("PROOT_TMP_DIR", LinuxRuntime.prootTempDir(context).path) - if (SessionPrefs.prootNoSeccomp(context)) put("PROOT_NO_SECCOMP", "1") - LinuxRuntime.prootLibraryPath(context).takeIf { it.isNotEmpty() }?.let { put("LD_LIBRARY_PATH", it) } + val binds = LinuxRuntime.lastBinds(context).filterNot { it.startsWith("/proc/self/fd/") } + val guest = mutableListOf("/usr/bin/env", "-i") + request.optJSONObject("env")?.let { e -> e.keys().forEach { k -> guest.add("$k=${e.getString(k)}") } } + guest.addAll(argv) + val builder = if (NativeGuest.forSession(context)) { + NativeGuest.processBuilder(context, root, binds, guest, cwd) + } else { + val cmd = LinuxRuntime.rootPrefix(context, root, cwd) + binds.forEach { cmd.add("-b"); cmd.add(it) } + cmd.addAll(guest) + ProcessBuilder(cmd).directory(root).also { b -> + b.environment().apply { + clear() + put("PROOT_LOADER", LinuxRuntime.prootLoader(context).path) + put("PROOT_TMP_DIR", LinuxRuntime.prootTempDir(context).path) + if (SessionPrefs.prootNoSeccomp(context)) put("PROOT_NO_SECCOMP", "1") + LinuxRuntime.prootLibraryPath(context).takeIf { it.isNotEmpty() }?.let { put("LD_LIBRARY_PATH", it) } + } + } } val streams = listOf(stdio(fds.getOrNull(0), false), stdio(fds.getOrNull(1), true), stdio(fds.getOrNull(2), true)) try { diff --git a/app/src/main/java/com/droiddeck/launcher/session/BatteryComponent.kt b/app/src/main/java/com/droiddeck/launcher/session/BatteryComponent.kt index ef64bfde02..77223a9666 100644 --- a/app/src/main/java/com/droiddeck/launcher/session/BatteryComponent.kt +++ b/app/src/main/java/com/droiddeck/launcher/session/BatteryComponent.kt @@ -11,6 +11,8 @@ import kotlin.math.abs class BatteryComponent(val dir: File, private val vpowerDir: File) : SessionPart() { @Volatile private var running = false private var thread: Thread? = null + private val runtimeEstimator = BatteryRuntimeEstimator() + private var lastDischarging: Boolean? = null override fun start() { File(dir, "BAT0").deleteRecursively() @@ -49,11 +51,17 @@ class BatteryComponent(val dir: File, private val vpowerDir: File) : SessionPart val currentAvgUa = toMicroamps(bm?.getLongProperty(BatteryManager.BATTERY_PROPERTY_CURRENT_AVERAGE)?.takeIf { it != Long.MIN_VALUE && it != 0L } ?: 0L) .takeIf { it != 0L } ?: currentNowUa val discharging = status == BatteryManager.BATTERY_STATUS_DISCHARGING || status == BatteryManager.BATTERY_STATUS_NOT_CHARGING + if (lastDischarging != null && lastDischarging != discharging) runtimeEstimator.reset() + lastDischarging = discharging + val currentForRuntimeUa = currentNowUa.takeIf { it != 0L } ?: currentAvgUa val chargeFullUah = if (chargeNowUah > 0 && pct > 0) chargeNowUah * 100 / pct else 0L val energyNowUwh = chargeNowUah * voltageUv / 1_000_000L val energyFullUwh = chargeFullUah * voltageUv / 1_000_000L val powerNowUw = abs(currentNowUa) * voltageUv / 1_000_000L - val timeToEmptyS = if (discharging && chargeNowUah > 0 && abs(currentAvgUa) > 0) chargeNowUah * 3600L / abs(currentAvgUa) else 0L + val runtimeHours = if (discharging) + runtimeEstimator.estimateHours(chargeNowUah.toDouble(), currentForRuntimeUa.toDouble()) + else null + val timeToEmptyS = BatteryRuntimeEstimator.secondsFromHours(runtimeHours) val charging = status == BatteryManager.BATTERY_STATUS_CHARGING val timeToFullS = if (charging && chargeFullUah > chargeNowUah && abs(currentAvgUa) > 0) (chargeFullUah - chargeNowUah) * 3600L / abs(currentAvgUa) else 0L val statusText = when (status) { @@ -126,9 +134,7 @@ class BatteryComponent(val dir: File, private val vpowerDir: File) : SessionPart companion object { private const val TAG = "SessionService" - private const val MILLIAMP_CEILING = 10_000L - - internal fun toMicroamps(raw: Long): Long = if (abs(raw) < MILLIAMP_CEILING) raw * 1000L else raw + internal fun toMicroamps(raw: Long): Long = BatteryRuntimeEstimator.toMicroamps(raw) private const val PERIOD_MS = 5_000L private val VPOWER_FILES = listOf( "ac_status", "battery_percent", "battery_status", diff --git a/app/src/main/java/com/droiddeck/launcher/session/BatteryRuntimeEstimator.kt b/app/src/main/java/com/droiddeck/launcher/session/BatteryRuntimeEstimator.kt new file mode 100644 index 0000000000..624ce9d7b9 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/session/BatteryRuntimeEstimator.kt @@ -0,0 +1,74 @@ +package com.droiddeck.launcher.session + +import java.util.ArrayDeque +import kotlin.math.abs +import kotlin.math.roundToLong + +class BatteryRuntimeEstimator { + private val currentSamples = ArrayDeque() + + @Synchronized + fun reset() { + currentSamples.clear() + } + + @Synchronized + fun estimateHours(chargeNowUah: Double, currentSampleUa: Double): Double? { + if (currentSampleUa.isFinite() && currentSampleUa != 0.0) { + currentSamples.addLast(abs(currentSampleUa)) + while (currentSamples.size > MAX_SAMPLES) currentSamples.removeFirst() + } + if (!chargeNowUah.isFinite() || chargeNowUah <= 0.0 || currentSamples.isEmpty()) return null + var sum = 0.0 + for (sample in currentSamples) sum += sample + val averageCurrentUa = sum / currentSamples.size + if (!averageCurrentUa.isFinite() || averageCurrentUa <= 0.0) return null + val hours = chargeNowUah / averageCurrentUa + return hours.takeIf { it.isFinite() && it > 0.0 } + } + + companion object { + private const val MAX_SAMPLES = 25 + private const val MILLIAMP_CEILING = 10_000L + + @JvmStatic + fun toMicroamps(raw: Long): Long { + if (raw == Long.MIN_VALUE) return 0L + return if (abs(raw) < MILLIAMP_CEILING) raw * 1_000L else raw + } + + @JvmStatic + fun chargeMicroampHoursFromEnergy(energyUwh: Double, voltageUv: Double): Double? { + if (!energyUwh.isFinite() || energyUwh <= 0.0 || !voltageUv.isFinite() || voltageUv <= 0.0) return null + return (energyUwh * 1_000_000.0 / voltageUv).takeIf { it.isFinite() && it > 0.0 } + } + + @JvmStatic + fun currentMicroampsFromPower(powerUw: Double, voltageUv: Double): Double? { + if (!powerUw.isFinite() || voltageUv <= 0.0 || !voltageUv.isFinite()) return null + return (abs(powerUw) * 1_000_000.0 / voltageUv).takeIf { it.isFinite() && it > 0.0 } + } + + @JvmStatic + fun secondsFromHours(hours: Double?): Long { + if (hours == null || !hours.isFinite() || hours <= 0.0) return 0L + val seconds = hours * 3_600.0 + return if (seconds.isFinite() && seconds < Long.MAX_VALUE.toDouble()) seconds.toLong() else 0L + } + + @JvmStatic + fun formatDuration(hours: Double?): String? { + if (hours == null || !hours.isFinite() || hours <= 0.0) return null + val totalMinutes = (hours * 60.0).roundToLong().coerceAtLeast(1L) + val wholeHours = totalMinutes / 60L + val minutes = totalMinutes % 60L + val hourUnit = if (wholeHours == 1L) "hr" else "hrs" + val minuteUnit = if (minutes == 1L) "min" else "mins" + return when { + wholeHours > 0L && minutes > 0L -> "$wholeHours $hourUnit $minutes $minuteUnit" + wholeHours > 0L -> "$wholeHours $hourUnit" + else -> "$minutes $minuteUnit" + } + } + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/session/BootMovie.kt b/app/src/main/java/com/droiddeck/launcher/session/BootMovie.kt index a525bed375..148766436c 100644 --- a/app/src/main/java/com/droiddeck/launcher/session/BootMovie.kt +++ b/app/src/main/java/com/droiddeck/launcher/session/BootMovie.kt @@ -15,6 +15,7 @@ object BootMovie { const val DROIDDECK_30 = "dd30" const val DROIDDECK_60 = "dd60" const val CUSTOM = "custom" + private const val SKIP = "skip" const val MAX_BYTES = 50L shl 20 const val MAX_CONVERT_SECONDS = 60 val PICKER_EXTENSIONS = listOf("webm", "mkv", "mp4", "mov", "m4v", "3gp") @@ -22,6 +23,7 @@ object BootMovie { private val ASSETS = mapOf( DROIDDECK_30 to "droiddeck-startup.webm", DROIDDECK_60 to "droiddeck-startup-60.webm", + SKIP to "skip-startup.webm", ) internal val VIDEO_CODECS = setOf(MediaFormat.MIMETYPE_VIDEO_VP8, MediaFormat.MIMETYPE_VIDEO_VP9, MediaFormat.MIMETYPE_VIDEO_AV1) @@ -74,6 +76,7 @@ object BootMovie { fun prepare(context: Context): File? { BootMovieLibrary.restore(context) + if (SessionPrefs.skipBootMovie(context)) return assetFile(context, SKIP) val source = sourceOf(context, choice(context)) ?: return null return variant(context, source) } diff --git a/app/src/main/java/com/droiddeck/launcher/session/BootMovieReport.kt b/app/src/main/java/com/droiddeck/launcher/session/BootMovieReport.kt index 18ff31169d..b82dad26d2 100644 --- a/app/src/main/java/com/droiddeck/launcher/session/BootMovieReport.kt +++ b/app/src/main/java/com/droiddeck/launcher/session/BootMovieReport.kt @@ -67,7 +67,7 @@ object BootMovieReport { line("== DroidDeck state") line("choice=${BootMovie.choice(context)} saved choice=${SessionPrefs.bootMovie(context)} pending pick=${SessionPrefs.bootMovieApplyNext(context)}") line("last Steam path seen=${SessionPrefs.bootMovieSteamSeen(context)}") - line("sound=${SessionPrefs.bootMovieSound(context)} volume=${SessionPrefs.bootMovieVolume(context)} seconds=${SessionPrefs.bootMovieSeconds(context)}") + line("sound=${SessionPrefs.bootMovieSound(context)} volume=${SessionPrefs.bootMovieVolume(context)} seconds=${SessionPrefs.bootMovieSeconds(context)} skip=${SessionPrefs.skipBootMovie(context)}") line("session running=${SessionState.running}") line() line("== The movie list as shown") diff --git a/app/src/main/java/com/droiddeck/launcher/session/BottomDesktop.kt b/app/src/main/java/com/droiddeck/launcher/session/BottomDesktop.kt index 36b9c3dfdc..10d031715b 100644 --- a/app/src/main/java/com/droiddeck/launcher/session/BottomDesktop.kt +++ b/app/src/main/java/com/droiddeck/launcher/session/BottomDesktop.kt @@ -39,6 +39,7 @@ object BottomDesktop { val sessionDir: File, val generation: Int, val installed: Boolean, + val nativeUserland: Boolean, ) @Volatile private var launch: Launch? = null @@ -89,10 +90,11 @@ object BottomDesktop { root: File, sessionDir: File, generation: Int, + nativeUserland: Boolean, stillCurrent: () -> Boolean, ) { val prepared = Launch(ArrayList(guest), ArrayList(binds), sessionRoot, hostEnvironment.copyOf(), root, sessionDir, generation, - DesktopCatalog.desktopInstalled(root)) + DesktopCatalog.desktopInstalled(root), nativeUserland) synchronized(launchLock) { if (stillCurrent()) launch = prepared } } @@ -320,9 +322,17 @@ object BottomDesktop { add("BL_IME_DIR=" + imeDir.path) add(SCRIPT) } - val command = LinuxRuntime.commandWithBinds(context, current.root, binds, guest) + val command = if (current.nativeUserland) { + com.droiddeck.launcher.runtime.NativeGuest.command(current.root, guest.first(), guest.drop(1)) + } else { + LinuxRuntime.commandWithBinds(context, current.root, binds, guest) + } + val environment = if (current.nativeUserland) { + com.droiddeck.launcher.runtime.NativeGuest.sessionEnvironment(current.root, binds, SessionPrefs.guestHostname(context)) + .map { (k, v) -> "$k=$v" }.toTypedArray() + } else current.hostEnvironment val line = command.joinToString(" ") { it.replace("\\", "\\\\").replace(" ", "\\ ") } - val pid = HostProcess.start(line, current.hostEnvironment, current.root, { status -> + val pid = HostProcess.start(line, environment, current.root, { status -> main.post { if (generation != guestGeneration) return@post Log.i(TAG, "the desktop ended ($status)") diff --git a/app/src/main/java/com/droiddeck/launcher/session/BrowserHandoff.kt b/app/src/main/java/com/droiddeck/launcher/session/BrowserHandoff.kt new file mode 100644 index 0000000000..062afbfc78 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/session/BrowserHandoff.kt @@ -0,0 +1,26 @@ +package com.droiddeck.launcher.session + +internal class BrowserHandoff(private val timeoutMs: Long) { + private var startedAt = -1L + private var sessionLeft = false + + fun begin(now: Long) { + startedAt = now + sessionLeft = false + } + + fun sessionHidden() { + if (startedAt >= 0) sessionLeft = true + } + + fun sessionShown() { + if (sessionLeft) clear() + } + + fun clear() { + startedAt = -1L + sessionLeft = false + } + + fun active(now: Long): Boolean = startedAt >= 0 && now - startedAt < timeoutMs +} diff --git a/app/src/main/java/com/droiddeck/launcher/session/BuildWatermarkSetting.kt b/app/src/main/java/com/droiddeck/launcher/session/BuildWatermarkSetting.kt new file mode 100644 index 0000000000..98239f8eb0 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/session/BuildWatermarkSetting.kt @@ -0,0 +1,44 @@ +package com.droiddeck.launcher.session + +import android.content.Context +import android.content.Intent +import android.util.AtomicFile +import java.io.File + +internal object BuildWatermarkSetting { + const val CHANGED = "com.droiddeck.launcher.BUILD_WATERMARK_CHANGED" + + private fun file(context: Context) = AtomicFile(File(context.filesDir, "build-watermark")) + + private val processLock = Any() + + private fun locked(context: Context, action: () -> T): T = synchronized(processLock) { + File(context.filesDir, "build-watermark.lock").outputStream().channel.use { channel -> + channel.lock().use { action() } + } + } + + fun enabled(context: Context): Boolean = try { + locked(context) { + // SharedPreferences caches are process-local; read the shared file on every refresh. + file(context).readFully().decodeToString() != "off" + } + } catch (_: java.io.IOException) { + context.getSharedPreferences("session", Context.MODE_PRIVATE).getBoolean("buildWatermark", true) + } + + fun setEnabled(context: Context, on: Boolean) { + locked(context) { + val target = file(context) + val stream = target.startWrite() + try { + stream.write((if (on) "on" else "off").toByteArray()) + target.finishWrite(stream) + } catch (error: Throwable) { + target.failWrite(stream) + throw error + } + } + context.sendBroadcast(Intent(CHANGED).setPackage(context.packageName)) + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/session/GameEnvironmentStore.kt b/app/src/main/java/com/droiddeck/launcher/session/GameEnvironmentStore.kt index 2a19f39abc..81dc109d67 100644 --- a/app/src/main/java/com/droiddeck/launcher/session/GameEnvironmentStore.kt +++ b/app/src/main/java/com/droiddeck/launcher/session/GameEnvironmentStore.kt @@ -79,6 +79,13 @@ object GameEnvironmentStore { return config } + @Synchronized + fun setGameResolution(context: Context, scope: String, choice: com.droiddeck.launcher.core.GameResolution.Choice?): GameEnvironment.Config { + val config = GameEnvironment.withGameResolution(read(context), scope, choice) + save(context, config) + return config + } + @Synchronized fun setDefault(context: Context, scope: String, name: String, value: String): Boolean { val config = read(context) diff --git a/app/src/main/java/com/droiddeck/launcher/session/GameStorage.kt b/app/src/main/java/com/droiddeck/launcher/session/GameStorage.kt index 5bf25103b0..e9ecb7443c 100644 --- a/app/src/main/java/com/droiddeck/launcher/session/GameStorage.kt +++ b/app/src/main/java/com/droiddeck/launcher/session/GameStorage.kt @@ -90,11 +90,11 @@ object GameStorage { fun gamesFolderLibraries(context: Context): List { if (SessionPrefs.gameStorage(context).isNotEmpty()) return emptyList() - val card = effective(context)?.let { canonical(File(it.path)) } - val added = SteamLibraries.list(context).map { canonical(it.host) } + val card = effective(context)?.let { SteamLibraries.canonical(File(it.path)) } + val added = SteamLibraries.list(context).map { SteamLibraries.canonical(it.host) } val sm = context.getSystemService(StorageManager::class.java) return AddedGames.roots(context).mapNotNull { root -> - val host = canonical(root.host) + val host = SteamLibraries.canonical(root.host) if (!hasInstalledGames(root.host)) return@mapNotNull null if ('"' in root.guest || '\\' in root.guest || !root.host.isDirectory || !root.host.canWrite()) return@mapNotNull null if (card != null && (host == card || host.startsWith("$card/") || card.startsWith("$host/"))) return@mapNotNull null @@ -109,8 +109,6 @@ object GameStorage { internal fun hasInstalledGames(root: File): Boolean = File(root, "steamapps").listFiles { f -> f.isFile && f.name.startsWith("appmanifest_") && f.name.endsWith(".acf") }?.isNotEmpty() == true - private fun canonical(file: File): String = runCatching { file.canonicalPath }.getOrDefault(file.absolutePath) - fun labelFor(context: Context, path: String): String = options(context).firstOrNull { it.path == path }?.name ?: File(path).name.ifEmpty { context.getString(R.string.gstore_folder) } diff --git a/app/src/main/java/com/droiddeck/launcher/session/NoSteamLaunch.kt b/app/src/main/java/com/droiddeck/launcher/session/NoSteamLaunch.kt index 8d8070f875..5541507a10 100644 --- a/app/src/main/java/com/droiddeck/launcher/session/NoSteamLaunch.kt +++ b/app/src/main/java/com/droiddeck/launcher/session/NoSteamLaunch.kt @@ -30,9 +30,33 @@ object NoSteamLaunch { GameEnvironment.gameNoSteam(GameEnvironmentStore.read(context), (appId and 0xFFFFFFFFL).toString()) }.getOrDefault(false) + fun scopeOf(program: String?, args: List, battleNetTitle: (String) -> String? = { null }): String? = when (program) { + EPIC -> EpicClient.shortcutAppId.toString() + BATTLENET -> args.getOrNull(args.indexOf("launch") + 1)?.takeIf { args.contains("launch") }?.let(battleNetTitle) + ?: com.droiddeck.launcher.runtime.BattleNet.APP_ID.toString() + PROTON_RUN -> args.getOrNull(args.indexOf("--app") + 1)?.takeIf { args.contains("--app") } + else -> null + }?.takeIf { it.isNotEmpty() && GameEnvironment.validScope(it) } + + fun battleNetTitleScope(context: Context, code: String): String? = + AddedGames.scan(context).firstOrNull { game -> + game.source == com.droiddeck.launcher.stores.Store.BATTLENET.id && + game.storeId?.let(com.droiddeck.launcher.runtime.BattleNet::title)?.code == code + }?.let { settingsId(it).toString() } + + fun resolution(config: GameEnvironment.Config, scope: String?, output: Pair): Pair? { + val choice = scope?.let { GameEnvironment.gameResolution(config, it) } ?: return null + return com.droiddeck.launcher.core.GameResolution.resolve(choice, output) + } + + fun needsAddedGame(game: Library.SteamGame): Boolean = game.library == Library.ADDED && !viaBattleNet(game) + + private fun viaBattleNet(game: Library.SteamGame): Boolean = + game.library == Library.ADDED && game.source == com.droiddeck.launcher.stores.Store.BATTLENET.id + fun command(game: Library.SteamGame, added: AddedGames.Game?): Command? = when { game.library == Library.EPIC_LAUNCHER -> Command(EPIC, listOf("run"), game.name) - game.library == Library.ADDED && game.source == com.droiddeck.launcher.stores.Store.BATTLENET.id -> + viaBattleNet(game) -> game.storeId?.let(com.droiddeck.launcher.runtime.BattleNet::title)?.let { Command(BATTLENET, listOf("launch", it.code), game.name) } game.library == Library.ADDED -> added?.let { a -> a.steamAppId?.let { Command(PROTON_RUN, listOf("--app", it.toString()), a.name) } ?: addedCommand(a) } game.appId > 0 -> Command(PROTON_RUN, listOf("--app", game.appId.toString()), game.name) @@ -51,7 +75,7 @@ object NoSteamLaunch { fun addedGame(context: Context, game: Library.SteamGame): AddedGames.Game? { val id = game.appId.toLong() and 0xFFFFFFFFL - val one = game.gameFiles?.let { AddedGames.single(context, it.path) } + val one = game.gameFiles?.let { AddedGames.single(context, it.path, reuse = true) } return one?.takeIf { settingsId(it) == id } ?: AddedGames.scan(context).firstOrNull { settingsId(it) == id } } diff --git a/app/src/main/java/com/droiddeck/launcher/session/OrphanReaper.kt b/app/src/main/java/com/droiddeck/launcher/session/OrphanReaper.kt index cbcd904bc1..a6c5117665 100644 --- a/app/src/main/java/com/droiddeck/launcher/session/OrphanReaper.kt +++ b/app/src/main/java/com/droiddeck/launcher/session/OrphanReaper.kt @@ -11,6 +11,9 @@ object OrphanReaper { fun release(pid: Int) { kept.remove(pid) } + /** Kept processes and everything they started, which session cleanups must leave running. */ + fun spared(): Set = descendants(kept) + fun hasOtherProcesses(): Boolean = hasOtherProcesses( File("/proc").list()?.mapNotNull { it.toIntOrNull() }, android.os.Process.myPid(), ) { pid -> @@ -30,7 +33,7 @@ object OrphanReaper { fun reap(reason: String, matching: (String) -> Boolean = { true }): Int { val me = android.os.Process.myPid() val uid = android.os.Process.myUid() - val spared = descendants(kept) + val spared = spared() var killed = 0 File("/proc").listFiles()?.forEach { entry -> val pid = entry.name.toIntOrNull() ?: return@forEach diff --git a/app/src/main/java/com/droiddeck/launcher/session/ProtonExtras.kt b/app/src/main/java/com/droiddeck/launcher/session/ProtonExtras.kt index d17d40df48..94334f4dc9 100644 --- a/app/src/main/java/com/droiddeck/launcher/session/ProtonExtras.kt +++ b/app/src/main/java/com/droiddeck/launcher/session/ProtonExtras.kt @@ -283,14 +283,20 @@ object ProtonExtras { "LANG=C.UTF-8", "XDG_DATA_HOME=/root/.local/share", "/usr/local/bin/droiddeck-proton-extra", "/root/.local/share/Steam", archive.absolutePath, ) - val command = LinuxRuntime.command(context, null, runtimeDir, null, guest) - val process = ProcessBuilder(command) - .directory(root) - .redirectErrorStream(true) - val hostEnv = process.environment() - hostEnv["PROOT_LOADER"] = LinuxRuntime.prootLoader(context).path - hostEnv["PROOT_TMP_DIR"] = LinuxRuntime.prootTempDir(context).path - LinuxRuntime.prootLibraryPath(context).takeIf { it.isNotEmpty() }?.let { hostEnv["LD_LIBRARY_PATH"] = it } + val process = if (com.droiddeck.launcher.runtime.NativeGuest.enabled(context)) { + com.droiddeck.launcher.runtime.NativeGuest.processBuilder(context, root, + LinuxRuntime.binds(context, null, runtimeDir, null, null), guest).redirectErrorStream(true) + } else { + ProcessBuilder(LinuxRuntime.command(context, null, runtimeDir, null, guest)) + .directory(root) + .redirectErrorStream(true) + .also { builder -> + val hostEnv = builder.environment() + hostEnv["PROOT_LOADER"] = LinuxRuntime.prootLoader(context).path + hostEnv["PROOT_TMP_DIR"] = LinuxRuntime.prootTempDir(context).path + LinuxRuntime.prootLibraryPath(context).takeIf { it.isNotEmpty() }?.let { hostEnv["LD_LIBRARY_PATH"] = it } + } + } val child = process.start() var placed: String? = null child.inputStream.bufferedReader().useLines { lines -> diff --git a/app/src/main/java/com/droiddeck/launcher/session/SelectedGameProfile.kt b/app/src/main/java/com/droiddeck/launcher/session/SelectedGameProfile.kt index 41eeac38f6..c3df4a97c4 100644 --- a/app/src/main/java/com/droiddeck/launcher/session/SelectedGameProfile.kt +++ b/app/src/main/java/com/droiddeck/launcher/session/SelectedGameProfile.kt @@ -3,6 +3,7 @@ package com.droiddeck.launcher.session import com.droiddeck.launcher.core.FexPreset import com.droiddeck.launcher.core.GameEnvironment import com.droiddeck.launcher.frontend.Library +import com.droiddeck.launcher.gpu.FrameGen data class ProfileValue(val value: String, val inherited: Boolean) @@ -17,6 +18,8 @@ data class SelectedGameProfile( val environmentOverrides: Int, val windowsComponentNames: List, val startWithoutSteam: Boolean = false, + val frameGen: FrameGen.Mode = FrameGen.Mode.OFF, + val frameGenInherited: Boolean = true, ) { val hasOverrides: Boolean get() = !fexPreset.inherited || @@ -24,7 +27,8 @@ data class SelectedGameProfile( components.values.any { !it.inherited } || environmentOverrides > 0 || windowsComponentNames.isNotEmpty() || - startWithoutSteam + startWithoutSteam || + !frameGenInherited companion object { fun resolve( @@ -38,6 +42,8 @@ data class SelectedGameProfile( gameProtonId: String?, gameComponents: Map, gameWindowsComponents: List, + frameGenMode: FrameGen.Mode = FrameGen.Mode.OFF, + frameGenInherited: Boolean = true, ): SelectedGameProfile? { val game = games.firstOrNull { it.profileKey == selectedAppId.toString() } ?: return null val fexOverride = GameEnvironment.gameFexPreset(environment, game.profileKey) @@ -53,7 +59,7 @@ data class SelectedGameProfile( ) } val otherEnvironment = environment.games[game.profileKey].orEmpty().keys - FexPreset.environmentKeys - - GameEnvironment.NO_STEAM + GameEnvironment.NO_STEAM - GameEnvironment.GAME_RESOLUTION return SelectedGameProfile( appId = selectedAppId, name = game.name, @@ -68,6 +74,8 @@ data class SelectedGameProfile( environmentOverrides = otherEnvironment.size, windowsComponentNames = gameWindowsComponents.map(WinComponentNames::of), startWithoutSteam = GameEnvironment.gameNoSteam(environment, game.profileKey), + frameGen = frameGenMode, + frameGenInherited = frameGenInherited, ) } } diff --git a/app/src/main/java/com/droiddeck/launcher/session/SessionArtifacts.kt b/app/src/main/java/com/droiddeck/launcher/session/SessionArtifacts.kt index cb766a2de3..3ac0ef8ab6 100644 --- a/app/src/main/java/com/droiddeck/launcher/session/SessionArtifacts.kt +++ b/app/src/main/java/com/droiddeck/launcher/session/SessionArtifacts.kt @@ -77,6 +77,7 @@ object SessionArtifacts { copySteamLogs(context, dir, record, steamArch) VacDiagnostics.collect(context, dir) SessionLogCapture.dumpCrashBuffer(File(dir, "crash.log")) + SessionLogCapture.dumpMemoryPressure(File(dir, "memory-pressure.log")) val scrubbed = markScrubbed(scrubTree(record)) SessionEvents.record("session.artifacts_collected", mapOf("reason" to reason), dir) if (scrubbed) File(dir, COMPLETE_MARKER).writeText("collected: $reason at ${now()}\n") @@ -594,6 +595,10 @@ object SessionArtifacts { if (!crashLog.exists()) { SessionLogCapture.dumpCrashBuffer(crashLog) } + val memoryLog = File(dir, "memory-pressure.log") + if (newest && !memoryLog.exists()) { + SessionLogCapture.dumpMemoryPressure(memoryLog) + } if (stopWhenSessionStarts && SessionState.running) { record.failed = true record.deferred = true diff --git a/app/src/main/java/com/droiddeck/launcher/session/SessionFiles.kt b/app/src/main/java/com/droiddeck/launcher/session/SessionFiles.kt index f3b8478a21..96c556f174 100644 --- a/app/src/main/java/com/droiddeck/launcher/session/SessionFiles.kt +++ b/app/src/main/java/com/droiddeck/launcher/session/SessionFiles.kt @@ -33,12 +33,45 @@ object SessionFiles { "etc/xdg/autostart/droiddeck-clipboard.desktop" to "etc/xdg/autostart/droiddeck-clipboard.desktop", ) + private const val UBISOFT_SERVICE = "usr/local/lib/droiddeck-ubisoft/droiddeck-upc.exe" + + /** Fetches the Ubisoft pack and, once it lands, stages the service so a running session gets it without restarting. */ + fun ensureUbisoftService(context: Context) { + AddonPack.UBISOFT.ensure(context) { app -> + com.droiddeck.launcher.runtime.LinuxRuntime.rootDir(app).takeIf { it.isDirectory } + ?.let { stageUbisoftService(app, it, null) } + } + } + + @Synchronized + private fun stageUbisoftService(context: Context, root: File, ledger: StageLedger?) { + val pack = AddonPack.UBISOFT.takeIf { it.installed(context) }?.dir(context) ?: return + val target = File(root, UBISOFT_SERVICE) + if (ledger?.current(UBISOFT_SERVICE, target) == true) return + val staged = File(target.parentFile, target.name + ".staged") + var installed = false + try { + target.parentFile?.mkdirs() + File(pack, "droiddeck-upc.exe").inputStream().use { input -> + staged.outputStream().use { output -> FileUtils.copy(input, output) } + } + installed = staged.setExecutable(true, false) && staged.renameTo(target) + } catch (e: Exception) { + Log.w(TAG, "could not stage the Ubisoft launcher service", e) + } finally { + if (!installed) staged.delete() + } + if (installed) ledger?.staged(UBISOFT_SERVICE, target) else Log.e(TAG, "$UBISOFT_SERVICE NOT staged") + } + fun stage(context: Context, root: File, startsSession: Boolean = false) { if (DesktopCatalog.desktopInstalled(root) && !DesktopCatalog.desktopFromPack(root)) try { DesktopCatalog.cleanLegacy(context) } catch (e: Exception) { Log.w(TAG, "LXQt cleanup will retry next session", e) } GameEnvironmentStore.publish(context) WinComponents.publish(context) val files = arrayOf( + "rockstar/helpers/Launcher32.exe" to "usr/local/lib/droiddeck-rockstar/Launcher32.exe", + "rockstar/helpers/Launcher64.exe" to "usr/local/lib/droiddeck-rockstar/Launcher64.exe", "usr/local/bin/droiddeck-game-env" to "usr/local/bin/droiddeck-game-env", "usr/local/bin/droiddeck-game-gpu" to "usr/local/bin/droiddeck-game-gpu", "usr/local/bin/droiddeck-diagnostic-inventory" to "usr/local/bin/droiddeck-diagnostic-inventory", @@ -52,6 +85,7 @@ object SessionFiles { "libblsession.so" to "usr/local/lib/libblsession.so", "libfakeinput.so" to "usr/local/lib/libfakeinput.so", "libblfastpath.so" to "usr/local/lib/libblfastpath.so", + "libddnatv-hook.so" to "usr/lib/libddnatv-hook.so", "libblaudit.so" to "usr/local/lib/libblaudit.so", "libssbs.so" to "usr/local/lib/libssbs.so", "usr/local/bin/droiddeck-session" to "usr/local/bin/droiddeck-session", @@ -70,6 +104,7 @@ object SessionFiles { "usr/local/bin/droiddeck-steam-share" to "usr/local/bin/droiddeck-steam-share", "usr/local/bin/droiddeck-seed-redists" to "usr/local/bin/droiddeck-seed-redists", "usr/local/bin/droiddeck-launcher-cores" to "usr/local/bin/droiddeck-launcher-cores", + "usr/local/bin/droiddeck-pace-cores" to "usr/local/bin/droiddeck-pace-cores", "usr/local/bin/droiddeck-proton-extra" to "usr/local/bin/droiddeck-proton-extra", "usr/local/bin/droiddeck-netmanager" to "usr/local/bin/droiddeck-netmanager", "usr/local/bin/droiddeck-login1" to "usr/local/bin/droiddeck-login1", @@ -209,7 +244,7 @@ object SessionFiles { var installed = false try { target.parentFile?.mkdirs() - context.assets.open("linuxfs/$asset").use { input -> + (if (asset.startsWith("rockstar/")) requireNotNull(javaClass.getResourceAsStream("/$asset")) else context.assets.open("linuxfs/$asset")).use { input -> staged.outputStream().use { output -> FileUtils.copy(input, output) } } installed = staged.setExecutable(true, false) && staged.renameTo(target) @@ -251,18 +286,23 @@ object SessionFiles { } if (installed) ledger.staged(key, target) else Log.e(TAG, "DirectAudio $set/$relative NOT staged") } + stageUbisoftService(context, root, ledger) ledger.save() for (old in arrayOf("aarch64-unix", "aarch64-windows", "i386-windows")) File(root, "$DIRECTAUDIO_DIR/lib/wine/$old").deleteRecursively() val preload = StringBuilder("/usr/local/lib/libblsession.so\n") if (!File(Environment.getExternalStorageDirectory(), NO_PAD_SWITCH).exists()) { preload.append("/usr/local/lib/libfakeinput.so\n") } + val nativeUserland = SessionPrefs.nativeUserland(context) + if (nativeUserland) com.droiddeck.launcher.runtime.NativeGuest.prepare(context, root) if (ProotFastPath.enabled(context)) { val library = com.droiddeck.launcher.agent.AgentEnv.fastPathLibrary(context) preload.append(library + "\n") if (startsSession && library != ProotFastPath.LIBRARY) Log.i(TAG, "fast path preload: $library (debugging override)") } val etc = File(root, "etc").apply { mkdirs() } + File(etc, "droiddeck").mkdirs() + FileUtils.writeString(File(etc, "droiddeck/native-preload"), preload.toString()) val staged = File(etc, "ld.so.preload.staged") if (!FileUtils.writeString(staged, preload.toString()) || !staged.renameTo(File(etc, "ld.so.preload"))) { @@ -315,7 +355,10 @@ object SessionFiles { "stage session=$startsSession pending=$force choice=${SessionPrefs.bootMovie(context)} movie=${startupMovie?.path} " + "staged=$bigPictureMovieInstalled done=$done steam=${home.path} config: $before -> ${startupMoviePath(config)}", ) - if (startsSession) disableIdleSleep(home) + if (startsSession) { + disableIdleSleep(home) + seedUserDefaults(home) + } if (!done) allDone = false if (!bigPictureMovieInstalled) allInstalled = false if (done && home.path.contains(".droiddeck-x64") == activeIsX64) seen = if (bigPictureMovieInstalled) BOOT_MOVIE_PATH else "" @@ -535,6 +578,85 @@ object SessionFiles { } } + private const val USER_DEFAULTS_MARKER = "droiddeck-user-defaults-initialized" + private const val BATTERY_PREFERENCES = "CachedBatteryPreferences" + private const val UI_STATE = "UIStoreLocalSteamUIState" + private const val SORT_RECENT_OFF = "\\\"bSortedByRecent\\\":false" + private const val SORT_RECENT_ON = "\\\"bSortedByRecent\\\":true" + private const val BATTERY_PERCENT_ON = "{\\\"bShowBatteryPercentage\\\":true}" + + /** + * Seeds opinionated first-run defaults into each Steam account's localconfig.vdf: battery percentage shown and + * download speeds in bytes rather than bits, and the library sorted by recently played. A value is written once per account and only when the key is + * absent, so a later choice made in Steam is never overridden. Runs while Steam is stopped, as it keeps the + * file in memory and rewrites it. + */ + internal fun seedUserDefaults(steamHome: File) { + val users = File(steamHome, "userdata").listFiles { f -> f.isDirectory && f.name.all(Char::isDigit) && f.name != "0" } ?: return + for (user in users) { + val configDir = File(user, "config") + val marker = File(configDir, USER_DEFAULTS_MARKER) + val file = File(configDir, "localconfig.vdf") + if (marker.exists() || !file.isFile) continue + try { + val text = file.readText() + val updated = withUserDefaults(text) ?: continue + if (updated != text) { + val staged = File(configDir, file.name + ".staged") + staged.writeText(updated) + if (!staged.renameTo(file)) { staged.delete(); continue } + } + marker.writeText("1\n") + } catch (e: Exception) { + Log.w(TAG, "could not seed Steam user defaults", e) + } + } + } + + internal fun withUserDefaults(text: String): String? { + val newline = if (text.contains("\r\n")) "\r\n" else "\n" + val root = findObject(text, "UserLocalConfigStore", 0, text.length) ?: return null + var out = text + val system = findObject(out, "system", root.open + 1, root.close) + if (system == null) { + out = insertInto(out, root, listOf("\"system\"", "{", "\t\"displayratesasbits\"\t\t\"0\"", "}"), newline) + } else if (!hasKey(out.substring(system.keyStart, system.close + 1), "displayratesasbits")) { + val block = out.substring(system.keyStart, system.close + 1) + out = out.replaceRange(system.keyStart, system.close + 1, setScalar(block, "displayratesasbits", "0", newline)) + } + val reroot = findObject(out, "UserLocalConfigStore", 0, out.length) ?: return out + val web = findObject(out, "WebStorage", reroot.open + 1, reroot.close) + if (web == null) { + out = insertInto(out, reroot, listOf("\"WebStorage\"", "{", "\t\"$BATTERY_PREFERENCES\"\t\t\"$BATTERY_PERCENT_ON\"", "}"), newline) + } else if (!hasKey(out.substring(web.keyStart, web.close + 1), BATTERY_PREFERENCES)) { + val block = out.substring(web.keyStart, web.close + 1) + out = out.replaceRange(web.keyStart, web.close + 1, setScalar(block, BATTERY_PREFERENCES, BATTERY_PERCENT_ON, newline)) + } + return seedRecentSort(out, newline) + } + + // The library sort lives inside a JSON string; Steam writes bSortedByRecent:false until the player picks a sort, + // so the first seed flips it once and the marker file keeps a later choice. + private fun seedRecentSort(text: String, newline: String): String { + val root = findObject(text, "UserLocalConfigStore", 0, text.length) ?: return text + val web = findObject(text, "WebStorage", root.open + 1, root.close) ?: return text + val block = text.substring(web.keyStart, web.close + 1) + if (!hasKey(block, UI_STATE)) { + return text.replaceRange(web.keyStart, web.close + 1, + setScalar(block, UI_STATE, "{\\\"nVersion\\\":1,$SORT_RECENT_ON}", newline)) + } + return text.replaceRange(web.keyStart, web.close + 1, block.replace(SORT_RECENT_OFF, SORT_RECENT_ON)) + } + + private fun hasKey(block: String, key: String) = Regex("(?m)^[\\t ]*\"${Regex.escape(key)}\"[\\t ]").containsMatchIn(block) + + private fun insertInto(text: String, parent: VdfBlock, lines: List, newline: String): String { + val lineStart = text.lastIndexOf('\n', parent.close).let { if (it < 0) 0 else it + 1 } + val indent = text.substring(lineStart, parent.close).takeWhile { it == '\t' || it == ' ' } + "\t" + val section = lines.joinToString(newline) { indent + it } + newline + return text.substring(0, lineStart) + section + text.substring(lineStart) + } + private val IDLE_SLEEP_TIMERS = listOf("IdleSuspendBatterySeconds", "IdleSuspendACSeconds") internal fun disableIdleSleep(steamHome: File): Boolean { diff --git a/app/src/main/java/com/droiddeck/launcher/session/SessionPipController.kt b/app/src/main/java/com/droiddeck/launcher/session/SessionPipController.kt index 1b26e7de29..f32fe2abbf 100644 --- a/app/src/main/java/com/droiddeck/launcher/session/SessionPipController.kt +++ b/app/src/main/java/com/droiddeck/launcher/session/SessionPipController.kt @@ -21,6 +21,7 @@ class SessionPipController( private set private var suppressAuto = false private var visit = false + private var requested = false private var lastParams = "" val floating get() = transitioning || activity.isInPictureInPictureMode @@ -47,7 +48,7 @@ class SessionPipController( return builder.build() } - fun enter() { + fun enter(explicit: Boolean = true) { if (!eligible()) { Toast.makeText(activity, R.string.pip_not_ready, Toast.LENGTH_SHORT).show() return @@ -59,8 +60,10 @@ class SessionPipController( return } prepare() + requested = explicit val entered = runCatching { activity.enterPictureInPictureMode(params(bounds())) }.getOrDefault(false) if (!entered) { + requested = false restore() Toast.makeText(activity, R.string.pip_unavailable, Toast.LENGTH_SHORT).show() } @@ -68,7 +71,7 @@ class SessionPipController( fun leaving() { if (!automatic() || !allowed()) return - if (Build.VERSION.SDK_INT < 31) enter() else prepare() + if (Build.VERSION.SDK_INT < 31) enter(explicit = false) else prepare() } private fun prepare() { @@ -85,6 +88,8 @@ class SessionPipController( showPipUi(true) SessionService.beginPip(activity) SessionService.setActivityVisible(activity, true) + if (requested) runCatching { com.droiddeck.launcher.HomeApp.showFrontEnd(activity) } + requested = false } else restore() refresh(true) } diff --git a/app/src/main/java/com/droiddeck/launcher/session/SessionPrefs.kt b/app/src/main/java/com/droiddeck/launcher/session/SessionPrefs.kt index c8e81550a5..e6a8befb90 100644 --- a/app/src/main/java/com/droiddeck/launcher/session/SessionPrefs.kt +++ b/app/src/main/java/com/droiddeck/launcher/session/SessionPrefs.kt @@ -201,6 +201,18 @@ object SessionPrefs { prefs(context).edit().putBoolean("gameStoresEnabled", on).apply() } + fun soundtracksEnabled(context: Context): Boolean = prefs(context).getBoolean("soundtracksEnabled", true) + + fun setSoundtracksEnabled(context: Context, on: Boolean) { + prefs(context).edit().putBoolean("soundtracksEnabled", on).apply() + } + + fun soundtracksIngame(context: Context): Boolean = prefs(context).getBoolean("soundtracksIngame", false) + + fun setSoundtracksIngame(context: Context, on: Boolean) { + prefs(context).edit().putBoolean("soundtracksIngame", on).apply() + } + fun gameStoresSpeedTier(context: Context): String = prefs(context).getString("gameStoresSpeedTier", "fast") ?: "fast" fun setGameStoresSpeedTier(context: Context, tier: String) { @@ -253,12 +265,24 @@ object SessionPrefs { prefs(context).edit().putBoolean("railLabels", show).apply() } + fun agentTab(context: Context): Boolean = prefs(context).getBoolean("agentTab", true) + + fun setAgentTab(context: Context, show: Boolean) { + prefs(context).edit().putBoolean("agentTab", show).apply() + } + fun libraryShowUninstalled(context: Context): Boolean = prefs(context).getBoolean("libraryShowUninstalled", false) fun setLibraryShowUninstalled(context: Context, show: Boolean) { prefs(context).edit().putBoolean("libraryShowUninstalled", show).apply() } + fun libraryFavorites(context: Context): Set = prefs(context).getStringSet("libraryFavorites", null)?.toSet().orEmpty() + + fun setLibraryFavorites(context: Context, keys: Set) { + prefs(context).edit().putStringSet("libraryFavorites", keys.toSet()).apply() + } + fun storesTabOrder(context: Context): List = idList(prefs(context).getString("storesTabOrder", null)) fun setStoresTabOrder(context: Context, order: List) { @@ -271,6 +295,24 @@ object SessionPrefs { prefs(context).edit().putString("storesTabHidden", hidden.joinToString(",")).apply() } + fun navTabOrder(context: Context): List = idList(prefs(context).getString("navTabOrder", null)) + + fun setNavTabOrder(context: Context, order: List) { + prefs(context).edit().putString("navTabOrder", order.joinToString(",")).apply() + } + + fun navTabShelved(context: Context): Set = idList(prefs(context).getString("navTabShelved", "soundtracks,agent")).toSet() + + fun setNavTabShelved(context: Context, keys: Set) { + prefs(context).edit().putString("navTabShelved", keys.joinToString(",")).apply() + } + + fun navTabHidden(context: Context): Set = idList(prefs(context).getString("navTabHidden", null)).toSet() + + fun setNavTabHidden(context: Context, keys: Set) { + prefs(context).edit().putString("navTabHidden", keys.joinToString(",")).apply() + } + private fun idList(raw: String?): List = raw.orEmpty().split(',').map { it.trim() }.filter { it.isNotEmpty() } val STORES_SORTS = listOf("lastPlayed", "recentlyInstalled", "titleAsc", "titleDesc", "sizeDesc", "sizeAsc", "releaseDateDesc") @@ -714,6 +756,12 @@ object SessionPrefs { prefs(context).edit().putBoolean("syncFallback", on).apply() } + fun paceCores(context: Context): Boolean = prefs(context).getBoolean("paceCores", true) + + fun setPaceCores(context: Context, on: Boolean) { + prefs(context).edit().putBoolean("paceCores", on).apply() + } + fun gamescopeRealtime(context: Context): Boolean = prefs(context).getBoolean("gamescopeRealtime", false) fun setGamescopeRealtime(context: Context, on: Boolean) { @@ -752,6 +800,12 @@ object SessionPrefs { prefs(context).edit().putBoolean("prootNoSeccomp", on).apply() } + fun nativeUserland(context: Context): Boolean = prefs(context).getBoolean("nativeUserland", false) + + fun setNativeUserland(context: Context, on: Boolean) { + prefs(context).edit().putBoolean("nativeUserland", on).apply() + } + fun prootFastPath(context: Context): Boolean = prefs(context).getBoolean("prootFastPath", true) fun setProotFastPath(context: Context, on: Boolean) { @@ -1042,6 +1096,13 @@ object SessionPrefs { prefs(context).edit().putBoolean("vac_diagnostics", on).apply() } + fun buildWatermarkEnabled(context: Context): Boolean = + BuildWatermarkSetting.enabled(context) + + fun setBuildWatermarkEnabled(context: Context, on: Boolean) { + BuildWatermarkSetting.setEnabled(context, on) + } + private fun resolutionCap(context: Context, mode: String): Int = prefs(context).getInt("resolutionCap.$mode", 720) fun resolutionChosen(context: Context, mode: String): Boolean = @@ -1115,6 +1176,11 @@ object SessionPrefs { fun setBootMovieVolume(context: Context, percent: Int) { prefs(context).edit().putInt("bootMovieVolume", percent.coerceIn(0, 100)).apply() } fun bootMovieSeconds(context: Context): Int = prefs(context).getInt("bootMovieSeconds", 0).coerceAtLeast(0) fun setBootMovieSeconds(context: Context, seconds: Int) { prefs(context).edit().putInt("bootMovieSeconds", seconds.coerceAtLeast(0)).apply() } + fun skipBootMovie(context: Context): Boolean = prefs(context).getBoolean("skipBootMovie", false) + fun setSkipBootMovie(context: Context, on: Boolean) { + prefs(context).edit().putBoolean("skipBootMovie", on).apply() + setBootMovieApplyNext(context, true) + } fun bootMovieApplyNext(context: Context): Boolean = prefs(context).getBoolean("bootMovieApplyNext", false) fun setBootMovieApplyNext(context: Context, on: Boolean) { prefs(context).edit().putBoolean("bootMovieApplyNext", on).apply() } fun bootMovieSteamSeen(context: Context): String? = prefs(context).getString("bootMovieSteamSeen", null) @@ -1232,6 +1298,11 @@ object SessionPrefs { fun addedGameStoredAppId(context: Context, folderPath: String): Long? = prefs(context).getLong("addedAppId:$folderPath", 0L).takeIf { it != 0L } + fun addedGameFolders(context: Context): Map = prefs(context).all.mapNotNull { (key, value) -> + val id = (value as? Long)?.takeIf { key.startsWith("addedAppId:") && it != 0L } ?: return@mapNotNull null + (id and 0xFFFFFFFFL) to key.removePrefix("addedAppId:") + }.toMap() + fun followStoreGame(context: Context, key: String, folderPath: String, gone: (String) -> Boolean) = synchronized(addedGameLock) { val p = prefs(context) val previous = p.getString("storeFolder:$key", null) diff --git a/app/src/main/java/com/droiddeck/launcher/session/SessionService.kt b/app/src/main/java/com/droiddeck/launcher/session/SessionService.kt index 5fb5e37f29..d45bc531a6 100644 --- a/app/src/main/java/com/droiddeck/launcher/session/SessionService.kt +++ b/app/src/main/java/com/droiddeck/launcher/session/SessionService.kt @@ -23,6 +23,7 @@ import android.os.IBinder import android.os.Handler import android.os.Looper import android.os.PowerManager +import android.os.SystemClock import android.hardware.display.DisplayManager import android.view.Display import android.util.Log @@ -85,7 +86,12 @@ class SessionService : Service() { private var activityDisplayId = Display.DEFAULT_DISPLAY private var xrActivityVisible = false private var signInHold = false - private val hasVisibleSurface get() = !SessionVisibilityPolicy.isHidden( + private val browserHandoff = BrowserHandoff(BROWSER_HANDOFF_TIMEOUT_MS) + private val browserHandoffExpired = Runnable { + suspendAttemptFailed = false + updateSuspendPolicy() + } + private val hasVisibleSurface get() = browserHandoff.active(SystemClock.elapsedRealtime()) || !SessionVisibilityPolicy.isHidden( activityStarted = activityVisible || signInHold, defaultDisplayOn = (getSystemService(Context.POWER_SERVICE) as? PowerManager)?.isInteractive ?: screenOn, activityOnDefaultDisplay = activityDisplayId == Display.DEFAULT_DISPLAY, @@ -235,6 +241,7 @@ class SessionService : Service() { ACTION_ACTIVITY_VISIBLE -> { if (!SessionState.pipActive) pipTask = false activityVisible = true + browserHandoff.sessionShown() activityDisplayId = intent.getIntExtra(EXTRA_ACTIVITY_DISPLAY_ID, activityDisplayId) sessionDisplayId = intent.getIntExtra(EXTRA_DISPLAY_ID, sessionDisplayId) screenOn = readScreenOn() @@ -258,6 +265,7 @@ class SessionService : Service() { } ACTION_ACTIVITY_HIDDEN -> { activityVisible = false + browserHandoff.sessionHidden() activityDisplayId = intent.getIntExtra(EXTRA_ACTIVITY_DISPLAY_ID, activityDisplayId) suspendAttemptFailed = false updateSuspendPolicy() @@ -287,6 +295,17 @@ class SessionService : Service() { updateSuspendPolicy() return START_NOT_STICKY } + ACTION_BROWSER_HANDOFF -> { + if (!SessionState.running) return START_NOT_STICKY + browserHandoff.begin(SystemClock.elapsedRealtime()) + if (!activityVisible) browserHandoff.sessionHidden() + mainHandler.removeCallbacks(browserHandoffExpired) + mainHandler.postDelayed(browserHandoffExpired, BROWSER_HANDOFF_TIMEOUT_MS) + if (!manualHold) manualPauseRequested = false + suspendAttemptFailed = false + updateSuspendPolicy() + return START_NOT_STICKY + } ACTION_MIC_CHANGED -> { if (SessionState.running && SessionState.micAvailable && !SessionState.suspended) { val enabled = intent.getBooleanExtra("enabled", false) @@ -343,6 +362,8 @@ class SessionService : Service() { activityVisible = true xrActivityVisible = false signInHold = false + browserHandoff.clear() + mainHandler.removeCallbacks(browserHandoffExpired) sessionDisplayId = intent?.getIntExtra(EXTRA_DISPLAY_ID, Display.DEFAULT_DISPLAY) ?: Display.DEFAULT_DISPLAY activityDisplayId = intent?.getIntExtra(EXTRA_ACTIVITY_DISPLAY_ID, sessionDisplayId) ?: sessionDisplayId screenOn = readScreenOn() @@ -588,6 +609,14 @@ class SessionService : Service() { guest.add("BL_WIDTH=" + size.first) guest.add("BL_HEIGHT=" + size.second) + if (noSteamGame()) runCatching { + val scope = NoSteamLaunch.scopeOf(SessionState.program, SessionState.programArgs) { NoSteamLaunch.battleNetTitleScope(this, it) } + NoSteamLaunch.resolution(GameEnvironmentStore.read(this), scope, size) + }.onFailure { Log.w(TAG, "game resolution", it) }.getOrNull()?.let { (w, h) -> + guest.add("BL_GAME_WIDTH=$w") + guest.add("BL_GAME_HEIGHT=$h") + Log.i(TAG, "game resolution: ${w}x$h on a ${size.first}x${size.second} output") + } if (SessionState.followScreen || size.first < size.second || SessionPrefs.orientation(this) == android.content.pm.ActivityInfo.SCREEN_ORIENTATION_USER) guest.add("BL_FOLLOW_OUTPUT=1") @@ -665,6 +694,10 @@ class SessionService : Service() { FileUtils.clear(File(LinuxRuntime.liveDir(this), "shm")) val binds = sessionBinds(controllersOn, fakeInputDir, sessionDir, guest, sessionRoot, runtimeDir) + val nativeUserland = com.droiddeck.launcher.runtime.NativeGuest.enabled(this) + synchronized(stopLock) { + if (gen == sessionGen && SessionState.running) com.droiddeck.launcher.runtime.NativeGuest.sessionMode = nativeUserland + } val fastPathKey = if (ProotFastPath.enabled(this)) { val prootBinds = LinuxRuntime.binds( this, sessionRoot, runtimeDir, Environment.getExternalStorageDirectory(), binds, @@ -681,27 +714,42 @@ class SessionService : Service() { } } else null - val command = LinuxRuntime.command( - this, sessionRoot, runtimeDir, Environment.getExternalStorageDirectory(), binds, guest, - ) - - val hostEnv = HostEnvironment() - hostEnv["PROOT_LOADER"] = LinuxRuntime.prootLoader(this).path - hostEnv["PROOT_TMP_DIR"] = LinuxRuntime.prootTempDir(this).path - if (SessionPrefs.prootNoSeccomp(this)) { - hostEnv["PROOT_NO_SECCOMP"] = "1" - Log.i(TAG, "proot: seccomp acceleration off by request") + val sessionBindSpecs = LinuxRuntime.binds(this, sessionRoot, runtimeDir, Environment.getExternalStorageDirectory(), binds) + val command = if (nativeUserland) { + LinuxRuntime.rememberSessionBinds(sessionBindSpecs) + com.droiddeck.launcher.runtime.NativeGuest.command(root, guest.first(), guest.drop(1)) + } else { + LinuxRuntime.command(this, sessionRoot, runtimeDir, Environment.getExternalStorageDirectory(), binds, guest) } - fastPathKey?.let { ProotFastPath.hostEnv(it).let { (k, v) -> hostEnv[k] = v } } + + val prootEnv = HostEnvironment() + prootEnv["PROOT_LOADER"] = LinuxRuntime.prootLoader(this).path + prootEnv["PROOT_TMP_DIR"] = LinuxRuntime.prootTempDir(this).path + if (SessionPrefs.prootNoSeccomp(this)) { + prootEnv["PROOT_NO_SECCOMP"] = "1" + if (!nativeUserland) Log.i(TAG, "proot: seccomp acceleration off by request") + } + fastPathKey?.let { ProotFastPath.hostEnv(it).let { (k, v) -> prootEnv[k] = v } } for (key in listOf("PROOT_PROFILE", "PROOT_PROFILE_SLOW_US")) { - guest.lastOrNull { it.startsWith("$key=") }?.substringAfter('=')?.let { hostEnv[key] = it } + guest.lastOrNull { it.startsWith("$key=") }?.substringAfter('=')?.let { prootEnv[key] = it } } val prootLibs = LinuxRuntime.prootLibraryPath(this) - if (prootLibs.isNotEmpty()) hostEnv["LD_LIBRARY_PATH"] = prootLibs + if (prootLibs.isNotEmpty()) prootEnv["LD_LIBRARY_PATH"] = prootLibs - val terminalCommand = LinuxRuntime.command( - this, sessionRoot, runtimeDir, Environment.getExternalStorageDirectory(), binds, shellGuest, - ) + val drives = com.droiddeck.launcher.runtime.NativeGuest.relinkPrefixDrives(root, sessionBindSpecs) + if (drives > 0) Log.i(TAG, "$drives Wine drive links given their guest paths back") + val hostEnv = if (nativeUserland) HostEnvironment().also { env -> + Log.i(TAG, "native userland: no proot (${sessionBindSpecs.size} mounts)") + com.droiddeck.launcher.runtime.NativeGuest.sessionEnvironment(root, sessionBindSpecs, SessionPrefs.guestHostname(this)) + .forEach { (k, v) -> env[k] = v } + } else prootEnv + + // The terminal and the bottom desktop run the way the session does: without proot when it does + val terminalCommand = if (nativeUserland) { + com.droiddeck.launcher.runtime.NativeGuest.command(root, shellGuest.first(), shellGuest.drop(1)) + } else { + LinuxRuntime.command(this, sessionRoot, runtimeDir, Environment.getExternalStorageDirectory(), binds, shellGuest) + } val terminalHostEnvironment = LinkedHashMap(System.getenv()) hostEnv.asArray().forEach { entry -> val separator = entry.indexOf('=') @@ -711,7 +759,7 @@ class SessionService : Service() { SessionTerminal.prepare(terminalCommand, terminalHostEnvironment.map { (key, value) -> "$key=$value" }.toTypedArray(), root, gen) val (fastPathName, _) = ProotFastPath.hostEnv("") BottomDesktop.prepare(desktopGuest, binds, sessionRoot, - hostEnv.asArray().filterNot { it.startsWith("$fastPathName=") }.toTypedArray(), root, sessionDir, gen, + prootEnv.asArray().filterNot { it.startsWith("$fastPathName=") }.toTypedArray(), root, sessionDir, gen, nativeUserland, ) { gen == sessionGen && SessionState.running } } @@ -803,6 +851,7 @@ class SessionService : Service() { }, zramControl = File(filesDir, "${LinuxRuntime.DIR}/tmp/.bl-zram"), clockControl = File(filesDir, "${LinuxRuntime.DIR}/tmp/.bl-clock"), + mapClockControl = { WaylandCompositor.nativeSetClockControl(it.path) }, pagedOut = { processes, unacknowledged, residentKb, swapKb, swapBeforeKb, millis -> Log.i(TAG, "paged out $processes processes ($unacknowledged unacknowledged) in $millis ms: " + "resident ${residentKb / 1024} MB, zram ${swapBeforeKb / 1024} -> ${swapKb / 1024} MB") @@ -957,6 +1006,7 @@ class SessionService : Service() { guest.add("BL_SYNC=" + (if (SessionPrefs.fastSync(this)) "1" else "0")) guest.add("BL_SYNC_FALLBACK=" + (if (SessionPrefs.syncFallback(this)) "1" else "0")) guest.add("BL_FSYNC_FIRST=" + (if (SessionPrefs.fsyncFirst(this)) "1" else "0")) + guest.add("BL_PACE_CORES=" + (if (SessionPrefs.paceCores(this)) "1" else "0")) guest.add("BL_GAMESCOPE_REALTIME=" + (if (SessionPrefs.gamescopeRealtime(this)) "1" else "0")) if (SessionPrefs.cursorComposite(this)) guest.add("BL_CURSOR_COMPOSITE=1") relativeMouseForSession().takeIf { it != 0 }?.let { guest.add("gamescope_relative_mouse=$it") } @@ -968,7 +1018,9 @@ class SessionService : Service() { SessionPrefs.vramCapMb(this).takeIf { it > 0 }?.let { guest.add("BL_VRAM_MB=$it") } guest.add("AUDIO_DIRECT_DECAY=0") val extra = extraEnv() + agentEnvironment - if (extra.none { it.startsWith("TU_DEBUG=") }) guest.add("$GAME_TU_DEBUG=" + (tuOverride ?: if (tuDriver) "sysmem" else "")) + mapOf("TU_DEBUG" to (tuOverride ?: if (tuDriver) "sysmem" else ""), "MESA_NO_ERROR" to "").forEach { (name, game) -> + if (extra.none { it.startsWith("$name=") }) guest.add("$GAME_PREFIX$name=$game") + } extra.forEach { guest.add(it) } com.droiddeck.launcher.gpu.TpUbwcHint.forThisDevice(this)?.let { guest.add("${com.droiddeck.launcher.gpu.TpUbwcHint.ENV}=$it") } val clientPinned = steamHere && SessionPrefs.clientCpusOverride(this) @@ -1587,10 +1639,11 @@ class SessionService : Service() { val me = android.os.Process.myPid() val rootfs = try { File(filesDir, "linuxfs").canonicalPath } catch (e: Exception) { return } + "/" val procs = File("/proc").listFiles { f -> f.name.all { it.isDigit() } } ?: return + val spared = OrphanReaper.spared() var killed = 0 for (proc in procs) { val pid = proc.name.toIntOrNull() ?: continue - if (pid == me) continue + if (pid == me || pid in spared) continue val exe = try { File(proc, "exe").canonicalPath } catch (e: Exception) { continue } if (!exe.startsWith(rootfs)) continue android.os.Process.killProcess(pid) @@ -1602,10 +1655,11 @@ class SessionService : Service() { private fun killStragglers() { val me = android.os.Process.myPid() val procs = File("/proc").listFiles { f -> f.name.all { it.isDigit() } } ?: return + val spared = OrphanReaper.spared() var killed = 0 for (proc in procs) { val pid = proc.name.toIntOrNull() ?: continue - if (pid == me) continue + if (pid == me || pid in spared) continue val cmdline = try { File(proc, "cmdline").readBytes().toString(Charsets.UTF_8).replace('\u0000', ' ') } catch (e: Exception) { @@ -2023,6 +2077,8 @@ class SessionService : Service() { if (gen != null && gen != sessionGen) return cancelQueuedSteamGame() gameExitWatchToken++ + // also when startup stopped before the guest ran + com.droiddeck.launcher.runtime.NativeGuest.sessionMode = null if (!SessionState.running) return if (relaunch) SessionState.confirmRelaunchStop() SessionEvents.record("guest.exited", mapOf("status" to status)) @@ -2344,7 +2400,7 @@ class SessionService : Service() { private const val TRACER_NICE = -6 private const val MIC_RELEASE_TIMEOUT_MS = 5_000L private const val TU_DEBUG_SWITCH = "Download/droiddeck-tu-debug" - private const val GAME_TU_DEBUG = "DROIDDECK_GAME_TU_DEBUG" + private const val GAME_PREFIX = "DROIDDECK_GAME_" private const val LEGACY_ENV_SWITCH = "Download/droiddeck-env" private const val ENV_SWITCH_NAME = "droiddeck-env" @@ -2374,6 +2430,8 @@ class SessionService : Service() { private const val ACTION_XR_ACTIVITY_HIDDEN = "com.droiddeck.launcher.XR_ACTIVITY_HIDDEN" private const val ACTION_SIGN_IN_HOLD = "com.droiddeck.launcher.SIGN_IN_HOLD" private const val EXTRA_HOLD = "hold" + private const val ACTION_BROWSER_HANDOFF = "com.droiddeck.launcher.BROWSER_HANDOFF" + private const val BROWSER_HANDOFF_TIMEOUT_MS = 10 * 60_000L private const val ACTION_TRACK_AUXILIARY = "com.droiddeck.launcher.TRACK_AUXILIARY" private const val ACTION_STOP_AUXILIARY = "com.droiddeck.launcher.STOP_AUXILIARY" private const val ACTION_AUXILIARY_EXITED = "com.droiddeck.launcher.AUXILIARY_EXITED" @@ -2476,6 +2534,11 @@ class SessionService : Service() { context.startService(Intent(context, SessionService::class.java).setAction(ACTION_SIGN_IN_HOLD).putExtra(EXTRA_HOLD, hold)) } + fun holdForBrowserHandoff(context: Context) { + if (!SessionState.running) return + context.startService(Intent(context, SessionService::class.java).setAction(ACTION_BROWSER_HANDOFF)) + } + fun pause(context: Context) { context.startService(Intent(context, SessionService::class.java).setAction(ACTION_PAUSE_NOW)) } diff --git a/app/src/main/java/com/droiddeck/launcher/session/SessionSuspendController.kt b/app/src/main/java/com/droiddeck/launcher/session/SessionSuspendController.kt index b0a6852144..ad7360d8ee 100644 --- a/app/src/main/java/com/droiddeck/launcher/session/SessionSuspendController.kt +++ b/app/src/main/java/com/droiddeck/launcher/session/SessionSuspendController.kt @@ -23,6 +23,7 @@ internal class SessionSuspendController( private val executor: ExecutorService = Executors.newSingleThreadExecutor(), private val zramControl: File? = null, private val clockControl: File? = null, + private val mapClockControl: (File) -> Unit = {}, private val nowNanos: () -> Long = System::nanoTime, private val pagedOut: (processes: Int, unacknowledged: Int, residentKb: Long, swapKb: Long, swapBeforeKb: Long, millis: Long) -> Unit = { _, _, _, _, _, _ -> }, @@ -154,6 +155,7 @@ internal class SessionSuspendController( frozenSince = null val control = clockControl?.takeIf { it.isFile && it.length() >= Long.SIZE_BYTES } ?: return try { + mapClockControl(control) RandomAccessFile(control, "rw").use { file -> val bytes = ByteArray(Long.SIZE_BYTES) file.readFully(bytes) diff --git a/app/src/main/java/com/droiddeck/launcher/session/SettingsReset.kt b/app/src/main/java/com/droiddeck/launcher/session/SettingsReset.kt index 2146ac1942..17696c44a3 100644 --- a/app/src/main/java/com/droiddeck/launcher/session/SettingsReset.kt +++ b/app/src/main/java/com/droiddeck/launcher/session/SettingsReset.kt @@ -14,18 +14,18 @@ object SettingsReset { internal val SESSION_KEYS = setOf( "orientation", "launcherFullscreen", "animations", "lowStorageWarning", "theme", "runSteamAtStartup", "startupSession", "addedGamesArt", "dualScreenMode", "dualScreenSessionMode", "dualScreenLauncher", "dualScreenSessionControls", "androidTextFieldKeyboard", - "gameStoresEnabled", "gameStoresSpeedTier", "gameStoresParallel", "storesOpenTab", "storesShowMature", + "gameStoresEnabled", "soundtracksEnabled", "soundtracksIngame", "gameStoresSpeedTier", "gameStoresParallel", "storesOpenTab", "storesShowMature", "storesInstallLanguage", "hud", "hudDeck", "hudFps", "hudBattery", "hudGraph", "hudColor", "hudOpacity", "__KEEP_droidDeckHud__", "__KEEP_droidDeckHudPos__", "backHold", "backActionsInverted", "backDoubleTapMs", "touch", "osc", "shape", "steamController", "gamepadLeft", "gamepadRight", "pipAutoEnter", "unfoldedControls", "unfoldedControlsWithController", - "stretch16x9", "picturePosition", "railLabels", "pcKeyboardSize", "pcKeyboardOpacity", "pcKeyboardHiddenKeys", + "stretch16x9", "picturePosition", "railLabels", "agentTab", "navTabOrder", "navTabShelved", "navTabHidden", "pcKeyboardSize", "pcKeyboardOpacity", "pcKeyboardHiddenKeys", "gpuDriverMode", "androidDriver", "linuxDriver", "linuxDriver.steam", "linuxDriver.desktop", - "tuSysmem", "glThread", "noGlError", "zinkLazy", "mangoapp", "gpuClockPin", "gamescopeRealtime", "ramCapMb", "vramCapMb", "zramClient", + "tuSysmem", "glThread", "noGlError", "zinkLazy", "mangoapp", "gpuClockPin", "gamescopeRealtime", "paceCores", "ramCapMb", "vramCapMb", "zramClient", "directAudio", "mic", "wifiDiscovery", "clientCpusOverride", "clientCpus", "gameCpus", - "noXalia", "fastSync", "fsyncFirst", "syncFallback", "prootNoSeccomp", "prootFastPath", "cursorComposite", - "guestHostname", "fexPreset", "forceSsbs", "logs", "gameDebugLogsEnabled", "enhancedDiagnosticsNext", "storageDiagnostics", + "noXalia", "fastSync", "fsyncFirst", "syncFallback", "prootNoSeccomp", "prootFastPath", "nativeUserland", "cursorComposite", + "guestHostname", "fexPreset", "forceSsbs", "logs", "gameDebugLogsEnabled", "enhancedDiagnosticsNext", "storageDiagnostics", "buildWatermark", "upscaler", "upscaleSharpness", "screenEffects", "textureAnisotropy", "textureLodBias", - "steamDownloadsInBackground", "steam_offline", "bootMovie", "bootMovieSound", "bootMovieVolume", "bootMovieSeconds", + "steamDownloadsInBackground", "steam_offline", "bootMovie", "bootMovieSound", "bootMovieVolume", "bootMovieSeconds", "skipBootMovie", "bootMovieApplyNext", "bootMovieSteamSeen", "questDefaultsV1", "telemetryAuto", "telemetryOff", "statsStrip", "statsHud", "bottomHud", "bottomStripMetrics", "bottomStripTabs", "statsDash", "statsSpeedUnit", ) @@ -43,6 +43,7 @@ object SettingsReset { var ok = true val session = context.getSharedPreferences("session", Context.MODE_PRIVATE) session.edit().apply { session.all.keys.filter { isSessionSetting(it) }.forEach { remove(it) } }.commit() + BuildWatermarkSetting.setEnabled(context, true) ControllerPrefs.resetAll(context) InputProfiles.resetAll(context) context.getSharedPreferences("app-ui", Context.MODE_PRIVATE).edit().clear().commit() diff --git a/app/src/main/java/com/droiddeck/launcher/session/SteamLibraries.kt b/app/src/main/java/com/droiddeck/launcher/session/SteamLibraries.kt index 0846763599..8b219470c8 100644 --- a/app/src/main/java/com/droiddeck/launcher/session/SteamLibraries.kt +++ b/app/src/main/java/com/droiddeck/launcher/session/SteamLibraries.kt @@ -82,13 +82,14 @@ object SteamLibraries { /** Reads storage; call off the main thread. */ fun found(context: Context): List { val entries = list(context) - val taken = taken(context, entries) + AddedGames.roots(context).map { canonical(it.host) } + val taken = taken(context, entries) + GameStorage.gamesFolderLibraries(context).map { canonical(it.host) } + val gamesFolders = AddedGames.roots(context).map { canonical(it.host) } val hits = ArrayList>() for (root in StorageRoots.list(context)) { if (!root.readable) continue for (dir in candidates(rawView(root.dir), SCAN_DEPTH)) { val games = gameCount(dir) - if (games > 0 && File(dir, "steamapps").canWrite() && taken.none { overlaps(it, canonical(dir)) }) hits += dir to games + if (games > 0 && File(dir, "steamapps").canWrite() && offered(taken, gamesFolders, canonical(dir))) hits += dir to games } } val picked = ArrayList>() @@ -101,6 +102,9 @@ object SteamLibraries { } } + internal fun offered(taken: List, gamesFolders: List, dir: String): Boolean = + taken.none { overlaps(it, dir) } && gamesFolders.none { it != dir && overlaps(it, dir) } + /** The FUSE view under /storage hides files other apps wrote unless DroidDeck has all files access; the raw card mount does not. */ private fun rawView(dir: File): File { if (!dir.path.startsWith("/storage/") || dir.path.startsWith("/storage/emulated")) return dir @@ -171,7 +175,7 @@ object SteamLibraries { internal fun overlaps(a: String, b: String): Boolean = a == b || a.startsWith("$b/") || b.startsWith("$a/") - private fun canonical(file: File): String = UsbLink.storagePath(runCatching { file.canonicalPath }.getOrDefault(file.absolutePath)) + internal fun canonical(file: File): String = UsbLink.storagePath(runCatching { file.canonicalPath }.getOrDefault(file.absolutePath)) private const val SCAN_DEPTH = 2 private const val SCAN_LIMIT = 4000 diff --git a/app/src/main/java/com/droiddeck/launcher/storage/SteamStorage.kt b/app/src/main/java/com/droiddeck/launcher/storage/SteamStorage.kt index de3648e83c..62ba45fd9c 100644 --- a/app/src/main/java/com/droiddeck/launcher/storage/SteamStorage.kt +++ b/app/src/main/java/com/droiddeck/launcher/storage/SteamStorage.kt @@ -11,6 +11,8 @@ object SteamStorage { const val PROTON_11_ARM = 4628740 const val REDISTRIBUTABLES = 228980 const val FEX = 3127680 + const val EAC_RUNTIME = 1826330 + const val BATTLEYE_RUNTIME = 1161040 const val ARM_TOOL = "droiddeck-proton-arm64" const val ARM_11_TOOL = "droiddeck-proton-11-arm64" @@ -18,7 +20,7 @@ object SteamStorage { private val VALVE_TOOLS = setOf( 858280, 961940, 1054830, 1113280, 1245040, 1420170, 1493710, 1580130, 1887720, 2180100, 2348590, 2805730, 3029110, 3658110, 4183110, 4628710, 4690330, - SCOUT, SOLDIER, SNIPER, ARM_RUNTIME, PROTON_ARM, PROTON_11_ARM, REDISTRIBUTABLES, FEX, + SCOUT, SOLDIER, SNIPER, ARM_RUNTIME, PROTON_ARM, PROTON_11_ARM, REDISTRIBUTABLES, FEX, EAC_RUNTIME, BATTLEYE_RUNTIME, ) private val APP_ID = Regex("^\\s*\"appid\"\\s*\"(\\d+)\"", RegexOption.MULTILINE) @@ -93,6 +95,7 @@ object SteamStorage { val dir = m.installDir.orEmpty() return when { m.appId == SCOUT || m.appId == SOLDIER || dir == "SteamLinuxRuntime" || dir == "SteamLinuxRuntime_soldier" -> Kind.OLD_RUNTIME + m.appId == EAC_RUNTIME || m.appId == BATTLEYE_RUNTIME -> Kind.REQUIRED dir.startsWith("Proton") && "ARM64" in dir -> Kind.ARM_PROTON m.appId == PROTON_ARM || m.appId == PROTON_11_ARM -> Kind.ARM_PROTON dir.startsWith("Proton ") -> Kind.X86_PROTON @@ -152,6 +155,42 @@ object SteamStorage { fun leftoverId(name: String): Int? = name.toLongOrNull()?.takeIf { it in 1 until (1L shl 31) }?.toInt() + fun shortcutId(name: String): Long? = name.toLongOrNull() + ?.takeIf { it in Int.MIN_VALUE until 0 || it in (1L shl 31) until (1L shl 32) }?.and(0xFFFFFFFFL) + + private val COMPAT_PATH = Regex("""STEAM_COMPAT_DATA_PATH=(?:"([^"]*)"|'([^']*)'|(\S+))""") + private val COMPAT_ID = Regex("""/compatdata/(-?\d+)/*$""") + + fun sharedPrefixId(launchOptions: String): Long? { + val path = COMPAT_PATH.find(launchOptions)?.groupValues?.drop(1)?.firstOrNull { it.isNotEmpty() } ?: return null + return COMPAT_ID.find(path.trim())?.groupValues?.get(1)?.let(::shortcutId) + } + + private val GAME_FOLDER = Regex("""Z:\\\\(?:[^"\\]+\\\\)*?(?:steamapps\\\\common|Games\\\\Stores\\\\[^"\\]+)\\\\([^"\\]+)""") + + fun gameFolderHint(prefix: File): String? = runCatching { + listOf("pfx/system.reg", "pfx/user.reg").map { File(prefix, it) }.filter { it.isFile && it.length() < 64L * 1024 * 1024 } + .flatMap { f -> f.useLines { lines -> lines.flatMap { GAME_FOLDER.findAll(it).map { m -> m.groupValues[1] } }.toList() } } + .groupingBy { it }.eachCount().maxByOrNull { it.value }?.key + }.getOrNull() + + class Shortcut(val name: String, val launchOptions: List) + + fun shortcuts(root: File): Map? = runCatching { + val userdata = File(root, "userdata") + val users = if (userdata.exists()) userdata.listFiles() ?: return null else emptyArray() + users.mapNotNull { File(it, "config/shortcuts.vdf").takeIf(File::isFile) }.flatMap { file -> + val vdf = com.droiddeck.launcher.frontend.SteamAppInfo.readMap(java.nio.ByteBuffer.wrap(file.readBytes()).order(java.nio.ByteOrder.LITTLE_ENDIAN), null) + (vdf["shortcuts"] as? Map<*, *>)?.values?.filterIsInstance>()?.mapNotNull { s -> + fun value(key: String) = s.entries.firstOrNull { (it.key as? String).equals(key, ignoreCase = true) }?.value as? String + val id = value("appid")?.toLongOrNull()?.and(0xFFFFFFFFL) ?: return@mapNotNull null + id to Shortcut(value("AppName") ?: "", listOfNotNull(value("LaunchOptions"))) + }.orEmpty() + }.groupBy({ it.first }, { it.second }).mapValues { (_, all) -> + Shortcut(all.firstOrNull { it.name.isNotEmpty() }?.name.orEmpty(), all.flatMap { it.launchOptions }) + } + }.getOrNull() + fun isStubPrefix(prefix: File): Boolean = prefix.walkTopDown().onEnter { !java.nio.file.Files.isSymbolicLink(it.toPath()) } .none { it.isFile && it.name != "steam_autocloud.vdf" && !java.nio.file.Files.isSymbolicLink(it.toPath()) } } diff --git a/app/src/main/java/com/droiddeck/launcher/storage/StorageScan.kt b/app/src/main/java/com/droiddeck/launcher/storage/StorageScan.kt index 9c5fff91a9..dc07daabaf 100644 --- a/app/src/main/java/com/droiddeck/launcher/storage/StorageScan.kt +++ b/app/src/main/java/com/droiddeck/launcher/storage/StorageScan.kt @@ -18,7 +18,7 @@ enum class Bucket { GAMES, GAME_DATA, TOOLS, COMPONENTS, STORES, DESKTOP, SYSTEM class GameUsage( val appId: Int, val name: String, val art: File?, val library: String, val internal: Boolean, val lastPlayed: Long, - val game: Long, val prefix: Long, val shaders: Long, val workshop: Long, val shaderDir: File?, + val game: Long, val prefix: Long, val shaders: Long, val workshop: Long, val shaderDirs: List, val x64: Boolean = false, val prefixDir: File? = null, ) { val data: Long get() = prefix + shaders + workshop @@ -26,14 +26,23 @@ class GameUsage( } enum class ToolState { IN_USE, REQUIRED, UNUSED } -enum class ToolReason { DEFAULT_PROTON, PROTON, FEX_RUNTIME, ARM_RUNTIME, REDISTRIBUTABLES, FEX, STEAM_TOOL, OLD_RUNTIME, X86_PROTON, CUSTOM, CUSTOM_UNKNOWN, X64_CLIENT } +enum class ToolReason { DEFAULT_PROTON, PROTON, FEX_RUNTIME, ARM_RUNTIME, REDISTRIBUTABLES, FEX, ANTICHEAT_RUNTIME, STEAM_TOOL, OLD_RUNTIME, X86_PROTON, CUSTOM, CUSTOM_UNKNOWN, X64_CLIENT } class ToolUsage( val key: String, val name: String, val bytes: Long, val state: ToolState, val reason: ToolReason, val games: Int, val isDefault: Boolean, val manifests: List, val dirs: List, ) -class Leftover(val appId: Int, val prefix: File?, val shaders: File?, val bytes: Long, val safe: Boolean) +class Leftover(val appId: Long, val prefix: File?, val shaders: File?, val bytes: Long, val safe: Boolean, val shortcut: Boolean = false, val name: String? = null, val prefixBytes: Long = 0) + +enum class PrefixOwner { SHARED, LAUNCHER, GAME, UNKNOWN } + +class KeptPrefix( + val dir: File, val owner: PrefixOwner, val name: String?, val bytes: Long, val library: String, val x64: Boolean, val users: List = emptyList(), + val shaders: File? = null, val shaderBytes: Long = 0, +) + +class StoreGameUsage(val game: com.droiddeck.launcher.stores.InstalledStoreGame, val bytes: Long, val internal: Boolean) class ComponentUsage( val comp: String, val version: String, val bytes: Long, val inUse: Boolean, @@ -59,9 +68,11 @@ class StorageReport( val components: List, val flatpakApps: List, val flatpakRuntimes: Long, - val otherPrefixes: Long, + val kept: List, val leftoversChecked: Boolean, + val storeGames: List = emptyList(), ) { + val otherPrefixes: Long get() = kept.sumOf { it.bytes } val droiddeck: Long get() = buckets.values.sum() val installedShaders: Long get() = games.sumOf { it.shaders } val unusedTools: List get() = tools.filter { it.state == ToolState.UNUSED } @@ -91,7 +102,16 @@ object StorageScan { fun steamRoot(context: Context) = SessionPrefs.steamRoot(context, "arm64") + fun measure(file: File): Long = Walker().measure(file) + fun scan(context: Context): StorageReport { + val phases = ArrayList() + var mark = android.os.SystemClock.elapsedRealtime() + fun phase(name: String) { + val now = android.os.SystemClock.elapsedRealtime() + phases.add("$name ${now - mark}") + mark = now + } val walker = Walker() val files = context.filesDir val rootfs = LinuxRuntime.rootDir(context) @@ -99,6 +119,7 @@ object StorageScan { val x64Root = SessionPrefs.steamRoot(context, "x86_64").takeIf { SteamStorage.x64ClientPresent(it) } val clients = listOfNotNull("arm64", "x86_64".takeIf { x64Root != null }) fun canonical(f: File) = runCatching { f.canonicalPath }.getOrDefault(f.path) + phase("setup") val art = clients.associate { arch -> (arch == "x86_64") to runCatching { Library.steamGames(context, arch = arch) }.getOrDefault(emptyList()).associateBy { it.appId } } @@ -106,6 +127,7 @@ object StorageScan { class Lib(val root: File, val label: String, val internal: Boolean, val data: File, val listing: SteamStorage.Listing?, val x64: Boolean) { val manifests: List? get() = listing?.manifests } + phase("steam games") val libs = clients.flatMap { arch -> val x64 = arch == "x86_64" val primary = canonical(SessionPrefs.steamRoot(context, arch)) @@ -123,6 +145,7 @@ object StorageScan { val clientIds = libs.groupBy { it.x64 }.mapValues { (_, own) -> own.flatMap { it.listing?.ids.orEmpty() }.toSet() } fun installedGames(x64: Boolean) = libs.filter { it.x64 == x64 }.flatMap { it.manifests.orEmpty() } .filter { !SteamStorage.isTool(it) && it.installed }.map { it.appId.toString() }.toSet() + phase("libraries") val armUse = runCatching { SteamStorage.compatMappings(File(steamRoot, "config/config.vdf").readText()) }.getOrNull() ?.let { SteamStorage.ToolUse(it, installedGames(false)) } val x64Vdf = x64Root?.let { File(it, "config/config.vdf") } @@ -132,8 +155,10 @@ object StorageScan { val uses = listOfNotNull(armUse, x64Use) fun gamesOn(tool: String) = uses.sumOf { it.games(tool) } + val libraryDataRoots = File(files, "steam-libraries").listFiles().orEmpty().filter { it.isDirectory } val tools = LinkedHashMap() val games = ArrayList() + val countedShaders = HashSet() for (lib in libs) { for (m in lib.manifests.orEmpty()) { val dir = m.installDir @@ -153,6 +178,7 @@ object StorageScan { SteamStorage.ARM_RUNTIME -> ToolReason.ARM_RUNTIME SteamStorage.REDISTRIBUTABLES -> ToolReason.REDISTRIBUTABLES SteamStorage.FEX -> ToolReason.FEX + SteamStorage.EAC_RUNTIME, SteamStorage.BATTLEYE_RUNTIME -> ToolReason.ANTICHEAT_RUNTIME else -> ToolReason.STEAM_TOOL } } @@ -175,17 +201,19 @@ object StorageScan { val compatRoot = File(lib.data, "steamapps/compatdata").takeIf { it.isDirectory } ?: File(lib.root, "steamapps/compatdata") val prefixDir = File(compatRoot, m.appId.toString()).takeIf { it.isDirectory } val prefix = prefixDir?.let { walker.measure(it) } ?: 0 - val shaderDir = File(lib.data, "steamapps/shadercache/${m.appId}").takeIf { it.isDirectory } - val shaders = shaderDir?.let { walker.measure(it) } ?: 0 + val shaderDirs = ((listOf(lib) + libs.filter { it !== lib && it.x64 == lib.x64 }).map { it.data } + libraryDataRoots) + .map { File(it, "steamapps/shadercache/${m.appId}") }.filter { it.isDirectory }.distinctBy { canonical(it) } + val shaders = shaderDirs.filter { countedShaders.add(canonical(it)) }.sumOf { walker.measure(it) } val workshop = File(lib.root, "steamapps/workshop/content/${m.appId}").takeIf { it.isDirectory }?.let { walker.measure(it) } ?: 0 val known = art[lib.x64]?.get(m.appId) games.add(GameUsage( m.appId, known?.name ?: m.name, known?.art, lib.label, lib.internal, m.lastPlayed, - gameBytes, prefix, shaders, workshop, shaderDir, lib.x64, prefixDir, + gameBytes, prefix, shaders, workshop, shaderDirs, lib.x64, prefixDir, )) } } + phase("manifests and games") File(steamRoot, "compatibilitytools.d").listFiles()?.sortedBy { it.name }?.forEach { dir -> if (!dir.isDirectory) return@forEach val bytes = walker.measure(dir) @@ -205,6 +233,7 @@ object StorageScan { ) } + phase("compat tools") val leftovers = ArrayList() for (lib in libs) { if (!everyLibraryRead) break @@ -216,16 +245,22 @@ object StorageScan { for (id in (prefixes.keys + caches.keys).sorted()) { val prefix = prefixes[id] val cache = caches[id] - val bytes = (prefix?.let { walker.measure(it) } ?: 0) + (cache?.let { walker.measure(it) } ?: 0) + val prefixBytes = prefix?.let { walker.measure(it) } ?: 0 + val bytes = prefixBytes + (cache?.let { walker.measure(it) } ?: 0) val safe = prefix == null || SteamStorage.isStubPrefix(prefix) - leftovers.add(Leftover(id, prefix, cache, bytes, safe)) + val name = if (safe) null else runCatching { + com.droiddeck.launcher.frontend.SteamAppInfo.info(context, id, File(if (lib.x64) x64Root ?: steamRoot else steamRoot, "appcache/appinfo.vdf"))?.name + }.getOrNull()?.ifEmpty { null } + leftovers.add(Leftover(id.toLong(), prefix, cache, bytes, safe, name = name, prefixBytes = prefixBytes)) } } + phase("leftovers") val logs = SessionPaths.sessionFolders(context).filter { it != SessionPaths.current() } + listOf(File(LinuxRuntime.logDir(context), SessionPaths.TOOLS_DIR)).filter { it.exists() } val logBytes = logs.sumOf { walker.measure(it) } + phase("logs") val flatpakDir = File(rootfs, "root/.local/share/flatpak") val flatpakNames = runCatching { FlatpakManager.installedApps(context) }.getOrDefault(emptyList()).associate { it.id to it.name } val flatpakApps = File(flatpakDir, "app").listFiles().orEmpty().filter { it.isDirectory }.map { dir -> @@ -233,6 +268,7 @@ object StorageScan { }.sortedByDescending { it.bytes } val flatpakRuntimes = File(flatpakDir, "runtime").takeIf { it.isDirectory }?.let { walker.measure(it) } ?: 0 + phase("flatpak") val componentsDir = File(files, "components") val stored = runCatching { ComponentsManager.stored(context) }.onFailure { Log.w("StorageScan", "components", it) }.getOrNull() val components = stored?.let { st -> @@ -240,10 +276,70 @@ object StorageScan { st.originals.map { ComponentUsage(it.comp, it.protonVersion, it.size, it.kept, protonId = it.protonId, protonName = it.protonName) } }.orEmpty() - val otherPrefixes = libs.flatMap { lib -> - File(lib.data, "steamapps/compatdata").listFiles().orEmpty().filter { it.isDirectory && SteamStorage.leftoverId(it.name) == null } - }.sumOf { walker.measure(it) } + phase("components") + val added = com.droiddeck.launcher.frontend.AddedGames.listed(context) + val shortcuts = listOfNotNull(steamRoot, x64Root).map { SteamStorage.shortcuts(it) } + val ownersRead = added != null && shortcuts.all { it != null } + val live = HashMap() + shortcuts.forEach { it?.forEach { (id, s) -> live[id] = s.name } } + added?.forEach { live[it.appId] = it.name } + val folders = SessionPrefs.addedGameFolders(context) + val removedFolders = SessionPrefs.removedAddedGames(context).toSet() + folders.forEach { (id, path) -> if (id !in live && path !in removedFolders && File(path).exists()) live[id] = File(path).name } + val launchers = mapOf( + com.droiddeck.launcher.runtime.BattleNet.APP_ID to com.droiddeck.launcher.stores.Store.BATTLENET.label, + com.droiddeck.launcher.stores.ubisoft.UbisoftConnect.APP_ID to com.droiddeck.launcher.stores.Store.UBISOFT.label, + com.droiddeck.launcher.stores.epic.EpicClient.shortcutAppId to Library.EPIC_LAUNCHER_NAME, + ) + val users = HashMap>() + fun shares(own: Long, name: String, launchOptions: String) { + SteamStorage.sharedPrefixId(launchOptions)?.takeIf { it != own }?.let { users.getOrPut(it) { LinkedHashSet() }.add(name) } + } + added?.forEach { shares(it.appId, it.name, it.launchOptions) } + shortcuts.forEach { it?.forEach { (id, s) -> s.launchOptions.forEach { shares(id, s.name, it) } } } + phase("added games and shortcuts") + val kept = ArrayList() + for (lib in libs) { + val dirs = File(lib.data, "steamapps/compatdata").listFiles().orEmpty().filter { it.isDirectory && SteamStorage.leftoverId(it.name) == null } + val caches = File(lib.data, "steamapps/shadercache").listFiles().orEmpty() + .mapNotNull { f -> SteamStorage.shortcutId(f.name)?.takeIf { f.isDirectory }?.let { it to f } }.toMap() + for (dir in dirs) { + val bytes = walker.measure(dir) + val id = SteamStorage.shortcutId(dir.name) + val cache = id?.let { caches[it] } + val cacheBytes = cache?.let { walker.measure(it) } ?: 0 + when { + dir.name == "0" -> kept.add(KeptPrefix(dir, PrefixOwner.SHARED, null, bytes, lib.label, lib.x64)) + id != null && (id in launchers || id in users) -> kept.add(KeptPrefix(dir, PrefixOwner.LAUNCHER, + launchers[id] ?: live[id]?.ifEmpty { null }, bytes, lib.label, lib.x64, users[id].orEmpty().toList(), cache, cacheBytes)) + id != null && id in live -> kept.add(KeptPrefix(dir, PrefixOwner.GAME, live[id]?.ifEmpty { null }, bytes, lib.label, lib.x64, shaders = cache, shaderBytes = cacheBytes)) + id != null && ownersRead -> { + leftovers.add(Leftover(id, dir, cache, bytes + cacheBytes, SteamStorage.isStubPrefix(dir), + shortcut = true, name = folders[id]?.let { File(it).name } ?: SteamStorage.gameFolderHint(dir), prefixBytes = bytes)) + } + else -> kept.add(KeptPrefix(dir, PrefixOwner.UNKNOWN, id?.toString() ?: dir.name, bytes, lib.label, lib.x64)) + } + } + if (!ownersRead) continue + val prefixIds = dirs.mapNotNullTo(HashSet()) { SteamStorage.shortcutId(it.name) } + for ((id, cache) in caches) { + if (id in prefixIds || id in live || id in launchers || id in users) continue + leftovers.add(Leftover(id, null, cache, walker.measure(cache), true, shortcut = true, name = folders[id]?.let { File(it).name })) + } + } + phase("kept prefixes") + val storeGames = (com.droiddeck.launcher.stores.StoreInstallRoot.gameFolders(context).mapNotNull { folder -> + com.droiddeck.launcher.stores.StoreGameSidecar.read(folder) + ?.takeIf { it.isInstalled || it.state == com.droiddeck.launcher.stores.StoreGameSidecar.STATE_UPDATING } + ?.let { com.droiddeck.launcher.stores.InstalledStoreGame(it, folder) } + } + runCatching { com.droiddeck.launcher.stores.battlenet.BattleNetBackend.installedGames(context) }.getOrDefault(emptyList())) + .map { g -> + val internal = g.folder.path.startsWith(files.path + "/") + StoreGameUsage(g, if (internal) walker.measure(g.folder) else -1L, internal) + }.sortedByDescending { it.bytes } + + phase("store games") val clientRoots = listOfNotNull(steamRoot, x64Root) val apps = clientRoots.map { File(it, "steamapps") } val privateRoots = File(files, "steam-libraries").listFiles().orEmpty().filter { it.isDirectory } @@ -268,6 +364,8 @@ object StorageScan { val componentBytes = m(componentsDir) val droiddeck = m(files) + m(context.cacheDir) - rootfsBytes - privateBytes - componentBytes + (privateBytes - toolsPrivate - privatePrefixes - privateShaders) + phase("totals") + Log.i("StorageScan", "scan ms: " + phases.joinToString(", ")) val stat = StatFs(files.path) return StorageReport( System.currentTimeMillis(), stat.totalBytes, stat.availableBytes, @@ -283,7 +381,7 @@ object StorageScan { ), prefixes, shaders, workshop, flatpak, games.sortedByDescending { it.total }, tools.values.toList(), leftovers, logs, logBytes, - components, flatpakApps, flatpakRuntimes, otherPrefixes, everyLibraryRead, + components, flatpakApps, flatpakRuntimes, kept, everyLibraryRead, storeGames, ) } } diff --git a/app/src/main/java/com/droiddeck/launcher/storage/StorageState.kt b/app/src/main/java/com/droiddeck/launcher/storage/StorageState.kt index 331c5b402f..40a48a3669 100644 --- a/app/src/main/java/com/droiddeck/launcher/storage/StorageState.kt +++ b/app/src/main/java/com/droiddeck/launcher/storage/StorageState.kt @@ -13,6 +13,7 @@ import com.droiddeck.launcher.files.FileOps import com.droiddeck.launcher.runtime.FlatpakManager import com.droiddeck.launcher.session.ComponentsManager import com.droiddeck.launcher.session.SessionState +import com.droiddeck.launcher.stores.StoreGameSidecar enum class CleanItem { OLD_TOOLS, LEFTOVERS, LEFTOVERS_UNSURE, LOGS, UNUSED_CUSTOM, UNUSED_COMPONENTS, SHADERS } @@ -27,6 +28,45 @@ object StorageState { private set var cleaning by mutableStateOf(false) private set + var storeBatch by mutableStateOf(false) + private set + val busy: Boolean get() = cleaning || storeBatch + private var refreshAgain = false + val storeSizes = androidx.compose.runtime.mutableStateMapOf() + private var measuringStores = false + + private fun sizeKey(usage: StoreGameUsage): String = with(usage.game) { + "${folder.path}|${sidecar.installVersion}|${sidecar.installedAt}|${StoreGameSidecar.file(folder).lastModified()}" + } + + fun storeBytes(usage: StoreGameUsage): Long = if (usage.bytes >= 0) usage.bytes else storeSizes[sizeKey(usage)] ?: -1L + + private fun measureStoreGames(app: Context) { + val current = report ?: return + if (measuringStores) return + val wanted = current.storeGames.filter { it.bytes < 0 && sizeKey(it) !in storeSizes }.map { sizeKey(it) to it.game.folder } + if (wanted.isEmpty()) return + measuringStores = true + Thread({ + val started = android.os.SystemClock.elapsedRealtime() + for ((key, folder) in wanted) { + val bytes = runCatching { StorageScan.measure(folder) }.getOrDefault(0L) + main.post { storeSizes[key] = bytes } + } + Log.i(TAG, "measured ${wanted.size} store games on removable storage in ${android.os.SystemClock.elapsedRealtime() - started} ms") + main.post { + measuringStores = false + measureStoreGames(app) + } + }, "storage-store-sizes").start() + } + + private fun publish(app: Context, result: StorageReport) { + report = result + val live = result.storeGames.mapTo(HashSet()) { sizeKey(it) } + storeSizes.keys.retainAll(live) + measureStoreGames(app) + } var lastFreed by mutableStateOf(null) var progress by mutableStateOf(null) private set @@ -48,16 +88,21 @@ object StorageState { fun refresh(context: Context, force: Boolean = false) { val current = report - if (scanning || cleaning) return + if (scanning || cleaning) { + if (force) refreshAgain = true + return + } if (!force && current != null && System.currentTimeMillis() - current.at < FRESH_MS) return + refreshAgain = false val app = context.applicationContext scanning = true Thread({ val result = runCatching { StorageScan.scan(app) } .onFailure { Log.w(TAG, "storage scan failed", it) }.getOrNull() main.post { - if (result != null) report = result + if (result != null) publish(app, result) scanning = false + if (refreshAgain) refresh(app, force = true) } }, "storage-scan").start() } @@ -84,7 +129,7 @@ object StorageState { fun safeBytes(report: StorageReport): Long = SAFE.sumOf { bytes(report, it) } fun clean(context: Context, items: Set, onDone: (Long?) -> Unit) { - if (cleaning || SessionState.running) { onDone(null); return } + if (busy || SessionState.running) { onDone(null); return } val app = context.applicationContext appContext = app cleaning = true @@ -101,7 +146,7 @@ object StorageState { } fun removeTool(context: Context, tool: ToolUsage, onDone: (Long?) -> Unit) { - if (tool.state != ToolState.UNUSED || cleaning || SessionState.running) { onDone(null); return } + if (tool.state != ToolState.UNUSED || busy || SessionState.running) { onDone(null); return } val app = context.applicationContext cleaning = true Thread({ @@ -119,7 +164,7 @@ object StorageState { } private fun act(context: Context, name: String, action: (Context, StorageReport) -> Boolean, onDone: (Long?) -> Unit = {}) { - if (cleaning || SessionState.running) { onDone(null); return } + if (busy || SessionState.running) { onDone(null); return } val app = context.applicationContext appContext = app cleaning = true @@ -137,8 +182,8 @@ object StorageState { } fun clearShaders(context: Context, appId: Int, x64: Boolean = false) = act(context, "shaders-$appId", { _, fresh -> - val dir = fresh.games.firstOrNull { it.appId == appId && it.x64 == x64 }?.shaderDir ?: return@act false - FileOps.delete(dir) + val dirs = fresh.games.firstOrNull { it.appId == appId && it.x64 == x64 }?.shaderDirs.orEmpty() + dirs.isNotEmpty() && dirs.map { FileOps.delete(it) }.all { it } }) fun resetPrefix(context: Context, game: GameUsage) = act(context, "prefix-${game.appId}", { _, fresh -> @@ -155,6 +200,41 @@ object StorageState { true }) + fun resetKept(context: Context, prefix: KeptPrefix) = act(context, "kept-${prefix.dir.name}", { _, fresh -> + val dir = fresh.kept.firstOrNull { it.dir.path == prefix.dir.path && it.owner == prefix.owner } + ?.takeIf { it.owner == PrefixOwner.SHARED || it.owner == PrefixOwner.GAME }?.dir ?: return@act false + check(FileOps.delete(dir)) { "cannot delete $dir" } + true + }) + + fun uninstallStoreGames(context: Context, games: List) { + if (busy || SessionState.running || games.isEmpty()) return + storeBatch = true + uninstallNext(context.applicationContext, games) + } + + private fun uninstallNext(app: Context, games: List) { + val rest = games.dropWhile { com.droiddeck.launcher.stores.download.DownloadQueue.isActive(it.game.key) } + val next = rest.firstOrNull() + if (next == null || SessionState.running) { + storeBatch = false + com.droiddeck.launcher.stores.StoresState.notifyLibraryChanged(app) + refresh(app, force = true) + return + } + com.droiddeck.launcher.stores.StoresState.uninstall(app, next.game) { uninstallNext(app, rest.drop(1)) } + } + + fun removeDirs(context: Context, dirs: List) = act(context, "remove-${dirs.size}", { _, fresh -> + val allowed = (fresh.games.flatMap { it.shaderDirs + listOfNotNull(it.prefixDir) } + fresh.leftovers.flatMap { listOfNotNull(it.prefix, it.shaders) } + + fresh.kept.filter { it.owner == PrefixOwner.SHARED || it.owner == PrefixOwner.GAME }.flatMap { listOfNotNull(it.dir, it.shaders) }).mapTo(HashSet()) { it.path } + val wanted = dirs.distinctBy { it.path } + val targets = wanted.filter { it.path in allowed } + if (targets.size < wanted.size) Log.w(TAG, "kept ${wanted.size - targets.size} folders that are no longer safe to remove") + targets.forEach { check(FileOps.delete(it)) { "cannot delete $it" } } + targets.isNotEmpty() + }) + fun removeComponent(context: Context, usage: ComponentUsage) = act(context, "component", { app, fresh -> val current = fresh.components.firstOrNull { it.packageFile == usage.packageFile && it.protonId == usage.protonId && it.comp == usage.comp && it.version == usage.version } ?: return@act false @@ -186,10 +266,11 @@ object StorageState { private fun finish(app: Context, freed: Long?, onDone: (Long?) -> Unit) { val rescanned = runCatching { StorageScan.scan(app) }.getOrNull() main.post { - if (rescanned != null) report = rescanned + if (rescanned != null) publish(app, rescanned) cleaning = false lastFreed = freed onDone(freed) + if (refreshAgain) refresh(app, force = true) } } @@ -201,7 +282,7 @@ object StorageState { CleanItem.LEFTOVERS -> report.leftovers.filter { it.safe }.forEach(::deleteLeftover) CleanItem.LEFTOVERS_UNSURE -> report.leftovers.filter { !it.safe }.forEach(::deleteLeftover) CleanItem.LOGS -> report.logs.forEach { FileOps.delete(it) } - CleanItem.SHADERS -> report.games.mapNotNull { it.shaderDir }.forEach { FileOps.delete(it) } + CleanItem.SHADERS -> report.games.flatMap { it.shaderDirs }.forEach { FileOps.delete(it) } } } diff --git a/app/src/main/java/com/droiddeck/launcher/stores/CloudSaves.kt b/app/src/main/java/com/droiddeck/launcher/stores/CloudSaves.kt index 48244c4895..106719d559 100644 --- a/app/src/main/java/com/droiddeck/launcher/stores/CloudSaves.kt +++ b/app/src/main/java/com/droiddeck/launcher/stores/CloudSaves.kt @@ -87,7 +87,7 @@ object CloudSaves { val item = sidecar.extra["catalogItemId"].orEmpty() if (ns.isEmpty() || item.isEmpty()) "" else EpicApiClient.getCustomAttribute(token, ns, item, "CloudSaveFolder") } - Store.AMAZON, Store.ITCH, Store.GAMEJOLT, Store.XBOX, Store.BATTLENET -> "" + Store.AMAZON, Store.ITCH, Store.GAMEJOLT, Store.XBOX, Store.BATTLENET, Store.EA, Store.UBISOFT, Store.ROCKSTAR -> "" } ?: return null p.edit() .putString("cloud_template_$id", fetched.ifEmpty { TEMPLATE_NONE }) @@ -148,7 +148,7 @@ object CloudSaves { val dir = when (store) { Store.GOG -> CloudSavePaths.gog(template, pfx, folder) Store.EPIC -> CloudSavePaths.epic(template, pfx, folder, EpicCredentialStore.load(context)?.accountId.orEmpty(), id) - Store.AMAZON, Store.ITCH, Store.GAMEJOLT, Store.XBOX, Store.BATTLENET -> null + Store.AMAZON, Store.ITCH, Store.GAMEJOLT, Store.XBOX, Store.BATTLENET, Store.EA, Store.UBISOFT, Store.ROCKSTAR -> null } return dir to (if (dir == null) "unresolved" else "ok") } @@ -173,7 +173,7 @@ object CloudSaves { val account = EpicCredentialStore.load(context)?.accountId.orEmpty() if (token == null || account.isEmpty()) null else EpicCloud(account, id, token) } - Store.AMAZON, Store.ITCH, Store.GAMEJOLT, Store.XBOX, Store.BATTLENET -> null + Store.AMAZON, Store.ITCH, Store.GAMEJOLT, Store.XBOX, Store.BATTLENET, Store.EA, Store.UBISOFT, Store.ROCKSTAR -> null } private fun gogScopedToken(context: Context, id: String, clientId: String): String? { diff --git a/app/src/main/java/com/droiddeck/launcher/stores/LoginFlows.kt b/app/src/main/java/com/droiddeck/launcher/stores/LoginFlows.kt index 4e53c5ea08..a1b54088eb 100644 --- a/app/src/main/java/com/droiddeck/launcher/stores/LoginFlows.kt +++ b/app/src/main/java/com/droiddeck/launcher/stores/LoginFlows.kt @@ -13,11 +13,17 @@ internal object LoginFlows { Store.EPIC -> epicFlow() Store.AMAZON -> amazonFlow() Store.GAMEJOLT -> gameJoltFlow(browserUserAgent) + Store.UBISOFT -> ubisoftFlow(browserUserAgent) + Store.EA -> eaFlow(browserUserAgent) + Store.ROCKSTAR -> rockstarFlow(browserUserAgent) Store.ITCH, Store.XBOX, Store.BATTLENET -> null } @Volatile var epicFlow: () -> StoreLoginActivity.Flow? = { null } @Volatile var amazonFlow: () -> StoreLoginActivity.Flow? = { null } + @Volatile var ubisoftFlow: (String) -> StoreLoginActivity.Flow? = { null } + @Volatile var eaFlow: (String) -> StoreLoginActivity.Flow? = { null } + @Volatile var rockstarFlow: (String) -> StoreLoginActivity.Flow? = { null } @Volatile var gameJoltFlow: (String) -> StoreLoginActivity.Flow? = { null } private class GogFlow(private val state: String, override val userAgent: String) : StoreLoginActivity.Flow { diff --git a/app/src/main/java/com/droiddeck/launcher/stores/Store.kt b/app/src/main/java/com/droiddeck/launcher/stores/Store.kt index b7d0fbce1c..b48530fbea 100644 --- a/app/src/main/java/com/droiddeck/launcher/stores/Store.kt +++ b/app/src/main/java/com/droiddeck/launcher/stores/Store.kt @@ -7,7 +7,10 @@ enum class Store(val id: String, val label: String, val shortLabel: String) { XBOX("xbox", "Xbox", "Xbox"), ITCH("itch", "Itch.io", "Itch.io"), GAMEJOLT("gamejolt", "Game Jolt", "Game Jolt"), - BATTLENET("battlenet", "Battle.net", "Battle.net"); + BATTLENET("battlenet", "Battle.net", "Battle.net"), + UBISOFT("ubisoft", "Ubisoft Connect", "Ubisoft"), + EA("ea", "EA", "EA"), + ROCKSTAR("rockstar", "Rockstar Games", "Rockstar"); val folder: String get() = if (this == ITCH) "itch" else shortLabel diff --git a/app/src/main/java/com/droiddeck/launcher/stores/StoreAccounts.kt b/app/src/main/java/com/droiddeck/launcher/stores/StoreAccounts.kt index 5de9b5e1ab..5e30fb7a5d 100644 --- a/app/src/main/java/com/droiddeck/launcher/stores/StoreAccounts.kt +++ b/app/src/main/java/com/droiddeck/launcher/stores/StoreAccounts.kt @@ -67,8 +67,8 @@ object StoreAccounts { fun write(context: Context, store: Store, json: JSONObject) { unavailable.remove(store) val f = credentialsFile(context, store) - if (seal(f, json, retry = store == Store.XBOX) == null) { - check(store != Store.XBOX) { "Android Keystore is unavailable for Xbox credentials" } + if (seal(f, json, retry = store == Store.XBOX || store == Store.ROCKSTAR) == null) { + check(store != Store.XBOX && store != Store.ROCKSTAR) { "Android Keystore is unavailable for ${store.label} credentials" } put(f, json.toString()) } } diff --git a/app/src/main/java/com/droiddeck/launcher/stores/StoreCatalog.kt b/app/src/main/java/com/droiddeck/launcher/stores/StoreCatalog.kt index cb46d23601..e87266df65 100644 --- a/app/src/main/java/com/droiddeck/launcher/stores/StoreCatalog.kt +++ b/app/src/main/java/com/droiddeck/launcher/stores/StoreCatalog.kt @@ -106,6 +106,7 @@ fun detailCatalogItem( library.firstOrNull { it.store == store && it.id == id } ?: found.firstOrNull { it.store == store && it.id == id } ?: shelves?.all?.firstOrNull { it.store == store && it.id == id } + ?: shelves?.all?.firstOrNull { it.store == store && it.extra[StoreFront.STORE_CARD] == id } fun mergeItems(old: List?, new: List): List { if (old.isNullOrEmpty()) return new diff --git a/app/src/main/java/com/droiddeck/launcher/stores/StoreExe.kt b/app/src/main/java/com/droiddeck/launcher/stores/StoreExe.kt index ad2d478c18..0e9792edc7 100644 --- a/app/src/main/java/com/droiddeck/launcher/stores/StoreExe.kt +++ b/app/src/main/java/com/droiddeck/launcher/stores/StoreExe.kt @@ -3,7 +3,8 @@ package com.droiddeck.launcher.stores import java.io.File object StoreExe { - private val SKIP = listOf("redist", "unins", "setup", "crash", "report", "helper", "dotnet", "vcredist", "directx", "eac", "easyanticheat", "battleye", "launcher", "updater", "config") + private val SKIP = listOf("redist", "unins", "setup", "crash", "report", "helper", "dotnet", "vcredist", "directx", "eac", "easyanticheat", "battleye", "launcher", "updater", "config", "installer", "autorun") + private val SKIP_DIRS = setOf("installer_resources", "redist", "_commonredist", "support") fun pick(folder: File, hint: String?, title: String): String { val hinted = hint?.takeIf { it.isNotBlank() }?.replace('\\', '/')?.trimStart('/')?.let { File(folder, it) } @@ -28,7 +29,7 @@ object StoreExe { if (SKIP.none { lower.contains(it) }) out.add(f) } } - for (f in files) if (f.isDirectory && !f.name.startsWith(".")) collect(f, out, depth + 1) + for (f in files) if (f.isDirectory && !f.name.startsWith(".") && f.name.lowercase() !in SKIP_DIRS) collect(f, out, depth + 1) } private fun depth(root: File, f: File): Int = relative(root, f).count { it == '/' } diff --git a/app/src/main/java/com/droiddeck/launcher/stores/StoreFront.kt b/app/src/main/java/com/droiddeck/launcher/stores/StoreFront.kt new file mode 100644 index 0000000000..5791656111 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/stores/StoreFront.kt @@ -0,0 +1,119 @@ +package com.droiddeck.launcher.stores + +import android.content.SharedPreferences +import org.json.JSONArray +import org.json.JSONObject +import java.text.Normalizer +import java.util.Locale + +/** Store shelves fetched from a public catalog, kept in memory and on disk between refreshes. */ +internal class StoreFront( + private val store: Store, + private val prefs: () -> SharedPreferences, + private val fetch: () -> Catalog, + private val key: String = "store_front", + private val ttlMs: Long = 3 * 60 * 60 * 1000L, +) { + /** One refresh: the shelves and every game the store lists, for search. */ + class Catalog(val shelves: StoreShelves, val all: List = shelves.all) + + @Volatile private var memory: Catalog? = null + @Volatile private var memoryAt = 0L + + fun cached(): StoreShelves? = cachedCatalog()?.shelves + + fun everything(): List = cachedCatalog()?.all.orEmpty() + + private fun cachedCatalog(): Catalog? = memory ?: decode(prefs().getString(key, null))?.also { memory = it } + + /** The shelves, refreshed when stale; a refresh that fails keeps the last good set. */ + fun shelves(force: Boolean): StoreShelves? { + val now = System.currentTimeMillis() + if (!force) { + memory?.takeIf { now - memoryAt in 0 until ttlMs }?.let { return it.shelves } + val at = prefs().getLong("${key}_at", 0L) + if (now - at in 0 until ttlMs) decode(prefs().getString(key, null))?.let { memory = it; memoryAt = at; return it.shelves } + } + val fresh = runCatching(fetch).onFailure { StoresState.logLine("${store.label}: store shelves failed: ${it.javaClass.simpleName} ${it.message.orEmpty().take(160)}") } + .getOrNull()?.takeUnless { it.shelves.isEmpty } + ?: return cached() + prefs().edit().putString(key, encode(fresh)).putLong("${key}_at", now).apply() + memory = fresh + memoryAt = now + return fresh.shelves + } + + private fun encode(c: Catalog): String = JSONObject().apply { + val s = c.shelves + listOf(s.whatsNew, s.deals, s.free, s.trending).zip(SHELVES).forEach { (items, k) -> put(k, JSONArray(items.map { it.id })) } + put("art", JSONArray(s.art)) + put("items", JSONArray().apply { (c.all + s.all).distinctBy { it.id }.forEach { put(itemJson(it)) } }) + }.toString() + + private fun decode(text: String?): Catalog? { + val o = text?.let { runCatching { JSONObject(it) }.getOrNull() } ?: return null + val items = o.optJSONArray("items")?.let { a -> (0 until a.length()).mapNotNull { a.optJSONObject(it)?.let(::itemFrom) } }.orEmpty() + val byId = items.associateBy { it.id } + fun shelf(k: String) = o.optJSONArray(k)?.let { a -> (0 until a.length()).mapNotNull { byId[a.optString(it)] } }.orEmpty() + val art = o.optJSONArray("art")?.let { a -> List(a.length()) { a.optString(it) }.filter { it.isNotEmpty() } }.orEmpty() + val shelves = StoreShelves(shelf("new"), shelf("deals"), shelf("free"), shelf("trending"), art).takeUnless { it.isEmpty } ?: return null + return Catalog(shelves, items) + } + + private fun itemJson(i: CatalogItem) = JSONObject() + .put("id", i.id).put("title", i.title).put("image", i.imageUrl.orEmpty()).put("tall", i.tallImageUrl.orEmpty()).put("tags", i.tags) + .put("free", i.isFree).put("hasPrice", i.hasPrice).put("final", i.finalPrice).put("orig", i.originalPrice).put("disc", i.discountPercent) + .put("url", i.storeUrl).put("dev", i.developer).put("pub", i.publisher).put("rel", i.releaseDate).put("desc", i.description) + .put("mature", i.mature).put("logo", i.logoUrl.orEmpty()).put("extra", JSONObject(i.extra as Map<*, *>)) + + private fun itemFrom(o: JSONObject): CatalogItem? { + val extra = LinkedHashMap() + o.optJSONObject("extra")?.let { e -> e.keys().forEach { k -> extra[k] = e.optString(k) } } + return CatalogItem( + store = store, id = o.optString("id").ifEmpty { return null }, title = o.optString("title").ifEmpty { return null }, + imageUrl = o.optString("image").ifEmpty { null }, tallImageUrl = o.optString("tall").ifEmpty { null }, tags = o.optString("tags"), + isFree = o.optBoolean("free"), hasPrice = o.optBoolean("hasPrice"), finalPrice = o.optString("final"), originalPrice = o.optString("orig"), + discountPercent = o.optInt("disc"), storeUrl = o.optString("url"), developer = o.optString("dev"), publisher = o.optString("pub"), + releaseDate = o.optString("rel"), description = o.optString("desc"), mature = o.optBoolean("mature"), + logoUrl = o.optString("logo").ifEmpty { null }, extra = extra, + ) + } + + companion object { + /** On an owned game standing in for a store card: the card's id, so a page opened on the card still finds it. */ + const val STORE_CARD = "storeCard" + private val SHELVES = listOf("new", "deals", "free", "trending") + private val MARKS = Regex("[\\u2122\\u00AE\\u00A9]") + private val COMBINING = Regex("\\p{M}+") + private val NOT_WORD = Regex("[^\\p{L}\\p{N}]+") + + /** A title reduced to letters and digits, so "Far Cryยฎ 6" and "Far Cry 6" meet, and "Pokรฉmon" meets "Pokemon". */ + fun titleKey(title: String): String = + Normalizer.normalize(title.replace(MARKS, ""), Normalizer.Form.NFD).replace(COMBINING, "") + .lowercase(Locale.ROOT).replace(NOT_WORD, " ").trim() + + /** + * Shelf cards the account owns become its library entry, which carries what installing needs, + * keeping the shelf's art and price. + */ + fun markOwned(s: StoreShelves, library: List?, match: (CatalogItem, CatalogItem) -> Boolean): StoreShelves { + if (library.isNullOrEmpty()) return s + fun mark(list: List) = markOwned(list, library, match) + return StoreShelves(mark(s.whatsNew), mark(s.deals), mark(s.free), mark(s.trending), s.art) + } + + fun markOwned(list: List, library: List?, match: (CatalogItem, CatalogItem) -> Boolean): List { + if (library.isNullOrEmpty()) return list + return list.map { shelf -> + val owned = library.firstOrNull { match(shelf, it) } ?: return@map shelf + owned.copy( + imageUrl = shelf.imageUrl ?: owned.imageUrl, tallImageUrl = owned.tallImageUrl ?: shelf.tallImageUrl, + tags = owned.tags.ifBlank { shelf.tags }, description = owned.description.ifBlank { shelf.description }, + releaseDate = owned.releaseDate.ifBlank { shelf.releaseDate }, storeUrl = shelf.storeUrl.ifBlank { owned.storeUrl }, + developer = owned.developer.ifBlank { shelf.developer }, mature = shelf.mature, + extra = owned.extra + (STORE_CARD to shelf.id), + ) + }.distinctBy { it.id } + } + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/stores/StoreInstalls.kt b/app/src/main/java/com/droiddeck/launcher/stores/StoreInstalls.kt index c29ea41652..e792b67a94 100644 --- a/app/src/main/java/com/droiddeck/launcher/stores/StoreInstalls.kt +++ b/app/src/main/java/com/droiddeck/launcher/stores/StoreInstalls.kt @@ -89,16 +89,62 @@ object StoreInstalls { StoresState.logLine("uninstalled \"${game.sidecar.title}\"") } + private val discarding = HashMap() + + fun isDiscarding(folder: File): Boolean = synchronized(discarding) { folder.absolutePath in discarding } + + internal fun beginDiscard(folder: File) { synchronized(discarding) { discarding.merge(folder.absolutePath, 1, Int::plus) } } + + internal fun endDiscard(folder: File) { + synchronized(discarding) { + discarding.computeIfPresent(folder.absolutePath) { _, n -> (n - 1).takeIf { it > 0 } } + (discarding as Object).notifyAll() + } + } + + fun awaitDiscard(folder: File) { + synchronized(discarding) { while (folder.absolutePath in discarding) (discarding as Object).wait() } + } + + private val started = ThreadLocal?>() + + fun collectingDiscards(into: MutableList = ArrayList(), block: () -> Unit): List { + val previous = started.get() + started.set(into) + try { + block() + } finally { + started.set(previous) + previous?.addAll(into) + } + return into + } + fun discard(context: Context, folder: File, caches: List) { val app = context.applicationContext - Thread({ - val sidecar = StoreGameSidecar.read(folder) - val keep = sidecar?.isInstalled == true || sidecar?.state == StoreGameSidecar.STATE_UPDATING - caches.forEach { deleteTree(it) } - if (!keep) deleteTree(folder) - StoresState.logLine(if (keep) "removed update caches for ${folder.name}; verified file swaps are retained" else "removed ${folder.name}") - StoresState.notifyLibraryChanged(app) - }, "store-cancel-clean").start() + beginDiscard(folder) + val worker = Thread({ + try { + discardNow(app, folder, caches) + } finally { + endDiscard(folder) + } + }, "store-cancel-clean") + started.get()?.add(worker) + worker.start() + } + + @androidx.annotation.VisibleForTesting + internal var beforeDiscard: (File) -> Unit = {} + + private fun discardNow(app: Context, folder: File, caches: List) { + beforeDiscard(folder) + val sidecar = StoreGameSidecar.read(folder) + val keep = sidecar?.isInstalled == true || sidecar?.state == StoreGameSidecar.STATE_UPDATING + caches.forEach { deleteTree(it) } + if (!keep) deleteTree(folder) + StoresState.logLine(if (keep) "removed update caches for ${folder.name}; verified file swaps are retained" else "removed ${folder.name}") + StoresState.notifyLibraryChanged(app) } fun deleteTree(dir: File) { diff --git a/app/src/main/java/com/droiddeck/launcher/stores/StoreLaunch.kt b/app/src/main/java/com/droiddeck/launcher/stores/StoreLaunch.kt index 378d7fa74b..f45a23c654 100644 --- a/app/src/main/java/com/droiddeck/launcher/stores/StoreLaunch.kt +++ b/app/src/main/java/com/droiddeck/launcher/stores/StoreLaunch.kt @@ -11,10 +11,16 @@ object StoreLaunch { const val LAUNCHER = ".droiddeck-launch.bat" const val EPIC_CODE = ".droiddeck-epic-code" const val EPIC_ARGS = ".droiddeck-epic-args" + const val UBISOFT_LAUNCH = ".droiddeck-ubisoft.json" + private const val UBISOFT_SERVICE = "Z:\\usr\\local\\lib\\droiddeck-ubisoft\\droiddeck-upc.exe" + const val EA_ENV = ".droiddeck-ea-env" + /** A sleeping stand-in that the launch hook installs; older EA SDKs require a running Origin process. */ + const val EA_ORIGIN = "C:\\Program Files (x86)\\Origin\\Origin.exe" fun writeLauncher(folder: File, sidecar: StoreGameSidecar): StoreGameSidecar { - val needs = sidecar.args.isNotEmpty() || sidecar.env.isNotEmpty() || sidecar.store == Store.EPIC + val needs = sidecar.args.isNotEmpty() || sidecar.env.isNotEmpty() || sidecar.store == Store.EPIC || sidecar.store == Store.EA || sidecar.store == Store.UBISOFT || sidecar.store == Store.ROCKSTAR val file = File(folder, LAUNCHER) + if (sidecar.store == Store.ROCKSTAR && java.nio.file.Files.isSymbolicLink(file.toPath())) return sidecar.copy(launcher = null) if (!needs) { file.delete(); return sidecar.copy(launcher = null) } file.writeText(launcherText(sidecar)) return sidecar.copy(launcher = LAUNCHER) @@ -26,11 +32,11 @@ object StoreLaunch { ?: exe.substringBeforeLast('\\', "") val lines = ArrayList() lines += "@echo off" - lines += "setlocal" - lines += "rem Written by DroidDeck for ${sidecar.store.label}: ${sidecar.title}. Steam's shortcut runs this file." + lines += if (sidecar.store == Store.ROCKSTAR) "setlocal DisableDelayedExpansion" else "setlocal" + if (sidecar.store != Store.ROCKSTAR) lines += "rem Written by DroidDeck for ${sidecar.store.label}: ${sidecar.title}. Steam's shortcut runs this file." lines += "cd /d \"%~dp0$dir\"" for ((k, v) in sidecar.env) if (ENV_NAME.matches(k)) lines += "set \"$k=${v.replace("\"", "")}\"" - val args = sidecar.args.joinToString(" ") { quoteArg(it) } + val args = sidecar.args.joinToString(" ") { if (sidecar.store == Store.ROCKSTAR) batchArg(it) else quoteArg(it) } val run = "\"%~dp0$exe\"" + (if (args.isNotEmpty()) " $args" else "") if (sidecar.store == Store.EPIC) { lines += "if exist \"%~dp0$EPIC_ARGS\" goto client" @@ -49,6 +55,27 @@ object StoreLaunch { lines += "del \"%~dp0$EPIC_ARGS\"" lines += "if exist \"%~dp0$EPIC_CODE\" del \"%~dp0$EPIC_CODE\"" lines += "set \"$CLIENT_VAR=\" & \"%~dp0$exe\" %$CLIENT_VAR%" + } else if (sidecar.store == Store.ROCKSTAR) { + lines += "if not exist \"C:\\Program Files\\Rockstar Games\\Launcher\\launch.json\" goto direct" + lines += "\"C:\\Program Files\\Rockstar Games\\Launcher\\Launcher.exe\"" + lines += "exit /b %errorlevel%" + lines += ":direct" + lines += run + } else if (sidecar.store == Store.UBISOFT) { + lines += "if not exist \"%~dp0$UBISOFT_LAUNCH\" goto direct" + lines += "if not exist \"$UBISOFT_SERVICE\" goto direct" + lines += "\"$UBISOFT_SERVICE\" \"%~dp0$UBISOFT_LAUNCH\"" + lines += "goto :eof" + lines += ":direct" + lines += run + } else if (sidecar.store == Store.EA) { + lines += "if not exist \"%~dp0$EA_ENV\" goto run" + lines += "for /f \"usebackq tokens=1,* delims==\" %%a in (\"%~dp0$EA_ENV\") do set \"%%a=%%b\"" + lines += "del \"%~dp0$EA_ENV\"" + lines += ":run" + lines += "if exist \"$EA_ORIGIN\" start \"\" \"$EA_ORIGIN\"" + lines += run + lines += "taskkill /f /im Origin.exe >nul 2>&1" } else { lines += run } @@ -57,6 +84,22 @@ object StoreLaunch { private val ENV_NAME = Regex("[A-Za-z_][A-Za-z0-9_]*") + private fun batchArg(arg: String): String { + val quoted = StringBuilder("\"") + var slashes = 0 + for (c in arg.filter { it >= ' ' && it != '\u007f' }) { + if (c == '\\') { slashes++; continue } + quoted.append("\\".repeat(if (c == '"') slashes * 2 + 1 else slashes)).append(c) + slashes = 0 + } + quoted.append("\\".repeat(slashes * 2)).append('"') + return quoted.toString().map { c -> when (c) { + '%' -> "%%" + in "^&|<>()\"" -> "^$c" + else -> c.toString() + } }.joinToString("") + } + fun quoteArg(arg: String): String { val clean = arg.filter { it >= ' ' && it != '\u007f' } return if (' ' in clean && !clean.contains('"')) "\"$clean\"" else clean @@ -73,6 +116,19 @@ object StoreLaunch { return Library.addedGame(context, game) } + fun adopt(folder: File, sidecar: StoreGameSidecar): StoreGameSidecar { + if (sidecar.store !in listOf(Store.UBISOFT, Store.ROCKSTAR) || !sidecar.isInstalled) return sidecar + if (sidecar.store == Store.ROCKSTAR && java.nio.file.Files.isSymbolicLink(File(folder, LAUNCHER).toPath())) return sidecar.copy(launcher = null) + val wrongExe = !sidecar.exeFile(folder).isFile || sidecar.exe.contains("installer", ignoreCase = true) || sidecar.exe.contains("autorun", ignoreCase = true) + if (sidecar.store == Store.UBISOFT && sidecar.launcher == LAUNCHER && !wrongExe) return sidecar + val metadataExe = if (sidecar.store == Store.ROCKSTAR) com.droiddeck.launcher.stores.rockstar.RockstarMetadata.find(folder)?.exe + ?.takeIf { File(folder, it).isFile && File(folder, it).canonicalPath.startsWith(folder.canonicalPath + File.separator) } else null + val exe = metadataExe ?: if (wrongExe) StoreExe.pick(folder, null, sidecar.title).ifEmpty { sidecar.exe } else sidecar.exe + if (exe == sidecar.exe && sidecar.launcher == LAUNCHER && + runCatching { File(folder, LAUNCHER).readText() }.getOrNull() == launcherText(sidecar)) return sidecar + return runCatching { writeLauncher(folder, sidecar.copy(exe = exe)).also { it.write(folder) } }.getOrDefault(sidecar) + } + fun refreshLauncher(folder: File, sidecar: StoreGameSidecar) { if (sidecar.launcher != LAUNCHER) return val file = File(folder, LAUNCHER) diff --git a/app/src/main/java/com/droiddeck/launcher/stores/StoreLaunchRequests.kt b/app/src/main/java/com/droiddeck/launcher/stores/StoreLaunchRequests.kt index b4b9f7669a..979e363ccd 100644 --- a/app/src/main/java/com/droiddeck/launcher/stores/StoreLaunchRequests.kt +++ b/app/src/main/java/com/droiddeck/launcher/stores/StoreLaunchRequests.kt @@ -38,6 +38,7 @@ object StoreLaunchRequests { fun stop() { com.droiddeck.launcher.stores.xbox.XboxRuntime.stop() + com.droiddeck.launcher.stores.ea.EaLsx.stop() synchronized(lock) { observer?.stopWatching() observer = null @@ -58,6 +59,12 @@ object StoreLaunchRequests { "xbox-renew" -> JSONObject().put("ok", com.droiddeck.launcher.stores.xbox.XboxRuntime.renew(app, request.optString("id"), request.optString("lease"))) "xbox-prepare" -> runCatching { com.droiddeck.launcher.stores.xbox.XboxRuntime.prepare(app, request.getString("id")) } .getOrElse { JSONObject().put("ok", false).put("reason", "Xbox account service is unavailable. Sign in again and retry.") } + "ea-prepare" -> runCatching { lastLaunched = Store.EA to request.optString("id"); com.droiddeck.launcher.stores.ea.EaLaunch.prepare(app, request) } + .getOrElse { JSONObject().put("ok", false).put("reason", "error-" + it.javaClass.simpleName) } + "ea-exited" -> { + com.droiddeck.launcher.stores.ea.EaLsx.stop(request.optString("id")) + JSONObject().put("ok", true) + } "gog-achievements" -> runCatching { com.droiddeck.launcher.stores.gog.GogComet.prepare(app, request.optString("id")) } .getOrElse { JSONObject().put("ok", false).put("ready", false).put("reason", "service-unavailable") } "epic-code" -> { @@ -69,6 +76,23 @@ object StoreLaunchRequests { JSONObject().put("ok", true).put("code", code.written).put("reason", code.reason) } } + "rockstar-launch" -> runCatching { + lastLaunched = Store.ROCKSTAR to request.optString("id") + com.droiddeck.launcher.stores.rockstar.RockstarLaunch.prepare(app, request.optString("id")) + }.getOrElse { JSONObject().put("ok", false).put("reason", "error-" + it.javaClass.simpleName) } + "rockstar-exited" -> { + if (lastLaunched == (Store.ROCKSTAR to request.optString("id"))) lastLaunched = null + JSONObject().put("ok", true) + } + "ubisoft-launch" -> { + val id = request.optString("id") + if (id.isEmpty()) JSONObject().put("ok", false).put("reason", "no-id") + else { + lastLaunched = Store.UBISOFT to id + runCatching { com.droiddeck.launcher.stores.ubisoft.UbisoftLaunch.prepare(app, id) } + .getOrElse { JSONObject().put("ok", false).put("reason", it.javaClass.simpleName) } + } + } "cloud-down" -> { val store = Store.byId(request.optString("store")) val id = request.optString("id") @@ -90,6 +114,7 @@ object StoreLaunchRequests { if (!(url.startsWith("https://") || url.startsWith("http://"))) JSONObject().put("ok", false).put("reason", "not-http") else try { app.startActivity(android.content.Intent(android.content.Intent.ACTION_VIEW, android.net.Uri.parse(url)).addFlags(android.content.Intent.FLAG_ACTIVITY_NEW_TASK)) + com.droiddeck.launcher.session.SessionService.holdForBrowserHandoff(app) Log.i(TAG, "open-url: " + StoreLog.redactUrl(url)) JSONObject().put("ok", true) } catch (e: Exception) { diff --git a/app/src/main/java/com/droiddeck/launcher/stores/StoreLoginActivity.kt b/app/src/main/java/com/droiddeck/launcher/stores/StoreLoginActivity.kt index 228d97cd78..54571ab172 100644 --- a/app/src/main/java/com/droiddeck/launcher/stores/StoreLoginActivity.kt +++ b/app/src/main/java/com/droiddeck/launcher/stores/StoreLoginActivity.kt @@ -47,6 +47,9 @@ class StoreLoginActivity : ComponentActivity() { ?.takeIf { "Chrome/" in it } ?: "Mozilla/5.0 (Linux; Android ${Build.VERSION.RELEASE}; ${Build.MODEL}) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.6533.103 Mobile Safari/537.36" + private const val PAGE_TRIES = 20 + private const val PAGE_RETRY_MS = 500L + fun generateState(): String { val bytes = ByteArray(24) java.security.SecureRandom().nextBytes(bytes) @@ -60,7 +63,10 @@ class StoreLoginActivity : ComponentActivity() { fun isRedirect(url: String): Boolean fun finish(activity: StoreLoginActivity, view: WebView, url: String): String? val readsPage: Boolean get() = false + val pageScript: String get() = "(function(){ try { return document.body.innerText; } catch(e){ return ''; } })()" + fun pageReady(result: String): Boolean = true fun forgetSignIn(done: () -> Unit) = done() + fun pageFinished(view: WebView, url: String) {} } private var store: Store? = null @@ -278,6 +284,7 @@ class StoreLoginActivity : ComponentActivity() { } override fun onPageFinished(view: WebView?, url: String?) { + if (!isPopup && url != null && view != null) flow?.pageFinished(view, url) if (url != null && view != null && flow?.readsPage == true && flow?.isRedirect(url) == true) complete(view, url) } @@ -323,6 +330,14 @@ class StoreLoginActivity : ComponentActivity() { } } + private fun readPage(view: WebView, f: Flow, left: Int) { + view.evaluateJavascript(f.pageScript) { json -> + val result = json ?: "" + if (!f.pageReady(result) && left > 0) view.postDelayed({ readPage(view, f, left - 1) }, PAGE_RETRY_MS) + else Thread({ settle(f.finish(this, view, result)) }, "store-login").start() + } + } + private fun complete(view: WebView, url: String) { if (!captured.compareAndSet(false, true)) return val f = flow ?: return @@ -332,11 +347,7 @@ class StoreLoginActivity : ComponentActivity() { titleText.text = getString(R.string.stores_login_finishing) if (!f.readsPage) view.stopLoading() } - if (f.readsPage) { - view.evaluateJavascript("(function(){ try { return document.body.innerText; } catch(e){ return ''; } })()") { json -> - Thread({ settle(f.finish(this, view, json ?: "")) }, "store-login").start() - } - } else Thread({ settle(f.finish(this, view, url)) }, "store-login").start() + if (f.readsPage) readPage(view, f, PAGE_TRIES) else Thread({ settle(f.finish(this, view, url)) }, "store-login").start() } private fun settle(problem: String?) { diff --git a/app/src/main/java/com/droiddeck/launcher/stores/StoreSizes.kt b/app/src/main/java/com/droiddeck/launcher/stores/StoreSizes.kt index 545c981e50..21969dfbe7 100644 --- a/app/src/main/java/com/droiddeck/launcher/stores/StoreSizes.kt +++ b/app/src/main/java/com/droiddeck/launcher/stores/StoreSizes.kt @@ -43,7 +43,7 @@ object StoreSizes { if (available != null) return CompletableFuture.completedFuture(available) val app = context.applicationContext val version = item.extra["version"].orEmpty() - return sizeRequests.computeIfAbsent(item.key) { + return shared(sizeRequests, item.key) { CompletableFuture.supplyAsync({ val cached = cache(app, item.store).get(item.id, version) val bytes = cached ?: runCatching { fetch(app, item) } @@ -55,7 +55,8 @@ object StoreSizes { Store.EPIC -> EpicPrefs.get(app).edit().putLong("size_${item.id}", it).apply() Store.AMAZON -> AmazonPrefs.get(app).edit().putLong("size_${item.id}", it).apply() Store.ITCH, Store.GAMEJOLT -> {} - Store.GOG, Store.XBOX, Store.BATTLENET -> {} + Store.EA -> com.droiddeck.launcher.stores.ea.EaPrefs.get(app).edit().putLong("size_${item.id}", it).apply() + Store.GOG, Store.XBOX, Store.BATTLENET, Store.UBISOFT, Store.ROCKSTAR -> {} } } }, pool).exceptionally { error -> @@ -65,6 +66,25 @@ object StoreSizes { } } + internal fun shared( + requests: ConcurrentHashMap>, + key: String, + start: () -> CompletableFuture, + ): CompletableFuture { + var created: CompletableFuture? = null + val shared = requests.computeIfAbsent(key) { CompletableFuture().also { created = it } } + if (created === shared) { + val source = runCatching(start).getOrElse { failure -> + CompletableFuture().apply { completeExceptionally(failure) } + } + source.whenComplete { bytes, error -> + if (bytes == null) requests.remove(key, shared) + if (error != null) shared.completeExceptionally(error) else shared.complete(bytes) + } + } + return shared + } + val onDisk = mutableStateMapOf() fun requestDisk(context: Context, key: String, game: InstalledStoreGame) { @@ -77,7 +97,7 @@ object StoreSizes { onDisk[key]?.let { return CompletableFuture.completedFuture(it) } val app = context.applicationContext val version = "disk:${game.sidecar.installedAt}:${game.sidecar.installVersion}" - return diskRequests.computeIfAbsent(key) { + return shared(diskRequests, key) { CompletableFuture.supplyAsync({ val c = cache(app, game.sidecar.store) c.get("disk:${game.sidecar.id}", version) @@ -111,7 +131,8 @@ object StoreSizes { val bytes = AmazonApiClient.getBytes(AmazonApiClient.appendPath(spec.downloadUrl, "manifest.proto"), token) ?: return 0L AmazonManifest.parse(bytes).totalInstallSize } - Store.GOG, Store.XBOX, Store.BATTLENET -> 0L + Store.EA -> com.droiddeck.launcher.stores.ea.EaSizes.size(context, item) + Store.GOG, Store.XBOX, Store.BATTLENET, Store.UBISOFT, Store.ROCKSTAR -> 0L Store.ITCH -> com.droiddeck.launcher.stores.itch.ItchLibrary.size(context, item) Store.GAMEJOLT -> com.droiddeck.launcher.stores.gamejolt.GameJoltBuilds.size(context, item) } } diff --git a/app/src/main/java/com/droiddeck/launcher/stores/StoresState.kt b/app/src/main/java/com/droiddeck/launcher/stores/StoresState.kt index e7a9383f32..46de6eaab0 100644 --- a/app/src/main/java/com/droiddeck/launcher/stores/StoresState.kt +++ b/app/src/main/java/com/droiddeck/launcher/stores/StoresState.kt @@ -236,6 +236,27 @@ object StoresState { var itchPicking by mutableStateOf(null) var gameJoltPicking by mutableStateOf(null) + /** Store cards whose free game is being added to the account. */ + val claiming = mutableStateMapOf() + + fun canClaim(item: CatalogItem): Boolean = !item.accessible && isSignedIn(item.store) && backends[item.store]?.canClaim(item) == true + + /** Adds a free game to the account, then refreshes the library so it can be installed; [failed] runs when the store refused. */ + fun claim(context: Context, item: CatalogItem, failed: () -> Unit) { + val backend = backends[item.store] ?: return failed() + if (claiming.put(item.key, true) == true) return + val app = context.applicationContext + background("stores-claim", onFailure = { main.post { claiming.remove(item.key); failed() } }) { + val ok = backend.claim(app, item) + logLine("${item.store.label}: ${item.title} ${if (ok) "added to the library" else "could not be added; opening the store page"}") + if (ok) backend.syncLibrary(app, true) + main.post { + claiming.remove(item.key) + if (!ok) failed() + } + } + } + fun requestInstall(context: Context, item: CatalogItem) { askForNotifications(context) if (item.store == Store.ITCH && item.extra["uploadId"].isNullOrEmpty()) { itchPicking = item; return } @@ -293,23 +314,37 @@ object StoresState { val key = "${game.sidecar.store.id}:${game.sidecar.id}" uninstalling[key] = 0f background("stores-uninstall", onFailure = { main.post { uninstalling.remove(key); onDone() } }) { - runCatching { backends[game.sidecar.store]?.uninstall(app, game) } - if (game.sidecar.store == Store.BATTLENET && com.droiddeck.launcher.runtime.BattleNet.games(app).any { it.folder.absolutePath == game.folder.absolutePath }) { + if (!com.droiddeck.launcher.stores.download.DownloadQueue.holdForRemovalWhenFree(key)) { + logLine("kept \"${game.sidecar.title}\": its download or update is still running") main.post { uninstalling.remove(key); onDone() } return@background } - StoreInstalls.uninstall(app, game, progress = { f -> main.post { if (key in uninstalling) uninstalling[key] = f } }, removed = { - main.post { - installed = installed.filterNot { it.folder.absolutePath == game.folder.absolutePath } - uninstalling.remove(key) - if (game.sidecar.store == Store.ITCH) com.droiddeck.launcher.stores.itch.ItchUpdates.applied(app, key) - if (game.sidecar.store == Store.GAMEJOLT) com.droiddeck.launcher.stores.gamejolt.GameJoltUpdates.applied(app, key) - } - }) - main.post(onDone) + try { + StoreInstalls.awaitDiscard(game.folder) + uninstallHeld(app, game, key, onDone) + } finally { + com.droiddeck.launcher.stores.download.DownloadQueue.releaseRemoval(key) + } } } + private fun uninstallHeld(app: Context, game: InstalledStoreGame, key: String, onDone: () -> Unit) { + runCatching { backends[game.sidecar.store]?.uninstall(app, game) } + if (game.sidecar.store == Store.BATTLENET && com.droiddeck.launcher.runtime.BattleNet.games(app).any { it.folder.absolutePath == game.folder.absolutePath }) { + main.post { uninstalling.remove(key); onDone() } + return + } + StoreInstalls.uninstall(app, game, progress = { f -> main.post { if (key in uninstalling) uninstalling[key] = f } }, removed = { + main.post { + installed = installed.filterNot { it.folder.absolutePath == game.folder.absolutePath } + uninstalling.remove(key) + if (game.sidecar.store == Store.ITCH) com.droiddeck.launcher.stores.itch.ItchUpdates.applied(app, key) + if (game.sidecar.store == Store.GAMEJOLT) com.droiddeck.launcher.stores.gamejolt.GameJoltUpdates.applied(app, key) + } + }) + main.post(onDone) + } + @Volatile var libraryListener: (() -> Unit)? = null fun notifyLibraryChanged(context: Context) { @@ -359,6 +394,12 @@ interface StoreBackend { fun syncLibrary(context: Context, force: Boolean) fun loadShelves(context: Context, force: Boolean) fun search(context: Context, query: String): List = emptyList() + + /** Whether this store can add a free game to the account itself, rather than through its website. */ + fun canClaim(item: CatalogItem): Boolean = false + + /** Adds a free game to the account; true once the store has it in the account's library. */ + fun claim(context: Context, item: CatalogItem): Boolean = false fun install(context: Context, item: CatalogItem, root: java.io.File) fun uninstall(context: Context, game: InstalledStoreGame) } diff --git a/app/src/main/java/com/droiddeck/launcher/stores/battlenet/BattleNetInstall.kt b/app/src/main/java/com/droiddeck/launcher/stores/battlenet/BattleNetInstall.kt index fdd4db2495..f0eae9767f 100644 --- a/app/src/main/java/com/droiddeck/launcher/stores/battlenet/BattleNetInstall.kt +++ b/app/src/main/java/com/droiddeck/launcher/stores/battlenet/BattleNetInstall.kt @@ -111,16 +111,22 @@ object BattleNetInstall { fun update(context: Context, game: InstalledStoreGame) { val app = context.applicationContext Thread({ - val item = CatalogItem( - Store.BATTLENET, game.sidecar.id, game.sidecar.title, game.sidecar.hero, tallImageUrl = game.sidecar.cover, owned = true, - extra = mapOf(INSTALL_UID to installUid(app, game)), - ) + val item = updateItem(game, installUid(app, game)) game.folder.parentFile?.parentFile?.let { com.droiddeck.launcher.stores.download.SavedQueue.remember(app, item, it) } enqueue(app, item, game.folder, update = true) }, "battlenet-update").start() } + internal fun updateItem(game: InstalledStoreGame, uid: String) = CatalogItem( + Store.BATTLENET, game.sidecar.id, game.sidecar.title, game.sidecar.hero, tallImageUrl = game.sidecar.cover, owned = true, + extra = mapOf(INSTALL_UID to uid, UPDATE_FOLDER to game.folder.absolutePath), + ) + + internal fun updateFolder(item: CatalogItem): File? = item.extra[UPDATE_FOLDER]?.let(::File) + internal const val INSTALL_UID = "installUid" + internal const val UPDATE_FOLDER = "updateFolder" + internal const val STALLED = "stalled" internal fun installUid(context: Context, game: InstalledStoreGame): String = runCatching { BattleNet.games(context).firstOrNull { it.uid == game.sidecar.id }?.installUid }.getOrNull() ?: game.sidecar.id @@ -219,6 +225,7 @@ object BattleNetInstall { val detail = when { reason == null -> "exit $code" reason == "client" -> return context.getString(R.string.bnet_dl_client_first) + reason == STALLED -> return context.getString(R.string.bnet_dl_stalled) reason.startsWith("agent ") -> context.getString(R.string.bnet_dl_agent_error, reason.removePrefix("agent ")) else -> reason.removePrefix("stopped ") } diff --git a/app/src/main/java/com/droiddeck/launcher/stores/battlenet/BattleNetStore.kt b/app/src/main/java/com/droiddeck/launcher/stores/battlenet/BattleNetStore.kt index 403b867538..426d3616a9 100644 --- a/app/src/main/java/com/droiddeck/launcher/stores/battlenet/BattleNetStore.kt +++ b/app/src/main/java/com/droiddeck/launcher/stores/battlenet/BattleNetStore.kt @@ -192,6 +192,7 @@ object BattleNetBackend : StoreBackend { override fun install(context: Context, item: CatalogItem, root: File) { if (!BattleNetInstall.headless(item)) return BattleNetClient.installGame(context, item.id, root) val app = context.applicationContext + BattleNetInstall.updateFolder(item)?.let { return BattleNetInstall.enqueue(app, item, it, update = true) } BattleNetInstall.enqueue(app, item, StoreInstallRoot.folderFor(app, store, item.id, item.title, root)) } diff --git a/app/src/main/java/com/droiddeck/launcher/stores/download/DownloadQueue.kt b/app/src/main/java/com/droiddeck/launcher/stores/download/DownloadQueue.kt index 379161ebf1..19dc8ea178 100644 --- a/app/src/main/java/com/droiddeck/launcher/stores/download/DownloadQueue.kt +++ b/app/src/main/java/com/droiddeck/launcher/stores/download/DownloadQueue.kt @@ -3,6 +3,7 @@ package com.droiddeck.launcher.stores.download import android.content.Context import android.util.Log import com.droiddeck.launcher.session.SessionPrefs +import com.droiddeck.launcher.stores.StoreInstalls import com.droiddeck.launcher.stores.StoresState import java.util.concurrent.atomic.AtomicBoolean @@ -102,6 +103,55 @@ object DownloadQueue { private val lock = Any() private val items = LinkedHashMap() private val heldPaused = HashSet() + private val removing = HashSet() + private val cleaningUp = HashMap() + + fun holdForRemoval(key: String): Boolean = synchronized(lock) { + val item = items[key] + if (item?.entry?.isActive == true || item?.job != null || key in cleaningUp || key in removing) return@synchronized false + removing.add(key) + true + } + + fun releaseRemoval(key: String) { synchronized(lock) { removing.remove(key); (lock as Object).notifyAll() } } + + fun holdForRemovalWhenFree(key: String): Boolean = synchronized(lock) { + while (true) { + val item = items[key] + if (item?.entry?.isActive == true || item?.job != null) return@synchronized false + if (key !in cleaningUp && key !in removing) break + (lock as Object).wait() + } + removing.add(key) + true + } + + private fun beginCleanup(key: String): Boolean = synchronized(lock) { + if (key in removing) return@synchronized false + cleaningUp.merge(key, 1, Int::plus) + true + } + + private fun holdCleanup(key: String) { synchronized(lock) { cleaningUp.merge(key, 1, Int::plus) } } + + private fun endCleanup(key: String) { + synchronized(lock) { + cleaningUp.computeIfPresent(key) { _, n -> (n - 1).takeIf { it > 0 } } + (lock as Object).notifyAll() + } + } + + private fun cleanUpLater(context: Context, key: String, name: String, work: () -> Unit) { + Thread({ + try { + val deleting = ArrayList() + try { StoreInstalls.collectingDiscards(deleting, work) } finally { deleting.forEach { it.join() } } + } finally { + endCleanup(key) + advance(context) + } + }, name).start() + } fun holdPaused(key: String) = synchronized(lock) { heldPaused.add(key) } private var running = 0 @@ -131,6 +181,7 @@ object DownloadQueue { fun enqueue(context: Context, entry: DownloadEntry, factory: () -> DownloadJob) { val app = context.applicationContext synchronized(lock) { + if (entry.key in removing) { Log.i(TAG, "${entry.key}: being uninstalled"); return } items[entry.key]?.let { if (it.entry.isActive) { Log.i(TAG, "${entry.key}: already queued"); return } } items.remove(entry.key) val state = if (heldPaused.remove(entry.key)) DownloadState.PAUSED else DownloadState.QUEUED @@ -185,6 +236,7 @@ object DownloadQueue { val retry: (() -> Unit)? synchronized(lock) { val item = items[key] ?: return + if (key in removing) return if (item.entry.state != DownloadState.PAUSED && item.entry.state != DownloadState.FAILED) return retry = item.retry if (retry == null && item.factory == null) return @@ -206,23 +258,28 @@ object DownloadQueue { val app = context.applicationContext val item: Item val wasRunning: Boolean + var cleanup = false + var awaitDeletion: List = emptyList() synchronized(lock) { item = items[key] ?: return if (!item.entry.interruptible) return wasRunning = item.entry.state == DownloadState.RUNNING if (wasRunning) { item.cancelled.set(true) - item.job?.cancel(deleteFiles = true) + val deleting = StoreInstalls.collectingDiscards { runCatching { item.job?.cancel(deleteFiles = true) } } + if (deleting.isNotEmpty()) { holdCleanup(key); awaitDeletion = deleting } } if (!wasRunning) { + cleanup = beginCleanup(key) item.entry = item.entry.copy(state = DownloadState.CANCELLED, queuePosition = 0, finishedAt = System.currentTimeMillis()) renumber() publishLocked() } } - if (!wasRunning) { - Thread({ runCatching { item.factory?.invoke()?.cancel(deleteFiles = true) } }, "store-dl-cancel").start() + if (cleanup) { + cleanUpLater(app, key, "store-dl-cancel") { runCatching { item.factory?.invoke()?.cancel(deleteFiles = true) } } } + if (awaitDeletion.isNotEmpty()) cleanUpLater(app, key, "store-dl-cancel-wait") { awaitDeletion.forEach { it.join() } } StoresState.logLine("cancelled \"${item.entry.name}\"") StoreDownloadService.finish(app, key) advance(app) @@ -230,12 +287,16 @@ object DownloadQueue { } fun clear(context: Context, key: String) { - val item = synchronized(lock) { items[key] } ?: return - if (item.entry.state == DownloadState.RUNNING || item.entry.state == DownloadState.QUEUED) return - if (item.entry.state == DownloadState.FAILED || item.entry.state == DownloadState.PAUSED) { - Thread({ runCatching { item.factory?.invoke()?.cancel(deleteFiles = true) } }, "store-dl-clear").start() + val item: Item + val cleanup: Boolean + synchronized(lock) { + item = items[key] ?: return + if (item.entry.state == DownloadState.RUNNING || item.entry.state == DownloadState.QUEUED) return + cleanup = (item.entry.state == DownloadState.FAILED || item.entry.state == DownloadState.PAUSED) && beginCleanup(key) + items.remove(key) + publishLocked() } - synchronized(lock) { items.remove(key); publishLocked() } + if (cleanup) cleanUpLater(context.applicationContext, key, "store-dl-clear") { runCatching { item.factory?.invoke()?.cancel(deleteFiles = true) } } StoreDownloadService.finish(context.applicationContext, key) } @@ -298,7 +359,7 @@ object DownloadQueue { val next: Item synchronized(lock) { if (running >= parallel(context)) return - next = items.values.firstOrNull { it.entry.state == DownloadState.QUEUED } ?: return + next = items.values.firstOrNull { it.entry.state == DownloadState.QUEUED && it.entry.key !in cleaningUp } ?: return running++ next.entry = next.entry.copy(state = DownloadState.RUNNING, stage = DownloadStage.MANIFEST, queuePosition = 0) renumber() @@ -318,7 +379,15 @@ object DownloadQueue { val job = checkNotNull(item.factory).invoke() synchronized(lock) { item.job = job } StoresState.logLine("${item.entry.store.label}: fetching manifest for \"${item.entry.name}\"") - result = job.run(handle) + val deleting = ArrayList() + try { + StoreInstalls.collectingDiscards(deleting) { result = job.run(handle) } + } finally { + if (deleting.isNotEmpty()) { + holdCleanup(item.entry.key) + cleanUpLater(context, item.entry.key, "store-dl-run-discard") { deleting.forEach { it.join() } } + } + } if (result == null && !item.cancelled.get()) error = "install failed" } catch (t: Throwable) { error = t.message ?: t.javaClass.simpleName diff --git a/app/src/main/java/com/droiddeck/launcher/stores/ea/EaApi.kt b/app/src/main/java/com/droiddeck/launcher/stores/ea/EaApi.kt new file mode 100644 index 0000000000..55ecf79455 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/stores/ea/EaApi.kt @@ -0,0 +1,238 @@ +package com.droiddeck.launcher.stores.ea + +import android.net.Uri +import org.json.JSONArray +import org.json.JSONObject + +class EaApiException(val status: Int, message: String) : Exception(message) + +object EaApi { + private const val GRAPHQL = "https://service-aggregation-layer.juno.ea.com/graphql" + private const val LOCALE = "DEFAULT" + + class Player(val userId: String, val personaId: String, val displayName: String, val eaId: String) + + class OwnedProduct( + val offerId: String, + val productId: String, + val name: String, + val slug: String, + val baseSlug: String, + val gameType: String, + val downloadable: Boolean, + val trial: Boolean, + val ownership: List, + val productName: String = "", + ) + + class Offer( + val offerId: String, + val contentId: String, + val displayName: String, + val displayType: String, + val downloadable: Boolean, + val executePathOverride: String, + val installCheckOverride: String, + val executeParameters: String, + val multiplayerId: String, + val masterTitleId: String, + val gameVersion: String, + val cloudSaves: String, + val locales: List, + ) + + class Images(val tall: String?, val wide: String?, val logo: String?) + + class Build(val buildId: String, val gameVersion: String, val liveDate: String) + + private val queries = HashMap() + + internal fun query(name: String): String = synchronized(queries) { + queries.getOrPut(name) { + val stream = EaApi::class.java.getResourceAsStream("/ea/graphql/$name.gql") ?: throw IllegalStateException("missing query $name") + stream.use { it.readBytes().toString(Charsets.UTF_8) } + } + } + + private fun persisted(name: String): String = + JSONObject().put("persistedQuery", JSONObject().put("version", 1).put("sha256Hash", EaCrypto.hex(EaCrypto.sha256(query(name).toByteArray())))).toString() + + internal fun call(token: String, name: String, variables: JSONObject): JSONObject { + val headers = mapOf("Authorization" to "Bearer $token", "Accept" to "application/json") + val get = Uri.parse(GRAPHQL).buildUpon() + .appendQueryParameter("extensions", persisted(name)) + .appendQueryParameter("operationName", name) + .appendQueryParameter("variables", variables.toString()) + .build().toString() + var reply = EaHttp.request(get, headers = headers) + var json = runCatching { JSONObject(reply.text) }.getOrNull() + if (!reply.ok || json == null || json.has("errors")) { + val body = JSONObject() + .put("extensions", JSONObject(persisted(name))) + .put("variables", variables) + .put("operationName", name) + .put("query", query(name)) + reply = EaHttp.request(GRAPHQL, "POST", headers + ("Content-Type" to "application/json"), body.toString().toByteArray()) + json = runCatching { JSONObject(reply.text) }.getOrNull() + } + if (reply.status == 401) throw EaApiException(401, "EA refused the session") + if (json == null) throw EaApiException(reply.status, "EA gave no answer to $name (${reply.status})") + json.optJSONArray("errors")?.optJSONObject(0)?.let { throw EaApiException(reply.status, "$name: ${it.optString("message")}") } + return json.optJSONObject("data") ?: throw EaApiException(reply.status, "$name returned no data") + } + + fun player(token: String): Player { + val me = call(token, "GetUserPlayer", JSONObject()).optJSONObject("me") ?: throw EaApiException(0, "no player") + val p = me.optJSONObject("player") + return Player( + userId = me.optString("pd"), + personaId = p?.optString("psd").orEmpty(), + displayName = p?.optString("displayName").orEmpty(), + eaId = p?.optString("uniqueName").orEmpty().ifEmpty { p?.optString("displayName").orEmpty() }, + ) + } + + internal fun parseOwned(page: JSONObject): Pair, String?> { + val owned = page.optJSONObject("me")?.optJSONObject("ownedGameProducts") ?: return emptyList() to null + val items = owned.optJSONArray("items") ?: JSONArray() + val list = (0 until items.length()).mapNotNull { items.optJSONObject(it) }.mapNotNull { o -> + val product = o.optJSONObject("product") ?: return@mapNotNull null + val base = product.optJSONObject("baseItem") + val user = product.optJSONObject("gameProductUser") + val methods = user?.optJSONArray("ownershipMethods") + OwnedProduct( + offerId = o.optString("originOfferId").ifEmpty { return@mapNotNull null }, + productId = product.optString("id"), + name = (base?.optString("title")?.takeIf { it.isNotBlank() } ?: product.optString("name")).replace("\n", " ").trim(), + slug = product.optString("gameSlug"), + baseSlug = base?.optString("baseGameSlug").orEmpty().takeIf { it != "null" }.orEmpty(), + gameType = base?.optString("gameType").orEmpty(), + downloadable = product.optBoolean("downloadable", true), + trial = product.optJSONObject("trialDetails")?.optString("trialType").orEmpty().let { it.isNotEmpty() && it != "null" }, + ownership = (0 until (methods?.length() ?: 0)).map { methods!!.optString(it) }, + productName = product.optString("name").replace("\n", " ").trim(), + ) + } + val next = owned.optString("next").takeIf { it.isNotBlank() && it != "null" } + return list to next + } + + fun owned(token: String): List { + val out = ArrayList() + var next: String? = "0" + var guard = 0 + while (next != null && guard++ < 50) { + val variables = JSONObject() + .put("isMac", false) + .put("limit", 100) + .put("next", next) + .put("type", JSONArray().put("DIGITAL_FULL_GAME").put("PACKAGED_FULL_GAME")) + .put("storefronts", JSONArray().put("EA")) + .put("platforms", JSONArray().put("PC")) + val (items, after) = parseOwned(call(token, "getPreloadedOwnedGames", variables)) + out += items + next = after?.takeIf { it != next && items.isNotEmpty() } + } + return out + } + + internal fun parseOffers(data: JSONObject): List { + val arr = data.optJSONArray("legacyOffers") ?: return emptyList() + return (0 until arr.length()).mapNotNull { arr.optJSONObject(it) }.mapNotNull { o -> + val downloads = o.optJSONArray("downloads") + val version = (0 until (downloads?.length() ?: 0)).mapNotNull { downloads!!.optJSONObject(it) } + .firstOrNull { it.optString("downloadType").equals("LIVE", true) }?.optString("gameVersion") + ?: downloads?.optJSONObject(0)?.optString("gameVersion") + val locales = o.optJSONArray("softwareLocales") + fun s(k: String) = o.optString(k).takeIf { it != "null" }.orEmpty() + Offer( + offerId = s("offerId").ifEmpty { return@mapNotNull null }, + contentId = s("contentId"), + displayName = s("displayName"), + displayType = s("displayType"), + downloadable = o.optBoolean("isDownloadable", true), + executePathOverride = s("executePathOverride"), + installCheckOverride = s("installCheckOverride"), + executeParameters = s("executeParameters"), + multiplayerId = s("multiplayerId"), + masterTitleId = s("primaryMasterTitleId"), + gameVersion = version.orEmpty().takeIf { it != "null" }.orEmpty(), + cloudSaves = s("cloudSaveConfigurationOverride"), + locales = (0 until (locales?.length() ?: 0)).map { locales!!.optString(it) }, + ) + } + } + + fun offers(token: String, ids: List): List = ids.distinct().chunked(50).flatMap { chunk -> + parseOffers(call(token, "getLegacyCatalogDefs", JSONObject().put("offerIds", JSONArray(chunk)))) + } + + private fun path(o: JSONObject?, vararg keys: String): String? { + var cur = o ?: return null + for (k in keys.dropLast(1)) cur = cur.optJSONObject(k) ?: return null + return cur.optString(keys.last()).takeIf { it.startsWith("http") } + } + + internal fun parseImages(data: JSONObject): Images { + val game = data.optJSONObject("game") + val key = game?.optJSONObject("keyArt") + val pack = game?.optJSONObject("packArt") + return Images( + tall = path(pack, "aspect9x16Image", "path") ?: path(key, "aspect9x16Image", "path"), + wide = path(key, "aspect16x9Image", "path") ?: path(key, "largestImage", "path") ?: path(pack, "aspect2x1Image", "path"), + logo = path(game, "primaryLogo", "largestImage", "path") ?: path(game, "primaryLogo", "path"), + ) + } + + fun images(token: String, slug: String): Images = + parseImages(call(token, "GameImages", JSONObject().put("gameSlug", slug).put("locale", LOCALE))) + + fun downloadUrl(token: String, offerId: String, buildId: String? = null): String { + val data = call(token, "downloadUrl", JSONObject().put("offerId", offerId).put("buildId", buildId.orEmpty())) + return data.optJSONObject("downloadUrl")?.optString("url").orEmpty().ifEmpty { throw EaApiException(0, "EA gave no download link") } + } + + fun builds(token: String, offerId: String): List { + val arr = call(token, "availableBuilds", JSONObject().put("offerId", offerId)).optJSONArray("availableBuilds") ?: return emptyList() + return (0 until arr.length()).mapNotNull { arr.optJSONObject(it) }.map { + Build(it.optString("buildId"), it.optString("gameVersion").takeIf { v -> v != "null" }.orEmpty(), it.optString("buildLiveDate")) + } + } + + /** The free offer EA sells under a store slug, or null when the game has none. */ + fun freeOffer(token: String, slug: String): String? { + val variables = JSONObject().put("slug", slug).put("locale", "en-us").put("overrideCountryCode", "US") + val product = call(token, "GetGameProductOfferIds", variables).optJSONObject("game")?.optJSONObject("lowestPriceGameProduct") ?: return null + return product.optString("originOfferId").takeIf { product.optBoolean("isFree") && it.isNotBlank() && it != "null" } + } + + /** Adds a free offer to the account, as the EA app's "Get for free" does; the answer names what EA refused. */ + fun grantEntitlement(token: String, offerId: String): JSONObject = + call(token, "grantEntitlement", JSONObject().put("input", JSONObject().put("offerId", offerId).put("source", EaAuth.CLIENT_ID))) + .optJSONObject("grantEntitlement") ?: throw EaApiException(0, "EA gave no answer to the grant") + + fun legacyEntitlements(token: String): List { + val out = ArrayList() + var next: String? = "0" + var guard = 0 + while (next != null && guard++ < 50) { + val variables = JSONObject().put("limit", 100).put("next", next).put("storeFronts", JSONArray().put("EA")) + val page = call(token, "getLegacyEntitlements", variables).optJSONObject("me")?.optJSONObject("legacyEntitlements") ?: break + val items = page.optJSONArray("items") ?: JSONArray() + for (i in 0 until items.length()) items.optJSONObject(i)?.let(out::add) + next = page.optString("next").takeIf { it.isNotBlank() && it != "null" && it != next && items.length() > 0 } + } + return out + } + + fun entitlements(token: String, group: String): JSONArray { + val variables = JSONObject() + .put("productIds", JSONArray()) + .put("includeChildGroups", false) + .put("groupNames", JSONArray().put(group)) + .put("entitlementTag", "") + .put("pageSize", 100) + .put("pageNumber", 1) + return call(token, "sdkEntitlements", variables).optJSONObject("me")?.optJSONObject("sdkEntitlements")?.optJSONArray("entitlements") ?: JSONArray() + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/stores/ea/EaAuth.kt b/app/src/main/java/com/droiddeck/launcher/stores/ea/EaAuth.kt new file mode 100644 index 0000000000..67fb8e655e --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/stores/ea/EaAuth.kt @@ -0,0 +1,230 @@ +package com.droiddeck.launcher.stores.ea + +import android.content.Context +import android.net.Uri +import android.util.Log +import com.droiddeck.launcher.stores.Store +import com.droiddeck.launcher.stores.StoreAccounts +import org.json.JSONObject +import java.security.SecureRandom +import java.text.SimpleDateFormat +import java.util.Date +import java.util.Locale +import java.util.TimeZone + +object EaAuth { + private const val TAG = "EaAuth" + const val CLIENT_ID = "JUNO_PC_CLIENT" + private const val CLIENT_SECRET = "4mRLtYMb6vq9qglomWEaT4ChxsXWcyqbQpuBNfMPOYOiDmYYQmjuaBsF2Zp0RyVeWkfqhE9TuGgAw7te" + const val AUTH_URL = "https://accounts.ea.com/connect/auth" + private const val TOKEN_URL = "https://accounts.ea.com/connect/token" + const val REDIRECT = "qrc:///html/login_successful.html" + private const val REFRESH_MARGIN_MS = 5 * 60 * 1000L + private val refreshLock = Any() + private val random = SecureRandom() + + private val PC_SIGN_KEYS = mapOf( + "v1" to "ISa3dpGOc8wW7Adn4auACSQmaccrOyR2".toByteArray(), + "v2" to "nt5FfJbdPzNcl2pkC3zgjO43Knvscxft".toByteArray(), + ) + + val OPAQUE_SCOPES = listOf( + "basic.commerce.cartv2", "service.atom", "dp.client.default", "signin", "social_recommendation_user", + "basic.optin.write", "basic.commerce.cartv2.write", "basic.billing", "external.social_information_ups_admin", + ) + + class Account( + val accessToken: String, + val refreshToken: String, + val expiresAt: Long, + val userId: String, + val personaId: String, + val displayName: String, + val eaId: String, + ) + + class Pending(val url: String, val verifier: String) + + internal fun fromJson(o: JSONObject): Account? { + val access = o.optString("access_token").ifEmpty { return null } + return Account( + accessToken = access, + refreshToken = o.optString("refresh_token"), + expiresAt = o.optLong("expires_at"), + userId = o.optString("user_id"), + personaId = o.optString("persona_id"), + displayName = o.optString("display_name"), + eaId = o.optString("ea_id"), + ) + } + + fun load(context: Context): Account? = StoreAccounts.read(context.applicationContext, Store.EA)?.let(::fromJson) + + private fun deviceId(context: Context): String { + val prefs = EaPrefs.get(context) + prefs.getString("device", null)?.let { return it } + val made = EaCrypto.hex(ByteArray(16).also(random::nextBytes)) + prefs.edit().putString("device", made).apply() + return made + } + + internal fun pcSign(device: String, now: Date = Date(), version: String = if (random.nextBoolean()) "v1" else "v2"): String { + val stamp = SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS", Locale.US).apply { timeZone = TimeZone.getTimeZone("UTC") }.format(now) + val mid = EaCrypto.fnv1a(("DroidDeck" + device.uppercase() + "DroidDeck").toByteArray()).toString() + val json = "{\"av\":\"v1\",\"bsn\":\"None\",\"gid\":0,\"hsn\":\"None\",\"mid\":\"$mid\",\"msn\":\"${device.uppercase()}\",\"sv\":\"$version\",\"ts\":\"$stamp\"}" + val payload = EaCrypto.base64Url(json.toByteArray()) + val signature = EaCrypto.base64Url(EaCrypto.hmacSha256(PC_SIGN_KEYS.getValue(version), payload.toByteArray())) + return "$payload.$signature" + } + + internal fun authUrl( + device: String, + responseType: String, + challenge: String? = null, + accessToken: String? = null, + clientId: String = CLIENT_ID, + scopes: List = emptyList(), + tokenFormat: String? = null, + expiresIn: Int? = null, + ): String { + val b = Uri.parse(AUTH_URL).buildUpon() + .appendQueryParameter("client_id", clientId) + .appendQueryParameter("sbiod_enabled", "false") + .appendQueryParameter("response_type", responseType) + .appendQueryParameter("locale", "en_US") + .appendQueryParameter("pc_sign", pcSign(device)) + .appendQueryParameter("nonce", random.nextInt().toString()) + if (scopes.isNotEmpty()) b.appendQueryParameter("scope", scopes.joinToString(" ")) + if (challenge != null) { + b.appendQueryParameter("code_challenge_method", "S256") + b.appendQueryParameter("code_challenge", challenge) + } + if (accessToken != null) b.appendQueryParameter("access_token", accessToken) + if (tokenFormat != null) b.appendQueryParameter("token_format", tokenFormat) + if (expiresIn != null) b.appendQueryParameter("expires_in", expiresIn.toString()) + return b.build().toString() + } + + fun begin(context: Context): Pending { + val verifier = EaCrypto.base64Url(ByteArray(32).also(random::nextBytes)) + val challenge = EaCrypto.base64Url(EaCrypto.sha256(verifier.toByteArray())) + return Pending(authUrl(deviceId(context), "code", challenge = challenge), verifier) + } + + /** Pulls one parameter out of the redirect EA sends to its desktop client's local page. */ + internal fun redirectValue(location: String, name: String): String? { + val normal = location.replace("qrc:///html", "http://127.0.0.1").replace("qrc:/html", "http://127.0.0.1") + val uri = Uri.parse(normal) + uri.getQueryParameter(name)?.let { return it } + val fragment = uri.encodedFragment ?: return null + return Uri.parse("http://x/?$fragment").getQueryParameter(name) + } + + private fun tokenCall(values: List>): JSONObject { + val reply = EaHttp.request( + TOKEN_URL, "POST", + mapOf("Content-Type" to "application/x-www-form-urlencoded"), + EaHttp.form(values + listOf("client_id" to CLIENT_ID, "client_secret" to CLIENT_SECRET)).toByteArray(), + follow = false, + ) + val json = runCatching { JSONObject(reply.text) }.getOrNull() + if (!reply.ok || json == null || json.optString("access_token").isEmpty()) { + throw IllegalStateException("EA token request failed (${reply.status}): ${json?.optString("error_description")?.ifEmpty { json.optString("error") } ?: ""}") + } + return json + } + + fun exchange(context: Context, code: String, verifier: String) { + val token = tokenCall( + listOf( + "grant_type" to "authorization_code", "code" to code, "code_verifier" to verifier, + "redirect_uri" to REDIRECT, "token_format" to "JWS", + ), + ) + val access = token.getString("access_token") + val player = runCatching { EaApi.player(access) }.onFailure { Log.w(TAG, "player: ${it.message}") }.getOrNull() + val record = JSONObject() + .put("access_token", access) + .put("refresh_token", token.optString("refresh_token")) + .put("expires_at", System.currentTimeMillis() + token.optLong("expires_in", 3600) * 1000) + .put("user_id", player?.userId.orEmpty()) + .put("persona_id", player?.personaId.orEmpty()) + .put("display_name", player?.displayName.orEmpty()) + .put("ea_id", player?.eaId.orEmpty()) + StoreAccounts.write(context.applicationContext, Store.EA, record) + } + + private fun fresh(a: Account) = a.expiresAt - System.currentTimeMillis() > REFRESH_MARGIN_MS || a.refreshToken.isEmpty() + + private fun refreshLocked(context: Context, a: Account): String? { + if (a.refreshToken.isEmpty()) return null + val token = try { + tokenCall(listOf("grant_type" to "refresh_token", "refresh_token" to a.refreshToken)) + } catch (e: Exception) { + Log.w(TAG, "refresh: ${e.message}") + return null + } + val access = token.getString("access_token") + val player = if (load(context)?.userId.isNullOrEmpty()) runCatching { EaApi.player(access) }.getOrNull() else null + return access.takeIf { storeRefreshed(context, access, token.optLong("expires_in", 3600), token.optString("refresh_token"), player) } + } + + /** Writes a refreshed token into the saved sign-in, unless sign-out removed it meanwhile. */ + internal fun storeRefreshed(context: Context, access: String, expiresIn: Long, refresh: String, player: EaApi.Player? = null): Boolean = + synchronized(refreshLock) { + val app = context.applicationContext + val record = StoreAccounts.read(app, Store.EA) ?: return false + record.put("access_token", access).put("expires_at", System.currentTimeMillis() + expiresIn * 1000) + refresh.takeIf { it.isNotEmpty() }?.let { record.put("refresh_token", it) } + player?.let { record.put("user_id", it.userId).put("persona_id", it.personaId).put("display_name", it.displayName).put("ea_id", it.eaId) } + StoreAccounts.write(app, Store.EA, record) + true + } + + fun accessToken(context: Context): String? { + val current = load(context) ?: return null + if (fresh(current)) return current.accessToken + synchronized(refreshLock) { + val again = load(context) ?: return null + if (fresh(again)) return again.accessToken + return refreshLocked(context, again) ?: again.accessToken.takeIf { again.expiresAt > System.currentTimeMillis() } + } + } + + fun refreshNow(context: Context, stale: String?): String? = synchronized(refreshLock) { + val current = load(context) ?: return null + if (stale != null && current.accessToken != stale) return current.accessToken + refreshLocked(context, current) + } + + /** Asks EA to mint a code or token for another client from the signed-in session, as the EA app does for games. */ + fun mint( + context: Context, + clientId: String, + responseType: String, + scopes: List = emptyList(), + tokenFormat: String? = null, + expiresIn: Int? = null, + ): String? { + val access = accessToken(context) ?: return null + val url = authUrl(deviceId(context), responseType, accessToken = access, clientId = clientId, scopes = scopes, tokenFormat = tokenFormat, expiresIn = expiresIn) + val reply = runCatching { EaHttp.request(url, follow = false) }.getOrElse { + Log.w(TAG, "mint $clientId: ${it.javaClass.simpleName}") + return null + } + val location = reply.header("Location") ?: run { + Log.w(TAG, "mint $clientId: no redirect (${reply.status})") + return null + } + if (location.startsWith("https://signin.ea.com")) { + Log.w(TAG, "mint $clientId: the session needs a new sign-in") + return null + } + return redirectValue(location, if (responseType == "token") "access_token" else responseType) + } + + /** Waits for any refresh in progress, so it cannot write the sign-in back afterwards. */ + fun signOut(context: Context) { + synchronized(refreshLock) { StoreAccounts.clear(context.applicationContext, Store.EA) } + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/stores/ea/EaBackend.kt b/app/src/main/java/com/droiddeck/launcher/stores/ea/EaBackend.kt new file mode 100644 index 0000000000..bd8d5c1212 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/stores/ea/EaBackend.kt @@ -0,0 +1,159 @@ +package com.droiddeck.launcher.stores.ea + +import android.content.Context +import android.content.Intent +import android.util.Log +import android.webkit.WebView +import androidx.compose.runtime.mutableStateMapOf +import com.droiddeck.launcher.R +import com.droiddeck.launcher.stores.CatalogItem +import com.droiddeck.launcher.stores.InstalledStoreGame +import com.droiddeck.launcher.stores.LoginFlows +import com.droiddeck.launcher.stores.Store +import com.droiddeck.launcher.stores.StoreBackend +import com.droiddeck.launcher.stores.StoreFront +import com.droiddeck.launcher.stores.StoreInstallRoot +import com.droiddeck.launcher.stores.StoreLoginActivity +import com.droiddeck.launcher.stores.StoresState +import com.droiddeck.launcher.stores.WebCookies +import com.droiddeck.launcher.stores.download.DownloadEntry +import com.droiddeck.launcher.stores.download.DownloadQueue + +object EaBackend : StoreBackend { + override val store: Store = Store.EA + + @Volatile internal var app: Context? = null + + init { + LoginFlows.eaFlow = { ua -> app?.let { EaLogin(EaAuth.begin(it), ua) } } + } + + override fun signIn(context: Context) { + app = context.applicationContext + context.startActivity( + Intent(context, StoreLoginActivity::class.java) + .putExtra(StoreLoginActivity.EXTRA_STORE, store.id) + .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK), + ) + } + + override fun signOut(context: Context) { + val app = context.applicationContext + EaAuth.signOut(app) + EaLibrary.reset(app) + signOuts.incrementAndGet() + StoresState.post { StoresState.shelves.remove(store) } + EaUpdates.available.clear() + runCatching { WebCookies.expire(EaLogin.SIGN_IN_URLS, ".ea.com", listOf("/")) {} } + } + + override fun syncLibrary(context: Context, force: Boolean) { + val app = context.applicationContext + this.app = app + Thread({ EaLibrary.sync(app, force) }, "ea-sync").start() + } + + override fun loadShelves(context: Context, force: Boolean) { + val app = context.applicationContext + val account = signOuts.get() + EaStore.cached(app)?.let { s -> StoresState.post { StoresState.shelves[store] = StoreFront.markOwned(s, StoresState.library[store], EaStore::sameGame) } } + Thread({ + val shelves = EaStore.featured(app, force) ?: return@Thread + StoresState.post { if (signOuts.get() == account) StoresState.shelves[store] = StoreFront.markOwned(shelves, StoresState.library[store], EaStore::sameGame) } + }, "ea-shelves").start() + } + + private val signOuts = java.util.concurrent.atomic.AtomicInteger() + + override fun canClaim(item: CatalogItem): Boolean = item.isFree && !item.extra["slug"].isNullOrEmpty() + + override fun claim(context: Context, item: CatalogItem): Boolean { + val app = context.applicationContext + val token = EaAuth.accessToken(app) ?: return false + val slug = item.extra["slug"] ?: return false + val offer = EaApi.freeOffer(token, slug) ?: run { StoresState.logLine("ea: no free offer for $slug"); return false } + val answer = EaApi.grantEntitlement(token, offer) + StoresState.logLine("ea: grant $offer for $slug: $answer") + return answer.optBoolean("success") || answer.optJSONArray("entitledOfferIds")?.let { ids -> (0 until ids.length()).any { ids.optString(it) == offer } } == true + } + + override fun search(context: Context, query: String): List = + StoreFront.markOwned(EaStore.search(context.applicationContext, query), StoresState.library[store], EaStore::sameGame) + + override fun install(context: Context, item: CatalogItem, root: java.io.File) { + val app = context.applicationContext + if (!EaNative.ready()) { + StoresState.logLine(EaNative.ENGINE_MISSING) + StoresState.post { StoresState.problems[store] = EaNative.ENGINE_MISSING } + return + } + val folder = StoreInstallRoot.folderFor(app, store, item.id, item.title, root) + val entry = DownloadEntry(store, item.id, item.title, cover = item.tallImageUrl ?: item.imageUrl, bytesTotal = item.sizeBytes, location = StoreInstallRoot.labelFor(app, folder)) + DownloadQueue.enqueue(app, entry) { EaInstaller(app, item, folder) } + } + + override fun uninstall(context: Context, game: InstalledStoreGame) {} +} + +internal class EaLogin(private val pending: EaAuth.Pending, override val userAgent: String) : StoreLoginActivity.Flow { + override val startUrl: String get() = pending.url + + override fun isRedirect(url: String): Boolean = url.startsWith("qrc:", ignoreCase = true) + + override fun forgetSignIn(done: () -> Unit) { + runCatching { WebCookies.expire(SIGN_IN_URLS, ".ea.com", listOf("/")) { done() } }.onFailure { done() } + } + + override fun finish(activity: StoreLoginActivity, view: WebView, url: String): String? { + val code = EaAuth.redirectValue(url, "code") ?: return activity.getString(R.string.stores_login_error_verification) + return try { + EaAuth.exchange(activity, code, pending.verifier) + null + } catch (e: Exception) { + Log.w("EaLogin", "sign-in failed: ${e.message}") + activity.getString(R.string.stores_login_error_generic) + } + } + + companion object { + val SIGN_IN_URLS = listOf("https://accounts.ea.com", "https://signin.ea.com", "https://www.ea.com") + } +} + +object EaUpdates { + val available = mutableStateMapOf() + private val checked = java.util.concurrent.ConcurrentHashMap() + private const val RECHECK_MS = 30 * 60 * 1000L + + fun check(context: Context, game: InstalledStoreGame, force: Boolean = false) { + val app = context.applicationContext + val id = game.sidecar.id + val now = System.currentTimeMillis() + if (!force && now - (checked[id] ?: 0L) < RECHECK_MS) return + checked[id] = now + Thread({ + val token = EaAuth.accessToken(app) + val offer = token?.let { runCatching { EaApi.offers(it, listOf(id)) }.getOrNull() }?.firstOrNull() + if (offer == null) { + checked.remove(id) + return@Thread + } + val live = offer.gameVersion + val installed = game.sidecar.installVersion + StoresState.post { + if (live.isNotEmpty() && installed.isNotEmpty() && live != installed) available[game.key] = live else available.remove(game.key) + } + }, "ea-update-check").start() + } + + fun start(context: Context, game: InstalledStoreGame) { + val app = context.applicationContext + val root = game.folder.parentFile?.parentFile ?: return + val known = EaLibrary.game(app, game.sidecar.id) + val item = known?.let { EaLibrary.toCatalogItem(app, it) } ?: CatalogItem( + Store.EA, game.sidecar.id, game.sidecar.title, game.sidecar.hero, tallImageUrl = game.sidecar.cover, owned = true, extra = game.sidecar.extra, + ) + available.remove(game.key) + StoresState.install(app, item, root) + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/stores/ea/EaCrypto.kt b/app/src/main/java/com/droiddeck/launcher/stores/ea/EaCrypto.kt new file mode 100644 index 0000000000..d36a541085 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/stores/ea/EaCrypto.kt @@ -0,0 +1,83 @@ +package com.droiddeck.launcher.stores.ea + +import java.security.MessageDigest +import java.time.LocalDate +import java.time.ZoneOffset +import javax.crypto.Cipher +import javax.crypto.Mac +import javax.crypto.spec.IvParameterSpec +import javax.crypto.spec.SecretKeySpec + +internal object EaCrypto { + val LSX_DEFAULT_KEY = ByteArray(16) { it.toByte() } + + private val OOA_KEY = intArrayOf(65, 50, 114, 45, 208, 130, 239, 176, 220, 100, 87, 197, 118, 104, 202, 9) + .map { it.toByte() }.toByteArray() + + private const val PRIME_10K = 104729L + private const val PRIME_20K = 224737L + private const val PRIME_30K = 350377L + + fun ecbEncrypt(data: ByteArray, key: ByteArray): ByteArray = + Cipher.getInstance("AES/ECB/PKCS5Padding").run { init(Cipher.ENCRYPT_MODE, SecretKeySpec(key, "AES")); doFinal(data) } + + fun ecbDecrypt(data: ByteArray, key: ByteArray): ByteArray = + Cipher.getInstance("AES/ECB/PKCS5Padding").run { init(Cipher.DECRYPT_MODE, SecretKeySpec(key, "AES")); doFinal(data) } + + fun licenseEncrypt(data: ByteArray): ByteArray = + Cipher.getInstance("AES/CBC/PKCS5Padding").run { init(Cipher.ENCRYPT_MODE, SecretKeySpec(OOA_KEY, "AES"), IvParameterSpec(ByteArray(16))); doFinal(data) } + + fun licenseDecrypt(data: ByteArray): ByteArray = + Cipher.getInstance("AES/CBC/PKCS5Padding").run { init(Cipher.DECRYPT_MODE, SecretKeySpec(OOA_KEY, "AES"), IvParameterSpec(ByteArray(16))); doFinal(data) } + + fun hex(bytes: ByteArray): String = bytes.joinToString("") { "%02x".format(it.toInt() and 0xFF) } + + fun unhex(text: String): ByteArray { + val digits = text.lowercase().filter { it in '0'..'9' || it in 'a'..'f' } + if (digits.length % 2 != 0) return ByteArray(0) + return ByteArray(digits.length / 2) { i -> digits.substring(i * 2, i * 2 + 2).toInt(16).toByte() } + } + + /** The session key both sides derive after the LSX challenge, from a seed the game picks. */ + fun lsxKey(seed: Int): ByteArray { + if (seed == 0) return LSX_DEFAULT_KEY.copyOf() + var state = 7L + fun next(): Int { + state = (state * 214013L + 2531011L) and 0xFFFFFFFFL + return ((state ushr 16) and 0xFFFF).toInt() + } + val start = (next().toLong() + seed) and 0xFFFFFFFFL + state = start + return ByteArray(16) { next().toByte() } + } + + fun challengeAnswer(key: String): String = hex(ecbEncrypt(key.toByteArray(Charsets.US_ASCII), LSX_DEFAULT_KEY)) + + fun challengeSeed(version: String, answer: String): Int? = when (version) { + "2" -> 0 + "3" -> (answer[0].code shl 8) or answer[1].code + else -> null + } + + /** EA's launch handshake code, which changes every UTC day. */ + fun rtpCode(day: LocalDate = LocalDate.now(ZoneOffset.UTC)): Long { + val time = ((PRIME_10K * day.year) xor (day.monthValue * PRIME_20K) xor (day.dayOfMonth * PRIME_30K)) and 0xFFFFFFFFL + return (time xor ((time shl 16) and 0xFFFFFFFFL) xor (time ushr 16)) and 0xFFFFFFFFL + } + + fun sha256(data: ByteArray): ByteArray = MessageDigest.getInstance("SHA-256").digest(data) + + fun sha1(data: ByteArray): ByteArray = MessageDigest.getInstance("SHA-1").digest(data) + + fun hmacSha256(key: ByteArray, data: ByteArray): ByteArray = + Mac.getInstance("HmacSHA256").run { init(SecretKeySpec(key, "HmacSHA256")); doFinal(data) } + + fun fnv1a(data: ByteArray): ULong { + var hash = 0xcbf29ce484222325UL + for (b in data) hash = (hash xor (b.toUByte().toULong())) * 0x100000001b3UL + return hash + } + + fun base64Url(data: ByteArray): String = + java.util.Base64.getUrlEncoder().withoutPadding().encodeToString(data) +} diff --git a/app/src/main/java/com/droiddeck/launcher/stores/ea/EaHttp.kt b/app/src/main/java/com/droiddeck/launcher/stores/ea/EaHttp.kt new file mode 100644 index 0000000000..193c4d741c --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/stores/ea/EaHttp.kt @@ -0,0 +1,47 @@ +package com.droiddeck.launcher.stores.ea + +import java.net.HttpURLConnection +import java.net.URL +import java.net.URLEncoder + +internal class EaReply(val status: Int, val body: ByteArray, val headers: Map>) { + val ok: Boolean get() = status in 200..299 + val text: String get() = body.toString(Charsets.UTF_8) + fun header(name: String): String? = headers.entries.firstOrNull { it.key.equals(name, ignoreCase = true) }?.value?.firstOrNull() +} + +internal object EaHttp { + const val USER_AGENT = "Mozilla/5.0 EA Desktop/13.735.2.6250" + private const val TIMEOUT = 30_000 + + fun form(values: List>): String = + values.joinToString("&") { (k, v) -> URLEncoder.encode(k, "UTF-8") + "=" + URLEncoder.encode(v, "UTF-8") } + + fun request( + url: String, + method: String = "GET", + headers: Map = emptyMap(), + body: ByteArray? = null, + follow: Boolean = true, + ): EaReply { + val c = URL(url).openConnection() as HttpURLConnection + try { + c.requestMethod = method + c.connectTimeout = TIMEOUT + c.readTimeout = TIMEOUT + c.instanceFollowRedirects = follow + c.setRequestProperty("User-Agent", USER_AGENT) + for ((k, v) in headers) c.setRequestProperty(k, v) + if (body != null) { + c.doOutput = true + c.outputStream.use { it.write(body) } + } + val status = c.responseCode + val stream = if (status >= 400) c.errorStream else c.inputStream + val bytes = stream?.use { it.readBytes() } ?: ByteArray(0) + return EaReply(status, bytes, c.headerFields.filterKeys { it != null }) + } finally { + c.disconnect() + } + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/stores/ea/EaInstaller.kt b/app/src/main/java/com/droiddeck/launcher/stores/ea/EaInstaller.kt new file mode 100644 index 0000000000..22d973592d --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/stores/ea/EaInstaller.kt @@ -0,0 +1,140 @@ +package com.droiddeck.launcher.stores.ea + +import android.content.Context +import com.droiddeck.launcher.R +import com.droiddeck.launcher.stores.CatalogItem +import com.droiddeck.launcher.stores.Store +import com.droiddeck.launcher.stores.StoreExe +import com.droiddeck.launcher.stores.StoreGameSidecar +import com.droiddeck.launcher.stores.StoreInstalls +import com.droiddeck.launcher.stores.StoreLanguage +import com.droiddeck.launcher.stores.amazon.AmazonNative +import com.droiddeck.launcher.stores.download.DownloadQueue +import com.droiddeck.launcher.stores.download.DownloadStage +import com.droiddeck.launcher.stores.download.StoreDownloadTier +import org.json.JSONArray +import org.json.JSONObject +import java.io.File +import java.util.concurrent.atomic.AtomicBoolean +import java.util.concurrent.atomic.AtomicLong + +internal class EaInstaller( + private val app: Context, + private val item: CatalogItem, + private val folder: File, +) : DownloadQueue.DownloadJob { + private val cancelled = AtomicBoolean(false) + + override fun run(handle: DownloadQueue.JobHandle): String? { + handle.stage(DownloadStage.MANIFEST, app.getString(R.string.stores_sync_sign_in)) + var token = EaAuth.accessToken(app) ?: throw IllegalStateException("Not signed in to EA") + val url = try { + EaApi.downloadUrl(token, item.id) + } catch (e: EaApiException) { + if (e.status != 401) throw IllegalStateException(e.message) + token = EaAuth.refreshNow(app, token) ?: throw IllegalStateException("The EA sign-in has expired") + EaApi.downloadUrl(token, item.id) + } + val game = EaLibrary.game(app, item.id) + val version = runCatching { EaApi.offers(token, listOf(item.id)).firstOrNull()?.gameVersion }.getOrNull().orEmpty() + .ifEmpty { game?.version.orEmpty() } + val cover = item.tallImageUrl ?: item.imageUrl + StoreInstalls.begin(folder, Store.EA, item.id, item.title, cover, item.imageUrl) + if (cancelled.get()) return null + + val tier = StoreDownloadTier.current(app) + handle.log("ea: \"${item.title}\" tier=${tier.id} window=${tier.networkWindow}") + val request = JSONObject() + .put("url", url) + .put("gameDir", folder.absolutePath) + .put("maxWorkers", tier.networkWindow.coerceIn(1, 64)) + .put("processWorkers", tier.processWorkers) + .put("caBundle", "") + val shown = AtomicLong(-1) + val downloading = AtomicBoolean(false) + val listener = object : AmazonNative.InstallListener { + override fun onStatus(text: String) { handle.stage(DownloadStage.MANIFEST, text) } + override fun onCheck(doneBytes: Long, totalBytes: Long, files: Int, filesTotal: Int) { + handle.stage(DownloadStage.MANIFEST, "Checking filesโ€ฆ") + handle.stageProgress(doneBytes, totalBytes, files, filesTotal, bytes = true) + } + override fun onSizes(pendingBytes: Long, totalBytes: Long) { handle.diskSize(totalBytes) } + override fun onProgress(done: Long, total: Long, files: Int, filesTotal: Int) { + if (downloading.compareAndSet(false, true)) handle.stage(DownloadStage.DOWNLOAD) + while (true) { + val before = shown.get() + if (done < before) return + if (shown.compareAndSet(before, done)) break + } + handle.progress(done, total, "Downloading ($files/$filesTotal files)") + } + override fun onLog(line: String) { handle.log("ea: $line") } + override fun beforeReplace(): Boolean = try { + StoreInstalls.markUpdating(folder) + true + } catch (e: Exception) { + handle.log("ea: the install record could not be switched to updating (${e.javaClass.simpleName})") + false + } + override fun onComplete(success: Boolean, cancelled: Boolean, error: String, result: String) = Unit + } + val outcome = EaNative.install(request, listener, cancelled) + if (outcome.cancelled || cancelled.get() && !outcome.success) return null + if (!outcome.success) throw IllegalStateException(outcome.error.ifEmpty { "The EA install failed" }) + val result = outcome.result ?: JSONObject() + result.optLong("totalBytes").takeIf { it > 0 }?.let { EaPrefs.get(app).edit().putLong("size_${item.id}", it).apply() } + + handle.stage(DownloadStage.INSTALL, app.getString(R.string.stores_registering)) + val sidecar = sidecarFor(app, item, folder, game, version, cover) { handle.log("ea: $it") } + StoreInstalls.complete(app, folder, sidecar, onStep = { done, steps -> handle.stageProgress(done.toLong(), steps.toLong()) }) + return folder.path + } + + override fun cancel(deleteFiles: Boolean) { + cancelled.set(true) + if (deleteFiles) StoreInstalls.discard(app, folder, emptyList()) + } + + companion object { + fun locale(context: Context, available: List): String { + val wanted = StoreLanguage.localeFor(null, context) + val exact = "${wanted.language}_${wanted.country}" + return available.firstOrNull { it.equals(exact, true) } + ?: available.firstOrNull { it.substringBefore('_').equals(wanted.language, true) } + ?: available.firstOrNull { it.equals("en_US", true) } + ?: "en_US" + } + + internal fun sidecarFor(app: Context, item: CatalogItem, folder: File, game: EaGame?, version: String, cover: String?, log: (String) -> Unit): StoreGameSidecar { + val manifest = EaManifest.read(folder) + if (manifest == null) log("no installerdata.xml in ${folder.name}") + val launcher = manifest?.launcher() + val candidates = listOfNotNull(launcher?.path, game?.executePath?.takeIf { it.isNotEmpty() }) + var exe = candidates.firstNotNullOfOrNull { EaPaths.relativeOnDisk(folder, EaPaths.relative(it)) }.orEmpty() + if (exe.isEmpty()) exe = StoreExe.pick(folder, null, item.title) + if (exe.isEmpty()) { log("no exe found; pick one in Steam settings โ€บ Added games"); exe = "game.exe" } else log("exe=$exe") + val args = EaPaths.splitArgs(listOf(game?.parameters.orEmpty(), launcher?.parameters.orEmpty()).filter { it.isNotBlank() }.joinToString(" ")) + val keys = JSONArray() + listOfNotNull(game?.installCheck, game?.executePath, launcher?.path).mapNotNull { EaPaths.registered(it) } + .distinctBy { it.key.lowercase() + "|" + it.value.lowercase() } + .forEach { keys.put(JSONArray().put(it.key).put(it.value)) } + val extra = linkedMapOf( + "contentId" to (game?.contentId ?: item.extra["contentId"].orEmpty()), + "slug" to (game?.slug ?: item.extra["slug"].orEmpty()), + "multiplayerId" to game?.multiplayerId.orEmpty(), + "masterTitleId" to game?.masterTitleId.orEmpty(), + "locale" to locale(app, game?.locales.orEmpty()), + "registry" to keys.toString(), + "touchup" to manifest?.touchupPath.orEmpty().replace('\\', '/').trimStart('/'), + "touchupArgs" to manifest?.touchupParameters.orEmpty(), + "contentIds" to manifest?.contentIds.orEmpty().joinToString(","), + "displayName" to manifest?.title(locale(app, game?.locales.orEmpty())).orEmpty(), + ).filterValues { it.isNotEmpty() } + return StoreGameSidecar( + Store.EA, item.id, item.title, exe = exe, args = args, + installVersion = version.ifEmpty { manifest?.version.orEmpty() }, installedAt = System.currentTimeMillis(), + cover = cover, hero = item.imageUrl, extra = extra, cloud = false, logo = item.logoUrl, + ) + } + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/stores/ea/EaLaunch.kt b/app/src/main/java/com/droiddeck/launcher/stores/ea/EaLaunch.kt new file mode 100644 index 0000000000..a9b623a2d6 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/stores/ea/EaLaunch.kt @@ -0,0 +1,138 @@ +package com.droiddeck.launcher.stores.ea + +import android.content.Context +import android.util.Base64 +import android.util.Log +import com.droiddeck.launcher.stores.Store +import com.droiddeck.launcher.stores.StoreGameSidecar +import com.droiddeck.launcher.stores.StoreInstallRoot +import org.json.JSONArray +import org.json.JSONObject +import java.io.File +import java.util.UUID + +object EaLaunch { + private const val TAG = "EaLaunch" + const val ENV_FILE = ".droiddeck-ea-env" + + private fun installed(context: Context, id: String): Pair? = + StoreInstallRoot.gameFolders(context).firstNotNullOfOrNull { f -> + StoreGameSidecar.read(f)?.takeIf { it.store == Store.EA && it.id == id && it.isInstalled }?.let { f to it } + } + + internal fun environment( + offerId: String, + contentId: String, + locale: String, + generic: String, + access: String, + opaque: String, + account: EaAuth.Account, + session: String = UUID.randomUUID().toString(), + ): LinkedHashMap = linkedMapOf( + "EAAuthCode" to "unavailable", + "EAEgsProxyIpcPort" to "0", + "EAEntitlementSource" to "EA", + "EAExternalSource" to "EA", + "EAFreeTrialGame" to "false", + "EAGameLocale" to locale, + "EAGenericAuthToken" to generic, + "EALaunchCode" to "unavailable", + "EALaunchOwner" to "EA", + "EALaunchEAID" to account.eaId.ifEmpty { account.displayName }, + "EALaunchEnv" to "production", + "EALaunchOfflineMode" to "false", + "EALsxPort" to EaLsx.PORT.toString(), + "EARtPLaunchCode" to EaCrypto.rtpCode().toString(), + "EASecureLaunchTokenTemp" to account.userId, + "EASteamProxyIpcPort" to "0", + "OriginSessionKey" to session, + "ContentId" to contentId, + "EAOnErrorExitRetCode" to "1", + "EAConnectionId" to offerId, + "EALicenseToken" to offerId, + "EALaunchUserAuthToken" to opaque, + "EAAccessTokenJWS" to access, + ) + + /** Adds what installs made before the manifest's content ids and title were recorded are missing. */ + internal fun backfill(folder: File, sidecar: StoreGameSidecar): StoreGameSidecar { + if (sidecar.extra.containsKey("contentIds") || sidecar.extra.containsKey("displayName")) return sidecar + val manifest = EaManifest.read(folder) ?: return sidecar + val locale = sidecar.extra["locale"].orEmpty().ifEmpty { "en_US" } + val added = mapOf( + "contentIds" to manifest.contentIds.joinToString(","), + "displayName" to manifest.title(locale).orEmpty(), + ).filterValues { it.isNotEmpty() } + if (added.isEmpty()) return sidecar + val updated = sidecar.copy(extra = sidecar.extra + added) + runCatching { updated.write(folder) }.onFailure { Log.w(TAG, "sidecar: ${it.javaClass.simpleName}") } + return updated + } + + /** Answers the guest's request right before an EA game starts: session, licence and the LSX endpoint. */ + fun prepare(context: Context, request: JSONObject): JSONObject { + val app = context.applicationContext + val id = request.optString("id") + val reply = JSONObject().put("ok", false) + val (folder, recorded) = installed(app, id) ?: return reply.put("reason", "not-installed") + val sidecar = backfill(folder, recorded) + runCatching { com.droiddeck.launcher.stores.StoreLaunch.refreshLauncher(folder, sidecar) } + File(folder, ENV_FILE).delete() + val account = EaAuth.load(app) ?: return reply.put("reason", "signed-out") + val access = EaAuth.accessToken(app) ?: return reply.put("reason", "sign-in-expired") + val contentId = sidecar.extra["contentId"].orEmpty() + val locale = sidecar.extra["locale"].orEmpty().ifEmpty { "en_US" } + val core = EaOoa.coreDir(folder, sidecar.exe) + val hashVersion = core?.let(EaOoa::activationVersion) ?: 1 + val hardware = request.optJSONObject("hardware")?.let(EaOoa.Hardware::fromJson)?.takeIf { it.complete(hashVersion) } + val legacy = EaOoa.legacyCore(core) + + val lifetime = if (legacy) 14400 else 550 + val opaque = EaAuth.mint(app, EaAuth.CLIENT_ID, "token", EaAuth.OPAQUE_SCOPES, "OPAQUE", lifetime).orEmpty() + val known = (sidecar.extra["contentIds"].orEmpty().split(',') + sidecar.extra["multiplayerId"].orEmpty()).map { it.trim() }.filter { it.isNotEmpty() }.toSet() + val lsx = EaLsx.start(app, EaLsx.Game(id, contentId, sidecar.title, sidecar.installVersion, locale, hardware, hashVersion, opaque, + System.currentTimeMillis() + (lifetime - 30) * 1000L, known)) + val env = environment(id, contentId, locale, if (legacy && opaque.isNotEmpty()) opaque else access, access, opaque, EaAuth.load(app) ?: account) + val tmp = File(folder, "$ENV_FILE.tmp") + tmp.writeText(env.entries.joinToString("\r\n", postfix = "\r\n") { "${it.key}=${it.value}" }) + tmp.renameTo(File(folder, ENV_FILE)) + + val licenses = JSONArray() + val notes = ArrayList() + if (core != null) { + val ids = (listOf(contentId) + sidecar.extra["contentIds"].orEmpty().split(',')).map { it.trim() }.filter { it.isNotEmpty() }.distinct() + if (hardware == null) notes += "no-hardware" else { + val hash = EaOoa.machineHash(hardware, hashVersion) + for (content in ids) { + notes += try { + for ((path, data) in EaOoa.files(core, EaOoa.request(access, content, hash))) { + licenses.put(JSONObject().put("path", path).put("data", Base64.encodeToString(data, Base64.NO_WRAP))) + } + "$content:ok" + } catch (e: Exception) { + Log.w(TAG, "licence $content for $id: ${e.message}") + com.droiddeck.launcher.stores.StoresState.logLine("ea licence $content for $id v$hashVersion legacy=$legacy: ${e.message}") + "$content:refused" + } + } + } + } + if (core != null && notes.isNotEmpty() && notes.none { it.endsWith(":ok") }) runCatching { + val rows = EaApi.legacyEntitlements(access).filter { it.optString("productId") == id } + val types = rows.joinToString(",") { it.optString("entitlementType") + "/" + it.optString("entitlementTag") + "/" + it.optString("status") } + com.droiddeck.launcher.stores.StoresState.logLine("ea $id has no licence; entitlements: ${types.ifEmpty { "none" }}") + } + val licenseNote = if (core == null) "none-needed" else "v$hashVersion " + notes.joinToString(",") + Log.i(TAG, "prepared $id lsx=$lsx legacy=$legacy opaque=${opaque.isNotEmpty()} licence=$licenseNote") + return reply.put("ok", true).put("lsx", lsx).put("license", licenseNote).put("licenses", licenses) + } +} + +object EaSizes { + fun size(context: Context, item: com.droiddeck.launcher.stores.CatalogItem): Long { + val token = EaAuth.accessToken(context) ?: return 0L + val url = runCatching { EaApi.downloadUrl(token, item.id) }.getOrNull() ?: return 0L + return EaNative.call("zip.size", JSONObject().put("url", url))?.optLong("totalBytes") ?: 0L + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/stores/ea/EaLibrary.kt b/app/src/main/java/com/droiddeck/launcher/stores/ea/EaLibrary.kt new file mode 100644 index 0000000000..336b8b6390 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/stores/ea/EaLibrary.kt @@ -0,0 +1,320 @@ +package com.droiddeck.launcher.stores.ea + +import android.content.Context +import android.content.SharedPreferences +import com.droiddeck.launcher.R +import com.droiddeck.launcher.stores.CatalogItem +import com.droiddeck.launcher.stores.Store +import com.droiddeck.launcher.stores.StoreFront +import com.droiddeck.launcher.stores.StoreNet +import com.droiddeck.launcher.stores.StoresState +import com.droiddeck.launcher.stores.mergeItems +import org.json.JSONArray +import org.json.JSONObject +import java.util.concurrent.Executors +import java.util.concurrent.TimeUnit +import java.util.concurrent.atomic.AtomicBoolean + +object EaPrefs { + const val FILE = "stores.ea" + fun get(context: Context): SharedPreferences = context.applicationContext.getSharedPreferences(FILE, Context.MODE_PRIVATE) +} + +data class EaGame( + val offerId: String, + val contentId: String, + val title: String, + val slug: String, + val tall: String = "", + val wide: String = "", + val logo: String = "", + val version: String = "", + val executePath: String = "", + val installCheck: String = "", + val parameters: String = "", + val multiplayerId: String = "", + val masterTitleId: String = "", + val cloudSaves: String = "", + val locales: List = emptyList(), + val productName: String = "", +) { + fun toJson(): JSONObject = JSONObject() + .put("offerId", offerId).put("contentId", contentId).put("title", title).put("slug", slug) + .put("tall", tall).put("wide", wide).put("logo", logo).put("version", version) + .put("executePath", executePath).put("installCheck", installCheck).put("parameters", parameters) + .put("multiplayerId", multiplayerId).put("masterTitleId", masterTitleId).put("cloudSaves", cloudSaves) + .put("locales", JSONArray(locales)).put("productName", productName) + + companion object { + fun fromJson(o: JSONObject): EaGame? { + val locales = o.optJSONArray("locales") + return EaGame( + offerId = o.optString("offerId").ifEmpty { return null }, + contentId = o.optString("contentId"), + title = o.optString("title"), + slug = o.optString("slug"), + tall = o.optString("tall"), + wide = o.optString("wide"), + logo = o.optString("logo"), + version = o.optString("version"), + executePath = o.optString("executePath"), + installCheck = o.optString("installCheck"), + parameters = o.optString("parameters"), + multiplayerId = o.optString("multiplayerId"), + masterTitleId = o.optString("masterTitleId"), + cloudSaves = o.optString("cloudSaves"), + locales = (0 until (locales?.length() ?: 0)).map { locales!!.optString(it) }, + productName = o.optString("productName"), + ) + } + } +} + +object EaLibrary { + private const val KEY_CACHE = "library_cache_v3" + private const val KEY_SYNCED_AT = "library_synced_at_v3" + private const val THROTTLE_MS = 6 * 60 * 60 * 1000L + private const val ART_TTL_MS = 7 * 24 * 60 * 60 * 1000L + private const val ART_THREADS = 4 + const val STORE_URL = "https://www.ea.com/ea-app/library" + private val gate = SyncGate() + private val generation = java.util.concurrent.atomic.AtomicInteger() + + /** Drops the cache and makes any sync already running drop its results, in one step. */ + fun reset(context: Context) { + synchronized(cacheLock) { + generation.incrementAndGet() + EaPrefs.get(context).edit().remove(KEY_CACHE).remove(KEY_SYNCED_AT).commit() + } + } + + internal fun snapshot(app: Context): Pair> = synchronized(cacheLock) { generation.get() to cached(app) } + + internal fun storeCache(app: Context, games: List, gen: Int): Boolean = synchronized(cacheLock) { + gen == generation.get() && + EaPrefs.get(app).edit().putString(KEY_CACHE, JSONArray(games.map { it.toJson() }).toString()).putLong(KEY_SYNCED_AT, System.currentTimeMillis()).commit() + } + + private val cacheLock = Any() + private val store = Store.EA + + fun cached(context: Context): List { + val text = EaPrefs.get(context).getString(KEY_CACHE, null) ?: return emptyList() + val arr = runCatching { JSONArray(text) }.getOrNull() ?: return emptyList() + return (0 until arr.length()).mapNotNull { arr.optJSONObject(it)?.let(EaGame::fromJson) } + } + + fun game(context: Context, offerId: String): EaGame? = cached(context).firstOrNull { it.offerId == offerId } + + + fun toCatalogItem(context: Context, g: EaGame): CatalogItem { + val prefs = EaPrefs.get(context) + val tall = g.tall.ifEmpty { prefs.getString("poster_${g.offerId}", null).orEmpty() } + return CatalogItem( + store = store, + id = g.offerId, + title = g.title.ifBlank { g.slug }, + imageUrl = g.wide.ifEmpty { tall }.ifEmpty { null }, + tallImageUrl = tall.ifEmpty { g.wide }.ifEmpty { null }, + publisher = "Electronic Arts", + owned = true, + sizeBytes = prefs.getLong("size_${g.offerId}", 0L), + storeUrl = STORE_URL, + extra = mapOf("contentId" to g.contentId, "slug" to g.slug, "version" to g.version, "productName" to g.productName), + logoUrl = g.logo.ifEmpty { null }, + ) + } + + /** One entry per game: owned editions of the same base game collapse onto the base offer. */ + internal fun pick(owned: List, offers: Map): List> { + val usable = owned.filter { o -> + val offer = offers[o.offerId] ?: return@filter false + !o.trial && o.downloadable && offer.downloadable && + (offer.displayType.isEmpty() || offer.displayType.equals("FullGame", true)) && + (o.gameType.isEmpty() || o.gameType.equals("BASE_GAME", true)) + } + return usable.groupBy { it.baseSlug.ifEmpty { it.slug }.ifEmpty { it.offerId } }.values.map { group -> + val chosen = group.firstOrNull { it.baseSlug.isEmpty() } ?: group.first() + chosen to offers.getValue(chosen.offerId) + }.sortedBy { it.first.name.lowercase() } + } + + /** + * Offers EA lists as owned whose entitlements grant no active game download: an online pass or product-key + * link such as Burnout Paradise's VALIDATED_ONLINE_ACCESS, or a Game Pass title disabled once the + * subscription lapsed. EA refuses their licence. Offers with no entitlement rows at all are left alone. + */ + internal fun withoutGameDownload(rows: List): Map> = + rows.groupBy { it.optString("productId") }.filterKeys { it.isNotEmpty() }.filterValues { offer -> + offer.none { it.optString("entitlementType").equals("ORIGIN_DOWNLOAD", true) && it.optString("status").equals("ACTIVE", true) } + } + + private fun art(app: Context, token: String, slugs: Collection, gen: Int): Map { + val prefs = EaPrefs.get(app) + val now = System.currentTimeMillis() + val out = java.util.concurrent.ConcurrentHashMap() + val pool = Executors.newFixedThreadPool(ART_THREADS) + try { + for (slug in slugs.filter { it.isNotEmpty() }) { + if (gen != generation.get()) break + val cached = prefs.getString("art_$slug", null)?.let { runCatching { JSONObject(it) }.getOrNull() } + if (cached != null && now - cached.optLong("at") < ART_TTL_MS) { + out[slug] = EaApi.Images(cached.optString("tall").ifEmpty { null }, cached.optString("wide").ifEmpty { null }, cached.optString("logo").ifEmpty { null }) + continue + } + pool.execute { + if (gen != generation.get()) return@execute + val images = runCatching { EaApi.images(token, slug) }.getOrNull() ?: return@execute + out[slug] = images + prefs.edit().putString( + "art_$slug", + JSONObject().put("at", now).put("tall", images.tall.orEmpty()).put("wide", images.wide.orEmpty()).put("logo", images.logo.orEmpty()).toString(), + ).apply() + } + } + } finally { + pool.shutdown() + pool.awaitTermination(2, TimeUnit.MINUTES) + } + return out + } + + private fun posters(app: Context, games: List, gen: Int) { + val prefs = EaPrefs.get(app) + val todo = games.filter { it.tall.isEmpty() && !prefs.contains("poster_${it.offerId}") }.take(40) + if (todo.isEmpty()) return + val pool = Executors.newFixedThreadPool(ART_THREADS) + try { + for (g in todo) pool.execute { + if (gen != generation.get()) return@execute + prefs.edit().putString("poster_${g.offerId}", runCatching { StoreNet.sgdbPoster(g.title) }.getOrDefault("")).apply() + } + } finally { + pool.shutdown() + pool.awaitTermination(5, TimeUnit.MINUTES) + } + } + + private fun publish(app: Context, games: List, gen: Int = generation.get()) { + if (gen != generation.get()) return + val items = games.map { toCatalogItem(app, it) } + StoresState.post { + if (gen != generation.get()) return@post + StoresState.library[store] = mergeItems(StoresState.library[store], items) + StoresState.shelves[store]?.let { StoresState.shelves[store] = StoreFront.markOwned(it, items, EaStore::sameGame) } + } + } + + private inline fun withToken(app: Context, token: String, call: (String) -> T): T = try { + call(token) + } catch (e: EaApiException) { + if (e.status != 401) throw e + call(EaAuth.refreshNow(app, token) ?: throw e) + } + + fun sync(context: Context, force: Boolean) { + if (!gate.enter()) return + var forced = force + do { + runCatching { syncOnce(context.applicationContext, forced) } + forced = true + } while (gate.leave()) + } + + private fun syncOnce(app: Context, force: Boolean) { + val (gen, cache) = snapshot(app) + val prefs = EaPrefs.get(app) + val quiet = cache.isNotEmpty() && !force + fun status(id: Int) { if (!quiet) StoresState.post { StoresState.status[store] = app.getString(id) } } + fun problem(text: String?) { + StoresState.post { + StoresState.status.remove(store) + if (text == null) StoresState.problems.remove(store) else StoresState.problems[store] = text + } + } + try { + if (cache.isNotEmpty()) publish(app, cache, gen) + if (!force && cache.isNotEmpty() && System.currentTimeMillis() - prefs.getLong(KEY_SYNCED_AT, 0L) in 0 until THROTTLE_MS) { + return problem(null) + } + status(R.string.stores_sync_sign_in) + val token = EaAuth.accessToken(app) ?: return problem(StoresState.notSignedInLine(store)) + status(R.string.stores_sync_game_list) + val listed = withToken(app, token) { EaApi.owned(it) } + val rows = try { + withToken(app, token) { EaApi.legacyEntitlements(it) } + } catch (e: Exception) { + if (e is EaApiException && e.status == 401) throw e + if (e !is EaApiException && e !is java.io.IOException) throw e + StoresState.logLine("ea: entitlements unavailable, keeping every owned product: ${e.message}") + emptyList() + } + val unplayable = withoutGameDownload(rows) + for ((id, held) in unplayable) if (listed.any { it.offerId == id }) StoresState.logLine( + "ea: left out $id, no game download: " + held.joinToString(",") { it.optString("entitlementTag") + "/" + it.optString("status") + "/" + it.optString("statusReasonCode") + "/" + it.optString("externalType") }) + val owned = listed.filterNot { it.offerId in unplayable } + val offers = withToken(app, token) { EaApi.offers(it, owned.map { o -> o.offerId }) }.associateBy { it.offerId } + val picked = pick(owned, offers) + StoresState.logLine("ea: ${owned.size} owned products, ${picked.size} games") + for ((o, offer) in picked) StoresState.logLine( + "ea: owned ${o.offerId} content=${offer.contentId} master=${offer.masterTitleId} mp=${offer.multiplayerId} via=${o.ownership.joinToString("+")} type=${o.gameType}") + if (picked.isEmpty()) { + if (owned.size < listed.size && storeCache(app, emptyList(), gen)) publish(app, emptyList(), gen) + return problem(app.getString(R.string.stores_sync_no_games, store.label).takeIf { cache.isEmpty() || owned.size < listed.size }) + } + if (gen != generation.get()) return + status(R.string.stores_sync_cover_art) + val images = art(app, token, picked.map { it.first.slug }, gen) + val games = picked.map { (o, offer) -> + val img = images[o.slug] + EaGame( + offerId = o.offerId, contentId = offer.contentId, title = o.name.ifBlank { offer.displayName }, slug = o.slug, + tall = img?.tall.orEmpty(), wide = img?.wide.orEmpty(), logo = img?.logo.orEmpty(), version = offer.gameVersion, + executePath = offer.executePathOverride, installCheck = offer.installCheckOverride, parameters = offer.executeParameters, + multiplayerId = offer.multiplayerId, masterTitleId = offer.masterTitleId, cloudSaves = offer.cloudSaves, locales = offer.locales, + productName = o.productName, + ) + } + if (!storeCache(app, games, gen)) return + posters(app, games, gen) + if (gen != generation.get()) return + publish(app, games, gen) + problem(null) + } catch (e: EaApiException) { + StoresState.logLine("ea: library sync failed: ${e.message}") + if (e.status == 401) StoresState.markSignInExpired(store) + problem(if (cache.isEmpty()) e.message else null) + } catch (e: Exception) { + StoresState.logLine("ea: library sync failed: ${e.javaClass.simpleName} ${e.message.orEmpty()}") + problem(if (cache.isEmpty()) e.message ?: app.getString(R.string.stores_sync_failed) else null) + } + } +} + +/** One sync at a time; a request made meanwhile makes the running one go round again rather than being lost. */ +internal class SyncGate { + private var busy = false + private var again = false + + /** True when the caller should run; false when a running sync will pick the request up. */ + @Synchronized + fun enter(): Boolean { + if (busy) { + again = true + return false + } + busy = true + return true + } + + /** True when another round was requested while running; the caller stays the runner. */ + @Synchronized + fun leave(): Boolean { + if (again) { + again = false + return true + } + busy = false + return false + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/stores/ea/EaLsx.kt b/app/src/main/java/com/droiddeck/launcher/stores/ea/EaLsx.kt new file mode 100644 index 0000000000..f9e6b286a0 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/stores/ea/EaLsx.kt @@ -0,0 +1,446 @@ +package com.droiddeck.launcher.stores.ea + +import android.content.Context +import android.util.Log +import org.xmlpull.v1.XmlPullParser +import org.xmlpull.v1.XmlPullParserFactory +import java.io.ByteArrayOutputStream +import java.io.OutputStream +import java.io.StringReader +import java.net.InetAddress +import java.net.ServerSocket +import java.net.Socket +import java.time.LocalDateTime +import java.time.ZoneOffset +import java.time.format.DateTimeFormatter + +/** + * The local SDK endpoint EA games talk to in place of the EA app (LSX: XML over TCP, AES after a + * challenge). It answers for the one game DroidDeck last prepared. + */ +object EaLsx { + private const val TAG = "EaLsx" + const val PORT = 3216 + private const val SENDER = "EALS" + private const val CHALLENGE_KEY = "cacf897a20b6d612ad0c05e011df52bb" + private const val CHALLENGE_VERSION = "10,5,30,15625" + private const val LANGUAGES = "ar_SA,de_DE,en_US,es_ES,es_MX,fr_FR,it_IT,ja_JP,ko_KR,pl_PL,pt_BR,ru_RU,zh_CN,zh_TW" + + private val SERVICES = listOf( + "EbisuSDK" to "SDK", "EbisuSDK" to "PROFILE", "XMPP" to "PRESENCE", "XMPP" to "FRIENDS", "Commerce" to "COMMERCE", + "EbisuSDK" to "RECENTPLAYER", "EbisuSDK" to "IGO", "EbisuSDK" to "MISC", "EALS" to "LOGIN", "EbisuSDK" to "UTILITY", + "XMPP" to "XMPP", "XMPP" to "CHAT", "EbisuSDK" to "IGO_EVENT", "EALS" to "EALS_EVENTS", "EbisuSDK" to "LOGIN_EVENT", + "XMPP" to "INVITE_EVENT", "EbisuSDK" to "PROFILE_EVENT", "XMPP" to "PRESENCE_EVENT", "XMPP" to "FRIENDS_EVENT", + "Commerce" to "COMMERCE_EVENT", "XMPP" to "CHAT_EVENT", "EbisuSDK" to "DOWNLOAD_EVENT", "EbisuSDK" to "PERMISSION", + "EbisuSDK" to "RESOURCES", "EbisuSDK" to "BLOCKED_USERS", "EbisuSDK" to "BLOCKED_USER_EVENT", "EbisuSDK" to "GET_USERID", + "EbisuSDK" to "ONLINE_STATUS_EVENT", "EbisuSDK" to "ACHIEVEMENT", "EbisuSDK" to "ACHIEVEMENT_EVENT", + "EbisuSDK" to "BROADCAST_EVENT", "PI" to "PROGRESSIVE_INSTALLATION", "PI" to "PROGRESSIVE_INSTALLATION_EVENT", + "EbisuSDK" to "CONTENT", + ) + + class Game( + val offerId: String, + val contentId: String, + val title: String, + val version: String, + val locale: String, + val hardware: EaOoa.Hardware?, + val hashVersion: Int, + val token: String = "", + val tokenExpiresAt: Long = 0L, + val contentIds: Set = emptySet(), + ) { + val validToken: String? get() = token.takeIf { it.isNotEmpty() && System.currentTimeMillis() < tokenExpiresAt } + } + + /** The parts of a request a reply depends on. */ + class Message(val recipient: String, val id: String, val name: String, val attrs: Map, val children: List>) + + interface Account { + val userId: String + val personaId: String + val persona: String + fun authCode(clientId: String, scope: String?): String? + fun license(contentId: String, requestTicket: String, ticketEngine: String): String? + fun entitlements(group: String): List> + fun token(): String? + } + + @Volatile var game: Game? = null + @Volatile private var account: Account? = null + /** The one session of the current launch that may act for the account. */ + /** Bumped whenever the launch changes; a connection accepted under an older one is not admitted. */ + @Volatile internal var generation = 0 + private val holder = java.util.concurrent.atomic.AtomicReference(null) + private var server: ServerSocket? = null + private val lock = Any() + private const val MAX_CLIENTS = 8 + private val WHITESPACE = Regex("[ \t]+") + + fun start(context: Context, game: Game): Boolean { + synchronized(lock) { + closeSessions() + this.game = game + account = AppAccount(context.applicationContext) + runCatching { server?.close() } + return try { + val socket = ServerSocket().apply { + reuseAddress = true + bind(java.net.InetSocketAddress(InetAddress.getByName("127.0.0.1"), PORT), 8) + } + server = socket + Thread({ accept(socket) }, "ea-lsx").apply { isDaemon = true }.start() + Log.i(TAG, "listening on $PORT") + true + } catch (e: Exception) { + Log.w(TAG, "could not listen on $PORT: ${e.javaClass.simpleName}") + false + } + } + } + + /** Ends the endpoint; with [offerId], only if it still serves that game, so a late exit cannot stop a newer launch. */ + fun stop(offerId: String? = null) { + synchronized(lock) { + if (offerId != null && game?.offerId != offerId) return + runCatching { server?.close() } + server = null + game = null + account = null + closeSessions() + } + } + + private fun closeSessions() { + generation++ + holder.set(null) + synchronized(sessions) { sessions.forEach { it.trusted = false } } + for (socket in open) runCatching { socket.close() } + open.clear() + } + + private val open = java.util.Collections.newSetFromMap(java.util.concurrent.ConcurrentHashMap()) + private const val HANDSHAKE_TIMEOUT_MS = 15_000 + private const val UNTRUSTED_IDLE_MS = 10 * 60 * 1000 + + private fun accept(socket: ServerSocket) { + while (!socket.isClosed) { + val client = runCatching { socket.accept() }.getOrNull() ?: continue + val (owner, unreadable) = ownerUid(client) + val verified = owner?.let { it == android.os.Process.myUid() } + if (verified == false) { + Log.w(TAG, "refused a connection from another app") + runCatching { client.close() } + continue + } + if (unreadable != null) note("peer cannot be identified: $unreadable") + val session = runCatching { Session(client, client.getOutputStream(), verified == true, unreadable != null) }.getOrNull() + val live = session != null && synchronized(lock) { server === socket && admit(session).also { if (it) open += client } } + if (!live) { + runCatching { client.close() } + continue + } + Thread({ try { serve(client, session!!) } finally { synchronized(sessions) { sessions -= session!! }; open -= client } }, "ea-lsx-client").apply { isDaemon = true }.start() + } + } + + /** + * The uid owning the connecting socket, or null where SELinux hides /proc/net. The guest runs + * under this app's uid, so any other uid is another app; an unknown owner never gets credentials. + */ + /** The connecting socket's uid, or why Android hid socket ownership from this app (some builds deny /proc/net). */ + private fun ownerUid(client: Socket): Pair { + val port = client.port + var denied: String? = null + var read = false + for (path in listOf("/proc/net/tcp6", "/proc/net/tcp")) { + val lines = runCatching { java.io.File(path).readLines() }.onFailure { denied = "$path ${it.javaClass.simpleName}" }.getOrNull() ?: continue + read = true + owner(lines, port)?.let { return it to null } + } + return null to if (read) null else denied ?: "no socket table" + } + + internal fun owner(lines: List, port: Int): Int? = lines.drop(1).firstNotNullOfOrNull { line -> + val f = line.trim().split(WHITESPACE) + val local = f.getOrNull(1)?.substringAfterLast(':')?.toIntOrNull(16) + val remote = f.getOrNull(2)?.substringAfterLast(':')?.toIntOrNull(16) + if (local == port && remote == PORT) f.getOrNull(7)?.toIntOrNull() else null + } + + /** + * Adds [session] unless the cap is reached by sessions that cannot be replaced; otherwise the + * oldest session that never claimed the prepared game (then the oldest untrusted one) makes room. + * Counting and eviction share one lock, so the live total never passes the cap. + */ + internal fun admit(session: Session): Boolean = synchronized(sessions) { + if (sessions.count { !it.evicted } >= MAX_CLIENTS) { + val candidates = sessions.filter { !it.trusted && !it.evicted } + val victim = candidates.firstOrNull { !it.claimed } ?: candidates.firstOrNull() ?: return false + victim.evicted = true + runCatching { victim.socket.close() } + } + sessions += session + true + } + + internal val sessions = LinkedHashSet() + + /** Trust and eviction exclude each other: an evicted session never becomes trusted, a trusted one is never evicted. */ + internal fun promote(session: Session, matches: Boolean) { + synchronized(sessions) { session.trusted = matches && !session.evicted && session.born == generation && holder.compareAndSet(null, session) } + } + + internal class Session(val socket: Socket, val output: OutputStream, val verified: Boolean, val unverifiable: Boolean = false) { + val born = generation + val connectedAt = System.currentTimeMillis() + @Volatile var evicted = false + @Volatile var claimed = false + var key: ByteArray? = null + @Volatile var trusted = false + var pending: ByteArray? = null + + /** A peer Android names as another app never gets account data; one Android cannot name is judged by its claim alone. */ + val mayTrust get() = (verified || unverifiable) && claimed + + @Synchronized + fun send(xml: String) { + val key = this.key + val text = if (key == null) xml else EaCrypto.hex(EaCrypto.ecbEncrypt(xml.toByteArray(), key)) + output.write(text.toByteArray()) + output.write(0) + output.flush() + } + } + + private fun note(line: String) = com.droiddeck.launcher.stores.StoresState.logLine("ea lsx: $line") + + private fun serve(client: Socket, session: Session) { + client.tcpNoDelay = true + client.soTimeout = HANDSHAKE_TIMEOUT_MS + val seen = LinkedHashSet() + var why = "closed by the game" + note("game connected") + try { + session.send("") + val input = client.getInputStream() + val pending = ByteArrayOutputStream() + val chunk = ByteArray(16 * 1024) + while (true) { + if (session.key == null) { + val left = session.connectedAt + HANDSHAKE_TIMEOUT_MS - System.currentTimeMillis() + if (left <= 0) throw java.net.SocketTimeoutException() + client.soTimeout = left.toInt() + } + val n = input.read(chunk) + if (n < 0) break + pending.write(chunk, 0, n) + for (frame in frames(pending, session.key)) { + for (one in Regex(".*?", RegexOption.DOT_MATCHES_ALL).findAll(frame)) { + val message = parse(one.value) ?: continue + if (seen.add(message.name)) note("request ${message.name}") + val reply = runCatching { answer(session, message) } + .onFailure { note("${message.name} failed: ${it.javaClass.simpleName}") }.getOrNull() + if (reply != null) session.send("$reply") + session.pending?.let { session.key = it; session.pending = null } + if (session.key != null) { + val idle = if (session.trusted) 0 else UNTRUSTED_IDLE_MS + if (client.soTimeout != idle) client.soTimeout = idle + } + } + } + if (pending.size() > 4 * 1024 * 1024) { why = "message too large"; break } + } + } catch (e: java.net.SocketTimeoutException) { + why = "no trusted handshake in time" + } catch (e: Exception) { + why = e.javaClass.simpleName + } finally { + holder.compareAndSet(session, null) + note("game disconnected ($why)") + runCatching { client.close() } + } + } + + /** + * Complete messages in what has arrived so far. Messages normally end in a NUL; one that does + * not counts once it holds a whole `` element, plain or decrypted. + */ + private fun frames(pending: ByteArrayOutputStream, key: ByteArray?): List { + val bytes = pending.toByteArray() + val out = ArrayList() + var start = 0 + for (i in bytes.indices) { + if (bytes[i].toInt() != 0) continue + if (i > start) decode(String(bytes, start, i - start, Charsets.UTF_8), key)?.let(out::add) + start = i + 1 + } + var rest = String(bytes, start, bytes.size - start, Charsets.UTF_8) + if (rest.isNotBlank()) decode(rest, key)?.takeIf { it.contains("") }?.let { out += it; rest = "" } + pending.reset() + pending.write(rest.toByteArray(Charsets.UTF_8)) + return out + } + + private fun decode(frame: String, key: ByteArray?): String? { + val text = frame.trim() + if (text.isEmpty()) return null + if (text.startsWith("<")) return text + val k = key ?: return null + return runCatching { String(EaCrypto.ecbDecrypt(EaCrypto.unhex(text), k)) }.getOrNull() + } + + internal fun parse(xml: String): Message? = runCatching { + val parser = XmlPullParserFactory.newInstance().newPullParser() + parser.setInput(StringReader(xml)) + var recipient = "" + var id = "" + var name = "" + val attrs = HashMap() + val children = ArrayList>() + var depth = 0 + var child = "" + while (parser.eventType != XmlPullParser.END_DOCUMENT) { + when (parser.eventType) { + XmlPullParser.START_TAG -> { + depth++ + when (depth) { + 2 -> if (parser.name == "Request") { + recipient = parser.getAttributeValue(null, "recipient").orEmpty() + id = parser.getAttributeValue(null, "id").orEmpty() + } else return@runCatching null + 3 -> { + name = parser.name + for (i in 0 until parser.attributeCount) attrs[parser.getAttributeName(i)] = parser.getAttributeValue(i) + } + 4 -> child = parser.name + } + } + XmlPullParser.TEXT -> if (depth == 4) children += child to parser.text.trim() + XmlPullParser.END_TAG -> depth-- + } + parser.next() + } + if (name.isEmpty()) null else Message(recipient, id, name, attrs, children) + }.getOrNull() + + private fun esc(s: String) = s.replace("&", "&").replace("<", "<").replace(">", ">").replace("\"", """) + + private fun tag(name: String, vararg attrs: Pair, body: String? = null): String { + val a = attrs.filter { it.second != null }.joinToString("") { " ${it.first}=\"${esc(it.second.toString())}\"" } + return if (body == null) "<$name$a/>" else "<$name$a>$body" + } + + private fun now() = LocalDateTime.now(ZoneOffset.UTC).format(DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss")) + + private fun answer(session: Session, m: Message): String? { + val g = game + val who = account + val person = who?.takeIf { session.trusted } + val locale = g?.locale ?: "en_US" + return when (m.name) { + "ChallengeResponse" -> { + val answer = EaCrypto.challengeAnswer(m.attrs["key"].orEmpty()) + val version = m.attrs["version"].orEmpty() + val seed = EaCrypto.challengeSeed(version, answer) ?: 0 + val content = m.children.firstOrNull { it.first == "ContentId" }?.second.orEmpty() + session.claimed = g != null && content.isNotEmpty() && (content == g.contentId || content == g.offerId || content in g.contentIds) + val matches = session.mayTrust + promote(session, matches) + note("challenge version '$version' content '$content' ${when { session.trusted -> "matches the prepared game"; matches -> "matches, but another session holds this launch"; !session.verified && !session.unverifiable -> "comes from an unverified peer"; else -> "does not match the prepared game" }}") + session.pending = EaCrypto.lsxKey(seed) + Log.i(TAG, "game connected: ${m.children.firstOrNull { it.first == "Title" }?.second.orEmpty()}") + tag("ChallengeAccepted", "response" to answer) + } + "GetConfig" -> tag("GetConfigResponse", body = SERVICES.joinToString("") { tag("Service", "Name" to it.first, "Facility" to it.second) }) + "GetProfile" -> tag( + "GetProfileResponse", + "Persona" to person?.persona.orEmpty(), "SubscriberLevel" to 0, "CommerceCurrency" to "USD", "IsTrialSubscriber" to false, + "Country" to "US", "UserId" to person?.userId.orEmpty(), "GeoCountry" to "US", "AvatarId" to "", "IsSubscriber" to false, + "IsSteamSubscriber" to false, "PersonaId" to person?.personaId.orEmpty(), "IsUnderAge" to false, "UserIndex" to 0, + ) + "GetSetting" -> tag("GetSettingResponse", "Setting" to when (m.attrs["SettingId"]) { + "ENVIRONMENT" -> "production" + "LANGUAGE" -> locale + else -> "false" + }) + "GetGameInfo" -> tag("GetGameInfoResponse", "GameInfo" to when (m.attrs["GameInfoId"]) { + "FREETRIAL" -> "false" + "LANGUAGES" -> LANGUAGES + "INSTALLED_LANGUAGE" -> locale + "INSTALLED_VERSION", "AVAILABLE_VERSION" -> g?.version.orEmpty() + else -> "" + }) + "GetAllGameInfo" -> tag( + "GetAllGameInfoResponse", + "FullGamePurchased" to true, "FullGameReleased" to true, "InstalledVersion" to (g?.version ?: "0"), "MaxGroupSize" to 16, + "Languages" to LANGUAGES, "Expiration" to "0000-00-00T00:00:00", "UpToDate" to true, "HasExpiration" to false, + "EntitlementSource" to "EA", "AvailableVersion" to (g?.version ?: "0"), "DisplayName" to g?.title.orEmpty(), + "FreeTrial" to false, "InstalledLanguage" to locale, "FullGameReleaseDate" to "2000-01-01T00:00:00", "SystemTime" to now(), + ) + "GetInternetConnectedState" -> tag("InternetConnectedState", "connected" to 1) + "IsProgressiveInstallationAvailable" -> tag("IsProgressiveInstallationAvailableResponse", "ItemId" to m.attrs["ItemId"].orEmpty(), "Available" to false) + "AreChunksInstalled" -> tag( + "AreChunksInstalledResponse", "ItemId" to m.attrs["ItemId"].orEmpty(), "Installed" to true, + body = m.children.joinToString("") { tag(it.first, body = esc(it.second)) }, + ) + "GetAuthCode" -> tag("AuthCode", "value" to (who?.takeIf { session.trusted }?.authCode(m.attrs["ClientId"].orEmpty(), m.attrs["Scope"])?.takeIf { session.trusted } ?: "invalid")) + "GetAuthToken" -> tag("AuthToken", "value" to if (!session.trusted) "" else (g?.validToken ?: who?.token().orEmpty())) + "RequestLicense" -> { + val token = who?.takeIf { session.trusted }?.license(g?.contentId.orEmpty(), m.attrs["RequestTicket"].orEmpty(), m.attrs["TicketEngine"].orEmpty())?.takeIf { session.trusted }.orEmpty() + tag("RequestLicenseResponse", "License" to token) + } + "QueryEntitlements" -> { + val group = m.attrs["Group"].orEmpty() + val rows = who?.takeIf { session.trusted }?.entitlements(group).orEmpty() + tag("QueryEntitlementsResponse", body = rows.joinToString("") { e -> + tag( + "Entitlement", + "LastModifiedDate" to "0000-00-00T00:00:00", "EntitlementId" to e["id"], "UseCount" to (e["useCount"] ?: "0"), + "Version" to (e["version"] ?: "0"), "ItemId" to e["productId"], "ResourceId" to "", "GrantDate" to e["grantDate"], + "Group" to group, "EntitlementTag" to e["entitlementTag"], "Type" to e["entitlementType"], + "Expiration" to (e["terminationDate"]?.takeIf { it.isNotEmpty() && it != "null" } ?: "0000-00-00T00:00:00"), "Source" to "", + ) + }) + } + "GetPresence" -> tag("GetPresenceResponse", "UserId" to person?.userId.orEmpty(), "Presence" to "INGAME") + "QueryPresence" -> tag("QueryPresenceResponse", body = "") + "QueryFriends" -> tag("QueryFriendsResponse", body = "") + "GetBlockList" -> tag("GetBlockListResponse", "Return" to "Success", body = "") + "QueryOffers" -> tag("QueryOffersResponse", body = "") + "QueryImage" -> tag("QueryImageResponse", "Result" to 0, body = "") + "GetVoipStatus" -> tag("GetVoipStatusResponse", "Available" to false, "Active" to false) + "ShowIGOWindow", "SetDownloaderUtilization" -> null + else -> tag("ErrorSuccess", "Code" to 0, "Description" to "") + } + } + + private class AppAccount(private val app: Context) : Account { + private val saved get() = EaAuth.load(app) + override val userId: String get() = saved?.userId.orEmpty() + override val personaId: String get() = saved?.personaId.orEmpty() + override val persona: String get() = saved?.eaId?.ifEmpty { null } ?: saved?.displayName.orEmpty() + + override fun authCode(clientId: String, scope: String?): String? = + EaAuth.mint(app, clientId, "code", scopes = scope?.split(' ')?.filter { it.isNotBlank() }.orEmpty()) + + override fun license(contentId: String, requestTicket: String, ticketEngine: String): String? { + val g = game ?: return null + val hw = g.hardware ?: return null + val token = EaAuth.accessToken(app) ?: return null + return runCatching { + EaOoa.request(token, contentId, EaOoa.machineHash(hw, g.hashVersion), requestTicket.ifEmpty { null }, ticketEngine.ifEmpty { null }).gameToken + }.onFailure { Log.w(TAG, "licence: ${it.message}") }.getOrNull() + } + + override fun token(): String? = EaAuth.mint(app, EaAuth.CLIENT_ID, "token", EaAuth.OPAQUE_SCOPES, "OPAQUE", 14400) + + override fun entitlements(group: String): List> { + val token = EaAuth.accessToken(app) ?: return emptyList() + val arr = runCatching { EaApi.entitlements(token, group) }.getOrNull() ?: return emptyList() + return (0 until arr.length()).mapNotNull { arr.optJSONObject(it) }.map { o -> + o.keys().asSequence().associateWith { k -> o.optString(k) } + } + } + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/stores/ea/EaManifest.kt b/app/src/main/java/com/droiddeck/launcher/stores/ea/EaManifest.kt new file mode 100644 index 0000000000..8c98311c0c --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/stores/ea/EaManifest.kt @@ -0,0 +1,134 @@ +package com.droiddeck.launcher.stores.ea + +import org.xmlpull.v1.XmlPullParser +import org.xmlpull.v1.XmlPullParserFactory +import java.io.File +import java.io.StringReader + +/** What `__Installer/installerdata.xml` in an EA build says about running and finishing the install. */ +class EaManifest( + val version: String, + val launchers: List, + val touchupPath: String, + val touchupParameters: String, + val contentIds: List = emptyList(), + val titles: Map = emptyMap(), +) { + fun title(locale: String): String? = titles[locale] ?: titles["en_US"] ?: titles.values.firstOrNull() + + class Launcher(val path: String, val parameters: String, val trial: Boolean) + + fun launcher(): Launcher? = launchers.firstOrNull { !it.trial } ?: launchers.firstOrNull() + + companion object { + const val RELATIVE = "__Installer/installerdata.xml" + + fun decode(bytes: ByteArray): String { + val utf16 = bytes.size >= 2 && ((bytes[0] == 0xFF.toByte() && bytes[1] == 0xFE.toByte()) || (bytes[0] == 0xFE.toByte() && bytes[1] == 0xFF.toByte())) + val text = if (utf16) String(bytes, Charsets.UTF_16) else String(bytes, Charsets.UTF_8) + return text.trimStart('๏ปฟ') + } + + fun read(folder: File): EaManifest? { + val file = File(folder, RELATIVE).takeIf { it.isFile } ?: EaPaths.find(folder, RELATIVE) ?: return null + return runCatching { parse(decode(file.readBytes())) }.getOrNull() + } + + fun parse(xml: String): EaManifest { + val parser = XmlPullParserFactory.newInstance().newPullParser() + parser.setInput(StringReader(xml.replace(Regex("^<\\?xml[^>]*\\?>"), ""))) + val stack = ArrayList() + var version = "" + val launchers = ArrayList() + var touchupPath = "" + var touchupParams = "" + var path = "" + var params = "" + var trial = false + val contentIds = ArrayList() + val titles = LinkedHashMap() + var locale = "" + while (parser.eventType != XmlPullParser.END_DOCUMENT) { + when (parser.eventType) { + XmlPullParser.START_TAG -> { + val name = parser.name + stack += name + if (name.equals("gameVersion", true)) { + version = parser.getAttributeValue(null, "version") ?: version + } + if (name.equals("launcher", true)) { path = ""; params = ""; trial = false } + if (name.equals("localeInfo", true)) locale = parser.getAttributeValue(null, "locale").orEmpty() + } + XmlPullParser.TEXT -> { + val text = parser.text.trim() + val tag = stack.lastOrNull().orEmpty() + val parent = stack.getOrNull(stack.size - 2).orEmpty() + if (text.isNotEmpty()) when { + parent.equals("launcher", true) && tag.equals("filePath", true) -> path = text + parent.equals("launcher", true) && tag.equals("parameters", true) -> params = text + parent.equals("launcher", true) && tag.equals("trial", true) -> trial = text.equals("true", true) || text == "1" + (parent.equals("touchup", true) || parent.equals("executable", true)) && tag.equals("filePath", true) -> touchupPath = text + (parent.equals("touchup", true) || parent.equals("executable", true)) && tag.equals("parameters", true) -> touchupParams = text + parent.equals("contentIDs", true) && tag.equals("contentID", true) -> contentIds += text + parent.equals("localeInfo", true) && tag.equals("title", true) && locale.isNotEmpty() -> titles[locale] = text + } + } + XmlPullParser.END_TAG -> { + if (parser.name.equals("launcher", true) && path.isNotEmpty()) launchers += Launcher(path, params, trial) + stack.removeLastOrNull() + } + } + parser.next() + } + return EaManifest(version, launchers, touchupPath, touchupParams, contentIds, titles) + } + } +} + +object EaPaths { + private val KEY = Regex("^\\[([^\\]]+)\\](.*)$") + + /** `[HKEY_LOCAL_MACHINE\SOFTWARE\Publisher\Game\Install Dir]bin\game.exe` splits into the registry key, value and relative path. */ + class Registered(val key: String, val value: String, val rest: String) + + fun registered(path: String): Registered? { + val m = KEY.find(path.trim()) ?: return null + val full = m.groupValues[1] + val cut = full.lastIndexOf('\\').takeIf { it > 0 } ?: return null + return Registered(full.substring(0, cut), full.substring(cut + 1), m.groupValues[2]) + } + + fun relative(path: String): String { + val rest = registered(path)?.rest ?: path.replace("{installLocation}", "", ignoreCase = true) + return rest.replace('\\', '/').trimStart('/').split('/').filter { it.isNotEmpty() && it != "." }.joinToString("/") + } + + /** The real file for a path the manifest may spell in a different case. */ + fun find(folder: File, relative: String): File? { + var cur = folder + for (part in relative.replace('\\', '/').split('/').filter { it.isNotEmpty() }) { + val names = cur.listFiles() ?: return null + cur = names.firstOrNull { it.name == part } ?: names.firstOrNull { it.name.equals(part, true) } ?: return null + } + return cur.takeIf { it.exists() && it != folder } + } + + fun relativeOnDisk(folder: File, relative: String): String? = + find(folder, relative)?.relativeTo(folder)?.path?.replace(File.separatorChar, '/') + + fun splitArgs(text: String): List { + val out = ArrayList() + val cur = StringBuilder() + var quoted = false + var any = false + for (c in text) { + when { + c == '"' -> { quoted = !quoted; any = true } + c.isWhitespace() && !quoted -> { if (any || cur.isNotEmpty()) out += cur.toString(); cur.clear(); any = false } + else -> cur.append(c) + } + } + if (any || cur.isNotEmpty()) out += cur.toString() + return out + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/stores/ea/EaNative.kt b/app/src/main/java/com/droiddeck/launcher/stores/ea/EaNative.kt new file mode 100644 index 0000000000..b8a4b60052 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/stores/ea/EaNative.kt @@ -0,0 +1,57 @@ +package com.droiddeck.launcher.stores.ea + +import android.util.Log +import com.droiddeck.launcher.stores.StoresNative +import com.droiddeck.launcher.stores.amazon.AmazonNative +import org.json.JSONObject +import java.util.concurrent.CountDownLatch +import java.util.concurrent.TimeUnit +import java.util.concurrent.atomic.AtomicBoolean + +object EaNative { + private const val TAG = "EaNative" + const val ENGINE_MISSING = "EA: the store engine is not available" + + fun ready(): Boolean = StoresNative.ensureLoaded() + + fun call(op: String, request: JSONObject): JSONObject? { + if (!ready()) return null + val text = try { nativeCall(op, request.toString()) } catch (t: Throwable) { + Log.w(TAG, "$op: ${t.javaClass.simpleName}") + null + } ?: return null + return runCatching { JSONObject(text) }.getOrNull() + } + + fun install(request: JSONObject, events: AmazonNative.InstallListener, cancelled: AtomicBoolean): AmazonNative.InstallOutcome { + if (!ready()) return AmazonNative.InstallOutcome(false, false, ENGINE_MISSING, null) + val done = CountDownLatch(1) + val holder = arrayOfNulls(1) + val bridge = object : AmazonNative.InstallListener by events { + override fun onComplete(success: Boolean, cancelled: Boolean, error: String, result: String) { + holder[0] = AmazonNative.InstallOutcome(success, cancelled, error, result.takeIf { it.isNotEmpty() }?.let { runCatching { JSONObject(it) }.getOrNull() }) + done.countDown() + } + } + val handle = try { nativeInstall(request.toString(), bridge) } catch (t: Throwable) { + return AmazonNative.InstallOutcome(false, false, "The EA install could not start: ${t.javaClass.simpleName}", null) + } + if (handle == 0L) return holder[0] ?: AmazonNative.InstallOutcome(false, false, "The EA install could not start", null) + try { + var forwarded = false + while (true) { + val finished = try { done.await(250, TimeUnit.MILLISECONDS) } catch (e: InterruptedException) { cancelled.set(true); false } + if (finished) break + if (!forwarded && cancelled.get()) { nativeCancel(handle); forwarded = true } + } + } finally { + nativeRelease(handle) + } + return holder[0] ?: AmazonNative.InstallOutcome(false, false, "The EA install ended without a result", null) + } + + @JvmStatic private external fun nativeCall(op: String, request: String): String? + @JvmStatic private external fun nativeInstall(request: String, listener: AmazonNative.InstallListener): Long + @JvmStatic private external fun nativeCancel(handle: Long) + @JvmStatic private external fun nativeRelease(handle: Long) +} diff --git a/app/src/main/java/com/droiddeck/launcher/stores/ea/EaOoa.kt b/app/src/main/java/com/droiddeck/launcher/stores/ea/EaOoa.kt new file mode 100644 index 0000000000..5be0d03931 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/stores/ea/EaOoa.kt @@ -0,0 +1,212 @@ +package com.droiddeck.launcher.stores.ea + +import org.json.JSONObject +import org.xmlpull.v1.XmlPullParser +import org.xmlpull.v1.XmlPullParserFactory +import java.io.File +import java.io.StringReader +import java.net.URLEncoder +import java.security.SecureRandom + +/** Origin Online Activation: the per-machine licence an EA game's activation layer checks before it runs. */ +object EaOoa { + private const val LICENSES = "https://proxy.novafusion.ea.com/licenses" + const val LICENSE_DIR = "ProgramData/Electronic Arts/EA Services/License" + private const val SIGNATURE_SLOT = 65 + + /** + * What the game sees of the machine inside its Wine prefix: firmware and OS values from Wine's + * WMI, CPU values from CPUID executed as x86 code, since an emulated game sees the emulator's + * CPUID rather than the host CPU WMI describes. + */ + class Hardware( + val boardManufacturer: String, + val boardSerial: String, + val biosManufacturer: String, + val biosSerial: String, + val osInstallDate: String, + val osSerial: String, + val volumeSerial: String, + val gpuPnpId: String, + val cpuVendor: String, + val cpuEdx: String, + val cpuEax: String, + val cpuEcx: String, + val brand: String, + val hostname: String, + ) { + /** Whether the probe reported everything the hash of this activation version is built from. */ + fun complete(version: Int): Boolean { + val needed = arrayListOf(boardManufacturer, biosManufacturer) + when { + version <= 1 -> needed += listOf(hostname, osInstallDate, osSerial) + version == 2 -> needed += listOf(osInstallDate, osSerial, volumeSerial, cpuVendor, cpuEdx, cpuEcx) + version == 3 -> needed += listOf(volumeSerial, cpuVendor, cpuEdx, cpuEcx) + else -> needed += listOf(volumeSerial, cpuVendor, cpuEdx, cpuEax) + } + return needed.all { it.isNotEmpty() } + } + + companion object { + fun fromJson(o: JSONObject): Hardware { + fun s(k: String) = o.optString(k).trim() + return Hardware( + boardManufacturer = s("boardManufacturer"), + boardSerial = s("boardSerial").ifEmpty { "None" }, + biosManufacturer = s("biosManufacturer"), + biosSerial = s("biosSerial").ifEmpty { "None" }, + osInstallDate = s("osInstallDate"), + osSerial = s("osSerial"), + volumeSerial = s("volumeSerial").replace("-", "").lowercase().let { if (it.isEmpty()) it else it.padStart(8, '0') }, + gpuPnpId = s("gpuPnpId").ifEmpty { "None" }, + cpuVendor = s("cpuVendor"), + cpuEdx = s("cpuEdx").uppercase(), + cpuEax = s("cpuEax").uppercase(), + cpuEcx = s("cpuEcx").lowercase(), + brand = o.optString("cpuBrand"), + hostname = s("hostname"), + ) + } + } + } + + fun machineHash(hw: Hardware, version: Int): String { + val edxEax = hw.cpuEdx + hw.cpuEax + val edx = hw.cpuEdx.lowercase() + val shortGpu = hw.gpuPnpId.substringBeforeLast('\\', hw.gpuPnpId) + val parts = arrayListOf(hw.boardManufacturer, hw.boardSerial) + when { + version <= 1 -> parts += listOf(hw.hostname, hw.biosManufacturer, hw.biosSerial, hw.osInstallDate, hw.osSerial) + version == 2 -> parts += listOf(hw.biosManufacturer, hw.biosSerial, hw.osInstallDate, hw.osSerial, hw.volumeSerial, shortGpu, hw.cpuVendor, edx, hw.cpuEcx) + version == 3 -> parts += listOf(hw.biosManufacturer, hw.biosSerial, hw.volumeSerial, shortGpu, hw.cpuVendor, edx, hw.cpuEcx) + else -> parts += listOf(hw.biosManufacturer, hw.biosSerial, hw.volumeSerial, hw.gpuPnpId, hw.cpuVendor, edxEax) + } + val text = StringBuilder(parts.joinToString(";")).append(';') + if (version >= 2) text.append(hw.brand.take(47).padEnd(47, '\u0000')).append(';') + val digest = EaCrypto.sha1(text.toString().toByteArray(Charsets.ISO_8859_1)) + return if (version < 4) digest.joinToString("") { Integer.toHexString(it.toInt() and 0xFF) } else EaCrypto.hex(digest) + } + + /** Version of the game's activation layer, which decides how the machine hash is built. */ + fun activationVersion(core: File): Int { + val dll = listOf("activation.dll", "awc.dll").firstNotNullOfOrNull { EaPaths.find(core, it) } ?: return 1 + val (major, minor, patch) = productVersion(dll.readBytes()) ?: return 1 + return when { + major >= 5 -> 4 + major == 4 && (minor > 7 || (minor == 7 && patch >= 6)) -> 3 + major == 4 && minor == 7 -> 2 + major == 4 -> 1 + else -> 0 + } + } + + /** The activation layer's folder: `Core` beside the game's exe, where EA ships it, or at the game root. */ + fun coreDir(game: File, exe: String): File? { + val exeDir = exe.replace('\\', '/').substringBeforeLast('/', "") + val candidates = listOfNotNull(exeDir.takeIf { it.isNotEmpty() }?.let { "$it/Core" }, "Core") + return candidates.firstNotNullOfOrNull { EaPaths.find(game, it)?.takeIf { f -> f.isDirectory } } + } + + /** Games built on the 2012-era EA Core client, which want an opaque token rather than a JWS one. */ + fun legacyCore(core: File?): Boolean = core != null && EaPaths.find(core, "EACore.dll") != null + + private fun encodedSignature(core: File): Boolean = EaPaths.find(core, "activation.exe") != null + + internal fun productVersion(pe: ByteArray): Triple? { + val magic = byteArrayOf(0xBD.toByte(), 0x04, 0xEF.toByte(), 0xFE.toByte()) + var i = 0 + while (i + 24 <= pe.size) { + if (pe[i] == magic[0] && pe[i + 1] == magic[1] && pe[i + 2] == magic[2] && pe[i + 3] == magic[3]) { + fun u32(at: Int) = (pe[at].toLong() and 0xFF) or ((pe[at + 1].toLong() and 0xFF) shl 8) or ((pe[at + 2].toLong() and 0xFF) shl 16) or ((pe[at + 3].toLong() and 0xFF) shl 24) + val ms = u32(i + 16) + val ls = u32(i + 20) + return Triple((ms ushr 16).toInt(), (ms and 0xFFFF).toInt(), (ls ushr 16).toInt()) + } + i++ + } + return null + } + + class License(val fields: LinkedHashMap, val namespace: String, val signature: String) { + val gameToken: String? get() = fields["GameToken"]?.takeIf { it.isNotEmpty() } + val contentId: String get() = fields["ContentId"].orEmpty() + } + + internal fun parseLicense(xml: String, signature: String): License { + val parser = XmlPullParserFactory.newInstance().apply { isNamespaceAware = false }.newPullParser() + parser.setInput(StringReader(xml.replace(Regex("^<\\?xml[^>]*\\?>"), "").trim())) + val fields = LinkedHashMap() + var ns = "" + var depth = 0 + var tag = "" + while (parser.eventType != XmlPullParser.END_DOCUMENT) { + when (parser.eventType) { + XmlPullParser.START_TAG -> { + depth++ + if (depth == 1) ns = parser.getAttributeValue(null, "xmlns").orEmpty() else tag = parser.name + if (depth == 2) fields[tag] = "" + } + XmlPullParser.TEXT -> if (depth == 2) fields[tag] = fields[tag].orEmpty() + parser.text + XmlPullParser.END_TAG -> depth-- + } + parser.next() + } + return License(fields, ns, signature) + } + + private fun esc(s: String) = s.replace("&", "&").replace("<", "<").replace(">", ">").replace("\"", """) + + fun licenseXml(l: License): String { + val order = listOf("CipherKey", "MachineHash", "ContentId", "UserId", "GameToken", "GrantTime", "StartTime", "Nonce") + val body = StringBuilder("") + body.append("") + for (k in order) { + val v = l.fields[k] ?: continue + if (k == "GameToken" && v.isEmpty()) continue + body.append('<').append(k).append('>').append(esc(v)).append("') + } + return body.append("").toString() + } + + fun licenseBlob(l: License, encoded: Boolean): ByteArray { + val signature = if (encoded) l.signature.toByteArray() else java.util.Base64.getDecoder().decode(l.signature) + val head = ByteArray(SIGNATURE_SLOT) + System.arraycopy(signature, 0, head, 0, signature.size.coerceAtMost(SIGNATURE_SLOT)) + return head + EaCrypto.licenseEncrypt(licenseXml(l).toByteArray()) + } + + private const val AUTH_ATTEMPTS = 4 + + internal fun tokenRejected(body: String) = + body.contains("cause=\"AUTHENTICATION_FAILED\"") && body.contains("field=\"ea_eadmtoken\"") + + internal fun retryTokenRejected(request: () -> EaReply): EaReply { + var reply = request() + var attempt = 1 + while (!reply.ok && attempt < AUTH_ATTEMPTS && tokenRejected(reply.text)) { + attempt++ + reply = request() + } + return reply + } + + fun request(token: String, contentId: String, machineHash: String, requestToken: String? = null, requestType: String? = null): License { + val nonce = EaCrypto.hex(ByteArray(4).also(SecureRandom()::nextBytes)) + val params = mutableListOf("contentId" to contentId, "machineHash" to machineHash, "nonce" to nonce, "ea_eadmtoken" to token) + if (requestToken != null) params += "requestToken" to requestToken + if (requestType != null) params += "requestType" to requestType + val url = LICENSES + "?" + params.joinToString("&") { (k, v) -> k + "=" + URLEncoder.encode(v, "UTF-8") } + val headers = mapOf("X-Requester-Id" to "Origin Online Activation", "User-Agent" to "EACTransaction") + val reply = retryTokenRejected { EaHttp.request(url, headers = headers) } + if (!reply.ok) throw IllegalStateException("EA refused the licence (${reply.status}): ${reply.text.replace(Regex("(eadmToken value=\")[^\"]*"), "$1\"").take(600)}") + val signature = reply.header("x-signature") ?: throw IllegalStateException("EA's licence had no signature") + return parseLicense(String(EaCrypto.licenseDecrypt(reply.body), Charsets.UTF_8), signature) + } + + /** Licence files for a game about to start, named as the activation layer looks for them. */ + fun files(core: File, license: License): List> { + val blob = licenseBlob(license, encodedSignature(core)) + val id = license.contentId + return listOf("$LICENSE_DIR/$id.dlf" to blob, "$LICENSE_DIR/${id}_cached.dlf" to blob) + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/stores/ea/EaStore.kt b/app/src/main/java/com/droiddeck/launcher/stores/ea/EaStore.kt new file mode 100644 index 0000000000..b585dfec98 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/stores/ea/EaStore.kt @@ -0,0 +1,120 @@ +package com.droiddeck.launcher.stores.ea + +import android.content.Context +import com.droiddeck.launcher.stores.CatalogItem +import com.droiddeck.launcher.stores.Store +import com.droiddeck.launcher.stores.StoreFront +import com.droiddeck.launcher.stores.StoreNet +import com.droiddeck.launcher.stores.StoreShelves +import com.droiddeck.launcher.stores.cleanStoreText +import org.json.JSONObject +import java.time.Instant +import java.util.concurrent.Executors +import java.util.concurrent.TimeUnit + +/** EA's PC catalog, read from the game pages ea.com renders for the EA app's games. */ +object EaStore { + private const val SITE = "https://www.ea.com" + private const val CATALOG = "$SITE/games/library/pc-download" + private const val PAGE_SIZE = 12 + private const val MAX_PAGES = 20 + private const val SHELF = 24 + private val NEXT_DATA = Regex("""""", RegexOption.DOT_MATCHES_ALL) + + private var front: StoreFront? = null + + private fun front(context: Context): StoreFront = synchronized(this) { + front ?: StoreFront(Store.EA, { EaPrefs.get(context) }, { fetchAll().let { StoreFront.Catalog(shelves(it), it) } }, key = "store_front_catalog").also { front = it } + } + + fun cached(context: Context): StoreShelves? = front(context).cached() + + fun featured(context: Context, force: Boolean): StoreShelves? = front(context).shelves(force) + + fun search(context: Context, query: String): List { + val q = StoreFront.titleKey(query) + if (q.length < 2) return emptyList() + return front(context).everything().filter { StoreFront.titleKey(it.title).contains(q) } + } + + /** Whether a store card and a library entry are the same game. */ + fun sameGame(shelf: CatalogItem, owned: CatalogItem): Boolean { + val slug = shelf.extra["slug"].orEmpty() + if (slug.isNotEmpty() && slug == owned.extra["slug"]) return true + val shelfKey = StoreFront.titleKey(shelf.title).ifEmpty { return false } + return listOf(owned.title, owned.extra["productName"].orEmpty()).any { StoreFront.titleKey(it) == shelfKey } + } + + /** + * The device's currency. ea.com's pages are cached with whichever region asked first, so one page can carry + * roubles and the next dollars; a price in another currency is left off rather than shown wrong. + */ + private fun localCurrency(): String = + runCatching { java.util.Currency.getInstance(java.util.Locale.getDefault()).currencyCode }.getOrNull() ?: "USD" + + internal fun parsePage(html: String, currency: String = localCurrency()): Pair, Int> { + val data = NEXT_DATA.find(html)?.groupValues?.get(1) ?: return emptyList() to 0 + val props = JSONObject(data).optJSONObject("props")?.optJSONObject("pageProps") ?: return emptyList() to 0 + val games = props.optJSONArray("games") ?: return emptyList() to 0 + val items = (0 until games.length()).mapNotNull { games.optJSONObject(it) }.mapNotNull { item(it, currency) } + return items to props.optInt("totalItems", items.size) + } + + internal fun item(g: JSONObject, currency: String): CatalogItem? { + fun s(o: JSONObject?, k: String) = o?.optString(k)?.takeIf { it.isNotBlank() && it != "null" } + val slug = s(g, "slug") ?: return null + val title = s(g, "title")?.replace("\n", " ")?.trim() ?: return null + val art = g.optJSONObject("packArt") + val price = g.optJSONObject("price") + val total = s(price, "displayTotal").orEmpty() + val now = s(price, "displayTotalWithDiscount") ?: total + val discount = price?.optInt("discountPercentage") ?: 0 + val free = g.optBoolean("isFreeToPlay") || now.filter { it.isDigit() }.trimStart('0').isEmpty() && now.isNotEmpty() + val shown = !free && s(price, "currency").equals(currency, true) + val genres = g.optJSONArray("genres") + val franchise = s(g, "franchiseSlug") + return CatalogItem( + store = Store.EA, id = "ea-store:$slug", title = title, + imageUrl = s(art, "ar16X9") ?: s(art, "ar2X1"), tallImageUrl = s(art, "ar2X3") ?: s(art, "ar3X4"), + tags = (0 until (genres?.length() ?: 0)).mapNotNull { genres!!.optJSONObject(it)?.optString("name")?.takeIf(String::isNotBlank) }.take(3).joinToString(", "), + isFree = free, hasPrice = shown, finalPrice = if (shown) now else "", + originalPrice = if (shown && discount > 0) total else "", discountPercent = discount.coerceAtLeast(0), + storeUrl = if (franchise != null) "$SITE/games/$franchise/$slug" else "$SITE/games/$slug", + publisher = "Electronic Arts", releaseDate = s(g, "releaseDate")?.take(10).orEmpty(), + description = cleanStoreText(s(g, "shortDescription")), + extra = buildMap { put("slug", slug); s(g, "tier")?.let { put("tier", it) } }, + ) + } + + private fun page(n: Int): Pair, Int>? = + StoreNet.get(if (n == 1) CATALOG else "$CATALOG?page=$n", headers = mapOf("Accept" to "text/html"))?.let(::parsePage) + + /** Every page of the catalog; a page that fails fails the whole refresh, so a partial list never replaces a good one. */ + private fun fetchAll(): List { + val (first, total) = page(1) ?: throw java.io.IOException("ea.com catalog page 1 failed") + val pages = ((total + PAGE_SIZE - 1) / PAGE_SIZE).coerceIn(1, MAX_PAGES) + val rest = java.util.concurrent.ConcurrentHashMap>() + val pool = Executors.newFixedThreadPool(4) + try { + for (n in 2..pages) pool.execute { page(n)?.first?.let { rest[n] = it } } + } finally { + pool.shutdown() + if (!pool.awaitTermination(1, TimeUnit.MINUTES)) pool.shutdownNow() + } + (2..pages).firstOrNull { !rest.containsKey(it) }?.let { throw java.io.IOException("ea.com catalog page $it failed") } + return (first + (2..pages).flatMap { rest.getValue(it) }).distinctBy { it.id } + } + + internal fun shelves(all: List, now: Instant = Instant.now()): StoreShelves { + val today = now.toString().take(10) + val released = all.filter { it.releaseDate.isNotEmpty() && it.releaseDate <= today } + val headline = released.filter { it.extra["tier"] == "Tier1" || it.extra["tier"] == "Tier2" } + return StoreShelves( + whatsNew = released.sortedByDescending { it.releaseDate }.take(SHELF), + deals = released.filter { it.discountPercent > 0 }.sortedByDescending { it.discountPercent }.take(SHELF), + free = released.filter { it.isFree }.take(SHELF), + trending = (headline + released).distinctBy { it.id }.take(SHELF), + art = all.mapNotNull { it.imageUrl }.take(SHELF), + ) + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/stores/epic/EpicClientInstaller.kt b/app/src/main/java/com/droiddeck/launcher/stores/epic/EpicClientInstaller.kt index 12116732cf..d620388c82 100644 --- a/app/src/main/java/com/droiddeck/launcher/stores/epic/EpicClientInstaller.kt +++ b/app/src/main/java/com/droiddeck/launcher/stores/epic/EpicClientInstaller.kt @@ -21,19 +21,61 @@ import java.security.MessageDigest import java.util.concurrent.atomic.AtomicBoolean internal object EpicClientSources { - const val LAUNCHER_URL = "https://launcher-public-service-prod06.ol.epicgames.com/launcher/api/installer/download/EpicGamesLauncher-x86_64.AppImage" - const val LAUNCHER_FILE = "EpicGamesLauncher-x86_64.AppImage" + const val LAUNCHER_URL = "https://launcher-public-service-prod06.ol.epicgames.com/launcher/api/installer/download/EpicGamesLauncher-x86_64.deb" + const val LAUNCHER_FILE = "EpicGamesLauncher-x86_64.deb" const val RUNTIME_BASE = "https://repo.steampowered.com/steamrt4/images/" const val RUNTIME_FILE = "com.valvesoftware.SteamRuntime.Platform-amd64,i386-steamrt4-runtime.tar.gz" const val GLES_URL = "https://deb.debian.org/debian/pool/main/libg/libglvnd/libgles2_1.7.0-1+b2_amd64.deb" const val GLES_FILE = "libgles2_1.7.0-1+b2_amd64.deb" const val GLES_SHA256 = "e12c18aa77939d122ee1dea520ba0440b97dc19200b7396e03dff03a3ece74c1" + const val DEBIAN = "https://deb.debian.org/debian/" + const val SNAPSHOT = "https://snapshot.debian.org/archive/debian/20261101T000000Z/" const val USER_AGENT = "DroidDeck" private val VERSION = Regex("[A-Za-z0-9._+-]{1,64}") private val SUM = Regex("^([0-9a-fA-F]{64})\\s+\\*?(.+)$") class Source(val url: String, val version: String, val sha256: String? = null) + class Package(val path: String, val sha256: String, val size: Long) { + val file: String get() = path.substringAfterLast('/') + val urls: List get() = listOf(DEBIAN + path, SNAPSHOT + path) + } + + val DESKTOP = listOf( + Package("pool/main/a/abseil/libabsl20240722_20240722.0-4_amd64.deb", "78c6d7692890990a27cb1d5bbd95b7bfe47a4183ffafec5b30f689f9b58ec6f7", 491548L), + Package("pool/main/a/aom/libaom3_3.12.1-1+deb13u1_amd64.deb", "743eec7c94ae30295bc557ebac3dfae948e7390e89a2743c585d56297e9d312e", 1871712L), + Package("pool/main/a/aspell/libaspell15_0.60.8.1-4_amd64.deb", "8be22785198a4e5de1e2c3a157e8cd99ec7d5843c8ac96a174ec701ba4ac28e2", 337684L), + Package("pool/main/a/at-spi2-core/libatk-bridge2.0-0t64_2.56.2-1+deb13u2_amd64.deb", "c0fe87ea1bdca2f938eaa8286af5ad38ecd15cf18c6cfb5961d7d46ac3192325", 68516L), + Package("pool/main/a/at-spi2-core/libatspi2.0-0t64_2.56.2-1+deb13u2_amd64.deb", "65e9c9ecbd820fba2d04104cddd0bad33d256cbdfe0d1cb5365f10e363df2315", 81056L), + Package("pool/main/liba/libavif/libavif16_1.2.1-1.2_amd64.deb", "ba6c334454d3562560ad583fbe2c998e203b0fc5a0e0e91112ddcd3cff4704bb", 133120L), + Package("pool/main/libc/libcloudproviders/libcloudproviders0_0.3.6-2_amd64.deb", "a626bb23ed9ebc4bc3ce446b552048de63d76768bf0fb492754965c5ee28a7e4", 29232L), + Package("pool/main/c/colord/libcolord2_1.4.7-3_amd64.deb", "f11fd3b492781122edf0790f1e1fe24c51a41c67d4bb76cff84a9426c5654fa7", 139204L), + Package("pool/main/e/enchant-2/libenchant-2-2_2.8.2+dfsg1-3_amd64.deb", "83f208d89db1c48e6ede8a23e8ffa2bcddd4f99427bfd1279201247bbf27ca58", 56756L), + Package("pool/main/libe/libepoxy/libepoxy0_1.5.10-2_amd64.deb", "4c4c8024f2175086de65bca9fdc3fbb967f2863ebf249d489c66d0c8103dd3a3", 192728L), + Package("pool/main/libe/libevdev/libevdev2_1.13.4+dfsg-1_amd64.deb", "02e85fb9461b85b23f775d5fcf5a31c55d37bec40b63fd98ca5d3a2763714ae7", 32372L), + Package("pool/main/f/flite/libflite1_2.2-7_amd64.deb", "5945190970be7d4a1f71fb6f7e3e340ba2675e770605df0754051d617a6c5ee6", 12811404L), + Package("pool/main/libg/libgav1/libgav1-1_0.19.0-3+b1_amd64.deb", "94010041e59c7a8d2d3d1f5e62afd523f002b7b1caa3189419160b66d71c0195", 352956L), + Package("pool/main/g/gst-plugins-base1.0/libgstreamer-gl1.0-0_1.26.2-1+deb13u1_amd64.deb", "efacc61acbd44a6a067612e4592b9fe81efdc5011ed4c6cf7afd8ed83c5f834a", 269984L), + Package("pool/main/g/gst-plugins-base1.0/libgstreamer-plugins-base1.0-0_1.26.2-1+deb13u1_amd64.deb", "a20aedb3f89c162b4859cec37076f4eba54b0bcc7e5cb254a26cc4a877a88a1e", 997404L), + Package("pool/main/g/gstreamer1.0/libgstreamer1.0-0_1.26.2-2_amd64.deb", "08b463307fbde5496a346b1bb300b465cd22bd326f6f4634f482bf441af28a9b", 1421116L), + Package("pool/main/g/gtk+3.0/libgtk-3-0t64_3.24.49-3_amd64.deb", "4aa8828f01365f937f3bf69f812c8107ee4c8a2b208ffdd7656e8de5de81d98f", 2768812L), + Package("pool/main/h/hidapi/libhidapi-hidraw0_0.14.0-1+b2_amd64.deb", "89c546cb55be403ce63fe668baff2515979100a30fa07e2b97de186b9c07f01e", 12664L), + Package("pool/main/h/hunspell/libhunspell-1.7-0_1.7.2+really1.7.2-10+b4_amd64.deb", "a9427e5220e71f8c04c6c0f87826c6fef98e2bab6994a87d6d82e8a120790ecf", 236980L), + Package("pool/main/h/highway/libhwy1t64_1.2.0-2+b2_amd64.deb", "540c4ff28255fbfa89468061b722dfc2b773b0c1ecf163a063202482dea5b119", 676044L), + Package("pool/main/h/hyphen/libhyphen0_2.8.8-7+b2_amd64.deb", "fa9dca7b8cf1381fd52800c44a385c5725a78a88bd705f7c39b1046a5293435e", 30664L), + Package("pool/main/w/webkit2gtk/libjavascriptcoregtk-4.1-0_2.52.6-1~deb13u1_amd64.deb", "3383ebb3e13f31225c65f41112420be58493a3de112b5993cf5c417cfedc47c8", 7511632L), + Package("pool/main/j/jpeg-xl/libjxl0.11_0.11.2-0.1~deb13u2_amd64.deb", "cd1ca3a52cb0d8fdce1d994bcbf0663de28c64add1cfe8096639ae8fa9808824", 1133312L), + Package("pool/main/l/lcms2/liblcms2-2_2.16-2+deb13u2_amd64.deb", "32e53c2002ccea8c60c02779bea0ba49ac132fef702988a30d64af79b6617806", 160264L), + Package("pool/main/libm/libmanette/libmanette-0.2-0_0.2.12-1_amd64.deb", "98841a467692c46fd1870275113235691ebbfe71a3524f6b2a0fa7e9c33c6e56", 43752L), + Package("pool/main/o/orc/liborc-0.4-0t64_0.4.41-1_amd64.deb", "5b9afe78be0dd71399c0d4d7e5f26beb6ddf207279997942d8280be1b20bd58c", 189604L), + Package("pool/main/r/rust-rav1e/librav1e0.7_0.7.1-9+b2_amd64.deb", "d5b1373a8d6905ee4523faf1db7a626dc660e03836ec91b616e57ba386f47eb6", 946396L), + Package("pool/main/libs/libsecret/libsecret-1-0_0.21.7-1_amd64.deb", "949c5428cd3427486ac6c4dfc6d9400ce786c504c02334acc903c873aa52d14f", 111224L), + Package("pool/main/s/svt-av1/libsvtav1enc2_2.3.0+dfsg-1_amd64.deb", "cdaf961c3cc4fe78a19ff18c17d83d813f78a378fdcc4c86ccbb9b54e84ae599", 2489492L), + Package("pool/main/w/webkit2gtk/libwebkit2gtk-4.1-0_2.52.6-1~deb13u1_amd64.deb", "6471d989a61a56a7801e88e420789aa6b0eaba630a9787365bba8b9576b7ba1c", 24163372L), + Package("pool/main/libx/libxslt/libxslt1.1_1.1.35-1.2+deb13u3_amd64.deb", "c8e5a745ca3afaa079b01e0c00d80a241101d1ab840407fcd4bb423de3326160", 233128L), + Package("pool/main/liby/libyuv/libyuv0_0.0.1904.20250204-1_amd64.deb", "1a6827fe94fa5572a032332df7313ed408e9c0ad78f3a1248391bddc6d920ef2", 173700L), + ) + fun launcher(): Source? { val location = redirect(LAUNCHER_URL) ?: return null val version = launcherVersion(location) ?: return null @@ -142,12 +184,13 @@ internal object EpicClientSources { private fun hex(bytes: ByteArray): String = bytes.joinToString("") { "%02x".format(it) } - fun isAppImage(file: File): Boolean = runCatching { + private val DEB_MAGIC = "!\ndebian-binary".toByteArray(Charsets.US_ASCII) + + fun isDeb(file: File): Boolean = runCatching { RandomAccessFile(file, "r").use { raf -> - val head = ByteArray(11) + val head = ByteArray(DEB_MAGIC.size) raf.readFully(head) - head[0] == 0x7f.toByte() && head[1] == 'E'.code.toByte() && head[2] == 'L'.code.toByte() && head[3] == 'F'.code.toByte() && - head[8] == 'A'.code.toByte() && head[9] == 'I'.code.toByte() && head[10] == 2.toByte() + head.contentEquals(DEB_MAGIC) } }.getOrDefault(false) } @@ -156,9 +199,10 @@ internal class EpicClientInstaller(private val app: Context) : DownloadQueue.Dow private val cancelled = AtomicBoolean(false) @Volatile private var connection: HttpURLConnection? = null - private class Part(val url: String, val file: File, val sha256: String?, val appImage: Boolean) { - var size = -1L + private class Part(val urls: List, val file: File, val sha256: String?, val launcher: Boolean, var size: Long = -1L) { + var mirror = 0 var mismatch: String? = null + val url: String get() = urls[mirror] } override fun run(handle: DownloadQueue.JobHandle): String? { @@ -173,17 +217,15 @@ internal class EpicClientInstaller(private val app: Context) : DownloadQueue.Dow val needRuntime = !(before.runtimeVersion == runtime.version && File(state, "runtime/${runtime.version}/.droiddeck-ready").isFile) val dir = EpicClient.downloadsDir(app).apply { mkdirs() } val gles = EpicClientSources.gles() - val parts = buildList { - if (needApp) add(Part(launcher.url, File(dir, "${launcher.version}-${EpicClientSources.LAUNCHER_FILE}"), null, true)) - if (needRuntime) { - add(Part(runtime.url, File(dir, "steamrt4-${runtime.version}.tar.gz"), runtime.sha256, false)) - add(Part(gles.url, File(dir, EpicClientSources.GLES_FILE), gles.sha256, false)) - } - } + val appPart = if (needApp) Part(listOf(launcher.url), File(dir, "${launcher.version}-${EpicClientSources.LAUNCHER_FILE}"), null, true) else null + val desktopParts = if (needApp) EpicClientSources.DESKTOP.map { Part(it.urls, File(dir, it.file), it.sha256, false, it.size) } else emptyList() + val runtimePart = if (needRuntime) Part(listOf(runtime.url), File(dir, "steamrt4-${runtime.version}.tar.gz"), runtime.sha256, false) else null + val glesPart = if (needRuntime) Part(listOf(gles.url), File(dir, EpicClientSources.GLES_FILE), gles.sha256, false) else null + val parts = listOfNotNull(appPart) + desktopParts + listOfNotNull(runtimePart, glesPart) val keep = parts.flatMap { listOf(it.file.name, it.file.name + PARTIAL, it.file.name + TAG) }.toSet() dir.listFiles()?.forEach { if (it.name !in keep) it.deleteRecursively() } if (parts.isNotEmpty()) { - parts.forEach { it.size = length(it.url) } + parts.forEach { if (it.size <= 0) it.size = length(it.url) } val total = parts.sumOf { it.size.coerceAtLeast(0L) } val have = parts.sumOf { p -> if (p.file.isFile) p.file.length() else File(p.file.path + PARTIAL).length() } val needed = (total - have).coerceAtLeast(0L) + (if (needApp) APP_ROOM else 0L) + (if (needRuntime) RUNTIME_ROOM else 0L) @@ -202,8 +244,9 @@ internal class EpicClientInstaller(private val app: Context) : DownloadQueue.Dow handle.stage(DownloadStage.INSTALL, app.getString(R.string.epic_client_unpacking)) val argv = mutableListOf(EpicClient.PROGRAM, "install", "--app-version", launcher.version, "--runtime-version", runtime.version) fun guest(file: File) = EpicClient.guestPath(app, file) ?: throw IllegalStateException(app.getString(R.string.epic_client_unpack_failed, file.name)) - if (needApp) argv += listOf("--app", guest(parts[0].file)) - if (needRuntime) argv += listOf("--runtime", guest(parts[parts.size - 2].file), "--gles", guest(parts[parts.size - 1].file)) + appPart?.let { argv += listOf("--app", guest(it.file)) } + desktopParts.forEach { argv += listOf("--desktop", guest(it.file)) } + if (runtimePart != null && glesPart != null) argv += listOf("--runtime", guest(runtimePart.file), "--gles", guest(glesPart.file)) var answer: JSONObject? = null val code = GuestCommand.run(app, argv, fakeRoot = true, logName = "epic-client") { line -> if (line.startsWith("{")) runCatching { JSONObject(line) }.getOrNull()?.let { answer = it } @@ -298,6 +341,10 @@ internal class EpicClientInstaller(private val app: Context) : DownloadQueue.Dow } 200 -> false 416 -> { partial.delete(); tag.delete(); throw IOException("HTTP 416") } + 404, 410 -> { + if (part.mirror + 1 < part.urls.size) { part.mirror++; tag.delete() } + throw IOException("HTTP $code") + } else -> throw IOException("HTTP $code") } val served = conn.getHeaderField("ETag")?.takeIf { it.isNotBlank() } @@ -334,8 +381,8 @@ internal class EpicClientInstaller(private val app: Context) : DownloadQueue.Dow part.sha256?.let { want -> if (EpicClientSources.sha256(file) != want) { file.delete(); throw IOException("checksum mismatch") } } - if (part.appImage) { - if (!EpicClientSources.isAppImage(file)) { file.delete(); throw IOException("not an AppImage") } + if (part.launcher) { + if (!EpicClientSources.isDeb(file)) { file.delete(); throw IOException("not a Debian package") } if (EpicClientSources.etagMatches(file, etag) == false) { val seen = EpicClientSources.sha256(file) if (part.mismatch != seen) { @@ -351,7 +398,7 @@ internal class EpicClientInstaller(private val app: Context) : DownloadQueue.Dow const val PARTIAL = ".part" const val TAG = ".etag" const val ATTEMPTS = 6 - const val APP_ROOM = 600L shl 20 + const val APP_ROOM = 700L shl 20 const val RUNTIME_ROOM = 560L shl 20 } } diff --git a/app/src/main/java/com/droiddeck/launcher/stores/gog/GogComet.kt b/app/src/main/java/com/droiddeck/launcher/stores/gog/GogComet.kt index dec376c456..8ad240e651 100644 --- a/app/src/main/java/com/droiddeck/launcher/stores/gog/GogComet.kt +++ b/app/src/main/java/com/droiddeck/launcher/stores/gog/GogComet.kt @@ -139,15 +139,21 @@ object GogComet { !File(LinuxRuntime.rootDir(context), BIN.removePrefix("/")).isFile) return reply(false, "not-installed") val data = File(context.filesDir, "gog-achievements").apply { mkdirs() } val ready = CountDownLatch(1) - val command = LinuxRuntime.command(context, null, null, Environment.getExternalStorageDirectory(), - listOf("/usr/bin/env", "HOME=/root", "XDG_DATA_HOME=${data.path}/data", "XDG_CONFIG_HOME=${data.path}/config", "COMET_LOG=off", "COMET_ALLOWED_CLIENTS=${policy.path}", BIN, "--credentials-stdin")) - val pb = ProcessBuilder(command).redirectErrorStream(true) - pb.environment().apply { - remove("LD_PRELOAD"); remove("LD_AUDIT"); remove("LD_LIBRARY_PATH") - put("PROOT_LOADER", LinuxRuntime.prootLoader(context).path) - put("PROOT_TMP_DIR", LinuxRuntime.prootTempDir(context).path) - if (SessionPrefs.prootNoSeccomp(context)) put("PROOT_NO_SECCOMP", "1") - LinuxRuntime.prootLibraryPath(context).takeIf { it.isNotEmpty() }?.let { put("LD_LIBRARY_PATH", it) } + val guest = listOf("/usr/bin/env", "HOME=/root", "XDG_DATA_HOME=${data.path}/data", "XDG_CONFIG_HOME=${data.path}/config", "COMET_LOG=off", "COMET_ALLOWED_CLIENTS=${policy.path}", BIN, "--credentials-stdin") + val pb = if (com.droiddeck.launcher.runtime.NativeGuest.forSession(context)) { + val root = LinuxRuntime.rootDir(context) + com.droiddeck.launcher.runtime.NativeGuest.processBuilder(context, root, + LinuxRuntime.binds(context, null, null, Environment.getExternalStorageDirectory(), null), guest).redirectErrorStream(true) + } else { + ProcessBuilder(LinuxRuntime.command(context, null, null, Environment.getExternalStorageDirectory(), guest)).redirectErrorStream(true).also { + it.environment().apply { + remove("LD_PRELOAD"); remove("LD_AUDIT"); remove("LD_LIBRARY_PATH") + put("PROOT_LOADER", LinuxRuntime.prootLoader(context).path) + put("PROOT_TMP_DIR", LinuxRuntime.prootTempDir(context).path) + if (SessionPrefs.prootNoSeccomp(context)) put("PROOT_NO_SECCOMP", "1") + LinuxRuntime.prootLibraryPath(context).takeIf { it.isNotEmpty() }?.let { put("LD_LIBRARY_PATH", it) } + } + } } try { val child = pb.start() diff --git a/app/src/main/java/com/droiddeck/launcher/stores/gog/GogInstallRecord.kt b/app/src/main/java/com/droiddeck/launcher/stores/gog/GogInstallRecord.kt index df07991023..686ebd3c8f 100644 --- a/app/src/main/java/com/droiddeck/launcher/stores/gog/GogInstallRecord.kt +++ b/app/src/main/java/com/droiddeck/launcher/stores/gog/GogInstallRecord.kt @@ -65,13 +65,19 @@ internal object GogFiles { fun dir(folder: File): File = inside(folder, ".droiddeck-gog").apply { mkdirs() } fun journal(folder: File): File = File(dir(folder), "operation.json") - fun inside(root: File, raw: String): File { + private fun parts(raw: String): List { val path = raw.replace('\\', '/') + val parts = path.split('/') require(path.isNotBlank() && !path.startsWith('/') && ':' !in path && '\u0000' !in path && - path.split('/').none { it.isEmpty() || it == "." || it == ".." }) { "Invalid GOG path: $raw" } + parts.none { it.isEmpty() || it == "." || it == ".." }) { "Invalid GOG path: $raw" } + return parts + } + + fun inside(root: File, raw: String): File { + val parts = parts(raw) val base = root.canonicalFile var out = base - for (part in path.split('/')) { + for (part in parts) { out = File(out, part) require(!Files.isSymbolicLink(out.toPath())) { "GOG path is a symbolic link: $raw" } } @@ -122,21 +128,28 @@ internal object GogFiles { } fun validate(files: JSONArray, folder: File) { + val base = folder.canonicalFile val paths = HashSet() val components = HashMap() + val listings = HashMap>>() for (file in files.objects()) { val path = file.getString("path").replace('\\', '/') - inside(folder, path) + val parts = parts(path) require(!path.startsWith(".droiddeck-", true) && path != StoreGameSidecar.FILE_NAME) { "GOG content overlaps launcher metadata" } require(paths.add(path.lowercase(Locale.ROOT))) { "GOG paths differ only by case: $path" } - var parent = folder + var parent = base var relative = "" - for (part in path.split('/')) { + for (part in parts) { relative = if (relative.isEmpty()) part else "$relative/$part" + val child = File(parent, part) val previous = components.putIfAbsent(relative.lowercase(Locale.ROOT), relative) require(previous == null || previous == relative) { "GOG directory paths differ only by case: $path" } - require(parent.list()?.none { it != part && it.equals(part, true) } != false) { "An existing path differs only by case: $path" } - parent = File(parent, part) + if (previous == null) { + require(!Files.isSymbolicLink(child.toPath())) { "GOG path is a symbolic link: $path" } + val existing = listings.getOrPut(parent) { parent.list().orEmpty().groupBy { it.lowercase(Locale.ROOT) } } + require(existing[part.lowercase(Locale.ROOT)].orEmpty().all { it == part }) { "An existing path differs only by case: $path" } + } + parent = child } } } diff --git a/app/src/main/java/com/droiddeck/launcher/stores/rockstar/RockstarAuth.kt b/app/src/main/java/com/droiddeck/launcher/stores/rockstar/RockstarAuth.kt new file mode 100644 index 0000000000..b6c90cb41f --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/stores/rockstar/RockstarAuth.kt @@ -0,0 +1,239 @@ +package com.droiddeck.launcher.stores.rockstar + +import android.content.Context +import android.os.Build +import android.util.Log +import android.webkit.CookieManager +import com.droiddeck.launcher.stores.Store +import com.droiddeck.launcher.stores.StoreAccounts +import org.json.JSONObject +import java.net.HttpURLConnection +import java.net.URL +import java.net.URLEncoder +import java.security.SecureRandom + +object RockstarAuth { + private const val TAG = "RockstarAuth" + const val SIGN_IN_HOST = "https://signin.rockstargames.com" + private const val LAUNCHER_SITE = "https://rgl.rockstargames.com" + private const val GATEWAY = "$LAUNCHER_SITE/api/connect/gateway" + + const val START_URL = "$SIGN_IN_HOST/robots.txt" + + const val CODE_URL = "$SIGN_IN_HOST/droiddeck/auth-code" + val SIGN_IN_URLS = listOf(SIGN_IN_HOST, LAUNCHER_SITE, "https://www.rockstargames.com", "https://socialclub.rockstargames.com") + const val COOKIE_DOMAIN = ".rockstargames.com" + + const val USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36" + private const val PREFS = "stores.rockstar" + private const val TICKET_MARGIN_MS = 15 * 60 * 1000L + private val lock = Any() + + class Ticket(val ticket: String, val sessionKey: String, val sessionTicket: String, val rockstarId: String, val nickname: String, val expiresAt: Long, val email: String = "", val sdkTicket: String = "") + + internal fun fingerprint(context: Context): JSONObject { + val p = context.applicationContext.getSharedPreferences(PREFS, Context.MODE_PRIVATE) + fun stable(key: String, bytes: Int): String = p.getString(key, null) ?: ByteArray(bytes).also { SecureRandom().nextBytes(it) } + .joinToString("") { "%02x".format(it) }.also { p.edit().putString(key, it).apply() } + val device = "DROIDDECK-" + (Build.MODEL ?: "ANDROID").uppercase().replace(Regex("[^A-Z0-9]"), "").take(12) + return fingerprintOf(device, stable("volume_serial", 4), stable("cpu_info", 8)) + } + + internal fun fingerprintOf(device: String, volume: String, cpu: String): JSONObject = JSONObject() + .put("device_name", device) + .put("machine_name", device) + .put("os_version", "10.0.19045") + .put("volume_serial", volume) + .put("cpu_info", cpu) + + internal fun state(fingerprint: JSONObject) = "{\"fp\": $fingerprint}" + + internal fun bridgeScript(fingerprint: JSONObject, title: String, codeUrl: String = CODE_URL): String = """ +(function(){ + if (window.__droiddeckRgsc) return 'again'; + window.__droiddeckRgsc = true; + var fp = $fingerprint, title = ${JSONObject.quote(title)}, back = ${JSONObject.quote(codeUrl)}, seq = 0; + function later(cb, v){ setTimeout(function(){ try { if (cb) cb(v); } catch (e) {} }, 0); } + var answers = { + GetWindowConfig: { serviceInfo: { rosPlatform: 'pc' }, platformInfo: {} }, + GetDeviceId: { fingerprintKvp: fp }, + GetVersionInfo: { isDebugSdk: false }, + GetProfileList: { profiles: [] }, + GetCommandLineArguments: { arguments: [] } + }; + window.rgscQueryCancel = function(){}; + window.rgscQuery = function(q){ + q = q || {}; + var p = q.params || {}; + if (q.method === 'CallAuthResult' && p.authCode) { + later(q.onSuccess, {}); + setTimeout(function(){ location.replace(back + '?code=' + encodeURIComponent(p.authCode)); }, 50); + } else if ((q.method === 'CallAuthResult' && p.result === 3) || (q.method === 'CallSetWindowState' && p.state === 3)) { + later(q.onSuccess, {}); + setTimeout(function(){ location.replace(back + '?cancel=1'); }, 50); + } else if (q.method === 'CallLaunchExternalBrowser' && p.url) { + window.open(p.url, '_blank'); + later(q.onSuccess, {}); + } else { + later(q.onSuccess, Object.prototype.hasOwnProperty.call(answers, q.method) ? answers[q.method] : {}); + } + return ++seq; + }; + window.rgscAddSubscription = function(s){ + s = s || {}; + if (s.method === 'OnStartAuth') later(s.onSuccess, { launchPlatform: 0, titleLaunchInfo: { activeTitleName: title, externalPlatformInfo: {} }, profile: null, errorMessage: null }); + return ++seq; + }; + var form = '/signin/user-form?cid=launcher&lang=en-US'; + fetch(form, { credentials: 'include' }) + .then(function(r){ return r.text(); }) + .then(function(h){ + history.replaceState(null, '', form); document.open(); document.write(h); document.close(); + var css = document.createElement('style'); + css.textContent = '[data-ui-name="launcherSettings"]{display:none!important}'; + (document.head || document.documentElement).appendChild(css); + }); + return 'ok'; +})() +""".trimIndent() + + fun isCodeUrl(url: String) = url.startsWith(CODE_URL) + + internal fun cancelled(url: String): Boolean = android.net.Uri.parse(url).getQueryParameter("cancel") == "1" + + internal fun codeFrom(url: String): String? = android.net.Uri.parse(url).getQueryParameter("code")?.takeIf { it.isNotBlank() } + + fun completeSignIn(context: Context, url: String): String? { + val code = codeFrom(url) ?: return "no auth code" + val fp = fingerprint(context) + val gateway = "$GATEWAY?code=" + URLEncoder.encode(code, "UTF-8") + "&fingerprint=" + URLEncoder.encode(state(fp), "UTF-8") + val c = URL(gateway).openConnection() as HttpURLConnection + c.connectTimeout = 20_000 + c.readTimeout = 25_000 + c.instanceFollowRedirects = false + c.setRequestProperty("User-Agent", USER_AGENT) + c.setRequestProperty("Accept", "application/json") + c.setRequestProperty("X-Requested-With", "XMLHttpRequest") + c.setRequestProperty("Origin", LAUNCHER_SITE) + c.setRequestProperty("Referer", "$LAUNCHER_SITE/") + runCatching { CookieManager.getInstance().getCookie(LAUNCHER_SITE) }.getOrNull()?.takeIf { it.isNotEmpty() }?.let { c.setRequestProperty("Cookie", it) } + val (status, body) = try { + val s = c.responseCode + s to ((if (s in 200..299) c.inputStream else c.errorStream)?.use { it.readBytes().toString(Charsets.UTF_8) }.orEmpty()) + } finally { + c.disconnect() + } + val o = runCatching { JSONObject(body) }.getOrNull() + val token = o?.optString("ScAuthToken")?.takeIf { it.isNotEmpty() && it != "null" } + if (token == null) { + Log.w(TAG, "gateway $status; fields ${o?.keys()?.asSequence()?.toList() ?: "not json"}") + return "gateway $status" + } + val account = JSONObject() + .put("access_token", token) + .put("remembered_machine_token", o.optString("RememberedMachineToken").takeIf { it != "null" }.orEmpty()) + .put("login_guid", o.optString("LoginGuid").takeIf { it != "null" }.orEmpty()) + .put("display_name", "Rockstar Games") + .put("signed_in_at", System.currentTimeMillis()) + StoreAccounts.write(context.applicationContext, Store.ROCKSTAR, account) + val t = runCatching { mint(context) }.onFailure { Log.w(TAG, "first ticket: ${it.message}") }.getOrNull() + if (t == null) { + StoreAccounts.clear(context.applicationContext, Store.ROCKSTAR) + return "ticket" + } + return null + } + + fun ticket(context: Context, fresh: Boolean = false): Ticket? = synchronized(lock) { + val o = StoreAccounts.read(context.applicationContext, Store.ROCKSTAR) ?: return null + if (!fresh) { + val current = stored(o) + if (com.droiddeck.launcher.session.SessionState.running && + com.droiddeck.launcher.stores.StoreLaunchRequests.lastLaunched?.first == Store.ROCKSTAR) { + return current?.takeIf { it.expiresAt > System.currentTimeMillis() } + } + current?.takeIf { it.expiresAt - System.currentTimeMillis() > TICKET_MARGIN_MS }?.let { return it } + } + runCatching { mint(context) }.onFailure { Log.w(TAG, "ticket: ${it.message}") }.getOrNull() + } + + private fun stored(o: JSONObject): Ticket? { + val t = o.optString("ticket").takeIf { it.isNotEmpty() } ?: return null + return Ticket(t, o.optString("session_key"), o.optString("session_ticket"), o.optString("rockstar_id"), o.optString("display_name"), o.optLong("ticket_expires_at"), o.optString("email"), o.optString("sdk_ticket").takeIf { o.optInt("sdk_ticket_version") == 1 }.orEmpty()) + } + + private fun mint(context: Context): Ticket { + val app = context.applicationContext + val o = StoreAccounts.read(app, Store.ROCKSTAR) ?: throw IllegalStateException("not signed in") + val root = try { + RockstarRos.result("auth.asmx/CreateTicketScAuthToken2", listOf( + "ticket" to "", "platformName" to "pcros", "scAuthToken" to o.optString("access_token"), + "rememberedMachineToken" to o.optString("remembered_machine_token"), + ), headers = mapOf("SCS-MFAMachineFingerPrint" to state(fingerprint(app)))) + } catch (e: RockstarRos.RosException) { + if (e.code.startsWith("AuthenticationFailed")) com.droiddeck.launcher.stores.StoresState.markSignInExpired(Store.ROCKSTAR) + throw e + } + val t = parseTicket(root) ?: throw IllegalStateException("no ticket in the answer") + o.put("ticket", t.ticket).put("session_key", t.sessionKey).put("session_ticket", t.sessionTicket) + .put("rockstar_id", t.rockstarId).put("ticket_expires_at", t.expiresAt).put("email", t.email).put("sdk_ticket", t.sdkTicket).put("sdk_ticket_version", 1) + if (t.nickname.isNotEmpty()) o.put("display_name", t.nickname) + StoreAccounts.write(app, Store.ROCKSTAR, o) + return t + } + + internal fun parseTicket(root: org.w3c.dom.Element, now: Long = System.currentTimeMillis()): Ticket? { + val ticket = RockstarRos.text(root, "Ticket")?.takeIf { it.isNotEmpty() } ?: return null + val account = RockstarRos.first(root, "RockstarAccount") + val secs = RockstarRos.text(root, "SecsUntilExpiration")?.toLongOrNull() ?: 3600L + return Ticket( + ticket, RockstarRos.text(root, "SessionKey").orEmpty(), RockstarRos.text(root, "SessionTicket").orEmpty(), + (account?.let { RockstarRos.text(it, "RockstarId") } ?: RockstarRos.text(root, "RockstarId")).orEmpty(), + account?.let { RockstarRos.text(it, "Nickname") }.orEmpty(), + now + secs * 1000L, + account?.let { RockstarRos.text(it, "Email") }.orEmpty(), + sdkTicket(root), + ) + } + + internal fun sdkTicket(root: org.w3c.dom.Element): String { + val document = javax.xml.parsers.DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument() + val response = document.createElement("Response").also { document.appendChild(it) } + val fields = setOf("Status", "Ticket", "SessionKey", "SessionTicket", "SecsUntilExpiration", "PlayerAccountId", "PlayerAccountRuid", + "Region", "Privileges", "Privs", "Services", "SslServices", "Hosts", "DisabledSecurityFlags", "SessionId", "CloudKey", "PublicIp", "PosixTime", "IsSubAccount") + val blocked = setOf("scauthtoken", "accesstoken", "refreshtoken", "rememberedmachinetoken", "loginguid", "password") + fun copy(source: org.w3c.dom.Element): org.w3c.dom.Element { + val target = document.createElement(source.tagName) + for (i in 0 until source.attributes.length) { + val attribute = source.attributes.item(i) + if (attribute.nodeName.lowercase() !in blocked) target.setAttribute(attribute.nodeName, attribute.nodeValue) + } + var child = source.firstChild + while (child != null) { + if (child is org.w3c.dom.Element) { + if (child.tagName.lowercase() !in blocked) target.appendChild(copy(child)) + } else if (child.nodeType == org.w3c.dom.Node.TEXT_NODE || child.nodeType == org.w3c.dom.Node.CDATA_SECTION_NODE) { + target.appendChild(document.createTextNode(child.nodeValue)) + } + child = child.nextSibling + } + return target + } + for (field in fields) RockstarRos.first(root, field)?.let { response.appendChild(copy(it)) } + RockstarRos.first(root, "RockstarAccount")?.let { account -> + val target = document.createElement("RockstarAccount") + for (field in setOf("RockstarId", "Nickname", "Email", "Age", "CountryCode", "LanguageCode", "AvatarUrl", "ZipCode", "Ruid")) { + RockstarRos.first(account, field)?.let { target.appendChild(copy(it)) } + } + response.appendChild(target) + } + val output = java.io.StringWriter() + javax.xml.transform.TransformerFactory.newInstance().newTransformer().apply { + setOutputProperty(javax.xml.transform.OutputKeys.OMIT_XML_DECLARATION, "yes") + transform(javax.xml.transform.dom.DOMSource(document), javax.xml.transform.stream.StreamResult(output)) + } + return output.toString() + } + + fun signOut(context: Context) = synchronized(lock) { StoreAccounts.clear(context.applicationContext, Store.ROCKSTAR) } +} diff --git a/app/src/main/java/com/droiddeck/launcher/stores/rockstar/RockstarBackend.kt b/app/src/main/java/com/droiddeck/launcher/stores/rockstar/RockstarBackend.kt new file mode 100644 index 0000000000..f816ed8ef1 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/stores/rockstar/RockstarBackend.kt @@ -0,0 +1,209 @@ +package com.droiddeck.launcher.stores.rockstar + +import android.content.Context +import android.content.Intent +import android.util.Log +import android.webkit.WebView +import com.droiddeck.launcher.R +import com.droiddeck.launcher.stores.CatalogItem +import com.droiddeck.launcher.stores.InstalledStoreGame +import com.droiddeck.launcher.stores.LoginFlows +import com.droiddeck.launcher.stores.Store +import com.droiddeck.launcher.stores.StoreBackend +import com.droiddeck.launcher.stores.StoreFront +import com.droiddeck.launcher.stores.StoreInstallRoot +import com.droiddeck.launcher.stores.StoreLoginActivity +import com.droiddeck.launcher.stores.StoreShelves +import com.droiddeck.launcher.stores.StoresState +import com.droiddeck.launcher.stores.WebCookies +import com.droiddeck.launcher.stores.download.DownloadEntry +import com.droiddeck.launcher.stores.download.DownloadQueue +import org.w3c.dom.Element + +object RockstarBackend : StoreBackend { + override val store: Store = Store.ROCKSTAR + + init { + LoginFlows.rockstarFlow = { ua -> RockstarLogin(ua) } + } + + override fun signIn(context: Context) { + context.startActivity( + Intent(context, StoreLoginActivity::class.java) + .putExtra(StoreLoginActivity.EXTRA_STORE, store.id) + .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK), + ) + } + + override fun signOut(context: Context) { + RockstarAuth.signOut(context.applicationContext) + RockstarLibrary.reset() + runCatching { WebCookies.expire(RockstarAuth.SIGN_IN_URLS, RockstarAuth.COOKIE_DOMAIN, listOf("/")) {} } + } + + override fun syncLibrary(context: Context, force: Boolean) { + val app = context.applicationContext + Thread({ RockstarLibrary.sync(app) }, "rockstar-sync").start() + } + + override fun loadShelves(context: Context, force: Boolean) { + StoresState.post { StoresState.shelves[store] = StoreFront.markOwned(RockstarCatalog.shelves(), StoresState.library[store], RockstarCatalog::sameGame) } + } + + override fun search(context: Context, query: String): List = + StoreFront.markOwned(RockstarCatalog.search(query), StoresState.library[store], RockstarCatalog::sameGame) + + override fun install(context: Context, item: CatalogItem, root: java.io.File) { + val app = context.applicationContext + val folder = StoreInstallRoot.folderFor(app, store, item.id, item.title, root) + val entry = DownloadEntry(store, item.id, item.title, cover = item.tallImageUrl ?: item.imageUrl, + bytesTotal = item.sizeBytes, location = StoreInstallRoot.labelFor(app, folder)) + DownloadQueue.enqueue(app, entry) { RockstarInstaller(app, item, folder) } + } + + override fun uninstall(context: Context, game: InstalledStoreGame) {} +} + +internal class RockstarLogin(override val userAgent: String) : StoreLoginActivity.Flow { + override val startUrl: String get() = RockstarAuth.START_URL + override fun isRedirect(url: String): Boolean = RockstarAuth.isCodeUrl(url) + + override fun pageFinished(view: WebView, url: String) { + if (!url.startsWith(RockstarAuth.START_URL)) return + val title = "launcher" + view.evaluateJavascript(RockstarAuth.bridgeScript(RockstarAuth.fingerprint(view.context), title)) { Log.d("RockstarLogin", "bridge: $it") } + } + + override fun forgetSignIn(done: () -> Unit) { + runCatching { WebCookies.expire(RockstarAuth.SIGN_IN_URLS, RockstarAuth.COOKIE_DOMAIN, listOf("/")) { done() } }.onFailure { done() } + } + + override fun finish(activity: StoreLoginActivity, view: WebView, url: String): String? = if (RockstarAuth.cancelled(url)) null else try { + RockstarAuth.completeSignIn(activity, url)?.let { + Log.w("RockstarLogin", "sign-in incomplete: $it") + activity.getString(R.string.stores_login_error_verification) + } + } catch (e: Exception) { + Log.w("RockstarLogin", "sign-in failed: ${e.javaClass.simpleName}") + activity.getString(R.string.stores_login_error_generic) + } +} + +internal data class RockstarApp(val id: String, val name: String, val titleId: String, val branches: List, val parent: String = "") + +internal data class RockstarBranch(val id: String, val name: String, val buildId: String, val isDefault: Boolean, val accessToken: String) { + val hasBuild: Boolean get() = (buildId.toLongOrNull() ?: 0L) > 0 && accessToken.isNotEmpty() +} + +internal data class RockstarPackage(val title: String, val featured: Boolean) + +internal class RockstarAccountApps(val apps: List, val packages: List) + +internal object RockstarApps { + fun parse(root: Element): List = RockstarRos.all(root, "App").map { a -> + val branches = RockstarRos.first(a, "Branches")?.let { RockstarRos.children(it, "Branch") }.orEmpty().map { b -> + RockstarBranch(b.getAttribute("Id"), b.getAttribute("Name"), b.getAttribute("BuildId"), + b.getAttribute("IsDefault").equals("true", true), RockstarRos.text(b, "AccessToken").orEmpty()) + } + val parent = (a.parentNode?.parentNode as? Element)?.takeIf { it.tagName == "App" }?.getAttribute("Name").orEmpty() + RockstarApp(a.getAttribute("Id"), a.getAttribute("Name"), a.getAttribute("TitleId"), branches, parent) + } + + fun packages(root: Element): List = RockstarRos.all(root, "PackageJson").mapNotNull { p -> + val o = runCatching { org.json.JSONObject(p.textContent) }.getOrNull() ?: return@mapNotNull null + o.optString("title").takeIf { it.isNotEmpty() }?.let { RockstarPackage(it, o.optBoolean("isFeatured")) } + } + + fun fetch(ticket: String, log: (String) -> Unit): RockstarAccountApps { + val root = RockstarRos.result("app.asmx/GetAppsAndPackages", listOf("ticket" to ticket)) + val out = RockstarAccountApps(parse(root), packages(root)) + log("Rockstar: packages " + out.packages.joinToString(", ") { it.title + if (it.featured) " (featured)" else "" }.ifEmpty { "none" } + + "; builds " + out.apps.filter { a -> a.branches.any { it.hasBuild } }.joinToString(", ") { it.name }.ifEmpty { "none" }) + return out + } + + fun branch(app: RockstarApp): RockstarBranch? = app.branches.firstOrNull { it.isDefault && it.hasBuild } ?: app.branches.firstOrNull { it.hasBuild } + + fun deliverer(apps: List, title: RockstarTitle): RockstarApp? = apps + .filter { RockstarTitles.byId(it.name) == title && !it.name.endsWith("_steam") && !it.name.endsWith("_epic") } + .sortedBy { if (it.name == title.id) 0 else 1 } + .firstOrNull { branch(it) != null } +} + +object RockstarLibrary { + private val generation = java.util.concurrent.atomic.AtomicInteger() + private val running = java.util.concurrent.atomic.AtomicReference(null) + + fun reset() { + generation.incrementAndGet() + StoresState.post { + StoresState.library.remove(Store.ROCKSTAR) + StoresState.shelves.remove(Store.ROCKSTAR) + } + } + + private fun post(gen: Int, block: () -> Unit) = StoresState.post { if (generation.get() == gen) block() } + + internal fun owned(account: RockstarAccountApps): List = + account.packages.filter { !it.featured }.flatMap { RockstarTitles.forName(it.title) }.distinct() + + internal fun owns(account: RockstarAccountApps, rosId: Int, id: String): Boolean = + owned(account).any { it.rosTitleId == rosId } || account.packages.any { !it.featured && it.title == id } + + internal fun games(account: RockstarAccountApps): List = owned(account).mapNotNull { t -> + RockstarApps.deliverer(account.apps, t)?.let { RockstarTitles.item(t, owned = true, extra = mapOf("app" to it.name, "appId" to it.id)) } + }.sortedBy { it.title.lowercase() } + + fun sync(app: Context) { + val gen = generation.get() + if (running.getAndSet(gen) == gen) return + try { + val t = RockstarAuth.ticket(app) + if (t == null) { + post(gen) { StoresState.status.remove(Store.ROCKSTAR); StoresState.problems[Store.ROCKSTAR] = app.getString(R.string.stores_sync_sign_in) } + return + } + if (StoresState.library[Store.ROCKSTAR].isNullOrEmpty()) post(gen) { StoresState.status[Store.ROCKSTAR] = app.getString(R.string.stores_sync_game_list) } + val account = RockstarApps.fetch(t.ticket) { StoresState.logLine(it) } + val games = games(account) + owned(account).filter { o -> games.none { it.id == o.id } }.takeIf { it.isNotEmpty() }?.let { elsewhere -> + StoresState.logLine("Rockstar: owned through another store, installs from there: " + elsewhere.joinToString(", ") { it.name }) + } + post(gen) { + StoresState.status.remove(Store.ROCKSTAR) + StoresState.problems.remove(Store.ROCKSTAR) + StoresState.library[Store.ROCKSTAR] = games + StoresState.shelves[Store.ROCKSTAR]?.let { StoresState.shelves[Store.ROCKSTAR] = StoreFront.markOwned(it, games, RockstarCatalog::sameGame) } + } + StoresState.logLine("Rockstar: ${games.size} owned games") + } catch (e: Exception) { + StoresState.logLine("Rockstar: library sync failed: ${e.javaClass.simpleName} ${e.message.orEmpty().take(300)}") + post(gen) { StoresState.status.remove(Store.ROCKSTAR); StoresState.problems[Store.ROCKSTAR] = app.getString(R.string.stores_sync_failed) } + } finally { + running.compareAndSet(gen, null) + } + } +} + +internal object RockstarCatalog { + fun all(): List = RockstarTitles.all.map { RockstarTitles.item(it) } + + fun shelves(): StoreShelves { + val all = all() + val newest = all.sortedByDescending { it.releaseDate } + val headline = listOf("gta5_gen9", "rdr2", "rdr", "gta4", "gtasaunreal", "lanoire", "mp3") + return StoreShelves( + whatsNew = newest, + trending = headline.mapNotNull { id -> all.firstOrNull { it.id == id } } + all.filter { it.id !in headline }, + art = all.mapNotNull { it.imageUrl }, + ) + } + + fun search(query: String): List { + val q = StoreFront.titleKey(query) + if (q.length < 2) return emptyList() + return all().filter { StoreFront.titleKey(it.title).contains(q) } + } + + fun sameGame(shelf: CatalogItem, owned: CatalogItem): Boolean = shelf.id == owned.id +} diff --git a/app/src/main/java/com/droiddeck/launcher/stores/rockstar/RockstarInstaller.kt b/app/src/main/java/com/droiddeck/launcher/stores/rockstar/RockstarInstaller.kt new file mode 100644 index 0000000000..ac039d95f9 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/stores/rockstar/RockstarInstaller.kt @@ -0,0 +1,263 @@ +package com.droiddeck.launcher.stores.rockstar + +import android.content.Context +import com.droiddeck.launcher.R +import com.droiddeck.launcher.stores.CatalogItem +import com.droiddeck.launcher.stores.Store +import com.droiddeck.launcher.stores.StoreExe +import com.droiddeck.launcher.stores.StoreGameSidecar +import com.droiddeck.launcher.stores.StoreInstalls +import com.droiddeck.launcher.stores.download.DownloadQueue +import com.droiddeck.launcher.stores.download.DownloadStage +import org.w3c.dom.Element +import java.io.File +import java.io.RandomAccessFile +import java.net.HttpURLConnection +import java.net.URL +import java.nio.file.Files +import java.security.MessageDigest +import java.util.concurrent.ConcurrentLinkedQueue +import java.util.concurrent.Executors +import java.util.concurrent.TimeUnit +import java.util.concurrent.atomic.AtomicBoolean +import java.util.concurrent.atomic.AtomicLong +import java.util.concurrent.atomic.AtomicReference + +internal data class RockstarChunk(val fileEntryId: String, val chunkId: String, val sha256: String, val offset: Long, val size: Long) + +internal data class RockstarFile(val entryId: String, val versionId: String, val path: String, val size: Long, val sha256: String, val chunks: List) + +internal data class RockstarBuild(val buildId: String, val version: String, val preload: Boolean, val files: List) { + val bytes: Long get() = files.sumOf { it.size } +} + +internal object RockstarManifest { + fun inside(root: File, relative: String): File { + require(safePath(relative) == relative) { "Unsafe Rockstar install path" } + val base = root.canonicalFile + var target = base + for (part in relative.split('/')) { + target = File(target, part) + require(!Files.isSymbolicLink(target.toPath())) { "Rockstar install path is a symbolic link" } + } + require(target.canonicalFile.toPath().startsWith(base.toPath())) { "Rockstar install path leaves its folder" } + return target + } + + fun verified(target: File, chunk: RockstarChunk, cancelled: () -> Boolean = { false }): Boolean { + if (cancelled()) return false + if (!target.isFile || chunk.offset < 0 || chunk.size < 0 || chunk.offset > target.length() || chunk.size > target.length() - chunk.offset) return false + return RandomAccessFile(target, "r").use { input -> + input.seek(chunk.offset) + val digest = MessageDigest.getInstance("SHA-256") + val buffer = ByteArray(256 * 1024) + var remaining = chunk.size + while (remaining > 0) { + if (cancelled()) return false + val count = input.read(buffer, 0, minOf(buffer.size.toLong(), remaining).toInt()) + if (count <= 0) return false + digest.update(buffer, 0, count) + remaining -= count + } + digest.digest().joinToString("") { "%02x".format(it) }.equals(chunk.sha256, true) + } + } + + fun safePath(raw: String): String? { + val parts = raw.replace('\\', '/').split('/').filter { it.isNotEmpty() && it != "." } + if (parts.isEmpty() || parts.any { it == ".." || it.contains(':') }) return null + return parts.joinToString("/") + } + + fun parse(root: Element): RockstarBuild { + val result = RockstarRos.first(root, "Result") ?: throw IllegalStateException("manifest without a result") + val files = RockstarRos.all(result, "FileDetails").map { f -> + val entry = f.getAttribute("FileEntryId") + val path = safePath(RockstarRos.text(f, "RelativePath").orEmpty()) ?: throw IllegalStateException("unsafe path in the manifest") + val chunks = RockstarRos.first(f, "FileChunks")?.let { RockstarRos.children(it, "Chunk") }.orEmpty().map { c -> + RockstarChunk(entry, c.getAttribute("FileChunkId"), c.getAttribute("SHA256Hash").lowercase(), + c.getAttribute("StartByteOffset").toLong(), c.getAttribute("Size").toLong()) + } + val whole = RockstarRos.children(f, "SHA256Hash").firstOrNull()?.textContent?.trim()?.lowercase().orEmpty() + RockstarFile(entry, f.getAttribute("FileEntryVersionId"), path, f.getAttribute("FileSize").toLong(), whole, chunks) + } + return RockstarBuild(result.getAttribute("BuildId"), result.getAttribute("VersionNumber"), + RockstarRos.text(result, "IsPreload").equals("true", true), files) + } + + fun batches(chunks: List, maxBytes: Long = 48L * 1024 * 1024, maxCount: Int = 16): List> { + val out = ArrayList>() + var cur = ArrayList() + var bytes = 0L + for (c in chunks) { + if (cur.isNotEmpty() && (bytes + c.size > maxBytes || cur.size >= maxCount)) { out += cur; cur = ArrayList(); bytes = 0 } + cur += c + bytes += c.size + } + if (cur.isNotEmpty()) out += cur + return out + } + + fun key(file: RockstarFile, chunk: RockstarChunk) = "${file.versionId}:${chunk.chunkId}" +} + +internal class RockstarInstaller( + private val app: Context, + private val item: CatalogItem, + private val folder: File, +) : DownloadQueue.DownloadJob { + private val cancelled = AtomicBoolean(false) + + override fun run(handle: DownloadQueue.JobHandle): String? { + handle.stage(DownloadStage.MANIFEST, app.getString(R.string.stores_sync_sign_in)) + val ticket = RockstarAuth.ticket(app)?.ticket ?: throw IllegalStateException("Not signed in to Rockstar Games") + val title = RockstarTitles.byId(item.id) ?: throw IllegalStateException("Rockstar has no PC build of ${item.title}") + val account = RockstarApps.fetch(ticket) { handle.log(it) } + if (title !in RockstarLibrary.owned(account)) throw IllegalStateException("${item.title} is not in this Rockstar account's library") + val owned = RockstarApps.deliverer(account.apps, title) + ?: throw IllegalStateException("${item.title} is owned through another store and installs from there") + val branch = RockstarApps.branch(owned)!! + handle.log("rockstar: ${owned.name} branch ${branch.name} build ${branch.buildId}") + val build = RockstarManifest.parse(RockstarRos.result("app.asmx/GetBuildManifestFull", listOf("ticket" to ticket, "branchAccessToken" to branch.accessToken))) + if (build.preload) throw IllegalStateException("${item.title} is a preload Rockstar has not unlocked yet") + handle.log("rockstar: build ${build.buildId} ${build.version}, ${build.files.size} files, ${build.bytes} bytes") + handle.diskSize(build.bytes) + val cover = item.tallImageUrl ?: item.imageUrl + StoreInstalls.begin(folder, Store.ROCKSTAR, item.id, item.title, cover, item.imageUrl) + if (cancelled.get()) return null + + val ledger = RockstarManifest.inside(folder, LEDGER) + val done = HashSet().apply { if (ledger.isFile) ledger.readLines().filterTo(this) { it.isNotBlank() } } + val pending = ArrayList>() + var have = 0L + for (f in build.files) { + if (cancelled.get()) return null + val target = RockstarManifest.inside(folder, f.path) + target.parentFile?.mkdirs() + for (c in f.chunks) { + if (cancelled.get()) return null + if (RockstarManifest.key(f, c) in done && RockstarManifest.verified(target, c, cancelled::get)) have += c.size else pending += f to c + } + if (cancelled.get()) return null + RandomAccessFile(target, "rw").use { if (it.length() != f.size) it.setLength(f.size) } + } + val fileOf = pending.associate { (f, c) -> "${c.fileEntryId}:${c.chunkId}" to f } + val total = build.bytes + val progress = AtomicLong(have) + handle.stage(DownloadStage.DOWNLOAD) + handle.progress(have, total, "Downloading (${build.files.size} files)") + + val queue = ConcurrentLinkedQueue(RockstarManifest.batches(pending.map { it.second })) + val failure = AtomicReference(null) + val pool = Executors.newFixedThreadPool(WORKERS, DownloadQueue.workerFactory("rockstar-dl")) + val ledgerLock = Any() + repeat(WORKERS) { + pool.execute { + while (!cancelled.get() && failure.get() == null) { + val batch = queue.poll() ?: break + try { + val urls = chunkUrls(ticket, branch.accessToken, batch) + for (c in batch) { + if (cancelled.get()) break + val f = fileOf.getValue("${c.fileEntryId}:${c.chunkId}") + fetch({ retry -> (if (retry) null else urls[c.chunkId]) ?: chunkUrls(ticket, branch.accessToken, listOf(c)).getValue(c.chunkId) }, RockstarManifest.inside(folder, f.path), c, progress) { + handle.progress(progress.get(), total, "Downloading (${build.files.size} files)") + } + synchronized(ledgerLock) { ledger.appendText(RockstarManifest.key(f, c) + "\n") } + } + } catch (t: Throwable) { + failure.compareAndSet(null, t) + } + } + } + } + pool.shutdown() + while (!pool.awaitTermination(250, TimeUnit.MILLISECONDS)) Unit + if (cancelled.get()) return null + failure.get()?.let { throw it } + + handle.interruptible(false) + handle.stage(DownloadStage.INSTALL, app.getString(R.string.stores_registering)) + val exe = resolve(folder, title.exe) ?: StoreExe.pick(folder, null, item.title).ifEmpty { title.exe.replace('\\', '/') } + handle.log("rockstar: exe=$exe") + val sidecar = StoreGameSidecar( + Store.ROCKSTAR, item.id, item.title, exe = exe, + installVersion = build.version.ifEmpty { build.buildId }, installedAt = System.currentTimeMillis(), + cover = cover, hero = item.imageUrl, cloud = false, + extra = mapOf("rosTitleId" to title.rosTitleId.toString(), "app" to owned.name, "buildId" to build.buildId, "platform" to title.platform), + ) + StoreInstalls.complete(app, folder, sidecar, onStep = { d, steps -> handle.stageProgress(d.toLong(), steps.toLong()) }) + ledger.delete() + return folder.path + } + + private fun chunkUrls(ticket: String, branchToken: String, batch: List): Map { + val csv = batch.joinToString(",") { "${it.fileEntryId}:${it.chunkId}" } + val root = RockstarRos.result("app.asmx/RetrieveFileChunkMulti", listOf("ticket" to ticket, "branchAccessToken" to branchToken, "fileEntryAndChunkIdCsv" to csv)) + return RockstarRos.all(root, "Chunk").mapNotNull { c -> RockstarRos.text(c, "RedirectUrl")?.let { c.getAttribute("FileChunkId") to it } }.toMap() + } + + private fun fetch(url: (Boolean) -> String, target: File, chunk: RockstarChunk, progress: AtomicLong, report: () -> Unit) { + var lastError: Exception? = null + for (attempt in 0 until 3) { + if (cancelled.get()) return + val written = AtomicLong(0) + try { + val c = URL(url(attempt > 0)).openConnection() as HttpURLConnection + c.connectTimeout = 20_000 + c.readTimeout = 60_000 + try { + if (c.responseCode != 200) throw java.io.IOException("chunk ${chunk.chunkId}: HTTP ${c.responseCode}") + val digest = MessageDigest.getInstance("SHA-256") + RandomAccessFile(target, "rw").use { out -> + out.seek(chunk.offset) + c.inputStream.use { input -> + val buf = ByteArray(256 * 1024) + var last = 0L + while (true) { + if (cancelled.get()) { progress.addAndGet(-written.get()); return } + val n = input.read(buf) + if (n < 0) break + if (written.get() + n > chunk.size) throw java.io.IOException("chunk ${chunk.chunkId} is longer than the manifest says") + out.write(buf, 0, n) + digest.update(buf, 0, n) + written.addAndGet(n.toLong()) + progress.addAndGet(n.toLong()) + val now = System.currentTimeMillis() + if (now - last > 400) { last = now; report() } + } + } + } + val hex = digest.digest().joinToString("") { "%02x".format(it) } + if (written.get() != chunk.size || hex != chunk.sha256) throw java.io.IOException("chunk ${chunk.chunkId} failed its check") + report() + return + } finally { + c.disconnect() + } + } catch (e: Exception) { + progress.addAndGet(-written.get()) + lastError = e + } + } + throw lastError ?: java.io.IOException("chunk ${chunk.chunkId} failed") + } + + override fun cancel(deleteFiles: Boolean) { + cancelled.set(true) + if (deleteFiles) StoreInstalls.discard(app, folder, emptyList()) + } + + internal companion object { + const val LEDGER = ".droiddeck-rockstar-chunks" + private const val WORKERS = 4 + + fun resolve(folder: File, configured: String): String? { + var at = folder + for (part in configured.replace('\\', '/').split('/').filter { it.isNotEmpty() }) { + at = at.listFiles()?.firstOrNull { it.name.equals(part, ignoreCase = true) } ?: return null + } + return if (at.isFile) at.relativeTo(folder).invariantSeparatorsPath else null + } + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/stores/rockstar/RockstarLaunch.kt b/app/src/main/java/com/droiddeck/launcher/stores/rockstar/RockstarLaunch.kt new file mode 100644 index 0000000000..52f1119f90 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/stores/rockstar/RockstarLaunch.kt @@ -0,0 +1,69 @@ +package com.droiddeck.launcher.stores.rockstar + +import android.content.Context +import com.droiddeck.launcher.session.GameEnvironmentStore +import com.droiddeck.launcher.stores.Store +import com.droiddeck.launcher.stores.StoreGameSidecar +import com.droiddeck.launcher.stores.StoreInstallRoot +import org.json.JSONObject +import java.security.MessageDigest +import java.util.Base64 + +object RockstarLaunch { + internal val pipes = mapOf("gta3" to "GTA3_Pipe", "gtavc" to "GTA-VC_Pipe", "gtasa" to "GTA_SA_Pipe", "gta4" to "GTAIV_Pipe", "lanoire" to "LANOIRE_Pipe") + + fun usesClassicLauncher(id: String) = id in pipes + + fun applyDefaults(app: Context, id: String, appId: Long) { + val scope = (appId and 0xffffffffL).toString() + when (id) { + "gta3" -> GameEnvironmentStore.setDefault(app, scope, "FEX_X87REDUCEDPRECISION", "0") + "gtasa" -> GameEnvironmentStore.setDefault(app, scope, "PROTON_USE_WINED3D", "1") + } + } + + fun prepare(app: Context, id: String): JSONObject { + val folder = StoreInstallRoot.gameFolders(app).firstOrNull { folder -> + StoreGameSidecar.read(folder)?.let { it.store == Store.ROCKSTAR && it.id == id && it.isInstalled } == true + } ?: return failure("not-installed") + val installed = StoreGameSidecar.read(folder) ?: return failure("not-installed") + val exe = installed.exeFile(folder).canonicalFile + if (!exe.path.startsWith(folder.canonicalPath + java.io.File.separator) || !exe.isFile) return failure("missing-game-files") + val metadata = RockstarMetadata.find(folder) + val pipe = pipes[id] + val sdk = (pipe == null && metadata != null) || id in setOf("gta4", "lanoire") || listOf(folder, exe.parentFile).any { dir -> + dir.listFiles().orEmpty().any { it.isFile && it.name.lowercase() in setOf("socialclub.dll", "socialclub64.dll") } + } + if (pipe == null && !sdk) return failure("no-launcher-protocol") + if (pipe != null && !listOf(folder, exe.parentFile).any { java.io.File(it, "MTLX.dll").isFile }) return failure("missing-game-files") + val rosId = metadata?.rosId ?: RockstarTitles.byId(id)?.rosTitleId ?: return failure("missing-title-metadata") + var ticket = RockstarAuth.ticket(app) ?: RockstarAuth.ticket(app, fresh = true) ?: return failure("signed-out") + if (sdk && ticket.sdkTicket.isEmpty()) ticket = RockstarAuth.ticket(app, fresh = true) ?: return failure("signed-out") + val account = try { + RockstarApps.fetch(ticket.ticket) {} + } catch (e: RockstarRos.RosException) { + if (!(e.code.contains("Ticket", true) || e.code.contains("Sign", true) || e.code.contains("Auth", true))) throw e + ticket = RockstarAuth.ticket(app, fresh = true) ?: return failure("signed-out") + RockstarApps.fetch(ticket.ticket) {} + } + if (metadata != null && account.apps.none { it.titleId.toIntOrNull() == rosId && (it.name == metadata.id || it.name.startsWith(metadata.id + "_")) }) return failure("title-metadata-mismatch") + val tokenRoot = RockstarRos.result("app.asmx/GetTitleAccessToken2", listOf("ticket" to ticket.ticket, "titleId" to rosId.toString(), "platformId" to "8")) + val token = RockstarRos.text(tokenRoot, "Result")?.takeIf { it.isNotEmpty() } ?: return failure("no-title-token") + val result = JSONObject().put("ok", true).put("expiresAt", System.currentTimeMillis() + 90_000) + if (sdk) { + val session = JSONObject().put("accountId", ticket.rockstarId).put("identity", ticket.email.ifEmpty { ticket.nickname }).put("ticket", ticket.sdkTicket) + if (RockstarLibrary.owns(account, rosId, metadata?.id ?: id)) session.put("titleId", metadata?.id ?: id) + result.put("session", session) + } + if (pipe == null) return result + val hash = MessageDigest.getInstance("SHA-256").digest(RockstarAuth.fingerprint(app).toString().toByteArray()).copyOf(16) + val launch = RockstarRos.result("app.asmx/GetTitleLaunchData", listOf("ticket" to ticket.ticket, "titleAccessToken" to token, + "machineHash" to Base64.getEncoder().encodeToString(hash))) + val encoded = RockstarRos.text(launch, "Data") ?: return failure("no-launch-data") + val iv = RockstarRos.text(launch, "EndpointIV") ?: return failure("no-launch-iv") + val material = RockstarLaunchCipher.decode(encoded, iv) + return result.put("pipe", pipe).put("material", material) + } + + private fun failure(reason: String) = JSONObject().put("ok", false).put("reason", reason) +} diff --git a/app/src/main/java/com/droiddeck/launcher/stores/rockstar/RockstarLaunchCipher.kt b/app/src/main/java/com/droiddeck/launcher/stores/rockstar/RockstarLaunchCipher.kt new file mode 100644 index 0000000000..dd65b40b7c --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/stores/rockstar/RockstarLaunchCipher.kt @@ -0,0 +1,66 @@ +package com.droiddeck.launcher.stores.rockstar + +import java.nio.ByteBuffer +import java.nio.ByteOrder +import java.util.Base64 + +internal object RockstarLaunchCipher { + private val data by lazy { + val bytes = requireNotNull(javaClass.getResourceAsStream("/rockstar/legacy-cipher.bin")).use { it.readBytes() } + require(bytes.size == 86852 && bytes.copyOfRange(0, 8).contentEquals("DDRGLC01".toByteArray())) + bytes + } + private val tables by lazy { + ByteBuffer.wrap(data, 8, 86016).order(ByteOrder.LITTLE_ENDIAN).asIntBuffer().let { buffer -> IntArray(buffer.remaining()).also { buffer.get(it) } } + } + private val order = intArrayOf(0, 7, 10, 13, 1, 4, 11, 14, 2, 5, 8, 15, 3, 6, 9, 12) + + internal fun decrypt(cipher: ByteArray, iv: ByteArray, inner: Boolean): ByteArray { + require(cipher.isNotEmpty() && cipher.size <= 65536 && cipher.size % 16 == 0 && iv.size == 16) + val map = 86024 + val key = map + 272 + if (inner) 272 else 0 + val keys = ByteBuffer.wrap(data, key, 272).order(ByteOrder.LITTLE_ENDIAN).asIntBuffer().let { buffer -> IntArray(68).also { buffer.get(it) } } + val output = ByteArray(cipher.size) + var previous = iv + for (offset in cipher.indices step 16) { + var state = cipher.copyOfRange(offset, offset + 16) + for (round in 0..16) { + val next = ByteBuffer.allocate(16).order(ByteOrder.LITTLE_ENDIAN) + for (column in 0..3) { + var word = keys[round * 4 + column] + for (slot in column * 4 until column * 4 + 4) { + val index = if (round == 0 || round == 1 || round == 16) slot else order[slot] + val table = data[map + round * 16 + index].toInt() and 255 + require(table < 84) + word = word xor tables[table * 256 + (state[index].toInt() and 255)] + } + next.putInt(word) + } + state = next.array() + } + for (i in 0..15) output[offset + i] = (state[i].toInt() xor previous[i].toInt()).toByte() + previous = cipher.copyOfRange(offset, offset + 16) + } + val padding = output.last().toInt() and 255 + require(padding in 1..16 && output.takeLast(padding).all { (it.toInt() and 255) == padding }) + return output.copyOf(output.size - padding) + } + + fun decode(encoded: String, endpointIv: String): String { + require(encoded.length <= 90000 && endpointIv.length <= 32) + val clear = decrypt(Base64.getDecoder().decode(encoded), Base64.getDecoder().decode(endpointIv), false) + require(clear.size > 128) + val xml = clear.copyOf(clear.size - 128).toString(Charsets.UTF_8) + val root = RockstarRos.parse(xml) + require(root.tagName == "EncryptedResponse") + val date = requireNotNull(RockstarRos.text(root, "CreationDate")).toLong() + require(date in 0..0xffffffffL) + val text = requireNotNull(RockstarRos.text(root, "Data")) + require(text.length == 672 && text.all { it.digitToIntOrNull(16) != null }) + val cipher = ByteArray(text.length / 2) { i -> text.substring(i * 2, i * 2 + 2).toInt(16).toByte() } + val iv = ByteBuffer.allocate(16).order(ByteOrder.LITTLE_ENDIAN).put(data, data.size - 12, 12).putInt(date.toInt()).array() + val material = decrypt(cipher, iv, true) + require(material.size == 320) + return material.joinToString("") { "%02X".format(it) } + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/stores/rockstar/RockstarMetadata.kt b/app/src/main/java/com/droiddeck/launcher/stores/rockstar/RockstarMetadata.kt new file mode 100644 index 0000000000..5a7e052946 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/stores/rockstar/RockstarMetadata.kt @@ -0,0 +1,53 @@ +package com.droiddeck.launcher.stores.rockstar + +import org.json.JSONObject +import java.io.File +import java.nio.ByteBuffer +import java.nio.ByteOrder +import java.nio.charset.CodingErrorAction +import javax.crypto.Cipher +import javax.crypto.spec.IvParameterSpec +import javax.crypto.spec.SecretKeySpec + +internal object RockstarMetadata { + data class Title(val id: String, val rosId: Int, val exe: String) + + fun find(folder: File): Title? { + val root = folder.canonicalFile + var level = listOf(root) + repeat(4) { + val entries = level.map { it.listFiles().orEmpty() } + val metadata = entries.flatMap { files -> files.filter { it.name.equals("title.rgl", true) } } + for (file in metadata.filter { it.isFile && !java.nio.file.Files.isSymbolicLink(it.toPath()) && it.canonicalPath.startsWith(root.path + File.separator) }) { + if (file.length() in 112..1_048_576) runCatching { decode(file.readBytes()) }.getOrNull()?.let { + return it.copy(exe = File(file.parentFile, it.exe).relativeTo(root).invariantSeparatorsPath) + } + } + level = entries.flatMap { files -> files.asSequence().filter { + it.isDirectory && !java.nio.file.Files.isSymbolicLink(it.toPath()) && it.canonicalPath.startsWith(root.path + File.separator) + }.take(256).toList() }.take(256) + } + return null + } + + fun decode(bytes: ByteArray): Title? = runCatching { + require(bytes.size in 112..1_048_576 && bytes.copyOfRange(0, 4).contentEquals(byteArrayOf(82, 71, 76, 77))) + val header = ByteBuffer.wrap(bytes).order(ByteOrder.LITTLE_ENDIAN) + require(header.getInt(4) == 1 && header.getInt(8) == bytes.size - 80 && (bytes.size - 80) % 16 == 0) + val cipher = Cipher.getInstance("AES/CBC/NoPadding") + cipher.init(Cipher.DECRYPT_MODE, SecretKeySpec(ByteArray(32), "AES"), IvParameterSpec(bytes.copyOfRange(80, 96))) + val clear = cipher.doFinal(bytes, 96, bytes.size - 96) + val pad = clear.last().toInt() and 255 + val size = if (pad in 1..16 && clear.takeLast(pad).all { (it.toInt() and 255) == pad }) clear.size - pad + else clear.indexOfLast { it != 0.toByte() } + 1 + val text = Charsets.UTF_8.newDecoder().onMalformedInput(CodingErrorAction.REPORT) + .onUnmappableCharacter(CodingErrorAction.REPORT).decode(ByteBuffer.wrap(clear, 0, size)).toString().removePrefix("\uFEFF") + val json = JSONObject(text) + val id = json.getString("titleId") + val rosId = json.get("rosTitleId").toString().takeIf { Regex("[1-9][0-9]{0,4}").matches(it) }?.toInt() ?: return null + val exe = json.getString("principalFileName").replace('\\', '/') + require(Regex("[a-z][a-z0-9_]{0,63}").matches(id) && rosId in 1..65535) + require(exe.isNotEmpty() && !exe.startsWith('/') && ':' !in exe && '\u0000' !in exe && exe.split('/').none { it == ".." }) + Title(id, rosId, exe) + }.getOrNull() +} diff --git a/app/src/main/java/com/droiddeck/launcher/stores/rockstar/RockstarRos.kt b/app/src/main/java/com/droiddeck/launcher/stores/rockstar/RockstarRos.kt new file mode 100644 index 0000000000..88217aed08 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/stores/rockstar/RockstarRos.kt @@ -0,0 +1,96 @@ +package com.droiddeck.launcher.stores.rockstar + +import org.w3c.dom.Element +import java.io.ByteArrayInputStream +import java.net.HttpURLConnection +import java.net.URL +import java.net.URLEncoder +import javax.xml.XMLConstants +import javax.xml.parsers.DocumentBuilderFactory + +internal object RockstarRos { + const val HOST = "https://rgl-prod.ros.rockstargames.com" + const val PUBLIC_HOST = "https://prod.ros.rockstargames.com" + const val SERVICES = "/launcher/11/launcherservices/" + private const val MAX_BYTES = 32 * 1024 * 1024 + + class RosException(message: String, val code: String = "", val status: Int = 0) : Exception(message) + + class Reply(val status: Int, val body: String) + + fun form(fields: List>): String = + fields.joinToString("&") { (k, v) -> "$k=" + URLEncoder.encode(v, "UTF-8") } + + fun call(method: String, fields: List>, host: String = HOST, headers: Map = emptyMap()): Reply { + val c = URL(host + SERVICES + method).openConnection() as HttpURLConnection + c.requestMethod = "POST" + c.connectTimeout = 20_000 + c.readTimeout = 60_000 + c.instanceFollowRedirects = false + c.doOutput = true + c.setRequestProperty("Content-Type", "application/x-www-form-urlencoded; charset=utf-8") + c.setRequestProperty("User-Agent", RockstarAuth.USER_AGENT) + for ((k, v) in headers) c.setRequestProperty(k, v) + try { + c.outputStream.use { it.write(form(fields).toByteArray(Charsets.UTF_8)) } + val status = c.responseCode + val stream = (if (status in 200..299) c.inputStream else c.errorStream) + val bytes = stream?.use { input -> + val out = java.io.ByteArrayOutputStream() + val buf = ByteArray(64 * 1024) + while (true) { + val n = input.read(buf) + if (n < 0) break + out.write(buf, 0, n) + if (out.size() > MAX_BYTES) throw RosException("$method: answer too large", status = status) + } + out.toByteArray() + } ?: ByteArray(0) + return Reply(status, bytes.toString(Charsets.UTF_8)) + } finally { + c.disconnect() + } + } + + fun result(method: String, fields: List>, host: String = HOST, headers: Map = emptyMap()): Element { + val reply = call(method, fields, host, headers) + if (reply.status !in 200..299) throw RosException("$method: HTTP ${reply.status}", status = reply.status) + val root = runCatching { parse(reply.body) }.getOrNull() + ?: throw RosException("$method: HTTP ${reply.status} invalid response", status = reply.status) + if (text(root, "Status") != "1") { + val error = first(root, "Error") + val code = listOfNotNull(error?.getAttribute("Code")?.takeIf { it.isNotEmpty() }, error?.getAttribute("CodeEx")?.takeIf { it.isNotEmpty() }).joinToString("/") + throw RosException("$method: ${code.ifEmpty { "HTTP ${reply.status}" }}", code, reply.status) + } + return root + } + + fun parse(xml: String): Element { + require(!xml.contains(" 0) it.item(0) as Element else null } + + fun all(root: Element, tag: String): List = root.getElementsByTagName(tag).let { l -> (0 until l.length).map { l.item(it) as Element } } + + fun text(root: Element, tag: String): String? = first(root, tag)?.textContent?.trim() + + fun children(parent: Element, tag: String): List { + val out = ArrayList() + var n = parent.firstChild + while (n != null) { + if (n is Element && n.tagName == tag) out += n + n = n.nextSibling + } + return out + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/stores/rockstar/RockstarTitles.kt b/app/src/main/java/com/droiddeck/launcher/stores/rockstar/RockstarTitles.kt new file mode 100644 index 0000000000..bbbc0e69dd --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/stores/rockstar/RockstarTitles.kt @@ -0,0 +1,84 @@ +package com.droiddeck.launcher.stores.rockstar + +import com.droiddeck.launcher.stores.CatalogItem +import com.droiddeck.launcher.stores.Store + +internal data class RockstarTitle( + val id: String, + val rosTitleId: Int, + val name: String, + val exe: String, + val registryKey: String, + val steamAppId: Int, + val released: String, + val platform: String = "pcros", + val description: String = "", + val page: String = "", +) + +internal object RockstarTitles { + private const val ART = "https://cdn.cloudflare.steamstatic.com/steam/apps/" + + val all = listOf( + RockstarTitle("gta5_gen9", 11, "Grand Theft Auto V Enhanced", "GTA5_Enhanced.exe", "Rockstar Games\\GTAV Enhanced", 3240220, "2025-03-04", platform = "pcrosalt", + description = "Story mode and GTA Online with ray-traced visuals, faster loading and DualSense support.", + page = "https://www.rockstargames.com/gta-v"), + RockstarTitle("gta5", 11, "Grand Theft Auto V Legacy", "GTA5.exe", "Rockstar Games\\Grand Theft Auto V", 271590, "2015-04-14", + description = "Three criminals, one city: the original PC release of Grand Theft Auto V.", + page = "https://www.rockstargames.com/gta-v"), + RockstarTitle("rdr2", 13, "Red Dead Redemption 2", "RDR2.exe", "Rockstar Games\\Red Dead Redemption 2", 1174180, "2019-11-05", + description = "Arthur Morgan and the Van der Linde gang on the run at the end of the outlaw era.", + page = "https://www.rockstargames.com/reddeadredemption2"), + RockstarTitle("rdr", 8, "Red Dead Redemption", "RDR.exe", "Rockstar Games\\Red Dead Redemption", 2668510, "2024-10-29", + description = "John Marston's story, with the Undead Nightmare expansion.", + page = "https://www.rockstargames.com/reddeadredemption"), + RockstarTitle("gta4", 1, "Grand Theft Auto IV: The Complete Edition", "GTAIV.exe", "Rockstar Games\\Grand Theft Auto IV", 12210, "2008-12-02", + description = "Niko Bellic's Liberty City, with The Lost and Damned and The Ballad of Gay Tony.", + page = "https://www.rockstargames.com/games/IV"), + RockstarTitle("lanoire", 9, "L.A. Noire", "LANoire.exe", "Rockstar Games\\LANoireMTL", 110800, "2011-11-08", + description = "A detective story in 1947 Los Angeles.", + page = "https://www.rockstargames.com/games/lanoire"), + RockstarTitle("lanoirevr", 24, "L.A. Noire: The VR Case Files", "LANoireVR.exe", "Rockstar Games\\LANoireVR", 722230, "2017-12-15", + description = "Seven cases from L.A. Noire rebuilt for virtual reality."), + RockstarTitle("mp3", 10, "Max Payne 3", "MaxPayne3.exe", "Rockstar Games\\MP3MTL", 204100, "2012-05-29", + description = "Max Payne, years after New York, working private security in Sรฃo Paulo.", + page = "https://www.rockstargames.com/games/maxpayne3"), + RockstarTitle("bully", 23, "Bully: Scholarship Edition", "Bully.exe", "Rockstar Games\\Bully", 12200, "2008-10-21", + description = "Jimmy Hopkins against the bullies, teachers and cliques of Bullworth Academy.", page = "https://www.rockstargames.com/bully"), + RockstarTitle("gta3unreal", 28, "Grand Theft Auto III โ€“ The Definitive Edition", "Gameface\\Binaries\\Win64\\LibertyCity.exe", "Rockstar Games\\GTA III - DE", 1546970, "2021-11-11", + description = "Liberty City, remastered with new lighting, controls and visual detail."), + RockstarTitle("gtavcunreal", 29, "Grand Theft Auto: Vice City โ€“ The Definitive Edition", "Gameface\\Binaries\\Win64\\ViceCity.exe", "Rockstar Games\\GTA Vice City - DE", 1546990, "2021-11-11", + description = "Tommy Vercetti's 1980s Vice City, remastered with new lighting, controls and visual detail."), + RockstarTitle("gtasaunreal", 30, "Grand Theft Auto: San Andreas โ€“ The Definitive Edition", "Gameface\\Binaries\\Win64\\SanAndreas.exe", "Rockstar Games\\GTA San Andreas - DE", 1547000, "2021-11-11", + description = "CJ's return to San Andreas, remastered with new lighting, controls and visual detail."), + RockstarTitle("gtasa", 18, "Grand Theft Auto: San Andreas", "gta_sa.exe", "Rockstar Games\\GTA: San Andreas", 12120, "2005-06-07", + description = "Carl Johnson's return to Los Santos and the state of San Andreas.", page = "https://www.rockstargames.com/games/sanandreas"), + RockstarTitle("gtavc", 27, "Grand Theft Auto: Vice City", "gta-vc.exe", "Rockstar Games\\Grand Theft Auto: Vice City", 12110, "2003-05-12", + description = "Tommy Vercetti's rise through 1980s Vice City.", page = "https://www.rockstargames.com/games/vicecity"), + RockstarTitle("gta3", 26, "Grand Theft Auto III", "gta3.exe", "Rockstar Games\\Grand Theft Auto III", 12100, "2002-05-20", + description = "Claude's revenge in Liberty City, the game that took the series into 3D.", page = "https://www.rockstargames.com/games/grandtheftauto3"), + ) + + private val byId = all.associateBy { it.id } + + private val PARENTS = mapOf( + "rdr2_sp" to "rdr2", "rdr2_rdo" to "rdr2", "rdr2_sp_rgl" to "rdr2", "rdr2_sp_steam" to "rdr2", "rdr2_sp_epic" to "rdr2", + "gtatrilogy" to "gtasaunreal", + ) + + fun forName(name: String): List = + if (name.equals("gtatrilogy", true)) listOf("gta3unreal", "gtavcunreal", "gtasaunreal").mapNotNull { byId[it] } else listOfNotNull(byId(name)) + + fun byId(id: String?): RockstarTitle? = id?.lowercase()?.let { byId[it] ?: byId[PARENTS[it]] } + + fun cover(t: RockstarTitle) = "$ART${t.steamAppId}/library_600x900.jpg" + fun hero(t: RockstarTitle) = "$ART${t.steamAppId}/library_hero.jpg" + fun wide(t: RockstarTitle) = "$ART${t.steamAppId}/header.jpg" + + fun item(t: RockstarTitle, owned: Boolean = false, extra: Map = emptyMap()) = CatalogItem( + store = Store.ROCKSTAR, id = t.id, title = t.name, imageUrl = hero(t), tallImageUrl = cover(t), + storeUrl = t.page.ifEmpty { "https://store.rockstargames.com" }, developer = "Rockstar Games", publisher = "Rockstar Games", + releaseDate = t.released, description = t.description, owned = owned, mature = true, + extra = mapOf("rosTitleId" to t.rosTitleId.toString()) + extra, + ) +} diff --git a/app/src/main/java/com/droiddeck/launcher/stores/ubisoft/UbisoftActivation.kt b/app/src/main/java/com/droiddeck/launcher/stores/ubisoft/UbisoftActivation.kt new file mode 100644 index 0000000000..d11fde4210 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/stores/ubisoft/UbisoftActivation.kt @@ -0,0 +1,74 @@ +package com.droiddeck.launcher.stores.ubisoft + +import android.content.Context +import com.droiddeck.launcher.runtime.LinuxRuntime +import com.droiddeck.launcher.session.SessionState +import com.droiddeck.launcher.stores.StoresState +import org.json.JSONObject +import java.io.File + +/** + * Answers Denuvo activations for a running Ubisoft game. droiddeck-upc.exe writes the challenge + * the game's aux DLL sends to `bridge-/denuvo-.req`; the answer goes to `.rsp`. + */ +object UbisoftActivation { + private const val POLL_MS = 250L + private const val IDLE_MS = 60_000L + private val watching = HashMap() + + fun bridge(context: Context, product: Long) = File(LinuxRuntime.rootDir(context), "root/.cache/droiddeck/ubisoft/bridge-$product") + + /** Starts answering the product's activations; stale requests are cleared before this returns. */ + fun watch(app: Context, product: Long) { + val dir = bridge(app, product) + synchronized(watching) { + val running = watching.containsKey(product) + watching[product] = System.currentTimeMillis() + if (running) return + dir.mkdirs() + dir.listFiles()?.forEach { it.delete() } + } + Thread({ + var idleSince = 0L + while (true) { + runCatching { dir.listFiles { f -> f.name.startsWith("denuvo-") && f.name.endsWith(".req") }?.forEach { answer(app, product, it) } } + .onFailure { StoresState.logLine("Ubisoft: activation for $product: ${it.javaClass.simpleName}") } + val now = System.currentTimeMillis() + if (SessionState.running) idleSince = 0L + else if (idleSince == 0L) idleSince = now + else if (now - idleSince > IDLE_MS) synchronized(watching) { + if (now - (watching[product] ?: 0L) > IDLE_MS) { watching.remove(product); return@Thread } + } + runCatching { Thread.sleep(POLL_MS) } + } + }, "ubisoft-activation-$product").start() + } + + private fun answer(app: Context, product: Long, request: File) { + val challenge = runCatching { request.readBytes() }.getOrNull() ?: return + request.delete() + val reply = File(request.parentFile, request.name.removeSuffix(".req") + ".rsp") + val token = activate(app, product, challenge) + val part = File(reply.path + ".part") + part.writeBytes(token ?: ByteArray(0)) + part.renameTo(reply) + } + + private fun activate(app: Context, product: Long, challenge: ByteArray): ByteArray? { + val s = UbisoftAuth.current(app) ?: return null.also { StoresState.logLine("Ubisoft: activation for $product: signed out") } + val answer = UbisoftNative.call("denuvo", JSONObject().put("ticket", s.ticket).put("sessionId", s.sessionId) + .put("productId", product).put("challenge", hex(challenge))) + answer?.optString("error")?.takeIf { it.isNotEmpty() }?.let { + StoresState.logLine("Ubisoft: activation for $product: $it") + return null + } + val token = answer?.optString("token")?.takeIf { it.isNotEmpty() }?.let(::unhex) + StoresState.logLine("Ubisoft: activation for $product: ${token?.size ?: 0} B game token") + return token + } + + internal fun hex(b: ByteArray): String = b.joinToString("") { "%02x".format(it) } + + internal fun unhex(s: String): ByteArray? = + if (s.length % 2 != 0) null else runCatching { ByteArray(s.length / 2) { s.substring(it * 2, it * 2 + 2).toInt(16).toByte() } }.getOrNull() +} diff --git a/app/src/main/java/com/droiddeck/launcher/stores/ubisoft/UbisoftAuth.kt b/app/src/main/java/com/droiddeck/launcher/stores/ubisoft/UbisoftAuth.kt new file mode 100644 index 0000000000..f1cf2ea84d --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/stores/ubisoft/UbisoftAuth.kt @@ -0,0 +1,176 @@ +package com.droiddeck.launcher.stores.ubisoft + +import android.content.Context +import android.util.Log +import com.droiddeck.launcher.stores.Store +import com.droiddeck.launcher.stores.StoreAccounts +import org.json.JSONArray +import org.json.JSONObject +import java.net.HttpURLConnection +import java.net.URL +import java.net.URLEncoder + +/** UbiServices sessions: a ticket from Ubisoft's own web sign-in, exchanged for a launcher session that remember-me renews. */ +object UbisoftAuth { + private const val TAG = "UbisoftAuth" + const val SESSIONS = "https://public-ubiservices.ubi.com/v3/profiles/sessions" + + /** The web app and genome connect.ubisoft.com's sign-in page accepts. */ + private const val WEB_APP_ID = "f35adcb5-1911-440c-b1c9-48fdc1701c68" + private const val WEB_GENOME_ID = "5b36b900-65d8-47f3-93c8-86bdaa48ab50" + + /** The Ubisoft Connect PC app id; its sessions are accepted by the library GraphQL and Demux. */ + const val APP_ID = "f68a4bb5-608a-4ff2-8123-be8ef797e0a6" + private const val REFRESH_MARGIN_MS = 10 * 60 * 1000L + private val lock = Any() + + class Session( + val ticket: String, + val sessionId: String, + val profileId: String, + val userId: String, + val name: String, + val expiresAt: Long, + val rememberMe: String, + ) + + class Reply(val status: Int, val body: String, val headers: Map) { + val ok get() = status in 200..299 + } + + private val loggedIn = "https://connect.ubisoft.com/logged-in.html?appId=$WEB_APP_ID&lang=en-US&genomeId=$WEB_GENOME_ID" + val loginUrl = "https://connect.ubisoft.com/login?appId=$WEB_APP_ID&genomeId=$WEB_GENOME_ID&lang=en-US&nextUrl=" + URLEncoder.encode(loggedIn, "UTF-8") + val SIGN_IN_URLS = listOf("https://connect.ubisoft.com", "https://account.ubisoft.com", "https://ubisoft.com") + + fun isLoggedInPage(url: String) = url.startsWith("https://connect.ubisoft.com/logged-in.html") + + /** Reads connect.ubisoft.com's stored sign-in; the WebAuth SDK keeps it under keys holding `loginData` and `rememberMe`. */ + const val PAGE_SCRIPT = "(function(){try{var o={};for(var i=0;i = emptyMap()): Reply { + val c = URL(url).openConnection() as HttpURLConnection + c.requestMethod = method + c.connectTimeout = 15_000 + c.readTimeout = 25_000 + c.setRequestProperty("Ubi-AppId", APP_ID) + c.setRequestProperty("Ubi-RequestedPlatformType", "uplay") + c.setRequestProperty("Content-Type", "application/json") + c.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36") + authorization?.let { c.setRequestProperty("Authorization", it) } + sessionId?.let { c.setRequestProperty("Ubi-SessionId", it) } + for ((k, v) in extra) c.setRequestProperty(k, v) + try { + if (body != null) { + c.doOutput = true + c.outputStream.use { it.write(body.toByteArray()) } + } + val status = c.responseCode + val text = (if (status in 200..299) c.inputStream else c.errorStream)?.use { it.readBytes().toString(Charsets.UTF_8) }.orEmpty() + val headers = c.headerFields.filterKeys { it != null }.mapKeys { it.key.lowercase() }.mapValues { it.value.joinToString(",") } + return Reply(status, text, headers) + } finally { + c.disconnect() + } + } + + /** POSTs a session request, replaying it once when UbiServices answers with a challenge. */ + private fun session(authorization: String): Reply { + val body = JSONObject().put("rememberMe", true).toString() + val first = request(SESSIONS, "POST", authorization, body = body) + val challenge = first.headers["ubi-challenge"] ?: return first + return request(SESSIONS, "POST", authorization, body = body, extra = mapOf("Ubi-Challenge" to challenge)) + } + + internal fun parseSession(body: String, rememberFallback: String = ""): Session? { + val o = runCatching { JSONObject(body) }.getOrNull() ?: return null + val ticket = o.optString("ticket").takeIf { it.isNotEmpty() && it != "null" } ?: return null + return Session( + ticket = ticket, + sessionId = o.optString("sessionId"), + profileId = o.optString("profileId"), + userId = o.optString("userId"), + name = o.optString("nameOnPlatform"), + expiresAt = parseTime(o.optString("expiration")), + rememberMe = o.optString("rememberMeTicket").takeIf { it.isNotEmpty() && it != "null" } ?: rememberFallback, + ) + } + + internal fun parseTime(s: String): Long = runCatching { java.time.OffsetDateTime.parse(s).toInstant().toEpochMilli() } + .recoverCatching { java.time.Instant.parse(s).toEpochMilli() }.getOrDefault(System.currentTimeMillis() + 60 * 60 * 1000L) + + /** Values the web sign-in stored, found wherever the SDK nests them. */ + internal fun webValues(dump: String): Map { + val out = HashMap() + fun walk(v: Any?) { + when (v) { + is JSONObject -> v.keys().forEach { k -> + val x = v.opt(k) + if (x is String && x.isNotEmpty() && k !in out) { + val nested = if (x.startsWith("{") || x.startsWith("[")) runCatching { org.json.JSONTokener(x).nextValue() }.getOrNull() else null + if (nested != null) walk(nested) else out[k] = x + } else walk(x) + } + is JSONArray -> for (i in 0 until v.length()) walk(v.opt(i)) + } + } + val top = runCatching { org.json.JSONTokener(dump).nextValue() }.getOrNull() + walk(if (top is String) runCatching { JSONObject(top) }.getOrNull() else top) + return out + } + + /** Turns the page's stored sign-in into a launcher session; returns null on success or a reason. */ + fun completeWebSignIn(context: Context, dump: String): String? { + val web = webValues(dump) + val ticket = web["ticket"] + val remember = web["rememberMeTicket"].orEmpty() + val fresh = when { + ticket != null -> session("ubi_v1 t=$ticket").let { r -> + parseSession(r.body, remember) ?: run { Log.w(TAG, "ticket exchange: ${r.status} ${r.body.take(200)}"); null } + } + else -> null + } ?: remember.takeIf { it.isNotEmpty() }?.let { rm -> parseSession(session("rm_v1 t=$rm").body, rm) } + ?: return "no ticket" + save(context, fresh) + com.droiddeck.launcher.session.SessionFiles.ensureUbisoftService(context) + return null + } + + private fun save(context: Context, s: Session) { + val name = s.name.ifEmpty { profileName(s) } + StoreAccounts.write(context.applicationContext, Store.UBISOFT, JSONObject() + .put("access_token", s.ticket) + .put("session_id", s.sessionId) + .put("profile_id", s.profileId) + .put("user_id", s.userId) + .put("display_name", name) + .put("expires_at", s.expiresAt) + .put("remember_me", s.rememberMe)) + } + + private fun profileName(s: Session): String = runCatching { + JSONObject(request("https://public-ubiservices.ubi.com/v3/profiles/me", authorization = "ubi_v1 t=${s.ticket}", sessionId = s.sessionId).body).optString("nameOnPlatform") + }.getOrDefault("") + + fun load(context: Context): Session? { + val o = StoreAccounts.read(context.applicationContext, Store.UBISOFT) ?: return null + val ticket = o.optString("access_token").takeIf { it.isNotEmpty() } ?: return null + return Session(ticket, o.optString("session_id"), o.optString("profile_id"), o.optString("user_id"), o.optString("display_name"), o.optLong("expires_at"), o.optString("remember_me")) + } + + /** A live session, renewed through remember-me shortly before it expires. */ + fun current(context: Context): Session? = synchronized(lock) { + val s = load(context) ?: return null + if (s.expiresAt - System.currentTimeMillis() > REFRESH_MARGIN_MS || s.rememberMe.isEmpty()) return s + val renewed = runCatching { session("rm_v1 t=${s.rememberMe}") }.getOrNull()?.let { parseSession(it.body, s.rememberMe) } + if (renewed == null) { + Log.w(TAG, "remember-me renewal failed") + return if (s.expiresAt > System.currentTimeMillis()) s else null + } + save(context, Session(renewed.ticket, renewed.sessionId, renewed.profileId.ifEmpty { s.profileId }, renewed.userId.ifEmpty { s.userId }, + renewed.name.ifEmpty { s.name }, renewed.expiresAt, renewed.rememberMe)) + load(context) + } + + fun signOut(context: Context) = synchronized(lock) { StoreAccounts.clear(context.applicationContext, Store.UBISOFT) } +} diff --git a/app/src/main/java/com/droiddeck/launcher/stores/ubisoft/UbisoftBackend.kt b/app/src/main/java/com/droiddeck/launcher/stores/ubisoft/UbisoftBackend.kt new file mode 100644 index 0000000000..5d1a8c31bc --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/stores/ubisoft/UbisoftBackend.kt @@ -0,0 +1,252 @@ +package com.droiddeck.launcher.stores.ubisoft + +import android.content.Context +import android.content.Intent +import android.util.Log +import android.webkit.WebView +import com.droiddeck.launcher.R +import com.droiddeck.launcher.stores.CatalogItem +import com.droiddeck.launcher.stores.InstalledStoreGame +import com.droiddeck.launcher.stores.LoginFlows +import com.droiddeck.launcher.stores.Store +import com.droiddeck.launcher.stores.StoreBackend +import com.droiddeck.launcher.stores.StoreFront +import com.droiddeck.launcher.stores.StoreInstallRoot +import com.droiddeck.launcher.stores.download.DownloadEntry +import com.droiddeck.launcher.stores.download.DownloadQueue +import com.droiddeck.launcher.stores.StoreLoginActivity +import com.droiddeck.launcher.stores.StoresState +import com.droiddeck.launcher.stores.WebCookies +import org.json.JSONObject + +object UbisoftBackend : StoreBackend { + override val store: Store = Store.UBISOFT + + init { + LoginFlows.ubisoftFlow = { ua -> UbisoftLogin(ua) } + } + + override fun signIn(context: Context) { + context.startActivity( + Intent(context, StoreLoginActivity::class.java) + .putExtra(StoreLoginActivity.EXTRA_STORE, store.id) + .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK), + ) + } + + override fun signOut(context: Context) { + UbisoftAuth.signOut(context.applicationContext) + UbisoftLibrary.reset() + runCatching { WebCookies.expire(UbisoftAuth.SIGN_IN_URLS, ".ubisoft.com", listOf("/")) {} } + } + + override fun syncLibrary(context: Context, force: Boolean) { + val app = context.applicationContext + Thread({ UbisoftLibrary.sync(app, force) }, "ubisoft-sync").start() + } + + override fun loadShelves(context: Context, force: Boolean) { + val app = context.applicationContext + val account = UbisoftLibrary.account() + UbisoftStore.cached(app)?.let { s -> StoresState.post { StoresState.shelves[store] = StoreFront.markOwned(s, StoresState.library[store], UbisoftStore::sameGame) } } + Thread({ + val shelves = UbisoftStore.featured(app, force) ?: return@Thread + StoresState.post { if (UbisoftLibrary.account() == account) StoresState.shelves[store] = StoreFront.markOwned(shelves, StoresState.library[store], UbisoftStore::sameGame) } + }, "ubisoft-shelves").start() + } + + override fun search(context: Context, query: String): List = + StoreFront.markOwned(UbisoftStore.search(query), StoresState.library[store], UbisoftStore::sameGame) + + override fun install(context: Context, item: CatalogItem, root: java.io.File) { + val app = context.applicationContext + if (!UbisoftNative.ready()) { + StoresState.logLine(UbisoftNative.ENGINE_MISSING) + StoresState.post { StoresState.problems[store] = UbisoftNative.ENGINE_MISSING } + return + } + val folder = StoreInstallRoot.folderFor(app, store, item.id, item.title, root) + val entry = DownloadEntry(store, item.id, item.title, cover = item.tallImageUrl ?: item.imageUrl, + bytesTotal = item.sizeBytes, location = StoreInstallRoot.labelFor(app, folder)) + DownloadQueue.enqueue(app, entry) { UbisoftInstaller(app, item, folder) } + } + + override fun uninstall(context: Context, game: InstalledStoreGame) {} +} + +internal class UbisoftLogin(override val userAgent: String) : StoreLoginActivity.Flow { + override val startUrl: String get() = UbisoftAuth.loginUrl + override val readsPage: Boolean get() = true + override val pageScript: String get() = UbisoftAuth.PAGE_SCRIPT + override fun pageReady(result: String): Boolean = result.contains("ticket", ignoreCase = true) + override fun isRedirect(url: String): Boolean = UbisoftAuth.isLoggedInPage(url) + + override fun forgetSignIn(done: () -> Unit) { + runCatching { WebCookies.expire(UbisoftAuth.SIGN_IN_URLS, ".ubisoft.com", listOf("/")) { done() } }.onFailure { done() } + } + + override fun finish(activity: StoreLoginActivity, view: WebView, url: String): String? = try { + UbisoftAuth.completeWebSignIn(activity, url)?.let { + Log.w("UbisoftLogin", "sign-in incomplete: $it") + activity.getString(R.string.stores_login_error_verification) + } + } catch (e: Exception) { + Log.w("UbisoftLogin", "sign-in failed: ${e.javaClass.simpleName}") + activity.getString(R.string.stores_login_error_generic) + } +} + +object UbisoftLibrary { + private const val GRAPHQL = "https://public-ubiservices.ubi.com/v1/profiles/me/uplay/graphql" + private const val PAGE = 50 + private const val QUERY = "query OwnedGames(\$limit: Int, \$offset: Int) { viewer { games(limit: \$limit, offset: \$offset) { totalCount nodes { id spaceId name coverUrl backgroundUrl bannerUrl releaseDate } } } }" + private val generation = java.util.concurrent.atomic.AtomicInteger() + private val running = java.util.concurrent.atomic.AtomicReference(null) + + /** Forgets the signed-out account: its sync results are dropped and a new account may sync at once. */ + fun reset() { + generation.incrementAndGet() + StoresState.post { StoresState.shelves.remove(Store.UBISOFT) } + } + + /** Changes on every sign-out, so work begun for the old account can tell. */ + fun account(): Int = generation.get() + + private fun post(gen: Int, block: () -> Unit) = StoresState.post { if (generation.get() == gen) block() } + + internal fun parsePage(body: String): Pair, Int> { + val o = JSONObject(body) + o.optJSONArray("errors")?.optJSONObject(0)?.let { throw IllegalStateException(it.optString("message")) } + val games = o.optJSONObject("data")?.optJSONObject("viewer")?.optJSONObject("games") ?: return emptyList() to 0 + val nodes = games.optJSONArray("nodes") + val items = (0 until (nodes?.length() ?: 0)).mapNotNull { nodes!!.optJSONObject(it) }.mapNotNull { n -> + val space = n.optString("spaceId").takeIf { it.isNotEmpty() } ?: return@mapNotNull null + fun s(k: String) = n.optString(k).takeIf { it.isNotEmpty() && it != "null" } + CatalogItem( + Store.UBISOFT, space, n.optString("name").trim(), s("backgroundUrl") ?: s("bannerUrl"), + tallImageUrl = s("coverUrl"), releaseDate = s("releaseDate")?.take(10).orEmpty(), owned = true, + extra = mapOf("spaceId" to space, "gameId" to n.optString("id")), + ) + } + return items to games.optInt("totalCount", items.size) + } + + private val THIRD_PARTY = Regex("""^\s*third_party_platform:\s*\r?\n\s+name:\s*['"]?([^'"\r\n]+?)['"]?\s*$""", RegexOption.MULTILINE) + + /** The store a product's configuration says delivers it, such as Steam, when not Ubisoft itself. */ + internal fun thirdParty(configuration: String): String? = THIRD_PARTY.find(configuration)?.groupValues?.get(1)?.trim()?.takeIf { it.isNotEmpty() } + + /** + * Owned base games Ubisoft delivers itself, by UbiServices space; add-ons and bundles share spaces with their + * game. A game whose manifest Ubisoft did not send stays: the manifest only names the build to download. + */ + internal fun ownedBySpace(owned: JSONObject?): Map { + val list = owned?.optJSONArray("games") ?: return emptyMap() + val games = (0 until list.length()).mapNotNull { list.optJSONObject(it) } + .filter { it.optInt("productType") == 0 && it.optBoolean("owned", true) && thirdParty(it.optString("configuration")) == null } + .sortedByDescending { it.optString("manifest").isNotEmpty() } + val out = LinkedHashMap() + for (key in listOf("spaceId")) for (g in games) { + val space = g.optString(key).takeIf { it.isNotEmpty() } ?: continue + out.putIfAbsent(space, g) + } + return out + } + + private fun download(o: JSONObject) = listOfNotNull( + "productId" to o.optLong("productId").toString(), + o.optString("manifest").takeIf { it.isNotEmpty() }?.let { "manifest" to it }, + o.optString("appId").takeIf { it.isNotEmpty() }?.let { "appId" to it }, + executable(o.optString("configuration"))?.let { "exe" to it }, + ) + + /** + * Games Connect owns and delivers itself. The profile's game list also names games only played through + * Ubisoft+, free weekends or another store; without an ownership answer that list is all there is. + */ + internal fun assemble(listed: List, owned: JSONObject?): List { + val known = owned?.optJSONArray("games") != null && owned.optString("error").isEmpty() + val bySpace = ownedBySpace(owned) + val matched = listed.map { g -> bySpace[g.id]?.let { g.copy(extra = g.extra + download(it)) } ?: g } + .filter { !known || it.extra["productId"] != null } + .let { games -> games.filter { g -> g.extra["productId"] == null || games.first { it.extra["productId"] == g.extra["productId"] } === g } } + .let { games -> games.filter { g -> g.extra["productId"] != null || games.none { it !== g && it.title == g.title && it.extra["productId"] != null } } } + val products = matched.mapNotNull { it.extra["productId"] }.toSet() + val unlisted = bySpace.filterKeys { space -> listed.none { it.id == space } }.filterValues { it.optLong("productId").toString() !in products }.mapNotNull { (space, o) -> + val title = title(o.optString("configuration")) ?: return@mapNotNull null + CatalogItem(Store.UBISOFT, space, title, null, owned = true, extra = mapOf("spaceId" to space) + download(o)) + } + return (matched + unlisted).sortedBy { it.title.lowercase() } + } + + private val RELATIVE = Regex("""relative:\s*['"]?([^'"\r\n]+?)['"]?\s*$""", RegexOption.MULTILINE) + + private val NAME = Regex("""^\s{1,4}name:\s*['"]?(.+?)['"]?\s*$""", RegexOption.MULTILINE) + + /** The product's name from its configuration, following a localisation key such as `l1` to its default text. */ + internal fun title(configuration: String): String? { + val raw = NAME.find(configuration)?.groupValues?.get(1)?.trim()?.takeIf { it.isNotEmpty() } ?: return null + if (!Regex("""l\d+""").matches(raw)) return raw + val local = configuration.indexOf("localizations:").takeIf { it >= 0 } ?: return raw + return Regex("""^\s+${raw}:\s*['"]?(.+?)['"]?\s*$""", RegexOption.MULTILINE).find(configuration, local)?.groupValues?.get(1)?.trim() ?: raw + } + + /** The first launch path under `start_game` in a product's configuration. */ + internal fun executable(configuration: String): String? { + val start = configuration.indexOf("start_game").takeIf { it >= 0 } ?: return null + return RELATIVE.find(configuration, start)?.groupValues?.get(1)?.trim()?.takeIf { it.endsWith(".exe", true) } + } + + fun sync(app: Context, force: Boolean) { + val gen = generation.get() + if (running.getAndSet(gen) == gen) return + try { + val s = UbisoftAuth.current(app) + if (s == null) { + post(gen) { StoresState.status.remove(Store.UBISOFT); StoresState.problems[Store.UBISOFT] = app.getString(R.string.stores_sync_sign_in) } + return + } + if (StoresState.library[Store.UBISOFT].isNullOrEmpty()) post(gen) { StoresState.status[Store.UBISOFT] = app.getString(R.string.stores_sync_game_list) } + val all = ArrayList() + var offset = 0 + while (true) { + val body = JSONObject().put("operationName", "OwnedGames").put("query", QUERY) + .put("variables", JSONObject().put("limit", PAGE).put("offset", offset)).toString() + val reply = UbisoftAuth.request(GRAPHQL, "POST", "Ubi_v1 t=${s.ticket}", s.sessionId, body) + if (reply.status == 401) StoresState.markSignInExpired(Store.UBISOFT) + if (!reply.ok) throw IllegalStateException("library ${reply.status}") + val (items, total) = parsePage(reply.body) + all += items + offset += PAGE + if (items.isEmpty() || offset >= total) break + } + val owned = UbisoftNative.call("owned", JSONObject().put("ticket", s.ticket).put("sessionId", s.sessionId)) + owned?.optString("error")?.takeIf { it.isNotEmpty() }?.let { StoresState.logLine("Ubisoft: ownership: $it") } + owned?.takeIf { it.optInt("manifestsAsked") > 0 }?.let { + StoresState.logLine("Ubisoft: latest manifests: ${it.optInt("manifestsFound")} of ${it.optInt("manifestsAsked")} ${it.optString("manifestError")}".trim()) + } + val listed = all.distinctBy { it.id } + val games = assemble(listed, owned) + ownedBySpace(owned).values.filter { it.optString("manifest").isEmpty() }.takeIf { it.isNotEmpty() }?.let { bare -> + StoresState.logLine("Ubisoft: owned without a manifest: " + bare.joinToString(", ") { (title(it.optString("configuration")) ?: "?") + "=" + it.optLong("productId") }) + } + StoresState.logLine("Ubisoft: ${ownedBySpace(owned).size} owned products; " + + games.filter { it.extra.containsKey("productId") }.joinToString(", ") { "${it.title}=${it.extra["productId"]}" }) + listed.filter { g -> games.none { it.id == g.id } }.takeIf { it.isNotEmpty() }?.let { left -> + StoresState.logLine("Ubisoft: left out ${left.size} games Connect does not deliver to this account: " + left.joinToString(", ") { it.title }) + } + post(gen) { + StoresState.status.remove(Store.UBISOFT) + StoresState.problems.remove(Store.UBISOFT) + StoresState.library[Store.UBISOFT] = games + StoresState.shelves[Store.UBISOFT]?.let { StoresState.shelves[Store.UBISOFT] = StoreFront.markOwned(it, games, UbisoftStore::sameGame) } + } + StoresState.logLine("Ubisoft: ${games.size} owned games") + } catch (e: Exception) { + StoresState.logLine("Ubisoft: library sync failed: ${e.javaClass.simpleName} ${e.message.orEmpty().take(200)}") + post(gen) { StoresState.status.remove(Store.UBISOFT); StoresState.problems[Store.UBISOFT] = app.getString(R.string.stores_sync_failed) } + } finally { + running.compareAndSet(gen, null) + } + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/stores/ubisoft/UbisoftConnect.kt b/app/src/main/java/com/droiddeck/launcher/stores/ubisoft/UbisoftConnect.kt new file mode 100644 index 0000000000..23cc92cd20 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/stores/ubisoft/UbisoftConnect.kt @@ -0,0 +1,18 @@ +package com.droiddeck.launcher.stores.ubisoft + +import android.content.Context +import com.droiddeck.launcher.frontend.AddedGames +import com.droiddeck.launcher.runtime.LinuxRuntime +import java.io.File + +/** The one prefix every Ubisoft game runs in, so Ubisoft Connect is installed and signed in once. */ +object UbisoftConnect { + const val APP_ID = 2929927072L + + fun prefix(context: Context) = File(LinuxRuntime.rootDir(context), "root/.local/share/Steam/steamapps/compatdata/$APP_ID") + + fun installed(context: Context) = File(prefix(context), "pfx/drive_c/Program Files (x86)/Ubisoft/Ubisoft Game Launcher/upc.exe").isFile + + fun launchOptions(context: Context): String = + AddedGames.guestPath(context, prefix(context))?.let { "STEAM_COMPAT_DATA_PATH=$it %command%" }.orEmpty() +} diff --git a/app/src/main/java/com/droiddeck/launcher/stores/ubisoft/UbisoftInstaller.kt b/app/src/main/java/com/droiddeck/launcher/stores/ubisoft/UbisoftInstaller.kt new file mode 100644 index 0000000000..1bf4c4e360 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/stores/ubisoft/UbisoftInstaller.kt @@ -0,0 +1,104 @@ +package com.droiddeck.launcher.stores.ubisoft + +import android.content.Context +import com.droiddeck.launcher.R +import com.droiddeck.launcher.stores.CatalogItem +import com.droiddeck.launcher.stores.Store +import com.droiddeck.launcher.stores.StoreExe +import com.droiddeck.launcher.stores.StoreGameSidecar +import com.droiddeck.launcher.stores.StoreInstalls +import com.droiddeck.launcher.stores.StoreLanguage +import com.droiddeck.launcher.stores.amazon.AmazonNative +import com.droiddeck.launcher.stores.download.DownloadQueue +import com.droiddeck.launcher.stores.download.DownloadStage +import org.json.JSONObject +import java.io.File +import java.util.concurrent.atomic.AtomicBoolean +import java.util.concurrent.atomic.AtomicLong + +internal class UbisoftInstaller( + private val app: Context, + private val item: CatalogItem, + private val folder: File, +) : DownloadQueue.DownloadJob { + private val cancelled = AtomicBoolean(false) + + override fun run(handle: DownloadQueue.JobHandle): String? { + handle.stage(DownloadStage.MANIFEST, app.getString(R.string.stores_sync_sign_in)) + val s = UbisoftAuth.current(app) ?: throw IllegalStateException("Not signed in to Ubisoft") + val product = item.extra["productId"]?.toLongOrNull() ?: throw IllegalStateException("Ubisoft lists no download for ${item.title} on this account") + val cover = item.tallImageUrl ?: item.imageUrl + StoreInstalls.begin(folder, Store.UBISOFT, item.id, item.title, cover, item.imageUrl) + if (cancelled.get()) return null + val locale = StoreLanguage.localeFor(null, app) + val request = JSONObject() + .put("ticket", s.ticket) + .put("sessionId", s.sessionId) + .put("productId", product) + .put("manifest", item.extra["manifest"].orEmpty()) + .put("folder", folder.absolutePath) + .put("language", "${locale.language}-${locale.country}") + val shown = AtomicLong(-1) + val downloading = AtomicBoolean(false) + val listener = object : AmazonNative.InstallListener { + override fun onStatus(text: String) { handle.stage(DownloadStage.MANIFEST, text) } + override fun onCheck(doneBytes: Long, totalBytes: Long, files: Int, filesTotal: Int) { + handle.stageProgress(doneBytes, totalBytes, files, filesTotal, bytes = true) + } + override fun onSizes(pendingBytes: Long, totalBytes: Long) { handle.diskSize(totalBytes) } + override fun onProgress(done: Long, total: Long, files: Int, filesTotal: Int) { + if (downloading.compareAndSet(false, true)) handle.stage(DownloadStage.DOWNLOAD) + while (true) { + val before = shown.get() + if (done < before) return + if (shown.compareAndSet(before, done)) break + } + handle.progress(done, total, "Downloading ($files/$filesTotal files)") + } + override fun onLog(line: String) { handle.log(line) } + override fun beforeReplace(): Boolean = true + override fun onComplete(success: Boolean, cancelled: Boolean, error: String, result: String) = Unit + } + val outcome = UbisoftNative.install(request, listener, cancelled) + if (outcome.cancelled || cancelled.get() && !outcome.success) return null + if (!outcome.success) throw IllegalStateException(outcome.error.ifEmpty { "The Ubisoft install failed" }) + + handle.stage(DownloadStage.INSTALL, app.getString(R.string.stores_registering)) + val configured = resolve(folder, item.extra["exe"].orEmpty()) + val exe = configured ?: StoreExe.pick(folder, null, item.title).ifEmpty { "game.exe" } + handle.log("ubisoft: exe=$exe") + val sidecar = StoreGameSidecar( + Store.UBISOFT, item.id, item.title, exe = exe, + installVersion = item.extra["manifest"].orEmpty(), installedAt = System.currentTimeMillis(), + cover = cover, hero = item.imageUrl, cloud = false, + extra = item.extra.filterKeys { it in KEPT } + listOfNotNull( + outcome.result?.optJSONArray("chunks")?.let { UbisoftLaunch.CHUNKS to it.toString() }, + outcome.result?.optJSONObject("setup")?.let { UbisoftLaunch.SETUP to it.toString() }, + ), + ) + StoreInstalls.complete(app, folder, sidecar, onStep = { done, steps -> handle.stageProgress(done.toLong(), steps.toLong()) }) + return folder.path + } + + override fun cancel(deleteFiles: Boolean) { + cancelled.set(true) + if (deleteFiles) StoreInstalls.discard(app, folder, emptyList()) + } + + internal companion object { + val KEPT = setOf("productId", "spaceId", "manifest", "appId") + + /** A configured exe the way Windows finds it: any letter case, else the same file name anywhere in the install. */ + fun resolve(folder: File, configured: String): String? { + val rel = configured.replace('\\', '/').trimStart('/').takeIf { it.isNotEmpty() } ?: return null + var at = folder + for (part in rel.split('/')) { + at = at.listFiles()?.firstOrNull { it.name.equals(part, ignoreCase = true) } ?: return byName(folder, rel.substringAfterLast('/')) + } + return if (at.isFile) at.relativeTo(folder).invariantSeparatorsPath else byName(folder, rel.substringAfterLast('/')) + } + + private fun byName(folder: File, name: String): String? = + folder.walkTopDown().maxDepth(5).firstOrNull { it.isFile && it.name.equals(name, ignoreCase = true) }?.relativeTo(folder)?.invariantSeparatorsPath + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/stores/ubisoft/UbisoftLaunch.kt b/app/src/main/java/com/droiddeck/launcher/stores/ubisoft/UbisoftLaunch.kt new file mode 100644 index 0000000000..279d3b3e43 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/stores/ubisoft/UbisoftLaunch.kt @@ -0,0 +1,86 @@ +package com.droiddeck.launcher.stores.ubisoft + +import android.content.Context +import com.droiddeck.launcher.stores.StoreInstallRoot +import com.droiddeck.launcher.stores.Store +import com.droiddeck.launcher.stores.StoreGameSidecar +import com.droiddeck.launcher.stores.StoresState +import org.json.JSONArray +import org.json.JSONObject + +/** What the launcher service hands a starting Ubisoft game: the account, its products and a fresh game ticket. */ +object UbisoftLaunch { + private const val ENTITLEMENTS = "https://public-ubiservices.ubi.com/v1/profiles/me/global/ubiconnect/entitlement/api/entitlements" + private const val ME = "https://public-ubiservices.ubi.com/v3/users/me" + + fun prepare(app: Context, id: String): JSONObject { + val folder = StoreInstallRoot.gameFolders(app).firstOrNull { f -> + StoreGameSidecar.read(f)?.let { it.store == Store.UBISOFT && it.id == id } == true + } ?: return failure("not-installed") + val sidecar = StoreGameSidecar.read(folder) ?: return failure("not-installed") + val product = sidecar.extra["productId"]?.toLongOrNull() ?: return failure("no-product") + val s = UbisoftAuth.current(app) ?: return failure("signed-out") + val native = UbisoftNative.call("launch", JSONObject().put("ticket", s.ticket).put("sessionId", s.sessionId).put("productId", product)) + ?: return failure("engine-missing") + native.optString("error").takeIf { it.isNotEmpty() }?.let { + StoresState.logLine("Ubisoft: launch ticket for $product: $it") + return failure("ticket: $it") + } + val auth = "Ubi_v1 t=${s.ticket}" + val me = runCatching { UbisoftAuth.request(ME, "GET", auth, s.sessionId) }.getOrNull()?.takeIf { it.ok } + ?.let { runCatching { JSONObject(it.body) }.getOrNull() } + val account = JSONObject() + .put("userId", s.userId) + .put("username", me?.optString("username")?.takeIf { it.isNotEmpty() } ?: s.name) + .put("nameOnPlatform", me?.optString("nameOnPlatform")?.takeIf { it.isNotEmpty() } ?: s.name) + .put("email", me?.optString("email").orEmpty()) + .put("country", me?.optString("country")?.takeIf { it.isNotEmpty() } ?: "US") + val appId = runCatching { UbisoftAuth.request(ENTITLEMENTS, "GET", auth, s.sessionId) }.getOrNull()?.takeIf { it.ok } + ?.let { applicationId(it.body, product) } ?: sidecar.extra["appId"].orEmpty() + StoresState.logLine("Ubisoft: launch ticket for $product ready (${native.optJSONArray("owned")?.length() ?: 0} products, appId ${if (appId.isEmpty()) "unknown" else "found"})") + val language = com.droiddeck.launcher.stores.StoreLanguage.localeFor(null, app).let { "${it.language}-${it.country}" } + val cached = sidecar.extra[CHUNKS]?.let { runCatching { JSONArray(it) }.getOrNull() } + var setup = sidecar.extra[SETUP]?.let { runCatching { JSONObject(it) }.getOrNull() } + val chunks = if (cached != null && setup != null) cached else + UbisoftNative.call("chunks", JSONObject().put("ticket", s.ticket).put("sessionId", s.sessionId).put("productId", product) + .put("manifest", sidecar.extra["manifest"] ?: sidecar.installVersion).put("folder", folder.path).put("language", language)) + ?.let { r -> + r.optString("error").takeIf { it.isNotEmpty() }?.let { StoresState.logLine("Ubisoft: manifest for $product: $it") } + setup = r.optJSONObject("setup") + r.optJSONArray("chunks") + }?.also { c -> + runCatching { + StoreGameSidecar.read(folder)?.let { sc -> + sc.copy(extra = sc.extra + (CHUNKS to c.toString()) + listOfNotNull(setup?.let { SETUP to it.toString() })).write(folder) + } + com.droiddeck.launcher.stores.StoreLaunch.installedGame(app, Store.UBISOFT, id) + ?.let { com.droiddeck.launcher.frontend.AutoComponents.refreshLater(app, it) } + } + } ?: cached + setup?.let { StoresState.logLine("Ubisoft: setup for $product: ${it.toString().take(1500)}") } + UbisoftActivation.watch(app, product) + return JSONObject().put("ok", true) + .put("productId", product) + .put("ticket", native.optString("ticket")) + .put("owned", native.optJSONArray("owned") ?: JSONArray()) + .put("products", native.optJSONArray("products") ?: JSONArray()) + .put("account", account) + .put("appId", appId) + .put("language", language) + .put("chunks", chunks ?: JSONArray()) + .put("registry", setup?.optJSONArray("registry") ?: JSONArray()) + } + + const val CHUNKS = "chunks" + const val SETUP = "setup" + + /** The entitlement's `applicationId` for the product; the list sits under one of a few keys depending on the API version. */ + internal fun applicationId(body: String, product: Long): String? { + val root = runCatching { JSONObject(body) }.getOrNull() ?: return null + val list = sequenceOf("items", "entitlements", "products", "games", "results").firstNotNullOfOrNull { root.optJSONArray(it) } ?: return null + return (0 until list.length()).mapNotNull { list.optJSONObject(it) } + .firstOrNull { it.optLong("productId") == product }?.optString("applicationId")?.takeIf { it.isNotEmpty() } + } + + private fun failure(reason: String) = JSONObject().put("ok", false).put("reason", reason) +} diff --git a/app/src/main/java/com/droiddeck/launcher/stores/ubisoft/UbisoftNative.kt b/app/src/main/java/com/droiddeck/launcher/stores/ubisoft/UbisoftNative.kt new file mode 100644 index 0000000000..7a7d2eb881 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/stores/ubisoft/UbisoftNative.kt @@ -0,0 +1,57 @@ +package com.droiddeck.launcher.stores.ubisoft + +import android.util.Log +import com.droiddeck.launcher.stores.StoresNative +import com.droiddeck.launcher.stores.amazon.AmazonNative +import org.json.JSONObject +import java.util.concurrent.CountDownLatch +import java.util.concurrent.TimeUnit +import java.util.concurrent.atomic.AtomicBoolean + +object UbisoftNative { + private const val TAG = "UbisoftNative" + const val ENGINE_MISSING = "Ubisoft: the store engine is not available" + + fun ready(): Boolean = StoresNative.ensureLoaded() + + fun call(op: String, request: JSONObject): JSONObject? { + if (!ready()) return null + val text = try { nativeCall(op, request.toString()) } catch (t: Throwable) { + Log.w(TAG, "$op: ${t.javaClass.simpleName}") + null + } ?: return null + return runCatching { JSONObject(text) }.getOrNull() + } + + fun install(request: JSONObject, events: AmazonNative.InstallListener, cancelled: AtomicBoolean): AmazonNative.InstallOutcome { + if (!ready()) return AmazonNative.InstallOutcome(false, false, ENGINE_MISSING, null) + val done = CountDownLatch(1) + val holder = arrayOfNulls(1) + val bridge = object : AmazonNative.InstallListener by events { + override fun onComplete(success: Boolean, cancelled: Boolean, error: String, result: String) { + holder[0] = AmazonNative.InstallOutcome(success, cancelled, error, result.takeIf { it.isNotEmpty() }?.let { runCatching { JSONObject(it) }.getOrNull() }) + done.countDown() + } + } + val handle = try { nativeInstall(request.toString(), bridge) } catch (t: Throwable) { + return AmazonNative.InstallOutcome(false, false, "The Ubisoft install could not start: ${t.javaClass.simpleName}", null) + } + if (handle == 0L) return holder[0] ?: AmazonNative.InstallOutcome(false, false, "The Ubisoft install could not start", null) + try { + var forwarded = false + while (true) { + val finished = try { done.await(250, TimeUnit.MILLISECONDS) } catch (e: InterruptedException) { cancelled.set(true); false } + if (finished) break + if (!forwarded && cancelled.get()) { nativeCancel(handle); forwarded = true } + } + } finally { + nativeRelease(handle) + } + return holder[0] ?: AmazonNative.InstallOutcome(false, false, "The Ubisoft install ended without a result", null) + } + + @JvmStatic private external fun nativeCall(op: String, request: String): String? + @JvmStatic private external fun nativeInstall(request: String, listener: AmazonNative.InstallListener): Long + @JvmStatic private external fun nativeCancel(handle: Long) + @JvmStatic private external fun nativeRelease(handle: Long) +} diff --git a/app/src/main/java/com/droiddeck/launcher/stores/ubisoft/UbisoftStore.kt b/app/src/main/java/com/droiddeck/launcher/stores/ubisoft/UbisoftStore.kt new file mode 100644 index 0000000000..13edb2084f --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/stores/ubisoft/UbisoftStore.kt @@ -0,0 +1,129 @@ +package com.droiddeck.launcher.stores.ubisoft + +import android.content.Context +import android.net.Uri +import com.droiddeck.launcher.stores.CatalogItem +import com.droiddeck.launcher.stores.Store +import com.droiddeck.launcher.stores.StoreFront +import com.droiddeck.launcher.stores.StoreNet +import com.droiddeck.launcher.stores.StoreShelves +import com.droiddeck.launcher.stores.cleanStoreText +import com.droiddeck.launcher.stores.matureByAge +import org.json.JSONArray +import org.json.JSONObject +import java.text.NumberFormat +import java.time.Instant +import java.util.Currency +import java.util.Locale + +/** Ubisoft's PC catalog, from the product search the Ubisoft Store website uses. */ +object UbisoftStore { + /** The Ubisoft Store website's own read-only search key, sent by every store page. */ + private const val APP = "XELY3U4LOD" + private const val KEY = "5638539fd9edb8f2c6b024b49ec375bd" + private const val SHELF = 24 + private val RATING_AGE = mapOf("esrb-m" to 17, "esrb-ao" to 18, "pegi-18" to 18, "pegi-16" to 16, "usk-18" to 18) + + /** The store sites with an English catalog: site, index locale, currency. */ + private val SITES = mapOf( + "US" to Triple("us", "en_US", "USD"), "GB" to Triple("uk", "en_GB", "GBP"), + "CA" to Triple("ca", "en_CA", "CAD"), "AU" to Triple("anz", "en_AU", "AUD"), "NZ" to Triple("anz", "en_AU", "NZD"), + ) + + private fun site() = SITES[Locale.getDefault().country.uppercase(Locale.ROOT)] ?: SITES.getValue("US") + + private fun index(site: Triple, order: String) = "production__${site.first}_ubisoft__products__${site.second}__$order" + + private val fronts = HashMap, StoreFront>() + + /** Each store site keeps its own shelves, so a region change never shows another region's prices. */ + private fun front(context: Context): StoreFront = synchronized(fronts) { + val site = site() + fronts.getOrPut(site) { + StoreFront(Store.UBISOFT, { context.applicationContext.getSharedPreferences("stores.ubisoft", Context.MODE_PRIVATE) }, + { fetch(site) }, key = "store_front_${site.first}_${site.third}") + } + } + + fun cached(context: Context): StoreShelves? = front(context).cached() + + fun featured(context: Context, force: Boolean): StoreShelves? = front(context).shelves(force) + + fun search(query: String): List { + val term = query.trim() + if (term.length < 2) return emptyList() + return query(site(), "best_sellers", 40, query = term).orEmpty() + } + + /** Whether a store card and a library entry are the same game. */ + fun sameGame(shelf: CatalogItem, owned: CatalogItem): Boolean { + val product = shelf.extra["productId"].orEmpty() + if (product.isNotEmpty() && product == owned.extra["productId"]) return true + val key = StoreFront.titleKey(owned.title) + return key.isNotEmpty() && key == baseTitle(shelf.title) + } + + /** A product title without its edition, so "Far Cryยฎ 6 - Gold Edition" is "far cry 6". */ + internal fun baseTitle(title: String): String = StoreFront.titleKey(title.substringBefore(" - ")) + + /** One page of the index, or null when Ubisoft did not answer. */ + private fun query(site: Triple, order: String, hits: Int, query: String = "", filters: String = "", facets: List = emptyList()): List? { + val facetFilters = JSONArray().put("product_type:Games").put("Platform:PC (Digital)").apply { facets.forEach { put(it) } } + val url = Uri.parse("https://$APP-dsn.algolia.net/1/indexes/${index(site, order)}").buildUpon() + .appendQueryParameter("query", query) + .appendQueryParameter("hitsPerPage", (hits * 2).toString()) + .appendQueryParameter("facetFilters", facetFilters.toString()) + .apply { if (filters.isNotEmpty()) appendQueryParameter("filters", filters) } + .build().toString() + val body = StoreNet.get(url, headers = mapOf("X-Algolia-Application-Id" to APP, "X-Algolia-API-Key" to KEY)) ?: return null + return parse(JSONObject(body), site.third).take(hits) + } + + internal fun parse(answer: JSONObject, currency: String, now: Instant = Instant.now()): List { + val hits = answer.optJSONArray("hits") ?: return emptyList() + val items = (0 until hits.length()).mapNotNull { hits.optJSONObject(it) }.mapNotNull { item(it, currency, now) } + return items.groupBy { baseTitle(it.title) }.values.map { editions -> editions.firstOrNull { " - " !in it.title } ?: editions.first() } + } + + private fun money(amount: Double, currency: String): String = NumberFormat.getCurrencyInstance(Locale.US).apply { + this.currency = Currency.getInstance(currency) + }.format(amount) + + internal fun item(h: JSONObject, currency: String, now: Instant): CatalogItem? { + fun s(k: String) = h.optString(k).takeIf { it.isNotBlank() && it != "null" } + val id = s("objectID") ?: s("id") ?: return null + val title = s("title") ?: s("name") ?: return null + if (s("Free_offer") == "demo") return null + val price = h.optJSONObject("price")?.optDouble(currency)?.takeUnless { it.isNaN() } + val base = h.optJSONObject("default_price")?.optDouble(currency)?.takeUnless { it.isNaN() } + val discount = s("promotion_percentage")?.toDoubleOrNull()?.toInt() ?: 0 + val released = s("release_date")?.let { runCatching { Instant.parse(it) }.getOrNull() } + if (released != null && released.isAfter(now) && s("preorder") != "true") return null + val free = s("Free_offer") == "freeplay" || price == 0.0 + val image = s("image_link")?.substringBefore("?") + return CatalogItem( + store = Store.UBISOFT, id = "ubisoft-store:$id", title = title.trim(), + imageUrl = image, tallImageUrl = image, tags = listOfNotNull(s("Genre"), s("Edition")).joinToString(", "), + isFree = free, hasPrice = price != null, finalPrice = price?.let { money(it, currency) }.orEmpty(), + originalPrice = if (discount > 0 && base != null) money(base, currency) else "", discountPercent = if (discount > 0 && base != null) discount else 0, + storeUrl = s("link") ?: s("linkWeb").orEmpty(), publisher = "Ubisoft", releaseDate = released?.toString()?.take(10).orEmpty(), + description = cleanStoreText(s("longDescription")), + mature = s("adult").equals("TRUE", true) || matureByAge(listOfNotNull(s("Rating")?.let(RATING_AGE::get))), + extra = buildMap { + s("productLauncherIDString")?.let { put("productId", it) } + if (s("partOfUbisoftPlus").equals("true", true)) put("ubisoftPlus", "true") + }, + ) + } + + /** All four rows, or a failure when any of them failed, so a partial refresh never replaces a good one. */ + private fun fetch(site: Triple): StoreFront.Catalog { + fun row(order: String, filters: String = "", facets: List = emptyList()) = + query(site, order, SHELF, filters = filters, facets = facets) ?: throw java.io.IOException("Ubisoft store $order $filters$facets failed") + val trending = row("best_sellers") + val newest = row("release_date") + val deals = row("best_sellers", filters = "promotion_percentage > 0") + val free = row("best_sellers", facets = listOf("Free_offer:freeplay")) + return StoreFront.Catalog(StoreShelves(whatsNew = newest, deals = deals, free = free, trending = trending, art = trending.mapNotNull { it.imageUrl })) + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/stores/xbox/XboxCredentials.kt b/app/src/main/java/com/droiddeck/launcher/stores/xbox/XboxCredentials.kt index c8b126519f..59403dac0f 100644 --- a/app/src/main/java/com/droiddeck/launcher/stores/xbox/XboxCredentials.kt +++ b/app/src/main/java/com/droiddeck/launcher/stores/xbox/XboxCredentials.kt @@ -64,15 +64,32 @@ internal class XboxCredentials(private val app: Context, expectedGeneration: Str if (root <= 0 || pid <= 0) return null val status = java.io.File("/proc/$pid/status").readLines() val tracer = status.first { it.startsWith("TracerPid:") }.substringAfter(':').trim().toInt() - val tracerGroup = java.io.File("/proc/$tracer/status").readLines() - .first { it.startsWith("Tgid:") }.substringAfter(':').trim().toInt() - if (tracerGroup != root) return null + if (tracer != 0) { + // under proot, every guest process is traced by the proot the app started + val tracerGroup = java.io.File("/proc/$tracer/status").readLines() + .first { it.startsWith("Tgid:") }.substringAfter(':').trim().toInt() + if (tracerGroup != root) return null + } else if (!descendsFrom(pid, root)) { + // without proot, the process the app started is the backend itself (or its parent) + return null + } val executable = android.system.Os.stat(binary.path) if (!mapsBackend(java.io.File("/proc/$pid/maps").readText(), binary.path, executable.st_ino)) return null return java.io.File("/proc/$pid/stat").readText().substringAfterLast(") ").split(' ')[19] + ":${executable.st_dev}:${executable.st_ino}" } + private fun descendsFrom(pid: Int, root: Int): Boolean { + var current = pid + repeat(32) { + if (current == root) return true + if (current <= 1) return false + current = java.io.File("/proc/$current/status").readLines() + .firstOrNull { it.startsWith("PPid:") }?.substringAfter(':')?.trim()?.toIntOrNull() ?: return false + } + return false + } + fun signalBackend(signal: Int) { val process = backend ?: return if (!process.isAlive) return diff --git a/app/src/main/java/com/droiddeck/launcher/stores/xbox/Xodus.kt b/app/src/main/java/com/droiddeck/launcher/stores/xbox/Xodus.kt index f803d06416..f27794d1b5 100644 --- a/app/src/main/java/com/droiddeck/launcher/stores/xbox/Xodus.kt +++ b/app/src/main/java/com/droiddeck/launcher/stores/xbox/Xodus.kt @@ -88,7 +88,8 @@ internal object Xodus { 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 && + val native = com.droiddeck.launcher.runtime.NativeGuest.forSession(app) + val fastPathKey = if (!native && 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", @@ -98,12 +99,12 @@ internal object Xodus { 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)) + val builder = if (native) com.droiddeck.launcher.runtime.NativeGuest.processBuilder(app, root, binds, guestCommand) + else ProcessBuilder(LinuxRuntime.commandWithBinds(app, root, binds, guestCommand)).directory(LinuxRuntime.rootDir(app)) if (launchDirectory != null) builder.environment()["TMPDIR"] = launchDirectory.path builder.environment()["DROIDDECK_XBOX_CREDENTIAL_PORT"] = credentials.port.toString() builder.environment()["DROIDDECK_XBOX_CREDENTIAL_KEY"] = credentials.key - builder.environment().apply { + if (!native) builder.environment().apply { remove("LD_PRELOAD"); remove("LD_AUDIT"); remove("LD_LIBRARY_PATH") put("PROOT_LOADER", LinuxRuntime.prootLoader(app).path) put("PROOT_TMP_DIR", LinuxRuntime.prootTempDir(app).path) diff --git a/app/src/main/java/com/droiddeck/launcher/ui/AddAppDialog.kt b/app/src/main/java/com/droiddeck/launcher/ui/AddAppDialog.kt index 8e7aaf9966..3acc241b17 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/AddAppDialog.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/AddAppDialog.kt @@ -301,6 +301,9 @@ internal fun rememberShown(onDismiss: () -> Unit): MutableTransitionState, close: () -> Unit, label: String, wide: Boolean, @@ -309,17 +312,23 @@ internal fun AppDialog( back: (() -> Unit)? = null, scrollable: Boolean = true, scrollState: androidx.compose.foundation.ScrollState = rememberScrollState(), + side: (@Composable () -> Unit)? = null, + sideRoom: Dp = 0.dp, content: @Composable ColumnScope.() -> Unit, ) { val pal = LocalPalette.current + val panelCap = maxWidth ?: if (wide) 860.dp else 560.dp VeilRing() Dialog(onDismissRequest = back ?: close, properties = DialogProperties(usePlatformDefaultWidth = false, decorFitsSystemWindows = false)) { CompositionLocalProvider(LocalFrontFocus provides null) { - Box( + BoxWithConstraints( contentAlignment = Alignment.Center, modifier = Modifier.fillMaxSize().imePadding() .tapOutside(close), ) { + val panel = (this.maxWidth - DIALOG_MARGIN * 2).coerceAtMost(panelCap) + val free = (this.maxWidth - panel) / 2 - SIDE_GAP + val beside = side != null && free >= sideRoom AnimatedVisibility( visibleState = shown, enter = fadeIn(Motion.tw(180)) + scaleIn(Motion.sp(0.7f), initialScale = 0.94f), @@ -329,8 +338,8 @@ internal fun AppDialog( Column( verticalArrangement = Arrangement.spacedBy(14.dp), modifier = Modifier - .padding(12.dp) - .widthIn(max = maxWidth ?: if (wide) 860.dp else 560.dp) + .padding(DIALOG_MARGIN) + .widthIn(max = panelCap) .then( when { width != null -> Modifier.width(width) @@ -348,8 +357,21 @@ internal fun AppDialog( .then(modifier) .then(if (scrollable) Modifier.verticalScroll(scrollState) else Modifier) .padding(horizontal = 18.dp, vertical = 16.dp), - content = content, - ) + ) { + content() + if (side != null && !beside) side() + } + } + if (side != null && beside) { + AnimatedVisibility( + visibleState = shown, + enter = fadeIn(Motion.tw(180)), + exit = fadeOut(Motion.tw(140)), + modifier = Modifier.align(Alignment.CenterEnd).padding(end = SIDE_GAP), + label = "$label-side", + ) { + Box(Modifier.widthIn(max = free).blockTouches()) { side() } + } } } } diff --git a/app/src/main/java/com/droiddeck/launcher/ui/AddedGameEditor.kt b/app/src/main/java/com/droiddeck/launcher/ui/AddedGameEditor.kt index 89e1480869..a1b205e64a 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/AddedGameEditor.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/AddedGameEditor.kt @@ -70,6 +70,7 @@ import com.droiddeck.launcher.frontend.AddedGameArt import com.droiddeck.launcher.frontend.AddedGameEdits import com.droiddeck.launcher.frontend.AddedGames import com.droiddeck.launcher.frontend.LogoPosition +import com.droiddeck.launcher.frontend.SoundtrackCollectionArt import com.droiddeck.launcher.frontend.SteamGameArt import com.droiddeck.launcher.frontend.SteamGridDb import com.droiddeck.launcher.frontend.SteamLaunchOptions @@ -179,6 +180,16 @@ internal class ArtTarget( { c, value -> AddedGameEdits.setLogoPosition(c, game.folder.path, value) }, ) + fun ofCollection(id: Int, name: String, root: java.io.File? = null) = ArtTarget( + name, + { c, _ -> SoundtrackCollectionArt.source(c, id) }, + { c, _ -> AddedGameArt.Choices(SoundtrackCollectionArt.options(c, id, root), SteamGridDb.Status.OK) }, + { c, _, option -> SoundtrackCollectionArt.choose(c, id, option) }, + { c, _ -> SoundtrackCollectionArt.reset(c, id) }, + { _ -> null }, + { _, _ -> false }, + ) + fun of(game: com.droiddeck.launcher.frontend.Library.SteamGame) = ArtTarget( game.name, { c, slot -> SteamGameArt.chosenSource(c, game.appId, slot).second }, @@ -199,6 +210,12 @@ internal fun SteamGameArtEditor( ArtOnlyEditor(game.name, target, game, { SteamGameArt.describe(it, game) }, onClose, onChanged) } +@Composable +internal fun CollectionArtEditor(id: Int, name: String, root: java.io.File? = null, onClose: () -> Unit, onChanged: () -> Unit) { + val target = remember(id, root) { ArtTarget.ofCollection(id, name, root) } + ArtOnlyEditor(name, target, id, { SoundtrackCollectionArt.describe(it, id, root) }, onClose, onChanged, listOf(AddedGameArt.Slot.COVER)) +} + @Composable internal fun StoreGameArtEditor(folder: String, name: String, onClose: () -> Unit, onChanged: () -> Unit) { val app = LocalContext.current.applicationContext @@ -212,7 +229,7 @@ internal fun StoreGameArtEditor(folder: String, name: String, onClose: () -> Uni @Composable private fun ArtOnlyEditor( name: String, target: ArtTarget?, refresh: Any?, describe: (Context) -> List, - onClose: () -> Unit, onChanged: () -> Unit, + onClose: () -> Unit, onChanged: () -> Unit, slots: List = AddedGameArt.Slot.values().toList(), ) { val app = LocalContext.current.applicationContext val shown = rememberShown(onClose) @@ -233,7 +250,7 @@ private fun ArtOnlyEditor( modifier = Modifier.fillMaxWidth().heightIn(max = maxHeight).verticalScroll(rememberScrollState()), ) { Text(stringResource(R.string.edit_artwork), fontSize = 12.sp, color = MaterialTheme.colorScheme.onSurfaceVariant, modifier = Modifier.padding(start = 4.dp, top = 2.dp)) - for (slot in AddedGameArt.Slot.values()) key(slot) { + for (slot in slots) key(slot) { val state = arts.firstOrNull { it.slot == slot } FieldRow(slot.label(), focus = if (slot == AddedGameArt.Slot.COVER) first else null, onClick = { if (target != null) artSlot = slot }) { Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(10.dp)) { @@ -242,7 +259,7 @@ private fun ArtOnlyEditor( } } } - PickerRow(Icons.Outlined.Tune, stringResource(R.string.art_adjust_logo), logoPositionSummary(position?.value), enabled = target != null && position != null) { logoOpen = true } + if (AddedGameArt.Slot.LOGO in slots) PickerRow(Icons.Outlined.Tune, stringResource(R.string.art_adjust_logo), logoPositionSummary(position?.value), enabled = target != null && position != null) { logoOpen = true } } } val chosen = target ?: return diff --git a/app/src/main/java/com/droiddeck/launcher/ui/AgentEntries.kt b/app/src/main/java/com/droiddeck/launcher/ui/AgentEntries.kt new file mode 100644 index 0000000000..1ea5094ed7 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/ui/AgentEntries.kt @@ -0,0 +1,398 @@ +package com.droiddeck.launcher.ui + +import androidx.compose.animation.animateContentSize +import androidx.compose.foundation.background +import androidx.compose.foundation.clickable +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.ExperimentalLayoutApi +import androidx.compose.foundation.layout.FlowRow +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.heightIn +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.widthIn +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.text.selection.SelectionContainer +import androidx.compose.foundation.verticalScroll +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.outlined.CheckCircle +import androidx.compose.material.icons.outlined.Close +import androidx.compose.material.icons.outlined.Description +import androidx.compose.material.icons.outlined.ContentCopy +import androidx.compose.material.icons.outlined.ErrorOutline +import androidx.compose.material.icons.outlined.ExpandLess +import androidx.compose.material.icons.outlined.ExpandMore +import androidx.compose.material.icons.outlined.Psychology +import androidx.compose.material3.CircularProgressIndicator +import androidx.compose.material3.Icon +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.remember +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.saveable.rememberSaveable +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.graphics.Color +import androidx.compose.ui.layout.ContentScale +import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.text.AnnotatedString +import androidx.compose.ui.platform.LocalClipboardManager +import androidx.compose.ui.platform.testTag +import androidx.compose.ui.res.pluralStringResource +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.font.FontStyle +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import coil.compose.AsyncImage +import com.droiddeck.launcher.R +import com.droiddeck.launcher.agent.AgentAttachments +import com.droiddeck.launcher.agent.AgentHost +import com.droiddeck.launcher.agent.AgentHost.Entry +import com.droiddeck.launcher.agent.choices + +@Composable +internal fun AgentEntry( + entry: Entry, running: Boolean, last: Boolean = false, changes: Changes? = null, answerable: Boolean = false, + children: List = emptyList(), turn: List = emptyList(), onRevise: () -> Unit = {}, onSent: () -> Unit = {}, +) { + val colors = MaterialTheme.colorScheme + val pal = LocalPalette.current + when (entry) { + is Entry.Asked -> Column(Modifier.fillMaxWidth(), horizontalAlignment = Alignment.End, verticalArrangement = Arrangement.spacedBy(6.dp)) { + if (entry.files.isNotEmpty()) Row(horizontalArrangement = Arrangement.spacedBy(6.dp)) { entry.files.forEach { AttachmentChip(it, null) } } + if (entry.text.isNotEmpty()) SelectionContainer { + Text(entry.text, fontSize = 15.sp, color = pal.onPrimary, + modifier = Modifier.widthIn(max = 560.dp).clip(Shape16).background(pal.primary).padding(horizontal = 14.dp, vertical = 10.dp)) + } + } + is Entry.Said -> { + val reply = remember(entry.text) { choices(entry.text) } + Column(verticalArrangement = Arrangement.spacedBy(8.dp)) { + if (reply.text.isNotBlank()) SelectionContainer { AgentMarkdown(reply.text, Modifier.widthIn(max = 760.dp).padding(horizontal = 4.dp)) } + if (reply.options.isNotEmpty()) AgentChoices(reply.options, answerable, onSent) + } + } + is Entry.Thought -> AgentThought(entry.text, live = false) + is Entry.Used -> if (entry.tool == "TodoWrite") AgentTodos(entry.input) else AgentToolCall(entry, running, children) + is Entry.Result -> Unit + is Entry.Finished -> when { + last && AgentHost.answerless(AgentHost.entries) -> AgentNoReply() + last && entry.planned -> Column(verticalArrangement = Arrangement.spacedBy(8.dp)) { + AgentTurnEnd(entry, changes, turn) + AgentPlanActions(onRevise, onSent) + } + else -> AgentTurnEnd(entry, changes, turn) + } + } +} + +/** The options a reply ends with; picking one sends it, while the reply is still the latest. */ +@OptIn(ExperimentalLayoutApi::class) +@Composable +private fun AgentChoices(options: List, answerable: Boolean, onSent: () -> Unit) { + val context = LocalContext.current + FlowRow(horizontalArrangement = Arrangement.spacedBy(8.dp), verticalArrangement = Arrangement.spacedBy(8.dp), modifier = Modifier.padding(horizontal = 4.dp)) { + for (option in options) SecondaryButton(option, enabled = answerable, compact = true, modifier = Modifier.testTag("agent-choice")) { + AgentHost.send(context, option) + onSent() + } + } +} + +/** A plan turn changed nothing; Go carries the plan out with plan mode off, Revise asks for another. */ +@Composable +private fun AgentPlanActions(onRevise: () -> Unit, onSent: () -> Unit) { + val context = LocalContext.current + val pal = LocalPalette.current + val go = stringResource(R.string.agent_plan_go_message) + Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(10.dp), modifier = Modifier.padding(horizontal = 4.dp)) { + PrimaryButton(stringResource(R.string.agent_plan_go), compact = true, modifier = Modifier.testTag("agent-plan-go")) { + AgentHost.choosePlan(context, false) + AgentHost.send(context, go) + onSent() + } + SecondaryButton(stringResource(R.string.agent_plan_revise), compact = true, modifier = Modifier.testTag("agent-plan-revise")) { + AgentHost.choosePlan(context, true) + onRevise() + } + Text(stringResource(R.string.agent_plan_untouched), fontSize = 12.sp, color = pal.onSurfaceVariant) + } +} + +/** What a turn's edits added up to: files touched and lines added and removed. */ +internal data class Changes(val files: Int, val added: Int, val removed: Int) + +/** The edits of the turn that ends at [end], or null when it changed no file. */ +internal fun turnChanges(entries: List, end: Int): Changes? { + val start = entries.subList(0, end).indexOfLast { it is Entry.Asked } + val edits = turnEdits(entries.subList(start + 1, end)) + if (edits.isEmpty()) return null + return Changes(edits.map { it.path }.distinct().size, edits.sumOf { it.added }, edits.sumOf { it.removed }) +} + +/** The edits in [turn] that took, in order. Plan mode saves its plan as a file of its own, which is not a change to anything. */ +internal fun turnEdits(turn: List): List = + turn.filterIsInstance().filter { !it.failed }.mapNotNull { diffOf(it) }.filter { !it.path.contains("/.claude/plans/") } + +/** What the agent said in [turn], to copy as one text. */ +internal fun turnReply(turn: List): String = turn.filterIsInstance().joinToString("\n\n") { it.text } + +internal class Diff(val path: String, val lines: List) { + val added = lines.count { it.startsWith("+") } + val removed = lines.count { it.startsWith("-") } +} + +/** The diff an Edit or Write carries: its path, then lines led by ' ', '-' or '+'. */ +internal fun diffOf(entry: Entry.Used): Diff? { + if (entry.tool != "Edit" && entry.tool != "Write") return null + val lines = entry.input.lines() + val body = lines.drop(1).filter { it.isNotEmpty() } + if (lines.first().isBlank() || body.isEmpty() || body.any { it[0] != ' ' && it[0] != '-' && it[0] != '+' }) return null + if (body.none { it[0] != ' ' }) return null + return Diff(lines.first(), body) +} + +@Composable +private fun AgentTurnEnd(entry: Entry.Finished, changes: Changes?, turn: List) { + val colors = MaterialTheme.colorScheme + val pal = LocalPalette.current + var open by rememberSaveable { mutableStateOf(false) } + val reply = turnReply(turn) + val text = when { + entry.stopped -> stringResource(R.string.agent_stopped) + entry.error != null -> stringResource(R.string.agent_failed, entry.error) + else -> entry.usage?.let { u -> + buildList { + if (u.durationMs > 0) add(clock(u.durationMs / 1000)) + if (u.costUsd >= 0.005) add("$" + String.format(java.util.Locale.US, "%.2f", u.costUsd)) + if (u.inputTokens > 0 || u.outputTokens > 0) add(stringResource(R.string.agent_tokens, tokens(u.inputTokens), tokens(u.outputTokens))) + }.joinToString(" ยท ") + } + } + if (text.isNullOrEmpty() && changes == null && reply.isEmpty()) return + Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(10.dp), modifier = Modifier.padding(horizontal = 4.dp)) { + if (changes != null) Row( + verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(6.dp), + modifier = Modifier.clip(Shape12).background(if (open) pal.primary.copy(alpha = 0.2f) else pal.surfaceVariant).clickable { open = !open } + .padding(horizontal = 9.dp, vertical = 4.dp).testTag("agent-changes"), + ) { + Text(pluralStringResource(R.plurals.agent_files_changed, changes.files, changes.files), fontSize = 12.sp, color = pal.onSurfaceVariant) + Text("+${changes.added}", fontSize = 12.sp, fontFamily = FontFamily.Monospace, color = pal.good) + Text("โˆ’${changes.removed}", fontSize = 12.sp, fontFamily = FontFamily.Monospace, color = colors.error) + Icon(if (open) Icons.Outlined.ExpandLess else Icons.Outlined.ExpandMore, null, tint = pal.onSurfaceVariant, modifier = Modifier.size(16.dp)) + } + if (!text.isNullOrEmpty()) Text(text, fontSize = 12.sp, color = if (entry.error != null && !entry.stopped) colors.error else pal.onSurfaceVariant, + modifier = Modifier.weight(1f, fill = false)) + if (reply.isNotEmpty()) CopyButton(reply, stringResource(R.string.agent_copy_reply)) + } + if (open && changes != null) Column(Modifier.padding(start = 4.dp, end = 4.dp, top = 8.dp), verticalArrangement = Arrangement.spacedBy(8.dp)) { + for (diff in turnEdits(turn)) { + Text(diff.path, fontSize = 11.5.sp, fontFamily = FontFamily.Monospace, color = pal.onSurfaceVariant, maxLines = 1, overflow = TextOverflow.Ellipsis) + DiffBox(diff) + } + } +} + +@Composable +private fun CopyButton(text: String, label: String) { + val clipboard = LocalClipboardManager.current + val pal = LocalPalette.current + Icon( + Icons.Outlined.ContentCopy, label, tint = pal.onSurfaceVariant, + modifier = Modifier.size(28.dp).clip(Shape12).clickable { clipboard.setText(AnnotatedString(text)) }.padding(6.dp).testTag("agent-copy"), + ) +} + +@Composable +private fun AgentNoReply() { + val context = LocalContext.current + Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(12.dp), modifier = Modifier.padding(horizontal = 4.dp)) { + Text(stringResource(R.string.agent_no_reply), fontSize = 13.sp, color = AttentionAmber) + SecondaryButton(stringResource(R.string.agent_retry), compact = true) { AgentHost.retry(context) } + } +} + +internal fun tokens(n: Long) = when { + n >= 1_000_000 -> if (n % 1_000_000 == 0L) "${n / 1_000_000}M" else String.format(java.util.Locale.US, "%.1fM", n / 1_000_000.0) + n >= 1000 -> "${n / 1000}k" + else -> n.toString() +} + +@Composable +internal fun AgentThought(text: String, live: Boolean) { + val pal = LocalPalette.current + var open by rememberSaveable(text.take(40)) { mutableStateOf(false) } + Column(Modifier.padding(horizontal = 4.dp).animateContentSize()) { + Row(verticalAlignment = Alignment.CenterVertically, modifier = Modifier.clip(Shape12).clickable { open = !open }.padding(vertical = 4.dp)) { + Icon(Icons.Outlined.Psychology, null, tint = pal.onSurfaceVariant, modifier = Modifier.size(16.dp)) + Text(stringResource(if (live) R.string.agent_thinking else R.string.agent_thought), fontSize = 13.sp, color = pal.onSurfaceVariant, + modifier = Modifier.padding(start = 6.dp)) + Icon(if (open) Icons.Outlined.ExpandLess else Icons.Outlined.ExpandMore, null, tint = pal.onSurfaceVariant, modifier = Modifier.size(16.dp)) + } + if (open || live) Text( + if (open) text else text.takeLast(240), fontSize = 13.sp, fontStyle = FontStyle.Italic, color = pal.onSurfaceVariant, lineHeight = 19.sp, + maxLines = if (open) Int.MAX_VALUE else 3, overflow = TextOverflow.Ellipsis, modifier = Modifier.widthIn(max = 760.dp).padding(start = 22.dp), + ) + } +} + +@Composable +private fun AgentTodos(list: String) { + val pal = LocalPalette.current + val colors = MaterialTheme.colorScheme + Column( + Modifier.widthIn(max = 560.dp).padding(horizontal = 4.dp).clip(Shape12).background(pal.surfaceVariant).padding(horizontal = 12.dp, vertical = 8.dp), + verticalArrangement = Arrangement.spacedBy(4.dp), + ) { + for (line in list.lines().filter { it.isNotBlank() }) { + val done = line.startsWith("[x]") + val doing = line.startsWith("[~]") + Row(verticalAlignment = Alignment.CenterVertically) { + Box(Modifier.size(14.dp).clip(Shape12).background(when { + done -> pal.good + doing -> pal.primary + else -> pal.line + })) + Text(line.drop(4), fontSize = 13.sp, color = if (done) pal.onSurfaceVariant else colors.onSurface, + fontWeight = if (doing) FontWeight.SemiBold else null, modifier = Modifier.padding(start = 8.dp)) + } + } + } +} + +/** A tool call: one line with its status, opening to the full input and output, or to the diff of an edit. */ +@Composable +private fun AgentToolCall(entry: Entry.Used, running: Boolean, children: List = emptyList()) { + val colors = MaterialTheme.colorScheme + val pal = LocalPalette.current + var open by rememberSaveable(entry.id.ifEmpty { entry.detail }) { mutableStateOf(false) } + val diff = remember(entry.input) { diffOf(entry) } + Column( + Modifier.fillMaxWidth().padding(horizontal = 4.dp).clip(Shape12).background(pal.surfaceVariant).animateContentSize(), + ) { + Row( + verticalAlignment = Alignment.CenterVertically, + modifier = Modifier.fillMaxWidth().clickable { open = !open }.testTag("agent-tool").padding(horizontal = 10.dp, vertical = 8.dp), + ) { + Box(Modifier.size(16.dp), contentAlignment = Alignment.Center) { + when { + running -> CircularProgressIndicator(Modifier.size(13.dp), strokeWidth = 2.dp, color = pal.primary) + entry.failed -> Icon(Icons.Outlined.ErrorOutline, null, tint = colors.error, modifier = Modifier.size(16.dp)) + entry.output != null -> Icon(Icons.Outlined.CheckCircle, null, tint = pal.good, modifier = Modifier.size(16.dp)) + else -> Icon(Icons.Outlined.Close, null, tint = pal.onSurfaceVariant, modifier = Modifier.size(16.dp)) + } + } + Text(entry.tool, fontSize = 12.5.sp, fontWeight = FontWeight.SemiBold, color = pal.primary, modifier = Modifier.padding(start = 8.dp)) + Text(diff?.path?.substringAfterLast('/') ?: entry.detail, fontSize = 12.5.sp, fontFamily = FontFamily.Monospace, color = pal.onSurfaceVariant, + maxLines = 1, overflow = TextOverflow.Ellipsis, modifier = Modifier.weight(1f).padding(start = 8.dp)) + if (diff != null) { + Text("+${diff.added}", fontSize = 12.sp, fontFamily = FontFamily.Monospace, color = pal.good, modifier = Modifier.padding(start = 8.dp)) + Text("\u2212${diff.removed}", fontSize = 12.sp, fontFamily = FontFamily.Monospace, color = colors.error, modifier = Modifier.padding(start = 6.dp, end = 4.dp)) + } + Icon(if (open) Icons.Outlined.ExpandLess else Icons.Outlined.ExpandMore, null, tint = pal.onSurfaceVariant, modifier = Modifier.size(18.dp)) + } + if (children.isNotEmpty()) { + val latest = children.last() + Text( + pluralStringResource(R.plurals.agent_subagent_steps, children.size, children.size) + " ยท " + latest.tool + " " + latest.detail, + fontSize = 12.sp, fontFamily = FontFamily.Monospace, color = pal.onSurfaceVariant, maxLines = 1, overflow = TextOverflow.Ellipsis, + modifier = Modifier.padding(start = 34.dp, end = 10.dp, bottom = 8.dp), + ) + } + if (open && children.isNotEmpty()) Column(Modifier.padding(start = 10.dp, end = 4.dp, bottom = 6.dp), verticalArrangement = Arrangement.spacedBy(6.dp)) { + for (child in children) AgentToolCall(child, running && child.output == null) + } + if (open && diff != null) Column(Modifier.padding(start = 10.dp, end = 10.dp, bottom = 10.dp), verticalArrangement = Arrangement.spacedBy(6.dp)) { + if (diff.path.contains('/')) Text(diff.path, fontSize = 11.5.sp, fontFamily = FontFamily.Monospace, color = pal.onSurfaceVariant, maxLines = 1, overflow = TextOverflow.Ellipsis) + DiffBox(diff) + if (entry.failed && !entry.output.isNullOrBlank()) CodeBox(stringResource(R.string.agent_tool_output), entry.output, colors.error) + } else if (open) Column(Modifier.padding(start = 10.dp, end = 10.dp, bottom = 10.dp), verticalArrangement = Arrangement.spacedBy(6.dp)) { + if (entry.input.isNotBlank()) CodeBox(stringResource(R.string.agent_tool_input), entry.input, colors.onSurface) + when { + entry.output == null && running -> Text(stringResource(R.string.agent_tool_running), fontSize = 12.sp, color = pal.onSurfaceVariant) + entry.output == null -> Text(stringResource(R.string.agent_tool_no_result), fontSize = 12.sp, color = pal.onSurfaceVariant) + entry.output.isBlank() -> Text(stringResource(R.string.agent_tool_empty), fontSize = 12.sp, color = pal.onSurfaceVariant) + else -> CodeBox(stringResource(R.string.agent_tool_output), entry.output, if (entry.failed) colors.error else colors.onSurface) + } + } + } +} + +@Composable +private fun DiffBox(diff: Diff) { + val colors = MaterialTheme.colorScheme + val pal = LocalPalette.current + Column( + Modifier.fillMaxWidth().heightIn(max = 360.dp).clip(Shape12).background(colors.surface) + .verticalScroll(rememberScrollState()).padding(vertical = 6.dp), + ) { + for (line in diff.lines) { + val tint = when (line[0]) { + '+' -> pal.good + '-' -> colors.error + else -> null + } + Text( + line[0] + " " + line.substring(1), + fontSize = 12.sp, fontFamily = FontFamily.Monospace, lineHeight = 17.sp, + color = tint ?: pal.onSurfaceVariant, + modifier = Modifier.fillMaxWidth().background(tint?.copy(alpha = 0.12f) ?: Color.Transparent).padding(horizontal = 10.dp), + ) + } + } +} + +@Composable +private fun CodeBox(label: String, text: String, color: Color) { + val pal = LocalPalette.current + Column { + Row(verticalAlignment = Alignment.CenterVertically) { + Text(label, fontSize = 11.sp, fontWeight = FontWeight.SemiBold, letterSpacing = 1.sp, color = pal.onSurfaceVariant, + modifier = Modifier.weight(1f).padding(bottom = 3.dp)) + CopyButton(text, stringResource(R.string.agent_copy)) + } + SelectionContainer { + Text( + text, fontSize = 12.sp, fontFamily = FontFamily.Monospace, color = color, lineHeight = 17.sp, + modifier = Modifier.fillMaxWidth().heightIn(max = 360.dp).clip(Shape12).background(MaterialTheme.colorScheme.surface) + .verticalScroll(rememberScrollState()).padding(10.dp), + ) + } + } +} + +/** An attached file: a thumbnail for images, the name otherwise; [onRemove] adds a remove mark. */ +@Composable +internal fun AttachmentChip(path: String, onRemove: (() -> Unit)?) { + val context = LocalContext.current + val pal = LocalPalette.current + Box { + if (AgentAttachments.isImage(path)) AsyncImage( + model = AgentAttachments.host(context, path), contentDescription = path.substringAfterLast('/'), contentScale = ContentScale.Crop, + modifier = Modifier.size(72.dp).clip(Shape12).background(pal.surfaceVariant), + ) else Row( + verticalAlignment = Alignment.CenterVertically, + modifier = Modifier.heightIn(min = 40.dp).clip(Shape12).background(pal.surfaceVariant).padding(horizontal = 10.dp, vertical = 8.dp), + ) { + Icon(Icons.Outlined.Description, null, tint = pal.onSurfaceVariant, modifier = Modifier.size(18.dp)) + Text(path.substringAfterLast('/'), fontSize = 13.sp, color = MaterialTheme.colorScheme.onSurface, maxLines = 1, + overflow = TextOverflow.Ellipsis, modifier = Modifier.widthIn(max = 200.dp).padding(start = 6.dp, end = if (onRemove != null) 18.dp else 0.dp)) + } + if (onRemove != null) Box( + contentAlignment = Alignment.Center, + modifier = Modifier.align(Alignment.TopEnd).padding(3.dp).size(20.dp).clip(Shape12).background(MaterialTheme.colorScheme.surface).clickable(onClick = onRemove), + ) { + Icon(Icons.Outlined.Close, stringResource(R.string.agent_remove_attachment), tint = pal.onSurfaceVariant, modifier = Modifier.size(14.dp)) + } + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/ui/AgentMarkdown.kt b/app/src/main/java/com/droiddeck/launcher/ui/AgentMarkdown.kt new file mode 100644 index 0000000000..0d85087f85 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/ui/AgentMarkdown.kt @@ -0,0 +1,154 @@ +package com.droiddeck.launcher.ui + +import android.content.Context +import android.content.Intent +import android.net.Uri +import android.text.Selection +import android.text.Spannable +import android.text.SpannableStringBuilder +import android.text.Spanned +import android.widget.TextView +import android.widget.Toast +import androidx.compose.material3.MaterialTheme +import androidx.compose.runtime.Composable +import androidx.compose.runtime.remember +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.toArgb +import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.platform.LocalDensity +import androidx.compose.ui.unit.sp +import androidx.compose.ui.viewinterop.AndroidView +import com.droiddeck.launcher.R +import io.noties.markwon.AbstractMarkwonPlugin +import io.noties.markwon.Markwon +import io.noties.markwon.MarkwonConfiguration +import io.noties.markwon.MarkwonVisitor +import io.noties.markwon.core.MarkwonTheme +import io.noties.markwon.ext.strikethrough.StrikethroughPlugin +import io.noties.markwon.ext.tables.TableAwareMovementMethod +import io.noties.markwon.ext.tables.TablePlugin +import io.noties.markwon.ext.tables.TableRowSpan +import io.noties.markwon.ext.tasklist.TaskListPlugin +import org.commonmark.ext.autolink.AutolinkExtension +import org.commonmark.parser.Parser +import org.commonmark.ext.gfm.tables.TableCell +import org.commonmark.ext.gfm.tables.TableHead +import org.commonmark.ext.gfm.tables.TableRow +import org.commonmark.node.AbstractVisitor +import org.commonmark.node.CustomNode +import org.commonmark.node.Node + +@Composable +internal fun AgentMarkdown(text: String, modifier: Modifier) { + val context = LocalContext.current + val colors = MaterialTheme.colorScheme + val pal = LocalPalette.current + val density = LocalDensity.current + val textSize = with(density) { 15.sp.toPx() } + val lineSpacing = with(density) { 3.sp.toPx() } + val renderer = remember(context, pal.primary2, pal.surfaceVariant, density) { + agentMarkdownRenderer(context, pal.primary2.toArgb(), pal.surfaceVariant.toArgb()) + } + val rendered = remember(renderer, text) { renderer.toMarkdown(text) } + AndroidView( + modifier = modifier, + factory = { TextView(it).apply { + setTextIsSelectable(true) + movementMethod = TableAwareMovementMethod.create() + includeFontPadding = false + } }, + update = { view -> + view.setTextColor(colors.onSurface.toArgb()) + view.setLinkTextColor(pal.primary2.toArgb()) + view.setTextSize(android.util.TypedValue.COMPLEX_UNIT_PX, textSize) + view.setLineSpacing(lineSpacing, 1f) + setAgentMarkdown(view, renderer, rendered) + }, + ) +} + +internal fun agentMarkdownRenderer(context: Context, linkColor: Int, codeBackground: Int): Markwon = + Markwon.builder(context) + .usePlugin(StrikethroughPlugin.create()) + .usePlugin(TablePlugin.create(context)) + .usePlugin(TaskListPlugin.create(context)) + .usePlugin(object : AbstractMarkwonPlugin() { + override fun configureParser(builder: Parser.Builder) { + builder.extensions(listOf(AutolinkExtension.create())) + } + + override fun afterRender(node: Node, visitor: MarkwonVisitor) { + val rows = mutableListOf() + node.accept(object : AbstractVisitor() { + override fun visit(customNode: CustomNode) { + if (customNode is TableHead || customNode is TableRow) { + val cells = generateSequence(customNode.firstChild) { it.next }.filterIsInstance().toList() + if (cells.isNotEmpty()) rows += cells.joinToString(" | ") { markdownCellText(it) } + else visitChildren(customNode) + } else visitChildren(customNode) + } + }) + if (rows.isEmpty()) return + // Markwon keeps table cells outside the text buffer; expose them for copy and accessibility. + val builder = visitor.builder() + val text = SpannableStringBuilder(builder.removeFromEnd(0)) + val spans = text.getSpans(0, text.length, TableRowSpan::class.java).sortedBy { text.getSpanStart(it) } + for ((row, span) in spans.withIndex().reversed()) { + val start = text.getSpanStart(span) + val end = text.getSpanEnd(span) + val content = rows[row].ifEmpty { "\u00a0" } + text.removeSpan(span) + text.replace(start, end, content) + text.setSpan(span, start, start + content.length, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE) + } + builder.append(text) + } + + override fun configureTheme(builder: MarkwonTheme.Builder) { + builder.linkColor(linkColor).codeBackgroundColor(codeBackground) + } + + override fun configureConfiguration(builder: MarkwonConfiguration.Builder) { + builder.linkResolver { view, link -> + val intent = agentBrowserIntent(link) ?: return@linkResolver + try { + view.context.startActivity(intent) + } catch (_: android.content.ActivityNotFoundException) { + Toast.makeText(view.context, R.string.agent_browser_unavailable, Toast.LENGTH_SHORT).show() + } + } + } + }) + .build() + +private fun markdownCellText(node: Node): String = buildString { + node.accept(object : AbstractVisitor() { + override fun visit(text: org.commonmark.node.Text) { append(text.literal) } + override fun visit(code: org.commonmark.node.Code) { append(code.literal) } + override fun visit(lineBreak: org.commonmark.node.SoftLineBreak) { append(' ') } + override fun visit(lineBreak: org.commonmark.node.HardLineBreak) { append('\n') } + override fun visit(html: org.commonmark.node.HtmlInline) { append(html.literal) } + }) +} + +internal fun setAgentMarkdown(view: TextView, renderer: Markwon, rendered: Spanned) { + if (view.tag === rendered) return + val start = view.selectionStart + val end = view.selectionEnd + val sameText = view.text.toString() == rendered.toString() + renderer.setParsedMarkdown(view, rendered) + view.tag = rendered + if (sameText && start in 0..rendered.length && end in 0..rendered.length) { + (view.text as? Spannable)?.let { Selection.setSelection(it, start, end) } + } +} + +internal fun agentBrowserIntent(link: String): Intent? { + val uri = Uri.parse(link) + if (uri.scheme?.lowercase() !in listOf("http", "https") || uri.host.isNullOrBlank()) return null + return Intent(Intent.ACTION_VIEW, uri).apply { + addCategory(Intent.CATEGORY_BROWSABLE) + addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) + selector = Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_APP_BROWSER) + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/ui/AgentPage.kt b/app/src/main/java/com/droiddeck/launcher/ui/AgentPage.kt new file mode 100644 index 0000000000..3bc13a5f20 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/ui/AgentPage.kt @@ -0,0 +1,816 @@ +package com.droiddeck.launcher.ui + +import android.app.Activity +import android.content.ContextWrapper +import android.view.KeyEvent +import android.view.WindowManager +import androidx.activity.compose.LocalActivityResultRegistryOwner +import androidx.activity.compose.rememberLauncherForActivityResult +import androidx.activity.result.contract.ActivityResultContracts +import androidx.compose.animation.expandVertically +import androidx.compose.animation.fadeIn +import androidx.compose.animation.shrinkHorizontally +import androidx.compose.animation.expandHorizontally +import androidx.compose.animation.fadeOut +import androidx.compose.animation.shrinkVertically +import androidx.compose.foundation.Canvas +import androidx.compose.foundation.background +import androidx.compose.foundation.border +import androidx.compose.foundation.clickable +import androidx.compose.foundation.gestures.awaitEachGesture +import androidx.compose.foundation.gestures.awaitFirstDown +import androidx.compose.foundation.horizontalScroll +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.WindowInsets +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.ime +import androidx.compose.foundation.layout.imePadding +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.widthIn +import androidx.compose.foundation.lazy.LazyColumn +import androidx.compose.foundation.lazy.LazyListState +import androidx.compose.foundation.lazy.rememberLazyListState +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.shape.CircleShape +import androidx.compose.foundation.text.BasicTextField +import androidx.compose.foundation.text.KeyboardActions +import androidx.compose.foundation.text.KeyboardOptions +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.automirrored.outlined.Send +import androidx.compose.material.icons.outlined.Extension +import androidx.compose.material.icons.outlined.PhotoCamera +import androidx.compose.material.icons.outlined.MicOff +import androidx.compose.material.icons.outlined.Mic +import androidx.compose.material.icons.outlined.Add +import androidx.compose.material.icons.outlined.ArrowDownward +import androidx.compose.material.icons.outlined.AttachFile +import androidx.compose.material.icons.outlined.AutoAwesome +import androidx.compose.material.icons.outlined.Build +import androidx.compose.material.icons.outlined.Close +import androidx.compose.material.icons.outlined.ExpandMore +import androidx.compose.material.icons.outlined.History +import androidx.compose.material.icons.outlined.Memory +import androidx.compose.material.icons.outlined.MoreHoriz +import androidx.compose.material.icons.outlined.Pets +import androidx.compose.material.icons.outlined.Settings +import androidx.compose.material.icons.outlined.Stop +import androidx.compose.material3.CircularProgressIndicator +import androidx.compose.material3.Icon +import androidx.compose.material3.LinearProgressIndicator +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.DisposableEffect +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.MutableState +import androidx.compose.runtime.Stable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableIntStateOf +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.rememberCoroutineScope +import androidx.compose.runtime.rememberUpdatedState +import androidx.compose.runtime.saveable.rememberSaveable +import androidx.compose.runtime.setValue +import androidx.compose.runtime.snapshotFlow +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.draw.clipToBounds +import androidx.compose.ui.focus.FocusRequester +import androidx.compose.ui.focus.focusRequester +import androidx.compose.ui.focus.onFocusChanged +import androidx.compose.ui.geometry.Offset +import androidx.compose.ui.graphics.SolidColor +import androidx.compose.ui.graphics.StrokeCap +import androidx.compose.ui.graphics.drawscope.Stroke +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.input.key.onPreviewKeyEvent +import androidx.compose.ui.input.nestedscroll.NestedScrollConnection +import androidx.compose.ui.input.nestedscroll.NestedScrollSource +import androidx.compose.ui.input.nestedscroll.nestedScroll +import androidx.compose.ui.input.pointer.PointerEventPass +import androidx.compose.ui.input.pointer.pointerInput +import androidx.compose.ui.layout.onGloballyPositioned +import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.platform.LocalDensity +import androidx.compose.ui.platform.LocalFocusManager +import androidx.compose.ui.platform.LocalView +import androidx.compose.ui.platform.testTag +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.input.ImeAction +import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.unit.Dp +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import androidx.compose.ui.window.DialogWindowProvider +import com.droiddeck.launcher.R +import com.droiddeck.launcher.agent.AgentAttachments +import com.droiddeck.launcher.agent.AgentHost +import com.droiddeck.launcher.agent.AgentHost.Entry +import com.droiddeck.launcher.agent.AgentSetup +import kotlinx.coroutines.launch + +internal enum class AgentPanel { NONE, MODEL, USAGE, HISTORY, PROCESSES, TOOLS } + +/** Slash commands the app handles itself; others go to the CLI, which has its own. */ +private val LOCAL_COMMANDS = listOf("/new", "/model", "/plan", "/history", "/processes", "/stop") +private val CLI_COMMANDS = listOf("/compact", "/cost", "/review", "/init") + +/** + * The chat with the model, usage and menu on top and the editor at the bottom. Scrolling back + * through older messages hides the editor behind a small pill and stops following new output. + * [inputModifier] goes on the first control, where a controller lands without raising the keyboard. + */ +@Suppress("UNUSED_PARAMETER") +@Composable +internal fun AgentPage( + modifier: Modifier, inputModifier: Modifier = Modifier, visible: Boolean = true, startTyping: Boolean = true, hidesPet: Boolean = true, + menuSlot: AgentMenuSlot? = null, +) = AgentPageContent(modifier, inputModifier, visible, hidesPet, menuSlot) + +// Lab overlays run against the installed APK, so these entry points keep their JVM signatures. +@Suppress("UNUSED_PARAMETER") +@Composable +internal fun AgentPageWithControls( + modifier: Modifier, inputModifier: Modifier = Modifier, visible: Boolean = true, startTyping: Boolean = true, + showControlsWithoutKeyboard: Boolean, +) = AgentPageContent(modifier, inputModifier, visible, hidesPet = true) + +@Composable +private fun AgentPageContent( + modifier: Modifier, inputModifier: Modifier, visible: Boolean, hidesPet: Boolean, menuSlot: AgentMenuSlot? = null, +) { + val context = LocalContext.current + val view = LocalView.current + DisposableEffect(view, visible) { + val window = (view.parent as? DialogWindowProvider)?.window + ?: generateSequence(view.context) { (it as? ContextWrapper)?.baseContext } + .filterIsInstance().firstOrNull()?.window + val previousMode = window?.attributes?.softInputMode + if (visible) window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING) + onDispose { + if (visible && previousMode != null) window?.setSoftInputMode(previousMode) + } + } + remember { AgentHost.refresh(context) } + LaunchedEffect(AgentHost.unseen, visible) { if (visible) AgentHost.seen() } + // A stopped activity keeps its composition; the page is only on screen while its host is started. + val lifecycle = androidx.compose.ui.platform.LocalLifecycleOwner.current.lifecycle + var started by remember(lifecycle) { mutableStateOf(lifecycle.currentState.isAtLeast(androidx.lifecycle.Lifecycle.State.STARTED)) } + DisposableEffect(lifecycle) { + val observer = androidx.lifecycle.LifecycleEventObserver { _, _ -> started = lifecycle.currentState.isAtLeast(androidx.lifecycle.Lifecycle.State.STARTED) } + lifecycle.addObserver(observer) + onDispose { lifecycle.removeObserver(observer) } + } + DisposableEffect(visible, hidesPet, started) { + val counts = visible && hidesPet && started + if (counts) AgentPet.agentOnScreen++ + onDispose { if (counts) AgentPet.agentOnScreen-- } + } + remember { AgentSetup.check(context) } + var setup by rememberSaveable { mutableStateOf(false) } + val draft = rememberSaveable { mutableStateOf("") } + if (setup || AgentHost.state == AgentHost.State.MISSING || !(AgentSetup.ready || AgentSetup.completed(context))) { + AgentSetupView(modifier, onDone = { setup = false }) + return + } + var panel by rememberSaveable { mutableStateOf(AgentPanel.NONE) } + val composer = remember { ComposerState() } + val focusManager = LocalFocusManager.current + val togglePanel: (AgentPanel) -> Unit = { panel = if (panel == it) AgentPanel.NONE else it } + var menuOpen by rememberSaveable { mutableStateOf(false) } + val topBar: @Composable () -> Unit = { + AgentTopBar(panel, togglePanel, inputModifier) { + AgentMenu(menuOpen, { menuOpen = it }, onPanel = { panel = it }, onSetup = { setup = true }) + } + } + // A host with a title bar shows the top bar there. + val inSlot = menuSlot != null && panel != AgentPanel.HISTORY && panel != AgentPanel.PROCESSES && panel != AgentPanel.TOOLS + if (menuSlot != null) DisposableEffect(menuSlot, inSlot) { + menuSlot.content = if (inSlot) topBar else null + onDispose { menuSlot.content = null } + } + // The keyboard leaves too little height for a panel and the editor together, so typing closes the panel. + val keyboardOpen = WindowInsets.ime.getBottom(LocalDensity.current) > 0 + LaunchedEffect(keyboardOpen) { if (keyboardOpen && (panel == AgentPanel.MODEL || panel == AgentPanel.USAGE)) panel = AgentPanel.NONE } + Column( + modifier.fillMaxSize().imePadding().onPreviewKeyEvent { e -> + val k = e.nativeKeyEvent + if (k.keyCode != KeyEvent.KEYCODE_BUTTON_Y || composer.focused) return@onPreviewKeyEvent false + if (k.action == KeyEvent.ACTION_UP) composer.open() + true + }, + ) { + when (panel) { + AgentPanel.HISTORY -> { + AgentPanelBar(stringResource(R.string.agent_history)) { panel = AgentPanel.NONE } + AgentHistory(Modifier.weight(1f)) { panel = AgentPanel.NONE } + } + AgentPanel.PROCESSES -> { + AgentPanelBar(stringResource(R.string.agent_processes)) { panel = AgentPanel.NONE } + AgentProcessList(Modifier.weight(1f)) + } + AgentPanel.TOOLS -> { + AgentPanelBar(stringResource(R.string.agent_tools)) { panel = AgentPanel.NONE } + AgentToolsPanel(Modifier.weight(1f)) + } + else -> { + if (menuSlot == null) Box(Modifier.padding(bottom = 6.dp)) { topBar() } + when (panel) { + AgentPanel.MODEL -> Box(Modifier.padding(bottom = 8.dp)) { AgentModelPicker() } + AgentPanel.USAGE -> Box(Modifier.padding(bottom = 8.dp)) { AgentUsage() } + else -> Unit + } + val list = rememberLazyListState() + val scope = rememberCoroutineScope() + // Only dragging back through older messages stops following the latest; reaching the bottom again resumes it. + var readingBack by remember { mutableStateOf(false) } + LaunchedEffect(AgentHost.chat) { readingBack = false } + LaunchedEffect(list) { snapshotFlow { list.canScrollForward }.collect { if (!it) readingBack = false } } + val dragBack = remember { + object : NestedScrollConnection { + override fun onPreScroll(available: Offset, source: NestedScrollSource): Offset { + if (source == NestedScrollSource.Drag && available.y > 1f && list.canScrollBackward) readingBack = true + return Offset.Zero + } + } + } + val toLatest: () -> Unit = { + readingBack = false + scope.launch { list.scrollToItem(maxOf(0, list.layoutInfo.totalItemsCount - 1), Int.MAX_VALUE / 2) } + } + val hidden = !composer.focused && !composer.hasUnconsumedFocusRequest() && readingBack && AgentHost.entries.isNotEmpty() + var listHeight by remember { mutableIntStateOf(0) } + Box( + Modifier.weight(1f).fillMaxWidth().clipToBounds().nestedScroll(dragBack).onGloballyPositioned { + // The editor sliding in or the keyboard rising shrinks the list from below; a list following the latest keeps it in view, even mid-drag. + // Scrolling remeasures the list, which Compose refuses during a measure pass, so this runs once positioning is done. + val height = it.size.height + val shrunk = listHeight - height + listHeight = height + if (shrunk > 0 && !readingBack) list.dispatchRawDelta(shrunk.toFloat()) + }, + ) { + AgentConversation( + Modifier.fillMaxSize().pointerInput(Unit) { + awaitEachGesture { + awaitFirstDown(requireUnconsumed = false, pass = PointerEventPass.Initial) + if (panel == AgentPanel.MODEL || panel == AgentPanel.USAGE) panel = AgentPanel.NONE + if (composer.focused) focusManager.clearFocus() + } + }, + list, following = !readingBack, onRevise = { composer.open() }, onSent = toLatest, + ) + androidx.compose.animation.AnimatedVisibility( + hidden, enter = fadeIn(), exit = fadeOut(), modifier = Modifier.align(Alignment.BottomCenter).padding(bottom = 8.dp), + ) { + AgentJumpPill(toLatest) + } + } + androidx.compose.animation.AnimatedVisibility(!hidden, enter = expandVertically() + fadeIn(), exit = shrinkVertically() + fadeOut()) { + AgentComposer(composer, draft, visible, onPanel = { panel = it }, onSent = toLatest) + } + } + } + } +} + +/** Whether the editor has the cursor; [open] puts it there. */ +@Stable +private class ComposerState { + var focused by mutableStateOf(false) + var focusRequests by mutableIntStateOf(0) + private set + private var consumedFocusRequests by mutableIntStateOf(0) + + fun open() { + focusRequests++ + if (focused) consumeFocusRequest() + } + + fun hasUnconsumedFocusRequest() = focusRequests > consumedFocusRequests + + fun consumeFocusRequest() { + consumedFocusRequests = focusRequests + } +} + +/** Where a host with its own title bar shows the conversation's menu. */ +@Stable +internal class AgentMenuSlot { + var content by mutableStateOf<(@Composable () -> Unit)?>(null) +} + +/** The model and how full the context is, then the [menu]. */ +@Composable +private fun AgentTopBar(panel: AgentPanel, onPanel: (AgentPanel) -> Unit, firstControl: Modifier, menu: @Composable () -> Unit) { + val context = LocalContext.current + val pal = LocalPalette.current + Row(verticalAlignment = Alignment.CenterVertically, modifier = Modifier.fillMaxWidth()) { + Row(verticalAlignment = Alignment.CenterVertically, modifier = Modifier.weight(1f)) { + val model = AgentHost.models(context).firstOrNull { it.id == AgentHost.model }?.label ?: AgentHost.model ?: stringResource(R.string.agent_model_default) + Row( + verticalAlignment = Alignment.CenterVertically, + modifier = Modifier.weight(1f, fill = false).height(36.dp).clip(Shape12).then(firstControl).clickable { onPanel(AgentPanel.MODEL) } + .padding(horizontal = 8.dp).testTag("agent-model"), + ) { + val parts = listOfNotNull(AgentHost.harness.name, model, AgentHost.effort, stringResource(R.string.agent_plan_short).takeIf { AgentHost.plan && AgentHost.harness.plans }) + Text(parts.joinToString(" ยท "), fontSize = 13.sp, color = if (panel == AgentPanel.MODEL) pal.primary else pal.onSurfaceVariant, + maxLines = 1, overflow = TextOverflow.Ellipsis, modifier = Modifier.weight(1f, fill = false)) + Icon(Icons.Outlined.ExpandMore, null, tint = pal.onSurfaceVariant, modifier = Modifier.size(16.dp)) + } + ContextRing("agent-usage", onClick = { onPanel(AgentPanel.USAGE) }) + } + menu() + } +} + +/** History, processes, a new conversation, the pet and setup, folded behind one button. */ +@Composable +private fun AgentMenu(open: Boolean, onOpen: (Boolean) -> Unit, onPanel: (AgentPanel) -> Unit, onSetup: () -> Unit) { + val context = LocalContext.current + val colors = MaterialTheme.colorScheme + val pal = LocalPalette.current + val working = AgentHost.state == AgentHost.State.WORKING + Row( + verticalAlignment = Alignment.CenterVertically, + modifier = Modifier.clip(Shape16).background(colors.surface.copy(alpha = if (open) 0.97f else 0.88f)) + .border(1.dp, pal.line, Shape16).padding(end = 2.dp), + ) { + androidx.compose.animation.AnimatedVisibility(open, enter = expandHorizontally(expandFrom = Alignment.End) + fadeIn(), + exit = shrinkHorizontally(shrinkTowards = Alignment.End) + fadeOut()) { + Row(verticalAlignment = Alignment.CenterVertically) { + HeaderAction(Icons.Outlined.History, stringResource(R.string.agent_history), size = 36.dp, tag = "agent-history") { onOpen(false); onPanel(AgentPanel.HISTORY) } + HeaderAction(Icons.Outlined.Memory, stringResource(R.string.agent_processes), size = 36.dp, tag = "agent-processes") { onOpen(false); onPanel(AgentPanel.PROCESSES) } + if (AgentHost.harness == com.droiddeck.launcher.agent.ClaudeCode) HeaderAction( + Icons.Outlined.Extension, stringResource(R.string.agent_tools), size = 36.dp, tag = "agent-tools", + ) { onOpen(false); onPanel(AgentPanel.TOOLS) } + HeaderAction(Icons.Outlined.Add, stringResource(R.string.agent_new), enabled = !working && AgentHost.entries.isNotEmpty(), size = 36.dp, tag = "agent-new") { + onOpen(false) + AgentHost.forget(context) + } + HeaderAction(Icons.Outlined.Pets, stringResource(R.string.setup_agent_pet), selected = AgentPet.enabled, size = 36.dp, tag = "agent-pet-toggle") { + AgentPet.set(context, !AgentPet.enabled) + } + HeaderAction(Icons.Outlined.Settings, stringResource(R.string.agent_setup_title), enabled = !working, size = 36.dp, tag = "agent-settings") { + onOpen(false) + onSetup() + } + } + } + HeaderAction(Icons.Outlined.MoreHoriz, stringResource(R.string.agent_more), selected = open, size = 36.dp, tag = "agent-menu") { onOpen(!open) } + } +} + +@Composable +private fun AgentPanelBar(title: String, onClose: () -> Unit) { + Row(verticalAlignment = Alignment.CenterVertically, modifier = Modifier.fillMaxWidth().padding(bottom = 6.dp)) { + Text(title, fontSize = 17.sp, fontWeight = FontWeight.SemiBold, color = MaterialTheme.colorScheme.onBackground, modifier = Modifier.weight(1f)) + HeaderAction(Icons.Outlined.Close, stringResource(R.string.agent_close), size = 36.dp, tag = "agent-panel-close", onClick = onClose) + } +} + +@Composable +internal fun HeaderAction( + icon: ImageVector, label: String, enabled: Boolean = true, selected: Boolean = false, tag: String? = null, size: Dp = 44.dp, onClick: () -> Unit, +) { + val pal = LocalPalette.current + Box( + contentAlignment = Alignment.Center, + modifier = Modifier.padding(start = if (size < 44.dp) 4.dp else 8.dp).size(size).clip(Shape12) + .background(if (selected) pal.primary.copy(alpha = 0.2f) else pal.surfaceVariant) + .clickable(enabled = enabled, onClick = onClick) + .then(if (tag != null) Modifier.testTag(tag) else Modifier), + ) { + Icon(icon, label, tint = when { + selected -> pal.primary + enabled -> pal.onBackground + else -> pal.onSurfaceVariant.copy(alpha = 0.5f) + }, modifier = Modifier.size(if (size < 44.dp) 19.dp else 22.dp)) + } +} + +@Composable +private fun AgentConversation(modifier: Modifier, list: LazyListState, following: Boolean, onRevise: () -> Unit, onSent: () -> Unit) { + val pal = LocalPalette.current + val working = AgentHost.state == AgentHost.State.WORKING + // A subagent's calls are shown inside the call that started it. + val shown = AgentHost.entries.indices.filter { (AgentHost.entries[it] as? Entry.Used)?.parent.isNullOrEmpty() } + val items = shown.size + (if (working) 1 else 0) + val follow by rememberUpdatedState(following) + LaunchedEffect(items) { + if (items == 0 || !follow) return@LaunchedEffect + list.animateScrollToItem(items - 1) + list.scrollToItem(items - 1, Int.MAX_VALUE / 2) + } + LaunchedEffect(AgentHost.live.length / 80, AgentHost.liveThinking.length / 80) { + if (follow && items > 0) list.scrollToItem(items - 1, Int.MAX_VALUE / 2) + } + if (AgentHost.entries.isEmpty() && !working) { + Column(modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally, verticalArrangement = Arrangement.Center) { + Icon(Icons.Outlined.AutoAwesome, null, tint = pal.primary, modifier = Modifier.size(40.dp)) + Text(stringResource(R.string.agent_empty), fontSize = 15.sp, color = pal.onSurfaceVariant, + textAlign = TextAlign.Center, modifier = Modifier.widthIn(max = 460.dp).padding(top = 12.dp)) + } + return + } + val start = AgentHost.entries.indexOfLast { it is Entry.Asked } + LazyColumn(modifier.fillMaxWidth(), state = list, verticalArrangement = Arrangement.spacedBy(10.dp)) { + items(shown.size) { n -> + val i = shown[n] + val entry = AgentHost.entries[i] + AgentEntry( + entry, running = working && i > start && entry is Entry.Used && entry.output == null, last = !working && i == AgentHost.entries.lastIndex, + children = if (entry is Entry.Used) AgentHost.entries.filter { it is Entry.Used && it.parent == entry.id && entry.id.isNotEmpty() }.map { it as Entry.Used } else emptyList(), + changes = if (entry is Entry.Finished) turnChanges(AgentHost.entries, i) else null, + turn = if (entry is Entry.Finished) AgentHost.entries.subList(AgentHost.entries.subList(0, i).indexOfLast { it is Entry.Asked } + 1, i) else emptyList(), + answerable = !working && i > start && AgentHost.queue.isEmpty(), onRevise = onRevise, onSent = onSent, + ) + } + if (working) item { AgentLive() } + } +} + +/** Where the composer was, while it is hidden for reading back: what the agent is doing, and the way to the latest message. */ +@Composable +private fun AgentJumpPill(onClick: () -> Unit) { + val colors = MaterialTheme.colorScheme + val pal = LocalPalette.current + Row( + verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(8.dp), + modifier = Modifier.clip(CircleShape).background(colors.surface).border(1.dp, pal.line, CircleShape) + .clickable(onClick = onClick).padding(horizontal = 14.dp, vertical = 8.dp).testTag("agent-latest"), + ) { + if (AgentHost.state == AgentHost.State.WORKING) CircularProgressIndicator(Modifier.size(13.dp), strokeWidth = 2.dp, color = pal.primary) + Text(stringResource(if (AgentHost.state == AgentHost.State.WORKING) R.string.agent_working_short else R.string.agent_latest), fontSize = 13.sp, color = pal.onSurfaceVariant) + Icon(Icons.Outlined.ArrowDownward, null, tint = pal.onSurfaceVariant, modifier = Modifier.size(16.dp)) + } +} + +/** The reply being written, and what the agent is doing right now. */ +@Composable +private fun AgentLive() { + val pal = LocalPalette.current + Column(verticalArrangement = Arrangement.spacedBy(8.dp)) { + if (AgentHost.liveThinking.isNotBlank()) AgentThought(AgentHost.liveThinking, live = true) + if (AgentHost.live.isNotBlank()) AgentMarkdown(AgentHost.live, Modifier.widthIn(max = 760.dp).padding(horizontal = 4.dp)) + val running = AgentHost.running() + Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(10.dp), modifier = Modifier.padding(4.dp)) { + CircularProgressIndicator(Modifier.size(14.dp), strokeWidth = 2.dp, color = pal.primary) + val elapsed = clock((AgentHost.now - AgentHost.turnStarted) / 1000) + Text( + if (running != null) stringResource(R.string.agent_running, running.tool, elapsed) else stringResource(R.string.agent_thinking_for, elapsed), + fontSize = 13.sp, color = pal.onSurfaceVariant, + ) + } + } +} + +internal fun clock(seconds: Long): String { + val s = seconds.coerceAtLeast(0) + return when { + s < 60 -> "${s}s" + s < 3600 -> "${s / 60}m ${s % 60}s" + else -> "${s / 3600}h ${s % 3600 / 60}m" + } +} + +@Composable +private fun AgentLabCard() { + val context = LocalContext.current + val colors = MaterialTheme.colorScheme + val pal = LocalPalette.current + val lab = AgentHost.lab ?: return + var armed by remember(lab.pid) { mutableStateOf(false) } + Column( + Modifier.fillMaxWidth().padding(top = 8.dp).clip(Shape14).background(colors.surface).border(1.dp, if (lab.failed) AttentionAmber else pal.line, Shape14) + .padding(horizontal = 14.dp, vertical = 10.dp).testTag("agent-lab"), + ) { + Row(verticalAlignment = Alignment.CenterVertically) { + Column(Modifier.weight(1f)) { + Text( + stringResource(if (lab.prepare) R.string.agent_lab_preparing else R.string.agent_lab_building) + " ยท " + labStage(lab), + fontSize = 14.sp, fontWeight = FontWeight.SemiBold, color = if (lab.failed) AttentionAmber else colors.onBackground, + ) + val facts = buildList { + if (lab.running && lab.total > 0) add("${lab.done}/${lab.total}") + add(clock(lab.elapsedSeconds.toLong())) + if (lab.running && lab.etaSeconds >= 0) add(stringResource(R.string.agent_lab_left, clock(lab.etaSeconds.toLong()))) + } + Text(facts.joinToString(" ยท "), fontSize = 12.5.sp, color = pal.onSurfaceVariant) + } + if (lab.running) SecondaryButton(stringResource(if (armed) R.string.agent_lab_cancel_confirm else R.string.agent_lab_cancel), compact = true) { + if (armed) AgentHost.cancelLabBuild(context) else armed = true + } + } + if (lab.running) { + LinearProgressIndicator( + progress = { lab.permille / 1000f }, color = pal.primary, trackColor = pal.surfaceVariant, + modifier = Modifier.fillMaxWidth().padding(top = 8.dp).height(6.dp).clip(CircleShape), + ) + if (lab.task.isNotEmpty()) Text(lab.task, fontSize = 12.sp, fontFamily = FontFamily.Monospace, color = pal.onSurfaceVariant, + maxLines = 1, overflow = TextOverflow.Ellipsis, modifier = Modifier.padding(top = 4.dp)) + } + } +} + +@Composable +private fun labStage(lab: com.droiddeck.launcher.agent.LabProgress) = when (lab.stage) { + "building" -> stringResource(R.string.agent_lab_stage_building, lab.permille / 10) + "packaging" -> stringResource(R.string.agent_lab_stage_packaging) + "restarting" -> stringResource(R.string.agent_lab_stage_restarting) + "ready", "prepared" -> stringResource(R.string.agent_lab_stage_ready) + "failed" -> stringResource(R.string.agent_lab_stage_failed, lab.task) + else -> stringResource(R.string.agent_lab_stage_starting) +} + +private fun hasActivity() = AgentHost.lab != null || AgentHost.queue.isNotEmpty() || currentTodo() != null + +/** The todo item in progress and how many are done, while the agent works through a list. */ +private fun currentTodo(): String? { + if (AgentHost.state != AgentHost.State.WORKING) return null + val todos = AgentHost.todos()?.lines()?.filter { it.isNotBlank() }.orEmpty() + val doing = todos.firstOrNull { it.startsWith("[~]") } ?: todos.firstOrNull { it.startsWith("[ ]") } ?: return null + return "${todos.count { it.startsWith("[x]") }}/${todos.size} ยท ${doing.drop(4)}" +} + +/** A Lab build, the todo item in progress and queued messages, one chip each. */ +@Composable +private fun AgentActivity(labOpen: Boolean, onLab: () -> Unit) { + val context = LocalContext.current + val pal = LocalPalette.current + AgentHost.lab?.let { lab -> + AgentChip(selected = labOpen, warn = lab.failed, tag = "agent-lab-chip", onClick = onLab) { + Icon(Icons.Outlined.Build, null, tint = if (lab.failed) AttentionAmber else pal.onSurfaceVariant, modifier = Modifier.size(14.dp)) + Text(labStage(lab), fontSize = 12.5.sp, color = if (lab.failed) AttentionAmber else pal.onSurfaceVariant, maxLines = 1, + overflow = TextOverflow.Ellipsis, modifier = Modifier.widthIn(max = 160.dp)) + } + } + currentTodo()?.let { todo -> + AgentChip { + Text(todo, fontSize = 12.5.sp, color = pal.onSurfaceVariant, maxLines = 1, overflow = TextOverflow.Ellipsis, modifier = Modifier.widthIn(max = 220.dp)) + } + } + for (queued in AgentHost.queue) AgentChip(warn = true) { + Text(stringResource(R.string.agent_queued, queued.text), fontSize = 12.5.sp, color = AttentionAmber, maxLines = 1, + overflow = TextOverflow.Ellipsis, modifier = Modifier.widthIn(max = 180.dp)) + Text( + stringResource(R.string.agent_send_now), fontSize = 12.5.sp, fontWeight = FontWeight.SemiBold, color = pal.onPrimary, + modifier = Modifier.clip(Shape12).background(pal.primary).clickable { AgentHost.sendNow(context, queued) } + .padding(horizontal = 8.dp, vertical = 3.dp).testTag("agent-send-now"), + ) + Icon(Icons.Outlined.Close, stringResource(R.string.agent_unqueue), tint = pal.onSurfaceVariant, + modifier = Modifier.size(22.dp).clip(CircleShape).clickable { AgentHost.unqueue(queued) }.padding(3.dp)) + } +} + +@Composable +private fun AgentChip(selected: Boolean = false, warn: Boolean = false, tag: String? = null, onClick: (() -> Unit)? = null, content: @Composable () -> Unit) { + val pal = LocalPalette.current + Row( + verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(6.dp), + modifier = Modifier.height(30.dp).clip(Shape12) + .background(if (warn) AttentionAmber.copy(alpha = 0.14f) else if (selected) pal.primary.copy(alpha = 0.2f) else pal.surfaceVariant) + .then(if (onClick != null) Modifier.clickable(onClick = onClick) else Modifier) + .then(if (tag != null) Modifier.testTag(tag) else Modifier) + .padding(horizontal = 9.dp), + ) { content() } +} + +/** How full the context is, or failing that the plan limit nearest its end; amber when little is left. */ +@Composable +private fun ContextRing(tag: String, onClick: () -> Unit) { + val pal = LocalPalette.current + val percent = usagePercent() ?: return + val warn = percent >= 80 + val tint = if (warn) AttentionAmber else pal.primary + Row( + verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(5.dp), + modifier = Modifier.height(30.dp).clip(Shape12).clickable(onClick = onClick).padding(horizontal = 6.dp).testTag(tag), + ) { + val track = pal.line + Canvas(Modifier.size(16.dp)) { + val stroke = Stroke(width = 2.5.dp.toPx(), cap = StrokeCap.Round) + drawArc(track, 0f, 360f, false, style = stroke) + drawArc(tint, -90f, 360f * percent / 100f, false, style = stroke) + } + Text("$percent%", fontSize = 12.5.sp, color = if (warn) AttentionAmber else pal.onSurfaceVariant) + } +} + +/** The context's fill, unless a plan limit is nearly reached: that is the wall the user meets first. */ +internal fun usagePercent(): Int? { + val limit = AgentHost.limits.maxOfOrNull { liveUsed(it) } + val context = if (AgentHost.window > 0 && AgentHost.context > 0) (AgentHost.context * 100 / AgentHost.window).toInt().coerceIn(0, 100) else null + return if (limit != null && (limit >= 90 || context == null)) maxOf(limit, context ?: 0) else context +} + +/** A limit whose window has passed since it was reported is back to nothing used. */ +internal fun liveUsed(limit: AgentHost.Limit) = if (limit.resetsAt > 0 && limit.resetsAt * 1000 < System.currentTimeMillis()) 0 else limit.usedPercent + +@Composable +private fun AgentComposer(composer: ComposerState, draftState: MutableState, visible: Boolean, onPanel: (AgentPanel) -> Unit, onSent: () -> Unit) { + val context = LocalContext.current + var draft by draftState + var labOpen by rememberSaveable { mutableStateOf(false) } + if (AgentHost.lab == null) labOpen = false + val send = send@{ + val text = draft.trim() + when (text.substringBefore(' ')) { + "/new" -> AgentHost.forget(context) + "/model" -> onPanel(AgentPanel.MODEL) + "/plan" -> AgentHost.choosePlan(context, !AgentHost.plan) + "/history" -> onPanel(AgentPanel.HISTORY) + "/processes" -> onPanel(AgentPanel.PROCESSES) + "/stop" -> AgentHost.stop(context) + else -> { + if (text.isEmpty() && AgentAttachments.pending.isEmpty()) return@send + AgentHost.send(context, text, AgentAttachments.pending.toList()) + AgentAttachments.pending.clear() + onSent() + } + } + draft = "" + } + val keyboardOpen = WindowInsets.ime.getBottom(LocalDensity.current) > 0 + Column(Modifier.fillMaxWidth().padding(bottom = if (keyboardOpen) 4.dp else 8.dp)) { + if (labOpen) AgentLabCard() + if (hasActivity()) Row( + horizontalArrangement = Arrangement.spacedBy(8.dp), verticalAlignment = Alignment.CenterVertically, + modifier = Modifier.padding(top = 8.dp).fillMaxWidth().horizontalScroll(rememberScrollState()), + ) { AgentActivity(labOpen) { labOpen = !labOpen } } + AgentEditor(composer, draftState, visible, send) + } +} + +/** The text with attach, stop and send beside it. */ +@Composable +private fun AgentEditor(composer: ComposerState, draftState: MutableState, visible: Boolean, send: () -> Unit) { + val context = LocalContext.current + val colors = MaterialTheme.colorScheme + val pal = LocalPalette.current + var draft by draftState + val voice = remember { AgentVoice(context.applicationContext, { draftState.value }) { draftState.value = it } } + val voiceAvailable = remember { AgentVoice.available(context) } + DisposableEffect(voice) { onDispose { voice.stop() } } + LaunchedEffect(visible) { if (!visible) voice.stop() } + val working = AgentHost.state == AgentHost.State.WORKING + if (draft.startsWith("/") && !draft.contains(' ')) { + val matches = (LOCAL_COMMANDS + CLI_COMMANDS).filter { it.startsWith(draft) && it != draft } + if (matches.isNotEmpty()) Row( + horizontalArrangement = Arrangement.spacedBy(8.dp), + modifier = Modifier.padding(top = 8.dp).fillMaxWidth().horizontalScroll(rememberScrollState()), + ) { + for (command in matches) Text( + command, fontSize = 13.sp, fontFamily = FontFamily.Monospace, color = pal.primary, + modifier = Modifier.clip(Shape12).background(pal.surfaceVariant).clickable { draft = "$command " }.padding(horizontal = 12.dp, vertical = 8.dp), + ) + } + } + if (AgentAttachments.pending.isNotEmpty()) Row( + horizontalArrangement = Arrangement.spacedBy(8.dp), + modifier = Modifier.padding(top = 8.dp).fillMaxWidth().horizontalScroll(rememberScrollState()), + ) { + for (path in AgentAttachments.pending.toList()) AttachmentChip(path) { AgentAttachments.pending.remove(path) } + } + var focused by remember { mutableStateOf(false) } + val field = remember { FocusRequester() } + LaunchedEffect(composer.focusRequests) { if (composer.hasUnconsumedFocusRequest()) runCatching { field.requestFocus() } } + Column( + Modifier.fillMaxWidth().padding(top = 8.dp).clip(Shape16).background(colors.surface) + .border(if (focused) 2.dp else 1.dp, if (focused) pal.primary else pal.line, Shape16).padding(6.dp), + ) { + Row(verticalAlignment = Alignment.Bottom) { + if (LocalActivityResultRegistryOwner.current != null) AttachButton() + if (AgentAttachments.gameFrame != null) GameFrameButton() + Box(Modifier.weight(1f).padding(start = 8.dp, top = 10.dp, bottom = 10.dp)) { + if (draft.isEmpty()) Text( + stringResource(if (working) R.string.agent_hint_working else R.string.agent_hint), fontSize = 16.sp, + color = pal.onSurfaceVariant, maxLines = 1, overflow = TextOverflow.Ellipsis, + ) + BasicTextField( + draft, { draft = it }, + Modifier.fillMaxWidth().focusRequester(field).onFocusChanged { + focused = it.isFocused + composer.focused = it.isFocused + if (it.isFocused) composer.consumeFocusRequest() + }.testTag("agent-input"), + textStyle = TextStyle(fontSize = 16.sp, color = colors.onSurface), + cursorBrush = SolidColor(pal.primary), + keyboardOptions = KeyboardOptions(imeAction = ImeAction.Send), + keyboardActions = KeyboardActions(onSend = { + voice.stop() + send() + }), + minLines = 1, + maxLines = 8, + ) + } + if (working) RoundButton(Icons.Outlined.Stop, stringResource(R.string.agent_stop), pal.error.copy(alpha = 0.22f), colors.error, "agent-stop") { + AgentHost.stop(context) + } + val canSend = draft.isNotBlank() || AgentAttachments.pending.isNotEmpty() + // An empty message has nothing to send, so the button there dictates one instead. + if ((!canSend || voice.listening) && voiceAvailable) VoiceButton(voice) { voice.start(draft) } + else RoundButton( + Icons.AutoMirrored.Outlined.Send, stringResource(if (working) R.string.agent_queue else R.string.agent_send), + if (canSend) pal.primary else pal.surfaceVariant, if (canSend) pal.onPrimary else pal.onSurfaceVariant, "agent-send", enabled = canSend, + ) { + voice.stop() + send() + } + } + } +} + +@Composable +private fun VoiceButton(voice: AgentVoice, onStart: () -> Unit) { + val context = LocalContext.current + val pal = LocalPalette.current + val ask = if (LocalActivityResultRegistryOwner.current != null) rememberLauncherForActivityResult(ActivityResultContracts.RequestPermission()) { granted -> + if (granted) onStart() else android.widget.Toast.makeText(context, R.string.agent_voice_denied, android.widget.Toast.LENGTH_SHORT).show() + } else null + RoundButton( + if (voice.listening) Icons.Outlined.MicOff else Icons.Outlined.Mic, stringResource(if (voice.listening) R.string.agent_voice_stop else R.string.agent_voice), + if (voice.listening) pal.primary else pal.surfaceVariant, if (voice.listening) pal.onPrimary else pal.onBackground, "agent-voice", + ) { + when { + voice.listening -> voice.finish() + context.checkSelfPermission(android.Manifest.permission.RECORD_AUDIO) == android.content.pm.PackageManager.PERMISSION_GRANTED -> onStart() + ask != null -> ask.launch(android.Manifest.permission.RECORD_AUDIO) + else -> android.widget.Toast.makeText(context, R.string.agent_voice_denied, android.widget.Toast.LENGTH_SHORT).show() + } + } +} + +/** Attaches what the running game shows, taken from its own surface so nothing drawn over it is in the picture. */ +@Composable +private fun GameFrameButton() { + val context = LocalContext.current + val pal = LocalPalette.current + RoundButton(Icons.Outlined.PhotoCamera, stringResource(R.string.agent_attach_game), pal.surfaceVariant, pal.onBackground, "agent-game-frame") { + val grab = AgentAttachments.gameFrame ?: return@RoundButton + val chat = AgentHost.chat + grab frame@{ frame -> + if (frame == null) { + android.widget.Toast.makeText(context, R.string.agent_attach_game_failed, android.widget.Toast.LENGTH_SHORT).show() + return@frame + } + Thread({ + val path = AgentAttachments.saveFrame(context, chat, frame) + frame.recycle() + android.os.Handler(android.os.Looper.getMainLooper()).post { + when { + path == null -> android.widget.Toast.makeText(context, R.string.agent_attach_game_failed, android.widget.Toast.LENGTH_SHORT).show() + AgentHost.chat == chat -> AgentAttachments.pending.add(path) + else -> AgentAttachments.discard(context, listOf(path)) + } + } + }, "agent-game-frame").start() + } + } +} + +@Composable +private fun AttachButton() { + val context = LocalContext.current + val pal = LocalPalette.current + val picker = rememberLauncherForActivityResult(ActivityResultContracts.OpenMultipleDocuments()) { uris -> + if (uris.isEmpty()) return@rememberLauncherForActivityResult + val chat = AgentHost.chat + Thread({ + val paths = AgentAttachments.copy(context, chat, uris) + android.os.Handler(android.os.Looper.getMainLooper()).post { + if (AgentHost.chat == chat) AgentAttachments.pending.addAll(paths) else AgentAttachments.discard(context, paths) + } + }, "agent-attach").start() + } + RoundButton(Icons.Outlined.AttachFile, stringResource(R.string.agent_attach), pal.surfaceVariant, pal.onBackground, "agent-attach") { + runCatching { picker.launch(arrayOf("*/*")) } + } +} + +@Composable +private fun RoundButton( + icon: ImageVector, label: String, background: androidx.compose.ui.graphics.Color, tint: androidx.compose.ui.graphics.Color, + tag: String, enabled: Boolean = true, onClick: () -> Unit, +) { + Box( + contentAlignment = Alignment.Center, + modifier = Modifier.padding(start = 6.dp).size(42.dp).clip(CircleShape).background(background) + .clickable(enabled = enabled, onClick = onClick).testTag(tag), + ) { + Icon(icon, label, tint = tint, modifier = Modifier.size(21.dp)) + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/ui/AgentPanels.kt b/app/src/main/java/com/droiddeck/launcher/ui/AgentPanels.kt new file mode 100644 index 0000000000..ce4135a73e --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/ui/AgentPanels.kt @@ -0,0 +1,429 @@ +package com.droiddeck.launcher.ui + +import android.text.format.DateUtils +import android.text.format.Formatter +import androidx.compose.foundation.background +import androidx.compose.foundation.border +import androidx.compose.foundation.clickable +import androidx.compose.foundation.horizontalScroll +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.height +import androidx.compose.foundation.layout.heightIn +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.shape.CircleShape +import androidx.compose.foundation.lazy.LazyColumn +import androidx.compose.foundation.lazy.items +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.text.selection.SelectionContainer +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.mutableIntStateOf +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.produceState +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.platform.testTag +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.text.BasicTextField +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.outlined.Close +import androidx.compose.material.icons.outlined.Search +import androidx.compose.material3.Icon +import androidx.compose.runtime.saveable.rememberSaveable +import androidx.compose.ui.graphics.SolidColor +import androidx.compose.ui.text.TextStyle +import androidx.compose.runtime.rememberCoroutineScope +import kotlinx.coroutines.launch +import com.droiddeck.launcher.agent.AgentTools +import com.droiddeck.launcher.R +import com.droiddeck.launcher.agent.AgentChats +import com.droiddeck.launcher.agent.AgentHarness +import com.droiddeck.launcher.agent.AgentHost +import com.droiddeck.launcher.agent.AgentProcesses +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.delay +import kotlinx.coroutines.withContext + +/** The model, reasoning effort and plan mode for the next turns; a conversation keeps going with whatever is chosen. */ +@Composable +internal fun AgentModelPicker() { + val context = LocalContext.current + val pal = LocalPalette.current + val models = remember(AgentHost.harness) { AgentHost.models(context) } + Column(Modifier.fillMaxWidth().padding(bottom = 10.dp), verticalArrangement = Arrangement.spacedBy(10.dp)) { + Row(horizontalArrangement = Arrangement.spacedBy(8.dp), modifier = Modifier.horizontalScroll(rememberScrollState())) { + val choices = listOf(AgentHarness.Model("", stringResource(R.string.agent_model_default))) + models + for (choice in choices) { + val id = choice.id.ifEmpty { null } + if (id == AgentHost.model) PrimaryButton(choice.label, compact = true) {} + else SecondaryButton(choice.label, compact = true) { AgentHost.chooseModel(context, id) } + } + } + if (AgentHost.harness.efforts.isNotEmpty()) Column(verticalArrangement = Arrangement.spacedBy(6.dp)) { + Text(stringResource(R.string.agent_effort), fontSize = 15.sp, fontWeight = FontWeight.SemiBold, color = MaterialTheme.colorScheme.onBackground, modifier = Modifier.padding(horizontal = 2.dp)) + Row(horizontalArrangement = Arrangement.spacedBy(8.dp), modifier = Modifier.horizontalScroll(rememberScrollState())) { + for (level in listOf(null) + AgentHost.harness.efforts) { + val label = level ?: stringResource(R.string.agent_model_default) + if (level == AgentHost.effort) PrimaryButton(label, compact = true) {} + else SecondaryButton(label, compact = true) { AgentHost.chooseEffort(context, level) } + } + } + } + if (AgentHost.harness.plans) Row(verticalAlignment = Alignment.CenterVertically, modifier = Modifier.fillMaxWidth().padding(horizontal = 2.dp)) { + Column(Modifier.weight(1f)) { + Text(stringResource(R.string.agent_plan), fontSize = 15.sp, fontWeight = FontWeight.SemiBold, color = MaterialTheme.colorScheme.onBackground) + Text(stringResource(R.string.agent_plan_hint), fontSize = 12.5.sp, color = pal.onSurfaceVariant) + } + ToggleSwitch(AgentHost.plan, label = stringResource(R.string.agent_plan)) { AgentHost.choosePlan(context, it) } + } + } +} + +@Composable +internal fun AgentHistory(modifier: Modifier, onOpened: () -> Unit) { + val context = LocalContext.current + val colors = MaterialTheme.colorScheme + val pal = LocalPalette.current + var version by remember { mutableIntStateOf(0) } + val chats by produceState(emptyList(), version, AgentHost.entries.size) { + value = withContext(Dispatchers.IO) { AgentChats.list(context) } + } + if (chats.isEmpty()) { + Box(modifier.fillMaxWidth(), contentAlignment = Alignment.Center) { + Text(stringResource(R.string.agent_history_empty), fontSize = 15.sp, color = pal.onSurfaceVariant) + } + return + } + var query by rememberSaveable { mutableStateOf("") } + val found by produceState?>(null, chats, query) { + if (query.isNotBlank()) delay(250) + value = withContext(Dispatchers.IO) { AgentChats.search(context, chats, query) } + } + val working = AgentHost.state == AgentHost.State.WORKING + Column(modifier.fillMaxWidth()) { + AgentHistorySearch(query) { query = it } + val shown = found ?: chats + if (shown.isEmpty()) Box(Modifier.weight(1f).fillMaxWidth(), contentAlignment = Alignment.Center) { + Text(stringResource(R.string.agent_history_no_match), fontSize = 15.sp, color = pal.onSurfaceVariant) + } else LazyColumn(Modifier.weight(1f).fillMaxWidth().clip(Shape14).background(colors.surface).border(1.dp, pal.line, Shape14)) { + items(shown, key = { it.id }) { chat -> AgentHistoryRow(chat, working, onOpened) { version++ } } + } + } +} + +@Composable +private fun AgentHistorySearch(query: String, onQuery: (String) -> Unit) { + val colors = MaterialTheme.colorScheme + val pal = LocalPalette.current + Row( + verticalAlignment = Alignment.CenterVertically, + modifier = Modifier.fillMaxWidth().padding(bottom = 8.dp).height(44.dp).clip(Shape14).background(colors.surface) + .border(1.dp, pal.line, Shape14).padding(horizontal = 12.dp), + ) { + Icon(Icons.Outlined.Search, null, tint = pal.onSurfaceVariant, modifier = Modifier.size(18.dp)) + Box(Modifier.weight(1f).padding(start = 8.dp)) { + if (query.isEmpty()) Text(stringResource(R.string.agent_history_search), fontSize = 15.sp, color = pal.onSurfaceVariant, maxLines = 1) + BasicTextField( + query, onQuery, singleLine = true, textStyle = TextStyle(fontSize = 15.sp, color = colors.onSurface), + cursorBrush = SolidColor(pal.primary), modifier = Modifier.fillMaxWidth().testTag("agent-history-search"), + ) + } + if (query.isNotEmpty()) Icon(Icons.Outlined.Close, stringResource(R.string.agent_close), tint = pal.onSurfaceVariant, + modifier = Modifier.size(28.dp).clip(CircleShape).clickable { onQuery("") }.padding(5.dp)) + } +} + +@Composable +private fun AgentHistoryRow(chat: AgentChats.Chat, working: Boolean, onOpened: () -> Unit, onDeleted: () -> Unit) { + val context = LocalContext.current + val colors = MaterialTheme.colorScheme + val pal = LocalPalette.current + Column { + var armed by remember(chat.id) { mutableStateOf(false) } + val current = chat.id == AgentHost.chat + Row( + verticalAlignment = Alignment.CenterVertically, + modifier = Modifier.fillMaxWidth().heightIn(min = 62.dp) + .clickable(enabled = !working || current) { + AgentHost.open(context, chat.id) + onOpened() + } + .background(if (current) pal.primary.copy(alpha = 0.12f) else colors.surface) + .padding(horizontal = 14.dp, vertical = 10.dp).testTag("agent-chat"), + ) { + Column(Modifier.weight(1f)) { + Text(chat.title, fontSize = 15.sp, fontWeight = FontWeight.SemiBold, color = colors.onBackground, maxLines = 1, overflow = TextOverflow.Ellipsis) + Text( + if (armed) stringResource(R.string.agent_history_delete_warning) + else AgentHarness.byId(chat.harness).name + " ยท " + when { + System.currentTimeMillis() - chat.updated < 60_000 -> stringResource(R.string.agent_just_now) + else -> DateUtils.getRelativeTimeSpanString(chat.updated, System.currentTimeMillis(), DateUtils.MINUTE_IN_MILLIS).toString() + }, + fontSize = 12.5.sp, color = if (armed) AttentionAmber else pal.onSurfaceVariant, + ) + } + SecondaryButton( + stringResource(if (armed) R.string.agent_storage_confirm else R.string.agent_history_delete), compact = true, + enabled = !(current && working), + ) { + if (armed) { + AgentHost.delete(context, chat.id) + onDeleted() + } else armed = true + } + } + Box(Modifier.fillMaxWidth().height(1.dp).background(pal.line)) + } +} + +/** Processes in the Linux userland, the agent's own first, each with a way to end it. */ +@Composable +internal fun AgentProcessList(modifier: Modifier) { + val context = LocalContext.current + val colors = MaterialTheme.colorScheme + val pal = LocalPalette.current + var refresh by remember { mutableIntStateOf(0) } + var procs by remember { mutableStateOf?>(null) } + LaunchedEffect(refresh) { + while (true) { + procs = withContext(Dispatchers.IO) { AgentProcesses.snapshot(AgentHost.turnPid) } + delay(2_000) + } + } + val list = procs ?: return + if (list.isEmpty()) { + Box(modifier.fillMaxWidth(), contentAlignment = Alignment.Center) { + Text(stringResource(R.string.agent_processes_empty), fontSize = 15.sp, color = pal.onSurfaceVariant) + } + return + } + LazyColumn(modifier.fillMaxWidth().clip(Shape14).background(colors.surface).border(1.dp, pal.line, Shape14)) { + items(list, key = { it.pid }) { proc -> + var open by remember(proc.pid) { mutableStateOf(false) } + Column(Modifier.fillMaxWidth().clickable { open = !open }.padding(horizontal = 14.dp, vertical = 10.dp).testTag("agent-process")) { + Row(verticalAlignment = Alignment.CenterVertically) { + Column(Modifier.weight(1f)) { + Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(8.dp)) { + Text(proc.name, fontSize = 15.sp, fontWeight = FontWeight.SemiBold, color = colors.onBackground) + if (proc.agent) Text(stringResource(R.string.agent_process_agent), fontSize = 11.sp, fontWeight = FontWeight.SemiBold, color = pal.primary, + modifier = Modifier.clip(Shape12).background(pal.primary.copy(alpha = 0.15f)).padding(horizontal = 6.dp, vertical = 1.dp)) + } + Text( + listOf("pid ${proc.pid}", clock(proc.seconds), Formatter.formatShortFileSize(context, proc.rssKb * 1024), "${proc.cpuPercent}% CPU").joinToString(" ยท "), + fontSize = 12.5.sp, color = pal.onSurfaceVariant, + ) + } + SecondaryButton(stringResource(R.string.agent_process_stop), compact = true) { + AgentProcesses.killTree(proc.pid) + refresh++ + } + } + SelectionContainer { + Text(proc.args, fontSize = 12.sp, fontFamily = FontFamily.Monospace, color = pal.onSurfaceVariant, + maxLines = if (open) 40 else 1, overflow = TextOverflow.Ellipsis, modifier = Modifier.padding(top = 4.dp)) + } + } + Box(Modifier.fillMaxWidth().height(1.dp).background(pal.line)) + } + } +} + +/** How full the conversation's context is, how much of the plan's limits is used, and what this conversation cost. */ +@Composable +internal fun AgentUsage() { + val context = LocalContext.current + val colors = MaterialTheme.colorScheme + val pal = LocalPalette.current + Column( + Modifier.fillMaxWidth().clip(Shape14).background(colors.surface).border(1.dp, pal.line, Shape14).padding(horizontal = 14.dp, vertical = 10.dp), + verticalArrangement = Arrangement.spacedBy(8.dp), + ) { + if (AgentHost.window > 0) UsageRow( + stringResource(R.string.agent_usage_context), + stringResource(R.string.agent_usage_of, tokens(AgentHost.context), tokens(AgentHost.window)), + (AgentHost.context.toFloat() / AgentHost.window).coerceIn(0f, 1f), + ) + for (limit in AgentHost.limits) { + val used = liveUsed(limit) + val label = when { + limit.minutes in 9_000..11_000 -> stringResource(R.string.agent_limit_week) + limit.minutes >= 60 -> stringResource(R.string.agent_limit_hours, limit.minutes / 60) + else -> stringResource(R.string.agent_limit_minutes, limit.minutes) + } + val value = if (limit.resetsAt * 1000 > System.currentTimeMillis()) stringResource(R.string.agent_limit_resets, used, resetTime(context, limit.resetsAt)) else "$used%" + UsageRow(label, value, used / 100f) + } + val turns = AgentHost.entries.filterIsInstance().mapNotNull { it.usage } + val cost = turns.sumOf { it.costUsd } + val ms = turns.sumOf { it.durationMs } + Row(verticalAlignment = Alignment.CenterVertically) { + val facts = buildList { + if (ms > 0) add(clock(ms / 1000)) + if (cost >= 0.005) add("$" + String.format(java.util.Locale.US, "%.2f", cost)) + } + Text( + if (facts.isEmpty()) stringResource(R.string.agent_usage_unknown) else stringResource(R.string.agent_usage_conversation, facts.joinToString(" ยท ")), + fontSize = 12.5.sp, color = pal.onSurfaceVariant, modifier = Modifier.weight(1f), + ) + if (AgentHost.harness.plans && AgentHost.entries.isNotEmpty() && AgentHost.state == AgentHost.State.IDLE) { + SecondaryButton("/compact", compact = true) { AgentHost.send(context, "/compact") } + } + } + } +} + +@Composable +private fun UsageRow(label: String, value: String, fraction: Float) { + val colors = MaterialTheme.colorScheme + val pal = LocalPalette.current + Column(verticalArrangement = Arrangement.spacedBy(4.dp)) { + Row(verticalAlignment = Alignment.CenterVertically) { + Text(label, fontSize = 14.sp, color = colors.onBackground, modifier = Modifier.weight(1f)) + Text(value, fontSize = 12.5.sp, color = pal.onSurfaceVariant) + } + LinearProgressIndicator( + progress = { fraction }, color = if (fraction >= 0.8f) AttentionAmber else pal.primary, trackColor = pal.surfaceVariant, + modifier = Modifier.fillMaxWidth().height(5.dp).clip(CircleShape), + ) + } +} + +/** A reset later today shows its time; one further off shows the day too. */ +private fun resetTime(context: android.content.Context, epochSeconds: Long): String { + val ms = epochSeconds * 1000 + val flags = if (ms - System.currentTimeMillis() < 20 * 3_600_000L) DateUtils.FORMAT_SHOW_TIME + else DateUtils.FORMAT_SHOW_WEEKDAY or DateUtils.FORMAT_ABBREV_WEEKDAY or DateUtils.FORMAT_SHOW_TIME + return DateUtils.formatDateTime(context, ms, flags) +} + +/** Claude Code's MCP servers, with a way to add and remove them, and the skills in its skills folder. */ +@Composable +internal fun AgentToolsPanel(modifier: Modifier) { + val context = LocalContext.current + val colors = MaterialTheme.colorScheme + val pal = LocalPalette.current + val scope = rememberCoroutineScope() + var version by remember { mutableIntStateOf(0) } + var loading by remember { mutableStateOf(true) } + val servers by produceState?>(null, version) { + loading = true + value = withContext(Dispatchers.IO) { AgentTools.servers(context) } + loading = false + } + val skills by produceState(emptyList(), version) { value = withContext(Dispatchers.IO) { AgentTools.skills(context) } } + var name by rememberSaveable { mutableStateOf("") } + var target by rememberSaveable { mutableStateOf("") } + var busy by remember { mutableStateOf(false) } + var message by remember { mutableStateOf(null) } + fun act(added: Boolean = false, action: suspend () -> AgentTools.Result) { + busy = true + message = null + scope.launch { + val result = withContext(Dispatchers.IO) { action() } + busy = false + if (!result.ok) message = result.output.ifBlank { context.getString(R.string.agent_tools_failed) } + else if (added) { + name = "" + target = "" + } + version++ + } + } + LazyColumn(modifier.fillMaxWidth(), verticalArrangement = Arrangement.spacedBy(8.dp)) { + item { ToolsHeading(stringResource(R.string.agent_tools_servers)) } + val list = servers + when { + loading && list == null -> item { Text(stringResource(R.string.agent_tools_loading), fontSize = 13.sp, color = pal.onSurfaceVariant) } + list == null -> item { Text(stringResource(R.string.agent_tools_failed), fontSize = 13.sp, color = AttentionAmber) } + list.isEmpty() -> item { Text(stringResource(R.string.agent_tools_no_servers), fontSize = 13.sp, color = pal.onSurfaceVariant) } + else -> items(list, key = { "mcp:" + it.name }) { server -> + var armed by remember(server.name) { mutableStateOf(false) } + ToolsRow(server.name, server.target + " ยท " + server.status) { + if (!server.account) SecondaryButton( + stringResource(if (armed) R.string.agent_storage_confirm else R.string.agent_tools_remove), compact = true, enabled = !busy, + ) { if (armed) act { AgentTools.remove(context, server.name) } else armed = true } + } + } + } + item { + Column( + Modifier.fillMaxWidth().clip(Shape14).background(colors.surface).border(1.dp, pal.line, Shape14).padding(12.dp), + verticalArrangement = Arrangement.spacedBy(8.dp), + ) { + ToolsField(name, { name = it }, stringResource(R.string.agent_tools_name), "agent-tools-name") + ToolsField(target, { target = it }, stringResource(R.string.agent_tools_target), "agent-tools-target") + Row(verticalAlignment = Alignment.CenterVertically) { + Text(stringResource(R.string.agent_tools_add_hint), fontSize = 12.sp, color = pal.onSurfaceVariant, modifier = Modifier.weight(1f)) + PrimaryButton(stringResource(R.string.agent_tools_add), enabled = !busy && name.isNotBlank() && target.isNotBlank(), compact = true) { + act(added = true) { AgentTools.add(context, name, target) } + } + } + message?.let { Text(it, fontSize = 12.sp, fontFamily = FontFamily.Monospace, color = AttentionAmber) } + } + } + item { ToolsHeading(stringResource(R.string.agent_tools_skills)) } + if (skills.isEmpty()) item { Text(stringResource(R.string.agent_tools_no_skills), fontSize = 13.sp, color = pal.onSurfaceVariant) } + items(skills, key = { "skill:" + it.name }) { skill -> + var armed by remember(skill.name) { mutableStateOf(false) } + ToolsRow(skill.name, skill.description) { + SecondaryButton(stringResource(if (armed) R.string.agent_storage_confirm else R.string.agent_history_delete), compact = true, enabled = !busy) { + if (armed) act { + AgentTools.Result(AgentTools.deleteSkill(context, skill.name), "") + } else armed = true + } + } + } + } +} + +@Composable +private fun ToolsHeading(text: String) { + Text(text, fontSize = 13.sp, fontWeight = FontWeight.SemiBold, color = LocalPalette.current.onSurfaceVariant, modifier = Modifier.padding(top = 6.dp)) +} + +@Composable +private fun ToolsRow(title: String, detail: String, action: @Composable () -> Unit) { + val colors = MaterialTheme.colorScheme + val pal = LocalPalette.current + Row( + verticalAlignment = Alignment.CenterVertically, + modifier = Modifier.fillMaxWidth().clip(Shape14).background(colors.surface).border(1.dp, pal.line, Shape14).padding(horizontal = 14.dp, vertical = 10.dp), + ) { + Column(Modifier.weight(1f)) { + Text(title, fontSize = 15.sp, fontWeight = FontWeight.SemiBold, color = colors.onBackground, maxLines = 1, overflow = TextOverflow.Ellipsis) + if (detail.isNotBlank()) Text(detail, fontSize = 12.5.sp, color = pal.onSurfaceVariant, maxLines = 2, overflow = TextOverflow.Ellipsis) + } + action() + } +} + +@Composable +private fun ToolsField(value: String, onValue: (String) -> Unit, hint: String, tag: String) { + val colors = MaterialTheme.colorScheme + val pal = LocalPalette.current + Box(Modifier.fillMaxWidth().clip(Shape12).background(pal.surfaceVariant).padding(horizontal = 12.dp, vertical = 10.dp)) { + if (value.isEmpty()) Text(hint, fontSize = 14.sp, color = pal.onSurfaceVariant, maxLines = 1) + BasicTextField( + value, onValue, singleLine = true, textStyle = TextStyle(fontSize = 14.sp, fontFamily = FontFamily.Monospace, color = colors.onSurface), + cursorBrush = SolidColor(pal.primary), modifier = Modifier.fillMaxWidth().testTag(tag), + ) + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/ui/AgentPet.kt b/app/src/main/java/com/droiddeck/launcher/ui/AgentPet.kt new file mode 100644 index 0000000000..8adadcab9c --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/ui/AgentPet.kt @@ -0,0 +1,323 @@ +package com.droiddeck.launcher.ui + +import android.app.Activity +import android.app.Application +import android.content.Context +import android.content.Intent +import android.net.Uri +import android.os.Bundle +import android.os.Handler +import android.os.Looper +import android.os.SystemClock +import android.provider.Settings +import android.view.View +import android.view.ViewGroup +import android.widget.FrameLayout +import androidx.compose.foundation.background +import androidx.compose.foundation.border +import androidx.compose.foundation.gestures.detectDragGestures +import androidx.compose.foundation.gestures.detectTapGestures +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.BoxWithConstraints +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.offset +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.widthIn +import androidx.compose.foundation.shape.CircleShape +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableIntStateOf +import androidx.compose.runtime.mutableLongStateOf +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue +import androidx.compose.runtime.snapshotFlow +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.input.pointer.pointerInput +import androidx.compose.ui.layout.onSizeChanged +import androidx.compose.ui.platform.ComposeView +import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.platform.LocalDensity +import androidx.compose.ui.platform.testTag +import androidx.compose.ui.semantics.contentDescription +import androidx.compose.ui.semantics.onClick +import androidx.compose.ui.semantics.role +import androidx.compose.ui.semantics.semantics +import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.unit.IntOffset +import androidx.compose.ui.unit.IntSize +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import com.droiddeck.launcher.agent.AgentHost +import kotlinx.coroutines.MainScope +import kotlinx.coroutines.delay +import kotlinx.coroutines.launch +import kotlin.math.roundToInt + +/** A DroidDeck window the pet can live in when it may not float over other apps. */ +internal interface AgentPetHost { + /** Something already covers the pet's place, such as the session drawer. */ + val petBlocked: Boolean +} + +/** + * DeeDee, the agent's pet: shows what the agent is doing and opens a chat with it. With the + * "display over other apps" permission it floats over every app in windows of its own + * ([PetWindows]); without it, it lives in DroidDeck's own windows. Either way it opens the same + * chat, growing out of it. + */ +internal object AgentPet { + var enabled by mutableStateOf(false) + private set + /** May draw over other apps. */ + var allowed by mutableStateOf(false) + private set + /** Agent pages on screen; the pet steps aside while the conversation itself is in view. */ + var agentOnScreen by mutableIntStateOf(0) + var now by mutableLongStateOf(SystemClock.elapsedRealtime()) + private set + /** When the agent last changed what it was doing. */ + var since by mutableLongStateOf(SystemClock.elapsedRealtime()) + private set + /** The floating windows could not be made, so the pet stays in DroidDeck's own windows instead. */ + private var floatFailed by mutableStateOf(false) + val floating get() = enabled && allowed && !floatFailed + /** How to close the chat open inside each DroidDeck window that has one. */ + private val closeInWindow = java.util.WeakHashMap Unit>() + + /** + * B and Back close a chat open inside [host] before the window acts on them, since the window's + * own keys (leaving a session, going back a page) would otherwise run under it. + */ + fun handleBack(host: AgentPetHost, event: android.view.KeyEvent): Boolean { + val close = closeInWindow[host] ?: return false + if (event.keyCode != android.view.KeyEvent.KEYCODE_BACK && event.keyCode != android.view.KeyEvent.KEYCODE_BUTTON_B) return false + if (event.action == android.view.KeyEvent.ACTION_UP) close() + return true + } + + internal fun chatOpenInWindow(host: AgentPetHost, close: (() -> Unit)?) { + if (close == null) closeInWindow.remove(host) else closeInWindow[host] = close + } + private var windows: PetWindows? = null + private val main = Handler(Looper.getMainLooper()) + private const val TAG = "agent-pet" + private const val KEY = "pet" + private const val SIDE = "pet_side" + private const val HEIGHT = "pet_y" + + fun set(context: Context, on: Boolean) { + enabled = on + AgentHost.prefs(context).edit().putBoolean(KEY, on).apply() + if (on) { + allowed = PetWindows.allowed(context) + if (!allowed) requestFloating(context) + } + } + + /** Opens the system page where the user lets DroidDeck draw over other apps. */ + fun requestFloating(context: Context) { + val intent = Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION, Uri.parse("package:${context.packageName}")) + .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) + runCatching { context.startActivity(intent) } + } + + internal fun place(context: Context) = AgentHost.prefs(context).let { it.getBoolean(SIDE, true) to it.getFloat(HEIGHT, 0.3f) } + + internal fun save(context: Context, right: Boolean, height: Float) { + AgentHost.prefs(context).edit().putBoolean(SIDE, right).putFloat(HEIGHT, height).apply() + } + + fun install(app: Application) { + enabled = AgentHost.prefs(app).getBoolean(KEY, false) + allowed = PetWindows.allowed(app) + val scope = MainScope() + scope.launch { + snapshotFlow { Triple(AgentHost.state, AgentHost.entries.size, AgentHost.lab?.running) }.collect { since = SystemClock.elapsedRealtime() } + } + scope.launch { + snapshotFlow { floating && AgentHost.installed }.collect { show -> + if (show && windows == null) windows = runCatching { PetWindows(app) }.onFailure { + android.util.Log.w("AgentPet", "could not float the pet", it) + floatFailed = true + }.getOrNull() + if (!show) windows?.close()?.also { windows = null } + } + } + tick(app) + app.registerActivityLifecycleCallbacks(object : Application.ActivityLifecycleCallbacks { + override fun onActivityResumed(activity: Activity) { + allowed = PetWindows.allowed(activity) + attach(activity) + } + override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) = Unit + override fun onActivityStarted(activity: Activity) = Unit + override fun onActivityPaused(activity: Activity) = Unit + override fun onActivityStopped(activity: Activity) = Unit + override fun onActivitySaveInstanceState(activity: Activity, outState: Bundle) = Unit + override fun onActivityDestroyed(activity: Activity) = Unit + }) + } + + private fun tick(app: Application) { + now = SystemClock.elapsedRealtime() + // The permission can be granted or taken back in Settings while DroidDeck is away. + if (enabled) allowed = PetWindows.allowed(app) + main.postDelayed({ tick(app) }, 1_000) + } + + private fun attach(activity: Activity) { + val host = activity as? AgentPetHost ?: return + val decor = activity.window.decorView as? ViewGroup ?: return + if (decor.findViewWithTag(TAG) != null) return + val layer = ComposeView(activity).apply { + tag = TAG + isFocusable = false + importantForAccessibility = View.IMPORTANT_FOR_ACCESSIBILITY_NO + setContent { DroidDeckTheme(appScale = com.droiddeck.launcher.core.AppUiPrefs.scale(activity)) { PetLayer(host) } } + } + decor.addView(layer, FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)) + } +} + +private const val SLEEP_AFTER_MS = 5 * 60_000L +private const val CHEER_MS = 10_000L +internal const val PREVIEW_MS = 6_000L + +/** What the agent is up to, as the pet shows it; [since] is when the agent last changed what it was doing. */ +internal fun petState(now: Long, since: Long): PetState { + if (AgentHost.state == AgentHost.State.WORKING || AgentHost.lab?.running == true) return PetState.WORKING + val last = AgentHost.entries.lastOrNull { it is AgentHost.Entry.Finished } as? AgentHost.Entry.Finished + if (AgentHost.unseen && last != null && !last.stopped) { + if (last.error != null) return PetState.ERROR + val said = (AgentHost.entries.lastOrNull { it is AgentHost.Entry.Said } as? AgentHost.Entry.Said)?.text?.trimEnd().orEmpty() + if (last.planned || said.endsWith("?")) return PetState.QUESTION + if (now - since < CHEER_MS) return PetState.DONE + } + return if (now - since > SLEEP_AFTER_MS) PetState.SLEEP else PetState.IDLE +} + +internal fun petStateNow() = petState(AgentPet.now, AgentPet.since) + +/** The line the preview bubble shows while the pet has news, or null when it has none. */ +internal fun petBubbleText(): String? { + if (!AgentHost.unseen) return null + val state = petStateNow() + if (state != PetState.DONE && state != PetState.QUESTION && state != PetState.ERROR) return null + val last = AgentHost.entries.lastOrNull { it is AgentHost.Entry.Finished } as? AgentHost.Entry.Finished + last?.error?.let { return it } + val said = AgentHost.entries.lastOrNull { it is AgentHost.Entry.Said } as? AgentHost.Entry.Said ?: return null + return said.text.lineSequence().map { it.trim().trimStart('#', '*', '-', ' ') }.firstOrNull { it.isNotEmpty() } +} + +/** DeeDee in [state], with a dot while a reply waits to be read. */ +@Composable +internal fun PetFigure(state: PetState, modifier: Modifier) { + Box(modifier.testTag("agent-pet")) { + Box(Modifier.fillMaxSize().padding(4.dp).clip(CircleShape).background(Color(0xEB0E141B)).border(1.dp, Color(0x29FFFFFF), CircleShape)) + DeeDee(state, Modifier.fillMaxSize().padding(6.dp)) + if (AgentHost.unseen && (state == PetState.IDLE || state == PetState.SLEEP)) Box( + Modifier.align(Alignment.TopEnd).padding(8.dp).size(14.dp).clip(CircleShape).background(Color(0xFF1A9FFF)).border(2.dp, Color(0xFF0E141B), CircleShape), + ) + } +} + +@Composable +internal fun PetPreview(text: String, modifier: Modifier, onTap: () -> Unit) { + val shape = RoundedCornerShape(16.dp) + Text( + text, fontSize = 14.sp, color = Color.White, maxLines = 2, overflow = TextOverflow.Ellipsis, + modifier = modifier.widthIn(max = 260.dp).clip(shape).background(Color(0xF0171D25)).border(1.dp, Color(0x33FFFFFF), shape) + .pointerInput(Unit) { detectTapGestures { onTap() } }.padding(horizontal = 14.dp, vertical = 10.dp), + ) +} + +/** The pet inside one DroidDeck window, for when it may not float over other apps. */ +@Composable +private fun PetLayer(host: AgentPetHost) { + var chatOpen by remember { mutableStateOf(false) } + var chatShown by remember { mutableStateOf(false) } + val shown = AgentPet.enabled && !AgentPet.floating && AgentHost.installed && (chatShown || AgentPet.agentOnScreen == 0) && !host.petBlocked + if (!shown) return + val context = LocalContext.current + val motion = remember { PetMotion(context) } + val density = LocalDensity.current + val openLabel = androidx.compose.ui.res.stringResource(com.droiddeck.launcher.R.string.agent_pet_open) + val openChat = { + motion.dock() + chatShown = true + chatOpen = true + } + val closeChat = { + chatOpen = false + motion.undock() + } + BoxWithConstraints(Modifier.fillMaxSize()) { + motion.fit(constraints.maxWidth.toFloat(), constraints.maxHeight.toFloat()) + if (chatShown) PetChat(chatOpen, motion, closeChat) { chatShown = false } + androidx.compose.runtime.DisposableEffect(host, chatOpen) { + AgentPet.chatOpenInWindow(host, if (chatOpen) closeChat else null) + onDispose { AgentPet.chatOpenInWindow(host, null) } + } + var bubble by remember { mutableStateOf(null) } + val news = petBubbleText() + LaunchedEffect(news) { + bubble = news + if (news != null) { + delay(PREVIEW_MS) + bubble = null + } + } + if (motion.dragging) Box(Modifier.offset { + val (tx, ty) = motion.target + IntOffset((tx - motion.size / 2).roundToInt(), (ty - motion.size / 2).roundToInt()) + }) { PetCloseTarget(motion.overTarget) } + val text = bubble + if (text != null && !motion.dragging) { + var size by remember { mutableStateOf(IntSize.Zero) } + val gap = with(density) { 10.dp.toPx() } + PetPreview(text, Modifier.onSizeChanged { size = it }.offset { + val x = if (motion.right) motion.x - gap - size.width else motion.x + motion.size + gap + IntOffset(x.roundToInt(), (motion.y + motion.size / 2 - size.height / 2).roundToInt()) + }) { + bubble = null + openChat() + } + } + PetFigure( + petStateNow(), + Modifier.offset { IntOffset(motion.x.roundToInt(), motion.y.roundToInt()) } + .size(with(density) { motion.size.toDp() }) + .semantics { + contentDescription = openLabel + role = androidx.compose.ui.semantics.Role.Button + onClick { if (chatOpen) closeChat() else openChat(); true } + } + .pointerInput(Unit) { detectTapGestures { bubble = null; if (chatOpen) closeChat() else openChat() } } + .pointerInput(Unit) { + // The pet moves under the finger, so its velocity is measured where it is on the screen. + val tracker = androidx.compose.ui.input.pointer.util.VelocityTracker() + detectDragGestures( + onDragStart = { bubble = null; if (chatOpen) closeChat(); tracker.resetTracking(); motion.start() }, + onDrag = { change, amount -> + change.consume() + motion.move(amount.x, amount.y) + tracker.addPosition(change.uptimeMillis, androidx.compose.ui.geometry.Offset(motion.x + change.position.x, motion.y + change.position.y)) + }, + onDragEnd = { + val v = tracker.calculateVelocity() + if (motion.end(v.x, v.y)) AgentPet.set(context, false) + }, + onDragCancel = { motion.cancel() }, + ) + }, + ) + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/ui/AgentPetWindows.kt b/app/src/main/java/com/droiddeck/launcher/ui/AgentPetWindows.kt new file mode 100644 index 0000000000..cea5fcaf3b --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/ui/AgentPetWindows.kt @@ -0,0 +1,572 @@ +package com.droiddeck.launcher.ui + +import android.animation.ValueAnimator +import android.annotation.SuppressLint +import android.content.Context +import android.graphics.PixelFormat +import android.os.Build +import android.provider.Settings +import android.view.Gravity +import android.view.KeyEvent +import android.view.MotionEvent +import android.view.View +import android.view.ViewConfiguration +import android.view.WindowManager +import android.view.animation.OvershootInterpolator +import android.widget.FrameLayout +import androidx.compose.foundation.background +import androidx.compose.foundation.border +import androidx.compose.foundation.clickable +import androidx.compose.foundation.interaction.MutableInteractionSource +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.BoxWithConstraints +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.offset +import androidx.compose.foundation.layout.width +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.outlined.Close +import androidx.compose.material3.Icon +import androidx.compose.material3.MaterialTheme +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableFloatStateOf +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue +import androidx.compose.runtime.snapshotFlow +import androidx.compose.animation.core.Animatable +import androidx.compose.foundation.Canvas +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.ui.Alignment +import androidx.compose.ui.geometry.CornerRadius +import androidx.compose.ui.geometry.Offset +import androidx.compose.ui.geometry.Rect +import androidx.compose.ui.geometry.Size +import androidx.compose.ui.graphics.Path +import androidx.compose.ui.graphics.drawscope.Stroke +import androidx.compose.ui.unit.IntOffset +import kotlinx.coroutines.coroutineScope +import kotlinx.coroutines.delay +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.graphicsLayer +import androidx.compose.ui.input.key.onPreviewKeyEvent +import androidx.compose.ui.platform.ComposeView +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.unit.dp +import androidx.lifecycle.Lifecycle +import androidx.lifecycle.LifecycleOwner +import androidx.lifecycle.LifecycleRegistry +import androidx.lifecycle.setViewTreeLifecycleOwner +import androidx.savedstate.SavedStateRegistry +import androidx.savedstate.SavedStateRegistryController +import androidx.savedstate.SavedStateRegistryOwner +import androidx.savedstate.setViewTreeSavedStateRegistryOwner +import com.droiddeck.launcher.R +import com.droiddeck.launcher.agent.AgentHost +import kotlinx.coroutines.MainScope +import kotlinx.coroutines.cancel +import kotlinx.coroutines.flow.collectLatest +import kotlinx.coroutines.launch +import kotlin.math.abs +import kotlin.math.hypot +import kotlin.math.roundToInt + +/** + * Where the pet is on the screen and how it moves: dragged anywhere, then settling against the + * nearer side edge, or dropped on the close target to turn it off. While its chat is open it is + * docked at the top corner, the way a chat head hops up when its conversation opens, and goes home + * when the chat closes. Positions are screen pixels. + */ +internal class PetMotion(private val context: Context) { + var x by mutableFloatStateOf(0f) + private set + var y by mutableFloatStateOf(0f) + private set + var right by mutableStateOf(true) + private set + var dragging by mutableStateOf(false) + private set + var width by mutableFloatStateOf(0f) + private set + var height by mutableFloatStateOf(0f) + private set + /** Docked for the chat; where to go back to is kept as a side and a relative height. */ + var docked by mutableStateOf(false) + private set + private val density = context.resources.displayMetrics.density + val size = 76 * density + private val margin = 6 * density + private val inset = 24 * density + private var settle: ValueAnimator? = null + // A fling's overshoot may carry the pet past the edge it settles on, but never so far that it leaves the screen. + private val spring = FlingSpring { sx, sy -> + x = sx.coerceIn(-size / 2, (width - size / 2).coerceAtLeast(-size / 2)) + y = sy.coerceIn(0f, (height - size).coerceAtLeast(0f)) + } + + val dockX get() = width - size - margin + + private companion object { + /** The share of the pet that hangs past the edge it rests against. */ + const val TUCK = 0.2f + } + val dockY get() = inset + val target get() = Pair(width / 2, height - 72 * density) + val overTarget get() = dragging && hypot(x + size / 2 - target.first, y + size / 2 - target.second) < size + + /** Fits the pet into a [w] by [h] screen, keeping its side and relative height, as after a rotation. */ + fun fit(w: Float, h: Float) { + if (w <= 0 || h <= 0 || (w == width && h == height)) return + val first = width == 0f + val fraction = if (first) AgentPet.place(context).also { right = it.first }.second else if (docked) home else fractionOf(y) + settle?.cancel() + spring.cancel() + width = w + height = h + home = fraction + if (docked) { + x = dockX + y = dockY + } else { + x = edge(right) + y = inset + travel() * fraction + } + } + + private var home = 0f + private fun travel() = (height - size - inset * 2).coerceAtLeast(0f) + private fun fractionOf(at: Float) = if (travel() > 0) ((at - inset) / travel()).coerceIn(0f, 1f) else 0f + /** At rest the pet tucks part of itself past the screen edge, as a chat head does. */ + private fun edge(side: Boolean) = if (side) width - size * (1f - TUCK) else -size * TUCK + + /** Hops up to the top corner for the chat. */ + fun dock() { + if (docked) return + home = fractionOf(y) + docked = true + glide(dockX, dockY, 260, OvershootInterpolator(0.9f)) + } + + /** Goes back to where it was before the chat opened. */ + fun undock() { + if (!docked) return + docked = false + glide(edge(right), inset + travel() * home, 320, android.view.animation.DecelerateInterpolator(1.6f)) + } + + fun start() { + settle?.cancel() + spring.cancel() + docked = false + dragging = true + } + + fun move(dx: Float, dy: Float) { + x += dx + y += dy + } + + /** A drag the system took away: the pet goes back to an edge, never to the close target. */ + fun cancel() { + if (!dragging) return + dragging = false + right = x + size / 2 > width / 2 + val toY = y.coerceIn(inset, (height - size - inset).coerceAtLeast(inset)) + home = fractionOf(toY) + spring.start(x, y, 0f, 0f, edge(right), toY) + } + + /** Ends a drag let go at [vx], [vy] pixels per second; true when the pet was dropped on the close target. */ + fun end(vx: Float = 0f, vy: Float = 0f): Boolean { + val dismissed = overTarget + dragging = false + if (dismissed) return true + right = EdgeFling.toRight(x + size / 2, width, vx, density) + val toY = EdgeFling.restY(y, vy, inset, height - size - inset) + home = fractionOf(toY) + AgentPet.save(context, right, home) + spring.start(x, y, vx, vy, edge(right), toY) + return false + } + + private fun glide(toX: Float, toY: Float, ms: Long, curve: android.animation.TimeInterpolator) { + settle?.cancel() + spring.cancel() + val fromX = x + val fromY = y + settle = ValueAnimator.ofFloat(0f, 1f).apply { + duration = (ms * Motion.scale).toLong().coerceAtLeast(0) + interpolator = curve + addUpdateListener { + val f = it.animatedValue as Float + x = fromX + (toX - fromX) * f + y = fromY + (toY - fromY) * f + } + start() + } + } +} + +/** Lets a ComposeView live in a window no activity owns. */ +private class OverlayOwner : LifecycleOwner, SavedStateRegistryOwner { + private val registry = LifecycleRegistry(this) + private val saved = SavedStateRegistryController.create(this) + override val lifecycle: Lifecycle get() = registry + override val savedStateRegistry: SavedStateRegistry get() = saved.savedStateRegistry + + init { + saved.performRestore(null) + registry.currentState = Lifecycle.State.RESUMED + } + + fun destroy() { + registry.currentState = Lifecycle.State.DESTROYED + } +} + +/** + * The pet over every app, in windows of its own: the pet, its message preview, the close target + * while it is dragged, and the chat it opens. Needs the "display over other apps" permission. + */ +@SuppressLint("ClickableViewAccessibility") +internal class PetWindows(private val context: Context) { + private val windows = context.getSystemService(WindowManager::class.java) + private val owner = OverlayOwner() + private val motion = PetMotion(context) + private val scope = MainScope() + /** The chat is open, or opening; its window stays up until it has shrunk back into the pet. */ + private var chatOpen by mutableStateOf(false) + private var bubble by mutableStateOf(null) + private var bubbleWidth by mutableFloatStateOf(0f) + private var bubbleHeight by mutableFloatStateOf(0f) + /** The windows are in the window manager, so moving one goes through it. */ + private var added = false + private val turns = object : android.content.ComponentCallbacks { + override fun onConfigurationChanged(newConfig: android.content.res.Configuration) = fitScreen() + @Deprecated("Deprecated in Java") + override fun onLowMemory() = Unit + } + + // A window emptied to no size keeps showing its last frame, so each is hidden as a whole instead. + private val head = window(touchable = true, focusable = false) { + PetFigure(petStateNow(), Modifier.size(76.dp)) + } + private val preview = window(touchable = true, focusable = false, onSize = { w, h -> bubbleWidth = w.toFloat(); bubbleHeight = h.toFloat() }) { + bubble?.let { PetPreview(it, Modifier.padding(2.dp)) { openChat() } } + } + private val target = window(touchable = false, focusable = false) { + PetCloseTarget(motion.overTarget) + } + private val chat: Window = window(touchable = true, focusable = true, full = true) { + PetChat(chatOpen, motion, ::closeChat) { showChat(false) } + } + + init { + head.view.setOnTouchListener(DragTouch()) + head.view.contentDescription = context.getString(R.string.agent_pet_open) + head.view.setOnClickListener { if (chatOpen) closeChat() else openChat() } + scope.launch { snapshotFlow { Triple(motion.x, motion.y, motion.right) }.collectLatest { place() } } + scope.launch { snapshotFlow { bubbleWidth to bubbleHeight }.collectLatest { place() } } + scope.launch { snapshotFlow { AgentPet.agentOnScreen == 0 }.collectLatest { setVisible(head, it) } } + scope.launch { snapshotFlow { motion.dragging }.collectLatest { setVisible(target, it) } } + scope.launch { + snapshotFlow { bubble != null && !chatOpen && !motion.dragging && AgentPet.agentOnScreen == 0 }.collectLatest { setVisible(preview, it) } + } + scope.launch { + snapshotFlow { petBubbleText() }.collectLatest { text -> + bubble = text + if (text != null) { + kotlinx.coroutines.delay(PREVIEW_MS) + bubble = null + } + } + } + fitScreen() + context.registerComponentCallbacks(turns) + place() + listOf(target, preview).forEach { setVisible(it, false) } + showChat(false) + listOf(chat, target, preview, head).forEach { windows.addView(it.view, it.params) } + added = true + } + + private class Window(val view: FrameLayout, val params: WindowManager.LayoutParams, val touchable: Boolean) + + private fun window( + touchable: Boolean, focusable: Boolean, full: Boolean = false, onSize: ((Int, Int) -> Unit)? = null, content: @Composable () -> Unit, + ): Window { + val compose = ComposeView(context).apply { + setViewTreeLifecycleOwner(owner) + setViewTreeSavedStateRegistryOwner(owner) + setContent { DroidDeckTheme(appScale = com.droiddeck.launcher.core.AppUiPrefs.scale(context)) { content() } } + } + val frame = object : FrameLayout(context) { + override fun dispatchKeyEvent(event: KeyEvent): Boolean { + if (full && event.keyCode == KeyEvent.KEYCODE_BACK && event.action == KeyEvent.ACTION_UP && chatOpen) { + closeChat() + return true + } + return super.dispatchKeyEvent(event) + } + }.apply { + addView(compose) + setViewTreeLifecycleOwner(owner) + setViewTreeSavedStateRegistryOwner(owner) + } + val size = if (full) WindowManager.LayoutParams.MATCH_PARENT else WindowManager.LayoutParams.WRAP_CONTENT + val params = WindowManager.LayoutParams( + size, size, WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY, + (if (focusable) 0 else WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE) or + (if (touchable) 0 else WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE) or + WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN or + (if (full) 0 else WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS), + PixelFormat.TRANSLUCENT, + ).apply { + gravity = Gravity.TOP or Gravity.START + if (full) softInputMode = WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES + noMoveAnimation(this) + } + if (onSize != null) compose.addOnLayoutChangeListener { v, _, _, _, _, _, _, _, _ -> onSize(v.width, v.height) } + return Window(frame, params, touchable) + } + + /** + * The system otherwise eases a moved overlay from where it last placed it, so the pet trails behind + * the finger, lags the chat as it opens, or flashes at an old spot. setCanPlayMoveAnimation sets the + * same flag but makes some ROMs refuse the window, so the flag is set directly. + */ + private fun noMoveAnimation(params: WindowManager.LayoutParams) { + runCatching { + val field = WindowManager.LayoutParams::class.java.getField("privateFlags") + field.setInt(params, field.getInt(params) or PRIVATE_FLAG_NO_MOVE_ANIMATION) + } + } + + /** A hidden overlay window still owns its frame, which the system can stretch over the screen, so it also stops taking touches. */ + private fun setVisible(window: Window, shown: Boolean) { + window.view.visibility = if (shown) View.VISIBLE else View.GONE + setTouchable(window, shown && window.touchable) + } + + private fun setTouchable(window: Window, on: Boolean) { + val flags = if (on) window.params.flags and WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE.inv() + else window.params.flags or WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE + if (flags == window.params.flags) return + window.params.flags = flags + if (added) runCatching { windows.updateViewLayout(window.view, window.params) } + } + + private fun place() { + val gap = 10 * context.resources.displayMetrics.density + update(head, motion.x, motion.y) + val bx = if (motion.right) motion.x - gap - bubbleWidth else motion.x + motion.size + gap + update(preview, bx, motion.y + motion.size / 2 - bubbleHeight / 2) + val (tx, ty) = motion.target + update(target, tx - motion.size / 2, ty - motion.size / 2) + } + + private fun update(window: Window, x: Float, y: Float) { + if (window.params.x == x.roundToInt() && window.params.y == y.roundToInt()) return + window.params.x = x.roundToInt() + window.params.y = y.roundToInt() + if (added) runCatching { windows.updateViewLayout(window.view, window.params) } + } + + private fun openChat() { + bubble = null + if (chatOpen) return + motion.dock() + showChat(true) + chatOpen = true + } + + private fun closeChat() { + if (!chatOpen) return + chatOpen = false + motion.undock() + } + + /** + * The chat window is always drawn; closed, it waits off the screen and takes neither touches nor + * keys, so opening it is a move and not a first layout. + */ + private fun showChat(on: Boolean) { + chat.params.x = if (on) 0 else OFFSCREEN + val quiet = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE + chat.params.flags = if (on) chat.params.flags and quiet.inv() else chat.params.flags or quiet + if (added) runCatching { windows.updateViewLayout(chat.view, chat.params) } + } + + /** The whole screen, the status and navigation bars included, since overlay windows can cover them. */ + private fun fitScreen() { + val bounds = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) windows.maximumWindowMetrics.bounds + else android.graphics.Point().also { @Suppress("DEPRECATION") windows.defaultDisplay.getRealSize(it) }.let { android.graphics.Rect(0, 0, it.x, it.y) } + motion.fit(bounds.width().toFloat(), bounds.height().toFloat()) + } + + fun close() { + runCatching { context.unregisterComponentCallbacks(turns) } + scope.cancel() + listOf(head, preview, target, chat).forEach { runCatching { windows.removeView(it.view) } } + owner.destroy() + } + + /** Drags and taps on the pet, in screen coordinates, since its window moves under the finger. */ + private inner class DragTouch : View.OnTouchListener { + private val slop = ViewConfiguration.get(context).scaledTouchSlop + private var downX = 0f + private var downY = 0f + private var lastX = 0f + private var lastY = 0f + private var moved = false + private var tracker: android.view.VelocityTracker? = null + + /** The window moves under the finger, so velocity is measured on the screen. */ + private fun track(e: MotionEvent) { + val onScreen = MotionEvent.obtain(e).apply { setLocation(e.rawX, e.rawY) } + (tracker ?: android.view.VelocityTracker.obtain().also { tracker = it }).addMovement(onScreen) + onScreen.recycle() + } + + private fun release(): Pair { + val t = tracker ?: return 0f to 0f + t.computeCurrentVelocity(1000) + val v = t.xVelocity to t.yVelocity + t.recycle() + tracker = null + return v + } + + override fun onTouch(v: View, e: MotionEvent): Boolean { + track(e) + when (e.actionMasked) { + MotionEvent.ACTION_DOWN -> { + downX = e.rawX; downY = e.rawY; lastX = e.rawX; lastY = e.rawY + moved = false + } + MotionEvent.ACTION_MOVE -> { + if (!moved && (abs(e.rawX - downX) > slop || abs(e.rawY - downY) > slop)) { + moved = true + bubble = null + closeChat() + motion.start() + } + if (moved) motion.move(e.rawX - lastX, e.rawY - lastY) + lastX = e.rawX; lastY = e.rawY + } + MotionEvent.ACTION_UP -> { + val (vx, vy) = release() + if (moved) { + if (motion.end(vx, vy)) AgentPet.set(context, false) + } else v.performClick() + } + MotionEvent.ACTION_CANCEL -> { + release() + if (moved) motion.cancel() + } + } + return true + } + } + + companion object { + private const val OFFSCREEN = 10_000 + private const val PRIVATE_FLAG_NO_MOVE_ANIMATION = 0x40 + fun allowed(context: Context) = Settings.canDrawOverlays(context) + } +} + +/** + * The floating chat, opened the way a chat head opens its conversation: the pet hops into the top + * corner while the whole conversation scales up out of it and fades in, and closing shrinks it back + * into the pet as the pet glides home. In landscape it sits beside the docked pet, in portrait + * under it. Its contents are built while it is closed, so opening only animates. + */ +@Composable +internal fun PetChat(open: Boolean, motion: PetMotion, onClose: () -> Unit, onClosed: () -> Unit) { + val colors = MaterialTheme.colorScheme + val pal = LocalPalette.current + val density = androidx.compose.ui.platform.LocalDensity.current + BoxWithConstraints( + Modifier.fillMaxSize().onPreviewKeyEvent { e -> + val k = e.nativeKeyEvent + if (k.keyCode != KeyEvent.KEYCODE_BUTTON_B || k.action != KeyEvent.ACTION_UP) return@onPreviewKeyEvent false + onClose() + true + }, + ) { + val w = constraints.maxWidth.toFloat() + val h = constraints.maxHeight.toFloat() + val margin = with(density) { 8.dp.toPx() } + val gap = with(density) { 6.dp.toPx() } + val wide = w > h + val panel = if (wide) { + val right = motion.dockX - gap + Rect((right - with(density) { 900.dp.toPx() }).coerceAtLeast(margin), motion.dockY, right, h - margin) + } else { + Rect(margin, motion.dockY + motion.size + gap, w - margin, h - margin) + } + val menuSlot = remember { AgentMenuSlot() } + val grow = remember { Animatable(0f) } + val fade = remember { Animatable(0f) } + LaunchedEffect(open) { + if (open) coroutineScope { + launch { grow.animateTo(1f, Motion.sp(0.82f, 520f)) } + launch { fade.animateTo(1f, Motion.tw(140)) } + } else if (fade.value > 0f) { + coroutineScope { + launch { grow.animateTo(0f, Motion.tw(170, easing = androidx.compose.animation.core.FastOutLinearInEasing)) } + launch { delay(Motion.ms(40).toLong()); fade.animateTo(0f, Motion.tw(130)) } + } + onClosed() + } + } + Box( + Modifier.fillMaxSize().graphicsLayer { alpha = fade.value }.background(Color(0x8C000000)) + .clickable(remember { MutableInteractionSource() }, null, enabled = open) { onClose() }, + ) + Column( + Modifier.offset { IntOffset(panel.left.roundToInt(), panel.top.roundToInt()) } + .size(with(density) { panel.width.toDp() }, with(density) { panel.height.toDp() }) + .graphicsLayer { + // Grows from where the pet is right now, so the two travel together while the pet hops to its corner. + transformOrigin = androidx.compose.ui.graphics.TransformOrigin( + ((motion.x + motion.size / 2 - panel.left) / panel.width.coerceAtLeast(1f)).coerceIn(0f, 1f), + ((motion.y + motion.size / 2 - panel.top) / panel.height.coerceAtLeast(1f)).coerceIn(0f, 1f), + ) + val s = 0.12f + 0.88f * grow.value + scaleX = s + scaleY = s + alpha = fade.value + } + .clip(Shape16).background(colors.background).border(1.dp, pal.line, Shape16) + .clickable(remember { MutableInteractionSource() }, null, enabled = open) {} + .padding(start = 12.dp, end = 12.dp, top = 6.dp), + ) { + Row(verticalAlignment = Alignment.CenterVertically, modifier = Modifier.fillMaxWidth().padding(bottom = 2.dp)) { + Box(Modifier.weight(1f)) { menuSlot.content?.invoke() } + HeaderAction(Icons.Outlined.Close, stringResource(R.string.agent_close), size = 34.dp, tag = "agent-pet-close", onClick = onClose) + } + AgentPage(Modifier.weight(1f).fillMaxWidth(), visible = open, startTyping = AgentHost.entries.isEmpty(), hidesPet = false, menuSlot = menuSlot) + } + } +} + +@Composable +internal fun PetCloseTarget(over: Boolean) { + Box( + contentAlignment = Alignment.Center, + modifier = Modifier.padding(4.dp).size(if (over) 84.dp else 68.dp).clip(androidx.compose.foundation.shape.CircleShape) + .background(Color(0xCC0E141B)) + .border(2.dp, if (over) Color(0xFFFF5A5F) else Color(0x66FFFFFF), androidx.compose.foundation.shape.CircleShape), + ) { Icon(Icons.Outlined.Close, null, tint = Color.White, modifier = Modifier.size(30.dp)) } +} diff --git a/app/src/main/java/com/droiddeck/launcher/ui/AgentSetupView.kt b/app/src/main/java/com/droiddeck/launcher/ui/AgentSetupView.kt new file mode 100644 index 0000000000..857e2edce9 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/ui/AgentSetupView.kt @@ -0,0 +1,215 @@ +package com.droiddeck.launcher.ui + +import androidx.compose.foundation.background +import androidx.compose.foundation.border +import androidx.compose.foundation.layout.Arrangement +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.verticalScroll +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.DisposableEffect +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.platform.LocalLifecycleOwner +import androidx.lifecycle.Lifecycle +import androidx.lifecycle.LifecycleEventObserver +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import com.droiddeck.launcher.PairingGuideActivity +import com.droiddeck.launcher.R +import com.droiddeck.launcher.agent.AgentHarness +import com.droiddeck.launcher.agent.AgentHost +import com.droiddeck.launcher.agent.AgentSetup +import com.droiddeck.launcher.agent.AgentStorage +import android.text.format.Formatter +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.heightIn +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue +import androidx.compose.runtime.saveable.rememberSaveable +import androidx.compose.ui.Alignment +import com.droiddeck.launcher.agent.AgentSetup.Status +import com.droiddeck.launcher.agent.AgentSetup.Step +import com.droiddeck.launcher.core.WirelessAdbPairingService + +@Composable +internal fun AgentSetupView(modifier: Modifier, onDone: () -> Unit = {}) { + val context = LocalContext.current + val colors = MaterialTheme.colorScheme + val pal = LocalPalette.current + LaunchedEffect(AgentHost.harness) { + AgentSetup.check(context) + AgentStorage.measure(context) + } + val lifecycle = LocalLifecycleOwner.current.lifecycle + DisposableEffect(lifecycle) { + var left = false + val observer = LifecycleEventObserver { _, event -> + if (event == Lifecycle.Event.ON_PAUSE) left = true + if (event == Lifecycle.Event.ON_RESUME && left) { + left = false + AgentSetup.check(context) + } + } + lifecycle.addObserver(observer) + onDispose { lifecycle.removeObserver(observer) } + } + Column(modifier.verticalScroll(rememberScrollState()), verticalArrangement = Arrangement.spacedBy(14.dp)) { + Text(stringResource(R.string.agent_setup_title), fontSize = 22.sp, fontWeight = FontWeight.Bold, color = colors.onBackground) + if (!AgentSetup.runtimeInstalled) { + Note(stringResource(R.string.agent_setup_runtime)) + return@Column + } + Row(horizontalArrangement = Arrangement.spacedBy(10.dp)) { + for (harness in AgentHarness.all) { + val chosen = harness == AgentHost.harness + if (chosen) PrimaryButton(harness.name, compact = true) {} else SecondaryButton(harness.name, enabled = !AgentSetup.busy, compact = true) { AgentHost.choose(context, harness) } + } + } + val steps = Step.entries + val done = steps.count { AgentSetup.status[it] == Status.DONE } + val busy = steps.any { AgentSetup.status[it] == Status.WORKING } + var details by rememberSaveable { mutableStateOf(false) } + val summary = if (AgentSetup.ready) buildList { + add(stringResource(R.string.agent_summary_signed_in, AgentHost.harness.name)) + if (AgentSetup.status[Step.GITHUB] == Status.DONE) add(stringResource(R.string.agent_step_github)) + if (AgentSetup.status[Step.BUILD_TOOLS] == Status.DONE) add(stringResource(R.string.agent_summary_lab)) + if (AgentSetup.status[Step.PREPARE] == Status.DONE) add(stringResource(R.string.agent_summary_fast)) + }.joinToString(" ยท ") else steps.firstOrNull { it.required && AgentSetup.status[it] != Status.DONE }?.let { labels(it, AgentHost.harness.name).first }.orEmpty() + ReadinessCard( + done, steps.size, summary, details || !AgentSetup.ready || busy, { details = !details }, + title = stringResource(if (AgentSetup.ready) R.string.agent_summary_ready else R.string.agent_summary_not_ready), + ready = AgentSetup.ready, + ) { + steps.forEachIndexed { index, step -> + val status = AgentSetup.status[step] ?: Status.UNKNOWN + val (title, hint) = labels(step, AgentHost.harness.name) + val lab = AgentHost.lab?.takeIf { it.prepare && it.running } + val detail = if (step == Step.PREPARE && lab != null) + stringResource(R.string.agent_prepare_progress, lab.permille / 10, clock(lab.etaSeconds.toLong().coerceAtLeast(0))) + else AgentSetup.detail[step] ?: hint + CheckRow( + when (status) { + Status.DONE -> CheckState.OK + Status.WORKING, Status.UNKNOWN -> CheckState.BUSY + Status.TODO, Status.FAILED -> CheckState.WARN + }, + title, detail, divider = index < steps.lastIndex, + ) { + val blocked = (step in setOf(Step.SIGN_IN, Step.GITHUB, Step.BUILD_TOOLS) && AgentSetup.status[Step.INSTALL] != Status.DONE) || + (step == Step.PREPARE && AgentSetup.status[Step.BUILD_TOOLS] != Status.DONE) + if ((status == Status.TODO || status == Status.FAILED) && !blocked) { + val label = stringResource(if (status == Status.FAILED) R.string.agent_setup_retry else action(step)) + val run = { if (step == Step.CONNECTION) pair(context) else AgentSetup.run(context, step) } + if (step.required) PrimaryButton(label, compact = true, onClick = run) else SecondaryButton(label, compact = true, onClick = run) + } + } + } + } + if (AgentSetup.ready || AgentSetup.completed(context)) PrimaryButton(stringResource(R.string.agent_setup_done), main = true, onClick = onDone) + StorageCard() + } +} + +@Composable +private fun StorageCard() { + val context = LocalContext.current + val colors = MaterialTheme.colorScheme + val pal = LocalPalette.current + val items = AgentStorage.Item.entries.filter { (AgentStorage.sizes[it] ?: 0L) > 0L } + if (items.isEmpty()) return + val total = items.sumOf { AgentStorage.sizes[it] ?: 0L } + var open by rememberSaveable { mutableStateOf(false) } + Column(Modifier.fillMaxWidth().clip(Shape14).background(colors.surface).border(1.dp, pal.line, Shape14)) { + Row(verticalAlignment = Alignment.CenterVertically, modifier = Modifier.fillMaxWidth().heightIn(min = 60.dp).padding(horizontal = 14.dp, vertical = 10.dp)) { + Column(Modifier.weight(1f)) { + Text(stringResource(R.string.agent_storage_title), fontSize = 15.sp, fontWeight = FontWeight.SemiBold, color = colors.onBackground) + Text(Formatter.formatShortFileSize(context, total), fontSize = 13.sp, color = pal.onSurfaceVariant) + } + SecondaryButton(stringResource(if (open) R.string.common_hide else R.string.setup_details), compact = true) { open = !open } + } + if (open) items.forEachIndexed { index, item -> + if (index == 0) Box(Modifier.fillMaxWidth().height(1.dp).background(pal.line)) + var armed by remember(item) { mutableStateOf(false) } + val busy = AgentStorage.removing[item] == true + Row( + verticalAlignment = Alignment.CenterVertically, + modifier = Modifier.fillMaxWidth().heightIn(min = 60.dp).padding(horizontal = 14.dp, vertical = 10.dp), + ) { + Column(Modifier.weight(1f)) { + Text(stringResource(storageTitle(item)), fontSize = 15.sp, fontWeight = FontWeight.SemiBold, color = colors.onBackground) + Text( + if (armed) stringResource(storageWarning(item)) else Formatter.formatShortFileSize(context, AgentStorage.sizes[item] ?: 0L), + fontSize = 13.sp, color = if (armed) AttentionAmber else pal.onSurfaceVariant, + ) + } + SecondaryButton( + stringResource(if (armed) R.string.agent_storage_confirm else R.string.agent_storage_remove), + enabled = !busy && AgentHost.state != AgentHost.State.WORKING, compact = true, + ) { + if (armed) { + armed = false + AgentStorage.remove(context, item) + } else armed = true + } + } + if (index < items.lastIndex) Box(Modifier.fillMaxWidth().height(1.dp).background(pal.line)) + } + } +} + +private fun storageTitle(item: AgentStorage.Item) = when (item) { + AgentStorage.Item.CLAUDE_CODE -> R.string.agent_storage_claude + AgentStorage.Item.CODEX -> R.string.agent_storage_codex + AgentStorage.Item.BUILD_TOOLS -> R.string.agent_step_build + AgentStorage.Item.SOURCE -> R.string.agent_storage_source + AgentStorage.Item.CACHES -> R.string.agent_storage_caches +} + +private fun storageWarning(item: AgentStorage.Item) = when (item) { + AgentStorage.Item.SOURCE -> R.string.agent_storage_source_warning + AgentStorage.Item.CACHES -> R.string.agent_storage_caches_warning + else -> R.string.agent_storage_reinstall_warning +} + +@Composable +private fun labels(step: Step, harness: String): Pair = when (step) { + Step.CONNECTION -> stringResource(R.string.agent_step_connection) to stringResource(R.string.agent_step_connection_hint) + Step.INSTALL -> stringResource(R.string.agent_step_install, harness) to stringResource(R.string.agent_step_install_hint) + Step.SIGN_IN -> stringResource(R.string.agent_step_sign_in, harness) to stringResource(R.string.agent_step_sign_in_hint) + Step.GITHUB -> stringResource(R.string.agent_step_github) to stringResource(R.string.agent_step_github_hint) + Step.BUILD_TOOLS -> stringResource(R.string.agent_step_build) to stringResource(R.string.agent_step_build_hint) + Step.PREPARE -> stringResource(R.string.agent_step_prepare) to stringResource(R.string.agent_step_prepare_hint) +} + +private fun action(step: Step): Int = when (step) { + Step.CONNECTION -> R.string.agent_action_pair + Step.INSTALL -> R.string.agent_action_install + Step.SIGN_IN, Step.GITHUB -> R.string.agent_action_sign_in + Step.BUILD_TOOLS -> R.string.agent_action_install + Step.PREPARE -> R.string.agent_action_prepare +} + +/** The pairing DroidDeck already uses for the phantom process fix; the agent reuses its key. */ +private fun pair(context: android.content.Context) { + if (!WirelessAdbPairingService.notificationsEnabled(context)) { + context.startActivity(android.content.Intent(android.provider.Settings.ACTION_APP_NOTIFICATION_SETTINGS) + .putExtra(android.provider.Settings.EXTRA_APP_PACKAGE, context.packageName) + .addFlags(android.content.Intent.FLAG_ACTIVITY_NEW_TASK)) + return + } + WirelessAdbPairingService.start(context) + PairingGuideActivity.start(context, null, false) +} diff --git a/app/src/main/java/com/droiddeck/launcher/ui/AgentVoice.kt b/app/src/main/java/com/droiddeck/launcher/ui/AgentVoice.kt new file mode 100644 index 0000000000..a6d78e599e --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/ui/AgentVoice.kt @@ -0,0 +1,74 @@ +package com.droiddeck.launcher.ui + +import android.content.Context +import android.content.Intent +import android.os.Bundle +import android.speech.RecognitionListener +import android.speech.RecognizerIntent +import android.speech.SpeechRecognizer +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.setValue + +/** Dictation into the Agent editor: what is heard so far follows the text already typed, until the user edits the draft. */ +internal class AgentVoice(private val context: Context, private val draft: () -> String, private val onText: (String) -> Unit) { + var listening by mutableStateOf(false) + private set + private var recognizer: SpeechRecognizer? = null + private var base = "" + private var written = "" + + fun start(typed: String) { + stop() + val speech = runCatching { SpeechRecognizer.createSpeechRecognizer(context) }.getOrNull() ?: return + recognizer = speech + base = typed.trimEnd().let { if (it.isEmpty()) it else "$it " } + written = typed + speech.setRecognitionListener(object : RecognitionListener { + override fun onReadyForSpeech(params: Bundle?) { listening = true } + override fun onBeginningOfSpeech() {} + override fun onRmsChanged(rmsdB: Float) {} + override fun onBufferReceived(buffer: ByteArray?) {} + override fun onEndOfSpeech() {} + override fun onError(error: Int) { if (recognizer === speech) stop() } + override fun onResults(results: Bundle?) { + if (recognizer !== speech) return + heard(results) + stop() + } + override fun onPartialResults(partialResults: Bundle?) { if (recognizer === speech) heard(partialResults) } + override fun onEvent(eventType: Int, params: Bundle?) {} + }) + val intent = Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH) + .putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM) + .putExtra(RecognizerIntent.EXTRA_PARTIAL_RESULTS, true) + .putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, context.packageName) + runCatching { speech.startListening(intent) }.onFailure { stop() } + } + + private fun heard(results: Bundle?) { + val spoken = results?.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION)?.firstOrNull()?.takeIf { it.isNotBlank() } ?: return + if (draft() != written) return stop() + written = base + spoken + onText(written) + } + + /** Ends listening but keeps the recognizer until its final result arrives. */ + fun finish() { + val speech = recognizer ?: return + listening = false + runCatching { speech.stopListening() }.onFailure { stop() } + } + + fun stop() { + listening = false + val speech = recognizer ?: return + recognizer = null + runCatching { speech.cancel() } + runCatching { speech.destroy() } + } + + companion object { + fun available(context: Context) = SpeechRecognizer.isRecognitionAvailable(context) + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/ui/AndroidAppsPage.kt b/app/src/main/java/com/droiddeck/launcher/ui/AndroidAppsPage.kt index f43e191a66..dce70549b2 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/AndroidAppsPage.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/AndroidAppsPage.kt @@ -22,6 +22,7 @@ import androidx.compose.foundation.focusGroup import androidx.compose.foundation.focusable import androidx.compose.foundation.gestures.awaitEachGesture import androidx.compose.foundation.gestures.awaitFirstDown +import androidx.compose.foundation.gestures.scrollBy import androidx.compose.foundation.hoverable import androidx.compose.foundation.interaction.MutableInteractionSource import androidx.compose.foundation.interaction.collectIsPressedAsState @@ -55,8 +56,6 @@ import androidx.compose.foundation.lazy.grid.rememberLazyGridState import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.filled.Close -import androidx.compose.material.icons.filled.Edit import androidx.compose.material.icons.filled.FilterAlt import androidx.compose.material.icons.filled.Sort import androidx.compose.material.icons.filled.Widgets @@ -75,6 +74,7 @@ import androidx.compose.runtime.remember import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.setValue +import androidx.compose.runtime.snapshotFlow import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip @@ -92,6 +92,7 @@ import androidx.compose.ui.focus.FocusDirection import androidx.compose.ui.focus.FocusRequester import androidx.compose.ui.focus.focusProperties import androidx.compose.ui.focus.focusRequester +import androidx.compose.ui.focus.onFocusChanged import androidx.compose.ui.input.InputMode import androidx.compose.ui.platform.LocalInputModeManager import androidx.compose.ui.platform.LocalContext @@ -110,10 +111,13 @@ import androidx.compose.ui.zIndex import com.droiddeck.launcher.HomeApp import com.droiddeck.launcher.HomeFolders import com.droiddeck.launcher.HomeHidden +import com.droiddeck.launcher.HomeIcons import com.droiddeck.launcher.HomePins +import com.droiddeck.launcher.IconPack import android.content.pm.ShortcutInfo import android.graphics.Bitmap import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.flow.drop import kotlinx.coroutines.withContext import com.droiddeck.launcher.HomeWidgets import com.droiddeck.launcher.R @@ -145,6 +149,9 @@ private sealed interface AppEntry : AppEntryKey { } } +/** The focus id of the tile an entry is shown as. */ +private fun tileId(entry: AppEntry): String = "tile:" + if (entry is AppEntry.App) entry.app.key else entry.key + private fun indexLetter(label: String): String { val c = label.trim().firstOrNull()?.uppercaseChar() ?: return "#" return if (c in 'A'..'Z') c.toString() else if (c.isLetter()) c.toString() else "#" @@ -231,6 +238,48 @@ internal object AppsView { } } +internal object AppsGrid { + const val SMALL = 44 + const val MEDIUM = 52 + const val LARGE = 64 + private val ICON_SIZES = listOf(SMALL, MEDIUM, LARGE) + const val TIGHT = -12 + const val NORMAL = 0 + const val ROOMY = 16 + private val SPACINGS = listOf(TIGHT, NORMAL, ROOMY) + + var labels by mutableStateOf(true) + private set + var iconDp by mutableStateOf(MEDIUM) + private set + var spacing by mutableStateOf(NORMAL) + private set + + private fun prefs(context: Context) = context.getSharedPreferences("home_launcher", Context.MODE_PRIVATE) + + fun load(context: Context) { + val p = prefs(context) + labels = p.getBoolean("grid_labels", true) + iconDp = p.getInt("grid_icon", MEDIUM).takeIf { it in ICON_SIZES } ?: MEDIUM + spacing = p.getInt("grid_spacing", NORMAL).takeIf { it in SPACINGS } ?: NORMAL + } + + fun setLabels(context: Context, value: Boolean) { + labels = value + prefs(context).edit().putBoolean("grid_labels", value).apply() + } + + fun setIconDp(context: Context, value: Int) { + iconDp = value + prefs(context).edit().putInt("grid_icon", value).apply() + } + + fun setSpacing(context: Context, value: Int) { + spacing = value + prefs(context).edit().putInt("grid_spacing", value).apply() + } +} + internal interface AppEntryKey { val label: String val installedAt: Long @@ -239,9 +288,9 @@ internal interface AppEntryKey { @OptIn(ExperimentalLayoutApi::class) @Composable -internal fun AndroidAppsPage(s: FrontEndState, modifier: Modifier, onLaunch: (HomeApp.LaunchableApp) -> Unit) { +internal fun AndroidAppsPage(s: FrontEndState, a: FrontEndActions, modifier: Modifier, onLaunch: (HomeApp.LaunchableApp) -> Unit) { val ctx = LocalContext.current - remember { HomeFolders.load(ctx); HomeWidgets.load(ctx); HomeHidden.load(ctx); AppsView.load(ctx); true } + remember { HomeFolders.load(ctx); HomeWidgets.load(ctx); HomeHidden.load(ctx); AppsView.load(ctx); AppsGrid.load(ctx); true } val colors = MaterialTheme.colorScheme val narrow = LocalNarrowPane.current val padH = if (narrow) 16.dp else 22.dp @@ -249,6 +298,10 @@ internal fun AndroidAppsPage(s: FrontEndState, modifier: Modifier, onLaunch: (Ho var openFolder by rememberSaveable { mutableStateOf(null) } var renameOnOpen by rememberSaveable { mutableStateOf(false) } var picking by rememberSaveable { mutableStateOf(false) } + var iconFor by remember { mutableStateOf(null) } + LaunchedEffect(Unit) { + snapshotFlow { HomeIcons.overrides }.drop(1).collect { a.onAppIconsChanged() } + } val folders = HomeFolders.folders val byKey = remember(s.androidApps) { s.androidApps.associateBy { it.key } } val byPkg = remember(s.androidApps) { s.androidApps.filterNot { it.work }.groupBy { it.packageName }.mapNotNull { (pkg, apps) -> apps.singleOrNull()?.let { pkg to it } }.toMap() } @@ -294,7 +347,7 @@ internal fun AndroidAppsPage(s: FrontEndState, modifier: Modifier, onLaunch: (Ho ModeHeader( stringResource(R.string.content_android_apps), query, { query = it }, placeholder = stringResource(R.string.apps_search_hint), - clearSearchFocus = openFolder != null || picking, + clearSearchFocus = openFolder != null || picking || iconFor != null, lead = { Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(8.dp), modifier = Modifier.padding(start = 2.dp, end = 4.dp)) { Text(stringResource(R.string.content_android_apps), fontSize = if (narrow) 20.sp else 24.sp, fontWeight = FontWeight.Bold, color = colors.onBackground, maxLines = 1) @@ -305,16 +358,37 @@ internal fun AndroidAppsPage(s: FrontEndState, modifier: Modifier, onLaunch: (Ho ) { AppsFilterButton() AppsSortButton() + AppsAppearanceButton(a) HeaderIconButton(stringResource(R.string.apps_add_widget), Icons.Filled.Widgets, "add-widget") { HomeWidgets.loadProviders(ctx) picking = true } } } - Box(Modifier.weight(1f).fillMaxWidth()) { + val front = LocalFrontFocus.current + val steer = rememberCoroutineScope() + // Down goes to the tile straight below. The grid's own search only sees the tiles laid out so far, so above a short or + // unseen last row it lands on a tile further left; above a gap in a short last row the row's last tile takes it. + Box(Modifier.weight(1f).fillMaxWidth().onPreviewKeyEvent { event -> + val k = event.nativeKeyEvent + if (k.keyCode != KeyEvent.KEYCODE_DPAD_DOWN || front == null) return@onPreviewKeyEvent false + val from = entries.indexOfFirst { tileId(it) == front.last } + val columns = (grid.layoutInfo.visibleItemsInfo.maxOfOrNull { it.column } ?: 0) + 1 + if (from < 0 || from / columns == entries.lastIndex / columns) return@onPreviewKeyEvent false + if (k.action == KeyEvent.ACTION_DOWN) { + val id = tileId(entries[minOf(from + columns, entries.lastIndex)]) + val shown = (front.attached[id] ?: 0) > 0 + if (!shown || runCatching { front.items.getValue(id).requestFocus() }.isFailure) steer.launch { + // The row below is not laid out yet: bring it in, then take it. + if (!shown) grid.scrollBy((grid.layoutInfo.visibleItemsInfo.firstOrNull { it.index == from + leadItems }?.size?.height ?: 0).toFloat()) + focusSoon { front.items.getValue(id) } + } + } + true + }) { val scroller = q.isEmpty() && byName && entries.size > 16 LazyVerticalGrid( - columns = GridCells.Adaptive(if (narrow) 84.dp else 96.dp), + columns = GridCells.Adaptive((if (narrow) 84 else 96).dp + AppsGrid.spacing.dp), state = grid, horizontalArrangement = Arrangement.spacedBy(10.dp), verticalArrangement = Arrangement.spacedBy(10.dp), @@ -345,7 +419,7 @@ internal fun AndroidAppsPage(s: FrontEndState, modifier: Modifier, onLaunch: (Ho items(entries, key = { it.key }) { entry -> when (entry) { is AppEntry.App -> AppTile( - entry.app, folderId = null, onLaunch = onLaunch, onNewFolder = newFolder, + entry.app, folderId = null, onLaunch = onLaunch, onNewFolder = newFolder, onChangeIcon = { iconFor = it }, first = entry === entries.first(), ) is AppEntry.Shortcut -> PinnedTile(entry.pinned, first = entry === entries.first()) @@ -369,7 +443,7 @@ internal fun AndroidAppsPage(s: FrontEndState, modifier: Modifier, onLaunch: (Ho var last by remember { mutableStateOf(folder) } if (folder != null) last = folder last?.let { f -> - FolderSheet(f, f.apps.mapNotNull(member).filter { it.key !in hidden }.sortedWith(compareBy(String.CASE_INSENSITIVE_ORDER) { it.label }), renameOnOpen, onLaunch, newFolder) { + FolderSheet(f, f.apps.mapNotNull(member).filter { it.key !in hidden }.sortedWith(compareBy(String.CASE_INSENSITIVE_ORDER) { it.label }), renameOnOpen, onLaunch, newFolder, { iconFor = it }) { openFolder = null renameOnOpen = false } @@ -379,11 +453,19 @@ internal fun AndroidAppsPage(s: FrontEndState, modifier: Modifier, onLaunch: (Ho picking, enter = fadeIn(Motion.tw(180)), exit = fadeOut(Motion.tw(160)), modifier = Modifier.fillMaxSize().zIndex(3f), ) { WidgetPicker(padH) { picking = false } } + AnimatedVisibility( + iconFor != null, enter = fadeIn(Motion.tw(180)), exit = fadeOut(Motion.tw(160)), + modifier = Modifier.fillMaxSize().zIndex(4f), + ) { + var last by remember { mutableStateOf(iconFor) } + iconFor?.let { last = it } + last?.let { app -> AppIconPicker(app, padH) { iconFor = null } } + } } } @Composable -private fun SwipeLock() { +internal fun SwipeLock() { DisposableEffect(Unit) { PageSwipe.locks++ onDispose { PageSwipe.locks-- } @@ -570,22 +652,22 @@ private fun AppIcon(app: HomeApp.LaunchableApp, size: androidx.compose.ui.unit.D private fun AppTile( app: HomeApp.LaunchableApp, folderId: String?, first: Boolean, onLaunch: (HomeApp.LaunchableApp) -> Unit, onNewFolder: (HomeApp.LaunchableApp) -> Unit, - modifier: Modifier = Modifier, + onChangeIcon: (HomeApp.LaunchableApp) -> Unit, modifier: Modifier = Modifier, ) { var menu by remember { mutableStateOf(false) } Box(modifier) { TileFrame(app.key, first, onClick = { onLaunch(app) }, onMenu = { menu = true }) { - AppIcon(app, 52.dp) - TileLabel(app.label) + AppIcon(app, AppsGrid.iconDp.dp) + if (AppsGrid.labels) TileLabel(app.label) } - AppMenu(app, folderId, menu, onDismiss = { menu = false }, onNewFolder = onNewFolder) + AppMenu(app, folderId, menu, onDismiss = { menu = false }, onNewFolder = onNewFolder, onChangeIcon = onChangeIcon) } } @Composable private fun AppMenu( app: HomeApp.LaunchableApp, folderId: String?, open: Boolean, - onDismiss: () -> Unit, onNewFolder: (HomeApp.LaunchableApp) -> Unit, + onDismiss: () -> Unit, onNewFolder: (HomeApp.LaunchableApp) -> Unit, onChangeIcon: (HomeApp.LaunchableApp) -> Unit, ) { val ctx = LocalContext.current var choosing by remember { mutableStateOf(false) } @@ -638,6 +720,14 @@ private fun AppMenu( onDismiss() HomeHidden.set(ctx, app.key, !isHidden) } + if (IconPack.active(ctx) != null) MenuItem(stringResource(R.string.apps_change_icon), checked = false) { + onDismiss() + onChangeIcon(app) + } + if (app.key in HomeIcons.overrides) MenuItem(stringResource(R.string.apps_reset_icon), checked = false) { + onDismiss() + HomeIcons.clear(ctx, app.key) + } MenuItem(stringResource(R.string.apps_app_info), checked = false) { onDismiss() runCatching { HomeApp.openAppInfo(ctx, app) } @@ -664,10 +754,10 @@ private fun PinnedTile(pinned: HomePins.Pinned, first: Boolean) { TileFrame(pinned.key, first, onClick = { runCatching { HomeApp.startShortcut(ctx, pinned.info) } }, onMenu = { menu = true }) { Box { val icon = pinned.icon - if (icon != null) Image(icon.asImageBitmap(), null, contentScale = ContentScale.Fit, modifier = Modifier.size(52.dp)) - else Box(Modifier.size(52.dp).clip(CircleShape).background(artBrush(hueOf(pinned.label)))) + if (icon != null) Image(icon.asImageBitmap(), null, contentScale = ContentScale.Fit, modifier = Modifier.size(AppsGrid.iconDp.dp)) + else Box(Modifier.size(AppsGrid.iconDp.dp).clip(CircleShape).background(artBrush(hueOf(pinned.label)))) } - TileLabel(pinned.label) + if (AppsGrid.labels) TileLabel(pinned.label) } AnchoredMenu(menu, onDismiss = { menu = false }, title = pinned.label, compact = true, minWidth = 180.dp) { firstItem -> MenuItem(stringResource(R.string.apps_shortcut_remove), checked = false, detail = pinned.appLabel, focusRequester = firstItem) { @@ -702,8 +792,8 @@ private fun FolderTile(entry: AppEntry.Folder, first: Boolean, onOpen: () -> Uni var menu by remember { mutableStateOf(false) } Box { TileFrame(entry.key, first, onClick = onOpen, onMenu = { menu = true }) { - FolderIcon(entry.apps, 52.dp) - TileLabel(entry.folder.name) + FolderIcon(entry.apps, AppsGrid.iconDp.dp) + if (AppsGrid.labels) TileLabel(entry.folder.name) } AnchoredMenu(menu, onDismiss = { menu = false }, title = entry.folder.name, compact = true, minWidth = 160.dp) { firstItem -> MenuItem(stringResource(R.string.apps_folder_rename), checked = false, focusRequester = firstItem) { @@ -722,7 +812,8 @@ private fun FolderTile(entry: AppEntry.Folder, first: Boolean, onOpen: () -> Uni @Composable private fun FolderSheet( folder: HomeFolders.Folder, apps: List, renameFirst: Boolean, - onLaunch: (HomeApp.LaunchableApp) -> Unit, onNewFolder: (HomeApp.LaunchableApp) -> Unit, onClose: () -> Unit, + onLaunch: (HomeApp.LaunchableApp) -> Unit, onNewFolder: (HomeApp.LaunchableApp) -> Unit, + onChangeIcon: (HomeApp.LaunchableApp) -> Unit, onClose: () -> Unit, ) { SwipeLock() val ctx = LocalContext.current @@ -779,29 +870,40 @@ private fun FolderSheet( .focusGroup() .padding(16.dp), ) { - Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(8.dp), modifier = Modifier.fillMaxWidth().padding(bottom = 10.dp)) { - if (renaming) Box(Modifier.weight(1f)) { + Box(contentAlignment = Alignment.Center, modifier = Modifier.fillMaxWidth().padding(bottom = 10.dp)) { + if (renaming) { AdbTextField( value = name, onValueChange = { name = it.take(40) }, label = stringResource(R.string.apps_folder_name), keyboardType = KeyboardType.Text, imeAction = ImeAction.Done, compact = true, showLabel = false, placeholder = folder.name, focusOnShow = true, onDone = { commit() }, ) } else { - Text(folder.name, fontSize = 20.sp, fontWeight = FontWeight.Bold, color = colors.onBackground, maxLines = 1, overflow = TextOverflow.Ellipsis, modifier = Modifier.weight(1f, fill = false)) - SmallIconButton(Icons.Filled.Edit, stringResource(R.string.apps_folder_rename), tint = colors.onSurfaceVariant) { renaming = true } - Spacer(Modifier.weight(1f)) + val src = remember { MutableInteractionSource() } + val hot = rememberHot(src) + val rename = { renaming = true } + Text( + folder.name, fontSize = 20.sp, fontWeight = FontWeight.Bold, color = colors.onBackground, + maxLines = 1, overflow = TextOverflow.Ellipsis, textAlign = TextAlign.Center, + // A faint chip at rest shows the name can be selected, now that the pencil is gone. + modifier = Modifier.clip(Shape12) + .background(if (hot) pal.signal.copy(alpha = 0.12f) else colors.onBackground.copy(alpha = 0.07f)) + .glideBorder(hot, Shape12, pal.signal) + .hoverable(src) + .clickable(interactionSource = src, indication = LocalIndication.current, onClickLabel = stringResource(R.string.apps_folder_rename), role = Role.Button, onClick = rename) + .controllerConfirm(onClick = rename) + .padding(horizontal = 14.dp, vertical = 6.dp), + ) } - SmallIconButton(Icons.Filled.Close, stringResource(R.string.common_close), tint = colors.onSurfaceVariant) { close() } } LazyVerticalGrid( - columns = GridCells.Adaptive(92.dp), + columns = GridCells.Adaptive(92.dp + AppsGrid.spacing.dp), state = grid, horizontalArrangement = Arrangement.spacedBy(10.dp), verticalArrangement = Arrangement.spacedBy(10.dp), ) { items(apps, key = { it.key }) { app -> AppTile( - app, folderId = folder.id, first = false, onLaunch = { onClose(); onLaunch(it) }, onNewFolder = onNewFolder, + app, folderId = folder.id, first = false, onLaunch = { onClose(); onLaunch(it) }, onNewFolder = onNewFolder, onChangeIcon = onChangeIcon, modifier = if (app === apps.first()) Modifier.focusRequester(firstApp) else Modifier, ) } @@ -823,7 +925,7 @@ private fun WidgetCard(w: HomeWidgets.Placed, maxWidthDp: Int) { val activity = remember(ctx) { ctx.findActivity() } Box { Box( - Modifier.size(width.dp, w.heightDp.dp) + Modifier.paneItem("widget:${w.id}").size(width.dp, w.heightDp.dp) .clip(Shape16) .background(colors.surface.copy(alpha = 0.35f)) .glideBorder(hot || menu, Shape16, pal.signal) diff --git a/app/src/main/java/com/droiddeck/launcher/ui/AppIconPicker.kt b/app/src/main/java/com/droiddeck/launcher/ui/AppIconPicker.kt new file mode 100644 index 0000000000..a438a09130 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/ui/AppIconPicker.kt @@ -0,0 +1,188 @@ +package com.droiddeck.launcher.ui + +import android.graphics.Bitmap +import android.util.LruCache +import androidx.activity.compose.BackHandler +import androidx.compose.foundation.Image +import androidx.compose.foundation.LocalIndication +import androidx.compose.foundation.background +import androidx.compose.foundation.clickable +import androidx.compose.foundation.focusGroup +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.PaddingValues +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.imePadding +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.lazy.grid.GridCells +import androidx.compose.foundation.lazy.grid.GridItemSpan +import androidx.compose.foundation.lazy.grid.LazyVerticalGrid +import androidx.compose.foundation.lazy.grid.items +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.produceState +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue +import androidx.compose.ui.Alignment +import androidx.compose.ui.ExperimentalComposeUiApi +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.focus.FocusDirection +import androidx.compose.ui.focus.FocusRequester +import androidx.compose.ui.focus.focusProperties +import androidx.compose.ui.focus.focusRequester +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.asImageBitmap +import androidx.compose.ui.input.InputMode +import androidx.compose.ui.layout.ContentScale +import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.platform.LocalDensity +import androidx.compose.ui.platform.LocalInputModeManager +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.semantics.Role +import androidx.compose.ui.semantics.contentDescription +import androidx.compose.ui.semantics.semantics +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import androidx.core.graphics.drawable.toBitmap +import com.droiddeck.launcher.HomeApp +import com.droiddeck.launcher.HomeIcons +import com.droiddeck.launcher.IconPack +import com.droiddeck.launcher.R +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.withContext + +private val CELL_ICON = 44.dp + +@OptIn(ExperimentalComposeUiApi::class) +private fun Modifier.focusTrap(): Modifier = focusProperties { + exit = { dir -> + if (dir == FocusDirection.Up || dir == FocusDirection.Down || dir == FocusDirection.Left || dir == FocusDirection.Right) FocusRequester.Cancel + else FocusRequester.Default + } +}.focusGroup() + +private fun normalized(text: String) = text.lowercase().filter { it.isLetterOrDigit() } + +internal fun iconMatches(names: List, label: String, query: String): List { + val q = normalized(query) + if (q.isNotEmpty()) return names.filter { q in normalized(it) } + val hint = normalized(label) + val (likely, rest) = names.partition { hint in normalized(it) } + return likely + rest +} + +@Composable +internal fun AppIconPicker(app: HomeApp.LaunchableApp, padH: androidx.compose.ui.unit.Dp, onClose: () -> Unit) { + SwipeLock() + val ctx = LocalContext.current + val colors = MaterialTheme.colorScheme + val pack = remember { IconPack.selected(ctx) } + val names by produceState?>(null, pack) { value = withContext(Dispatchers.IO) { IconPack.names(ctx, pack) } } + var query by remember { mutableStateOf("") } + val shown = remember(names, query) { names?.let { iconMatches(it, app.label, query) } } + val cache = remember { LruCache(256) } + val inputMode = LocalInputModeManager.current.inputMode + val ff = LocalFrontFocus.current + val first = remember { FocusRequester() } + var closing by remember { mutableStateOf(false) } + val close = { + closing = true + onClose() + if (inputMode == InputMode.Keyboard && ff != null) { + runCatching { ff.items.getValue("tile:${app.key}").requestFocus() } + .onFailure { runCatching { ff.firstTile.requestFocus() } } + } + } + LaunchedEffect(names != null, inputMode) { + if (names != null && !closing && inputMode == InputMode.Keyboard) { + repeat(2) { androidx.compose.runtime.withFrameNanos { } } + ff?.last = "icon:${shown?.firstOrNull()}" + if (!closing) runCatching { first.requestFocus() } + } + } + BackHandler { close() } + Column( + Modifier.fillMaxSize().imePadding().background(colors.background) + .blockTouches() + .focusTrap(), + ) { + val title = stringResource(R.string.touch_icon_for, app.label) + Box(Modifier.fillMaxWidth().padding(start = padH, end = padH, top = 8.dp)) { + ModeHeader( + title, query, { query = it }, placeholder = stringResource(R.string.apps_icons_search), + lead = { + Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(12.dp)) { + BackLink(stringResource(R.string.rail_apps), compact = true, onClick = close) + Text(title, fontSize = 15.sp, fontWeight = FontWeight.Bold, color = colors.onBackground, maxLines = 1, overflow = TextOverflow.Ellipsis) + } + }, + inlineWhenStacked = true, + ) { } + } + LazyVerticalGrid( + columns = GridCells.Adaptive(64.dp), + horizontalArrangement = Arrangement.spacedBy(4.dp), + verticalArrangement = Arrangement.spacedBy(4.dp), + contentPadding = PaddingValues(horizontal = padH, vertical = 8.dp), + modifier = Modifier.fillMaxSize(), + ) { + when { + shown == null -> item(key = "loading", span = { GridItemSpan(maxLineSpan) }) { Note(stringResource(R.string.apps_icons_loading)) } + shown.isEmpty() -> item(key = "none", span = { GridItemSpan(maxLineSpan) }) { Note(stringResource(R.string.apps_icons_none)) } + else -> items(shown, key = { it }) { name -> + PackIconCell( + pack, name, cache, + modifier = if (name == shown.first()) Modifier.focusRequester(first) else Modifier, + ) { + HomeIcons.set(ctx, app.key, pack, name) + close() + } + } + } + } + } +} + +@Composable +private fun PackIconCell( + pack: String, name: String, cache: LruCache, modifier: Modifier, onPick: () -> Unit, +) { + val ctx = LocalContext.current + val iconPx = with(LocalDensity.current) { CELL_ICON.roundToPx() } + val bitmap by produceState(cache.get(name), name) { + if (value == null) value = withContext(Dispatchers.IO) { + runCatching { IconPack.drawable(ctx, pack, name, ctx.resources.displayMetrics.densityDpi)?.toBitmap(iconPx, iconPx) }.getOrNull()?.also { cache.put(name, it) } + } + } + val pal = LocalPalette.current + val src = remember { MutableInteractionSource() } + val hot = rememberHot(src) + Box( + contentAlignment = Alignment.Center, + modifier = modifier.fillMaxWidth().paneItem("icon:$name").clip(Shape12) + .background(if (hot) pal.signal.copy(alpha = 0.14f) else Color.Transparent) + .glideBorder(hot, Shape12, pal.signal) + .hoverable(src).clickable(interactionSource = src, indication = LocalIndication.current, role = Role.Button, onClick = onPick) + .controllerConfirm(onClick = onPick) + .semantics { contentDescription = name.replace('_', ' ') } + .padding(10.dp), + ) { + val icon = bitmap + if (icon != null) Image(icon.asImageBitmap(), null, contentScale = ContentScale.Fit, modifier = Modifier.size(CELL_ICON)) + else Spacer(Modifier.size(CELL_ICON)) + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/ui/AppsAppearance.kt b/app/src/main/java/com/droiddeck/launcher/ui/AppsAppearance.kt new file mode 100644 index 0000000000..e04ff0d613 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/ui/AppsAppearance.kt @@ -0,0 +1,120 @@ +package com.droiddeck.launcher.ui + +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.verticalScroll +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.filled.Palette +import androidx.compose.material3.Icon +import androidx.compose.runtime.Composable +import androidx.compose.runtime.CompositionLocalProvider +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.produceState +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue +import androidx.compose.ui.Modifier +import androidx.compose.ui.focus.focusRequester +import androidx.compose.ui.geometry.Rect +import androidx.compose.ui.layout.boundsInRoot +import androidx.compose.ui.layout.onGloballyPositioned +import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.unit.dp +import com.droiddeck.launcher.HomeIcons +import com.droiddeck.launcher.IconPack +import com.droiddeck.launcher.R +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.withContext + +private val PanelWidth = 348.dp +private val PanelHeight = 316.dp +private val TabsWidth = 204.dp + +@Composable +internal fun AppsAppearanceButton(a: FrontEndActions) { + val pal = LocalPalette.current + val title = stringResource(R.string.apps_appearance) + var at by remember { mutableStateOf(null) } + Box(Modifier.onGloballyPositioned { at = it.boundsInRoot() }) { + HeaderIconButton(title, Icons.Filled.Palette, "apps-appearance") { + val from = at ?: return@HeaderIconButton + Steps.ask(StepAsk( + anchor = from, side = StepSide.Left, accent = pal.signal, pillCorner = 8.dp, items = 2, maxWidth = PanelWidth, + handle = { Icon(Icons.Filled.Palette, null, tint = pal.signal, modifier = Modifier.size(18.dp)) }, + ) { + StepTitle(title) + Column( + Modifier.stepItem(1).fillMaxWidth().height(minOf(PanelHeight, (maxHeight - 64.dp).coerceAtLeast(44.dp))).verticalScroll(rememberScrollState()), + ) { AppearanceRows(a) } + }) + } + } +} + +@Composable +private fun StepOutScope.AppearanceRows(a: FrontEndActions) { + val ctx = LocalContext.current + val host = rememberMenuHost() + var packsOpen by remember { mutableStateOf(false) } + var selected by remember { mutableStateOf(IconPack.selected(ctx)) } + var appColors by remember { mutableStateOf(IconPack.appColors(ctx)) } + val installed by produceState(emptyList()) { + value = withContext(Dispatchers.IO) { runCatching { IconPack.installed(ctx) }.getOrDefault(emptyList()) } + } + val hasBack by produceState(false, selected) { value = withContext(Dispatchers.IO) { IconPack.active(ctx)?.hasBack == true } } + CompositionLocalProvider(LocalCompactSettings provides true) { + val packs = listOf(IconPack.Pack(IconPack.NONE, stringResource(R.string.apps_icon_pack_system))) + installed + val current = packs.find { it.packageName == selected } ?: packs.first() + Box(Modifier.focusRequester(first)) { + LinkRow( + stringResource(R.string.apps_icon_pack), current.label, "", "icon-pack", + arrow = if (packsOpen) "โ–ด" else "โ–พ", + ) { packsOpen = !packsOpen } + } + if (packsOpen) packs.forEach { (value, text) -> + MenuItem(text, checked = value == current.packageName) { + selected = value + IconPack.select(ctx, value) + a.onAppIconsChanged() + packsOpen = false + runCatching { first.requestFocus() } + } + } + SettingsRow(stringResource(R.string.apps_icon_size), null) { + SegmentedTabs( + listOf( + AppsGrid.SMALL to stringResource(R.string.apps_icon_small), + AppsGrid.MEDIUM to stringResource(R.string.apps_icon_medium), + AppsGrid.LARGE to stringResource(R.string.apps_icon_large), + ), + AppsGrid.iconDp, Modifier.width(TabsWidth), + ) { AppsGrid.setIconDp(ctx, it) } + } + SettingsRow(stringResource(R.string.apps_spacing), null) { + SegmentedTabs( + listOf( + AppsGrid.TIGHT to stringResource(R.string.apps_spacing_tight), + AppsGrid.NORMAL to stringResource(R.string.apps_spacing_normal), + AppsGrid.ROOMY to stringResource(R.string.apps_spacing_roomy), + ), + AppsGrid.spacing, Modifier.width(TabsWidth), + ) { AppsGrid.setSpacing(ctx, it) } + } + ToggleRow(host, "app-names", stringResource(R.string.apps_hide_names), null, !AppsGrid.labels) { AppsGrid.setLabels(ctx, !it) } + if (hasBack) ToggleRow(host, "app-colors", stringResource(R.string.apps_icon_app_colors), null, appColors) { + appColors = it + IconPack.setAppColors(ctx, it) + a.onAppIconsChanged() + } + if (HomeIcons.overrides.isNotEmpty()) ActionRow(stringResource(R.string.apps_icons_custom), null, stringResource(R.string.ctrl_reset), { + HomeIcons.clearAll(ctx) + runCatching { first.requestFocus() } + }) + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/ui/BootMovieSection.kt b/app/src/main/java/com/droiddeck/launcher/ui/BootMovieSection.kt index 8e84ae4cbf..9e915031f2 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/BootMovieSection.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/BootMovieSection.kt @@ -142,18 +142,29 @@ private fun TabChip(label: String, selected: Boolean, modifier: Modifier = Modif @Composable internal fun BootMovieGroup(s: ModeSettings, a: ModeSettingsActions, host: MenuHost) { var tab by rememberSaveable { mutableStateOf(MovieTab.INSTALLED) } + val app = LocalContext.current.applicationContext + var skipBootMovie by remember { mutableStateOf(SessionPrefs.skipBootMovie(app)) } SettingsGroup(stringResource(R.string.boot_movie)) { - Row(horizontalArrangement = Arrangement.spacedBy(6.dp), modifier = Modifier.fillMaxWidth().padding(horizontal = 10.dp, vertical = 10.dp)) { - TabChip(stringResource(R.string.boot_movie_tab_installed), tab == MovieTab.INSTALLED, Modifier.weight(1f)) { tab = MovieTab.INSTALLED } - TabChip(stringResource(R.string.boot_movie_tab_import), tab == MovieTab.IMPORT, Modifier.weight(1f)) { tab = MovieTab.IMPORT } - TabChip(stringResource(R.string.boot_movie_tab_repo), tab == MovieTab.REPO, Modifier.weight(1f)) { tab = MovieTab.REPO } - TabChip(stringResource(R.string.boot_movie_tab_sound), tab == MovieTab.SOUND, Modifier.weight(1f)) { tab = MovieTab.SOUND } + ToggleRow( + host, "boot-movie-skip", stringResource(R.string.boot_movie_skip), + stringResource(R.string.boot_movie_skip_hint), skipBootMovie, + ) { enabled -> + skipBootMovie = enabled + SessionPrefs.setSkipBootMovie(app, enabled) } - when (tab) { - MovieTab.INSTALLED -> InstalledTab(a) - MovieTab.IMPORT -> ImportTab(s, a) - MovieTab.REPO -> RepoTab(a) - MovieTab.SOUND -> SoundTab(s, a, host) + if (!skipBootMovie) { + Row(horizontalArrangement = Arrangement.spacedBy(6.dp), modifier = Modifier.fillMaxWidth().padding(horizontal = 10.dp, vertical = 10.dp)) { + TabChip(stringResource(R.string.boot_movie_tab_installed), tab == MovieTab.INSTALLED, Modifier.weight(1f)) { tab = MovieTab.INSTALLED } + TabChip(stringResource(R.string.boot_movie_tab_import), tab == MovieTab.IMPORT, Modifier.weight(1f)) { tab = MovieTab.IMPORT } + TabChip(stringResource(R.string.boot_movie_tab_repo), tab == MovieTab.REPO, Modifier.weight(1f)) { tab = MovieTab.REPO } + TabChip(stringResource(R.string.boot_movie_tab_sound), tab == MovieTab.SOUND, Modifier.weight(1f)) { tab = MovieTab.SOUND } + } + when (tab) { + MovieTab.INSTALLED -> InstalledTab(a) + MovieTab.IMPORT -> ImportTab(s, a) + MovieTab.REPO -> RepoTab(a) + MovieTab.SOUND -> SoundTab(s, a, host) + } } } } diff --git a/app/src/main/java/com/droiddeck/launcher/ui/BottomStrip.kt b/app/src/main/java/com/droiddeck/launcher/ui/BottomStrip.kt index 3df2090bc4..60844df4de 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/BottomStrip.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/BottomStrip.kt @@ -14,7 +14,6 @@ import androidx.compose.ui.platform.LocalContext import com.droiddeck.launcher.hud.DroidDeckHudConfig import com.droiddeck.launcher.hud.FrameStats import com.droiddeck.launcher.hud.GameFrameFeed -import com.droiddeck.launcher.hud.HudFrames import com.droiddeck.launcher.hud.HudMetrics import com.droiddeck.launcher.hud.KeyValueSet import com.droiddeck.launcher.hud.MangoReadings @@ -34,7 +33,7 @@ private const val STRIP_TEMP_PLAIN = 0xFFF2F5F9.toInt() @Composable internal fun SessionBottomStrip(pageId: String?, fps: () -> Float?) { val context = LocalContext.current - val frames = remember { GameFrameFeed(File(LinuxRuntime.rootDir(context), HudFrames.PATH)) } + val frames = remember { GameFrameFeed.forRoot(LinuxRuntime.rootDir(context)) } DisposableEffect(frames) { onDispose { frames.close() } } val page by rememberUpdatedState(pageId) var frameTick by remember { mutableIntStateOf(0) } diff --git a/app/src/main/java/com/droiddeck/launcher/ui/BottomTelemetryPage.kt b/app/src/main/java/com/droiddeck/launcher/ui/BottomTelemetryPage.kt index 08b4ae8ada..4c454b52d1 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/BottomTelemetryPage.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/BottomTelemetryPage.kt @@ -55,7 +55,6 @@ import com.droiddeck.launcher.hud.DroidDeckHudConfig import com.droiddeck.launcher.hud.DroidDeckHudHost import com.droiddeck.launcher.hud.FrameStats import com.droiddeck.launcher.hud.GameFrameFeed -import com.droiddeck.launcher.hud.HudFrames import com.droiddeck.launcher.hud.HudMetrics import com.droiddeck.launcher.hud.KeyValueSet import com.droiddeck.launcher.hud.MangoReadings @@ -144,7 +143,7 @@ fun BottomTelemetryPage(fps: () -> Float?, runningGame: () -> String? = { null } var perfTick by remember { mutableIntStateOf(0) } var traceTick by remember { mutableIntStateOf(0) } var clock by remember { mutableStateOf("") } - val frames = remember { GameFrameFeed(File(LinuxRuntime.rootDir(context), HudFrames.PATH)) } + val frames = remember { GameFrameFeed.forRoot(LinuxRuntime.rootDir(context)) } DisposableEffect(frames) { onDispose { frames.close() } } val currentFps = { if (frames.live) frames.stats.fps else fps() } var hud by remember { mutableStateOf(StatsHud.from(SessionPrefs.statsHud(context))) } diff --git a/app/src/main/java/com/droiddeck/launcher/ui/BuildWatermark.kt b/app/src/main/java/com/droiddeck/launcher/ui/BuildWatermark.kt index 648d754aac..446420806c 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/BuildWatermark.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/BuildWatermark.kt @@ -2,7 +2,12 @@ package com.droiddeck.launcher.ui import android.app.Activity import android.app.Application +import android.content.BroadcastReceiver +import android.content.Intent +import android.content.IntentFilter import android.content.Context +import androidx.core.content.ContextCompat +import com.droiddeck.launcher.session.BuildWatermarkSetting import android.graphics.Canvas import android.graphics.Paint import android.graphics.Typeface @@ -14,11 +19,14 @@ import android.view.Gravity import android.view.View import android.view.ViewGroup import android.widget.FrameLayout +import java.util.WeakHashMap import com.droiddeck.launcher.BuildConfig import com.droiddeck.launcher.QuestXrActivity object BuildWatermark { private const val TITLE_LIMIT = 80 + private val activities = WeakHashMap() + internal var lineProvider: () -> List? = { lines() } fun lines( pr: Int = BuildConfig.PR_NUMBER, @@ -38,32 +46,56 @@ object BuildWatermark { if (text.length <= TITLE_LIMIT) text else text.take(TITLE_LIMIT - 1).trimEnd() + "โ€ฆ" fun install(app: Application) { - val lines = lines() ?: return + ContextCompat.registerReceiver( + app, + object : BroadcastReceiver() { + override fun onReceive(context: Context, intent: Intent) { refresh(context) } + }, + IntentFilter(BuildWatermarkSetting.CHANGED), + "${app.packageName}.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION", + null, + ContextCompat.RECEIVER_NOT_EXPORTED, + ) app.registerActivityLifecycleCallbacks(object : Application.ActivityLifecycleCallbacks { override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) { if (activity is QuestXrActivity) return - val decor = activity.window.decorView as? ViewGroup ?: return - if (decor.findViewWithTag(TAG) != null) return - val margin = (8 * activity.resources.displayMetrics.density).toInt() - decor.addView( - MarkView(activity, lines).apply { tag = TAG }, - FrameLayout.LayoutParams( - ViewGroup.LayoutParams.WRAP_CONTENT, - ViewGroup.LayoutParams.WRAP_CONTENT, - Gravity.BOTTOM or Gravity.END, - ).apply { setMargins(margin, margin, margin, margin) }, - ) + synchronized(activities) { activities[activity] = Unit } + update(activity) } override fun onActivityStarted(activity: Activity) = Unit - override fun onActivityResumed(activity: Activity) = Unit + override fun onActivityResumed(activity: Activity) { update(activity) } override fun onActivityPaused(activity: Activity) = Unit override fun onActivityStopped(activity: Activity) = Unit override fun onActivitySaveInstanceState(activity: Activity, outState: Bundle) = Unit - override fun onActivityDestroyed(activity: Activity) = Unit + override fun onActivityDestroyed(activity: Activity) { synchronized(activities) { activities.remove(activity) } } }) } + fun refresh(context: Context) { + val current = synchronized(activities) { activities.keys.toList() } + current.forEach(::update) + } + + private fun update(activity: Activity) { + if (activity is QuestXrActivity) return + val decor = activity.window.decorView as? ViewGroup ?: return + decor.findViewWithTag(TAG)?.let(decor::removeView) + if (!com.droiddeck.launcher.session.SessionPrefs.buildWatermarkEnabled(activity)) return + val lab = com.droiddeck.launcher.lab.LabOverlay.active?.let { "LAB | ${truncate(it.label)}" } + val build = lineProvider().orEmpty() + val content = (listOfNotNull(lab) + build).ifEmpty { return } + val margin = (8 * activity.resources.displayMetrics.density).toInt() + decor.addView( + MarkView(activity, content).apply { tag = TAG }, + FrameLayout.LayoutParams( + ViewGroup.LayoutParams.WRAP_CONTENT, + ViewGroup.LayoutParams.WRAP_CONTENT, + Gravity.BOTTOM or Gravity.END, + ).apply { setMargins(margin, margin, margin, margin) }, + ) + } + private const val TAG = "build-watermark" private class MarkView(context: Context, private val lines: List) : View(context) { diff --git a/app/src/main/java/com/droiddeck/launcher/ui/DeeDee.kt b/app/src/main/java/com/droiddeck/launcher/ui/DeeDee.kt new file mode 100644 index 0000000000..c2632915fc --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/ui/DeeDee.kt @@ -0,0 +1,381 @@ +package com.droiddeck.launcher.ui + +import androidx.compose.animation.core.CubicBezierEasing +import androidx.compose.animation.core.Easing +import androidx.compose.foundation.Canvas +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.produceState +import androidx.compose.runtime.withFrameNanos +import androidx.compose.ui.Modifier +import androidx.compose.ui.geometry.CornerRadius +import androidx.compose.ui.geometry.Offset +import androidx.compose.ui.geometry.Rect +import androidx.compose.ui.geometry.Size +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.Path +import androidx.compose.ui.graphics.PathOperation +import androidx.compose.ui.graphics.StrokeCap +import androidx.compose.ui.graphics.drawscope.DrawScope +import androidx.compose.ui.graphics.drawscope.Stroke +import androidx.compose.ui.graphics.drawscope.rotate +import androidx.compose.ui.graphics.drawscope.scale +import androidx.compose.ui.graphics.drawscope.translate +import androidx.compose.ui.graphics.drawscope.withTransform +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.text.drawText +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.rememberTextMeasurer +import kotlin.math.PI + +internal enum class PetState { IDLE, WORKING, QUESTION, DONE, ERROR, SLEEP } + +private val White = Color(0xFFFFFFFF) +private val Blue = Color(0xFF1A9FFF) +private val Ink = Color(0xFF0E141B) +private val Amber = Color(0xFFFFB627) +private val Red = Color(0xFFFF5A5F) +private val Slate = Color(0xFF3A4A5A) +private val Term = Color(0xFF26303B) +private val TermLine = Color(0xFF8FA3B6) + +private val EaseInOut: Easing = CubicBezierEasing(0.42f, 0f, 0.58f, 1f) +private val EaseOut: Easing = CubicBezierEasing(0f, 0f, 0.58f, 1f) +private val Hop: Easing = CubicBezierEasing(0.3f, 0f, 0.4f, 1f) +private val Pop: Easing = CubicBezierEasing(0.3f, 1.6f, 0.5f, 1f) +private val Linear = Easing { it } +private val Step = Easing { 0f } + +/** Where 0..1 of a loop [period] seconds long is at [time]; [lead] starts it that many seconds early. */ +private fun loop(time: Float, period: Float, lead: Float = 0f): Float { + val t = (time + lead) % period + return (if (t < 0) t + period else t) / period +} + +/** A CSS-style keyframe track: [stops] holds (position, value) pairs, eased per segment. */ +private fun track(p: Float, easing: Easing, vararg stops: Float): Float { + if (p <= stops[0]) return stops[1] + var i = 0 + while (i + 2 < stops.size) { + val a = stops[i] + val b = stops[i + 2] + if (p <= b) { + val t = if (b > a) (p - a) / (b - a) else 1f + return stops[i + 1] + (stops[i + 3] - stops[i + 1]) * easing.transform(t) + } + i += 2 + } + return stops[stops.size - 1] +} + +private fun mix(a: Color, b: Color, t: Float) = Color( + a.red + (b.red - a.red) * t, a.green + (b.green - a.green) * t, a.blue + (b.blue - a.blue) * t, a.alpha + (b.alpha - a.alpha) * t, +) + +/** The DroidDeck mark the head is drawn from, in its own 128 by 223.72 space. */ +private val headMark: Path by lazy { + val d = Path().apply { + moveTo(-31.98f, 0f) + lineTo(63.97f, 0f) + cubicTo(125.81f, 0f, 175.93f, 50.08f, 175.93f, 111.86f) + cubicTo(175.93f, 173.64f, 125.81f, 223.72f, 63.97f, 223.72f) + lineTo(-31.98f, 223.72f) + close() + } + val cut = Path().apply { + addOval(Rect(Offset(63.98f, 111.86f), 71.81f)) + addRect(Rect(56.055f, 0f, 56.055f + 15.83f, 45f)) + addRect(Rect(56.055f, 178.72f, 56.055f + 15.83f, 223.72f)) + } + Path.combine(PathOperation.Difference, d, cut) +} + +private fun star(x: Float, y: Float, a: Float) = Path().apply { + moveTo(x, y - a) + quadraticBezierTo(x, y, x + a, y) + quadraticBezierTo(x, y, x, y + a) + quadraticBezierTo(x, y, x - a, y) + quadraticBezierTo(x, y, x, y - a) + close() +} + +private class Spark(val x: Float, val y: Float, val size: Float, val color: Color, val lead: Float) + +private val sparks = listOf( + Spark(90f, 120f, 14f, White, 0f), Spark(318f, 110f, 12f, Blue, 0.4f), Spark(104f, 210f, 9f, Blue, 0.8f), + Spark(312f, 200f, 10f, White, 0.4f), Spark(250f, 40f, 8f, White, 0f), +).map { it to star(it.x, it.y, it.size) } + +/** The rig of the DeeDee mock (a 400 by 360 view box) looping through [state]; [crop] is the part of the view box shown. */ +@Composable +internal fun DeeDee(state: PetState, modifier: Modifier, crop: Rect = Rect(35f, 15f, 365f, 345f)) { + val time by produceState(0f) { + val start = withFrameNanos { it } + while (true) withFrameNanos { value = (it - start) / 1_000_000_000f } + } + val text = rememberTextMeasurer() + Canvas(modifier) { + val k = minOf(size.width / crop.width, size.height / crop.height) + withTransform({ + translate((size.width - crop.width * k) / 2, (size.height - crop.height * k) / 2) + scale(k, k, Offset.Zero) + translate(-crop.left, -crop.top) + }) { rig(state, time, text) } + } +} + +private fun DrawScope.rig(state: PetState, t: Float, text: androidx.compose.ui.text.TextMeasurer) { + // Shadow under the feet. + var shadowX = 1f + var shadowAlpha = 0.4f + when (state) { + PetState.IDLE -> shadowX = track(loop(t, 3f), EaseInOut, 0f, 1f, 0.5f, 0.9f, 1f, 1f) + PetState.DONE -> { + val p = loop(t, 1.2f) + shadowX = track(p, Hop, 0f, 1f, 0.15f, 1f, 0.45f, 0.7f, 0.75f, 1f, 1f, 1f) + shadowAlpha = track(p, Hop, 0f, 0.4f, 0.15f, 0.4f, 0.45f, 0.2f, 0.75f, 0.4f, 1f, 0.4f) + } + else -> Unit + } + scale(shadowX, 1f, Offset(200f, 336f)) { + drawOval(Color.Black.copy(alpha = shadowAlpha), Offset(130f, 327f), Size(140f, 18f)) + } + + // The whole body moves together. + var dx = 0f + var dy = 0f + var sx = 1f + var sy = 1f + when (state) { + PetState.IDLE -> dy = track(loop(t, 3f), EaseInOut, 0f, 0f, 0.5f, -6f, 1f, 0f) + PetState.WORKING -> dy = track(loop(t, 1.6f), EaseInOut, 0f, 0f, 0.5f, -2f, 1f, 0f) + PetState.QUESTION -> dy = track(loop(t, 2.4f), EaseInOut, 0f, 0f, 0.5f, -4f, 1f, 0f) + PetState.DONE -> { + val p = loop(t, 1.2f) + dy = track(p, Hop, 0f, 0f, 0.15f, 0f, 0.45f, -30f, 0.75f, 0f, 1f, 0f) + sx = track(p, Hop, 0f, 1.03f, 0.15f, 1f, 0.75f, 1f, 0.85f, 1.04f, 1f, 1.03f) + sy = track(p, Hop, 0f, 0.96f, 0.15f, 1f, 0.75f, 1f, 0.85f, 0.95f, 1f, 0.96f) + } + PetState.ERROR -> dx = track(loop(t, 2f), EaseInOut, 0f, 0f, 0.04f, -7f, 0.08f, 7f, 0.12f, -5f, 0.16f, 5f, 0.2f, -2f, 0.24f, 2f, 0.3f, 0f, 1f, 0f) + PetState.SLEEP -> { + val p = loop(t, 4f) + sx = track(p, EaseInOut, 0f, 1f, 0.5f, 1.02f, 1f, 1f) + sy = track(p, EaseInOut, 0f, 1f, 0.5f, 0.97f, 1f, 1f) + } + } + val alarm = if (state == PetState.ERROR) track(loop(t, 2f), EaseInOut, 0f, 0f, 0.04f, 1f, 0.24f, 1f, 0.3f, 0f, 1f, 0f) else 0f + withTransform({ + translate(dx, dy) + scale(sx, sy, Offset(200f, 317f)) + }) { + legs() + body(state, t, alarm) + if (state == PetState.WORKING) terminal(t) + arms(state, t) + head(state, t, alarm) + } + extras(state, t, text) +} + +private fun DrawScope.legs() { + for ((x, y, w, h, r) in listOf( + floatArrayOf(166f, 283f, 18f, 30f, 8f), floatArrayOf(216f, 283f, 18f, 30f, 8f), + floatArrayOf(158f, 305f, 30f, 12f, 6f), floatArrayOf(212f, 305f, 30f, 12f, 6f), + )) drawRoundRect(White, Offset(x, y), Size(w, h), CornerRadius(r)) +} + +private operator fun FloatArray.component5() = this[4] + +private fun DrawScope.body(state: PetState, t: Float, alarm: Float) { + drawRect(White, Offset(194f, 200f), Size(12f, 20f)) + drawRoundRect(White, Offset(148f, 215f), Size(104f, 72f), CornerRadius(22f)) + val glow = when (state) { + PetState.WORKING -> track(loop(t, 0.8f), EaseInOut, 0f, 1f, 0.5f, 0.5f, 1f, 1f) + PetState.SLEEP -> track(loop(t, 4f), EaseInOut, 0f, 0.35f, 0.5f, 0.8f, 1f, 0.35f) + else -> 1f + } + drawCircle(mix(Blue, Red, alarm).copy(alpha = glow), 11f, Offset(200f, 251f)) +} + +private fun DrawScope.terminal(t: Float) { + drawRoundRect(Term, Offset(150f, 256f), Size(100f, 40f), CornerRadius(8f)) + drawRoundRect(Blue, Offset(150f, 256f), Size(100f, 40f), CornerRadius(8f), style = Stroke(3f)) + drawRoundRect(Blue, Offset(160f, 266f), Size(44f, 5f), CornerRadius(2.5f)) + val grow = track(loop(t, 1.6f), EaseOut, 0f, 0.1f, 0.7f, 1f, 1f, 1f) + scale(grow, 1f, Offset(160f, 278f)) { drawRoundRect(TermLine, Offset(160f, 276f), Size(60f, 5f), CornerRadius(2.5f)) } + val cursor = track(loop(t, 0.7f), Step, 0f, 1f, 0.5f, 0.2f, 1f, 0.2f) + drawRoundRect(White.copy(alpha = cursor), Offset(224f, 276f), Size(10f, 5f), CornerRadius(2f)) +} + +/** One arm: from the shoulder through a curve to the hand, turned about the shoulder. */ +private fun DrawScope.arm(shoulder: Offset, control: Offset, hand: Offset, degrees: Float) { + rotate(degrees, shoulder) { + val path = Path().apply { + moveTo(shoulder.x, shoulder.y) + quadraticBezierTo(control.x, control.y, hand.x, hand.y) + } + drawPath(path, White, style = Stroke(10f, cap = StrokeCap.Round)) + drawCircle(White, 9f, hand) + } +} + +private fun DrawScope.arms(state: PetState, t: Float) { + val l = Offset(151f, 236f) + val r = Offset(249f, 236f) + when (state) { + PetState.IDLE -> { + val sway = track(loop(t, 3f), EaseInOut, 0f, 0f, 0.5f, 4f, 1f, 0f) + arm(l, Offset(127f, 246f), Offset(123f, 276f), sway) + arm(r, Offset(273f, 246f), Offset(277f, 276f), sway) + } + PetState.WORKING -> { + val p = loop(t, 0.32f) + arm(l, Offset(133f, 258f), Offset(157f, 270f), track(p, EaseInOut, 0f, 0f, 0.5f, -6f, 1f, 0f)) + arm(r, Offset(267f, 258f), Offset(243f, 270f), track(p, EaseInOut, 0f, -5f, 0.5f, 1f, 1f, -5f)) + } + PetState.QUESTION -> { + arm(l, Offset(127f, 246f), Offset(123f, 276f), 0f) + arm(r, Offset(279f, 230f), Offset(287f, 198f), track(loop(t, 0.9f), EaseInOut, 0f, -8f, 0.5f, 14f, 1f, -8f)) + } + PetState.DONE -> { + val p = loop(t, 1.2f) + arm(l, Offset(121f, 230f), Offset(115f, 196f), track(p, EaseInOut, 0f, 0f, 0.45f, 12f, 1f, 0f)) + arm(r, Offset(279f, 230f), Offset(285f, 196f), track(p, EaseInOut, 0f, 0f, 0.45f, -12f, 1f, 0f)) + } + PetState.ERROR, PetState.SLEEP -> { + arm(Offset(151f, 238f), Offset(137f, 254f), Offset(135f, 284f), 0f) + arm(Offset(249f, 238f), Offset(263f, 254f), Offset(265f, 284f), 0f) + } + } +} + +private fun DrawScope.head(state: PetState, t: Float, alarm: Float) { + val tilt = when (state) { + PetState.QUESTION -> track(loop(t, 2.4f), EaseInOut, 0f, -9f, 0.5f, -5f, 1f, -9f) + PetState.SLEEP -> 6f + else -> 0f + } + withTransform({ + rotate(tilt, Offset(200f, 215f)) + if (state == PetState.SLEEP) translate(0f, 6f) + }) { + antenna(state, t) + withTransform({ + translate(200f, 150f) + scale(0.62f, 0.62f, Offset.Zero) + translate(-64f, -111.86f) + }) { + drawPath(headMark, White) + drawCircle(mix(Blue, Red, alarm).copy(alpha = if (state == PetState.SLEEP) 0.6f else 1f), 55.98f, Offset(63.98f, 111.86f)) + } + eye(state, t) + if (state == PetState.WORKING) { + val sweep = 46f / (2f * PI.toFloat() * 39.6f) * 360f + rotate(360f * loop(t, 1.1f), Offset(200f, 150f)) { + drawArc(Blue, 0f, sweep, false, Offset(160.4f, 110.4f), Size(79.2f, 79.2f), style = Stroke(5f, cap = StrokeCap.Round)) + } + } + } +} + +private fun DrawScope.antenna(state: PetState, t: Float) { + val lean = when (state) { + PetState.ERROR -> 22f + PetState.SLEEP -> -28f + else -> 0f + } + rotate(lean, Offset(200f, 100f)) { + drawLine(White, Offset(200f, 100f), Offset(200f, 52f), 7f, StrokeCap.Round) + var radius = 10f + val (color, alpha) = when (state) { + PetState.IDLE -> Blue to track(loop(t, 3f), EaseInOut, 0f, 1f, 0.5f, 0.45f, 1f, 1f) + PetState.WORKING -> Blue to track(loop(t, 0.5f), Step, 0f, 1f, 0.5f, 0.2f, 1f, 0.2f) + PetState.QUESTION -> { + val p = loop(t, 1f) + radius = track(p, EaseInOut, 0f, 10f, 0.5f, 13f, 1f, 10f) + Amber to track(p, EaseInOut, 0f, 1f, 0.5f, 0.5f, 1f, 1f) + } + PetState.DONE -> Blue to 1f + PetState.ERROR -> Red to track(loop(t, 1f), Step, 0f, 1f, 0.5f, 0.25f, 1f, 0.25f) + PetState.SLEEP -> Slate to 1f + } + drawCircle(color.copy(alpha = alpha), radius, Offset(200f, 45f)) + } +} + +private fun DrawScope.eye(state: PetState, t: Float) { + when (state) { + PetState.DONE -> drawPath(Path().apply { moveTo(186f, 156f); quadraticBezierTo(203f, 136f, 220f, 156f) }, Ink, style = Stroke(7f, cap = StrokeCap.Round)) + PetState.SLEEP -> drawPath(Path().apply { moveTo(186f, 152f); quadraticBezierTo(203f, 162f, 220f, 152f) }, Ink, style = Stroke(6f, cap = StrokeCap.Round)) + PetState.ERROR -> { + val stroke = 6f + drawLine(Ink, Offset(193f, 139f), Offset(215f, 161f), stroke, StrokeCap.Round) + drawLine(Ink, Offset(215f, 139f), Offset(193f, 161f), stroke, StrokeCap.Round) + } + else -> { + val blink = if (state == PetState.IDLE) track(loop(t, 4.5f), EaseInOut, 0f, 1f, 0.44f, 1f, 0.47f, 0.1f, 0.5f, 1f, 1f, 1f) else 1f + val (px, py) = when (state) { + PetState.IDLE -> track(loop(t, 9f), EaseInOut, 0f, 0f, 0.3f, 0f, 0.36f, -7f, 0.52f, -7f, 0.58f, 5f, 0.8f, 5f, 0.86f, 0f, 1f, 0f) to 0f + PetState.WORKING -> track(loop(t, 1.6f), EaseInOut, 0f, -7f, 0.5f, 6f, 1f, -7f) to 0f + else -> 5f to -5f + } + scale(1f, blink, Offset(204f, 149f)) { + translate(px, py) { + drawCircle(Ink, 16f, Offset(204f, 149f)) + drawCircle(White, 5f, Offset(210f, 143f)) + drawCircle(White.copy(alpha = 0.7f), 2.2f, Offset(199f, 155f)) + } + } + } + } +} + +private fun DrawScope.speechTail(color: Color) { + drawPath(Path().apply { moveTo(264f, 82f); lineTo(254f, 100f); lineTo(278f, 86f); close() }, color) +} + +private fun DrawScope.extras(state: PetState, t: Float, text: androidx.compose.ui.text.TextMeasurer) { + when (state) { + PetState.QUESTION -> { + val p = loop(t, 2.4f) + val s = track(p, Pop, 0f, 0.4f, 0.12f, 1f, 0.88f, 1f, 1f, 0.9f) + val a = track(p, Pop, 0f, 0f, 0.12f, 1f, 0.88f, 1f, 1f, 0f).coerceIn(0f, 1f) + scale(s, s, Offset(262f, 96f)) { + drawRoundRect(Amber.copy(alpha = a), Offset(254f, 30f), Size(62f, 58f), CornerRadius(18f)) + speechTail(Amber.copy(alpha = a)) + val mark = text.measure("?", TextStyle(color = Ink.copy(alpha = a), fontSize = 42f.toSp(), fontWeight = FontWeight.Bold)) + drawText(mark, topLeft = Offset(285f - mark.size.width / 2f, 74f - mark.firstBaseline)) + } + } + PetState.ERROR -> { + val nudge = track(loop(t, 2f), EaseInOut, 0f, 0f, 0.06f, -10f, 0.14f, 8f, 0.22f, -4f, 0.3f, 0f, 1f, 0f) + rotate(nudge, Offset(262f, 96f)) { + drawRoundRect(Red, Offset(254f, 34f), Size(54f, 54f), CornerRadius(16f)) + speechTail(Red) + drawRoundRect(White, Offset(277f, 44f), Size(8f, 24f), CornerRadius(4f)) + drawCircle(White, 5f, Offset(281f, 77f)) + } + } + PetState.DONE -> for ((spark, path) in sparks) { + val p = loop(t, 1.2f, spark.lead) + val s = track(p, EaseInOut, 0f, 0f, 0.4f, 1f, 0.7f, 0.6f, 1f, 0f) + val turn = track(p, EaseInOut, 0f, 0f, 0.4f, 45f, 0.7f, 90f, 1f, 0f) + val a = track(p, EaseInOut, 0f, 0f, 0.4f, 1f, 0.7f, 0.8f, 1f, 0f) + if (s <= 0.01f) continue + withTransform({ + rotate(turn, Offset(spark.x, spark.y)) + scale(s, s, Offset(spark.x, spark.y)) + }) { drawPath(path, spark.color.copy(alpha = a)) } + } + PetState.SLEEP -> for ((i, z) in listOf(Triple(250f, 96f, 22f), Triple(268f, 74f, 30f), Triple(286f, 52f, 38f)).withIndex()) { + val p = loop(t, 4f, -1.3f * i) + val a = track(p, EaseOut, 0f, 0f, 0.2f, 1f, 1f, 0f) + val zx = track(p, EaseOut, 0f, -10f, 1f, 14f) + val zy = track(p, EaseOut, 0f, 16f, 1f, -22f) + val glyph = text.measure("z", TextStyle(color = White.copy(alpha = a), fontSize = z.third.toSp(), fontWeight = FontWeight.Bold)) + // The view box places a glyph by its baseline. + drawText(glyph, topLeft = Offset(z.first + zx, z.second + zy - glyph.firstBaseline)) + } + else -> Unit + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/ui/DroidDeckHudSettings.kt b/app/src/main/java/com/droiddeck/launcher/ui/DroidDeckHudSettings.kt index 4b67d9eea4..65a65502f2 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/DroidDeckHudSettings.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/DroidDeckHudSettings.kt @@ -1,5 +1,7 @@ package com.droiddeck.launcher.ui +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf @@ -8,7 +10,9 @@ import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource +import androidx.compose.ui.unit.sp import com.droiddeck.launcher.R +import com.droiddeck.launcher.hud.DroidDeckHudConfig import com.droiddeck.launcher.hud.DroidDeckHudSize import com.droiddeck.launcher.session.SessionPrefs import com.droiddeck.launcher.session.StripMetric @@ -55,20 +59,34 @@ internal fun DroidDeckHudSettings(host: MenuHost, a: DrawerActions, track: (Stri ChoiceRow(host, "hud-outline-color", stringResource(R.string.hud_outline_color), null, listOf("0" to stringResource(R.string.hud_outline_gray), "1" to stringResource(R.string.hud_outline_theme)), if (cfg["hudOutlineAccent"] == "0") "0" else "1", chipModifier = track("hud-outline-color")) { a.onHudSetting("hudOutlineAccent", it) } + ToggleRow(host, "hud-fps-decimal", stringResource(R.string.hud_metric_decimal), null, on("fpsDecimal"), + chipModifier = track("hud-fps-decimal")) { a.onHudSetting("fpsDecimal", flag(it)) } + ToggleRow(host, "hud-clock", stringResource(R.string.hud_metric_clock), null, on("showClock"), + chipModifier = track("hud-clock")) { a.onHudSetting("showClock", flag(it)) } + ToggleRow(host, "hud-graph", stringResource(R.string.hud_metric_graph), null, on("showFPSGraph"), + chipModifier = track("hud-graph")) { a.onHudSetting("showFPSGraph", flag(it)) } } - val size = DroidDeckHudSize.from(cfg["hudSize"]) - val chips = size.supportedChips() + EXTRA[size].orEmpty() + var editing by remember { mutableStateOf(false) } SettingsGroup(stringResource(R.string.hud_group_metrics)) { - for (metric in METRICS) { - if (metric.chip !in chips || metric.chip in HIDDEN[size].orEmpty()) continue - ToggleRow(host, "hud-${metric.key}", stringResource(metric.label), null, on(metric.key), - chipModifier = track("hud-${metric.key}")) { a.onHudSetting(metric.key, flag(it)) } + ActionRow(stringResource(R.string.hud_group_metrics), null, stringResource(R.string.common_edit), + onClick = { editing = true }, modifier = track("hud-readings")) + val rows = DroidDeckHudSize.rowsFor(DroidDeckHudSize.from(cfg["hudSize"]), cfg) + SettingsRow(stringResource(R.string.hud_readings_shown), null) { + Text(stringResource(R.string.hud_readings_count, rows.count { on(it) }, rows.size), + fontSize = 13.sp, color = MaterialTheme.colorScheme.onSurfaceVariant) } + if (editing) HudReadingsDialog( + visible = rows, + initialOrder = rows, + initialOn = rows.associateWith { on(it) }, + onDismiss = { editing = false }, + onSave = { switches, order -> a.onHudOrder(switches, order) }, + onReset = a.onHudOrderReset, + ) } - val tempsShown = ("Temp" in chips && on("showTemp")) || ("GPU temp" in chips && on("showGpuTemp")) - if (tempsShown) SettingsGroup(stringResource(R.string.hud_group_temps)) { + if (on("showTemp") || on("showGpuTemp") || on("showBatteryTemp")) SettingsGroup(stringResource(R.string.hud_group_temps)) { ChoiceRow(host, "hud-temp-unit", stringResource(R.string.hud_temp_unit), null, listOf("c" to "ยฐC", "f" to "ยฐF"), if (cfg["tempUnit"].equals("f", true)) "f" else "c", chipModifier = track("hud-temp-unit")) { a.onHudSetting("tempUnit", it) } @@ -145,39 +163,39 @@ private val BOTTOM_STRIP_ROWS = listOf( StripMetric.CLOCK to R.string.hud_metric_clock, ) -private val EXTRA = mapOf(DroidDeckHudSize.PILL to setOf("Temp", "Power")) - -private class HudMetric(val chip: String, val key: String, val label: Int) +private class HudMetric(val key: String, val label: Int) +// Wrapper and DX version have nothing to show in DroidDeck. private val METRICS = listOf( - HudMetric("FPS", "showFPS", R.string.drawer_hud_fps), - HudMetric("FPS graph", "showFPSGraph", R.string.hud_metric_graph), - HudMetric("FPS .1", "fpsDecimal", R.string.hud_metric_decimal), - HudMetric("1% low", "showLow1", R.string.hud_metric_low1), - HudMetric("0.1% low", "showLow01", R.string.hud_metric_low01), - HudMetric("0.01% low", "showLow001", R.string.hud_metric_low001), - HudMetric("Engine", "showEngine", R.string.hud_metric_engine), - HudMetric("GPU model", "showGpuModel", R.string.hud_metric_gpu_model), - HudMetric("GPU", "showGPULoad", R.string.hud_metric_gpu), - HudMetric("GPU temp", "showGpuTemp", R.string.hud_metric_gpu_temp), - HudMetric("CPU", "showCPUUsage", R.string.hud_metric_cpu), - HudMetric("Per-core", "showPerCore", R.string.hud_metric_per_core), - HudMetric("Temp", "showTemp", R.string.hud_metric_temp), - HudMetric("RAM", "showRAM", R.string.hud_metric_ram), - HudMetric("VRAM", "showVram", R.string.hud_metric_vram), - HudMetric("Swap", "showSwap", R.string.hud_metric_swap), - HudMetric("Battery", "showBattery", R.string.hud_metric_battery), - HudMetric("Power", "showPower", R.string.hud_metric_power), - HudMetric("Network", "showNet", R.string.hud_metric_network), - HudMetric("Resolution", "showResolution", R.string.hud_metric_resolution), - HudMetric("Proton", "showProton", R.string.hud_metric_proton), - HudMetric("Session", "showSession", R.string.hud_metric_session), - HudMetric("Clock", "showClock", R.string.hud_metric_clock), + HudMetric("showGpuModel", R.string.hud_metric_gpu_model), + HudMetric("showGPULoad", R.string.hud_metric_gpu), + HudMetric("showCPUUsage", R.string.hud_metric_cpu), + HudMetric("showPerCore", R.string.hud_metric_per_core), + HudMetric("showTemp", R.string.hud_metric_temp), + HudMetric("showBatteryTemp", R.string.drawer_hud_battery), + HudMetric("showGpuTemp", R.string.hud_metric_gpu_temp), + HudMetric("showVram", R.string.hud_metric_vram), + HudMetric("showRAM", R.string.hud_metric_ram), + HudMetric("showSwap", R.string.hud_metric_swap), + HudMetric("showBattery", R.string.hud_metric_battery), + HudMetric("showBatteryTime", R.string.hud_metric_battery_time), + HudMetric("showPower", R.string.hud_metric_power), + HudMetric("showFPS", R.string.drawer_hud_fps), + HudMetric("showFPSGraph", R.string.hud_metric_graph), + HudMetric("showLatency", R.string.hud_metric_latency), + HudMetric("showAvg", R.string.hud_metric_avg), + HudMetric("showLow1", R.string.hud_metric_low1), + HudMetric("showLow01", R.string.hud_metric_low01), + HudMetric("showLow001", R.string.hud_metric_low001), + HudMetric("showEngine", R.string.hud_metric_engine), + HudMetric("showDisplay", R.string.hud_metric_display), + HudMetric("showHdr", R.string.hud_metric_hdr), + HudMetric("showNet", R.string.hud_metric_network), + HudMetric("showResolution", R.string.hud_metric_resolution), + HudMetric("showProton", R.string.hud_metric_proton), + HudMetric("showSession", R.string.hud_metric_session), + HudMetric("showClock", R.string.hud_metric_clock), ) -private val HIDDEN = mapOf( - DroidDeckHudSize.PILL to setOf("FPS", "FPS graph"), - DroidDeckHudSize.MINIMAL to setOf("FPS"), - DroidDeckHudSize.TILES to setOf("FPS graph", "0.1% low", "0.01% low"), - DroidDeckHudSize.STRIP to setOf("FPS"), -) +internal fun hudMetricLabel(key: String): Int? = + METRICS.firstOrNull { it.key == key }?.label diff --git a/app/src/main/java/com/droiddeck/launcher/ui/DualScreenPanel.kt b/app/src/main/java/com/droiddeck/launcher/ui/DualScreenPanel.kt index b46afbb977..df4e4a8d1b 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/DualScreenPanel.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/DualScreenPanel.kt @@ -59,6 +59,8 @@ class DualPanelModel( val appScale: Int, val onSelect: (String) -> Unit, val onResume: () -> Unit, + val title: String = selected, + val moreDownloads: Int = 0, ) object DualScreenPanel { @@ -322,7 +324,7 @@ internal fun DualPanelContent(model: DualPanelModel) { Row(Modifier.fillMaxWidth(), verticalAlignment = Alignment.CenterVertically) { Text(stringResource(R.string.app_name), fontSize = 15.sp, fontWeight = FontWeight.Bold, color = pal.signal) Spacer(Modifier.size(12.dp)) - val (label, _) = railLabelIcon(model.selected) + val (label, _) = railLabelIcon(model.title) Text(stringResource(label), fontSize = 15.sp, fontWeight = FontWeight.SemiBold, color = colors.onBackground, modifier = Modifier.weight(1f), maxLines = 1, overflow = TextOverflow.Ellipsis) PanelClock() @@ -336,7 +338,7 @@ internal fun DualPanelContent(model: DualPanelModel) { for (row in model.keys.chunked(columns)) { Row(Modifier.fillMaxWidth().height(tileHeight), horizontalArrangement = Arrangement.spacedBy(gap)) { for (key in row) PanelTile(key, key == model.selected, key in model.badges, - if (key == "stores") model.storeDownloads else 0, Modifier.weight(1f)) { model.onSelect(key) } + if (key == "stores") model.storeDownloads else if (key == NavTabs.MORE) model.moreDownloads else 0, Modifier.weight(1f)) { model.onSelect(key) } repeat(columns - row.size) { Spacer(Modifier.weight(1f)) } } } @@ -400,12 +402,10 @@ private fun PanelClock() { } @Composable -internal fun DualPanelPublisher(s: FrontEndState, selected: String, onSelect: (String) -> Unit, a: FrontEndActions) { - val badges = buildSet { - if (setupNeedsAttention(s)) add("setup") - if (s.updates.hasUpdate) add("updates") - } - val model = DualPanelModel(navigationKeys(s), selected, badges, s.storeDownloadsActive, s.running, s.theme, s.appScale, onSelect, a.onResume) +internal fun DualPanelPublisher(s: FrontEndState, selected: String, title: String, onSelect: (String) -> Unit, a: FrontEndActions) { + val keys = navigationKeys(s) + val badges = keys.filter { railBadge(s, it) }.toSet() + val model = DualPanelModel(keys, selected, badges, s.storeDownloadsActive, s.running, s.theme, s.appScale, onSelect, a.onResume, title, railCount(s, NavTabs.MORE)) androidx.compose.runtime.SideEffect { DualScreenPanel.model = model } androidx.compose.runtime.DisposableEffect(Unit) { onDispose { DualScreenPanel.model = null } } } diff --git a/app/src/main/java/com/droiddeck/launcher/ui/EaUpdateButton.kt b/app/src/main/java/com/droiddeck/launcher/ui/EaUpdateButton.kt new file mode 100644 index 0000000000..9fe2a41155 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/ui/EaUpdateButton.kt @@ -0,0 +1,17 @@ +package com.droiddeck.launcher.ui + +import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.stringResource +import com.droiddeck.launcher.R +import com.droiddeck.launcher.stores.InstalledStoreGame +import com.droiddeck.launcher.stores.ea.EaUpdates + +@Composable +internal fun EaUpdateButton(installed: InstalledStoreGame, enabled: Boolean) { + val ctx = LocalContext.current + LaunchedEffect(installed.key, installed.sidecar.installVersion) { EaUpdates.check(ctx, installed) } + if (EaUpdates.available[installed.key] == null) return + SecondaryButton(stringResource(R.string.common_update), enabled = enabled) { EaUpdates.start(ctx, installed) } +} diff --git a/app/src/main/java/com/droiddeck/launcher/ui/EdgeFling.kt b/app/src/main/java/com/droiddeck/launcher/ui/EdgeFling.kt new file mode 100644 index 0000000000..700d031776 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/ui/EdgeFling.kt @@ -0,0 +1,92 @@ +package com.droiddeck.launcher.ui + +import android.view.Choreographer +import kotlin.math.abs +import kotlin.math.sqrt + +/** + * Where something dragged and let go against the side edges, like a chat head, comes to rest: + * a quick sideways flick sends it to the side it was thrown toward from wherever it is; a slower + * release goes to the side its coasting would carry it to; and its height carries on with the + * throw. Velocities are pixels per second. + */ +internal object EdgeFling { + /** How far a throw coasts, in seconds of its release velocity. */ + const val COAST_S = 0.18f + /** A sideways speed past this many dp per second picks its side outright. */ + private const val FLICK_DP_S = 600f + + fun toRight(centerX: Float, span: Float, vx: Float, density: Float): Boolean { + if (abs(vx) > FLICK_DP_S * density) return vx > 0 + return centerX + vx * COAST_S > span / 2 + } + + fun restY(y: Float, vy: Float, min: Float, max: Float) = (y + vy * COAST_S).coerceIn(min, max.coerceAtLeast(min)) +} + +/** + * A spring in two dimensions that starts with the velocity it was let go with, stepped on each + * display frame, so a throw flows into its settle instead of starting over from rest. + */ +internal class FlingSpring( + private val stiffness: Float = 340f, + dampingRatio: Float = 0.74f, + private val onFrame: (Float, Float) -> Unit, +) : Choreographer.FrameCallback { + private val damping = 2f * dampingRatio * sqrt(stiffness) + private var x = 0f + private var y = 0f + private var vx = 0f + private var vy = 0f + private var toX = 0f + private var toY = 0f + private var last = 0L + private var onEnd: (() -> Unit)? = null + var running = false + private set + + fun start(fromX: Float, fromY: Float, velocityX: Float, velocityY: Float, targetX: Float, targetY: Float, end: (() -> Unit)? = null) { + cancel() + x = fromX; y = fromY; vx = velocityX; vy = velocityY; toX = targetX; toY = targetY + onEnd = end + if (Motion.scale == 0f) { + onFrame(toX, toY) + end?.invoke() + return + } + running = true + last = 0L + Choreographer.getInstance().postFrameCallback(this) + } + + fun cancel() { + if (!running) return + running = false + Choreographer.getInstance().removeFrameCallback(this) + } + + override fun doFrame(frameTimeNanos: Long) { + if (!running) return + val dt = if (last == 0L) 1f / 120f else ((frameTimeNanos - last) / 1e9f).coerceIn(0f, 1f / 20f) + last = frameTimeNanos + // Small fixed steps keep the spring stable however long a frame took. + var left = dt / Motion.scale.coerceAtLeast(0.1f) + while (left > 0f) { + val h = minOf(left, 1f / 480f) + vx += (-stiffness * (x - toX) - damping * vx) * h + vy += (-stiffness * (y - toY) - damping * vy) * h + x += vx * h + y += vy * h + left -= h + } + val settled = abs(x - toX) < 0.5f && abs(y - toY) < 0.5f && abs(vx) < 20f && abs(vy) < 20f + if (settled) { + running = false + onFrame(toX, toY) + onEnd?.invoke() + return + } + onFrame(x, y) + Choreographer.getInstance().postFrameCallback(this) + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/ui/FrameGenMenu.kt b/app/src/main/java/com/droiddeck/launcher/ui/FrameGenMenu.kt index bac30bd3b8..83f2e05436 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/FrameGenMenu.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/FrameGenMenu.kt @@ -13,6 +13,9 @@ internal fun FrameGenMenu( host: MenuHost, mode: FrameGen.Mode, lossless: Lossless.State, onPick: (FrameGen.Mode) -> Unit, onImportLossless: () -> Unit, + gameProfileId: String? = null, + hasGameOverride: Boolean = false, + onResetGame: () -> Unit = {}, ) { val context = LocalContext.current AnchoredMenu(host.open == "fg", onDismiss = { if (host.open == "fg") host.open = null }, title = stringResource(R.string.frame_gen_title)) { firstItemFocus -> @@ -27,6 +30,12 @@ internal fun FrameGenMenu( onPick(m); host.open = null } item(FrameGen.Mode.OFF, focus = firstItemFocus) + if (gameProfileId != null) { + MenuItem(stringResource(R.string.comp_game_use_general), checked = !hasGameOverride) { + onResetGame() + host.open = null + } + } for (m in 2..4) item(FrameGen.Mode(FrameGen.ENGINE_DDFG, m)) val lsfg = (2..4).map { FrameGen.Mode(FrameGen.ENGINE_LSFG, it) } + FrameGen.ADAPTIVE_TARGETS.map { FrameGen.Mode(FrameGen.ENGINE_LSFG, target = it) } diff --git a/app/src/main/java/com/droiddeck/launcher/ui/FrontEndContent.kt b/app/src/main/java/com/droiddeck/launcher/ui/FrontEndContent.kt index 1c4536fc02..26d0506a73 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/FrontEndContent.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/FrontEndContent.kt @@ -115,6 +115,7 @@ internal fun Pane( s.pageKey != null && page != null -> null selected.startsWith("app:") -> s.steamGames.firstOrNull { "app:${it.appId}" == selected }?.art selected == "games" -> s.steamGames.maxByOrNull { it.lastPlayed }?.art + selected.startsWith("sound:") -> s.soundtracks.firstOrNull { "sound:${it.appId}" == selected }?.let { it.hero ?: it.art } selected.startsWith("rom:") -> romFor(s, selected)?.second?.art else -> null } @@ -124,10 +125,12 @@ internal fun Pane( val origins = remember { HashMap() } val paneAt = remember { arrayOf(Offset.Zero) } val livePage by rememberUpdatedState(s.pageKey) - val railContent = if (selected.startsWith("app:")) "games" else selected + val railContent = if (selected.startsWith("app:")) "games" else if (selected.startsWith("sound:")) "soundtracks" else selected val target = if (page != null && s.pageKey != null) s.pageKey else railContent val gameShown = remember { arrayOf("games") } if (selected == "games" || selected.startsWith("app:")) gameShown[0] = selected + val soundShown = remember { arrayOf("soundtracks") } + if (selected == "soundtracks" || selected.startsWith("sound:")) soundShown[0] = selected val before = remember { arrayOf(target) } if (page != null && s.pageKey != null) { pages[s.pageKey] = page @@ -171,7 +174,7 @@ internal fun Pane( label = "pane", ) { key -> val drawn = (if (page != null && key == s.pageKey) page else pages[key]) - ?: { Content(s, if (key == "games") gameShown[0] else key, a, Modifier.fillMaxSize(), onSelect, onAndroidAppClick, onOpenDeveloperOptions, onRequestWirelessAdb, onPairWirelessDebugging) } + ?: { Content(s, if (key == "games") gameShown[0] else if (key == "soundtracks") soundShown[0] else key, a, Modifier.fillMaxSize(), onSelect, onAndroidAppClick, onOpenDeveloperOptions, onRequestWirelessAdb, onPairWirelessDebugging) } val hopSink by androidx.compose.animation.core.animateFloatAsState( if (Hops.sinking == key) 1f else 0f, Motion.tw(260), label = "hopSink", ) @@ -262,7 +265,7 @@ private fun Content( StoresPage(s, a, modifier) return } - if (selected == "games" || selected.startsWith("app:")) { + if (selected == "games" || selected.startsWith("app:") || selected == "soundtracks" || selected.startsWith("sound:")) { LibraryPage(s, a, selected, onSelect, modifier) return } @@ -270,8 +273,16 @@ private fun Content( DesktopPage(s, a, modifier, onSelect) return } + if (selected == NavTabs.MORE) { + MorePage(s, a, onSelect, modifier.padding(horizontal = padH).padding(top = padV)) + return + } + if (selected == "agent") { + AgentPage(modifier.padding(horizontal = padH).padding(top = padV)) + return + } if (selected == "android-apps" && s.isHomeApp) { - AndroidAppsPage(s, modifier, onAndroidAppClick) + AndroidAppsPage(s, a, modifier, onAndroidAppClick) return } Column(modifier = modifier.verticalScroll(rememberScrollState()).padding(horizontal = padH, vertical = padV)) { diff --git a/app/src/main/java/com/droiddeck/launcher/ui/FrontEndRail.kt b/app/src/main/java/com/droiddeck/launcher/ui/FrontEndRail.kt index ecc597c930..5f1b3dfaee 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/FrontEndRail.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/FrontEndRail.kt @@ -47,9 +47,11 @@ import androidx.compose.foundation.relocation.bringIntoViewRequester import androidx.compose.foundation.verticalScroll import androidx.compose.material.icons.Icons import androidx.compose.material.icons.outlined.Apps +import androidx.compose.material.icons.outlined.AutoAwesome import androidx.compose.material.icons.outlined.DesktopWindows import androidx.compose.material.icons.outlined.Layers import androidx.compose.material.icons.outlined.LocalMall +import androidx.compose.material.icons.outlined.MoreHoriz import androidx.compose.material.icons.outlined.SportsEsports import androidx.compose.material.icons.outlined.Storefront import androidx.compose.material.icons.outlined.SystemUpdate @@ -104,13 +106,16 @@ internal fun BottomBar( val bounds = remember { androidx.compose.runtime.mutableStateMapOf() } val tint = androidx.compose.runtime.rememberUpdatedState(LocalPalette.current.signal) val content = remember { arrayOfNulls(1) } + val barContext = LocalContext.current + remember { RailLabels.load(barContext) } + val iconOnly = !RailLabels.shown Row(modifier.fillMaxWidth().background(MaterialTheme.colorScheme.surface), verticalAlignment = Alignment.CenterVertically) { BoxWithConstraints(Modifier.weight(1f)) { val itemWidth = (maxWidth / keys.size).coerceIn(56.dp, 88.dp) Box(Modifier.fillMaxWidth().horizontalScroll(rememberScrollState()).onPlaced { content[0] = it }) { if (shown in keys) ChipGlide(keys.indexOf(shown), bounds[shown], tint, GlideAxis.Horizontal, corner = 14.dp, fill = 0.14f, outline = 0f) Row(Modifier.selectableGroup().padding(vertical = 4.dp), horizontalArrangement = Arrangement.Center) { - NavigationItems(s, shown, compact = true, iconOnly = false, height = 56.dp, width = itemWidth, + NavigationItems(s, shown, compact = true, iconOnly = iconOnly, height = if (iconOnly) 48.dp else 56.dp, width = itemWidth, place = { key -> Modifier.onGloballyPositioned { item -> content[0]?.let { bounds[key] = it.localBoundingBoxOf(item) }; Hops.railBounds[key] = item.boundsInRoot() } }, onSelect = onSelect, onFocusSelect = onFocusSelect) } @@ -120,13 +125,7 @@ internal fun BottomBar( } } -internal fun navigationKeys(s: FrontEndState) = buildList { - add("steam"); add("games") - if (s.gameStoresEnabled) add("stores") - add("desktop"); add("components") - if (s.isHomeApp) add("android-apps") - add("setup"); add("updates") -} +internal fun navigationKeys(s: FrontEndState) = NavTabs.bar(s) internal object RailLabels { var shown by mutableStateOf(true) @@ -156,7 +155,7 @@ internal fun SideRail( horizontalAlignment = Alignment.CenterHorizontally, modifier = modifier.width(if (iconOnly) 64.dp else 92.dp).background(colors.surface).padding(vertical = if (compact) 8.dp else 12.dp), ) { - val count = 6 + (if (s.gameStoresEnabled) 1 else 0) + (if (s.isHomeApp) 1 else 0) + val count = navigationKeys(s).size BoxWithConstraints(Modifier.weight(1f).fillMaxWidth()) { val fit = (maxHeight / count - 4.dp).coerceIn(44.dp, if (iconOnly) 48.dp else if (compact) 52.dp else 60.dp) val shown = Hops.railPreview ?: selected @@ -194,17 +193,33 @@ internal fun SideRail( internal fun railLabelIcon(key: String): Pair = when (key) { "steam" -> R.string.rail_steam to Icons.Outlined.SportsEsports "games" -> R.string.rail_games to Icons.Outlined.VideoLibrary + "soundtracks" -> R.string.rail_music to SoundtrackIcon "stores" -> R.string.rail_stores to Icons.Outlined.LocalMall "desktop" -> R.string.rail_desktop to Icons.Outlined.DesktopWindows "components" -> R.string.rail_components to Icons.Outlined.Layers + "agent" -> R.string.rail_agent to Icons.Outlined.AutoAwesome "android-apps" -> R.string.rail_apps to Icons.Outlined.Apps "setup" -> R.string.rail_setup to Icons.Outlined.Tune + NavTabs.MORE -> R.string.rail_more to Icons.Outlined.MoreHoriz else -> R.string.rail_updates to Icons.Outlined.SystemUpdate } internal fun setupNeedsAttention(s: FrontEndState): Boolean = !s.ready || (s.available != null && s.available != s.installed) || PhantomProcessLimit.blocksSteam(s.phantomProcessStatus) || com.droiddeck.launcher.sync.Syncthing.needsAttention +internal fun railBadge(s: FrontEndState, key: String, setupNeedsAttention: Boolean = setupNeedsAttention(s)): Boolean = when (key) { + "setup" -> setupNeedsAttention + "updates" -> s.updates.hasUpdate + NavTabs.MORE -> NavTabs.more(s).any { it != NavTabs.MORE && railBadge(s, it, setupNeedsAttention) } + else -> false +} + +internal fun railCount(s: FrontEndState, key: String): Int = when (key) { + "stores" -> s.storeDownloadsActive + NavTabs.MORE -> if ("stores" in NavTabs.more(s)) s.storeDownloadsActive else 0 + else -> 0 +} + @Composable private fun NavigationItems( s: FrontEndState, shown: String, compact: Boolean, iconOnly: Boolean, height: Dp, width: Dp, @@ -215,8 +230,8 @@ private fun NavigationItems( val (label, icon) = railLabelIcon(key) key(key) { RailItem(stringResource(label), icon, key, shown == key, compact, iconOnly, height, width, - badge = (key == "setup" && setupNeedsAttention) || (key == "updates" && s.updates.hasUpdate), - count = if (key == "stores") s.storeDownloadsActive else 0, + badge = railBadge(s, key, setupNeedsAttention), + count = railCount(s, key), place = place, onFocus = { onFocusSelect(key) }) { onSelect(key) } } } diff --git a/app/src/main/java/com/droiddeck/launcher/ui/FrontEndScreen.kt b/app/src/main/java/com/droiddeck/launcher/ui/FrontEndScreen.kt index 31a8fb28c8..c936d13c74 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/FrontEndScreen.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/FrontEndScreen.kt @@ -40,6 +40,8 @@ import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.ime +import androidx.compose.foundation.layout.imePadding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.systemBars import androidx.compose.foundation.layout.width @@ -108,6 +110,7 @@ class FrontEndState( val vacDiagnostics: Boolean = false, val agentCommands: Boolean = false, val graphicsLogs: Boolean = false, + val buildWatermark: Boolean = true, val steamGpuDrawing: Boolean = false, val bridgeFellBack: Boolean = false, val bridgeFellBackMemory: Boolean = false, @@ -168,6 +171,7 @@ class FrontEndState( val showPhantomGate: Boolean = false, val orientation: Int = android.content.pm.ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE, val launcherOrientation: Int = android.content.pm.ActivityInfo.SCREEN_ORIENTATION_USER, + val homePage: String = com.droiddeck.launcher.core.AppUiPrefs.HOME_PAGE_STEAM, val launcherFullscreen: Boolean = true, val downloadSource: String = DownloadSource.MODE_AUTO, val downloadMirror: String = "", @@ -177,6 +181,10 @@ class FrontEndState( val lowStorageWarning: Boolean = true, val launcherIcon: String = com.droiddeck.launcher.LauncherIcon.DARK, val gameStoresEnabled: Boolean = true, + val soundtracksEnabled: Boolean = true, + val soundtracksIngame: Boolean = false, + val soundtracks: List = emptyList(), + val soundtracksLoaded: Boolean = true, val gameStoresSpeedTier: String = "fast", val navigate: String? = null, val addedGamesArt: Boolean = true, @@ -247,6 +255,7 @@ class FrontEndActions( val onVacDiagnostics: () -> Unit = {}, val onAgentCommands: () -> Unit = {}, val onGraphicsLogs: () -> Unit = {}, + val onBuildWatermark: () -> Unit = {}, val onSteamGpuDrawing: () -> Unit = {}, val onClearCachedApps: (Boolean) -> Unit = {}, val onMemoryHud: (String) -> Unit = {}, @@ -267,6 +276,7 @@ class FrontEndActions( val onLauncherIcon: (String) -> Unit = {}, val onOrientation: (Int) -> Unit = {}, val onLauncherOrientation: (Int) -> Unit = {}, + val onHomePage: (String) -> Unit = {}, val onLauncherFullscreen: (Boolean) -> Unit = {}, val onAnimationsEnabled: (Boolean) -> Unit = {}, val onLowStorageWarning: (Boolean) -> Unit = {}, @@ -279,6 +289,11 @@ class FrontEndActions( val onDownloadPrefix: (String) -> Unit = {}, val onDownloadProxy: (String) -> Unit = {}, val onGameStoresEnabled: (Boolean) -> Unit = {}, + val onSoundtracksEnabled: (Boolean) -> Unit = {}, + val onSoundtracksIngame: (Boolean) -> Unit = {}, + val onSoundtrackAdded: (java.io.File) -> Unit = {}, + val onSoundtracksChanged: () -> Unit = {}, + val onSoundtrackRemoved: (Library.SteamGame) -> Unit = {}, val onGameStoresSpeedTier: (String) -> Unit = {}, val onNavigated: () -> Unit = {}, val onStoresShowMature: (Boolean) -> Unit = {}, @@ -287,6 +302,7 @@ class FrontEndActions( val onLibraryChanged: () -> Unit = {}, val onHomeApp: () -> Unit = {}, val onHomeScreen: (Boolean) -> Unit = {}, + val onAppIconsChanged: () -> Unit = {}, val onSteamIntegration: (com.droiddeck.launcher.core.SteamIntegration.Feature?) -> Unit = {}, val onDismissIntegration: () -> Unit = {}, val onIntegration: (com.droiddeck.launcher.core.SteamIntegration.Feature) -> Unit = {}, @@ -452,7 +468,9 @@ fun FrontEndScreen(s: FrontEndState, a: FrontEndActions, page: (@Composable () - @OptIn(ExperimentalComposeUiApi::class) @Composable private fun FrontEndScreenBody(s: FrontEndState, a: FrontEndActions, page: (@Composable () -> Unit)?, frontFocus: FrontFocus) { - var selected by rememberSaveable { mutableStateOf(if (s.shortcutPicker) "games" else "steam") } + var selected by rememberSaveable { + mutableStateOf(if (s.shortcutPicker) "games" else if (NavTabs.place(s, "steam") == TabPlace.HIDDEN) navigationKeys(s).first { it != "components" } else "steam") + } LaunchedEffect(s.shortcutPicker) { if (s.shortcutPicker) selected = "games" } LaunchedEffect(s.navigate) { val target = s.navigate ?: return@LaunchedEffect @@ -462,6 +480,14 @@ private fun FrontEndScreenBody(s: FrontEndState, a: FrontEndActions, page: (@Com "setup:launcher" -> { SetupTabs.openLauncher = true; selected = "setup" } com.droiddeck.launcher.sync.SyncthingService.NAV -> com.droiddeck.launcher.sync.Syncthing.requestOpen() "setup:integration" -> { SetupTabs.openOverview = true; selected = "setup" } + com.droiddeck.launcher.core.AppUiPrefs.HOME_PAGE_APPS -> { + // Home lands on the apps page itself, so a page open over the rail (Components, Performance) closes first. + if (s.pageKey != null) a.onPageBack() + Hops.origin = null + Hops.restore = null + Hops.sinking = null + selected = target + } else -> selected = target } a.onNavigated() @@ -551,20 +577,32 @@ private fun FrontEndScreenBody(s: FrontEndState, a: FrontEndActions, page: (@Com ) { selected = if (selected.startsWith("rom:")) "emu:" + selected.removePrefix("rom:").substringBefore(':') else "desktop" } + val backToMore = s.pageKey == null && Hops.origin == null && selected in NavTabs.more(s) + BackHandler(enabled = !processSettingsPageVisible && backToMore) { + selected = NavTabs.MORE + } LaunchedEffect(s.isHomeApp) { if (!s.isHomeApp && selected == "android-apps") selected = "steam" } - LaunchedEffect(s.steamGames.isEmpty()) { - if (s.steamGames.isEmpty() && selected.startsWith("app:") && GameRef.parse(selected).appId != null) selected = "games" + LaunchedEffect(s.soundtracksEnabled) { + if (!s.soundtracksEnabled && (selected == "soundtracks" || selected.startsWith("sound:"))) selected = "games" + } + LaunchedEffect(s.steamGames.isEmpty(), s.soundtracks, s.soundtracksLoaded) { + if (s.steamGames.isEmpty() && selected.startsWith("app:")) { + val id = GameRef.parse(selected).appId + if (id != null && s.soundtracks.none { it.appId == id } && s.soundtracksLoaded) selected = "games" + } } remember { Motion.refresh(ctx); true } - val railSelection = when { + val openTab = when { Hops.origin != null && s.pageKey == Hops.origin?.page -> Hops.origin!!.dest s.pageKey == "performance" -> "steam" s.pageKey == "controller-mapping" -> "setup" selected.startsWith("app:") -> "games" + selected.startsWith("sound:") -> "soundtracks" selected.startsWith("emu:") || selected.startsWith("rom:") || selected.startsWith("user:") || selected == "store" -> "desktop" else -> s.pageKey ?: selected } + val railSelection = if (openTab in NavTabs.more(s)) NavTabs.MORE else openTab val railSelectionNow = androidx.compose.runtime.rememberUpdatedState(railSelection) var railPicks by remember { mutableStateOf(0) } val showRailPage: (String, Boolean) -> Unit = { key, focusContent -> @@ -673,23 +711,25 @@ private fun FrontEndScreenBody(s: FrontEndState, a: FrontEndActions, page: (@Com val r = Hops.restore ?: return@LaunchedEffect if (r.surface == HOP_SURFACE_SHEET) return@LaunchedEffect Hops.restore = null - if (r.rail != selected && !(r.rail == "games" && selected.startsWith("app:"))) selected = r.rail + if (r.rail != selected && !(r.rail == "games" && selected.startsWith("app:")) && !(r.rail == "soundtracks" && selected.startsWith("sound:"))) selected = r.rail kotlinx.coroutines.delay(Motion.ms(PAGE_EXIT_MS).toLong()) if (inputModeManager.inputMode != InputMode.Keyboard) return@LaunchedEffect frontFocus.last = r.control focusWithinFrames({ frontFocus.last == r.control && anyFocused }) { frontFocus.items[r.control] ?: frontFocus.paneEntry() } } var screenAt by remember { mutableStateOf(Offset.Zero) } - if (s.dualScreen) DualPanelPublisher(s, railSelection, { key -> + if (s.dualScreen) DualPanelPublisher(s, railSelection, openTab, { key -> if (processSettingsPageVisible) return@DualPanelPublisher if (inputModeManager.inputMode != InputMode.Keyboard) inputModeManager.requestInputMode(InputMode.Keyboard) focusManager.clearFocus(force = true) onRailSelect(key) }, a) CompositionLocalProvider(LocalShowSection provides { key -> selected = key }) { + val agentKeyboardOpen = railSelection == "agent" && WindowInsets.ime.getBottom(androidx.compose.ui.platform.LocalDensity.current) > 0 LauncherLayout( bottomNavigation && !s.dualScreen, pal.line, Modifier.fillMaxSize().onGloballyPositioned { screenAt = it.positionInRoot() } + .then(if (railSelection == "agent") Modifier.imePadding() else Modifier) .then(if (s.dualScreen) Modifier.onKeyEvent { event -> val step = dualPageStep(event.nativeKeyEvent) ?: return@onKeyEvent false if (event.type == KeyEventType.KeyDown && !processSettingsPageVisible) { @@ -703,7 +743,7 @@ private fun FrontEndScreenBody(s: FrontEndState, a: FrontEndActions, page: (@Com true } else Modifier), navigation = { - if (s.dualScreen) Unit + if (s.dualScreen || (bottomNavigation && agentKeyboardOpen)) Unit else if (bottomNavigation) BottomBar(s, railSelection, onRailSelect, onRailFocus, a, railFocus) else SideRail(s, railSelection, onRailSelect, onRailFocus, a, railFocus.fillMaxHeight()) }, @@ -801,7 +841,7 @@ private fun FrontEndScreenBody(s: FrontEndState, a: FrontEndActions, page: (@Com ) } } - val hasBackTarget = (s.pageKey != null && page != null) || + val hasBackTarget = backToMore || (s.pageKey != null && page != null) || (s.pageKey == null && Hops.origin?.page == selected) || ((s.pageKey == null || page == null) && (selected.startsWith("emu:") || selected.startsWith("rom:") || selected.startsWith("user:") || selected == "store")) diff --git a/app/src/main/java/com/droiddeck/launcher/ui/FrontEndSetup.kt b/app/src/main/java/com/droiddeck/launcher/ui/FrontEndSetup.kt index 3532d3e771..6ae4c38762 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/FrontEndSetup.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/FrontEndSetup.kt @@ -84,20 +84,21 @@ import com.droiddeck.launcher.stores.download.StoreDownloadTier import com.droiddeck.launcher.R -private enum class CheckState { OK, WARN, BUSY } +internal enum class CheckState { OK, WARN, BUSY } private const val STORAGE_TAB = 3 private const val LAUNCHER_TAB = 2 internal object SetupTabs { var openLauncher = false + var focusTabs = false var openOverview = false } private const val GLASSES_TAB = 6 private const val SYNC_TAB = 4 @Composable -private fun CheckRow(state: CheckState, title: String, detail: String?, divider: Boolean = true, action: (@Composable () -> Unit)? = null) { +internal fun CheckRow(state: CheckState, title: String, detail: String?, divider: Boolean = true, action: (@Composable () -> Unit)? = null) { val colors = MaterialTheme.colorScheme val pal = LocalPalette.current val tint = when (state) { @@ -146,6 +147,7 @@ internal fun SetupPanel( ) { val host = rememberMenuHost() val ctx = LocalContext.current + var hideHomeFromRecents by remember { mutableStateOf(com.droiddeck.launcher.core.AppUiPrefs.hideHomeFromRecents(ctx)) } var processLimitBusy by remember { mutableStateOf(false) } var processLimitMessage by remember { mutableStateOf(null) } val setProcessLimit: (Boolean) -> Unit = { enabled -> @@ -456,8 +458,9 @@ internal fun SetupPanel( remember { RailLabels.load(railContext) } ToggleRow(host, "rail-labels", stringResource(R.string.setup_rail_labels), stringResource(R.string.setup_rail_labels_hint), RailLabels.shown) { RailLabels.set(railContext, it) } LanguageRow(host, s.language, a.onLanguage) - ToggleRow(host, "show-stores", stringResource(R.string.setup_stores), null, s.gameStoresEnabled, onChange = a.onGameStoresEnabled) + if (s.soundtracksEnabled) ToggleRow(host, "soundtracks-ingame", stringResource(R.string.setup_soundtracks_ingame), stringResource(R.string.setup_soundtracks_ingame_hint), s.soundtracksIngame, onChange = a.onSoundtracksIngame) } + TabsSettingsGroup(host, s, a) } val device: @Composable () -> Unit = { SettingsGroup(stringResource(R.string.setup_group_device)) { @@ -468,6 +471,18 @@ internal fun SetupPanel( ) { a.onHomeScreen(it) } if (s.homeScreenEnabled) { ActionRow(stringResource(R.string.setup_default_home), s.defaultHomeLabel ?: stringResource(R.string.setup_choose_home), stringResource(R.string.setup_choose), a.onHomeApp) + ToggleRow( + host, "hide-home-from-recents", stringResource(R.string.setup_hide_home_from_recents), + stringResource(R.string.setup_hide_home_from_recents_hint), hideHomeFromRecents, + ) { hidden -> + hideHomeFromRecents = hidden + com.droiddeck.launcher.core.AppUiPrefs.setHideHomeFromRecents(ctx, hidden) + } + ChoiceRow( + host, "home-page", stringResource(R.string.setup_home_page), stringResource(R.string.setup_home_page_hint), + com.droiddeck.launcher.core.AppUiPrefs.homePageOptions.map { (value, label) -> value to stringResource(label) }, + s.homePage, onPick = a.onHomePage, + ) } ChoiceRow( host, "launcher-orientation", stringResource(R.string.setup_launcher_orientation), null, @@ -589,6 +604,16 @@ internal fun SetupPanel( ) { a.onGameDebugLogs() } ToggleRow(host, "vacdiag", stringResource(R.string.setup_vac_diag), stringResource(R.string.setup_vac_diag_hint), s.vacDiagnostics) { a.onVacDiagnostics() } ToggleRow(host, "agent-commands", stringResource(R.string.setup_agent_commands), null, s.agentCommands) { a.onAgentCommands() } + if (com.droiddeck.launcher.agent.AgentHost.available) { + val agentContext = androidx.compose.ui.platform.LocalContext.current + ToggleRow(host, "agent-pet", stringResource(R.string.setup_agent_pet), stringResource(R.string.setup_agent_pet_hint), AgentPet.enabled) { + AgentPet.set(agentContext, it) + } + if (AgentPet.enabled && !AgentPet.allowed) ActionRow( + stringResource(R.string.setup_agent_pet_float), stringResource(R.string.setup_agent_pet_float_hint), + stringResource(R.string.setup_agent_pet_allow), onClick = { AgentPet.requestFloating(agentContext) }, + ) + } ToggleRow(host, "graphics-logs", stringResource(R.string.setup_graphics_logs), stringResource(R.string.setup_graphics_logs_hint), s.graphicsLogs) { a.onGraphicsLogs() } if (!s.adreno && com.droiddeck.launcher.session.SessionPrefs.steamGpuCompositingAllowed()) ToggleRow(host, "steam-gpu-drawing", stringResource(R.string.setup_steam_gpu_drawing), stringResource(R.string.setup_steam_gpu_drawing_hint), s.steamGpuDrawing) { a.onSteamGpuDrawing() } ActionRow(stringResource(R.string.setup_latest_logs), stringResource(R.string.drawer_logs_hint), stringResource(R.string.drawer_share_logs), a.onShareLogs, @@ -690,10 +715,12 @@ internal fun SetupPanel( } @Composable -private fun ReadinessCard(passing: Int, total: Int, line: String, open: Boolean, onDetails: () -> Unit, checks: @Composable () -> Unit) { +internal fun ReadinessCard( + passing: Int, total: Int, line: String, open: Boolean, onDetails: () -> Unit, title: String? = null, ready: Boolean = passing == total, + checks: @Composable () -> Unit, +) { val colors = MaterialTheme.colorScheme val pal = LocalPalette.current - val ready = passing == total Column(Modifier.fillMaxWidth().padding(top = 8.dp).clip(Shape14).background(colors.surface).border(1.dp, pal.line, Shape14)) { Row( verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(14.dp), @@ -709,7 +736,7 @@ private fun ReadinessCard(passing: Int, total: Int, line: String, open: Boolean, } Column(Modifier.weight(1f)) { Text( - stringResource(if (ready) R.string.setup_ready else R.string.setup_not_ready), + title ?: stringResource(if (ready) R.string.setup_ready else R.string.setup_not_ready), fontSize = 17.sp, fontWeight = FontWeight.Bold, color = colors.onBackground, ) if (line.isNotEmpty()) Text(line, fontSize = 13.sp, color = colors.onSurfaceVariant, maxLines = 2, overflow = TextOverflow.Ellipsis) @@ -737,6 +764,17 @@ internal fun LaunchSettings(s: FrontEndState, a: FrontEndActions, host: MenuHost val context = androidx.compose.ui.platform.LocalContext.current val inputMode = androidx.compose.ui.platform.LocalInputModeManager.current val wincompKey = game?.takeIf { it.library == com.droiddeck.launcher.frontend.Library.ADDED || it.appId > 0 }?.profileKey + val frameGenProfileKey = game?.profileKey?.takeIf { it.isNotBlank() } + var gameFrameGenMode by remember(frameGenProfileKey) { + mutableStateOf(frameGenProfileKey?.let { + com.droiddeck.launcher.gpu.FrameGen.mode(context, it) + } ?: s.frameGen) + } + var gameFrameGenOverride by remember(frameGenProfileKey) { + mutableStateOf(frameGenProfileKey?.let { + com.droiddeck.launcher.gpu.FrameGen.hasGameOverride(context, it) + } ?: false) + } var wincompOpen by remember(wincompKey) { mutableStateOf(null) } val wincompPicks = remember(wincompKey, wincompOpen) { wincompKey?.let { com.droiddeck.launcher.session.WinComponents.picks(context, it) }.orEmpty() } val steamScope = game?.let { com.droiddeck.launcher.session.NoSteamLaunch.scope(it) } @@ -755,10 +793,42 @@ internal fun LaunchSettings(s: FrontEndState, a: FrontEndActions, host: MenuHost } add { m -> Box(m) { - SettingCard(stringResource(R.string.frame_gen_title), s.frameGenLabel, "card:fg", Modifier.fillMaxSize()) { + SettingCard( + stringResource(R.string.frame_gen_title), + if (frameGenProfileKey != null) + com.droiddeck.launcher.gpu.FrameGen.label(context, gameFrameGenMode) + else s.frameGenLabel, + "card:fg", Modifier.fillMaxSize() + ) { host.open = if (host.open == "fg") null else "fg" } - FrameGenMenu(s, a, host) + FrameGenMenu( + host = host, + mode = if (frameGenProfileKey != null) gameFrameGenMode else s.frameGen, + lossless = s.lossless, + onPick = { mode -> + val key = frameGenProfileKey + if (key == null) { + a.onFrameGenPick(mode) + } else { + com.droiddeck.launcher.gpu.FrameGen.setForGame(context, key, mode) + gameFrameGenMode = mode + gameFrameGenOverride = true + } + }, + onImportLossless = a.onImportLossless, + gameProfileId = frameGenProfileKey, + hasGameOverride = gameFrameGenOverride, + onResetGame = { + val key = frameGenProfileKey + if (key != null) { + com.droiddeck.launcher.gpu.FrameGen.clearGame(context, key) + gameFrameGenMode = + com.droiddeck.launcher.gpu.FrameGen.mode(context) + gameFrameGenOverride = false + } + } + ) } } if (controller != null) add { m -> SettingCard(stringResource(R.string.setup_card_controls), stringResource(R.string.setup_card_controls_hint), "card:controls", m, controller.onMapping) } @@ -855,12 +925,37 @@ internal fun GameSettingsMenus(host: MenuHost, game: com.droiddeck.launcher.fron val custom = stringResource(R.string.comp_game_fex_custom) val customSync = stringResource(R.string.game_sync_custom) val resetDone = stringResource(R.string.comp_game_reset_done, game.name) + val resKey = "game-settings-res" + val resolution = current?.let { com.droiddeck.launcher.core.GameEnvironment.gameResolution(it, scope) } + val screen = remember { com.droiddeck.launcher.session.SessionDisplay.screenSize(com.droiddeck.launcher.session.SessionDisplay.panelSize(appContext)) } + val matchScreen = stringResource(R.string.display_match_screen, screen.first, screen.second) + val scaledLabels = com.droiddeck.launcher.core.GameResolution.scales.associateWith { + stringResource(R.string.display_follow_screen_scaled, com.droiddeck.launcher.core.GameResolution.formatScale(it)) + } + fun sizeLabel(size: Pair) = "${size.first}ร—${size.second} ยท ${com.droiddeck.launcher.core.GameResolution.aspectLabel(size.first, size.second)}" + fun resolutionLabel(choice: com.droiddeck.launcher.core.GameResolution.Choice?): String = when (choice) { + null -> matchScreen + is com.droiddeck.launcher.core.GameResolution.Scaled -> (scaledLabels[choice.scale] + ?: "รท" + com.droiddeck.launcher.core.GameResolution.formatScale(choice.scale)) + + " ยท " + sizeLabel(com.droiddeck.launcher.core.GameResolution.resolve(choice, screen)) + is com.droiddeck.launcher.core.GameResolution.Fixed -> sizeLabel(choice.width to choice.height) + } + fun pickResolution(choice: com.droiddeck.launcher.core.GameResolution.Choice?) { + host.open = key + save { com.droiddeck.launcher.session.GameEnvironmentStore.setGameResolution(it, scope, choice) } + } + var editResolution by remember(scope) { mutableStateOf(false) } AnchoredMenu(host.open == key, onDismiss = { if (host.open == key) host.open = null }, title = stringResource(R.string.game_settings_menu_title, game.name)) { first -> MenuItem(stringResource(R.string.game_no_steam_title), checked = noSteam, enabled = ready, detail = stringResource(R.string.game_no_steam_detail), focusRequester = first) { val on = !noSteam save { com.droiddeck.launcher.session.GameEnvironmentStore.setGameNoSteam(it, scope, on) } } + if (noSteam) MenuItem( + stringResource(R.string.game_res_title), checked = false, enabled = ready, + detail = resolutionLabel(resolution), + trailing = { Text("โ€บ", fontSize = 16.sp, color = colors.onSurfaceVariant) }, + ) { host.open = resKey } if (!launcher) { val chosen = com.droiddeck.launcher.core.FexPreset.all.firstOrNull { it.id == fex } MenuItem( @@ -897,6 +992,45 @@ internal fun GameSettingsMenus(host: MenuHost, game: com.droiddeck.launcher.fron } } } + AnchoredMenu(host.open == resKey, onDismiss = { if (host.open == resKey) host.open = null }, title = stringResource(R.string.game_res_title)) { first -> + MenuItem(matchScreen, checked = resolution == null, enabled = ready, focusRequester = first) { pickResolution(null) } + com.droiddeck.launcher.core.GameResolution.scales.forEach { scale -> + val choice = com.droiddeck.launcher.core.GameResolution.Scaled(scale) + MenuItem(scaledLabels.getValue(scale), checked = resolution == choice, enabled = ready, + detail = sizeLabel(com.droiddeck.launcher.core.GameResolution.resolve(choice, screen))) { pickResolution(choice) } + } + com.droiddeck.launcher.core.GameResolution.aspects.forEach { aspect -> + val sizes = com.droiddeck.launcher.core.GameResolution.sizesFor(aspect, screen) + MenuItem(aspect.label, checked = resolution in aspect.sizes, enabled = ready, + detail = sizes.joinToString(" ยท ") { "${it.width}ร—${it.height}" }, + trailing = { Text("โ€บ", fontSize = 16.sp, color = colors.onSurfaceVariant) }, + ) { host.open = "$resKey-${aspect.label}" } + } + val fixed = resolution as? com.droiddeck.launcher.core.GameResolution.Fixed + val customValue = fixed?.takeIf { f -> com.droiddeck.launcher.core.GameResolution.aspects.none { f in it.sizes } } + MenuItem( + if (customValue == null) stringResource(R.string.mode_res_custom) else stringResource(R.string.mode_res_custom_value, customValue.width, customValue.height), + checked = customValue != null, enabled = ready, + detail = customValue?.let { com.droiddeck.launcher.core.GameResolution.aspectLabel(it.width, it.height) }, + ) { editResolution = true } + } + com.droiddeck.launcher.core.GameResolution.aspects.forEach { aspect -> + val aspectKey = "$resKey-${aspect.label}" + AnchoredMenu(host.open == aspectKey, onDismiss = { if (host.open == aspectKey) host.open = null }, title = aspect.label) { first -> + com.droiddeck.launcher.core.GameResolution.sizesFor(aspect, screen).forEachIndexed { index, size -> + MenuItem("${size.width}ร—${size.height}", checked = resolution == size, enabled = ready, + focusRequester = if (index == 0) first else null) { pickResolution(size) } + } + } + } + if (editResolution) CustomResolutionDialog( + (resolution as? com.droiddeck.launcher.core.GameResolution.Fixed)?.let { it.width to it.height }, + onSave = { value -> + editResolution = false + pickResolution(com.droiddeck.launcher.core.GameResolution.Fixed(value.first, value.second)) + }, + onDismiss = { editResolution = false }, + ) AnchoredMenu(host.open == fexKey, onDismiss = { if (host.open == fexKey) host.open = null }, title = stringResource(R.string.fex_preset_title)) { first -> MenuItem(useDefault, checked = fex == null, enabled = ready, detail = stringResource(generalFex.label), focusRequester = first) { host.open = key diff --git a/app/src/main/java/com/droiddeck/launcher/ui/GameDetail.kt b/app/src/main/java/com/droiddeck/launcher/ui/GameDetail.kt index 808c944858..d692af4f2e 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/GameDetail.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/GameDetail.kt @@ -35,6 +35,8 @@ import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.verticalScroll import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.filled.Favorite +import androidx.compose.material.icons.filled.FavoriteBorder import androidx.compose.material.icons.filled.PlayArrow import androidx.compose.material.icons.outlined.Delete import androidx.compose.material.icons.outlined.Edit @@ -148,7 +150,7 @@ internal fun GameDetail( val narrow = LocalNarrowPane.current val stacked = narrow || LocalConfiguration.current.screenWidthDp < 700 val ref = remember(key) { GameRef.parse(key) } - val games = s.steamGames + rememberXboxCloudRows(s) + val games = s.steamGames + rememberXboxCloudRows(s) + if (s.soundtracksEnabled) emptyList() else s.soundtracks val found = ref.game(games) val known = remember(key) { arrayOfNulls>(1) } val store = ref.store ?: Store.byId(found?.source) ?: known[0]?.first @@ -165,6 +167,7 @@ internal fun GameDetail( if (nothing) return val source = game?.source ?: store?.id ?: Library.SOURCE_STEAM val title = game?.name ?: item?.title ?: installed?.sidecar?.title ?: id.orEmpty() + val favoriteKey = if (store != null && id != null) "${store.id}:$id" else game?.let { GameRef.key(it) } ?: key val scores = if (source != Library.ADDED) rememberGameScores(title.takeIf { it.isNotBlank() && it != id }) else null val achievements = remember(store, id, item?.accessible, installed) { when { @@ -225,6 +228,7 @@ internal fun GameDetail( Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) { if (installed != null && installed.sidecar.store == Store.ITCH) ItchCheckButton(installed) if (installed != null && installed.sidecar.store == Store.GAMEJOLT) GameJoltCheckButton(installed) + FavoriteButton(favoriteKey) RemoveButton(title, game, installed, a) } } @@ -280,7 +284,7 @@ internal fun GameDetail( } @Composable -private fun SourceBadge(source: String) { +internal fun SourceBadge(source: String) { val c = sourceColours(source) Row( verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(7.dp), @@ -309,7 +313,7 @@ private fun GameStatusLine(source: String, game: Library.SteamGame?, item: Catal item?.accessible == true -> listOf(stringResource(R.string.stores_eyebrow_library)) else -> listOf(stringResource(R.string.stores_eyebrow_store)) } - val size = if (folder != null && (installed != null || game != null)) diskSize(installed, folder) else (item?.sizeBytes ?: 0L).takeIf { it > 0 } + val size = if (folder != null && (installed != null || game != null)) diskSize(installed, folder) else catalogSize(item).takeIf { it > 0 } val line = (state + listOfNotNull(size?.let { formatBytes(it) })).filter { it.isNotBlank() }.joinToString(" ยท ").replaceFirstChar { it.uppercase() } val muted = colors.onBackground.copy(alpha = 0.78f) Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(10.dp)) { @@ -399,6 +403,7 @@ internal fun GameActions( val download = rawDownload?.takeIf { it.isActive } val failed = rawDownload?.takeIf { it.state == DownloadState.FAILED } val cloud = game?.library == Library.XBOX_CLOUD && installed == null + val downloadBytes = catalogSize(item) Actions { when { s.shortcutPicker && game != null -> { @@ -430,6 +435,7 @@ internal fun GameActions( openUrl(ctx, item?.storeUrl.orEmpty().ifBlank { GameJoltApi.pageUrl("game", installed.sidecar.id) }) } } + if (store == Store.EA && installed != null) EaUpdateButton(installed, download == null && StoresState.uninstalling[installed.key] == null) if (store == Store.GOG && installed != null) GogMaintenanceActions(installed) if (store == Store.XBOX && id != null) XboxInstalledStream(id, game?.name ?: item?.title.orEmpty(), item) if (store == Store.XBOX && installed != null && id != null) { @@ -473,7 +479,7 @@ internal fun GameActions( if (item?.installable == true && item.xboxPc) { SecondaryButton( if (StoresState.isUnfinished(item)) stringResource(R.string.stores_resume_install) - else if (item.sizeBytes > 0) stringResource(R.string.stores_install_size, formatBytes(item.sizeBytes)) + else if (downloadBytes > 0) stringResource(R.string.stores_install_size, formatBytes(downloadBytes)) else stringResource(R.string.stores_install), ) { StoresState.requestInstall(ctx, item) } } @@ -491,7 +497,7 @@ internal fun GameActions( } item?.installable == true -> { InstallButton( - if (item.sizeBytes > 0) stringResource(R.string.stores_install_size, formatBytes(item.sizeBytes)) else stringResource(R.string.stores_install), + if (downloadBytes > 0) stringResource(R.string.stores_install_size, formatBytes(downloadBytes)) else stringResource(R.string.stores_install), leadOn, ) { StoresState.requestInstall(ctx, item) } if (store == Store.XBOX && item.xboxCloud) { @@ -504,7 +510,12 @@ internal fun GameActions( InstallButton(stringResource(R.string.stores_install), leadOn) { StoresState.requestInstall(ctx, item) } SecondaryButton(stringResource(R.string.stores_view_on, item.store.shortLabel)) { openStoreUrl(ctx, item) } } - item != null && item.isFree -> PrimaryButton(stringResource(R.string.stores_get_free), main = true, modifier = leadOn) { openStoreUrl(ctx, item) } + item != null && item.isFree -> { + val adding = StoresState.claiming[item.key] == true + PrimaryButton(stringResource(if (adding) R.string.stores_claiming else R.string.stores_get_free), enabled = !adding, main = true, modifier = leadOn) { + if (StoresState.canClaim(item)) StoresState.claim(ctx, item) { openStoreUrl(ctx, item) } else openStoreUrl(ctx, item) + } + } item != null -> PrimaryButton(buyLabel(item), main = true, modifier = leadOn) { openStoreUrl(ctx, item) } } if (cloud && (download != null || failed != null)) { @@ -567,13 +578,13 @@ private fun buyLabel(item: CatalogItem): String = when { } @Composable -private fun FileButtons(game: Library.SteamGame, a: FrontEndActions) { +internal fun FileButtons(game: Library.SteamGame, a: FrontEndActions) { game.gameFiles?.takeIf { it.isDirectory }?.let { dir -> SecondaryButton(stringResource(R.string.games_files), compact = true) { a.onBrowseFiles(dir) } } game.protonPrefix?.takeIf { it.isDirectory }?.let { dir -> SecondaryButton(stringResource(R.string.games_prefix), compact = true) { a.onBrowseFiles(dir) } } } @Composable -private fun GameShortcutMenu(g: Library.SteamGame, a: FrontEndActions) { +internal fun GameShortcutMenu(g: Library.SteamGame, a: FrontEndActions) { var open by remember(g.gameId) { mutableStateOf(false) } Box { SecondaryButton(stringResource(R.string.game_shortcut), compact = true) { open = !open } @@ -586,7 +597,7 @@ private fun GameShortcutMenu(g: Library.SteamGame, a: FrontEndActions) { } @Composable -private fun rememberEditArt(g: Library.SteamGame): (() -> Unit)? { +internal fun rememberEditArt(g: Library.SteamGame): (() -> Unit)? { val ctx = LocalContext.current val folder = g.gameFiles return when { @@ -600,7 +611,7 @@ private fun rememberEditArt(g: Library.SteamGame): (() -> Unit)? { } @Composable -private fun EditArtButton(g: Library.SteamGame) { +internal fun EditArtButton(g: Library.SteamGame) { val open = rememberEditArt(g) ?: return IconAction(Icons.Outlined.Edit, stringResource(R.string.game_edit_art), "game:edit", onClick = open) } @@ -625,7 +636,7 @@ private fun GameMoreMenu(g: Library.SteamGame, a: FrontEndActions) { } @Composable -internal fun IconAction(icon: androidx.compose.ui.graphics.vector.ImageVector, label: String, id: String, danger: Boolean = false, enabled: Boolean = true, frosted: Boolean = false, onClick: () -> Unit) { +internal fun IconAction(icon: androidx.compose.ui.graphics.vector.ImageVector, label: String, id: String, danger: Boolean = false, enabled: Boolean = true, frosted: Boolean = false, tint: Color? = null, onClick: () -> Unit) { val colors = MaterialTheme.colorScheme val pill = LocalPillButtons.current val shape = if (pill) CircleShape else Shape12 @@ -650,14 +661,26 @@ internal fun IconAction(icon: androidx.compose.ui.graphics.vector.ImageVector, l .controllerConfirm(enabled = enabled, onClick = onClick) .semantics { contentDescription = label }, ) { - Icon(icon, contentDescription = null, tint = if (danger && hot) colors.error else if (danger && !pill) Color.White else colors.onBackground, modifier = Modifier.size(18.dp)) + Icon(icon, contentDescription = null, tint = tint ?: if (danger && hot) colors.error else if (danger && !pill) Color.White else colors.onBackground, modifier = Modifier.size(18.dp)) } } if (frosted) Box(Modifier.glass(CircleShape)) { button() } else button() } @Composable -private fun RemoveButton(title: String, game: Library.SteamGame?, installed: InstalledStoreGame?, a: FrontEndActions) { +internal fun FavoriteButton(key: String) { + val ctx = LocalContext.current + remember { LibraryFavorites.load(ctx) } + val on = key in LibraryFavorites.keys + IconAction( + if (on) Icons.Filled.Favorite else Icons.Filled.FavoriteBorder, + stringResource(if (on) R.string.fm_favorite_remove else R.string.fm_favorite_add), + "game:favorite", frosted = true, tint = if (on) FavoritesColours.dot else null, + ) { LibraryFavorites.toggle(ctx, key) } +} + +@Composable +internal fun RemoveButton(title: String, game: Library.SteamGame?, installed: InstalledStoreGame?, a: FrontEndActions) { val ctx = LocalContext.current val colors = MaterialTheme.colorScheme if ((installed?.sidecar?.store?.id ?: game?.source) == Store.BATTLENET.id && installed?.sidecar?.id?.let(BattleNetInstall::product) == null) return @@ -915,7 +938,7 @@ private fun AddonRow(name: String, target: WowAddons.Target, a: FrontEndActions) @Composable private fun CloudRows(g: Library.SteamGame) { - val store = Store.byId(g.source)?.takeIf { it != Store.AMAZON } ?: return + val store = Store.byId(g.source)?.takeIf { it != Store.AMAZON && it != Store.EA } ?: return val id = g.storeId ?: return val context = LocalContext.current.applicationContext var busy by remember(g.gameId) { mutableStateOf(null) } @@ -1010,6 +1033,13 @@ internal fun FactRow(label: String, value: String, labelWidth: androidx.compose. } } +@Composable +internal fun catalogSize(item: CatalogItem?): Long { + val ctx = LocalContext.current + if (item != null) LaunchedEffect(item.key, item.accessible) { StoreSizes.request(ctx, item) } + return item?.let { StoreSizes.size(it) } ?: 0L +} + @Composable internal fun diskSize(installed: InstalledStoreGame?, folder: File): Long? { val ctx = LocalContext.current diff --git a/app/src/main/java/com/droiddeck/launcher/ui/GameGlass.kt b/app/src/main/java/com/droiddeck/launcher/ui/GameGlass.kt index a2660d1b47..e5fd8845bd 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/GameGlass.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/GameGlass.kt @@ -38,6 +38,7 @@ import androidx.compose.ui.graphics.drawscope.drawIntoCanvas import androidx.compose.ui.graphics.drawscope.DrawScope import androidx.compose.ui.graphics.drawscope.clipRect import androidx.compose.ui.graphics.drawscope.translate +import androidx.compose.ui.draw.blur import androidx.compose.ui.graphics.graphicsLayer import androidx.compose.ui.graphics.luminance import androidx.compose.ui.graphics.painter.Painter @@ -147,6 +148,7 @@ internal fun GameBackdrop( fadeTop: Boolean, modifier: Modifier = Modifier, onArtPlaced: (androidx.compose.ui.geometry.Rect?) -> Unit = {}, + artBlur: androidx.compose.ui.unit.Dp = 0.dp, content: @Composable () -> Unit, ) { val ctx = LocalContext.current @@ -178,13 +180,13 @@ internal fun GameBackdrop( glass.fadeBottom(this, size) }, ) - if (art != null) ArtLayer(art, ambient ?: art, fadeTop, onArtPlaced) + if (art != null) ArtLayer(art, ambient ?: art, fadeTop, artBlur, onArtPlaced) CompositionLocalProvider(LocalGlass provides glass) { content() } } } @Composable -private fun ArtLayer(model: Any?, sample: Any?, fadeTop: Boolean, onPlaced: (androidx.compose.ui.geometry.Rect?) -> Unit) { +private fun ArtLayer(model: Any?, sample: Any?, fadeTop: Boolean, blur: androidx.compose.ui.unit.Dp, onPlaced: (androidx.compose.ui.geometry.Rect?) -> Unit) { val colors = MaterialTheme.colorScheme val light = colors.background.luminance() > 0.5f val pale = ((rememberArtBrightness(sample) - 0.28f) / 0.5f).coerceIn(0f, 1f) @@ -208,7 +210,7 @@ private fun ArtLayer(model: Any?, sample: Any?, fadeTop: Boolean, onPlaced: (and model = model, contentDescription = null, contentScale = ContentScale.Crop, alignment = BiasAlignment(0.45f, -0.35f), colorFilter = artFilter, - modifier = Modifier.matchParentSize(), + modifier = Modifier.matchParentSize().then(if (blur > 0.dp) Modifier.blur(blur) else Modifier), ) Box( Modifier.matchParentSize().drawBehind { diff --git a/app/src/main/java/com/droiddeck/launcher/ui/HudReadingsDialog.kt b/app/src/main/java/com/droiddeck/launcher/ui/HudReadingsDialog.kt new file mode 100644 index 0000000000..4d3cc47af5 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/ui/HudReadingsDialog.kt @@ -0,0 +1,389 @@ +package com.droiddeck.launcher.ui + +import android.view.KeyEvent +import androidx.compose.foundation.ExperimentalFoundationApi +import androidx.compose.foundation.background +import androidx.compose.animation.core.LinearEasing +import androidx.compose.animation.core.animateFloatAsState +import androidx.compose.animation.core.tween +import androidx.compose.foundation.border +import androidx.compose.foundation.focusable +import androidx.compose.foundation.gestures.awaitEachGesture +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.foundation.gestures.awaitFirstDown +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.fillMaxHeight +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.widthIn +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.lazy.LazyColumn +import androidx.compose.foundation.lazy.itemsIndexed +import androidx.compose.foundation.lazy.rememberLazyListState +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.filled.DragHandle +import androidx.compose.material3.Icon +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.mutableFloatStateOf +import androidx.compose.runtime.mutableStateListOf +import androidx.compose.runtime.mutableStateMapOf +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.rememberCoroutineScope +import androidx.compose.runtime.setValue +import androidx.compose.runtime.withFrameNanos +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.focus.FocusRequester +import androidx.compose.ui.focus.focusProperties +import androidx.compose.ui.focus.focusRequester +import androidx.compose.ui.focus.onFocusChanged +import androidx.compose.ui.graphics.graphicsLayer +import androidx.compose.ui.input.InputMode +import androidx.compose.ui.input.key.onPreviewKeyEvent +import androidx.compose.ui.input.pointer.PointerEventPass +import androidx.compose.ui.input.pointer.pointerInput +import androidx.compose.material3.LocalTextStyle +import androidx.compose.ui.platform.LocalDensity +import androidx.compose.ui.platform.LocalInputModeManager +import androidx.compose.ui.platform.testTag +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.PlatformTextStyle +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import androidx.compose.ui.zIndex +import com.droiddeck.launcher.R +import kotlinx.coroutines.delay +import kotlinx.coroutines.launch +import kotlin.math.roundToInt + +private val ROW_HEIGHT = 44.dp +private val HANDLE_WIDTH = 40.dp +private const val RESET_HOLD_MS = 5_000 +private const val TAP_HOLD_MS = 400 +private val HINT_LABEL_WIDTH = 92.dp +private val HINT_KEY_SIZE = 18.dp +private val HINT_GAP = 8.dp +private val HINT_LABEL_MIN = 24.dp +private val HINT_ROOM = HINT_LABEL_MIN + HINT_KEY_SIZE + HINT_GAP + +@Composable +internal fun ResetHold(held: Boolean, onFire: () -> Unit): Float { + val fill by animateFloatAsState( + if (held) 1f else 0f, + if (held) tween(RESET_HOLD_MS, easing = LinearEasing) else tween(120), + label = "resetHold", + ) + LaunchedEffect(held) { + if (!held) return@LaunchedEffect + delay(RESET_HOLD_MS.toLong()) + onFire() + } + return fill +} + +@Composable +private fun HudKeyHints(grabbed: String?, resetFill: Float) { + Column( + horizontalAlignment = Alignment.End, + verticalArrangement = Arrangement.spacedBy(6.dp), + ) { + KeyHint("X", stringResource(R.string.hud_hint_reset), resetFill) + KeyHint("Y", stringResource(if (grabbed != null) R.string.hud_hint_drop else R.string.hud_hint_grab)) + KeyHint("B", stringResource(R.string.hud_hint_save)) + } +} + +@Composable +internal fun KeyHint(key: String, label: String, fill: Float = 0f) { + Row( + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.spacedBy(HINT_GAP), + ) { + Text( + label, + fontSize = 11.sp, + lineHeight = 14.sp, + textAlign = TextAlign.End, + color = MaterialTheme.colorScheme.onSurfaceVariant, + maxLines = 2, + modifier = Modifier.widthIn(max = HINT_LABEL_WIDTH), + ) + Box( + contentAlignment = Alignment.Center, + modifier = Modifier.size(HINT_KEY_SIZE).clip(RoundedCornerShape(5.dp)) + .background( + if (fill > 0f) MaterialTheme.colorScheme.primary.copy(alpha = 0.15f + 0.55f * fill) + else MaterialTheme.colorScheme.surfaceVariant, + ) + .border(1.dp, MaterialTheme.colorScheme.outline, RoundedCornerShape(5.dp)), + ) { + Text( + key, + fontSize = 10.sp, + lineHeight = 10.sp, + textAlign = TextAlign.Center, + fontWeight = FontWeight.SemiBold, + color = MaterialTheme.colorScheme.onSurface, + style = LocalTextStyle.current.copy( + platformStyle = PlatformTextStyle(includeFontPadding = false), + ), + ) + } + } +} + +@OptIn(ExperimentalFoundationApi::class) +@Composable +internal fun HudReadingsDialog( + visible: List, + initialOrder: List, + initialOn: Map, + onDismiss: () -> Unit, + onSave: (Map, List) -> Unit, + onReset: () -> Unit, + controller: Boolean = LocalInputModeManager.current.inputMode == InputMode.Keyboard, +) { + val order = remember { mutableStateListOf().apply { addAll(initialOrder.filter { it in visible }) } } + val enabled = remember { mutableStateMapOf() } + remember(initialOn) { for (key in initialOrder) enabled[key] = initialOn[key] == true; true } + val merged = { + val moved = order.toList() + var i = 0 + initialOrder.map { if (it in visible) moved[i++] else it } + } + val shown = rememberShown { onDismiss() } + val close = { shown.targetState = false } + val save = { onSave(enabled.toMap(), merged()); close() } + val restore = { onReset(); close() } + val rowPx = with(LocalDensity.current) { ROW_HEIGHT.toPx() } + var pad by remember { mutableStateOf(controller) } + var yHeld by remember { mutableStateOf(false) } + var yLong by remember { mutableStateOf(false) } + var yStartedGrab by remember { mutableStateOf(false) } + LaunchedEffect(yHeld) { + if (!yHeld) return@LaunchedEffect + delay(TAP_HOLD_MS.toLong()) + yLong = true + } + + var resetHeld by remember { mutableStateOf(false) } + val resetFill = ResetHold(resetHeld, restore) + + var dragging by remember { mutableStateOf(-1) } + var dragOffset by remember { mutableFloatStateOf(0f) } + + val panelFocus = remember { FocusRequester() } + val firstKey = remember { order.firstOrNull() } + val firstFocus = remember { FocusRequester() } + LaunchedEffect(Unit) { + runCatching { panelFocus.requestFocus() } + repeat(30) { + if (runCatching { firstFocus.requestFocus() }.isSuccess) return@LaunchedEffect + withFrameNanos { } + } + } + var focusedKey by remember { mutableStateOf(null) } + var grabbed by remember { mutableStateOf(null) } + val before = remember { mutableStateListOf() } + val grab = { + val target = focusedKey ?: order.firstOrNull() + if (target != null && grabbed == null && dragging < 0) { + before.clear() + before.addAll(order) + grabbed = target + } + } + val cancel = { + val held = grabbed + if (held != null) { + order.clear() + order.addAll(before) + grabbed = null + } + } + + AppDialog( + shown, close, "hudReadings", wide = false, scrollable = false, + modifier = Modifier.fillMaxHeight(), + back = { if (grabbed != null) cancel() else if (pad) save() else close() }, + side = if (pad) { + { HudKeyHints(grabbed, resetFill) } + } else { + null + }, + sideRoom = HINT_ROOM, + ) { + val state = rememberLazyListState() + val scope = rememberCoroutineScope() + val handlePx = with(LocalDensity.current) { HANDLE_WIDTH.toPx() } + Column( + Modifier.fillMaxWidth().weight(1f).focusRequester(panelFocus).focusable() + .onPreviewKeyEvent { event -> + val key = event.nativeKeyEvent + val down = key.action == KeyEvent.ACTION_DOWN + if (down) pad = true + val first = down && key.repeatCount == 0 + val held = grabbed + when { + key.keyCode == KeyEvent.KEYCODE_BUTTON_Y -> { + when { + down && first -> { + yHeld = true + yLong = key.flags and KeyEvent.FLAG_LONG_PRESS != 0 + yStartedGrab = grabbed == null + if (yStartedGrab) grab() + } + down -> if (key.repeatCount > 0) yLong = true + else -> { + val drop = grabbed != null && (!yStartedGrab || yLong) + yHeld = false + if (drop) grabbed = null + } + } + true + } + key.keyCode == KeyEvent.KEYCODE_BUTTON_X && pad -> { + resetHeld = down + true + } + key.keyCode == KeyEvent.KEYCODE_BUTTON_A || + key.keyCode == KeyEvent.KEYCODE_ENTER || + key.keyCode == KeyEvent.KEYCODE_SPACE -> { + val target = focusedKey + when { + held != null -> { + if (first) grabbed = null + true + } + target == null -> false + else -> { + if (first) enabled[target] = !(enabled[target] == true) + true + } + } + } + held == null -> false + key.keyCode == KeyEvent.KEYCODE_DPAD_UP || key.keyCode == KeyEvent.KEYCODE_DPAD_DOWN -> { + if (down) { + val from = order.indexOf(held) + val step = if (key.keyCode == KeyEvent.KEYCODE_DPAD_UP) -1 else 1 + val to = (from + step).coerceIn(0, order.lastIndex) + if (to != from) { + order.add(to, order.removeAt(from)) + val visible = state.layoutInfo.visibleItemsInfo + if (visible.isNotEmpty()) { + val first = visible.first().index + val last = visible.last().index + val target = when { + to <= first -> to + to > last -> (to - visible.size + 1).coerceAtLeast(0) + else -> null + } + if (target != null) scope.launch { state.animateScrollToItem(target) } + } + } + } + true + } + else -> false + } + }, + ) { + val list = @Composable { m: Modifier -> + LazyColumn(state = state, modifier = m.pointerInput(Unit) { + awaitEachGesture { + val down = awaitFirstDown(requireUnconsumed = false) + val item = state.layoutInfo.visibleItemsInfo.firstOrNull { + it.offset <= down.position.y && down.position.y < it.offset + it.size + } + if (item == null || down.position.x > handlePx || grabbed != null) return@awaitEachGesture + val start = item.index + dragging = start + dragOffset = 0f + while (true) { + val change = awaitPointerEvent(PointerEventPass.Initial).changes.firstOrNull { it.id == down.id } ?: break + val travel = change.position.y - down.position.y + change.consume() + if (!change.pressed) break + val target = (start + (travel / rowPx).roundToInt()).coerceIn(0, order.lastIndex) + while (target != dragging) { + val step = if (target > dragging) 1 else -1 + order.add(dragging + step, order.removeAt(dragging)) + dragging += step + } + dragOffset = travel - (dragging - start) * rowPx + } + dragging = -1 + dragOffset = 0f + } + }) { + itemsIndexed(order, key = { _, key -> key }) { index, key -> + val held = index == dragging || key == grabbed + Row( + verticalAlignment = Alignment.CenterVertically, + modifier = Modifier.fillMaxWidth().height(ROW_HEIGHT).testTag("hud-row-$key") + .then(if (key == firstKey) Modifier.focusRequester(firstFocus) else Modifier) + .onFocusChanged { if (it.isFocused) focusedKey = key else if (focusedKey == key) focusedKey = null } + .zIndex(if (held) 1f else 0f) + .graphicsLayer { translationY = if (index == dragging) dragOffset else 0f } + .clip(Shape12) + .background( + if (held) MaterialTheme.colorScheme.surfaceVariant + else MaterialTheme.colorScheme.surface, + ) + .then( + if (key == focusedKey) Modifier.border(2.dp, LocalPalette.current.signal, Shape12) + else Modifier, + ) + .focusable() + .padding(start = 4.dp, end = 6.dp), + ) { + Box( + contentAlignment = Alignment.Center, + modifier = Modifier.size(width = HANDLE_WIDTH, height = ROW_HEIGHT).testTag("hud-handle-$key"), + ) { + Icon( + Icons.Filled.DragHandle, null, + tint = MaterialTheme.colorScheme.onSurfaceVariant, + modifier = Modifier.size(20.dp), + ) + } + val label = hudMetricLabel(key) + Text( + if (label != null) stringResource(label) else key, + fontSize = 14.sp, color = MaterialTheme.colorScheme.onBackground, maxLines = 1, + modifier = Modifier.weight(1f).padding(start = 2.dp), + ) + ToggleSwitch( + enabled[key] == true, true, null, + modifier = Modifier.testTag("hud-switch-$key").focusProperties { canFocus = false }, + ) { enabled[key] = !(enabled[key] == true) } + } + } + } + } + list(Modifier.weight(1f).fillMaxWidth()) + if (!pad) { + Row(Modifier.fillMaxWidth().padding(top = 8.dp), horizontalArrangement = Arrangement.spacedBy(8.dp)) { + Box(Modifier.weight(1f)) + PrimaryButton(stringResource(R.string.common_ok), compact = true, onClick = save) + SecondaryButton(stringResource(R.string.hud_reset_button), compact = true, onClick = restore) + } + } + } + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/ui/LabBuilds.kt b/app/src/main/java/com/droiddeck/launcher/ui/LabBuilds.kt new file mode 100644 index 0000000000..8bfc59306b --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/ui/LabBuilds.kt @@ -0,0 +1,162 @@ +package com.droiddeck.launcher.ui + +import android.text.format.DateUtils +import androidx.compose.foundation.background +import androidx.compose.foundation.border +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.height +import androidx.compose.foundation.layout.heightIn +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.outlined.Code +import androidx.compose.material3.Icon +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableIntStateOf +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.text.font.FontWeight +import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import com.droiddeck.launcher.R +import com.droiddeck.launcher.core.WirelessAdbFix +import com.droiddeck.launcher.lab.LabOverlay + +/** + * Lab builds on this device: the one in use, one waiting for a restart, and the kept ones. + * [onRebuild] offers to build a kept one again for this install, when something can. + */ +@Composable +internal fun LabBuilds(sessionRunning: Boolean = false, onRebuild: ((LabOverlay.Info) -> Unit)? = null) { + val context = LocalContext.current + var version by remember { mutableIntStateOf(0) } + var busy by remember { mutableStateOf(false) } + var error by remember { mutableStateOf(null) } + val current = remember(version) { LabOverlay.current(context) } + val pending = remember(version) { LabOverlay.pending(context) } + val saved = remember(version) { LabOverlay.saved(context) } + if (current == null && pending == null && saved.isEmpty()) return + val active = LabOverlay.active + val paused = active == null && current != null && LabOverlay.skipped == LabOverlay.SKIPPED_APP_IMAGE + val restartFailed = stringResource(R.string.lab_restart_failed) + val canRestart = !busy && !sessionRunning + + /** Android may have given the APK an app image again, which a Lab build cannot load over. */ + fun restart() { + busy = true + error = null + Thread({ + val result = runCatching { + if (LabOverlay.needsRecompile(context)) WirelessAdbFix.shell(context, LabOverlay.recompileCommand(context)) + } + android.os.Handler(android.os.Looper.getMainLooper()).post { + busy = false + if (result.isSuccess) LabOverlay.restart(context) + else error = restartFailed.format(result.exceptionOrNull()?.message.orEmpty()) + } + }, "lab-restart").start() + } + + val colors = MaterialTheme.colorScheme + val pal = LocalPalette.current + Column(Modifier.fillMaxWidth().padding(top = 18.dp)) { + Text( + stringResource(R.string.lab_builds).uppercase(), fontSize = 12.sp, fontWeight = FontWeight.SemiBold, letterSpacing = 1.5.sp, + color = colors.onSurfaceVariant, modifier = Modifier.padding(start = 2.dp, top = 2.dp, bottom = 10.dp), + ) + Column(Modifier.fillMaxWidth().clip(Shape14).background(colors.surface).border(1.dp, pal.line, Shape14)) { + val rows = mutableListOf<@Composable () -> Unit>() + if (current != null) rows += { + BuildRow( + current, true, + when { + active != null -> stringResource(R.string.lab_in_use) + paused -> stringResource(R.string.lab_paused_row) + else -> stringResource(R.string.lab_not_loaded, LabOverlay.skipped.orEmpty()) + }, + warn = active == null, + ) { + if (paused) PrimaryButton(stringResource(R.string.lab_restart), compact = true, enabled = canRestart) { restart() } + SecondaryButton(stringResource(R.string.lab_turn_off), compact = true, enabled = canRestart) { LabOverlay.turnOff(context) } + } + } + if (pending != null) rows += { + BuildRow(pending, false, stringResource(R.string.lab_waiting), warn = false) { + PrimaryButton(stringResource(R.string.lab_restart), compact = true, enabled = canRestart) { restart() } + } + } + for (build in saved) rows += { + var armed by remember(build.dir) { mutableStateOf(false) } + val info = build.info + BuildRow( + info, false, + when { + armed -> stringResource(R.string.lab_delete_warning) + !build.usable -> stringResource(R.string.lab_other_install) + build.reason == LabOverlay.Reason.DID_NOT_START -> stringResource(R.string.lab_off_did_not_start) + else -> stringResource(R.string.lab_kept) + }, + warn = armed || !build.usable || build.reason == LabOverlay.Reason.DID_NOT_START, + ) { + if (!build.usable && !armed && info != null && onRebuild != null) SecondaryButton(stringResource(R.string.lab_rebuild), compact = true, enabled = !busy) { + onRebuild(info) + } + if (build.usable && !armed) SecondaryButton(stringResource(R.string.lab_use), compact = true, enabled = canRestart) { + runCatching { LabOverlay.stage(context, build) } + .onSuccess { version++; restart() } + .onFailure { error = it.message } + } + SecondaryButton(stringResource(if (armed) R.string.lab_delete_confirm else R.string.lab_delete), compact = true, enabled = !busy) { + if (armed) { + LabOverlay.delete(build) + version++ + } else armed = true + } + } + } + rows.forEachIndexed { index, row -> + row() + if (index < rows.lastIndex) Box(Modifier.fillMaxWidth().height(1.dp).background(pal.line)) + } + } + error?.let { Text(it, fontSize = 12.5.sp, color = AttentionAmber, modifier = Modifier.padding(start = 2.dp, top = 8.dp)) } + } +} + +@Composable +private fun BuildRow(info: LabOverlay.Info?, current: Boolean, status: String, warn: Boolean, actions: @Composable () -> Unit) { + val colors = MaterialTheme.colorScheme + val pal = LocalPalette.current + Row( + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.spacedBy(12.dp), + modifier = Modifier.fillMaxWidth().heightIn(min = 60.dp).padding(horizontal = 14.dp, vertical = 10.dp), + ) { + Box(contentAlignment = Alignment.Center, modifier = Modifier.size(34.dp).clip(Shape12) + .background(if (current) pal.signal.copy(alpha = 0.18f) else colors.surfaceVariant)) { + Icon(Icons.Outlined.Code, null, tint = if (current) pal.signal else colors.onSurfaceVariant, modifier = Modifier.size(20.dp)) + } + Column(Modifier.weight(1f)) { + Text(info?.label ?: "?", fontSize = 14.5.sp, fontWeight = FontWeight.SemiBold, color = colors.onBackground, + maxLines = 1, overflow = TextOverflow.Ellipsis) + val built = info?.built?.takeIf { it > 0 }?.let { DateUtils.getRelativeTimeSpanString(it * 1000, System.currentTimeMillis(), DateUtils.MINUTE_IN_MILLIS).toString() } + Text(listOfNotNull(status, built).joinToString(" ยท "), fontSize = 12.5.sp, color = if (warn) AttentionAmber else colors.onSurfaceVariant, + maxLines = 2, overflow = TextOverflow.Ellipsis) + } + Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) { actions() } + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/ui/LibraryFavorites.kt b/app/src/main/java/com/droiddeck/launcher/ui/LibraryFavorites.kt new file mode 100644 index 0000000000..2aab3b4b9f --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/ui/LibraryFavorites.kt @@ -0,0 +1,35 @@ +package com.droiddeck.launcher.ui + +import android.content.Context +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.setValue +import com.droiddeck.launcher.session.SessionPrefs + +internal const val LIBRARY_FAVORITES = "favorites" + +internal object LibraryFavorites { + var keys by mutableStateOf>(emptySet()) + private set + private var loaded = false + + fun load(context: Context) { + if (loaded) return + loaded = true + keys = SessionPrefs.libraryFavorites(context) + } + + fun toggle(context: Context, key: String) { + load(context) + keys = toggled(keys, key) + SessionPrefs.setLibraryFavorites(context, keys) + } +} + +internal fun toggled(keys: Set, key: String): Set = if (key in keys) keys - key else keys + key + +internal fun inLibrarySource(source: String, entry: LibraryEntry, favorites: Set): Boolean = when (source) { + LIBRARY_ALL -> true + LIBRARY_FAVORITES -> entry.favoriteKey in favorites + else -> entry.source == source +} diff --git a/app/src/main/java/com/droiddeck/launcher/ui/LibraryPage.kt b/app/src/main/java/com/droiddeck/launcher/ui/LibraryPage.kt index dfba4cf31f..d4210f326b 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/LibraryPage.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/LibraryPage.kt @@ -42,6 +42,7 @@ import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Add +import androidx.compose.material.icons.filled.BookmarkBorder import androidx.compose.material.icons.filled.FilterAlt import androidx.compose.material.icons.filled.GridView import androidx.compose.material.icons.filled.PlayArrow @@ -61,6 +62,7 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableIntStateOf import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember +import androidx.compose.runtime.produceState import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -92,6 +94,11 @@ import androidx.compose.ui.unit.sp import coil.compose.AsyncImage import com.droiddeck.launcher.R import com.droiddeck.launcher.frontend.Library +import com.droiddeck.launcher.frontend.Soundtrack +import com.droiddeck.launcher.frontend.SoundtrackCollections +import com.droiddeck.launcher.frontend.SoundtrackIndex +import com.droiddeck.launcher.frontend.SoundtrackTracks +import com.droiddeck.launcher.playback.SoundtrackController import com.droiddeck.launcher.session.SessionPrefs import com.droiddeck.launcher.stores.CatalogItem import com.droiddeck.launcher.stores.Store @@ -119,6 +126,7 @@ internal class LibraryEntry( val game: Library.SteamGame?, val item: CatalogItem?, val installed: Boolean, ) { val storeKey: String? get() = item?.key ?: game?.storeId?.let { "${game.source}:$it" } + val favoriteKey: String get() = storeKey ?: key } internal fun libraryEntries( @@ -155,9 +163,12 @@ internal fun collectionEntries(all: List, items: List internal fun installedFirst(entries: List): List = entries.partition { it.installed }.let { (on, off) -> on + off } internal const val LIBRARY_ALL = "all" -internal fun librarySources(entries: List, order: List, always: Set = emptySet()): List = - (listOf(Library.SOURCE_STEAM) + arrangeStoreTabs(order, emptySet()).map { it.store.id } + Library.ADDED) - .filter { source -> source in always || entries.any { it.source == source } } +internal fun librarySources(entries: List, order: List, always: Set = emptySet(), favorites: Set = emptySet()): List = + (listOf(LIBRARY_FAVORITES, Library.SOURCE_STEAM) + arrangeStoreTabs(order, emptySet()).map { it.store.id } + Library.ADDED + Library.SOURCE_COLLECTION) + .filter { source -> + if (source == LIBRARY_FAVORITES) entries.any { it.favoriteKey in favorites } + else source in always || entries.any { it.source == source } + } internal object LibraryDisplay { val scales = listOf(0.75f, 0.875f, 1f, 1.2f, 1.45f) @@ -215,14 +226,26 @@ internal fun LibraryPage(s: FrontEndState, a: FrontEndActions, selected: String, val inputMode = androidx.compose.ui.platform.LocalInputModeManager.current LaunchedEffect(Unit) { StoresState.refresh(ctx) } remember { LibraryDisplay.load(ctx) } - val stores = s.gameStoresEnabled && !s.shortcutPicker + remember { LibraryFavorites.load(ctx) } + val soundMode = selected == "soundtracks" || selected.startsWith("sound:") + val favorites = if (soundMode) emptySet() else LibraryFavorites.keys + val stores = s.gameStoresEnabled && !s.shortcutPicker && !soundMode val signedIn = Store.entries.filter { StoresState.isSignedIn(it) } LaunchedEffect(stores, signedIn) { if (stores) signedIn.forEach { StoresState.loadLibrary(ctx, it) } } val owned = if (stores) signedIn.associateWith { StoresState.library[it].orEmpty() } else emptyMap() val installedStore = StoresState.installed.map { it.key }.toSet() val syncing = if (stores) signedIn.mapNotNull { st -> StoresState.status[st]?.let { st to it } } else emptyList() val cloudRows = rememberXboxCloudRows(s) - val all = remember(s.steamGames, cloudRows, owned, installedStore) { libraryEntries(s.steamGames + cloudRows, owned, installedStore) } + remember { SoundtrackCollections.load(ctx) } + val savedSnapshot = SoundtrackCollections.snapshot + val favoritesLabel = stringResource(R.string.soundtracks_favorites) + val all = remember(soundMode, s.steamGames, s.soundtracks, s.soundtracksEnabled, cloudRows, owned, installedStore, savedSnapshot, favoritesLabel) { + if (soundMode) s.soundtracks.map { LibraryEntry("sound:${it.appId}", it.source, it.name, it, null, true) } + + (if (s.soundtracks.isEmpty() && savedSnapshot.favorites.isEmpty() && savedSnapshot.collections.isEmpty()) emptyList() else SoundtrackCollections.games(ctx, favoritesLabel)) + .map { LibraryEntry("sound:${it.appId}", it.source, it.name, it, null, true) } + else libraryEntries(s.steamGames + cloudRows + if (s.soundtracksEnabled) emptyList() else s.soundtracks.filter { it.library != Library.ADDED }, owned, installedStore) + } + var addingSoundtrack by remember { mutableStateOf(false) } LaunchedEffect(Unit) { XboxLibraryFilter.load(ctx) } var showUninstalled by remember(LibraryView.ownedRequest) { mutableStateOf(SessionPrefs.libraryShowUninstalled(ctx)) } var collectionShows by remember { mutableStateOf?>(null) } @@ -240,7 +263,11 @@ internal fun LibraryPage(s: FrontEndState, a: FrontEndActions, selected: String, } val itchSignedIn = owned.containsKey(Store.ITCH) val gameJoltSignedIn = owned.containsKey(Store.GAMEJOLT) - val sources = librarySources(all, SessionPrefs.storesTabOrder(ctx), listOfNotNull(Store.ITCH.id.takeIf { itchSignedIn }, Store.GAMEJOLT.id.takeIf { gameJoltSignedIn }).toSet()) + val sources = librarySources( + all, SessionPrefs.storesTabOrder(ctx), + listOfNotNull(Store.ITCH.id.takeIf { itchSignedIn && !soundMode }, Store.GAMEJOLT.id.takeIf { gameJoltSignedIn && !soundMode }, Library.SOURCE_COLLECTION.takeIf { soundMode }).toSet(), + favorites, + ) val source = LibraryView.source.takeIf { it == LIBRARY_ALL || it in sources } ?: LIBRARY_ALL val q = LibraryView.query.trim().lowercase() val xboxFilter = if (source == Store.XBOX.id) XboxLibraryFilter.current else XboxLibraryFilter.ALL @@ -262,9 +289,33 @@ internal fun LibraryPage(s: FrontEndState, a: FrontEndActions, selected: String, val collectionItems = collectionId?.let { if (source == Store.GAMEJOLT.id) GameJoltCollections.gamesOf(it) else ItchCollections.gamesOf(it) } val pool = if (collectionId == null) all else collectionEntries(all, collectionItems.orEmpty(), Store.byId(source) ?: Store.ITCH) val matching = pool.filter { - (source == LIBRARY_ALL || it.source == source) && (q.isEmpty() || it.title.lowercase().contains(q)) && keepsXbox(xboxFilter, it) + inLibrarySource(source, it, favorites) && (q.isEmpty() || it.title.lowercase().contains(q)) && keepsXbox(xboxFilter, it) } val listUninstalled = if (collectionId == null) showUninstalled else collectionShows?.takeIf { it.first == collectionId }?.second ?: true + val trackHits by produceState>(emptyList(), soundMode, q, source, s.soundtracks) { + if (!soundMode || q.isEmpty()) { + value = emptyList() + return@produceState + } + kotlinx.coroutines.delay(150) + value = kotlinx.coroutines.withContext(kotlinx.coroutines.Dispatchers.IO) { + SoundtrackIndex.build(ctx, s.soundtracks) + .filter { (source == LIBRARY_ALL || it.game.source == source) && SoundtrackTracks.matches(q, it.ref.title, it.ref.artist, it.ref.album) } + .distinctBy { it.ref.path } + .sortedWith(compareBy({ SoundtrackTracks.rank(q, it.ref.title) }, { it.ref.title.lowercase() })) + .take(100) + } + } + val shownHits = trackHits.filter { source == LIBRARY_ALL || it.game.source == source } + val hitScope = rememberCoroutineScope() + val playHit: (SoundtrackIndex.Hit) -> Unit = { hit -> + val dir = hit.game.gameFiles + if (dir != null) hitScope.launch { + val album = kotlinx.coroutines.withContext(kotlinx.coroutines.Dispatchers.IO) { Soundtrack.load(ctx, dir, hit.game.art) } + SoundtrackController.play(ctx, album, hit.game.name, hit.ref.path, root = dir) + } + } + var savedDialog by remember { mutableStateOf(false) } val candidates = if (listUninstalled) matching else matching.filter { it.installed } val hiddenUninstalled = if (listUninstalled) 0 else matching.count { !it.installed } val sort = s.storesSort @@ -304,18 +355,20 @@ internal fun LibraryPage(s: FrontEndState, a: FrontEndActions, selected: String, var stable by remember { mutableStateOf(emptyList()) } val ordered = if (sizesPending) retainOrder(candidates, stable) { it.key } else sorted SideEffect { if (!sizesPending) stable = sorted } - val visible = installedFirst(ordered) + val visible = installedFirst(ordered).let { list -> + if (soundMode && source == Library.SOURCE_COLLECTION) list.sortedBy { if (it.game?.appId == SoundtrackCollections.FAVORITES_ID) 0 else 1 } else list + } val split = visible.count { it.installed }.takeIf { it in 1 until visible.size } ?: 0 - val open = selected.takeIf { it.startsWith("app:") } - val back = { onSelect("games") } + val open = selected.takeIf { it.startsWith(if (soundMode) "sound:" else "app:") } + val back = { onSelect(if (soundMode) "soundtracks" else "games") } BackHandler(enabled = open == null && LibraryView.query.isNotEmpty()) { LibraryView.query = "" } BackHandler(enabled = open != null) { back() } val lead = remember { FocusRequester() } var detailFocused by remember { mutableStateOf(false) } var lastOpened by remember { mutableStateOf(null) } val wasOpen = remember { booleanArrayOf(false) } - val backLabel = stringResource(R.string.rail_games) + val backLabel = stringResource(if (soundMode) R.string.rail_soundtracks else R.string.rail_games) LaunchedEffect(open) { val closing = open == null && wasOpen[0] wasOpen[0] = open != null @@ -349,7 +402,7 @@ internal fun LibraryPage(s: FrontEndState, a: FrontEndActions, selected: String, kotlinx.coroutines.delay(Motion.ms(240).toLong()) focusWithinFrames({ ff.last?.startsWith("card:") == true }) { if (ff.firstTileAttached > 0) ff.firstTile else FocusRequester.Default } } - if (all.isEmpty() && open == null && !itchSignedIn && !gameJoltSignedIn) { + if (!soundMode && all.isEmpty() && open == null && !itchSignedIn && !gameJoltSignedIn) { LibraryEmpty(s, a, modifier) return } @@ -385,9 +438,26 @@ internal fun LibraryPage(s: FrontEndState, a: FrontEndActions, selected: String, onOpen = { focusManager.clearFocus(force = true); onSelect(it) }, searchCleared = open != null, onFocus = { gridFocused = it }, + soundMode = soundMode, + emptyText = when { + soundMode && all.isEmpty() -> R.string.soundtracks_empty + soundMode && source == Library.SOURCE_COLLECTION && q.isEmpty() -> R.string.soundtracks_collections_empty + else -> R.string.stores_nothing_matches + }, + onAddSoundtrack = { addingSoundtrack = true }, + onCollections = { savedDialog = true }, + trackHits = shownHits, onPlayHit = playHit, ) }, - ) { key -> GameDetail(key, s, a, lead, backLabel, hopRail = "games", onBack = back) } + ) { key -> + if (soundMode || (!s.soundtracksEnabled && s.soundtracks.any { GameRef.key(it) == key })) SoundtrackDetail(key, s, a, lead, backLabel, onBack = back) + else GameDetail(key, s, a, lead, backLabel, hopRail = "games", onBack = back) + } + if (savedDialog) SavedDialog(emptyList(), onOpen = { id -> onSelect("sound:$id") }) { savedDialog = false } + if (addingSoundtrack) SyncFolderPicker(stringResource(R.string.soundtracks_add_title), null, onDismiss = { addingSoundtrack = false }) { dir -> + addingSoundtrack = false + a.onSoundtrackAdded(dir) + } } @Composable @@ -416,6 +486,8 @@ private fun LibraryGrid( sources: List, source: String, sizesPending: Boolean, syncing: List>, showUninstalled: Boolean?, onShowUninstalled: (Boolean) -> Unit, hiddenUninstalled: Int, onSource: (String) -> Unit, onCycle: (Int) -> Unit, onOpen: (String) -> Unit, onFocus: (Boolean) -> Unit, searchCleared: Boolean, + soundMode: Boolean = false, emptyText: Int = R.string.stores_nothing_matches, onAddSoundtrack: () -> Unit = {}, + onCollections: () -> Unit = {}, trackHits: List = emptyList(), onPlayHit: (SoundtrackIndex.Hit) -> Unit = {}, ) { val listMode = s.storesView == "list" val capsules = s.storesView == "capsules" @@ -438,7 +510,7 @@ private fun LibraryGrid( val next = storeGridNeighbor(index, visible.size, if (listMode) 1 else columns, direction, split) when { direction == 0 || index < 0 -> false - next == null -> direction > 0 + next == null -> direction > 0 && trackHits.isEmpty() else -> { if (key.action == KeyEvent.ACTION_DOWN) { val target = "card:${visible[next].key}" @@ -457,7 +529,7 @@ private fun LibraryGrid( } val picker = s.shortcutPicker && e.game != null val choose = if (picker) ({ a.onSteamGame(e.game!!) }) else null - if (listMode) LibraryRow(e, first, navigation, choose, onOpen) else LibraryTile(e, capsules, first, navigation, choose, onOpen, showSource = source == LIBRARY_ALL) + if (listMode) LibraryRow(e, first, navigation, choose, onOpen) else LibraryTile(e, capsules, first, navigation, choose, onOpen, showSource = source == LIBRARY_ALL || source == LIBRARY_FAVORITES) } LazyVerticalGrid( columns = if (listMode) GridCells.Fixed(1) else GridCells.Adaptive(tileWidth), state = grid, @@ -470,7 +542,7 @@ private fun LibraryGrid( contentPadding = PaddingValues(top = 4.dp, bottom = 16.dp), ) { item(key = "header", span = { GridItemSpan(maxLineSpan) }) { - Rise(0) { LibraryHeader(s, a, total, searchCleared, source == Store.XBOX.id, showUninstalled, onShowUninstalled, collections = Store.byId(source)?.takeIf { it == Store.ITCH || it == Store.GAMEJOLT }) } + Rise(0) { LibraryHeader(s, a, total, searchCleared, source == Store.XBOX.id, showUninstalled, onShowUninstalled, collections = Store.byId(source)?.takeIf { it == Store.ITCH || it == Store.GAMEJOLT }, soundMode = soundMode, onAddSoundtrack = onAddSoundtrack, onCollections = onCollections) } } item(key = "filters", span = { GridItemSpan(maxLineSpan) }) { Rise(1) { LibraryFilters(sources, source, onSource) } @@ -488,7 +560,7 @@ private fun LibraryGrid( Text(stringResource(R.string.store_section_loading), fontSize = 11.sp, color = MaterialTheme.colorScheme.onSurfaceVariant) } } - val empty = R.string.stores_nothing_matches + val empty = emptyText if (visible.isEmpty() && hiddenUninstalled > 0) item(key = "browse-owned", span = { GridItemSpan(maxLineSpan) }) { Column(horizontalAlignment = Alignment.CenterHorizontally, verticalArrangement = Arrangement.spacedBy(12.dp), modifier = Modifier.fillMaxWidth().padding(vertical = 32.dp)) { Text(stringResource(R.string.library_no_installed_matches), fontSize = 13.sp, color = MaterialTheme.colorScheme.onSurfaceVariant) @@ -502,6 +574,40 @@ private fun LibraryGrid( item(key = "not-installed-label", span = { GridItemSpan(maxLineSpan) }) { SectionLabel(stringResource(R.string.stores_section_not_installed)) } libraryGrid(visible.drop(split), empty, tile) } + if (trackHits.isNotEmpty()) { + item(key = "tracks-label", span = { GridItemSpan(maxLineSpan) }) { SectionLabel(stringResource(R.string.soundtracks_tracks_heading)) } + items(trackHits, key = { "track:${it.ref.path}" }, span = { GridItemSpan(maxLineSpan) }, contentType = { "track" }) { hit -> TrackHitRow(hit, onPlayHit) } + } + } +} + +@Composable +private fun TrackHitRow(hit: SoundtrackIndex.Hit, onPlay: (SoundtrackIndex.Hit) -> Unit) { + val colors = MaterialTheme.colorScheme + val pal = LocalPalette.current + val src = remember { MutableInteractionSource() } + val hot = rememberHot(src) + val shape = RoundedCornerShape(10.dp) + val cover = hit.ref.cover.takeIf { it.isNotEmpty() }?.let { java.io.File(it) }?.takeIf { it.isFile } + Row( + verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(12.dp), + modifier = Modifier.fillMaxWidth().heightIn(min = 56.dp).paneItem("trackhit:${hit.ref.path}").testTag("track-hit") + .clip(shape).glideBorder(hot, shape, pal.signal, pal.line) + .hoverable(src).clickable(role = Role.Button, interactionSource = src, indication = LocalIndication.current) { onPlay(hit) } + .controllerConfirm { onPlay(hit) } + .padding(horizontal = 10.dp, vertical = 6.dp), + ) { + Box(Modifier.size(44.dp).clip(RoundedCornerShape(8.dp)).background(artBrush(hueOf(hit.ref.album)))) { + if (cover != null) AsyncImage(model = cover, contentDescription = null, contentScale = ContentScale.Crop, modifier = Modifier.matchParentSize()) + } + Column(Modifier.weight(1f), verticalArrangement = Arrangement.spacedBy(2.dp)) { + Text(hit.ref.title, fontSize = 14.sp, fontWeight = FontWeight.Bold, color = colors.onBackground, maxLines = 1, overflow = TextOverflow.Ellipsis) + Text( + listOf(hit.ref.album, hit.ref.artist).filter { it.isNotBlank() }.joinToString(" ยท "), + fontSize = 12.sp, color = colors.onSurfaceVariant, maxLines = 1, overflow = TextOverflow.Ellipsis, + ) + } + if (hit.ref.durationMs > 0) Text(Soundtrack.formatLength(hit.ref.durationMs), fontSize = 12.sp, color = colors.onSurfaceVariant, maxLines = 1) } } @@ -532,28 +638,31 @@ private fun LazyGridScope.libraryGrid(entries: List, empty: Int, t private fun LibraryHeader( s: FrontEndState, a: FrontEndActions, total: Int, searchCleared: Boolean, xbox: Boolean, showUninstalled: Boolean?, onShowUninstalled: (Boolean) -> Unit, collections: Store?, + soundMode: Boolean = false, onAddSoundtrack: () -> Unit = {}, onCollections: () -> Unit = {}, ) { val colors = MaterialTheme.colorScheme val narrow = LocalNarrowPane.current + val heading = stringResource(if (soundMode) R.string.rail_soundtracks else R.string.rail_games) ModeHeader( - stringResource(R.string.rail_games), LibraryView.query, { LibraryView.query = it }, - placeholder = stringResource(R.string.stores_search_library), + heading, LibraryView.query, { LibraryView.query = it }, + placeholder = stringResource(if (soundMode) R.string.soundtracks_search else R.string.stores_search_library), clearSearchFocus = searchCleared, inlineWhenStacked = true, lead = { Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(8.dp), modifier = Modifier.padding(start = 2.dp, end = 4.dp)) { - Text(stringResource(R.string.rail_games), fontSize = if (narrow) 20.sp else 24.sp, fontWeight = FontWeight.Bold, color = colors.onBackground, maxLines = 1) - Text(pluralStringResource(R.plurals.mode_added_count, total, total), fontSize = 13.sp, color = colors.onSurfaceVariant, maxLines = 1) + Text(heading, fontSize = if (narrow) 20.sp else 24.sp, fontWeight = FontWeight.Bold, color = colors.onBackground, maxLines = 1) + Text(if (soundMode) total.toString() else pluralStringResource(R.plurals.mode_added_count, total, total), fontSize = 13.sp, color = colors.onSurfaceVariant, maxLines = 1) if (s.steamGamesX64 && !narrow) ClientTag() } }, ) { + if (soundMode) HeaderIconButton(stringResource(R.string.soundtracks_saved), Icons.Filled.BookmarkBorder, "collections", onCollections) DisplayButton() - if (showUninstalled != null || xbox) LibraryFilterButton(showUninstalled, onShowUninstalled, xbox) + if (!soundMode && (showUninstalled != null || xbox)) LibraryFilterButton(showUninstalled, onShowUninstalled, xbox) if (collections != null) CollectionsButton(collections) SortButton(s, a) ViewButton(s, a) - GameFileFolderActions(s, a) - if (!s.shortcutPicker) AddGameButton { GamesDialogState.adding = true } + if (!soundMode) GameFileFolderActions(s, a) + if (!s.shortcutPicker) AddGameButton { if (soundMode) onAddSoundtrack() else GamesDialogState.adding = true } } if (s.steamGamesX64 && narrow) Box(Modifier.padding(top = 4.dp)) { ClientTag() } } @@ -570,10 +679,19 @@ private fun LibraryFilters(sources: List, source: String, onSource: (Str val store = Store.byId(src) val dot = when { store != null -> sourceColours(src).dot.copy(alpha = if (StoresState.isSignedIn(store) && StoresState.expired[store] != true) 1f else 0.35f) - src == Library.SOURCE_STEAM -> sourceColours(src).dot + src == LIBRARY_FAVORITES -> FavoritesColours.dot + src == Library.SOURCE_STEAM || src == Library.ADDED || src == Library.SOURCE_COLLECTION -> sourceColours(src).dot else -> null } - SourceFilterChip(src, if (src == Library.ADDED) stringResource(R.string.library_filter_added) else store?.shortLabel ?: sourceLabel(src), source == src, dot) { onSource(src) } + SourceFilterChip( + src, + when (src) { + Library.ADDED -> stringResource(R.string.library_filter_added) + LIBRARY_FAVORITES -> stringResource(R.string.soundtracks_favorites) + else -> store?.shortLabel ?: sourceLabel(src) + }, + source == src, dot, + ) { onSource(src) } } } } @@ -649,7 +767,7 @@ private fun LibraryArt(e: LibraryEntry, wide: Any?, tall: Any?, download: Downlo } ArtCard( e.title, wide, tall, download, hot, capsule, chip, - badge = if (showSource) ({ SourceChip(e.source, small = true, modifier = Modifier.align(Alignment.TopStart).padding(6.dp)) }) else null, + badge = if (showSource) ({ SourceChip(e.source, small = true, modifier = Modifier.align(Alignment.TopStart).padding(6.dp), label = favoritesBadge(e), colours = favoritesColours(e)) }) else null, ) { LibrarySize(e) } } @@ -742,7 +860,7 @@ internal fun LibraryMarker(e: LibraryEntry, download: DownloadEntry?, showDownlo } } -private fun libraryUpdateAvailable(e: LibraryEntry): Boolean = e.storeKey?.let { it in ItchUpdates.available || it in GameJoltUpdates.available } == true || +private fun libraryUpdateAvailable(e: LibraryEntry): Boolean = e.storeKey?.let { it in ItchUpdates.available || it in GameJoltUpdates.available || it in com.droiddeck.launcher.stores.ea.EaUpdates.available } == true || e.source == Store.GOG.id && (e.item?.id ?: e.game?.storeId)?.let { GogMaintenance.checks[it]?.state } == GogMaintenance.State.AVAILABLE @Composable @@ -786,7 +904,7 @@ private fun LibraryRow(e: LibraryEntry, first: Boolean, navigation: Modifier, ch Column(Modifier.weight(1f), verticalArrangement = Arrangement.spacedBy(3.dp)) { Text(e.title, fontSize = 14.sp, fontWeight = FontWeight.Bold, color = colors.onBackground, maxLines = 1, overflow = TextOverflow.Ellipsis) Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(6.dp)) { - SourceChip(e.source, small = true) + SourceChip(e.source, small = true, label = favoritesBadge(e), colours = favoritesColours(e)) Text(meta.joinToString(" ยท "), fontSize = 12.sp, color = colors.onSurfaceVariant, maxLines = 1, overflow = TextOverflow.Ellipsis) } } @@ -1004,3 +1122,10 @@ private fun ViewButton(s: FrontEndState, a: FrontEndActions) { "view", ) { a.onStoresView(next) } } + +@Composable +private fun favoritesBadge(e: LibraryEntry): String? = + if (e.game?.appId == SoundtrackCollections.FAVORITES_ID && e.source == Library.SOURCE_COLLECTION) stringResource(R.string.soundtracks_favorites) else null + +private fun favoritesColours(e: LibraryEntry): SourceColours? = + if (e.game?.appId == SoundtrackCollections.FAVORITES_ID && e.source == Library.SOURCE_COLLECTION) FavoritesColours else null diff --git a/app/src/main/java/com/droiddeck/launcher/ui/MorePage.kt b/app/src/main/java/com/droiddeck/launcher/ui/MorePage.kt new file mode 100644 index 0000000000..b4d6952413 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/ui/MorePage.kt @@ -0,0 +1,98 @@ +package com.droiddeck.launcher.ui + +import androidx.compose.foundation.LocalIndication +import androidx.compose.foundation.background +import androidx.compose.foundation.clickable +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.BoxWithConstraints +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.shape.CircleShape +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.foundation.verticalScroll +import androidx.compose.material3.Icon +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.remember +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.platform.testTag +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.semantics.Role +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import com.droiddeck.launcher.R + +@Composable +internal fun MorePage(s: FrontEndState, a: FrontEndActions, onSelect: (String) -> Unit, modifier: Modifier) { + val keys = NavTabs.more(s) + val open: (String) -> Unit = { key -> if (key == "components") a.onComponents(true) else onSelect(key) } + Column(modifier.verticalScroll(rememberScrollState())) { + PageHeader(stringResource(R.string.rail_more)) { + Spacer(Modifier.weight(1f)) + SecondaryButton(stringResource(R.string.more_edit_tabs), compact = true) { + SetupTabs.openLauncher = true + SetupTabs.focusTabs = true + onSelect("setup") + } + } + BoxWithConstraints(Modifier.fillMaxWidth()) { + val gap = 12.dp + val columns = ((maxWidth + gap) / (160.dp + gap)).toInt().coerceIn(2, 5) + Column(verticalArrangement = Arrangement.spacedBy(gap)) { + keys.chunked(columns).forEachIndexed { r, row -> + Row(Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.spacedBy(gap)) { + row.forEachIndexed { c, key -> + MoreTile(s, key, first = r == 0 && c == 0, Modifier.weight(1f)) { open(key) } + } + repeat(columns - row.size) { Spacer(Modifier.weight(1f)) } + } + } + } + } + } +} + +@Composable +private fun MoreTile(s: FrontEndState, key: String, first: Boolean, modifier: Modifier, onClick: () -> Unit) { + val colors = MaterialTheme.colorScheme + val pal = LocalPalette.current + val (label, icon) = railLabelIcon(key) + val src = remember { MutableInteractionSource() } + val hot = rememberHot(src) + val shape = RoundedCornerShape(18.dp) + val count = railCount(s, key) + Box( + contentAlignment = Alignment.Center, + modifier = modifier + .then(if (first) Modifier.paneEntry() else Modifier.paneItem("more:$key")) + .testTag("more-$key") + .height(112.dp).clip(shape) + .background(if (hot) pal.signal.copy(alpha = 0.12f) else colors.surface) + .glideBorder(hot, shape, pal.signal, pal.line) + .hoverable(src) + .clickable(interactionSource = src, indication = LocalIndication.current, role = Role.Tab, onClick = onClick) + .controllerConfirm(onClick = onClick), + ) { + Column(horizontalAlignment = Alignment.CenterHorizontally, verticalArrangement = Arrangement.spacedBy(8.dp)) { + Icon(icon, contentDescription = null, tint = if (hot) pal.signal else colors.onSurfaceVariant, modifier = Modifier.size(30.dp)) + Text(stringResource(label), fontSize = 14.sp, fontWeight = FontWeight.SemiBold, color = colors.onBackground, + maxLines = 1, overflow = TextOverflow.Ellipsis, modifier = Modifier.padding(horizontal = 8.dp)) + } + if (railBadge(s, key)) Box(Modifier.align(Alignment.TopEnd).padding(12.dp).size(9.dp).clip(CircleShape).background(AttentionAmber)) + if (count > 0) Box(Modifier.align(Alignment.TopEnd).padding(10.dp)) { CountPill(count) } + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/ui/NavTabs.kt b/app/src/main/java/com/droiddeck/launcher/ui/NavTabs.kt new file mode 100644 index 0000000000..17f1478201 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/ui/NavTabs.kt @@ -0,0 +1,86 @@ +package com.droiddeck.launcher.ui + +import android.content.Context +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.setValue +import com.droiddeck.launcher.agent.AgentHost +import com.droiddeck.launcher.agent.AgentTab +import com.droiddeck.launcher.session.SessionPrefs + +internal enum class TabPlace { BAR, MORE, HIDDEN } + +internal object NavTabs { + const val MORE = "more" + val FEATURES = setOf("stores", "soundtracks", "agent") + val ALL = listOf("steam", "games", "soundtracks", "stores", "desktop", "agent", "components", "android-apps", "setup", "updates") + + var order by mutableStateOf(ALL) + private set + var shelved by mutableStateOf(emptySet()) + private set + var hidden by mutableStateOf(emptySet()) + private set + + fun load(context: Context) { + order = arrange(SessionPrefs.navTabOrder(context)) + shelved = SessionPrefs.navTabShelved(context).intersect(ALL.toSet()) + hidden = SessionPrefs.navTabHidden(context).intersect(ALL.toSet()) - FEATURES - "setup" + } + + fun arrange(saved: List): List { + val listed = saved.filter { it in ALL }.distinct() + val missing = ALL.filterNot { it in listed } + val out = listed.toMutableList() + for (key in missing) { + val before = ALL.subList(0, ALL.indexOf(key)).lastOrNull { it in out } + out.add(if (before == null) 0 else out.indexOf(before) + 1, key) + } + return out + } + + fun available(s: FrontEndState, key: String): Boolean = when (key) { + "android-apps" -> s.isHomeApp + "agent" -> AgentHost.available + else -> true + } + + fun hideable(key: String) = key != "setup" + + fun place(s: FrontEndState, key: String): TabPlace = when { + featureOff(s, key) || key in hidden -> TabPlace.HIDDEN + key in shelved -> TabPlace.MORE + else -> TabPlace.BAR + } + + private fun featureOff(s: FrontEndState, key: String) = when (key) { + "stores" -> !s.gameStoresEnabled + "soundtracks" -> !s.soundtracksEnabled + "agent" -> !AgentTab.shown + else -> false + } + + fun listed(s: FrontEndState) = order.filter { available(s, it) } + + fun more(s: FrontEndState) = listed(s).filter { place(s, it) == TabPlace.MORE } + + fun bar(s: FrontEndState): List { + val shown = listed(s).filter { place(s, it) == TabPlace.BAR } + return if (more(s).isEmpty()) shown else shown + MORE + } + + fun setHidden(context: Context, key: String, hide: Boolean) { + hidden = if (hide && hideable(key) && key !in FEATURES) hidden + key else hidden - key + SessionPrefs.setNavTabHidden(context, hidden) + } + + fun rearrange(context: Context, s: FrontEndState, bar: List, more: List) { + val placed = bar + more + if (placed.toSet() != listed(s).toSet()) return + val next = placed.iterator() + order = order.map { if (it in placed) next.next() else it } + shelved = shelved - placed.toSet() + more + SessionPrefs.setNavTabOrder(context, order) + SessionPrefs.setNavTabShelved(context, shelved) + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/ui/PerformanceDialog.kt b/app/src/main/java/com/droiddeck/launcher/ui/PerformanceDialog.kt index 2c0927bc88..fdfd5ca3d2 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/PerformanceDialog.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/PerformanceDialog.kt @@ -36,6 +36,7 @@ fun PerformancePage( clientOverride: Boolean, clientCores: Set, gameCores: Set, + paceCores: Boolean, tuSysmem: Boolean, zinkLazy: Boolean, glThread: Boolean, @@ -53,10 +54,12 @@ fun PerformancePage( ramCapAvailable: Boolean, prootNoSeccomp: Boolean, prootFastPath: Boolean, + nativeUserland: Boolean, cursorComposite: Boolean, guestHostname: String, phantomWarning: String?, onClientOverride: (Boolean) -> Unit, + onPaceCores: (Boolean) -> Unit, onTuSysmem: (Boolean) -> Unit, onZinkLazy: (Boolean) -> Unit, onGlThread: (Boolean) -> Unit, @@ -72,6 +75,7 @@ fun PerformancePage( onVramCapMb: (Int) -> Unit, onProotNoSeccomp: (Boolean) -> Unit, onProotFastPath: (Boolean) -> Unit, + onNativeUserland: (Boolean) -> Unit, onCursorComposite: (Boolean) -> Unit, onGuestHostname: (String) -> Unit, onClientCore: (Int, Boolean) -> Unit, @@ -103,6 +107,11 @@ fun PerformancePage( stringResource(R.string.perf_game_cores_hint), coreItems, gameCores, onToggle = onGameCore, ) + ToggleRow( + host, "paceCores", stringResource(R.string.perf_pace_cores), + stringResource(R.string.perf_pace_cores_hint), + paceCores, onChange = onPaceCores, + ) } SettingsGroup(stringResource(R.string.perf_client_ui)) { ToggleRow( @@ -187,9 +196,18 @@ fun PerformancePage( ) ToggleRow( host, "fastpath", stringResource(R.string.perf_fastpath), - if (prootNoSeccomp) stringResource(R.string.perf_fastpath_needs_seccomp) - else stringResource(R.string.perf_fastpath_hint), - prootFastPath && !prootNoSeccomp, enabled = !prootNoSeccomp, onChange = onProotFastPath, + when { + nativeUserland -> stringResource(R.string.perf_fastpath_needs_proot) + prootNoSeccomp -> stringResource(R.string.perf_fastpath_needs_seccomp) + else -> stringResource(R.string.perf_fastpath_hint) + }, + prootFastPath && !prootNoSeccomp && !nativeUserland, enabled = !prootNoSeccomp && !nativeUserland, + onChange = onProotFastPath, + ) + ToggleRow( + host, "nativeuserland", stringResource(R.string.perf_native_userland), + stringResource(R.string.perf_native_userland_hint), + nativeUserland, onChange = onNativeUserland, ) ToggleRow( host, "cursorcomposite", stringResource(R.string.perf_cursor_composite), diff --git a/app/src/main/java/com/droiddeck/launcher/ui/SessionDrawerPage.kt b/app/src/main/java/com/droiddeck/launcher/ui/SessionDrawerPage.kt index 07289bdf29..cb438903b7 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/SessionDrawerPage.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/SessionDrawerPage.kt @@ -9,12 +9,16 @@ internal enum class SessionDrawerPage(val firstControl: String) { EFFECTS("look"), VR("steamvr"), GAMES("anisotropy"), + AGENT("agent-input"), SESSION("suspend"), } -internal fun sessionDrawerPages(hasSecondScreen: Boolean, hasGlasses: Boolean = false): List = +internal fun sessionDrawerPages( + hasSecondScreen: Boolean, hasGlasses: Boolean = false, hasAgent: Boolean = com.droiddeck.launcher.agent.AgentHost.installed && com.droiddeck.launcher.agent.AgentTab.shown, +): List = SessionDrawerPage.entries.filter { - (hasSecondScreen || it != SessionDrawerPage.SECOND_SCREEN) && (hasGlasses || it != SessionDrawerPage.GLASSES) + (hasSecondScreen || it != SessionDrawerPage.SECOND_SCREEN) && (hasGlasses || it != SessionDrawerPage.GLASSES) && + (hasAgent || it != SessionDrawerPage.AGENT) } internal fun List.step(current: SessionDrawerPage, direction: Int): SessionDrawerPage { diff --git a/app/src/main/java/com/droiddeck/launcher/ui/SessionOverlay.kt b/app/src/main/java/com/droiddeck/launcher/ui/SessionOverlay.kt index 7315817c1c..2e57de51cf 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/SessionOverlay.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/SessionOverlay.kt @@ -43,6 +43,7 @@ import androidx.compose.material.icons.outlined.PowerSettingsNew import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.material.icons.outlined.DesktopWindows import androidx.compose.material.icons.outlined.Layers +import androidx.compose.material.icons.outlined.AutoAwesome import androidx.compose.material.icons.outlined.ScreenShare import androidx.compose.material.icons.outlined.Pause import androidx.compose.material.icons.outlined.PictureInPictureAlt @@ -172,6 +173,7 @@ private val SessionDrawerPage.title: Int get() = when (this) { SessionDrawerPage.VR -> R.string.vr_title SessionDrawerPage.EFFECTS -> R.string.drawer_page_effects SessionDrawerPage.GAMES -> R.string.game_settings_title + SessionDrawerPage.AGENT -> R.string.rail_agent SessionDrawerPage.SESSION -> R.string.mode_session } @@ -184,6 +186,7 @@ private val SessionDrawerPage.icon get() = when (this) { SessionDrawerPage.VR -> VrHeadsetIcon SessionDrawerPage.EFFECTS -> Icons.Outlined.AutoFixHigh SessionDrawerPage.GAMES -> Icons.Outlined.Layers + SessionDrawerPage.AGENT -> Icons.Outlined.AutoAwesome SessionDrawerPage.SESSION -> Icons.Outlined.Settings } @@ -217,6 +220,9 @@ class DrawerActions( val hudOn: Boolean, val hudConfig: Map = emptyMap(), val frameGen: FrameGen.Mode, + val frameGenTargetGameId: String? = null, + val frameGenTargetGameName: String? = null, + val hasGameOverride: Boolean = false, val lossless: Lossless.State, val oscMode: String, val suspendPolicy: String, @@ -256,9 +262,12 @@ class DrawerActions( val selectedSecondScreenDisplay: Int, val onHud: (Boolean) -> Unit, val onHudSetting: (String, String) -> Unit = { _, _ -> }, + val onHudOrder: (Map, List) -> Unit = { _, _ -> }, + val onHudOrderReset: () -> Unit = {}, val onHudReset: () -> Unit = {}, val onHudExport: () -> Unit = {}, val onFrameGenPick: (FrameGen.Mode) -> Unit, + val onFrameGenReset: () -> Unit = {}, val fpsLimit: Int = 0, val onFpsLimit: (Int) -> Unit = {}, val onImportLossless: () -> Unit, @@ -550,7 +559,14 @@ internal fun SessionDrawer(open: Boolean, requestedPage: SessionDrawerPage, cont glassesPages, glassesTab, modifier = Modifier.fillMaxWidth().padding(top = 8.dp), tabModifier = { key -> focus.track(page, "glasses-tab-$key").testTag("glasses-tab-$key") }, ) { selectedGlassesTab = it } - Column( + // The agent's chat scrolls itself and keeps its composer at the bottom, so it takes the height left. + if (page == SessionDrawerPage.AGENT) AgentPageWithControls( + Modifier.weight(1f).fillMaxWidth().padding(top = 8.dp, start = 14.dp, end = 14.dp), + inputModifier = focus.track(page, "agent-input"), + visible = open, + startTyping = false, + showControlsWithoutKeyboard = true, + ) else Column( modifier = Modifier.weight(1f).fillMaxWidth().verticalScroll(pageScroll.getValue(page)), ) { CompositionLocalProvider(LocalChipMinWidth provides 96.dp, LocalCompactSettings provides true) { when (page) { @@ -560,10 +576,21 @@ internal fun SessionDrawer(open: Boolean, requestedPage: SessionDrawerPage, cont val fgOpen = host.open == "fg" val offLabel = stringResource(R.string.frame_gen_off) val fgLabel = FrameGen.label(LocalContext.current, a.frameGen) - SettingsRow(stringResource(R.string.frame_gen_title), null, highlighted = fgOpen) { + SettingsRow( + stringResource(R.string.frame_gen_title), + if (a.frameGenTargetGameId != null) + "${stringResource(R.string.frame_gen_scope_game)} ยท ${a.frameGenTargetGameName ?: "ID ${a.frameGenTargetGameId}"}" + else stringResource(R.string.frame_gen_scope_global), + highlighted = fgOpen + ) { Box { ValueChip(fgLabel, fgOpen, modifier = focus.track(page, "fg")) { host.open = if (fgOpen) null else "fg" } - FrameGenMenu(host, a.frameGen, a.lossless, a.onFrameGenPick, a.onImportLossless) + FrameGenMenu( + host, a.frameGen, a.lossless, a.onFrameGenPick, a.onImportLossless, + gameProfileId = a.frameGenTargetGameId, + hasGameOverride = a.hasGameOverride, + onResetGame = a.onFrameGenReset, + ) } } if (a.direct) SliderRow( @@ -762,6 +789,7 @@ internal fun SessionDrawer(open: Boolean, requestedPage: SessionDrawerPage, cont track = { key -> focus.track(page, key) }, ) } + SessionDrawerPage.AGENT -> Unit SessionDrawerPage.SESSION -> { if (a.isHomeApp) SettingsGroup(stringResource(R.string.drawer_android_apps)) { SettingsRow(stringResource(R.string.drawer_launch_app), null) { @@ -1342,6 +1370,12 @@ private fun SelectedGameProfileGroup(host: MenuHost, a: DrawerActions, track: (S if (!profile.fexPreset.inherited) { ProfileSummaryRow(stringResource(R.string.comp_game_fex), fexProfileLabel(profile.fexPreset)) } + if (!profile.frameGenInherited) { + ProfileSummaryRow( + stringResource(R.string.frame_gen_title), + FrameGen.label(LocalContext.current, profile.frameGen), + ) + } if (!profile.proton.inherited) { ProfileSummaryRow(stringResource(R.string.comp_proton), profileValueLabel(profile.proton)) } diff --git a/app/src/main/java/com/droiddeck/launcher/ui/SoundtrackCollectionsUi.kt b/app/src/main/java/com/droiddeck/launcher/ui/SoundtrackCollectionsUi.kt new file mode 100644 index 0000000000..2bf1314621 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/ui/SoundtrackCollectionsUi.kt @@ -0,0 +1,295 @@ +package com.droiddeck.launcher.ui + +import androidx.compose.foundation.LocalIndication +import androidx.compose.foundation.background +import androidx.compose.foundation.border +import androidx.compose.foundation.clickable +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.heightIn +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.lazy.LazyColumn +import androidx.compose.foundation.lazy.items +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.shape.CircleShape +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.foundation.verticalScroll +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.filled.Add +import androidx.compose.material.icons.filled.Bookmark +import androidx.compose.material.icons.filled.Check +import androidx.compose.material.icons.filled.Delete +import androidx.compose.material.icons.filled.Edit +import androidx.compose.material.icons.filled.Remove +import androidx.compose.material.icons.filled.CheckBox +import androidx.compose.material.icons.filled.CheckBoxOutlineBlank +import androidx.compose.material3.AlertDialog +import androidx.compose.material3.Icon +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text +import androidx.compose.material3.TextButton +import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.produceState +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.graphics.Color +import androidx.compose.ui.layout.ContentScale +import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.platform.testTag +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.semantics.Role +import androidx.compose.ui.semantics.contentDescription +import androidx.compose.ui.semantics.semantics +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.input.ImeAction +import androidx.compose.ui.text.input.KeyboardType +import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import coil.compose.AsyncImage +import com.droiddeck.launcher.R +import com.droiddeck.launcher.frontend.Library +import com.droiddeck.launcher.frontend.Soundtrack +import com.droiddeck.launcher.frontend.SoundtrackCollections +import com.droiddeck.launcher.frontend.SoundtrackIndex +import com.droiddeck.launcher.frontend.SoundtrackTracks +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.withContext + +@Composable +internal fun SavedDialog(pending: List, onOpen: ((Int) -> Unit)?, onDismiss: () -> Unit) { + val ctx = LocalContext.current + val colors = MaterialTheme.colorScheme + remember { SoundtrackCollections.load(ctx) } + val snapshot = SoundtrackCollections.snapshot + val favoritesLabel = stringResource(R.string.soundtracks_favorites) + var naming by remember { mutableStateOf(false) } + val rows = listOf(Triple(SoundtrackCollections.FAVORITES_ID, favoritesLabel, snapshot.favorites)) + + snapshot.collections.map { Triple(it.id, it.name, it.tracks) } + AlertDialog( + onDismissRequest = onDismiss, + title = { + Row(verticalAlignment = Alignment.CenterVertically) { + Text(stringResource(R.string.soundtracks_saved), modifier = Modifier.weight(1f)) + Icon(Icons.Filled.Bookmark, contentDescription = null, tint = colors.onSurfaceVariant) + } + }, + text = { + Column(Modifier.verticalScroll(rememberScrollState()), verticalArrangement = Arrangement.spacedBy(8.dp)) { + SavedRow(stringResource(R.string.soundtracks_create_collection), stringResource(R.string.soundtracks_organise), null, "saved-create", null) { + TextButton(onClick = { naming = true }, modifier = Modifier.focusGlide(CircleShape).testTag("saved-new")) { + Icon(Icons.Filled.Add, contentDescription = null, modifier = Modifier.size(18.dp)) + Text(stringResource(R.string.soundtracks_new)) + } + } + for ((id, name, tracks) in rows) { + val cover = tracks.firstNotNullOfOrNull { t -> t.cover.takeIf { it.isNotEmpty() }?.let { java.io.File(it) }?.takeIf { it.isFile } } + val subtitle = stringResource(R.string.soundtracks_length_value, tracks.size, Soundtrack.formatLength(tracks.sumOf { it.durationMs })) + val added = pending.isNotEmpty() && pending.all { p -> tracks.any { it.path == p.path } } + SavedRow(name, subtitle, cover, "saved-$id", if (pending.isEmpty() && onOpen != null) ({ onDismiss(); onOpen(id) }) else null) { + if (pending.isNotEmpty()) CircleAction(if (added) Icons.Filled.Check else Icons.Filled.Add, name, "saved-add-$id") { + if (added) SoundtrackCollections.remove(ctx, id, pending.map { it.path }.toSet()) + else SoundtrackCollections.add(ctx, id, pending) + } + } + } + } + }, + confirmButton = { TextButton(onClick = onDismiss, modifier = Modifier.focusGlide(CircleShape)) { Text(stringResource(R.string.common_close)) } }, + ) + if (naming) NameDialog( + stringResource(R.string.soundtracks_create_collection), "", stringResource(R.string.soundtracks_create), + onConfirm = { name -> + val id = SoundtrackCollections.create(ctx, name, pending) + if (id != null && pending.isEmpty() && onOpen != null) { onDismiss(); onOpen(id) } + id != null + }, + onDismiss = { naming = false }, + ) +} + +@Composable +private fun SavedRow(title: String, subtitle: String, cover: Any?, tag: String, onClick: (() -> Unit)?, trailing: @Composable () -> Unit) { + val colors = MaterialTheme.colorScheme + val pal = LocalPalette.current + val src = remember { MutableInteractionSource() } + val hot = rememberHot(src) && onClick != null + val shape = RoundedCornerShape(10.dp) + Row( + verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(12.dp), + modifier = Modifier.fillMaxWidth().testTag(tag).clip(shape).background(if (hot) pal.signal.copy(alpha = 0.12f) else Color.Transparent) + .glideBorder(hot, shape, pal.signal, Color.Transparent) + .then( + if (onClick != null) Modifier.hoverable(src).clickable(interactionSource = src, indication = LocalIndication.current, role = Role.Button, onClick = onClick) + .controllerConfirm(onClick = onClick) + else Modifier, + ) + .padding(vertical = 4.dp), + ) { + Box(Modifier.size(52.dp).clip(RoundedCornerShape(8.dp)).background(Color.White.copy(alpha = 0.08f))) { + if (cover != null) AsyncImage(cover, contentDescription = null, contentScale = ContentScale.Crop, modifier = Modifier.matchParentSize()) + } + Column(Modifier.weight(1f), verticalArrangement = Arrangement.spacedBy(2.dp)) { + Text(title, fontSize = 15.sp, fontWeight = FontWeight.SemiBold, color = colors.onSurface, maxLines = 1, overflow = TextOverflow.Ellipsis) + Text(subtitle, fontSize = 12.sp, color = colors.onSurfaceVariant, maxLines = 1, overflow = TextOverflow.Ellipsis) + } + trailing() + } +} + +@Composable +private fun CircleAction(icon: androidx.compose.ui.graphics.vector.ImageVector, label: String, tag: String, onClick: () -> Unit) { + val colors = MaterialTheme.colorScheme + val pal = LocalPalette.current + val src = remember { MutableInteractionSource() } + val hot = rememberHot(src) + Box( + contentAlignment = Alignment.Center, + modifier = Modifier.testTag(tag).size(40.dp).clip(CircleShape).background(if (hot) pal.signal.copy(alpha = 0.16f) else Color.Transparent) + .border(1.dp, if (hot) pal.signal else colors.onSurface.copy(alpha = 0.7f), CircleShape) + .hoverable(src).clickable(interactionSource = src, indication = LocalIndication.current, role = Role.Button, onClick = onClick) + .controllerConfirm(onClick = onClick) + .semantics { contentDescription = label }, + ) { Icon(icon, contentDescription = null, tint = colors.onSurface, modifier = Modifier.size(20.dp)) } +} + +@Composable +internal fun NameDialog(title: String, initial: String, confirm: String, onConfirm: (String) -> Boolean, onDismiss: () -> Unit) { + var text by remember { mutableStateOf(initial) } + var invalid by remember { mutableStateOf(false) } + val submit: () -> Unit = { + val ok = onConfirm(text) + if (ok) onDismiss() + invalid = !ok + } + AlertDialog( + onDismissRequest = onDismiss, + title = { Text(title) }, + text = { + Column(verticalArrangement = Arrangement.spacedBy(8.dp)) { + AdbTextField( + value = text, onValueChange = { text = it; invalid = false }, label = stringResource(R.string.soundtracks_collection_name), + keyboardType = KeyboardType.Text, imeAction = ImeAction.Done, focusOnShow = true, onDone = submit, + ) + if (invalid) Text(stringResource(R.string.soundtracks_name_invalid), fontSize = 12.sp, color = MaterialTheme.colorScheme.error) + } + }, + confirmButton = { TextButton(onClick = submit, modifier = Modifier.focusGlide(CircleShape).testTag("name-confirm")) { Text(confirm) } }, + dismissButton = { TextButton(onClick = onDismiss, modifier = Modifier.focusGlide(CircleShape)) { Text(stringResource(R.string.common_cancel)) } }, + ) +} + +@Composable +internal fun ManageDialog(id: Int, games: List, onRemoveMode: () -> Unit, onDismiss: () -> Unit) { + val ctx = LocalContext.current + val name = SoundtrackCollections.snapshot.collections.firstOrNull { it.id == id }?.name.orEmpty() + val favorites = id == SoundtrackCollections.FAVORITES_ID + var renaming by remember { mutableStateOf(false) } + var adding by remember { mutableStateOf(false) } + var deleting by remember { mutableStateOf(false) } + val shown = rememberShown(onDismiss) + val close = { shown.targetState = false } + AppDialog(shown, close, "soundtrackManage", wide = false, maxWidth = 420.dp) { + Column(verticalArrangement = Arrangement.spacedBy(6.dp), modifier = Modifier.fillMaxWidth()) { + DialogTitleRow(stringResource(R.string.soundtracks_manage), onClose = close) + if (!favorites) PickerRow(Icons.Filled.Edit, stringResource(R.string.soundtracks_rename), null) { renaming = true } + PickerRow(Icons.Filled.Add, stringResource(R.string.soundtracks_add_tracks), null) { adding = true } + PickerRow(Icons.Filled.Remove, stringResource(R.string.soundtracks_remove_tracks), null) { onDismiss(); onRemoveMode() } + if (!favorites) PickerRow(Icons.Filled.Delete, stringResource(R.string.soundtracks_delete_collection), null) { deleting = true } + } + } + if (renaming) NameDialog( + stringResource(R.string.soundtracks_rename), name, stringResource(R.string.soundtracks_rename), + onConfirm = { SoundtrackCollections.rename(ctx, id, it) }, onDismiss = { renaming = false }, + ) + if (adding) TrackPickerDialog(id, games) { adding = false } + if (deleting) ConfirmDialog( + title = stringResource(R.string.soundtracks_delete_title, name), text = stringResource(R.string.soundtracks_delete_body), + confirm = stringResource(R.string.common_delete), + onConfirm = { SoundtrackCollections.delete(ctx, id); onDismiss() }, + onDismiss = { deleting = false }, + ) +} + +@Composable +internal fun TrackPickerDialog(id: Int, games: List, onDismiss: () -> Unit) { + val ctx = LocalContext.current + val colors = MaterialTheme.colorScheme + val pal = LocalPalette.current + val hits by produceState?>(null, games) { value = withContext(Dispatchers.IO) { SoundtrackIndex.build(ctx, games) } } + var query by remember { mutableStateOf("") } + var picked by remember { mutableStateOf(setOf()) } + val have = SoundtrackCollections.tracksOf(id).mapTo(HashSet()) { it.path } + val list = hits?.distinctBy { it.ref.path }?.filter { it.ref.path !in have && SoundtrackTracks.matches(query, it.ref.title, it.ref.artist, it.ref.album) } + AlertDialog( + onDismissRequest = onDismiss, + title = { Text(stringResource(R.string.soundtracks_add_tracks)) }, + text = { + Column(verticalArrangement = Arrangement.spacedBy(8.dp)) { + AdbTextField( + value = query, onValueChange = { query = it }, label = "", keyboardType = KeyboardType.Text, imeAction = ImeAction.Search, + placeholder = stringResource(R.string.soundtracks_search_tracks), compact = true, + ) + Row(horizontalArrangement = Arrangement.spacedBy(4.dp), verticalAlignment = Alignment.CenterVertically) { + TextButton(onClick = { picked = picked + list.orEmpty().map { it.ref.path } }, modifier = Modifier.focusGlide(CircleShape)) { + Text(stringResource(R.string.soundtracks_select_all)) + } + TextButton(onClick = { picked = emptySet() }, modifier = Modifier.focusGlide(CircleShape)) { + Text(stringResource(R.string.soundtracks_deselect_all)) + } + } + if (list == null) Text(stringResource(R.string.store_section_loading), fontSize = 13.sp, color = colors.onSurfaceVariant) + else LazyColumn(Modifier.fillMaxWidth().heightIn(max = 340.dp).testTag("track-picker")) { + items(list, key = { it.ref.path }) { hit -> + val on = hit.ref.path in picked + val src = remember { MutableInteractionSource() } + val hot = rememberHot(src) + val toggle = { picked = if (on) picked - hit.ref.path else picked + hit.ref.path } + Row( + verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(10.dp), + modifier = Modifier.fillMaxWidth().clip(RoundedCornerShape(8.dp)).background(if (on) pal.signal.copy(alpha = 0.16f) else if (hot) Color.White.copy(alpha = 0.08f) else Color.Transparent) + .hoverable(src).clickable(interactionSource = src, indication = LocalIndication.current, role = Role.Checkbox, onClick = toggle) + .controllerConfirm(onClick = toggle).padding(horizontal = 8.dp, vertical = 8.dp), + ) { + Icon( + if (on) Icons.Filled.CheckBox else Icons.Filled.CheckBoxOutlineBlank, contentDescription = null, + tint = if (on) pal.signal else colors.onSurfaceVariant, modifier = Modifier.size(20.dp), + ) + Column(Modifier.weight(1f)) { + Text(hit.ref.title, fontSize = 14.sp, color = colors.onSurface, maxLines = 1, overflow = TextOverflow.Ellipsis) + Text( + listOf(hit.ref.album, hit.ref.artist).filter { it.isNotBlank() }.joinToString(" ยท "), + fontSize = 12.sp, color = colors.onSurfaceVariant, maxLines = 1, overflow = TextOverflow.Ellipsis, + ) + } + if (hit.ref.durationMs > 0) Text(Soundtrack.formatLength(hit.ref.durationMs), fontSize = 12.sp, color = colors.onSurfaceVariant, maxLines = 1) + } + } + } + } + }, + confirmButton = { + TextButton( + enabled = picked.isNotEmpty(), + onClick = { + SoundtrackCollections.add(ctx, id, hits.orEmpty().filter { it.ref.path in picked }.map { it.ref }) + onDismiss() + }, + modifier = Modifier.focusGlide(CircleShape).testTag("picker-add"), + ) { Text(stringResource(R.string.soundtracks_add_count, picked.size)) } + }, + dismissButton = { TextButton(onClick = onDismiss, modifier = Modifier.focusGlide(CircleShape)) { Text(stringResource(R.string.common_cancel)) } }, + ) +} diff --git a/app/src/main/java/com/droiddeck/launcher/ui/SoundtrackDetail.kt b/app/src/main/java/com/droiddeck/launcher/ui/SoundtrackDetail.kt new file mode 100644 index 0000000000..896e94c343 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/ui/SoundtrackDetail.kt @@ -0,0 +1,391 @@ +package com.droiddeck.launcher.ui + +import androidx.compose.foundation.LocalIndication +import androidx.compose.foundation.background +import androidx.compose.foundation.clickable +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.Spacer +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.heightIn +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.lazy.LazyColumn +import androidx.compose.foundation.lazy.items +import androidx.compose.foundation.lazy.rememberLazyListState +import androidx.compose.foundation.shape.CircleShape +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.filled.BookmarkBorder +import androidx.compose.material.icons.filled.Favorite +import androidx.compose.material.icons.filled.FavoriteBorder +import androidx.compose.material.icons.filled.Pause +import androidx.compose.material.icons.filled.PlayArrow +import androidx.compose.material.icons.filled.Repeat +import androidx.compose.material.icons.filled.RepeatOne +import androidx.compose.material.icons.filled.Shuffle +import androidx.compose.material.icons.filled.SkipNext +import androidx.compose.material.icons.filled.SkipPrevious +import androidx.compose.material.icons.filled.VolumeOff +import androidx.compose.material.icons.filled.VolumeUp +import androidx.compose.material3.Icon +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Slider +import androidx.compose.material3.SliderDefaults +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableFloatStateOf +import androidx.compose.runtime.mutableIntStateOf +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.produceState +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.focus.FocusRequester +import androidx.compose.ui.focus.focusRequester +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.layout.ContentScale +import androidx.compose.ui.platform.LocalConfiguration +import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.platform.testTag +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.semantics.Role +import androidx.compose.ui.semantics.contentDescription +import androidx.compose.ui.semantics.semantics +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import androidx.media3.common.Player +import coil.compose.AsyncImage +import com.droiddeck.launcher.R +import com.droiddeck.launcher.frontend.Library +import com.droiddeck.launcher.frontend.Soundtrack +import com.droiddeck.launcher.frontend.SoundtrackCollections +import com.droiddeck.launcher.frontend.SoundtrackOrder +import com.droiddeck.launcher.playback.SoundtrackController +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.delay +import kotlinx.coroutines.withContext + +@Composable +internal fun SoundtrackDetail(key: String, s: FrontEndState, a: FrontEndActions, lead: FocusRequester, backLabel: String, onBack: () -> Unit) { + val appId = remember(key) { key.removePrefix("sound:").removePrefix("app:").toIntOrNull() } + val ctx = LocalContext.current + remember { SoundtrackCollections.load(ctx) } + val favoritesLabel = stringResource(R.string.soundtracks_favorites) + val snapshot = SoundtrackCollections.snapshot + val saved = remember(snapshot, favoritesLabel) { SoundtrackCollections.games(ctx, favoritesLabel) } + val game = s.soundtracks.firstOrNull { it.appId == appId } ?: saved.firstOrNull { it.appId == appId } + LaunchedEffect(game == null, s.soundtracksLoaded) { if (game == null && s.soundtracksLoaded) onBack() } + if (game == null) return + val narrow = LocalNarrowPane.current + val stacked = narrow || LocalConfiguration.current.screenWidthDp < 700 + val root = game.gameFiles + val collectionId = if (game.source == Library.SOURCE_COLLECTION) game.appId else null + val target = remember(root, collectionId) { PlayTarget(root, collectionId) } + val loadedAlbum by produceState(null, root, game.art, SoundtrackOrder.version) { + value = root?.let { dir -> withContext(Dispatchers.IO) { Soundtrack.load(ctx, dir, game.art) } } + } + val collectionAlbum = remember(snapshot, collectionId) { collectionId?.let { SoundtrackCollections.album(ctx, it) } } + val album = collectionAlbum ?: loadedAlbum + LaunchedEffect(Unit) { SoundtrackController.connect(ctx) } + val inset = LocalDetailInset.current + val currentTrack = if (target.belongs) SoundtrackController.currentId else null + val trackArt by produceState(null, currentTrack) { + value = currentTrack?.let { id -> withContext(Dispatchers.IO) { Soundtrack.trackCover(ctx, java.io.File(id)) } } + } + val pinned = game.art?.path.orEmpty().let { it.contains("/steam-art/") || it.contains("/soundtrack-art/") } + val art: Any? = if (pinned) game.art else trackArt ?: game.art ?: album?.cover + val refs = remember(snapshot, collectionId) { collectionId?.let { id -> SoundtrackCollections.tracksOf(id).associateBy { it.path } }.orEmpty() } + val coverPath = (game.art ?: album?.cover)?.path.orEmpty() + val refOf: (Soundtrack.Track) -> SoundtrackCollections.TrackRef = { t -> + refs[t.id] ?: SoundtrackCollections.TrackRef(t.id, t.title, t.artist.ifBlank { album?.artist.orEmpty() }, game.name, t.durationMs, coverPath) + } + var selectRequest by remember { mutableIntStateOf(0) } + val onReorder: ((List) -> Unit)? = when { + collectionId != null -> ({ paths: List -> SoundtrackCollections.reorder(ctx, collectionId, paths) }) + game.library == Library.ADDED && root != null -> ({ paths: List -> SoundtrackOrder.set(ctx, root, paths) }) + else -> null + } + GameBackdrop(art, art, hueOf(game.name), fadeTop = inset.top < 8.dp, artBlur = 24.dp) { + Column(Modifier.fillMaxWidth().padding(horizontal = inset.horizontal).padding(top = inset.top)) { + Rise(0) { + Row(Modifier.fillMaxWidth().padding(bottom = 8.dp), verticalAlignment = Alignment.CenterVertically) { + Box(Modifier.glass(CircleShape)) { BackLink(backLabel, compact = true, onClick = onBack) } + Spacer(Modifier.weight(1f)) + SourceBadge(game.source) + } + } + val loaded = album + if (stacked) Column(verticalArrangement = Arrangement.spacedBy(14.dp)) { + Rise(1) { SoundtrackPlayer(game, loaded, art, lead, s, a, target, refOf, collectionId) { selectRequest++ } } + if (loaded != null) Rise(2) { + TrackPanel(loaded, game.name, target, refOf, collectionId, selectRequest, onReorder, Modifier.fillMaxWidth().height((LocalConfiguration.current.screenHeightDp * 0.55f).dp)) + } + } else Row(horizontalArrangement = Arrangement.spacedBy(28.dp), modifier = Modifier.fillMaxWidth()) { + Rise(1, Modifier.weight(0.42f)) { SoundtrackPlayer(game, loaded, art, lead, s, a, target, refOf, collectionId) { selectRequest++ } } + if (loaded != null) Rise(2, Modifier.weight(0.58f)) { + TrackPanel(loaded, game.name, target, refOf, collectionId, selectRequest, onReorder, Modifier.fillMaxWidth().height((LocalConfiguration.current.screenHeightDp * 0.72f).dp)) + } + } + } + } +} + +@Composable +private fun SoundtrackPlayer( + game: Library.SteamGame, album: Soundtrack.Album?, art: Any?, lead: FocusRequester, s: FrontEndState, a: FrontEndActions, + target: PlayTarget, refOf: (Soundtrack.Track) -> SoundtrackCollections.TrackRef, collectionId: Int?, onRemoveMode: () -> Unit, +) { + val ctx = LocalContext.current + val colors = MaterialTheme.colorScheme + val belongs = target.belongs + val playing = belongs && SoundtrackController.playing + val shownArt: Any? = art + var saving by remember { mutableStateOf(false) } + Column(verticalArrangement = Arrangement.spacedBy(14.dp), modifier = Modifier.fillMaxWidth()) { + Row(horizontalArrangement = Arrangement.spacedBy(16.dp), verticalAlignment = Alignment.Top) { + Box(Modifier.size(120.dp).clip(RoundedCornerShape(10.dp)).background(Color.Black.copy(alpha = 0.35f))) { + if (shownArt != null) AsyncImage(shownArt, contentDescription = game.name, contentScale = ContentScale.Fit, modifier = Modifier.matchParentSize().testTag("soundtrack-cover")) + } + Column(verticalArrangement = Arrangement.spacedBy(6.dp), modifier = Modifier.weight(1f)) { + Text( + game.name, fontSize = 22.sp, lineHeight = 26.sp, fontWeight = FontWeight.Black, color = colors.onBackground, + maxLines = 2, overflow = TextOverflow.Ellipsis, + ) + val artist = album?.artist.orEmpty() + if (artist.isNotBlank()) Text(artist, fontSize = 14.sp, color = colors.onBackground.copy(alpha = 0.8f), maxLines = 1, overflow = TextOverflow.Ellipsis) + if (album != null && album.tracks.isNotEmpty()) { + Text( + stringResource(R.string.soundtracks_total_length).uppercase(), fontSize = 11.sp, fontWeight = FontWeight.Bold, letterSpacing = 0.8.sp, + color = colors.onSurfaceVariant, modifier = Modifier.padding(top = 4.dp), + ) + Text( + stringResource(R.string.soundtracks_length_value, album.tracks.size, Soundtrack.formatLength(album.totalMs)), + fontSize = 13.sp, color = colors.onBackground, + ) + } + } + } + Seek(target, album) + val shuffleLabel = stringResource(R.string.soundtracks_shuffle) + val previousLabel = stringResource(R.string.soundtracks_previous) + val playLabel = stringResource(if (playing) R.string.soundtracks_pause else R.string.soundtracks_play) + val nextLabel = stringResource(R.string.soundtracks_next) + val repeatLabel = stringResource( + when (SoundtrackController.repeat) { + Player.REPEAT_MODE_ALL -> R.string.soundtracks_repeat_all + Player.REPEAT_MODE_ONE -> R.string.soundtracks_repeat_one + else -> R.string.soundtracks_repeat_off + }, + ) + val loaded = album?.takeIf { it.tracks.isNotEmpty() } + Row(horizontalArrangement = Arrangement.spacedBy(14.dp, Alignment.CenterHorizontally), verticalAlignment = Alignment.CenterVertically, modifier = Modifier.fillMaxWidth()) { + TransportButton(Icons.Filled.Shuffle, shuffleLabel, "sound:shuffle", on = belongs && SoundtrackController.shuffle, enabled = loaded != null) { + if (loaded == null) return@TransportButton + if (belongs) SoundtrackController.setShuffle(ctx, !SoundtrackController.shuffle) + else SoundtrackController.play(ctx, loaded, game.name, null, shuffled = true, root = target.root, collection = target.collection) + } + TransportButton(Icons.Filled.SkipPrevious, previousLabel, "sound:previous", enabled = loaded != null) { + if (loaded == null) return@TransportButton + if (belongs) SoundtrackController.previous(ctx) else SoundtrackController.play(ctx, loaded, game.name, null, root = target.root, collection = target.collection) + } + TransportButton( + if (playing) Icons.Filled.Pause else Icons.Filled.PlayArrow, playLabel, "sound:play", big = true, enabled = loaded != null, + modifier = Modifier.focusRequester(lead), + ) { + if (loaded != null) SoundtrackController.toggle(ctx, loaded, game.name, target.root, target.collection) + } + TransportButton(Icons.Filled.SkipNext, nextLabel, "sound:next", enabled = loaded != null) { + if (loaded == null) return@TransportButton + if (belongs) SoundtrackController.next(ctx) else SoundtrackController.play(ctx, loaded, game.name, null, root = target.root, collection = target.collection) + } + TransportButton( + if (SoundtrackController.repeat == Player.REPEAT_MODE_ONE) Icons.Filled.RepeatOne else Icons.Filled.Repeat, repeatLabel, "sound:repeat", + on = SoundtrackController.repeat != Player.REPEAT_MODE_OFF, enabled = loaded != null && belongs, + ) { SoundtrackController.cycleRepeat(ctx) } + } + val heartTrack = if (belongs) loaded?.tracks?.firstOrNull { it.id == SoundtrackController.currentId } else null + val liked = heartTrack != null && SoundtrackCollections.snapshot.favorites.any { it.path == heartTrack.id } + Row(Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.End, verticalAlignment = Alignment.CenterVertically) { + TransportButton( + if (liked) Icons.Filled.Favorite else Icons.Filled.FavoriteBorder, stringResource(R.string.soundtracks_add_favorites), "sound:favorite", + on = liked, enabled = heartTrack != null, + ) { heartTrack?.let { SoundtrackCollections.toggleFavorite(ctx, refOf(it)) } } + TransportButton(Icons.Filled.BookmarkBorder, stringResource(R.string.soundtracks_saved), "sound:saved", enabled = heartTrack != null) { saving = true } + } + if (saving && heartTrack != null) SavedDialog(listOf(refOf(heartTrack)), null) { saving = false } + Volume() + Column(verticalArrangement = Arrangement.spacedBy(8.dp), modifier = Modifier.fillMaxWidth().padding(top = 4.dp)) { + SoundtrackActions(game, s, a, collectionId, onRemoveMode) + } + } +} + +@Composable +private fun Seek(target: PlayTarget, album: Soundtrack.Album?) { + val ctx = LocalContext.current + val colors = MaterialTheme.colorScheme + val pal = LocalPalette.current + val belongs = target.belongs + var position by remember { mutableFloatStateOf(0f) } + var dragging by remember { mutableStateOf(false) } + val duration = if (belongs) SoundtrackController.durationMs else 0L + LaunchedEffect(belongs, SoundtrackController.currentId) { + if (!belongs) { + if (!dragging) position = 0f + return@LaunchedEffect + } + while (true) { + if (!dragging) position = SoundtrackController.position().toFloat() + delay(400) + } + } + Column(verticalArrangement = Arrangement.spacedBy(0.dp), modifier = Modifier.fillMaxWidth()) { + Slider( + value = if (duration > 0) (position / duration).coerceIn(0f, 1f) else 0f, + onValueChange = { dragging = true; position = it * duration }, + onValueChangeFinished = { dragging = false; SoundtrackController.seekTo(ctx, position.toLong()) }, + enabled = belongs && duration > 0 && album != null, + colors = SliderDefaults.colors(thumbColor = pal.signal, activeTrackColor = pal.signal, inactiveTrackColor = colors.onBackground.copy(alpha = 0.18f)), + modifier = Modifier.fillMaxWidth().testTag("soundtrack-seek"), + ) + Row(Modifier.fillMaxWidth().padding(horizontal = 4.dp)) { + Text(Soundtrack.formatLength(position.toLong()), fontSize = 11.sp, color = colors.onSurfaceVariant) + Spacer(Modifier.weight(1f)) + Text(Soundtrack.formatLength(duration), fontSize = 11.sp, color = colors.onSurfaceVariant) + } + } +} + +@Composable +private fun Volume() { + val ctx = LocalContext.current + val colors = MaterialTheme.colorScheme + val pal = LocalPalette.current + var level by remember { mutableFloatStateOf(SoundtrackController.volume) } + LaunchedEffect(SoundtrackController.volume) { level = SoundtrackController.volume } + Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(10.dp), modifier = Modifier.fillMaxWidth()) { + Icon(if (level <= 0.001f) Icons.Filled.VolumeOff else Icons.Filled.VolumeUp, contentDescription = stringResource(R.string.soundtracks_volume), tint = colors.onSurfaceVariant, modifier = Modifier.size(20.dp)) + Slider( + value = level, onValueChange = { level = it; SoundtrackController.setVolume(ctx, it) }, + colors = SliderDefaults.colors(thumbColor = pal.signal, activeTrackColor = pal.signal, inactiveTrackColor = colors.onBackground.copy(alpha = 0.18f)), + modifier = Modifier.weight(1f).testTag("soundtrack-volume"), + ) + } +} + +@Composable +private fun TransportButton( + icon: ImageVector, label: String, id: String, big: Boolean = false, on: Boolean = false, enabled: Boolean = true, + modifier: Modifier = Modifier, onClick: () -> Unit, +) { + val colors = MaterialTheme.colorScheme + val pal = LocalPalette.current + val src = remember { MutableInteractionSource() } + val hot = rememberHot(src) && enabled + val size = if (big) 60.dp else 44.dp + val fill = when { + big -> pal.signal.copy(alpha = if (hot) 1f else 0.9f) + hot -> pal.signal.copy(alpha = 0.16f) + else -> Color.Transparent + } + Box( + contentAlignment = Alignment.Center, + modifier = modifier.paneItem(id).testTag(id).size(size).clip(CircleShape).background(fill) + .glideBorder(hot, CircleShape, pal.signal, if (big) Color.Transparent else Color.Transparent) + .hoverable(src).clickable(interactionSource = src, indication = LocalIndication.current, role = Role.Button, enabled = enabled, onClick = onClick) + .controllerConfirm(enabled = enabled, onClick = onClick) + .semantics { contentDescription = label }, + ) { + Icon( + icon, contentDescription = null, + tint = when { + big -> colors.background + !enabled -> colors.onSurfaceVariant.copy(alpha = 0.4f) + on -> pal.signal + else -> colors.onBackground + }, + modifier = Modifier.size(if (big) 34.dp else 26.dp), + ) + } +} + +@Composable +private fun SeeMoreButton(label: String, id: String, danger: Boolean = false, modifier: Modifier = Modifier, onClick: () -> Unit) { + val colors = MaterialTheme.colorScheme + val pal = LocalPalette.current + val src = remember { MutableInteractionSource() } + val hot = rememberHot(src) + val shape = RoundedCornerShape(10.dp) + val accent = if (danger) colors.error else pal.signal + Box( + contentAlignment = Alignment.Center, + modifier = modifier.fillMaxWidth().paneItem(id).testTag(id).heightIn(min = 44.dp).clip(shape) + .background(if (hot) accent.copy(alpha = 0.16f) else Color.White.copy(alpha = 0.09f)) + .glideBorder(hot, shape, accent, Color.White.copy(alpha = 0.10f)) + .hoverable(src).clickable(interactionSource = src, indication = LocalIndication.current, role = Role.Button, onClick = onClick) + .controllerConfirm(onClick = onClick) + .padding(horizontal = 16.dp, vertical = 10.dp), + ) { + Text( + label, fontSize = 14.sp, fontWeight = FontWeight.SemiBold, textAlign = TextAlign.Center, + color = if (danger && hot) colors.error else colors.onBackground, maxLines = 1, overflow = TextOverflow.Ellipsis, + ) + } +} + +@Composable +private fun SoundtrackActions(game: Library.SteamGame, s: FrontEndState, a: FrontEndActions, collectionId: Int?, onRemoveMode: () -> Unit) { + var options by remember { mutableStateOf(false) } + var managing by remember { mutableStateOf(false) } + if (collectionId != null) SeeMoreButton(stringResource(R.string.soundtracks_manage), "sound:manage") { managing = true } + if (managing && collectionId != null) ManageDialog(collectionId, s.soundtracks, onRemoveMode) { managing = false } + SeeMoreButton(stringResource(R.string.soundtracks_options), "sound:options") { options = true } + if (options) SoundtrackOptionsDialog { options = false } + game.gameFiles?.takeIf { it.isDirectory }?.let { dir -> + SeeMoreButton(stringResource(R.string.games_files), "sound:files") { a.onBrowseFiles(dir) } + } + var menu by remember(game.appId) { mutableStateOf(false) } + Box { + SeeMoreButton(stringResource(R.string.game_shortcut), "sound:shortcut") { menu = !menu } + AnchoredMenu(menu, onDismiss = { menu = false }, title = stringResource(R.string.game_shortcut)) { first -> + MenuItem(stringResource(R.string.game_shortcut_add), checked = false, focusRequester = first) { menu = false; a.onGameShortcut(game) } + MenuItem(stringResource(R.string.game_link_copy), checked = false) { menu = false; a.onCopyGameLink(game) } + } + } + var collectionArt by remember(game.appId) { mutableStateOf(false) } + val ownArt = game.library == Library.ADDED + if (ownArt) SeeMoreButton(stringResource(R.string.game_edit_art), "sound:art") { collectionArt = true } + else SeeMoreButton(stringResource(R.string.game_edit_art), "sound:art") { GamesDialogState.steamArt = game } + if (collectionArt && ownArt) CollectionArtEditor( + game.appId, game.name, game.gameFiles, + onClose = { collectionArt = false }, + onChanged = { if (collectionId != null) SoundtrackCollections.refresh() else a.onSoundtracksChanged() }, + ) + if (collectionId != null) return + var asking by remember(game.appId) { mutableStateOf(false) } + val added = game.library == Library.ADDED + val label = stringResource(if (added) R.string.edit_remove else R.string.common_uninstall) + SeeMoreButton(label, "sound:remove", danger = true) { asking = true } + if (asking) ConfirmDialog( + title = if (added) stringResource(R.string.games_remove_title, game.name) else stringResource(R.string.stores_uninstall_title, game.name), + text = if (added) stringResource(R.string.games_remove_body) else stringResource(R.string.games_uninstall_body), + confirm = label, + onConfirm = { a.onSoundtrackRemoved(game) }, + onDismiss = { asking = false }, + ) +} diff --git a/app/src/main/java/com/droiddeck/launcher/ui/SoundtrackIcon.kt b/app/src/main/java/com/droiddeck/launcher/ui/SoundtrackIcon.kt new file mode 100644 index 0000000000..70c1fd0178 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/ui/SoundtrackIcon.kt @@ -0,0 +1,15 @@ +package com.droiddeck.launcher.ui + +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.SolidColor +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.graphics.vector.addPathNodes +import androidx.compose.ui.unit.dp + +private const val NOTES = "M8.4,4.5 L20,2 V6 L8.4,8.5 Z M8.4,4.5 H10.6 V17.5 H8.4 Z M17.9,2 H20 V15.5 H17.9 Z M7.2,14.7 A3.4,2.8 0 1,0 7.2,20.3 A3.4,2.8 0 1,0 7.2,14.7 Z M16.6,12.7 A3.4,2.8 0 1,0 16.6,18.3 A3.4,2.8 0 1,0 16.6,12.7 Z" + +internal val SoundtrackIcon: ImageVector by lazy { + ImageVector.Builder("Soundtrack", 24.dp, 24.dp, 24f, 24f) + .addPath(addPathNodes(NOTES), fill = SolidColor(Color.Black)) + .build() +} diff --git a/app/src/main/java/com/droiddeck/launcher/ui/SoundtrackOptions.kt b/app/src/main/java/com/droiddeck/launcher/ui/SoundtrackOptions.kt new file mode 100644 index 0000000000..dc9fadfa28 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/ui/SoundtrackOptions.kt @@ -0,0 +1,217 @@ +package com.droiddeck.launcher.ui + +import android.media.AudioManager +import android.media.audiofx.BassBoost +import android.media.audiofx.Equalizer +import androidx.compose.foundation.background +import androidx.compose.foundation.horizontalScroll +import androidx.compose.foundation.layout.Arrangement +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.toggleable +import androidx.compose.foundation.shape.CircleShape +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.foundation.verticalScroll +import androidx.compose.material3.AlertDialog +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Slider +import androidx.compose.material3.SliderDefaults +import androidx.compose.material3.Switch +import androidx.compose.material3.Text +import androidx.compose.material3.TextButton +import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableLongStateOf +import androidx.compose.runtime.produceState +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.platform.testTag +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.frontend.Soundtrack +import com.droiddeck.launcher.playback.SoundtrackController +import com.droiddeck.launcher.playback.SoundtrackSettings +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.delay +import kotlinx.coroutines.withContext +import kotlin.math.roundToInt + +private class EqInfo( + val bands: Int, val min: Int, val max: Int, val freqs: List, val presets: List>>, val bassSupported: Boolean, +) + +private fun readEqInfo(audio: AudioManager): EqInfo? = runCatching { + val id = audio.generateAudioSessionId() + val eq = Equalizer(0, id) + try { + val count = eq.numberOfBands.toInt() + val presets = (0 until eq.numberOfPresets.toInt()).map { preset -> + eq.usePreset(preset.toShort()) + eq.getPresetName(preset.toShort()) to (0 until count).map { eq.getBandLevel(it.toShort()).toInt() } + } + val bass = runCatching { BassBoost(0, id).let { b -> try { b.strengthSupported } finally { b.release() } } }.getOrDefault(false) + EqInfo( + count, eq.bandLevelRange[0].toInt(), eq.bandLevelRange[1].toInt(), + (0 until count).map { eq.getCenterFreq(it.toShort()) / 1000 }, presets, bass, + ) + } finally { + eq.release() + } +}.getOrNull() + +@Composable +internal fun SoundtrackOptionsDialog(onDismiss: () -> Unit) { + val ctx = LocalContext.current + LaunchedEffect(Unit) { SoundtrackSettings.load(ctx) } + AlertDialog( + onDismissRequest = onDismiss, + title = { Text(stringResource(R.string.soundtracks_options)) }, + text = { + Column(Modifier.verticalScroll(rememberScrollState()), verticalArrangement = Arrangement.spacedBy(16.dp)) { + RateRow(stringResource(R.string.theme_rgb_speed), SoundtrackSettings.speed, "soundtrack-speed") { SoundtrackController.setSpeed(ctx, it) } + RateRow(stringResource(R.string.soundtracks_pitch), SoundtrackSettings.pitch, "soundtrack-pitch") { SoundtrackController.setPitch(ctx, it) } + SwitchRow(stringResource(R.string.soundtracks_skip_silence), SoundtrackSettings.skipSilence, "soundtrack-skip-silence") { + SoundtrackController.setSkipSilence(ctx, it) + } + SleepSection() + EqualizerSection() + } + }, + confirmButton = { TextButton(onClick = onDismiss, modifier = Modifier.focusGlide(CircleShape)) { Text(stringResource(R.string.common_close)) } }, + ) +} + +@Composable +private fun RateRow(label: String, value: Float, tag: String, onChange: (Float) -> Unit) { + val colors = MaterialTheme.colorScheme + val pal = LocalPalette.current + Column(verticalArrangement = Arrangement.spacedBy(2.dp)) { + Row(verticalAlignment = Alignment.CenterVertically) { + Text(label, fontSize = 14.sp, fontWeight = FontWeight.SemiBold, color = colors.onSurface, modifier = Modifier.weight(1f)) + Text("%.2fร—".format(value), fontSize = 14.sp, color = colors.onSurfaceVariant) + TextButton(onClick = { onChange(1f) }, modifier = Modifier.focusGlide(CircleShape)) { Text(stringResource(R.string.soundtracks_reset)) } + } + Slider( + value = value, onValueChange = { v -> (v * 20f).roundToInt().div(20f).let { if (it != value) onChange(it) } }, + valueRange = SoundtrackSettings.MIN_RATE..SoundtrackSettings.MAX_RATE, steps = 29, + colors = SliderDefaults.colors(thumbColor = pal.signal, activeTrackColor = pal.signal, inactiveTrackColor = colors.onSurface.copy(alpha = 0.18f)), + modifier = Modifier.fillMaxWidth().testTag(tag), + ) + } +} + +@Composable +private fun SwitchRow(label: String, checked: Boolean, tag: String, onChange: (Boolean) -> Unit) { + val colors = MaterialTheme.colorScheme + Row( + verticalAlignment = Alignment.CenterVertically, + modifier = Modifier.fillMaxWidth().focusGlide(RoundedCornerShape(12.dp)).toggleable(checked, role = Role.Switch, onValueChange = onChange).padding(vertical = 4.dp).testTag(tag), + ) { + Text(label, fontSize = 14.sp, fontWeight = FontWeight.SemiBold, color = colors.onSurface, modifier = Modifier.weight(1f)) + Switch(checked = checked, onCheckedChange = null) + } +} + +@Composable +private fun OptionChip(label: String, selected: Boolean, onClick: () -> Unit) { + val colors = MaterialTheme.colorScheme + val pal = LocalPalette.current + val shape = RoundedCornerShape(99.dp) + Text( + label, fontSize = 13.sp, fontWeight = FontWeight.SemiBold, maxLines = 1, + color = if (selected) pal.signal else colors.onSurface, + modifier = Modifier.focusGlide(shape).clip(shape) + .background(if (selected) pal.signal.copy(alpha = 0.18f) else colors.onSurface.copy(alpha = 0.08f)) + .selectable(selected = selected, role = Role.RadioButton, onClick = onClick) + .padding(horizontal = 14.dp, vertical = 8.dp), + ) +} + +@Composable +private fun SleepSection() { + val ctx = LocalContext.current + val colors = MaterialTheme.colorScheme + var left by remember { mutableLongStateOf(0L) } + LaunchedEffect(Unit) { + while (true) { + left = SoundtrackController.sleepRemainingMs() + delay(1000) + } + } + val trackEnd = SoundtrackController.sleepTrackEnd + val timed = left > 0L + Column(verticalArrangement = Arrangement.spacedBy(8.dp)) { + Row(verticalAlignment = Alignment.CenterVertically) { + Text(stringResource(R.string.soundtracks_sleep), fontSize = 14.sp, fontWeight = FontWeight.SemiBold, color = colors.onSurface, modifier = Modifier.weight(1f)) + if (timed) Text(stringResource(R.string.soundtracks_sleep_left, Soundtrack.formatLength(left)), fontSize = 13.sp, color = colors.onSurfaceVariant) + } + Row(Modifier.horizontalScroll(rememberScrollState()), horizontalArrangement = Arrangement.spacedBy(8.dp)) { + OptionChip(stringResource(R.string.perf_cap_off), !timed && !trackEnd) { SoundtrackController.setSleep(ctx, 0) } + for (minutes in listOf(15, 30, 60)) OptionChip(stringResource(R.string.soundtracks_sleep_minutes, minutes), false) { SoundtrackController.setSleep(ctx, minutes) } + OptionChip(stringResource(R.string.soundtracks_sleep_track_end), trackEnd) { SoundtrackController.setSleep(ctx, -1) } + } + } +} + +@Composable +private fun EqualizerSection() { + val ctx = LocalContext.current + val colors = MaterialTheme.colorScheme + val pal = LocalPalette.current + val info by produceState(null) { + value = withContext(Dispatchers.IO) { readEqInfo(ctx.getSystemService(AudioManager::class.java)) } + } + val ready = info + val on = SoundtrackSettings.eqOn + val levels = ready?.let { i -> SoundtrackSettings.bands.takeIf { it.size == i.bands } ?: List(i.bands) { 0 } }.orEmpty() + val bass = SoundtrackSettings.bass + Column(verticalArrangement = Arrangement.spacedBy(8.dp)) { + SwitchRow(stringResource(R.string.soundtracks_equalizer), on && ready != null, "soundtrack-eq") { + if (ready != null) SoundtrackController.setEqualizer(ctx, it, levels, bass) + } + if (ready == null || ready.bands == 0) { + if (ready != null) Text(stringResource(R.string.soundtracks_eq_unavailable), fontSize = 13.sp, color = colors.onSurfaceVariant) + return@Column + } + if (ready.presets.isNotEmpty()) Row(Modifier.horizontalScroll(rememberScrollState()), horizontalArrangement = Arrangement.spacedBy(8.dp)) { + for ((name, preset) in ready.presets) OptionChip(name, on && preset == levels) { SoundtrackController.setEqualizer(ctx, true, preset, bass) } + } + for (band in 0 until ready.bands) { + Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(10.dp)) { + val hz = ready.freqs[band] + Text(if (hz >= 1000) "%.1f kHz".format(hz / 1000f) else "$hz Hz", fontSize = 12.sp, color = colors.onSurfaceVariant, modifier = Modifier.padding(end = 2.dp)) + Slider( + value = levels[band].toFloat(), valueRange = ready.min.toFloat()..ready.max.toFloat(), + onValueChange = { v -> SoundtrackController.setEqualizer(ctx, true, levels.toMutableList().also { it[band] = v.roundToInt() }, bass) }, + colors = SliderDefaults.colors(thumbColor = pal.signal, activeTrackColor = pal.signal, inactiveTrackColor = colors.onSurface.copy(alpha = 0.18f)), + modifier = Modifier.weight(1f).testTag("soundtrack-eq-$band"), + ) + } + } + if (ready.bassSupported) Column { + Text(stringResource(R.string.soundtracks_bass), fontSize = 13.sp, color = colors.onSurfaceVariant) + Slider( + value = bass.toFloat(), valueRange = 0f..1000f, + onValueChange = { v -> SoundtrackController.setEqualizer(ctx, true, levels, v.roundToInt()) }, + colors = SliderDefaults.colors(thumbColor = pal.signal, activeTrackColor = pal.signal, inactiveTrackColor = colors.onSurface.copy(alpha = 0.18f)), + modifier = Modifier.fillMaxWidth().testTag("soundtrack-bass"), + ) + } + TextButton(onClick = { SoundtrackController.setEqualizer(ctx, on, List(ready.bands) { 0 }, 0) }, modifier = Modifier.focusGlide(CircleShape)) { + Text(stringResource(R.string.soundtracks_reset)) + } + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/ui/SoundtrackTrackPanel.kt b/app/src/main/java/com/droiddeck/launcher/ui/SoundtrackTrackPanel.kt new file mode 100644 index 0000000000..c0769536c7 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/ui/SoundtrackTrackPanel.kt @@ -0,0 +1,391 @@ +package com.droiddeck.launcher.ui + +import androidx.activity.compose.BackHandler +import androidx.compose.foundation.ExperimentalFoundationApi +import androidx.compose.foundation.LocalIndication +import androidx.compose.foundation.background +import androidx.compose.foundation.combinedClickable +import androidx.compose.foundation.gestures.detectDragGesturesAfterLongPress +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.layout.size +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.lazy.LazyColumn +import androidx.compose.foundation.lazy.items +import androidx.compose.foundation.lazy.rememberLazyListState +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.shape.CircleShape +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.filled.CheckBox +import androidx.compose.material.icons.filled.CheckBoxOutlineBlank +import androidx.compose.material.icons.filled.PlayArrow +import androidx.compose.material.icons.filled.Sort +import androidx.compose.material3.Icon +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text +import androidx.compose.material3.TextButton +import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableFloatStateOf +import androidx.compose.runtime.mutableIntStateOf +import androidx.compose.runtime.rememberCoroutineScope +import kotlinx.coroutines.launch +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.rememberUpdatedState +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.graphics.graphicsLayer +import androidx.compose.ui.input.pointer.pointerInput +import androidx.compose.ui.zIndex +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.platform.testTag +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.semantics.Role +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.input.ImeAction +import androidx.compose.ui.text.input.KeyboardType +import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import com.droiddeck.launcher.R +import com.droiddeck.launcher.frontend.Soundtrack +import com.droiddeck.launcher.frontend.SoundtrackCollections +import com.droiddeck.launcher.frontend.SoundtrackTracks +import com.droiddeck.launcher.playback.SoundtrackController + +internal class PlayTarget(val root: java.io.File?, val collection: Int?) { + val belongs: Boolean get() = if (collection != null) SoundtrackController.belongsCollection(collection) else SoundtrackController.belongs(root) +} + +private sealed interface SoundRow { + class Disc(val number: Int, val label: String) : SoundRow + class Item(val track: Soundtrack.Track) : SoundRow +} + +private fun rowsOf(album: Soundtrack.Album): List = buildList { + for ((disc, tracks) in album.disc) { + if (album.multiDisc) add(SoundRow.Disc(disc, tracks.firstOrNull()?.discLabel ?: disc.toString())) + tracks.forEach { add(SoundRow.Item(it)) } + } +} + +@Composable +private fun sortLabel(sort: SoundtrackTracks.Sort): String = stringResource( + when (sort) { + SoundtrackTracks.Sort.DEFAULT -> R.string.soundtracks_sort_default + SoundtrackTracks.Sort.TITLE_ASC -> R.string.stores_sort_title_asc + SoundtrackTracks.Sort.TITLE_DESC -> R.string.stores_sort_title_desc + SoundtrackTracks.Sort.LONGEST -> R.string.soundtracks_sort_longest + SoundtrackTracks.Sort.SHORTEST -> R.string.soundtracks_sort_shortest + }, +) + +@Composable +internal fun TrackPanel( + album: Soundtrack.Album, title: String, target: PlayTarget, refOf: (Soundtrack.Track) -> SoundtrackCollections.TrackRef, + collectionId: Int?, selectRequest: Int, onReorder: ((List) -> Unit)?, modifier: Modifier, +) { + val ctx = LocalContext.current + val colors = MaterialTheme.colorScheme + var query by remember { mutableStateOf("") } + var sort by remember { mutableStateOf(SoundtrackTracks.Sort.DEFAULT) } + var sortMenu by remember { mutableStateOf(false) } + var selecting by remember { mutableStateOf(false) } + var picked by remember { mutableStateOf(setOf()) } + var saving by remember { mutableStateOf(false) } + val leave: () -> Unit = { + selecting = false + picked = emptySet() + } + LaunchedEffect(selectRequest) { if (selectRequest > 0) selecting = true } + BackHandler(enabled = selecting) { leave() } + val rows: List = remember(album, query, sort) { + if (sort == SoundtrackTracks.Sort.DEFAULT && query.isBlank()) rowsOf(album) + else SoundtrackTracks.sort( + album.tracks.filter { SoundtrackTracks.matches(query, it.title, it.artist) }, sort, { it.title }, { it.durationMs }, + ).map { SoundRow.Item(it) } + } + val rowIds = rows.filterIsInstance().map { it.track.id } + var working by remember(rowIds) { mutableStateOf?>(null) } + val display = working ?: rows + val canReorder = onReorder != null && sort == SoundtrackTracks.Sort.DEFAULT && query.isBlank() && selecting + var dragId by remember { mutableStateOf(null) } + var dragTotal by remember { mutableFloatStateOf(0f) } + var dragTo by remember { mutableIntStateOf(0) } + val numbers = remember(display) { + val out = HashMap() + var n = 0 + for (row in display) { + if (row is SoundRow.Disc) n = 0 + else if (row is SoundRow.Item) out[row.track.id] = ++n + } + out + } + val state = rememberLazyListState() + val scope = rememberCoroutineScope() + val drag = remember { DragState() } + fun applyDrag() { + drag.total = drag.total.coerceIn((drag.lo - drag.from) * drag.size, (drag.hi - drag.from) * drag.size) + dragTotal = drag.total + dragTo = dragTarget(drag.total, drag.size, drag.from, drag.lo, drag.hi) + } + val finishDrag: () -> Unit = { + if (dragId != null) { + val from = drag.from + val to = dragTo + if (to != from && from in drag.base.indices) { + val moved = drag.base.toMutableList().apply { add(to, removeAt(from)) } + val index = state.firstVisibleItemIndex + val offset = state.firstVisibleItemScrollOffset + working = moved + scope.launch { state.scrollToItem(index, offset) } + onReorder?.invoke(moved.filterIsInstance().map { it.track.id }) + } + dragId = null + dragTotal = 0f + dragTo = from + } + } + val rowsNow by rememberUpdatedState(rows) + val finishNow by rememberUpdatedState(finishDrag) + val current = if (target.belongs) SoundtrackController.currentId else null + var scrolledTo by remember { mutableStateOf(null) } + LaunchedEffect(album, current) { + if (current == null) { + scrolledTo = null + return@LaunchedEffect + } + if (dragId != null || current == scrolledTo) return@LaunchedEffect + val at = rows.indexOfFirst { it is SoundRow.Item && it.track.id == current } + if (at >= 0) { + scrolledTo = current + state.animateScrollToItem(at) + } + } + val chosen = album.tracks.filter { it.id in picked }.map(refOf) + Column(modifier) { + Row(Modifier.fillMaxWidth().padding(bottom = 8.dp), verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(6.dp)) { + Box(Modifier.weight(1f)) { + AdbTextField( + value = query, onValueChange = { query = it }, label = "", keyboardType = KeyboardType.Text, imeAction = ImeAction.Search, + placeholder = stringResource(R.string.soundtracks_search_tracks), compact = true, + ) + } + Box { + HeaderIconButton(stringResource(R.string.stores_sort), Icons.Filled.Sort, "tracks-sort") { sortMenu = !sortMenu } + AnchoredMenu(sortMenu, onDismiss = { sortMenu = false }, title = stringResource(R.string.stores_sort)) { first -> + SoundtrackTracks.Sort.values().forEachIndexed { i, option -> + MenuItem(sortLabel(option), checked = option == sort, focusRequester = if (i == 0) first else null) { + sort = option + sortMenu = false + } + } + } + } + HeaderIconButton(stringResource(R.string.soundtracks_select), Icons.Filled.CheckBox, "tracks-select") { + if (selecting) leave() else selecting = true + } + } + if (selecting) Row( + Modifier.fillMaxWidth().horizontalScroll(rememberScrollState()).padding(bottom = 6.dp), + horizontalArrangement = Arrangement.spacedBy(2.dp), verticalAlignment = Alignment.CenterVertically, + ) { + Text(stringResource(R.string.soundtracks_selected, picked.size), fontSize = 13.sp, color = colors.onSurfaceVariant, modifier = Modifier.padding(horizontal = 6.dp)) + TextButton(onClick = { picked = rowIds.toSet() }, modifier = Modifier.focusGlide(CircleShape).testTag("tracks-select-all")) { + Text(stringResource(R.string.soundtracks_select_all)) + } + TextButton(onClick = { picked = emptySet() }, modifier = Modifier.focusGlide(CircleShape).testTag("tracks-deselect-all")) { + Text(stringResource(R.string.soundtracks_deselect_all)) + } + TextButton(enabled = picked.isNotEmpty(), onClick = { saving = true }, modifier = Modifier.focusGlide(CircleShape).testTag("tracks-add-collection")) { + Text(stringResource(R.string.soundtracks_add_to_collection)) + } + TextButton( + enabled = picked.isNotEmpty(), + onClick = { + SoundtrackCollections.add(ctx, SoundtrackCollections.FAVORITES_ID, chosen) + leave() + }, + modifier = Modifier.focusGlide(CircleShape).testTag("tracks-add-favorites"), + ) { Text(stringResource(R.string.soundtracks_add_favorites)) } + if (collectionId != null) TextButton( + enabled = picked.isNotEmpty(), + onClick = { + SoundtrackCollections.remove(ctx, collectionId, picked) + leave() + }, + modifier = Modifier.focusGlide(CircleShape).testTag("tracks-remove"), + ) { Text(stringResource(R.string.soundtracks_remove_from_collection)) } + TextButton(onClick = leave, modifier = Modifier.focusGlide(CircleShape)) { Text(stringResource(R.string.common_cancel)) } + } + if (display.isEmpty()) Text( + stringResource(if (album.tracks.isEmpty()) R.string.soundtracks_no_tracks else R.string.stores_nothing_matches), + fontSize = 13.sp, color = colors.onSurfaceVariant, modifier = Modifier.padding(top = 12.dp), + ) + else LazyColumn( + state = state, + modifier = Modifier.weight(1f).fillMaxWidth().clip(RoundedCornerShape(10.dp)).background(Color.Black.copy(alpha = 0.28f)).testTag("soundtrack-tracks"), + ) { + items(display, key = { if (it is SoundRow.Item) it.track.id else "disc-${(it as SoundRow.Disc).number}" }) { row -> + when (row) { + is SoundRow.Disc -> Text( + stringResource(R.string.soundtracks_disc, row.label), fontSize = 13.sp, fontWeight = FontWeight.Bold, color = colors.onBackground, + modifier = Modifier.fillMaxWidth().background(Color.White.copy(alpha = 0.12f)).padding(horizontal = 12.dp, vertical = 8.dp), + ) + is SoundRow.Item -> { + val id = row.track.id + val flip = { picked = if (id in picked) picked - id else picked + id } + val dragging = dragId == id + val draggable = canReorder && id in picked + val shift = if (!canReorder) Modifier else Modifier + .zIndex(if (dragging) 1f else 0f) + .graphicsLayer { + translationY = when { + dragId == null -> 0f + dragId == id -> dragTotal + else -> { + val at = drag.index[id] ?: -1 + val f = drag.from + val t = dragTo + if (at < 0) 0f + else if (f < t && at in (f + 1)..t) -drag.size + else if (t < f && at in t until f) drag.size + else 0f + } + } + } + val dragModifier = if (!draggable) shift else shift + .pointerInput(id) { + detectDragGesturesAfterLongPress( + onDragStart = { + val base = working ?: rowsNow + val from = base.indexOfFirst { it is SoundRow.Item && it.track.id == id } + if (from >= 0) { + val disc = (base[from] as SoundRow.Item).track.disc + var lo = from + while (lo > 0 && (base[lo - 1] as? SoundRow.Item)?.track?.disc == disc) lo-- + var hi = from + while (hi < base.lastIndex && (base[hi + 1] as? SoundRow.Item)?.track?.disc == disc) hi++ + val visible = state.layoutInfo.visibleItemsInfo + val me = visible.firstOrNull { it.key == id } + val next = visible.firstOrNull { it.index == (me?.index ?: -2) + 1 && it.key != "disc-0" && base.getOrNull(from + 1) is SoundRow.Item } + val prev = visible.firstOrNull { it.index == (me?.index ?: -2) - 1 && base.getOrNull(from - 1) is SoundRow.Item } + val pitch = when { + me != null && next != null -> (next.offset - me.offset).toFloat() + me != null && prev != null -> (me.offset - prev.offset).toFloat() + else -> me?.size?.toFloat() ?: 0f + } + drag.base = base + drag.index = HashMap().also { m -> base.forEachIndexed { i, r -> if (r is SoundRow.Item) m[r.track.id] = i } } + drag.from = from + drag.lo = lo + drag.hi = hi + drag.size = if (pitch > 0f) pitch else 1f + drag.total = 0f + dragTotal = 0f + dragTo = from + dragId = id + } + }, + onDrag = { change, amount -> + change.consume() + if (dragId == id) { + drag.total += amount.y + applyDrag() + } + }, + onDragEnd = { finishNow() }, + onDragCancel = { finishNow() }, + ) + } + TrackRow( + row.track, numbers[id] ?: row.track.number, dragging, dragModifier, id == current, selecting, id in picked, + onClick = { + if (selecting) flip() + else if (id == current) SoundtrackController.toggle(ctx, album, title, target.root, target.collection) + else SoundtrackController.play(ctx, album, title, id, root = target.root, collection = target.collection) + }, + onLongClick = if (draggable) null else ({ + if (selecting) flip() + else { + selecting = true + picked = setOf(id) + } + }), + ) + } + } + } + } + } + if (saving) SavedDialog(chosen, null) { + saving = false + leave() + } +} + +@OptIn(ExperimentalFoundationApi::class) +@Composable +private fun TrackRow( + track: Soundtrack.Track, number: Int, dragging: Boolean, extra: Modifier, current: Boolean, selecting: Boolean, selected: Boolean, + onClick: () -> Unit, onLongClick: (() -> Unit)?, +) { + val colors = MaterialTheme.colorScheme + val pal = LocalPalette.current + val src = remember { MutableInteractionSource() } + val hot = rememberHot(src) + val shape = RoundedCornerShape(8.dp) + val tint = if (current) pal.signal else colors.onBackground + Row( + verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(10.dp), + modifier = extra.fillMaxWidth().padding(horizontal = 4.dp, vertical = 1.dp).clip(shape) + .background(if (dragging) pal.signal.copy(alpha = 0.32f) else if (selected) pal.signal.copy(alpha = 0.24f) else if (current) pal.signal.copy(alpha = 0.14f) else if (hot) Color.White.copy(alpha = 0.08f) else Color.Transparent) + .glideBorder(hot, shape, pal.signal, Color.Transparent) + .hoverable(src) + .combinedClickable(interactionSource = src, indication = LocalIndication.current, role = Role.Button, onLongClick = onLongClick, onClick = onClick) + .controllerConfirm(onClick = onClick) + .padding(horizontal = 10.dp, vertical = 9.dp), + ) { + Box(Modifier.width(28.dp), contentAlignment = Alignment.CenterEnd) { + when { + selecting -> Icon( + if (selected) Icons.Filled.CheckBox else Icons.Filled.CheckBoxOutlineBlank, contentDescription = null, + tint = if (selected) pal.signal else colors.onSurfaceVariant, modifier = Modifier.size(20.dp), + ) + current && SoundtrackController.playing -> Icon(Icons.Filled.PlayArrow, contentDescription = null, tint = tint, modifier = Modifier.size(16.dp)) + else -> Text("$number.", fontSize = 13.sp, color = if (current) pal.signal else colors.onSurfaceVariant, maxLines = 1) + } + } + Text( + track.title, fontSize = 14.sp, color = tint, fontWeight = if (current) FontWeight.SemiBold else FontWeight.Normal, + maxLines = 1, overflow = TextOverflow.Ellipsis, modifier = Modifier.weight(1f), + ) + if (track.durationMs > 0) Text(Soundtrack.formatLength(track.durationMs), fontSize = 13.sp, color = colors.onSurfaceVariant, maxLines = 1) + } +} + +private class DragState { + var base: List = emptyList() + var index: Map = emptyMap() + var from = 0 + var lo = 0 + var hi = 0 + var size = 1f + var total = 0f +} + +internal fun dragTarget(total: Float, size: Float, from: Int, lo: Int, hi: Int): Int = + (from + Math.round(total / size)).coerceIn(lo, hi) diff --git a/app/src/main/java/com/droiddeck/launcher/ui/StoragePage.kt b/app/src/main/java/com/droiddeck/launcher/ui/StoragePage.kt index 04ff93efc9..1333172d7a 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/StoragePage.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/StoragePage.kt @@ -17,6 +17,7 @@ import androidx.compose.foundation.interaction.collectIsHoveredAsState import androidx.compose.foundation.interaction.collectIsPressedAsState import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.BoxWithConstraints import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.ExperimentalLayoutApi import androidx.compose.foundation.layout.FlowRow @@ -86,6 +87,9 @@ import com.droiddeck.launcher.storage.Bucket import com.droiddeck.launcher.storage.CleanItem import com.droiddeck.launcher.storage.ComponentUsage import com.droiddeck.launcher.storage.GameUsage +import com.droiddeck.launcher.storage.KeptPrefix +import com.droiddeck.launcher.storage.PrefixOwner +import com.droiddeck.launcher.storage.StoreGameUsage import com.droiddeck.launcher.storage.StorageReport import com.droiddeck.launcher.storage.StorageState import com.droiddeck.launcher.storage.ToolReason @@ -148,6 +152,7 @@ internal fun StoragePanel(s: FrontEndState, a: FrontEndActions) { "data" -> GameDataView(report, s.sessionRunning) { view = "overview" } "components" -> ComponentsView(report, s.sessionRunning) { view = "overview" } "desktop" -> DesktopView(report, s.sessionRunning) { view = "overview" } + "stores" -> StoreGamesView(report, s.sessionRunning) { view = "overview" } "tools" -> ToolsView(report, s.sessionRunning) { view = "overview" } else -> Overview(report, s.sessionRunning, onCleanUp = { cleanup = true }, onOpen = { view = it }) } @@ -260,12 +265,23 @@ private fun DefaultStorageGroup() { } } -@OptIn(ExperimentalLayoutApi::class) @Composable private fun Overview(report: StorageReport, sessionRunning: Boolean, onCleanUp: () -> Unit, onOpen: (String) -> Unit) { + val narrowPane = LocalNarrowPane.current + BoxWithConstraints(Modifier.fillMaxWidth()) { + val wide = !narrowPane && maxWidth >= WIDE_OVERVIEW + Column { OverviewContent(report, sessionRunning, wide, onCleanUp, onOpen) } + } +} + +private val WIDE_OVERVIEW = 700.dp +private val NARROW_ROW = 640.dp + +@OptIn(ExperimentalLayoutApi::class) +@Composable +private fun OverviewContent(report: StorageReport, sessionRunning: Boolean, wide: Boolean, onCleanUp: () -> Unit, onOpen: (String) -> Unit) { val colors = MaterialTheme.colorScheme val pal = LocalPalette.current - val wide = !LocalNarrowPane.current val used = report.total - report.free val safe = StorageState.safeBytes(report) val low = report.free < StorageState.LOW_SPACE_BYTES @@ -275,7 +291,7 @@ private fun Overview(report: StorageReport, sessionRunning: Boolean, onCleanUp: val usage: @Composable (Modifier) -> Unit = { m -> Column(m) { FlowRow(verticalArrangement = Arrangement.spacedBy(4.dp), horizontalArrangement = Arrangement.spacedBy(8.dp)) { Text(stringResource(R.string.storage_internal), fontSize = 17.sp, fontWeight = FontWeight.Bold, color = colors.onBackground) - Text("ยท " + stringResource(R.string.storage_used_of, gb(used), gb(report.total)), fontSize = 15.sp, color = colors.onSurfaceVariant) + Text(stringResource(R.string.storage_used_of, gb(used), gb(report.total)), fontSize = 15.sp, color = colors.onSurfaceVariant) Pill(stringResource(R.string.storage_free, gb(report.free)), if (low) AttentionAmber else pal.good) } val time = DateFormat.getTimeInstance(DateFormat.SHORT).format(Date(report.at)) @@ -294,7 +310,7 @@ private fun Overview(report: StorageReport, sessionRunning: Boolean, onCleanUp: Text(stringResource(R.string.storage_safe_now), fontSize = 13.sp, color = colors.onSurfaceVariant) Text(gb(safe), fontSize = 26.sp, fontWeight = FontWeight.Bold, color = if (safe > 0) pal.good else colors.onBackground) Text(stringResource(R.string.storage_safe_hint), fontSize = 12.sp, color = colors.onSurfaceVariant, modifier = Modifier.padding(bottom = 10.dp)) - PrimaryButton(stringResource(R.string.storage_clean_up), enabled = !sessionRunning && !StorageState.cleaning, compact = true, onClick = onCleanUp) + PrimaryButton(stringResource(R.string.storage_clean_up), enabled = !sessionRunning && !StorageState.busy, compact = true, onClick = onCleanUp) } } if (wide) Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(18.dp), modifier = summary) { usage(Modifier.weight(1f)) @@ -338,7 +354,8 @@ private fun Overview(report: StorageReport, sessionRunning: Boolean, onCleanUp: }, { m -> BucketCard(Bucket.STORES, Icons.Outlined.ShoppingBag, stringResource(R.string.storage_stores), - stringResource(R.string.storage_stores_hint), report.buckets.getValue(Bucket.STORES), m) + pluralStringResource(R.plurals.storage_games_installed, report.storeGames.size, report.storeGames.size), + report.buckets.getValue(Bucket.STORES), m) { onOpen("stores") } }, { m -> BucketCard(Bucket.DESKTOP, Icons.Outlined.Monitor, stringResource(R.string.storage_desktop), @@ -485,7 +502,7 @@ private fun CleanUpDialog(report: StorageReport, sessionRunning: Boolean, onDism } }, confirmButton = { - if (picked.isNotEmpty() && !sessionRunning && !StorageState.cleaning) { + if (picked.isNotEmpty() && !sessionRunning && !StorageState.busy) { FocusText(stringResource(R.string.storage_free_button, gb(total)), pal.signal) { StorageState.clean(ctx, picked) { onDismiss() } } @@ -501,8 +518,6 @@ private fun CleanUpDialog(report: StorageReport, sessionRunning: Boolean, onDism private fun CleanRow(item: CleanItem, report: StorageReport, on: Boolean, modifier: Modifier, onToggle: () -> Unit) { val colors = MaterialTheme.colorScheme val pal = LocalPalette.current - val src = remember { MutableInteractionSource() } - val hot = src.collectIsFocusedAsState().value || src.collectIsHoveredAsState().value val unsureCount = report.leftovers.count { !it.safe } val safeCount = report.leftovers.count { it.safe } val oldTools = report.unusedTools.filter { it.reason != ToolReason.CUSTOM } @@ -517,6 +532,23 @@ private fun CleanRow(item: CleanItem, report: StorageReport, on: Boolean, modifi CleanItem.UNUSED_COMPONENTS -> Triple(stringResource(R.string.storage_item_components), unusedLabels.joinToString(", "), 1) CleanItem.SHADERS -> Triple(stringResource(R.string.storage_item_shaders), stringResource(R.string.storage_item_shaders_detail), 2) } + ToggleRow( + title, detail, StorageState.bytes(report, item), on, modifier, + when (tag) { + 0 -> stringResource(R.string.storage_tag_safe) to pal.good + 1 -> stringResource(R.string.storage_tag_unused) to colors.onSurfaceVariant + else -> stringResource(if (item == CleanItem.SHADERS) R.string.storage_tag_stutter else R.string.storage_tag_saves) to AttentionAmber + }, + onToggle, + ) +} + +@Composable +private fun ToggleRow(title: String, detail: String, bytes: Long, on: Boolean, modifier: Modifier, pill: Pair, onToggle: () -> Unit) { + val colors = MaterialTheme.colorScheme + val pal = LocalPalette.current + val src = remember { MutableInteractionSource() } + val hot = src.collectIsFocusedAsState().value || src.collectIsHoveredAsState().value val shape = RoundedCornerShape(12.dp) Row( verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(12.dp), @@ -535,16 +567,12 @@ private fun CleanRow(item: CleanItem, report: StorageReport, on: Boolean, modifi ) { if (on) Icon(Icons.Filled.Check, contentDescription = null, tint = Color.White, modifier = Modifier.size(16.dp)) } Column(Modifier.weight(1f)) { Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(8.dp)) { - Text(title, fontSize = 14.sp, fontWeight = FontWeight.SemiBold, color = colors.onBackground, maxLines = 1, overflow = TextOverflow.Ellipsis, modifier = Modifier.weight(1f, fill = false)) - when (tag) { - 0 -> Pill(stringResource(R.string.storage_tag_safe), pal.good) - 1 -> Pill(stringResource(R.string.storage_tag_unused), colors.onSurfaceVariant) - else -> Pill(stringResource(if (item == CleanItem.SHADERS) R.string.storage_tag_stutter else R.string.storage_tag_saves), AttentionAmber) - } + Text(title, fontSize = 14.sp, fontWeight = FontWeight.SemiBold, color = colors.onBackground, maxLines = 2, overflow = TextOverflow.Ellipsis, modifier = Modifier.weight(1f, fill = false)) + Pill(pill.first, pill.second) } Text(detail, fontSize = 12.sp, color = colors.onSurfaceVariant, maxLines = 2, overflow = TextOverflow.Ellipsis) } - Text(gb(StorageState.bytes(report, item)), fontSize = 14.sp, fontWeight = FontWeight.SemiBold, color = colors.onBackground) + Text(gb(bytes), fontSize = 14.sp, fontWeight = FontWeight.SemiBold, color = colors.onBackground) } } @@ -583,6 +611,8 @@ private fun GamesView(report: StorageReport, sessionRunning: Boolean, a: FrontEn Column(Modifier.fillMaxWidth().clip(Shape14).background(colors.surface).border(1.dp, pal.line, Shape14)) { if (games.isEmpty()) Text(stringResource(R.string.storage_no_games), fontSize = 14.sp, color = colors.onSurfaceVariant, modifier = Modifier.padding(16.dp)) games.forEachIndexed { i, g -> + BoxWithConstraints(Modifier.fillMaxWidth()) { + val narrow = maxWidth < NARROW_ROW Row( verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(14.dp), modifier = Modifier.fillMaxWidth().padding(horizontal = 14.dp, vertical = 8.dp), @@ -594,13 +624,14 @@ private fun GamesView(report: StorageReport, sessionRunning: Boolean, a: FrontEn Text(gameName(g), fontSize = 15.sp, fontWeight = FontWeight.SemiBold, color = colors.onBackground, maxLines = 1, overflow = TextOverflow.Ellipsis) Text( listOfNotNull( + stringResource(R.string.storage_game_parts, gb(g.game), gb(g.data)).takeIf { narrow }, g.library.takeIf { !g.internal }, if (g.lastPlayed > 0) stringResource(R.string.storage_played, DateFormat.getDateInstance(DateFormat.MEDIUM).format(Date(g.lastPlayed * 1000))) else stringResource(R.string.storage_never_played), ).joinToString(" ยท "), - fontSize = 12.sp, color = colors.onSurfaceVariant, maxLines = 1, overflow = TextOverflow.Ellipsis, + fontSize = 12.sp, color = colors.onSurfaceVariant, maxLines = if (narrow) 2 else 1, overflow = TextOverflow.Ellipsis, ) } - Column(Modifier.weight(1f)) { + if (!narrow) Column(Modifier.weight(1f)) { Row(Modifier.fillMaxWidth().height(8.dp).clip(RoundedCornerShape(4.dp)).background(Color(0xFF0A0C0F))) { listOf(g.game to BucketColors.getValue(Bucket.GAMES), g.prefix to BucketColors.getValue(Bucket.GAME_DATA), (g.shaders + g.workshop) to Color(0xFFC5B8FF)) .forEach { (v, c) -> if (v > 0) Box(Modifier.weight(v.toFloat() / max).fillMaxHeight().background(c)) } @@ -615,6 +646,7 @@ private fun GamesView(report: StorageReport, sessionRunning: Boolean, a: FrontEn Text(gb(g.total), fontSize = 16.sp, fontWeight = FontWeight.SemiBold, color = colors.onBackground, modifier = Modifier.widthIn(min = 72.dp)) SecondaryButton(stringResource(R.string.storage_uninstall), compact = true, enabled = !sessionRunning) { confirm = g } } + } if (i < games.lastIndex) Box(Modifier.fillMaxWidth().height(1.dp).background(pal.line)) } } @@ -662,7 +694,7 @@ private fun ToolsView(report: StorageReport, sessionRunning: Boolean, onBack: () stringResource(R.string.storage_tools_detail, gb(report.tools.sumOf { it.bytes }), gb(unused.sumOf { it.bytes })), onBack, ) { if (unused.isNotEmpty()) PrimaryButton(stringResource(R.string.storage_remove_unused, gb(unused.sumOf { it.bytes })), compact = true, - enabled = !sessionRunning && !StorageState.cleaning) { confirmAll = true } + enabled = !sessionRunning && !StorageState.busy) { confirmAll = true } } if (sessionRunning) { Note(stringResource(R.string.storage_session_running)); Spacer(Modifier.height(4.dp)) } SectionTitle(stringResource(R.string.storage_in_use), null) @@ -714,6 +746,7 @@ private fun toolDetail(t: ToolUsage): String = when (t.reason) { ToolReason.ARM_RUNTIME -> stringResource(R.string.storage_tool_arm_runtime) ToolReason.REDISTRIBUTABLES -> stringResource(R.string.storage_tool_redist) ToolReason.FEX -> stringResource(R.string.storage_tool_fex) + ToolReason.ANTICHEAT_RUNTIME -> stringResource(R.string.storage_tool_anticheat) ToolReason.STEAM_TOOL -> stringResource(R.string.storage_tool_steam) ToolReason.OLD_RUNTIME -> stringResource(R.string.storage_tool_old_runtime) ToolReason.X86_PROTON -> stringResource(R.string.storage_tool_x86_proton) @@ -730,26 +763,22 @@ private fun toolDetail(t: ToolUsage): String = when (t.reason) { private fun ToolList(tools: List, sessionRunning: Boolean, onRemove: (ToolUsage) -> Unit) { val colors = MaterialTheme.colorScheme val pal = LocalPalette.current - Column(Modifier.fillMaxWidth().clip(Shape14).background(colors.surface).border(1.dp, pal.line, Shape14)) { + ListCard { tools.forEachIndexed { i, t -> - Row( - verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(12.dp), - modifier = Modifier.fillMaxWidth().heightIn(min = 56.dp).padding(horizontal = 14.dp, vertical = 8.dp), - ) { - Column(Modifier.weight(1f)) { - Text(t.name, fontSize = 15.sp, fontWeight = FontWeight.SemiBold, color = colors.onBackground, maxLines = 1, overflow = TextOverflow.Ellipsis) - Text(toolDetail(t), fontSize = 12.5.sp, color = colors.onSurfaceVariant, maxLines = 1, overflow = TextOverflow.Ellipsis) - } - when (t.state) { - ToolState.IN_USE -> Pill(if (t.isDefault) stringResource(R.string.storage_tag_default) else pluralStringResource(R.plurals.storage_tag_games, t.games, t.games), pal.signal) - ToolState.REQUIRED -> Pill(stringResource(R.string.storage_tag_required), colors.onSurfaceVariant) - ToolState.UNUSED -> Pill(stringResource(R.string.storage_tag_not_used), AttentionAmber) - } - Text(gb(t.bytes), fontSize = 15.sp, fontWeight = FontWeight.SemiBold, color = colors.onBackground, modifier = Modifier.widthIn(min = 70.dp)) - if (t.state == ToolState.UNUSED) SecondaryButton(stringResource(R.string.storage_remove), compact = true, enabled = !sessionRunning && !StorageState.cleaning) { onRemove(t) } - else Icon(Icons.Outlined.Lock, contentDescription = null, tint = colors.onSurfaceVariant, modifier = Modifier.size(16.dp)) - } - if (i < tools.lastIndex) Box(Modifier.fillMaxWidth().height(1.dp).background(pal.line)) + ItemRow( + t.name, toolDetail(t), t.bytes, i == tools.lastIndex, + pill = { + when (t.state) { + ToolState.IN_USE -> Pill(if (t.isDefault) stringResource(R.string.storage_tag_default) else pluralStringResource(R.plurals.storage_tag_games, t.games, t.games), pal.signal) + ToolState.REQUIRED -> Pill(stringResource(R.string.storage_tag_required), colors.onSurfaceVariant) + ToolState.UNUSED -> Pill(stringResource(R.string.storage_tag_not_used), AttentionAmber) + } + }, + action = { + if (t.state == ToolState.UNUSED) SecondaryButton(stringResource(R.string.storage_remove), compact = true, enabled = !sessionRunning && !StorageState.busy) { onRemove(t) } + else Icon(Icons.Outlined.Lock, contentDescription = null, tint = colors.onSurfaceVariant, modifier = Modifier.size(16.dp)) + }, + ) } } } @@ -810,24 +839,72 @@ private fun ListCard(content: @Composable () -> Unit) { } @Composable -private fun ItemRow(title: String, detail: String?, bytes: Long, last: Boolean, pill: (@Composable () -> Unit)? = null, action: (@Composable () -> Unit)? = null) { +private fun ItemRow( + title: String, detail: String?, bytes: Long, last: Boolean, pill: (@Composable () -> Unit)? = null, + selected: Boolean? = null, onSelect: () -> Unit = {}, selectable: Boolean = true, slot: Boolean = false, + stack: Boolean = pill != null, action: (@Composable () -> Unit)? = null, +) { val colors = MaterialTheme.colorScheme val pal = LocalPalette.current - Row( - verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(12.dp), - modifier = Modifier.fillMaxWidth().heightIn(min = 56.dp).padding(horizontal = 14.dp, vertical = 8.dp), - ) { - Column(Modifier.weight(1f)) { - Text(title, fontSize = 15.sp, fontWeight = FontWeight.SemiBold, color = colors.onBackground, maxLines = 1, overflow = TextOverflow.Ellipsis) - if (detail != null) Text(detail, fontSize = 12.5.sp, color = colors.onSurfaceVariant, maxLines = 1, overflow = TextOverflow.Ellipsis) + BoxWithConstraints(Modifier.fillMaxWidth()) { + val tight = maxWidth < NARROW_ROW + val narrow = tight && stack + val size = @Composable { + Text(if (bytes < 0) "โ€ฆ" else gb(bytes), fontSize = 15.sp, fontWeight = FontWeight.SemiBold, color = colors.onBackground, + modifier = if (narrow) Modifier else Modifier.widthIn(min = 70.dp)) + } + Column(Modifier.fillMaxWidth().heightIn(min = 56.dp).padding(horizontal = 14.dp, vertical = 8.dp), verticalArrangement = Arrangement.spacedBy(6.dp)) { + Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(12.dp)) { + if (selected != null) SelectBox(selected, selectable, onSelect) else if (slot) Spacer(Modifier.size(40.dp)) + Column(Modifier.weight(1f)) { + Text(title, fontSize = 15.sp, fontWeight = FontWeight.SemiBold, color = colors.onBackground, maxLines = if (narrow) 2 else 1, overflow = TextOverflow.Ellipsis) + if (detail != null) Text(detail, fontSize = 12.5.sp, color = colors.onSurfaceVariant, maxLines = if (tight) 2 else 1, overflow = TextOverflow.Ellipsis) + } + if (narrow) size() else { + pill?.invoke() + size() + action?.invoke() + } + } + if (narrow) Row( + verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(8.dp, Alignment.End), + modifier = Modifier.fillMaxWidth(), + ) { + pill?.invoke() + action?.invoke() + } } - pill?.invoke() - Text(gb(bytes), fontSize = 15.sp, fontWeight = FontWeight.SemiBold, color = colors.onBackground, modifier = Modifier.widthIn(min = 70.dp)) - action?.invoke() } if (!last) Box(Modifier.fillMaxWidth().height(1.dp).background(pal.line)) } +@Composable +private fun SelectBox(on: Boolean, enabled: Boolean, onToggle: () -> Unit) { + val colors = MaterialTheme.colorScheme + val pal = LocalPalette.current + val src = remember { MutableInteractionSource() } + val hot = enabled && (src.collectIsFocusedAsState().value || src.collectIsHoveredAsState().value) + val shape = RoundedCornerShape(6.dp) + val edge = when { + on || hot -> pal.signal + enabled -> colors.onSurfaceVariant + else -> colors.onSurfaceVariant.copy(alpha = 0.35f) + } + Box( + contentAlignment = Alignment.Center, + modifier = Modifier.size(40.dp).clip(RoundedCornerShape(10.dp)) + .background(if (hot) pal.signal.copy(alpha = 0.12f) else Color.Transparent) + .then(if (enabled) Modifier.hoverable(src) + .clickable(interactionSource = src, indication = LocalIndication.current, role = Role.Checkbox, onClick = onToggle) + .controllerConfirm(onClick = onToggle) else Modifier), + ) { + Box( + contentAlignment = Alignment.Center, + modifier = Modifier.size(22.dp).clip(shape).background(if (on) pal.signal else Color.Transparent).border(2.dp, edge, shape), + ) { if (on) Icon(Icons.Filled.Check, contentDescription = null, tint = Color.White, modifier = Modifier.size(16.dp)) } + } +} + @Composable private fun ConfirmDialog(title: String, body: String, confirm: String, danger: Boolean = true, onConfirm: () -> Unit, onDismiss: () -> Unit) { val colors = MaterialTheme.colorScheme @@ -845,22 +922,53 @@ private fun ConfirmDialog(title: String, body: String, confirm: String, danger: ) } +private class DataTarget(val key: String, val label: String, val prefixes: List>, val shaders: List>) + @Composable private fun GameDataView(report: StorageReport, sessionRunning: Boolean, onBack: () -> Unit) { val ctx = LocalContext.current - val busy = sessionRunning || StorageState.cleaning + val busy = sessionRunning || StorageState.busy var confirm by remember { mutableStateOf(null) } var confirmPrefix by remember { mutableStateOf(null) } - SubHeader(stringResource(R.string.storage_game_data), stringResource(R.string.storage_game_data_hint, gb(report.prefixes), gb(report.workshop), gb(report.shaders)), onBack) + var confirmKept by remember { mutableStateOf(null) } + var picked by remember { mutableStateOf(emptySet()) } + var confirmBulk by remember { mutableStateOf(false) } + val games = report.games.filter { it.data >= ONE_MB || it.prefixDir != null }.sortedByDescending { it.data } + val leftovers = report.leftovers.sortedByDescending { it.bytes } + val safe = leftovers.filter { it.safe } + val unsure = leftovers.filter { !it.safe } + val kept = report.kept.filter { it.bytes + it.shaderBytes >= ONE_MB }.sortedByDescending { it.bytes + it.shaderBytes } + val safeLabel = pluralStringResource(R.plurals.storage_item_leftovers_detail, safe.size, safe.size) + val gameNames = games.associate { gameKey(it) to gameName(it) } + val unsureNames = unsure.associate { leftoverKey(it) to leftoverName(it) } + val keptNames = kept.associate { it.dir.path to keptName(it) } + val targets = buildList { + games.forEach { g -> + add(DataTarget(gameKey(g), gameNames[gameKey(g)].orEmpty(), + listOfNotNull(g.prefixDir?.let { it to g.prefix }), g.shaderDirs.takeIf { g.shaders > 0 }.orEmpty().mapIndexed { i, d -> d to if (i == 0) g.shaders else 0L })) + } + if (safe.isNotEmpty()) add(DataTarget("safe", safeLabel, safe.mapNotNull { l -> l.prefix?.let { it to l.prefixBytes } }, safe.mapNotNull { l -> l.shaders?.let { it to l.bytes - l.prefixBytes } })) + unsure.forEach { l -> add(DataTarget("left:${leftoverKey(l)}", unsureNames[leftoverKey(l)].orEmpty(), listOfNotNull(l.prefix?.let { it to l.prefixBytes }), listOfNotNull(l.shaders?.let { it to l.bytes - l.prefixBytes }))) } + kept.filter { it.owner == PrefixOwner.SHARED || it.owner == PrefixOwner.GAME } + .forEach { k -> add(DataTarget("kept:${k.dir.path}", keptNames[k.dir.path].orEmpty(), listOf(k.dir to k.bytes), listOfNotNull(k.shaders?.let { it to k.shaderBytes }))) } + }.associateBy { it.key } + val chosen = picked.mapNotNull { targets[it] } + fun bytesOf(t: DataTarget, prefixes: Boolean, shaders: Boolean): Long = + (if (prefixes) t.prefixes.sumOf { it.second } else 0L) + (if (shaders) t.shaders.sumOf { it.second } else 0L) + fun toggle(key: String) { picked = if (key in picked) picked - key else picked + key } + SubHeader(stringResource(R.string.storage_game_data), stringResource(R.string.storage_game_data_hint, gb(report.prefixes), gb(report.workshop), gb(report.shaders)), onBack) { + if (chosen.isNotEmpty()) PrimaryButton(stringResource(R.string.storage_remove_selected, gb(chosen.sumOf { bytesOf(it, true, true) })), compact = true, enabled = !busy) { confirmBulk = true } + } ActionStatus() if (sessionRunning) { Note(stringResource(R.string.storage_session_running)); Spacer(Modifier.height(4.dp)) } - val games = report.games.filter { it.data >= ONE_MB || it.prefixDir != null }.sortedByDescending { it.data } SectionTitle(stringResource(R.string.storage_data_installed), gb(games.sumOf { it.data })) ListCard { if (games.isEmpty()) Text(stringResource(R.string.storage_no_games), fontSize = 14.sp, color = MaterialTheme.colorScheme.onSurfaceVariant, modifier = Modifier.padding(16.dp)) games.forEachIndexed { i, g -> + val key = gameKey(g) ItemRow( gameName(g), stringResource(R.string.storage_data_parts, gb(g.prefix), gb(g.shaders), gb(g.workshop)), g.data, i == games.lastIndex, + selected = key in picked, selectable = !busy && (g.prefixDir != null || g.shaders > 0), onSelect = { toggle(key) }, stack = true, action = { Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) { SecondaryButton(stringResource(R.string.storage_clear_shaders), compact = true, enabled = !busy && g.shaders >= ONE_MB) { StorageState.clearShaders(ctx, g.appId, g.x64) } @@ -870,33 +978,73 @@ private fun GameDataView(report: StorageReport, sessionRunning: Boolean, onBack: ) } } - val leftovers = report.leftovers.sortedByDescending { it.bytes } if (!report.leftoversChecked) { SectionTitle(stringResource(R.string.storage_data_leftovers), null) Note(stringResource(R.string.storage_leftovers_unchecked)) } if (leftovers.isNotEmpty()) { SectionTitle(stringResource(R.string.storage_data_leftovers), gb(leftovers.sumOf { it.bytes })) - val safe = leftovers.filter { it.safe } ListCard { if (safe.isNotEmpty()) ItemRow( - pluralStringResource(R.plurals.storage_item_leftovers_detail, safe.size, safe.size), null, safe.sumOf { it.bytes }, leftovers.none { !it.safe }, + safeLabel, null, safe.sumOf { it.bytes }, unsure.isEmpty(), pill = { Pill(stringResource(R.string.storage_tag_safe), LocalPalette.current.good) }, + selected = "safe" in picked, selectable = !busy, onSelect = { toggle("safe") }, action = { SecondaryButton(stringResource(R.string.storage_remove), compact = true, enabled = !busy) { StorageState.clean(ctx, setOf(CleanItem.LEFTOVERS)) { } } }, ) - val unsure = leftovers.filter { !it.safe } unsure.forEachIndexed { i, l -> + val key = "left:${leftoverKey(l)}" ItemRow( - stringResource(R.string.storage_steam_app, l.appId), stringResource(R.string.storage_leftover_unsure_detail), l.bytes, i == unsure.lastIndex, + leftoverName(l), stringResource(R.string.storage_leftover_unsure_detail), l.bytes, i == unsure.lastIndex, pill = { Pill(stringResource(R.string.storage_tag_saves), AttentionAmber) }, + selected = key in picked, selectable = !busy, onSelect = { toggle(key) }, action = { SecondaryButton(stringResource(R.string.storage_remove), compact = true, enabled = !busy) { confirm = l } }, ) } } } - if (report.otherPrefixes > 0) { - SectionTitle(stringResource(R.string.storage_data_other), null) - ListCard { ItemRow(stringResource(R.string.storage_data_other_title), stringResource(R.string.storage_data_other_detail), report.otherPrefixes, true) } + if (kept.isNotEmpty()) { + SectionTitle(stringResource(R.string.storage_data_other), gb(kept.sumOf { it.bytes + it.shaderBytes })) + ListCard { + kept.forEachIndexed { i, k -> + val resettable = k.owner == PrefixOwner.SHARED || k.owner == PrefixOwner.GAME + val key = "kept:${k.dir.path}" + ItemRow( + keptName(k), + listOfNotNull(when (k.owner) { + PrefixOwner.SHARED -> stringResource(R.string.storage_shared_prefix_detail) + PrefixOwner.LAUNCHER -> if (k.users.isEmpty()) stringResource(R.string.storage_launcher_prefix) + else stringResource(R.string.storage_launcher_used_by, k.users.distinct().joinToString(", ")) + PrefixOwner.GAME -> stringResource(R.string.storage_prefix_shaders, gb(k.bytes), gb(k.shaderBytes)) + PrefixOwner.UNKNOWN -> stringResource(R.string.storage_unknown_prefix_detail) + }, k.shaderBytes.takeIf { it >= ONE_MB && k.owner != PrefixOwner.GAME }?.let { stringResource(R.string.storage_bulk_shaders) + "ย " + gb(it).replace(' ', 'ย ') }).joinToString(" ยท "), + k.bytes + k.shaderBytes, i == kept.lastIndex, + pill = if (k.owner == PrefixOwner.LAUNCHER) { { Pill(stringResource(R.string.storage_tag_required), MaterialTheme.colorScheme.onSurfaceVariant) } } else null, + selected = if (resettable) key in picked else null, slot = true, selectable = !busy, onSelect = { toggle(key) }, + action = if (resettable) { + { SecondaryButton(stringResource(R.string.storage_reset_prefix), compact = true, enabled = !busy) { confirmKept = k } } + } else null, + ) + } + } + } + if (confirmBulk) BulkRemoveDialog( + chosen, + hasPrefixes = chosen.any { it.prefixes.isNotEmpty() }, hasShaders = chosen.any { it.shaders.isNotEmpty() }, + bytesOf = ::bytesOf, + onConfirm = { prefixes, shaders -> + StorageState.removeDirs(ctx, chosen.flatMap { (if (prefixes) it.prefixes.map { p -> p.first } else emptyList()) + (if (shaders) it.shaders.map { c -> c.first } else emptyList()) }) + picked = emptySet() + }, + onDismiss = { confirmBulk = false }, + ) + confirmKept?.let { k -> + ConfirmDialog( + stringResource(R.string.storage_reset_prefix_title, keptName(k)), + if (k.owner == PrefixOwner.SHARED) stringResource(R.string.storage_reset_shared_confirm, gb(k.bytes)) + else stringResource(R.string.storage_reset_prefix_confirm, gb(k.bytes), k.library), + stringResource(R.string.storage_reset_prefix), + onConfirm = { StorageState.resetKept(ctx, k) }, onDismiss = { confirmKept = null }, + ) } confirmPrefix?.let { g -> ConfirmDialog( @@ -907,19 +1055,125 @@ private fun GameDataView(report: StorageReport, sessionRunning: Boolean, onBack: } confirm?.let { l -> ConfirmDialog( - stringResource(R.string.storage_remove_title, stringResource(R.string.storage_steam_app, l.appId)), + stringResource(R.string.storage_remove_title, leftoverName(l)), stringResource(R.string.storage_leftover_confirm, gb(l.bytes)), stringResource(R.string.storage_remove), onConfirm = { StorageState.removeLeftover(ctx, l) }, onDismiss = { confirm = null }, ) } } +@Composable +private fun BulkRemoveDialog( + chosen: List, hasPrefixes: Boolean, hasShaders: Boolean, bytesOf: (DataTarget, Boolean, Boolean) -> Long, + onConfirm: (prefixes: Boolean, shaders: Boolean) -> Unit, onDismiss: () -> Unit, +) { + val colors = MaterialTheme.colorScheme + val pal = LocalPalette.current + var prefixes by remember { mutableStateOf(hasPrefixes) } + var shaders by remember { mutableStateOf(hasShaders) } + val total = chosen.sumOf { bytesOf(it, prefixes, shaders) } + val first = remember { FocusRequester() } + LaunchedEffect(Unit) { runCatching { first.requestFocus() } } + AlertDialog( + properties = androidx.compose.ui.window.DialogProperties(usePlatformDefaultWidth = false), + modifier = Modifier.fillMaxWidth(0.62f).widthIn(min = 420.dp, max = 760.dp), + onDismissRequest = onDismiss, + title = { Text(stringResource(R.string.storage_remove_selected, gb(total))) }, + text = { + Column(Modifier.verticalScroll(rememberScrollState()), verticalArrangement = Arrangement.spacedBy(8.dp)) { + Text(chosen.joinToString("\n") { "โ€ข " + it.label }, fontSize = 14.sp, color = colors.onBackground) + Spacer(Modifier.height(4.dp)) + if (hasPrefixes) ToggleRow( + stringResource(R.string.storage_bulk_prefixes), stringResource(R.string.storage_bulk_prefixes_detail), + chosen.sumOf { bytesOf(it, true, false) }, prefixes, Modifier.focusRequester(first), + stringResource(R.string.storage_tag_saves) to AttentionAmber, + ) { prefixes = !prefixes } + if (hasShaders) ToggleRow( + stringResource(R.string.storage_bulk_shaders), stringResource(R.string.storage_item_shaders_detail), + chosen.sumOf { bytesOf(it, false, true) }, shaders, if (hasPrefixes) Modifier else Modifier.focusRequester(first), + stringResource(R.string.storage_tag_stutter) to AttentionAmber, + ) { shaders = !shaders } + } + }, + confirmButton = { + if (prefixes || shaders) FocusText(stringResource(R.string.storage_remove), colors.error) { onDismiss(); onConfirm(prefixes, shaders) } + }, + dismissButton = { FocusText(stringResource(R.string.common_cancel), colors.onBackground, onClick = onDismiss) }, + ) +} + +private fun gameKey(g: com.droiddeck.launcher.storage.GameUsage) = "game:${g.x64}:${g.appId}:${g.prefixDir?.path}" + +private fun leftoverKey(l: com.droiddeck.launcher.storage.Leftover) = l.prefix?.path ?: l.shaders?.path ?: l.appId.toString() + +@Composable +private fun keptName(k: KeptPrefix): String { + val name = when (k.owner) { + PrefixOwner.SHARED -> stringResource(R.string.storage_shared_prefix) + PrefixOwner.GAME -> k.name ?: stringResource(R.string.storage_data_other_title) + else -> k.name ?: k.dir.name + } + return if (k.x64) stringResource(R.string.storage_game_x64, name) else name +} + +@Composable +private fun leftoverName(l: com.droiddeck.launcher.storage.Leftover): String = when { + l.name != null -> l.name + l.shortcut -> stringResource(R.string.storage_shortcut_app, l.appId.toString()) + else -> stringResource(R.string.storage_steam_app, l.appId) +} + +@Composable +private fun StoreGamesView(report: StorageReport, sessionRunning: Boolean, onBack: () -> Unit) { + val ctx = LocalContext.current + val uninstalling = com.droiddeck.launcher.stores.StoresState.uninstalling + val busy = sessionRunning || StorageState.busy || uninstalling.isNotEmpty() + var confirm by remember { mutableStateOf>(emptyList()) } + var picked by remember { mutableStateOf(emptySet()) } + val games = report.storeGames + val chosen = games.filter { it.game.folder.path in picked && !com.droiddeck.launcher.stores.download.DownloadQueue.isActive(it.game.key) } + SubHeader(stringResource(R.string.storage_stores), + pluralStringResource(R.plurals.storage_games_installed, games.size, games.size) + " ยท " + gb(games.sumOf { StorageState.storeBytes(it).coerceAtLeast(0) }), onBack) { + if (chosen.isNotEmpty()) PrimaryButton(stringResource(R.string.storage_uninstall_selected, gb(chosen.sumOf { StorageState.storeBytes(it).coerceAtLeast(0) })), compact = true, enabled = !busy) { confirm = chosen } + } + ActionStatus() + if (sessionRunning) { Note(stringResource(R.string.storage_session_running)); Spacer(Modifier.height(4.dp)) } + ListCard { + if (games.isEmpty()) Text(stringResource(R.string.storage_no_games), fontSize = 14.sp, color = MaterialTheme.colorScheme.onSurfaceVariant, modifier = Modifier.padding(16.dp)) + games.forEachIndexed { i, g -> + val removing = g.game.key in uninstalling + val downloading = com.droiddeck.launcher.stores.download.DownloadQueue.isActive(g.game.key) + val key = g.game.folder.path + ItemRow( + g.game.sidecar.title, + if (g.internal) g.game.sidecar.store.label else g.game.sidecar.store.label + " ยท " + stringResource(R.string.fm_drive_sd), + StorageState.storeBytes(g), i == games.lastIndex, + selected = key in picked && !downloading, selectable = !busy && !downloading, onSelect = { picked = if (key in picked) picked - key else picked + key }, + action = { + SecondaryButton(stringResource(if (removing) R.string.stores_uninstalling else R.string.storage_uninstall), compact = true, + enabled = !busy && !downloading) { confirm = listOf(g) } + }, + ) + } + } + if (confirm.isNotEmpty()) { + val list = confirm + val total = gb(list.sumOf { StorageState.storeBytes(it).coerceAtLeast(0) }) + ConfirmDialog( + if (list.size == 1) stringResource(R.string.stores_uninstall_title, list[0].game.sidecar.title) else stringResource(R.string.storage_uninstall_selected, total), + (if (list.size == 1) "" else list.joinToString("\n") { "โ€ข " + it.game.sidecar.title } + "\n\n") + stringResource(R.string.stores_uninstall_body_size, total), + stringResource(R.string.storage_uninstall), + onConfirm = { StorageState.uninstallStoreGames(ctx, list); picked = emptySet() }, onDismiss = { confirm = emptyList() }, + ) + } +} + @Composable internal fun ComponentsView(report: StorageReport, sessionRunning: Boolean, onBack: () -> Unit) { val ctx = LocalContext.current val pal = LocalPalette.current val colors = MaterialTheme.colorScheme - val busy = sessionRunning || StorageState.cleaning + val busy = sessionRunning || StorageState.busy var confirm by remember { mutableStateOf(null) } var confirmAll by remember { mutableStateOf(false) } val unused = report.unusedComponents @@ -977,7 +1231,7 @@ internal fun ComponentsView(report: StorageReport, sessionRunning: Boolean, onBa @Composable private fun DesktopView(report: StorageReport, sessionRunning: Boolean, onBack: () -> Unit) { val ctx = LocalContext.current - val busy = sessionRunning || StorageState.cleaning + val busy = sessionRunning || StorageState.busy var confirm by remember { mutableStateOf(null) } var confirmPrune by remember { mutableStateOf(false) } SubHeader(stringResource(R.string.storage_desktop), stringResource(R.string.storage_desktop_detail, gb(report.flatpak)), onBack) { diff --git a/app/src/main/java/com/droiddeck/launcher/ui/StoreChips.kt b/app/src/main/java/com/droiddeck/launcher/ui/StoreChips.kt index 1d2aef9d6e..3921df7f32 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/StoreChips.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/StoreChips.kt @@ -25,6 +25,8 @@ internal const val FLATHUB = "flathub" internal class SourceColours(val fill: Color, val ink: Color, val dot: Color) +internal val FavoritesColours = SourceColours(Color(0xFF3D1A26), Color(0xFFFFB3C8), Color(0xFFFF5C8A)) + internal fun sourceColours(source: String): SourceColours = when (source) { Store.GOG.id -> SourceColours(Color(0xFF3A1A3C), Color(0xFFE6A3EA), Color(0xFFC25BC8)) Store.EPIC.id -> SourceColours(Color(0xFF2A2A2A), Color(0xFFDDDDDD), Color(0xFFBDBDBD)) @@ -33,7 +35,11 @@ internal fun sourceColours(source: String): SourceColours = when (source) { Store.ITCH.id -> SourceColours(Color(0xFF3A1A1E), Color(0xFFFFB3B3), Color(0xFFFF5C5C)) Store.GAMEJOLT.id -> SourceColours(Color(0xFF232E00), Color(0xFFE3FF66), Color(0xFFCCFF00)) Store.BATTLENET.id -> SourceColours(Color(0xFF0A2440), Color(0xFF9DD1FF), Color(0xFF148EFF)) + Store.UBISOFT.id -> SourceColours(Color(0xFF0B1E44), Color(0xFFA8C6FF), Color(0xFF2E7DFF)) + Store.EA.id -> SourceColours(Color(0xFF3A0E12), Color(0xFFFF9A9A), Color(0xFFFF4747)) + Store.ROCKSTAR.id -> SourceColours(Color(0xFF3A2A06), Color(0xFFFFD780), Color(0xFFFCAF17)) Library.SOURCE_STEAM -> SourceColours(Color(0xFF16293D), Color(0xFF7CC4FF), Color(0xFF1A9FFF)) + Library.SOURCE_COLLECTION -> SourceColours(Color(0xFF2B1A3D), Color(0xFFD2A8FF), Color(0xFFA25BFF)) FLATHUB -> SourceColours(Color(0xFF0B2E2B), Color(0xFF9FE3DD), FlathubTeal) else -> SourceColours(Color(0xFF1A1D22), Color(0xFF9AA3AF), Color(0xFF9AA3AF)) } @@ -41,6 +47,7 @@ internal fun sourceColours(source: String): SourceColours = when (source) { @Composable internal fun sourceLabel(source: String): String = when (source) { Library.SOURCE_STEAM -> stringResource(R.string.source_steam) + Library.SOURCE_COLLECTION -> stringResource(R.string.soundtracks_collections) Store.GOG.id -> Store.GOG.label Store.EPIC.id -> Store.EPIC.label Store.AMAZON.id -> Store.AMAZON.label @@ -48,14 +55,17 @@ internal fun sourceLabel(source: String): String = when (source) { Store.ITCH.id -> Store.ITCH.label Store.GAMEJOLT.id -> Store.GAMEJOLT.label Store.BATTLENET.id -> Store.BATTLENET.label + Store.UBISOFT.id -> Store.UBISOFT.shortLabel + Store.EA.id -> Store.EA.label + Store.ROCKSTAR.id -> Store.ROCKSTAR.shortLabel else -> stringResource(R.string.source_added) } @Composable -internal fun SourceChip(source: String, small: Boolean = false, modifier: Modifier = Modifier) { - val c = sourceColours(source) +internal fun SourceChip(source: String, small: Boolean = false, modifier: Modifier = Modifier, label: String? = null, colours: SourceColours? = null) { + val c = colours ?: sourceColours(source) Text( - sourceLabel(source), fontSize = if (small) 10.sp else 11.sp, fontWeight = FontWeight.Bold, letterSpacing = 0.4.sp, + label ?: sourceLabel(source), fontSize = if (small) 10.sp else 11.sp, fontWeight = FontWeight.Bold, letterSpacing = 0.4.sp, color = c.ink, maxLines = 1, modifier = modifier.clip(RoundedCornerShape(6.dp)).background(c.fill) .padding(horizontal = if (small) 6.dp else 8.dp, vertical = if (small) 1.dp else 2.dp), diff --git a/app/src/main/java/com/droiddeck/launcher/ui/StoresDownloads.kt b/app/src/main/java/com/droiddeck/launcher/ui/StoresDownloads.kt index 8988e16a17..0b1000e6e3 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/StoresDownloads.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/StoresDownloads.kt @@ -85,6 +85,7 @@ import com.droiddeck.launcher.R import com.droiddeck.launcher.session.SessionPrefs import com.droiddeck.launcher.stores.CatalogItem import com.droiddeck.launcher.stores.StoreLanguage +import com.droiddeck.launcher.stores.Store import com.droiddeck.launcher.stores.StoresState import com.droiddeck.launcher.stores.download.DownloadEntry import com.droiddeck.launcher.stores.download.DownloadQueue diff --git a/app/src/main/java/com/droiddeck/launcher/ui/StoresPage.kt b/app/src/main/java/com/droiddeck/launcher/ui/StoresPage.kt index c5f31f5d32..e5005a018e 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/StoresPage.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/StoresPage.kt @@ -13,6 +13,7 @@ import androidx.compose.material.icons.outlined.Folder import androidx.compose.material.icons.outlined.SdCard import androidx.compose.material.icons.outlined.Smartphone import androidx.compose.runtime.CompositionLocalProvider +import androidx.compose.ui.focus.FocusRequester import androidx.compose.ui.focus.focusProperties import androidx.compose.ui.focus.focusRequester import androidx.compose.ui.focus.onFocusChanged @@ -1072,12 +1073,20 @@ internal fun ModeHeader( var searching by remember { mutableStateOf(query.isNotEmpty()) } var focusOnOpen by remember { mutableStateOf(false) } val open by animateFloatAsState(if (searching) 1f else 0f, Motion.sp(0.75f, 420f), label = "searchOpen") + // Closing takes the field away with focus still in it; the search button gets it once it is back on screen. + val searchIcon = remember { FocusRequester() } + var toIcon by remember { mutableStateOf(false) } val close = { searching = false focusOnOpen = false + toIcon = true if (query.isNotEmpty()) onQuery("") } BackHandler(enabled = searching && !clearSearchFocus) { close() } + LaunchedEffect(toIcon, searching, open <= 0.01f) { + if (searching) toIcon = false + else if (toIcon && open <= 0.01f) { focusSoon { searchIcon }; toIcon = false } + } val heading: @Composable () -> Unit = { if (lead != null) lead() else Text( @@ -1093,7 +1102,7 @@ internal fun ModeHeader( Box(Modifier.width(w).graphicsLayer { alpha = (open * 1.6f).coerceAtMost(1f) }) { AdbTextField( value = query, onValueChange = onQuery, label = "", keyboardType = KeyboardType.Text, imeAction = ImeAction.Search, - placeholder = placeholder, compact = true, focusOnShow = focusOnOpen, + placeholder = placeholder, compact = true, showLabel = false, focusOnShow = focusOnOpen, clearFocus = clearSearchFocus || !searching, onFocusChange = { focused -> if (!focused && query.isEmpty()) { searching = false; focusOnOpen = false } }, ) @@ -1103,7 +1112,7 @@ internal fun ModeHeader( } } val searchButton: @Composable () -> Unit = { - SearchIcon(stringResource(R.string.stores_search_open)) { searching = true; focusOnOpen = true } + Box(Modifier.focusRequester(searchIcon)) { SearchIcon(stringResource(R.string.stores_search_open)) { searching = true; focusOnOpen = true } } } BoxWithConstraints(Modifier.fillMaxWidth()) { val stacked = maxWidth < NarrowPaneWidth @@ -1157,6 +1166,9 @@ internal fun storePalette(base: Palette, store: Store?): Palette { Store.ITCH -> Color(0xFFFF5C5C) to Color(0xFFD93B3B) Store.GAMEJOLT -> Color(0xFFCCFF00) to Color(0xFFA3CC00) Store.BATTLENET -> Color(0xFF148EFF) to Color(0xFF0B6BD3) + Store.UBISOFT -> Color(0xFF2E7DFF) to Color(0xFF1A5BD6) + Store.EA -> Color(0xFFFF4747) to Color(0xFFE03030) + Store.ROCKSTAR -> Color(0xFFFCAF17) to Color(0xFFD98E00) null -> return base } val on = if (accent.luminance() > 0.18f) Color(0xFF0B0B0D) else Color.White diff --git a/app/src/main/java/com/droiddeck/launcher/ui/TabsSettings.kt b/app/src/main/java/com/droiddeck/launcher/ui/TabsSettings.kt new file mode 100644 index 0000000000..475c400b16 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/ui/TabsSettings.kt @@ -0,0 +1,269 @@ +package com.droiddeck.launcher.ui + +import android.view.KeyEvent +import androidx.compose.foundation.background +import androidx.compose.foundation.focusable +import androidx.compose.foundation.gestures.awaitEachGesture +import androidx.compose.foundation.gestures.awaitFirstDown +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.Spacer +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.relocation.BringIntoViewRequester +import androidx.compose.foundation.relocation.bringIntoViewRequester +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.filled.DragHandle +import androidx.compose.material3.Icon +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.key +import androidx.compose.runtime.mutableFloatStateOf +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.rememberUpdatedState +import androidx.compose.runtime.setValue +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.alpha +import androidx.compose.ui.focus.focusProperties +import androidx.compose.ui.focus.onFocusChanged +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.graphicsLayer +import androidx.compose.ui.input.InputMode +import androidx.compose.ui.input.key.onPreviewKeyEvent +import androidx.compose.ui.input.pointer.PointerEventPass +import androidx.compose.ui.input.pointer.pointerInput +import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.platform.LocalDensity +import androidx.compose.ui.platform.LocalInputModeManager +import androidx.compose.ui.platform.testTag +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import androidx.compose.ui.zIndex +import com.droiddeck.launcher.R +import com.droiddeck.launcher.agent.AgentTab +import kotlin.math.roundToInt + +private const val MORE_LINE = "|more|" +private val TAB_ROW = 52.dp +private val TAB_HANDLE = 44.dp + +internal fun tabRows(bar: List, more: List) = bar + MORE_LINE + more + +internal fun moveTabRow(rows: List, key: String, step: Int): List? { + val from = rows.indexOf(key) + val to = from + step + if (from < 0 || to !in rows.indices) return null + return rows.toMutableList().apply { add(to, removeAt(from)) } +} + +@OptIn(androidx.compose.foundation.ExperimentalFoundationApi::class) +@Composable +internal fun TabsSettingsGroup(host: MenuHost, s: FrontEndState, a: FrontEndActions) { + val ctx = LocalContext.current + val reveal = remember { BringIntoViewRequester() } + LaunchedEffect(Unit) { + if (!SetupTabs.focusTabs) return@LaunchedEffect + SetupTabs.focusTabs = false + androidx.compose.runtime.withFrameNanos { } + reveal.bringIntoView() + } + val pad = LocalInputModeManager.current.inputMode == InputMode.Keyboard + val state by rememberUpdatedState(s) + val rows = { + val keys = NavTabs.listed(state) + tabRows(keys.filter { it !in NavTabs.shelved }, keys.filter { it in NavTabs.shelved }) + } + val commit = { next: List -> + val split = next.indexOf(MORE_LINE) + NavTabs.rearrange(ctx, state, next.subList(0, split), next.subList(split + 1, next.size)) + } + fun setShown(key: String, show: Boolean) { + when (key) { + "stores" -> if (show != s.gameStoresEnabled) a.onGameStoresEnabled(show) + "soundtracks" -> if (show != s.soundtracksEnabled) a.onSoundtracksEnabled(show) + "agent" -> if (show != AgentTab.shown) AgentTab.set(ctx, show) + } + NavTabs.setHidden(ctx, key, !show) + } + + var dragging by remember { mutableStateOf(null) } + var dragOffset by remember { mutableFloatStateOf(0f) } + var grabbed by remember { mutableStateOf(null) } + var before by remember { mutableStateOf>(emptyList()) } + var focused by remember { mutableStateOf(null) } + val rowPx = with(LocalDensity.current) { TAB_ROW.toPx() } + val handlePx = with(LocalDensity.current) { TAB_HANDLE.toPx() } + val list = rows() + + Box(Modifier.bringIntoViewRequester(reveal)) { + SettingsGroup(stringResource(R.string.setup_group_tabs)) { + Column( + Modifier.fillMaxWidth().pointerInput(Unit) { + awaitEachGesture { + val down = awaitFirstDown(requireUnconsumed = false) + val start = (down.position.y / rowPx).toInt() + val key = rows().getOrNull(start) + if (key == null || key == MORE_LINE || down.position.x > handlePx || grabbed != null) return@awaitEachGesture + down.consume() + dragging = key + dragOffset = 0f + while (true) { + val change = awaitPointerEvent(PointerEventPass.Initial).changes.firstOrNull { it.id == down.id } ?: break + change.consume() + if (!change.pressed) break + val travel = change.position.y - down.position.y + val current = rows() + val target = (start + (travel / rowPx).roundToInt()).coerceIn(0, current.lastIndex) + var at = current.indexOf(key) + var next = current + while (target != at) { + next = moveTabRow(next, key, if (target > at) 1 else -1) ?: break + at = next.indexOf(key) + } + if (next !== current) commit(next) + dragOffset = travel - (at - start) * rowPx + } + dragging = null + dragOffset = 0f + } + }, + ) { + list.forEachIndexed { index, tab -> + key(tab) { + if (tab == MORE_LINE) { + MoreLine() + } else { + val shown = NavTabs.place(s, tab) != TabPlace.HIDDEN + val held = tab == dragging || tab == grabbed + val bring = remember { BringIntoViewRequester() } + LaunchedEffect(index, grabbed) { if (grabbed == tab) bring.bringIntoView() } + TabRow( + tab, shown, NavTabs.hideable(tab), held, + offset = if (tab == dragging) dragOffset else 0f, + hint = if (pad && focused == tab) stringResource(if (grabbed == tab) R.string.hud_hint_drop else R.string.hud_hint_grab) else null, + modifier = Modifier.bringIntoViewRequester(bring) + .onPreviewKeyEvent { event -> + val e = event.nativeKeyEvent + val down = e.action == KeyEvent.ACTION_DOWN + val first = down && e.repeatCount == 0 + val mine = grabbed == tab + when (e.keyCode) { + KeyEvent.KEYCODE_BUTTON_Y -> { + if (first) { + if (mine) grabbed = null + else if (grabbed == null) { before = rows(); grabbed = tab } + } + true + } + KeyEvent.KEYCODE_DPAD_UP, KeyEvent.KEYCODE_DPAD_DOWN -> { + if (mine && down) moveTabRow(rows(), tab, if (e.keyCode == KeyEvent.KEYCODE_DPAD_UP) -1 else 1)?.let(commit) + mine + } + KeyEvent.KEYCODE_DPAD_LEFT, KeyEvent.KEYCODE_DPAD_RIGHT -> mine + KeyEvent.KEYCODE_BUTTON_B, KeyEvent.KEYCODE_BACK -> { + if (mine && first) { commit(before); grabbed = null } + mine + } + KeyEvent.KEYCODE_BUTTON_A, KeyEvent.KEYCODE_ENTER, KeyEvent.KEYCODE_SPACE -> { + if (first) { + if (mine) grabbed = null + else if (NavTabs.hideable(tab)) setShown(tab, !shown) + } + true + } + else -> false + } + }, + onFocus = { if (it) focused = tab else if (focused == tab) { focused = null; if (grabbed == tab) grabbed = null } }, + ) { host.open = null; setShown(tab, it) } + } + } + } + } + } + } +} + +@Composable +private fun MoreLine() { + val colors = MaterialTheme.colorScheme + val pal = LocalPalette.current + Column(Modifier.fillMaxWidth().height(TAB_ROW).testTag("tab-more-line")) { + Row( + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.spacedBy(10.dp), + modifier = Modifier.fillMaxWidth().weight(1f).background(colors.surfaceVariant.copy(alpha = 0.35f)).padding(horizontal = 14.dp), + ) { + Icon(railLabelIcon(NavTabs.MORE).second, null, tint = colors.onSurfaceVariant, modifier = Modifier.size(18.dp)) + Text( + stringResource(R.string.rail_more).uppercase(), fontSize = 12.sp, fontWeight = FontWeight.SemiBold, + letterSpacing = 1.5.sp, color = colors.onSurfaceVariant, + ) + Box(Modifier.weight(1f).height(1.dp).background(pal.line2)) + } + Box(Modifier.fillMaxWidth().height(1.dp).background(pal.line)) + } +} + +@Composable +private fun TabRow( + tab: String, shown: Boolean, hideable: Boolean, held: Boolean, offset: Float, hint: String?, + modifier: Modifier, onFocus: (Boolean) -> Unit, onShown: (Boolean) -> Unit, +) { + val colors = MaterialTheme.colorScheme + val pal = LocalPalette.current + val (labelRes, icon) = railLabelIcon(tab) + val label = stringResource(labelRes) + val src = remember { MutableInteractionSource() } + val hot = rememberHot(src) + Column( + modifier.fillMaxWidth().height(TAB_ROW).testTag("tab-row-$tab") + .zIndex(if (held) 1f else 0f) + .graphicsLayer { translationY = offset } + .background(if (held) colors.surfaceVariant else colors.surface) + .glideBorder(hot, Shape12, pal.signal) + .onFocusChanged { onFocus(it.isFocused) } + .hoverable(src) + .focusable(interactionSource = src), + ) { + Row( + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.spacedBy(6.dp), + modifier = Modifier.fillMaxWidth().weight(1f).padding(end = 10.dp), + ) { + Box(contentAlignment = Alignment.Center, modifier = Modifier.size(width = TAB_HANDLE, height = TAB_ROW).testTag("tab-handle-$tab")) { + Icon(Icons.Filled.DragHandle, null, tint = if (held) pal.signal else colors.onSurfaceVariant, modifier = Modifier.size(20.dp)) + } + Row( + verticalAlignment = Alignment.CenterVertically, + modifier = Modifier.weight(1f).alpha(if (shown) 1f else 0.5f), + ) { + Icon(icon, contentDescription = null, tint = colors.onSurfaceVariant, modifier = Modifier.size(20.dp)) + Spacer(Modifier.width(12.dp)) + Text(label, fontSize = 15.sp, fontWeight = FontWeight.SemiBold, color = colors.onBackground, maxLines = 1, overflow = TextOverflow.Ellipsis) + } + if (hint != null) KeyHint("Y", hint) + ToggleSwitch( + shown, hideable, label, + Modifier.testTag("tab-shown-$tab").focusProperties { canFocus = false }, + onChange = onShown, + ) + } + Box(Modifier.fillMaxWidth().height(1.dp).background(if (held) Color.Transparent else pal.line)) + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/ui/UpdatesPage.kt b/app/src/main/java/com/droiddeck/launcher/ui/UpdatesPage.kt index dd73939a7d..92478a6cd2 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/UpdatesPage.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/UpdatesPage.kt @@ -18,6 +18,8 @@ import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.BoxWithConstraints import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.ExperimentalLayoutApi +import androidx.compose.foundation.layout.FlowRow import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth @@ -31,7 +33,9 @@ import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.verticalScroll import androidx.compose.material.icons.Icons import androidx.compose.material.icons.outlined.Bolt +import androidx.compose.material.icons.automirrored.filled.OpenInNew import androidx.compose.material.icons.outlined.CheckCircle +import androidx.compose.material.icons.outlined.ContentCopy import androidx.compose.material.icons.outlined.Code import androidx.compose.material.icons.outlined.Download import androidx.compose.material.icons.outlined.Info @@ -50,6 +54,7 @@ import androidx.compose.material3.Text import androidx.compose.material3.TextButton import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableIntStateOf import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.saveable.rememberSaveable @@ -59,7 +64,12 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.semantics.Role +import androidx.compose.ui.platform.LocalClipboardManager +import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.text.AnnotatedString import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.input.ImeAction +import androidx.compose.ui.text.input.KeyboardType import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp @@ -87,11 +97,13 @@ class UpdatesActions( val onInstall: (Release) -> Unit = {}, val onAllowInstalls: () -> Unit = {}, val onDismissPermission: () -> Unit = {}, + val onSeen: (Release) -> Unit = {}, ) @OptIn(androidx.compose.foundation.ExperimentalFoundationApi::class) @Composable internal fun UpdatesPage(s: FrontEndState, a: FrontEndActions, modifier: Modifier) { + val host = rememberMenuHost() val u = s.updates val ua = a.updates val me = remember { AppUpdates.installed() } @@ -111,6 +123,13 @@ internal fun UpdatesPage(s: FrontEndState, a: FrontEndActions, modifier: Modifie if (u.checking) stringResource(R.string.common_checking) else if (checked != null) stringResource(R.string.upd_checked, ago(checked).replaceFirstChar { it.lowercase() }) else stringResource(R.string.upd_not_checked), fontSize = 13.sp, color = colors.onSurfaceVariant, ) + val clipboard = LocalClipboardManager.current + val context = LocalContext.current + val details = buildDetails(me, s.buildLabel) + ToolIcon(Icons.Outlined.ContentCopy, stringResource(R.string.upd_copy_build)) { + clipboard.setText(AnnotatedString(details)) + android.widget.Toast.makeText(context, context.getString(R.string.upd_copied), android.widget.Toast.LENGTH_SHORT).show() + } ToolIcon(Icons.Outlined.Refresh, stringResource(R.string.store_check_updates), busy = u.checking, enabled = !u.checking && u.stage == null, onClick = ua.onCheck) } BoxWithConstraints(Modifier.weight(1f).fillMaxWidth()) { @@ -120,14 +139,20 @@ internal fun UpdatesPage(s: FrontEndState, a: FrontEndActions, modifier: Modifie StatusPanel(s, u, ua, me) Box(Modifier.height(18.dp)) ChannelLabel() - ChannelPicker(u, ua) + ChannelPicker(u, ua, s.sessionRunning) } else { ChannelLabel() Row(horizontalArrangement = Arrangement.spacedBy(18.dp)) { - Box(Modifier.weight(1f)) { ChannelPicker(u, ua) } + Box(Modifier.weight(1f)) { ChannelPicker(u, ua, s.sessionRunning) } Box(Modifier.weight(1.15f)) { StatusPanel(s, u, ua, me) } } } + Box(Modifier.padding(top = 18.dp)) { + ToggleRow( + host, "build-watermark", stringResource(R.string.setup_build_watermark), + stringResource(R.string.setup_build_watermark_hint), s.buildWatermark, + ) { a.onBuildWatermark() } + } } } } @@ -162,6 +187,8 @@ private fun StatusPanel(s: FrontEndState, u: UpdatesState, ua: UpdatesActions, m offered && installBlock != null -> Look(colors.onSurfaceVariant, stringResource(R.string.upd_blocked_status), newBuild(u.follow, release!!), null) offer == Offer.UPDATE -> Look(AttentionAmber, stringResource(R.string.upd_available), newBuild(u.follow, release!!), null) offer == Offer.SWITCH -> Look(pal.signal, stringResource(R.string.upd_switch), newBuild(u.follow, release!!), null) + offer == Offer.AHEAD && u.follow.channel == Channel.NIGHTLY -> Look(pal.signal, stringResource(R.string.upd_ahead_preview_status), + stringResource(R.string.upd_ahead_preview_headline), stringResource(R.string.upd_ahead_preview_detail)) offer == Offer.AHEAD -> Look(pal.signal, stringResource(R.string.upd_ahead_status), stringResource(R.string.upd_ahead_headline), stringResource(R.string.upd_ahead_detail)) offer == Offer.GONE -> Look(AttentionAmber, stringResource(R.string.upd_gone_status), stringResource(R.string.upd_gone_headline), @@ -179,6 +206,12 @@ private fun StatusPanel(s: FrontEndState, u: UpdatesState, ua: UpdatesActions, m Text(look.headline, fontSize = 22.sp, fontWeight = FontWeight.Bold, color = colors.onBackground, modifier = Modifier.padding(top = 4.dp)) if (offered) { ReleaseNotes(changeTitle(release!!.title.ifBlank { release.tag }), release.summary, release.tag) + ReleaseFacts(release) + } + if (release != null && u.follow.channel == Channel.TEST && catalog != null) { + androidx.compose.runtime.LaunchedEffect(release.tag, release.commit, release.apk?.sha256) { ua.onSeen(release) } + if (!offered) ReleaseFacts(release) + TestFreshness(catalog, release) } if (look.detail != null) Text(look.detail, fontSize = 14.sp, color = colors.onSurfaceVariant, modifier = Modifier.padding(top = 10.dp)) if (installBlock != null && offered) { @@ -197,7 +230,7 @@ private fun StatusPanel(s: FrontEndState, u: UpdatesState, ua: UpdatesActions, m offered && installBlock != null -> Unit offer == Offer.UPDATE -> PrimaryButton(stringResource(R.string.upd_update_button, button), enabled = installable, main = true) { ua.onInstall(release!!) } offer == Offer.SWITCH -> PrimaryButton(stringResource(R.string.upd_install_button, button), enabled = installable, main = true) { ua.onInstall(release!!) } - offer == Offer.AHEAD && installBlock == null -> + offer == Offer.AHEAD && u.follow.channel == Channel.STABLE && installBlock == null -> SecondaryButton(stringResource(R.string.upd_install_anyway, release?.version.orEmpty()), enabled = installable) { ua.onInstall(release!!) } offer == Offer.GONE -> PrimaryButton(stringResource(R.string.upd_follow_preview), main = true) { ua.onFollow(Follow(Channel.NIGHTLY)) } } @@ -206,7 +239,7 @@ private fun StatusPanel(s: FrontEndState, u: UpdatesState, ua: UpdatesActions, m Text(stringResource(R.string.upd_stop_session), fontSize = 12.5.sp, color = colors.onSurfaceVariant, modifier = Modifier.padding(top = 8.dp)) } if (u.follow.channel == Channel.NIGHTLY) { - PreviewHistory(catalog, me) + PreviewHistory(catalog, me, s, u, ua) } } } @@ -262,10 +295,13 @@ private fun ChannelLabel() { } @Composable -private fun ChannelPicker(u: UpdatesState, ua: UpdatesActions) { +private fun ChannelPicker(u: UpdatesState, ua: UpdatesActions, sessionRunning: Boolean) { val colors = MaterialTheme.colorScheme val catalog = u.catalog val tests = catalog?.tests.orEmpty() + val me = remember { AppUpdates.installed() } + val ready = tests.count { AppUpdates.installable(it, me) } + var showTests by rememberSaveable { mutableStateOf(false) } Column(verticalArrangement = Arrangement.spacedBy(10.dp)) { ChannelCard( Icons.Outlined.Verified, stringResource(R.string.upd_stable), stringResource(R.string.upd_stable_hint), @@ -277,68 +313,230 @@ private fun ChannelPicker(u: UpdatesState, ua: UpdatesActions) { ) { ua.onFollow(Follow(Channel.NIGHTLY)) } ChannelCard( Icons.Outlined.Science, stringResource(R.string.upd_tests), stringResource(R.string.upd_tests_hint), - if (tests.isEmpty()) stringResource(R.string.upd_tests_none) else pluralStringResource(R.plurals.upd_tests_count, tests.size, tests.size), + if (tests.isEmpty()) stringResource(R.string.upd_tests_none) else pluralStringResource(R.plurals.upd_tests_count, ready, ready), u.follow.channel == Channel.TEST, enabled = tests.isNotEmpty() || u.follow.channel == Channel.TEST, - ) { tests.firstOrNull()?.let { ua.onFollow(Follow(Channel.TEST, it.pr)) } } - AnimatedVisibility(u.follow.channel == Channel.TEST && tests.isNotEmpty(), enter = expandVertically(Motion.sp(1f)) + fadeIn(Motion.sp(1f)), exit = shrinkVertically(Motion.sp(1f)) + fadeOut(Motion.sp(1f))) { - Column(Modifier.padding(start = 18.dp), verticalArrangement = Arrangement.spacedBy(6.dp)) { - tests.forEach { t -> TestRow(t, u.follow.pr == t.pr) { ua.onFollow(Follow(Channel.TEST, t.pr)) } } - } + ) { showTests = !showTests } + AnimatedVisibility((showTests || u.follow.channel == Channel.TEST) && tests.isNotEmpty(), enter = expandVertically(Motion.sp(1f)) + fadeIn(Motion.sp(1f)), exit = shrinkVertically(Motion.sp(1f)) + fadeOut(Motion.sp(1f))) { + TestList(tests, me, u, ua) } + val context = androidx.compose.ui.platform.LocalContext.current + val agentReady = com.droiddeck.launcher.agent.AgentHost.installed && + (com.droiddeck.launcher.agent.AgentSetup.ready || com.droiddeck.launcher.agent.AgentSetup.completed(context)) + LabBuilds(sessionRunning, onRebuild = if (agentReady) { info -> + com.droiddeck.launcher.agent.AgentHost.send(context, context.getString(R.string.agent_rebuild_lab, info.label)) + context.startActivity(android.content.Intent(context, com.droiddeck.launcher.FrontEndActivity::class.java) + .putExtra(com.droiddeck.launcher.stores.download.StoreDownloadService.EXTRA_NAV, "agent") + .addFlags(android.content.Intent.FLAG_ACTIVITY_SINGLE_TOP or android.content.Intent.FLAG_ACTIVITY_REORDER_TO_FRONT)) + } else null) } } @Composable -private fun PreviewHistory(catalog: AppUpdates.Catalog?, me: AppUpdates.Installed) { +private fun PreviewHistory(catalog: AppUpdates.Catalog?, me: AppUpdates.Installed, s: FrontEndState, u: UpdatesState, ua: UpdatesActions) { val history = catalog?.let { AppUpdates.previewHistory(it, me) } ?: return val colors = MaterialTheme.colorScheme - val pal = LocalPalette.current - val key = catalog?.recentPreviews?.firstOrNull()?.commit - var expanded by rememberSaveable(key) { mutableStateOf(false) } val heading = when (history.kind) { AppUpdates.PreviewHistoryKind.CURRENT -> stringResource(R.string.upd_preview_current) AppUpdates.PreviewHistoryKind.BEHIND -> pluralStringResource( R.plurals.upd_preview_behind, history.buildsBehind, history.buildsBehind, ) AppUpdates.PreviewHistoryKind.RECENT -> pluralStringResource( - R.plurals.upd_preview_recent, history.changes.size, history.changes.size, + R.plurals.upd_preview_recent, maxOf(history.builds.size, history.changes.size), maxOf(history.builds.size, history.changes.size), ) } Column(Modifier.fillMaxWidth().padding(top = 18.dp)) { Text(heading, fontSize = 11.5.sp, fontWeight = FontWeight.Medium, color = colors.onSurfaceVariant) - if (history.changes.isNotEmpty()) { - val visible = if (expanded) history.changes else history.changes.take(3) - Column(Modifier.padding(top = 3.dp), verticalArrangement = Arrangement.spacedBy(3.dp)) { - visible.forEach { change -> - Column { - Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(6.dp)) { - Text( - changeTitle(change.title.ifBlank { change.commit.take(7) }), - fontSize = 12.5.sp, fontWeight = FontWeight.SemiBold, color = colors.onBackground, - maxLines = 1, overflow = TextOverflow.Ellipsis, modifier = Modifier.weight(1f), - ) - Text(ago(change.publishedAt), fontSize = 11.sp, color = colors.onSurfaceVariant) - } - if (change.summary.isNotBlank()) Text( - change.summary, fontSize = 11.5.sp, color = colors.onSurfaceVariant, - maxLines = 1, overflow = TextOverflow.Ellipsis, - ) + if (history.builds.isNotEmpty()) { + Text(stringResource(R.string.upd_preview_pick), fontSize = 11.5.sp, color = colors.onSurfaceVariant) + PreviewBuilds(history, me, s, u, ua) + } else if (history.changes.isNotEmpty()) { + LegacyChanges(history.changes) + } + } +} + +@Composable +private fun PreviewBuilds(history: AppUpdates.PreviewHistory, me: AppUpdates.Installed, s: FrontEndState, u: UpdatesState, ua: UpdatesActions) { + val builds = history.builds + var open by rememberSaveable { mutableStateOf(null) } + var shown by rememberSaveable(builds.firstOrNull()?.commit) { + mutableIntStateOf(maxOf(5, if (history.installedIndex >= 0) history.installedIndex + 2 else 0)) + } + Column(Modifier.padding(top = 6.dp), verticalArrangement = Arrangement.spacedBy(4.dp)) { + builds.take(shown).forEachIndexed { index, build -> + PreviewBuildRow( + build, index, history.installedIndex, me, s, u, ua, + expanded = open == build.commit, + ) { open = if (open == build.commit) null else build.commit } + } + } + val more = builds.size - shown + if (more > 0) MoreLink(stringResource(R.string.upd_show_more, more), "preview:history:more") { shown += 20 } + else if (shown > 5) MoreLink(stringResource(R.string.upd_less), "preview:history:less") { shown = 5 } +} + +@Composable +private fun PreviewBuildRow( + build: Release, index: Int, installedIndex: Int, me: AppUpdates.Installed, + s: FrontEndState, u: UpdatesState, ua: UpdatesActions, expanded: Boolean, onToggle: () -> Unit, +) { + val colors = MaterialTheme.colorScheme + val pal = LocalPalette.current + val src = remember { MutableInteractionSource() } + val hot = rememberHot(src) + val installed = index == installedIndex + val block = AppUpdates.installBlock(build, me) + val tooOld = block != null && build.apk != null && build.apk.versionCode < me.versionCode + Column( + Modifier.fillMaxWidth().clip(Shape12) + .background(if (hot) pal.signal.copy(alpha = 0.12f) else if (expanded) colors.surfaceVariant else Color.Transparent) + .alpha(if (tooOld && !expanded) 0.55f else 1f), + ) { + Row( + verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(8.dp), + modifier = Modifier.fillMaxWidth().paneItem("preview:${build.commit}") + .glideBorder(hot, Shape12, pal.signal) + .hoverable(src).clickable(interactionSource = src, indication = null, role = Role.Button, onClick = onToggle) + .controllerConfirm(onClick = onToggle) + .padding(horizontal = 8.dp, vertical = 6.dp), + ) { + Column(Modifier.weight(1f)) { + Text( + changeTitle(build.title.ifBlank { build.shortCommit }), fontSize = 12.5.sp, fontWeight = FontWeight.SemiBold, + color = colors.onBackground, maxLines = if (expanded) Int.MAX_VALUE else 1, overflow = TextOverflow.Ellipsis, + ) + Text( + listOfNotNull(ago(build.committedAt.takeIf { it > 0 } ?: build.publishedAt), build.author.takeIf { it.isNotEmpty() }?.let { "@$it" }, build.shortCommit) + .joinToString(" ยท "), + fontSize = 11.sp, color = colors.onSurfaceVariant, maxLines = 1, overflow = TextOverflow.Ellipsis, + ) + } + if (installed) Chip(stringResource(R.string.upd_installed_tag), ok = true) + } + if (expanded) Column(Modifier.padding(start = 8.dp, end = 8.dp, bottom = 10.dp)) { + if (build.summary.isNotBlank()) Text(build.summary, fontSize = 12.5.sp, color = colors.onSurfaceVariant) + ReleaseFacts(build) + Box(Modifier.padding(top = 10.dp)) { + when { + installed -> Unit + block != null -> Text(block.message(LocalContext.current), fontSize = 12.5.sp, color = AttentionAmber) + me.updatable -> { + val size = build.apk?.size?.takeIf { it > 0 }?.let { " ยท ${megabytes(it)}" }.orEmpty() + val label = if (installedIndex in 0 until index) stringResource(R.string.upd_rollback_this, size) + else stringResource(R.string.upd_install_this, size) + SecondaryButton(label, enabled = u.stage == null && !s.sessionRunning, compact = true) { ua.onInstall(build) } } } } - if (history.changes.size > 3 || expanded) { - val src = remember { MutableInteractionSource() } - val hot = rememberHot(src) - val toggle = { expanded = !expanded } + } + } +} + +@Composable +private fun LegacyChanges(changes: List) { + val colors = MaterialTheme.colorScheme + Column(Modifier.padding(top = 3.dp), verticalArrangement = Arrangement.spacedBy(3.dp)) { + changes.take(10).forEach { change -> + Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(6.dp)) { Text( - if (expanded) stringResource(R.string.upd_less) else stringResource(R.string.upd_more), - fontSize = 12.sp, fontWeight = FontWeight.SemiBold, color = pal.signal, - modifier = Modifier.padding(top = 1.dp).offset(x = (-6).dp).paneItem("preview:history:more") - .clip(Shape12).glideBorder(hot, Shape12, pal.signal) - .hoverable(src).clickable(interactionSource = src, indication = null, role = Role.Button, onClick = toggle) - .controllerConfirm(onClick = toggle) - .padding(horizontal = 6.dp, vertical = 4.dp), + changeTitle(change.title.ifBlank { change.commit.take(7) }), + fontSize = 12.5.sp, fontWeight = FontWeight.SemiBold, color = colors.onBackground, + maxLines = 1, overflow = TextOverflow.Ellipsis, modifier = Modifier.weight(1f), ) + Text(ago(change.publishedAt), fontSize = 11.sp, color = colors.onSurfaceVariant) + } + } + } +} + +@Composable +private fun MoreLink(text: String, id: String, onClick: () -> Unit) { + val pal = LocalPalette.current + val src = remember { MutableInteractionSource() } + val hot = rememberHot(src) + Text( + text, fontSize = 12.sp, fontWeight = FontWeight.SemiBold, color = pal.signal, + modifier = Modifier.padding(top = 2.dp).offset(x = (-6).dp).paneItem(id) + .clip(Shape12).glideBorder(hot, Shape12, pal.signal) + .hoverable(src).clickable(interactionSource = src, indication = null, role = Role.Button, onClick = onClick) + .controllerConfirm(onClick = onClick) + .padding(horizontal = 6.dp, vertical = 4.dp), + ) +} + +@OptIn(ExperimentalLayoutApi::class) +@Composable +private fun ReleaseFacts(r: Release) { + val colors = MaterialTheme.colorScheme + val facts = listOfNotNull( + r.author.takeIf { it.isNotEmpty() }?.let { "@$it" }, + stringResource(R.string.upd_version_code, r.versionCode), + ).joinToString(" ยท ") + Text(facts, fontSize = 12.sp, color = colors.onSurfaceVariant, modifier = Modifier.padding(top = 8.dp)) + FlowRow(Modifier.padding(top = 2.dp), horizontalArrangement = Arrangement.spacedBy(6.dp)) { + if (r.linkedPr > 0) LinkPill(stringResource(R.string.upd_pr, r.linkedPr), "https://github.com/Droid-Deck/DroidDeck/pull/${r.linkedPr}") + if (r.commit.length >= 7) LinkPill(stringResource(R.string.upd_link_commit, r.shortCommit), "https://github.com/Droid-Deck/DroidDeck/commit/${r.commit}") + if (r.url.startsWith("https://github.com/Droid-Deck/")) LinkPill(stringResource(R.string.upd_link_release), r.url) + } +} + +@Composable +private fun TestFreshness(catalog: AppUpdates.Catalog, r: Release) { + val colors = MaterialTheme.colorScheme + if (r.newerCommitPushed) Text( + stringResource(R.string.upd_newer_commit, r.headCommit.take(7)), fontSize = 12.5.sp, color = AttentionAmber, modifier = Modifier.padding(top = 8.dp), + ) + val behind = AppUpdates.previewsSince(catalog, r) + if (behind > 0) Text( + stringResource(R.string.upd_main_moved, behind), fontSize = 12.5.sp, color = colors.onSurfaceVariant, modifier = Modifier.padding(top = 4.dp), + ) +} + +@Composable +private fun LinkPill(label: String, url: String) { + val ctx = LocalContext.current + val pal = LocalPalette.current + val src = remember { MutableInteractionSource() } + val hot = rememberHot(src) + val open = { openUrl(ctx, url) } + Row( + verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(5.dp), + modifier = Modifier.paneItem("link:$url").heightIn(min = 36.dp).offset(x = (-8).dp).clip(Shape12) + .background(if (hot) pal.signal.copy(alpha = 0.14f) else Color.Transparent) + .glideBorder(hot, Shape12, pal.signal) + .hoverable(src).clickable(interactionSource = src, indication = null, role = Role.Button, onClick = open) + .controllerConfirm(onClick = open).padding(horizontal = 8.dp), + ) { + val tint = pal.signal + Text(label, fontSize = 12.sp, fontWeight = FontWeight.Medium, color = tint, maxLines = 1) + Icon(Icons.AutoMirrored.Filled.OpenInNew, contentDescription = null, tint = tint.copy(alpha = 0.65f), modifier = Modifier.size(11.dp)) + } +} + +@Composable +private fun TestList(tests: List, me: AppUpdates.Installed, u: UpdatesState, ua: UpdatesActions) { + val colors = MaterialTheme.colorScheme + var query by rememberSaveable { mutableStateOf("") } + val needle = query.trim().removePrefix("#").removePrefix("@") + val matches = tests.filter { + needle.isEmpty() || it.pr.toString().startsWith(needle) || it.title.contains(needle, ignoreCase = true) || + it.author.contains(needle, ignoreCase = true) || (needle.length >= 4 && it.commit.startsWith(needle, ignoreCase = true)) + } + val (ready, old) = matches.partition { it.versionCode >= me.versionCode } + val followedOld = u.follow.channel == Channel.TEST && old.any { it.pr == u.follow.pr } + var showOld by rememberSaveable { mutableStateOf(false) } + Column(Modifier.padding(start = 18.dp), verticalArrangement = Arrangement.spacedBy(6.dp)) { + if (tests.size > 5 || query.isNotEmpty()) AdbTextField( + value = query, onValueChange = { query = it }, label = stringResource(R.string.upd_tests_find), + keyboardType = KeyboardType.Text, imeAction = ImeAction.Search, compact = true, showLabel = false, + placeholder = stringResource(R.string.upd_tests_find), modifier = Modifier.fillMaxWidth(), + ) + if (matches.isEmpty()) Text(stringResource(R.string.upd_tests_no_match), fontSize = 12.5.sp, color = colors.onSurfaceVariant, modifier = Modifier.padding(4.dp)) + ready.forEach { t -> TestRow(t, u.follow.pr == t.pr && u.follow.channel == Channel.TEST) { ua.onFollow(Follow(Channel.TEST, t.pr)) } } + if (old.isNotEmpty()) { + MoreLink(stringResource(R.string.upd_tests_old, old.size, me.versionCode), "tests:old") { showOld = !showOld } + if (showOld || followedOld || needle.isNotEmpty()) old.forEach { t -> + TestRow(t, u.follow.pr == t.pr && u.follow.channel == Channel.TEST, tooOld = true) { ua.onFollow(Follow(Channel.TEST, t.pr)) } } } } @@ -388,7 +586,7 @@ private fun RadioDot(selected: Boolean, size: androidx.compose.ui.unit.Dp = 22.d } @Composable -private fun TestRow(t: Release, selected: Boolean, onClick: () -> Unit) { +private fun TestRow(t: Release, selected: Boolean, tooOld: Boolean = false, onClick: () -> Unit) { val colors = MaterialTheme.colorScheme val pal = LocalPalette.current val src = remember { MutableInteractionSource() } @@ -401,6 +599,7 @@ private fun TestRow(t: Release, selected: Boolean, onClick: () -> Unit) { .clip(Shape12) .background(colors.surface).background(if (hot) pal.signal.copy(alpha = 0.14f) else Color.Transparent) .glideBorder(hot, Shape12, pal.signal, pal.line) + .alpha(if (tooOld && !selected) 0.6f else 1f) .hoverable(src) .clickable(interactionSource = src, indication = null, role = Role.RadioButton, onClick = onClick) .controllerConfirm(onClick = onClick) @@ -408,13 +607,29 @@ private fun TestRow(t: Release, selected: Boolean, onClick: () -> Unit) { ) { Text("#${t.pr}", fontSize = 13.sp, fontWeight = FontWeight.Bold, color = if (selected) pal.signal else colors.onSurfaceVariant) Column(Modifier.weight(1f)) { - Text(t.title.ifBlank { stringResource(R.string.upd_pr, t.pr) }, fontSize = 13.5.sp, fontWeight = FontWeight.SemiBold, color = colors.onBackground, maxLines = 1, overflow = TextOverflow.Ellipsis) - Text(if (t.apk == null) stringResource(R.string.upd_not_built) else stringResource(R.string.upd_updated, ago(t.publishedAt)), fontSize = 12.sp, color = colors.onSurfaceVariant) + Text(changeTitle(t.title.ifBlank { stringResource(R.string.upd_pr, t.pr) }), fontSize = 13.5.sp, fontWeight = FontWeight.SemiBold, color = colors.onBackground, maxLines = 1, overflow = TextOverflow.Ellipsis) + val detail = when { + t.apk == null -> stringResource(R.string.upd_not_built) + tooOld -> stringResource(R.string.upd_tests_old_row, t.versionCode) + else -> stringResource(R.string.upd_updated, ago(t.builtAt.takeIf { it > 0 } ?: t.publishedAt)) + } + Text( + listOfNotNull(detail, t.author.takeIf { it.isNotEmpty() }?.let { "@$it" }, t.shortCommit).joinToString(" ยท "), + fontSize = 12.sp, color = colors.onSurfaceVariant, maxLines = 1, overflow = TextOverflow.Ellipsis, + ) + if (t.newerCommitPushed) Text(stringResource(R.string.upd_newer_commit_short), fontSize = 12.sp, color = AttentionAmber, maxLines = 1, overflow = TextOverflow.Ellipsis) } RadioDot(selected, 20.dp) } } +private fun buildDetails(me: AppUpdates.Installed, label: String): String = buildString { + append("DroidDeck ").append(me.version).append(" (versionCode ").append(me.versionCode).append(")\n") + append(label) + if (me.pr > 0) append("\nPR #").append(me.pr).append(" https://github.com/Droid-Deck/DroidDeck/pull/").append(me.pr) + if (me.commit.length >= 7) append("\nCommit ").append(me.commit) +} + @Composable private fun channelName(f: Follow) = when (f.channel) { Channel.STABLE -> stringResource(R.string.upd_stable) diff --git a/app/src/main/java/com/droiddeck/launcher/ui/WinComponentsEditor.kt b/app/src/main/java/com/droiddeck/launcher/ui/WinComponentsEditor.kt index 4dff5d4d60..3fd3c9477c 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/WinComponentsEditor.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/WinComponentsEditor.kt @@ -56,7 +56,7 @@ import java.io.File private fun installable(name: String, all: Map): String = WinComponents.installable(name, all) @Composable -private fun originName(origin: String): String = if (origin == WinCompSources.Origin.XBOX.name) "Xbox" else stringResource( +private fun originName(origin: String): String = if (origin == WinCompSources.Origin.XBOX.name) "Xbox" else if (origin == WinCompSources.Origin.UBISOFT.name) "Ubisoft Connect" else stringResource( when (origin) { WinCompSources.Origin.GOG.name -> R.string.wincomp_src_gog WinCompSources.Origin.EPIC.name -> R.string.wincomp_src_epic @@ -71,6 +71,7 @@ private fun autoReason(r: WinComponents.AutoReason): String = when (r.kind) { WinCompSources.Origin.GOG.name -> stringResource(R.string.wincomp_auto_gog) WinCompSources.Origin.EPIC.name -> stringResource(R.string.wincomp_auto_epic) WinCompSources.Origin.AMAZON.name -> stringResource(R.string.wincomp_auto_amazon) + WinCompSources.Origin.UBISOFT.name -> "From Ubisoft's install steps for this game" WinCompSources.Origin.XBOX.name -> "Xbox games install it with the game (${r.args.getOrElse(0) { "VC14" }})" else -> "" } diff --git a/app/src/main/java/com/droiddeck/launcher/ui/WirelessAdbFixPage.kt b/app/src/main/java/com/droiddeck/launcher/ui/WirelessAdbFixPage.kt index 8ebfb5ad69..a685e414f3 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/WirelessAdbFixPage.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/WirelessAdbFixPage.kt @@ -454,6 +454,18 @@ internal fun AdbTextField( } } showSoftInputOnFocus = !bottomTyping + // B on a controller puts the keyboard away first; with no keyboard up it goes back as usual. + var hidingKeyboard = false + setOnKeyListener { view, keyCode, event -> + if (keyCode != android.view.KeyEvent.KEYCODE_BUTTON_B) return@setOnKeyListener false + if (event.action == android.view.KeyEvent.ACTION_DOWN && event.repeatCount == 0) { + hidingKeyboard = androidx.core.view.ViewCompat.getRootWindowInsets(view) + ?.isVisible(androidx.core.view.WindowInsetsCompat.Type.ime()) == true + if (hidingKeyboard) (view.context.getSystemService(android.content.Context.INPUT_METHOD_SERVICE) as? android.view.inputmethod.InputMethodManager) + ?.hideSoftInputFromWindow(view.windowToken, 0) + } + hidingKeyboard + } setOnClickListener { if (hasFocus() && !typeOnBottom(this) && bottomTypingLatest.value) showKeyboardHere(this) } setOnFocusChangeListener { _, hasFocus -> focused = hasFocus diff --git a/app/src/main/java/com/droiddeck/launcher/update/AppUpdates.kt b/app/src/main/java/com/droiddeck/launcher/update/AppUpdates.kt index 51b5fc3d32..3540448b64 100644 --- a/app/src/main/java/com/droiddeck/launcher/update/AppUpdates.kt +++ b/app/src/main/java/com/droiddeck/launcher/update/AppUpdates.kt @@ -18,7 +18,7 @@ object AppUpdates { private const val TAG = "AppUpdates" private const val REPO = "Droid-Deck/DroidDeck" private const val CI_REPO = "Droid-Deck/DroidDeck-CI" - private const val CATALOG_URL = "https://raw.githubusercontent.com/$CI_REPO/main/catalog.json" + private val CATALOG_URL = "https://raw.githubusercontent.com/$CI_REPO/${BuildConfig.UPDATE_CATALOG_BRANCH}/catalog.json" private const val PREFS = "app_updates" private const val KEY_CATALOG = "catalog" private const val KEY_CHANNEL = "channel" @@ -49,7 +49,21 @@ object AppUpdates { val publishedAt: Long, val url: String, val apk: Apk?, - ) + val author: String = "", + val committedAt: Long = 0L, + /** The PR a Preview build merged, 0 for a direct push. Test builds use [pr]. */ + val mergedPr: Int = 0, + /** The PR's newest commit when the catalog was made; differs from [commit] while a rebuild is pending. */ + val headCommit: String = "", + /** When the APK itself was uploaded; release-note edits leave it unchanged. */ + val builtAt: Long = 0L, + ) { + val linkedPr: Int get() = if (pr > 0) pr else mergedPr + val shortCommit: String get() = commit.take(7) + val newerCommitPushed: Boolean get() = + headCommit.length >= 7 && !headCommit.startsWith(commit, ignoreCase = true) && + !commit.startsWith(headCommit, ignoreCase = true) + } class PreviewChange( val commit: String, @@ -64,7 +78,11 @@ object AppUpdates { val tests: List, val checkedAt: Long, val recentPreviews: List = emptyList(), - ) + val previews: List = emptyList(), + ) { + /** Every published Preview build, newest commit first; older catalogs only name the newest. */ + val previewBuilds: List get() = previews.ifEmpty { listOfNotNull(preview) } + } class Installed( val commit: String, @@ -88,6 +106,8 @@ object AppUpdates { val kind: PreviewHistoryKind, val buildsBehind: Int, val changes: List, + val builds: List = emptyList(), + val installedIndex: Int = -1, ) enum class Offer { @@ -149,7 +169,13 @@ object AppUpdates { compareVersions(r.version ?: "", me.version) > 0 -> Offer.UPDATE else -> Offer.AHEAD } - Channel.NIGHTLY -> if (me.pr != 0) Offer.SWITCH else Offer.UPDATE + Channel.NIGHTLY -> when { + me.pr != 0 -> Offer.SWITCH + previewIndex(catalog, me) > 0 -> Offer.UPDATE + previewIndex(catalog, me) < 0 && me.committedAt > 0 && r.committedAt > 0 && + me.committedAt > r.committedAt -> Offer.AHEAD + else -> Offer.UPDATE + } Channel.TEST -> if (me.pr == r.pr) Offer.UPDATE else Offer.SWITCH } } @@ -162,12 +188,39 @@ object AppUpdates { } fun isRunning(r: Release, me: Installed = installed()): Boolean { - if (me.commit.length < 7 || r.commit.length < 7 || r.pr != me.pr) return false + if (me.commit.length < 7 || r.commit.length < 7 || r.pr != me.pr || r.versionCode > me.versionCode) return false return me.commit.startsWith(r.commit, ignoreCase = true) || r.commit.startsWith(me.commit, ignoreCase = true) } + /** Where the installed build sits in [Catalog.previewBuilds], or -1 when it is not one of them. */ + fun previewIndex(catalog: Catalog, me: Installed = installed()): Int { + if (me.pr != 0) return -1 + val builds = catalog.previewBuilds + val matching = builds.indices.filter { matchesInstalledCommit(builds[it].commit, me.commit) } + return matching.singleOrNull() ?: -1 + } + + /** How many Preview builds landed on main after this test build was made. */ + fun previewsSince(catalog: Catalog, test: Release): Int = + catalog.previews.count { + (it.committedAt.takeIf { at -> at > 0 } ?: it.publishedAt) > (test.builtAt.takeIf { at -> at > 0 } ?: test.publishedAt) + } + + fun installable(r: Release, me: Installed = installed()): Boolean = + me.updatable && installBlock(r, me) == null && !isRunning(r, me) + fun previewHistory(catalog: Catalog, me: Installed = installed()): PreviewHistory? { + if (catalog.previews.isNotEmpty()) { + val builds = catalog.previews + val index = previewIndex(catalog, me) + val kind = when { + index == 0 -> PreviewHistoryKind.CURRENT + index > 0 -> PreviewHistoryKind.BEHIND + else -> PreviewHistoryKind.RECENT + } + return PreviewHistory(kind, maxOf(index, 0), emptyList(), builds, index) + } if (!me.ciBuild || catalog.recentPreviews.isEmpty()) return null val stable = catalog.stable if ( @@ -225,7 +278,8 @@ object AppUpdates { if (stable != null && isRunning(stable, me)) return Guess(Follow(Channel.STABLE), true) val publishedPreview = catalog != null && me.updatable && ( catalog.preview?.let { isRunning(it, me) } == true || - catalog.recentPreviews.any { matchesInstalledCommit(it.commit, me.commit) } + catalog.recentPreviews.any { matchesInstalledCommit(it.commit, me.commit) } || + catalog.previewBuilds.any { matchesInstalledCommit(it.commit, me.commit) } ) if (stable?.version?.let { compareVersions(me.version, it) < 0 } == true) return Guess(Follow(Channel.STABLE), !publishedPreview) return Guess(Follow(if (publishedPreview) Channel.NIGHTLY else Channel.STABLE), false) @@ -237,7 +291,7 @@ object AppUpdates { prefs(context).edit().putString(KEY_CHANNEL, value).apply() } - private fun stored(context: Context): Follow? { + fun stored(context: Context): Follow? { val v = prefs(context).getString(KEY_CHANNEL, null) ?: return null return when { v == "stable" -> Follow(Channel.STABLE) @@ -281,6 +335,7 @@ object AppUpdates { } val tests = root.optJSONArray("tests") ?: JSONArray() val recentPreviews = root.optJSONArray("recentPreviews") ?: JSONArray() + val previews = root.optJSONArray("previews") ?: JSONArray() return Catalog( root.optJSONObject("stable")?.let { readPublishedRelease(it, packageName) }, root.optJSONObject("preview")?.let { readPublishedRelease(it, packageName) }, @@ -294,6 +349,10 @@ object AppUpdates { .sortedByDescending { it.publishedAt } .distinctBy { it.commit.lowercase() } .take(10), + (0 until previews.length()) + .map { readPublishedRelease(previews.getJSONObject(it), packageName) } + .filter { it.pr == 0 } + .distinctBy { it.commit.lowercase() }, ) } @@ -327,6 +386,11 @@ object AppUpdates { o.optLong("publishedAt"), o.optString("url"), apk, + o.optString("author").takeIf { Regex("^[A-Za-z0-9-]{1,39}(\\[bot\\])?$").matches(it) }.orEmpty(), + o.optLong("committedAt"), + o.optInt("mergedPr").coerceAtLeast(0), + o.optString("headCommit").takeIf { Regex("^[0-9a-fA-F]{7,40}$").matches(it) }.orEmpty(), + o.optLong("builtAt"), ) } @@ -425,6 +489,11 @@ object AppUpdates { .put("publishedAt", r.publishedAt) .put("url", r.url) .put("apk", r.apk?.let(::writeApk)) + .put("author", r.author) + .put("committedAt", r.committedAt) + .put("mergedPr", r.mergedPr) + .put("headCommit", r.headCommit) + .put("builtAt", r.builtAt) private fun readCachedRelease(o: JSONObject): Release = Release( o.getString("tag"), @@ -447,6 +516,11 @@ object AppUpdates { it.getString("signerSha256"), ) }, + o.optString("author"), + o.optLong("committedAt"), + o.optInt("mergedPr"), + o.optString("headCommit"), + o.optLong("builtAt"), ) internal fun writeCatalog(c: Catalog): JSONObject = JSONObject() @@ -454,6 +528,7 @@ object AppUpdates { .put("preview", c.preview?.let(::writeRelease)) .put("tests", JSONArray().apply { c.tests.forEach { put(writeRelease(it)) } }) .put("recentPreviews", JSONArray().apply { c.recentPreviews.forEach { put(writePreviewChange(it)) } }) + .put("previews", JSONArray().apply { c.previews.forEach { put(writeRelease(it)) } }) .put("checkedAt", c.checkedAt) private fun writePreviewChange(c: PreviewChange): JSONObject = JSONObject() @@ -466,6 +541,7 @@ object AppUpdates { val tests = o.optJSONArray("tests") ?: JSONArray() val preview = o.optJSONObject("preview") ?: o.optJSONObject("nightly") val recentPreviews = o.optJSONArray("recentPreviews") ?: JSONArray() + val previews = o.optJSONArray("previews") ?: JSONArray() return Catalog( o.optJSONObject("stable")?.let(::readCachedRelease), preview?.let(::readCachedRelease), @@ -476,6 +552,7 @@ object AppUpdates { .sortedByDescending { it.publishedAt } .distinctBy { it.commit.lowercase() } .take(10), + (0 until previews.length()).map { readCachedRelease(previews.getJSONObject(it)) }, ) } diff --git a/app/src/main/java/com/droiddeck/launcher/update/UpdateWatch.kt b/app/src/main/java/com/droiddeck/launcher/update/UpdateWatch.kt new file mode 100644 index 0000000000..4c85c6a5d2 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/update/UpdateWatch.kt @@ -0,0 +1,102 @@ +package com.droiddeck.launcher.update + +import android.app.Notification +import android.app.NotificationChannel +import android.app.NotificationManager +import android.app.PendingIntent +import android.app.job.JobInfo +import android.app.job.JobParameters +import android.app.job.JobScheduler +import android.app.job.JobService +import android.content.ComponentName +import android.content.Context +import android.content.Intent +import com.droiddeck.launcher.FrontEndActivity +import com.droiddeck.launcher.R +import com.droiddeck.launcher.stores.download.StoreDownloadService + +/** Checks the catalog in the background while a PR test build is followed, and says when that PR has a new build. */ +class UpdateWatch : JobService() { + override fun onStartJob(params: JobParameters): Boolean { + Thread({ + runCatching { check(applicationContext) } + jobFinished(params, false) + }, "update-watch").start() + return true + } + + override fun onStopJob(params: JobParameters): Boolean = true + + companion object { + private const val JOB_ID = 41_230 + private const val NOTIFICATION_ID = 41_231 + private const val CHANNEL_ID = "test-builds" + private const val PREFS = "app_updates" + private const val KEY_SEEN = "watch_seen" + private const val INTERVAL_MS = 60 * 60 * 1000L + + fun sync(context: Context, follow: AppUpdates.Follow, current: AppUpdates.Release? = null) { + val scheduler = context.getSystemService(JobScheduler::class.java) ?: return + if (follow.channel != AppUpdates.Channel.TEST) { + scheduler.cancel(JOB_ID) + return + } + current?.let { seen(context, it) } + if (scheduler.getPendingJob(JOB_ID) != null) return + val job = JobInfo.Builder(JOB_ID, ComponentName(context, UpdateWatch::class.java)) + .setRequiredNetworkType(JobInfo.NETWORK_TYPE_ANY) + .setPeriodic(INTERVAL_MS) + .build() + runCatching { scheduler.schedule(job) } + } + + fun seen(context: Context, release: AppUpdates.Release) { + prefs(context).edit().putString(KEY_SEEN, key(release)).apply() + } + + private fun key(r: AppUpdates.Release) = "${r.pr}:${r.commit}:${r.versionCode}:${r.apk?.sha256.orEmpty()}" + + + internal fun check(context: Context) { + val catalog = AppUpdates.refresh(context) + val follow = AppUpdates.follow(context, catalog) + if (follow.channel != AppUpdates.Channel.TEST) return + val release = AppUpdates.release(catalog, follow) ?: return + if (prefs(context).getString(KEY_SEEN, null) == key(release)) return + val me = AppUpdates.installed() + val offer = AppUpdates.offer(catalog, follow, me) + if (!me.updatable || AppUpdates.installBlock(release, me) != null || + (offer != AppUpdates.Offer.UPDATE && offer != AppUpdates.Offer.SWITCH) + ) return + if (post(context, release)) seen(context, release) + } + + private fun post(context: Context, release: AppUpdates.Release): Boolean { + val manager = context.getSystemService(NotificationManager::class.java) ?: return false + manager.createNotificationChannel( + NotificationChannel(CHANNEL_ID, context.getString(R.string.upd_watch_channel), NotificationManager.IMPORTANCE_DEFAULT), + ) + if (!manager.areNotificationsEnabled() || + manager.getNotificationChannel(CHANNEL_ID)?.importance == NotificationManager.IMPORTANCE_NONE + ) return false + val open = PendingIntent.getActivity( + context, NOTIFICATION_ID, + Intent(context, FrontEndActivity::class.java).putExtra(StoreDownloadService.EXTRA_NAV, "updates") + .addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP or Intent.FLAG_ACTIVITY_REORDER_TO_FRONT), + PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT, + ) + val text = context.getString(R.string.upd_watch_text, release.title.ifBlank { release.commit.take(7) }) + val notification = Notification.Builder(context, CHANNEL_ID) + .setSmallIcon(R.drawable.ic_stat_session) + .setContentTitle(context.getString(R.string.upd_watch_title, release.pr)) + .setContentText(text) + .setStyle(Notification.BigTextStyle().bigText(text)) + .setContentIntent(open) + .setAutoCancel(true) + .build() + return runCatching { manager.notify(NOTIFICATION_ID, notification) }.isSuccess + } + + private fun prefs(context: Context) = context.getSharedPreferences(PREFS, Context.MODE_PRIVATE) + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/wayland/CompositorHost.kt b/app/src/main/java/com/droiddeck/launcher/wayland/CompositorHost.kt index 7166440029..7fcdc09620 100644 --- a/app/src/main/java/com/droiddeck/launcher/wayland/CompositorHost.kt +++ b/app/src/main/java/com/droiddeck/launcher/wayland/CompositorHost.kt @@ -50,6 +50,7 @@ object CompositorHost { refreshHz: Float, fpsLimit: Int, ): Boolean { + WaylandCompositor.nativeSetClockControl(java.io.File(context.filesDir, "${com.droiddeck.launcher.runtime.LinuxRuntime.DIR}/tmp/.bl-clock").path) ownVsyncThread = SessionPrefs.vsyncThread(context) WaylandCompositor.nativeSetRenderOnCommit(SessionPrefs.renderOnCommit(context)) pace(refreshHz, fpsLimit) @@ -135,7 +136,9 @@ object CompositorHost { vsyncRunning = false } + @Synchronized fun newSession() { + WaylandCompositor.nativeSetClockControl(null) if (started) WaylandCompositor.nativeResetFirstFrame() } diff --git a/app/src/main/java/com/droiddeck/launcher/wayland/WaylandCompositor.java b/app/src/main/java/com/droiddeck/launcher/wayland/WaylandCompositor.java index a2ac2171df..10735a1710 100644 --- a/app/src/main/java/com/droiddeck/launcher/wayland/WaylandCompositor.java +++ b/app/src/main/java/com/droiddeck/launcher/wayland/WaylandCompositor.java @@ -178,6 +178,8 @@ public final class WaylandCompositor { public static native void nativeVsync(long frameTimeNanos); + public static native void nativeSetClockControl(String path); + public static native int nativeCompositorTid(); private static native String nativeCompositorFault(); @@ -338,6 +340,7 @@ public final class WaylandCompositor { public static native int nativeFrameGenProblem(); public static native String nativeFrameGenCapsReason(); + public static native boolean nativeFrameGenActive(); public static native float[] nativeFrameGenStats(); public static native long nativeHudFrameTimes(float[] out); diff --git a/app/src/main/res/drawable/ic_repeat_all.xml b/app/src/main/res/drawable/ic_repeat_all.xml new file mode 100644 index 0000000000..c696a476a6 --- /dev/null +++ b/app/src/main/res/drawable/ic_repeat_all.xml @@ -0,0 +1,10 @@ + + + + diff --git a/app/src/main/res/drawable/ic_repeat_off.xml b/app/src/main/res/drawable/ic_repeat_off.xml new file mode 100644 index 0000000000..e989d57d7b --- /dev/null +++ b/app/src/main/res/drawable/ic_repeat_off.xml @@ -0,0 +1,11 @@ + + + + diff --git a/app/src/main/res/drawable/ic_repeat_one.xml b/app/src/main/res/drawable/ic_repeat_one.xml new file mode 100644 index 0000000000..fda860fcc2 --- /dev/null +++ b/app/src/main/res/drawable/ic_repeat_one.xml @@ -0,0 +1,10 @@ + + + + diff --git a/app/src/main/res/drawable/ic_shuffle_off.xml b/app/src/main/res/drawable/ic_shuffle_off.xml new file mode 100644 index 0000000000..3ede806a20 --- /dev/null +++ b/app/src/main/res/drawable/ic_shuffle_off.xml @@ -0,0 +1,11 @@ + + + + diff --git a/app/src/main/res/drawable/ic_shuffle_on.xml b/app/src/main/res/drawable/ic_shuffle_on.xml new file mode 100644 index 0000000000..8f62d5de55 --- /dev/null +++ b/app/src/main/res/drawable/ic_shuffle_on.xml @@ -0,0 +1,10 @@ + + + + diff --git a/app/src/main/res/drawable/ic_soundtrack.xml b/app/src/main/res/drawable/ic_soundtrack.xml new file mode 100644 index 0000000000..00839efe01 --- /dev/null +++ b/app/src/main/res/drawable/ic_soundtrack.xml @@ -0,0 +1,10 @@ + + + + diff --git a/app/src/main/res/values-ar/input_library.xml b/app/src/main/res/values-ar/input_library.xml new file mode 100644 index 0000000000..68f65da57e --- /dev/null +++ b/app/src/main/res/values-ar/input_library.xml @@ -0,0 +1,132 @@ + + + ุงู„ุดุงุดุฉ ุงู„ู…ุญุฏุฏุฉ ุบูŠุฑ ู…ุชุงุญุฉ. ูˆุตู‘ู„ู‡ุง ู„ุชุญุฑูŠุฑ ู‡ุฐุง ุงู„ุชุฎุทูŠุท ุจุญุฌู…ู‡ ุงู„ูุนู„ูŠ. + ุชุฌุงู‡ู„ ุชุบูŠูŠุฑุงุช ุงู„ุชุฎุทูŠุท ุบูŠุฑ ุงู„ู…ุญููˆุธุฉุŸ + ูŠุณุชุฎุฏู… ู‡ุฐุง ุงู„ุชุฎุทูŠุท %1$d ู…ู† ู…ู„ูุงุช ุงู„ุชุนุฑูŠู. ุชูุทุจูŽู‘ู‚ ุงู„ุชุบูŠูŠุฑุงุช ุงู„ู…ุญููˆุธุฉ ุนู„ู‰ ุฌู…ูŠุนู‡ุง. + ู…ู„ูุงุช ุงู„ุชุนุฑูŠู ุงู„ุงูุชุฑุงุถูŠุฉ + ูˆุถุน ุณุทุญ ุงู„ู…ูƒุชุจ + ูˆุถุน ุงู„ู„ุนุจ + ุงูุชุฑุงุถูŠ ู„ุณุทุญ ุงู„ู…ูƒุชุจ ูˆุงู„ู„ุนุจ + ุงูุชุฑุงุถูŠ ู„ูˆุถุน ุงู„ู„ุนุจ + ุงูุชุฑุงุถูŠ ู„ูˆุถุน ุณุทุญ ุงู„ู…ูƒุชุจ + ุฅุนุฏุงุฏุงุช ุงู„ุฌู‡ุงุฒ + ุนู†ุงุตุฑ ุงู„ุชุญูƒู… + ุฃุฒุฑุงุฑ ูˆุนุตูŠ ูˆุฒู†ุงุฏุงุช ูˆู…ูุงุชูŠุญ ุฅุถุงููŠุฉ + ู†ุณุฎ ู…ู„ู ุงู„ุชุนุฑูŠู + ุฅุนุงุฏุฉ ุชุนูŠูŠู† ุงู„ุฅุฌุฑุงุกุงุช + ุฅุนุงุฏุฉ ุชุนูŠูŠู† ุงู„ุฅุฌุฑุงุกุงุช ููŠ %1$s ุฅู„ู‰ ู‚ูŠู… ู…ู„ู ุงู„ุชุนุฑูŠู ุงู„ุฃุณุงุณูŠุŸ ุณุชุจู‚ู‰ ุงู„ุชุฎุทูŠุทุงุช ูˆู…ู„ูุงุช ุงู„ุชุนุฑูŠู ุงู„ุฃุฎุฑู‰ ุฏูˆู† ุชุบูŠูŠุฑ. + ุญุฐู %1$sุŸ ุณุชุนูˆุฏ ุงู„ุฃูˆุถุงุน ุงู„ุชูŠ ุชุณุชุฎุฏู…ู‡ ุฅู„ู‰ ู…ู„ู ุงู„ุชุนุฑูŠู ุงู„ุงูุชุฑุงุถูŠ ุงู„ู…ุฏู…ุฌ. ุณุชุจู‚ู‰ ุงู„ุชุฎุทูŠุทุงุช ุงู„ู…ุญููˆุธุฉ ูˆุงู„ุฅุนุฏุงุฏุงุช ุงู„ู…ุดุชุฑูƒุฉ ู…ุชุงุญุฉ. + ุงู„ุธู‡ูˆุฑ + ูŠู†ุทุจู‚ ุนู„ู‰ ุฌู…ูŠุน ู…ู„ูุงุช ุงู„ุชุนุฑูŠู. ูŠุนุฑุถ Auto ุนู†ุงุตุฑ ุชุญูƒู… ุงู„ุดุงุดุฉ ุงู„ุฑุฆูŠุณูŠุฉ ุนู†ุฏ ุนุฏู… ุชูˆุตูŠู„ ูˆุญุฏุฉ ุชุญูƒู… ููŠ ูˆุถุน ุงู„ู„ุนุจ. + ุงู„ุชุญุฑูŠุฑ ุนู„ู‰ ุงู„ุดุงุดุฉ + ุงู„ุชุฎุทูŠุทุงุช ุงู„ู…ุญููˆุธุฉโ€ฆ + ุงุฎุชุฑ ุชุฎุทูŠุทู‹ุง ุฃูˆ ุฃู†ุดุฆ ุชุฎุทูŠุทูƒ + ุงุฎุชุฑ ุนู†ุงุตุฑ ุชุญูƒู… ู…ู„ู ุงู„ุชุนุฑูŠู ููŠ ู‚ุงุฆู…ุฉ ุฌู„ุณุฉ ุงู„ุดุงุดุฉ ุงู„ุซุงู†ูˆูŠุฉ. ูŠุญุฏุฏ ู…ุญุฏุฏุง ู…ู„ู ุงู„ุชุนุฑูŠู ูˆุงู„ุดุงุดุฉ ุงู„ุซุงู†ูˆูŠุฉ ููŠ ู‚ุงุฆู…ุฉ ูˆุญุฏุฉ ุงู„ุชุญูƒู… ุนู†ุงุตุฑ ุงู„ุชุญูƒู… ุงู„ู…ุนุฑูˆุถุฉ. + ุฅุฌุฑุงุกุงุช ุงู„ุฃุฒุฑุงุฑ + ู…ุดุชุฑูƒ ู…ุน %1$s. ุชูุทุจูŽู‘ู‚ ุงู„ุชุนุฏูŠู„ุงุช ุนู„ู‰ ุชู„ูƒ ุงู„ู…ู„ูุงุช ุฃูŠุถู‹ุง. + ุฅุนุงุฏุฉ ุงุณุชุฎุฏุงู… ุงู„ุฅุนุฏุงุฏุงุช + ุงุณุชุฎุฏุงู… ุงู„ุฅุนุฏุงุฏุงุช ู…ู†โ€ฆ + ุงู„ู†ุณุฎ ู…ู† ู…ู„ู ุชุนุฑูŠู ุขุฎุฑ ุฃูˆ ุฅุจู‚ุงุก ุงู„ุฅุนุฏุงุฏุงุช ู…ุดุชุฑูƒุฉ + ุฌุนู„ู‡ ู…ุณุชู‚ู„ู‹ุง + ุงู„ุงุญุชูุงุธ ุจุงู„ุฅุนุฏุงุฏ ุงู„ุญุงู„ูŠ ูˆุฅูŠู‚ุงู ู…ุดุงุฑูƒุฉ ุงู„ุชุบูŠูŠุฑุงุช + ุชุญูุธ ุงู„ุชุฎุทูŠุทุงุช ุงู„ุนู†ุงุตุฑ ูˆู…ูˆุงุถุนู‡ุง. ูŠู…ูƒู† ู„ูƒู„ ู…ู„ู ุชุนุฑูŠู ุชุนูŠูŠู† ุฅุฌุฑุงุกุงุชู‡. ุญุฑู‘ุฑ ุจุงู„ุญุฌู… ุงู„ูƒุงู…ู„ ุนู„ู‰ ุงู„ุดุงุดุฉ ุงู„ู‡ุฏู. + ุงู„ุชุฎุทูŠุท ุงู„ุญุงู„ูŠ + ุญุฐู ุงู„ุชุฎุทูŠุท ุบูŠุฑ ุงู„ู…ุณุชุฎุฏู… %1$s ูˆุฅุฌุฑุงุกุงุชู‡ ุงู„ู…ุญููˆุธุฉุŸ + ุฅุนุงุฏุฉ ุชุณู…ูŠุฉ ุงู„ุชุฎุทูŠุท ุงู„ุญุงู„ูŠ + ุชู… ุญูุธ ุฅุนุฏุงุฏุงุช ุงู„ุฅุฏุฎุงู„ ุบูŠุฑ ุงู„ู…ู‚ุฑูˆุกุฉ ููŠ ู†ุณุฎุฉ ุงุณุชุฑุฏุงุฏ. ูŠู…ูƒู†ูƒ ู…ุชุงุจุนุฉ ุชุญุฑูŠุฑ ู…ู„ูุงุช ุงู„ุชุนุฑูŠู ุงู„ู…ุณุชุนุงุฏุฉ. + ุงู„ุฎุตุงุฆุต + ุฎุตุงุฆุต ุงู„ู†ู‚ุฑ + %1$s ยท ู†ู‚ุฑ + ุฃุฒุฑุงุฑ + ุงู„ุนุตูŠ ูˆุงู„ู„ูˆุญุงุช ูˆุงู„ุฒู†ุงุฏุงุช + ุฅุฎูุงุก ุงู„ุฃุฏูˆุงุช + ูˆุญุฏุฉ ุงู„ุชุญูƒู… + ุฅุฑุณุงู„ ุฅุฏุฎุงู„ ูˆุญุฏุฉ ุงู„ุชุญูƒู… ุฅู„ู‰ Steam Input ุฃูˆ ุงู„ู„ุนุจุฉ. + ู‡ุฐุง ุงู„ุนู†ุตุฑ ู„ุง ูŠุฑุณู„ ุฅุฏุฎุงู„ ูˆุญุฏุฉ ุชุญูƒู… ุฃูˆ ูุฃุฑุฉ ุฃูˆ ู„ูˆุญุฉ ู…ูุงุชูŠุญ. + ู†ู‚ุฑุฉ ุงู„ูุฃุฑุฉ + ุฅุฌุฑุงุก DroidDeck + ุฅุฌุฑุงุก + ุณุฑุนุฉ ุงู„ุชู…ุฑูŠุฑ: %1$d ุฎุทูˆุฉ/ุซ + + ู…ู„ู ุชุนุฑูŠู ุฌุฏูŠุฏ + + ุชุฎุทูŠุท ุฌุฏูŠุฏ + %1$s ยท ูŠุณุชุฎุฏู…ู‡ %2$d ู…ู† ู…ู„ูุงุช ุงู„ุชุนุฑูŠู. ุชูุทุจูŽู‘ู‚ ุงู„ุชุบูŠูŠุฑุงุช ุนู„ู‰ ูƒู„ ู…ู„ู ุชุนุฑูŠู ูŠุณุชุฎุฏู… ู‡ุฐู‡ ุงู„ุชุนูŠูŠู†ุงุช. + ุฅุนุงุฏุฉ ุชุณู…ูŠุฉ + ุญุฐู + ุฃุถู ุนู†ุงุตุฑ ุฅู„ู‰ ุงู„ุชุฎุทูŠุท ู‚ุจู„ ุชุนูŠูŠู† ุฅุฌุฑุงุกุงุชู‡ุง. + ุชุนุฐู‘ุฑ ุญูุธ ุฅุนุฏุงุฏุงุช ุงู„ุฅุฏุฎุงู„ + ุงู„ุงุณู… + ุงู„ุจุฏุก ู…ู† + ุฒุฑ + ุนุตุง + ู„ูˆุญุฉ ู„ู…ุณ + ุชูˆุฌูŠู‡ ู…ุชู‚ุงุทุน + ุฒู†ุงุฏ + ุชู… + ุชุฑุงุฌุน + + ุฅุถุงูุฉ + ุงุณุญุจ ู„ู„ุชุญุฑูŠูƒ. ุงุณุญุจ ุฒุงูˆูŠุฉ ู„ุชุบูŠูŠุฑ ุงู„ุญุฌู…. ุงุถุบุท ุนู„ู‰ ุงู„ุฎุตุงุฆุต ู„ุชุนูŠูŠู† ุฅุฌุฑุงุก. + ุงู„ุชุญุฑูŠุฑ ุนู„ู‰ ุงู„ุดุงุดุฉ ุงู„ุซุงู†ูˆูŠุฉ + ุฅุนุงุฏุฉ ุงุณุชุฎุฏุงู… %1$s ู…ู† ู…ู„ู ุชุนุฑูŠู ุขุฎุฑ. ุณุชุจู‚ู‰ ู…ุตุงุฏุฑ ุงู„ุชุญูƒู… ุงู„ุฃุฎุฑู‰ ุฏูˆู† ุชุบูŠูŠุฑ. + ุฅุจู‚ุงุก ุนู†ุงุตุฑ ุงู„ุชุญูƒู… ุงู„ูุนู„ูŠุฉ ู…ุดุชุฑูƒุฉ + ุงูุชุฑุงุถูŠู‹ุงุŒ ุฌู…ูŠุน ุนู†ุงุตุฑ ุงู„ุชุญูƒู… ูˆุงู„ุชุฎุทูŠุทุงุช ุงู„ู…ุฎุตุตุฉ ู†ุณุฎ ู…ุณุชู‚ู„ุฉ. ุงู„ู…ุดุงุฑูƒุฉ ุชุฑุจุท ุนู†ุงุตุฑ ุงู„ุชุญูƒู… ุงู„ูุนู„ูŠุฉ ูู‚ุท. + ุงุณุชุฎุฏุงู… ู‡ุฐู‡ ุงู„ุนู†ุงุตุฑ ูˆุงู„ู…ูˆุงุถุน. ุชุญุงูุธ ุงู„ู…ุดุงุฑูƒุฉ ุนู„ู‰ ุชุฒุงู…ู† ุชุนุฏูŠู„ุงุช ุงู„ุฃุจุนุงุฏ ุงู„ู…ุณุชู‚ุจู„ูŠุฉุ› ุชุจู‚ู‰ ุฅุฌุฑุงุกุงุช ุงู„ุฃุฒุฑุงุฑ ู…ุณุชู‚ู„ุฉ. ูŠุจุฏุฃ ุงู„ุชุฎุทูŠุท ุงู„ู…ุฎุชู„ู ุจุฅุฌุฑุงุกุงุช ุบูŠุฑ ู…ุนูŠู‘ู†ุฉ. + ู†ุณุฎ ุนู†ุงุตุฑ ุงู„ุชุญูƒู… ูˆุงู„ุฅุฌุฑุงุกุงุช ู‡ุฐู‡ ุฃูˆ ุฑุจุทู‡ุง ุจุญูŠุซ ุชู†ุทุจู‚ ุงู„ุชุนุฏูŠู„ุงุช ุงู„ู…ุณุชู‚ุจู„ูŠุฉ ุนู„ู‰ ูƒู„ุง ุงู„ู…ู„ููŠู†. + ุฅุจู‚ุงุก ู…ุดุชุฑูƒู‹ุง + ู†ุณุฎุฉ ู…ุณุชู‚ู„ุฉ + ุจุฏุก ุงู„ุนุตุง ุนู†ุฏ ู…ูˆุถุน ุงู„ู„ู…ุณ + ุฅุฎูุงุก ุงู„ุนุตุง ุนู†ุฏ ุนุฏู… ุงู„ุงุณุชุฎุฏุงู… + ุงู„ุฃุฏูˆุงุช + ุชู„ู‚ุงุฆูŠ (%1$s) + ู…ุฎุตุต (%1$s) + ุญูุธ ูƒู…ู„ู ุชุนุฑูŠู ุฌุฏูŠุฏ + ุนู†ุงุตุฑ ุชุญูƒู… ู…ู„ู ุงู„ุชุนุฑูŠู + ู…ู„ู ุงู„ุชุนุฑูŠู + ุฅูŠู…ุงุกุงุช ู„ูˆุญุฉ ู„ู…ุณ ุงู„ูุฃุฑุฉ + ุนู†ุฏ ุชุนูŠูŠู†ู‡ุง ู„ู…ุคุดุฑ ุงู„ูุฃุฑุฉ: ุงุถุบุท ู„ู„ู†ู‚ุฑุŒ ูˆุงุณุชู…ุฑ ู„ู„ุชู…ุฑูŠุฑ ุจุงู„ุณุญุจุŒ ูˆู…ุฑู‘ุฑ ุจุฅุตุจุนูŠู†. + ู„ุฏู‰ %1$s ุชุฌุงูˆุฒ ู„ู„ู‚ุงุฆู…ุฉ ุงู„ุณุฑูŠุนุฉ. ุงุฎุชุฑ ุชู„ู‚ุงุฆูŠ ู‡ู†ุงูƒ ู„ุงุณุชุฎุฏุงู… ู…ู„ู ุงู„ุชุนุฑูŠู ุงู„ุงูุชุฑุงุถูŠ ูˆุงู„ุฃุฌุฒุงุก ุงู„ุซู„ุงุซุฉ ุงู„ู…ุญููˆุธุฉ. + ุฅุฏุฎุงู„ DroidDeck + ูŠูุญุชุฌุฒ ุฃุซู†ุงุก ุชุญุฑูŠูƒ ุงู„ุนุตุง ููŠ ุฃูŠ ุงุชุฌุงู‡: ูŠูุถุบุท ููˆู‚ 55% ูˆูŠูุญุฑู‘ุฑ ุชุญุช 35%. ุงุณุชุฎุฏู… ู…ูุงุชูŠุญ ุงู„ุงุชุฌุงู‡ ู„ุชุนูŠูŠู† ูƒู„ ุงุชุฌุงู‡ ุนู„ู‰ ุญุฏุฉ. ุชูู†ููŽู‘ุฐ ุฃูˆุงู…ุฑ DroidDeck ู…ุฑุฉ ูˆุงุญุฏุฉ ู„ูƒู„ ุงู†ุญุฑุงู. ูŠูุถุจุท ุงู„ู†ู‚ุฑ ุนู„ู‰ ุงู„ุนุตุง ุนู„ู‰ ุญุฏุฉ. + ูŠูุญุชุฌุฒ ุฃุซู†ุงุก ู„ู…ุณ ู„ูˆุญุฉ ุงู„ู„ู…ุณุ› ูˆูŠูุญุฑู‘ุฑ ุนู†ุฏ ุฑูุน ุฅุตุจุนูƒ. ุชูู†ููŽู‘ุฐ ุฃูˆุงู…ุฑ DroidDeck ู…ุฑุฉ ูˆุงุญุฏุฉ ู„ูƒู„ ู„ู…ุณุฉ. ูŠูุถุจุท ุงู„ู†ู‚ุฑ ุนู„ู‰ ุงู„ู„ูˆุญุฉ ุนู„ู‰ ุญุฏุฉ. + ูŠูุญุชุฌุฒ ุนู†ุฏู…ุง ูŠุชุฌุงูˆุฒ ุงู„ุฒู†ุงุฏ 55%ุ› ูˆูŠูุญุฑู‘ุฑ ุชุญุช 35%. ุชูู†ููŽู‘ุฐ ุฃูˆุงู…ุฑ DroidDeck ู…ุฑุฉ ูˆุงุญุฏุฉ ู„ูƒู„ ุถุบุทุฉ. + ุงุชุฌุงู‡ ุงู„ุชู…ุฑูŠุฑ + ุฑุฃุณูŠ + ุฃูู‚ูŠ + ุชู…ุฑูŠุฑ ุฃูู‚ูŠ + ุงู„ู‚ูŠุงุณุงุช + ูุนู‘ู„ ุงู„ุชุณุฌูŠู„ุŒ ูˆุงุณุชุฎุฏู… ุนู†ุงุตุฑ ุงู„ุชุญูƒู… ููŠ ุฌู„ุณุฉ ู‚ูŠุฏ ุงู„ุชุดุบูŠู„ุŒ ุซู… ุนุฏ ูˆุงู‚ุฑุฃ ุงู„ู†ุชุงุฆุฌ. ูŠู‚ูŠุณ ุฒู…ู† ุฅุฑุณุงู„ DroidDeck ูู‚ุทุŒ ูˆู„ูŠุณ ุฒู…ู† ุงุณุชุฌุงุจุฉ ุงู„ุดุงุดุฉ. ูŠู†ุชู‡ูŠ ุงู„ุชุณุฌูŠู„ ุนู†ุฏ ุฅุบู„ุงู‚ ุนู…ู„ูŠุฉ ุงู„ุชุทุจูŠู‚. + %1$d ุนู†ุงุตุฑ ุชุญูƒู… + ุชุฎุทูŠุทุงุช ู…ุญููˆุธุฉ ุฃุฎุฑู‰ (%1$d) โ–พ + ุฅุฎูุงุก ุงู„ุชุฎุทูŠุทุงุช ุงู„ู…ุญููˆุธุฉ ุงู„ุฃุฎุฑู‰ (%1$d) โ–ด + ุงู„ุฑุฆูŠุณูŠุฉ / Guide + ุฑุฌูˆุน ยท ู†ู‚ุฑุฉ ูˆุงุญุฏุฉ + ุฑุฌูˆุน ยท ู†ู‚ุฑ ู…ุฒุฏูˆุฌ + ุฑุฌูˆุน ยท ู…ุฑุชุงู† ููŠ Steam ูˆู…ุฑุฉ ููŠ ุณุทุญ ุงู„ู…ูƒุชุจ + ููŠ ูˆุถุน Steam. ุงู„ุงุณุชู…ุฑุงุฑ ุจุงู„ุถุบุท ุนู„ู‰ ุฑุฌูˆุน ูŠูุชุญ ุงู„ูˆุตูˆู„ ุงู„ุณุฑูŠุน ุฃูŠุถู‹ุง. + ุงู„ุงุณุชุนุงุฏุฉ ุฅู„ู‰ ุงู„ุงูุชุฑุงุถูŠ + ูŠุชู… ุชุฐูƒุฑ ุงุฎุชูŠุงุฑ ุงู„ู„ูˆุญุฉ. ูŠูุชุญ ุณุทุญ ุงู„ู…ูƒุชุจ ู…ุณุงุญุฉ ุนู…ู„ ุซุงู†ูŠุฉุ› ูˆู„ุง ูŠุบูŠู‘ุฑ ุงู„ุฌู„ุณุฉ ุฃูˆ ู…ู„ู ุชุนุฑูŠู ุงู„ุฅุฏุฎุงู„. + ูˆุญุฏุฉ ุชุญูƒู… ุงูุชุฑุงุถูŠุฉ + ู†ูˆุน ูˆุญุฏุฉ ุงู„ุชุญูƒู… ุงู„ุชูŠ ูŠุฑุงู‡ุง Steam ุฃูˆ ุงู„ู„ุนุจุฉ. + ุดุงุดุฉ ู„ู…ุณ + ูƒูŠููŠุฉ ุงู„ุชุนุงู…ู„ ู…ุน ุงู„ู„ู…ุณุงุช ุนู„ู‰ ุดุงุดุฉ ุงู„ู„ุนุจุฉ. ุชุญุชูุธ ุฃุฒุฑุงุฑ ู…ู„ู ุงู„ุชุนุฑูŠู ุจุฅุฌุฑุงุกุงุชู‡ุง ุงู„ู…ุนูŠู‘ู†ุฉ. + ู…ุคุดุฑ ุงู„ู„ู…ุณ + ุฅุธู‡ุงุฑ ู…ุคุดุฑ ู„ู„ู…ุณุงุช ุงู„ู…ุจุงุดุฑุฉ ุนู„ู‰ ุดุงุดุฉ ุงู„ู„ุนุจุฉ. + ุงู„ู„ู…ุณ ูˆุงู„ุงุณุชู…ุฑุงุฑ + ุฅุฌุฑุงุก ุงู„ูุฃุฑุฉ ุนู†ุฏ ุงู„ุงุณุชู…ุฑุงุฑ ุจุฅุตุจุน ุนู„ู‰ ุดุงุดุฉ ุงู„ู„ุนุจุฉ. + ู†ู‚ุฑุงุช ุฒุฑ ุฑุฌูˆุน + ุงู„ุฅุฌุฑุงุก ุงู„ุฃูˆู„: ู†ู‚ุฑุฉ ูˆุงุญุฏุฉ. ุงู„ุฅุฌุฑุงุก ุงู„ุซุงู†ูŠ: ู†ู‚ุฑุชุงู†. + ุฒุฑ ุชุจุฏูŠู„ + ุงุถุบุท ู„ู„ุงุณุชู…ุฑุงุฑุŒ ูˆุงุถุบุท ู…ุฑุฉ ุฃุฎุฑู‰ ู„ู„ุชุญุฑูŠุฑ. ูุชุญ ู‚ุงุฆู…ุฉ ุฃูˆ ุชุจุฏูŠู„ ู…ู„ู ุงู„ุชุนุฑูŠู ูŠุญุฑู‘ุฑ ุงู„ุฒุฑ. + ุงู„ุดูƒู„ + ู…ุณุชุฏูŠุฑ + ูƒุจุณูˆู„ุฉ + ุฏุงุฆุฑุฉ + ู…ุณุชุทูŠู„ + ุชุณู…ูŠุฉ ุงู„ุฒุฑ + ู†ุต + ุตูˆุฑุฉ ู…ุณุชูˆุฑุฏุฉ + ู…ูุงุชูŠุญ ู‚ุทุฑูŠุฉ ู…ู†ูุตู„ุฉ + ุนูŠู‘ู† ู…ูุชุงุญู‹ุง ู„ูƒู„ ู‚ุทุฑ. ุงู„ู‚ุทุฑ ุงู„ูุงุฑุบ ูŠุถุบุท ุงู„ุงุชุฌุงู‡ูŠู† ุงู„ู…ุฌุงูˆุฑูŠู†. + ุงู„ุงุชุฌุงู‡ุงุช ุงู„ู…ุฌุงูˆุฑุฉ + ุชู… ุญูุธ ู…ูุงุชูŠุญ ุงู„ุดุงุดุฉ ุงู„ู‚ุฏูŠู…ุฉ ูƒู…ู„ูุงุช ุชุนุฑูŠู ู…ุณุชูˆุฑุฏุฉ ุฃุฏู†ุงู‡. ุงุฎุชุฑ ูˆุงุญุฏู‹ุง ู„ุงุณุชุฎุฏุงู…ู‡ ุฃูˆ ุชุญุฑูŠุฑู‡. ุชู… ุงู„ุงุญุชูุงุธ ุจุชุญุฏูŠุฏุงุช ู…ู„ู ุงู„ุชุนุฑูŠู ุงู„ุญุงู„ูŠุฉ. + ู„ู… ู†ุชู…ูƒู† ู…ู† ุงุณุชูŠุฑุงุฏ ู…ูุงุชูŠุญ ุงู„ุดุงุดุฉ ุงู„ู‚ุฏูŠู…ุฉ ุชู„ู‚ุงุฆูŠู‹ุง. ุชู… ุงู„ุงุญุชูุงุธ ุจุงู„ุฅุนุฏุงุฏุงุช ุงู„ุฃุตู„ูŠุฉ. + diff --git a/app/src/main/res/values-ar/input_strings.xml b/app/src/main/res/values-ar/input_strings.xml new file mode 100644 index 0000000000..d375d35ff4 --- /dev/null +++ b/app/src/main/res/values-ar/input_strings.xml @@ -0,0 +1,38 @@ + + + ู…ู„ูุงุช ุชุนุฑูŠู ุงู„ุฅุฏุฎุงู„ + ู…ู„ูุงุช ุงู„ุชุนุฑูŠู + ูˆุญุฏุฉ ุชุญูƒู… ูุนู„ูŠุฉ + ุงู„ุดุงุดุฉ ุงู„ุฑุฆูŠุณูŠุฉ + ุงู„ุดุงุดุฉ ุงู„ุซุงู†ูˆูŠุฉ + ุฃุตู„ูŠ / Steam Input + ุฃุตู„ูŠ: %1$s + ุฅุฑุณุงู„ ุชุญูƒู… ุขุฎุฑ ู…ู† ูˆุญุฏุฉ ุงู„ุชุญูƒู… + ู…ุนุทู‘ู„ + ู…ูุชุงุญ ุฃูˆ ู…ุฌู…ูˆุนุฉ ู…ูุงุชูŠุญ + ู…ูุงุชูŠุญ ุงู„ุงุชุฌุงู‡ + ุชุญุฑูŠูƒ ุงู„ู…ุคุดุฑ + ุณุฑุนุฉ ุงู„ู…ุคุดุฑ: %1$d + ุชู…ุฑูŠุฑ + ุชู…ุฑูŠุฑ ุนู…ูˆุฏูŠ + ุฒุฑ ุงู„ูุฃุฑุฉ ุงู„ุฃูŠุณุฑ + ุฒุฑ ุงู„ูุฃุฑุฉ ุงู„ุฃูŠู…ู† + ุฒุฑ ุงู„ูุฃุฑุฉ ุงู„ุฃูˆุณุท + ูุชุญ ู‚ุงุฆู…ุฉ DroidDeck + ุฅุธู‡ุงุฑ ู„ูˆุญุฉ ุงู„ู…ูุงุชูŠุญ + ูุชุญ ู‚ุงุฆู…ุฉ Steam + ูุชุญ ุงู„ูˆุตูˆู„ ุงู„ุณุฑูŠุน ููŠ Steam + ุฅุฒุงู„ุฉ ุนู†ุตุฑ ุงู„ุชุญูƒู… + ุฅุถุงูุฉ ุนู†ุตุฑ ุชุญูƒู… + ุฃุฒุฑุงุฑ ุฎุงุตุฉ ุจุงู„ุฌู‡ุงุฒ + ุชุนูŠูŠู† ุฒุฑ ูุนู„ูŠ + ุญุฑู‘ุฑ ุงู„ุฒุฑ ุซู… ุงุฎุชุฑ ุชุญุฑูŠุฑ ุฃูˆ ุฅุนุงุฏุฉ ุงู„ู…ุญุงูˆู„ุฉ ุฃูˆ ุฅู„ุบุงุก. ูŠู„ุบูŠ B ุฃูˆ ุฑุฌูˆุน ุจุนุฏ ุงู„ุชุญุฑูŠุฑ. + ุฅุนุงุฏุฉ ุงู„ู…ุญุงูˆู„ุฉ + ุงุถุบุท ุฒุฑู‹ุงุŒ ุจู…ุง ููŠ ุฐู„ูƒ ุฒุฑ ุฑุฌูˆุน ูŠูุจู„ู‘ุบ ุนู†ู‡ ูƒู…ูุชุงุญ. ู…ูุงุชูŠุญ ุงู„ุตูˆุช ูˆู…ูุงุชูŠุญ ู†ุธุงู… Android ู…ุญุฌูˆุฒุฉ. ูŠู†ุทุจู‚ ุงู„ุชุนูŠูŠู† ุนู„ู‰ ู‡ุฐุง ุงู„ุฌู‡ุงุฒ ูู‚ุท. + ุฅุฒุงู„ุฉ ุงู„ุชุนูŠูŠู† + ุชุดุฎูŠุต ุงู„ุฅุฏุฎุงู„ + ุชุณุฌูŠู„ ุฒู…ู† ุฅุฑุณุงู„ ุงู„ุฅุฏุฎุงู„ + ู‚ุฑุงุกุฉ ุงู„ู‚ูŠุงุณุงุช + ูŠู‚ูŠุณ ุงู„ุฅุฑุณุงู„ ู…ู† Android ุญุชู‰ ุงู„ู†ุดุฑ ููŠ ู†ุงู‚ู„ ุงู„ุฅุฏุฎุงู„ ุงู„ุญุงู„ูŠ. ู„ุง ูŠุดู…ู„ ูˆุตูˆู„ Bluetooth ุฃูˆ ุงุณุชุนู„ุงู… ุงู„ุถูŠู ุฃูˆ ุงู„ุนุฑุถ ุฃูˆ ุฒู…ู† ุงุณุชุฌุงุจุฉ ุงู„ุดุงุดุฉ. ุงู„ุชุณุฌูŠู„ ู…ุชูˆู‚ู ุงูุชุฑุงุถูŠู‹ุง. + ุงุณุชุฎุฏุงู… ุชุนูŠูŠู† ุงู„ุฅุฏุฎุงู„ ุงู„ุนุงุฏูŠ + diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index 573c669b9d..191f4a79e3 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -28,6 +28,8 @@ ุชุนู„ูŠู‚ ุงู„ุขู† ุฅูŠู‚ุงู ุงู„ุฌู„ุณุฉ ุชูˆู„ูŠุฏ ุงู„ุฅุทุงุฑุงุช + ุฅุนุฏุงุฏุงุช ู‡ุฐู‡ ุงู„ู„ุนุจุฉ + ุงู„ุฅุนุฏุงุฏุงุช ุงู„ุงูุชุฑุงุถูŠุฉ ุงุฎุชุฑ ูˆุถุน ุชูˆู„ูŠุฏ ุงู„ุฅุทุงุฑุงุช ุฅูŠู‚ุงู DD-FG %1$dร— @@ -183,6 +185,7 @@ ุชุนุฐู‘ุฑ ุชู†ุฒูŠู„ ุจูŠุฆุฉ ุฑุณูˆู…ุงุช PowerVR. ุชุญู‚ู‚ ู…ู† ุงู„ุงุชุตุงู„ ูˆุญุงูˆู„ ู…ุฑุฉ ุฃุฎุฑู‰. ุชุนุฐู‘ุฑ ุชู†ุฒูŠู„ DirectAudioุŒ ู„ุฐุง ูŠุณุชุฎุฏู… ุตูˆุช ุงู„ุฃู„ุนุงุจ ุงู„ู…ุณุงุฑ ุงู„ุฃุจุทุฃ ููŠ ู‡ุฐู‡ ุงู„ุฌู„ุณุฉ. ู‡ุฐุง ุงู„ุจุฑู†ุงู…ุฌ + ู„ู… ุชุชู…ูƒู† ุงู„ุฌู„ุณุฉ ู…ู† ุงู„ุฑุณู… ุนู„ู‰ ุงู„ุดุงุดุฉ: %1$s. ุชุนุฑุถ ู‡ุฐู‡ ุงู„ุดุงุดุฉ ุงู„ุณุจุจ ุจุฏู„ู‹ุง ู…ู† ุดุงุดุฉ ุณูˆุฏุงุกุ› ูˆุงู„ุชูุงุตูŠู„ ููŠ ุณุฌู„ุงุช ุงู„ุฌู„ุณุฉ. ุชุนุฐู‘ุฑ ุชู†ุฒูŠู„ ุนู…ูŠู„ Steam. ู‚ุฏ ุชูƒูˆู† ุดุจูƒุชูƒ ุฃูˆ VPN ุชุญุธุฑ ุฎูˆุงุฏู… Steamุ› ุชุญู‚ู‘ู‚ ู…ู† ุงู„ุงุชุตุงู„ ูˆุญุงูˆู„ ู…ุฑุฉ ุฃุฎุฑู‰. ุชุนุฐู‘ุฑ ุฅุนุฏุงุฏ ุนู…ูŠู„ Steam. ุชุญู‚ู‘ู‚ ู…ู† ุงู„ุงุชุตุงู„ ูˆุงู„ู…ุณุงุญุฉ ุงู„ูุงุฑุบุฉุŒ ุซู… ุญุงูˆู„ ู…ุฑุฉ ุฃุฎุฑู‰. %1$s ู…ุจู†ูŠ ู„ุฃุฌู‡ุฒุฉ ูƒู…ุจูŠูˆุชุฑ x86 ูˆูŠุนู…ู„ ุนุจุฑ FEXุŒ ุงู„ุฐูŠ ู„ู… ูŠุชู… ุชุซุจูŠุชู‡ ุจุนุฏ. ุดุบู‘ู„ Steam ู…ุฑุฉ ูˆุงุญุฏุฉ ุฃุซู†ุงุก ุชุณุฌูŠู„ ุงู„ุฏุฎูˆู„ ูˆุฏุนู‡ ูŠูู†ุฒู‘ู„ FEX ูˆSteam Linux RuntimeุŒ ุซู… ุดุบู‘ู„ ู‡ุฐุง ุงู„ุจุฑู†ุงู…ุฌ ู…ุฌุฏุฏู‹ุง. @@ -389,6 +392,9 @@ ุบูŠุฑ ู…ุฏุนูˆู… ู‡ู†ุง ุจุนุฏ ุฌุงุฑู ุชุญู…ูŠู„ ุงู„ู…ูƒูˆู‘ู†ุงุชโ€ฆ ุชุนุฐู‘ุฑ ุงู„ุชุซุจูŠุช: %1$s + ู‡ุฐุง ุงู„ุชู†ุฒูŠู„ ุจุญุงุฌุฉ ุฅู„ู‰ ุชุญุฏูŠุซ. + ุงู„ุชุญุฏูŠุซ ููŠ ู‚ุงุฆู…ุฉ ุงู„ุงู†ุชุธุงุฑ. + ุฅุนุงุฏุฉ ู…ุญุงูˆู„ุฉ ุงู„ุชุญุฏูŠุซ ุชู… ุงู„ุชู†ุฒูŠู„ ุฌุงุฑู ุชู†ุฒูŠู„ %1$s ุฌุงุฑู ุงู„ุชุซุจูŠุช: %1$s @@ -419,6 +425,22 @@ ู…ุณุงุญุฉ ุงู„ุชุฎุฒูŠู† ุงู„ุฏุงุฎู„ูŠุฉ ูู‚ุท ุงู„ู…ุฌู„ุฏ: %1$s ู…ูƒุชุจุฉ ุซุงู†ูŠุฉ + ู…ูƒุชุจุงุช Steam ุฅุถุงููŠุฉ + ู…ุฌู„ุฏุงุช ูŠุณุชุทูŠุน Steam ุชุซุจูŠุช ุงู„ุฃู„ุนุงุจ ููŠู‡ุง ูˆุชุดุบูŠู„ู‡ุง ู…ู†ู‡ุงุŒ ู„ูƒู„ ู…ู†ู‡ุง ุงุณู…ู‡. ุฅุฒุงู„ุฉ ุฃุญุฏู‡ุง ุชุจู‚ูŠ ุฃู„ุนุงุจู‡ ุนู„ู‰ ุงู„ู‚ุฑุต. + ุฅุถุงูุฉ ู…ูƒุชุจุฉ + ุฅุนุงุฏุฉ ุงู„ุชุณู…ูŠุฉ + ุงุณู… ุงู„ู…ูƒุชุจุฉ + ุงุฎุชุฑ ู…ุฌู„ุฏู‹ุง ู„ู„ู…ูƒุชุจุฉ + ุงู„ุญุฏ ุงู„ุฃู‚ุตู‰ ู„ู„ู…ูƒุชุจุงุช ุงู„ู…ุถุงูุฉ: %1$d + ู‡ุฐุง ุงู„ู…ุฌู„ุฏ ู…ูƒุชุจุฉ ุจุงู„ูุนู„ ุฃูˆ ุฏุงุฎู„ ู…ูƒุชุจุฉ ุฃุฎุฑู‰ + %1$s ยท ุบูŠุฑ ู…ุชุงุญ + ูŠุณุฑูŠ ุจุฏุกู‹ุง ู…ู† ุฌู„ุณุฉ Steam ุงู„ุชุงู„ูŠุฉ + ุชู… ุงู„ุนุซูˆุฑ ุนู„ูŠู‡ุง ุนู„ู‰ ู‡ุฐุง ุงู„ุฌู‡ุงุฒ ยท %1$s ยท %2$s + ุฅุถุงูุฉ + ุงู„ุนุซูˆุฑ ุนู„ู‰ ู…ูƒุชุจุงุช ููŠ ุงู„ุชุฎุฒูŠู† ุงู„ุฏุงุฎู„ูŠ + ุงุณู…ุญ ุจุงู„ูˆุตูˆู„ ุฅู„ู‰ ุฌู…ูŠุน ุงู„ู…ู„ูุงุช ู„ูŠุชู…ูƒู† DroidDeck ู…ู† ุฑุคูŠุฉ ู…ูƒุชุจุงุช Steam ุงู„ุชูŠ ุชุญุชูุธ ุจู‡ุง ุชุทุจูŠู‚ุงุช ุฃุฎุฑู‰ ุนู„ู‰ ุงู„ุชุฎุฒูŠู† ุงู„ุฏุงุฎู„ูŠ + ุงู„ุณู…ุงุญ + ุชู…ุช ุฅุถุงูุฉ %1$sุŒ ู…ูƒุชุจุฉ Steam ุงู„ู…ูˆุฌูˆุฏุฉ ุฏุงุฎู„ ุงู„ู…ุฌู„ุฏ ุงู„ุฐูŠ ุงุฎุชุฑุชู‡ ู‚ุฏ ุชุชู‚ุทุน ุงู„ุฃู„ุนุงุจ ุงู„ุชูŠ ุชุญู…ู‘ู„ ู…ู„ูุงุชู‡ุง ุจุงุณุชู…ุฑุงุฑ ู…ู† ุจุทุงู‚ุฉ SD ุฃูˆ ู…ู† ู…ุณุงุญุฉ ุงู„ุชุฎุฒูŠู† ุงู„ู…ุดุชุฑูƒุฉ. ุชุดุฎูŠุต ุงู„ุชุฎุฒูŠู† ูŠุณุฌู‘ู„ ู†ุชุงุฆุฌ ุชุฎุตูŠุต ุงู„ู…ุณุงุญุฉ ูˆุนูŠู†ุงุช ู…ู† ุชูˆู‚ูŠุชุงุช ุงู„ุชุฎุฒูŠู† ููŠ ยซู…ุดุงุฑูƒุฉ ุงู„ุณุฌู„ุงุชยป. ู‚ุฏ ูŠุจุทุฆ ุนู…ู„ูŠุงุช ุงู„ุชุซุจูŠุช ุฃุซู†ุงุก ุชูุนูŠู„ู‡. ูŠูุทุจูŽู‘ู‚ ููŠ ุงู„ุฌู„ุณุฉ ุงู„ุชุงู„ูŠุฉ. @@ -486,6 +508,7 @@ ุชุดุบูŠู„ ูŠุจุฏุฃ ู…ุน Steam ูŠุจุฏุฃ ุจุฏูˆู† Steam + ุฏู‚ุฉ ุงู„ู„ุนุจุฉ ุงู„ุฅุนุฏุงุฏุงุช ุฅุนุฏุงุฏุงุช %1$s ุงู„ุงูุชุฑุงุถูŠ @@ -573,6 +596,8 @@ ุฃู†ูˆูŠุฉ ุงู„ุฃู„ุนุงุจ ุฃู†ูˆูŠุฉ ุงู„ุฃู„ุนุงุจ ุงู„ุฃู†ูˆูŠุฉ ุงู„ู…ุฎุตู‘ุตุฉ ู„ู„ุฃู„ุนุงุจ. ุนู†ุฏ ุชุญุฏูŠุฏู‡ุง ุฌู…ูŠุนู‹ุงุŒ ูŠูˆุฒู‘ุน Android ุงู„ู…ู‡ุงู… ุจุญุฑูŠุฉ. + ุชูˆููŠุฑ ุงู„ุทุงู‚ุฉ ููŠ ุงู„ุฃู„ุนุงุจ ุงู„ุซุงุจุชุฉ + ูŠุดุบู‘ู„ ุงู„ู„ุนุจุฉ ุนู„ู‰ ุงู„ุฃู†ูˆูŠุฉ ุงู„ุฃุจุทุฃ ู…ุง ุฏุงู…ุช ุชุญุงูุธ ุนู„ู‰ ู…ุนุฏู„ ุฅุทุงุฑุงุช ุซุงุจุชุŒ ูˆูŠุนูŠุฏู‡ุง ุฅู„ู‰ ุฃู†ูˆูŠุชู‡ุง ุงู„ู…ุนุชุงุฏุฉ ุนู†ุฏู…ุง ุชุชุฃุฎุฑ. ูˆุงุฌู‡ุฉ ุงู„ุนู…ูŠู„ GL ู…ุชุนุฏุฏ ู…ุคุดุฑุงุช ุงู„ุชุฑุงุจุท ู‚ุฏ ูŠุฌุนู„ ู‚ูˆุงุฆู… Steam ุฃุณุฑุน ุงุณุชุฌุงุจุฉ. @@ -608,7 +633,10 @@ ูŠุนุทู‘ู„ ู…ุณุงุนุฏ ุงู„ุชู†ู‚ู‘ู„ ุจูˆุญุฏุฉ ุงู„ุชุญูƒู… ููŠ ProtonุŒ ุงู„ุฐูŠ ูŠุณุชู‡ู„ูƒ CPU ููŠ ูƒู„ ู„ุนุจุฉ. ุชุดุบูŠู„ proot ุจู„ุง seccomp ู‚ุฏ ูŠูุตู„ุญ ุฃุฎุทุงุก ุงุณุชุฏุนุงุกุงุช ุงู„ู†ุธุงู… (syscall) ุงู„ู†ุงู‚ุตุฉ ุนู„ู‰ ุจุนุถ ุงู„ุฃู†ูˆูŠุฉ. ู‚ุฏ ูŠู‚ู„ู‘ู„ ุงู„ุฃุฏุงุก. + ุงู„ุชุดุบูŠู„ ุฏูˆู† proot (ุชุฌุฑูŠุจูŠ) + ูŠุจุฏุฃ ุชุดุบูŠู„ ุฌุงู†ุจ Linux ู…ุจุงุดุฑุฉ ุนู„ู‰ Android. ูŠุณุฑูŠ ุนู„ู‰ ุงู„ุฌู„ุณุฉ ุงู„ุชุงู„ูŠุฉ. ุฃูˆู‚ูู‡ ุฅุฐุง ุชุนุฐุฑ ุชุดุบูŠู„ ุฃูŠ ุดูŠุก. ู…ุณุงุฑ proot ุงู„ุณุฑูŠุน + ู„ุง ูŠูุณุชุฎุฏู… ุฏูˆู† proot. ูŠุญุชุงุฌ ุฅู„ู‰ ู…ุฑุดู‘ุญ seccomp ููŠ proot. ุนู…ู„ูŠุงุช ุจุญุซ ุฃุณุฑุน ุนู† ุงู„ู…ู„ูุงุช ูˆุชู‚ุทู‘ุน ุฃู‚ู„. ุฃูˆู‚ูู‡ ุฅุฐุง ุชุนุฐู‘ุฑ ุนู„ู‰ ุจุฑู†ุงู…ุฌ ุงู„ุนุซูˆุฑ ุนู„ู‰ ู…ู„ูุงุชู‡. ุฑุณู… ุงู„ู…ุคุดุฑ ุฏุงุฎู„ gamescope @@ -691,6 +719,7 @@ ุฐุงูƒุฑุฉ ุงู„ุฑุณูˆู…ุงุช ุฐุงูƒุฑุฉ ุงู„ุชุจุฏูŠู„ ู…ุณุชูˆู‰ ุงู„ุจุทุงุฑูŠุฉ + ุงู„ูˆู‚ุช ุงู„ู…ุชุจู‚ูŠ ู„ุนู…ุฑ ุงู„ุจุทุงุฑูŠุฉ ุงุณุชู‡ู„ุงูƒ ุงู„ุทุงู‚ุฉ ุงู„ุดุจูƒุฉ ุงู„ุฏู‚ุฉ @@ -821,6 +850,7 @@ ุงู„ุฌู‡ุงุฒ ู…ุฏุนูˆู… GPU ุบูŠุฑ ู…ูุฎุชุจูŽุฑ GPU ุบูŠุฑ ู…ุฏุนูˆู… + GPU ุนุจุฑ ุฌุณุฑ Mali %1$s ยท %2$s %1$s: %2$s ู„ุง ุชุชูˆูุฑ ูˆุงุฌู‡ุฉ ุฑุณูˆู…ุงุช ู…ุชูˆุงูู‚ุฉ ู…ุน %1$s. ู‚ุฏ ูŠุนุฑุถ Steam ุดุงุดุฉ ุณูˆุฏุงุก. @@ -850,15 +880,38 @@ ุงู„ุฌู„ุณุฉ ุณุฌู„ุงุช ุงู„ุฌู„ุณุฉ ุชูุญููŽุธ ุจุนุฏ ูƒู„ ุฌู„ุณุฉ + ุชุดุฎูŠุตุงุช ู…ูˆุณุนุฉ ู„ู„ุฌู„ุณุฉ ุงู„ุชุงู„ูŠุฉ + ูŠุฌู…ุน ุณุฌู„ุงุช ู…ูุตู„ุฉ ู„ุฌู„ุณุฉ ูˆุงุญุฏุฉ. ู‚ุฏ ูŠู‚ู„ู„ ุงู„ุฃุฏุงุก ูˆูŠุณุชู‡ู„ูƒ ู…ุณุงุญุฉ ุชุฎุฒูŠู† ุฃูƒุจุฑ. ูŠูˆู‚ู ู†ูุณู‡ ุนู†ุฏ ุจุฏุก ุงู„ุฌู„ุณุฉุ› ุฑุงุฌุน ุงู„ุณุฌู„ุงุช ู‚ุจู„ ู…ุดุงุฑูƒุชู‡ุง. ุณุฌู„ุงุช ุชุตุญูŠุญ ุงู„ุฃู„ุนุงุจ ุชุถู…ูŠู† ุจูŠุงู†ุงุช ุชุดุฎูŠุต Proton ูˆWine ูˆุงู„ุฑุณูˆู…ุงุช ุนู†ุฏ ุชุดุบูŠู„ ุงู„ู„ุนุจุฉ ุงู„ุชุงู„ูŠุฉ. ู‚ุฏ ูŠู‚ู„ู‘ู„ ุงู„ุฃุฏุงุก ูˆูŠุณุชู‡ู„ูƒ ู…ุณุงุญุฉ ุชุฎุฒูŠู† ุฃูƒุจุฑ. ุฃุนูุฏ ุชุดุบูŠู„ ู‡ุฐู‡ ุงู„ุฌู„ุณุฉ ู„ุญูุธ ุณุฌู„ุงุช ุชุตุญูŠุญ ุงู„ุฃู„ุนุงุจ ุชุนุฐู‘ุฑ ุชุญุฏูŠุซ ุงู„ุชุณุฌูŠู„. ุชุญู‚ู‘ู‚ ู…ู† ุงู„ู…ูุชุงุญ ูˆุญุงูˆู„ ู…ุฑุฉ ุฃุฎุฑู‰. ุฃุฏูˆุงุช ุชุตุญูŠุญ ุงู„ุฃุฎุทุงุก + ุณุฌู„ุงุช ุฑุณูˆู…ูŠุงุช ู…ูุตู„ุฉ + ูˆุงุฌู‡ุฉ Steam: ุงู„ุฑุณู… ุนุจุฑ GPU + ู…ุน ุฒูˆุฌ ู…ุดุบู‘ู„ุงุช XclipseุŒ ุชุฑุณู… Steam ุตูุญุงุชู‡ุง ุจุฑู…ุฌูŠู‹ุง (ุฃุธู‡ุฑ ุงู„ุฑุณู… ุนุจุฑ GPU ู…ุฑุจุนุงุช ู…ุดูˆู‡ุฉ). ุดุบู‘ู„ู‡ ู„ู„ุญุตูˆู„ ุนู„ู‰ ูˆุงุฌู‡ุฉ Steam ุฃุณุฑุน ุฅุฐุง ุจุฏุช ุงู„ุตูˆุฑุฉ ุณู„ูŠู…ุฉ ุนู„ู‰ ู‡ุฐุง ุงู„ู‡ุงุชู. + ุจูู†ูŠ ููŠ %1$s + ุชู… ุชุญุฏูŠุซ %1$s ุฅู„ู‰ ุฃุญุฏุซ ุฅุตุฏุงุฑ + ูุดู„ ุฌุณุฑ Mali ููŠ ุงุฎุชุจุงุฑู‡ ุงู„ุฐุงุชูŠ ุนู„ู‰ %1$s ุฎู„ุงู„ ุงู„ุฌู„ุณุฉ ุงู„ุฃุฎูŠุฑุฉ (ุงู„ุตูˆุฑ ุฃูˆ ุนู…ู„ูŠุงุช ุงู„ุฑุณู…)ุŒ ู„ุฐุง ุงุณุชุฎุฏู…ุช ุงู„ุฌู„ุณุฉ ุฒูˆุฌ ุจุฑุงู…ุฌ ุงู„ุชุดุบูŠู„ PanVK ุจุฏู„ู‹ุง ู…ู† ุฐู„ูƒ. + ู„ู… ูŠุฌุฏ ุฌุณุฑ Mali ุฃูŠ ุทุฑูŠู‚ุฉ ู„ู…ุดุงุฑูƒุฉ ุงู„ุฐุงูƒุฑุฉ ู…ุน ุจุฑู†ุงู…ุฌ ุงู„ุชุดุบูŠู„ ุนู„ู‰ %1$s ุฎู„ุงู„ ุงู„ุฌู„ุณุฉ ุงู„ุฃุฎูŠุฑุฉุŒ ู„ุฐุง ุงุณุชุฎุฏู…ุช ุงู„ุฌู„ุณุฉ ุฒูˆุฌ ุจุฑุงู…ุฌ ุงู„ุชุดุบูŠู„ PanVK ุจุฏู„ู‹ุง ู…ู† ุฐู„ูƒ. ู„ุง ูŠู…ูƒู† ู„ู„ุฌุณุฑ ุงู„ุนู…ู„ ุนู„ู‰ ู‡ุฐุง ุงู„ู‡ุงุชูุ› ูˆุฅูŠู‚ุงูู‡ ูŠูุจู‚ูŠ ุฒูˆุฌ PanVK. + ุชูุถุงู ุณุฌู„ุงุช Proton ูˆDXVK ูˆุจุฑุงู…ุฌ ุงู„ุชุดุบูŠู„ ู„ูƒู„ ู„ุนุจุฉ ุฅู„ู‰ ุณุฌู„ุงุช ุงู„ุฌู„ุณุฉ. ุชูƒูˆู† ู…ูุนู‘ู„ุฉ ุฏุงุฆู…ู‹ุง ุนู†ุฏู…ุง ู„ุง ูŠูƒูˆู† ู…ุนุงู„ุฌ ุงู„ุฑุณูˆู…ูŠุงุช Adreno. ุฃุญุฏุซ ุณุฌู„ุงุช ุงู„ุฌู„ุณุฉ ุณุฌู„ุงุช ุงู„ุฌู„ุณุฉ ุงู„ู…ุญููˆุธุฉ ูŠุญุชูุธ ุจุฃุญุฏุซ %1$d ู…ุณุญ ุงู„ุณุฌู„ุงุช + ุณุฌู„ุงุช ุงู„ุฌู„ุณุงุช ุงู„ู…ุชุงุญุฉ + ู„ุง ุชูˆุฌุฏ ุณุฌู„ุงุช ุฌู„ุณุงุช ู…ุญููˆุธุฉ ุจุนุฏ. + ุชุชุถู…ู† ู…ู„ูุงุช ZIP ุงู„ู…ุดุชุฑูƒุฉ ูˆุงู„ู…ุญููˆุธุฉ ุงู„ุฌู„ุณุฉ ุงู„ู…ุญุฏุฏุฉุŒ ุฅุถุงูุฉู‹ ุฅู„ู‰ ุจูŠุงู†ุงุช ุงู„ุชุดุฎูŠุต ุฐุงุช ุงู„ุตู„ุฉ ุจู€ Steam ูˆุงู„ู…ุชุฌุฑ ูˆุงู„ุฃุฏูˆุงุช ูˆBattle.net. + %1$s ยท %2$s + ุงู„ุฌู„ุณุฉ ุงู„ุญุงู„ูŠุฉ + ู…ุดุงุฑูƒุฉ + ุงู„ุญูุธ ุนู„ู‰ ุงู„ุฌู‡ุงุฒ + ุญุฐู + ุญุฐู ุณุฌู„ุงุช ุงู„ุฌู„ุณุฉุŸ + ุญุฐู %1$sุŸ ู„ุง ูŠู…ูƒู† ุงู„ุชุฑุงุฌุน ุนู† ู‡ุฐุง. + ุชู… ุญูุธ ุณุฌู„ุงุช ุงู„ุฌู„ุณุฉ. + ุชุนุฐู‘ุฑ ุญูุธ ุณุฌู„ุงุช ุงู„ุฌู„ุณุฉ. + ุชุนุฐู‘ุฑ ุญุฐู ุณุฌู„ุงุช ุงู„ุฌู„ุณุฉ. ุฅุนุงุฏุฉ ุชุนูŠูŠู† ูƒู„ ุงู„ุฅุนุฏุงุฏุงุช ุฅุฑุฌุงุน ูƒู„ ุฅุนุฏุงุฏ ุฅู„ู‰ ู‚ูŠู…ุชู‡ ุงู„ุงูุชุฑุงุถูŠุฉ ุฅุนุงุฏุฉ ุชุนูŠูŠู† @@ -885,6 +938,8 @@ ุงุณุชุฎุฏุงู… ูƒุดุงุดุฉ ุฑุฆูŠุณูŠุฉ ูŠู…ูƒู† ุฃู† ูŠูƒูˆู† DroidDeck ุชุทุจูŠู‚ ุงู„ุดุงุดุฉ ุงู„ุฑุฆูŠุณูŠุฉ ู„ุง ูŠูุนุฑูŽุถ DroidDeck ุฃุจุฏู‹ุง ูƒุชุทุจูŠู‚ ู„ู„ุดุงุดุฉ ุงู„ุฑุฆูŠุณูŠุฉ + ูŠูุชุญ ุฒุฑ ุงู„ุดุงุดุฉ ุงู„ุฑุฆูŠุณูŠุฉ + ุงู„ุตูุญุฉ ุงู„ุชูŠ ุชุธู‡ุฑ ุนู†ุฏู…ุง ูŠูƒูˆู† DroidDeck ุชุทุจูŠู‚ ุงู„ุดุงุดุฉ ุงู„ุฑุฆูŠุณูŠุฉ ูˆุชุถุบุท ุนู„ู‰ ุฒุฑ ุงู„ุดุงุดุฉ ุงู„ุฑุฆูŠุณูŠุฉ ููŠ ุฅุถุงูุฉ ุงู„ุฃู„ุนุงุจุŒ ุงุถุจุท DroidDeck ุนู„ู‰ ุชุถู…ูŠู† ุงู„ุงุชุฌุงู‡ ุงุชุฌุงู‡ ุงู„ู…ุดุบู‘ู„ @@ -898,15 +953,22 @@ ู…ู„ุก ุงู„ุดุงุดุฉ ูŠุฎููŠ ุดุฑูŠุทูŠ ุงู„ุญุงู„ุฉ ูˆุงู„ุชู†ู‚ู‘ู„ ููŠ Android ูŠุนุฑุถ ุดุฑูŠุทูŠ ุงู„ุญุงู„ุฉ ูˆุงู„ุชู†ู‚ู‘ู„ ููŠ Android + ุงู„ู…ุดุบู‘ู„ ุนู„ู‰ ุดุงุดุชูŠู† + ูŠุถุน ุงู„ูˆุถุน ยซุชู„ู‚ุงุฆูŠยป ุฃู‚ุณุงู… ุงู„ู…ุดุบู‘ู„ (Steam ูˆุงู„ู…ูƒุชุจุฉ ูˆุงู„ู…ุชุงุฌุฑ ูˆุบูŠุฑู‡ุง) ุนู„ู‰ ุงู„ุดุงุดุฉ ุงู„ุซุงู†ูŠุฉ ููŠ ุงู„ุฃุฌู‡ุฒุฉ ุงู„ู…ุญู…ูˆู„ุฉ ุงู„ู…ุฒูˆู‘ุฏุฉ ุจุดุงุดุฉ ุซุงู†ูŠุฉ ู…ุฏู…ุฌุฉ. ูˆูŠุณุชุฎุฏู… ุงู„ูˆุถุน ยซุชุดุบูŠู„ยป ุฃูŠ ุดุงุดุฉ ุซุงู†ูŠุฉ. ุฃู…ุง ุงู„ูˆุถุน ยซุฅูŠู‚ุงูยป ููŠูุจู‚ูŠ ุงู„ู…ุดุบู‘ู„ ุนู„ู‰ ุดุงุดุฉ ูˆุงุญุฏุฉ. + ุงู„ุฌู„ุณุงุช ุนู„ู‰ ุดุงุดุชูŠู† + ูŠุซุจู‘ุช ุงู„ูˆุถุน ยซุชู„ู‚ุงุฆูŠยป ู‚ุงุฆู…ุฉ ุฏุงุฎู„ ุงู„ู„ุนุจุฉ ุนู„ู‰ ุงู„ุดุงุดุฉ ุงู„ุซุงู†ูŠุฉ ุงู„ู…ุฏู…ุฌุฉ ุจุฏู„ู‹ุง ู…ู† ุงู„ู†ุงูุฐุฉ ุงู„ู…ู†ุจุซู‚ุฉ. ูˆูŠุณุชุฎุฏู… ุงู„ูˆุถุน ยซุชุดุบูŠู„ยป ุฃูŠ ุดุงุดุฉ ุซุงู†ูŠุฉ. ุฃู…ุง ุงู„ูˆุถุน ยซุฅูŠู‚ุงูยป ููŠูุจู‚ูŠ ุงู„ู‚ุงุฆู…ุฉ ุนู„ู‰ ุดุงุดุฉ ุงู„ู„ุนุจุฉุŒ ูˆูŠู…ูƒู†ูƒ ู…ุน ุฐู„ูƒ ุงุฎุชูŠุงุฑ ุดุงุดุฉ ุซุงู†ูŠุฉ ู…ู†ู‡ุง. ุชู„ู‚ุงุฆูŠ ุชุดุบูŠู„ ุฅูŠู‚ุงู ุนู†ุงุตุฑ ุชุญูƒู… ุงู„ุดุงุดุฉ ุงู„ุณูู„ูŠุฉ ููŠ ุงู„ุฃู„ุนุงุจ + ู„ูˆุญุฉ ู…ูุงุชูŠุญ Android ู„ุญู‚ูˆู„ ุงู„ู†ุต ูŠูุชุญ ู„ูˆุญุฉ ุงู„ู„ู…ุณ ูˆู„ูˆุญุฉ ุงู„ู…ูุงุชูŠุญ ุนู„ู‰ ุงู„ุดุงุดุฉ ุงู„ุซุงู†ูŠุฉ ุนู†ุฏ ุจุฏุก ุงู„ุฌู„ุณุฉ. ุงู„ูƒุชุงุจุฉ ุนู„ู‰ ุงู„ุดุงุดุฉ ุงู„ุนู„ูˆูŠุฉ ุชู… ุชุทุจูŠู‚ ุงู„ุดุงุดุฉ ุงู„ุฑุฆูŠุณูŠุฉ ุงู„ุงูุชุฑุงุถูŠ ุงุฎุชูŠุงุฑ ุชุทุจูŠู‚ ู„ู„ุดุงุดุฉ ุงู„ุฑุฆูŠุณูŠุฉ + ุฅุฎูุงุก ุงู„ู…ุดุบู„ ู…ู† ู‚ุงุฆู…ุฉ ุงู„ุชุทุจูŠู‚ุงุช ุงู„ุญุฏูŠุซุฉ ุฃุซู†ุงุก ุงู„ุฎู…ูˆู„ + ูŠุณุฑูŠ ุฐู„ูƒ ูู‚ุท ุนู†ุฏู…ุง ูŠูƒูˆู† DroidDeck ุชุทุจูŠู‚ ุงู„ุดุงุดุฉ ุงู„ุฑุฆูŠุณูŠุฉ ุงู„ุงูุชุฑุงุถูŠ ูˆู„ุง ุชูˆุฌุฏ ุฌู„ุณุฉ ู‚ูŠุฏ ุงู„ุชุดุบูŠู„. ุงุฎุชูŠุงุฑ ุชุทุจูŠู‚ุงุช Linux (ุชุฌุฑูŠุจูŠ) ุงู„ู…ู„ูุงุช @@ -1018,9 +1080,176 @@ ุงู„ู…ุนุงูŠู†ุฉ ุฃุญุฏุซ ุงู„ุฅุตู„ุงุญุงุชุŒ ู‚ุจู„ ุงู„ุฅุตุฏุงุฑ ุงู„ู…ุณุชู‚ุฑ ู…ุญุฏูŽู‘ุซ + ู†ุณุฎ ุชูุงุตูŠู„ ุงู„ุฅุตุฏุงุฑ + ุชู… ู†ุณุฎ ุชูุงุตูŠู„ ุงู„ุฅุตุฏุงุฑ + ุฃุญุฏุซ ู…ู† ุงู„ู…ุนุงูŠู†ุฉ + ุฅุตุฏุงุฑูƒ ุฃุญุฏุซ ู…ู† ุงู„ู…ุนุงูŠู†ุฉ + ู‡ุฐุง ุงู„ุฅุตุฏุงุฑ ุฃุญุฏุซ ู…ู† ุขุฎุฑ ุฅุตุฏุงุฑ ู…ุนุงูŠู†ุฉ. ุณูŠุญุฏู‘ุซู‡ ุฅุตุฏุงุฑ ุงู„ู…ุนุงูŠู†ุฉ ุงู„ุชุงู„ูŠ. + ุงุฎุชุฑ ุฅุตุฏุงุฑู‹ุง ู„ุฑุคูŠุฉ ุชุบูŠูŠุฑุงุชู‡ ุฃูˆ ุชุซุจูŠุชู‡. + ู…ุซุจู‘ุช + ุชุซุจูŠุช ู‡ุฐุง ุงู„ุฅุตุฏุงุฑ%1$s + ุงู„ุฑุฌูˆุน ุฅู„ู‰ ู‡ุฐุง ุงู„ุฅุตุฏุงุฑ%1$s + versionCode %1$d + ุงู„ุงู„ุชุฒุงู… %1$s + ุตูุญุฉ ุงู„ุฅุตุฏุงุฑ + ููŠ ุทู„ุจ ุงู„ุฏู…ุฌ ุงู„ุชุฒุงู… ุฃุญุฏุซ (%1$s). ุฅุตุฏุงุฑ ุงู„ุงุฎุชุจุงุฑ ุงู„ุฎุงุต ุจู‡ ู„ูŠุณ ุฌุงู‡ุฒู‹ุง ุจุนุฏุŒ ู„ุฐุง ู„ุง ูŠุชุถู…ู†ู‡ ู‡ุฐุง ุงู„ุฅุตุฏุงุฑ. + ุชู… ุฏูุน ุงู„ุชุฒุงู… ุฃุญุฏุซุŒ ุงู„ุฅุตุฏุงุฑ ู‚ูŠุฏ ุงู„ุงู†ุชุธุงุฑ + ุฑู‚ู… PR ุฃูˆ ุงู„ุนู†ูˆุงู† ุฃูˆ ุงู„ู…ุคู„ู + ู„ุง ูŠูˆุฌุฏ ุฅุตุฏุงุฑ ุงุฎุชุจุงุฑ ู…ุทุงุจู‚ + ูŠุญุชุงุฌ ุฅู„ู‰ ุฅุนุงุฏุฉ ุจู†ุงุก (versionCode %1$d) + ุชุญุฏูŠุซุงุช ุฅุตุฏุงุฑุงุช ุงู„ุงุฎุชุจุงุฑ + ุฅุตุฏุงุฑ ุงุฎุชุจุงุฑ ุฌุฏูŠุฏ ู„ู€ PR #%1$d + %1$s. ุงูุชุญ ุงู„ุชุญุฏูŠุซุงุช ู„ุชุซุจูŠุชู‡. + ุนุฑุถ ุงู„ู…ุฒูŠุฏ (%1$d) + ุชุญุชุงุฌ ุฅู„ู‰ ุฅุนุงุฏุฉ ุจู†ุงุก ู„ู€ versionCode %2$d (%1$d) + ุฅุตุฏุงุฑุงุช ุงู„ู…ุนุงูŠู†ุฉ ุนู„ู‰ main ู…ู†ุฐ ุฅุตุฏุงุฑ ุงู„ุงุฎุชุจุงุฑ ู‡ุฐุง: %1$d ุฅุตุฏุงุฑุงุช ุงู„ุงุฎุชุจุงุฑ ุฌุฑู‘ุจ ุฅุตู„ุงุญู‹ุง ู‚ุจู„ ุฅุตุฏุงุฑู‡ ุฑุณู…ูŠู‹ุง ู„ุง ุดูŠุก ุญุงู„ูŠู‹ุง + ุฅุตุฏุงุฑ ุงู„ู…ุฎุชุจุฑ + ุฅุตุฏุงุฑุงุช ุงู„ู…ุฎุชุจุฑ + ู‚ูŠุฏ ุงู„ุงุณุชุฎุฏุงู… + ู…ุชูˆู‚ู ู…ุคู‚ุชู‹ุง ุจุนุฏ ุฃู† ุฃุนุงุฏ Android ุชุญุณูŠู† DroidDeck + ุบูŠุฑ ู…ูุญู…ู‘ู„: %1$s + ุจุงู†ุชุธุงุฑ ุฅุนุงุฏุฉ ุงู„ุชุดุบูŠู„ + ุชู… ุงู„ุงุญุชูุงุธ ุจู‡ุง + ู„ุฅุตุฏุงุฑ ุขุฎุฑ + ุฅุนุงุฏุฉ ุงู„ุจู†ุงุก + ูŠุญุฐู ู‡ุฐุง ุงู„ุฅุตุฏุงุฑ ู…ู† ุงู„ุฌู‡ุงุฒ + ุฅุนุงุฏุฉ ุงู„ุชุดุบูŠู„ ุจู‡ + ุฅูŠู‚ุงู + ุงุณุชุฎุฏุงู… + ุญุฐู + ุญุฐู ุงู„ุขู† + ุชุนุฐู‘ุฑ ุชุฌู‡ูŠุฒ ุฅุนุงุฏุฉ ุงู„ุชุดุบูŠู„: %1$s. ู‚ู… ุจุฅู‚ุฑุงู† ุชุตุญูŠุญ ุงู„ุฃุฎุทุงุก ุงู„ู„ุงุณู„ูƒูŠ ููŠ ุงู„ุฅุนุฏุงุฏุŒ ุซู… ุญุงูˆู„ ู…ุฌุฏุฏู‹ุง. + ุชู… ุชุซุจูŠุช ุฅุตุฏุงุฑ ุงู„ู…ุฎุชุจุฑ + ุฃูุนูŠุฏ ุชุดุบูŠู„ DroidDeck ุนู„ู‰ %1$s + ู†ุณุฎุฉ ุงู„ู…ุฎุชุจุฑ ู…ุชูˆู‚ูุฉ ู…ุคู‚ุชู‹ุง + ุฃุนุงุฏ Android ุชุญุณูŠู† DroidDeckุŒ ู„ุฐุง ู„ู… ูŠุชู… ุชุญู…ูŠู„ %1$s. ุงูุชุญ ุงู„ุชุญุฏูŠุซุงุช ู„ุฅุนุงุฏุฉ ุงู„ุชุดุบูŠู„ ุนู„ูŠู‡ุง. + ุชู… ุฅูŠู‚ุงู ู†ุณุฎุฉ ุงู„ู…ุฎุชุจุฑ + ุจูู†ูŠุช ู„ุฅุตุฏุงุฑ ุขุฎุฑ ู…ู† DroidDeck. ูˆู‡ูŠ ู…ุญููˆุธุฉ ููŠ ุงู„ุชุญุฏูŠุซุงุช. + ู„ู… ูŠุจุฏุฃ DroidDeck ุนู„ูŠู‡ุง ู…ุฑุชูŠู† + ุงู„ูˆูƒูŠู„ + ุงู„ูˆูƒูŠู„ + ุงู„ูˆูƒูŠู„ ูŠุนู…ู„ + ุซุจู‘ุช Claude Code ููŠ ุจูŠุฆุฉ ู…ุณุชุฎุฏู… Linux ู„ุงุณุชุฎุฏุงู… ุงู„ูˆูƒูŠู„. + ุงุณุฃู„ ุนู† ู„ุนุจุฉุŒ ุฃูˆ ุชุนุทู‘ู„ุŒ ุฃูˆ ุชุบูŠูŠุฑ ููŠ DroidDeck + ุฅุฑุณุงู„ + ู…ุญุงุฏุซุฉ ุฌุฏูŠุฏุฉ + ุฅูŠู‚ุงู + ุงู„ุชุฎุฒูŠู† + ุฅุฒุงู„ุฉ + ุฅุฒุงู„ุฉ ุงู„ุขู† + Claude Code + Codex + ุงู„ูƒูˆุฏ ุงู„ู…ุตุฏุฑูŠ ู„ู€ DroidDeck + ุฐุงูƒุฑุงุช ุงู„ุชู†ุฒูŠู„ ุงู„ู…ุคู‚ุชุฉ + ุงู„ุชุบูŠูŠุฑุงุช ุงู„ุชูŠ ู„ู… ุชูุฑูุน ุชููู‚ุฏ + ุชู†ุฒู‘ู„ู‡ุง ุนู…ู„ูŠุงุช ุงู„ุจู†ุงุก ู…ู† ุฌุฏูŠุฏ + ูŠู…ูƒู† ู„ู„ุฅุนุฏุงุฏ ุชุซุจูŠุชู‡ุง ู…ุฌุฏุฏู‹ุงุ› ุชุณุฌูŠู„ุงุช ุงู„ุฏุฎูˆู„ ู…ุญููˆุธุฉ + ุนุงุฏ DroidDeck ู„ู„ุนู…ู„ ุนู„ู‰ ู†ุณุฎุฉ ุงู„ู…ุฎุชุจุฑ. ุชุงุจุน ู…ู† ุญูŠุซ ุชูˆู‚ูุช. + ุงุณุฃู„ู‡ ู„ู…ุงุฐุง ู„ุง ุชุจุฏุฃ ู„ุนุจุฉุŒ ุฃูˆ ุงุทู„ุจ ุดุฑุญ ุณุฌู„ุŒ ุฃูˆ ุบูŠู‘ุฑ DroidDeck ูˆุฌุฑู‘ุจ ุงู„ุชุบูŠูŠุฑ ุนู„ู‰ ู‡ุฐุง ุงู„ุฌู‡ุงุฒ. + ูุดู„: %1$s + %1$s ุงู†ุชู‡ู‰ (ุฑู…ุฒ ุงู„ุฎุฑูˆุฌ %2$d) + ุชู… ุงู„ุฅูŠู‚ุงู + ุงู†ุชู‡ู‰ ุฏูˆู† ุฑุฏ + ุฅุนุงุฏุฉ ุงู„ู…ุญุงูˆู„ุฉ + ุฌุงุฑู ุฅุนุฏุงุฏ ุงู„ูˆูƒูŠู„ + ุฃุนุฏ ุจู†ุงุก ู†ุณุฎุฉ ุงู„ู…ุฎุชุจุฑ %1$s ู„ุฅุตุฏุงุฑ DroidDeck ุงู„ู…ุซุจู‘ุช ูˆุฃุนุฏ ุงู„ุชุดุบูŠู„ ุนู„ูŠู‡ุง. + %1$s ู…ุฏุฎู„ุงุช ยท %2$s ู…ุฎุฑุฌุงุช + ูŠููƒู‘ุฑ + ููƒู‘ุฑ + ูŠููƒู‘ุฑ ยท %1$s + %1$s ยท %2$s + ุงู„ุฅุฏุฎุงู„ + ุงู„ุฅุฎุฑุงุฌ + ู‚ูŠุฏ ุงู„ุชุดุบูŠู„โ€ฆ + ู„ุง ุชูˆุฌุฏ ู†ุชูŠุฌุฉ: ุงู†ุชู‡ุช ุงู„ุฌูˆู„ุฉ ุฃูˆู„ู‹ุง + ู„ุง ู…ุฎุฑุฌุงุช + ุงูƒุชุจ ู„ุฅุถุงูุฉ ุงู„ุฑุณุงู„ุฉ ุงู„ุชุงู„ูŠุฉ ุฅู„ู‰ ุงู„ุงู†ุชุธุงุฑ + ุฅุถุงูุฉ ุฅู„ู‰ ุงู„ุงู†ุชุธุงุฑ + ุงู„ุชุงู„ูŠ: %1$s + ู„ุง ุชูุฑุณู„ + ุฅุฑูุงู‚ + ุฅุฒุงู„ุฉ + ุงู„ุงูุชุฑุงุถูŠ + ุฌู‡ุฏ ุงู„ุงุณุชุฏู„ุงู„ + ุชู†ููŠุฐ + ุชุนุฏูŠู„ + ู„ู… ูŠุชุบูŠุฑ ุดูŠุก ุจุนุฏ + ุงู„ู…ุถูŠ ู‚ุฏู…ุงู‹ ููŠ ุงู„ุฎุทุฉ. + ุฅุฑุณุงู„ ุงู„ุขู† + ุงู„ู…ุฒูŠุฏ + ุฅุบู„ุงู‚ + ุงู„ุฃุญุฏุซ + ู‚ูŠุฏ ุงู„ุนู…ู„ + ุงู„ุณูŠุงู‚ + %1$s ู…ู† %2$s + ู‡ุฐู‡ ุงู„ู…ุญุงุฏุซุฉ ยท %1$s + ูŠุธู‡ุฑ ุงู„ุงุณุชุฎุฏุงู… ุจุนุฏ ุงู„ุฑุฏ ุงู„ุฃูˆู„ + ุญุฏ ู…ุฏุชู‡ %1$d ุณุงุนุฉ + ุญุฏ ู…ุฏุชู‡ %1$d ุฏู‚ูŠู‚ุฉ + ุงู„ุญุฏ ุงู„ุฃุณุจูˆุนูŠ + %1$d%% ยท ูŠูุนุงุฏ ุถุจุทู‡ %2$s + + %1$d ู…ู„ูุงุช + %1$d ู…ู„ูู‹ุง + %1$d ู…ู„ู + %1$d ู…ู„ู + %1$d ู…ู„ูุงู† + %1$d ู…ู„ูุงุช + + ุฎุทู‘ุท ุฃูˆู„ู‹ุง + ุชุฎุทูŠุท + ูŠู‚ุชุฑุญ ุฎุทุฉ ุฏูˆู† ุชุบูŠูŠุฑ ุฃูŠ ุดูŠุก + ุงู„ู…ุญุงุฏุซุงุช + ู„ุง ุชูˆุฌุฏ ู…ุญุงุฏุซุงุช ุจุนุฏ + ุงู„ุขู† + ุญุฐู + ูŠุญุฐูู‡ุง ูˆู…ุฑูู‚ุงุชู‡ุง + ุงู„ุนู…ู„ูŠุงุช + ู„ุง ุดูŠุก ูŠุนู…ู„ ููŠ ุจูŠุฆุฉ ู…ุณุชุฎุฏู… Linux + ุงู„ูˆูƒูŠู„ + ุฅูŠู‚ุงู + ุจู†ุงุก ุงู„ู…ุฎุชุจุฑ + ุฌุงุฑู ุชุฌู‡ูŠุฒ ุฅุตุฏุงุฑุงุช ุงู„ู…ุฎุชุจุฑ + %1$d%% ยท ุญูˆุงู„ูŠ %2$s ู…ุชุจู‚ู + ุญูˆุงู„ูŠ %1$s ู…ุชุจู‚ู + ุฅู„ุบุงุก + ุฅู„ุบุงุก ุงู„ุจู†ุงุก + ุฌุงุฑู ุงู„ุจุฏุก + %1$d%% + ุฌุงุฑู ุงู„ุชุบู„ูŠู + ุฌุงุฑู ุฅุนุงุฏุฉ ุชุดุบูŠู„ DroidDeck ุนู„ูŠู‡ + ุชู… + ูุดู„: %1$s + ุฅุนุฏุงุฏ ุงู„ูˆูƒูŠู„ + ุซุจู‘ุช ูˆู‚ุช ุชุดุบูŠู„ Linux ููŠ ุงู„ุฅุนุฏุงุฏ ุฃูˆู„ู‹ุง. + ุฅุนุงุฏุฉ ุงู„ู…ุญุงูˆู„ุฉ + ุงุจุฏุฃ ุงู„ู…ุญุงุฏุซุฉ + ุงุชุตุงู„ ุงู„ุฌู‡ุงุฒ + ุงู„ุชุตุญูŠุญ ุงู„ู„ุงุณู„ูƒูŠุŒ ู„ูŠุชู…ูƒู‘ู† ุงู„ูˆูƒูŠู„ ู…ู† ุฑุคูŠุฉ DroidDeck ูˆุงู„ุชุญูƒู… ุจู‡ + ุซุจู‘ุช %1$s + ุฏุงุฎู„ ู…ุณุงุญุฉ ู…ุณุชุฎุฏู… LinuxุŒ ู…ุน git ูˆgh ูˆadb + ุชุณุฌูŠู„ ุงู„ุฏุฎูˆู„ ุฅู„ู‰ %1$s + ูŠูุชุญ ู…ุชุตูุญูƒ + GitHub + ุงุฎุชูŠุงุฑูŠุŒ ู„ูุชุญ ุทู„ุจุงุช ุงู„ุณุญุจ + ุฃุฏูˆุงุช ุงู„ุจู†ุงุก + ุงุฎุชูŠุงุฑูŠุŒ ู„ุจู†ุงุกุงุช Lab ุนู„ู‰ ู‡ุฐุง ุงู„ุฌู‡ุงุฒ ยท ุญูˆุงู„ูŠ 5 GB + ุงู„ูˆูƒูŠู„ ุฌุงู‡ุฒ + ุฃูƒู…ู„ ุฅุนุฏุงุฏ ุงู„ูˆูƒูŠู„ + ุชู… ุชุณุฌูŠู„ ุงู„ุฏุฎูˆู„ ุฅู„ู‰ %1$s + ุจู†ุงุกุงุช Lab + ุจู†ุงุกุงุช ุณุฑูŠุนุฉ + ุจู†ุงุกุงุช Lab ุณุฑูŠุนุฉ + ูŠูุฌู…ู‘ุน ู‡ุฐุง ุงู„ุฅุตุฏุงุฑ ู…ุณุจู‚ู‹ุงุŒ ูุชุณุชุบุฑู‚ ุจู†ุงุกุงุช Lab ุฏู‚ุงุฆู‚ ยท ุญูˆุงู„ูŠ 20 ุฏู‚ูŠู‚ุฉ ู„ู…ุฑุฉ ูˆุงุญุฏุฉ + ุฌุงุฑู ุงู„ุชุฌู…ูŠุน ยท %1$d%% ยท ุญูˆุงู„ูŠ %2$s ู…ุชุจู‚ู + ุชุญุถูŠุฑ + ุชุนุฐู‘ุฑ ุงู„ูˆุตูˆู„ ุฅู„ู‰ ุชุตุญูŠุญ ุงู„ุฃุฎุทุงุก ุงู„ู„ุงุณู„ูƒูŠุ› ุฒุฑ ุงู„ุงู‚ุชุฑุงู† ูŠุดุบู‘ู„ู‡ + ุงู‚ุชุฑุงู† + ุชุซุจูŠุช + ุชุณุฌูŠู„ ุงู„ุฏุฎูˆู„ PR #%1$d ู„ู… ูŠูุจู†ูŽ ู„ู‡ุฐู‡ ุงู„ู†ุณุฎุฉ ู…ู† DroidDeck ุชู… ุงู„ุชุญุฏูŠุซ %1$s @@ -1276,6 +1505,9 @@ ุงู„ุชุทุจูŠู‚ุงุช ุงู„ุฅุนุฏุงุฏ ุงู„ุชุญุฏูŠุซุงุช + ุงู„ู…ุฒูŠุฏ + ุชุนุฏูŠู„ ุงู„ุชุจูˆูŠุจุงุช + ุงู„ุชุจูˆูŠุจุงุช %1$d%% ุงุณุชุฆู†ุงู %1$s ูŠุธู‡ุฑ ุจุงุณู… /root/ROMs ููŠ ูƒู„ ุฌู„ุณุฉ. ู…ุณุงุญุฉ ุงู„ุชุฎุฒูŠู† ุงู„ุฏุงุฎู„ูŠุฉ ู…ุชุงุญุฉ ููŠ /root/Storage. @@ -1297,6 +1529,15 @@ ุฅู„ุบุงุก ุงู„ุทู„ุจ ุงู„ู…ุนู„ูŽู‘ู‚ ู„ูˆุญุฉ ู…ูุงุชูŠุญ Android ุฅุฎูุงุก โœ• + ุงู„ุญุฌู… ุนู„ู‰ ุงู„ุดุงุดุฉ + ู†ุณุจุฉ ุงู„ุดุงุดุฉ ุงู„ุชูŠ ุชุดุบู„ู‡ุง ู„ูˆุญุฉ ุงู„ู…ูุงุชูŠุญุŒ ุจู…ุง ููŠ ุฐู„ูƒ ุงู„ุดุฑูŠุท ุงู„ุนู„ูˆูŠ. + ุงู„ุนุชุงู…ุฉ + ู‚ู„ู‘ู„ู‡ุง ู„ุฑุคูŠุฉ ุงู„ู„ุนุจุฉ ุฎู„ู ู„ูˆุญุฉ ุงู„ู…ูุงุชูŠุญ. + ุงู„ู…ูุงุชูŠุญ ุงู„ู…ุฎููŠุฉ + ุงู„ู…ูุงุชูŠุญ ุงู„ุชูŠ ู†ุงุฏุฑู‹ุง ู…ุง ุชุณุชุฎุฏู…ู‡ุง ู„ุง ุชุธู‡ุฑ ุนู„ู‰ ู„ูˆุญุฉ ุงู„ู…ูุงุชูŠุญ. + ุตู Esc ูˆู…ูุงุชูŠุญ ุงู„ูˆุธุงุฆู + Ins / Del / Home / End / PgUp / PgDn + ู…ูุงุชูŠุญ ุงู„ุฃุณู‡ู… ุชุดุบูŠู„ %1$s ุงุฎุชุฑ ุดุงุดุฉ. ุงู„ุดุงุดุฉ ุงู„ุซุงู†ูˆูŠุฉ: %1$s. ู„ู… ุชุนุฏ ุงู„ุดุงุดุฉ ุงู„ุซุงู†ูˆูŠุฉ ู…ุชุงุญุฉ. @@ -1866,7 +2107,24 @@ ุงู„ูˆุญุฏุฉ ุงู„ุทุฑููŠุฉ ู…ู‚ุงุจุถ Deck + ู„ูˆุญุชุง ุงู„ู„ู…ุณ ู„ูˆุญุฉ ุงู„ู…ุนู„ูˆู…ุงุช + ุณุทุญ ุงู„ู…ูƒุชุจ + ุชุดุบูŠู„ ุณุทุญ ุงู„ู…ูƒุชุจ + ุณุทุญ ุงู„ู…ูƒุชุจ ยท %1$s + ู„ูˆุญุฉ ุงู„ู„ู…ุณ + ุงู„ู„ู…ุณ ุงู„ู…ุจุงุดุฑ + ู„ูˆุญุฉ ุงู„ู„ู…ุณ. ุงู†ู‚ุฑ ู„ู„ุชุจุฏูŠู„ ุฅู„ู‰ ุงู„ู„ู…ุณ ุงู„ู…ุจุงุดุฑ + ุงู„ู„ู…ุณ ุงู„ู…ุจุงุดุฑ. ุงู†ู‚ุฑ ู„ู„ุชุจุฏูŠู„ ุฅู„ู‰ ู„ูˆุญุฉ ุงู„ู„ู…ุณ + ุฌุงุฑู ุชุดุบูŠู„ ุณุทุญ ู…ูƒุชุจ KDEโ€ฆ + ุฃูุบู„ู‚ ุณุทุญ ุงู„ู…ูƒุชุจ. + ุชุนุฐู‘ุฑ ุชุดุบูŠู„ ุณุทุญ ุงู„ู…ูƒุชุจ. ุณุฌู„ุงุชู‡ ููŠ ู…ุฌู„ุฏ bottom-desktop ู„ู‡ุฐู‡ ุงู„ุฌู„ุณุฉ. + ุณุทุญ ุงู„ู…ูƒุชุจ ู…ุบู„ู‚. ู„ุง ูŠูˆุฌุฏ ู…ุง ูŠูุนุฑุถ ู‡ู†ุง ุจุนุฏ. + ุชุจุฏูŠู„ ุงู„ุดุงุดุชูŠู† + ุงู„ุดุงุดุฉ ุงู„ุณูู„ูŠุฉ ู…ุดุบูˆู„ุฉ ุญุงู„ูŠู‹ุง + ุดุงุดุฉ ุงู„ู„ุนุจุฉ + ุนุฑุถ ุงู„ู„ุนุจุฉ ุนู„ู‰ + ุงู„ุดุงุดุฉ ุงู„ุนู„ูˆูŠุฉ + ุงู„ุดุงุดุฉ ุงู„ุณูู„ูŠุฉ ุงู„ุชู†ุฒูŠู„ุงุช ู„ุง ุชูˆุฌุฏ ุชู†ุฒูŠู„ุงุช ุฌุงุฑูŠุฉ. Steam @@ -1901,6 +2159,20 @@ ุงู„ูˆู‚ูˆุฏุŒ t ุงู„ุฑุฆูŠุณูŠ %1$s t ุงู„ุงุญุชูŠุงุทูŠ %1$s t + ุฒู…ู† ุงู„ุฅุทุงุฑ + ุขุฎุฑ %1$d ุซ + ู…ุชูˆุณุท ุฒู…ู† ุงู„ุฅุทุงุฑ + ุฃุฏู†ู‰ 1% + ุฅุทุงุฑุงุช ุชุชุฌุงูˆุฒ 33 ู…ู„ู„ูŠ ุซุงู†ูŠุฉ + %1$d / ุฏู‚ูŠู‚ุฉ + ู…ุฏุฉ ุงู„ู„ุนุจ %1$s + %1$d ุฃู†ูˆูŠุฉุŒ ุญุชู‰ %2$s ุบูŠุบุงู‡ุฑุชุฒ + %1$d ุฃู†ูˆูŠุฉ + ุงู„ู„ุนุจุฉ + ุฅุทุงุฑ/ุซ ู…ู† ุฃุตู„ %1$d ู‡ุฑุชุฒ + ุงู„ุนู„ุงู…ุฉ ุงู„ุญู…ุฑุงุก ู‡ูŠ ุงู„ู†ู‚ุทุฉ ุงู„ุชูŠ ุชูุธู‡ุฑ ููŠู‡ุง ุงู„ู…ุคุดุฑุงุช ุฏุฑุฌุฉ ุงู„ุญุฑุงุฑุฉ ุจุงู„ู„ูˆู† ุงู„ุฃุญู…ุฑ. + ุงู„ุฌู‡ุงุฒ ุจุงู„ูƒุงู…ู„ + ุงู„ุจุทุงุฑูŠุฉ ุฅุฑุณุงู„ ุจูŠุงู†ุงุช ู„ูˆุญุฉ ุงู„ุนุฏุงุฏุงุช ุชู„ู‚ุงุฆูŠ ูŠูุนู‘ู„ู‡ุง ู„ูƒู„ ู„ุนุจุฉ ู…ุฏุฑุฌุฉ ู‡ู†ุงุŒ ุจู…ุง ููŠ ุฐู„ูƒ ุงู„ุฃู„ุนุงุจ ุงู„ุชูŠ ูŠูุนุซุฑ ุนู„ูŠู‡ุง ู„ุงุญู‚ู‹ุง. ุชุจู‚ู‰ ุงู„ุฃู„ุนุงุจ ุงู„ุชูŠ ุชูˆู‚ูู‡ุง ู…ุชูˆู‚ูุฉ. @@ -1924,6 +2196,10 @@ ุงู„ู…ูŠูƒุฑูˆููˆู† ู…ุชูˆู‚ู ู„ู‡ุฐู‡ ุงู„ู„ุนุจุฉ. ู„ู„ุชุญุฏุซุŒ ูุนูู‘ู„ ยซุงู„ู…ูŠูƒุฑูˆููˆู†ยป ููŠ ุฅุนุฏุงุฏุงุช Steam ููŠ DroidDeck (ุงู„ุตูˆุช) ูˆุงุจุฏุฃ ุงู„ู„ุนุจุฉ ู…ู† ุฌุฏูŠุฏ. ู…ุณุชูˆู‰ ุงู„ุตูˆุช %1$d%% ุฅุญุตุงุกุงุช ุฏุงุฎู„ ุงู„ู„ุนุจุฉ + ู…ุคุดุฑุงุช ุงู„ุดุงุดุฉ ุงู„ุณูู„ูŠุฉ + ุดุฑูŠุท ุนู„ู‰ ูƒู„ ุชุจูˆูŠุจ + ุฃุฏู†ู‰ 1% ูˆ0.1% + ุฏุฑุฌุฉ ุญุฑุงุฑุฉ ุงู„ู…ุนุงู„ุฌ FPS CPU GPU @@ -2100,6 +2376,7 @@ ุฌุงุฑู ุจุฏุก ุงู„ุฌู„ุณุฉโ€ฆ %1$d:%2$02d ู…ู†ู‚ุถูŠุฉ ยท ู„ุง ุชุฒุงู„ ุฌุงุฑูŠุฉ ุฌุงุฑู ุชู†ุฒูŠู„ ุชุญุฏูŠุซ ุนู…ูŠู„ Steam ยท %1$d%% + ุฌุงุฑู ุชุทุจูŠู‚ ุชุญุฏูŠุซ ุนู…ูŠู„ Steamโ€ฆ ุฌุงุฑู ุชู†ุฒูŠู„ ุนู…ูŠู„ Steam ยท %1$s ูŠูˆุฌุฏ ุชุซุจูŠุช ู„ุฃุฏุงุฉ ุชูˆุงูู‚ ู‚ูŠุฏ ุงู„ุชู†ููŠุฐ ุจุงู„ูุนู„ @@ -2176,11 +2453,29 @@ ุญุฏูˆุฏ ูƒุฑุชูˆู†ูŠุฉ ู…ุน ุฒูŠุงุฏุฉ ุงู„ุญุฏู‘ุฉ. ูˆุญุฏุฉ GPU ู„ูŠุณุช ู…ู† ู†ูˆุน Adreno + ุจุฑู†ุงู…ุฌ ุชุดุบูŠู„ PowerVR ููŠ ุงู„ู†ุธุงู…: ูŠุฎุชู„ู ุงู„ุชูˆุงูู‚ ุจุงุฎุชู„ุงู ุงู„ุฌู‡ุงุฒ + ุชุฌุฑูŠุจูŠ: RADV ุฃูˆ ุจุฑู†ุงู…ุฌ ุชุดุบูŠู„ Xclipse ููŠ ุงู„ู†ุธุงู… + PowerVR ููŠ ุงู„ู†ุธุงู… + ูŠุณุชุฎุฏู… ุจุฑุงู…ุฌ ุงู„ุชุดุบูŠู„ ุงู„ู…ุฏู…ุฌุฉ ู„ู‡ุฐุง ุงู„ู…ุนุงู„ุฌ ุงู„ุฑุณูˆู…ูŠ + ุชู… ุงุฎุชูŠุงุฑ ุจุฑู†ุงู…ุฌ ุชุดุบูŠู„ PowerVR ุงู„ุฎุงุต ุจุงู„ู†ุธุงู… ู„ูˆู‚ุช ุงู„ุชุดุบูŠู„ ูˆุงู„ุนุฑุถ. + ู„ุง ูŠุบุทูŠ ุฃูŠ ุจุฑู†ุงู…ุฌ ุชุดุบูŠู„ ู…ูุชูˆุญ ุฌู‡ุงุฒ Mali ู‡ุฐุง ุจุนุฏ: ุฌุณุฑ Mali ู…ููุนู‘ู„. + ู‡ุฐู‡ ู†ุณุฎุฉ ุงุฎุชุจุงุฑ ู„ู„ุฃุฌู‡ุฒุฉ ุบูŠุฑ ุงู„ู…ุฒูˆู‘ุฏุฉ ุจู€ Snapdragon: ุงู„ู†ุณุฎ ุงู„ุฑุณู…ูŠุฉ ู‡ู†ุง ุชุนู…ู„ ุนู„ู‰ Adreno ูู‚ุทุŒ ู„ุฐุง ู„ุง ุชูุซุจูŽู‘ุช ููˆู‚ู‡ุง. ู†ุณุฎ ุงู„ุงุฎุชุจุงุฑ ุงู„ุฌุฏูŠุฏุฉ ู…ุชุงุญุฉ ุนู„ู‰ github.com/The412Banner/droiddeck-nonadreno-drivers. + ุงู†ุชู‡ุช ุงู„ุฌู„ุณุฉ ุงู„ุฃุฎูŠุฑุฉ ู„ุฃู† Android ุฃุบู„ู‚ DroidDeck ู„ุชุญุฑูŠุฑ ุงู„ุฐุงูƒุฑุฉุŒ ู„ุง ุจุณุจุจ ุชุนุทู‘ู„. ุฃุบู„ู‚ ุงู„ุชุทุจูŠู‚ุงุช ุงู„ุฃุฎุฑู‰ ุฃูˆ ู‚ู„ู‘ู„ ุฅุนุฏุงุฏุงุช ู†ุณูŠุฌ ุงู„ู„ุนุจุฉุŒ ุซู… ุญุงูˆู„ ู…ุฌุฏุฏู‹ุง. + Mali (Venus) + ุฌุณุฑ Mali + ู„ุง ูŠุบุทูŠ ุฃูŠ ุจุฑู†ุงู…ุฌ ุชุดุบูŠู„ ู…ูุชูˆุญ ุฌู‡ุงุฒ Mali ู‡ุฐุง ุจุนุฏ: ูŠูุณุชุฎุฏู… %1$s ุนู„ู‰ ุจุฑู†ุงู…ุฌ ุชุดุบูŠู„ ุงู„ู‡ุงุชู ู†ูุณู‡. + ู„ู… ูŠูู†ุดุฑ %1$s ุจุนุฏ: ูŠูุณุชุฎุฏู… %2$s ุญุชู‰ ูŠูู†ุดุฑ. + %1$s ุบูŠุฑ ู…ุชุงุญุŒ ูˆูŠูุจู„ู‘ุบ ุจุฑู†ุงู…ุฌ ุชุดุบูŠู„ ู‡ุฐุง ุงู„ู‡ุงุชู ุนู† Vulkan %2$s (ูŠุญุชุงุฌ Venus ุฅู„ู‰ 1.2): ูŠูุณุชุฎุฏู… ุฌุณุฑ Mali. + ู„ู… ูŠูู†ุดุฑ %1$s ุจุนุฏ: ุฌุณุฑ Mali ู…ููุนู‘ู„ ุฅู„ู‰ ุฃู† ูŠูู†ุดุฑ. + ููŠ ู‚ุงุฆู…ุฉ ุงู„ุงู†ุชุธุงุฑ: %1$s (ููŠ ุงู†ุชุธุงุฑ ุจุฑู†ุงู…ุฌ ุชุดุบูŠู„ ู…ุฎุชู„ู ู„ูˆู‚ุช ุงู„ุชุดุบูŠู„) + ุชูˆูู‘ุฑ ุจูŠุฆุฉ ุชุดุบูŠู„ PowerVR ุงู„ุฎุงุตุฉ ุจุงู„ู†ุธุงู… ุญุฒู…ุฉ DXVK. ูŠู…ูƒู† ุชุฎุฒูŠู† ุญุฒู… DXVK ุงู„ุฃุฎุฑู‰ุŒ ู„ูƒู†ู‡ุง ู„ุง ุชูุทุจูŽู‘ู‚ ู…ุน ุจุฑู†ุงู…ุฌ ุงู„ุชุดุบูŠู„ ู‡ุฐุง. ู…ุฏุนูˆู… ุชุฌุฑูŠุจูŠ: ุจุฑุงู…ุฌ ุชุดุบูŠู„ู‡ ุฅุตุฏุงุฑุงุช ุงุฎุชุจุงุฑูŠุฉ ุฏุนู… ุชุฌุฑูŠุจูŠ ู„ู€ Adreno 850: ูŠุชุทู„ุจ ุจุฑุงู…ุฌ ุชุดุบูŠู„ ุชุฌุฑูŠุจูŠุฉ ู…ุชูˆุงูู‚ุฉ ู„ู„ุนุฑุถ ูˆุงู„ุฃู„ุนุงุจุŒ ูˆู„ู… ูŠูุชุญู‚ูŽู‘ู‚ ู…ู†ู‡ ุนู„ู‰ ู‡ุฐุง ุงู„ุฌู‡ุงุฒ ุฃู‚ู„ ู…ู† ุงู„ุนุชุงุฏ ุงู„ู…ูุฎุชุจูŽุฑ (Adreno 725 ูˆุฃุญุฏุซ): ู‚ุฏ ู„ุง ูŠุนู…ู„ ุบูŠุฑ ู…ุฏุนูˆู…: ู„ุง ุชุชูˆูุฑ ูˆุงุฌู‡ุฉ ุฑุณูˆู…ุงุช ู…ุชูˆุงูู‚ุฉ ู…ุน ูˆุญุฏุฉ ู…ุนุงู„ุฌุฉ ุงู„ุฑุณูˆู…ุงุช ู‡ุฐู‡ + ูŠุนู…ู„ ุนุจุฑ ุฌุณุฑ MaliุŒ ุนู„ู‰ ุจุฑู†ุงู…ุฌ ุชุดุบูŠู„ Vulkan ุงู„ุฎุงุต ุจุงู„ู‡ุงุชู + ุบูŠุฑ ู…ุฏุนูˆู… ุนู†ุฏ ุฅูŠู‚ุงู ุฌุณุฑ Mali: ูŠุญุชุงุฌ Turnip ุฅู„ู‰ ู…ุนุงู„ุฌ ุฑุณูˆู…ูŠุงุช Adreno (Snapdragon) ุชู… ุงู„ูˆุตูˆู„ ุฅู„ู‰ ุญุฏู‘ ุงู„ุทู„ุจุงุช ููŠ GitHub - ุญุงูˆูู„ ู…ุฑุฉ ุฃุฎุฑู‰ ู„ุงุญู‚ู‹ุง ุงุณุชุฌุงุจ GitHub ุจู€ HTTP %1$d @@ -2289,7 +2584,6 @@ ุงู„ู…ุชุงุฌุฑ Steam ู…ุฎุตูŽู‘ุต - ุงู„ู…ุชุงุฌุฑ ูุฆุฉ ุณุฑุนุฉ ุงู„ุชู†ุฒูŠู„ ู…ุชูˆุงุฒู† ุณุฑูŠุน @@ -2328,6 +2622,7 @@ ููŠ ุงู†ุชุธุงุฑ ุชู†ุฒูŠู„ Battle.net ุงู„ุขุฎุฑโ€ฆ ุงูุชุญ Battle.net ูˆุณุฌู‘ู„ ุงู„ุฏุฎูˆู„ ู…ุฑุฉ ูˆุงุญุฏุฉุŒ ุซู… ุซุจู‘ุช ุฃู„ุนุงุจู‡ ู…ู† ู‡ู†ุง. ุชูˆู‚ูุช ุฃุฏุงุฉ ุงู„ุชู†ุฒูŠู„ ู…ู† Blizzard: %1$s + ุชูˆู‚ูุช ุฃุฏุงุฉ ุงู„ุชู†ุฒูŠู„ ู…ู† Blizzard ุนู† ุงู„ุชู‚ุฏู…. ุฎุทุฃ Blizzard %1$s ุชุญุฏูŠุซ ุฃู„ุนุงุจ Blizzard @@ -2335,6 +2630,7 @@ ู…ู†ู‚ุทุน ุชุซุจูŠุช ยท %1$s ุงุญุตู„ ุนู„ูŠู‡ุง ู…ุฌุงู†ู‹ุง + ุฌุงุฑู ุงู„ุฅุถุงูุฉ ุฅู„ู‰ ุงู„ู…ูƒุชุจุฉโ€ฆ ุนุฑุถ ุนู„ู‰ %1$s ุดุฑุงุก ยท %1$s ู…ุซุจูŽู‘ุชุฉ @@ -2381,6 +2677,12 @@ ุชุฑุชูŠุจ ุชุณู…ูŠุงุช ุงู„ุดุฑูŠุท ุงู„ุฌุงู†ุจูŠ ุฅุธู‡ุงุฑ ุงู„ุฃุณู…ุงุก ุฃุณูู„ ุฑู…ูˆุฒ ุงู„ุดุฑูŠุท ุงู„ุฌุงู†ุจูŠ. ุฃูˆู‚ูู‡ ู„ู„ุญุตูˆู„ ุนู„ู‰ ุดุฑูŠุท ุฌุงู†ุจูŠ ุฃู†ุญู. + ุฑููŠู‚ ุงู„ูˆูƒูŠู„ + ูŠุธู‡ุฑ DeeDee ููˆู‚ ุงู„ู…ุดุบู„ ูˆุงู„ุฃู„ุนุงุจ ูˆูŠุนุฑุถ ู…ุง ูŠูุนู„ู‡ ุงู„ูˆูƒูŠู„. + ููˆู‚ ุงู„ุชุทุจูŠู‚ุงุช ุงู„ุฃุฎุฑู‰ + ุงุณู…ุญ ู„ู€ DeeDee ุจุงู„ุธู‡ูˆุฑ ููˆู‚ ูƒู„ ุงู„ุชุทุจูŠู‚ุงุช ูˆูุชุญ ุงู„ู…ุญุงุฏุซุฉ ู‡ู†ุงูƒ + ุงู„ุณู…ุงุญ + ุงู„ุฏุฑุฏุดุฉ ู…ุน DeeDee ุงู„ุนุฑุถ ุจุทุงู‚ุงุช ุฃูƒุจุฑ ุจุทุงู‚ุงุช ุฃุตุบุฑ @@ -2673,7 +2975,14 @@ %1$s ยท ูŠู„ุฒู… ุฅุนุงุฏุฉ ุชุดุบูŠู„ ู‡ุฐุง ุงู„ุฌู‡ุงุฒ ุฅุฒุงู„ุฉ %1$sุŸ - ุงู„ุชุดุฎูŠุต + ุงู„ู…ุทูˆู‘ุฑ + ุนู„ุงู…ุฉ ู…ุงุฆูŠุฉ ู„ุงุณู… ุงู„ุฅุตุฏุงุฑ + ุนุฑุถ ุงุณู… ุฅุตุฏุงุฑ ุงู„ุงุฎุชุจุงุฑ ุฃูˆ Lab ุนู„ู‰ ุงู„ุดุงุดุฉ. ู…ูุนู‘ู„ ุงูุชุฑุงุถูŠู‹ุง. + ู…ุดุงุฑูƒุฉ ุญุฒู… ุงู„ุชุดุฎูŠุต + ุงู„ุฌู„ุณุฉ ูˆุงู„ุฌู‡ุงุฒ + ุงู„ุฑุณูˆู…ูŠุงุช + ุงู„ุฃู„ุนุงุจ ูˆุงู„ุชูˆุงูู‚ + ุฌู…ูŠุน ุงู„ุญุฒู… ุฌุงู‡ุฒ ู„ู„ู‘ุนุจ ุบูŠุฑ ุฌุงู‡ุฒ ู„ู„ู‘ุนุจ ุจุนุฏ ุจูŠุฆุฉ ุงู„ุชุดุบูŠู„ %1$s @@ -2712,6 +3021,9 @@ ูุนู‘ู„ ุฅู†ุฌุงุฒุงุช GOG ููŠ ุฅุนุฏุงุฏุงุช ุงู„ู…ุชุงุฌุฑ ุงู„ุฅู†ุฌุงุฒุงุช ุบูŠุฑ ู…ุชูˆูุฑุฉุ› ุชุญู‚ู‘ู‚ ู…ู† ุณุฌู„ุงุช ุงู„ุฌู„ุณุฉ ุชู… ูุชุญ ุงู„ุฅู†ุฌุงุฒ + Mali (Venus): ู…ูุนุทูŽู‘ู„ + Mali (Venus): ู…ููุนูŽู‘ู„ + ูŠูุจู„ู‘ุบ ุจุฑู†ุงู…ุฌ ุงู„ุชุดุบูŠู„ ุนู„ู‰ %1$s ุนู† Vulkan %2$s. ูŠุญุชุงุฌ Mali (Venus) ุฅู„ู‰ Vulkan 1.2 ุฃูˆ ุฃุญุฏุซ (ู„ุง ูŠุจุฏุฃ gamescope ุนู„ู‰ ุงู„ุฅุตุฏุงุฑุงุช ุงู„ุฃู‚ุฏู…)ุŒ ู„ุฐุง ุชุชุฌุงูˆุฒ ุงู„ุฌู„ุณุงุช Venus ูˆุชุณุชุฎุฏู… ุฒูˆุฌ ุจุฑุงู…ุฌ ุชุดุบูŠู„ PanVK ุจุฏู„ู‹ุง ู…ู†ู‡. ู„ุตู‚ ุงู„ุนุตุง ุงู„ูŠุณุฑู‰ ุงู„ุนุตุง ุงู„ูŠู…ู†ู‰ @@ -3006,7 +3318,7 @@ ุงุฎุชูŠุงุฑ ู…ุฌู„ุฏโ€ฆ ุงุณุชุฎุฏู… ุฃูŠ ู…ุฌู„ุฏ ุนู„ู‰ ุจุทุงู‚ุฉ SD ุฃูˆ ู…ุญุฑูƒ USB ุชูˆุถุน ุงู„ุฃู„ุนุงุจ ููŠ ู…ุฌู„ุฏ Games ุฏุงุฎู„ ุงู„ู…ูˆู‚ุน ุงู„ู…ุญุฏุฏ. ู„ุง ุชูู†ู‚ู„ ุงู„ุฃู„ุนุงุจ ุงู„ุญุงู„ูŠุฉ. - ุฅู„ู‰ ุฃูŠู† ูŠุฐู‡ุจ + ู…ุง ูŠุดุบู„ ุงู„ู…ุณุงุญุฉ ุฃู„ุนุงุจ Steam ุจูŠุงู†ุงุช ุงู„ุฃู„ุนุงุจ ุงู„ุจุงุฏุฆุงุช %1$s ยท ุงู„ูˆุฑุดุฉ %2$s ยท ุงู„ุดูŠุฏุฑุงุช %3$s @@ -3075,6 +3387,7 @@ ุชุซุจูŠุชุงุช VC++ ูˆDirectX ุงู„ุชูŠ ุชุญุชุงุฌู‡ุง ุงู„ุฃู„ุนุงุจ ูŠุดุบู‘ู„ ุฃู„ุนุงุจ Linux x86 ุฃุฏุงุฉ Steam + ูŠูู†ุฒู‘ู„ Steam ู‡ุฐุง ู„ู„ุฃู„ุนุงุจ ุงู„ุชูŠ ุชุฃุชูŠ ุจู†ุธุงู… ู…ูƒุงูุญุฉ ุงู„ุบุดุŒ ุญุชู‰ ูˆู‡ูˆ ู…ูุนุทูŽู‘ู„. ุฅุฒุงู„ุชู‡ ุชูุนู„ู‘ู‚ ุชุซุจูŠุชู‡ุง ุนู†ุฏ 0% ูŠุดุบู‘ู„ DroidDeck ุงู„ุฃู„ุนุงุจ ุฏูˆู† ุจูŠุฆุฉ ุงู„ุชุดุบูŠู„ ู‡ุฐู‡ Proton x86ุŒ ูˆู„ุง ูŠุณุชุทูŠุน DroidDeck ุชุดุบูŠู„ู‡ ุงู„ุงูุชุฑุงุถูŠ ู„ูƒู„ ุงู„ุฃู„ุนุงุจ @@ -3166,6 +3479,19 @@ ู…ุญููˆุธุฉ ุฃู„ุนุงุจ ุฎุงุฑุฌ Steam ูˆุจุงุฏุฆุฉ Steam ุงู„ู…ุดุชุฑูƒุฉ ุจุงุฏุฆุงุช ุฃู„ุนุงุจ ุฃูุถูŠูุช ู…ู† ุงู„ู…ุชุงุฌุฑ ุฃูˆ ูŠุฏูˆูŠู‹ุง + ุจุงุฏุฆุฉ Steam ุงู„ู…ุดุชุฑูƒุฉ + ูŠุดุบู‘ู„ Steam ู…ุณุงุนุฏุงุช Windows ุงู„ุฎุงุตุฉ ุจู‡ ู‡ู†ุง + ูŠุญุฐูู‡ุง (%1$s). ูŠู†ุดุฆ Steam ุจุงุฏุฆุฉ ุฌุฏูŠุฏุฉ ููŠ ุงู„ู…ุฑุฉ ุงู„ุชุงู„ูŠุฉ ุงู„ุชูŠ ูŠุญุชุงุฌู‡ุง ููŠู‡ุง. + ุชุทุจูŠู‚ ู…ุชุฌุฑ ูˆุงู„ุฃู„ุนุงุจ ุงู„ุชูŠ ุชุนู…ู„ ุจู‡ + ู…ุณุชุฎุฏูŽู…ุฉ ุจูˆุงุณุทุฉ %1$s + ู„ุนุจุฉ ุฎุงุฑุฌ Steam %1$s + ุบูŠุฑ ู…ุทุงุจู‚ุฉ ู„ุฃูŠ ู„ุนุจุฉุŒ ู„ุฐุง ูŠูุญุชูุธ ุจู‡ุง + ุญุฐู ุงู„ู…ุญุฏุฏ ยท %1$s + ุฅู„ุบุงุก ุชุซุจูŠุช ุงู„ู…ุญุฏุฏ ยท %1$s + ุจุงุฏุฆุงุช Wine + ุชููู‚ุฏ ุงู„ุญูุธุงุช ูˆุงู„ุฅุนุฏุงุฏุงุช ุฏุงุฎู„ู‡ุงุŒ ูˆุชุจู‚ู‰ ุญูุธุงุช Steam Cloud ููŠ ุญุณุงุจูƒ. + ุฐุงูƒุฑุงุช ุงู„ุดูŠุฏุฑุงุช ุงู„ู…ุคู‚ุชุฉ + ุงู„ุจุงุฏุฆุฉ %1$s ยท ุงู„ุดูŠุฏุฑุงุช %2$s ุญุฒู… ู…ู†ุฒู‘ู„ุฉ ุฃุตูˆู„ ู…ุญููˆุธุฉ ู„ุง ุญุฒู… ู…ูƒูˆู‘ู†ุงุช ู…ู†ุฒู‘ู„ุฉ. @@ -3208,6 +3534,8 @@ DroidDeck ยท %1$d ุฅุทุงุฑ/ุซ ู…ุนุฏู„ 60 ุฅุทุงุฑู‹ุง/ุซ ุฃูƒุซุฑ ุณู„ุงุณุฉ ู„ูƒู†ู‡ ูŠุณุชู‡ู„ูƒ ุงู„ู…ุนุงู„ุฌ ุฃูƒุซุฑ ุฃุซู†ุงุก ุจุฏุก Steam. ููŠุฏูŠูˆ ู…ุฎุชุงุฑ ููŠ ุฅุนุฏุงุฏุงุช Steam ู†ูุณู‡ุง ูŠุธู‡ุฑ ู‡ู†ุง ุฃูŠุถู‹ุง. ุงู„ุตูˆุช + ุชุฎุทูŠ ู…ู‚ุทุน ุจุฏุก ุงู„ุชุดุบูŠู„ + ุงุณุชุฎุฏู… ู…ู‚ุทุนู‹ุง ุฃุณูˆุฏ ู…ุฏุชู‡ 0.1 ุซุงู†ูŠุฉ ูƒู…ู‚ุทุน ุจุฏุก ุชุดุบูŠู„ Steam. ูŠุณุฑูŠ ููŠ ุงู„ุฌู„ุณุฉ ุงู„ุชุงู„ูŠุฉ. ููŠุฏูŠูˆ ุฎุงุต ุจูƒ MP4 ุฃูˆ MOV ุฃูˆ MKV ุฃูˆ WebM. ุชูุญูˆูŽู‘ู„ ุงู„ุตูŠุบ ุงู„ุฃุฎุฑู‰ ูˆุงู„ู…ู„ูุงุช ุงู„ุฃูƒุจุฑ ู…ู† %1$d ู…ูŠุบุงุจุงูŠุช ุฅู„ู‰ WebM ุจุฏู‚ุฉ 720p ุนู„ู‰ ุงู„ุฌู‡ุงุฒุŒ ุญุชู‰ %2$d ุซุงู†ูŠุฉ. ุงุณุชูŠุฑุงุฏ @@ -3669,6 +3997,7 @@ ุฅุจู‚ุงุก Alt+Tab ูˆู…ูุชุงุญ Win ูˆุฒุฑ ุงู„ุฑุฆูŠุณูŠุฉ ุฏุงุฎู„ ุฌู„ุณุฉ DroidDeck ุงู„ู†ุดุทุฉ ุจุฏู„ุงู‹ ู…ู† Android. ูุนู‘ู„ ยซุงู„ุณุทูˆุนยป ู…ู† ุงู„ุฅุนุฏุงุฏ โ†’ ุชูƒุงู…ู„ Steam ุฌุณุฑ Mali: ู…ุชูˆู‚ู + ู„ุง ูŠู…ูƒู† ู„ู€ %1$s ุงุณุชุฎุฏุงู… ุฌุณุฑ Mali (ูŠุญุชุงุฌ ุฅู„ู‰ ู…ุนุงู„ุฌ ุฑุณูˆู…ูŠุงุช Mali ู…ู† ุฏูˆู† ู…ุณุงุฑ ู„ุจุฑู†ุงู…ุฌ ุชุดุบูŠู„ ุงู„ู†ุธุงู…)ุŒ ู„ุฐุง ู„ูŠุณ ู„ู‡ุฐุง ุงู„ู…ูุชุงุญ ุฃูŠ ุชุฃุซูŠุฑ ู‡ู†ุง. ุฌุณุฑ Mali: ูŠุนู…ู„ %1$s ู„ูŠุณ Adreno. ุฌุณุฑ Vulkan ุงู„ุชุฌุฑูŠุจูŠ ูŠุนู…ู„: ุชุนุฑุถ ุงู„ุฌู„ุณุฉ ุงู„ุฑุณูˆู…ุงุช ุนุจุฑ ุจุฑู†ุงู…ุฌ ุชุดุบูŠู„ ุงู„ู‡ุงุชู ู†ูุณู‡. ุชูˆู‚ู‘ุน ูˆุฌูˆุฏ ุฃุฎุทุงุกุ› ุฃุฑุณู„ ุณุฌู„ุงุช ุงู„ุฌู„ุณุฉ. ุงู„ูˆุถุน ุงู„ุขู…ู† @@ -3694,6 +4023,25 @@ ู†ู‚ู„ ุฅู„ู‰ ุงู„ุฎู„ู ุฅุนุฏุงุฏุงุช ุงู„ุฃุฏุงุฉ ุฅุฒุงู„ุฉ ุงู„ุฃุฏุงุฉ + ุงู„ู…ุธู‡ุฑ + ุญุฒู…ุฉ ุงู„ุฑู…ูˆุฒ + ุงู„ุงูุชุฑุงุถูŠ ู„ู„ู†ุธุงู… + ุฎู„ููŠุฉ ุจู„ูˆู† ุงู„ุชุทุจูŠู‚ + ุญุฌู… ุงู„ุฑู…ูˆุฒ + ุตุบูŠุฑ + ู…ุชูˆุณุท + ูƒุจูŠุฑ + ุฅุฎูุงุก ุฃุณู…ุงุก ุงู„ุชุทุจูŠู‚ุงุช + ุงู„ุชุจุงุนุฏ + ุถูŠู‚ + ุนุงุฏูŠ + ูˆุงุณุน + ุชุบูŠูŠุฑ ุงู„ุฑู…ุฒ + ุฅุนุงุฏุฉ ุถุจุท ุงู„ุฑู…ุฒ + ุงู„ุจุญุซ ููŠ ุงู„ุฑู…ูˆุฒ + ุฌุงุฑู ุชุญู…ูŠู„ ุงู„ุฑู…ูˆุฒโ€ฆ + ู„ู… ูŠุชู… ุงู„ุนุซูˆุฑ ุนู„ู‰ ุฑู…ูˆุฒ. + ุฑู…ูˆุฒ ู…ุฎุตู‘ุตุฉ ุฅุถุงูุฉ ุฅู„ู‰ ู…ุฌู„ุฏ ู…ุฌู„ุฏ ุฌุฏูŠุฏ ุฅุฒุงู„ุฉ ู…ู† ุงู„ู…ุฌู„ุฏ @@ -3813,5 +4161,81 @@ ุชุนุฐู‘ุฑ ุงุณุชูŠุฑุงุฏ ู‡ุฐุง ุงู„ุชุฎุทูŠุท ุซู„ุฌ ู‚ุฑู…ุฒูŠ + ุฃุณุทุญ ุจูŠุถุงุก ู…ุน ู„ู…ุณุงุช ุญู…ุฑุงุก. + ุงู„ู…ูˆุณูŠู‚ู‰ ุงู„ุชุตูˆูŠุฑูŠุฉ + ุงู„ู…ูˆุณูŠู‚ู‰ + ุฎูŠุงุฑุงุช ุงู„ุชุดุบูŠู„ + ุงู„ู…ูุถู„ุฉ + ุงู„ู…ุฌู…ูˆุนุงุช + ู„ุง ุชูˆุฌุฏ ู…ุฌู…ูˆุนุงุช ุจุนุฏ. ุงุถุบุท ุนู„ู‰ ุฃูŠู‚ูˆู†ุฉ ุงู„ุฅุดุงุฑุฉ ุงู„ู…ุฑุฌุนูŠุฉ ู„ุฅู†ุดุงุก ู…ุฌู…ูˆุนุฉ. + ุงู„ู…ุญููˆุธุงุช + ุฅู†ุดุงุก ู…ุฌู…ูˆุนุฉ + ู†ุธู‘ู… ู…ุง ุญูุธุชู‡ + ุฌุฏูŠุฏ + ุฅู†ุดุงุก + ุงุณู… ุงู„ู…ุฌู…ูˆุนุฉ + ุฃุฏุฎู„ ุงุณู…ู‹ุง ู„ุง ุชุณุชุฎุฏู…ู‡ ุฃูŠ ู…ุฌู…ูˆุนุฉ ุฃุฎุฑู‰ + ุฅุฏุงุฑุฉ + ุฅุนุงุฏุฉ ุชุณู…ูŠุฉ + ุฅุถุงูุฉ ู…ู‚ุงุทุน + ุฅุถุงูุฉ (%1$d) + ุฅุฒุงู„ุฉ ู…ู‚ุงุทุน + ุญุฐู ุงู„ู…ุฌู…ูˆุนุฉ + ุญุฐู %1$sุŸ + ุชุจู‚ู‰ ุงู„ู…ู‚ุงุทุน ุนู„ู‰ ุฌู‡ุงุฒูƒ. ุชุชู… ุฅุฒุงู„ุฉ ุงู„ู…ุฌู…ูˆุนุฉ ูู‚ุท. + ุชุญุฏูŠุฏ + ุชุญุฏูŠุฏ ุงู„ูƒู„ + ุฅู„ุบุงุก ุชุญุฏูŠุฏ ุงู„ูƒู„ + ุชู… ุชุญุฏูŠุฏ %1$d + ุฅุถุงูุฉ ุฅู„ู‰ ู…ุฌู…ูˆุนุฉ + ุฅุถุงูุฉ ุฅู„ู‰ ุงู„ู…ูุถู„ุฉ + ุฅุฒุงู„ุฉ ู…ู† ุงู„ู…ุฌู…ูˆุนุฉ + ุงุจุญุซ ููŠ ุงู„ู…ู‚ุงุทุน + ุชุฑุชูŠุจ ุงู„ุฃู„ุจูˆู… + ุงู„ุฃุทูˆู„ ุฃูˆู„ู‹ุง + ุงู„ุฃู‚ุตุฑ ุฃูˆู„ู‹ุง + ุงู„ู…ู‚ุงุทุน + ุทุจู‚ุฉ ุงู„ุตูˆุช + ุฅุนุงุฏุฉ ุถุจุท + ุชุฎุทูŠ ุงู„ุตู…ุช + ู…ุคู‚ุช ุงู„ู†ูˆู… + %1$d ุฏ + ู†ู‡ุงูŠุฉ ุงู„ู…ู‚ุทุน + ู…ุชุจู‚ูŠ %1$s + ุงู„ู…ุนุงุฏู„ + ุชุนุฒูŠุฒ ุงู„ุฌู‡ูŠุฑ + ุงู„ู…ุนุงุฏู„ ุบูŠุฑ ู…ุชุงุญ ุนู„ู‰ ู‡ุฐุง ุงู„ุฌู‡ุงุฒ + ุชูุนูŠู„ ุฃุซู†ุงุก ุงู„ู„ุนุจ + ุงุณุชู…ุฑ ููŠ ุชุดุบูŠู„ ุงู„ู…ูˆุณูŠู‚ู‰ ุงู„ุชุตูˆูŠุฑูŠุฉ ุฃุซู†ุงุก ุชุดุบูŠู„ ุงู„ู„ุนุจุฉ + ู„ุง ุชูˆุฌุฏ ู…ูˆุณูŠู‚ู‰ ุชุตูˆูŠุฑูŠุฉ ู…ุซุจู‘ุชุฉ ุจุนุฏ. + ุงุจุญุซ ููŠ ุงู„ู…ูˆุณูŠู‚ู‰ ุงู„ุชุตูˆูŠุฑูŠุฉ + ุฅุถุงูุฉ ู…ุฌู„ุฏ ู…ูˆุณูŠู‚ู‰ ุชุตูˆูŠุฑูŠุฉ + ู„ุง ุชูˆุฌุฏ ู…ู„ูุงุช ุตูˆุชูŠุฉ ููŠ ู‡ุฐุง ุงู„ู…ุฌู„ุฏ + ุงู„ู…ุฏุฉ ุงู„ุฅุฌู…ุงู„ูŠุฉ + %1$d ู…ู‚ุทุนู‹ุง / %2$s + ุงู„ู‚ุฑุต %1$s + ุนุดูˆุงุฆูŠ + ุงู„ุณุงุจู‚ + ุชุดุบูŠู„ + ุฅูŠู‚ุงู ู…ุคู‚ุช + ุงู„ุชุงู„ูŠ + ุงู„ุชูƒุฑุงุฑ ู…ุชูˆู‚ู + ุชูƒุฑุงุฑ ุงู„ูƒู„ + ุชูƒุฑุงุฑ ู…ู‚ุทุน ูˆุงุญุฏ + ู…ุณุชูˆู‰ ุงู„ุตูˆุช + ู„ุง ุชูˆุฌุฏ ู…ู„ูุงุช ุตูˆุชูŠุฉ ููŠ ู‡ุฐู‡ ุงู„ู…ูˆุณูŠู‚ู‰ ุงู„ุชุตูˆูŠุฑูŠุฉ + ุงู„ุชุดุบูŠู„ ุบูŠุฑ ู…ุชุงุญ + ู„ุง ูŠุชูˆูุฑ ู…ุชุตูุญ ูˆูŠุจ ู„ูุชุญ ู‡ุฐุง ุงู„ุฑุงุจุท. + ุงู„ุชู‚ุงุท + ุฅูู„ุงุช + ุญูุธ + ุงุถุบุท ู…ุทูˆู„ุงู‹ ู„ุฅุนุงุฏุฉ ุงู„ุถุจุท + ุงู„ู…ุชุงุฌุฑ + ุฒู…ู† ุงู„ุฅุทุงุฑ + ู…ุชูˆุณุท ู…ุนุฏู„ ุงู„ุฅุทุงุฑุงุช + ุฎุงุฏู… ุงู„ุนุฑุถ + ุญุงู„ุฉ HDR + ุงู„ู…ุนุฑูˆุถ + %1$d ู…ู† %2$d diff --git a/app/src/main/res/values-b+es+419/input_library.xml b/app/src/main/res/values-b+es+419/input_library.xml new file mode 100644 index 0000000000..7769845d32 --- /dev/null +++ b/app/src/main/res/values-b+es+419/input_library.xml @@ -0,0 +1,132 @@ + + + La pantalla seleccionada no estรก disponible. Conรฉctala para editar este diseรฑo a su tamaรฑo real. + ยฟDescartar los cambios de diseรฑo sin guardar? + Este diseรฑo lo usan %1$d perfiles. Los cambios guardados se aplican a todos. + Perfiles predeterminados + Modo escritorio + Modo juego + Predeterminado para escritorio y juego + Predeterminado para el modo juego + Predeterminado para el modo escritorio + Ajustes del dispositivo + Controles + Botones, palancas, gatillos y teclas extra + Copiar perfil + Restablecer acciones + ยฟRestablecer las acciones de %1$s a los valores predeterminados de su perfil base? Los diseรฑos y otros perfiles no cambiarรกn. + ยฟEliminar %1$s? Los modos que lo usan volverรกn a su perfil predeterminado integrado. Los diseรฑos guardados y los ajustes compartidos seguirรกn disponibles. + Visibilidad + Se aplica a todos los perfiles. Auto muestra los controles de la pantalla principal cuando no hay control conectado en el modo juego. + Editar en pantalla + Diseรฑos guardadosโ€ฆ + Elige un diseรฑo o crea el tuyo + Elige Controles de perfil en el menรบ de sesiรณn de la pantalla secundaria. Los selectores de Perfil y Pantalla secundaria del menรบ del control eligen los controles que se muestran. + Acciones de botones + Compartido con %1$s. Las ediciones tambiรฉn se aplican a esos perfiles. + Reutilizar ajustes + Usar ajustes deโ€ฆ + Copiar de otro perfil o mantener los ajustes compartidos + Hacer independiente + Mantener la configuraciรณn actual y dejar de compartir cambios + Los diseรฑos guardan elementos y sus posiciones. Cada perfil puede asignar sus propias acciones. Edita a tamaรฑo completo en la pantalla de destino. + Diseรฑo actual + ยฟEliminar el diseรฑo sin usar %1$s y sus acciones guardadas? + Renombrar el diseรฑo actual + La configuraciรณn de entrada ilegible se guardรณ en una copia de recuperaciรณn. Puedes seguir editando los perfiles restaurados. + Propiedades + Propiedades del clic + %1$s ยท Clic + Botones + Palancas, pads y gatillos + Ocultar herramientas + Control + Envรญa la entrada del control a Steam Input o al juego. + Este elemento no envรญa entrada de control, mouse ni teclado. + Clic del mouse + Acciรณn de DroidDeck + Acciรณn + Velocidad de desplazamiento: %1$d pasos/s + + Perfil nuevo + + Diseรฑo nuevo + %1$s ยท Lo usan %2$d perfiles. Los cambios se aplican a todos los perfiles que usan estas asignaciones. + Cambiar nombre + Eliminar + Agrega elementos al diseรฑo antes de asignar sus acciones. + No se pudo guardar la configuraciรณn de entrada + Nombre + Empezar desde + Botรณn + Palanca + Panel tรกctil + Cruceta + Gatillo + Listo + Deshacer + + Agregar + Arrastra para mover. Arrastra una esquina para cambiar el tamaรฑo. Toca Propiedades para asignar una acciรณn. + Editando en la pantalla secundaria + Reutilizar %1$s de otro perfil. Las demรกs fuentes de control no cambiarรกn. + Mantener compartidos los controles fรญsicos + Por defecto, todos los controles y diseรฑos personalizados son copias independientes. Compartir solo vincula los controles fรญsicos. + Usar estos elementos y posiciones. Compartir mantiene sincronizados los cambios futuros de geometrรญa; tus acciones de botรณn siguen siendo independientes. Un diseรฑo distinto empieza con acciones sin asignar. + Copiar estos controles y acciones, o vincularlos para que los cambios futuros se apliquen a ambos perfiles. + Mantener compartido + Copia independiente + Iniciar la palanca en el punto de toque + Ocultar la palanca cuando no se use + Herramientas + Auto (%1$s) + Personalizado (%1$s) + Guardar como perfil nuevo + Controles del perfil + Perfil + Gestos del panel tรกctil del mouse + Si se asigna al puntero del mouse: toca para hacer clic, mantรฉn para arrastrar y desplaza con dos dedos. + %1$s tiene una anulaciรณn del menรบ rรกpido. Selecciona Auto allรญ para usar su perfil predeterminado y sus tres partes guardadas. + Entrada de DroidDeck + Se mantiene mientras la palanca se mueve en cualquier direcciรณn: se presiona por encima del 55 %, se suelta por debajo del 35 %. Usa Teclas de direcciรณn para asignar cada direcciรณn por separado. Los comandos de DroidDeck se ejecutan una vez por desvรญo. El clic de la palanca se configura aparte. + Se mantiene mientras se toca el panel tรกctil; se suelta al levantar el dedo. Los comandos de DroidDeck se ejecutan una vez por toque. El clic del panel se configura aparte. + Se mantiene cuando el gatillo supera el 55 %; se suelta por debajo del 35 %. Los comandos de DroidDeck se ejecutan una vez por pulsaciรณn. + Direcciรณn de desplazamiento + Vertical + Horizontal + Desplazar horizontalmente + Mediciones + Activa la grabaciรณn, usa los controles en una sesiรณn en marcha y luego vuelve y lee los resultados. Mide solo el tiempo de envรญo de DroidDeck, no la latencia de pantalla. La grabaciรณn termina al cerrar el proceso de la app. + %1$d controles + Otros diseรฑos guardados (%1$d) โ–พ + Ocultar otros diseรฑos guardados (%1$d) โ–ด + Inicio / Guรญa + Atrรกs ยท un toque + Atrรกs ยท doble toque + Atrรกs ยท dos veces en Steam, una en escritorio + En modo Steam. Mantener Atrรกs tambiรฉn abre el acceso rรกpido. + Restaurar valores predeterminados + Tu elecciรณn de panel se recuerda. Escritorio abre un segundo espacio de trabajo; no cambia la sesiรณn ni su perfil de entrada. + Control virtual + El tipo de control que ven Steam o el juego. + Pantalla tรกctil + Cรณmo se manejan los toques en la pantalla del juego. Los botones del perfil mantienen sus acciones asignadas. + Cursor tรกctil + Muestra un puntero para toques directos en la pantalla del juego. + Tocar y mantener + Acciรณn del mouse al mantener un dedo en la pantalla del juego. + Toques del botรณn Atrรกs + Primera acciรณn: un toque. Segunda acciรณn: doble toque. + Botรณn de alternar + Toca para mantener, toca de nuevo para soltar. Abrir un menรบ o cambiar de perfil suelta el botรณn. + Forma + Redondeada + Pรญldora + Cรญrculo + Rectรกngulo + Etiqueta del botรณn + Texto + Imagen importada + Teclas diagonales separadas + Asigna una tecla a cada diagonal. Una diagonal vacรญa presiona sus dos direcciones vecinas. + Direcciones vecinas + Tus antiguas teclas en pantalla se guardaron como perfiles importados abajo. Selecciona uno para usarlo o editarlo. Se mantuvieron tus selecciones de perfil actuales. + Las antiguas teclas en pantalla no se pudieron importar automรกticamente. Se conservรณ la configuraciรณn original. + diff --git a/app/src/main/res/values-b+es+419/input_strings.xml b/app/src/main/res/values-b+es+419/input_strings.xml new file mode 100644 index 0000000000..744979897b --- /dev/null +++ b/app/src/main/res/values-b+es+419/input_strings.xml @@ -0,0 +1,38 @@ + + + Perfiles de entrada + Perfiles + Control fรญsico + Pantalla principal + Pantalla secundaria + Nativo / Steam Input + Nativo: %1$s + Enviar otro control del mando + Desactivado + Tecla o combinaciรณn de teclas + Teclas de direcciรณn + Mover el puntero + Velocidad del puntero: %1$d + Desplazar + Desplazar verticalmente + Botรณn izquierdo del mouse + Botรณn derecho del mouse + Botรณn central del mouse + Abrir el menรบ de DroidDeck + Mostrar el teclado + Abrir el menรบ de Steam + Abrir el acceso rรกpido de Steam + Quitar control + Agregar control + Botones especรญficos del dispositivo + Asignar un botรณn fรญsico + Suelta el botรณn y elige Editar, Reintentar o Cancelar. B o Atrรกs cancela despuรฉs de soltarlo. + Reintentar + Presiona un botรณn, incluso un botรณn Atrรกs informado como tecla. Las teclas de volumen y del sistema Android estรกn reservadas. La asignaciรณn solo se aplica a este dispositivo. + Quitar asignaciรณn + Diagnรณstico de entrada + Registrar el tiempo de envรญo de entrada + Leer mediciones + Mide el envรญo de Android hasta su publicaciรณn en el transporte de entrada existente. No incluye la llegada por Bluetooth, el sondeo del invitado, el renderizado ni la latencia de pantalla. La grabaciรณn estรก desactivada de forma predeterminada. + Usar la asignaciรณn de entrada normal + diff --git a/app/src/main/res/values-b+es+419/strings.xml b/app/src/main/res/values-b+es+419/strings.xml index f38bdcee46..c892f88c8e 100644 --- a/app/src/main/res/values-b+es+419/strings.xml +++ b/app/src/main/res/values-b+es+419/strings.xml @@ -28,6 +28,8 @@ Suspender ahora Detener sesiรณn Generaciรณn de fotogramas + Ajustes para este juego + Ajustes predeterminados Elige el modo de generaciรณn de fotogramas Desactivada DD-FG %1$dร— @@ -183,6 +185,7 @@ No se pudo descargar el entorno grรกfico de PowerVR. Revisa la conexiรณn e intรฉntalo de nuevo. No se pudo descargar DirectAudio, asรญ que el audio de los juegos usa la ruta mรกs lenta en esta sesiรณn. Este programa + La sesiรณn no pudo dibujar en la pantalla: %1$s. En lugar de una pantalla negra, esta pantalla muestra el motivo; los registros de la sesiรณn tienen los detalles. No se pudo descargar el cliente de Steam. Es posible que tu red o VPN estรฉ bloqueando los servidores de Steam; revisa la conexiรณn e intรฉntalo de nuevo. No se pudo configurar el cliente de Steam. Revisa la conexiรณn y el espacio libre, y vuelve a intentarlo. %1$s estรก hecho para PC x86 y se ejecuta con FEX, que aรบn no estรก instalado. Abre Steam una vez con tu sesiรณn iniciada y deja que descargue FEX y el Steam Linux Runtime; despuรฉs vuelve a iniciarlo. @@ -386,6 +389,9 @@ Aรบn no compatible aquรญ Cargando los componentesโ€ฆ No se pudo instalar: %1$s + Esta descarga necesita una actualizaciรณn. + Actualizaciรณn en cola. + Reintentar actualizaciรณn Descargado Descargando %1$s Instalando: %1$s @@ -416,6 +422,22 @@ Solo interno Carpeta: %1$s Segunda biblioteca + Mรกs bibliotecas de Steam + Carpetas donde Steam puede instalar y ejecutar juegos, cada una con su propio nombre. Al quitar una, sus juegos permanecen en el disco. + Agregar biblioteca + Cambiar nombre + Nombre de la biblioteca + Elige una carpeta para la biblioteca + Como mรกximo %1$d bibliotecas agregadas + Esa carpeta ya es una biblioteca o estรก dentro de una + %1$s ยท no disponible + Se aplica a partir de la prรณxima sesiรณn de Steam + Se encontrรณ en este dispositivo ยท %1$s ยท %2$s + Agregar + Encontrar bibliotecas en el almacenamiento interno + Permite el acceso a todos los archivos para que DroidDeck pueda ver las bibliotecas de Steam que otras apps guardan en el almacenamiento interno + Permitir + Se agregรณ %1$s, la biblioteca de Steam dentro de la carpeta que elegiste Los juegos que cargan recursos desde la SD o el almacenamiento compartido pueden tener microcortes. Diagnรณstico de almacenamiento Registra los resultados de asignaciรณn y muestras de tiempos de almacenamiento en Compartir registros. Puede ralentizar las instalaciones mientras estรฉ activado. Se aplica en la prรณxima sesiรณn. @@ -480,6 +502,7 @@ Activado Se inicia con Steam Se inicia sin Steam + Resoluciรณn del juego Ajustes Ajustes de %1$s Predeterminado @@ -567,6 +590,8 @@ Nรบcleos de juegos Nรบcleos de juegos Nรบcleos para los juegos. Con todos seleccionados, Android los asigna libremente. + Ahorrar energรญa en juegos estables + Ejecuta un juego en los nรบcleos mรกs lentos mientras mantiene una tasa de fotogramas estable, y lo devuelve a sus nรบcleos habituales cuando se queda atrรกs. Interfaz del cliente GL con subprocesos Puede hacer los menรบs de Steam mรกs รกgiles. @@ -602,7 +627,10 @@ Desactiva el asistente de navegaciรณn con control de Proton, que consume CPU en cada juego. Ejecutar proot sin seccomp Puede corregir errores de syscalls ausentes en algunos kernels. Puede reducir el rendimiento. + Ejecutar sin proot (experimental) + Inicia el entorno Linux directamente en Android. Se aplica a la prรณxima sesiรณn. Desactรญvalo si algo falla al iniciar. Ruta rรกpida de proot + No se usa sin proot. Requiere el filtro seccomp de proot. Bรบsquedas de archivos mรกs rรกpidas y menos microcortes. Desactรญvalo si un programa no encuentra sus archivos. Dibujar el cursor dentro de gamescope @@ -685,6 +713,7 @@ Memoria grรกfica Memoria de intercambio Nivel de baterรญa + Tiempo de baterรญa restante Consumo de energรญa Red Resoluciรณn @@ -839,6 +868,7 @@ Dispositivo compatible GPU sin probar GPU no compatible + GPU a travรฉs del puente Mali %1$s ยท %2$s %1$s: %2$s No hay un motor grรกfico compatible disponible para %1$s. Steam puede mostrar una pantalla negra. @@ -868,15 +898,38 @@ Sesiรณn Registros de sesiรณn Se guardan tras cada sesiรณn + Diagnรณsticos mejorados para la prรณxima sesiรณn + Captura registros detallados durante una sesiรณn. Puede reducir el rendimiento y usar mรกs almacenamiento. Se desactiva automรกticamente al iniciar la sesiรณn; revisa los registros antes de compartirlos. Registros de depuraciรณn de juegos Incluye diagnรณsticos de Proton, Wine y grรกficos en el prรณximo inicio de un juego. Puede reducir el rendimiento y usar mรกs almacenamiento. Reinicia esta sesiรณn para guardar los registros de depuraciรณn de juegos No se pudo actualizar el registro. Revisa el interruptor e intรฉntalo de nuevo. Herramientas de depuraciรณn + Registros detallados de grรกficos + Interfaz de Steam: dibujo con GPU + Con el par de controladores Xclipse, Steam dibuja sus pรกginas por software (el dibujo con GPU mostraba mosaicos con errores). Actรญvalo para una interfaz de Steam mรกs rรกpida si se ve bien en este telรฉfono. + compilado %1$s + %1$s se actualizรณ a la compilaciรณn mรกs reciente + El puente Mali no pasรณ la autoprueba en %1$s durante la รบltima sesiรณn (imรกgenes o dibujos), por lo que la sesiรณn usรณ el par de controladores PanVK en su lugar. + El puente Mali no encontrรณ ninguna forma de compartir memoria con el controlador en %1$s durante la รบltima sesiรณn, por lo que la sesiรณn usรณ el par de controladores PanVK en su lugar. El puente no puede funcionar en este telรฉfono; desactivarlo mantiene el par PanVK. + Los registros de Proton, DXVK y de los controladores de cada juego se incluyen en los registros de la sesiรณn. Siempre activado cuando la GPU no es Adreno. รšltimos registros de sesiรณn Registros de sesiรณn guardados Conserva los %1$d mรกs recientes Borrar registros + Registros de sesiรณn disponibles + Todavรญa no hay registros de sesiรณn guardados. + Los archivos ZIP compartidos y guardados incluyen la sesiรณn seleccionada, ademรกs de los diagnรณsticos relacionados de Steam, la tienda, las herramientas y Battle.net. + %1$s ยท %2$s + Sesiรณn actual + Compartir + Guardar en el dispositivo + Eliminar + ยฟEliminar los registros de sesiรณn? + ยฟEliminar %1$s? Esta acciรณn no se puede deshacer. + Registros de sesiรณn guardados. + No se pudieron guardar los registros de sesiรณn. + No se pudieron eliminar los registros de sesiรณn. Restablecer todos los ajustes Devuelve cada ajuste a su valor predeterminado Restablecer @@ -903,6 +956,8 @@ Usar como pantalla de inicio DroidDeck puede ser la app de inicio DroidDeck nunca se ofrece como app de inicio + El botรณn de inicio abre + La pรกgina que se muestra cuando DroidDeck es la app de inicio y presionas Inicio En Agregar juegos, cambia DroidDeck a Incluir Orientaciรณn Orientaciรณn del launcher @@ -916,15 +971,22 @@ Pantalla completa Oculta las barras de estado y navegaciรณn de Android Muestra las barras de estado y navegaciรณn de Android + Lanzador de doble pantalla + Automรกtico coloca las secciones del lanzador (Steam, Biblioteca, Tiendas y las demรกs) en la segunda pantalla integrada de las consolas portรกtiles que la tienen. Activado usa cualquier segunda pantalla. Desactivado mantiene el lanzador en una sola pantalla. + Sesiones de doble pantalla + Automรกtico acopla el menรบ del juego en la segunda pantalla integrada en lugar de mostrarlo como ventana emergente. Activado usa cualquier segunda pantalla. Desactivado mantiene el menรบ en la pantalla del juego; todavรญa puedes elegir una segunda pantalla desde el menรบ. Automรกtico Activado Desactivado Controles en la pantalla inferior en juegos + Teclado de Android para campos de texto Abre el trackpad y el teclado en la segunda pantalla cuando empieza una sesiรณn. Escribiendo en la pantalla superior Listo App de inicio predeterminada Elige una app de inicio + Ocultar el lanzador de Recientes mientras estรฉ inactivo + Solo se aplica cuando DroidDeck es la app de inicio predeterminada y no hay ninguna sesiรณn en ejecuciรณn. Elegir Apps de Linux (beta) Archivos @@ -1036,9 +1098,173 @@ Vista previa Las correcciones mรกs recientes, antes que Estable Al dรญa + Copiar detalles de la versiรณn + Detalles de la versiรณn copiados + Mรกs nueva que Vista previa + Vas por delante de Vista previa + Esta versiรณn es mรกs nueva que la รบltima Vista previa. La prรณxima versiรณn de Vista previa la actualizarรก. + Elige una versiรณn para ver sus cambios o instalarla. + Instalada + Instalar esta versiรณn%1$s + Volver a esta versiรณn%1$s + versionCode %1$d + Commit %1$s + Pรกgina de la versiรณn + El PR tiene un commit mรกs nuevo (%1$s). Su versiรณn de prueba aรบn no estรก lista, asรญ que esta no lo incluye. + Hay un commit mรกs nuevo, versiรณn pendiente + Nรบmero de PR, tรญtulo o autor + Ninguna versiรณn de prueba coincide + Necesita recompilarse (versionCode %1$d) + Actualizaciones de versiones de prueba + Nueva versiรณn de prueba del PR #%1$d + %1$s. Abre Actualizaciones para instalarla. + Mostrar mรกs (%1$d) + Necesitan recompilarse para versionCode %2$d (%1$d) + Versiones de Vista previa en main desde esta versiรณn de prueba: %1$d Versiones de prueba Prueba una correcciรณn antes de su publicaciรณn Ninguna por ahora + Compilaciรณn de laboratorio + Compilaciones de laboratorio + En uso + En pausa despuรฉs de que Android volviรณ a optimizar DroidDeck + No cargada: %1$s + Esperando un reinicio + Conservada + Para otra versiรณn + Recompilar + Elimina esta compilaciรณn del dispositivo + Reiniciar con esta + Desactivar + Usar + Eliminar + Eliminar ahora + No se pudo preparar el reinicio: %1$s. Empareja la depuraciรณn inalรกmbrica en Configuraciรณn y vuelve a intentarlo. + Compilaciรณn de laboratorio instalada + DroidDeck se reiniciรณ con %1$s + Compilaciรณn de Lab pausada + Android volviรณ a optimizar DroidDeck, asรญ que %1$s no estรก cargada. Abre Actualizaciones para arrancar de nuevo con ella. + Compilaciรณn de Lab desactivada + Se creรณ para otra versiรณn de DroidDeck. Se conserva en Actualizaciones. + DroidDeck no arrancรณ con ella dos veces + Agente + Agente + El agente estรก trabajando + Instala Claude Code en el entorno de usuario de Linux para usar el agente. + Pregunta sobre un juego, un fallo o un cambio en DroidDeck + Enviar + Nueva conversaciรณn + Detener + Almacenamiento + Quitar + Quitar ahora + Claude Code + Codex + Cรณdigo fuente de DroidDeck + Cachรฉs de descarga + Los cambios que no se suben se pierden + Las compilaciones vuelven a descargarlos + El proceso de configuraciรณn puede volver a instalarlo; se conservan los inicios de sesiรณn + DroidDeck arrancรณ de nuevo con tu compilaciรณn de Lab. Continรบa donde te quedaste. + Pรญdele que explique por quรฉ un juego no arranca, interprete un registro o cambie DroidDeck y pruebe el cambio en este dispositivo. + Fallรณ: %1$s + %1$s finalizรณ (cรณdigo de salida %2$d) + Detenido + Finalizรณ sin respuesta + Reintentar + Configurando el agente + Recompila mi compilaciรณn de Lab %1$s para la versiรณn instalada de DroidDeck y arranca de nuevo con ella. + %1$s de entrada ยท %2$s de salida + Pensando + Pensamiento + Pensando ยท %1$s + %1$s ยท %2$s + ENTRADA + SALIDA + Ejecutandoโ€ฆ + Sin resultado: el turno terminรณ antes + Sin salida + Escribe para encolar el siguiente mensaje + Encolar + Siguiente: %1$s + No enviar + Adjuntar + Quitar + Predeterminado + Esfuerzo de razonamiento + Adelante + Revisar + Aรบn no hay cambios + Adelante con el plan. + Enviar ahora + Mรกs + Cerrar + Mรกs reciente + Trabajando + Contexto + %1$s de %2$s + Esta conversaciรณn ยท %1$s + El uso se muestra despuรฉs de la primera respuesta + Lรญmite de %1$d horas + Lรญmite de %1$d minutos + Lรญmite semanal + %1$d%% ยท se restablece %2$s + + %1$d archivos + %1$d archivo + %1$d archivos + + Planear primero + Planear + Propone un plan sin cambiar nada + Conversaciones + Aรบn no hay conversaciones + Ahora mismo + Eliminar + Elimina la conversaciรณn y sus archivos adjuntos + Procesos + No hay nada en ejecuciรณn en el espacio de usuario de Linux + AGENTE + Detener + Compilaciรณn de Lab + Preparando compilaciones de Lab + %1$d%% ยท aprox. %2$s restantes + aprox. %1$s restantes + Cancelar + Cancelar compilaciรณn + Iniciando + %1$d%% + Empaquetando + Reiniciando DroidDeck en รฉl + Listo + Fallรณ: %1$s + Configurar el agente + Instala primero el entorno de ejecuciรณn de Linux en Configuraciรณn. + Reintentar + Empezar a chatear + Conexiรณn del dispositivo + Depuraciรณn inalรกmbrica para que el agente pueda ver y controlar DroidDeck + Instalar %1$s + En el espacio de usuario de Linux, con git, gh y adb + Iniciar sesiรณn en %1$s + Abre tu navegador + GitHub + Opcional, para abrir pull requests + Herramientas de compilaciรณn + Opcional, para compilaciones de Lab en este dispositivo ยท unos 5 GB + Agente listo + Terminar de configurar el agente + Sesiรณn iniciada en %1$s + Compilaciones de Lab + compilaciones rรกpidas + Compilaciones rรกpidas de Lab + Precompila esta versiรณn para que las compilaciones de Lab tarden unos minutos ยท unos 20 minutos una sola vez + Compilando ยท %1$d%% ยท unos %2$s restantes + Preparar + No se puede acceder a la depuraciรณn inalรกmbrica; Vincular la activa + Vincular + Instalar + Iniciar sesiรณn PR #%1$d No compilada para esta copia de DroidDeck Actualizada %1$s @@ -1325,6 +1551,9 @@ Apps Configuraciรณn Actualizar + Mรกs + Editar pestaรฑas + Pestaรฑas %1$d%% Reanudar %1$s Aparece como /root/ROMs en cada sesiรณn. El almacenamiento interno estรก en /root/Storage. @@ -1346,6 +1575,15 @@ Cancelar en cola Teclado de Android Ocultar โœ• + Tamaรฑo en pantalla + Parte de la pantalla que ocupa el teclado, encabezado incluido. + Opacidad + Bรกjala para ver el juego detrรกs del teclado. + Teclas ocultas + Las teclas que casi no usas no aparecen en el teclado. + Esc y fila de funciones + Ins / Del / Home / End / PgUp / PgDn + Teclas de direcciรณn Iniciar %1$s Elige una pantalla. Secundaria: %1$s. La pantalla secundaria ya no estรก disponible. @@ -1858,7 +2096,24 @@ Terminal Agarres de Deck + trackpads Panel + Escritorio + Iniciar el escritorio + Escritorio ยท %1$s + Panel tรกctil + Toque directo + Panel tรกctil. Toca para usar el toque directo + Toque directo. Toca para usar el panel tรกctil + Iniciando el escritorio KDEโ€ฆ + El escritorio se cerrรณ. + No se pudo iniciar el escritorio. Los registros estรกn en la carpeta bottom-desktop de esta sesiรณn. + El escritorio estรก cerrado. Todavรญa no hay nada que mostrar aquรญ. + Intercambiar pantallas + La pantalla inferior estรก ocupada ahora + Pantalla del juego + Mostrar el juego en + Pantalla superior + Pantalla inferior Descargas No hay descargas en curso. Steam @@ -1893,6 +2148,20 @@ Combustible, t Principal %1$s t Reserva %1$s t + Tiempo de fotograma + รบltimos %1$d s + fotograma promedio + mรญnimo al 1% + fotogramas de mรกs de 33 ms + %1$d / min + Jugando durante %1$s + %1$d nรบcleos, hasta %2$s GHz + %1$d nรบcleos + juego + FPS de %1$d Hz + La marca roja indica el punto donde el HUD muestra la temperatura en rojo. + todo el dispositivo + baterรญa Enviar datos al panel Automรกtico Lo activa en todos los juegos de esta lista, incluidos los que se encuentren mรกs adelante. Los juegos que desactives seguirรกn desactivados. @@ -1916,6 +2185,10 @@ El micro estรก desactivado en este juego. Para hablar, activa Micrรณfono en los ajustes de Steam de DroidDeck (Audio) y vuelve a iniciar el juego. Volumen %1$d%% Estadรญsticas del juego + HUD de la pantalla inferior + Franja en todas las pestaรฑas + Mรญnimos al 1% y 0.1% + Temperatura de la CPU FPS CPU GPU @@ -2080,6 +2353,7 @@ Iniciando la sesiรณnโ€ฆ %1$d:%2$02d transcurridos ยท sigue en marcha Descargando la actualizaciรณn del cliente de Steam ยท %1$d%% + Aplicando la actualizaciรณn del cliente de Steamโ€ฆ Descargando el cliente de Steam ยท %1$s Ya se estรก instalando una herramienta de compatibilidad Detรฉn la sesiรณn activa antes de instalar herramientas de compatibilidad @@ -2151,11 +2425,29 @@ Bordes anime Contornos toon mรกs nitidez. La GPU no es Adreno + Controlador PowerVR del sistema: la compatibilidad varรญa segรบn el dispositivo + Experimental: RADV o el controlador Xclipse del sistema + PowerVR del sistema + Usa los controladores integrados para esta GPU + El controlador PowerVR del sistema estรก seleccionado para el entorno de ejecuciรณn y la pantalla. + Todavรญa no hay un controlador de cรณdigo abierto que cubra este Mali: el puente Mali estรก activado. + Esta es la compilaciรณn de prueba para dispositivos sin Snapdragon: las compilaciones oficiales de aquรญ solo funcionan en Adreno, por lo que no se instalan sobre ella. Las nuevas compilaciones de prueba estรกn en github.com/The412Banner/droiddeck-nonadreno-drivers. + La รบltima sesiรณn terminรณ porque Android cerrรณ DroidDeck para liberar memoria, no fue un fallo. Cierra otras apps o reduce la calidad de las texturas del juego y vuelve a intentarlo. + Mali (Venus) + el puente Mali + Todavรญa no hay un controlador de cรณdigo abierto que cubra este Mali: se usa %1$s, sobre el controlador del propio celular. + %1$s aรบn no estรก publicado: se usa %2$s hasta que se publique. + %1$s no estรก disponible y el controlador de este celular indica Vulkan %2$s (Venus necesita 1.2): se usa el puente Mali. + %1$s aรบn no estรก publicado: el puente Mali estรก activado hasta que se publique. + En cola: %1$s (en espera de otro controlador del entorno de ejecuciรณn) + DXVK lo proporciona el entorno de ejecuciรณn PowerVR del sistema. Se pueden guardar otros paquetes de DXVK, pero no se aplican con este controlador. Compatible Experimental: sus controladores son versiones de prueba Compatibilidad experimental con Adreno 850: requiere controladores experimentales de pantalla y de juegos compatibles; no verificada en este dispositivo Por debajo del hardware probado (Adreno 725 y posteriores): puede que no funcione No compatible: no hay un motor grรกfico compatible disponible para esta GPU + Funciona a travรฉs del puente Mali, sobre el controlador Vulkan del propio celular + No es compatible con el puente Mali desactivado: Turnip necesita una GPU Adreno (Snapdragon) Se alcanzรณ el lรญmite de solicitudes de GitHub - intรฉntalo mรกs tarde GitHub respondiรณ HTTP %1$d Error en la descarga @@ -2258,7 +2550,6 @@ Tiendas Steam Personalizados - Tiendas Nivel de velocidad de descarga Equilibrado Rรกpido @@ -2297,6 +2588,7 @@ Esperando la otra descarga de Battle.netโ€ฆ Abre Battle.net e inicia sesiรณn una vez; luego instala sus juegos desde aquรญ. El descargador de Blizzard se detuvo: %1$s + El descargador de Blizzard dejรณ de avanzar. Error de Blizzard %1$s Actualizar Juegos de Blizzard @@ -2304,6 +2596,7 @@ Interrumpida Instalar ยท %1$s Obtener gratis + Agregando a la bibliotecaโ€ฆ Ver en %1$s Comprar ยท %1$s Instalado @@ -2316,6 +2609,12 @@ Ordenar Etiquetas de la barra lateral Muestra los nombres debajo de los รญconos de la barra lateral. Desactรญvalo para una barra lateral mรกs estrecha. + Mascota del agente + DeeDee flota sobre el lanzador y los juegos y muestra lo que hace el agente. + Sobre otras aplicaciones + Permite que DeeDee flote sobre todas las aplicaciones y abra su chat allรญ + Permitir + Chatear con DeeDee Vista Tarjetas mรกs grandes Tarjetas mรกs pequeรฑas @@ -2610,7 +2909,14 @@ %1$s ยท reinicio pendiente Este dispositivo ยฟQuitar %1$s? - Diagnรณstico + Desarrollador + Marca de agua de compilaciรณn + Muestra en pantalla la etiqueta de la versiรณn de prueba o Lab. Activada de forma predeterminada. + Compartir paquetes de diagnรณstico + Sesiรณn y dispositivo + Grรกficos + Juegos y compatibilidad + Todos los paquetes Listo para jugar Aรบn no estรก listo para jugar runtime %1$s @@ -2649,6 +2955,9 @@ Activa los logros de GOG en los ajustes de tiendas Logros no disponibles; revisa los registros de la sesiรณn Logro desbloqueado + Mali (Venus): desactivado + Mali (Venus): activado + El controlador de %1$s indica Vulkan %2$s. Mali (Venus) necesita Vulkan 1.2 o posterior (gamescope no se inicia en versiones anteriores), asรญ que las sesiones omiten Venus y usan en su lugar el par de controladores PanVK. Pegar Stick izquierdo Stick derecho @@ -2858,7 +3167,7 @@ Elegir carpetaโ€ฆ Usa cualquier carpeta de una tarjeta SD o unidad USB Los juegos se guardan en una carpeta Games dentro de la ubicaciรณn seleccionada. Los juegos existentes no se mueven. - Dรณnde va + Quรฉ ocupa espacio Juegos de Steam Datos de juegos Prefijos %1$s ยท taller %2$s ยท shaders %3$s @@ -2927,6 +3236,7 @@ Instaladores de VC++ y DirectX que piden los juegos Ejecuta juegos Linux x86 Herramienta de Steam + Steam descarga esto para los juegos que incluyen sistema antitrampas, incluso cuando estรก desactivado. Si lo eliminas, la instalaciรณn de esos juegos se queda atascada al 0% DroidDeck ejecuta juegos sin este runtime Proton x86, que DroidDeck no puede ejecutar Predeterminado para todos los juegos @@ -2997,6 +3307,19 @@ Conservados Juegos que no son de Steam y prefijo compartido de Steam Prefijos de juegos agregados desde tiendas o a mano + Prefijo compartido de Steam + Steam ejecuta aquรญ sus propias herramientas de Windows + Lo borra (%1$s). Steam crea uno nuevo la prรณxima vez que lo necesite. + Una app de tienda y los juegos que se ejecutan con ella + Usado por %1$s + Juego que no es de Steam %1$s + No coincide con ningรบn juego, asรญ que se conserva + Quitar selecciรณn ยท %1$s + Desinstalar selecciรณn ยท %1$s + Prefijos de Wine + Se pierden las partidas y los ajustes que contienen; las partidas de Steam Cloud se conservan en tu cuenta. + Cachรฉs de shaders + Prefijo %1$s ยท shaders %2$s Paquetes descargados Originales guardados No hay paquetes de componentes descargados. @@ -3033,6 +3356,8 @@ DroidDeck ยท %1$d fps 60 fps se ve mรกs fluido pero usa mรกs CPU mientras Steam se inicia. Un video elegido en la configuraciรณn de Steam tambiรฉn aparece aquรญ. Sonido + Omitir el video de inicio + Usa un clip negro de 0.1 segundos como video de inicio de Steam. Se aplica en la prรณxima sesiรณn. Tu propio video MP4, MOV, MKV o WebM. Otros formatos y archivos de mรกs de %1$d MB se convierten a WebM 720p en el dispositivo, hasta %2$d segundos. Importar @@ -3528,6 +3853,7 @@ Mantiene Alt+Tab, la tecla Win y el botรณn Inicio dentro de una sesiรณn activa de DroidDeck en lugar de Android. Activa Brillo en Configuraciรณn โ†’ Integraciรณn con Steam Puente Mali: desactivado + %1$s no puede usar el puente Mali (necesita una GPU Mali sin ruta de controlador del sistema), asรญ que esta opciรณn no tiene efecto aquรญ. Puente Mali: activado %1$s no es una Adreno. El puente Vulkan experimental estรก activado: la sesiรณn dibuja a travรฉs del propio controlador del telรฉfono. Espera errores; envรญa los registros de la sesiรณn. Modo seguro @@ -3553,6 +3879,25 @@ Mover despuรฉs Configuraciรณn del widget Quitar widget + Apariencia + Paquete de iconos + Predeterminado del sistema + Fondo con color de la app + Tamaรฑo de iconos + Pequeรฑo + Mediano + Grande + Ocultar nombres de apps + Espaciado + Denso + Normal + Amplio + Cambiar icono + Restablecer icono + Buscar iconos + Cargando iconosโ€ฆ + No se encontraron iconos. + Iconos personalizados Agregar a carpeta Carpeta nueva Quitar de la carpeta @@ -3669,4 +4014,79 @@ No se pudo importar esta disposiciรณn Nieve escarlata Superficies blancas con acentos rojos. + Bandas sonoras + Mรบsica + Opciones de reproducciรณn + Favoritos + Colecciones + Aรบn no hay colecciones. Toca el รญcono de marcador para crear una. + Guardados + Crear una colecciรณn + Organiza tus guardados + Nueva + Crear + Nombre de la colecciรณn + Ingresa un nombre que no use ninguna otra colecciรณn + Administrar + Cambiar nombre + Agregar pistas + Agregar (%1$d) + Quitar pistas + Eliminar colecciรณn + ยฟEliminar %1$s? + Las pistas permanecen en tu dispositivo. Solo se elimina la colecciรณn. + Seleccionar + Seleccionar todo + Deseleccionar todo + %1$d seleccionadas + Agregar a la colecciรณn + Agregar a favoritos + Quitar de la colecciรณn + Buscar pistas + Orden del รกlbum + Mรกs largas primero + Mรกs cortas primero + Pistas + Tono + Restablecer + Omitir silencios + Temporizador de sueรฑo + %1$d min + Fin de la pista + Quedan %1$s + Ecualizador + Refuerzo de graves + El ecualizador no estรก disponible en este dispositivo + Activar en el juego + Mantรฉn la banda sonora sonando mientras se ejecuta un juego + Aรบn no hay bandas sonoras instaladas. + Buscar bandas sonoras + Aรฑadir una carpeta de banda sonora + No hay archivos de audio en esa carpeta + Duraciรณn total + %1$d pistas / %2$s + Disco %1$s + Aleatorio + Anterior + Reproducir + Pausar + Siguiente + Repeticiรณn desactivada + Repetir todo + Repetir una + Volumen + No hay archivos de audio en esta banda sonora + Inicio no disponible + No hay un navegador web disponible para abrir este enlace. + Agarrar + Soltar + Guardar + Mantรฉn para restablecer + Tiendas + Tiempo de fotograma + Frecuencia media de fotogramas + Servidor de pantalla + Estado HDR + Mostrados + %1$d de %2$d diff --git a/app/src/main/res/values-bg/input_library.xml b/app/src/main/res/values-bg/input_library.xml new file mode 100644 index 0000000000..53f2103152 --- /dev/null +++ b/app/src/main/res/values-bg/input_library.xml @@ -0,0 +1,132 @@ + + + ะ˜ะทะฑั€ะฐะฝะธัั‚ ะดะธัะฟะปะตะน ะฝะต ะต ะฝะฐะปะธั‡ะตะฝ. ะกะฒัŠั€ะถะตั‚ะต ะณะพ, ะทะฐ ะดะฐ ั€ะตะดะฐะบั‚ะธั€ะฐั‚ะต ั‚ะพะฒะฐ ะพั„ะพั€ะผะปะตะฝะธะต ะฒ ั€ะตะฐะปะตะฝ ั€ะฐะทะผะตั€. + ะ”ะฐ ัะต ะพั‚ั…ะฒัŠั€ะปัั‚ ะปะธ ะฝะตะทะฐะฟะฐะทะตะฝะธั‚ะต ะฟั€ะพะผะตะฝะธ ะฟะพ ะพั„ะพั€ะผะปะตะฝะธะตั‚ะพ? + ะขะพะฒะฐ ะพั„ะพั€ะผะปะตะฝะธะต ัะต ะธะทะฟะพะปะทะฒะฐ ะพั‚ %1$d ะฟั€ะพั„ะธะปะฐ. ะ—ะฐะฟะฐะทะตะฝะธั‚ะต ะฟั€ะพะผะตะฝะธ ะฒะฐะถะฐั‚ ะทะฐ ะฒัะธั‡ะบะธ. + ะŸั€ะพั„ะธะปะธ ะฟะพ ะฟะพะดั€ะฐะทะฑะธั€ะฐะฝะต + ะ ะตะถะธะผ ะฝะฐ ั€ะฐะฑะพั‚ะตะฝ ะฟะปะพั‚ + ะ˜ะณั€ะพะฒะธ ั€ะตะถะธะผ + ะŸะพ ะฟะพะดั€ะฐะทะฑะธั€ะฐะฝะต ะทะฐ ั€ะฐะฑะพั‚ะตะฝ ะฟะปะพั‚ ะธ ะธะณั€ะฐ + ะŸะพ ะฟะพะดั€ะฐะทะฑะธั€ะฐะฝะต ะทะฐ ะธะณั€ะพะฒะธ ั€ะตะถะธะผ + ะŸะพ ะฟะพะดั€ะฐะทะฑะธั€ะฐะฝะต ะทะฐ ั€ะตะถะธะผ ะฝะฐ ั€ะฐะฑะพั‚ะตะฝ ะฟะปะพั‚ + ะะฐัั‚ั€ะพะนะบะธ ะฝะฐ ัƒัั‚ั€ะพะนัั‚ะฒะพั‚ะพ + ะฃะฟั€ะฐะฒะปะตะฝะธะต + ะ‘ัƒั‚ะพะฝะธ, ัั‚ะธะบะพะฒะต, ัะฟัƒััŠั†ะธ ะธ ะดะพะฟัŠะปะฝะธั‚ะตะปะฝะธ ะบะปะฐะฒะธัˆะธ + ะšะพะฟะธั€ะฐะฝะต ะฝะฐ ะฟั€ะพั„ะธะป + ะัƒะปะธั€ะฐะฝะต ะฝะฐ ะดะตะนัั‚ะฒะธัั‚ะฐ + ะ”ะฐ ัะต ะฝัƒะปะธั€ะฐั‚ ะปะธ ะดะตะนัั‚ะฒะธัั‚ะฐ ะฒ %1$s ะดะพ ัั‚ะพะนะฝะพัั‚ะธั‚ะต ะฝะฐ ะฑะฐะทะพะฒะธั ะฟั€ะพั„ะธะป? ะžั„ะพั€ะผะปะตะฝะธัั‚ะฐ ะธ ะดั€ัƒะณะธั‚ะต ะฟั€ะพั„ะธะปะธ ะพัั‚ะฐะฒะฐั‚ ะฝะตะฟั€ะพะผะตะฝะตะฝะธ. + ะ”ะฐ ัะต ะธะทั‚ั€ะธะต ะปะธ %1$s? ะ ะตะถะธะผะธั‚ะต, ะบะพะธั‚ะพ ะณะพ ะธะทะฟะพะปะทะฒะฐั‚, ั‰ะต ัะต ะฒัŠั€ะฝะฐั‚ ะบัŠะผ ะฒะณั€ะฐะดะตะฝะธั‚ะต ะฝะฐัั‚ั€ะพะนะบะธ ะฟะพ ะฟะพะดั€ะฐะทะฑะธั€ะฐะฝะต. ะ—ะฐะฟะฐะทะตะฝะธั‚ะต ะพั„ะพั€ะผะปะตะฝะธั ะธ ัะฟะพะดะตะปะตะฝะธั‚ะต ะฝะฐัั‚ั€ะพะนะบะธ ะพัั‚ะฐะฒะฐั‚ ะฝะฐะปะธั‡ะฝะธ. + ะ’ะธะดะธะผะพัั‚ + ะ’ะฐะถะธ ะทะฐ ะฒัะธั‡ะบะธ ะฟั€ะพั„ะธะปะธ. Auto ะฟะพะบะฐะทะฒะฐ ัƒะฟั€ะฐะฒะปะตะฝะธะตั‚ะพ ะฝะฐ ะพัะฝะพะฒะฝะธั ะตะบั€ะฐะฝ, ะบะพะณะฐั‚ะพ ะฒ ะธะณั€ะพะฒะธ ั€ะตะถะธะผ ะฝัะผะฐ ัะฒัŠั€ะทะฐะฝ ะบะพะฝั‚ั€ะพะปะตั€. + ะ ะตะดะฐะบั‚ะธั€ะฐะฝะต ะฝะฐ ะตะบั€ะฐะฝะฐ + ะ—ะฐะฟะฐะทะตะฝะธ ะพั„ะพั€ะผะปะตะฝะธัโ€ฆ + ะ˜ะทะฑะตั€ะตั‚ะต ะพั„ะพั€ะผะปะตะฝะธะต ะธะปะธ ััŠะทะดะฐะนั‚ะต ัะฒะพะต + ะ˜ะทะฑะตั€ะตั‚ะต ะฃะฟั€ะฐะฒะปะตะฝะธะต ะฝะฐ ะฟั€ะพั„ะธะปะฐ ะฒ ะผะตะฝัŽั‚ะพ ะฝะฐ ัะตัะธัั‚ะฐ ะฝะฐ ะฒั‚ะพั€ะธั ะตะบั€ะฐะฝ. ะ˜ะทะฑะพั€ะธั‚ะต ะŸั€ะพั„ะธะป ะธ ะ’ั‚ะพั€ะธ ะตะบั€ะฐะฝ ะฒ ะผะตะฝัŽั‚ะพ ะฝะฐ ะบะพะฝั‚ั€ะพะปะตั€ะฐ ะพะฟั€ะตะดะตะปัั‚ ะบะพะต ัƒะฟั€ะฐะฒะปะตะฝะธะต ะดะฐ ัะต ะฟะพะบะฐะทะฒะฐ. + ะ”ะตะนัั‚ะฒะธั ะฝะฐ ะฑัƒั‚ะพะฝะธั‚ะต + ะกะฟะพะดะตะปะตะฝะพ ั %1$s. ะŸั€ะพะผะตะฝะธั‚ะต ะฒะฐะถะฐั‚ ะธ ะทะฐ ั‚ะตะทะธ ะฟั€ะพั„ะธะปะธ. + ะŸะพะฒั‚ะพั€ะฝะพ ะธะทะฟะพะปะทะฒะฐะฝะต ะฝะฐ ะฝะฐัั‚ั€ะพะนะบะธ + ะ˜ะทะฟะพะปะทะฒะฐะฝะต ะฝะฐ ะฝะฐัั‚ั€ะพะนะบะธ ะพั‚โ€ฆ + ะšะพะฟะธั€ะฐะฝะต ะพั‚ ะดั€ัƒะณ ะฟั€ะพั„ะธะป ะธะปะธ ะทะฐะฟะฐะทะฒะฐะฝะต ะฝะฐ ัะฟะพะดะตะปะตะฝะธ ะฝะฐัั‚ั€ะพะนะบะธ + ะะฐะฟั€ะฐะฒะตั‚ะต ะฝะตะทะฐะฒะธัะธะผะพ + ะ—ะฐะฟะฐะทะฒะฐะฝะต ะฝะฐ ั‚ะตะบัƒั‰ะฐั‚ะฐ ะฝะฐัั‚ั€ะพะนะบะฐ ะธ ัะฟะธั€ะฐะฝะต ะฝะฐ ัะฟะพะดะตะปัะฝะตั‚ะพ ะฝะฐ ะฟั€ะพะผะตะฝะธ + ะžั„ะพั€ะผะปะตะฝะธัั‚ะฐ ะฟะฐะทัั‚ ะตะปะตะผะตะฝั‚ะธ ะธ ะฟะพะทะธั†ะธะธ. ะ’ัะตะบะธ ะฟั€ะพั„ะธะป ะผะพะถะต ะดะฐ ะทะฐะดะฐะฒะฐ ัะฒะพะธ ะดะตะนัั‚ะฒะธั. ะ ะตะดะฐะบั‚ะธั€ะฐะนั‚ะต ะฒ ะฟัŠะปะตะฝ ั€ะฐะทะผะตั€ ะฝะฐ ั†ะตะปะตะฒะธั ะตะบั€ะฐะฝ. + ะขะตะบัƒั‰ะพ ะพั„ะพั€ะผะปะตะฝะธะต + ะ”ะฐ ัะต ะธะทั‚ั€ะธะต ะปะธ ะฝะตะธะทะฟะพะปะทะฒะฐะฝะพั‚ะพ ะพั„ะพั€ะผะปะตะฝะธะต %1$s ะธ ะทะฐะฟะฐะทะตะฝะธั‚ะต ะผัƒ ะดะตะนัั‚ะฒะธั? + ะŸั€ะตะธะผะตะฝัƒะฒะฐะฝะต ะฝะฐ ั‚ะตะบัƒั‰ะพั‚ะพ ะพั„ะพั€ะผะปะตะฝะธะต + ะะตั‡ะตั‚ะธะผะธั‚ะต ะฝะฐัั‚ั€ะพะนะบะธ ะทะฐ ะฒั…ะพะด ัะฐ ะทะฐะฟะฐะทะตะฝะธ ะฒ ะบะพะฟะธะต ะทะฐ ะฒัŠะทัั‚ะฐะฝะพะฒัะฒะฐะฝะต. ะœะพะถะตั‚ะต ะดะฐ ะฟั€ะพะดัŠะปะถะธั‚ะต ะดะฐ ั€ะตะดะฐะบั‚ะธั€ะฐั‚ะต ะฒัŠะทัั‚ะฐะฝะพะฒะตะฝะธั‚ะต ะฟั€ะพั„ะธะปะธ. + ะกะฒะพะนัั‚ะฒะฐ + ะกะฒะพะนัั‚ะฒะฐ ะฝะฐ ั‰ั€ะฐะบะฒะฐะฝะต + %1$s ยท ะฉั€ะฐะบะฒะฐะฝะต + ะ‘ัƒั‚ะพะฝะธ + ะกั‚ะธะบะพะฒะต, ะฟะพะดะปะพะถะบะธ ะธ ัะฟัƒััŠั†ะธ + ะกะบั€ะธะฒะฐะฝะต ะฝะฐ ะธะฝัั‚ั€ัƒะผะตะฝั‚ะธั‚ะต + ะšะพะฝั‚ั€ะพะปะตั€ + ะ˜ะทะฟั€ะฐั‰ะฐะฝะต ะฝะฐ ะฒั…ะพะดะฐ ะพั‚ ะบะพะฝั‚ั€ะพะปะตั€ะฐ ะบัŠะผ Steam Input ะธะปะธ ะธะณั€ะฐั‚ะฐ. + ะขะพะทะธ ะตะปะตะผะตะฝั‚ ะฝะต ะธะทะฟั€ะฐั‰ะฐ ะฒั…ะพะด ะพั‚ ะบะพะฝั‚ั€ะพะปะตั€, ะผะธัˆะบะฐ ะธะปะธ ะบะปะฐะฒะธะฐั‚ัƒั€ะฐ. + ะฉั€ะฐะบะฒะฐะฝะต ั ะผะธัˆะบะฐ + ะ”ะตะนัั‚ะฒะธะต ะฝะฐ DroidDeck + ะ”ะตะนัั‚ะฒะธะต + ะกะบะพั€ะพัั‚ ะฝะฐ ะฟั€ะตะฒัŠั€ั‚ะฐะฝะต: %1$d ัั‚ัŠะฟะบะธ/ั + + ะะพะฒ ะฟั€ะพั„ะธะป + + ะะพะฒะพ ะพั„ะพั€ะผะปะตะฝะธะต + %1$s ยท ะ˜ะทะฟะพะปะทะฒะฐ ัะต ะพั‚ %2$d ะฟั€ะพั„ะธะปะฐ. ะŸั€ะพะผะตะฝะธั‚ะต ะฒะฐะถะฐั‚ ะทะฐ ะฒัะตะบะธ ะฟั€ะพั„ะธะป ั ั‚ะตะทะธ ะทะฐะดะฐะฒะฐะฝะธั. + ะŸั€ะตะธะผะตะฝัƒะฒะฐะฝะต + ะ˜ะทั‚ั€ะธะฒะฐะฝะต + ะ”ะพะฑะฐะฒะตั‚ะต ะตะปะตะผะตะฝั‚ะธ ะบัŠะผ ะพั„ะพั€ะผะปะตะฝะธะตั‚ะพ, ะฟั€ะตะดะธ ะดะฐ ะทะฐะดะฐะดะตั‚ะต ะดะตะนัั‚ะฒะธัั‚ะฐ ะธะผ. + ะะฐัั‚ั€ะพะนะบะธั‚ะต ะทะฐ ะฒั…ะพะด ะฝะต ะผะพะถะฐั…ะฐ ะดะฐ ะฑัŠะดะฐั‚ ะทะฐะฟะฐะทะตะฝะธ + ะ˜ะผะต + ะ—ะฐะฟะพั‡ะฒะฐะฝะต ะพั‚ + ะ‘ัƒั‚ะพะฝ + ะกั‚ะธะบ + ะขัŠั‡ะฟะฐะด + D-pad + ะกะฟัƒััŠะบ + ะ“ะพั‚ะพะฒะพ + ะžั‚ะผัะฝะฐ + + ะ”ะพะฑะฐะฒัะฝะต + ะŸะปัŠะทะฝะตั‚ะต ะทะฐ ะฟั€ะตะผะตัั‚ะฒะฐะฝะต. ะŸะปัŠะทะฝะตั‚ะต ัŠะณัŠะป ะทะฐ ะฟั€ะตะพั€ะฐะทะผะตั€ัะฒะฐะฝะต. ะ”ะพะบะพัะฝะตั‚ะต ะกะฒะพะนัั‚ะฒะฐ, ะทะฐ ะดะฐ ะทะฐะดะฐะดะตั‚ะต ะดะตะนัั‚ะฒะธะต. + ะ ะตะดะฐะบั‚ะธั€ะฐะฝะต ะฝะฐ ะฒั‚ะพั€ะธั ะตะบั€ะฐะฝ + ะŸะพะฒั‚ะพั€ะฝะพ ะธะทะฟะพะปะทะฒะฐะฝะต ะฝะฐ %1$s ะพั‚ ะดั€ัƒะณ ะฟั€ะพั„ะธะป. ะžัั‚ะฐะฝะฐะปะธั‚ะต ะธะทั‚ะพั‡ะฝะธั†ะธ ะฝะฐ ัƒะฟั€ะฐะฒะปะตะฝะธะต ะพัั‚ะฐะฒะฐั‚ ะฝะตะฟั€ะพะผะตะฝะตะฝะธ. + ะคะธะทะธั‡ะตัะบะพั‚ะพ ัƒะฟั€ะฐะฒะปะตะฝะธะต ะดะฐ ะพัั‚ะฐะฝะต ัะฟะพะดะตะปะตะฝะพ + ะŸะพ ะฟะพะดั€ะฐะทะฑะธั€ะฐะฝะต ะฒัะธั‡ะบะธ ะบะพะฝั‚ั€ะพะปะธ ะธ ะฟะตั€ัะพะฝะฐะปะธะทะธั€ะฐะฝะธ ะพั„ะพั€ะผะปะตะฝะธั ัะฐ ะฝะตะทะฐะฒะธัะธะผะธ ะบะพะฟะธั. ะกะฟะพะดะตะปัะฝะตั‚ะพ ัะฒัŠั€ะทะฒะฐ ัะฐะผะพ ั„ะธะทะธั‡ะตัะบะธั‚ะต ะบะพะฝั‚ั€ะพะปะธ. + ะ˜ะทะฟะพะปะทะฒะฐะฝะต ะฝะฐ ั‚ะตะทะธ ะตะปะตะผะตะฝั‚ะธ ะธ ะฟะพะทะธั†ะธะธ. ะกะฟะพะดะตะปัะฝะตั‚ะพ ัะธะฝั…ั€ะพะฝะธะทะธั€ะฐ ะฑัŠะดะตั‰ะธ ะฟั€ะพะผะตะฝะธ ะฟะพ ะณะตะพะผะตั‚ั€ะธัั‚ะฐ; ะดะตะนัั‚ะฒะธัั‚ะฐ ะฝะฐ ะฑัƒั‚ะพะฝะธั‚ะต ะพัั‚ะฐะฒะฐั‚ ะฝะตะทะฐะฒะธัะธะผะธ. ะ ะฐะทะปะธั‡ะฝะพ ะพั„ะพั€ะผะปะตะฝะธะต ะทะฐะฟะพั‡ะฒะฐ ั ะฝะตะทะฐะดะฐะดะตะฝะธ ะดะตะนัั‚ะฒะธั. + ะšะพะฟะธั€ะฐะฝะต ะฝะฐ ั‚ะตะทะธ ะบะพะฝั‚ั€ะพะปะธ ะธ ะดะตะนัั‚ะฒะธั ะธะปะธ ัะฒัŠั€ะทะฒะฐะฝะตั‚ะพ ะธะผ, ะทะฐ ะดะฐ ะฒะฐะถะฐั‚ ะฑัŠะดะตั‰ะธ ะฟั€ะพะผะตะฝะธ ะธ ะทะฐ ะดะฒะฐั‚ะฐ ะฟั€ะพั„ะธะปะฐ. + ะžัั‚ะฐะฒะธ ัะฟะพะดะตะปะตะฝะพ + ะะตะทะฐะฒะธัะธะผะพ ะบะพะฟะธะต + ะกั‚ะฐั€ั‚ะธั€ะฐะฝะต ะฝะฐ ัั‚ะธะบะฐ ะพั‚ ั‚ะพั‡ะบะฐั‚ะฐ ะฝะฐ ะดะพะบะพัะฒะฐะฝะต + ะกะบั€ะธะฒะฐะฝะต ะฝะฐ ัั‚ะธะบะฐ, ะบะพะณะฐั‚ะพ ะฝะต ัะต ะธะทะฟะพะปะทะฒะฐ + ะ˜ะฝัั‚ั€ัƒะผะตะฝั‚ะธ + ะะฒั‚ะพะผะฐั‚ะธั‡ะฝะพ (%1$s) + ะŸะตั€ัะพะฝะฐะปะธะทะธั€ะฐะฝะพ (%1$s) + ะ—ะฐะฟะฐะทะฒะฐะฝะต ะบะฐั‚ะพ ะฝะพะฒ ะฟั€ะพั„ะธะป + ะฃะฟั€ะฐะฒะปะตะฝะธะต ะฝะฐ ะฟั€ะพั„ะธะปะฐ + ะŸั€ะพั„ะธะป + ะ–ะตัั‚ะพะฒะต ะฝะฐ ั‚ัŠั‡ะฟะฐะดะฐ ะฝะฐ ะผะธัˆะบะฐั‚ะฐ + ะšะพะณะฐั‚ะพ ะต ะทะฐะดะฐะดะตะฝะพ ะฝะฐ ะฟะพะบะฐะทะฐะปะตั†ะฐ ะฝะฐ ะผะธัˆะบะฐั‚ะฐ: ะดะพะบะพัะฝะตั‚ะต ะทะฐ ั‰ั€ะฐะบะฒะฐะฝะต, ะทะฐะดั€ัŠะถั‚ะต ะทะฐ ะฟะปัŠะทะณะฐะฝะต ะธ ะฟั€ะตะฒัŠั€ั‚ะฐะนั‚ะต ั ะดะฒะฐ ะฟั€ัŠัั‚ะฐ. + %1$s ะธะผะฐ ะทะฐะผัะฝะฐ ะฝะฐ ะฑัŠั€ะทะพั‚ะพ ะผะตะฝัŽ. ะ˜ะทะฑะตั€ะตั‚ะต ะะฒั‚ะพะผะฐั‚ะธั‡ะฝะพ, ะทะฐ ะดะฐ ะธะทะฟะพะปะทะฒะฐั‚ะต ะฟั€ะพั„ะธะปะฐ ะฟะพ ะฟะพะดั€ะฐะทะฑะธั€ะฐะฝะต ะธ ั‚ั€ะธั‚ะต ะทะฐะฟะฐะทะตะฝะธ ั‡ะฐัั‚ะธ. + ะ’ั…ะพะด ะฝะฐ DroidDeck + ะ—ะฐะดัŠั€ะถะฐ ัะต, ะดะพะบะฐั‚ะพ ัั‚ะธะบัŠั‚ ะต ะพั‚ะผะตัั‚ะตะฝ ะฒ ะบะพัั‚ะพ ะธ ะดะฐ ะต ะฟะพัะพะบะฐ: ะฝะฐั‚ะธัะบะฐ ะฟั€ะธ ะฝะฐะด 55%, ะพั‚ะฟัƒัะบะฐ ะฟะพะด 35%. ะ˜ะทะฟะพะปะทะฒะฐะนั‚ะต ะšะปะฐะฒะธัˆะธ ะทะฐ ะฟะพัะพะบะฐ, ะทะฐ ะดะฐ ะทะฐะดะฐะดะตั‚ะต ะฒััะบะฐ ะฟะพัะพะบะฐ ะพั‚ะดะตะปะฝะพ. ะšะพะผะฐะฝะดะธั‚ะต ะฝะฐ DroidDeck ัะต ะธะทะฟัŠะปะฝัะฒะฐั‚ ะฒะตะดะฝัŠะถ ะฝะฐ ะพั‚ะบะปะพะฝะตะฝะธะต. ะฉั€ะฐะบะฒะฐะฝะตั‚ะพ ะฝะฐ ัั‚ะธะบะฐ ัะต ะฝะฐัั‚ั€ะพะนะฒะฐ ะพั‚ะดะตะปะฝะพ. + ะ—ะฐะดัŠั€ะถะฐ ัะต, ะดะพะบะฐั‚ะพ ะดะพะบะพัะฒะฐั‚ะต ั‚ัŠั‡ะฟะฐะดะฐ; ะพั‚ะฟัƒัะบะฐ ัะต ะฟั€ะธ ะฒะดะธะณะฐะฝะต ะฝะฐ ะฟั€ัŠัั‚ะฐ. ะšะพะผะฐะฝะดะธั‚ะต ะฝะฐ DroidDeck ัะต ะธะทะฟัŠะปะฝัะฒะฐั‚ ะฒะตะดะฝัŠะถ ะฝะฐ ะดะพะบะพัะฒะฐะฝะต. ะฉั€ะฐะบะฒะฐะฝะตั‚ะพ ะฝะฐ ั‚ัŠั‡ะฟะฐะดะฐ ัะต ะฝะฐัั‚ั€ะพะนะฒะฐ ะพั‚ะดะตะปะฝะพ. + ะ—ะฐะดัŠั€ะถะฐ ัะต, ะบะพะณะฐั‚ะพ ัะฟัƒััŠะบัŠั‚ ะฟั€ะตะผะธะฝะต 55%; ะพั‚ะฟัƒัะบะฐ ัะต ะฟะพะด 35%. ะšะพะผะฐะฝะดะธั‚ะต ะฝะฐ DroidDeck ัะต ะธะทะฟัŠะปะฝัะฒะฐั‚ ะฒะตะดะฝัŠะถ ะฝะฐ ะฝะฐั‚ะธัะบะฐะฝะต. + ะŸะพัะพะบะฐ ะฝะฐ ะฟั€ะตะฒัŠั€ั‚ะฐะฝะต + ะ’ะตั€ั‚ะธะบะฐะปะฝะพ + ะฅะพั€ะธะทะพะฝั‚ะฐะปะฝะพ + ะฅะพั€ะธะทะพะฝั‚ะฐะปะฝะพ ะฟั€ะตะฒัŠั€ั‚ะฐะฝะต + ะ˜ะทะผะตั€ะฒะฐะฝะธั + ะ’ะบะปัŽั‡ะตั‚ะต ะทะฐะฟะธัะฐ, ะธะทะฟะพะปะทะฒะฐะนั‚ะต ัƒะฟั€ะฐะฒะปะตะฝะธะตั‚ะพ ะฒ ะฐะบั‚ะธะฒะฝะฐ ัะตัะธั, ัะปะตะด ะบะพะตั‚ะพ ัะต ะฒัŠั€ะฝะตั‚ะต ะธ ะฟั€ะพั‡ะตั‚ะตั‚ะต ั€ะตะทัƒะปั‚ะฐั‚ะธั‚ะต. ะ˜ะทะผะตั€ะฒะฐ ัะฐะผะพ ะฒั€ะตะผะตั‚ะพ ะทะฐ ะธะทะฟั€ะฐั‰ะฐะฝะต ะฝะฐ DroidDeck, ะฝะต ะทะฐะบัŠัะฝะตะฝะธะตั‚ะพ ะฝะฐ ะตะบั€ะฐะฝะฐ. ะ—ะฐะฟะธััŠั‚ ะฟั€ะธะบะปัŽั‡ะฒะฐ ะฟั€ะธ ะทะฐั‚ะฒะฐั€ัะฝะต ะฝะฐ ะฟั€ะพั†ะตัะฐ ะฝะฐ ะฟั€ะธะปะพะถะตะฝะธะตั‚ะพ. + %1$d ะบะพะฝั‚ั€ะพะปะฐ + ะ”ั€ัƒะณะธ ะทะฐะฟะฐะทะตะฝะธ ะพั„ะพั€ะผะปะตะฝะธั (%1$d) โ–พ + ะกะบั€ะธะฒะฐะฝะต ะฝะฐ ะดั€ัƒะณะธ ะทะฐะฟะฐะทะตะฝะธ ะพั„ะพั€ะผะปะตะฝะธั (%1$d) โ–ด + ะะฐั‡ะฐะปะพ / Guide + ะะฐะทะฐะด ยท ะตะดะฝะพ ะดะพะบะพัะฒะฐะฝะต + ะะฐะทะฐะด ยท ะดะฒะพะนะฝะพ ะดะพะบะพัะฒะฐะฝะต + ะะฐะทะฐะด ยท ะดะฒะฐ ะฟัŠั‚ะธ ะฒ Steam, ะฒะตะดะฝัŠะถ ะฒ ั€ะฐะฑะพั‚ะตะฝ ะฟะปะพั‚ + ะ’ ั€ะตะถะธะผ Steam. ะ—ะฐะดัŠั€ะถะฐะฝะตั‚ะพ ะฝะฐ ะะฐะทะฐะด ะพั‚ะฒะฐั€ั ะธ ะฑัŠั€ะทะธั ะดะพัั‚ัŠะฟ. + ะ’ั€ัŠั‰ะฐะฝะต ะบัŠะผ ะฟะพะดั€ะฐะทะฑะธั€ะฐะฝะตั‚ะพ + ะ˜ะทะฑะพั€ัŠั‚ ะฝะฐ ะฟะฐะฝะตะป ัะต ะทะฐะฟะพะผะฝั. ะ ะฐะฑะพั‚ะฝะธัั‚ ะฟะปะพั‚ ะพั‚ะฒะฐั€ั ะฒั‚ะพั€ะพ ั€ะฐะฑะพั‚ะฝะพ ะฟั€ะพัั‚ั€ะฐะฝัั‚ะฒะพ; ะฝะต ัะผะตะฝั ัะตัะธัั‚ะฐ ะธะปะธ ะฟั€ะพั„ะธะปะฐ ั ะทะฐ ะฒั…ะพะด. + ะ’ะธั€ั‚ัƒะฐะปะตะฝ ะบะพะฝั‚ั€ะพะปะตั€ + ะขะธะฟัŠั‚ ะบะพะฝั‚ั€ะพะปะตั€, ะบะพะนั‚ะพ Steam ะธะปะธ ะธะณั€ะฐั‚ะฐ ะฒะธะถะดะฐั‚. + ะกะตะฝะทะพั€ะตะฝ ะตะบั€ะฐะฝ + ะšะฐะบ ัะต ะพะฑั€ะฐะฑะพั‚ะฒะฐั‚ ะดะพะบะพัะฒะฐะฝะธัั‚ะฐ ะฝะฐ ะตะบั€ะฐะฝะฐ ะฝะฐ ะธะณั€ะฐั‚ะฐ. ะ‘ัƒั‚ะพะฝะธั‚ะต ะฝะฐ ะฟั€ะพั„ะธะปะฐ ะทะฐะฟะฐะทะฒะฐั‚ ะทะฐะดะฐะดะตะฝะธั‚ะต ัะธ ะดะตะนัั‚ะฒะธั. + ะšัƒั€ัะพั€ ะทะฐ ะดะพะบะพัะฒะฐะฝะต + ะŸะพะบะฐะทะฒะฐ ะฟะพะบะฐะทะฐะปะตั† ะทะฐ ะดะธั€ะตะบั‚ะฝะธ ะดะพะบะพัะฒะฐะฝะธั ะฝะฐ ะตะบั€ะฐะฝะฐ ะฝะฐ ะธะณั€ะฐั‚ะฐ. + ะ”ะพะบะพัะฒะฐะฝะต ะธ ะทะฐะดัŠั€ะถะฐะฝะต + ะ”ะตะนัั‚ะฒะธะต ะฝะฐ ะผะธัˆะบะฐั‚ะฐ ะฟั€ะธ ะทะฐะดัŠั€ะถะฐะฝะต ะฝะฐ ะฟั€ัŠัั‚ ะฝะฐ ะตะบั€ะฐะฝะฐ ะฝะฐ ะธะณั€ะฐั‚ะฐ. + ะ”ะพะบะพัะฒะฐะฝะธั ะฝะฐ ะฑัƒั‚ะพะฝะฐ ะะฐะทะฐะด + ะŸัŠั€ะฒะพ ะดะตะนัั‚ะฒะธะต: ะตะดะฝะพ ะดะพะบะพัะฒะฐะฝะต. ะ’ั‚ะพั€ะพ ะดะตะนัั‚ะฒะธะต: ะดะฒะพะนะฝะพ ะดะพะบะพัะฒะฐะฝะต. + ะŸั€ะตะฒะบะปัŽั‡ะฒะฐั‰ ะฑัƒั‚ะพะฝ + ะ”ะพะบะพัะฝะตั‚ะต ะทะฐ ะทะฐะดัŠั€ะถะฐะฝะต, ะดะพะบะพัะฝะตั‚ะต ะพั‚ะฝะพะฒะพ ะทะฐ ะพัะฒะพะฑะพะถะดะฐะฒะฐะฝะต. ะžั‚ะฒะฐั€ัะฝะต ะฝะฐ ะผะตะฝัŽ ะธะปะธ ัะผัะฝะฐ ะฝะฐ ะฟั€ะพั„ะธะป ะพัะฒะพะฑะพะถะดะฐะฒะฐ ะฑัƒั‚ะพะฝะฐ. + ะคะพั€ะผะฐ + ะ—ะฐะพะฑะปะตะฝะฐ + ะšะฐะฟััƒะปะฐ + ะšั€ัŠะณ + ะŸั€ะฐะฒะพัŠะณัŠะปะฝะธะบ + ะะฐะดะฟะธั ะฝะฐ ะฑัƒั‚ะพะฝะฐ + ะขะตะบัั‚ + ะ˜ะผะฟะพั€ั‚ะธั€ะฐะฝะพ ะธะทะพะฑั€ะฐะถะตะฝะธะต + ะžั‚ะดะตะปะฝะธ ะดะธะฐะณะพะฝะฐะปะฝะธ ะบะปะฐะฒะธัˆะธ + ะ—ะฐะดะฐะนั‚ะต ะบะปะฐะฒะธัˆ ะทะฐ ะฒัะตะบะธ ะดะธะฐะณะพะฝะฐะป. ะŸั€ะฐะทะฝะธัั‚ ะดะธะฐะณะพะฝะฐะป ะฝะฐั‚ะธัะบะฐ ะดะฒะตั‚ะต ััŠัะตะดะฝะธ ะฟะพัะพะบะธ. + ะกัŠัะตะดะฝะธ ะฟะพัะพะบะธ + ะกั‚ะฐั€ะธั‚ะต ะฒะธ ะตะบั€ะฐะฝะฝะธ ะบะปะฐะฒะธัˆะธ ัะฐ ะทะฐะฟะฐะทะตะฝะธ ะบะฐั‚ะพ ะธะผะฟะพั€ั‚ะธั€ะฐะฝะธ ะฟั€ะพั„ะธะปะธ ะฟะพ-ะดะพะปัƒ. ะ˜ะทะฑะตั€ะตั‚ะต ะตะดะธะฝ ะทะฐ ะธะทะฟะพะปะทะฒะฐะฝะต ะธะปะธ ั€ะตะดะฐะบั‚ะธั€ะฐะฝะต. ะขะตะบัƒั‰ะธั‚ะต ะธะทะฑะพั€ะธ ะฝะฐ ะฟั€ะพั„ะธะป ัะฐ ะทะฐะฟะฐะทะตะฝะธ. + ะกั‚ะฐั€ะธั‚ะต ะตะบั€ะฐะฝะฝะธ ะบะปะฐะฒะธัˆะธ ะฝะต ะผะพะถะฐั…ะฐ ะดะฐ ัะต ะธะผะฟะพั€ั‚ะธั€ะฐั‚ ะฐะฒั‚ะพะผะฐั‚ะธั‡ะฝะพ. ะžั€ะธะณะธะฝะฐะปะฝะธั‚ะต ะฝะฐัั‚ั€ะพะนะบะธ ัะฐ ะทะฐะฟะฐะทะตะฝะธ. + diff --git a/app/src/main/res/values-bg/input_strings.xml b/app/src/main/res/values-bg/input_strings.xml new file mode 100644 index 0000000000..3e16a7059a --- /dev/null +++ b/app/src/main/res/values-bg/input_strings.xml @@ -0,0 +1,38 @@ + + + ะŸั€ะพั„ะธะปะธ ะทะฐ ะฒั…ะพะด + ะŸั€ะพั„ะธะปะธ + ะคะธะทะธั‡ะตัะบะธ ะบะพะฝั‚ั€ะพะปะตั€ + ะžัะฝะพะฒะตะฝ ะตะบั€ะฐะฝ + ะ’ั‚ะพั€ะธ ะตะบั€ะฐะฝ + ะกะพะฑัั‚ะฒะตะฝ / Steam Input + ะกะพะฑัั‚ะฒะตะฝ: %1$s + ะ˜ะทะฟั€ะฐั‰ะฐะฝะต ะฝะฐ ะดั€ัƒะณะฐ ะบะพะผะฐะฝะดะฐ ะพั‚ ะบะพะฝั‚ั€ะพะปะตั€ะฐ + ะ˜ะทะบะปัŽั‡ะตะฝะพ + ะšะปะฐะฒะธัˆ ะธะปะธ ะบะพะผะฑะธะฝะฐั†ะธั ะพั‚ ะบะปะฐะฒะธัˆะธ + ะšะปะฐะฒะธัˆะธ ะทะฐ ะฟะพัะพะบะฐ + ะ”ะฒะธะถะตะฝะธะต ะฝะฐ ะฟะพะบะฐะทะฐะปะตั†ะฐ + ะกะบะพั€ะพัั‚ ะฝะฐ ะฟะพะบะฐะทะฐะปะตั†ะฐ: %1$d + ะŸั€ะตะฒัŠั€ั‚ะฐะฝะต + ะ’ะตั€ั‚ะธะบะฐะปะฝะพ ะฟั€ะตะฒัŠั€ั‚ะฐะฝะต + ะ›ัะฒ ะฑัƒั‚ะพะฝ ะฝะฐ ะผะธัˆะบะฐั‚ะฐ + ะ”ะตัะตะฝ ะฑัƒั‚ะพะฝ ะฝะฐ ะผะธัˆะบะฐั‚ะฐ + ะกั€ะตะดะตะฝ ะฑัƒั‚ะพะฝ ะฝะฐ ะผะธัˆะบะฐั‚ะฐ + ะžั‚ะฒะฐั€ัะฝะต ะฝะฐ ะผะตะฝัŽั‚ะพ ะฝะฐ DroidDeck + ะŸะพะบะฐะทะฒะฐะฝะต ะฝะฐ ะบะปะฐะฒะธะฐั‚ัƒั€ะฐั‚ะฐ + ะžั‚ะฒะฐั€ัะฝะต ะฝะฐ ะผะตะฝัŽั‚ะพ ะฝะฐ Steam + ะžั‚ะฒะฐั€ัะฝะต ะฝะฐ ะฑัŠั€ะทะธั ะดะพัั‚ัŠะฟ ะฝะฐ Steam + ะŸั€ะตะผะฐั…ะฒะฐะฝะต ะฝะฐ ะบะพะฝั‚ั€ะพะปะฐ + ะ”ะพะฑะฐะฒัะฝะต ะฝะฐ ะบะพะฝั‚ั€ะพะป + ะ‘ัƒั‚ะพะฝะธ, ัะฟะตั†ะธั„ะธั‡ะฝะธ ะทะฐ ัƒัั‚ั€ะพะนัั‚ะฒะพั‚ะพ + ะ—ะฐะดะฐะฒะฐะฝะต ะฝะฐ ั„ะธะทะธั‡ะตัะบะธ ะฑัƒั‚ะพะฝ + ะžั‚ะฟัƒัะฝะตั‚ะต ะฑัƒั‚ะพะฝะฐ, ัะปะตะด ะบะพะตั‚ะพ ะธะทะฑะตั€ะตั‚ะต ะ ะตะดะฐะบั†ะธั, ะŸะพะฒั‚ะพั€ะตะฝะธะต ะธะปะธ ะžั‚ะบะฐะท. B ะธะปะธ ะะฐะทะฐะด ะพั‚ะผะตะฝั ัะปะตะด ะพั‚ะฟัƒัะบะฐะฝะตั‚ะพ. + ะŸะพะฒั‚ะพั€ะตะฝะธะต + ะะฐั‚ะธัะฝะตั‚ะต ะฑัƒั‚ะพะฝ, ะฒะบะปัŽั‡ะธั‚ะตะปะฝะพ ะฑัƒั‚ะพะฝ ะะฐะทะฐะด, ััŠะพะฑั‰ะตะฝ ะบะฐั‚ะพ ะบะปะฐะฒะธัˆ. ะšะปะฐะฒะธัˆะธั‚ะต ะทะฐ ัะธะปะฐ ะฝะฐ ะทะฒัƒะบะฐ ะธ ัะธัั‚ะตะผะฝะธั‚ะต ะบะปะฐะฒะธัˆะธ ะฝะฐ Android ัะฐ ะทะฐะฟะฐะทะตะฝะธ. ะ—ะฐะดะฐะฒะฐะฝะตั‚ะพ ะฒะฐะถะธ ัะฐะผะพ ะทะฐ ั‚ะพะฒะฐ ัƒัั‚ั€ะพะนัั‚ะฒะพ. + ะŸั€ะตะผะฐั…ะฒะฐะฝะต ะฝะฐ ะทะฐะดะฐะฒะฐะฝะตั‚ะพ + ะ”ะธะฐะณะฝะพัั‚ะธะบะฐ ะฝะฐ ะฒั…ะพะดะฐ + ะ—ะฐะฟะธัะฒะฐะฝะต ะฝะฐ ะฒั€ะตะผะตั‚ะพ ะทะฐ ะธะทะฟั€ะฐั‰ะฐะฝะต ะฝะฐ ะฒั…ะพะดะฐ + ะŸั€ะพั‡ะธั‚ะฐะฝะต ะฝะฐ ะธะทะผะตั€ะฒะฐะฝะธัั‚ะฐ + ะ˜ะทะผะตั€ะฒะฐ ะฟัŠั‚ั ะพั‚ ะธะทะฟั€ะฐั‰ะฐะฝะตั‚ะพ ะฒ Android ะดะพ ะฟัƒะฑะปะธะบัƒะฒะฐะฝะตั‚ะพ ะฒ ััŠั‰ะตัั‚ะฒัƒะฒะฐั‰ะธั ะฒั…ะพะดะตะฝ ั‚ั€ะฐะฝัะฟะพั€ั‚. ะะต ะฒะบะปัŽั‡ะฒะฐ ะฟั€ะธัั‚ะธะณะฐะฝะตั‚ะพ ะฟะพ Bluetooth, ะทะฐะฟะธั‚ะฒะฐะฝะตั‚ะพ ะฝะฐ ะณะพัั‚ะฐ, ะธะทะพะฑั€ะฐะทัะฒะฐะฝะตั‚ะพ ะธ ะทะฐะบัŠัะฝะตะฝะธะตั‚ะพ ะฝะฐ ะตะบั€ะฐะฝะฐ. ะ—ะฐะฟะธััŠั‚ ะต ะธะทะบะปัŽั‡ะตะฝ ะฟะพ ะฟะพะดั€ะฐะทะฑะธั€ะฐะฝะต. + ะ˜ะทะฟะพะปะทะฒะฐะฝะต ะฝะฐ ะพะฑะธั‡ะฐะนะฝะพั‚ะพ ะทะฐะดะฐะฒะฐะฝะต ะฝะฐ ะฒั…ะพะด + diff --git a/app/src/main/res/values-bg/strings.xml b/app/src/main/res/values-bg/strings.xml index 36751e5311..a2760406e6 100644 --- a/app/src/main/res/values-bg/strings.xml +++ b/app/src/main/res/values-bg/strings.xml @@ -28,6 +28,8 @@ ะŸั€ะธัะฟะธ ัะตะณะฐ ะกะฟั€ะธ ัะตัะธัั‚ะฐ ะ“ะตะฝะตั€ะธั€ะฐะฝะต ะฝะฐ ะบะฐะดั€ะธ + ะะฐัั‚ั€ะพะนะบะธ ะทะฐ ั‚ะฐะทะธ ะธะณั€ะฐ + ะะฐัั‚ั€ะพะนะบะธ ะฟะพ ะฟะพะดั€ะฐะทะฑะธั€ะฐะฝะต ะ˜ะทะฑะตั€ะตั‚ะต ั€ะตะถะธะผะฐ ะฝะฐ ะณะตะฝะตั€ะธั€ะฐะฝะต ะฝะฐ ะบะฐะดั€ะธ ะ˜ะทะบะปัŽั‡ะตะฝะพ DD-FG %1$dร— @@ -183,6 +185,7 @@ ะ“ั€ะฐั„ะธั‡ะฝะฐั‚ะฐ ัั€ะตะดะฐ ะทะฐ PowerVR ะฝะต ะผะพะถะฐ ะดะฐ ะฑัŠะดะต ะธะทั‚ะตะณะปะตะฝะฐ. ะŸั€ะพะฒะตั€ะตั‚ะต ะฒั€ัŠะทะบะฐั‚ะฐ ะธ ะพะฟะธั‚ะฐะนั‚ะต ะพั‚ะฝะพะฒะพ. DirectAudio ะฝะต ะผะพะถะฐ ะดะฐ ะฑัŠะดะต ะธะทั‚ะตะณะปะตะฝ, ะทะฐั‚ะพะฒะฐ ะทะฒัƒะบัŠั‚ ะฝะฐ ะธะณั€ะธั‚ะต ะธะทะฟะพะปะทะฒะฐ ะฟะพ-ะฑะฐะฒะฝะธั ะฟัŠั‚ ะฒ ั‚ะฐะทะธ ัะตัะธั. ะขะฐะทะธ ะฟั€ะพะณั€ะฐะผะฐ + ะกะตัะธัั‚ะฐ ะฝะต ัƒัะฟั ะดะฐ ะธะทะพะฑั€ะฐะทะธ ััŠะดัŠั€ะถะฐะฝะธะต ะฝะฐ ะตะบั€ะฐะฝะฐ: %1$s. ะ’ะผะตัั‚ะพ ั‡ะตั€ะตะฝ ะตะบั€ะฐะฝ ั‚ัƒะบ ะต ะฟะพะบะฐะทะฐะฝะฐ ะฟั€ะธั‡ะธะฝะฐั‚ะฐ; ะฟะพะดั€ะพะฑะฝะพัั‚ะธั‚ะต ัะฐ ะฒ ะดะฝะตะฒะฝะธั†ะธั‚ะต ะฝะฐ ัะตัะธัั‚ะฐ. ะšะปะธะตะฝั‚ัŠั‚ ะฝะฐ Steam ะฝะต ะผะพะถะฐ ะดะฐ ะฑัŠะดะต ะธะทั‚ะตะณะปะตะฝ. ะœั€ะตะถะฐั‚ะฐ ะธะปะธ VPN ะฒั€ัŠะทะบะฐั‚ะฐ ะฒะธ ะผะพะถะต ะดะฐ ะฑะปะพะบะธั€ะฐ ััŠั€ะฒัŠั€ะธั‚ะต ะฝะฐ Steam; ะฟั€ะพะฒะตั€ะตั‚ะต ะฒั€ัŠะทะบะฐั‚ะฐ ะธ ะพะฟะธั‚ะฐะนั‚ะต ะพั‚ะฝะพะฒะพ. ะšะปะธะตะฝั‚ัŠั‚ ะฝะฐ Steam ะฝะต ะผะพะถะฐ ะดะฐ ะฑัŠะดะต ะฝะฐัั‚ั€ะพะตะฝ. ะŸั€ะพะฒะตั€ะตั‚ะต ะฒั€ัŠะทะบะฐั‚ะฐ ะธ ัะฒะพะฑะพะดะฝะพั‚ะพ ะผััั‚ะพ, ัะปะตะด ะบะพะตั‚ะพ ะพะฟะธั‚ะฐะนั‚ะต ะพั‚ะฝะพะฒะพ. %1$s ะต ะบะพะผะฟะธะปะธั€ะฐะฝะฐ ะทะฐ x86 ะบะพะผะฟัŽั‚ั€ะธ ะธ ัะต ัั‚ะฐั€ั‚ะธั€ะฐ ะฟั€ะตะท FEX, ะบะพะนั‚ะพ ะพั‰ะต ะฝะต ะต ะธะฝัั‚ะฐะปะธั€ะฐะฝ. ะกั‚ะฐั€ั‚ะธั€ะฐะนั‚ะต Steam ะฒะตะดะฝัŠะถ, ะดะพะบะฐั‚ะพ ัั‚ะต ะฒะปะตะทะปะธ, ะธ ะณะพ ะพัั‚ะฐะฒะตั‚ะต ะดะฐ ะธะทั‚ะตะณะปะธ FEX ะธ Steam Linux Runtime, ัะปะตะด ะบะพะตั‚ะพ ัั‚ะฐั€ั‚ะธั€ะฐะนั‚ะต ะพั‚ะฝะพะฒะพ. @@ -385,6 +388,9 @@ ะ’ัะต ะพั‰ะต ะฝะต ัะต ะฟะพะดะดัŠั€ะถะฐ ั‚ัƒะบ ะ—ะฐั€ะตะถะดะฐะฝะต ะฝะฐ ะบะพะผะฟะพะฝะตะฝั‚ะธั‚ะตโ€ฆ ะ˜ะฝัั‚ะฐะปะธั€ะฐะฝะตั‚ะพ ะฝะต ะฑะต ัƒัะฟะตัˆะฝะพ: %1$s + ะขะพะฒะฐ ะธะทั‚ะตะณะปัะฝะต ัะต ะฝัƒะถะดะฐะต ะพั‚ ะฐะบั‚ัƒะฐะปะธะทะฐั†ะธั. + ะะบั‚ัƒะฐะปะธะทะฐั†ะธัั‚ะฐ ะต ะฒ ะพะฟะฐัˆะบะฐั‚ะฐ. + ะŸะพะฒั‚ะพั€ะธ ะฐะบั‚ัƒะฐะปะธะทะฐั†ะธัั‚ะฐ ะ˜ะทั‚ะตะณะปะตะฝะพ ะ˜ะทั‚ะตะณะปัะฝะต ะฝะฐ %1$s ะ˜ะฝัั‚ะฐะปะธั€ะฐะฝะต: %1$s @@ -415,6 +421,22 @@ ะกะฐะผะพ ะฒัŠั‚ั€ะตัˆะฝะฐ ะฟะฐะผะตั‚ ะŸะฐะฟะบะฐ: %1$s ะ’ั‚ะพั€ะฐ ะฑะธะฑะปะธะพั‚ะตะบะฐ + ะžั‰ะต ะฑะธะฑะปะธะพั‚ะตะบะธ ะฝะฐ Steam + ะŸะฐะฟะบะธ, ะฒ ะบะพะธั‚ะพ Steam ะผะพะถะต ะดะฐ ะธะฝัั‚ะฐะปะธั€ะฐ ะธะณั€ะธ ะธ ะพั‚ ะบะพะธั‚ะพ ะดะฐ ะณะธ ะฟัƒัะบะฐ, ะฒััะบะฐ ััŠั ัะฒะพะต ะธะผะต. ะŸั€ะธ ะฟั€ะตะผะฐั…ะฒะฐะฝะต ะฝะฐ ะฟะฐะฟะบะฐ ะธะณั€ะธั‚ะต ั ะพัั‚ะฐะฒะฐั‚ ะฝะฐ ะดะธัะบะฐ. + ะ”ะพะฑะฐะฒะธ ะฑะธะฑะปะธะพั‚ะตะบะฐ + ะŸั€ะตะธะผะตะฝัƒะฒะฐะน + ะ˜ะผะต ะฝะฐ ะฑะธะฑะปะธะพั‚ะตะบะฐั‚ะฐ + ะ˜ะทะฑะตั€ะธ ะฟะฐะฟะบะฐ ะทะฐ ะฑะธะฑะปะธะพั‚ะตะบะฐั‚ะฐ + ะะฐะน-ะผะฝะพะณะพ %1$d ะดะพะฑะฐะฒะตะฝะธ ะฑะธะฑะปะธะพั‚ะตะบะธ + ะขะฐะทะธ ะฟะฐะฟะบะฐ ะฒะตั‡ะต ะต ะฑะธะฑะปะธะพั‚ะตะบะฐ ะธะปะธ ัะต ะฝะฐะผะธั€ะฐ ะฒ ั‚ะฐะบะฐะฒะฐ + %1$s ยท ะฝะต ะต ะฝะฐะปะธั‡ะฝะฐ + ะ’ะปะธะทะฐ ะฒ ัะธะปะฐ ะพั‚ ัะปะตะดะฒะฐั‰ะฐั‚ะฐ ัะตัะธั ะฝะฐ Steam + ะžั‚ะบั€ะธั‚ะธ ะฝะฐ ั‚ะพะฒะฐ ัƒัั‚ั€ะพะนัั‚ะฒะพ ยท %1$s ยท %2$s + ะ”ะพะฑะฐะฒะธ + ะžั‚ะบั€ะธะฒะฐะฝะต ะฝะฐ ะฑะธะฑะปะธะพั‚ะตะบะธ ะฒัŠะฒ ะฒัŠั‚ั€ะตัˆะฝะฐั‚ะฐ ะฟะฐะผะตั‚ + ะ ะฐะทั€ะตัˆะธ ะดะพัั‚ัŠะฟ ะดะพ ะฒัะธั‡ะบะธ ั„ะฐะนะปะพะฒะต, ะทะฐ ะดะฐ ะผะพะถะต DroidDeck ะดะฐ ะฒะธะถะดะฐ ะฑะธะฑะปะธะพั‚ะตะบะธั‚ะต ะฝะฐ Steam, ะบะพะธั‚ะพ ะดั€ัƒะณะธ ะฟั€ะธะปะพะถะตะฝะธั ััŠั…ั€ะฐะฝัะฒะฐั‚ ะฒัŠะฒ ะฒัŠั‚ั€ะตัˆะฝะฐั‚ะฐ ะฟะฐะผะตั‚. + ะ ะฐะทั€ะตัˆะธ + ะ”ะพะฑะฐะฒะตะฝะฐ ะต %1$s, ะฑะธะฑะปะธะพั‚ะตะบะฐั‚ะฐ ะฝะฐ Steam ะฒ ะฟะฐะฟะบะฐั‚ะฐ, ะบะพัั‚ะพ ะธะทะฑั€ะฐ ะ˜ะณั€ะธ, ะบะพะธั‚ะพ ัั‚ั€ะธะนะผะฒะฐั‚ ั€ะตััƒั€ัะธ ะพั‚ SD ะบะฐั€ั‚ะฐั‚ะฐ ะธะปะธ ะพะฑั‰ะพั‚ะพ ั…ั€ะฐะฝะธะปะธั‰ะต, ะผะพะถะต ะดะฐ ะทะฐะตะบะฒะฐั‚. ะ”ะธะฐะณะฝะพัั‚ะธะบะฐ ะฝะฐ ั…ั€ะฐะฝะธะปะธั‰ะตั‚ะพ ะ—ะฐะฟะธัะฒะฐ ั€ะตะทัƒะปั‚ะฐั‚ะธั‚ะต ะพั‚ ะทะฐะดะตะปัะฝะตั‚ะพ ะธ ะธะทะฒะฐะดะบะพะฒะธ ะฒั€ะตะผะตะฝะฐ ะฝะฐ ั…ั€ะฐะฝะธะปะธั‰ะตั‚ะพ ะฒ โ€žะกะฟะพะดะตะปัะฝะต ะฝะฐ ะดะฝะตะฒะฝะธั†ะธโ€œ. ะœะพะถะต ะดะฐ ะทะฐะฑะฐะฒะธ ะธะฝัั‚ะฐะปะฐั†ะธะธั‚ะต, ะดะพะบะฐั‚ะพ ะต ะฒะบะปัŽั‡ะตะฝะพ. ะŸั€ะธะปะฐะณะฐ ัะต ะพั‚ ัะปะตะดะฒะฐั‰ะฐั‚ะฐ ัะตัะธั. @@ -478,6 +500,7 @@ ะ’ะบะปัŽั‡ะตะฝะพ ะกั‚ะฐั€ั‚ะธั€ะฐ ััŠั Steam ะกั‚ะฐั€ั‚ะธั€ะฐ ะฑะตะท Steam + ะ ะตะทะพะปัŽั†ะธั ะฝะฐ ะธะณั€ะฐั‚ะฐ ะะฐัั‚ั€ะพะนะบะธ ะะฐัั‚ั€ะพะนะบะธ ะฝะฐ %1$s ะŸะพ ะฟะพะดั€ะฐะทะฑะธั€ะฐะฝะต @@ -565,6 +588,8 @@ ะฏะดั€ะฐ ะทะฐ ะธะณั€ะธ ะฏะดั€ะฐ ะทะฐ ะธะณั€ะธ ะฏะดั€ะฐ ะทะฐ ะธะณั€ะธ. ะšะพะณะฐั‚ะพ ะฒัะธั‡ะบะธ ัะฐ ะธะทะฑั€ะฐะฝะธ, Android ะณะธ ั€ะฐะทะฟั€ะตะดะตะปั ัะฒะพะฑะพะดะฝะพ. + ะŸะตัั‚ะตะฝะต ะฝะฐ ะตะฝะตั€ะณะธั ะฟั€ะธ ัั‚ะฐะฑะธะปะฝะธ ะธะณั€ะธ + ะŸัƒัะบะฐ ะธะณั€ะฐั‚ะฐ ะฝะฐ ะฟะพ-ะฑะฐะฒะฝะธั‚ะต ัะดั€ะฐ, ะดะพะบะฐั‚ะพ ะดัŠั€ะถะธ ัั‚ะฐะฑะธะปะฝะฐ ะบะฐะดั€ะพะฒะฐ ั‡ะตัั‚ะพั‚ะฐ, ะธ ั ะฒั€ัŠั‰ะฐ ะฝะฐ ะพะฑะธั‡ะฐะนะฝะธั‚ะต ั ัะดั€ะฐ, ั‰ะพะผ ะธะทะพัั‚ะฐะฝะต. ะ˜ะฝั‚ะตั€ั„ะตะนั ะฝะฐ ะบะปะธะตะฝั‚ะฐ ะœะฝะพะณะพะฝะธัˆะบะพะฒ GL ะœะพะถะต ะดะฐ ะฝะฐะฟั€ะฐะฒะธ ะผะตะฝัŽั‚ะฐั‚ะฐ ะฝะฐ Steam ะฟะพ-ะพั‚ะทะธะฒั‡ะธะฒะธ. @@ -600,7 +625,10 @@ ะ˜ะทะบะปัŽั‡ะฒะฐ ะฟะพะผะพั‰ะฝะธะบะฐ ะฝะฐ Proton ะทะฐ ะฝะฐะฒะธะณะฐั†ะธั ั ะบะพะฝั‚ั€ะพะปะตั€, ะบะพะนั‚ะพ ะธะทะฟะพะปะทะฒะฐ ะฟั€ะพั†ะตัะพั€ะฝะพ ะฒั€ะตะผะต ะฒัŠะฒ ะฒััะบะฐ ะธะณั€ะฐ. ะกั‚ะฐั€ั‚ะธั€ะฐะฝะต ะฝะฐ proot ะฑะตะท seccomp ะœะพะถะต ะดะฐ ะพั‚ัั‚ั€ะฐะฝะธ ะณั€ะตัˆะบะธ ั ะปะธะฟัะฒะฐั‰ะธ ัะธัั‚ะตะผะฝะธ ะธะทะฒะธะบะฒะฐะฝะธั ะฝะฐ ะฝัะบะพะธ ัะดั€ะฐ. ะœะพะถะต ะดะฐ ะฝะฐะผะฐะปะธ ะฟั€ะพะธะทะฒะพะดะธั‚ะตะปะฝะพัั‚ั‚ะฐ. + ะกั‚ะฐั€ั‚ะธั€ะฐะฝะต ะฑะตะท proot (ะตะบัะฟะตั€ะธะผะตะฝั‚ะฐะปะฝะพ) + ะกั‚ะฐั€ั‚ะธั€ะฐ Linux ั‡ะฐัั‚ั‚ะฐ ะดะธั€ะตะบั‚ะฝะพ ะฒ Android. ะ’ะปะธะทะฐ ะฒ ัะธะปะฐ ะพั‚ ัะปะตะดะฒะฐั‰ะฐั‚ะฐ ัะตัะธั. ะ˜ะทะบะปัŽั‡ะธ, ะฐะบะพ ะฝะตั‰ะพ ะฝะต ัะต ัั‚ะฐั€ั‚ะธั€ะฐ. ะ‘ัŠั€ะท ะฟัŠั‚ ะฝะฐ proot + ะะต ัะต ะธะทะฟะพะปะทะฒะฐ ะฑะตะท proot. ะ˜ะทะธัะบะฒะฐ ั„ะธะปั‚ัŠั€ะฐ seccomp ะฝะฐ proot. ะŸะพ-ะฑัŠั€ะทะพ ั‚ัŠั€ัะตะฝะต ะฝะฐ ั„ะฐะนะปะพะฒะต ะธ ะฟะพ-ะผะฐะปะบะพ ะทะฐะตะบะฒะฐะฝะต. ะ˜ะทะบะปัŽั‡ะตั‚ะต, ะฐะบะพ ะฟั€ะพะณั€ะฐะผะฐ ะฝะต ะผะพะถะต ะดะฐ ะฝะฐะผะตั€ะธ ั„ะฐะนะปะพะฒะตั‚ะต ัะธ. ะ˜ะทะพะฑั€ะฐะทัะฒะฐะฝะต ะฝะฐ ะบัƒั€ัะพั€ะฐ ะฒ gamescope @@ -683,6 +711,7 @@ ะ“ั€ะฐั„ะธั‡ะฝะฐ ะฟะฐะผะตั‚ Swap ะฟะฐะผะตั‚ ะะธะฒะพ ะฝะฐ ะฑะฐั‚ะตั€ะธัั‚ะฐ + ะžัั‚ะฐะฒะฐั‰ะพ ะฒั€ะตะผะต ะฝะฐ ะฑะฐั‚ะตั€ะธัั‚ะฐ ะšะพะฝััƒะผะฐั†ะธั ะฝะฐ ะตะฝะตั€ะณะธั ะœั€ะตะถะฐ ะ ะฐะทะดะตะปะธั‚ะตะปะฝะฐ ัะฟะพัะพะฑะฝะพัั‚ @@ -809,6 +838,7 @@ ะฃัั‚ั€ะพะนัั‚ะฒะพั‚ะพ ัะต ะฟะพะดะดัŠั€ะถะฐ ะะตะฟั€ะพะฒะตั€ะตะฝ GPU GPU ะฝะต ัะต ะฟะพะดะดัŠั€ะถะฐ + GPU ะฟั€ะตะท Mali ะผะพัั‚ %1$s ยท %2$s %1$s: %2$s ะัะผะฐ ััŠะฒะผะตัั‚ะธะผ ะณั€ะฐั„ะธั‡ะตะฝ ะฑะตะบะตะฝะด ะทะฐ %1$s. Steam ะผะพะถะต ะดะฐ ะฟะพะบะฐะทะฒะฐ ั‡ะตั€ะตะฝ ะตะบั€ะฐะฝ. @@ -838,15 +868,38 @@ ะกะตัะธั ะ”ะฝะตะฒะฝะธั†ะธ ะฝะฐ ัะตัะธัั‚ะฐ ะ—ะฐะฟะฐะทะฒะฐั‚ ัะต ัะปะตะด ะฒััะบะฐ ัะตัะธั + ะ ะฐะทัˆะธั€ะตะฝะฐ ะดะธะฐะณะฝะพัั‚ะธะบะฐ ะทะฐ ัะปะตะดะฒะฐั‰ะฐั‚ะฐ ัะตัะธั + ะ—ะฐะฟะธัะฒะฐ ะฟะพะดั€ะพะฑะฝะธ ะดะฝะตะฒะฝะธั†ะธ ะทะฐ ะตะดะฝะฐ ัะตัะธั. ะœะพะถะต ะดะฐ ะฝะฐะผะฐะปะธ ะฟั€ะพะธะทะฒะพะดะธั‚ะตะปะฝะพัั‚ั‚ะฐ ะธ ะดะฐ ะทะฐะตะผะฐ ะฟะพะฒะตั‡ะต ะผััั‚ะพ ะทะฐ ััŠั…ั€ะฐะฝะตะฝะธะต. ะ˜ะทะบะปัŽั‡ะฒะฐ ัะต ัะฐะผะฐ ะฟั€ะธ ัั‚ะฐั€ั‚ะธั€ะฐะฝะต ะฝะฐ ัะตัะธัั‚ะฐ; ะฟั€ะตะณะปะตะดะฐะน ะดะฝะตะฒะฝะธั†ะธั‚ะต, ะฟั€ะตะดะธ ะดะฐ ะณะธ ัะฟะพะดะตะปะธัˆ. ะ”ะฝะตะฒะฝะธั†ะธ ะทะฐ ะดะตะฑัŠะณะฒะฐะฝะต ะฝะฐ ะธะณั€ะธ ะ’ะบะปัŽั‡ะฒะฐ ะดะธะฐะณะฝะพัั‚ะธะบะฐ ะฝะฐ Proton, Wine ะธ ะณั€ะฐั„ะธะบะฐั‚ะฐ ะฟั€ะธ ัะปะตะดะฒะฐั‰ะพั‚ะพ ัั‚ะฐั€ั‚ะธั€ะฐะฝะต ะฝะฐ ะธะณั€ะฐ. ะœะพะถะต ะดะฐ ะฝะฐะผะฐะปะธ ะฟั€ะพะธะทะฒะพะดะธั‚ะตะปะฝะพัั‚ั‚ะฐ ะธ ะดะฐ ะทะฐะตะผะต ะฟะพะฒะตั‡ะต ะผััั‚ะพ. ะ ะตัั‚ะฐั€ั‚ะธั€ะฐะนั‚ะต ั‚ะฐะทะธ ัะตัะธั, ะทะฐ ะดะฐ ะทะฐะฟะฐะทะธั‚ะต ะดะฝะตะฒะฝะธั†ะธั‚ะต ะทะฐ ะดะตะฑัŠะณะฒะฐะฝะต ะฝะฐ ะธะณั€ะธ ะ—ะฐะฟะธัะฒะฐะฝะตั‚ะพ ะฒ ะดะฝะตะฒะฝะธะบ ะฝะต ะผะพะถะฐ ะดะฐ ะฑัŠะดะต ะฟั€ะพะผะตะฝะตะฝะพ. ะŸั€ะพะฒะตั€ะตั‚ะต ะฟั€ะตะฒะบะปัŽั‡ะฒะฐั‚ะตะปั ะธ ะพะฟะธั‚ะฐะนั‚ะต ะฟะฐะบ. ะ˜ะฝัั‚ั€ัƒะผะตะฝั‚ะธ ะทะฐ ะพั‚ัั‚ั€ะฐะฝัะฒะฐะฝะต ะฝะฐ ะณั€ะตัˆะบะธ + ะŸะพะดั€ะพะฑะฝะธ ะดะฝะตะฒะฝะธั†ะธ ะทะฐ ะณั€ะฐั„ะธะบะฐั‚ะฐ + ะ˜ะฝั‚ะตั€ั„ะตะนั ะฝะฐ Steam: ะธะทั€ะธััƒะฒะฐะฝะต ั‡ั€ะตะท GPU + ะŸั€ะธ ะดะฒะพะนะบะฐั‚ะฐ ะดั€ะฐะนะฒะตั€ะธ Xclipse Steam ะธะทั€ะธััƒะฒะฐ ัั‚ั€ะฐะฝะธั†ะธั‚ะต ัะธ ัะพั„ั‚ัƒะตั€ะฝะพ (ะธะทั€ะธััƒะฒะฐะฝะตั‚ะพ ั‡ั€ะตะท GPU ะดะฐะฒะฐัˆะต ั€ะฐะทะฑะธั‚ะธ ะฟะปะพั‡ะบะธ). ะ’ะบะปัŽั‡ะธ ะทะฐ ะฟะพ-ะฑัŠั€ะท ะธะฝั‚ะตั€ั„ะตะนั ะฝะฐ Steam, ะฐะบะพ ะธะทะณะปะตะถะดะฐ ะฟั€ะฐะฒะธะปะฝะพ ะฝะฐ ั‚ะพะทะธ ั‚ะตะปะตั„ะพะฝ. + ะบะพะผะฟะธะปะธั€ะฐะฝะพ ะฝะฐ %1$s + %1$s ะฒะตั‡ะต ะธะทะฟะพะปะทะฒะฐ ะฝะฐะน-ะฝะพะฒะฐั‚ะฐ ะบะพะผะฟะธะปะฐั†ะธั + ะœะพัั‚ะธะบัŠั‚ Mali ะฝะต ะฟั€ะตะผะธะฝะฐ ัะฐะผะพะฟั€ะพะฒะตั€ะบะฐั‚ะฐ ัะธ ะฟั€ะธ ะฟะพัะปะตะดะฝะฐั‚ะฐ ัะตัะธั ะฝะฐ %1$s (ะธะทะพะฑั€ะฐะถะตะฝะธั ะธะปะธ ะบะพะผะฐะฝะดะธ ะทะฐ ั€ะธััƒะฒะฐะฝะต), ะทะฐั‚ะพะฒะฐ ะฒ ัะตัะธัั‚ะฐ ะฑะตัˆะต ะธะทะฟะพะปะทะฒะฐะฝะฐ ะดะฒะพะนะบะฐั‚ะฐ ะดั€ะฐะนะฒะตั€ะธ PanVK. + ะœะพัั‚ะธะบัŠั‚ Mali ะฝะต ะฝะฐะผะตั€ะธ ะฝะฐั‡ะธะฝ ะดะฐ ัะฟะพะดะตะปั ะฟะฐะผะตั‚ ั ะดั€ะฐะนะฒะตั€ะฐ ะฟั€ะธ ะฟะพัะปะตะดะฝะฐั‚ะฐ ัะตัะธั ะฝะฐ %1$s, ะทะฐั‚ะพะฒะฐ ะฒ ัะตัะธัั‚ะฐ ะฑะตัˆะต ะธะทะฟะพะปะทะฒะฐะฝะฐ ะดะฒะพะนะบะฐั‚ะฐ ะดั€ะฐะนะฒะตั€ะธ PanVK. ะœะพัั‚ะธะบัŠั‚ ะฝะต ะผะพะถะต ะดะฐ ั€ะฐะฑะพั‚ะธ ะฝะฐ ั‚ะพะทะธ ั‚ะตะปะตั„ะพะฝ; ะธะทะบะปัŽั‡ะฒะฐะฝะตั‚ะพ ะผัƒ ะทะฐะฟะฐะทะฒะฐ ะดะฒะพะนะบะฐั‚ะฐ ะดั€ะฐะนะฒะตั€ะธ PanVK. + ะ›ะพะณะพะฒะตั‚ะต ะฝะฐ Proton, DXVK ะธ ะดั€ะฐะนะฒะตั€ะธั‚ะต ะทะฐ ะฒััะบะฐ ะธะณั€ะฐ ัะฐ ะฒ ะปะพะณะพะฒะตั‚ะต ะฝะฐ ัะตัะธัั‚ะฐ. ะ’ะธะฝะฐะณะธ ะฒะบะปัŽั‡ะตะฝะพ, ะบะพะณะฐั‚ะพ GPU ะฝะต ะต Adreno. ะŸะพัะปะตะดะฝะธ ะดะฝะตะฒะฝะธั†ะธ ะฝะฐ ัะตัะธัั‚ะฐ ะ—ะฐะฟะฐะทะตะฝะธ ะดะฝะตะฒะฝะธั†ะธ ะฝะฐ ัะตัะธัั‚ะฐ ะ—ะฐะฟะฐะทะฒะฐ ะฝะฐะน-ะฝะพะฒะธั‚ะต %1$d ะ˜ะทั‡ะธัั‚ะฒะฐะฝะต ะฝะฐ ะดะฝะตะฒะฝะธั†ะธั‚ะต + ะะฐะปะธั‡ะฝะธ ะปะพะณะพะฒะต ะพั‚ ัะตัะธะธั‚ะต + ะžั‰ะต ะฝัะผะฐ ะทะฐะฟะฐะทะตะฝะธ ะปะพะณะพะฒะต ะพั‚ ัะตัะธะธ. + ะกะฟะพะดะตะปะตะฝะธั‚ะต ะธ ะทะฐะฟะฐะทะตะฝะธั‚ะต ZIP ะฐั€ั…ะธะฒะธ ะฒะบะปัŽั‡ะฒะฐั‚ ะธะทะฑั€ะฐะฝะฐั‚ะฐ ัะตัะธั ะทะฐะตะดะฝะพ ััŠั ัะฒัŠั€ะทะฐะฝะธั‚ะต ะดะธะฐะณะฝะพัั‚ะธั‡ะฝะธ ะดะฐะฝะฝะธ ะพั‚ Steam, ะผะฐะณะฐะทะธะฝะฐ, ะธะฝัั‚ั€ัƒะผะตะฝั‚ะธั‚ะต ะธ Battle.net. + %1$s ยท %2$s + ะขะตะบัƒั‰ะฐ ัะตัะธั + ะกะฟะพะดะตะปะธ + ะ—ะฐะฟะฐะทะธ ะฝะฐ ัƒัั‚ั€ะพะนัั‚ะฒะพั‚ะพ + ะ˜ะทั‚ั€ะธะน + ะ”ะฐ ัะต ะธะทั‚ั€ะธัั‚ ะปะธ ะปะพะณะพะฒะตั‚ะต ะพั‚ ัะตัะธัั‚ะฐ? + ะ”ะฐ ัะต ะธะทั‚ั€ะธะต ะปะธ %1$s? ะขะพะฒะฐ ะฝะต ะผะพะถะต ะดะฐ ัะต ะพั‚ะผะตะฝะธ. + ะ›ะพะณะพะฒะตั‚ะต ะพั‚ ัะตัะธัั‚ะฐ ัะฐ ะทะฐะฟะฐะทะตะฝะธ. + ะ›ะพะณะพะฒะตั‚ะต ะพั‚ ัะตัะธัั‚ะฐ ะฝะต ะผะพะถะฐั…ะฐ ะดะฐ ะฑัŠะดะฐั‚ ะทะฐะฟะฐะทะตะฝะธ. + ะ›ะพะณะพะฒะตั‚ะต ะพั‚ ัะตัะธัั‚ะฐ ะฝะต ะผะพะถะฐั…ะฐ ะดะฐ ะฑัŠะดะฐั‚ ะธะทั‚ั€ะธั‚ะธ. ะัƒะปะธั€ะฐะฝะต ะฝะฐ ะฒัะธั‡ะบะธ ะฝะฐัั‚ั€ะพะนะบะธ ะ’ั€ัŠั‰ะฐ ะฒััะบะฐ ะฝะฐัั‚ั€ะพะนะบะฐ ะบัŠะผ ัั‚ะพะนะฝะพัั‚ั‚ะฐ ะฟะพ ะฟะพะดั€ะฐะทะฑะธั€ะฐะฝะต ะัƒะปะธั€ะฐะฝะต @@ -873,6 +926,8 @@ ะ˜ะทะฟะพะปะทะฒะฐะฝะต ะบะฐั‚ะพ ะฝะฐั‡ะฐะปะตะฝ ะตะบั€ะฐะฝ DroidDeck ะผะพะถะต ะดะฐ ะฑัŠะดะต ะฟั€ะธะปะพะถะตะฝะธะตั‚ะพ ะทะฐ ะฝะฐั‡ะฐะปะตะฝ ะตะบั€ะฐะฝ DroidDeck ะฝะธะบะพะณะฐ ะฝะต ัะต ะฟั€ะตะดะปะฐะณะฐ ะบะฐั‚ะพ ะฟั€ะธะปะพะถะตะฝะธะต ะทะฐ ะฝะฐั‡ะฐะปะตะฝ ะตะบั€ะฐะฝ + ะ‘ัƒั‚ะพะฝัŠั‚ โ€žะะฐั‡ะฐะปะพโ€œ ะพั‚ะฒะฐั€ั + ะกั‚ั€ะฐะฝะธั†ะฐั‚ะฐ, ะบะพัั‚ะพ ัะต ะฟะพะบะฐะทะฒะฐ, ะบะพะณะฐั‚ะพ DroidDeck ะต ะฟั€ะธะปะพะถะตะฝะธะตั‚ะพ ะทะฐ โ€žะะฐั‡ะฐะปะพโ€œ ะธ ะฝะฐั‚ะธัะฝะตัˆ โ€žะะฐั‡ะฐะปะพโ€œ ะ’ โ€žะ”ะพะฑะฐะฒัะฝะต ะฝะฐ ะธะณั€ะธโ€œ ะทะฐะดะฐะนั‚ะต DroidDeck ะฝะฐ โ€žะ’ะบะปัŽั‡ะฒะฐะฝะตโ€œ ะžั€ะธะตะฝั‚ะฐั†ะธั ะžั€ะธะตะฝั‚ะฐั†ะธั ะฝะฐ ัั‚ะฐั€ั‚ะตั€ะฐ @@ -886,15 +941,22 @@ ะฆัะป ะตะบั€ะฐะฝ ะกะบั€ะธะฒะฐ ะปะตะฝั‚ะธั‚ะต ะทะฐ ััŠัั‚ะพัะฝะธะต ะธ ะฝะฐะฒะธะณะฐั†ะธั ะฝะฐ Android ะŸะพะบะฐะทะฒะฐ ะปะตะฝั‚ะธั‚ะต ะทะฐ ััŠัั‚ะพัะฝะธะต ะธ ะฝะฐะฒะธะณะฐั†ะธั ะฝะฐ Android + ะ›ะฐัƒะฝั‡ะตั€ ั ะดะฒะฐ ะตะบั€ะฐะฝะฐ + ะะฒั‚ะพะผะฐั‚ะธั‡ะฝะพ: ัะตะบั†ะธะธั‚ะต ะฝะฐ ะปะฐัƒะฝั‡ะตั€ะฐ (Steam, ะ‘ะธะฑะปะธะพั‚ะตะบะฐ, ะœะฐะณะฐะทะธะฝะธ ะธ ะพัั‚ะฐะฝะฐะปะธั‚ะต) ัะต ะฟะพะบะฐะทะฒะฐั‚ ะฝะฐ ะฒั‚ะพั€ะธั ะตะบั€ะฐะฝ ะฟั€ะธ ะฟั€ะตะฝะพัะธะผะธ ัƒัั‚ั€ะพะนัั‚ะฒะฐ ั ะฒะณั€ะฐะดะตะฝ ั‚ะฐะบัŠะฒ. ะ’ะบะปัŽั‡ะตะฝะพ: ะธะทะฟะพะปะทะฒะฐ ัะต ะฒัะตะบะธ ะฒั‚ะพั€ะธ ะดะธัะฟะปะตะน. ะ˜ะทะบะปัŽั‡ะตะฝะพ: ะปะฐัƒะฝั‡ะตั€ัŠั‚ ะพัั‚ะฐะฒะฐ ะฝะฐ ะตะดะธะฝ ะตะบั€ะฐะฝ. + ะกะตัะธะธ ั ะดะฒะฐ ะตะบั€ะฐะฝะฐ + ะะฒั‚ะพะผะฐั‚ะธั‡ะฝะพ: ะผะตะฝัŽั‚ะพ ะฒ ะธะณั€ะฐั‚ะฐ ัะต ะฟะพะบะฐะทะฒะฐ ะทะฐะบั€ะตะฟะตะฝะพ ะฝะฐ ะฒะณั€ะฐะดะตะฝะธั ะฒั‚ะพั€ะธ ะตะบั€ะฐะฝ, ะฐ ะฝะต ะบะฐั‚ะพ ะธะทัะบะฐั‡ะฐั‰ ะฟั€ะพะทะพั€ะตั†. ะ’ะบะปัŽั‡ะตะฝะพ: ะธะทะฟะพะปะทะฒะฐ ัะต ะฒัะตะบะธ ะฒั‚ะพั€ะธ ะดะธัะฟะปะตะน. ะ˜ะทะบะปัŽั‡ะตะฝะพ: ะผะตะฝัŽั‚ะพ ะพัั‚ะฐะฒะฐ ะฝะฐ ะตะบั€ะฐะฝะฐ ั ะธะณั€ะฐั‚ะฐ; ะพั‚ ะฝะตะณะพ ะฒัะต ะพั‰ะต ะผะพะถะตั‚ะต ะดะฐ ะธะทะฑะตั€ะตั‚ะต ะฒั‚ะพั€ะธ ะตะบั€ะฐะฝ. ะะฒั‚ะพะผะฐั‚ะธั‡ะฝะพ ะ’ะบะป. ะ˜ะทะบะป. ะšะพะฝั‚ั€ะพะปะธ ะฝะฐ ะดะพะปะฝะธั ะตะบั€ะฐะฝ ะฒ ะธะณั€ะธั‚ะต + Android ะบะปะฐะฒะธะฐั‚ัƒั€ะฐ ะทะฐ ั‚ะตะบัั‚ะพะฒะธ ะฟะพะปะตั‚ะฐ ะžั‚ะฒะฐั€ั ั‚ั€ะฐะบะฟะฐะดะฐ ะธ ะบะปะฐะฒะธะฐั‚ัƒั€ะฐั‚ะฐ ะฝะฐ ะฒั‚ะพั€ะธั ะตะบั€ะฐะฝ ะฟั€ะธ ัั‚ะฐั€ั‚ะธั€ะฐะฝะต ะฝะฐ ัะตัะธั. ะ’ัŠะฒะตะถะดะฐะฝะต ะทะฐ ะณะพั€ะฝะธั ะตะบั€ะฐะฝ ะ“ะพั‚ะพะฒะพ ะŸั€ะธะปะพะถะตะฝะธะต ะทะฐ ะฝะฐั‡ะฐะปะตะฝ ะตะบั€ะฐะฝ ะฟะพ ะฟะพะดั€ะฐะทะฑะธั€ะฐะฝะต ะ˜ะทะฑะตั€ะตั‚ะต ะฟั€ะธะปะพะถะตะฝะธะต ะทะฐ ะฝะฐั‡ะฐะปะตะฝ ะตะบั€ะฐะฝ + ะกะบั€ะธะน ะปะฐัƒะฝั‡ะตั€ะฐ ะพั‚ โ€žะŸะพัะปะตะดะฝะธ ะฟั€ะธะปะพะถะตะฝะธัโ€œ, ะดะพะบะฐั‚ะพ ะต ะฝะตะฐะบั‚ะธะฒะตะฝ + ะ’ะฐะถะธ ัะฐะผะพ ะบะพะณะฐั‚ะพ DroidDeck ะต ะฟั€ะธะปะพะถะตะฝะธะตั‚ะพ ะฟะพ ะฟะพะดั€ะฐะทะฑะธั€ะฐะฝะต ะทะฐ โ€žะะฐั‡ะฐะปะพโ€œ ะธ ะฝัะผะฐ ะฐะบั‚ะธะฒะฝะฐ ัะตัะธั. ะ˜ะทะฑะพั€ ะŸั€ะธะปะพะถะตะฝะธั ะทะฐ Linux (ะฑะตั‚ะฐ) ะคะฐะนะปะพะฒะต @@ -1006,9 +1068,172 @@ Preview ะะฐะน-ะฝะพะฒะธั‚ะต ะฟะพะฟั€ะฐะฒะบะธ, ะฟั€ะตะดะธ Stable ะะบั‚ัƒะฐะปะฝะพ + ะšะพะฟะธั€ะฐะฝะต ะฝะฐ ะดะฐะฝะฝะธั‚ะต ะทะฐ ะฒะตั€ัะธัั‚ะฐ + ะ”ะฐะฝะฝะธั‚ะต ะทะฐ ะฒะตั€ัะธัั‚ะฐ ัะฐ ะบะพะฟะธั€ะฐะฝะธ + ะŸั€ะตะด Preview + ะ˜ะทะฟั€ะตะฒะฐั€ะฒะฐั‚ะต Preview + ะขะฐะทะธ ะฒะตั€ัะธั ะต ะฟะพ-ะฝะพะฒะฐ ะพั‚ ะฟะพัะปะตะดะฝะฐั‚ะฐ Preview. ะกะปะตะดะฒะฐั‰ะฐั‚ะฐ Preview ะฒะตั€ัะธั ั‰ะต ั ะพะฑะฝะพะฒะธ. + ะ˜ะทะฑะตั€ะตั‚ะต ะฒะตั€ัะธั, ะทะฐ ะดะฐ ะฒะธะดะธั‚ะต ะฟั€ะพะผะตะฝะธั‚ะต ะธะปะธ ะดะฐ ั ะธะฝัั‚ะฐะปะธั€ะฐั‚ะต. + ะ˜ะฝัั‚ะฐะปะธั€ะฐะฝะฐ + ะ˜ะฝัั‚ะฐะปะธั€ะฐะฝะต ะฝะฐ ั‚ะฐะทะธ ะฒะตั€ัะธั%1$s + ะ’ั€ัŠั‰ะฐะฝะต ะบัŠะผ ั‚ะฐะทะธ ะฒะตั€ัะธั%1$s + versionCode %1$d + ะšัŠะผะธั‚ %1$s + ะกั‚ั€ะฐะฝะธั†ะฐ ะฝะฐ ะฒะตั€ัะธัั‚ะฐ + PR ะธะผะฐ ะฟะพ-ะฝะพะฒ ะบัŠะผะธั‚ (%1$s). ะขะตัั‚ะพะฒะฐั‚ะฐ ะผัƒ ะฒะตั€ัะธั ะพั‰ะต ะฝะต ะต ะณะพั‚ะพะฒะฐ, ะทะฐั‚ะพะฒะฐ ั‚ะฐะทะธ ะฝะต ะณะพ ะฒะบะปัŽั‡ะฒะฐ. + ะ˜ะผะฐ ะฟะพ-ะฝะพะฒ ะบัŠะผะธั‚, ะฒะตั€ัะธัั‚ะฐ ะฟั€ะตะดัั‚ะพะธ + ะะพะผะตั€ ะฝะฐ PR, ะทะฐะณะปะฐะฒะธะต ะธะปะธ ะฐะฒั‚ะพั€ + ะัะผะฐ ััŠะฒะฟะฐะดะฐั‰ะธ ั‚ะตัั‚ะพะฒะธ ะฒะตั€ัะธะธ + ะัƒะถะฝะพ ะต ะฝะพะฒะพ ะธะทะณั€ะฐะถะดะฐะฝะต (versionCode %1$d) + ะžะฑะฝะพะฒะปะตะฝะธั ะฝะฐ ั‚ะตัั‚ะพะฒะธ ะฒะตั€ัะธะธ + ะะพะฒะฐ ั‚ะตัั‚ะพะฒะฐ ะฒะตั€ัะธั ะฝะฐ PR #%1$d + %1$s. ะžั‚ะฒะพั€ะตั‚ะต ะžะฑะฝะพะฒะปะตะฝะธั, ะทะฐ ะดะฐ ั ะธะฝัั‚ะฐะปะธั€ะฐั‚ะต. + ะžั‰ะต (%1$d) + ะัƒะถะฝะพ ะต ะฝะพะฒะพ ะธะทะณั€ะฐะถะดะฐะฝะต ะทะฐ versionCode %2$d (%1$d) + Preview ะฒะตั€ัะธะธ ะฒ main ัะปะตะด ั‚ะฐะทะธ ั‚ะตัั‚ะพะฒะฐ ะฒะตั€ัะธั: %1$d ะขะตัั‚ะพะฒะธ ะฒะตั€ัะธะธ ะ˜ะทะฟั€ะพะฑะฒะฐะนั‚ะต ะฟะพะฟั€ะฐะฒะบะฐ, ะฟั€ะตะดะธ ะดะฐ ะฑัŠะดะต ะธะทะดะฐะดะตะฝะฐ ะัะผะฐ ะฒ ะผะพะผะตะฝั‚ะฐ + ะ›ะฐะฑะพั€ะฐั‚ะพั€ะฝะฐ ะบะพะผะฟะธะปะฐั†ะธั + ะ›ะฐะฑะพั€ะฐั‚ะพั€ะฝะธ ะบะพะผะฟะธะปะฐั†ะธะธ + ะ’ ัƒะฟะพั‚ั€ะตะฑะฐ + ะะฐ ะฟะฐัƒะทะฐ, ัะปะตะด ะบะฐั‚ะพ Android ะฟะพะฒั‚ะพั€ะฝะพ ะพะฟั‚ะธะผะธะทะธั€ะฐ DroidDeck + ะะต ะต ะทะฐั€ะตะดะตะฝะฐ: %1$s + ะ’ ะพั‡ะฐะบะฒะฐะฝะต ะฝะฐ ั€ะตัั‚ะฐั€ั‚ + ะ—ะฐะฟะฐะทะตะฝะฐ + ะ—ะฐ ะดั€ัƒะณะฐ ะฒะตั€ัะธั + ะŸั€ะตะธะทะณั€ะฐะดะธ + ะ˜ะทั‚ั€ะธะฒะฐ ั‚ะฐะทะธ ะบะพะผะฟะธะปะฐั†ะธั ะพั‚ ัƒัั‚ั€ะพะนัั‚ะฒะพั‚ะพ + ะ ะตัั‚ะฐั€ั‚ะธั€ะฐะน ั ะฝะตั + ะ˜ะทะบะปัŽั‡ะธ + ะ˜ะทะฟะพะปะทะฒะฐะน + ะ˜ะทั‚ั€ะธะน + ะ˜ะทั‚ั€ะธะน ัะตะณะฐ + ะะต ะผะพะถะฐ ะดะฐ ัะต ะฟะพะดะณะพั‚ะฒะธ ั€ะตัั‚ะฐั€ั‚ัŠั‚: %1$s. ะกะดะฒะพะตั‚ะต ะฑะตะทะถะธั‡ะฝะพั‚ะพ ะพั‚ัั‚ั€ะฐะฝัะฒะฐะฝะต ะฝะฐ ะณั€ะตัˆะบะธ ะฒ ะะฐัั‚ั€ะพะนะบะธ ะธ ะพะฟะธั‚ะฐะนั‚ะต ะพั‚ะฝะพะฒะพ. + ะ›ะฐะฑะพั€ะฐั‚ะพั€ะฝะฐ ะบะพะผะฟะธะปะฐั†ะธั ะต ะธะฝัั‚ะฐะปะธั€ะฐะฝะฐ + DroidDeck ัะต ั€ะตัั‚ะฐั€ั‚ะธั€ะฐ ั %1$s + ะ›ะฐะฑ ะบะพะผะฟะธะปะฐั†ะธัั‚ะฐ ะต ะฝะฐ ะฟะฐัƒะทะฐ + Android ะพะฟั‚ะธะผะธะทะธั€ะฐ ะพั‚ะฝะพะฒะพ DroidDeck, ะทะฐั‚ะพะฒะฐ %1$s ะฝะต ะต ะทะฐั€ะตะดะตะฝะฐ. ะžั‚ะฒะพั€ะตั‚ะต ะะบั‚ัƒะฐะปะธะทะฐั†ะธะธ, ะทะฐ ะดะฐ ั€ะตัั‚ะฐั€ั‚ะธั€ะฐั‚ะต ั ะฝะตั. + ะ›ะฐะฑ ะบะพะผะฟะธะปะฐั†ะธัั‚ะฐ ะต ะธะทะบะปัŽั‡ะตะฝะฐ + ะกัŠะทะดะฐะดะตะฝะฐ ะต ะทะฐ ะดั€ัƒะณะฐ ะฒะตั€ัะธั ะฝะฐ DroidDeck. ะ—ะฐะฟะฐะทะตะฝะฐ ะต ะฒ ะะบั‚ัƒะฐะปะธะทะฐั†ะธะธ. + DroidDeck ะฝะต ัั‚ะฐั€ั‚ะธั€ะฐ ะดะฒะฐ ะฟัŠั‚ะธ ั ะฝะตั + ะะณะตะฝั‚ + ะะณะตะฝั‚ + ะะณะตะฝั‚ัŠั‚ ั€ะฐะฑะพั‚ะธ + ะ˜ะฝัั‚ะฐะปะธั€ะฐะนั‚ะต Claude Code ะฒ ะฟะพั‚ั€ะตะฑะธั‚ะตะปัะบะพั‚ะพ ะฟั€ะพัั‚ั€ะฐะฝัั‚ะฒะพ ะฝะฐ Linux, ะทะฐ ะดะฐ ะธะทะฟะพะปะทะฒะฐั‚ะต ะฐะณะตะฝั‚ะฐ. + ะŸะพะฟะธั‚ะฐะนั‚ะต ะทะฐ ะธะณั€ะฐ, ัั€ะธะฒ ะธะปะธ ะฟั€ะพะผัะฝะฐ ะฒ DroidDeck + ะ˜ะทะฟั€ะฐั‚ะธ + ะะพะฒ ั€ะฐะทะณะพะฒะพั€ + ะกะฟั€ะธ + ะกัŠั…ั€ะฐะฝะตะฝะธะต + ะŸั€ะตะผะฐั…ะฝะธ + ะŸั€ะตะผะฐั…ะฝะธ ัะตะณะฐ + Claude Code + Codex + ะ˜ะทั…ะพะดะตะฝ ะบะพะด ะฝะฐ DroidDeck + ะšะตัˆะพะฒะต ะทะฐ ะธะทั‚ะตะณะปัะฝะต + ะะตะธะทะฟั€ะฐั‚ะตะฝะธั‚ะต ะฟั€ะพะผะตะฝะธ ัะต ะณัƒะฑัั‚ + ะšะพะผะฟะธะปะฐั†ะธะธั‚ะต ะณะธ ะธะทั‚ะตะณะปัั‚ ะพั‚ะฝะพะฒะพ + ะะฐัั‚ั€ะพะนะบะฐั‚ะฐ ะผะพะถะต ะดะฐ ะณะพ ะธะฝัั‚ะฐะปะธั€ะฐ ะพั‚ะฝะพะฒะพ; ะฒะฟะธัะฒะฐะฝะธัั‚ะฐ ัะต ะทะฐะฟะฐะทะฒะฐั‚ + DroidDeck ั€ะตัั‚ะฐั€ั‚ะธั€ะฐ ั ะฒะฐัˆะฐั‚ะฐ ะปะฐะฑ ะบะพะผะฟะธะปะฐั†ะธั. ะŸั€ะพะดัŠะปะถะตั‚ะต ะพั‚ั‚ะฐะผ, ะบัŠะดะตั‚ะพ ัะฟั€ัั…ั‚ะต. + ะŸะพะฟะธั‚ะฐะนั‚ะต ะณะพ ะทะฐั‰ะพ ะธะณั€ะฐ ะฝะต ัั‚ะฐั€ั‚ะธั€ะฐ, ะฟะพะผะพะปะตั‚ะต ะณะพ ะดะฐ ะพะฑััะฝะธ ะปะพะณ ะธะปะธ ะดะฐ ะฟั€ะพะผะตะฝะธ DroidDeck ะธ ะดะฐ ะธะทะฟั€ะพะฑะฒะฐ ะฟั€ะพะผัะฝะฐั‚ะฐ ะฝะฐ ั‚ะพะฒะฐ ัƒัั‚ั€ะพะนัั‚ะฒะพ. + ะะตัƒัะฟะตัˆะฝะพ: %1$s + %1$s ะฟั€ะธะบะปัŽั‡ะธ (ะธะทั…ะพะด %2$d) + ะกะฟั€ัะฝะพ + ะŸั€ะธะบะปัŽั‡ะธ ะฑะตะท ะพั‚ะณะพะฒะพั€ + ะžะฟะธั‚ะฐะน ะพั‚ะฝะพะฒะพ + ะะฐัั‚ั€ะพะนะฒะฐ ัะต ะฐะณะตะฝั‚ัŠั‚ + ะŸั€ะตะบะพะผะฟะธะปะธั€ะฐะน ะผะพัั‚ะฐ ะปะฐะฑ ะบะพะผะฟะธะปะฐั†ะธั %1$s ะทะฐ ะธะฝัั‚ะฐะปะธั€ะฐะฝะฐั‚ะฐ ะฒะตั€ัะธั ะฝะฐ DroidDeck ะธ ั€ะตัั‚ะฐั€ั‚ะธั€ะฐะน ั ะฝะตั. + %1$s ะฝะฐ ะฒั…ะพะด ยท %2$s ะฝะฐ ะธะทั…ะพะด + ะœะธัะปะธ + ะœะธััŠะป + ะœะธัะปะธ ยท %1$s + %1$s ยท %2$s + ะ’ะฅะžะ” + ะ˜ะ—ะฅะžะ” + ะ˜ะทะฟัŠะปะฝัะฒะฐ ัะตโ€ฆ + ะัะผะฐ ั€ะตะทัƒะปั‚ะฐั‚: ั…ะพะดัŠั‚ ะฟั€ะธะบะปัŽั‡ะธ ะฟัŠั€ะฒะธ + ะัะผะฐ ะธะทั…ะพะด + ะ’ัŠะฒะตะดะตั‚ะต, ะทะฐ ะดะฐ ะฝะฐั€ะตะดะธั‚ะต ัะปะตะดะฒะฐั‰ะพั‚ะพ ััŠะพะฑั‰ะตะฝะธะต + ะ’ ะพะฟะฐัˆะบะฐั‚ะฐ + ะกะปะตะดะฒะฐั‰ะพ: %1$s + ะะต ะธะทะฟั€ะฐั‰ะฐะน + ะŸั€ะธะบะฐั‡ะธ + ะŸั€ะตะผะฐั…ะฝะธ + ะŸะพ ะฟะพะดั€ะฐะทะฑะธั€ะฐะฝะต + ะฃัะธะปะธะต ะทะฐ ั€ะฐะทััŠะถะดะตะฝะธะต + ะะฐะฟั€ะตะด + ะŸั€ะตั€ะฐะฑะพั‚ะธ + ะžั‰ะต ะฝะธั‰ะพ ะฝะต ะต ะฟั€ะพะผะตะฝะตะฝะพ + ะ˜ะทะฟัŠะปะฝะธ ะฟะปะฐะฝะฐ. + ะ˜ะทะฟั€ะฐั‚ะธ ัะตะณะฐ + ะžั‰ะต + ะ—ะฐั‚ะฒะพั€ะธ + ะะฐะน-ะฝะพะฒะพั‚ะพ + ะ ะฐะฑะพั‚ะธ + ะšะพะฝั‚ะตะบัั‚ + %1$s ะพั‚ %2$s + ะขะพะทะธ ั€ะฐะทะณะพะฒะพั€ ยท %1$s + ะ˜ะทะฟะพะปะทะฒะฐะฝะตั‚ะพ ัะต ะฟะพะบะฐะทะฒะฐ ัะปะตะด ะฟัŠั€ะฒะธั ะพั‚ะณะพะฒะพั€ + %1$d-ั‡ะฐัะพะฒ ะปะธะผะธั‚ + %1$d-ะผะธะฝัƒั‚ะตะฝ ะปะธะผะธั‚ + ะกะตะดะผะธั‡ะตะฝ ะปะธะผะธั‚ + %1$d%% ยท ะฝัƒะปะธั€ะฐ ัะต %2$s + + %1$d ั„ะฐะนะป + %1$d ั„ะฐะนะปะฐ + + ะŸะปะฐะฝะธั€ะฐะน ะฟัŠั€ะฒะพ + ะŸะปะฐะฝ + ะŸั€ะตะดะปะฐะณะฐ ะฟะปะฐะฝ, ะฑะตะท ะดะฐ ะฟั€ะพะผะตะฝั ะฝะธั‰ะพ + ะ ะฐะทะณะพะฒะพั€ะธ + ะ’ัะต ะพั‰ะต ะฝัะผะฐ ั€ะฐะทะณะพะฒะพั€ะธ + ะขะพะบัƒ-ั‰ะพ + ะ˜ะทั‚ั€ะธะน + ะ˜ะทั‚ั€ะธะฒะฐ ะณะพ ะทะฐะตะดะฝะพ ั ะฟั€ะธะบะฐั‡ะตะฝะธั‚ะต ั„ะฐะนะปะพะฒะต + ะŸั€ะพั†ะตัะธ + ะ’ ะฟะพั‚ั€ะตะฑะธั‚ะตะปัะบะพั‚ะพ ะฟั€ะพัั‚ั€ะฐะฝัั‚ะฒะพ ะฝะฐ Linux ะฝัะผะฐ ั€ะฐะฑะพั‚ะตั‰ะธ ะฟั€ะพั†ะตัะธ + ะะ“ะ•ะะข + ะกะฟั€ะธ + ะกะฑะพั€ะบะฐ Lab + ะŸะพะดะณะพั‚ะพะฒะบะฐ ะฝะฐ ัะฑะพั€ะบะธ Lab + %1$d%% ยท ะพัั‚ะฐะฒะฐั‚ ะพะบะพะปะพ %2$s + ะพัั‚ะฐะฒะฐั‚ ะพะบะพะปะพ %1$s + ะžั‚ะผะตะฝะธ + ะžั‚ะผะตะฝะธ ัะฑะพั€ะบะฐั‚ะฐ + ะกั‚ะฐั€ั‚ะธั€ะฐะฝะต + %1$d%% + ะžะฟะฐะบะพะฒะฐะฝะต + ะ ะตัั‚ะฐั€ั‚ะธั€ะฐะฝะต ะฝะฐ DroidDeck ะฒัŠั€ั…ัƒ ะฝะตะณะพ + ะ“ะพั‚ะพะฒะพ + ะะตัƒัะฟะตัˆะฝะพ: %1$s + ะะฐัั‚ั€ะพะนะบะฐ ะฝะฐ ะฐะณะตะฝั‚ะฐ + ะŸัŠั€ะฒะพ ะธะฝัั‚ะฐะปะธั€ะฐะนั‚ะต Linux ัั€ะตะดะฐั‚ะฐ ะทะฐ ะธะทะฟัŠะปะฝะตะฝะธะต ะฒ โ€žะะฐัั‚ั€ะพะนะบะธโ€œ. + ะžะฟะธั‚ะฐะน ะพั‚ะฝะพะฒะพ + ะ—ะฐะฟะพั‡ะฝะธ ั€ะฐะทะณะพะฒะพั€ + ะ’ั€ัŠะทะบะฐ ั ัƒัั‚ั€ะพะนัั‚ะฒะพั‚ะพ + ะ‘ะตะทะถะธั‡ะฝะพ ะพั‚ัั‚ั€ะฐะฝัะฒะฐะฝะต ะฝะฐ ะณั€ะตัˆะบะธ, ะทะฐ ะดะฐ ะผะพะถะต ะฐะณะตะฝั‚ัŠั‚ ะดะฐ ะฒะธะถะดะฐ ะธ ัƒะฟั€ะฐะฒะปัะฒะฐ DroidDeck + ะ˜ะฝัั‚ะฐะปะธั€ะฐะฝะต ะฝะฐ %1$s + ะ’ ะฟะพั‚ั€ะตะฑะธั‚ะตะปัะบะพั‚ะพ ะฟั€ะพัั‚ั€ะฐะฝัั‚ะฒะพ ะฝะฐ Linux, ั git, gh ะธ adb + ะ’ั…ะพะด ะฒ %1$s + ะžั‚ะฒะฐั€ั ะฑั€ะฐัƒะทัŠั€ะฐ ะฒะธ + GitHub + ะะตะทะฐะดัŠะปะถะธั‚ะตะปะฝะพ, ะทะฐ ะพั‚ะฒะฐั€ัะฝะต ะฝะฐ pull requests + ะ˜ะฝัั‚ั€ัƒะผะตะฝั‚ะธ ะทะฐ ะบะพะผะฟะธะปะธั€ะฐะฝะต + ะะตะทะฐะดัŠะปะถะธั‚ะตะปะฝะพ, ะทะฐ Lab ะบะพะผะฟะธะปะฐั†ะธะธ ะฝะฐ ั‚ะพะฒะฐ ัƒัั‚ั€ะพะนัั‚ะฒะพ ยท ะพะบะพะปะพ 5 GB + ะะณะตะฝั‚ัŠั‚ ะต ะณะพั‚ะพะฒ + ะ—ะฐะฒัŠั€ัˆะตั‚ะต ะฝะฐัั‚ั€ะพะนะบะฐั‚ะฐ ะฝะฐ ะฐะณะตะฝั‚ะฐ + ะ’ะปะตะทะปะธ ัั‚ะต ะฒ %1$s + Lab ะบะพะผะฟะธะปะฐั†ะธะธ + ะฑัŠั€ะทะธ ะบะพะผะฟะธะปะฐั†ะธะธ + ะ‘ัŠั€ะทะธ Lab ะบะพะผะฟะธะปะฐั†ะธะธ + ะšะพะผะฟะธะปะธั€ะฐ ั‚ะฐะทะธ ะฒะตั€ัะธั ะฟั€ะตะดะฒะฐั€ะธั‚ะตะปะฝะพ, ั‚ะฐะบะฐ ั‡ะต Lab ะบะพะผะฟะธะปะฐั†ะธะธั‚ะต ะดะฐ ะพั‚ะฝะตะผะฐั‚ ะผะธะฝัƒั‚ะธ ยท ะพะบะพะปะพ 20 ะผะธะฝัƒั‚ะธ ะตะดะฝะพะบั€ะฐั‚ะฝะพ + ะšะพะผะฟะธะปะธั€ะฐะฝะต ยท %1$d%% ยท ะพัั‚ะฐะฒะฐั‚ ะพะบะพะปะพ %2$s + ะŸะพะดะณะพั‚ะฒะธ + ะ‘ะตะทะถะธั‡ะฝะพั‚ะพ ะพั‚ัั‚ั€ะฐะฝัะฒะฐะฝะต ะฝะฐ ะณั€ะตัˆะบะธ ะฝะต ะต ะดะพัั‚ัŠะฟะฝะพ; ัะดะฒะพัะฒะฐะฝะตั‚ะพ ะณะพ ะฒะบะปัŽั‡ะฒะฐ + ะกะดะฒะพะน + ะ˜ะฝัั‚ะฐะปะธั€ะฐะน + ะ’ะปะตะท PR #%1$d ะะต ะต ะบะพะผะฟะธะปะธั€ะฐะฝะฐ ะทะฐ ั‚ะพะฒะฐ ะบะพะฟะธะต ะฝะฐ DroidDeck ะะบั‚ัƒะฐะปะธะทะธั€ะฐะฝะพ %1$s @@ -1248,6 +1473,9 @@ ะŸั€ะธะปะพะถะตะฝะธั ะะฐัั‚ั€ะพะนะบะฐ ะะบั‚ัƒะฐะปะธะทะฐั†ะธะธ + ะžั‰ะต + ะ ะตะดะฐะบั‚ะธั€ะฐะน ั€ะฐะทะดะตะปะธ + ะ ะฐะทะดะตะปะธ %1$d%% ะŸั€ะพะดัŠะปะถะฐะฒะฐะฝะต ะฝะฐ %1$s ะŸะพะบะฐะทะฒะฐ ัะต ะบะฐั‚ะพ /root/ROMs ะฒัŠะฒ ะฒััะบะฐ ัะตัะธั. ะ’ัŠั‚ั€ะตัˆะฝะฐั‚ะฐ ะฟะฐะผะตั‚ ะต ะฝะฐ /root/Storage. @@ -1269,6 +1497,15 @@ ะžั‚ะบะฐะท ะฝะฐ ะธะทั‡ะฐะบะฒะฐะฝะตั‚ะพ ะšะปะฐะฒะธะฐั‚ัƒั€ะฐ ะฝะฐ Android ะกะบั€ะธะฒะฐะฝะต โœ• + ะ ะฐะทะผะตั€ ะฝะฐ ะตะบั€ะฐะฝะฐ + ะšะฐะบะฒะฐ ั‡ะฐัั‚ ะพั‚ ะตะบั€ะฐะฝะฐ ะทะฐะตะผะฐ ะบะปะฐะฒะธะฐั‚ัƒั€ะฐั‚ะฐ, ะฒะบะปัŽั‡ะธั‚ะตะปะฝะพ ะทะฐะณะปะฐะฒะบะฐั‚ะฐ. + ะะตะฟั€ะพะทั€ะฐั‡ะฝะพัั‚ + ะะฐะผะฐะปะตั‚ะต ั, ะทะฐ ะดะฐ ะฒะธะถะดะฐั‚ะต ะธะณั€ะฐั‚ะฐ ะทะฐะด ะบะปะฐะฒะธะฐั‚ัƒั€ะฐั‚ะฐ. + ะกะบั€ะธั‚ะธ ะบะปะฐะฒะธัˆะธ + ะ ัะดะบะพ ะธะทะฟะพะปะทะฒะฐะฝะธั‚ะต ะบะปะฐะฒะธัˆะธ ะฝะต ัะต ะฟะพะบะฐะทะฒะฐั‚ ะฝะฐ ะบะปะฐะฒะธะฐั‚ัƒั€ะฐั‚ะฐ. + Esc ะธ ั€ะตะด ั ั„ัƒะฝะบั†ะธะพะฝะฐะปะฝะธ ะบะปะฐะฒะธัˆะธ + Ins / Del / Home / End / PgUp / PgDn + ะšะปะฐะฒะธัˆะธ ััŠั ัั‚ั€ะตะปะบะธ ะŸัƒัะบะฐะฝะต ะฝะฐ %1$s ะ˜ะทะฑะตั€ะธ ะตะบั€ะฐะฝ. ะ’ั‚ะพั€ะธ: %1$s. ะ’ั‚ะพั€ะธัั‚ ะตะบั€ะฐะฝ ะฒะตั‡ะต ะฝะต ะต ะดะพัั‚ัŠะฟะตะฝ. @@ -1770,7 +2007,24 @@ ะขะตั€ะผะธะฝะฐะป ะ—ะฐั…ะฒะฐั‚ะธ + ั‚ั€ะฐะบะฟะฐะดะธ ะฝะฐ Deck ะขะฐะฑะปะพ + ะ ะฐะฑะพั‚ะตะฝ ะฟะปะพั‚ + ะกั‚ะฐั€ั‚ะธั€ะฐะนั‚ะต ั€ะฐะฑะพั‚ะฝะธั ะฟะปะพั‚ + ะ ะฐะฑะพั‚ะตะฝ ะฟะปะพั‚ ยท %1$s + ะขัŠั‡ะฟะฐะด + ะ”ะธั€ะตะบั‚ะฝะพ ะดะพะบะพัะฒะฐะฝะต + ะขัŠั‡ะฟะฐะด. ะ”ะพะบะพัะฝะตั‚ะต ะทะฐ ะดะธั€ะตะบั‚ะฝะพ ะดะพะบะพัะฒะฐะฝะต + ะ”ะธั€ะตะบั‚ะฝะพ ะดะพะบะพัะฒะฐะฝะต. ะ”ะพะบะพัะฝะตั‚ะต ะทะฐ ั‚ัŠั‡ะฟะฐะด + ะกั‚ะฐั€ั‚ะธั€ะฐะฝะต ะฝะฐ ั€ะฐะฑะพั‚ะฝะธั ะฟะปะพั‚ KDEโ€ฆ + ะ ะฐะฑะพั‚ะฝะธัั‚ ะฟะปะพั‚ ัะต ะทะฐั‚ะฒะพั€ะธ. + ะ ะฐะฑะพั‚ะฝะธัั‚ ะฟะปะพั‚ ะฝะต ะผะพะถะฐ ะดะฐ ัะต ัั‚ะฐั€ั‚ะธั€ะฐ. ะ›ะพะณะพะฒะตั‚ะต ะผัƒ ัะฐ ะฒ ะฟะฐะฟะบะฐั‚ะฐ bottom-desktop ะฝะฐ ั‚ะฐะทะธ ัะตัะธั. + ะ ะฐะฑะพั‚ะฝะธัั‚ ะฟะปะพั‚ ะต ะทะฐั‚ะฒะพั€ะตะฝ. ะ’ัะต ะพั‰ะต ะฝัะผะฐ ะฝะธั‰ะพ ะทะฐ ะฟะพะบะฐะทะฒะฐะฝะต. + ะ ะฐะทะผัะฝะฐ ะฝะฐ ะตะบั€ะฐะฝะธั‚ะต + ะ”ะพะปะฝะธัั‚ ะตะบั€ะฐะฝ ะฝะต ะต ัะฒะพะฑะพะดะตะฝ ะฒ ะผะพะผะตะฝั‚ะฐ + ะ•ะบั€ะฐะฝ ะฝะฐ ะธะณั€ะฐั‚ะฐ + ะŸะพะบะฐะถะตั‚ะต ะธะณั€ะฐั‚ะฐ ะฝะฐ + ะ“ะพั€ะตะฝ ะตะบั€ะฐะฝ + ะ”ะพะปะตะฝ ะตะบั€ะฐะฝ ะ˜ะทั‚ะตะณะปัะฝะธั ะัะผะฐ ะฐะบั‚ะธะฒะฝะธ ะธะทั‚ะตะณะปัะฝะธั. Steam @@ -1805,6 +2059,20 @@ ะ“ะพั€ะธะฒะพ, t ะžัะฝะพะฒะฝะพ %1$s t ะ ะตะทะตั€ะฒ %1$s t + ะ’ั€ะตะผะต ะฝะฐ ะบะฐะดัŠั€ะฐ + ะฟะพัะปะตะดะฝะธั‚ะต %1$d s + ัั€. ะบะฐะดัŠั€ + ะฝะฐะน-ะฝะธัะบะธั‚ะต 1% + ะบะฐะดั€ะธ ะฝะฐะด 33 ms + %1$d / min + ะ’ ะธะณั€ะฐ ะพั‚ %1$s + %1$d ัะดั€ะฐ, ะดะพ %2$s GHz + %1$d ัะดั€ะฐ + ะธะณั€ะฐ + FPS ะพั‚ %1$d Hz + ะงะตั€ะฒะตะฝะฐั‚ะฐ ะผะฐั€ะบะธั€ะพะฒะบะฐ ะต ะผััั‚ะพั‚ะพ, ะบัŠะดะตั‚ะพ HUD ะฟะพะบะฐะทะฒะฐ ั‚ะตะผะฟะตั€ะฐั‚ัƒั€ะฐั‚ะฐ ะฒ ั‡ะตั€ะฒะตะฝะพ. + ั†ัะปะพั‚ะพ ัƒัั‚ั€ะพะนัั‚ะฒะพ + ะฑะฐั‚ะตั€ะธั ะ˜ะทะฟั€ะฐั‰ะฐะฝะต ะฝะฐ ะดะฐะฝะฝะธ ะทะฐ ั‚ะฐะฑะปะพั‚ะพ ะะฒั‚ะพะผะฐั‚ะธั‡ะฝะพ ะ’ะบะปัŽั‡ะฒะฐ ะณะพ ะทะฐ ะฒััะบะฐ ะธะณั€ะฐ ะพั‚ ัะฟะธััŠะบะฐ ั‚ัƒะบ, ะฒะบะปัŽั‡ะธั‚ะตะปะฝะพ ะธะณั€ะธ, ะพั‚ะบั€ะธั‚ะธ ะฟะพ-ะบัŠัะฝะพ. ะ˜ะณั€ะธั‚ะต, ะบะพะธั‚ะพ ะธะทะบะปัŽั‡ะธั‚ะต, ะพัั‚ะฐะฒะฐั‚ ะธะทะบะปัŽั‡ะตะฝะธ. @@ -1828,6 +2096,10 @@ ะœะธะบั€ะพั„ะพะฝัŠั‚ ะต ะธะทะบะปัŽั‡ะตะฝ ะทะฐ ั‚ะฐะทะธ ะธะณั€ะฐ. ะ—ะฐ ะดะฐ ะณะพะฒะพั€ะธั‚ะต, ะฒะบะปัŽั‡ะตั‚ะต โ€žะœะธะบั€ะพั„ะพะฝโ€œ ะฒ ะฝะฐัั‚ั€ะพะนะบะธั‚ะต ะฝะฐ Steam ะฒ DroidDeck (ะ—ะฒัƒะบ) ะธ ัั‚ะฐั€ั‚ะธั€ะฐะนั‚ะต ะธะณั€ะฐั‚ะฐ ะพั‚ะฝะพะฒะพ. ะกะธะปะฐ ะฝะฐ ะทะฒัƒะบะฐ %1$d%% ะกั‚ะฐั‚ะธัั‚ะธะบะฐ ะฒ ะธะณั€ะฐั‚ะฐ + HUD ะฝะฐ ะดะพะปะฝะธั ะตะบั€ะฐะฝ + ะ›ะตะฝั‚ะฐ ะฝะฐ ะฒัะตะบะธ ั€ะฐะทะดะตะป + ะฝะฐะน-ะฝะธัะบะธั‚ะต 1% ะธ 0.1% + ะขะตะผะฟะตั€ะฐั‚ัƒั€ะฐ ะฝะฐ CPU FPS CPU GPU @@ -2000,6 +2272,7 @@ ะกั‚ะฐั€ั‚ะธั€ะฐะฝะต ะฝะฐ ัะตัะธัั‚ะฐโ€ฆ %1$d:%2$02d ะธะทะผะธะฝะฐะปะธ ยท ะฒัะต ะพั‰ะต ั€ะฐะฑะพั‚ะธ ะ˜ะทั‚ะตะณะปัะฝะต ะฝะฐ ะฐะบั‚ัƒะฐะปะธะทะฐั†ะธัั‚ะฐ ะฝะฐ ะบะปะธะตะฝั‚ะฐ ะฝะฐ Steam ยท %1$d%% + ะŸั€ะธะปะฐะณะฐะฝะต ะฝะฐ ะฐะบั‚ัƒะฐะปะธะทะฐั†ะธัั‚ะฐ ะฝะฐ ะบะปะธะตะฝั‚ะฐ Steamโ€ฆ ะ˜ะทั‚ะตะณะปัะฝะต ะฝะฐ ะบะปะธะตะฝั‚ะฐ ะฝะฐ Steam ยท %1$s ะ’ะตั‡ะต ั‚ะตั‡ะต ะธะฝัั‚ะฐะปะฐั†ะธั ะฝะฐ ะธะฝัั‚ั€ัƒะผะตะฝั‚ ะทะฐ ััŠะฒะผะตัั‚ะธะผะพัั‚ @@ -2076,11 +2349,29 @@ ะšะพะฝั‚ัƒั€ะธ ะบะฐั‚ะพ ะฒ ะฐะฝะธะผะฐั†ะธั ะฟะปัŽั ะธะทะพัั‚ั€ัะฝะต. ะะต ะต GPU Adreno + ะกะธัั‚ะตะผะตะฝ ะดั€ะฐะนะฒะตั€ PowerVR: ััŠะฒะผะตัั‚ะธะผะพัั‚ั‚ะฐ ะฒะฐั€ะธั€ะฐ ัะฟะพั€ะตะด ัƒัั‚ั€ะพะนัั‚ะฒะพั‚ะพ + ะ•ะบัะฟะตั€ะธะผะตะฝั‚ะฐะปะฝะพ: RADV ะธะปะธ ัะธัั‚ะตะผะฝะธัั‚ ะดั€ะฐะนะฒะตั€ Xclipse + ะกะธัั‚ะตะผะตะฝ PowerVR + ะ˜ะทะฟะพะปะทะฒะฐ ะฒะณั€ะฐะดะตะฝะธั‚ะต ะดั€ะฐะนะฒะตั€ะธ ะทะฐ ั‚ะพะทะธ GPU + ะกะธัั‚ะตะผะฝะธัั‚ ะดั€ะฐะนะฒะตั€ PowerVR ะต ะธะทะฑั€ะฐะฝ ะทะฐ ัั€ะตะดะฐั‚ะฐ ะทะฐ ะธะทะฟัŠะปะฝะตะฝะธะต ะธ ะดะธัะฟะปะตั. + ะะธั‚ะพ ะตะดะธะฝ ะดั€ะฐะนะฒะตั€ ั ะพั‚ะฒะพั€ะตะฝ ะบะพะด ะทะฐัะตะณะฐ ะฝะต ะฟะพะดะดัŠั€ะถะฐ ั‚ะพะทะธ Mali: ะผะพัั‚ัŠั‚ Mali ะต ะฒะบะปัŽั‡ะตะฝ. + ะขะพะฒะฐ ะต ั‚ะตัั‚ะพะฒะฐั‚ะฐ ะฒะตั€ัะธั ะทะฐ ัƒัั‚ั€ะพะนัั‚ะฒะฐ ะฑะตะท Snapdragon: ะพั„ะธั†ะธะฐะปะฝะธั‚ะต ะฒะตั€ัะธะธ ั‚ัƒะบ ั€ะฐะฑะพั‚ัั‚ ัะฐะผะพ ะฝะฐ Adreno, ะทะฐั‚ะพะฒะฐ ะฝะต ัะต ะธะฝัั‚ะฐะปะธั€ะฐั‚ ะฒัŠั€ั…ัƒ ะฝะตั. ะะพะฒะธั‚ะต ั‚ะตัั‚ะพะฒะธ ะฒะตั€ัะธะธ ัะฐ ะฝะฐ github.com/The412Banner/droiddeck-nonadreno-drivers. + ะŸะพัะปะตะดะฝะฐั‚ะฐ ัะตัะธั ะฟั€ะธะบะปัŽั‡ะธ, ะทะฐั‰ะพั‚ะพ Android ะทะฐั‚ะฒะพั€ะธ DroidDeck, ะทะฐ ะดะฐ ะพัะฒะพะฑะพะดะธ ะฟะฐะผะตั‚, ะฐ ะฝะต ะทะฐั€ะฐะดะธ ัั€ะธะฒ. ะ—ะฐั‚ะฒะพั€ะตั‚ะต ะดั€ัƒะณะธ ะฟั€ะธะปะพะถะตะฝะธั ะธะปะธ ะฝะฐะผะฐะปะตั‚ะต ะฝะฐัั‚ั€ะพะนะบะธั‚ะต ะทะฐ ั‚ะตะบัั‚ัƒั€ะธ ะฝะฐ ะธะณั€ะฐั‚ะฐ, ะฟะพัะปะต ะพะฟะธั‚ะฐะนั‚ะต ะพั‚ะฝะพะฒะพ. + Mali (Venus) + ะผะพัั‚ัŠั‚ Mali + ะะธั‚ะพ ะตะดะธะฝ ะดั€ะฐะนะฒะตั€ ั ะพั‚ะฒะพั€ะตะฝ ะบะพะด ะทะฐัะตะณะฐ ะฝะต ะฟะพะดะดัŠั€ะถะฐ ั‚ะพะทะธ Mali: ะธะทะฟะพะปะทะฒะฐ ัะต %1$s ััŠั ัะพะฑัั‚ะฒะตะฝะธั ะดั€ะฐะนะฒะตั€ ะฝะฐ ั‚ะตะปะตั„ะพะฝะฐ. + %1$s ะฒัะต ะพั‰ะต ะฝะต ะต ะฟัƒะฑะปะธะบัƒะฒะฐะฝ: ะดะพั‚ะพะณะฐะฒะฐ ัะต ะธะทะฟะพะปะทะฒะฐ %2$s. + %1$s ะฝะต ะต ะฝะฐะปะธั‡ะตะฝ, ะฐ ะดั€ะฐะนะฒะตั€ัŠั‚ ะฝะฐ ั‚ะพะทะธ ั‚ะตะปะตั„ะพะฝ ะพั‚ั‡ะธั‚ะฐ Vulkan %2$s (Venus ะธะทะธัะบะฒะฐ 1.2): ะธะทะฟะพะปะทะฒะฐ ัะต ะผะพัั‚ัŠั‚ Mali. + %1$s ะฒัะต ะพั‰ะต ะฝะต ะต ะฟัƒะฑะปะธะบัƒะฒะฐะฝ: ะดะพั‚ะพะณะฐะฒะฐ ะผะพัั‚ัŠั‚ Mali ะต ะฒะบะปัŽั‡ะตะฝ. + ะ’ ะพะฟะฐัˆะบะฐ: %1$s (ะธะทั‡ะฐะบะฒะฐ ะดั€ัƒะณ ะดั€ะฐะนะฒะตั€ ะฝะฐ ัั€ะตะดะฐั‚ะฐ ะทะฐ ะธะทะฟัŠะปะฝะตะฝะธะต) + DXVK ัะต ะฟั€ะตะดะพัั‚ะฐะฒั ะพั‚ ัะธัั‚ะตะผะฝะฐั‚ะฐ ัั€ะตะดะฐ ะทะฐ ะธะทะฟัŠะปะฝะตะฝะธะต PowerVR. ะ”ั€ัƒะณะธ DXVK ะฟะฐะบะตั‚ะธ ะผะพะณะฐั‚ ะดะฐ ัะต ััŠั…ั€ะฐะฝัะฒะฐั‚, ะฝะพ ะฝะต ัะต ะฟั€ะธะปะฐะณะฐั‚ ั ั‚ะพะทะธ ะดั€ะฐะนะฒะตั€. ะŸะพะดะดัŠั€ะถะฐะฝ ะ•ะบัะฟะตั€ะธะผะตะฝั‚ะฐะปะตะฝ: ะดั€ะฐะนะฒะตั€ะธั‚ะต ะผัƒ ัะฐ ั‚ะตัั‚ะพะฒะธ ะฒะตั€ัะธะธ ะ•ะบัะฟะตั€ะธะผะตะฝั‚ะฐะปะฝะฐ ะฟะพะดะดั€ัŠะถะบะฐ ะฝะฐ Adreno 850: ะธะทะธัะบะฒะฐ ััŠะฒะผะตัั‚ะธะผะธ ะตะบัะฟะตั€ะธะผะตะฝั‚ะฐะปะฝะธ ะดั€ะฐะนะฒะตั€ะธ ะทะฐ ะดะธัะฟะปะตั ะธ ะธะณั€ะธั‚ะต; ะฝะต ะต ะฟั€ะพะฒะตั€ะตะฝะฐ ะฝะฐ ั‚ะพะฒะฐ ัƒัั‚ั€ะพะนัั‚ะฒะพ ะŸะพะด ั‚ะตัั‚ะฒะฐะฝะธั‚ะต ัƒัั‚ั€ะพะนัั‚ะฒะฐ (Adreno 725 ะธ ะฟะพ-ะฝะพะฒะธ): ะผะพะถะต ะดะฐ ะฝะต ั€ะฐะฑะพั‚ะธ ะะต ัะต ะฟะพะดะดัŠั€ะถะฐ: ะฝัะผะฐ ััŠะฒะผะตัั‚ะธะผ ะณั€ะฐั„ะธั‡ะตะฝ ะฑะตะบะตะฝะด ะทะฐ ั‚ะพะทะธ GPU + ะ ะฐะฑะพั‚ะธ ะฟั€ะตะท ะผะพัั‚ะฐ Mali, ััŠั ัะพะฑัั‚ะฒะตะฝะธั ะดั€ะฐะนะฒะตั€ Vulkan ะฝะฐ ั‚ะตะปะตั„ะพะฝะฐ + ะะต ัะต ะฟะพะดะดัŠั€ะถะฐ, ะบะพะณะฐั‚ะพ ะผะพัั‚ัŠั‚ Mali ะต ะธะทะบะปัŽั‡ะตะฝ: Turnip ะธะทะธัะบะฒะฐ ะณั€ะฐั„ะธั‡ะตะฝ ะฟั€ะพั†ะตัะพั€ Adreno (Snapdragon) ะ”ะพัั‚ะธะณะฝะฐั‚ะพ ะต ะพะณั€ะฐะฝะธั‡ะตะฝะธะตั‚ะพ ะฝะฐ GitHub ะทะฐ ะทะฐัะฒะบะธ - ะพะฟะธั‚ะฐะน ะพั‚ะฝะพะฒะพ ะฟะพ-ะบัŠัะฝะพ GitHub ะพั‚ะณะพะฒะพั€ะธ ั HTTP %1$d @@ -2189,7 +2480,6 @@ ะœะฐะณะฐะทะธะฝะธ Steam ะŸะตั€ัะพะฝะฐะปะธะทะธั€ะฐะฝะฐ - ะœะฐะณะฐะทะธะฝะธ ะกะบะพั€ะพัั‚ ะฝะฐ ะธะทั‚ะตะณะปัะฝะต ะ‘ะฐะปะฐะฝัะธั€ะฐะฝะพ ะ‘ัŠั€ะทะพ @@ -2228,6 +2518,7 @@ ะ˜ะทั‡ะฐะบะฒะฐะฝะต ะฝะฐ ะดั€ัƒะณะพั‚ะพ ะธะทั‚ะตะณะปัะฝะต ะพั‚ Battle.netโ€ฆ ะžั‚ะฒะพั€ะตั‚ะต Battle.net ะธ ะฒะปะตะทั‚ะต ะฒะตะดะฝัŠะถ, ัะปะตะด ั‚ะพะฒะฐ ะธะฝัั‚ะฐะปะธั€ะฐะนั‚ะต ะธะณั€ะธั‚ะต ะผัƒ ะพั‚ั‚ัƒะบ. ะŸั€ะพะณั€ะฐะผะฐั‚ะฐ ะทะฐ ะธะทั‚ะตะณะปัะฝะต ะฝะฐ Blizzard ัะฟั€ั: %1$s + ะŸั€ะพะณั€ะฐะผะฐั‚ะฐ ะทะฐ ะธะทั‚ะตะณะปัะฝะต ะฝะฐ Blizzard ัะฟั€ั ะดะฐ ะฝะฐะฟั€ะตะดะฒะฐ. ะ“ั€ะตัˆะบะฐ ะฝะฐ Blizzard %1$s ะะบั‚ัƒะฐะปะธะทะธั€ะฐะฝะต ะ˜ะณั€ะธ ะฝะฐ Blizzard @@ -2235,6 +2526,7 @@ ะŸั€ะตะบัŠัะฝะฐั‚ะพ ะ˜ะฝัั‚ะฐะปะฐั†ะธั ยท %1$s ะ’ะทะตะผะธ ะฑะตะทะฟะปะฐั‚ะฝะพ + ะ”ะพะฑะฐะฒัะฝะต ะฒ ะฑะธะฑะปะธะพั‚ะตะบะฐั‚ะฐโ€ฆ ะ’ะธะถ ะฒ %1$s ะšัƒะฟะธ ยท %1$s ะ˜ะฝัั‚ะฐะปะธั€ะฐะฝะฐ @@ -2281,6 +2573,12 @@ ะกะพั€ั‚ะธั€ะฐะฝะต ะ•ั‚ะธะบะตั‚ะธ ะฒ ัั‚ั€ะฐะฝะธั‡ะฝะฐั‚ะฐ ะปะตะฝั‚ะฐ ะŸะพะบะฐะทะฒะฐะฝะต ะฝะฐ ะธะผะตะฝะฐ ะฟะพะด ะธะบะพะฝะธั‚ะต ะฒ ัั‚ั€ะฐะฝะธั‡ะฝะฐั‚ะฐ ะปะตะฝั‚ะฐ. ะ˜ะทะบะปัŽั‡ะตั‚ะต ะทะฐ ะฟะพ-ั‚ััะฝะฐ ัั‚ั€ะฐะฝะธั‡ะฝะฐ ะปะตะฝั‚ะฐ. + ะ›ัŽะฑะธะผะตั† ะฝะฐ ะฐะณะตะฝั‚ะฐ + DeeDee ัั‚ะพะธ ะฝะฐะด ะปะฐัƒะฝั‡ะตั€ะฐ ะธ ะธะณั€ะธั‚ะต ะธ ะฟะพะบะฐะทะฒะฐ ะบะฐะบะฒะพ ะฟั€ะฐะฒะธ ะฐะณะตะฝั‚ัŠั‚. + ะะฐะด ะดั€ัƒะณะธ ะฟั€ะธะปะพะถะตะฝะธั + ะŸะพะทะฒะพะปะธ ะฝะฐ DeeDee ะดะฐ ัะต ะฟะพะบะฐะทะฒะฐ ะฝะฐะด ะฒััะบะพ ะฟั€ะธะปะพะถะตะฝะธะต ะธ ะดะฐ ะพั‚ะฒะฐั€ั ั‡ะฐั‚ะฐ ัะธ ั‚ะฐะผ + ะ ะฐะทั€ะตัˆะธ + ะงะฐั‚ ั DeeDee ะ˜ะทะณะปะตะด ะŸะพ-ะณะพะปะตะผะธ ะบะฐั€ั‚ะธ ะŸะพ-ะผะฐะปะบะธ ะบะฐั€ั‚ะธ @@ -2565,7 +2863,14 @@ %1$s ยท ะฝัƒะถะตะฝ ะต ั€ะตัั‚ะฐั€ั‚ ะขะพะฒะฐ ัƒัั‚ั€ะพะนัั‚ะฒะพ ะŸั€ะตะผะฐั…ะฒะฐะฝะต ะฝะฐ %1$s? - ะ”ะธะฐะณะฝะพัั‚ะธะบะฐ + ะ ะฐะทั€ะฐะฑะพั‚ั‡ะธะบ + ะ’ะพะดะตะฝ ะทะฝะฐะบ ั ะตั‚ะธะบะตั‚ ะฝะฐ ะบะพะผะฟะธะปะฐั†ะธัั‚ะฐ + ะŸะพะบะฐะทะฒะฐ ะตั‚ะธะบะตั‚ะฐ ะฝะฐ ั‚ะตัั‚ะพะฒะฐั‚ะฐ ะธะปะธ Lab ะบะพะผะฟะธะปะฐั†ะธั ะฝะฐ ะตะบั€ะฐะฝะฐ. ะ’ะบะปัŽั‡ะตะฝะพ ะฟะพ ะฟะพะดั€ะฐะทะฑะธั€ะฐะฝะต. + ะกะฟะพะดะตะปัะฝะต ะฝะฐ ะดะธะฐะณะฝะพัั‚ะธั‡ะฝะธ ะฟะฐะบะตั‚ะธ + ะกะตัะธั ะธ ัƒัั‚ั€ะพะนัั‚ะฒะพ + ะ“ั€ะฐั„ะธะบะฐ + ะ˜ะณั€ะธ ะธ ััŠะฒะผะตัั‚ะธะผะพัั‚ + ะ’ัะธั‡ะบะธ ะฟะฐะบะตั‚ะธ ะ“ะพั‚ะพะฒะพ ะทะฐ ะธะณั€ะฐ ะžั‰ะต ะฝะต ะต ะณะพั‚ะพะฒะพ ะทะฐ ะธะณั€ะฐ ัั€ะตะดะฐ %1$s @@ -2604,6 +2909,9 @@ ะ’ะบะปัŽั‡ะธ ะฟะพัั‚ะธะถะตะฝะธัั‚ะฐ ะฝะฐ GOG ะฒ ะฝะฐัั‚ั€ะพะนะบะธั‚ะต ะฝะฐ ะผะฐะณะฐะทะธะฝะธั‚ะต ะŸะพัั‚ะธะถะตะฝะธัั‚ะฐ ะฝะต ัะฐ ะดะพัั‚ัŠะฟะฝะธ; ะฟั€ะพะฒะตั€ะตั‚ะต ะปะพะณะพะฒะตั‚ะต ะฝะฐ ัะตัะธัั‚ะฐ ะŸะพัั‚ะธะถะตะฝะธะต ะพั‚ะบะปัŽั‡ะตะฝะพ + Mali (Venus): ะธะทะบะปัŽั‡ะตะฝ + Mali (Venus): ะฒะบะปัŽั‡ะตะฝ + ะ”ั€ะฐะนะฒะตั€ัŠั‚ ะฝะฐ %1$s ะพั‚ั‡ะธั‚ะฐ Vulkan %2$s. Mali (Venus) ะธะทะธัะบะฒะฐ Vulkan 1.2 ะธะปะธ ะฟะพ-ะฝะพะฒะฐ ะฒะตั€ัะธั (gamescope ะฝะต ัั‚ะฐั€ั‚ะธั€ะฐ ะฝะฐ ะฟะพ-ัั‚ะฐั€ะธ ะฒะตั€ัะธะธ), ะทะฐั‚ะพะฒะฐ ัะตัะธะธั‚ะต ะฟั€ะพะฟัƒัะบะฐั‚ Venus ะธ ะฒะผะตัั‚ะพ ั‚ะพะฒะฐ ะธะทะฟะพะปะทะฒะฐั‚ ะดะฒะพะนะบะฐั‚ะฐ ะดั€ะฐะนะฒะตั€ะธ PanVK. ะŸะพัั‚ะฐะฒัะฝะต ะ›ัะฒ ัั‚ะธะบ ะ”ะตัะตะฝ ัั‚ะธะบ @@ -2890,7 +3198,7 @@ ะ˜ะทะฑะพั€ ะฝะฐ ะฟะฐะฟะบะฐโ€ฆ ะ˜ะทะฟะพะปะทะฒะฐะนั‚ะต ะบะพัั‚ะพ ะธ ะดะฐ ะต ะฟะฐะฟะบะฐ ะฝะฐ SD ะบะฐั€ั‚ะฐ ะธะปะธ USB ัƒัั‚ั€ะพะนัั‚ะฒะพ ะ˜ะณั€ะธั‚ะต ะพั‚ะธะฒะฐั‚ ะฒ ะฟะฐะฟะบะฐ Games ะฒ ะธะทะฑั€ะฐะฝะพั‚ะพ ะผััั‚ะพ. ะกัŠั‰ะตัั‚ะฒัƒะฒะฐั‰ะธั‚ะต ะธะณั€ะธ ะฝะต ัะต ะฟั€ะตะผะตัั‚ะฒะฐั‚. - ะšัŠะดะต ะพั‚ะธะฒะฐ + ะšะฐะบะฒะพ ะทะฐะตะผะฐ ะผััั‚ะพ ะ˜ะณั€ะธ ะพั‚ Steam ะ”ะฐะฝะฝะธ ะฝะฐ ะธะณั€ะธั‚ะต ะŸั€ะตั„ะธะบัะธ %1$s ยท workshop %2$s ยท ัˆะตะนะดัŠั€ะธ %3$s @@ -2959,6 +3267,7 @@ ะ˜ะฝัั‚ะฐะปะฐั†ะธะธ ะฝะฐ VC++ ะธ DirectX, ะฝัƒะถะฝะธ ะฝะฐ ะธะณั€ะธั‚ะต ะกั‚ะฐั€ั‚ะธั€ะฐ ะธะณั€ะธ ะทะฐ Linux x86 ะ˜ะฝัั‚ั€ัƒะผะตะฝั‚ ะฝะฐ Steam + Steam ะธะทั‚ะตะณะปั ั‚ะพะฒะฐ ะทะฐ ะธะณั€ะธ, ะบะพะธั‚ะพ ะฒะบะปัŽั‡ะฒะฐั‚ ะฐะฝั‚ะธ-ั‡ะธะนั‚, ะดะพั€ะธ ะบะพะณะฐั‚ะพ ะต ะธะทะบะปัŽั‡ะตะฝ. ะŸั€ะตะผะฐั…ะฒะฐะฝะตั‚ะพ ะผัƒ ัะฟะธั€ะฐ ะธะฝัั‚ะฐะปะฐั†ะธัั‚ะฐ ะธะผ ะฝะฐ 0% DroidDeck ัั‚ะฐั€ั‚ะธั€ะฐ ะธะณั€ะธ ะฑะตะท ั‚ะฐะทะธ ัั€ะตะดะฐ Proton x86, ะบะพะนั‚ะพ DroidDeck ะฝะต ะผะพะถะต ะดะฐ ัั‚ะฐั€ั‚ะธั€ะฐ ะŸะพ ะฟะพะดั€ะฐะทะฑะธั€ะฐะฝะต ะทะฐ ะฒัะธั‡ะบะธ ะธะณั€ะธ @@ -3022,6 +3331,19 @@ ะ—ะฐะฟะฐะทะตะฝะธ ะ˜ะณั€ะธ ะธะทะฒัŠะฝ Steam ะธ ัะฟะพะดะตะปะตะฝ Steam ะฟั€ะตั„ะธะบั ะŸั€ะตั„ะธะบัะธ ะฝะฐ ะธะณั€ะธ, ะดะพะฑะฐะฒะตะฝะธ ะฟั€ะตะท ะผะฐะณะฐะทะธะฝะธ ะธะปะธ ั€ัŠั‡ะฝะพ + ะกะฟะพะดะตะปะตะฝ Steam ะฟั€ะตั„ะธะบั + Steam ะธะทะฟัŠะปะฝัะฒะฐ ั‚ัƒะบ ัะฒะพะธ ะฟะพะผะพั‰ะฝะธ ะฟั€ะพะณั€ะฐะผะธ ะทะฐ Windows + ะ˜ะทั‚ั€ะธะฒะฐ ะณะพ (%1$s). Steam ััŠะทะดะฐะฒะฐ ะฝะพะฒ ัะปะตะดะฒะฐั‰ะธั ะฟัŠั‚, ะบะพะณะฐั‚ะพ ะผัƒ ะฟะพั‚ั€ัะฑะฒะฐ. + ะŸั€ะธะปะพะถะตะฝะธะต ะผะฐะณะฐะทะธะฝ ะธ ะธะณั€ะธั‚ะต, ะบะพะธั‚ะพ ั€ะฐะฑะพั‚ัั‚ ั ะฝะตะณะพ + ะ˜ะทะฟะพะปะทะฒะฐ ัะต ะพั‚ %1$s + ะ˜ะณั€ะฐ ะธะทะฒัŠะฝ Steam %1$s + ะะต ะต ัะฒัŠั€ะทะฐะฝ ั ะธะณั€ะฐ, ะทะฐั‚ะพะฒะฐ ัะต ะทะฐะฟะฐะทะฒะฐ + ะŸั€ะตะผะฐั…ะฝะธ ะธะทะฑั€ะฐะฝะธั‚ะต ยท %1$s + ะ”ะตะธะฝัั‚ะฐะปะธั€ะฐะน ะธะทะฑั€ะฐะฝะธั‚ะต ยท %1$s + ะŸั€ะตั„ะธะบัะธ ะฝะฐ Wine + ะ—ะฐะฟะธัะธั‚ะต ะธ ะฝะฐัั‚ั€ะพะนะบะธั‚ะต ะฒ ั‚ัั… ัะต ะณัƒะฑัั‚; ะทะฐะฟะธัะธั‚ะต ะฒ Steam Cloud ะพัั‚ะฐะฒะฐั‚ ะฒ ะฐะบะฐัƒะฝั‚ะฐ ะฒะธ. + ะšะตัˆะพะฒะต ะฝะฐ ัˆะตะนะดัŠั€ะธั‚ะต + ะŸั€ะตั„ะธะบั %1$s ยท ัˆะตะนะดัŠั€ะธ %2$s ะ˜ะทั‚ะตะณะปะตะฝะธ ะฟะฐะบะตั‚ะธ ะ—ะฐะฟะฐะทะตะฝะธ ะพั€ะธะณะธะฝะฐะปะธ ะัะผะฐ ะธะทั‚ะตะณะปะตะฝะธ ะฟะฐะบะตั‚ะธ ั ะบะพะผะฟะพะฝะตะฝั‚ะธ. @@ -3056,6 +3378,8 @@ DroidDeck ยท %1$d ะบะฐะดัŠั€ะฐ/ั 60 ะบะฐะดัŠั€ะฐ/ั ะธะทะณะปะตะถะดะฐ ะฟะพ-ะณะปะฐะดะบะพ, ะฝะพ ะฝะฐั‚ะพะฒะฐั€ะฒะฐ ะฟะพะฒะตั‡ะต ะฟั€ะพั†ะตัะพั€ะฐ, ะดะพะบะฐั‚ะพ Steam ัะต ัั‚ะฐั€ั‚ะธั€ะฐ. ะ’ะธะดะตะพ, ะธะทะฑั€ะฐะฝะพ ะฒ ะฝะฐัั‚ั€ะพะนะบะธั‚ะต ะฝะฐ Steam, ััŠั‰ะพ ัะต ะฟะพะบะฐะทะฒะฐ ั‚ัƒะบ. ะ—ะฒัƒะบ + ะŸั€ะพะฟัƒัะฝะธ ัั‚ะฐั€ั‚ะพะฒะพั‚ะพ ะฒะธะดะตะพ + ะ˜ะทะฟะพะปะทะฒะฐะน 0,1-ัะตะบัƒะฝะดะตะฝ ั‡ะตั€ะตะฝ ะบะปะธะฟ ะบะฐั‚ะพ ัั‚ะฐั€ั‚ะพะฒะพั‚ะพ ะฒะธะดะตะพ ะฝะฐ Steam. ะ’ะปะธะทะฐ ะฒ ัะธะปะฐ ะฟั€ะธ ัะปะตะดะฒะฐั‰ะฐั‚ะฐ ัะตัะธั. ะกะพะฑัั‚ะฒะตะฝะพ ะฒะธะดะตะพ MP4, MOV, MKV ะธะปะธ WebM. ะ”ั€ัƒะณะธ ั„ะพั€ะผะฐั‚ะธ ะธ ั„ะฐะนะปะพะฒะต ะฝะฐะด %1$d MB ัะต ะบะพะฝะฒะตั€ั‚ะธั€ะฐั‚ ะฝะฐ ัƒัั‚ั€ะพะนัั‚ะฒะพั‚ะพ ะดะพ WebM 720p, ะดะพ %2$d ัะตะบัƒะฝะดะธ. ะ˜ะผะฟะพั€ั‚ะธั€ะฐะฝะต @@ -3517,6 +3841,7 @@ ะ—ะฐะดัŠั€ะถะฐ Alt+Tab, ะบะปะฐะฒะธัˆะฐ Win ะธ ะฑัƒั‚ะพะฝะฐ ะะฐั‡ะฐะปะพ ะฒ ะฐะบั‚ะธะฒะฝะฐั‚ะฐ ัะตัะธั ะฝะฐ DroidDeck ะฒะผะตัั‚ะพ ะฒ Android. ะ’ะบะปัŽั‡ะตั‚ะต โ€žะฏั€ะบะพัั‚โ€œ ะฒ ะะฐัั‚ั€ะพะนะบะฐ โ†’ ะ˜ะฝั‚ะตะณั€ะฐั†ะธั ััŠั Steam Mali ะผะพัั‚: ะธะทะบะป. + %1$s ะฝะต ะผะพะถะต ะดะฐ ะธะทะฟะพะปะทะฒะฐ ะผะพัั‚ะฐ Mali (ะฝัƒะถะตะฝ ะต ะณั€ะฐั„ะธั‡ะตะฝ ะฟั€ะพั†ะตัะพั€ Mali ะฑะตะท ะผะฐั€ัˆั€ัƒั‚ ะฟั€ะตะท ัะธัั‚ะตะผะตะฝ ะดั€ะฐะนะฒะตั€), ะทะฐั‚ะพะฒะฐ ั‚ะพะทะธ ะฟั€ะตะฒะบะปัŽั‡ะฒะฐั‚ะตะป ะฝัะผะฐ ะตั„ะตะบั‚ ั‚ัƒะบ. Mali ะผะพัั‚: ะฒะบะป. %1$s ะฝะต ะต Adreno. ะ•ะบัะฟะตั€ะธะผะตะฝั‚ะฐะปะฝะธัั‚ Vulkan ะผะพัั‚ ะต ะฒะบะปัŽั‡ะตะฝ: ัะตัะธัั‚ะฐ ั€ะธััƒะฒะฐ ะฟั€ะตะท ัะพะฑัั‚ะฒะตะฝะธั ะดั€ะฐะนะฒะตั€ ะฝะฐ ั‚ะตะปะตั„ะพะฝะฐ. ะžั‡ะฐะบะฒะฐะนั‚ะต ะณั€ะตัˆะบะธ; ะธะทะฟั€ะฐั‚ะตั‚ะต ะปะพะณะพะฒะตั‚ะต ะฝะฐ ัะตัะธัั‚ะฐ. ะ‘ะตะทะพะฟะฐัะตะฝ ั€ะตะถะธะผ @@ -3542,6 +3867,25 @@ ะŸั€ะตะผะตัั‚ะฒะฐะฝะต ะฟะพ-ะบัŠัะฝะพ ะะฐัั‚ั€ะพะนะบะธ ะฝะฐ ะฟั€ะธัะฟะพัะพะฑะปะตะฝะธะตั‚ะพ ะŸั€ะตะผะฐั…ะฒะฐะฝะต ะฝะฐ ะฟั€ะธัะฟะพัะพะฑะปะตะฝะธะตั‚ะพ + ะ’ัŠะฝัˆะตะฝ ะฒะธะด + ะŸะฐะบะตั‚ ั ะธะบะพะฝะธ + ะŸะพ ะฟะพะดั€ะฐะทะฑะธั€ะฐะฝะต ะพั‚ ัะธัั‚ะตะผะฐั‚ะฐ + ะคะพะฝ ะฒ ั†ะฒะตั‚ะฐ ะฝะฐ ะฟั€ะธะปะพะถะตะฝะธะตั‚ะพ + ะ ะฐะทะผะตั€ ะฝะฐ ะธะบะพะฝะธั‚ะต + ะœะฐะปัŠะบ + ะกั€ะตะดะตะฝ + ะ“ะพะปัะผ + ะกะบั€ะธะฒะฐะฝะต ะฝะฐ ะธะผะตะฝะฐั‚ะฐ + ะ ะฐะทัั‚ะพัะฝะธะต + ะŸะปัŠั‚ะฝะพ + ะกั€ะตะดะฝะพ + ะจะธั€ะพะบะพ + ะŸั€ะพะผัะฝะฐ ะฝะฐ ะธะบะพะฝะฐั‚ะฐ + ะัƒะปะธั€ะฐะฝะต ะฝะฐ ะธะบะพะฝะฐั‚ะฐ + ะขัŠั€ัะตะฝะต ะฝะฐ ะธะบะพะฝะธ + ะ˜ะบะพะฝะธั‚ะต ัะต ะทะฐั€ะตะถะดะฐั‚โ€ฆ + ะัะผะฐ ะฝะฐะผะตั€ะตะฝะธ ะธะบะพะฝะธ. + ะŸะตั€ัะพะฝะฐะปะธะทะธั€ะฐะฝะธ ะธะบะพะฝะธ ะ”ะพะฑะฐะฒัะฝะต ะฒ ะฟะฐะฟะบะฐ ะะพะฒะฐ ะฟะฐะฟะบะฐ ะŸั€ะตะผะฐั…ะฒะฐะฝะต ะพั‚ ะฟะฐะฟะบะฐั‚ะฐ @@ -3657,5 +4001,81 @@ ะขะพะฒะฐ ั€ะฐะทะฟะพะปะพะถะตะฝะธะต ะฝะต ะผะพะถะฐ ะดะฐ ะฑัŠะดะต ะธะผะฟะพั€ั‚ะธั€ะฐะฝะพ ะะปะตะฝ ัะฝัะณ + ะ‘ะตะปะธ ะฟะพะฒัŠั€ั…ะฝะพัั‚ะธ ั ั‡ะตั€ะฒะตะฝะธ ะฐะบั†ะตะฝั‚ะธ. + ะกะฐัƒะฝะดั‚ั€ะฐั†ะธ + ะœัƒะทะธะบะฐ + ะžะฟั†ะธะธ ะทะฐ ะฒัŠะทะฟั€ะพะธะทะฒะตะถะดะฐะฝะต + ะ›ัŽะฑะธะผะธ + ะšะพะปะตะบั†ะธะธ + ะ’ัะต ะพั‰ะต ะฝัะผะฐ ะบะพะปะตะบั†ะธะธ. ะ”ะพะบะพัะฝะตั‚ะต ะธะบะพะฝะฐั‚ะฐ ะฝะฐ ะพั‚ะผะตั‚ะบะฐ, ะทะฐ ะดะฐ ััŠะทะดะฐะดะตั‚ะต. + ะ—ะฐะฟะฐะทะตะฝะธ + ะกัŠะทะดะฐะฒะฐะฝะต ะฝะฐ ะบะพะปะตะบั†ะธั + ะžั€ะณะฐะฝะธะทะธั€ะฐะนั‚ะต ะทะฐะฟะฐะทะตะฝะพั‚ะพ + ะะพะฒะฐ + ะกัŠะทะดะฐะน + ะ˜ะผะต ะฝะฐ ะบะพะปะตะบั†ะธัั‚ะฐ + ะ’ัŠะฒะตะดะตั‚ะต ะธะผะต, ะบะพะตั‚ะพ ะฝะต ัะต ะธะทะฟะพะปะทะฒะฐ ะพั‚ ะดั€ัƒะณะฐ ะบะพะปะตะบั†ะธั + ะฃะฟั€ะฐะฒะปะตะฝะธะต + ะŸั€ะตะธะผะตะฝัƒะฒะฐะฝะต + ะ”ะพะฑะฐะฒัะฝะต ะฝะฐ ะฟะตัะฝะธ + ะ”ะพะฑะฐะฒะธ (%1$d) + ะŸั€ะตะผะฐั…ะฒะฐะฝะต ะฝะฐ ะฟะตัะฝะธ + ะ˜ะทั‚ั€ะธะฒะฐะฝะต ะฝะฐ ะบะพะปะตะบั†ะธั + ะ”ะฐ ัะต ะธะทั‚ั€ะธะต ะปะธ %1$s? + ะŸะตัะฝะธั‚ะต ะพัั‚ะฐะฒะฐั‚ ะฝะฐ ัƒัั‚ั€ะพะนัั‚ะฒะพั‚ะพ ะฒะธ. ะŸั€ะตะผะฐั…ะฒะฐ ัะต ัะฐะผะพ ะบะพะปะตะบั†ะธัั‚ะฐ. + ะ˜ะทะฑะพั€ + ะ˜ะทะฑะตั€ะธ ะฒัะธั‡ะบะธ + ะžั‚ะผะตะฝะธ ะธะทะฑะพั€ะฐ ะฝะฐ ะฒัะธั‡ะบะธ + ะ˜ะทะฑั€ะฐะฝะธ: %1$d + ะ”ะพะฑะฐะฒะธ ะบัŠะผ ะบะพะปะตะบั†ะธั + ะ”ะพะฑะฐะฒะธ ะฒ ะปัŽะฑะธะผะธ + ะŸั€ะตะผะฐั…ะฝะธ ะพั‚ ะบะพะปะตะบั†ะธัั‚ะฐ + ะขัŠั€ัะตะฝะต ะฝะฐ ะฟะตัะฝะธ + ะšะฐั‚ะพ ะฒ ะฐะปะฑัƒะผะฐ + ะะฐะน-ะดัŠะปะณะธั‚ะต ะฟัŠั€ะฒะพ + ะะฐะน-ะบั€ะฐั‚ะบะธั‚ะต ะฟัŠั€ะฒะพ + ะŸะตัะฝะธ + ะ’ะธัะพั‡ะธะฝะฐ ะฝะฐ ั‚ะพะฝะฐ + ะัƒะปะธั€ะฐะฝะต + ะŸั€ะตัะบะฐั‡ะฐะฝะต ะฝะฐ ั‚ะธัˆะธะฝะฐ + ะขะฐะนะผะตั€ ะทะฐ ะทะฐัะฟะธะฒะฐะฝะต + %1$d ะผะธะฝ + ะšั€ะฐะน ะฝะฐ ะฟะตัะตะฝั‚ะฐ + ะžัั‚ะฐะฒะฐั‚ %1$s + ะ•ะบะฒะฐะปะฐะนะทะตั€ + ะฃัะธะปะฒะฐะฝะต ะฝะฐ ะฑะฐัะธั‚ะต + ะ•ะบะฒะฐะปะฐะนะทะตั€ัŠั‚ ะฝะต ะต ะฝะฐะปะธั‡ะตะฝ ะฝะฐ ั‚ะพะฒะฐ ัƒัั‚ั€ะพะนัั‚ะฒะพ + ะ’ะบะปัŽั‡ะธ ะฒ ะธะณั€ะฐั‚ะฐ + ะกะฐัƒะฝะดั‚ั€ะฐะบัŠั‚ ะดะฐ ะฟั€ะพะดัŠะปะถะธ ะดะฐ ัะฒะธั€ะธ, ะดะพะบะฐั‚ะพ ะฒัŠั€ะฒะธ ะธะณั€ะฐ + ะ’ัะต ะพั‰ะต ะฝัะผะฐ ะธะฝัั‚ะฐะปะธั€ะฐะฝะธ ัะฐัƒะฝะดั‚ั€ะฐั†ะธ. + ะขัŠั€ัะตะฝะต ะฝะฐ ัะฐัƒะฝะดั‚ั€ะฐั†ะธ + ะ”ะพะฑะฐะฒัะฝะต ะฝะฐ ะฟะฐะฟะบะฐ ััŠั ัะฐัƒะฝะดั‚ั€ะฐะบ + ะ’ ั‚ะฐะทะธ ะฟะฐะฟะบะฐ ะฝัะผะฐ ะฐัƒะดะธะพั„ะฐะนะปะพะฒะต + ะžะฑั‰ะฐ ะฟั€ะพะดัŠะปะถะธั‚ะตะปะฝะพัั‚ + %1$d ะฟะตัะฝะธ / %2$s + ะ”ะธัะบ %1$s + ะ ะฐะทะฑัŠั€ะบะฒะฐะฝะต + ะŸั€ะตะดะธัˆะฝะฐ + ะŸัƒัะบะฐะฝะต + ะŸะฐัƒะทะฐ + ะกะปะตะดะฒะฐั‰ะฐ + ะŸะพะฒั‚ะพั€ะตะฝะธะตั‚ะพ ะต ะธะทะบะปัŽั‡ะตะฝะพ + ะŸะพะฒั‚ะฐั€ัะฝะต ะฝะฐ ะฒัะธั‡ะบะธ + ะŸะพะฒั‚ะฐั€ัะฝะต ะฝะฐ ะตะดะฝะฐ + ะกะธะปะฐ ะฝะฐ ะทะฒัƒะบะฐ + ะ’ ั‚ะพะทะธ ัะฐัƒะฝะดั‚ั€ะฐะบ ะฝัะผะฐ ะฐัƒะดะธะพั„ะฐะนะปะพะฒะต + ะกั‚ะฐั€ั‚ะธั€ะฐะฝะตั‚ะพ ะต ะฝะตะดะพัั‚ัŠะฟะฝะพ + ะัะผะฐ ะฝะฐะปะธั‡ะตะฝ ัƒะตะฑ ะฑั€ะฐัƒะทัŠั€ ะทะฐ ะพั‚ะฒะฐั€ัะฝะต ะฝะฐ ั‚ะฐะทะธ ะฒั€ัŠะทะบะฐ. + ะฅะฒะฐะฝะธ + ะŸัƒัะฝะธ + ะ—ะฐะฟะธัˆะธ + ะ—ะฐะดั€ัŠะถ ะทะฐ ะฝัƒะปะธั€ะฐะฝะต + ะœะฐะณะฐะทะธะฝะธ + ะ’ั€ะตะผะต ะฝะฐ ะบะฐะดัŠั€ + ะกั€ะตะดะฝะฐ ั‡ะตัั‚ะพั‚ะฐ ะฝะฐ ะบะฐะดั€ะธั‚ะต + ะกัŠั€ะฒัŠั€ ะทะฐ ะฟะพะบะฐะทะฒะฐะฝะต + ะกัŠัั‚ะพัะฝะธะต ะฝะฐ HDR + ะŸะพะบะฐะทะฐะฝะธ + %1$d ะพั‚ %2$d diff --git a/app/src/main/res/values-cs/input_library.xml b/app/src/main/res/values-cs/input_library.xml new file mode 100644 index 0000000000..10783695ce --- /dev/null +++ b/app/src/main/res/values-cs/input_library.xml @@ -0,0 +1,132 @@ + + + Vybranรฝ displej nenรญ dostupnรฝ. Pล™ipojte jej, abyste mohli toto rozloลพenรญ upravit v plnรฉ velikosti. + Zahodit neuloลพenรฉ zmฤ›ny rozloลพenรญ? + Toto rozloลพenรญ pouลพรญvรก %1$d profilลฏ. Uloลพenรฉ zmฤ›ny platรญ pro vลกechny. + Vรฝchozรญ profily + Reลพim plochy + Reลพim hry + Vรฝchozรญ pro plochu i hru + Vรฝchozรญ pro reลพim hry + Vรฝchozรญ pro reลพim plochy + Nastavenรญ zaล™รญzenรญ + Ovlรกdรกnรญ + Tlaฤรญtka, pรกฤky, spouลกtฤ› a dalลกรญ klรกvesy + Kopรญrovat profil + Obnovit akce + Obnovit akce v %1$s na vรฝchozรญ hodnoty zรกkladnรญho profilu? Rozloลพenรญ a dalลกรญ profily zลฏstanou nezmฤ›nฤ›nรฉ. + Smazat %1$s? Reลพimy, kterรฉ jej pouลพรญvajรญ, se vrรกtรญ k vestavฤ›nรฉmu vรฝchozรญmu profilu. Uloลพenรก rozloลพenรญ a sdรญlenรก nastavenรญ zลฏstanou dostupnรก. + Viditelnost + Platรญ pro vลกechny profily. Auto zobrazรญ ovlรกdรกnรญ hlavnรญ obrazovky, kdyลพ v reลพimu hry nenรญ pล™ipojen ovladaฤ. + Upravit na obrazovce + Uloลพenรก rozloลพenรญโ€ฆ + Vyberte rozloลพenรญ nebo si vytvoล™te vlastnรญ + V menu relace vedlejลกรญ obrazovky vyberte Ovlรกdรกnรญ profilu. Volby Profil a Vedlejลกรญ obrazovka v menu ovladaฤe urฤujรญ, kterรฉ ovlรกdรกnรญ se zobrazรญ. + Akce tlaฤรญtek + Sdรญleno s %1$s. รšpravy se projevรญ i v tฤ›chto profilech. + Znovu pouลพรญt nastavenรญ + Pouลพรญt nastavenรญ zโ€ฆ + Zkopรญrovat z jinรฉho profilu nebo ponechat nastavenรญ sdรญlenรก + Udฤ›lat nezรกvislรฝm + Ponechat aktuรกlnรญ nastavenรญ a pล™estat sdรญlet zmฤ›ny + Rozloลพenรญ uklรกdajรญ prvky a jejich pozice. Kaลพdรฝ profil mลฏลพe pล™iล™adit vlastnรญ akce. Upravujte v plnรฉ velikosti na cรญlovรฉ obrazovce. + Aktuรกlnรญ rozloลพenรญ + Smazat nepouลพรญvanรฉ rozloลพenรญ %1$s a jeho uloลพenรฉ akce? + Pล™ejmenovat aktuรกlnรญ rozloลพenรญ + Neฤitelnรก nastavenรญ vstupu byla uloลพena do zรกloลพnรญ kopie. Mลฏลพete dรกl upravovat obnovenรฉ profily. + Vlastnosti + Vlastnosti kliknutรญ + %1$s ยท Kliknutรญ + Tlaฤรญtka + Pรกฤky, podloลพky a spouลกtฤ› + Skrรฝt nรกstroje + Ovladaฤ + Odesรญlรก vstup ovladaฤe do Steam Input nebo do hry. + Tento prvek neodesรญlรก vstup ovladaฤe, myลกi ani klรกvesnice. + Kliknutรญ myลกรญ + Akce DroidDeck + Akce + Rychlost posunu: %1$d krokลฏ/s + + Novรฝ profil + + Novรฉ rozloลพenรญ + %1$s ยท Pouลพรญvรก %2$d profilลฏ. Zmฤ›ny platรญ pro vลกechny profily s tรญmto pล™iล™azenรญm. + Pล™ejmenovat + Smazat + Neลพ pล™iล™adรญte akce, pล™idejte do rozloลพenรญ prvky. + Nastavenรญ vstupu se nepodaล™ilo uloลพit + Nรกzev + Zaฤรญt od + Tlaฤรญtko + Pรกฤka + Touchpad + Kล™รญลพovรฝ ovladaฤ + Spouลกลฅ + Hotovo + Zpฤ›t + + Pล™idat + Pล™etaลพenรญm pล™esunete. Pล™etaลพenรญm rohu zmฤ›nรญte velikost. Klepnฤ›te na Vlastnosti pro pล™iล™azenรญ akce. + รšprava na vedlejลกรญ obrazovce + Znovu pouลพรญt %1$s z jinรฉho profilu. Ostatnรญ zdroje ovlรกdรกnรญ zลฏstanou nezmฤ›nฤ›nรฉ. + Ponechat fyzickรฉ ovlรกdรกnรญ sdรญlenรฉ + Ve vรฝchozรญm nastavenรญ jsou vลกechna ovlรกdรกnรญ a vlastnรญ rozloลพenรญ nezรกvislรฉ kopie. Sdรญlenรญ propojuje pouze fyzickรฉ ovlรกdรกnรญ. + Pouลพรญt tyto prvky a pozice. Sdรญlenรญ udrลพuje budoucรญ zmฤ›ny geometrie v synchronizaci; akce tlaฤรญtek zลฏstรกvajรญ nezรกvislรฉ. Jinรฉ rozloลพenรญ zaฤรญnรก s nepล™iล™azenรฝmi akcemi. + Zkopรญrovat tato ovlรกdรกnรญ a akce, nebo je propojit, aby se budoucรญ รบpravy projevily v obou profilech. + Ponechat sdรญlenรฉ + Nezรกvislรก kopie + Spustit pรกฤku v mรญstฤ› dotyku + Skrรฝt pรกฤku, kdyลพ se nepouลพรญvรก + Nรกstroje + Automaticky (%1$s) + Vlastnรญ (%1$s) + Uloลพit jako novรฝ profil + Ovlรกdรกnรญ profilu + Profil + Gesta touchpadu myลกi + Pล™i pล™iล™azenรญ k ukazateli myลกi: klepnutรญm kliknete, podrลพenรญm tรกhnete a dvฤ›ma prsty posouvรกte. + %1$s mรก pล™epsรกnรญ rychlรฉ nabรญdky. Vyberte Automaticky, chcete-li pouลพรญt vรฝchozรญ profil a vลกechny tล™i uloลพenรฉ ฤรกsti. + Vstup DroidDeck + Drลพeno, kdyลพ je pรกฤka vychรฝlena jakรฝmkoli smฤ›rem: stisk nad 55 %, uvolnฤ›nรญ pod 35 %. Pomocรญ Smฤ›rovรฝch klรกves pล™iล™aฤte kaลพdรฝ smฤ›r zvlรกลกลฅ. Pล™รญkazy DroidDeck se spustรญ jednou za vychรฝlenรญ. Kliknutรญ pรกฤky se nastavuje zvlรกลกลฅ. + Drลพeno pล™i dotyku touchpadu; uvolnฤ›no pล™i zvednutรญ prstu. Pล™รญkazy DroidDeck se spustรญ jednou za dotyk. Kliknutรญ touchpadu se nastavuje zvlรกลกลฅ. + Drลพeno, kdyลพ spouลกลฅ pล™ekroฤรญ 55 %; uvolnฤ›no pod 35 %. Pล™รญkazy DroidDeck se spustรญ jednou za stisk. + Smฤ›r posunu + Svisle + Vodorovnฤ› + Posouvat vodorovnฤ› + Mฤ›ล™enรญ + Zapnฤ›te zรกznam, pouลพijte ovlรกdรกnรญ v bฤ›ลพรญcรญ relaci, potรฉ se vraลฅte a pล™eฤtฤ›te vรฝsledky. Mฤ›ล™รญ pouze dobu odeslรกnรญ DroidDeck, ne zpoลพdฤ›nรญ displeje. Zรกznam konฤรญ pล™i zavล™enรญ procesu aplikace. + Ovlรกdacรญch prvkลฏ: %1$d + Dalลกรญ uloลพenรก rozloลพenรญ (%1$d) โ–พ + Skrรฝt dalลกรญ uloลพenรก rozloลพenรญ (%1$d) โ–ด + Domลฏ / Guide + Zpฤ›t ยท jedno klepnutรญ + Zpฤ›t ยท dvojitรฉ klepnutรญ + Zpฤ›t ยท dvakrรกt v Steam, jednou na ploลกe + V reลพimu Steam. Podrลพenรญm Zpฤ›t se takรฉ otevล™e rychlรฝ pล™รญstup. + Obnovit vรฝchozรญ + Volba panelu se pamatuje. Plocha otevล™e druhรฝ pracovnรญ prostor; nepล™epรญnรก relaci ani jejรญ vstupnรญ profil. + Virtuรกlnรญ ovladaฤ + Typ ovladaฤe, kterรฝ vidรญ Steam nebo hra. + Dotykovรก obrazovka + Jak se zpracovรกvajรญ dotyky na obrazovce hry. Tlaฤรญtka profilu si zachovรกvajรญ pล™iล™azenรฉ akce. + Kurzor dotyku + Zobrazรญ ukazatel pro pล™รญmรฉ dotyky na obrazovce hry. + Dotknout se a podrลพet + Akce myลกi pล™i podrลพenรญ prstu na obrazovce hry. + Klepnutรญ tlaฤรญtka Zpฤ›t + Prvnรญ akce: jedno klepnutรญ. Druhรก akce: dvojitรฉ klepnutรญ. + Pล™epรญnacรญ tlaฤรญtko + Klepnutรญm podrลพรญte, dalลกรญm klepnutรญm uvolnรญte. Otevล™enรญ nabรญdky nebo pล™epnutรญ profilu tlaฤรญtko uvolnรญ. + Tvar + Zaoblenรฝ + Kapsle + Kruh + Obdรฉlnรญk + Popisek tlaฤรญtka + Text + Importovanรฝ obrรกzek + Samostatnรฉ diagonรกlnรญ klรกvesy + Pล™iล™aฤte klรกvesu kaลพdรฉ diagonรกle. Prรกzdnรก diagonรกla stiskne dvฤ› sousednรญ smฤ›ry. + Sousednรญ smฤ›ry + Vaลกe starรฉ klรกvesy na obrazovce jsou uloลพeny nรญลพe jako importovanรฉ profily. Vyberte jeden k pouลพitรญ nebo รบpravฤ›. Vaลกe aktuรกlnรญ volby profilu byly zachovรกny. + Starรฉ klรกvesy na obrazovce se nepodaล™ilo importovat automaticky. Pลฏvodnรญ nastavenรญ bylo zachovรกno. + diff --git a/app/src/main/res/values-cs/input_strings.xml b/app/src/main/res/values-cs/input_strings.xml new file mode 100644 index 0000000000..6cd32d90b3 --- /dev/null +++ b/app/src/main/res/values-cs/input_strings.xml @@ -0,0 +1,38 @@ + + + Profily vstupu + Profily + Fyzickรฝ ovladaฤ + Hlavnรญ obrazovka + Vedlejลกรญ obrazovka + Nativnรญ / Steam Input + Nativnรญ: %1$s + Odeslat jinรฝ povel ovladaฤe + Zakรกzรกno + Klรกvesa nebo kombinace klรกves + Smฤ›rovรฉ klรกvesy + Pohyb ukazatele + Rychlost ukazatele: %1$d + Posun + Posun svisle + Levรฉ tlaฤรญtko myลกi + Pravรฉ tlaฤรญtko myลกi + Prostล™ednรญ tlaฤรญtko myลกi + Otevล™รญt nabรญdku DroidDeck + Zobrazit klรกvesnici + Otevล™รญt nabรญdku Steam + Otevล™รญt rychlรฝ pล™รญstup Steam + Odebrat prvek + Pล™idat prvek + Tlaฤรญtka specifickรก pro zaล™รญzenรญ + Pล™iล™adit fyzickรฉ tlaฤรญtko + Uvolnฤ›te tlaฤรญtko a zvolte Upravit, Znovu nebo Zruลกit. B nebo Zpฤ›t zruลกรญ po uvolnฤ›nรญ. + Znovu + Stisknฤ›te tlaฤรญtko, vฤetnฤ› tlaฤรญtka Zpฤ›t hlรกลกenรฉho jako klรกvesa. Klรกvesy hlasitosti a systรฉmovรฉ klรกvesy Androidu jsou vyhrazenรฉ. Pล™iล™azenรญ platรญ jen pro toto zaล™รญzenรญ. + Odebrat pล™iล™azenรญ + Diagnostika vstupu + Zaznamenรกvat dobu odeslรกnรญ vstupu + Pล™eฤรญst mฤ›ล™enรญ + Mฤ›ล™รญ cestu od odeslรกnรญ v Androidu po publikaci ve stรกvajรญcรญm vstupnรญm pล™enosu. Nezahrnuje pล™รญchod pล™es Bluetooth, dotazovรกnรญ hosta, vykreslovรกnรญ ani zpoลพdฤ›nรญ displeje. Zรกznam je ve vรฝchozรญm nastavenรญ vypnutรฝ. + Pouลพรญt bฤ›ลพnรฉ pล™iล™azenรญ vstupu + diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 010374a13e..c0d54caa91 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -28,6 +28,8 @@ Pozastavit teฤ Ukonฤit relaci Generovรกnรญ snรญmkลฏ + Nastavenรญ pro tuto hru + Vรฝchozรญ nastavenรญ Vyberte reลพim generovรกnรญ snรญmkลฏ Vypnuto DD-FG %1$dร— @@ -183,6 +185,7 @@ Grafickรฉ prostล™edรญ PowerVR se nepodaล™ilo stรกhnout. Zkontrolujte pล™ipojenรญ a zkuste to znovu. DirectAudio se nepodaล™ilo stรกhnout, takลพe zvuk her v tรฉto relaci pouลพรญvรก pomalejลกรญ cestu. Tento program + Relaci se nepodaล™ilo vykreslit na obrazovku: %1$s. Mรญsto ฤernรฉ obrazovky je zde dลฏvod; podrobnosti jsou v protokolech relace. Klienta Steam se nepodaล™ilo stรกhnout. Vaลกe sรญลฅ nebo VPN moลพnรก blokuje servery Steamu; zkontrolujte pล™ipojenรญ a zkuste to znovu. Klienta Steam se nepodaล™ilo nastavit. Zkontrolujte pล™ipojenรญ a volnรฉ mรญsto a zkuste to znovu. %1$s je sestaven pro PC x86 a bฤ›ลพรญ pล™es FEX, kterรฝ jeลกtฤ› nenรญ nainstalovรกn. Jednou spusลฅte pล™ihlรกลกenรฝ Steam a nechte ho stรกhnout FEX a Steam Linux Runtime, pak to spusลฅte znovu. @@ -387,6 +390,9 @@ Zde jeลกtฤ› nepodporovรกno Naฤรญtรกnรญ komponentโ€ฆ Nepodaล™ilo se nainstalovat: %1$s + Tato staลพenรก data vyลพadujรญ aktualizaci. + Aktualizace je ve frontฤ›. + Opakovat aktualizaci Staลพeno Stahuje se %1$s Instaluje se: %1$s @@ -417,6 +423,22 @@ Pouze internรญ Sloลพka: %1$s Druhรก knihovna + Dalลกรญ knihovny Steam + Sloลพky, do kterรฝch mลฏลพe Steam instalovat hry a odkud je spouลกtรญ, kaลพdรก pod svรฝm nรกzvem. Po odebrรกnรญ zลฏstanou jejรญ hry na disku. + Pล™idat knihovnu + Pล™ejmenovat + Nรกzev knihovny + Vyberte sloลพku pro knihovnu + Nejvรฝลกe %1$d pล™idanรฝch knihoven + Tato sloลพka uลพ je knihovnou nebo leลพรญ uvnitล™ jinรฉ + %1$s ยท nenรญ k dispozici + Platรญ od dalลกรญ relace Steam + Nalezeno na tomto zaล™รญzenรญ ยท %1$s ยท %2$s + Pล™idat + Najรญt knihovny v internรญm รบloลพiลกti + Povolte pล™รญstup ke vลกem souborลฏm, aby DroidDeck vidฤ›l knihovny Steam, kterรฉ jinรฉ aplikace uchovรกvajรญ v internรญm รบloลพiลกti + Povolit + Pล™idรกna %1$s, knihovna Steam uvnitล™ vybranรฉ sloลพky Hry, kterรฉ streamujรญ data z karty SD nebo sdรญlenรฉho รบloลพiลกtฤ›, mohou trhat. Diagnostika รบloลพiลกtฤ› Zaznamenรกvรก vรฝsledky alokace a vzorky ฤasovรกnรญ รบloลพiลกtฤ› do sdรญlenรฝch protokolลฏ. Kdyลพ je zapnuto, mลฏลพe zpomalit instalace. Pouลพije se od pล™รญลกtรญ relace. @@ -482,6 +504,7 @@ Zapnuto Spouลกtรญ se se Steamem Spouลกtรญ se bez Steamu + Rozliลกenรญ hry Nastavenรญ Nastavenรญ %1$s Vรฝchozรญ @@ -569,6 +592,8 @@ Jรกdra pro hru Jรกdra pro hru Jรกdra pro hry. Se vลกemi vybranรฝmi plรกnuje Android volnฤ›. + ล etล™it energii u stabilnรญch her + Spouลกtรญ hru na pomalejลกรญch jรกdrech, dokud drลพรญ stabilnรญ snรญmkovou frekvenci, a vrรกtรญ ji na obvyklรก jรกdra, jakmile zaฤne zaostรกvat. Rozhranรญ klienta Vรญcevlรกknovรฉ GL Mลฏลพe zrychlit odezvu nabรญdek Steamu. @@ -604,7 +629,10 @@ Vypne pomocnรญka Protonu pro navigaci gamepadem, kterรฝ stojรญ vรฝkon CPU v kaลพdรฉ hล™e. Spustit proot bez seccomp Mลฏลพe opravit chyby s chybฤ›jรญcรญmi systรฉmovรฝmi volรกnรญmi na nฤ›kterรฝch jรกdrech. Mลฏลพe snรญลพit vรฝkon. + Spustit bez proot (experimentรกlnรญ) + Spustรญ linuxovou ฤรกst pล™รญmo na Androidu. Platรญ pro dalลกรญ relaci. Vypnฤ›te, pokud se nฤ›co nespustรญ. Rychlรก cesta proot + Bez proot se nepouลพije. Vyลพaduje filtr seccomp od proot. Rychlejลกรญ vyhledรกvรกnรญ souborลฏ a mรฉnฤ› zadrhรกvรกnรญ. Vypnฤ›te, pokud program nemลฏลพe najรญt svรฉ soubory. Kreslit kurzor v gamescope @@ -687,6 +715,7 @@ Grafickรก pamฤ›ลฅ Odklรกdacรญ pamฤ›ลฅ Stav baterie + Zbรฝvajรญcรญ vรฝdrลพ baterie Pล™รญkon Sรญลฅ Rozliลกenรญ @@ -815,6 +844,7 @@ Zaล™รญzenรญ podporovรกno Neovฤ›ล™enรฉ GPU GPU nepodporovรกno + GPU pล™es most Mali %1$s ยท %2$s %1$s: %2$s Pro %1$s nenรญ k dispozici kompatibilnรญ grafickรฝ backend. Steam mลฏลพe zobrazit ฤernou obrazovku. @@ -844,15 +874,38 @@ Relace Protokoly relace Uloลพeno po kaลพdรฉ relaci + Rozลกรญล™enรก diagnostika pro dalลกรญ relaci + Zachytรกvรก podrobnรฉ protokoly pro jednu relaci. Mลฏลพe snรญลพit vรฝkon a zabrat vรญce mรญsta. Po spuลกtฤ›nรญ relace se sama vypne; protokoly pล™ed sdรญlenรญm zkontrolujte. Ladicรญ protokoly her Pล™i dalลกรญm spuลกtฤ›nรญ hry zahrnout diagnostiku Protonu, Wine a grafiky. Mลฏลพe snรญลพit vรฝkon a zabrat vรญce รบloลพiลกtฤ›. Pro uklรกdรกnรญ ladicรญch protokolลฏ her restartujte tuto relaci Protokolovรกnรญ se nepodaล™ilo zmฤ›nit. Zkontrolujte pล™epรญnaฤ a zkuste to znovu. Nรกstroje pro ladฤ›nรญ + Podrobnรฉ protokoly grafiky + Rozhranรญ Steam: vykreslovรกnรญ na GPU + S pรกrem ovladaฤลฏ Xclipse vykresluje Steam svรฉ strรกnky softwarovฤ› (vykreslovรกnรญ na GPU zobrazovalo poลกkozenรฉ dlaลพdice). Pokud na tomto telefonu vypadรก sprรกvnฤ›, zapnฤ›te tuto moลพnost pro rychlejลกรญ rozhranรญ Steam. + sestaveno %1$s + %1$s byl aktualizovรกn na nejnovฤ›jลกรญ sestavenรญ + Most Mali neproลกel pล™i poslednรญ relaci na %1$s samotestem (obrรกzky nebo vykreslovรกnรญ), takลพe relace mรญsto nฤ›j pouลพila dvojici ovladaฤลฏ PanVK. + Most Mali pล™i poslednรญ relaci na %1$s nenaลกel zpลฏsob, jak sdรญlet pamฤ›ลฅ s ovladaฤem, takลพe relace pouลพila dvojici ovladaฤลฏ PanVK. Na tomto telefonu most fungovat nemลฏลพe; jeho vypnutรญ zachovรก dvojici ovladaฤลฏ PanVK. + Logy Proton, DXVK a ovladaฤลฏ kaลพdรฉ hry jsou v lozรญch relace. Vลพdy zapnuto, pokud GPU nenรญ Adreno. Protokoly poslednรญ relace Uloลพenรฉ protokoly relacรญ Uchovรกvรก nejnovฤ›jลกรญch %1$d Vymazat protokoly + Dostupnรฉ logy relacรญ + Zatรญm ลพรกdnรฉ uloลพenรฉ logy relacรญ. + Sdรญlenรฉ a uloลพenรฉ soubory ZIP obsahujรญ vybranou relaci a souvisejรญcรญ diagnostickรฉ รบdaje pro Steam, obchod, nรกstroje a Battle.net. + %1$s ยท %2$s + Aktuรกlnรญ relace + Sdรญlet + Uloลพit do zaล™รญzenรญ + Smazat + Smazat logy relace? + Smazat %1$s? Akci nelze vrรกtit zpฤ›t. + Logy relace byly uloลพeny. + Logy relace se nepodaล™ilo uloลพit. + Logy relace se nepodaล™ilo smazat. Obnovit vลกechna nastavenรญ Vrรกtรญ kaลพdรฉ nastavenรญ na vรฝchozรญ hodnotu Obnovit @@ -879,6 +932,8 @@ Pouลพรญt jako domovskou obrazovku DroidDeck mลฏลพe bรฝt domovskรก aplikace DroidDeck se nikdy nenabรญzรญ jako domovskรก aplikace + Tlaฤรญtko Domลฏ otevรญrรก + Strรกnka, kterรก se zobrazรญ, kdyลพ je DroidDeck aplikacรญ Domลฏ a stisknete tlaฤรญtko Domลฏ V Pล™idat hry nastavte DroidDeck na Zahrnout Orientace Orientace launcheru @@ -892,15 +947,22 @@ Celรก obrazovka Skryje stavovรฝ a navigaฤnรญ panel Androidu Zobrazรญ stavovรฝ a navigaฤnรญ panel Androidu + Spouลกtฤ›ฤ na dvou obrazovkรกch + Automaticky pล™esune sekce spouลกtฤ›ฤe (Steam, Knihovna, Obchody a ostatnรญ) na druhou obrazovku handheldลฏ, kterรฉ ji majรญ vestavฤ›nou. Zapnuto pouลพije libovolnรฝ druhรฝ displej. Vypnuto ponechรก spouลกtฤ›ฤ na jednรฉ obrazovce. + Relace na dvou obrazovkรกch + Automaticky pล™ipne nabรญdku ve hล™e na vestavฤ›nou druhou obrazovku mรญsto pล™ekryvnรฉho okna. Zapnuto pouลพije libovolnรฝ druhรฝ displej. Vypnuto ponechรก nabรญdku na obrazovce hry; druhou obrazovku z nรญ mลฏลพete stejnฤ› vybrat. Automaticky Zapnuto Vypnuto Ovlรกdรกnรญ na spodnรญ obrazovce ve hrรกch + Klรกvesnice systรฉmu Android pro textovรก pole Pล™i spuลกtฤ›nรญ relace otevล™e touchpad a klรกvesnici na druhรฉ obrazovce. Psanรญ pro hornรญ obrazovku Hotovo Vรฝchozรญ domovskรก aplikace Vybrat domovskou aplikaci + Skrรฝt spouลกtฤ›ฤ z Nedรกvnรฝch aplikacรญ, kdyลพ je neฤinnรฝ + Platรญ pouze tehdy, kdyลพ je DroidDeck vรฝchozรญ aplikacรญ Domลฏ a nebฤ›ลพรญ ลพรกdnรก relace. Vybrat Aplikace Linuxu (beta) Soubory @@ -1012,9 +1074,174 @@ Preview Nejnovฤ›jลกรญ opravy, dล™รญve neลพ ve Stable Aktuรกlnรญ + Kopรญrovat รบdaje o sestavฤ› + รšdaje o sestavฤ› zkopรญrovรกny + Novฤ›jลกรญ neลพ Preview + Jste napล™ed pล™ed Preview + Tato sestava je novฤ›jลกรญ neลพ poslednรญ Preview. Dalลกรญ sestava Preview ji aktualizuje. + Vyberte sestavu a zobrazte jejรญ zmฤ›ny nebo ji nainstalujte. + Nainstalovรกno + Nainstalovat tuto sestavu%1$s + Vrรกtit se k tรฉto sestavฤ›%1$s + versionCode %1$d + Commit %1$s + Strรกnka vydรกnรญ + PR mรก novฤ›jลกรญ commit (%1$s). Jeho testovacรญ sestava jeลกtฤ› nenรญ hotovรก, takลพe tato ho neobsahuje. + Novรฝ commit odeslรกn, sestava ฤekรก + ฤŒรญslo PR, nรกzev nebo autor + ลฝรกdnรก testovacรญ sestava neodpovรญdรก + Nutnรฉ znovu sestavit (versionCode %1$d) + Aktualizace testovacรญch sestav + Novรก testovacรญ sestava PR #%1$d + %1$s. Nainstalujete ji v Aktualizacรญch. + Zobrazit dalลกรญ (%1$d) + Nutnรฉ znovu sestavit pro versionCode %2$d (%1$d) + Sestavy Preview v main od tรฉto testovacรญ sestavy: %1$d Testovacรญ sestavy Vyzkouลกejte opravu pล™ed jejรญm vydรกnรญm Momentรกlnฤ› ลพรกdnรฉ + Laboratornรญ sestavenรญ + Laboratornรญ sestavenรญ + Pouลพรญvรก se + Pozastaveno potรฉ, co Android znovu optimalizoval DroidDeck + Nenaฤteno: %1$s + ฤŒekรก na restart + Ponechรกno + Pro jinou verzi + Znovu sestavit + Smaลพe toto sestavenรญ ze zaล™รญzenรญ + Restartovat na nฤ›m + Vypnout + Pouลพรญt + Smazat + Smazat nynรญ + Restart se nepodaล™ilo pล™ipravit: %1$s. V Nastavenรญ spรกrujte bezdrรกtovรฉ ladฤ›nรญ a zkuste to znovu. + Laboratornรญ sestavenรญ nainstalovรกno + DroidDeck se restartoval na %1$s + Laboratornรญ sestavenรญ pozastaveno + Android znovu optimalizoval aplikaci DroidDeck, takลพe %1$s nenรญ naฤteno. Otevล™ete Aktualizace a znovu na nฤ›m spusลฅte DroidDeck. + Laboratornรญ sestavenรญ vypnuto + Bylo vytvoล™eno pro jinou verzi aplikace DroidDeck. Zลฏstรกvรก v Aktualizacรญch. + DroidDeck se na nฤ›m dvakrรกt nespustil. + Agent + Agent + Agent pracuje + Chcete-li pouลพรญvat agenta, nainstalujte Claude Code v uลพivatelskรฉm prostล™edรญ Linuxu. + Zeptejte se na hru, pรกd nebo รบpravu aplikace DroidDeck + Odeslat + Novรก konverzace + Zastavit + รšloลพiลกtฤ› + Odebrat + Odebrat nynรญ + Claude Code + Codex + Zdrojovรฝ kรณd DroidDeck + Mezipamฤ›ลฅ stahovรกnรญ + Neodeslanรฉ zmฤ›ny se ztratรญ + Sestavenรญ je znovu stรกhnou. + รšvodnรญ nastavenรญ ho mลฏลพe znovu nainstalovat; pล™ihlรกลกenรญ zลฏstanou zachovรกna. + DroidDeck se znovu spustil na vaลกem laboratornรญm sestavenรญ. Pokraฤujte tam, kde jste skonฤili. + Zeptejte se, proฤ se hra nespustรญ, poลพรกdejte o vysvฤ›tlenรญ logu nebo รบpravu aplikace DroidDeck a nechte zmฤ›nu otestovat na tomto zaล™รญzenรญ. + Chyba: %1$s + %1$s skonฤil (kรณd %2$d) + Zastaveno + Skonฤilo bez odpovฤ›di + Zkusit znovu + Nastavovรกnรญ agenta + Znovu sestavte mรฉ laboratornรญ sestavenรญ %1$s pro nainstalovanou verzi aplikace DroidDeck a znovu na nฤ›m spusลฅte DroidDeck. + %1$s na vstupu ยท %2$s na vรฝstupu + Pล™emรฝลกlรญ + Myลกlenka + Pล™emรฝลกlรญ ยท %1$s + %1$s ยท %2$s + VSTUP + VรSTUP + Probรญhรกโ€ฆ + ลฝรกdnรฝ vรฝsledek: kolo skonฤilo dล™รญve + ลฝรกdnรฝ vรฝstup + Psanรญm zaล™adรญte dalลกรญ zprรกvu do fronty + Zaล™adit do fronty + Dalลกรญ: %1$s + Neposรญlat + Pล™iloลพit + Odebrat + Vรฝchozรญ + Nรกroฤnost uvaลพovรกnรญ + Provรฉst + Pล™epracovat + Zatรญm se nic nezmฤ›nilo + Proveฤ plรกn. + Odeslat nynรญ + Vรญce + Zavล™รญt + Nejnovฤ›jลกรญ + Pracuje + Kontext + %1$s z %2$s + Tato konverzace ยท %1$s + Vyuลพitรญ se zobrazรญ po prvnรญ odpovฤ›di + %1$dhodinovรฝ limit + %1$dminutovรฝ limit + Tรฝdennรญ limit + %1$d%% ยท obnovรญ se %2$s + + %1$d soubory + %1$d souboru + %1$d soubor + %1$d souborลฏ + + Nejprve plรกn + Plรกn + Navrhne plรกn a nic nezmฤ›nรญ + Konverzace + Zatรญm ลพรกdnรฉ konverzace + Prรกvฤ› teฤ + Smazat + Smaลพe ji i jejรญ pล™รญlohy + Procesy + V uลพivatelskรฉm prostoru Linuxu nic nebฤ›ลพรญ + AGENT + Zastavit + Sestavenรญ Labu + Pล™ipravujรญ se sestavenรญ Labu + %1$d%% ยท zbรฝvรก asi %2$s + zbรฝvรก asi %1$s + Zruลกit + Zruลกit sestavenรญ + Spouลกtรญ se + %1$d%% + Balรญ se + Restartuje se DroidDeck na nฤ›m + Hotovo + Selhalo: %1$s + Nastavit agenta + Nejprve v Nastavenรญ nainstalujte bฤ›hovรฉ prostล™edรญ Linuxu. + Zkusit znovu + Zaฤรญt chatovat + Pล™ipojenรญ zaล™รญzenรญ + Bezdrรกtovรฉ ladฤ›nรญ, aby agent vidฤ›l a ovlรกdal DroidDeck + Nainstalovat %1$s + Do linuxovรฉho uลพivatelskรฉho prostoru, s git, gh a adb + Pล™ihlรกsit se k %1$s + Otevล™e prohlรญลพeฤ + GitHub + Volitelnรฉ, pro otevรญrรกnรญ pull requestลฏ + Nรกstroje pro sestavenรญ + Volitelnรฉ, pro sestavenรญ Lab na tomto zaล™รญzenรญ ยท asi 5 GB + Agent je pล™ipraven + Dokonฤete nastavenรญ agenta + Pล™ihlรกลกeno k %1$s + Sestavenรญ Lab + rychlรก sestavenรญ + Rychlรก sestavenรญ Lab + Pล™edem zkompiluje tuto verzi, takลพe sestavenรญ Lab trvajรญ minuty ยท asi 20 minut jednorรกzovฤ› + Kompiluje se ยท %1$d%% ยท zbรฝvรก asi %2$s + Pล™ipravit + Bezdrรกtovรฉ ladฤ›nรญ nenรญ dostupnรฉ; Spรกrovat ho zapne + Spรกrovat + Instalovat + Pล™ihlรกsit se PR #%1$d Pro tuto kopii DroidDecku nenรญ sestavena Aktualizovรกno %1$s @@ -1262,6 +1489,9 @@ Aplikace Pล™รญprava Aktualizace + Vรญce + Upravit karty + Karty %1$d%% Obnovit %1$s V kaลพdรฉ relaci se zobrazรญ jako /root/ROMs. Vnitล™nรญ รบloลพiลกtฤ› je v /root/Storage. @@ -1283,6 +1513,15 @@ Zruลกit ฤekajรญcรญ Klรกvesnice Androidu Skrรฝt โœ• + Velikost na obrazovce + Podรญl obrazovky, kterรฝ klรกvesnice zabรญrรก, vฤetnฤ› zรกhlavรญ. + Neprลฏhlednost + Sniลพte ji, abyste vidฤ›li hru za klรกvesnicรญ. + Skrytรฉ klรกvesy + Klรกvesy, kterรฉ pouลพรญvรกte zล™รญdka, se na klรกvesnici nezobrazujรญ. + Esc a ล™ada funkฤnรญch klรกves + Ins / Del / Home / End / PgUp / PgDn + Klรกvesy se ลกipkami Spustit %1$s Vyberte obrazovku. Druhรก: %1$s. Druhรก obrazovka uลพ nenรญ dostupnรก. @@ -1818,7 +2057,24 @@ Terminรกl Rukojeti + trackpady Deck Pล™ehled + Plocha + Spustit plochu + Plocha ยท %1$s + Touchpad + Pล™รญmรฝ dotyk + Touchpad. Klepnutรญm pล™epnete na pล™รญmรฝ dotyk + Pล™รญmรฝ dotyk. Klepnutรญm pล™epnete na touchpad + Spouลกtรญ se plocha KDEโ€ฆ + Plocha se zavล™ela. + Plochu se nepodaล™ilo spustit. Jejรญ protokoly jsou ve sloลพce bottom-desktop tรฉto relace. + Plocha je zavล™enรก. Zatรญm tu nenรญ nic k zobrazenรญ. + Prohodit obrazovky + Spodnรญ obrazovka teฤ nenรญ volnรก + Hernรญ obrazovka + Zobrazit hru na + Hornรญ obrazovka + Spodnรญ obrazovka Stahovรกnรญ Neprobรญhรก ลพรกdnรฉ stahovรกnรญ. Steam @@ -1853,6 +2109,20 @@ Palivo, t Hlavnรญ %1$s t Rezerva %1$s t + Doba snรญmku + poslednรญch %1$d s + prลฏmฤ›rnรฝ snรญmek + 1% nejniลพลกรญ hodnota + snรญmky nad 33 ms + %1$d / min + Hrajete %1$s + %1$d jader, aลพ %2$s GHz + %1$d jader + hra + FPS z %1$d Hz + ฤŒervenรก znaฤka oznaฤuje mรญsto, kde HUD zobrazuje teplotu ฤervenฤ›. + celรฉ zaล™รญzenรญ + baterie Odesรญlat data pro palubnรญ desku Automaticky Zapne to pro kaลพdou zde uvedenou hru, vฤetnฤ› her nalezenรฝch pozdฤ›ji. Hry, kterรฉ vypnete, zลฏstanou vypnutรฉ. @@ -1876,6 +2146,10 @@ Mikrofon je pro tuto hru vypnutรฝ. Chcete-li mluvit, zapnฤ›te Mikrofon v nastavenรญ Steamu v DroidDecku (Zvuk) a spusลฅte hru znovu. Hlasitost %1$d%% Statistiky ve hล™e + HUD na spodnรญ obrazovce + Liลกta na kaลพdรฉ kartฤ› + 1% a 0,1% nejniลพลกรญ hodnoty + Teplota CPU FPS CPU GPU @@ -2050,6 +2324,7 @@ Spouลกtฤ›nรญ relaceโ€ฆ %1$d:%2$02d uplynulo ยท stรกle pracuje Stahovรกnรญ aktualizace klienta Steam ยท %1$d%% + Instaluje se aktualizace klienta Steamโ€ฆ Stahovรกnรญ klienta Steam ยท %1$s Instalace nรกstroje kompatibility uลพ bฤ›ลพรญ @@ -2126,11 +2401,29 @@ Kreslenรฉ obrysy plus zaostล™enรญ. Nenรญ GPU Adreno + Systรฉmovรฝ ovladaฤ PowerVR: kompatibilita se liลกรญ podle zaล™รญzenรญ + Experimentรกlnรญ: RADV nebo systรฉmovรฝ ovladaฤ Xclipse + Systรฉmovรฝ PowerVR + Pouลพรญvรก vestavฤ›nรฉ ovladaฤe pro tuto GPU + Pro bฤ›hovรฉ prostล™edรญ a zobrazenรญ je vybrรกn systรฉmovรฝ ovladaฤ PowerVR. + ลฝรกdnรฝ otevล™enรฝ ovladaฤ zatรญm tento Mali nepokrรฝvรก: most Mali je zapnutรฝ. + Tohle je testovacรญ sestavenรญ pro zaล™รญzenรญ, kterรก nemajรญ Snapdragon: oficiรกlnรญ sestavenรญ tady bฤ›ลพรญ jen na Adreno, proto se pล™es nฤ›j neinstalujรญ. Novรก testovacรญ sestavenรญ jsou k dispozici na github.com/The412Banner/droiddeck-nonadreno-drivers. + Poslednรญ relace skonฤila, protoลพe Android ukonฤil DroidDeck, aby uvolnil pamฤ›ลฅ, neลกlo o pรกd. Zavล™ete ostatnรญ aplikace nebo sniลพte nastavenรญ textur hry a zkuste to znovu. + Mali (Venus) + most Mali + ลฝรกdnรฝ otevล™enรฝ ovladaฤ zatรญm tento Mali nepokrรฝvรก: pouลพije se %1$s na vlastnรญm ovladaฤi telefonu. + %1$s jeลกtฤ› nevyลกel: do tรฉ doby se pouลพรญvรก %2$s. + %1$s nenรญ dostupnรฝ a ovladaฤ tohoto telefonu hlรกsรญ Vulkan %2$s (Venus potล™ebuje 1.2): pouลพije se most Mali. + %1$s jeลกtฤ› nevyลกel: do tรฉ doby je zapnutรฝ most Mali. + Ve frontฤ›: %1$s (ฤekรก na jinรฝ ovladaฤ bฤ›hovรฉho prostล™edรญ) + DXVK dodรกvรก systรฉmovรฉ bฤ›hovรฉ prostล™edรญ PowerVR. Ostatnรญ balรญฤky DXVK lze uloลพit, ale s tรญmto ovladaฤem se nepouลพijรญ. Podporovรกno Experimentรกlnรญ: jeho ovladaฤe jsou testovacรญ sestavenรญ Experimentรกlnรญ podpora Adreno 850: vyลพaduje kompatibilnรญ experimentรกlnรญ ovladaฤe displeje a her; na tomto zaล™รญzenรญ neovฤ›ล™eno Pod testovanรฝm hardwarem (Adreno 725 a novฤ›jลกรญ): nemusรญ fungovat Nepodporovรกno: pro tento GPU nenรญ k dispozici kompatibilnรญ grafickรฝ backend + Bฤ›ลพรญ pล™es most Mali na vlastnรญm ovladaฤi Vulkan telefonu + S vypnutรฝm mostem Mali nenรญ podporovรกno: Turnip potล™ebuje GPU Adreno (Snapdragon) Byl dosaลพen limit poลพadavkลฏ GitHubu - zkuste to pozdฤ›ji GitHub odpovฤ›dฤ›l HTTP %1$d @@ -2239,7 +2532,6 @@ Obchody Steam Vlastnรญ - Obchody รšroveลˆ rychlosti stahovรกnรญ Vyvรกลพenรฉ Rychlรฉ @@ -2278,6 +2570,7 @@ ฤŒekรกnรญ na druhรฉ stahovรกnรญ z Battle.netโ€ฆ Otevล™ete Battle.net a jednou se pล™ihlaste, pak instalujte jeho hry odsud. Stahovaฤ Blizzardu se zastavil: %1$s + Stahovaฤ Blizzardu pล™estal postupovat. Chyba Blizzardu %1$s Aktualizovat Hry od Blizzardu @@ -2285,6 +2578,7 @@ Pล™eruลกeno Instalace ยท %1$s Zรญskat zdarma + Pล™idรกvรกnรญ do knihovnyโ€ฆ Zobrazit na %1$s Koupit ยท %1$s Nainstalovรกno @@ -2331,6 +2625,12 @@ ล˜azenรญ Popisky postrannรญho panelu Zobrazovat nรกzvy pod ikonami postrannรญho panelu. Vypnฤ›te pro uลพลกรญ panel. + Mazlรญฤek agenta + DeeDee se zobrazuje nad spouลกtฤ›ฤem a hrami a ukazuje, co agent dฤ›lรก. + Nad ostatnรญmi aplikacemi + Umoลพnฤ›te DeeDee zobrazovat se nad vลกemi aplikacemi a otevรญrat v nich chat. + Povolit + Chat s DeeDee Zobrazenรญ Vฤ›tลกรญ karty Menลกรญ karty @@ -2619,7 +2919,14 @@ %1$s ยท ฤekรก na restart Toto zaล™รญzenรญ Odstranit %1$s? - Diagnostika + Vรฝvojรกล™ + Vodoznak s oznaฤenรญm sestavenรญ + Zobrazit na obrazovce oznaฤenรญ testovacรญho sestavenรญ nebo sestavenรญ Lab. Ve vรฝchozรญm nastavenรญ zapnutรฉ. + Sdรญlet diagnostickรฉ balรญฤky + Relace a zaล™รญzenรญ + Grafika + Hry a kompatibilita + Vลกechny balรญฤky Pล™ipraveno ke hranรญ Jeลกtฤ› nenรญ pล™ipraveno ke hranรญ runtime %1$s @@ -2658,6 +2965,9 @@ Zapnฤ›te achievementy GOG v nastavenรญ obchodลฏ Achievementy nejsou k dispozici; zkontrolujte protokoly relace Achievement odemฤen + Mali (Venus): vypnuto + Mali (Venus): zapnuto + Ovladaฤ na %1$s hlรกsรญ Vulkan %2$s. Mali (Venus) potล™ebuje Vulkan 1.2 nebo novฤ›jลกรญ (na starลกรญch se gamescope nespustรญ), proto relace Venus pล™eskoฤรญ a pouลพijรญ dvojici ovladaฤลฏ PanVK. Vloลพit Levรก pรกฤka Pravรก pรกฤka @@ -2948,7 +3258,7 @@ Vybrat sloลพkuโ€ฆ Pouลพรญt libovolnou sloลพku na kartฤ› SD nebo disku USB Hry se uklรกdajรญ do sloลพky Games ve vybranรฉm umรญstฤ›nรญ. Stรกvajรญcรญ hry se nepล™esouvajรญ. - Kam to jde + Co zabรญrรก mรญsto Hry ze Steamu Data her Prefixy %1$s ยท workshop %2$s ยท shadery %3$s @@ -3017,6 +3327,7 @@ Instalace VC++ a DirectX, kterรฉ hry potล™ebujรญ Spouลกtรญ hry pro Linux x86 Nรกstroj Steamu + Steam to stahuje pro hry s anti-cheatem, i kdyลพ je vypnutรฝ. Kdyลพ ho odeberete, jejich instalace uvรญzne na 0 % DroidDeck spouลกtรญ hry bez tohoto prostล™edรญ Proton x86, kterรฝ DroidDeck nedokรกลพe spustit Vรฝchozรญ pro vลกechny hry @@ -3094,6 +3405,19 @@ Zachovรกno Hry mimo Steam a sdรญlenรฝ prefix Steamu Prefixy her pล™idanรฝch pล™es obchody nebo ruฤnฤ› + Sdรญlenรฝ prefix Steamu + Steam zde spouลกtรญ svรฉ pomocnรฉ programy pro Windows + Smaลพe ho (%1$s). Steam si vytvoล™รญ novรฝ, aลพ ho bude pล™รญลกtฤ› potล™ebovat. + Aplikace obchodu a hry, kterรฉ s nรญ bฤ›ลพรญ + Pouลพรญvรก: %1$s + Hra mimo Steam %1$s + Nepatล™รญ k ลพรกdnรฉ hล™e, proto zลฏstรกvรก + Odebrat vybranรฉ ยท %1$s + Odinstalovat vybranรฉ ยท %1$s + Prefixy Wine + Uloลพenรฉ hry a nastavenรญ v nich budou ztraceny; uloลพenรญ ve Steam Cloud zลฏstanou ve vaลกem รบฤtu. + Mezipamฤ›ti shaderลฏ + Prefix %1$s ยท shadery %2$s Staลพenรฉ balรญky Zachovanรฉ originรกly Nejsou staลพenรฉ ลพรกdnรฉ balรญky komponent. @@ -3132,6 +3456,8 @@ DroidDeck ยท %1$d fps 60 fps vypadรก plynuleji, ale pล™i spouลกtฤ›nรญ Steamu vรญc zatฤ›ลพuje procesor. Video vybranรฉ pล™รญmo v nastavenรญ Steamu se zde takรฉ zobrazรญ. Zvuk + Pล™eskoฤit รบvodnรญ video + Pouลพije se 0,1sekundovรฝ ฤernรฝ klip jako รบvodnรญ video pล™i spuลกtฤ›nรญ aplikace Steam. Projevรญ se v pล™รญลกtรญ relaci. Vlastnรญ video MP4, MOV, MKV nebo WebM. Jinรฉ formรกty a soubory nad %1$d MB se v zaล™รญzenรญ pล™evedou na WebM 720p, nejvรฝลกe %2$d sekund. Importovat @@ -3593,6 +3919,7 @@ Ponechรก Alt+Tab, klรกvesu Win a tlaฤรญtko Domลฏ v aktivnรญ relaci DroidDeck mรญsto Androidu. Zapnฤ›te Jas v Pล™รญprava โ†’ Integrace se Steamem Most Mali: vypnuto + %1$s nemลฏลพe pouลพรญt most Mali (potล™ebuje GPU Mali bez trasy pล™es systรฉmovรฝ ovladaฤ), takลพe tento pล™epรญnaฤ tady nemรก ลพรกdnรฝ รบฤinek. Most Mali: zapnuto %1$s nenรญ Adreno. Experimentรกlnรญ most Vulkan je zapnutรฝ: relace vykresluje pล™es vlastnรญ ovladaฤ telefonu. Poฤรญtejte s chybami; poลกlete protokoly relace. Bezpeฤnรฝ reลพim @@ -3618,6 +3945,25 @@ Posunout pozdฤ›ji Nastavenรญ widgetu Odebrat widget + Vzhled + Balรญฤek ikon + Vรฝchozรญ systรฉmovรฝ + Pozadรญ v barvฤ› aplikace + Velikost ikon + Malรฉ + Stล™ednรญ + Velkรฉ + Skrรฝt nรกzvy aplikacรญ + Rozestupy + Tฤ›snรฉ + Bฤ›ลพnรฉ + Volnรฉ + Zmฤ›nit ikonu + Obnovit ikonu + Hledat ikony + Naฤรญtรกnรญ ikonโ€ฆ + Nebyly nalezeny ลพรกdnรฉ ikony. + Vlastnรญ ikony Pล™idat do sloลพky Novรก sloลพka Odebrat ze sloลพky @@ -3735,5 +4081,81 @@ Toto rozloลพenรญ nelze importovat ล arlatovรฝ snรญh + Bรญlรฉ povrchy s ฤervenรฝmi akcenty. + Soundtracky + Hudba + Moลพnosti pล™ehrรกvรกnรญ + Oblรญbenรฉ + Kolekce + Zatรญm ลพรกdnรฉ kolekce. Klepnutรญm na ikonu zรกloลพky nฤ›jakou vytvoล™รญte. + Uloลพeno + Vytvoล™it kolekci + Uspoล™รกdejte si uloลพenรฉ skladby + Novรก + Vytvoล™it + Nรกzev kolekce + Zadejte nรกzev, kterรฝ nepouลพรญvรก ลพรกdnรก jinรก kolekce + Spravovat + Pล™ejmenovat + Pล™idat skladby + Pล™idat (%1$d) + Odebrat skladby + Smazat kolekci + Smazat %1$s? + Skladby zลฏstanou ve vaลกem zaล™รญzenรญ. Odstranรญ se pouze kolekce. + Vybrat + Vybrat vลกe + Zruลกit vรฝbฤ›r + Vybrรกno: %1$d + Pล™idat do kolekce + Pล™idat do oblรญbenรฝch + Odebrat z kolekce + Hledat skladby + Poล™adรญ alba + Nejdelลกรญ prvnรญ + Nejkratลกรญ prvnรญ + Skladby + Vรฝลกka tรณnu + Obnovit + Pล™eskakovat ticho + ฤŒasovaฤ vypnutรญ + %1$d min + Konec skladby + Zbรฝvรก %1$s + Ekvalizรฉr + Zesรญlenรญ basลฏ + Ekvalizรฉr nenรญ na tomto zaล™รญzenรญ k dispozici + Povolit ve hล™e + Nechat soundtrack hrรกt bฤ›hem hry + Zatรญm nejsou nainstalovรกny ลพรกdnรฉ soundtracky. + Hledat soundtracky + Pล™idat sloลพku se soundtrackem + V tรฉto sloลพce nejsou ลพรกdnรฉ zvukovรฉ soubory + Celkovรก dรฉlka + Skladeb: %1$d / %2$s + Disk %1$s + Nรกhodnฤ› + Pล™edchozรญ + Pล™ehrรกt + Pozastavit + Dalลกรญ + Opakovรกnรญ vypnuto + Opakovat vลกe + Opakovat jednu + Hlasitost + V tomto soundtracku nejsou ลพรกdnรฉ zvukovรฉ soubory + Spuลกtฤ›nรญ nenรญ dostupnรฉ + K otevล™enรญ tohoto odkazu nenรญ k dispozici ลพรกdnรฝ webovรฝ prohlรญลพeฤ. + Uchopit + Pustit + Uloลพit + Podrลพ pro obnovenรญ + Obchody + Doba snรญmku + Prลฏmฤ›rnรก snรญmkovรก frekvence + Zobrazovacรญ server + Stav HDR + Zobrazeno + %1$d z %2$d diff --git a/app/src/main/res/values-da/input_library.xml b/app/src/main/res/values-da/input_library.xml new file mode 100644 index 0000000000..f3fd6e80ac --- /dev/null +++ b/app/src/main/res/values-da/input_library.xml @@ -0,0 +1,132 @@ + + + Den valgte skรฆrm er ikke tilgรฆngelig. Tilslut den for at redigere dette layout i fuld stรธrrelse. + Kassรฉr ikke-gemte layoutรฆndringer? + Dette layout bruges af %1$d profiler. Gemte รฆndringer gรฆlder for alle. + Standardprofiler + Skrivebordstilstand + Spiltilstand + Standard for skrivebord og spil + Standard for spiltilstand + Standard for skrivebordstilstand + Enhedsindstillinger + Betjening + Knapper, stik, aftrรฆkkere og ekstra taster + Kopiรฉr profil + Nulstil handlinger + Nulstil handlingerne i %1$s til basisprofilens standardvรฆrdier? Layouts og andre profiler รฆndres ikke. + Slet %1$s? Tilstande, der bruger den, vender tilbage til deres indbyggede standardprofil. Gemte layouts og delte indstillinger forbliver tilgรฆngelige. + Synlighed + Gรฆlder for alle profiler. Auto viser hovedskรฆrmens betjening, nรฅr der ikke er tilsluttet en controller i spiltilstand. + Rediger pรฅ skรฆrmen + Gemte layoutsโ€ฆ + Vรฆlg et layout, eller opret dit eget + Vรฆlg Profilbetjening i sekundรฆrskรฆrmens sessionsmenu. Valgene Profil og Sekundรฆr skรฆrm i controllermenuen bestemmer, hvilken betjening der vises. + Knaphandlinger + Delt med %1$s. ร†ndringer gรฆlder ogsรฅ for disse profiler. + Genbrug indstillinger + Brug indstillinger fraโ€ฆ + Kopiรฉr fra en anden profil, eller behold indstillingerne delt + Gรธr uafhรฆngig + Behold den nuvรฆrende opsรฆtning, og stop med at dele รฆndringer + Layouts gemmer elementer og deres placeringer. Hver profil kan tildele sine egne handlinger. Rediger i fuld stรธrrelse pรฅ mรฅlskรฆrmen. + Aktuelt layout + Slet det ubrugte layout %1$s og dets gemte handlinger? + Omdรธb aktuelt layout + Ulรฆselige inputindstillinger blev gemt i en gendannelseskopi. Du kan fortsรฆtte med at redigere de gendannede profiler. + Egenskaber + Egenskaber for klik + %1$s ยท Klik + Knapper + Styrepinde, pads og aftrรฆkkere + Skjul vรฆrktรธjer + Controller + Sender controllerinput til Steam Input eller spillet. + Dette element sender ingen input fra controller, mus eller tastatur. + Museklik + DroidDeck-handling + Handling + Rullehastighed: %1$d trin/s + + Ny profil + + Nyt layout + %1$s ยท Bruges af %2$d profiler. ร†ndringer gรฆlder for alle profiler, der bruger disse tildelinger. + Omdรธb + Slet + Tilfรธj elementer til layoutet, fรธr du tildeler deres handlinger. + Kunne ikke gemme inputindstillinger + Navn + Start fra + Knap + Styrepind + Touchpad + Retningskryds + Aftrรฆkker + Fรฆrdig + Fortryd + + Tilfรธj + Trรฆk for at flytte. Trรฆk i et hjรธrne for at รฆndre stรธrrelse. Tryk pรฅ Egenskaber for at tildele en handling. + Redigeres pรฅ sekundรฆrskรฆrmen + Genbrug %1$s fra en anden profil. De รธvrige kontrolkilder forbliver uรฆndrede. + Behold fysisk betjening delt + Som standard er alle betjeninger og brugerdefinerede layouts uafhรฆngige kopier. Deling linker kun den fysiske betjening. + Brug disse elementer og placeringer. Deling holder fremtidige geometriรฆndringer synkroniserede; dine knaphandlinger forbliver uafhรฆngige. Et andet layout starter med utildelte handlinger. + Kopiรฉr disse betjeninger og handlinger, eller link dem, sรฅ fremtidige รฆndringer gรฆlder for begge profiler. + Behold delt + Uafhรฆngig kopi + Start stikket ved berรธringspunktet + Skjul stikket, nรฅr det ikke bruges + Vรฆrktรธjer + Auto (%1$s) + Brugerdefineret (%1$s) + Gem som ny profil + Profilbetjening + Profil + Musetouchpadbevรฆgelser + Nรฅr tildelt musemarkรธren: tryk for at klikke, hold for at trรฆkke, og rul med to fingre. + %1$s har en tilsidesรฆttelse af hurtigmenuen. Vรฆlg Auto for at bruge dens standardprofil og alle tre gemte dele. + DroidDeck-input + Holdes, mens styrepinden flyttes i en vilkรฅrlig retning: tryk over 55 %, slip under 35 %. Brug Retningstaster til at tildele hver retning separat. DroidDeck-kommandoer kรธrer รฉn gang pr. udsving. Stikklikket konfigureres separat. + Holdes, mens du rรธrer touchpadden; slippes, nรฅr du lรธfter fingeren. DroidDeck-kommandoer kรธrer รฉn gang pr. berรธring. Touchpadklikket konfigureres separat. + Holdes, nรฅr aftrรฆkkeren passerer 55 %; slippes under 35 %. DroidDeck-kommandoer kรธrer รฉn gang pr. tryk. + Rulleretning + Lodret + Vandret + Rul vandret + Mรฅlinger + Slรฅ optagelse til, brug betjeningen i en kรธrende session, og vend sรฅ tilbage og lรฆs resultaterne. Mรฅler kun DroidDecks afsendelsestid, ikke skรฆrmforsinkelse. Optagelsen slutter, nรฅr app-processen lukkes. + %1$d betjeninger + Andre gemte layouts (%1$d) โ–พ + Skjul andre gemte layouts (%1$d) โ–ด + Hjem / Guide + Tilbage ยท enkelt tryk + Tilbage ยท dobbelttryk + Tilbage ยท to gange i Steam, รฉn gang pรฅ skrivebordet + I Steam-tilstand. Hvis du holder Tilbage, รฅbnes hurtigadgang ogsรฅ. + Gendan standard + Dit panelvalg huskes. Skrivebord รฅbner et andet arbejdsomrรฅde; det skifter ikke sessionen eller dens inputprofil. + Virtuel controller + Den controllertype, som Steam eller spillet ser. + Berรธringsskรฆrm + Hvordan berรธringer pรฅ spilskรฆrmen hรฅndteres. Profilknapper beholder deres tildelte handlinger. + Berรธringsmarkรธr + Viser en markรธr ved direkte berรธringer pรฅ spilskรฆrmen. + Rรธr og hold + Musehandling, nรฅr du holder en finger pรฅ spilskรฆrmen. + Tryk pรฅ Tilbage-knappen + Fรธrste handling: enkelt tryk. Anden handling: dobbelttryk. + Skifteknap + Tryk for at holde, tryk igen for at slippe. ร…bning af en menu eller skift af profil slipper knappen. + Form + Afrundet + Pille + Cirkel + Rektangel + Knapetiket + Tekst + Importeret billede + Separate diagonalknapper + Tildel en tast til hver diagonal. En tom diagonal trykker sine to naboretninger. + Naboretninger + Dine gamle skรฆrmtaster er gemt som importerede profiler nedenfor. Vรฆlg en for at bruge eller redigere den. Dine nuvรฆrende profilvalg er bevaret. + De gamle skรฆrmtaster kunne ikke importeres automatisk. De oprindelige indstillinger er bevaret. + diff --git a/app/src/main/res/values-da/input_strings.xml b/app/src/main/res/values-da/input_strings.xml new file mode 100644 index 0000000000..2e4e23b45a --- /dev/null +++ b/app/src/main/res/values-da/input_strings.xml @@ -0,0 +1,38 @@ + + + Inputprofiler + Profiler + Fysisk controller + Hovedskรฆrm + Sekundรฆr skรฆrm + Indbygget / Steam Input + Indbygget: %1$s + Send en anden controllerstyring + Deaktiveret + Tast eller tastekombination + Retningstaster + Flyt markรธren + Markรธrhastighed: %1$d + Rul + Rul lodret + Venstre museknap + Hรธjre museknap + Midterste museknap + ร…bn DroidDeck-menuen + Vis tastatur + ร…bn Steam-menuen + ร…bn Steams hurtigadgang + Fjern kontrol + Tilfรธj kontrol + Enhedsspecifikke knapper + Tildel en fysisk knap + Slip knappen, og vรฆlg Rediger, Prรธv igen eller Annuller. B eller Tilbage annullerer efter slip. + Prรธv igen + Tryk pรฅ en knap, ogsรฅ en Tilbage-knap der rapporteres som tast. Lydstyrke- og Android-systemtaster er reserveret. Tildelingen gรฆlder kun denne enhed. + Fjern tildeling + Inputdiagnostik + Optag inputafsendelsestid + Lรฆs mรฅlinger + Mรฅler afsendelsen fra Android til offentliggรธrelse i den eksisterende inputtransport. Bluetoothankomst, gรฆstepolling, rendering og skรฆrmforsinkelse er ikke medtaget. Optagelse er slรฅet fra som standard. + Brug normal inputtildeling + diff --git a/app/src/main/res/values-da/strings.xml b/app/src/main/res/values-da/strings.xml index f0c0527365..443b2a96cb 100644 --- a/app/src/main/res/values-da/strings.xml +++ b/app/src/main/res/values-da/strings.xml @@ -28,6 +28,8 @@ Sรฆt pรฅ pause nu Afslut session Billedgenerering + Indstillinger for dette spil + Standardindstillinger Vรฆlg metode til billedgenerering Fra DD-FG %1$dร— @@ -183,6 +185,7 @@ PowerVR-grafikmiljรธet kunne ikke hentes. Tjek forbindelsen, og prรธv igen. DirectAudio kunne ikke downloades, sรฅ spillyd bruger den langsommere vej i denne session. Dette program + Sessionen kunne ikke tegne pรฅ skรฆrmen: %1$s. Denne skรฆrm viser hvorfor i stedet for en sort skรฆrm; sessionens logfiler indeholder detaljerne. Steam-klienten kunne ikke downloades. Dit netvรฆrk eller din VPN blokerer muligvis Steams servere; tjek forbindelsen, og prรธv igen. Steam-klienten kunne ikke konfigureres. Tjek forbindelsen og den ledige lagerplads, og prรธv igen. %1$s er bygget til x86-pcโ€™er og kรธres via FEX, som ikke er installeret endnu. Start Steam รฉn gang, mens du er logget ind, og lad det downloade FEX og Steam Linux Runtime, og start sรฅ dette igen. @@ -385,6 +388,9 @@ Ikke understรธttet her endnu Indlรฆser komponenterneโ€ฆ Kunne ikke installere: %1$s + Denne download skal opdateres. + Opdatering sat i kรธ. + Prรธv opdatering igen Downloadet Downloader %1$s Installerer: %1$s @@ -415,6 +421,22 @@ Kun internt Mappe: %1$s Andet bibliotek + Flere Steam-biblioteker + Mapper, som Steam kan installere i og spille fra, hver med sit eget navn. Hvis du fjerner et bibliotek, bliver spillene pรฅ disken. + Tilfรธj bibliotek + Omdรธb + Bibliotekets navn + Vรฆlg en mappe til biblioteket + Hรธjst %1$d tilfรธjede biblioteker + Mappen er allerede et bibliotek eller ligger i et + %1$s ยท ikke tilgรฆngelig + Gรฆlder fra nรฆste Steam-session + Fundet pรฅ denne enhed ยท %1$s ยท %2$s + Tilfรธj + Find biblioteker pรฅ den interne lagerplads + Tillad adgang til alle filer, sรฅ DroidDeck kan se Steam-biblioteker, som andre apps gemmer pรฅ den interne lagerplads + Tillad + Tilfรธjet %1$s, Steam-biblioteket i den mappe, du valgte Spil, der streamer data fra SD-kort eller delt lager, kan stamme. Lagerdiagnostik Registrerer allokeringsresultater og lagertider i Del logs. Kan gรธre installationer langsommere, mens det er aktivt. Gรฆlder fra nรฆste session. @@ -478,6 +500,7 @@ Til Starter med Steam Starter uden Steam + Spiloplรธsning Indstillinger Indstillinger for %1$s Standard @@ -565,6 +588,8 @@ Spilkerner Spilkerner Kerner til spil. Med alle valgt planlรฆgger Android frit. + Spar strรธm i stabile spil + Kรธrer et spil pรฅ de langsommere kerner, mens det holder en stabil billedfrekvens, og flytter det tilbage til sine vante kerner, nรฅr det halter bagefter. Klientgrรฆnseflade Threaded GL Kan gรธre Steam-menuer mere lydhรธre. @@ -600,7 +625,10 @@ Deaktiverer Protons gamepad-navigationshjรฆlper, som koster CPU i hvert spil. Kรธr proot uden seccomp Kan afhjรฆlpe fejl om manglende systemkald pรฅ nogle kerner. Kan reducere ydelsen. + Kรธr uden proot (eksperimentelt) + Starter Linux-delen direkte pรฅ Android. Gรฆlder fra nรฆste session. Slรฅ fra, hvis noget ikke kan starte. proot-hurtigvej + Bruges ikke uden proot. Krรฆver prootets seccomp-filter. Hurtigere filopslag og mindre hak. Slรฅ fra, hvis et program ikke kan finde sine filer. Tegn markรธren i gamescope @@ -683,6 +711,7 @@ Grafikhukommelse Swap-hukommelse Batteriniveau + Resterende batteritid Strรธmforbrug Netvรฆrk Oplรธsning @@ -809,6 +838,7 @@ Enhed understรธttet Utestet GPU GPU ikke understรธttet + GPU via Mali-broen %1$s ยท %2$s %1$s: %2$s Ingen kompatibel grafikbackend er tilgรฆngelig for %1$s. Steam kan vise en sort skรฆrm. @@ -838,15 +868,38 @@ Session Sessionslogs Gemt efter hver session + Udvidet diagnostik til nรฆste session + Indsamler detaljerede logfiler i รฉn session. Kan reducere ydeevnen og bruge mere lagerplads. Slรฅr sig selv fra, nรฅr sessionen starter; gennemgรฅ logfilerne, fรธr du deler dem. Fejlfindingslogs for spil Medtag Proton-, Wine- og grafikdiagnostik ved nรฆste spilstart. Kan reducere ydelsen og bruge mere lagerplads. Genstart denne session for at gemme fejlfindingslogs for spil Kunne ikke opdatere logning. Tjek kontakten, og prรธv igen. Fejlfindingsvรฆrktรธjer + Detaljerede grafiklogfiler + Steam-brugerflade: GPU-tegning + Med Xclipse-driverparret tegner Steam sine sider i software (GPU-tegning gav รธdelagte fliser). Slรฅ til for en hurtigere Steam-brugerflade, hvis det ser rigtigt ud pรฅ denne telefon. + bygget %1$s + %1$s er opdateret til den nyeste build + Mali-broen bestod ikke sin selvtest pรฅ %1$s i den forrige session (billeder eller tegninger), sรฅ sessionen brugte PanVK-driverparret i stedet. + Mali-broen fandt ingen mรฅde at dele hukommelse med driveren pรฅ %1$s i den forrige session, sรฅ sessionen brugte PanVK-driverparret i stedet. Broen kan ikke fungere pรฅ denne telefon; nรฅr den slรฅs fra, bevares PanVK-parret. + Proton-, DXVK- og driverlogfilerne for hvert spil findes i sessionens logfiler. Altid til, nรฅr GPU\'en ikke er en Adreno. Seneste sessionslogs Gemte sessionslogs Gemmer de nyeste %1$d Ryd logs + Tilgรฆngelige sessionslogfiler + Ingen gemte sessionslogfiler endnu. + Delte og gemte ZIP-filer indeholder den valgte session samt relaterede diagnostikdata for Steam, butikker, vรฆrktรธjer og Battle.net. + %1$s ยท %2$s + Aktuel session + Del + Gem pรฅ enheden + Slet + Slet sessionslogfiler? + Slet %1$s? Dette kan ikke fortrydes. + Sessionslogfilerne er gemt. + Kunne ikke gemme sessionslogfilerne. + Kunne ikke slette sessionslogfilerne. Nulstil alle indstillinger Sรฆt hver indstilling tilbage til standardvรฆrdien Nulstil @@ -873,6 +926,8 @@ Brug som startskรฆrm DroidDeck kan vรฆre Home-appen DroidDeck tilbydes aldrig som Home-app + Hjem-knappen รฅbner + Den side, der vises, nรฅr DroidDeck er startskรฆrmsappen og du trykker pรฅ Hjem I Tilfรธj spil skal du sรฆtte DroidDeck til Medtag Retning Launcherens retning @@ -886,15 +941,22 @@ Fuldskรฆrm Skjuler Androids status- og navigationsbjรฆlker Viser Androids status- og navigationsbjรฆlker + Launcher til to skรฆrme + Automatisk placerer launcherens sektioner (Steam, Bibliotek, Butikker og resten) pรฅ den anden skรฆrm pรฅ hรฅndholdte enheder med en indbygget anden skรฆrm. Til bruger enhver ekstra skรฆrm. Fra holder launcheren pรฅ รฉn skรฆrm. + Sessioner pรฅ to skรฆrme + Automatisk fastgรธr spilmenuen pรฅ den indbyggede anden skรฆrm i stedet for et pop-up-vindue. Til bruger enhver ekstra skรฆrm. Fra holder menuen pรฅ spilskรฆrmen; du kan stadig vรฆlge en anden skรฆrm fra menuen. Automatisk Til Fra Kontroller pรฅ nederste skรฆrm i spil + Android-tastatur til tekstfelter ร…bner pegefeltet og tastaturet pรฅ den anden skรฆrm, nรฅr en session starter. Skriver til den รธverste skรฆrm Fรฆrdig Standard Home-app Vรฆlg en Home-app + Skjul launcheren fra Seneste apps, mens den er inaktiv + Gรฆlder kun, nรฅr DroidDeck er standardappen til startskรฆrmen og ingen session kรธrer. Vรฆlg Linux-apps (beta) Filer @@ -1006,9 +1068,172 @@ Preview Nyeste rettelser, fรธr Stable Opdateret + Kopiรฉr builddetaljer + Builddetaljer kopieret + Foran Preview + Du er foran Preview + Dette build er nyere end det seneste Preview. Det nรฆste Preview-build opdaterer det. + Vรฆlg et build for at se รฆndringerne eller installere det. + Installeret + Installรฉr dette build%1$s + Gรฅ tilbage til dette build%1$s + versionCode %1$d + Commit %1$s + Udgivelsesside + PR\'en har et nyere commit (%1$s). Dens testbuild er ikke klar endnu, sรฅ dette indeholder det ikke. + Nyere commit sendt, build afventer + PR-nummer, titel eller forfatter + Intet testbuild passer + Skal bygges igen (versionCode %1$d) + Opdateringer af testbuilds + Nyt testbuild til PR #%1$d + %1$s. ร…bn Opdateringer for at installere det. + Vis flere (%1$d) + Skal bygges igen til versionCode %2$d (%1$d) + Preview-builds pรฅ main siden dette testbuild: %1$d Testbuilds Prรธv en rettelse, fรธr den udgives Ingen lige nu + Lab-build + Lab-builds + I brug + Sat pรฅ pause, efter at Android genoptimerede DroidDeck + Ikke indlรฆst: %1$s + Venter pรฅ genstart + Beholdt + Til en anden version + Genbyg + Sletter denne build fra enheden + Genstart med den + Slรฅ fra + Brug + Slet + Slet nu + Kunne ikke forberede genstarten: %1$s. Par trรฅdlรธs fejlfinding i Opsรฆtning, og prรธv igen. + Lab-build installeret + DroidDeck er genstartet med %1$s + Lab-build sat pรฅ pause + Android har genoptimeret DroidDeck, sรฅ %1$s ikke er indlรฆst. ร…bn Opdateringer for at genstarte pรฅ den. + Lab-build slรฅet fra + Den blev bygget til en anden version af DroidDeck. Den ligger stadig i Opdateringer. + DroidDeck startede ikke pรฅ den to gange + Agent + Agent + Agenten arbejder + Installer Claude Code i Linux-brugermiljรธet for at bruge agenten. + Spรธrg om et spil, et nedbrud eller en รฆndring af DroidDeck + Send + Ny samtale + Stop + Lagring + Fjern + Fjern nu + Claude Code + Codex + DroidDeck-kildekode + Downloadcacher + ร†ndringer, der ikke er pushet, gรฅr tabt + Nรฅr der bygges, hentes de igen + Opsรฆtningen kan installere det igen; logins bevares + DroidDeck er genstartet pรฅ din Lab-build. Fortsรฆt, hvor du slap. + Spรธrg, hvorfor et spil ikke starter, bed om en forklaring pรฅ en log, eller fรฅ den til at รฆndre DroidDeck og prรธve รฆndringen pรฅ denne enhed. + Fejl: %1$s + %1$s sluttede (afslutningskode %2$d) + Stoppet + Afsluttet uden svar + Prรธv igen + Sรฆtter agenten op + Genopbyg min Lab-build %1$s til den installerede version af DroidDeck, og genstart pรฅ den. + %1$s ind ยท %2$s ud + Tรฆnker + Tankegang + Tรฆnker ยท %1$s + %1$s ยท %2$s + INPUT + OUTPUT + Kรธrerโ€ฆ + Intet resultat: turen sluttede fรธrst + Intet output + Skriv for at sรฆtte den nรฆste besked i kรธ + Sรฆt i kรธ + Nรฆste: %1$s + Send ikke + Vedhรฆft + Fjern + Standard + Rรฆsonneringsindsats + Gรฅ i gang + Revider + Intet รฆndret endnu + Gรฅ i gang med planen. + Send nu + Mere + Luk + Seneste + Arbejder + Kontekst + %1$s af %2$s + Denne samtale ยท %1$s + Forbruget vises efter det fรธrste svar + %1$d-timers grรฆnse + %1$d-minutters grรฆnse + Ugentlig grรฆnse + %1$d%% ยท nulstilles %2$s + + %1$d fil + %1$d filer + + Planlรฆg fรธrst + Plan + Foreslรฅr en plan uden at รฆndre noget + Samtaler + Ingen samtaler endnu + Lige nu + Slet + Sletter den og dens vedhรฆftede filer + Processer + Intet kรธrer i Linux-brugerrummet + AGENT + Stop + Lab-build + Forbereder Lab-builds + %1$d%% ยท ca. %2$s tilbage + ca. %1$s tilbage + Annuller + Annuller build + Starter + %1$d%% + Pakker + Genstarter DroidDeck pรฅ den + Fรฆrdig + Mislykkedes: %1$s + Sรฆt agenten op + Installer Linux-runtime i Opsรฆtning fรธrst. + Prรธv igen + Begynd at chatte + Enhedsforbindelse + Trรฅdlรธs fejlfinding, sรฅ agenten kan se og styre DroidDeck + Installer %1$s + I Linux-brugerrummet, med git, gh og adb + Log ind pรฅ %1$s + ร…bner din browser + GitHub + Valgfrit, til at รฅbne pull requests + Byggevรฆrktรธjer + Valgfrit, til Lab-builds pรฅ denne enhed ยท ca. 5 GB + Agent klar + Fuldfรธr opsรฆtningen af agenten + Logget ind pรฅ %1$s + Lab-builds + hurtige builds + Hurtige Lab-builds + Kompilerer denne version pรฅ forhรฅnd, sรฅ Lab-builds tager minutter ยท ca. 20 minutter รฉn gang + Kompilerer ยท %1$d%% ยท ca. %2$s tilbage + Forbered + Trรฅdlรธs fejlfinding kan ikke nรฅs; Par slรฅr den til + Par + Installer + Log ind PR #%1$d Ikke bygget til denne kopi af DroidDeck Opdateret %1$s @@ -1248,6 +1473,9 @@ Apps Opsรฆtning Opdateringer + Mere + Rediger faner + Faner %1$d%% Genoptag %1$s Vises som /root/ROMs i hver session. Intern lagerplads er pรฅ /root/Storage. @@ -1269,6 +1497,15 @@ Annuller afventende Android-tastatur Skjul โœ• + Stรธrrelse pรฅ skรฆrmen + Den del af skรฆrmen, tastaturet fylder, inklusive header. + Uigennemsigtighed + Sรฆnk den for at se spillet bag tastaturet. + Skjulte taster + Taster, du sjรฆldent bruger, vises ikke pรฅ tastaturet. + Esc og funktionsrรฆkken + Ins / Del / Home / End / PgUp / PgDn + Piletaster Start %1$s Vรฆlg en skรฆrm. Sekundรฆr: %1$s. Den sekundรฆre skรฆrm er ikke lรฆngere tilgรฆngelig. @@ -1770,7 +2007,24 @@ Terminal Deck-greb + trackpads Dashboard + Skrivebord + Start skrivebordet + Skrivebord ยท %1$s + Pegefelt + Direkte berรธring + Pegefelt. Tryk for direkte berรธring + Direkte berรธring. Tryk for pegefelt + Starter KDE-skrivebordetโ€ฆ + Skrivebordet blev lukket. + Skrivebordet kunne ikke starte. Logfilerne findes i denne sessions bottom-desktop-mappe. + Skrivebordet er lukket. Intet at vise her endnu. + Byt skรฆrme + Den nederste skรฆrm er ikke ledig lige nu + Spilskรฆrm + Vis spillet pรฅ + ร˜verste skรฆrm + Nederste skรฆrm Downloads Ingen downloads i gang. Steam @@ -1805,6 +2059,20 @@ Brรฆndstof, t Hoved %1$s t Reserve %1$s t + Billedtid + sidste %1$d s + gns. billede + 1 % low + billeder over 33 ms + %1$d / min + Spillet i %1$s + %1$d kerner, op til %2$s GHz + %1$d kerner + spil + FPS af %1$d Hz + Det rรธde mรฆrke angiver, hvor HUD viser temperaturen i rรธdt. + hele enheden + batteri Send instrumentbrรฆtdata Auto Slรฅr det til for alle spil pรฅ listen her, ogsรฅ spil, der findes senere. Spil, du slรฅr fra, forbliver slรฅet fra. @@ -1828,6 +2096,10 @@ Mikrofonen er slรฅet fra for dette spil. For at tale skal du slรฅ Mikrofon til i DroidDecks Steam-indstillinger (Lyd) og starte spillet igen. Lydstyrke %1$d%% Statistik i spillet + HUD pรฅ nederste skรฆrm + Stribe pรฅ alle faner + 1 % og 0,1 % lows + CPU-temperatur FPS CPU GPU @@ -2000,6 +2272,7 @@ Starter sessionenโ€ฆ %1$d:%2$02d forlรธbet ยท arbejder stadig Downloader Steam-klientopdateringen ยท %1$d%% + Anvender Steam-klientopdateringenโ€ฆ Downloader Steam-klienten ยท %1$s En installation af et kompatibilitetsvรฆrktรธj er allerede i gang @@ -2076,11 +2349,29 @@ Toon-konturer plus skรฆrpning. Ikke en Adreno-GPU + System-PowerVR-driver: Kompatibiliteten varierer afhรฆngigt af enheden + Eksperimentelt: RADV eller systemets Xclipse-driver + System-PowerVR + Bruger de indbyggede drivere til denne GPU + Systemets PowerVR-driver er valgt til runtime og skรฆrm. + Ingen รฅben driver understรธtter denne Mali endnu: Mali-broen er slรฅet til. + Dette er testbuildet til ikke-Snapdragon: de officielle builds her kรธrer kun pรฅ Adreno, sรฅ de installeres ikke oven pรฅ det. Nye testbuilds findes pรฅ github.com/The412Banner/droiddeck-nonadreno-drivers. + Den sidste session sluttede, fordi Android lukkede DroidDeck for at frigรธre hukommelse, ikke pรฅ grund af et nedbrud. Luk andre apps, eller sรฆnk spillets teksturindstillinger, og prรธv igen. + Mali (Venus) + Mali-broen + Ingen รฅben driver understรธtter denne Mali endnu: %1$s bruges oven pรฅ telefonens egen driver. + %1$s er ikke udgivet endnu: %2$s bruges indtil da. + %1$s er ikke tilgรฆngelig, og telefonens driver rapporterer Vulkan %2$s (Venus krรฆver 1.2): Mali-broen bruges. + %1$s er ikke udgivet endnu: Mali-broen er slรฅet til indtil da. + I kรธ: %1$s (venter pรฅ en anden runtime-driver) + DXVK leveres af systemets PowerVR-runtime. Andre DXVK-pakker kan gemmes, men bliver ikke anvendt med denne driver. Understรธttet Eksperimentel: dens drivere er testversioner Eksperimentel Adreno 850-understรธttelse: krรฆver kompatible eksperimentelle skรฆrm- og spildrivere; ikke bekrรฆftet pรฅ denne enhed Under testet hardware (Adreno 725 og nyere): kรธrer muligvis ikke Understรธttes ikke: ingen kompatibel grafikbackend er tilgรฆngelig for denne GPU + Kรธrer via Mali-broen pรฅ telefonens egen Vulkan-driver + Understรธttes ikke, nรฅr Mali-broen er slรฅet fra: Turnip krรฆver en Adreno-GPU (Snapdragon) GitHubs hastighedsgrรฆnse blev nรฅet - forsรธg igen senere GitHub svarede HTTP %1$d @@ -2189,7 +2480,6 @@ Butikker Steam Brugerdefineret - Butikker Downloadhastighed Afbalanceret Hurtig @@ -2228,6 +2518,7 @@ Venter pรฅ den anden Battle.net-downloadโ€ฆ ร…bn Battle.net, og log ind รฉn gang, og installer derefter dets spil herfra. Blizzards downloader stoppede: %1$s + Blizzards downloader holdt op med at gรธre fremskridt. Blizzard-fejl %1$s Opdater Blizzard-spil @@ -2235,6 +2526,7 @@ Afbrudt Installation ยท %1$s Fรฅ gratis + Fรธjer til biblioteketโ€ฆ Se pรฅ %1$s Kรธb ยท %1$s Installeret @@ -2281,6 +2573,12 @@ Sortรฉr Sidepanelets etiketter Vis navne under ikonerne i sidepanelet. Slรฅ fra for et smallere sidepanel. + Agentkรฆledyr + DeeDee svรฆver over launcheren og spil og viser, hvad agenten laver. + Over andre apps + Lad DeeDee svรฆve over alle apps og รฅbne chatten der + Tillad + Chat med DeeDee Visning Stรธrre kort Mindre kort @@ -2565,7 +2863,14 @@ %1$s ยท krรฆver genstart Denne enhed Fjern %1$s? - Diagnostik + Udvikler + Vandmรฆrke med buildmรฆrkat + Vis mรฆrkatet for test- eller Lab-builden pรฅ skรฆrmen. Aktiveret som standard. + Del diagnostikpakker + Session og enhed + Grafik + Spil og kompatibilitet + Alle pakker Klar til at spille Ikke klar til at spille endnu runtime %1$s @@ -2604,6 +2909,9 @@ Aktivรฉr GOG-bedrifter i Butik-indstillinger Bedrifter ikke tilgรฆngelige; se sessionslogs Bedrift lรฅst op + Mali (Venus): fra + Mali (Venus): til + Driveren pรฅ %1$s rapporterer Vulkan %2$s. Mali (Venus) krรฆver Vulkan 1.2 eller nyere (gamescope starter ikke pรฅ รฆldre), sรฅ sessioner springer Venus over og bruger PanVK-driverparret i stedet. Indsรฆt Venstre stick Hรธjre stick @@ -2890,7 +3198,7 @@ Vรฆlg mappeโ€ฆ Brug en hvilken som helst mappe pรฅ et SD-kort eller USB-drev Spil placeres i en Games-mappe pรฅ den valgte placering. Eksisterende spil flyttes ikke. - Hvor det ender + Hvad bruger plads Steam-spil Spildata Prรฆfikser %1$s ยท workshop %2$s ยท shaders %3$s @@ -2959,6 +3267,7 @@ VC++- og DirectX-installationer, som spil krรฆver Kรธrer Linux x86-spil Steam-vรฆrktรธj + Steam downloader dette til spil, der leveres med anti-cheat, selv nรฅr det er slรฅet fra. Fjernes det, gรฅr installationen i stรฅ pรฅ 0 % DroidDeck kรธrer spil uden dette kรธrselsmiljรธ Proton x86, som DroidDeck ikke kan kรธre Standard for alle spil @@ -3022,6 +3331,19 @@ Bevares Ikke-Steam-spil og delt Steam-prรฆfiks Prรฆfikser for spil tilfรธjet via butikker eller manuelt + Steams delte prรฆfiks + Steam kรธrer sine egne Windows-hjรฆlpere her + Sletter det (%1$s). Steam opretter et nyt, nรฆste gang det skal bruges. + En butiksapp og de spil, der kรธrer med den + Bruges af %1$s + Ikke-Steam-spil %1$s + Ikke knyttet til et spil, sรฅ det bevares + Fjern valgte ยท %1$s + Afinstaller valgte ยท %1$s + Wine-prefixer + Gemte spil og indstillinger i dem gรฅr tabt; Steam Cloud-gemninger forbliver pรฅ din konto. + Shadercacher + Prรฆfiks %1$s ยท shaders %2$s Hentede pakker Bevarede originaler Ingen komponentpakker hentet. @@ -3056,6 +3378,8 @@ DroidDeck ยท %1$d fps 60 fps ser mere flydende ud, men bruger mere CPU, mens Steam starter. En video valgt i Steams egne indstillinger vises ogsรฅ her. Lyd + Spring opstartsfilmen over + Brug et sort klip pรฅ 0,1 sekund som opstartsfilm i Steam. Gรฆlder fra nรฆste session. Din egen video MP4, MOV, MKV eller WebM. Andre formater og filer over %1$d MB konverteres til 720p-WebM pรฅ enheden, op til %2$d sekunder. Importรฉr @@ -3517,6 +3841,7 @@ Holder Alt+Tab, Win-tasten og Hjem-knappen i en aktiv DroidDeck-session i stedet for Android. Slรฅ Lysstyrke til under Opsรฆtning โ†’ Steam-integration Mali-bro: fra + %1$s kan ikke bruge Mali-broen (den krรฆver en Mali-GPU uden en rute gennem systemdriveren), sรฅ denne kontakt har ingen virkning her. Mali-bro: til %1$s er ikke en Adreno. Den eksperimentelle Vulkan-bro er slรฅet til: sessionen tegner gennem telefonens egen driver. Forvent fejl; send sessionslogfilerne. Sikker tilstand @@ -3542,6 +3867,25 @@ Flyt senere Widgetindstillinger Fjern widget + Udseende + Ikonpakke + Systemstandard + Baggrund i appens farve + Ikonstรธrrelse + Lille + Mellem + Stor + Skjul appnavne + Afstand + Tรฆt + Normal + Luftig + Skift ikon + Nulstil ikon + Sรธg efter ikoner + Indlรฆser ikonerโ€ฆ + Ingen ikoner fundet. + Brugerdefinerede ikoner Fรธj til mappe Ny mappe Fjern fra mappe @@ -3657,5 +4001,81 @@ Dette layout kunne ikke importeres Skarlagensne + Hvide overflader med rรธde accenter. + Soundtracks + Musik + Afspilningsindstillinger + Favoritter + Samlinger + Ingen samlinger endnu. Tryk pรฅ bogmรฆrkeikonet for at oprette en. + Gemt + Opret en samling + Organiser dine gemte numre + Ny + Opret + Navn pรฅ samling + Angiv et navn, som ingen anden samling bruger + Administrer + Omdรธb + Tilfรธj numre + Tilfรธj (%1$d) + Fjern numre + Slet samling + Slet %1$s? + Numrene bliver pรฅ din enhed. Kun samlingen fjernes. + Vรฆlg + Vรฆlg alle + Fravรฆlg alle + %1$d valgt + Fรธj til samling + Fรธj til favoritter + Fjern fra samling + Sรธg i numre + Albumrรฆkkefรธlge + Lรฆngste fรธrst + Korteste fรธrst + Numre + Tonehรธjde + Nulstil + Spring stilhed over + Sovetimer + %1$d min. + Slut pรฅ nummer + %1$s tilbage + Equalizer + Bassforstรฆrkning + Equalizeren er ikke tilgรฆngelig pรฅ denne enhed + Aktivรฉr i spil + Lad soundtracket spille, mens et spil kรธrer + Ingen soundtracks installeret endnu. + Sรธg i soundtracks + Tilfรธj en soundtrack-mappe + Ingen lydfiler i den mappe + Samlet lรฆngde + %1$d numre / %2$s + Disk %1$s + Bland + Forrige + Afspil + Pause + Nรฆste + Gentag fra + Gentag alle + Gentag รฉn + Lydstyrke + Ingen lydfiler i dette soundtrack + Start er ikke tilgรฆngelig + Der er ingen tilgรฆngelig webbrowser til at รฅbne dette link. + Tag + Slip + Gem + Hold for at nulstille + Butikker + Billedtid + Gennemsnitlig billedhastighed + Visningsserver + HDR-status + Vist + %1$d af %2$d diff --git a/app/src/main/res/values-de/input_library.xml b/app/src/main/res/values-de/input_library.xml new file mode 100644 index 0000000000..8ba2b07f50 --- /dev/null +++ b/app/src/main/res/values-de/input_library.xml @@ -0,0 +1,132 @@ + + + Der gewรคhlte Bildschirm ist nicht verfรผgbar. Verbinden Sie ihn, um dieses Layout in seiner tatsรคchlichen GrรถรŸe zu bearbeiten. + Nicht gespeicherte Layoutรคnderungen verwerfen? + Dieses Layout wird von %1$d Profilen verwendet. Gespeicherte ร„nderungen gelten fรผr alle. + Standardprofile + Desktop-Modus + Spielmodus + Standard fรผr Desktop und Spiel + Standard fรผr den Spielmodus + Standard fรผr den Desktop-Modus + Gerรคteeinstellungen + Steuerung + Tasten, Sticks, Trigger und Zusatztasten + Profil kopieren + Aktionen zurรผcksetzen + Aktionen in %1$s auf die Standardwerte des Basisprofils zurรผcksetzen? Layouts und andere Profile bleiben unverรคndert. + %1$s lรถschen? Modi, die es verwenden, kehren zu ihrem integrierten Standardprofil zurรผck. Gespeicherte Layouts und geteilte Einstellungen bleiben verfรผgbar. + Sichtbarkeit + Gilt fรผr alle Profile. Auto zeigt die Hauptbildschirm-Steuerung, wenn im Spielmodus kein Controller angeschlossen ist. + Auf dem Bildschirm bearbeiten + Gespeicherte Layoutsโ€ฆ + Wรคhlen Sie ein Layout oder erstellen Sie ein eigenes + Wรคhlen Sie Profilsteuerung im Sitzungsmenรผ des Zweitbildschirms. Die Auswahl von Profil und Zweitbildschirm im Controller-Menรผ bestimmt die angezeigte Steuerung. + Tastenaktionen + Geteilt mit %1$s. ร„nderungen gelten auch fรผr diese Profile. + Einstellungen wiederverwenden + Einstellungen รผbernehmen vonโ€ฆ + Von einem anderen Profil kopieren oder Einstellungen geteilt lassen + Unabhรคngig machen + Aktuelle Einrichtung behalten und ร„nderungen nicht mehr teilen + Layouts speichern Elemente und ihre Positionen. Jedes Profil kann eigene Aktionen zuweisen. In voller GrรถรŸe auf dem Zielbildschirm bearbeiten. + Aktuelles Layout + Das ungenutzte Layout %1$s und seine gespeicherten Aktionen lรถschen? + Aktuelles Layout umbenennen + Unlesbare Eingabeeinstellungen wurden in einer Wiederherstellungskopie gesichert. Sie kรถnnen die wiederhergestellten Profile weiter bearbeiten. + Eigenschaften + Eigenschaften fรผr Klick + %1$s ยท Klick + Tasten + Sticks, Pads und Trigger + Werkzeuge ausblenden + Controller + Controller-Eingaben an Steam Input oder das Spiel senden. + Dieses Element sendet keine Controller-, Maus- oder Tastatureingaben. + Mausklick + DroidDeck-Aktion + Aktion + Scrollgeschwindigkeit: %1$d Schritte/s + + Neues Profil + + Neues Layout + %1$s ยท Wird von %2$d Profilen verwendet. ร„nderungen gelten fรผr jedes Profil mit diesen Zuweisungen. + Umbenennen + Lรถschen + Fรผgen Sie Elemente zum Layout hinzu, bevor Sie ihre Aktionen zuweisen. + Eingabeeinstellungen konnten nicht gespeichert werden + Name + Beginnen mit + Taste + Stick + Touchpad + Steuerkreuz + Trigger + Fertig + Rรผckgรคngig + + Hinzufรผgen + Zum Verschieben ziehen. An einer Ecke ziehen zum GrรถรŸe รคndern. Auf Eigenschaften tippen, um eine Aktion zuzuweisen. + Bearbeitung auf dem Zweitbildschirm + %1$s von einem anderen Profil wiederverwenden. Die anderen Steuerungsquellen bleiben unverรคndert. + Physische Steuerung geteilt lassen + StandardmรครŸig sind alle Steuerungen und benutzerdefinierten Layouts unabhรคngige Kopien. Teilen verknรผpft nur die physische Steuerung. + Diese Elemente und Positionen verwenden. Teilen synchronisiert kรผnftige Geometrieรคnderungen; deine Tastenaktionen bleiben unabhรคngig. Ein anderes Layout beginnt mit nicht zugewiesenen Aktionen. + Diese Steuerungen und Aktionen kopieren oder verknรผpfen, sodass kรผnftige ร„nderungen fรผr beide Profile gelten. + Geteilt lassen + Unabhรคngige Kopie + Stick an der Berรผhrungsstelle starten + Stick ausblenden, wenn nicht benutzt + Werkzeuge + Auto (%1$s) + Benutzerdefiniert (%1$s) + Als neues Profil speichern + Profilsteuerung + Profil + Maus-Touchpad-Gesten + Wenn dem Mauszeiger zugewiesen: Tippen zum Klicken, Halten zum Ziehen, mit zwei Fingern scrollen. + %1$s hat eine Schnellmenรผ-รœberschreibung. Wรคhle dort Auto, um sein Standardprofil und alle drei gespeicherten Teile zu verwenden. + DroidDeck Input + Gehalten, wรคhrend der Stick in eine beliebige Richtung bewegt wird: drรผcken รผber 55 %, loslassen unter 35 %. Mit Richtungstasten jede Richtung einzeln zuweisen. DroidDeck-Aktionen laufen einmal pro Ausschlag. Der Stick-Klick wird separat konfiguriert. + Gehalten, wรคhrend das Touchpad berรผhrt wird; losgelassen beim Abheben des Fingers. DroidDeck-Aktionen laufen einmal pro Berรผhrung. Der Touchpad-Klick wird separat konfiguriert. + Gehalten, wenn der Trigger 55 % รผberschreitet; losgelassen unter 35 %. DroidDeck-Aktionen laufen einmal pro Druck. + Scrollrichtung + Vertikal + Horizontal + Horizontal scrollen + Messwerte + Aktiviere die Aufzeichnung, benutze die Steuerung in einer laufenden Sitzung und lies dann die Ergebnisse. Misst nur die DroidDeck-Dispatch-Zeit, nicht die Anzeigelatenz. Die Aufzeichnung endet beim SchlieรŸen des App-Prozesses. + %1$d Steuerelemente + Andere gespeicherte Layouts (%1$d) โ–พ + Andere gespeicherte Layouts ausblenden (%1$d) โ–ด + Home / Guide + Zurรผck ยท einmal tippen + Zurรผck ยท zweimal tippen + Zurรผck ยท zweimal in Steam, einmal im Desktop + Im Steam-Modus. Halten von Zurรผck รถffnet auch den Schnellzugriff. + Auf Standard zurรผcksetzen + Ihre Panel-Auswahl wird gespeichert. Desktop รถffnet einen zweiten Arbeitsbereich; es wechselt weder die Sitzung noch ihr Eingabeprofil. + Virtueller Controller + Der von Steam oder dem Spiel erkannte Controller-Typ. + Touchscreen + Wie Berรผhrungen auf dem Spielbildschirm behandelt werden. Profiltasten behalten ihre zugewiesenen Aktionen. + Touch-Cursor + Zeigt einen Zeiger fรผr direkte Berรผhrungen auf dem Spielbildschirm. + Berรผhren und halten + Mausaktion beim Halten eines Fingers auf dem Spielbildschirm. + Zurรผck-Taste tippen + Erste Aktion: einmal tippen. Zweite Aktion: zweimal tippen. + Umschalttaste + Tippen zum Halten, erneut tippen zum Loslassen. Das ร–ffnen eines Menรผs oder ein Profilwechsel lรคsst die Taste los. + Form + Abgerundet + Pille + Kreis + Rechteck + Tastenbezeichnung + Text + Importiertes Bild + Getrennte Diagonaltasten + Weisen Sie jeder Diagonale eine Taste zu. Eine leere Diagonale drรผckt ihre beiden Nachbarrichtungen. + Benachbarte Richtungen + Ihre alten Bildschirmtasten sind unten als importierte Profile gespeichert. Wรคhlen Sie eines zum Verwenden oder Bearbeiten. Ihre aktuellen Profilauswahlen bleiben erhalten. + Die alten Bildschirmtasten konnten nicht automatisch importiert werden. Die ursprรผnglichen Einstellungen wurden beibehalten. + diff --git a/app/src/main/res/values-de/input_strings.xml b/app/src/main/res/values-de/input_strings.xml new file mode 100644 index 0000000000..b37b9c2b71 --- /dev/null +++ b/app/src/main/res/values-de/input_strings.xml @@ -0,0 +1,38 @@ + + + Eingabeprofile + Profile + Physischer Controller + Hauptbildschirm + Zweitbildschirm + Nativ / Steam Input + Nativ: %1$s + Andere Controller-Steuerung senden + Deaktiviert + Taste oder Tastenkombination + Richtungstasten + Zeiger bewegen + Zeigergeschwindigkeit: %1$d + Scrollen + Vertikal scrollen + Linke Maustaste + Rechte Maustaste + Mittlere Maustaste + DroidDeck-Menรผ รถffnen + Tastatur anzeigen + Steam-Menรผ รถffnen + Steam-Schnellzugriff รถffnen + Steuerung entfernen + Steuerung hinzufรผgen + Gerรคtespezifische Tasten + Physische Taste zuweisen + Taste loslassen, dann Bearbeiten, Wiederholen oder Abbrechen wรคhlen. B oder Zurรผck bricht nach dem Loslassen ab. + Wiederholen + Taste drรผcken, auch eine als Tastaturtaste gemeldete Zurรผck-Taste. Lautstรคrke- und Android-Systemtasten sind reserviert. Die Zuweisung gilt nur fรผr dieses Gerรคt. + Zuweisung entfernen + Eingabediagnose + Eingabe-Dispatch-Zeit aufzeichnen + Messwerte lesen + Misst den Android-Dispatch bis zur Verรถffentlichung im vorhandenen Eingabetransport. Bluetooth-Ankunft, Gast-Polling, Rendering und Anzeigelatenz sind ausgenommen. Die Aufzeichnung ist standardmรครŸig aus. + Normale Eingabezuweisung verwenden + diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index ad656b8bb8..41e8e685eb 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -28,6 +28,8 @@ Jetzt anhalten Sitzung beenden Frame-Generierung + Einstellungen fรผr dieses Spiel + Standardeinstellungen Modus der Frame-Generierung auswรคhlen Aus DD-FG %1$dร— @@ -183,6 +185,7 @@ Die PowerVR-Grafikumgebung konnte nicht heruntergeladen werden. Prรผfe die Verbindung und versuch es erneut. DirectAudio konnte nicht heruntergeladen werden, daher nutzt der Spielton in dieser Sitzung den langsameren Weg. Dieses Programm + Die Sitzung konnte nicht auf den Bildschirm zeichnen: %1$s. Auf diesem Bildschirm sehen Sie den Grund statt eines schwarzen Bildschirms; die Details finden Sie in den Sitzungsprotokollen. Der Steam-Client konnte nicht heruntergeladen werden. Dein Netzwerk oder VPN blockiert mรถglicherweise die Server von Steam; prรผfe die Verbindung und versuche es erneut. Der Steam-Client konnte nicht eingerichtet werden. Prรผfe die Verbindung und den freien Speicher und versuche es erneut. %1$s ist fรผr x86-PCs gebaut und lรคuft รผber FEX, das noch nicht installiert ist. Starte Steam einmal, wรคhrend du angemeldet bist, und lass es FEX und die Steam Linux Runtime herunterladen. Starte es danach erneut. @@ -385,6 +388,9 @@ Hier noch nicht unterstรผtzt Komponenten werden geladenโ€ฆ Installation fehlgeschlagen: %1$s + Dieser Download benรถtigt ein Update. + Update in der Warteschlange. + Aktualisierung erneut versuchen Heruntergeladen %1$s wird heruntergeladen Wird installiert: %1$s @@ -415,6 +421,22 @@ Nur intern Ordner: %1$s Zweite Bibliothek + Weitere Steam-Bibliotheken + Ordner, in denen Steam Spiele installieren und von denen aus es sie starten kann, jeweils unter eigenem Namen. Beim Entfernen eines Ordners bleiben dessen Spiele auf dem Datentrรคger. + Bibliothek hinzufรผgen + Umbenennen + Bibliotheksname + Ordner fรผr die Bibliothek auswรคhlen + Hรถchstens %1$d hinzugefรผgte Bibliotheken + Dieser Ordner ist bereits eine Bibliothek oder liegt innerhalb einer + %1$s ยท nicht verfรผgbar + Gilt ab der nรคchsten Steam-Sitzung + Auf diesem Gerรคt gefunden ยท %1$s ยท %2$s + Hinzufรผgen + Bibliotheken im internen Speicher finden + Zugriff auf alle Dateien erlauben, damit DroidDeck Steam-Bibliotheken sehen kann, die andere Apps im internen Speicher ablegen + Zulassen + %1$s hinzugefรผgt, die Steam-Bibliothek im ausgewรคhlten Ordner Spiele, die Daten von der SD-Karte oder aus dem gemeinsamen Speicher streamen, kรถnnen ruckeln. Speicherdiagnose Zeichnet Zuweisungsergebnisse und stichprobenartige Speicher-Timings fรผr โ€žLogs teilenโ€œ auf. Kann Installationen verlangsamen, solange aktiv. Gilt ab der nรคchsten Sitzung. @@ -478,6 +500,7 @@ An Startet mit Steam Startet ohne Steam + Spielauflรถsung Einstellungen Einstellungen fรผr %1$s Standard @@ -565,6 +588,8 @@ Spielkerne Spielkerne Kerne fรผr Spiele. Sind alle ausgewรคhlt, verteilt Android frei. + Strom sparen bei stabilen Spielen + Lรคsst ein Spiel auf den langsameren Kernen laufen, solange es eine stabile Bildrate hรคlt, und gibt ihm seine รผblichen Kerne zurรผck, sobald es zurรผckfรคllt. Client-Oberflรคche Threaded GL Kann Steam-Menรผs reaktionsschneller machen. @@ -600,7 +625,10 @@ Deaktiviert Protons Gamepad-Navigationshilfe, die in jedem Spiel CPU-Leistung kostet. proot ohne seccomp ausfรผhren Kann Fehler wegen fehlender Syscalls auf manchen Kerneln beheben. Kann die Leistung mindern. + Ohne proot ausfรผhren (experimentell) + Startet die Linux-Umgebung direkt unter Android. Gilt ab der nรคchsten Sitzung. Bei Startproblemen deaktivieren. proot-Schnellpfad + Wird ohne proot nicht verwendet. Benรถtigt den seccomp-Filter von proot. Schnellere Dateisuche und weniger Ruckler. Deaktivieren, wenn ein Programm seine Dateien nicht findet. Zeiger in gamescope zeichnen @@ -683,6 +711,7 @@ Grafikspeicher Swap-Speicher Akkustand + Verbleibende Akkulaufzeit Leistungsaufnahme Netzwerk Auflรถsung @@ -809,6 +838,7 @@ Gerรคt unterstรผtzt Ungetestete GPU GPU nicht unterstรผtzt + GPU รผber die Mali-Bridge %1$s ยท %2$s %1$s: %2$s Fรผr %1$s ist kein kompatibles Grafik-Backend verfรผgbar. Steam zeigt mรถglicherweise einen schwarzen Bildschirm. @@ -838,15 +868,38 @@ Sitzung Sitzungslogs Nach jeder Sitzung gespeichert + Erweiterte Diagnose fรผr die nรคchste Sitzung + Zeichnet fรผr eine Sitzung detaillierte Protokolle auf. Kann die Leistung verringern und mehr Speicherplatz beanspruchen. Schaltet sich beim Start der Sitzung selbst ab; Protokolle vor dem Teilen prรผfen. Spiel-Debug-Logs Beim nรคchsten Spielstart Diagnosen von Proton, Wine und Grafik einschlieรŸen. Kann die Leistung mindern und mehr Speicher belegen. Starte diese Sitzung neu, um Spiel-Debug-Logs zu speichern Protokollierung konnte nicht aktualisiert werden. Prรผfe den Schalter und versuch es erneut. Debugging-Tools + Detaillierte Grafik-Protokolle + Steam-Oberflรคche: Zeichnen mit der GPU + Mit dem Xclipse-Treiberpaar zeichnet Steam seine Seiten per Software (Zeichnen mit der GPU zeigte fehlerhafte Kacheln). Fรผr eine schnellere Steam-Oberflรคche einschalten, wenn die Darstellung auf diesem Telefon stimmt. + erstellt am %1$s + %1$s auf den neuesten Build aktualisiert + Die Mali-Bridge hat ihren Selbsttest in der letzten Sitzung auf %1$s nicht bestanden (Bilder oder Zeichnungen), daher verwendete die Sitzung stattdessen das PanVK-Treiberpaar. + Die Mali-Bridge fand in der letzten Sitzung auf %1$s keinen Weg, Speicher mit dem Treiber zu teilen, daher verwendete die Sitzung stattdessen das PanVK-Treiberpaar. Die Bridge kann auf diesem Telefon nicht funktionieren; beim Ausschalten bleibt das PanVK-Paar aktiv. + Die Proton-, DXVK- und Treiberprotokolle jedes Spiels in den Protokollen der Sitzung. Immer aktiv, wenn die GPU kein Adreno ist. Neueste Sitzungslogs Gespeicherte Sitzungslogs Behรคlt die neuesten %1$d Logs lรถschen + Verfรผgbare Sitzungsprotokolle + Noch keine gespeicherten Sitzungsprotokolle. + Geteilte und gespeicherte ZIPs enthalten die ausgewรคhlte Sitzung sowie zugehรถrige Diagnosen von Steam, Store, Tools und Battle.net. + %1$s ยท %2$s + Aktuelle Sitzung + Teilen + Auf Gerรคt speichern + Lรถschen + Sitzungsprotokolle lรถschen? + %1$s lรถschen? Dies kann nicht rรผckgรคngig gemacht werden. + Sitzungsprotokolle gespeichert. + Sitzungsprotokolle konnten nicht gespeichert werden. + Sitzungsprotokolle konnten nicht gelรถscht werden. Offlinemodus Melde dich zuerst bei Steam an Launcher @@ -865,6 +918,8 @@ Als Startbildschirm verwenden DroidDeck kann die Startbildschirm-App sein DroidDeck wird nie als Startbildschirm-App angeboten + Home-Taste รถffnet + Die Seite, die beim Drรผcken von Home angezeigt wird, wenn DroidDeck die Start-App ist Stelle DroidDeck unter โ€žSpiele hinzufรผgenโ€œ auf โ€žEinschlieรŸenโ€œ Ausrichtung Launcher-Ausrichtung @@ -878,15 +933,22 @@ Vollbild Blendet die Status- und Navigationsleiste von Android aus Zeigt die Status- und Navigationsleiste von Android an + Dual-Screen-Launcher + Bei Automatisch liegen die Launcher-Bereiche (Steam, Bibliothek, Shops und die รผbrigen) auf dem zweiten Bildschirm von Handhelds mit integriertem zweitem Bildschirm. Ein nutzt einen beliebigen zweiten Bildschirm. Aus belรคsst den Launcher auf einem Bildschirm. + Dual-Screen-Sitzungen + Bei Automatisch wird das In-Game-Menรผ auf dem integrierten zweiten Bildschirm angedockt statt als Pop-over angezeigt. Ein nutzt einen beliebigen zweiten Bildschirm. Aus belรคsst das Menรผ auf dem Spielbildschirm; du kannst von dort weiterhin einen zweiten Bildschirm auswรคhlen. Automatisch Ein Aus Steuerung auf dem unteren Bildschirm in Spielen + Android-Tastatur fรผr Textfelder ร–ffnet beim Start einer Sitzung Trackpad und Tastatur auf dem zweiten Bildschirm. Eingabe fรผr den oberen Bildschirm Fertig Standard-Startbildschirm-App Startbildschirm-App auswรคhlen + Launcher im Leerlauf aus โ€žZuletzt verwendetโ€œ ausblenden + Gilt nur, wenn DroidDeck die Standard-Start-App ist und keine Sitzung lรคuft. Auswรคhlen Linux-Apps (Beta) Dateien @@ -998,9 +1060,172 @@ Vorschau Neueste Fixes, vor Stabil Aktuell + Build-Details kopieren + Build-Details kopiert + Vor der Vorschau + Du bist der Vorschau voraus + Dieser Build ist neuer als die neueste Vorschau. Der nรคchste Vorschau-Build aktualisiert ihn. + Wรคhle einen Build, um seine ร„nderungen zu sehen oder ihn zu installieren. + Installiert + Diesen Build installieren%1$s + Zu diesem Build zurรผck%1$s + versionCode %1$d + Commit %1$s + Release-Seite + Der PR hat einen neueren Commit (%1$s). Sein Test-Build ist noch nicht fertig, daher fehlt er in diesem. + Neuerer Commit, Build ausstehend + PR-Nummer, Titel oder Autor + Kein Test-Build passt + Muss neu gebaut werden (versionCode %1$d) + Test-Build-Updates + Neuer Test-Build fรผr PR #%1$d + %1$s. ร–ffne Updates, um ihn zu installieren. + Mehr anzeigen (%1$d) + Mรผssen fรผr versionCode %2$d neu gebaut werden (%1$d) + Vorschau-Builds auf main seit diesem Test-Build: %1$d Test-Builds Einen Fix vor dem Release ausprobieren Derzeit keine + Lab-Build + Lab-Builds + In Verwendung + Pausiert, nachdem Android DroidDeck neu optimiert hat + Nicht geladen: %1$s + Warten auf einen Neustart + Behalten + Fรผr eine andere Version + Neu erstellen + Lรถscht diesen Build vom Gerรคt + Damit neu starten + Deaktivieren + Verwenden + Lรถschen + Jetzt lรถschen + Neustart konnte nicht vorbereitet werden: %1$s. Kopple das drahtlose Debugging in der Einrichtung und versuche es erneut. + Lab-Build installiert + DroidDeck wurde mit %1$s neu gestartet + Lab-Build pausiert + Android hat DroidDeck neu optimiert, daher ist %1$s nicht geladen. ร–ffne Updates, um damit neu zu starten. + Lab-Build deaktiviert + Er wurde fรผr eine andere Version von DroidDeck erstellt. Er bleibt in Updates erhalten. + DroidDeck ist damit zweimal nicht gestartet + Agent + Agent + Agent arbeitet + Installiere Claude Code in der Linux-Umgebung, um den Agenten zu verwenden. + Frag nach einem Spiel, einem Absturz oder einer ร„nderung an DroidDeck + Senden + Neues Gesprรคch + Anhalten + Speicher + Entfernen + Jetzt entfernen + Claude Code + Codex + DroidDeck-Quellcode + Download-Caches + Nicht gepushte ร„nderungen gehen verloren + Builds laden diese erneut herunter + Das Setup kann es erneut installieren; Anmeldungen bleiben erhalten + DroidDeck wurde auf deinem Lab-Build neu gestartet. Mach dort weiter, wo du aufgehรถrt hast. + Frag, warum ein Spiel nicht startet, lass dir ein Log erklรคren oder รคndere DroidDeck und teste die ร„nderung auf diesem Gerรคt. + Fehlgeschlagen: %1$s + %1$s beendet (Exit-Code %2$d) + Angehalten + Ohne Antwort beendet + Erneut versuchen + Agent wird eingerichtet + Erstelle meinen Lab-Build %1$s fรผr die installierte Version von DroidDeck neu und starte darauf neu. + %1$s rein ยท %2$s raus + Denkt nach + Gedanke + Denkt nach ยท %1$s + %1$s ยท %2$s + EINGABE + AUSGABE + Wird ausgefรผhrtโ€ฆ + Kein Ergebnis: Der Durchlauf endete zuvor + Keine Ausgabe + Tippen, um die nรคchste Nachricht einzureihen + Einreihen + Als Nรคchstes: %1$s + Nicht senden + Anhรคngen + Entfernen + Standard + Denkaufwand + Ausfรผhren + รœberarbeiten + Noch nichts geรคndert + Fรผhre den Plan aus. + Jetzt senden + Mehr + SchlieรŸen + Neueste + Arbeitet + Kontext + %1$s von %2$s + Diese Unterhaltung ยท %1$s + Der Verbrauch wird nach der ersten Antwort angezeigt + %1$d-Stunden-Limit + %1$d-Minuten-Limit + Wรถchentliches Limit + %1$d%% ยท wird %2$s zurรผckgesetzt + + %1$d Datei + %1$d Dateien + + Zuerst planen + Plan + Schlรคgt einen Plan vor, ohne etwas zu รคndern + Unterhaltungen + Noch keine Unterhaltungen + Gerade eben + Lรถschen + Lรถscht sie und ihre Anhรคnge + Prozesse + Im Linux-Userland lรคuft nichts + AGENT + Beenden + Lab-Build + Lab-Builds werden vorbereitet + %1$d%% ยท noch etwa %2$s + noch etwa %1$s + Abbrechen + Build abbrechen + Wird gestartet + %1$d%% + Wird gepackt + DroidDeck wird darauf neu gestartet + Fertig + Fehlgeschlagen: %1$s + Agent einrichten + Installiere die Linux-Laufzeit zuerst in der Einrichtung. + Erneut versuchen + Chat starten + Gerรคteverbindung + Drahtloses Debugging, damit der Agent DroidDeck sehen und steuern kann + %1$s installieren + In das Linux-Userland, mit git, gh und adb + Bei %1$s anmelden + ร–ffnet deinen Browser + GitHub + Optional, um Pull Requests zu erstellen + Build-Tools + Optional, fรผr Lab-Builds auf diesem Gerรคt ยท etwa 5 GB + Agent bereit + Agent-Einrichtung abschlieรŸen + Bei %1$s angemeldet + Lab-Builds + schnelle Builds + Schnelle Lab-Builds + Kompiliert diese Version vorab, damit Lab-Builds nur Minuten dauern ยท einmalig etwa 20 Minuten + Kompilierung lรคuft ยท %1$d%% ยท noch etwa %2$s + Vorbereiten + Wireless-Debugging ist nicht erreichbar; Koppeln schaltet es ein + Koppeln + Installieren + Anmelden PR #%1$d Nicht fรผr diese Kopie von DroidDeck gebaut Aktualisiert: %1$s @@ -1240,6 +1465,9 @@ Apps Einrichtung Updates + Mehr + Tabs bearbeiten + Tabs %1$d %% %1$s fortsetzen Erscheint in jeder Sitzung als /root/ROMs. Der interne Speicher liegt unter /root/Storage. @@ -1261,6 +1489,15 @@ Vormerkung abbrechen Android-Tastatur Ausblenden โœ• + GrรถรŸe auf dem Bildschirm + Anteil des Bildschirms, den die Tastatur einnimmt, inklusive Kopfzeile. + Deckkraft + Verringern, um das Spiel hinter der Tastatur zu sehen. + Ausgeblendete Tasten + Tasten, die du selten nutzt, bleiben auf der Tastatur ausgeblendet. + Esc- und Funktionstastenreihe + Ins / Del / Home / End / PgUp / PgDn + Pfeiltasten %1$s starten Wรคhle einen Bildschirm. Zweitbildschirm: %1$s. Der Zweitbildschirm ist nicht mehr verfรผgbar. @@ -1762,7 +1999,24 @@ Terminal Deck-Griffe + Trackpads Dashboard + Desktop + Desktop starten + Desktop ยท %1$s + Trackpad + Direkte Berรผhrung + Trackpad. Fรผr direkte Berรผhrung tippen + Direkte Berรผhrung. Fรผr Trackpad tippen + KDE-Desktop wird gestartetโ€ฆ + Der Desktop wurde beendet. + Der Desktop konnte nicht gestartet werden. Die Protokolle liegen im Ordner bottom-desktop dieser Sitzung. + Der Desktop ist geschlossen. Hier gibt es noch nichts anzuzeigen. + Bildschirme tauschen + Der untere Bildschirm ist gerade nicht frei + Spielbildschirm + Spiel anzeigen auf + Oberer Bildschirm + Unterer Bildschirm Downloads Keine laufenden Downloads. Steam @@ -1797,6 +2051,20 @@ Treibstoff, t Haupttank %1$s t Reserve %1$s t + Framezeit + letzte %1$d s + ร˜ Frame + 1 % Low + Frames รผber 33 ms + %1$d / min + Spielzeit %1$s + %1$d Kerne, bis zu %2$s GHz + %1$d Kerne + Spiel + FPS bei %1$d Hz + Die rote Markierung kennzeichnet die Stelle, an der das HUD die Temperatur rot anzeigt. + ganzes Gerรคt + Akku Dashboard-Daten senden Automatisch Schaltet es fรผr jedes hier aufgefรผhrte Spiel ein, auch fรผr spรคter gefundene Spiele. Spiele, die du ausschaltest, bleiben aus. @@ -1820,6 +2088,10 @@ Das Mikro ist fรผr dieses Spiel aus. Um zu sprechen, aktiviere โ€žMikrofonโ€œ in den Steam-Einstellungen von DroidDeck (Audio) und starte das Spiel neu. Lautstรคrke %1$d%% Spielstatistiken + HUD fรผr den unteren Bildschirm + Leiste auf jedem Tab + 1 %- und 0,1 %-Lows + CPU-Temperatur FPS CPU GPU @@ -1992,6 +2264,7 @@ Sitzung wird gestartetโ€ฆ %1$d:%2$02d vergangen ยท lรคuft noch Update des Steam-Clients wird heruntergeladen ยท %1$d %% + Steam-Client-Update wird angewendetโ€ฆ Steam-Client wird heruntergeladen ยท %1$s Es lรคuft bereits die Installation eines Kompatibilitรคtstools @@ -2068,11 +2341,29 @@ Cartoon-Konturen plus Schรคrfung. Keine Adreno-GPU + System-PowerVR-Treiber: Kompatibilitรคt hรคngt vom Gerรคt ab + Experimentell: RADV oder der System-Xclipse-Treiber + System-PowerVR + Verwendet die integrierten Treiber fรผr diese GPU + Der System-PowerVR-Treiber ist fรผr Runtime und Anzeige ausgewรคhlt. + Fรผr dieses Mali gibt es noch keinen Open-Source-Treiber: Die Mali-Brรผcke ist aktiv. + Dies ist der Non-Snapdragon-Test-Build: Die offiziellen Builds hier laufen nur auf Adreno und werden deshalb nicht รผber diesen Build installiert. Neue Test-Builds gibt es auf github.com/The412Banner/droiddeck-nonadreno-drivers. + Die letzte Sitzung endete, weil Android DroidDeck beendet hat, um Speicher freizugeben, nicht wegen eines Absturzes. SchlieรŸe andere Apps oder senke die Textureinstellungen des Spiels und versuche es erneut. + Mali (Venus) + die Mali-Brรผcke + Fรผr dieses Mali gibt es noch keinen Open-Source-Treiber: %1$s wird mit dem gerรคteeigenen Treiber verwendet. + %1$s ist noch nicht verรถffentlicht: Bis dahin wird %2$s verwendet. + %1$s ist nicht verfรผgbar, und der Treiber dieses Telefons meldet Vulkan %2$s (Venus benรถtigt 1.2): Die Mali-Brรผcke wird verwendet. + %1$s ist noch nicht verรถffentlicht: Die Mali-Brรผcke bleibt bis dahin aktiviert. + In Warteschlange: %1$s (wartet auf einen anderen Runtime-Treiber) + DXVK wird von der PowerVR-Runtime des Systems bereitgestellt. Andere DXVK-Pakete kรถnnen zwar gespeichert, mit diesem Treiber aber nicht angewendet werden. Unterstรผtzt Experimentell: Die Treiber sind Test-Builds Experimentelle Adreno-850-Unterstรผtzung: erfordert kompatible experimentelle Anzeige- und Spieltreiber; auf diesem Gerรคt nicht geprรผft Unter der getesteten Hardware (Adreno 725 und neuer): lรคuft eventuell nicht Nicht unterstรผtzt: Fรผr diese GPU ist kein kompatibles Grafik-Backend verfรผgbar + Lรคuft รผber die Mali-Brรผcke mit dem eigenen Vulkan-Treiber des Telefons + Bei deaktivierter Mali-Brรผcke nicht unterstรผtzt: Turnip benรถtigt eine Adreno-GPU (Snapdragon) Das Rate-Limit von GitHub wurde erreicht - versuche es spรคter erneut GitHub antwortete mit HTTP %1$d @@ -2181,7 +2472,6 @@ Stores Steam Eigene - Stores Download-Tempo Ausgewogen Schnell @@ -2220,6 +2510,7 @@ Warten auf den anderen Battle.net-Downloadโ€ฆ ร–ffne Battle.net und melde dich einmal an, dann installiere seine Spiele hier. Blizzards Downloader wurde beendet: %1$s + Blizzards Downloader kommt nicht mehr voran. Blizzard-Fehler %1$s Aktualisieren Blizzard-Spiele @@ -2227,6 +2518,7 @@ Unterbrochen Installieren ยท %1$s Kostenlos erhalten + Wird zur Bibliothek hinzugefรผgtโ€ฆ Auf %1$s ansehen Kaufen ยท %1$s Installiert @@ -2273,6 +2565,12 @@ Sortieren Seitenleisten-Beschriftungen Namen unter den Symbolen der Seitenleiste anzeigen. Ausschalten fรผr eine schmalere Seitenleiste. + Agenten-Begleiter + DeeDee schwebt รผber dem Launcher und Spielen und zeigt, was der Agent gerade tut. + รœber anderen Apps + DeeDee รผber allen Apps schweben lassen und den Chat dort รถffnen + Erlauben + Mit DeeDee chatten Anzeige GrรถรŸere Karten Kleinere Karten @@ -2554,7 +2852,14 @@ %1$s ยท Neustart ausstehend Dieses Gerรคt %1$s entfernen? - Diagnose + Entwickler + Build-Kennzeichnung als Wasserzeichen + Kennzeichnung des Test- oder Lab-Builds auf dem Bildschirm anzeigen. StandardmรครŸig aktiviert. + Diagnose-Pakete teilen + Sitzung und Gerรคt + Grafik + Spiele und Kompatibilitรคt + Alle Pakete Bereit zum Spielen Noch nicht bereit zum Spielen Laufzeit %1$s @@ -2593,6 +2898,9 @@ Aktiviere GOG-Erfolge in den Store-Einstellungen Erfolge nicht verfรผgbar; Sitzungsprotokolle prรผfen Erfolg freigeschaltet + Mali (Venus): aus + Mali (Venus): ein + Der Treiber auf %1$s meldet Vulkan %2$s. Mali (Venus) benรถtigt Vulkan 1.2 oder neuer (gamescope startet mit รคlteren Versionen nicht), daher wird Venus in Sitzungen รผbersprungen und stattdessen das PanVK-Treiberpaar verwendet. Einfรผgen Linker Stick Rechter Stick @@ -2890,7 +3198,7 @@ Ordner auswรคhlenโ€ฆ Einen beliebigen Ordner auf einer SD-Karte oder einem USB-Laufwerk verwenden Spiele kommen in einen Games-Ordner am ausgewรคhlten Ort. Vorhandene Spiele werden nicht verschoben. - Belegung + Was Speicher belegt Steam-Spiele Spieldaten Prรคfixe %1$s ยท Workshop %2$s ยท Shader %3$s @@ -2959,6 +3267,7 @@ VC++- und DirectX-Installationsprogramme, die Spiele anfordern Linux-x86-Spiele ausfรผhren Steam-Werkzeuge + Steam lรคdt dies fรผr Spiele herunter, die Anti-Cheat mitliefern, selbst wenn Anti-Cheat deaktiviert ist. Wird es entfernt, bleibt die Installation dieser Spiele bei 0 % hรคngen DroidDeck fรผhrt Spiele ohne diese Laufzeit aus x86-Proton, das DroidDeck nicht ausfรผhren kann Standard fรผr alle Spiele @@ -3022,6 +3331,19 @@ Behalten Gemeinsame Prรคfixe von Nicht-Steam-Spielen und Steam Prรคfixe von Spielen aus Stores oder manuell hinzugefรผgter Spiele + Gemeinsames Prรคfix von Steam + Steam fรผhrt hier eigene Windows-Hilfsprogramme aus + Lรถscht es (%1$s). Steam erstellt ein neues, sobald es wieder eines braucht. + Eine Store-App und die Spiele, die damit laufen + Verwendet von %1$s + Nicht-Steam-Spiel %1$s + Keinem Spiel zugeordnet, daher bleibt es erhalten + Auswahl entfernen ยท %1$s + Auswahl deinstallieren ยท %1$s + Wine-Prรคfixe + Speicherstรคnde und Einstellungen darin gehen verloren; Steam-Cloud-Speicherstรคnde bleiben in deinem Konto. + Shader-Caches + Prรคfix %1$s ยท Shader %2$s Geladene Pakete Gesicherte Originale Keine geladenen Komponentenpakete. @@ -3056,6 +3378,8 @@ DroidDeck ยท %1$d fps 60 fps wirkt flรผssiger, braucht aber mehr CPU, wรคhrend Steam startet. Ein in Steam selbst gewรคhltes Video erscheint hier ebenfalls. Ton + Startvideo รผberspringen + Ein schwarzes Video von 0,1 Sekunden als Steam-Startvideo verwenden. Gilt ab der nรคchsten Sitzung. Eigenes Video MP4, MOV, MKV oder WebM. Andere Formate und Dateien รผber %1$d MB werden auf dem Gerรคt in 720p-WebM umgewandelt, bis %2$d Sekunden. Importieren @@ -3517,6 +3841,7 @@ Hรคlt Alt+Tab, die Win-Taste und die Home-Taste in einer aktiven DroidDeck-Sitzung statt bei Android. Aktiviere Helligkeit unter Einrichtung โ†’ Steam-Integration Mali-Brรผcke: aus + %1$s kann die Mali-Brรผcke nicht nutzen (sie benรถtigt eine Mali-GPU ohne Systemtreiber-Route), daher hat dieser Schalter hier keine Wirkung. Mali-Brรผcke: an %1$s ist kein Adreno. Die experimentelle Vulkan-Brรผcke ist an: Die Sitzung zeichnet รผber den eigenen Treiber des Telefons. Rechne mit Fehlern und sende die Sitzungsprotokolle. Sicherer Modus @@ -3542,6 +3867,25 @@ Nach hinten Widget-Einstellungen Widget entfernen + Darstellung + Symbolpaket + Systemstandard + Hintergrund in App-Farbe + SymbolgrรถรŸe + Klein + Mittel + GroรŸ + App-Namen ausblenden + Abstand + Eng + Normal + Weit + Symbol รคndern + Symbol zurรผcksetzen + Symbole suchen + Symbole werden geladenโ€ฆ + Keine Symbole gefunden. + Eigene Symbole Zu Ordner hinzufรผgen Neuer Ordner Aus Ordner entfernen @@ -3657,5 +4001,81 @@ Dieses Layout konnte nicht importiert werden Scharlachroter Schnee + WeiรŸe Oberflรคchen mit roten Akzenten. + Soundtracks + Musik + Wiedergabeoptionen + Favoriten + Sammlungen + Noch keine Sammlungen. Tippe auf das Lesezeichen-Symbol, um eine zu erstellen. + Gespeichert + Sammlung erstellen + Ordne deine gespeicherten Titel + Neu + Erstellen + Name der Sammlung + Gib einen Namen ein, den keine andere Sammlung verwendet + Verwalten + Umbenennen + Titel hinzufรผgen + Hinzufรผgen (%1$d) + Titel entfernen + Sammlung lรถschen + %1$s lรถschen? + Die Titel bleiben auf deinem Gerรคt. Nur die Sammlung wird entfernt. + Auswรคhlen + Alle auswรคhlen + Alle abwรคhlen + %1$d ausgewรคhlt + Zur Sammlung hinzufรผgen + Zu Favoriten hinzufรผgen + Aus Sammlung entfernen + Titel suchen + Albumreihenfolge + Lรคngste zuerst + Kรผrzeste zuerst + Titel + Tonhรถhe + Zurรผcksetzen + Stille รผberspringen + Schlaftimer + %1$d Min. + Ende des Titels + Noch %1$s + Equalizer + Bassverstรคrkung + Der Equalizer ist auf diesem Gerรคt nicht verfรผgbar + Im Spiel aktivieren + Soundtrack wรคhrend eines Spiels weiterspielen + Noch keine Soundtracks installiert. + Soundtracks durchsuchen + Soundtrack-Ordner hinzufรผgen + Keine Audiodateien in diesem Ordner + Gesamtlรคnge + %1$d Titel / %2$s + Disc %1$s + Zufรคllig + Zurรผck + Wiedergabe + Pause + Weiter + Wiederholen aus + Alle wiederholen + Titel wiederholen + Lautstรคrke + Keine Audiodateien in diesem Soundtrack + Start nicht verfรผgbar + Es ist kein Webbrowser verfรผgbar, um diesen Link zu รถffnen. + Greifen + Loslassen + Speichern + Halten zum Zurรผcksetzen + Stores + Frame-Zeit + Durchschnittliche Bildrate + Anzeigeserver + HDR-Status + Angezeigt + %1$d von %2$d diff --git a/app/src/main/res/values-el/input_library.xml b/app/src/main/res/values-el/input_library.xml new file mode 100644 index 0000000000..c9f40579e3 --- /dev/null +++ b/app/src/main/res/values-el/input_library.xml @@ -0,0 +1,132 @@ + + + ฮ— ฮตฯ€ฮนฮปฮตฮณฮผฮญฮฝฮท ฮฟฮธฯŒฮฝฮท ฮดฮตฮฝ ฮตฮฏฮฝฮฑฮน ฮดฮนฮฑฮธฮญฯƒฮนฮผฮท. ฮฃฯ…ฮฝฮดฮญฯƒฯ„ฮต ฯ„ฮทฮฝ ฮณฮนฮฑ ฮฝฮฑ ฮตฯ€ฮตฮพฮตฯฮณฮฑฯƒฯ„ฮตฮฏฯ„ฮต ฮฑฯ…ฯ„ฮฎ ฯ„ฮท ฮดฮนฮฌฯ„ฮฑฮพฮท ฯƒฯ„ฮฟ ฯ€ฯฮฑฮณฮผฮฑฯ„ฮนฮบฯŒ ฯ„ฮทฯ‚ ฮผฮญฮณฮตฮธฮฟฯ‚. + ฮ‘ฯ€ฯŒฯฯฮนฯˆฮท ฮผฮท ฮฑฯ€ฮฟฮธฮทฮบฮตฯ…ฮผฮญฮฝฯ‰ฮฝ ฮฑฮปฮปฮฑฮณฯŽฮฝ ฮดฮนฮฌฯ„ฮฑฮพฮทฯ‚; + ฮ‘ฯ…ฯ„ฮฎ ฮท ฮดฮนฮฌฯ„ฮฑฮพฮท ฯ‡ฯฮทฯƒฮนฮผฮฟฯ€ฮฟฮนฮตฮฏฯ„ฮฑฮน ฮฑฯ€ฯŒ %1$d ฯ€ฯฮฟฯ†ฮฏฮป. ฮŸฮน ฮฑฯ€ฮฟฮธฮทฮบฮตฯ…ฮผฮญฮฝฮตฯ‚ ฮฑฮปฮปฮฑฮณฮญฯ‚ ฮนฯƒฯ‡ฯฮฟฯ…ฮฝ ฮณฮนฮฑ ฯŒฮปฮฑ. + ฮ ฯฮฟฮตฯ€ฮนฮปฮตฮณฮผฮญฮฝฮฑ ฯ€ฯฮฟฯ†ฮฏฮป + ฮ›ฮตฮนฯ„ฮฟฯ…ฯฮณฮฏฮฑ ฮตฯ€ฮนฯ†ฮฌฮฝฮตฮนฮฑฯ‚ ฮตฯฮณฮฑฯƒฮฏฮฑฯ‚ + ฮ›ฮตฮนฯ„ฮฟฯ…ฯฮณฮฏฮฑ ฯ€ฮฑฮนฯ‡ฮฝฮนฮดฮนฮฟฯ + ฮ ฯฮฟฮตฯ€ฮนฮปฮฟฮณฮฎ ฮณฮนฮฑ ฮตฯ€ฮนฯ†ฮฌฮฝฮตฮนฮฑ ฮตฯฮณฮฑฯƒฮฏฮฑฯ‚ ฮบฮฑฮน ฯ€ฮฑฮนฯ‡ฮฝฮฏฮดฮน + ฮ ฯฮฟฮตฯ€ฮนฮปฮฟฮณฮฎ ฮณฮนฮฑ ฮปฮตฮนฯ„ฮฟฯ…ฯฮณฮฏฮฑ ฯ€ฮฑฮนฯ‡ฮฝฮนฮดฮนฮฟฯ + ฮ ฯฮฟฮตฯ€ฮนฮปฮฟฮณฮฎ ฮณฮนฮฑ ฮปฮตฮนฯ„ฮฟฯ…ฯฮณฮฏฮฑ ฮตฯ€ฮนฯ†ฮฌฮฝฮตฮนฮฑฯ‚ ฮตฯฮณฮฑฯƒฮฏฮฑฯ‚ + ฮกฯ…ฮธฮผฮฏฯƒฮตฮนฯ‚ ฯƒฯ…ฯƒฮบฮตฯ…ฮฎฯ‚ + ฮงฮตฮนฯฮนฯƒฯ„ฮฎฯฮนฮฑ + ฮšฮฟฯ…ฮผฯ€ฮนฮฌ, ฮผฮฟฯ‡ฮปฮฟฮฏ, ฯƒฮบฮฑฮฝฮดฮฌฮปฮตฯ‚ ฮบฮฑฮน ฮตฯ€ฮนฯ€ฮปฮญฮฟฮฝ ฯ€ฮปฮฎฮบฯ„ฯฮฑ + ฮ‘ฮฝฯ„ฮนฮณฯฮฑฯ†ฮฎ ฯ€ฯฮฟฯ†ฮฏฮป + ฮ•ฯ€ฮฑฮฝฮฑฯ†ฮฟฯฮฌ ฮตฮฝฮตฯฮณฮตฮนฯŽฮฝ + ฮ•ฯ€ฮฑฮฝฮฑฯ†ฮฟฯฮฌ ฯ„ฯ‰ฮฝ ฮตฮฝฮตฯฮณฮตฮนฯŽฮฝ ฯƒฯ„ฮฟ %1$s ฯƒฯ„ฮนฯ‚ ฯ€ฯฮฟฮตฯ€ฮนฮปฮฟฮณฮญฯ‚ ฯ„ฮฟฯ… ฮฒฮฑฯƒฮนฮบฮฟฯ ฯ€ฯฮฟฯ†ฮฏฮป; ฮŸฮน ฮดฮนฮฑฯ„ฮฌฮพฮตฮนฯ‚ ฮบฮฑฮน ฯ„ฮฑ ฮฌฮปฮปฮฑ ฯ€ฯฮฟฯ†ฮฏฮป ฯ€ฮฑฯฮฑฮผฮญฮฝฮฟฯ…ฮฝ ฮฏฮดฮนฮฑ. + ฮ”ฮนฮฑฮณฯฮฑฯ†ฮฎ ฯ„ฮฟฯ… %1$s; ฮŸฮน ฮปฮตฮนฯ„ฮฟฯ…ฯฮณฮฏฮตฯ‚ ฯ€ฮฟฯ… ฯ„ฮฟ ฯ‡ฯฮทฯƒฮนฮผฮฟฯ€ฮฟฮนฮฟฯฮฝ ฮตฯ€ฮนฯƒฯ„ฯฮญฯ†ฮฟฯ…ฮฝ ฯƒฯ„ฮฟ ฮตฮฝฯƒฯ‰ฮผฮฑฯ„ฯ‰ฮผฮญฮฝฮฟ ฯ€ฯฮฟฮตฯ€ฮนฮปฮตฮณฮผฮญฮฝฮฟ ฯ€ฯฮฟฯ†ฮฏฮป. ฮŸฮน ฮฑฯ€ฮฟฮธฮทฮบฮตฯ…ฮผฮญฮฝฮตฯ‚ ฮดฮนฮฑฯ„ฮฌฮพฮตฮนฯ‚ ฮบฮฑฮน ฮฟฮน ฮบฮฟฮนฮฝฮญฯ‚ ฯฯ…ฮธฮผฮฏฯƒฮตฮนฯ‚ ฯ€ฮฑฯฮฑฮผฮญฮฝฮฟฯ…ฮฝ ฮดฮนฮฑฮธฮญฯƒฮนฮผฮตฯ‚. + ฮŸฯฮฑฯ„ฯŒฯ„ฮทฯ„ฮฑ + ฮ™ฯƒฯ‡ฯฮตฮน ฮณฮนฮฑ ฯŒฮปฮฑ ฯ„ฮฑ ฯ€ฯฮฟฯ†ฮฏฮป. ฮคฮฟ Auto ฮตฮผฯ†ฮฑฮฝฮฏฮถฮตฮน ฯ„ฮฑ ฯ‡ฮตฮนฯฮนฯƒฯ„ฮฎฯฮนฮฑ ฯ„ฮทฯ‚ ฮบฯฯฮนฮฑฯ‚ ฮฟฮธฯŒฮฝฮทฯ‚ ฯŒฯ„ฮฑฮฝ ฮดฮตฮฝ ฮตฮฏฮฝฮฑฮน ฯƒฯ…ฮฝฮดฮตฮดฮตฮผฮญฮฝฮฟ ฯ‡ฮตฮนฯฮนฯƒฯ„ฮฎฯฮนฮฟ ฯƒฮต ฮปฮตฮนฯ„ฮฟฯ…ฯฮณฮฏฮฑ ฯ€ฮฑฮนฯ‡ฮฝฮนฮดฮนฮฟฯ. + ฮ•ฯ€ฮตฮพฮตฯฮณฮฑฯƒฮฏฮฑ ฯƒฯ„ฮทฮฝ ฮฟฮธฯŒฮฝฮท + ฮ‘ฯ€ฮฟฮธฮทฮบฮตฯ…ฮผฮญฮฝฮตฯ‚ ฮดฮนฮฑฯ„ฮฌฮพฮตฮนฯ‚โ€ฆ + ฮ•ฯ€ฮนฮปฮญฮพฯ„ฮต ฮดฮนฮฌฯ„ฮฑฮพฮท ฮฎ ฮดฮทฮผฮนฮฟฯ…ฯฮณฮฎฯƒฯ„ฮต ฯ„ฮท ฮดฮนฮบฮฎ ฯƒฮฑฯ‚ + ฮ•ฯ€ฮนฮปฮญฮพฯ„ฮต ฮงฮตฮนฯฮนฯƒฯ„ฮฎฯฮนฮฑ ฯ€ฯฮฟฯ†ฮฏฮป ฯƒฯ„ฮฟ ฮผฮตฮฝฮฟฯ ฯƒฯ…ฮฝฮตฮดฯฮฏฮฑฯ‚ ฯ„ฮทฯ‚ ฮดฮตฯ…ฯ„ฮตฯฮตฯฮฟฯ…ฯƒฮฑฯ‚ ฮฟฮธฯŒฮฝฮทฯ‚. ฮŸฮน ฮตฯ€ฮนฮปฮฟฮณฮตฮฏฯ‚ ฮ ฯฮฟฯ†ฮฏฮป ฮบฮฑฮน ฮ”ฮตฯ…ฯ„ฮตฯฮตฯฮฟฯ…ฯƒฮฑ ฮฟฮธฯŒฮฝฮท ฯƒฯ„ฮฟ ฮผฮตฮฝฮฟฯ ฯ‡ฮตฮนฯฮนฯƒฯ„ฮทฯฮฏฮฟฯ… ฮบฮฑฮธฮฟฯฮฏฮถฮฟฯ…ฮฝ ฯ€ฮฟฮนฮฑ ฯ‡ฮตฮนฯฮนฯƒฯ„ฮฎฯฮนฮฑ ฮตฮผฯ†ฮฑฮฝฮฏฮถฮฟฮฝฯ„ฮฑฮน. + ฮ•ฮฝฮญฯฮณฮตฮนฮตฯ‚ ฮบฮฟฯ…ฮผฯ€ฮนฯŽฮฝ + ฮšฮฟฮนฮฝฯŒฯ‡ฯฮทฯƒฯ„ฮฟ ฮผฮต %1$s. ฮŸฮน ฮฑฮปฮปฮฑฮณฮญฯ‚ ฮนฯƒฯ‡ฯฮฟฯ…ฮฝ ฮบฮฑฮน ฮณฮนฮฑ ฮฑฯ…ฯ„ฮฌ ฯ„ฮฑ ฯ€ฯฮฟฯ†ฮฏฮป. + ฮ•ฯ€ฮฑฮฝฮฑฯ‡ฯฮทฯƒฮนฮผฮฟฯ€ฮฟฮฏฮทฯƒฮท ฯฯ…ฮธฮผฮฏฯƒฮตฯ‰ฮฝ + ฮงฯฮฎฯƒฮท ฯฯ…ฮธฮผฮฏฯƒฮตฯ‰ฮฝ ฮฑฯ€ฯŒโ€ฆ + ฮ‘ฮฝฯ„ฮนฮณฯฮฑฯ†ฮฎ ฮฑฯ€ฯŒ ฮฌฮปฮปฮฟ ฯ€ฯฮฟฯ†ฮฏฮป ฮฎ ฮดฮนฮฑฯ„ฮฎฯฮทฯƒฮท ฮบฮฟฮนฮฝฯŽฮฝ ฯฯ…ฮธฮผฮฏฯƒฮตฯ‰ฮฝ + ฮ”ฮทฮผฮนฮฟฯ…ฯฮณฮฏฮฑ ฮฑฮฝฮตฮพฮฌฯฯ„ฮทฯ„ฮฟฯ… + ฮ”ฮนฮฑฯ„ฮฎฯฮทฯƒฮท ฯ„ฯฮญฯ‡ฮฟฯ…ฯƒฮฑฯ‚ ฯฯฮธฮผฮนฯƒฮทฯ‚ ฮบฮฑฮน ฮดฮนฮฑฮบฮฟฯ€ฮฎ ฮบฮฟฮนฮฝฮฎฯ‚ ฯ‡ฯฮฎฯƒฮทฯ‚ ฮฑฮปฮปฮฑฮณฯŽฮฝ + ฮŸฮน ฮดฮนฮฑฯ„ฮฌฮพฮตฮนฯ‚ ฮฑฯ€ฮฟฮธฮทฮบฮตฯฮฟฯ…ฮฝ ฯƒฯ„ฮฟฮนฯ‡ฮตฮฏฮฑ ฮบฮฑฮน ฮธฮญฯƒฮตฮนฯ‚. ฮšฮฌฮธฮต ฯ€ฯฮฟฯ†ฮฏฮป ฮผฯ€ฮฟฯฮตฮฏ ฮฝฮฑ ฮฟฯฮฏฯƒฮตฮน ฯ„ฮนฯ‚ ฮดฮนฮบฮญฯ‚ ฯ„ฮฟฯ… ฮตฮฝฮญฯฮณฮตฮนฮตฯ‚. ฮ•ฯ€ฮตฮพฮตฯฮณฮฑฯƒฯ„ฮตฮฏฯ„ฮต ฯƒฮต ฯ€ฮปฮฎฯฮตฯ‚ ฮผฮญฮณฮตฮธฮฟฯ‚ ฯƒฯ„ฮทฮฝ ฮฟฮธฯŒฮฝฮท ฯ€ฯฮฟฮฟฯฮนฯƒฮผฮฟฯ. + ฮคฯฮญฯ‡ฮฟฯ…ฯƒฮฑ ฮดฮนฮฌฯ„ฮฑฮพฮท + ฮ”ฮนฮฑฮณฯฮฑฯ†ฮฎ ฯ„ฮทฯ‚ ฮฑฯ‡ฯฮทฯƒฮนฮผฮฟฯ€ฮฟฮฏฮทฯ„ฮทฯ‚ ฮดฮนฮฌฯ„ฮฑฮพฮทฯ‚ %1$s ฮบฮฑฮน ฯ„ฯ‰ฮฝ ฮฑฯ€ฮฟฮธฮทฮบฮตฯ…ฮผฮญฮฝฯ‰ฮฝ ฮตฮฝฮตฯฮณฮตฮนฯŽฮฝ ฯ„ฮทฯ‚; + ฮœฮตฯ„ฮฟฮฝฮฟฮผฮฑฯƒฮฏฮฑ ฯ„ฯฮญฯ‡ฮฟฯ…ฯƒฮฑฯ‚ ฮดฮนฮฌฯ„ฮฑฮพฮทฯ‚ + ฮŸฮน ฮผฮท ฮฑฮฝฮฑฮณฮฝฯŽฯƒฮนฮผฮตฯ‚ ฯฯ…ฮธฮผฮฏฯƒฮตฮนฯ‚ ฮตฮนฯƒฯŒฮดฮฟฯ… ฮดฮนฮฑฯ„ฮทฯฮฎฮธฮทฮบฮฑฮฝ ฯƒฮต ฮฑฮฝฯ„ฮฏฮณฯฮฑฯ†ฮฟ ฮฑฮฝฮฌฮบฯ„ฮทฯƒฮทฯ‚. ฮœฯ€ฮฟฯฮตฮฏฯ„ฮต ฮฝฮฑ ฯƒฯ…ฮฝฮตฯ‡ฮฏฯƒฮตฯ„ฮต ฯ„ฮทฮฝ ฮตฯ€ฮตฮพฮตฯฮณฮฑฯƒฮฏฮฑ ฯ„ฯ‰ฮฝ ฯ€ฯฮฟฯ†ฮฏฮป ฯ€ฮฟฯ… ฮฑฮฝฮฑฮบฯ„ฮฎฮธฮทฮบฮฑฮฝ. + ฮ™ฮดฮนฯŒฯ„ฮทฯ„ฮตฯ‚ + ฮ™ฮดฮนฯŒฯ„ฮทฯ„ฮตฯ‚ ฮบฮปฮนฮบ + %1$s ยท ฮšฮปฮนฮบ + ฮšฮฟฯ…ฮผฯ€ฮนฮฌ + ฮœฮฟฯ‡ฮปฮฟฮฏ, ฯ€ฮปฮฑฮบฮฏฮดฮนฮฑ ฮบฮฑฮน ฯƒฮบฮฑฮฝฮดฮฌฮปฮตฯ‚ + ฮ‘ฯ€ฯŒฮบฯฯ…ฯˆฮท ฮตฯฮณฮฑฮปฮตฮฏฯ‰ฮฝ + ฮงฮตฮนฯฮนฯƒฯ„ฮฎฯฮนฮฟ + ฮฃฯ„ฮญฮปฮฝฮตฮน ฯ„ฮทฮฝ ฮตฮฏฯƒฮฟฮดฮฟ ฯ„ฮฟฯ… ฯ‡ฮตฮนฯฮนฯƒฯ„ฮทฯฮฏฮฟฯ… ฯƒฯ„ฮฟ Steam Input ฮฎ ฯƒฯ„ฮฟ ฯ€ฮฑฮนฯ‡ฮฝฮฏฮดฮน. + ฮ‘ฯ…ฯ„ฯŒ ฯ„ฮฟ ฯƒฯ„ฮฟฮนฯ‡ฮตฮฏฮฟ ฮดฮตฮฝ ฯƒฯ„ฮญฮปฮฝฮตฮน ฮตฮฏฯƒฮฟฮดฮฟ ฯ‡ฮตฮนฯฮนฯƒฯ„ฮทฯฮฏฮฟฯ…, ฯ€ฮฟฮฝฯ„ฮนฮบฮนฮฟฯ ฮฎ ฯ€ฮปฮทฮบฯ„ฯฮฟฮปฮฟฮณฮฏฮฟฯ…. + ฮšฮปฮนฮบ ฯ€ฮฟฮฝฯ„ฮนฮบฮนฮฟฯ + ฮ•ฮฝฮญฯฮณฮตฮนฮฑ DroidDeck + ฮ•ฮฝฮญฯฮณฮตฮนฮฑ + ฮคฮฑฯ‡ฯฯ„ฮทฯ„ฮฑ ฮบฯฮปฮนฯƒฮทฯ‚: %1$d ฮฒฮฎฮผฮฑฯ„ฮฑ/s + + ฮฮญฮฟ ฯ€ฯฮฟฯ†ฮฏฮป + + ฮฮญฮฑ ฮดฮนฮฌฯ„ฮฑฮพฮท + %1$s ยท ฮงฯฮทฯƒฮนฮผฮฟฯ€ฮฟฮนฮตฮฏฯ„ฮฑฮน ฮฑฯ€ฯŒ %2$d ฯ€ฯฮฟฯ†ฮฏฮป. ฮŸฮน ฮฑฮปฮปฮฑฮณฮญฯ‚ ฮนฯƒฯ‡ฯฮฟฯ…ฮฝ ฮณฮนฮฑ ฮบฮฌฮธฮต ฯ€ฯฮฟฯ†ฮฏฮป ฮผฮต ฮฑฯ…ฯ„ฮญฯ‚ ฯ„ฮนฯ‚ ฮฑฮฝฯ„ฮนฯƒฯ„ฮฟฮนฯ‡ฮฏฯƒฮตฮนฯ‚. + ฮœฮตฯ„ฮฟฮฝฮฟฮผฮฑฯƒฮฏฮฑ + ฮ”ฮนฮฑฮณฯฮฑฯ†ฮฎ + ฮ ฯฮฟฯƒฮธฮญฯƒฯ„ฮต ฯƒฯ„ฮฟฮนฯ‡ฮตฮฏฮฑ ฯƒฯ„ฮท ฮดฮนฮฌฯ„ฮฑฮพฮท ฯ€ฯฮนฮฝ ฮฑฮฝฯ„ฮนฯƒฯ„ฮฟฮนฯ‡ฮฏฯƒฮตฯ„ฮต ฯ„ฮนฯ‚ ฮตฮฝฮญฯฮณฮตฮนฮญฯ‚ ฯ„ฮฟฯ…ฯ‚. + ฮ”ฮตฮฝ ฮฎฯ„ฮฑฮฝ ฮดฯ…ฮฝฮฑฯ„ฮฎ ฮท ฮฑฯ€ฮฟฮธฮฎฮบฮตฯ…ฯƒฮท ฯ„ฯ‰ฮฝ ฯฯ…ฮธฮผฮฏฯƒฮตฯ‰ฮฝ ฮตฮนฯƒฯŒฮดฮฟฯ… + ฮŒฮฝฮฟฮผฮฑ + ฮˆฮฝฮฑฯฮพฮท ฮฑฯ€ฯŒ + ฮšฮฟฯ…ฮผฯ€ฮฏ + ฮœฮฟฯ‡ฮปฯŒฯ‚ + Touchpad + ฮฃฯ„ฮฑฯ…ฯฯŒฯ‚ + ฮฃฮบฮฑฮฝฮดฮฌฮปฮท + ฮคฮญฮปฮฟฯ‚ + ฮ‘ฮฝฮฑฮฏฯฮตฯƒฮท + + ฮ ฯฮฟฯƒฮธฮฎฮบฮท + ฮฃฯฯฮตฯ„ฮต ฮณฮนฮฑ ฮผฮตฯ„ฮฑฮบฮฏฮฝฮทฯƒฮท. ฮฃฯฯฮตฯ„ฮต ฮผฮนฮฑ ฮณฯ‰ฮฝฮฏฮฑ ฮณฮนฮฑ ฮฑฮปฮปฮฑฮณฮฎ ฮผฮตฮณฮญฮธฮฟฯ…ฯ‚. ฮ ฮฑฯ„ฮฎฯƒฯ„ฮต ฮ™ฮดฮนฯŒฯ„ฮทฯ„ฮตฯ‚ ฮณฮนฮฑ ฮฑฮฝฯ„ฮนฯƒฯ„ฮฟฮฏฯ‡ฮนฯƒฮท ฮตฮฝฮญฯฮณฮตฮนฮฑฯ‚. + ฮ•ฯ€ฮตฮพฮตฯฮณฮฑฯƒฮฏฮฑ ฯƒฯ„ฮท ฮดฮตฯ…ฯ„ฮตฯฮตฯฮฟฯ…ฯƒฮฑ ฮฟฮธฯŒฮฝฮท + ฮ•ฯ€ฮฑฮฝฮฑฯ‡ฯฮฎฯƒฮท ฯ„ฮฟฯ… %1$s ฮฑฯ€ฯŒ ฮฌฮปฮปฮฟ ฯ€ฯฮฟฯ†ฮฏฮป. ฮŸฮน ฮฌฮปฮปฮตฯ‚ ฯ€ฮทฮณฮญฯ‚ ฯ‡ฮตฮนฯฮนฯƒฮผฮฟฯ ฯ€ฮฑฯฮฑฮผฮญฮฝฮฟฯ…ฮฝ ฮฏฮดฮนฮตฯ‚. + ฮ”ฮนฮฑฯ„ฮฎฯฮทฯƒฮท ฮบฮฟฮนฮฝฯŽฮฝ ฯ†ฯ…ฯƒฮนฮบฯŽฮฝ ฯ‡ฮตฮนฯฮนฯƒฯ„ฮทฯฮฏฯ‰ฮฝ + ฮ‘ฯ€ฯŒ ฯ€ฯฮฟฮตฯ€ฮนฮปฮฟฮณฮฎ, ฯŒฮปฮฑ ฯ„ฮฑ ฯ‡ฮตฮนฯฮนฯƒฯ„ฮฎฯฮนฮฑ ฮบฮฑฮน ฮฟฮน ฯ€ฯฮฟฯƒฮฑฯฮผฮฟฯƒฮผฮญฮฝฮตฯ‚ ฮดฮนฮฑฯ„ฮฌฮพฮตฮนฯ‚ ฮตฮฏฮฝฮฑฮน ฮฑฮฝฮตฮพฮฌฯฯ„ฮทฯ„ฮฑ ฮฑฮฝฯ„ฮฏฮณฯฮฑฯ†ฮฑ. ฮ— ฮบฮฟฮนฮฝฮฎ ฯ‡ฯฮฎฯƒฮท ฯƒฯ…ฮฝฮดฮญฮตฮน ฮผฯŒฮฝฮฟ ฯ„ฮฑ ฯ†ฯ…ฯƒฮนฮบฮฌ ฯ‡ฮตฮนฯฮนฯƒฯ„ฮฎฯฮนฮฑ. + ฮงฯฮฎฯƒฮท ฮฑฯ…ฯ„ฯŽฮฝ ฯ„ฯ‰ฮฝ ฯƒฯ„ฮฟฮนฯ‡ฮตฮฏฯ‰ฮฝ ฮบฮฑฮน ฮธฮญฯƒฮตฯ‰ฮฝ. ฮ— ฮบฮฟฮนฮฝฮฎ ฯ‡ฯฮฎฯƒฮท ฯƒฯ…ฮณฯ‡ฯฮฟฮฝฮฏฮถฮตฮน ฯ„ฮนฯ‚ ฮผฮตฮปฮปฮฟฮฝฯ„ฮนฮบฮญฯ‚ ฮฑฮปฮปฮฑฮณฮญฯ‚ ฮณฮตฯ‰ฮผฮตฯ„ฯฮฏฮฑฯ‚ยท ฮฟฮน ฮตฮฝฮญฯฮณฮตฮนฮตฯ‚ ฯ„ฯ‰ฮฝ ฮบฮฟฯ…ฮผฯ€ฮนฯŽฮฝ ฯ€ฮฑฯฮฑฮผฮญฮฝฮฟฯ…ฮฝ ฮฑฮฝฮตฮพฮฌฯฯ„ฮทฯ„ฮตฯ‚. ฮœฮนฮฑ ฮดฮนฮฑฯ†ฮฟฯฮตฯ„ฮนฮบฮฎ ฮดฮนฮฌฯ„ฮฑฮพฮท ฮพฮตฮบฮนฮฝฮฌ ฮผฮต ฮผฮท ฮฑฮฝฯ„ฮนฯƒฯ„ฮฟฮนฯ‡ฮนฯƒฮผฮญฮฝฮตฯ‚ ฮตฮฝฮญฯฮณฮตฮนฮตฯ‚. + ฮ‘ฮฝฯ„ฮนฮณฯฮฑฯ†ฮฎ ฮฑฯ…ฯ„ฯŽฮฝ ฯ„ฯ‰ฮฝ ฯ‡ฮตฮนฯฮนฯƒฯ„ฮทฯฮฏฯ‰ฮฝ ฮบฮฑฮน ฮตฮฝฮตฯฮณฮตฮนฯŽฮฝ ฮฎ ฯƒฯฮฝฮดฮตฯƒฮฎ ฯ„ฮฟฯ…ฯ‚ ฯŽฯƒฯ„ฮต ฮฟฮน ฮผฮตฮปฮปฮฟฮฝฯ„ฮนฮบฮญฯ‚ ฮฑฮปฮปฮฑฮณฮญฯ‚ ฮฝฮฑ ฮนฯƒฯ‡ฯฮฟฯ…ฮฝ ฮบฮฑฮน ฮณฮนฮฑ ฯ„ฮฑ ฮดฯฮฟ ฯ€ฯฮฟฯ†ฮฏฮป. + ฮ”ฮนฮฑฯ„ฮฎฯฮทฯƒฮท ฮบฮฟฮนฮฝฯŒฯ‡ฯฮทฯƒฯ„ฮฟฯ… + ฮ‘ฮฝฮตฮพฮฌฯฯ„ฮทฯ„ฮฟ ฮฑฮฝฯ„ฮฏฮณฯฮฑฯ†ฮฟ + ฮˆฮฝฮฑฯฮพฮท ฮผฮฟฯ‡ฮปฮฟฯ ฯƒฯ„ฮฟ ฯƒฮทฮผฮตฮฏฮฟ ฮฑฯ†ฮฎฯ‚ + ฮ‘ฯ€ฯŒฮบฯฯ…ฯˆฮท ฮผฮฟฯ‡ฮปฮฟฯ ฯŒฯ„ฮฑฮฝ ฮดฮตฮฝ ฯ‡ฯฮทฯƒฮนฮผฮฟฯ€ฮฟฮนฮตฮฏฯ„ฮฑฮน + ฮ•ฯฮณฮฑฮปฮตฮฏฮฑ + ฮ‘ฯ…ฯ„ฯŒฮผฮฑฯ„ฮฟ (%1$s) + ฮ ฯฮฟฯƒฮฑฯฮผฮฟฯƒฮผฮญฮฝฮฟ (%1$s) + ฮ‘ฯ€ฮฟฮธฮฎฮบฮตฯ…ฯƒฮท ฯ‰ฯ‚ ฮฝฮญฮฟ ฯ€ฯฮฟฯ†ฮฏฮป + ฮงฮตฮนฯฮนฯƒฯ„ฮฎฯฮนฮฑ ฯ€ฯฮฟฯ†ฮฏฮป + ฮ ฯฮฟฯ†ฮฏฮป + ฮงฮตฮนฯฮฟฮฝฮฟฮผฮฏฮตฯ‚ touchpad ฯ€ฮฟฮฝฯ„ฮนฮบฮนฮฟฯ + ฮŒฯ„ฮฑฮฝ ฮฑฮฝฯ„ฮนฯƒฯ„ฮฟฮนฯ‡ฮนฯƒฯ„ฮตฮฏ ฯƒฯ„ฮฟฮฝ ฮดฮตฮฏฮบฯ„ฮท ฯ„ฮฟฯ… ฯ€ฮฟฮฝฯ„ฮนฮบฮนฮฟฯ: ฯ€ฮฑฯ„ฮฎฯƒฯ„ฮต ฮณฮนฮฑ ฮบฮปฮนฮบ, ฮบฯฮฑฯ„ฮฎฯƒฯ„ฮต ฮณฮนฮฑ ฮผฮตฯ„ฮฑฯ†ฮฟฯฮฌ ฮบฮฑฮน ฮบฯ…ฮปฮฎฯƒฯ„ฮต ฮผฮต ฮดฯฮฟ ฮดฮฌฯ‡ฯ„ฯ…ฮปฮฑ. + ฮคฮฟ %1$s ฮญฯ‡ฮตฮน ฯ€ฮฑฯฮฌฮบฮฑฮผฯˆฮท ฮณฯฮฎฮณฮฟฯฮฟฯ… ฮผฮตฮฝฮฟฯ. ฮ•ฯ€ฮนฮปฮญฮพฯ„ฮต ฮ‘ฯ…ฯ„ฯŒฮผฮฑฯ„ฮฟ ฮตฮบฮตฮฏ ฮณฮนฮฑ ฮฝฮฑ ฯ‡ฯฮทฯƒฮนฮผฮฟฯ€ฮฟฮนฮฎฯƒฮตฯ„ฮต ฯ„ฮฟ ฯ€ฯฮฟฮตฯ€ฮนฮปฮตฮณฮผฮญฮฝฮฟ ฯ€ฯฮฟฯ†ฮฏฮป ฮบฮฑฮน ฯ„ฮฑ ฯ„ฯฮฏฮฑ ฮฑฯ€ฮฟฮธฮทฮบฮตฯ…ฮผฮญฮฝฮฑ ฮผฮญฯฮท. + ฮ•ฮฏฯƒฮฟฮดฮฟฯ‚ DroidDeck + ฮšฯฮฑฯ„ฮตฮฏฯ„ฮฑฮน ฯŒฯƒฮฟ ฮฟ ฮผฮฟฯ‡ฮปฯŒฯ‚ ฮบฮนฮฝฮตฮฏฯ„ฮฑฮน ฯ€ฯฮฟฯ‚ ฮฟฯ€ฮฟฮนฮฑฮดฮฎฯ€ฮฟฯ„ฮต ฮบฮฑฯ„ฮตฯฮธฯ…ฮฝฯƒฮท: ฯ€ฮฌฯ„ฮทฮผฮฑ ฯ€ฮฌฮฝฯ‰ ฮฑฯ€ฯŒ 55%, ฮฑฯ€ฮตฮปฮตฯ…ฮธฮญฯฯ‰ฯƒฮท ฮบฮฌฯ„ฯ‰ ฮฑฯ€ฯŒ 35%. ฮงฯฮทฯƒฮนฮผฮฟฯ€ฮฟฮนฮฎฯƒฯ„ฮต ฮ ฮปฮฎฮบฯ„ฯฮฑ ฮบฮฑฯ„ฮตฯฮธฯ…ฮฝฯƒฮทฯ‚ ฮณฮนฮฑ ฮบฮฌฮธฮต ฮบฮฑฯ„ฮตฯฮธฯ…ฮฝฯƒฮท ฮพฮตฯ‡ฯ‰ฯฮนฯƒฯ„ฮฌ. ฮŸฮน ฮตฮฝฯ„ฮฟฮปฮญฯ‚ DroidDeck ฮตฮบฯ„ฮตฮปฮฟฯฮฝฯ„ฮฑฮน ฮผฮฏฮฑ ฯ†ฮฟฯฮฌ ฮฑฮฝฮฌ ฮตฮบฯ„ฯฮฟฯ€ฮฎ. ฮคฮฟ ฮบฮปฮนฮบ ฯ„ฮฟฯ… ฮผฮฟฯ‡ฮปฮฟฯ ฯฯ…ฮธฮผฮฏฮถฮตฯ„ฮฑฮน ฮพฮตฯ‡ฯ‰ฯฮนฯƒฯ„ฮฌ. + ฮšฯฮฑฯ„ฮตฮฏฯ„ฮฑฮน ฯŒฯƒฮฟ ฮฑฮณฮณฮฏฮถฮตฯ„ฮต ฯ„ฮฟ touchpadยท ฮฑฯ€ฮตฮปฮตฯ…ฮธฮตฯฯŽฮฝฮตฯ„ฮฑฮน ฯŒฯ„ฮฑฮฝ ฯƒฮทฮบฯŽฯƒฮตฯ„ฮต ฯ„ฮฟ ฮดฮฌฯ‡ฯ„ฯ…ฮปฮฟ. ฮŸฮน ฮตฮฝฯ„ฮฟฮปฮญฯ‚ DroidDeck ฮตฮบฯ„ฮตฮปฮฟฯฮฝฯ„ฮฑฮน ฮผฮฏฮฑ ฯ†ฮฟฯฮฌ ฮฑฮฝฮฌ ฮฌฮณฮณฮนฮณฮผฮฑ. ฮคฮฟ ฮบฮปฮนฮบ ฯ„ฮฟฯ… touchpad ฯฯ…ฮธฮผฮฏฮถฮตฯ„ฮฑฮน ฮพฮตฯ‡ฯ‰ฯฮนฯƒฯ„ฮฌ. + ฮšฯฮฑฯ„ฮตฮฏฯ„ฮฑฮน ฯŒฯ„ฮฑฮฝ ฮท ฯƒฮบฮฑฮฝฮดฮฌฮปฮท ฯ€ฮตฯฮฌฯƒฮตฮน ฯ„ฮฟ 55%ยท ฮฑฯ€ฮตฮปฮตฯ…ฮธฮตฯฯŽฮฝฮตฯ„ฮฑฮน ฮบฮฌฯ„ฯ‰ ฮฑฯ€ฯŒ 35%. ฮŸฮน ฮตฮฝฯ„ฮฟฮปฮญฯ‚ DroidDeck ฮตฮบฯ„ฮตฮปฮฟฯฮฝฯ„ฮฑฮน ฮผฮฏฮฑ ฯ†ฮฟฯฮฌ ฮฑฮฝฮฌ ฯ€ฮฌฯ„ฮทฮผฮฑ. + ฮšฮฑฯ„ฮตฯฮธฯ…ฮฝฯƒฮท ฮบฯฮปฮนฯƒฮทฯ‚ + ฮšฮฑฯ„ฮฑฮบฯŒฯฯ…ฯ†ฮฑ + ฮŸฯฮนฮถฯŒฮฝฯ„ฮนฮฑ + ฮŸฯฮนฮถฯŒฮฝฯ„ฮนฮฑ ฮบฯฮปฮนฯƒฮท + ฮœฮตฯ„ฯฮฎฯƒฮตฮนฯ‚ + ฮ•ฮฝฮตฯฮณฮฟฯ€ฮฟฮนฮฎฯƒฯ„ฮต ฯ„ฮทฮฝ ฮบฮฑฯ„ฮฑฮณฯฮฑฯ†ฮฎ, ฯ‡ฯฮทฯƒฮนฮผฮฟฯ€ฮฟฮนฮฎฯƒฯ„ฮต ฯ„ฮฑ ฯ‡ฮตฮนฯฮนฯƒฯ„ฮฎฯฮนฮฑ ฯƒฮต ฮตฮฝฮตฯฮณฮฎ ฯƒฯ…ฮฝฮตฮดฯฮฏฮฑ ฮบฮฑฮน ฮผฮตฯ„ฮฌ ฮตฯ€ฮนฯƒฯ„ฯฮญฯˆฯ„ฮต ฮบฮฑฮน ฮดฮนฮฑฮฒฮฌฯƒฯ„ฮต ฯ„ฮฑ ฮฑฯ€ฮฟฯ„ฮตฮปฮญฯƒฮผฮฑฯ„ฮฑ. ฮœฮตฯ„ฯฮฌ ฮผฯŒฮฝฮฟ ฯ„ฮฟฮฝ ฯ‡ฯฯŒฮฝฮฟ ฮฑฯ€ฮฟฯƒฯ„ฮฟฮปฮฎฯ‚ ฯ„ฮฟฯ… DroidDeck, ฯŒฯ‡ฮน ฯ„ฮทฮฝ ฮบฮฑฮธฯ…ฯƒฯ„ฮญฯฮทฯƒฮท ฮฟฮธฯŒฮฝฮทฯ‚. ฮ— ฮบฮฑฯ„ฮฑฮณฯฮฑฯ†ฮฎ ฯ„ฮตฮปฮตฮนฯŽฮฝฮตฮน ฯŒฯ„ฮฑฮฝ ฮบฮปฮตฮฏฯƒฮตฮน ฮท ฮดฮนฮตฯฮณฮฑฯƒฮฏฮฑ ฯ„ฮทฯ‚ ฮตฯ†ฮฑฯฮผฮฟฮณฮฎฯ‚. + %1$d ฯ‡ฮตฮนฯฮนฯƒฯ„ฮฎฯฮนฮฑ + ฮ†ฮปฮปฮตฯ‚ ฮฑฯ€ฮฟฮธฮทฮบฮตฯ…ฮผฮญฮฝฮตฯ‚ ฮดฮนฮฑฯ„ฮฌฮพฮตฮนฯ‚ (%1$d) โ–พ + ฮ‘ฯ€ฯŒฮบฯฯ…ฯˆฮท ฮฌฮปฮปฯ‰ฮฝ ฮฑฯ€ฮฟฮธฮทฮบฮตฯ…ฮผฮญฮฝฯ‰ฮฝ ฮดฮนฮฑฯ„ฮฌฮพฮตฯ‰ฮฝ (%1$d) โ–ด + ฮ‘ฯฯ‡ฮนฮบฮฎ / Guide + ฮ ฮฏฯƒฯ‰ ยท ฮญฮฝฮฑ ฯ€ฮฌฯ„ฮทฮผฮฑ + ฮ ฮฏฯƒฯ‰ ยท ฮดฮนฯ€ฮปฯŒ ฯ€ฮฌฯ„ฮทฮผฮฑ + ฮ ฮฏฯƒฯ‰ ยท ฮดฯฮฟ ฯ†ฮฟฯฮญฯ‚ ฯƒฯ„ฮฟ Steam, ฮผฮฏฮฑ ฯƒฯ„ฮทฮฝ ฮตฯ€ฮนฯ†ฮฌฮฝฮตฮนฮฑ ฮตฯฮณฮฑฯƒฮฏฮฑฯ‚ + ฮฃฮต ฮปฮตฮนฯ„ฮฟฯ…ฯฮณฮฏฮฑ Steam. ฮคฮฟ ฮบฯฮฌฯ„ฮทฮผฮฑ ฯ„ฮฟฯ… ฮ ฮฏฯƒฯ‰ ฮฑฮฝฮฟฮฏฮณฮตฮน ฮบฮฑฮน ฯ„ฮท ฮณฯฮฎฮณฮฟฯฮท ฯ€ฯฯŒฯƒฮฒฮฑฯƒฮท. + ฮ•ฯ€ฮฑฮฝฮฑฯ†ฮฟฯฮฌ ฯƒฯ„ฮนฯ‚ ฯ€ฯฮฟฮตฯ€ฮนฮปฮฟฮณฮญฯ‚ + ฮ— ฮตฯ€ฮนฮปฮฟฮณฮฎ ฯ€ฮฏฮฝฮฑฮบฮฑ ฮฑฯ€ฮฟฮผฮฝฮทฮผฮฟฮฝฮตฯฮตฯ„ฮฑฮน. ฮ— ฮตฯ€ฮนฯ†ฮฌฮฝฮตฮนฮฑ ฮตฯฮณฮฑฯƒฮฏฮฑฯ‚ ฮฑฮฝฮฟฮฏฮณฮตฮน ฮดฮตฯฯ„ฮตฯฮฟ ฯ‡ฯŽฯฮฟ ฮตฯฮณฮฑฯƒฮฏฮฑฯ‚ยท ฮดฮตฮฝ ฮฑฮปฮปฮฌฮถฮตฮน ฯ„ฮท ฯƒฯ…ฮฝฮตฮดฯฮฏฮฑ ฮฟฯฯ„ฮต ฯ„ฮฟ ฯ€ฯฮฟฯ†ฮฏฮป ฮตฮนฯƒฯŒฮดฮฟฯ… ฯ„ฮทฯ‚. + ฮ•ฮนฮบฮฟฮฝฮนฮบฯŒ ฯ‡ฮตฮนฯฮนฯƒฯ„ฮฎฯฮนฮฟ + ฮŸ ฯ„ฯฯ€ฮฟฯ‚ ฯ‡ฮตฮนฯฮนฯƒฯ„ฮทฯฮฏฮฟฯ… ฯ€ฮฟฯ… ฮฒฮปฮญฯ€ฮฟฯ…ฮฝ ฯ„ฮฟ Steam ฮฎ ฯ„ฮฟ ฯ€ฮฑฮนฯ‡ฮฝฮฏฮดฮน. + ฮŸฮธฯŒฮฝฮท ฮฑฯ†ฮฎฯ‚ + ฮ ฯŽฯ‚ ฯ‡ฮตฮนฯฮฏฮถฮฟฮฝฯ„ฮฑฮน ฯ„ฮฑ ฮฑฮณฮณฮฏฮณฮผฮฑฯ„ฮฑ ฯƒฯ„ฮทฮฝ ฮฟฮธฯŒฮฝฮท ฯ„ฮฟฯ… ฯ€ฮฑฮนฯ‡ฮฝฮนฮดฮนฮฟฯ. ฮคฮฑ ฮบฮฟฯ…ฮผฯ€ฮนฮฌ ฯ„ฮฟฯ… ฯ€ฯฮฟฯ†ฮฏฮป ฮดฮนฮฑฯ„ฮทฯฮฟฯฮฝ ฯ„ฮนฯ‚ ฮฑฮฝฯ„ฮนฯƒฯ„ฮฟฮนฯ‡ฮนฯƒฮผฮญฮฝฮตฯ‚ ฮตฮฝฮญฯฮณฮตฮนฮตฯ‚. + ฮ”ฮตฮฏฮบฯ„ฮทฯ‚ ฮฑฯ†ฮฎฯ‚ + ฮ•ฮผฯ†ฮฑฮฝฮฏฮถฮตฮน ฮดฮตฮฏฮบฯ„ฮท ฮณฮนฮฑ ฮฌฮผฮตฯƒฮฑ ฮฑฮณฮณฮฏฮณฮผฮฑฯ„ฮฑ ฯƒฯ„ฮทฮฝ ฮฟฮธฯŒฮฝฮท ฯ„ฮฟฯ… ฯ€ฮฑฮนฯ‡ฮฝฮนฮดฮนฮฟฯ. + ฮ†ฮณฮณฮนฮณฮผฮฑ ฮบฮฑฮน ฮบฯฮฌฯ„ฮทฮผฮฑ + ฮ•ฮฝฮญฯฮณฮตฮนฮฑ ฯ€ฮฟฮฝฯ„ฮนฮบฮนฮฟฯ ฯŒฯ„ฮฑฮฝ ฮบฯฮฑฯ„ฮฌฯ„ฮต ฯ„ฮฟ ฮดฮฌฯ‡ฯ„ฯ…ฮปฯŒ ฯƒฮฑฯ‚ ฯƒฯ„ฮทฮฝ ฮฟฮธฯŒฮฝฮท ฯ„ฮฟฯ… ฯ€ฮฑฮนฯ‡ฮฝฮนฮดฮนฮฟฯ. + ฮ ฮฑฯ„ฮฎฮผฮฑฯ„ฮฑ ฯ„ฮฟฯ… ฮบฮฟฯ…ฮผฯ€ฮนฮฟฯ ฮ ฮฏฯƒฯ‰ + ฮ ฯฯŽฯ„ฮท ฮตฮฝฮญฯฮณฮตฮนฮฑ: ฮญฮฝฮฑ ฯ€ฮฌฯ„ฮทฮผฮฑ. ฮ”ฮตฯฯ„ฮตฯฮท ฮตฮฝฮญฯฮณฮตฮนฮฑ: ฮดฮนฯ€ฮปฯŒ ฯ€ฮฌฯ„ฮทฮผฮฑ. + ฮšฮฟฯ…ฮผฯ€ฮฏ ฮตฮฝฮฑฮปฮปฮฑฮณฮฎฯ‚ + ฮ ฮฑฯ„ฮฎฯƒฯ„ฮต ฮณฮนฮฑ ฮบฯฮฌฯ„ฮทฮผฮฑ, ฯ€ฮฑฯ„ฮฎฯƒฯ„ฮต ฮพฮฑฮฝฮฌ ฮณฮนฮฑ ฮฑฯ€ฮตฮปฮตฯ…ฮธฮญฯฯ‰ฯƒฮท. ฮคฮฟ ฮฌฮฝฮฟฮนฮณฮผฮฑ ฮผฮตฮฝฮฟฯ ฮฎ ฮท ฮฑฮปฮปฮฑฮณฮฎ ฯ€ฯฮฟฯ†ฮฏฮป ฮฑฯ€ฮตฮปฮตฯ…ฮธฮตฯฯŽฮฝฮตฮน ฯ„ฮฟ ฮบฮฟฯ…ฮผฯ€ฮฏ. + ฮฃฯ‡ฮฎฮผฮฑ + ฮฃฯ„ฯฮฟฮณฮณฯ…ฮปฮตฮผฮญฮฝฮฟ + ฮšฮฌฯˆฮฟฯ…ฮปฮฑ + ฮšฯฮบฮปฮฟฯ‚ + ฮŸฯฮธฮฟฮณฯŽฮฝฮนฮฟ + ฮ•ฯ„ฮนฮบฮญฯ„ฮฑ ฮบฮฟฯ…ฮผฯ€ฮนฮฟฯ + ฮšฮตฮฏฮผฮตฮฝฮฟ + ฮ•ฮนฯƒฮฑฮณฯŒฮผฮตฮฝฮท ฮตฮนฮบฯŒฮฝฮฑ + ฮžฮตฯ‡ฯ‰ฯฮนฯƒฯ„ฮฌ ฮดฮนฮฑฮณฯŽฮฝฮนฮฑ ฯ€ฮปฮฎฮบฯ„ฯฮฑ + ฮ‘ฮฝฯ„ฮนฯƒฯ„ฮฟฮนฯ‡ฮฏฯƒฯ„ฮต ฯ€ฮปฮฎฮบฯ„ฯฮฟ ฯƒฮต ฮบฮฌฮธฮต ฮดฮนฮฑฮณฯŽฮฝฮนฮฟ. ฮ— ฮบฮตฮฝฮฎ ฮดฮนฮฑฮณฯŽฮฝฮนฮฟฯ‚ ฯ€ฮฑฯ„ฮฌ ฯ„ฮนฯ‚ ฮดฯฮฟ ฮณฮตฮนฯ„ฮฟฮฝฮนฮบฮญฯ‚ ฮบฮฑฯ„ฮตฯ…ฮธฯฮฝฯƒฮตฮนฯ‚. + ฮ“ฮตฮนฯ„ฮฟฮฝฮนฮบฮญฯ‚ ฮบฮฑฯ„ฮตฯ…ฮธฯฮฝฯƒฮตฮนฯ‚ + ฮคฮฑ ฯ€ฮฑฮปฮนฮฌ ฯ€ฮปฮฎฮบฯ„ฯฮฑ ฮฟฮธฯŒฮฝฮทฯ‚ ฮฑฯ€ฮฟฮธฮทฮบฮตฯฯ„ฮทฮบฮฑฮฝ ฯ‰ฯ‚ ฮตฮนฯƒฮฑฮณฯŒฮผฮตฮฝฮฑ ฯ€ฯฮฟฯ†ฮฏฮป ฯ€ฮฑฯฮฑฮบฮฌฯ„ฯ‰. ฮ•ฯ€ฮนฮปฮญฮพฯ„ฮต ฮญฮฝฮฑ ฮณฮนฮฑ ฯ‡ฯฮฎฯƒฮท ฮฎ ฮตฯ€ฮตฮพฮตฯฮณฮฑฯƒฮฏฮฑ. ฮŸฮน ฯ„ฯฮญฯ‡ฮฟฯ…ฯƒฮตฯ‚ ฮตฯ€ฮนฮปฮฟฮณฮญฯ‚ ฯ€ฯฮฟฯ†ฮฏฮป ฮดฮนฮฑฯ„ฮทฯฮฎฮธฮทฮบฮฑฮฝ. + ฮคฮฑ ฯ€ฮฑฮปฮนฮฌ ฯ€ฮปฮฎฮบฯ„ฯฮฑ ฮฟฮธฯŒฮฝฮทฯ‚ ฮดฮตฮฝ ฮผฯ€ฯŒฯฮตฯƒฮฑฮฝ ฮฝฮฑ ฮตฮนฯƒฮฑฯ‡ฮธฮฟฯฮฝ ฮฑฯ…ฯ„ฯŒฮผฮฑฯ„ฮฑ. ฮŸฮน ฮฑฯฯ‡ฮนฮบฮญฯ‚ ฯฯ…ฮธฮผฮฏฯƒฮตฮนฯ‚ ฮดฮนฮฑฯ„ฮทฯฮฎฮธฮทฮบฮฑฮฝ. + diff --git a/app/src/main/res/values-el/input_strings.xml b/app/src/main/res/values-el/input_strings.xml new file mode 100644 index 0000000000..58b5bce713 --- /dev/null +++ b/app/src/main/res/values-el/input_strings.xml @@ -0,0 +1,38 @@ + + + ฮ ฯฮฟฯ†ฮฏฮป ฮตฮนฯƒฯŒฮดฮฟฯ… + ฮ ฯฮฟฯ†ฮฏฮป + ฮฆฯ…ฯƒฮนฮบฯŒ ฯ‡ฮตฮนฯฮนฯƒฯ„ฮฎฯฮนฮฟ + ฮšฯฯฮนฮฑ ฮฟฮธฯŒฮฝฮท + ฮ”ฮตฯ…ฯ„ฮตฯฮตฯฮฟฯ…ฯƒฮฑ ฮฟฮธฯŒฮฝฮท + ฮ•ฮณฮณฮตฮฝฮญฯ‚ / Steam Input + ฮ•ฮณฮณฮตฮฝฮญฯ‚: %1$s + ฮ‘ฯ€ฮฟฯƒฯ„ฮฟฮปฮฎ ฮฌฮปฮปฮทฯ‚ ฮตฮฝฯ„ฮฟฮปฮฎฯ‚ ฯ‡ฮตฮนฯฮนฯƒฯ„ฮทฯฮฏฮฟฯ… + ฮ‘ฯ€ฮตฮฝฮตฯฮณฮฟฯ€ฮฟฮนฮทฮผฮญฮฝฮฟ + ฮ ฮปฮฎฮบฯ„ฯฮฟ ฮฎ ฯƒฯ…ฮฝฮดฯ…ฮฑฯƒฮผฯŒฯ‚ ฯ€ฮปฮฎฮบฯ„ฯฯ‰ฮฝ + ฮ ฮปฮฎฮบฯ„ฯฮฑ ฮบฮฑฯ„ฮตฯฮธฯ…ฮฝฯƒฮทฯ‚ + ฮœฮตฯ„ฮฑฮบฮฏฮฝฮทฯƒฮท ฮดฮตฮฏฮบฯ„ฮท + ฮคฮฑฯ‡ฯฯ„ฮทฯ„ฮฑ ฮดฮตฮฏฮบฯ„ฮท: %1$d + ฮšฯฮปฮนฯƒฮท + ฮšฮฑฯ„ฮฑฮบฯŒฯฯ…ฯ†ฮท ฮบฯฮปฮนฯƒฮท + ฮ‘ฯฮนฯƒฯ„ฮตฯฯŒ ฮบฮฟฯ…ฮผฯ€ฮฏ ฯ€ฮฟฮฝฯ„ฮนฮบฮนฮฟฯ + ฮ”ฮตฮพฮฏ ฮบฮฟฯ…ฮผฯ€ฮฏ ฯ€ฮฟฮฝฯ„ฮนฮบฮนฮฟฯ + ฮœฮตฯƒฮฑฮฏฮฟ ฮบฮฟฯ…ฮผฯ€ฮฏ ฯ€ฮฟฮฝฯ„ฮนฮบฮนฮฟฯ + ฮ†ฮฝฮฟฮนฮณฮผฮฑ ฮผฮตฮฝฮฟฯ DroidDeck + ฮ•ฮผฯ†ฮฌฮฝฮนฯƒฮท ฯ€ฮปฮทฮบฯ„ฯฮฟฮปฮฟฮณฮฏฮฟฯ… + ฮ†ฮฝฮฟฮนฮณฮผฮฑ ฮผฮตฮฝฮฟฯ Steam + ฮ†ฮฝฮฟฮนฮณฮผฮฑ ฮณฯฮฎฮณฮฟฯฮทฯ‚ ฯ€ฯฯŒฯƒฮฒฮฑฯƒฮทฯ‚ Steam + ฮ‘ฯ†ฮฑฮฏฯฮตฯƒฮท ฯƒฯ„ฮฟฮนฯ‡ฮตฮฏฮฟฯ… + ฮ ฯฮฟฯƒฮธฮฎฮบฮท ฯƒฯ„ฮฟฮนฯ‡ฮตฮฏฮฟฯ… + ฮšฮฟฯ…ฮผฯ€ฮนฮฌ ฮตฮนฮดฮนฮบฮฌ ฮณฮนฮฑ ฯ„ฮท ฯƒฯ…ฯƒฮบฮตฯ…ฮฎ + ฮ‘ฮฝฯ„ฮนฯƒฯ„ฮฟฮฏฯ‡ฮนฯƒฮท ฯ†ฯ…ฯƒฮนฮบฮฟฯ ฮบฮฟฯ…ฮผฯ€ฮนฮฟฯ + ฮ‘ฯ†ฮฎฯƒฯ„ฮต ฯ„ฮฟ ฮบฮฟฯ…ฮผฯ€ฮฏ ฮบฮฑฮน ฮตฯ€ฮนฮปฮญฮพฯ„ฮต ฮ•ฯ€ฮตฮพฮตฯฮณฮฑฯƒฮฏฮฑ, ฮ•ฯ€ฮฑฮฝฮฌฮปฮทฯˆฮท ฮฎ ฮ‘ฮบฯฯฯ‰ฯƒฮท. ฮคฮฟ B ฮฎ ฯ„ฮฟ ฮ ฮฏฯƒฯ‰ ฮฑฮบฯ…ฯฯŽฮฝฮตฮน ฮฑฯ†ฮฟฯ ฮฑฯ†ฮฎฯƒฮตฯ„ฮต ฯ„ฮฟ ฮบฮฟฯ…ฮผฯ€ฮฏ. + ฮ•ฯ€ฮฑฮฝฮฌฮปฮทฯˆฮท + ฮ ฮฑฯ„ฮฎฯƒฯ„ฮต ฮญฮฝฮฑ ฮบฮฟฯ…ฮผฯ€ฮฏ, ฮฑฮบฯŒฮผฮท ฮบฮฑฮน ฮ ฮฏฯƒฯ‰ ฯ€ฮฟฯ… ฮฑฮฝฮฑฯ†ฮญฯฮตฯ„ฮฑฮน ฯ‰ฯ‚ ฯ€ฮปฮฎฮบฯ„ฯฮฟ. ฮคฮฑ ฯ€ฮปฮฎฮบฯ„ฯฮฑ ฮญฮฝฯ„ฮฑฯƒฮทฯ‚ ฮบฮฑฮน ฯ„ฮฑ ฯ€ฮปฮฎฮบฯ„ฯฮฑ ฯƒฯ…ฯƒฯ„ฮฎฮผฮฑฯ„ฮฟฯ‚ Android ฮตฮฏฮฝฮฑฮน ฮดฮตฯƒฮผฮตฯ…ฮผฮญฮฝฮฑ. ฮ— ฮฑฮฝฯ„ฮนฯƒฯ„ฮฟฮฏฯ‡ฮนฯƒฮท ฮนฯƒฯ‡ฯฮตฮน ฮผฯŒฮฝฮฟ ฮณฮนฮฑ ฮฑฯ…ฯ„ฮฎ ฯ„ฮท ฯƒฯ…ฯƒฮบฮตฯ…ฮฎ. + ฮ‘ฯ†ฮฑฮฏฯฮตฯƒฮท ฮฑฮฝฯ„ฮนฯƒฯ„ฮฟฮฏฯ‡ฮนฯƒฮทฯ‚ + ฮ”ฮนฮฌฮณฮฝฯ‰ฯƒฮท ฮตฮนฯƒฯŒฮดฮฟฯ… + ฮšฮฑฯ„ฮฑฮณฯฮฑฯ†ฮฎ ฯ‡ฯฯŒฮฝฮฟฯ… ฮฑฯ€ฮฟฯƒฯ„ฮฟฮปฮฎฯ‚ ฮตฮนฯƒฯŒฮดฮฟฯ… + ฮ‘ฮฝฮฌฮณฮฝฯ‰ฯƒฮท ฮผฮตฯ„ฯฮฎฯƒฮตฯ‰ฮฝ + ฮœฮตฯ„ฯฮฌ ฯ„ฮทฮฝ ฮฑฯ€ฮฟฯƒฯ„ฮฟฮปฮฎ ฮฑฯ€ฯŒ ฯ„ฮฟ Android ฮญฯ‰ฯ‚ ฯ„ฮท ฮดฮทฮผฮฟฯƒฮฏฮตฯ…ฯƒฮท ฯƒฯ„ฮท ฮผฮตฯ„ฮฑฯ†ฮฟฯฮฌ ฮตฮนฯƒฯŒฮดฮฟฯ…. ฮ”ฮตฮฝ ฯ€ฮตฯฮนฮปฮฑฮผฮฒฮฌฮฝฮตฮน ฮฌฯ†ฮนฮพฮท Bluetooth, ฮดฮตฮนฮณฮผฮฑฯ„ฮฟฮปฮทฯˆฮฏฮฑ ฮตฯ€ฮนฯƒฮบฮญฯ€ฯ„ฮท, ฮฑฯ€ฯŒฮดฮฟฯƒฮท ฮบฮฑฮน ฮบฮฑฮธฯ…ฯƒฯ„ฮญฯฮทฯƒฮท ฮฟฮธฯŒฮฝฮทฯ‚. ฮ— ฮบฮฑฯ„ฮฑฮณฯฮฑฯ†ฮฎ ฮตฮฏฮฝฮฑฮน ฮฑฯ€ฮตฮฝฮตฯฮณฮฟฯ€ฮฟฮนฮทฮผฮญฮฝฮท ฮฑฯ€ฯŒ ฯ€ฯฮฟฮตฯ€ฮนฮปฮฟฮณฮฎ. + ฮงฯฮฎฯƒฮท ฮบฮฑฮฝฮฟฮฝฮนฮบฮฎฯ‚ ฮฑฮฝฯ„ฮนฯƒฯ„ฮฟฮฏฯ‡ฮนฯƒฮทฯ‚ ฮตฮนฯƒฯŒฮดฮฟฯ… + diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index 0d7d8e1c91..70c09dfcde 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -28,6 +28,8 @@ ฮ‘ฮฝฮฑฯƒฯ„ฮฟฮปฮฎ ฯ„ฯŽฯฮฑ ฮ”ฮนฮฑฮบฮฟฯ€ฮฎ ฯƒฯ…ฮฝฮตฮดฯฮฏฮฑฯ‚ ฮ”ฮทฮผฮนฮฟฯ…ฯฮณฮฏฮฑ ฮบฮฑฯฮญ + ฮกฯ…ฮธฮผฮฏฯƒฮตฮนฯ‚ ฮณฮนฮฑ ฮฑฯ…ฯ„ฯŒ ฯ„ฮฟ ฯ€ฮฑฮนฯ‡ฮฝฮฏฮดฮน + ฮ ฯฮฟฮตฯ€ฮนฮปฮตฮณฮผฮญฮฝฮตฯ‚ ฯฯ…ฮธฮผฮฏฯƒฮตฮนฯ‚ ฮ•ฯ€ฮนฮปฮญฮพฯ„ฮต ฯ„ฮท ฮปฮตฮนฯ„ฮฟฯ…ฯฮณฮฏฮฑ ฮดฮทฮผฮนฮฟฯ…ฯฮณฮฏฮฑฯ‚ ฮบฮฑฯฮญ ฮ‘ฮฝฮตฮฝฮตฯฮณฯŒ DD-FG %1$dร— @@ -183,6 +185,7 @@ ฮ”ฮตฮฝ ฮฎฯ„ฮฑฮฝ ฮดฯ…ฮฝฮฑฯ„ฮฎ ฮท ฮปฮฎฯˆฮท ฯ„ฮฟฯ… ฮณฯฮฑฯ†ฮนฮบฮฟฯ ฯ€ฮตฯฮนฮฒฮฌฮปฮปฮฟฮฝฯ„ฮฟฯ‚ PowerVR. ฮ•ฮปฮญฮณฮพฯ„ฮต ฯ„ฮท ฯƒฯฮฝฮดฮตฯƒฮท ฮบฮฑฮน ฮดฮฟฮบฮนฮผฮฌฯƒฯ„ฮต ฮพฮฑฮฝฮฌ. ฮ”ฮตฮฝ ฮฎฯ„ฮฑฮฝ ฮดฯ…ฮฝฮฑฯ„ฮฎ ฮท ฮปฮฎฯˆฮท ฯ„ฮฟฯ… DirectAudio, ฮฟฯ€ฯŒฯ„ฮต ฮฟ ฮฎฯ‡ฮฟฯ‚ ฯ„ฯ‰ฮฝ ฯ€ฮฑฮนฯ‡ฮฝฮนฮดฮนฯŽฮฝ ฯ‡ฯฮทฯƒฮนฮผฮฟฯ€ฮฟฮนฮตฮฏ ฯ„ฮทฮฝ ฯ€ฮนฮฟ ฮฑฯฮณฮฎ ฮดฮนฮฑฮดฯฮฟฮผฮฎ ฯƒฮต ฮฑฯ…ฯ„ฮฎ ฯ„ฮท ฯƒฯ…ฮฝฮตฮดฯฮฏฮฑ. ฮ‘ฯ…ฯ„ฯŒ ฯ„ฮฟ ฯ€ฯฯŒฮณฯฮฑฮผฮผฮฑ + ฮ— ฯƒฯ…ฮฝฮตฮดฯฮฏฮฑ ฮดฮตฮฝ ฮผฯ€ฯŒฯฮตฯƒฮต ฮฝฮฑ ฯƒฯ‡ฮตฮดฮนฮฌฯƒฮตฮน ฯƒฯ„ฮทฮฝ ฮฟฮธฯŒฮฝฮท: %1$s. ฮ‘ฯ…ฯ„ฮฎ ฮท ฮฟฮธฯŒฮฝฮท ฮดฮตฮฏฯ‡ฮฝฮตฮน ฯ„ฮฟฮฝ ฮปฯŒฮณฮฟ ฮฑฮฝฯ„ฮฏ ฮฝฮฑ ฮตฮฏฮฝฮฑฮน ฮผฮฑฯฯฮทยท ฮฟฮน ฮปฮตฯ€ฯ„ฮฟฮผฮญฯฮตฮนฮตฯ‚ ฮฒฯฮฏฯƒฮบฮฟฮฝฯ„ฮฑฮน ฯƒฯ„ฮฑ ฮฑฯฯ‡ฮตฮฏฮฑ ฮบฮฑฯ„ฮฑฮณฯฮฑฯ†ฮฎฯ‚ ฯ„ฮทฯ‚ ฯƒฯ…ฮฝฮตฮดฯฮฏฮฑฯ‚. ฮ”ฮตฮฝ ฮฎฯ„ฮฑฮฝ ฮดฯ…ฮฝฮฑฯ„ฮฎ ฮท ฮปฮฎฯˆฮท ฯ„ฮฟฯ… ฯ€ฮตฮปฮฌฯ„ฮท Steam. ฮคฮฟ ฮดฮฏฮบฯ„ฯ…ฮฟ ฮฎ ฯ„ฮฟ VPN ฯƒฮฑฯ‚ ฮฏฯƒฯ‰ฯ‚ ฮฑฯ€ฮฟฮบฮปฮตฮฏฮตฮน ฯ„ฮฟฯ…ฯ‚ ฮดฮนฮฑฮบฮฟฮผฮนฯƒฯ„ฮญฯ‚ ฯ„ฮฟฯ… Steamยท ฮตฮปฮญฮณฮพฯ„ฮต ฯ„ฮท ฯƒฯฮฝฮดฮตฯƒฮท ฮบฮฑฮน ฮดฮฟฮบฮนฮผฮฌฯƒฯ„ฮต ฮพฮฑฮฝฮฌ. ฮ”ฮตฮฝ ฮฎฯ„ฮฑฮฝ ฮดฯ…ฮฝฮฑฯ„ฮฎ ฮท ฯฯฮธฮผฮนฯƒฮท ฯ„ฮฟฯ… ฯ€ฮตฮปฮฌฯ„ฮท Steam. ฮ•ฮปฮญฮณฮพฯ„ฮต ฯ„ฮท ฯƒฯฮฝฮดฮตฯƒฮท ฮบฮฑฮน ฯ„ฮฟฮฝ ฮตฮปฮตฯฮธฮตฯฮฟ ฯ‡ฯŽฯฮฟ ฮฑฯ€ฮฟฮธฮฎฮบฮตฯ…ฯƒฮทฯ‚ ฮบฮฑฮน ฮดฮฟฮบฮนฮผฮฌฯƒฯ„ฮต ฮพฮฑฮฝฮฌ. ฮคฮฟ %1$s ฮตฮฏฮฝฮฑฮน ฯ‡ฯ„ฮนฯƒฮผฮญฮฝฮฟ ฮณฮนฮฑ ฯ…ฯ€ฮฟฮปฮฟฮณฮนฯƒฯ„ฮญฯ‚ x86 ฮบฮฑฮน ฮตฮบฯ„ฮตฮปฮตฮฏฯ„ฮฑฮน ฮผฮญฯƒฯ‰ FEX, ฯ„ฮฟ ฮฟฯ€ฮฟฮฏฮฟ ฮดฮตฮฝ ฮญฯ‡ฮตฮน ฮตฮณฮบฮฑฯ„ฮฑฯƒฯ„ฮฑฮธฮตฮฏ ฮฑฮบฯŒฮผฮฑ. ฮ•ฮบฮบฮนฮฝฮฎฯƒฯ„ฮต ฯ„ฮฟ Steam ฮผฮฏฮฑ ฯ†ฮฟฯฮฌ ฮตฮฝฯŽ ฮตฮฏฯƒฯ„ฮต ฯƒฯ…ฮฝฮดฮตฮดฮตฮผฮญฮฝฮฟฮน ฮบฮฑฮน ฮฑฯ†ฮฎฯƒฯ„ฮต ฯ„ฮฟ ฮฝฮฑ ฮบฮฌฮฝฮตฮน ฮปฮฎฯˆฮท ฯ„ฮฟฯ… FEX ฮบฮฑฮน ฯ„ฮฟฯ… Steam Linux Runtime, ฮผฮตฯ„ฮฌ ฮตฮบฮบฮนฮฝฮฎฯƒฯ„ฮต ฮฑฯ…ฯ„ฯŒ ฮพฮฑฮฝฮฌ. @@ -385,6 +388,9 @@ ฮ”ฮตฮฝ ฯ…ฯ€ฮฟฯƒฯ„ฮทฯฮฏฮถฮตฯ„ฮฑฮน ฮฑฮบฯŒฮผฮฑ ฮตฮดฯŽ ฮฆฯŒฯฯ„ฯ‰ฯƒฮท ฯ„ฯ‰ฮฝ ฯƒฯ„ฮฟฮนฯ‡ฮตฮฏฯ‰ฮฝโ€ฆ ฮ”ฮตฮฝ ฮฎฯ„ฮฑฮฝ ฮดฯ…ฮฝฮฑฯ„ฮฎ ฮท ฮตฮณฮบฮฑฯ„ฮฌฯƒฯ„ฮฑฯƒฮท: %1$s + ฮ‘ฯ…ฯ„ฮฎ ฮท ฮปฮฎฯˆฮท ฯ‡ฯฮตฮนฮฌฮถฮตฯ„ฮฑฮน ฮตฮฝฮทฮผฮญฯฯ‰ฯƒฮท. + ฮ— ฮตฮฝฮทฮผฮญฯฯ‰ฯƒฮท ฮผฯ€ฮฎฮบฮต ฯƒฯ„ฮทฮฝ ฮฟฯ…ฯฮฌ. + ฮ•ฯ€ฮฑฮฝฮฌฮปฮทฯˆฮท ฮตฮฝฮทฮผฮญฯฯ‰ฯƒฮทฯ‚ ฮ›ฮฎฯ†ฮธฮทฮบฮต ฮ›ฮฎฯˆฮท %1$s ฮ•ฮณฮบฮฑฯ„ฮฌฯƒฯ„ฮฑฯƒฮท: %1$s @@ -415,6 +421,22 @@ ฮœฯŒฮฝฮฟ ฮตฯƒฯ‰ฯ„ฮตฯฮนฮบฮฎ ฮฑฯ€ฮฟฮธฮฎฮบฮตฯ…ฯƒฮท ฮฆฮฌฮบฮตฮปฮฟฯ‚: %1$s ฮ”ฮตฯฯ„ฮตฯฮท ฮฒฮนฮฒฮปฮนฮฟฮธฮฎฮบฮท + ฮ ฮตฯฮนฯƒฯƒฯŒฯ„ฮตฯฮตฯ‚ ฮฒฮนฮฒฮปฮนฮฟฮธฮฎฮบฮตฯ‚ Steam + ฮฆฮฌฮบฮตฮปฮฟฮน ฯƒฯ„ฮฟฯ…ฯ‚ ฮฟฯ€ฮฟฮฏฮฟฯ…ฯ‚ ฯ„ฮฟ Steam ฮผฯ€ฮฟฯฮตฮฏ ฮฝฮฑ ฮตฮณฮบฮฑฮธฮนฯƒฯ„ฮฌ ฮบฮฑฮน ฮฝฮฑ ฮตฮบฮบฮนฮฝฮตฮฏ ฯ€ฮฑฮนฯ‡ฮฝฮฏฮดฮนฮฑ, ฮฟ ฮบฮฑฮธฮญฮฝฮฑฯ‚ ฮผฮต ฯ„ฮฟ ฮดฮนฮบฯŒ ฯ„ฮฟฯ… ฯŒฮฝฮฟฮผฮฑ. ฮ‘ฮฝ ฮฑฯ†ฮฑฮนฯฮญฯƒฮตฯ„ฮต ฮบฮฌฯ€ฮฟฮนฮฟฮฝ, ฯ„ฮฑ ฯ€ฮฑฮนฯ‡ฮฝฮฏฮดฮนฮฑ ฯ€ฮฑฯฮฑฮผฮญฮฝฮฟฯ…ฮฝ ฯƒฯ„ฮฟฮฝ ฮดฮฏฯƒฮบฮฟ. + ฮ ฯฮฟฯƒฮธฮฎฮบฮท ฮฒฮนฮฒฮปฮนฮฟฮธฮฎฮบฮทฯ‚ + ฮœฮตฯ„ฮฟฮฝฮฟฮผฮฑฯƒฮฏฮฑ + ฮŒฮฝฮฟฮผฮฑ ฮฒฮนฮฒฮปฮนฮฟฮธฮฎฮบฮทฯ‚ + ฮ•ฯ€ฮนฮปฮญฮพฯ„ฮต ฮญฮฝฮฑฮฝ ฯ†ฮฌฮบฮตฮปฮฟ ฮณฮนฮฑ ฯ„ฮท ฮฒฮนฮฒฮปฮนฮฟฮธฮฎฮบฮท + ฮคฮฟ ฯ€ฮฟฮปฯ %1$d ฯ€ฯฯŒฯƒฮธฮตฯ„ฮตฯ‚ ฮฒฮนฮฒฮปฮนฮฟฮธฮฎฮบฮตฯ‚ + ฮ‘ฯ…ฯ„ฯŒฯ‚ ฮฟ ฯ†ฮฌฮบฮตฮปฮฟฯ‚ ฮตฮฏฮฝฮฑฮน ฮฎฮดฮท ฮฒฮนฮฒฮปฮนฮฟฮธฮฎฮบฮท ฮฎ ฮฒฯฮฏฯƒฮบฮตฯ„ฮฑฮน ฮผฮญฯƒฮฑ ฯƒฮต ฮผฮฏฮฑ + %1$s ยท ฮผฮท ฮดฮนฮฑฮธฮญฯƒฮนฮผฮฟ + ฮ™ฯƒฯ‡ฯฮตฮน ฮฑฯ€ฯŒ ฯ„ฮทฮฝ ฮตฯ€ฯŒฮผฮตฮฝฮท ฯƒฯ…ฮฝฮตฮดฯฮฏฮฑ Steam + ฮ’ฯฮญฮธฮทฮบฮต ฯƒฮต ฮฑฯ…ฯ„ฮฎ ฯ„ฮท ฯƒฯ…ฯƒฮบฮตฯ…ฮฎ ยท %1$s ยท %2$s + ฮ ฯฮฟฯƒฮธฮฎฮบฮท + ฮ•ฯฯฮตฯƒฮท ฮฒฮนฮฒฮปฮนฮฟฮธฮทฮบฯŽฮฝ ฯƒฯ„ฮฟฮฝ ฮตฯƒฯ‰ฯ„ฮตฯฮนฮบฯŒ ฯ‡ฯŽฯฮฟ ฮฑฯ€ฮฟฮธฮฎฮบฮตฯ…ฯƒฮทฯ‚ + ฮ•ฯ€ฮนฯ„ฯฮญฯˆฯ„ฮต ฯ„ฮทฮฝ ฯ€ฯฯŒฯƒฮฒฮฑฯƒฮท ฯƒฮต ฯŒฮปฮฑ ฯ„ฮฑ ฮฑฯฯ‡ฮตฮฏฮฑ, ฯŽฯƒฯ„ฮต ฯ„ฮฟ DroidDeck ฮฝฮฑ ฮฒฮปฮญฯ€ฮตฮน ฯ„ฮนฯ‚ ฮฒฮนฮฒฮปฮนฮฟฮธฮฎฮบฮตฯ‚ Steam ฯ€ฮฟฯ… ฮฌฮปฮปฮตฯ‚ ฮตฯ†ฮฑฯฮผฮฟฮณฮญฯ‚ ฮดฮนฮฑฯ„ฮทฯฮฟฯฮฝ ฯƒฯ„ฮฟฮฝ ฮตฯƒฯ‰ฯ„ฮตฯฮนฮบฯŒ ฯ‡ฯŽฯฮฟ ฮฑฯ€ฮฟฮธฮฎฮบฮตฯ…ฯƒฮทฯ‚ + ฮฮฑ ฮตฯ€ฮนฯ„ฯฮฑฯ€ฮตฮฏ + ฮ ฯฮฟฯƒฯ„ฮญฮธฮทฮบฮต %1$s, ฮท ฮฒฮนฮฒฮปฮนฮฟฮธฮฎฮบฮท Steam ฮผฮญฯƒฮฑ ฯƒฯ„ฮฟฮฝ ฯ†ฮฌฮบฮตฮปฮฟ ฯ€ฮฟฯ… ฮตฯ€ฮนฮปฮญฮพฮฑฯ„ฮต ฮ ฮฑฮนฯ‡ฮฝฮฏฮดฮนฮฑ ฯ€ฮฟฯ… ฮผฮตฯ„ฮฑฮดฮฏฮดฮฟฯ…ฮฝ ฮดฮตฮดฮฟฮผฮญฮฝฮฑ ฮฑฯ€ฯŒ ฮบฮฌฯฯ„ฮฑ SD ฮฎ ฮบฮฟฮนฮฝฯŒฯ‡ฯฮทฯƒฯ„ฮฟ ฯ‡ฯŽฯฮฟ ฮฑฯ€ฮฟฮธฮฎฮบฮตฯ…ฯƒฮทฯ‚ ฮผฯ€ฮฟฯฮตฮฏ ฮฝฮฑ ฮบฮฟฮปฮปฮฌฮฝฮต. ฮ”ฮนฮฑฮณฮฝฯ‰ฯƒฯ„ฮนฮบฮฌ ฮฑฯ€ฮฟฮธฮทฮบฮตฯ…ฯ„ฮนฮบฮฟฯ ฯ‡ฯŽฯฮฟฯ… ฮšฮฑฯ„ฮฑฮณฯฮฌฯ†ฮตฮน ฮฑฯ€ฮฟฯ„ฮตฮปฮญฯƒฮผฮฑฯ„ฮฑ ฮบฮฑฯ„ฮฑฮฝฮฟฮผฮฎฯ‚ ฮบฮฑฮน ฮดฮตฮนฮณฮผฮฑฯ„ฮฟฮปฮทฯ€ฯ„ฮนฮบฮฟฯฯ‚ ฯ‡ฯฯŒฮฝฮฟฯ…ฯ‚ ฮฑฯ€ฮฟฮธฮฎฮบฮตฯ…ฯƒฮทฯ‚ ฯƒฯ„ฮทฮฝ ฮšฮฟฮนฮฝฮฎ ฯ‡ฯฮฎฯƒฮท ฮฑฯฯ‡ฮตฮฏฯ‰ฮฝ ฮบฮฑฯ„ฮฑฮณฯฮฑฯ†ฮฎฯ‚. ฮœฯ€ฮฟฯฮตฮฏ ฮฝฮฑ ฮตฯ€ฮนฮฒฯฮฑฮดฯฮฝฮตฮน ฯ„ฮนฯ‚ ฮตฮณฮบฮฑฯ„ฮฑฯƒฯ„ฮฌฯƒฮตฮนฯ‚ ฯŒฯƒฮฟ ฮตฮฏฮฝฮฑฮน ฮตฮฝฮตฯฮณฯŒ. ฮ•ฯ†ฮฑฯฮผฯŒฮถฮตฯ„ฮฑฮน ฯƒฯ„ฮทฮฝ ฮตฯ€ฯŒฮผฮตฮฝฮท ฯƒฯ…ฮฝฮตฮดฯฮฏฮฑ. @@ -478,6 +500,7 @@ ฮ•ฮฝฮตฯฮณฯŒ ฮžฮตฮบฮนฮฝฮฌ ฮผฮต ฯ„ฮฟ Steam ฮžฮตฮบฮนฮฝฮฌ ฯ‡ฯ‰ฯฮฏฯ‚ ฯ„ฮฟ Steam + ฮ‘ฮฝฮฌฮปฯ…ฯƒฮท ฯ€ฮฑฮนฯ‡ฮฝฮนฮดฮนฮฟฯ ฮกฯ…ฮธฮผฮฏฯƒฮตฮนฯ‚ ฮกฯ…ฮธฮผฮฏฯƒฮตฮนฯ‚ %1$s ฮ ฯฮฟฮตฯ€ฮนฮปฮฟฮณฮฎ @@ -565,6 +588,8 @@ ฮ ฯ…ฯฮฎฮฝฮตฯ‚ ฯ€ฮฑฮนฯ‡ฮฝฮนฮดฮนฮฟฯ ฮ ฯ…ฯฮฎฮฝฮตฯ‚ ฯ€ฮฑฮนฯ‡ฮฝฮนฮดฮนฮฟฯ ฮ ฯ…ฯฮฎฮฝฮตฯ‚ ฮณฮนฮฑ ฯ€ฮฑฮนฯ‡ฮฝฮฏฮดฮนฮฑ. ฮœฮต ฯŒฮปฮฟฯ…ฯ‚ ฮตฯ€ฮนฮปฮตฮณฮผฮญฮฝฮฟฯ…ฯ‚, ฯ„ฮฟ Android ฯ„ฮฟฯ…ฯ‚ ฯ€ฯฮฟฮณฯฮฑฮผฮผฮฑฯ„ฮฏฮถฮตฮน ฮตฮปฮตฯฮธฮตฯฮฑ. + ฮ•ฮพฮฟฮนฮบฮฟฮฝฯŒฮผฮทฯƒฮท ฮตฮฝฮญฯฮณฮตฮนฮฑฯ‚ ฯƒฮต ฯƒฯ„ฮฑฮธฮตฯฮฌ ฯ€ฮฑฮนฯ‡ฮฝฮฏฮดฮนฮฑ + ฮคฯฮญฯ‡ฮตฮน ฯ„ฮฟ ฯ€ฮฑฮนฯ‡ฮฝฮฏฮดฮน ฯƒฯ„ฮฟฯ…ฯ‚ ฯ€ฮนฮฟ ฮฑฯฮณฮฟฯฯ‚ ฯ€ฯ…ฯฮฎฮฝฮตฯ‚ ฯŒฯƒฮฟ ฮบฯฮฑฯ„ฮฌ ฯƒฯ„ฮฑฮธฮตฯฯŒ ฯฯ…ฮธฮผฯŒ ฮบฮฑฯฮญ, ฮบฮฑฮน ฯ„ฮฟ ฮตฯ€ฮนฯƒฯ„ฯฮญฯ†ฮตฮน ฯƒฯ„ฮฟฯ…ฯ‚ ฯƒฯ…ฮฝฮฎฮธฮตฮนฯ‚ ฯ€ฯ…ฯฮฎฮฝฮตฯ‚ ฯ„ฮฟฯ… ฯŒฯ„ฮฑฮฝ ฮผฮญฮฝฮตฮน ฯ€ฮฏฯƒฯ‰. ฮ”ฮนฮตฯ€ฮฑฯ†ฮฎ ฯ€ฮตฮปฮฌฯ„ฮท ฮฮทฮผฮฑฯ„ฮฟฯ€ฮฟฮนฮทฮผฮญฮฝฮฟ GL ฮœฯ€ฮฟฯฮตฮฏ ฮฝฮฑ ฮบฮฌฮฝฮตฮน ฯ„ฮฑ ฮผฮตฮฝฮฟฯ ฯ„ฮฟฯ… Steam ฯ€ฮนฮฟ ฮฑฯ€ฮฟฮบฯฮฏฯƒฮนฮผฮฑ. @@ -600,7 +625,10 @@ ฮ‘ฯ€ฮตฮฝฮตฯฮณฮฟฯ€ฮฟฮนฮตฮฏ ฯ„ฮฟฮฝ ฮฒฮฟฮทฮธฯŒ ฯ€ฮปฮฟฮฎฮณฮทฯƒฮทฯ‚ ฮผฮต ฯ‡ฮตฮนฯฮนฯƒฯ„ฮฎฯฮนฮฟ ฯ„ฮฟฯ… Proton, ฯ€ฮฟฯ… ฮบฮฟฯƒฯ„ฮฏฮถฮตฮน CPU ฯƒฮต ฮบฮฌฮธฮต ฯ€ฮฑฮนฯ‡ฮฝฮฏฮดฮน. ฮ•ฮบฯ„ฮญฮปฮตฯƒฮท ฯ„ฮฟฯ… proot ฯ‡ฯ‰ฯฮฏฯ‚ seccomp ฮœฯ€ฮฟฯฮตฮฏ ฮฝฮฑ ฮดฮนฮฟฯฮธฯŽฯƒฮตฮน ฯƒฯ†ฮฌฮปฮผฮฑฯ„ฮฑ ฮฑฯ€ฯŒฮฝฯ„ฯ‰ฮฝ syscall ฯƒฮต ฮฟฯฮนฯƒฮผฮญฮฝฮฟฯ…ฯ‚ ฯ€ฯ…ฯฮฎฮฝฮตฯ‚. ฮœฯ€ฮฟฯฮตฮฏ ฮฝฮฑ ฮผฮตฮนฯŽฯƒฮตฮน ฯ„ฮทฮฝ ฮฑฯ€ฯŒฮดฮฟฯƒฮท. + ฮ•ฮบฯ„ฮญฮปฮตฯƒฮท ฯ‡ฯ‰ฯฮฏฯ‚ proot (ฯ€ฮตฮนฯฮฑฮผฮฑฯ„ฮนฮบฯŒ) + ฮ•ฮบฮบฮนฮฝฮตฮฏ ฯ„ฮฟ ฯƒฮบฮญฮปฮฟฯ‚ Linux ฮฑฯ€ฮตฯ…ฮธฮตฮฏฮฑฯ‚ ฯƒฯ„ฮฟ Android. ฮ™ฯƒฯ‡ฯฮตฮน ฮณฮนฮฑ ฯ„ฮทฮฝ ฮตฯ€ฯŒฮผฮตฮฝฮท ฯƒฯ…ฮฝฮตฮดฯฮฏฮฑ. ฮ‘ฯ€ฮตฮฝฮตฯฮณฮฟฯ€ฮฟฮนฮฎฯƒฯ„ฮต ฯ„ฮฟ ฮฑฮฝ ฮบฮฌฯ„ฮน ฮดฮตฮฝ ฮตฮบฮบฮนฮฝฮตฮฏฯ„ฮฑฮน. ฮคฮฑฯ‡ฮตฮฏฮฑ ฮดฮนฮฑฮดฯฮฟฮผฮฎ proot + ฮ”ฮตฮฝ ฯ‡ฯฮทฯƒฮนฮผฮฟฯ€ฮฟฮนฮตฮฏฯ„ฮฑฮน ฯ‡ฯ‰ฯฮฏฯ‚ proot. ฮ‘ฯ€ฮฑฮนฯ„ฮตฮฏ ฯ„ฮฟ ฯ†ฮฏฮปฯ„ฯฮฟ seccomp ฯ„ฮฟฯ… proot. ฮคฮฑฯ‡ฯฯ„ฮตฯฮท ฮฑฮฝฮฑฮถฮฎฯ„ฮทฯƒฮท ฮฑฯฯ‡ฮตฮฏฯ‰ฮฝ ฮบฮฑฮน ฮปฮนฮณฯŒฯ„ฮตฯฮฑ ฮบฮฟฮปฮปฮฎฮผฮฑฯ„ฮฑ. ฮ‘ฯ€ฮตฮฝฮตฯฮณฮฟฯ€ฮฟฮนฮฎฯƒฯ„ฮต ฯ„ฮฟ ฮฑฮฝ ฮญฮฝฮฑ ฯ€ฯฯŒฮณฯฮฑฮผฮผฮฑ ฮดฮตฮฝ ฮผฯ€ฮฟฯฮตฮฏ ฮฝฮฑ ฮฒฯฮตฮน ฯ„ฮฑ ฮฑฯฯ‡ฮตฮฏฮฑ ฯ„ฮฟฯ…. ฮฃฯ‡ฮตฮดฮฏฮฑฯƒฮท ฯ„ฮฟฯ… ฮดฮตฮฏฮบฯ„ฮท ฮผฮญฯƒฮฑ ฯƒฯ„ฮฟ gamescope @@ -683,6 +711,7 @@ ฮœฮฝฮฎฮผฮท ฮณฯฮฑฯ†ฮนฮบฯŽฮฝ ฮœฮฝฮฎฮผฮท swap ฮฃฯ„ฮฌฮธฮผฮท ฮผฯ€ฮฑฯ„ฮฑฯฮฏฮฑฯ‚ + ฮฅฯ€ฮฟฮปฮตฮนฯ€ฯŒฮผฮตฮฝฮท ฮดฮนฮฌฯฮบฮตฮนฮฑ ฮผฯ€ฮฑฯ„ฮฑฯฮฏฮฑฯ‚ ฮšฮฑฯ„ฮฑฮฝฮฌฮปฯ‰ฯƒฮท ฮนฯƒฯ‡ฯฮฟฯ‚ ฮ”ฮฏฮบฯ„ฯ…ฮฟ ฮ‘ฮฝฮฌฮปฯ…ฯƒฮท @@ -809,6 +838,7 @@ ฮ— ฯƒฯ…ฯƒฮบฮตฯ…ฮฎ ฯ…ฯ€ฮฟฯƒฯ„ฮทฯฮฏฮถฮตฯ„ฮฑฮน ฮœฮท ฮดฮฟฮบฮนฮผฮฑฯƒฮผฮญฮฝฮท GPU ฮ— GPU ฮดฮตฮฝ ฯ…ฯ€ฮฟฯƒฯ„ฮทฯฮฏฮถฮตฯ„ฮฑฮน + GPU ฮผฮญฯƒฯ‰ ฮณฮญฯ†ฯ…ฯฮฑฯ‚ Mali %1$s ยท %2$s %1$s: %2$s ฮ”ฮตฮฝ ฯ…ฯ€ฮฌฯฯ‡ฮตฮน ฯƒฯ…ฮผฮฒฮฑฯ„ฯŒ ฯ…ฯ€ฮฟฯƒฯฯƒฯ„ฮทฮผฮฑ ฮณฯฮฑฯ†ฮนฮบฯŽฮฝ ฮณฮนฮฑ %1$s. ฮคฮฟ Steam ฮผฯ€ฮฟฯฮตฮฏ ฮฝฮฑ ฮตฮผฯ†ฮฑฮฝฮฏฯƒฮตฮน ฮผฮฑฯฯฮท ฮฟฮธฯŒฮฝฮท. @@ -838,15 +868,38 @@ ฮฃฯ…ฮฝฮตฮดฯฮฏฮฑ ฮ‘ฯฯ‡ฮตฮฏฮฑ ฮบฮฑฯ„ฮฑฮณฯฮฑฯ†ฮฎฯ‚ ฯƒฯ…ฮฝฮตฮดฯฮฏฮฑฯ‚ ฮ‘ฯ€ฮฟฮธฮทฮบฮตฯฮฟฮฝฯ„ฮฑฮน ฮผฮตฯ„ฮฌ ฮฑฯ€ฯŒ ฮบฮฌฮธฮต ฯƒฯ…ฮฝฮตฮดฯฮฏฮฑ + ฮ•ฮฝฮนฯƒฯ‡ฯ…ฮผฮญฮฝฮฑ ฮดฮนฮฑฮณฮฝฯ‰ฯƒฯ„ฮนฮบฮฌ ฮณฮนฮฑ ฯ„ฮทฮฝ ฮตฯ€ฯŒฮผฮตฮฝฮท ฯƒฯ…ฮฝฮตฮดฯฮฏฮฑ + ฮšฮฑฯ„ฮฑฮณฯฮฌฯ†ฮตฮน ฮปฮตฯ€ฯ„ฮฟฮผฮตฯฮฎ ฮฑฯฯ‡ฮตฮฏฮฑ ฮบฮฑฯ„ฮฑฮณฯฮฑฯ†ฮฎฯ‚ ฮณฮนฮฑ ฮผฮฏฮฑ ฯƒฯ…ฮฝฮตฮดฯฮฏฮฑ. ฮ•ฮฝฮดฮญฯ‡ฮตฯ„ฮฑฮน ฮฝฮฑ ฮผฮตฮนฯŽฯƒฮตฮน ฯ„ฮนฯ‚ ฮตฯ€ฮนฮดฯŒฯƒฮตฮนฯ‚ ฮบฮฑฮน ฮฝฮฑ ฯ‡ฯฮทฯƒฮนฮผฮฟฯ€ฮฟฮนฮฎฯƒฮตฮน ฯ€ฮตฯฮนฯƒฯƒฯŒฯ„ฮตฯฮฟ ฯ‡ฯŽฯฮฟ. ฮ‘ฯ€ฮตฮฝฮตฯฮณฮฟฯ€ฮฟฮนฮตฮฏฯ„ฮฑฮน ฮฑฯ…ฯ„ฯŒฮผฮฑฯ„ฮฑ ฮผฮต ฯ„ฮทฮฝ ฮญฮฝฮฑฯฮพฮท ฯ„ฮทฯ‚ ฯƒฯ…ฮฝฮตฮดฯฮฏฮฑฯ‚ยท ฮตฮปฮญฮณฮพฯ„ฮต ฯ„ฮฑ ฮฑฯฯ‡ฮตฮฏฮฑ ฮบฮฑฯ„ฮฑฮณฯฮฑฯ†ฮฎฯ‚ ฯ€ฯฮนฮฝ ฯ„ฮฑ ฮผฮฟฮนฯฮฑฯƒฯ„ฮตฮฏฯ„ฮต. ฮ‘ฯฯ‡ฮตฮฏฮฑ ฮบฮฑฯ„ฮฑฮณฯฮฑฯ†ฮฎฯ‚ ฮตฮฝฯ„ฮฟฯ€ฮนฯƒฮผฮฟฯ ฯƒฯ†ฮฑฮปฮผฮฌฯ„ฯ‰ฮฝ ฯ€ฮฑฮนฯ‡ฮฝฮนฮดฮนฯŽฮฝ ฮฃฯ…ฮผฯ€ฮตฯฮฏฮปฮทฯˆฮท ฮดฮนฮฑฮณฮฝฯ‰ฯƒฯ„ฮนฮบฯŽฮฝ Proton, Wine ฮบฮฑฮน ฮณฯฮฑฯ†ฮนฮบฯŽฮฝ ฯƒฯ„ฮทฮฝ ฮตฯ€ฯŒฮผฮตฮฝฮท ฮตฮบฮบฮฏฮฝฮทฯƒฮท ฯ€ฮฑฮนฯ‡ฮฝฮนฮดฮนฮฟฯ. ฮœฯ€ฮฟฯฮตฮฏ ฮฝฮฑ ฮผฮตฮนฯŽฯƒฮตฮน ฯ„ฮทฮฝ ฮฑฯ€ฯŒฮดฮฟฯƒฮท ฮบฮฑฮน ฮฝฮฑ ฯ‡ฯฮทฯƒฮนฮผฮฟฯ€ฮฟฮนฮฎฯƒฮตฮน ฯ€ฮตฯฮนฯƒฯƒฯŒฯ„ฮตฯฮฟ ฯ‡ฯŽฯฮฟ. ฮ•ฯ€ฮฑฮฝฮตฮบฮบฮนฮฝฮฎฯƒฯ„ฮต ฮฑฯ…ฯ„ฮฎ ฯ„ฮท ฯƒฯ…ฮฝฮตฮดฯฮฏฮฑ ฮณฮนฮฑ ฮฝฮฑ ฮฑฯ€ฮฟฮธฮทฮบฮตฯฯƒฮตฯ„ฮต ฮฑฯฯ‡ฮตฮฏฮฑ ฮบฮฑฯ„ฮฑฮณฯฮฑฯ†ฮฎฯ‚ ฮตฮฝฯ„ฮฟฯ€ฮนฯƒฮผฮฟฯ ฯƒฯ†ฮฑฮปฮผฮฌฯ„ฯ‰ฮฝ ฯ€ฮฑฮนฯ‡ฮฝฮนฮดฮนฯŽฮฝ ฮ”ฮตฮฝ ฮฎฯ„ฮฑฮฝ ฮดฯ…ฮฝฮฑฯ„ฮฎ ฮท ฮตฮฝฮทฮผฮญฯฯ‰ฯƒฮท ฯ„ฮทฯ‚ ฮบฮฑฯ„ฮฑฮณฯฮฑฯ†ฮฎฯ‚. ฮ•ฮปฮญฮณฮพฯ„ฮต ฯ„ฮฟฮฝ ฮดฮนฮฑฮบฯŒฯ€ฯ„ฮท ฮบฮฑฮน ฮดฮฟฮบฮนฮผฮฌฯƒฯ„ฮต ฮพฮฑฮฝฮฌ. ฮ•ฯฮณฮฑฮปฮตฮฏฮฑ ฮตฮฝฯ„ฮฟฯ€ฮนฯƒฮผฮฟฯ ฯƒฯ†ฮฑฮปฮผฮฌฯ„ฯ‰ฮฝ + ฮ›ฮตฯ€ฯ„ฮฟฮผฮตฯฮฎ ฮฑฯฯ‡ฮตฮฏฮฑ ฮบฮฑฯ„ฮฑฮณฯฮฑฯ†ฮฎฯ‚ ฮณฯฮฑฯ†ฮนฮบฯŽฮฝ + ฮ”ฮนฮตฯ€ฮฑฯ†ฮฎ Steam: ฯƒฯ‡ฮตฮดฮฏฮฑฯƒฮท ฮผฮต GPU + ฮœฮต ฯ„ฮฟ ฮถฮตฯฮณฮฟฯ‚ ฯ€ฯฮฟฮณฯฮฑฮผฮผฮฌฯ„ฯ‰ฮฝ ฮฟฮดฮฎฮณฮทฯƒฮทฯ‚ Xclipse, ฯ„ฮฟ Steam ฯƒฯ‡ฮตฮดฮนฮฌฮถฮตฮน ฯ„ฮนฯ‚ ฯƒฮตฮปฮฏฮดฮตฯ‚ ฯ„ฮฟฯ… ฮผฮญฯƒฯ‰ ฮปฮฟฮณฮนฯƒฮผฮนฮบฮฟฯ (ฮท ฯƒฯ‡ฮตฮดฮฏฮฑฯƒฮท ฮผฮต GPU ฮตฮผฯ†ฮฌฮฝฮนฮถฮต ฯƒฯ€ฮฑฯƒฮผฮญฮฝฮฑ ฯ€ฮปฮฑฮบฮฏฮดฮนฮฑ). ฮ•ฮฝฮตฯฮณฮฟฯ€ฮฟฮนฮฎฯƒฯ„ฮต ฯ„ฮฟ ฮณฮนฮฑ ฯ„ฮฑฯ‡ฯฯ„ฮตฯฮท ฮดฮนฮตฯ€ฮฑฯ†ฮฎ Steam, ฮฑฮฝ ฯ†ฮฑฮฏฮฝฮตฯ„ฮฑฮน ฯƒฯ‰ฯƒฯ„ฮฎ ฯƒฮต ฮฑฯ…ฯ„ฯŒ ฯ„ฮฟ ฯ„ฮทฮปฮญฯ†ฯ‰ฮฝฮฟ. + ฮดฮทฮผฮนฮฟฯ…ฯฮณฮฎฮธฮทฮบฮต %1$s + %1$s ฮตฮฝฮทฮผฮตฯฯŽฮธฮทฮบฮต ฯƒฯ„ฮทฮฝ ฯ€ฮนฮฟ ฯ€ฯฯŒฯƒฯ†ฮฑฯ„ฮท ฮญฮบฮดฮฟฯƒฮท + ฮ— ฮณฮญฯ†ฯ…ฯฮฑ Mali ฮฑฯ€ฮญฯ„ฯ…ฯ‡ฮต ฯƒฯ„ฮฟฮฝ ฮฑฯ…ฯ„ฮฟฮญฮปฮตฮณฯ‡ฯŒ ฯ„ฮทฯ‚ ฯƒฯ„ฮฟ %1$s ฮบฮฑฯ„ฮฌ ฯ„ฮทฮฝ ฯ€ฯฮฟฮทฮณฮฟฯฮผฮตฮฝฮท ฯƒฯ…ฮฝฮตฮดฯฮฏฮฑ (ฮตฮนฮบฯŒฮฝฮตฯ‚ ฮฎ ฮบฮปฮฎฯƒฮตฮนฯ‚ ฯƒฯ‡ฮตฮดฮฏฮฑฯƒฮทฯ‚), ฮฟฯ€ฯŒฯ„ฮต ฮท ฯƒฯ…ฮฝฮตฮดฯฮฏฮฑ ฯ‡ฯฮทฯƒฮนฮผฮฟฯ€ฮฟฮฏฮทฯƒฮต ฯƒฯ„ฮท ฮธฮญฯƒฮท ฯ„ฮทฯ‚ ฯ„ฮฟ ฮถฮตฯฮณฮฟฯ‚ ฮฟฮดฮทฮณฯŽฮฝ PanVK. + ฮ— ฮณฮญฯ†ฯ…ฯฮฑ Mali ฮดฮตฮฝ ฮฒฯฮฎฮบฮต ฯ„ฯฯŒฯ€ฮฟ ฮฝฮฑ ฮผฮฟฮนฯฮฑฯƒฯ„ฮตฮฏ ฮผฮฝฮฎฮผฮท ฮผฮต ฯ„ฮฟฮฝ ฮฟฮดฮทฮณฯŒ ฯƒฯ„ฮฟ %1$s ฮบฮฑฯ„ฮฌ ฯ„ฮทฮฝ ฯ€ฯฮฟฮทฮณฮฟฯฮผฮตฮฝฮท ฯƒฯ…ฮฝฮตฮดฯฮฏฮฑ, ฮฟฯ€ฯŒฯ„ฮต ฮท ฯƒฯ…ฮฝฮตฮดฯฮฏฮฑ ฯ‡ฯฮทฯƒฮนฮผฮฟฯ€ฮฟฮฏฮทฯƒฮต ฯƒฯ„ฮท ฮธฮญฯƒฮท ฯ„ฮทฯ‚ ฯ„ฮฟ ฮถฮตฯฮณฮฟฯ‚ ฮฟฮดฮทฮณฯŽฮฝ PanVK. ฮ— ฮณฮญฯ†ฯ…ฯฮฑ ฮดฮตฮฝ ฮผฯ€ฮฟฯฮตฮฏ ฮฝฮฑ ฮปฮตฮนฯ„ฮฟฯ…ฯฮณฮฎฯƒฮตฮน ฯƒฮต ฮฑฯ…ฯ„ฯŒ ฯ„ฮฟ ฯ„ฮทฮปฮญฯ†ฯ‰ฮฝฮฟยท ฮท ฮฑฯ€ฮตฮฝฮตฯฮณฮฟฯ€ฮฟฮฏฮทฯƒฮฎ ฯ„ฮทฯ‚ ฮดฮนฮฑฯ„ฮทฯฮตฮฏ ฯ„ฮฟ ฮถฮตฯฮณฮฟฯ‚ PanVK. + ฮคฮฑ ฮฑฯฯ‡ฮตฮฏฮฑ ฮบฮฑฯ„ฮฑฮณฯฮฑฯ†ฮฎฯ‚ Proton, DXVK ฮบฮฑฮน ฮฟฮดฮทฮณฯŽฮฝ ฮบฮฌฮธฮต ฯ€ฮฑฮนฯ‡ฮฝฮนฮดฮนฮฟฯ ฯ€ฯฮฟฯƒฯ„ฮฏฮธฮตฮฝฯ„ฮฑฮน ฯƒฯ„ฮฑ ฮฑฯฯ‡ฮตฮฏฮฑ ฮบฮฑฯ„ฮฑฮณฯฮฑฯ†ฮฎฯ‚ ฯ„ฮทฯ‚ ฯƒฯ…ฮฝฮตฮดฯฮฏฮฑฯ‚. ฮ ฮฌฮฝฯ„ฮฑ ฮตฮฝฮตฯฮณฯŒ ฯŒฯ„ฮฑฮฝ ฮท GPU ฮดฮตฮฝ ฮตฮฏฮฝฮฑฮน Adreno. ฮ ฮนฮฟ ฯ€ฯฯŒฯƒฯ†ฮฑฯ„ฮฑ ฮฑฯฯ‡ฮตฮฏฮฑ ฮบฮฑฯ„ฮฑฮณฯฮฑฯ†ฮฎฯ‚ ฯƒฯ…ฮฝฮตฮดฯฮฏฮฑฯ‚ ฮ‘ฯ€ฮฟฮธฮทฮบฮตฯ…ฮผฮญฮฝฮฑ ฮฑฯฯ‡ฮตฮฏฮฑ ฮบฮฑฯ„ฮฑฮณฯฮฑฯ†ฮฎฯ‚ ฯƒฯ…ฮฝฮตฮดฯฮฏฮฑฯ‚ ฮ”ฮนฮฑฯ„ฮทฯฮตฮฏ ฯ„ฮฑ %1$d ฯ€ฮนฮฟ ฯ€ฯฯŒฯƒฯ†ฮฑฯ„ฮฑ ฮ•ฮบฮบฮฑฮธฮฌฯฮนฯƒฮท ฮฑฯฯ‡ฮตฮฏฯ‰ฮฝ ฮบฮฑฯ„ฮฑฮณฯฮฑฯ†ฮฎฯ‚ + ฮ”ฮนฮฑฮธฮญฯƒฮนฮผฮฑ ฮฑฯฯ‡ฮตฮฏฮฑ ฮบฮฑฯ„ฮฑฮณฯฮฑฯ†ฮฎฯ‚ ฯƒฯ…ฮฝฮตฮดฯฮนฯŽฮฝ + ฮ”ฮตฮฝ ฯ…ฯ€ฮฌฯฯ‡ฮฟฯ…ฮฝ ฮฑฮบฯŒฮผฮท ฮฑฯ€ฮฟฮธฮทฮบฮตฯ…ฮผฮญฮฝฮฑ ฮฑฯฯ‡ฮตฮฏฮฑ ฮบฮฑฯ„ฮฑฮณฯฮฑฯ†ฮฎฯ‚ ฯƒฯ…ฮฝฮตฮดฯฮฏฮฑฯ‚. + ฮคฮฑ ฮฑฯฯ‡ฮตฮฏฮฑ ZIP ฯ€ฮฟฯ… ฮบฮฟฮนฮฝฮฟฯ€ฮฟฮนฮฟฯฮฝฯ„ฮฑฮน ฮฎ ฮฑฯ€ฮฟฮธฮทฮบฮตฯฮฟฮฝฯ„ฮฑฮน ฯ€ฮตฯฮนฮปฮฑฮผฮฒฮฌฮฝฮฟฯ…ฮฝ ฯ„ฮทฮฝ ฮตฯ€ฮนฮปฮตฮณฮผฮญฮฝฮท ฯƒฯ…ฮฝฮตฮดฯฮฏฮฑ ฮบฮฑฮน ฯ„ฮฑ ฯƒฯ‡ฮตฯ„ฮนฮบฮฌ ฮดฮนฮฑฮณฮฝฯ‰ฯƒฯ„ฮนฮบฮฌ Steam, ฮบฮฑฯ„ฮฑฯƒฯ„ฮฎฮผฮฑฯ„ฮฟฯ‚, ฮตฯฮณฮฑฮปฮตฮฏฯ‰ฮฝ ฮบฮฑฮน Battle.net. + %1$s ยท %2$s + ฮคฯฮญฯ‡ฮฟฯ…ฯƒฮฑ ฯƒฯ…ฮฝฮตฮดฯฮฏฮฑ + ฮšฮฟฮนฮฝฮฟฯ€ฮฟฮฏฮทฯƒฮท + ฮ‘ฯ€ฮฟฮธฮฎฮบฮตฯ…ฯƒฮท ฯƒฯ„ฮท ฯƒฯ…ฯƒฮบฮตฯ…ฮฎ + ฮ”ฮนฮฑฮณฯฮฑฯ†ฮฎ + ฮ”ฮนฮฑฮณฯฮฑฯ†ฮฎ ฮฑฯฯ‡ฮตฮฏฯ‰ฮฝ ฮบฮฑฯ„ฮฑฮณฯฮฑฯ†ฮฎฯ‚ ฯƒฯ…ฮฝฮตฮดฯฮฏฮฑฯ‚; + ฮ”ฮนฮฑฮณฯฮฑฯ†ฮฎ ฯ„ฮฟฯ… %1$s; ฮ”ฮตฮฝ ฮผฯ€ฮฟฯฮตฮฏ ฮฝฮฑ ฮฑฮฝฮฑฮนฯฮตฮธฮตฮฏ. + ฮคฮฑ ฮฑฯฯ‡ฮตฮฏฮฑ ฮบฮฑฯ„ฮฑฮณฯฮฑฯ†ฮฎฯ‚ ฯƒฯ…ฮฝฮตฮดฯฮฏฮฑฯ‚ ฮฑฯ€ฮฟฮธฮทฮบฮตฯฯ„ฮทฮบฮฑฮฝ. + ฮ”ฮตฮฝ ฮฎฯ„ฮฑฮฝ ฮดฯ…ฮฝฮฑฯ„ฮฎ ฮท ฮฑฯ€ฮฟฮธฮฎฮบฮตฯ…ฯƒฮท ฯ„ฯ‰ฮฝ ฮฑฯฯ‡ฮตฮฏฯ‰ฮฝ ฮบฮฑฯ„ฮฑฮณฯฮฑฯ†ฮฎฯ‚ ฯƒฯ…ฮฝฮตฮดฯฮฏฮฑฯ‚. + ฮ”ฮตฮฝ ฮฎฯ„ฮฑฮฝ ฮดฯ…ฮฝฮฑฯ„ฮฎ ฮท ฮดฮนฮฑฮณฯฮฑฯ†ฮฎ ฯ„ฯ‰ฮฝ ฮฑฯฯ‡ฮตฮฏฯ‰ฮฝ ฮบฮฑฯ„ฮฑฮณฯฮฑฯ†ฮฎฯ‚ ฯƒฯ…ฮฝฮตฮดฯฮฏฮฑฯ‚. ฮ•ฯ€ฮฑฮฝฮฑฯ†ฮฟฯฮฌ ฯŒฮปฯ‰ฮฝ ฯ„ฯ‰ฮฝ ฯฯ…ฮธฮผฮฏฯƒฮตฯ‰ฮฝ ฮ•ฯ€ฮฑฮฝฮฑฯ†ฮญฯฮตฮน ฮบฮฌฮธฮต ฯฯฮธฮผฮนฯƒฮท ฯƒฯ„ฮทฮฝ ฯ€ฯฮฟฮตฯ€ฮนฮปฮตฮณฮผฮญฮฝฮท ฯ„ฮนฮผฮฎ ฮ•ฯ€ฮฑฮฝฮฑฯ†ฮฟฯฮฌ @@ -873,6 +926,8 @@ ฮงฯฮฎฯƒฮท ฯ‰ฯ‚ ฮฑฯฯ‡ฮนฮบฮฎ ฮฟฮธฯŒฮฝฮท ฮคฮฟ DroidDeck ฮผฯ€ฮฟฯฮตฮฏ ฮฝฮฑ ฮตฮฏฮฝฮฑฮน ฮท ฮตฯ†ฮฑฯฮผฮฟฮณฮฎ ฮฑฯฯ‡ฮนฮบฮฎฯ‚ ฮฟฮธฯŒฮฝฮทฯ‚ ฮคฮฟ DroidDeck ฮดฮตฮฝ ฯ€ฯฮฟฯ„ฮตฮฏฮฝฮตฯ„ฮฑฮน ฯ€ฮฟฯ„ฮญ ฯ‰ฯ‚ ฮตฯ†ฮฑฯฮผฮฟฮณฮฎ ฮฑฯฯ‡ฮนฮบฮฎฯ‚ ฮฟฮธฯŒฮฝฮทฯ‚ + ฮคฮฟ ฮบฮฟฯ…ฮผฯ€ฮฏ ฮ‘ฯฯ‡ฮนฮบฮฎฯ‚ ฮฟฮธฯŒฮฝฮทฯ‚ ฮฑฮฝฮฟฮฏฮณฮตฮน + ฮ— ฯƒฮตฮปฮฏฮดฮฑ ฯ€ฮฟฯ… ฮตฮผฯ†ฮฑฮฝฮฏฮถฮตฯ„ฮฑฮน ฯŒฯ„ฮฑฮฝ ฯ„ฮฟ DroidDeck ฮตฮฏฮฝฮฑฮน ฮท ฮตฯ†ฮฑฯฮผฮฟฮณฮฎ ฮ‘ฯฯ‡ฮนฮบฮฎฯ‚ ฮฟฮธฯŒฮฝฮทฯ‚ ฮบฮฑฮน ฯ€ฮฑฯ„ฮฌฯ„ฮต ฯ„ฮฟ ฮบฮฟฯ…ฮผฯ€ฮฏ ฮ‘ฯฯ‡ฮนฮบฮฎฯ‚ ฮฟฮธฯŒฮฝฮทฯ‚ ฮฃฯ„ฮทฮฝ ฮ ฯฮฟฯƒฮธฮฎฮบฮท ฯ€ฮฑฮนฯ‡ฮฝฮนฮดฮนฯŽฮฝ, ฮฟฯฮฏฯƒฯ„ฮต ฯ„ฮฟ DroidDeck ฯƒฮต ฮฃฯ…ฮผฯ€ฮตฯฮฏฮปฮทฯˆฮท ฮ ฯฮฟฯƒฮฑฮฝฮฑฯ„ฮฟฮปฮนฯƒฮผฯŒฯ‚ ฮ ฯฮฟฯƒฮฑฮฝฮฑฯ„ฮฟฮปฮนฯƒฮผฯŒฯ‚ launcher @@ -886,15 +941,22 @@ ฮ ฮปฮฎฯฮทฯ‚ ฮฟฮธฯŒฮฝฮท ฮ‘ฯ€ฮฟฮบฯฯฯ€ฯ„ฮตฮน ฯ„ฮนฯ‚ ฮณฯฮฑฮผฮผฮญฯ‚ ฮบฮฑฯ„ฮฌฯƒฯ„ฮฑฯƒฮทฯ‚ ฮบฮฑฮน ฯ€ฮปฮฟฮฎฮณฮทฯƒฮทฯ‚ ฯ„ฮฟฯ… Android ฮ•ฮผฯ†ฮฑฮฝฮฏฮถฮตฮน ฯ„ฮนฯ‚ ฮณฯฮฑฮผฮผฮญฯ‚ ฮบฮฑฯ„ฮฌฯƒฯ„ฮฑฯƒฮทฯ‚ ฮบฮฑฮน ฯ€ฮปฮฟฮฎฮณฮทฯƒฮทฯ‚ ฯ„ฮฟฯ… Android + ฮ•ฮบฮบฮนฮฝฮทฯ„ฮฎฯ‚ ฮดฮนฯ€ฮปฮฎฯ‚ ฮฟฮธฯŒฮฝฮทฯ‚ + ฮ— ฮตฯ€ฮนฮปฮฟฮณฮฎ ฮ‘ฯ…ฯ„ฯŒฮผฮฑฯ„ฮฑ ฯ„ฮฟฯ€ฮฟฮธฮตฯ„ฮตฮฏ ฯ„ฮนฯ‚ ฮตฮฝฯŒฯ„ฮทฯ„ฮตฯ‚ ฯ„ฮฟฯ… ฮตฮบฮบฮนฮฝฮทฯ„ฮฎ (Steam, ฮ’ฮนฮฒฮปฮนฮฟฮธฮฎฮบฮท, ฮšฮฑฯ„ฮฑฯƒฯ„ฮฎฮผฮฑฯ„ฮฑ ฮบฮฑฮน ฯ„ฮนฯ‚ ฯ…ฯ€ฯŒฮปฮฟฮนฯ€ฮตฯ‚) ฯƒฯ„ฮท ฮดฮตฯฯ„ฮตฯฮท ฮฟฮธฯŒฮฝฮท ฯ„ฯ‰ฮฝ ฯ†ฮฟฯฮทฯ„ฯŽฮฝ ฮบฮฟฮฝฯƒฮฟฮปฯŽฮฝ ฮผฮต ฮตฮฝฯƒฯ‰ฮผฮฑฯ„ฯ‰ฮผฮญฮฝฮท ฮดฮตฯฯ„ฮตฯฮท ฮฟฮธฯŒฮฝฮท. ฮ— ฮตฯ€ฮนฮปฮฟฮณฮฎ ฮ•ฮฝฮตฯฮณฯŒ ฯ‡ฯฮทฯƒฮนฮผฮฟฯ€ฮฟฮนฮตฮฏ ฮฟฯ€ฮฟฮนฮฑฮดฮฎฯ€ฮฟฯ„ฮต ฮดฮตฯฯ„ฮตฯฮท ฮฟฮธฯŒฮฝฮท. ฮ— ฮตฯ€ฮนฮปฮฟฮณฮฎ ฮ‘ฮฝฮตฮฝฮตฯฮณฯŒ ฮบฯฮฑฯ„ฮฌ ฯ„ฮฟฮฝ ฮตฮบฮบฮนฮฝฮทฯ„ฮฎ ฯƒฮต ฮผฮฏฮฑ ฮฟฮธฯŒฮฝฮท. + ฮฃฯ…ฮฝฮตฮดฯฮฏฮตฯ‚ ฮดฮนฯ€ฮปฮฎฯ‚ ฮฟฮธฯŒฮฝฮทฯ‚ + ฮ— ฮตฯ€ฮนฮปฮฟฮณฮฎ ฮ‘ฯ…ฯ„ฯŒฮผฮฑฯ„ฮฑ ฯ„ฮฟฯ€ฮฟฮธฮตฯ„ฮตฮฏ ฯ„ฮฟ ฮผฮตฮฝฮฟฯ ฮตฮฝฯ„ฯŒฯ‚ ฯ€ฮฑฮนฯ‡ฮฝฮนฮดฮนฮฟฯ ฯƒฯ„ฮทฮฝ ฮตฮฝฯƒฯ‰ฮผฮฑฯ„ฯ‰ฮผฮญฮฝฮท ฮดฮตฯฯ„ฮตฯฮท ฮฟฮธฯŒฮฝฮท ฮฑฮฝฯ„ฮฏ ฮณฮนฮฑ ฮฑฮฝฮฑฮดฯ…ฯŒฮผฮตฮฝฮฟ ฯ€ฮฑฯฮฌฮธฯ…ฯฮฟ. ฮ— ฮตฯ€ฮนฮปฮฟฮณฮฎ ฮ•ฮฝฮตฯฮณฯŒ ฯ‡ฯฮทฯƒฮนฮผฮฟฯ€ฮฟฮนฮตฮฏ ฮฟฯ€ฮฟฮนฮฑฮดฮฎฯ€ฮฟฯ„ฮต ฮดฮตฯฯ„ฮตฯฮท ฮฟฮธฯŒฮฝฮท. ฮ— ฮตฯ€ฮนฮปฮฟฮณฮฎ ฮ‘ฮฝฮตฮฝฮตฯฮณฯŒ ฮดฮนฮฑฯ„ฮทฯฮตฮฏ ฯ„ฮฟ ฮผฮตฮฝฮฟฯ ฯƒฯ„ฮทฮฝ ฮฟฮธฯŒฮฝฮท ฯ„ฮฟฯ… ฯ€ฮฑฮนฯ‡ฮฝฮนฮดฮนฮฟฯยท ฮผฯ€ฮฟฯฮตฮฏฯ„ฮต ฮฑฮบฯŒฮผฮท ฮฝฮฑ ฮตฯ€ฮนฮปฮญฮพฮตฯ„ฮต ฮดฮตฯฯ„ฮตฯฮท ฮฟฮธฯŒฮฝฮท ฮฑฯ€ฯŒ ฮฑฯ…ฯ„ฯŒ. ฮ‘ฯ…ฯ„ฯŒฮผฮฑฯ„ฮฟ ฮ•ฮฝฮตฯฮณฯŒ ฮ‘ฮฝฮตฮฝฮตฯฮณฯŒ ฮงฮตฮนฯฮนฯƒฯ„ฮฎฯฮนฮฑ ฮบฮฌฯ„ฯ‰ ฮฟฮธฯŒฮฝฮทฯ‚ ฯƒฯ„ฮฑ ฯ€ฮฑฮนฯ‡ฮฝฮฏฮดฮนฮฑ + ฮ ฮปฮทฮบฯ„ฯฮฟฮปฯŒฮณฮนฮฟ Android ฮณฮนฮฑ ฯ€ฮตฮดฮฏฮฑ ฮบฮตฮนฮผฮญฮฝฮฟฯ… ฮ‘ฮฝฮฟฮฏฮณฮตฮน ฯ„ฮทฮฝ ฮตฯ€ฮนฯ†ฮฌฮฝฮตฮนฮฑ ฮฑฯ†ฮฎฯ‚ ฮบฮฑฮน ฯ„ฮฟ ฯ€ฮปฮทฮบฯ„ฯฮฟฮปฯŒฮณฮนฮฟ ฯƒฯ„ฮท ฮดฮตฯฯ„ฮตฯฮท ฮฟฮธฯŒฮฝฮท ฯŒฯ„ฮฑฮฝ ฮพฮตฮบฮนฮฝฮฌ ฮผฮนฮฑ ฯƒฯ…ฮฝฮตฮดฯฮฏฮฑ. ฮ ฮปฮทฮบฯ„ฯฮฟฮปฯŒฮณฮทฯƒฮท ฮณฮนฮฑ ฯ„ฮทฮฝ ฯ€ฮฌฮฝฯ‰ ฮฟฮธฯŒฮฝฮท ฮคฮญฮปฮฟฯ‚ ฮ ฯฮฟฮตฯ€ฮนฮปฮตฮณฮผฮญฮฝฮท ฮตฯ†ฮฑฯฮผฮฟฮณฮฎ ฮฑฯฯ‡ฮนฮบฮฎฯ‚ ฮฟฮธฯŒฮฝฮทฯ‚ ฮ•ฯ€ฮนฮปฮฟฮณฮฎ ฮตฯ†ฮฑฯฮผฮฟฮณฮฎฯ‚ ฮฑฯฯ‡ฮนฮบฮฎฯ‚ ฮฟฮธฯŒฮฝฮทฯ‚ + ฮ‘ฯ€ฯŒฮบฯฯ…ฯˆฮท ฯ„ฮฟฯ… ฮตฮบฮบฮนฮฝฮทฯ„ฮฎ ฮฑฯ€ฯŒ ฯ„ฮฑ ฮ ฯฯŒฯƒฯ†ฮฑฯ„ฮฑ ฮบฮฑฯ„ฮฌ ฯ„ฮทฮฝ ฮฑฮดฯฮฌฮฝฮตฮนฮฑ + ฮ™ฯƒฯ‡ฯฮตฮน ฮผฯŒฮฝฮฟ ฯŒฯ„ฮฑฮฝ ฯ„ฮฟ DroidDeck ฮตฮฏฮฝฮฑฮน ฮท ฯ€ฯฮฟฮตฯ€ฮนฮปฮตฮณฮผฮญฮฝฮท ฮตฯ†ฮฑฯฮผฮฟฮณฮฎ ฮ‘ฯฯ‡ฮนฮบฮฎฯ‚ ฮฟฮธฯŒฮฝฮทฯ‚ ฮบฮฑฮน ฮดฮตฮฝ ฮตฮบฯ„ฮตฮปฮตฮฏฯ„ฮฑฮน ฮบฮฑฮผฮฏฮฑ ฯƒฯ…ฮฝฮตฮดฯฮฏฮฑ. ฮ•ฯ€ฮนฮปฮฟฮณฮฎ ฮ•ฯ†ฮฑฯฮผฮฟฮณฮญฯ‚ Linux (beta) ฮ‘ฯฯ‡ฮตฮฏฮฑ @@ -1006,9 +1068,172 @@ Preview ฮฮตฯŒฯ„ฮตฯฮตฯ‚ ฮดฮนฮฟฯฮธฯŽฯƒฮตฮนฯ‚, ฯ€ฯฮนฮฝ ฯ„ฮฟ Stable ฮ•ฮฝฮทฮผฮตฯฯ‰ฮผฮญฮฝฮฟ + ฮ‘ฮฝฯ„ฮนฮณฯฮฑฯ†ฮฎ ฯƒฯ„ฮฟฮนฯ‡ฮตฮฏฯ‰ฮฝ build + ฮคฮฑ ฯƒฯ„ฮฟฮนฯ‡ฮตฮฏฮฑ ฯ„ฮฟฯ… build ฮฑฮฝฯ„ฮนฮณฯฮฌฯ†ฮทฮบฮฑฮฝ + ฮฮตฯŒฯ„ฮตฯฮฟ ฮฑฯ€ฯŒ ฯ„ฮฟ Preview + ฮ•ฮฏฯƒฯ„ฮต ฮผฯ€ฯฮฟฯƒฯ„ฮฌ ฮฑฯ€ฯŒ ฯ„ฮฟ Preview + ฮ‘ฯ…ฯ„ฯŒ ฯ„ฮฟ build ฮตฮฏฮฝฮฑฮน ฮฝฮตฯŒฯ„ฮตฯฮฟ ฮฑฯ€ฯŒ ฯ„ฮฟ ฯ„ฮตฮปฮตฯ…ฯ„ฮฑฮฏฮฟ Preview. ฮคฮฟ ฮตฯ€ฯŒฮผฮตฮฝฮฟ Preview build ฮธฮฑ ฯ„ฮฟ ฮตฮฝฮทฮผฮตฯฯŽฯƒฮตฮน. + ฮ•ฯ€ฮนฮปฮญฮพฯ„ฮต ฮญฮฝฮฑ build ฮณฮนฮฑ ฮฝฮฑ ฮดฮตฮฏฯ„ฮต ฯ„ฮนฯ‚ ฮฑฮปฮปฮฑฮณฮญฯ‚ ฮฎ ฮฝฮฑ ฯ„ฮฟ ฮตฮณฮบฮฑฯ„ฮฑฯƒฯ„ฮฎฯƒฮตฯ„ฮต. + ฮ•ฮณฮบฮฑฯ„ฮตฯƒฯ„ฮทฮผฮญฮฝฮฟ + ฮ•ฮณฮบฮฑฯ„ฮฌฯƒฯ„ฮฑฯƒฮท ฮฑฯ…ฯ„ฮฟฯ ฯ„ฮฟฯ… build%1$s + ฮ•ฯ€ฮนฯƒฯ„ฯฮฟฯ†ฮฎ ฯƒฮต ฮฑฯ…ฯ„ฯŒ ฯ„ฮฟ build%1$s + versionCode %1$d + Commit %1$s + ฮฃฮตฮปฮฏฮดฮฑ ฮญฮบฮดฮฟฯƒฮทฯ‚ + ฮคฮฟ PR ฮญฯ‡ฮตฮน ฮฝฮตฯŒฯ„ฮตฯฮฟ commit (%1$s). ฮคฮฟ ฮดฮฟฮบฮนฮผฮฑฯƒฯ„ฮนฮบฯŒ ฯ„ฮฟฯ… build ฮดฮตฮฝ ฮตฮฏฮฝฮฑฮน ฮญฯ„ฮฟฮนฮผฮฟ ฮฑฮบฯŒฮผฮท, ฮฟฯ€ฯŒฯ„ฮต ฮฑฯ…ฯ„ฯŒ ฮดฮตฮฝ ฯ„ฮฟ ฯ€ฮตฯฮนฮปฮฑฮผฮฒฮฌฮฝฮตฮน. + ฮฮตฯŒฯ„ฮตฯฮฟ commit, ฯ„ฮฟ build ฮตฮบฮบฯฮตฮผฮตฮฏ + ฮ‘ฯฮนฮธฮผฯŒฯ‚ PR, ฯ„ฮฏฯ„ฮปฮฟฯ‚ ฮฎ ฯƒฯ…ฮฝฯ„ฮฌฮบฯ„ฮทฯ‚ + ฮšฮฑฮฝฮญฮฝฮฑ ฮดฮฟฮบฮนฮผฮฑฯƒฯ„ฮนฮบฯŒ build ฮดฮตฮฝ ฯ„ฮฑฮนฯฮนฮฌฮถฮตฮน + ฮงฯฮตฮนฮฌฮถฮตฯ„ฮฑฮน ฮฝฮญฮฟ build (versionCode %1$d) + ฮ•ฮฝฮทฮผฮตฯฯŽฯƒฮตฮนฯ‚ ฮดฮฟฮบฮนฮผฮฑฯƒฯ„ฮนฮบฯŽฮฝ builds + ฮฮญฮฟ ฮดฮฟฮบฮนฮผฮฑฯƒฯ„ฮนฮบฯŒ build ฮณฮนฮฑ ฯ„ฮฟ PR #%1$d + %1$s. ฮ‘ฮฝฮฟฮฏฮพฯ„ฮต ฯ„ฮนฯ‚ ฮ•ฮฝฮทฮผฮตฯฯŽฯƒฮตฮนฯ‚ ฮณฮนฮฑ ฮตฮณฮบฮฑฯ„ฮฌฯƒฯ„ฮฑฯƒฮท. + ฮ ฮตฯฮนฯƒฯƒฯŒฯ„ฮตฯฮฑ (%1$d) + ฮงฯฮตฮนฮฌฮถฮฟฮฝฯ„ฮฑฮน ฮฝฮญฮฟ build ฮณฮนฮฑ versionCode %2$d (%1$d) + Preview builds ฯƒฯ„ฮฟ main ฮผฮตฯ„ฮฌ ฮฑฯ€ฯŒ ฮฑฯ…ฯ„ฯŒ ฯ„ฮฟ ฮดฮฟฮบฮนฮผฮฑฯƒฯ„ฮนฮบฯŒ build: %1$d ฮ”ฮฟฮบฮนฮผฮฑฯƒฯ„ฮนฮบฮฌ builds ฮ”ฮฟฮบฮนฮผฮฌฯƒฯ„ฮต ฮผฮนฮฑ ฮดฮนฯŒฯฮธฯ‰ฯƒฮท ฯ€ฯฮนฮฝ ฮบฯ…ฮบฮปฮฟฯ†ฮฟฯฮฎฯƒฮตฮน ฮšฮฑฮฝฮญฮฝฮฑ ฯ€ฯฮฟฯ‚ ฯ„ฮฟ ฯ€ฮฑฯฯŒฮฝ + ฮ ฮตฮนฯฮฑฮผฮฑฯ„ฮนฮบฮฎ ฮญฮบฮดฮฟฯƒฮท + ฮ ฮตฮนฯฮฑฮผฮฑฯ„ฮนฮบฮญฯ‚ ฮตฮบฮดฯŒฯƒฮตฮนฯ‚ + ฮฃฮต ฯ‡ฯฮฎฯƒฮท + ฮฃฮต ฯ€ฮฑฯฯƒฮท ฮผฮตฯ„ฮฌ ฯ„ฮทฮฝ ฮตฮบ ฮฝฮญฮฟฯ… ฮฒฮตฮปฯ„ฮนฯƒฯ„ฮฟฯ€ฮฟฮฏฮทฯƒฮท ฯ„ฮฟฯ… DroidDeck ฮฑฯ€ฯŒ ฯ„ฮฟ Android + ฮ”ฮตฮฝ ฯ†ฮฟฯฯ„ฯŽฮธฮทฮบฮต: %1$s + ฮ‘ฮฝฮฑฮผฮฟฮฝฮฎ ฮณฮนฮฑ ฮตฯ€ฮฑฮฝฮตฮบฮบฮฏฮฝฮทฯƒฮท + ฮ”ฮนฮฑฯ„ฮทฯฮฎฮธฮทฮบฮต + ฮ“ฮนฮฑ ฮฌฮปฮปฮท ฮญฮบฮดฮฟฯƒฮท + ฮ•ฯ€ฮฑฮฝฮฑฮดฮทฮผฮนฮฟฯ…ฯฮณฮฏฮฑ + ฮ”ฮนฮฑฮณฯฮฌฯ†ฮตฮน ฮฑฯ…ฯ„ฮฎฮฝ ฯ„ฮทฮฝ ฮญฮบฮดฮฟฯƒฮท ฮฑฯ€ฯŒ ฯ„ฮท ฯƒฯ…ฯƒฮบฮตฯ…ฮฎ + ฮ•ฯ€ฮฑฮฝฮตฮบฮบฮฏฮฝฮทฯƒฮท ฮผฮต ฮฑฯ…ฯ„ฮฎฮฝ + ฮ‘ฯ€ฮตฮฝฮตฯฮณฮฟฯ€ฮฟฮฏฮทฯƒฮท + ฮงฯฮฎฯƒฮท + ฮ”ฮนฮฑฮณฯฮฑฯ†ฮฎ + ฮ”ฮนฮฑฮณฯฮฑฯ†ฮฎ ฯ„ฯŽฯฮฑ + ฮ”ฮตฮฝ ฮฎฯ„ฮฑฮฝ ฮดฯ…ฮฝฮฑฯ„ฮฎ ฮท ฯ€ฯฮฟฮตฯ„ฮฟฮนฮผฮฑฯƒฮฏฮฑ ฯ„ฮทฯ‚ ฮตฯ€ฮฑฮฝฮตฮบฮบฮฏฮฝฮทฯƒฮทฯ‚: %1$s. ฮšฮฌฮฝฯ„ฮต ฯƒฯฮถฮตฯ…ฮพฮท ฮผฮต ฮฑฯƒฯฯฮผฮฑฯ„ฮฟ ฮตฮฝฯ„ฮฟฯ€ฮนฯƒฮผฯŒ ฯƒฯ†ฮฑฮปฮผฮฌฯ„ฯ‰ฮฝ ฯƒฯ„ฮท ฮกฯฮธฮผฮนฯƒฮท ฮบฮฑฮน ฮดฮฟฮบฮนฮผฮฌฯƒฯ„ฮต ฮพฮฑฮฝฮฌ. + ฮ•ฮณฮบฮฑฯ„ฮฑฯƒฯ„ฮฌฮธฮทฮบฮต ฯ€ฮตฮนฯฮฑฮผฮฑฯ„ฮนฮบฮฎ ฮญฮบฮดฮฟฯƒฮท + ฮคฮฟ DroidDeck ฮตฯ€ฮฑฮฝฮตฮบฮบฮนฮฝฮฎฮธฮทฮบฮต ฮผฮต ฯ„ฮฟ %1$s + ฮ— ฮญฮบฮดฮฟฯƒฮท Lab ฯƒฮต ฯ€ฮฑฯฯƒฮท + ฮคฮฟ Android ฮฒฮตฮปฯ„ฮนฯƒฯ„ฮฟฯ€ฮฟฮฏฮทฯƒฮต ฮพฮฑฮฝฮฌ ฯ„ฮฟ DroidDeck, ฮฟฯ€ฯŒฯ„ฮต ฯ„ฮฟ %1$s ฮดฮตฮฝ ฮตฮฏฮฝฮฑฮน ฯ†ฮฟฯฯ„ฯ‰ฮผฮญฮฝฮฟ. ฮ†ฮฝฮฟฮนฮพฮต ฯ„ฮนฯ‚ ฮ•ฮฝฮทฮผฮตฯฯŽฯƒฮตฮนฯ‚ ฮณฮนฮฑ ฮฝฮฑ ฮตฯ€ฮฑฮฝฮตฮบฮบฮนฮฝฮฎฯƒฮตฮนฯ‚ ฮผฮต ฮฑฯ…ฯ„ฯŒ. + ฮ— ฮญฮบฮดฮฟฯƒฮท Lab ฮฑฯ€ฮตฮฝฮตฯฮณฮฟฯ€ฮฟฮนฮฎฮธฮทฮบฮต + ฮ”ฮทฮผฮนฮฟฯ…ฯฮณฮฎฮธฮทฮบฮต ฮณฮนฮฑ ฮฌฮปฮปฮท ฮญฮบฮดฮฟฯƒฮท ฯ„ฮฟฯ… DroidDeck. ฮ”ฮนฮฑฯ„ฮทฯฮตฮฏฯ„ฮฑฮน ฯƒฯ„ฮนฯ‚ ฮ•ฮฝฮทฮผฮตฯฯŽฯƒฮตฮนฯ‚. + ฮคฮฟ DroidDeck ฮดฮตฮฝ ฮพฮตฮบฮฏฮฝฮทฯƒฮต ฮผฮต ฮฑฯ…ฯ„ฯŒ ฮดฯฮฟ ฯ†ฮฟฯฮญฯ‚ + ฮ ฯฮฌฮบฯ„ฮฟฯฮฑฯ‚ + ฮ ฯฮฌฮบฯ„ฮฟฯฮฑฯ‚ + ฮŸ ฯ€ฯฮฌฮบฯ„ฮฟฯฮฑฯ‚ ฮตฯฮณฮฌฮถฮตฯ„ฮฑฮน + ฮ•ฮณฮบฮฑฯ„ฮญฯƒฯ„ฮทฯƒฮต ฯ„ฮฟ Claude Code ฯƒฯ„ฮฟ ฯ€ฮตฯฮนฮฒฮฌฮปฮปฮฟฮฝ ฯ‡ฯฮฎฯƒฯ„ฮท ฯ„ฮฟฯ… Linux ฮณฮนฮฑ ฮฝฮฑ ฯ‡ฯฮทฯƒฮนฮผฮฟฯ€ฮฟฮนฮฎฯƒฮตฮนฯ‚ ฯ„ฮฟฮฝ ฯ€ฯฮฌฮบฯ„ฮฟฯฮฑ. + ฮกฯŽฯ„ฮทฯƒฮต ฮณฮนฮฑ ฮญฮฝฮฑ ฯ€ฮฑฮนฯ‡ฮฝฮฏฮดฮน, ฮญฮฝฮฑ ฯƒฯ†ฮฌฮปฮผฮฑ ฮฎ ฮผฮนฮฑ ฮฑฮปฮปฮฑฮณฮฎ ฯƒฯ„ฮฟ DroidDeck + ฮ‘ฯ€ฮฟฯƒฯ„ฮฟฮปฮฎ + ฮฮญฮฑ ฯƒฯ…ฮฝฮฟฮผฮนฮปฮฏฮฑ + ฮ”ฮนฮฑฮบฮฟฯ€ฮฎ + ฮ‘ฯ€ฮฟฮธฮทฮบฮตฯ…ฯ„ฮนฮบฯŒฯ‚ ฯ‡ฯŽฯฮฟฯ‚ + ฮ‘ฯ†ฮฑฮฏฯฮตฯƒฮท + ฮ‘ฯ†ฮฑฮฏฯฮตฯƒฮท ฯ„ฯŽฯฮฑ + Claude Code + Codex + ฮ ฮทฮณฮฑฮฏฮฟฯ‚ ฮบฯŽฮดฮนฮบฮฑฯ‚ DroidDeck + ฮ ฯฮฟฯƒฯ‰ฯฮนฮฝฮฎ ฮผฮฝฮฎฮผฮท ฮปฮฎฯˆฮตฯ‰ฮฝ + ฮŸฮน ฮฑฮปฮปฮฑฮณฮญฯ‚ ฯ€ฮฟฯ… ฮดฮตฮฝ ฮญฯ‡ฮฟฯ…ฮฝ ฮฑฮฝฮญฮฒฮตฮน ฯ‡ฮฌฮฝฮฟฮฝฯ„ฮฑฮน + ฮŸฮน ฮตฮบฮดฯŒฯƒฮตฮนฯ‚ ฯ„ฮฑ ฮบฮฑฯ„ฮตฮฒฮฌฮถฮฟฯ…ฮฝ ฮพฮฑฮฝฮฌ + ฮ— ฯฯฮธฮผฮนฯƒฮท ฮผฯ€ฮฟฯฮตฮฏ ฮฝฮฑ ฯ„ฮฟ ฮพฮฑฮฝฮฑฮตฮณฮบฮฑฯ„ฮฑฯƒฯ„ฮฎฯƒฮตฮนยท ฮฟฮน ฯƒฯ…ฮฝฮดฮญฯƒฮตฮนฯ‚ ฮดฮนฮฑฯ„ฮทฯฮฟฯฮฝฯ„ฮฑฮน + ฮคฮฟ DroidDeck ฮตฯ€ฮฑฮฝฮตฮบฮบฮนฮฝฮฎฮธฮทฮบฮต ฮผฮต ฯ„ฮทฮฝ ฮญฮบฮดฮฟฯƒฮท Lab ฯƒฮฟฯ…. ฮฃฯ…ฮฝฮญฯ‡ฮนฯƒฮต ฮฑฯ€ฯŒ ฮตฮบฮตฮฏ ฯ€ฮฟฯ… ฯƒฯ„ฮฑฮผฮฌฯ„ฮทฯƒฮตฯ‚. + ฮกฯŽฯ„ฮทฯƒฮญ ฯ„ฮฟ ฮณฮนฮฑฯ„ฮฏ ฮญฮฝฮฑ ฯ€ฮฑฮนฯ‡ฮฝฮฏฮดฮน ฮดฮตฮฝ ฮพฮตฮบฮนฮฝฮฌ, ฮถฮฎฯ„ฮทฯƒฮญ ฯ„ฮฟฯ… ฮฝฮฑ ฮตฮพฮทฮณฮฎฯƒฮตฮน ฮญฮฝฮฑ ฮฑฯฯ‡ฮตฮฏฮฟ ฮบฮฑฯ„ฮฑฮณฯฮฑฯ†ฮฎฯ‚ ฮฎ ฮฝฮฑ ฮฑฮปฮปฮฌฮพฮตฮน ฯ„ฮฟ DroidDeck ฮบฮฑฮน ฮฝฮฑ ฮดฮฟฮบฮนฮผฮฌฯƒฮตฮน ฯ„ฮทฮฝ ฮฑฮปฮปฮฑฮณฮฎ ฯƒฮต ฮฑฯ…ฯ„ฮฎ ฯ„ฮท ฯƒฯ…ฯƒฮบฮตฯ…ฮฎ. + ฮ‘ฯ€ฮญฯ„ฯ…ฯ‡ฮต: %1$s + %1$s ฯ„ฮตฯฮผฮฑฯ„ฮฏฯƒฯ„ฮทฮบฮต (ฮบฯ‰ฮดฮนฮบฯŒฯ‚ ฮตฮพฯŒฮดฮฟฯ… %2$d) + ฮ”ฮนฮฑฮบฯŒฯ€ฮทฮบฮต + ฮคฮตฯฮผฮฑฯ„ฮฏฯƒฯ„ฮทฮบฮต ฯ‡ฯ‰ฯฮฏฯ‚ ฮฑฯ€ฮฌฮฝฯ„ฮทฯƒฮท + ฮ•ฯ€ฮฑฮฝฮฌฮปฮทฯˆฮท + ฮ“ฮฏฮฝฮตฯ„ฮฑฮน ฯฯฮธฮผฮนฯƒฮท ฯ„ฮฟฯ… ฯ€ฯฮฌฮบฯ„ฮฟฯฮฑ + ฮžฮฑฮฝฮฑฮดฮทฮผฮนฮฟฯฯฮณฮทฯƒฮต ฯ„ฮท ฮดฮนฮบฮฎ ฮผฮฟฯ… ฮญฮบฮดฮฟฯƒฮท Lab %1$s ฮณฮนฮฑ ฯ„ฮทฮฝ ฮตฮณฮบฮฑฯ„ฮตฯƒฯ„ฮทฮผฮญฮฝฮท ฮญฮบฮดฮฟฯƒฮท ฯ„ฮฟฯ… DroidDeck ฮบฮฑฮน ฮตฯ€ฮฑฮฝฮตฮบฮบฮฏฮฝฮทฯƒฮต ฮผฮต ฮฑฯ…ฯ„ฮฎฮฝ. + %1$s ฮตฮฏฯƒฮฟฮดฮฟฯ‚ ยท %2$s ฮญฮพฮฟฮดฮฟฯ‚ + ฮฃฮบฮญฯ†ฯ„ฮตฯ„ฮฑฮน + ฮฃฮบฮญฯˆฮท + ฮฃฮบฮญฯ†ฯ„ฮตฯ„ฮฑฮน ยท %1$s + %1$s ยท %2$s + ฮ•ฮ™ฮฃฮŸฮ”ฮŸฮฃ + ฮ•ฮžฮŸฮ”ฮŸฮฃ + ฮ•ฮบฯ„ฮตฮปฮตฮฏฯ„ฮฑฮนโ€ฆ + ฮงฯ‰ฯฮฏฯ‚ ฮฑฯ€ฮฟฯ„ฮญฮปฮตฯƒฮผฮฑ: ฮฟ ฮณฯฯฮฟฯ‚ ฮญฮปฮทฮพฮต ฯ€ฯฯŽฯ„ฮฑ + ฮงฯ‰ฯฮฏฯ‚ ฮญฮพฮฟฮดฮฟ + ฮ“ฯฮฌฯˆฯ„ฮต ฮณฮนฮฑ ฮฝฮฑ ฯ€ฯฮฟฯƒฮธฮญฯƒฮตฯ„ฮต ฯ„ฮฟ ฮตฯ€ฯŒฮผฮตฮฝฮฟ ฮผฮฎฮฝฯ…ฮผฮฑ ฯƒฯ„ฮทฮฝ ฮฟฯ…ฯฮฌ + ฮฃฯ„ฮทฮฝ ฮฟฯ…ฯฮฌ + ฮ•ฯ€ฯŒฮผฮตฮฝฮฟ: %1$s + ฮฮฑ ฮผฮทฮฝ ฯƒฯ„ฮฑฮปฮตฮฏ + ฮ•ฯ€ฮนฯƒฯฮฝฮฑฯˆฮท + ฮ‘ฯ†ฮฑฮฏฯฮตฯƒฮท + ฮ ฯฮฟฮตฯ€ฮนฮปฮฟฮณฮฎ + ฮ ฯฮฟฯƒฯ€ฮฌฮธฮตฮนฮฑ ฯƒฯ…ฮปฮปฮฟฮณฮนฯƒฮผฮฟฯ + ฮ ฯฮฟฯ‡ฯŽฯฮทฯƒฮท + ฮ‘ฮฝฮฑฮธฮตฯŽฯฮทฯƒฮท + ฮ”ฮตฮฝ ฮญฯ‡ฮตฮน ฮฑฮปฮปฮฌฮพฮตฮน ฯ„ฮฏฯ€ฮฟฯ„ฮฑ ฮฑฮบฯŒฮผฮท + ฮ ฯฮฟฯ‡ฯŽฯฮทฯƒฮต ฮผฮต ฯ„ฮฟ ฯƒฯ‡ฮญฮดฮนฮฟ. + ฮ‘ฯ€ฮฟฯƒฯ„ฮฟฮปฮฎ ฯ„ฯŽฯฮฑ + ฮ ฮตฯฮนฯƒฯƒฯŒฯ„ฮตฯฮฑ + ฮšฮปฮตฮฏฯƒฮนฮผฮฟ + ฮ ฮนฮฟ ฯ€ฯฯŒฯƒฯ†ฮฑฯ„ฮฟ + ฮฃฮต ฮตฯฮณฮฑฯƒฮฏฮฑ + ฮ ฮปฮฑฮฏฯƒฮนฮฟ + %1$s ฮฑฯ€ฯŒ %2$s + ฮ‘ฯ…ฯ„ฮฎ ฮท ฯƒฯ…ฮฝฮฟฮผฮนฮปฮฏฮฑ ยท %1$s + ฮ— ฯ‡ฯฮฎฯƒฮท ฮตฮผฯ†ฮฑฮฝฮฏฮถฮตฯ„ฮฑฮน ฮผฮตฯ„ฮฌ ฯ„ฮทฮฝ ฯ€ฯฯŽฯ„ฮท ฮฑฯ€ฮฌฮฝฯ„ฮทฯƒฮท + ฮŒฯฮนฮฟ %1$d ฯ‰ฯฯŽฮฝ + ฮŒฯฮนฮฟ %1$d ฮปฮตฯ€ฯ„ฯŽฮฝ + ฮ•ฮฒฮดฮฟฮผฮฑฮดฮนฮฑฮฏฮฟ ฯŒฯฮนฮฟ + %1$d%% ยท ฮตฯ€ฮฑฮฝฮฑฯ†ฮญฯฮตฯ„ฮฑฮน %2$s + + %1$d ฮฑฯฯ‡ฮตฮฏฮฟ + %1$d ฮฑฯฯ‡ฮตฮฏฮฑ + + ฮ ฯฯŽฯ„ฮฑ ฯƒฯ‡ฮญฮดฮนฮฟ + ฮฃฯ‡ฮญฮดฮนฮฟ + ฮ ฯฮฟฯ„ฮตฮฏฮฝฮตฮน ฯƒฯ‡ฮญฮดฮนฮฟ ฯ‡ฯ‰ฯฮฏฯ‚ ฮฝฮฑ ฮฑฮปฮปฮฌฮพฮตฮน ฯ„ฮฏฯ€ฮฟฯ„ฮฑ + ฮฃฯ…ฮฝฮฟฮผฮนฮปฮฏฮตฯ‚ + ฮ”ฮตฮฝ ฯ…ฯ€ฮฌฯฯ‡ฮฟฯ…ฮฝ ฮฑฮบฯŒฮผฮท ฯƒฯ…ฮฝฮฟฮผฮนฮปฮฏฮตฯ‚ + ฮœฯŒฮปฮนฯ‚ ฯ„ฯŽฯฮฑ + ฮ”ฮนฮฑฮณฯฮฑฯ†ฮฎ + ฮ”ฮนฮฑฮณฯฮฌฯ†ฮตฮน ฯ„ฮท ฯƒฯ…ฮฝฮฟฮผฮนฮปฮฏฮฑ ฮบฮฑฮน ฯ„ฮฑ ฯƒฯ…ฮฝฮทฮผฮผฮญฮฝฮฑ ฯ„ฮทฯ‚ + ฮ”ฮนฮตฯฮณฮฑฯƒฮฏฮตฯ‚ + ฮ”ฮตฮฝ ฮตฮบฯ„ฮตฮปฮตฮฏฯ„ฮฑฮน ฯ„ฮฏฯ€ฮฟฯ„ฮฑ ฯƒฯ„ฮฟ ฯ€ฮตฯฮนฮฒฮฌฮปฮปฮฟฮฝ ฯ‡ฯฮฎฯƒฯ„ฮท Linux + ฮ ฮกฮ‘ฮšฮคฮŸฮกฮ‘ฮฃ + ฮ”ฮนฮฑฮบฮฟฯ€ฮฎ + ฮšฮฑฯ„ฮฑฯƒฮบฮตฯ…ฮฎ Lab + ฮ ฯฮฟฮตฯ„ฮฟฮนฮผฮฑฯƒฮฏฮฑ ฮบฮฑฯ„ฮฑฯƒฮบฮตฯ…ฯŽฮฝ Lab + %1$d%% ยท ฯ€ฮตฯฮฏฯ€ฮฟฯ… %2$s ฮฑฮบฯŒฮผฮท + ฯ€ฮตฯฮฏฯ€ฮฟฯ… %1$s ฮฑฮบฯŒฮผฮท + ฮ‘ฮบฯฯฯ‰ฯƒฮท + ฮ‘ฮบฯฯฯ‰ฯƒฮท ฮบฮฑฯ„ฮฑฯƒฮบฮตฯ…ฮฎฯ‚ + ฮˆฮฝฮฑฯฮพฮท + %1$d%% + ฮฃฯ…ฯƒฮบฮตฯ…ฮฑฯƒฮฏฮฑ + ฮ•ฯ€ฮฑฮฝฮตฮบฮบฮฏฮฝฮทฯƒฮท ฯ„ฮฟฯ… DroidDeck ฯƒฮต ฮฑฯ…ฯ„ฯŒ + ฮŸฮปฮฟฮบฮปฮทฯฯŽฮธฮทฮบฮต + ฮ‘ฯ€ฮญฯ„ฯ…ฯ‡ฮต: %1$s + ฮกฯฮธฮผฮนฯƒฮท ฯ„ฮฟฯ… ฯ€ฯฮฌฮบฯ„ฮฟฯฮฑ + ฮ•ฮณฮบฮฑฯ„ฮฑฯƒฯ„ฮฎฯƒฯ„ฮต ฯ€ฯฯŽฯ„ฮฑ ฯ„ฮฟ ฯ€ฮตฯฮนฮฒฮฌฮปฮปฮฟฮฝ ฮตฮบฯ„ฮญฮปฮตฯƒฮทฯ‚ Linux ฯƒฯ„ฮฟ Setup. + ฮ•ฯ€ฮฑฮฝฮฌฮปฮทฯˆฮท + ฮˆฮฝฮฑฯฮพฮท ฯƒฯ…ฮฝฮฟฮผฮนฮปฮฏฮฑฯ‚ + ฮฃฯฮฝฮดฮตฯƒฮท ฯƒฯ…ฯƒฮบฮตฯ…ฮฎฯ‚ + ฮ‘ฯƒฯฯฮผฮฑฯ„ฮท ฮฑฯ€ฮฟฯƒฯ†ฮฑฮปฮผฮฌฯ„ฯ‰ฯƒฮท, ฯŽฯƒฯ„ฮต ฮฟ ฯ€ฯฮฌฮบฯ„ฮฟฯฮฑฯ‚ ฮฝฮฑ ฮฒฮปฮญฯ€ฮตฮน ฮบฮฑฮน ฮฝฮฑ ฮตฮปฮญฮณฯ‡ฮตฮน ฯ„ฮฟ DroidDeck + ฮ•ฮณฮบฮฑฯ„ฮฌฯƒฯ„ฮฑฯƒฮท %1$s + ฮœฮญฯƒฮฑ ฯƒฯ„ฮฟ ฯ€ฮตฯฮนฮฒฮฌฮปฮปฮฟฮฝ ฯ‡ฯฮฎฯƒฯ„ฮท Linux, ฮผฮต git, gh ฮบฮฑฮน adb + ฮฃฯฮฝฮดฮตฯƒฮท ฯƒฯ„ฮฟ %1$s + ฮ‘ฮฝฮฟฮฏฮณฮตฮน ฯ„ฮฟ ฯ€ฯฯŒฮณฯฮฑฮผฮผฮฑ ฯ€ฮตฯฮนฮฎฮณฮทฯƒฮฎฯ‚ ฯƒฮฑฯ‚ + GitHub + ฮ ฯฮฟฮฑฮนฯฮตฯ„ฮนฮบฯŒ, ฮณฮนฮฑ ฮฌฮฝฮฟฮนฮณฮผฮฑ pull requests + ฮ•ฯฮณฮฑฮปฮตฮฏฮฑ ฮผฮตฯ„ฮฑฮณฮปฯŽฯ„ฯ„ฮนฯƒฮทฯ‚ + ฮ ฯฮฟฮฑฮนฯฮตฯ„ฮนฮบฯŒ, ฮณฮนฮฑ ฮผฮตฯ„ฮฑฮณฮปฯ‰ฯ„ฯ„ฮฏฯƒฮตฮนฯ‚ Lab ฯƒฮต ฮฑฯ…ฯ„ฮฎ ฯ„ฮท ฯƒฯ…ฯƒฮบฮตฯ…ฮฎ ยท ฯ€ฮตฯฮฏฯ€ฮฟฯ… 5 GB + ฮŸ Agent ฮตฮฏฮฝฮฑฮน ฮญฯ„ฮฟฮนฮผฮฟฯ‚ + ฮŸฮปฮฟฮบฮปฮทฯฯŽฯƒฯ„ฮต ฯ„ฮท ฯฯฮธฮผฮนฯƒฮท ฯ„ฮฟฯ… Agent + ฮฃฯ…ฮฝฮดฮตฮดฮตฮผฮญฮฝฮฟฯ‚ ฯƒฯ„ฮฟ %1$s + ฮœฮตฯ„ฮฑฮณฮปฯ‰ฯ„ฯ„ฮฏฯƒฮตฮนฯ‚ Lab + ฮณฯฮฎฮณฮฟฯฮตฯ‚ ฮผฮตฯ„ฮฑฮณฮปฯ‰ฯ„ฯ„ฮฏฯƒฮตฮนฯ‚ + ฮ“ฯฮฎฮณฮฟฯฮตฯ‚ ฮผฮตฯ„ฮฑฮณฮปฯ‰ฯ„ฯ„ฮฏฯƒฮตฮนฯ‚ Lab + ฮœฮตฯ„ฮฑฮณฮปฯ‰ฯ„ฯ„ฮฏฮถฮตฮน ฮตฮบ ฯ„ฯ‰ฮฝ ฯ€ฯฮฟฯ„ฮญฯฯ‰ฮฝ ฮฑฯ…ฯ„ฮฎ ฯ„ฮทฮฝ ฮญฮบฮดฮฟฯƒฮท, ฯŽฯƒฯ„ฮต ฮฟฮน ฮผฮตฯ„ฮฑฮณฮปฯ‰ฯ„ฯ„ฮฏฯƒฮตฮนฯ‚ Lab ฮฝฮฑ ฮดฮนฮฑฯฮบฮฟฯฮฝ ฮปฮตฯ€ฯ„ฮฌ ยท ฯ€ฮตฯฮฏฯ€ฮฟฯ… 20 ฮปฮตฯ€ฯ„ฮฌ ฮผฮฏฮฑ ฯ†ฮฟฯฮฌ + ฮœฮตฯ„ฮฑฮณฮปฯŽฯ„ฯ„ฮนฯƒฮท ยท %1$d%% ยท ฯ€ฮตฯฮฏฯ€ฮฟฯ… %2$s ฮฑฮบฯŒฮผฮท + ฮ ฯฮฟฮตฯ„ฮฟฮนฮผฮฑฯƒฮฏฮฑ + ฮ— ฮฑฯƒฯฯฮผฮฑฯ„ฮท ฮฑฯ€ฮฟฯƒฯ†ฮฑฮปฮผฮฌฯ„ฯ‰ฯƒฮท ฮดฮตฮฝ ฮตฮฏฮฝฮฑฮน ฯ€ฯฮฟฯƒฮฒฮฌฯƒฮนฮผฮท ยท ฮท ฮฃฯฮถฮตฯ…ฮพฮท ฯ„ฮทฮฝ ฮตฮฝฮตฯฮณฮฟฯ€ฮฟฮนฮตฮฏ + ฮฃฯฮถฮตฯ…ฮพฮท + ฮ•ฮณฮบฮฑฯ„ฮฌฯƒฯ„ฮฑฯƒฮท + ฮฃฯฮฝฮดฮตฯƒฮท PR #%1$d ฮ”ฮตฮฝ ฮญฯ‡ฮตฮน ฮบฮฑฯ„ฮฑฯƒฮบฮตฯ…ฮฑฯƒฯ„ฮตฮฏ ฮณฮนฮฑ ฮฑฯ…ฯ„ฮฎ ฯ„ฮทฮฝ ฮญฮบฮดฮฟฯƒฮท ฯ„ฮฟฯ… DroidDeck ฮ•ฮฝฮทฮผฮตฯฯŽฮธฮทฮบฮต %1$s @@ -1248,6 +1473,9 @@ ฮ•ฯ†ฮฑฯฮผฮฟฮณฮญฯ‚ ฮกฯฮธฮผฮนฯƒฮท ฮ•ฮฝฮทฮผฮตฯฯŽฯƒฮตฮนฯ‚ + ฮ ฮตฯฮนฯƒฯƒฯŒฯ„ฮตฯฮฑ + ฮ•ฯ€ฮตฮพฮตฯฮณฮฑฯƒฮฏฮฑ ฮบฮฑฯฯ„ฮตฮปฯŽฮฝ + ฮšฮฑฯฯ„ฮญฮปฮตฯ‚ %1$d%% ฮฃฯ…ฮฝฮญฯ‡ฮนฯƒฮท %1$s ฮ•ฮผฯ†ฮฑฮฝฮฏฮถฮตฯ„ฮฑฮน ฯ‰ฯ‚ /root/ROMs ฯƒฮต ฮบฮฌฮธฮต ฯƒฯ…ฮฝฮตฮดฯฮฏฮฑ. ฮŸ ฮตฯƒฯ‰ฯ„ฮตฯฮนฮบฯŒฯ‚ ฯ‡ฯŽฯฮฟฯ‚ ฮฑฯ€ฮฟฮธฮฎฮบฮตฯ…ฯƒฮทฯ‚ ฮฒฯฮฏฯƒฮบฮตฯ„ฮฑฮน ฯƒฯ„ฮฟ /root/Storage. @@ -1269,6 +1497,15 @@ ฮ‘ฮบฯฯฯ‰ฯƒฮท ฯƒฮต ฮตฮบฮบฯฮตฮผฯŒฯ„ฮทฯ„ฮฑ ฮ ฮปฮทฮบฯ„ฯฮฟฮปฯŒฮณฮนฮฟ Android ฮ‘ฯ€ฯŒฮบฯฯ…ฯˆฮท โœ• + ฮœฮญฮณฮตฮธฮฟฯ‚ ฯƒฯ„ฮทฮฝ ฮฟฮธฯŒฮฝฮท + ฮ ฮฟฯƒฮฟฯƒฯ„ฯŒ ฯ„ฮทฯ‚ ฮฟฮธฯŒฮฝฮทฯ‚ ฯ€ฮฟฯ… ฮบฮฑฯ„ฮฑฮปฮฑฮผฮฒฮฌฮฝฮตฮน ฯ„ฮฟ ฯ€ฮปฮทฮบฯ„ฯฮฟฮปฯŒฮณฮนฮฟ, ฯƒฯ…ฮผฯ€ฮตฯฮนฮปฮฑฮผฮฒฮฑฮฝฮฟฮผฮญฮฝฮทฯ‚ ฯ„ฮทฯ‚ ฮบฮตฯ†ฮฑฮปฮฏฮดฮฑฯ‚. + ฮ‘ฮดฮนฮฑฯ†ฮฌฮฝฮตฮนฮฑ + ฮœฮตฮนฯŽฯƒฯ„ฮต ฯ„ฮทฮฝ ฮณฮนฮฑ ฮฝฮฑ ฮฒฮปฮญฯ€ฮตฯ„ฮต ฯ„ฮฟ ฯ€ฮฑฮนฯ‡ฮฝฮฏฮดฮน ฯ€ฮฏฯƒฯ‰ ฮฑฯ€ฯŒ ฯ„ฮฟ ฯ€ฮปฮทฮบฯ„ฯฮฟฮปฯŒฮณฮนฮฟ. + ฮšฯฯ…ฯ†ฮฌ ฯ€ฮปฮฎฮบฯ„ฯฮฑ + ฮคฮฑ ฯ€ฮปฮฎฮบฯ„ฯฮฑ ฯ€ฮฟฯ… ฯ‡ฯฮทฯƒฮนฮผฮฟฯ€ฮฟฮนฮตฮฏฯ„ฮต ฯƒฯ€ฮฌฮฝฮนฮฑ ฮดฮตฮฝ ฮตฮผฯ†ฮฑฮฝฮฏฮถฮฟฮฝฯ„ฮฑฮน ฯƒฯ„ฮฟ ฯ€ฮปฮทฮบฯ„ฯฮฟฮปฯŒฮณฮนฮฟ. + Esc ฮบฮฑฮน ฯƒฮตฮนฯฮฌ ฮปฮตฮนฯ„ฮฟฯ…ฯฮณฮนฯŽฮฝ + Ins / Del / Home / End / PgUp / PgDn + ฮ ฮปฮฎฮบฯ„ฯฮฑ ฮฒฮตฮปฯŽฮฝ ฮ•ฮบฮบฮฏฮฝฮทฯƒฮท %1$s ฮ•ฯ€ฮนฮปฮญฮพฯ„ฮต ฮฟฮธฯŒฮฝฮท. ฮ”ฮตฯ…ฯ„ฮตฯฮตฯฮฟฯ…ฯƒฮฑ: %1$s. ฮ— ฮดฮตฯ…ฯ„ฮตฯฮตฯฮฟฯ…ฯƒฮฑ ฮฟฮธฯŒฮฝฮท ฮดฮตฮฝ ฮตฮฏฮฝฮฑฮน ฯ€ฮปฮญฮฟฮฝ ฮดฮนฮฑฮธฮญฯƒฮนฮผฮท. @@ -1770,7 +2007,24 @@ ฮคฮตฯฮผฮฑฯ„ฮนฮบฯŒ ฮ›ฮฑฮฒฮญฯ‚ Deck + ฯ€ฮนฮฝฮฑฮบฮฏฮดฮตฯ‚ ฮฑฯ†ฮฎฯ‚ ฮ ฮฏฮฝฮฑฮบฮฑฯ‚ ฮตฮปฮญฮณฯ‡ฮฟฯ… + ฮ•ฯ€ฮนฯ†ฮฌฮฝฮตฮนฮฑ ฮตฯฮณฮฑฯƒฮฏฮฑฯ‚ + ฮ•ฮบฮบฮฏฮฝฮทฯƒฮท ฮตฯ€ฮนฯ†ฮฌฮฝฮตฮนฮฑฯ‚ ฮตฯฮณฮฑฯƒฮฏฮฑฯ‚ + ฮ•ฯ€ฮนฯ†ฮฌฮฝฮตฮนฮฑ ฮตฯฮณฮฑฯƒฮฏฮฑฯ‚ ยท %1$s + ฮ•ฯ€ฮนฯ†ฮฌฮฝฮตฮนฮฑ ฮฑฯ†ฮฎฯ‚ + ฮ†ฮผฮตฯƒฮท ฮฑฯ†ฮฎ + ฮ•ฯ€ฮนฯ†ฮฌฮฝฮตฮนฮฑ ฮฑฯ†ฮฎฯ‚. ฮ ฮฑฯ„ฮฎฯƒฯ„ฮต ฮณฮนฮฑ ฮฌฮผฮตฯƒฮท ฮฑฯ†ฮฎ + ฮ†ฮผฮตฯƒฮท ฮฑฯ†ฮฎ. ฮ ฮฑฯ„ฮฎฯƒฯ„ฮต ฮณฮนฮฑ ฮตฯ€ฮนฯ†ฮฌฮฝฮตฮนฮฑ ฮฑฯ†ฮฎฯ‚ + ฮ•ฮบฮบฮฏฮฝฮทฯƒฮท ฯ„ฮทฯ‚ ฮตฯ€ฮนฯ†ฮฌฮฝฮตฮนฮฑฯ‚ ฮตฯฮณฮฑฯƒฮฏฮฑฯ‚ KDEโ€ฆ + ฮ— ฮตฯ€ฮนฯ†ฮฌฮฝฮตฮนฮฑ ฮตฯฮณฮฑฯƒฮฏฮฑฯ‚ ฮญฮบฮปฮตฮนฯƒฮต. + ฮ— ฮตฯ€ฮนฯ†ฮฌฮฝฮตฮนฮฑ ฮตฯฮณฮฑฯƒฮฏฮฑฯ‚ ฮดฮตฮฝ ฮผฯ€ฯŒฯฮตฯƒฮต ฮฝฮฑ ฮตฮบฮบฮนฮฝฮทฮธฮตฮฏ. ฮคฮฑ ฮฑฯฯ‡ฮตฮฏฮฑ ฮบฮฑฯ„ฮฑฮณฯฮฑฯ†ฮฎฯ‚ ฮฒฯฮฏฯƒฮบฮฟฮฝฯ„ฮฑฮน ฯƒฯ„ฮฟฮฝ ฯ†ฮฌฮบฮตฮปฮฟ bottom-desktop ฮฑฯ…ฯ„ฮฎฯ‚ ฯ„ฮทฯ‚ ฯƒฯ…ฮฝฮตฮดฯฮฏฮฑฯ‚. + ฮ— ฮตฯ€ฮนฯ†ฮฌฮฝฮตฮนฮฑ ฮตฯฮณฮฑฯƒฮฏฮฑฯ‚ ฮตฮฏฮฝฮฑฮน ฮบฮปฮตฮนฯƒฯ„ฮฎ. ฮ”ฮตฮฝ ฯ…ฯ€ฮฌฯฯ‡ฮตฮน ฯ„ฮฏฯ€ฮฟฯ„ฮฑ ฮณฮนฮฑ ฮตฮผฯ†ฮฌฮฝฮนฯƒฮท ฮฑฮบฯŒฮผฮฑ. + ฮ•ฮฝฮฑฮปฮปฮฑฮณฮฎ ฮฟฮธฮฟฮฝฯŽฮฝ + ฮ— ฮบฮฌฯ„ฯ‰ ฮฟฮธฯŒฮฝฮท ฮดฮตฮฝ ฮตฮฏฮฝฮฑฮน ฮดฮนฮฑฮธฮญฯƒฮนฮผฮท ฮฑฯ…ฯ„ฮฎ ฯ„ฮท ฯƒฯ„ฮนฮณฮผฮฎ + ฮŸฮธฯŒฮฝฮท ฯ€ฮฑฮนฯ‡ฮฝฮนฮดฮนฮฟฯ + ฮ•ฮผฯ†ฮฌฮฝฮนฯƒฮท ฯ„ฮฟฯ… ฯ€ฮฑฮนฯ‡ฮฝฮนฮดฮนฮฟฯ ฯƒฯ„ฮทฮฝ + ฮ•ฯ€ฮฌฮฝฯ‰ ฮฟฮธฯŒฮฝฮท + ฮšฮฌฯ„ฯ‰ ฮฟฮธฯŒฮฝฮท ฮ›ฮฎฯˆฮตฮนฯ‚ ฮ”ฮตฮฝ ฮตฮบฯ„ฮตฮปฮฟฯฮฝฯ„ฮฑฮน ฮปฮฎฯˆฮตฮนฯ‚. Steam @@ -1805,6 +2059,20 @@ ฮšฮฑฯฯƒฮนฮผฮฟ, t ฮšฯฯฮนฮฟ %1$s t ฮ•ฯ†ฮตฮดฯฮนฮบฯŒ %1$s t + ฮงฯฯŒฮฝฮฟฯ‚ ฮบฮฑฯฮญ + ฯ„ฮตฮปฮตฯ…ฯ„ฮฑฮฏฮฑ %1$d s + ฮผฮญฯƒฮฟ ฮบฮฑฯฮญ + 1% ฯ‡ฮฑฮผฮทฮปฮฌ + ฮบฮฑฯฮญ ฯ€ฮฌฮฝฯ‰ ฮฑฯ€ฯŒ 33 ms + %1$d / min + ฮฃฮต ฯ€ฮฑฮนฯ‡ฮฝฮฏฮดฮน ฮตฮดฯŽ ฮบฮฑฮน %1$s + %1$d ฯ€ฯ…ฯฮฎฮฝฮตฯ‚, ฮญฯ‰ฯ‚ %2$s GHz + %1$d ฯ€ฯ…ฯฮฎฮฝฮตฯ‚ + ฯ€ฮฑฮนฯ‡ฮฝฮฏฮดฮน + FPS ฯƒฯ„ฮฑ %1$d Hz + ฮ— ฮบฯŒฮบฮบฮนฮฝฮท ฮญฮฝฮดฮตฮนฮพฮท ฮตฮฏฮฝฮฑฮน ฯ„ฮฟ ฯƒฮทฮผฮตฮฏฮฟ ฯŒฯ€ฮฟฯ… ฯ„ฮฟ HUD ฮตฮผฯ†ฮฑฮฝฮฏฮถฮตฮน ฯ„ฮท ฮธฮตฯฮผฮฟฮบฯฮฑฯƒฮฏฮฑ ฮผฮต ฮบฯŒฮบฮบฮนฮฝฮฟ. + ฮฟฮปฯŒฮบฮปฮทฯฮท ฮท ฯƒฯ…ฯƒฮบฮตฯ…ฮฎ + ฮผฯ€ฮฑฯ„ฮฑฯฮฏฮฑ ฮ‘ฯ€ฮฟฯƒฯ„ฮฟฮปฮฎ ฮดฮตฮดฮฟฮผฮญฮฝฯ‰ฮฝ ฯ€ฮฏฮฝฮฑฮบฮฑ ฮ‘ฯ…ฯ„ฯŒฮผฮฑฯ„ฮฑ ฮคฮฟ ฮตฮฝฮตฯฮณฮฟฯ€ฮฟฮนฮตฮฏ ฮณฮนฮฑ ฮบฮฌฮธฮต ฯ€ฮฑฮนฯ‡ฮฝฮฏฮดฮน ฯ„ฮทฯ‚ ฮปฮฏฯƒฯ„ฮฑฯ‚, ฮผฮฑฮถฮฏ ฮบฮฑฮน ฯŒฯƒฮฑ ฮฒฯฮตฮธฮฟฯฮฝ ฮฑฯฮณฯŒฯ„ฮตฯฮฑ. ฮคฮฑ ฯ€ฮฑฮนฯ‡ฮฝฮฏฮดฮนฮฑ ฯ€ฮฟฯ… ฮฑฯ€ฮตฮฝฮตฯฮณฮฟฯ€ฮฟฮนฮตฮฏฯ„ฮต ฯ€ฮฑฯฮฑฮผฮญฮฝฮฟฯ…ฮฝ ฮฑฮฝฮตฮฝฮตฯฮณฮฌ. @@ -1828,6 +2096,10 @@ ฮคฮฟ ฮผฮนฮบฯฯŒฯ†ฯ‰ฮฝฮฟ ฮตฮฏฮฝฮฑฮน ฮฑฯ€ฮตฮฝฮตฯฮณฮฟฯ€ฮฟฮนฮทฮผฮญฮฝฮฟ ฮณฮนฮฑ ฮฑฯ…ฯ„ฯŒ ฯ„ฮฟ ฯ€ฮฑฮนฯ‡ฮฝฮฏฮดฮน. ฮ“ฮนฮฑ ฮฝฮฑ ฮผฮนฮปฮฎฯƒฮตฯ„ฮต, ฮตฮฝฮตฯฮณฮฟฯ€ฮฟฮนฮฎฯƒฯ„ฮต ฯ„ฮฟ ฮœฮนฮบฯฯŒฯ†ฯ‰ฮฝฮฟ ฯƒฯ„ฮนฯ‚ ฯฯ…ฮธฮผฮฏฯƒฮตฮนฯ‚ Steam ฯ„ฮฟฯ… DroidDeck (ฮ‰ฯ‡ฮฟฯ‚) ฮบฮฑฮน ฮพฮตฮบฮนฮฝฮฎฯƒฯ„ฮต ฮพฮฑฮฝฮฌ ฯ„ฮฟ ฯ€ฮฑฮนฯ‡ฮฝฮฏฮดฮน. ฮˆฮฝฯ„ฮฑฯƒฮท %1$d%% ฮฃฯ„ฮฑฯ„ฮนฯƒฯ„ฮนฮบฮฌ ฯ€ฮฑฮนฯ‡ฮฝฮนฮดฮนฮฟฯ + HUD ฮบฮฌฯ„ฯ‰ ฮฟฮธฯŒฮฝฮทฯ‚ + ฮ›ฯ‰ฯฮฏฮดฮฑ ฯƒฮต ฮบฮฌฮธฮต ฮบฮฑฯฯ„ฮญฮปฮฑ + 1% ฮบฮฑฮน 0,1% ฯ‡ฮฑฮผฮทฮปฮฌ + ฮ˜ฮตฯฮผฮฟฮบฯฮฑฯƒฮฏฮฑ CPU FPS CPU GPU @@ -2000,6 +2272,7 @@ ฮ•ฮบฮบฮฏฮฝฮทฯƒฮท ฯ„ฮทฯ‚ ฯƒฯ…ฮฝฮตฮดฯฮฏฮฑฯ‚โ€ฆ %1$d:%2$02d ฯ€ฮญฯฮฑฯƒฮฑฮฝ ยท ฮฑฮบฯŒฮผฮฑ ฯƒฮต ฮตฮพฮญฮปฮนฮพฮท ฮ›ฮฎฯˆฮท ฯ„ฮทฯ‚ ฮตฮฝฮทฮผฮญฯฯ‰ฯƒฮทฯ‚ ฯ„ฮฟฯ… ฯ€ฮตฮปฮฌฯ„ฮท Steam ยท %1$d%% + ฮ•ฯ†ฮฑฯฮผฮฟฮณฮฎ ฯ„ฮทฯ‚ ฮตฮฝฮทฮผฮญฯฯ‰ฯƒฮทฯ‚ ฯ„ฮฟฯ… ฯ€ฮตฮปฮฌฯ„ฮท Steamโ€ฆ ฮ›ฮฎฯˆฮท ฯ„ฮฟฯ… ฯ€ฮตฮปฮฌฯ„ฮท Steam ยท %1$s ฮœฮนฮฑ ฮตฮณฮบฮฑฯ„ฮฌฯƒฯ„ฮฑฯƒฮท ฮตฯฮณฮฑฮปฮตฮฏฮฟฯ… ฯƒฯ…ฮผฮฒฮฑฯ„ฯŒฯ„ฮทฯ„ฮฑฯ‚ ฮตฮบฯ„ฮตฮปฮตฮฏฯ„ฮฑฮน ฮฎฮดฮท @@ -2076,11 +2349,29 @@ ฮ ฮตฯฮนฮณฯฮฌฮผฮผฮฑฯ„ฮฑ ฯ„ฯฯ€ฮฟฯ… toon ฯƒฯ…ฮฝ ฯŒฮพฯ…ฮฝฯƒฮท. ฮ”ฮตฮฝ ฮตฮฏฮฝฮฑฮน GPU Adreno + ฮ ฯฯŒฮณฯฮฑฮผฮผฮฑ ฮฟฮดฮฎฮณฮทฯƒฮทฯ‚ PowerVR ฯ„ฮฟฯ… ฯƒฯ…ฯƒฯ„ฮฎฮผฮฑฯ„ฮฟฯ‚: ฮท ฯƒฯ…ฮผฮฒฮฑฯ„ฯŒฯ„ฮทฯ„ฮฑ ฮดฮนฮฑฯ†ฮญฯฮตฮน ฮฑฮฝฮฌ ฯƒฯ…ฯƒฮบฮตฯ…ฮฎ + ฮ ฮตฮนฯฮฑฮผฮฑฯ„ฮนฮบฯŒ: RADV ฮฎ ฯ„ฮฟ ฯ€ฯฯŒฮณฯฮฑฮผฮผฮฑ ฮฟฮดฮฎฮณฮทฯƒฮทฯ‚ Xclipse ฯ„ฮฟฯ… ฯƒฯ…ฯƒฯ„ฮฎฮผฮฑฯ„ฮฟฯ‚ + PowerVR ฯƒฯ…ฯƒฯ„ฮฎฮผฮฑฯ„ฮฟฯ‚ + ฮงฯฮทฯƒฮนฮผฮฟฯ€ฮฟฮนฮตฮฏ ฯ„ฮฑ ฮตฮฝฯƒฯ‰ฮผฮฑฯ„ฯ‰ฮผฮญฮฝฮฑ ฯ€ฯฮฟฮณฯฮฌฮผฮผฮฑฯ„ฮฑ ฮฟฮดฮฎฮณฮทฯƒฮทฯ‚ ฮณฮนฮฑ ฮฑฯ…ฯ„ฮฎ ฯ„ฮทฮฝ GPU + ฮˆฯ‡ฮตฮน ฮตฯ€ฮนฮปฮตฮณฮตฮฏ ฮฟ ฮฟฮดฮทฮณฯŒฯ‚ PowerVR ฯ„ฮฟฯ… ฯƒฯ…ฯƒฯ„ฮฎฮผฮฑฯ„ฮฟฯ‚ ฮณฮนฮฑ ฯ„ฮฟ ฯ€ฮตฯฮนฮฒฮฌฮปฮปฮฟฮฝ ฮตฮบฯ„ฮญฮปฮตฯƒฮทฯ‚ ฮบฮฑฮน ฯ„ฮทฮฝ ฮฟฮธฯŒฮฝฮท. + ฮšฮฑฮฝฮญฮฝฮฑฯ‚ ฮฟฮดฮทฮณฯŒฯ‚ ฮฑฮฝฮฟฮนฯ‡ฯ„ฮฟฯ ฮบฯŽฮดฮนฮบฮฑ ฮดฮตฮฝ ฯ…ฯ€ฮฟฯƒฯ„ฮทฯฮฏฮถฮตฮน ฮฑฮบฯŒฮผฮท ฮฑฯ…ฯ„ฯŒ ฯ„ฮฟ Mali: ฮท ฮณฮญฯ†ฯ…ฯฮฑ Mali ฮตฮฏฮฝฮฑฮน ฮตฮฝฮตฯฮณฮฟฯ€ฮฟฮนฮทฮผฮญฮฝฮท. + ฮ ฯฯŒฮบฮตฮนฯ„ฮฑฮน ฮณฮนฮฑ ฯ„ฮท ฮดฮฟฮบฮนฮผฮฑฯƒฯ„ฮนฮบฮฎ ฮญฮบฮดฮฟฯƒฮท ฮณฮนฮฑ ฯƒฯ…ฯƒฮบฮตฯ…ฮญฯ‚ ฯ‡ฯ‰ฯฮฏฯ‚ Snapdragon: ฮฟฮน ฮตฯ€ฮฏฯƒฮทฮผฮตฯ‚ ฮตฮบฮดฯŒฯƒฮตฮนฯ‚ ฮตฮดฯŽ ฮปฮตฮนฯ„ฮฟฯ…ฯฮณฮฟฯฮฝ ฮผฯŒฮฝฮฟ ฯƒฮต Adreno, ฮตฯ€ฮฟฮผฮญฮฝฯ‰ฯ‚ ฮดฮตฮฝ ฮตฮณฮบฮฑฮธฮฏฯƒฯ„ฮฑฮฝฯ„ฮฑฮน ฯ€ฮฌฮฝฯ‰ ฮฑฯ€ฯŒ ฮฑฯ…ฯ„ฮฎฮฝ. ฮŸฮน ฮฝฮญฮตฯ‚ ฮดฮฟฮบฮนฮผฮฑฯƒฯ„ฮนฮบฮญฯ‚ ฮตฮบฮดฯŒฯƒฮตฮนฯ‚ ฮฒฯฮฏฯƒฮบฮฟฮฝฯ„ฮฑฮน ฯƒฯ„ฮฟ github.com/The412Banner/droiddeck-nonadreno-drivers. + ฮ— ฯ„ฮตฮปฮตฯ…ฯ„ฮฑฮฏฮฑ ฯƒฯ…ฮฝฮตฮดฯฮฏฮฑ ฯ„ฮตฯฮผฮฑฯ„ฮฏฯƒฯ„ฮทฮบฮต ฮตฯ€ฮตฮนฮดฮฎ ฯ„ฮฟ Android ฮญฮบฮปฮตฮนฯƒฮต ฯ„ฮฟ DroidDeck ฮณฮนฮฑ ฮฝฮฑ ฮตฮปฮตฯ…ฮธฮตฯฯŽฯƒฮตฮน ฮผฮฝฮฎฮผฮท, ฯŒฯ‡ฮน ฮปฯŒฮณฯ‰ ฯƒฯ†ฮฌฮปฮผฮฑฯ„ฮฟฯ‚. ฮšฮปฮตฮฏฯƒฯ„ฮต ฮฌฮปฮปฮตฯ‚ ฮตฯ†ฮฑฯฮผฮฟฮณฮญฯ‚ ฮฎ ฯ‡ฮฑฮผฮทฮปฯŽฯƒฯ„ฮต ฯ„ฮนฯ‚ ฯฯ…ฮธฮผฮฏฯƒฮตฮนฯ‚ ฯ…ฯ†ฯŽฮฝ ฯ„ฮฟฯ… ฯ€ฮฑฮนฯ‡ฮฝฮนฮดฮนฮฟฯ ฮบฮฑฮน ฮดฮฟฮบฮนฮผฮฌฯƒฯ„ฮต ฮพฮฑฮฝฮฌ. + Mali (Venus) + ฮท ฮณฮญฯ†ฯ…ฯฮฑ Mali + ฮšฮฑฮฝฮญฮฝฮฑฯ‚ ฮฟฮดฮทฮณฯŒฯ‚ ฮฑฮฝฮฟฮนฯ‡ฯ„ฮฟฯ ฮบฯŽฮดฮนฮบฮฑ ฮดฮตฮฝ ฯ…ฯ€ฮฟฯƒฯ„ฮทฯฮฏฮถฮตฮน ฮฑฮบฯŒฮผฮท ฮฑฯ…ฯ„ฯŒ ฯ„ฮฟ Mali: ฯ‡ฯฮทฯƒฮนฮผฮฟฯ€ฮฟฮนฮตฮฏฯ„ฮฑฮน ฯ„ฮฟ %1$s, ฯ€ฮฌฮฝฯ‰ ฯƒฯ„ฮฟฮฝ ฮตฮฝฯƒฯ‰ฮผฮฑฯ„ฯ‰ฮผฮญฮฝฮฟ ฮฟฮดฮทฮณฯŒ ฯ„ฮฟฯ… ฯ„ฮทฮปฮตฯ†ฯŽฮฝฮฟฯ…. + ฮคฮฟ %1$s ฮดฮตฮฝ ฮญฯ‡ฮตฮน ฮบฯ…ฮบฮปฮฟฯ†ฮฟฯฮฎฯƒฮตฮน ฮฑฮบฯŒฮผฮท: ฯ‡ฯฮทฯƒฮนฮผฮฟฯ€ฮฟฮนฮตฮฏฯ„ฮฑฮน ฯ„ฮฟ %2$s ฮผฮญฯ‡ฯฮน ฮฝฮฑ ฮบฯ…ฮบฮปฮฟฯ†ฮฟฯฮฎฯƒฮตฮน. + ฮคฮฟ %1$s ฮดฮตฮฝ ฮตฮฏฮฝฮฑฮน ฮดฮนฮฑฮธฮญฯƒฮนฮผฮฟ ฮบฮฑฮน ฮฟ ฮฟฮดฮทฮณฯŒฯ‚ ฮฑฯ…ฯ„ฮฟฯ ฯ„ฮฟฯ… ฯ„ฮทฮปฮตฯ†ฯŽฮฝฮฟฯ… ฮฑฮฝฮฑฯ†ฮญฯฮตฮน Vulkan %2$s (ฯ„ฮฟ Venus ฯ‡ฯฮตฮนฮฌฮถฮตฯ„ฮฑฮน 1.2): ฯ‡ฯฮทฯƒฮนฮผฮฟฯ€ฮฟฮนฮตฮฏฯ„ฮฑฮน ฮท ฮณฮญฯ†ฯ…ฯฮฑ Mali. + ฮคฮฟ %1$s ฮดฮตฮฝ ฮญฯ‡ฮตฮน ฮบฯ…ฮบฮปฮฟฯ†ฮฟฯฮฎฯƒฮตฮน ฮฑฮบฯŒฮผฮท: ฮท ฮณฮญฯ†ฯ…ฯฮฑ Mali ฮตฮฏฮฝฮฑฮน ฮตฮฝฮตฯฮณฮฟฯ€ฮฟฮนฮทฮผฮญฮฝฮท ฮผฮญฯ‡ฯฮน ฮฝฮฑ ฮบฯ…ฮบฮปฮฟฯ†ฮฟฯฮฎฯƒฮตฮน. + ฮฃฮต ฮฟฯ…ฯฮฌ: %1$s (ฯ€ฮตฯฮนฮผฮญฮฝฮตฮน ฮดฮนฮฑฯ†ฮฟฯฮตฯ„ฮนฮบฯŒ ฮฟฮดฮทฮณฯŒ ฮณฮนฮฑ ฯ„ฮฟ ฯ€ฮตฯฮนฮฒฮฌฮปฮปฮฟฮฝ ฮตฮบฯ„ฮญฮปฮตฯƒฮทฯ‚) + ฮคฮฟ DXVK ฯ€ฮฑฯฮญฯ‡ฮตฯ„ฮฑฮน ฮฑฯ€ฯŒ ฯ„ฮฟ ฯ€ฮตฯฮนฮฒฮฌฮปฮปฮฟฮฝ ฮตฮบฯ„ฮญฮปฮตฯƒฮทฯ‚ PowerVR ฯ„ฮฟฯ… ฯƒฯ…ฯƒฯ„ฮฎฮผฮฑฯ„ฮฟฯ‚. ฮ†ฮปฮปฮฑ ฯ€ฮฑฮบฮญฯ„ฮฑ DXVK ฮผฯ€ฮฟฯฮฟฯฮฝ ฮฝฮฑ ฮฑฯ€ฮฟฮธฮทฮบฮตฯ…ฯ„ฮฟฯฮฝ, ฮฑฮปฮปฮฌ ฮดฮตฮฝ ฮตฯ†ฮฑฯฮผฯŒฮถฮฟฮฝฯ„ฮฑฮน ฮผฮต ฮฑฯ…ฯ„ฯŒฮฝ ฯ„ฮฟฮฝ ฮฟฮดฮทฮณฯŒ. ฮฅฯ€ฮฟฯƒฯ„ฮทฯฮฏฮถฮตฯ„ฮฑฮน ฮ ฮตฮนฯฮฑฮผฮฑฯ„ฮนฮบฯŒ: ฯ„ฮฑ ฯ€ฯฮฟฮณฯฮฌฮผฮผฮฑฯ„ฮฑ ฮฟฮดฮฎฮณฮทฯƒฮฎฯ‚ ฯ„ฮฟฯ… ฮตฮฏฮฝฮฑฮน ฮดฮฟฮบฮนฮผฮฑฯƒฯ„ฮนฮบฮญฯ‚ ฮตฮบฮดฯŒฯƒฮตฮนฯ‚ ฮ ฮตฮนฯฮฑฮผฮฑฯ„ฮนฮบฮฎ ฯ…ฯ€ฮฟฯƒฯ„ฮฎฯฮนฮพฮท Adreno 850: ฮฑฯ€ฮฑฮนฯ„ฮตฮฏ ฯƒฯ…ฮผฮฒฮฑฯ„ฮฌ ฯ€ฮตฮนฯฮฑฮผฮฑฯ„ฮนฮบฮฌ ฯ€ฯฮฟฮณฯฮฌฮผฮผฮฑฯ„ฮฑ ฮฟฮดฮฎฮณฮทฯƒฮทฯ‚ ฮฟฮธฯŒฮฝฮทฯ‚ ฮบฮฑฮน ฯ€ฮฑฮนฯ‡ฮฝฮนฮดฮนฯŽฮฝยท ฮดฮตฮฝ ฮญฯ‡ฮตฮน ฮตฯ€ฮฑฮปฮทฮธฮตฯ…ฯ„ฮตฮฏ ฯƒฮต ฮฑฯ…ฯ„ฮฎ ฯ„ฮท ฯƒฯ…ฯƒฮบฮตฯ…ฮฎ ฮšฮฌฯ„ฯ‰ ฮฑฯ€ฯŒ ฯ„ฮฟ ฮดฮฟฮบฮนฮผฮฑฯƒฮผฮญฮฝฮฟ ฯ…ฮปฮนฮบฯŒ (Adreno 725 ฮบฮฑฮน ฮฝฮตฯŒฯ„ฮตฯฮฑ): ฮฏฯƒฯ‰ฯ‚ ฮฝฮฑ ฮผฮทฮฝ ฮตฮบฯ„ฮตฮปฮตฯƒฯ„ฮตฮฏ ฮ”ฮตฮฝ ฯ…ฯ€ฮฟฯƒฯ„ฮทฯฮฏฮถฮตฯ„ฮฑฮน: ฮดฮตฮฝ ฯ…ฯ€ฮฌฯฯ‡ฮตฮน ฯƒฯ…ฮผฮฒฮฑฯ„ฯŒ ฯ…ฯ€ฮฟฯƒฯฯƒฯ„ฮทฮผฮฑ ฮณฯฮฑฯ†ฮนฮบฯŽฮฝ ฮณฮนฮฑ ฮฑฯ…ฯ„ฮฎฮฝ ฯ„ฮทฮฝ GPU + ฮ›ฮตฮนฯ„ฮฟฯ…ฯฮณฮตฮฏ ฮผฮญฯƒฯ‰ ฯ„ฮทฯ‚ ฮณฮญฯ†ฯ…ฯฮฑฯ‚ Mali, ฯ€ฮฌฮฝฯ‰ ฯƒฯ„ฮฟฮฝ ฮตฮฝฯƒฯ‰ฮผฮฑฯ„ฯ‰ฮผฮญฮฝฮฟ ฮฟฮดฮทฮณฯŒ Vulkan ฯ„ฮฟฯ… ฯ„ฮทฮปฮตฯ†ฯŽฮฝฮฟฯ… + ฮ”ฮตฮฝ ฯ…ฯ€ฮฟฯƒฯ„ฮทฯฮฏฮถฮตฯ„ฮฑฮน ฮผฮต ฯ„ฮท ฮณฮญฯ†ฯ…ฯฮฑ Mali ฮฑฯ€ฮตฮฝฮตฯฮณฮฟฯ€ฮฟฮนฮทฮผฮญฮฝฮท: ฯ„ฮฟ Turnip ฯ‡ฯฮตฮนฮฌฮถฮตฯ„ฮฑฮน GPU Adreno (Snapdragon) ฮคฮฟ ฯŒฯฮนฮฟ ฯฯ…ฮธฮผฮฟฯ ฯ„ฮฟฯ… GitHub ฮพฮตฯ€ฮตฯฮฌฯƒฯ„ฮทฮบฮต - ฮดฮฟฮบฮนฮผฮฌฯƒฯ„ฮต ฮพฮฑฮฝฮฌ ฮฑฯฮณฯŒฯ„ฮตฯฮฑ ฮคฮฟ GitHub ฮฑฯ€ฮฌฮฝฯ„ฮทฯƒฮต ฮผฮต HTTP %1$d @@ -2189,7 +2480,6 @@ ฮšฮฑฯ„ฮฑฯƒฯ„ฮฎฮผฮฑฯ„ฮฑ Steam ฮ ฯฮฟฯƒฮฑฯฮผฮฟฯƒฮผฮญฮฝฮฟ - ฮšฮฑฯ„ฮฑฯƒฯ„ฮฎฮผฮฑฯ„ฮฑ ฮ•ฯ€ฮฏฯ€ฮตฮดฮฟ ฯ„ฮฑฯ‡ฯฯ„ฮทฯ„ฮฑฯ‚ ฮปฮฎฯˆฮทฯ‚ ฮ™ฯƒฮฟฯฯฮฟฯ€ฮทฮผฮญฮฝฮฟ ฮคฮฑฯ‡ฯ @@ -2228,6 +2518,7 @@ ฮ‘ฮฝฮฑฮผฮฟฮฝฮฎ ฮณฮนฮฑ ฯ„ฮทฮฝ ฮฌฮปฮปฮท ฮปฮฎฯˆฮท ฮฑฯ€ฯŒ ฯ„ฮฟ Battle.netโ€ฆ ฮ‘ฮฝฮฟฮฏฮพฯ„ฮต ฯ„ฮฟ Battle.net ฮบฮฑฮน ฯƒฯ…ฮฝฮดฮตฮธฮตฮฏฯ„ฮต ฮผฮฏฮฑ ฯ†ฮฟฯฮฌ, ฮญฯ€ฮตฮนฯ„ฮฑ ฮตฮณฮบฮฑฯ„ฮฑฯƒฯ„ฮฎฯƒฯ„ฮต ฯ„ฮฑ ฯ€ฮฑฮนฯ‡ฮฝฮฏฮดฮนฮฑ ฯ„ฮฟฯ… ฮฑฯ€ฯŒ ฮตฮดฯŽ. ฮคฮฟ ฯ€ฯฯŒฮณฯฮฑฮผฮผฮฑ ฮปฮฎฯˆฮทฯ‚ ฯ„ฮทฯ‚ Blizzard ฯƒฯ„ฮฑฮผฮฌฯ„ฮทฯƒฮต: %1$s + ฮคฮฟ ฯ€ฯฯŒฮณฯฮฑฮผฮผฮฑ ฮปฮฎฯˆฮทฯ‚ ฯ„ฮทฯ‚ Blizzard ฯƒฯ„ฮฑฮผฮฌฯ„ฮทฯƒฮต ฮฝฮฑ ฯ€ฯฮฟฯ‡ฯ‰ฯฮฌ. ฮฃฯ†ฮฌฮปฮผฮฑ Blizzard %1$s ฮ•ฮฝฮทฮผฮญฯฯ‰ฯƒฮท ฮ ฮฑฮนฯ‡ฮฝฮฏฮดฮนฮฑ ฯ„ฮทฯ‚ Blizzard @@ -2235,6 +2526,7 @@ ฮ”ฮนฮฑฮบฯŒฯ€ฮทฮบฮต ฮ•ฮณฮบฮฑฯ„ฮฌฯƒฯ„ฮฑฯƒฮท ยท %1$s ฮ‘ฯ€ฯŒฮบฯ„ฮทฯƒฮท ฮดฯ‰ฯฮตฮฌฮฝ + ฮ ฯฮฟฯƒฮธฮฎฮบฮท ฯƒฯ„ฮท ฮฒฮนฮฒฮปฮนฮฟฮธฮฎฮบฮทโ€ฆ ฮ ฯฮฟฮฒฮฟฮปฮฎ ฯƒฯ„ฮฟ %1$s ฮ‘ฮณฮฟฯฮฌ ยท %1$s ฮ•ฮณฮบฮฑฯ„ฮตฯƒฯ„ฮทฮผฮญฮฝฮฟ @@ -2281,6 +2573,12 @@ ฮคฮฑฮพฮนฮฝฯŒฮผฮทฯƒฮท ฮ•ฯ„ฮนฮบฮญฯ„ฮตฯ‚ ฯ€ฮปฮฑฯŠฮฝฮฎฯ‚ ฮณฯฮฑฮผฮผฮฎฯ‚ ฮ•ฮผฯ†ฮฌฮฝฮนฯƒฮท ฮฟฮฝฮฟฮผฮฌฯ„ฯ‰ฮฝ ฮบฮฌฯ„ฯ‰ ฮฑฯ€ฯŒ ฯ„ฮฑ ฮตฮนฮบฮฟฮฝฮฏฮดฮนฮฑ ฯ„ฮทฯ‚ ฯ€ฮปฮฑฯŠฮฝฮฎฯ‚ ฮณฯฮฑฮผฮผฮฎฯ‚. ฮ‘ฯ€ฮตฮฝฮตฯฮณฮฟฯ€ฮฟฮนฮฎฯƒฯ„ฮต ฮณฮนฮฑ ฯ€ฮนฮฟ ฮปฮตฯ€ฯ„ฮฎ ฯ€ฮปฮฑฯŠฮฝฮฎ ฮณฯฮฑฮผฮผฮฎ. + ฮšฮฑฯ„ฮฟฮนฮบฮฏฮดฮนฮฟ ฯ„ฮฟฯ… ฯ€ฯฮฌฮบฯ„ฮฟฯฮฑ + ฮคฮฟ DeeDee ฮตฮผฯ†ฮฑฮฝฮฏฮถฮตฯ„ฮฑฮน ฯ€ฮฌฮฝฯ‰ ฮฑฯ€ฯŒ ฯ„ฮฟฮฝ ฮตฮบฮบฮนฮฝฮทฯ„ฮฎ ฮบฮฑฮน ฯ„ฮฑ ฯ€ฮฑฮนฯ‡ฮฝฮฏฮดฮนฮฑ ฮบฮฑฮน ฮดฮตฮฏฯ‡ฮฝฮตฮน ฯ„ฮน ฮบฮฌฮฝฮตฮน ฮฟ ฯ€ฯฮฌฮบฯ„ฮฟฯฮฑฯ‚. + ฮ ฮฌฮฝฯ‰ ฮฑฯ€ฯŒ ฮฌฮปฮปฮตฯ‚ ฮตฯ†ฮฑฯฮผฮฟฮณฮญฯ‚ + ฮ‘ฯ†ฮฎฯƒฯ„ฮต ฯ„ฮฟ DeeDee ฮฝฮฑ ฮตฮผฯ†ฮฑฮฝฮฏฮถฮตฯ„ฮฑฮน ฯ€ฮฌฮฝฯ‰ ฮฑฯ€ฯŒ ฮบฮฌฮธฮต ฮตฯ†ฮฑฯฮผฮฟฮณฮฎ ฮบฮฑฮน ฮฝฮฑ ฮฑฮฝฮฟฮฏฮณฮตฮน ฮตฮบฮตฮฏ ฯ„ฮท ฯƒฯ…ฮฝฮฟฮผฮนฮปฮฏฮฑ + ฮฮฑ ฮตฯ€ฮนฯ„ฯฮญฯ€ฮตฯ„ฮฑฮน + ฮฃฯ…ฮฝฮฟฮผฮนฮปฮฏฮฑ ฮผฮต DeeDee ฮ ฯฮฟฮฒฮฟฮปฮฎ ฮœฮตฮณฮฑฮปฯฯ„ฮตฯฮตฯ‚ ฮบฮฌฯฯ„ฮตฯ‚ ฮœฮนฮบฯฯŒฯ„ฮตฯฮตฯ‚ ฮบฮฌฯฯ„ฮตฯ‚ @@ -2565,7 +2863,14 @@ %1$s ยท ฮฑฯ€ฮฑฮนฯ„ฮตฮฏฯ„ฮฑฮน ฮตฯ€ฮฑฮฝฮตฮบฮบฮฏฮฝฮทฯƒฮท ฮ‘ฯ…ฯ„ฮฎ ฮท ฯƒฯ…ฯƒฮบฮตฯ…ฮฎ ฮšฮฑฯ„ฮฌฯฮณฮทฯƒฮท %1$s; - ฮ”ฮนฮฑฮณฮฝฯ‰ฯƒฯ„ฮนฮบฮฌ + ฮ ฯฮฟฮณฯฮฑฮผฮผฮฑฯ„ฮนฯƒฯ„ฮฎฯ‚ + ฮฅฮดฮฑฯ„ฮฟฮณฯฮฌฯ†ฮทฮผฮฑ ฮตฯ„ฮนฮบฮญฯ„ฮฑฯ‚ ฮญฮบฮดฮฟฯƒฮทฯ‚ + ฮ•ฮผฯ†ฮฌฮฝฮนฯƒฮท ฯ„ฮทฯ‚ ฮตฯ„ฮนฮบฮญฯ„ฮฑฯ‚ ฮดฮฟฮบฮนฮผฮฑฯƒฯ„ฮนฮบฮฎฯ‚ ฮญฮบฮดฮฟฯƒฮทฯ‚ ฮฎ ฮญฮบฮดฮฟฯƒฮทฯ‚ Lab ฯƒฯ„ฮทฮฝ ฮฟฮธฯŒฮฝฮท. ฮ•ฮฝฮตฯฮณฯŒ ฮฑฯ€ฯŒ ฯ€ฯฮฟฮตฯ€ฮนฮปฮฟฮณฮฎ. + ฮšฮฟฮนฮฝฮฟฯ€ฮฟฮฏฮทฯƒฮท ฯ€ฮฑฮบฮญฯ„ฯ‰ฮฝ ฮดฮนฮฑฮณฮฝฯ‰ฯƒฯ„ฮนฮบฯŽฮฝ + ฮฃฯ…ฮฝฮตฮดฯฮฏฮฑ ฮบฮฑฮน ฯƒฯ…ฯƒฮบฮตฯ…ฮฎ + ฮ“ฯฮฑฯ†ฮนฮบฮฌ + ฮ ฮฑฮนฯ‡ฮฝฮฏฮดฮนฮฑ ฮบฮฑฮน ฯƒฯ…ฮผฮฒฮฑฯ„ฯŒฯ„ฮทฯ„ฮฑ + ฮŒฮปฮฑ ฯ„ฮฑ ฯ€ฮฑฮบฮญฯ„ฮฑ ฮˆฯ„ฮฟฮนฮผฮฟ ฮณฮนฮฑ ฯ€ฮฑฮนฯ‡ฮฝฮฏฮดฮน ฮ”ฮตฮฝ ฮตฮฏฮฝฮฑฮน ฮฑฮบฯŒฮผฮฑ ฮญฯ„ฮฟฮนฮผฮฟ ฮณฮนฮฑ ฯ€ฮฑฮนฯ‡ฮฝฮฏฮดฮน runtime %1$s @@ -2604,6 +2909,9 @@ ฮ•ฮฝฮตฯฮณฮฟฯ€ฮฟฮนฮฎฯƒฯ„ฮต ฯ„ฮฑ ฮตฯ€ฮนฯ„ฮตฯฮณฮผฮฑฯ„ฮฑ GOG ฯƒฯ„ฮนฯ‚ ฯฯ…ฮธฮผฮฏฯƒฮตฮนฯ‚ ฮบฮฑฯ„ฮฑฯƒฯ„ฮทฮผฮฌฯ„ฯ‰ฮฝ ฮคฮฑ ฮตฯ€ฮนฯ„ฮตฯฮณฮผฮฑฯ„ฮฑ ฮดฮตฮฝ ฮตฮฏฮฝฮฑฮน ฮดฮนฮฑฮธฮญฯƒฮนฮผฮฑยท ฮตฮปฮญฮณฮพฯ„ฮต ฯ„ฮฑ ฮฑฯฯ‡ฮตฮฏฮฑ ฮบฮฑฯ„ฮฑฮณฯฮฑฯ†ฮฎฯ‚ ฯ„ฮทฯ‚ ฯƒฯ…ฮฝฮตฮดฯฮฏฮฑฯ‚ ฮคฮฟ ฮตฯ€ฮฏฯ„ฮตฯ…ฮณฮผฮฑ ฮพฮตฮบฮปฮตฮนฮดฯŽฮธฮทฮบฮต + Mali (Venus): ฮฑฯ€ฮตฮฝฮตฯฮณฮฟฯ€ฮฟฮนฮทฮผฮญฮฝฮฟ + Mali (Venus): ฮตฮฝฮตฯฮณฮฟฯ€ฮฟฮนฮทฮผฮญฮฝฮฟ + ฮŸ ฮฟฮดฮทฮณฯŒฯ‚ ฯƒฯ„ฮฟ %1$s ฮฑฮฝฮฑฯ†ฮญฯฮตฮน Vulkan %2$s. ฮคฮฟ Mali (Venus) ฯ‡ฯฮตฮนฮฌฮถฮตฯ„ฮฑฮน Vulkan 1.2 ฮฎ ฮฝฮตฯŒฯ„ฮตฯฮฟ (ฯ„ฮฟ gamescope ฮดฮตฮฝ ฮพฮตฮบฮนฮฝฮฌ ฯƒฮต ฯ€ฮฑฮปฮนฯŒฯ„ฮตฯฮตฯ‚ ฮตฮบฮดฯŒฯƒฮตฮนฯ‚), ฮตฯ€ฮฟฮผฮญฮฝฯ‰ฯ‚ ฮฟฮน ฯƒฯ…ฮฝฮตฮดฯฮฏฮตฯ‚ ฯ€ฮฑฯฮฑฮบฮฌฮผฯ€ฯ„ฮฟฯ…ฮฝ ฯ„ฮฟ Venus ฮบฮฑฮน ฯ‡ฯฮทฯƒฮนฮผฮฟฯ€ฮฟฮนฮฟฯฮฝ ฯƒฯ„ฮท ฮธฮญฯƒฮท ฯ„ฮฟฯ… ฯ„ฮฟ ฮถฮตฯฮณฮฟฯ‚ ฮฟฮดฮทฮณฯŽฮฝ PanVK. ฮ•ฯ€ฮนฮบฯŒฮปฮปฮทฯƒฮท ฮ‘ฯฮนฯƒฯ„ฮตฯฯŒ ฯƒฯ„ฮนฮบ ฮ”ฮตฮพฮฏ ฯƒฯ„ฮนฮบ @@ -2890,7 +3198,7 @@ ฮ•ฯ€ฮนฮปฮฟฮณฮฎ ฯ†ฮฑฮบฮญฮปฮฟฯ…โ€ฆ ฮงฯฮทฯƒฮนฮผฮฟฯ€ฮฟฮนฮฎฯƒฯ„ฮต ฮฟฯ€ฮฟฮนฮฟฮฝฮดฮฎฯ€ฮฟฯ„ฮต ฯ†ฮฌฮบฮตฮปฮฟ ฯƒฮต ฮบฮฌฯฯ„ฮฑ SD ฮฎ ฮผฮฟฮฝฮฌฮดฮฑ USB ฮคฮฑ ฯ€ฮฑฮนฯ‡ฮฝฮฏฮดฮนฮฑ ฮผฯ€ฮฑฮฏฮฝฮฟฯ…ฮฝ ฯƒฮต ฯ†ฮฌฮบฮตฮปฮฟ Games ฮผฮญฯƒฮฑ ฯƒฯ„ฮทฮฝ ฮตฯ€ฮนฮปฮตฮณฮผฮญฮฝฮท ฯ„ฮฟฯ€ฮฟฮธฮตฯƒฮฏฮฑ. ฮคฮฑ ฯ…ฯ€ฮฌฯฯ‡ฮฟฮฝฯ„ฮฑ ฯ€ฮฑฮนฯ‡ฮฝฮฏฮดฮนฮฑ ฮดฮตฮฝ ฮผฮตฯ„ฮฑฮบฮนฮฝฮฟฯฮฝฯ„ฮฑฮน. - ฮ ฮฟฯ ฯ€ฮทฮณฮฑฮฏฮฝฮตฮน + ฮคฮน ฮบฮฑฯ„ฮฑฮปฮฑฮผฮฒฮฌฮฝฮตฮน ฯ‡ฯŽฯฮฟ ฮ ฮฑฮนฯ‡ฮฝฮฏฮดฮนฮฑ Steam ฮ”ฮตฮดฮฟฮผฮญฮฝฮฑ ฯ€ฮฑฮนฯ‡ฮฝฮนฮดฮนฯŽฮฝ Prefix %1$s ยท workshop %2$s ยท shaders %3$s @@ -2959,6 +3267,7 @@ ฮ•ฮณฮบฮฑฯ„ฮฑฯƒฯ„ฮฌฯƒฮตฮนฯ‚ VC++ ฮบฮฑฮน DirectX ฯ€ฮฟฯ… ฯ‡ฯฮตฮนฮฌฮถฮฟฮฝฯ„ฮฑฮน ฯ„ฮฑ ฯ€ฮฑฮนฯ‡ฮฝฮฏฮดฮนฮฑ ฮคฯฮญฯ‡ฮตฮน ฯ€ฮฑฮนฯ‡ฮฝฮฏฮดฮนฮฑ Linux x86 ฮ•ฯฮณฮฑฮปฮตฮฏฮฟ Steam + ฮคฮฟ Steam ฮบฮฑฯ„ฮตฮฒฮฌฮถฮตฮน ฮฑฯ…ฯ„ฯŒ ฯ„ฮฟ ฯƒฯ„ฮฟฮนฯ‡ฮตฮฏฮฟ ฮณฮนฮฑ ฯ€ฮฑฮนฯ‡ฮฝฮฏฮดฮนฮฑ ฯ€ฮฟฯ… ฯ€ฮตฯฮนฮปฮฑฮผฮฒฮฌฮฝฮฟฯ…ฮฝ anti-cheat, ฮฑฮบฯŒฮผฮท ฮบฮฑฮน ฯŒฯ„ฮฑฮฝ ฮตฮฏฮฝฮฑฮน ฮฑฯ€ฮตฮฝฮตฯฮณฮฟฯ€ฮฟฮนฮทฮผฮญฮฝฮฟ. ฮ— ฮฑฯ†ฮฑฮฏฯฮตฯƒฮฎ ฯ„ฮฟฯ… ฮบฮฟฮปฮปฮฌฮตฮน ฯ„ฮทฮฝ ฮตฮณฮบฮฑฯ„ฮฌฯƒฯ„ฮฑฯƒฮฎ ฯ„ฮฟฯ…ฯ‚ ฯƒฯ„ฮฟ 0% ฮคฮฟ DroidDeck ฯ„ฯฮญฯ‡ฮตฮน ฯ€ฮฑฮนฯ‡ฮฝฮฏฮดฮนฮฑ ฯ‡ฯ‰ฯฮฏฯ‚ ฮฑฯ…ฯ„ฯŒ ฯ„ฮฟ ฯ€ฮตฯฮนฮฒฮฌฮปฮปฮฟฮฝ Proton x86, ฯ€ฮฟฯ… ฯ„ฮฟ DroidDeck ฮดฮตฮฝ ฮผฯ€ฮฟฯฮตฮฏ ฮฝฮฑ ฯ„ฯฮญฮพฮตฮน ฮ ฯฮฟฮตฯ€ฮนฮปฮฟฮณฮฎ ฮณฮนฮฑ ฯŒฮปฮฑ ฯ„ฮฑ ฯ€ฮฑฮนฯ‡ฮฝฮฏฮดฮนฮฑ @@ -3022,6 +3331,19 @@ ฮ”ฮนฮฑฯ„ฮทฯฮฟฯฮฝฯ„ฮฑฮน ฮ ฮฑฮนฯ‡ฮฝฮฏฮดฮนฮฑ ฮตฮบฯ„ฯŒฯ‚ Steam ฮบฮฑฮน ฮบฮฟฮนฮฝฯŒ prefix Steam Prefix ฯ€ฮฑฮนฯ‡ฮฝฮนฮดฮนฯŽฮฝ ฯ€ฮฟฯ… ฯ€ฯฮฟฯƒฯ„ฮญฮธฮทฮบฮฑฮฝ ฮฑฯ€ฯŒ ฮบฮฑฯ„ฮฑฯƒฯ„ฮฎฮผฮฑฯ„ฮฑ ฮฎ ฯ‡ฮตฮนฯฮฟฮบฮฏฮฝฮทฯ„ฮฑ + ฮšฮฟฮนฮฝฯŒ prefix ฯ„ฮฟฯ… Steam + ฮคฮฟ Steam ฮตฮบฯ„ฮตฮปฮตฮฏ ฮตฮดฯŽ ฯ„ฮฑ ฮดฮนฮบฮฌ ฯ„ฮฟฯ… ฮฒฮฟฮทฮธฮทฯ„ฮนฮบฮฌ ฯ€ฯฮฟฮณฯฮฌฮผฮผฮฑฯ„ฮฑ Windows + ฮคฮฟ ฮดฮนฮฑฮณฯฮฌฯ†ฮตฮน (%1$s). ฮคฮฟ Steam ฮดฮทฮผฮนฮฟฯ…ฯฮณฮตฮฏ ฮฝฮญฮฟ ฯ„ฮทฮฝ ฮตฯ€ฯŒฮผฮตฮฝฮท ฯ†ฮฟฯฮฌ ฯ€ฮฟฯ… ฮธฮฑ ฯ„ฮฟ ฯ‡ฯฮตฮนฮฑฯƒฯ„ฮตฮฏ. + ฮœฮนฮฑ ฮตฯ†ฮฑฯฮผฮฟฮณฮฎ ฮบฮฑฯ„ฮฑฯƒฯ„ฮฎฮผฮฑฯ„ฮฟฯ‚ ฮบฮฑฮน ฯ„ฮฑ ฯ€ฮฑฮนฯ‡ฮฝฮฏฮดฮนฮฑ ฯ€ฮฟฯ… ฯ„ฯฮญฯ‡ฮฟฯ…ฮฝ ฮผฮต ฮฑฯ…ฯ„ฮฎฮฝ + ฮงฯฮทฯƒฮนฮผฮฟฯ€ฮฟฮนฮตฮฏฯ„ฮฑฮน ฮฑฯ€ฯŒ %1$s + ฮ ฮฑฮนฯ‡ฮฝฮฏฮดฮน ฮตฮบฯ„ฯŒฯ‚ Steam %1$s + ฮ”ฮตฮฝ ฮฑฮฝฯ„ฮนฯƒฯ„ฮฟฮนฯ‡ฮตฮฏ ฯƒฮต ฯ€ฮฑฮนฯ‡ฮฝฮฏฮดฮน, ฮฟฯ€ฯŒฯ„ฮต ฮดฮนฮฑฯ„ฮทฯฮตฮฏฯ„ฮฑฮน + ฮ‘ฯ†ฮฑฮฏฯฮตฯƒฮท ฮตฯ€ฮนฮปฮตฮณฮผฮญฮฝฯ‰ฮฝ ยท %1$s + ฮšฮฑฯ„ฮฌฯฮณฮทฯƒฮท ฮตฯ€ฮนฮปฮตฮณฮผฮญฮฝฯ‰ฮฝ ยท %1$s + Prefix Wine + ฮŸฮน ฮฑฯ€ฮฟฮธฮทฮบฮตฯฯƒฮตฮนฯ‚ ฮบฮฑฮน ฮฟฮน ฯฯ…ฮธฮผฮฏฯƒฮตฮนฯ‚ ฮผฮญฯƒฮฑ ฯ„ฮฟฯ…ฯ‚ ฯ‡ฮฌฮฝฮฟฮฝฯ„ฮฑฮนยท ฮฟฮน ฮฑฯ€ฮฟฮธฮทฮบฮตฯฯƒฮตฮนฯ‚ Steam Cloud ฯ€ฮฑฯฮฑฮผฮญฮฝฮฟฯ…ฮฝ ฯƒฯ„ฮฟฮฝ ฮปฮฟฮณฮฑฯฮนฮฑฯƒฮผฯŒ ฯƒฮฑฯ‚. + ฮ ฯฮฟฯƒฯ‰ฯฮนฮฝฮญฯ‚ ฮผฮฝฮฎฮผฮตฯ‚ shaders + ฮ ฯฯŒฮธฮตฮผฮฑ %1$s ยท ฯƒฮบฮนฮฑฯƒฯ„ฮญฯ‚ %2$s ฮ›ฮทฯ†ฮธฮญฮฝฯ„ฮฑ ฯ€ฮฑฮบฮญฯ„ฮฑ ฮ”ฮนฮฑฯ„ฮทฯฮทฮผฮญฮฝฮฑ ฮฑฯฯ‡ฮนฮบฮฌ ฮ”ฮตฮฝ ฮญฯ‡ฮฟฯ…ฮฝ ฮปฮทฯ†ฮธฮตฮฏ ฯ€ฮฑฮบฮญฯ„ฮฑ ฯƒฯ„ฮฟฮนฯ‡ฮตฮฏฯ‰ฮฝ. @@ -3056,6 +3378,8 @@ DroidDeck ยท %1$d fps ฮคฮฑ 60 fps ฯ†ฮฑฮฏฮฝฮฟฮฝฯ„ฮฑฮน ฯ€ฮนฮฟ ฮฟฮผฮฑฮปฮฌ, ฮฑฮปฮปฮฌ ฮตฯ€ฮนฮฒฮฑฯฯฮฝฮฟฯ…ฮฝ ฯ€ฮตฯฮนฯƒฯƒฯŒฯ„ฮตฯฮฟ ฯ„ฮฟฮฝ ฮตฯ€ฮตฮพฮตฯฮณฮฑฯƒฯ„ฮฎ ฯŒฯƒฮฟ ฮพฮตฮบฮนฮฝฮฌ ฯ„ฮฟ Steam. ฮˆฮฝฮฑ ฮฒฮฏฮฝฯ„ฮตฮฟ ฯ€ฮฟฯ… ฮตฯ€ฮนฮปฮญฯ‡ฮธฮทฮบฮต ฯƒฯ„ฮนฯ‚ ฯฯ…ฮธฮผฮฏฯƒฮตฮนฯ‚ ฯ„ฮฟฯ… Steam ฮตฮผฯ†ฮฑฮฝฮฏฮถฮตฯ„ฮฑฮน ฮบฮน ฮตฮดฯŽ. ฮ‰ฯ‡ฮฟฯ‚ + ฮ ฮฑฯฮฌฮปฮตฮนฯˆฮท ฯ„ฮฑฮนฮฝฮฏฮฑฯ‚ ฮตฮบฮบฮฏฮฝฮทฯƒฮทฯ‚ + ฮงฯฮทฯƒฮนฮผฮฟฯ€ฮฟฮนฮตฮฏ ฮญฮฝฮฑ ฮผฮฑฯฯฮฟ ฮบฮปฮนฯ€ 0,1 ฮดฮตฯ…ฯ„ฮตฯฮฟฮปฮญฯ€ฯ„ฮฟฯ… ฯ‰ฯ‚ ฯ„ฮฑฮนฮฝฮฏฮฑ ฮตฮบฮบฮฏฮฝฮทฯƒฮทฯ‚ ฯ„ฮฟฯ… Steam. ฮ•ฯ†ฮฑฯฮผฯŒฮถฮตฯ„ฮฑฮน ฯƒฯ„ฮทฮฝ ฮตฯ€ฯŒฮผฮตฮฝฮท ฯƒฯ…ฮฝฮตฮดฯฮฏฮฑ. ฮ”ฮนฮบฯŒ ฯƒฮฑฯ‚ ฮฒฮฏฮฝฯ„ฮตฮฟ MP4, MOV, MKV ฮฎ WebM. ฮ†ฮปฮปฮตฯ‚ ฮผฮฟฯฯ†ฮญฯ‚ ฮบฮฑฮน ฮฑฯฯ‡ฮตฮฏฮฑ ฯ€ฮฌฮฝฯ‰ ฮฑฯ€ฯŒ %1$d MB ฮผฮตฯ„ฮฑฯ„ฯฮญฯ€ฮฟฮฝฯ„ฮฑฮน ฯƒฯ„ฮท ฯƒฯ…ฯƒฮบฮตฯ…ฮฎ ฯƒฮต WebM 720p, ฮญฯ‰ฯ‚ %2$d ฮดฮตฯ…ฯ„ฮตฯฯŒฮปฮตฯ€ฯ„ฮฑ. ฮ•ฮนฯƒฮฑฮณฯ‰ฮณฮฎ @@ -3517,6 +3841,7 @@ ฮ”ฮนฮฑฯ„ฮทฯฮตฮฏ ฯ„ฮฑ Alt+Tab, ฯ„ฮฟ ฯ€ฮปฮฎฮบฯ„ฯฮฟ Win ฮบฮฑฮน ฯ„ฮฟ ฮบฮฟฯ…ฮผฯ€ฮฏ ฮ‘ฯฯ‡ฮนฮบฮฎฯ‚ ฯƒฯ„ฮทฮฝ ฮตฮฝฮตฯฮณฮฎ ฯƒฯ…ฮฝฮตฮดฯฮฏฮฑ DroidDeck ฮฑฮฝฯ„ฮฏ ฮณฮนฮฑ ฯ„ฮฟ Android. ฮ•ฮฝฮตฯฮณฮฟฯ€ฮฟฮนฮฎฯƒฯ„ฮต ฯ„ฮท ฮฆฯ‰ฯ„ฮตฮนฮฝฯŒฯ„ฮทฯ„ฮฑ ฯƒฯ„ฮท ฮกฯฮธฮผฮนฯƒฮท โ†’ ฮ•ฮฝฯƒฯ‰ฮผฮฌฯ„ฯ‰ฯƒฮท Steam ฮ“ฮญฯ†ฯ…ฯฮฑ Mali: ฮฑฮฝฮตฮฝฮตฯฮณฮฎ + ฮคฮฟ %1$s ฮดฮตฮฝ ฮผฯ€ฮฟฯฮตฮฏ ฮฝฮฑ ฯ‡ฯฮทฯƒฮนฮผฮฟฯ€ฮฟฮนฮฎฯƒฮตฮน ฯ„ฮท ฮณฮญฯ†ฯ…ฯฮฑ Mali (ฯ‡ฯฮตฮนฮฌฮถฮตฯ„ฮฑฮน GPU Mali ฯ‡ฯ‰ฯฮฏฯ‚ ฮดฮนฮฑฮดฯฮฟฮผฮฎ ฮฟฮดฮทฮณฮฟฯ ฯƒฯ…ฯƒฯ„ฮฎฮผฮฑฯ„ฮฟฯ‚), ฮตฯ€ฮฟฮผฮญฮฝฯ‰ฯ‚ ฮฑฯ…ฯ„ฯŒฯ‚ ฮฟ ฮดฮนฮฑฮบฯŒฯ€ฯ„ฮทฯ‚ ฮดฮตฮฝ ฮญฯ‡ฮตฮน ฮบฮฑฮผฮฏฮฑ ฮตฯ€ฮฏฮดฯฮฑฯƒฮท ฮตฮดฯŽ. ฮ“ฮญฯ†ฯ…ฯฮฑ Mali: ฮตฮฝฮตฯฮณฮฎ ฮ— %1$s ฮดฮตฮฝ ฮตฮฏฮฝฮฑฮน Adreno. ฮ— ฯ€ฮตฮนฯฮฑฮผฮฑฯ„ฮนฮบฮฎ ฮณฮญฯ†ฯ…ฯฮฑ Vulkan ฮตฮฏฮฝฮฑฮน ฮตฮฝฮตฯฮณฮฎ: ฮท ฯƒฯ…ฮฝฮตฮดฯฮฏฮฑ ฯƒฯ‡ฮตฮดฮนฮฌฮถฮตฮน ฮผฮญฯƒฯ‰ ฯ„ฮฟฯ… ฯ€ฯฮฟฮณฯฮฌฮผฮผฮฑฯ„ฮฟฯ‚ ฮฟฮดฮฎฮณฮทฯƒฮทฯ‚ ฯ„ฮฟฯ… ฮฏฮดฮนฮฟฯ… ฯ„ฮฟฯ… ฯ„ฮทฮปฮตฯ†ฯŽฮฝฮฟฯ…. ฮ‘ฮฝฮฑฮผฮญฮฝฮตฯ„ฮต ฯƒฯ†ฮฌฮปฮผฮฑฯ„ฮฑยท ฯƒฯ„ฮตฮฏฮปฯ„ฮต ฯ„ฮฑ ฮฑฯฯ‡ฮตฮฏฮฑ ฮบฮฑฯ„ฮฑฮณฯฮฑฯ†ฮฎฯ‚ ฯ„ฮทฯ‚ ฯƒฯ…ฮฝฮตฮดฯฮฏฮฑฯ‚. ฮ‘ฯƒฯ†ฮฑฮปฮฎฯ‚ ฮปฮตฮนฯ„ฮฟฯ…ฯฮณฮฏฮฑ @@ -3542,6 +3867,25 @@ ฮœฮตฯ„ฮฑฮบฮฏฮฝฮทฯƒฮท ฮฑฯฮณฯŒฯ„ฮตฯฮฑ ฮกฯ…ฮธฮผฮฏฯƒฮตฮนฯ‚ ฮณฯฮฑฯ†ฮนฮบฮฟฯ ฯƒฯ„ฮฟฮนฯ‡ฮตฮฏฮฟฯ… ฮ‘ฯ†ฮฑฮฏฯฮตฯƒฮท ฮณฯฮฑฯ†ฮนฮบฮฟฯ ฯƒฯ„ฮฟฮนฯ‡ฮตฮฏฮฟฯ… + ฮ•ฮผฯ†ฮฌฮฝฮนฯƒฮท + ฮ ฮฑฮบฮญฯ„ฮฟ ฮตฮนฮบฮฟฮฝฮนฮดฮฏฯ‰ฮฝ + ฮ ฯฮฟฮตฯ€ฮนฮปฮฟฮณฮฎ ฯƒฯ…ฯƒฯ„ฮฎฮผฮฑฯ„ฮฟฯ‚ + ฮฆฯŒฮฝฯ„ฮฟ ฮผฮต ฯ‡ฯฯŽฮผฮฑ ฮตฯ†ฮฑฯฮผฮฟฮณฮฎฯ‚ + ฮœฮญฮณฮตฮธฮฟฯ‚ ฮตฮนฮบฮฟฮฝฮนฮดฮฏฯ‰ฮฝ + ฮœฮนฮบฯฯŒ + ฮœฮตฯƒฮฑฮฏฮฟ + ฮœฮตฮณฮฌฮปฮฟ + ฮ‘ฯ€ฯŒฮบฯฯ…ฯˆฮท ฮฟฮฝฮฟฮผฮฌฯ„ฯ‰ฮฝ ฮตฯ†ฮฑฯฮผฮฟฮณฯŽฮฝ + ฮ‘ฯ€ฯŒฯƒฯ„ฮฑฯƒฮท + ฮฃฯ„ฮตฮฝฮฎ + ฮœฮญฯ„ฯฮนฮฑ + ฮ•ฯ…ฯฮตฮฏฮฑ + ฮ‘ฮปฮปฮฑฮณฮฎ ฮตฮนฮบฮฟฮฝฮนฮดฮฏฮฟฯ… + ฮ•ฯ€ฮฑฮฝฮฑฯ†ฮฟฯฮฌ ฮตฮนฮบฮฟฮฝฮนฮดฮฏฮฟฯ… + ฮ‘ฮฝฮฑฮถฮฎฯ„ฮทฯƒฮท ฮตฮนฮบฮฟฮฝฮนฮดฮฏฯ‰ฮฝ + ฮฆฯŒฯฯ„ฯ‰ฯƒฮท ฮตฮนฮบฮฟฮฝฮนฮดฮฏฯ‰ฮฝโ€ฆ + ฮ”ฮตฮฝ ฮฒฯฮญฮธฮทฮบฮฑฮฝ ฮตฮนฮบฮฟฮฝฮฏฮดฮนฮฑ. + ฮ ฯฮฟฯƒฮฑฯฮผฮฟฯƒฮผฮญฮฝฮฑ ฮตฮนฮบฮฟฮฝฮฏฮดฮนฮฑ ฮ ฯฮฟฯƒฮธฮฎฮบฮท ฯƒฮต ฯ†ฮฌฮบฮตฮปฮฟ ฮฮญฮฟฯ‚ ฯ†ฮฌฮบฮตฮปฮฟฯ‚ ฮ‘ฯ†ฮฑฮฏฯฮตฯƒฮท ฮฑฯ€ฯŒ ฯ†ฮฌฮบฮตฮปฮฟ @@ -3657,5 +4001,81 @@ ฮ”ฮตฮฝ ฮฎฯ„ฮฑฮฝ ฮดฯ…ฮฝฮฑฯ„ฮฎ ฮท ฮตฮนฯƒฮฑฮณฯ‰ฮณฮฎ ฮฑฯ…ฯ„ฮฎฯ‚ ฯ„ฮทฯ‚ ฮดฮนฮฌฯ„ฮฑฮพฮทฯ‚ ฮšฮฑฯ„ฮฑฮบฯŒฮบฮบฮนฮฝฮฟ ฯ‡ฮนฯŒฮฝฮน + ฮ›ฮตฯ…ฮบฮญฯ‚ ฮตฯ€ฮนฯ†ฮฌฮฝฮตฮนฮตฯ‚ ฮผฮต ฮบฯŒฮบฮบฮนฮฝฮตฯ‚ ฮปฮตฯ€ฯ„ฮฟฮผฮญฯฮตฮนฮตฯ‚. + Soundtrack + ฮœฮฟฯ…ฯƒฮนฮบฮฎ + ฮ•ฯ€ฮนฮปฮฟฮณฮญฯ‚ ฮฑฮฝฮฑฯ€ฮฑฯฮฑฮณฯ‰ฮณฮฎฯ‚ + ฮ‘ฮณฮฑฯ€ฮทฮผฮญฮฝฮฑ + ฮฃฯ…ฮปฮปฮฟฮณฮญฯ‚ + ฮ”ฮตฮฝ ฯ…ฯ€ฮฌฯฯ‡ฮฟฯ…ฮฝ ฯƒฯ…ฮปฮปฮฟฮณฮญฯ‚ ฮฑฮบฯŒฮผฮท. ฮ ฮฑฯ„ฮฎฯƒฯ„ฮต ฯ„ฮฟ ฮตฮนฮบฮฟฮฝฮฏฮดฮนฮฟ ฯƒฮตฮปฮนฮดฮฟฮดฮตฮฏฮบฯ„ฮท ฮณฮนฮฑ ฮฝฮฑ ฮดฮทฮผฮนฮฟฯ…ฯฮณฮฎฯƒฮตฯ„ฮต ฮผฮฏฮฑ. + ฮ‘ฯ€ฮฟฮธฮทฮบฮตฯ…ฮผฮญฮฝฮฑ + ฮ”ฮทฮผฮนฮฟฯ…ฯฮณฮฏฮฑ ฯƒฯ…ฮปฮปฮฟฮณฮฎฯ‚ + ฮŸฯฮณฮฑฮฝฯŽฯƒฯ„ฮต ฯ„ฮฑ ฮฑฯ€ฮฟฮธฮทฮบฮตฯ…ฮผฮญฮฝฮฑ ฯƒฮฑฯ‚ + ฮฮญฮฑ + ฮ”ฮทฮผฮนฮฟฯ…ฯฮณฮฏฮฑ + ฮŒฮฝฮฟฮผฮฑ ฯƒฯ…ฮปฮปฮฟฮณฮฎฯ‚ + ฮ•ฮนฯƒฮฑฮณฮฌฮณฮตฯ„ฮต ฮญฮฝฮฑ ฯŒฮฝฮฟฮผฮฑ ฯ€ฮฟฯ… ฮดฮตฮฝ ฯ‡ฯฮทฯƒฮนฮผฮฟฯ€ฮฟฮนฮตฮฏ ฮฌฮปฮปฮท ฯƒฯ…ฮปฮปฮฟฮณฮฎ + ฮ”ฮนฮฑฯ‡ฮตฮฏฯฮนฯƒฮท + ฮœฮตฯ„ฮฟฮฝฮฟฮผฮฑฯƒฮฏฮฑ + ฮ ฯฮฟฯƒฮธฮฎฮบฮท ฮบฮฟฮผฮผฮฑฯ„ฮนฯŽฮฝ + ฮ ฯฮฟฯƒฮธฮฎฮบฮท (%1$d) + ฮšฮฑฯ„ฮฌฯฮณฮทฯƒฮท ฮบฮฟฮผฮผฮฑฯ„ฮนฯŽฮฝ + ฮ”ฮนฮฑฮณฯฮฑฯ†ฮฎ ฯƒฯ…ฮปฮปฮฟฮณฮฎฯ‚ + ฮ”ฮนฮฑฮณฯฮฑฯ†ฮฎ %1$s; + ฮคฮฑ ฮบฮฟฮผฮผฮฌฯ„ฮนฮฑ ฯ€ฮฑฯฮฑฮผฮญฮฝฮฟฯ…ฮฝ ฯƒฯ„ฮท ฯƒฯ…ฯƒฮบฮตฯ…ฮฎ ฯƒฮฑฯ‚. ฮšฮฑฯ„ฮฑฯฮณฮตฮฏฯ„ฮฑฮน ฮผฯŒฮฝฮฟ ฮท ฯƒฯ…ฮปฮปฮฟฮณฮฎ. + ฮ•ฯ€ฮนฮปฮฟฮณฮฎ + ฮ•ฯ€ฮนฮปฮฟฮณฮฎ ฯŒฮปฯ‰ฮฝ + ฮ‘ฯ€ฮฟฮตฯ€ฮนฮปฮฟฮณฮฎ ฯŒฮปฯ‰ฮฝ + %1$d ฮตฯ€ฮนฮปฮตฮณฮผฮญฮฝฮฑ + ฮ ฯฮฟฯƒฮธฮฎฮบฮท ฯƒฯ„ฮท ฯƒฯ…ฮปฮปฮฟฮณฮฎ + ฮ ฯฮฟฯƒฮธฮฎฮบฮท ฯƒฯ„ฮฑ ฮฑฮณฮฑฯ€ฮทฮผฮญฮฝฮฑ + ฮšฮฑฯ„ฮฌฯฮณฮทฯƒฮท ฮฑฯ€ฯŒ ฯ„ฮท ฯƒฯ…ฮปฮปฮฟฮณฮฎ + ฮ‘ฮฝฮฑฮถฮฎฯ„ฮทฯƒฮท ฮบฮฟฮผฮผฮฑฯ„ฮนฯŽฮฝ + ฮฃฮตฮนฯฮฌ ฮฌฮปฮผฯ€ฮฟฯ…ฮผ + ฮœฮตฮณฮฑฮปฯฯ„ฮตฯฮท ฮดฮนฮฌฯฮบฮตฮนฮฑ ฯ€ฯฯŽฯ„ฮฑ + ฮœฮนฮบฯฯŒฯ„ฮตฯฮท ฮดฮนฮฌฯฮบฮตฮนฮฑ ฯ€ฯฯŽฯ„ฮฑ + ฮšฮฟฮผฮผฮฌฯ„ฮนฮฑ + ฮคฯŒฮฝฮฟฯ‚ + ฮ•ฯ€ฮฑฮฝฮฑฯ†ฮฟฯฮฌ + ฮ ฮฑฯฮฌฮปฮตฮนฯˆฮท ฯƒฮนฯ‰ฯ€ฮฎฯ‚ + ฮงฯฮฟฮฝฮฟฮดฮนฮฑฮบฯŒฯ€ฯ„ฮทฯ‚ ฯฯ€ฮฝฮฟฯ… + %1$d ฮป. + ฮคฮญฮปฮฟฯ‚ ฮบฮฟฮผฮผฮฑฯ„ฮนฮฟฯ + ฮ‘ฯ€ฮฟฮผฮญฮฝฮฟฯ…ฮฝ %1$s + ฮ™ฯƒฮฟฯƒฯ„ฮฑฮธฮผฮนฯƒฯ„ฮฎฯ‚ + ฮ•ฮฝฮฏฯƒฯ‡ฯ…ฯƒฮท ฮผฯ€ฮฌฯƒฯ‰ฮฝ + ฮŸ ฮนฯƒฮฟฯƒฯ„ฮฑฮธฮผฮนฯƒฯ„ฮฎฯ‚ ฮดฮตฮฝ ฮตฮฏฮฝฮฑฮน ฮดฮนฮฑฮธฮญฯƒฮนฮผฮฟฯ‚ ฯƒฮต ฮฑฯ…ฯ„ฮฎ ฯ„ฮท ฯƒฯ…ฯƒฮบฮตฯ…ฮฎ + ฮ•ฮฝฮตฯฮณฮฟฯ€ฮฟฮฏฮทฯƒฮท ฮตฮฝฯ„ฯŒฯ‚ ฯ€ฮฑฮนฯ‡ฮฝฮนฮดฮนฮฟฯ + ฮ— ฮผฮฟฯ…ฯƒฮนฮบฮฎ ฯƒฯ…ฮฝฮตฯ‡ฮฏฮถฮตฮน ฮฝฮฑ ฯ€ฮฑฮฏฮถฮตฮน ฯŒฯƒฮฟ ฮตฮบฯ„ฮตฮปฮตฮฏฯ„ฮฑฮน ฮญฮฝฮฑ ฯ€ฮฑฮนฯ‡ฮฝฮฏฮดฮน + ฮ”ฮตฮฝ ฯ…ฯ€ฮฌฯฯ‡ฮฟฯ…ฮฝ ฮตฮณฮบฮฑฯ„ฮตฯƒฯ„ฮทฮผฮญฮฝฮฑ soundtrack ฮฑฮบฯŒฮผฮท. + ฮ‘ฮฝฮฑฮถฮฎฯ„ฮทฯƒฮท soundtrack + ฮ ฯฮฟฯƒฮธฮฎฮบฮท ฯ†ฮฑฮบฮญฮปฮฟฯ… soundtrack + ฮ”ฮตฮฝ ฯ…ฯ€ฮฌฯฯ‡ฮฟฯ…ฮฝ ฮฑฯฯ‡ฮตฮฏฮฑ ฮฎฯ‡ฮฟฯ… ฯƒฮต ฮฑฯ…ฯ„ฯŒฮฝ ฯ„ฮฟฮฝ ฯ†ฮฌฮบฮตฮปฮฟ + ฮฃฯ…ฮฝฮฟฮปฮนฮบฮฎ ฮดฮนฮฌฯฮบฮตฮนฮฑ + %1$d ฮบฮฟฮผฮผฮฌฯ„ฮนฮฑ / %2$s + ฮ”ฮฏฯƒฮบฮฟฯ‚ %1$s + ฮคฯ…ฯ‡ฮฑฮฏฮฑ ฯƒฮตฮนฯฮฌ + ฮ ฯฮฟฮทฮณฮฟฯฮผฮตฮฝฮฟ + ฮ‘ฮฝฮฑฯ€ฮฑฯฮฑฮณฯ‰ฮณฮฎ + ฮ ฮฑฯฯƒฮท + ฮ•ฯ€ฯŒฮผฮตฮฝฮฟ + ฮ•ฯ€ฮฑฮฝฮฌฮปฮทฯˆฮท ฮฑฮฝฮตฮฝฮตฯฮณฮฎ + ฮ•ฯ€ฮฑฮฝฮฌฮปฮทฯˆฮท ฯŒฮปฯ‰ฮฝ + ฮ•ฯ€ฮฑฮฝฮฌฮปฮทฯˆฮท ฮตฮฝฯŒฯ‚ + ฮˆฮฝฯ„ฮฑฯƒฮท + ฮ”ฮตฮฝ ฯ…ฯ€ฮฌฯฯ‡ฮฟฯ…ฮฝ ฮฑฯฯ‡ฮตฮฏฮฑ ฮฎฯ‡ฮฟฯ… ฯƒฮต ฮฑฯ…ฯ„ฯŒ ฯ„ฮฟ soundtrack + ฮ— ฮตฮบฮบฮฏฮฝฮทฯƒฮท ฮดฮตฮฝ ฮตฮฏฮฝฮฑฮน ฮดฮนฮฑฮธฮญฯƒฮนฮผฮท + ฮ”ฮตฮฝ ฮตฮฏฮฝฮฑฮน ฮดฮนฮฑฮธฮญฯƒฮนฮผฮฟ ฯ€ฯฯŒฮณฯฮฑฮผฮผฮฑ ฯ€ฮตฯฮนฮฎฮณฮทฯƒฮทฯ‚ ฮนฯƒฯ„ฮฟฯ ฮณฮนฮฑ ฯ„ฮฟ ฮฌฮฝฮฟฮนฮณฮผฮฑ ฮฑฯ…ฯ„ฮฟฯ ฯ„ฮฟฯ… ฯƒฯ…ฮฝฮดฮญฯƒฮผฮฟฯ…. + ฮ ฮนฮฌฯƒฮต + ฮ†ฯ†ฮทฯƒฮต + ฮ‘ฯ€ฮฟฮธฮฎฮบฮตฯ…ฯƒฮท + ฮšฯฮฌฯ„ฮทฯƒฮต ฮณฮนฮฑ ฮตฯ€ฮฑฮฝฮฑฯ†ฮฟฯฮฌ + ฮšฮฑฯ„ฮฑฯƒฯ„ฮฎฮผฮฑฯ„ฮฑ + ฮงฯฯŒฮฝฮฟฯ‚ ฮบฮฑฯฮญ + ฮœฮญฯƒฮฟฯ‚ ฯฯ…ฮธฮผฯŒฯ‚ ฮบฮฑฯฮญ + ฮ”ฮนฮฑฮบฮฟฮผฮนฯƒฯ„ฮฎฯ‚ ฯ€ฯฮฟฮฒฮฟฮปฮฎฯ‚ + ฮšฮฑฯ„ฮฌฯƒฯ„ฮฑฯƒฮท HDR + ฮ•ฮผฯ†ฮฑฮฝฮฏฮถฮฟฮฝฯ„ฮฑฮน + %1$d ฮฑฯ€ฯŒ %2$d diff --git a/app/src/main/res/values-es/input_library.xml b/app/src/main/res/values-es/input_library.xml new file mode 100644 index 0000000000..fe2ee17896 --- /dev/null +++ b/app/src/main/res/values-es/input_library.xml @@ -0,0 +1,132 @@ + + + La pantalla seleccionada no estรก disponible. Conรฉctala para editar este diseรฑo a su tamaรฑo real. + ยฟDescartar los cambios de diseรฑo sin guardar? + Este diseรฑo lo usan %1$d perfiles. Los cambios guardados se aplican a todos. + Perfiles predeterminados + Modo escritorio + Modo juego + Predeterminado para escritorio y juego + Predeterminado para el modo juego + Predeterminado para el modo escritorio + Ajustes del dispositivo + Controles + Botones, sticks, gatillos y teclas extra + Copiar perfil + Restablecer acciones + ยฟRestablecer las acciones de %1$s a los valores predeterminados de su perfil base? Los diseรฑos y otros perfiles no cambiarรกn. + ยฟEliminar %1$s? Los modos que lo usan volverรกn a su perfil predeterminado integrado. Los diseรฑos guardados y los ajustes compartidos seguirรกn disponibles. + Visibilidad + Se aplica a todos los perfiles. Auto muestra los controles de la pantalla principal cuando no hay mando conectado en el modo juego. + Editar en pantalla + Diseรฑos guardadosโ€ฆ + Elige un diseรฑo o crea el tuyo + Elige Controles de perfil en el menรบ de sesiรณn de la pantalla secundaria. Los selectores de Perfil y Pantalla secundaria del menรบ del mando eligen los controles que se muestran. + Acciones de botones + Compartido con %1$s. Las ediciones tambiรฉn se aplican a esos perfiles. + Reutilizar ajustes + Usar ajustes deโ€ฆ + Copiar de otro perfil o mantener los ajustes compartidos + Hacer independiente + Mantener la configuraciรณn actual y dejar de compartir cambios + Los diseรฑos guardan elementos y sus posiciones. Cada perfil puede asignar sus propias acciones. Edita a tamaรฑo completo en la pantalla de destino. + Diseรฑo actual + ยฟEliminar el diseรฑo sin usar %1$s y sus acciones guardadas? + Renombrar el diseรฑo actual + La configuraciรณn de entrada ilegible se guardรณ en una copia de recuperaciรณn. Puede seguir editando los perfiles restaurados. + Propiedades + Propiedades del clic + %1$s ยท Clic + Botones + Sticks, pads y gatillos + Ocultar herramientas + Mando + Envรญa la entrada del mando a Steam Input o al juego. + Este elemento no envรญa entrada de mando, ratรณn ni teclado. + Clic del ratรณn + Acciรณn de DroidDeck + Acciรณn + Velocidad de desplazamiento: %1$d pasos/s + + Perfil nuevo + + Diseรฑo nuevo + %1$s ยท Lo usan %2$d perfiles. Los cambios se aplican a todos los perfiles que usan estas asignaciones. + Cambiar nombre + Eliminar + Aรฑade elementos al diseรฑo antes de asignar sus acciones. + No se pudo guardar la configuraciรณn de entrada + Nombre + Empezar desde + Botรณn + Stick + Panel tรกctil + Cruceta + Gatillo + Listo + Deshacer + + Aรฑadir + Arrastra para mover. Arrastra una esquina para cambiar el tamaรฑo. Toca Propiedades para asignar una acciรณn. + Editando en la pantalla secundaria + Reutilizar %1$s de otro perfil. Las demรกs fuentes de control no cambiarรกn. + Mantener compartidos los controles fรญsicos + Por defecto, todos los controles y diseรฑos personalizados son copias independientes. Compartir solo vincula los controles fรญsicos. + Usar estos elementos y posiciones. Compartir mantiene sincronizados los cambios futuros de geometrรญa; tus acciones de botรณn siguen siendo independientes. Un diseรฑo distinto empieza con acciones sin asignar. + Copiar estos controles y acciones, o vincularlos para que los cambios futuros se apliquen a ambos perfiles. + Mantener compartido + Copia independiente + Iniciar el stick en el punto de toque + Ocultar el stick cuando no se use + Herramientas + Auto (%1$s) + Personalizado (%1$s) + Guardar como perfil nuevo + Controles del perfil + Perfil + Gestos del panel tรกctil del ratรณn + Si se asigna al puntero del ratรณn: toca para hacer clic, mantรฉn para arrastrar y desplaza con dos dedos. + %1$s tiene una anulaciรณn del menรบ rรกpido. Selecciona Auto allรญ para usar su perfil predeterminado y sus tres partes guardadas. + Entrada de DroidDeck + Se mantiene mientras el stick se mueve en cualquier direcciรณn: se pulsa por encima del 55 %, se suelta por debajo del 35 %. Usa Teclas de direcciรณn para asignar cada direcciรณn por separado. Los comandos de DroidDeck se ejecutan una vez por desvรญo. El clic del stick se configura aparte. + Se mantiene mientras se toca el panel tรกctil; se suelta al levantar el dedo. Los comandos de DroidDeck se ejecutan una vez por toque. El clic del panel se configura aparte. + Se mantiene cuando el gatillo supera el 55 %; se suelta por debajo del 35 %. Los comandos de DroidDeck se ejecutan una vez por pulsaciรณn. + Direcciรณn de desplazamiento + Vertical + Horizontal + Desplazar horizontalmente + Mediciones + Activa la grabaciรณn, usa los controles en una sesiรณn en marcha y luego vuelve y lee los resultados. Mide solo el tiempo de envรญo de DroidDeck, no la latencia de pantalla. La grabaciรณn termina al cerrar el proceso de la app. + %1$d controles + Otros diseรฑos guardados (%1$d) โ–พ + Ocultar otros diseรฑos guardados (%1$d) โ–ด + Inicio / Guรญa + Atrรกs ยท un toque + Atrรกs ยท doble toque + Atrรกs ยท dos veces en Steam, una en escritorio + En modo Steam. Mantener Atrรกs tambiรฉn abre el acceso rรกpido. + Restaurar valores predeterminados + Tu elecciรณn de panel se recuerda. Escritorio abre un segundo espacio de trabajo; no cambia la sesiรณn ni su perfil de entrada. + Mando virtual + El tipo de mando que ven Steam o el juego. + Pantalla tรกctil + Cรณmo se manejan los toques en la pantalla del juego. Los botones del perfil mantienen sus acciones asignadas. + Cursor tรกctil + Muestra un puntero para toques directos en la pantalla del juego. + Tocar y mantener + Acciรณn del ratรณn al mantener un dedo en la pantalla del juego. + Toques del botรณn Atrรกs + Primera acciรณn: un toque. Segunda acciรณn: doble toque. + Botรณn de alternar + Toca para mantener, toca de nuevo para soltar. Abrir un menรบ o cambiar de perfil suelta el botรณn. + Forma + Redondeada + Pรญldora + Cรญrculo + Rectรกngulo + Etiqueta del botรณn + Texto + Imagen importada + Teclas diagonales separadas + Asigna una tecla a cada diagonal. Una diagonal vacรญa pulsa sus dos direcciones vecinas. + Direcciones vecinas + Tus antiguas teclas en pantalla se guardaron como perfiles importados abajo. Selecciona uno para usarlo o editarlo. Se mantuvieron tus selecciones de perfil actuales. + Las antiguas teclas en pantalla no se pudieron importar automรกticamente. Se conservรณ la configuraciรณn original. + diff --git a/app/src/main/res/values-es/input_strings.xml b/app/src/main/res/values-es/input_strings.xml new file mode 100644 index 0000000000..e6e5a5bec5 --- /dev/null +++ b/app/src/main/res/values-es/input_strings.xml @@ -0,0 +1,38 @@ + + + Perfiles de entrada + Perfiles + Mando fรญsico + Pantalla principal + Pantalla secundaria + Nativo / Steam Input + Nativo: %1$s + Enviar otro control del mando + Desactivado + Tecla o combinaciรณn de teclas + Teclas de direcciรณn + Mover el puntero + Velocidad del puntero: %1$d + Desplazar + Desplazar verticalmente + Botรณn izquierdo del ratรณn + Botรณn derecho del ratรณn + Botรณn central del ratรณn + Abrir el menรบ de DroidDeck + Mostrar el teclado + Abrir el menรบ de Steam + Abrir el acceso rรกpido de Steam + Quitar control + Aรฑadir control + Botones especรญficos del dispositivo + Asignar un botรณn fรญsico + Suelta el botรณn y elige Editar, Reintentar o Cancelar. B o Atrรกs cancela tras soltarlo. + Reintentar + Pulsa un botรณn, incluido un botรณn Atrรกs informado como tecla. Las teclas de volumen y del sistema Android estรกn reservadas. La asignaciรณn solo se aplica a este dispositivo. + Quitar asignaciรณn + Diagnรณstico de entrada + Registrar el tiempo de envรญo de entrada + Leer mediciones + Mide el envรญo de Android hasta su publicaciรณn en el transporte de entrada existente. No incluye la llegada por Bluetooth, el sondeo del invitado, el renderizado ni la latencia de pantalla. La grabaciรณn estรก desactivada de forma predeterminada. + Usar la asignaciรณn de entrada normal + diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 1e7fb4865a..dedf2b43ff 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -28,6 +28,8 @@ Suspender ahora Detener sesiรณn Generaciรณn de fotogramas + Ajustes para este juego + Ajustes predeterminados Elige el modo de generaciรณn de fotogramas Desactivada DD-FG %1$dร— @@ -183,6 +185,7 @@ No se pudo descargar el entorno grรกfico de PowerVR. Comprueba la conexiรณn e intรฉntalo de nuevo. No se ha podido descargar DirectAudio, asรญ que el audio de los juegos usa la ruta mรกs lenta en esta sesiรณn. Este programa + La sesiรณn no pudo dibujar en la pantalla: %1$s. En lugar de mostrarse una pantalla negra, esta pantalla explica el motivo; los registros de la sesiรณn contienen los detalles. No se ha podido descargar el cliente de Steam. Puede que tu red o VPN estรฉ bloqueando los servidores de Steam; comprueba la conexiรณn y vuelve a intentarlo. No se ha podido configurar el cliente de Steam. Comprueba la conexiรณn y el espacio libre y vuelve a intentarlo. %1$s estรก hecho para PC x86 y se ejecuta con FEX, que aรบn no estรก instalado. Abre Steam una vez con tu sesiรณn iniciada y deja que descargue FEX y el Steam Linux Runtime; despuรฉs vuelve a iniciarlo. @@ -386,6 +389,9 @@ Aรบn no compatible aquรญ Cargando los componentesโ€ฆ No se pudo instalar: %1$s + Esta descarga necesita una actualizaciรณn. + Actualizaciรณn en cola. + Reintentar actualizaciรณn Descargado Descargando %1$s Instalando: %1$s @@ -416,6 +422,22 @@ Solo interno Carpeta: %1$s Segunda biblioteca + Mรกs bibliotecas de Steam + Carpetas en las que Steam puede instalar juegos y desde las que puede ejecutarlos, cada una con su propio nombre. Al eliminar una, sus juegos permanecen en el disco. + Aรฑadir biblioteca + Cambiar nombre + Nombre de la biblioteca + Selecciona una carpeta para la biblioteca + Como mรกximo %1$d bibliotecas aรฑadidas + Esa carpeta ya es una biblioteca o estรก dentro de una + %1$s ยท no disponible + Se aplicarรก a partir de la prรณxima sesiรณn de Steam + Encontradas en este dispositivo ยท %1$s ยท %2$s + Aรฑadir + Buscar bibliotecas en el almacenamiento interno + Permite el acceso a todos los archivos para que DroidDeck pueda ver las bibliotecas de Steam que otras aplicaciones guardan en el almacenamiento interno + Permitir + Se aรฑadiรณ %1$s, la biblioteca de Steam dentro de la carpeta que seleccionaste Los juegos que cargan recursos desde la SD o el almacenamiento compartido pueden ir a tirones. Diagnรณstico de almacenamiento Registra los resultados de asignaciรณn y muestras de tiempos de almacenamiento en Compartir registros. Puede ralentizar las instalaciones mientras estรฉ activado. Se aplica en la prรณxima sesiรณn. @@ -480,6 +502,7 @@ Activado Se inicia con Steam Se inicia sin Steam + Resoluciรณn del juego Ajustes Ajustes de %1$s Predeterminado @@ -567,6 +590,8 @@ Nรบcleos de juegos Nรบcleos de juegos Nรบcleos para los juegos. Con todos seleccionados, Android los asigna libremente. + Ahorrar energรญa en juegos estables + Ejecuta un juego en los nรบcleos mรกs lentos mientras mantiene una tasa de fotogramas estable, y lo devuelve a sus nรบcleos habituales cuando se queda atrรกs. Interfaz del cliente GL con subprocesos Puede hacer los menรบs de Steam mรกs รกgiles. @@ -602,7 +627,10 @@ Desactiva el asistente de navegaciรณn con mando de Proton, que consume CPU en cada juego. Ejecutar proot sin seccomp Puede corregir errores de syscalls ausentes en algunos kernels. Puede reducir el rendimiento. + Ejecutar sin proot (experimental) + Inicia el entorno Linux directamente en Android. Se aplicarรก en la prรณxima sesiรณn. Desactiva esta opciรณn si algo no arranca. Ruta rรกpida de proot + No se usa sin proot. Requiere el filtro seccomp de proot. Bรบsquedas de archivos mรกs rรกpidas y menos tirones. Desactรญvalo si un programa no encuentra sus archivos. Dibujar el cursor dentro de gamescope @@ -685,6 +713,7 @@ Memoria grรกfica Memoria de intercambio Nivel de baterรญa + Tiempo de baterรญa restante Consumo de energรญa Red Resoluciรณn @@ -812,6 +841,7 @@ Dispositivo compatible GPU sin probar GPU no compatible + GPU a travรฉs del puente Mali %1$s ยท %2$s %1$s: %2$s No hay un motor grรกfico compatible disponible; %1$s puede mostrar una pantalla negra @@ -841,15 +871,38 @@ Sesiรณn Registros de sesiรณn Se guardan tras cada sesiรณn + Diagnรณsticos mejorados para la prรณxima sesiรณn + Captura registros detallados durante una sesiรณn. Puede reducir el rendimiento y ocupar mรกs espacio de almacenamiento. Se desactiva automรกticamente al iniciar la sesiรณn; revisa los registros antes de compartirlos. Registros de depuraciรณn de juegos Incluye diagnรณsticos de Proton, Wine y grรกficos en el prรณximo inicio de un juego. Puede reducir el rendimiento y usar mรกs almacenamiento. Reinicia esta sesiรณn para guardar los registros de depuraciรณn de juegos No se ha podido actualizar el registro. Comprueba el interruptor y vuelve a intentarlo. Herramientas de depuraciรณn + Registros detallados de grรกficos + Interfaz de Steam: dibujo con GPU + Con el par de controladores Xclipse, Steam dibuja sus pรกginas por software (el dibujo con GPU mostraba teselas corruptas). Activa esta opciรณn para una interfaz de Steam mรกs rรกpida si se ve bien en este telรฉfono. + compilado el %1$s + %1$s actualizado a la compilaciรณn mรกs reciente + El puente Mali no superรณ la autoprueba en %1$s durante la รบltima sesiรณn (imรกgenes o dibujos), por lo que la sesiรณn usรณ el par de controladores PanVK en su lugar. + El puente Mali no encontrรณ forma de compartir memoria con el controlador en %1$s durante la รบltima sesiรณn, por lo que la sesiรณn usรณ el par de controladores PanVK en su lugar. El puente no puede funcionar en este telรฉfono; desactivarlo mantiene el par PanVK. + Los registros de Proton, DXVK y de los controladores de cada juego se incluyen en los registros de la sesiรณn. Siempre activado cuando la GPU no es Adreno. รšltimos registros de sesiรณn Registros de sesiรณn guardados Conserva los %1$d mรกs recientes Borrar registros + Registros de sesiรณn disponibles + Todavรญa no hay registros de sesiรณn guardados. + Los ZIP compartidos y guardados incluyen la sesiรณn seleccionada y los diagnรณsticos relacionados de Steam, la tienda, las herramientas y Battle.net. + %1$s ยท %2$s + Sesiรณn actual + Compartir + Guardar en el dispositivo + Eliminar + ยฟEliminar registros de sesiรณn? + ยฟEliminar %1$s? Esta acciรณn no se puede deshacer. + Registros de sesiรณn guardados. + No se pudieron guardar los registros de sesiรณn. + No se pudieron eliminar los registros de sesiรณn. Restablecer todos los ajustes Devuelve cada ajuste a su valor predeterminado Restablecer @@ -876,6 +929,8 @@ Usar como pantalla de inicio DroidDeck puede ser la app de inicio DroidDeck nunca se ofrece como app de inicio + El botรณn de inicio abre + La pรกgina que se muestra cuando DroidDeck es la aplicaciรณn de inicio y pulsas el botรณn de inicio. En Aรฑadir juegos, pon DroidDeck en Incluir Orientaciรณn Orientaciรณn del launcher @@ -889,15 +944,22 @@ Pantalla completa Oculta las barras de estado y navegaciรณn de Android Muestra las barras de estado y navegaciรณn de Android + Lanzador de doble pantalla + Automรกtico coloca las secciones del lanzador (Steam, Biblioteca, Tiendas y el resto) en la segunda pantalla de las consolas portรกtiles que la llevan integrada. Activado usa cualquier segunda pantalla. Desactivado mantiene el lanzador en una sola pantalla. + Sesiones de doble pantalla + Automรกtico acopla el menรบ dentro del juego en la segunda pantalla integrada en lugar de una ventana emergente. Activado usa cualquier segunda pantalla. Desactivado mantiene el menรบ en la pantalla del juego; desde รฉl todavรญa puedes elegir una segunda pantalla. Automรกtico Activado Desactivado Controles en la pantalla inferior en juegos + Teclado Android para campos de texto Abre el trackpad y el teclado en la segunda pantalla al iniciar una sesiรณn. Escribiendo en la pantalla superior Hecho App de inicio predeterminada Elige una app de inicio + Ocultar el lanzador de Recientes cuando estรฉ inactivo + Solo se aplica cuando DroidDeck es la aplicaciรณn de inicio predeterminada y no hay ninguna sesiรณn en curso. Elegir Apps de Linux (beta) Archivos @@ -1009,9 +1071,173 @@ Vista previa Las correcciones mรกs recientes, antes que Estable Al dรญa + Copiar detalles de la versiรณn + Detalles de la versiรณn copiados + Mรกs nueva que Vista previa + Vas por delante de Vista previa + Esta versiรณn es mรกs nueva que la รบltima Vista previa. La prรณxima versiรณn de Vista previa la actualizarรก. + Elige una versiรณn para ver sus cambios o instalarla. + Instalada + Instalar esta versiรณn%1$s + Volver a esta versiรณn%1$s + versionCode %1$d + Commit %1$s + Pรกgina de la versiรณn + El PR tiene un commit mรกs nuevo (%1$s). Su versiรณn de prueba aรบn no estรก lista, asรญ que esta no lo incluye. + Hay un commit mรกs nuevo, versiรณn pendiente + Nรบmero de PR, tรญtulo o autor + Ninguna versiรณn de prueba coincide + Hay que recompilarla (versionCode %1$d) + Actualizaciones de versiones de prueba + Nueva versiรณn de prueba del PR #%1$d + %1$s. Abre Actualizaciones para instalarla. + Mostrar mรกs (%1$d) + Hay que recompilarlas para versionCode %2$d (%1$d) + Versiones de Vista previa en main desde esta versiรณn de prueba: %1$d Versiones de prueba Prueba una correcciรณn antes de su publicaciรณn Ninguna por ahora + Compilaciรณn de laboratorio + Compilaciones de laboratorio + En uso + En pausa despuรฉs de que Android reoptimizara DroidDeck + No cargada: %1$s + Esperando un reinicio + Conservada + Para otra versiรณn + Recompilar + Elimina esta compilaciรณn del dispositivo + Reiniciar con esta + Desactivar + Usar + Eliminar + Eliminar ahora + No se pudo preparar el reinicio: %1$s. Empareja la depuraciรณn inalรกmbrica en Configuraciรณn y vuelve a intentarlo. + Compilaciรณn de laboratorio instalada + DroidDeck se reiniciรณ con %1$s + Compilaciรณn de laboratorio en pausa + Android volviรณ a optimizar DroidDeck, por lo que %1$s no se ha cargado. Abre Actualizaciones para reiniciar con ella. + Compilaciรณn de laboratorio desactivada + Se compilรณ para otra versiรณn de DroidDeck. Se conserva en Actualizaciones. + DroidDeck no se iniciรณ en dos ocasiones con esa compilaciรณn. + Agente + Agente + El agente estรก trabajando + Instala Claude Code en el espacio de usuario de Linux para usar el agente. + Pregunta sobre un juego, un fallo o un cambio en DroidDeck + Enviar + Nueva conversaciรณn + Detener + Almacenamiento + Quitar + Quitar ahora + Claude Code + Codex + Cรณdigo fuente de DroidDeck + Cachรฉs de descarga + Se pierden los cambios que no se han subido + Las compilaciones vuelven a descargarlos + El asistente de configuraciรณn puede volver a instalarlo; se conservan los inicios de sesiรณn + DroidDeck se ha reiniciado con tu compilaciรณn de laboratorio. Continรบa donde lo dejaste. + Pregรบntale por quรฉ un juego no arranca, que explique un registro o que cambie DroidDeck y pruebe el cambio en este dispositivo. + Error: %1$s + %1$s terminรณ (cรณdigo de salida %2$d) + Detenido + Terminรณ sin respuesta + Reintentar + Configurando el agente + Recompila mi compilaciรณn de laboratorio %1$s para la versiรณn instalada de DroidDeck y reinicia con ella. + %1$s de entrada ยท %2$s de salida + Pensando + Pensamiento + Pensando ยท %1$s + %1$s ยท %2$s + ENTRADA + SALIDA + Ejecutandoโ€ฆ + Sin resultado: el turno terminรณ antes + Sin salida + Escribe para encolar el siguiente mensaje + Encolar + Siguiente: %1$s + No enviar + Adjuntar + Quitar + Predeterminado + Esfuerzo de razonamiento + Adelante + Revisar + Aรบn no hay cambios + Adelante con el plan. + Enviar ahora + Mรกs + Cerrar + Mรกs reciente + Trabajando + Contexto + %1$s de %2$s + Esta conversaciรณn ยท %1$s + El uso se muestra despuรฉs de la primera respuesta + Lรญmite de %1$d horas + Lรญmite de %1$d minutos + Lรญmite semanal + %1$d%% ยท se restablece %2$s + + %1$d de archivos + %1$d archivo + %1$d archivos + + Planificar primero + Planificar + Propone un plan sin cambiar nada + Conversaciones + Aรบn no hay conversaciones + Ahora mismo + Eliminar + Elimina la conversaciรณn y sus adjuntos + Procesos + No hay nada en ejecuciรณn en el espacio de usuario de Linux + AGENTE + Detener + Compilaciรณn de Lab + Preparando compilaciones de Lab + %1$d%% ยท quedan aprox. %2$s + quedan aprox. %1$s + Cancelar + Cancelar compilaciรณn + Iniciando + %1$d%% + Empaquetando + Reiniciando DroidDeck en รฉl + Listo + Fallรณ: %1$s + Configurar el agente + Instala primero el entorno de ejecuciรณn de Linux en Configuraciรณn. + Reintentar + Empezar a chatear + Conexiรณn del dispositivo + Depuraciรณn inalรกmbrica para que el agente pueda ver y controlar DroidDeck + Instalar %1$s + En el espacio de usuario de Linux, con git, gh y adb + Iniciar sesiรณn en %1$s + Abre el navegador + GitHub + Opcional, para abrir solicitudes de incorporaciรณn de cambios + Herramientas de compilaciรณn + Opcional, para compilaciones de Lab en este dispositivo ยท unos 5 GB + Agente listo + Termina de configurar el agente + Sesiรณn iniciada en %1$s + Compilaciones de Lab + compilaciones rรกpidas + Compilaciones rรกpidas de Lab + Compila esta versiรณn con antelaciรณn, asรญ las compilaciones de Lab se hacen en minutos ยท unos 20 minutos una sola vez + Compilando ยท %1$d%% ยท quedan unos %2$s + Preparar + No se puede acceder a la depuraciรณn inalรกmbrica; Emparejar la activa + Emparejar + Instalar + Iniciar sesiรณn PR #%1$d No compilada para esta copia de DroidDeck Actualizada %1$s @@ -1255,6 +1481,9 @@ Apps Configuraciรณn Actualizar + Mรกs + Editar pestaรฑas + Pestaรฑas %1$d%% Reanudar %1$s Aparece como /root/ROMs en cada sesiรณn. El almacenamiento interno estรก en /root/Storage. @@ -1276,6 +1505,15 @@ Cancelar en cola Teclado de Android Ocultar โœ• + Tamaรฑo en pantalla + Proporciรณn de la pantalla que ocupa el teclado, cabecera incluida. + Opacidad + Redรบcela para ver el juego detrรกs del teclado. + Teclas ocultas + Las teclas que apenas usas no aparecen en el teclado. + Esc y fila de teclas de funciรณn + Ins / Supr / Inicio / Fin / RePรกg / AvPรกg + Teclas de direcciรณn Iniciar %1$s Elige una pantalla. Secundaria: %1$s. La pantalla secundaria ya no estรก disponible. @@ -1794,7 +2032,24 @@ Terminal Agarres de Deck + trackpads Panel + Escritorio + Iniciar el escritorio + Escritorio ยท %1$s + Panel tรกctil + Toque directo + Panel tรกctil. Toca para cambiar a toque directo + Toque directo. Toca para cambiar al panel tรกctil + Iniciando el escritorio KDEโ€ฆ + El escritorio se cerrรณ. + No se pudo iniciar el escritorio. Los registros estรกn en la carpeta bottom-desktop de esta sesiรณn. + El escritorio estรก cerrado. Todavรญa no hay nada que mostrar aquรญ. + Intercambiar pantallas + La pantalla inferior no estรก disponible ahora mismo + Pantalla del juego + Mostrar el juego en + Pantalla superior + Pantalla inferior Descargas No hay descargas en curso. Steam @@ -1829,6 +2084,20 @@ Combustible, t Principal %1$s t Reserva %1$s t + Tiempo de fotograma + รบltimos %1$d s + fotograma medio + Mรญnimo del 1 % + fotogramas de mรกs de 33 ms + %1$d / min + Jugando desde hace %1$s + %1$d nรบcleos, hasta %2$s GHz + %1$d nรบcleos + juego + FPS de %1$d Hz + La marca roja seรฑala el punto en el que el HUD muestra la temperatura en rojo. + todo el dispositivo + baterรญa Enviar datos al panel Automรกtico Lo activa en todos los juegos de esta lista, incluidos los que se encuentren mรกs adelante. Los juegos que desactives seguirรกn desactivados. @@ -1852,6 +2121,10 @@ El micro estรก desactivado en este juego. Para hablar, activa Micrรณfono en los ajustes de Steam de DroidDeck (Audio) y vuelve a iniciar el juego. Volumen %1$d%% Estadรญsticas del juego + HUD de la pantalla inferior + Barra en todas las pestaรฑas + Mรญnimos del 1 % y el 0,1 % + Temperatura de la CPU FPS CPU GPU @@ -2025,6 +2298,7 @@ Iniciando la sesiรณnโ€ฆ %1$d:%2$02d transcurridos ยท sigue en marcha Descargando la actualizaciรณn del cliente de Steam ยท %1$d%% + Aplicando la actualizaciรณn del cliente de Steamโ€ฆ Descargando el cliente de Steam ยท %1$s Ya se estรก instalando una herramienta de compatibilidad @@ -2101,11 +2375,29 @@ Contornos toon mรกs nitidez. La GPU no es Adreno + Controlador PowerVR del sistema: la compatibilidad varรญa segรบn el dispositivo + Experimental: RADV o el controlador Xclipse del sistema + PowerVR del sistema + Usa los controladores integrados para esta GPU + Se ha seleccionado el controlador PowerVR del sistema para el entorno de ejecuciรณn y la pantalla. + Aรบn no hay ningรบn controlador de cรณdigo abierto que admita este Mali: el puente Mali estรก activado. + Esta es la compilaciรณn de prueba para dispositivos sin Snapdragon: las compilaciones oficiales de aquรญ solo funcionan en Adreno, asรญ que no se instalan sobre ella. Las nuevas compilaciones de prueba estรกn en github.com/The412Banner/droiddeck-nonadreno-drivers. + La รบltima sesiรณn terminรณ porque Android cerrรณ DroidDeck para liberar memoria, no por un fallo. Cierra otras aplicaciones o reduce los ajustes de texturas del juego y vuelve a intentarlo. + Mali (Venus) + el puente Mali + Aรบn no hay ningรบn controlador de cรณdigo abierto que admita este Mali: se usa %1$s, sobre el controlador propio del telรฉfono. + %1$s aรบn no se ha publicado: se usa %2$s hasta que se publique. + %1$s no estรก disponible y el controlador de este telรฉfono informa de Vulkan %2$s (Venus necesita 1.2): se usa el puente Mali. + %1$s aรบn no se ha publicado: el puente Mali estรก activado hasta que se publique. + En cola: %1$s (a la espera de otro controlador del entorno de ejecuciรณn) + DXVK lo proporciona el entorno de ejecuciรณn PowerVR del sistema. Se pueden guardar otros paquetes de DXVK, pero no se aplican con este controlador. Compatible Experimental: sus controladores son versiones de prueba Compatibilidad experimental con Adreno 850: requiere controladores experimentales de pantalla y de juegos compatibles; no verificada en este dispositivo Por debajo del hardware probado (Adreno 725 y posteriores): puede que no funcione No compatible: no hay un motor grรกfico compatible disponible para esta GPU + Se ejecuta a travรฉs del puente Mali, sobre el controlador Vulkan propio del telรฉfono + No se admite con el puente Mali desactivado: Turnip necesita una GPU Adreno (Snapdragon) Se alcanzรณ el lรญmite de solicitudes de GitHub - intรฉntalo mรกs tarde GitHub respondiรณ HTTP %1$d @@ -2214,7 +2506,6 @@ Tiendas Steam Personalizados - Tiendas Nivel de velocidad de descarga Equilibrado Rรกpido @@ -2253,6 +2544,7 @@ Esperando a la otra descarga de Battle.netโ€ฆ Abre Battle.net e inicia sesiรณn una vez; despuรฉs instala sus juegos desde aquรญ. El descargador de Blizzard se ha detenido: %1$s + El descargador de Blizzard ha dejado de avanzar. Error de Blizzard %1$s Actualizar Juegos de Blizzard @@ -2260,6 +2552,7 @@ Interrumpida Instalar ยท %1$s Obtener gratis + Aรฑadiendo a la bibliotecaโ€ฆ Ver en %1$s Comprar ยท %1$s Instalado @@ -2306,6 +2599,12 @@ Ordenar Etiquetas de la barra lateral Muestra los nombres debajo de los iconos de la barra lateral. Desactรญvalo para una barra lateral mรกs estrecha. + Mascota del agente + DeeDee flota sobre el lanzador y los juegos y muestra lo que estรก haciendo el agente. + Sobre otras aplicaciones + Permite que DeeDee flote sobre todas las aplicaciones y abra su chat allรญ + Permitir + Chat con DeeDee Vista Tarjetas mรกs grandes Tarjetas mรกs pequeรฑas @@ -2589,7 +2888,14 @@ %1$s ยท reinicio pendiente Este dispositivo ยฟQuitar %1$s? - Diagnรณstico + Desarrollador + Marca de agua de compilaciรณn + Muestra en pantalla la etiqueta de la versiรณn de prueba o Lab. Activada de forma predeterminada. + Compartir paquetes de diagnรณstico + Sesiรณn y dispositivo + Grรกficos + Juegos y compatibilidad + Todos los paquetes Listo para jugar Aรบn no estรก listo para jugar runtime %1$s @@ -2628,6 +2934,9 @@ Activa los logros de GOG en los ajustes de tiendas Logros no disponibles; revisa los registros de la sesiรณn Logro desbloqueado + Mali (Venus): desactivado + Mali (Venus): activado + El controlador de %1$s informa de Vulkan %2$s. Mali (Venus) necesita Vulkan 1.2 o posterior (gamescope no se inicia en versiones anteriores), asรญ que las sesiones omiten Venus y usan en su lugar el par de controladores PanVK. Pegar Stick izquierdo Stick derecho @@ -2919,7 +3228,7 @@ Elegir carpetaโ€ฆ Usa cualquier carpeta de una tarjeta SD o unidad USB Los juegos se guardan en una carpeta Games dentro de la ubicaciรณn seleccionada. Los juegos existentes no se mueven. - Dรณnde va + Quรฉ ocupa espacio Juegos de Steam Datos de juegos Prefijos %1$s ยท taller %2$s ยท shaders %3$s @@ -2988,6 +3297,7 @@ Instaladores de VC++ y DirectX que piden los juegos Ejecuta juegos Linux x86 Herramienta de Steam + Steam descarga esto para los juegos que incluyen sistema antitrampas, incluso cuando estรก desactivado. Al eliminarlo, su instalaciรณn se queda atascada en el 0 % DroidDeck ejecuta juegos sin este runtime Proton x86, que DroidDeck no puede ejecutar Predeterminado para todos los juegos @@ -3058,6 +3368,19 @@ Conservados Juegos que no son de Steam y prefijo compartido de Steam Prefijos de juegos aรฑadidos desde tiendas o a mano + Prefijo compartido de Steam + Steam ejecuta aquรญ sus propias herramientas de Windows + Lo borra (%1$s). Steam crea uno nuevo la prรณxima vez que lo necesite. + Una app de tienda y los juegos que se ejecutan con ella + Usado por %1$s + Juego que no es de Steam %1$s + No coincide con ningรบn juego, asรญ que se conserva + Quitar selecciรณn ยท %1$s + Desinstalar selecciรณn ยท %1$s + Prefijos de Wine + Se pierden las partidas y los ajustes que contienen; las partidas de Steam Cloud se conservan en tu cuenta. + Cachรฉs de shaders + Prefijo %1$s ยท shaders %2$s Paquetes descargados Originales guardados No hay paquetes de componentes descargados. @@ -3094,6 +3417,8 @@ DroidDeck ยท %1$d fps 60 fps se ve mรกs fluido pero usa mรกs CPU mientras Steam se inicia. Un vรญdeo elegido en los ajustes de Steam tambiรฉn aparece aquรญ. Sonido + Omitir vรญdeo de inicio + Usa un clip negro de 0,1 segundos como vรญdeo de inicio de Steam. Se aplicarรก en la prรณxima sesiรณn. Tu propio vรญdeo MP4, MOV, MKV o WebM. Otros formatos y archivos de mรกs de %1$d MB se convierten a WebM 720p en el dispositivo, hasta %2$d segundos. Importar @@ -3555,6 +3880,7 @@ Mantiene Alt+Tab, la tecla Win y el botรณn Inicio en una sesiรณn activa de DroidDeck en lugar de Android. Activa Brillo en Configuraciรณn โ†’ Integraciรณn con Steam Puente Mali: desactivado + %1$s no puede usar el puente Mali (necesita una GPU Mali sin ruta de controlador del sistema), asรญ que este interruptor no tiene efecto aquรญ. Puente Mali: activado %1$s no es una Adreno. El puente Vulkan experimental estรก activado: la sesiรณn dibuja a travรฉs del propio controlador del telรฉfono. Espera errores; envรญa los registros de la sesiรณn. Modo seguro @@ -3580,6 +3906,25 @@ Mover despuรฉs Ajustes del widget Quitar widget + Apariencia + Paquete de iconos + Predeterminado del sistema + Fondo con color de la app + Tamaรฑo de iconos + Pequeรฑo + Mediano + Grande + Ocultar nombres de aplicaciones + Espaciado + Denso + Normal + Amplio + Cambiar icono + Restablecer icono + Buscar iconos + Cargando iconosโ€ฆ + No se encontraron iconos. + Iconos personalizados Aรฑadir a carpeta Carpeta nueva Quitar de la carpeta @@ -3696,5 +4041,81 @@ No se ha podido importar esta disposiciรณn Nieve escarlata + Superficies blancas con acentos rojos. + Bandas sonoras + Mรบsica + Opciones de reproducciรณn + Favoritos + Colecciones + Aรบn no hay colecciones. Toca el icono de marcador para crear una. + Guardados + Crear una colecciรณn + Organiza tus guardados + Nueva + Crear + Nombre de la colecciรณn + Introduce un nombre que no use ninguna otra colecciรณn + Gestionar + Cambiar nombre + Aรฑadir pistas + Aรฑadir (%1$d) + Quitar pistas + Eliminar colecciรณn + ยฟEliminar %1$s? + Las pistas permanecen en tu dispositivo. Solo se elimina la colecciรณn. + Seleccionar + Seleccionar todo + Deseleccionar todo + %1$d seleccionadas + Aรฑadir a la colecciรณn + Aรฑadir a favoritos + Quitar de la colecciรณn + Buscar pistas + Orden del รกlbum + Mรกs largas primero + Mรกs cortas primero + Pistas + Tono + Restablecer + Omitir silencios + Temporizador de sueรฑo + %1$d min + Fin de la pista + Quedan %1$s + Ecualizador + Refuerzo de graves + El ecualizador no estรก disponible en este dispositivo + Activar en el juego + Mantรฉn la banda sonora sonando mientras se ejecuta un juego + Aรบn no hay bandas sonoras instaladas. + Buscar bandas sonoras + Aรฑadir una carpeta de banda sonora + No hay archivos de audio en esa carpeta + Duraciรณn total + %1$d pistas / %2$s + Disco %1$s + Aleatorio + Anterior + Reproducir + Pausar + Siguiente + Repeticiรณn desactivada + Repetir todo + Repetir una + Volumen + No hay archivos de audio en esta banda sonora + Inicio no disponible + No hay ningรบn navegador web disponible para abrir este enlace. + Agarrar + Soltar + Guardar + Mantรฉn para restablecer + Tiendas + Tiempo de fotograma + Frecuencia media de fotogramas + Servidor de pantalla + Estado HDR + Mostrados + %1$d de %2$d diff --git a/app/src/main/res/values-fi/input_library.xml b/app/src/main/res/values-fi/input_library.xml new file mode 100644 index 0000000000..846dae260f --- /dev/null +++ b/app/src/main/res/values-fi/input_library.xml @@ -0,0 +1,132 @@ + + + Valittu nรคyttรถ ei ole kรคytettรคvissรค. Yhdistรค se, niin voit muokata tรคtรค asettelua tรคydessรค koossa. + Hylรคtรครคnkรถ tallentamattomat asettelumuutokset? + Tรคmรค asettelu on kรคytรถssรค %1$d profiilissa. Tallennetut muutokset koskevat kaikkia. + Oletusprofiilit + Tyรถpรถytรคtila + Pelitila + Oletus tyรถpรถydรคlle ja pelille + Oletus pelitilalle + Oletus tyรถpรถytรคtilalle + Laitteen asetukset + Ohjaimet + Painikkeet, tikut, liipaisimet ja lisรคnรคppรคimet + Kopioi profiili + Nollaa toiminnot + Nollataanko kohteen %1$s toiminnot perusprofiilin oletuksiin? Asettelut ja muut profiilit pysyvรคt ennallaan. + Poistetaanko %1$s? Sitรค kรคyttรคvรคt tilat palaavat sisรครคnrakennettuun oletusprofiiliin. Tallennetut asettelut ja jaetut asetukset sรคilyvรคt. + Nรคkyvyys + Koskee kaikkia profiileja. Auto nรคyttรครค pรครคnรคytรถn ohjaimet, kun pelitilassa ei ole ohjainta kytkettynรค. + Muokkaa nรคytรถllรค + Tallennetut asettelutโ€ฆ + Valitse asettelu tai luo oma + Valitse Profiilin ohjaimet toissijaisen nรคytรถn istuntovalikosta. Ohjainvalikon Profiili- ja Toissijainen nรคyttรถ -valinnat mรครคrรครคvรคt nรคytettรคvรคt ohjaimet. + Painikkeiden toiminnot + Jaettu kohteen %1$s kanssa. Muutokset koskevat myรถs nรคitรค profiileja. + Kรคytรค asetuksia uudelleen + Kรคytรค asetuksia kohteestaโ€ฆ + Kopioi toisesta profiilista tai pidรค asetukset jaettuina + Tee itsenรคiseksi + Sรคilytรค nykyinen kokoonpano ja lopeta muutosten jakaminen + Asettelut tallentavat elementit ja niiden sijainnit. Jokainen profiili voi mรครคrittรครค omat toimintonsa. Muokkaa tรคydessรค koossa kohdenรคytรถllรค. + Nykyinen asettelu + Poistetaanko kรคyttรคmรคtรถn asettelu %1$s ja sen tallennetut toiminnot? + Nimeรค nykyinen asettelu uudelleen + Lukukelvottomat syรถttรถasetukset tallennettiin palautuskopioon. Voit jatkaa palautettujen profiilien muokkaamista. + Ominaisuudet + Napsautuksen ominaisuudet + %1$s ยท Napsautus + Painikkeet + Tikut, alustat ja liipaisimet + Piilota tyรถkalut + Ohjain + Lรคhettรครค ohjaimen syรถtteen Steam Inputille tai pelille. + Tรคmรค elementti ei lรคhetรค ohjaimen, hiiren tai nรคppรคimistรถn syรถtettรค. + Hiiren napsautus + DroidDeck-toiminto + Toiminto + Vieritysnopeus: %1$d askelta/s + + Uusi profiili + + Uusi asettelu + %1$s ยท Kรคytรถssรค %2$d profiilissa. Muutokset koskevat kaikkia profiileja, jotka kรคyttรคvรคt nรคitรค mรครคrityksiรค. + Nimeรค uudelleen + Poista + Lisรครค elementtejรค asetteluun ennen toimintojen mรครคrittรคmistรค. + Syรถttรถasetusten tallentaminen epรคonnistui + Nimi + Aloita + Painike + Tikku + Kosketuslevy + Ristikko-ohjain + Liipaisin + Valmis + Kumoa + + Lisรครค + Vedรค siirtรครคksesi. Vedรค kulmasta muuttaaksesi kokoa. Napauta Ominaisuudet mรครคrittรครคksesi toiminnon. + Muokataan toissijaisella nรคytรถllรค + Kรคytรค uudelleen %1$s toisesta profiilista. Muut ohjauslรคhteet pysyvรคt ennallaan. + Pidรค fyysiset ohjaimet jaettuina + Oletuksena kaikki ohjaimet ja mukautetut asettelut ovat itsenรคisiรค kopioita. Jakaminen linkittรครค vain fyysiset ohjaimet. + Kรคytรค nรคitรค elementtejรค ja sijainteja. Jakaminen pitรครค tulevat geometriamuutokset synkronissa; painiketoiminnot pysyvรคt itsenรคisinรค. Eri asettelu alkaa mรครคrittรคmรคttรถmillรค toiminnoilla. + Kopioi nรคmรค ohjaimet ja toiminnot tai linkitรค ne, jotta tulevat muutokset koskevat molempia profiileja. + Pidรค jaettuna + Itsenรคinen kopio + Aloita tikku kosketuskohdasta + Piilota tikku, kun sitรค ei kรคytetรค + Tyรถkalut + Automaattinen (%1$s) + Mukautettu (%1$s) + Tallenna uutena profiilina + Profiilin ohjaimet + Profiili + Hiiren kosketuslevyn eleet + Kun mรครคritetty hiiren osoittimelle: napauta klikataksesi, pidรค painettuna vetรครคksesi ja vieritรค kahdella sormella. + Kohteella %1$s on pikavalikon ohitus. Valitse Automaattinen kรคyttรครคksesi sen oletusprofiilia ja kaikkia kolmea tallennettua osaa. + DroidDeck-syรถte + Pidetรครคn, kun tikkua liikutetaan mihin tahansa suuntaan: painetaan yli 55 %:ssa, vapautetaan alle 35 %:ssa. Mรครคritรค jokainen suunta erikseen Suuntanรคppรคimillรค. DroidDeck-komennot suoritetaan kerran poikkeamaa kohti. Tikun napsautus mรครคritetรครคn erikseen. + Pidetรครคn kosketuslevyn kosketuksen ajan; vapautetaan, kun nostat sormen. DroidDeck-komennot suoritetaan kerran kosketusta kohti. Kosketuslevyn napsautus mรครคritetรครคn erikseen. + Pidetรครคn, kun liipaisin ylittรครค 55 %; vapautetaan alle 35 %:ssa. DroidDeck-komennot suoritetaan kerran painallusta kohti. + Vierityssuunta + Pystysuora + Vaakasuora + Vieritรค vaakasuunnassa + Mittaukset + Ota tallennus kรคyttรถรถn, kรคytรค ohjaimia kรคynnissรค olevassa istunnossa ja palaa sitten lukemaan tulokset. Mittaa vain DroidDeckin lรคhetysajan, ei nรคytรถn viivettรค. Tallennus pรครคttyy, kun sovelluksen prosessi sulkeutuu. + %1$d ohjainta + Muut tallennetut asettelut (%1$d) โ–พ + Piilota muut tallennetut asettelut (%1$d) โ–ด + Koti / Guide + Takaisin ยท yksi napautus + Takaisin ยท kaksoisnapautus + Takaisin ยท kahdesti Steamissa, kerran tyรถpรถydรคllรค + Steam-tilassa. Takaisin-painikkeen pitรคminen avaa myรถs pikakรคytรถn. + Palauta oletukset + Paneelivalintasi muistetaan. Tyรถpรถytรค avaa toisen tyรถtilan; se ei vaihda istuntoa tai sen syรถttรถprofiilia. + Virtuaaliohjain + Ohjaintyyppi, jonka Steam tai peli nรคkee. + Kosketusnรคyttรถ + Miten pelinรคytรถn kosketuksia kรคsitellรครคn. Profiilin painikkeet sรคilyttรคvรคt mรครคritetyt toimintonsa. + Kosketuskursori + Nรคyttรครค osoittimen suorille kosketuksille pelinรคytรถllรค. + Kosketa ja pidรค + Hiiren toiminto, kun pidรคt sormea pelinรคytรถllรค. + Takaisin-painikkeen napautukset + Ensimmรคinen toiminto: yksi napautus. Toinen toiminto: kaksoisnapautus. + Vaihtopainike + Napauta pitรครคksesi, napauta uudelleen vapauttaaksesi. Valikon avaaminen tai profiilin vaihto vapauttaa painikkeen. + Muoto + Pyรถristetty + Kapseli + Ympyrรค + Suorakaide + Painikkeen nimiรถ + Teksti + Tuotu kuva + Erilliset vinonรคppรคimet + Mรครคritรค nรคppรคin jokaiselle vinolle. Tyhjรค vino painaa kahta viereistรค suuntaa. + Viereiset suunnat + Vanhat nรคyttรถnรคppรคimesi on tallennettu alle tuotuina profiileina. Valitse yksi kรคyttรครคksesi tai muokataksesi sitรค. Nykyiset profiilivalintasi on sรคilytetty. + Vanhoja nรคyttรถnรคppรคimiรค ei voitu tuoda automaattisesti. Alkuperรคiset asetukset on sรคilytetty. + diff --git a/app/src/main/res/values-fi/input_strings.xml b/app/src/main/res/values-fi/input_strings.xml new file mode 100644 index 0000000000..945b606896 --- /dev/null +++ b/app/src/main/res/values-fi/input_strings.xml @@ -0,0 +1,38 @@ + + + Syรถttรถprofiilit + Profiilit + Fyysinen ohjain + Pรครคnรคyttรถ + Toissijainen nรคyttรถ + Alkuperรคinen / Steam Input + Alkuperรคinen: %1$s + Lรคhetรค toinen ohjaimen komento + Pois kรคytรถstรค + Nรคppรคin tai nรคppรคinyhdistelmรค + Suuntanรคppรคimet + Siirrรค osoitinta + Osoittimen nopeus: %1$d + Vieritรค + Vieritรค pystysuunnassa + Hiiren vasen painike + Hiiren oikea painike + Hiiren keskimmรคinen painike + Avaa DroidDeck-valikko + Nรคytรค nรคppรคimistรถ + Avaa Steam-valikko + Avaa Steamin pikakรคyttรถ + Poista ohjain + Lisรครค ohjain + Laittekohtaiset painikkeet + Mรครคritรค fyysinen painike + Vapauta painike ja valitse Muokkaa, Yritรค uudelleen tai Peruuta. B tai Takaisin peruuttaa vapauttamisen jรคlkeen. + Yritรค uudelleen + Paina painiketta, myรถs nรคppรคimeksi ilmoitettua Takaisin-painiketta. ร„รคnenvoimakkuus- ja Android-jรคrjestelmรคnรคppรคimet on varattu. Mรครคritys koskee vain tรคtรค laitetta. + Poista mรครคritys + Syรถtteen diagnostiikka + Tallenna syรถtteen lรคhetysaika + Lue mittaukset + Mittaa lรคhetyksen Androidista julkaisuun olemassa olevaan syรถttรถkanavaan. Bluetoothin saapuminen, vieraan kysely, renderรถinti ja nรคytรถn viive eivรคt sisรคlly. Tallennus on oletuksena pois. + Kรคytรค tavallista syรถttรถmรครคritystรค + diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml index ba86de4422..8d0e351def 100644 --- a/app/src/main/res/values-fi/strings.xml +++ b/app/src/main/res/values-fi/strings.xml @@ -28,6 +28,8 @@ Keskeytรค nyt Lopeta istunto Kehysten generointi + Tรคmรคn pelin asetukset + Oletusasetukset Valitse kehysten generoinnin tila Pois DD-FG %1$dร— @@ -183,6 +185,7 @@ PowerVR-grafiikkaympรคristรถรค ei voitu ladata. Tarkista yhteys ja yritรค uudelleen. DirectAudiota ei voitu ladata, joten pelin รครคni kรคyttรครค tรคssรค istunnossa hitaampaa reittiรค. Tรคmรค ohjelma + Istunto ei pystynyt piirtรคmรครคn nรคytรถlle: %1$s. Mustan ruudun sijaan tรคmรค nรคyttรถ kertoo syyn. Tarkemmat tiedot ovat istuntolokeissa. Steam-asiakasohjelmaa ei voitu ladata. Verkkosi tai VPN saattaa estรครค Steamin palvelimet; tarkista yhteys ja yritรค uudelleen. Steam-asiakasohjelmaa ei voitu ottaa kรคyttรถรถn. Tarkista yhteys ja vapaa tallennustila ja yritรค uudelleen. %1$s on tehty x86-tietokoneille ja kรคynnistyy FEXin kautta, jota ei ole vielรค asennettu. Kรคynnistรค Steam kerran kirjautuneena ja anna sen ladata FEX ja Steam Linux Runtime, sitten kรคynnistรค tรคmรค uudelleen. @@ -385,6 +388,9 @@ Ei tueta tรคssรค vielรค Ladataan komponenttejaโ€ฆ Asennus epรคonnistui: %1$s + Tรคmรค lataus tarvitsee pรคivityksen. + Pรคivitys jonossa. + Yritรค pรคivittรครค uudelleen Ladattu Ladataan: %1$s Asennetaan: %1$s @@ -415,6 +421,22 @@ Vain sisรคinen Kansio: %1$s Toinen kirjasto + Lisรครค Steam-kirjastoja + Kansioita, joihin Steam voi asentaa pelejรค ja joista niitรค voi kรคynnistรครค, kukin omalla nimellรครคn. Kirjaston poistaminen luettelosta sรคilyttรครค pelit levyllรค. + Lisรครค kirjasto + Nimeรค uudelleen + Kirjaston nimi + Valitse kirjastolle kansio + Enintรครคn %1$d lisรคttyรค kirjastoa + Kansio on jo kirjasto tai sijaitsee toisen kirjaston sisรคllรค + %1$s ยท ei kรคytettรคvissรค + Otetaan kรคyttรถรถn seuraavassa Steam-istunnossa + Lรถytyi tรคltรค laitteelta ยท %1$s ยท %2$s + Lisรครค + Etsi kirjastoja sisรคisestรค tallennustilasta + Salli kรคyttรถoikeus kaikkiin tiedostoihin, jotta DroidDeck nรคkee Steam-kirjastot, jotka muut sovellukset sรคilyttรคvรคt sisรคisessรค tallennustilassa + Salli + Lisรคtty %1$s, valitsemasi kansion sisรคllรค oleva Steam-kirjasto Pelit, jotka striimaavat materiaalia SD-kortilta tai jaetulta tallennustilalta, voivat nykiรค. Tallennustilan diagnostiikka Tallentaa varaustulokset ja otetut tallennustilan ajoitusnรคytteet Jaa lokit -toimintoon. Voi hidastaa asennuksia kรคytรถssรค ollessaan. Tulee voimaan seuraavassa istunnossa. @@ -478,6 +500,7 @@ Pรครคllรค Kรคynnistyy Steamin kanssa Kรคynnistyy ilman Steamia + Pelin resoluutio Asetukset %1$s โ€“ asetukset Oletus @@ -565,6 +588,8 @@ Pelin ytimet Pelin ytimet Ytimet peleille. Kun kaikki on valittuna, Android ajoittaa vapaasti. + Sรครคstรค virtaa tasaisissa peleissรค + Ajaa pelin hitaammilla ytimillรค, kun se pitรครค tasaisen ruudunpรคivitysnopeuden, ja palauttaa sen tavallisille ytimilleen, kun se jรครค jรคlkeen. Asiakasohjelman kรคyttรถliittymรค Sรคikeistetty GL Voi tehdรค Steamin valikoista reagoivampia. @@ -600,7 +625,10 @@ Poistaa kรคytรถstรค Protonin ohjaimen navigointiavustimen, joka kuluttaa suoritintehoa jokaisessa pelissรค. Suorita proot ilman seccompia Voi korjata puuttuvan jรคrjestelmรคkutsun virheitรค joissakin ytimissรค. Voi heikentรครค suorituskykyรค. + Suorita ilman prootia (kokeellinen) + Kรคynnistรครค Linux-puolen suoraan Android-alustalla. Muutos tulee voimaan seuraavassa istunnossa. Poista kรคytรถstรค, jos jokin ei kรคynnisty. proot-pikareitti + Ei ole kรคytรถssรค ilman prootia Vaatii prootin seccomp-suodattimen. Nopeampi tiedostojen hakeminen ja vรคhemmรคn nykimistรค. Poista kรคytรถstรค, jos ohjelma ei lรถydรค tiedostojaan. Piirrรค osoitin gamescopessa @@ -683,6 +711,7 @@ Nรคytรถnohjaimen muisti Swap-tila Akun varaus + Akun jรคljellรค oleva kรคyttรถaika Virrankulutus Verkko Tarkkuus @@ -809,6 +838,7 @@ Laite tuettu Testaamaton GPU GPU ei ole tuettu + GPU Mali-sillan kautta %1$s ยท %2$s %1$s: %2$s GPU:lle %1$s ei ole saatavilla yhteensopivaa grafiikkataustajรคrjestelmรครค. Steam saattaa nรคyttรครค mustan ruudun. @@ -838,15 +868,38 @@ Istunto Istunnon lokit Tallennetaan joka istunnon jรคlkeen + Tehostettu diagnostiikka seuraavaa istuntoa varten + Kerรครค yhden istunnon ajalta yksityiskohtaiset lokit. Voi heikentรครค suorituskykyรค ja viedรค enemmรคn tallennustilaa. Kytkeytyy pois pรครคltรค istunnon alkaessa; tarkista lokit ennen jakamista. Pelien vianmรครคrityslokit Sisรคllytรค Protonin, Winen ja grafiikan diagnostiikka seuraavaan pelin kรคynnistykseen. Voi heikentรครค suorituskykyรค ja kรคyttรครค enemmรคn tallennustilaa. Kรคynnistรค tรคmรค istunto uudelleen tallentaaksesi pelien vianmรครคrityslokit Lokitusta ei voitu pรคivittรครค. Tarkista kytkin ja yritรค uudelleen. Vianmรครคritystyรถkalut + Yksityiskohtaiset grafiikkalokit + Steam-kรคyttรถliittymรค: GPU-piirto + Xclipse-ajuriparin kanssa Steam piirtรครค sivunsa ohjelmistollisesti (GPU-piirto nรคytti rikkinรคisiรค laattoja). Ota kรคyttรถรถn nopeampaa Steam-kรคyttรถliittymรครค varten, jos kรคyttรถliittymรค nรคyttรครค tรคssรค puhelimessa virheettรถmรคltรค. + rakennettu %1$s + %1$s pรคivitetty uusimpaan koontiversioon + Mali-silta epรคonnistui itsetestissรครคn laitteella %1$s edellisessรค istunnossa (kuvat tai piirrot), joten istunto kรคytti sen sijaan PanVK-ajuriparia. + Mali-silta ei lรถytรคnyt tapaa jakaa muistia ajurin kanssa laitteella %1$s edellisessรค istunnossa, joten istunto kรคytti sen sijaan PanVK-ajuriparia. Silta ei voi toimia tรคssรค puhelimessa; kun se kytketรครคn pois pรครคltรค, PanVK-pari sรคilyy kรคytรถssรค. + Jokaisen pelin Proton-, DXVK- ja ajurilokit istunnon lokeissa. Aina pรครคllรค, kun GPU ei ole Adreno. Viimeisimmรคt istunnon lokit Tallennetut istunnon lokit Sรคilyttรครค %1$d uusinta Tyhjennรค lokit + Saatavilla olevat istuntolokit + Tallennettuja istuntolokeja ei ole vielรค. + Jaetut ja tallennetut ZIP-paketit sisรคltรคvรคt valitun istunnon sekรค siihen liittyvรคt Steam-, kauppa-, tyรถkalu- ja Battle.net-diagnostiikkatiedot. + %1$s ยท %2$s + Nykyinen istunto + Jaa + Tallenna laitteeseen + Poista + Poistetaanko istuntolokit? + Poistetaanko %1$s? Tรคtรค ei voi perua. + Istuntolokit tallennettu. + Istuntolokeja ei voitu tallentaa. + Istuntolokeja ei voitu poistaa. Palauta kaikki asetukset Palauta jokainen asetus oletusarvoon Palauta @@ -873,6 +926,8 @@ Kรคytรค Aloitusnรคyttรถnรค DroidDeck voi olla kotisovellus DroidDeckiรค ei koskaan tarjota kotisovellukseksi + Koti-painike avaa + Sivu, joka nรคytetรครคn, kun DroidDeck on Koti-sovellus ja painat Koti-painiketta Aseta Lisรครค pelejรค -kohdassa DroidDeck tilaan Sisรคllytรค Suunta Kรคynnistimen suunta @@ -886,15 +941,22 @@ Koko nรคyttรถ Piilottaa Androidin tila- ja navigointipalkit Nรคyttรครค Androidin tila- ja navigointipalkit + Kahden nรคytรถn kรคynnistin + Automaattinen siirtรครค kรคynnistimen osiot (Steam, Kirjasto, Kaupat ja muut) kรคsikonsolin sisรครคnrakennetulle toiselle nรคytรถlle. Pรครคllรค kรคyttรครค mitรค tahansa toista nรคyttรถรค. Pois pรครคltรค pitรครค kรคynnistimen yhdellรค nรคytรถllรค. + Kahden nรคytรถn istunnot + Automaattinen kiinnittรครค pelinsisรคisen valikon sisรครคnrakennetulle toiselle nรคytรถlle ponnahdusikkunan sijaan. Pรครคllรค kรคyttรครค mitรค tahansa toista nรคyttรถรค. Pois pรครคltรค pitรครค valikon pelinรคytรถllรค; voit silti valita toisen nรคytรถn valikosta. Automaattinen Pรครคllรค Pois Alanรคytรถn ohjaimet peleissรค + Android-nรคppรคimistรถ tekstikentille Avaa kosketuslevyn ja nรคppรคimistรถn toiselle nรคytรถlle, kun istunto alkaa. Kirjoitus ylรคruudulle Valmis Oletuskotisovellus Valitse kotisovellus + Piilota kรคynnistin Viimeisimmistรค sovelluksista, kun se on kรคyttรคmรคttรถmรคnรค + Koskee vain, kun DroidDeck on oletus-Koti-sovellus eikรค istunto ole kรคynnissรค. Valitse Linux-sovellukset (beta) Tiedostot @@ -1006,9 +1068,172 @@ Preview Uusimmat korjaukset, ennen Stablea Ajan tasalla + Kopioi buildin tiedot + Buildin tiedot kopioitu + Previewtรค uudempi + Olet Previewtรค edellรค + Tรคmรค build on uudempi kuin viimeisin Preview. Seuraava Preview-build pรคivittรครค sen. + Valitse build nรคhdรคksesi sen muutokset tai asentaaksesi sen. + Asennettu + Asenna tรคmรค build%1$s + Palaa tรคhรคn buildiin%1$s + versionCode %1$d + Commit %1$s + Julkaisusivu + PR:ssรค on uudempi commit (%1$s). Sen testibuild ei ole vielรค valmis, joten tรคmรค ei sisรคllรค sitรค. + Uudempi commit, build odottaa + PR-numero, otsikko tai tekijรค + Mikรครคn testibuild ei vastaa + Rakennettava uudelleen (versionCode %1$d) + Testibuildien pรคivitykset + Uusi testibuild PR:lle #%1$d + %1$s. Asenna se Pรคivitykset-sivulta. + Nรคytรค lisรครค (%1$d) + Rakennettava uudelleen versionCodelle %2$d (%1$d) + Preview-buildejรค mainissa tรคmรคn testibuildin jรคlkeen: %1$d Testibuildit Kokeile korjausta ennen sen julkaisua Ei yhtรครคn juuri nyt + Lab-koontiversio + Lab-koontiversiot + Kรคytรถssรค + Keskeytetty, kun Android optimoi DroidDeckin uudelleen + Ei ladattu: %1$s + Odotetaan uudelleenkรคynnistystรค + Sรคilytetty + Toista versiota varten + Rakenna uudelleen + Poistaa tรคmรคn koontiversion laitteesta + Kรคynnistรค uudelleen sillรค + Kytke pois pรครคltรค + Kรคytรค + Poista + Poista nyt + Uudelleenkรคynnistystรค ei voitu valmistella: %1$s. Parita langaton virheenkorjaus Asetuksissa ja yritรค uudelleen. + Lab-koontiversio asennettu + DroidDeck kรคynnistyi uudelleen koontiversiolla %1$s + Lab-versio tauolla + Android optimoi DroidDeckin uudelleen, joten %1$s ei ole ladattu. Avaa Pรคivitykset kรคynnistรครคksesi DroidDeck sillรค uudelleen. + Lab-versio poistettu kรคytรถstรค + Se rakennettiin DroidDeckin toiselle versiolle. Se on tallessa Pรคivityksissรค. + DroidDeck ei kรคynnistynyt sillรค kahdesti + Agentti + Agentti + Agentti tyรถskentelee + Asenna Claude Code Linux-ympรคristรถรถn kรคyttรครคksesi agenttia. + Kysy pelistรค, kaatumisesta tai DroidDeckin muuttamisesta + Lรคhetรค + Uusi keskustelu + Pysรคytรค + Tallennustila + Poista + Poista nyt + Claude Code + Codex + DroidDeckin lรคhdekoodi + Latausvรคlimuistit + Muutokset, joita ei ole tyรถnnetty, katoavat + Koontiversiot lataavat nรคmรค uudelleen + Kรคyttรถรถnotto voi asentaa sen uudelleen; kirjautumiset sรคilyvรคt + DroidDeck kรคynnistyi uudelleen Lab-versiollasi. Jatka siitรค, mihin jรคit. + Pyydรค kertomaan, miksi peli ei kรคynnisty, selittรคmรครคn loki tai muuttamaan DroidDeckiรค ja kokeilemaan muutosta tรคllรค laitteella. + Epรคonnistui: %1$s + %1$s pรครคttyi (poistumiskoodi %2$d) + Pysรคytetty + Pรครคttyi ilman vastausta + Yritรค uudelleen + Otetaan agenttia kรคyttรถรถn + Rakenna Lab-versio %1$s uudelleen DroidDeckin asennetulle versiolle ja kรคynnistรค DroidDeck sillรค uudelleen. + %1$s sisรครคn ยท %2$s ulos + Ajattelee + Ajatus + Ajattelee ยท %1$s + %1$s ยท %2$s + SYร–TE + TULOSTE + Suoritetaanโ€ฆ + Ei tulosta: vuoro pรครคttyi ensin + Ei tulostetta + Kirjoita lisรคtรคksesi seuraavan viestin jonoon + Jono + Seuraava: %1$s + ร„lรค lรคhetรค + Liitรค + Poista + Oletus + Pรครคttelyteho + Aloita + Muokkaa + Ei muutoksia vielรค + Aloita suunnitelman toteutus. + Lรคhetรค nyt + Lisรครค + Sulje + Uusin + Tyรถskentelee + Konteksti + %1$s %2$s:sta + Tรคmรค keskustelu ยท %1$s + Kรคyttรถ nรคkyy ensimmรคisen vastauksen jรคlkeen + %1$d tunnin aikaraja + %1$d minuutin aikaraja + Viikkoraja + %1$d%% ยท nollautuu %2$s + + %1$d tiedosto + %1$d tiedostoa + + Suunnittele ensin + Suunnittele + Ehdottaa suunnitelmaa muuttamatta mitรครคn + Keskustelut + Ei vielรค keskusteluja + Juuri nyt + Poista + Poistaa sen ja sen liitteet + Prosessit + Linuxin kรคyttรคjรคtilassa ei ole mitรครคn kรคynnissรค + AGENTTI + Pysรคytรค + Lab-koonti + Valmistellaan Lab-koonteja + %1$d%% ยท noin %2$s jรคljellรค + noin %1$s jรคljellรค + Peruuta + Peruuta koonti + Kรคynnistetรครคn + %1$d%% + Pakataan + Kรคynnistetรครคn DroidDeck uudelleen siinรค + Valmis + Epรคonnistui: %1$s + Mรครคritรค agentti + Asenna Linux-suoritusympรคristรถ ensin Setupissa. + Yritรค uudelleen + Aloita keskustelu + Laiteyhteys + Langaton virheenkorjaus, jotta agentti nรคkee DroidDeckin ja voi ohjata sitรค + Asenna %1$s + Linux-kรคyttรคjรคtilaan, mukana git, gh ja adb + Kirjaudu sisรครคn palveluun %1$s + Avaa selaimen + GitHub + Valinnainen, vetopyyntรถjen avaamista varten + Kรครคnnรถstyรถkalut + Valinnainen, Lab-koontiversioille tรคllรค laitteella ยท noin 5 Gt + Agentti valmis + Viimeistele agentin kรคyttรถรถnotto + Kirjautunut sisรครคn palveluun %1$s + Lab-koontiversiot + nopeat koontiversiot + Nopeat Lab-koontiversiot + Kรครคntรครค tรคmรคn version etukรคteen, joten Lab-koontiversiot valmistuvat minuuteissa ยท noin 20 minuuttia vain kerran + Kรครคnnetรครคn ยท %1$d%% ยท noin %2$s jรคljellรค + Valmistele + Langaton virheenkorjaus ei ole tavoitettavissa; Parita ottaa sen kรคyttรถรถn + Parita + Asenna + Kirjaudu sisรครคn PR #%1$d Ei rakennettu tรคlle DroidDeck-kopiolle Pรคivitettiin %1$s @@ -1248,6 +1473,9 @@ Sovellukset Asetukset Pรคivitykset + Lisรครค + Muokkaa vรคlilehtiรค + Vรคlilehdet %1$d %% Jatka: %1$s Nรคkyy sessiossa polussa /root/ROMs. Sisรคinen tallennustila on /root/Storage. @@ -1269,6 +1497,15 @@ Peruuta jonotus Android-nรคppรคimistรถ Piilota โœ• + Koko nรคytรถllรค + Nรคytรถn osuus, jonka nรคppรคimistรถ vie, ylรคpalkki mukaan lukien. + Peittรคvyys + Laske sitรค, jotta peli nรคkyy nรคppรคimistรถn takaa. + Piilotetut nรคppรคimet + Harvoin kรคyttรคmรคsi nรคppรคimet pysyvรคt pois nรคppรคimistรถstรค. + Esc ja funktiorivi + Ins / Del / Home / End / PgUp / PgDn + Nuolinรคppรคimet Kรคynnistรค %1$s Valitse nรคyttรถ. Toinen nรคyttรถ: %1$s. Toinen nรคyttรถ ei ole enรครค kรคytettรคvissรค. @@ -1770,7 +2007,24 @@ Pรครคte Deck-kahvat + kosketuslevyt Kojelauta + Tyรถpรถytรค + Kรคynnistรค tyรถpรถytรค + Tyรถpรถytรค ยท %1$s + Kosketuslevy + Suora kosketus + Kosketuslevy. Napauta vaihtaaksesi suoraan kosketukseen + Suora kosketus. Napauta vaihtaaksesi kosketuslevyyn + Kรคynnistetรครคn KDE-tyรถpรถytรครคโ€ฆ + Tyรถpรถytรค sulkeutui. + Tyรถpรถydรคn kรคynnistys epรคonnistui. Sen lokit ovat tรคmรคn istunnon bottom-desktop-kansiossa. + Tyรถpรถytรค on suljettu. Tรครคllรค ei ole vielรค mitรครคn nรคytettรคvรครค. + Vaihda nรคytรถt + Alanรคyttรถ ei ole juuri nyt vapaana + Pelinรคyttรถ + Nรคytรค peli + Ylรคnรคyttรถ + Alanรคyttรถ Lataukset Latauksia ei ole kรคynnissรค. Steam @@ -1805,6 +2059,20 @@ Polttoaine, t Pรครคtankki %1$s t Varatankki %1$s t + Kehysaika + viimeiset %1$d s + keskim. kehys + alin 1 % + yli 33 ms:n kehykset + %1$d / min + Pelattu %1$s + %1$d ydintรค, enintรครคn %2$s GHz + %1$d ydintรค + peli + %1$d Hz:n FPS + Punainen merkki on kohta, jossa HUD alkaa nรคyttรครค lรคmpรถtilan punaisena. + koko laite + akku Lรคhetรค kojelaudan tiedot Automaattinen Kytkee sen pรครคlle jokaiselle tรคssรค luetellulle pelille, myรถs myรถhemmin lรถytyville. Pois kytkemรคsi pelit pysyvรคt pois pรครคltรค. @@ -1828,6 +2096,10 @@ Mikrofoni on pois pรครคltรค tรคssรค pelissรค. Jos haluat puhua, kytke Mikrofoni pรครคlle DroidDeckin Steam-asetuksissa (ร„รคni) ja kรคynnistรค peli uudelleen. ร„รคnenvoimakkuus %1$d %% Pelinsisรคiset tilastot + Alanรคytรถn HUD + Palkki kaikilla vรคlilehdillรค + alimmat 1 % ja 0,1 % + CPU:n lรคmpรถtila FPS CPU GPU @@ -2000,6 +2272,7 @@ Kรคynnistetรครคn istuntoaโ€ฆ %1$d:%2$02d kulunut ยท yhรค kรคynnissรค Ladataan Steam-asiakasohjelman pรคivitystรค ยท %1$d %% + Asennetaan Steam-asiakasohjelman pรคivitystรคโ€ฆ Ladataan Steam-asiakasohjelmaa ยท %1$s Yhteensopivuustyรถkalun asennus on jo kรคynnissรค @@ -2076,11 +2349,29 @@ Sarjakuvamaiset รครคriviivat ja terรคvรถinti. Ei Adreno-grafiikkapiiri + Jรคrjestelmรคn PowerVR-ajuri: yhteensopivuus vaihtelee laitteen mukaan + Kokeellinen: RADV tai jรคrjestelmรคn Xclipse-ajuri + Jรคrjestelmรคn PowerVR + Kรคyttรครค tรคmรคn GPU:n omia ajureita + Jรคrjestelmรคn PowerVR-ajuri on valittu ajonajalle ja nรคytรถlle. + Mikรครคn avoin ajuri ei vielรค tue tรคtรค Mali-mallia: Mali-silta on kรคytรถssรค. + Tรคmรค on ei-Snapdragon-testiversio: viralliset versiot toimivat tรครคllรค vain Adreno-laitteilla, joten niitรค ei asenneta sen pรครคlle. Uudet testiversiot lรถytyvรคt osoitteesta github.com/The412Banner/droiddeck-nonadreno-drivers. + Edellinen istunto pรครคttyi, koska Android sulki DroidDeck-sovelluksen vapauttaakseen muistia; kyse ei ollut kaatumisesta. Sulje muut sovellukset tai alenna pelin tekstuuriasetuksia ja yritรค uudelleen. + Mali (Venus) + Mali-silta + Mikรครคn avoin ajuri ei vielรค tue tรคtรค Mali-mallia: %1$s on kรคytรถssรค puhelimen oman ajurin pรครคllรค. + %1$s ei ole vielรค julkaistu: %2$s on kรคytรถssรค julkaisuun asti. + %1$s ei ole saatavilla, ja tรคmรคn puhelimen ajuri ilmoittaa Vulkan-versioksi %2$s (Venus vaatii Vulkan 1.2:n): Mali-silta on kรคytรถssรค. + %1$s ei ole vielรค julkaistu: Mali-silta on kรคytรถssรค julkaisuun asti. + Jonossa: %1$s (odottaa eri ajuria ajonajalle) + DXVK tulee jรคrjestelmรคn PowerVR-ajonajalta. Muut DXVK-paketit voidaan tallentaa, mutta niitรค ei oteta kรคyttรถรถn tรคmรคn ajurin kanssa. Tuettu Kokeellinen: sen ajurit ovat testiversioita Kokeellinen Adreno 850 -tuki: vaatii yhteensopivat kokeelliset nรคyttรถ- ja peliajurit; ei vahvistettu tรคllรค laitteella Testatun laitteiston alapuolella (Adreno 725 ja uudemmat): ei vรคlttรคmรคttรค toimi Ei tuettu: tรคlle GPU:lle ei ole saatavilla yhteensopivaa grafiikkataustajรคrjestelmรครค + Toimii Mali-sillan kautta puhelimen omalla Vulkan-ajurilla + Ei tuettu, kun Mali-silta on pois pรครคltรค: Turnip toimii vain Adreno (Snapdragon) -grafiikkasuorittimella GitHubin kรคyttรถrajoitus tuli vastaan - yritรค myรถhemmin uudelleen GitHub vastasi HTTP %1$d @@ -2189,7 +2480,6 @@ Kaupat Steam Mukautettu - Kaupat Latausnopeuden taso Tasapainotettu Nopea @@ -2228,6 +2518,7 @@ Odotetaan toista Battle.net-lataustaโ€ฆ Avaa Battle.net ja kirjaudu sisรครคn kerran, asenna sitten sen pelit tรครคltรค. Blizzardin latausohjelma pysรคhtyi: %1$s + Blizzardin latausohjelma lakkasi etenemรคstรค. Blizzard-virhe %1$s Pรคivitรค Blizzardin pelit @@ -2235,6 +2526,7 @@ Keskeytynyt Asenna ยท %1$s Hanki ilmaiseksi + Lisรคtรครคn kirjastoonโ€ฆ Nรคytรค %1$s:ssรค Osta ยท %1$s Asennettu @@ -2281,6 +2573,12 @@ Jรคrjestรค Sivupalkin nimikkeet Nรคytรค nimet sivupalkin kuvakkeiden alla. Poista kรคytรถstรค kapeampaa sivupalkkia varten. + Agenttilemmikki + DeeDee leijuu kรคynnistimen ja pelien pรครคllรค ja nรคyttรครค, mitรค agentti tekee. + Muiden sovellusten pรครคllรค + Anna DeeDee:n leijua kaikkien sovellusten pรครคllรค ja avata keskustelunsa siellรค + Salli + Keskustele DeeDee:n kanssa Nรคkymรค Suuremmat kortit Pienemmรคt kortit @@ -2565,7 +2863,14 @@ %1$s ยท vaatii uudelleenkรคynnistyksen Tรคmรค laite Poistetaanko %1$s? - Diagnostiikka + Kehittรคjรค + Koontiversion vesileima + Nรคytรค testi- tai Lab-version tunniste nรคytรถllรค. Kรคytรถssรค oletusarvoisesti. + Jaa diagnostiikkapaketit + Istunto ja laite + Grafiikka + Pelit ja yhteensopivuus + Kaikki paketit Valmis pelattavaksi Ei vielรค valmis pelattavaksi ajoympรคristรถ %1$s @@ -2604,6 +2909,9 @@ Ota GOG-saavutukset kรคyttรถรถn kauppa-asetuksissa Saavutukset ei kรคytettรคvissรค; tarkista istunnon lokit Saavutus avattu + Mali (Venus): pois pรครคltรค + Mali (Venus): pรครคllรค + Laitteella %1$s kรคytรถssรค oleva ajuri ilmoittaa Vulkan-versioksi %2$s. Mali (Venus) vaatii Vulkan 1.2:n tai uudemman (gamescope ei kรคynnisty vanhemmilla versioilla), joten istunnot ohittavat Venus-vaihtoehdon ja kรคyttรคvรคt sen sijaan PanVK-ajuriparia. Liitรค Vasen tatti Oikea tatti @@ -2890,7 +3198,7 @@ Valitse kansioโ€ฆ Kรคytรค mitรค tahansa kansiota SD-kortilla tai USB-asemalla Pelit tallennetaan valitun sijainnin Games-kansioon. Nykyisiรค pelejรค ei siirretรค. - Mihin se menee + Mikรค vie tilaa Steam-pelit Pelidata Etuliitteet %1$s ยท workshop %2$s ยท shaderit %3$s @@ -2959,6 +3267,7 @@ Pelien tarvitsemat VC++- ja DirectX-asennukset Ajaa Linux x86 -pelejรค Steam-tyรถkalu + Steam lataa tรคmรคn peleille, joissa on huijauksenesto, vaikka se on pois pรครคltรค. Sen poistaminen jumittaa niiden asennuksen 0 %:iin. DroidDeck ajaa pelejรค ilman tรคtรค ajonaikaympรคristรถรค Proton x86, jota DroidDeck ei pysty ajamaan Oletus kaikille peleille @@ -3022,6 +3331,19 @@ Sรคilytetรครคn Muut kuin Steam-pelit ja jaettu Steam-etuliite Kauppojen kautta tai kรคsin lisรคttyjen pelien etuliitteet + Steamin jaettu etuliite + Steam suorittaa tรครคllรค omia Windows-apuohjelmiaan + Poistaa sen (%1$s). Steam luo uuden, kun tarvitsee sitรค seuraavan kerran. + Kauppasovellus ja pelit, jotka toimivat sen kanssa + Kรคyttรครค: %1$s + Muu kuin Steam-peli %1$s + Ei vastaa mitรครคn peliรค, joten se sรคilytetรครคn + Poista valitut ยท %1$s + Poista valittujen asennus ยท %1$s + Wine-prefixit + Niiden sisรคllรค olevat tallennukset ja asetukset menetetรครคn; Steam Cloud -tallennukset sรคilyvรคt tilillรคsi. + Shadervรคlimuistit + Etuliite %1$s ยท shaderit %2$s Ladatut paketit Sรคilytetyt alkuperรคiset Komponenttipaketteja ei ole ladattu. @@ -3056,6 +3378,8 @@ DroidDeck ยท %1$d fps 60 fps nรคyttรครค sulavammalta, mutta kuormittaa suoritinta enemmรคn Steamin kรคynnistyessรค. Steamin omista asetuksista valittu video nรคkyy myรถs tรครคllรค. ร„รคni + Ohita kรคynnistysvideo + Kรคytรค 0,1 sekunnin mustaa leikettรค Steam-kรคynnistysvideona. Otetaan kรคyttรถรถn seuraavassa istunnossa. Oma video MP4, MOV, MKV tai WebM. Muut muodot ja yli %1$d Mt:n tiedostot muunnetaan laitteella 720p-WebM-muotoon, enintรครคn %2$d sekuntia. Tuo @@ -3517,6 +3841,7 @@ Pitรครค Alt+Tabin, Win-nรคppรคimen ja Koti-painikkeen aktiivisessa DroidDeck-istunnossa Androidin sijaan. Ota Kirkkaus kรคyttรถรถn kohdassa Kรคyttรถรถnotto โ†’ Steam-integraatio Mali-silta: pois + %1$s ei voi kรคyttรครค Mali-siltaa (se vaatii Mali-GPU:n, jolla ei ole jรคrjestelmรคajurireittiรค), joten tรคllรค kytkimellรค ei ole vaikutusta tรคssรค. Mali-silta: pรครคllรค %1$s ei ole Adreno. Kokeellinen Vulkan-silta on pรครคllรค: istunto piirtรครค puhelimen oman ajurin kautta. Odota virheitรค; lรคhetรค istunnon lokit. Turvatila @@ -3542,6 +3867,25 @@ Siirrรค myรถhemmรคksi Widgetin asetukset Poista widget + Ulkoasu + Kuvakepaketti + Jรคrjestelmรคn oletus + Taustavรคri sovelluksesta + Kuvakekoko + Pieni + Keski + Suuri + Piilota sovellusten nimet + Vรคlit + Tiivis + Normaali + Vรคljรค + Vaihda kuvake + Palauta kuvake + Hae kuvakkeita + Ladataan kuvakkeitaโ€ฆ + Kuvakkeita ei lรถytynyt. + Mukautetut kuvakkeet Lisรครค kansioon Uusi kansio Poista kansiosta @@ -3657,5 +4001,81 @@ Tรคtรค asettelua ei voitu tuoda Helakanpunainen lumi + Valkoiset pinnat punaisin korostuksin. + Soundtrackit + Musiikki + Toistoasetukset + Suosikit + Kokoelmat + Ei vielรค kokoelmia. Luo sellainen napauttamalla kirjanmerkkikuvaketta. + Tallennettu + Luo kokoelma + Jรคrjestรค tallennuksesi + Uusi + Luo + Kokoelman nimi + Anna nimi, jota mikรครคn toinen kokoelma ei kรคytรค + Hallitse + Nimeรค uudelleen + Lisรครค kappaleita + Lisรครค (%1$d) + Poista kappaleita + Poista kokoelma + Poistetaanko %1$s? + Kappaleet sรคilyvรคt laitteellasi. Vain kokoelma poistetaan. + Valitse + Valitse kaikki + Poista kaikkien valinta + %1$d valittu + Lisรครค kokoelmaan + Lisรครค suosikkeihin + Poista kokoelmasta + Hae kappaleita + Albumin jรคrjestys + Pisin ensin + Lyhin ensin + Kappaleet + ร„รคnenkorkeus + Palauta + Ohita hiljaisuus + Uniajastin + %1$d min + Kappaleen loppu + %1$s jรคljellรค + Taajuuskorjain + Bassonkorostus + Taajuuskorjain ei ole kรคytettรคvissรค tรคllรค laitteella + Ota kรคyttรถรถn pelin aikana + Pidรค soundtrack soimassa pelin aikana + Soundtrackeja ei ole vielรค asennettu. + Hae soundtrackeja + Lisรครค soundtrack-kansio + Kansiossa ei ole รครคnitiedostoja + Kokonaiskesto + %1$d kappaletta / %2$s + Levy %1$s + Sekoita + Edellinen + Toista + Tauko + Seuraava + Toisto pois + Toista kaikki + Toista yksi + ร„รคnenvoimakkuus + Tรคssรค soundtrackissa ei ole รครคnitiedostoja + Kรคynnistรคminen ei ole mahdollista + Tรคmรคn linkin avaamiseen ei ole kรคytettรคvissรค verkkoselainta. + Tartu + Pudota + Tallenna + Pidรค palauttaaksesi + Kaupat + Kuvan aika + Keskimรครคrรคinen kuvataajuus + Nรคyttรถpalvelin + HDR-tila + Nรคkyvissรค + %1$d / %2$d diff --git a/app/src/main/res/values-fr/input_library.xml b/app/src/main/res/values-fr/input_library.xml new file mode 100644 index 0000000000..4e899b637f --- /dev/null +++ b/app/src/main/res/values-fr/input_library.xml @@ -0,0 +1,132 @@ + + + L\'รฉcran sรฉlectionnรฉ n\'est pas disponible. Connectez-le pour modifier cette disposition ร  sa taille rรฉelle. + Abandonner les modifications de disposition non enregistrรฉes ? + Cette disposition est utilisรฉe par %1$d profils. Les modifications enregistrรฉes s\'appliquent ร  tous. + Profils par dรฉfaut + Mode bureau + Mode jeu + Par dรฉfaut pour le bureau et le jeu + Par dรฉfaut pour le mode jeu + Par dรฉfaut pour le mode bureau + Rรฉglages de l\'appareil + Contrรดles + Boutons, sticks, gรขchettes et touches supplรฉmentaires + Copier le profil + Rรฉinitialiser les actions + Rรฉinitialiser les actions de %1$s sur les valeurs par dรฉfaut de son profil de base ? Les dispositions et les autres profils resteront inchangรฉs. + Supprimer %1$s ? Les modes qui l\'utilisent reviendront ร  leur profil par dรฉfaut intรฉgrรฉ. Les dispositions enregistrรฉes et les rรฉglages partagรฉs resteront disponibles. + Visibilitรฉ + S\'applique ร  tous les profils. Auto affiche les contrรดles de l\'รฉcran principal lorsqu\'aucune manette n\'est connectรฉe en mode jeu. + Modifier ร  l\'รฉcran + Dispositions enregistrรฉesโ€ฆ + Choisissez une disposition ou crรฉez la vรดtre + Choisissez Contrรดles du profil dans le menu de session de l\'รฉcran secondaire. Les sรฉlecteurs Profil et ร‰cran secondaire du menu de la manette choisissent les contrรดles ร  afficher. + Actions des boutons + Partagรฉ avec %1$s. Les modifications s\'appliquent aussi ร  ces profils. + Rรฉutiliser les rรฉglages + Utiliser les rรฉglages deโ€ฆ + Copier depuis un autre profil ou garder les rรฉglages partagรฉs + Rendre indรฉpendant + Conserver la configuration actuelle et cesser de partager les modifications + Les dispositions stockent les รฉlรฉments et leurs positions. Chaque profil peut assigner ses propres actions. Modifiez ร  taille rรฉelle sur l\'รฉcran cible. + Disposition actuelle + Supprimer la disposition inutilisรฉe %1$s et ses actions enregistrรฉes ? + Renommer la disposition actuelle + Les rรฉglages d\'entrรฉe illisibles ont รฉtรฉ conservรฉs dans une copie de rรฉcupรฉration. Vous pouvez continuer ร  modifier les profils restaurรฉs. + Propriรฉtรฉs + Propriรฉtรฉs du clic + %1$s ยท Clic + Boutons + Sticks, pavรฉs et gรขchettes + Masquer les outils + Manette + Envoie l\'entrรฉe de la manette ร  Steam Input ou au jeu. + Cet รฉlรฉment n\'envoie aucune entrรฉe de manette, de souris ou de clavier. + Clic de souris + Action DroidDeck + Action + Vitesse de dรฉfilement : %1$d crans/s + + Nouveau profil + + Nouvelle disposition + %1$s ยท Utilisรฉ par %2$d profils. Les modifications s\'appliquent ร  tous les profils utilisant ces affectations. + Renommer + Supprimer + Ajoutez des รฉlรฉments ร  la disposition avant d\'assigner leurs actions. + Impossible d\'enregistrer les rรฉglages d\'entrรฉe + Nom + Partir de + Bouton + Stick + Pavรฉ tactile + Croix directionnelle + Gรขchette + Terminรฉ + Annuler + + Ajouter + Faites glisser pour dรฉplacer. Faites glisser un coin pour redimensionner. Touchez Propriรฉtรฉs pour assigner une action. + Modification sur l\'รฉcran secondaire + Rรฉutiliser %1$s d\'un autre profil. Les autres sources de contrรดle resteront inchangรฉes. + Garder les contrรดles physiques partagรฉs + Par dรฉfaut, tous les contrรดles et dispositions personnalisรฉes sont des copies indรฉpendantes. Le partage ne lie que les contrรดles physiques. + Utiliser ces รฉlรฉments et positions. Le partage synchronise les futures modifications de gรฉomรฉtrie ; vos actions de bouton restent indรฉpendantes. Une autre disposition dรฉmarre avec des actions non assignรฉes. + Copier ces contrรดles et actions, ou les lier pour que les futures modifications s\'appliquent aux deux profils. + Garder partagรฉ + Copie indรฉpendante + Dรฉmarrer le stick au point de contact + Masquer le stick lorsqu\'il n\'est pas utilisรฉ + Outils + Auto (%1$s) + Personnalisรฉ (%1$s) + Enregistrer comme nouveau profil + Contrรดles du profil + Profil + Gestes du pavรฉ tactile de la souris + Si assignรฉ au pointeur de la souris : toucher pour cliquer, maintenir pour faire glisser, dรฉfiler avec deux doigts. + %1$s a une dรฉrogation de menu rapide. Sรฉlectionnez Auto pour utiliser son profil par dรฉfaut et ses trois parties enregistrรฉes. + Entrรฉe DroidDeck + Maintenu lorsque le stick est dรฉplacรฉ dans n\'importe quelle direction : appui au-dessus de 55 %, relรขchement sous 35 %. Utilisez Touches de direction pour assigner chaque direction sรฉparรฉment. Les commandes DroidDeck s\'exรฉcutent une fois par dรฉflexion. Le clic du stick se configure sรฉparรฉment. + Maintenu pendant le contact avec le pavรฉ tactile ; relรขchรฉ au lever du doigt. Les commandes DroidDeck s\'exรฉcutent une fois par contact. Le clic du pavรฉ se configure sรฉparรฉment. + Maintenu lorsque la gรขchette dรฉpasse 55 % ; relรขchรฉ sous 35 %. Les commandes DroidDeck s\'exรฉcutent une fois par pression. + Direction du dรฉfilement + Vertical + Horizontal + Dรฉfiler horizontalement + Mesures + Activez l\'enregistrement, utilisez les contrรดles dans une session en cours, puis revenez et lisez les rรฉsultats. Mesure uniquement le dรฉlai d\'envoi de DroidDeck, pas la latence d\'affichage. L\'enregistrement s\'arrรชte ร  la fermeture du processus de l\'app. + %1$d contrรดles + Autres dispositions enregistrรฉes (%1$d) โ–พ + Masquer les autres dispositions enregistrรฉes (%1$d) โ–ด + Accueil / Guide + Retour ยท appui simple + Retour ยท appui double + Retour ยท deux fois dans Steam, une fois sur le bureau + En mode Steam. Maintenir Retour ouvre aussi l\'accรจs rapide. + Rรฉtablir par dรฉfaut + Votre choix de panneau est mรฉmorisรฉ. Le bureau ouvre un second espace de travail ; il ne change ni la session ni son profil d\'entrรฉe. + Manette virtuelle + Le type de manette vu par Steam ou le jeu. + ร‰cran tactile + Comment les touchers sur l\'รฉcran du jeu sont gรฉrรฉs. Les boutons du profil gardent leurs actions assignรฉes. + Curseur tactile + Affiche un pointeur pour les touchers directs sur l\'รฉcran du jeu. + Toucher et maintenir + Action de la souris en maintenant un doigt sur l\'รฉcran du jeu. + Appuis du bouton Retour + Premiรจre action : appui simple. Deuxiรจme action : appui double. + Bouton ร  bascule + Touchez pour maintenir, touchez encore pour relรขcher. Ouvrir un menu ou changer de profil relรขche le bouton. + Forme + Arrondie + Pilule + Cercle + Rectangle + Libellรฉ du bouton + Texte + Image importรฉe + Touches diagonales sรฉparรฉes + Assignez une touche ร  chaque diagonale. Une diagonale vide presse ses deux directions voisines. + Directions voisines + Vos anciennes touches ร  l\'รฉcran sont enregistrรฉes comme profils importรฉs ci-dessous. Sรฉlectionnez-en un pour l\'utiliser ou le modifier. Vos sรฉlections de profil actuelles ont รฉtรฉ conservรฉes. + Les anciennes touches ร  l\'รฉcran n\'ont pas pu รชtre importรฉes automatiquement. Les rรฉglages d\'origine ont รฉtรฉ conservรฉs. + diff --git a/app/src/main/res/values-fr/input_strings.xml b/app/src/main/res/values-fr/input_strings.xml new file mode 100644 index 0000000000..eb2182ad4d --- /dev/null +++ b/app/src/main/res/values-fr/input_strings.xml @@ -0,0 +1,38 @@ + + + Profils d\'entrรฉe + Profils + Manette physique + ร‰cran principal + ร‰cran secondaire + Natif / Steam Input + Natif : %1$s + Envoyer une autre commande de manette + Dรฉsactivรฉ + Touche ou combinaison de touches + Touches directionnelles + Dรฉplacer le pointeur + Vitesse du pointeur : %1$d + Dรฉfiler + Dรฉfiler verticalement + Bouton gauche de la souris + Bouton droit de la souris + Bouton central de la souris + Ouvrir le menu DroidDeck + Afficher le clavier + Ouvrir le menu Steam + Ouvrir l\'accรจs rapide Steam + Supprimer le contrรดle + Ajouter un contrรดle + Boutons propres ร  l\'appareil + Assigner un bouton physique + Relรขchez le bouton, puis choisissez Modifier, Rรฉessayer ou Annuler. B ou Retour annule aprรจs le relรขchement. + Rรฉessayer + Appuyez sur un bouton, y compris un bouton Retour signalรฉ comme touche. Les touches de volume et du systรจme Android sont rรฉservรฉes. L\'assignation ne s\'applique qu\'ร  cet appareil. + Supprimer l\'assignation + Diagnostic des entrรฉes + Enregistrer le dรฉlai d\'envoi des entrรฉes + Lire les mesures + Mesure l\'envoi Android jusqu\'ร  sa publication dans le transport d\'entrรฉe existant. Cela exclut l\'arrivรฉe Bluetooth, l\'interrogation de l\'invitรฉ, le rendu et la latence d\'affichage. L\'enregistrement est dรฉsactivรฉ par dรฉfaut. + Utiliser l\'assignation d\'entrรฉe normale + diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 02c4953bfb..b2752c83c2 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -28,6 +28,8 @@ Mettre en pause maintenant Terminer cette session Gรฉnรฉration d\'images + Paramรจtres pour ce jeu + Paramรจtres par dรฉfaut Sรฉlectionnez le mode de gรฉnรฉration d\'images ร  utiliser Dรฉsactivรฉ DD-FG %1$dร— @@ -183,6 +185,7 @@ L\'environnement graphique PowerVR n\'a pas pu รชtre tรฉlรฉchargรฉ. Vรฉrifiez la connexion et rรฉessayez. Impossible de tรฉlรฉcharger DirectAudio ; l\'audio des jeux utilise le chemin plus lent pour cette session. Ce programme + La session n\'a pas pu dessiner ร  l\'รฉcran : %1$s. Cet รฉcran affiche la raison au lieu d\'un รฉcran noir ; les journaux de la session contiennent les dรฉtails. Impossible de tรฉlรฉcharger le client Steam. Votre rรฉseau ou votre VPN bloque peut-รชtre les serveurs de Steam ; vรฉrifiez la connexion et rรฉessayez. Impossible de configurer le client Steam. Vรฉrifiez la connexion et l\'espace libre, puis rรฉessayez. %1$s est conรงu pour les PC x86 et s\'exรฉcute via FEX, qui n\'est pas encore installรฉ. Lancez Steam une fois en รฉtant connectรฉ et laissez-le tรฉlรฉcharger FEX et le Steam Linux Runtime, puis relancez ce programme. @@ -386,6 +389,9 @@ Pas encore pris en charge ici Chargement des composantsโ€ฆ Installation impossible : %1$s + Ce tรฉlรฉchargement nรฉcessite une mise ร  jour. + Mise ร  jour en file d\'attente. + Rรฉessayer la mise ร  jour Tรฉlรฉchargรฉ Tรฉlรฉchargement de %1$s Installation : %1$s @@ -416,6 +422,22 @@ Stockage interne uniquement Dossier : %1$s Bibliothรจque secondaire + Autres bibliothรจques Steam + Dossiers oรน Steam peut installer des jeux et les lancer, chacun sous son propre nom. Le retirer conserve ses jeux sur le disque. + Ajouter une bibliothรจque + Renommer + Nom de la bibliothรจque + Choisir un dossier pour la bibliothรจque + %1$d bibliothรจques ajoutรฉes au maximum + Ce dossier est dรฉjร  utilisรฉ comme bibliothรจque ou se trouve dans une bibliothรจque existante + %1$s ยท indisponible + Prend effet ร  la prochaine session Steam + Trouvรฉ sur cet appareil ยท %1$s ยท %2$s + Ajouter + Rechercher des bibliothรจques sur le stockage interne + Autoriser l\'accรจs ร  tous les fichiers pour que DroidDeck puisse voir les bibliothรจques Steam que d\'autres applications conservent sur le stockage interne + Autoriser + Ajout de %1$s, la bibliothรจque Steam situรฉe dans le dossier choisi Les jeux lisant des ressources depuis une carte SD ou un stockage partagรฉ peuvent saccader. Diagnostic du stockage Enregistre les rรฉsultats d\'allocation et des mesures de temps du stockage dans ยซ Partager les journaux ยป. Peut ralentir les installations lorsqu\'il est activรฉ. Prendra effet ร  la prochaine session. @@ -480,6 +502,7 @@ Activรฉ Dรฉmarre avec Steam Dรฉmarre sans Steam + Rรฉsolution du jeu Paramรจtres Paramรจtres de %1$s Par dรฉfaut @@ -567,6 +590,8 @@ Cล“urs de jeu Cล“urs de jeu Cล“urs utilisรฉs par les jeux. Si tous sont sรฉlectionnรฉs, Android planifie librement. + ร‰conomiser l\'รฉnergie dans les jeux stables + Fait tourner un jeu sur les cล“urs plus lents tant qu\'il tient une frรฉquence d\'images stable, et le remet sur ses cล“urs habituels dรจs qu\'il prend du retard. Interface du client Multithread GL Peut rendre les menus Steam plus rรฉactifs. @@ -602,7 +627,10 @@ Dรฉsactive l\'assistant de navigation ร  la manette de Proton, qui consomme du CPU dans chaque jeu. Exรฉcuter proot sans seccomp Peut corriger certaines erreurs d\'appels systรจme manquants sur certains noyaux, mais peut rรฉduire les performances. + Exรฉcuter sans proot (expรฉrimental) + Dรฉmarre la partie Linux directement sur Android. Prend effet ร  la prochaine session. Dรฉsactivez cette option si un รฉlรฉment ne dรฉmarre pas. Chemin rapide proot + Non utilisรฉ sans proot. Nรฉcessite le filtre seccomp de proot. Recherche de fichiers plus rapide, moins de saccades. Dรฉsactivez cette option si un programme ne trouve pas ses fichiers. Dessiner le curseur dans gamescope @@ -685,6 +713,7 @@ Mรฉmoire graphique Mรฉmoire d\'รฉchange Niveau de batterie + Autonomie restante de la batterie Consommation Rรฉseau Rรฉsolution @@ -812,6 +841,7 @@ Appareil pris en charge GPU non testรฉ GPU non pris en charge + GPU via le pont Mali %1$s ยท %2$s %1$s : %2$s Aucun moteur graphique compatible nโ€™est disponible ; %1$s peut afficher un รฉcran noir. @@ -841,15 +871,38 @@ Session Journaux de session Enregistrรฉ aprรจs chaque fin de session + Diagnostics avancรฉs pour la prochaine session + Enregistre des journaux dรฉtaillรฉs pour une session. Peut rรฉduire les performances et utiliser plus de stockage. Se dรฉsactive au dรฉmarrage de la session ; consultez les journaux avant de les partager. Journaux de dรฉbogage des jeux Inclure les diagnostics Proton, Wine et graphiques au prochain lancement d\'un jeu. Peut rรฉduire les performances et utiliser plus de stockage. Redรฉmarrez cette session pour enregistrer les journaux de dรฉbogage des jeux Impossible de modifier la journalisation. Vรฉrifiez l\'interrupteur et rรฉessayez. Outils de dรฉbogage + Journaux graphiques dรฉtaillรฉs + Interface Steam : rendu GPU + Avec la paire de pilotes Xclipse, Steam dessine ses pages en logiciel : le rendu GPU produisait des tuiles corrompues. Activez cette option pour accรฉlรฉrer l\'interface Steam si l\'affichage est correct sur ce tรฉlรฉphone. + compilรฉ le %1$s + %1$s mis ร  jour vers la derniรจre version + La passerelle Mali a รฉchouรฉ ร  son auto-test sur %1$s lors de la derniรจre session (images ou appels de dessin). La session a donc utilisรฉ la paire de pilotes PanVK ร  la place. + La passerelle Mali n\'a trouvรฉ aucun moyen de partager la mรฉmoire avec le pilote sur %1$s lors de la derniรจre session. La session a donc utilisรฉ la paire de pilotes PanVK ร  la place. La passerelle ne peut pas fonctionner sur ce tรฉlรฉphone. La dรฉsactiver conserve la paire PanVK. + Les journaux Proton, DXVK et des pilotes de chaque jeu sont inclus dans les journaux de la session. Toujours activรฉ lorsque le GPU n\'est pas un Adreno. Derniers journaux de session Journaux de session enregistrรฉs Conserver les %1$d plus rรฉcents Effacer les journaux + Journaux de session disponibles + Aucun journal de session enregistrรฉ pour le moment. + Les fichiers ZIP partagรฉs et enregistrรฉs incluent la session sรฉlectionnรฉe ainsi que les diagnostics associรฉs de Steam, de la boutique, des outils et de Battle.net. + %1$s ยท %2$s + Session en cours + Partager + Enregistrer sur l\'appareil + Supprimer + Supprimer les journaux de session ? + Supprimer %1$s ? Cette action est irrรฉversible. + Journaux de session enregistrรฉs. + Impossible d\'enregistrer les journaux de session. + Impossible de supprimer les journaux de session. Rรฉinitialiser tous les paramรจtres Remet chaque paramรจtre ร  sa valeur par dรฉfaut Rรฉinitialiser @@ -876,6 +929,8 @@ Utiliser comme รฉcran d\'accueil DroidDeck peut รชtre utilisรฉ comme application d\'รฉcran d\'accueil DroidDeck ne sera pas proposรฉ comme application d\'รฉcran d\'accueil + Le bouton Accueil ouvre + La page affichรฉe lorsque DroidDeck est lโ€™application Accueil et que vous appuyez sur le bouton Accueil Dans Ajouter des jeux, rรฉglez DroidDeck sur Inclure Orientation Orientation du lanceur @@ -889,15 +944,22 @@ Plein รฉcran Masquer la barre d\'รฉtat et la barre de navigation Android Afficher la barre d\'รฉtat et la barre de navigation Android + Lanceur double รฉcran + Automatique place les sections du lanceur (Steam, Bibliothรจque, Boutiques et les autres) sur le second รฉcran intรฉgrรฉ des consoles portables qui en sont รฉquipรฉes. Activรฉ utilise n\'importe quel รฉcran secondaire. Dรฉsactivรฉ conserve le lanceur sur un seul รฉcran. + Sessions double รฉcran + Automatique ancre le menu en jeu sur le second รฉcran intรฉgrรฉ au lieu d\'un menu flottant. Activรฉ utilise n\'importe quel รฉcran secondaire. Dรฉsactivรฉ garde le menu sur l\'รฉcran du jeu. Vous pouvez toujours sรฉlectionner un second รฉcran depuis ce menu. Automatique Activรฉ Dรฉsactivรฉ Commandes sur l\'รฉcran du bas en jeu + Clavier Android pour les champs de texte Ouvre le pavรฉ tactile et le clavier sur le second รฉcran au dรฉmarrage d\'une session. Saisie pour l\'รฉcran du haut Terminรฉ Application d\'รฉcran d\'accueil par dรฉfaut Choisir l\'application d\'รฉcran d\'accueil + Masquer le lanceur des Applications rรฉcentes pendant lโ€™inactivitรฉ + Sโ€™applique uniquement lorsque DroidDeck est lโ€™application Accueil par dรฉfaut et quโ€™aucune session nโ€™est en cours. Choisir Applications Linux (bรชta) Fichiers @@ -1009,9 +1071,172 @@ Preview Derniers correctifs avant Stable ร€ jour + Copier les dรฉtails de la version + Dรฉtails de la version copiรฉs + En avance sur Preview + Vous avez une longueur d\'avance sur Preview + Cette version est plus rรฉcente que la derniรจre Preview. La prochaine version Preview la mettra ร  jour. + Choisissez une version pour voir ses changements ou l\'installer. + Installรฉe + Installer cette version%1$s + Revenir ร  cette version%1$s + versionCode %1$d + Commit %1$s + Page de la version + La PR a un commit plus rรฉcent (%1$s). Sa version de test n\'est pas encore prรชte, donc celle-ci ne l\'inclut pas. + Commit plus rรฉcent, version en attente + Numรฉro de PR, titre ou auteur + Aucune version de test ne correspond + ร€ recompiler (versionCode %1$d) + Mises ร  jour des versions de test + Nouvelle version de test de la PR #%1$d + %1$s. Ouvrez Mises ร  jour pour l\'installer. + Afficher plus (%1$d) + ร€ recompiler pour le versionCode %2$d (%1$d) + Versions Preview sur main depuis cette version de test : %1$d Versions de test Essayer un correctif avant sa publication officielle Aucun pour le moment + Version labo + Versions labo + En cours d\'utilisation + En pause aprรจs la rรฉoptimisation de DroidDeck par Android + Non chargรฉe : %1$s + En attente d\'un redรฉmarrage + Conservรฉe + Pour une autre version + Reconstruire + Supprime cette version de l\'appareil + Redรฉmarrer avec cette version + Dรฉsactiver + Utiliser + Supprimer + Supprimer maintenant + Impossible de prรฉparer le redรฉmarrage : %1$s. Associez le dรฉbogage sans fil dans la section Configuration, puis rรฉessayez. + Version labo installรฉe + DroidDeck a redรฉmarrรฉ sur %1$s + Version Lab en pause + Android a rรฉoptimisรฉ DroidDeck, %1$s n\'est donc pas chargรฉ. Ouvrez Mises ร  jour pour redรฉmarrer dessus. + Version Lab dรฉsactivรฉe + Elle a รฉtรฉ crรฉรฉe pour une autre version de DroidDeck. Elle est conservรฉe dans Mises ร  jour. + DroidDeck n\'a pas dรฉmarrรฉ dessus ร  deux reprises + Agent + Agent + L\'agent travaille + Installez Claude Code dans l\'environnement utilisateur Linux pour utiliser l\'agent. + Posez une question sur un jeu, un plantage ou une modification de DroidDeck + Envoyer + Nouvelle conversation + Arrรชter + Stockage + Supprimer + Supprimer maintenant + Claude Code + Codex + Code source de DroidDeck + Caches de tรฉlรฉchargement + Les modifications non envoyรฉes sont perdues + Les builds les retรฉlรฉchargent + La configuration peut le rรฉinstaller ; les connexions sont conservรฉes + DroidDeck a redรฉmarrรฉ sur votre version Lab. Reprenez lร  oรน vous en รฉtiez. + Demandez-lui de trouver pourquoi un jeu ne dรฉmarre pas, d\'expliquer un journal ou de modifier DroidDeck et de tester la modification sur cet appareil. + ร‰chec : %1$s + %1$s s\'est terminรฉ (code %2$d) + Arrรชtรฉ + Terminรฉ sans rรฉponse + Rรฉessayer + Configuration de l\'agent + Reconstruisez ma version Lab %1$s pour la version installรฉe de DroidDeck et redรฉmarrez dessus. + %1$s en entrรฉe ยท %2$s en sortie + Rรฉflexion en cours + Rรฉflexion + Rรฉflexion en cours ยท %1$s + %1$s ยท %2$s + ENTRร‰E + SORTIE + En coursโ€ฆ + Aucun rรฉsultat : le tour a pris fin avant + Aucune sortie + Tapez pour mettre le prochain message en attente + Mettre en attente + Suivant : %1$s + Ne pas envoyer + Joindre + Supprimer + Par dรฉfaut + Effort de raisonnement + Exรฉcuter + Rรฉviser + Rien nโ€™a encore changรฉ + Exรฉcute le plan. + Envoyer maintenant + Plus + Fermer + Dernier + En cours + Contexte + %1$s sur %2$s + Cette conversation ยท %1$s + Lโ€™utilisation sโ€™affiche aprรจs la premiรจre rรฉponse + Limite de %1$d heures + Limite de %1$d minutes + Limite hebdomadaire + %1$d%% ยท se rรฉinitialise %2$s + + %1$d fichier + %1$d fichiers + + Planifier d\'abord + Plan + Propose un plan sans rien modifier + Conversations + Aucune conversation pour l\'instant + ร€ l\'instant + Supprimer + Supprime la conversation et ses piรจces jointes + Processus + Rien ne s\'exรฉcute dans l\'espace utilisateur Linux + AGENT + Arrรชter + Compilation Lab + Prรฉparation des compilations Lab + %1$d%% ยท il reste environ %2$s + il reste environ %1$s + Annuler + Annuler la compilation + Dรฉmarrage + %1$d%% + Empaquetage + Redรฉmarrage de DroidDeck sur celui-ci + Terminรฉ + ร‰chec : %1$s + Configurer l\'agent + Installez d\'abord l\'environnement d\'exรฉcution Linux dans Configuration. + Rรฉessayer + Commencer ร  discuter + Connexion ร  l\'appareil + Dรฉbogage sans fil, pour que l\'agent puisse voir et piloter DroidDeck + Installer %1$s + Dans l\'espace utilisateur Linux, avec git, gh et adb + Se connecter ร  %1$s + Ouvre votre navigateur + GitHub + Facultatif, pour ouvrir des pull requests + Outils de compilation + Facultatif, pour les compilations Lab sur cet appareil ยท environ 5 Go + Agent prรชt + Terminez la configuration de l\'agent + Connectรฉ ร  %1$s + Compilations Lab + compilations rapides + Compilations Lab rapides + Compile cette version ร  l\'avance, pour que les compilations Lab ne prennent que quelques minutes ยท environ 20 minutes, une seule fois + Compilation en cours ยท %1$d%% ยท il reste environ %2$s + Prรฉparer + Le dรฉbogage sans fil n\'est pas accessible ; ยซ Associer ยป l\'active + Associer + Installer + Se connecter PR #%1$d Non compilรฉ pour cette copie de DroidDeck %1$s mis ร  jour @@ -1255,6 +1480,9 @@ Applications Configuration Mises ร  jour + Plus + Modifier les onglets + Onglets %1$d%% Reprendre %1$s Affichรฉ comme /root/ROMs dans chaque session. Le stockage interne se trouve dans /root/Storage. @@ -1276,6 +1504,15 @@ Annuler la file d\'attente Clavier Android Masquer โœ• + Taille ร  l\'รฉcran + Part de l\'รฉcran occupรฉe par le clavier, y compris l\'en-tรชte. + Opacitรฉ + Rรฉduisez-la pour voir le jeu derriรจre le clavier. + Touches masquรฉes + Les touches que vous utilisez rarement ne s\'affichent pas sur le clavier. + ร‰chap et rangรฉe des touches de fonction + Ins / Suppr / Dรฉbut / Fin / PgPrรฉc / PgSuiv + Touches flรฉchรฉes Lancer %1$s Choisir l\'รฉcran. ร‰cran secondaire : %1$s. L\'รฉcran secondaire n\'est plus disponible. @@ -1794,7 +2031,24 @@ Terminal Poignรฉes Deck + pavรฉs tactiles Tableau de bord + Bureau + Dรฉmarrer le bureau + Bureau ยท %1$s + Pavรฉ tactile + Tactile direct + Pavรฉ tactile. Touchez pour passer en tactile direct + Tactile direct. Touchez pour passer au pavรฉ tactile + Dรฉmarrage du bureau KDEโ€ฆ + Le bureau vient de se fermer. + Impossible de dรฉmarrer le bureau. Ses journaux se trouvent dans le dossier bottom-desktop de cette session. + Le bureau est fermรฉ. Rien ร  afficher pour l\'instant. + Permuter les รฉcrans + ร‰cran du bas occupรฉ pour le moment + ร‰cran du jeu + Afficher le jeu sur + ร‰cran du haut + ร‰cran du bas Tรฉlรฉchargements Aucun tรฉlรฉchargement en cours. Steam @@ -1829,6 +2083,20 @@ Carburant, t Principal %1$s t Rรฉserve %1$s t + Temps par image + %1$d derniรจres s + image moyenne + 1 % les plus bas + images de plus de 33 ms + %1$d / min + En jeu depuis %1$s + %1$d cล“urs, %2$s GHz au maximum + %1$d cล“urs + jeu + FPS de %1$d Hz + Le repรจre rouge indique oรน le HUD affiche la tempรฉrature en rouge. + appareil entier + batterie Envoyer les donnรฉes du tableau de bord Automatique L\'active pour chaque jeu listรฉ ici, y compris les jeux trouvรฉs plus tard. Les jeux que vous dรฉsactivez restent dรฉsactivรฉs. @@ -1852,6 +2120,10 @@ Le micro est dรฉsactivรฉ pour ce jeu. Pour parler, activez Microphone dans les paramรจtres Steam de DroidDeck (Audio), puis relancez le jeu. Volume %1$d %% Statistiques en jeu + HUD de l\'รฉcran du bas + Bande sur tous les onglets + 1 % et 0,1 % les plus bas + Tempรฉrature du CPU FPS CPU GPU @@ -2025,6 +2297,7 @@ Dรฉmarrage de la sessionโ€ฆ %1$d:%2$02d รฉcoulรฉes ยท toujours en cours Tรฉlรฉchargement de la mise ร  jour du client Steam ยท %1$d%% + Application de la mise ร  jour du client Steamโ€ฆ Tรฉlรฉchargement du client Steam ยท %1$s Une installation d\'outil de compatibilitรฉ est dรฉjร  en cours @@ -2101,11 +2374,29 @@ Contours faรงon dessin animรฉ et nettetรฉ accrue. GPU non Adreno + Pilote systรจme PowerVR : la compatibilitรฉ varie selon chaque appareil + Expรฉrimental : RADV ou le pilote systรจme Xclipse + PowerVR systรจme + Utilise les pilotes intรฉgrรฉs de ce GPU + Le pilote PowerVR du systรจme est sรฉlectionnรฉ pour le runtime et l\'affichage. + Aucun pilote libre ne prend encore en charge ce Mali : le pont Mali est activรฉ. + Ceci est la version de test non-Snapdragon : les versions officielles disponibles ici ne fonctionnent que sur Adreno, elles ne sont donc pas installรฉes par-dessus celle-ci. Les nouvelles versions de test se trouvent sur github.com/The412Banner/droiddeck-nonadreno-drivers. + La derniรจre session s\'est terminรฉe parce qu\'Android a fermรฉ DroidDeck pour libรฉrer de la mรฉmoire, et non ร  cause d\'un plantage. Fermez les autres applications ou rรฉduisez les paramรจtres de texture du jeu, puis rรฉessayez. + Mali (Venus) + le pont Mali + Aucun pilote libre ne prend encore en charge ce Mali : %1$s est utilisรฉ, sur le pilote du tรฉlรฉphone. + %1$s n\'est pas encore publiรฉ : %2$s est utilisรฉ en attendant. + %1$s n\'est pas disponible, et le pilote de ce tรฉlรฉphone indique Vulkan %2$s (Venus nรฉcessite 1.2) : le pont Mali est utilisรฉ. + %1$s n\'est pas encore publiรฉ : le pont Mali reste activรฉ en attendant. + En file d\'attente : %1$s (en attente d\'un pilote de runtime diffรฉrent) + DXVK est fourni par le runtime PowerVR du systรจme. Les autres paquets DXVK peuvent รชtre stockรฉs mais ne sont pas appliquรฉs avec ce pilote. Pris en charge Expรฉrimental : ses pilotes sont des versions de test Prise en charge expรฉrimentale de l\'Adreno 850 : nรฉcessite des pilotes d\'affichage et de jeu expรฉrimentaux compatibles ; non vรฉrifiรฉe sur cet appareil En dessous du matรฉriel testรฉ (Adreno 725 et plus rรฉcent) : risque de ne pas fonctionner Non pris en charge : aucun moteur graphique compatible nโ€™est disponible pour ce GPU + Passe par le pont Mali, sur le pilote Vulkan du tรฉlรฉphone + Non pris en charge lorsque le pont Mali est dรฉsactivรฉ : Turnip nรฉcessite un GPU Adreno (Snapdragon) Limite de requรชtes GitHub atteinte - rรฉessayez plus tard GitHub a rรฉpondu HTTP %1$d @@ -2214,7 +2505,6 @@ Boutiques Steam Personnalisรฉ - Boutiques Niveau de vitesse de tรฉlรฉchargement ร‰quilibrรฉ Rapide @@ -2253,6 +2543,7 @@ En attente de l\'autre tรฉlรฉchargement Battle.netโ€ฆ Ouvrez Battle.net et connectez-vous une fois, puis installez ses jeux ici. Le tรฉlรฉchargeur de Blizzard s\'est arrรชtรฉ : %1$s + Le tรฉlรฉchargeur de Blizzard n\'avance plus. Erreur Blizzard %1$s Mettre ร  jour Jeux Blizzard @@ -2260,6 +2551,7 @@ Interrompu Installer ยท %1$s Obtenir gratuitement + Ajout ร  la bibliothรจqueโ€ฆ Voir sur %1$s Acheter ยท %1$s Installรฉ @@ -2306,6 +2598,12 @@ Trier Libellรฉs de la barre latรฉrale Afficher les noms sous les icรดnes de la barre latรฉrale. Dรฉsactivez pour une barre latรฉrale plus fine. + Compagnon de lโ€™agent + DeeDee flotte au-dessus du lanceur et des jeux et montre ce que fait lโ€™agent. + Au-dessus des autres applications + Autorise DeeDee ร  flotter au-dessus de toutes les applications et ร  y ouvrir sa discussion + Autoriser + Discuter avec DeeDee Affichage Cartes plus grandes Cartes plus petites @@ -2589,7 +2887,14 @@ %1$s ยท redรฉmarrage en attente Cet appareil Supprimer %1$s ? - Diagnostic + Dรฉveloppeur + Filigrane de version + Afficher le libellรฉ de la version de test ou Lab ร  lโ€™รฉcran. Activรฉ par dรฉfaut. + Partager les lots de diagnostics + Session et appareil + Graphiques + Jeux et compatibilitรฉ + Tous les lots Prรชt ร  jouer Pas encore prรชt ร  jouer environnement d\'exรฉcution %1$s @@ -2628,6 +2933,9 @@ Activez les succรจs GOG dans les paramรจtres des boutiques Succรจs indisponibles ; consultez les journaux de session Succรจs dรฉbloquรฉ + Mali (Venus) : dรฉsactivรฉ + Mali (Venus) : activรฉ + Le pilote de %1$s indique Vulkan %2$s. Mali (Venus) nรฉcessite Vulkan 1.2 ou une version plus rรฉcente (gamescope ne dรฉmarre pas sur les versions plus anciennes) ; les sessions ignorent donc Venus et utilisent ร  la place la paire de pilotes PanVK. Coller Stick gauche Stick droit @@ -2919,7 +3227,7 @@ Choisir un dossierโ€ฆ Utiliser n\'importe quel dossier sur une carte SD ou une clรฉ USB Les jeux sont placรฉs dans un dossier Games ร  l\'emplacement sรฉlectionnรฉ. Les jeux existants ne sont pas dรฉplacรฉs. - Oรน รงa va + Ce qui prend de la place Jeux Steam Donnรฉes de jeu Prรฉfixes %1$s ยท atelier %2$s ยท shaders %3$s @@ -2988,6 +3296,7 @@ Programmes d\'installation VC++ et DirectX demandรฉs par les jeux Exรฉcute les jeux Linux x86 Outil Steam + Steam tรฉlรฉcharge cet outil pour les jeux livrรฉs avec un anti-triche, mรชme lorsque celui-ci est dรฉsactivรฉ. Le supprimer bloque leur installation ร  0 %. DroidDeck exรฉcute les jeux sans cet environnement d\'exรฉcution Proton x86, que DroidDeck ne peut pas exรฉcuter Par dรฉfaut pour tous les jeux @@ -3058,6 +3367,19 @@ Conservรฉs Jeux hors Steam et prรฉfixe partagรฉ de Steam Prรฉfixes de jeux ajoutรฉs depuis les boutiques ou ร  la main + Prรฉfixe partagรฉ de Steam + Steam y exรฉcute ses propres utilitaires Windows + Le supprime (%1$s). Steam en crรฉe un nouveau la prochaine fois qu\'il en a besoin. + Une app de boutique et les jeux qui tournent avec elle + Utilisรฉ par %1$s + Jeu hors Steam %1$s + Associรฉ ร  aucun jeu, il est donc conservรฉ + Supprimer la sรฉlection ยท %1$s + Dรฉsinstaller la sรฉlection ยท %1$s + Prรฉfixes Wine + Les sauvegardes et paramรจtres qu\'ils contiennent sont perdus ; les sauvegardes Steam Cloud restent dans votre compte. + Caches de shaders + Prรฉfixe %1$s ยท shaders %2$s Paquets tรฉlรฉchargรฉs Originaux conservรฉs Aucun paquet de composant tรฉlรฉchargรฉ. @@ -3094,6 +3416,8 @@ DroidDeck ยท %1$d i/s 60 i/s est plus fluide mais sollicite davantage le processeur pendant le dรฉmarrage de Steam. Une vidรฉo choisie dans les paramรจtres de Steam apparaรฎt aussi ici. Son + Ignorer la vidรฉo de dรฉmarrage + Utilise un clip noir de 0,1 seconde comme vidรฉo de dรฉmarrage de Steam. Sโ€™applique ร  la prochaine session. Votre propre vidรฉo MP4, MOV, MKV ou WebM. Les autres formats et les fichiers de plus de %1$d Mo sont convertis en WebM 720p sur l\'appareil, jusqu\'ร  %2$d secondes. Importer @@ -3555,6 +3879,7 @@ Garde Alt+Tab, la touche Win et le bouton Accueil dans une session DroidDeck active plutรดt que dans Android. Activez Luminositรฉ dans Paramรจtres โ†’ Intรฉgration Steam Pont Mali : dรฉsactivรฉ + %1$s ne peut pas utiliser le pont Mali (il faut un GPU Mali sans route de pilote systรจme) ; ce commutateur n\'a donc aucun effet ici. Pont Mali : activรฉ %1$s n\'est pas un Adreno. Le pont Vulkan expรฉrimental est activรฉ : la session dessine via le pilote du tรฉlรฉphone lui-mรชme. Attendez-vous ร  des bugs ; envoyez les journaux de session. Mode sans รฉchec @@ -3580,6 +3905,25 @@ Reculer Paramรจtres du widget Retirer le widget + Apparence + Pack d\'icรดnes + Par dรฉfaut du systรจme + Fond couleur de l\'appli + Taille des icรดnes + Petite + Moyenne + Grande + Masquer les noms des applications + Espacement + Serrรฉ + Normal + Aรฉrรฉ + Changer l\'icรดne + Rรฉinitialiser l\'icรดne + Rechercher des icรดnes + Chargement des icรดnesโ€ฆ + Aucune icรดne trouvรฉe. + Icรดnes personnalisรฉes Ajouter ร  un dossier Nouveau dossier Retirer du dossier @@ -3696,5 +4040,81 @@ Impossible dโ€™importer cette disposition Neige รฉcarlate + Surfaces blanches avec des accents rouges. + Bandes originales + Musique + Options de lecture + Favoris + Collections + Aucune collection pour le moment. Touchez l\'icรดne de favori pour en crรฉer une. + Enregistrรฉs + Crรฉer une collection + Organisez vos titres enregistrรฉs + Nouvelle + Crรฉer + Nom de la collection + Saisissez un nom qu\'aucune autre collection n\'utilise + Gรฉrer + Renommer + Ajouter des morceaux + Ajouter (%1$d) + Retirer des morceaux + Supprimer la collection + Supprimer %1$s ? + Les morceaux restent sur votre appareil. Seule la collection est supprimรฉe. + Sรฉlectionner + Tout sรฉlectionner + Tout dรฉsรฉlectionner + %1$d sรฉlectionnรฉ(s) + Ajouter ร  une collection + Ajouter aux favoris + Retirer de la collection + Rechercher des morceaux + Ordre de l\'album + Plus longs d\'abord + Plus courts d\'abord + Morceaux + Hauteur + Rรฉinitialiser + Ignorer les silences + Minuteur de veille + %1$d min + Fin du morceau + %1$s restantes + ร‰galiseur + Renforcement des basses + L\'รฉgaliseur n\'est pas disponible sur cet appareil + Activer en jeu + Garder la bande originale active pendant une partie + Aucune bande originale installรฉe pour le moment. + Rechercher des bandes originales + Ajouter un dossier de bande originale + Aucun fichier audio dans ce dossier + Durรฉe totale + %1$d pistes / %2$s + Disque %1$s + Alรฉatoire + Prรฉcรฉdent + Lecture + Pause + Suivant + Rรฉpรฉtition dรฉsactivรฉe + Tout rรฉpรฉter + Rรฉpรฉter une piste + Volume + Aucun fichier audio dans cette bande originale + Lancement indisponible + Aucun navigateur Web nโ€™est disponible pour ouvrir ce lien. + Saisir + Dรฉposer + Enregistrer + Maintenir pour rรฉinitialiser + Boutiques + Temps de frame + Frequence moyenne des images + Serveur graphique + ร‰tat HDR + Affichรฉs + %1$d sur %2$d diff --git a/app/src/main/res/values-hi/input_library.xml b/app/src/main/res/values-hi/input_library.xml new file mode 100644 index 0000000000..81147024d8 --- /dev/null +++ b/app/src/main/res/values-hi/input_library.xml @@ -0,0 +1,132 @@ + + + เค…-เคชเค เคจเฅ€เคฏ เค‡เคจเคชเฅเคŸ เคธเฅ‡เคŸเคฟเค‚เค—เฅเคธ เค•เฅ‹ เคฐเคฟเค•เคตเคฐเฅ€ เคชเฅเคฐเคคเคฟ เคฎเฅ‡เค‚ เคธเฅเคฐเค•เฅเคทเคฟเคค เคฐเค–เคพ เค—เคฏเคพเฅค เค†เคช เคฌเคนเคพเคฒ เค•เคฟเค เค—เค เคชเฅเคฐเฅ‹เคซเคผเคพเค‡เคฒ เค•เฅ‹ เคธเค‚เคชเคพเคฆเคฟเคค เค•เคฐเคจเคพ เคœเคพเคฐเฅ€ เคฐเค– เคธเค•เคคเฅ‡ เคนเฅˆเค‚เฅค + เค—เฅเคฃ + เค•เฅเคฒเคฟเค• เค—เฅเคฃ + %1$s ยท เค•เฅเคฒเคฟเค• + เคฌเคŸเคจ + เคธเฅเคŸเคฟเค•, เคชเฅˆเคก เค”เคฐ เคŸเฅเคฐเคฟเค—เคฐ + เคŸเฅ‚เคฒ เค›เคฟเคชเคพเคเค + เค•เค‚เคŸเฅเคฐเฅ‹เคฒเคฐ + เค•เค‚เคŸเฅเคฐเฅ‹เคฒเคฐ เค‡เคจเคชเฅเคŸ Steam Input เคฏเคพ เค—เฅ‡เคฎ เค•เฅ‹ เคญเฅ‡เคœเฅ‡เค‚เฅค + เคฏเคน เคคเคคเฅเคต เค•เค‚เคŸเฅเคฐเฅ‹เคฒเคฐ, เคฎเคพเค‰เคธ เคฏเคพ เค•เฅ€เคฌเฅ‹เคฐเฅเคก เค‡เคจเคชเฅเคŸ เคจเคนเฅ€เค‚ เคญเฅ‡เคœเคคเคพเฅค + เคฎเคพเค‰เคธ เค•เฅเคฒเคฟเค• + DroidDeck เค•เฅเคฐเคฟเคฏเคพ + เค•เฅเคฐเคฟเคฏเคพ + เคธเฅเค•เฅเคฐเฅ‰เคฒ เค—เคคเคฟ: %1$d เคšเคฐเคฃ/เคธเฅ‡ + + เคจเคฏเคพ เคชเฅเคฐเฅ‹เคซเคผเคพเค‡เคฒ + + เคจเคฏเคพ เคฒเฅ‡เค†เค‰เคŸ + %1$s ยท %2$d เคชเฅเคฐเฅ‹เคซเคผเคพเค‡เคฒ เคฆเฅเคตเคพเคฐเคพ เค‰เคชเคฏเฅ‹เค—เฅค เคฌเคฆเคฒเคพเคต เค‡เคจ เคฌเคพเค‡เค‚เคกเคฟเค‚เค— เค•เคพ เค‰เคชเคฏเฅ‹เค— เค•เคฐเคจเฅ‡ เคตเคพเคฒเฅ‡ เคนเคฐ เคชเฅเคฐเฅ‹เคซเคผเคพเค‡เคฒ เคชเคฐ เคฒเคพเค—เฅ‚ เคนเฅ‹เคคเฅ‡ เคนเฅˆเค‚เฅค + เคจเคพเคฎ เคฌเคฆเคฒเฅ‡เค‚ + เคนเคŸเคพเคเค + เค•เฅเคฐเคฟเคฏเคพเคเค เค…เคธเคพเค‡เคจ เค•เคฐเคจเฅ‡ เคธเฅ‡ เคชเคนเคฒเฅ‡ เคฒเฅ‡เค†เค‰เคŸ เคฎเฅ‡เค‚ เคคเคคเฅเคต เคœเฅ‹เคกเคผเฅ‡เค‚เฅค + เค‡เคจเคชเฅเคŸ เคธเฅ‡เคŸเคฟเค‚เค—เฅเคธ เคธเคนเฅ‡เคœเฅ€ เคจเคนเฅ€เค‚ เคœเคพ เคธเค•เฅ€เค‚ + เคจเคพเคฎ + เคธเฅ‡ เคถเฅเคฐเฅ‚ เค•เคฐเฅ‡เค‚ + เคฌเคŸเคจ + เคธเฅเคŸเคฟเค• + เคŸเคšเคชเฅˆเคก + เคกเฅ€-เคชเฅˆเคก + เคŸเฅเคฐเคฟเค—เคฐ + เคนเฅ‹ เค—เคฏเคพ + เคชเฅ‚เคฐเฅเคตเคตเคค เค•เคฐเฅ‡เค‚ + + เคœเฅ‹เคกเคผเฅ‡เค‚ + เค–เฅ€เค‚เคšเค•เคฐ เคฒเฅ‡ เคœเคพเคเคเฅค เค•เฅ‹เคจเฅ‡ เคธเฅ‡ เค–เฅ€เค‚เคšเค•เคฐ เค†เค•เคพเคฐ เคฌเคฆเคฒเฅ‡เค‚เฅค เค•เฅเคฐเคฟเคฏเคพ เค…เคธเคพเค‡เคจ เค•เคฐเคจเฅ‡ เค•เฅ‡ เคฒเคฟเค เค—เฅเคฃ เคชเคฐ เคŸเฅˆเคช เค•เคฐเฅ‡เค‚เฅค + เคฆเฅ‚เคธเคฐเฅ€ เคธเฅเค•เฅเคฐเฅ€เคจ เคชเคฐ เคธเค‚เคชเคพเคฆเคจ + เคšเคฏเคจเคฟเคค เคกเคฟเคธเฅเคชเฅเคฒเฅ‡ เค‰เคชเคฒเคฌเฅเคง เคจเคนเฅ€เค‚ เคนเฅˆเฅค เค‡เคธ เคฒเฅ‡เค†เค‰เคŸ เค•เฅ‹ เค‰เคธเค•เฅ‡ เคตเคพเคธเฅเคคเคตเคฟเค• เค†เค•เคพเคฐ เคฎเฅ‡เค‚ เคธเค‚เคชเคพเคฆเคฟเคค เค•เคฐเคจเฅ‡ เค•เฅ‡ เคฒเคฟเค เค‡เคธเฅ‡ เค•เคจเฅ‡เค•เฅเคŸ เค•เคฐเฅ‡เค‚เฅค + เคธเคนเฅ‡เคœเฅ‡ เคจ เค—เค เคฒเฅ‡เค†เค‰เคŸ เคฌเคฆเคฒเคพเคต เค›เฅ‹เคกเคผเฅ‡เค‚? + เคฏเคน เคฒเฅ‡เค†เค‰เคŸ %1$d เคชเฅเคฐเฅ‹เคซเคผเคพเค‡เคฒ เคฆเฅเคตเคพเคฐเคพ เค‰เคชเคฏเฅ‹เค— เค•เคฟเคฏเคพ เคœเคพเคคเคพ เคนเฅˆเฅค เคธเคนเฅ‡เคœเฅ‡ เค—เค เคฌเคฆเคฒเคพเคต เคธเคญเฅ€ เคชเคฐ เคฒเคพเค—เฅ‚ เคนเฅ‹เคคเฅ‡ เคนเฅˆเค‚เฅค + เคกเคฟเคซเคผเฅ‰เคฒเฅเคŸ เคชเฅเคฐเฅ‹เคซเคผเคพเค‡เคฒ + เคกเฅ‡เคธเฅเค•เคŸเฅ‰เคช เคฎเฅ‹เคก + เค—เฅ‡เคฎ เคฎเฅ‹เคก + เคกเฅ‡เคธเฅเค•เคŸเฅ‰เคช เค”เคฐ เค—เฅ‡เคฎ เค•เฅ‡ เคฒเคฟเค เคกเคฟเคซเคผเฅ‰เคฒเฅเคŸ + เค—เฅ‡เคฎ เคฎเฅ‹เคก เค•เฅ‡ เคฒเคฟเค เคกเคฟเคซเคผเฅ‰เคฒเฅเคŸ + เคกเฅ‡เคธเฅเค•เคŸเฅ‰เคช เคฎเฅ‹เคก เค•เฅ‡ เคฒเคฟเค เคกเคฟเคซเคผเฅ‰เคฒเฅเคŸ + เคกเคฟเคตเคพเค‡เคธ เคธเฅ‡เคŸเคฟเค‚เค—เฅเคธ + เคจเคฟเคฏเค‚เคคเฅเคฐเคฃ + เคฌเคŸเคจ, เคธเฅเคŸเคฟเค•, เคŸเฅเคฐเคฟเค—เคฐ เค”เคฐ เค…เคคเคฟเคฐเคฟเค•เฅเคค เค•เฅเค‚เคœเคฟเคฏเคพเค + เคชเฅเคฐเฅ‹เคซเคผเคพเค‡เคฒ เค•เฅ‰เคชเฅ€ เค•เคฐเฅ‡เค‚ + เค•เฅเคฐเคฟเคฏเคพเคเค เคฐเฅ€เคธเฅ‡เคŸ เค•เคฐเฅ‡เค‚ + %1$s เคฎเฅ‡เค‚ เค•เฅเคฐเคฟเคฏเคพเค“เค‚ เค•เฅ‹ เค‰เคธเค•เฅ‡ เค†เคงเคพเคฐ เคชเฅเคฐเฅ‹เคซเคผเคพเค‡เคฒ เคกเคฟเคซเคผเฅ‰เคฒเฅเคŸ เคชเคฐ เคฐเฅ€เคธเฅ‡เคŸ เค•เคฐเฅ‡เค‚? เคฒเฅ‡เค†เค‰เคŸ เค”เคฐ เค…เคจเฅเคฏ เคชเฅเคฐเฅ‹เคซเคผเคพเค‡เคฒ เค…เคชเคฐเคฟเคตเคฐเฅเคคเคฟเคค เคฐเคนเฅ‡เค‚เค—เฅ‡เฅค + %1$s เคนเคŸเคพเคเค? เค‡เคธเค•เคพ เค‰เคชเคฏเฅ‹เค— เค•เคฐเคจเฅ‡ เคตเคพเคฒเฅ‡ เคฎเฅ‹เคก เค…เคชเคจเฅ‡ เค…เค‚เคคเคฐเฅเคจเคฟเคนเคฟเคค เคกเคฟเคซเคผเฅ‰เคฒเฅเคŸ เคชเฅเคฐเฅ‹เคซเคผเคพเค‡เคฒ เคชเคฐ เคฒเฅŒเคŸเฅ‡เค‚เค—เฅ‡เฅค เคธเคนเฅ‡เคœเฅ‡ เค—เค เคฒเฅ‡เค†เค‰เคŸ เค”เคฐ เคธเคพเคเคพ เคธเฅ‡เคŸเคฟเค‚เค—เฅเคธ เค‰เคชเคฒเคฌเฅเคง เคฐเคนเฅ‡เค‚เค—เฅ€เฅค + เคฆเฅƒเคถเฅเคฏเคคเคพ + เคธเคญเฅ€ เคชเฅเคฐเฅ‹เคซเคผเคพเค‡เคฒ เคชเคฐ เคฒเคพเค—เฅ‚เฅค เค—เฅ‡เคฎ เคฎเฅ‹เคก เคฎเฅ‡เค‚ เค•เค‚เคŸเฅเคฐเฅ‹เคฒเคฐ เค•เคจเฅ‡เค•เฅเคŸ เคจ เคนเฅ‹เคจเฅ‡ เคชเคฐ Auto เคฎเฅเค–เฅเคฏ เคธเฅเค•เฅเคฐเฅ€เคจ เค•เฅ‡ เคจเคฟเคฏเค‚เคคเฅเคฐเคฃ เคฆเคฟเค–เคพเคคเคพ เคนเฅˆเฅค + เคธเฅเค•เฅเคฐเฅ€เคจ เคชเคฐ เคธเค‚เคชเคพเคฆเคฟเคค เค•เคฐเฅ‡เค‚ + เคธเคนเฅ‡เคœเฅ‡ เค—เค เคฒเฅ‡เค†เค‰เคŸโ€ฆ + เคฒเฅ‡เค†เค‰เคŸ เคšเฅเคจเฅ‡เค‚ เคฏเคพ เค…เคชเคจเคพ เคฌเคจเคพเคเค + เคฆเฅ‚เคธเคฐเฅ€ เคธเฅเค•เฅเคฐเฅ€เคจ เค•เฅ‡ เคธเคคเฅเคฐ เคฎเฅ‡เคจเฅ‚ เคฎเฅ‡เค‚ เคชเฅเคฐเฅ‹เคซเคผเคพเค‡เคฒ เคจเคฟเคฏเค‚เคคเฅเคฐเคฃ เคšเฅเคจเฅ‡เค‚เฅค เค•เค‚เคŸเฅเคฐเฅ‹เคฒเคฐ เคฎเฅ‡เคจเฅ‚ เคฎเฅ‡เค‚ เคชเฅเคฐเฅ‹เคซเคผเคพเค‡เคฒ เค”เคฐ เคฆเฅ‚เคธเคฐเฅ€ เคธเฅเค•เฅเคฐเฅ€เคจ เคšเคฏเคจเค•เคฐเฅเคคเคพ เคคเคฏ เค•เคฐเคคเฅ‡ เคนเฅˆเค‚ เค•เคฟ เค•เฅŒเคจ เคธเฅ‡ เคจเคฟเคฏเค‚เคคเฅเคฐเคฃ เคฆเคฟเค–เฅ‡เค‚เฅค + เคฌเคŸเคจ เค•เฅเคฐเคฟเคฏเคพเคเค + %1$s เค•เฅ‡ เคธเคพเคฅ เคธเคพเคเคพเฅค เคธเค‚เคชเคพเคฆเคจ เค‰เคจ เคชเฅเคฐเฅ‹เคซเคผเคพเค‡เคฒ เคชเคฐ เคญเฅ€ เคฒเคพเค—เฅ‚ เคนเฅ‹เคคเฅ‡ เคนเฅˆเค‚เฅค + เคธเฅ‡เคŸเคฟเค‚เค—เฅเคธ เคชเฅเคจเคƒ เค‰เคชเคฏเฅ‹เค— เค•เคฐเฅ‡เค‚ + เคธเฅ‡เคŸเคฟเค‚เค—เฅเคธ เคฏเคนเคพเค เคธเฅ‡ เคฒเฅ‡เค‚โ€ฆ + เค•เคฟเคธเฅ€ เค…เคจเฅเคฏ เคชเฅเคฐเฅ‹เคซเคผเคพเค‡เคฒ เคธเฅ‡ เค•เฅ‰เคชเฅ€ เค•เคฐเฅ‡เค‚ เคฏเคพ เคธเฅ‡เคŸเคฟเค‚เค—เฅเคธ เคธเคพเคเคพ เคฐเค–เฅ‡เค‚ + เคธเฅเคตเคคเค‚เคคเฅเคฐ เคฌเคจเคพเคเค + เคตเคฐเฅเคคเคฎเคพเคจ เคธเฅ‡เคŸเค…เคช เคฐเค–เฅ‡เค‚ เค”เคฐ เคฌเคฆเคฒเคพเคต เคธเคพเคเคพ เค•เคฐเคจเคพ เคฌเค‚เคฆ เค•เคฐเฅ‡เค‚ + เคฒเฅ‡เค†เค‰เคŸ เคคเคคเฅเคต เค”เคฐ เค‰เคจเค•เฅ€ เคธเฅเคฅเคฟเคคเคฟ เคธเค‚เค—เฅเคฐเคนเฅ€เคค เค•เคฐเคคเฅ‡ เคนเฅˆเค‚เฅค เคชเฅเคฐเคคเฅเคฏเฅ‡เค• เคชเฅเคฐเฅ‹เคซเคผเคพเค‡เคฒ เค…เคชเคจเฅ€ เค•เฅเคฐเคฟเคฏเคพเคเค เค…เคธเคพเค‡เคจ เค•เคฐ เคธเค•เคคเคพ เคนเฅˆเฅค เคฒเค•เฅเคทเฅเคฏ เคธเฅเค•เฅเคฐเฅ€เคจ เคชเคฐ เคชเฅ‚เคฐเฅเคฃ เค†เค•เคพเคฐ เคฎเฅ‡เค‚ เคธเค‚เคชเคพเคฆเคฟเคค เค•เคฐเฅ‡เค‚เฅค + เคตเคฐเฅเคคเคฎเคพเคจ เคฒเฅ‡เค†เค‰เคŸ + เค…เคชเฅเคฐเคฏเฅเค•เฅเคค เคฒเฅ‡เค†เค‰เคŸ %1$s เค”เคฐ เค‰เคธเค•เฅ€ เคธเคนเฅ‡เคœเฅ€ เค—เคˆ เค•เฅเคฐเคฟเคฏเคพเคเค เคนเคŸเคพเคเค? + เคตเคฐเฅเคคเคฎเคพเคจ เคฒเฅ‡เค†เค‰เคŸ เค•เคพ เคจเคพเคฎ เคฌเคฆเคฒเฅ‡เค‚ + เค•เคฟเคธเฅ€ เค…เคจเฅเคฏ เคชเฅเคฐเฅ‹เคซเคผเคพเค‡เคฒ เคธเฅ‡ %1$s เค•เคพ เคชเฅเคจเคƒ เค‰เคชเคฏเฅ‹เค— เค•เคฐเฅ‡เค‚เฅค เค…เคจเฅเคฏ เคจเคฟเคฏเค‚เคคเฅเคฐเคฃ เคธเฅเคฐเฅ‹เคค เค…เคชเคฐเคฟเคตเคฐเฅเคคเคฟเคค เคฐเคนเฅ‡เค‚เค—เฅ‡เฅค + เคญเฅŒเคคเคฟเค• เคจเคฟเคฏเค‚เคคเฅเคฐเคฃ เคธเคพเคเคพ เคฐเค–เฅ‡เค‚ + เคกเคฟเคซเคผเฅ‰เคฒเฅเคŸ เคฐเฅ‚เคช เคธเฅ‡ เคธเคญเฅ€ เคจเคฟเคฏเค‚เคคเฅเคฐเคฃ เค”เคฐ เค•เคธเฅเคŸเคฎ เคฒเฅ‡เค†เค‰เคŸ เคธเฅเคตเคคเค‚เคคเฅเคฐ เคชเฅเคฐเคคเคฟเคฏเคพเค เคนเฅˆเค‚เฅค เคธเคพเคเคพ เค•เคฐเคจเคพ เค•เฅ‡เคตเคฒ เคญเฅŒเคคเคฟเค• เคจเคฟเคฏเค‚เคคเฅเคฐเคฃ เคœเฅ‹เคกเคผเคคเคพ เคนเฅˆเฅค + เคฏเฅ‡ เคคเคคเฅเคต เค”เคฐ เคธเฅเคฅเคฟเคคเคฟเคฏเคพเค เค‰เคชเคฏเฅ‹เค— เค•เคฐเฅ‡เค‚เฅค เคธเคพเคเคพ เค•เคฐเคจเฅ‡ เคธเฅ‡ เคญเคตเคฟเคทเฅเคฏ เค•เฅ‡ เคœเฅเคฏเคพเคฎเคฟเคคเคฟ เคฌเคฆเคฒเคพเคต เคธเคฟเค‚เค• เคฐเคนเคคเฅ‡ เคนเฅˆเค‚; เค†เคชเค•เฅ€ เคฌเคŸเคจ เค•เฅเคฐเคฟเคฏเคพเคเค เคธเฅเคตเคคเค‚เคคเฅเคฐ เคฐเคนเคคเฅ€ เคนเฅˆเค‚เฅค เคญเคฟเคจเฅเคจ เคฒเฅ‡เค†เค‰เคŸ เคฌเคฟเคจเคพ เค…เคธเคพเค‡เคจ เค•เฅเคฐเคฟเคฏเคพเค“เค‚ เคธเฅ‡ เคถเฅเคฐเฅ‚ เคนเฅ‹เคคเคพ เคนเฅˆเฅค + เค‡เคจ เคจเคฟเคฏเค‚เคคเฅเคฐเคฃเฅ‹เค‚ เค”เคฐ เค•เฅเคฐเคฟเคฏเคพเค“เค‚ เค•เฅ‹ เค•เฅ‰เคชเฅ€ เค•เคฐเฅ‡เค‚, เคฏเคพ เคฒเคฟเค‚เค• เค•เคฐเฅ‡เค‚ เคคเคพเค•เคฟ เคญเคตเคฟเคทเฅเคฏ เค•เฅ‡ เคฌเคฆเคฒเคพเคต เคฆเฅ‹เคจเฅ‹เค‚ เคชเฅเคฐเฅ‹เคซเคผเคพเค‡เคฒ เคชเคฐ เคฒเคพเค—เฅ‚ เคนเฅ‹เค‚เฅค + เคธเคพเคเคพ เคฐเค–เฅ‡เค‚ + เคธเฅเคตเคคเค‚เคคเฅเคฐ เคชเฅเคฐเคคเคฟ + เคธเฅเคชเคฐเฅเคถ เคธเฅเคฅเคพเคจ เคธเฅ‡ เคธเฅเคŸเคฟเค• เคถเฅเคฐเฅ‚ เค•เคฐเฅ‡เค‚ + เค‰เคชเคฏเฅ‹เค— เคฎเฅ‡เค‚ เคจ เคนเฅ‹ เคคเฅ‹ เคธเฅเคŸเคฟเค• เค›เคฟเคชเคพเคเค + เคŸเฅ‚เคฒ + Auto (%1$s) + เค•เคธเฅเคŸเคฎ (%1$s) + เคจเค เคชเฅเคฐเฅ‹เคซเคผเคพเค‡เคฒ เค•เฅ‡ เคฐเฅ‚เคช เคฎเฅ‡เค‚ เคธเคนเฅ‡เคœเฅ‡เค‚ + เคชเฅเคฐเฅ‹เคซเคผเคพเค‡เคฒ เคจเคฟเคฏเค‚เคคเฅเคฐเคฃ + เคชเฅเคฐเฅ‹เคซเคผเคพเค‡เคฒ + เคฎเคพเค‰เคธ เคŸเคšเคชเฅˆเคก เค‡เคถเคพเคฐเฅ‡ + เคฎเคพเค‰เคธ เคชเฅ‰เค‡เค‚เคŸเคฐ เคชเคฐ เค…เคธเคพเค‡เคจ เคนเฅ‹เคจเฅ‡ เคชเคฐ: เค•เฅเคฒเคฟเค• เค•เฅ‡ เคฒเคฟเค เคŸเฅˆเคช เค•เคฐเฅ‡เค‚, เค–เฅ€เค‚เคšเคจเฅ‡ เค•เฅ‡ เคฒเคฟเค เคฆเคฌเคพเค เคฐเค–เฅ‡เค‚, เค”เคฐ เคฆเฅ‹ เค‰เคเค—เคฒเคฟเคฏเฅ‹เค‚ เคธเฅ‡ เคธเฅเค•เฅเคฐเฅ‰เคฒ เค•เคฐเฅ‡เค‚เฅค + %1$s เคฎเฅ‡เค‚ เค•เฅเคตเคฟเค•-เคฎเฅ‡เคจเฅเคฏเฅ‚ เค“เคตเคฐเคฐเคพเค‡เคก เคนเฅˆเฅค เคตเคนเคพเค Auto เคšเฅเคจเฅ‡เค‚ เคคเคพเค•เคฟ เค‰เคธเค•เคพ เคกเคฟเคซเคผเฅ‰เคฒเฅเคŸ เคชเฅเคฐเฅ‹เคซเคผเคพเค‡เคฒ เค”เคฐ เคคเฅ€เคจเฅ‹เค‚ เคธเคนเฅ‡เคœเฅ‡ เคญเคพเค— เค‰เคชเคฏเฅ‹เค— เคนเฅ‹เค‚เฅค + DroidDeck เค‡เคจเคชเฅเคŸ + เคธเฅเคŸเคฟเค• เค•เฅ‹ เค•เคฟเคธเฅ€ เคญเฅ€ เคฆเคฟเคถเคพ เคฎเฅ‡เค‚ เคนเคฟเคฒเคพเคจเฅ‡ เคชเคฐ เคฆเคฌเคพ เคฐเคนเคคเคพ เคนเฅˆ: 55% เคธเฅ‡ เคŠเคชเคฐ เคฆเคฌเคพเคเค, 35% เคธเฅ‡ เคจเฅ€เคšเฅ‡ เค›เฅ‹เคกเคผเฅ‡เค‚เฅค เคชเฅเคฐเคคเฅเคฏเฅ‡เค• เคฆเคฟเคถเคพ เค…เคฒเค— เค…เคธเคพเค‡เคจ เค•เคฐเคจเฅ‡ เค•เฅ‡ เคฒเคฟเค เคฆเคฟเคถเคพ เค•เฅเค‚เคœเคฟเคฏเคพเค เค‰เคชเคฏเฅ‹เค— เค•เคฐเฅ‡เค‚เฅค DroidDeck เค•เฅเคฐเคฟเคฏเคพเคเค เคชเฅเคฐเคคเคฟ เคเฅเค•เคพเคต เคเค• เคฌเคพเคฐ เคšเคฒเคคเฅ€ เคนเฅˆเค‚เฅค เคธเฅเคŸเคฟเค• เค•เฅเคฒเคฟเค• เค…เคฒเค— เคธเฅ‡ เคธเฅ‡เคŸ เคนเฅ‹เคคเคพ เคนเฅˆเฅค + เคŸเคšเคชเฅˆเคก เค›เฅ‚เคจเฅ‡ เคชเคฐ เคฆเคฌเคพ เคฐเคนเคคเคพ เคนเฅˆ; เค‰เคเค—เคฒเฅ€ เค‰เค เคพเคจเฅ‡ เคชเคฐ เค›เฅ‚เคŸเคคเคพ เคนเฅˆเฅค DroidDeck เค•เฅเคฐเคฟเคฏเคพเคเค เคชเฅเคฐเคคเคฟ เคธเฅเคชเคฐเฅเคถ เคเค• เคฌเคพเคฐ เคšเคฒเคคเฅ€ เคนเฅˆเค‚เฅค เคŸเคšเคชเฅˆเคก เค•เฅเคฒเคฟเค• เค…เคฒเค— เคธเฅ‡ เคธเฅ‡เคŸ เคนเฅ‹เคคเคพ เคนเฅˆเฅค + เคŸเฅเคฐเคฟเค—เคฐ 55% เคชเคพเคฐ เค•เคฐเคจเฅ‡ เคชเคฐ เคฆเคฌเคพ เคฐเคนเคคเคพ เคนเฅˆ; 35% เคธเฅ‡ เคจเฅ€เคšเฅ‡ เค›เฅ‚เคŸเคคเคพ เคนเฅˆเฅค DroidDeck เค•เฅเคฐเคฟเคฏเคพเคเค เคชเฅเคฐเคคเคฟ เคฆเคฌเคพเคต เคเค• เคฌเคพเคฐ เคšเคฒเคคเฅ€ เคนเฅˆเค‚เฅค + เคธเฅเค•เฅเคฐเฅ‰เคฒ เคฆเคฟเคถเคพ + เคฒเค‚เคฌเคตเคค + เค•เฅเคทเฅˆเคคเคฟเคœ + เค•เฅเคทเฅˆเคคเคฟเคœ เคธเฅเค•เฅเคฐเฅ‰เคฒ เค•เคฐเฅ‡เค‚ + เคฎเคพเคช + เคฐเคฟเค•เฅ‰เคฐเฅเคกเคฟเค‚เค— เคธเค•เฅเคทเคฎ เค•เคฐเฅ‡เค‚, เคšเคพเคฒเฅ‚ เคธเคคเฅเคฐ เคฎเฅ‡เค‚ เคจเคฟเคฏเค‚เคคเฅเคฐเคฃ เค‰เคชเคฏเฅ‹เค— เค•เคฐเฅ‡เค‚, เคซเคฟเคฐ เคฒเฅŒเคŸเค•เคฐ เคชเคฐเคฟเคฃเคพเคฎ เคชเคขเคผเฅ‡เค‚เฅค เค•เฅ‡เคตเคฒ DroidDeck เคชเฅเคฐเฅ‡เคทเคฃ เคธเคฎเคฏ เคฎเคพเคชเคคเคพ เคนเฅˆ, เคกเคฟเคธเฅเคชเฅเคฒเฅ‡ เคตเคฟเคฒเค‚เคฌ เคจเคนเฅ€เค‚เฅค เคเคช เคชเฅเคฐเค•เฅเคฐเคฟเคฏเคพ เคฌเค‚เคฆ เคนเฅ‹เคจเฅ‡ เคชเคฐ เคฐเคฟเค•เฅ‰เคฐเฅเคกเคฟเค‚เค— เคธเคฎเคพเคชเฅเคค เคนเฅ‹เคคเฅ€ เคนเฅˆเฅค + %1$d เคจเคฟเคฏเค‚เคคเฅเคฐเคฃ + เค…เคจเฅเคฏ เคธเคนเฅ‡เคœเฅ‡ เค—เค เคฒเฅ‡เค†เค‰เคŸ (%1$d) โ–พ + เค…เคจเฅเคฏ เคธเคนเฅ‡เคœเฅ‡ เค—เค เคฒเฅ‡เค†เค‰เคŸ เค›เคฟเคชเคพเคเค (%1$d) โ–ด + เคนเฅ‹เคฎ / Guide + เคตเคพเคชเคธ ยท เคเค• เคŸเฅˆเคช + เคตเคพเคชเคธ ยท เคฆเฅ‹ เคŸเฅˆเคช + เคตเคพเคชเคธ ยท Steam เคฎเฅ‡เค‚ เคฆเฅ‹ เคฌเคพเคฐ, เคกเฅ‡เคธเฅเค•เคŸเฅ‰เคช เคฎเฅ‡เค‚ เคเค• เคฌเคพเคฐ + Steam เคฎเฅ‹เคก เคฎเฅ‡เค‚เฅค เคตเคพเคชเคธ เคฆเคฌเคพเค เคฐเค–เคจเฅ‡ เคธเฅ‡ เค•เฅเคตเคฟเค• เคเค•เฅเคธเฅ‡เคธ เคญเฅ€ เค–เฅเคฒเคคเคพ เคนเฅˆเฅค + เคกเคฟเคซเคผเฅ‰เคฒเฅเคŸ เคชเคฐ เคชเฅเคจเคฐเฅเคธเฅเคฅเคพเคชเคฟเคค เค•เคฐเฅ‡เค‚ + เค†เคชเค•เคพ เคชเฅˆเคจเคฒ เคšเคฏเคจ เคฏเคพเคฆ เคฐเค–เคพ เคœเคพเคคเคพ เคนเฅˆเฅค เคกเฅ‡เคธเฅเค•เคŸเฅ‰เคช เคฆเฅ‚เคธเคฐเคพ เค•เคพเคฐเฅเคฏเค•เฅเคทเฅ‡เคคเฅเคฐ เค–เฅ‹เคฒเคคเคพ เคนเฅˆ; เคฏเคน เคธเคคเฅเคฐ เคฏเคพ เค‰เคธเค•เคพ เค‡เคจเคชเฅเคŸ เคชเฅเคฐเฅ‹เคซเคผเคพเค‡เคฒ เคจเคนเฅ€เค‚ เคฌเคฆเคฒเคคเคพเฅค + เคตเคฐเฅเคšเฅเค…เคฒ เค•เค‚เคŸเฅเคฐเฅ‹เคฒเคฐ + Steam เคฏเคพ เค—เฅ‡เคฎ เคฆเฅเคตเคพเคฐเคพ เคฆเฅ‡เค–เคพ เคœเคพเคจเฅ‡ เคตเคพเคฒเคพ เค•เค‚เคŸเฅเคฐเฅ‹เคฒเคฐ เคชเฅเคฐเค•เคพเคฐเฅค + เคŸเคšเคธเฅเค•เฅเคฐเฅ€เคจ + เค—เฅ‡เคฎ เคธเฅเค•เฅเคฐเฅ€เคจ เคชเคฐ เคธเฅเคชเคฐเฅเคถ เค•เฅˆเคธเฅ‡ เคธเค‚เคญเคพเคฒเฅ‡ เคœเคพเคคเฅ‡ เคนเฅˆเค‚เฅค เคชเฅเคฐเฅ‹เคซเคผเคพเค‡เคฒ เคฌเคŸเคจ เค…เคชเคจเฅ€ เค…เคธเคพเค‡เคจ เค•เฅ€ เค—เคˆ เค•เฅเคฐเคฟเคฏเคพเคเค เคฐเค–เคคเฅ‡ เคนเฅˆเค‚เฅค + เคŸเคš เค•เคฐเฅเคธเคฐ + เค—เฅ‡เคฎ เคธเฅเค•เฅเคฐเฅ€เคจ เคชเคฐ เคธเฅ€เคงเฅ‡ เคธเฅเคชเคฐเฅเคถ เค•เฅ‡ เคฒเคฟเค เคชเฅ‰เค‡เค‚เคŸเคฐ เคฆเคฟเค–เคพเคเคเฅค + เคธเฅเคชเคฐเฅเคถ เค•เคฐเฅ‡เค‚ เค”เคฐ เคฆเคฌเคพเค เคฐเค–เฅ‡เค‚ + เค—เฅ‡เคฎ เคธเฅเค•เฅเคฐเฅ€เคจ เคชเคฐ เค‰เคเค—เคฒเฅ€ เคฆเคฌเคพเค เคฐเค–เคจเฅ‡ เคชเคฐ เคฎเคพเค‰เคธ เค•เฅเคฐเคฟเคฏเคพเฅค + เคตเคพเคชเคธ เคฌเคŸเคจ เคŸเฅˆเคช + เคชเคนเคฒเฅ€ เค•เฅเคฐเคฟเคฏเคพ: เคเค• เคŸเฅˆเคชเฅค เคฆเฅ‚เคธเคฐเฅ€ เค•เฅเคฐเคฟเคฏเคพ: เคฆเฅ‹ เคŸเฅˆเคชเฅค + เคŸเฅ‰เค—เคฒ เคฌเคŸเคจ + เคฆเคฌเคพเค เคฐเค–เคจเฅ‡ เค•เฅ‡ เคฒเคฟเค เคŸเฅˆเคช เค•เคฐเฅ‡เค‚, เค›เฅ‹เคกเคผเคจเฅ‡ เค•เฅ‡ เคฒเคฟเค เคซเคฟเคฐ เคŸเฅˆเคช เค•เคฐเฅ‡เค‚เฅค เคฎเฅ‡เคจเฅเคฏเฅ‚ เค–เฅ‹เคฒเคจเฅ‡ เคฏเคพ เคชเฅเคฐเฅ‹เคซเคผเคพเค‡เคฒ เคฌเคฆเคฒเคจเฅ‡ เคชเคฐ เคฌเคŸเคจ เค›เฅ‚เคŸ เคœเคพเคคเคพ เคนเฅˆเฅค + เค†เค•เคพเคฐ + เค—เฅ‹เคฒ + เค—เฅ‹เคฒเฅ€ + เคตเฅƒเคคเฅเคค + เค†เคฏเคค + เคฌเคŸเคจ เคฒเฅ‡เคฌเคฒ + เคŸเฅ‡เค•เฅเคธเฅเคŸ + เค†เคฏเคพเคคเคฟเคค เค›เคตเคฟ + เค…เคฒเค— เคตเคฟเค•เคฐเฅเคฃ เค•เฅเค‚เคœเคฟเคฏเคพเค + เคชเฅเคฐเคคเฅเคฏเฅ‡เค• เคตเคฟเค•เคฐเฅเคฃ เค•เฅ‹ เค•เฅเค‚เคœเฅ€ เค…เคธเคพเค‡เคจ เค•เคฐเฅ‡เค‚เฅค เค–เคพเคฒเฅ€ เคตเคฟเค•เคฐเฅเคฃ เค…เคชเคจเฅ‡ เคฆเฅ‹ เคชเคกเคผเฅ‹เคธเฅ€ เคฆเคฟเคถเคพเค“เค‚ เค•เฅ‹ เคฆเคฌเคพเคคเคพ เคนเฅˆเฅค + เคชเคกเคผเฅ‹เคธเฅ€ เคฆเคฟเคถเคพเคเค + เค†เคชเค•เฅ€ เคชเฅเคฐเคพเคจเฅ€ เคธเฅเค•เฅเคฐเฅ€เคจ เค•เฅเค‚เคœเคฟเคฏเคพเค เคจเฅ€เคšเฅ‡ เค†เคฏเคพเคคเคฟเคค เคชเฅเคฐเฅ‹เคซเคผเคพเค‡เคฒ เค•เฅ‡ เคฐเฅ‚เคช เคฎเฅ‡เค‚ เคธเคนเฅ‡เคœเฅ€ เค—เคˆ เคนเฅˆเค‚เฅค เค‰เคชเคฏเฅ‹เค— เคฏเคพ เคธเค‚เคชเคพเคฆเคจ เค•เฅ‡ เคฒเคฟเค เคเค• เคšเฅเคจเฅ‡เค‚เฅค เค†เคชเค•เฅ‡ เคตเคฐเฅเคคเคฎเคพเคจ เคชเฅเคฐเฅ‹เคซเคผเคพเค‡เคฒ เคšเคฏเคจ เคฐเค–เฅ‡ เค—เค เคนเฅˆเค‚เฅค + เคชเฅเคฐเคพเคจเฅ€ เคธเฅเค•เฅเคฐเฅ€เคจ เค•เฅเค‚เคœเคฟเคฏเคพเค เคธเฅเคตเคšเคพเคฒเคฟเคค เคฐเฅ‚เคช เคธเฅ‡ เค†เคฏเคพเคค เคจเคนเฅ€เค‚ เคนเฅ‹ เคธเค•เฅ€เค‚เฅค เคฎเฅ‚เคฒ เคธเฅ‡เคŸเคฟเค‚เค—เฅเคธ เคฐเค–เฅ€ เค—เคˆ เคนเฅˆเค‚เฅค + diff --git a/app/src/main/res/values-hi/input_strings.xml b/app/src/main/res/values-hi/input_strings.xml new file mode 100644 index 0000000000..4a0fb0a0f2 --- /dev/null +++ b/app/src/main/res/values-hi/input_strings.xml @@ -0,0 +1,38 @@ + + + เค‡เคจเคชเฅเคŸ เคชเฅเคฐเฅ‹เคซเคผเคพเค‡เคฒ + เคชเฅเคฐเฅ‹เคซเคผเคพเค‡เคฒ + เคญเฅŒเคคเคฟเค• เค•เค‚เคŸเฅเคฐเฅ‹เคฒเคฐ + เคฎเฅเค–เฅเคฏ เคธเฅเค•เฅเคฐเฅ€เคจ + เคฆเฅ‚เคธเคฐเฅ€ เคธเฅเค•เฅเคฐเฅ€เคจ + เคฎเฅ‚เคฒ / Steam Input + เคฎเฅ‚เคฒ: %1$s + เค•เค‚เคŸเฅเคฐเฅ‹เคฒเคฐ เค•เคพ เคฆเฅ‚เคธเคฐเคพ เคจเคฟเคฏเค‚เคคเฅเคฐเคฃ เคญเฅ‡เคœเฅ‡เค‚ + เคฌเค‚เคฆ + เค•เฅเค‚เคœเฅ€ เคฏเคพ เค•เฅเค‚เคœเฅ€ เคธเค‚เคฏเฅ‹เคœเคจ + เคฆเคฟเคถเคพ เค•เฅเค‚เคœเคฟเคฏเคพเค + เคชเฅ‰เค‡เค‚เคŸเคฐ เคนเคฟเคฒเคพเคเค + เคชเฅ‰เค‡เค‚เคŸเคฐ เค—เคคเคฟ: %1$d + เคธเฅเค•เฅเคฐเฅ‰เคฒ + เคฒเค‚เคฌเคตเคค เคธเฅเค•เฅเคฐเฅ‰เคฒ + เคฎเคพเค‰เคธ เค•เคพ เคฌเคพเคฏเคพเค เคฌเคŸเคจ + เคฎเคพเค‰เคธ เค•เคพ เคฆเคพเคฏเคพเค เคฌเคŸเคจ + เคฎเคพเค‰เคธ เค•เคพ เคฎเคงเฅเคฏ เคฌเคŸเคจ + DroidDeck เคฎเฅ‡เคจเฅเคฏเฅ‚ เค–เฅ‹เคฒเฅ‡เค‚ + เค•เฅ€เคฌเฅ‹เคฐเฅเคก เคฆเคฟเค–เคพเคเค + Steam เคฎเฅ‡เคจเฅเคฏเฅ‚ เค–เฅ‹เคฒเฅ‡เค‚ + Steam เคคเฅเคตเคฐเคฟเคค เคชเคนเฅเคเคš เค–เฅ‹เคฒเฅ‡เค‚ + เคจเคฟเคฏเค‚เคคเฅเคฐเคฃ เคนเคŸเคพเคเค + เคจเคฟเคฏเค‚เคคเฅเคฐเคฃ เคœเฅ‹เคกเคผเฅ‡เค‚ + เคกเคฟเคตเคพเค‡เคธ-เคตเคฟเคถเคฟเคทเฅเคŸ เคฌเคŸเคจ + เคญเฅŒเคคเคฟเค• เคฌเคŸเคจ เค…เคธเคพเค‡เคจ เค•เคฐเฅ‡เค‚ + เคฌเคŸเคจ เค›เฅ‹เคกเคผเฅ‡เค‚, เคซเคฟเคฐ เคธเค‚เคชเคพเคฆเคฟเคค เค•เคฐเฅ‡เค‚, เคชเฅเคจเคƒ เคชเฅเคฐเคฏเคพเคธ เค•เคฐเฅ‡เค‚ เคฏเคพ เคฐเคฆเฅเคฆ เค•เคฐเฅ‡เค‚ เคšเฅเคจเฅ‡เค‚เฅค เค›เฅ‹เคกเคผเคจเฅ‡ เค•เฅ‡ เคฌเคพเคฆ B เคฏเคพ เคตเคพเคชเคธ เคฐเคฆเฅเคฆ เค•เคฐเคคเคพ เคนเฅˆเฅค + เคชเฅเคจเคƒ เคชเฅเคฐเคฏเคพเคธ เค•เคฐเฅ‡เค‚ + เค•เฅ‹เคˆ เคฌเคŸเคจ เคฆเคฌเคพเคเค, เคœเคฟเคธเคฎเฅ‡เค‚ เค•เฅเค‚เคœเฅ€ เค•เฅ‡ เคฐเฅ‚เคช เคฎเฅ‡เค‚ เคฐเคฟเคชเฅ‹เคฐเฅเคŸ เคนเฅ‹เคจเฅ‡ เคตเคพเคฒเคพ เคตเคพเคชเคธ เคฌเคŸเคจ เคญเฅ€ เคถเคพเคฎเคฟเคฒ เคนเฅˆเฅค เคตเฅ‰เคฒเฅเคฏเฅ‚เคฎ เค”เคฐ Android เคธเคฟเคธเฅเคŸเคฎ เค•เฅเค‚เคœเคฟเคฏเคพเค เค†เคฐเค•เฅเคทเคฟเคค เคนเฅˆเค‚เฅค เค…เคธเคพเค‡เคจเคฎเฅ‡เค‚เคŸ เค•เฅ‡เคตเคฒ เค‡เคธ เคกเคฟเคตเคพเค‡เคธ เคชเคฐ เคฒเคพเค—เฅ‚ เคนเฅ‹เคคเคพ เคนเฅˆเฅค + เค…เคธเคพเค‡เคจเคฎเฅ‡เค‚เคŸ เคนเคŸเคพเคเค + เค‡เคจเคชเฅเคŸ เคจเคฟเคฆเคพเคจ + เค‡เคจเคชเฅเคŸ เคญเฅ‡เคœเคจเฅ‡ เค•เคพ เคธเคฎเคฏ เคฐเคฟเค•เฅ‰เคฐเฅเคก เค•เคฐเฅ‡เค‚ + เคฎเคพเคช เคชเคขเคผเฅ‡เค‚ + Android เคธเฅ‡ เคฎเฅŒเคœเฅ‚เคฆเคพ เค‡เคจเคชเฅเคŸ เคŸเฅเคฐเคพเค‚เคธเคชเฅ‹เคฐเฅเคŸ เคฎเฅ‡เค‚ เคชเฅเคฐเค•เคพเคถเคจ เคคเค• เคฎเคพเคชเคคเคพ เคนเฅˆเฅค เค‡เคธเคฎเฅ‡เค‚ Bluetooth เค†เค—เคฎเคจ, เค—เฅ‡เคธเฅเคŸ เคชเฅ‹เคฒเคฟเค‚เค—, เคฐเฅ‡เค‚เคกเคฐเคฟเค‚เค— เค”เคฐ เคกเคฟเคธเฅเคชเฅเคฒเฅ‡ เคตเคฟเคฒเค‚เคฌ เคถเคพเคฎเคฟเคฒ เคจเคนเฅ€เค‚ เคนเฅˆเค‚เฅค เคฐเคฟเค•เฅ‰เคฐเฅเคกเคฟเค‚เค— เคกเคฟเคซเคผเฅ‰เคฒเฅเคŸ เคฐเฅ‚เคช เคธเฅ‡ เคฌเค‚เคฆ เคนเฅˆเฅค + เคธเคพเคฎเคพเคจเฅเคฏ เค‡เคจเคชเฅเคŸ เค…เคธเคพเค‡เคจเคฎเฅ‡เค‚เคŸ เค•เคพ เค‰เคชเคฏเฅ‹เค— เค•เคฐเฅ‡เค‚ + diff --git a/app/src/main/res/values-hi/strings.xml b/app/src/main/res/values-hi/strings.xml index cdacc2c56d..87be428351 100644 --- a/app/src/main/res/values-hi/strings.xml +++ b/app/src/main/res/values-hi/strings.xml @@ -28,6 +28,8 @@ เค…เคญเฅ€ เคธเคธเฅเคชเฅ‡เค‚เคก เค•เคฐเฅ‡เค‚ เคธเฅ‡เคถเคจ เคฌเค‚เคฆ เค•เคฐเฅ‡เค‚ เคซเคผเฅเคฐเฅ‡เคฎ เคœเคจเคฐเฅ‡เคถเคจ + เค‡เคธ เค—เฅ‡เคฎ เค•เฅ€ เคธเฅ‡เคŸเคฟเค‚เค— + เคกเคฟเคซเคผเฅ‰เคฒเฅเคŸ เคธเฅ‡เคŸเคฟเค‚เค— เคซเคผเฅเคฐเฅ‡เคฎ เคœเคจเคฐเฅ‡เคถเคจ เคฎเฅ‹เคก เคšเฅเคจเฅ‡เค‚ เคฌเค‚เคฆ DD-FG %1$dร— @@ -183,6 +185,7 @@ PowerVR เค—เฅเคฐเคพเคซเคผเคฟเค•เฅเคธ เคเคจเคตเคพเคฏเคฐเคฎเฅ‡เค‚เคŸ เคกเคพเค‰เคจเคฒเฅ‹เคก เคจเคนเฅ€เค‚ เคนเฅ‹ เคธเค•เคพเฅค เค•เคจเฅ‡เค•เฅเคถเคจ เคœเคพเคเคšเฅ‡เค‚ เค”เคฐ เคซเคฟเคฐ เค•เฅ‹เคถเคฟเคถ เค•เคฐเฅ‡เค‚เฅค DirectAudio เคกเคพเค‰เคจเคฒเฅ‹เคก เคจเคนเฅ€เค‚ เคนเฅ‹ เคธเค•เคพ, เค‡เคธเคฒเคฟเค เค‡เคธ เคธเฅ‡เคถเคจ เคฎเฅ‡เค‚ เค—เฅ‡เคฎ เค‘เคกเคฟเคฏเฅ‹ เคงเฅ€เคฎเคพ เคชเคพเคฅ เค‡เคธเฅเคคเฅ‡เคฎเคพเคฒ เค•เคฐเคคเคพ เคนเฅˆเฅค เคฏเคน เคชเฅเคฐเฅ‹เค—เฅเคฐเคพเคฎ + เคธเคคเฅเคฐ เคธเฅเค•เฅเคฐเฅ€เคจ เคชเคฐ เคกเฅเคฐเฅ‰ เคจเคนเฅ€เค‚ เค•เคฐ เคธเค•เคพ: %1$sเฅค เค•เคพเคฒเฅ€ เคธเฅเค•เฅเคฐเฅ€เคจ เค•เฅ‡ เคฌเคœเคพเคฏ เคฏเคน เคธเฅเค•เฅเคฐเฅ€เคจ เค•เคพเคฐเคฃ เคฆเคฟเค–เคพเคคเฅ€ เคนเฅˆ; เคชเฅ‚เคฐเคพ เคตเคฟเคตเคฐเคฃ เคธเคคเฅเคฐ เคฒเฅ‰เค— เคฎเฅ‡เค‚ เคนเฅˆเฅค Steam เค•เฅเคฒเคพเค‡เค‚เคŸ เคกเคพเค‰เคจเคฒเฅ‹เคก เคจเคนเฅ€เค‚ เคนเฅ‹ เคธเค•เคพเฅค เคนเฅ‹ เคธเค•เคคเคพ เคนเฅˆ เค†เคชเค•เคพ เคจเฅ‡เคŸเคตเคฐเฅเค• เคฏเคพ VPN Steam เค•เฅ‡ เคธเคฐเฅเคตเคฐ เคฌเฅเคฒเฅ‰เค• เค•เคฐ เคฐเคนเคพ เคนเฅ‹; เค•เคจเฅ‡เค•เฅเคถเคจ เคœเคพเค‚เคšเฅ‡เค‚ เค”เคฐ เคซเคฟเคฐ เคธเฅ‡ เค•เฅ‹เคถเคฟเคถ เค•เคฐเฅ‡เค‚เฅค Steam เค•เฅเคฒเคพเค‡เค‚เคŸ เคธเฅ‡เคŸ เค…เคช เคจเคนเฅ€เค‚ เคนเฅ‹ เคธเค•เคพเฅค เค•เคจเฅ‡เค•เฅเคถเคจ เค”เคฐ เค–เคพเคฒเฅ€ เคธเฅเคŸเฅ‹เคฐเฅ‡เคœ เคœเคพเค‚เคšเฅ‡เค‚, เคซเคฟเคฐ เคธเฅ‡ เค•เฅ‹เคถเคฟเคถ เค•เคฐเฅ‡เค‚เฅค %1$s x86 เคชเฅ€เคธเฅ€ เค•เฅ‡ เคฒเคฟเค เคฌเคจเคพ เคนเฅˆ เค”เคฐ FEX เค•เฅ‡ เคœเคผเคฐเคฟเค เคšเคฒเคคเคพ เคนเฅˆ, เคœเฅ‹ เค…เคญเฅ€ เค‡เค‚เคธเฅเคŸเฅ‰เคฒ เคจเคนเฅ€เค‚ เคนเฅˆเฅค เคธเคพเค‡เคจ เค‡เคจ เคฐเคนเคคเฅ‡ เคนเฅเค Steam เคเค• เคฌเคพเคฐ เคถเฅเคฐเฅ‚ เค•เคฐเฅ‡เค‚ เค”เคฐ เค‡เคธเฅ‡ FEX เค”เคฐ Steam Linux Runtime เคกเคพเค‰เคจเคฒเฅ‹เคก เค•เคฐเคจเฅ‡ เคฆเฅ‡เค‚, เคซเคฟเคฐ เค‡เคธเฅ‡ เคซเคฟเคฐ เคธเฅ‡ เคถเฅเคฐเฅ‚ เค•เคฐเฅ‡เค‚เฅค @@ -385,6 +388,9 @@ เค…เคญเฅ€ เคฏเคนเคพเค‚ เคธเคฎเคฐเฅเคฅเคฟเคค เคจเคนเฅ€เค‚ เค•เฅ‰เคฎเฅเคชเฅ‹เคจเฅ‡เค‚เคŸ เคฒเฅ‹เคก เคนเฅ‹ เคฐเคนเฅ‡ เคนเฅˆเค‚โ€ฆ เค‡เค‚เคธเฅเคŸเฅ‰เคฒ เคจเคนเฅ€เค‚ เคนเฅ‹ เคธเค•เคพ: %1$s + เค‡เคธ เคกเคพเค‰เคจเคฒเฅ‹เคก เค•เฅ‹ เค…เคชเคกเฅ‡เคŸ เค•เฅ€ เคœเคผเคฐเฅ‚เคฐเคค เคนเฅˆเฅค + เค…เคชเคกเฅ‡เคŸ เค•เคคเคพเคฐ เคฎเฅ‡เค‚ เคนเฅˆเฅค + เค…เคชเคกเฅ‡เคŸ เคซเคฟเคฐ เคธเฅ‡ เค•เคฐเฅ‡เค‚ เคกเคพเค‰เคจเคฒเฅ‹เคก เคนเฅ‹ เค—เคฏเคพ %1$s เคกเคพเค‰เคจเคฒเฅ‹เคก เคนเฅ‹ เคฐเคนเคพ เคนเฅˆ เค‡เค‚เคธเฅเคŸเฅ‰เคฒ เคนเฅ‹ เคฐเคนเคพ เคนเฅˆ: %1$s @@ -415,6 +421,22 @@ เค•เฅ‡เคตเคฒ เค‡เค‚เคŸเคฐเคจเคฒ เคซเคผเฅ‹เคฒเฅเคกเคฐ: %1$s เคฆเฅ‚เคธเคฐเฅ€ เคฒเคพเค‡เคฌเฅเคฐเฅ‡เคฐเฅ€ + เค”เคฐ Steam เคฒเคพเค‡เคฌเฅเคฐเฅ‡เคฐเฅ€เคœเคผ + เคตเฅ‡ เคซเคผเฅ‹เคฒเฅเคกเคฐ เคœเคฟเคจเคฎเฅ‡เค‚ Steam เค—เฅ‡เคฎ เค‡เค‚เคธเฅเคŸเฅ‰เคฒ เค•เคฐ เคธเค•เคคเคพ เคนเฅˆ เค”เคฐ เคœเคนเคพเค เคธเฅ‡ เคšเคฒเคพ เคธเค•เคคเคพ เคนเฅˆ, เคนเคฐ เคเค• เค…เคชเคจเฅ‡ เคจเคพเคฎ เค•เฅ‡ เคธเคพเคฅเฅค เค•เคฟเคธเฅ€ เค•เฅ‹ เคนเคŸเคพเคจเฅ‡ เคชเคฐ เค‰เคธเค•เฅ‡ เค—เฅ‡เคฎ เคกเคฟเคธเฅเค• เคชเคฐ เคฌเคจเฅ‡ เคฐเคนเคคเฅ‡ เคนเฅˆเค‚เฅค + เคฒเคพเค‡เคฌเฅเคฐเฅ‡เคฐเฅ€ เคœเฅ‹เคกเคผเฅ‡เค‚ + เคจเคพเคฎ เคฌเคฆเคฒเฅ‡เค‚ + เคฒเคพเค‡เคฌเฅเคฐเฅ‡เคฐเฅ€ เค•เคพ เคจเคพเคฎ + เคฒเคพเค‡เคฌเฅเคฐเฅ‡เคฐเฅ€ เค•เฅ‡ เคฒเคฟเค เคซเคผเฅ‹เคฒเฅเคกเคฐ เคšเฅเคจเฅ‡เค‚ + เค…เคงเคฟเค•เคคเคฎ %1$d เคฒเคพเค‡เคฌเฅเคฐเฅ‡เคฐเฅ€เคœเคผ เคœเฅ‹เคกเคผเฅ€ เคœเคพ เคธเค•เคคเฅ€ เคนเฅˆเค‚ + เคฏเคน เคซเคผเฅ‹เคฒเฅเคกเคฐ เคชเคนเคฒเฅ‡ เคธเฅ‡ เคฒเคพเค‡เคฌเฅเคฐเฅ‡เคฐเฅ€ เคนเฅˆ เคฏเคพ เค•เคฟเคธเฅ€ เคฒเคพเค‡เคฌเฅเคฐเฅ‡เคฐเฅ€ เค•เฅ‡ เค…เค‚เคฆเคฐ เคนเฅˆ + %1$s ยท เค‰เคชเคฒเคฌเฅเคง เคจเคนเฅ€เค‚ + เค…เค—เคฒเฅ‡ Steam เคธเคคเฅเคฐ เคธเฅ‡ เคฒเคพเค—เฅ‚ เคนเฅ‹เค—เคพ + เค‡เคธ เคกเคฟเคตเคพเค‡เคธ เคชเคฐ เคชเคพเคฏเคพ เค—เคฏเคพ ยท %1$s ยท %2$s + เคœเฅ‹เคกเคผเฅ‡เค‚ + เค†เค‚เคคเคฐเคฟเค• เคธเฅเคŸเฅ‹เคฐเฅ‡เคœ เคฎเฅ‡เค‚ เคฒเคพเค‡เคฌเฅเคฐเฅ‡เคฐเฅ€เคœเคผ เค–เฅ‹เคœเฅ‡เค‚ + เคธเคญเฅ€ เคซเคผเคพเค‡เคฒเฅ‹เค‚ เคคเค• เคชเคนเฅเคเคš เคฆเฅ‡เค‚ เคคเคพเค•เคฟ DroidDeck เค‰เคจ Steam เคฒเคพเค‡เคฌเฅเคฐเฅ‡เคฐเฅ€เคœเคผ เค•เฅ‹ เคฆเฅ‡เค– เคธเค•เฅ‡ เคœเฅ‹ เคฆเฅ‚เคธเคฐเฅ‡ เคเคช เค†เค‚เคคเคฐเคฟเค• เคธเฅเคŸเฅ‹เคฐเฅ‡เคœ เคฎเฅ‡เค‚ เคฐเค–เคคเฅ‡ เคนเฅˆเค‚ + เค…เคจเฅเคฎเคคเคฟ เคฆเฅ‡เค‚ + %1$s เค•เฅ‹ เคœเฅ‹เคกเคผเคพ เค—เคฏเคพ, เค†เคชเค•เฅ‡ เคšเฅเคจเฅ‡ เคซเคผเฅ‹เคฒเฅเคกเคฐ เค•เฅ‡ เค…เค‚เคฆเคฐ เคฎเฅŒเคœเฅ‚เคฆ Steam เคฒเคพเค‡เคฌเฅเคฐเฅ‡เคฐเฅ€ SD เคฏเคพ เคถเฅ‡เคฏเคฐเฅเคก เคธเฅเคŸเฅ‹เคฐเฅ‡เคœ เคธเฅ‡ เคเคธเฅ‡เคŸ เคธเฅเคŸเฅเคฐเฅ€เคฎ เค•เคฐเคจเฅ‡ เคตเคพเคฒเฅ‡ เค—เฅ‡เคฎ เค…เคŸเค• เคธเค•เคคเฅ‡ เคนเฅˆเค‚เฅค เคธเฅเคŸเฅ‹เคฐเฅ‡เคœ เคกเคพเคฏเค—เฅเคจเฅ‹เคธเฅเคŸเคฟเค•เฅเคธ Share logs เคฎเฅ‡เค‚ เคเคฒเฅ‹เค•เฅ‡เคถเคจ เคจเคคเฅ€เคœเฅ‡ เค”เคฐ เคธเฅˆเค‚เคชเคฒ เค•เคฟเค เคธเฅเคŸเฅ‹เคฐเฅ‡เคœ เคŸเคพเค‡เคฎเคฟเค‚เค— เคฐเคฟเค•เฅ‰เคฐเฅเคก เค•เคฐเฅ‡เค‚เฅค เคšเคพเคฒเฅ‚ เคฐเคนเคคเฅ‡ เคนเฅเค เค‡เค‚เคธเฅเคŸเฅ‰เคฒ เคงเฅ€เคฎเฅ‡ เคนเฅ‹ เคธเค•เคคเฅ‡ เคนเฅˆเค‚เฅค เค…เค—เคฒเฅ‡ เคธเฅ‡เคถเคจ เคธเฅ‡ เคฒเคพเค—เฅ‚ เคนเฅ‹เคคเคพ เคนเฅˆเฅค @@ -478,6 +500,7 @@ เคšเคพเคฒเฅ‚ Steam เค•เฅ‡ เคธเคพเคฅ เคถเฅเคฐเฅ‚ เคนเฅ‹เคคเคพ เคนเฅˆ Steam เค•เฅ‡ เคฌเคฟเคจเคพ เคถเฅเคฐเฅ‚ เคนเฅ‹เคคเคพ เคนเฅˆ + เค—เฅ‡เคฎ เคฐเคฟเคœเคผเฅ‰เคฒเฅเคฏเฅ‚เคถเคจ เคธเฅ‡เคŸเคฟเค‚เค— %1$s เคธเฅ‡เคŸเคฟเค‚เค— เคกเคฟเคซเคผเฅ‰เคฒเฅเคŸ @@ -565,6 +588,8 @@ เค—เฅ‡เคฎ เค•เฅ‹เคฐ เค—เฅ‡เคฎ เค•เฅ‹เคฐ เค—เฅ‡เคฎ เค•เฅ‡ เคฒเคฟเค เค•เฅ‹เคฐเฅค เคธเคญเฅ€ เคšเฅเคจเฅ‡ เคนเฅ‹เคจเฅ‡ เคชเคฐ, Android เค–เฅเคฆ เคถเฅ‡เคกเฅเคฏเฅ‚เคฒ เค•เคฐเคคเคพ เคนเฅˆเฅค + เคธเฅเคฅเคฟเคฐ เค—เฅ‡เคฎ เคฎเฅ‡เค‚ เคฌเคฟเคœเคฒเฅ€ เคฌเคšเคพเคเค + เคœเคฌ เคคเค• เค—เฅ‡เคฎ เคธเฅเคฅเคฟเคฐ เคซเคผเฅเคฐเฅ‡เคฎ เคฐเฅ‡เคŸ เคฌเคจเคพเค เคฐเค–เคคเคพ เคนเฅˆ, เค‰เคธเฅ‡ เคงเฅ€เคฎเฅ‡ เค•เฅ‹เคฐ เคชเคฐ เคšเคฒเคพเคคเคพ เคนเฅˆ, เค”เคฐ เคชเคฟเค›เคกเคผเคคเฅ‡ เคนเฅ€ เค‰เคธเค•เฅ‡ เคธเคพเคฎเคพเคจเฅเคฏ เค•เฅ‹เคฐ เคชเคฐ เคฒเฅŒเคŸเคพ เคฆเฅ‡เคคเคพ เคนเฅˆเฅค เค•เฅเคฒเคพเค‡เค‚เคŸ เค‡เค‚เคŸเคฐเคซเคผเฅ‡เคธ เคฅเฅเคฐเฅ‡เคกเฅ‡เคก GL Steam เคฎเฅ‡เคจเฅ‚ เค•เฅ‹ เคœเคผเฅเคฏเคพเคฆเคพ เคฐเคฟเคธเฅเคชเฅ‰เคจเฅเคธเคฟเคต เคฌเคจเคพ เคธเค•เคคเคพ เคนเฅˆเฅค @@ -600,7 +625,10 @@ Proton เค•เฅ‡ เค—เฅ‡เคฎเคชเฅˆเคก เคจเฅ‡เคตเคฟเค—เฅ‡เคถเคจ เคนเฅ‡เคฒเฅเคชเคฐ เค•เฅ‹ เคฌเค‚เคฆ เค•เคฐเคคเคพ เคนเฅˆ, เคœเฅ‹ เคนเคฐ เค—เฅ‡เคฎ เคฎเฅ‡เค‚ CPU เค–เคฐเฅเคš เค•เคฐเคคเคพ เคนเฅˆเฅค proot เค•เฅ‹ seccomp เค•เฅ‡ เคฌเคฟเคจเคพ เคšเคฒเคพเคเค‚ เค•เฅเค› เค•เคฐเฅเคจเฅ‡เคฒ เคชเคฐ missing-syscall เคเคฐเคฐ เค เฅ€เค• เค•เคฐ เคธเค•เคคเคพ เคนเฅˆเฅค เคชเคฐเคซเคผเฅ‰เคฐเฅเคฎเฅ‡เค‚เคธ เค˜เคŸเคพ เคธเค•เคคเคพ เคนเฅˆเฅค + proot เค•เฅ‡ เคฌเคฟเคจเคพ เคšเคฒเคพเคเค (เคชเฅเคฐเคฏเฅ‹เค—เคพเคคเฅเคฎเค•) + Linux เคนเคฟเคธเฅเคธเคพ เคธเฅ€เคงเฅ‡ Android เคชเคฐ เคถเฅเคฐเฅ‚ เคนเฅ‹เคคเคพ เคนเฅˆเฅค เค…เค—เคฒเฅ‡ เคธเคคเฅเคฐ เคธเฅ‡ เคฒเคพเค—เฅ‚ เคนเฅ‹เค—เคพเฅค เค…เค—เคฐ เค•เฅเค› เคถเฅเคฐเฅ‚ เคจ เคนเฅ‹ เคคเฅ‹ เค‡เคธเฅ‡ เคฌเค‚เคฆ เค•เคฐ เคฆเฅ‡เค‚เฅค proot เคซเคผเคพเคธเฅเคŸ เคชเคพเคฅ + proot เค•เฅ‡ เคฌเคฟเคจเคพ เค‡เคธเค•เคพ เค‰เคชเคฏเฅ‹เค— เคจเคนเฅ€เค‚ เคนเฅ‹เคคเคพเฅค proot เค•เฅ‡ seccomp เคซเคผเคฟเคฒเฅเคŸเคฐ เค•เฅ€ เคœเคผเคฐเฅ‚เคฐเคค เคนเฅˆเฅค เคคเฅ‡เคœเคผ เคซเคผเคพเค‡เคฒ เคฒเฅเค•เค…เคช เค”เคฐ เค•เคฎ เค…เคŸเค•เคพเคตเฅค เค…เค—เคฐ เค•เฅ‹เคˆ เคชเฅเคฐเฅ‹เค—เฅเคฐเคพเคฎ เค…เคชเคจเฅ€ เคซเคผเคพเค‡เคฒเฅ‡เค‚ เคจ เค–เฅ‹เคœ เคชเคพเค เคคเฅ‹ เค‡เคธเฅ‡ เคฌเค‚เคฆ เค•เคฐเฅ‡เค‚เฅค gamescope เค•เฅ‡ เค…เค‚เคฆเคฐ เค•เคฐเฅเคธเคฐ เคฌเคจเคพเคเค‚ @@ -683,6 +711,7 @@ เค—เฅเคฐเคพเคซเคผเคฟเค•เฅเคธ เคฎเฅ‡เคฎเฅ‹เคฐเฅ€ เคธเฅเคตเฅˆเคช เคฌเฅˆเคŸเคฐเฅ€ เคฒเฅ‡เคตเคฒ + เคฌเฅˆเคŸเคฐเฅ€ เค•เคพ เคถเฅ‡เคท เคธเคฎเคฏ เคชเคพเคตเคฐ เค–เคชเคค เคจเฅ‡เคŸเคตเคฐเฅเค• เคฐเคฟเคœเคผเฅ‰เคฒเฅเคฏเฅ‚เคถเคจ @@ -809,6 +838,7 @@ เคกเคฟเคตเคพเค‡เคธ เคธเคฎเคฐเฅเคฅเคฟเคค เค…เคจเคŸเฅ‡เคธเฅเคŸเฅ‡เคก GPU GPU เคธเคฎเคฐเฅเคฅเคฟเคค เคจเคนเฅ€เค‚ + Mali เคฌเฅเคฐเคฟเคœ เค•เฅ‡ เคœเคผเคฐเคฟเค GPU %1$s ยท %2$s %1$s: %2$s %1$s เค•เฅ‡ เคฒเคฟเค เค•เฅ‹เคˆ เคธเค‚เค—เคค เค—เฅเคฐเคพเคซเคผเคฟเค•เฅเคธ เคฌเฅˆเค•เคเค‚เคก เค‰เคชเคฒเคฌเฅเคง เคจเคนเฅ€เค‚ เคนเฅˆเฅค Steam เค•เคพเคฒเฅ€ เคธเฅเค•เฅเคฐเฅ€เคจ เคฆเคฟเค–เคพ เคธเค•เคคเคพ เคนเฅˆเฅค @@ -838,15 +868,38 @@ เคธเฅ‡เคถเคจ เคธเฅ‡เคถเคจ เคฒเฅ‰เค— เคนเคฐ เคธเฅ‡เคถเคจ เค•เฅ‡ เคฌเคพเคฆ เคธเฅ‡เคต เคนเฅ‹เคคเคพ เคนเฅˆ + เค…เค—เคฒเฅ‡ เคธเคคเฅเคฐ เค•เฅ‡ เคฒเคฟเค เค‰เคจเฅเคจเคค เคกเคพเคฏเค—เฅเคจเฅ‰เคธเฅเคŸเคฟเค•เฅเคธ + เคเค• เคธเคคเฅเคฐ เค•เฅ‡ เคฒเคฟเค เคตเคฟเคธเฅเคคเฅƒเคค เคฒเฅ‰เค— เค•เฅˆเคชเฅเคšเคฐ เค•เคฐเคคเคพ เคนเฅˆเฅค เคชเฅเคฐเคฆเคฐเฅเคถเคจ เค•เคฎ เคนเฅ‹ เคธเค•เคคเคพ เคนเฅˆ เค”เคฐ เคœเคผเฅเคฏเคพเคฆเคพ เคธเฅเคŸเฅ‹เคฐเฅ‡เคœ เคฒเค— เคธเค•เคคเฅ€ เคนเฅˆเฅค เคธเคคเฅเคฐ เคถเฅเคฐเฅ‚ เคนเฅ‹เคคเฅ‡ เคนเฅ€ เคฏเคน เค…เคชเคจเฅ‡ เค†เคช เคฌเค‚เคฆ เคนเฅ‹ เคœเคพเคคเคพ เคนเฅˆ; เคถเฅ‡เคฏเคฐ เค•เคฐเคจเฅ‡ เคธเฅ‡ เคชเคนเคฒเฅ‡ เคฒเฅ‰เค— เคœเคพเคเคš เคฒเฅ‡เค‚เฅค เค—เฅ‡เคฎ เคกเฅ€เคฌเค— เคฒเฅ‰เค— เค…เค—เคฒเฅ€ เคฌเคพเคฐ เค—เฅ‡เคฎ เคฒเฅ‰เคจเฅเคš เคนเฅ‹เคจเฅ‡ เคชเคฐ Proton, Wine เค”เคฐ เค—เฅเคฐเคพเคซเคผเคฟเค•เฅเคธ เคกเคพเคฏเค—เฅเคจเฅ‹เคธเฅเคŸเคฟเค•เฅเคธ เคถเคพเคฎเคฟเคฒ เค•เคฐเฅ‡เค‚เฅค เคชเคฐเคซเคผเฅ‰เคฐเฅเคฎเฅ‡เค‚เคธ เค˜เคŸเคพ เคธเค•เคคเคพ เคนเฅˆ เค”เคฐ เคœเคผเฅเคฏเคพเคฆเคพ เคธเฅเคŸเฅ‹เคฐเฅ‡เคœ เคฒเฅ‡ เคธเค•เคคเคพ เคนเฅˆเฅค เค—เฅ‡เคฎ เคกเฅ€เคฌเค— เคฒเฅ‰เค— เคธเฅ‡เคต เค•เคฐเคจเฅ‡ เค•เฅ‡ เคฒเคฟเค เคฏเคน เคธเฅ‡เคถเคจ เคฐเฅ€เคธเฅเคŸเคพเคฐเฅเคŸ เค•เคฐเฅ‡เค‚ เคฒเฅ‰เค—เคฟเค‚เค— เค…เคชเคกเฅ‡เคŸ เคจเคนเฅ€เค‚ เคนเฅ‹ เคธเค•เฅ€เฅค เคธเฅเคตเคฟเคš เคœเคพเค‚เคšเฅ‡เค‚ เค”เคฐ เคซเคฟเคฐ เค•เฅ‹เคถเคฟเคถ เค•เคฐเฅ‡เค‚เฅค เคกเคฟเคฌเค—เคฟเค‚เค— เคŸเฅ‚เคฒ + เคตเคฟเคธเฅเคคเฅƒเคค เค—เฅเคฐเคพเคซเคผเคฟเค•เฅเคธ เคฒเฅ‰เค— + Steam เค‡เค‚เคŸเคฐเคซเคผเฅ‡เคธ: GPU เคกเฅเคฐเฅ‰เค‡เค‚เค— + Xclipse เคกเฅเคฐเคพเค‡เคตเคฐ เคœเฅ‹เคกเคผเฅ€ เค•เฅ‡ เคธเคพเคฅ, Steam เค…เคชเคจเฅ‡ เคชเฅ‡เคœ เคธเฅ‰เคซเคผเฅเคŸเคตเฅ‡เคฏเคฐ เคธเฅ‡ เคกเฅเคฐเฅ‰ เค•เคฐเคคเคพ เคนเฅˆ (GPU เคกเฅเคฐเฅ‰เค‡เค‚เค— เคฎเฅ‡เค‚ เคŸเคพเค‡เคฒเฅ‡เค‚ เคŸเฅ‚เคŸเฅ€ เคนเฅเคˆ เคฆเคฟเค–เฅ€เค‚)เฅค เค…เค—เคฐ เค‡เคธ เคซเคผเฅ‹เคจ เคชเคฐ เค เฅ€เค• เคฆเคฟเค–เฅ‡, เคคเฅ‹ เคคเฅ‡เคœเคผ Steam เค‡เค‚เคŸเคฐเคซเคผเฅ‡เคธ เค•เฅ‡ เคฒเคฟเค เค‡เคธเฅ‡ เคšเคพเคฒเฅ‚ เค•เคฐเฅ‡เค‚เฅค + %1$s เคชเคฐ เคจเคฟเคฐเฅเคฎเคฟเคค + %1$s เค•เฅ‹ เคจเคตเฅ€เคจเคคเคฎ เคฌเคฟเคฒเฅเคก เคชเคฐ เค…เคชเคกเฅ‡เคŸ เค•เคฟเคฏเคพ เค—เคฏเคพ + เคชเคฟเค›เคฒเฅ‡ เคธเคคเฅเคฐ เคฎเฅ‡เค‚ %1$s เคชเคฐ Mali เคฌเฅเคฐเคฟเคœ เค•เฅ€ เคธเฅเคต-เคœเคพเคเคš (เค‡เคฎเฅ‡เคœ เคฏเคพ เคกเฅเคฐเฅ‰) เคตเคฟเคซเคฒ เคฐเคนเฅ€, เค‡เคธเคฒเคฟเค เคธเคคเฅเคฐ เคฎเฅ‡เค‚ เค‡เคธเค•เฅ‡ เคฌเคœเคพเคฏ PanVK เคกเฅเคฐเคพเค‡เคตเคฐ เคœเฅ‹เคกเคผเฅ€ เค•เคพ เค‡เคธเฅเคคเฅ‡เคฎเคพเคฒ เค•เคฟเคฏเคพ เค—เคฏเคพเฅค + เคชเคฟเค›เคฒเฅ‡ เคธเคคเฅเคฐ เคฎเฅ‡เค‚ %1$s เคชเคฐ Mali เคฌเฅเคฐเคฟเคœ เค•เฅ‹ เคกเฅเคฐเคพเค‡เคตเคฐ เค•เฅ‡ เคธเคพเคฅ เคฎเฅ‡เคฎเฅ‹เคฐเฅ€ เคธเคพเคเคพ เค•เคฐเคจเฅ‡ เค•เคพ เค•เฅ‹เคˆ เคคเคฐเฅ€เค•เคพ เคจเคนเฅ€เค‚ เคฎเคฟเคฒเคพ, เค‡เคธเคฒเคฟเค เคธเคคเฅเคฐ เคฎเฅ‡เค‚ เค‡เคธเค•เฅ‡ เคฌเคœเคพเคฏ PanVK เคกเฅเคฐเคพเค‡เคตเคฐ เคœเฅ‹เคกเคผเฅ€ เค•เคพ เค‡เคธเฅเคคเฅ‡เคฎเคพเคฒ เค•เคฟเคฏเคพ เค—เคฏเคพเฅค เคฏเคน เคฌเฅเคฐเคฟเคœ เค‡เคธ เคซเคผเฅ‹เคจ เคชเคฐ เค•เคพเคฎ เคจเคนเฅ€เค‚ เค•เคฐ เคธเค•เคคเคพ; เค‡เคธเฅ‡ เคฌเค‚เคฆ เคฐเค–เคจเฅ‡ เคธเฅ‡ PanVK เคœเฅ‹เคกเคผเฅ€ เคนเฅ€ เคฌเคจเฅ€ เคฐเคนเคคเฅ€ เคนเฅˆเฅค + เคนเคฐ เค—เฅ‡เคฎ เค•เฅ‡ Proton, DXVK เค”เคฐ เคกเฅเคฐเคพเค‡เคตเคฐ เคฒเฅ‰เค— เคธเคคเฅเคฐ เค•เฅ‡ เคฒเฅ‰เค— เคฎเฅ‡เค‚ เคฎเคฟเคฒเคคเฅ‡ เคนเฅˆเค‚เฅค GPU Adreno เคจ เคนเฅ‹เคจเฅ‡ เคชเคฐ เคฏเคน เคนเคฎเฅ‡เคถเคพ เคšเคพเคฒเฅ‚ เคฐเคนเคคเคพ เคนเฅˆเฅค เคจเคตเฅ€เคจเคคเคฎ เคธเฅ‡เคถเคจ เคฒเฅ‰เค— เคธเฅ‡เคต เค•เคฟเค เคธเฅ‡เคถเคจ เคฒเฅ‰เค— เคธเคฌเคธเฅ‡ เคจเค %1$d เคฐเค–เคคเคพ เคนเฅˆ เคฒเฅ‰เค— เคนเคŸเคพเคเค‚ + เค‰เคชเคฒเคฌเฅเคง เคธเคคเฅเคฐ เคฒเฅ‰เค— + เค…เคญเฅ€ เคคเค• เค•เฅ‹เคˆ เคธเคนเฅ‡เคœเคพ เค—เคฏเคพ เคธเคคเฅเคฐ เคฒเฅ‰เค— เคจเคนเฅ€เค‚ เคนเฅˆเฅค + เคธเคพเคเคพ เค•เฅ€ เค—เคˆ เค”เคฐ เคธเคนเฅ‡เคœเฅ€ เค—เคˆ ZIP เคซเคผเคพเค‡เคฒเฅ‹เค‚ เคฎเฅ‡เค‚ เคšเฅเคจเคพ เค—เคฏเคพ เคธเคคเฅเคฐ เค”เคฐ เค‰เคธเคธเฅ‡ เคœเฅเคกเคผเฅ‡ Steam, เคธเฅเคŸเฅ‹เคฐ, เคŸเฅ‚เคฒ เค”เคฐ Battle.net เค•เฅ‡ เคจเคฟเคฆเคพเคจ เคกเฅ‡เคŸเคพ เคถเคพเคฎเคฟเคฒ เคนเฅ‹เคคเฅ‡ เคนเฅˆเค‚เฅค + %1$s ยท %2$s + เคตเคฐเฅเคคเคฎเคพเคจ เคธเคคเฅเคฐ + เคธเคพเคเคพ เค•เคฐเฅ‡เค‚ + เคกเคฟเคตเคพเค‡เคธ เคฎเฅ‡เค‚ เคธเคนเฅ‡เคœเฅ‡เค‚ + เคนเคŸเคพเคเค + เคธเคคเฅเคฐ เคฒเฅ‰เค— เคนเคŸเคพเคเค? + %1$s เคนเคŸเคพเคเค? เค‡เคธเฅ‡ เคชเฅ‚เคฐเฅเคตเคตเคค เคจเคนเฅ€เค‚ เค•เคฟเคฏเคพ เคœเคพ เคธเค•เคคเคพเฅค + เคธเคคเฅเคฐ เคฒเฅ‰เค— เคธเคนเฅ‡เคœ เคฒเคฟเค เค—เคเฅค + เคธเคคเฅเคฐ เคฒเฅ‰เค— เคธเคนเฅ‡เคœเฅ‡ เคจเคนเฅ€เค‚ เคœเคพ เคธเค•เฅ‡เฅค + เคธเคคเฅเคฐ เคฒเฅ‰เค— เคนเคŸเคพเค เคจเคนเฅ€เค‚ เคœเคพ เคธเค•เฅ‡เฅค เคธเคญเฅ€ เคธเฅ‡เคŸเคฟเค‚เค— เคฐเฅ€เคธเฅ‡เคŸ เค•เคฐเฅ‡เค‚ เคนเคฐ เคธเฅ‡เคŸเคฟเค‚เค— เค•เฅ‹ เคกเคฟเคซเคผเฅ‰เคฒเฅเคŸ เคฎเคพเคจ เคชเคฐ เคฒเฅŒเคŸเคพเคเค เคฐเฅ€เคธเฅ‡เคŸ เค•เคฐเฅ‡เค‚ @@ -873,6 +926,8 @@ เคนเฅ‹เคฎ เคธเฅเค•เฅเคฐเฅ€เคจ เค•เฅ‡ เคคเฅŒเคฐ เคชเคฐ เค‡เคธเฅเคคเฅ‡เคฎเคพเคฒ เค•เคฐเฅ‡เค‚ DroidDeck เคนเฅ‹เคฎ เคเคช เคนเฅ‹ เคธเค•เคคเคพ เคนเฅˆ DroidDeck เค•เฅ‹ เคนเฅ‹เคฎ เคเคช เค•เฅ‡ เคคเฅŒเคฐ เคชเคฐ เค•เคญเฅ€ เคจเคนเฅ€เค‚ เคฆเคฟเค–เคพเคฏเคพ เคœเคพเคคเคพ + เคนเฅ‹เคฎ เคฌเคŸเคจ เค–เฅ‹เคฒเคคเคพ เคนเฅˆ + เคœเคฌ DroidDeck เคนเฅ‹เคฎ เคเคช เคนเฅ‹ เค”เคฐ เค†เคช เคนเฅ‹เคฎ เคฌเคŸเคจ เคฆเคฌเคพเคเค, เคคเคฌ เคฆเคฟเค–เคจเฅ‡ เคตเคพเคฒเคพ เคชเฅ‡เคœเฅค เค—เฅ‡เคฎ เคœเฅ‹เคกเคผเฅ‡เค‚ เคฎเฅ‡เค‚ DroidDeck เค•เฅ‹ เคถเคพเคฎเคฟเคฒ เค•เคฐเฅ‡เค‚ เคชเคฐ เคธเฅ‡เคŸ เค•เคฐเฅ‡เค‚ เค“เคฐเคฟเคเค‚เคŸเฅ‡เคถเคจ เคฒเฅ‰เคจเฅเคšเคฐ เค“เคฐเคฟเคเค‚เคŸเฅ‡เคถเคจ @@ -886,15 +941,22 @@ เคซเคผเฅเคฒเคธเฅเค•เฅเคฐเฅ€เคจ Android เคธเฅเคŸเฅ‡เคŸเคธ เค”เคฐ เคจเฅ‡เคตเคฟเค—เฅ‡เคถเคจ เคฌเคพเคฐ เค›เคฟเคชเคพเคคเคพ เคนเฅˆ Android เคธเฅเคŸเฅ‡เคŸเคธ เค”เคฐ เคจเฅ‡เคตเคฟเค—เฅ‡เคถเคจ เคฌเคพเคฐ เคฆเคฟเค–เคพเคคเคพ เคนเฅˆ + เคกเฅเค…เคฒ เคธเฅเค•เฅเคฐเฅ€เคจ เคฒเฅ‰เคจเฅเคšเคฐ + เคธเฅเคตเคšเคพเคฒเคฟเคค เคชเคฐ, เคฌเคฟเคฒเฅเคŸ-เค‡เคจ เคฆเฅ‚เคธเคฐเฅ€ เคธเฅเค•เฅเคฐเฅ€เคจ เคตเคพเคฒเฅ‡ เคนเฅˆเค‚เคกเคนเฅ‡เคฒเฅเคก เคฎเฅ‡เค‚ เคฒเฅ‰เคจเฅเคšเคฐ เค•เฅ‡ เคธเฅ‡เค•เฅเคถเคจ (Steam, เคฒเคพเค‡เคฌเฅเคฐเฅ‡เคฐเฅ€, เคธเฅเคŸเฅ‹เคฐเฅเคธ เค”เคฐ เคฌเคพเค•เฅ€) เคฆเฅ‚เคธเคฐเฅ€ เคธเฅเค•เฅเคฐเฅ€เคจ เคชเคฐ เคšเคฒเฅ‡ เคœเคพเคคเฅ‡ เคนเฅˆเค‚เฅค เคšเคพเคฒเฅ‚ เคชเคฐ เค•เฅ‹เคˆ เคญเฅ€ เคฆเฅ‚เคธเคฐเฅ€ เคกเคฟเคธเฅเคชเฅเคฒเฅ‡ เค‡เคธเฅเคคเฅ‡เคฎเคพเคฒ เคนเฅ‹เคคเฅ€ เคนเฅˆเฅค เคฌเค‚เคฆ เคชเคฐ เคฒเฅ‰เคจเฅเคšเคฐ เคเค• เคนเฅ€ เคธเฅเค•เฅเคฐเฅ€เคจ เคชเคฐ เคฐเคนเคคเคพ เคนเฅˆเฅค + เคกเฅเค…เคฒ เคธเฅเค•เฅเคฐเฅ€เคจ เคธเคคเฅเคฐ + เคธเฅเคตเคšเคพเคฒเคฟเคค เคชเคฐ เค‡เคจ-เค—เฅ‡เคฎ เคฎเฅ‡เคจเฅเคฏเฅ‚ เคชเฅ‰เคช-เค“เคตเคฐ เค•เฅ€ เคœเค—เคน เคฌเคฟเคฒเฅเคŸ-เค‡เคจ เคฆเฅ‚เคธเคฐเฅ€ เคธเฅเค•เฅเคฐเฅ€เคจ เคชเคฐ เคกเฅ‰เค• เคนเฅ‹ เคœเคพเคคเคพ เคนเฅˆเฅค เคšเคพเคฒเฅ‚ เคชเคฐ เค•เฅ‹เคˆ เคญเฅ€ เคฆเฅ‚เคธเคฐเฅ€ เคกเคฟเคธเฅเคชเฅเคฒเฅ‡ เค‡เคธเฅเคคเฅ‡เคฎเคพเคฒ เคนเฅ‹เคคเฅ€ เคนเฅˆเฅค เคฌเค‚เคฆ เคชเคฐ เคฎเฅ‡เคจเฅเคฏเฅ‚ เค—เฅ‡เคฎ เคตเคพเคฒเฅ€ เคธเฅเค•เฅเคฐเฅ€เคจ เคชเคฐ เคนเฅ€ เคฐเคนเคคเคพ เคนเฅˆ; เคซเคฟเคฐ เคญเฅ€ เค†เคช เคฎเฅ‡เคจเฅเคฏเฅ‚ เคธเฅ‡ เคฆเฅ‚เคธเคฐเฅ€ เคธเฅเค•เฅเคฐเฅ€เคจ เคšเฅเคจ เคธเค•เคคเฅ‡ เคนเฅˆเค‚เฅค เค‘เคŸเฅ‹เคฎเฅˆเคŸเคฟเค• เคšเคพเคฒเฅ‚ เคฌเค‚เคฆ เค—เฅ‡เคฎ เคฎเฅ‡เค‚ เคจเฅ€เคšเฅ‡ เค•เฅ€ เคธเฅเค•เฅเคฐเฅ€เคจ เค•เฅ‡ เค•เค‚เคŸเฅเคฐเฅ‹เคฒ + เคŸเฅ‡เค•เฅเคธเฅเคŸ เคซเคผเฅ€เคฒเฅเคก เค•เฅ‡ เคฒเคฟเค Android เค•เฅ€เคฌเฅ‹เคฐเฅเคก เคธเฅ‡เคถเคจ เคถเฅเคฐเฅ‚ เคนเฅ‹เคจเฅ‡ เคชเคฐ เคฆเฅ‚เคธเคฐเฅ€ เคธเฅเค•เฅเคฐเฅ€เคจ เคชเคฐ เคŸเฅเคฐเฅˆเค•เคชเฅˆเคก เค”เคฐ เค•เฅ€เคฌเฅ‹เคฐเฅเคก เค–เฅ‹เคฒเคคเคพ เคนเฅˆเฅค เคŠเคชเคฐ เค•เฅ€ เคธเฅเค•เฅเคฐเฅ€เคจ เค•เฅ‡ เคฒเคฟเค เคŸเคพเค‡เคชเคฟเค‚เค— เคนเฅ‹ เค—เคฏเคพ เคกเคฟเคซเคผเฅ‰เคฒเฅเคŸ เคนเฅ‹เคฎ เคเคช เคนเฅ‹เคฎ เคเคช เคšเฅเคจเฅ‡เค‚ + เคจเคฟเคทเฅเค•เฅเคฐเคฟเคฏ เค…เคตเคธเฅเคฅเคพ เคฎเฅ‡เค‚ เคฒเฅ‰เคจเฅเคšเคฐ เค•เฅ‹ เคนเคพเคฒ เค•เฅ‡ เคเคชเฅเคธ เคธเฅ‡ เค›เคฟเคชเคพเคเค + เคฏเคน เคคเคญเฅ€ เคฒเคพเค—เฅ‚ เคนเฅ‹เคคเคพ เคนเฅˆ เคœเคฌ DroidDeck เคกเคฟเคซเคผเฅ‰เคฒเฅเคŸ เคนเฅ‹เคฎ เคเคช เคนเฅ‹ เค”เคฐ เค•เฅ‹เคˆ เคธเคคเฅเคฐ เคจ เคšเคฒ เคฐเคนเคพ เคนเฅ‹เฅค เคšเฅเคจเฅ‡เค‚ Linux เคเคช (เคฌเฅ€เคŸเคพ) เคซเคผเคพเค‡เคฒเฅ‡เค‚ @@ -1006,9 +1068,172 @@ เคชเฅเคฐเฅ€เคตเฅเคฏเฅ‚ เคจเคตเฅ€เคจเคคเคฎ เคซเคผเคฟเค•เฅเคธ, เคธเฅเคŸเฅ‡เคฌเคฒ เคธเฅ‡ เคชเคนเคฒเฅ‡ เคจเคตเฅ€เคจเคคเคฎ + เคฌเคฟเคฒเฅเคก เคตเคฟเคตเคฐเคฃ เค•เฅ‰เคชเฅ€ เค•เคฐเฅ‡เค‚ + เคฌเคฟเคฒเฅเคก เคตเคฟเคตเคฐเคฃ เค•เฅ‰เคชเฅ€ เคนเฅ‹ เค—เคฏเคพ + เคชเฅเคฐเฅ€เคตเฅเคฏเฅ‚ เคธเฅ‡ เค†เค—เฅ‡ + เค†เคช เคชเฅเคฐเฅ€เคตเฅเคฏเฅ‚ เคธเฅ‡ เค†เค—เฅ‡ เคนเฅˆเค‚ + เคฏเคน เคฌเคฟเคฒเฅเคก เคจเคตเฅ€เคจเคคเคฎ เคชเฅเคฐเฅ€เคตเฅเคฏเฅ‚ เคธเฅ‡ เคจเคฏเคพ เคนเฅˆเฅค เค…เค—เคฒเคพ เคชเฅเคฐเฅ€เคตเฅเคฏเฅ‚ เคฌเคฟเคฒเฅเคก เค‡เคธเฅ‡ เค…เคชเคกเฅ‡เคŸ เค•เคฐเฅ‡เค—เคพเฅค + เคฌเคฆเคฒเคพเคต เคฆเฅ‡เค–เคจเฅ‡ เคฏเคพ เค‡เค‚เคธเฅเคŸเฅ‰เคฒ เค•เคฐเคจเฅ‡ เค•เฅ‡ เคฒเคฟเค เค•เฅ‹เคˆ เคฌเคฟเคฒเฅเคก เคšเฅเคจเฅ‡เค‚เฅค + เค‡เค‚เคธเฅเคŸเฅ‰เคฒ เคนเฅˆ + เคฏเคน เคฌเคฟเคฒเฅเคก เค‡เค‚เคธเฅเคŸเฅ‰เคฒ เค•เคฐเฅ‡เค‚%1$s + เค‡เคธ เคฌเคฟเคฒเฅเคก เคชเคฐ เคตเคพเคชเคธ เคœเคพเคเค‚%1$s + versionCode %1$d + เค•เคฎเคฟเคŸ %1$s + เคฐเคฟเคฒเฅ€เคœเคผ เคชเฅ‡เคœ + PR เคฎเฅ‡เค‚ เคจเคฏเคพ เค•เคฎเคฟเคŸ (%1$s) เคนเฅˆเฅค เค‰เคธเค•เคพ เคŸเฅ‡เคธเฅเคŸ เคฌเคฟเคฒเฅเคก เค…เคญเฅ€ เคคเฅˆเคฏเคพเคฐ เคจเคนเฅ€เค‚ เคนเฅˆ, เค‡เคธเคฒเคฟเค เคฏเคน เคฌเคฟเคฒเฅเคก เค‰เคธเฅ‡ เคถเคพเคฎเคฟเคฒ เคจเคนเฅ€เค‚ เค•เคฐเคคเคพเฅค + เคจเคฏเคพ เค•เคฎเคฟเคŸ เค†เคฏเคพ, เคฌเคฟเคฒเฅเคก เคฌเคพเค•เฅ€ เคนเฅˆ + PR เคจเค‚เคฌเคฐ, เคถเฅ€เคฐเฅเคทเค• เคฏเคพ เคฒเฅ‡เค–เค• + เค•เฅ‹เคˆ เคŸเฅ‡เคธเฅเคŸ เคฌเคฟเคฒเฅเคก เคฎเฅ‡เคฒ เคจเคนเฅ€เค‚ เค–เคพเคคเคพ + เคซเคฟเคฐ เคธเฅ‡ เคฌเคจเคพเคจเคพ เคนเฅ‹เค—เคพ (versionCode %1$d) + เคŸเฅ‡เคธเฅเคŸ เคฌเคฟเคฒเฅเคก เค…เคชเคกเฅ‡เคŸ + PR #%1$d เค•เคพ เคจเคฏเคพ เคŸเฅ‡เคธเฅเคŸ เคฌเคฟเคฒเฅเคก + %1$sเฅค เค‡เคธเฅ‡ เค‡เค‚เคธเฅเคŸเฅ‰เคฒ เค•เคฐเคจเฅ‡ เค•เฅ‡ เคฒเคฟเค เค…เคชเคกเฅ‡เคŸ เค–เฅ‹เคฒเฅ‡เค‚เฅค + เค”เคฐ เคฆเคฟเค–เคพเคเค‚ (%1$d) + versionCode %2$d เค•เฅ‡ เคฒเคฟเค เคซเคฟเคฐ เคธเฅ‡ เคฌเคจเคพเคจเฅ‡ เคนเฅ‹เค‚เค—เฅ‡ (%1$d) + เค‡เคธ เคŸเฅ‡เคธเฅเคŸ เคฌเคฟเคฒเฅเคก เค•เฅ‡ เคฌเคพเคฆ main เคชเคฐ เคชเฅเคฐเฅ€เคตเฅเคฏเฅ‚ เคฌเคฟเคฒเฅเคก: %1$d เคŸเฅ‡เคธเฅเคŸ เคฌเคฟเคฒเฅเคก เคฐเคฟเคฒเฅ€เคœเคผ เคนเฅ‹เคจเฅ‡ เคธเฅ‡ เคชเคนเคฒเฅ‡ เค•เคฟเคธเฅ€ เคซเคผเคฟเค•เฅเคธ เค•เฅ‹ เค†เคœเคผเคฎเคพเคเค‚ เค…เคญเฅ€ เค•เฅ‹เคˆ เคจเคนเฅ€เค‚ + เคฒเฅˆเคฌ เคฌเคฟเคฒเฅเคก + เคฒเฅˆเคฌ เคฌเคฟเคฒเฅเคกเฅเคธ + เค‡เคธเฅเคคเฅ‡เคฎเคพเคฒ เคฎเฅ‡เค‚ + Android เค•เฅ‡ DroidDeck เค•เฅ‹ เคฆเฅ‹เคฌเคพเคฐเคพ เค‘เคชเฅเคŸเคฟเคฎเคพเค‡เคœเคผ เค•เคฐเคจเฅ‡ เค•เฅ‡ เคฌเคพเคฆ เค‡เคธเฅ‡ เคฐเฅ‹เค• เคฆเคฟเคฏเคพ เค—เคฏเคพ + เคฒเฅ‹เคก เคจเคนเฅ€เค‚ เคนเฅเค†: %1$s + เคฐเฅ€เคธเฅเคŸเคพเคฐเฅเคŸ เค•เฅ€ เคชเฅเคฐเคคเฅ€เค•เฅเคทเคพ เคฎเฅ‡เค‚ + เคฐเค–เคพ เค—เคฏเคพ + เค•เคฟเคธเฅ€ เคฆเฅ‚เคธเคฐเฅ‡ เคตเคฐเฅเคœเคผเคจ เค•เฅ‡ เคฒเคฟเค + เคซเคฟเคฐ เคธเฅ‡ เคฌเคจเคพเคเค + เค‡เคธ เคฌเคฟเคฒเฅเคก เค•เฅ‹ เคกเคฟเคตเคพเค‡เคธ เคธเฅ‡ เคนเคŸเคพเคคเคพ เคนเฅˆ + เค‡เคธเฅ€ เคชเคฐ เคฐเฅ€เคธเฅเคŸเคพเคฐเฅเคŸ เค•เคฐเฅ‡เค‚ + เคฌเค‚เคฆ เค•เคฐเฅ‡เค‚ + เค‡เคธเฅเคคเฅ‡เคฎเคพเคฒ เค•เคฐเฅ‡เค‚ + เคนเคŸเคพเคเค + เค…เคญเฅ€ เคนเคŸเคพเคเค + เคฐเฅ€เคธเฅเคŸเคพเคฐเฅเคŸ เคคเฅˆเคฏเคพเคฐ เคจเคนเฅ€เค‚ เค•เคฟเคฏเคพ เคœเคพ เคธเค•เคพ: %1$sเฅค เคธเฅ‡เคŸเค…เคช เคฎเฅ‡เค‚ เคตเคพเคฏเคฐเคฒเฅ‡เคธ เคกเคฟเคฌเค—เคฟเค‚เค— เคชเฅ‡เคฏเคฐ เค•เคฐเฅ‡เค‚ เค”เคฐ เคซเคฟเคฐ เค•เฅ‹เคถเคฟเคถ เค•เคฐเฅ‡เค‚เฅค + เคฒเฅˆเคฌ เคฌเคฟเคฒเฅเคก เค‡เค‚เคธเฅเคŸเฅ‰เคฒ เคนเฅ‹ เค—เคฏเคพ + DroidDeck %1$s เคชเคฐ เคฐเฅ€เคธเฅเคŸเคพเคฐเฅเคŸ เคนเฅเค† + เคฒเฅˆเคฌ เคฌเคฟเคฒเฅเคก เคฐเฅ‹เค•เคพ เค—เคฏเคพ + Android เคจเฅ‡ DroidDeck เค•เฅ‹ เคฆเฅ‹เคฌเคพเคฐเคพ เค‘เคชเฅเคŸเคฟเคฎเคพเค‡เคœเคผ เค•เคฟเคฏเคพ, เค‡เคธเคฒเคฟเค %1$s เคฒเฅ‹เคก เคจเคนเฅ€เค‚ เคนเฅเค†เฅค เค‰เคธเฅ€ เคชเคฐ เคซเคฟเคฐ เคธเฅ‡ เคถเฅเคฐเฅ‚ เค•เคฐเคจเฅ‡ เค•เฅ‡ เคฒเคฟเค เค…เคชเคกเฅ‡เคŸเฅเคธ เค–เฅ‹เคฒเฅ‡เค‚เฅค + เคฒเฅˆเคฌ เคฌเคฟเคฒเฅเคก เคฌเค‚เคฆ เค•เคฐ เคฆเคฟเคฏเคพ เค—เคฏเคพ + เคฏเคน DroidDeck เค•เฅ‡ เค•เคฟเคธเฅ€ เคฆเฅ‚เคธเคฐเฅ‡ เคตเคฐเฅเคœเคจ เค•เฅ‡ เคฒเคฟเค เคฌเคจเคพเคฏเคพ เค—เคฏเคพ เคฅเคพเฅค เค‡เคธเฅ‡ เค…เคชเคกเฅ‡เคŸเฅเคธ เคฎเฅ‡เค‚ เคฐเค–เคพ เค—เคฏเคพ เคนเฅˆเฅค + DroidDeck เค‡เคธ เคชเคฐ เคฆเฅ‹ เคฌเคพเคฐ เคถเฅเคฐเฅ‚ เคจเคนเฅ€เค‚ เคนเฅเค† + เคเคœเฅ‡เค‚เคŸ + เคเคœเฅ‡เค‚เคŸ + เคเคœเฅ‡เค‚เคŸ เค•เคพเคฎ เค•เคฐ เคฐเคนเคพ เคนเฅˆ + เคเคœเฅ‡เค‚เคŸ เค‡เคธเฅเคคเฅ‡เคฎเคพเคฒ เค•เคฐเคจเฅ‡ เค•เฅ‡ เคฒเคฟเค Linux เคฏเฅ‚เคœเคผเคฐเคฒเฅˆเค‚เคก เคฎเฅ‡เค‚ Claude Code เค‡เค‚เคธเฅเคŸเฅ‰เคฒ เค•เคฐเฅ‡เค‚เฅค + เค•เคฟเคธเฅ€ เค—เฅ‡เคฎ, เค•เฅเคฐเฅˆเคถ เคฏเคพ DroidDeck เคฎเฅ‡เค‚ เคฌเคฆเคฒเคพเคต เค•เฅ‡ เคฌเคพเคฐเฅ‡ เคฎเฅ‡เค‚ เคชเฅ‚เค›เฅ‡เค‚ + เคญเฅ‡เคœเฅ‡เค‚ + เคจเคˆ เคฌเคพเคคเคšเฅ€เคค + เคฐเฅ‹เค•เฅ‡เค‚ + เคธเฅเคŸเฅ‹เคฐเฅ‡เคœ + เคนเคŸเคพเคเค + เค…เคญเฅ€ เคนเคŸเคพเคเค + Claude Code + Codex + DroidDeck เคธเฅ‹เคฐเฅเคธ + เคกเคพเค‰เคจเคฒเฅ‹เคก เค•เฅˆเคถ + เคœเฅ‹ เคฌเคฆเคฒเคพเคต เคชเฅเคถ เคจเคนเฅ€เค‚ เค•เคฟเค เค—เค, เคตเฅ‡ เค–เฅ‹ เคœเคพเคเคเค—เฅ‡ + เคฌเคฟเคฒเฅเคก เค‡เคจเฅเคนเฅ‡เค‚ เคซเคฟเคฐ เคธเฅ‡ เคกเคพเค‰เคจเคฒเฅ‹เคก เค•เคฐเฅ‡เค‚เค—เฅ‡ + เคธเฅ‡เคŸเค…เคช เค‡เคธเฅ‡ เคฆเฅ‹เคฌเคพเคฐเคพ เค‡เค‚เคธเฅเคŸเฅ‰เคฒ เค•เคฐ เคธเค•เคคเคพ เคนเฅˆ; เคธเคพเค‡เคจ-เค‡เคจ เคธเฅเคฐเค•เฅเคทเคฟเคค เคฐเคนเฅ‡เค‚เค—เฅ‡ + DroidDeck เค†เคชเค•เฅ‡ เคฒเฅˆเคฌ เคฌเคฟเคฒเฅเคก เคชเคฐ เคซเคฟเคฐ เคธเฅ‡ เคถเฅเคฐเฅ‚ เคนเฅ‹ เค—เคฏเคพเฅค เคœเคนเคพเค เค›เฅ‹เคกเคผเคพ เคฅเคพ, เคตเคนเฅ€เค‚ เคธเฅ‡ เคœเคพเคฐเฅ€ เคฐเค–เฅ‡เค‚เฅค + เค‡เคธเคธเฅ‡ เคชเฅ‚เค›เฅ‡เค‚ เค•เคฟ เค•เฅ‹เคˆ เค—เฅ‡เคฎ เค•เฅเคฏเฅ‹เค‚ เคถเฅเคฐเฅ‚ เคจเคนเฅ€เค‚ เคนเฅ‹เคคเคพ, เค•เฅ‹เคˆ เคฒเฅ‰เค— เคธเคฎเคเคพเค, เคฏเคพ DroidDeck เคฎเฅ‡เค‚ เคฌเคฆเคฒเคพเคต เค•เคฐเฅ‡ เค”เคฐ เค‰เคธเฅ‡ เค‡เคธ เคกเคฟเคตเคพเค‡เคธ เคชเคฐ เค†เคœเคผเคฎเคพเคเฅค + เคตเคฟเคซเคฒ: %1$s + %1$s เคธเคฎเคพเคชเฅเคค เคนเฅเค† (เคเค—เฅเคœเคผเคฟเคŸ %2$d) + เคฐเฅ‹เค• เคฆเคฟเคฏเคพ เค—เคฏเคพ + เคฌเคฟเคจเคพ เคœเคตเคพเคฌ เค•เฅ‡ เคธเคฎเคพเคชเฅเคค เคนเฅเค† + เคซเคฟเคฐ เคธเฅ‡ เค•เฅ‹เคถเคฟเคถ เค•เคฐเฅ‡เค‚ + เคเคœเฅ‡เค‚เคŸ เคธเฅ‡เคŸ เค…เคช เคนเฅ‹ เคฐเคนเคพ เคนเฅˆ + DroidDeck เค•เฅ‡ เค‡เค‚เคธเฅเคŸเฅ‰เคฒ เค•เคฟเค เค—เค เคตเคฐเฅเคœเคจ เค•เฅ‡ เคฒเคฟเค เคฎเฅ‡เคฐเคพ เคฒเฅˆเคฌ เคฌเคฟเคฒเฅเคก %1$s เคฆเฅ‹เคฌเคพเคฐเคพ เคฌเคจเคพเคเค เค”เคฐ เค‰เคธเฅ€ เคชเคฐ เคซเคฟเคฐ เคธเฅ‡ เคถเฅเคฐเฅ‚ เค•เคฐเฅ‡เค‚เฅค + %1$s เค‡เคจ ยท %2$s เค†เค‰เคŸ + เคธเฅ‹เคš เคฐเคนเคพ เคนเฅˆ + เคตเคฟเคšเคพเคฐ + เคธเฅ‹เคš เคฐเคนเคพ เคนเฅˆ ยท %1$s + %1$s ยท %2$s + เค‡เคจเคชเฅเคŸ + เค†เค‰เคŸเคชเฅเคŸ + เคšเคฒ เคฐเคนเคพ เคนเฅˆโ€ฆ + เค•เฅ‹เคˆ เคชเคฐเคฟเคฃเคพเคฎ เคจเคนเฅ€เค‚: เคฌเคพเคฐเฅ€ เคชเคนเคฒเฅ‡ เค–เคคเฅเคฎ เคนเฅ‹ เค—เคˆ + เค•เฅ‹เคˆ เค†เค‰เคŸเคชเฅเคŸ เคจเคนเฅ€เค‚ + เค…เค—เคฒเคพ เคธเค‚เคฆเฅ‡เคถ เค•เคคเคพเคฐ เคฎเฅ‡เค‚ เคœเฅ‹เคกเคผเคจเฅ‡ เค•เฅ‡ เคฒเคฟเค เคŸเคพเค‡เคช เค•เคฐเฅ‡เค‚ + เค•เคคเคพเคฐ เคฎเฅ‡เค‚ เคœเฅ‹เคกเคผเฅ‡เค‚ + เค…เค—เคฒเคพ: %1$s + เคจ เคญเฅ‡เคœเฅ‡เค‚ + เคธเค‚เคฒเค—เฅเคจ เค•เคฐเฅ‡เค‚ + เคนเคŸเคพเคเค + เคกเคฟเคซเคผเฅ‰เคฒเฅเคŸ + เคธเฅ‹เคšเคจเฅ‡ เค•เคพ เคธเฅเคคเคฐ + เค†เค—เฅ‡ เคฌเคขเคผเฅ‡เค‚ + เคธเค‚เคถเฅ‹เคงเคฟเคค เค•เคฐเฅ‡เค‚ + เค…เคญเฅ€ เคคเค• เค•เฅเค› เคจเคนเฅ€เค‚ เคฌเคฆเคฒเคพ + เคฏเฅ‹เคœเคจเคพ เค•เฅ‡ เคธเคพเคฅ เค†เค—เฅ‡ เคฌเคขเคผเฅ‡เค‚เฅค + เค…เคญเฅ€ เคญเฅ‡เคœเฅ‡เค‚ + เค…เคงเคฟเค• + เคฌเค‚เคฆ เค•เคฐเฅ‡เค‚ + เคจเคตเฅ€เคจเคคเคฎ + เค•เคพเคฎ เคšเคฒ เคฐเคนเคพ เคนเฅˆ + เคธเค‚เคฆเคฐเฅเคญ + %1$s, เค•เฅเคฒ %2$s เคฎเฅ‡เค‚ เคธเฅ‡ + เคฏเคน เคฌเคพเคคเคšเฅ€เคค ยท %1$s + เคชเคนเคฒเฅ‡ เคœเคตเคพเคฌ เค•เฅ‡ เคฌเคพเคฆ เค‰เคชเคฏเฅ‹เค— เคฆเคฟเค–เฅ‡เค—เคพ + %1$d-เค˜เค‚เคŸเฅ‡ เค•เฅ€ เคธเฅ€เคฎเคพ + %1$d-เคฎเคฟเคจเคŸ เค•เฅ€ เคธเฅ€เคฎเคพ + เคธเคพเคชเฅเคคเคพเคนเคฟเค• เคธเฅ€เคฎเคพ + %1$d%% ยท เคฐเฅ€เคธเฅ‡เคŸ: %2$s + + %1$d เคซเคผเคพเค‡เคฒ + %1$d เคซเคผเคพเค‡เคฒเฅ‡เค‚ + + เคชเคนเคฒเฅ‡ เคฏเฅ‹เคœเคจเคพ เคฌเคจเคพเคเค + เคฏเฅ‹เคœเคจเคพ + เค•เฅเค› เคญเฅ€ เคฌเคฆเคฒเฅ‡ เคฌเคฟเคจเคพ เคฏเฅ‹เคœเคจเคพ เคชเฅ‡เคถ เค•เคฐเคคเคพ เคนเฅˆ + เคฌเคพเคคเคšเฅ€เคคเฅ‡เค‚ + เค…เคญเฅ€ เคคเค• เค•เฅ‹เคˆ เคฌเคพเคคเคšเฅ€เคค เคจเคนเฅ€เค‚ + เค…เคญเฅ€-เค…เคญเฅ€ + เคฎเคฟเคŸเคพเคเค + เค‡เคธเฅ‡ เค”เคฐ เค‡เคธเค•เฅ€ เคธเค‚เคฒเค—เฅเคจ เคซเคผเคพเค‡เคฒเฅ‡เค‚ เคฎเคฟเคŸเคพ เคฆเฅ‡เคคเคพ เคนเฅˆ + เคชเฅเคฐเฅ‹เคธเฅ‡เคธ + Linux เคฏเฅ‚เคœเคผเคฐเคฒเฅˆเค‚เคก เคฎเฅ‡เค‚ เค•เฅเค› เคจเคนเฅ€เค‚ เคšเคฒ เคฐเคนเคพ เคนเฅˆ + เคเคœเฅ‡เค‚เคŸ + เคฐเฅ‹เค•เฅ‡เค‚ + เคฒเฅˆเคฌ เคฌเคฟเคฒเฅเคก + เคฒเฅˆเคฌ เคฌเคฟเคฒเฅเคก เคคเฅˆเคฏเคพเคฐ เค•เคฟเค เคœเคพ เคฐเคนเฅ‡ เคนเฅˆเค‚ + %1$d%% ยท เคฒเค—เคญเค— %2$s เคฌเคšเคพ เคนเฅˆ + เคฒเค—เคญเค— %1$s เคฌเคšเคพ เคนเฅˆ + เคฐเคฆเฅเคฆ เค•เคฐเฅ‡เค‚ + เคฌเคฟเคฒเฅเคก เคฐเคฆเฅเคฆ เค•เคฐเฅ‡เค‚ + เคถเฅเคฐเฅ‚ เคนเฅ‹ เคฐเคนเคพ เคนเฅˆ + %1$d%% + เคชเฅˆเค•เฅ‡เคœเคฟเค‚เค— + เค‡เคธ เคชเคฐ DroidDeck เคซเคฟเคฐ เคธเฅ‡ เคถเฅเคฐเฅ‚ เค•เคฟเคฏเคพ เคœเคพ เคฐเคนเคพ เคนเฅˆ + เคชเฅ‚เคฐเคพ เคนเฅเค† + เคตเคฟเคซเคฒ: %1$s + เคเคœเฅ‡เค‚เคŸ เคธเฅ‡เคŸ เค…เคช เค•เคฐเฅ‡เค‚ + เคชเคนเคฒเฅ‡ เคธเฅ‡เคŸ เค…เคช เคฎเฅ‡เค‚ Linux เคฐเคจเคŸเคพเค‡เคฎ เค‡เค‚เคธเฅเคŸเฅ‰เคฒ เค•เคฐเฅ‡เค‚เฅค + เคซเคฟเคฐ เคธเฅ‡ เค•เฅ‹เคถเคฟเคถ เค•เคฐเฅ‡เค‚ + เคฌเคพเคคเคšเฅ€เคค เคถเฅเคฐเฅ‚ เค•เคฐเฅ‡เค‚ + เคกเคฟเคตเคพเค‡เคธ เค•เคจเฅ‡เค•เฅเคถเคจ + เคตเคพเคฏเคฐเคฒเฅ‡เคธ เคกเคฟเคฌเค—เคฟเค‚เค—, เคคเคพเค•เคฟ เคเคœเฅ‡เค‚เคŸ DroidDeck เค•เฅ‹ เคฆเฅ‡เค– เค”เคฐ เคจเคฟเคฏเค‚เคคเฅเคฐเคฟเคค เค•เคฐ เคธเค•เฅ‡ + %1$s เค‡เค‚เคธเฅเคŸเฅ‰เคฒ เค•เคฐเฅ‡เค‚ + Linux เคฏเฅ‚เคœเคผเคฐเคฒเฅˆเค‚เคก เคฎเฅ‡เค‚, git, gh เค”เคฐ adb เค•เฅ‡ เคธเคพเคฅ + %1$s เคฎเฅ‡เค‚ เคธเคพเค‡เคจ เค‡เคจ เค•เคฐเฅ‡เค‚ + เค†เคชเค•เคพ เคฌเฅเคฐเคพเค‰เคœเคผเคฐ เค–เฅเคฒเคคเคพ เคนเฅˆ + GitHub + เคตเฅˆเค•เคฒเฅเคชเคฟเค•, เคชเฅเคฒ เคฐเคฟเค•เฅเคตเฅ‡เคธเฅเคŸ เค–เฅ‹เคฒเคจเฅ‡ เค•เฅ‡ เคฒเคฟเค + เคฌเคฟเคฒเฅเคก เคŸเฅ‚เคฒเฅเคธ + เคตเฅˆเค•เคฒเฅเคชเคฟเค•, เค‡เคธ เคกเคฟเคตเคพเค‡เคธ เคชเคฐ Lab เคฌเคฟเคฒเฅเคก เค•เฅ‡ เคฒเคฟเค ยท เคฒเค—เคญเค— 5 GB + Agent เคคเฅˆเคฏเคพเคฐ + Agent เค•เฅ€ เคธเฅ‡เคŸเค…เคช เคชเฅ‚เคฐเฅ€ เค•เคฐเฅ‡เค‚ + %1$s เคฎเฅ‡เค‚ เคธเคพเค‡เคจ เค‡เคจ เค•เคฟเคฏเคพ เคนเฅเค† เคนเฅˆ + Lab เคฌเคฟเคฒเฅเคก + เคคเฅ‡เคœเคผ เคฌเคฟเคฒเฅเคก + เคคเฅ‡เคœเคผ Lab เคฌเคฟเคฒเฅเคก + เค‡เคธ เคตเคฐเฅเคœเคผเคจ เค•เฅ‹ เคชเคนเคฒเฅ‡ เคธเฅ‡ เค•เค‚เคชเคพเค‡เคฒ เค•เคฐเคคเคพ เคนเฅˆ, เคœเคฟเคธเคธเฅ‡ Lab เคฌเคฟเคฒเฅเคก เคฎเฅ‡เค‚ เค•เฅเค› เคฎเคฟเคจเคŸ เคฒเค—เคคเฅ‡ เคนเฅˆเค‚ ยท เคเค• เคฌเคพเคฐ เคฒเค—เคญเค— 20 เคฎเคฟเคจเคŸ + เค•เค‚เคชเคพเค‡เคฒ เคนเฅ‹ เคฐเคนเคพ เคนเฅˆ ยท %1$d%% ยท เคฒเค—เคญเค— %2$s เคฌเคพเค•เฅ€ + เคคเฅˆเคฏเคพเคฐ เค•เคฐเฅ‡เค‚ + เคตเคพเคฏเคฐเคฒเฅ‡เคธ เคกเคฟเคฌเค—เคฟเค‚เค— เคธเฅ‡ เค•เคจเฅ‡เค•เฅเคŸ เคจเคนเฅ€เค‚ เคนเฅ‹ เคชเคพ เคฐเคนเคพ; เคชเฅ‡เคฏเคฐ เค•เคฐเคจเฅ‡ เคธเฅ‡ เคฏเคน เคšเคพเคฒเฅ‚ เคนเฅ‹ เคœเคพเคคเคพ เคนเฅˆ + เคชเฅ‡เคฏเคฐ เค•เคฐเฅ‡เค‚ + เค‡เค‚เคธเฅเคŸเฅ‰เคฒ เค•เคฐเฅ‡เค‚ + เคธเคพเค‡เคจ เค‡เคจ เค•เคฐเฅ‡เค‚ PR #%1$d DroidDeck เค•เฅ€ เค‡เคธ เค•เฅ‰เคชเฅ€ เค•เฅ‡ เคฒเคฟเค เคจเคนเฅ€เค‚ เคฌเคจเคพ %1$s เค•เฅ‹ เค…เคชเคกเฅ‡เคŸ เค•เคฟเคฏเคพ เค—เคฏเคพ @@ -1248,6 +1473,9 @@ เคเคช เคธเฅ‡เคŸเค…เคช เค…เคชเคกเฅ‡เคŸ + เค…เคงเคฟเค• + เคŸเฅˆเคฌเฅเคธ เคธเค‚เคชเคพเคฆเคฟเคค เค•เคฐเฅ‡เค‚ + เคŸเฅˆเคฌเฅเคธ %1$d%% %1$s เคซเคฟเคฐ เคธเฅ‡ เคถเฅเคฐเฅ‚ เค•เคฐเฅ‡เค‚ เคนเคฐ เคธเฅ‡เคถเคจ เคฎเฅ‡เค‚ /root/ROMs เค•เฅ‡ เคฐเฅ‚เคช เคฎเฅ‡เค‚ เคฆเคฟเค–เคคเคพ เคนเฅˆเฅค เค‡เค‚เคŸเคฐเคจเคฒ เคธเฅเคŸเฅ‹เคฐเฅ‡เคœ /root/Storage เคชเคฐ เคนเฅˆเฅค @@ -1269,6 +1497,15 @@ เคชเฅ‡เค‚เคกเคฟเค‚เค— เคฐเคฆเฅเคฆ เค•เคฐเฅ‡เค‚ Android เค•เฅ€เคฌเฅ‹เคฐเฅเคก เค›เคฟเคชเคพเคเค‚ โœ• + เคธเฅเค•เฅเคฐเฅ€เคจ เคชเคฐ เค†เค•เคพเคฐ + เค•เฅ€เคฌเฅ‹เคฐเฅเคก เคธเฅเค•เฅเคฐเฅ€เคจ เค•เคพ เค•เคฟเคคเคจเคพ เคนเคฟเคธเฅเคธเคพ เค˜เฅ‡เคฐเคคเคพ เคนเฅˆ, เคนเฅ‡เคกเคฐ เคธเคฎเฅ‡เคคเฅค + เค…เคชเคพเคฐเคฆเคฐเฅเคถเคฟเคคเคพ + เค•เฅ€เคฌเฅ‹เคฐเฅเคก เค•เฅ‡ เคชเฅ€เค›เฅ‡ เค—เฅ‡เคฎ เคฆเคฟเค–เคพเคจเฅ‡ เค•เฅ‡ เคฒเคฟเค เค‡เคธเฅ‡ เค˜เคŸเคพเคเคเฅค + เค›เคฟเคชเฅ€ เค•เฅเค‚เคœเคฟเคฏเคพเค + เคœเคฟเคจ เค•เฅเค‚เคœเคฟเคฏเฅ‹เค‚ เค•เคพ เค†เคช เค•เคฎ เค‡เคธเฅเคคเฅ‡เคฎเคพเคฒ เค•เคฐเคคเฅ‡ เคนเฅˆเค‚, เคตเฅ‡ เค•เฅ€เคฌเฅ‹เคฐเฅเคก เคชเคฐ เคจเคนเฅ€เค‚ เคฐเคนเคคเฅ€เค‚เฅค + Esc เค”เคฐ เคซเคผเค‚เค•เฅเคถเคจ เคชเค‚เค•เฅเคคเคฟ + Ins / Del / Home / End / PgUp / PgDn เค•เฅเค‚เคœเคฟเคฏเคพเค + เคคเฅ€เคฐ เค•เฅเค‚เคœเคฟเคฏเคพเค %1$s เคฒเฅ‰เคจเฅเคš เค•เคฐเฅ‡เค‚ เคธเฅเค•เฅเคฐเฅ€เคจ เคšเฅเคจเฅ‡เค‚เฅค เคธเฅ‡เค•เฅ‡เค‚เคกเคฐเฅ€: %1$sเฅค เคธเฅ‡เค•เฅ‡เค‚เคกเคฐเฅ€ เคกเคฟเคธเฅเคชเฅเคฒเฅ‡ เค…เคฌ เค‰เคชเคฒเคฌเฅเคง เคจเคนเฅ€เค‚ เคนเฅˆเฅค @@ -1770,7 +2007,24 @@ เคŸเคฐเฅเคฎเคฟเคจเคฒ Deck เค—เฅเคฐเคฟเคช + เคŸเฅเคฐเฅˆเค•เคชเฅˆเคก เคกเฅˆเคถเคฌเฅ‹เคฐเฅเคก + เคกเฅ‡เคธเฅเค•เคŸเฅ‰เคช + เคกเฅ‡เคธเฅเค•เคŸเฅ‰เคช เคถเฅเคฐเฅ‚ เค•เคฐเฅ‡เค‚ + เคกเฅ‡เคธเฅเค•เคŸเฅ‰เคช ยท %1$s + เคŸเฅเคฐเฅˆเค•เคชเฅˆเคก + เคกเคพเคฏเคฐเฅ‡เค•เฅเคŸ เคŸเคš + เคŸเฅเคฐเฅˆเค•เคชเฅˆเคกเฅค เคกเคพเคฏเคฐเฅ‡เค•เฅเคŸ เคŸเคš เค•เฅ‡ เคฒเคฟเค เคŸเฅˆเคช เค•เคฐเฅ‡เค‚ + เคกเคพเคฏเคฐเฅ‡เค•เฅเคŸ เคŸเคšเฅค เคŸเฅเคฐเฅˆเค•เคชเฅˆเคก เค•เฅ‡ เคฒเคฟเค เคŸเฅˆเคช เค•เคฐเฅ‡เค‚ + KDE เคกเฅ‡เคธเฅเค•เคŸเฅ‰เคช เคถเฅเคฐเฅ‚ เคนเฅ‹ เคฐเคนเคพ เคนเฅˆโ€ฆ + เคกเฅ‡เคธเฅเค•เคŸเฅ‰เคช เคฌเค‚เคฆ เคนเฅ‹ เค—เคฏเคพเฅค + เคกเฅ‡เคธเฅเค•เคŸเฅ‰เคช เคถเฅเคฐเฅ‚ เคจเคนเฅ€เค‚ เคนเฅ‹ เคธเค•เคพเฅค เค‡เคธเค•เฅ‡ เคฒเฅ‰เค— เค‡เคธ เคธเคคเฅเคฐ เค•เฅ‡ bottom-desktop เคซเคผเฅ‹เคฒเฅเคกเคฐ เคฎเฅ‡เค‚ เคนเฅˆเค‚เฅค + เคกเฅ‡เคธเฅเค•เคŸเฅ‰เคช เคฌเค‚เคฆ เคนเฅˆเฅค เคฏเคนเคพเค‚ เคฆเคฟเค–เคพเคจเฅ‡ เค•เฅ‡ เคฒเคฟเค เค…เคญเฅ€ เค•เฅเค› เคจเคนเฅ€เค‚ เคนเฅˆเฅค + เคธเฅเค•เฅเคฐเฅ€เคจเฅ‡เค‚ เคฌเคฆเคฒเฅ‡เค‚ + เคจเคฟเคšเคฒเฅ€ เคธเฅเค•เฅเคฐเฅ€เคจ เค…เคญเฅ€ เค‰เคชเคฒเคฌเฅเคง เคจเคนเฅ€เค‚ เคนเฅˆ + เค—เฅ‡เคฎ เคธเฅเค•เฅเคฐเฅ€เคจ + เค—เฅ‡เคฎ เค•เคฟเคธ เคธเฅเค•เฅเคฐเฅ€เคจ เคชเคฐ เคฆเคฟเค–เคพเคเค + เคŠเคชเคฐเฅ€ เคธเฅเค•เฅเคฐเฅ€เคจ + เคจเคฟเคšเคฒเฅ€ เคธเฅเค•เฅเคฐเฅ€เคจ เคกเคพเค‰เคจเคฒเฅ‹เคก เค•เฅ‹เคˆ เคกเคพเค‰เคจเคฒเฅ‹เคก เคจเคนเฅ€เค‚ เคšเคฒ เคฐเคนเคพ เคนเฅˆเฅค Steam @@ -1805,6 +2059,20 @@ เคซเคผเฅเคฏเฅ‚เคฒ, t เคฎเฅเค–เฅเคฏ %1$s t เคฐเคฟเคœเคผเคฐเฅเคต %1$s t + เคซเคผเฅเคฐเฅ‡เคฎ เคธเคฎเคฏ + เคชเคฟเค›เคฒเฅ‡ %1$d เคธเฅ‡เค•เค‚เคก + เค”เคธเคค เคซเคผเฅเคฐเฅ‡เคฎ + 1 เคชเฅเคฐเคคเคฟเคถเคค เคจเฅเคฏเฅ‚เคจเคคเคฎ + 33 ms เคธเฅ‡ เค…เคงเคฟเค• เคธเคฎเคฏ เคตเคพเคฒเฅ‡ เคซเคผเฅเคฐเฅ‡เคฎ + %1$d / เคฎเคฟเคจเคŸ + %1$s เคธเฅ‡ เค–เฅ‡เคฒ เคฐเคนเฅ‡ เคนเฅˆเค‚ + %1$d เค•เฅ‹เคฐ, %2$s GHz เคคเค• + %1$d เค•เฅ‹เคฐ + เค—เฅ‡เคฎ + %1$d Hz เค•เคพ FPS + เคฒเคพเคฒ เคจเคฟเคถเคพเคจ เคตเคน เคฌเคฟเค‚เคฆเฅ เคนเฅˆ เคœเคนเคพเค HUD เคคเคพเคชเคฎเคพเคจ เค•เฅ‹ เคฒเคพเคฒ เคฐเค‚เค— เคฎเฅ‡เค‚ เคฆเคฟเค–เคพเคคเคพ เคนเฅˆเฅค + เคชเฅ‚เคฐเคพ เคกเคฟเคตเคพเค‡เคธ + เคฌเฅˆเคŸเคฐเฅ€ เคกเฅˆเคถเคฌเฅ‹เคฐเฅเคก เคกเฅ‡เคŸเคพ เคญเฅ‡เคœเฅ‡เค‚ เค‘เคŸเฅ‹เคฎเฅˆเคŸเคฟเค• เคฏเคนเคพเค‚ เคฆเคฟเค เคนเคฐ เค—เฅ‡เคฎ เค•เฅ‡ เคฒเคฟเค เค‡เคธเฅ‡ เคšเคพเคฒเฅ‚ เค•เคฐเคคเคพ เคนเฅˆ, เคฌเคพเคฆ เคฎเฅ‡เค‚ เคฎเคฟเคฒเคจเฅ‡ เคตเคพเคฒเฅ‡ เค—เฅ‡เคฎ เคญเฅ€ เคถเคพเคฎเคฟเคฒ เคนเฅˆเค‚เฅค เคœเคฟเคจ เค—เฅ‡เคฎ เค•เฅ‹ เค†เคช เคฌเค‚เคฆ เค•เคฐเคคเฅ‡ เคนเฅˆเค‚, เคตเฅ‡ เคฌเค‚เคฆ เคนเฅ€ เคฐเคนเคคเฅ‡ เคนเฅˆเค‚เฅค @@ -1828,6 +2096,10 @@ เค‡เคธ เค—เฅ‡เคฎ เค•เฅ‡ เคฒเคฟเค เคฎเคพเค‡เค• เคฌเค‚เคฆ เคนเฅˆเฅค เคฌเคพเคค เค•เคฐเคจเฅ‡ เค•เฅ‡ เคฒเคฟเค DroidDeck เค•เฅ€ Steam เคธเฅ‡เคŸเคฟเค‚เค— (เค‘เคกเคฟเคฏเฅ‹) เคฎเฅ‡เค‚ เคฎเคพเค‡เค•เฅเคฐเฅ‹เคซเคผเฅ‹เคจ เคšเคพเคฒเฅ‚ เค•เคฐเฅ‡เค‚ เค”เคฐ เค—เฅ‡เคฎ เคซเคฟเคฐ เคธเฅ‡ เคถเฅเคฐเฅ‚ เค•เคฐเฅ‡เค‚เฅค เคตเฅ‰เคฒเฅเคฏเฅ‚เคฎ %1$d%% เค‡เคจ-เค—เฅ‡เคฎ เค†เค‚เค•เคกเคผเฅ‡ + เคจเคฟเคšเคฒเฅ€ เคธเฅเค•เฅเคฐเฅ€เคจ HUD + เคนเคฐ เคŸเฅˆเคฌ เคชเคฐ เคธเฅเคŸเฅเคฐเคฟเคช + 1% เค”เคฐ 0.1% เคจเฅเคฏเฅ‚เคจเคคเคฎ + CPU เคคเคพเคชเคฎเคพเคจ FPS CPU GPU @@ -2000,6 +2272,7 @@ เคธเฅ‡เคถเคจ เคถเฅเคฐเฅ‚ เคนเฅ‹ เคฐเคนเคพ เคนเฅˆโ€ฆ %1$d:%2$02d เคฌเฅ€เคค เค—เคฏเคพ ยท เค…เคญเฅ€ เคญเฅ€ เค•เคพเคฎ เคนเฅ‹ เคฐเคนเคพ เคนเฅˆ Steam เค•เฅเคฒเคพเค‡เค‚เคŸ เค…เคชเคกเฅ‡เคŸ เคกเคพเค‰เคจเคฒเฅ‹เคก เคนเฅ‹ เคฐเคนเคพ เคนเฅˆ ยท %1$d%% + Steam เค•เฅเคฒเคพเค‡เค‚เคŸ เค…เคชเคกเฅ‡เคŸ เคฒเคพเค—เฅ‚ เค•เคฟเคฏเคพ เคœเคพ เคฐเคนเคพ เคนเฅˆโ€ฆ Steam เค•เฅเคฒเคพเค‡เค‚เคŸ เคกเคพเค‰เคจเคฒเฅ‹เคก เคนเฅ‹ เคฐเคนเคพ เคนเฅˆ ยท %1$s เคเค• เค•เคฎเฅเคชเฅˆเคŸเคฟเคฌเคฟเคฒเคฟเคŸเฅ€ เคŸเฅ‚เคฒ เค‡เค‚เคธเฅเคŸเฅ‰เคฒ เคชเคนเคฒเฅ‡ เคธเฅ‡ เคšเคฒ เคฐเคนเคพ เคนเฅˆ @@ -2076,11 +2349,29 @@ เคŸเฅ‚เคจ เค†เค‰เคŸเคฒเคพเค‡เคจ เค•เฅ‡ เคธเคพเคฅ เคถเคพเคฐเฅเคชเคจเคฟเค‚เค—เฅค Adreno GPU เคจเคนเฅ€เค‚ เคนเฅˆ + เคธเคฟเคธเฅเคŸเคฎ PowerVR เคกเฅเคฐเคพเค‡เคตเคฐ: เคธเค‚เค—เคคเคคเคพ เคกเคฟเคตเคพเค‡เคธ เค•เฅ‡ เค…เคจเฅเคธเคพเคฐ เค…เคฒเค—-เค…เคฒเค— เคนเฅ‹เคคเฅ€ เคนเฅˆ + เคชเฅเคฐเคพเคฏเฅ‹เค—เคฟเค•: RADV เคฏเคพ เคธเคฟเคธเฅเคŸเคฎ Xclipse เคกเฅเคฐเคพเค‡เคตเคฐ + เคธเคฟเคธเฅเคŸเคฎ PowerVR + เค‡เคธ GPU เค•เฅ‡ เค…เค‚เคคเคฐเฅเคจเคฟเคนเคฟเคค เคกเฅเคฐเคพเค‡เคตเคฐเฅ‹เค‚ เค•เคพ เค‰เคชเคฏเฅ‹เค— เค•เคฐเคคเคพ เคนเฅˆ + เคฐเคจเคŸเคพเค‡เคฎ เค”เคฐ เคกเคฟเคธเฅเคชเฅเคฒเฅ‡ เค•เฅ‡ เคฒเคฟเค เคธเคฟเคธเฅเคŸเคฎ เค•เคพ PowerVR เคกเฅเคฐเคพเค‡เคตเคฐ เคšเฅเคจเคพ เค—เคฏเคพ เคนเฅˆเฅค + เค‡เคธ Mali เค•เฅ‡ เคฒเคฟเค เค…เคญเฅ€ เค•เฅ‹เคˆ เค“เคชเคจ เคกเฅเคฐเคพเค‡เคตเคฐ เคจเคนเฅ€เค‚ เคนเฅˆ: Mali เคฌเฅเคฐเคฟเคœ เคšเคพเคฒเฅ‚ เคนเฅˆเฅค + เคฏเคน เค—เฅˆเคฐ-Snapdragon เคŸเฅ‡เคธเฅเคŸ เคฌเคฟเคฒเฅเคก เคนเฅˆ: เคฏเคนเคพเค เค•เฅ‡ เค†เคงเคฟเค•เคพเคฐเคฟเค• เคฌเคฟเคฒเฅเคก เค•เฅ‡เคตเคฒ Adreno เคชเคฐ เคšเคฒเคคเฅ‡ เคนเฅˆเค‚, เค‡เคธเคฒเคฟเค เค‰เคจเฅเคนเฅ‡เค‚ เค‡เคธเค•เฅ‡ เคŠเคชเคฐ เค‡เค‚เคธเฅเคŸเฅ‰เคฒ เคจเคนเฅ€เค‚ เค•เคฟเคฏเคพ เคœเคพเคคเคพเฅค เคจเค เคŸเฅ‡เคธเฅเคŸ เคฌเคฟเคฒเฅเคก github.com/The412Banner/droiddeck-nonadreno-drivers เคชเคฐ เคฎเคฟเคฒเคคเฅ‡ เคนเฅˆเค‚เฅค + เคชเคฟเค›เคฒเคพ เคธเคคเฅเคฐ เค‡เคธเคฒเคฟเค เค–เคคเฅเคฎ เคนเฅเค† เค•เฅเคฏเฅ‹เค‚เค•เคฟ Android เคจเฅ‡ เคฎเฅ‡เคฎเฅ‹เคฐเฅ€ เค–เคพเคฒเฅ€ เค•เคฐเคจเฅ‡ เค•เฅ‡ เคฒเคฟเค DroidDeck เค•เฅ‹ เคฌเค‚เคฆ เค•เคฐ เคฆเคฟเคฏเคพ เคฅเคพ, เคฏเคน เค•เฅ‹เคˆ เค•เฅเคฐเฅˆเคถ เคจเคนเฅ€เค‚ เคฅเคพเฅค เคฆเฅ‚เคธเคฐเฅ‡ เคเคช เคฌเค‚เคฆ เค•เคฐเฅ‡เค‚ เคฏเคพ เค—เฅ‡เคฎ เค•เฅ€ เคŸเฅ‡เค•เฅเคธเคšเคฐ เคธเฅ‡เคŸเคฟเค‚เค— เค•เคฎ เค•เคฐเฅ‡เค‚, เคซเคฟเคฐ เคฆเฅ‹เคฌเคพเคฐเคพ เค•เฅ‹เคถเคฟเคถ เค•เคฐเฅ‡เค‚เฅค + Mali (Venus) + Mali เคฌเฅเคฐเคฟเคœ + เค‡เคธ Mali เค•เฅ‡ เคฒเคฟเค เค…เคญเฅ€ เค•เฅ‹เคˆ เค“เคชเคจ เคกเฅเคฐเคพเค‡เคตเคฐ เคจเคนเฅ€เค‚ เคนเฅˆ: เคซเคผเฅ‹เคจ เค•เฅ‡ เค…เคชเคจเฅ‡ เคกเฅเคฐเคพเค‡เคตเคฐ เคชเคฐ %1$s เค‡เคธเฅเคคเฅ‡เคฎเคพเคฒ เคนเฅ‹เคคเคพ เคนเฅˆเฅค + %1$s เค…เคญเฅ€ เคคเค• เคœเคพเคฐเฅ€ เคจเคนเฅ€เค‚ เคนเฅเค† เคนเฅˆ: เคคเคฌ เคคเค• %2$s เค‡เคธเฅเคคเฅ‡เคฎเคพเคฒ เคนเฅ‹เคคเคพ เคนเฅˆเฅค + %1$s เค‰เคชเคฒเคฌเฅเคง เคจเคนเฅ€เค‚ เคนเฅˆ, เค”เคฐ เค‡เคธ เคซเคผเฅ‹เคจ เค•เคพ เคกเฅเคฐเคพเค‡เคตเคฐ Vulkan %2$s เคฌเคคเคพเคคเคพ เคนเฅˆ (Venus เค•เฅ‹ 1.2 เคšเคพเคนเคฟเค): Mali เคฌเฅเคฐเคฟเคœ เค‡เคธเฅเคคเฅ‡เคฎเคพเคฒ เคนเฅ‹เคคเคพ เคนเฅˆเฅค + %1$s เค…เคญเฅ€ เคคเค• เคœเคพเคฐเฅ€ เคจเคนเฅ€เค‚ เคนเฅเค† เคนเฅˆ: เคคเคฌ เคคเค• Mali เคฌเฅเคฐเคฟเคœ เคšเคพเคฒเฅ‚ เคฐเคนเฅ‡เค—เคพเฅค + เค•เคคเคพเคฐ เคฎเฅ‡เค‚: %1$s (เค…เคฒเค— เคฐเคจเคŸเคพเค‡เคฎ เคกเฅเคฐเคพเค‡เคตเคฐ เค•เฅ€ เคชเฅเคฐเคคเฅ€เค•เฅเคทเคพ เคฎเฅ‡เค‚) + เคธเคฟเคธเฅเคŸเคฎ เค•เคพ PowerVR เคฐเคจเคŸเคพเค‡เคฎ DXVK เค‰เคชเคฒเคฌเฅเคง เค•เคฐเคพเคคเคพ เคนเฅˆเฅค เคฆเฅ‚เคธเคฐเฅ‡ DXVK เคชเฅˆเค•เฅ‡เคœ เคธเคนเฅ‡เคœเฅ‡ เคœเคพ เคธเค•เคคเฅ‡ เคนเฅˆเค‚, เคฒเฅ‡เค•เคฟเคจ เค‡เคธ เคกเฅเคฐเคพเค‡เคตเคฐ เค•เฅ‡ เคธเคพเคฅ เคฒเคพเค—เฅ‚ เคจเคนเฅ€เค‚ เคนเฅ‹เคคเฅ‡เฅค เคธเคฎเคฐเฅเคฅเคฟเคค เคเค•เฅเคธเคชเฅ‡เคฐเคฟเคฎเฅ‡เค‚เคŸเคฒ: เค‡เคธเค•เฅ‡ เคกเฅเคฐเคพเค‡เคตเคฐ เคŸเฅ‡เคธเฅเคŸ เคฌเคฟเคฒเฅเคก เคนเฅˆเค‚ เคชเฅเคฐเคฏเฅ‹เค—เคพเคคเฅเคฎเค• Adreno 850 เคธเคฎเคฐเฅเคฅเคจ: เค•เคฎเฅเคชเฅˆเคŸเคฟเคฌเคฒ เคชเฅเคฐเคฏเฅ‹เค—เคพเคคเฅเคฎเค• เคกเคฟเคธเฅเคชเฅเคฒเฅ‡ เค”เคฐ เค—เฅ‡เคฎ เคกเฅเคฐเคพเค‡เคตเคฐ เคšเคพเคนเคฟเค; เค‡เคธ เคกเคฟเคตเคพเค‡เคธ เคชเคฐ เคœเคพเค‚เคšเคพ เคจเคนเฅ€เค‚ เค—เคฏเคพ เคœเคพเค‚เคšเฅ‡ เค—เค เคนเคพเคฐเฅเคกเคตเฅ‡เคฏเคฐ เคธเฅ‡ เคจเฅ€เคšเฅ‡ (Adreno 725 เค”เคฐ เคจเค): เคฏเคน เคถเคพเคฏเคฆ เคจ เคšเคฒเฅ‡ เคธเคฎเคฐเฅเคฅเคฟเคค เคจเคนเฅ€เค‚: เค‡เคธ GPU เค•เฅ‡ เคฒเคฟเค เค•เฅ‹เคˆ เคธเค‚เค—เคค เค—เฅเคฐเคพเคซเคผเคฟเค•เฅเคธ เคฌเฅˆเค•เคเค‚เคก เค‰เคชเคฒเคฌเฅเคง เคจเคนเฅ€เค‚ เคนเฅˆ + Mali เคฌเฅเคฐเคฟเคœ เคธเฅ‡ เคนเฅ‹เค•เคฐ, เคซเคผเฅ‹เคจ เค•เฅ‡ เค…เคชเคจเฅ‡ Vulkan เคกเฅเคฐเคพเค‡เคตเคฐ เคชเคฐ เคšเคฒเคคเคพ เคนเฅˆ + Mali เคฌเฅเคฐเคฟเคœ เคฌเค‚เคฆ เคนเฅ‹เคจเฅ‡ เคชเคฐ เคฏเคน เคธเคฎเคฐเฅเคฅเคฟเคค เคจเคนเฅ€เค‚ เคนเฅˆ: Turnip เค•เฅ‡ เคฒเคฟเค Adreno (Snapdragon) GPU เคœเคผเคฐเฅ‚เคฐเฅ€ เคนเฅˆ GitHub เค•เฅ€ เคฐเฅ‡เคŸ เคฒเคฟเคฎเคฟเคŸ เคชเคพเคฐ เคนเฅ‹ เค—เคˆ - เคฌเคพเคฆ เคฎเฅ‡เค‚ เคซเคฟเคฐ เค•เฅ‹เคถเคฟเคถ เค•เคฐเฅ‡เค‚ GitHub เคจเฅ‡ HTTP %1$d เคœเคตเคพเคฌ เคฆเคฟเคฏเคพ @@ -2189,7 +2480,6 @@ เคธเฅเคŸเฅ‹เคฐ Steam เค•เคธเฅเคŸเคฎ - เคธเฅเคŸเฅ‹เคฐ เคกเคพเค‰เคจเคฒเฅ‹เคก เคธเฅเคชเฅ€เคก เคŸเคฟเคฏเคฐ เคฌเฅˆเคฒเฅ‡เค‚เคธเฅเคก เคซเคผเคพเคธเฅเคŸ @@ -2228,6 +2518,7 @@ เคฆเฅ‚เคธเคฐเฅ‡ Battle.net เคกเคพเค‰เคจเคฒเฅ‹เคก เค•เคพ เค‡เค‚เคคเคœเคผเคพเคฐโ€ฆ Battle.net เค–เฅ‹เคฒเฅ‡เค‚ เค”เคฐ เคเค• เคฌเคพเคฐ เคธเคพเค‡เคจ เค‡เคจ เค•เคฐเฅ‡เค‚, เคซเคฟเคฐ เค‡เคธเค•เฅ‡ เค—เฅ‡เคฎ เคฏเคนเคพเค เคธเฅ‡ เค‡เค‚เคธเฅเคŸเฅ‰เคฒ เค•เคฐเฅ‡เค‚เฅค Blizzard เค•เคพ เคกเคพเค‰เคจเคฒเฅ‹เคกเคฐ เคฐเฅเค• เค—เคฏเคพ: %1$s + Blizzard เค•เคพ เคกเคพเค‰เคจเคฒเฅ‹เคกเคฐ เค†เค—เฅ‡ เคจเคนเฅ€เค‚ เคฌเคขเคผ เคฐเคนเคพเฅค Blizzard เคคเฅเคฐเฅเคŸเคฟ %1$s เค…เคชเคกเฅ‡เคŸ เค•เคฐเฅ‡เค‚ Blizzard เค•เฅ‡ เค—เฅ‡เคฎ @@ -2235,6 +2526,7 @@ เคฌเคพเคงเคฟเคค เค‡เค‚เคธเฅเคŸเฅ‰เคฒ ยท %1$s เคฎเฅเคซเคผเฅเคค เคฎเฅ‡เค‚ เคชเคพเคเค‚ + เคฒเคพเค‡เคฌเฅเคฐเฅ‡เคฐเฅ€ เคฎเฅ‡เค‚ เคœเฅ‹เคกเคผเคพ เคœเคพ เคฐเคนเคพ เคนเฅˆโ€ฆ %1$s เคชเคฐ เคฆเฅ‡เค–เฅ‡เค‚ เค–เคฐเฅ€เคฆเฅ‡เค‚ ยท %1$s เค‡เค‚เคธเฅเคŸเฅ‰เคฒ เคนเฅˆ @@ -2281,6 +2573,12 @@ เค•เฅเคฐเคฎเคฌเคฆเฅเคง เค•เคฐเฅ‡เค‚ เคธเคพเค‡เคกเคฌเคพเคฐ เคฒเฅ‡เคฌเคฒ เคธเคพเค‡เคกเคฌเคพเคฐ เค†เค‡เค•เคจ เค•เฅ‡ เคจเฅ€เคšเฅ‡ เคจเคพเคฎ เคฆเคฟเค–เคพเคเค‚เฅค เคชเคคเคฒเฅ‡ เคธเคพเค‡เคกเคฌเคพเคฐ เค•เฅ‡ เคฒเคฟเค เคฌเค‚เคฆ เค•เคฐเฅ‡เค‚เฅค + เคเคœเฅ‡เค‚เคŸ เคชเฅ‡เคŸ + DeeDee เคฒเฅ‰เคจเฅเคšเคฐ เค”เคฐ เค—เฅ‡เคฎเฅเคธ เคชเคฐ เคฆเคฟเค–เคพเคˆ เคฆเฅ‡เคคเคพ เคนเฅˆ เค”เคฐ เคฌเคคเคพเคคเคพ เคนเฅˆ เค•เคฟ เคเคœเฅ‡เค‚เคŸ เค•เฅเคฏเคพ เค•เคฐ เคฐเคนเคพ เคนเฅˆเฅค + เค…เคจเฅเคฏ เคเคชเฅเคธ เค•เฅ‡ เคŠเคชเคฐ เคฆเคฟเค–เคพเคเค + DeeDee เค•เฅ‹ เคนเคฐ เคเคช เค•เฅ‡ เคŠเคชเคฐ เคฆเคฟเค–เคจเฅ‡ เคฆเฅ‡เค‚ เค”เคฐ เคตเคนเฅ€เค‚ เค‡เคธเค•เฅ€ เคšเฅˆเคŸ เค–เฅ‹เคฒเฅ‡เค‚ + เค…เคจเฅเคฎเคคเคฟ เคฆเฅ‡เค‚ + DeeDee เค•เฅ‡ เคธเคพเคฅ เคšเฅˆเคŸ เค•เคฐเฅ‡เค‚ เคกเคฟเคธเฅเคชเฅเคฒเฅ‡ เคฌเคกเคผเฅ‡ เค•เคพเคฐเฅเคก เค›เฅ‹เคŸเฅ‡ เค•เคพเคฐเฅเคก @@ -2565,7 +2863,14 @@ %1$s ยท เคฐเฅ€เคธเฅเคŸเคพเคฐเฅเคŸ เคฌเคพเค•เฅ€ เคฏเคน เคกเคฟเคตเคพเค‡เคธ %1$s เคนเคŸเคพเคเค‚? - เคกเคพเคฏเค—เฅเคจเฅ‹เคธเฅเคŸเคฟเค•เฅเคธ + เคกเฅ‡เคตเคฒเคชเคฐ + เคฌเคฟเคฒเฅเคก เคฒเฅ‡เคฌเคฒ เคตเฅ‰เคŸเคฐเคฎเคพเคฐเฅเค• + เคธเฅเค•เฅเคฐเฅ€เคจ เคชเคฐ เคŸเฅ‡เคธเฅเคŸ เคฏเคพ Lab เคฌเคฟเคฒเฅเคก เคฒเฅ‡เคฌเคฒ เคฆเคฟเค–เคพเคเคเฅค เคกเคฟเคซเคผเฅ‰เคฒเฅเคŸ เคฐเฅ‚เคช เคธเฅ‡ เคšเคพเคฒเฅ‚เฅค + เคกเคพเคฏเค—เฅเคจเฅ‰เคธเฅเคŸเคฟเค• เคฌเค‚เคกเคฒ เคถเฅ‡เคฏเคฐ เค•เคฐเฅ‡เค‚ + เคธเคคเฅเคฐ เค”เคฐ เคกเคฟเคตเคพเค‡เคธ + เค—เฅเคฐเคพเคซเคผเคฟเค•เฅเคธ + เค—เฅ‡เคฎ เค”เคฐ เคธเค‚เค—เคคเคคเคพ + เคธเคญเฅ€ เคฌเค‚เคกเคฒ เค–เฅ‡เคฒเคจเฅ‡ เค•เฅ‡ เคฒเคฟเค เคคเฅˆเคฏเคพเคฐ เค…เคญเฅ€ เค–เฅ‡เคฒเคจเฅ‡ เค•เฅ‡ เคฒเคฟเค เคคเฅˆเคฏเคพเคฐ เคจเคนเฅ€เค‚ เคฐเคจเคŸเคพเค‡เคฎ %1$s @@ -2604,6 +2909,9 @@ Stores เคธเฅ‡เคŸเคฟเค‚เค— เคฎเฅ‡เค‚ GOG เค‰เคชเคฒเคฌเฅเคงเคฟเคฏเคพเค‚ เคšเคพเคฒเฅ‚ เค•เคฐเฅ‡เค‚ เค‰เคชเคฒเคฌเฅเคงเคฟเคฏเคพเค‚ เค‰เคชเคฒเคฌเฅเคง เคจเคนเฅ€เค‚; เคธเฅ‡เคถเคจ เคฒเฅ‰เค— เคฆเฅ‡เค–เฅ‡เค‚ เค‰เคชเคฒเคฌเฅเคงเคฟ เค…เคจเคฒเฅ‰เค• เคนเฅเคˆ + Mali (Venus): เคฌเค‚เคฆ + Mali (Venus): เคšเคพเคฒเฅ‚ + %1$s เคชเคฐ เคฎเฅŒเคœเฅ‚เคฆ เคกเฅเคฐเคพเค‡เคตเคฐ Vulkan %2$s เคฌเคคเคพเคคเคพ เคนเฅˆเฅค Mali (Venus) เค•เฅ‹ Vulkan 1.2 เคฏเคพ เคจเคฏเคพ เคšเคพเคนเคฟเค (เคชเฅเคฐเคพเคจเฅ‡ เคชเคฐ gamescope เคถเฅเคฐเฅ‚ เคจเคนเฅ€เค‚ เคนเฅ‹เคคเคพ), เค‡เคธเคฒเคฟเค เคธเคคเฅเคฐ Venus เค›เฅ‹เคกเคผเค•เคฐ เค‰เคธเค•เฅ€ เคœเค—เคน PanVK เคกเฅเคฐเคพเค‡เคตเคฐเฅ‹เค‚ เค•เฅ€ เคœเฅ‹เคกเคผเฅ€ เค‡เคธเฅเคคเฅ‡เคฎเคพเคฒ เค•เคฐเคคเฅ‡ เคนเฅˆเค‚เฅค เคชเฅ‡เคธเฅเคŸ เค•เคฐเฅ‡เค‚ เคฌเคพเคฏเคพเค‚ เคธเฅเคŸเคฟเค• เคฆเคพเคฏเคพเค‚ เคธเฅเคŸเคฟเค• @@ -2890,7 +3198,7 @@ เคซเคผเฅ‹เคฒเฅเคกเคฐ เคšเฅเคจเฅ‡เค‚โ€ฆ SD เค•เคพเคฐเฅเคก เคฏเคพ USB เคกเฅเคฐเคพเค‡เคต เคชเคฐ เค•เฅ‹เคˆ เคญเฅ€ เคซเคผเฅ‹เคฒเฅเคกเคฐ เค‡เคธเฅเคคเฅ‡เคฎเคพเคฒ เค•เคฐเฅ‡เค‚ เค—เฅ‡เคฎ เคšเฅเคจเฅ€ เค—เคˆ เคœเค—เคน เค•เฅ‡ เค…เค‚เคฆเคฐ เคเค• Games เคซเคผเฅ‹เคฒเฅเคกเคฐ เคฎเฅ‡เค‚ เคœเคพเคคเฅ‡ เคนเฅˆเค‚เฅค เคฎเฅŒเคœเฅ‚เคฆเคพ เค—เฅ‡เคฎ เคฎเฅ‚เคต เคจเคนเฅ€เค‚ เค•เคฟเค เคœเคพเคคเฅ‡เฅค - เค•เคนเคพเค เคœเคพเคคเคพ เคนเฅˆ + เค•เฅเคฏเคพ เคœเค—เคน เค˜เฅ‡เคฐ เคฐเคนเคพ เคนเฅˆ Steam เค—เฅ‡เคฎ เค—เฅ‡เคฎ เคกเฅ‡เคŸเคพ เคชเฅเคฐเฅ€เคซเคผเคฟเค•เฅเคธ %1$s ยท เคตเคฐเฅเค•เคถเฅ‰เคช %2$s ยท เคถเฅ‡เคกเคฐ %3$s @@ -2959,6 +3267,7 @@ เค—เฅ‡เคฎ เค•เฅ‹ เคœเคผเคฐเฅ‚เคฐเฅ€ VC++ เค”เคฐ DirectX เค‡เค‚เคธเฅเคŸเฅ‰เคฒ Linux x86 เค—เฅ‡เคฎ เคšเคฒเคพเคคเคพ เคนเฅˆ Steam เคŸเฅ‚เคฒ + Steam เค‡เคธเฅ‡ เค‰เคจ เค—เฅ‡เคฎเฅเคธ เค•เฅ‡ เคฒเคฟเค เคกเคพเค‰เคจเคฒเฅ‹เคก เค•เคฐเคคเคพ เคนเฅˆ เคœเคฟเคจเคฎเฅ‡เค‚ เคเค‚เคŸเฅ€-เคšเฅ€เคŸ เคถเคพเคฎเคฟเคฒ เคนเฅˆ, เคญเคฒเฅ‡ เคนเฅ€ เคตเคน เคฌเค‚เคฆ เคนเฅ‹เฅค เค‡เคธเฅ‡ เคนเคŸเคพเคจเฅ‡ เคธเฅ‡ เค‰เคจเค•เฅ€ เค‡เค‚เคธเฅเคŸเฅ‰เคฒเฅ‡เคถเคจ 0% เคชเคฐ เคฐเฅเค• เคœเคพเคคเฅ€ เคนเฅˆเฅค DroidDeck เค‡เคธ เคฐเคจเคŸเคพเค‡เคฎ เค•เฅ‡ เคฌเคฟเคจเคพ เค—เฅ‡เคฎ เคšเคฒเคพเคคเคพ เคนเฅˆ Proton x86, เคœเคฟเคธเฅ‡ DroidDeck เคจเคนเฅ€เค‚ เคšเคฒเคพ เคธเค•เคคเคพ เคธเคญเฅ€ เค—เฅ‡เคฎ เค•เฅ‡ เคฒเคฟเค เคกเคฟเคซเคผเฅ‰เคฒเฅเคŸ @@ -3022,6 +3331,19 @@ เคฐเค–เคพ เค—เคฏเคพ เค—เฅˆเคฐ-Steam เค—เฅ‡เคฎ เค”เคฐ เคธเคพเคเคพ Steam เคชเฅเคฐเฅ€เคซเคผเคฟเค•เฅเคธ เคธเฅเคŸเฅ‹เคฐ เคธเฅ‡ เคฏเคพ เคนเคพเคฅ เคธเฅ‡ เคœเฅ‹เคกเคผเฅ‡ เค—เฅ‡เคฎ เค•เฅ‡ เคชเฅเคฐเฅ€เคซเคผเคฟเค•เฅเคธ + Steam เค•เคพ เคธเคพเคเคพ เคชเฅเคฐเฅ€เคซเคผเคฟเค•เฅเคธ + Steam เคฏเคนเคพเค เค…เคชเคจเฅ‡ Windows เคนเฅ‡เคฒเฅเคชเคฐ เคšเคฒเคพเคคเคพ เคนเฅˆ + เค‡เคธเฅ‡ เคกเคฟเคฒเฅ€เคŸ เค•เคฐเคคเคพ เคนเฅˆ (%1$s)เฅค เค…เค—เคฒเฅ€ เคฌเคพเคฐ เคœเคผเคฐเฅ‚เคฐเคค เคชเคกเคผเคจเฅ‡ เคชเคฐ Steam เคจเคฏเคพ เคฌเคจเคพ เคฒเฅ‡เคคเคพ เคนเฅˆเฅค + เคเค• เคธเฅเคŸเฅ‹เคฐ เคเคช เค”เคฐ เค‰เคธเค•เฅ‡ เคธเคพเคฅ เคšเคฒเคจเฅ‡ เคตเคพเคฒเฅ‡ เค—เฅ‡เคฎ + %1$s เคฆเฅเคตเคพเคฐเคพ เค‡เคธเฅเคคเฅ‡เคฎเคพเคฒ + เค—เฅˆเคฐ-Steam เค—เฅ‡เคฎ %1$s + เค•เคฟเคธเฅ€ เค—เฅ‡เคฎ เคธเฅ‡ เคฎเฅ‡เคฒ เคจเคนเฅ€เค‚ เค–เคพเคคเคพ, เค‡เคธเคฒเคฟเค เคฐเค–เคพ เคœเคพเคคเคพ เคนเฅˆ + เคšเฅเคจเฅ‡ เค—เค เคนเคŸเคพเคเค ยท %1$s + เคšเฅเคจเฅ‡ เค—เค เค…เคจเค‡เค‚เคธเฅเคŸเฅ‰เคฒ เค•เคฐเฅ‡เค‚ ยท %1$s + Wine เคชเฅเคฐเฅ€เคซเคผเคฟเค•เฅเคธ + เค‡เคจเค•เฅ‡ เค…เค‚เคฆเคฐ เค•เฅ‡ เคธเฅ‡เคต เค”เคฐ เคธเฅ‡เคŸเคฟเค‚เค— เค–เฅ‹ เคœเคพเคคเฅ‡ เคนเฅˆเค‚; Steam Cloud เคธเฅ‡เคต เค†เคชเค•เฅ‡ เค…เค•เคพเค‰เค‚เคŸ เคฎเฅ‡เค‚ เคฐเคนเคคเฅ‡ เคนเฅˆเค‚เฅค + เคถเฅ‡เคกเคฐ เค•เฅˆเคถ + เคชเฅเคฐเฅ€เคซเคผเคฟเค•เฅเคธ %1$s ยท เคถเฅ‡เคกเคฐ %2$s เคกเคพเค‰เคจเคฒเฅ‹เคก เค•เคฟเค เคชเฅˆเค•เฅ‡เคœ เคฐเค–เฅ‡ เค—เค เคฎเฅ‚เคฒ เค•เฅ‹เคˆ เค•เฅ‰เคฎเฅเคชเฅ‹เคจเฅ‡เค‚เคŸ เคชเฅˆเค•เฅ‡เคœ เคกเคพเค‰เคจเคฒเฅ‹เคก เคจเคนเฅ€เค‚ เคนเฅˆเฅค @@ -3056,6 +3378,8 @@ DroidDeck ยท %1$d fps 60 fps เคœเคผเฅเคฏเคพเคฆเคพ เคธเฅเคฎเฅ‚เคฅ เคฆเคฟเค–เคคเคพ เคนเฅˆ, เคฒเฅ‡เค•เคฟเคจ Steam เคถเฅเคฐเฅ‚ เคนเฅ‹เคคเฅ‡ เคธเคฎเคฏ CPU เคœเคผเฅเคฏเคพเคฆเคพ เค‡เคธเฅเคคเฅ‡เคฎเคพเคฒ เค•เคฐเคคเคพ เคนเฅˆเฅค Steam เค•เฅ€ เค…เคชเคจเฅ€ เคธเฅ‡เคŸเคฟเค‚เค—เฅเคธ เคฎเฅ‡เค‚ เคšเฅเคจเคพ เค—เคฏเคพ เคตเฅ€เคกเคฟเคฏเฅ‹ เคฏเคนเคพเค เคญเฅ€ เคฆเคฟเค–เคคเคพ เคนเฅˆเฅค เค†เคตเคพเคœเคผ + เคฌเฅ‚เคŸ เคฎเฅ‚เคตเฅ€ เค›เฅ‹เคกเคผเฅ‡เค‚ + Steam เค•เฅ€ เคธเฅเคŸเคพเคฐเฅเคŸเค…เคช เคฎเฅ‚เคตเฅ€ เค•เฅ‡ เคฐเฅ‚เคช เคฎเฅ‡เค‚ 0.1 เคธเฅ‡เค•เค‚เคก เค•เฅ€ เค•เคพเคฒเฅ€ เค•เฅเคฒเคฟเคช เค‡เคธเฅเคคเฅ‡เคฎเคพเคฒ เค•เคฐเฅ‡เค‚เฅค เค…เค—เคฒเฅ‡ เคธเคคเฅเคฐ เคธเฅ‡ เคฒเคพเค—เฅ‚ เคนเฅ‹เค—เคพเฅค เค…เคชเคจเคพ เคตเฅ€เคกเคฟเคฏเฅ‹ MP4, MOV, MKV เคฏเคพ WebM. เคฆเฅ‚เคธเคฐเฅ‡ เคซเคผเฅ‰เคฐเฅเคฎเฅˆเคŸ เค”เคฐ %1$d MB เคธเฅ‡ เคฌเคกเคผเฅ€ เคซเคผเคพเค‡เคฒเฅ‡เค‚ เคกเคฟเคตเคพเค‡เคธ เคชเคฐ 720p WebM เคฎเฅ‡เค‚ เคฌเคฆเคฒเฅ€ เคœเคพเคคเฅ€ เคนเฅˆเค‚, %2$d เคธเฅ‡เค•เค‚เคก เคคเค•เฅค เค‡เค‚เคชเฅ‹เคฐเฅเคŸ เค•เคฐเฅ‡เค‚ @@ -3517,6 +3841,7 @@ Alt+Tab, Win เค•เฅเค‚เคœเฅ€ เค”เคฐ เคนเฅ‹เคฎ เคฌเคŸเคจ เค•เฅ‹ Android เค•เฅ‡ เคฌเคœเคพเคฏ เคธเค•เฅเคฐเคฟเคฏ DroidDeck เคธเคคเฅเคฐ เคฎเฅ‡เค‚ เคฐเค–เคคเคพ เคนเฅˆเฅค Setup โ†’ Steam เค‡เค‚เคŸเฅ€เค—เฅเคฐเฅ‡เคถเคจ เคฎเฅ‡เค‚ เคฌเฅเคฐเคพเค‡เคŸเคจเฅ‡เคธ เคšเคพเคฒเฅ‚ เค•เคฐเฅ‡เค‚ Mali เคฌเฅเคฐเคฟเคœ: เคฌเค‚เคฆ + %1$s Mali เคฌเฅเคฐเคฟเคœ เค‡เคธเฅเคคเฅ‡เคฎเคพเคฒ เคจเคนเฅ€เค‚ เค•เคฐ เคธเค•เคคเคพ (เค‡เคธเฅ‡ เคเคธเคพ Mali GPU เคšเคพเคนเคฟเค เคœเคฟเคธเค•เฅ‡ เคชเคพเคธ เคธเคฟเคธเฅเคŸเคฎ เคกเฅเคฐเคพเค‡เคตเคฐ เค•เคพ เคฐเคพเคธเฅเคคเคพ เคจ เคนเฅ‹), เค‡เคธเคฒเคฟเค เคฏเคนเคพเค เค‡เคธ เคธเฅเคตเคฟเคš เค•เคพ เค•เฅ‹เคˆ เค…เคธเคฐ เคจเคนเฅ€เค‚ เคนเฅˆเฅค Mali เคฌเฅเคฐเคฟเคœ: เคšเคพเคฒเฅ‚ %1$s Adreno เคจเคนเฅ€เค‚ เคนเฅˆเฅค เคชเฅเคฐเคพเคฏเฅ‹เค—เคฟเค• Vulkan เคฌเฅเคฐเคฟเคœ เคšเคพเคฒเฅ‚ เคนเฅˆ: เคธเคคเฅเคฐ เคซเคผเฅ‹เคจ เค•เฅ‡ เค…เคชเคจเฅ‡ เคกเฅเคฐเคพเค‡เคตเคฐ เคธเฅ‡ เคกเฅเคฐเฅ‰ เค•เคฐเคคเคพ เคนเฅˆเฅค เคฌเค— เค•เฅ€ เค‰เคฎเฅเคฎเฅ€เคฆ เคฐเค–เฅ‡เค‚; เคธเคคเฅเคฐ เคฒเฅ‰เค— เคญเฅ‡เคœเฅ‡เค‚เฅค เคธเฅเคฐเค•เฅเคทเคฟเคค เคฎเฅ‹เคก @@ -3542,6 +3867,25 @@ เคฌเคพเคฆ เคฎเฅ‡เค‚ เคฒเฅ‡ เคœเคพเคเค เคตเคฟเคœเฅ‡เคŸ เคธเฅ‡เคŸเคฟเค‚เค— เคตเคฟเคœเฅ‡เคŸ เคนเคŸเคพเคเค + เคฆเคฟเค–เคพเคตเคŸ + เค†เค‡เค•เคจ เคชเฅˆเค• + เคธเคฟเคธเฅเคŸเคฎ เคกเคฟเคซเคผเฅ‰เคฒเฅเคŸ + เคเคช เค•เฅ‡ เคฐเค‚เค— เค•เคพ เคฌเฅˆเค•เค—เฅเคฐเคพเค‰เค‚เคก + เค†เค‡เค•เคจ เค•เคพ เค†เค•เคพเคฐ + เค›เฅ‹เคŸเคพ + เคฎเคงเฅเคฏเคฎ + เคฌเคกเคผเคพ + เคเคช เค•เฅ‡ เคจเคพเคฎ เค›เคฟเคชเคพเคเค‚ + เคธเฅเคชเฅ‡เคธเคฟเค‚เค— + เค•เคฎ + เคธเคพเคฎเคพเคจเฅเคฏ + เคœเคผเฅเคฏเคพเคฆเคพ + เค†เค‡เค•เคจ เคฌเคฆเคฒเฅ‡เค‚ + เค†เค‡เค•เคจ เคฐเฅ€เคธเฅ‡เคŸ เค•เคฐเฅ‡เค‚ + เค†เค‡เค•เคจ เค–เฅ‹เคœเฅ‡เค‚ + เค†เค‡เค•เคจ เคฒเฅ‹เคก เคนเฅ‹ เคฐเคนเฅ‡ เคนเฅˆเค‚โ€ฆ + เค•เฅ‹เคˆ เค†เค‡เค•เคจ เคจเคนเฅ€เค‚ เคฎเคฟเคฒเคพเฅค + เค•เคธเฅเคŸเคฎ เค†เค‡เค•เคจ เคซเคผเฅ‹เคฒเฅเคกเคฐ เคฎเฅ‡เค‚ เคœเฅ‹เคกเคผเฅ‡เค‚ เคจเคฏเคพ เคซเคผเฅ‹เคฒเฅเคกเคฐ เคซเคผเฅ‹เคฒเฅเคกเคฐ เคธเฅ‡ เคนเคŸเคพเคเค @@ -3657,5 +4001,81 @@ เคฏเคน เคฒเฅ‡เค†เค‰เคŸ เค‡เคฎเฅเคชเฅ‹เคฐเฅเคŸ เคจเคนเฅ€เค‚ เค•เคฟเคฏเคพ เคœเคพ เคธเค•เคพ เค•เคฟเคฐเคฎเคฟเคœเคผเฅ€ เคฌเคฐเฅเคซ + เคฒเคพเคฒ เคฐเค‚เค— เค•เฅ€ เคเคฒเค•เคฟเคฏเฅ‹เค‚ เคตเคพเคฒเฅ€ เคธเคซเคผเฅ‡เคฆ เคธเคคเคนเฅ‡เค‚เฅค + เคธเคพเค‰เค‚เคกเคŸเฅเคฐเฅˆเค• + เคธเค‚เค—เฅ€เคค + เคชเฅเคฒเฅ‡เคฌเฅˆเค• เคตเคฟเค•เคฒเฅเคช + เคชเคธเค‚เคฆเฅ€เคฆเคพ + เค•เคฒเฅ‡เค•เฅเคถเคจ + เค…เคญเฅ€ เคคเค• เค•เฅ‹เคˆ เค•เคฒเฅ‡เค•เฅเคถเคจ เคจเคนเฅ€เค‚ เคนเฅˆเฅค เคฌเคจเคพเคจเฅ‡ เค•เฅ‡ เคฒเคฟเค เคฌเฅเค•เคฎเคพเคฐเฅเค• เค†เค‡เค•เคจ เคชเคฐ เคŸเฅˆเคช เค•เคฐเฅ‡เค‚เฅค + เคธเคนเฅ‡เคœเฅ‡ เค—เค + เค•เคฒเฅ‡เค•เฅเคถเคจ เคฌเคจเคพเคเค‚ + เค…เคชเคจเฅ‡ เคธเฅ‡เคต เคตเฅเคฏเคตเคธเฅเคฅเคฟเคค เค•เคฐเฅ‡เค‚ + เคจเคฏเคพ + เคฌเคจเคพเคเค‚ + เค•เคฒเฅ‡เค•เฅเคถเคจ เค•เคพ เคจเคพเคฎ + เคเคธเคพ เคจเคพเคฎ เคฆเคฐเฅเคœ เค•เคฐเฅ‡เค‚ เคœเฅ‹ เค•เคฟเคธเฅ€ เค…เคจเฅเคฏ เค•เคฒเฅ‡เค•เฅเคถเคจ เคฎเฅ‡เค‚ เค‰เคชเคฏเฅ‹เค— เคจ เคนเฅเค† เคนเฅ‹ + เคชเฅเคฐเคฌเค‚เคงเคฟเคค เค•เคฐเฅ‡เค‚ + เคจเคพเคฎ เคฌเคฆเคฒเฅ‡เค‚ + เคŸเฅเคฐเฅˆเค• เคœเฅ‹เคกเคผเฅ‡เค‚ + เคœเฅ‹เคกเคผเฅ‡เค‚ (%1$d) + เคŸเฅเคฐเฅˆเค• เคนเคŸเคพเคเค‚ + เค•เคฒเฅ‡เค•เฅเคถเคจ เคนเคŸเคพเคเค‚ + %1$s เคนเคŸเคพเคเค‚? + เคŸเฅเคฐเฅˆเค• เค†เคชเค•เฅ‡ เคกเคฟเคตเคพเค‡เคธ เคชเคฐ เคฐเคนเฅ‡เค‚เค—เฅ‡เฅค เค•เฅ‡เคตเคฒ เค•เคฒเฅ‡เค•เฅเคถเคจ เคนเคŸเคพเคฏเคพ เคœเคพเคเค—เคพเฅค + เคšเฅเคจเฅ‡เค‚ + เคธเคญเฅ€ เคšเฅเคจเฅ‡เค‚ + เคธเคญเฅ€ เคšเคฏเคจ เคนเคŸเคพเคเค‚ + %1$d เคšเฅเคจเฅ‡ เค—เค + เค•เคฒเฅ‡เค•เฅเคถเคจ เคฎเฅ‡เค‚ เคœเฅ‹เคกเคผเฅ‡เค‚ + เคชเคธเค‚เคฆเฅ€เคฆเคพ เคฎเฅ‡เค‚ เคœเฅ‹เคกเคผเฅ‡เค‚ + เค•เคฒเฅ‡เค•เฅเคถเคจ เคธเฅ‡ เคนเคŸเคพเคเค‚ + เคŸเฅเคฐเฅˆเค• เค–เฅ‹เคœเฅ‡เค‚ + เคเคฒเฅเคฌเคฎ เค•เฅเคฐเคฎ + เคธเคฌเคธเฅ‡ เคฒเค‚เคฌเฅ‡ เคชเคนเคฒเฅ‡ + เคธเคฌเคธเฅ‡ เค›เฅ‹เคŸเฅ‡ เคชเคนเคฒเฅ‡ + เคŸเฅเคฐเฅˆเค• + เคชเคฟเคš + เคฐเฅ€เคธเฅ‡เคŸ เค•เคฐเฅ‡เค‚ + เคฎเฅŒเคจ เค›เฅ‹เคกเคผเฅ‡เค‚ + เคธเฅเคฒเฅ€เคช เคŸเคพเค‡เคฎเคฐ + %1$d เคฎเคฟเคจเคŸ + เคŸเฅเคฐเฅˆเค• เค•เคพ เค…เค‚เคค + %1$s เคถเฅ‡เคท + เค‡เค•เฅเคตเคฒเคพเค‡เคœเคผเคฐ + เคฌเคพเคธ เคฌเฅ‚เคธเฅเคŸ + เค‡เคธ เคกเคฟเคตเคพเค‡เคธ เคชเคฐ เค‡เค•เฅเคตเคฒเคพเค‡เคœเคผเคฐ เค‰เคชเคฒเคฌเฅเคง เคจเคนเฅ€เค‚ เคนเฅˆ + เค—เฅ‡เคฎ เค•เฅ‡ เคฆเฅŒเคฐเคพเคจ เคšเคพเคฒเฅ‚ เค•เคฐเฅ‡เค‚ + เค—เฅ‡เคฎ เคšเคฒเคคเฅ‡ เคธเคฎเคฏ เคธเคพเค‰เค‚เคกเคŸเฅเคฐเฅˆเค• เคฌเคœเคคเคพ เคฐเค–เฅ‡เค‚ + เค…เคญเฅ€ เคคเค• เค•เฅ‹เคˆ เคธเคพเค‰เค‚เคกเคŸเฅเคฐเฅˆเค• เค‡เค‚เคธเฅเคŸเฅ‰เคฒ เคจเคนเฅ€เค‚ เคนเฅˆเฅค + เคธเคพเค‰เค‚เคกเคŸเฅเคฐเฅˆเค• เค–เฅ‹เคœเฅ‡เค‚ + เคธเคพเค‰เค‚เคกเคŸเฅเคฐเฅˆเค• เคซเคผเฅ‹เคฒเฅเคกเคฐ เคœเฅ‹เคกเคผเฅ‡เค‚ + เค‰เคธ เคซเคผเฅ‹เคฒเฅเคกเคฐ เคฎเฅ‡เค‚ เค•เฅ‹เคˆ เค‘เคกเคฟเคฏเฅ‹ เคซเคผเคพเค‡เคฒ เคจเคนเฅ€เค‚ เคนเฅˆ + เค•เฅเคฒ เค…เคตเคงเคฟ + %1$d เคŸเฅเคฐเฅˆเค• / %2$s + เคกเคฟเคธเฅเค• %1$s + เคถเคซเคผเคฒ + เคชเคฟเค›เคฒเคพ + เคšเคฒเคพเคเค + เคฐเฅ‹เค•เฅ‡เค‚ + เค…เค—เคฒเคพ + เคฐเคฟเคชเฅ€เคŸ เคฌเค‚เคฆ + เคธเคญเฅ€ เคฆเฅ‹เคนเคฐเคพเคเค + เคเค• เคฆเฅ‹เคนเคฐเคพเคเค + เคตเฅ‰เคฒเฅเคฏเฅ‚เคฎ + เค‡เคธ เคธเคพเค‰เค‚เคกเคŸเฅเคฐเฅˆเค• เคฎเฅ‡เค‚ เค•เฅ‹เคˆ เค‘เคกเคฟเคฏเฅ‹ เคซเคผเคพเค‡เคฒ เคจเคนเฅ€เค‚ เคนเฅˆ + เคฒเฅ‰เคจเฅเคš เค‰เคชเคฒเคฌเฅเคง เคจเคนเฅ€เค‚ + เค‡เคธ เคฒเคฟเค‚เค• เค•เฅ‹ เค–เฅ‹เคฒเคจเฅ‡ เค•เฅ‡ เคฒเคฟเค เค•เฅ‹เคˆ เคตเฅ‡เคฌ เคฌเฅเคฐเคพเค‰เคœเคผเคฐ เค‰เคชเคฒเคฌเฅเคง เคจเคนเฅ€เค‚ เคนเฅˆเฅค + เคชเค•เคกเคผเฅ‡เค‚ + เค›เฅ‹เคกเคผเฅ‡เค‚ + เคธเฅ‡เคต เค•เคฐเฅ‡เค‚ + เคฐเฅ€เคธเฅ‡เคŸ เค•เฅ‡ เคฒเคฟเค เคฆเคฌเคพเค เคฐเค–เฅ‡เค‚ + เคธเฅเคŸเฅ‹เคฐ + เคซเคผเฅเคฐเฅ‡เคฎ เคธเคฎเคฏ + เค”เคธเคค เคซเคผเฅเคฐเฅ‡เคฎ เคฆเคฐ + เคกเคฟเคธเฅเคชเฅเคฒเฅ‡ เคธเคฐเฅเคตเคฐ + HDR เคธเฅเคฅเคฟเคคเคฟ + เคฆเคฟเค–เคพเค เค—เค + %2$d เคฎเฅ‡เค‚ เคธเฅ‡ %1$d diff --git a/app/src/main/res/values-hu/input_library.xml b/app/src/main/res/values-hu/input_library.xml new file mode 100644 index 0000000000..ceeaeaf94e --- /dev/null +++ b/app/src/main/res/values-hu/input_library.xml @@ -0,0 +1,132 @@ + + + Az olvashatatlan beviteli beรกllรญtรกsokat helyreรกllรญtรกsi mรกsolatban ล‘riztรผk meg. A visszaรกllรญtott profilok szerkesztรฉsรฉt folytathatja. + Tulajdonsรกgok + Kattintรกs tulajdonsรกgai + %1$s ยท Kattintรกs + Gombok + Karok, felรผletek รฉs ravaszok + Eszkรถzรถk elrejtรฉse + Vezรฉrlล‘ + Vezรฉrlล‘ bemenet kรผldรฉse a Steam Inputnak vagy a jรกtรฉknak. + Ez az elem nem kรผld vezรฉrlล‘-, egรฉr- vagy billentyลฑzetbemenetet. + Egรฉrkattintรกs + DroidDeck mลฑvelet + Mลฑvelet + Gรถrgetรฉsi sebessรฉg: %1$d lรฉpรฉs/mp + + รšj profil + + รšj elrendezรฉs + %1$s ยท %2$d profil hasznรกlja. A mรณdosรญtรกsok minden ilyen hozzรกrendelรฉst hasznรกlรณ profilra รฉrvรฉnyesek. + รtnevezรฉs + Tรถrlรฉs + Adjon elemeket az elrendezรฉshez, mielล‘tt hozzรกrendeli a mลฑveleteiket. + Nem sikerรผlt menteni a beviteli beรกllรญtรกsokat + Nรฉv + Kiindulรกs + Gomb + Kar + ร‰rintล‘felรผlet + Kereszt + Ravasz + Kรฉsz + Visszavonรกs + + Hozzรกadรกs + Hรบzza az รกthelyezรฉshez. Hรบzza a sarkรกt az รกtmรฉretezรฉshez. Koppintson a Tulajdonsรกgokra mลฑvelet hozzรกrendelรฉsรฉhez. + Szerkesztรฉs a mรกsodlagos kรฉpernyล‘n + A kivรกlasztott kijelzล‘ nem รฉrhetล‘ el. Csatlakoztassa, hogy ezt az elrendezรฉst valรณs mรฉretben szerkessze. + Elveti a nem mentett elrendezรฉsmรณdosรญtรกsokat? + Ezt az elrendezรฉst %1$d profil hasznรกlja. A mentett mรณdosรญtรกsok mindegyikre รฉrvรฉnyesek. + Alapรฉrtelmezett profilok + Asztali mรณd + Jรกtรฉkmรณd + Alapรฉrtelmezett asztalihoz รฉs jรกtรฉkhoz + Alapรฉrtelmezett jรกtรฉkmรณdhoz + Alapรฉrtelmezett asztali mรณdhoz + Eszkรถzbeรกllรญtรกsok + Vezรฉrlล‘k + Gombok, karok, ravaszok รฉs tovรกbbi gombok + Profil mรกsolรกsa + Mลฑveletek visszaรกllรญtรกsa + Visszaรกllรญtja a(z) %1$s mลฑveleteit az alap profil alapรฉrtรฉkeire? Az elrendezรฉsek รฉs mรกs profilok vรกltozatlanok maradnak. + Tรถrli: %1$s? A hasznรกlรณ mรณdok visszatรฉrnek beรฉpรญtett alapรฉrtelmezett profiljukhoz. A mentett elrendezรฉsek รฉs megosztott beรกllรญtรกsok elรฉrhetล‘k maradnak. + Lรกthatรณsรกg + Minden profilra รฉrvรฉnyes. Az Auto a fล‘ kรฉpernyล‘ vezรฉrlล‘it mutatja, ha jรกtรฉkmรณdban nincs vezรฉrlล‘ csatlakoztatva. + Szerkesztรฉs a kรฉpernyล‘n + Mentett elrendezรฉsekโ€ฆ + Vรกlasszon elrendezรฉst, vagy hozzon lรฉtre sajรกtot + Vรกlassza a Profil vezรฉrlล‘it a mรกsodlagos kรฉpernyล‘ munkamenet-menรผjรฉben. A vezรฉrlล‘ menรผjรฉben a Profil รฉs a Mรกsodlagos kรฉpernyล‘ vรกlasztรณ dรถnti el, mely vezรฉrlล‘k jelenjenek meg. + Gombmลฑveletek + Megosztva ezzel: %1$s. A szerkesztรฉsek azokra a profilokra is รฉrvรฉnyesek. + Beรกllรญtรกsok รบjrafelhasznรกlรกsa + Beรกllรญtรกsok innenโ€ฆ + Mรกsolรกs mรกsik profilbรณl, vagy a beรกllรญtรกsok megosztva tartรกsa + Fรผggetlennรฉ tรฉtel + A jelenlegi beรกllรญtรกs megtartรกsa รฉs a mรณdosรญtรกsok megosztรกsรกnak leรกllรญtรกsa + Az elrendezรฉsek elemeket รฉs pozรญciรณikat tรกroljรกk. Minden profil sajรกt mลฑveleteket rendelhet. Teljes mรฉretben szerkessze a cรฉlkรฉpernyล‘n. + Jelenlegi elrendezรฉs + Tรถrli a nem hasznรกlt %1$s elrendezรฉst รฉs mentett mลฑveleteit? + Jelenlegi elrendezรฉs รกtnevezรฉse + %1$s รบjrafelhasznรกlรกsa mรกsik profilbรณl. A tรถbbi vezรฉrlล‘forrรกs vรกltozatlan marad. + Fizikai vezรฉrlล‘k megosztva tartรกsa + Alapรฉrtelmezรฉs szerint minden vezรฉrlล‘ รฉs egyรฉni elrendezรฉs fรผggetlen mรกsolat. A megosztรกs csak a fizikai vezรฉrlล‘ket kapcsolja รถssze. + Ezen elemek รฉs pozรญciรณk hasznรกlata. A megosztรกs szinkronban tartja a jรถvล‘beli geometriai mรณdosรญtรกsokat; a gombmลฑveletek fรผggetlenek maradnak. Egy mรกsik elrendezรฉs hozzรก nem rendelt mลฑveletekkel indul. + Ezen vezรฉrlล‘k รฉs mลฑveletek mรกsolรกsa vagy รถsszekapcsolรกsa, hogy a jรถvล‘beli mรณdosรญtรกsok mindkรฉt profilra รฉrvรฉnyesek legyenek. + Megosztva tartรกs + Fรผggetlen mรกsolat + Kar indรญtรกsa az รฉrintรฉsi ponttรณl + Kar elrejtรฉse, ha nincs hasznรกlatban + Eszkรถzรถk + Automatikus (%1$s) + Egyรฉni (%1$s) + Mentรฉs รบj profilkรฉnt + Profil vezรฉrlล‘i + Profil + Egรฉr รฉrintล‘felรผlet-gesztusok + Ha az egรฉrkurzorhoz van rendelve: koppintson a kattintรกshoz, tartsa nyomva a hรบzรกshoz, รฉs kรฉt ujjal gรถrgessen. + A(z) %1$s gyorsmenรผ-felรผlรญrรกssal rendelkezik. Vรกlassza ott az Automatikust, hogy az alapรฉrtelmezett profiljรกt รฉs mindhรกrom mentett rรฉszรฉt hasznรกlja. + DroidDeck bemenet + Nyomva tartva, amรญg a kart bรกrmely irรกnyba mozgatja: nyomรกs 55% felett, elengedรฉs 35% alatt. Az Irรกnybillentyลฑkkel kรผlรถn rendelhetล‘ minden irรกny. A DroidDeck parancsok kitรฉrรฉsenkรฉnt egyszer futnak. A kar kattintรกsa kรผlรถn รกllรญthatรณ. + Nyomva tartva az รฉrintล‘felรผlet รฉrintรฉse kรถzben; az ujj felemelรฉsekor elengedve. A DroidDeck parancsok รฉrintรฉsenkรฉnt egyszer futnak. Az รฉrintล‘felรผlet kattintรกsa kรผlรถn รกllรญthatรณ. + Nyomva tartva, amikor a ravasz รกtlรฉpi az 55%-ot; 35% alatt elengedve. A DroidDeck parancsok nyomรกsonkรฉnt egyszer futnak. + Gรถrgetรฉsi irรกny + Fรผggล‘leges + Vรญzszintes + Vรญzszintes gรถrgetรฉs + Mรฉrรฉsek + Kapcsolja be a rรถgzรญtรฉst, hasznรกlja a vezรฉrlล‘ket egy futรณ munkamenetben, majd tรฉrjen vissza รฉs olvassa le az eredmรฉnyeket. Csak a DroidDeck kรผldรฉsi idejรฉt mรฉri, a kijelzล‘ kรฉsleltetรฉsรฉt nem. A rรถgzรญtรฉs az alkalmazรกs folyamatรกnak bezรกrรกsakor รฉr vรฉget. + %1$d vezรฉrlล‘ + Egyรฉb mentett elrendezรฉsek (%1$d) โ–พ + Egyรฉb mentett elrendezรฉsek elrejtรฉse (%1$d) โ–ด + Home / Guide + Vissza ยท egy koppintรกs + Vissza ยท dupla koppintรกs + Vissza ยท kรฉtszer Steam mรณdban, egyszer asztali mรณdban + Steam mรณdban. A Vissza nyomva tartรกsa a gyorselรฉrรฉst is megnyitja. + Visszaรกllรญtรกs alapรฉrtelmezettre + A panelvรกlasztรกs megjegyzล‘dik. Az asztali mรณd mรกsodik munkateret nyit; nem vรกltja a munkamenetet vagy annak beviteli profiljรกt. + Virtuรกlis vezรฉrlล‘ + A Steam vagy a jรกtรฉk รกltal lรกtott vezรฉrlล‘tรญpus. + ร‰rintล‘kรฉpernyล‘ + Hogyan kezelล‘dnek a jรกtรฉk kรฉpernyล‘jรฉn tรถrtรฉnล‘ รฉrintรฉsek. A profilgombok megtartjรกk hozzรกrendelt mลฑveleteiket. + ร‰rintรฉskurzor + Mutatรณt jelenรญt meg a jรกtรฉk kรฉpernyล‘jรฉn tรถrtรฉnล‘ kรถzvetlen รฉrintรฉsekhez. + ร‰rintรฉs รฉs nyomva tartรกs + Egรฉr mลฑvelet, amikor ujjรกt a jรกtรฉk kรฉpernyล‘jรฉn tartja. + Vissza gomb koppintรกsai + Elsล‘ mลฑvelet: egy koppintรกs. Mรกsodik mลฑvelet: dupla koppintรกs. + Kapcsolรณgomb + Koppintson a tartรกshoz, koppintson รบjra az elengedรฉshez. Menรผ megnyitรกsa vagy profilvรกltรกs elengedi a gombot. + Forma + Lekerekรญtett + Kapszula + Kรถr + Tรฉglalap + Gombcรญmke + Szรถveg + Importรกlt kรฉp + Kรผlรถn รกtlรณs gombok + Rendeljen gombot minden รกtlรณhoz. Az รผres รกtlรณ a kรฉt szomszรฉdos irรกnyt nyomja. + Szomszรฉdos irรกnyok + A rรฉgi kรฉpernyล‘gombok lent importรกlt profilkรฉnt vannak mentve. Vรกlasszon egyet hasznรกlathoz vagy szerkesztรฉshez. A jelenlegi profilvรกlasztรกsok megmaradtak. + A rรฉgi kรฉpernyล‘gombokat nem sikerรผlt automatikusan importรกlni. Az eredeti beรกllรญtรกsok megmaradtak. + diff --git a/app/src/main/res/values-hu/input_strings.xml b/app/src/main/res/values-hu/input_strings.xml new file mode 100644 index 0000000000..1fb45dd72a --- /dev/null +++ b/app/src/main/res/values-hu/input_strings.xml @@ -0,0 +1,38 @@ + + + Beviteli profilok + Profilok + Fizikai vezรฉrlล‘ + Fล‘ kรฉpernyล‘ + Mรกsodlagos kรฉpernyล‘ + Natรญv / Steam Input + Natรญv: %1$s + Mรกsik vezรฉrlล‘parancs kรผldรฉse + Letiltva + Billentyลฑ vagy billentyลฑkombinรกciรณ + Irรกnybillentyลฑk + Mutatรณ mozgatรกsa + Mutatรณ sebessรฉge: %1$d + Gรถrgetรฉs + Fรผggล‘leges gรถrgetรฉs + Bal egรฉrgomb + Jobb egรฉrgomb + Kรถzรฉpsล‘ egรฉrgomb + DroidDeck menรผ megnyitรกsa + Billentyลฑzet megjelenรญtรฉse + Steam menรผ megnyitรกsa + Steam gyorselรฉrรฉs megnyitรกsa + Vezรฉrlล‘elem eltรกvolรญtรกsa + Vezรฉrlล‘elem hozzรกadรกsa + Eszkรถzspecifikus gombok + Fizikai gomb hozzรกrendelรฉse + Engedje el a gombot, majd vรกlassza a Szerkesztรฉs, รšjra vagy Mรฉgse lehetล‘sรฉget. A B vagy a Vissza elengedรฉs utรกn megszakรญtja. + รšjra + Nyomjon meg egy gombot, beleรฉrtve a billentyลฑkรฉnt jelentett Vissza gombot is. A hangerล‘- รฉs Android rendszergombok foglaltak. A hozzรกrendelรฉs csak erre az eszkรถzre รฉrvรฉnyes. + Hozzรกrendelรฉs eltรกvolรญtรกsa + Bemeneti diagnosztika + Bemenetkรผldรฉsi idล‘ rรถgzรญtรฉse + Mรฉrรฉsek beolvasรกsa + Az Androidrรณl a meglรฉvล‘ bemeneti รกtvitelbe tรถrtรฉnล‘ kรถzzรฉtรฉtelig mรฉr. Nem tartalmazza a Bluetooth-รฉrkezรฉst, a vendรฉg lekรฉrdezรฉsรฉt, a renderelรฉst รฉs a kijelzล‘ kรฉsleltetรฉsรฉt. A rรถgzรญtรฉs alapรฉrtelmezรฉs szerint ki van kapcsolva. + Normรกl bemeneti hozzรกrendelรฉs hasznรกlata + diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index 3743a26364..f99551869c 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -28,6 +28,8 @@ Felfรผggesztรฉs most Munkamenet leรกllรญtรกsa Kรฉpkocka-generรกlรกs + A jรกtรฉk beรกllรญtรกsai + Alapรฉrtelmezett beรกllรญtรกsok Vรกlassza ki a kรฉpkocka-generรกlรกs mรณdjรกt Ki DD-FG %1$dร— @@ -183,6 +185,7 @@ A PowerVR grafikus kรถrnyezetet nem sikerรผlt letรถlteni. Ellenล‘rizd a kapcsolatot, รฉs prรณbรกld รบjra. A DirectAudio nem tรถlthetล‘ le, ezรฉrt a jรกtรฉkhang ebben a munkamenetben a lassabb รบtvonalat hasznรกlja. Ez a program + A munkamenet nem tudta megjelenรญteni a kรฉpet a kรฉpernyล‘n: %1$s. Fekete kรฉpernyล‘ helyett ez a kรฉpernyล‘ mutatja az okot; a rรฉszletek a munkamenet naplรณiban talรกlhatรณk. A Steam-klienst nem sikerรผlt letรถlteni. Lehet, hogy a hรกlรณzat vagy a VPN blokkolja a Steam szervereit; ellenล‘rizd a kapcsolatot, รฉs prรณbรกld รบjra. A Steam-klienst nem sikerรผlt beรกllรญtani. Ellenล‘rizd a kapcsolatot รฉs a szabad tรกrhelyet, majd prรณbรกld รบjra. A %1$s x86 PC-khez kรฉszรผlt, รฉs a FEX-en keresztรผl fut, amely mรฉg nincs telepรญtve. Indรญtsa el egyszer a Steamet bejelentkezve, รฉs hagyja letรถlteni a FEX-et รฉs a Steam Linux Runtime-ot, majd indรญtsa el ezt รบjra. @@ -385,6 +388,9 @@ Itt mรฉg nem tรกmogatott ร–sszetevล‘k betรถltรฉseโ€ฆ Nem sikerรผlt telepรญteni: %1$s + Ehhez a letรถltรฉshez frissรญtรฉs szรผksรฉges. + A frissรญtรฉs vรกrรณlistรกra kerรผlt. + Frissรญtรฉs รบjra Letรถltve %1$s letรถltรฉse Telepรญtรฉs: %1$s @@ -415,6 +421,22 @@ Csak belsล‘ Mappa: %1$s Mรกsodik kรถnyvtรกr + Tovรกbbi Steam-kรถnyvtรกrak + Mappรกk, amelyekbe a Steam telepรญteni, illetve amelyekbล‘l futtatni tud, mindegyik sajรกt nรฉv alatt. Egy mappa eltรกvolรญtรกsa meghagyja a jรกtรฉkait a tรกrhelyen. + Kรถnyvtรกr hozzรกadรกsa + รtnevezรฉs + Kรถnyvtรกr neve + Vรกlasszon mappรกt a kรถnyvtรกrnak + Legfeljebb %1$d hozzรกadott kรถnyvtรกr + Ez a mappa mรกr kรถnyvtรกr, vagy egy kรถnyvtรกron belรผl van + %1$s ยท nem รฉrhetล‘ el + A kรถvetkezล‘ Steam-munkamenettล‘l รฉrvรฉnyes + Megtalรกlva ezen az eszkรถzรถn ยท %1$s ยท %2$s + Hozzรกadรกs + Kรถnyvtรกrak keresรฉse a belsล‘ tรกrhelyen + Engedรฉlyezze az รถsszes fรกjl elรฉrรฉsรฉt, hogy a DroidDeck lรกthassa a mรกs alkalmazรกsok รกltal a belsล‘ tรกrhelyen tartott Steam-kรถnyvtรกrakat + Engedรฉlyezรฉs + Hozzรกadva: %1$s, a kivรกlasztott mappรกban lรฉvล‘ Steam-kรถnyvtรกr Az SD-kรกrtyรกrรณl vagy megosztott tรกrhelyrล‘l streamelล‘ jรกtรฉkok akadhatnak. Tรกrhely-diagnosztika Rรถgzรญti a foglalรกsi eredmรฉnyeket รฉs a mintavรฉtelezett tรกrhelyidล‘zรญtรฉseket a megosztott naplรณkban. Bekapcsolva lassรญthatja a telepรญtรฉseket. A kรถvetkezล‘ munkamenettล‘l รฉrvรฉnyes. @@ -478,6 +500,7 @@ Be Steammel indul Steam nรฉlkรผl indul + Jรกtรฉk felbontรกsa Beรกllรญtรกsok %1$s beรกllรญtรกsai Alapรฉrtelmezett @@ -565,6 +588,8 @@ Jรกtรฉkmagok Jรกtรฉkmagok Magok a jรกtรฉkokhoz. Ha mind kivรกlasztva van, az Android szabadon รผtemez. + Energiatakarรฉkossรกg stabil jรกtรฉkoknรกl + A jรกtรฉkot a lassabb magokon futtatja, amรญg stabil kรฉpkockasebessรฉget tart, รฉs visszaadja a szokรกsos magjait, amint lemarad. Kliens felhasznรกlรณi felรผlet Szรกlalt GL Reszponzรญvabbรก teheti a Steam menรผit. @@ -600,7 +625,10 @@ Kikapcsolja a Proton kontroller-navigรกciรณs segรฉdjรฉt, amely minden jรกtรฉkban CPU-t hasznรกl. A proot futtatรกsa seccomp nรฉlkรผl Javรญthatja a hiรกnyzรณ szisztรฉmahรญvรกs-hibรกkat egyes kerneleken. Csรถkkentheti a teljesรญtmรฉnyt. + Futtatรกs proot nรฉlkรผl (kรญsรฉrleti) + A Linux rรฉszt kรถzvetlenรผl az Androidon indรญtja. A kรถvetkezล‘ munkamenettล‘l รฉrvรฉnyes. Kapcsolja ki, ha valami nem indul el. proot gyors รบtvonal + Proot nรฉlkรผl nem hasznรกlhatรณ. A proot seccomp-szลฑrล‘jรฉt igรฉnyli. Gyorsabb fรกjlkeresรฉs รฉs kevesebb akadรกs. Kapcsolja ki, ha egy program nem talรกlja a fรกjljait. A kurzor rajzolรกsa a gamescope-on belรผl @@ -683,6 +711,7 @@ Grafikus memรณria Swap-memรณria Akkuszint + Hรกtralรฉvล‘ akkumulรกtor-รผzemidล‘ Energiafelvรฉtel Hรกlรณzat Felbontรกs @@ -809,6 +838,7 @@ Az eszkรถz tรกmogatott Nem tesztelt GPU A GPU nem tรกmogatott + GPU Mali-hรญdon keresztรผl %1$s ยท %2$s %1$s: %2$s Nincs kompatibilis grafikus hรกttรฉrrendszer ehhez: %1$s. A Steam fekete kรฉpernyล‘t jelenรญthet meg. @@ -838,15 +868,38 @@ Munkamenet Munkamenet-naplรณk Minden munkamenet utรกn mentve + Rรฉszletes diagnosztika a kรถvetkezล‘ munkamenethez + Egy munkamenetrล‘l rรฉszletes naplรณkat kรฉszรญt. Csรถkkentheti a teljesรญtmรฉnyt รฉs tรถbb tรกrhelyet hasznรกlhat. A munkamenet indรญtรกsakor magรกtรณl kikapcsol; megosztรกs elล‘tt nรฉzze รกt a naplรณkat. Jรกtรฉk-hibakeresรฉsi naplรณk Proton-, Wine- รฉs grafikai diagnosztika a kรถvetkezล‘ jรกtรฉkindรญtรกskor. Csรถkkentheti a teljesรญtmรฉnyt, รฉs tรถbb tรกrhelyet hasznรกl. Indรญtsa รบjra ezt a munkamenetet a jรกtรฉk-hibakeresรฉsi naplรณk mentรฉsรฉhez Nem sikerรผlt frissรญteni a naplรณzรกst. Ellenล‘rizze a kapcsolรณt, รฉs prรณbรกlja รบjra. Hibakeresรฉsi eszkรถzรถk + Rรฉszletes grafikai naplรณk + Steam felรผlet: GPU-rajzolรกs + Az Xclipse illesztล‘program-pรกrral a Steam szoftveresen rajzolja az oldalait (a GPU-rajzolรกs hibรกs csempรฉket eredmรฉnyezett). Kapcsolja be a gyorsabb Steam-felรผletรฉrt, ha ezen a telefonon jรณl nรฉz ki. + kรฉszรผlt: %1$s + %1$s frissรผlt a legรบjabb buildre + A Mali-hรญd %1$s esetรฉn a legutรณbbi munkamenetben nem ment รกt az รถnteszten (kรฉpek vagy rajzolรกsi mลฑveletek), ezรฉrt a munkamenet helyette a PanVK illesztล‘program-pรกrt hasznรกlta. + A Mali-hรญd %1$s esetรฉn a legutรณbbi munkamenetben nem talรกlt mรณdot arra, hogy memรณriรกt osszon meg az illesztล‘programmal, ezรฉrt a munkamenet helyette a PanVK illesztล‘program-pรกrt hasznรกlta. A hรญd nem tud mลฑkรถdni ezen a telefonon; a kikapcsolรกsรกval a PanVK pรกr marad hasznรกlatban. + Az egyes jรกtรฉkok Proton-, DXVK- รฉs illesztล‘program-naplรณi a munkamenet naplรณiban talรกlhatรณk. Mindig be van kapcsolva, ha a GPU nem Adreno. Legutรณbbi munkamenet-naplรณk Mentett munkamenet-naplรณk A legรบjabb %1$d-t tartja meg Naplรณk tรถrlรฉse + Elรฉrhetล‘ munkamenetnaplรณk + Mรฉg nincsenek mentett munkamenetnaplรณk. + A megosztott รฉs mentett ZIP-fรกjlok tartalmazzรกk a kivรกlasztott munkamenetet, valamint a kapcsolรณdรณ Steam-, รกruhรกz-, eszkรถz- รฉs Battle.net-diagnosztikai adatokat. + %1$s ยท %2$s + Aktuรกlis munkamenet + Megosztรกs + Mentรฉs az eszkรถzre + Tรถrlรฉs + Munkamenetnaplรณk tรถrlรฉse? + %1$s tรถrlรฉse? Ez nem vonhatรณ vissza. + Munkamenetnaplรณk mentve. + Nem sikerรผlt menteni a munkamenetnaplรณkat. + Nem sikerรผlt tรถrรถlni a munkamenetnaplรณkat. Minden beรกllรญtรกs visszaรกllรญtรกsa Minden beรกllรญtรกst visszaรกllรญt az alapรฉrtรฉkre Visszaรกllรญtรกs @@ -873,6 +926,8 @@ Hasznรกlat kezdล‘kรฉpernyล‘kรฉnt A DroidDeck lehet a kezdล‘kรฉpernyล‘ alkalmazรกs A DroidDeck soha nem jelenik meg kezdล‘kรฉpernyล‘ alkalmazรกskรฉnt + A Kezdล‘lap gomb megnyitja + A lap, amely akkor jelenik meg, ha a DroidDeck a kezdล‘lap-alkalmazรกs, รฉs megnyomod a Kezdล‘lap gombot A Jรกtรฉkok hozzรกadรกsa rรฉszben รกllรญtsd a DroidDecket Belefoglalรกsra Tรกjolรกs Az indรญtรณ tรกjolรกsa @@ -886,15 +941,22 @@ Teljes kรฉpernyล‘ Elrejti az Android รกllapot- รฉs navigรกciรณs sรกvokat Megjelenรญti az Android รกllapot- รฉs navigรกciรณs sรกvokat + Kรฉtkรฉpernyล‘s indรญtรณ + Az Automatikus mรณd a beรฉpรญtett mรกsodik kรฉpernyล‘vel rendelkezล‘ kรฉzi eszkรถzรถkรถn a mรกsodik kรฉpernyล‘re helyezi az indรญtรณ szakaszait (Steam, Kรถnyvtรกr, รruhรกzak รฉs a tรถbbi). A Be mรณd bรกrmely mรกsodik kijelzล‘t hasznรกl. A Ki mรณd egy kรฉpernyล‘n tartja az indรญtรณt. + Kรฉtkรฉpernyล‘s munkamenetek + Az Automatikus mรณd a felugrรณ panel helyett a beรฉpรญtett mรกsodik kรฉpernyล‘re dokkolja a jรกtรฉkon belรผli menรผt. A Be mรณd bรกrmely mรกsodik kijelzล‘t hasznรกl. A Ki mรณd a jรกtรฉk kรฉpernyล‘jรฉn tartja a menรผt; a menรผbล‘l tovรกbbra is kivรกlaszthatรณ egy mรกsodik kรฉpernyล‘. Automatikus Be Ki Alsรณ kรฉpernyล‘s vezรฉrlล‘k jรกtรฉkokban + Android-billentyลฑzet a szรถvegmezล‘khรถz Munkamenet indรญtรกsakor megnyitja az รฉrintล‘padot รฉs a billentyลฑzetet a mรกsodik kรฉpernyล‘n. Gรฉpelรฉs a felsล‘ kรฉpernyล‘re Kรฉsz Alapรฉrtelmezett kezdล‘kรฉpernyล‘ alkalmazรกs Vรกlasszon kezdล‘kรฉpernyล‘ alkalmazรกst + Az indรญtรณ elrejtรฉse a Legutรณbbiak kรถzรผl รผresjรกratban + Csak akkor รฉrvรฉnyes, ha a DroidDeck az alapรฉrtelmezett kezdล‘lap-alkalmazรกs, รฉs nem fut munkamenet. Kivรกlasztรกs Linux-alkalmazรกsok (bรฉta) Fรกjlok @@ -1006,9 +1068,172 @@ Preview A legรบjabb javรญtรกsok, a Stable elล‘tt Naprakรฉsz + Build adatainak mรกsolรกsa + Build adatai kimรกsolva + รšjabb a Previewnรกl + Elล‘rรฉbb jรกrsz a Previewnรกl + Ez a build รบjabb a legutรณbbi Previewnรกl. A kรถvetkezล‘ Preview build frissรญti. + Vรกlassz egy buildet a vรกltozรกsai megtekintรฉsรฉhez vagy telepรญtรฉsรฉhez. + Telepรญtve + Build telepรญtรฉse%1$s + Visszatรฉrรฉs ehhez a buildhez%1$s + versionCode %1$d + Commit %1$s + Kiadรกsi oldal + A PR-nek รบjabb commitja van (%1$s). A teszt buildje mรฉg nem kรฉsz, ezรฉrt ez nem tartalmazza. + รšjabb commit, a build kรฉszรผl + PR-szรกm, cรญm vagy szerzล‘ + Nincs egyezล‘ teszt build + รšjra kell รฉpรญteni (versionCode %1$d) + Teszt buildek frissรญtรฉsei + รšj teszt build: PR #%1$d + %1$s. A telepรญtรฉshez nyisd meg a Frissรญtรฉseket. + Tรถbb (%1$d) + รšjra kell รฉpรญteni a %2$d versionCode-hoz (%1$d) + Preview buildek a mainen e teszt build รณta: %1$d Teszt buildek Prรณbรกljon ki egy javรญtรกst a kiadรกsa elล‘tt Jelenleg nincs + Kรญsรฉrleti build + Kรญsรฉrleti buildek + Hasznรกlatban + Szรผneteltetve, miutรกn az Android รบjraoptimalizรกlta a DroidDeck alkalmazรกst + Nincs betรถltve: %1$s + รšjraindรญtรกsra vรกr + Megtartva + Mรกsik verziรณhoz + รšjraรฉpรญtรฉs + Tรถrli ezt a buildet az eszkรถzrล‘l + รšjraindรญtรกs ezzel + Kikapcsolรกs + Hasznรกlat + Tรถrlรฉs + Tรถrlรฉs most + Nem sikerรผlt elล‘kรฉszรญteni az รบjraindรญtรกst: %1$s. Pรกrosรญtsa a vezetรฉk nรฉlkรผli hibakeresรฉst a Beรกllรญtรกsokban, รฉs prรณbรกlja รบjra. + Kรญsรฉrleti build telepรญtve + A DroidDeck ezzel indult รบjra: %1$s + A Lab build szรผneteltetve + Az Android รบjraoptimalizรกlta a DroidDeck alkalmazรกst, ezรฉrt %1$s nincs betรถltve. Nyissa meg a Frissรญtรฉsek elemet, รฉs indรญtsa รบjra azon. + A Lab build kikapcsolva + A DroidDeck egy mรกsik verziรณjรกhoz kรฉszรผlt. A Frissรญtรฉsek tartalmazza. + A DroidDeck kรฉtszer nem indult el rajta + รœgynรถk + รœgynรถk + Az รผgynรถk dolgozik + Az รผgynรถk hasznรกlatรกhoz telepรญtse a Claude Code alkalmazรกst a Linux felhasznรกlรณi terรฉbe. + Kรฉrdezzen egy jรกtรฉkrรณl, egy รถsszeomlรกsrรณl vagy a DroidDeck mรณdosรญtรกsรกrรณl + Kรผldรฉs + รšj beszรฉlgetรฉs + Leรกllรญtรกs + Tรกrhely + Eltรกvolรญtรกs + Eltรกvolรญtรกs most + Claude Code + Codex + DroidDeck forrรกskรณdja + Letรถltรฉsi gyorsรญtรณtรกrak + A fel nem kรผldรถtt mรณdosรญtรกsok elvesznek + A buildek รบjra letรถltik ล‘ket + A telepรญtล‘ รบjra feltelepรญtheti; a bejelentkezรฉsek megmaradnak + A DroidDeck a Lab build hasznรกlatรกval indult รบjra. Folytassa ott, ahol abbahagyta. + Kรฉrdezze meg, miรฉrt nem indul el egy jรกtรฉk, kรฉrjen magyarรกzatot egy naplรณhoz, vagy mรณdosรญttassa a DroidDeck alkalmazรกst, รฉs prรณbรกlja ki a vรกltoztatรกst ezen az eszkรถzรถn. + Hiba: %1$s + %1$s befejezล‘dรถtt (kilรฉpรฉs: %2$d) + Leรกllรญtva + Vรกlasz nรฉlkรผl รฉrt vรฉget + รšjraprรณbรกlรกs + Az รผgynรถk beรกllรญtรกsa + ร‰pรญtse รบjra a Lab build %1$s verziรณt a DroidDeck telepรญtett kiadรกsรกhoz, รฉs indรญtsa รบjra rajta. + %1$s be ยท %2$s ki + Gondolkodik + Gondolat + Gondolkodik ยท %1$s + %1$s ยท %2$s + BEMENET + KIMENET + Futโ€ฆ + Nincs eredmรฉny: a beszรฉlgetรฉsi fordulรณ elล‘bb รฉrt vรฉget + Nincs kimenet + Gรฉpelj a kรถvetkezล‘ รผzenet sorba รกllรญtรกsรกhoz + Sorba รกllรญtรกs + Kรถvetkezล‘: %1$s + Ne kรผldd el + Csatolรกs + Eltรกvolรญtรกs + Alapรฉrtelmezett + Gondolkodรกsi erล‘feszรญtรฉs + Mehet + รtdolgozรกs + Mรฉg semmi sem vรกltozott + Hajtsd vรฉgre a tervet. + Kรผldรฉs most + Tovรกbbiak + Bezรกrรกs + Legรบjabb + Dolgozik + Kontextus + %1$s / %2$s + Ez a beszรฉlgetรฉs ยท %1$s + A hasznรกlati adatok az elsล‘ vรกlasz utรกn jelennek meg + %1$d รณrรกs korlรกt + %1$d perces korlรกt + Heti korlรกt + %1$d%% ยท visszaรกll %2$s + + %1$d fรกjl + %1$d fรกjl + + Tervezz elล‘szรถr + Tervezรฉs + Tervet javasol, semmit sem vรกltoztat + Beszรฉlgetรฉsek + Mรฉg nincs beszรฉlgetรฉs + ร‰pp most + Tรถrlรฉs + Tรถrli a beszรฉlgetรฉst รฉs a mellรฉkleteit + Folyamatok + Semmi sem fut a Linux-felhasznรกlรณi tรฉrben + รGENS + Leรกllรญtรกs + Laboratรณriumi build + Laboratรณriumi buildek elล‘kรฉszรญtรฉse + %1$d%% ยท kรถrรผlbelรผl %2$s van hรกtra + kรถrรผlbelรผl %1$s van hรกtra + Mรฉgse + Build megszakรญtรกsa + Indรญtรกs + %1$d%% + Csomagolรกs + DroidDeck รบjraindรญtรกsa rajta + Kรฉsz + Sikertelen: %1$s + Az รกgens beรกllรญtรกsa + Elล‘szรถr telepรญtsd a Linux-futtatรณkรถrnyezetet a Beรกllรญtรกsban. + Prรณbรกld รบjra + Kezdj beszรฉlgetni + Eszkรถzcsatlakozรกs + Vezetรฉk nรฉlkรผli hibakeresรฉs, hogy az รกgens lรกssa รฉs vezรฉrelje a DroidDeck alkalmazรกst + Telepรญtsd: %1$s + A Linux felhasznรกlรณi tรฉrbe, git, gh รฉs adb tรกmogatรกssal + Bejelentkezรฉs ide: %1$s + Megnyitja a bรถngรฉszล‘t + GitHub + Nem kรถtelezล‘, pull requestek nyitรกsรกhoz + Fordรญtรณeszkรถzรถk + Nem kรถtelezล‘, a Lab-fordรญtรกsokhoz ezen az eszkรถzรถn ยท kb. 5 GB + Az agent kรฉszen รกll + Fejezd be az agent beรกllรญtรกsรกt + Bejelentkezve ide: %1$s + Lab-fordรญtรกsok + gyors fordรญtรกsok + Gyors Lab-fordรญtรกsok + Elล‘re lefordรญtja ezt a verziรณt, รญgy a Lab-fordรญtรกsok percek alatt elkรฉszรผlnek ยท egyszeri kb. 20 perc + Fordรญtรกs ยท %1$d%% ยท kb. %2$s van hรกtra + Elล‘kรฉszรญtรฉs + A vezetรฉk nรฉlkรผli hibakeresรฉs nem รฉrhetล‘ el; a Pรกrosรญtรกs bekapcsolja + Pรกrosรญtรกs + Telepรญtรฉs + Bejelentkezรฉs PR #%1$d Nincs buildelve ehhez a DroidDeck-mรกsolathoz Frissรญtve: %1$s @@ -1248,6 +1473,9 @@ Alkalmazรกsok Beรกllรญtรกs Frissรญtรฉsek + Tovรกbbiak + Fรผlek szerkesztรฉse + Fรผlek %1$d%% %1$s folytatรกsa Minden munkamenetben /root/ROMs nรฉven jelenik meg. A belsล‘ tรกrhely itt talรกlhatรณ: /root/Storage. @@ -1269,6 +1497,15 @@ Vรกrakozรณ megszakรญtรกsa Android billentyลฑzet Elrejtรฉs โœ• + Mรฉret a kรฉpernyล‘n + A kรฉpernyล‘ hรกnyadรกt foglalja el a billentyลฑzet, a fejlรฉcet is beleszรกmรญtva. + รtlรกtszatlansรกg + Csรถkkentsd, hogy lรกsd a billentyลฑzet mรถgรถtti jรกtรฉkot. + Rejtett billentyลฑk + A ritkรกn hasznรกlt billentyลฑk nem jelennek meg a billentyลฑzeten. + Esc รฉs a funkciรณbillentyลฑk sora + Ins / Del / Home / End / PgUp / PgDn + Nyรญlbillentyลฑk %1$s indรญtรกsa Vรกlasszon kรฉpernyล‘t. Mรกsodlagos: %1$s. A mรกsodlagos kijelzล‘ mรกr nem elรฉrhetล‘. @@ -1770,7 +2007,24 @@ Terminรกl Deck fogรณk + รฉrintล‘padok Irรกnyรญtรณpult + Asztal + Az asztal indรญtรกsa + Asztal ยท %1$s + ร‰rintล‘pad + Kรถzvetlen รฉrintรฉs + ร‰rintล‘pad. Koppintรกs a kรถzvetlen รฉrintรฉsre vรกltรกshoz + Kรถzvetlen รฉrintรฉs. Koppintรกs az รฉrintล‘padra vรกltรกshoz + A KDE asztal indรญtรกsaโ€ฆ + Az asztal bezรกrult. + Az asztal nem indult el. A naplรณi a munkamenet bottom-desktop mappรกjรกban talรกlhatรณk. + Az asztal zรกrva van. Itt mรฉg nincs mit megjelenรญteni. + Kรฉpernyล‘k felcserรฉlรฉse + Az alsรณ kรฉpernyล‘ jelenleg nem hasznรกlhatรณ + Jรกtรฉkkรฉpernyล‘ + A jรกtรฉk megjelenรญtรฉse: + Felsล‘ kรฉpernyล‘ + Alsรณ kรฉpernyล‘ Letรถltรฉsek Nincs folyamatban lรฉvล‘ letรถltรฉs. Steam @@ -1805,6 +2059,20 @@ รœzemanyag, t Fล‘ %1$s t Tartalรฉk %1$s t + Kรฉpkockaidล‘ + elmรบlt %1$d mp + รกtlagos kรฉpkockaidล‘ + 1%-os minimum + 33 ms feletti kรฉpkockรกk + %1$d / perc + Jรกtรฉk ideje: %1$s + %1$d mag, akรกr %2$s GHz + %1$d mag + jรกtรฉk + %1$d Hz-es FPS + A piros jelรถlรฉs jelzi, hol jelenรญti meg pirosan a HUD a hล‘mรฉrsรฉkletet. + teljes eszkรถz + akkumulรกtor Mลฑszerfal-adatok kรผldรฉse Automatikus Bekapcsolja az itt felsorolt รถsszes jรกtรฉknรกl, a kรฉsล‘bb talรกlt jรกtรฉkokat is beleรฉrtve. A kikapcsolt jรกtรฉkok kikapcsolva maradnak. @@ -1828,6 +2096,10 @@ A mikrofon ki van kapcsolva ennรฉl a jรกtรฉknรกl. A beszรฉdhez kapcsolja be a Mikrofon opciรณt a DroidDeck Steam-beรกllรญtรกsaiban (Hang), majd indรญtsa รบjra a jรกtรฉkot. Hangerล‘ %1$d%% Jรกtรฉkon belรผli statisztikรกk + HUD az alsรณ kรฉpernyล‘n + Sรกv minden lapon + 1%- รฉs 0,1%-os minimumok + CPU-hล‘mรฉrsรฉklet FPS CPU GPU @@ -2000,6 +2272,7 @@ A munkamenet indรญtรกsaโ€ฆ %1$d:%2$02d eltelt ยท mรฉg dolgozik A Steam-kliens frissรญtรฉsรฉnek letรถltรฉse ยท %1$d%% + A Steam-kliens frissรญtรฉsรฉnek alkalmazรกsaโ€ฆ A Steam-kliens letรถltรฉse ยท %1$s Mรกr fut egy kompatibilitรกsi eszkรถz telepรญtรฉse @@ -2076,11 +2349,29 @@ Rajzfilmes kรถrvonalak plusz รฉlesรญtรฉs. Nem Adreno GPU + A rendszer PowerVR-illesztล‘programja: a kompatibilitรกs eszkรถzรถnkรฉnt vรกltozรณ + Kรญsรฉrleti: RADV vagy a rendszer Xclipse-illesztล‘programja + Rendszer PowerVR + A GPU beรฉpรญtett illesztล‘programjait hasznรกlja + A rendszer PowerVR illesztล‘programja van kivรกlasztva a futtatรณkรถrnyezethez รฉs a megjelenรญtรฉshez. + Ezt a Mali-t mรฉg egyetlen nyรญlt illesztล‘program sem tรกmogatja: a Mali hรญd be van kapcsolva. + Ez a nem Snapdragon tesztvรกltozat: az itteni hivatalos vรกltozatok csak Adreno-n futnak, ezรฉrt nem telepรผlnek rรก. Az รบj tesztvรกltozatok a github.com/The412Banner/droiddeck-nonadreno-drivers cรญmen รฉrhetล‘k el. + Az elล‘zล‘ munkamenet azรฉrt รฉrt vรฉget, mert az Android memรณria felszabadรญtรกsa miatt bezรกrta a DroidDeck alkalmazรกst, nem pedig รถsszeomlรกs tรถrtรฉnt. Zรกrj be mรกs alkalmazรกsokat, vagy csรถkkentsd a jรกtรฉk textรบrabeรกllรญtรกsait, majd prรณbรกld รบjra. + Mali (Venus) + a Mali hรญd + Ezt a Mali-t mรฉg egyetlen nyรญlt illesztล‘program sem tรกmogatja: %1$s van hasznรกlatban, a telefon sajรกt illesztล‘programjรกn. + %1$s mรฉg nincs kiadva: addig %2$s van hasznรกlatban. + %1$s nem รฉrhetล‘ el, รฉs a telefon illesztล‘programja Vulkan %2$s verziรณt jelez (a Venus 1.2-t igรฉnyel): a Mali hรญd van hasznรกlatban. + %1$s mรฉg nincs kiadva: addig a Mali hรญd be van kapcsolva. + Vรกrรณlistรกn: %1$s (egy mรกsik futtatรณkรถrnyezet-illesztล‘programra vรกr) + A DXVK-t a rendszer PowerVR futtatรณkรถrnyezete biztosรญtja. Mรกs DXVK-csomagok tรกrolhatรณk, de ezzel az illesztล‘programmal nem kerรผlnek alkalmazรกsra. Tรกmogatott Kรญsรฉrleti: az illesztล‘programjai teszt buildek Kรญsรฉrleti Adreno 850-tรกmogatรกs: kompatibilis kรญsรฉrleti kijelzล‘- รฉs jรกtรฉk-illesztล‘programokat igรฉnyel; ezen az eszkรถzรถn nincs ellenล‘rizve A tesztelt hardver alatt (Adreno 725 รฉs รบjabb): lehet, hogy nem fut Nem tรกmogatott: nincs kompatibilis grafikus hรกttรฉrrendszer ehhez a GPU-hoz + A Mali hรญdon keresztรผl, a telefon sajรกt Vulkan illesztล‘programjรกn fut + Nem tรกmogatott, ha a Mali hรญd ki van kapcsolva: a Turnip Adreno (Snapdragon) GPU-t igรฉnyel A GitHub korlรกtja elรฉrve โ€“ prรณbรกlja รบjra kรฉsล‘bb A GitHub HTTP %1$d vรกlaszt adott @@ -2189,7 +2480,6 @@ รruhรกzak Steam Egyรฉni - รruhรกzak Letรถltรฉsi sebessรฉgi szint Kiegyensรบlyozott Gyors @@ -2228,6 +2518,7 @@ Vรกrakozรกs a mรกsik Battle.net-letรถltรฉsreโ€ฆ Nyisd meg a Battle.netet, รฉs jelentkezz be egyszer, majd innen telepรญtsd a jรกtรฉkait. A Blizzard letรถltล‘je leรกllt: %1$s + A Blizzard letรถltล‘je nem halad tovรกbb. Blizzard-hiba: %1$s Frissรญtรฉs Blizzard-jรกtรฉkok @@ -2235,6 +2526,7 @@ Megszakรญtva Telepรญtรฉs ยท %1$s Ingyenes beszerzรฉs + Hozzรกadรกs a kรถnyvtรกrhozโ€ฆ Megtekintรฉs itt: %1$s Megvรฉtel ยท %1$s Telepรญtve @@ -2281,6 +2573,12 @@ Rendezรฉs Oldalsรกv-feliratok Nevek megjelenรญtรฉse az oldalsรกv ikonjai alatt. Kapcsolja ki a keskenyebb oldalsรกvhoz. + Az รผgynรถk kisรกllata + A DeeDee az indรญtรณ รฉs a jรกtรฉkok felett lebeg, รฉs megmutatja, mit csinรกl az รผgynรถk. + Mรกs alkalmazรกsok felett + Engedd, hogy DeeDee minden alkalmazรกs felett lebegjen รฉs ott nyissa meg a csevegรฉst + Engedรฉlyezรฉs + Csevegรฉs DeeDee-vel Megjelenรญtรฉs Nagyobb kรกrtyรกk Kisebb kรกrtyรกk @@ -2565,7 +2863,14 @@ %1$s ยท รบjraindรญtรกs szรผksรฉges Ez a kรฉszรผlรฉk Eltรกvolรญtja a %1$s-t? - Diagnosztika + Fejlesztล‘ + Buildcรญmke vรญzjelkรฉnt + A tesztbuild vagy Lab-build cรญmkรฉjรฉnek megjelenรญtรฉse a kรฉpernyล‘n. Alapรฉrtelmezรฉs szerint bekapcsolva. + Diagnosztikai csomagok megosztรกsa + Munkamenet รฉs eszkรถz + Grafika + Jรกtรฉkok รฉs kompatibilitรกs + ร–sszes csomag Kรฉszen รกll a jรกtรฉkra Mรฉg nem รกll kรฉszen a jรกtรฉkra futtatรณkรถrnyezet: %1$s @@ -2604,6 +2909,9 @@ Kapcsold be a GOG-eredmรฉnyeket a Store-beรกllรญtรกsokban Eredmรฉnyek nem elรฉrhetล‘k; nรฉzd meg a munkamenet-naplรณkat Eredmรฉny feloldva + Mali (Venus): ki + Mali (Venus): be + %1$s illesztล‘programja Vulkan %2$s verziรณt jelez. A Mali (Venus) legalรกbb Vulkan 1.2-t igรฉnyel (rรฉgebbi verziรณkon a gamescope nem indul el), ezรฉrt a munkamenetek kihagyjรกk a Venust, รฉs helyette a PanVK illesztล‘programpรกrt hasznรกljรกk. Beillesztรฉs Bal kar Jobb kar @@ -2890,7 +3198,7 @@ Mappa kivรกlasztรกsaโ€ฆ Bรกrmely mappa hasznรกlata SD-kรกrtyรกn vagy USB-meghajtรณn A jรกtรฉkok a kivรกlasztott helyen belรผli Games mappรกba kerรผlnek. A meglรฉvล‘ jรกtรฉkok nem kerรผlnek รกthelyezรฉsre. - Hova kerรผl + Mi foglalja a helyet Steam-jรกtรฉkok Jรกtรฉkadatok Prefixek %1$s ยท workshop %2$s ยท shaderek %3$s @@ -2959,6 +3267,7 @@ A jรกtรฉkokhoz szรผksรฉges VC++ รฉs DirectX telepรญtรฉsek Linux x86-os jรกtรฉkokat futtat Steam-eszkรถz + A Steam ezt azokhoz a jรกtรฉkokhoz tรถlti le, amelyek csalรกs elleni vรฉdelmet tartalmaznak, akkor is, ha ki van kapcsolva. Ha eltรกvolรญtod, a telepรญtรฉsรผk 0%-nรกl elakad. A DroidDeck e futtatรณkรถrnyezet nรฉlkรผl futtat jรกtรฉkokat Proton x86, amit a DroidDeck nem tud futtatni Alapรฉrtelmezett minden jรกtรฉknak @@ -3022,6 +3331,19 @@ Megtartva Nem Steam-es jรกtรฉkok รฉs a megosztott Steam prefix รruhรกzbรณl vagy kรฉzzel hozzรกadott jรกtรฉkok prefixei + A Steam megosztott prefixe + A Steam itt futtatja sajรกt Windows-segรฉdprogramjait + Tรถrli (%1$s). A Steam รบjat hoz lรฉtre, amikor legkรถzelebb szรผksรฉge lesz rรก. + Egy รกruhรกzalkalmazรกs รฉs a vele futรณ jรกtรฉkok + Hasznรกlja: %1$s + Nem Steam-es jรกtรฉk: %1$s + Nem tartozik jรกtรฉkhoz, ezรฉrt megmarad + Kijelรถltek eltรกvolรญtรกsa ยท %1$s + Kijelรถltek eltรกvolรญtรกsa ยท %1$s + Wine-prefixek + A bennรผk lรฉvล‘ mentรฉsek รฉs beรกllรญtรกsok elvesznek; a Steam Cloud-mentรฉsek a fiรณkjรกban maradnak. + Shader-gyorsรญtรณtรกrak + Prefix %1$s ยท shaderek %2$s Letรถltรถtt csomagok Megtartott eredetiek Nincs letรถltรถtt รถsszetevล‘-csomag. @@ -3056,6 +3378,8 @@ DroidDeck ยท %1$d fps A 60 fps simรกbb, de jobban terheli a processzort a Steam indulรกsa kรถzben. A Steam sajรกt beรกllรญtรกsaiban vรกlasztott videรณ itt is megjelenik. Hang + Indรญtรกsi videรณ kihagyรกsa + Egy 0,1 mรกsodperces fekete klipet hasznรกl a Steam indรญtรกsi videรณjakรฉnt. A kรถvetkezล‘ munkamenetben lรฉp รฉrvรฉnybe. Sajรกt videรณ MP4, MOV, MKV vagy WebM. Mรกs formรกtumokat รฉs a %1$d MB-nรกl nagyobb fรกjlokat az eszkรถz 720p WebM-re alakรญtja, legfeljebb %2$d mรกsodpercig. Importรกlรกs @@ -3517,6 +3841,7 @@ Az Alt+Tab, a Win billentyลฑ รฉs a Kezdล‘lap gomb az aktรญv DroidDeck-munkamenetben marad az Android helyett. Kapcsolja be a Fรฉnyerล‘t itt: Beรกllรญtรกs โ†’ Steam-integrรกciรณ Mali hรญd: ki + %1$s nem hasznรกlhatja a Mali hidat (ehhez olyan Mali GPU kell, amelyhez nincs rendszer-illesztล‘programos รบtvonal), ezรฉrt ennek a kapcsolรณnak itt nincs hatรกsa. Mali hรญd: be A(z) %1$s nem Adreno. A kรญsรฉrleti Vulkan hรญd be van kapcsolva: a munkamenet a telefon sajรกt illesztล‘programjรกn keresztรผl rajzol. Hibรกkra szรกmรญts; kรผldd el a munkamenet naplรณit. Biztonsรกgos mรณd @@ -3542,6 +3867,25 @@ Hรกtrรฉbb Modulbeรกllรญtรกsok Modul eltรกvolรญtรกsa + Megjelenรฉs + Ikoncsomag + Rendszer alapรฉrtelmezett + Hรกttรฉr az alkalmazรกs szรญnรฉvel + Ikonmรฉret + Kicsi + Kรถzepes + Nagy + Alkalmazรกsnevek elrejtรฉse + Tรฉrkรถz + Szลฑk + Normรกl + Tรกg + Ikon mรณdosรญtรกsa + Ikon visszaรกllรญtรกsa + Ikonok keresรฉse + Ikonok betรถltรฉseโ€ฆ + Nem talรกlhatรณ ikon. + Egyรฉni ikonok Hozzรกadรกs mappรกhoz รšj mappa Eltรกvolรญtรกs a mappรกbรณl @@ -3657,5 +4001,81 @@ Ez az elrendezรฉs nem importรกlhatรณ Skarlรกtvรถrรถs hรณ + Fehรฉr felรผletek piros kiemelรฉsekkel. + Soundtrackek + Zene + Lejรกtszรกsi beรกllรญtรกsok + Kedvencek + Gyลฑjtemรฉnyek + Mรฉg nincs gyลฑjtemรฉny. Koppints a kรถnyvjelzล‘ ikonra egy lรฉtrehozรกsรกhoz. + Mentve + Gyลฑjtemรฉny lรฉtrehozรกsa + Rendezd a mentรฉseidet + รšj + Lรฉtrehozรกs + Gyลฑjtemรฉny neve + Adj meg egy nevet, amelyet mรกs gyลฑjtemรฉny nem hasznรกl + Kezelรฉs + รtnevezรฉs + Szรกmok hozzรกadรกsa + Hozzรกadรกs (%1$d) + Szรกmok eltรกvolรญtรกsa + Gyลฑjtemรฉny tรถrlรฉse + Tรถrlรถd ezt: %1$s? + A szรกmok az eszkรถzรถdรถn maradnak. Csak a gyลฑjtemรฉny tรถrlล‘dik. + Kijelรถlรฉs + ร–sszes kijelรถlรฉse + Kijelรถlรฉs tรถrlรฉse + %1$d kijelรถlve + Hozzรกadรกs gyลฑjtemรฉnyhez + Hozzรกadรกs a kedvencekhez + Eltรกvolรญtรกs a gyลฑjtemรฉnybล‘l + Szรกmok keresรฉse + Albumsorrend + Leghosszabb elรถl + Legrรถvidebb elรถl + Szรกmok + Hangmagassรกg + Visszaรกllรญtรกs + Csend รกtugrรกsa + Alvรกsidล‘zรญtล‘ + %1$d perc + Szรกm vรฉge + %1$s van hรกtra + Hangszรญnszabรกlyzรณ + Mรฉlyhangerล‘sรญtรฉs + A hangszรญnszabรกlyzรณ nem รฉrhetล‘ el ezen az eszkรถzรถn + Engedรฉlyezรฉs jรกtรฉk kรถzben + A soundtrack szรณljon tovรกbb jรกtรฉk kรถzben + Mรฉg nincs telepรญtett soundtrack. + Soundtrackek keresรฉse + Soundtrack mappa hozzรกadรกsa + Nincs hangfรกjl ebben a mappรกban + Teljes hossz + %1$d szรกm / %2$s + %1$s. lemez + Keverรฉs + Elล‘zล‘ + Lejรกtszรกs + Szรผnet + Kรถvetkezล‘ + Ismรฉtlรฉs kikapcsolva + ร–sszes ismรฉtlรฉse + Egy ismรฉtlรฉse + Hangerล‘ + Nincs hangfรกjl ebben a soundtrackben + Indรญtรกs nem elรฉrhetล‘ + Nincs elรฉrhetล‘ webbรถngรฉszล‘ a hivatkozรกs megnyitรกsรกhoz. + Megfogรกs + Elengedรฉs + Mentรฉs + Tartsd nyomva a visszaรกllรญtรกshoz + รruhรกzak + Kรฉpkockaidล‘ + รtlagos kรฉpkockasebessรฉg + Megjelenรญtล‘ kiszolgรกlรณ + HDR รกllapot + Megjelenรญtve + %1$d / %2$d diff --git a/app/src/main/res/values-in/input_library.xml b/app/src/main/res/values-in/input_library.xml new file mode 100644 index 0000000000..f24780d5cc --- /dev/null +++ b/app/src/main/res/values-in/input_library.xml @@ -0,0 +1,132 @@ + + + Setelan input yang tidak terbaca disimpan dalam salinan pemulihan. Anda dapat terus mengedit profil yang dipulihkan. + Properti + Properti klik + %1$s ยท Klik + Tombol + Stik, pad, dan pemicu + Sembunyikan alat + Pengontrol + Kirim input pengontrol ke Steam Input atau game. + Elemen ini tidak mengirim input pengontrol, mouse, atau keyboard. + Klik mouse + Tindakan DroidDeck + Tindakan + Kecepatan gulir: %1$d langkah/dtk + + Profil baru + + Tata letak baru + %1$s ยท Digunakan oleh %2$d profil. Perubahan berlaku untuk setiap profil yang memakai penetapan ini. + Ganti nama + Hapus + Tambahkan elemen ke tata letak sebelum menetapkan tindakannya. + Tidak dapat menyimpan setelan input + Nama + Mulai dari + Tombol + Stik + Touchpad + D-pad + Pemicu + Selesai + Urungkan + + Tambah + Seret untuk memindahkan. Seret sudut untuk mengubah ukuran. Ketuk Properti untuk menetapkan tindakan. + Mengedit di layar sekunder + Layar yang dipilih tidak tersedia. Hubungkan untuk mengedit tata letak ini pada ukuran sebenarnya. + Buang perubahan tata letak yang belum disimpan? + Tata letak ini digunakan oleh %1$d profil. Perubahan tersimpan berlaku untuk semuanya. + Profil bawaan + Mode desktop + Mode game + Bawaan untuk desktop dan game + Bawaan untuk mode game + Bawaan untuk mode desktop + Setelan perangkat + Kontrol + Tombol, stik, pemicu, dan tombol tambahan + Salin profil + Atur ulang tindakan + Atur ulang tindakan di %1$s ke bawaan profil dasarnya? Tata letak dan profil lain tidak berubah. + Hapus %1$s? Mode yang memakainya akan kembali ke profil bawaan bawaannya. Tata letak tersimpan dan setelan bersama tetap tersedia. + Visibilitas + Berlaku untuk semua profil. Auto menampilkan kontrol layar utama saat tidak ada pengontrol terhubung di mode game. + Edit di layar + Tata letak tersimpanโ€ฆ + Pilih tata letak atau buat sendiri + Pilih Kontrol profil di menu sesi layar sekunder. Pemilih Profil dan Layar sekunder di menu pengontrol menentukan kontrol yang ditampilkan. + Tindakan tombol + Dibagikan dengan %1$s. Edit juga berlaku untuk profil tersebut. + Gunakan ulang setelan + Gunakan setelan dariโ€ฆ + Salin dari profil lain atau biarkan setelan dibagikan + Jadikan mandiri + Pertahankan pengaturan saat ini dan berhenti membagikan perubahan + Tata letak menyimpan elemen dan posisinya. Setiap profil dapat menetapkan tindakannya sendiri. Edit pada ukuran penuh di layar target. + Tata letak saat ini + Hapus tata letak yang tidak terpakai %1$s dan tindakan tersimpannya? + Ganti nama tata letak saat ini + Gunakan ulang %1$s dari profil lain. Sumber kontrol lain tetap tidak berubah. + Biarkan kontrol fisik dibagikan + Secara bawaan, semua kontrol dan tata letak khusus adalah salinan independen. Berbagi hanya menautkan kontrol fisik. + Gunakan elemen dan posisi ini. Berbagi menjaga perubahan geometri mendatang tetap sinkron; tindakan tombol Anda tetap independen. Tata letak berbeda dimulai dengan tindakan yang belum ditetapkan. + Salin kontrol dan tindakan ini, atau tautkan agar perubahan mendatang berlaku untuk kedua profil. + Biarkan dibagikan + Salinan independen + Mulai stik di posisi sentuh + Sembunyikan stik saat tidak digunakan + Alat + Otomatis (%1$s) + Khusus (%1$s) + Simpan sebagai profil baru + Kontrol profil + Profil + Gestur touchpad mouse + Jika ditetapkan ke penunjuk mouse: ketuk untuk klik, tahan untuk menyeret, dan gulir dengan dua jari. + %1$s memiliki penggantian menu cepat. Pilih Otomatis di sana untuk memakai profil bawaan dan ketiga bagian tersimpannya. + Input DroidDeck + Ditahan saat stik digerakkan ke segala arah: tekan di atas 55%, lepas di bawah 35%. Gunakan Tombol arah untuk menetapkan tiap arah secara terpisah. Perintah DroidDeck berjalan sekali per defleksi. Klik stik diatur terpisah. + Ditahan saat menyentuh touchpad; dilepas saat jari diangkat. Perintah DroidDeck berjalan sekali per sentuhan. Klik touchpad diatur terpisah. + Ditahan saat pemicu melewati 55%; dilepas di bawah 35%. Perintah DroidDeck berjalan sekali per penekanan. + Arah gulir + Vertikal + Horizontal + Gulir horizontal + Pengukuran + Aktifkan perekaman, gunakan kontrol dalam sesi berjalan, lalu kembali dan baca hasilnya. Hanya mengukur waktu pengiriman DroidDeck, bukan latensi layar. Perekaman berakhir saat proses aplikasi ditutup. + %1$d kontrol + Tata letak tersimpan lain (%1$d) โ–พ + Sembunyikan tata letak tersimpan lain (%1$d) โ–ด + Beranda / Guide + Kembali ยท satu ketuk + Kembali ยท ketuk dua kali + Kembali ยท dua kali di Steam, sekali di desktop + Di mode Steam. Menahan Kembali juga membuka akses cepat. + Pulihkan ke bawaan + Pilihan panel Anda diingat. Desktop membuka ruang kerja kedua; tidak mengganti sesi atau profil inputnya. + Pengontrol virtual + Jenis pengontrol yang dilihat Steam atau game. + Layar sentuh + Cara sentuhan di layar game ditangani. Tombol profil tetap memakai tindakan yang ditetapkan. + Kursor sentuh + Tampilkan penunjuk untuk sentuhan langsung di layar game. + Sentuh dan tahan + Tindakan mouse saat menahan jari di layar game. + Ketukan tombol Kembali + Tindakan pertama: satu ketuk. Tindakan kedua: dua ketuk. + Tombol sakelar + Ketuk untuk menahan, ketuk lagi untuk melepas. Membuka menu atau mengganti profil melepas tombol. + Bentuk + Membulat + Pil + Lingkaran + Persegi panjang + Label tombol + Teks + Gambar yang diimpor + Tombol diagonal terpisah + Tetapkan tombol untuk setiap diagonal. Diagonal kosong menekan dua arah tetangganya. + Arah tetangga + Tombol layar lama Anda disimpan sebagai profil impor di bawah. Pilih satu untuk dipakai atau diedit. Pilihan profil Anda saat ini dipertahankan. + Tombol layar lama tidak dapat diimpor otomatis. Setelan asli dipertahankan. + diff --git a/app/src/main/res/values-in/input_strings.xml b/app/src/main/res/values-in/input_strings.xml new file mode 100644 index 0000000000..c115e8a9e2 --- /dev/null +++ b/app/src/main/res/values-in/input_strings.xml @@ -0,0 +1,38 @@ + + + Profil input + Profil + Pengontrol fisik + Layar utama + Layar sekunder + Asli / Steam Input + Asli: %1$s + Kirim kontrol pengontrol lain + Dinonaktifkan + Tombol atau kombinasi tombol + Tombol arah + Gerakkan penunjuk + Kecepatan penunjuk: %1$d + Gulir + Gulir vertikal + Tombol kiri mouse + Tombol kanan mouse + Tombol tengah mouse + Buka menu DroidDeck + Tampilkan keyboard + Buka menu Steam + Buka akses cepat Steam + Hapus kontrol + Tambah kontrol + Tombol khusus perangkat + Tetapkan tombol fisik + Lepaskan tombol, lalu pilih Edit, Coba lagi, atau Batal. B atau Kembali membatalkan setelah dilepas. + Coba lagi + Tekan tombol, termasuk tombol Kembali yang dilaporkan sebagai tombol keyboard. Tombol volume dan sistem Android dicadangkan. Penetapan hanya berlaku untuk perangkat ini. + Hapus penetapan + Diagnostik input + Catat waktu pengiriman input + Baca pengukuran + Mengukur pengiriman dari Android hingga publikasi ke transport input yang ada. Tidak termasuk kedatangan Bluetooth, polling tamu, rendering, dan latensi layar. Perekaman mati secara default. + Gunakan penetapan input normal + diff --git a/app/src/main/res/values-in/strings.xml b/app/src/main/res/values-in/strings.xml index 395b199251..9c81a06c3f 100644 --- a/app/src/main/res/values-in/strings.xml +++ b/app/src/main/res/values-in/strings.xml @@ -28,6 +28,8 @@ Jeda sekarang Hentikan sesi Pembuatan frame + Pengaturan untuk game ini + Pengaturan bawaan Pilih mode pembuatan frame Nonaktif DD-FG %1$dร— @@ -183,6 +185,7 @@ Lingkungan grafis PowerVR tidak dapat diunduh. Periksa koneksi dan coba lagi. DirectAudio tidak dapat diunduh, jadi audio gim menggunakan jalur yang lebih lambat di sesi ini. Program ini + Sesi gagal menampilkan gambar ke layar: %1$s. Layar ini menunjukkan alasannya, bukan layar hitam; rinciannya ada di log sesi. Tidak dapat mengunduh klien Steam. Jaringan atau VPN Anda mungkin memblokir server Steam; periksa koneksi lalu coba lagi. Tidak dapat menyiapkan klien Steam. Periksa koneksi dan ruang penyimpanan kosong, lalu coba lagi. %1$s dibuat untuk PC x86 dan berjalan melalui FEX, yang belum terinstal. Mulai Steam sekali saat masuk dan biarkan FEX serta Steam Linux Runtime diunduh, lalu mulai lagi. @@ -384,6 +387,9 @@ Belum didukung di sini Memuat komponenโ€ฆ Tidak dapat menginstal: %1$s + Unduhan ini perlu diperbarui. + Pembaruan mengantre. + Coba lagi pembaruan Terunduh Mengunduh %1$s Menginstal: %1$s @@ -414,6 +420,22 @@ Hanya internal Folder: %1$s Pustaka kedua + Pustaka Steam lainnya + Folder yang bisa dipakai Steam untuk memasang dan menjalankan game, masing-masing dengan namanya sendiri. Menghapus satu folder tidak menghapus game yang ada di penyimpanan. + Tambah pustaka + Ganti nama + Nama pustaka + Pilih folder untuk pustaka + Maksimal %1$d pustaka tambahan + Folder itu sudah menjadi pustaka atau berada di dalam pustaka lain + %1$s ยท tidak tersedia + Berlaku mulai sesi Steam berikutnya + Ditemukan di perangkat ini ยท %1$s ยท %2$s + Tambah + Temukan pustaka di penyimpanan internal + Izinkan akses semua file agar DroidDeck dapat melihat pustaka Steam yang disimpan aplikasi lain di penyimpanan internal + Izinkan + Ditambahkan %1$s, pustaka Steam di dalam folder yang Anda pilih Gim yang melakukan streaming aset dari SD atau penyimpanan bersama dapat tersendat. Diagnostik penyimpanan Mencatat hasil alokasi dan waktu penyimpanan yang disampel di Bagikan log. Dapat memperlambat instalasi saat diaktifkan. Berlaku pada sesi berikutnya. @@ -476,6 +498,7 @@ Aktif Dimulai dengan Steam Dimulai tanpa Steam + Resolusi game Setelan Setelan %1$s Default @@ -563,6 +586,8 @@ Core gim Core gim Core untuk gim. Dengan semua dipilih, Android menjadwalkan secara bebas. + Hemat daya pada game yang stabil + Menjalankan game di core yang lebih lambat selama frame rate-nya stabil, dan mengembalikannya ke core biasanya begitu tertinggal. Antarmuka klien GL berulir (threaded) Dapat membuat menu Steam lebih responsif. @@ -598,7 +623,10 @@ Menonaktifkan bantuan navigasi gamepad milik Proton, yang menggunakan CPU di setiap gim. Jalankan proot tanpa seccomp Dapat memperbaiki galat syscall yang hilang pada beberapa kernel. Dapat mengurangi performa. + Jalankan tanpa proot (eksperimental) + Menjalankan sisi Linux langsung di Android. Berlaku untuk sesi berikutnya. Nonaktifkan jika ada yang gagal dimulai. Jalur cepat proot + Tidak digunakan tanpa proot. Memerlukan filter seccomp milik proot. Pencarian file lebih cepat dan lebih sedikit tersendat. Nonaktifkan jika program tidak dapat menemukan filenya. Gambar kursor di dalam gamescope @@ -681,6 +709,7 @@ Memori grafis Memori swap Level baterai + Sisa waktu baterai Konsumsi daya Jaringan Resolusi @@ -806,6 +835,7 @@ Perangkat didukung GPU belum diuji GPU tidak didukung + GPU melalui jembatan Mali %1$s ยท %2$s %1$s: %2$s Tidak ada backend grafis yang kompatibel untuk %1$s. Steam mungkin menampilkan layar hitam. @@ -835,15 +865,38 @@ Sesi Log sesi Disimpan setelah setiap sesi + Diagnostik lanjutan untuk sesi berikutnya + Merekam log rinci untuk satu sesi. Dapat menurunkan performa dan menggunakan lebih banyak penyimpanan. Nonaktif dengan sendirinya saat sesi dimulai; tinjau log sebelum membagikannya. Log debug gim Sertakan diagnostik Proton, Wine, dan grafis pada peluncuran gim berikutnya. Dapat mengurangi performa dan memakai lebih banyak penyimpanan. Mulai ulang sesi ini untuk menyimpan log debug gim Tidak dapat memperbarui pencatatan log. Periksa tombolnya lalu coba lagi. Alat debug + Log grafis rinci + Antarmuka Steam: rendering GPU + Dengan pasangan driver Xclipse, Steam menggambar halamannya secara perangkat lunak (rendering GPU menampilkan ubin yang rusak). Aktifkan untuk antarmuka Steam yang lebih cepat jika tampilannya terlihat benar di ponsel ini. + dibuat %1$s + %1$s diperbarui ke build terbaru + Jembatan Mali gagal uji mandiri pada %1$s saat sesi terakhir (gambar atau perintah menggambar), sehingga sesi tersebut menggunakan pasangan driver PanVK sebagai gantinya. + Jembatan Mali tidak menemukan cara berbagi memori dengan driver pada %1$s saat sesi terakhir, sehingga sesi tersebut menggunakan pasangan driver PanVK sebagai gantinya. Jembatan ini tidak dapat berfungsi di ponsel ini; menonaktifkannya membuat pasangan PanVK tetap dipakai. + Log Proton, DXVK, dan driver setiap game disertakan dalam log sesi. Selalu aktif bila GPU bukan Adreno. Log sesi terbaru Log sesi tersimpan Menyimpan %1$d terbaru Hapus log + Log sesi yang tersedia + Belum ada log sesi tersimpan. + File ZIP yang dibagikan maupun disimpan menyertakan sesi yang dipilih beserta diagnostik terkait Steam, toko, alat, dan Battle.net. + %1$s ยท %2$s + Sesi saat ini + Bagikan + Simpan ke perangkat + Hapus + Hapus log sesi? + Hapus %1$s? Tindakan ini tidak dapat dibatalkan. + Log sesi tersimpan. + Tidak dapat menyimpan log sesi. + Tidak dapat menghapus log sesi. Setel ulang semua setelan Kembalikan setiap setelan ke nilai bawaannya Setel ulang @@ -870,6 +923,8 @@ Gunakan sebagai Layar Utama DroidDeck dapat menjadi aplikasi Utama DroidDeck tidak pernah ditawarkan sebagai aplikasi Utama + Tombol Beranda membuka + Halaman yang ditampilkan saat DroidDeck menjadi aplikasi Beranda dan Anda menekan tombol Beranda Di Tambahkan Game, setel DroidDeck ke Sertakan Orientasi Orientasi peluncur @@ -883,15 +938,22 @@ Layar penuh Menyembunyikan bilah status dan navigasi Android Menampilkan bilah status dan navigasi Android + Peluncur layar ganda + Otomatis menempatkan bagian peluncur (Steam, Pustaka, Toko, dan bagian lainnya) pada layar kedua bawaan perangkat genggam. Aktif memakai layar kedua mana pun. Nonaktif membuat peluncur tetap di satu layar saja. + Sesi layar ganda + Otomatis menempatkan menu dalam game di layar kedua bawaan alih-alih sebagai pop-over. Aktif memakai layar kedua mana pun. Nonaktif menjaga menu tetap di layar game; Anda masih dapat memilih layar kedua dari menu tersebut. Otomatis Aktif Nonaktif Kontrol layar bawah dalam game + Keyboard Android untuk kolom teks Membuka trackpad dan keyboard di layar kedua saat sesi dimulai. Mengetik untuk layar atas Selesai Aplikasi Utama default Pilih aplikasi Utama + Sembunyikan peluncur dari Aplikasi terbaru saat tidak aktif + Hanya berlaku saat DroidDeck menjadi aplikasi Beranda default dan tidak ada sesi yang berjalan. Pilih Aplikasi Linux (beta) File @@ -1003,9 +1065,172 @@ Preview Perbaikan terbaru, sebelum Stable Terbaru + Salin detail build + Detail build disalin + Lebih baru dari Preview + Anda lebih baru dari Preview + Build ini lebih baru dari Preview terbaru. Build Preview berikutnya akan memperbaruinya. + Pilih build untuk melihat perubahannya atau memasangnya. + Terpasang + Pasang build ini%1$s + Kembali ke build ini%1$s + versionCode %1$d + Commit %1$s + Halaman rilis + PR ini punya commit lebih baru (%1$s). Build pengujiannya belum siap, jadi build ini belum memuatnya. + Ada commit baru, build menunggu + Nomor PR, judul, atau penulis + Tidak ada build pengujian yang cocok + Perlu dibangun ulang (versionCode %1$d) + Pembaruan build pengujian + Build pengujian baru untuk PR #%1$d + %1$s. Buka Pembaruan untuk memasangnya. + Tampilkan lagi (%1$d) + Perlu dibangun ulang untuk versionCode %2$d (%1$d) + Build Preview di main sejak build pengujian ini: %1$d Build pengujian Coba perbaikan sebelum dirilis Tidak ada saat ini + Build Lab + Build Lab + Sedang digunakan + Dijeda setelah Android mengoptimalkan ulang DroidDeck + Tidak dimuat: %1$s + Menunggu mulai ulang + Dipertahankan + Untuk versi lain + Bangun ulang + Menghapus build ini dari perangkat + Mulai ulang dengan build ini + Nonaktifkan + Gunakan + Hapus + Hapus sekarang + Tidak dapat menyiapkan mulai ulang: %1$s. Pasangkan debug nirkabel di Penyiapan lalu coba lagi. + Build Lab terpasang + DroidDeck dimulai ulang pada %1$s + Build Lab dijeda + Android mengoptimalkan ulang DroidDeck, sehingga %1$s tidak dimuat. Buka Pembaruan untuk memulai ulang dengannya. + Build Lab dinonaktifkan + Build itu dibuat untuk versi DroidDeck lain. Disimpan di Pembaruan. + DroidDeck gagal dimulai dengannya dua kali. + Agen + Agen + Agen sedang bekerja + Pasang Claude Code di lingkungan pengguna Linux untuk menggunakan agen. + Tanyakan tentang sebuah game, crash, atau perubahan pada DroidDeck + Kirim + Percakapan baru + Hentikan + Penyimpanan + Hapus + Hapus sekarang + Claude Code + Codex + Kode sumber DroidDeck + Cache unduhan + Perubahan yang tidak di-push akan hilang + Build akan mengunduhnya lagi + Penyiapan dapat memasangnya lagi; sesi login tetap tersimpan + DroidDeck dimulai ulang pada build Lab Anda. Lanjutkan dari mana Anda berhenti. + Tanyakan mengapa sebuah game tidak bisa dijalankan, minta penjelasan sebuah log, atau minta untuk mengubah DroidDeck lalu coba perubahannya di perangkat ini. + Gagal: %1$s + %1$s berakhir (kode keluar %2$d) + Dihentikan + Berakhir tanpa balasan + Coba lagi + Menyiapkan agen + Buat ulang build Lab %1$s saya untuk versi DroidDeck yang terpasang, lalu mulai ulang dengannya. + %1$s masuk ยท %2$s keluar + Sedang berpikir + Pemikiran + Sedang berpikir ยท %1$s + %1$s ยท %2$s + MASUKAN + KELUARAN + Sedang berjalanโ€ฆ + Tidak ada hasil: giliran berakhir lebih dulu + Tidak ada keluaran + Ketik untuk mengantrekan pesan berikutnya + Antrekan + Berikutnya: %1$s + Jangan kirim + Lampirkan + Hapus + Default + Upaya penalaran + Jalankan + Revisi + Belum ada perubahan + Jalankan rencana ini. + Kirim sekarang + Lainnya + Tutup + Terbaru + Sedang bekerja + Konteks + %1$s dari %2$s + Percakapan ini ยท %1$s + Penggunaan muncul setelah balasan pertama + Batas %1$d jam + Batas %1$d menit + Batas mingguan + %1$d%% ยท diatur ulang %2$s + + %1$d berkas + %1$d berkas + + Rencanakan dulu + Rencana + Mengusulkan rencana tanpa mengubah apa pun + Percakapan + Belum ada percakapan + Baru saja + Hapus + Menghapusnya beserta lampirannya + Proses + Tidak ada yang berjalan di ruang pengguna Linux + AGEN + Hentikan + Build Lab + Menyiapkan build Lab + %1$d%% ยท sekitar %2$s lagi + sekitar %1$s lagi + Batalkan + Batalkan build + Memulai + %1$d%% + Mengemas + Memulai ulang DroidDeck pada build tersebut + Selesai + Gagal: %1$s + Siapkan agen + Instal runtime Linux di Penyiapan terlebih dahulu. + Coba lagi + Mulai mengobrol + Koneksi perangkat + Debugging nirkabel, agar agen dapat melihat dan mengendalikan DroidDeck + Instal %1$s + Ke dalam userland Linux, beserta git, gh, dan adb + Masuk ke %1$s + Membuka browser Anda + GitHub + Opsional, untuk membuka pull request + Alat build + Opsional, untuk build Lab di perangkat ini ยท sekitar 5 GB + Agen siap + Selesaikan penyiapan agen + Sudah masuk ke %1$s + Build Lab + build cepat + Build Lab cepat + Mengompilasi versi ini lebih dulu, agar build Lab hanya butuh beberapa menit ยท sekitar 20 menit, cukup sekali + Mengompilasi ยท %1$d%% ยท sekitar %2$s tersisa + Siapkan + Debug nirkabel tidak dapat dijangkau; Pasangkan menyalakannya + Pasangkan + Pasang + Masuk PR #%1$d Tidak dibuat untuk salinan DroidDeck ini Diperbarui %1$s @@ -1241,6 +1466,9 @@ Aplikasi Penyiapan Pembaruan + Lainnya + Edit tab + Tab %1$d%% Lanjutkan %1$s Muncul sebagai /root/ROMs di setiap sesi. Penyimpanan internal berada di /root/Storage. @@ -1262,6 +1490,15 @@ Batalkan antrean Keyboard Android Sembunyikan โœ• + Ukuran di layar + Porsi layar yang dipakai keyboard, termasuk header. + Opasitas + Turunkan agar game di belakang keyboard terlihat. + Tombol tersembunyi + Tombol yang jarang dipakai tidak ditampilkan di keyboard. + Baris Esc dan fungsi + Ins / Del / Home / End / PgUp / PgDn + Tombol panah Luncurkan %1$s Pilih layar. Sekunder: %1$s. Layar sekunder tidak lagi tersedia. @@ -1746,7 +1983,24 @@ Terminal Pegangan Deck + trackpad Dasbor + Desktop + Mulai desktop + Desktop ยท %1$s + Trackpad + Sentuhan langsung + Trackpad. Ketuk untuk sentuhan langsung + Sentuhan langsung. Ketuk untuk trackpad + Memulai desktop KDEโ€ฆ + Desktop ditutup. + Desktop tidak dapat dimulai. Log-nya ada di folder bottom-desktop sesi ini. + Desktop tertutup. Belum ada yang bisa ditampilkan di sini. + Tukar layar + Layar bawah sedang tidak tersedia + Layar game + Tampilkan game di + Layar atas + Layar bawah Unduhan Tidak ada unduhan yang berjalan. Steam @@ -1781,6 +2035,20 @@ Bahan bakar, t Utama %1$s t Cadangan %1$s t + Waktu frame + %1$d s terakhir + rata-rata frame + 1% terendah + frame di atas 33 ms + %1$d / min + Bermain selama %1$s + %1$d inti, hingga %2$s GHz + %1$d inti + game + FPS dari %1$d Hz + Tanda merah adalah batas saat HUD menampilkan suhu berwarna merah. + seluruh perangkat + baterai Kirim data dasbor Otomatis Mengaktifkannya untuk setiap gim yang tercantum di sini, termasuk gim yang ditemukan nanti. Gim yang Anda matikan tetap mati. @@ -1804,6 +2072,10 @@ Mik mati untuk gim ini. Untuk berbicara, aktifkan Mikrofon di setelan Steam DroidDeck (Audio) lalu mulai gim lagi. Volume %1$d%% Statistik dalam gim + HUD layar bawah + Strip di setiap tab + 1% dan 0,1% terendah + Suhu CPU FPS CPU GPU @@ -1975,6 +2247,7 @@ Memulai sesiโ€ฆ %1$d:%2$02d berlalu ยท masih berjalan Mengunduh pembaruan klien Steam ยท %1$d%% + Menerapkan pembaruan klien Steamโ€ฆ Mengunduh klien Steam ยท %1$s Instalasi alat kompatibilitas sedang berjalan @@ -2051,11 +2324,29 @@ Garis luar toon ditambah penajaman. Bukan GPU Adreno + Driver PowerVR sistem: kompatibilitas berbeda tiap perangkat + Eksperimental: RADV atau driver Xclipse sistem + PowerVR sistem + Menggunakan driver bawaan untuk GPU ini + Driver PowerVR sistem dipilih untuk runtime dan tampilan. + Belum ada driver terbuka yang mendukung Mali ini: jembatan Mali aktif. + Ini adalah build uji non-Snapdragon: build resmi di sini hanya berjalan di Adreno, jadi build resmi tidak dipasang menggantikannya. Build uji baru tersedia di github.com/The412Banner/droiddeck-nonadreno-drivers. + Sesi terakhir berakhir karena Android menutup DroidDeck untuk membebaskan memori, bukan karena crash. Tutup aplikasi lain atau turunkan pengaturan tekstur game, lalu coba lagi. + Mali (Venus) + jembatan Mali + Belum ada driver terbuka yang mendukung Mali ini: %1$s digunakan, dengan driver bawaan ponsel. + %1$s belum dirilis: %2$s digunakan sampai rilisnya. + %1$s tidak tersedia, dan driver ponsel ini melaporkan Vulkan %2$s (Venus membutuhkan 1.2): jembatan Mali digunakan. + %1$s belum dirilis: jembatan Mali aktif sampai rilisnya. + Diantrekan: %1$s (menunggu driver runtime yang berbeda) + DXVK disediakan oleh runtime PowerVR sistem. Paket DXVK lain bisa disimpan, tetapi tidak diterapkan dengan driver ini. Didukung Eksperimental: drivernya adalah build uji Dukungan eksperimental Adreno 850: memerlukan driver tampilan dan driver gim eksperimental yang kompatibel; belum diverifikasi di perangkat ini Di bawah perangkat keras yang diuji (Adreno 725 dan lebih baru): mungkin tidak dapat berjalan Tidak didukung: tidak ada backend grafis yang kompatibel untuk GPU ini + Berjalan lewat jembatan Mali, dengan driver Vulkan bawaan ponsel + Tidak didukung saat jembatan Mali nonaktif: Turnip membutuhkan GPU Adreno (Snapdragon) Batas kecepatan GitHub tercapai - coba lagi nanti GitHub merespons HTTP %1$d @@ -2164,7 +2455,6 @@ Toko Steam Khusus - Toko Tingkat kecepatan unduhan Seimbang Cepat @@ -2203,6 +2493,7 @@ Menunggu unduhan Battle.net lainnyaโ€ฆ Buka Battle.net dan masuk sekali, lalu instal gamenya dari sini. Pengunduh Blizzard berhenti: %1$s + Pengunduh Blizzard berhenti berjalan. Kesalahan Blizzard %1$s Perbarui Game Blizzard @@ -2210,6 +2501,7 @@ Terhenti Instal ยท %1$s Dapatkan gratis + Menambahkan ke pustakaโ€ฆ Lihat di %1$s Beli ยท %1$s Terinstal @@ -2256,6 +2548,12 @@ Urutkan Label bilah samping Tampilkan nama di bawah ikon bilah samping. Nonaktifkan untuk bilah samping yang lebih ramping. + Peliharaan agen + DeeDee melayang di atas peluncur dan game serta menampilkan apa yang sedang dilakukan agen. + Di atas aplikasi lain + Izinkan DeeDee melayang di atas semua aplikasi dan membuka obrolannya di sana + Izinkan + Chat dengan DeeDee Tampilan Kartu lebih besar Kartu lebih kecil @@ -2538,7 +2836,14 @@ %1$s ยท perlu mulai ulang Perangkat ini Hapus %1$s? - Diagnostik + Developer + Tanda air label build + Tampilkan label build pengujian atau Lab di layar. Aktif secara default. + Bagikan paket diagnostik + Sesi dan perangkat + Grafis + Game dan kompatibilitas + Semua paket Siap bermain Belum siap bermain runtime %1$s @@ -2577,6 +2882,9 @@ Aktifkan pencapaian GOG di setelan Stores Pencapaian tidak tersedia; periksa log sesi Pencapaian terbuka + Mali (Venus): nonaktif + Mali (Venus): aktif + Driver pada %1$s melaporkan Vulkan %2$s. Mali (Venus) membutuhkan Vulkan 1.2 atau lebih baru (gamescope tidak berjalan di versi yang lebih lama), jadi sesi tidak memakai Venus dan menggunakan pasangan driver PanVK sebagai gantinya. Tempel Stik kiri Stik kanan @@ -2861,7 +3169,7 @@ Pilih folderโ€ฆ Gunakan folder apa pun di kartu SD atau drive USB Game akan disimpan di folder Games di dalam lokasi yang dipilih. Game yang sudah terpasang tidak dipindahkan. - Ke mana perginya + Yang memakai ruang Gim Steam Data gim Prefix %1$s ยท workshop %2$s ยท shader %3$s @@ -2930,6 +3238,7 @@ Instalan VC++ dan DirectX yang dibutuhkan gim Menjalankan gim Linux x86 Alat Steam + Steam mengunduh ini untuk game yang menyertakan anti-cheat, bahkan saat anti-cheat tidak aktif. Menghapusnya membuat instalasi game tersebut mandek di 0% DroidDeck menjalankan gim tanpa runtime ini Proton x86, yang tidak bisa dijalankan DroidDeck Bawaan untuk semua gim @@ -2993,6 +3302,19 @@ Disimpan Gim non-Steam dan prefix Steam bersama Prefix gim dari toko atau yang ditambahkan sendiri + Prefix Steam bersama + Steam menjalankan helper Windows-nya sendiri di sini + Menghapusnya (%1$s). Steam membuat yang baru saat membutuhkannya lagi. + Aplikasi toko dan gim yang berjalan dengannya + Dipakai oleh %1$s + Gim non-Steam %1$s + Tidak cocok dengan gim mana pun, jadi tetap disimpan + Hapus yang dipilih ยท %1$s + Hapus instalasi yang dipilih ยท %1$s + Prefix Wine + Save dan setelan di dalamnya akan hilang; save Steam Cloud tetap di akun Anda. + Cache shader + Prefix %1$s ยท shader %2$s Paket yang diunduh Berkas asli yang disimpan Tidak ada paket komponen yang diunduh. @@ -3027,6 +3349,8 @@ DroidDeck ยท %1$d fps 60 fps terlihat lebih mulus tetapi memakai lebih banyak CPU saat Steam dimulai. Video yang dipilih di pengaturan Steam sendiri juga muncul di sini. Suara + Lewati video pembukaan + Gunakan klip hitam berdurasi 0,1 detik sebagai video pembukaan Steam. Berlaku pada sesi berikutnya. Video sendiri MP4, MOV, MKV, atau WebM. Format lain dan file di atas %1$d MB dikonversi ke WebM 720p di perangkat, hingga %2$d detik. Impor @@ -3488,6 +3812,7 @@ Menjaga Alt+Tab, tombol Win, dan tombol Beranda tetap di sesi DroidDeck yang aktif, bukan di Android. Aktifkan Kecerahan di Penyiapan โ†’ Integrasi Steam Jembatan Mali: mati + %1$s tidak dapat menggunakan jembatan Mali (jembatan ini membutuhkan GPU Mali tanpa jalur driver sistem), sehingga sakelar ini tidak berpengaruh di sini. Jembatan Mali: nyala %1$s bukan Adreno. Jembatan Vulkan eksperimental menyala: sesi menggambar melalui driver ponsel itu sendiri. Bersiaplah menemui bug; kirim log sesi. Mode aman @@ -3513,6 +3838,25 @@ Pindahkan ke belakang Setelan widget Hapus widget + Tampilan + Paket ikon + Default sistem + Latar warna aplikasi + Ukuran ikon + Kecil + Sedang + Besar + Sembunyikan nama aplikasi + Jarak + Rapat + Normal + Longgar + Ubah ikon + Setel ulang ikon + Cari ikon + Memuat ikonโ€ฆ + Ikon tidak ditemukan. + Ikon khusus Tambahkan ke folder Folder baru Keluarkan dari folder @@ -3627,5 +3971,81 @@ Tata letak ini tidak dapat diimpor Salju Kirmizi + Permukaan putih dengan aksen merah. + Soundtrack + Musik + Opsi pemutaran + Favorit + Koleksi + Belum ada koleksi. Ketuk ikon penanda untuk membuatnya. + Tersimpan + Buat koleksi + Atur simpananmu + Baru + Buat + Nama koleksi + Masukkan nama yang tidak dipakai koleksi lain + Kelola + Ganti nama + Tambah lagu + Tambah (%1$d) + Hapus lagu + Hapus koleksi + Hapus %1$s? + Lagu tetap ada di perangkatmu. Hanya koleksinya yang dihapus. + Pilih + Pilih semua + Batalkan semua pilihan + %1$d dipilih + Tambahkan ke koleksi + Tambahkan ke favorit + Hapus dari koleksi + Cari lagu + Urutan album + Terpanjang dulu + Terpendek dulu + Lagu + Nada + Atur ulang + Lewati keheningan + Timer tidur + %1$d mnt + Akhir lagu + Sisa %1$s + Ekualiser + Penguat bass + Ekualiser tidak tersedia di perangkat ini + Aktifkan saat bermain + Tetap putar soundtrack saat game berjalan + Belum ada soundtrack yang terpasang. + Cari soundtrack + Tambahkan folder soundtrack + Tidak ada file audio di folder itu + Total durasi + %1$d trek / %2$s + Disk %1$s + Acak + Sebelumnya + Putar + Jeda + Berikutnya + Ulangi mati + Ulangi semua + Ulangi satu + Volume + Tidak ada file audio di soundtrack ini + Peluncuran tidak tersedia + Tidak ada browser web yang tersedia untuk membuka tautan ini. + Ambil + Lepas + Simpan + Tahan untuk setel ulang + Toko + Waktu frame + Rata-rata laju frame + Server tampilan + Status HDR + Ditampilkan + %1$d dari %2$d diff --git a/app/src/main/res/values-it/input_library.xml b/app/src/main/res/values-it/input_library.xml new file mode 100644 index 0000000000..87061db293 --- /dev/null +++ b/app/src/main/res/values-it/input_library.xml @@ -0,0 +1,132 @@ + + + Il display selezionato non รจ disponibile. Collegalo per modificare questo layout alle sue dimensioni reali. + Ignorare le modifiche al layout non salvate? + Questo layout รจ usato da %1$d profili. Le modifiche salvate valgono per tutti. + Profili predefiniti + Modalitร  desktop + Modalitร  gioco + Predefinito per desktop e gioco + Predefinito per la modalitร  gioco + Predefinito per la modalitร  desktop + Impostazioni del dispositivo + Controlli + Pulsanti, stick, grilletti e tasti extra + Copia profilo + Reimposta azioni + Reimpostare le azioni in %1$s ai valori predefiniti del profilo base? I layout e gli altri profili restano invariati. + Eliminare %1$s? Le modalitร  che lo usano torneranno al profilo predefinito integrato. I layout salvati e le impostazioni condivise resteranno disponibili. + Visibilitร  + Vale per tutti i profili. Auto mostra i controlli dello schermo principale quando in modalitร  gioco non รจ collegato un controller. + Modifica su schermo + Layout salvatiโ€ฆ + Scegli un layout o creane uno tuo + Scegli Controlli profilo nel menu sessione dello schermo secondario. I selettori Profilo e Schermo secondario nel menu del controller scelgono i controlli da mostrare. + Azioni dei pulsanti + Condiviso con %1$s. Le modifiche valgono anche per quei profili. + Riusa impostazioni + Usa impostazioni daโ€ฆ + Copia da un altro profilo o mantieni le impostazioni condivise + Rendi indipendente + Mantieni la configurazione attuale e smetti di condividere le modifiche + I layout memorizzano elementi e posizioni. Ogni profilo puรฒ assegnare le proprie azioni. Modifica a dimensione piena sullo schermo di destinazione. + Layout attuale + Eliminare il layout non usato %1$s e le sue azioni salvate? + Rinomina il layout attuale + Le impostazioni di input illeggibili sono state salvate in una copia di ripristino. Puoi continuare a modificare i profili ripristinati. + Proprietร  + Proprietร  del clic + %1$s ยท Clic + Pulsanti + Stick, pad e grilletti + Nascondi strumenti + Controller + Invia l\'input del controller a Steam Input o al gioco. + Questo elemento non invia input di controller, mouse o tastiera. + Clic del mouse + Azione DroidDeck + Azione + Velocitร  di scorrimento: %1$d passi/s + + Nuovo profilo + + Nuovo layout + %1$s ยท Usato da %2$d profili. Le modifiche valgono per ogni profilo che usa queste assegnazioni. + Rinomina + Elimina + Aggiungi elementi al layout prima di assegnare le loro azioni. + Impossibile salvare le impostazioni di input + Nome + Parti da + Pulsante + Stick + Touchpad + Croce direzionale + Grilletto + Fatto + Annulla + + Aggiungi + Trascina per spostare. Trascina un angolo per ridimensionare. Tocca Proprietร  per assegnare un\'azione. + Modifica sullo schermo secondario + Riusa %1$s da un altro profilo. Le altre sorgenti di controllo restano invariate. + Mantieni condivisi i controlli fisici + Per impostazione predefinita, tutti i controlli e i layout personalizzati sono copie indipendenti. La condivisione collega solo i controlli fisici. + Usa questi elementi e posizioni. La condivisione mantiene sincronizzate le future modifiche alla geometria; le azioni dei pulsanti restano indipendenti. Un layout diverso parte con azioni non assegnate. + Copia questi controlli e azioni, oppure collegali cosรฌ che le modifiche future valgano per entrambi i profili. + Mantieni condiviso + Copia indipendente + Avvia lo stick nel punto toccato + Nascondi lo stick quando non รจ in uso + Strumenti + Auto (%1$s) + Personalizzato (%1$s) + Salva come nuovo profilo + Controlli profilo + Profilo + Gesti del touchpad del mouse + Se assegnato al puntatore del mouse: tocca per fare clic, tieni premuto per trascinare e scorri con due dita. + %1$s ha una sostituzione del menu rapido. Seleziona Auto per usare il suo profilo predefinito e tutte e tre le parti salvate. + Input DroidDeck + Mantenuto mentre lo stick รจ mosso in qualsiasi direzione: pressione sopra il 55%, rilascio sotto il 35%. Usa Tasti direzionali per assegnare ogni direzione separatamente. I comandi DroidDeck vengono eseguiti una volta per deflessione. Il clic dello stick si configura a parte. + Mantenuto mentre tocchi il touchpad; rilasciato quando sollevi il dito. I comandi DroidDeck vengono eseguiti una volta per tocco. Il clic del touchpad si configura a parte. + Mantenuto quando il grilletto supera il 55%; rilasciato sotto il 35%. I comandi DroidDeck vengono eseguiti una volta per pressione. + Direzione di scorrimento + Verticale + Orizzontale + Scorri orizzontalmente + Misurazioni + Attiva la registrazione, usa i controlli in una sessione attiva, poi torna e leggi i risultati. Misura solo il tempo di invio di DroidDeck, non la latenza dello schermo. La registrazione termina alla chiusura del processo dell\'app. + %1$d controlli + Altri layout salvati (%1$d) โ–พ + Nascondi altri layout salvati (%1$d) โ–ด + Home / Guida + Indietro ยท tocco singolo + Indietro ยท doppio tocco + Indietro ยท due volte in Steam, una su desktop + In modalitร  Steam. Tenere premuto Indietro apre anche l\'accesso rapido. + Ripristina i valori predefiniti + La scelta del pannello viene ricordata. Desktop apre un secondo spazio di lavoro; non cambia la sessione nรฉ il suo profilo di input. + Controller virtuale + Il tipo di controller visto da Steam o dal gioco. + Touchscreen + Come vengono gestiti i tocchi sullo schermo di gioco. I pulsanti del profilo mantengono le azioni assegnate. + Cursore tattile + Mostra un puntatore per i tocchi diretti sullo schermo di gioco. + Tocca e tieni premuto + Azione del mouse quando tieni un dito sullo schermo di gioco. + Tocchi del pulsante Indietro + Prima azione: tocco singolo. Seconda azione: doppio tocco. + Pulsante a interruttore + Tocca per tenere premuto, tocca di nuovo per rilasciare. Aprire un menu o cambiare profilo rilascia il pulsante. + Forma + Arrotondata + Pillola + Cerchio + Rettangolo + Etichetta del pulsante + Testo + Immagine importata + Tasti diagonali separati + Assegna un tasto a ogni diagonale. Una diagonale vuota preme le due direzioni vicine. + Direzioni vicine + I tuoi vecchi tasti a schermo sono salvati come profili importati qui sotto. Selezionane uno per usarlo o modificarlo. Le selezioni di profilo attuali sono state mantenute. + I vecchi tasti a schermo non sono stati importati automaticamente. Le impostazioni originali sono state conservate. + diff --git a/app/src/main/res/values-it/input_strings.xml b/app/src/main/res/values-it/input_strings.xml new file mode 100644 index 0000000000..a5e401d1c8 --- /dev/null +++ b/app/src/main/res/values-it/input_strings.xml @@ -0,0 +1,38 @@ + + + Profili di input + Profili + Controller fisico + Schermo principale + Schermo secondario + Nativo / Steam Input + Nativo: %1$s + Invia un altro controllo del controller + Disattivato + Tasto o combinazione di tasti + Tasti direzionali + Sposta il puntatore + Velocitร  del puntatore: %1$d + Scorri + Scorri verticalmente + Tasto sinistro del mouse + Tasto destro del mouse + Tasto centrale del mouse + Apri il menu DroidDeck + Mostra tastiera + Apri il menu Steam + Apri l\'accesso rapido di Steam + Rimuovi controllo + Aggiungi controllo + Tasti specifici del dispositivo + Assegna un tasto fisico + Rilascia il tasto, poi scegli Modifica, Riprova o Annulla. B o Indietro annulla dopo il rilascio. + Riprova + Premi un tasto, incluso un tasto Indietro segnalato come tasto di tastiera. I tasti volume e di sistema Android sono riservati. L\'assegnazione vale solo per questo dispositivo. + Rimuovi assegnazione + Diagnostica input + Registra il tempo di invio dell\'input + Leggi le misurazioni + Misura l\'invio di Android fino alla pubblicazione nel trasporto di input esistente. Esclude l\'arrivo Bluetooth, il polling dell\'ospite, il rendering e la latenza dello schermo. La registrazione รจ disattivata per impostazione predefinita. + Usa l\'assegnazione di input normale + diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 9d7e3392bf..cbca952ea9 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -28,6 +28,8 @@ Sospendi ora Termina sessione Generazione di frame + Impostazioni per questo gioco + Impostazioni predefinite Seleziona la modalitร  di generazione di frame Disattivata DD-FG %1$dร— @@ -183,6 +185,7 @@ Non รจ stato possibile scaricare l\'ambiente grafico PowerVR. Controlla la connessione e riprova. Impossibile scaricare DirectAudio, quindi l\'audio dei giochi usa il percorso piรน lento in questa sessione. Questo programma + La sessione non รจ riuscita a disegnare sullo schermo: %1$s. Questa schermata mostra il motivo al posto di una schermata nera; i log della sessione contengono i dettagli. Impossibile scaricare il client Steam. La rete o la VPN potrebbe bloccare i server di Steam; controlla la connessione e riprova. Impossibile configurare il client Steam. Controlla la connessione e lo spazio libero, poi riprova. %1$s รจ compilato per PC x86 e viene eseguito tramite FEX, che non รจ ancora installato. Avvia Steam una volta dopo aver eseguito l\'accesso e lascia che scarichi FEX e lo Steam Linux Runtime, poi riavvia il programma. @@ -386,6 +389,9 @@ Non ancora supportato qui Caricamento dei componentiโ€ฆ Impossibile installare: %1$s + Questo download richiede un aggiornamento. + Aggiornamento in coda. + Riprova aggiornamento Scaricato Download di %1$s Installazione: %1$s @@ -416,6 +422,22 @@ Solo memoria interna Cartella: %1$s Seconda libreria + Altre librerie Steam + Cartelle in cui Steam puรฒ installare e da cui puรฒ avviare i giochi, ciascuna con il proprio nome. Rimuoverne una lascia i suoi giochi sul disco. + Aggiungi libreria + Rinomina + Nome libreria + Scegli una cartella per la libreria + Al massimo %1$d librerie aggiunte + La cartella รจ giร  una libreria o si trova all\'interno di una + %1$s ยท non disponibile + Si applica dalla prossima sessione di Steam + Trovate su questo dispositivo ยท %1$s ยท %2$s + Aggiungi + Trova librerie nella memoria interna + Consenti l\'accesso a tutti i file affinchรฉ DroidDeck possa vedere le librerie Steam che altre app conservano nella memoria interna + Consenti + Aggiunta %1$s, la libreria Steam contenuta nella cartella scelta I giochi che caricano risorse in streaming dalla SD o dalla memoria condivisa potrebbero scattare. Diagnostica archiviazione Registra i risultati delle allocazioni e campioni dei tempi di archiviazione in Condividi log. Mentre รจ attiva puรฒ rallentare le installazioni. Si applica dalla prossima sessione. @@ -480,6 +502,7 @@ Attivo Si avvia con Steam Si avvia senza Steam + Risoluzione del gioco Impostazioni Impostazioni di %1$s Predefinito @@ -567,6 +590,8 @@ Core dei giochi Core dei giochi Core per i giochi. Con tutti selezionati, Android li gestisce liberamente. + Risparmia energia nei giochi stabili + Esegue un gioco sui core piรน lenti finchรฉ mantiene un frame rate stabile, e lo riporta sui suoi core abituali appena resta indietro. Interfaccia del client GL multithread Puรฒ rendere piรน reattivi i menu di Steam. @@ -602,7 +627,10 @@ Disattiva l\'assistente di navigazione con gamepad di Proton, che consuma CPU in ogni gioco. Esegui proot senza seccomp Puรฒ risolvere errori di syscall mancanti su alcuni kernel. Puรฒ ridurre le prestazioni. + Esegui senza proot (sperimentale) + Avvia la parte Linux direttamente su Android. Si applica alla sessione successiva. Disattivala se qualcosa non si avvia. Percorso veloce di proot + Non utilizzato senza proot. Richiede il filtro seccomp di proot. Ricerca dei file piรน veloce e meno scatti. Disattivalo se un programma non trova i suoi file. Disegna il cursore in gamescope @@ -685,6 +713,7 @@ Memoria grafica Memoria swap Livello batteria + Autonomia residua della batteria Consumo energetico Rete Risoluzione @@ -812,6 +841,7 @@ Dispositivo supportato GPU non testata GPU non supportata + GPU tramite bridge Mali %1$s ยท %2$s %1$s: %2$s Nessun backend grafico compatibile disponibile per %1$s. Steam potrebbe mostrare una schermata nera. @@ -841,15 +871,38 @@ Sessione Log della sessione Salvati dopo ogni sessione + Diagnostica avanzata per la prossima sessione + Acquisisce log dettagliati per una sessione. Puรฒ ridurre le prestazioni e occupare piรน spazio di archiviazione. Si disattiva automaticamente all\'avvio della sessione; controlla i log prima di condividerli. Log di debug dei giochi Includi la diagnostica di Proton, Wine e grafica al prossimo avvio di un gioco. Puรฒ ridurre le prestazioni e occupare piรน spazio. Riavvia questa sessione per salvare i log di debug dei giochi Impossibile aggiornare i log. Controlla l\'interruttore e riprova. Strumenti di debug + Log grafici dettagliati + Interfaccia Steam: rendering GPU + Con la coppia di driver Xclipse, Steam disegna le pagine via software (il rendering GPU mostrava riquadri danneggiati). Attivala per un\'interfaccia Steam piรน veloce, se su questo telefono appare corretta. + compilato %1$s + Aggiornamento di %1$s alla build piรน recente + Il bridge Mali non ha superato il test automatico su %1$s nella sessione precedente (immagini o draw), quindi รจ stata usata la coppia di driver PanVK. + Il bridge Mali non ha trovato alcun modo per condividere la memoria con il driver su %1$s nella sessione precedente, quindi รจ stata usata la coppia di driver PanVK. Il bridge non puรฒ funzionare su questo telefono; disattivarlo mantiene la coppia PanVK. + I log di Proton, DXVK e driver di ogni gioco vengono inclusi nei log della sessione. Sempre attivo quando la GPU non รจ una Adreno. Log dell\'ultima sessione Log delle sessioni salvati Conserva i %1$d piรน recenti Cancella log + Log di sessione disponibili + Ancora nessun log di sessione salvato. + Gli ZIP condivisi e salvati includono la sessione selezionata e i dati diagnostici correlati a Steam, agli store, agli strumenti e a Battle.net. + %1$s ยท %2$s + Sessione corrente + Condividi + Salva sul dispositivo + Elimina + Eliminare i log di sessione? + Eliminare %1$s? Questa operazione non puรฒ essere annullata. + Log di sessione salvati. + Impossibile salvare i log di sessione. + Impossibile eliminare i log di sessione. Modalitร  offline Accedi prima a Steam Launcher @@ -868,6 +921,8 @@ Usa come schermata Home DroidDeck puรฒ essere l\'app Home DroidDeck non viene mai proposta come app Home + Il pulsante Home apre + La pagina mostrata quando DroidDeck รจ l\'app Home e premi il pulsante Home In Aggiungi giochi, imposta DroidDeck su Includi Orientamento Orientamento del launcher @@ -881,15 +936,22 @@ Schermo intero Nasconde la barra di stato e la barra di navigazione di Android Mostra la barra di stato e la barra di navigazione di Android + Launcher a doppio schermo + Automatico colloca le sezioni del launcher (Steam, Libreria, Store e le altre) sullo schermo secondario integrato delle console portatili che ne hanno uno. Con Attivo si usa qualsiasi display secondario. Con Disattivo il launcher resta su un solo schermo. + Sessioni a doppio schermo + Automatico aggancia il menu di gioco allo schermo secondario integrato invece di aprirlo come finestra a comparsa. Con Attivo si usa qualsiasi display secondario. Con Disattivo il menu resta sullo schermo del gioco; da lรฌ puoi comunque scegliere uno schermo secondario. Automatico Attivo Disattivo Controlli sullo schermo inferiore nei giochi + Tastiera Android per i campi di testo Apre il trackpad e la tastiera sul secondo schermo all\'avvio di una sessione. Digitazione per lo schermo superiore Fine App Home predefinita Scegli un\'app Home + Nascondi il launcher dalla schermata Recenti quando รจ inattivo + Si applica solo quando DroidDeck รจ l\'app Home predefinita e nessuna sessione รจ in corso. Scegli App Linux (beta) File @@ -1001,9 +1063,172 @@ Preview Le correzioni piรน recenti, prima di Stable Aggiornato + Copia i dettagli della build + Dettagli della build copiati + Piรน recente di Preview + Sei avanti rispetto a Preview + Questa build รจ piรน recente dell\'ultima Preview. La prossima build Preview la aggiornerร . + Scegli una build per vederne le modifiche o installarla. + Installata + Installa questa build%1$s + Torna a questa build%1$s + versionCode %1$d + Commit %1$s + Pagina della release + La PR ha un commit piรน recente (%1$s). La sua build di test non รจ ancora pronta, quindi questa non lo include. + Commit piรน recente, build in attesa + Numero PR, titolo o autore + Nessuna build di test corrisponde + Da ricompilare (versionCode %1$d) + Aggiornamenti build di test + Nuova build di test per la PR #%1$d + %1$s. Apri Aggiornamenti per installarla. + Mostra altre (%1$d) + Da ricompilare per versionCode %2$d (%1$d) + Build Preview su main dopo questa build di test: %1$d Build di test Prova una correzione prima che venga rilasciata Nessuna al momento + Build lab + Build lab + In uso + In pausa dopo che Android ha riottimizzato DroidDeck + Non caricata: %1$s + In attesa di un riavvio + Mantenuta + Per una versione diversa + Ricostruisci + Elimina questa build dal dispositivo + Riavvia con questa build + Disattiva + Usa + Elimina + Elimina ora + Impossibile preparare il riavvio: %1$s. Abbina il debug wireless in Configurazione e riprova. + Build lab installata + DroidDeck riavviato con %1$s + Build Lab in pausa + Android ha riottimizzato DroidDeck, quindi %1$s non รจ caricata. Apri Aggiornamenti per riavviare con essa. + Build Lab disattivata + รˆ stata compilata per un\'altra versione di DroidDeck. รˆ conservata in Aggiornamenti. + DroidDeck non si รจ avviato con essa due volte + Agente + Agente + L\'agente sta lavorando + Installa Claude Code nella userland Linux per usare l\'agente. + Chiedi di un gioco, di un arresto anomalo o di una modifica a DroidDeck + Invia + Nuova conversazione + Interrompi + Archiviazione + Rimuovi + Rimuovi ora + Claude Code + Codex + Sorgenti di DroidDeck + Cache dei download + Le modifiche non inviate vanno perse + Le build le scaricano di nuovo + La configurazione puรฒ reinstallarlo; gli accessi vengono mantenuti + DroidDeck รจ ripartito con la tua build Lab. Riprendi da dove avevi lasciato. + Chiedigli perchรฉ un gioco non si avvia, di spiegarti un log o di apportare una modifica a DroidDeck e provarla su questo dispositivo. + Non riuscito: %1$s + %1$s terminato (uscita %2$d) + Interrotto + Terminato senza risposta + Riprova + Configurazione dell\'agente in corso + Ricompila la mia build Lab %1$s per la versione installata di DroidDeck e riavvia con essa. + %1$s in entrata ยท %2$s in uscita + Sto pensando + Pensiero + Sto pensando ยท %1$s + %1$s ยท %2$s + INGRESSO + USCITA + In esecuzioneโ€ฆ + Nessun risultato: il turno รจ terminato prima + Nessun output + Digita per mettere in coda il messaggio successivo + Metti in coda + Prossimo: %1$s + Non inviare + Allega + Rimuovi + Predefinito + Livello di ragionamento + Procedi + Rivedi + Ancora nessuna modifica + Procedi con il piano. + Invia ora + Altro + Chiudi + Piรน recente + In elaborazione + Contesto + %1$s su %2$s + Questa conversazione ยท %1$s + L\'utilizzo viene mostrato dopo la prima risposta + Limite di %1$d ore + Limite di %1$d minuti + Limite settimanale + %1$d%% ยท si reimposta %2$s + + %1$d file + %1$d file + + Pianifica prima + Piano + Propone un piano senza modificare nulla + Conversazioni + Ancora nessuna conversazione + Proprio ora + Elimina + La elimina insieme ai suoi allegati + Processi + Nessun processo in esecuzione nello spazio utente Linux + AGENTE + Ferma + Compilazione Lab + Preparazione delle build Lab + %1$d%% ยท circa %2$s rimanenti + circa %1$s rimanenti + Annulla + Annulla la compilazione + Avvio + %1$d%% + Creazione del pacchetto + Riavvio di DroidDeck sul dispositivo + Completato + Non riuscito: %1$s + Configura l\'agente + Installa prima il runtime Linux in Configurazione. + Riprova + Inizia a chattare + Connessione al dispositivo + Debug wireless, cosรฌ l\'agente puรฒ vedere e controllare DroidDeck + Installa %1$s + Nell\'ambiente utente Linux, con git, gh e adb + Accedi a %1$s + Apre il browser + GitHub + Facoltativo, per aprire le pull request + Strumenti di compilazione + Facoltativo, per le compilazioni Lab su questo dispositivo ยท circa 5 GB + Agente pronto + Completa la configurazione dell\'agente + Accesso effettuato a %1$s + Compilazioni Lab + compilazioni rapide + Compilazioni Lab rapide + Questa versione viene compilata in anticipo, cosรฌ le compilazioni Lab richiedono minuti ยท circa 20 minuti una sola volta + Compilazione in corso ยท %1$d%% ยท circa %2$s rimanenti + Prepara + Il debug wireless non รจ raggiungibile; Associa lo attiva + Associa + Installa + Accedi PR #%1$d Non compilata per questa copia di DroidDeck Aggiornato %1$s @@ -1247,6 +1472,9 @@ App Configurazione Aggiornamenti + Altro + Modifica schede + Schede %1$d%% Riprendi %1$s Appare come /root/ROMs in ogni sessione. La memoria interna si trova in /root/Storage. @@ -1268,6 +1496,15 @@ Togli dalla coda Tastiera Android Nascondi โœ• + Dimensioni sullo schermo + Porzione dello schermo occupata dalla tastiera, intestazione inclusa. + Opacitร  + Riducila per vedere il gioco dietro la tastiera. + Tasti nascosti + I tasti che usi raramente non compaiono sulla tastiera. + Esc e riga dei tasti funzione + Ins / Canc / Home / Fine / PgSu / PgGiรน + Tasti freccia Avvia %1$s Scegli uno schermo. Secondario: %1$s. Lo schermo secondario non รจ piรน disponibile. @@ -1786,7 +2023,24 @@ Terminale Impugnature Deck + trackpad Dashboard + Desktop + Avvia il desktop + Desktop ยท %1$s + Trackpad + Tocco diretto + Trackpad. Tocca per il tocco diretto + Tocco diretto. Tocca per il Trackpad + Avvio del desktop KDEโ€ฆ + Il desktop si รจ chiuso. + Non รจ stato possibile avviare il desktop. I log si trovano nella cartella bottom-desktop di questa sessione. + Il desktop รจ chiuso. Ancora niente da mostrare qui. + Scambia schermi + Lo schermo inferiore non รจ libero al momento + Schermo di gioco + Mostra il gioco su + Schermo superiore + Schermo inferiore Download Nessun download in corso. Steam @@ -1821,6 +2075,20 @@ Carburante, t Principale %1$s t Riserva %1$s t + Tempo di frame + ultimi %1$d s + frame medio + Minimo 1% + frame oltre 33 ms + %1$d / min + In gioco da %1$s + %1$d core, fino a %2$s GHz + %1$d core + gioco + FPS a %1$d Hz + Il segno rosso indica dove l\'HUD mostra la temperatura in rosso. + intero dispositivo + batteria Invia dati al cruscotto Automatico Lo attiva per ogni gioco elencato qui, compresi i giochi trovati in seguito. I giochi che disattivi restano disattivati. @@ -1844,6 +2112,10 @@ Il microfono รจ disattivato per questo gioco. Per parlare, attiva Microfono nelle impostazioni Steam di DroidDeck (Audio) e riavvia il gioco. Volume %1$d%% Statistiche di gioco + HUD dello schermo inferiore + Barra su ogni scheda + Minimi 1% e 0,1% + Temperatura CPU FPS CPU GPU @@ -2017,6 +2289,7 @@ Avvio della sessioneโ€ฆ %1$d:%2$02d trascorsi ยท ancora in corso Download dell\'aggiornamento del client Steam ยท %1$d%% + Applicazione dell\'aggiornamento del client Steamโ€ฆ Download del client Steam ยท %1$s รˆ giร  in corso l\'installazione di uno strumento di compatibilitร  @@ -2093,11 +2366,29 @@ Contorni da cartone animato piรน nitidezza. Non รจ una GPU Adreno + Driver PowerVR di sistema: la compatibilitร  varia in base al dispositivo + Sperimentale: RADV o il driver Xclipse di sistema + PowerVR di sistema + Usa i driver integrati per questa GPU + Il driver PowerVR di sistema รจ selezionato per il runtime e lo schermo. + Nessun driver open supporta ancora questa Mali: il bridge Mali รจ attivo. + Questa รจ la build di test non-Snapdragon: le build ufficiali qui funzionano solo su Adreno, quindi non vengono installate al suo posto. Le nuove build di test sono su github.com/The412Banner/droiddeck-nonadreno-drivers. + La sessione precedente รจ terminata perchรฉ Android ha chiuso DroidDeck per liberare memoria, non per un arresto anomalo. Chiudi le altre app o riduci le impostazioni delle texture del gioco, poi riprova. + Mali (Venus) + il bridge Mali + Nessun driver open supporta ancora questa Mali: viene usato %1$s, sul driver del telefono. + %1$s non รจ ancora pubblicato: fino ad allora viene usato %2$s. + %1$s non รจ disponibile e il driver di questo telefono segnala Vulkan %2$s (Venus richiede la versione 1.2): viene usato il bridge Mali. + %1$s non รจ ancora pubblicato: il bridge Mali resta attivo fino ad allora. + In coda: %1$s (in attesa di un driver runtime diverso) + DXVK รจ fornito dal runtime PowerVR di sistema. Gli altri pacchetti DXVK possono essere salvati ma non vengono applicati con questo driver. Supportata Sperimentale: i suoi driver sono build di test Supporto sperimentale per Adreno 850: richiede driver di visualizzazione e di gioco sperimentali compatibili; non verificato su questo dispositivo Inferiore all\'hardware testato (Adreno 725 e successive): potrebbe non funzionare Non supportata: nessun backend grafico compatibile disponibile per questa GPU + Funziona tramite il bridge Mali, sul driver Vulkan del telefono + Non supportato con il bridge Mali disattivato: Turnip richiede una GPU Adreno (Snapdragon) Raggiunto il limite di richieste di GitHub - riprova piรน tardi GitHub ha risposto HTTP %1$d @@ -2206,7 +2497,6 @@ Negozi Steam Personalizzati - Negozi Livello di velocitร  di download Bilanciato Veloce @@ -2245,6 +2535,7 @@ In attesa dell\'altro download di Battle.netโ€ฆ Apri Battle.net ed esegui l\'accesso una volta, poi installa qui i suoi giochi. Il downloader di Blizzard si รจ fermato: %1$s + Il downloader di Blizzard ha smesso di avanzare. Errore Blizzard %1$s Aggiorna Giochi Blizzard @@ -2252,6 +2543,7 @@ Interrotto Installa ยท %1$s Ottieni gratis + Aggiunta alla libreriaโ€ฆ Visualizza su %1$s Acquista ยท %1$s Installato @@ -2298,6 +2590,12 @@ Ordina Etichette della barra laterale Mostra i nomi sotto le icone della barra laterale. Disattivalo per una barra laterale piรน sottile. + Mascotte dell\'agente + DeeDee appare sopra il launcher e i giochi, mostrando cosa sta facendo l\'agente. + Sopra altre app + Consenti a DeeDee di apparire sopra tutte le app e di aprire lรฌ la sua chat + Consenti + Apri la chat con DeeDee Visualizzazione Schede piรน grandi Schede piรน piccole @@ -2581,7 +2879,14 @@ %1$s ยท riavvio in attesa Questo dispositivo Rimuovere %1$s? - Diagnostica + Sviluppatore + Filigrana con etichetta build + Mostra sullo schermo lโ€™etichetta della build di test o Lab. Attiva per impostazione predefinita. + Condividi i pacchetti diagnostici + Sessione e dispositivo + Grafica + Giochi e compatibilitร  + Tutti i pacchetti Pronto per giocare Non ancora pronto per giocare runtime %1$s @@ -2620,6 +2925,9 @@ Attiva gli obiettivi GOG nelle impostazioni Store Obiettivi non disponibili; controlla i log della sessione Obiettivo sbloccato + Mali (Venus): disattivato + Mali (Venus): attivato + Il driver su %1$s segnala Vulkan %2$s. Mali (Venus) richiede Vulkan 1.2 o superiore (gamescope non si avvia sulle versioni precedenti), quindi le sessioni saltano Venus e usano invece la coppia di driver PanVK. Incolla Stick sinistro Stick destro @@ -2919,7 +3227,7 @@ Scegli cartellaโ€ฆ Usa qualsiasi cartella su una scheda SD o un\'unitร  USB I giochi vanno in una cartella Games all\'interno della posizione selezionata. I giochi esistenti non vengono spostati. - Dove finisce + Cosa occupa spazio Giochi Steam Dati dei giochi Prefissi %1$s ยท workshop %2$s ยท shader %3$s @@ -2988,6 +3296,7 @@ Programmi di installazione VC++ e DirectX richiesti dai giochi Esegue i giochi Linux x86 Strumento Steam + Steam scarica questo componente per i giochi che includono un anti-cheat, anche quando รจ disattivato. Rimuoverlo blocca la loro installazione allo 0% DroidDeck esegue i giochi senza questo runtime Proton x86, che DroidDeck non puรฒ eseguire Predefinito per tutti i giochi @@ -3058,6 +3367,19 @@ Conservati Giochi non Steam e prefisso condiviso di Steam Prefissi di giochi aggiunti dagli store o a mano + Prefisso condiviso di Steam + Steam esegue qui i propri strumenti Windows + Lo elimina (%1$s). Steam ne crea uno nuovo la prossima volta che serve. + Un\'app di uno store e i giochi che girano con essa + Usato da %1$s + Gioco non Steam %1$s + Non associato a nessun gioco, quindi viene conservato + Rimuovi selezionati ยท %1$s + Disinstalla selezionati ยท %1$s + Prefissi Wine + Salvataggi e impostazioni al loro interno vanno persi; i salvataggi di Steam Cloud restano nel tuo account. + Cache shader + Prefisso %1$s ยท shader %2$s Pacchetti scaricati Originali conservati Nessun pacchetto di componenti scaricato. @@ -3094,6 +3416,8 @@ DroidDeck ยท %1$d fps 60 fps รจ piรน fluido ma usa piรน CPU durante l\'avvio di Steam. Anche un video scelto nelle impostazioni di Steam compare qui. Audio + Salta il video di avvio + Usa una clip nera di 0,1 secondi come video di avvio di Steam. Dalla sessione successiva. Il tuo video MP4, MOV, MKV o WebM. Altri formati e file oltre %1$d MB vengono convertiti in WebM 720p sul dispositivo, fino a %2$d secondi. Importa @@ -3555,6 +3879,7 @@ Mantiene Alt+Tab, il tasto Win e il tasto Home in una sessione DroidDeck attiva anzichรฉ in Android. Attiva Luminositร  in Configurazione โ†’ Integrazione con Steam Ponte Mali: disattivato + %1$s non puรฒ usare il bridge Mali (richiede una GPU Mali senza un percorso tramite driver di sistema), quindi questo interruttore non ha effetto qui. Ponte Mali: attivo %1$s non รจ una Adreno. Il ponte Vulkan sperimentale รจ attivo: la sessione disegna tramite il driver del telefono. Aspettati bug; invia i log della sessione. Modalitร  sicura @@ -3580,6 +3905,25 @@ Sposta dopo Impostazioni widget Rimuovi widget + Aspetto + Pacchetto icone + Predefinito di sistema + Sfondo col colore dell\'app + Dimensione icone + Piccole + Medie + Grandi + Nascondi nomi delle app + Spaziatura + Stretta + Normale + Ampia + Cambia icona + Ripristina icona + Cerca icone + Caricamento iconeโ€ฆ + Nessuna icona trovata. + Icone personalizzate Aggiungi a cartella Nuova cartella Rimuovi dalla cartella @@ -3696,5 +4040,81 @@ Impossibile importare questo layout Neve scarlatta + Superfici bianche con accenti rossi. + Colonne sonore + Musica + Opzioni di riproduzione + Preferiti + Raccolte + Nessuna raccolta per ora. Tocca l\'icona del segnalibro per crearne una. + Salvati + Crea una raccolta + Organizza i tuoi salvataggi + Nuova + Crea + Nome della raccolta + Inserisci un nome non usato da altre raccolte + Gestisci + Rinomina + Aggiungi brani + Aggiungi (%1$d) + Rimuovi brani + Elimina raccolta + Eliminare %1$s? + I brani restano sul dispositivo. Viene rimossa solo la raccolta. + Seleziona + Seleziona tutto + Deseleziona tutto + %1$d selezionati + Aggiungi alla raccolta + Aggiungi ai preferiti + Rimuovi dalla raccolta + Cerca brani + Ordine dell\'album + Piรน lunghi prima + Piรน brevi prima + Brani + Tonalitร  + Reimposta + Salta i silenzi + Timer di spegnimento + %1$d min + Fine del brano + Restano %1$s + Equalizzatore + Potenziamento bassi + L\'equalizzatore non รจ disponibile su questo dispositivo + Attiva in gioco + Mantieni la colonna sonora in riproduzione durante una partita + Nessuna colonna sonora installata. + Cerca colonne sonore + Aggiungi una cartella di colonna sonora + Nessun file audio in questa cartella + Durata totale + %1$d brani / %2$s + Disco %1$s + Casuale + Precedente + Riproduci + Pausa + Successivo + Ripetizione disattivata + Ripeti tutto + Ripeti uno + Volume + Nessun file audio in questa colonna sonora + Avvio non disponibile + Non รจ disponibile alcun browser web per aprire questo link. + Afferra + Rilascia + Salva + Tieni premuto per ripristinare + Negozi + Tempo frame + Frequenza media fotogrammi + Server di visualizzazione + Stato HDR + Mostrati + %1$d di %2$d diff --git a/app/src/main/res/values-ja/input_library.xml b/app/src/main/res/values-ja/input_library.xml new file mode 100644 index 0000000000..ecf218c491 --- /dev/null +++ b/app/src/main/res/values-ja/input_library.xml @@ -0,0 +1,132 @@ + + + ้ธๆŠžใ—ใŸใƒ‡ใ‚ฃใ‚นใƒ—ใƒฌใ‚คใฏๅˆฉ็”จใงใใพใ›ใ‚“ใ€‚ๆŽฅ็ถšใ™ใ‚‹ใจใ€ใ“ใฎใƒฌใ‚คใ‚ขใ‚ฆใƒˆใ‚’ๅฎŸๅฏธใง็ทจ้›†ใงใใพใ™ใ€‚ + ไฟๅญ˜ใ•ใ‚Œใฆใ„ใชใ„ใƒฌใ‚คใ‚ขใ‚ฆใƒˆใฎๅค‰ๆ›ดใ‚’็ ดๆฃ„ใ—ใพใ™ใ‹๏ผŸ + ใ“ใฎใƒฌใ‚คใ‚ขใ‚ฆใƒˆใฏ %1$d ๅ€‹ใฎใƒ—ใƒญใƒ•ใ‚กใ‚คใƒซใงไฝฟ็”จไธญใงใ™ใ€‚ไฟๅญ˜ใ—ใŸๅค‰ๆ›ดใฏใ™ในใฆใซ้ฉ็”จใ•ใ‚Œใพใ™ใ€‚ + ๆ—ขๅฎšใฎใƒ—ใƒญใƒ•ใ‚กใ‚คใƒซ + ใƒ‡ใ‚นใ‚ฏใƒˆใƒƒใƒ—ใƒขใƒผใƒ‰ + ใ‚ฒใƒผใƒ ใƒขใƒผใƒ‰ + ใƒ‡ใ‚นใ‚ฏใƒˆใƒƒใƒ—ใจใ‚ฒใƒผใƒ ใฎๆ—ขๅฎš + ใ‚ฒใƒผใƒ ใƒขใƒผใƒ‰ใฎๆ—ขๅฎš + ใƒ‡ใ‚นใ‚ฏใƒˆใƒƒใƒ—ใƒขใƒผใƒ‰ใฎๆ—ขๅฎš + ใƒ‡ใƒใ‚คใ‚น่จญๅฎš + ใ‚ณใƒณใƒˆใƒญใƒผใƒซ + ใƒœใ‚ฟใƒณใ€ใ‚นใƒ†ใ‚ฃใƒƒใ‚ฏใ€ใƒˆใƒชใ‚ฌใƒผใ€่ฟฝๅŠ ใ‚ญใƒผ + ใƒ—ใƒญใƒ•ใ‚กใ‚คใƒซใ‚’ใ‚ณใƒ”ใƒผ + ใ‚ขใ‚ฏใ‚ทใƒงใƒณใ‚’ใƒชใ‚ปใƒƒใƒˆ + %1$s ใฎใ‚ขใ‚ฏใ‚ทใƒงใƒณใ‚’ๅŸบๆœฌใƒ—ใƒญใƒ•ใ‚กใ‚คใƒซใฎๆ—ขๅฎšๅ€คใซๆˆปใ—ใพใ™ใ‹๏ผŸใƒฌใ‚คใ‚ขใ‚ฆใƒˆใจไป–ใฎใƒ—ใƒญใƒ•ใ‚กใ‚คใƒซใฏๅค‰ๆ›ดใ•ใ‚Œใพใ›ใ‚“ใ€‚ + %1$s ใ‚’ๅ‰Š้™คใ—ใพใ™ใ‹๏ผŸไฝฟ็”จไธญใฎใƒขใƒผใƒ‰ใฏๅ†…่”ตใฎๆ—ขๅฎšใƒ—ใƒญใƒ•ใ‚กใ‚คใƒซใซๆˆปใ‚Šใพใ™ใ€‚ไฟๅญ˜ๆธˆใฟใƒฌใ‚คใ‚ขใ‚ฆใƒˆใจๅ…ฑๆœ‰่จญๅฎšใฏๅผ•ใ็ถšใๅˆฉ็”จใงใใพใ™ใ€‚ + ่กจ็คบ + ใ™ในใฆใฎใƒ—ใƒญใƒ•ใ‚กใ‚คใƒซใซ้ฉ็”จใ•ใ‚Œใพใ™ใ€‚Auto ใฏใ‚ฒใƒผใƒ ใƒขใƒผใƒ‰ใงใ‚ณใƒณใƒˆใƒญใƒผใƒฉใƒผใŒๆŽฅ็ถšใ•ใ‚Œใฆใ„ใชใ„ใจใใซใƒกใ‚คใƒณ็”ป้ขใฎใ‚ณใƒณใƒˆใƒญใƒผใƒซใ‚’่กจ็คบใ—ใพใ™ใ€‚ + ็”ป้ขไธŠใง็ทจ้›† + ไฟๅญ˜ๆธˆใฟใƒฌใ‚คใ‚ขใ‚ฆใƒˆโ€ฆ + ใƒฌใ‚คใ‚ขใ‚ฆใƒˆใ‚’้ธๆŠžใ™ใ‚‹ใ‹ใ€ๆ–ฐ่ฆไฝœๆˆใ—ใพใ™ + ใ‚ปใ‚ซใƒณใƒ‰็”ป้ขใฎใ‚ปใƒƒใ‚ทใƒงใƒณใƒกใƒ‹ใƒฅใƒผใงใƒ—ใƒญใƒ•ใ‚กใ‚คใƒซใ‚ณใƒณใƒˆใƒญใƒผใƒซใ‚’้ธๆŠžใ—ใพใ™ใ€‚ใ‚ณใƒณใƒˆใƒญใƒผใƒฉใƒผใƒกใƒ‹ใƒฅใƒผใฎใƒ—ใƒญใƒ•ใ‚กใ‚คใƒซใจใ‚ปใ‚ซใƒณใƒ‰็”ป้ขใฎ้ธๆŠžใง่กจ็คบใ™ใ‚‹ใ‚ณใƒณใƒˆใƒญใƒผใƒซใ‚’ๆฑบใ‚ใพใ™ใ€‚ + ใƒœใ‚ฟใƒณใฎใ‚ขใ‚ฏใ‚ทใƒงใƒณ + %1$s ใจๅ…ฑๆœ‰ไธญใ€‚็ทจ้›†ใฏใใ‚Œใ‚‰ใฎใƒ—ใƒญใƒ•ใ‚กใ‚คใƒซใซใ‚‚้ฉ็”จใ•ใ‚Œใพใ™ใ€‚ + ่จญๅฎšใ‚’ๅ†ๅˆฉ็”จ + ่จญๅฎšใฎไฝฟ็”จๅ…ƒโ€ฆ + ๅˆฅใฎใƒ—ใƒญใƒ•ใ‚กใ‚คใƒซใ‹ใ‚‰ใ‚ณใƒ”ใƒผใ™ใ‚‹ใ‹ใ€่จญๅฎšใ‚’ๅ…ฑๆœ‰ใ—ใŸใพใพใซใ—ใพใ™ + ็‹ฌ็ซ‹ใ•ใ›ใ‚‹ + ็พๅœจใฎ่จญๅฎšใ‚’ไฟๆŒใ—ใ€ๅค‰ๆ›ดใฎๅ…ฑๆœ‰ใ‚’ๅœๆญขใ—ใพใ™ + ใƒฌใ‚คใ‚ขใ‚ฆใƒˆใฏ่ฆ็ด ใจไฝ็ฝฎใ‚’ไฟๅญ˜ใ—ใพใ™ใ€‚ใƒ—ใƒญใƒ•ใ‚กใ‚คใƒซใ”ใจใซ็‹ฌ่‡ชใฎใ‚ขใ‚ฏใ‚ทใƒงใƒณใ‚’ๅ‰ฒใ‚Šๅฝ“ใฆใ‚‰ใ‚Œใพใ™ใ€‚ๅฏพ่ฑกใฎ็”ป้ขใงๅฎŸๅฏธใง็ทจ้›†ใ—ใฆใใ ใ•ใ„ใ€‚ + ็พๅœจใฎใƒฌใ‚คใ‚ขใ‚ฆใƒˆ + ๆœชไฝฟ็”จใฎใƒฌใ‚คใ‚ขใ‚ฆใƒˆ %1$s ใจไฟๅญ˜ๆธˆใฟใ‚ขใ‚ฏใ‚ทใƒงใƒณใ‚’ๅ‰Š้™คใ—ใพใ™ใ‹๏ผŸ + ็พๅœจใฎใƒฌใ‚คใ‚ขใ‚ฆใƒˆใฎๅๅ‰ใ‚’ๅค‰ๆ›ด + ่ชญใฟๅ–ใ‚Œใชใ„ๅ…ฅๅŠ›่จญๅฎšใฏๅพฉๅ…ƒ็”จใ‚ณใƒ”ใƒผใซไฟๅญ˜ใ•ใ‚Œใพใ—ใŸใ€‚ๅพฉๅ…ƒใ•ใ‚ŒใŸใƒ—ใƒญใƒ•ใ‚กใ‚คใƒซใฏๅผ•ใ็ถšใ็ทจ้›†ใงใใพใ™ใ€‚ + ใƒ—ใƒญใƒ‘ใƒ†ใ‚ฃ + ใ‚ฏใƒชใƒƒใ‚ฏใฎใƒ—ใƒญใƒ‘ใƒ†ใ‚ฃ + %1$s ยท ใ‚ฏใƒชใƒƒใ‚ฏ + ใƒœใ‚ฟใƒณ + ใ‚นใƒ†ใ‚ฃใƒƒใ‚ฏใ€ใƒ‘ใƒƒใƒ‰ใ€ใƒˆใƒชใ‚ฌใƒผ + ใƒ„ใƒผใƒซใ‚’้š ใ™ + ใ‚ณใƒณใƒˆใƒญใƒผใƒฉใƒผ + ใ‚ณใƒณใƒˆใƒญใƒผใƒฉใƒผๅ…ฅๅŠ›ใ‚’ Steam Input ใพใŸใฏใ‚ฒใƒผใƒ ใซ้€ไฟกใ—ใพใ™ใ€‚ + ใ“ใฎ่ฆ็ด ใฏใ‚ณใƒณใƒˆใƒญใƒผใƒฉใƒผใ€ใƒžใ‚ฆใ‚นใ€ใ‚ญใƒผใƒœใƒผใƒ‰ใฎๅ…ฅๅŠ›ใ‚’่กŒใ„ใพใ›ใ‚“ใ€‚ + ใƒžใ‚ฆใ‚นใ‚ฏใƒชใƒƒใ‚ฏ + DroidDeck ใ‚ขใ‚ฏใ‚ทใƒงใƒณ + ใ‚ขใ‚ฏใ‚ทใƒงใƒณ + ใ‚นใ‚ฏใƒญใƒผใƒซ้€Ÿๅบฆ: %1$d ใ‚นใƒ†ใƒƒใƒ—/็ง’ + + ๆ–ฐใ—ใ„ใƒ—ใƒญใƒ•ใ‚กใ‚คใƒซ + + ๆ–ฐใ—ใ„ใƒฌใ‚คใ‚ขใ‚ฆใƒˆ + %1$s ยท %2$d ๅ€‹ใฎใƒ—ใƒญใƒ•ใ‚กใ‚คใƒซใŒไฝฟ็”จไธญใ€‚ๅค‰ๆ›ดใฏใ“ใฎๅ‰ฒใ‚Šๅฝ“ใฆใ‚’ไฝฟใ†ใ™ในใฆใฎใƒ—ใƒญใƒ•ใ‚กใ‚คใƒซใซ้ฉ็”จใ•ใ‚Œใพใ™ใ€‚ + ๅๅ‰ใ‚’ๅค‰ๆ›ด + ๅ‰Š้™ค + ใ‚ขใ‚ฏใ‚ทใƒงใƒณใ‚’ๅ‰ฒใ‚Šๅฝ“ใฆใ‚‹ๅ‰ใซใ€ใƒฌใ‚คใ‚ขใ‚ฆใƒˆใซ่ฆ็ด ใ‚’่ฟฝๅŠ ใ—ใฆใใ ใ•ใ„ใ€‚ + ๅ…ฅๅŠ›่จญๅฎšใ‚’ไฟๅญ˜ใงใใพใ›ใ‚“ใงใ—ใŸ + ๅๅ‰ + ้–‹ๅง‹ๅ…ƒ + ใƒœใ‚ฟใƒณ + ใ‚นใƒ†ใ‚ฃใƒƒใ‚ฏ + ใ‚ฟใƒƒใƒใƒ‘ใƒƒใƒ‰ + ๅๅญ—ใ‚ญใƒผ + ใƒˆใƒชใ‚ฌใƒผ + ๅฎŒไบ† + ๅ…ƒใซๆˆปใ™ + + ่ฟฝๅŠ  + ใƒ‰ใƒฉใƒƒใ‚ฐใง็งปๅ‹•ใ€‚่ง’ใ‚’ใƒ‰ใƒฉใƒƒใ‚ฐใงใ‚ตใ‚คใ‚บๅค‰ๆ›ดใ€‚ใƒ—ใƒญใƒ‘ใƒ†ใ‚ฃใ‚’ใ‚ฟใƒƒใƒ—ใ—ใฆใ‚ขใ‚ฏใ‚ทใƒงใƒณใ‚’ๅ‰ฒใ‚Šๅฝ“ใฆใพใ™ใ€‚ + ใ‚ตใƒ–็”ป้ขใง็ทจ้›†ไธญ + ๅˆฅใฎใƒ—ใƒญใƒ•ใ‚กใ‚คใƒซใ‹ใ‚‰ %1$s ใ‚’ๅ†ๅˆฉ็”จใ—ใพใ™ใ€‚ไป–ใฎใ‚ณใƒณใƒˆใƒญใƒผใƒซใ‚ฝใƒผใ‚นใฏๅค‰ๆ›ดใ•ใ‚Œใพใ›ใ‚“ใ€‚ + ็‰ฉ็†ใ‚ณใƒณใƒˆใƒญใƒผใƒซใ‚’ๅ…ฑๆœ‰ใ—ใŸใพใพใซใ™ใ‚‹ + ๆ—ขๅฎšใงใฏใ€ใ™ในใฆใฎใ‚ณใƒณใƒˆใƒญใƒผใƒซใจใ‚ซใ‚นใ‚ฟใƒ ใƒฌใ‚คใ‚ขใ‚ฆใƒˆใฏ็‹ฌ็ซ‹ใ—ใŸใ‚ณใƒ”ใƒผใงใ™ใ€‚ๅ…ฑๆœ‰ใฏ็‰ฉ็†ใ‚ณใƒณใƒˆใƒญใƒผใƒซใ ใ‘ใ‚’ใƒชใƒณใ‚ฏใ—ใพใ™ใ€‚ + ใ“ใฎ่ฆ็ด ใจไฝ็ฝฎใ‚’ไฝฟ็”จใ—ใพใ™ใ€‚ๅ…ฑๆœ‰ใ™ใ‚‹ใจไปŠๅพŒใฎใ‚ธใ‚ชใƒกใƒˆใƒชๅค‰ๆ›ดใŒๅŒๆœŸใ•ใ‚Œใพใ™ใŒใ€ใƒœใ‚ฟใƒณใฎใ‚ขใ‚ฏใ‚ทใƒงใƒณใฏ็‹ฌ็ซ‹ใ—ใŸใพใพใงใ™ใ€‚ๅˆฅใฎใƒฌใ‚คใ‚ขใ‚ฆใƒˆใฏๆœชๅ‰ฒใ‚Šๅฝ“ใฆใฎใ‚ขใ‚ฏใ‚ทใƒงใƒณใงๅง‹ใพใ‚Šใพใ™ใ€‚ + ใ“ใ‚Œใ‚‰ใฎใ‚ณใƒณใƒˆใƒญใƒผใƒซใจใ‚ขใ‚ฏใ‚ทใƒงใƒณใ‚’ใ‚ณใƒ”ใƒผใ™ใ‚‹ใ‹ใ€ใƒชใƒณใ‚ฏใ—ใฆไปŠๅพŒใฎ็ทจ้›†ใ‚’ไธกๆ–นใฎใƒ—ใƒญใƒ•ใ‚กใ‚คใƒซใซ้ฉ็”จใ—ใพใ™ใ€‚ + ๅ…ฑๆœ‰ใ—ใŸใพใพใซใ™ใ‚‹ + ็‹ฌ็ซ‹ใ—ใŸใ‚ณใƒ”ใƒผ + ใ‚ฟใƒƒใƒไฝ็ฝฎใ‹ใ‚‰ใ‚นใƒ†ใ‚ฃใƒƒใ‚ฏใ‚’้–‹ๅง‹ + ๆœชไฝฟ็”จๆ™‚ใฏใ‚นใƒ†ใ‚ฃใƒƒใ‚ฏใ‚’้š ใ™ + ใƒ„ใƒผใƒซ + ่‡ชๅ‹• (%1$s) + ใ‚ซใ‚นใ‚ฟใƒ  (%1$s) + ๆ–ฐใ—ใ„ใƒ—ใƒญใƒ•ใ‚กใ‚คใƒซใจใ—ใฆไฟๅญ˜ + ใƒ—ใƒญใƒ•ใ‚กใ‚คใƒซใ‚ณใƒณใƒˆใƒญใƒผใƒซ + ใƒ—ใƒญใƒ•ใ‚กใ‚คใƒซ + ใƒžใ‚ฆใ‚นใ‚ฟใƒƒใƒใƒ‘ใƒƒใƒ‰ใฎใ‚ธใ‚งใ‚นใƒใƒฃใƒผ + ใƒžใ‚ฆใ‚นใƒใ‚คใƒณใ‚ฟใƒผใซๅ‰ฒใ‚Šๅฝ“ใฆใŸๅ ดๅˆ: ใ‚ฟใƒƒใƒ—ใงใ‚ฏใƒชใƒƒใ‚ฏใ€้•ทๆŠผใ—ใงใƒ‰ใƒฉใƒƒใ‚ฐใ€2 ๆœฌๆŒ‡ใงใ‚นใ‚ฏใƒญใƒผใƒซใ—ใพใ™ใ€‚ + %1$s ใซใฏใ‚ฏใ‚คใƒƒใ‚ฏใƒกใƒ‹ใƒฅใƒผใฎไธŠๆ›ธใใŒใ‚ใ‚Šใพใ™ใ€‚[่‡ชๅ‹•] ใ‚’้ธใถใจๆ—ขๅฎšใฎใƒ—ใƒญใƒ•ใ‚กใ‚คใƒซใจไฟๅญ˜ๆธˆใฟใฎ 3 ใคใฎใƒ‘ใƒผใƒ„ใ‚’ไฝฟ็”จใ—ใพใ™ใ€‚ + DroidDeck ๅ…ฅๅŠ› + ใ‚นใƒ†ใ‚ฃใƒƒใ‚ฏใ‚’ใฉใฎๆ–นๅ‘ใซๅ‹•ใ‹ใ—ใฆใ„ใ‚‹้–“ใ‚‚ไฟๆŒใ•ใ‚Œใพใ™: 55% ใ‚’่ถ…ใˆใ‚‹ใจๆŠผไธ‹ใ€35% ใ‚’ไธ‹ๅ›žใ‚‹ใจ่งฃๆ”พใ€‚ๆ–นๅ‘ใ‚ญใƒผใงๅ„ๆ–นๅ‘ใ‚’ๅ€‹ๅˆฅใซๅ‰ฒใ‚Šๅฝ“ใฆใพใ™ใ€‚DroidDeck ใ‚ณใƒžใƒณใƒ‰ใฏ 1 ๅ›žใฎๅ‚พใใซใคใ 1 ๅ›žๅฎŸ่กŒใ•ใ‚Œใพใ™ใ€‚ใ‚นใƒ†ใ‚ฃใƒƒใ‚ฏใฎใ‚ฏใƒชใƒƒใ‚ฏใฏๅˆฅใซ่จญๅฎšใ—ใพใ™ใ€‚ + ใ‚ฟใƒƒใƒใƒ‘ใƒƒใƒ‰ใซ่งฆใ‚Œใฆใ„ใ‚‹้–“ไฟๆŒใ•ใ‚Œใ€ๆŒ‡ใ‚’้›ขใ™ใจ่งฃๆ”พใ•ใ‚Œใพใ™ใ€‚DroidDeck ใ‚ณใƒžใƒณใƒ‰ใฏ 1 ๅ›žใฎใ‚ฟใƒƒใƒใซใคใ 1 ๅ›žๅฎŸ่กŒใ•ใ‚Œใพใ™ใ€‚ใ‚ฟใƒƒใƒใƒ‘ใƒƒใƒ‰ใฎใ‚ฏใƒชใƒƒใ‚ฏใฏๅˆฅใซ่จญๅฎšใ—ใพใ™ใ€‚ + ใƒˆใƒชใ‚ฌใƒผใŒ 55% ใ‚’่ถ…ใˆใ‚‹ใจไฟๆŒใ•ใ‚Œใ€35% ใ‚’ไธ‹ๅ›žใ‚‹ใจ่งฃๆ”พใ•ใ‚Œใพใ™ใ€‚DroidDeck ใ‚ณใƒžใƒณใƒ‰ใฏ 1 ๅ›žใฎๆŠผไธ‹ใซใคใ 1 ๅ›žๅฎŸ่กŒใ•ใ‚Œใพใ™ใ€‚ + ใ‚นใ‚ฏใƒญใƒผใƒซๆ–นๅ‘ + ็ธฆ + ๆจช + ๆจชใซใ‚นใ‚ฏใƒญใƒผใƒซ + ๆธฌๅฎšๅ€ค + ่จ˜้Œฒใ‚’ๆœ‰ๅŠนใซใ—ใ€ๅฎŸ่กŒไธญใฎใ‚ปใƒƒใ‚ทใƒงใƒณใงใ‚ณใƒณใƒˆใƒญใƒผใƒซใ‚’ไฝฟใฃใฆใ‹ใ‚‰ๆˆปใฃใฆ็ตๆžœใ‚’่ชญใฟๅ–ใ‚Šใพใ™ใ€‚ๆธฌๅฎšใ™ใ‚‹ใฎใฏ DroidDeck ใฎ้€ไฟกๆ™‚้–“ใฎใฟใงใ€่กจ็คบ้…ๅปถใฏๅซใฟใพใ›ใ‚“ใ€‚่จ˜้Œฒใฏใ‚ขใƒ—ใƒชใฎใƒ—ใƒญใ‚ปใ‚นใŒ้–‰ใ˜ใ‚‹ใจ็ต‚ไบ†ใ—ใพใ™ใ€‚ + %1$d ๅ€‹ใฎใ‚ณใƒณใƒˆใƒญใƒผใƒซ + ไป–ใฎไฟๅญ˜ๆธˆใฟใƒฌใ‚คใ‚ขใ‚ฆใƒˆ (%1$d) โ–พ + ไป–ใฎไฟๅญ˜ๆธˆใฟใƒฌใ‚คใ‚ขใ‚ฆใƒˆใ‚’้š ใ™ (%1$d) โ–ด + ใƒ›ใƒผใƒ  / Guide + ๆˆปใ‚‹ ยท ใ‚ทใƒณใ‚ฐใƒซใ‚ฟใƒƒใƒ— + ๆˆปใ‚‹ ยท ใƒ€ใƒ–ใƒซใ‚ฟใƒƒใƒ— + ๆˆปใ‚‹ ยท Steam ใงใฏ 2 ๅ›žใ€ใƒ‡ใ‚นใ‚ฏใƒˆใƒƒใƒ—ใงใฏ 1 ๅ›ž + Steam ใƒขใƒผใƒ‰ๆ™‚ใ€‚ๆˆปใ‚‹ใ‚’้•ทๆŠผใ—ใ™ใ‚‹ใจใ‚ฏใ‚คใƒƒใ‚ฏใ‚ขใ‚ฏใ‚ปใ‚นใ‚‚้–‹ใใพใ™ใ€‚ + ๆ—ขๅฎšใซๆˆปใ™ + ใƒ‘ใƒใƒซใฎ้ธๆŠžใฏ่จ˜ๆ†ถใ•ใ‚Œใพใ™ใ€‚ใƒ‡ใ‚นใ‚ฏใƒˆใƒƒใƒ—ใฏ 2 ใค็›ฎใฎใƒฏใƒผใ‚ฏใ‚นใƒšใƒผใ‚นใ‚’้–‹ใใ ใ‘ใงใ€ใ‚ปใƒƒใ‚ทใƒงใƒณใ‚„ใใฎๅ…ฅๅŠ›ใƒ—ใƒญใƒ•ใ‚กใ‚คใƒซใ‚’ๅˆ‡ใ‚Šๆ›ฟใˆใพใ›ใ‚“ใ€‚ + ไปฎๆƒณใ‚ณใƒณใƒˆใƒญใƒผใƒฉใƒผ + Steam ใพใŸใฏใ‚ฒใƒผใƒ ใŒ่ช่ญ˜ใ™ใ‚‹ใ‚ณใƒณใƒˆใƒญใƒผใƒฉใƒผใฎ็จฎ้กžใ€‚ + ใ‚ฟใƒƒใƒใ‚นใ‚ฏใƒชใƒผใƒณ + ใ‚ฒใƒผใƒ ็”ป้ขใฎใ‚ฟใƒƒใƒใฎๆ‰ฑใ„ๆ–นใ€‚ใƒ—ใƒญใƒ•ใ‚กใ‚คใƒซใฎใƒœใ‚ฟใƒณใฏๅ‰ฒใ‚Šๅฝ“ใฆๆธˆใฟใฎใ‚ขใ‚ฏใ‚ทใƒงใƒณใ‚’ไฟใกใพใ™ใ€‚ + ใ‚ฟใƒƒใƒใ‚ซใƒผใ‚ฝใƒซ + ใ‚ฒใƒผใƒ ็”ป้ขใธใฎ็›ดๆŽฅใ‚ฟใƒƒใƒใซใƒใ‚คใƒณใ‚ฟใƒผใ‚’่กจ็คบใ—ใพใ™ใ€‚ + ใ‚ฟใƒƒใƒใ—ใฆ้•ทๆŠผใ— + ใ‚ฒใƒผใƒ ็”ป้ขใงๆŒ‡ใ‚’ๆŠผใ—็ถšใ‘ใŸใจใใฎใƒžใ‚ฆใ‚นๅ‹•ไฝœใ€‚ + ๆˆปใ‚‹ใƒœใ‚ฟใƒณใฎใ‚ฟใƒƒใƒ— + 1 ใค็›ฎใฎใ‚ขใ‚ฏใ‚ทใƒงใƒณ: ใ‚ทใƒณใ‚ฐใƒซใ‚ฟใƒƒใƒ—ใ€‚2 ใค็›ฎใฎใ‚ขใ‚ฏใ‚ทใƒงใƒณ: ใƒ€ใƒ–ใƒซใ‚ฟใƒƒใƒ—ใ€‚ + ใƒˆใ‚ฐใƒซใƒœใ‚ฟใƒณ + ใ‚ฟใƒƒใƒ—ใงไฟๆŒใ€ใ‚‚ใ†ไธ€ๅบฆใ‚ฟใƒƒใƒ—ใง่งฃๆ”พใ€‚ใƒกใƒ‹ใƒฅใƒผใ‚’้–‹ใใ‹ใƒ—ใƒญใƒ•ใ‚กใ‚คใƒซใ‚’ๅˆ‡ใ‚Šๆ›ฟใˆใ‚‹ใจใƒœใ‚ฟใƒณใฏ่งฃๆ”พใ•ใ‚Œใพใ™ใ€‚ + ๅฝข + ่ง’ไธธ + ใƒ”ใƒซ + ๅ†† + ็Ÿฉๅฝข + ใƒœใ‚ฟใƒณใฎใƒฉใƒ™ใƒซ + ใƒ†ใ‚ญใ‚นใƒˆ + ใ‚คใƒณใƒใƒผใƒˆใ—ใŸ็”ปๅƒ + ๅ€‹ๅˆฅใฎๆ–œใ‚ใ‚ญใƒผ + ๅ„ๆ–œใ‚ๆ–นๅ‘ใซใ‚ญใƒผใ‚’ๅ‰ฒใ‚Šๅฝ“ใฆใพใ™ใ€‚็ฉบใฎๆ–œใ‚ใฏ้šฃๆŽฅใ™ใ‚‹ 2 ๆ–นๅ‘ใ‚’ๆŠผใ—ใพใ™ใ€‚ + ้šฃๆŽฅใ™ใ‚‹ๆ–นๅ‘ + ไปฅๅ‰ใฎ็”ป้ขใ‚ญใƒผใฏไธ‹ใฎใ‚คใƒณใƒใƒผใƒˆๆธˆใฟใƒ—ใƒญใƒ•ใ‚กใ‚คใƒซใจใ—ใฆไฟๅญ˜ใ•ใ‚Œใฆใ„ใพใ™ใ€‚1 ใค้ธใ‚“ใงไฝฟ็”จใพใŸใฏ็ทจ้›†ใ—ใพใ™ใ€‚็พๅœจใฎใƒ—ใƒญใƒ•ใ‚กใ‚คใƒซ้ธๆŠžใฏไฟๆŒใ•ใ‚Œใฆใ„ใพใ™ใ€‚ + ไปฅๅ‰ใฎ็”ป้ขใ‚ญใƒผใฏ่‡ชๅ‹•ใงใ‚คใƒณใƒใƒผใƒˆใงใใพใ›ใ‚“ใงใ—ใŸใ€‚ๅ…ƒใฎ่จญๅฎšใฏไฟๆŒใ•ใ‚Œใฆใ„ใพใ™ใ€‚ + diff --git a/app/src/main/res/values-ja/input_strings.xml b/app/src/main/res/values-ja/input_strings.xml new file mode 100644 index 0000000000..ac60ca8e51 --- /dev/null +++ b/app/src/main/res/values-ja/input_strings.xml @@ -0,0 +1,38 @@ + + + ๅ…ฅๅŠ›ใƒ—ใƒญใƒ•ใ‚กใ‚คใƒซ + ใƒ—ใƒญใƒ•ใ‚กใ‚คใƒซ + ็‰ฉ็†ใ‚ณใƒณใƒˆใƒญใƒผใƒฉใƒผ + ใƒกใ‚คใƒณ็”ป้ข + ใ‚ตใƒ–็”ป้ข + ใƒใ‚คใƒ†ใ‚ฃใƒ– / Steam Input + ใƒใ‚คใƒ†ใ‚ฃใƒ–: %1$s + ๅˆฅใฎใ‚ณใƒณใƒˆใƒญใƒผใƒฉใƒผๅ…ฅๅŠ›ใ‚’้€ไฟก + ็„กๅŠน + ใ‚ญใƒผใพใŸใฏใ‚ญใƒผใฎ็ต„ใฟๅˆใ‚ใ› + ๆ–นๅ‘ใ‚ญใƒผ + ใƒใ‚คใƒณใ‚ฟใƒผใ‚’็งปๅ‹• + ใƒใ‚คใƒณใ‚ฟใƒผ้€Ÿๅบฆ: %1$d + ใ‚นใ‚ฏใƒญใƒผใƒซ + ๅž‚็›ดใ‚นใ‚ฏใƒญใƒผใƒซ + ใƒžใ‚ฆใ‚นๅทฆใƒœใ‚ฟใƒณ + ใƒžใ‚ฆใ‚นๅณใƒœใ‚ฟใƒณ + ใƒžใ‚ฆใ‚นไธญใƒœใ‚ฟใƒณ + DroidDeck ใƒกใƒ‹ใƒฅใƒผใ‚’้–‹ใ + ใ‚ญใƒผใƒœใƒผใƒ‰ใ‚’่กจ็คบ + Steam ใƒกใƒ‹ใƒฅใƒผใ‚’้–‹ใ + Steam ใ‚ฏใ‚คใƒƒใ‚ฏใ‚ขใ‚ฏใ‚ปใ‚นใ‚’้–‹ใ + ใ‚ณใƒณใƒˆใƒญใƒผใƒซใ‚’ๅ‰Š้™ค + ใ‚ณใƒณใƒˆใƒญใƒผใƒซใ‚’่ฟฝๅŠ  + ใƒ‡ใƒใ‚คใ‚นๅ›บๆœ‰ใฎใƒœใ‚ฟใƒณ + ็‰ฉ็†ใƒœใ‚ฟใƒณใ‚’ๅ‰ฒใ‚Šๅฝ“ใฆ + ใƒœใ‚ฟใƒณใ‚’้›ขใ—ใฆใ‹ใ‚‰ใ€็ทจ้›†ใƒปๅ†่ฉฆ่กŒใƒปใ‚ญใƒฃใƒณใ‚ปใƒซใฎใ„ใšใ‚Œใ‹ใ‚’้ธๆŠžใ—ใพใ™ใ€‚B ใพใŸใฏๆˆปใ‚‹ใฏ้›ขใ—ใŸๅพŒใซใ‚ญใƒฃใƒณใ‚ปใƒซใ—ใพใ™ใ€‚ + ๅ†่ฉฆ่กŒ + ใƒœใ‚ฟใƒณใ‚’ๆŠผใ—ใฆใใ ใ•ใ„ใ€‚ใ‚ญใƒผใƒœใƒผใƒ‰ใ‚ญใƒผใจใ—ใฆๅ ฑๅ‘Šใ•ใ‚Œใ‚‹ๆˆปใ‚‹ใƒœใ‚ฟใƒณใ‚‚ๅซใฟใพใ™ใ€‚้Ÿณ้‡ใ‚ญใƒผใจ Android ใฎใ‚ทใ‚นใƒ†ใƒ ใ‚ญใƒผใฏไบˆ็ด„ใ•ใ‚Œใฆใ„ใพใ™ใ€‚ๅ‰ฒใ‚Šๅฝ“ใฆใฏใ“ใฎใƒ‡ใƒใ‚คใ‚นใซใฎใฟ้ฉ็”จใ•ใ‚Œใพใ™ใ€‚ + ๅ‰ฒใ‚Šๅฝ“ใฆใ‚’ๅ‰Š้™ค + ๅ…ฅๅŠ›่จบๆ–ญ + ๅ…ฅๅŠ›ใƒ‡ใ‚ฃใ‚นใƒ‘ใƒƒใƒๆ™‚้–“ใ‚’่จ˜้Œฒ + ๆธฌๅฎšๅ€คใ‚’่ชญใฟๅ–ใ‚‹ + Android ใฎใƒ‡ใ‚ฃใ‚นใƒ‘ใƒƒใƒใ‹ใ‚‰ๆ—ขๅญ˜ใฎๅ…ฅๅŠ›ใƒˆใƒฉใƒณใ‚นใƒใƒผใƒˆใธใฎๅ…ฌ้–‹ใพใงใฎๆ™‚้–“ใ‚’ๆธฌๅฎšใ—ใพใ™ใ€‚Bluetooth ใฎๅˆฐ็€ใ€ใ‚ฒใ‚นใƒˆใฎใƒใƒผใƒชใƒณใ‚ฐใ€ๆ็”ปใ€่กจ็คบใฎ้…ๅปถใฏๅซใฟใพใ›ใ‚“ใ€‚่จ˜้Œฒใฏๆ—ขๅฎšใงใ‚ชใƒ•ใงใ™ใ€‚ + ้€šๅธธใฎๅ…ฅๅŠ›ๅ‰ฒใ‚Šๅฝ“ใฆใ‚’ไฝฟ็”จ + diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 2be588f1c8..93dda1d018 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -28,6 +28,8 @@ ไปŠใ™ใไธ€ๆ™‚ๅœๆญข ใ‚ปใƒƒใ‚ทใƒงใƒณใ‚’็ต‚ไบ† ใƒ•ใƒฌใƒผใƒ ็”Ÿๆˆ + ใ“ใฎใ‚ฒใƒผใƒ ใฎ่จญๅฎš + ใƒ‡ใƒ•ใ‚ฉใƒซใƒˆ่จญๅฎš ไฝฟ็”จใ™ใ‚‹ใƒ•ใƒฌใƒผใƒ ็”Ÿๆˆใƒขใƒผใƒ‰ใ‚’้ธๆŠžใ—ใฆใใ ใ•ใ„ ใ‚ชใƒ• DD-FG %1$dร— @@ -183,6 +185,7 @@ PowerVRใฎใ‚ฐใƒฉใƒ•ใ‚ฃใƒƒใ‚ฏใ‚น็’ฐๅขƒใ‚’ใƒ€ใ‚ฆใƒณใƒญใƒผใƒ‰ใงใใพใ›ใ‚“ใงใ—ใŸใ€‚ๆŽฅ็ถšใ‚’็ขบ่ชใ—ใฆใ€ใ‚‚ใ†ไธ€ๅบฆใŠ่ฉฆใ—ใใ ใ•ใ„ใ€‚ DirectAudioใ‚’ใƒ€ใ‚ฆใƒณใƒญใƒผใƒ‰ใงใใชใ‹ใฃใŸใŸใ‚ใ€ใ“ใฎใ‚ปใƒƒใ‚ทใƒงใƒณใงใฏใ‚ฒใƒผใƒ ้ŸณๅฃฐใซไฝŽ้€Ÿใช็ตŒ่ทฏใ‚’ไฝฟ็”จใ—ใพใ™ใ€‚ ใ“ใฎใƒ—ใƒญใ‚ฐใƒฉใƒ  + ใ‚ปใƒƒใ‚ทใƒงใƒณใŒ็”ป้ขใซๆ็”ปใงใใพใ›ใ‚“ใงใ—ใŸ: %1$sใ€‚้ป’ใ„็”ป้ขใฎไปฃใ‚ใ‚Šใซใ€ใ“ใฎ็”ป้ขใง็†็”ฑใ‚’่กจ็คบใ—ใฆใ„ใพใ™ใ€‚่ฉณ็ดฐใฏใ‚ปใƒƒใ‚ทใƒงใƒณใƒญใ‚ฐใซใ‚ใ‚Šใพใ™ใ€‚ Steamใ‚ฏใƒฉใ‚คใ‚ขใƒณใƒˆใ‚’ใƒ€ใ‚ฆใƒณใƒญใƒผใƒ‰ใงใใพใ›ใ‚“ใงใ—ใŸใ€‚ใƒใƒƒใƒˆใƒฏใƒผใ‚ฏใพใŸใฏVPNใŒSteamใฎใ‚ตใƒผใƒใƒผใ‚’ใƒ–ใƒญใƒƒใ‚ฏใ—ใฆใ„ใ‚‹ๅฏ่ƒฝๆ€งใŒใ‚ใ‚Šใพใ™ใ€‚ๆŽฅ็ถšใ‚’็ขบ่ชใ—ใฆใ€ใ‚‚ใ†ไธ€ๅบฆใŠ่ฉฆใ—ใใ ใ•ใ„ใ€‚ Steamใ‚ฏใƒฉใ‚คใ‚ขใƒณใƒˆใ‚’ใ‚ปใƒƒใƒˆใ‚ขใƒƒใƒ—ใงใใพใ›ใ‚“ใงใ—ใŸใ€‚ๆŽฅ็ถšใจ็ฉบใๅฎน้‡ใ‚’็ขบ่ชใ—ใฆใ€ใ‚‚ใ†ไธ€ๅบฆใŠ่ฉฆใ—ใใ ใ•ใ„ใ€‚ %1$sใฏx86 PCๅ‘ใ‘ใซใƒ“ใƒซใƒ‰ใ•ใ‚ŒใฆใŠใ‚Šใ€FEX็ตŒ็”ฑใงๅฎŸ่กŒใ•ใ‚Œใพใ™ใŒใ€FEXใฏใพใ ใ‚คใƒณใ‚นใƒˆใƒผใƒซใ•ใ‚Œใฆใ„ใพใ›ใ‚“ใ€‚ใƒญใ‚ฐใ‚คใƒณใ—ใŸ็Šถๆ…‹ใงไธ€ๅบฆSteamใ‚’่ตทๅ‹•ใ—ใ€FEXใจSteam Linux Runtimeใ‚’ใƒ€ใ‚ฆใƒณใƒญใƒผใƒ‰ใ—ใฆใ‹ใ‚‰ใ€ใ‚‚ใ†ไธ€ๅบฆ่ตทๅ‹•ใ—ใฆใใ ใ•ใ„ใ€‚ @@ -384,6 +387,9 @@ ใ“ใ“ใงใฏใพใ ๆœชๅฏพๅฟœ ใ‚ณใƒณใƒใƒผใƒใƒณใƒˆใ‚’่ชญใฟ่พผใฟไธญโ€ฆ ใ‚คใƒณใ‚นใƒˆใƒผใƒซใงใใพใ›ใ‚“ใงใ—ใŸ: %1$s + ใ“ใฎใƒ€ใ‚ฆใƒณใƒญใƒผใƒ‰ใซใฏๆ›ดๆ–ฐใŒๅฟ…่ฆใงใ™ใ€‚ + ๆ›ดๆ–ฐใ‚’ใ‚ญใƒฅใƒผใซ่ฟฝๅŠ ใ—ใพใ—ใŸใ€‚ + ๆ›ดๆ–ฐใ‚’ๅ†่ฉฆ่กŒ ใƒ€ใ‚ฆใƒณใƒญใƒผใƒ‰ๆธˆใฟ %1$sใ‚’ใƒ€ใ‚ฆใƒณใƒญใƒผใƒ‰ไธญ ใ‚คใƒณใ‚นใƒˆใƒผใƒซไธญ๏ผš%1$s @@ -414,6 +420,22 @@ ๅ†…้ƒจใ‚นใƒˆใƒฌใƒผใ‚ธใฎใฟ ใƒ•ใ‚ฉใƒซใƒ€๏ผš%1$s ็ฌฌ2ใƒฉใ‚คใƒ–ใƒฉใƒช + ่ฟฝๅŠ ใฎ Steam ใƒฉใ‚คใƒ–ใƒฉใƒช + Steam ใŒใ‚ฒใƒผใƒ ใ‚’ใ‚คใƒณใ‚นใƒˆใƒผใƒซใ—ใฆ่ตทๅ‹•ใงใใ‚‹ใƒ•ใ‚ฉใƒซใƒ€ใƒผใงใ™ใ€‚ใใ‚Œใžใ‚Œ็‹ฌ่‡ชใฎๅๅ‰ใง็ฎก็†ใ—ใพใ™ใ€‚ๅ‰Š้™คใ—ใฆใ‚‚ใ‚ฒใƒผใƒ ใฏใƒ‡ใ‚ฃใ‚นใ‚ฏไธŠใซๆฎ‹ใ‚Šใพใ™ใ€‚ + ใƒฉใ‚คใƒ–ใƒฉใƒชใ‚’่ฟฝๅŠ  + ๅๅ‰ใ‚’ๅค‰ๆ›ด + ใƒฉใ‚คใƒ–ใƒฉใƒชๅ + ใƒฉใ‚คใƒ–ใƒฉใƒชใซใ™ใ‚‹ใƒ•ใ‚ฉใƒซใƒ€ใƒผใ‚’้ธๆŠž + ่ฟฝๅŠ ใงใใ‚‹ใƒฉใ‚คใƒ–ใƒฉใƒชใฏๆœ€ๅคง %1$d ๅ€‹ใงใ™ + ใใฎใƒ•ใ‚ฉใƒซใƒ€ใƒผใฏใ™ใงใซใƒฉใ‚คใƒ–ใƒฉใƒชใ‹ใ€ใƒฉใ‚คใƒ–ใƒฉใƒชใฎไธญใซใ‚ใ‚Šใพใ™ + %1$s ยท ๅˆฉ็”จใงใใพใ›ใ‚“ + ๆฌกๅ›žใฎ Steam ใ‚ปใƒƒใ‚ทใƒงใƒณใ‹ใ‚‰้ฉ็”จใ•ใ‚Œใพใ™ + ใ“ใฎใƒ‡ใƒใ‚คใ‚นใง่ฆ‹ใคใ‹ใ‚Šใพใ—ใŸ ยท %1$s ยท %2$s + ่ฟฝๅŠ  + ๅ†…้ƒจใ‚นใƒˆใƒฌใƒผใ‚ธใฎใƒฉใ‚คใƒ–ใƒฉใƒชใ‚’ๆคœ็ดข + ใ™ในใฆใฎใƒ•ใ‚กใ‚คใƒซใธใฎใ‚ขใ‚ฏใ‚ปใ‚นใ‚’่จฑๅฏใ™ใ‚‹ใจใ€DroidDeck ใŒไป–ใฎใ‚ขใƒ—ใƒชใฎๅ†…้ƒจใ‚นใƒˆใƒฌใƒผใ‚ธใซใ‚ใ‚‹ Steam ใƒฉใ‚คใƒ–ใƒฉใƒชใ‚’ๆคœๅ‡บใงใใพใ™ + ่จฑๅฏ + ้ธๆŠžใ—ใŸใƒ•ใ‚ฉใƒซใƒ€ใƒผๅ†…ใฎ Steam ใƒฉใ‚คใƒ–ใƒฉใƒชใงใ‚ใ‚‹ %1$s ใ‚’่ฟฝๅŠ ใ—ใพใ—ใŸ SDใ‚ซใƒผใƒ‰ใพใŸใฏๅ…ฑๆœ‰ใ‚นใƒˆใƒฌใƒผใ‚ธใ‹ใ‚‰ใƒชใ‚ฝใƒผใ‚นใ‚’่ชญใฟๅ–ใ‚‹ใ‚ฒใƒผใƒ ใฏใ‚ซใ‚ฏใคใๅ ดๅˆใŒใ‚ใ‚Šใพใ™ใ€‚ ใ‚นใƒˆใƒฌใƒผใ‚ธ่จบๆ–ญ ๅ‰ฒใ‚Šๅฝ“ใฆ็ตๆžœใจใ‚ตใƒณใƒ—ใƒชใƒณใ‚ฐใ—ใŸใ‚นใƒˆใƒฌใƒผใ‚ธใฎๅ‡ฆ็†ๆ™‚้–“ใ‚’ใ€Œใƒญใ‚ฐใ‚’ๅ…ฑๆœ‰ใ€ใซ่จ˜้Œฒใ—ใพใ™ใ€‚ๆœ‰ๅŠนไธญใฏใ‚คใƒณใ‚นใƒˆใƒผใƒซใŒ้…ใใชใ‚‹ๅ ดๅˆใŒใ‚ใ‚Šใพใ™ใ€‚ๆฌกๅ›žใฎใ‚ปใƒƒใ‚ทใƒงใƒณใงๆœ‰ๅŠนใซใชใ‚Šใพใ™ใ€‚ @@ -476,6 +498,7 @@ ใ‚ชใƒณ Steam ใจไธ€็ท’ใซ่ตทๅ‹• Steam ใชใ—ใง่ตทๅ‹• + ใ‚ฒใƒผใƒ ใฎ่งฃๅƒๅบฆ ่จญๅฎš %1$s ใฎ่จญๅฎš ใƒ‡ใƒ•ใ‚ฉใƒซใƒˆ @@ -563,6 +586,8 @@ ใ‚ฒใƒผใƒ ใ‚ณใ‚ข ใ‚ฒใƒผใƒ ใ‚ณใ‚ข ใ‚ฒใƒผใƒ ใŒไฝฟ็”จใ™ใ‚‹ใ‚ณใ‚ขใ€‚ใ™ในใฆ้ธๆŠžใ™ใ‚‹ใจAndroidใŒ่‡ช็”ฑใซใ‚นใ‚ฑใ‚ธใƒฅใƒผใƒซใ—ใพใ™ใ€‚ + ๅฎ‰ๅฎšใ—ใŸใ‚ฒใƒผใƒ ใง็œ้›ปๅŠ› + ใƒ•ใƒฌใƒผใƒ ใƒฌใƒผใƒˆใŒๅฎ‰ๅฎšใ—ใฆใ„ใ‚‹้–“ใฏใ‚ฒใƒผใƒ ใ‚’ไฝŽ้€Ÿใ‚ณใ‚ขใงๅ‹•ใ‹ใ—ใ€้…ใ‚Œๅง‹ใ‚ใŸใ‚‰ๅ…ƒใฎใ‚ณใ‚ขใซๆˆปใ—ใพใ™ใ€‚ ใ‚ฏใƒฉใ‚คใ‚ขใƒณใƒˆUI GLใƒžใƒซใƒใ‚นใƒฌใƒƒใƒ‰ Steamใƒกใƒ‹ใƒฅใƒผใฎๅฟœ็ญ”ใŒ้€Ÿใใชใ‚‹ๅฏ่ƒฝๆ€งใŒใ‚ใ‚Šใพใ™ใ€‚ @@ -598,7 +623,10 @@ Protonใฎใ‚ณใƒณใƒˆใƒญใƒผใƒฉใƒผใƒŠใƒ“ใ‚ฒใƒผใ‚ทใƒงใƒณ่ฃœๅŠฉใ‚’็„กๅŠนใซใ—ใพใ™ใ€‚ใ“ใ‚Œใฏใ™ในใฆใฎใ‚ฒใƒผใƒ ใงCPUใ‚’ๆถˆ่ฒปใ—ใพใ™ใ€‚ seccompใชใ—ใงprootใ‚’ๅฎŸ่กŒ ไธ€้ƒจใฎใ‚ซใƒผใƒใƒซใงใ€Œใ‚ทใ‚นใƒ†ใƒ ใ‚ณใƒผใƒซใŒ่ฆ‹ใคใ‹ใ‚‰ใชใ„ใ€ใ‚จใƒฉใƒผใŒ่งฃๆถˆใ•ใ‚Œใ‚‹ๅ ดๅˆใŒใ‚ใ‚Šใพใ™ใ€‚ใƒ‘ใƒ•ใ‚ฉใƒผใƒžใƒณใ‚นใŒไฝŽไธ‹ใ™ใ‚‹ๅฏ่ƒฝๆ€งใŒใ‚ใ‚Šใพใ™ใ€‚ + proot ใชใ—ใงๅฎŸ่กŒ (ๅฎŸ้จ“็š„) + Linux ๅดใ‚’ Android ไธŠใง็›ดๆŽฅ่ตทๅ‹•ใ—ใพใ™ใ€‚ๆฌกๅ›žใฎใ‚ปใƒƒใ‚ทใƒงใƒณใ‹ใ‚‰้ฉ็”จใ•ใ‚Œใพใ™ใ€‚่ตทๅ‹•ใซๅคฑๆ•—ใ™ใ‚‹ๅ ดๅˆใฏใ‚ชใƒ•ใซใ—ใฆใใ ใ•ใ„ใ€‚ prootใƒ•ใ‚กใ‚นใƒˆใƒ‘ใ‚น + proot ใชใ—ใงใฏไฝฟ็”จใ•ใ‚Œใพใ›ใ‚“ใ€‚ prootใฎseccompใƒ•ใ‚ฃใƒซใ‚ฟใƒผใŒๅฟ…่ฆใงใ™ใ€‚ ใƒ•ใ‚กใ‚คใƒซๆคœ็ดขใŒ้€Ÿใใชใ‚Šใ€ใ‚นใ‚ฟใƒƒใ‚ฟใƒผใŒๆธ›ใ‚Šใพใ™ใ€‚ใƒ—ใƒญใ‚ฐใƒฉใƒ ใŒใƒ•ใ‚กใ‚คใƒซใ‚’่ฆ‹ใคใ‘ใ‚‰ใ‚Œใชใ„ๅ ดๅˆใฏใ€ใ“ใ‚Œใ‚’ใ‚ชใƒ•ใซใ—ใฆใใ ใ•ใ„ใ€‚ gamescopeๅ†…ใงใ‚ซใƒผใ‚ฝใƒซใ‚’ๆ็”ป @@ -681,6 +709,7 @@ ใ‚ฐใƒฉใƒ•ใ‚ฃใƒƒใ‚ฏใ‚นใƒกใƒขใƒช ใ‚นใƒฏใƒƒใƒ— ใƒใƒƒใƒ†ใƒชใƒผๆฎ‹้‡ + ใƒใƒƒใƒ†ใƒชใƒผๆฎ‹ใ‚Šๆ™‚้–“ ๆถˆ่ฒป้›ปๅŠ› ใƒใƒƒใƒˆใƒฏใƒผใ‚ฏ ่งฃๅƒๅบฆ @@ -806,6 +835,7 @@ ใƒ‡ใƒใ‚คใ‚นใฏใ‚ตใƒใƒผใƒˆใ•ใ‚Œใฆใ„ใพใ™ ๆœชใƒ†ใ‚นใƒˆใฎGPU GPUใฏใ‚ตใƒใƒผใƒˆใ•ใ‚Œใฆใ„ใพใ›ใ‚“ + Mali ใƒ–ใƒชใƒƒใ‚ธ็ตŒ็”ฑใฎ GPU %1$s ยท %2$s %1$s๏ผš%2$s ๅˆฉ็”จใงใใ‚‹ไบ’ๆ›ใ‚ฐใƒฉใƒ•ใ‚ฃใƒƒใ‚ฏใ‚นใƒใƒƒใ‚ฏใ‚จใƒณใƒ‰ใŒใ‚ใ‚Šใพใ›ใ‚“ใ€‚%1$sใงใฏ็”ป้ขใŒ็œŸใฃๆš—ใซใชใ‚‹ๅฏ่ƒฝๆ€งใŒใ‚ใ‚Šใพใ™ใ€‚ @@ -835,15 +865,38 @@ ใ‚ปใƒƒใ‚ทใƒงใƒณ ใ‚ปใƒƒใ‚ทใƒงใƒณใƒญใ‚ฐ ๅ„ใ‚ปใƒƒใ‚ทใƒงใƒณ็ต‚ไบ†ๅพŒใซไฟๅญ˜ + ๆฌกๅ›žใ‚ปใƒƒใ‚ทใƒงใƒณใฎๆ‹กๅผต่จบๆ–ญ + 1 ๅ›žใฎใ‚ปใƒƒใ‚ทใƒงใƒณใง่ฉณ็ดฐใชใƒญใ‚ฐใ‚’่จ˜้Œฒใ—ใพใ™ใ€‚ใƒ‘ใƒ•ใ‚ฉใƒผใƒžใƒณใ‚นใŒไฝŽไธ‹ใ—ใ€ไฝฟ็”จๅฎน้‡ใŒๅข—ใˆใ‚‹ๅ ดๅˆใŒใ‚ใ‚Šใพใ™ใ€‚ใ‚ปใƒƒใ‚ทใƒงใƒณ้–‹ๅง‹ๆ™‚ใซ่‡ชๅ‹•ใงใ‚ชใƒ•ใซใชใ‚Šใพใ™ใ€‚ๅ…ฑๆœ‰ใ™ใ‚‹ๅ‰ใซใƒญใ‚ฐใ‚’็ขบ่ชใ—ใฆใใ ใ•ใ„ใ€‚ ใ‚ฒใƒผใƒ ใฎใƒ‡ใƒใƒƒใ‚ฐใƒญใ‚ฐ ๆฌกๅ›žใฎใ‚ฒใƒผใƒ ่ตทๅ‹•ๆ™‚ใซProtonใ€Wineใ€ใ‚ฐใƒฉใƒ•ใ‚ฃใƒƒใ‚ฏใ‚นใฎ่จบๆ–ญๆƒ…ๅ ฑใ‚’ๅซใ‚ใพใ™ใ€‚ใƒ‘ใƒ•ใ‚ฉใƒผใƒžใƒณใ‚นใŒไฝŽไธ‹ใ—ใ€ใ‚นใƒˆใƒฌใƒผใ‚ธใ‚’ๅคšใไฝฟ็”จใ™ใ‚‹ๅ ดๅˆใŒใ‚ใ‚Šใพใ™ใ€‚ ใ‚ฒใƒผใƒ ใฎใƒ‡ใƒใƒƒใ‚ฐใƒญใ‚ฐใ‚’ไฟๅญ˜ใ™ใ‚‹ใซใฏใ“ใฎใ‚ปใƒƒใ‚ทใƒงใƒณใ‚’ๅ†่ตทๅ‹•ใ—ใฆใใ ใ•ใ„ ใƒญใ‚ฐ่จญๅฎšใ‚’ๆ›ดๆ–ฐใงใใพใ›ใ‚“ใงใ—ใŸใ€‚ใ‚นใ‚คใƒƒใƒใ‚’็ขบ่ชใ—ใฆใ€ใ‚‚ใ†ไธ€ๅบฆใŠ่ฉฆใ—ใใ ใ•ใ„ใ€‚ ใƒ‡ใƒใƒƒใ‚ฐใƒ„ใƒผใƒซ + ่ฉณ็ดฐใชใ‚ฐใƒฉใƒ•ใ‚ฃใƒƒใ‚ฏใ‚นใƒญใ‚ฐ + Steam ใ‚คใƒณใ‚ฟใƒผใƒ•ใ‚งใƒผใ‚น: GPU ๆ็”ป + Xclipse ใƒ‰ใƒฉใ‚คใƒใƒผใฎ็ต„ใฟๅˆใ‚ใ›ใงใฏใ€Steam ใฏใ‚ฝใƒ•ใƒˆใ‚ฆใ‚งใ‚ขใงใƒšใƒผใ‚ธใ‚’ๆ็”ปใ—ใพใ™ (GPU ๆ็”ปใงใฏใ‚ฟใ‚คใƒซใŒไนฑใ‚Œใพใ—ใŸ)ใ€‚ใ“ใฎ็ซฏๆœซใง่กจ็คบใŒๆญฃใ—ใ‘ใ‚Œใฐใ€ใ‚ชใƒณใซใ™ใ‚‹ใจ Steam ใ‚คใƒณใ‚ฟใƒผใƒ•ใ‚งใƒผใ‚นใŒ้ซ˜้€ŸๅŒ–ใ—ใพใ™ใ€‚ + %1$s ใซใƒ“ใƒซใƒ‰ + %1$s ใ‚’ๆœ€ๆ–ฐใƒ“ใƒซใƒ‰ใซๆ›ดๆ–ฐใ—ใพใ—ใŸ + ๅ‰ๅ›žใฎใ‚ปใƒƒใ‚ทใƒงใƒณใง %1$s ไธŠใฎ Mali ใƒ–ใƒชใƒƒใ‚ธใŒ่‡ชๅทฑ่จบๆ–ญ๏ผˆ็”ปๅƒใพใŸใฏๆ็”ป๏ผ‰ใซๅคฑๆ•—ใ—ใŸใŸใ‚ใ€ไปฃใ‚ใ‚Šใซ PanVK ใƒ‰ใƒฉใ‚คใƒใƒผใƒšใ‚ขใ‚’ไฝฟ็”จใ—ใพใ—ใŸใ€‚ + ๅ‰ๅ›žใฎใ‚ปใƒƒใ‚ทใƒงใƒณใง %1$s ไธŠใฎ Mali ใƒ–ใƒชใƒƒใ‚ธใŒใƒ‰ใƒฉใ‚คใƒใƒผใจใƒกใƒขใƒชใ‚’ๅ…ฑๆœ‰ใ™ใ‚‹ๆ‰‹ๆฎตใ‚’่ฆ‹ใคใ‘ใ‚‰ใ‚Œใชใ‹ใฃใŸใŸใ‚ใ€ไปฃใ‚ใ‚Šใซ PanVK ใƒ‰ใƒฉใ‚คใƒใƒผใƒšใ‚ขใ‚’ไฝฟ็”จใ—ใพใ—ใŸใ€‚ใ“ใฎ็ซฏๆœซใงใฏใƒ–ใƒชใƒƒใ‚ธใฏๅ‹•ไฝœใ—ใพใ›ใ‚“ใ€‚ใ‚ชใƒ•ใซใ™ใ‚‹ใจ PanVK ใƒšใ‚ขใŒ็ถญๆŒใ•ใ‚Œใพใ™ใ€‚ + ใ‚ฒใƒผใƒ ใ”ใจใฎ Protonใ€DXVKใ€ใƒ‰ใƒฉใ‚คใƒใƒผใฎใƒญใ‚ฐใ‚’ใ‚ปใƒƒใ‚ทใƒงใƒณใฎใƒญใ‚ฐใซๅซใ‚ใพใ™ใ€‚GPU ใŒ Adreno ไปฅๅค–ใฎๅ ดๅˆใฏๅธธใซๆœ‰ๅŠนใงใ™ใ€‚ ๆœ€ๆ–ฐใฎใ‚ปใƒƒใ‚ทใƒงใƒณใƒญใ‚ฐ ไฟๅญ˜ใ•ใ‚ŒใŸใ‚ปใƒƒใ‚ทใƒงใƒณใƒญใ‚ฐ ๆœ€ๆ–ฐใฎ%1$dไปถใ‚’ไฟๆŒ ใƒญใ‚ฐใ‚’ๆถˆๅŽป + ๅˆฉ็”จๅฏ่ƒฝใชใ‚ปใƒƒใ‚ทใƒงใƒณใƒญใ‚ฐ + ไฟๅญ˜ใ•ใ‚ŒใŸใ‚ปใƒƒใ‚ทใƒงใƒณใƒญใ‚ฐใฏใพใ ใ‚ใ‚Šใพใ›ใ‚“ใ€‚ + ๅ…ฑๆœ‰ใƒปไฟๅญ˜ใ—ใŸ ZIP ใซใฏใ€้ธๆŠžใ—ใŸใ‚ปใƒƒใ‚ทใƒงใƒณใซๅŠ ใˆใ€้–ข้€ฃใ™ใ‚‹ Steamใ€ใ‚นใƒˆใ‚ขใ€ใƒ„ใƒผใƒซใ€Battle.net ใฎ่จบๆ–ญๆƒ…ๅ ฑใŒๅซใพใ‚Œใพใ™ใ€‚ + %1$s ยท %2$s + ็พๅœจใฎใ‚ปใƒƒใ‚ทใƒงใƒณ + ๅ…ฑๆœ‰ + ็ซฏๆœซใซไฟๅญ˜ + ๅ‰Š้™ค + ใ‚ปใƒƒใ‚ทใƒงใƒณใƒญใ‚ฐใ‚’ๅ‰Š้™คใ—ใพใ™ใ‹๏ผŸ + %1$s ใ‚’ๅ‰Š้™คใ—ใพใ™ใ‹๏ผŸใ“ใฎๆ“ไฝœใฏๅ–ใ‚Šๆถˆใ›ใพใ›ใ‚“ใ€‚ + ใ‚ปใƒƒใ‚ทใƒงใƒณใƒญใ‚ฐใ‚’ไฟๅญ˜ใ—ใพใ—ใŸใ€‚ + ใ‚ปใƒƒใ‚ทใƒงใƒณใƒญใ‚ฐใ‚’ไฟๅญ˜ใงใใพใ›ใ‚“ใงใ—ใŸใ€‚ + ใ‚ปใƒƒใ‚ทใƒงใƒณใƒญใ‚ฐใ‚’ๅ‰Š้™คใงใใพใ›ใ‚“ใงใ—ใŸใ€‚ ใ™ในใฆใฎ่จญๅฎšใ‚’ใƒชใ‚ปใƒƒใƒˆ ใ™ในใฆใฎ่จญๅฎšใ‚’ใƒ‡ใƒ•ใ‚ฉใƒซใƒˆใซๆˆปใ—ใพใ™ ใƒชใ‚ปใƒƒใƒˆ @@ -870,6 +923,8 @@ ใƒ›ใƒผใƒ ็”ป้ขใจใ—ใฆไฝฟ็”จ DroidDeckใ‚’ใƒ›ใƒผใƒ ใ‚ขใƒ—ใƒชใจใ—ใฆไฝฟ็”จใงใใพใ™ DroidDeckใฏใƒ›ใƒผใƒ ใ‚ขใƒ—ใƒชใจใ—ใฆๆไพ›ใ•ใ‚Œใพใ›ใ‚“ + ใƒ›ใƒผใƒ ใƒœใ‚ฟใƒณใง้–‹ใใƒšใƒผใ‚ธ + DroidDeck ใŒใƒ›ใƒผใƒ ใ‚ขใƒ—ใƒชใฎใจใใซใƒ›ใƒผใƒ ใƒœใ‚ฟใƒณใ‚’ๆŠผใ™ใจ่กจ็คบใ•ใ‚Œใ‚‹ใƒšใƒผใ‚ธ ใ€Œใ‚ฒใƒผใƒ ใ‚’่ฟฝๅŠ ใ€ใง DroidDeck ใ‚’ใ€Œๅซใ‚ใ‚‹ใ€ใซ่จญๅฎšใ—ใฆใใ ใ•ใ„ ็”ป้ขใฎๅ‘ใ ใƒฉใƒณใƒใƒฃใƒผใฎๅ‘ใ @@ -883,15 +938,22 @@ ๅ…จ็”ป้ข Androidใฎใ‚นใƒ†ใƒผใ‚ฟใ‚นใƒใƒผใจใƒŠใƒ“ใ‚ฒใƒผใ‚ทใƒงใƒณใƒใƒผใ‚’้ž่กจ็คบ Androidใฎใ‚นใƒ†ใƒผใ‚ฟใ‚นใƒใƒผใจใƒŠใƒ“ใ‚ฒใƒผใ‚ทใƒงใƒณใƒใƒผใ‚’่กจ็คบ + ใƒ‡ใƒฅใ‚ขใƒซใ‚นใ‚ฏใƒชใƒผใƒณใƒฉใƒณใƒใƒฃใƒผ + ่‡ชๅ‹•ใงใฏใ€ๅ†…่”ตใ‚ปใ‚ซใƒณใƒ‰ใ‚นใ‚ฏใƒชใƒผใƒณใ‚’ๆญ่ผ‰ใ—ใŸๆบๅธฏใ‚ฒใƒผใƒ ๆฉŸใงใ€ใƒฉใƒณใƒใƒฃใƒผใฎๅ„ใ‚ปใ‚ฏใ‚ทใƒงใƒณ๏ผˆSteamใ€ใƒฉใ‚คใƒ–ใƒฉใƒชใ€ใ‚นใƒˆใ‚ขใชใฉ๏ผ‰ใ‚’2็”ป้ข็›ฎใซ่กจ็คบใ—ใพใ™ใ€‚ใ‚ชใƒณใงใฏไปปๆ„ใฎใ‚ปใ‚ซใƒณใƒ‰ใƒ‡ใ‚ฃใ‚นใƒ—ใƒฌใ‚คใ‚’ไฝฟ็”จใ—ใพใ™ใ€‚ใ‚ชใƒ•ใงใฏใƒฉใƒณใƒใƒฃใƒผใ‚’1็”ป้ขใซ็•™ใ‚ใพใ™ใ€‚ + ใƒ‡ใƒฅใ‚ขใƒซใ‚นใ‚ฏใƒชใƒผใƒณใ‚ปใƒƒใ‚ทใƒงใƒณ + ่‡ชๅ‹•ใงใฏใ€ใƒใƒƒใƒ—ใ‚ชใƒผใƒใƒผใฎไปฃใ‚ใ‚Šใซใ‚ฒใƒผใƒ ๅ†…ใƒกใƒ‹ใƒฅใƒผใ‚’ๅ†…่”ตใ‚ปใ‚ซใƒณใƒ‰ใ‚นใ‚ฏใƒชใƒผใƒณใซๅ›บๅฎšใ—ใพใ™ใ€‚ใ‚ชใƒณใงใฏไปปๆ„ใฎใ‚ปใ‚ซใƒณใƒ‰ใƒ‡ใ‚ฃใ‚นใƒ—ใƒฌใ‚คใ‚’ไฝฟ็”จใ—ใพใ™ใ€‚ใ‚ชใƒ•ใงใฏใƒกใƒ‹ใƒฅใƒผใ‚’ใ‚ฒใƒผใƒ ็”ป้ขใซ็•™ใ‚ใพใ™ใŒใ€ใƒกใƒ‹ใƒฅใƒผใ‹ใ‚‰ใ‚ปใ‚ซใƒณใƒ‰ใ‚นใ‚ฏใƒชใƒผใƒณใ‚’้ธๆŠžใ™ใ‚‹ใ“ใจใ‚‚ใงใใพใ™ใ€‚ ่‡ชๅ‹• ใ‚ชใƒณ ใ‚ชใƒ• ใ‚ฒใƒผใƒ ไธญใฎไธ‹็”ป้ขใ‚ณใƒณใƒˆใƒญใƒผใƒซ + ใƒ†ใ‚ญใ‚นใƒˆๅ…ฅๅŠ›ๆฌ„ใซ Android ใ‚ญใƒผใƒœใƒผใƒ‰ใ‚’ไฝฟ็”จ ใ‚ปใƒƒใ‚ทใƒงใƒณ้–‹ๅง‹ๆ™‚ใซ2็”ป้ข็›ฎใซใƒˆใƒฉใƒƒใ‚ฏใƒ‘ใƒƒใƒ‰ใจใ‚ญใƒผใƒœใƒผใƒ‰ใ‚’้–‹ใใพใ™ใ€‚ ไธŠ็”ป้ขใซๅ…ฅๅŠ›ไธญ ๅฎŒไบ† ใƒ‡ใƒ•ใ‚ฉใƒซใƒˆใฎใƒ›ใƒผใƒ ใ‚ขใƒ—ใƒช ใƒ›ใƒผใƒ ใ‚ขใƒ—ใƒชใ‚’้ธๆŠž + ๅพ…ๆฉŸไธญใซใƒฉใƒณใƒใƒฃใƒผใ‚’ๆœ€่ฟ‘ใฎใ‚ขใƒ—ใƒชใ‹ใ‚‰้ž่กจ็คบใซใ™ใ‚‹ + DroidDeck ใŒใƒ‡ใƒ•ใ‚ฉใƒซใƒˆใฎใƒ›ใƒผใƒ ใ‚ขใƒ—ใƒชใงใ€ใ‚ปใƒƒใ‚ทใƒงใƒณใŒๅฎŸ่กŒใ•ใ‚Œใฆใ„ใชใ„ๅ ดๅˆใซใฎใฟ้ฉ็”จใ•ใ‚Œใพใ™ใ€‚ ้ธๆŠž Linuxใ‚ขใƒ—ใƒช๏ผˆใƒ™ใƒผใ‚ฟ็‰ˆ๏ผ‰ ใƒ•ใ‚กใ‚คใƒซ @@ -1003,9 +1065,172 @@ ใƒ—ใƒฌใƒ“ใƒฅใƒผ็‰ˆ ๅฎ‰ๅฎš็‰ˆใ‚ˆใ‚Šๅ…ˆใซๆœ€ๆ–ฐใฎไฟฎๆญฃ ๆœ€ๆ–ฐใงใ™ + ใƒ“ใƒซใƒ‰ๆƒ…ๅ ฑใ‚’ใ‚ณใƒ”ใƒผ + ใƒ“ใƒซใƒ‰ๆƒ…ๅ ฑใ‚’ใ‚ณใƒ”ใƒผใ—ใพใ—ใŸ + ใƒ—ใƒฌใƒ“ใƒฅใƒผ็‰ˆใ‚ˆใ‚Šๆ–ฐใ—ใ„ + ใƒ—ใƒฌใƒ“ใƒฅใƒผ็‰ˆใ‚ˆใ‚Šๅ…ˆ่กŒใ—ใฆใ„ใพใ™ + ใ“ใฎใƒ“ใƒซใƒ‰ใฏๆœ€ๆ–ฐใฎใƒ—ใƒฌใƒ“ใƒฅใƒผ็‰ˆใ‚ˆใ‚Šๆ–ฐใ—ใ„ใงใ™ใ€‚ๆฌกใฎใƒ—ใƒฌใƒ“ใƒฅใƒผ็‰ˆใงๆ›ดๆ–ฐใ•ใ‚Œใพใ™ใ€‚ + ใƒ“ใƒซใƒ‰ใ‚’้ธใถใจๅค‰ๆ›ดๅ†…ๅฎนใฎ็ขบ่ชใ‚„ใ‚คใƒณใ‚นใƒˆใƒผใƒซใŒใงใใพใ™ใ€‚ + ใ‚คใƒณใ‚นใƒˆใƒผใƒซๆธˆใฟ + ใ“ใฎใƒ“ใƒซใƒ‰ใ‚’ใ‚คใƒณใ‚นใƒˆใƒผใƒซ%1$s + ใ“ใฎใƒ“ใƒซใƒ‰ใซๆˆปใ™%1$s + versionCode %1$d + ใ‚ณใƒŸใƒƒใƒˆ %1$s + ใƒชใƒชใƒผใ‚นใƒšใƒผใ‚ธ + ใ“ใฎPRใซใฏๆ–ฐใ—ใ„ใ‚ณใƒŸใƒƒใƒˆ (%1$s) ใŒใ‚ใ‚Šใพใ™ใ€‚ใใฎใƒ†ใ‚นใƒˆใƒ“ใƒซใƒ‰ใฏใพใ ๆบ–ๅ‚™ไธญใฎใŸใ‚ใ€ใ“ใฎใƒ“ใƒซใƒ‰ใซใฏๅซใพใ‚Œใฆใ„ใพใ›ใ‚“ใ€‚ + ๆ–ฐใ—ใ„ใ‚ณใƒŸใƒƒใƒˆใ‚ใ‚Šใ€ใƒ“ใƒซใƒ‰ๅพ…ใก + PR็•ชๅทใ€ใ‚ฟใ‚คใƒˆใƒซใ€ไฝœๆˆ่€… + ไธ€่‡ดใ™ใ‚‹ใƒ†ใ‚นใƒˆใƒ“ใƒซใƒ‰ใฏใ‚ใ‚Šใพใ›ใ‚“ + ๅ†ใƒ“ใƒซใƒ‰ใŒๅฟ…่ฆ (versionCode %1$d) + ใƒ†ใ‚นใƒˆใƒ“ใƒซใƒ‰ใฎๆ›ดๆ–ฐ + PR #%1$d ใฎๆ–ฐใ—ใ„ใƒ†ใ‚นใƒˆใƒ“ใƒซใƒ‰ + %1$sใ€‚ใ‚ขใƒƒใƒ—ใƒ‡ใƒผใƒˆใ‚’้–‹ใ„ใฆใ‚คใƒณใ‚นใƒˆใƒผใƒซใ—ใฆใใ ใ•ใ„ใ€‚ + ใ•ใ‚‰ใซ่กจ็คบ (%1$d) + versionCode %2$d ๅ‘ใ‘ใซๅ†ใƒ“ใƒซใƒ‰ใŒๅฟ…่ฆ (%1$d) + ใ“ใฎใƒ†ใ‚นใƒˆใƒ“ใƒซใƒ‰ไปฅ้™ใฎ main ใฎใƒ—ใƒฌใƒ“ใƒฅใƒผ็‰ˆใƒ“ใƒซใƒ‰: %1$d ใƒ†ใ‚นใƒˆใƒ“ใƒซใƒ‰ ๆญฃๅผใƒชใƒชใƒผใ‚นๅ‰ใซ็‰นๅฎšใฎไฟฎๆญฃใ‚’่ฉฆใ™ ็พๅœจใ‚ใ‚Šใพใ›ใ‚“ + ใƒฉใƒœใƒ“ใƒซใƒ‰ + ใƒฉใƒœใƒ“ใƒซใƒ‰ + ไฝฟ็”จไธญ + Android ใŒ DroidDeck ใ‚’ๅ†ๆœ€้ฉๅŒ–ใ—ใŸๅพŒใซไธ€ๆ™‚ๅœๆญขใ—ใพใ—ใŸ + ่ชญใฟ่พผใพใ‚Œใฆใ„ใพใ›ใ‚“: %1$s + ๅ†่ตทๅ‹•ใ‚’ๅพ…ใฃใฆใ„ใพใ™ + ไฟๆŒๆธˆใฟ + ๅˆฅใฎใƒใƒผใ‚ธใƒงใƒณ็”จ + ๅ†ใƒ“ใƒซใƒ‰ + ใ“ใฎใƒ“ใƒซใƒ‰ใ‚’็ซฏๆœซใ‹ใ‚‰ๅ‰Š้™คใ—ใพใ™ + ใ“ใฎใƒ“ใƒซใƒ‰ใงๅ†่ตทๅ‹• + ใ‚ชใƒ•ใซใ™ใ‚‹ + ไฝฟ็”จ + ๅ‰Š้™ค + ไปŠใ™ใๅ‰Š้™ค + ๅ†่ตทๅ‹•ใ‚’ๆบ–ๅ‚™ใงใใพใ›ใ‚“ใงใ—ใŸ: %1$sใ€‚่จญๅฎšใงใƒฏใ‚คใƒคใƒฌใ‚นใƒ‡ใƒใƒƒใ‚ฐใ‚’ใƒšใ‚ขใƒชใƒณใ‚ฐใ—ใฆใ€ใ‚‚ใ†ไธ€ๅบฆใŠ่ฉฆใ—ใใ ใ•ใ„ใ€‚ + ใƒฉใƒœใƒ“ใƒซใƒ‰ใ‚’ใ‚คใƒณใ‚นใƒˆใƒผใƒซใ—ใพใ—ใŸ + DroidDeck ใ‚’ %1$s ใงๅ†่ตทๅ‹•ใ—ใพใ—ใŸ + Lab ใƒ“ใƒซใƒ‰ใ‚’ไธ€ๆ™‚ๅœๆญขใ—ใพใ—ใŸ + Android ใŒ DroidDeck ใ‚’ๅ†ๆœ€้ฉๅŒ–ใ—ใŸใŸใ‚ใ€%1$s ใฏ่ชญใฟ่พผใพใ‚Œใฆใ„ใพใ›ใ‚“ใ€‚ใ‚ขใƒƒใƒ—ใƒ‡ใƒผใƒˆใ‚’้–‹ใใ€ใใฎใƒ“ใƒซใƒ‰ใงๅ†่ตทๅ‹•ใ—ใฆใใ ใ•ใ„ใ€‚ + Lab ใƒ“ใƒซใƒ‰ใ‚’ใ‚ชใƒ•ใซใ—ใพใ—ใŸ + ๅˆฅใฎใƒใƒผใ‚ธใƒงใƒณใฎ DroidDeck ็”จใซใƒ“ใƒซใƒ‰ใ•ใ‚Œใพใ—ใŸใ€‚ใ‚ขใƒƒใƒ—ใƒ‡ใƒผใƒˆใซไฟ็ฎกใ•ใ‚Œใฆใ„ใพใ™ใ€‚ + ใใฎใƒ“ใƒซใƒ‰ใง DroidDeck ใŒ 2 ๅ›ž่ตทๅ‹•ใ—ใพใ›ใ‚“ใงใ—ใŸ + ใ‚จใƒผใ‚ธใ‚งใƒณใƒˆ + ใ‚จใƒผใ‚ธใ‚งใƒณใƒˆ + ใ‚จใƒผใ‚ธใ‚งใƒณใƒˆใŒไฝœๆฅญไธญใงใ™ + ใ‚จใƒผใ‚ธใ‚งใƒณใƒˆใ‚’ไฝฟใ†ใซใฏใ€Linux ใƒฆใƒผใ‚ถใƒผใƒฉใƒณใƒ‰ใซ Claude Code ใ‚’ใ‚คใƒณใ‚นใƒˆใƒผใƒซใ—ใฆใใ ใ•ใ„ใ€‚ + ใ‚ฒใƒผใƒ ใ‚„ใ‚ฏใƒฉใƒƒใ‚ทใƒฅใ€DroidDeck ใฎๅค‰ๆ›ดใซใคใ„ใฆ่ณชๅ•ใ—ใฆใใ ใ•ใ„ + ้€ไฟก + ๆ–ฐใ—ใ„ไผš่ฉฑ + ๅœๆญข + ใ‚นใƒˆใƒฌใƒผใ‚ธ + ๅ‰Š้™ค + ไปŠใ™ใๅ‰Š้™ค + Claude Code + Codex + DroidDeck ใฎใ‚ฝใƒผใ‚น + ใƒ€ใ‚ฆใƒณใƒญใƒผใƒ‰ใ‚ญใƒฃใƒƒใ‚ทใƒฅ + ใƒ—ใƒƒใ‚ทใƒฅใ—ใฆใ„ใชใ„ๅค‰ๆ›ดใฏๅคฑใ‚ใ‚Œใพใ™ + ใƒ“ใƒซใƒ‰ๆ™‚ใซๅ†ๅบฆใƒ€ใ‚ฆใƒณใƒญใƒผใƒ‰ใ•ใ‚Œใพใ™ + ใ‚ปใƒƒใƒˆใ‚ขใƒƒใƒ—ใงๅ†ๅบฆใ‚คใƒณใ‚นใƒˆใƒผใƒซใงใใพใ™ใ€‚ใ‚ตใ‚คใƒณใ‚คใƒณๆƒ…ๅ ฑใฏไฟๆŒใ•ใ‚Œใพใ™ + DroidDeck ใŒ Lab ใƒ“ใƒซใƒ‰ใงๅ†่ตทๅ‹•ใ—ใพใ—ใŸใ€‚็ถšใใ‹ใ‚‰ๅ†้–‹ใ—ใฆใใ ใ•ใ„ใ€‚ + ใ‚ฒใƒผใƒ ใŒ่ตทๅ‹•ใ—ใชใ„็†็”ฑใ‚’ๅฐ‹ใญใŸใ‚Šใ€ใƒญใ‚ฐใ‚’่ชฌๆ˜Žใ—ใฆใ‚‚ใ‚‰ใฃใŸใ‚Šใ€DroidDeck ใซๅค‰ๆ›ดใ‚’ๅŠ ใˆใฆใ“ใฎ็ซฏๆœซใง่ฉฆใ—ใฆใ‚‚ใ‚‰ใฃใŸใ‚Šใ—ใฆใใ ใ•ใ„ใ€‚ + ๅคฑๆ•—: %1$s + %1$s ใŒ็ต‚ไบ†ใ—ใพใ—ใŸ (็ต‚ไบ†ใ‚ณใƒผใƒ‰ %2$d) + ๅœๆญขใ—ใพใ—ใŸ + ่ฟ”ไฟกใŒใชใ„ใพใพ็ต‚ไบ†ใ—ใพใ—ใŸ + ๅ†่ฉฆ่กŒ + ใ‚จใƒผใ‚ธใ‚งใƒณใƒˆใ‚’่จญๅฎšไธญใงใ™ + ใ‚คใƒณใ‚นใƒˆใƒผใƒซๆธˆใฟใฎ DroidDeck ใฎใƒใƒผใ‚ธใƒงใƒณใซๅˆใ‚ใ›ใฆ Lab ใƒ“ใƒซใƒ‰ %1$s ใ‚’ๅ†ใƒ“ใƒซใƒ‰ใ—ใ€ใใฎใƒ“ใƒซใƒ‰ใงๅ†่ตทๅ‹•ใ—ใฆใใ ใ•ใ„ใ€‚ + ๅ…ฅๅŠ› %1$s ยท ๅ‡บๅŠ› %2$s + ่€ƒใˆไธญ + ๆ€่€ƒ + ่€ƒใˆไธญ ยท %1$s + %1$s ยท %2$s + ๅ…ฅๅŠ› + ๅ‡บๅŠ› + ๅฎŸ่กŒไธญโ€ฆ + ็ตๆžœใชใ—๏ผšใ‚ฟใƒผใƒณใŒๅ…ˆใซ็ต‚ไบ†ใ—ใพใ—ใŸ + ๅ‡บๅŠ›ใชใ— + ๅ…ฅๅŠ›ใ™ใ‚‹ใจๆฌกใฎใƒกใƒƒใ‚ปใƒผใ‚ธใ‚’ใ‚ญใƒฅใƒผใซ่ฟฝๅŠ ใงใใพใ™ + ใ‚ญใƒฅใƒผใซ่ฟฝๅŠ  + ๆฌก: %1$s + ้€ไฟกใ—ใชใ„ + ๆทปไป˜ + ๅ‰Š้™ค + ใƒ‡ใƒ•ใ‚ฉใƒซใƒˆ + ๆŽจ่ซ–ใƒฌใƒ™ใƒซ + ้€ฒใ‚ใ‚‹ + ไฟฎๆญฃ + ใพใ ๅค‰ๆ›ดใฏใ‚ใ‚Šใพใ›ใ‚“ + ่จˆ็”ปใ‚’้€ฒใ‚ใฆใใ ใ•ใ„ใ€‚ + ไปŠใ™ใ้€ไฟก + ใใฎไป– + ้–‰ใ˜ใ‚‹ + ๆœ€ๆ–ฐ + ๅ‡ฆ็†ไธญ + ใ‚ณใƒณใƒ†ใ‚ญใ‚นใƒˆ + %2$s ใฎใ†ใก %1$s + ใ“ใฎไผš่ฉฑ ยท %1$s + ๆœ€ๅˆใฎ่ฟ”ไฟกๅพŒใซไฝฟ็”จ้‡ใŒ่กจ็คบใ•ใ‚Œใพใ™ + %1$d ๆ™‚้–“ใฎๅˆถ้™ + %1$d ๅˆ†ใฎๅˆถ้™ + ้€ฑ้–“ๅˆถ้™ + %1$d%% ยท %2$s ใซใƒชใ‚ปใƒƒใƒˆ + + %1$d ใƒ•ใ‚กใ‚คใƒซ + %1$d ใƒ•ใ‚กใ‚คใƒซ + + ใพใš่จˆ็”ปใ‚’็ซ‹ใฆใ‚‹ + ่จˆ็”ป + ไฝ•ใ‚‚ๅค‰ๆ›ดใ›ใšใซ่จˆ็”ปใ‚’ๆๆกˆใ—ใพใ™ + ไผš่ฉฑๅฑฅๆญด + ไผš่ฉฑๅฑฅๆญดใฏใพใ ใ‚ใ‚Šใพใ›ใ‚“ + ใŸใฃใŸไปŠ + ๅ‰Š้™ค + ใใฎไผš่ฉฑใจๆทปไป˜ใƒ•ใ‚กใ‚คใƒซใ‚’ๅ‰Š้™คใ—ใพใ™ + ใƒ—ใƒญใ‚ปใ‚น + Linux ใƒฆใƒผใ‚ถใƒผใƒฉใƒณใƒ‰ใงใฏไฝ•ใ‚‚ๅฎŸ่กŒใ•ใ‚Œใฆใ„ใพใ›ใ‚“ + ใ‚จใƒผใ‚ธใ‚งใƒณใƒˆ + ๅœๆญข + ใƒฉใƒœใƒ“ใƒซใƒ‰ + ใƒฉใƒœใƒ“ใƒซใƒ‰ใ‚’ๆบ–ๅ‚™ไธญ + %1$d%% ยท ๆฎ‹ใ‚Š็ด„ %2$s + ๆฎ‹ใ‚Š็ด„ %1$s + ใ‚ญใƒฃใƒณใ‚ปใƒซ + ใƒ“ใƒซใƒ‰ใ‚’ใ‚ญใƒฃใƒณใ‚ปใƒซ + ้–‹ๅง‹ไธญ + %1$d%% + ใƒ‘ใƒƒใ‚ฑใƒผใ‚ธใƒณใ‚ฐไธญ + ใใฎใƒ“ใƒซใƒ‰ใง DroidDeck ใ‚’ๅ†่ตทๅ‹•ไธญ + ๅฎŒไบ† + ๅคฑๆ•—: %1$s + ใ‚จใƒผใ‚ธใ‚งใƒณใƒˆใ‚’่จญๅฎš + ๅ…ˆใซใ‚ปใƒƒใƒˆใ‚ขใƒƒใƒ—ใง Linux ใƒฉใƒณใ‚ฟใ‚คใƒ ใ‚’ใ‚คใƒณใ‚นใƒˆใƒผใƒซใ—ใฆใใ ใ•ใ„ใ€‚ + ๅ†่ฉฆ่กŒ + ใƒใƒฃใƒƒใƒˆใ‚’ๅง‹ใ‚ใ‚‹ + ใƒ‡ใƒใ‚คใ‚นๆŽฅ็ถš + ใƒฏใ‚คใƒคใƒฌใ‚นใƒ‡ใƒใƒƒใ‚ฐใงใ€ใ‚จใƒผใ‚ธใ‚งใƒณใƒˆใŒ DroidDeck ใ‚’่ช่ญ˜ใ—ใฆๆ“ไฝœใงใใพใ™ + %1$s ใ‚’ใ‚คใƒณใ‚นใƒˆใƒผใƒซ + gitใ€ghใ€adb ใ‚’ๅซใ‚€ Linux ใƒฆใƒผใ‚ถใƒผใƒฉใƒณใƒ‰ใธ + %1$s ใซใ‚ตใ‚คใƒณใ‚คใƒณ + ใƒ–ใƒฉใ‚ฆใ‚ถใŒ้–‹ใใพใ™ + GitHub + ็œ็•ฅๅฏ ยท ใƒ—ใƒซใƒชใ‚ฏใ‚จใ‚นใƒˆใ‚’ไฝœๆˆใ™ใ‚‹ๅ ดๅˆ + ใƒ“ใƒซใƒ‰ใƒ„ใƒผใƒซ + ็œ็•ฅๅฏ ยท ใ“ใฎ็ซฏๆœซใงใฎ Lab ใƒ“ใƒซใƒ‰็”จ ยท ็ด„ 5 GB + ใ‚จใƒผใ‚ธใ‚งใƒณใƒˆๆบ–ๅ‚™ๅฎŒไบ† + ใ‚จใƒผใ‚ธใ‚งใƒณใƒˆใฎ่จญๅฎšใ‚’ๅฎŒไบ†ใ—ใฆใใ ใ•ใ„ + %1$s ใซใ‚ตใ‚คใƒณใ‚คใƒณๆธˆใฟ + Lab ใƒ“ใƒซใƒ‰ + ้ซ˜้€Ÿใƒ“ใƒซใƒ‰ + ้ซ˜้€Ÿ Lab ใƒ“ใƒซใƒ‰ + ใ“ใฎใƒใƒผใ‚ธใƒงใƒณใ‚’ไบ‹ๅ‰ใซใ‚ณใƒณใƒ‘ใ‚คใƒซใ™ใ‚‹ใŸใ‚ใ€Lab ใƒ“ใƒซใƒ‰ใฏๆ•ฐๅˆ†ใงๅฎŒไบ†ใ—ใพใ™ ยท ๅˆๅ›žใฎใฟ็ด„ 20 ๅˆ† + ใ‚ณใƒณใƒ‘ใ‚คใƒซไธญ ยท %1$d%% ยท ๆฎ‹ใ‚Š็ด„ %2$s + ๆบ–ๅ‚™ + ใƒฏใ‚คใƒคใƒฌใ‚นใƒ‡ใƒใƒƒใ‚ฐใซๆŽฅ็ถšใงใใพใ›ใ‚“ใ€‚ใƒšใ‚ขใƒชใƒณใ‚ฐใงๆœ‰ๅŠนใซใชใ‚Šใพใ™ + ใƒšใ‚ขใƒชใƒณใ‚ฐ + ใ‚คใƒณใ‚นใƒˆใƒผใƒซ + ใ‚ตใ‚คใƒณใ‚คใƒณ PR #%1$d ใ“ใฎDroidDeckใ‚ณใƒ”ใƒผ็”จใซใฏใƒ“ใƒซใƒ‰ใ•ใ‚Œใฆใ„ใพใ›ใ‚“ %1$sใ‚’ๆ›ดๆ–ฐใ—ใพใ—ใŸ @@ -1241,6 +1466,9 @@ ใ‚ขใƒ—ใƒช ใ‚ปใƒƒใƒˆใ‚ขใƒƒใƒ— ใ‚ขใƒƒใƒ—ใƒ‡ใƒผใƒˆ + ใใฎไป– + ใ‚ฟใƒ–ใ‚’็ทจ้›† + ใ‚ฟใƒ– %1$d%% %1$sใ‚’ๅ†้–‹ ๅ„ใ‚ปใƒƒใ‚ทใƒงใƒณใง /root/ROMs ใจใ—ใฆ่กจ็คบใ•ใ‚Œใพใ™ใ€‚ๅ†…้ƒจใ‚นใƒˆใƒฌใƒผใ‚ธใฏ /root/Storage ใซใ‚ใ‚Šใพใ™ใ€‚ @@ -1262,6 +1490,15 @@ ใ‚ญใƒฅใƒผใ‚’ใ‚ญใƒฃใƒณใ‚ปใƒซ Androidใ‚ญใƒผใƒœใƒผใƒ‰ ้š ใ™ โœ• + ็”ป้ขไธŠใฎใ‚ตใ‚คใ‚บ + ใƒ˜ใƒƒใƒ€ใƒผใ‚’ๅซใ‚ใ€ใ‚ญใƒผใƒœใƒผใƒ‰ใŒ็”ป้ขใซๅ ใ‚ใ‚‹ๅ‰ฒๅˆใ€‚ + ไธ้€ๆ˜Žๅบฆ + ไธ‹ใ’ใ‚‹ใจใ€ใ‚ญใƒผใƒœใƒผใƒ‰ใฎ่ƒŒๅพŒใซใ‚ใ‚‹ใ‚ฒใƒผใƒ ใŒ่ฆ‹ใˆใพใ™ใ€‚ + ้ž่กจ็คบใฎใ‚ญใƒผ + ใปใจใ‚“ใฉไฝฟใ‚ใชใ„ใ‚ญใƒผใฏใ‚ญใƒผใƒœใƒผใƒ‰ใซ่กจ็คบใ•ใ‚Œใพใ›ใ‚“ใ€‚ + Esc ใจใƒ•ใ‚กใƒณใ‚ฏใ‚ทใƒงใƒณใ‚ญใƒผๅˆ— + Ins / Del / Home / End / PgUp / PgDn + ็Ÿขๅฐใ‚ญใƒผ %1$sใ‚’่ตทๅ‹• ็”ป้ขใ‚’้ธๆŠžใ—ใฆใใ ใ•ใ„ใ€‚ใ‚ปใ‚ซใƒณใƒ€ใƒช็”ป้ข๏ผš%1$sใ€‚ ใ‚ปใ‚ซใƒณใƒ€ใƒช็”ป้ขใฏๅˆฉ็”จใงใใพใ›ใ‚“ใ€‚ @@ -1746,7 +1983,24 @@ ใ‚ฟใƒผใƒŸใƒŠใƒซ Deckใ‚ฐใƒชใƒƒใƒ— + ใƒˆใƒฉใƒƒใ‚ฏใƒ‘ใƒƒใƒ‰ ใƒ€ใƒƒใ‚ทใƒฅใƒœใƒผใƒ‰ + ใƒ‡ใ‚นใ‚ฏใƒˆใƒƒใƒ— + ใƒ‡ใ‚นใ‚ฏใƒˆใƒƒใƒ—ใ‚’่ตทๅ‹• + ใƒ‡ใ‚นใ‚ฏใƒˆใƒƒใƒ— ยท %1$s + ใƒˆใƒฉใƒƒใ‚ฏใƒ‘ใƒƒใƒ‰ + ็›ดๆŽฅใ‚ฟใƒƒใƒ + ใƒˆใƒฉใƒƒใ‚ฏใƒ‘ใƒƒใƒ‰ใ€‚ใ‚ฟใƒƒใƒ—ใง็›ดๆŽฅใ‚ฟใƒƒใƒใซๅˆ‡ใ‚Šๆ›ฟใˆ + ็›ดๆŽฅใ‚ฟใƒƒใƒใ€‚ใ‚ฟใƒƒใƒ—ใงใƒˆใƒฉใƒƒใ‚ฏใƒ‘ใƒƒใƒ‰ใซๅˆ‡ใ‚Šๆ›ฟใˆ + KDE ใƒ‡ใ‚นใ‚ฏใƒˆใƒƒใƒ—ใ‚’่ตทๅ‹•ใ—ใฆใ„ใพใ™โ€ฆ + ใƒ‡ใ‚นใ‚ฏใƒˆใƒƒใƒ—ใŒ็ต‚ไบ†ใ—ใพใ—ใŸใ€‚ + ใƒ‡ใ‚นใ‚ฏใƒˆใƒƒใƒ—ใ‚’่ตทๅ‹•ใงใใพใ›ใ‚“ใงใ—ใŸใ€‚ใƒญใ‚ฐใฏใ“ใฎใ‚ปใƒƒใ‚ทใƒงใƒณใฎ bottom-desktop ใƒ•ใ‚ฉใƒซใƒ€ใƒผใซใ‚ใ‚Šใพใ™ใ€‚ + ใƒ‡ใ‚นใ‚ฏใƒˆใƒƒใƒ—ใฏ็ต‚ไบ†ใ—ใฆใ„ใพใ™ใ€‚ ใพใ ่กจ็คบใ™ใ‚‹ใ‚‚ใฎใฏใ‚ใ‚Šใพใ›ใ‚“ใ€‚ + ็”ป้ขใ‚’ๅ…ฅใ‚Œๆ›ฟใˆ + ไธ‹้ƒจ็”ป้ขใฏไปŠใฏ็ฉบใ„ใฆใ„ใพใ›ใ‚“ + ใ‚ฒใƒผใƒ ็”ป้ข + ใ‚ฒใƒผใƒ ใ‚’่กจ็คบใ™ใ‚‹็”ป้ข + ไธŠ้ƒจ็”ป้ข + ไธ‹้ƒจ็”ป้ข ใƒ€ใ‚ฆใƒณใƒญใƒผใƒ‰ ๅฎŸ่กŒไธญใฎใƒ€ใ‚ฆใƒณใƒญใƒผใƒ‰ใฏใ‚ใ‚Šใพใ›ใ‚“ใ€‚ Steam @@ -1781,6 +2035,20 @@ ็‡ƒๆ–™๏ผˆt๏ผ‰ ใƒกใ‚คใƒณ %1$s t ไบˆๅ‚™ %1$s t + ใƒ•ใƒฌใƒผใƒ ๆ™‚้–“ + ็›ด่ฟ‘ %1$d ็ง’ + ๅนณๅ‡ใƒ•ใƒฌใƒผใƒ  + ไธ‹ไฝ 1% + 33 ms ใ‚’่ถ…ใˆใ‚‹ใƒ•ใƒฌใƒผใƒ  + %1$d / ๅˆ† + ใƒ—ใƒฌใ‚คๆ™‚้–“ %1$s + %1$d ใ‚ณใ‚ขใ€ๆœ€ๅคง %2$s GHz + %1$d ใ‚ณใ‚ข + ใ‚ฒใƒผใƒ  + %1$d Hz ใฎ FPS + ่ตคใ„ใƒžใƒผใ‚ฏใฏใ€HUD ใŒๆธฉๅบฆใ‚’่ตคใง่กจ็คบใ™ใ‚‹ไฝ็ฝฎใงใ™ใ€‚ + ใƒ‡ใƒใ‚คใ‚นๅ…จไฝ“ + ใƒใƒƒใƒ†ใƒชใƒผ ใƒ€ใƒƒใ‚ทใƒฅใƒœใƒผใƒ‰็”จใƒ‡ใƒผใ‚ฟใ‚’้€ไฟก ่‡ชๅ‹• ใ“ใ“ใซ่กจ็คบใ•ใ‚Œใฆใ„ใ‚‹ใ™ในใฆใฎใ‚ฒใƒผใƒ ๏ผˆๅพŒใ‹ใ‚‰่ฆ‹ใคใ‹ใฃใŸใ‚ฒใƒผใƒ ใ‚’ๅซใ‚€๏ผ‰ใงใ‚ชใƒณใซใ—ใพใ™ใ€‚ใ‚ชใƒ•ใซใ—ใŸใ‚ฒใƒผใƒ ใฏใ‚ชใƒ•ใฎใพใพใงใ™ใ€‚ @@ -1804,6 +2072,10 @@ ใ“ใฎใ‚ฒใƒผใƒ ใงใฏใƒžใ‚คใ‚ฏใŒใ‚ชใƒ•ใงใ™ใ€‚่ฉฑใ™ใซใฏใ€DroidDeckใฎSteam่จญๅฎš๏ผˆใ‚ชใƒผใƒ‡ใ‚ฃใ‚ช๏ผ‰ใงใƒžใ‚คใ‚ฏใ‚’ใ‚ชใƒณใซใ—ใฆใ€ใ‚ฒใƒผใƒ ใ‚’ๅ†่ตทๅ‹•ใ—ใฆใใ ใ•ใ„ใ€‚ ้Ÿณ้‡ %1$d%% ใ‚ฒใƒผใƒ ๅ†…็ตฑ่จˆ + ไธ‹้ƒจ็”ป้ขใฎ HUD + ใ™ในใฆใฎใ‚ฟใƒ–ใซใ‚นใƒˆใƒชใƒƒใƒ—ใ‚’่กจ็คบ + ไธ‹ไฝ 1% ใจ 0.1% + CPU ๆธฉๅบฆ FPS CPU GPU @@ -1975,6 +2247,7 @@ ใ‚ปใƒƒใ‚ทใƒงใƒณใ‚’้–‹ๅง‹ไธญโ€ฆ %1$d:%2$02d ็ตŒ้Ž ยท ๅ‡ฆ็†ไธญ Steamใ‚ฏใƒฉใ‚คใ‚ขใƒณใƒˆใฎใ‚ขใƒƒใƒ—ใƒ‡ใƒผใƒˆใ‚’ใƒ€ใ‚ฆใƒณใƒญใƒผใƒ‰ไธญ ยท %1$d%% + Steam ใ‚ฏใƒฉใ‚คใ‚ขใƒณใƒˆใฎๆ›ดๆ–ฐใ‚’้ฉ็”จใ—ใฆใ„ใพใ™โ€ฆ Steamใ‚ฏใƒฉใ‚คใ‚ขใƒณใƒˆใ‚’ใƒ€ใ‚ฆใƒณใƒญใƒผใƒ‰ไธญ ยท %1$s ไบ’ๆ›ๆ€งใƒ„ใƒผใƒซใฎใ‚คใƒณใ‚นใƒˆใƒผใƒซใฏใ™ใงใซๅฎŸ่กŒไธญใงใ™ @@ -2051,11 +2324,29 @@ ใƒˆใ‚ฅใƒผใƒณ่ผช้ƒญ็ทšใจใ‚ทใƒฃใƒผใƒ—ๅŒ–ใ€‚ Adreno GPUใงใฏใ‚ใ‚Šใพใ›ใ‚“ + ใ‚ทใ‚นใƒ†ใƒ ใฎ PowerVR ใƒ‰ใƒฉใ‚คใƒใƒผ: ไบ’ๆ›ๆ€งใฏใƒ‡ใƒใ‚คใ‚นใซใ‚ˆใฃใฆ็•ฐใชใ‚Šใพใ™ + ๅฎŸ้จ“็š„: RADV ใพใŸใฏใ‚ทใ‚นใƒ†ใƒ ใฎ Xclipse ใƒ‰ใƒฉใ‚คใƒใƒผ + ใ‚ทใ‚นใƒ†ใƒ  PowerVR + ใ“ใฎ GPU ใซใฏๅ†…่”ตใƒ‰ใƒฉใ‚คใƒใƒผใ‚’ไฝฟ็”จใ—ใพใ™ + ใƒฉใƒณใ‚ฟใ‚คใƒ ใจใƒ‡ใ‚ฃใ‚นใƒ—ใƒฌใ‚คใซใฏใ€ใ‚ทใ‚นใƒ†ใƒ ใฎ PowerVR ใƒ‰ใƒฉใ‚คใƒใƒผใŒ้ธๆŠžใ•ใ‚Œใฆใ„ใพใ™ใ€‚ + ใ“ใฎ Mali ใซๅฏพๅฟœใ™ใ‚‹ใ‚ชใƒผใƒ—ใƒณใ‚ฝใƒผใ‚นใƒ‰ใƒฉใ‚คใƒใƒผใฏใพใ ใ‚ใ‚Šใพใ›ใ‚“ใ€‚Mali ใƒ–ใƒชใƒƒใ‚ธใŒๆœ‰ๅŠนใงใ™ใ€‚ + ใ“ใ‚Œใฏ Snapdragon ไปฅๅค–ใฎ็ซฏๆœซๅ‘ใ‘ใƒ†ใ‚นใƒˆใƒ“ใƒซใƒ‰ใงใ™ใ€‚ๅ…ฌๅผใƒ“ใƒซใƒ‰ใฏ Adreno ใงใฎใฟๅ‹•ไฝœใ™ใ‚‹ใŸใ‚ใ€ใ“ใฎใƒ“ใƒซใƒ‰ใซไธŠๆ›ธใใ‚คใƒณใ‚นใƒˆใƒผใƒซใ•ใ‚Œใ‚‹ใ“ใจใฏใ‚ใ‚Šใพใ›ใ‚“ใ€‚ๆ–ฐใ—ใ„ใƒ†ใ‚นใƒˆใƒ“ใƒซใƒ‰ใฏ github.com/The412Banner/droiddeck-nonadreno-drivers ใซใ‚ใ‚Šใพใ™ใ€‚ + ๅ‰ๅ›žใฎใ‚ปใƒƒใ‚ทใƒงใƒณใฏใ€ใ‚ฏใƒฉใƒƒใ‚ทใƒฅใงใฏใชใ Android ใŒใƒกใƒขใƒชใ‚’่งฃๆ”พใ™ใ‚‹ใŸใ‚ใซ DroidDeck ใ‚’็ต‚ไบ†ใ—ใŸใ“ใจใง็ต‚ใ‚ใ‚Šใพใ—ใŸใ€‚ไป–ใฎใ‚ขใƒ—ใƒชใ‚’้–‰ใ˜ใ‚‹ใ‹ใ€ใ‚ฒใƒผใƒ ใฎใƒ†ใ‚ฏใ‚นใƒใƒฃ่จญๅฎšใ‚’ไธ‹ใ’ใฆใ‹ใ‚‰ใ€ใ‚‚ใ†ไธ€ๅบฆใŠ่ฉฆใ—ใใ ใ•ใ„ใ€‚ + Mali (Venus) + Mali ใƒ–ใƒชใƒƒใ‚ธ + ใ“ใฎ Mali ใซๅฏพๅฟœใ™ใ‚‹ใ‚ชใƒผใƒ—ใƒณใ‚ฝใƒผใ‚นใƒ‰ใƒฉใ‚คใƒใƒผใฏใพใ ใ‚ใ‚Šใพใ›ใ‚“ใ€‚็ซฏๆœซๅ†…่”ตใฎใƒ‰ใƒฉใ‚คใƒใƒผไธŠใง %1$s ใ‚’ไฝฟ็”จใ—ใพใ™ใ€‚ + %1$s ใฏใพใ ๅ…ฌ้–‹ใ•ใ‚Œใฆใ„ใพใ›ใ‚“ใ€‚ๅ…ฌ้–‹ใ•ใ‚Œใ‚‹ใพใง %2$s ใ‚’ไฝฟ็”จใ—ใพใ™ใ€‚ + %1$s ใฏๅˆฉ็”จใงใใšใ€ใ“ใฎ็ซฏๆœซใฎใƒ‰ใƒฉใ‚คใƒใƒผใฏ Vulkan %2$s ใ‚’ๅ ฑๅ‘Šใ—ใฆใ„ใพใ™๏ผˆVenus ใซใฏ 1.2 ใŒๅฟ…่ฆใงใ™๏ผ‰ใ€‚Mali ใƒ–ใƒชใƒƒใ‚ธใ‚’ไฝฟ็”จใ—ใพใ™ใ€‚ + %1$s ใฏใพใ ๅ…ฌ้–‹ใ•ใ‚Œใฆใ„ใพใ›ใ‚“ใ€‚ๅ…ฌ้–‹ใ•ใ‚Œใ‚‹ใพใง Mali ใƒ–ใƒชใƒƒใ‚ธใŒๆœ‰ๅŠนใงใ™ใ€‚ + ๅพ…ๆฉŸไธญ๏ผš%1$s๏ผˆๅˆฅใฎใƒฉใƒณใ‚ฟใ‚คใƒ ใƒ‰ใƒฉใ‚คใƒใƒผใ‚’ๅพ…ใฃใฆใ„ใพใ™๏ผ‰ + DXVK ใฏใ‚ทใ‚นใƒ†ใƒ ใฎ PowerVR ใƒฉใƒณใ‚ฟใ‚คใƒ ใซใ‚ˆใฃใฆๆไพ›ใ•ใ‚Œใพใ™ใ€‚ไป–ใฎ DXVK ใƒ‘ใƒƒใ‚ฑใƒผใ‚ธใฏไฟๅญ˜ใงใใพใ™ใŒใ€ใ“ใฎใƒ‰ใƒฉใ‚คใƒใƒผใงใฏ้ฉ็”จใ•ใ‚Œใพใ›ใ‚“ใ€‚ ใ‚ตใƒใƒผใƒˆๅฏพ่ฑก ๅฎŸ้จ“็š„๏ผšใƒ‰ใƒฉใ‚คใƒใƒผใฏใƒ†ใ‚นใƒˆใƒ“ใƒซใƒ‰ใงใ™ Adreno 850ใฎๅฎŸ้จ“็š„ใ‚ตใƒใƒผใƒˆ๏ผšไบ’ๆ›ๆ€งใฎใ‚ใ‚‹ๅฎŸ้จ“็‰ˆใฎใƒ‡ใ‚ฃใ‚นใƒ—ใƒฌใ‚คใƒ‰ใƒฉใ‚คใƒใƒผใจใ‚ฒใƒผใƒ ใƒ‰ใƒฉใ‚คใƒใƒผใŒๅฟ…่ฆใงใ™ใ€‚ใ“ใฎใƒ‡ใƒใ‚คใ‚นใงใฏๆœชๆคœ่จผใงใ™ ใƒ†ใ‚นใƒˆๆธˆใฟใƒใƒผใƒ‰ใ‚ฆใ‚งใ‚ข๏ผˆAdreno 725ไปฅ้™๏ผ‰ๆœชๆบ€๏ผšๅ‹•ไฝœใ—ใชใ„ๅฏ่ƒฝๆ€งใŒใ‚ใ‚Šใพใ™ ใ‚ตใƒใƒผใƒˆๅฏพ่ฑกๅค–๏ผšใ“ใฎGPUใงๅˆฉ็”จใงใใ‚‹ไบ’ๆ›ใ‚ฐใƒฉใƒ•ใ‚ฃใƒƒใ‚ฏใ‚นใƒใƒƒใ‚ฏใ‚จใƒณใƒ‰ใŒใ‚ใ‚Šใพใ›ใ‚“ + Mali ใƒ–ใƒชใƒƒใ‚ธใ‚’็ตŒ็”ฑใ—ใฆใ€็ซฏๆœซๅ†…่”ตใฎ Vulkan ใƒ‰ใƒฉใ‚คใƒใƒผไธŠใงๅ‹•ไฝœใ—ใพใ™ + Mali ใƒ–ใƒชใƒƒใ‚ธใŒใ‚ชใƒ•ใฎๅ ดๅˆใฏใ‚ตใƒใƒผใƒˆใ•ใ‚Œใพใ›ใ‚“ใ€‚Turnip ใซใฏ Adreno (Snapdragon) GPU ใŒๅฟ…่ฆใงใ™ GitHubใฎใƒฌใƒผใƒˆๅˆถ้™ใซ้”ใ—ใพใ—ใŸใ€‚ๅพŒใงใ‚‚ใ†ไธ€ๅบฆใŠ่ฉฆใ—ใใ ใ•ใ„ GitHubใŒHTTP %1$dใ‚’่ฟ”ใ—ใพใ—ใŸ @@ -2164,7 +2455,6 @@ ใ‚นใƒˆใ‚ข Steam ใ‚ซใ‚นใ‚ฟใƒ  - ใ‚นใƒˆใ‚ข ใƒ€ใ‚ฆใƒณใƒญใƒผใƒ‰้€Ÿๅบฆใƒฌใƒ™ใƒซ ใƒใƒฉใƒณใ‚น ้ซ˜้€Ÿ @@ -2203,6 +2493,7 @@ ใ‚‚ใ†ไธ€ใคใฎ Battle.net ใฎใƒ€ใ‚ฆใƒณใƒญใƒผใƒ‰ใ‚’ๅพ…ใฃใฆใ„ใพใ™โ€ฆ Battle.net ใ‚’้–‹ใ„ใฆไธ€ๅบฆใ‚ตใ‚คใƒณใ‚คใƒณใ—ใฆใ‹ใ‚‰ใ€ใ“ใ“ใงใ‚ฒใƒผใƒ ใ‚’ใ‚คใƒณใ‚นใƒˆใƒผใƒซใ—ใฆใใ ใ•ใ„ใ€‚ Blizzard ใฎใƒ€ใ‚ฆใƒณใƒญใƒผใƒ€ใƒผใŒๅœๆญขใ—ใพใ—ใŸ: %1$s + Blizzard ใฎใƒ€ใ‚ฆใƒณใƒญใƒผใƒ€ใƒผใŒ้€ฒใพใชใใชใ‚Šใพใ—ใŸใ€‚ Blizzard ใ‚จใƒฉใƒผ %1$s ใ‚ขใƒƒใƒ—ใƒ‡ใƒผใƒˆ Blizzard ใฎใ‚ฒใƒผใƒ  @@ -2210,6 +2501,7 @@ ไธญๆ–ญ ใ‚คใƒณใ‚นใƒˆใƒผใƒซ ยท %1$s ็„กๆ–™ใงๅ…ฅๆ‰‹ + ใƒฉใ‚คใƒ–ใƒฉใƒชใซ่ฟฝๅŠ ไธญโ€ฆ %1$sใง่ฆ‹ใ‚‹ ่ณผๅ…ฅ ยท %1$s ใ‚คใƒณใ‚นใƒˆใƒผใƒซๆธˆใฟ @@ -2256,6 +2548,12 @@ ไธฆในๆ›ฟใˆ ใ‚ตใ‚คใƒ‰ใƒใƒผใฎใƒฉใƒ™ใƒซ ใ‚ตใ‚คใƒ‰ใƒใƒผใฎใ‚ขใ‚คใ‚ณใƒณใฎไธ‹ใซๅๅ‰ใ‚’่กจ็คบใ—ใพใ™ใ€‚ใ‚ชใƒ•ใซใ™ใ‚‹ใจใ‚ตใ‚คใƒ‰ใƒใƒผใŒ็ดฐใใชใ‚Šใพใ™ใ€‚ + ใ‚จใƒผใ‚ธใ‚งใƒณใƒˆใฎใƒšใƒƒใƒˆ + DeeDee ใฏใƒฉใƒณใƒใƒฃใƒผใ‚„ใ‚ฒใƒผใƒ ใฎไธŠใซๆตฎใ‹ใ‚“ใง่กจ็คบใ•ใ‚Œใ€ใ‚จใƒผใ‚ธใ‚งใƒณใƒˆใŒไฝ•ใ‚’ใ—ใฆใ„ใ‚‹ใ‹ใ‚’็คบใ—ใพใ™ใ€‚ + ไป–ใฎใ‚ขใƒ—ใƒชใฎไธŠใซ่กจ็คบ + DeeDee ใ‚’ใ™ในใฆใฎใ‚ขใƒ—ใƒชใฎไธŠใซ่กจ็คบใ—ใ€ใใ“ใงใƒใƒฃใƒƒใƒˆใ‚’้–‹ใ‘ใ‚‹ใ‚ˆใ†ใซใ—ใพใ™ + ่จฑๅฏ + DeeDee ใจใƒใƒฃใƒƒใƒˆ ่กจ็คบ ๅคงใใ„ใ‚ซใƒผใƒ‰ ๅฐใ•ใ„ใ‚ซใƒผใƒ‰ @@ -2538,7 +2836,14 @@ %1$s ยท ๅ†่ตทๅ‹•ๅพ…ใก ใ“ใฎใƒ‡ใƒใ‚คใ‚น %1$sใ‚’ๅ‰Š้™คใ—ใพใ™ใ‹๏ผŸ - ่จบๆ–ญ + ้–‹็™บ่€… + ใƒ“ใƒซใƒ‰ใƒฉใƒ™ใƒซใฎ้€ใ‹ใ— + ใƒ†ใ‚นใƒˆใƒ“ใƒซใƒ‰ใพใŸใฏLabใƒ“ใƒซใƒ‰ใฎใƒฉใƒ™ใƒซใ‚’็”ป้ขใซ่กจ็คบใ—ใพใ™ใ€‚ใƒ‡ใƒ•ใ‚ฉใƒซใƒˆใงๆœ‰ๅŠนใงใ™ใ€‚ + ่จบๆ–ญใƒใƒณใƒ‰ใƒซใ‚’ๅ…ฑๆœ‰ + ใ‚ปใƒƒใ‚ทใƒงใƒณใจใƒ‡ใƒใ‚คใ‚น + ใ‚ฐใƒฉใƒ•ใ‚ฃใƒƒใ‚ฏใ‚น + ใ‚ฒใƒผใƒ ใจไบ’ๆ›ๆ€ง + ใ™ในใฆใฎใƒใƒณใƒ‰ใƒซ ใƒ—ใƒฌใ‚คใฎๆบ–ๅ‚™ๅฎŒไบ† ใพใ ใƒ—ใƒฌใ‚คใฎๆบ–ๅ‚™ใŒใงใใฆใ„ใพใ›ใ‚“ ๅฎŸ่กŒ็’ฐๅขƒ %1$s @@ -2577,6 +2882,9 @@ ใ‚นใƒˆใ‚ข่จญๅฎšใงGOGใฎๅฎŸ็ธพใ‚’ๆœ‰ๅŠนใซใ—ใฆใใ ใ•ใ„ ๅฎŸ็ธพใ‚’ๅˆฉ็”จใงใใพใ›ใ‚“ใ€‚ใ‚ปใƒƒใ‚ทใƒงใƒณใƒญใ‚ฐใ‚’็ขบ่ชใ—ใฆใใ ใ•ใ„ ๅฎŸ็ธพใ‚’่งฃ้™คใ—ใพใ—ใŸ + Mali (Venus): ใ‚ชใƒ• + Mali (Venus): ใ‚ชใƒณ + %1$s ใฎใƒ‰ใƒฉใ‚คใƒใƒผใฏ Vulkan %2$s ใ‚’ๅ ฑๅ‘Šใ—ใฆใ„ใพใ™ใ€‚Mali (Venus) ใซใฏ Vulkan 1.2 ไปฅ้™ใŒๅฟ…่ฆใงใ€ๅคใ„ใƒใƒผใ‚ธใƒงใƒณใงใฏ gamescope ใŒ่ตทๅ‹•ใ—ใพใ›ใ‚“ใ€‚ใใฎใŸใ‚ใ‚ปใƒƒใ‚ทใƒงใƒณใงใฏ Venus ใ‚’ใ‚นใ‚ญใƒƒใƒ—ใ—ใ€ไปฃใ‚ใ‚Šใซ PanVK ใƒ‰ใƒฉใ‚คใƒใƒผใฎใƒšใ‚ขใ‚’ไฝฟ็”จใ—ใพใ™ใ€‚ ่ฒผใ‚Šไป˜ใ‘ ๅทฆใ‚นใƒ†ใ‚ฃใƒƒใ‚ฏ ๅณใ‚นใƒ†ใ‚ฃใƒƒใ‚ฏ @@ -2861,7 +3169,7 @@ ใƒ•ใ‚ฉใƒซใƒ€ใƒผใ‚’้ธๆŠžโ€ฆ SDใ‚ซใƒผใƒ‰ใ‚„USBใƒ‰ใƒฉใ‚คใƒ–ใฎไปปๆ„ใฎใƒ•ใ‚ฉใƒซใƒ€ใƒผใ‚’ไฝฟ็”จใ—ใพใ™ ใ‚ฒใƒผใƒ ใฏ้ธๆŠžใ—ใŸๅ ดๆ‰€ใฎไธญใฎGamesใƒ•ใ‚ฉใƒซใƒ€ใƒผใซไฟๅญ˜ใ•ใ‚Œใพใ™ใ€‚ๆ—ขๅญ˜ใฎใ‚ฒใƒผใƒ ใฏ็งปๅ‹•ใ•ใ‚Œใพใ›ใ‚“ใ€‚ - ไฝฟ็”จๅ†…่จณ + ๅฎน้‡ใ‚’ไฝฟใฃใฆใ„ใ‚‹ใ‚‚ใฎ Steam ใ‚ฒใƒผใƒ  ใ‚ฒใƒผใƒ ใƒ‡ใƒผใ‚ฟ ใƒ—ใƒฌใƒ•ใ‚ฃใƒƒใ‚ฏใ‚น %1$s ยท ใƒฏใƒผใ‚ฏใ‚ทใƒงใƒƒใƒ— %2$s ยท ใ‚ทใ‚งใƒผใƒ€ใƒผ %3$s @@ -2930,6 +3238,7 @@ ใ‚ฒใƒผใƒ ใŒ่ฆๆฑ‚ใ—ใŸ VC++ ใจ DirectX ใฎใ‚คใƒณใ‚นใƒˆใƒผใƒฉใƒผ Linux x86 ใ‚ฒใƒผใƒ ใ‚’ๅฎŸ่กŒ Steam ใƒ„ใƒผใƒซ + Steam ใฏใ‚ขใƒณใƒใƒใƒผใƒˆใ‚’ๅŒๆขฑใ™ใ‚‹ใ‚ฒใƒผใƒ ๅ‘ใ‘ใซใ€ใใฎๆฉŸ่ƒฝใŒใ‚ชใƒ•ใงใ‚‚ใ“ใ‚Œใ‚’ใƒ€ใ‚ฆใƒณใƒญใƒผใƒ‰ใ—ใพใ™ใ€‚ๅ‰Š้™คใ™ใ‚‹ใจใ€ใใ‚Œใ‚‰ใฎใ‚ฒใƒผใƒ ใฎใ‚คใƒณใ‚นใƒˆใƒผใƒซใŒ 0% ใงๆญขใพใ‚Šใพใ™ DroidDeck ใฏใ“ใฎใƒฉใƒณใ‚ฟใ‚คใƒ ใชใ—ใงใ‚ฒใƒผใƒ ใ‚’ๅฎŸ่กŒใงใใพใ™ x86 Proton ใฎใŸใ‚ DroidDeck ใงใฏๅฎŸ่กŒใงใใพใ›ใ‚“ ใ™ในใฆใฎใ‚ฒใƒผใƒ ใฎๆ—ขๅฎš @@ -2993,6 +3302,19 @@ ไฟๆŒ Steam ไปฅๅค–ใฎใ‚ฒใƒผใƒ ใจ Steam ใฎๅ…ฑๆœ‰ใƒ—ใƒฌใƒ•ใ‚ฃใƒƒใ‚ฏใ‚น ใ‚นใƒˆใ‚ขใ‹ใ‚‰ใ€ใพใŸใฏๆ‰‹ๅ‹•ใง่ฟฝๅŠ ใ—ใŸใ‚ฒใƒผใƒ ใฎใƒ—ใƒฌใƒ•ใ‚ฃใƒƒใ‚ฏใ‚น + Steam ใฎๅ…ฑๆœ‰ใƒ—ใƒฌใƒ•ใ‚ฃใƒƒใ‚ฏใ‚น + Steam ใŒ็‹ฌ่‡ชใฎ Windows ใƒ˜ใƒซใƒ‘ใƒผใ‚’ใ“ใ“ใงๅฎŸ่กŒใ—ใพใ™ + ๅ‰Š้™คใ—ใพใ™๏ผˆ%1$s๏ผ‰ใ€‚ๆฌกใซๅฟ…่ฆใซใชใฃใŸใจใ Steam ใŒๆ–ฐใ—ใไฝœๆˆใ—ใพใ™ใ€‚ + ใ‚นใƒˆใ‚ขใ‚ขใƒ—ใƒชใจใใ‚Œใงๅ‹•ใใ‚ฒใƒผใƒ  + %1$s ใŒไฝฟ็”จ + Steam ไปฅๅค–ใฎใ‚ฒใƒผใƒ  %1$s + ใฉใฎใ‚ฒใƒผใƒ ใซใ‚‚ไธ€่‡ดใ—ใชใ„ใŸใ‚ไฟๆŒใ•ใ‚Œใพใ™ + ้ธๆŠž้ …็›ฎใ‚’ๅ‰Š้™ค ยท %1$s + ้ธๆŠž้ …็›ฎใ‚’ใ‚ขใƒณใ‚คใƒณใ‚นใƒˆใƒผใƒซ ยท %1$s + Wineใƒ—ใƒฌใƒ•ใ‚ฃใƒƒใ‚ฏใ‚น + ใใฎไธญใฎใ‚ปใƒผใƒ–ใƒ‡ใƒผใ‚ฟใจ่จญๅฎšใฏๅคฑใ‚ใ‚Œใพใ™ใ€‚Steam Cloudใฎใ‚ปใƒผใƒ–ใƒ‡ใƒผใ‚ฟใฏใ‚ขใ‚ซใ‚ฆใƒณใƒˆใซๆฎ‹ใ‚Šใพใ™ใ€‚ + ใ‚ทใ‚งใƒผใƒ€ใƒผใ‚ญใƒฃใƒƒใ‚ทใƒฅ + ใƒ—ใƒฌใƒ•ใ‚ฃใƒƒใ‚ฏใ‚น %1$s ยท ใ‚ทใ‚งใƒผใƒ€ใƒผ %2$s ใƒ€ใ‚ฆใƒณใƒญใƒผใƒ‰ๆธˆใฟใฎใƒ‘ใƒƒใ‚ฑใƒผใ‚ธ ไฟๅญ˜ๆธˆใฟใฎๅ…ƒใƒ•ใ‚กใ‚คใƒซ ใƒ€ใ‚ฆใƒณใƒญใƒผใƒ‰ๆธˆใฟใฎใ‚ณใƒณใƒใƒผใƒใƒณใƒˆใƒ‘ใƒƒใ‚ฑใƒผใ‚ธใฏใ‚ใ‚Šใพใ›ใ‚“ใ€‚ @@ -3027,6 +3349,8 @@ DroidDeck ยท %1$d fps 60 fps ใฏใชใ‚ใ‚‰ใ‹ใงใ™ใŒใ€Steam ใฎ่ตทๅ‹•ไธญใซ CPU ใ‚’ใ‚ˆใ‚Šๅคšใไฝฟใ„ใพใ™ใ€‚Steam ๆœฌไฝ“ใฎ่จญๅฎšใง้ธใ‚“ใ ใƒ ใƒผใƒ“ใƒผใ‚‚ใ“ใ“ใซ่กจ็คบใ•ใ‚Œใพใ™ใ€‚ ใ‚ตใ‚ฆใƒณใƒ‰ + ่ตทๅ‹•ใƒ ใƒผใƒ“ใƒผใ‚’ใ‚นใ‚ญใƒƒใƒ— + 0.1 ็ง’ใฎ้ป’ใ„ใ‚ฏใƒชใƒƒใƒ—ใ‚’ Steam ใฎ่ตทๅ‹•ใƒ ใƒผใƒ“ใƒผใจใ—ใฆไฝฟ็”จใ—ใพใ™ใ€‚ๆฌกๅ›žใ‚ปใƒƒใ‚ทใƒงใƒณใ‹ใ‚‰้ฉ็”จใ•ใ‚Œใพใ™ใ€‚ ่‡ชๅˆ†ใฎใƒ ใƒผใƒ“ใƒผ MP4ใ€MOVใ€MKVใ€WebMใ€‚ใใฎไป–ใฎๅฝขๅผใ‚„ %1$d MB ใ‚’่ถ…ใˆใ‚‹ใƒ•ใ‚กใ‚คใƒซใฏใ€็ซฏๆœซไธŠใง 720p ใฎ WebM ใซๅค‰ๆ›ใ•ใ‚Œใพใ™๏ผˆ%2$d ็ง’ใพใง๏ผ‰ใ€‚ ใ‚คใƒณใƒใƒผใƒˆ @@ -3488,6 +3812,7 @@ Alt+Tabใ€Win ใ‚ญใƒผใ€ใƒ›ใƒผใƒ ใƒœใ‚ฟใƒณใ‚’ Android ใงใฏใชใๆ“ไฝœไธญใฎ DroidDeck ใ‚ปใƒƒใ‚ทใƒงใƒณใงไฝฟใˆใ‚‹ใ‚ˆใ†ใซใ—ใพใ™ใ€‚ ใ€Œใ‚ปใƒƒใƒˆใ‚ขใƒƒใƒ—ใ€โ†’ใ€ŒSteam้€ฃๆบใ€ใงๆ˜Žใ‚‹ใ•ใ‚’ใ‚ชใƒณใซใ—ใฆใใ ใ•ใ„ Mali ใƒ–ใƒชใƒƒใ‚ธ: ใ‚ชใƒ• + %1$s ใงใฏ Mali ใƒ–ใƒชใƒƒใ‚ธใ‚’ไฝฟ็”จใงใใพใ›ใ‚“๏ผˆใ‚ทใ‚นใƒ†ใƒ ใƒ‰ใƒฉใ‚คใƒใƒผใฎ็ตŒ่ทฏใŒๅญ˜ๅœจใ—ใชใ„ Mali GPU ใŒๅฟ…่ฆใงใ™๏ผ‰ใ€‚ใใฎใŸใ‚ใ€ใ“ใฎใ‚นใ‚คใƒƒใƒใฏใ“ใ“ใงใฏๅŠนๆžœใŒใ‚ใ‚Šใพใ›ใ‚“ใ€‚ Mali ใƒ–ใƒชใƒƒใ‚ธ: ใ‚ชใƒณ %1$s ใฏ Adreno ใงใฏใ‚ใ‚Šใพใ›ใ‚“ใ€‚่ฉฆ้จ“็š„ใช Vulkan ใƒ–ใƒชใƒƒใ‚ธใŒใ‚ชใƒณใงใ™ใ€‚ใ‚ปใƒƒใ‚ทใƒงใƒณใฏใ‚นใƒžใƒผใƒˆใƒ•ใ‚ฉใƒณๆœฌไฝ“ใฎใƒ‰ใƒฉใ‚คใƒใƒผใงๆ็”ปใ—ใพใ™ใ€‚ไธๅ…ทๅˆใŒๅ‡บใ‚‹ๅฏ่ƒฝๆ€งใŒใ‚ใ‚Šใพใ™ใ€‚ใ‚ปใƒƒใ‚ทใƒงใƒณใƒญใ‚ฐใ‚’้€ใฃใฆใใ ใ•ใ„ใ€‚ ใ‚ปใƒผใƒ•ใƒขใƒผใƒ‰ @@ -3513,6 +3838,25 @@ ๅพŒใ‚ใธ็งปๅ‹• ใ‚ฆใ‚ฃใ‚ธใ‚งใƒƒใƒˆใฎ่จญๅฎš ใ‚ฆใ‚ฃใ‚ธใ‚งใƒƒใƒˆใ‚’ๅ‰Š้™ค + ๅค–่ฆณ + ใ‚ขใ‚คใ‚ณใƒณใƒ‘ใƒƒใ‚ฏ + ใ‚ทใ‚นใƒ†ใƒ ใฎใƒ‡ใƒ•ใ‚ฉใƒซใƒˆ + ใ‚ขใƒ—ใƒชใฎ่‰ฒใ‚’่ƒŒๆ™ฏใซไฝฟ็”จ + ใ‚ขใ‚คใ‚ณใƒณใ‚ตใ‚คใ‚บ + ๅฐ + ไธญ + ๅคง + ใ‚ขใƒ—ใƒชๅใ‚’้ž่กจ็คบ + ้–“้š” + ็‹ญใ„ + ๆจ™ๆบ– + ๅบƒใ„ + ใ‚ขใ‚คใ‚ณใƒณใ‚’ๅค‰ๆ›ด + ใ‚ขใ‚คใ‚ณใƒณใ‚’ใƒชใ‚ปใƒƒใƒˆ + ใ‚ขใ‚คใ‚ณใƒณใ‚’ๆคœ็ดข + ใ‚ขใ‚คใ‚ณใƒณใ‚’่ชญใฟ่พผใฟไธญโ€ฆ + ใ‚ขใ‚คใ‚ณใƒณใŒ่ฆ‹ใคใ‹ใ‚Šใพใ›ใ‚“ใ€‚ + ใ‚ซใ‚นใ‚ฟใƒ ใ‚ขใ‚คใ‚ณใƒณ ใƒ•ใ‚ฉใƒซใƒ€ใซ่ฟฝๅŠ  ๆ–ฐใ—ใ„ใƒ•ใ‚ฉใƒซใƒ€ ใƒ•ใ‚ฉใƒซใƒ€ใ‹ใ‚‰ๅ‰Š้™ค @@ -3627,5 +3971,81 @@ ใ“ใฎใƒฌใ‚คใ‚ขใ‚ฆใƒˆใ‚’ใ‚คใƒณใƒใƒผใƒˆใงใใพใ›ใ‚“ใงใ—ใŸ ็ท‹่‰ฒใฎ้›ช + ็™ฝใ„ใ‚ตใƒผใƒ•ใ‚งใ‚นใซ่ตคใฎใ‚ขใ‚ฏใ‚ปใƒณใƒˆใ€‚ + ใ‚ตใ‚ฆใƒณใƒ‰ใƒˆใƒฉใƒƒใ‚ฏ + ้Ÿณๆฅฝ + ๅ†็”Ÿใ‚ชใƒ—ใ‚ทใƒงใƒณ + ใŠๆฐ—ใซๅ…ฅใ‚Š + ใ‚ณใƒฌใ‚ฏใ‚ทใƒงใƒณ + ใ‚ณใƒฌใ‚ฏใ‚ทใƒงใƒณใฏใพใ ใ‚ใ‚Šใพใ›ใ‚“ใ€‚ใƒ–ใƒƒใ‚ฏใƒžใƒผใ‚ฏใ‚ขใ‚คใ‚ณใƒณใ‚’ใ‚ฟใƒƒใƒ—ใ—ใฆไฝœๆˆใงใใพใ™ใ€‚ + ไฟๅญ˜ๆธˆใฟ + ใ‚ณใƒฌใ‚ฏใ‚ทใƒงใƒณใ‚’ไฝœๆˆ + ไฟๅญ˜ใ—ใŸๆ›ฒใ‚’ๆ•ด็† + ๆ–ฐ่ฆ + ไฝœๆˆ + ใ‚ณใƒฌใ‚ฏใ‚ทใƒงใƒณๅ + ไป–ใฎใ‚ณใƒฌใ‚ฏใ‚ทใƒงใƒณใงไฝฟใ‚ใ‚Œใฆใ„ใชใ„ๅๅ‰ใ‚’ๅ…ฅๅŠ›ใ—ใฆใใ ใ•ใ„ + ็ฎก็† + ๅๅ‰ใ‚’ๅค‰ๆ›ด + ใƒˆใƒฉใƒƒใ‚ฏใ‚’่ฟฝๅŠ  + ่ฟฝๅŠ (%1$d) + ใƒˆใƒฉใƒƒใ‚ฏใ‚’ๅ‰Š้™ค + ใ‚ณใƒฌใ‚ฏใ‚ทใƒงใƒณใ‚’ๅ‰Š้™ค + %1$sใ‚’ๅ‰Š้™คใ—ใพใ™ใ‹? + ใƒˆใƒฉใƒƒใ‚ฏใฏใƒ‡ใƒใ‚คใ‚นใซๆฎ‹ใ‚Šใพใ™ใ€‚ใ‚ณใƒฌใ‚ฏใ‚ทใƒงใƒณใฎใฟใŒๅ‰Š้™คใ•ใ‚Œใพใ™ใ€‚ + ้ธๆŠž + ใ™ในใฆ้ธๆŠž + ใ™ในใฆ้ธๆŠž่งฃ้™ค + %1$dไปถ้ธๆŠžไธญ + ใ‚ณใƒฌใ‚ฏใ‚ทใƒงใƒณใซ่ฟฝๅŠ  + ใŠๆฐ—ใซๅ…ฅใ‚Šใซ่ฟฝๅŠ  + ใ‚ณใƒฌใ‚ฏใ‚ทใƒงใƒณใ‹ใ‚‰ๅ‰Š้™ค + ใƒˆใƒฉใƒƒใ‚ฏใ‚’ๆคœ็ดข + ใ‚ขใƒซใƒใƒ ้ † + ้•ทใ„้ † + ็Ÿญใ„้ † + ใƒˆใƒฉใƒƒใ‚ฏ + ใƒ”ใƒƒใƒ + ใƒชใ‚ปใƒƒใƒˆ + ็„ก้Ÿณ้ƒจๅˆ†ใ‚’ใ‚นใ‚ญใƒƒใƒ— + ใ‚นใƒชใƒผใƒ—ใ‚ฟใ‚คใƒžใƒผ + %1$dๅˆ† + ใƒˆใƒฉใƒƒใ‚ฏใฎ็ต‚ใ‚ใ‚Š + ๆฎ‹ใ‚Š %1$s + ใ‚คใ‚ณใƒฉใ‚คใ‚ถใƒผ + ไฝŽ้Ÿณใƒ–ใƒผใ‚นใƒˆ + ใ“ใฎใƒ‡ใƒใ‚คใ‚นใงใฏใ‚คใ‚ณใƒฉใ‚คใ‚ถใƒผใ‚’ไฝฟ็”จใงใใพใ›ใ‚“ + ใ‚ฒใƒผใƒ ไธญใ‚‚ๆœ‰ๅŠนใซใ™ใ‚‹ + ใ‚ฒใƒผใƒ ๅฎŸ่กŒไธญใ‚‚ใ‚ตใ‚ฆใƒณใƒ‰ใƒˆใƒฉใƒƒใ‚ฏใ‚’ๅ†็”Ÿใ—็ถšใ‘ใพใ™ + ใ‚คใƒณใ‚นใƒˆใƒผใƒซๆธˆใฟใฎใ‚ตใ‚ฆใƒณใƒ‰ใƒˆใƒฉใƒƒใ‚ฏใฏใพใ ใ‚ใ‚Šใพใ›ใ‚“ใ€‚ + ใ‚ตใ‚ฆใƒณใƒ‰ใƒˆใƒฉใƒƒใ‚ฏใ‚’ๆคœ็ดข + ใ‚ตใ‚ฆใƒณใƒ‰ใƒˆใƒฉใƒƒใ‚ฏใฎใƒ•ใ‚ฉใƒซใƒ€ใƒผใ‚’่ฟฝๅŠ  + ใใฎใƒ•ใ‚ฉใƒซใƒ€ใƒผใซ้Ÿณๅฃฐใƒ•ใ‚กใ‚คใƒซใŒใ‚ใ‚Šใพใ›ใ‚“ + ๅˆ่จˆๆ™‚้–“ + %1$d ใƒˆใƒฉใƒƒใ‚ฏ / %2$s + ใƒ‡ใ‚ฃใ‚นใ‚ฏ %1$s + ใ‚ทใƒฃใƒƒใƒ•ใƒซ + ๅ‰ใธ + ๅ†็”Ÿ + ไธ€ๆ™‚ๅœๆญข + ๆฌกใธ + ใƒชใƒ”ใƒผใƒˆใชใ— + ๅ…จๆ›ฒใƒชใƒ”ใƒผใƒˆ + 1ๆ›ฒใƒชใƒ”ใƒผใƒˆ + ้Ÿณ้‡ + ใ“ใฎใ‚ตใ‚ฆใƒณใƒ‰ใƒˆใƒฉใƒƒใ‚ฏใซ้Ÿณๅฃฐใƒ•ใ‚กใ‚คใƒซใŒใ‚ใ‚Šใพใ›ใ‚“ + ่ตทๅ‹•ใงใใพใ›ใ‚“ + ใ“ใฎใƒชใƒณใ‚ฏใ‚’้–‹ใ‘ใ‚‹ใ‚ฆใ‚งใƒ–ใƒ–ใƒฉใ‚ฆใ‚ถใŒใ‚ใ‚Šใพใ›ใ‚“ใ€‚ + ๆŽดใ‚€ + ้›ขใ™ + ไฟๅญ˜ + ้•ทๆŠผใ—ใงใƒชใ‚ปใƒƒใƒˆ + ใ‚นใƒˆใ‚ข + ใƒ•ใƒฌใƒผใƒ ๆ™‚้–“ + ๅนณๅ‡ใƒ•ใƒฌใƒผใƒ ใƒฌใƒผใƒˆ + ่กจ็คบใ‚ตใƒผใƒใƒผ + HDR ็Šถๆ…‹ + ่กจ็คบไธญ + %2$d ไธญ %1$d diff --git a/app/src/main/res/values-ko/input_library.xml b/app/src/main/res/values-ko/input_library.xml new file mode 100644 index 0000000000..d19c198c7e --- /dev/null +++ b/app/src/main/res/values-ko/input_library.xml @@ -0,0 +1,132 @@ + + + ์„ ํƒํ•œ ๋””์Šคํ”Œ๋ ˆ์ด๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. ์—ฐ๊ฒฐํ•˜๋ฉด ์ด ๋ ˆ์ด์•„์›ƒ์„ ์‹ค์ œ ํฌ๊ธฐ๋กœ ํŽธ์ง‘ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. + ์ €์žฅํ•˜์ง€ ์•Š์€ ๋ ˆ์ด์•„์›ƒ ๋ณ€๊ฒฝ์„ ์ทจ์†Œํ• ๊นŒ์š”? + ์ด ๋ ˆ์ด์•„์›ƒ์€ %1$d๊ฐœ ํ”„๋กœํ•„์—์„œ ์‚ฌ์šฉ ์ค‘์ž…๋‹ˆ๋‹ค. ์ €์žฅ๋œ ๋ณ€๊ฒฝ์€ ๋ชจ๋‘์— ์ ์šฉ๋ฉ๋‹ˆ๋‹ค. + ๊ธฐ๋ณธ ํ”„๋กœํ•„ + ๋ฐ์Šคํฌํ†ฑ ๋ชจ๋“œ + ๊ฒŒ์ž„ ๋ชจ๋“œ + ๋ฐ์Šคํฌํ†ฑ ๋ฐ ๊ฒŒ์ž„ ๊ธฐ๋ณธ + ๊ฒŒ์ž„ ๋ชจ๋“œ ๊ธฐ๋ณธ + ๋ฐ์Šคํฌํ†ฑ ๋ชจ๋“œ ๊ธฐ๋ณธ + ๊ธฐ๊ธฐ ์„ค์ • + ์ปจํŠธ๋กค + ๋ฒ„ํŠผ, ์Šคํ‹ฑ, ํŠธ๋ฆฌ๊ฑฐ ๋ฐ ์ถ”๊ฐ€ ํ‚ค + ํ”„๋กœํ•„ ๋ณต์‚ฌ + ๋™์ž‘ ์ดˆ๊ธฐํ™” + %1$s์˜ ๋™์ž‘์„ ๊ธฐ๋ณธ ํ”„๋กœํ•„ ๊ฐ’์œผ๋กœ ์ดˆ๊ธฐํ™”ํ• ๊นŒ์š”? ๋ ˆ์ด์•„์›ƒ๊ณผ ๋‹ค๋ฅธ ํ”„๋กœํ•„์€ ๊ทธ๋Œ€๋กœ ์œ ์ง€๋ฉ๋‹ˆ๋‹ค. + %1$s์„(๋ฅผ) ์‚ญ์ œํ• ๊นŒ์š”? ์‚ฌ์šฉ ์ค‘์ธ ๋ชจ๋“œ๋Š” ๋‚ด์žฅ ๊ธฐ๋ณธ ํ”„๋กœํ•„๋กœ ๋Œ์•„๊ฐ‘๋‹ˆ๋‹ค. ์ €์žฅ๋œ ๋ ˆ์ด์•„์›ƒ๊ณผ ๊ณต์œ  ์„ค์ •์€ ๊ณ„์† ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. + ํ‘œ์‹œ + ๋ชจ๋“  ํ”„๋กœํ•„์— ์ ์šฉ๋ฉ๋‹ˆ๋‹ค. Auto๋Š” ๊ฒŒ์ž„ ๋ชจ๋“œ์—์„œ ์ปจํŠธ๋กค๋Ÿฌ๊ฐ€ ์—ฐ๊ฒฐ๋˜์ง€ ์•Š์•˜์„ ๋•Œ ๊ธฐ๋ณธ ํ™”๋ฉด ์ปจํŠธ๋กค์„ ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค. + ํ™”๋ฉด์—์„œ ํŽธ์ง‘ + ์ €์žฅ๋œ ๋ ˆ์ด์•„์›ƒโ€ฆ + ๋ ˆ์ด์•„์›ƒ์„ ์„ ํƒํ•˜๊ฑฐ๋‚˜ ์ƒˆ๋กœ ๋งŒ๋“œ์„ธ์š” + ๋ณด์กฐ ํ™”๋ฉด ์„ธ์…˜ ๋ฉ”๋‰ด์—์„œ ํ”„๋กœํ•„ ์ปจํŠธ๋กค์„ ์„ ํƒํ•˜์„ธ์š”. ์ปจํŠธ๋กค๋Ÿฌ ๋ฉ”๋‰ด์˜ ํ”„๋กœํ•„ ๋ฐ ๋ณด์กฐ ํ™”๋ฉด ์„ ํƒ์œผ๋กœ ํ‘œ์‹œํ•  ์ปจํŠธ๋กค์„ ์ •ํ•ฉ๋‹ˆ๋‹ค. + ๋ฒ„ํŠผ ๋™์ž‘ + %1$s์™€(๊ณผ) ๊ณต์œ  ์ค‘์ž…๋‹ˆ๋‹ค. ํŽธ์ง‘ ๋‚ด์šฉ์€ ํ•ด๋‹น ํ”„๋กœํ•„์—๋„ ์ ์šฉ๋ฉ๋‹ˆ๋‹ค. + ์„ค์ • ์žฌ์‚ฌ์šฉ + ์„ค์ • ์‚ฌ์šฉ ์œ„์น˜โ€ฆ + ๋‹ค๋ฅธ ํ”„๋กœํ•„์—์„œ ๋ณต์‚ฌํ•˜๊ฑฐ๋‚˜ ์„ค์ •์„ ๊ณต์œ ํ•œ ์ƒํƒœ๋กœ ์œ ์ง€ํ•ฉ๋‹ˆ๋‹ค + ๋…๋ฆฝ์ ์œผ๋กœ ๋งŒ๋“ค๊ธฐ + ํ˜„์žฌ ์„ค์ •์„ ์œ ์ง€ํ•˜๊ณ  ๋ณ€๊ฒฝ ๊ณต์œ ๋ฅผ ์ค‘์ง€ํ•ฉ๋‹ˆ๋‹ค + ๋ ˆ์ด์•„์›ƒ์€ ์š”์†Œ์™€ ์œ„์น˜๋ฅผ ์ €์žฅํ•ฉ๋‹ˆ๋‹ค. ๊ฐ ํ”„๋กœํ•„์€ ์ž์ฒด ๋™์ž‘์„ ์ง€์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋Œ€์ƒ ํ™”๋ฉด์—์„œ ์‹ค์ œ ํฌ๊ธฐ๋กœ ํŽธ์ง‘ํ•˜์„ธ์š”. + ํ˜„์žฌ ๋ ˆ์ด์•„์›ƒ + ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š” ๋ ˆ์ด์•„์›ƒ %1$s๊ณผ(์™€) ์ €์žฅ๋œ ๋™์ž‘์„ ์‚ญ์ œํ• ๊นŒ์š”? + ํ˜„์žฌ ๋ ˆ์ด์•„์›ƒ ์ด๋ฆ„ ๋ณ€๊ฒฝ + ์ฝ์„ ์ˆ˜ ์—†๋Š” ์ž…๋ ฅ ์„ค์ •์ด ๋ณต๊ตฌ ์‚ฌ๋ณธ์— ๋ณด๊ด€๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ๋ณต์›๋œ ํ”„๋กœํ•„์„ ๊ณ„์† ํŽธ์ง‘ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. + ์†์„ฑ + ํด๋ฆญ ์†์„ฑ + %1$s ยท ํด๋ฆญ + ๋ฒ„ํŠผ + ์Šคํ‹ฑ, ํŒจ๋“œ, ํŠธ๋ฆฌ๊ฑฐ + ๋„๊ตฌ ์ˆจ๊ธฐ๊ธฐ + ์ปจํŠธ๋กค๋Ÿฌ + ์ปจํŠธ๋กค๋Ÿฌ ์ž…๋ ฅ์„ Steam Input ๋˜๋Š” ๊ฒŒ์ž„์œผ๋กœ ๋ณด๋ƒ…๋‹ˆ๋‹ค. + ์ด ์š”์†Œ๋Š” ์ปจํŠธ๋กค๋Ÿฌ, ๋งˆ์šฐ์Šค, ํ‚ค๋ณด๋“œ ์ž…๋ ฅ์„ ๋ณด๋‚ด์ง€ ์•Š์Šต๋‹ˆ๋‹ค. + ๋งˆ์šฐ์Šค ํด๋ฆญ + DroidDeck ๋™์ž‘ + ๋™์ž‘ + ์Šคํฌ๋กค ์†๋„: %1$d ๋‹จ๊ณ„/์ดˆ + + ์ƒˆ ํ”„๋กœํ•„ + + ์ƒˆ ๋ ˆ์ด์•„์›ƒ + %1$s ยท %2$d๊ฐœ ํ”„๋กœํ•„์—์„œ ์‚ฌ์šฉ ์ค‘์ž…๋‹ˆ๋‹ค. ๋ณ€๊ฒฝ ์‚ฌํ•ญ์€ ์ด ํ• ๋‹น์„ ์‚ฌ์šฉํ•˜๋Š” ๋ชจ๋“  ํ”„๋กœํ•„์— ์ ์šฉ๋ฉ๋‹ˆ๋‹ค. + ์ด๋ฆ„ ๋ณ€๊ฒฝ + ์‚ญ์ œ + ๋™์ž‘์„ ํ• ๋‹นํ•˜๊ธฐ ์ „์— ๋ ˆ์ด์•„์›ƒ์— ์š”์†Œ๋ฅผ ์ถ”๊ฐ€ํ•˜์„ธ์š”. + ์ž…๋ ฅ ์„ค์ •์„ ์ €์žฅํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค + ์ด๋ฆ„ + ์‹œ์ž‘ ์œ„์น˜ + ๋ฒ„ํŠผ + ์Šคํ‹ฑ + ํ„ฐ์น˜ํŒจ๋“œ + ์‹ญ์žํ‚ค + ํŠธ๋ฆฌ๊ฑฐ + ์™„๋ฃŒ + ์‹คํ–‰ ์ทจ์†Œ + + ์ถ”๊ฐ€ + ๋“œ๋ž˜๊ทธํ•˜์—ฌ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค. ๋ชจ์„œ๋ฆฌ๋ฅผ ๋“œ๋ž˜๊ทธํ•˜์—ฌ ํฌ๊ธฐ๋ฅผ ์กฐ์ •ํ•ฉ๋‹ˆ๋‹ค. ์†์„ฑ์„ ํƒญํ•˜์—ฌ ๋™์ž‘์„ ํ• ๋‹นํ•ฉ๋‹ˆ๋‹ค. + ๋ณด์กฐ ํ™”๋ฉด์—์„œ ํŽธ์ง‘ ์ค‘ + ๋‹ค๋ฅธ ํ”„๋กœํ•„์˜ %1$s์„(๋ฅผ) ์žฌ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. ๋‹ค๋ฅธ ์ปจํŠธ๋กค ์†Œ์Šค๋Š” ๊ทธ๋Œ€๋กœ ์œ ์ง€๋ฉ๋‹ˆ๋‹ค. + ๋ฌผ๋ฆฌ ์ปจํŠธ๋กค์„ ๊ณต์œ  ์ƒํƒœ๋กœ ์œ ์ง€ + ๊ธฐ๋ณธ์ ์œผ๋กœ ๋ชจ๋“  ์ปจํŠธ๋กค๊ณผ ์‚ฌ์šฉ์ž ๋ ˆ์ด์•„์›ƒ์€ ๋…๋ฆฝ๋œ ์‚ฌ๋ณธ์ž…๋‹ˆ๋‹ค. ๊ณต์œ ๋Š” ๋ฌผ๋ฆฌ ์ปจํŠธ๋กค๋งŒ ์—ฐ๊ฒฐํ•ฉ๋‹ˆ๋‹ค. + ์ด ์š”์†Œ์™€ ์œ„์น˜๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. ๊ณต์œ ํ•˜๋ฉด ์ดํ›„ ์ง€์˜ค๋ฉ”ํŠธ๋ฆฌ ๋ณ€๊ฒฝ์ด ๋™๊ธฐํ™”๋˜์ง€๋งŒ ๋ฒ„ํŠผ ๋™์ž‘์€ ๋…๋ฆฝ์ ์œผ๋กœ ์œ ์ง€๋ฉ๋‹ˆ๋‹ค. ๋‹ค๋ฅธ ๋ ˆ์ด์•„์›ƒ์€ ํ• ๋‹น๋˜์ง€ ์•Š์€ ๋™์ž‘์œผ๋กœ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค. + ์ด ์ปจํŠธ๋กค๊ณผ ๋™์ž‘์„ ๋ณต์‚ฌํ•˜๊ฑฐ๋‚˜ ์—ฐ๊ฒฐํ•˜์—ฌ ์ดํ›„ ํŽธ์ง‘์ด ๋‘ ํ”„๋กœํ•„ ๋ชจ๋‘์— ์ ์šฉ๋˜๊ฒŒ ํ•ฉ๋‹ˆ๋‹ค. + ๊ณต์œ  ์œ ์ง€ + ๋…๋ฆฝ ์‚ฌ๋ณธ + ํ„ฐ์น˜ํ•œ ์œ„์น˜์—์„œ ์Šคํ‹ฑ ์‹œ์ž‘ + ์‚ฌ์šฉํ•˜์ง€ ์•Š์„ ๋•Œ ์Šคํ‹ฑ ์ˆจ๊ธฐ๊ธฐ + ๋„๊ตฌ + ์ž๋™ (%1$s) + ์‚ฌ์šฉ์ž ์ง€์ • (%1$s) + ์ƒˆ ํ”„๋กœํ•„๋กœ ์ €์žฅ + ํ”„๋กœํ•„ ์ปจํŠธ๋กค + ํ”„๋กœํ•„ + ๋งˆ์šฐ์Šค ํ„ฐ์น˜ํŒจ๋“œ ์ œ์Šค์ฒ˜ + ๋งˆ์šฐ์Šค ํฌ์ธํ„ฐ์— ํ• ๋‹น๋œ ๊ฒฝ์šฐ: ํƒญํ•˜์—ฌ ํด๋ฆญ, ๊ธธ๊ฒŒ ๋ˆŒ๋Ÿฌ ๋“œ๋ž˜๊ทธ, ๋‘ ์†๊ฐ€๋ฝ์œผ๋กœ ์Šคํฌ๋กคํ•ฉ๋‹ˆ๋‹ค. + %1$s์—๋Š” ๋น ๋ฅธ ๋ฉ”๋‰ด ์žฌ์ •์˜๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. ์ž๋™์„ ์„ ํƒํ•˜๋ฉด ๊ธฐ๋ณธ ํ”„๋กœํ•„๊ณผ ์ €์žฅ๋œ ์„ธ ๋ถ€๋ถ„์„ ๋ชจ๋‘ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. + DroidDeck ์ž…๋ ฅ + ์Šคํ‹ฑ์„ ์–ด๋А ๋ฐฉํ–ฅ์œผ๋กœ๋“  ์›€์ง์ด๋Š” ๋™์•ˆ ์œ ์ง€๋ฉ๋‹ˆ๋‹ค: 55% ์ดˆ๊ณผ ์‹œ ๋ˆ„๋ฆ„, 35% ๋ฏธ๋งŒ ์‹œ ํ•ด์ œ. ๋ฐฉํ–ฅ ํ‚ค๋กœ ๊ฐ ๋ฐฉํ–ฅ์„ ๋”ฐ๋กœ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค. DroidDeck ๋ช…๋ น์€ ๊ธฐ์šธ๊ธฐ๋งˆ๋‹ค ํ•œ ๋ฒˆ ์‹คํ–‰๋ฉ๋‹ˆ๋‹ค. ์Šคํ‹ฑ ํด๋ฆญ์€ ๋”ฐ๋กœ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. + ํ„ฐ์น˜ํŒจ๋“œ๋ฅผ ๋งŒ์ง€๋Š” ๋™์•ˆ ์œ ์ง€๋˜๊ณ  ์†์„ ๋–ผ๋ฉด ํ•ด์ œ๋ฉ๋‹ˆ๋‹ค. DroidDeck ๋ช…๋ น์€ ํ„ฐ์น˜๋งˆ๋‹ค ํ•œ ๋ฒˆ ์‹คํ–‰๋ฉ๋‹ˆ๋‹ค. ํ„ฐ์น˜ํŒจ๋“œ ํด๋ฆญ์€ ๋”ฐ๋กœ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. + ํŠธ๋ฆฌ๊ฑฐ๊ฐ€ 55%๋ฅผ ๋„˜์œผ๋ฉด ์œ ์ง€๋˜๊ณ  35% ๋ฏธ๋งŒ์ด๋ฉด ํ•ด์ œ๋ฉ๋‹ˆ๋‹ค. DroidDeck ๋ช…๋ น์€ ๋ˆ„๋ฅผ ๋•Œ๋งˆ๋‹ค ํ•œ ๋ฒˆ ์‹คํ–‰๋ฉ๋‹ˆ๋‹ค. + ์Šคํฌ๋กค ๋ฐฉํ–ฅ + ์„ธ๋กœ + ๊ฐ€๋กœ + ๊ฐ€๋กœ๋กœ ์Šคํฌ๋กค + ์ธก์ •๊ฐ’ + ๊ธฐ๋ก์„ ์ผœ๊ณ  ์‹คํ–‰ ์ค‘์ธ ์„ธ์…˜์—์„œ ์ปจํŠธ๋กค์„ ์‚ฌ์šฉํ•œ ๋’ค ๋Œ์•„์™€ ๊ฒฐ๊ณผ๋ฅผ ์ฝ์œผ์„ธ์š”. DroidDeck ์ „๋‹ฌ ์‹œ๊ฐ„๋งŒ ์ธก์ •ํ•˜๋ฉฐ ํ‘œ์‹œ ์ง€์—ฐ์€ ํฌํ•จํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ์•ฑ ํ”„๋กœ์„ธ์Šค๊ฐ€ ์ข…๋ฃŒ๋˜๋ฉด ๊ธฐ๋ก์ด ๋๋‚ฉ๋‹ˆ๋‹ค. + ์ปจํŠธ๋กค %1$d๊ฐœ + ๋‹ค๋ฅธ ์ €์žฅ๋œ ๋ ˆ์ด์•„์›ƒ (%1$d) โ–พ + ๋‹ค๋ฅธ ์ €์žฅ๋œ ๋ ˆ์ด์•„์›ƒ ์ˆจ๊ธฐ๊ธฐ (%1$d) โ–ด + ํ™ˆ / Guide + ๋’ค๋กœ ยท ํ•œ ๋ฒˆ ํƒญ + ๋’ค๋กœ ยท ๋‘ ๋ฒˆ ํƒญ + ๋’ค๋กœ ยท Steam์—์„œ๋Š” ๋‘ ๋ฒˆ, ๋ฐ์Šคํฌํ†ฑ์—์„œ๋Š” ํ•œ ๋ฒˆ + Steam ๋ชจ๋“œ์—์„œ. ๋’ค๋กœ๋ฅผ ๊ธธ๊ฒŒ ๋ˆ„๋ฅด๋ฉด ๋น ๋ฅธ ์•ก์„ธ์Šค๋„ ์—ด๋ฆฝ๋‹ˆ๋‹ค. + ๊ธฐ๋ณธ๊ฐ’์œผ๋กœ ๋ณต์› + ํŒจ๋„ ์„ ํƒ์ด ๊ธฐ์–ต๋ฉ๋‹ˆ๋‹ค. ๋ฐ์Šคํฌํ†ฑ์€ ๋‘ ๋ฒˆ์งธ ์ž‘์—… ๊ณต๊ฐ„์„ ์—ด ๋ฟ ์„ธ์…˜์ด๋‚˜ ์ž…๋ ฅ ํ”„๋กœํ•„์„ ์ „ํ™˜ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. + ๊ฐ€์ƒ ์ปจํŠธ๋กค๋Ÿฌ + Steam ๋˜๋Š” ๊ฒŒ์ž„์ด ์ธ์‹ํ•˜๋Š” ์ปจํŠธ๋กค๋Ÿฌ ์œ ํ˜•์ž…๋‹ˆ๋‹ค. + ํ„ฐ์น˜์Šคํฌ๋ฆฐ + ๊ฒŒ์ž„ ํ™”๋ฉด์˜ ํ„ฐ์น˜ ์ฒ˜๋ฆฌ ๋ฐฉ์‹์ž…๋‹ˆ๋‹ค. ํ”„๋กœํ•„ ๋ฒ„ํŠผ์€ ์ง€์ •๋œ ๋™์ž‘์„ ์œ ์ง€ํ•ฉ๋‹ˆ๋‹ค. + ํ„ฐ์น˜ ์ปค์„œ + ๊ฒŒ์ž„ ํ™”๋ฉด์˜ ์ง์ ‘ ํ„ฐ์น˜์— ํฌ์ธํ„ฐ๋ฅผ ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค. + ํ„ฐ์น˜ ํ›„ ์œ ์ง€ + ๊ฒŒ์ž„ ํ™”๋ฉด์—์„œ ์†๊ฐ€๋ฝ์„ ๋ˆ„๋ฅด๊ณ  ์žˆ์„ ๋•Œ์˜ ๋งˆ์šฐ์Šค ๋™์ž‘์ž…๋‹ˆ๋‹ค. + ๋’ค๋กœ ๋ฒ„ํŠผ ํƒญ + ์ฒซ ๋ฒˆ์งธ ๋™์ž‘: ํ•œ ๋ฒˆ ํƒญ. ๋‘ ๋ฒˆ์งธ ๋™์ž‘: ๋‘ ๋ฒˆ ํƒญ. + ํ† ๊ธ€ ๋ฒ„ํŠผ + ํƒญํ•˜์—ฌ ์œ ์ง€, ๋‹ค์‹œ ํƒญํ•˜์—ฌ ํ•ด์ œ. ๋ฉ”๋‰ด๋ฅผ ์—ด๊ฑฐ๋‚˜ ํ”„๋กœํ•„์„ ์ „ํ™˜ํ•˜๋ฉด ๋ฒ„ํŠผ์ด ํ•ด์ œ๋ฉ๋‹ˆ๋‹ค. + ๋ชจ์–‘ + ๋‘ฅ๊ทผ ๋ชจ์„œ๋ฆฌ + ์•Œ์•ฝ + ์› + ์‚ฌ๊ฐํ˜• + ๋ฒ„ํŠผ ๋ผ๋ฒจ + ํ…์ŠคํŠธ + ๊ฐ€์ ธ์˜จ ์ด๋ฏธ์ง€ + ๊ฐœ๋ณ„ ๋Œ€๊ฐ์„  ํ‚ค + ๊ฐ ๋Œ€๊ฐ์„ ์— ํ‚ค๋ฅผ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค. ๋น„์–ด ์žˆ๋Š” ๋Œ€๊ฐ์„ ์€ ์ธ์ ‘ํ•œ ๋‘ ๋ฐฉํ–ฅ์„ ๋ˆ„๋ฆ…๋‹ˆ๋‹ค. + ์ธ์ ‘ ๋ฐฉํ–ฅ + ์ด์ „ ํ™”๋ฉด ํ‚ค๋Š” ์•„๋ž˜์— ๊ฐ€์ ธ์˜จ ํ”„๋กœํ•„๋กœ ์ €์žฅ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. ํ•˜๋‚˜๋ฅผ ์„ ํƒํ•ด ์‚ฌ์šฉํ•˜๊ฑฐ๋‚˜ ํŽธ์ง‘ํ•˜์„ธ์š”. ํ˜„์žฌ ํ”„๋กœํ•„ ์„ ํƒ์€ ์œ ์ง€๋ฉ๋‹ˆ๋‹ค. + ์ด์ „ ํ™”๋ฉด ํ‚ค๋ฅผ ์ž๋™์œผ๋กœ ๊ฐ€์ ธ์˜ฌ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. ์›๋ž˜ ์„ค์ •์ด ์œ ์ง€๋˜์—ˆ์Šต๋‹ˆ๋‹ค. + diff --git a/app/src/main/res/values-ko/input_strings.xml b/app/src/main/res/values-ko/input_strings.xml new file mode 100644 index 0000000000..b38fa335b5 --- /dev/null +++ b/app/src/main/res/values-ko/input_strings.xml @@ -0,0 +1,38 @@ + + + ์ž…๋ ฅ ํ”„๋กœํ•„ + ํ”„๋กœํ•„ + ๋ฌผ๋ฆฌ ์ปจํŠธ๋กค๋Ÿฌ + ๊ธฐ๋ณธ ํ™”๋ฉด + ๋ณด์กฐ ํ™”๋ฉด + ๋„ค์ดํ‹ฐ๋ธŒ / Steam Input + ๋„ค์ดํ‹ฐ๋ธŒ: %1$s + ๋‹ค๋ฅธ ์ปจํŠธ๋กค๋Ÿฌ ์ž…๋ ฅ ๋ณด๋‚ด๊ธฐ + ์‚ฌ์šฉ ์•ˆ ํ•จ + ํ‚ค ๋˜๋Š” ํ‚ค ์กฐํ•ฉ + ๋ฐฉํ–ฅ ํ‚ค + ํฌ์ธํ„ฐ ์ด๋™ + ํฌ์ธํ„ฐ ์†๋„: %1$d + ์Šคํฌ๋กค + ์„ธ๋กœ๋กœ ์Šคํฌ๋กค + ๋งˆ์šฐ์Šค ์™ผ์ชฝ ๋ฒ„ํŠผ + ๋งˆ์šฐ์Šค ์˜ค๋ฅธ์ชฝ ๋ฒ„ํŠผ + ๋งˆ์šฐ์Šค ๊ฐ€์šด๋ฐ ๋ฒ„ํŠผ + DroidDeck ๋ฉ”๋‰ด ์—ด๊ธฐ + ํ‚ค๋ณด๋“œ ํ‘œ์‹œ + Steam ๋ฉ”๋‰ด ์—ด๊ธฐ + Steam ๋น ๋ฅธ ์•ก์„ธ์Šค ์—ด๊ธฐ + ์ปจํŠธ๋กค ์ œ๊ฑฐ + ์ปจํŠธ๋กค ์ถ”๊ฐ€ + ๊ธฐ๊ธฐ๋ณ„ ๋ฒ„ํŠผ + ๋ฌผ๋ฆฌ ๋ฒ„ํŠผ ์ง€์ • + ๋ฒ„ํŠผ์„ ๋†“์€ ๋‹ค์Œ ํŽธ์ง‘, ๋‹ค์‹œ ์‹œ๋„ ๋˜๋Š” ์ทจ์†Œ๋ฅผ ์„ ํƒํ•˜์„ธ์š”. B ๋˜๋Š” ๋’ค๋กœ๋Š” ๋†“์€ ํ›„ ์ทจ์†Œํ•ฉ๋‹ˆ๋‹ค. + ๋‹ค์‹œ ์‹œ๋„ + ๋ฒ„ํŠผ์„ ๋ˆ„๋ฅด์„ธ์š”. ํ‚ค๋ณด๋“œ ํ‚ค๋กœ ๋ณด๊ณ ๋˜๋Š” ๋’ค๋กœ ๋ฒ„ํŠผ๋„ ํฌํ•จ๋ฉ๋‹ˆ๋‹ค. ๋ณผ๋ฅจ ๋ฐ Android ์‹œ์Šคํ…œ ํ‚ค๋Š” ์˜ˆ์•ฝ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. ์ง€์ •์€ ์ด ๊ธฐ๊ธฐ์—๋งŒ ์ ์šฉ๋ฉ๋‹ˆ๋‹ค. + ์ง€์ • ์ œ๊ฑฐ + ์ž…๋ ฅ ์ง„๋‹จ + ์ž…๋ ฅ ์ „๋‹ฌ ์‹œ๊ฐ„ ๊ธฐ๋ก + ์ธก์ •๊ฐ’ ์ฝ๊ธฐ + Android ์ „๋‹ฌ๋ถ€ํ„ฐ ๊ธฐ์กด ์ž…๋ ฅ ์ „์†ก์œผ๋กœ์˜ ๊ฒŒ์‹œ๊นŒ์ง€ ์ธก์ •ํ•ฉ๋‹ˆ๋‹ค. Bluetooth ๋„์ฐฉ, ๊ฒŒ์ŠคํŠธ ํด๋ง, ๋ Œ๋”๋ง ๋ฐ ๋””์Šคํ”Œ๋ ˆ์ด ์ง€์—ฐ์€ ํฌํ•จ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ๊ธฐ๋ก์€ ๊ธฐ๋ณธ์ ์œผ๋กœ ๊บผ์ ธ ์žˆ์Šต๋‹ˆ๋‹ค. + ์ผ๋ฐ˜ ์ž…๋ ฅ ์ง€์ • ์‚ฌ์šฉ + diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml index 457511bbde..048dced14f 100644 --- a/app/src/main/res/values-ko/strings.xml +++ b/app/src/main/res/values-ko/strings.xml @@ -28,6 +28,8 @@ ์ง€๊ธˆ ์ผ์‹œ ์ค‘์ง€ ์„ธ์…˜ ์ข…๋ฃŒ ํ”„๋ ˆ์ž„ ์ƒ์„ฑ + ์ด ๊ฒŒ์ž„์˜ ์„ค์ • + ๊ธฐ๋ณธ ์„ค์ • ์‚ฌ์šฉํ•  ํ”„๋ ˆ์ž„ ์ƒ์„ฑ ๋ชจ๋“œ๋ฅผ ์„ ํƒํ•˜์„ธ์š” ๋” DD-FG %1$dร— @@ -183,6 +185,7 @@ PowerVR ๊ทธ๋ž˜ํ”ฝ ํ™˜๊ฒฝ์„ ๋‹ค์šด๋กœ๋“œํ•˜์ง€ ๋ชปํ–ˆ์Šต๋‹ˆ๋‹ค. ์—ฐ๊ฒฐ์„ ํ™•์ธํ•˜๊ณ  ๋‹ค์‹œ ์‹œ๋„ํ•˜์„ธ์š”. DirectAudio๋ฅผ ๋‹ค์šด๋กœ๋“œํ•  ์ˆ˜ ์—†์–ด ์ด๋ฒˆ ์„ธ์…˜์—์„œ๋Š” ๊ฒŒ์ž„ ์˜ค๋””์˜ค๊ฐ€ ๋” ๋А๋ฆฐ ๊ฒฝ๋กœ๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. ์ด ํ”„๋กœ๊ทธ๋žจ + ์„ธ์…˜์ด ํ™”๋ฉด์„ ๊ทธ๋ฆฌ์ง€ ๋ชปํ–ˆ์Šต๋‹ˆ๋‹ค: %1$s. ๊ฒ€์€ ํ™”๋ฉด ๋Œ€์‹  ์ด ํ™”๋ฉด์— ์ด์œ ๋ฅผ ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ ์„ธ์…˜ ๋กœ๊ทธ์— ์žˆ์Šต๋‹ˆ๋‹ค. Steam ํด๋ผ์ด์–ธํŠธ๋ฅผ ๋‹ค์šด๋กœ๋“œํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. ๋„คํŠธ์›Œํฌ๋‚˜ VPN์ด Steam ์„œ๋ฒ„๋ฅผ ์ฐจ๋‹จํ•˜๊ณ  ์žˆ์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์—ฐ๊ฒฐ์„ ํ™•์ธํ•˜๊ณ  ๋‹ค์‹œ ์‹œ๋„ํ•˜์„ธ์š”. Steam ํด๋ผ์ด์–ธํŠธ๋ฅผ ์„ค์ •ํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. ์—ฐ๊ฒฐ๊ณผ ๋‚จ์€ ์ €์žฅ ๊ณต๊ฐ„์„ ํ™•์ธํ•œ ๋’ค ๋‹ค์‹œ ์‹œ๋„ํ•˜์„ธ์š”. %1$s์€(๋Š”) x86 PC์šฉ์œผ๋กœ ๋นŒ๋“œ๋˜์–ด FEX๋ฅผ ํ†ตํ•ด ์‹คํ–‰๋˜์ง€๋งŒ, FEX๊ฐ€ ์•„์ง ์„ค์น˜๋˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค. ๋กœ๊ทธ์ธํ•œ ์ƒํƒœ๋กœ Steam์„ ํ•œ ๋ฒˆ ์‹œ์ž‘ํ•˜์—ฌ FEX์™€ Steam Linux Runtime์„ ๋‹ค์šด๋กœ๋“œํ•œ ํ›„ ๋‹ค์‹œ ์‹œ์ž‘ํ•˜์„ธ์š”. @@ -384,6 +387,9 @@ ์•„์ง ์—ฌ๊ธฐ์„œ ์ง€์›๋˜์ง€ ์•Š์Œ ๊ตฌ์„ฑ ์š”์†Œ๋ฅผ ๋ถˆ๋Ÿฌ์˜ค๋Š” ์ค‘โ€ฆ ์„ค์น˜ํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค: %1$s + ์ด ๋‹ค์šด๋กœ๋“œ๋Š” ์—…๋ฐ์ดํŠธ๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. + ์—…๋ฐ์ดํŠธ๊ฐ€ ๋Œ€๊ธฐ ์ค‘์ž…๋‹ˆ๋‹ค. + ์—…๋ฐ์ดํŠธ ๋‹ค์‹œ ์‹œ๋„ ๋‹ค์šด๋กœ๋“œ๋จ %1$s ๋‹ค์šด๋กœ๋“œ ์ค‘ ์„ค์น˜ ์ค‘: %1$s @@ -414,6 +420,22 @@ ๋‚ด๋ถ€ ์ €์žฅ ๊ณต๊ฐ„๋งŒ ํด๋”: %1$s ๋ณด์กฐ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ + ์ถ”๊ฐ€ Steam ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ + Steam์ด ๊ฒŒ์ž„์„ ์„ค์น˜ํ•˜๊ณ  ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ๋Š” ํด๋”์ด๋ฉฐ, ๊ฐ๊ฐ ๊ณ ์œ ํ•œ ์ด๋ฆ„์ด ์ง€์ •๋ฉ๋‹ˆ๋‹ค. ์‚ญ์ œํ•ด๋„ ๊ฒŒ์ž„์€ ๋””์Šคํฌ์— ๋‚จ์Šต๋‹ˆ๋‹ค. + ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์ถ”๊ฐ€ + ์ด๋ฆ„ ๋ณ€๊ฒฝ + ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์ด๋ฆ„ + ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋กœ ์‚ฌ์šฉํ•  ํด๋” ์„ ํƒ + ์ถ”๊ฐ€ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋Š” ์ตœ๋Œ€ %1$d๊ฐœ์ž…๋‹ˆ๋‹ค. + ํ•ด๋‹น ํด๋”๋Š” ์ด๋ฏธ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์ด๊ฑฐ๋‚˜ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์•ˆ์— ์žˆ์Šต๋‹ˆ๋‹ค + %1$s ยท ์‚ฌ์šฉํ•  ์ˆ˜ ์—†์Œ + ๋‹ค์Œ Steam ์„ธ์…˜๋ถ€ํ„ฐ ์ ์šฉ๋ฉ๋‹ˆ๋‹ค + ์ด ๊ธฐ๊ธฐ์—์„œ ์ฐพ์Œ ยท %1$s ยท %2$s + ์ถ”๊ฐ€ + ๋‚ด๋ถ€ ์ €์žฅ์†Œ์—์„œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์ฐพ๊ธฐ + ๋ชจ๋“  ํŒŒ์ผ ์ ‘๊ทผ์„ ํ—ˆ์šฉํ•˜๋ฉด DroidDeck์ด ๋‚ด๋ถ€ ์ €์žฅ์†Œ์— ์žˆ๋Š” ๋‹ค๋ฅธ ์•ฑ์˜ Steam ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. + ํ—ˆ์šฉ + ์„ ํƒํ•œ ํด๋” ์•ˆ์˜ Steam ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ %1$s๋ฅผ ์ถ”๊ฐ€ํ–ˆ์Šต๋‹ˆ๋‹ค. SD ์นด๋“œ๋‚˜ ๊ณต์œ  ์ €์žฅ ๊ณต๊ฐ„์—์„œ ๋ฆฌ์†Œ์Šค๋ฅผ ์ฝ๋Š” ๊ฒŒ์ž„์€ ๋Š๊ธธ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ €์žฅ ๊ณต๊ฐ„ ์ง„๋‹จ ํ• ๋‹น ๊ฒฐ๊ณผ์™€ ์ƒ˜ํ”Œ๋งํ•œ ์ €์žฅ ๊ณต๊ฐ„ ์‘๋‹ต ์‹œ๊ฐ„์„ \"๋กœ๊ทธ ๊ณต์œ \"์— ๊ธฐ๋กํ•ฉ๋‹ˆ๋‹ค. ์ผœ์ ธ ์žˆ๋Š” ๋™์•ˆ ์„ค์น˜๊ฐ€ ๋А๋ ค์งˆ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋‹ค์Œ ์„ธ์…˜์— ์ ์šฉ๋ฉ๋‹ˆ๋‹ค. @@ -476,6 +498,7 @@ ์ผœ์ง Steam๊ณผ ํ•จ๊ป˜ ์‹œ์ž‘ Steam ์—†์ด ์‹œ์ž‘ + ๊ฒŒ์ž„ ํ•ด์ƒ๋„ ์„ค์ • %1$s ์„ค์ • ๊ธฐ๋ณธ๊ฐ’ @@ -563,6 +586,8 @@ ๊ฒŒ์ž„ ์ฝ”์–ด ๊ฒŒ์ž„ ์ฝ”์–ด ๊ฒŒ์ž„์—์„œ ์‚ฌ์šฉํ•˜๋Š” ์ฝ”์–ด์ž…๋‹ˆ๋‹ค. ๋ชจ๋‘ ์„ ํƒํ•˜๋ฉด Android๊ฐ€ ์ž์œ ๋กญ๊ฒŒ ์Šค์ผ€์ค„๋งํ•ฉ๋‹ˆ๋‹ค. + ์•ˆ์ •์ ์ธ ๊ฒŒ์ž„์—์„œ ์ „๋ ฅ ์ ˆ์•ฝ + ๊ฒŒ์ž„์ด ์•ˆ์ •์ ์ธ ํ”„๋ ˆ์ž„ ๋ ˆ์ดํŠธ๋ฅผ ์œ ์ง€ํ•˜๋Š” ๋™์•ˆ ๋А๋ฆฐ ์ฝ”์–ด์—์„œ ์‹คํ–‰ํ•˜๊ณ , ๋’ค์ฒ˜์ง€๋ฉด ์›๋ž˜ ์ฝ”์–ด๋กœ ๋˜๋Œ๋ฆฝ๋‹ˆ๋‹ค. ํด๋ผ์ด์–ธํŠธ UI GL ๋ฉ€ํ‹ฐ์Šค๋ ˆ๋”ฉ Steam ๋ฉ”๋‰ด ์‘๋‹ต ์†๋„๋ฅผ ๋†’์ผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. @@ -598,7 +623,10 @@ ๋ชจ๋“  ๊ฒŒ์ž„์—์„œ CPU๋ฅผ ์‚ฌ์šฉํ•˜๋Š” Proton์˜ ์ปจํŠธ๋กค๋Ÿฌ ํƒ์ƒ‰ ๋„์šฐ๋ฏธ๋ฅผ ๋น„ํ™œ์„ฑํ™”ํ•ฉ๋‹ˆ๋‹ค. seccomp ์—†์ด proot ์‹คํ–‰ ์ผ๋ถ€ ์ปค๋„์—์„œ ์‹œ์Šคํ…œ ํ˜ธ์ถœ ๋ˆ„๋ฝ ์˜ค๋ฅ˜๋ฅผ ์ˆ˜์ •ํ•  ์ˆ˜ ์žˆ์ง€๋งŒ ์„ฑ๋Šฅ์ด ์ €ํ•˜๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. + proot ์—†์ด ์‹คํ–‰ (์‹คํ—˜์ ) + Linux ํ™˜๊ฒฝ์„ Android์—์„œ ์ง์ ‘ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค. ๋‹ค์Œ ์„ธ์…˜๋ถ€ํ„ฐ ์ ์šฉ๋ฉ๋‹ˆ๋‹ค. ์‹œ์ž‘์— ์‹คํŒจํ•˜๋ฉด ๋„์„ธ์š”. proot ๋น ๋ฅธ ๊ฒฝ๋กœ + proot ์—†์ด๋Š” ์‚ฌ์šฉ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. proot์˜ seccomp ํ•„ํ„ฐ๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. ํŒŒ์ผ ๊ฒ€์ƒ‰์ด ๋นจ๋ผ์ง€๊ณ  ๋Š๊น€์ด ์ค„์–ด๋“ญ๋‹ˆ๋‹ค. ํ”„๋กœ๊ทธ๋žจ์ด ํŒŒ์ผ์„ ์ฐพ์ง€ ๋ชปํ•˜๋ฉด ์ด ์˜ต์…˜์„ ๋„์„ธ์š”. gamescope ์•ˆ์—์„œ ์ปค์„œ ๊ทธ๋ฆฌ๊ธฐ @@ -681,6 +709,7 @@ ๊ทธ๋ž˜ํ”ฝ ๋ฉ”๋ชจ๋ฆฌ ์Šค์™‘ ๋ฐฐํ„ฐ๋ฆฌ ์ž”๋Ÿ‰ + ๋‚จ์€ ๋ฐฐํ„ฐ๋ฆฌ ์‚ฌ์šฉ ์‹œ๊ฐ„ ์†Œ๋น„ ์ „๋ ฅ ๋„คํŠธ์›Œํฌ ํ•ด์ƒ๋„ @@ -806,6 +835,7 @@ ๊ธฐ๊ธฐ ์ง€์›๋จ ํ…Œ์ŠคํŠธ๋˜์ง€ ์•Š์€ GPU GPU ์ง€์›๋˜์ง€ ์•Š์Œ + Mali ๋ธŒ๋ฆฌ์ง€๋ฅผ ํ†ตํ•œ GPU %1$s ยท %2$s %1$s: %2$s ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” ํ˜ธํ™˜ ๊ทธ๋ž˜ํ”ฝ ๋ฐฑ์—”๋“œ๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค. %1$s์—์„œ ํ™”๋ฉด์ด ๊ฒ€๊ฒŒ ํ‘œ์‹œ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. @@ -835,15 +865,38 @@ ์„ธ์…˜ ์„ธ์…˜ ๋กœ๊ทธ ๊ฐ ์„ธ์…˜ ์ข…๋ฃŒ ํ›„ ์ €์žฅ + ๋‹ค์Œ ์„ธ์…˜์šฉ ๊ฐ•ํ™” ์ง„๋‹จ + ํ•œ ์„ธ์…˜ ๋™์•ˆ ์ƒ์„ธ ๋กœ๊ทธ๋ฅผ ์ˆ˜์ง‘ํ•ฉ๋‹ˆ๋‹ค. ์„ฑ๋Šฅ์ด ์ €ํ•˜๋˜๊ฑฐ๋‚˜ ์ €์žฅ ๊ณต๊ฐ„์„ ๋” ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์„ธ์…˜์ด ์‹œ์ž‘๋˜๋ฉด ์ž๋™์œผ๋กœ ๊บผ์ง€๋ฉฐ, ๊ณต์œ ํ•˜๊ธฐ ์ „์— ๋กœ๊ทธ๋ฅผ ํ™•์ธํ•˜์„ธ์š”. ๊ฒŒ์ž„ ๋””๋ฒ„๊ทธ ๋กœ๊ทธ ๋‹ค์Œ ๊ฒŒ์ž„ ์‹คํ–‰ ์‹œ Proton, Wine ๋ฐ ๊ทธ๋ž˜ํ”ฝ ์ง„๋‹จ ์ •๋ณด๋ฅผ ํฌํ•จํ•ฉ๋‹ˆ๋‹ค. ์„ฑ๋Šฅ์ด ์ €ํ•˜๋˜๊ณ  ์ €์žฅ ๊ณต๊ฐ„์„ ๋” ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ฒŒ์ž„ ๋””๋ฒ„๊ทธ ๋กœ๊ทธ๋ฅผ ์ €์žฅํ•˜๋ ค๋ฉด ์ด ์„ธ์…˜์„ ๋‹ค์‹œ ์‹œ์ž‘ํ•˜์„ธ์š” ๋กœ๊น…์„ ์—…๋ฐ์ดํŠธํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. ์Šค์œ„์น˜๋ฅผ ํ™•์ธํ•˜๊ณ  ๋‹ค์‹œ ์‹œ๋„ํ•˜์„ธ์š”. ๋””๋ฒ„๊น… ๋„๊ตฌ + ์ƒ์„ธ ๊ทธ๋ž˜ํ”ฝ ๋กœ๊ทธ + Steam ์ธํ„ฐํŽ˜์ด์Šค: GPU ๋ Œ๋”๋ง + Xclipse ๋“œ๋ผ์ด๋ฒ„ ์กฐํ•ฉ์—์„œ๋Š” Steam ํŽ˜์ด์ง€๋ฅผ ์†Œํ”„ํŠธ์›จ์–ด๋กœ ๊ทธ๋ฆฝ๋‹ˆ๋‹ค(GPU ๋ Œ๋”๋ง์—์„œ๋Š” ํƒ€์ผ์ด ๊นจ์ ธ ๋ณด์˜€์Šต๋‹ˆ๋‹ค). ์ด ๊ธฐ๊ธฐ์—์„œ ์ •์ƒ์ ์œผ๋กœ ๋ณด์ธ๋‹ค๋ฉด ๋” ๋น ๋ฅธ Steam ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ์œ„ํ•ด ์ผœ์„ธ์š”. + %1$s์— ๋นŒ๋“œ๋จ + %1$s์ด(๊ฐ€) ์ตœ์‹  ๋นŒ๋“œ๋กœ ์—…๋ฐ์ดํŠธ๋˜์—ˆ์Šต๋‹ˆ๋‹ค + ์ง€๋‚œ ์„ธ์…˜์—์„œ %1$s์˜ Mali ๋ธŒ๋ฆฌ์ง€ ์ž์ฒด ํ…Œ์ŠคํŠธ(์ด๋ฏธ์ง€ ๋˜๋Š” ๋“œ๋กœ์šฐ)๊ฐ€ ์‹คํŒจํ•ด PanVK ๋“œ๋ผ์ด๋ฒ„ ์Œ์„ ๋Œ€์‹  ์‚ฌ์šฉํ–ˆ์Šต๋‹ˆ๋‹ค. + ์ง€๋‚œ ์„ธ์…˜์—์„œ Mali ๋ธŒ๋ฆฌ์ง€๊ฐ€ %1$s์˜ ๋“œ๋ผ์ด๋ฒ„์™€ ๋ฉ”๋ชจ๋ฆฌ๋ฅผ ๊ณต์œ ํ•  ๋ฐฉ๋ฒ•์„ ์ฐพ์ง€ ๋ชปํ•ด PanVK ๋“œ๋ผ์ด๋ฒ„ ์Œ์„ ๋Œ€์‹  ์‚ฌ์šฉํ–ˆ์Šต๋‹ˆ๋‹ค. ์ด ํœด๋Œ€ํฐ์—์„œ๋Š” ๋ธŒ๋ฆฌ์ง€๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์—†์œผ๋ฉฐ, ๋„๋ฉด PanVK ์Œ์ด ์œ ์ง€๋ฉ๋‹ˆ๋‹ค. + ๊ฒŒ์ž„๋ณ„ Proton, DXVK ๋ฐ ๋“œ๋ผ์ด๋ฒ„ ๋กœ๊ทธ๊ฐ€ ์„ธ์…˜ ๋กœ๊ทธ์— ํฌํ•จ๋ฉ๋‹ˆ๋‹ค. GPU๊ฐ€ Adreno๊ฐ€ ์•„๋‹Œ ๊ฒฝ์šฐ ํ•ญ์ƒ ์ผœ์ง‘๋‹ˆ๋‹ค. ์ตœ์‹  ์„ธ์…˜ ๋กœ๊ทธ ์ €์žฅ๋œ ์„ธ์…˜ ๋กœ๊ทธ ์ตœ์‹  %1$d๊ฐœ ์œ ์ง€ ๋กœ๊ทธ ์ง€์šฐ๊ธฐ + ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ์„ธ์…˜ ๋กœ๊ทธ + ์ €์žฅ๋œ ์„ธ์…˜ ๋กœ๊ทธ๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค. + ๊ณต์œ ํ•˜๊ฑฐ๋‚˜ ์ €์žฅํ•œ ZIP์—๋Š” ์„ ํƒํ•œ ์„ธ์…˜๊ณผ ๊ด€๋ จ Steam, ์Šคํ† ์–ด, ๋„๊ตฌ, Battle.net ์ง„๋‹จ ์ •๋ณด๊ฐ€ ํฌํ•จ๋ฉ๋‹ˆ๋‹ค. + %1$s ยท %2$s + ํ˜„์žฌ ์„ธ์…˜ + ๊ณต์œ  + ๊ธฐ๊ธฐ์— ์ €์žฅ + ์‚ญ์ œ + ์„ธ์…˜ ๋กœ๊ทธ๋ฅผ ์‚ญ์ œํ•˜์‹œ๊ฒ ์Šต๋‹ˆ๊นŒ? + %1$s์„(๋ฅผ) ์‚ญ์ œํ•˜์‹œ๊ฒ ์Šต๋‹ˆ๊นŒ? ๋˜๋Œ๋ฆด ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. + ์„ธ์…˜ ๋กœ๊ทธ๋ฅผ ์ €์žฅํ–ˆ์Šต๋‹ˆ๋‹ค. + ์„ธ์…˜ ๋กœ๊ทธ๋ฅผ ์ €์žฅํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. + ์„ธ์…˜ ๋กœ๊ทธ๋ฅผ ์‚ญ์ œํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. ๋ชจ๋“  ์„ค์ • ์ดˆ๊ธฐํ™” ๋ชจ๋“  ์„ค์ •์„ ๊ธฐ๋ณธ๊ฐ’์œผ๋กœ ๋˜๋Œ๋ฆฝ๋‹ˆ๋‹ค ์ดˆ๊ธฐํ™” @@ -870,6 +923,8 @@ ํ™ˆ ํ™”๋ฉด์œผ๋กœ ์‚ฌ์šฉ DroidDeck์„ ํ™ˆ ์•ฑ์œผ๋กœ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค DroidDeck์€ ํ™ˆ ์•ฑ์œผ๋กœ ์ œ๊ณต๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค + ํ™ˆ ๋ฒ„ํŠผ์œผ๋กœ ์—ด ํŽ˜์ด์ง€ + DroidDeck์ด ํ™ˆ ์•ฑ์ผ ๋•Œ ํ™ˆ ๋ฒ„ํŠผ์„ ๋ˆ„๋ฅด๋ฉด ํ‘œ์‹œ๋˜๋Š” ํŽ˜์ด์ง€ ๊ฒŒ์ž„ ์ถ”๊ฐ€์—์„œ DroidDeck์„ ํฌํ•จ์œผ๋กœ ์„ค์ •ํ•˜์„ธ์š” ํ™”๋ฉด ๋ฐฉํ–ฅ ๋Ÿฐ์ฒ˜ ๋ฐฉํ–ฅ @@ -883,15 +938,22 @@ ์ „์ฒด ํ™”๋ฉด Android ์ƒํƒœ ํ‘œ์‹œ์ค„ ๋ฐ ํƒ์ƒ‰ ํ‘œ์‹œ์ค„ ์ˆจ๊ธฐ๊ธฐ Android ์ƒํƒœ ํ‘œ์‹œ์ค„ ๋ฐ ํƒ์ƒ‰ ํ‘œ์‹œ์ค„ ํ‘œ์‹œ + ๋“€์–ผ ํ™”๋ฉด ๋Ÿฐ์ฒ˜ + ์ž๋™์€ ๋‚ด์žฅ ๋‘ ๋ฒˆ์งธ ํ™”๋ฉด์ด ์žˆ๋Š” ํœด๋Œ€์šฉ ๊ธฐ๊ธฐ์—์„œ ๋Ÿฐ์ฒ˜ ์„น์…˜(Steam, ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ, ์Šคํ† ์–ด ๋“ฑ)์„ ๋‘ ๋ฒˆ์งธ ํ™”๋ฉด์— ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค. ์ผœ๊ธฐ๋Š” ์–ด๋–ค ๋‘ ๋ฒˆ์งธ ๋””์Šคํ”Œ๋ ˆ์ด๋“  ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. ๋„๊ธฐ๋Š” ๋Ÿฐ์ฒ˜๋ฅผ ํ•œ ํ™”๋ฉด์— ์œ ์ง€ํ•ฉ๋‹ˆ๋‹ค. + ๋“€์–ผ ํ™”๋ฉด ์„ธ์…˜ + ์ž๋™์€ ํŒ์˜ค๋ฒ„ ๋Œ€์‹  ๊ฒŒ์ž„ ๋‚ด ๋ฉ”๋‰ด๋ฅผ ๋‚ด์žฅ ๋‘ ๋ฒˆ์งธ ํ™”๋ฉด์— ๊ณ ์ •ํ•ฉ๋‹ˆ๋‹ค. ์ผœ๊ธฐ๋Š” ์–ด๋–ค ๋‘ ๋ฒˆ์งธ ๋””์Šคํ”Œ๋ ˆ์ด๋“  ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. ๋„๊ธฐ๋Š” ๋ฉ”๋‰ด๋ฅผ ๊ฒŒ์ž„ ํ™”๋ฉด์— ์œ ์ง€ํ•˜์ง€๋งŒ, ๋ฉ”๋‰ด์—์„œ ๋‘ ๋ฒˆ์งธ ํ™”๋ฉด์„ ์„ ํƒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ž๋™ ์ผœ๊ธฐ ๋„๊ธฐ ๊ฒŒ์ž„ ์ค‘ ํ•˜๋‹จ ํ™”๋ฉด ์ปจํŠธ๋กค + ํ…์ŠคํŠธ ์ž…๋ ฅ๋ž€์— Android ํ‚ค๋ณด๋“œ ์‚ฌ์šฉ ์„ธ์…˜์ด ์‹œ์ž‘๋˜๋ฉด ๋‘ ๋ฒˆ์งธ ํ™”๋ฉด์— ํŠธ๋ž™ํŒจ๋“œ์™€ ํ‚ค๋ณด๋“œ๋ฅผ ์—ฝ๋‹ˆ๋‹ค. ์ƒ๋‹จ ํ™”๋ฉด์— ์ž…๋ ฅ ์ค‘ ์™„๋ฃŒ ๊ธฐ๋ณธ ํ™ˆ ์•ฑ ํ™ˆ ์•ฑ ์„ ํƒ + ๋Œ€๊ธฐ ์ค‘์ผ ๋•Œ ์ตœ๊ทผ ์•ฑ ๋ชฉ๋ก์—์„œ ๋Ÿฐ์ฒ˜ ์ˆจ๊ธฐ๊ธฐ + DroidDeck์ด ๊ธฐ๋ณธ ํ™ˆ ์•ฑ์ด๊ณ  ์‹คํ–‰ ์ค‘์ธ ์„ธ์…˜์ด ์—†์„ ๋•Œ๋งŒ ์ ์šฉ๋ฉ๋‹ˆ๋‹ค. ์„ ํƒ Linux ์•ฑ(๋ฒ ํƒ€) ํŒŒ์ผ @@ -1003,9 +1065,172 @@ ๋ฏธ๋ฆฌ๋ณด๊ธฐ ์•ˆ์ •ํŒ๋ณด๋‹ค ๋จผ์ € ๋ฐ›๋Š” ์ตœ์‹  ์ˆ˜์ • ์‚ฌํ•ญ ์ตœ์‹  ๋ฒ„์ „ + ๋นŒ๋“œ ์ •๋ณด ๋ณต์‚ฌ + ๋นŒ๋“œ ์ •๋ณด๋ฅผ ๋ณต์‚ฌํ–ˆ์Šต๋‹ˆ๋‹ค + ๋ฏธ๋ฆฌ๋ณด๊ธฐ๋ณด๋‹ค ์ตœ์‹  + ๋ฏธ๋ฆฌ๋ณด๊ธฐ๋ณด๋‹ค ์•ž์„œ ์žˆ์Šต๋‹ˆ๋‹ค + ์ด ๋นŒ๋“œ๋Š” ์ตœ์‹  ๋ฏธ๋ฆฌ๋ณด๊ธฐ๋ณด๋‹ค ์ƒˆ๋กญ์Šต๋‹ˆ๋‹ค. ๋‹ค์Œ ๋ฏธ๋ฆฌ๋ณด๊ธฐ ๋นŒ๋“œ๊ฐ€ ์—…๋ฐ์ดํŠธํ•ฉ๋‹ˆ๋‹ค. + ๋นŒ๋“œ๋ฅผ ์„ ํƒํ•ด ๋ณ€๊ฒฝ ์‚ฌํ•ญ์„ ๋ณด๊ฑฐ๋‚˜ ์„ค์น˜ํ•˜์„ธ์š”. + ์„ค์น˜๋จ + ์ด ๋นŒ๋“œ ์„ค์น˜%1$s + ์ด ๋นŒ๋“œ๋กœ ๋˜๋Œ๋ฆฌ๊ธฐ%1$s + versionCode %1$d + ์ปค๋ฐ‹ %1$s + ๋ฆด๋ฆฌ์Šค ํŽ˜์ด์ง€ + ์ด PR์— ๋” ์ƒˆ๋กœ์šด ์ปค๋ฐ‹(%1$s)์ด ์žˆ์Šต๋‹ˆ๋‹ค. ํ•ด๋‹น ํ…Œ์ŠคํŠธ ๋นŒ๋“œ๊ฐ€ ์•„์ง ์ค€๋น„๋˜์ง€ ์•Š์•„ ์ด ๋นŒ๋“œ์—๋Š” ํฌํ•จ๋˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค. + ์ƒˆ ์ปค๋ฐ‹ ์žˆ์Œ, ๋นŒ๋“œ ๋Œ€๊ธฐ ์ค‘ + PR ๋ฒˆํ˜ธ, ์ œ๋ชฉ ๋˜๋Š” ์ž‘์„ฑ์ž + ์ผ์น˜ํ•˜๋Š” ํ…Œ์ŠคํŠธ ๋นŒ๋“œ๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค + ๋‹ค์‹œ ๋นŒ๋“œ ํ•„์š” (versionCode %1$d) + ํ…Œ์ŠคํŠธ ๋นŒ๋“œ ์—…๋ฐ์ดํŠธ + PR #%1$d ์ƒˆ ํ…Œ์ŠคํŠธ ๋นŒ๋“œ + %1$s. ์—…๋ฐ์ดํŠธ๋ฅผ ์—ด์–ด ์„ค์น˜ํ•˜์„ธ์š”. + ๋” ๋ณด๊ธฐ (%1$d) + versionCode %2$d์šฉ์œผ๋กœ ๋‹ค์‹œ ๋นŒ๋“œ ํ•„์š” (%1$d) + ์ด ํ…Œ์ŠคํŠธ ๋นŒ๋“œ ์ดํ›„ main์˜ ๋ฏธ๋ฆฌ๋ณด๊ธฐ ๋นŒ๋“œ: %1$d ํ…Œ์ŠคํŠธ ๋นŒ๋“œ ์ •์‹ ์ถœ์‹œ ์ „์— ํŠน์ • ์ˆ˜์ • ์‚ฌํ•ญ์„ ์‹œํ—˜ํ•ด ๋ณด๊ธฐ ํ˜„์žฌ ์—†์Œ + Lab ๋นŒ๋“œ + Lab ๋นŒ๋“œ + ์‚ฌ์šฉ ์ค‘ + Android๊ฐ€ DroidDeck์„ ๋‹ค์‹œ ์ตœ์ ํ™”ํ•œ ํ›„ ์ผ์‹œ ์ค‘์ง€๋จ + ๋กœ๋“œ๋˜์ง€ ์•Š์Œ: %1$s + ์žฌ์‹œ์ž‘ ๋Œ€๊ธฐ ์ค‘ + ์œ ์ง€๋จ + ๋‹ค๋ฅธ ๋ฒ„์ „์šฉ + ์žฌ๋นŒ๋“œ + ๊ธฐ๊ธฐ์—์„œ ์ด ๋นŒ๋“œ๋ฅผ ์‚ญ์ œํ•ฉ๋‹ˆ๋‹ค + ์ด ๋นŒ๋“œ๋กœ ์žฌ์‹œ์ž‘ + ๋„๊ธฐ + ์‚ฌ์šฉ + ์‚ญ์ œ + ์ง€๊ธˆ ์‚ญ์ œ + ์žฌ์‹œ์ž‘์„ ์ค€๋น„ํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค: %1$s. ์„ค์ •์—์„œ ๋ฌด์„  ๋””๋ฒ„๊น…์„ ํŽ˜์–ด๋งํ•œ ํ›„ ๋‹ค์‹œ ์‹œ๋„ํ•˜์„ธ์š”. + Lab ๋นŒ๋“œ ์„ค์น˜๋จ + DroidDeck์ด %1$s๋กœ ์žฌ์‹œ์ž‘๋˜์—ˆ์Šต๋‹ˆ๋‹ค + Lab ๋นŒ๋“œ ์ผ์‹œ ์ค‘์ง€ + Android๊ฐ€ DroidDeck์„ ๋‹ค์‹œ ์ตœ์ ํ™”ํ•ด %1$s์ด(๊ฐ€) ๋กœ๋“œ๋˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค. ์—…๋ฐ์ดํŠธ๋ฅผ ์—ด์–ด ์ด ๋นŒ๋“œ๋กœ ๋‹ค์‹œ ์‹œ์ž‘ํ•˜์„ธ์š”. + Lab ๋นŒ๋“œ ์‚ฌ์šฉ ์ค‘์ง€ + ๋‹ค๋ฅธ ๋ฒ„์ „์˜ DroidDeck์šฉ์œผ๋กœ ๋นŒ๋“œ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ์—…๋ฐ์ดํŠธ์— ๋ณด๊ด€๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. + ์ด ๋นŒ๋“œ๋กœ DroidDeck์„ ๋‘ ๋ฒˆ ์‹œ์ž‘ํ•˜์ง€ ๋ชปํ–ˆ์Šต๋‹ˆ๋‹ค. + ์—์ด์ „ํŠธ + ์—์ด์ „ํŠธ + ์—์ด์ „ํŠธ๊ฐ€ ์ž‘์—… ์ค‘์ž…๋‹ˆ๋‹ค + ์—์ด์ „ํŠธ๋ฅผ ์‚ฌ์šฉํ•˜๋ ค๋ฉด Linux ์‚ฌ์šฉ์ž ์˜์—ญ์— Claude Code๋ฅผ ์„ค์น˜ํ•˜์„ธ์š”. + ๊ฒŒ์ž„, ๋น„์ •์ƒ ์ข…๋ฃŒ ๋˜๋Š” DroidDeck ๋ณ€๊ฒฝ์— ๋Œ€ํ•ด ๋ฌผ์–ด๋ณด์„ธ์š” + ๋ณด๋‚ด๊ธฐ + ์ƒˆ ๋Œ€ํ™” + ์ค‘์ง€ + ์ €์žฅ ๊ณต๊ฐ„ + ์‚ญ์ œ + ์ง€๊ธˆ ์‚ญ์ œ + Claude Code + Codex + DroidDeck ์†Œ์Šค + ๋‹ค์šด๋กœ๋“œ ์บ์‹œ + ํ‘ธ์‹œํ•˜์ง€ ์•Š์€ ๋ณ€๊ฒฝ ์‚ฌํ•ญ์€ ์‚ฌ๋ผ์ง‘๋‹ˆ๋‹ค + ๋นŒ๋“œ ์‹œ ๋‹ค์‹œ ๋‹ค์šด๋กœ๋“œํ•ฉ๋‹ˆ๋‹ค + ์„ค์ •์—์„œ ๋‹ค์‹œ ์„ค์น˜ํ•  ์ˆ˜ ์žˆ์œผ๋ฉฐ ๋กœ๊ทธ์ธ ์ •๋ณด๋Š” ์œ ์ง€๋ฉ๋‹ˆ๋‹ค + DroidDeck์ด Lab ๋นŒ๋“œ๋กœ ๋‹ค์‹œ ์‹œ์ž‘๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ํ•˜๋˜ ์ž‘์—…์„ ๊ณ„์†ํ•˜์„ธ์š”. + ๊ฒŒ์ž„์ด ์‹œ์ž‘๋˜์ง€ ์•Š๋Š” ์ด์œ ๋ฅผ ๋ฌป๊ฑฐ๋‚˜, ๋กœ๊ทธ๋ฅผ ์„ค๋ช…ํ•ด ๋‹ฌ๋ผ๊ณ  ํ•˜๊ฑฐ๋‚˜, DroidDeck์„ ๋ณ€๊ฒฝํ•˜๊ณ  ์ด ๊ธฐ๊ธฐ์—์„œ ๊ทธ ๋ณ€๊ฒฝ์„ ์‹œํ—˜ํ•ด ๋ณด๋ผ๊ณ  ์š”์ฒญํ•˜์„ธ์š”. + ์‹คํŒจ: %1$s + %1$s ์ข…๋ฃŒ (์ฝ”๋“œ %2$d) + ์ค‘์ง€๋จ + ์‘๋‹ต ์—†์ด ์ข…๋ฃŒ๋จ + ๋‹ค์‹œ ์‹œ๋„ + ์—์ด์ „ํŠธ ์„ค์ • ์ค‘ + ์„ค์น˜๋œ DroidDeck ๋ฒ„์ „์— ๋งž๊ฒŒ ๋‚ด Lab ๋นŒ๋“œ %1$s๋ฅผ ๋‹ค์‹œ ๋นŒ๋“œํ•˜๊ณ  ๊ทธ ๋นŒ๋“œ๋กœ ๋‹ค์‹œ ์‹œ์ž‘ํ•ด ์ฃผ์„ธ์š”. + %1$s ์ž…๋ ฅ ยท %2$s ์ถœ๋ ฅ + ์ƒ๊ฐ ์ค‘ + ์ƒ๊ฐ + ์ƒ๊ฐ ์ค‘ ยท %1$s + %1$s ยท %2$s + ์ž…๋ ฅ + ์ถœ๋ ฅ + ์‹คํ–‰ ์ค‘โ€ฆ + ๊ฒฐ๊ณผ ์—†์Œ: ํ„ด์ด ๋จผ์ € ์ข…๋ฃŒ๋˜์—ˆ์Šต๋‹ˆ๋‹ค + ์ถœ๋ ฅ ์—†์Œ + ์ž…๋ ฅํ•˜๋ฉด ๋‹ค์Œ ๋ฉ”์‹œ์ง€๊ฐ€ ๋Œ€๊ธฐ์—ด์— ์ถ”๊ฐ€๋ฉ๋‹ˆ๋‹ค + ๋Œ€๊ธฐ์—ด์— ์ถ”๊ฐ€ + ๋‹ค์Œ: %1$s + ๋ณด๋‚ด์ง€ ์•Š๊ธฐ + ์ฒจ๋ถ€ + ์ œ๊ฑฐ + ๊ธฐ๋ณธ + ์ถ”๋ก  ์ˆ˜์ค€ + ์ง„ํ–‰ + ์ˆ˜์ • + ์•„์ง ๋ณ€๊ฒฝ๋œ ๋‚ด์šฉ ์—†์Œ + ๊ณ„ํš๋Œ€๋กœ ์ง„ํ–‰ํ•ด ์ฃผ์„ธ์š”. + ์ง€๊ธˆ ๋ณด๋‚ด๊ธฐ + ๋”๋ณด๊ธฐ + ๋‹ซ๊ธฐ + ์ตœ์‹  + ์ž‘์—… ์ค‘ + ์ปจํ…์ŠคํŠธ + %2$s ์ค‘ %1$s + ์ด ๋Œ€ํ™” ยท %1$s + ์ฒซ ๋‹ต๋ณ€ ํ›„ ์‚ฌ์šฉ๋Ÿ‰์ด ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค. + %1$d์‹œ๊ฐ„ ํ•œ๋„ + %1$d๋ถ„ ํ•œ๋„ + ์ฃผ๊ฐ„ ํ•œ๋„ + %1$d%% ยท %2$s์— ์ดˆ๊ธฐํ™” + + %1$d๊ฐœ ํŒŒ์ผ + %1$d๊ฐœ ํŒŒ์ผ + + ๋จผ์ € ๊ณ„ํš ์„ธ์šฐ๊ธฐ + ๊ณ„ํš + ์•„๋ฌด๊ฒƒ๋„ ๋ณ€๊ฒฝํ•˜์ง€ ์•Š๊ณ  ๊ณ„ํš๋งŒ ์ œ์•ˆํ•ฉ๋‹ˆ๋‹ค + ๋Œ€ํ™” + ์•„์ง ๋Œ€ํ™”๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค + ๋ฐฉ๊ธˆ ์ „ + ์‚ญ์ œ + ๋Œ€ํ™”์™€ ์ฒจ๋ถ€ ํŒŒ์ผ์ด ํ•จ๊ป˜ ์‚ญ์ œ๋ฉ๋‹ˆ๋‹ค + ํ”„๋กœ์„ธ์Šค + ๋ฆฌ๋ˆ…์Šค ์‚ฌ์šฉ์ž ๊ณต๊ฐ„์—์„œ ์‹คํ–‰ ์ค‘์ธ ํ”„๋กœ์„ธ์Šค๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค + ์—์ด์ „ํŠธ + ์ค‘์ง€ + ๋žฉ ๋นŒ๋“œ + ๋žฉ ๋นŒ๋“œ ์ค€๋น„ ์ค‘ + %1$d%% ยท ์•ฝ %2$s ๋‚จ์Œ + ์•ฝ %1$s ๋‚จ์Œ + ์ทจ์†Œ + ๋นŒ๋“œ ์ทจ์†Œ + ์‹œ์ž‘ ์ค‘ + %1$d%% + ํŒจํ‚ค์ง• ์ค‘ + DroidDeck ์žฌ์‹œ์ž‘ ์ค‘ + ์™„๋ฃŒ + ์‹คํŒจ: %1$s + ์—์ด์ „ํŠธ ์„ค์ • + ๋จผ์ € ์„ค์ •์—์„œ ๋ฆฌ๋ˆ…์Šค ๋Ÿฐํƒ€์ž„์„ ์„ค์น˜ํ•˜์„ธ์š”. + ๋‹ค์‹œ ์‹œ๋„ + ๋Œ€ํ™” ์‹œ์ž‘ + ๊ธฐ๊ธฐ ์—ฐ๊ฒฐ + ๋ฌด์„  ๋””๋ฒ„๊น…์œผ๋กœ ์—์ด์ „ํŠธ๊ฐ€ DroidDeck์„ ํ™•์ธํ•˜๊ณ  ์ œ์–ดํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค + %1$s ์„ค์น˜ + Linux ์‚ฌ์šฉ์ž ๊ณต๊ฐ„์— git, gh, adb์™€ ํ•จ๊ป˜ ์„ค์น˜ + %1$s์— ๋กœ๊ทธ์ธ + ๋ธŒ๋ผ์šฐ์ €๊ฐ€ ์—ด๋ฆฝ๋‹ˆ๋‹ค + GitHub + ์„ ํƒ ์‚ฌํ•ญ ยท ํ’€ ๋ฆฌํ€˜์ŠคํŠธ๋ฅผ ๋งŒ๋“ค ๋•Œ ํ•„์š” + ๋นŒ๋“œ ๋„๊ตฌ + ์„ ํƒ ์‚ฌํ•ญ ยท ์ด ๊ธฐ๊ธฐ์—์„œ Lab ๋นŒ๋“œ์— ์‚ฌ์šฉ ยท ์•ฝ 5 GB + ์—์ด์ „ํŠธ ์ค€๋น„ ์™„๋ฃŒ + ์—์ด์ „ํŠธ ์„ค์ •์„ ์™„๋ฃŒํ•˜์„ธ์š” + %1$s์— ๋กœ๊ทธ์ธ๋จ + Lab ๋นŒ๋“œ + ๋น ๋ฅธ ๋นŒ๋“œ + ๋น ๋ฅธ Lab ๋นŒ๋“œ + ์ด ๋ฒ„์ „์„ ๋ฏธ๋ฆฌ ์ปดํŒŒ์ผํ•ด Lab ๋นŒ๋“œ๊ฐ€ ๋ช‡ ๋ถ„ ๋งŒ์— ์™„๋ฃŒ๋ฉ๋‹ˆ๋‹ค ยท ํ•œ ๋ฒˆ ์•ฝ 20๋ถ„ + ์ปดํŒŒ์ผ ์ค‘ ยท %1$d%% ยท ์•ฝ %2$s ๋‚จ์Œ + ์ค€๋น„ + ๋ฌด์„  ๋””๋ฒ„๊น…์— ์—ฐ๊ฒฐํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. ํŽ˜์–ด๋งํ•˜๋ฉด ์ผœ์ง‘๋‹ˆ๋‹ค + ํŽ˜์–ด๋ง + ์„ค์น˜ + ๋กœ๊ทธ์ธ PR #%1$d ์ด DroidDeck ๋ณต์‚ฌ๋ณธ์šฉ์œผ๋กœ ๋นŒ๋“œ๋˜์ง€ ์•Š์Œ %1$s ์—…๋ฐ์ดํŠธ๋จ @@ -1241,6 +1466,9 @@ ์•ฑ ์„ค์ • ์—…๋ฐ์ดํŠธ + ๋”๋ณด๊ธฐ + ํƒญ ํŽธ์ง‘ + ํƒญ %1$d%% %1$s ์žฌ๊ฐœ ๊ฐ ์„ธ์…˜์—์„œ /root/ROMs๋กœ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค. ๋‚ด๋ถ€ ์ €์žฅ ๊ณต๊ฐ„์€ /root/Storage์— ์žˆ์Šต๋‹ˆ๋‹ค. @@ -1262,6 +1490,15 @@ ๋Œ€๊ธฐ ์ทจ์†Œ Android ํ‚ค๋ณด๋“œ ์ˆจ๊ธฐ๊ธฐ โœ• + ํ™”๋ฉด์ƒ ํฌ๊ธฐ + ํ—ค๋”๋ฅผ ํฌํ•จํ•ด ํ‚ค๋ณด๋“œ๊ฐ€ ํ™”๋ฉด์—์„œ ์ฐจ์ง€ํ•˜๋Š” ๋น„์œจ์ž…๋‹ˆ๋‹ค. + ๋ถˆํˆฌ๋ช…๋„ + ๋‚ฎ์ถ”๋ฉด ํ‚ค๋ณด๋“œ ๋’ค์˜ ๊ฒŒ์ž„์ด ๋ณด์ž…๋‹ˆ๋‹ค. + ์ˆจ๊ธด ํ‚ค + ์ž์ฃผ ์“ฐ์ง€ ์•Š๋Š” ํ‚ค๋Š” ํ‚ค๋ณด๋“œ์— ํ‘œ์‹œ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. + Esc ๋ฐ ๊ธฐ๋Šฅ ํ‚ค ํ–‰ + Ins / Del / Home / End / PgUp / PgDn + ํ™”์‚ดํ‘œ ํ‚ค %1$s ์‹คํ–‰ ํ™”๋ฉด์„ ์„ ํƒํ•˜์„ธ์š”. ๋ณด์กฐ ํ™”๋ฉด: %1$s. ๋ณด์กฐ ํ™”๋ฉด์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. @@ -1746,7 +1983,24 @@ ํ„ฐ๋ฏธ๋„ Deck ๊ทธ๋ฆฝ + ํ„ฐ์น˜ํŒจ๋“œ ๋Œ€์‹œ๋ณด๋“œ + ๋ฐ์Šคํฌํ†ฑ + ๋ฐ์Šคํฌํ†ฑ ์‹œ์ž‘ + ๋ฐ์Šคํฌํ†ฑ ยท %1$s + ํŠธ๋ž™ํŒจ๋“œ + ์ง์ ‘ ํ„ฐ์น˜ + ํŠธ๋ž™ํŒจ๋“œ. ํƒญํ•˜์—ฌ ์ง์ ‘ ํ„ฐ์น˜๋กœ ์ „ํ™˜ + ์ง์ ‘ ํ„ฐ์น˜. ํƒญํ•˜์—ฌ ํŠธ๋ž™ํŒจ๋“œ๋กœ ์ „ํ™˜ + KDE ๋ฐ์Šคํฌํ†ฑ์„ ์‹œ์ž‘ํ•˜๋Š” ์ค‘โ€ฆ + ๋ฐ์Šคํฌํ†ฑ์ด ์ข…๋ฃŒ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. + ๋ฐ์Šคํฌํ†ฑ์„ ์‹œ์ž‘ํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. ๋กœ๊ทธ๋Š” ์ด ์„ธ์…˜์˜ bottom-desktop ํด๋”์— ์žˆ์Šต๋‹ˆ๋‹ค. + ๋ฐ์Šคํฌํ†ฑ์ด ์ข…๋ฃŒ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. ์•„์ง ํ‘œ์‹œํ•  ๋‚ด์šฉ์ด ์—†์Šต๋‹ˆ๋‹ค. + ํ™”๋ฉด ๋ฐ”๊พธ๊ธฐ + ํ˜„์žฌ ํ•˜๋‹จ ํ™”๋ฉด์ด ์‚ฌ์šฉ ์ค‘์ž…๋‹ˆ๋‹ค. + ๊ฒŒ์ž„ ํ™”๋ฉด + ๊ฒŒ์ž„์„ ํ‘œ์‹œํ•  ํ™”๋ฉด + ์ƒ๋‹จ ํ™”๋ฉด + ํ•˜๋‹จ ํ™”๋ฉด ๋‹ค์šด๋กœ๋“œ ์ง„ํ–‰ ์ค‘์ธ ๋‹ค์šด๋กœ๋“œ๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค. Steam @@ -1781,6 +2035,20 @@ ์—ฐ๋ฃŒ, t ๋ฉ”์ธ %1$s t ์˜ˆ๋น„ %1$s t + ํ”„๋ ˆ์ž„ ์‹œ๊ฐ„ + ์ตœ๊ทผ %1$d์ดˆ + ํ‰๊ท  ํ”„๋ ˆ์ž„ + 1% ๋กœ์šฐ + 33 ms ์ดˆ๊ณผ ํ”„๋ ˆ์ž„ + ๋ถ„๋‹น %1$d + %1$s ๋™์•ˆ ํ”Œ๋ ˆ์ด ์ค‘ + %1$d์ฝ”์–ด, ์ตœ๋Œ€ %2$s GHz + %1$d์ฝ”์–ด + ๊ฒŒ์ž„ + %1$d Hz์˜ FPS + ๋นจ๊ฐ„์ƒ‰ ํ‘œ์‹œ๋Š” HUD๊ฐ€ ์˜จ๋„๋ฅผ ๋นจ๊ฐ„์ƒ‰์œผ๋กœ ํ‘œ์‹œํ•˜๋Š” ์ง€์ ์ž…๋‹ˆ๋‹ค. + ๊ธฐ๊ธฐ ์ „์ฒด + ๋ฐฐํ„ฐ๋ฆฌ ๊ณ„๊ธฐํŒ ๋ฐ์ดํ„ฐ ๋ณด๋‚ด๊ธฐ ์ž๋™ ๋‚˜์ค‘์— ๋ฐœ๊ฒฌ๋œ ๊ฒŒ์ž„์„ ํฌํ•จํ•ด ์—ฌ๊ธฐ์— ๋‚˜์—ด๋œ ๋ชจ๋“  ๊ฒŒ์ž„์—์„œ ์ผญ๋‹ˆ๋‹ค. ์ง์ ‘ ๋ˆ ๊ฒŒ์ž„์€ ๊บผ์ง„ ์ƒํƒœ๋กœ ์œ ์ง€๋ฉ๋‹ˆ๋‹ค. @@ -1804,6 +2072,10 @@ ์ด ๊ฒŒ์ž„์—์„œ๋Š” ๋งˆ์ดํฌ๊ฐ€ ๊บผ์ ธ ์žˆ์Šต๋‹ˆ๋‹ค. ๋Œ€ํ™”ํ•˜๋ ค๋ฉด DroidDeck์˜ Steam ์„ค์ •(์˜ค๋””์˜ค)์—์„œ ๋งˆ์ดํฌ๋ฅผ ์ผœ๊ณ  ๊ฒŒ์ž„์„ ๋‹ค์‹œ ์‹œ์ž‘ํ•˜์„ธ์š”. ๋ณผ๋ฅจ %1$d%% ๊ฒŒ์ž„ ๋‚ด ํ†ต๊ณ„ + ํ•˜๋‹จ ํ™”๋ฉด HUD + ๋ชจ๋“  ํƒญ์— ์ŠคํŠธ๋ฆฝ ํ‘œ์‹œ + 1% ๋ฐ 0.1% ๋กœ์šฐ + CPU ์˜จ๋„ FPS CPU GPU @@ -1975,6 +2247,7 @@ ์„ธ์…˜ ์‹œ์ž‘ ์ค‘โ€ฆ %1$d:%2$02d ๊ฒฝ๊ณผ ยท ์•„์ง ์ง„ํ–‰ ์ค‘ Steam ํด๋ผ์ด์–ธํŠธ ์—…๋ฐ์ดํŠธ ๋‹ค์šด๋กœ๋“œ ์ค‘ ยท %1$d%% + Steam ํด๋ผ์ด์–ธํŠธ ์—…๋ฐ์ดํŠธ ์ ์šฉ ์ค‘โ€ฆ Steam ํด๋ผ์ด์–ธํŠธ ๋‹ค์šด๋กœ๋“œ ์ค‘ ยท %1$s ํ˜ธํ™˜์„ฑ ๋„๊ตฌ๋ฅผ ์ด๋ฏธ ์„ค์น˜ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค @@ -2051,11 +2324,29 @@ ํˆฐ ์œค๊ณฝ์„ ๊ณผ ์ƒคํ”„๋‹. Adreno GPU๊ฐ€ ์•„๋‹˜ + ์‹œ์Šคํ…œ PowerVR ๋“œ๋ผ์ด๋ฒ„: ๊ธฐ๊ธฐ์— ๋”ฐ๋ผ ํ˜ธํ™˜์„ฑ์ด ๋‹ค๋ฆ…๋‹ˆ๋‹ค + ์‹คํ—˜ ๊ธฐ๋Šฅ: RADV ๋˜๋Š” ์‹œ์Šคํ…œ Xclipse ๋“œ๋ผ์ด๋ฒ„ + ์‹œ์Šคํ…œ PowerVR + ์ด GPU์— ๋‚ด์žฅ๋œ ๋“œ๋ผ์ด๋ฒ„๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค + ๋Ÿฐํƒ€์ž„๊ณผ ๋””์Šคํ”Œ๋ ˆ์ด์— ์‹œ์Šคํ…œ PowerVR ๋“œ๋ผ์ด๋ฒ„๊ฐ€ ์„ ํƒ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. + ์•„์ง ์ด Mali๋ฅผ ์ง€์›ํ•˜๋Š” ๊ณต๊ฐœ ๋“œ๋ผ์ด๋ฒ„๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค: Mali ๋ธŒ๋ฆฌ์ง€๊ฐ€ ์ผœ์ ธ ์žˆ์Šต๋‹ˆ๋‹ค. + ์ด ๋นŒ๋“œ๋Š” ์Šค๋ƒ…๋“œ๋ž˜๊ณค ์™ธ ๊ธฐ๊ธฐ์šฉ ํ…Œ์ŠคํŠธ ๋นŒ๋“œ์ž…๋‹ˆ๋‹ค: ์—ฌ๊ธฐ์˜ ๊ณต์‹ ๋นŒ๋“œ๋Š” Adreno์—์„œ๋งŒ ์‹คํ–‰๋˜๋ฏ€๋กœ ์ด ๋นŒ๋“œ ์œ„์—๋Š” ์„ค์น˜๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ์ƒˆ ํ…Œ์ŠคํŠธ ๋นŒ๋“œ๋Š” github.com/The412Banner/droiddeck-nonadreno-drivers์— ์žˆ์Šต๋‹ˆ๋‹ค. + ๋งˆ์ง€๋ง‰ ์„ธ์…˜์€ ์ถฉ๋Œ์ด ์•„๋‹ˆ๋ผ ์•ˆ๋“œ๋กœ์ด๋“œ๊ฐ€ ๋ฉ”๋ชจ๋ฆฌ๋ฅผ ํ™•๋ณดํ•˜๋ ค๊ณ  DroidDeck์„ ์ข…๋ฃŒํ•ด ๋๋‚ฌ์Šต๋‹ˆ๋‹ค. ๋‹ค๋ฅธ ์•ฑ์„ ๋‹ซ๊ฑฐ๋‚˜ ๊ฒŒ์ž„์˜ ํ…์Šค์ฒ˜ ์„ค์ •์„ ๋‚ฎ์ถ˜ ๋’ค ๋‹ค์‹œ ์‹œ๋„ํ•˜์„ธ์š”. + Mali (Venus) + Mali ๋ธŒ๋ฆฌ์ง€ + ์•„์ง ์ด Mali๋ฅผ ์ง€์›ํ•˜๋Š” ๊ณต๊ฐœ ๋“œ๋ผ์ด๋ฒ„๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค: ํœด๋Œ€์ „ํ™” ์ž์ฒด ๋“œ๋ผ์ด๋ฒ„ ์œ„์—์„œ %1$s๊ฐ€ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค. + %1$s๊ฐ€ ์•„์ง ๊ณต๊ฐœ๋˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค: ๊ณต๊ฐœ๋  ๋•Œ๊นŒ์ง€ %2$s๊ฐ€ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค. + %1$s๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์—†์œผ๋ฉฐ, ์ด ํœด๋Œ€์ „ํ™”์˜ ๋“œ๋ผ์ด๋ฒ„๊ฐ€ ๋ณด๊ณ ํ•˜๋Š” Vulkan ๋ฒ„์ „์€ %2$s์ž…๋‹ˆ๋‹ค(Venus์—๋Š” 1.2๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค): Mali ๋ธŒ๋ฆฌ์ง€๊ฐ€ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค. + %1$s๊ฐ€ ์•„์ง ๊ณต๊ฐœ๋˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค: ๊ณต๊ฐœ๋  ๋•Œ๊นŒ์ง€ Mali ๋ธŒ๋ฆฌ์ง€๊ฐ€ ์ผœ์ ธ ์žˆ์Šต๋‹ˆ๋‹ค. + ๋Œ€๊ธฐ ์ค‘: %1$s(๋‹ค๋ฅธ ๋Ÿฐํƒ€์ž„ ๋“œ๋ผ์ด๋ฒ„๋ฅผ ๊ธฐ๋‹ค๋ฆฌ๋Š” ์ค‘) + DXVK๋Š” ์‹œ์Šคํ…œ PowerVR ๋Ÿฐํƒ€์ž„์—์„œ ์ œ๊ณต๋ฉ๋‹ˆ๋‹ค. ๋‹ค๋ฅธ DXVK ํŒจํ‚ค์ง€๋Š” ์ €์žฅํ•  ์ˆ˜ ์žˆ์ง€๋งŒ ์ด ๋“œ๋ผ์ด๋ฒ„์—์„œ๋Š” ์ ์šฉ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ์ง€์›๋จ ์‹คํ—˜์ : ๋“œ๋ผ์ด๋ฒ„๊ฐ€ ํ…Œ์ŠคํŠธ ๋นŒ๋“œ์ž…๋‹ˆ๋‹ค ์‹คํ—˜์  Adreno 850 ์ง€์›: ํ˜ธํ™˜๋˜๋Š” ์‹คํ—˜์šฉ ๋””์Šคํ”Œ๋ ˆ์ด ๋ฐ ๊ฒŒ์ž„ ๋“œ๋ผ์ด๋ฒ„๊ฐ€ ํ•„์š”ํ•˜๋ฉฐ, ์ด ๊ธฐ๊ธฐ์—์„œ ๊ฒ€์ฆ๋˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค ํ…Œ์ŠคํŠธ๋œ ํ•˜๋“œ์›จ์–ด(Adreno 725 ์ด์ƒ)๋ณด๋‹ค ๋‚ฎ์Œ: ์‹คํ–‰๋˜์ง€ ์•Š์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค ์ง€์›๋˜์ง€ ์•Š์Œ: ์ด GPU์—์„œ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” ํ˜ธํ™˜ ๊ทธ๋ž˜ํ”ฝ ๋ฐฑ์—”๋“œ๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค + Mali ๋ธŒ๋ฆฌ์ง€๋ฅผ ๊ฑฐ์ณ ํœด๋Œ€์ „ํ™” ์ž์ฒด Vulkan ๋“œ๋ผ์ด๋ฒ„์—์„œ ์‹คํ–‰๋ฉ๋‹ˆ๋‹ค. + Mali ๋ธŒ๋ฆฌ์ง€๊ฐ€ ๊บผ์ ธ ์žˆ์œผ๋ฉด ์ง€์›๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค: Turnip์—๋Š” Adreno(์Šค๋ƒ…๋“œ๋ž˜๊ณค) GPU๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. GitHub ์š”์ฒญ ํ•œ๋„์— ๋„๋‹ฌํ–ˆ์Šต๋‹ˆ๋‹ค. ๋‚˜์ค‘์— ๋‹ค์‹œ ์‹œ๋„ํ•˜์„ธ์š” GitHub ์‘๋‹ต: HTTP %1$d @@ -2164,7 +2455,6 @@ ์Šคํ† ์–ด Steam ์‚ฌ์šฉ์ž ์ •์˜ - ์Šคํ† ์–ด ๋‹ค์šด๋กœ๋“œ ์†๋„ ๋‹จ๊ณ„ ๊ท ํ˜• ๋น ๋ฆ„ @@ -2203,6 +2493,7 @@ ๋‹ค๋ฅธ Battle.net ๋‹ค์šด๋กœ๋“œ๋ฅผ ๊ธฐ๋‹ค๋ฆฌ๋Š” ์ค‘โ€ฆ Battle.net์„ ์—ด๊ณ  ํ•œ ๋ฒˆ ๋กœ๊ทธ์ธํ•œ ๋‹ค์Œ ์—ฌ๊ธฐ์—์„œ ๊ฒŒ์ž„์„ ์„ค์น˜ํ•˜์„ธ์š”. Blizzard ๋‹ค์šด๋กœ๋”๊ฐ€ ์ค‘์ง€๋จ: %1$s + Blizzard ๋‹ค์šด๋กœ๋”๊ฐ€ ๋” ์ด์ƒ ์ง„ํ–‰๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. Blizzard ์˜ค๋ฅ˜ %1$s ์—…๋ฐ์ดํŠธ Blizzard ๊ฒŒ์ž„ @@ -2210,6 +2501,7 @@ ์ค‘๋‹จ๋จ ์„ค์น˜ ยท %1$s ๋ฌด๋ฃŒ๋กœ ๋ฐ›๊ธฐ + ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์— ์ถ”๊ฐ€ํ•˜๋Š” ์ค‘โ€ฆ %1$s์—์„œ ๋ณด๊ธฐ ๊ตฌ๋งค ยท %1$s ์„ค์น˜๋จ @@ -2256,6 +2548,12 @@ ์ •๋ ฌ ์‚ฌ์ด๋“œ๋ฐ” ๋ ˆ์ด๋ธ” ์‚ฌ์ด๋“œ๋ฐ” ์•„์ด์ฝ˜ ์•„๋ž˜์— ์ด๋ฆ„์„ ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค. ๋„๋ฉด ์‚ฌ์ด๋“œ๋ฐ”๊ฐ€ ๋” ์Šฌ๋ฆผํ•ด์ง‘๋‹ˆ๋‹ค. + ์—์ด์ „ํŠธ ํŽซ + DeeDee๊ฐ€ ๋Ÿฐ์ฒ˜์™€ ๊ฒŒ์ž„ ์œ„์— ํ‘œ์‹œ๋˜๋ฉฐ ์—์ด์ „ํŠธ๊ฐ€ ๋ฌด์—‡์„ ํ•˜๊ณ  ์žˆ๋Š”์ง€ ๋ณด์—ฌ ์ค๋‹ˆ๋‹ค. + ๋‹ค๋ฅธ ์•ฑ ์œ„์— ํ‘œ์‹œ + DeeDee๊ฐ€ ๋ชจ๋“  ์•ฑ ์œ„์— ํ‘œ์‹œ๋˜๋„๋ก ํ—ˆ์šฉํ•˜๊ณ  ํ•ด๋‹น ์•ฑ์—์„œ ์ฑ„ํŒ…์„ ์—ด ์ˆ˜ ์žˆ๊ฒŒ ํ•ฉ๋‹ˆ๋‹ค. + ํ—ˆ์šฉ + DeeDee์™€ ์ฑ„ํŒ…ํ•˜๊ธฐ ํ‘œ์‹œ ์นด๋“œ ํฌ๊ฒŒ ์นด๋“œ ์ž‘๊ฒŒ @@ -2538,7 +2836,14 @@ %1$s ยท ์žฌ์‹œ์ž‘ ๋Œ€๊ธฐ ์ด ๊ธฐ๊ธฐ %1$s์„(๋ฅผ) ์ œ๊ฑฐํ•˜์‹œ๊ฒ ์Šต๋‹ˆ๊นŒ? - ์ง„๋‹จ + ๊ฐœ๋ฐœ์ž + ๋นŒ๋“œ ๋ผ๋ฒจ ์›Œํ„ฐ๋งˆํฌ + ํ…Œ์ŠคํŠธ ๋˜๋Š” Lab ๋นŒ๋“œ ๋ผ๋ฒจ์„ ํ™”๋ฉด์— ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค. ๊ธฐ๋ณธ์ ์œผ๋กœ ์ผœ์ ธ ์žˆ์Šต๋‹ˆ๋‹ค. + ์ง„๋‹จ ๋ฒˆ๋“ค ๊ณต์œ  + ์„ธ์…˜ ๋ฐ ๊ธฐ๊ธฐ + ๊ทธ๋ž˜ํ”ฝ + ๊ฒŒ์ž„ ๋ฐ ํ˜ธํ™˜์„ฑ + ๋ชจ๋“  ๋ฒˆ๋“ค ํ”Œ๋ ˆ์ด ์ค€๋น„ ์™„๋ฃŒ ์•„์ง ํ”Œ๋ ˆ์ดํ•  ์ค€๋น„๊ฐ€ ๋˜์ง€ ์•Š์Œ ๋Ÿฐํƒ€์ž„ %1$s @@ -2577,6 +2882,9 @@ ์Šคํ† ์–ด ์„ค์ •์—์„œ GOG ๋„์ „ ๊ณผ์ œ๋ฅผ ํ™œ์„ฑํ™”ํ•˜์„ธ์š” ๋„์ „ ๊ณผ์ œ๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. ์„ธ์…˜ ๋กœ๊ทธ๋ฅผ ํ™•์ธํ•˜์„ธ์š” ๋„์ „ ๊ณผ์ œ ์ž ๊ธˆ ํ•ด์ œ๋จ + Mali (Venus): ๊บผ์ง + Mali (Venus): ์ผœ์ง + %1$s์˜ ๋“œ๋ผ์ด๋ฒ„๊ฐ€ Vulkan %2$s๋ฅผ ๋ณด๊ณ ํ•ฉ๋‹ˆ๋‹ค. Mali (Venus)์—๋Š” Vulkan 1.2 ์ด์ƒ์ด ํ•„์š”ํ•˜๊ณ (๋” ๋‚ฎ์€ ๋ฒ„์ „์—์„œ๋Š” gamescope์ด ์‹œ์ž‘๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค), ์„ธ์…˜์€ Venus๋ฅผ ๊ฑด๋„ˆ๋›ฐ๊ณ  PanVK ๋“œ๋ผ์ด๋ฒ„ ์กฐํ•ฉ์„ ๋Œ€์‹  ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. ๋ถ™์—ฌ๋„ฃ๊ธฐ ์™ผ์ชฝ ์Šคํ‹ฑ ์˜ค๋ฅธ์ชฝ ์Šคํ‹ฑ @@ -2861,7 +3169,7 @@ ํด๋” ์„ ํƒโ€ฆ SD ์นด๋“œ๋‚˜ USB ๋“œ๋ผ์ด๋ธŒ์˜ ์•„๋ฌด ํด๋”๋‚˜ ์‚ฌ์šฉ ๊ฒŒ์ž„์€ ์„ ํƒํ•œ ์œ„์น˜ ์•ˆ์˜ Games ํด๋”์— ์ €์žฅ๋ฉ๋‹ˆ๋‹ค. ๊ธฐ์กด ๊ฒŒ์ž„์€ ์ด๋™๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. - ์‚ฌ์šฉ ๋‚ด์—ญ + ๊ณต๊ฐ„์„ ์ฐจ์ง€ํ•˜๋Š” ํ•ญ๋ชฉ Steam ๊ฒŒ์ž„ ๊ฒŒ์ž„ ๋ฐ์ดํ„ฐ ํ”„๋ฆฌํ”ฝ์Šค %1$s ยท ์›Œํฌ์ˆ %2$s ยท ์…ฐ์ด๋” %3$s @@ -2930,6 +3238,7 @@ ๊ฒŒ์ž„์ด ์š”์ฒญํ•œ VC++ ๋ฐ DirectX ์„ค์น˜ ๊ด€๋ฆฌ์ž Linux x86 ๊ฒŒ์ž„ ์‹คํ–‰ Steam ๋„๊ตฌ + Steam์€ ๊ฒŒ์ž„์— ์•ˆํ‹ฐ ์น˜ํŠธ๊ฐ€ ํฌํ•จ๋˜์–ด ์žˆ์œผ๋ฉด ๊บผ์ ธ ์žˆ์–ด๋„ ์ด ํ•ญ๋ชฉ์„ ๋‹ค์šด๋กœ๋“œํ•ฉ๋‹ˆ๋‹ค. ์‚ญ์ œํ•˜๋ฉด ํ•ด๋‹น ๊ฒŒ์ž„์˜ ์„ค์น˜๊ฐ€ 0%์—์„œ ๋ฉˆ์ถฅ๋‹ˆ๋‹ค. DroidDeck์€ ์ด ๋Ÿฐํƒ€์ž„ ์—†์ด ๊ฒŒ์ž„์„ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค x86 Proton์ด๋ผ DroidDeck์—์„œ ์‹คํ–‰ํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค ๋ชจ๋“  ๊ฒŒ์ž„์˜ ๊ธฐ๋ณธ๊ฐ’ @@ -2993,6 +3302,19 @@ ์œ ์ง€ Steam์ด ์•„๋‹Œ ๊ฒŒ์ž„๊ณผ Steam์˜ ๊ณต์œ  ํ”„๋ฆฌํ”ฝ์Šค ์Šคํ† ์–ด์—์„œ ์ถ”๊ฐ€ํ–ˆ๊ฑฐ๋‚˜ ์ง์ ‘ ์ถ”๊ฐ€ํ•œ ๊ฒŒ์ž„์˜ ํ”„๋ฆฌํ”ฝ์Šค + Steam์˜ ๊ณต์œ  ํ”„๋ฆฌํ”ฝ์Šค + Steam์ด ์ž์ฒด Windows ๋„์šฐ๋ฏธ๋ฅผ ์—ฌ๊ธฐ์„œ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค + ์‚ญ์ œํ•ฉ๋‹ˆ๋‹ค(%1$s). ๋‹ค์Œ์— ํ•„์š”ํ•  ๋•Œ Steam์ด ์ƒˆ๋กœ ๋งŒ๋“ญ๋‹ˆ๋‹ค. + ์Šคํ† ์–ด ์•ฑ๊ณผ ์ด ์•ฑ์œผ๋กœ ์‹คํ–‰๋˜๋Š” ๊ฒŒ์ž„ + ์‚ฌ์šฉ ์ค‘: %1$s + Steam์ด ์•„๋‹Œ ๊ฒŒ์ž„ %1$s + ์ผ์น˜ํ•˜๋Š” ๊ฒŒ์ž„์ด ์—†์–ด ์œ ์ง€๋ฉ๋‹ˆ๋‹ค + ์„ ํƒ ํ•ญ๋ชฉ ์ œ๊ฑฐ ยท %1$s + ์„ ํƒ ํ•ญ๋ชฉ ์ œ๊ฑฐ ยท %1$s + Wine ํ”„๋ฆฌํ”ฝ์Šค + ๊ทธ ์•ˆ์˜ ์ €์žฅ ํŒŒ์ผ๊ณผ ์„ค์ •์€ ์‚ฌ๋ผ์ง€๋ฉฐ, Steam Cloud ์ €์žฅ ํŒŒ์ผ์€ ๊ณ„์ •์— ๋‚จ์•„ ์žˆ์Šต๋‹ˆ๋‹ค. + ์…ฐ์ด๋” ์บ์‹œ + ํ”„๋ฆฌํ”ฝ์Šค %1$s ยท ์…ฐ์ด๋” %2$s ๋‚ด๋ ค๋ฐ›์€ ํŒจํ‚ค์ง€ ์ €์žฅ๋œ ์›๋ณธ ํŒŒ์ผ ๋‚ด๋ ค๋ฐ›์€ ๊ตฌ์„ฑ ์š”์†Œ ํŒจํ‚ค์ง€๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค. @@ -3027,6 +3349,8 @@ DroidDeck ยท %1$d fps 60 fps๋Š” ๋” ๋ถ€๋“œ๋Ÿฝ์ง€๋งŒ Steam์ด ์‹œ์ž‘๋˜๋Š” ๋™์•ˆ CPU๋ฅผ ๋” ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. Steam ์ž์ฒด ์„ค์ •์—์„œ ๊ณ ๋ฅธ ๋™์˜์ƒ๋„ ์—ฌ๊ธฐ์— ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค. ์†Œ๋ฆฌ + ์‹œ์ž‘ ๋™์˜์ƒ ๊ฑด๋„ˆ๋›ฐ๊ธฐ + 0.1์ดˆ์งœ๋ฆฌ ๊ฒ€์€ ํ™”๋ฉด ํด๋ฆฝ์„ Steam ์‹œ์ž‘ ๋™์˜์ƒ์œผ๋กœ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. ๋‹ค์Œ ์„ธ์…˜๋ถ€ํ„ฐ ์ ์šฉ๋ฉ๋‹ˆ๋‹ค. ๋‚ด ๋™์˜์ƒ MP4, MOV, MKV ๋˜๋Š” WebM. ๋‹ค๋ฅธ ํ˜•์‹๊ณผ %1$d MB๋ฅผ ๋„˜๋Š” ํŒŒ์ผ์€ ๊ธฐ๊ธฐ์—์„œ 720p WebM์œผ๋กœ ๋ณ€ํ™˜๋ฉ๋‹ˆ๋‹ค(์ตœ๋Œ€ %2$d์ดˆ). ๊ฐ€์ ธ์˜ค๊ธฐ @@ -3488,6 +3812,7 @@ Alt+Tab, Win ํ‚ค, ํ™ˆ ๋ฒ„ํŠผ์„ Android ๋Œ€์‹  ์‚ฌ์šฉ ์ค‘์ธ DroidDeck ์„ธ์…˜์—์„œ ์ž‘๋™ํ•˜๊ฒŒ ํ•ฉ๋‹ˆ๋‹ค. ์„ค์ • โ†’ Steam ์—ฐ๋™์—์„œ ๋ฐ๊ธฐ๋ฅผ ์ผœ์„ธ์š” Mali ๋ธŒ๋ฆฌ์ง€: ๋” + Mali ๋ธŒ๋ฆฌ์ง€์—๋Š” ์‹œ์Šคํ…œ ๋“œ๋ผ์ด๋ฒ„ ๊ฒฝ๋กœ๊ฐ€ ์—†๋Š” Mali GPU๊ฐ€ ํ•„์š”ํ•˜๋ฏ€๋กœ %1$s์—์„œ๋Š” ์‚ฌ์šฉํ•  ์ˆ˜ ์—†์œผ๋ฉฐ, ์ด ์Šค์œ„์น˜๋Š” ์—ฌ๊ธฐ์„œ ์•„๋ฌด ํšจ๊ณผ๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค. Mali ๋ธŒ๋ฆฌ์ง€: ์ผฌ %1$s์€(๋Š”) Adreno๊ฐ€ ์•„๋‹™๋‹ˆ๋‹ค. ์‹คํ—˜์  Vulkan ๋ธŒ๋ฆฌ์ง€๊ฐ€ ์ผœ์ ธ ์žˆ์–ด ์„ธ์…˜์ด ํœด๋Œ€ํฐ ์ž์ฒด ๋“œ๋ผ์ด๋ฒ„๋กœ ๊ทธ๋ฆฝ๋‹ˆ๋‹ค. ๋ฒ„๊ทธ๊ฐ€ ์žˆ์„ ์ˆ˜ ์žˆ์œผ๋‹ˆ ์„ธ์…˜ ๋กœ๊ทธ๋ฅผ ๋ณด๋‚ด ์ฃผ์„ธ์š”. ์•ˆ์ „ ๋ชจ๋“œ @@ -3513,6 +3838,25 @@ ๋’ค๋กœ ์ด๋™ ์œ„์ ฏ ์„ค์ • ์œ„์ ฏ ์‚ญ์ œ + ์™ธ๊ด€ + ์•„์ด์ฝ˜ ํŒฉ + ์‹œ์Šคํ…œ ๊ธฐ๋ณธ๊ฐ’ + ์•ฑ ์ƒ‰์ƒ ๋ฐฐ๊ฒฝ + ์•„์ด์ฝ˜ ํฌ๊ธฐ + ์ž‘๊ฒŒ + ๋ณดํ†ต + ํฌ๊ฒŒ + ์•ฑ ์ด๋ฆ„ ์ˆจ๊ธฐ๊ธฐ + ๊ฐ„๊ฒฉ + ์ข๊ฒŒ + ๋ณดํ†ต + ๋„“๊ฒŒ + ์•„์ด์ฝ˜ ๋ณ€๊ฒฝ + ์•„์ด์ฝ˜ ์ดˆ๊ธฐํ™” + ์•„์ด์ฝ˜ ๊ฒ€์ƒ‰ + ์•„์ด์ฝ˜ ๋ถˆ๋Ÿฌ์˜ค๋Š” ์ค‘โ€ฆ + ์•„์ด์ฝ˜์„ ์ฐพ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. + ์‚ฌ์šฉ์ž ์ •์˜ ์•„์ด์ฝ˜ ํด๋”์— ์ถ”๊ฐ€ ์ƒˆ ํด๋” ํด๋”์—์„œ ์ œ๊ฑฐ @@ -3627,5 +3971,81 @@ ์ด ๋ ˆ์ด์•„์›ƒ์„ ๊ฐ€์ ธ์˜ฌ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค ์ง„ํ™๋น› ๋ˆˆ + ๋นจ๊ฐ„์ƒ‰ ํฌ์ธํŠธ๊ฐ€ ์žˆ๋Š” ํฐ์ƒ‰ ํ‘œ๋ฉด. + ์‚ฌ์šด๋“œํŠธ๋ž™ + ์Œ์•… + ์žฌ์ƒ ์˜ต์…˜ + ์ฆ๊ฒจ์ฐพ๊ธฐ + ์ปฌ๋ ‰์…˜ + ์•„์ง ์ปฌ๋ ‰์…˜์ด ์—†์Šต๋‹ˆ๋‹ค. ๋ถ๋งˆํฌ ์•„์ด์ฝ˜์„ ๋ˆŒ๋Ÿฌ ๋งŒ๋“ค์–ด ๋ณด์„ธ์š”. + ์ €์žฅ๋จ + ์ปฌ๋ ‰์…˜ ๋งŒ๋“ค๊ธฐ + ์ €์žฅํ•œ ๊ณก์„ ์ •๋ฆฌํ•˜์„ธ์š” + ์ƒˆ๋กœ ๋งŒ๋“ค๊ธฐ + ๋งŒ๋“ค๊ธฐ + ์ปฌ๋ ‰์…˜ ์ด๋ฆ„ + ๋‹ค๋ฅธ ์ปฌ๋ ‰์…˜์—์„œ ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š” ์ด๋ฆ„์„ ์ž…๋ ฅํ•˜์„ธ์š” + ๊ด€๋ฆฌ + ์ด๋ฆ„ ๋ณ€๊ฒฝ + ํŠธ๋ž™ ์ถ”๊ฐ€ + ์ถ”๊ฐ€ (%1$d) + ํŠธ๋ž™ ์ œ๊ฑฐ + ์ปฌ๋ ‰์…˜ ์‚ญ์ œ + %1$s์„(๋ฅผ) ์‚ญ์ œํ• ๊นŒ์š”? + ํŠธ๋ž™์€ ๊ธฐ๊ธฐ์— ๊ทธ๋Œ€๋กœ ๋‚จ์Šต๋‹ˆ๋‹ค. ์ปฌ๋ ‰์…˜๋งŒ ์‚ญ์ œ๋ฉ๋‹ˆ๋‹ค. + ์„ ํƒ + ๋ชจ๋‘ ์„ ํƒ + ๋ชจ๋‘ ์„ ํƒ ํ•ด์ œ + %1$d๊ฐœ ์„ ํƒ๋จ + ์ปฌ๋ ‰์…˜์— ์ถ”๊ฐ€ + ์ฆ๊ฒจ์ฐพ๊ธฐ์— ์ถ”๊ฐ€ + ์ปฌ๋ ‰์…˜์—์„œ ์ œ๊ฑฐ + ํŠธ๋ž™ ๊ฒ€์ƒ‰ + ์•จ๋ฒ” ์ˆœ์„œ + ๊ธด ์ˆœ์„œ + ์งง์€ ์ˆœ์„œ + ํŠธ๋ž™ + ํ”ผ์น˜ + ์ดˆ๊ธฐํ™” + ๋ฌด์Œ ๊ฑด๋„ˆ๋›ฐ๊ธฐ + ์ทจ์นจ ํƒ€์ด๋จธ + %1$d๋ถ„ + ํŠธ๋ž™ ๋ + %1$s ๋‚จ์Œ + ์ดํ€„๋ผ์ด์ € + ๋ฒ ์ด์Šค ๋ถ€์ŠคํŠธ + ์ด ๊ธฐ๊ธฐ์—์„œ๋Š” ์ดํ€„๋ผ์ด์ €๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค + ๊ฒŒ์ž„ ์ค‘ ์‚ฌ์šฉ + ๊ฒŒ์ž„์ด ์‹คํ–‰๋˜๋Š” ๋™์•ˆ ์‚ฌ์šด๋“œํŠธ๋ž™ ๊ณ„์† ์žฌ์ƒ + ์„ค์น˜๋œ ์‚ฌ์šด๋“œํŠธ๋ž™์ด ์•„์ง ์—†์Šต๋‹ˆ๋‹ค. + ์‚ฌ์šด๋“œํŠธ๋ž™ ๊ฒ€์ƒ‰ + ์‚ฌ์šด๋“œํŠธ๋ž™ ํด๋” ์ถ”๊ฐ€ + ํ•ด๋‹น ํด๋”์— ์˜ค๋””์˜ค ํŒŒ์ผ์ด ์—†์Šต๋‹ˆ๋‹ค + ์ด ์žฌ์ƒ ์‹œ๊ฐ„ + %1$d๊ฐœ ํŠธ๋ž™ / %2$s + ๋””์Šคํฌ %1$s + ์…”ํ”Œ + ์ด์ „ + ์žฌ์ƒ + ์ผ์‹œ์ •์ง€ + ๋‹ค์Œ + ๋ฐ˜๋ณต ๋” + ์ „์ฒด ๋ฐ˜๋ณต + ํ•œ ๊ณก ๋ฐ˜๋ณต + ๋ณผ๋ฅจ + ์ด ์‚ฌ์šด๋“œํŠธ๋ž™์— ์˜ค๋””์˜ค ํŒŒ์ผ์ด ์—†์Šต๋‹ˆ๋‹ค + ์‹คํ–‰ํ•  ์ˆ˜ ์—†์Œ + ์ด ๋งํฌ๋ฅผ ์—ด ์ˆ˜ ์žˆ๋Š” ์›น ๋ธŒ๋ผ์šฐ์ €๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค. + ์žก๊ธฐ + ๋†“๊ธฐ + ์ €์žฅ + ๊ธธ๊ฒŒ ๋ˆŒ๋Ÿฌ ์ดˆ๊ธฐํ™” + ์Šคํ† ์–ด + ํ”„๋ ˆ์ž„ ์‹œ๊ฐ„ + ํ‰๊ท  ํ”„๋ ˆ์ž„ ์†๋„ + ๋””์Šคํ”Œ๋ ˆ์ด ์„œ๋ฒ„ + HDR ์ƒํƒœ + ํ‘œ์‹œ๋จ + %2$d ์ค‘ %1$d diff --git a/app/src/main/res/values-ms/input_library.xml b/app/src/main/res/values-ms/input_library.xml new file mode 100644 index 0000000000..bd4b455121 --- /dev/null +++ b/app/src/main/res/values-ms/input_library.xml @@ -0,0 +1,132 @@ + + + Tetapan input yang tidak dapat dibaca disimpan dalam salinan pemulihan. Anda boleh terus menyunting profil yang dipulihkan. + Sifat + Sifat klik + %1$s ยท Klik + Butang + Kayu, pad dan pencetus + Sembunyikan alat + Pengawal + Hantar input pengawal ke Steam Input atau permainan. + Elemen ini tidak menghantar input pengawal, tetikus atau papan kekunci. + Klik tetikus + Tindakan DroidDeck + Tindakan + Kelajuan tatal: %1$d langkah/s + + Profil baharu + + Susun atur baharu + %1$s ยท Digunakan oleh %2$d profil. Perubahan terpakai pada setiap profil yang menggunakan penetapan ini. + Namakan semula + Padam + Tambah elemen pada susun atur sebelum menetapkan tindakannya. + Tidak dapat menyimpan tetapan input + Nama + Mula dari + Butang + Kayu + Pad sentuh + D-pad + Pencetus + Selesai + Buat asal + + Tambah + Seret untuk mengalih. Seret penjuru untuk mengubah saiz. Ketik Sifat untuk menetapkan tindakan. + Menyunting pada skrin kedua + Skrin yang dipilih tidak tersedia. Sambungkannya untuk menyunting susun atur ini pada saiz sebenar. + Buang perubahan susun atur yang belum disimpan? + Susun atur ini digunakan oleh %1$d profil. Perubahan yang disimpan terpakai pada semua. + Profil lalai + Mod desktop + Mod permainan + Lalai untuk desktop dan permainan + Lalai untuk mod permainan + Lalai untuk mod desktop + Tetapan peranti + Kawalan + Butang, kayu, pencetus dan kekunci tambahan + Salin profil + Tetapkan semula tindakan + Tetapkan semula tindakan dalam %1$s kepada lalai profil asasnya? Susun atur dan profil lain kekal tidak berubah. + Padam %1$s? Mod yang menggunakannya akan kembali kepada profil lalai terbina dalam. Susun atur tersimpan dan tetapan dikongsi kekal tersedia. + Keterlihatan + Terpakai pada semua profil. Auto menunjukkan kawalan skrin utama apabila tiada pengawal disambungkan dalam mod permainan. + Sunting pada skrin + Susun atur tersimpanโ€ฆ + Pilih susun atur atau cipta sendiri + Pilih Kawalan profil dalam menu sesi skrin kedua. Pemilih Profil dan Skrin kedua dalam menu pengawal menentukan kawalan yang dipaparkan. + Tindakan butang + Dikongsi dengan %1$s. Suntingan juga terpakai pada profil tersebut. + Guna semula tetapan + Guna tetapan daripadaโ€ฆ + Salin daripada profil lain atau kekalkan tetapan dikongsi + Jadikan bebas + Kekalkan persediaan semasa dan berhenti berkongsi perubahan + Susun atur menyimpan elemen dan kedudukannya. Setiap profil boleh menetapkan tindakannya sendiri. Sunting pada saiz penuh di skrin sasaran. + Susun atur semasa + Padam susun atur tidak digunakan %1$s dan tindakan tersimpannya? + Namakan semula susun atur semasa + Guna semula %1$s daripada profil lain. Sumber kawalan lain kekal tidak berubah. + Kekalkan kawalan fizikal dikongsi + Secara lalai, semua kawalan dan susun atur tersuai ialah salinan bebas. Perkongsian hanya memautkan kawalan fizikal. + Guna elemen dan kedudukan ini. Perkongsian memastikan perubahan geometri masa depan kekal segerak; tindakan butang anda kekal bebas. Susun atur berbeza bermula dengan tindakan yang belum ditetapkan. + Salin kawalan dan tindakan ini, atau pautkannya supaya perubahan masa depan terpakai pada kedua-dua profil. + Kekalkan dikongsi + Salinan bebas + Mulakan kayu pada kedudukan sentuhan + Sembunyikan kayu apabila tidak digunakan + Alat + Auto (%1$s) + Tersuai (%1$s) + Simpan sebagai profil baharu + Kawalan profil + Profil + Gerak isyarat pad sentuh tetikus + Apabila ditetapkan pada penuding tetikus: ketik untuk klik, tahan untuk seret, dan tatal dengan dua jari. + %1$s mempunyai penggantian menu pantas. Pilih Auto di sana untuk menggunakan profil lalainya dan ketiga-tiga bahagian tersimpan. + Input DroidDeck + Ditetapkan semasa kayu digerakkan ke mana-mana arah: tekan melebihi 55%, lepas di bawah 35%. Gunakan Kekunci arah untuk menetapkan setiap arah secara berasingan. Perintah DroidDeck berjalan sekali setiap pesongan. Klik kayu ditetapkan secara berasingan. + Ditetapkan semasa menyentuh pad sentuh; dilepaskan apabila jari diangkat. Perintah DroidDeck berjalan sekali setiap sentuhan. Klik pad sentuh ditetapkan secara berasingan. + Ditetapkan apabila pencetus melepasi 55%; dilepaskan di bawah 35%. Perintah DroidDeck berjalan sekali setiap tekanan. + Arah tatal + Menegak + Mendatar + Tatal mendatar + Ukuran + Dayakan rakaman, gunakan kawalan dalam sesi yang berjalan, kemudian kembali dan baca keputusan. Hanya mengukur masa penghantaran DroidDeck, bukan kependaman skrin. Rakaman berakhir apabila proses apl ditutup. + %1$d kawalan + Susun atur tersimpan lain (%1$d) โ–พ + Sembunyikan susun atur tersimpan lain (%1$d) โ–ด + Utama / Guide + Kembali ยท satu ketikan + Kembali ยท ketik dua kali + Kembali ยท dua kali dalam Steam, sekali di desktop + Dalam mod Steam. Menahan Kembali juga membuka akses pantas. + Pulihkan kepada lalai + Pilihan panel anda diingati. Desktop membuka ruang kerja kedua; ia tidak menukar sesi atau profil inputnya. + Pengawal maya + Jenis pengawal yang dilihat oleh Steam atau permainan. + Skrin sentuh + Bagaimana sentuhan pada skrin permainan dikendalikan. Butang profil kekal dengan tindakan yang ditetapkan. + Kursor sentuh + Tunjukkan penuding untuk sentuhan langsung pada skrin permainan. + Sentuh dan tahan + Tindakan tetikus apabila menahan jari pada skrin permainan. + Ketikan butang Kembali + Tindakan pertama: satu ketikan. Tindakan kedua: dua ketikan. + Butang togol + Ketik untuk menahan, ketik lagi untuk melepaskan. Membuka menu atau menukar profil melepaskan butang. + Bentuk + Bulat + Pil + Bulatan + Segi empat tepat + Label butang + Teks + Imej diimport + Kekunci pepenjuru berasingan + Tetapkan kekunci untuk setiap pepenjuru. Pepenjuru kosong menekan dua arah jirannya. + Arah jiran + Kekunci skrin lama anda disimpan sebagai profil diimport di bawah. Pilih satu untuk digunakan atau disunting. Pilihan profil semasa anda dikekalkan. + Kekunci skrin lama tidak dapat diimport secara automatik. Tetapan asal dikekalkan. + diff --git a/app/src/main/res/values-ms/input_strings.xml b/app/src/main/res/values-ms/input_strings.xml new file mode 100644 index 0000000000..e96a230e16 --- /dev/null +++ b/app/src/main/res/values-ms/input_strings.xml @@ -0,0 +1,38 @@ + + + Profil input + Profil + Pengawal fizikal + Skrin utama + Skrin kedua + Asli / Steam Input + Asli: %1$s + Hantar kawalan pengawal lain + Dinyahdayakan + Kekunci atau gabungan kekunci + Kekunci arah + Gerakkan penuding + Kelajuan penuding: %1$d + Tatal + Tatal menegak + Butang kiri tetikus + Butang kanan tetikus + Butang tengah tetikus + Buka menu DroidDeck + Tunjukkan papan kekunci + Buka menu Steam + Buka akses pantas Steam + Alih keluar kawalan + Tambah kawalan + Butang khusus peranti + Tetapkan butang fizikal + Lepaskan butang, kemudian pilih Edit, Cuba lagi atau Batal. B atau Kembali membatalkan selepas dilepaskan. + Cuba lagi + Tekan butang, termasuk butang Kembali yang dilaporkan sebagai kekunci. Kekunci kelantangan dan sistem Android dikhaskan. Penetapan hanya terpakai pada peranti ini. + Alih keluar penetapan + Diagnostik input + Rakam masa penghantaran input + Baca ukuran + Mengukur penghantaran dari Android hingga penerbitan ke pengangkutan input sedia ada. Tidak termasuk ketibaan Bluetooth, pengundian tetamu, pemaparan dan kependaman skrin. Rakaman dimatikan secara lalai. + Gunakan penetapan input biasa + diff --git a/app/src/main/res/values-ms/strings.xml b/app/src/main/res/values-ms/strings.xml index 10524febe1..7d0a634ed9 100644 --- a/app/src/main/res/values-ms/strings.xml +++ b/app/src/main/res/values-ms/strings.xml @@ -28,6 +28,8 @@ Gantung sekarang Hentikan sesi Penjanaan bingkai + Tetapan untuk permainan ini + Tetapan lalai Pilih mod penjanaan bingkai Mati DD-FG %1$dร— @@ -183,6 +185,7 @@ Persekitaran grafik PowerVR tidak dapat dimuat turun. Semak sambungan dan cuba lagi. DirectAudio tidak dapat dimuat turun, jadi audio permainan menggunakan laluan yang lebih perlahan untuk sesi ini. Program ini + Sesi gagal melukis pada skrin: %1$s. Skrin ini menunjukkan sebabnya, bukannya skrin hitam; butiran ada dalam log sesi. Tidak dapat memuat turun klien Steam. Rangkaian atau VPN anda mungkin menyekat pelayan Steam; semak sambungan dan cuba lagi. Tidak dapat menyediakan klien Steam. Semak sambungan dan ruang storan kosong, kemudian cuba lagi. %1$s dibina untuk PC x86 dan berjalan melalui FEX, yang belum dipasang lagi. Mulakan Steam sekali semasa anda log masuk dan biarkan ia memuat turun FEX dan Steam Linux Runtime, kemudian mulakan ini semula. @@ -384,6 +387,9 @@ Belum disokong di sini Memuatkan komponenโ€ฆ Tidak dapat memasang: %1$s + Muat turun ini perlu dikemas kini. + Kemas kini dalam baris gilir. + Cuba semula kemas kini Dimuat turun Memuat turun %1$s Memasang: %1$s @@ -414,6 +420,22 @@ Dalaman sahaja Folder: %1$s Pustaka kedua + Pustaka Steam tambahan + Folder tempat Steam boleh memasang permainan dan menjalankannya dari situ, setiap satu dengan namanya sendiri. Mengalih keluar satu folder tidak membuang permainannya daripada storan. + Tambah pustaka + Namakan semula + Nama pustaka + Pilih folder untuk pustaka + Maksimum %1$d pustaka tambahan + Folder itu sudah menjadi pustaka atau berada di dalam pustaka. + %1$s ยท tidak tersedia + Berkuat kuasa dari sesi Steam seterusnya + Ditemui pada peranti ini ยท %1$s ยท %2$s + Tambah + Cari pustaka pada storan dalaman + Benarkan akses kepada semua fail supaya DroidDeck dapat melihat pustaka Steam yang disimpan oleh apl lain pada storan dalaman + Benarkan + Ditambah %1$s, iaitu pustaka Steam di dalam folder yang anda pilih Permainan yang menstrim aset daripada SD atau storan kongsi mungkin tersekat-sekat. Diagnostik storan Rekod keputusan peruntukan dan masa storan yang disampel dalam Kongsi log. Boleh melambatkan pemasangan semasa dihidupkan. Berkuat kuasa pada sesi seterusnya. @@ -476,6 +498,7 @@ Hidup Bermula dengan Steam Bermula tanpa Steam + Resolusi permainan Tetapan Tetapan %1$s Lalai @@ -563,6 +586,8 @@ Teras permainan Teras permainan Teras untuk permainan. Dengan semua dipilih, Android menjadualkan secara bebas. + Jimat kuasa dalam permainan yang stabil + Menjalankan permainan pada teras yang lebih perlahan selagi kadar bingkainya stabil, dan mengembalikannya ke teras biasanya sebaik ia ketinggalan. Antara muka klien GL berbenang Boleh menjadikan menu Steam lebih responsif. @@ -598,7 +623,10 @@ Melumpuhkan pembantu navigasi pad Proton, yang memakan CPU dalam setiap permainan. Jalankan proot tanpa seccomp Mungkin membetulkan ralat syscall yang hilang pada sesetengah kernel. Boleh mengurangkan prestasi. + Jalankan tanpa proot (eksperimen) + Memulakan bahagian Linux terus pada Android. Berkuat kuasa dari sesi seterusnya. Matikan jika ada yang gagal dimulakan. Laluan pantas proot + Tidak digunakan tanpa proot. Memerlukan penapis seccomp proot. Carian fail lebih pantas dan kurang tersekat-sekat. Matikan jika sesuatu program tidak dapat mencari failnya. Lukis kursor di dalam gamescope @@ -681,6 +709,7 @@ Memori grafik Memori swap Tahap bateri + Baki hayat bateri Penggunaan kuasa Rangkaian Resolusi @@ -806,6 +835,7 @@ Peranti disokong GPU belum diuji GPU tidak disokong + GPU melalui jambatan Mali %1$s ยท %2$s %1$s: %2$s Tiada backend grafik yang serasi tersedia untuk %1$s. Steam mungkin memaparkan skrin hitam. @@ -835,15 +865,38 @@ Sesi Log sesi Disimpan selepas setiap sesi + Diagnostik dipertingkat untuk sesi seterusnya + Merakam log terperinci untuk satu sesi. Boleh mengurangkan prestasi dan menggunakan lebih banyak storan. Ia dimatikan sendiri apabila sesi bermula; semak log sebelum berkongsi. Log nyahpepijat permainan Sertakan diagnostik Proton, Wine dan grafik pada pelancaran permainan seterusnya. Boleh mengurangkan prestasi dan menggunakan lebih banyak storan. Mulakan semula sesi ini untuk menyimpan log nyahpepijat permainan Tidak dapat mengemas kini pengelogan. Semak suis dan cuba lagi. Alatan penyahpepijatan + Log grafik terperinci + Antara muka Steam: pelukisan GPU + Dengan pasangan pemacu Xclipse, Steam melukis halamannya melalui perisian (pelukisan GPU menghasilkan jubin yang cacat). Hidupkan untuk antara muka Steam yang lebih pantas jika hasilnya kelihatan betul pada telefon ini. + dibina pada %1$s + %1$s dikemas kini kepada binaan terbaharu + Jambatan Mali gagal ujian kendiri pada %1$s semasa sesi lepas (imej atau lukisan), jadi sesi itu menggunakan pasangan pemacu PanVK sebaliknya. + Jambatan Mali tidak menemui cara untuk berkongsi memori dengan pemacu pada %1$s semasa sesi lepas, jadi sesi itu menggunakan pasangan pemacu PanVK sebaliknya. Jambatan ini tidak boleh berfungsi pada telefon ini; mematikannya mengekalkan pasangan PanVK. + Log Proton, DXVK dan pemacu bagi setiap permainan disertakan dalam log sesi. Sentiasa aktif apabila GPU bukan Adreno. Log sesi terkini Log sesi tersimpan Menyimpan %1$d yang terbaharu Kosongkan log + Log sesi yang tersedia + Belum ada log sesi yang disimpan. + Fail ZIP yang dikongsi dan disimpan menyertakan sesi yang dipilih serta diagnostik berkaitan bagi Steam, kedai, alat dan Battle.net. + %1$s ยท %2$s + Sesi semasa + Kongsi + Simpan ke peranti + Padam + Padam log sesi? + Padam %1$s? Tindakan ini tidak boleh dibatalkan. + Log sesi disimpan. + Tidak dapat menyimpan log sesi. + Tidak dapat memadam log sesi. Set semula semua tetapan Kembalikan setiap tetapan kepada nilai lalai Set semula @@ -870,6 +923,8 @@ Gunakan sebagai skrin Utama DroidDeck boleh menjadi apl Utama DroidDeck tidak sekali-kali ditawarkan sebagai apl Utama + Butang Utama membuka + Halaman yang dipaparkan apabila DroidDeck ialah apl Skrin Utama dan anda menekan butang Utama Dalam Tambah Permainan, tetapkan DroidDeck kepada Sertakan Orientasi Orientasi pelancar @@ -883,15 +938,22 @@ Skrin penuh Menyembunyikan bar status dan navigasi Android Memaparkan bar status dan navigasi Android + Pelancar dwi skrin + Automatik meletakkan bahagian pelancar (Steam, Pustaka, Kedai dan selebihnya) pada skrin kedua terbina dalam peranti genggam. Hidup menggunakan sebarang paparan kedua. Mati mengekalkan pelancar pada satu skrin. + Sesi dwi skrin + Automatik meletakkan menu dalam permainan pada skrin kedua terbina dalam, bukannya sebagai tetingkap timbul. Hidup menggunakan sebarang paparan kedua. Mati mengekalkan menu pada skrin permainan; anda masih boleh memilih skrin kedua daripada menu itu. Automatik Hidup Mati Kawalan skrin bawah dalam permainan + Papan kekunci Android untuk medan teks Membuka pad jejak dan papan kekunci pada skrin kedua apabila sesi bermula. Menaip untuk skrin atas Selesai Apl Utama lalai Pilih apl Utama + Sembunyikan pelancar daripada senarai apl terkini semasa melahu + Hanya berkuat kuasa apabila DroidDeck ialah apl Skrin Utama lalai dan tiada sesi sedang berjalan. Pilih Apl Linux (beta) Fail @@ -1003,9 +1065,172 @@ Preview Pembetulan terbaharu, sebelum Stable Terkini + Salin butiran binaan + Butiran binaan disalin + Lebih baharu daripada Preview + Anda mendahului Preview + Binaan ini lebih baharu daripada Preview terkini. Binaan Preview seterusnya akan mengemas kininya. + Pilih binaan untuk melihat perubahannya atau memasangnya. + Dipasang + Pasang binaan ini%1$s + Kembali ke binaan ini%1$s + versionCode %1$d + Commit %1$s + Halaman keluaran + PR ini ada commit lebih baharu (%1$s). Binaan ujiannya belum siap, jadi binaan ini tidak memuatkannya. + Commit baharu ditolak, binaan menunggu + Nombor PR, tajuk atau pengarang + Tiada binaan ujian yang sepadan + Perlu dibina semula (versionCode %1$d) + Kemas kini binaan ujian + Binaan ujian baharu untuk PR #%1$d + %1$s. Buka Kemas kini untuk memasangnya. + Tunjuk lagi (%1$d) + Perlu dibina semula untuk versionCode %2$d (%1$d) + Binaan Preview di main sejak binaan ujian ini: %1$d Binaan ujian Cuba pembetulan sebelum dikeluarkan Tiada pada masa ini + Binaan Lab + Binaan Lab + Sedang digunakan + Dijeda selepas Android mengoptimumkan semula DroidDeck + Tidak dimuatkan: %1$s + Menunggu permulaan semula + Dikekalkan + Untuk versi lain + Bina semula + Memadam binaan ini daripada peranti + Mulakan semula dengannya + Matikan + Gunakan + Padam + Padam sekarang + Tidak dapat menyediakan permulaan semula: %1$s. Pasangkan penyahpepijatan wayarles dalam Persediaan dan cuba lagi. + Binaan Lab dipasang + DroidDeck dimulakan semula pada %1$s + Binaan Lab dijeda + Android mengoptimumkan semula DroidDeck, jadi %1$s tidak dimuatkan. Buka Kemas Kini untuk memulakan semula padanya. + Binaan Lab dimatikan + Ia dibina untuk versi DroidDeck yang lain. Ia disimpan dalam Kemas Kini. + DroidDeck tidak dimulakan padanya dua kali + Ejen + Ejen + Ejen sedang bekerja + Pasang Claude Code dalam ruang pengguna Linux untuk menggunakan ejen. + Tanya tentang permainan, ranapan, atau perubahan pada DroidDeck + Hantar + Perbualan baharu + Hentikan + Storan + Alih keluar + Alih keluar sekarang + Claude Code + Codex + Sumber DroidDeck + Cache muat turun + Perubahan yang belum dimuat naik akan hilang + Binaan akan memuat turunnya semula + Persediaan boleh memasangnya semula; log masuk dikekalkan + DroidDeck dimulakan semula pada binaan Lab anda. Sambung semula dari tempat anda berhenti. + Tanya mengapa sesuatu permainan tidak dapat dimulakan, minta ia menerangkan log, atau mengubah DroidDeck dan mencuba perubahan itu pada peranti ini. + Gagal: %1$s + %1$s tamat (kod keluar %2$d) + Dihentikan + Tamat tanpa balasan + Cuba semula + Menyediakan ejen + Bina semula binaan Lab saya %1$s untuk versi DroidDeck yang dipasang dan mulakan semula padanya. + %1$s masuk ยท %2$s keluar + Berfikir + Fikiran + Berfikir ยท %1$s + %1$s ยท %2$s + MASUKAN + KELUARAN + Sedang berjalanโ€ฆ + Tiada hasil: giliran tamat terlebih dahulu + Tiada output + Taip untuk membariskan mesej seterusnya + Baris gilir + Seterusnya: %1$s + Jangan hantar + Lampirkan + Alih keluar + Lalai + Usaha penaakulan + Teruskan + Ubah suai + Belum ada perubahan + Teruskan dengan pelan ini. + Hantar sekarang + Lagi + Tutup + Terkini + Sedang bekerja + Konteks + %1$s daripada %2$s + Perbualan ini ยท %1$s + Penggunaan dipaparkan selepas balasan pertama + Had %1$d jam + Had %1$d minit + Had mingguan + %1$d%% ยท ditetapkan semula %2$s + + %1$d fail + %1$d fail + + Rancang dahulu + Rancang + Mencadangkan pelan tanpa mengubah apa-apa + Perbualan + Belum ada perbualan + Baru sahaja + Padam + Memadamnya dan lampirannya + Proses + Tiada apa-apa berjalan dalam ruang pengguna Linux + AGEN + Hentikan + Binaan Lab + Menyediakan binaan Lab + %1$d%% ยท kira-kira %2$s lagi + kira-kira %1$s lagi + Batal + Batalkan binaan + Memulakan + %1$d%% + Membungkus + Memulakan semula DroidDeck padanya + Selesai + Gagal: %1$s + Sediakan agen + Pasang runtime Linux dalam Setup terlebih dahulu. + Cuba semula + Mula berbual + Sambungan peranti + Penyahpepijatan wayarles, supaya agen boleh melihat dan mengawal DroidDeck + Pasang %1$s + Ke dalam userland Linux, dengan git, gh dan adb + Log masuk ke %1$s + Membuka penyemak imbas anda + GitHub + Pilihan, untuk membuka pull request + Alat binaan + Pilihan, untuk binaan Lab pada peranti ini ยท kira-kira 5 GB + Ejen sedia + Lengkapkan persediaan ejen + Sudah log masuk ke %1$s + Binaan Lab + binaan pantas + Binaan Lab pantas + Mengkompil versi ini lebih awal, supaya binaan Lab mengambil masa beberapa minit ยท kira-kira 20 minit sekali sahaja + Mengkompil ยท %1$d%% ยท kira-kira %2$s lagi + Sediakan + Penyahpepijatan wayarles tidak dapat dicapai; Pasangkan menghidupkannya + Pasangkan + Pasang + Log masuk PR #%1$d Tidak dibina untuk salinan DroidDeck ini Dikemas kini %1$s @@ -1241,6 +1466,9 @@ Apl Persediaan Kemas kini + Lagi + Sunting tab + Tab %1$d%% Sambung %1$s Muncul sebagai /root/ROMs dalam setiap sesi. Storan dalaman berada di /root/Storage. @@ -1262,6 +1490,15 @@ Batalkan yang tertangguh Papan kekunci Android Sembunyi โœ• + Saiz pada skrin + Bahagian skrin yang digunakan papan kekunci, termasuk pengepala. + Kelegapan + Turunkan untuk melihat permainan di belakang papan kekunci. + Kekunci tersembunyi + Kekunci yang jarang digunakan tidak dipaparkan pada papan kekunci. + Esc dan baris kekunci fungsi + Ins / Del / Home / End / PgUp / PgDn + Kekunci anak panah Lancarkan %1$s Pilih skrin. Kedua: %1$s. Paparan kedua tidak lagi tersedia. @@ -1746,7 +1983,24 @@ Terminal Pemegang Deck + trackpad Papan pemuka + Desktop + Mulakan desktop + Desktop ยท %1$s + Pad jejak + Sentuhan terus + Pad jejak. Ketik untuk sentuhan terus + Sentuhan terus. Ketik untuk pad jejak + Memulakan desktop KDEโ€ฆ + Desktop telah ditutup. + Desktop tidak dapat dimulakan. Lognya ada dalam folder bottom-desktop sesi ini. + Desktop ditutup. Belum ada apa-apa untuk dipaparkan di sini. + Tukar skrin + Skrin bawah tidak tersedia buat masa ini + Skrin permainan + Tunjukkan permainan pada + Skrin atas + Skrin bawah Muat turun Tiada muat turun yang sedang berjalan. Steam @@ -1781,6 +2035,20 @@ Bahan api, t Utama %1$s t Simpanan %1$s t + Masa bingkai + %1$d s terakhir + purata bingkai + 1% terendah + bingkai melebihi 33 ms + %1$d / min + Bermain selama %1$s + %1$d teras, sehingga %2$s GHz + %1$d teras + permainan + FPS pada %1$d Hz + Tanda merah ialah tempat HUD memaparkan suhu dalam warna merah. + seluruh peranti + bateri Hantar data papan pemuka Automatik Menghidupkannya untuk setiap permainan yang disenaraikan di sini, termasuk permainan yang ditemui kemudian. Permainan yang anda matikan kekal mati. @@ -1804,6 +2072,10 @@ Mikrofon dimatikan untuk permainan ini. Untuk bercakap, hidupkan Mikrofon dalam tetapan Steam DroidDeck (Audio) dan mulakan permainan semula. Kelantangan %1$d%% Statistik dalam permainan + HUD skrin bawah + Jalur pada setiap tab + 1% dan 0.1% terendah + Suhu CPU FPS CPU GPU @@ -1975,6 +2247,7 @@ Memulakan sesiโ€ฆ %1$d:%2$02d berlalu ยท masih berjalan Memuat turun kemas kini klien Steam ยท %1$d%% + Memasang kemas kini klien Steamโ€ฆ Memuat turun klien Steam ยท %1$s Pemasangan alat keserasian sudah berjalan @@ -2051,11 +2324,29 @@ Garis luar kartun tambah ketajaman. Bukan GPU Adreno + Pemandu sistem PowerVR: keserasian berbeza mengikut peranti + Eksperimen: RADV atau pemandu sistem Xclipse + PowerVR sistem + Menggunakan pemandu terbina dalam untuk GPU ini + Pemandu PowerVR sistem dipilih untuk masa jalan dan paparan. + Tiada pemandu sumber terbuka yang menyokong Mali ini setakat ini: jambatan Mali dihidupkan. + Ini ialah binaan ujian bukan Snapdragon: binaan rasmi di sini hanya berjalan pada Adreno, jadi binaan-binaan itu tidak dipasang menggantikannya. Binaan ujian baharu terdapat di github.com/The412Banner/droiddeck-nonadreno-drivers. + Sesi terakhir tamat kerana Android menutup DroidDeck untuk membebaskan memori, bukan kerana ranap. Tutup aplikasi lain atau kurangkan tetapan tekstur permainan, kemudian cuba lagi. + Mali (Venus) + jambatan Mali + Tiada pemandu sumber terbuka yang menyokong Mali ini setakat ini: %1$s digunakan, dengan pemandu asal telefon. + %1$s belum diterbitkan: %2$s digunakan sehingga ia diterbitkan. + %1$s tidak tersedia, dan pemandu telefon ini melaporkan Vulkan %2$s (Venus memerlukan Vulkan 1.2): jambatan Mali digunakan. + %1$s belum diterbitkan: jambatan Mali dihidupkan sehingga ia diterbitkan. + Dalam baris gilir: %1$s (menunggu pemandu masa jalan yang lain) + DXVK disediakan oleh persekitaran masa jalan PowerVR sistem. Pakej DXVK lain boleh disimpan tetapi tidak digunakan dengan pemandu ini. Disokong Eksperimen: pemacunya ialah binaan ujian Sokongan eksperimen Adreno 850: memerlukan pemacu paparan dan permainan eksperimen yang serasi; belum disahkan pada peranti ini Di bawah perkakasan yang diuji (Adreno 725 dan lebih baharu): mungkin tidak dapat berjalan Tidak disokong: tiada backend grafik yang serasi tersedia untuk GPU ini + Berjalan melalui jambatan Mali, menggunakan pemandu Vulkan asal telefon + Tidak disokong apabila jambatan Mali dimatikan: Turnip memerlukan GPU Adreno (Snapdragon) Had kadar GitHub dicapai - cuba lagi kemudian GitHub menjawab HTTP %1$d @@ -2164,7 +2455,6 @@ Kedai Steam Tersuai - Kedai Tahap kelajuan muat turun Seimbang Pantas @@ -2203,6 +2493,7 @@ Menunggu muat turun Battle.net yang lainโ€ฆ Buka Battle.net dan log masuk sekali, kemudian pasang permainannya dari sini. Pemuat turun Blizzard berhenti: %1$s + Pemuat turun Blizzard berhenti bergerak. Ralat Blizzard %1$s Kemas kini Permainan Blizzard @@ -2210,6 +2501,7 @@ Terganggu Pasang ยท %1$s Dapatkan percuma + Menambah ke pustakaโ€ฆ Lihat pada %1$s Beli ยท %1$s Dipasang @@ -2256,6 +2548,12 @@ Isih Label bar sisi Paparkan nama di bawah ikon bar sisi. Matikan untuk bar sisi yang lebih ramping. + Haiwan peliharaan ejen + DeeDee terapung di atas pelancar dan permainan serta menunjukkan apa yang sedang dilakukan oleh ejen. + Di atas apl lain + Benarkan DeeDee terapung di atas setiap apl dan buka sembangnya di situ + Benarkan + Sembang dengan DeeDee Paparan Kad lebih besar Kad lebih kecil @@ -2538,7 +2836,14 @@ %1$s ยท perlu mula semula Peranti ini Alih keluar %1$s? - Diagnostik + Pembangun + Tera air label binaan + Paparkan label binaan ujian atau Lab pada skrin. Dihidupkan secara lalai. + Kongsi himpunan diagnostik + Sesi dan peranti + Grafik + Permainan dan keserasian + Semua himpunan Sedia untuk bermain Belum sedia untuk bermain masa jalan %1$s @@ -2577,6 +2882,9 @@ Hidupkan pencapaian GOG dalam tetapan Stores Pencapaian tidak tersedia; semak log sesi Pencapaian dibuka kunci + Mali (Venus): dimatikan + Mali (Venus): dihidupkan + Pemandu pada %1$s melaporkan Vulkan %2$s. Mali (Venus) memerlukan Vulkan 1.2 atau lebih baharu (gamescope tidak bermula pada versi lebih lama), jadi sesi melangkau Venus dan menggunakan pasangan pemandu PanVK sebaliknya. Tampal Kayu bedik kiri Kayu bedik kanan @@ -2861,7 +3169,7 @@ Pilih folderโ€ฆ Gunakan mana-mana folder pada kad SD atau pemacu USB Permainan dimasukkan ke dalam folder Games di dalam lokasi yang dipilih. Permainan sedia ada tidak dipindahkan. - Ke mana perginya + Apa yang guna ruang Permainan Steam Data permainan Awalan %1$s ยท workshop %2$s ยท shader %3$s @@ -2930,6 +3238,7 @@ Pemasangan VC++ dan DirectX yang diperlukan permainan Menjalankan permainan Linux x86 Alat Steam + Steam memuat turun ini untuk permainan yang menyertakan anti-cheat, walaupun anti-cheat itu dimatikan. Membuangnya menyebabkan pemasangan permainan itu terhenti pada 0% DroidDeck menjalankan permainan tanpa runtime ini Proton x86, yang tidak dapat dijalankan oleh DroidDeck Lalai untuk semua permainan @@ -2993,6 +3302,19 @@ Disimpan Permainan bukan Steam dan awalan Steam dikongsi Awalan permainan daripada kedai atau yang ditambah sendiri + Awalan Steam dikongsi + Steam menjalankan pembantu Windowsnya sendiri di sini + Memadamnya (%1$s). Steam mencipta yang baharu apabila memerlukannya lagi. + Aplikasi kedai dan permainan yang berjalan dengannya + Digunakan oleh %1$s + Permainan bukan Steam %1$s + Tidak sepadan dengan mana-mana permainan, jadi ia disimpan + Alih keluar yang dipilih ยท %1$s + Nyahpasang yang dipilih ยท %1$s + Prefix Wine + Simpanan dan tetapan di dalamnya akan hilang; simpanan Steam Cloud kekal dalam akaun anda. + Cache shader + Awalan %1$s ยท shader %2$s Pakej yang dimuat turun Fail asal yang disimpan Tiada pakej komponen dimuat turun. @@ -3027,6 +3349,8 @@ DroidDeck ยท %1$d fps 60 fps kelihatan lebih lancar tetapi menggunakan lebih banyak CPU semasa Steam bermula. Video yang dipilih dalam tetapan Steam sendiri turut dipaparkan di sini. Bunyi + Langkau filem permulaan + Gunakan klip hitam 0.1 saat sebagai filem permulaan Steam. Berkuat kuasa pada sesi seterusnya. Video anda sendiri MP4, MOV, MKV atau WebM. Format lain dan fail melebihi %1$d MB ditukar kepada WebM 720p pada peranti, sehingga %2$d saat. Import @@ -3488,6 +3812,7 @@ Mengekalkan Alt+Tab, kekunci Win dan butang Utama dalam sesi DroidDeck yang aktif, bukan Android. Hidupkan Kecerahan dalam Persediaan โ†’ Integrasi Steam Jambatan Mali: mati + %1$s tidak boleh menggunakan jambatan Mali (jambatan itu memerlukan GPU Mali tanpa laluan pemandu sistem), jadi suis ini tidak memberi kesan di sini. Jambatan Mali: hidup %1$s bukan Adreno. Jambatan Vulkan eksperimen dihidupkan: sesi melukis melalui pemacu telefon itu sendiri. Jangkakan pepijat; hantar log sesi. Mod selamat @@ -3513,6 +3838,25 @@ Alih ke belakang Tetapan widget Alih keluar widget + Rupa + Pek ikon + Lalai sistem + Latar warna apl + Saiz ikon + Kecil + Sedang + Besar + Sembunyikan nama apl + Jarak + Rapat + Biasa + Luas + Tukar ikon + Set semula ikon + Cari ikon + Memuatkan ikonโ€ฆ + Tiada ikon ditemui. + Ikon tersuai Tambah pada folder Folder baharu Alih keluar daripada folder @@ -3627,5 +3971,81 @@ Susun atur ini tidak dapat diimport Salji Merah Skarlet + Permukaan putih dengan aksen merah. + Runut bunyi + Muzik + Pilihan main balik + Kegemaran + Koleksi + Belum ada koleksi. Ketik ikon penanda buku untuk mencipta satu. + Disimpan + Cipta koleksi + Susun simpanan anda + Baharu + Cipta + Nama koleksi + Masukkan nama yang tidak digunakan oleh koleksi lain + Urus + Namakan semula + Tambah lagu + Tambah (%1$d) + Alih keluar lagu + Padam koleksi + Padam %1$s? + Lagu kekal pada peranti anda. Hanya koleksi dialih keluar. + Pilih + Pilih semua + Nyahpilih semua + %1$d dipilih + Tambah ke koleksi + Tambah ke kegemaran + Alih keluar daripada koleksi + Cari lagu + Susunan album + Terpanjang dahulu + Terpendek dahulu + Lagu + Pic + Tetapkan semula + Langkau senyap + Pemasa tidur + %1$d min + Hujung lagu + %1$s lagi + Penyama + Peningkat bes + Penyama tidak tersedia pada peranti ini + Dayakan dalam permainan + Teruskan memainkan runut bunyi semasa permainan berjalan + Belum ada runut bunyi dipasang. + Cari runut bunyi + Tambah folder runut bunyi + Tiada fail audio dalam folder itu + Jumlah tempoh + %1$d trek / %2$s + Cakera %1$s + Rawak + Sebelumnya + Main + Jeda + Seterusnya + Ulang dimatikan + Ulang semua + Ulang satu + Kelantangan + Tiada fail audio dalam runut bunyi ini + Pelancaran tidak tersedia + Tiada penyemak imbas web tersedia untuk membuka pautan ini. + Ambil + Lepas + Simpan + Tahan untuk set semula + Kedai + Masa bingkai + Purata kadar bingkai + Pelayan paparan + Keadaan HDR + Dipaparkan + %1$d daripada %2$d diff --git a/app/src/main/res/values-nb/input_library.xml b/app/src/main/res/values-nb/input_library.xml new file mode 100644 index 0000000000..e810fed5a4 --- /dev/null +++ b/app/src/main/res/values-nb/input_library.xml @@ -0,0 +1,132 @@ + + + Ulesbare inndata-innstillinger ble bevart i en gjenopprettingskopi. Du kan fortsette รฅ redigere de gjenopprettede profilene. + Egenskaper + Egenskaper for klikk + %1$s ยท Klikk + Knapper + Stikker, puter og avtrekkere + Skjul verktรธy + Kontroller + Send kontrollerinndata til Steam Input eller spillet. + Dette elementet sender ingen inndata fra kontroller, mus eller tastatur. + Museklikk + DroidDeck-handling + Handling + Rullehastighet: %1$d trinn/s + + Ny profil + + Nytt oppsett + %1$s ยท Brukes av %2$d profiler. Endringer gjelder for alle profiler som bruker disse tildelingene. + Gi nytt navn + Slett + Legg til elementer i oppsettet fรธr du tildeler handlingene deres. + Kunne ikke lagre inndata-innstillingene + Navn + Start fra + Knapp + Stikke + Styreflate + Retningskryss + Avtrekker + Ferdig + Angre + + Legg til + Dra for รฅ flytte. Dra i et hjรธrne for รฅ endre stรธrrelse. Trykk pรฅ Egenskaper for รฅ tildele en handling. + Redigeres pรฅ sekundรฆrskjermen + Den valgte skjermen er ikke tilgjengelig. Koble den til for รฅ redigere dette oppsettet i full stรธrrelse. + Forkaste ulagrede oppsettendringer? + Dette oppsettet brukes av %1$d profiler. Lagrede endringer gjelder for alle. + Standardprofiler + Skrivebordsmodus + Spillmodus + Standard for skrivebord og spill + Standard for spillmodus + Standard for skrivebordsmodus + Enhetsinnstillinger + Kontroller + Knapper, stikker, avtrekkere og ekstra taster + Kopier profil + Tilbakestill handlinger + Tilbakestille handlingene i %1$s til basisprofilens standardverdier? Oppsett og andre profiler forblir uendret. + Slette %1$s? Moduser som bruker den gรฅr tilbake til sin innebygde standardprofil. Lagrede oppsett og delte innstillinger forblir tilgjengelige. + Synlighet + Gjelder alle profiler. Auto viser hovedskjermens kontroller nรฅr ingen kontroller er tilkoblet i spillmodus. + Rediger pรฅ skjermen + Lagrede oppsettโ€ฆ + Velg et oppsett eller lag ditt eget + Velg Profilkontroller i รธktmenyen pรฅ sekundรฆrskjermen. Profil- og Sekundรฆrskjerm-valgene i kontrollermenyen bestemmer hvilke kontroller som vises. + Knapphandlinger + Delt med %1$s. Endringer gjelder ogsรฅ disse profilene. + Bruk innstillinger pรฅ nytt + Bruk innstillinger fraโ€ฆ + Kopier fra en annen profil eller behold innstillingene delt + Gjรธr uavhengig + Behold dagens oppsett og slutt รฅ dele endringer + Oppsett lagrer elementer og posisjonene deres. Hver profil kan tildele egne handlinger. Rediger i full stรธrrelse pรฅ mรฅlskjermen. + Gjeldende oppsett + Slette det ubrukte oppsettet %1$s og de lagrede handlingene? + Gi gjeldende oppsett nytt navn + Bruk %1$s pรฅ nytt fra en annen profil. De andre kontrollkildene forblir uendret. + Behold fysiske kontroller delt + Som standard er alle kontroller og egendefinerte oppsett uavhengige kopier. Deling kobler bare de fysiske kontrollene. + Bruk disse elementene og posisjonene. Deling holder fremtidige geometriendringer synkronisert; knapphandlingene dine forblir uavhengige. Et annet oppsett starter med utildelte handlinger. + Kopier disse kontrollene og handlingene, eller koble dem slik at fremtidige endringer gjelder begge profilene. + Behold delt + Uavhengig kopi + Start stikka ved berรธringspunktet + Skjul stikka nรฅr den ikke brukes + Verktรธy + Auto (%1$s) + Egendefinert (%1$s) + Lagre som ny profil + Profilkontroller + Profil + Musestyreflatebevegelser + Nรฅr tilordnet musepekeren: trykk for รฅ klikke, hold for รฅ dra, og rull med to fingre. + %1$s har en overstyring av hurtigmenyen. Velg Auto der for รฅ bruke standardprofilen og alle tre lagrede delene. + DroidDeck-inndata + Holdes mens stikka flyttes i en hvilken som helst retning: trykk over 55 %, slipp under 35 %. Bruk Retningstaster for รฅ tildele hver retning separat. DroidDeck-kommandoer kjรธres รฉn gang per utslag. Stikkklikket konfigureres separat. + Holdes mens du berรธrer styreflaten; slippes nรฅr du lรธfter fingeren. DroidDeck-kommandoer kjรธres รฉn gang per berรธring. Styreflateklikket konfigureres separat. + Holdes nรฅr avtrekkeren passerer 55 %; slippes under 35 %. DroidDeck-kommandoer kjรธres รฉn gang per trykk. + Rulleretning + Loddrett + Vannrett + Rull vannrett + Mรฅlinger + Slรฅ pรฅ opptak, bruk kontrollene i en kjรธrende รธkt, og kom tilbake og les resultatene. Mรฅler bare DroidDeck-utsendingstiden, ikke skjermforsinkelse. Opptaket avsluttes nรฅr appprosessen lukkes. + %1$d kontroller + Andre lagrede oppsett (%1$d) โ–พ + Skjul andre lagrede oppsett (%1$d) โ–ด + Hjem / Guide + Tilbake ยท enkelt trykk + Tilbake ยท dobbeltrykk + Tilbake ยท to ganger i Steam, รฉn gang pรฅ skrivebordet + I Steam-modus. ร… holde Tilbake รฅpner ogsรฅ hurtigtilgang. + Tilbakestill til standard + Panelvalget ditt huskes. Skrivebord รฅpner et andre arbeidsomrรฅde; det bytter ikke รธkten eller inndataprofilen. + Virtuell kontroller + Kontrollertypen som Steam eller spillet ser. + Berรธringsskjerm + Hvordan berรธringer pรฅ spillskjermen hรฅndteres. Profilknappene beholder sine tilordnede handlinger. + Berรธringsmarkรธr + Vis en peker for direkte berรธringer pรฅ spillskjermen. + Berรธr og hold + Musehandling nรฅr du holder en finger pรฅ spillskjermen. + Trykk pรฅ Tilbake-knappen + Fรธrste handling: enkelt trykk. Andre handling: dobbeltrykk. + Veksleknapp + Trykk for รฅ holde, trykk igjen for รฅ slippe. ร… รฅpne en meny eller bytte profil slipper knappen. + Form + Avrundet + Pille + Sirkel + Rektangel + Knappetekst + Tekst + Importert bilde + Separate diagonalknapper + Tilordne en tast til hver diagonal. En tom diagonal trykker de to naboretningene. + Naboretninger + De gamle skjermtastene dine er lagret som importerte profiler nedenfor. Velg en for รฅ bruke eller redigere den. Dine nรฅvรฆrende profilvalg er beholdt. + De gamle skjermtastene kunne ikke importeres automatisk. De opprinnelige innstillingene er beholdt. + diff --git a/app/src/main/res/values-nb/input_strings.xml b/app/src/main/res/values-nb/input_strings.xml new file mode 100644 index 0000000000..92e1af4eff --- /dev/null +++ b/app/src/main/res/values-nb/input_strings.xml @@ -0,0 +1,38 @@ + + + Inndataprofiler + Profiler + Fysisk kontroller + Hovedskjerm + Sekundรฆrskjerm + Innebygd / Steam Input + Innebygd: %1$s + Send en annen kontrollerkontroll + Deaktivert + Tast eller tastekombinasjon + Retningstaster + Flytt pekeren + Pekerhastighet: %1$d + Rull + Rull loddrett + Venstre museknapp + Hรธyre museknapp + Midtre museknapp + ร…pne DroidDeck-menyen + Vis tastatur + ร…pne Steam-menyen + ร…pne Steams hurtigtilgang + Fjern kontroll + Legg til kontroll + Enhetsspesifikke knapper + Tildel en fysisk knapp + Slipp knappen, og velg Rediger, Prรธv igjen eller Avbryt. B eller Tilbake avbryter etter slipp. + Prรธv igjen + Trykk pรฅ en knapp, ogsรฅ en Tilbake-knapp som rapporteres som tast. Volum- og Android-systemtaster er reservert. Tildelingen gjelder bare denne enheten. + Fjern tildeling + Inndatadiagnostikk + Ta opp inndataforsinkelse + Les mรฅlinger + Mรฅler forsendelsen fra Android til publisering i den eksisterende inndatatransporten. Bluetoothtilkobling, gjestepolling, gjengivelse og skjermforsinkelse er ikke med. Opptak er av som standard. + Bruk vanlig inndatatildeling + diff --git a/app/src/main/res/values-nb/strings.xml b/app/src/main/res/values-nb/strings.xml index 8ac2561bab..43678cb4ad 100644 --- a/app/src/main/res/values-nb/strings.xml +++ b/app/src/main/res/values-nb/strings.xml @@ -28,6 +28,8 @@ Sett pรฅ pause nรฅ Avslutt sesjon Bildegenerering + Innstillinger for dette spillet + Standardinnstillinger Velg modus for bildegenerering Av DD-FG %1$dร— @@ -183,6 +185,7 @@ PowerVR-grafikkmiljรธet kunne ikke lastes ned. Sjekk tilkoblingen og prรธv igjen. Kunne ikke laste ned DirectAudio, sรฅ spillyd bruker den tregere veien i denne sesjonen. Dette programmet + ร˜kten kunne ikke tegne pรฅ skjermen: %1$s. Denne skjermen viser hvorfor i stedet for en svart skjerm; detaljene finnes i loggene for รธkten. Kunne ikke laste ned Steam-klienten. Nettverket eller VPN-en din blokkerer kanskje Steams servere; sjekk tilkoblingen og prรธv igjen. Kunne ikke sette opp Steam-klienten. Sjekk tilkoblingen og ledig lagringsplass, og prรธv igjen. %1$s er bygget for x86-PC-er og kjรธrer via FEX, som ikke er installert ennรฅ. Start Steam รฉn gang mens du er innlogget, og la den laste ned FEX og Steam Linux Runtime, og start dette pรฅ nytt. @@ -385,6 +388,9 @@ Ikke stรธttet her ennรฅ Laster komponenteneโ€ฆ Kunne ikke installere: %1$s + Denne nedlastingen trenger en oppdatering. + Oppdateringen er lagt i kรธ. + Prรธv oppdateringen pรฅ nytt Lastet ned Laster ned %1$s Installerer: %1$s @@ -415,6 +421,22 @@ Bare intern Mappe: %1$s Andre bibliotek + Flere Steam-biblioteker + Mapper som Steam kan installere til og spille fra, hver under sitt eget navn. Fjerner du ett, blir spillene liggende pรฅ disken. + Legg til bibliotek + Endre navn + Biblioteknavn + Velg en mappe for biblioteket + Hรธyst %1$d biblioteker kan legges til + Den mappen er allerede et bibliotek eller ligger inne i ett + %1$s ยท ikke tilgjengelig + Gjelder fra neste Steam-รธkt + Funnet pรฅ denne enheten ยท %1$s ยท %2$s + Legg til + Finn biblioteker pรฅ intern lagring + Tillat tilgang til alle filer, slik at DroidDeck kan se Steam-biblioteker som andre apper lagrer pรฅ intern lagring + Tillat + La til %1$s, Steam-biblioteket inne i mappen du valgte Spill som strรธmmer ressurser fra SD-kort eller delt lagring kan hakke. Lagringsdiagnostikk Lagrer tildelingsresultater og tidsmรฅlinger for lagring i Del logger. Kan gjรธre installasjoner tregere mens dette er pรฅ. Gjelder fra neste sesjon. @@ -478,6 +500,7 @@ Pรฅ Starter med Steam Starter uten Steam + Spillopplรธsning Innstillinger Innstillinger for %1$s Standard @@ -565,6 +588,8 @@ Spillkjerner Spillkjerner Kjerner for spill. Med alle valgt, planlegger Android fritt. + Spar strรธm i stabile spill + Kjรธrer et spill pรฅ de tregere kjernene mens det holder en stabil bildefrekvens, og flytter det tilbake til de vanlige kjernene nรฅr det henger etter. Klientgrensesnitt Trรฅdet GL Kan gjรธre Steam-menyer mer responsive. @@ -600,7 +625,10 @@ Slรฅr av Protons hjelper for kontrollernavigasjon, som koster CPU i hvert spill. Kjรธr proot uten seccomp Kan fikse feil om manglende systemkall pรฅ noen kjerner. Kan redusere ytelsen. + Kjรธr uten proot (eksperimentelt) + Starter Linux-delen direkte pรฅ Android. Gjelder fra neste รธkt. Slรฅ av hvis noe ikke starter. proot-hurtigvei + Brukes ikke uten proot. Krever prootens seccomp-filter. Raskere filoppslag og mindre hakking. Slรฅ av hvis et program ikke finner filene sine. Tegn markรธren i gamescope @@ -683,6 +711,7 @@ Grafikkminne Swap-minne Batterinivรฅ + Gjenvรฆrende batteritid Strรธmforbruk Nettverk Opplรธsning @@ -809,6 +838,7 @@ Enheten er stรธttet Utestet GPU GPU ikke stรธttet + GPU via Mali-bro %1$s ยท %2$s %1$s: %2$s Ingen kompatibel grafikkbackend er tilgjengelig for %1$s. Steam kan vise en svart skjerm. @@ -838,15 +868,38 @@ Sesjon Sesjonslogger Lagret etter hver sesjon + Utvidet diagnostikk for neste รธkt + Samler inn detaljerte logger for รฉn รธkt. Kan redusere ytelsen og bruke mer lagringsplass. Slรฅr seg av nรฅr รธkten starter; se gjennom loggene fรธr du deler. Feilsรธkingslogger for spill Ta med diagnostikk for Proton, Wine og grafikk ved neste spillstart. Kan redusere ytelsen og bruke mer lagringsplass. Start denne sesjonen pรฅ nytt for รฅ lagre feilsรธkingslogger for spill Kunne ikke oppdatere loggingen. Sjekk bryteren og prรธv igjen. Feilsรธkingsverktรธy + Detaljerte grafikklogger + Steam-grensesnitt: GPU-tegning + Med Xclipse-driverparet tegner Steam sidene sine i programvare (GPU-tegning viste รธdelagte fliser). Slรฅ pรฅ for et raskere Steam-grensesnitt hvis det ser riktig ut pรฅ denne telefonen. + bygget %1$s + %1$s oppdatert til det nyeste bygget + Mali-broen bestod ikke selvtesten pรฅ %1$s under forrige รธkt (bilder eller tegnekall), sรฅ รธkten brukte PanVK-driverparet i stedet. + Mali-broen fant ingen mรฅte รฅ dele minne med driveren pรฅ %1$s under forrige รธkt, sรฅ รธkten brukte PanVK-driverparet i stedet. Broen kan ikke fungere pรฅ denne telefonen; hvis du slรฅr den av, beholder du PanVK-paret. + Proton-, DXVK- og driverloggene for hvert spill tas med i รธktens logger. Alltid pรฅ nรฅr GPU-en ikke er en Adreno. Nyeste sesjonslogger Lagrede sesjonslogger Beholder de %1$d nyeste Tรธm logger + Tilgjengelige รธktlogger + Ingen lagrede รธktlogger ennรฅ. + Delte og lagrede ZIP-filer inneholder den valgte รธkten samt tilhรธrende diagnostikk for Steam, butikker, verktรธy og Battle.net. + %1$s ยท %2$s + Gjeldende รธkt + Del + Lagre pรฅ enheten + Slett + Slette รธktlogger? + Slette %1$s? Dette kan ikke angres. + ร˜ktlogger lagret. + Kunne ikke lagre รธktlogger. + Kunne ikke slette รธktlogger. Tilbakestill alle innstillinger Sett hver innstilling tilbake til standardverdien Tilbakestill @@ -873,6 +926,8 @@ Bruk som Hjem-skjerm DroidDeck kan vรฆre Hjem-appen DroidDeck tilbys aldri som en Hjem-app + Hjem-knappen รฅpner + Siden som vises nรฅr DroidDeck er startappen og du trykker pรฅ Hjem I Legg til spill setter du DroidDeck til Inkluder Retning Retning for launcheren @@ -886,15 +941,22 @@ Fullskjerm Skjuler Androids status- og navigasjonslinjer Viser Androids status- og navigasjonslinjer + Startprogram pรฅ to skjermer + Automatisk plasserer startprogrammets deler (Steam, Bibliotek, Butikker og resten) pรฅ den andre skjermen pรฅ hรฅndholdte enheter med innebygd sekundรฆrskjerm. Pรฅ bruker en hvilken som helst annen skjerm. Av holder startprogrammet pรฅ รฉn skjerm. + ร˜kter pรฅ to skjermer + Automatisk fester spillmenyen til den innebygde sekundรฆrskjermen i stedet for รฅ vise den som et overlappende vindu. Pรฅ bruker en hvilken som helst annen skjerm. Av holder menyen pรฅ spillskjermen; du kan fortsatt velge en annen skjerm i menyen. Automatisk Pรฅ Av Kontroller pรฅ nederste skjerm i spill + Android-tastatur for tekstfelt ร…pner styreflaten og tastaturet pรฅ den andre skjermen nรฅr en รธkt starter. Skriver for den รธverste skjermen Ferdig Standard Hjem-app Velg en Hjem-app + Skjul startappen fra Siste apper mens den er inaktiv + Gjelder bare nรฅr DroidDeck er standard startapp og ingen รธkt kjรธrer. Velg Linux-apper (beta) Filer @@ -1006,9 +1068,172 @@ Preview Nyeste fikser, fรธr Stable Oppdatert + Kopier byggdetaljer + Byggdetaljer kopiert + Foran Preview + Du er foran Preview + Dette bygget er nyere enn siste Preview. Neste Preview-bygg oppdaterer det. + Velg et bygg for รฅ se endringene eller installere det. + Installert + Installer dette bygget%1$s + Gรฅ tilbake til dette bygget%1$s + versionCode %1$d + Commit %1$s + Utgivelsesside + PR-en har en nyere commit (%1$s). Testbygget for den er ikke klart ennรฅ, sรฅ dette inneholder den ikke. + Nyere commit, bygg venter + PR-nummer, tittel eller forfatter + Ingen testbygg passer + Mรฅ bygges pรฅ nytt (versionCode %1$d) + Oppdateringer for testbygg + Nytt testbygg for PR #%1$d + %1$s. ร…pne Oppdateringer for รฅ installere det. + Vis flere (%1$d) + Mรฅ bygges pรฅ nytt for versionCode %2$d (%1$d) + Preview-bygg pรฅ main siden dette testbygget: %1$d Testbuilder Prรธv en fiks fรธr den blir utgitt Ingen akkurat nรฅ + Lab-bygg + Lab-bygg + I bruk + Satt pรฅ pause etter at Android optimaliserte DroidDeck pรฅ nytt + Ikke lastet inn: %1$s + Venter pรฅ omstart + Beholdt + For en annen versjon + Bygg pรฅ nytt + Sletter dette bygget fra enheten + Start pรฅ nytt med bygget + Slรฅ av + Bruk + Slett + Slett nรฅ + Kunne ikke klargjรธre omstarten: %1$s. Par trรฅdlรธs feilsรธking i Oppsett og prรธv igjen. + Lab-bygg installert + DroidDeck startet pรฅ nytt med %1$s + Lab-bygget er satt pรฅ pause + Android har optimalisert DroidDeck pรฅ nytt, sรฅ %1$s er ikke lastet inn. ร…pne Oppdateringer for รฅ starte pรฅ nytt med det. + Lab-bygget er slรฅtt av + Det ble bygget for en annen versjon av DroidDeck. Det ligger fortsatt i Oppdateringer. + DroidDeck klarte ikke รฅ starte med det to ganger + Agent + Agent + Agenten jobber + Installer Claude Code i Linux-brukermiljรธet for รฅ bruke agenten. + Spรธr om et spill, en krasj eller en endring i DroidDeck + Send + Ny samtale + Stopp + Lagring + Fjern + Fjern nรฅ + Claude Code + Codex + DroidDeck-kildekode + Nedlastingshurtiglagre + Endringer som ikke pushes, gรฅr tapt + Bygg laster dem ned pรฅ nytt + Oppsettet kan installere det pรฅ nytt; innloggingene beholdes + DroidDeck startet pรฅ nytt med Lab-bygget ditt. Fortsett der du slapp. + Spรธr den hvorfor et spill ikke starter, be den forklare en logg, eller fรฅ den til รฅ endre DroidDeck og prรธve endringen pรฅ denne enheten. + Mislyktes: %1$s + %1$s avsluttet (avslutningskode %2$d) + Stoppet + Avsluttet uten svar + Prรธv igjen + Setter opp agenten + Bygg Lab-bygget mitt %1$s pรฅ nytt for den installerte versjonen av DroidDeck, og start pรฅ nytt med det. + %1$s inn ยท %2$s ut + Tenker + Tanke + Tenker ยท %1$s + %1$s ยท %2$s + INNDATA + UTDATA + Kjรธrerโ€ฆ + Ingen resultat: runden ble avsluttet fรธrst + Ingen utdata + Skriv for รฅ legge neste melding i kรธ + Legg i kรธ + Neste: %1$s + Ikke send + Legg ved + Fjern + Standard + Resonneringsinnsats + Gรฅ videre + Revider + Ingen endringer ennรฅ + Gรฅ videre med planen. + Send nรฅ + Mer + Lukk + Nyeste + Arbeider + Kontekst + %1$s av %2$s + Denne samtalen ยท %1$s + Forbruket vises etter det fรธrste svaret + %1$d-timersgrense + %1$d-minuttersgrense + Ukentlig grense + %1$d%% ยท nullstilles %2$s + + %1$d fil + %1$d filer + + Planlegg fรธrst + Plan + Foreslรฅr en plan uten รฅ endre noe + Samtaler + Ingen samtaler ennรฅ + Akkurat nรฅ + Slett + Sletter den og vedleggene + Prosesser + Ingenting kjรธrer i Linux-brukerlandet + AGENT + Stopp + Lab-bygg + Forbereder Lab-bygg + %1$d%% ยท ca. %2$s igjen + ca. %1$s igjen + Avbryt + Avbryt byggingen + Starter + %1$d%% + Pakker + Starter DroidDeck pรฅ nytt pรฅ den + Ferdig + Feilet: %1$s + Sett opp agenten + Installer Linux-runtime i Oppsett fรธrst. + Prรธv igjen + Begynn รฅ chatte + Enhetstilkobling + Trรฅdlรธs feilsรธking, sรฅ agenten kan se og styre DroidDeck + Installer %1$s + I Linux-brukerlandet, med git, gh og adb + Logg inn pรฅ %1$s + ร…pner nettleseren din + GitHub + Valgfritt, for รฅ opprette pull-forespรธrsler + Byggeverktรธy + Valgfritt, for Lab-bygg pรฅ denne enheten ยท ca. 5 GB + Agenten er klar + Fullfรธr oppsettet av agenten + Logget inn pรฅ %1$s + Lab-bygg + raske bygg + Raske Lab-bygg + Kompilerer denne versjonen pรฅ forhรฅnd, slik at Lab-bygg tar minutter ยท ca. 20 minutter รฉn gang + Kompilerer ยท %1$d%% ยท ca. %2$s igjen + Forbered + Trรฅdlรธs feilsรธking er ikke tilgjengelig; Par slรฅr den pรฅ + Par + Installer + Logg inn PR #%1$d Ikke bygget for denne kopien av DroidDeck Oppdatert %1$s @@ -1248,6 +1473,9 @@ Apper Oppsett Oppdateringer + Mer + Rediger faner + Faner %1$d%% Gjenoppta %1$s Vises som /root/ROMs i hver sesjon. Intern lagring er pรฅ /root/Storage. @@ -1269,6 +1497,15 @@ Avbryt i kรธ Android-tastatur Skjul โœ• + Stรธrrelse pรฅ skjermen + Andelen av skjermen tastaturet tar, inkludert toppfeltet. + Ugjennomsiktighet + Senk den for รฅ se spillet bak tastaturet. + Skjulte taster + Taster du sjelden bruker vises ikke pรฅ tastaturet. + Esc og funksjonsrad + Ins / Del / Home / End / PgUp / PgDn + Piltaster Start %1$s Velg en skjerm. Sekundรฆr: %1$s. Den sekundรฆre skjermen er ikke tilgjengelig lenger. @@ -1770,7 +2007,24 @@ Terminal Deck-grep + styreflater Dashbord + Skrivebord + Start skrivebordet + Skrivebord ยท %1$s + Styreflate + Direkte berรธring + Styreflate. Trykk for direkte berรธring + Direkte berรธring. Trykk for styreflate + Starter KDE-skrivebordetโ€ฆ + Skrivebordet ble lukket. + Skrivebordet kunne ikke starte. Loggene ligger i bottom-desktop-mappen for denne รธkten. + Skrivebordet er lukket. Ingenting รฅ vise her ennรฅ. + Bytt skjermer + Bunnskjermen er ikke ledig akkurat nรฅ + Spillskjerm + Vis spillet pรฅ + Toppskjermen + Bunnskjermen Nedlastinger Ingen nedlastinger pรฅgรฅr. Steam @@ -1805,6 +2059,20 @@ Drivstoff, t Hoved %1$s t Reserve %1$s t + Bildetid + siste %1$d s + Gjennomsnittlig bildetid + Laveste 1 % + Bilder over 33 ms + %1$d / min + Spilt i %1$s + %1$d kjerner, opptil %2$s GHz + %1$d kjerner + spill + FPS pรฅ %1$d Hz + Den rรธde markeringen er der HUD-en viser temperaturen i rรธdt. + hele enheten + batteri Send dashborddata Automatisk Slรฅr det pรฅ for alle spill som er oppfรธrt her, ogsรฅ spill som blir funnet senere. Spill du slรฅr av, forblir av. @@ -1828,6 +2096,10 @@ Mikrofonen er av for dette spillet. For รฅ snakke, slรฅ pรฅ Mikrofon i DroidDecks Steam-innstillinger (Lyd) og start spillet pรฅ nytt. Volum %1$d%% Statistikk i spillet + HUD pรฅ bunnskjermen + Stripe pรฅ hver fane + Laveste 1 % og 0,1 % + CPU-temperatur FPS CPU GPU @@ -2000,6 +2272,7 @@ Starter sesjonenโ€ฆ %1$d:%2$02d gรฅtt ยท fortsatt i gang Laster ned Steam-klientoppdateringen ยท %1$d%% + Installerer Steam-klientoppdateringenโ€ฆ Laster ned Steam-klienten ยท %1$s En installasjon av et kompatibilitetsverktรธy kjรธrer allerede @@ -2076,11 +2349,29 @@ Tegnefilm-konturer pluss skarphet. Ikke en Adreno-GPU + PowerVR-driver fra systemet: kompatibiliteten varierer med enheten + Eksperimentelt: RADV eller Xclipse-driver fra systemet + PowerVR fra systemet + Bruker de innebygde driverne for denne GPU-en + Systemets PowerVR-driver er valgt for kjรธretidsmiljรธet og skjermen. + Ingen รฅpen driver stรธtter denne Mali-GPU-en ennรฅ: Mali-broen er slรฅtt pรฅ. + Dette er testbygget for ikke-Snapdragon: de offisielle byggene her kjรธrer bare pรฅ Adreno, sรฅ de blir ikke installert oppรฅ det. Nye testbygg finnes pรฅ github.com/The412Banner/droiddeck-nonadreno-drivers. + Forrige รธkt ble avsluttet fordi Android lukket DroidDeck for รฅ frigjรธre minne, ikke pรฅ grunn av et krasj. Lukk andre apper eller senk spillets teksturinnstillinger, og prรธv igjen. + Mali (Venus) + Mali-broen + Ingen รฅpen driver stรธtter denne Mali-GPU-en ennรฅ: %1$s brukes, pรฅ telefonens egen driver. + %1$s er ikke publisert ennรฅ: %2$s brukes til den er det. + %1$s er ikke tilgjengelig, og driveren pรฅ denne telefonen rapporterer Vulkan %2$s (Venus krever 1.2): Mali-broen brukes. + %1$s er ikke publisert ennรฅ: Mali-broen er slรฅtt pรฅ til den er det. + I kรธ: %1$s (venter pรฅ en annen driver for kjรธretidsmiljรธet) + DXVK leveres av systemets PowerVR-kjรธretidsmiljรธ. Andre DXVK-pakker kan lagres, men blir ikke tatt i bruk med denne driveren. Stรธttet Eksperimentell: driverne er testbuilder Eksperimentell stรธtte for Adreno 850: krever kompatible eksperimentelle skjerm- og spilldrivere; ikke bekreftet pรฅ denne enheten Under testet maskinvare (Adreno 725 og nyere): den kan ikke kjรธre Stรธttes ikke: ingen kompatibel grafikkbackend er tilgjengelig for denne GPU-en + Kjรธrer via Mali-broen, pรฅ telefonens egen Vulkan-driver + Stรธttes ikke nรฅr Mali-broen er av: Turnip krever en Adreno-GPU (Snapdragon) GitHubs hastighetsgrense ble nรฅdd โ€“ prรธv igjen senere GitHub svarte HTTP %1$d @@ -2189,7 +2480,6 @@ Butikker Steam Egendefinert - Butikker Nedlastingshastighetsnivรฅ Balansert Rask @@ -2228,6 +2518,7 @@ Venter pรฅ den andre Battle.net-nedlastingenโ€ฆ ร…pne Battle.net og logg pรฅ รฉn gang, og installer deretter spillene herfra. Blizzards nedlaster stoppet: %1$s + Blizzards nedlaster sluttet รฅ gjรธre fremgang. Blizzard-feil %1$s Oppdater Blizzard-spill @@ -2235,6 +2526,7 @@ Avbrutt Installer ยท %1$s Hent gratis + Legger til i biblioteket โ€ฆ Vis pรฅ %1$s Kjรธp ยท %1$s Installert @@ -2281,6 +2573,12 @@ Sorter Etiketter i sidepanelet Vis navn under ikonene i sidepanelet. Slรฅ av for et smalere sidepanel. + Agentkjรฆledyr + DeeDee flyter over startskjermen og spill og viser hva agenten gjรธr. + Over andre apper + La DeeDee flyte over alle apper og รฅpne chatten sin der + Tillat + Chat med DeeDee Visning Stรธrre kort Mindre kort @@ -2565,7 +2863,14 @@ %1$s ยท krever omstart Denne enheten Fjerne %1$s? - Diagnostikk + Utvikler + Vannmerke for byggetikett + Vis etiketten for test- eller Lab-bygget pรฅ skjermen. Pรฅ som standard. + Del diagnostikkpakker + ร˜kt og enhet + Grafikk + Spill og kompatibilitet + Alle pakker Klar til รฅ spille Ikke klar til รฅ spille ennรฅ kjรธretid %1$s @@ -2604,6 +2909,9 @@ Slรฅ pรฅ GOG-prestasjoner i Store-innstillinger Prestasjoner ikke tilgjengelig; sjekk sesjonsloggene Prestasjon lรฅst opp + Mali (Venus): av + Mali (Venus): pรฅ + Driveren pรฅ %1$s rapporterer Vulkan %2$s. Mali (Venus) krever Vulkan 1.2 eller nyere (gamescope starter ikke pรฅ eldre versjoner), sรฅ รธktene hopper over Venus og bruker PanVK-driverparet i stedet. Lim inn Venstre stikke Hรธyre stikke @@ -2890,7 +3198,7 @@ Velg mappeโ€ฆ Bruk en hvilken som helst mappe pรฅ et SD-kort eller en USB-enhet Spill legges i en Games-mappe pรฅ valgt plassering. Eksisterende spill flyttes ikke. - Hvor det ender + Hva som bruker plass Steam-spill Spilldata Prefikser %1$s ยท workshop %2$s ยท shaders %3$s @@ -2959,6 +3267,7 @@ VC++- og DirectX-installasjoner spill krever Kjรธrer Linux x86-spill Steam-verktรธy + Steam laster ned dette for spill som leveres med anti-juks, selv nรฅr anti-juks er slรฅtt av. Fjerner du dette, blir installasjonen deres stรฅende pรฅ 0%. DroidDeck kjรธrer spill uten dette kjรธretidsmiljรธet Proton x86, som DroidDeck ikke kan kjรธre Standard for alle spill @@ -3022,6 +3331,19 @@ Beholdes Ikke-Steam-spill og delt Steam-prefiks Prefikser for spill lagt til via butikker eller manuelt + Steams delte prefiks + Steam kjรธrer sine egne Windows-hjelpere her + Sletter det (%1$s). Steam oppretter et nytt neste gang det trengs. + En butikkapp og spillene som kjรธrer med den + Brukes av %1$s + Ikke-Steam-spill %1$s + Ikke knyttet til et spill, sรฅ det beholdes + Fjern valgte ยท %1$s + Avinstaller valgte ยท %1$s + Wine-prefikser + Lagringer og innstillinger i dem gรฅr tapt; Steam Cloud-lagringer blir vรฆrende pรฅ kontoen din. + Shadercacher + Prefiks %1$s ยท shaders %2$s Nedlastede pakker Beholdte originaler Ingen komponentpakker lastet ned. @@ -3056,6 +3378,8 @@ DroidDeck ยท %1$d fps 60 fps ser jevnere ut, men bruker mer CPU mens Steam starter. En video valgt i Steams egne innstillinger vises ogsรฅ her. Lyd + Hopp over oppstartsfilmen + Bruk et svart klipp pรฅ 0,1 sekunder som oppstartsfilmen til Steam. Trer i kraft neste รธkt. Din egen video MP4, MOV, MKV eller WebM. Andre formater og filer over %1$d MB konverteres til 720p-WebM pรฅ enheten, opptil %2$d sekunder. Importer @@ -3517,6 +3841,7 @@ Holder Alt+Tab, Win-tasten og Hjem-knappen i en aktiv DroidDeck-รธkt i stedet for Android. Slรฅ pรฅ Lysstyrke i Oppsett โ†’ Steam-integrering Mali-bro: av + %1$s kan ikke bruke Mali-broen (den krever en Mali-GPU uten en rute via systemdriveren), sรฅ denne bryteren har ingen effekt her. Mali-bro: pรฅ %1$s er ikke en Adreno. Den eksperimentelle Vulkan-broen er pรฅ: รธkten tegner gjennom telefonens egen driver. Forvent feil; send รธktloggene. Sikker modus @@ -3542,6 +3867,25 @@ Flytt senere Modulinnstillinger Fjern modul + Utseende + Ikonpakke + Systemstandard + Bakgrunn i appens farge + Ikonstรธrrelse + Liten + Middels + Stor + Skjul appnavn + Avstand + Tett + Normal + Luftig + Endre ikon + Tilbakestill ikon + Sรธk etter ikoner + Laster inn ikonerโ€ฆ + Fant ingen ikoner. + Egendefinerte ikoner Legg til i mappe Ny mappe Fjern fra mappe @@ -3657,5 +4001,81 @@ Kunne ikke importere dette oppsettet Skarlagenssnรธ + Hvite flater med rรธde aksenter. + Lydspor + Musikk + Avspillingsalternativer + Favoritter + Samlinger + Ingen samlinger ennรฅ. Trykk pรฅ bokmerkeikonet for รฅ opprette en. + Lagret + Opprett en samling + Organiser det du lagrer + Ny + Opprett + Navn pรฅ samling + Skriv inn et navn som ingen andre samlinger bruker + Administrer + Gi nytt navn + Legg til spor + Legg til (%1$d) + Fjern spor + Slett samling + Slette %1$s? + Sporene blir vรฆrende pรฅ enheten din. Bare samlingen fjernes. + Velg + Velg alle + Fjern alle valg + %1$d valgt + Legg til i samling + Legg til i favoritter + Fjern fra samling + Sรธk i spor + Albumrekkefรธlge + Lengste fรธrst + Korteste fรธrst + Spor + Tonehรธyde + Tilbakestill + Hopp over stillhet + Sรธvntimer + %1$d min + Slutten av sporet + %1$s igjen + Equalizer + Bassforsterkning + Equalizeren er ikke tilgjengelig pรฅ denne enheten + Aktiver i spill + Fortsett รฅ spille lydsporet mens et spill kjรธrer + Ingen lydspor installert ennรฅ. + Sรธk i lydspor + Legg til en lydspormappe + Ingen lydfiler i denne mappen + Total lengde + %1$d spor / %2$s + Plate %1$s + Tilfeldig rekkefรธlge + Forrige + Spill av + Pause + Neste + Gjentakelse av + Gjenta alle + Gjenta ett + Volum + Ingen lydfiler i dette lydsporet + Start utilgjengelig + Ingen nettleser er tilgjengelig for รฅ รฅpne denne lenken. + Ta tak + Slipp + Lagre + Hold for รฅ tilbakestille + Butikker + Bildetid + Gjennomsnittlig bildefrekvens + Visningstjener + HDR-status + Vist + %1$d av %2$d diff --git a/app/src/main/res/values-nl/input_library.xml b/app/src/main/res/values-nl/input_library.xml new file mode 100644 index 0000000000..80f96a853b --- /dev/null +++ b/app/src/main/res/values-nl/input_library.xml @@ -0,0 +1,132 @@ + + + Onleesbare invoerinstellingen zijn bewaard in een herstelkopie. Je kunt de herstelde profielen blijven bewerken. + Eigenschappen + Klikeigenschappen + %1$s ยท Klik + Knoppen + Sticks, pads en triggers + Gereedschap verbergen + Controller + Stuur controllerinvoer naar Steam Input of het spel. + Dit element stuurt geen controller-, muis- of toetsenbordinvoer. + Muisklik + DroidDeck-actie + Actie + Scrollsnelheid: %1$d stappen/s + + Nieuw profiel + + Nieuwe indeling + %1$s ยท Gebruikt door %2$d profielen. Wijzigingen gelden voor elk profiel met deze toewijzingen. + Naam wijzigen + Verwijderen + Voeg elementen toe aan de indeling voordat je hun acties toewijst. + Invoerinstellingen konden niet worden opgeslagen + Naam + Beginnen met + Knop + Stick + Touchpad + Kruis + Trigger + Gereed + Ongedaan maken + + Toevoegen + Sleep om te verplaatsen. Sleep een hoek om te vergroten of verkleinen. Tik op Eigenschappen om een actie toe te wijzen. + Bewerken op het secundaire scherm + Het geselecteerde scherm is niet beschikbaar. Sluit het aan om deze indeling op ware grootte te bewerken. + Niet-opgeslagen indelingswijzigingen negeren? + Deze indeling wordt door %1$d profielen gebruikt. Opgeslagen wijzigingen gelden voor alle. + Standaardprofielen + Bureaubladmodus + Spelmodus + Standaard voor bureaublad en spel + Standaard voor spelmodus + Standaard voor bureaubladmodus + Apparaatinstellingen + Bediening + Knoppen, sticks, triggers en extra toetsen + Profiel kopiรซren + Acties resetten + Acties in %1$s terugzetten naar de standaardwaarden van het basisprofiel? Indelingen en andere profielen blijven ongewijzigd. + %1$s verwijderen? Modi die het gebruiken keren terug naar hun ingebouwde standaardprofiel. Opgeslagen indelingen en gedeelde instellingen blijven beschikbaar. + Zichtbaarheid + Geldt voor alle profielen. Auto toont de bediening van het hoofdscherm als er geen controller is aangesloten in spelmodus. + Op scherm bewerken + Opgeslagen indelingenโ€ฆ + Kies een indeling of maak je eigen + Kies Profielbediening in het sessiemenu van het secundaire scherm. De keuzes Profiel en Secundair scherm in het controllermenu bepalen welke bediening wordt getoond. + Knopacties + Gedeeld met %1$s. Bewerkingen gelden ook voor die profielen. + Instellingen hergebruiken + Instellingen gebruiken vanโ€ฆ + Kopiรซren van een ander profiel of instellingen gedeeld houden + Onafhankelijk maken + Huidige opzet behouden en wijzigingen niet meer delen + Indelingen bewaren elementen en hun posities. Elk profiel kan eigen acties toewijzen. Bewerk op ware grootte op het doelscherm. + Huidige indeling + De ongebruikte indeling %1$s en de opgeslagen acties verwijderen? + Huidige indeling een andere naam geven + %1$s hergebruiken van een ander profiel. De andere bedieningsbronnen blijven ongewijzigd. + Fysieke bediening gedeeld houden + Standaard zijn alle bedieningen en aangepaste indelingen onafhankelijke kopieรซn. Delen koppelt alleen de fysieke bediening. + Deze elementen en posities gebruiken. Delen houdt toekomstige geometriewijzigingen gesynchroniseerd; je knopacties blijven onafhankelijk. Een andere indeling begint met niet-toegewezen acties. + Deze bediening en acties kopiรซren of koppelen zodat toekomstige wijzigingen voor beide profielen gelden. + Gedeeld houden + Onafhankelijke kopie + Stick starten op aanraakpunt + Stick verbergen als die niet wordt gebruikt + Gereedschap + Auto (%1$s) + Aangepast (%1$s) + Opslaan als nieuw profiel + Profielbediening + Profiel + Muis-touchpadgebaren + Bij toewijzing aan de muisaanwijzer: tik om te klikken, houd vast om te slepen en scroll met twee vingers. + %1$s heeft een snelmenu-overschrijving. Kies daar Auto om het standaardprofiel en alle drie opgeslagen delen te gebruiken. + DroidDeck-invoer + Vastgehouden terwijl de stick in een willekeurige richting wordt bewogen: ingedrukt boven 55%, losgelaten onder 35%. Gebruik Richtingtoetsen om elke richting apart toe te wijzen. DroidDeck-opdrachten worden รฉรฉn keer per uitslag uitgevoerd. De stickklik wordt apart ingesteld. + Vastgehouden tijdens aanraking van de touchpad; losgelaten bij het optillen van je vinger. DroidDeck-opdrachten worden รฉรฉn keer per aanraking uitgevoerd. De touchpadklik wordt apart ingesteld. + Vastgehouden wanneer de trigger 55% passeert; losgelaten onder 35%. DroidDeck-opdrachten worden รฉรฉn keer per druk uitgevoerd. + Scrollrichting + Verticaal + Horizontaal + Horizontaal scrollen + Metingen + Schakel opnemen in, gebruik de bediening in een lopende sessie en kom terug om de resultaten te lezen. Meet alleen de DroidDeck-verzendtijd, niet de schermvertraging. De opname stopt wanneer het app-proces sluit. + %1$d bedieningen + Andere opgeslagen indelingen (%1$d) โ–พ + Andere opgeslagen indelingen verbergen (%1$d) โ–ด + Home / Guide + Terug ยท รฉรฉn tik + Terug ยท dubbeltik + Terug ยท twee keer in Steam, รฉรฉn keer op bureaublad + In spelmodus Steam. Terug ingedrukt houden opent ook snelle toegang. + Terugzetten naar standaard + Je paneelkeuze wordt onthouden. Bureaublad opent een tweede werkruimte; het wisselt de sessie of het invoerprofiel niet. + Virtuele controller + Het controllertype dat Steam of het spel ziet. + Touchscreen + Hoe aanrakingen op het spelscherm worden afgehandeld. Profielknoppen behouden hun toegewezen acties. + Aanraakcursor + Toon een aanwijzer voor directe aanrakingen op het spelscherm. + Aanraken en vasthouden + Muisactie wanneer je een vinger op het spelscherm houdt. + Tikken op de terugknop + Eerste actie: รฉรฉn tik. Tweede actie: dubbeltik. + Schakelknop + Tik om vast te houden, tik opnieuw om los te laten. Een menu openen of van profiel wisselen laat de knop los. + Vorm + Afgerond + Pil + Cirkel + Rechthoek + Knoplabel + Tekst + Geรฏmporteerde afbeelding + Aparte diagonale toetsen + Wijs een toets toe aan elke diagonaal. Een lege diagonaal drukt de twee aangrenzende richtingen. + Aangrenzende richtingen + Je oude schermtoetsen zijn hieronder opgeslagen als geรฏmporteerde profielen. Selecteer er een om te gebruiken of te bewerken. Je huidige profielkeuzes zijn behouden. + De oude schermtoetsen konden niet automatisch worden geรฏmporteerd. De oorspronkelijke instellingen zijn behouden. + diff --git a/app/src/main/res/values-nl/input_strings.xml b/app/src/main/res/values-nl/input_strings.xml new file mode 100644 index 0000000000..df68d569fe --- /dev/null +++ b/app/src/main/res/values-nl/input_strings.xml @@ -0,0 +1,38 @@ + + + Invoerprofielen + Profielen + Fysieke controller + Hoofdscherm + Secundair scherm + Native / Steam Input + Native: %1$s + Een andere controllerbesturing sturen + Uitgeschakeld + Toets of toetscombinatie + Richtingtoetsen + Aanwijzer verplaatsen + Aanwijzersnelheid: %1$d + Scrollen + Verticaal scrollen + Linkermuisknop + Rechtermuisknop + Middelste muisknop + DroidDeck-menu openen + Toetsenbord tonen + Steam-menu openen + Steam-sneltoegang openen + Besturing verwijderen + Besturing toevoegen + Apparaatspecifieke knoppen + Een fysieke knop toewijzen + Laat de knop los en kies Bewerken, Opnieuw of Annuleren. B of Terug annuleert na loslaten. + Opnieuw + Druk op een knop, ook een Terug-knop die als toets wordt gemeld. Volumetoetsen en Android-systeemtoetsen zijn gereserveerd. De toewijzing geldt alleen voor dit apparaat. + Toewijzing verwijderen + Invoerdiagnose + Invoerverzendtijd opnemen + Metingen lezen + Meet de verzending van Android tot publicatie in het bestaande invoertransport. Bluetooth-aankomst, gastpolling, weergave en schermvertraging vallen er niet onder. Opnemen staat standaard uit. + Normale invoertoewijzing gebruiken + diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index a7bd52c016..5247d1fedd 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -28,6 +28,8 @@ Nu onderbreken Sessie stoppen Framegeneratie + Instellingen voor dit spel + Standaardinstellingen Kies de modus voor framegeneratie Uit DD-FG %1$dร— @@ -183,6 +185,7 @@ De PowerVR-grafische omgeving kon niet worden gedownload. Controleer de verbinding en probeer het opnieuw. DirectAudio kon niet worden gedownload, dus gamegeluid gebruikt deze sessie de tragere route. Dit programma + De sessie kon niet op het scherm tekenen: %1$s. Dit scherm laat zien waarom, in plaats van een zwart scherm; de details staan in de sessielogboeken. De Steam-client kon niet worden gedownload. Je netwerk of VPN blokkeert mogelijk de servers van Steam; controleer de verbinding en probeer het opnieuw. De Steam-client kon niet worden ingesteld. Controleer de verbinding en de vrije opslag en probeer het opnieuw. %1$s is gemaakt voor x86-pcโ€™s en draait via FEX, dat nog niet is geรฏnstalleerd. Start Steam รฉรฉn keer terwijl je bent ingelogd en laat het FEX en de Steam Linux Runtime downloaden. Start dit daarna opnieuw. @@ -385,6 +388,9 @@ Hier nog niet ondersteund Componenten ladenโ€ฆ Kan niet installeren: %1$s + Voor deze download is een update nodig. + Update staat in de wachtrij. + Update opnieuw proberen Gedownload %1$s downloaden Installeren: %1$s @@ -415,6 +421,22 @@ Alleen intern Map: %1$s Tweede bibliotheek + Meer Steam-bibliotheken + Mappen waarnaar Steam kan installeren en van waaruit het games kan spelen, elk onder een eigen naam. Als je er een verwijdert, blijven de games op schijf staan. + Bibliotheek toevoegen + Hernoemen + Bibliotheeknaam + Kies een map voor de bibliotheek + Maximaal %1$d toegevoegde bibliotheken + Die map is al een bibliotheek of bevindt zich in een bibliotheek + %1$s ยท niet beschikbaar + Geldt vanaf de volgende Steam-sessie + Gevonden op dit apparaat ยท %1$s ยท %2$s + Toevoegen + Bibliotheken op interne opslag zoeken + Geef toegang tot alle bestanden zodat DroidDeck Steam-bibliotheken kan zien die andere apps op interne opslag bewaren + Toestaan + %1$s toegevoegd, de Steam-bibliotheek in de map die je hebt gekozen Games die assets streamen vanaf SD of gedeelde opslag kunnen haperen. Opslagdiagnose Legt toewijzingsresultaten en steekproeven van opslagtijden vast in Logs delen. Kan installaties vertragen zolang dit aan staat. Geldt vanaf de volgende sessie. @@ -478,6 +500,7 @@ Aan Start met Steam Start zonder Steam + Spelresolutie Instellingen Instellingen voor %1$s Standaard @@ -565,6 +588,8 @@ Gamecores Gamecores Cores voor games. Met alles geselecteerd verdeelt Android vrij. + Stroom besparen bij stabiele games + Draait een game op de tragere kernen zolang de framerate stabiel blijft, en zet hem terug op zijn gebruikelijke kernen zodra hij achterraakt. Clientinterface GL-threading Kan Steam-menuโ€™s sneller laten reageren. @@ -600,7 +625,10 @@ Schakelt de gamepadnavigatiehulp van Proton uit, die in elke game CPU kost. Draai proot zonder seccomp Kan foutmeldingen over ontbrekende systeemaanroepen op sommige kernels verhelpen. Kan de prestaties verlagen. + Uitvoeren zonder proot (experimenteel) + Start de Linux-kant rechtstreeks op Android. Geldt voor de volgende sessie. Schakel dit uit als iets niet kan starten. proot-snelpad + Niet gebruikt zonder proot. Vereist het seccomp-filter van proot. Snellere bestandstoegang en minder stotteren. Zet dit uit als een programma zijn bestanden niet kan vinden. Cursor in gamescope tekenen @@ -683,6 +711,7 @@ Grafisch geheugen Swapgeheugen Accuniveau + Resterende batterijduur Stroomverbruik Netwerk Resolutie @@ -809,6 +838,7 @@ Apparaat ondersteund Ongeteste GPU GPU niet ondersteund + GPU via Mali-brug %1$s ยท %2$s %1$s: %2$s Er is geen compatibele grafische backend beschikbaar voor %1$s. Steam kan een zwart scherm tonen. @@ -838,15 +868,38 @@ Sessie Sessielogs Opgeslagen na elke sessie + Uitgebreide diagnostiek voor de volgende sessie + Legt gedetailleerde logboeken vast voor รฉรฉn sessie. Kan de prestaties verminderen en meer opslagruimte gebruiken. Schakelt zichzelf uit zodra de sessie start; bekijk de logboeken voordat je ze deelt. Debuglogs van games Neem bij de volgende gamestart diagnostiek van Proton, Wine en graphics op. Kan de prestaties verlagen en meer opslag gebruiken. Start deze sessie opnieuw om debuglogs van games op te slaan Kan logging niet bijwerken. Controleer de schakelaar en probeer het opnieuw. Hulpmiddelen voor debuggen + Gedetailleerde grafische logboeken + Steam-interface: GPU-tekenen + Met het Xclipse-driverpaar tekent Steam zijn pagina\'s in software (GPU-tekenen liet gebroken tegels zien). Schakel dit in voor een snellere Steam-interface als het op deze telefoon goed uitziet. + gebouwd op %1$s + %1$s bijgewerkt naar de nieuwste build + Tijdens de vorige sessie slaagde de Mali-brug op %1$s niet voor de zelftest (afbeeldingen of draws), dus gebruikte de sessie in plaats daarvan het PanVK-driverpaar. + De Mali-brug vond tijdens de vorige sessie geen manier om op %1$s geheugen met de driver te delen, dus gebruikte de sessie in plaats daarvan het PanVK-driverpaar. De brug kan op deze telefoon niet werken; als je de brug uitzet, blijft het PanVK-paar in gebruik. + De Proton-, DXVK- en driverlogboeken van elk spel komen terecht in de logboeken van de sessie. Altijd aan als de GPU geen Adreno is. Nieuwste sessielogs Opgeslagen sessielogs Bewaart de nieuwste %1$d Logs wissen + Beschikbare sessielogboeken + Nog geen opgeslagen sessielogboeken. + Gedeelde en opgeslagen ZIP\'s bevatten de geselecteerde sessie en bijbehorende diagnostische gegevens van Steam, winkels, tools en Battle.net. + %1$s ยท %2$s + Huidige sessie + Delen + Opslaan op apparaat + Verwijderen + Sessielogboeken verwijderen? + %1$s verwijderen? Dit kan niet ongedaan worden gemaakt. + Sessielogboeken opgeslagen. + Sessielogboeken konden niet worden opgeslagen. + Sessielogboeken konden niet worden verwijderd. Alle instellingen resetten Zet elke instelling terug op de standaardwaarde Resetten @@ -873,6 +926,8 @@ Als startscherm gebruiken DroidDeck kan de startschermapp zijn DroidDeck wordt nooit aangeboden als startschermapp + Home-knop opent + De pagina die wordt weergegeven als DroidDeck de Home-app is en je op Home drukt Zet DroidDeck bij Games toevoegen op Opnemen Oriรซntatie Oriรซntatie van launcher @@ -886,15 +941,22 @@ Volledig scherm Verbergt de statusbalk en navigatiebalk van Android Toont de statusbalk en navigatiebalk van Android + Launcher op twee schermen + Automatisch zet de launchersecties (Steam, Bibliotheek, Winkels en de rest) op het tweede scherm van handhelds met een ingebouwd exemplaar. Aan gebruikt elk tweede scherm. Uit houdt de launcher op รฉรฉn scherm. + Sessies op twee schermen + Automatisch zet het menu in de game vast op het ingebouwde tweede scherm, in plaats van in een pop-over. Aan gebruikt elk tweede scherm. Uit houdt het menu op het gamescherm; je kunt vanuit dat menu alsnog een tweede scherm kiezen. Automatisch Aan Uit Bediening op het onderste scherm in games + Android-toetsenbord voor tekstvelden Opent het trackpad en toetsenbord op het tweede scherm wanneer een sessie start. Typen voor het bovenste scherm Klaar Standaard startschermapp Kies een startschermapp + Launcher verbergen in Recente apps tijdens inactiviteit + Geldt alleen als DroidDeck de standaard Home-app is en er geen sessie actief is. Kiezen Linux-apps (bรจta) Bestanden @@ -1006,9 +1068,172 @@ Preview Nieuwste fixes, vรณรณr Stabiel Up-to-date + Builddetails kopiรซren + Builddetails gekopieerd + Voor op Preview + Je loopt voor op Preview + Deze build is nieuwer dan de nieuwste Preview. De volgende Preview-build werkt hem bij. + Kies een build om de wijzigingen te zien of hem te installeren. + Geรฏnstalleerd + Deze build installeren%1$s + Terug naar deze build%1$s + versionCode %1$d + Commit %1$s + Releasepagina + De PR heeft een nieuwere commit (%1$s). De testbuild daarvan is nog niet klaar, dus deze bevat hem niet. + Nieuwere commit, build volgt + PR-nummer, titel of auteur + Geen testbuild gevonden + Moet opnieuw gebouwd (versionCode %1$d) + Updates van testbuilds + Nieuwe testbuild voor PR #%1$d + %1$s. Open Updates om hem te installeren. + Meer tonen (%1$d) + Moeten opnieuw gebouwd voor versionCode %2$d (%1$d) + Preview-builds op main sinds deze testbuild: %1$d Testbuilds Probeer een fix voordat die wordt uitgebracht Momenteel geen + Lab-build + Lab-builds + In gebruik + Gepauzeerd nadat Android DroidDeck opnieuw heeft geoptimaliseerd + Niet geladen: %1$s + Wachten op een herstart + Behouden + Voor een andere versie + Opnieuw bouwen + Verwijdert deze build van het apparaat + Opnieuw starten met deze build + Uitzetten + Gebruiken + Verwijderen + Nu verwijderen + De herstart kon niet worden voorbereid: %1$s. Koppel draadloze foutopsporing in Instellingen en probeer het opnieuw. + Lab-build geรฏnstalleerd + DroidDeck is opnieuw gestart met %1$s + Lab-build gepauzeerd + Android heeft DroidDeck opnieuw geoptimaliseerd, dus %1$s is niet geladen. Open Updates om DroidDeck ermee opnieuw te starten. + Lab-build uitgeschakeld + Deze build is gebouwd voor een andere versie van DroidDeck. Hij wordt bewaard in Updates. + DroidDeck is er twee keer niet mee opgestart. + Agent + Agent + De agent is aan het werk + Installeer Claude Code in de Linux-gebruikersomgeving om de agent te gebruiken. + Stel een vraag over een game, een crash of een aanpassing aan DroidDeck + Verzenden + Nieuw gesprek + Stoppen + Opslag + Verwijderen + Nu verwijderen + Claude Code + Codex + DroidDeck-broncode + Downloadcaches + Niet-gepushte wijzigingen gaan verloren + Builds downloaden ze opnieuw + Setup kan het opnieuw installeren; aanmeldgegevens blijven bewaard + DroidDeck is opnieuw gestart op je Lab-build. Ga verder waar je gebleven was. + Vraag het waarom een game niet start, laat het een log uitleggen of laat het DroidDeck aanpassen en de wijziging op dit apparaat uitproberen. + Mislukt: %1$s + %1$s is beรซindigd (exitcode %2$d) + Gestopt + Beรซindigd zonder antwoord + Opnieuw proberen + De agent wordt ingesteld + Bouw mijn Lab-build %1$s opnieuw voor de geรฏnstalleerde versie van DroidDeck en start er opnieuw op. + %1$s in ยท %2$s uit + Nadenken + Gedachte + Nadenken ยท %1$s + %1$s ยท %2$s + INVOER + UITVOER + Wordt uitgevoerdโ€ฆ + Geen resultaat: de beurt is al afgelopen + Geen uitvoer + Typ om het volgende bericht in de wachtrij te zetten + In wachtrij + Volgende: %1$s + Niet verzenden + Bijvoegen + Verwijderen + Standaard + Redeneerinspanning + Ga + Herzien + Nog niets gewijzigd + Ga door met het plan. + Nu verzenden + Meer + Sluiten + Nieuwste + Bezig + Context + %1$s van %2$s + Dit gesprek ยท %1$s + Verbruik verschijnt na het eerste antwoord + %1$d-uurslimiet + %1$d-minutenlimiet + Wekelijkse limiet + %1$d%% ยท reset %2$s + + %1$d bestand + %1$d bestanden + + Eerst plannen + Plan + Stelt een plan voor zonder iets te wijzigen + Gesprekken + Nog geen gesprekken + Zojuist + Verwijderen + Verwijdert het gesprek en de bijlagen + Processen + Er draait niets in het Linux-userland + AGENT + Stoppen + Lab-build + Lab-builds voorbereiden + %1$d%% ยท nog ongeveer %2$s + nog ongeveer %1$s + Annuleren + Build annuleren + Starten + %1$d%% + Pakket maken + DroidDeck erop opnieuw starten + Klaar + Mislukt: %1$s + Agent instellen + Installeer eerst de Linux-runtime in Setup. + Opnieuw proberen + Begin met chatten + Apparaatverbinding + Draadloos debuggen, zodat de agent DroidDeck kan zien en aansturen + %1$s installeren + In het Linux-userland, met git, gh en adb + Inloggen bij %1$s + Opent je browser + GitHub + Optioneel, om pull requests te openen + Buildtools + Optioneel, voor Lab-builds op dit apparaat ยท ongeveer 5 GB + Agent gereed + Voltooi de configuratie van de agent + Ingelogd bij %1$s + Lab-builds + snelle builds + Snelle Lab-builds + Compileert deze versie vooraf, zodat Lab-builds minuten duren ยท eenmalig ongeveer 20 minuten + Compileren ยท %1$d%% ยท nog ongeveer %2$s te gaan + Voorbereiden + Draadloze foutopsporing is niet bereikbaar; Koppelen schakelt dit in + Koppelen + Installeren + Inloggen PR #%1$d Niet gebouwd voor deze kopie van DroidDeck Geรผpdatet %1$s @@ -1248,6 +1473,9 @@ Apps Installatie Updates + Meer + Tabbladen bewerken + Tabbladen %1$d%% %1$s hervatten Verschijnt in elke sessie als /root/ROMs. Interne opslag staat op /root/Storage. @@ -1269,6 +1497,15 @@ Wachtrij annuleren Android-toetsenbord Verbergen โœ• + Grootte op scherm + Het deel van het scherm dat het toetsenbord inneemt, inclusief de header. + Dekking + Verlaag deze om het spel achter het toetsenbord te zien. + Verborgen toetsen + Toetsen die je zelden gebruikt staan niet op het toetsenbord. + Esc en functierij + Ins / Del / Home / End / PgUp / PgDn + Pijltjestoetsen %1$s starten Kies een scherm. Tweede scherm: %1$s. Het tweede scherm is niet meer beschikbaar. @@ -1770,7 +2007,24 @@ Terminal Deck-grepen + trackpads Dashboard + Desktop + Desktop starten + Desktop ยท %1$s + Trackpad + Directe aanraking + Trackpad. Tik voor directe aanraking + Directe aanraking. Tik voor trackpad + KDE-desktop startenโ€ฆ + De desktop is afgesloten. + De desktop kon niet starten. De logboeken staan in de map bottom-desktop van deze sessie. + De desktop is gesloten. Hier is nog niets te zien. + Schermen omwisselen + Het onderste scherm is nu niet vrij. + Gamescherm + Game tonen op + Bovenste scherm + Onderste scherm Downloads Er lopen geen downloads. Steam @@ -1805,6 +2059,20 @@ Brandstof, t Hoofdtank %1$s t Reserve %1$s t + Frametijd + laatste %1$d s + gem. frame + 1% low + frames boven 33 ms + %1$d / min + Speeltijd %1$s + %1$d cores, tot %2$s GHz + %1$d cores + game + FPS van %1$d Hz + De rode markering is het punt waarop de HUD de temperatuur in het rood weergeeft. + hele apparaat + accu Dashboardgegevens verzenden Automatisch Zet het aan voor elke game in deze lijst, ook voor games die later worden gevonden. Games die je uitzet, blijven uit. @@ -1828,6 +2096,10 @@ De microfoon staat uit voor deze game. Zet Microfoon aan in de Steam-instellingen van DroidDeck (Audio) en start de game opnieuw om te praten. Volume %1$d%% In-game statistieken + HUD op het onderste scherm + Strip op elk tabblad + 1% en 0,1% lows + CPU-temperatuur FPS CPU GPU @@ -2000,6 +2272,7 @@ Sessie wordt gestartโ€ฆ %1$d:%2$02d verstreken ยท nog bezig Update van de Steam-client downloaden ยท %1$d%% + Update van de Steam-client toepassenโ€ฆ Steam-client downloaden ยท %1$s Er wordt al een compatibiliteitstool geรฏnstalleerd @@ -2076,11 +2349,29 @@ Contourlijnen plus verscherping. Geen Adreno-GPU + PowerVR-systeemdriver: de compatibiliteit verschilt per apparaat + Experimenteel: RADV of de Xclipse-systeemdriver + Systeem-PowerVR + Gebruikt de ingebouwde drivers voor deze GPU + De PowerVR-systeemdriver is geselecteerd voor de runtime en het scherm. + Nog geen open driver ondersteunt deze Mali: de Mali-brug staat aan. + Dit is de niet-Snapdragon-testbuild: de officiรซle builds hier draaien alleen op Adreno en worden daarom niet over deze build heen geรฏnstalleerd. Nieuwe testbuilds staan op github.com/The412Banner/droiddeck-nonadreno-drivers. + De laatste sessie is beรซindigd omdat Android DroidDeck sloot om geheugen vrij te maken, niet door een crash. Sluit andere apps of verlaag de textuurinstellingen van het spel en probeer het opnieuw. + Mali (Venus) + de Mali-brug + Nog geen open driver ondersteunt deze Mali: %1$s wordt gebruikt, op de eigen driver van het toestel. + %1$s is nog niet gepubliceerd: tot die tijd wordt %2$s gebruikt. + %1$s is niet beschikbaar en de driver van dit toestel meldt Vulkan %2$s (Venus heeft 1.2 nodig): de Mali-brug wordt gebruikt. + %1$s is nog niet gepubliceerd: tot die tijd staat de Mali-brug aan. + In de wachtrij: %1$s (wacht op een andere runtimedriver) + DXVK wordt geleverd door de PowerVR-systeemruntime. Andere DXVK-pakketten kunnen worden opgeslagen, maar worden met deze driver niet toegepast. Ondersteund Experimenteel: de drivers zijn testbuilds Experimentele ondersteuning voor Adreno 850: vereist compatibele experimentele scherm- en gamedrivers; niet geverifieerd op dit apparaat Onder de geteste hardware (Adreno 725 en nieuwer): werkt mogelijk niet Niet ondersteund: er is geen compatibele grafische backend beschikbaar voor deze GPU + Loopt via de Mali-brug, op de eigen Vulkan-driver van het toestel + Niet ondersteund met de Mali-brug uitgeschakeld: Turnip heeft een Adreno (Snapdragon)-GPU nodig De ratelimiet van GitHub is bereikt - probeer het later opnieuw GitHub antwoordde met HTTP %1$d @@ -2189,7 +2480,6 @@ Winkels Steam Aangepast - Winkels Niveau voor downloadsnelheid Gebalanceerd Snel @@ -2228,6 +2518,7 @@ Wachten op de andere Battle.net-downloadโ€ฆ Open Battle.net en meld je รฉรฉn keer aan, installeer daarna de games hier. Blizzards downloader is gestopt: %1$s + Blizzards downloader maakt geen voortgang meer. Blizzard-fout %1$s Bijwerken Blizzard-games @@ -2235,6 +2526,7 @@ Onderbroken Installeren ยท %1$s Gratis verkrijgen + Toevoegen aan bibliotheekโ€ฆ Bekijken op %1$s Kopen ยท %1$s Geรฏnstalleerd @@ -2281,6 +2573,12 @@ Sorteren Labels in zijbalk Toon namen onder de pictogrammen in de zijbalk. Zet uit voor een smallere zijbalk. + Agenthuisdier + DeeDee zweeft boven de launcher en games en laat zien wat de agent doet. + Boven andere apps + Laat DeeDee boven elke app zweven en open daar de chat + Toestaan + Chatten met DeeDee Weergave Grotere kaarten Kleinere kaarten @@ -2565,7 +2863,14 @@ %1$s ยท herstart nodig Dit apparaat %1$s verwijderen? - Diagnostiek + Ontwikkelaar + Buildlabel als watermerk + Toon het label van de testbuild of Lab-build op het scherm. Standaard ingeschakeld. + Diagnostische bundels delen + Sessie en apparaat + Grafische gegevens + Games en compatibiliteit + Alle bundels Klaar om te spelen Nog niet klaar om te spelen runtime %1$s @@ -2604,6 +2909,9 @@ Zet GOG-prestaties aan in de Stores-instellingen Prestaties niet beschikbaar; controleer sessielogs Prestatie ontgrendeld + Mali (Venus): uit + Mali (Venus): aan + De driver op %1$s meldt Vulkan %2$s. Mali (Venus) heeft Vulkan 1.2 of nieuwer nodig (gamescope start niet op oudere versies), dus sessies slaan Venus over en gebruiken in plaats daarvan het PanVK-driverpaar. Plakken Linkerstick Rechterstick @@ -2890,7 +3198,7 @@ Map kiezenโ€ฆ Gebruik een willekeurige map op een SD-kaart of USB-stick Games komen in een map Games op de gekozen locatie. Bestaande games worden niet verplaatst. - Waar het naartoe gaat + Wat ruimte inneemt Steam-games Gamegegevens Prefixen %1$s ยท workshop %2$s ยท shaders %3$s @@ -2959,6 +3267,7 @@ VC++- en DirectX-installaties die games nodig hebben Draait Linux x86-games Steam-hulpprogramma + Steam downloadt dit voor games die anti-cheat meeleveren, ook als anti-cheat is uitgeschakeld. Als je het verwijdert, blijft de installatie op 0% hangen DroidDeck draait games zonder deze runtime Proton x86, dat DroidDeck niet kan draaien Standaard voor alle games @@ -3022,6 +3331,19 @@ Bewaard Niet-Steam-games en gedeeld Steam-prefix Prefixen van games die via winkels of handmatig zijn toegevoegd + Gedeeld Steam-prefix + Steam voert hier eigen Windows-hulpmiddelen uit + Verwijdert het (%1$s). Steam maakt een nieuw aan zodra het er weer een nodig heeft. + Een winkel-app en de games die ermee draaien + Gebruikt door %1$s + Niet-Steam-game %1$s + Niet aan een game gekoppeld, dus het blijft bewaard + Selectie verwijderen ยท %1$s + Selectie verwijderen ยท %1$s + Wine-prefixen + Opgeslagen spellen en instellingen daarin gaan verloren; Steam Cloud-opslagen blijven in je account. + Shadercaches + Prefix %1$s ยท shaders %2$s Gedownloade pakketten Bewaarde originelen Geen componentpakketten gedownload. @@ -3056,6 +3378,8 @@ DroidDeck ยท %1$d fps 60 fps oogt vloeiender maar gebruikt meer CPU terwijl Steam opstart. Een video die in Steam zelf is gekozen verschijnt hier ook. Geluid + Opstartvideo overslaan + Gebruik een zwart fragment van 0,1 seconde als opstartvideo van Steam. Wordt toegepast in de volgende sessie. Eigen video MP4, MOV, MKV of WebM. Andere formaten en bestanden boven %1$d MB worden op het apparaat omgezet naar 720p-WebM, tot %2$d seconden. Importeren @@ -3517,6 +3841,7 @@ Houdt Alt+Tab, de Win-toets en de Home-knop in een actieve DroidDeck-sessie in plaats van Android. Zet Helderheid aan in Installatie โ†’ Steam-integratie Mali-brug: uit + %1$s kan de Mali-brug niet gebruiken (die heeft een Mali-GPU nodig zonder route via de systeemdriver), dus deze schakelaar heeft hier geen effect. Mali-brug: aan %1$s is geen Adreno. De experimentele Vulkan-brug staat aan: de sessie tekent via het eigen stuurprogramma van de telefoon. Verwacht fouten; stuur de sessielogboeken. Veilige modus @@ -3542,6 +3867,25 @@ Naar achteren Widgetinstellingen Widget verwijderen + Weergave + Pictogrampakket + Systeemstandaard + Achtergrond in app-kleur + Grootte van pictogrammen + Klein + Middel + Groot + App-namen verbergen + Afstand + Krap + Normaal + Ruim + Pictogram wijzigen + Pictogram resetten + Pictogrammen zoeken + Pictogrammen ladenโ€ฆ + Geen pictogrammen gevonden. + Aangepaste pictogrammen Toevoegen aan map Nieuwe map Uit map verwijderen @@ -3657,5 +4001,81 @@ Deze indeling kan niet worden geรฏmporteerd Scharlakenrode sneeuw + Witte oppervlakken met rode accenten. + Soundtracks + Muziek + Afspeelopties + Favorieten + Collecties + Nog geen collecties. Tik op het bladwijzericoon om er een te maken. + Opgeslagen + Maak een collectie + Orden je opgeslagen nummers + Nieuw + Maken + Naam van collectie + Voer een naam in die geen andere collectie gebruikt + Beheren + Hernoemen + Nummers toevoegen + Toevoegen (%1$d) + Nummers verwijderen + Collectie verwijderen + %1$s verwijderen? + De nummers blijven op je apparaat. Alleen de collectie wordt verwijderd. + Selecteren + Alles selecteren + Alles deselecteren + %1$d geselecteerd + Toevoegen aan collectie + Toevoegen aan favorieten + Verwijderen uit collectie + Nummers zoeken + Albumvolgorde + Langste eerst + Kortste eerst + Nummers + Toonhoogte + Resetten + Stilte overslaan + Slaaptimer + %1$d min + Einde van het nummer + Nog %1$s + Equalizer + Basversterking + De equalizer is niet beschikbaar op dit apparaat + In-game inschakelen + Laat de soundtrack doorspelen terwijl een game draait + Nog geen soundtracks geรฏnstalleerd. + Soundtracks zoeken + Soundtrackmap toevoegen + Geen audiobestanden in deze map + Totale lengte + %1$d nummers / %2$s + Schijf %1$s + Willekeurig + Vorige + Afspelen + Pauzeren + Volgende + Herhalen uit + Alles herhalen + Eรฉn herhalen + Volume + Geen audiobestanden in deze soundtrack + Starten niet beschikbaar + Er is geen webbrowser beschikbaar om deze link te openen. + Pakken + Loslaten + Opslaan + Houd vast om te resetten + Winkels + Frametijd + Gemiddelde framesnelheid + Weergaveserver + HDR-status + Getoond + %1$d van %2$d diff --git a/app/src/main/res/values-pl/input_library.xml b/app/src/main/res/values-pl/input_library.xml new file mode 100644 index 0000000000..1193c2a125 --- /dev/null +++ b/app/src/main/res/values-pl/input_library.xml @@ -0,0 +1,132 @@ + + + Nieczytelne ustawienia wejล›cia zachowano w kopii zapasowej. Moลผesz dalej edytowaฤ‡ przywrรณcone profile. + Wล‚aล›ciwoล›ci + Wล‚aล›ciwoล›ci klikniฤ™cia + %1$s ยท Klikniฤ™cie + Przyciski + Drฤ…ลผki, pady i spusty + Ukryj narzฤ™dzia + Kontroler + Wysyล‚aj wejล›cie kontrolera do Steam Input lub gry. + Ten element nie wysyล‚a wejล›cia kontrolera, myszy ani klawiatury. + Klikniฤ™cie myszy + Akcja DroidDeck + Akcja + Szybkoล›ฤ‡ przewijania: %1$d krokรณw/s + + Nowy profil + + Nowy ukล‚ad + %1$s ยท Uลผywane przez %2$d profile. Zmiany dotyczฤ… kaลผdego profilu z tymi przypisaniami. + Zmieล„ nazwฤ™ + Usuล„ + Dodaj elementy do ukล‚adu, zanim przypiszesz ich akcje. + Nie udaล‚o siฤ™ zapisaฤ‡ ustawieล„ wejล›cia + Nazwa + Zacznij od + Przycisk + Drฤ…ลผek + Touchpad + Krzyลผak + Spust + Gotowe + Cofnij + + Dodaj + Przeciฤ…gnij, aby przenieล›ฤ‡. Przeciฤ…gnij rรณg, aby zmieniฤ‡ rozmiar. Dotknij Wล‚aล›ciwoล›ci, aby przypisaฤ‡ akcjฤ™. + Edycja na dodatkowym ekranie + Wybrany ekran jest niedostฤ™pny. Podล‚ฤ…cz go, aby edytowaฤ‡ ten ukล‚ad w rzeczywistym rozmiarze. + Odrzuciฤ‡ niezapisane zmiany ukล‚adu? + Ten ukล‚ad jest uลผywany przez %1$d profili. Zapisane zmiany dotyczฤ… wszystkich. + Profile domyล›lne + Tryb pulpitu + Tryb gry + Domyล›lny dla pulpitu i gry + Domyล›lny dla trybu gry + Domyล›lny dla trybu pulpitu + Ustawienia urzฤ…dzenia + Sterowanie + Przyciski, drฤ…ลผki, spusty i dodatkowe klawisze + Kopiuj profil + Resetuj akcje + Zresetowaฤ‡ akcje w %1$s do wartoล›ci domyล›lnych profilu bazowego? Ukล‚ady i inne profile pozostanฤ… bez zmian. + Usunฤ…ฤ‡ %1$s? Tryby, ktรณre go uลผywajฤ…, wrรณcฤ… do wbudowanego profilu domyล›lnego. Zapisane ukล‚ady i udostฤ™pnione ustawienia pozostanฤ… dostฤ™pne. + Widocznoล›ฤ‡ + Dotyczy wszystkich profili. Auto pokazuje sterowanie ekranu gล‚รณwnego, gdy w trybie gry nie podล‚ฤ…czono kontrolera. + Edytuj na ekranie + Zapisane ukล‚adyโ€ฆ + Wybierz ukล‚ad lub utwรณrz wล‚asny + Wybierz Sterowanie profilu w menu sesji dodatkowego ekranu. Wybory Profil i Dodatkowy ekran w menu kontrolera decydujฤ…, ktรณre sterowanie jest pokazywane. + Akcje przyciskรณw + Udostฤ™pnione z %1$s. Zmiany dotyczฤ… takลผe tych profili. + Uลผyj ponownie ustawieล„ + Uลผyj ustawieล„ zโ€ฆ + Skopiuj z innego profilu lub pozostaw ustawienia udostฤ™pnione + Uczyล„ niezaleลผnym + Zachowaj bieลผฤ…cฤ… konfiguracjฤ™ i przestaล„ udostฤ™pniaฤ‡ zmiany + Ukล‚ady przechowujฤ… elementy i ich pozycje. Kaลผdy profil moลผe przypisaฤ‡ wล‚asne akcje. Edytuj w peล‚nym rozmiarze na docelowym ekranie. + Bieลผฤ…cy ukล‚ad + Usunฤ…ฤ‡ nieuลผywany ukล‚ad %1$s i jego zapisane akcje? + Zmieล„ nazwฤ™ bieลผฤ…cego ukล‚adu + Uลผyj ponownie %1$s z innego profilu. Inne ลบrรณdล‚a sterowania pozostanฤ… bez zmian. + Zachowaj wspรณล‚dzielenie sterowania fizycznego + Domyล›lnie wszystkie elementy sterowania i ukล‚ady niestandardowe to niezaleลผne kopie. Udostฤ™pnianie ล‚ฤ…czy tylko sterowanie fizyczne. + Uลผyj tych elementรณw i pozycji. Udostฤ™pnianie synchronizuje przyszล‚e zmiany geometrii; akcje przyciskรณw pozostajฤ… niezaleลผne. Inny ukล‚ad zaczyna siฤ™ od nieprzypisanych akcji. + Skopiuj te elementy sterowania i akcje albo poล‚ฤ…cz je, aby przyszล‚e zmiany dotyczyล‚y obu profili. + Zachowaj udostฤ™pnione + Niezaleลผna kopia + Zacznij drฤ…ลผek w miejscu dotkniฤ™cia + Ukryj drฤ…ลผek, gdy nie jest uลผywany + Narzฤ™dzia + Auto (%1$s) + Niestandardowy (%1$s) + Zapisz jako nowy profil + Sterowanie profilu + Profil + Gesty touchpada myszy + Po przypisaniu do wskaลบnika myszy: dotknij, aby kliknฤ…ฤ‡, przytrzymaj, aby przeciฤ…gnฤ…ฤ‡, i przewijaj dwoma palcami. + %1$s ma zastฤ…pienie szybkiego menu. Wybierz tam Auto, aby uลผyฤ‡ profilu domyล›lnego i wszystkich trzech zapisanych czฤ™ล›ci. + Wejล›cie DroidDeck + Przytrzymywane, gdy drฤ…ลผek jest wychylony w dowolnym kierunku: naciล›niฤ™cie powyลผej 55%, zwolnienie poniลผej 35%. Uลผyj Klawiszy kierunkowych, aby przypisaฤ‡ kaลผdy kierunek osobno. Polecenia DroidDeck dziaล‚ajฤ… raz na wychylenie. Klikniฤ™cie drฤ…ลผka ustawia siฤ™ osobno. + Przytrzymywane podczas dotykania touchpada; zwalniane po podniesieniu palca. Polecenia DroidDeck dziaล‚ajฤ… raz na dotkniฤ™cie. Klikniฤ™cie touchpada ustawia siฤ™ osobno. + Przytrzymywane, gdy spust przekroczy 55%; zwalniane poniลผej 35%. Polecenia DroidDeck dziaล‚ajฤ… raz na naciล›niฤ™cie. + Kierunek przewijania + Pionowo + Poziomo + Przewijaj poziomo + Pomiary + Wล‚ฤ…cz nagrywanie, uลผyj sterowania w dziaล‚ajฤ…cej sesji, a nastฤ™pnie wrรณฤ‡ i odczytaj wyniki. Mierzy tylko czas wysyล‚ania DroidDeck, nie opรณลบnienie ekranu. Nagrywanie koล„czy siฤ™ przy zamkniฤ™ciu procesu aplikacji. + Elementรณw sterowania: %1$d + Inne zapisane ukล‚ady (%1$d) โ–พ + Ukryj inne zapisane ukล‚ady (%1$d) โ–ด + Home / Guide + Wstecz ยท jedno dotkniฤ™cie + Wstecz ยท dwukrotne dotkniฤ™cie + Wstecz ยท dwa razy w Steam, raz na pulpicie + W trybie Steam. Przytrzymanie Wstecz otwiera teลผ szybki dostฤ™p. + Przywrรณฤ‡ domyล›lne + Wybรณr panelu jest zapamiฤ™tywany. Pulpit otwiera drugฤ… przestrzeล„ roboczฤ…; nie przeล‚ฤ…cza sesji ani jej profilu wejล›cia. + Wirtualny kontroler + Typ kontrolera widziany przez Steam lub grฤ™. + Ekran dotykowy + Jak obsล‚ugiwane sฤ… dotkniฤ™cia na ekranie gry. Przyciski profilu zachowujฤ… przypisane akcje. + Kursor dotyku + Pokazuj wskaลบnik dla bezpoล›rednich dotkniฤ™ฤ‡ na ekranie gry. + Dotknij i przytrzymaj + Akcja myszy przy przytrzymaniu palca na ekranie gry. + Dotkniฤ™cia przycisku Wstecz + Pierwsza akcja: jedno dotkniฤ™cie. Druga akcja: dwukrotne dotkniฤ™cie. + Przycisk przeล‚ฤ…czania + Dotknij, aby przytrzymaฤ‡, dotknij ponownie, aby zwolniฤ‡. Otwarcie menu lub zmiana profilu zwalnia przycisk. + Ksztaล‚t + Zaokrฤ…glony + Kapsuล‚ka + Koล‚o + Prostokฤ…t + Etykieta przycisku + Tekst + Zaimportowany obraz + Osobne klawisze ukoล›ne + Przypisz klawisz do kaลผdej przekฤ…tnej. Pusta przekฤ…tna naciska dwa sฤ…siednie kierunki. + Sฤ…siednie kierunki + Twoje stare klawisze ekranowe sฤ… zapisane poniลผej jako zaimportowane profile. Wybierz jeden, aby go uลผyฤ‡ lub edytowaฤ‡. Bieลผฤ…ce wybory profili zostaล‚y zachowane. + Nie udaล‚o siฤ™ automatycznie zaimportowaฤ‡ starych klawiszy ekranowych. Oryginalne ustawienia zostaล‚y zachowane. + diff --git a/app/src/main/res/values-pl/input_strings.xml b/app/src/main/res/values-pl/input_strings.xml new file mode 100644 index 0000000000..fcd5fdf9dd --- /dev/null +++ b/app/src/main/res/values-pl/input_strings.xml @@ -0,0 +1,38 @@ + + + Profile wejล›cia + Profile + Fizyczny kontroler + Gล‚รณwny ekran + Dodatkowy ekran + Natywny / Steam Input + Natywny: %1$s + Wyล›lij inne sterowanie kontrolera + Wyล‚ฤ…czone + Klawisz lub kombinacja klawiszy + Klawisze kierunkowe + Przesuล„ wskaลบnik + Szybkoล›ฤ‡ wskaลบnika: %1$d + Przewiล„ + Przewiล„ w pionie + Lewy przycisk myszy + Prawy przycisk myszy + ลšrodkowy przycisk myszy + Otwรณrz menu DroidDeck + Pokaลผ klawiaturฤ™ + Otwรณrz menu Steam + Otwรณrz szybki dostฤ™p Steam + Usuล„ element sterujฤ…cy + Dodaj element sterujฤ…cy + Przyciski specyficzne dla urzฤ…dzenia + Przypisz przycisk fizyczny + Zwolnij przycisk, a nastฤ™pnie wybierz Edytuj, Ponรณw lub Anuluj. B lub Wstecz anuluje po zwolnieniu. + Ponรณw + Naciล›nij przycisk, w tym przycisk Wstecz zgล‚aszany jako klawisz. Klawisze gล‚oล›noล›ci i systemowe Android sฤ… zarezerwowane. Przypisanie dotyczy tylko tego urzฤ…dzenia. + Usuล„ przypisanie + Diagnostyka wejล›cia + Zapisuj czas wysyล‚ania wejล›cia + Odczytaj pomiary + Mierzy wysyล‚anie z Androida do publikacji w istniejฤ…cym transporcie wejล›cia. Nie obejmuje przybycia przez Bluetooth, odpytywania goล›cia, renderowania ani opรณลบnienia ekranu. Nagrywanie jest domyล›lnie wyล‚ฤ…czone. + Uลผyj normalnego przypisania wejล›cia + diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 4d00ba2ee8..de994d5239 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -28,6 +28,8 @@ Wstrzymaj teraz Zatrzymaj sesjฤ™ Generowanie klatek + Ustawienia tej gry + Ustawienia domyล›lne Wybierz tryb generowania klatek Wyล‚. DD-FG %1$dร— @@ -183,6 +185,7 @@ Nie udaล‚o siฤ™ pobraฤ‡ ล›rodowiska graficznego PowerVR. Sprawdลบ poล‚ฤ…czenie i sprรณbuj ponownie. Nie udaล‚o siฤ™ pobraฤ‡ DirectAudio, wiฤ™c w tej sesji dลบwiฤ™k gier uลผywa wolniejszej ล›cieลผki. Ten program + Sesja nie mogล‚a wyล›wietliฤ‡ obrazu na ekranie: %1$s. Ten ekran pokazuje przyczynฤ™ zamiast czarnego obrazu; szczegรณล‚y znajdujฤ… siฤ™ w logach sesji. Nie udaล‚o siฤ™ pobraฤ‡ klienta Steam. Twoja sieฤ‡ lub VPN moลผe blokowaฤ‡ serwery Steam; sprawdลบ poล‚ฤ…czenie i sprรณbuj ponownie. Nie udaล‚o siฤ™ skonfigurowaฤ‡ klienta Steam. Sprawdลบ poล‚ฤ…czenie i wolne miejsce, a potem sprรณbuj ponownie. %1$s jest zbudowany dla komputerรณw x86 i dziaล‚a przez FEX, ktรณry nie jest jeszcze zainstalowany. Uruchom raz Steam po zalogowaniu i pozwรณl mu pobraฤ‡ FEX oraz Steam Linux Runtime, a potem uruchom program ponownie. @@ -387,6 +390,9 @@ Tutaj jeszcze nieobsล‚ugiwane Wczytywanie komponentรณwโ€ฆ Nie udaล‚o siฤ™ zainstalowaฤ‡: %1$s + Pobrane pliki wymagajฤ… aktualizacji. + Aktualizacja w kolejce. + Ponรณw aktualizacjฤ™ Pobrano Pobieranie %1$s Instalowanie: %1$s @@ -417,6 +423,22 @@ Tylko pamiฤ™ฤ‡ wewnฤ™trzna Folder: %1$s Druga biblioteka + Wiฤ™cej bibliotek Steam + Foldery, do ktรณrych Steam moลผe instalowaฤ‡ gry i z ktรณrych moลผe je uruchamiaฤ‡, kaลผdy pod wล‚asnฤ… nazwฤ…. Usuniฤ™cie folderu zostawia jego gry na dysku. + Dodaj bibliotekฤ™ + Zmieล„ nazwฤ™ + Nazwa biblioteki + Wybierz folder dla biblioteki + Maksymalnie %1$d dodanych bibliotek + Ten folder jest juลผ bibliotekฤ… lub znajduje siฤ™ wewnฤ…trz innej + %1$s ยท niedostฤ™pna + Zacznie obowiฤ…zywaฤ‡ od nastฤ™pnej sesji Steam + Znaleziono na tym urzฤ…dzeniu ยท %1$s ยท %2$s + Dodaj + Znajdลบ biblioteki w pamiฤ™ci wewnฤ™trznej + Zezwรณl na dostฤ™p do wszystkich plikรณw, aby DroidDeck mรณgล‚ widzieฤ‡ biblioteki Steam, ktรณre inne aplikacje przechowujฤ… w pamiฤ™ci wewnฤ™trznej + Zezwรณl + Dodano %1$s, bibliotekฤ™ Steam znajdujฤ…cฤ… siฤ™ w wybranym folderze Gry, ktรณre strumieniujฤ… zasoby z karty SD lub pamiฤ™ci wspรณล‚dzielonej, mogฤ… siฤ™ zacinaฤ‡. Diagnostyka pamiฤ™ci Zapisuje wyniki alokacji i prรณbkowane czasy dostฤ™pu do pamiฤ™ci w โ€žUdostฤ™pnij logiโ€. Po wล‚ฤ…czeniu moลผe spowalniaฤ‡ instalacje. Dziaล‚a od nastฤ™pnej sesji. @@ -482,6 +504,7 @@ Wล‚. Uruchamia siฤ™ ze Steam Uruchamia siฤ™ bez Steam + Rozdzielczoล›ฤ‡ gry Ustawienia Ustawienia: %1$s Domyล›lne @@ -569,6 +592,8 @@ Rdzenie gier Rdzenie gier Rdzenie dla gier. Gdy wszystkie sฤ… zaznaczone, Android swobodnie przydziela zadania. + Oszczฤ™dzaj energiฤ™ w stabilnych grach + Uruchamia grฤ™ na wolniejszych rdzeniach, dopรณki utrzymuje stabilnฤ… liczbฤ™ klatek, a gdy zaczyna nie nadฤ…ลผaฤ‡, przywraca jej zwykล‚e rdzenie. Interfejs klienta Wielowฤ…tkowy GL Moลผe poprawiฤ‡ responsywnoล›ฤ‡ menu Steam. @@ -604,7 +629,10 @@ Wyล‚ฤ…cza pomocnika Proton do nawigacji kontrolerem, ktรณry zuลผywa CPU w kaลผdej grze. Uruchamiaj proot bez seccomp Moลผe naprawiฤ‡ bล‚ฤ™dy brakujฤ…cych wywoล‚aล„ systemowych na niektรณrych jฤ…drach. Moลผe obniลผyฤ‡ wydajnoล›ฤ‡. + Uruchom bez proot (eksperymentalne) + Uruchamia ล›rodowisko Linux bezpoล›rednio na Androidzie. Zacznie obowiฤ…zywaฤ‡ od nastฤ™pnej sesji. Wyล‚ฤ…cz, jeล›li coล› nie chce siฤ™ uruchomiฤ‡. Szybka ล›cieลผka proot + Nie jest uลผywane bez proot. Wymaga filtra seccomp proot. Szybsze wyszukiwanie plikรณw i mniej przyciฤ™ฤ‡. Wyล‚ฤ…cz, jeล›li program nie moลผe znaleลบฤ‡ swoich plikรณw. Rysuj kursor w gamescope @@ -687,6 +715,7 @@ Pamiฤ™ฤ‡ graficzna Pamiฤ™ฤ‡ wymiany Poziom baterii + Pozostaล‚y czas pracy baterii Pobรณr mocy Sieฤ‡ Rozdzielczoล›ฤ‡ @@ -815,6 +844,7 @@ Urzฤ…dzenie obsล‚ugiwane Nieprzetestowany GPU GPU nieobsล‚ugiwany + GPU przez mostek Mali %1$s ยท %2$s %1$s: %2$s Brak zgodnego zaplecza graficznego dla %1$s. Steam moลผe wyล›wietlaฤ‡ czarny ekran. @@ -844,15 +874,38 @@ Sesja Logi sesji Zapisywane po kaลผdej sesji + Rozszerzona diagnostyka dla nastฤ™pnej sesji + Zapisuje szczegรณล‚owe logi przez jednฤ… sesjฤ™. Moลผe obniลผyฤ‡ wydajnoล›ฤ‡ i zajฤ…ฤ‡ wiฤ™cej miejsca. Wyล‚ฤ…cza siฤ™ sama w momencie uruchomienia sesji; przed udostฤ™pnieniem przejrzyj logi. Logi debugowania gier Doล‚ฤ…cz diagnostykฤ™ Proton, Wine i grafiki przy nastฤ™pnym uruchomieniu gry. Moลผe obniลผyฤ‡ wydajnoล›ฤ‡ i zajฤ…ฤ‡ wiฤ™cej miejsca. Uruchom ponownie tฤ™ sesjฤ™, aby zapisywaฤ‡ logi debugowania gier Nie udaล‚o siฤ™ zmieniฤ‡ logowania. Sprawdลบ przeล‚ฤ…cznik i sprรณbuj ponownie. Narzฤ™dzia debugowania + Szczegรณล‚owe logi graficzne + Interfejs Steam: rysowanie przez GPU + Z parฤ… sterownikรณw Xclipse Steam rysuje swoje strony programowo (rysowanie przez GPU dawaล‚o uszkodzone kafelki). Wล‚ฤ…cz, aby przyspieszyฤ‡ interfejs Steam, jeล›li na tym telefonie wyglฤ…da poprawnie. + zbudowano %1$s + %1$s zaktualizowano do najnowszej kompilacji + Most Mali nie przeszedล‚ autotestu na %1$s w poprzedniej sesji (obrazy lub rysowanie), wiฤ™c zamiast niego uลผyto pary sterownikรณw PanVK. + Most Mali nie znalazล‚ sposobu na wspรณล‚dzielenie pamiฤ™ci ze sterownikiem na %1$s w poprzedniej sesji, wiฤ™c zamiast niego uลผyto pary sterownikรณw PanVK. Most nie moลผe dziaล‚aฤ‡ na tym telefonie; wyล‚ฤ…czenie go pozostawia parฤ™ PanVK. + Dzienniki Proton, DXVK i sterownikรณw kaลผdej gry znajdujฤ… siฤ™ w dziennikach sesji. Zawsze wล‚ฤ…czone, gdy GPU nie jest Adreno. Najnowsze logi sesji Zapisane logi sesji Zachowuje najnowsze: %1$d Wyczyล›ฤ‡ logi + Dostฤ™pne dzienniki sesji + Brak zapisanych dziennikรณw sesji. + Udostฤ™pniane i zapisywane archiwa ZIP zawierajฤ… wybranฤ… sesjฤ™ oraz powiฤ…zane dane diagnostyczne Steam, sklepu, narzฤ™dzi i Battle.net. + %1$s ยท %2$s + Bieลผฤ…ca sesja + Udostฤ™pnij + Zapisz na urzฤ…dzeniu + Usuล„ + Usunฤ…ฤ‡ dzienniki sesji? + Usunฤ…ฤ‡ %1$s? Tej operacji nie moลผna cofnฤ…ฤ‡. + Zapisano dzienniki sesji. + Nie udaล‚o siฤ™ zapisaฤ‡ dziennikรณw sesji. + Nie udaล‚o siฤ™ usunฤ…ฤ‡ dziennikรณw sesji. Zresetuj wszystkie ustawienia Przywrรณฤ‡ kaลผde ustawienie do wartoล›ci domyล›lnej Resetuj @@ -879,6 +932,8 @@ Uลผyj jako ekranu gล‚รณwnego DroidDeck moลผe byฤ‡ aplikacjฤ… ekranu gล‚รณwnego DroidDeck nigdy nie jest proponowany jako aplikacja ekranu gล‚รณwnego + Przycisk ekranu gล‚รณwnego otwiera + Strona wyล›wietlana, gdy DroidDeck jest aplikacjฤ… ekranu gล‚รณwnego i naciล›niesz przycisk ekranu gล‚รณwnego W sekcji Dodaj gry ustaw DroidDeck na Uwzglฤ™dnij Orientacja Orientacja launchera @@ -892,15 +947,22 @@ Peล‚ny ekran Ukrywa systemowe paski stanu i nawigacji Pokazuje systemowe paski stanu i nawigacji + Launcher na dwรณch ekranach + Automatycznie umieszcza sekcje launchera (Steam, Biblioteka, Sklepy i pozostaล‚e) na wbudowanym drugim ekranie konsol przenoล›nych. Wล‚ฤ…czone uลผywa dowolnego drugiego wyล›wietlacza. Wyล‚ฤ…czone pozostawia launcher na jednym ekranie. + Sesje na dwรณch ekranach + Automatycznie przypina menu w grze do wbudowanego drugiego ekranu zamiast okna podrฤ™cznego. Wล‚ฤ…czone uลผywa dowolnego drugiego wyล›wietlacza. Wyล‚ฤ…czone pozostawia menu na ekranie gry; nadal moลผna z poziomu menu wybraฤ‡ drugi ekran. Automatycznie Wล‚ฤ…czone Wyล‚ฤ…czone Sterowanie na dolnym ekranie w grach + Klawiatura systemu Android do pรณl tekstowych Otwiera gล‚adzik i klawiaturฤ™ na drugim ekranie po rozpoczฤ™ciu sesji. Pisanie dla gรณrnego ekranu Gotowe Domyล›lna aplikacja ekranu gล‚รณwnego Wybierz aplikacjฤ™ ekranu gล‚รณwnego + Ukryj launchera w ostatnich aplikacjach podczas bezczynnoล›ci + Dotyczy tylko sytuacji, gdy DroidDeck jest domyล›lnฤ… aplikacjฤ… ekranu gล‚รณwnego i nie trwa ลผadna sesja. Wybierz Aplikacje Linux (beta) Pliki @@ -1012,9 +1074,174 @@ Preview Najnowsze poprawki, zanim trafiฤ… do Stable Aktualne + Kopiuj szczegรณล‚y kompilacji + Skopiowano szczegรณล‚y kompilacji + Nowsza niลผ Preview + Wyprzedzasz Preview + Ta kompilacja jest nowsza niลผ najnowsza Preview. Zaktualizuje jฤ… nastฤ™pna kompilacja Preview. + Wybierz kompilacjฤ™, aby zobaczyฤ‡ zmiany lub jฤ… zainstalowaฤ‡. + Zainstalowana + Zainstaluj tฤ™ kompilacjฤ™%1$s + Wrรณฤ‡ do tej kompilacji%1$s + versionCode %1$d + Commit %1$s + Strona wydania + PR ma nowszy commit (%1$s). Jego kompilacja testowa nie jest jeszcze gotowa, wiฤ™c ta go nie zawiera. + Nowszy commit, kompilacja w toku + Numer PR, tytuล‚ lub autor + Brak pasujฤ…cych kompilacji testowych + Wymaga ponownej kompilacji (versionCode %1$d) + Aktualizacje kompilacji testowych + Nowa kompilacja testowa PR #%1$d + %1$s. Otwรณrz Aktualizacje, aby jฤ… zainstalowaฤ‡. + Pokaลผ wiฤ™cej (%1$d) + Wymagajฤ… ponownej kompilacji dla versionCode %2$d (%1$d) + Kompilacje Preview na main od tej kompilacji testowej: %1$d Kompilacje testowe Wyprรณbuj poprawkฤ™ przed jej wydaniem Obecnie ลผadnych + Kompilacja testowa + Kompilacje testowe + W uลผyciu + Wstrzymana po ponownej optymalizacji DroidDeck przez system Android + Nie wczytano: %1$s + Oczekiwanie na restart + Zachowano + Dla innej wersji + Przebuduj + Usuwa tฤ™ kompilacjฤ™ z urzฤ…dzenia + Uruchom ponownie na niej + Wyล‚ฤ…cz + Uลผyj + Usuล„ + Usuล„ teraz + Nie udaล‚o siฤ™ przygotowaฤ‡ restartu: %1$s. Sparuj debugowanie bezprzewodowe w Ustawieniach i sprรณbuj ponownie. + Zainstalowano kompilacjฤ™ testowฤ… + DroidDeck uruchomiono ponownie na %1$s + Kompilacja Lab wstrzymana + Android ponownie zoptymalizowaล‚ DroidDeck, wiฤ™c %1$s nie jest wczytana. Otwรณrz Aktualizacje, aby ponownie uruchomiฤ‡ na niej DroidDeck. + Kompilacja Lab wyล‚ฤ…czona + Zostaล‚a zbudowana dla innej wersji DroidDeck. Znajduje siฤ™ w Aktualizacjach. + DroidDeck dwukrotnie nie uruchomiล‚ siฤ™ na niej. + Agent + Agent + Agent pracuje + Zainstaluj Claude Code w przestrzeni uลผytkownika Linux, aby korzystaฤ‡ z agenta. + Zapytaj o grฤ™, awariฤ™ lub zmianฤ™ w DroidDeck + Wyล›lij + Nowa rozmowa + Zatrzymaj + Pamiฤ™ฤ‡ + Usuล„ + Usuล„ teraz + Claude Code + Codex + Kod ลบrรณdล‚owy DroidDeck + Pamiฤ™ฤ‡ podrฤ™czna pobraล„ + Zmiany, ktรณre nie zostaล‚y wypchniฤ™te, zostanฤ… utracone. + Kompilacje pobiorฤ… je ponownie. + Konfiguracja moลผe zainstalowaฤ‡ to ponownie; dane logowania zostajฤ… zachowane. + DroidDeck uruchomiล‚ siฤ™ ponownie na twojej kompilacji Lab. Kontynuuj tam, gdzie przerwaล‚eล›. + Zapytaj, dlaczego gra nie chce siฤ™ uruchomiฤ‡, poproล› o wyjaล›nienie logu albo o zmianฤ™ w DroidDeck i wyprรณbowanie jej na tym urzฤ…dzeniu. + Nie udaล‚o siฤ™: %1$s + %1$s zakoล„czyล‚ dziaล‚anie (kod wyjล›cia %2$d) + Zatrzymano + Zakoล„czyล‚o siฤ™ bez odpowiedzi + Ponรณw + Konfigurowanie agenta + Zbuduj ponownie mojฤ… kompilacjฤ™ Lab %1$s dla zainstalowanej wersji DroidDeck i uruchom na niej ponownie DroidDeck. + %1$s wej. ยท %2$s wyj. + Myล›lenie + Myล›l + Myล›lenie ยท %1$s + %1$s ยท %2$s + WEJลšCIE + WYJลšCIE + Trwaโ€ฆ + Brak wyniku: tura zakoล„czyล‚a siฤ™ wczeล›niej + Brak danych wyjล›ciowych + Wpisz, aby zakolejkowaฤ‡ nastฤ™pnฤ… wiadomoล›ฤ‡ + Zakolejkuj + Nastฤ™pna: %1$s + Nie wysyล‚aj + Zaล‚ฤ…cz + Usuล„ + Domyล›lny + Poziom rozumowania + Wykonaj + Zmodyfikuj + Nic jeszcze nie zmieniono + Wykonaj plan. + Wyล›lij teraz + Wiฤ™cej + Zamknij + Najnowsze + Pracuje + Kontekst + %1$s z %2$s + Ta rozmowa ยท %1$s + Zuลผycie pojawi siฤ™ po pierwszej odpowiedzi + %1$d-godzinny limit + %1$d-minutowy limit + Tygodniowy limit + %1$d%% ยท resetuje siฤ™ %2$s + + %1$d pliki + %1$d plikรณw + %1$d plik + %1$d pliku + + Najpierw plan + Plan + Proponuje plan bez wprowadzania zmian + Rozmowy + Nie ma jeszcze rozmรณw + Przed chwilฤ… + Usuล„ + Usuwa rozmowฤ™ i jej zaล‚ฤ…czniki + Procesy + Nic nie dziaล‚a w przestrzeni uลผytkownika Linux + AGENT + Zatrzymaj + Kompilacja Lab + Przygotowywanie kompilacji Lab + %1$d%% ยท pozostaล‚o okoล‚o %2$s + pozostaล‚o okoล‚o %1$s + Anuluj + Anulowaฤ‡ kompilacjฤ™ + Rozpoczynanie + %1$d%% + Pakowanie + Ponowne uruchamianie DroidDeck na nim + Gotowe + Nie udaล‚o siฤ™: %1$s + Skonfiguruj agenta + Najpierw zainstaluj ล›rodowisko uruchomieniowe Linux w ustawieniach. + Ponรณw + Rozpocznij rozmowฤ™ + Poล‚ฤ…czenie z urzฤ…dzeniem + Debugowanie bezprzewodowe, aby agent mรณgล‚ widzieฤ‡ DroidDeck i sterowaฤ‡ nim + Zainstaluj %1$s + Do przestrzeni uลผytkownika Linuksa, z git, gh i adb + Zaloguj siฤ™ do %1$s + Otwiera przeglฤ…darkฤ™ + GitHub + Opcjonalnie, do tworzenia pull requestรณw + Narzฤ™dzia do kompilacji + Opcjonalnie, do kompilacji Lab na tym urzฤ…dzeniu ยท okoล‚o 5 GB + Agent gotowy + Dokoล„cz konfiguracjฤ™ agenta + Zalogowano do %1$s + Kompilacje Lab + szybkie kompilacje + Szybkie kompilacje Lab + Kompiluje tฤ™ wersjฤ™ z wyprzedzeniem, wiฤ™c kompilacje Lab trwajฤ… minuty ยท jednorazowo okoล‚o 20 minut + Kompilowanie ยท %1$d%% ยท pozostaล‚o okoล‚o %2$s + Przygotuj + Debugowanie bezprzewodowe jest niedostฤ™pne; Paruj, aby je wล‚ฤ…czyฤ‡ + Paruj + Zainstaluj + Zaloguj siฤ™ PR #%1$d Nie zbudowano dla tej kopii DroidDeck Zaktualizowano %1$s @@ -1262,6 +1489,9 @@ Aplikacje Konfiguracja Aktualizacje + Wiฤ™cej + Edytuj karty + Karty %1$d%% Wznรณw %1$s W kaลผdej sesji widoczny jako /root/ROMs. Pamiฤ™ฤ‡ wewnฤ™trzna jest w /root/Storage. @@ -1283,6 +1513,15 @@ Anuluj oczekujฤ…ce Klawiatura Android Ukryj โœ• + Rozmiar na ekranie + Czฤ™ล›ฤ‡ ekranu zajmowana przez klawiaturฤ™, wliczajฤ…c nagล‚รณwek. + Krycie + Zmniejsz je, aby zobaczyฤ‡ grฤ™ za klawiaturฤ…. + Ukryte klawisze + Klawisze, ktรณrych rzadko uลผywasz, nie pojawiajฤ… siฤ™ na klawiaturze. + Esc i rzฤ…d klawiszy funkcyjnych + Ins / Del / Home / End / PgUp / PgDn + Klawisze strzaล‚ek Uruchom %1$s Wybierz ekran. Dodatkowy: %1$s. Dodatkowy wyล›wietlacz nie jest juลผ dostฤ™pny. @@ -1818,7 +2057,24 @@ Terminal Uchwyty Deck + trackpady Panel + Pulpit + Uruchom pulpit + Pulpit ยท %1$s + Gล‚adzik + Dotyk bezpoล›redni + Gล‚adzik. Dotknij, aby przeล‚ฤ…czyฤ‡ na dotyk bezpoล›redni + Dotyk bezpoล›redni. Dotknij, aby przeล‚ฤ…czyฤ‡ na gล‚adzik + Uruchamianie pulpitu KDEโ€ฆ + Pulpit zostaล‚ zamkniฤ™ty. + Nie udaล‚o siฤ™ uruchomiฤ‡ pulpitu. Jego logi znajdujฤ… siฤ™ w folderze bottom-desktop tej sesji. + Pulpit jest zamkniฤ™ty. Na razie nie ma tu nic do pokazania. + Zamieล„ ekrany + Dolny ekran jest teraz zajฤ™ty + Ekran gry + Wyล›wietl grฤ™ na + Gรณrny ekran + Dolny ekran Pobieranie Nic nie jest pobierane. Steam @@ -1853,6 +2109,20 @@ Paliwo, t Gล‚รณwne %1$s t Rezerwa %1$s t + Czas klatki + ostatnie %1$d s + ล›redni czas klatki + najniลผsze 1% + klatki powyลผej 33 ms + %1$d / min + Czas gry: %1$s + %1$d rdzeni, do %2$s GHz + %1$d rdzeni + gra + FPS przy %1$d Hz + Czerwony znacznik wskazuje temperaturฤ™, od ktรณrej HUD wyล›wietla jฤ… na czerwono. + caล‚e urzฤ…dzenie + bateria Wysyล‚aj dane do panelu Automatycznie Wล‚ฤ…cza wysyล‚anie dla kaลผdej gry z tej listy, takลผe dla gier znalezionych pรณลบniej. Gry, ktรณre wyล‚ฤ…czysz, pozostanฤ… wyล‚ฤ…czone. @@ -1876,6 +2146,10 @@ Mikrofon jest wyล‚ฤ…czony dla tej gry. Aby rozmawiaฤ‡, wล‚ฤ…cz Mikrofon w ustawieniach Steam w DroidDeck (Dลบwiฤ™k) i uruchom grฤ™ ponownie. Gล‚oล›noล›ฤ‡ %1$d%% Statystyki w grze + HUD dolnego ekranu + Pasek na kaลผdej karcie + najniลผsze 1% i 0,1% + Temperatura CPU FPS CPU GPU @@ -2050,6 +2324,7 @@ Uruchamianie sesjiโ€ฆ Minฤ™ล‚o %1$d:%2$02d ยท nadal trwa Pobieranie aktualizacji klienta Steam ยท %1$d%% + Instalowanie aktualizacji klienta Steamโ€ฆ Pobieranie klienta Steam ยท %1$s Instalacja narzฤ™dzia zgodnoล›ci juลผ trwa @@ -2126,11 +2401,29 @@ Kreskรณwkowe kontury i wyostrzenie. To nie jest GPU Adreno + Systemowy sterownik PowerVR: kompatybilnoล›ฤ‡ zaleลผy od urzฤ…dzenia + Eksperymentalne: RADV lub systemowy sterownik Xclipse + Systemowy PowerVR + Uลผywa wbudowanych sterownikรณw tego GPU + Wybrano systemowy sterownik PowerVR dla ล›rodowiska uruchomieniowego i wyล›wietlania. + ลปaden otwarty sterownik nie obsล‚uguje jeszcze tego Mali: mostek Mali jest wล‚ฤ…czony. + To testowa kompilacja dla urzฤ…dzeล„ bez Snapdragona: oficjalne kompilacje tutaj dziaล‚ajฤ… tylko na Adreno, wiฤ™c nie nadpisujฤ… jej. Nowe kompilacje testowe sฤ… na github.com/The412Banner/droiddeck-nonadreno-drivers. + Ostatnia sesja zakoล„czyล‚a siฤ™, bo Android zamknฤ…ล‚ DroidDeck, ลผeby zwolniฤ‡ pamiฤ™ฤ‡. To nie byล‚a awaria. Zamknij inne aplikacje lub obniลผ ustawienia tekstur gry i sprรณbuj ponownie. + Mali (Venus) + mostek Mali + ลปaden otwarty sterownik nie obsล‚uguje jeszcze tego Mali: uลผywany jest %1$s na wล‚asnym sterowniku telefonu. + %1$s nie zostaล‚ jeszcze opublikowany: do tego czasu uลผywany jest %2$s. + %1$s jest niedostฤ™pny, a sterownik tego telefonu zgล‚asza Vulkan %2$s (Venus wymaga 1.2): uลผywany jest mostek Mali. + %1$s nie zostaล‚ jeszcze opublikowany: do tego czasu mostek Mali jest wล‚ฤ…czony. + W kolejce: %1$s (oczekiwanie na inny sterownik ล›rodowiska uruchomieniowego) + DXVK jest dostarczany przez systemowe ล›rodowisko uruchomieniowe PowerVR. Inne pakiety DXVK moลผna przechowywaฤ‡, ale nie sฤ… stosowane z tym sterownikiem. Obsล‚ugiwany Eksperymentalny: jego sterowniki to wersje testowe Eksperymentalna obsล‚uga Adreno 850: wymaga zgodnych eksperymentalnych sterownikรณw ekranu i gier; nie zweryfikowano na tym urzฤ…dzeniu Poniลผej testowanego sprzฤ™tu (Adreno 725 i nowsze): moลผe nie dziaล‚aฤ‡ Nieobsล‚ugiwany: brak zgodnego zaplecza graficznego dla tego GPU + Dziaล‚a przez mostek Mali, na wล‚asnym sterowniku Vulkan telefonu + Nieobsล‚ugiwane przy wyล‚ฤ…czonym moล›cie Mali: Turnip wymaga GPU Adreno (Snapdragon) Osiฤ…gniฤ™to limit zapytaล„ GitHub โ€“ sprรณbuj ponownie pรณลบniej GitHub odpowiedziaล‚ HTTP %1$d @@ -2239,7 +2532,6 @@ Sklepy Steam Wล‚asna - Sklepy Poziom szybkoล›ci pobierania Zbalansowany Szybki @@ -2278,6 +2570,7 @@ Oczekiwanie na drugie pobieranie z Battle.netโ€ฆ Otwรณrz Battle.net i zaloguj siฤ™ raz, a potem instaluj jego gry tutaj. Program pobierajฤ…cy Blizzarda zatrzymaล‚ siฤ™: %1$s + Program pobierajฤ…cy Blizzarda przestaล‚ robiฤ‡ postฤ™py. Bล‚ฤ…d Blizzarda %1$s Aktualizuj Gry Blizzarda @@ -2285,6 +2578,7 @@ Przerwano Instalacja ยท %1$s Odbierz bezpล‚atnie + Dodawanie do bibliotekiโ€ฆ Zobacz w %1$s Kup ยท %1$s Zainstalowano @@ -2331,6 +2625,12 @@ Sortuj Etykiety paska bocznego Pokazuj nazwy pod ikonami paska bocznego. Wyล‚ฤ…cz, aby pasek byล‚ wฤ™ลผszy. + Maskotka agenta + DeeDee wyล›wietla siฤ™ nad launcherem i grami oraz pokazuje, co robi agent. + Nad innymi aplikacjami + Pozwรณl DeeDee wyล›wietlaฤ‡ siฤ™ nad kaลผdฤ… aplikacjฤ… i otwieraฤ‡ tam jej czat + Zezwรณl + Czat z DeeDee Wyล›wietlanie Wiฤ™ksze karty Mniejsze karty @@ -2619,7 +2919,14 @@ %1$s ยท wymaga restartu To urzฤ…dzenie Usunฤ…ฤ‡ %1$s? - Diagnostyka + Programista + Znak wodny z etykietฤ… kompilacji + Pokazuj na ekranie etykietฤ™ kompilacji testowej lub Lab. Domyล›lnie wล‚ฤ…czone. + Udostฤ™pnij pakiety diagnostyczne + Sesja i urzฤ…dzenie + Grafika + Gry i zgodnoล›ฤ‡ + Wszystkie pakiety Gotowe do gry Jeszcze nie gotowe do gry ล›rodowisko %1$s @@ -2658,6 +2965,9 @@ Wล‚ฤ…cz osiฤ…gniฤ™cia GOG w ustawieniach Store Osiฤ…gniฤ™cia niedostฤ™pne; sprawdลบ dzienniki sesji Osiฤ…gniฤ™cie odblokowane + Mali (Venus): wyล‚ฤ…czone + Mali (Venus): wล‚ฤ…czone + Sterownik na %1$s zgล‚asza Vulkan %2$s. Mali (Venus) wymaga Vulkan 1.2 lub nowszego (na starszych wersjach gamescope siฤ™ nie uruchamia), wiฤ™c sesje pomijajฤ… Venus i zamiast tego uลผywajฤ… pary sterownikรณw PanVK. Wklej Lewy drฤ…ลผek Prawy drฤ…ลผek @@ -2948,7 +3258,7 @@ Wybierz folderโ€ฆ Uลผyj dowolnego folderu na karcie SD lub dysku USB Gry trafiajฤ… do folderu Games w wybranym miejscu. Istniejฤ…ce gry nie sฤ… przenoszone. - Gdzie to trafia + Co zajmuje miejsce Gry Steam Dane gier Prefiksy %1$s ยท warsztat %2$s ยท shadery %3$s @@ -3017,6 +3327,7 @@ Instalacje VC++ i DirectX wymagane przez gry Uruchamia gry Linux x86 Narzฤ™dzie Steam + Steam pobiera ten skล‚adnik dla gier z systemem antycheatowym nawet wtedy, gdy jest wyล‚ฤ…czony. Jego usuniฤ™cie zatrzymuje ich instalacjฤ™ na 0%. DroidDeck uruchamia gry bez tego ล›rodowiska Proton x86, ktรณrego DroidDeck nie potrafi uruchomiฤ‡ Domyล›lne dla wszystkich gier @@ -3094,6 +3405,19 @@ Zachowane Gry poza Steam i wspรณล‚dzielony prefiks Steam Prefiksy gier dodanych przez sklepy lub rฤ™cznie + Wspรณล‚dzielony prefiks Steam + Steam uruchamia tu wล‚asne narzฤ™dzia pomocnicze Windows + Usuwa go (%1$s). Steam utworzy nowy, gdy znรณw bฤ™dzie potrzebny. + Aplikacja sklepu i gry, ktรณre z niฤ… dziaล‚ajฤ… + Uลผywany przez: %1$s + Gra spoza Steam %1$s + Nie pasuje do ลผadnej gry, wiฤ™c zostaje zachowany + Usuล„ wybrane ยท %1$s + Odinstaluj wybrane ยท %1$s + Prefiksy Wine + Zapisy i ustawienia w nich zostanฤ… utracone; zapisy w Steam Cloud pozostajฤ… na Twoim koncie. + Pamiฤ™ci podrฤ™czne shaderรณw + Prefiks %1$s ยท shadery %2$s Pobrane pakiety Zachowane oryginaล‚y Nie pobrano ลผadnych pakietรณw komponentรณw. @@ -3132,6 +3456,8 @@ DroidDeck ยท %1$d kl./s 60 kl./s wyglฤ…da pล‚ynniej, ale bardziej obciฤ…ลผa procesor podczas uruchamiania Steam. Film wybrany w ustawieniach Steam teลผ jest tu widoczny. Dลบwiฤ™k + Pomiล„ film startowy + Uลผyj 0,1-sekundowego czarnego klipu jako filmu startowego Steam. Zacznie obowiฤ…zywaฤ‡ w nastฤ™pnej sesji. Wล‚asny film MP4, MOV, MKV lub WebM. Inne formaty i pliki powyลผej %1$d MB sฤ… konwertowane na urzฤ…dzeniu do WebM 720p, do %2$d sekund. Importuj @@ -3593,6 +3919,7 @@ Zatrzymuje Alt+Tab, klawisz Win i przycisk Home w aktywnej sesji DroidDeck zamiast w Androidzie. Wล‚ฤ…cz Jasnoล›ฤ‡ w Konfiguracja โ†’ Integracja ze Steam Most Mali: wyล‚. + %1$s nie moลผe uลผywaฤ‡ mostku Mali (wymaga GPU Mali bez ล›cieลผki sterownika systemowego), wiฤ™c ten przeล‚ฤ…cznik nic tu nie zmienia. Most Mali: wล‚. %1$s to nie Adreno. Eksperymentalny most Vulkan jest wล‚ฤ…czony: sesja rysuje przez wล‚asny sterownik telefonu. Spodziewaj siฤ™ bล‚ฤ™dรณw; wyล›lij logi sesji. Tryb bezpieczny @@ -3618,6 +3945,25 @@ Przesuล„ pรณลบniej Ustawienia widลผetu Usuล„ widลผet + Wyglฤ…d + Pakiet ikon + Domyล›lny systemu + Tล‚o w kolorze aplikacji + Rozmiar ikon + Maล‚y + ลšredni + Duลผy + Ukryj nazwy aplikacji + Odstฤ™py + Ciasne + ลšrednie + Luลบne + Zmieล„ ikonฤ™ + Resetuj ikonฤ™ + Szukaj ikon + Wczytywanie ikonโ€ฆ + Nie znaleziono ikon. + Wล‚asne ikony Dodaj do folderu Nowy folder Usuล„ z folderu @@ -3735,5 +4081,81 @@ Nie moลผna zaimportowaฤ‡ tego ukล‚adu Szkarล‚atny ล›nieg + Biaล‚e powierzchnie z czerwonymi akcentami. + ลšcieลผki dลบwiฤ™kowe + Muzyka + Opcje odtwarzania + Ulubione + Kolekcje + Brak kolekcji. Dotknij ikony zakล‚adki, aby utworzyฤ‡ nowฤ…. + Zapisane + Utwรณrz kolekcjฤ™ + Uporzฤ…dkuj swoje zapisy + Nowa + Utwรณrz + Nazwa kolekcji + Wpisz nazwฤ™, ktรณrej nie uลผywa ลผadna inna kolekcja + Zarzฤ…dzaj + Zmieล„ nazwฤ™ + Dodaj utwory + Dodaj (%1$d) + Usuล„ utwory + Usuล„ kolekcjฤ™ + Usunฤ…ฤ‡ %1$s? + Utwory pozostajฤ… na urzฤ…dzeniu. Usuniฤ™ta zostanie tylko kolekcja. + Zaznacz + Zaznacz wszystko + Odznacz wszystko + Zaznaczono: %1$d + Dodaj do kolekcji + Dodaj do ulubionych + Usuล„ z kolekcji + Szukaj utworรณw + Kolejnoล›ฤ‡ z albumu + Najdล‚uลผsze najpierw + Najkrรณtsze najpierw + Utwory + Wysokoล›ฤ‡ dลบwiฤ™ku + Resetuj + Pomijaj ciszฤ™ + Wyล‚ฤ…cznik czasowy + %1$d min + Koniec utworu + Pozostaล‚o %1$s + Korektor + Wzmocnienie basรณw + Korektor nie jest dostฤ™pny na tym urzฤ…dzeniu + Wล‚ฤ…cz w grze + Odtwarzaj ล›cieลผkฤ™ dลบwiฤ™kowฤ… podczas dziaล‚ania gry + Brak zainstalowanych ล›cieลผek dลบwiฤ™kowych. + Szukaj ล›cieลผek dลบwiฤ™kowych + Dodaj folder ze ล›cieลผkฤ… dลบwiฤ™kowฤ… + Brak plikรณw audio w tym folderze + Caล‚kowity czas + Utworรณw: %1$d / %2$s + Pล‚yta %1$s + Losowo + Poprzedni + Odtwรณrz + Wstrzymaj + Nastฤ™pny + Powtarzanie wyล‚ฤ…czone + Powtarzaj wszystko + Powtarzaj jeden + Gล‚oล›noล›ฤ‡ + Brak plikรณw audio w tej ล›cieลผce dลบwiฤ™kowej + Uruchomienie niedostฤ™pne + Brak przeglฤ…darki internetowej do otwarcia tego linku. + Chwyฤ‡ + Upuล›ฤ‡ + Zapisz + Przytrzymaj, aby zresetowaฤ‡ + Sklepy + Czas klatki + ลšrednia liczba klatek + Serwer wyล›wietlania + Stan HDR + Pokazane + %1$d z %2$d diff --git a/app/src/main/res/values-pt-rPT/input_library.xml b/app/src/main/res/values-pt-rPT/input_library.xml new file mode 100644 index 0000000000..498a7442e0 --- /dev/null +++ b/app/src/main/res/values-pt-rPT/input_library.xml @@ -0,0 +1,132 @@ + + + O ecrรฃ selecionado nรฃo estรก disponรญvel. Ligue-o para editar esta disposiรงรฃo no tamanho real. + Descartar as alteraรงรตes de disposiรงรฃo nรฃo guardadas? + Esta disposiรงรฃo รฉ usada por %1$d perfis. As alteraรงรตes guardadas aplicam-se a todos. + Perfis predefinidos + Modo de ambiente de trabalho + Modo de jogo + Predefinido para ambiente de trabalho e jogo + Predefinido para o modo de jogo + Predefinido para o modo de ambiente de trabalho + Definiรงรตes do dispositivo + Controlos + Botรตes, analรณgicos, gatilhos e teclas extra + Copiar perfil + Repor aรงรตes + Repor as aรงรตes de %1$s nos valores predefinidos do perfil base? As disposiรงรตes e os outros perfis mantรชm-se iguais. + Eliminar %1$s? Os modos que o usam voltam ao perfil predefinido integrado. As disposiรงรตes guardadas e as definiรงรตes partilhadas continuam disponรญveis. + Visibilidade + Aplica-se a todos os perfis. Auto mostra os controlos do ecrรฃ principal quando nรฃo hรก comando ligado no modo de jogo. + Editar no ecrรฃ + Disposiรงรตes guardadasโ€ฆ + Escolha uma disposiรงรฃo ou crie a sua + Escolha Controlos do perfil no menu de sessรฃo do ecrรฃ secundรกrio. Os seletores Perfil e Ecrรฃ secundรกrio no menu do comando escolhem os controlos a mostrar. + Aรงรตes dos botรตes + Partilhado com %1$s. As ediรงรตes tambรฉm se aplicam a esses perfis. + Reutilizar definiรงรตes + Usar definiรงรตes deโ€ฆ + Copiar de outro perfil ou manter as definiรงรตes partilhadas + Tornar independente + Manter a configuraรงรฃo atual e deixar de partilhar alteraรงรตes + As disposiรงรตes guardam elementos e posiรงรตes. Cada perfil pode atribuir as suas prรณprias aรงรตes. Edite em tamanho real no ecrรฃ de destino. + Disposiรงรฃo atual + Eliminar a disposiรงรฃo nรฃo utilizada %1$s e as suas aรงรตes guardadas? + Mudar o nome da disposiรงรฃo atual + As definiรงรตes de entrada ilegรญveis foram guardadas numa cรณpia de recuperaรงรฃo. Pode continuar a editar os perfis restaurados. + Propriedades + Propriedades do clique + %1$s ยท Clique + Botรตes + Analรณgicos, pads e gatilhos + Ocultar ferramentas + Comando + Envia a entrada do comando para o Steam Input ou para o jogo. + Este elemento nรฃo envia entrada de comando, rato ou teclado. + Clique do rato + Aรงรฃo do DroidDeck + Aรงรฃo + Velocidade de deslocamento: %1$d passos/s + + Novo perfil + + Nova disposiรงรฃo + %1$s ยท Usado por %2$d perfis. As alteraรงรตes aplicam-se a todos os perfis que usam estas atribuiรงรตes. + Mudar o nome + Eliminar + Adicione elementos ร  disposiรงรฃo antes de atribuir as suas aรงรตes. + Nรฃo foi possรญvel guardar as definiรงรตes de entrada + Nome + Comeรงar de + Botรฃo + Analรณgico + Touchpad + Direcional + Gatilho + Concluรญdo + Anular + + Adicionar + Arraste para mover. Arraste um canto para redimensionar. Toque em Propriedades para atribuir uma aรงรฃo. + A editar no ecrรฃ secundรกrio + Reutilizar %1$s de outro perfil. As outras fontes de controlo mantรชm-se iguais. + Manter os controlos fรญsicos partilhados + Por predefiniรงรฃo, todos os controlos e disposiรงรตes personalizadas sรฃo cรณpias independentes. Partilhar apenas liga os controlos fรญsicos. + Usar estes elementos e posiรงรตes. Partilhar mantรฉm as futuras alteraรงรตes de geometria sincronizadas; as aรงรตes dos botรตes continuam independentes. Uma disposiรงรฃo diferente comeรงa com aรงรตes nรฃo atribuรญdas. + Copiar estes controlos e aรงรตes, ou ligรก-los para que alteraรงรตes futuras se apliquem aos dois perfis. + Manter partilhado + Cรณpia independente + Iniciar o analรณgico no ponto de toque + Ocultar o analรณgico quando nรฃo estรก a ser usado + Ferramentas + Auto (%1$s) + Personalizado (%1$s) + Guardar como novo perfil + Controlos do perfil + Perfil + Gestos do touchpad do rato + Quando atribuรญdo ao ponteiro do rato: toque para clicar, mantenha para arrastar e desloque com dois dedos. + %1$s tem uma substituiรงรฃo do menu rรกpido. Selecione Auto para usar o perfil predefinido e as trรชs partes guardadas. + Entrada DroidDeck + Mantido enquanto o analรณgico รฉ movido em qualquer direรงรฃo: pressiona acima de 55%, liberta abaixo de 35%. Use Teclas de direรงรฃo para atribuir cada direรงรฃo em separado. Os comandos DroidDeck correm uma vez por desvio. O clique do analรณgico configura-se ร  parte. + Mantido enquanto toca no touchpad; libertado ao levantar o dedo. Os comandos DroidDeck correm uma vez por toque. O clique do touchpad configura-se ร  parte. + Mantido quando o gatilho passa os 55%; libertado abaixo dos 35%. Os comandos DroidDeck correm uma vez por pressรฃo. + Direรงรฃo de deslocamento + Vertical + Horizontal + Deslocar horizontalmente + Mediรงรตes + Ative a gravaรงรฃo, use os controlos numa sessรฃo em curso e depois volte e leia os resultados. Mede apenas o tempo de envio do DroidDeck, nรฃo a latรชncia do ecrรฃ. A gravaรงรฃo termina quando o processo da app fecha. + %1$d controlos + Outras disposiรงรตes guardadas (%1$d) โ–พ + Ocultar outras disposiรงรตes guardadas (%1$d) โ–ด + Inรญcio / Guia + Voltar ยท toque รบnico + Voltar ยท duplo toque + Voltar ยท duas vezes no Steam, uma no ambiente de trabalho + No modo Steam. Manter Voltar tambรฉm abre o acesso rรกpido. + Repor predefiniรงรตes + A sua escolha de painel รฉ memorizada. O ambiente de trabalho abre um segundo espaรงo de trabalho; nรฃo muda a sessรฃo nem o seu perfil de entrada. + Comando virtual + O tipo de comando visto pelo Steam ou pelo jogo. + Ecrรฃ tรกtil + Como os toques no ecrรฃ do jogo sรฃo tratados. Os botรตes do perfil mantรชm as aรงรตes atribuรญdas. + Cursor tรกtil + Mostra um ponteiro para toques diretos no ecrรฃ do jogo. + Tocar e manter + Aรงรฃo do rato ao manter um dedo no ecrรฃ do jogo. + Toques do botรฃo Voltar + Primeira aรงรฃo: toque รบnico. Segunda aรงรฃo: duplo toque. + Botรฃo de alternรขncia + Toque para manter, toque novamente para libertar. Abrir um menu ou mudar de perfil liberta o botรฃo. + Forma + Arredondada + Cรกpsula + Cรญrculo + Retรขngulo + Etiqueta do botรฃo + Texto + Imagem importada + Teclas diagonais separadas + Atribua uma tecla a cada diagonal. Uma diagonal vazia pressiona as duas direรงรตes vizinhas. + Direรงรตes vizinhas + As suas antigas teclas no ecrรฃ foram guardadas como perfis importados abaixo. Selecione um para usar ou editar. As suas seleรงรตes de perfil atuais foram mantidas. + As antigas teclas no ecrรฃ nรฃo puderam ser importadas automaticamente. As definiรงรตes originais foram mantidas. + diff --git a/app/src/main/res/values-pt-rPT/input_strings.xml b/app/src/main/res/values-pt-rPT/input_strings.xml new file mode 100644 index 0000000000..0d81834854 --- /dev/null +++ b/app/src/main/res/values-pt-rPT/input_strings.xml @@ -0,0 +1,38 @@ + + + Perfis de entrada + Perfis + Comando fรญsico + Ecrรฃ principal + Ecrรฃ secundรกrio + Nativo / Steam Input + Nativo: %1$s + Enviar outro controlo do comando + Desativado + Tecla ou combinaรงรฃo de teclas + Teclas direcionais + Mover o ponteiro + Velocidade do ponteiro: %1$d + Deslocar + Deslocar verticalmente + Botรฃo esquerdo do rato + Botรฃo direito do rato + Botรฃo do meio do rato + Abrir o menu do DroidDeck + Mostrar teclado + Abrir o menu do Steam + Abrir o acesso rรกpido do Steam + Remover controlo + Adicionar controlo + Botรตes especรญficos do dispositivo + Atribuir um botรฃo fรญsico + Largue o botรฃo e escolha Editar, Repetir ou Cancelar. B ou Voltar cancela apรณs largar. + Repetir + Prima um botรฃo, incluindo um botรฃo Voltar reportado como tecla. As teclas de volume e do sistema Android estรฃo reservadas. A atribuiรงรฃo aplica-se apenas a este dispositivo. + Remover atribuiรงรฃo + Diagnรณstico de entrada + Registar o tempo de envio da entrada + Ler mediรงรตes + Mede o envio do Android atรฉ ร  publicaรงรฃo no transporte de entrada existente. Exclui a chegada por Bluetooth, a sondagem do convidado, a renderizaรงรฃo e a latรชncia do ecrรฃ. A gravaรงรฃo estรก desativada por predefiniรงรฃo. + Usar a atribuiรงรฃo de entrada normal + diff --git a/app/src/main/res/values-pt-rPT/strings.xml b/app/src/main/res/values-pt-rPT/strings.xml index 17ff8cbac3..dc549260d8 100644 --- a/app/src/main/res/values-pt-rPT/strings.xml +++ b/app/src/main/res/values-pt-rPT/strings.xml @@ -28,6 +28,8 @@ Suspender agora Terminar sessรฃo Geraรงรฃo de fotogramas + Definiรงรตes para este jogo + Definiรงรตes predefinidas Selecione o modo de geraรงรฃo de fotogramas Desligado DD-FG %1$dร— @@ -183,6 +185,7 @@ Nรฃo foi possรญvel transferir o ambiente grรกfico PowerVR. Verifique a ligaรงรฃo e tente novamente. Nรฃo foi possรญvel transferir o DirectAudio, por isso o รกudio dos jogos utiliza o caminho mais lento nesta sessรฃo. Este programa + A sessรฃo nรฃo conseguiu desenhar no ecrรฃ: %1$s. Este ecrรฃ mostra o motivo em vez de um ecrรฃ preto; os registos da sessรฃo tรชm os detalhes. Nรฃo foi possรญvel transferir o cliente Steam. A sua rede ou VPN pode estar a bloquear os servidores da Steam; verifique a ligaรงรฃo e tente novamente. Nรฃo foi possรญvel configurar o cliente Steam. Verifique a ligaรงรฃo e o espaรงo livre e tente novamente. %1$s foi compilado para PCs x86 e รฉ executado atravรฉs do FEX, que ainda nรฃo estรก instalado. Abra o Steam uma vez com a sessรฃo iniciada e deixe-o transferir o FEX e o Steam Linux Runtime; depois, volte a iniciรก-lo. @@ -386,6 +389,9 @@ Ainda nรฃo suportado aqui A carregar os componentesโ€ฆ Nรฃo foi possรญvel instalar: %1$s + Esta transferรชncia precisa de uma atualizaรงรฃo. + Atualizaรงรฃo na fila. + Repetir atualizaรงรฃo Transferido A transferir %1$s A instalar: %1$s @@ -416,6 +422,22 @@ Apenas interno Pasta: %1$s Segunda biblioteca + Mais bibliotecas Steam + Pastas onde o Steam pode instalar jogos e a partir das quais os pode executar, cada uma com o seu prรณprio nome. Remover uma pasta mantรฉm os jogos no disco. + Adicionar biblioteca + Mudar o nome + Nome da biblioteca + Escolher uma pasta para a biblioteca + No mรกximo %1$d bibliotecas adicionadas + Essa pasta jรก รฉ uma biblioteca ou estรก dentro de uma + %1$s ยท indisponรญvel + Aplica-se a partir da prรณxima sessรฃo do Steam + Encontrado neste dispositivo ยท %1$s ยท %2$s + Adicionar + Encontrar bibliotecas no armazenamento interno + Permitir o acesso a todos os ficheiros para que o DroidDeck possa ver as bibliotecas Steam que outras aplicaรงรตes mantรชm no armazenamento interno + Permitir + Foi adicionada %1$s, a biblioteca Steam dentro da pasta que escolheu Os jogos que carregam recursos em streaming a partir do SD ou do armazenamento partilhado podem apresentar soluรงos. Diagnรณstico de armazenamento Regista os resultados de alocaรงรฃo e amostras de tempos de armazenamento em Partilhar registos. Pode tornar as instalaรงรตes mais lentas enquanto estiver ativado. Aplica-se na prรณxima sessรฃo. @@ -480,6 +502,7 @@ Ativado Inicia com o Steam Inicia sem o Steam + Resoluรงรฃo do jogo Definiรงรตes Definiรงรตes de %1$s Predefiniรงรฃo @@ -567,6 +590,8 @@ Nรบcleos dos jogos Nรบcleos dos jogos Nรบcleos para os jogos. Com todos selecionados, o Android distribui livremente. + Poupar energia em jogos estรกveis + Executa um jogo nos nรบcleos mais lentos enquanto mantรฉm uma taxa de fotogramas estรกvel, e devolve-o aos nรบcleos habituais quando fica para trรกs. Interface do cliente GL multithread Pode fazer os menus do Steam responder mais depressa. @@ -602,7 +627,10 @@ Desativa o assistente de navegaรงรฃo por comando do Proton, que gasta CPU em todos os jogos. Executar o proot sem seccomp Pode corrigir erros de chamadas de sistema em falta em alguns kernels. Pode reduzir o desempenho. + Executar sem proot (experimental) + Inicia a parte Linux diretamente no Android. Aplica-se ร  prรณxima sessรฃo. Desative se algo nรฃo conseguir arrancar. Caminho rรกpido do proot + Nรฃo utilizado sem proot. Requer o filtro seccomp do proot. Pesquisas de ficheiros mais rรกpidas e menos soluรงos. Desative se um programa nรฃo encontrar os seus ficheiros. Desenhar o cursor dentro do gamescope @@ -685,6 +713,7 @@ Memรณria grรกfica Memรณria swap Nรญvel da bateria + Autonomia restante da bateria Consumo de energia Rede Resoluรงรฃo @@ -812,6 +841,7 @@ Dispositivo suportado GPU nรฃo testada GPU nรฃo suportada + GPU via ponte Mali %1$s ยท %2$s %1$s: %2$s Nรฃo estรก disponรญvel um backend grรกfico compatรญvel para %1$s. O Steam pode apresentar um ecrรฃ preto. @@ -841,15 +871,38 @@ Sessรฃo Registos da sessรฃo Guardados apรณs cada sessรฃo + Diagnรณstico avanรงado para a prรณxima sessรฃo + Captura registos detalhados durante uma sessรฃo. Pode reduzir o desempenho e ocupar mais espaรงo de armazenamento. Desativa-se automaticamente quando a sessรฃo comeรงa; reveja os registos antes de os partilhar. Registos de depuraรงรฃo dos jogos Inclui diagnรณsticos do Proton, do Wine e de grรกficos no prรณximo arranque de um jogo. Pode reduzir o desempenho e ocupar mais armazenamento. Reinicie esta sessรฃo para guardar os registos de depuraรงรฃo dos jogos Nรฃo foi possรญvel atualizar os registos. Verifique o interruptor e tente novamente. Ferramentas de depuraรงรฃo + Registos grรกficos detalhados + Interface do Steam: desenho pela GPU + Com o par de controladores Xclipse, o Steam desenha as suas pรกginas por software (o desenho pela GPU mostrou mosaicos com falhas). Ative para uma interface do Steam mais rรกpida se esta parecer correta neste telemรณvel. + compilado em %1$s + %1$s atualizado para a compilaรงรฃo mais recente + Na รบltima sessรฃo, a ponte Mali falhou o autoteste em %1$s (imagens ou desenhos), pelo que a sessรฃo utilizou o par de controladores PanVK. + Na รบltima sessรฃo, a ponte Mali nรฃo encontrou forma de partilhar memรณria com o controlador em %1$s, pelo que a sessรฃo utilizou o par de controladores PanVK. A ponte nรฃo pode funcionar neste telemรณvel; desativรก-la mantรฉm o par PanVK. + Os registos de Proton, DXVK e dos controladores de cada jogo ficam nos registos da sessรฃo. Sempre ativado quando a GPU nรฃo รฉ Adreno. Registos da รบltima sessรฃo Registos de sessรตes guardados Mantรฉm os %1$d mais recentes Limpar registos + Registos de sessรฃo disponรญveis + Ainda nรฃo hรก registos de sessรฃo guardados. + Os ficheiros ZIP partilhados e guardados incluem a sessรฃo selecionada, alรฉm dos diagnรณsticos relacionados do Steam, da loja, das ferramentas e da Battle.net. + %1$s ยท %2$s + Sessรฃo atual + Partilhar + Guardar no dispositivo + Eliminar + Eliminar os registos de sessรฃo? + Eliminar %1$s? Esta aรงรฃo nรฃo pode ser anulada. + Registos de sessรฃo guardados. + Nรฃo foi possรญvel guardar os registos de sessรฃo. + Nรฃo foi possรญvel eliminar os registos de sessรฃo. Modo offline Inicie sessรฃo no Steam primeiro Iniciador @@ -868,6 +921,8 @@ Utilizar como pรกgina inicial O DroidDeck pode ser a app de pรกgina inicial O DroidDeck nunca รฉ proposto como app de pรกgina inicial + O botรฃo Home abre + A pรกgina apresentada quando o DroidDeck รฉ a aplicaรงรฃo Home e se premir Home Em Adicionar jogos, define o DroidDeck como Incluir Orientaรงรฃo Orientaรงรฃo do iniciador @@ -881,15 +936,22 @@ Ecrรฃ inteiro Oculta as barras de estado e de navegaรงรฃo do Android Mostra as barras de estado e de navegaรงรฃo do Android + Iniciador de ecrรฃ duplo + Automรกtico coloca as secรงรตes do iniciador (Steam, Biblioteca, Lojas e as restantes) no segundo ecrรฃ das consolas portรกteis com um segundo ecrรฃ integrado. Ativado utiliza qualquer segundo ecrรฃ. Desativado mantรฉm o iniciador num รบnico ecrรฃ. + Sessรตes de ecrรฃ duplo + Automรกtico fixa o menu do jogo no segundo ecrรฃ integrado em vez de o apresentar como painel sobreposto. Ativado utiliza qualquer segundo ecrรฃ. Desativado mantรฉm o menu no ecrรฃ do jogo; ainda pode escolher um segundo ecrรฃ no prรณprio menu. Automรกtico Ativado Desativado Controlos no ecrรฃ inferior nos jogos + Teclado Android para campos de texto Abre o trackpad e o teclado no segundo ecrรฃ quando uma sessรฃo comeรงa. A escrever para o ecrรฃ superior Concluรญdo App de pรกgina inicial predefinida Escolher uma app de pรกgina inicial + Ocultar o iniciador dos Recentes enquanto inativo + Sรณ se aplica quando o DroidDeck รฉ a aplicaรงรฃo Home predefinida e nรฃo hรก nenhuma sessรฃo em curso. Escolher Apps Linux (beta) Ficheiros @@ -1001,9 +1063,172 @@ Antevisรฃo As correรงรตes mais recentes, antes do Estรกvel Atualizado + Copiar detalhes da versรฃo + Detalhes da versรฃo copiados + ร€ frente da Antevisรฃo + Estรก ร  frente da Antevisรฃo + Esta versรฃo รฉ mais recente do que a รบltima Antevisรฃo. A prรณxima versรฃo de Antevisรฃo vai atualizรก-la. + Escolha uma versรฃo para ver as alteraรงรตes ou instalรก-la. + Instalada + Instalar esta versรฃo%1$s + Voltar a esta versรฃo%1$s + versionCode %1$d + Commit %1$s + Pรกgina da versรฃo + O PR tem um commit mais recente (%1$s). A versรฃo de teste dele ainda nรฃo estรก pronta, por isso esta nรฃo o inclui. + Commit mais recente, versรฃo pendente + Nรบmero do PR, tรญtulo ou autor + Nenhuma versรฃo de teste corresponde + Precisa de ser recompilada (versionCode %1$d) + Atualizaรงรตes de versรตes de teste + Nova versรฃo de teste do PR #%1$d + %1$s. Abra Atualizaรงรตes para a instalar. + Mostrar mais (%1$d) + Precisam de ser recompiladas para o versionCode %2$d (%1$d) + Versรตes de Antevisรฃo no main desde esta versรฃo de teste: %1$d Versรตes de teste Experimente uma correรงรฃo antes de ser lanรงada Nenhuma de momento + Compilaรงรฃo de laboratรณrio + Compilaรงรตes de laboratรณrio + Em utilizaรงรฃo + Em pausa apรณs o Android ter reotimizado o DroidDeck + Nรฃo carregado: %1$s + ร€ espera de um reinรญcio + Mantido + Para outra versรฃo + Recompilar + Elimina esta compilaรงรฃo do dispositivo + Reiniciar com esta compilaรงรฃo + Desativar + Utilizar + Eliminar + Eliminar agora + Nรฃo foi possรญvel preparar o reinรญcio: %1$s. Emparelhe a depuraรงรฃo sem fios nas Definiรงรตes e tente de novo. + Compilaรงรฃo de laboratรณrio instalada + O DroidDeck reiniciou com %1$s + Compilaรงรฃo Lab em pausa + O Android voltou a otimizar o DroidDeck, pelo que %1$s nรฃo estรก carregada. Abra Atualizaรงรตes para reiniciar com ela. + Compilaรงรฃo Lab desativada + Foi compilada para outra versรฃo do DroidDeck. Estรก guardada em Atualizaรงรตes. + O DroidDeck nรฃo arrancou com ela duas vezes + Agente + Agente + O agente estรก a trabalhar + Instale o Claude Code no espaรงo de utilizador do Linux para usar o agente. + Pergunte sobre um jogo, uma falha ou uma alteraรงรฃo no DroidDeck + Enviar + Nova conversa + Parar + Armazenamento + Remover + Remover agora + Claude Code + Codex + Cรณdigo-fonte do DroidDeck + Caches de transferรชncias + As alteraรงรตes nรฃo enviadas sรฃo perdidas + As compilaรงรตes voltam a descarregรก-las + A configuraรงรฃo inicial pode voltar a instalรก-lo; as sessรตes iniciadas mantรชm-se + O DroidDeck reiniciou com a sua compilaรงรฃo Lab. Continue onde ficou. + Pergunte-lhe porque รฉ que um jogo nรฃo arranca, peรงa-lhe para explicar um registo ou para alterar o DroidDeck e testar a alteraรงรฃo neste dispositivo. + Falhou: %1$s + %1$s terminou (cรณdigo de saรญda %2$d) + Parado + Terminou sem resposta + Tentar novamente + A configurar o agente + Recompile a minha compilaรงรฃo Lab %1$s para a versรฃo instalada do DroidDeck e reinicie com ela. + %1$s de entrada ยท %2$s de saรญda + A pensar + Pensamento + A pensar ยท %1$s + %1$s ยท %2$s + ENTRADA + SAรDA + A executarโ€ฆ + Sem resultado: o turno terminou antes + Sem saรญda + Escreva para pรดr a mensagem seguinte na fila + Pรดr na fila + Seguinte: %1$s + Nรฃo enviar + Anexar + Remover + Predefinido + Esforรงo de raciocรญnio + Avanรงar + Rever + Ainda nada mudou + Avanรงar com o plano. + Enviar agora + Mais + Fechar + Mais recente + A trabalhar + Contexto + %1$s de %2$s + Esta conversa ยท %1$s + A utilizaรงรฃo sรณ aparece apรณs a primeira resposta + Limite de %1$d horas + Limite de %1$d minutos + Limite semanal + %1$d%% ยท reinรญcio: %2$s + + %1$d ficheiro + %1$d ficheiros + + Planear primeiro + Planear + Propรตe um plano sem alterar nada + Conversas + Ainda nรฃo hรก conversas + Agora mesmo + Eliminar + Elimina-a e os respetivos anexos + Processos + Nรฃo hรก nada a correr no espaรงo de utilizador do Linux + AGENTE + Parar + Compilaรงรฃo do Lab + A preparar compilaรงรตes do Lab + %1$d%% ยท falta cerca de %2$s + falta cerca de %1$s + Cancelar + Cancelar compilaรงรฃo + A iniciar + %1$d%% + A empacotar + A reiniciar o DroidDeck no dispositivo + Concluรญdo + Falhou: %1$s + Configurar o agente + Instale primeiro o ambiente de execuรงรฃo Linux na Configuraรงรฃo inicial. + Tentar novamente + Comeรงar a conversar + Ligaรงรฃo ao dispositivo + Depuraรงรฃo sem fios, para o agente ver e controlar o DroidDeck + Instalar %1$s + No espaรงo de utilizador Linux, com git, gh e adb + Iniciar sessรฃo em %1$s + Abre o navegador + GitHub + Opcional, para abrir pull requests + Ferramentas de compilaรงรฃo + Opcional, para compilaรงรตes do Lab neste dispositivo ยท cerca de 5 GB + Agente pronto + Conclua a configuraรงรฃo do agente + Sessรฃo iniciada em %1$s + Compilaรงรตes do Lab + compilaรงรตes rรกpidas + Compilaรงรตes rรกpidas do Lab + Compila esta versรฃo antecipadamente, para que as compilaรงรตes do Lab demorem minutos ยท cerca de 20 minutos, uma รบnica vez + A compilar ยท %1$d%% ยท restam cerca de %2$s + Preparar + A depuraรงรฃo sem fios nรฃo estรก acessรญvel; Emparelhar ativa-a + Emparelhar + Instalar + Iniciar sessรฃo PR #%1$d Nรฃo compilada para esta cรณpia do DroidDeck Atualizado %1$s @@ -1247,6 +1472,9 @@ Aplicaรงรตes Configuraรงรฃo Atualizaรงรตes + Mais + Editar separadores + Separadores %1$d%% Retomar %1$s Aparece como /root/ROMs em cada sessรฃo. O armazenamento interno estรก em /root/Storage. @@ -1268,6 +1496,15 @@ Cancelar pedido pendente Teclado Android Ocultar โœ• + Tamanho no ecrรฃ + Percentagem do ecrรฃ ocupada pelo teclado, incluindo o cabeรงalho. + Opacidade + Reduza-a para ver o jogo por trรกs do teclado. + Teclas ocultas + As teclas que raramente usa nรฃo aparecem no teclado. + Esc e linha das teclas de funรงรฃo + Ins / Del / Home / End / PgUp / PgDn + Teclas de direรงรฃo Iniciar %1$s Escolha um ecrรฃ. Secundรกrio: %1$s. O ecrรฃ secundรกrio jรก nรฃo estรก disponรญvel. @@ -1786,7 +2023,24 @@ Terminal Pegas + trackpads do Deck Painel + Ambiente de trabalho + Iniciar o ambiente de trabalho + Ambiente de trabalho ยท %1$s + Painel tรกtil + Toque direto + Painel tรกtil. Toca para passar ao toque direto + Toque direto. Toca para passar ao painel tรกtil + A iniciar o ambiente de trabalhoโ€ฆ + O ambiente de trabalho foi encerrado. + Nรฃo foi possรญvel iniciar o ambiente de trabalho. Os registos estรฃo na pasta bottom-desktop desta sessรฃo. + O ambiente de trabalho estรก encerrado. Ainda nรฃo hรก nada para mostrar aqui. + Trocar ecrรฃs + O ecrรฃ inferior nรฃo estรก livre neste momento + Ecrรฃ do jogo + Mostrar o jogo em + Ecrรฃ superior + Ecrรฃ inferior Transferรชncias Nenhuma transferรชncia em curso. Steam @@ -1821,6 +2075,20 @@ Combustรญvel, t Principal %1$s t Reserva %1$s t + Tempo de fotograma + รบltimos %1$d s + fotograma mรฉdio + 1% mais baixo + fotogramas acima de 33 ms + %1$d / min + A jogar hรก %1$s + %1$d nรบcleos, atรฉ %2$s GHz + %1$d nรบcleos + jogo + FPS de %1$d Hz + A marca vermelha รฉ o ponto em que o HUD mostra a temperatura a vermelho. + todo o dispositivo + bateria Enviar dados para o painel Automรกtico Ativa para todos os jogos aqui listados, incluindo os encontrados mais tarde. Os jogos que desativar permanecem desativados. @@ -1844,6 +2112,10 @@ O microfone estรก desligado neste jogo. Para falar, ative Microfone nas definiรงรตes do Steam do DroidDeck (รudio) e volte a iniciar o jogo. Volume %1$d%% Estatรญsticas no jogo + HUD do ecrรฃ inferior + Faixa em todos os separadores + 1% e 0,1% mais baixos + Temperatura da CPU FPS CPU GPU @@ -2017,6 +2289,7 @@ A iniciar a sessรฃoโ€ฆ %1$d:%2$02d decorridos ยท ainda a trabalhar A transferir a atualizaรงรฃo do cliente Steam ยท %1$d%% + A aplicar a atualizaรงรฃo do cliente Steamโ€ฆ A transferir o cliente Steam ยท %1$s Jรก estรก em curso a instalaรงรฃo de uma ferramenta de compatibilidade @@ -2093,11 +2366,29 @@ Contornos de desenho animado mais nitidez. Nรฃo รฉ uma GPU Adreno + Controlador PowerVR do sistema: a compatibilidade varia consoante o dispositivo + Experimental: RADV ou o controlador Xclipse do sistema + PowerVR do sistema + Utiliza os controladores integrados desta GPU + O controlador PowerVR do sistema estรก selecionado para o runtime e o ecrรฃ. + Ainda nรฃo hรก nenhum controlador de cรณdigo aberto que suporte esta Mali: a ponte Mali estรก ativada. + Esta รฉ a versรฃo de teste para dispositivos sem Snapdragon: as versรตes oficiais daqui sรณ funcionam em Adreno, por isso nรฃo sรฃo instaladas sobre ela. As novas versรตes de teste estรฃo em github.com/The412Banner/droiddeck-nonadreno-drivers. + A รบltima sessรฃo terminou porque o Android fechou o DroidDeck para libertar memรณria; nรฃo foi uma falha. Feche outras aplicaรงรตes ou reduza as definiรงรตes de textura do jogo e tente de novo. + Mali (Venus) + a ponte Mali + Ainda nรฃo hรก nenhum controlador de cรณdigo aberto que suporte esta Mali: %1$s รฉ usado com o controlador do prรณprio telemรณvel. + %1$s ainda nรฃo foi publicado: %2$s รฉ usado atรฉ lรก. + %1$s nรฃo estรก disponรญvel e o controlador deste telemรณvel indica Vulkan %2$s (Venus requer 1.2): รฉ usada a ponte Mali. + %1$s ainda nรฃo foi publicado: a ponte Mali estรก ativada atรฉ lรก. + Em fila: %1$s (ร  espera de um controlador de runtime diferente) + O DXVK รฉ fornecido pelo runtime PowerVR do sistema. Outros pacotes DXVK podem ser armazenados, mas nรฃo sรฃo aplicados com este controlador. Suportada Experimental: os controladores sรฃo versรตes de teste Suporte experimental para Adreno 850: requer controladores de ecrรฃ e de jogos experimentais compatรญveis; nรฃo verificado neste dispositivo Abaixo do hardware testado (Adreno 725 e mais recentes): pode nรฃo funcionar Nรฃo suportada: nรฃo estรก disponรญvel um backend grรกfico compatรญvel para esta GPU + Corre atravรฉs da ponte Mali, com o controlador Vulkan do prรณprio telemรณvel + Nรฃo suportado com a ponte Mali desativada: o Turnip precisa de uma GPU Adreno (Snapdragon) Foi atingido o limite de pedidos do GitHub - tente novamente mais tarde O GitHub respondeu HTTP %1$d @@ -2206,7 +2497,6 @@ Lojas Steam Personalizados - Lojas Nรญvel de velocidade de transferรชncia Equilibrado Rรกpido @@ -2245,6 +2535,7 @@ A aguardar a outra transferรชncia do Battle.netโ€ฆ Abra o Battle.net e inicie sessรฃo uma vez; depois instale os jogos dele aqui. O programa de transferรชncia da Blizzard parou: %1$s + O programa de transferรชncia da Blizzard deixou de avanรงar. Erro da Blizzard %1$s Atualizar Jogos da Blizzard @@ -2252,6 +2543,7 @@ Interrompida Instalar ยท %1$s Obter grรกtis + A adicionar ร  bibliotecaโ€ฆ Ver em %1$s Comprar ยท %1$s Instalado @@ -2298,6 +2590,12 @@ Ordenar Etiquetas da barra lateral Mostra os nomes por baixo dos รญcones da barra lateral. Desative para uma barra lateral mais estreita. + Mascote do agente + A DeeDee flutua sobre o iniciador e os jogos e mostra o que o agente estรก a fazer. + Sobre outras aplicaรงรตes + Permitir que a DeeDee flutue sobre todas as aplicaรงรตes e abra aรญ a conversa + Permitir + Conversar com a DeeDee Apresentaรงรฃo Cartรตes maiores Cartรตes mais pequenos @@ -2581,7 +2879,14 @@ %1$s ยท reinรญcio pendente Este dispositivo Remover %1$s? - Diagnรณstico + Programador + Marca de รกgua da compilaรงรฃo + Mostrar no ecrรฃ a etiqueta da compilaรงรฃo de teste ou Lab. Ativada por predefiniรงรฃo. + Partilhar pacotes de diagnรณstico + Sessรฃo e dispositivo + Grรกficos + Jogos e compatibilidade + Todos os pacotes Pronto para jogar Ainda nรฃo estรก pronto para jogar ambiente de execuรงรฃo %1$s @@ -2620,6 +2925,9 @@ Ativa as conquistas da GOG nas definiรงรตes de Lojas Conquistas indisponรญveis; verifica os registos da sessรฃo Conquista desbloqueada + Mali (Venus): desativado + Mali (Venus): ativado + O controlador de %1$s indica Vulkan %2$s. Mali (Venus) requer Vulkan 1.2 ou superior (o gamescope nรฃo arranca em versรตes anteriores), por isso as sessรตes nรฃo usam o Venus e recorrem ao par de controladores PanVK. Colar Stick esquerdo Stick direito @@ -2919,7 +3227,7 @@ Escolher pastaโ€ฆ Utilize qualquer pasta num cartรฃo SD ou unidade USB Os jogos vรฃo para uma pasta Games dentro do local selecionado. Os jogos existentes nรฃo sรฃo movidos. - Para onde vai + O que ocupa espaรงo Jogos do Steam Dados dos jogos Prefixos %1$s ยท workshop %2$s ยท shaders %3$s @@ -2988,6 +3296,7 @@ Instaladores VC++ e DirectX exigidos pelos jogos Executa jogos Linux x86 Ferramenta do Steam + O Steam descarrega isto para jogos que incluem anti-cheat, mesmo quando este estรก desativado. Removรช-lo deixa a instalaรงรฃo desses jogos parada nos 0% O DroidDeck executa jogos sem este ambiente de execuรงรฃo Proton x86, que o DroidDeck nรฃo consegue executar Predefinido para todos os jogos @@ -3058,6 +3367,19 @@ Mantidos Jogos nรฃo Steam e prefixo partilhado do Steam Prefixos de jogos adicionados pelas lojas ou ร  mรฃo + Prefixo partilhado do Steam + O Steam executa aqui os seus prรณprios auxiliares do Windows + Elimina-o (%1$s). O Steam cria um novo da prรณxima vez que precisar. + Uma app de loja e os jogos que correm com ela + Usado por %1$s + Jogo nรฃo Steam %1$s + Nรฃo corresponde a nenhum jogo, por isso รฉ mantido + Remover seleรงรฃo ยท %1$s + Desinstalar seleรงรฃo ยท %1$s + Prefixos do Wine + Os guardados e as definiรงรตes neles perdem-se; os guardados do Steam Cloud ficam na sua conta. + Caches de shaders + Prefixo %1$s ยท shaders %2$s Pacotes transferidos Originais mantidos Nenhum pacote de componentes transferido. @@ -3094,6 +3416,8 @@ DroidDeck ยท %1$d fps 60 fps รฉ mais fluido, mas usa mais CPU enquanto o Steam arranca. Um vรญdeo escolhido nas definiรงรตes do Steam tambรฉm aparece aqui. Som + Ignorar o vรญdeo de arranque + Utilizar um clipe preto de 0,1 segundos como vรญdeo de arranque do Steam. Aplica-se na prรณxima sessรฃo. O seu prรณprio vรญdeo MP4, MOV, MKV ou WebM. Outros formatos e ficheiros acima de %1$d MB sรฃo convertidos para WebM 720p no dispositivo, atรฉ %2$d segundos. Importar @@ -3555,6 +3879,7 @@ Mantรฉm Alt+Tab, a tecla Win e o botรฃo Inรญcio numa sessรฃo ativa do DroidDeck em vez do Android. Ative Brilho em Configuraรงรฃo โ†’ Integraรงรฃo com o Steam Ponte Mali: desligada + %1$s nรฃo pode usar a ponte Mali (รฉ necessรกria uma GPU Mali sem rota de controlador do sistema), por isso este interruptor nรฃo tem efeito aqui. Ponte Mali: ligada %1$s nรฃo รฉ uma Adreno. A ponte Vulkan experimental estรก ligada: a sessรฃo desenha atravรฉs do prรณprio controlador do telemรณvel. Conte com erros; envie os registos da sessรฃo. Modo seguro @@ -3580,6 +3905,25 @@ Mover para depois Definiรงรตes do widget Remover widget + Aspeto + Pacote de รญcones + Predefiniรงรฃo do sistema + Fundo na cor da app + Tamanho dos รญcones + Pequeno + Mรฉdio + Grande + Ocultar nomes das aplicaรงรตes + Espaรงamento + Justo + Normal + Amplo + Alterar รญcone + Repor รญcone + Pesquisar รญcones + A carregar รญconesโ€ฆ + Nenhum รญcone encontrado. + รcones personalizados Adicionar a pasta Nova pasta Remover da pasta @@ -3696,5 +4040,81 @@ Nรฃo foi possรญvel importar este esquema Neve Escarlate + Superfรญcies brancas com detalhes vermelhos. + Bandas sonoras + Mรบsica + Opรงรตes de reproduรงรฃo + Favoritas + Coleรงรตes + Ainda nรฃo hรก coleรงรตes. Toque no รญcone de marcador para criar uma. + Guardadas + Criar uma coleรงรฃo + Organize as suas faixas guardadas + Nova + Criar + Nome da coleรงรฃo + Introduza um nome que nenhuma outra coleรงรฃo utilize + Gerir + Mudar o nome + Adicionar faixas + Adicionar (%1$d) + Remover faixas + Eliminar coleรงรฃo + Eliminar %1$s? + As faixas permanecem no seu dispositivo. Apenas a coleรงรฃo รฉ removida. + Selecionar + Selecionar tudo + Desselecionar tudo + %1$d selecionadas + Adicionar ร  coleรงรฃo + Adicionar ร s favoritas + Remover da coleรงรฃo + Pesquisar faixas + Ordem do รกlbum + Mais longas primeiro + Mais curtas primeiro + Faixas + Tom + Repor + Saltar silรชncio + Temporizador de suspensรฃo + %1$d min + Fim da faixa + Restam %1$s + Equalizador + Reforรงo de graves + O equalizador nรฃo estรก disponรญvel neste dispositivo + Ativar durante o jogo + Continuar a reproduzir a banda sonora enquanto um jogo estรก em execuรงรฃo + Ainda nรฃo hรก bandas sonoras instaladas. + Pesquisar bandas sonoras + Adicionar uma pasta de banda sonora + Nenhum ficheiro de รกudio nessa pasta + Duraรงรฃo total + %1$d faixas / %2$s + Disco %1$s + Aleatรณrio + Anterior + Reproduzir + Pausar + Seguinte + Repetiรงรฃo desativada + Repetir tudo + Repetir uma + Volume + Nenhum ficheiro de รกudio nesta banda sonora + Inรญcio indisponรญvel + Nรฃo hรก nenhum navegador disponรญvel para abrir esta ligaรงรฃo. + Agarrar + Largar + Guardar + Mantenha para repor + Lojas + Tempo de frame + Taxa mรฉdia de frames + Servidor de ecrรฃ + Estado HDR + Mostrados + %1$d de %2$d diff --git a/app/src/main/res/values-pt/input_library.xml b/app/src/main/res/values-pt/input_library.xml new file mode 100644 index 0000000000..ae84ba99ce --- /dev/null +++ b/app/src/main/res/values-pt/input_library.xml @@ -0,0 +1,132 @@ + + + A tela selecionada nรฃo estรก disponรญvel. Conecte-a para editar este layout no tamanho real. + Descartar as alteraรงรตes de layout nรฃo salvas? + Este layout รฉ usado por %1$d perfis. As alteraรงรตes salvas valem para todos. + Perfis padrรฃo + Modo desktop + Modo jogo + Padrรฃo para desktop e jogo + Padrรฃo para o modo jogo + Padrรฃo para o modo desktop + Configuraรงรตes do dispositivo + Controles + Botรตes, analรณgicos, gatilhos e teclas extras + Copiar perfil + Redefinir aรงรตes + Redefinir as aรงรตes de %1$s para os padrรตes do perfil base? Os layouts e outros perfis permanecem iguais. + Excluir %1$s? Os modos que o usam voltarรฃo ao perfil padrรฃo integrado. Os layouts salvos e as configuraรงรตes compartilhadas continuarรฃo disponรญveis. + Visibilidade + Vale para todos os perfis. Auto mostra os controles da tela principal quando nenhum controle estรก conectado no modo jogo. + Editar na tela + Layouts salvosโ€ฆ + Escolha um layout ou crie o seu + Escolha Controles do perfil no menu de sessรฃo da tela secundรกria. Os seletores Perfil e Tela secundรกria no menu do controle escolhem os controles exibidos. + Aรงรตes dos botรตes + Compartilhado com %1$s. As ediรงรตes tambรฉm valem para esses perfis. + Reutilizar configuraรงรตes + Usar configuraรงรตes deโ€ฆ + Copiar de outro perfil ou manter as configuraรงรตes compartilhadas + Tornar independente + Manter a configuraรงรฃo atual e parar de compartilhar alteraรงรตes + Os layouts guardam elementos e posiรงรตes. Cada perfil pode atribuir suas prรณprias aรงรตes. Edite em tamanho real na tela de destino. + Layout atual + Excluir o layout nรฃo usado %1$s e suas aรงรตes salvas? + Renomear o layout atual + As configuraรงรตes de entrada ilegรญveis foram preservadas em uma cรณpia de recuperaรงรฃo. Vocรช pode continuar editando os perfis restaurados. + Propriedades + Propriedades do clique + %1$s ยท Clique + Botรตes + Analรณgicos, pads e gatilhos + Ocultar ferramentas + Controle + Envia a entrada do controle para o Steam Input ou para o jogo. + Este elemento nรฃo envia entrada de controle, mouse ou teclado. + Clique do mouse + Aรงรฃo do DroidDeck + Aรงรฃo + Velocidade de rolagem: %1$d passos/s + + Novo perfil + + Novo layout + %1$s ยท Usado por %2$d perfis. As alteraรงรตes valem para todos os perfis que usam estas atribuiรงรตes. + Renomear + Excluir + Adicione elementos ao layout antes de atribuir suas aรงรตes. + Nรฃo foi possรญvel salvar as configuraรงรตes de entrada + Nome + Comeรงar de + Botรฃo + Analรณgico + Touchpad + Direcional + Gatilho + Concluรญdo + Desfazer + + Adicionar + Arraste para mover. Arraste um canto para redimensionar. Toque em Propriedades para atribuir uma aรงรฃo. + Editando na tela secundรกria + Reutilizar %1$s de outro perfil. As outras fontes de controle permanecem iguais. + Manter os controles fรญsicos compartilhados + Por padrรฃo, todos os controles e layouts personalizados sรฃo cรณpias independentes. Compartilhar sรณ vincula os controles fรญsicos. + Usar estes elementos e posiรงรตes. Compartilhar mantรฉm as futuras mudanรงas de geometria em sincronia; suas aรงรตes de botรฃo continuam independentes. Um layout diferente comeรงa com aรงรตes nรฃo atribuรญdas. + Copiar estes controles e aรงรตes, ou vinculรก-los para que mudanรงas futuras valham para os dois perfis. + Manter compartilhado + Cรณpia independente + Iniciar o analรณgico no ponto de toque + Ocultar o analรณgico quando nรฃo estiver em uso + Ferramentas + Auto (%1$s) + Personalizado (%1$s) + Salvar como novo perfil + Controles do perfil + Perfil + Gestos do touchpad do mouse + Quando atribuรญdo ao ponteiro do mouse: toque para clicar, segure para arrastar e role com dois dedos. + %1$s tem uma substituiรงรฃo do menu rรกpido. Selecione Auto lรก para usar o perfil padrรฃo e as trรชs partes salvas. + Entrada do DroidDeck + Mantido enquanto o analรณgico รฉ movido em qualquer direรงรฃo: pressiona acima de 55%, solta abaixo de 35%. Use Teclas de direรงรฃo para atribuir cada direรงรฃo separadamente. Os comandos do DroidDeck rodam uma vez por deflexรฃo. O clique do analรณgico รฉ configurado ร  parte. + Mantido enquanto o touchpad รฉ tocado; liberado ao levantar o dedo. Os comandos do DroidDeck rodam uma vez por toque. O clique do touchpad รฉ configurado ร  parte. + Mantido quando o gatilho passa de 55%; liberado abaixo de 35%. Os comandos do DroidDeck rodam uma vez por pressionamento. + Direรงรฃo de rolagem + Vertical + Horizontal + Rolar horizontalmente + Mediรงรตes + Ative a gravaรงรฃo, use os controles em uma sessรฃo em execuรงรฃo e depois volte e leia os resultados. Mede apenas o tempo de envio do DroidDeck, nรฃo a latรชncia da tela. A gravaรงรฃo termina quando o processo do app fecha. + %1$d controles + Outros layouts salvos (%1$d) โ–พ + Ocultar outros layouts salvos (%1$d) โ–ด + Inรญcio / Guia + Voltar ยท toque รบnico + Voltar ยท toque duplo + Voltar ยท duas vezes no Steam, uma no desktop + No modo Steam. Manter Voltar tambรฉm abre o acesso rรกpido. + Restaurar o padrรฃo + Sua escolha de painel รฉ lembrada. O desktop abre um segundo espaรงo de trabalho; nรฃo troca a sessรฃo nem o perfil de entrada. + Controle virtual + O tipo de controle visto pelo Steam ou pelo jogo. + Tela sensรญvel ao toque + Como os toques na tela do jogo sรฃo tratados. Os botรตes do perfil mantรชm as aรงรตes atribuรญdas. + Cursor de toque + Mostra um ponteiro para toques diretos na tela do jogo. + Tocar e segurar + Aรงรฃo do mouse ao segurar um dedo na tela do jogo. + Toques do botรฃo Voltar + Primeira aรงรฃo: toque รบnico. Segunda aรงรฃo: toque duplo. + Botรฃo de alternรขncia + Toque para manter, toque de novo para soltar. Abrir um menu ou trocar de perfil solta o botรฃo. + Forma + Arredondada + Pรญlula + Cรญrculo + Retรขngulo + Rรณtulo do botรฃo + Texto + Imagem importada + Teclas diagonais separadas + Atribua uma tecla a cada diagonal. Uma diagonal vazia pressiona suas duas direรงรตes vizinhas. + Direรงรตes vizinhas + Suas antigas teclas na tela foram salvas como perfis importados abaixo. Selecione um para usar ou editar. Suas seleรงรตes de perfil atuais foram mantidas. + As antigas teclas na tela nรฃo puderam ser importadas automaticamente. As configuraรงรตes originais foram mantidas. + diff --git a/app/src/main/res/values-pt/input_strings.xml b/app/src/main/res/values-pt/input_strings.xml new file mode 100644 index 0000000000..5847aa3ac4 --- /dev/null +++ b/app/src/main/res/values-pt/input_strings.xml @@ -0,0 +1,38 @@ + + + Perfis de entrada + Perfis + Controle fรญsico + Tela principal + Tela secundรกria + Nativo / Steam Input + Nativo: %1$s + Enviar outro comando do controle + Desativado + Tecla ou combinaรงรฃo de teclas + Teclas direcionais + Mover o ponteiro + Velocidade do ponteiro: %1$d + Rolar + Rolar verticalmente + Botรฃo esquerdo do mouse + Botรฃo direito do mouse + Botรฃo do meio do mouse + Abrir o menu do DroidDeck + Mostrar teclado + Abrir o menu do Steam + Abrir o acesso rรกpido do Steam + Remover controle + Adicionar controle + Botรตes especรญficos do dispositivo + Atribuir um botรฃo fรญsico + Solte o botรฃo e escolha Editar, Repetir ou Cancelar. B ou Voltar cancela apรณs soltar. + Repetir + Pressione um botรฃo, incluindo um botรฃo Voltar informado como tecla. As teclas de volume e do sistema Android sรฃo reservadas. A atribuiรงรฃo vale apenas para este dispositivo. + Remover atribuiรงรฃo + Diagnรณstico de entrada + Registrar o tempo de envio da entrada + Ler mediรงรตes + Mede o envio do Android atรฉ a publicaรงรฃo no transporte de entrada existente. Nรฃo inclui a chegada por Bluetooth, a sondagem do convidado, a renderizaรงรฃo nem a latรชncia da tela. A gravaรงรฃo fica desativada por padrรฃo. + Usar a atribuiรงรฃo de entrada normal + diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 73d1a4c4c9..7f8d3196b6 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -28,6 +28,8 @@ Suspender agora Encerrar sessรฃo Geraรงรฃo de quadros + Configuraรงรตes para este jogo + Configuraรงรตes padrรฃo Selecione o modo de geraรงรฃo de quadros Desativada DD-FG %1$dร— @@ -183,6 +185,7 @@ Nรฃo foi possรญvel baixar o ambiente grรกfico PowerVR. Verifique a conexรฃo e tente novamente. Nรฃo foi possรญvel baixar o DirectAudio, entรฃo o รกudio dos jogos usa o caminho mais lento nesta sessรฃo. Este programa + A sessรฃo nรฃo conseguiu desenhar na tela: %1$s. Esta tela mostra o motivo no lugar de uma tela preta; os logs da sessรฃo trazem os detalhes. Nรฃo foi possรญvel baixar o cliente Steam. Sua rede ou VPN pode estar bloqueando os servidores da Steam; verifique a conexรฃo e tente novamente. Nรฃo foi possรญvel configurar o cliente Steam. Verifique a conexรฃo e o espaรงo livre e tente novamente. %1$s รฉ feito para PCs x86 e roda pelo FEX, que ainda nรฃo estรก instalado. Abra a Steam uma vez com a sessรฃo iniciada e deixe-a baixar o FEX e o Steam Linux Runtime; depois, abra isto de novo. @@ -386,6 +389,9 @@ Ainda sem suporte aqui Carregando os componentesโ€ฆ Nรฃo foi possรญvel instalar: %1$s + Este download precisa de uma atualizaรงรฃo. + Atualizaรงรฃo na fila. + Tentar atualizar novamente Baixado Baixando %1$s Instalando: %1$s @@ -416,6 +422,22 @@ Somente interno Pasta: %1$s Segunda biblioteca + Mais bibliotecas do Steam + Pastas onde o Steam pode instalar e executar jogos, cada uma com seu prรณprio nome. Remover uma mantรฉm os jogos no disco. + Adicionar biblioteca + Renomear + Nome da biblioteca + Escolher uma pasta para a biblioteca + No mรกximo %1$d bibliotecas adicionadas + Essa pasta jรก รฉ uma biblioteca ou estรก dentro de uma + %1$s ยท indisponรญvel + Vale a partir da prรณxima sessรฃo do Steam + Encontrado neste dispositivo ยท %1$s ยท %2$s + Adicionar + Encontrar bibliotecas no armazenamento interno + Permita acesso a todos os arquivos para que o DroidDeck veja bibliotecas do Steam que outros apps mantรชm no armazenamento interno + Permitir + Adicionada %1$s, a biblioteca do Steam dentro da pasta escolhida Jogos que carregam recursos do SD ou do armazenamento compartilhado durante o jogo podem ter engasgos. Diagnรณstico de armazenamento Registra os resultados de alocaรงรฃo e amostras de tempos de armazenamento em Compartilhar logs. Pode deixar as instalaรงรตes mais lentas enquanto estiver ativado. Vale a partir da prรณxima sessรฃo. @@ -480,6 +502,7 @@ Ativado Inicia com o Steam Inicia sem o Steam + Resoluรงรฃo do jogo Configuraรงรตes Configuraรงรตes de %1$s Padrรฃo @@ -567,6 +590,8 @@ Nรบcleos dos jogos Nรบcleos dos jogos Nรบcleos para os jogos. Com todos selecionados, o Android distribui livremente. + Economizar energia em jogos estรกveis + Executa um jogo nos nรบcleos mais lentos enquanto mantรฉm uma taxa de quadros estรกvel, e o devolve aos nรบcleos de sempre quando fica para trรกs. Interface do cliente GL em threads Pode deixar os menus da Steam mais responsivos. @@ -602,7 +627,10 @@ Desativa o assistente de navegaรงรฃo por controle do Proton, que consome CPU em todos os jogos. Rodar o proot sem seccomp Pode corrigir erros de syscall ausente em alguns kernels. Pode reduzir o desempenho. + Executar sem proot (experimental) + Inicia o ambiente Linux diretamente no Android. Vale a partir da prรณxima sessรฃo. Desative se algo nรฃo iniciar. Caminho rรกpido do proot + Nรฃo usado sem proot. Requer o filtro seccomp do proot. Buscas de arquivos mais rรกpidas e menos engasgos. Desative se um programa nรฃo encontrar os arquivos dele. Desenhar o cursor dentro do gamescope @@ -685,6 +713,7 @@ Memรณria grรกfica Memรณria swap Nรญvel da bateria + Tempo restante da bateria Consumo de energia Rede Resoluรงรฃo @@ -812,6 +841,7 @@ Dispositivo compatรญvel GPU nรฃo testada GPU sem suporte + GPU via ponte Mali %1$s ยท %2$s %1$s: %2$s Nenhum backend grรกfico compatรญvel estรก disponรญvel para %1$s. O Steam pode exibir uma tela preta. @@ -841,15 +871,38 @@ Sessรฃo Logs da sessรฃo Salvos apรณs cada sessรฃo + Diagnรณsticos avanรงados para a prรณxima sessรฃo + Captura logs detalhados durante uma sessรฃo. Pode reduzir o desempenho e usar mais armazenamento. Desliga-se sozinho quando a sessรฃo comeรงa; revise os logs antes de compartilhar. Logs de depuraรงรฃo dos jogos Inclui diagnรณsticos do Proton, do Wine e de grรกficos na prรณxima inicializaรงรฃo do jogo. Pode reduzir o desempenho e usar mais armazenamento. Reinicie esta sessรฃo para salvar os logs de depuraรงรฃo dos jogos Nรฃo foi possรญvel atualizar os logs. Verifique a chave e tente novamente. Ferramentas de depuraรงรฃo + Logs detalhados de grรกficos + Interface do Steam: renderizaรงรฃo pela GPU + Com o par de drivers Xclipse, o Steam renderiza suas pรกginas por software (a renderizaรงรฃo pela GPU apresentou blocos quebrados). Ative para ter uma interface do Steam mais rรกpida se ela aparecer corretamente neste telefone. + compilado em %1$s + %1$s atualizado para a compilaรงรฃo mais recente + A ponte Mali falhou no autoteste em %1$s na รบltima sessรฃo (imagens ou chamadas de desenho), entรฃo a sessรฃo usou o par de drivers PanVK em vez disso. + A ponte Mali nรฃo encontrou nenhuma forma de compartilhar memรณria com o driver em %1$s na รบltima sessรฃo, entรฃo a sessรฃo usou o par de drivers PanVK em vez disso. A ponte nรฃo funciona neste aparelho; desativรก-la mantรฉm o par PanVK. + Os registros de Proton, DXVK e do driver de cada jogo sรฃo incluรญdos nos registros da sessรฃo. Sempre ativado quando a GPU nรฃo รฉ Adreno. Logs da รบltima sessรฃo Logs de sessรฃo salvos Mantรฉm os %1$d mais recentes Limpar logs + Registros de sessรฃo disponรญveis + Ainda nรฃo hรก registros de sessรฃo salvos. + Os arquivos ZIP compartilhados e salvos incluem a sessรฃo selecionada, alรฉm de diagnรณsticos relacionados da Steam, da loja, das ferramentas e da Battle.net. + %1$s ยท %2$s + Sessรฃo atual + Compartilhar + Salvar no dispositivo + Excluir + Excluir registros de sessรฃo? + Excluir %1$s? Isso nรฃo pode ser desfeito. + Registros de sessรฃo salvos. + Nรฃo foi possรญvel salvar os registros de sessรฃo. + Nรฃo foi possรญvel excluir os registros de sessรฃo. Modo offline Inicie sessรฃo na Steam primeiro Inicializador @@ -868,6 +921,8 @@ Usar como tela inicial O DroidDeck pode ser o app de inรญcio O DroidDeck nunca รฉ oferecido como app de inรญcio + Botรฃo Home abre + A pรกgina exibida quando DroidDeck รฉ o app Home e vocรช pressiona Home Em Adicionar jogos, defina o DroidDeck como Incluir Orientaรงรฃo Orientaรงรฃo do launcher @@ -881,15 +936,22 @@ Tela cheia Oculta as barras de status e de navegaรงรฃo do Android Mostra as barras de status e de navegaรงรฃo do Android + Iniciador em duas telas + O modo automรกtico coloca as seรงรตes do iniciador (Steam, Biblioteca, Lojas e as demais) na segunda tela de consoles portรกteis com uma tela secundรกria integrada. Ativado usa qualquer tela secundรกria. Desativado mantรฉm o iniciador em uma รบnica tela. + Sessรตes em duas telas + O modo automรกtico fixa o menu do jogo na segunda tela integrada em vez de exibi-lo como painel flutuante. Ativado usa qualquer tela secundรกria. Desativado mantรฉm o menu na tela do jogo; ainda รฉ possรญvel escolher uma segunda tela a partir dele. Automรกtico Ativado Desativado Controles na tela inferior nos jogos + Teclado do Android para campos de texto Abre o trackpad e o teclado na segunda tela quando uma sessรฃo comeรงa. Digitando para a tela superior Concluรญdo App de inรญcio padrรฃo Escolher um app de inรญcio + Ocultar o launcher dos Recentes enquanto estiver ocioso + Aplica-se apenas quando DroidDeck รฉ o app Home padrรฃo e nenhuma sessรฃo estiver em execuรงรฃo. Escolher Apps Linux (beta) Arquivos @@ -1001,9 +1063,173 @@ Prรฉvia As correรงรตes mais recentes, antes da Estรกvel Atualizado + Copiar detalhes da versรฃo + Detalhes da versรฃo copiados + ร€ frente da Prรฉvia + Vocรช estรก ร  frente da Prรฉvia + Esta versรฃo รฉ mais nova que a รบltima Prรฉvia. A prรณxima versรฃo da Prรฉvia vai atualizรก-la. + Escolha uma versรฃo para ver as mudanรงas ou instalรก-la. + Instalada + Instalar esta versรฃo%1$s + Voltar para esta versรฃo%1$s + versionCode %1$d + Commit %1$s + Pรกgina da versรฃo + O PR tem um commit mais novo (%1$s). A versรฃo de teste dele ainda nรฃo estรก pronta, entรฃo esta nรฃo o inclui. + Commit mais novo, versรฃo pendente + Nรบmero do PR, tรญtulo ou autor + Nenhuma versรฃo de teste corresponde + Precisa ser recompilada (versionCode %1$d) + Atualizaรงรตes de versรตes de teste + Nova versรฃo de teste do PR #%1$d + %1$s. Abra Atualizaรงรตes para instalรก-la. + Mostrar mais (%1$d) + Precisam ser recompiladas para o versionCode %2$d (%1$d) + Versรตes da Prรฉvia no main desde esta versรฃo de teste: %1$d Versรตes de teste Experimente uma correรงรฃo antes do lanรงamento Nenhuma no momento + Compilaรงรฃo de laboratรณrio + Compilaรงรตes de laboratรณrio + Em uso + Pausada apรณs o Android otimizar o DroidDeck novamente + Nรฃo carregada: %1$s + Aguardando um reinรญcio + Mantida + Para outra versรฃo + Recompilar + Exclui esta compilaรงรฃo do dispositivo + Reiniciar com esta + Desativar + Usar + Excluir + Excluir agora + Nรฃo foi possรญvel preparar o reinรญcio: %1$s. Emparelhe a depuraรงรฃo sem fio em Configuraรงรตes e tente novamente. + Compilaรงรฃo de laboratรณrio instalada + DroidDeck foi reiniciado com %1$s + Build do Lab pausado + O Android reotimizou o DroidDeck, entรฃo %1$s nรฃo foi carregado. Abra Atualizaรงรตes para reiniciar com ele. + Build do Lab desativado + Ele foi compilado para outra versรฃo do DroidDeck. Estรก guardado em Atualizaรงรตes. + O DroidDeck nรฃo iniciou com ele duas vezes + Agente + Agente + O agente estรก trabalhando + Instale o Claude Code no espaรงo de usuรกrio do Linux para usar o agente. + Pergunte sobre um jogo, um travamento ou uma alteraรงรฃo no DroidDeck + Enviar + Nova conversa + Parar + Armazenamento + Remover + Remover agora + Claude Code + Codex + Cรณdigo-fonte do DroidDeck + Caches de download + Alteraรงรตes nรฃo enviadas sรฃo perdidas + Os builds baixam esses arquivos novamente + A configuraรงรฃo pode instalรก-lo novamente; os logins sรฃo mantidos + O DroidDeck reiniciou com seu build do Lab. Continue de onde parou. + Pergunte por que um jogo nรฃo inicia, peรงa para explicar um log ou para alterar o DroidDeck e testar a alteraรงรฃo neste dispositivo. + Falha: %1$s + %1$s terminou (cรณdigo de saรญda %2$d) + Interrompido + Terminou sem resposta + Tentar novamente + Configurando o agente + Recompile meu build do Lab %1$s para a versรฃo instalada do DroidDeck e reinicie com ele. + %1$s de entrada ยท %2$s de saรญda + Pensando + Pensamento + Pensando ยท %1$s + %1$s ยท %2$s + ENTRADA + SAรDA + Executandoโ€ฆ + Nenhum resultado: o turno terminou antes + Nenhuma saรญda + Digite para enfileirar a prรณxima mensagem + Enfileirar + Prรณxima: %1$s + Nรฃo enviar + Anexar + Remover + Padrรฃo + Esforรงo de raciocรญnio + Prosseguir + Revisar + Nada mudou ainda + Siga em frente com o plano. + Enviar agora + Mais + Fechar + Mais recente + Trabalhando + Contexto + %1$s de %2$s + Esta conversa ยท %1$s + O uso aparece apรณs a primeira resposta + Limite de %1$d horas + Limite de %1$d minutos + Limite semanal + %1$d%% ยท reinicia em %2$s + + %1$d arquivos + %1$d arquivo + %1$d arquivos + + Planejar primeiro + Planejar + Propรตe um plano sem alterar nada + Conversas + Ainda nรฃo hรก conversas + Agora mesmo + Excluir + Exclui a conversa e seus anexos + Processos + Nada estรก em execuรงรฃo no espaรงo de usuรกrio do Linux + AGENTE + Parar + Compilaรงรฃo do laboratรณrio + Preparando compilaรงรตes do laboratรณrio + %1$d%% ยท faltam cerca de %2$s + faltam cerca de %1$s + Cancelar + Cancelar compilaรงรฃo + Iniciando + %1$d%% + Empacotando + Reiniciando o DroidDeck nele + Concluรญdo + Falhou: %1$s + Configurar o agente + Instale o ambiente de execuรงรฃo do Linux em Configuraรงรตes primeiro. + Tentar novamente + Comeรงar a conversar + Conexรฃo do dispositivo + Depuraรงรฃo por Wi-Fi, para que o agente possa ver e controlar o DroidDeck + Instalar %1$s + No espaรงo de usuรกrio do Linux, com git, gh e adb + Entrar em %1$s + Abre o navegador + GitHub + Opcional, para abrir solicitaรงรตes de pull + Ferramentas de compilaรงรฃo + Opcional, para compilaรงรตes do Lab neste dispositivo ยท cerca de 5 GB + Agente pronto + Conclua a configuraรงรฃo do agente + Conectado a %1$s + Compilaรงรตes do Lab + compilaรงรตes rรกpidas + Compilaรงรตes rรกpidas do Lab + Prรฉ-compila esta versรฃo, para que as compilaรงรตes do Lab levem minutos ยท cerca de 20 minutos, uma รบnica vez + Compilando ยท %1$d%% ยท cerca de %2$s para concluir + Preparar + A depuraรงรฃo sem fio nรฃo estรก acessรญvel; Parear a ativa + Parear + Instalar + Entrar PR #%1$d Nรฃo compilada para esta cรณpia do DroidDeck Atualizado %1$s @@ -1247,6 +1473,9 @@ Apps Configuraรงรฃo Atualizaรงรตes + Mais + Editar abas + Abas %1$d%% Retomar %1$s Aparece como /root/ROMs em cada sessรฃo. O armazenamento interno fica em /root/Storage. @@ -1268,6 +1497,15 @@ Cancelar pendente Teclado do Android Ocultar โœ• + Tamanho na tela + Parte da tela ocupada pelo teclado, incluindo o cabeรงalho. + Opacidade + Reduza para ver o jogo atrรกs do teclado. + Teclas ocultas + Teclas que vocรช usa raramente nรฃo aparecem no teclado. + Esc e fileira de teclas de funรงรฃo + Ins / Del / Home / End / PgUp / PgDn + Teclas de seta Iniciar %1$s Escolha uma tela. Secundรกria: %1$s. A tela secundรกria nรฃo estรก mais disponรญvel. @@ -1786,7 +2024,24 @@ Terminal Botรตes traseiros + trackpads do Deck Painel + รrea de trabalho + Iniciar a รกrea de trabalho + รrea de trabalho ยท %1$s + Touchpad + Toque direto + Touchpad. Toque para usar o toque direto + Toque direto. Toque para usar o touchpad + Iniciando a รกrea de trabalho KDEโ€ฆ + A รกrea de trabalho foi encerrada. + Nรฃo foi possรญvel iniciar a รกrea de trabalho. Os registros ficam na pasta bottom-desktop desta sessรฃo. + A รกrea de trabalho estรก fechada. Nada para mostrar aqui ainda. + Alternar telas + A tela inferior estรก ocupada no momento + Tela do jogo + Exibir o jogo em + Tela superior + Tela inferior Downloads Nenhum download em andamento. Steam @@ -1821,6 +2076,20 @@ Combustรญvel, t Principal %1$s t Reserva %1$s t + Tempo de quadro + รบltimos %1$d s + quadro mรฉdio + 1% mais baixo + quadros acima de 33 ms + %1$d / min + Jogando hรก %1$s + %1$d nรบcleos, atรฉ %2$s GHz + %1$d nรบcleos + jogo + FPS de %1$d Hz + A marca vermelha indica onde o HUD mostra a temperatura em vermelho. + dispositivo inteiro + bateria Enviar dados para o painel Automรกtico Ativa para todos os jogos listados aqui, incluindo os encontrados depois. Os jogos que vocรช desativar continuam desativados. @@ -1844,6 +2113,10 @@ O microfone estรก desligado neste jogo. Para falar, ative Microfone nas configuraรงรตes da Steam do DroidDeck (รudio) e inicie o jogo de novo. Volume %1$d%% Estatรญsticas no jogo + HUD da tela inferior + Faixa em todas as abas + 1% e 0,1% mais baixos + Temperatura da CPU FPS CPU GPU @@ -2017,6 +2290,7 @@ Iniciando a sessรฃoโ€ฆ %1$d:%2$02d decorridos ยท ainda em andamento Baixando a atualizaรงรฃo do cliente Steam ยท %1$d%% + Aplicando a atualizaรงรฃo do cliente Steamโ€ฆ Baixando o cliente Steam ยท %1$s Jรก hรก uma instalaรงรฃo de ferramenta de compatibilidade em andamento @@ -2093,11 +2367,29 @@ Contornos de desenho animado e nitidez. Nรฃo รฉ uma GPU Adreno + Driver PowerVR do sistema: a compatibilidade varia por dispositivo + Experimental: RADV ou o driver Xclipse do sistema + PowerVR do sistema + Usa os drivers integrados desta GPU + O driver PowerVR do sistema estรก selecionado para o runtime e a tela. + Nenhum driver de cรณdigo aberto oferece suporte a esta Mali ainda: a ponte Mali estรก ativada. + Esta รฉ a versรฃo de teste para aparelhos sem Snapdragon: as versรตes oficiais daqui sรณ rodam em Adreno, entรฃo nรฃo sรฃo instaladas sobre ela. As novas versรตes de teste estรฃo em github.com/The412Banner/droiddeck-nonadreno-drivers. + A รบltima sessรฃo terminou porque o Android fechou o DroidDeck para liberar memรณria, e nรฃo por uma falha. Feche outros apps ou reduza as configuraรงรตes de textura do jogo e tente novamente. + Mali (Venus) + a ponte Mali + Nenhum driver de cรณdigo aberto oferece suporte a esta Mali ainda: %1$s รฉ usado no driver nativo do aparelho. + %1$s ainda nรฃo foi publicado: %2$s รฉ usado atรฉ lรก. + %1$s nรฃo estรก disponรญvel, e o driver deste aparelho informa Vulkan %2$s (Venus requer 1.2): a ponte Mali รฉ usada. + %1$s ainda nรฃo foi publicado: a ponte Mali estรก ativada atรฉ lรก. + Na fila: %1$s (aguardando outro driver de runtime) + O DXVK รฉ fornecido pelo runtime PowerVR do sistema. Outros pacotes DXVK podem ser armazenados, mas nรฃo sรฃo aplicados com este driver. Compatรญvel Experimental: os drivers sรฃo versรตes de teste Suporte experimental ร  Adreno 850: requer drivers de tela e de jogos experimentais compatรญveis; nรฃo verificado neste dispositivo Abaixo do hardware testado (Adreno 725 ou mais recente): pode nรฃo funcionar Nรฃo suportada: nenhum backend grรกfico compatรญvel estรก disponรญvel para esta GPU + Funciona pela ponte Mali, no driver Vulkan nativo do aparelho + Sem suporte com a ponte Mali desativada: o Turnip precisa de uma GPU Adreno (Snapdragon) O limite de requisiรงรตes do GitHub foi atingido - tente mais tarde O GitHub respondeu HTTP %1$d @@ -2206,7 +2498,6 @@ Lojas Steam Personalizado - Lojas Nรญvel de velocidade de download Equilibrado Rรกpido @@ -2245,6 +2536,7 @@ Aguardando o outro download do Battle.netโ€ฆ Abra o Battle.net e entre uma vez; depois instale os jogos dele aqui. O downloader da Blizzard parou: %1$s + O downloader da Blizzard parou de avanรงar. Erro da Blizzard %1$s Atualizar Jogos da Blizzard @@ -2252,6 +2544,7 @@ Interrompido Instalar ยท %1$s Obter grรกtis + Adicionando ร  bibliotecaโ€ฆ Ver em %1$s Comprar ยท %1$s Instalado @@ -2298,6 +2591,12 @@ Ordenar Rรณtulos da barra lateral Mostra os nomes sob os รญcones da barra lateral. Desative para uma barra lateral mais estreita. + Mascote do agente + DeeDee flutua sobre o launcher e os jogos e mostra o que o agente estรก fazendo. + Sobre outros apps + Permita que DeeDee flutue sobre todos os apps e abra o chat dela ali + Permitir + Conversar com DeeDee Exibiรงรฃo Cards maiores Cards menores @@ -2581,7 +2880,14 @@ %1$s ยท reinรญcio pendente Este aparelho Remover %1$s? - Diagnรณstico + Desenvolvedor + Marca de รกgua da compilaรงรฃo + Mostrar na tela a etiqueta da compilaรงรฃo de teste ou Lab. Ativada por padrรฃo. + Compartilhar pacotes de diagnรณstico + Sessรฃo e dispositivo + Grรกficos + Jogos e compatibilidade + Todos os pacotes Pronto para jogar Ainda nรฃo estรก pronto para jogar runtime %1$s @@ -2620,6 +2926,9 @@ Ative as conquistas da GOG nas configuraรงรตes de Lojas Conquistas indisponรญveis; veja os registros da sessรฃo Conquista desbloqueada + Mali (Venus): desativado + Mali (Venus): ativado + O driver em %1$s informa Vulkan %2$s. Mali (Venus) requer Vulkan 1.2 ou mais recente (o gamescope nรฃo inicia em versรตes anteriores), por isso as sessรตes ignoram o Venus e usam o par de drivers PanVK. Colar Analรณgico esquerdo Analรณgico direito @@ -2919,7 +3228,7 @@ Escolher pastaโ€ฆ Use qualquer pasta em um cartรฃo SD ou unidade USB Os jogos vรฃo para uma pasta Games dentro do local selecionado. Jogos existentes nรฃo sรฃo movidos. - Para onde vai + O que ocupa espaรงo Jogos da Steam Dados dos jogos Prefixos %1$s ยท workshop %2$s ยท shaders %3$s @@ -2988,6 +3297,7 @@ Instaladores de VC++ e DirectX exigidos pelos jogos Roda jogos Linux x86 Ferramenta da Steam + O Steam baixa isso para jogos que incluem anti-cheat, mesmo quando ele estรก desativado. Removรช-lo trava a instalaรงรฃo desses jogos em 0% O DroidDeck roda jogos sem este runtime Proton x86, que o DroidDeck nรฃo consegue rodar Padrรฃo para todos os jogos @@ -3058,6 +3368,19 @@ Mantidos Jogos nรฃo Steam e prefixo compartilhado da Steam Prefixos de jogos adicionados pelas lojas ou ร  mรฃo + Prefixo compartilhado da Steam + A Steam executa aqui seus prรณprios auxiliares do Windows + Apaga o prefixo (%1$s). A Steam cria um novo na prรณxima vez que precisar. + Um app de loja e os jogos que rodam com ele + Usado por %1$s + Jogo nรฃo Steam %1$s + Nรฃo corresponde a nenhum jogo, entรฃo รฉ mantido + Remover seleรงรฃo ยท %1$s + Desinstalar seleรงรฃo ยท %1$s + Prefixos do Wine + Salvamentos e configuraรงรตes neles sรฃo perdidos; os salvamentos do Steam Cloud continuam na sua conta. + Caches de shaders + Prefixo %1$s ยท shaders %2$s Pacotes baixados Originais mantidos Nenhum pacote de componentes baixado. @@ -3094,6 +3417,8 @@ DroidDeck ยท %1$d fps 60 fps fica mais fluido, mas usa mais CPU enquanto o Steam inicia. Um vรญdeo escolhido nas configuraรงรตes do Steam tambรฉm aparece aqui. Som + Pular vรญdeo de inicializaรงรฃo + Use um clipe preto de 0,1 segundo como vรญdeo de inicializaรงรฃo do Steam. Aplica-se na prรณxima sessรฃo. Seu prรณprio vรญdeo MP4, MOV, MKV ou WebM. Outros formatos e arquivos acima de %1$d MB sรฃo convertidos para WebM 720p no aparelho, atรฉ %2$d segundos. Importar @@ -3555,6 +3880,7 @@ Mantรฉm Alt+Tab, a tecla Win e o botรฃo Inรญcio em uma sessรฃo ativa do DroidDeck em vez do Android. Ative Brilho em Configuraรงรฃo โ†’ Integraรงรฃo com a Steam Ponte Mali: desligada + %1$s nรฃo pode usar a ponte Mali (ela precisa de uma GPU Mali sem uma rota de driver do sistema), por isso esta chave nรฃo tem efeito aqui. Ponte Mali: ligada %1$s nรฃo รฉ uma Adreno. A ponte Vulkan experimental estรก ligada: a sessรฃo desenha pelo prรณprio driver do celular. Espere bugs; envie os logs da sessรฃo. Modo seguro @@ -3580,6 +3906,25 @@ Mover para depois Configuraรงรตes do widget Remover widget + Aparรชncia + Pacote de รญcones + Padrรฃo do sistema + Fundo na cor do app + Tamanho dos รญcones + Pequeno + Mรฉdio + Grande + Ocultar nomes dos apps + Espaรงamento + Justo + Normal + Amplo + Alterar รญcone + Redefinir รญcone + Buscar รญcones + Carregando รญconesโ€ฆ + Nenhum รญcone encontrado. + รcones personalizados Adicionar ร  pasta Nova pasta Remover da pasta @@ -3696,5 +4041,81 @@ Nรฃo foi possรญvel importar este layout Neve Escarlate + Superfรญcies brancas com detalhes em vermelho. + Trilhas sonoras + Mรบsica + Opรงรตes de reproduรงรฃo + Favoritas + Coleรงรตes + Nenhuma coleรงรฃo ainda. Toque no รญcone de marcador para criar uma. + Salvas + Criar uma coleรงรฃo + Organize suas faixas salvas + Nova + Criar + Nome da coleรงรฃo + Digite um nome que nenhuma outra coleรงรฃo use + Gerenciar + Renomear + Adicionar faixas + Adicionar (%1$d) + Remover faixas + Excluir coleรงรฃo + Excluir %1$s? + As faixas continuam no seu dispositivo. Somente a coleรงรฃo รฉ removida. + Selecionar + Selecionar tudo + Desmarcar tudo + %1$d selecionadas + Adicionar ร  coleรงรฃo + Adicionar ร s favoritas + Remover da coleรงรฃo + Pesquisar faixas + Ordem do รกlbum + Mais longas primeiro + Mais curtas primeiro + Faixas + Tom + Redefinir + Pular silรชncio + Timer de sono + %1$d min + Fim da faixa + Restam %1$s + Equalizador + Reforรงo de graves + O equalizador nรฃo estรก disponรญvel neste dispositivo + Ativar durante o jogo + Continuar tocando a trilha sonora enquanto um jogo estรก em execuรงรฃo + Nenhuma trilha sonora instalada ainda. + Pesquisar trilhas sonoras + Adicionar uma pasta de trilha sonora + Nenhum arquivo de รกudio nessa pasta + Duraรงรฃo total + %1$d faixas / %2$s + Disco %1$s + Aleatรณrio + Anterior + Reproduzir + Pausar + Prรณxima + Repetiรงรฃo desativada + Repetir tudo + Repetir uma + Volume + Nenhum arquivo de รกudio nesta trilha sonora + Inicializaรงรฃo indisponรญvel + Nenhum navegador estรก disponรญvel para abrir este link. + Agarrar + Soltar + Salvar + Segure para redefinir + Lojas + Tempo de quadro + Taxa mรฉdia de quadros + Servidor de exibiรงรฃo + Estado HDR + Exibidos + %1$d de %2$d diff --git a/app/src/main/res/values-ro/input_library.xml b/app/src/main/res/values-ro/input_library.xml new file mode 100644 index 0000000000..e277e65abf --- /dev/null +++ b/app/src/main/res/values-ro/input_library.xml @@ -0,0 +1,132 @@ + + + Setฤƒrile de intrare necitibile au fost pฤƒstrate รฎntr-o copie de recuperare. Poศ›i continua sฤƒ editezi profilurile restaurate. + Proprietฤƒศ›i + Proprietฤƒศ›i clic + %1$s ยท Clic + Butoane + Manete, pad-uri ศ™i trฤƒgaci + Ascunde instrumentele + Controller + Trimite intrarea controllerului cฤƒtre Steam Input sau joc. + Acest element nu trimite intrare de controller, mouse sau tastaturฤƒ. + Clic de mouse + Acศ›iune DroidDeck + Acศ›iune + Viteza de derulare: %1$d paศ™i/s + + Profil nou + + Aspect nou + %1$s ยท Folosit de %2$d profiluri. Modificฤƒrile se aplicฤƒ fiecฤƒrui profil care foloseศ™te aceste atribuiri. + Redenumeศ™te + ศ˜terge + Adaugฤƒ elemente รฎn aspect รฎnainte de a le atribui acศ›iuni. + Setฤƒrile de intrare nu au putut fi salvate + Nume + รŽncepe de la + Buton + Manetฤƒ + Touchpad + Cruce + Trฤƒgaci + Gata + Anuleazฤƒ + + Adaugฤƒ + Trage pentru a muta. Trage de un colศ› pentru a redimensiona. Atinge Proprietฤƒศ›i pentru a atribui o acศ›iune. + Editare pe ecranul secundar + Ecranul selectat nu este disponibil. Conecteazฤƒ-l pentru a edita acest aspect la dimensiunea realฤƒ. + Renunศ›i la modificฤƒrile de aspect nesalvate? + Acest aspect este folosit de %1$d profiluri. Modificฤƒrile salvate se aplicฤƒ tuturor. + Profiluri implicite + Mod desktop + Mod joc + Implicit pentru desktop ศ™i joc + Implicit pentru modul joc + Implicit pentru modul desktop + Setฤƒri dispozitiv + Comenzi + Butoane, manete, trฤƒgaci ศ™i taste suplimentare + Copiazฤƒ profilul + Reseteazฤƒ acศ›iunile + Resetezi acศ›iunile din %1$s la valorile implicite ale profilului de bazฤƒ? Aspectele ศ™i celelalte profiluri rฤƒmรขn neschimbate. + ศ˜tergi %1$s? Modurile care รฎl folosesc revin la profilul implicit integrat. Aspectele salvate ศ™i setฤƒrile partajate rฤƒmรขn disponibile. + Vizibilitate + Se aplicฤƒ tuturor profilurilor. Auto afiศ™eazฤƒ comenzile ecranului principal cรขnd nu este conectat un controller รฎn modul joc. + Editeazฤƒ pe ecran + Aspecte salvateโ€ฆ + Alege un aspect sau creeazฤƒ-l pe al tฤƒu + Alege Comenzile profilului รฎn meniul de sesiune al ecranului secundar. Selectoarele Profil ศ™i Ecran secundar din meniul controllerului decid ce comenzi sunt afiศ™ate. + Acศ›iunile butoanelor + Partajat cu %1$s. Modificฤƒrile se aplicฤƒ ศ™i acelor profiluri. + Reutilizeazฤƒ setฤƒrile + Foloseศ™te setฤƒrile dinโ€ฆ + Copiazฤƒ din alt profil sau pฤƒstreazฤƒ setฤƒrile partajate + Fฤƒ independent + Pฤƒstreazฤƒ configuraศ›ia actualฤƒ ศ™i nu mai partaja modificฤƒrile + Aspectele stocheazฤƒ elemente ศ™i poziศ›iile lor. Fiecare profil poate atribui propriile acศ›iuni. Editeazฤƒ la dimensiune completฤƒ pe ecranul ศ›intฤƒ. + Aspectul actual + ศ˜tergi aspectul nefolosit %1$s ศ™i acศ›iunile lui salvate? + Redenumeศ™te aspectul actual + Reutilizeazฤƒ %1$s din alt profil. Celelalte surse de control rฤƒmรขn neschimbate. + Pฤƒstreazฤƒ comenzile fizice partajate + Implicit, toate comenzile ศ™i aspectele personalizate sunt copii independente. Partajarea leagฤƒ doar comenzile fizice. + Foloseศ™te aceste elemente ศ™i poziศ›ii. Partajarea sincronizeazฤƒ modificฤƒrile viitoare de geometrie; acศ›iunile butoanelor rฤƒmรขn independente. Un aspect diferit รฎncepe cu acศ›iuni neatribuite. + Copiazฤƒ aceste comenzi ศ™i acศ›iuni sau leagฤƒ-le astfel รฎncรขt modificฤƒrile viitoare sฤƒ se aplice ambelor profiluri. + Pฤƒstreazฤƒ partajat + Copie independentฤƒ + Porneศ™te maneta la punctul de atingere + Ascunde maneta cรขnd nu este folositฤƒ + Instrumente + Auto (%1$s) + Personalizat (%1$s) + Salveazฤƒ ca profil nou + Comenzile profilului + Profil + Gesturi touchpad mouse + Cรขnd este atribuit indicatorului mouse-ului: atinge pentru clic, ศ›ine pentru tragere ศ™i deruleazฤƒ cu douฤƒ degete. + %1$s are o suprascriere a meniului rapid. Selecteazฤƒ Auto acolo pentru a folosi profilul implicit ศ™i toate cele trei pฤƒrศ›i salvate. + Intrare DroidDeck + ศšinut cรขt timp maneta este miศ™catฤƒ รฎn orice direcศ›ie: apฤƒsat peste 55%, eliberat sub 35%. Foloseศ™te Tastele direcศ›ionale pentru a atribui fiecare direcศ›ie separat. Comenzile DroidDeck ruleazฤƒ o datฤƒ per deviere. Clicul manetei se configureazฤƒ separat. + ศšinut cรขt timp atingi touchpad-ul; eliberat cรขnd ridici degetul. Comenzile DroidDeck ruleazฤƒ o datฤƒ per atingere. Clicul touchpad-ului se configureazฤƒ separat. + ศšinut cรขnd trฤƒgaciul trece de 55%; eliberat sub 35%. Comenzile DroidDeck ruleazฤƒ o datฤƒ per apฤƒsare. + Direcศ›ia de derulare + Vertical + Orizontal + Deruleazฤƒ orizontal + Mฤƒsurฤƒtori + Activeazฤƒ รฎnregistrarea, foloseศ™te comenzile รฎntr-o sesiune activฤƒ, apoi revino ศ™i citeศ™te rezultatele. Mฤƒsoarฤƒ doar timpul de trimitere DroidDeck, nu latenศ›a ecranului. รŽnregistrarea se terminฤƒ cรขnd procesul aplicaศ›iei se รฎnchide. + %1$d comenzi + Alte aspecte salvate (%1$d) โ–พ + Ascunde alte aspecte salvate (%1$d) โ–ด + Acasฤƒ / Guide + รŽnapoi ยท o atingere + รŽnapoi ยท atingere dublฤƒ + รŽnapoi ยท de douฤƒ ori รฎn Steam, o datฤƒ pe desktop + รŽn modul Steam. ศšinerea butonului รŽnapoi deschide ศ™i accesul rapid. + Restabileศ™te implicit + Alegerea panoului este reศ›inutฤƒ. Desktopul deschide un al doilea spaศ›iu de lucru; nu schimbฤƒ sesiunea sau profilul ei de intrare. + Controller virtual + Tipul de controller vฤƒzut de Steam sau de joc. + Ecran tactil + Cum sunt tratate atingerile pe ecranul jocului. Butoanele profilului รฎศ™i pฤƒstreazฤƒ acศ›iunile atribuite. + Cursor tactil + Afiศ™eazฤƒ un indicator pentru atingeri directe pe ecranul jocului. + Atinge ศ™i ศ›ine + Acศ›iunea mouse-ului cรขnd ศ›ii un deget pe ecranul jocului. + Atingeri ale butonului รŽnapoi + Prima acศ›iune: o atingere. A doua acศ›iune: atingere dublฤƒ. + Buton de comutare + Atinge pentru a ศ›ine, atinge din nou pentru a elibera. Deschiderea unui meniu sau schimbarea profilului elibereazฤƒ butonul. + Formฤƒ + Rotunjit + Capsulฤƒ + Cerc + Dreptunghi + Eticheta butonului + Text + Imagine importatฤƒ + Taste diagonale separate + Atribuie o tastฤƒ fiecฤƒrei diagonale. O diagonalฤƒ goalฤƒ apasฤƒ cele douฤƒ direcศ›ii vecine. + Direcศ›ii vecine + Vechile tale taste de pe ecran sunt salvate mai jos ca profiluri importate. Selecteazฤƒ unul pentru a-l folosi sau edita. Selecศ›iile actuale de profil au fost pฤƒstrate. + Vechile taste de pe ecran nu au putut fi importate automat. Setฤƒrile originale au fost pฤƒstrate. + diff --git a/app/src/main/res/values-ro/input_strings.xml b/app/src/main/res/values-ro/input_strings.xml new file mode 100644 index 0000000000..1603f7b260 --- /dev/null +++ b/app/src/main/res/values-ro/input_strings.xml @@ -0,0 +1,38 @@ + + + Profiluri de intrare + Profiluri + Controller fizic + Ecran principal + Ecran secundar + Nativ / Steam Input + Nativ: %1$s + Trimite altฤƒ comandฤƒ a controllerului + Dezactivat + Tastฤƒ sau combinaศ›ie de taste + Taste direcศ›ionale + Mutฤƒ indicatorul + Viteza indicatorului: %1$d + Deruleazฤƒ + Deruleazฤƒ vertical + Butonul stรขng al mouse-ului + Butonul drept al mouse-ului + Butonul din mijloc al mouse-ului + Deschide meniul DroidDeck + Afiศ™eazฤƒ tastatura + Deschide meniul Steam + Deschide accesul rapid Steam + Eliminฤƒ controlul + Adaugฤƒ control + Butoane specifice dispozitivului + Atribuie un buton fizic + Elibereazฤƒ butonul, apoi alege Editeazฤƒ, Reรฎncearcฤƒ sau Anuleazฤƒ. B sau รŽnapoi anuleazฤƒ dupฤƒ eliberare. + Reรฎncearcฤƒ + Apasฤƒ un buton, inclusiv un buton รŽnapoi raportat ca tastฤƒ. Tastele de volum ศ™i tastele de sistem Android sunt rezervate. Atribuirea se aplicฤƒ doar acestui dispozitiv. + Eliminฤƒ atribuirea + Diagnozฤƒ intrare + รŽnregistreazฤƒ timpul de trimitere a intrฤƒrii + Citeศ™te mฤƒsurฤƒtorile + Mฤƒsoarฤƒ trimiterea de la Android pรขnฤƒ la publicarea รฎn transportul de intrare existent. Nu include sosirea prin Bluetooth, interogarea invitatului, randarea ศ™i latenศ›a ecranului. รŽnregistrarea este opritฤƒ implicit. + Foloseศ™te atribuirea normalฤƒ de intrare + diff --git a/app/src/main/res/values-ro/strings.xml b/app/src/main/res/values-ro/strings.xml index d3b8b9269b..9c28d24295 100644 --- a/app/src/main/res/values-ro/strings.xml +++ b/app/src/main/res/values-ro/strings.xml @@ -28,6 +28,8 @@ Suspendฤƒ acum Opreศ™te sesiunea Generare de cadre + Setฤƒri pentru acest joc + Setฤƒri implicite Selecteazฤƒ modul de generare a cadrelor Dezactivat DD-FG %1$dร— @@ -183,6 +185,7 @@ Mediul grafic PowerVR nu a putut fi descฤƒrcat. Verificฤƒ conexiunea ศ™i รฎncearcฤƒ din nou. DirectAudio nu a putut fi descฤƒrcat, aศ™a cฤƒ sunetul jocurilor foloseศ™te calea mai lentฤƒ รฎn aceastฤƒ sesiune. Acest program + Sesiunea nu a putut reda pe ecran: %1$s. Acest ecran aratฤƒ motivul รฎn locul unui ecran negru; detaliile sunt รฎn jurnalele sesiunii. Clientul Steam nu a putut fi descฤƒrcat. Reศ›eaua sau VPN-ul tฤƒu poate bloca serverele Steam; verificฤƒ conexiunea ศ™i รฎncearcฤƒ din nou. Clientul Steam nu a putut fi configurat. Verificฤƒ conexiunea ศ™i spaศ›iul liber, apoi รฎncearcฤƒ din nou. %1$s este compilat pentru PC-uri x86 ศ™i ruleazฤƒ prin FEX, care nu este รฎncฤƒ instalat. Porneศ™te Steam o datฤƒ, fiind autentificat, ศ™i lasฤƒ-l sฤƒ descarce FEX ศ™i Steam Linux Runtime, apoi porneศ™te din nou acesta. @@ -386,6 +389,9 @@ Neacceptat รฎncฤƒ aici Se รฎncarcฤƒ componenteleโ€ฆ Nu s-a putut instala: %1$s + Aceastฤƒ descฤƒrcare trebuie actualizatฤƒ. + Actualizare รฎn aศ™teptare. + Reรฎncearcฤƒ actualizarea Descฤƒrcat Se descarcฤƒ %1$s Se instaleazฤƒ: %1$s @@ -416,6 +422,22 @@ Doar internฤƒ Folder: %1$s A doua bibliotecฤƒ + Mai multe biblioteci Steam + Dosare รฎn care Steam poate instala ศ™i din care poate rula jocuri, fiecare cu propriul nume. Eliminarea unuia lasฤƒ jocurile pe disc. + Adaugฤƒ bibliotecฤƒ + Redenumeศ™te + Nume bibliotecฤƒ + Alege un dosar pentru bibliotecฤƒ + Cel mult %1$d biblioteci adฤƒugate + Acel dosar este deja o bibliotecฤƒ sau se aflฤƒ รฎntr-una + %1$s ยท indisponibil + Se aplicฤƒ din urmฤƒtoarea sesiune Steam + Gฤƒsit pe acest dispozitiv ยท %1$s ยท %2$s + Adaugฤƒ + Gฤƒseศ™te biblioteci รฎn stocarea internฤƒ + Permite accesul la toate fiศ™ierele ca DroidDeck sฤƒ poatฤƒ vedea bibliotecile Steam pฤƒstrate de alte aplicaศ›ii รฎn stocarea internฤƒ + Permite + S-a adฤƒugat %1$s, biblioteca Steam din dosarul ales Jocurile care transmit fiศ™iere de pe SD sau din stocarea partajatฤƒ pot avea sacadฤƒri. Diagnosticare stocare รŽnregistreazฤƒ rezultatele alocฤƒrilor ศ™i timpii de stocare eศ™antionaศ›i รฎn Partajare jurnale. Poate รฎncetini instalฤƒrile cรขt este activฤƒ. Se aplicฤƒ la sesiunea urmฤƒtoare. @@ -480,6 +502,7 @@ Activat Porneศ™te cu Steam Porneศ™te fฤƒrฤƒ Steam + Rezoluศ›ia jocului Setฤƒri Setฤƒri %1$s Implicit @@ -567,6 +590,8 @@ Nuclee pentru joc Nuclee pentru joc Nuclee pentru jocuri. Cu toate selectate, Android le programeazฤƒ liber. + Economiseศ™te energie รฎn jocurile stabile + Ruleazฤƒ jocul pe nucleele mai lente cรขt timp รฎศ™i menศ›ine o ratฤƒ de cadre stabilฤƒ ศ™i รฎl readuce pe nucleele obiศ™nuite cรขnd rฤƒmรขne รฎn urmฤƒ. Interfaศ›a clientului GL pe fire Poate face meniurile Steam mai receptive. @@ -602,7 +627,10 @@ Dezactiveazฤƒ asistentul de navigare cu gamepad al Proton, care costฤƒ CPU รฎn fiecare joc. Ruleazฤƒ proot fฤƒrฤƒ seccomp Poate remedia erori de apel de sistem lipsฤƒ pe unele kernel-uri. Poate reduce performanศ›a. + Ruleazฤƒ fฤƒrฤƒ proot (experimental) + Porneศ™te partea Linux direct pe Android. Se aplicฤƒ din urmฤƒtoarea sesiune. Dezactiveazฤƒ dacฤƒ ceva nu porneศ™te. Cale rapidฤƒ proot + Nu se foloseศ™te fฤƒrฤƒ proot. Necesitฤƒ filtrul seccomp al proot. Cฤƒutฤƒri de fiศ™iere mai rapide ศ™i mai puศ›ine sacadฤƒri. Dezactiveazฤƒ dacฤƒ un program nu รฎศ™i gฤƒseศ™te fiศ™ierele. Deseneazฤƒ cursorul รฎn gamescope @@ -685,6 +713,7 @@ Memorie graficฤƒ Memorie swap Nivel baterie + Autonomie rฤƒmasฤƒ a bateriei Consum de energie Reศ›ea Rezoluศ›ie @@ -812,6 +841,7 @@ Dispozitiv acceptat GPU netestat GPU neacceptat + GPU prin puntea Mali %1$s ยท %2$s %1$s: %2$s Nu este disponibil un backend grafic compatibil pentru %1$s. Steam poate afiศ™a un ecran negru. @@ -841,15 +871,38 @@ Sesiune Jurnalele sesiunii Salvate dupฤƒ fiecare sesiune + Diagnosticare extinsฤƒ pentru urmฤƒtoarea sesiune + Capteazฤƒ jurnale detaliate pentru o singurฤƒ sesiune. Poate reduce performanศ›a ศ™i folosi mai mult spaศ›iu de stocare. Se dezactiveazฤƒ automat cรขnd porneศ™te sesiunea; verificฤƒ jurnalele รฎnainte de a le partaja. Jurnale de depanare a jocurilor Include diagnosticare Proton, Wine ศ™i graficฤƒ la urmฤƒtoarea lansare a unui joc. Poate reduce performanศ›a ศ™i foloseศ™te mai mult spaศ›iu. Reporneศ™te aceastฤƒ sesiune pentru a salva jurnalele de depanare Jurnalizarea nu a putut fi actualizatฤƒ. Verificฤƒ comutatorul ศ™i รฎncearcฤƒ din nou. Instrumente de depanare + Jurnale detaliate de graficฤƒ + Interfaศ›a Steam: desenare GPU + Cu perechea de drivere Xclipse, Steam รฎศ™i deseneazฤƒ paginile รฎn software (desenarea GPU a afiศ™at dale stricate). Activeazฤƒ pentru o interfaศ›ฤƒ Steam mai rapidฤƒ dacฤƒ aratฤƒ corect pe acest telefon. + compilat la %1$s + %1$s actualizat la cea mai nouฤƒ versiune + Puntea Mali nu a trecut autotestul pe %1$s รฎn sesiunea anterioarฤƒ (imagini sau desenฤƒri), aศ™a cฤƒ sesiunea a folosit รฎn schimb perechea de drivere PanVK. + Puntea Mali nu a gฤƒsit nicio modalitate de a partaja memoria cu driverul pe %1$s รฎn sesiunea anterioarฤƒ, aศ™a cฤƒ sesiunea a folosit รฎn schimb perechea de drivere PanVK. Puntea nu poate funcศ›iona pe acest telefon; dezactivarea ei pฤƒstreazฤƒ perechea PanVK. + Jurnalele Proton, DXVK ศ™i de drivere ale fiecฤƒrui joc sunt incluse รฎn jurnalele sesiunii. Activat mereu cรขnd GPU-ul nu este Adreno. Cele mai recente jurnale de sesiune Jurnale de sesiune salvate Pฤƒstreazฤƒ cele mai recente %1$d ศ˜terge jurnalele + Jurnale de sesiune disponibile + Nu existฤƒ รฎncฤƒ jurnale de sesiune salvate. + Arhivele ZIP partajate ศ™i salvate includ sesiunea selectatฤƒ, plus datele de diagnosticare aferente pentru Steam, magazine, instrumente ศ™i Battle.net. + %1$s ยท %2$s + Sesiunea curentฤƒ + Partajeazฤƒ + Salveazฤƒ pe dispozitiv + ศ˜terge + ศ˜terge jurnalele de sesiune? + ศ˜terge %1$s? Operaศ›iunea nu poate fi anulatฤƒ. + Jurnalele de sesiune au fost salvate. + Jurnalele de sesiune nu au putut fi salvate. + Jurnalele de sesiune nu au putut fi ศ™terse. Reseteazฤƒ toate setฤƒrile Readuce fiecare setare la valoarea implicitฤƒ Reseteazฤƒ @@ -876,6 +929,8 @@ Foloseศ™te ca ecran Acasฤƒ DroidDeck poate fi aplicaศ›ia Acasฤƒ DroidDeck nu este niciodatฤƒ oferit ca aplicaศ›ie Acasฤƒ + Butonul Acasฤƒ deschide + Pagina afiศ™atฤƒ cรขnd DroidDeck este aplicaศ›ia de pornire ศ™i apeศ™i butonul Acasฤƒ รŽn Adaugฤƒ jocuri, seteazฤƒ DroidDeck pe Include Orientare Orientarea launcherului @@ -889,15 +944,22 @@ Ecran complet Ascunde barele de stare ศ™i de navigare Android Aratฤƒ barele de stare ศ™i de navigare Android + Lansator pe douฤƒ ecrane + Automat plaseazฤƒ secศ›iunile lansatorului (Steam, Bibliotecฤƒ, Magazine ศ™i celelalte) pe ecranul secundar al consolelor portabile cu unul integrat. Activat foloseศ™te orice ecran secundar. Dezactivat pฤƒstreazฤƒ lansatorul pe un singur ecran. + Sesiuni pe douฤƒ ecrane + Automat andocheazฤƒ meniul din joc pe ecranul secundar integrat, รฎn loc de o fereastrฤƒ suprapusฤƒ. Activat foloseศ™te orice ecran secundar. Dezactivat pฤƒstreazฤƒ meniul pe ecranul jocului; poศ›i alege รฎn continuare un ecran secundar din meniu. Automat Pornit Oprit Comenzi pe ecranul de jos รฎn jocuri + Tastatura Android pentru cรขmpurile de text Deschide trackpadul ศ™i tastatura pe al doilea ecran cรขnd porneศ™te o sesiune. Scriere pentru ecranul de sus Gata Aplicaศ›ia Acasฤƒ implicitฤƒ Alege o aplicaศ›ie Acasฤƒ + Ascunde aplicaศ›ia de pornire din lista aplicaศ›iilor recente cรขt timp este inactivฤƒ + Se aplicฤƒ doar cรขnd DroidDeck este aplicaศ›ia implicitฤƒ de pornire ศ™i nu ruleazฤƒ nicio sesiune. Alege Aplicaศ›ii Linux (beta) Fiศ™iere @@ -1009,9 +1071,173 @@ Preview Cele mai noi remedieri, รฎnainte de Stabilฤƒ Actualizat + Copiazฤƒ detaliile versiunii + Detaliile versiunii au fost copiate + รŽnaintea Preview + Eศ™ti รฎnaintea Preview + Aceastฤƒ versiune este mai nouฤƒ decรขt ultima Preview. Urmฤƒtoarea versiune Preview o va actualiza. + Alege o versiune pentru a-i vedea modificฤƒrile sau a o instala. + Instalatฤƒ + Instaleazฤƒ aceastฤƒ versiune%1$s + Revino la aceastฤƒ versiune%1$s + versionCode %1$d + Commit %1$s + Pagina versiunii + PR-ul are un commit mai nou (%1$s). Versiunea lui de test nu e gata รฎncฤƒ, aศ™a cฤƒ aceasta nu รฎl include. + Commit mai nou, versiune รฎn aศ™teptare + Numฤƒr PR, titlu sau autor + Nicio versiune de test nu se potriveศ™te + Trebuie recompilatฤƒ (versionCode %1$d) + Actualizฤƒri pentru versiunile de test + Versiune de test nouฤƒ pentru PR #%1$d + %1$s. Deschide Actualizฤƒri pentru a o instala. + Aratฤƒ mai multe (%1$d) + Trebuie recompilate pentru versionCode %2$d (%1$d) + Versiuni Preview pe main de la aceastฤƒ versiune de test: %1$d Versiuni de test รŽncearcฤƒ o remediere รฎnainte de lansare Niciuna acum + Versiune experimentalฤƒ + Versiuni experimentale + รŽn utilizare + รŽn pauzฤƒ dupฤƒ ce Android a reoptimizat DroidDeck + Nu s-a รฎncฤƒrcat: %1$s + รŽn aศ™teptarea unei reporniri + Pฤƒstratฤƒ + Pentru altฤƒ versiune + Reconstruieศ™te + ศ˜terge aceastฤƒ versiune de pe dispozitiv + Reporneศ™te cu aceastฤƒ versiune + Dezactiveazฤƒ + Foloseศ™te + ศ˜terge + ศ˜terge acum + Repornirea nu a putut fi pregฤƒtitฤƒ: %1$s. Asociazฤƒ depanarea wireless รฎn Configurare ศ™i รฎncearcฤƒ din nou. + Versiune experimentalฤƒ instalatฤƒ + DroidDeck a repornit pe %1$s + Compilarea Lab suspendatฤƒ + Android a reoptimizat DroidDeck, aศ™a cฤƒ %1$s nu s-a รฎncฤƒrcat. Deschide Actualizฤƒri pentru a reporni pe ea. + Compilarea Lab dezactivatฤƒ + A fost construitฤƒ pentru o altฤƒ versiune de DroidDeck. Este pฤƒstratฤƒ รฎn Actualizฤƒri. + DroidDeck nu a pornit pe ea de douฤƒ ori + Agent + Agent + Agentul lucreazฤƒ + Instaleazฤƒ Claude Code รฎn spaศ›iul utilizatorului Linux pentru a folosi agentul. + รŽntreabฤƒ despre un joc, o blocare sau o modificare a DroidDeck + Trimite + Conversaศ›ie nouฤƒ + Opreศ™te + Stocare + Eliminฤƒ + Eliminฤƒ acum + Claude Code + Codex + Codul sursฤƒ DroidDeck + Cache-uri de descฤƒrcare + Modificฤƒrile netrimise se pierd + Compilฤƒrile le vor descฤƒrca din nou + Configurarea รฎl poate instala din nou; datele de autentificare se pฤƒstreazฤƒ + DroidDeck a repornit pe compilarea ta Lab. Continuฤƒ de unde ai rฤƒmas. + รŽntreabฤƒ-l de ce un joc nu porneศ™te, cere-i sฤƒ explice un jurnal sau sฤƒ modifice DroidDeck ศ™i sฤƒ รฎncerce modificarea pe acest dispozitiv. + A eศ™uat: %1$s + %1$s s-a รฎncheiat (ieศ™ire %2$d) + Oprit + S-a รฎncheiat fฤƒrฤƒ rฤƒspuns + Reรฎncearcฤƒ + Se configureazฤƒ agentul + Reconstruieศ™te compilarea mea Lab %1$s pentru versiunea instalatฤƒ de DroidDeck ศ™i reporneศ™te pe ea. + %1$s intrare ยท %2$s ieศ™ire + Se gรขndeศ™te + Gรขnd + Se gรขndeศ™te ยท %1$s + %1$s ยท %2$s + INTRARE + IEศ˜IRE + Se executฤƒโ€ฆ + Niciun rezultat: runda s-a รฎncheiat รฎnainte + Nicio ieศ™ire + Scrie pentru a pune urmฤƒtorul mesaj รฎn coadฤƒ + Pune รฎn coadฤƒ + Urmฤƒtorul: %1$s + Nu trimite + Ataศ™eazฤƒ + Eliminฤƒ + Implicit + Efort de raศ›ionament + Continuฤƒ + Revizuieศ™te + Nimic nu s-a schimbat รฎncฤƒ + Continuฤƒ cu planul. + Trimite acum + Mai multe + รŽnchide + Cele mai recente + Lucreazฤƒ + Context + %1$s din %2$s + Aceastฤƒ conversaศ›ie ยท %1$s + Utilizarea apare dupฤƒ primul rฤƒspuns + Limitฤƒ de %1$d ore + Limitฤƒ de %1$d minute + Limitฤƒ sฤƒptฤƒmรขnalฤƒ + %1$d%% ยท se reseteazฤƒ %2$s + + %1$d fiศ™iere + %1$d fiศ™ier + %1$d de fiศ™iere + + Planificฤƒ mai รฎntรขi + Plan + Propune un plan fฤƒrฤƒ a modifica nimic + Conversaศ›ii + Nu existฤƒ รฎncฤƒ conversaศ›ii + Chiar acum + ศ˜terge + ศ˜terge conversaศ›ia ศ™i ataศ™amentele ei + Procese + Nu ruleazฤƒ nimic รฎn spaศ›iul utilizatorului Linux + AGENT + Opreศ™te + Compilare Lab + Se pregฤƒtesc compilฤƒrile Lab + %1$d%% ยท mai rฤƒmรขn aproximativ %2$s + mai rฤƒmรขn aproximativ %1$s + Anuleazฤƒ + Anuleazฤƒ compilarea + Se porneศ™te + %1$d%% + Se รฎmpacheteazฤƒ + Se reporneศ™te DroidDeck pe acesta + Gata + Eศ™ec: %1$s + Configureazฤƒ agentul + Instaleazฤƒ mai รฎntรขi mediul de execuศ›ie Linux รฎn Configurare. + Reรฎncearcฤƒ + รŽncepe conversaศ›ia + Conexiunea dispozitivului + Depanare wireless, pentru ca agentul sฤƒ vadฤƒ ศ™i sฤƒ controleze DroidDeck + Instaleazฤƒ %1$s + รŽn mediul Linux, cu git, gh ศ™i adb + Conectare la %1$s + Deschide browserul + GitHub + Opศ›ional, pentru a deschide pull requests + Instrumente de compilare + Opศ›ional, pentru compilฤƒri Lab pe acest dispozitiv ยท aproximativ 5 GB + Agent pregฤƒtit + Finalizaศ›i configurarea agentului + Conectat la %1$s + Compilฤƒri Lab + compilฤƒri rapide + Compilฤƒri Lab rapide + Compileazฤƒ aceastฤƒ versiune รฎn avans, ca apoi compilฤƒrile Lab sฤƒ dureze minute ยท aproximativ 20 de minute, o singurฤƒ datฤƒ + Se compileazฤƒ ยท %1$d%% ยท timp rฤƒmas: aproximativ %2$s + Pregฤƒteศ™te + Depanarea fฤƒrฤƒ fir nu este accesibilฤƒ; โ€žAsociazฤƒโ€ o activeazฤƒ + Asociazฤƒ + Instaleazฤƒ + Conectaศ›i-vฤƒ PR #%1$d Nu este compilatฤƒ pentru aceastฤƒ copie de DroidDeck Actualizat %1$s @@ -1255,6 +1481,9 @@ Aplicaศ›ii Configurare Actualizฤƒri + Mai multe + Editeazฤƒ taburile + Taburi %1$d%% Reluare %1$s Apare ca /root/ROMs รฎn fiecare sesiune. Stocarea internฤƒ este la /root/Storage. @@ -1276,6 +1505,15 @@ Anuleazฤƒ cererea รฎn aศ™teptare Tastatura Android Ascunde โœ• + Dimensiune pe ecran + Partea din ecran ocupatฤƒ de tastaturฤƒ, inclusiv antetul. + Opacitate + Reduceศ›i-o pentru a vedea jocul din spatele tastaturii. + Taste ascunse + Tastele pe care le folosiศ›i rar nu apar pe tastaturฤƒ. + Esc ศ™i rรขndul tastelor funcศ›ionale + Ins / Del / Home / End / PgUp / PgDn + Tastele cu sฤƒgeศ›i Lanseazฤƒ %1$s Alege un ecran. Secundar: %1$s. Ecranul secundar nu mai este disponibil. @@ -1794,7 +2032,24 @@ Terminal Mรขnere + trackpaduri Deck Tablou de bord + Desktop + Porneศ™te desktopul + Desktop ยท %1$s + Trackpad + Atingere directฤƒ + Trackpad. Atinge pentru atingere directฤƒ + Atingere directฤƒ. Atinge pentru trackpad + Se porneศ™te desktopul KDEโ€ฆ + Desktopul s-a รฎnchis. + Desktopul nu a putut porni. Jurnalele se aflฤƒ รฎn dosarul bottom-desktop al acestei sesiuni. + Desktopul este รฎnchis. Nimic de afiศ™at aici รฎncฤƒ. + Inverseazฤƒ ecranele + Ecranul de jos nu este liber momentan + Ecranul jocului + Afiศ™eazฤƒ jocul pe + Ecranul de sus + Ecranul de jos Descฤƒrcฤƒri Nicio descฤƒrcare รฎn curs. Steam @@ -1829,6 +2084,20 @@ Combustibil, t Principal %1$s t Rezervฤƒ %1$s t + Timp per cadru + ultimele %1$d s + medie per cadru + 1% minime + cadre peste 33 ms + %1$d / min + รŽn joc de %1$s + %1$d nuclee, pรขnฤƒ la %2$s GHz + %1$d nuclee + joc + FPS din %1$d Hz + Marcajul roศ™u indicฤƒ locul รฎn care HUD-ul afiศ™eazฤƒ temperatura รฎn roศ™u. + tot dispozitivul + baterie Trimite date pentru tabloul de bord Automat Activeazฤƒ trimiterea pentru fiecare joc din listฤƒ, inclusiv pentru jocurile gฤƒsite mai tรขrziu. Jocurile pe care le dezactivezi rฤƒmรขn dezactivate. @@ -1852,6 +2121,10 @@ Microfonul este oprit pentru acest joc. Pentru a vorbi, activeazฤƒ Microfon รฎn setฤƒrile Steam din DroidDeck (Sunet) ศ™i porneศ™te din nou jocul. Volum %1$d%% Statistici รฎn joc + HUD pe ecranul de jos + Bandฤƒ pe fiecare filฤƒ + Minimele de 1% ศ™i 0,1% + Temperatura CPU FPS CPU GPU @@ -2025,6 +2298,7 @@ Se porneศ™te sesiuneaโ€ฆ %1$d:%2$02d scurse ยท รฎncฤƒ se lucreazฤƒ Se descarcฤƒ actualizarea clientului Steam ยท %1$d%% + Se aplicฤƒ actualizarea clientului Steamโ€ฆ Se descarcฤƒ clientul Steam ยท %1$s O instalare a unui instrument de compatibilitate este deja รฎn curs @@ -2101,11 +2375,29 @@ Contururi toon plus claritate. Nu este un GPU Adreno + Driverul de sistem PowerVR: compatibilitatea variazฤƒ รฎn funcศ›ie de dispozitiv + Experimental: RADV sau driverul de sistem Xclipse + PowerVR de sistem + Foloseศ™te driverele integrate ale acestui GPU + Driverul PowerVR de sistem este selectat pentru runtime ศ™i afiศ™aj. + Niciun driver open-source nu suportฤƒ รฎncฤƒ acest Mali: puntea Mali este activatฤƒ. + Aceasta este versiunea de test non-Snapdragon: versiunile oficiale de aici ruleazฤƒ doar pe Adreno, aศ™a cฤƒ nu sunt instalate peste ea. Versiunile de test noi se aflฤƒ pe github.com/The412Banner/droiddeck-nonadreno-drivers. + Ultima sesiune s-a รฎncheiat deoarece Android a รฎnchis DroidDeck pentru a elibera memorie, nu din cauza unei opriri neaศ™teptate. รŽnchide alte aplicaศ›ii sau reduce setฤƒrile de texturฤƒ ale jocului, apoi รฎncearcฤƒ din nou. + Mali (Venus) + puntea Mali + Niciun driver open-source nu suportฤƒ รฎncฤƒ acest Mali: se foloseศ™te %1$s, pe driverul propriu al telefonului. + %1$s nu este รฎncฤƒ publicat: se foloseศ™te %2$s pรขnฤƒ atunci. + %1$s nu este disponibil, iar driverul acestui telefon raporteazฤƒ Vulkan %2$s (Venus necesitฤƒ 1.2): se foloseศ™te puntea Mali. + %1$s nu este รฎncฤƒ publicat: puntea Mali rฤƒmรขne activatฤƒ pรขnฤƒ atunci. + รŽn coadฤƒ: %1$s (se aศ™teaptฤƒ un alt driver de runtime) + DXVK este furnizat de runtime-ul PowerVR de sistem. Alte pachete DXVK pot fi stocate, dar nu sunt aplicate cu acest driver. Acceptat Experimental: driverele sale sunt versiuni de test Suport experimental pentru Adreno 850: necesitฤƒ drivere experimentale compatibile de afiศ™aj ศ™i de jocuri; neverificat pe acest dispozitiv Sub hardware-ul testat (Adreno 725 ศ™i mai nou): poate sฤƒ nu ruleze Neacceptat: nu este disponibil un backend grafic compatibil pentru acest GPU + Ruleazฤƒ prin puntea Mali, pe driverul Vulkan propriu al telefonului + Nu este suportat cu puntea Mali dezactivatฤƒ: Turnip necesitฤƒ un GPU Adreno (Snapdragon) S-a atins limita de solicitฤƒri a GitHub - รฎncearcฤƒ din nou mai tรขrziu GitHub a rฤƒspuns cu HTTP %1$d @@ -2214,7 +2506,6 @@ Magazine Steam Personalizat - Magazine Nivelul vitezei de descฤƒrcare Echilibrat Rapid @@ -2253,6 +2544,7 @@ Se aศ™teaptฤƒ cealaltฤƒ descฤƒrcare Battle.netโ€ฆ Deschide Battle.net ศ™i conecteazฤƒ-te o datฤƒ, apoi instaleazฤƒ jocurile de aici. Programul de descฤƒrcare Blizzard s-a oprit: %1$s + Programul de descฤƒrcare Blizzard nu mai avanseazฤƒ. Eroare Blizzard %1$s Actualizeazฤƒ Jocuri Blizzard @@ -2260,6 +2552,7 @@ รŽntreruptฤƒ Instalare ยท %1$s Obศ›ine gratuit + Se adaugฤƒ รฎn bibliotecฤƒโ€ฆ Vezi pe %1$s Cumpฤƒrฤƒ ยท %1$s Instalat @@ -2306,6 +2599,12 @@ Sorteazฤƒ Etichete รฎn bara lateralฤƒ Afiศ™eazฤƒ numele sub pictogramele din bara lateralฤƒ. Dezactiveazฤƒ pentru o barฤƒ lateralฤƒ mai รฎngustฤƒ. + Mascota agentului + DeeDee pluteศ™te peste aplicaศ›ia de pornire ศ™i peste jocuri, arฤƒtรขnd ce face agentul. + Peste alte aplicaศ›ii + Permite ca DeeDee sฤƒ pluteascฤƒ peste orice aplicaศ›ie ศ™i sฤƒ deschidฤƒ chatul acolo + Permite + Discutฤƒ cu DeeDee Afiศ™are Carduri mai mari Carduri mai mici @@ -2592,7 +2891,14 @@ %1$s ยท necesitฤƒ repornire Acest dispozitiv Elimini %1$s? - Diagnosticare + Dezvoltator + Filigranฤƒ cu eticheta versiunii + Afiศ™eazฤƒ pe ecran eticheta versiunii de testare sau Lab. Activatฤƒ implicit. + Partajeazฤƒ pachetele de diagnosticare + Sesiune ศ™i dispozitiv + Graficฤƒ + Jocuri ศ™i compatibilitate + Toate pachetele Pregฤƒtit de joc รŽncฤƒ nepregฤƒtit de joc mediu de execuศ›ie %1$s @@ -2631,6 +2937,9 @@ Activeazฤƒ realizฤƒrile GOG din setฤƒrile Stores Realizฤƒri indisponibile; verificฤƒ jurnalele sesiunii Realizare deblocatฤƒ + Mali (Venus): dezactivat + Mali (Venus): activat + Driverul de pe %1$s raporteazฤƒ Vulkan %2$s. Mali (Venus) necesitฤƒ Vulkan 1.2 sau mai nou (gamescope nu porneศ™te pe versiuni mai vechi), aศ™a cฤƒ sesiunile omit Venus ศ™i folosesc รฎn schimb perechea de drivere PanVK. Insereazฤƒ Stick stรขnga Stick dreapta @@ -2919,7 +3228,7 @@ Alege un folderโ€ฆ Foloseศ™te orice folder de pe un card SD sau o unitate USB Jocurile sunt puse รฎntr-un folder Games din locaศ›ia selectatฤƒ. Jocurile existente nu sunt mutate. - Unde ajunge + Ce ocupฤƒ spaศ›iu Jocuri Steam Datele jocurilor Prefixe %1$s ยท workshop %2$s ยท shadere %3$s @@ -2988,6 +3297,7 @@ Instalฤƒri VC++ ศ™i DirectX cerute de jocuri Ruleazฤƒ jocuri Linux x86 Unealtฤƒ Steam + Steam descarcฤƒ aceastฤƒ componentฤƒ pentru jocurile care includ anti-cheat, chiar ศ™i cรขnd este dezactivat. Eliminarea ei blocheazฤƒ instalarea acestora la 0% DroidDeck ruleazฤƒ jocuri fฤƒrฤƒ acest mediu de execuศ›ie Proton x86, pe care DroidDeck nu รฎl poate rula Implicit pentru toate jocurile @@ -3058,6 +3368,19 @@ Pฤƒstrate Jocuri non-Steam ศ™i prefixul Steam partajat Prefixele jocurilor din magazine sau adฤƒugate manual + Prefixul Steam partajat + Steam ruleazฤƒ aici propriile utilitare Windows + รŽl ศ™terge (%1$s). Steam creeazฤƒ unul nou data viitoare cรขnd are nevoie. + O aplicaศ›ie de magazin ศ™i jocurile care ruleazฤƒ cu ea + Folosit de %1$s + Joc non-Steam %1$s + Nu corespunde niciunui joc, deci este pฤƒstrat + Eliminฤƒ selecศ›ia ยท %1$s + Dezinstaleazฤƒ selecศ›ia ยท %1$s + Prefixuri Wine + Salvฤƒrile ศ™i setฤƒrile din ele se pierd; salvฤƒrile din Steam Cloud rฤƒmรขn รฎn contul tฤƒu. + Cache-uri de shadere + Prefixe %1$s ยท shadere %2$s Pachete descฤƒrcate Originale pฤƒstrate Niciun pachet de componente descฤƒrcat. @@ -3094,6 +3417,8 @@ DroidDeck ยท %1$d fps 60 fps aratฤƒ mai fluid, dar foloseศ™te mai mult procesorul cรขt porneศ™te Steam. Un videoclip ales รฎn setฤƒrile Steam apare ศ™i aici. Sunet + Omite filmul de pornire + Foloseศ™te un clip negru de 0,1 secunde ca film de pornire pentru Steam. Se aplicฤƒ la urmฤƒtoarea sesiune. Videoclipul tฤƒu MP4, MOV, MKV sau WebM. Alte formate ศ™i fiศ™ierele de peste %1$d MB sunt convertite pe dispozitiv รฎn WebM 720p, pรขnฤƒ la %2$d secunde. Importฤƒ @@ -3555,6 +3880,7 @@ Pฤƒstreazฤƒ Alt+Tab, tasta Win ศ™i butonul Acasฤƒ รฎntr-o sesiune DroidDeck activฤƒ รฎn loc de Android. Activeazฤƒ Luminozitate รฎn Configurare โ†’ Integrare Steam Punte Mali: opritฤƒ + %1$s nu poate folosi puntea Mali (are nevoie de un GPU Mali fฤƒrฤƒ o rutฤƒ prin driverul de sistem), deci acest comutator nu are niciun efect aici. Punte Mali: pornitฤƒ %1$s nu este Adreno. Puntea Vulkan experimentalฤƒ este pornitฤƒ: sesiunea deseneazฤƒ prin driverul propriu al telefonului. Aศ™teaptฤƒ-te la erori; trimite jurnalele sesiunii. Mod sigur @@ -3580,6 +3906,25 @@ Mutฤƒ mai tรขrziu Setฤƒri widget Eliminฤƒ widgetul + Aspect + Pachet de iconiศ›e + Implicit de sistem + Fundal รฎn culoarea aplicaศ›iei + Dimensiune iconiศ›e + Micฤƒ + Medie + Mare + Ascunde numele aplicaศ›iilor + Spaศ›iere + Strรขnsฤƒ + Normalฤƒ + Largฤƒ + Schimbฤƒ iconiศ›a + Reseteazฤƒ iconiศ›a + Cautฤƒ iconiศ›e + Se รฎncarcฤƒ iconiศ›eleโ€ฆ + Nu s-au gฤƒsit iconiศ›e. + Iconiศ›e personalizate Adaugฤƒ รฎn dosar Dosar nou Eliminฤƒ din dosar @@ -3696,5 +4041,81 @@ Acest aranjament nu a putut fi importat Zฤƒpadฤƒ stacojie + Suprafeศ›e albe cu accente roศ™ii. + Coloane sonore + Muzicฤƒ + Opศ›iuni de redare + Favorite + Colecศ›ii + Nicio colecศ›ie รฎncฤƒ. Atinge pictograma de marcaj pentru a crea una. + Salvate + Creeazฤƒ o colecศ›ie + Organizeazฤƒ-ศ›i piesele salvate + Nouฤƒ + Creeazฤƒ + Numele colecศ›iei + Introdu un nume pe care nu รฎl foloseศ™te nicio altฤƒ colecศ›ie + Gestioneazฤƒ + Redenumeศ™te + Adaugฤƒ piese + Adaugฤƒ (%1$d) + Eliminฤƒ piese + ศ˜terge colecศ›ia + ศ˜tergi %1$s? + Piesele rฤƒmรขn pe dispozitiv. Se eliminฤƒ doar colecศ›ia. + Selecteazฤƒ + Selecteazฤƒ tot + Deselecteazฤƒ tot + %1$d selectate + Adaugฤƒ รฎn colecศ›ie + Adaugฤƒ la favorite + Eliminฤƒ din colecศ›ie + Cautฤƒ piese + Ordinea albumului + Cele mai lungi primele + Cele mai scurte primele + Piese + รŽnฤƒlศ›ime + Reseteazฤƒ + Omite tฤƒcerea + Temporizator de somn + %1$d min + Sfรขrศ™itul piesei + Mai sunt %1$s + Egalizator + Amplificare bas + Egalizatorul nu este disponibil pe acest dispozitiv + Activeazฤƒ รฎn joc + Continuฤƒ redarea coloanei sonore cรขt timp ruleazฤƒ un joc + Nicio coloanฤƒ sonorฤƒ instalatฤƒ รฎncฤƒ. + Cautฤƒ coloane sonore + Adaugฤƒ un dosar de coloanฤƒ sonorฤƒ + Niciun fiศ™ier audio รฎn acel dosar + Duratฤƒ totalฤƒ + Piese: %1$d ยท %2$s + Discul %1$s + Amestecare + Anterior + Redare + Pauzฤƒ + Urmฤƒtor + Repetare dezactivatฤƒ + Repetฤƒ tot + Repetฤƒ una + Volum + Niciun fiศ™ier audio รฎn aceastฤƒ coloanฤƒ sonorฤƒ + Lansare indisponibilฤƒ + Nu este disponibil niciun browser web pentru a deschide acest link. + Prinde + Lasฤƒ + Salveazฤƒ + ศšine apฤƒsat pentru resetare + Magazine + Timp cadru + Rata medie de cadre + Server de afiศ™are + Stare HDR + Afiศ™ate + %1$d din %2$d diff --git a/app/src/main/res/values-ru/input_library.xml b/app/src/main/res/values-ru/input_library.xml new file mode 100644 index 0000000000..d02df2ffe6 --- /dev/null +++ b/app/src/main/res/values-ru/input_library.xml @@ -0,0 +1,132 @@ + + + ะ’ั‹ะฑั€ะฐะฝะฝั‹ะน ัะบั€ะฐะฝ ะฝะตะดะพัั‚ัƒะฟะตะฝ. ะŸะพะดะบะปัŽั‡ะธั‚ะต ะตะณะพ, ั‡ั‚ะพะฑั‹ ั€ะตะดะฐะบั‚ะธั€ะพะฒะฐั‚ัŒ ัั‚ัƒ ั€ะฐัะบะปะฐะดะบัƒ ะฒ ั€ะตะฐะปัŒะฝะพะผ ั€ะฐะทะผะตั€ะต. + ะžั‚ะผะตะฝะธั‚ัŒ ะฝะตัะพั…ั€ะฐะฝั‘ะฝะฝั‹ะต ะธะทะผะตะฝะตะฝะธั ั€ะฐัะบะปะฐะดะบะธ? + ะญั‚ะฐ ั€ะฐัะบะปะฐะดะบะฐ ะธัะฟะพะปัŒะทัƒะตั‚ัั ะฟั€ะพั„ะธะปัะผะธ: %1$d. ะกะพั…ั€ะฐะฝั‘ะฝะฝั‹ะต ะธะทะผะตะฝะตะฝะธั ะฟั€ะธะผะตะฝัั‚ัั ะบะพ ะฒัะตะผ. + ะŸั€ะพั„ะธะปะธ ะฟะพ ัƒะผะพะปั‡ะฐะฝะธัŽ + ะ ะตะถะธะผ ั€ะฐะฑะพั‡ะตะณะพ ัั‚ะพะปะฐ + ะ˜ะณั€ะพะฒะพะน ั€ะตะถะธะผ + ะŸะพ ัƒะผะพะปั‡ะฐะฝะธัŽ ะดะปั ั€ะฐะฑะพั‡ะตะณะพ ัั‚ะพะปะฐ ะธ ะธะณั€ั‹ + ะŸะพ ัƒะผะพะปั‡ะฐะฝะธัŽ ะดะปั ะธะณั€ะพะฒะพะณะพ ั€ะตะถะธะผะฐ + ะŸะพ ัƒะผะพะปั‡ะฐะฝะธัŽ ะดะปั ั€ะตะถะธะผะฐ ั€ะฐะฑะพั‡ะตะณะพ ัั‚ะพะปะฐ + ะะฐัั‚ั€ะพะนะบะธ ัƒัั‚ั€ะพะนัั‚ะฒะฐ + ะฃะฟั€ะฐะฒะปะตะฝะธะต + ะšะฝะพะฟะบะธ, ัั‚ะธะบะธ, ั‚ั€ะธะณะณะตั€ั‹ ะธ ะดะพะฟ. ะบะปะฐะฒะธัˆะธ + ะšะพะฟะธั€ะพะฒะฐั‚ัŒ ะฟั€ะพั„ะธะปัŒ + ะกะฑั€ะพัะธั‚ัŒ ะดะตะนัั‚ะฒะธั + ะกะฑั€ะพัะธั‚ัŒ ะดะตะนัั‚ะฒะธั ะฒ %1$s ะดะพ ะทะฝะฐั‡ะตะฝะธะน ะฑะฐะทะพะฒะพะณะพ ะฟั€ะพั„ะธะปั? ะ ะฐัะบะปะฐะดะบะธ ะธ ะดั€ัƒะณะธะต ะฟั€ะพั„ะธะปะธ ะพัั‚ะฐะฝัƒั‚ัั ะฑะตะท ะธะทะผะตะฝะตะฝะธะน. + ะฃะดะฐะปะธั‚ัŒ %1$s? ะ ะตะถะธะผั‹, ะธัะฟะพะปัŒะทัƒัŽั‰ะธะต ะตะณะพ, ะฒะตั€ะฝัƒั‚ัั ะบ ะฒัั‚ั€ะพะตะฝะฝะพะผัƒ ะฟั€ะพั„ะธะปัŽ ะฟะพ ัƒะผะพะปั‡ะฐะฝะธัŽ. ะกะพั…ั€ะฐะฝั‘ะฝะฝั‹ะต ั€ะฐัะบะปะฐะดะบะธ ะธ ะพะฑั‰ะธะต ะฝะฐัั‚ั€ะพะนะบะธ ะพัั‚ะฐะฝัƒั‚ัั ะดะพัั‚ัƒะฟะฝั‹. + ะ’ะธะดะธะผะพัั‚ัŒ + ะŸั€ะธะผะตะฝัะตั‚ัั ะบะพ ะฒัะตะผ ะฟั€ะพั„ะธะปัะผ. Auto ะฟะพะบะฐะทั‹ะฒะฐะตั‚ ัƒะฟั€ะฐะฒะปะตะฝะธะต ะพัะฝะพะฒะฝะพะณะพ ัะบั€ะฐะฝะฐ, ะตัะปะธ ะฒ ะธะณั€ะพะฒะพะผ ั€ะตะถะธะผะต ะฝะต ะฟะพะดะบะปัŽั‡ั‘ะฝ ะบะพะฝั‚ั€ะพะปะปะตั€. + ะ ะตะดะฐะบั‚ะธั€ะพะฒะฐั‚ัŒ ะฝะฐ ัะบั€ะฐะฝะต + ะกะพั…ั€ะฐะฝั‘ะฝะฝั‹ะต ั€ะฐัะบะปะฐะดะบะธโ€ฆ + ะ’ั‹ะฑะตั€ะธั‚ะต ั€ะฐัะบะปะฐะดะบัƒ ะธะปะธ ัะพะทะดะฐะนั‚ะต ัะฒะพัŽ + ะ’ั‹ะฑะตั€ะธั‚ะต ยซะฃะฟั€ะฐะฒะปะตะฝะธะต ะฟั€ะพั„ะธะปัยป ะฒ ะผะตะฝัŽ ัะตะฐะฝัะฐ ะฒั‚ะพั€ะพะณะพ ัะบั€ะฐะฝะฐ. ะกะตะปะตะบั‚ะพั€ั‹ ยซะŸั€ะพั„ะธะปัŒยป ะธ ยซะ’ั‚ะพั€ะพะน ัะบั€ะฐะฝยป ะฒ ะผะตะฝัŽ ะบะพะฝั‚ั€ะพะปะปะตั€ะฐ ะพะฟั€ะตะดะตะปััŽั‚, ะบะฐะบะพะต ัƒะฟั€ะฐะฒะปะตะฝะธะต ะฟะพะบะฐะทั‹ะฒะฐั‚ัŒ. + ะ”ะตะนัั‚ะฒะธั ะบะฝะพะฟะพะบ + ะžะฑั‰ะธะน ะดะพัั‚ัƒะฟ ั %1$s. ะ˜ะทะผะตะฝะตะฝะธั ั‚ะฐะบะถะต ะฟั€ะธะผะตะฝัั‚ัั ะบ ัั‚ะธะผ ะฟั€ะพั„ะธะปัะผ. + ะŸะพะฒั‚ะพั€ะฝะพ ะธัะฟะพะปัŒะทะพะฒะฐั‚ัŒ ะฝะฐัั‚ั€ะพะนะบะธ + ะ˜ัะฟะพะปัŒะทะพะฒะฐั‚ัŒ ะฝะฐัั‚ั€ะพะนะบะธ ะธะทโ€ฆ + ะกะบะพะฟะธั€ะพะฒะฐั‚ัŒ ะธะท ะดั€ัƒะณะพะณะพ ะฟั€ะพั„ะธะปั ะธะปะธ ะพัั‚ะฐะฒะธั‚ัŒ ะฝะฐัั‚ั€ะพะนะบะธ ะพะฑั‰ะธะผะธ + ะกะดะตะปะฐั‚ัŒ ะฝะตะทะฐะฒะธัะธะผั‹ะผ + ะžัั‚ะฐะฒะธั‚ัŒ ั‚ะตะบัƒั‰ัƒัŽ ะฝะฐัั‚ั€ะพะนะบัƒ ะธ ะฟะตั€ะตัั‚ะฐั‚ัŒ ะดะตะปะธั‚ัŒัั ะธะทะผะตะฝะตะฝะธัะผะธ + ะ ะฐัะบะปะฐะดะบะธ ั…ั€ะฐะฝัั‚ ัะปะตะผะตะฝั‚ั‹ ะธ ะธั… ะฟะพะทะธั†ะธะธ. ะšะฐะถะดั‹ะน ะฟั€ะพั„ะธะปัŒ ะผะพะถะตั‚ ะฝะฐะทะฝะฐั‡ะฐั‚ัŒ ัะฒะพะธ ะดะตะนัั‚ะฒะธั. ะ ะตะดะฐะบั‚ะธั€ัƒะนั‚ะต ะฒ ะฟะพะปะฝะพะผ ั€ะฐะทะผะตั€ะต ะฝะฐ ั†ะตะปะตะฒะพะผ ัะบั€ะฐะฝะต. + ะขะตะบัƒั‰ะฐั ั€ะฐัะบะปะฐะดะบะฐ + ะฃะดะฐะปะธั‚ัŒ ะฝะตะธัะฟะพะปัŒะทัƒะตะผัƒัŽ ั€ะฐัะบะปะฐะดะบัƒ %1$s ะธ ะตั‘ ัะพั…ั€ะฐะฝั‘ะฝะฝั‹ะต ะดะตะนัั‚ะฒะธั? + ะŸะตั€ะตะธะผะตะฝะพะฒะฐั‚ัŒ ั‚ะตะบัƒั‰ัƒัŽ ั€ะฐัะบะปะฐะดะบัƒ + ะะตั‡ะธั‚ะฐะตะผั‹ะต ะฝะฐัั‚ั€ะพะนะบะธ ะฒะฒะพะดะฐ ัะพั…ั€ะฐะฝะตะฝั‹ ะฒ ั€ะตะทะตั€ะฒะฝะพะน ะบะพะฟะธะธ. ะ’ั‹ ะผะพะถะตั‚ะต ะฟั€ะพะดะพะปะถะธั‚ัŒ ั€ะตะดะฐะบั‚ะธั€ะพะฒะฐั‚ัŒ ะฒะพััั‚ะฐะฝะพะฒะปะตะฝะฝั‹ะต ะฟั€ะพั„ะธะปะธ. + ะกะฒะพะนัั‚ะฒะฐ + ะกะฒะพะนัั‚ะฒะฐ ะฝะฐะถะฐั‚ะธั + %1$s ยท ะะฐะถะฐั‚ะธะต + ะšะฝะพะฟะบะธ + ะกั‚ะธะบะธ, ั‚ะฐั‡ะฟะฐะดั‹ ะธ ั‚ั€ะธะณะณะตั€ั‹ + ะกะบั€ั‹ั‚ัŒ ะธะฝัั‚ั€ัƒะผะตะฝั‚ั‹ + ะšะพะฝั‚ั€ะพะปะปะตั€ + ะžั‚ะฟั€ะฐะฒะปัั‚ัŒ ะฒะฒะพะด ะบะพะฝั‚ั€ะพะปะปะตั€ะฐ ะฒ Steam Input ะธะปะธ ะธะณั€ัƒ. + ะญั‚ะพั‚ ัะปะตะผะตะฝั‚ ะฝะต ะพั‚ะฟั€ะฐะฒะปัะตั‚ ะฒะฒะพะด ะบะพะฝั‚ั€ะพะปะปะตั€ะฐ, ะผั‹ัˆะธ ะธะปะธ ะบะปะฐะฒะธะฐั‚ัƒั€ั‹. + ะะฐะถะฐั‚ะธะต ะผั‹ัˆะธ + ะ”ะตะนัั‚ะฒะธะต DroidDeck + ะ”ะตะนัั‚ะฒะธะต + ะกะบะพั€ะพัั‚ัŒ ะฟั€ะพะบั€ัƒั‚ะบะธ: %1$d ัˆะฐะณะพะฒ/ั + + ะะพะฒั‹ะน ะฟั€ะพั„ะธะปัŒ + + ะะพะฒะฐั ั€ะฐัะบะปะฐะดะบะฐ + %1$s ยท ะ˜ัะฟะพะปัŒะทัƒะตั‚ัั ะฟั€ะพั„ะธะปัะผะธ: %2$d. ะ˜ะทะผะตะฝะตะฝะธั ะฟั€ะธะผะตะฝััŽั‚ัั ะบะพ ะฒัะตะผ ะฟั€ะพั„ะธะปัะผ ั ัั‚ะธะผะธ ะฟั€ะธะฒัะทะบะฐะผะธ. + ะŸะตั€ะตะธะผะตะฝะพะฒะฐั‚ัŒ + ะฃะดะฐะปะธั‚ัŒ + ะ”ะพะฑะฐะฒัŒั‚ะต ัะปะตะผะตะฝั‚ั‹ ะฒ ั€ะฐัะบะปะฐะดะบัƒ, ะฟั€ะตะถะดะต ั‡ะตะผ ะฝะฐะทะฝะฐั‡ะฐั‚ัŒ ะธะผ ะดะตะนัั‚ะฒะธั. + ะะต ัƒะดะฐะปะพััŒ ัะพั…ั€ะฐะฝะธั‚ัŒ ะฝะฐัั‚ั€ะพะนะบะธ ะฒะฒะพะดะฐ + ะะฐะทะฒะฐะฝะธะต + ะะฐั‡ะฐั‚ัŒ ั + ะšะฝะพะฟะบะฐ + ะกั‚ะธะบ + ะขะฐั‡ะฟะฐะด + ะšั€ะตัั‚ะพะฒะธะฝะฐ + ะขั€ะธะณะณะตั€ + ะ“ะพั‚ะพะฒะพ + ะžั‚ะผะตะฝะธั‚ัŒ + + ะ”ะพะฑะฐะฒะธั‚ัŒ + ะŸะตั€ะตั‚ะฐั‰ะธั‚ะต, ั‡ั‚ะพะฑั‹ ะฟะตั€ะตะผะตัั‚ะธั‚ัŒ. ะŸะพั‚ัะฝะธั‚ะต ะทะฐ ัƒะณะพะป, ั‡ั‚ะพะฑั‹ ะธะทะผะตะฝะธั‚ัŒ ั€ะฐะทะผะตั€. ะะฐะถะผะธั‚ะต ยซะกะฒะพะนัั‚ะฒะฐยป, ั‡ั‚ะพะฑั‹ ะฝะฐะทะฝะฐั‡ะธั‚ัŒ ะดะตะนัั‚ะฒะธะต. + ะ ะตะดะฐะบั‚ะธั€ะพะฒะฐะฝะธะต ะฝะฐ ะฒั‚ะพั€ะพะผ ัะบั€ะฐะฝะต + ะ˜ัะฟะพะปัŒะทะพะฒะฐั‚ัŒ %1$s ะธะท ะดั€ัƒะณะพะณะพ ะฟั€ะพั„ะธะปั. ะžัั‚ะฐะปัŒะฝั‹ะต ะธัั‚ะพั‡ะฝะธะบะธ ัƒะฟั€ะฐะฒะปะตะฝะธั ะพัั‚ะฐะฝัƒั‚ัั ะฑะตะท ะธะทะผะตะฝะตะฝะธะน. + ะžัั‚ะฐะฒะธั‚ัŒ ั„ะธะทะธั‡ะตัะบะพะต ัƒะฟั€ะฐะฒะปะตะฝะธะต ะพะฑั‰ะธะผ + ะŸะพ ัƒะผะพะปั‡ะฐะฝะธัŽ ะฒัะต ัะปะตะผะตะฝั‚ั‹ ัƒะฟั€ะฐะฒะปะตะฝะธั ะธ ะฟะพะปัŒะทะพะฒะฐั‚ะตะปัŒัะบะธะต ั€ะฐัะบะปะฐะดะบะธ โ€” ะฝะตะทะฐะฒะธัะธะผั‹ะต ะบะพะฟะธะธ. ะžะฑั‰ะธะน ะดะพัั‚ัƒะฟ ัะฒัะทั‹ะฒะฐะตั‚ ั‚ะพะปัŒะบะพ ั„ะธะทะธั‡ะตัะบะพะต ัƒะฟั€ะฐะฒะปะตะฝะธะต. + ะ˜ัะฟะพะปัŒะทะพะฒะฐั‚ัŒ ัั‚ะธ ัะปะตะผะตะฝั‚ั‹ ะธ ะฟะพะทะธั†ะธะธ. ะžะฑั‰ะธะน ะดะพัั‚ัƒะฟ ัะธะฝั…ั€ะพะฝะธะทะธั€ัƒะตั‚ ะฑัƒะดัƒั‰ะธะต ะธะทะผะตะฝะตะฝะธั ะณะตะพะผะตั‚ั€ะธะธ; ะดะตะนัั‚ะฒะธั ะบะฝะพะฟะพะบ ะพัั‚ะฐะฝัƒั‚ัั ะฝะตะทะฐะฒะธัะธะผั‹ะผะธ. ะ”ั€ัƒะณะฐั ั€ะฐัะบะปะฐะดะบะฐ ะฝะฐั‡ะธะฝะฐะตั‚ัั ั ะฝะตะฝะฐะทะฝะฐั‡ะตะฝะฝั‹ะผะธ ะดะตะนัั‚ะฒะธัะผะธ. + ะกะบะพะฟะธั€ะพะฒะฐั‚ัŒ ัั‚ะธ ัะปะตะผะตะฝั‚ั‹ ัƒะฟั€ะฐะฒะปะตะฝะธั ะธ ะดะตะนัั‚ะฒะธั ะธะปะธ ัะฒัะทะฐั‚ัŒ ะธั…, ั‡ั‚ะพะฑั‹ ะฑัƒะดัƒั‰ะธะต ะธะทะผะตะฝะตะฝะธั ะฟั€ะธะผะตะฝัะปะธััŒ ะบ ะพะฑะพะธะผ ะฟั€ะพั„ะธะปัะผ. + ะžัั‚ะฐะฒะธั‚ัŒ ะพะฑั‰ะธะผ + ะะตะทะฐะฒะธัะธะผะฐั ะบะพะฟะธั + ะ—ะฐะฟัƒัะบะฐั‚ัŒ ัั‚ะธะบ ะพั‚ ั‚ะพั‡ะบะธ ะบะฐัะฐะฝะธั + ะกะบั€ั‹ะฒะฐั‚ัŒ ัั‚ะธะบ, ะบะพะณะดะฐ ะพะฝ ะฝะต ะธัะฟะพะปัŒะทัƒะตั‚ัั + ะ˜ะฝัั‚ั€ัƒะผะตะฝั‚ั‹ + ะะฒั‚ะพ (%1$s) + ะŸะพะปัŒะทะพะฒะฐั‚ะตะปัŒัะบะธะน (%1$s) + ะกะพั…ั€ะฐะฝะธั‚ัŒ ะบะฐะบ ะฝะพะฒั‹ะน ะฟั€ะพั„ะธะปัŒ + ะฃะฟั€ะฐะฒะปะตะฝะธะต ะฟั€ะพั„ะธะปั + ะŸั€ะพั„ะธะปัŒ + ะ–ะตัั‚ั‹ ั‚ะฐั‡ะฟะฐะดะฐ ะผั‹ัˆะธ + ะ•ัะปะธ ะฝะฐะทะฝะฐั‡ะตะฝะพ ัƒะบะฐะทะฐั‚ะตะปัŽ ะผั‹ัˆะธ: ะบะฐัะฐะฝะธะต โ€” ะบะปะธะบ, ัƒะดะตั€ะถะฐะฝะธะต โ€” ะฟะตั€ะตั‚ะฐัะบะธะฒะฐะฝะธะต, ะฟั€ะพะบั€ัƒั‚ะบะฐ ะดะฒัƒะผั ะฟะฐะปัŒั†ะฐะผะธ. + ะ”ะปั %1$s ะทะฐะดะฐะฝะพ ะฟะตั€ะตะพะฟั€ะตะดะตะปะตะฝะธะต ะฑั‹ัั‚ั€ะพะณะพ ะผะตะฝัŽ. ะ’ั‹ะฑะตั€ะธั‚ะต ยซะะฒั‚ะพยป, ั‡ั‚ะพะฑั‹ ะธัะฟะพะปัŒะทะพะฒะฐั‚ัŒ ะฟั€ะพั„ะธะปัŒ ะฟะพ ัƒะผะพะปั‡ะฐะฝะธัŽ ะธ ะฒัะต ั‚ั€ะธ ัะพั…ั€ะฐะฝั‘ะฝะฝั‹ะต ั‡ะฐัั‚ะธ. + ะ’ะฒะพะด DroidDeck + ะฃะดะตั€ะถะธะฒะฐะตั‚ัั, ะฟะพะบะฐ ัั‚ะธะบ ะพั‚ะบะปะพะฝั‘ะฝ ะฒ ะปัŽะฑะพะผ ะฝะฐะฟั€ะฐะฒะปะตะฝะธะธ: ะฝะฐะถะฐั‚ะธะต ะฒั‹ัˆะต 55%, ะพั‚ะฟัƒัะบะฐะฝะธะต ะฝะธะถะต 35%. ะ˜ัะฟะพะปัŒะทัƒะนั‚ะต ยซะšะปะฐะฒะธัˆะธ ะฝะฐะฟั€ะฐะฒะปะตะฝะธะนยป, ั‡ั‚ะพะฑั‹ ะฝะฐะทะฝะฐั‡ะธั‚ัŒ ะบะฐะถะดะพะต ะฝะฐะฟั€ะฐะฒะปะตะฝะธะต ะพั‚ะดะตะปัŒะฝะพ. ะšะพะผะฐะฝะดั‹ DroidDeck ัั€ะฐะฑะฐั‚ั‹ะฒะฐัŽั‚ ะพะดะธะฝ ั€ะฐะท ะทะฐ ะพั‚ะบะปะพะฝะตะฝะธะต. ะะฐะถะฐั‚ะธะต ัั‚ะธะบะฐ ะฝะฐัั‚ั€ะฐะธะฒะฐะตั‚ัั ะพั‚ะดะตะปัŒะฝะพ. + ะฃะดะตั€ะถะธะฒะฐะตั‚ัั, ะฟะพะบะฐ ะฒั‹ ะบะฐัะฐะตั‚ะตััŒ ั‚ะฐั‡ะฟะฐะดะฐ; ะพั‚ะฟัƒัะบะฐะตั‚ัั ะฟั€ะธ ะฟะพะดะฝัั‚ะธะธ ะฟะฐะปัŒั†ะฐ. ะšะพะผะฐะฝะดั‹ DroidDeck ัั€ะฐะฑะฐั‚ั‹ะฒะฐัŽั‚ ะพะดะธะฝ ั€ะฐะท ะทะฐ ะบะฐัะฐะฝะธะต. ะะฐะถะฐั‚ะธะต ั‚ะฐั‡ะฟะฐะดะฐ ะฝะฐัั‚ั€ะฐะธะฒะฐะตั‚ัั ะพั‚ะดะตะปัŒะฝะพ. + ะฃะดะตั€ะถะธะฒะฐะตั‚ัั, ะบะพะณะดะฐ ั‚ั€ะธะณะณะตั€ ะฟั€ะพั…ะพะดะธั‚ 55%; ะพั‚ะฟัƒัะบะฐะตั‚ัั ะฝะธะถะต 35%. ะšะพะผะฐะฝะดั‹ DroidDeck ัั€ะฐะฑะฐั‚ั‹ะฒะฐัŽั‚ ะพะดะธะฝ ั€ะฐะท ะทะฐ ะฝะฐะถะฐั‚ะธะต. + ะะฐะฟั€ะฐะฒะปะตะฝะธะต ะฟั€ะพะบั€ัƒั‚ะบะธ + ะ’ะตั€ั‚ะธะบะฐะปัŒะฝะพ + ะ“ะพั€ะธะทะพะฝั‚ะฐะปัŒะฝะพ + ะŸั€ะพะบั€ัƒั‡ะธะฒะฐั‚ัŒ ะฟะพ ะณะพั€ะธะทะพะฝั‚ะฐะปะธ + ะ˜ะทะผะตั€ะตะฝะธั + ะ’ะบะปัŽั‡ะธั‚ะต ะทะฐะฟะธััŒ, ะธัะฟะพะปัŒะทัƒะนั‚ะต ัƒะฟั€ะฐะฒะปะตะฝะธะต ะฒ ะทะฐะฟัƒั‰ะตะฝะฝะพะผ ัะตะฐะฝัะต, ะทะฐั‚ะตะผ ะฒะตั€ะฝะธั‚ะตััŒ ะธ ะฟั€ะพั‡ะธั‚ะฐะนั‚ะต ั€ะตะทัƒะปัŒั‚ะฐั‚ั‹. ะ˜ะทะผะตั€ัะตั‚ัั ั‚ะพะปัŒะบะพ ะฒั€ะตะผั ะพั‚ะฟั€ะฐะฒะบะธ DroidDeck, ะฑะตะท ะทะฐะดะตั€ะถะบะธ ัะบั€ะฐะฝะฐ. ะ—ะฐะฟะธััŒ ะทะฐะฒะตั€ัˆะฐะตั‚ัั ะฟั€ะธ ะทะฐะบั€ั‹ั‚ะธะธ ะฟั€ะพั†ะตััะฐ ะฟั€ะธะปะพะถะตะฝะธั. + ะญะปะตะผะตะฝั‚ะพะฒ ัƒะฟั€ะฐะฒะปะตะฝะธั: %1$d + ะ”ั€ัƒะณะธะต ัะพั…ั€ะฐะฝั‘ะฝะฝั‹ะต ั€ะฐัะบะปะฐะดะบะธ (%1$d) โ–พ + ะกะบั€ั‹ั‚ัŒ ะดั€ัƒะณะธะต ัะพั…ั€ะฐะฝั‘ะฝะฝั‹ะต ั€ะฐัะบะปะฐะดะบะธ (%1$d) โ–ด + ะ”ะพะผะพะน / Guide + ะะฐะทะฐะด ยท ะพะดะฝะพ ะฝะฐะถะฐั‚ะธะต + ะะฐะทะฐะด ยท ะดะฒะพะนะฝะพะต ะฝะฐะถะฐั‚ะธะต + ะะฐะทะฐะด ยท ะดะฒะฐะถะดั‹ ะฒ Steam, ะพะดะธะฝ ั€ะฐะท ะฒ ั€ะฐะฑะพั‡ะตะผ ัั‚ะพะปะต + ะ’ ั€ะตะถะธะผะต Steam. ะฃะดะตั€ะถะฐะฝะธะต ยซะะฐะทะฐะดยป ั‚ะฐะบะถะต ะพั‚ะบั€ั‹ะฒะฐะตั‚ ะฑั‹ัั‚ั€ั‹ะน ะดะพัั‚ัƒะฟ. + ะ’ะตั€ะฝัƒั‚ัŒ ะฟะพ ัƒะผะพะปั‡ะฐะฝะธัŽ + ะ’ั‹ะฑะพั€ ะฟะฐะฝะตะปะธ ะทะฐะฟะพะผะธะฝะฐะตั‚ัั. ะ ะฐะฑะพั‡ะธะน ัั‚ะพะป ะพั‚ะบั€ั‹ะฒะฐะตั‚ ะฒั‚ะพั€ะพะต ั€ะฐะฑะพั‡ะตะต ะฟั€ะพัั‚ั€ะฐะฝัั‚ะฒะพ; ะพะฝ ะฝะต ะฟะตั€ะตะบะปัŽั‡ะฐะตั‚ ัะตะฐะฝั ะธะปะธ ะตะณะพ ะฟั€ะพั„ะธะปัŒ ะฒะฒะพะดะฐ. + ะ’ะธั€ั‚ัƒะฐะปัŒะฝั‹ะน ะบะพะฝั‚ั€ะพะปะปะตั€ + ะขะธะฟ ะบะพะฝั‚ั€ะพะปะปะตั€ะฐ, ะบะพั‚ะพั€ั‹ะน ะฒะธะดัั‚ Steam ะธะปะธ ะธะณั€ะฐ. + ะกะตะฝัะพั€ะฝั‹ะน ัะบั€ะฐะฝ + ะšะฐะบ ะพะฑั€ะฐะฑะฐั‚ั‹ะฒะฐัŽั‚ัั ะบะฐัะฐะฝะธั ะฝะฐ ัะบั€ะฐะฝะต ะธะณั€ั‹. ะšะฝะพะฟะบะธ ะฟั€ะพั„ะธะปั ัะพั…ั€ะฐะฝััŽั‚ ะฝะฐะทะฝะฐั‡ะตะฝะฝั‹ะต ะดะตะนัั‚ะฒะธั. + ะšะฐัะฐะฝะธะต-ะบัƒั€ัะพั€ + ะŸะพะบะฐะทั‹ะฒะฐั‚ัŒ ัƒะบะฐะทะฐั‚ะตะปัŒ ะดะปั ะฟั€ัะผั‹ั… ะบะฐัะฐะฝะธะน ะฝะฐ ัะบั€ะฐะฝะต ะธะณั€ั‹. + ะšะพัะฝัƒั‚ัŒัั ะธ ัƒะดะตั€ะถะธะฒะฐั‚ัŒ + ะ”ะตะนัั‚ะฒะธะต ะผั‹ัˆะธ ะฟั€ะธ ัƒะดะตั€ะถะฐะฝะธะธ ะฟะฐะปัŒั†ะฐ ะฝะฐ ัะบั€ะฐะฝะต ะธะณั€ั‹. + ะะฐะถะฐั‚ะธั ะบะฝะพะฟะบะธ ยซะะฐะทะฐะดยป + ะŸะตั€ะฒะพะต ะดะตะนัั‚ะฒะธะต: ะพะดะฝะพ ะฝะฐะถะฐั‚ะธะต. ะ’ั‚ะพั€ะพะต ะดะตะนัั‚ะฒะธะต: ะดะฒะพะนะฝะพะต ะฝะฐะถะฐั‚ะธะต. + ะšะฝะพะฟะบะฐ-ะฟะตั€ะตะบะปัŽั‡ะฐั‚ะตะปัŒ + ะšะพัะฝะธั‚ะตััŒ, ั‡ั‚ะพะฑั‹ ัƒะดะตั€ะถะธะฒะฐั‚ัŒ, ะบะพัะฝะธั‚ะตััŒ ัะฝะพะฒะฐ, ั‡ั‚ะพะฑั‹ ะพั‚ะฟัƒัั‚ะธั‚ัŒ. ะžั‚ะบั€ั‹ั‚ะธะต ะผะตะฝัŽ ะธะปะธ ัะผะตะฝะฐ ะฟั€ะพั„ะธะปั ะพั‚ะฟัƒัะบะฐะตั‚ ะบะฝะพะฟะบัƒ. + ะคะพั€ะผะฐ + ะกะบั€ัƒะณะปั‘ะฝะฝะฐั + ะšะฐะฟััƒะปะฐ + ะšั€ัƒะณ + ะŸั€ัะผะพัƒะณะพะปัŒะฝะธะบ + ะŸะพะดะฟะธััŒ ะบะฝะพะฟะบะธ + ะขะตะบัั‚ + ะ˜ะผะฟะพั€ั‚ะธั€ะพะฒะฐะฝะฝะพะต ะธะทะพะฑั€ะฐะถะตะฝะธะต + ะžั‚ะดะตะปัŒะฝั‹ะต ะบะปะฐะฒะธัˆะธ ะดะธะฐะณะพะฝะฐะปะตะน + ะะฐะทะฝะฐั‡ัŒั‚ะต ะบะปะฐะฒะธัˆัƒ ะบะฐะถะดะพะน ะดะธะฐะณะพะฝะฐะปะธ. ะŸัƒัั‚ะฐั ะดะธะฐะณะพะฝะฐะปัŒ ะฝะฐะถะธะผะฐะตั‚ ะดะฒะฐ ัะพัะตะดะฝะธั… ะฝะฐะฟั€ะฐะฒะปะตะฝะธั. + ะกะพัะตะดะฝะธะต ะฝะฐะฟั€ะฐะฒะปะตะฝะธั + ะ’ะฐัˆะธ ัั‚ะฐั€ั‹ะต ัะบั€ะฐะฝะฝั‹ะต ะบะปะฐะฒะธัˆะธ ัะพั…ั€ะฐะฝะตะฝั‹ ะฝะธะถะต ะบะฐะบ ะธะผะฟะพั€ั‚ะธั€ะพะฒะฐะฝะฝั‹ะต ะฟั€ะพั„ะธะปะธ. ะ’ั‹ะฑะตั€ะธั‚ะต ะพะดะธะฝ, ั‡ั‚ะพะฑั‹ ะธัะฟะพะปัŒะทะพะฒะฐั‚ัŒ ะธะปะธ ะธะทะผะตะฝะธั‚ัŒ. ะขะตะบัƒั‰ะธะต ะฒั‹ะฑั€ะฐะฝะฝั‹ะต ะฟั€ะพั„ะธะปะธ ัะพั…ั€ะฐะฝะตะฝั‹. + ะกั‚ะฐั€ั‹ะต ัะบั€ะฐะฝะฝั‹ะต ะบะปะฐะฒะธัˆะธ ะฝะต ัƒะดะฐะปะพััŒ ะธะผะฟะพั€ั‚ะธั€ะพะฒะฐั‚ัŒ ะฐะฒั‚ะพะผะฐั‚ะธั‡ะตัะบะธ. ะ˜ัั…ะพะดะฝั‹ะต ะฝะฐัั‚ั€ะพะนะบะธ ัะพั…ั€ะฐะฝะตะฝั‹. + diff --git a/app/src/main/res/values-ru/input_strings.xml b/app/src/main/res/values-ru/input_strings.xml new file mode 100644 index 0000000000..9f041bfb21 --- /dev/null +++ b/app/src/main/res/values-ru/input_strings.xml @@ -0,0 +1,38 @@ + + + ะŸั€ะพั„ะธะปะธ ะฒะฒะพะดะฐ + ะŸั€ะพั„ะธะปะธ + ะคะธะทะธั‡ะตัะบะธะน ะบะพะฝั‚ั€ะพะปะปะตั€ + ะžัะฝะพะฒะฝะพะน ัะบั€ะฐะฝ + ะ’ั‚ะพั€ะพะน ัะบั€ะฐะฝ + ะกะพะฑัั‚ะฒะตะฝะฝั‹ะน / Steam Input + ะกะพะฑัั‚ะฒะตะฝะฝั‹ะน: %1$s + ะžั‚ะฟั€ะฐะฒะธั‚ัŒ ะดั€ัƒะณัƒัŽ ะบะพะผะฐะฝะดัƒ ะบะพะฝั‚ั€ะพะปะปะตั€ะฐ + ะžั‚ะบะปัŽั‡ะตะฝะพ + ะšะปะฐะฒะธัˆะฐ ะธะปะธ ัะพั‡ะตั‚ะฐะฝะธะต ะบะปะฐะฒะธัˆ + ะšะปะฐะฒะธัˆะธ ะฝะฐะฟั€ะฐะฒะปะตะฝะธะน + ะ”ะฒะธะณะฐั‚ัŒ ัƒะบะฐะทะฐั‚ะตะปัŒ + ะกะบะพั€ะพัั‚ัŒ ัƒะบะฐะทะฐั‚ะตะปั: %1$d + ะŸั€ะพะบั€ัƒั‚ะบะฐ + ะŸั€ะพะบั€ัƒั‚ะบะฐ ะฟะพ ะฒะตั€ั‚ะธะบะฐะปะธ + ะ›ะตะฒะฐั ะบะฝะพะฟะบะฐ ะผั‹ัˆะธ + ะŸั€ะฐะฒะฐั ะบะฝะพะฟะบะฐ ะผั‹ัˆะธ + ะกั€ะตะดะฝัั ะบะฝะพะฟะบะฐ ะผั‹ัˆะธ + ะžั‚ะบั€ั‹ั‚ัŒ ะผะตะฝัŽ DroidDeck + ะŸะพะบะฐะทะฐั‚ัŒ ะบะปะฐะฒะธะฐั‚ัƒั€ัƒ + ะžั‚ะบั€ั‹ั‚ัŒ ะผะตะฝัŽ Steam + ะžั‚ะบั€ั‹ั‚ัŒ ะฑั‹ัั‚ั€ั‹ะน ะดะพัั‚ัƒะฟ Steam + ะฃะดะฐะปะธั‚ัŒ ัะปะตะผะตะฝั‚ + ะ”ะพะฑะฐะฒะธั‚ัŒ ัะปะตะผะตะฝั‚ + ะšะฝะพะฟะบะธ ะบะพะฝะบั€ะตั‚ะฝะพะณะพ ัƒัั‚ั€ะพะนัั‚ะฒะฐ + ะะฐะทะฝะฐั‡ะธั‚ัŒ ั„ะธะทะธั‡ะตัะบัƒัŽ ะบะฝะพะฟะบัƒ + ะžั‚ะฟัƒัั‚ะธั‚ะต ะบะฝะพะฟะบัƒ ะธ ะฒั‹ะฑะตั€ะธั‚ะต ยซะ˜ะทะผะตะฝะธั‚ัŒยป, ยซะŸะพะฒั‚ะพั€ะธั‚ัŒยป ะธะปะธ ยซะžั‚ะผะตะฝะฐยป. B ะธะปะธ ยซะะฐะทะฐะดยป ะพั‚ะผะตะฝัะตั‚ ะฟะพัะปะต ะพั‚ะฟัƒัะบะฐะฝะธั. + ะŸะพะฒั‚ะพั€ะธั‚ัŒ + ะะฐะถะผะธั‚ะต ะบะฝะพะฟะบัƒ, ะฒ ั‚ะพะผ ั‡ะธัะปะต ยซะะฐะทะฐะดยป, ะตัะปะธ ะพะฝะฐ ะฟะตั€ะตะดะฐั‘ั‚ัั ะบะฐะบ ะบะปะฐะฒะธัˆะฐ. ะšะปะฐะฒะธัˆะธ ะณั€ะพะผะบะพัั‚ะธ ะธ ัะธัั‚ะตะผะฝั‹ะต ะบะปะฐะฒะธัˆะธ Android ะทะฐั€ะตะทะตั€ะฒะธั€ะพะฒะฐะฝั‹. ะะฐะทะฝะฐั‡ะตะฝะธะต ะดะตะนัั‚ะฒัƒะตั‚ ั‚ะพะปัŒะบะพ ะฝะฐ ัั‚ะพะผ ัƒัั‚ั€ะพะนัั‚ะฒะต. + ะฃะดะฐะปะธั‚ัŒ ะฝะฐะทะฝะฐั‡ะตะฝะธะต + ะ”ะธะฐะณะฝะพัั‚ะธะบะฐ ะฒะฒะพะดะฐ + ะ—ะฐะฟะธัั‹ะฒะฐั‚ัŒ ะฒั€ะตะผั ะพั‚ะฟั€ะฐะฒะบะธ ะฒะฒะพะดะฐ + ะŸั€ะพั‡ะธั‚ะฐั‚ัŒ ะธะทะผะตั€ะตะฝะธั + ะ˜ะทะผะตั€ัะตั‚ ะฟัƒั‚ัŒ ะพั‚ ะดะธัะฟะตั‚ั‡ะตั€ะธะทะฐั†ะธะธ Android ะดะพ ะฟัƒะฑะปะธะบะฐั†ะธะธ ะฒ ััƒั‰ะตัั‚ะฒัƒัŽั‰ะตะผ ั‚ั€ะฐะฝัะฟะพั€ั‚ะต ะฒะฒะพะดะฐ. ะะต ัƒั‡ะธั‚ั‹ะฒะฐะตั‚ ะฟั€ะธั…ะพะด ะฟะพ Bluetooth, ะพะฟั€ะพั ะณะพัั‚ั, ะพั‚ั€ะธัะพะฒะบัƒ ะธ ะทะฐะดะตั€ะถะบัƒ ัะบั€ะฐะฝะฐ. ะ—ะฐะฟะธััŒ ะฟะพ ัƒะผะพะปั‡ะฐะฝะธัŽ ะฒั‹ะบะปัŽั‡ะตะฝะฐ. + ะ˜ัะฟะพะปัŒะทะพะฒะฐั‚ัŒ ะพะฑั‹ั‡ะฝะพะต ะฝะฐะทะฝะฐั‡ะตะฝะธะต ะฒะฒะพะดะฐ + diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 89dc1b2d78..8a98c2b2a2 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -28,6 +28,8 @@ ะŸั€ะธะพัั‚ะฐะฝะพะฒะธั‚ัŒ ัะตะนั‡ะฐั ะžัั‚ะฐะฝะพะฒะธั‚ัŒ ัะตััะธัŽ ะ“ะตะฝะตั€ะฐั†ะธั ะบะฐะดั€ะพะฒ + ะะฐัั‚ั€ะพะนะบะธ ัั‚ะพะน ะธะณั€ั‹ + ะะฐัั‚ั€ะพะนะบะธ ะฟะพ ัƒะผะพะปั‡ะฐะฝะธัŽ ะ’ั‹ะฑะตั€ะธั‚ะต ั€ะตะถะธะผ ะณะตะฝะตั€ะฐั†ะธะธ ะบะฐะดั€ะพะฒ ะ’ั‹ะบะป. DD-FG %1$dร— @@ -183,6 +185,7 @@ ะะต ัƒะดะฐะปะพััŒ ัะบะฐั‡ะฐั‚ัŒ ะณั€ะฐั„ะธั‡ะตัะบัƒัŽ ัั€ะตะดัƒ PowerVR. ะŸั€ะพะฒะตั€ัŒั‚ะต ะฟะพะดะบะปัŽั‡ะตะฝะธะต ะธ ะฟะพะฒั‚ะพั€ะธั‚ะต ะฟะพะฟั‹ั‚ะบัƒ. ะะต ัƒะดะฐะปะพััŒ ัะบะฐั‡ะฐั‚ัŒ DirectAudio, ะฟะพัั‚ะพะผัƒ ะฒ ัั‚ะพะน ัะตััะธะธ ะทะฒัƒะบ ะธะณั€ ะธะดั‘ั‚ ะฟะพ ะฑะพะปะตะต ะผะตะดะปะตะฝะฝะพะผัƒ ะฟัƒั‚ะธ. ะญั‚ะฐ ะฟั€ะพะณั€ะฐะผะผะฐ + ะกะตะฐะฝััƒ ะฝะต ัƒะดะฐะปะพััŒ ะฒั‹ะฒะตัั‚ะธ ะธะทะพะฑั€ะฐะถะตะฝะธะต ะฝะฐ ัะบั€ะฐะฝ: %1$s. ะ’ะผะตัั‚ะพ ั‡ั‘ั€ะฝะพะณะพ ัะบั€ะฐะฝะฐ ะทะดะตััŒ ะฟะพะบะฐะทะฐะฝะฐ ะฟั€ะธั‡ะธะฝะฐ; ะฟะพะดั€ะพะฑะฝะพัั‚ะธ ะฒ ะถัƒั€ะฝะฐะปะฐั… ัะตะฐะฝัะฐ. ะะต ัƒะดะฐะปะพััŒ ัะบะฐั‡ะฐั‚ัŒ ะบะปะธะตะฝั‚ Steam. ะ’ะพะทะผะพะถะฝะพ, ะฒะฐัˆะฐ ัะตั‚ัŒ ะธะปะธ VPN ะฑะปะพะบะธั€ัƒะตั‚ ัะตั€ะฒะตั€ั‹ Steam; ะฟั€ะพะฒะตั€ัŒั‚ะต ะฟะพะดะบะปัŽั‡ะตะฝะธะต ะธ ะฟะพะฒั‚ะพั€ะธั‚ะต ะฟะพะฟั‹ั‚ะบัƒ. ะะต ัƒะดะฐะปะพััŒ ะฝะฐัั‚ั€ะพะธั‚ัŒ ะบะปะธะตะฝั‚ Steam. ะŸั€ะพะฒะตั€ัŒั‚ะต ะฟะพะดะบะปัŽั‡ะตะฝะธะต ะธ ัะฒะพะฑะพะดะฝะพะต ะผะตัั‚ะพ, ะทะฐั‚ะตะผ ะฟะพะฒั‚ะพั€ะธั‚ะต ะฟะพะฟั‹ั‚ะบัƒ. %1$s โ€” ัะฑะพั€ะบะฐ ะดะปั x86-ะŸะš, ะบะพั‚ะพั€ะฐั ั€ะฐะฑะพั‚ะฐะตั‚ ั‡ะตั€ะตะท FEX, ะฐ ะพะฝ ะตั‰ะต ะฝะต ัƒัั‚ะฐะฝะพะฒะปะตะฝ. ะ—ะฐะฟัƒัั‚ะธั‚ะต Steam ะพะดะธะฝ ั€ะฐะท, ะฒะพะนะดั ะฒ ะฐะบะบะฐัƒะฝั‚, ะธ ะดะฐะนั‚ะต ะตะผัƒ ัะบะฐั‡ะฐั‚ัŒ FEX ะธ Steam Linux Runtime, ะทะฐั‚ะตะผ ะทะฐะฟัƒัั‚ะธั‚ะต ะฟั€ะพะณั€ะฐะผะผัƒ ัะฝะพะฒะฐ. @@ -501,6 +504,7 @@ ะ’ะบะปัŽั‡ะตะฝะพ ะ—ะฐะฟัƒัะบะฐะตั‚ัั ัะพ Steam ะ—ะฐะฟัƒัะบะฐะตั‚ัั ะฑะตะท Steam + ะ ะฐะทั€ะตัˆะตะฝะธะต ะธะณั€ั‹ ะะฐัั‚ั€ะพะนะบะธ ะะฐัั‚ั€ะพะนะบะธ %1$s ะŸะพ ัƒะผะพะปั‡ะฐะฝะธัŽ @@ -588,6 +592,8 @@ ะฏะดั€ะฐ ะธะณั€ั‹ ะฏะดั€ะฐ ะธะณั€ั‹ ะฏะดั€ะฐ, ะธัะฟะพะปัŒะทัƒะตะผั‹ะต ะธะณั€ะฐะผะธ. ะŸั€ะธ ะฒั‹ะฑะพั€ะต ะฒัะตั… ัะดะตั€ Android ะฟะปะฐะฝะธั€ัƒะตั‚ ัะฒะพะฑะพะดะฝะพ. + ะญะบะพะฝะพะผะธั‚ัŒ ัะฝะตั€ะณะธัŽ ะฒ ัั‚ะฐะฑะธะปัŒะฝั‹ั… ะธะณั€ะฐั… + ะ—ะฐะฟัƒัะบะฐะตั‚ ะธะณั€ัƒ ะฝะฐ ะฑะพะปะตะต ะผะตะดะปะตะฝะฝั‹ั… ัะดั€ะฐั…, ะฟะพะบะฐ ะพะฝะฐ ะดะตั€ะถะธั‚ ัั‚ะฐะฑะธะปัŒะฝัƒัŽ ั‡ะฐัั‚ะพั‚ัƒ ะบะฐะดั€ะพะฒ, ะธ ะฒะพะทะฒั€ะฐั‰ะฐะตั‚ ะตั‘ ะฝะฐ ะพะฑั‹ั‡ะฝั‹ะต ัะดั€ะฐ, ะบะฐะบ ั‚ะพะปัŒะบะพ ะพะฝะฐ ะพั‚ัั‚ะฐั‘ั‚. ะ˜ะฝั‚ะตั€ั„ะตะนั ะบะปะธะตะฝั‚ะฐ ะœะฝะพะณะพะฟะพั‚ะพั‡ะฝะพัั‚ัŒ GL ะœะพะถะตั‚ ัƒัะบะพั€ะธั‚ัŒ ะพั‚ะบะปะธะบ ะผะตะฝัŽ Steam. @@ -623,7 +629,10 @@ ะžั‚ะบะปัŽั‡ะฐะตั‚ ะฟะพะผะพั‰ะฝะธะบ ะฝะฐะฒะธะณะฐั†ะธะธ ะณะตะนะผะฟะฐะดะฐ Proton, ะบะพั‚ะพั€ั‹ะน ะฟะพั‚ั€ะตะฑะปัะตั‚ CPU ะฒ ะบะฐะถะดะพะน ะธะณั€ะต. ะ—ะฐะฟัƒัะบะฐั‚ัŒ proot ะฑะตะท seccomp ะœะพะถะตั‚ ะธัะฟั€ะฐะฒะธั‚ัŒ ะพัˆะธะฑะบะธ ะพั‚ััƒั‚ัั‚ะฒัƒัŽั‰ะธั… ัะธัั‚ะตะผะฝั‹ั… ะฒั‹ะทะพะฒะพะฒ ะฝะฐ ะฝะตะบะพั‚ะพั€ั‹ั… ัะดั€ะฐั…, ะฝะพ ะผะพะถะตั‚ ัะฝะธะทะธั‚ัŒ ะฟั€ะพะธะทะฒะพะดะธั‚ะตะปัŒะฝะพัั‚ัŒ. + ะ—ะฐะฟัƒัะบ ะฑะตะท proot (ัะบัะฟะตั€ะธะผะตะฝั‚ะฐะปัŒะฝะพ) + ะ—ะฐะฟัƒัะบะฐะตั‚ ะพะบั€ัƒะถะตะฝะธะต Linux ะฝะฐะฟั€ัะผัƒัŽ ะฒ Android. ะŸั€ะธะผะตะฝัะตั‚ัั ะบ ัะปะตะดัƒัŽั‰ะตะผัƒ ัะตะฐะฝััƒ. ะžั‚ะบะปัŽั‡ะธั‚ะต, ะตัะปะธ ั‡ั‚ะพ-ั‚ะพ ะฝะต ะทะฐะฟัƒัะบะฐะตั‚ัั. ะ‘ั‹ัั‚ั€ั‹ะน ะฟัƒั‚ัŒ proot + ะ‘ะตะท proot ะฝะต ะธัะฟะพะปัŒะทัƒะตั‚ัั. ะขั€ะตะฑัƒะตั‚ัั ั„ะธะปัŒั‚ั€ seccomp ะดะปั proot. ะ‘ั‹ัั‚ั€ั‹ะน ะฟะพะธัะบ ั„ะฐะนะปะพะฒ, ะผะตะฝัŒัˆะต ะฟะพะดั‚ะพั€ะผะฐะถะธะฒะฐะฝะธะน. ะžั‚ะบะปัŽั‡ะธั‚ะต, ะตัะปะธ ะฟั€ะพะณั€ะฐะผะผะฐ ะฝะต ะฝะฐั…ะพะดะธั‚ ั„ะฐะนะปั‹. ะ ะธัะพะฒะฐั‚ัŒ ะบัƒั€ัะพั€ ะฒะฝัƒั‚ั€ะธ gamescope @@ -706,6 +715,7 @@ ะ’ะธะดะตะพะฟะฐะผัั‚ัŒ ะŸะพะดะบะฐั‡ะบะฐ ะ—ะฐั€ัะด ะฑะฐั‚ะฐั€ะตะธ + ะžัั‚ะฐะฒัˆะตะตัั ะฒั€ะตะผั ั€ะฐะฑะพั‚ั‹ ะฑะฐั‚ะฐั€ะตะธ ะŸะพั‚ั€ะตะฑะปัะตะผะฐั ะผะพั‰ะฝะพัั‚ัŒ ะกะตั‚ัŒ ะ ะฐะทั€ะตัˆะตะฝะธะต @@ -864,11 +874,21 @@ ะกะตััะธั ะ–ัƒั€ะฝะฐะปั‹ ัะตััะธะธ ะกะพั…ั€ะฐะฝัะตั‚ัั ะฟะพัะปะต ะบะฐะถะดะพะน ัะตััะธะธ + ะ ะฐััˆะธั€ะตะฝะฝะฐั ะดะธะฐะณะฝะพัั‚ะธะบะฐ ะดะปั ัะปะตะดัƒัŽั‰ะตะณะพ ัะตะฐะฝัะฐ + ะ—ะฐะฟะธัั‹ะฒะฐะตั‚ ะฟะพะดั€ะพะฑะฝั‹ะต ะถัƒั€ะฝะฐะปั‹ ะทะฐ ะพะดะธะฝ ัะตะฐะฝั. ะœะพะถะตั‚ ัะฝะธะทะธั‚ัŒ ะฟั€ะพะธะทะฒะพะดะธั‚ะตะปัŒะฝะพัั‚ัŒ ะธ ะทะฐะฝัั‚ัŒ ะฑะพะปัŒัˆะต ะผะตัั‚ะฐ. ะžั‚ะบะปัŽั‡ะฐะตั‚ัั ัะฐะผะฐ ะฟั€ะธ ะทะฐะฟัƒัะบะต ัะตะฐะฝัะฐ; ะฟะตั€ะตะด ะพั‚ะฟั€ะฐะฒะบะพะน ะฟั€ะพัะผะพั‚ั€ะธั‚ะต ะถัƒั€ะฝะฐะปั‹. ะ–ัƒั€ะฝะฐะปั‹ ะพั‚ะปะฐะดะบะธ ะธะณั€ ะ”ะพะฑะฐะฒะปัั‚ัŒ ะดะธะฐะณะฝะพัั‚ะธะบัƒ Proton, Wine ะธ ะณั€ะฐั„ะธะบะธ ะฟั€ะธ ัะปะตะดัƒัŽั‰ะตะผ ะทะฐะฟัƒัะบะต ะธะณั€ั‹. ะœะพะถะตั‚ ัะฝะธะทะธั‚ัŒ ะฟั€ะพะธะทะฒะพะดะธั‚ะตะปัŒะฝะพัั‚ัŒ ะธ ะทะฐะฝัั‚ัŒ ะฑะพะปัŒัˆะต ะผะตัั‚ะฐ. ะŸะตั€ะตะทะฐะฟัƒัั‚ะธั‚ะต ัะตััะธัŽ, ั‡ั‚ะพะฑั‹ ัะพั…ั€ะฐะฝัั‚ัŒ ะถัƒั€ะฝะฐะปั‹ ะพั‚ะปะฐะดะบะธ ะธะณั€ ะะต ัƒะดะฐะปะพััŒ ะพะฑะฝะพะฒะธั‚ัŒ ะถัƒั€ะฝะฐะปะธั€ะพะฒะฐะฝะธะต. ะŸั€ะพะฒะตั€ัŒั‚ะต ะฟะตั€ะตะบะปัŽั‡ะฐั‚ะตะปัŒ ะธ ะฟะพะฒั‚ะพั€ะธั‚ะต ะฟะพะฟั‹ั‚ะบัƒ. ะ˜ะฝัั‚ั€ัƒะผะตะฝั‚ั‹ ะพั‚ะปะฐะดะบะธ + ะŸะพะดั€ะพะฑะฝั‹ะต ะถัƒั€ะฝะฐะปั‹ ะณั€ะฐั„ะธะบะธ + ะ˜ะฝั‚ะตั€ั„ะตะนั Steam: ะพั‚ั€ะธัะพะฒะบะฐ ะฝะฐ GPU + ะก ะฟะฐั€ะพะน ะดั€ะฐะนะฒะตั€ะพะฒ Xclipse Steam ะพั‚ั€ะธัะพะฒั‹ะฒะฐะตั‚ ัั‚ั€ะฐะฝะธั†ั‹ ะฟั€ะพะณั€ะฐะผะผะฝะพ (ะฟั€ะธ ะพั‚ั€ะธัะพะฒะบะต ะฝะฐ GPU ะฟะพัะฒะปัะปะธััŒ ะฑะธั‚ั‹ะต ั‚ะฐะนะปั‹). ะ’ะบะปัŽั‡ะธั‚ะต, ั‡ั‚ะพะฑั‹ ัƒัะบะพั€ะธั‚ัŒ ะธะฝั‚ะตั€ั„ะตะนั Steam, ะตัะปะธ ะฝะฐ ัั‚ะพะผ ั‚ะตะปะตั„ะพะฝะต ะพะฝ ะฒั‹ะณะปัะดะธั‚ ะบะพั€ั€ะตะบั‚ะฝะพ. + ัะฑะพั€ะบะฐ %1$s + %1$s ะพะฑะฝะพะฒะปั‘ะฝ ะดะพ ะฟะพัะปะตะดะฝะตะน ัะฑะพั€ะบะธ + ะ’ ะฟั€ะพัˆะปะพะผ ัะตะฐะฝัะต ะผะพัั‚ Mali ะฝะต ะฟั€ะพัˆั‘ะป ัะฐะผะพะฟั€ะพะฒะตั€ะบัƒ ะฝะฐ %1$s (ะธะทะพะฑั€ะฐะถะตะฝะธั ะธะปะธ ะพั‚ั€ะธัะพะฒะบะฐ), ะฟะพัั‚ะพะผัƒ ะฒ ัะตะฐะฝัะต ะธัะฟะพะปัŒะทะพะฒะฐะปะฐััŒ ะฟะฐั€ะฐ ะดั€ะฐะนะฒะตั€ะพะฒ PanVK. + ะ’ ะฟั€ะพัˆะปะพะผ ัะตะฐะฝัะต ะผะพัั‚ Mali ะฝะต ะฝะฐัˆั‘ะป ัะฟะพัะพะฑะฐ ั€ะฐะทะดะตะปัั‚ัŒ ะฟะฐะผัั‚ัŒ ั ะดั€ะฐะนะฒะตั€ะพะผ ะฝะฐ %1$s, ะฟะพัั‚ะพะผัƒ ะฒ ัะตะฐะฝัะต ะธัะฟะพะปัŒะทะพะฒะฐะปะฐััŒ ะฟะฐั€ะฐ ะดั€ะฐะนะฒะตั€ะพะฒ PanVK. ะะฐ ัั‚ะพะผ ั‚ะตะปะตั„ะพะฝะต ะผะพัั‚ ั€ะฐะฑะพั‚ะฐั‚ัŒ ะฝะต ะผะพะถะตั‚; ะฟั€ะธ ะตะณะพ ะพั‚ะบะปัŽั‡ะตะฝะธะธ ะพัั‚ะฐะฝะตั‚ัั ะฟะฐั€ะฐ PanVK. + ะ–ัƒั€ะฝะฐะปั‹ Proton, DXVK ะธ ะดั€ะฐะนะฒะตั€ะพะฒ ะดะปั ะบะฐะถะดะพะน ะธะณั€ั‹ ะฝะฐั…ะพะดัั‚ัั ะฒ ะถัƒั€ะฝะฐะปะฐั… ัะตะฐะฝัะฐ. ะ’ัะตะณะดะฐ ะฒะบะปัŽั‡ะตะฝะพ, ะตัะปะธ GPU ะฝะต Adreno. ะŸะพัะปะตะดะฝะธะต ะถัƒั€ะฝะฐะปั‹ ัะตััะธะธ ะกะพั…ั€ะฐะฝะตะฝะฝั‹ะต ะถัƒั€ะฝะฐะปั‹ ัะตััะธะธ ะฅั€ะฐะฝัั‚ัั ะฟะพัะปะตะดะฝะธะต %1$d @@ -912,6 +932,8 @@ ะ˜ัะฟะพะปัŒะทะพะฒะฐั‚ัŒ ะบะฐะบ ะณะปะฐะฒะฝั‹ะน ัะบั€ะฐะฝ DroidDeck ะผะพะถะตั‚ ะธัะฟะพะปัŒะทะพะฒะฐั‚ัŒัั ะบะฐะบ ะฟั€ะธะปะพะถะตะฝะธะต ะณะปะฐะฒะฝะพะณะพ ัะบั€ะฐะฝะฐ DroidDeck ะฝะต ะฑัƒะดะตั‚ ะดะพัั‚ัƒะฟะตะฝ ะบะฐะบ ะฟั€ะธะปะพะถะตะฝะธะต ะณะปะฐะฒะฝะพะณะพ ัะบั€ะฐะฝะฐ + ะšะฝะพะฟะบะฐ ยซะ”ะพะผะพะนยป ะพั‚ะบั€ั‹ะฒะฐะตั‚ + ะกั‚ั€ะฐะฝะธั†ะฐ, ะบะพั‚ะพั€ะฐั ะพั‚ะบั€ั‹ะฒะฐะตั‚ัั, ะบะพะณะดะฐ DroidDeck โ€” ะฟั€ะธะปะพะถะตะฝะธะต ะณะปะฐะฒะฝะพะณะพ ัะบั€ะฐะฝะฐ ะฟะพ ัƒะผะพะปั‡ะฐะฝะธัŽ ะธ ะฝะฐะถะฐั‚ะฐ ะบะฝะพะฟะบะฐ ยซะ”ะพะผะพะนยป. ะ’ ั€ะฐะทะดะตะปะต ยซะ”ะพะฑะฐะฒะธั‚ัŒ ะธะณั€ั‹ยป ะฟะตั€ะตะบะปัŽั‡ะธั‚ะต DroidDeck ะฝะฐ ยซะ’ะบะปัŽั‡ะธั‚ัŒยป ะžั€ะธะตะฝั‚ะฐั†ะธั ะžั€ะธะตะฝั‚ะฐั†ะธั ะปะฐัƒะฝั‡ะตั€ะฐ @@ -933,11 +955,14 @@ ะ’ะบะป. ะ’ั‹ะบะป. ะฃะฟั€ะฐะฒะปะตะฝะธะต ะฝะฐ ะฝะธะถะฝะตะผ ัะบั€ะฐะฝะต ะฒ ะธะณั€ะฐั… + ะšะปะฐะฒะธะฐั‚ัƒั€ะฐ Android ะดะปั ั‚ะตะบัั‚ะพะฒั‹ั… ะฟะพะปะตะน ะžั‚ะบั€ั‹ะฒะฐะตั‚ ั‚ะฐั‡ะฟะฐะด ะธ ะบะปะฐะฒะธะฐั‚ัƒั€ัƒ ะฝะฐ ะฒั‚ะพั€ะพะผ ัะบั€ะฐะฝะต ะฟั€ะธ ะทะฐะฟัƒัะบะต ัะตะฐะฝัะฐ. ะ’ะฒะพะด ะดะปั ะฒะตั€ั…ะฝะตะณะพ ัะบั€ะฐะฝะฐ ะ“ะพั‚ะพะฒะพ ะ“ะปะฐะฒะฝั‹ะน ัะบั€ะฐะฝ ะฟะพ ัƒะผะพะปั‡ะฐะฝะธัŽ ะ’ั‹ะฑั€ะฐั‚ัŒ ะณะปะฐะฒะฝั‹ะน ัะบั€ะฐะฝ + ะกะบั€ั‹ะฒะฐั‚ัŒ ะปะฐัƒะฝั‡ะตั€ ะธะท ยซะะตะดะฐะฒะฝะธั… ะฟั€ะธะปะพะถะตะฝะธะนยป ะฒ ั€ะตะถะธะผะต ะพะถะธะดะฐะฝะธั + ะŸั€ะธะผะตะฝัะตั‚ัั ั‚ะพะปัŒะบะพ ะตัะปะธ DroidDeck โ€” ะฟั€ะธะปะพะถะตะฝะธะต ะณะปะฐะฒะฝะพะณะพ ัะบั€ะฐะฝะฐ ะฟะพ ัƒะผะพะปั‡ะฐะฝะธัŽ ะธ ะฝะตั‚ ะฐะบั‚ะธะฒะฝะพะณะพ ัะตะฐะฝัะฐ. ะ’ั‹ะฑั€ะฐั‚ัŒ ะŸั€ะธะปะพะถะตะฝะธั Linux (ะฑะตั‚ะฐ) ะคะฐะนะปั‹ @@ -1049,9 +1074,174 @@ Preview ะŸะพัะปะตะดะฝะธะต ะธัะฟั€ะฐะฒะปะตะฝะธั ะฟะตั€ะตะด Stable ะะบั‚ัƒะฐะปัŒะฝะพ + ะกะบะพะฟะธั€ะพะฒะฐั‚ัŒ ัะฒะตะดะตะฝะธั ะพ ัะฑะพั€ะบะต + ะกะฒะตะดะตะฝะธั ะพ ัะฑะพั€ะบะต ัะบะพะฟะธั€ะพะฒะฐะฝั‹ + ะะพะฒะตะต Preview + ะ’ั‹ ะพะฟะตั€ะตะถะฐะตั‚ะต Preview + ะญั‚ะฐ ัะฑะพั€ะบะฐ ะฝะพะฒะตะต ะฟะพัะปะตะดะฝะตะน Preview. ะ•ั‘ ะพะฑะฝะพะฒะธั‚ ัะปะตะดัƒัŽั‰ะฐั ัะฑะพั€ะบะฐ Preview. + ะ’ั‹ะฑะตั€ะธั‚ะต ัะฑะพั€ะบัƒ, ั‡ั‚ะพะฑั‹ ัƒะฒะธะดะตั‚ัŒ ะธะทะผะตะฝะตะฝะธั ะธะปะธ ัƒัั‚ะฐะฝะพะฒะธั‚ัŒ ะตั‘. + ะฃัั‚ะฐะฝะพะฒะปะตะฝะฐ + ะฃัั‚ะฐะฝะพะฒะธั‚ัŒ ัั‚ัƒ ัะฑะพั€ะบัƒ%1$s + ะ’ะตั€ะฝัƒั‚ัŒัั ะบ ัั‚ะพะน ัะฑะพั€ะบะต%1$s + versionCode %1$d + ะšะพะผะผะธั‚ %1$s + ะกั‚ั€ะฐะฝะธั†ะฐ ั€ะตะปะธะทะฐ + ะ’ PR ะตัั‚ัŒ ะฑะพะปะตะต ะฝะพะฒั‹ะน ะบะพะผะผะธั‚ (%1$s). ะ•ะณะพ ั‚ะตัั‚ะพะฒะฐั ัะฑะพั€ะบะฐ ะตั‰ั‘ ะฝะต ะณะพั‚ะพะฒะฐ, ะฟะพัั‚ะพะผัƒ ะฒ ัั‚ะพะน ะตะณะพ ะฝะตั‚. + ะ•ัั‚ัŒ ะฝะพะฒั‹ะน ะบะพะผะผะธั‚, ัะฑะพั€ะบะฐ ะพะถะธะดะฐะตั‚ัั + ะะพะผะตั€ PR, ะฝะฐะทะฒะฐะฝะธะต ะธะปะธ ะฐะฒั‚ะพั€ + ะŸะพะดั…ะพะดัั‰ะธั… ั‚ะตัั‚ะพะฒั‹ั… ัะฑะพั€ะพะบ ะฝะตั‚ + ะัƒะถะฝะฐ ะฟะตั€ะตัะฑะพั€ะบะฐ (versionCode %1$d) + ะžะฑะฝะพะฒะปะตะฝะธั ั‚ะตัั‚ะพะฒั‹ั… ัะฑะพั€ะพะบ + ะะพะฒะฐั ั‚ะตัั‚ะพะฒะฐั ัะฑะพั€ะบะฐ PR #%1$d + %1$s. ะžั‚ะบั€ะพะนั‚ะต ะžะฑะฝะพะฒะปะตะฝะธั, ั‡ั‚ะพะฑั‹ ัƒัั‚ะฐะฝะพะฒะธั‚ัŒ ะตั‘. + ะŸะพะบะฐะทะฐั‚ัŒ ะตั‰ั‘ (%1$d) + ะัƒะถะฝะฐ ะฟะตั€ะตัะฑะพั€ะบะฐ ะดะปั versionCode %2$d (%1$d) + ะกะฑะพั€ะพะบ Preview ะฒ main ะฟะพัะปะต ัั‚ะพะน ั‚ะตัั‚ะพะฒะพะน ัะฑะพั€ะบะธ: %1$d ะขะตัั‚ะพะฒั‹ะต ัะฑะพั€ะบะธ ะŸะพะฟั€ะพะฑะพะฒะฐั‚ัŒ ะธัะฟั€ะฐะฒะปะตะฝะธะต ะดะพ ะพั„ะธั†ะธะฐะปัŒะฝะพะณะพ ะฒั‹ะฟัƒัะบะฐ ะกะตะนั‡ะฐั ะฝะตั‚ + ะ›ะฐะฑะพั€ะฐั‚ะพั€ะฝะฐั ัะฑะพั€ะบะฐ + ะ›ะฐะฑะพั€ะฐั‚ะพั€ะฝั‹ะต ัะฑะพั€ะบะธ + ะ˜ัะฟะพะปัŒะทัƒะตั‚ัั + ะŸั€ะธะพัั‚ะฐะฝะพะฒะปะตะฝะพ ะฟะพัะปะต ะฟะพะฒั‚ะพั€ะฝะพะน ะพะฟั‚ะธะผะธะทะฐั†ะธะธ DroidDeck ะฒ Android + ะะต ะทะฐะณั€ัƒะถะตะฝะพ: %1$s + ะžะถะธะดะฐะตั‚ ะฟะตั€ะตะทะฐะฟัƒัะบะฐ + ะกะพั…ั€ะฐะฝะตะฝะพ + ะ”ะปั ะดั€ัƒะณะพะน ะฒะตั€ัะธะธ + ะŸะตั€ะตัะพะฑั€ะฐั‚ัŒ + ะฃะดะฐะปัะตั‚ ัั‚ัƒ ัะฑะพั€ะบัƒ ั ัƒัั‚ั€ะพะนัั‚ะฒะฐ + ะŸะตั€ะตะทะฐะฟัƒัั‚ะธั‚ัŒ ั ะฝะตะน + ะžั‚ะบะปัŽั‡ะธั‚ัŒ + ะ˜ัะฟะพะปัŒะทะพะฒะฐั‚ัŒ + ะฃะดะฐะปะธั‚ัŒ + ะฃะดะฐะปะธั‚ัŒ ัะตะนั‡ะฐั + ะะต ัƒะดะฐะปะพััŒ ะฟะพะดะณะพั‚ะพะฒะธั‚ัŒ ะฟะตั€ะตะทะฐะฟัƒัะบ: %1$s. ะ’ั‹ะฟะพะปะฝะธั‚ะต ัะพะฟั€ัะถะตะฝะธะต ะดะปั ะฑะตัะฟั€ะพะฒะพะดะฝะพะน ะพั‚ะปะฐะดะบะธ ะฒ ยซะะฐัั‚ั€ะพะนะบะตยป ะธ ะฟะพะฒั‚ะพั€ะธั‚ะต ะฟะพะฟั‹ั‚ะบัƒ. + ะ›ะฐะฑะพั€ะฐั‚ะพั€ะฝะฐั ัะฑะพั€ะบะฐ ัƒัั‚ะฐะฝะพะฒะปะตะฝะฐ + DroidDeck ะฟะตั€ะตะทะฐะฟัƒั‰ะตะฝ ะฝะฐ %1$s + ะ›ะฐะฑะพั€ะฐั‚ะพั€ะฝะฐั ัะฑะพั€ะบะฐ ะฟั€ะธะพัั‚ะฐะฝะพะฒะปะตะฝะฐ + Android ะฟะพะฒั‚ะพั€ะฝะพ ะพะฟั‚ะธะผะธะทะธั€ะพะฒะฐะป DroidDeck, ะฟะพัั‚ะพะผัƒ %1$s ะฝะต ะทะฐะณั€ัƒะถะตะฝะฐ. ะžั‚ะบั€ะพะนั‚ะต ยซะžะฑะฝะพะฒะปะตะฝะธัยป, ั‡ั‚ะพะฑั‹ ะฟะตั€ะตะทะฐะฟัƒัั‚ะธั‚ัŒ ะฝะฐ ะฝะตะน. + ะ›ะฐะฑะพั€ะฐั‚ะพั€ะฝะฐั ัะฑะพั€ะบะฐ ะพั‚ะบะปัŽั‡ะตะฝะฐ + ะกะฑะพั€ะบะฐ ัะพะทะดะฐะฝะฐ ะดะปั ะดั€ัƒะณะพะน ะฒะตั€ัะธะธ DroidDeck. ะžะฝะฐ ัะพั…ั€ะฐะฝะตะฝะฐ ะฒ ยซะžะฑะฝะพะฒะปะตะฝะธัยป. + DroidDeck ะดะฒะฐะถะดั‹ ะฝะต ะทะฐะฟัƒัั‚ะธะปัั ะฝะฐ ะฝะตะน + ะะณะตะฝั‚ + ะะณะตะฝั‚ + ะะณะตะฝั‚ ั€ะฐะฑะพั‚ะฐะตั‚ + ะฃัั‚ะฐะฝะพะฒะธั‚ะต Claude Code ะฒ ะฟะพะปัŒะทะพะฒะฐั‚ะตะปัŒัะบะพะน ัั€ะตะดะต Linux, ั‡ั‚ะพะฑั‹ ะธัะฟะพะปัŒะทะพะฒะฐั‚ัŒ ะฐะณะตะฝั‚ะฐ. + ะกะฟั€ะพัะธั‚ะต ะพะฑ ะธะณั€ะต, ัะฑะพะต ะธะปะธ ะธะทะผะตะฝะตะฝะธะธ DroidDeck + ะžั‚ะฟั€ะฐะฒะธั‚ัŒ + ะะพะฒั‹ะน ะดะธะฐะปะพะณ + ะžัั‚ะฐะฝะพะฒะธั‚ัŒ + ะฅั€ะฐะฝะธะปะธั‰ะต + ะฃะดะฐะปะธั‚ัŒ + ะฃะดะฐะปะธั‚ัŒ ัะตะนั‡ะฐั + Claude Code + Codex + ะ˜ัั…ะพะดะฝั‹ะน ะบะพะด DroidDeck + ะšััˆ ะทะฐะณั€ัƒะทะพะบ + ะะตะพั‚ะฟั€ะฐะฒะปะตะฝะฝั‹ะต ะธะทะผะตะฝะตะฝะธั ะฑัƒะดัƒั‚ ะฟะพั‚ะตั€ัะฝั‹ + ะกะฑะพั€ะบะธ ัะบะฐั‡ะฐัŽั‚ ะธั… ะทะฐะฝะพะฒะพ + ยซะะฐัั‚ั€ะพะนะบะฐยป ะผะพะถะตั‚ ัƒัั‚ะฐะฝะพะฒะธั‚ัŒ ะตะณะพ ัะฝะพะฒะฐ; ะฐะฒั‚ะพั€ะธะทะฐั†ะธั ัะพั…ั€ะฐะฝะธั‚ัั + DroidDeck ะฟะตั€ะตะทะฐะฟัƒั‰ะตะฝ ะฝะฐ ะฒะฐัˆะตะน ะปะฐะฑะพั€ะฐั‚ะพั€ะฝะพะน ัะฑะพั€ะบะต. ะŸั€ะพะดะพะปะถะธั‚ะต ั ั‚ะพะณะพ ะผะตัั‚ะฐ, ะณะดะต ะพัั‚ะฐะฝะพะฒะธะปะธััŒ. + ะกะฟั€ะพัะธั‚ะต, ะฟะพั‡ะตะผัƒ ะธะณั€ะฐ ะฝะต ะทะฐะฟัƒัะบะฐะตั‚ัั, ะฟะพะฟั€ะพัะธั‚ะต ะพะฑัŠััะฝะธั‚ัŒ ะปะพะณ, ะธะทะผะตะฝะธั‚ัŒ DroidDeck ะธ ะฟั€ะพะฒะตั€ะธั‚ัŒ ะธะทะผะตะฝะตะฝะธะต ะฝะฐ ัั‚ะพะผ ัƒัั‚ั€ะพะนัั‚ะฒะต. + ะžัˆะธะฑะบะฐ: %1$s + %1$s ะทะฐะฒะตั€ัˆั‘ะฝ (ะบะพะด ะฒั‹ั…ะพะดะฐ %2$d) + ะžัั‚ะฐะฝะพะฒะปะตะฝะพ + ะ—ะฐะฒะตั€ัˆะตะฝะพ ะฑะตะท ะพั‚ะฒะตั‚ะฐ + ะŸะพะฒั‚ะพั€ะธั‚ัŒ + ะะฐัั‚ั€ะพะนะบะฐ ะฐะณะตะฝั‚ะฐ + ะŸะตั€ะตัะพะฑะตั€ะธั‚ะต ะผะพัŽ ะปะฐะฑะพั€ะฐั‚ะพั€ะฝัƒัŽ ัะฑะพั€ะบัƒ %1$s ะฟะพะด ัƒัั‚ะฐะฝะพะฒะปะตะฝะฝัƒัŽ ะฒะตั€ัะธัŽ DroidDeck ะธ ะฟะตั€ะตะทะฐะฟัƒัั‚ะธั‚ะต ะฝะฐ ะฝะตะน. + %1$s ะฝะฐ ะฒั…ะพะดะต ยท %2$s ะฝะฐ ะฒั‹ั…ะพะดะต + ะ”ัƒะผะฐะตั‚ + ะœั‹ัะปัŒ + ะ”ัƒะผะฐะตั‚ ยท %1$s + %1$s ยท %2$s + ะ’ะ’ะžะ” + ะ’ะซะ’ะžะ” + ะ’ั‹ะฟะพะปะฝัะตั‚ััโ€ฆ + ะะตั‚ ั€ะตะทัƒะปัŒั‚ะฐั‚ะฐ: ั…ะพะด ะทะฐะฒะตั€ัˆะธะปัั ั€ะฐะฝัŒัˆะต + ะะตั‚ ะฒั‹ะฒะพะดะฐ + ะ’ะฒะตะดะธั‚ะต ั‚ะตะบัั‚, ั‡ั‚ะพะฑั‹ ะฟะพัั‚ะฐะฒะธั‚ัŒ ัะปะตะดัƒัŽั‰ะตะต ัะพะพะฑั‰ะตะฝะธะต ะฒ ะพั‡ะตั€ะตะดัŒ + ะ’ ะพั‡ะตั€ะตะดัŒ + ะ”ะฐะปะตะต: %1$s + ะะต ะพั‚ะฟั€ะฐะฒะปัั‚ัŒ + ะŸั€ะธะบั€ะตะฟะธั‚ัŒ + ะฃะดะฐะปะธั‚ัŒ + ะŸะพ ัƒะผะพะปั‡ะฐะฝะธัŽ + ะฃั€ะพะฒะตะฝัŒ ั€ะฐัััƒะถะดะตะฝะธะน + ะ’ะฟะตั€ั‘ะด + ะ˜ะทะผะตะฝะธั‚ัŒ + ะ˜ะทะผะตะฝะตะฝะธะน ะฟะพะบะฐ ะฝะตั‚ + ะ”ะตะนัั‚ะฒัƒะนั‚ะต ะฟะพ ะฟะปะฐะฝัƒ. + ะžั‚ะฟั€ะฐะฒะธั‚ัŒ ัะตะนั‡ะฐั + ะ•ั‰ั‘ + ะ—ะฐะบั€ั‹ั‚ัŒ + ะŸะพัะปะตะดะฝัั ะฒะตั€ัะธั + ะ ะฐะฑะพั‚ะฐะตั‚ + ะšะพะฝั‚ะตะบัั‚ + %1$s ะธะท %2$s + ะญั‚ะพั‚ ะดะธะฐะปะพะณ ยท %1$s + ะ”ะฐะฝะฝั‹ะต ะพะฑ ะธัะฟะพะปัŒะทะพะฒะฐะฝะธะธ ะฟะพัะฒัั‚ัั ะฟะพัะปะต ะฟะตั€ะฒะพะณะพ ะพั‚ะฒะตั‚ะฐ + ะ›ะธะผะธั‚ %1$d ั‡ + ะ›ะธะผะธั‚ %1$d ะผะธะฝ + ะะตะดะตะปัŒะฝั‹ะน ะปะธะผะธั‚ + %1$d%% ยท ัะฑั€ะพั %2$s + + %1$d ั„ะฐะนะปะฐ + %1$d ั„ะฐะนะปะพะฒ + %1$d ั„ะฐะนะป + %1$d ั„ะฐะนะปะพะฒ + + ะกะฝะฐั‡ะฐะปะฐ ะฟะปะฐะฝ + ะŸะปะฐะฝ + ะŸั€ะตะดะปะฐะณะฐะตั‚ ะฟะปะฐะฝ, ะฝะธั‡ะตะณะพ ะฝะต ะผะตะฝัั + ะ”ะธะฐะปะพะณะธ + ะ”ะธะฐะปะพะณะพะฒ ะฟะพะบะฐ ะฝะตั‚ + ะขะพะปัŒะบะพ ั‡ั‚ะพ + ะฃะดะฐะปะธั‚ัŒ + ะฃะดะฐะปะธั‚ ะดะธะฐะปะพะณ ะธ ะฒะปะพะถะตะฝะธั + ะŸั€ะพั†ะตััั‹ + ะ’ ะฟะพะปัŒะทะพะฒะฐั‚ะตะปัŒัะบะพะผ ะฟั€ะพัั‚ั€ะฐะฝัั‚ะฒะต Linux ะฝะธั‡ะตะณะพ ะฝะต ะทะฐะฟัƒั‰ะตะฝะพ + ะะ“ะ•ะะข + ะžัั‚ะฐะฝะพะฒะธั‚ัŒ + ะกะฑะพั€ะบะฐ Lab + ะŸะพะดะณะพั‚ะพะฒะบะฐ ัะฑะพั€ะพะบ Lab + %1$d%% ยท ะพัั‚ะฐะปะพััŒ ะพะบะพะปะพ %2$s + ะพัั‚ะฐะปะพััŒ ะพะบะพะปะพ %1$s + ะžั‚ะผะตะฝะฐ + ะžั‚ะผะตะฝะธั‚ัŒ ัะฑะพั€ะบัƒ + ะ—ะฐะฟัƒัะบ + %1$d%% + ะฃะฟะฐะบะพะฒะบะฐ + ะŸะตั€ะตะทะฐะฟัƒัะบ DroidDeck ะฝะฐ ะฝะตะน + ะ“ะพั‚ะพะฒะพ + ะžัˆะธะฑะบะฐ: %1$s + ะะฐัั‚ั€ะพะนะบะฐ ะฐะณะตะฝั‚ะฐ + ะกะฝะฐั‡ะฐะปะฐ ัƒัั‚ะฐะฝะพะฒะธั‚ะต ัั€ะตะดัƒ ะฒั‹ะฟะพะปะฝะตะฝะธั Linux ะฒ ั€ะฐะทะดะตะปะต ยซะะฐัั‚ั€ะพะนะบะฐยป. + ะŸะพะฒั‚ะพั€ะธั‚ัŒ + ะะฐั‡ะฐั‚ัŒ ะดะธะฐะปะพะณ + ะŸะพะดะบะปัŽั‡ะตะฝะธะต ัƒัั‚ั€ะพะนัั‚ะฒะฐ + ะ‘ะตัะฟั€ะพะฒะพะดะฝะฐั ะพั‚ะปะฐะดะบะฐ, ั‡ั‚ะพะฑั‹ ะฐะณะตะฝั‚ ะฒะธะดะตะป DroidDeck ะธ ัƒะฟั€ะฐะฒะปัะป ะธะผ + ะฃัั‚ะฐะฝะพะฒะธั‚ัŒ %1$s + ะ’ ะฟะพะปัŒะทะพะฒะฐั‚ะตะปัŒัะบัƒัŽ ัั€ะตะดัƒ Linux, ั git, gh ะธ adb + ะ’ะพะนั‚ะธ ะฒ %1$s + ะžั‚ะบั€ะพะตั‚ ะฑั€ะฐัƒะทะตั€ + GitHub + ะะตะพะฑัะทะฐั‚ะตะปัŒะฝะพ, ะดะปั ะพั‚ะบั€ั‹ั‚ะธั ะฟัƒะปะป-ั€ะตะบะฒะตัั‚ะพะฒ + ะ˜ะฝัั‚ั€ัƒะผะตะฝั‚ั‹ ัะฑะพั€ะบะธ + ะะตะพะฑัะทะฐั‚ะตะปัŒะฝะพ, ะดะปั ัะฑะพั€ะพะบ Lab ะฝะฐ ัั‚ะพะผ ัƒัั‚ั€ะพะนัั‚ะฒะต ยท ะพะบะพะปะพ 5 ะ“ะ‘ + ะะณะตะฝั‚ ะณะพั‚ะพะฒ + ะ—ะฐะฒะตั€ัˆะธั‚ะต ะฝะฐัั‚ั€ะพะนะบัƒ ะฐะณะตะฝั‚ะฐ + ะ’ั‹ ะฒะพัˆะปะธ ะฒ %1$s + ะกะฑะพั€ะบะธ Lab + ะฑั‹ัั‚ั€ั‹ะต ัะฑะพั€ะบะธ + ะ‘ั‹ัั‚ั€ั‹ะต ัะฑะพั€ะบะธ Lab + ะ—ะฐั€ะฐะฝะตะต ะบะพะผะฟะธะปะธั€ัƒะตั‚ ัั‚ัƒ ะฒะตั€ัะธัŽ, ั‡ั‚ะพะฑั‹ ัะฑะพั€ะบะธ Lab ะทะฐะฝะธะผะฐะปะธ ะผะธะฝัƒั‚ั‹ ยท ะพะบะพะปะพ 20 ะผะธะฝัƒั‚ ะพะดะธะฝ ั€ะฐะท + ะšะพะผะฟะธะปัั†ะธั ยท %1$d%% ยท ะพัั‚ะฐะปะพััŒ ะพะบะพะปะพ %2$s + ะŸะพะดะณะพั‚ะพะฒะธั‚ัŒ + ะ‘ะตัะฟั€ะพะฒะพะดะฝะฐั ะพั‚ะปะฐะดะบะฐ ะฝะตะดะพัั‚ัƒะฟะฝะฐ; ยซะกะพะฟั€ัะถะตะฝะธะตยป ะฒะบะปัŽั‡ะธั‚ ะตั‘ + ะกะพะฟั€ัะถะตะฝะธะต + ะฃัั‚ะฐะฝะพะฒะธั‚ัŒ + ะ’ะพะนั‚ะธ PR #%1$d ะะต ัะพะฑั€ะฐะฝะพ ะดะปั ัั‚ะพะน ะบะพะฟะธะธ DroidDeck ะžะฑะฝะพะฒะปะตะฝะพ %1$s @@ -1299,6 +1489,9 @@ ะŸั€ะธะปะพะถะตะฝะธั ะะฐัั‚ั€ะพะนะบะฐ ะžะฑะฝะพะฒะปะตะฝะธั + ะ•ั‰ั‘ + ะะฐัั‚ั€ะพะธั‚ัŒ ะฒะบะปะฐะดะบะธ + ะ’ะบะปะฐะดะบะธ %1$d%% ะŸั€ะพะดะพะปะถะธั‚ัŒ %1$s ะžั‚ะพะฑั€ะฐะถะฐะตั‚ัั ะบะฐะบ /root/ROMs ะฒ ะบะฐะถะดะพะน ัะตััะธะธ. ะ’ะฝัƒั‚ั€ะตะฝะฝะตะต ั…ั€ะฐะฝะธะปะธั‰ะต ะฝะฐั…ะพะดะธั‚ัั ะฒ /root/Storage. @@ -2131,6 +2324,7 @@ ะ—ะฐะฟัƒัะบ ัะตััะธะธโ€ฆ ะŸั€ะพัˆะปะพ %1$d:%2$02d ยท ั€ะฐะฑะพั‚ะฐ ะฟั€ะพะดะพะปะถะฐะตั‚ัั ะ—ะฐะณั€ัƒะทะบะฐ ะพะฑะฝะพะฒะปะตะฝะธั ะบะปะธะตะฝั‚ะฐ Steam ยท %1$d%% + ะŸั€ะธะผะตะฝะตะฝะธะต ะพะฑะฝะพะฒะปะตะฝะธั ะบะปะธะตะฝั‚ะฐ Steamโ€ฆ ะ—ะฐะณั€ัƒะทะบะฐ ะบะปะธะตะฝั‚ะฐ Steam ยท %1$s ะ˜ะฝัั‚ั€ัƒะผะตะฝั‚ ัะพะฒะผะตัั‚ะธะผะพัั‚ะธ ัƒะถะต ัƒัั‚ะฐะฝะฐะฒะปะธะฒะฐะตั‚ัั @@ -2207,6 +2401,22 @@ ะœัƒะปัŒั‚ััˆะฝั‹ะต ะบะพะฝั‚ัƒั€ั‹ ะฟะปัŽั ั€ะตะทะบะพัั‚ัŒ. GPU ะฝะต Adreno + ะกะธัั‚ะตะผะฝั‹ะน ะดั€ะฐะนะฒะตั€ PowerVR: ัะพะฒะผะตัั‚ะธะผะพัั‚ัŒ ะทะฐะฒะธัะธั‚ ะพั‚ ัƒัั‚ั€ะพะนัั‚ะฒะฐ + ะญะบัะฟะตั€ะธะผะตะฝั‚ะฐะปัŒะฝะพ: RADV ะธะปะธ ัะธัั‚ะตะผะฝั‹ะน ะดั€ะฐะนะฒะตั€ Xclipse + ะกะธัั‚ะตะผะฝั‹ะน PowerVR + ะ˜ัะฟะพะปัŒะทัƒะตั‚ ะฒัั‚ั€ะพะตะฝะฝั‹ะต ะดั€ะฐะนะฒะตั€ั‹ ะดะปั ัั‚ะพะณะพ GPU + ะ”ะปั ัั€ะตะดั‹ ะฒั‹ะฟะพะปะฝะตะฝะธั ะธ ะพั‚ะพะฑั€ะฐะถะตะฝะธั ะฒั‹ะฑั€ะฐะฝ ัะธัั‚ะตะผะฝั‹ะน ะดั€ะฐะนะฒะตั€ PowerVR. + ะะธ ะพะดะธะฝ ะพั‚ะบั€ั‹ั‚ั‹ะน ะดั€ะฐะนะฒะตั€ ะฟะพะบะฐ ะฝะต ะฟะพะดะดะตั€ะถะธะฒะฐะตั‚ ัั‚ะพั‚ Mali: ะฒะบะปัŽั‡ั‘ะฝ ะผะพัั‚ Mali. + ะญั‚ะพ ั‚ะตัั‚ะพะฒะฐั ัะฑะพั€ะบะฐ ะดะปั ัƒัั‚ั€ะพะนัั‚ะฒ ะฑะตะท Snapdragon: ะพั„ะธั†ะธะฐะปัŒะฝั‹ะต ัะฑะพั€ะบะธ ะทะดะตััŒ ั€ะฐะฑะพั‚ะฐัŽั‚ ั‚ะพะปัŒะบะพ ะฝะฐ Adreno, ะฟะพัั‚ะพะผัƒ ะพะฝะธ ะฝะต ัƒัั‚ะฐะฝะฐะฒะปะธะฒะฐัŽั‚ัั ะฟะพะฒะตั€ั… ะฝะตั‘. ะะพะฒั‹ะต ั‚ะตัั‚ะพะฒั‹ะต ัะฑะพั€ะบะธ ะดะพัั‚ัƒะฟะฝั‹ ะฝะฐ github.com/The412Banner/droiddeck-nonadreno-drivers. + ะŸะพัะปะตะดะฝะธะน ัะตะฐะฝั ะทะฐะฒะตั€ัˆะธะปัั ะฟะพั‚ะพะผัƒ, ั‡ั‚ะพ Android ะทะฐะบั€ั‹ะป DroidDeck, ั‡ั‚ะพะฑั‹ ะพัะฒะพะฑะพะดะธั‚ัŒ ะฟะฐะผัั‚ัŒ; ัั‚ะพ ะฝะต ัะฑะพะน. ะ—ะฐะบั€ะพะนั‚ะต ะดั€ัƒะณะธะต ะฟั€ะธะปะพะถะตะฝะธั ะธะปะธ ัะฝะธะทัŒั‚ะต ะฝะฐัั‚ั€ะพะนะบะธ ะบะฐั‡ะตัั‚ะฒะฐ ั‚ะตะบัั‚ัƒั€ ะฒ ะธะณั€ะต, ะทะฐั‚ะตะผ ะฟะพะฟั€ะพะฑัƒะนั‚ะต ัะฝะพะฒะฐ. + Mali (Venus) + ะผะพัั‚ Mali + ะะธ ะพะดะธะฝ ะพั‚ะบั€ั‹ั‚ั‹ะน ะดั€ะฐะนะฒะตั€ ะฟะพะบะฐ ะฝะต ะฟะพะดะดะตั€ะถะธะฒะฐะตั‚ ัั‚ะพั‚ Mali: ะธัะฟะพะปัŒะทัƒะตั‚ัั %1$s ะฟะพะฒะตั€ั… ัะพะฑัั‚ะฒะตะฝะฝะพะณะพ ะดั€ะฐะนะฒะตั€ะฐ ั‚ะตะปะตั„ะพะฝะฐ. + %1$s ะตั‰ั‘ ะฝะต ะพะฟัƒะฑะปะธะบะพะฒะฐะฝ: ะดะพ ะฟัƒะฑะปะธะบะฐั†ะธะธ ะธัะฟะพะปัŒะทัƒะตั‚ัั %2$s. + %1$s ะฝะตะดะพัั‚ัƒะฟะตะฝ, ะฐ ะดั€ะฐะนะฒะตั€ ัั‚ะพะณะพ ั‚ะตะปะตั„ะพะฝะฐ ัะพะพะฑั‰ะฐะตั‚ ะฒะตั€ัะธัŽ Vulkan %2$s (ะดะปั Venus ะฝัƒะถะตะฝ Vulkan 1.2): ะธัะฟะพะปัŒะทัƒะตั‚ัั ะผะพัั‚ Mali. + %1$s ะตั‰ั‘ ะฝะต ะพะฟัƒะฑะปะธะบะพะฒะฐะฝ: ะผะพัั‚ Mali ะฒะบะปัŽั‡ั‘ะฝ ะดะพ ะตะณะพ ะฟัƒะฑะปะธะบะฐั†ะธะธ. + ะ’ ะพั‡ะตั€ะตะดะธ: %1$s (ะพะถะธะดะฐะตั‚ ะดั€ัƒะณะพะน ะดั€ะฐะนะฒะตั€ ัั€ะตะดั‹ ะฒั‹ะฟะพะปะฝะตะฝะธั) + DXVK ะฟั€ะตะดะพัั‚ะฐะฒะปัะตั‚ัั ัะธัั‚ะตะผะฝะพะน ัั€ะตะดะพะน ะฒั‹ะฟะพะปะฝะตะฝะธั PowerVR. ะ”ั€ัƒะณะธะต ะฟะฐะบะตั‚ั‹ DXVK ะผะพะถะฝะพ ั…ั€ะฐะฝะธั‚ัŒ, ะฝะพ ะฟั€ะธ ะธัะฟะพะปัŒะทะพะฒะฐะฝะธะธ ัั‚ะพะณะพ ะดั€ะฐะนะฒะตั€ะฐ ะพะฝะธ ะฝะต ะฟั€ะธะผะตะฝััŽั‚ัั. ะŸะพะดะดะตั€ะถะธะฒะฐะตั‚ัั ะญะบัะฟะตั€ะธะผะตะฝั‚ะฐะปัŒะฝะพ: ะตะณะพ ะดั€ะฐะนะฒะตั€ั‹ โ€” ั‚ะตัั‚ะพะฒั‹ะต ัะฑะพั€ะบะธ ะญะบัะฟะตั€ะธะผะตะฝั‚ะฐะปัŒะฝะฐั ะฟะพะดะดะตั€ะถะบะฐ Adreno 850: ั‚ั€ะตะฑัƒัŽั‚ัั ัะพะฒะผะตัั‚ะธะผั‹ะต ัะบัะฟะตั€ะธะผะตะฝั‚ะฐะปัŒะฝั‹ะต ะดั€ะฐะนะฒะตั€ั‹ ะดะธัะฟะปะตั ะธ ะธะณั€; ะฝะต ะฟั€ะพะฒะตั€ะตะฝะพ ะฝะฐ ัั‚ะพะผ ัƒัั‚ั€ะพะนัั‚ะฒะต @@ -2322,7 +2532,6 @@ ะœะฐะณะฐะทะธะฝั‹ Steam ะกะฒะพะธ - ะœะฐะณะฐะทะธะฝั‹ ะฃั€ะพะฒะตะฝัŒ ัะบะพั€ะพัั‚ะธ ะทะฐะณั€ัƒะทะบะธ ะกะฑะฐะปะฐะฝัะธั€ะพะฒะฐะฝะฝั‹ะน ะ‘ั‹ัั‚ั€ั‹ะน @@ -2361,6 +2570,7 @@ ะžะถะธะดะฐะฝะธะต ะดั€ัƒะณะพะน ะทะฐะณั€ัƒะทะบะธ Battle.netโ€ฆ ะžั‚ะบั€ะพะนั‚ะต Battle.net ะธ ะฒะพะนะดะธั‚ะต ะพะดะธะฝ ั€ะฐะท, ะทะฐั‚ะตะผ ัƒัั‚ะฐะฝะฐะฒะปะธะฒะฐะนั‚ะต ะตะณะพ ะธะณั€ั‹ ะทะดะตััŒ. ะ—ะฐะณั€ัƒะทั‡ะธะบ Blizzard ะพัั‚ะฐะฝะพะฒะธะปัั: %1$s + ะ—ะฐะณั€ัƒะทั‡ะธะบ Blizzard ะฟะตั€ะตัั‚ะฐะป ะฟั€ะพะดะฒะธะณะฐั‚ัŒัั. ะžัˆะธะฑะบะฐ Blizzard %1$s ะžะฑะฝะพะฒะธั‚ัŒ ะ˜ะณั€ั‹ Blizzard @@ -2368,6 +2578,7 @@ ะŸั€ะตั€ะฒะฐะฝะพ ะฃัั‚ะฐะฝะพะฒะธั‚ัŒ ยท %1$s ะŸะพะปัƒั‡ะธั‚ัŒ ะฑะตัะฟะปะฐั‚ะฝะพ + ะ”ะพะฑะฐะฒะปะตะฝะธะต ะฒ ะฑะธะฑะปะธะพั‚ะตะบัƒโ€ฆ ะžั‚ะบั€ั‹ั‚ัŒ ะฒ %1$s ะšัƒะฟะธั‚ัŒ ยท %1$s ะฃัั‚ะฐะฝะพะฒะปะตะฝะพ @@ -2414,6 +2625,12 @@ ะกะพั€ั‚ะธั€ะพะฒะบะฐ ะŸะพะดะฟะธัะธ ะฑะพะบะพะฒะพะน ะฟะฐะฝะตะปะธ ะŸะพะบะฐะทั‹ะฒะฐั‚ัŒ ะฝะฐะทะฒะฐะฝะธั ะฟะพะด ะทะฝะฐั‡ะบะฐะผะธ ะฑะพะบะพะฒะพะน ะฟะฐะฝะตะปะธ. ะžั‚ะบะปัŽั‡ะธั‚ะต, ั‡ั‚ะพะฑั‹ ัะดะตะปะฐั‚ัŒ ะฟะฐะฝะตะปัŒ ัƒะถะต. + ะŸะธั‚ะพะผะตั† ะฐะณะตะฝั‚ะฐ + DeeDee ะพั‚ะพะฑั€ะฐะถะฐะตั‚ัั ะฟะพะฒะตั€ั… ะปะฐัƒะฝั‡ะตั€ะฐ ะธ ะธะณั€ ะธ ะฟะพะบะฐะทั‹ะฒะฐะตั‚, ั‡ั‚ะพ ะดะตะปะฐะตั‚ ะฐะณะตะฝั‚. + ะŸะพะฒะตั€ั… ะดั€ัƒะณะธั… ะฟั€ะธะปะพะถะตะฝะธะน + ะ ะฐะทั€ะตัˆะธั‚ัŒ DeeDee ะพั‚ะพะฑั€ะฐะถะฐั‚ัŒัั ะฟะพะฒะตั€ั… ะฒัะตั… ะฟั€ะธะปะพะถะตะฝะธะน ะธ ะพั‚ะบั€ั‹ะฒะฐั‚ัŒ ั‚ะฐะผ ั‡ะฐั‚ ั DeeDee + ะ ะฐะทั€ะตัˆะธั‚ัŒ + ะงะฐั‚ ั DeeDee ะ’ะธะด ะšั€ัƒะฟะฝั‹ะต ะบะฐั€ั‚ะพั‡ะบะธ ะœะตะปะบะธะต ะบะฐั€ั‚ะพั‡ะบะธ @@ -2699,7 +2916,14 @@ %1$s ยท ะฝัƒะถะตะฝ ะฟะตั€ะตะทะฐะฟัƒัะบ ะญั‚ะพ ัƒัั‚ั€ะพะนัั‚ะฒะพ ะฃะดะฐะปะธั‚ัŒ %1$s? - ะ”ะธะฐะณะฝะพัั‚ะธะบะฐ + ะ ะฐะทั€ะฐะฑะพั‚ั‡ะธะบ + ะ’ะพะดัะฝะพะน ะทะฝะฐะบ ั ะผะตั‚ะบะพะน ัะฑะพั€ะบะธ + ะŸะพะบะฐะทั‹ะฒะฐั‚ัŒ ะฝะฐ ัะบั€ะฐะฝะต ะผะตั‚ะบัƒ ั‚ะตัั‚ะพะฒะพะน ัะฑะพั€ะบะธ ะธะปะธ ัะฑะพั€ะบะธ Lab. ะ’ะบะปัŽั‡ะตะฝะพ ะฟะพ ัƒะผะพะปั‡ะฐะฝะธัŽ. + ะŸะพะดะตะปะธั‚ัŒัั ะฝะฐะฑะพั€ะฐะผะธ ะดะธะฐะณะฝะพัั‚ะธะบะธ + ะกะตะฐะฝั ะธ ัƒัั‚ั€ะพะนัั‚ะฒะพ + ะ“ั€ะฐั„ะธะบะฐ + ะ˜ะณั€ั‹ ะธ ัะพะฒะผะตัั‚ะธะผะพัั‚ัŒ + ะ’ัะต ะฝะฐะฑะพั€ั‹ ะ“ะพั‚ะพะฒะพ ะบ ะธะณั€ะต ะŸะพะบะฐ ะฝะต ะณะพั‚ะพะฒะพ ะบ ะธะณั€ะต ัั€ะตะดะฐ ะฒั‹ะฟะพะปะฝะตะฝะธั %1$s @@ -2738,6 +2962,9 @@ ะ’ะบะปัŽั‡ะธั‚ะต ะดะพัั‚ะธะถะตะฝะธั GOG ะฒ ะฝะฐัั‚ั€ะพะนะบะฐั… ะผะฐะณะฐะทะธะฝะพะฒ ะ”ะพัั‚ะธะถะตะฝะธั ะฝะตะดะพัั‚ัƒะฟะฝั‹; ะฟั€ะพะฒะตั€ัŒั‚ะต ะถัƒั€ะฝะฐะปั‹ ัะตััะธะธ ะ”ะพัั‚ะธะถะตะฝะธะต ะพั‚ะบั€ั‹ั‚ะพ + Mali (Venus): ะพั‚ะบะปัŽั‡ะตะฝะพ + Mali (Venus): ะฒะบะปัŽั‡ะตะฝะพ + ะ”ั€ะฐะนะฒะตั€ ะฝะฐ %1$s ัะพะพะฑั‰ะฐะตั‚ ะฒะตั€ัะธัŽ Vulkan %2$s. ะ”ะปั Mali (Venus) ะฝัƒะถะตะฝ Vulkan 1.2 ะธะปะธ ะฝะพะฒะตะต (ะฝะฐ ะฑะพะปะตะต ัั‚ะฐั€ั‹ั… ะฒะตั€ัะธัั… gamescope ะฝะต ะทะฐะฟัƒัะบะฐะตั‚ัั), ะฟะพัั‚ะพะผัƒ Venus ะฒ ัะตะฐะฝัะฐั… ะฝะต ะธัะฟะพะปัŒะทัƒะตั‚ัั: ะฒะผะตัั‚ะพ ัั‚ะพะณะพ ะฟั€ะธะผะตะฝัะตั‚ัั ะฟะฐั€ะฐ ะดั€ะฐะนะฒะตั€ะพะฒ PanVK. ะ’ัั‚ะฐะฒะธั‚ัŒ ะ›ะตะฒั‹ะน ัั‚ะธะบ ะŸั€ะฐะฒั‹ะน ัั‚ะธะบ @@ -3031,7 +3258,7 @@ ะ’ั‹ะฑั€ะฐั‚ัŒ ะฟะฐะฟะบัƒโ€ฆ ะ›ัŽะฑะฐั ะฟะฐะฟะบะฐ ะฝะฐ SD-ะบะฐั€ั‚ะต ะธะปะธ USB-ะฝะฐะบะพะฟะธั‚ะตะปะต ะ˜ะณั€ั‹ ะฟะพะผะตั‰ะฐัŽั‚ัั ะฒ ะฟะฐะฟะบัƒ Games ะฒ ะฒั‹ะฑั€ะฐะฝะฝะพะผ ะผะตัั‚ะต. ะฃัั‚ะฐะฝะพะฒะปะตะฝะฝั‹ะต ะธะณั€ั‹ ะฝะต ะฟะตั€ะตะผะตั‰ะฐัŽั‚ัั. - ะšัƒะดะฐ ัƒั…ะพะดะธั‚ + ะงั‚ะพ ะทะฐะฝะธะผะฐะตั‚ ะผะตัั‚ะพ ะ˜ะณั€ั‹ Steam ะ”ะฐะฝะฝั‹ะต ะธะณั€ ะŸั€ะตั„ะธะบัั‹ %1$s ยท ะผะฐัั‚ะตั€ัะบะฐั %2$s ยท ัˆะตะนะดะตั€ั‹ %3$s @@ -3100,6 +3327,7 @@ ะฃัั‚ะฐะฝะพะฒั‰ะธะบะธ VC++ ะธ DirectX, ะบะพั‚ะพั€ั‹ะต ั‚ั€ะตะฑัƒัŽั‚ ะธะณั€ั‹ ะ—ะฐะฟัƒัะบะฐะตั‚ ะธะณั€ั‹ Linux x86 ะ˜ะฝัั‚ั€ัƒะผะตะฝั‚ Steam + Steam ะทะฐะณั€ัƒะถะฐะตั‚ ัั‚ะพั‚ ะบะพะผะฟะพะฝะตะฝั‚ ะดะปั ะธะณั€ ั ะฐะฝั‚ะธั‡ะธั‚ะพะผ, ะดะฐะถะต ะตัะปะธ ะพะฝ ะพั‚ะบะปัŽั‡ั‘ะฝ. ะ•ัะปะธ ะตะณะพ ัƒะดะฐะปะธั‚ัŒ, ัƒัั‚ะฐะฝะพะฒะบะฐ ัั‚ะธั… ะธะณั€ ะทะฐะฒะธัะฝะตั‚ ะฝะฐ 0% DroidDeck ะทะฐะฟัƒัะบะฐะตั‚ ะธะณั€ั‹ ะฑะตะท ัั‚ะพะน ัั€ะตะดั‹ ะฒั‹ะฟะพะปะฝะตะฝะธั Proton x86, ะบะพั‚ะพั€ั‹ะน DroidDeck ะฝะต ะผะพะถะตั‚ ะทะฐะฟัƒัั‚ะธั‚ัŒ ะŸะพ ัƒะผะพะปั‡ะฐะฝะธัŽ ะดะปั ะฒัะตั… ะธะณั€ @@ -3177,6 +3405,19 @@ ะกะพั…ั€ะฐะฝั‘ะฝะฝั‹ะต ะ˜ะณั€ั‹ ะฝะต ะธะท Steam ะธ ะพะฑั‰ะธะน ะฟั€ะตั„ะธะบั Steam ะŸั€ะตั„ะธะบัั‹ ะธะณั€, ะดะพะฑะฐะฒะปะตะฝะฝั‹ั… ะผะฐะณะฐะทะธะฝะฐะผะธ ะธะปะธ ะฒั€ัƒั‡ะฝัƒัŽ + ะžะฑั‰ะธะน ะฟั€ะตั„ะธะบั Steam + Steam ะทะฐะฟัƒัะบะฐะตั‚ ะทะดะตััŒ ัะฒะพะธ ะฒัะฟะพะผะพะณะฐั‚ะตะปัŒะฝั‹ะต ะฟั€ะพะณั€ะฐะผะผั‹ Windows + ะฃะดะฐะปัะตั‚ ะตะณะพ (%1$s). Steam ัะพะทะดะฐัั‚ ะฝะพะฒั‹ะน, ะบะพะณะดะฐ ะพะฝ ัะฝะพะฒะฐ ะฟะพะฝะฐะดะพะฑะธั‚ัั. + ะŸั€ะธะปะพะถะตะฝะธะต ะผะฐะณะฐะทะธะฝะฐ ะธ ะธะณั€ั‹, ะบะพั‚ะพั€ั‹ะต ั ะฝะธะผ ั€ะฐะฑะพั‚ะฐัŽั‚ + ะ˜ัะฟะพะปัŒะทัƒะตั‚ัั: %1$s + ะ˜ะณั€ะฐ ะฝะต ะธะท Steam %1$s + ะะต ัะพะฟะพัั‚ะฐะฒะปะตะฝ ั ะธะณั€ะพะน, ะฟะพัั‚ะพะผัƒ ัะพั…ั€ะฐะฝัะตั‚ัั + ะฃะดะฐะปะธั‚ัŒ ะฒั‹ะฑั€ะฐะฝะฝั‹ะต ยท %1$s + ะฃะดะฐะปะธั‚ัŒ ะฒั‹ะฑั€ะฐะฝะฝั‹ะต ยท %1$s + ะŸั€ะตั„ะธะบัั‹ Wine + ะกะพั…ั€ะฐะฝะตะฝะธั ะธ ะฝะฐัั‚ั€ะพะนะบะธ ะฒ ะฝะธั… ะฑัƒะดัƒั‚ ะฟะพั‚ะตั€ัะฝั‹; ัะพั…ั€ะฐะฝะตะฝะธั Steam Cloud ะพัั‚ะฐัŽั‚ัั ะฒ ะฒะฐัˆะตะผ ะฐะบะบะฐัƒะฝั‚ะต. + ะšััˆะธ ัˆะตะนะดะตั€ะพะฒ + ะŸั€ะตั„ะธะบั %1$s ยท ัˆะตะนะดะตั€ั‹ %2$s ะ—ะฐะณั€ัƒะถะตะฝะฝั‹ะต ะฟะฐะบะตั‚ั‹ ะกะพั…ั€ะฐะฝั‘ะฝะฝั‹ะต ะพั€ะธะณะธะฝะฐะปั‹ ะŸะฐะบะตั‚ั‹ ะบะพะผะฟะพะฝะตะฝั‚ะพะฒ ะฝะต ะทะฐะณั€ัƒะถะตะฝั‹. @@ -3215,6 +3456,8 @@ DroidDeck ยท %1$d ะบะฐะดั€/ั 60 ะบะฐะดั€/ั ะฒั‹ะณะปัะดะธั‚ ะฟะปะฐะฒะฝะตะต, ะฝะพ ัะธะปัŒะฝะตะต ะฝะฐะณั€ัƒะถะฐะตั‚ ะฟั€ะพั†ะตััะพั€ ะฟั€ะธ ะทะฐะฟัƒัะบะต Steam. ะ’ะธะดะตะพ, ะฒั‹ะฑั€ะฐะฝะฝะพะต ะฒ ะฝะฐัั‚ั€ะพะนะบะฐั… ัะฐะผะพะณะพ Steam, ั‚ะพะถะต ะฟะพัะฒะปัะตั‚ัั ะทะดะตััŒ. ะ—ะฒัƒะบ + ะŸั€ะพะฟัƒัะบะฐั‚ัŒ ัั‚ะฐั€ั‚ะพะฒะพะต ะฒะธะดะตะพ + ะ˜ัะฟะพะปัŒะทะพะฒะฐั‚ัŒ 0,1-ัะตะบัƒะฝะดะฝั‹ะน ั‡ั‘ั€ะฝั‹ะน ะบะปะธะฟ ะฒ ะบะฐั‡ะตัั‚ะฒะต ัั‚ะฐั€ั‚ะพะฒะพะณะพ ะฒะธะดะตะพ Steam. ะŸั€ะธะผะตะฝะธั‚ัั ะฒ ัะปะตะดัƒัŽั‰ะตะผ ัะตะฐะฝัะต. ะกะฒะพั‘ ะฒะธะดะตะพ MP4, MOV, MKV ะธะปะธ WebM. ะ”ั€ัƒะณะธะต ั„ะพั€ะผะฐั‚ั‹ ะธ ั„ะฐะนะปั‹ ะฑะพะปัŒัˆะต %1$d ะœะ‘ ะฟั€ะตะพะฑั€ะฐะทัƒัŽั‚ัั ะฝะฐ ัƒัั‚ั€ะพะนัั‚ะฒะต ะฒ WebM 720p, ะดะพ %2$d ัะตะบัƒะฝะด. ะ˜ะผะฟะพั€ั‚ @@ -3676,6 +3919,7 @@ ะžัั‚ะฐะฒะปัะตั‚ Alt+Tab, ะบะปะฐะฒะธัˆัƒ Win ะธ ะบะฝะพะฟะบัƒ ยซะ”ะพะผะพะนยป ะฒ ะฐะบั‚ะธะฒะฝะพะผ ัะตะฐะฝัะต DroidDeck, ะฐ ะฝะต ะฒ Android. ะ’ะบะปัŽั‡ะธั‚ะต ยซะฏั€ะบะพัั‚ัŒยป ะฒ ยซะะฐัั‚ั€ะพะนะบะฐ โ†’ ะ˜ะฝั‚ะตะณั€ะฐั†ะธั ัะพ Steamยป ะœะพัั‚ Mali: ะฒั‹ะบะป. + %1$s ะฝะต ะผะพะถะตั‚ ะธัะฟะพะปัŒะทะพะฒะฐั‚ัŒ ะผะพัั‚ Mali (ะดะปั ะฝะตะณะพ ะฝัƒะถะตะฝ GPU Mali ะฑะตะท ะผะฐั€ัˆั€ัƒั‚ะฐ ั‡ะตั€ะตะท ัะธัั‚ะตะผะฝั‹ะน ะดั€ะฐะนะฒะตั€), ะฟะพัั‚ะพะผัƒ ัั‚ะพั‚ ะฟะตั€ะตะบะปัŽั‡ะฐั‚ะตะปัŒ ะทะดะตััŒ ะฝะธ ะฝะฐ ั‡ั‚ะพ ะฝะต ะฒะปะธัะตั‚. ะœะพัั‚ Mali: ะฒะบะป. %1$s โ€” ะฝะต Adreno. ะ’ะบะปัŽั‡ั‘ะฝ ัะบัะฟะตั€ะธะผะตะฝั‚ะฐะปัŒะฝั‹ะน ะผะพัั‚ Vulkan: ัะตะฐะฝั ั€ะธััƒะตั‚ ั‡ะตั€ะตะท ัะพะฑัั‚ะฒะตะฝะฝั‹ะน ะดั€ะฐะนะฒะตั€ ั‚ะตะปะตั„ะพะฝะฐ. ะ’ะพะทะผะพะถะฝั‹ ะพัˆะธะฑะบะธ; ะพั‚ะฟั€ะฐะฒัŒั‚ะต ะถัƒั€ะฝะฐะปั‹ ัะตะฐะฝัะฐ. ะ‘ะตะทะพะฟะฐัะฝั‹ะน ั€ะตะถะธะผ @@ -3701,6 +3945,25 @@ ะŸะตั€ะตะผะตัั‚ะธั‚ัŒ ะฟะพะทะถะต ะะฐัั‚ั€ะพะนะบะธ ะฒะธะดะถะตั‚ะฐ ะฃะดะฐะปะธั‚ัŒ ะฒะธะดะถะตั‚ + ะ’ะฝะตัˆะฝะธะน ะฒะธะด + ะะฐะฑะพั€ ะธะบะพะฝะพะบ + ะšะฐะบ ะฒ ัะธัั‚ะตะผะต + ะคะพะฝ ั†ะฒะตั‚ะฐ ะฟั€ะธะปะพะถะตะฝะธั + ะ ะฐะทะผะตั€ ะธะบะพะฝะพะบ + ะœะตะปะบะธะต + ะกั€ะตะดะฝะธะต + ะšั€ัƒะฟะฝั‹ะต + ะกะบั€ั‹ั‚ัŒ ะฝะฐะทะฒะฐะฝะธั ะฟั€ะธะปะพะถะตะฝะธะน + ะžั‚ัั‚ัƒะฟั‹ + ะฃะทะบะพ + ะกั€ะตะดะฝะต + ะจะธั€ะพะบะพ + ะกะผะตะฝะธั‚ัŒ ะธะบะพะฝะบัƒ + ะกะฑั€ะพัะธั‚ัŒ ะธะบะพะฝะบัƒ + ะŸะพะธัะบ ะธะบะพะฝะพะบ + ะ—ะฐะณั€ัƒะทะบะฐ ะธะบะพะฝะพะบโ€ฆ + ะ˜ะบะพะฝะบะธ ะฝะต ะฝะฐะนะดะตะฝั‹. + ะกะฒะพะธ ะธะบะพะฝะบะธ ะ”ะพะฑะฐะฒะธั‚ัŒ ะฒ ะฟะฐะฟะบัƒ ะะพะฒะฐั ะฟะฐะฟะบะฐ ะฃะฑั€ะฐั‚ัŒ ะธะท ะฟะฐะฟะบะธ @@ -3818,5 +4081,81 @@ ะะต ัƒะดะฐะปะพััŒ ะธะผะฟะพั€ั‚ะธั€ะพะฒะฐั‚ัŒ ัั‚ัƒ ั€ะฐัะบะปะฐะดะบัƒ ะะปั‹ะน ัะฝะตะณ + ะ‘ะตะปั‹ะต ะฟะพะฒะตั€ั…ะฝะพัั‚ะธ ั ะบั€ะฐัะฝั‹ะผะธ ะฐะบั†ะตะฝั‚ะฐะผะธ. + ะกะฐัƒะฝะดั‚ั€ะตะบะธ + ะœัƒะทั‹ะบะฐ + ะŸะฐั€ะฐะผะตั‚ั€ั‹ ะฒะพัะฟั€ะพะธะทะฒะตะดะตะฝะธั + ะ˜ะทะฑั€ะฐะฝะฝะพะต + ะšะพะปะปะตะบั†ะธะธ + ะšะพะปะปะตะบั†ะธะน ะฟะพะบะฐ ะฝะตั‚. ะะฐะถะผะธั‚ะต ะฝะฐ ะทะฝะฐั‡ะพะบ ะทะฐะบะปะฐะดะบะธ, ั‡ั‚ะพะฑั‹ ัะพะทะดะฐั‚ัŒ ะตั‘. + ะกะพั…ั€ะฐะฝะตะฝะพ + ะกะพะทะดะฐั‚ัŒ ะบะพะปะปะตะบั†ะธัŽ + ะฃะฟะพั€ัะดะพั‡ะธั‚ะต ัะพั…ั€ะฐะฝั‘ะฝะฝะพะต + ะะพะฒะฐั + ะกะพะทะดะฐั‚ัŒ + ะะฐะทะฒะฐะฝะธะต ะบะพะปะปะตะบั†ะธะธ + ะ’ะฒะตะดะธั‚ะต ะฝะฐะทะฒะฐะฝะธะต, ะบะพั‚ะพั€ะพะต ะฝะต ะธัะฟะพะปัŒะทัƒะตั‚ัั ะฒ ะดั€ัƒะณะพะน ะบะพะปะปะตะบั†ะธะธ + ะฃะฟั€ะฐะฒะปะตะฝะธะต + ะŸะตั€ะตะธะผะตะฝะพะฒะฐั‚ัŒ + ะ”ะพะฑะฐะฒะธั‚ัŒ ั‚ั€ะตะบะธ + ะ”ะพะฑะฐะฒะธั‚ัŒ (%1$d) + ะฃะฑั€ะฐั‚ัŒ ั‚ั€ะตะบะธ + ะฃะดะฐะปะธั‚ัŒ ะบะพะปะปะตะบั†ะธัŽ + ะฃะดะฐะปะธั‚ัŒ %1$s? + ะขั€ะตะบะธ ะพัั‚ะฐะฝัƒั‚ัั ะฝะฐ ัƒัั‚ั€ะพะนัั‚ะฒะต. ะ‘ัƒะดะตั‚ ัƒะดะฐะปะตะฝะฐ ั‚ะพะปัŒะบะพ ะบะพะปะปะตะบั†ะธั. + ะ’ั‹ะฑั€ะฐั‚ัŒ + ะ’ั‹ะฑั€ะฐั‚ัŒ ะฒัะต + ะกะฝัั‚ัŒ ะฒั‹ะฑะพั€ + ะ’ั‹ะฑั€ะฐะฝะพ: %1$d + ะ”ะพะฑะฐะฒะธั‚ัŒ ะฒ ะบะพะปะปะตะบั†ะธัŽ + ะ”ะพะฑะฐะฒะธั‚ัŒ ะฒ ะธะทะฑั€ะฐะฝะฝะพะต + ะฃะฑั€ะฐั‚ัŒ ะธะท ะบะพะปะปะตะบั†ะธะธ + ะŸะพะธัะบ ั‚ั€ะตะบะพะฒ + ะŸะพั€ัะดะพะบ ะฒ ะฐะปัŒะฑะพะผะต + ะกะฝะฐั‡ะฐะปะฐ ะดะปะธะฝะฝั‹ะต + ะกะฝะฐั‡ะฐะปะฐ ะบะพั€ะพั‚ะบะธะต + ะขั€ะตะบะธ + ะ’ั‹ัะพั‚ะฐ ั‚ะพะฝะฐ + ะกะฑั€ะพัะธั‚ัŒ + ะŸั€ะพะฟัƒัะบะฐั‚ัŒ ั‚ะธัˆะธะฝัƒ + ะขะฐะนะผะตั€ ัะฝะฐ + %1$d ะผะธะฝ + ะšะพะฝะตั† ั‚ั€ะตะบะฐ + ะžัั‚ะฐะปะพััŒ %1$s + ะญะบะฒะฐะปะฐะนะทะตั€ + ะฃัะธะปะตะฝะธะต ะฑะฐัะฐ + ะญะบะฒะฐะปะฐะนะทะตั€ ะฝะตะดะพัั‚ัƒะฟะตะฝ ะฝะฐ ัั‚ะพะผ ัƒัั‚ั€ะพะนัั‚ะฒะต + ะ’ะบะปัŽั‡ะธั‚ัŒ ะฒ ะธะณั€ะต + ะŸั€ะพะดะพะปะถะฐั‚ัŒ ะฒะพัะฟั€ะพะธะทะฒะตะดะตะฝะธะต ัะฐัƒะฝะดั‚ั€ะตะบะฐ ะฒะพ ะฒั€ะตะผั ะธะณั€ั‹ + ะกะฐัƒะฝะดั‚ั€ะตะบะธ ะตั‰ั‘ ะฝะต ัƒัั‚ะฐะฝะพะฒะปะตะฝั‹. + ะŸะพะธัะบ ัะฐัƒะฝะดั‚ั€ะตะบะพะฒ + ะ”ะพะฑะฐะฒะธั‚ัŒ ะฟะฐะฟะบัƒ ัะฐัƒะฝะดั‚ั€ะตะบะฐ + ะ’ ัั‚ะพะน ะฟะฐะฟะบะต ะฝะตั‚ ะฐัƒะดะธะพั„ะฐะนะปะพะฒ + ะžะฑั‰ะฐั ะดะปะธั‚ะตะปัŒะฝะพัั‚ัŒ + ะขั€ะตะบะพะฒ: %1$d / %2$s + ะ”ะธัะบ %1$s + ะŸะตั€ะตะผะตัˆะฐั‚ัŒ + ะะฐะทะฐะด + ะ’ะพัะฟั€ะพะธะทะฒะตัั‚ะธ + ะŸะฐัƒะทะฐ + ะ”ะฐะปะตะต + ะŸะพะฒั‚ะพั€ ะฒั‹ะบะปัŽั‡ะตะฝ + ะŸะพะฒั‚ะพั€ัั‚ัŒ ะฒัั‘ + ะŸะพะฒั‚ะพั€ัั‚ัŒ ะพะดะธะฝ + ะ“ั€ะพะผะบะพัั‚ัŒ + ะ’ ัั‚ะพะผ ัะฐัƒะฝะดั‚ั€ะตะบะต ะฝะตั‚ ะฐัƒะดะธะพั„ะฐะนะปะพะฒ + ะ—ะฐะฟัƒัะบ ะฝะตะดะพัั‚ัƒะฟะตะฝ + ะะตั‚ ะดะพัั‚ัƒะฟะฝะพะณะพ ะฒะตะฑ-ะฑั€ะฐัƒะทะตั€ะฐ ะดะปั ะพั‚ะบั€ั‹ั‚ะธั ัั‚ะพะน ััั‹ะปะบะธ. + ะ’ะทัั‚ัŒ + ะžั‚ะฟัƒัั‚ะธั‚ัŒ + ะกะพั…ั€ะฐะฝะธั‚ัŒ + ะฃะดะตั€ะถะธะฒะฐะนั‚ะต ะดะปั ัะฑั€ะพัะฐ + ะœะฐะณะฐะทะธะฝั‹ + ะ’ั€ะตะผั ะบะฐะดั€ะฐ + ะกั€ะตะดะฝัั ั‡ะฐัั‚ะพั‚ะฐ ะบะฐะดั€ะพะฒ + ะกะตั€ะฒะตั€ ะฒั‹ะฒะพะดะฐ + ะกะพัั‚ะพัะฝะธะต HDR + ะŸะพะบะฐะทะฐะฝะพ + %1$d ะธะท %2$d diff --git a/app/src/main/res/values-sv/input_library.xml b/app/src/main/res/values-sv/input_library.xml new file mode 100644 index 0000000000..dfe4102366 --- /dev/null +++ b/app/src/main/res/values-sv/input_library.xml @@ -0,0 +1,132 @@ + + + Olรคsbara inmatningsinstรคllningar bevarades i en รฅterstรคllningskopia. Du kan fortsรคtta redigera de รฅterstรคllda profilerna. + Egenskaper + Klickegenskaper + %1$s ยท Klick + Knappar + Spakar, plattor och avtryckare + Dรถlj verktyg + Handkontroll + Skicka handkontrollens inmatning till Steam Input eller spelet. + Det hรคr elementet skickar ingen inmatning frรฅn handkontroll, mus eller tangentbord. + Musklick + DroidDeck-รฅtgรคrd + ร…tgรคrd + Rullningshastighet: %1$d steg/s + + Ny profil + + Ny layout + %1$s ยท Anvรคnds av %2$d profiler. ร„ndringar gรคller alla profiler som anvรคnder dessa tilldelningar. + Byt namn + Ta bort + Lรคgg till element i layouten innan du tilldelar deras รฅtgรคrder. + Kunde inte spara inmatningsinstรคllningarna + Namn + Bรถrja frรฅn + Knapp + Spak + Styrplatta + Styrkors + Avtryckare + Klar + ร…ngra + + Lรคgg till + Dra fรถr att flytta. Dra i ett hรถrn fรถr att รคndra storlek. Tryck pรฅ Egenskaper fรถr att tilldela en รฅtgรคrd. + Redigeras pรฅ sekundรคrskรคrmen + Den valda skรคrmen รคr inte tillgรคnglig. Anslut den fรถr att redigera layouten i full storlek. + Kassera osparade layoutรคndringar? + Den hรคr layouten anvรคnds av %1$d profiler. Sparade รคndringar gรคller alla. + Standardprofiler + Skrivbordslรคge + Spellรคge + Standard fรถr skrivbord och spel + Standard fรถr spellรคge + Standard fรถr skrivbordslรคge + Enhetsinstรคllningar + Styrning + Knappar, spakar, avtryckare och extra tangenter + Kopiera profil + ร…terstรคll รฅtgรคrder + ร…terstรคll รฅtgรคrderna i %1$s till basprofilens standardvรคrden? Layouter och andra profiler fรถrblir ofรถrรคndrade. + Ta bort %1$s? Lรคgen som anvรคnder den รฅtergรฅr till sin inbyggda standardprofil. Sparade layouter och delade instรคllningar finns kvar. + Synlighet + Gรคller alla profiler. Auto visar huvudskรคrmens styrning nรคr ingen handkontroll รคr ansluten i spellรคge. + Redigera pรฅ skรคrmen + Sparade layouterโ€ฆ + Vรคlj en layout eller skapa din egen + Vรคlj Profilstyrning i sekundรคrskรคrmens sessionsmeny. Valen Profil och Sekundรคr skรคrm i handkontrollsmenyn avgรถr vilken styrning som visas. + Knappรฅtgรคrder + Delad med %1$s. ร„ndringar gรคller รคven dessa profiler. + ร…teranvรคnd instรคllningar + Anvรคnd instรคllningar frรฅnโ€ฆ + Kopiera frรฅn en annan profil eller behรฅll instรคllningarna delade + Gรถr oberoende + Behรฅll nuvarande uppsรคttning och sluta dela รคndringar + Layouter sparar element och deras positioner. Varje profil kan tilldela egna รฅtgรคrder. Redigera i full storlek pรฅ mรฅlskรคrmen. + Aktuell layout + Ta bort den oanvรคnda layouten %1$s och dess sparade รฅtgรคrder? + Byt namn pรฅ aktuell layout + ร…teranvรคnd %1$s frรฅn en annan profil. De andra styrkรคllorna fรถrblir ofรถrรคndrade. + Behรฅll fysisk styrning delad + Som standard รคr alla styrningar och anpassade layouter oberoende kopior. Delning lรคnkar bara den fysiska styrningen. + Anvรคnd dessa element och positioner. Delning hรฅller framtida geometriรคndringar synkroniserade; dina knappรฅtgรคrder fรถrblir oberoende. En annan layout bรถrjar med otilldelade รฅtgรคrder. + Kopiera dessa styrningar och รฅtgรคrder, eller lรคnka dem sรฅ att framtida รคndringar gรคller bรฅda profilerna. + Behรฅll delad + Oberoende kopia + Starta spaken vid berรถringspunkten + Dรถlj spaken nรคr den inte anvรคnds + Verktyg + Auto (%1$s) + Anpassad (%1$s) + Spara som ny profil + Profilstyrning + Profil + Musstyrplattesgester + Nรคr tilldelad muspekaren: tryck fรถr att klicka, hรฅll fรถr att dra och rulla med tvรฅ fingrar. + %1$s har en รฅsidosรคttning av snabbmenyn. Vรคlj Auto dรคr fรถr att anvรคnda standardprofilen och alla tre sparade delarna. + DroidDeck-inmatning + Hรฅlls medan spaken rรถrs i valfri riktning: tryck รถver 55 %, slรคpp under 35 %. Anvรคnd Riktningstangenter fรถr att tilldela varje riktning separat. DroidDeck-kommandon kรถrs en gรฅng per utslag. Spakens klick konfigureras separat. + Hรฅlls medan du rรถr styrplattan; slรคpps nรคr du lyfter fingret. DroidDeck-kommandon kรถrs en gรฅng per berรถring. Styrplattans klick konfigureras separat. + Hรฅlls nรคr avtryckaren passerar 55 %; slรคpps under 35 %. DroidDeck-kommandon kรถrs en gรฅng per tryck. + Rullningsriktning + Lodrรคtt + Vรฅgrรคtt + Rulla vรฅgrรคtt + Mรคtningar + Slรฅ pรฅ inspelning, anvรคnd styrningen i en pรฅgรฅende session och kom tillbaka och lรคs resultaten. Mรคter bara DroidDecks sรคndningstid, inte skรคrmfรถrdrรถjning. Inspelningen avslutas nรคr appens process stรคngs. + %1$d styrningar + Andra sparade layouter (%1$d) โ–พ + Dรถlj andra sparade layouter (%1$d) โ–ด + Hem / Guide + Tillbaka ยท enkel tryckning + Tillbaka ยท dubbeltryck + Tillbaka ยท tvรฅ gรฅnger i Steam, en gรฅng pรฅ skrivbordet + I Steam-lรคge. Att hรฅlla Tillbaka รถppnar รคven snabbรฅtkomst. + ร…terstรคll till standard + Ditt panelval kommer ihรฅg. Skrivbord รถppnar en andra arbetsyta; det byter inte sessionen eller dess inmatningsprofil. + Virtuell handkontroll + Den handkontrolltyp som Steam eller spelet ser. + Pekskรคrm + Hur berรถringar pรฅ spelskรคrmen hanteras. Profilknapparna behรฅller sina tilldelade รฅtgรคrder. + Pekmarkรถr + Visa en pekare fรถr direkta berรถringar pรฅ spelskรคrmen. + Tryck och hรฅll + Musรฅtgรคrd nรคr du hรฅller ett finger pรฅ spelskรคrmen. + Tryck pรฅ Tillbaka-knappen + Fรถrsta รฅtgรคrden: ett tryck. Andra รฅtgรคrden: dubbeltryck. + Vรคxlingsknapp + Tryck fรถr att hรฅlla, tryck igen fรถr att slรคppa. Att รถppna en meny eller byta profil slรคpper knappen. + Form + Rundad + Kapsel + Cirkel + Rektangel + Knappetikett + Text + Importerad bild + Separata diagonalknappar + Tilldela en tangent till varje diagonal. En tom diagonal trycker de tvรฅ angrรคnsande riktningarna. + Angrรคnsande riktningar + Dina gamla skรคrmtangenter รคr sparade som importerade profiler nedan. Vรคlj en fรถr att anvรคnda eller redigera den. Dina nuvarande profilval har behรฅllits. + De gamla skรคrmtangenterna kunde inte importeras automatiskt. De ursprungliga instรคllningarna har behรฅllits. + diff --git a/app/src/main/res/values-sv/input_strings.xml b/app/src/main/res/values-sv/input_strings.xml new file mode 100644 index 0000000000..ae79aa8645 --- /dev/null +++ b/app/src/main/res/values-sv/input_strings.xml @@ -0,0 +1,38 @@ + + + Inmatningsprofiler + Profiler + Fysisk handkontroll + Huvudskรคrm + Sekundรคr skรคrm + Inbyggd / Steam Input + Inbyggd: %1$s + Skicka en annan handkontrollsstyrning + Inaktiverad + Tangent eller tangentkombination + Riktningstangenter + Flytta pekaren + Pekarhastighet: %1$d + Rulla + Rulla lodrรคtt + Vรคnster musknapp + Hรถger musknapp + Mitten musknapp + ร–ppna DroidDeck-menyn + Visa tangentbord + ร–ppna Steam-menyn + ร–ppna Steams snabbรฅtkomst + Ta bort kontroll + Lรคgg till kontroll + Enhetsspecifika knappar + Tilldela en fysisk knapp + Slรคpp knappen och vรคlj Redigera, Fรถrsรถk igen eller Avbryt. B eller Tillbaka avbryter efter slรคpp. + Fรถrsรถk igen + Tryck pรฅ en knapp, รคven en Tillbaka-knapp som rapporteras som tangent. Volym- och Android-systemtangenter รคr reserverade. Tilldelningen gรคller bara den hรคr enheten. + Ta bort tilldelning + Indatadiagnostik + Spela in indatasรคndningstid + Lรคs mรคtningar + Mรคter sรคndningen frรฅn Android till publicering i den befintliga indatatransporten. Bluetoothankomst, gรคstpollning, rendering och skรคrmfรถrdrรถjning ingรฅr inte. Inspelning รคr av som standard. + Anvรคnd normal indatatilldelning + diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index c8a3088a00..427d722263 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -28,6 +28,8 @@ Pausa nu Stoppa sessionen Bildrutegenerering + Instรคllningar fรถr det hรคr spelet + Standardinstรคllningar Vรคlj lรคge fรถr bildrutegenerering Av DD-FG %1$dร— @@ -183,6 +185,7 @@ PowerVR-grafikmiljรถn kunde inte laddas ned. Kontrollera anslutningen och fรถrsรถk igen. Det gick inte att ladda ned DirectAudio, sรฅ spelljudet anvรคnder den lรฅngsammare vรคgen den hรคr sessionen. Det hรคr programmet + Sessionen kunde inte rita pรฅ skรคrmen: %1$s. Den hรคr skรคrmen visar orsaken i stรคllet fรถr att vara svart; detaljerna finns i sessionsloggarna. Det gick inte att ladda ned Steam-klienten. Ditt nรคtverk eller din VPN kanske blockerar Steams servrar; kontrollera anslutningen och fรถrsรถk igen. Det gick inte att konfigurera Steam-klienten. Kontrollera anslutningen och det lediga lagringsutrymmet och fรถrsรถk igen. %1$s รคr byggt fรถr x86-datorer och kรถrs via FEX, som inte รคr installerat รคn. Starta Steam en gรฅng medan du รคr inloggad och lรฅt det ladda ned FEX och Steam Linux Runtime. Starta sedan detta igen. @@ -385,6 +388,9 @@ Stรถds inte hรคr รคn Lรคser in komponenternaโ€ฆ Kunde inte installera: %1$s + Den hรคr nedladdningen behรถver en uppdatering. + Uppdatering i kรถ. + Fรถrsรถk uppdatera igen Nedladdad Laddar ned %1$s Installerar: %1$s @@ -415,6 +421,22 @@ Endast internt Mapp: %1$s Andra biblioteket + Fler Steam-bibliotek + Mappar som Steam kan installera till och spela frรฅn, var och en under sitt eget namn. Tar du bort en mapp finns spelen kvar pรฅ lagringen. + Lรคgg till bibliotek + Byt namn + Biblioteksnamn + Vรคlj en mapp fรถr biblioteket + Hรถgst %1$d tillagda bibliotek + Mappen รคr redan ett bibliotek eller ligger i ett + %1$s ยท inte tillgรคnglig + Gรคller frรฅn nรคsta Steam-session + Hittades pรฅ den hรคr enheten ยท %1$s ยท %2$s + Lรคgg till + Hitta bibliotek i den interna lagringen + Tillรฅt รฅtkomst till alla filer sรฅ att DroidDeck kan se Steam-bibliotek som andra appar sparar i den interna lagringen + Tillรฅt + Lade till %1$s, Steam-biblioteket i mappen du valde Spel som strรถmmar tillgรฅngar frรฅn SD-kortet eller delad lagring kan hacka. Lagringsdiagnostik Registrerar allokeringsresultat och uppmรคtta lagringstider i Dela loggar. Kan gรถra installationer lรฅngsammare medan funktionen รคr aktiverad. Gรคller frรฅn nรคsta session. @@ -478,6 +500,7 @@ Pรฅ Startar med Steam Startar utan Steam + Spelupplรถsning Instรคllningar Instรคllningar fรถr %1$s Standard @@ -565,6 +588,8 @@ Spelkรคrnor Spelkรคrnor Kรคrnor fรถr spel. Med alla valda schemalรคgger Android fritt. + Spara strรถm i stabila spel + Kรถr ett spel pรฅ de lรฅngsammare kรคrnorna medan det hรฅller en stabil bildfrekvens, och flyttar tillbaka det till sina vanliga kรคrnor nรคr det halkar efter. Klientgrรคnssnitt Trรฅdad GL Kan gรถra Steams menyer mer responsiva. @@ -600,7 +625,10 @@ Inaktiverar Protons hjรคlp fรถr handkontrollsnavigering, vilket kostar CPU i alla spel. Kรถr proot utan seccomp Kan รฅtgรคrda fel med saknade systemanrop pรฅ vissa Linux-kรคrnor. Kan minska prestandan. + Kรถr utan proot (experimentellt) + Startar Linux-delen direkt pรฅ Android. Gรคller nรคsta session. Stรคng av om nรฅgot inte startar. proot snabbvรคg + Anvรคnds inte utan proot. Krรคver proots seccomp-filter. Snabbare filuppslagningar och mindre hack. Stรคng av om ett program inte hittar sina filer. Rita markรถren i gamescope @@ -683,6 +711,7 @@ Grafikminne Vรคxlingsminne Batterinivรฅ + ร…terstรฅende batteritid Strรถmfรถrbrukning Nรคtverk Upplรถsning @@ -809,6 +838,7 @@ Enheten stรถds Otestad GPU GPU stรถds inte + GPU via Mali-bryggan %1$s ยท %2$s %1$s: %2$s Ingen kompatibel grafikbackend รคr tillgรคnglig fรถr %1$s. Steam kan visa en svart skรคrm. @@ -838,15 +868,38 @@ Session Sessionsloggar Sparas efter varje session + Utรถkad diagnostik fรถr nรคsta session + Samlar in detaljerade loggar under en session. Kan sรคnka prestandan och anvรคnda mer lagring. Stรคngs av automatiskt nรคr sessionen startar; granska loggarna innan du delar dem. Felsรถkningsloggar fรถr spel Ta med diagnostik fรถr Proton, Wine och grafik vid nรคsta spelstart. Kan sรคnka prestandan och anvรคnda mer lagringsutrymme. Starta om sessionen fรถr att spara felsรถkningsloggar fรถr spel Det gick inte att uppdatera loggningen. Kontrollera reglaget och fรถrsรถk igen. Felsรถkningsverktyg + Detaljerade grafikloggar + Steam-grรคnssnitt: GPU-ritning + Med Xclipse-drivrutinsparet ritar Steam sina sidor i mjukvara (GPU-ritning gav trasiga rutor). Slรฅ pรฅ fรถr ett snabbare Steam-grรคnssnitt om det ser rรคtt ut pรฅ den hรคr telefonen. + byggd %1$s + %1$s har uppdaterats till det senaste bygget + Mali-bryggan klarade inte sitt sjรคlvtest pรฅ %1$s under fรถrra sessionen (bilder eller ritningsanrop), sรฅ sessionen anvรคnde PanVK-drivrutinsparet i stรคllet. + Mali-bryggan hittade inget sรคtt att dela minne med drivrutinen pรฅ %1$s under fรถrra sessionen, sรฅ sessionen anvรคnde PanVK-drivrutinsparet i stรคllet. Bryggan kan inte fungera pรฅ den hรคr telefonen; med den avstรคngd behรฅlls PanVK-paret. + Varje spels Proton-, DXVK- och drivrutinsloggar ingรฅr i sessionens loggar. Alltid pรฅ nรคr GPU:n inte รคr en Adreno. Senaste sessionsloggar Sparade sessionsloggar Behรฅller de %1$d senaste Rensa loggar + Tillgรคngliga sessionsloggar + Inga sparade sessionsloggar รคnnu. + Delade och sparade ZIP-filer innehรฅller den valda sessionen samt relaterad Steam-, butiks-, verktygs- och Battle.net-diagnostik. + %1$s ยท %2$s + Aktuell session + Dela + Spara pรฅ enheten + Ta bort + Ta bort sessionsloggarna? + Ta bort %1$s? Det gรฅr inte att รฅngra. + Sessionsloggarna sparades. + Kunde inte spara sessionsloggarna. + Kunde inte ta bort sessionsloggarna. ร…terstรคll alla instรคllningar Sรคtt tillbaka varje instรคllning till standardvรคrdet ร…terstรคll @@ -873,6 +926,8 @@ Anvรคnd som startskรคrm DroidDeck kan vara startskรคrmsappen DroidDeck erbjuds aldrig som startskรคrmsapp + Hemknappen รถppnar + Sidan som visas nรคr DroidDeck รคr hemskรคrmsappen och du trycker pรฅ Hemknappen Under Lรคgg till spel stรคller du DroidDeck pรฅ Inkludera Orientering Launcherns orientering @@ -886,15 +941,22 @@ Helskรคrm Dรถljer Androids statusfรคlt och navigeringsfรคlt Visar Androids statusfรคlt och navigeringsfรคlt + Startprogram fรถr tvรฅ skรคrmar + Automatiskt: placerar startprogrammets avsnitt (Steam, Bibliotek, Butiker med flera) pรฅ den inbyggda andra skรคrmen pรฅ handhรฅllna enheter som har en. Pรฅ: anvรคnder vilken andra bildskรคrm som helst. Av: behรฅller startprogrammet pรฅ en skรคrm. + Sessioner med tvรฅ skรคrmar + Automatiskt: fรคster spelmenyn pรฅ den inbyggda andra skรคrmen i stรคllet fรถr att visa den som en popupmeny. Pรฅ: anvรคnder vilken andra bildskรคrm som helst. Av: behรฅller menyn pรฅ spelskรคrmen; du kan fortfarande vรคlja en andra skรคrm frรฅn menyn. Automatiskt Pรฅ Av Kontroller pรฅ nedre skรคrmen i spel + Android-tangentbord fรถr textfรคlt ร–ppnar styrplattan och tangentbordet pรฅ den andra skรคrmen nรคr en session startar. Skriver fรถr den รถvre skรคrmen Klar Standardapp fรถr startskรคrmen Vรคlj en app fรถr startskรคrmen + Dรถlj startprogrammet i Senaste nรคr det รคr inaktivt + Gรคller bara nรคr DroidDeck รคr standardappen fรถr hemskรคrmen och ingen session kรถrs. Vรคlj Linux-appar (beta) Filer @@ -1006,9 +1068,172 @@ Fรถrhandsversion De senaste fixarna, fรถre Stabil Senaste versionen + Kopiera bygguppgifter + Bygguppgifter kopierade + Fรถre Fรถrhandsversion + Du ligger fรถre Fรถrhandsversion + Det hรคr bygget รคr nyare รคn den senaste fรถrhandsversionen. Nรคsta fรถrhandsbygge uppdaterar det. + Vรคlj ett bygge fรถr att se รคndringarna eller installera det. + Installerat + Installera det hรคr bygget%1$s + Gรฅ tillbaka till det hรคr bygget%1$s + versionCode %1$d + Commit %1$s + Versionssida + PR:en har en nyare commit (%1$s). Dess testbygge รคr inte klart รคn, sรฅ det hรคr innehรฅller den inte. + Nyare commit, bygge vรคntar + PR-nummer, titel eller fรถrfattare + Inget testbygge matchar + Mรฅste byggas om (versionCode %1$d) + Uppdateringar av testbyggen + Nytt testbygge fรถr PR #%1$d + %1$s. ร–ppna Uppdateringar fรถr att installera det. + Visa fler (%1$d) + Mรฅste byggas om fรถr versionCode %2$d (%1$d) + Fรถrhandsbyggen pรฅ main sedan det hรคr testbygget: %1$d Testbyggen Prova en fix innan den slรคpps Inga just nu + Labbversion + Labbversioner + Anvรคnds + Pausad efter att Android optimerade om DroidDeck + Inte laddad: %1$s + Vรคntar pรฅ omstart + Behรฅllen + Fรถr en annan version + Bygg om + Tar bort den hรคr versionen frรฅn enheten + Starta om med den + Stรคng av + Anvรคnd + Ta bort + Ta bort nu + Kunde inte fรถrbereda omstarten: %1$s. Para ihop via trรฅdlรถs felsรถkning i Instรคllningar och fรถrsรถk igen. + Labbversion installerad + DroidDeck startades om med %1$s + Lab-bygget pausat + Android har optimerat om DroidDeck, sรฅ %1$s รคr inte inlรคst. ร–ppna Uppdateringar fรถr att starta om pรฅ det. + Lab-bygget avstรคngt + Det byggdes fรถr en annan version av DroidDeck. Det behรฅlls i Uppdateringar. + DroidDeck startade inte pรฅ det tvรฅ gรฅnger + Agent + Agent + Agenten arbetar + Installera Claude Code i Linux-anvรคndarmiljรถn fรถr att anvรคnda agenten. + Frรฅga om ett spel, en krasch eller en รคndring av DroidDeck + Skicka + Ny konversation + Stoppa + Lagring + Ta bort + Ta bort nu + Claude Code + Codex + DroidDeck-kรคllkod + Nedladdningscache + ร„ndringar som inte pushas gรฅr fรถrlorade + Byggen laddar ner dem igen + Installationen kan installera det igen; inloggningarna behรฅlls + DroidDeck startades om pรฅ ditt Lab-bygge. Fortsรคtt dรคr du slutade. + Frรฅga den varfรถr ett spel inte startar, be den fรถrklara en logg eller รคndra DroidDeck och testa รคndringen pรฅ den hรคr enheten. + Misslyckades: %1$s + %1$s avslutades (avslutskod %2$d) + Stoppad + Avslutades utan svar + Fรถrsรถk igen + Konfigurerar agenten + Bygg om mitt Lab-bygge %1$s fรถr den installerade versionen av DroidDeck och starta om pรฅ det. + %1$s in ยท %2$s ut + Tรคnker + Tanke + Tรคnker ยท %1$s + %1$s ยท %2$s + INDATA + UTDATA + Kรถrโ€ฆ + Inget resultat: omgรฅngen avslutades fรถrst + Ingen utdata + Skriv fรถr att kรถa nรคsta meddelande + Kรถa + Nรคsta: %1$s + Skicka inte + Bifoga + Ta bort + Standard + Resonemangsnivรฅ + Kรถr + Revidera + Inget har รคndrats รคnnu + Kรถr planen. + Skicka nu + Mer + Stรคng + Senaste + Arbetar + Kontext + %1$s av %2$s + Den hรคr konversationen ยท %1$s + Anvรคndningen visas efter fรถrsta svaret + %1$d-timmarsgrรคns + %1$d-minutersgrรคns + Veckogrรคns + %1$d%% ยท รฅterstรคlls %2$s + + %1$d fil + %1$d filer + + Planera fรถrst + Planera + Fรถreslรฅr en plan utan att รคndra nรฅgot + Konversationer + Inga konversationer รคnnu + Nyss + Ta bort + Tar bort den och dess bilagor + Processer + Inget kรถrs i Linux-anvรคndarutrymmet + AGENT + Stoppa + Lab-bygge + Fรถrbereder Lab-byggen + %1$d%% ยท cirka %2$s kvar + cirka %1$s kvar + Avbryt + Avbryt bygget + Startar + %1$d%% + Paketerar + Startar om DroidDeck pรฅ det + Klart + Misslyckades: %1$s + Stรคll in agenten + Installera Linux-kรถrmiljรถn i Instรคllningar fรถrst. + Fรถrsรถk igen + Bรถrja chatta + Enhetsanslutning + Trรฅdlรถs felsรถkning, sรฅ att agenten kan se och styra DroidDeck + Installera %1$s + In i Linux-miljรถn, med git, gh och adb + Logga in pรฅ %1$s + ร–ppnar din webblรคsare + GitHub + Valfritt, fรถr att รถppna pull requests + Byggverktyg + Valfritt, fรถr Lab-byggen pรฅ den hรคr enheten ยท cirka 5 GB + Agenten รคr redo + Slutfรถr konfigurationen av agenten + Inloggad pรฅ %1$s + Lab-byggen + snabba byggen + Snabba Lab-byggen + Kompilerar den hรคr versionen i fรถrvรคg, sรฅ att Lab-byggen tar minuter ยท cirka 20 minuter en gรฅng + Kompilerar ยท %1$d%% ยท cirka %2$s kvar + Fรถrbered + Trรฅdlรถs felsรถkning kan inte nรฅs; Para slรฅr pรฅ den + Para + Installera + Logga in PR #%1$d Inte byggd fรถr den hรคr kopian av DroidDeck Uppdaterad %1$s @@ -1248,6 +1473,9 @@ Appar Konfiguration Uppdateringar + Mer + Redigera flikar + Flikar %1$d %% ร…teruppta %1$s Visas som /root/ROMs i varje session. Det interna lagringsutrymmet finns pรฅ /root/Storage. @@ -1269,6 +1497,15 @@ Avbryt kรถn Android-tangentbord Dรถlj โœ• + Storlek pรฅ skรคrmen + Andel av skรคrmen som tangentbordet tar upp, inklusive toppfรคltet. + Opacitet + Sรคnk den fรถr att se spelet bakom tangentbordet. + Dolda tangenter + Tangenter du sรคllan anvรคnder hรฅlls borta frรฅn tangentbordet. + Raden med Esc och funktionstangenter + Ins / Del / Home / End / PgUp / PgDn + Piltangenter Starta %1$s Vรคlj en skรคrm. Sekundรคr: %1$s. Den sekundรคra skรคrmen รคr inte lรคngre tillgรคnglig. @@ -1770,7 +2007,24 @@ Terminal Deck-grepp + styrplattor ร–versikt + Skrivbord + Starta skrivbordet + Skrivbord ยท %1$s + Styrplatta + Direkt pekning + Styrplatta. Tryck fรถr direkt pekning + Direkt pekning. Tryck fรถr styrplatta + Startar KDE-skrivbordetโ€ฆ + Skrivbordet stรคngdes. + Skrivbordet kunde inte starta. Loggarna finns i mappen bottom-desktop fรถr den hรคr sessionen. + Skrivbordet รคr stรคngt. Inget att visa hรคr รคn. + Vรคxla skรคrmar + Den nedre skรคrmen รคr upptagen just nu + Spelskรคrm + Visa spelet pรฅ + ร–vre skรคrmen + Nedre skรคrmen Nedladdningar Inga nedladdningar pรฅgรฅr. Steam @@ -1805,6 +2059,20 @@ Brรคnsle, t Huvudtank %1$s t Reserv %1$s t + Bildrutetid + senaste %1$d s + snitt per bildruta + lรคgsta 1 % + bildrutor รถver 33 ms + %1$d / min + Spelat i %1$s + %1$d kรคrnor, upp till %2$s GHz + %1$d kรคrnor + spel + FPS vid %1$d Hz + Det rรถda mรคrket รคr dรคr HUD:en visar temperaturen i rรถtt. + hela enheten + batteri Skicka data till instrumentpanelen Automatiskt Slรฅr pรฅ det fรถr alla spel i listan, รคven spel som hittas senare. Spel som du stรคnger av fรถrblir avstรคngda. @@ -1828,6 +2096,10 @@ Mikrofonen รคr avstรคngd fรถr det hรคr spelet. Slรฅ pรฅ Mikrofon i DroidDecks Steam-instรคllningar (Ljud) och starta spelet igen fรถr att prata. Volym %1$d%% Statistik i spelet + HUD pรฅ nedre skรคrmen + Remsa pรฅ varje flik + lรคgsta 1 % och 0,1 % + CPU-temperatur FPS CPU GPU @@ -2000,6 +2272,7 @@ Startar sessionenโ€ฆ %1$d:%2$02d fรถrflutit ยท arbetar fortfarande Laddar ned uppdateringen av Steam-klienten ยท %1$d %% + Tillรคmpar uppdateringen av Steam-klientenโ€ฆ Laddar ned Steam-klienten ยท %1$s En installation av ett kompatibilitetsverktyg pรฅgรฅr redan @@ -2076,11 +2349,29 @@ Tecknade konturer plus skรคrpa. Inte en Adreno-GPU + System-PowerVR-drivrutin: kompatibiliteten varierar beroende pรฅ enhet + Experimentellt: RADV eller systemets Xclipse-drivrutin + System-PowerVR + Anvรคnder de inbyggda drivrutinerna fรถr den hรคr GPU:n + Systemets PowerVR-drivrutin รคr vald fรถr kรถrmiljรถn och skรคrmen. + Ingen รถppen drivrutin stรถder den hรคr Mali รคnnu: Mali-bryggan รคr pรฅ. + Detta รคr testbygget fรถr icke-Snapdragon: de officiella byggena hรคr fungerar bara pรฅ Adreno, sรฅ de installeras inte ovanpรฅ det. Nya testbyggen finns pรฅ github.com/The412Banner/droiddeck-nonadreno-drivers. + Den senaste sessionen avslutades eftersom Android stรคngde DroidDeck fรถr att frigรถra minne, inte pรฅ grund av en krasch. Stรคng andra appar eller sรคnk spelets texturinstรคllningar och fรถrsรถk igen. + Mali (Venus) + Mali-bryggan + Ingen รถppen drivrutin stรถder den hรคr Mali รคnnu: %1$s anvรคnds pรฅ telefonens egen drivrutin. + %1$s har รคnnu inte publicerats: %2$s anvรคnds tills dess. + %1$s รคr inte tillgรคnglig, och telefonens drivrutin rapporterar Vulkan %2$s (Venus krรคver 1.2): Mali-bryggan anvรคnds. + %1$s har รคnnu inte publicerats: Mali-bryggan รคr pรฅ tills dess. + I kรถ: %1$s (vรคntar pรฅ en annan drivrutin fรถr kรถrmiljรถn) + DXVK tillhandahรฅlls av systemets PowerVR-kรถrmiljรถ. Andra DXVK-paket kan lagras men tillรคmpas inte med den hรคr drivrutinen. Stรถds Experimentell: dess drivrutiner รคr testversioner Experimentellt stรถd fรถr Adreno 850: krรคver kompatibla experimentella skรคrm- och speldrivrutiner; inte verifierat pรฅ den hรคr enheten Under testad maskinvara (Adreno 725 och nyare): det kan hรคnda att det inte fungerar Stรถds inte: ingen kompatibel grafikbackend รคr tillgรคnglig fรถr denna GPU + Kรถrs via Mali-bryggan, pรฅ telefonens egen Vulkan-drivrutin + Stรถds inte nรคr Mali-bryggan รคr av: Turnip krรคver en Adreno-GPU (Snapdragon) GitHubs hastighetsgrรคns nรฅddes - fรถrsรถk igen senare GitHub svarade HTTP %1$d @@ -2189,7 +2480,6 @@ Butiker Steam Egna - Butiker Nedladdningshastighet Balanserad Snabb @@ -2228,6 +2518,7 @@ Vรคntar pรฅ den andra Battle.net-nedladdningenโ€ฆ ร–ppna Battle.net och logga in en gรฅng, installera sedan dess spel hรคr. Blizzards nedladdare stoppades: %1$s + Blizzards nedladdare slutade gรถra framsteg. Blizzard-fel %1$s Uppdatera Blizzard-spel @@ -2235,6 +2526,7 @@ Avbruten Installation ยท %1$s Hรคmta gratis + Lรคgger till i biblioteket โ€ฆ Visa pรฅ %1$s Kรถp ยท %1$s Installerat @@ -2281,6 +2573,12 @@ Sortera Sidofรคltets etiketter Visa namn under ikonerna i sidofรคltet. Stรคng av fรถr ett smalare sidofรคlt. + Agentens husdjur + DeeDee svรคvar รถver startprogrammet och spel och visar vad agenten gรถr. + ร–ver andra appar + Lรฅt DeeDee svรคva รถver alla appar och รถppna chatten dรคr + Tillรฅt + Chatta med DeeDee Visning Stรถrre kort Mindre kort @@ -2565,7 +2863,14 @@ %1$s ยท krรคver omstart Den hรคr enheten Ta bort %1$s? - Diagnostik + Utvecklare + Vattenstรคmpel med byggetikett + Visa testbyggets eller Lab-byggets etikett pรฅ skรคrmen. Aktiverad som standard. + Dela diagnostikpaket + Session och enhet + Grafik + Spel och kompatibilitet + Alla paket Redo att spela Inte redo att spela รคn runtime %1$s @@ -2604,6 +2909,9 @@ Aktivera GOG-prestationer i butiksinstรคllningarna Prestationer inte tillgรคngliga; kontrollera sessionsloggarna Prestation upplรฅst + Mali (Venus): av + Mali (Venus): pรฅ + Drivrutinen pรฅ %1$s rapporterar Vulkan %2$s. Mali (Venus) krรคver Vulkan 1.2 eller senare (gamescope startar inte pรฅ รคldre), sรฅ sessionerna hoppar รถver Venus och anvรคnder PanVK-drivrutinsparet i stรคllet. Klistra in Vรคnster styrspak Hรถger styrspak @@ -2890,7 +3198,7 @@ Vรคlj mappโ€ฆ Anvรคnd valfri mapp pรฅ ett SD-kort eller USB-minne Spel hamnar i en Games-mapp pรฅ den valda platsen. Befintliga spel flyttas inte. - Vart det tar vรคgen + Vad som tar plats Steam-spel Speldata Prefix %1$s ยท workshop %2$s ยท shaders %3$s @@ -2959,6 +3267,7 @@ VC++- och DirectX-installationer som spel behรถver Kรถr Linux x86-spel Steam-verktyg + Steam laddar ner detta fรถr spel som levereras med anti-cheat, รคven nรคr det รคr avstรคngt. Tar du bort det fastnar deras installation pรฅ 0 % DroidDeck kรถr spel utan den hรคr kรถrmiljรถn Proton x86, som DroidDeck inte kan kรถra Standard fรถr alla spel @@ -3022,6 +3331,19 @@ Behรฅlls Icke-Steam-spel och delat Steam-prefix Prefix fรถr spel som lagts till via butiker eller manuellt + Steams delade prefix + Steam kรถr sina egna Windows-hjรคlpprogram hรคr + Raderar det (%1$s). Steam skapar ett nytt nรคsta gรฅng det behรถvs. + En butiksapp och spelen som kรถrs med den + Anvรคnds av %1$s + Icke-Steam-spel %1$s + Inte kopplat till nรฅgot spel, sรฅ det behรฅlls + Ta bort valda ยท %1$s + Avinstallera valda ยท %1$s + Wine-prefix + Sparningar och instรคllningar i dem gรฅr fรถrlorade; Steam Cloud-sparningar finns kvar pรฅ ditt konto. + Shadercacheminnen + Prefix %1$s ยท shaders %2$s Hรคmtade paket Behรฅllna original Inga komponentpaket hรคmtade. @@ -3056,6 +3378,8 @@ DroidDeck ยท %1$d fps 60 fps ser jรคmnare ut men anvรคnder mer CPU medan Steam startar. En video vald i Steams egna instรคllningar visas ocksรฅ hรคr. Ljud + Hoppa รถver uppstartsfilmen + Anvรคnd ett svart klipp pรฅ 0,1 sekunder som uppstartsfilm fรถr Steam. Tillรคmpas nรคsta session. Egen video MP4, MOV, MKV eller WebM. Andra format och filer รถver %1$d MB konverteras till 720p-WebM pรฅ enheten, upp till %2$d sekunder. Importera @@ -3517,6 +3841,7 @@ Hรฅller Alt+Tab, Win-tangenten och Hem-knappen i en aktiv DroidDeck-session i stรคllet fรถr Android. Slรฅ pรฅ Ljusstyrka under Konfiguration โ†’ Steam-integration Mali-brygga: av + %1$s kan inte anvรคnda Mali-bryggan (den krรคver en Mali-GPU utan en vรคg via systemdrivrutinen), sรฅ det hรคr reglaget har ingen effekt hรคr. Mali-brygga: pรฅ %1$s รคr inte en Adreno. Den experimentella Vulkan-bryggan รคr pรฅ: sessionen ritar via telefonens egen drivrutin. Rรคkna med buggar; skicka sessionsloggarna. Sรคkert lรคge @@ -3542,6 +3867,25 @@ Flytta senare Widgetinstรคllningar Ta bort widget + Utseende + Ikonpaket + Systemstandard + Bakgrund i appens fรคrg + Ikonstorlek + Liten + Mellan + Stor + Dรถlj appnamn + Avstรฅnd + Tรคtt + Normalt + Luftigt + ร„ndra ikon + ร…terstรคll ikon + Sรถk ikoner + Lรคser in ikonerโ€ฆ + Inga ikoner hittades. + Anpassade ikoner Lรคgg till i mapp Ny mapp Ta bort frรฅn mapp @@ -3657,5 +4001,81 @@ Det gick inte att importera layouten Scharlakansrรถd snรถ + Vita ytor med rรถda accenter. + Soundtracks + Musik + Uppspelningsalternativ + Favoriter + Samlingar + Inga samlingar รคn. Tryck pรฅ bokmรคrkesikonen fรถr att skapa en. + Sparade + Skapa en samling + Organisera dina sparade spรฅr + Ny + Skapa + Samlingens namn + Ange ett namn som ingen annan samling anvรคnder + Hantera + Byt namn + Lรคgg till spรฅr + Lรคgg till (%1$d) + Ta bort spรฅr + Ta bort samling + Ta bort %1$s? + Spรฅren finns kvar pรฅ din enhet. Bara samlingen tas bort. + Vรคlj + Vรคlj alla + Avmarkera alla + %1$d valda + Lรคgg till i samling + Lรคgg till i favoriter + Ta bort frรฅn samling + Sรถk spรฅr + Albumordning + Lรคngst fรถrst + Kortast fรถrst + Spรฅr + Tonhรถjd + ร…terstรคll + Hoppa รถver tystnad + Insomningstimer + %1$d min + Slutet av spรฅret + %1$s kvar + Equalizer + Basfรถrstรคrkning + Equalizern รคr inte tillgรคnglig pรฅ den hรคr enheten + Aktivera i spel + Fortsรคtt spela soundtracket medan ett spel kรถrs + Inga soundtracks installerade รคn. + Sรถk bland soundtracks + Lรคgg till en soundtrackmapp + Inga ljudfiler i den mappen + Total lรคngd + %1$d spรฅr / %2$s + Skiva %1$s + Blanda + Fรถregรฅende + Spela + Pausa + Nรคsta + Upprepning av + Upprepa alla + Upprepa ett + Volym + Inga ljudfiler i detta soundtrack + Kan inte starta + Ingen webblรคsare รคr tillgรคnglig fรถr att รถppna den hรคr lรคnken. + Greppa + Slรคpp + Spara + Hรฅll fรถr att รฅterstรคlla + Butiker + Bildtid + Genomsnittlig bildfrekvens + Visningsserver + HDR-status + Visade + %1$d av %2$d diff --git a/app/src/main/res/values-th/input_library.xml b/app/src/main/res/values-th/input_library.xml new file mode 100644 index 0000000000..944a4aaa79 --- /dev/null +++ b/app/src/main/res/values-th/input_library.xml @@ -0,0 +1,132 @@ + + + เธเธฒเธฃเธ•เธฑเน‰เธ‡เธ„เนˆเธฒเธญเธดเธ™เธžเธธเธ•เธ—เธตเนˆเธญเนˆเธฒเธ™เน„เธกเนˆเน„เธ”เน‰เธ–เธนเธเน€เธเน‡เธšเน„เธงเน‰เนƒเธ™เธชเธณเน€เธ™เธฒเธเธนเน‰เธ„เธทเธ™ เธ„เธธเธ“เธขเธฑเธ‡เนเธเน‰เน„เธ‚เน‚เธ›เธฃเน„เธŸเธฅเนŒเธ—เธตเนˆเธเธนเน‰เธ„เธทเธ™เน„เธ”เน‰ + เธ„เธธเธ“เธชเธกเธšเธฑเธ•เธด + เธ„เธธเธ“เธชเธกเธšเธฑเธ•เธดเธเธฒเธฃเธ„เธฅเธดเธ + %1$s ยท เธ„เธฅเธดเธ + เธ›เธธเนˆเธก + เธเน‰เธฒเธ™ เนเธžเธ” เนเธฅเธฐเน„เธ + เธ‹เนˆเธญเธ™เน€เธ„เธฃเธทเนˆเธญเธ‡เธกเธทเธญ + เธ„เธญเธ™เน‚เธ—เธฃเธฅเน€เธฅเธญเธฃเนŒ + เธชเนˆเธ‡เธญเธดเธ™เธžเธธเธ•เธ„เธญเธ™เน‚เธ—เธฃเธฅเน€เธฅเธญเธฃเนŒเน„เธ›เธขเธฑเธ‡ Steam Input เธซเธฃเธทเธญเน€เธเธก + เธญเธ‡เธ„เนŒเธ›เธฃเธฐเธเธญเธšเธ™เธตเน‰เน„เธกเนˆเธชเนˆเธ‡เธญเธดเธ™เธžเธธเธ•เธ„เธญเธ™เน‚เธ—เธฃเธฅเน€เธฅเธญเธฃเนŒ เน€เธกเธฒเธชเนŒ เธซเธฃเธทเธญเธ„เธตเธขเนŒเธšเธญเธฃเนŒเธ” + เธ„เธฅเธดเธเน€เธกเธฒเธชเนŒ + เธเธฒเธฃเธ—เธณเธ‡เธฒเธ™เธ‚เธญเธ‡ DroidDeck + เธเธฒเธฃเธ—เธณเธ‡เธฒเธ™ + เธ„เธงเธฒเธกเน€เธฃเน‡เธงเธเธฒเธฃเน€เธฅเธทเนˆเธญเธ™: %1$d เธ‚เธฑเน‰เธ™/เธงเธดเธ™เธฒเธ—เธต + + เน‚เธ›เธฃเน„เธŸเธฅเนŒเนƒเธซเธกเนˆ + + เน€เธฅเธขเนŒเน€เธญเธฒเธ•เนŒเนƒเธซเธกเนˆ + %1$s ยท เนƒเธŠเน‰เน‚เธ”เธข %2$d เน‚เธ›เธฃเน„เธŸเธฅเนŒ เธเธฒเธฃเน€เธ›เธฅเธตเนˆเธขเธ™เนเธ›เธฅเธ‡เธกเธตเธœเธฅเธเธฑเธšเธ—เธธเธเน‚เธ›เธฃเน„เธŸเธฅเนŒเธ—เธตเนˆเนƒเธŠเน‰เธเธฒเธฃเธเธณเธซเธ™เธ”เธ™เธตเน‰ + เน€เธ›เธฅเธตเนˆเธขเธ™เธŠเธทเนˆเธญ + เธฅเธš + เน€เธžเธดเนˆเธกเธญเธ‡เธ„เนŒเธ›เธฃเธฐเธเธญเธšเนƒเธ™เน€เธฅเธขเนŒเน€เธญเธฒเธ•เนŒเธเนˆเธญเธ™เธเธณเธซเธ™เธ”เธเธฒเธฃเธ—เธณเธ‡เธฒเธ™ + เธšเธฑเธ™เธ—เธถเธเธเธฒเธฃเธ•เธฑเน‰เธ‡เธ„เนˆเธฒเธญเธดเธ™เธžเธธเธ•เน„เธกเนˆเน„เธ”เน‰ + เธŠเธทเนˆเธญ + เน€เธฃเธดเนˆเธกเธˆเธฒเธ + เธ›เธธเนˆเธก + เธเน‰เธฒเธ™ + เธ—เธฑเธŠเนเธžเธ” + D-pad + เน„เธ + เน€เธชเธฃเน‡เธˆ + เน€เธฅเธดเธเธ—เธณ + + เน€เธžเธดเนˆเธก + เธฅเธฒเธเน€เธžเธทเนˆเธญเธขเน‰เธฒเธข เธฅเธฒเธเธกเธธเธกเน€เธžเธทเนˆเธญเธ›เธฃเธฑเธšเธ‚เธ™เธฒเธ” เนเธ•เธฐเธ„เธธเธ“เธชเธกเธšเธฑเธ•เธดเน€เธžเธทเนˆเธญเธเธณเธซเธ™เธ”เธเธฒเธฃเธ—เธณเธ‡เธฒเธ™ + เธเธณเธฅเธฑเธ‡เนเธเน‰เน„เธ‚เธšเธ™เธซเธ™เน‰เธฒเธˆเธญเธฃเธญเธ‡ + เน„เธกเนˆเธกเธตเธซเธ™เน‰เธฒเธˆเธญเธ—เธตเนˆเน€เธฅเธทเธญเธ เน€เธŠเธทเนˆเธญเธกเธ•เนˆเธญเน€เธžเธทเนˆเธญเนเธเน‰เน„เธ‚เน€เธฅเธขเนŒเน€เธญเธฒเธ•เนŒเธ™เธตเน‰เธ—เธตเนˆเธ‚เธ™เธฒเธ”เธˆเธฃเธดเธ‡ + เธ—เธดเน‰เธ‡เธเธฒเธฃเน€เธ›เธฅเธตเนˆเธขเธ™เนเธ›เธฅเธ‡เน€เธฅเธขเนŒเน€เธญเธฒเธ•เนŒเธ—เธตเนˆเธขเธฑเธ‡เน„เธกเนˆเธšเธฑเธ™เธ—เธถเธเธซเธฃเธทเธญเน„เธกเนˆ + เน€เธฅเธขเนŒเน€เธญเธฒเธ•เนŒเธ™เธตเน‰เนƒเธŠเน‰เน‚เธ”เธข %1$d เน‚เธ›เธฃเน„เธŸเธฅเนŒ เธเธฒเธฃเน€เธ›เธฅเธตเนˆเธขเธ™เนเธ›เธฅเธ‡เธ—เธตเนˆเธšเธฑเธ™เธ—เธถเธเธกเธตเธœเธฅเธเธฑเธšเธ—เธฑเน‰เธ‡เธซเธกเธ” + เน‚เธ›เธฃเน„เธŸเธฅเนŒเน€เธฃเธดเนˆเธกเธ•เน‰เธ™ + เน‚เธซเธกเธ”เน€เธ”เธชเธเนŒเธ—เน‡เธญเธ› + เน‚เธซเธกเธ”เน€เธเธก + เธ„เนˆเธฒเน€เธฃเธดเนˆเธกเธ•เน‰เธ™เธชเธณเธซเธฃเธฑเธšเน€เธ”เธชเธเนŒเธ—เน‡เธญเธ›เนเธฅเธฐเน€เธเธก + เธ„เนˆเธฒเน€เธฃเธดเนˆเธกเธ•เน‰เธ™เธชเธณเธซเธฃเธฑเธšเน‚เธซเธกเธ”เน€เธเธก + เธ„เนˆเธฒเน€เธฃเธดเนˆเธกเธ•เน‰เธ™เธชเธณเธซเธฃเธฑเธšเน‚เธซเธกเธ”เน€เธ”เธชเธเนŒเธ—เน‡เธญเธ› + เธเธฒเธฃเธ•เธฑเน‰เธ‡เธ„เนˆเธฒเธญเธธเธ›เธเธฃเธ“เนŒ + เธเธฒเธฃเธ„เธงเธšเธ„เธธเธก + เธ›เธธเนˆเธก เธเน‰เธฒเธ™ เน„เธ เนเธฅเธฐเธ›เธธเนˆเธกเน€เธžเธดเนˆเธกเน€เธ•เธดเธก + เธ„เธฑเธ”เธฅเธญเธเน‚เธ›เธฃเน„เธŸเธฅเนŒ + เธฃเธตเน€เธ‹เน‡เธ•เธเธฒเธฃเธ—เธณเธ‡เธฒเธ™ + เธฃเธตเน€เธ‹เน‡เธ•เธเธฒเธฃเธ—เธณเธ‡เธฒเธ™เนƒเธ™ %1$s เน€เธ›เน‡เธ™เธ„เนˆเธฒเน€เธฃเธดเนˆเธกเธ•เน‰เธ™เธ‚เธญเธ‡เน‚เธ›เธฃเน„เธŸเธฅเนŒเธเธฒเธ™เธซเธฃเธทเธญเน„เธกเนˆ เน€เธฅเธขเนŒเน€เธญเธฒเธ•เนŒเนเธฅเธฐเน‚เธ›เธฃเน„เธŸเธฅเนŒเธญเธทเนˆเธ™เธˆเธฐเน„เธกเนˆเน€เธ›เธฅเธตเนˆเธขเธ™ + เธฅเธš %1$s เธซเธฃเธทเธญเน„เธกเนˆ เน‚เธซเธกเธ”เธ—เธตเนˆเนƒเธŠเน‰เธˆเธฐเธเธฅเธฑเธšเน„เธ›เนƒเธŠเน‰เน‚เธ›เธฃเน„เธŸเธฅเนŒเน€เธฃเธดเนˆเธกเธ•เน‰เธ™เธ—เธตเนˆเธกเธตเธกเธฒเนƒเธซเน‰ เน€เธฅเธขเนŒเน€เธญเธฒเธ•เนŒเธ—เธตเนˆเธšเธฑเธ™เธ—เธถเธเนเธฅเธฐเธเธฒเธฃเธ•เธฑเน‰เธ‡เธ„เนˆเธฒเธ—เธตเนˆเนเธŠเธฃเนŒเธขเธฑเธ‡เนƒเธŠเน‰เน„เธ”เน‰ + เธเธฒเธฃเธกเธญเธ‡เน€เธซเน‡เธ™ + เธกเธตเธœเธฅเธเธฑเธšเธ—เธธเธเน‚เธ›เธฃเน„เธŸเธฅเนŒ Auto เธˆเธฐเนเธชเธ”เธ‡เธเธฒเธฃเธ„เธงเธšเธ„เธธเธกเธซเธ™เน‰เธฒเธˆเธญเธซเธฅเธฑเธเน€เธกเธทเนˆเธญเน„เธกเนˆเน„เธ”เน‰เน€เธŠเธทเนˆเธญเธกเธ•เนˆเธญเธ„เธญเธ™เน‚เธ—เธฃเธฅเน€เธฅเธญเธฃเนŒเนƒเธ™เน‚เธซเธกเธ”เน€เธเธก + เนเธเน‰เน„เธ‚เธšเธ™เธซเธ™เน‰เธฒเธˆเธญ + เน€เธฅเธขเนŒเน€เธญเธฒเธ•เนŒเธ—เธตเนˆเธšเธฑเธ™เธ—เธถเธโ€ฆ + เน€เธฅเธทเธญเธเน€เธฅเธขเนŒเน€เธญเธฒเธ•เนŒเธซเธฃเธทเธญเธชเธฃเน‰เธฒเธ‡เธ‚เธญเธ‡เธ„เธธเธ“เน€เธญเธ‡ + เน€เธฅเธทเธญเธเธเธฒเธฃเธ„เธงเธšเธ„เธธเธกเน‚เธ›เธฃเน„เธŸเธฅเนŒเนƒเธ™เน€เธกเธ™เธนเน€เธ‹เธชเธŠเธฑเธ™เธ‚เธญเธ‡เธซเธ™เน‰เธฒเธˆเธญเธฃเธญเธ‡ เธ•เธฑเธงเน€เธฅเธทเธญเธเน‚เธ›เธฃเน„เธŸเธฅเนŒเนเธฅเธฐเธซเธ™เน‰เธฒเธˆเธญเธฃเธญเธ‡เนƒเธ™เน€เธกเธ™เธนเธ„เธญเธ™เน‚เธ—เธฃเธฅเน€เธฅเธญเธฃเนŒเธเธณเธซเธ™เธ”เธงเนˆเธฒเธˆเธฐเนเธชเธ”เธ‡เธเธฒเธฃเธ„เธงเธšเธ„เธธเธกเนƒเธ” + เธเธฒเธฃเธ—เธณเธ‡เธฒเธ™เธ‚เธญเธ‡เธ›เธธเนˆเธก + เนเธŠเธฃเนŒเธเธฑเธš %1$s เธเธฒเธฃเนเธเน‰เน„เธ‚เธกเธตเธœเธฅเธเธฑเธšเน‚เธ›เธฃเน„เธŸเธฅเนŒเน€เธซเธฅเนˆเธฒเธ™เธฑเน‰เธ™เธ”เน‰เธงเธข + เนƒเธŠเน‰เธเธฒเธฃเธ•เธฑเน‰เธ‡เธ„เนˆเธฒเธ‹เน‰เธณ + เนƒเธŠเน‰เธเธฒเธฃเธ•เธฑเน‰เธ‡เธ„เนˆเธฒเธˆเธฒเธโ€ฆ + เธ„เธฑเธ”เธฅเธญเธเธˆเธฒเธเน‚เธ›เธฃเน„เธŸเธฅเนŒเธญเธทเนˆเธ™เธซเธฃเธทเธญเน€เธเน‡เธšเธเธฒเธฃเธ•เธฑเน‰เธ‡เธ„เนˆเธฒเน„เธงเน‰เนเธŠเธฃเนŒ + เธ—เธณเนƒเธซเน‰เน€เธ›เน‡เธ™เธญเธดเธชเธฃเธฐ + เน€เธเน‡เธšเธเธฒเธฃเธ•เธฑเน‰เธ‡เธ„เนˆเธฒเธ›เธฑเธˆเธˆเธธเธšเธฑเธ™เนเธฅเธฐเธซเธขเธธเธ”เนเธŠเธฃเนŒเธเธฒเธฃเน€เธ›เธฅเธตเนˆเธขเธ™เนเธ›เธฅเธ‡ + เน€เธฅเธขเนŒเน€เธญเธฒเธ•เนŒเน€เธเน‡เธšเธญเธ‡เธ„เนŒเธ›เธฃเธฐเธเธญเธšเนเธฅเธฐเธ•เธณเนเธซเธ™เนˆเธ‡ เนเธ•เนˆเธฅเธฐเน‚เธ›เธฃเน„เธŸเธฅเนŒเธเธณเธซเธ™เธ”เธเธฒเธฃเธ—เธณเธ‡เธฒเธ™เธ‚เธญเธ‡เธ•เธ™เน€เธญเธ‡เน„เธ”เน‰ เนเธเน‰เน„เธ‚เธ—เธตเนˆเธ‚เธ™เธฒเธ”เน€เธ•เน‡เธกเธšเธ™เธซเธ™เน‰เธฒเธˆเธญเน€เธ›เน‰เธฒเธซเธกเธฒเธข + เน€เธฅเธขเนŒเน€เธญเธฒเธ•เนŒเธ›เธฑเธˆเธˆเธธเธšเธฑเธ™ + เธฅเธšเน€เธฅเธขเนŒเน€เธญเธฒเธ•เนŒเธ—เธตเนˆเน„เธกเนˆเน„เธ”เน‰เนƒเธŠเน‰ %1$s เนเธฅเธฐเธเธฒเธฃเธ—เธณเธ‡เธฒเธ™เธ—เธตเนˆเธšเธฑเธ™เธ—เธถเธเน„เธงเน‰เธซเธฃเธทเธญเน„เธกเนˆ + เน€เธ›เธฅเธตเนˆเธขเธ™เธŠเธทเนˆเธญเน€เธฅเธขเนŒเน€เธญเธฒเธ•เนŒเธ›เธฑเธˆเธˆเธธเธšเธฑเธ™ + เนƒเธŠเน‰ %1$s เธ‹เน‰เธณเธˆเธฒเธเน‚เธ›เธฃเน„เธŸเธฅเนŒเธญเธทเนˆเธ™ เนเธซเธฅเนˆเธ‡เธ„เธงเธšเธ„เธธเธกเธญเธทเนˆเธ™เธˆเธฐเน„เธกเนˆเน€เธ›เธฅเธตเนˆเธขเธ™ + เน€เธเน‡เธšเธเธฒเธฃเธ„เธงเธšเธ„เธธเธกเธˆเธฃเธดเธ‡เน„เธงเน‰เนเธŠเธฃเนŒ + เน‚เธ”เธขเธ„เนˆเธฒเน€เธฃเธดเนˆเธกเธ•เน‰เธ™ เธเธฒเธฃเธ„เธงเธšเธ„เธธเธกเนเธฅเธฐเน€เธฅเธขเนŒเน€เธญเธฒเธ•เนŒเธ—เธตเนˆเธเธณเธซเธ™เธ”เน€เธญเธ‡เธ—เธฑเน‰เธ‡เธซเธกเธ”เน€เธ›เน‡เธ™เธชเธณเน€เธ™เธฒเธญเธดเธชเธฃเธฐ เธเธฒเธฃเนเธŠเธฃเนŒเธˆเธฐเน€เธŠเธทเนˆเธญเธกเน€เธ‰เธžเธฒเธฐเธเธฒเธฃเธ„เธงเธšเธ„เธธเธกเธˆเธฃเธดเธ‡ + เนƒเธŠเน‰เธญเธ‡เธ„เนŒเธ›เธฃเธฐเธเธญเธšเนเธฅเธฐเธ•เธณเนเธซเธ™เนˆเธ‡เน€เธซเธฅเนˆเธฒเธ™เธตเน‰ เธเธฒเธฃเนเธŠเธฃเนŒเธˆเธฐเธ—เธณเนƒเธซเน‰เธเธฒเธฃเนเธเน‰เน„เธ‚เน€เธฃเธ‚เธฒเธ„เธ“เธดเธ•เนƒเธ™เธญเธ™เธฒเธ„เธ•เธ‹เธดเธ‡เธเนŒเธเธฑเธ™ เธเธฒเธฃเธ—เธณเธ‡เธฒเธ™เธ‚เธญเธ‡เธ›เธธเนˆเธกเธขเธฑเธ‡เธ„เธ‡เน€เธ›เน‡เธ™เธญเธดเธชเธฃเธฐ เน€เธฅเธขเนŒเน€เธญเธฒเธ•เนŒเธญเธทเนˆเธ™เน€เธฃเธดเนˆเธกเธ•เน‰เธ™เธ”เน‰เธงเธขเธเธฒเธฃเธ—เธณเธ‡เธฒเธ™เธ—เธตเนˆเธขเธฑเธ‡เน„เธกเนˆเธเธณเธซเธ™เธ” + เธ„เธฑเธ”เธฅเธญเธเธเธฒเธฃเธ„เธงเธšเธ„เธธเธกเนเธฅเธฐเธเธฒเธฃเธ—เธณเธ‡เธฒเธ™เน€เธซเธฅเนˆเธฒเธ™เธตเน‰ เธซเธฃเธทเธญเน€เธŠเธทเนˆเธญเธกเน‚เธขเธ‡เน€เธžเธทเนˆเธญเนƒเธซเน‰เธเธฒเธฃเนเธเน‰เน„เธ‚เนƒเธ™เธญเธ™เธฒเธ„เธ•เธกเธตเธœเธฅเธเธฑเธšเธ—เธฑเน‰เธ‡เธชเธญเธ‡เน‚เธ›เธฃเน„เธŸเธฅเนŒ + เน€เธเน‡เธšเน„เธงเน‰เนเธŠเธฃเนŒ + เธชเธณเน€เธ™เธฒเธญเธดเธชเธฃเธฐ + เน€เธฃเธดเนˆเธกเธเน‰เธฒเธ™เธ—เธตเนˆเธ•เธณเนเธซเธ™เนˆเธ‡เนเธ•เธฐ + เธ‹เนˆเธญเธ™เธเน‰เธฒเธ™เน€เธกเธทเนˆเธญเน„เธกเนˆเนƒเธŠเน‰เธ‡เธฒเธ™ + เน€เธ„เธฃเธทเนˆเธญเธ‡เธกเธทเธญ + เธญเธฑเธ•เน‚เธ™เธกเธฑเธ•เธด (%1$s) + เธเธณเธซเธ™เธ”เน€เธญเธ‡ (%1$s) + เธšเธฑเธ™เธ—เธถเธเน€เธ›เน‡เธ™เน‚เธ›เธฃเน„เธŸเธฅเนŒเนƒเธซเธกเนˆ + เธเธฒเธฃเธ„เธงเธšเธ„เธธเธกเน‚เธ›เธฃเน„เธŸเธฅเนŒ + เน‚เธ›เธฃเน„เธŸเธฅเนŒ + เธ—เนˆเธฒเธ—เธฒเธ‡เธ—เธฑเธŠเนเธžเธ”เน€เธกเธฒเธชเนŒ + เน€เธกเธทเนˆเธญเธเธณเธซเธ™เธ”เนƒเธซเน‰เธ•เธฑเธงเธŠเธตเน‰เน€เธกเธฒเธชเนŒ: เนเธ•เธฐเน€เธžเธทเนˆเธญเธ„เธฅเธดเธ เธเธ”เธ„เน‰เธฒเธ‡เน€เธžเธทเนˆเธญเธฅเธฒเธ เนเธฅเธฐเน€เธฅเธทเนˆเธญเธ™เธ”เน‰เธงเธขเธชเธญเธ‡เธ™เธดเน‰เธง + %1$s เธกเธตเธเธฒเธฃเนเธ—เธ™เธ—เธตเนˆเน€เธกเธ™เธนเธ”เนˆเธงเธ™ เน€เธฅเธทเธญเธเธญเธฑเธ•เน‚เธ™เธกเธฑเธ•เธดเธ—เธตเนˆเธ™เธฑเนˆเธ™เน€เธžเธทเนˆเธญเนƒเธŠเน‰เน‚เธ›เธฃเน„เธŸเธฅเนŒเน€เธฃเธดเนˆเธกเธ•เน‰เธ™เนเธฅเธฐเธ—เธฑเน‰เธ‡เธชเธฒเธกเธชเนˆเธงเธ™เธ—เธตเนˆเธšเธฑเธ™เธ—เธถเธเน„เธงเน‰ + เธญเธดเธ™เธžเธธเธ• DroidDeck + เธ–เธนเธเธเธ”เธ„เน‰เธฒเธ‡เธ‚เธ“เธฐเธเน‰เธฒเธ™เธ–เธนเธเน€เธฅเธทเนˆเธญเธ™เน„เธ›เธ—เธธเธเธ—เธดเธจเธ—เธฒเธ‡: เธเธ”เน€เธกเธทเนˆเธญเน€เธเธดเธ™ 55% เธ›เธฅเนˆเธญเธขเน€เธกเธทเนˆเธญเธ•เนˆเธณเธเธงเนˆเธฒ 35% เนƒเธŠเน‰เธ›เธธเนˆเธกเธ—เธดเธจเธ—เธฒเธ‡เน€เธžเธทเนˆเธญเธเธณเธซเธ™เธ”เนเธ•เนˆเธฅเธฐเธ—เธดเธจเนเธขเธเธเธฑเธ™ เธ„เธณเธชเธฑเนˆเธ‡ DroidDeck เธ—เธณเธ‡เธฒเธ™เธ„เธฃเธฑเน‰เธ‡เน€เธ”เธตเธขเธงเธ•เนˆเธญเธเธฒเธฃเน€เธญเธตเธขเธ‡ เธ„เธฅเธดเธเธเน‰เธฒเธ™เธ•เธฑเน‰เธ‡เธ„เนˆเธฒเนเธขเธ + เธ–เธนเธเธเธ”เธ„เน‰เธฒเธ‡เธ‚เธ“เธฐเนเธ•เธฐเธ—เธฑเธŠเนเธžเธ” เนเธฅเธฐเธ›เธฅเนˆเธญเธขเน€เธกเธทเนˆเธญเธขเธเธ™เธดเน‰เธง เธ„เธณเธชเธฑเนˆเธ‡ DroidDeck เธ—เธณเธ‡เธฒเธ™เธ„เธฃเธฑเน‰เธ‡เน€เธ”เธตเธขเธงเธ•เนˆเธญเธเธฒเธฃเนเธ•เธฐ เธ„เธฅเธดเธเธ—เธฑเธŠเนเธžเธ”เธ•เธฑเน‰เธ‡เธ„เนˆเธฒเนเธขเธ + เธ–เธนเธเธเธ”เธ„เน‰เธฒเธ‡เน€เธกเธทเนˆเธญเน„เธเน€เธเธดเธ™ 55% เนเธฅเธฐเธ›เธฅเนˆเธญเธขเน€เธกเธทเนˆเธญเธ•เนˆเธณเธเธงเนˆเธฒ 35% เธ„เธณเธชเธฑเนˆเธ‡ DroidDeck เธ—เธณเธ‡เธฒเธ™เธ„เธฃเธฑเน‰เธ‡เน€เธ”เธตเธขเธงเธ•เนˆเธญเธเธฒเธฃเธเธ” + เธ—เธดเธจเธ—เธฒเธ‡เธเธฒเธฃเน€เธฅเธทเนˆเธญเธ™ + เนเธ™เธงเธ•เธฑเน‰เธ‡ + เนเธ™เธงเธ™เธญเธ™ + เน€เธฅเธทเนˆเธญเธ™เนเธ™เธงเธ™เธญเธ™ + เธเธฒเธฃเธงเธฑเธ” + เน€เธ›เธดเธ”เธเธฒเธฃเธšเธฑเธ™เธ—เธถเธ เนƒเธŠเน‰เธเธฒเธฃเธ„เธงเธšเธ„เธธเธกเนƒเธ™เน€เธ‹เธชเธŠเธฑเธ™เธ—เธตเนˆเธเธณเธฅเธฑเธ‡เธ—เธณเธ‡เธฒเธ™ เนเธฅเน‰เธงเธเธฅเธฑเธšเธกเธฒเธญเนˆเธฒเธ™เธœเธฅ เธงเธฑเธ”เน€เธ‰เธžเธฒเธฐเน€เธงเธฅเธฒเธเธฒเธฃเธชเนˆเธ‡เธ‚เธญเธ‡ DroidDeck เน„เธกเนˆเธฃเธงเธกเธ„เธงเธฒเธกเธซเธ™เนˆเธงเธ‡เธ‚เธญเธ‡เธซเธ™เน‰เธฒเธˆเธญ เธเธฒเธฃเธšเธฑเธ™เธ—เธถเธเธˆเธฐเธชเธดเน‰เธ™เธชเธธเธ”เน€เธกเธทเนˆเธญเน‚เธ›เธฃเน€เธ‹เธชเนเธญเธ›เธ›เธดเธ” + %1$d เธเธฒเธฃเธ„เธงเธšเธ„เธธเธก + เน€เธฅเธขเนŒเน€เธญเธฒเธ•เนŒเธ—เธตเนˆเธšเธฑเธ™เธ—เธถเธเน„เธงเน‰เธญเธทเนˆเธ™ (%1$d) โ–พ + เธ‹เนˆเธญเธ™เน€เธฅเธขเนŒเน€เธญเธฒเธ•เนŒเธ—เธตเนˆเธšเธฑเธ™เธ—เธถเธเน„เธงเน‰เธญเธทเนˆเธ™ (%1$d) โ–ด + เธซเธ™เน‰เธฒเนเธฃเธ / Guide + เธขเน‰เธญเธ™เธเธฅเธฑเธš ยท เนเธ•เธฐเธ„เธฃเธฑเน‰เธ‡เน€เธ”เธตเธขเธง + เธขเน‰เธญเธ™เธเธฅเธฑเธš ยท เนเธ•เธฐเธชเธญเธ‡เธ„เธฃเธฑเน‰เธ‡ + เธขเน‰เธญเธ™เธเธฅเธฑเธš ยท เธชเธญเธ‡เธ„เธฃเธฑเน‰เธ‡เนƒเธ™ Steam เธซเธ™เธถเนˆเธ‡เธ„เธฃเธฑเน‰เธ‡เธšเธ™เน€เธ”เธชเธเนŒเธ—เน‡เธญเธ› + เนƒเธ™เน‚เธซเธกเธ” Steam เธเธฒเธฃเธเธ”เธขเน‰เธญเธ™เธเธฅเธฑเธšเธ„เน‰เธฒเธ‡เธˆเธฐเน€เธ›เธดเธ”เธเธฒเธฃเน€เธ‚เน‰เธฒเธ–เธถเธ‡เธ”เนˆเธงเธ™เธ”เน‰เธงเธข + เธ„เธทเธ™เธ„เนˆเธฒเน€เธฃเธดเนˆเธกเธ•เน‰เธ™ + เธ•เธฑเธงเน€เธฅเธทเธญเธเนเธœเธ‡เธ‚เธญเธ‡เธ„เธธเธ“เธˆเธฐเธ–เธนเธเธˆเธณเน„เธงเน‰ เน€เธ”เธชเธเนŒเธ—เน‡เธญเธ›เธˆเธฐเน€เธ›เธดเธ”เธžเธทเน‰เธ™เธ—เธตเนˆเธ—เธณเธ‡เธฒเธ™เธ—เธตเนˆเธชเธญเธ‡ เน„เธกเนˆเน„เธ”เน‰เธชเธฅเธฑเธšเน€เธ‹เธชเธŠเธฑเธ™เธซเธฃเธทเธญเน‚เธ›เธฃเน„เธŸเธฅเนŒเธญเธดเธ™เธžเธธเธ• + เธ„เธญเธ™เน‚เธ—เธฃเธฅเน€เธฅเธญเธฃเนŒเน€เธชเธกเธทเธญเธ™ + เธŠเธ™เธดเธ”เธ„เธญเธ™เน‚เธ—เธฃเธฅเน€เธฅเธญเธฃเนŒเธ—เธตเนˆ Steam เธซเธฃเธทเธญเน€เธเธกเธกเธญเธ‡เน€เธซเน‡เธ™ + เธซเธ™เน‰เธฒเธˆเธญเธชเธฑเธกเธœเธฑเธช + เธงเธดเธ˜เธตเธˆเธฑเธ”เธเธฒเธฃเธเธฒเธฃเธชเธฑเธกเธœเธฑเธชเธšเธ™เธซเธ™เน‰เธฒเธˆเธญเน€เธเธก เธ›เธธเนˆเธกเน‚เธ›เธฃเน„เธŸเธฅเนŒเธขเธฑเธ‡เธ„เธ‡เธเธฒเธฃเธ—เธณเธ‡เธฒเธ™เธ—เธตเนˆเธเธณเธซเธ™เธ”เน„เธงเน‰ + เน€เธ„เธญเธฃเนŒเน€เธ‹เธญเธฃเนŒเธชเธฑเธกเธœเธฑเธช + เนเธชเธ”เธ‡เธ•เธฑเธงเธŠเธตเน‰เธชเธณเธซเธฃเธฑเธšเธเธฒเธฃเธชเธฑเธกเธœเธฑเธชเน‚เธ”เธขเธ•เธฃเธ‡เธšเธ™เธซเธ™เน‰เธฒเธˆเธญเน€เธเธก + เนเธ•เธฐเนเธฅเน‰เธงเธเธ”เธ„เน‰เธฒเธ‡ + เธเธฒเธฃเธ—เธณเธ‡เธฒเธ™เธ‚เธญเธ‡เน€เธกเธฒเธชเนŒเน€เธกเธทเนˆเธญเธเธ”เธ™เธดเน‰เธงเธ„เน‰เธฒเธ‡เธšเธ™เธซเธ™เน‰เธฒเธˆเธญเน€เธเธก + เธเธฒเธฃเนเธ•เธฐเธ›เธธเนˆเธกเธขเน‰เธญเธ™เธเธฅเธฑเธš + เธเธฒเธฃเธ—เธณเธ‡เธฒเธ™เนเธฃเธ: เนเธ•เธฐเธ„เธฃเธฑเน‰เธ‡เน€เธ”เธตเธขเธง เธเธฒเธฃเธ—เธณเธ‡เธฒเธ™เธ—เธตเนˆเธชเธญเธ‡: เนเธ•เธฐเธชเธญเธ‡เธ„เธฃเธฑเน‰เธ‡ + เธ›เธธเนˆเธกเธชเธฅเธฑเธš + เนเธ•เธฐเน€เธžเธทเนˆเธญเธเธ”เธ„เน‰เธฒเธ‡ เนเธ•เธฐเธญเธตเธเธ„เธฃเธฑเน‰เธ‡เน€เธžเธทเนˆเธญเธ›เธฅเนˆเธญเธข เธเธฒเธฃเน€เธ›เธดเธ”เน€เธกเธ™เธนเธซเธฃเธทเธญเธชเธฅเธฑเธšเน‚เธ›เธฃเน„เธŸเธฅเนŒเธˆเธฐเธ›เธฅเนˆเธญเธขเธ›เธธเนˆเธก + เธฃเธนเธ›เธฃเนˆเธฒเธ‡ + เธกเธธเธกเธกเธ™ + เนเธ„เธ›เธ‹เธนเธฅ + เธงเธ‡เธเธฅเธก + เธชเธตเนˆเน€เธซเธฅเธตเนˆเธขเธกเธœเธทเธ™เธœเน‰เธฒ + เธ›เน‰เธฒเธขเธ›เธธเนˆเธก + เธ‚เน‰เธญเธ„เธงเธฒเธก + เธฃเธนเธ›เธ เธฒเธžเธ—เธตเนˆเธ™เธณเน€เธ‚เน‰เธฒ + เธ›เธธเนˆเธกเธ—เนเธขเธ‡เนเธขเธ + เธเธณเธซเธ™เธ”เธ›เธธเนˆเธกเนƒเธซเน‰เนเธ•เนˆเธฅเธฐเธ—เนเธขเธ‡ เธ—เนเธขเธ‡เธงเนˆเธฒเธ‡เธˆเธฐเธเธ”เธชเธญเธ‡เธ—เธดเธจเธ—เธตเนˆเธญเธขเธนเนˆเธ‚เน‰เธฒเธ‡เน€เธ„เธตเธขเธ‡ + เธ—เธดเธจเธ‚เน‰เธฒเธ‡เน€เธ„เธตเธขเธ‡ + เธ›เธธเนˆเธกเธซเธ™เน‰เธฒเธˆเธญเน€เธ”เธดเธกเธ‚เธญเธ‡เธ„เธธเธ“เธ–เธนเธเธšเธฑเธ™เธ—เธถเธเน€เธ›เน‡เธ™เน‚เธ›เธฃเน„เธŸเธฅเนŒเธ—เธตเนˆเธ™เธณเน€เธ‚เน‰เธฒเน„เธงเน‰เธ”เน‰เธฒเธ™เธฅเนˆเธฒเธ‡ เน€เธฅเธทเธญเธเธซเธ™เธถเนˆเธ‡เธฃเธฒเธขเธเธฒเธฃเน€เธžเธทเนˆเธญเนƒเธŠเน‰เธซเธฃเธทเธญเนเธเน‰เน„เธ‚ เธ•เธฑเธงเน€เธฅเธทเธญเธเน‚เธ›เธฃเน„เธŸเธฅเนŒเธ›เธฑเธˆเธˆเธธเธšเธฑเธ™เธขเธฑเธ‡เธ„เธ‡เธญเธขเธนเนˆ + เน„เธกเนˆเธชเธฒเธกเธฒเธฃเธ–เธ™เธณเน€เธ‚เน‰เธฒเธ›เธธเนˆเธกเธซเธ™เน‰เธฒเธˆเธญเน€เธ”เธดเธกเน‚เธ”เธขเธญเธฑเธ•เน‚เธ™เธกเธฑเธ•เธดเน„เธ”เน‰ เธเธฒเธฃเธ•เธฑเน‰เธ‡เธ„เนˆเธฒเน€เธ”เธดเธกเธขเธฑเธ‡เธ„เธ‡เธญเธขเธนเนˆ + diff --git a/app/src/main/res/values-th/input_strings.xml b/app/src/main/res/values-th/input_strings.xml new file mode 100644 index 0000000000..de9275d0a6 --- /dev/null +++ b/app/src/main/res/values-th/input_strings.xml @@ -0,0 +1,38 @@ + + + เน‚เธ›เธฃเน„เธŸเธฅเนŒเธญเธดเธ™เธžเธธเธ• + เน‚เธ›เธฃเน„เธŸเธฅเนŒ + เธ„เธญเธ™เน‚เธ—เธฃเธฅเน€เธฅเธญเธฃเนŒเธˆเธฃเธดเธ‡ + เธซเธ™เน‰เธฒเธˆเธญเธซเธฅเธฑเธ + เธซเธ™เน‰เธฒเธˆเธญเธฃเธญเธ‡ + เธ”เธฑเน‰เธ‡เน€เธ”เธดเธก / Steam Input + เธ”เธฑเน‰เธ‡เน€เธ”เธดเธก: %1$s + เธชเนˆเธ‡เธเธฒเธฃเธ„เธงเธšเธ„เธธเธกเธ„เธญเธ™เน‚เธ—เธฃเธฅเน€เธฅเธญเธฃเนŒเธญเธทเนˆเธ™ + เธ›เธดเธ”เนƒเธŠเน‰เธ‡เธฒเธ™ + เธ›เธธเนˆเธกเธซเธฃเธทเธญเธŠเธธเธ”เธ›เธธเนˆเธก + เธ›เธธเนˆเธกเธ—เธดเธจเธ—เธฒเธ‡ + เน€เธฅเธทเนˆเธญเธ™เธ•เธฑเธงเธŠเธตเน‰ + เธ„เธงเธฒเธกเน€เธฃเน‡เธงเธ•เธฑเธงเธŠเธตเน‰: %1$d + เน€เธฅเธทเนˆเธญเธ™ + เน€เธฅเธทเนˆเธญเธ™เนเธ™เธงเธ•เธฑเน‰เธ‡ + เธ›เธธเนˆเธกเธ‹เน‰เธฒเธขเธ‚เธญเธ‡เน€เธกเธฒเธชเนŒ + เธ›เธธเนˆเธกเธ‚เธงเธฒเธ‚เธญเธ‡เน€เธกเธฒเธชเนŒ + เธ›เธธเนˆเธกเธเธฅเธฒเธ‡เธ‚เธญเธ‡เน€เธกเธฒเธชเนŒ + เน€เธ›เธดเธ”เน€เธกเธ™เธน DroidDeck + เนเธชเธ”เธ‡เนเธ›เน‰เธ™เธžเธดเธกเธžเนŒ + เน€เธ›เธดเธ”เน€เธกเธ™เธน Steam + เน€เธ›เธดเธ”เธเธฒเธฃเน€เธ‚เน‰เธฒเธ–เธถเธ‡เธ”เนˆเธงเธ™เธ‚เธญเธ‡ Steam + เธฅเธšเธเธฒเธฃเธ„เธงเธšเธ„เธธเธก + เน€เธžเธดเนˆเธกเธเธฒเธฃเธ„เธงเธšเธ„เธธเธก + เธ›เธธเนˆเธกเน€เธ‰เธžเธฒเธฐเธญเธธเธ›เธเธฃเธ“เนŒ + เธเธณเธซเธ™เธ”เธ›เธธเนˆเธกเธˆเธฃเธดเธ‡ + เธ›เธฅเนˆเธญเธขเธ›เธธเนˆเธก เนเธฅเน‰เธงเน€เธฅเธทเธญเธ เนเธเน‰เน„เธ‚ เธฅเธญเธ‡เธญเธตเธเธ„เธฃเธฑเน‰เธ‡ เธซเธฃเธทเธญเธขเธเน€เธฅเธดเธ B เธซเธฃเธทเธญเธขเน‰เธญเธ™เธเธฅเธฑเธšเธˆเธฐเธขเธเน€เธฅเธดเธเธซเธฅเธฑเธ‡เธ›เธฅเนˆเธญเธข + เธฅเธญเธ‡เธญเธตเธเธ„เธฃเธฑเน‰เธ‡ + เธเธ”เธ›เธธเนˆเธก เธฃเธงเธกเธ–เธถเธ‡เธ›เธธเนˆเธกเธขเน‰เธญเธ™เธเธฅเธฑเธšเธ—เธตเนˆเธฃเธฒเธขเธ‡เธฒเธ™เน€เธ›เน‡เธ™เธ›เธธเนˆเธกเธ„เธตเธขเนŒเธšเธญเธฃเนŒเธ” เธ›เธธเนˆเธกเธฃเธฐเธ”เธฑเธšเน€เธชเธตเธขเธ‡เนเธฅเธฐเธ›เธธเนˆเธกเธฃเธฐเธšเธš Android เธ–เธนเธเธชเธ‡เธงเธ™เน„เธงเน‰ เธเธฒเธฃเธเธณเธซเธ™เธ”เนƒเธŠเน‰เธเธฑเธšเธญเธธเธ›เธเธฃเธ“เนŒเธ™เธตเน‰เน€เธ—เนˆเธฒเธ™เธฑเน‰เธ™ + เธฅเธšเธเธฒเธฃเธเธณเธซเธ™เธ” + เธเธฒเธฃเธงเธดเธ™เธดเธˆเธ‰เธฑเธขเธญเธดเธ™เธžเธธเธ• + เธšเธฑเธ™เธ—เธถเธเน€เธงเธฅเธฒเธเธฒเธฃเธชเนˆเธ‡เธญเธดเธ™เธžเธธเธ• + เธญเนˆเธฒเธ™เธ„เนˆเธฒเธ—เธตเนˆเธงเธฑเธ” + เธงเธฑเธ”เธเธฒเธฃเธชเนˆเธ‡เธˆเธฒเธ Android เธˆเธ™เธ–เธถเธ‡เธเธฒเธฃเน€เธœเธขเนเธžเธฃเนˆเน„เธ›เธขเธฑเธ‡เธŠเนˆเธญเธ‡เธ—เธฒเธ‡เธญเธดเธ™เธžเธธเธ•เธ—เธตเนˆเธกเธตเธญเธขเธนเนˆ เน„เธกเนˆเธฃเธงเธกเธเธฒเธฃเธกเธฒเธ–เธถเธ‡เธ‚เธญเธ‡ Bluetooth เธเธฒเธฃเน‚เธžเธฅเธ‚เธญเธ‡เน€เธเธชเธ•เนŒ เธเธฒเธฃเน€เธฃเธ™เน€เธ”เธญเธฃเนŒ เนเธฅเธฐเธ„เธงเธฒเธกเธซเธ™เนˆเธงเธ‡เธ‚เธญเธ‡เธซเธ™เน‰เธฒเธˆเธญ เธเธฒเธฃเธšเธฑเธ™เธ—เธถเธเธ›เธดเธ”เธญเธขเธนเนˆเน‚เธ”เธขเธ„เนˆเธฒเน€เธฃเธดเนˆเธกเธ•เน‰เธ™ + เนƒเธŠเน‰เธเธฒเธฃเธเธณเธซเธ™เธ”เธญเธดเธ™เธžเธธเธ•เธ›เธเธ•เธด + diff --git a/app/src/main/res/values-th/strings.xml b/app/src/main/res/values-th/strings.xml index 4bbe6cf467..fb4139f53b 100644 --- a/app/src/main/res/values-th/strings.xml +++ b/app/src/main/res/values-th/strings.xml @@ -28,6 +28,8 @@ เธซเธขเธธเธ”เธŠเธฑเนˆเธงเธ„เธฃเธฒเธงเธ•เธญเธ™เธ™เธตเน‰ เธซเธขเธธเธ”เน€เธ‹เธชเธŠเธฑเธ™ เธเธฒเธฃเธชเธฃเน‰เธฒเธ‡เน€เธŸเธฃเธก + เธเธฒเธฃเธ•เธฑเน‰เธ‡เธ„เนˆเธฒเธชเธณเธซเธฃเธฑเธšเน€เธเธกเธ™เธตเน‰ + เธเธฒเธฃเธ•เธฑเน‰เธ‡เธ„เนˆเธฒเน€เธฃเธดเนˆเธกเธ•เน‰เธ™ เน€เธฅเธทเธญเธเน‚เธซเธกเธ”เธเธฒเธฃเธชเธฃเน‰เธฒเธ‡เน€เธŸเธฃเธก เธ›เธดเธ” DD-FG %1$dร— @@ -183,6 +185,7 @@ เธ”เธฒเธงเธ™เนŒเน‚เธซเธฅเธ”เธชเธ เธฒเธžเนเธงเธ”เธฅเน‰เธญเธกเธเธฃเธฒเธŸเธดเธ PowerVR เน„เธกเนˆเธชเธณเน€เธฃเน‡เธˆ เธ•เธฃเธงเธˆเธชเธญเธšเธเธฒเธฃเน€เธŠเธทเนˆเธญเธกเธ•เนˆเธญเนเธฅเน‰เธงเธฅเธญเธ‡เธญเธตเธเธ„เธฃเธฑเน‰เธ‡ เธ”เธฒเธงเธ™เนŒเน‚เธซเธฅเธ” DirectAudio เน„เธกเนˆเน„เธ”เน‰ เน€เธชเธตเธขเธ‡เน€เธเธกเนƒเธ™เน€เธ‹เธชเธŠเธฑเธ™เธ™เธตเน‰เธˆเธถเธ‡เนƒเธŠเน‰เน€เธชเน‰เธ™เธ—เธฒเธ‡เธ—เธตเนˆเธŠเน‰เธฒเธเธงเนˆเธฒ เน‚เธ›เธฃเนเธเธฃเธกเธ™เธตเน‰ + เน€เธ‹เธชเธŠเธฑเธ™เน„เธกเนˆเธชเธฒเธกเธฒเธฃเธ–เนเธชเธ”เธ‡เธœเธฅเธšเธ™เธซเธ™เน‰เธฒเธˆเธญเน„เธ”เน‰: %1$s เธซเธ™เน‰เธฒเธˆเธญเธ™เธตเน‰เนเธชเธ”เธ‡เธชเธฒเน€เธซเธ•เธธเนเธ—เธ™เธ—เธตเนˆเธˆเธฐเน€เธ›เน‡เธ™เธซเธ™เน‰เธฒเธˆเธญเธชเธตเธ”เธณ เธฃเธฒเธขเธฅเธฐเน€เธญเธตเธขเธ”เธญเธขเธนเนˆเนƒเธ™เธšเธฑเธ™เธ—เธถเธเธ‚เธญเธ‡เน€เธ‹เธชเธŠเธฑเธ™ เธ”เธฒเธงเธ™เนŒเน‚เธซเธฅเธ”เน„เธ„เธฅเน€เธญเธ™เธ•เนŒ Steam เน„เธกเนˆเน„เธ”เน‰ เน€เธ„เธฃเธทเธญเธ‚เนˆเธฒเธขเธซเธฃเธทเธญ VPN เธ‚เธญเธ‡เธ„เธธเธ“เธญเธฒเธˆเธšเธฅเน‡เธญเธเน€เธ‹เธดเธฃเนŒเธŸเน€เธงเธญเธฃเนŒเธ‚เธญเธ‡ Steam เธ•เธฃเธงเธˆเธชเธญเธšเธเธฒเธฃเน€เธŠเธทเนˆเธญเธกเธ•เนˆเธญเนเธฅเน‰เธงเธฅเธญเธ‡เธญเธตเธเธ„เธฃเธฑเน‰เธ‡ เธ•เธฑเน‰เธ‡เธ„เนˆเธฒเน„เธ„เธฅเน€เธญเธ™เธ•เนŒ Steam เน„เธกเนˆเน„เธ”เน‰ เธ•เธฃเธงเธˆเธชเธญเธšเธเธฒเธฃเน€เธŠเธทเนˆเธญเธกเธ•เนˆเธญเนเธฅเธฐเธžเธทเน‰เธ™เธ—เธตเนˆเธงเนˆเธฒเธ‡ เนเธฅเน‰เธงเธฅเธญเธ‡เธญเธตเธเธ„เธฃเธฑเน‰เธ‡ %1$s เธชเธฃเน‰เธฒเธ‡เธกเธฒเธชเธณเธซเธฃเธฑเธšเธžเธตเธ‹เธต x86 เนเธฅเธฐเธฃเธฑเธ™เธœเนˆเธฒเธ™ FEX เธ‹เธถเนˆเธ‡เธขเธฑเธ‡เน„เธกเนˆเน„เธ”เน‰เธ•เธดเธ”เธ•เธฑเน‰เธ‡ เน€เธฃเธดเนˆเธก Steam เธชเธฑเธเธ„เธฃเธฑเน‰เธ‡เธ‚เธ“เธฐเธฅเธ‡เธŠเธทเนˆเธญเน€เธ‚เน‰เธฒเนƒเธŠเน‰เนเธฅเธฐเนƒเธซเน‰เธ”เธฒเธงเธ™เนŒเน‚เธซเธฅเธ” FEX เนเธฅเธฐ Steam Linux Runtime เธˆเธฒเธเธ™เธฑเน‰เธ™เน€เธฃเธดเนˆเธกเน‚เธ›เธฃเนเธเธฃเธกเธ™เธตเน‰เธญเธตเธเธ„เธฃเธฑเน‰เธ‡ @@ -384,6 +387,9 @@ เธขเธฑเธ‡เน„เธกเนˆเธฃเธญเธ‡เธฃเธฑเธšเนƒเธ™เธ—เธตเนˆเธ™เธตเน‰ เธเธณเธฅเธฑเธ‡เน‚เธซเธฅเธ”เธ„เธญเธกเน‚เธžเน€เธ™เธ™เธ•เนŒโ€ฆ เธ•เธดเธ”เธ•เธฑเน‰เธ‡เน„เธกเนˆเน„เธ”เน‰: %1$s + เน„เธŸเธฅเนŒเธ—เธตเนˆเธ”เธฒเธงเธ™เนŒเน‚เธซเธฅเธ”เธ™เธตเน‰เธ•เน‰เธญเธ‡เธญเธฑเธ›เน€เธ”เธ• + เธญเธฑเธ›เน€เธ”เธ•เธญเธขเธนเนˆเนƒเธ™เธ„เธดเธงเนเธฅเน‰เธง + เธฅเธญเธ‡เธญเธฑเธ›เน€เธ”เธ•เธญเธตเธเธ„เธฃเธฑเน‰เธ‡ เธ”เธฒเธงเธ™เนŒเน‚เธซเธฅเธ”เนเธฅเน‰เธง เธเธณเธฅเธฑเธ‡เธ”เธฒเธงเธ™เนŒเน‚เธซเธฅเธ” %1$s เธเธณเธฅเธฑเธ‡เธ•เธดเธ”เธ•เธฑเน‰เธ‡: %1$s @@ -414,6 +420,22 @@ เธžเธทเน‰เธ™เธ—เธตเนˆเธ เธฒเธขเนƒเธ™เน€เธ—เนˆเธฒเธ™เธฑเน‰เธ™ เน‚เธŸเธฅเน€เธ”เธญเธฃเนŒ: %1$s เน„เธฅเธšเธฃเธฒเธฃเธตเธ—เธตเนˆเธชเธญเธ‡ + เน„เธฅเธšเธฃเธฒเธฃเธต Steam เน€เธžเธดเนˆเธกเน€เธ•เธดเธก + เน‚เธŸเธฅเน€เธ”เธญเธฃเนŒเธ—เธตเนˆ Steam เนƒเธŠเน‰เธ•เธดเธ”เธ•เธฑเน‰เธ‡เนเธฅเธฐเน€เธฅเนˆเธ™เน€เธเธกเน„เธ”เน‰ เน‚เธ”เธขเนเธ•เนˆเธฅเธฐเน‚เธŸเธฅเน€เธ”เธญเธฃเนŒเธกเธตเธŠเธทเนˆเธญเธ‚เธญเธ‡เธ•เธฑเธงเน€เธญเธ‡ เธเธฒเธฃเธ™เธณเน‚เธŸเธฅเน€เธ”เธญเธฃเนŒเธญเธญเธเน„เธกเนˆเน„เธ”เน‰เธฅเธšเน€เธเธกเธญเธญเธเธˆเธฒเธเน€เธ„เธฃเธทเนˆเธญเธ‡ + เน€เธžเธดเนˆเธกเน„เธฅเธšเธฃเธฒเธฃเธต + เน€เธ›เธฅเธตเนˆเธขเธ™เธŠเธทเนˆเธญ + เธŠเธทเนˆเธญเน„เธฅเธšเธฃเธฒเธฃเธต + เน€เธฅเธทเธญเธเน‚เธŸเธฅเน€เธ”เธญเธฃเนŒเธชเธณเธซเธฃเธฑเธšเน„เธฅเธšเธฃเธฒเธฃเธต + เน€เธžเธดเนˆเธกเน„เธฅเธšเธฃเธฒเธฃเธตเน„เธ”เน‰เธชเธนเธ‡เธชเธธเธ” %1$d เธฃเธฒเธขเธเธฒเธฃ + เน‚เธŸเธฅเน€เธ”เธญเธฃเนŒเธ™เธตเน‰เน€เธ›เน‡เธ™เน„เธฅเธšเธฃเธฒเธฃเธตเธญเธขเธนเนˆเนเธฅเน‰เธงเธซเธฃเธทเธญเธญเธขเธนเนˆเธ เธฒเธขเนƒเธ™เน„เธฅเธšเธฃเธฒเธฃเธตเธญเธทเนˆเธ™ + %1$s ยท เน„เธกเนˆเธžเธฃเน‰เธญเธกเนƒเธŠเน‰เธ‡เธฒเธ™ + เธกเธตเธœเธฅเธ•เธฑเน‰เธ‡เนเธ•เนˆเน€เธ‹เธชเธŠเธฑเธ™ Steam เธ–เธฑเธ”เน„เธ› + เธžเธšเนƒเธ™เน€เธ„เธฃเธทเนˆเธญเธ‡เธ™เธตเน‰ ยท %1$s ยท %2$s + เน€เธžเธดเนˆเธก + เธ„เน‰เธ™เธซเธฒเน„เธฅเธšเธฃเธฒเธฃเธตเนƒเธ™เธ—เธตเนˆเน€เธเน‡เธšเธ‚เน‰เธญเธกเธนเธฅเธ เธฒเธขเนƒเธ™ + เธญเธ™เธธเธเธฒเธ•เธเธฒเธฃเน€เธ‚เน‰เธฒเธ–เธถเธ‡เน„เธŸเธฅเนŒเธ—เธฑเน‰เธ‡เธซเธกเธ” เน€เธžเธทเนˆเธญเนƒเธซเน‰ DroidDeck เน€เธซเน‡เธ™เน„เธฅเธšเธฃเธฒเธฃเธต Steam เธ—เธตเนˆเนเธญเธ›เธญเธทเนˆเธ™เน€เธเน‡เธšเน„เธงเน‰เนƒเธ™เธ—เธตเนˆเน€เธเน‡เธšเธ‚เน‰เธญเธกเธนเธฅเธ เธฒเธขเนƒเธ™ + เธญเธ™เธธเธเธฒเธ• + เน€เธžเธดเนˆเธก %1$s เนเธฅเน‰เธง เธ‹เธถเนˆเธ‡เน€เธ›เน‡เธ™เน„เธฅเธšเธฃเธฒเธฃเธต Steam เธ—เธตเนˆเธญเธขเธนเนˆเธ เธฒเธขเนƒเธ™เน‚เธŸเธฅเน€เธ”เธญเธฃเนŒเธ—เธตเนˆเธ„เธธเธ“เน€เธฅเธทเธญเธ เน€เธเธกเธ—เธตเนˆเธชเธ•เธฃเธตเธกเธ‚เน‰เธญเธกเธนเธฅเธˆเธฒเธ SD เธซเธฃเธทเธญเธžเธทเน‰เธ™เธ—เธตเนˆเธˆเธฑเธ”เน€เธเน‡เธšเธ—เธตเนˆเนƒเธŠเน‰เธฃเนˆเธงเธกเธเธฑเธ™เธญเธฒเธˆเธเธฃเธฐเธ•เธธเธ เธเธฒเธฃเธงเธดเธ™เธดเธˆเธ‰เธฑเธขเธžเธทเน‰เธ™เธ—เธตเนˆเธˆเธฑเธ”เน€เธเน‡เธš เธšเธฑเธ™เธ—เธถเธเธœเธฅเธเธฒเธฃเธˆเธฑเธ”เธชเธฃเธฃเนเธฅเธฐเน€เธงเธฅเธฒเธžเธทเน‰เธ™เธ—เธตเนˆเธˆเธฑเธ”เน€เธเน‡เธšเธ—เธตเนˆเธชเธธเนˆเธกเธ•เธฃเธงเธˆเน„เธงเน‰เนƒเธ™เธฅเน‡เธญเธเธ—เธตเนˆเนเธŠเธฃเนŒ เธญเธฒเธˆเธ—เธณเนƒเธซเน‰เธเธฒเธฃเธ•เธดเธ”เธ•เธฑเน‰เธ‡เธŠเน‰เธฒเธฅเธ‡เธ‚เธ“เธฐเน€เธ›เธดเธ”เนƒเธŠเน‰เธ‡เธฒเธ™ เธˆเธฐเธกเธตเธœเธฅเนƒเธ™เน€เธ‹เธชเธŠเธฑเธ™เธ–เธฑเธ”เน„เธ› @@ -476,6 +498,7 @@ เน€เธ›เธดเธ” เน€เธฃเธดเนˆเธกเธžเธฃเน‰เธญเธก Steam เน€เธฃเธดเนˆเธกเน‚เธ”เธขเน„เธกเนˆเนƒเธŠเน‰ Steam + เธ„เธงเธฒเธกเธฅเธฐเน€เธญเธตเธขเธ”เธ‚เธญเธ‡เน€เธเธก เธเธฒเธฃเธ•เธฑเน‰เธ‡เธ„เนˆเธฒ เธเธฒเธฃเธ•เธฑเน‰เธ‡เธ„เนˆเธฒ %1$s เธ„เนˆเธฒเน€เธฃเธดเนˆเธกเธ•เน‰เธ™ @@ -563,6 +586,8 @@ เธ„เธญเธฃเนŒเธชเธณเธซเธฃเธฑเธšเน€เธเธก เธ„เธญเธฃเนŒเน€เธเธก เธ„เธญเธฃเนŒเธชเธณเธซเธฃเธฑเธšเน€เธเธก เน€เธกเธทเนˆเธญเน€เธฅเธทเธญเธเธ—เธฑเน‰เธ‡เธซเธกเธ” Android เธˆเธฐเธˆเธฑเธ”เธชเธฃเธฃเน„เธ”เน‰เธญเธขเนˆเธฒเธ‡เธญเธดเธชเธฃเธฐ + เธ›เธฃเธฐเธซเธขเธฑเธ”เธžเธฅเธฑเธ‡เธ‡เธฒเธ™เนƒเธ™เน€เธเธกเธ—เธตเนˆเธ™เธดเนˆเธ‡ + เธฃเธฑเธ™เน€เธเธกเธšเธ™เธ„เธญเธฃเนŒเธ—เธตเนˆเธŠเน‰เธฒเธเธงเนˆเธฒเธ‚เธ“เธฐเธ—เธตเนˆเน€เธŸเธฃเธกเน€เธฃเธ•เธ„เธ‡เธ—เธตเนˆ เนเธฅเธฐเธขเน‰เธฒเธขเธเธฅเธฑเธšเน„เธ›เธขเธฑเธ‡เธ„เธญเธฃเนŒเธ›เธเธ•เธดเธ—เธฑเธ™เธ—เธตเธ—เธตเนˆเธ•เธฒเธกเน„เธกเนˆเธ—เธฑเธ™ เธญเธดเธ™เน€เธ—เธญเธฃเนŒเน€เธŸเธ‹เน„เธ„เธฅเน€เธญเธ™เธ•เนŒ GL เนเธšเธšเน€เธ˜เธฃเธ” เธญเธฒเธˆเธ—เธณเนƒเธซเน‰เน€เธกเธ™เธน Steam เธ•เธญเธšเธชเธ™เธญเธ‡เน„เธงเธ‚เธถเน‰เธ™ @@ -598,7 +623,10 @@ เธ›เธดเธ”เธ•เธฑเธงเธŠเนˆเธงเธขเธ„เธงเธšเธ„เธธเธกเธ”เน‰เธงเธขเธ„เธญเธ™เน‚เธ—เธฃเธฅเน€เธฅเธญเธฃเนŒเธ‚เธญเธ‡ Proton เธ‹เธถเนˆเธ‡เธเธดเธ™เธžเธฅเธฑเธ‡ CPU เนƒเธ™เธ—เธธเธเน€เธเธก เธฃเธฑเธ™ proot เน‚เธ”เธขเน„เธกเนˆเนƒเธŠเน‰ seccomp เธญเธฒเธˆเนเธเน‰เธ‚เน‰เธญเธœเธดเธ”เธžเธฅเธฒเธ” syscall เธ—เธตเนˆเธ‚เธฒเธ”เธซเธฒเธขเธšเธ™เธšเธฒเธ‡เน€เธ„เธญเธฃเนŒเน€เธ™เธฅ เธญเธฒเธˆเธฅเธ”เธ›เธฃเธฐเธชเธดเธ—เธ˜เธดเธ เธฒเธž + เน€เธฃเธตเธขเธเนƒเธŠเน‰เน‚เธ”เธขเน„เธกเนˆเนƒเธŠเน‰ proot (เธ—เธ”เธฅเธญเธ‡) + เน€เธฃเธดเนˆเธกเธเธฑเนˆเธ‡ Linux เธšเธ™ Android เน‚เธ”เธขเธ•เธฃเธ‡ เธกเธตเธœเธฅเธเธฑเธšเน€เธ‹เธชเธŠเธฑเธ™เธ–เธฑเธ”เน„เธ› เธซเธฒเธเธกเธตเธญเธฐเน„เธฃเน€เธฃเธดเนˆเธกเน„เธกเนˆเธชเธณเน€เธฃเน‡เธˆเนƒเธซเน‰เธ›เธดเธ”เธ•เธฑเธงเน€เธฅเธทเธญเธเธ™เธตเน‰ เน€เธชเน‰เธ™เธ—เธฒเธ‡เธฅเธฑเธ”เธ‚เธญเธ‡ proot + เน„เธกเนˆเน„เธ”เน‰เนƒเธŠเน‰เธ‡เธฒเธ™เน€เธกเธทเนˆเธญเน„เธกเนˆเธกเธต proot เธ•เน‰เธญเธ‡เนƒเธŠเน‰เธ•เธฑเธงเธเธฃเธญเธ‡ seccomp เธ‚เธญเธ‡ proot เธ„เน‰เธ™เธซเธฒเน„เธŸเธฅเนŒเน€เธฃเน‡เธงเธ‚เธถเน‰เธ™เนเธฅเธฐเธชเธฐเธ”เธธเธ”เธ™เน‰เธญเธขเธฅเธ‡ เธ›เธดเธ”เธซเธฒเธเน‚เธ›เธฃเนเธเธฃเธกเธซเธฒเน„เธŸเธฅเนŒเธ‚เธญเธ‡เธ•เธฑเธงเน€เธญเธ‡เน„เธกเนˆเธžเธš เธงเธฒเธ”เน€เธ„เธญเธฃเนŒเน€เธ‹เธญเธฃเนŒเธ เธฒเธขเนƒเธ™ gamescope @@ -681,6 +709,7 @@ เธซเธ™เนˆเธงเธขเธ„เธงเธฒเธกเธˆเธณเธเธฃเธฒเธŸเธดเธ เธžเธทเน‰เธ™เธ—เธตเนˆเธชเธงเน‡เธญเธ› เธฃเธฐเธ”เธฑเธšเนเธšเธ•เน€เธ•เธญเธฃเธตเนˆ + เน€เธงเธฅเธฒเธเธฒเธฃเนƒเธŠเน‰เธ‡เธฒเธ™เนเธšเธ•เน€เธ•เธญเธฃเธตเนˆเธ—เธตเนˆเน€เธซเธฅเธทเธญ เธเธฒเธฃเนƒเธŠเน‰เธžเธฅเธฑเธ‡เธ‡เธฒเธ™ เน€เธ„เธฃเธทเธญเธ‚เนˆเธฒเธข เธ„เธงเธฒเธกเธฅเธฐเน€เธญเธตเธขเธ” @@ -806,6 +835,7 @@ เธฃเธญเธ‡เธฃเธฑเธšเธญเธธเธ›เธเธฃเธ“เนŒเธ™เธตเน‰ GPU เธ—เธตเนˆเธขเธฑเธ‡เน„เธกเนˆเธœเนˆเธฒเธ™เธเธฒเธฃเธ—เธ”เธชเธญเธš เน„เธกเนˆเธฃเธญเธ‡เธฃเธฑเธš GPU เธ™เธตเน‰ + GPU เธœเนˆเธฒเธ™เธšเธฃเธดเธ”เธˆเนŒ Mali %1$s ยท %2$s %1$s: %2$s เน„เธกเนˆเธกเธตเนเธšเน‡เธเน€เธญเธ™เธ”เนŒเธเธฃเธฒเธŸเธดเธเธ—เธตเนˆเน€เธ‚เน‰เธฒเธเธฑเธ™เน„เธ”เน‰เธชเธณเธซเธฃเธฑเธš %1$s Steam เธญเธฒเธˆเนเธชเธ”เธ‡เธซเธ™เน‰เธฒเธˆเธญเธชเธตเธ”เธณ @@ -835,15 +865,38 @@ เน€เธ‹เธชเธŠเธฑเธ™ เธฅเน‡เธญเธเน€เธ‹เธชเธŠเธฑเธ™ เธšเธฑเธ™เธ—เธถเธเน„เธงเน‰เธซเธฅเธฑเธ‡เธˆเธšเนเธ•เนˆเธฅเธฐเน€เธ‹เธชเธŠเธฑเธ™ + เธเธฒเธฃเธงเธดเธ™เธดเธˆเธ‰เธฑเธขเธ‚เธฑเน‰เธ™เธชเธนเธ‡เธชเธณเธซเธฃเธฑเธšเน€เธ‹เธชเธŠเธฑเธ™เธ–เธฑเธ”เน„เธ› + เน€เธเน‡เธšเธšเธฑเธ™เธ—เธถเธเน‚เธ”เธขเธฅเธฐเน€เธญเธตเธขเธ”เน€เธ›เน‡เธ™เน€เธงเธฅเธฒเธซเธ™เธถเนˆเธ‡เน€เธ‹เธชเธŠเธฑเธ™ เธญเธฒเธˆเธ—เธณเนƒเธซเน‰เธ›เธฃเธฐเธชเธดเธ—เธ˜เธดเธ เธฒเธžเธฅเธ”เธฅเธ‡เนเธฅเธฐเนƒเธŠเน‰เธžเธทเน‰เธ™เธ—เธตเนˆเน€เธเน‡เธšเธ‚เน‰เธญเธกเธนเธฅเธกเธฒเธเธ‚เธถเน‰เธ™ เธˆเธฐเธ›เธดเธ”เน€เธญเธ‡เน€เธกเธทเนˆเธญเน€เธ‹เธชเธŠเธฑเธ™เน€เธฃเธดเนˆเธกเธ‚เธถเน‰เธ™ เธ•เธฃเธงเธˆเธชเธญเธšเธšเธฑเธ™เธ—เธถเธเธเนˆเธญเธ™เนเธŠเธฃเนŒ เธšเธฑเธ™เธ—เธถเธเธ”เธตเธšเธฑเธเธ‚เธญเธ‡เน€เธเธก เธฃเธงเธกเธ‚เน‰เธญเธกเธนเธฅเธงเธดเธ™เธดเธˆเธ‰เธฑเธขเธ‚เธญเธ‡ Proton, Wine เนเธฅเธฐเธเธฃเธฒเธŸเธดเธเนƒเธ™เธเธฒเธฃเน€เธ›เธดเธ”เน€เธเธกเธ„เธฃเธฑเน‰เธ‡เธ–เธฑเธ”เน„เธ› เธญเธฒเธˆเธฅเธ”เธ›เธฃเธฐเธชเธดเธ—เธ˜เธดเธ เธฒเธžเนเธฅเธฐเนƒเธŠเน‰เธžเธทเน‰เธ™เธ—เธตเนˆเธˆเธฑเธ”เน€เธเน‡เธšเธกเธฒเธเธ‚เธถเน‰เธ™ เธฃเธตเธชเธ•เธฒเธฃเนŒเธ—เน€เธ‹เธชเธŠเธฑเธ™เธ™เธตเน‰เน€เธžเธทเนˆเธญเธšเธฑเธ™เธ—เธถเธเธšเธฑเธ™เธ—เธถเธเธ”เธตเธšเธฑเธเธ‚เธญเธ‡เน€เธเธก เธญเธฑเธ›เน€เธ”เธ•เธเธฒเธฃเธšเธฑเธ™เธ—เธถเธเน„เธกเนˆเน„เธ”เน‰ เธ•เธฃเธงเธˆเธชเธญเธšเธชเธงเธดเธ•เธŠเนŒเนเธฅเน‰เธงเธฅเธญเธ‡เนƒเธซเธกเนˆ เน€เธ„เธฃเธทเนˆเธญเธ‡เธกเธทเธญเธ”เธตเธšเธฑเธ + เธšเธฑเธ™เธ—เธถเธเธเธฃเธฒเธŸเธดเธเน‚เธ”เธขเธฅเธฐเน€เธญเธตเธขเธ” + เธญเธดเธ™เน€เธ—เธญเธฃเนŒเน€เธŸเธ‹ Steam: เธงเธฒเธ”เธ”เน‰เธงเธข GPU + เธ”เน‰เธงเธขเน„เธ”เธฃเน€เธงเธญเธฃเนŒเธ„เธนเนˆ Xclipse Steam เธˆเธฐเธงเธฒเธ”เธซเธ™เน‰เธฒเน€เธžเธˆเธ”เน‰เธงเธขเธ‹เธญเธŸเธ•เนŒเนเธงเธฃเนŒ (เธเธฒเธฃเธงเธฒเธ”เธ”เน‰เธงเธข GPU เธ—เธณเนƒเธซเน‰เธ เธฒเธžเนเธ•เธเน€เธ›เน‡เธ™เธŠเธดเน‰เธ™) เน€เธ›เธดเธ”เธ•เธฑเธงเน€เธฅเธทเธญเธเธ™เธตเน‰เน€เธžเธทเนˆเธญเนƒเธซเน‰เธญเธดเธ™เน€เธ—เธญเธฃเนŒเน€เธŸเธ‹ Steam เน€เธฃเน‡เธงเธ‚เธถเน‰เธ™เธซเธฒเธเธ”เธนเธ›เธเธ•เธดเธšเธ™เน€เธ„เธฃเธทเนˆเธญเธ‡เธ™เธตเน‰ + เธชเธฃเน‰เธฒเธ‡เน€เธกเธทเนˆเธญ %1$s + %1$s เธญเธฑเธ›เน€เธ”เธ•เน€เธ›เน‡เธ™เธšเธดเธฅเธ”เนŒเธฅเนˆเธฒเธชเธธเธ”เนเธฅเน‰เธง + เธšเธฃเธดเธ”เธˆเนŒ Mali เธ•เธฃเธงเธˆเธชเธญเธšเธ•เธฑเธงเน€เธญเธ‡เน„เธกเนˆเธœเนˆเธฒเธ™เธšเธ™ %1$s เนƒเธ™เน€เธ‹เธชเธŠเธฑเธ™เธเนˆเธญเธ™เธซเธ™เน‰เธฒ (เธฃเธนเธ›เธ เธฒเธžเธซเธฃเธทเธญเธเธฒเธฃเธงเธฒเธ”) เน€เธ‹เธชเธŠเธฑเธ™เธˆเธถเธ‡เนƒเธŠเน‰เธ„เธนเนˆเน„เธ”เธฃเน€เธงเธญเธฃเนŒ PanVK เนเธ—เธ™ + เธšเธฃเธดเธ”เธˆเนŒ Mali เธซเธฒเธŠเนˆเธญเธ‡เธ—เธฒเธ‡เนเธŠเธฃเนŒเธซเธ™เนˆเธงเธขเธ„เธงเธฒเธกเธˆเธณเธเธฑเธšเน„เธ”เธฃเน€เธงเธญเธฃเนŒเธšเธ™ %1$s เน„เธกเนˆเธžเธšเนƒเธ™เน€เธ‹เธชเธŠเธฑเธ™เธเนˆเธญเธ™เธซเธ™เน‰เธฒ เน€เธ‹เธชเธŠเธฑเธ™เธˆเธถเธ‡เนƒเธŠเน‰เธ„เธนเนˆเน„เธ”เธฃเน€เธงเธญเธฃเนŒ PanVK เนเธ—เธ™ เธšเธฃเธดเธ”เธˆเนŒเนƒเธŠเน‰เธ‡เธฒเธ™เน„เธกเนˆเน„เธ”เน‰เธšเธ™เน‚เธ—เธฃเธจเธฑเธžเธ—เนŒเน€เธ„เธฃเธทเนˆเธญเธ‡เธ™เธตเน‰ เธเธฒเธฃเธ›เธดเธ”เธšเธฃเธดเธ”เธˆเนŒเธˆเธฐเนƒเธซเน‰เนƒเธŠเน‰เธ„เธนเนˆ PanVK เธ•เนˆเธญเน„เธ› + เธšเธฑเธ™เธ—เธถเธ Proton, DXVK เนเธฅเธฐเน„เธ”เธฃเน€เธงเธญเธฃเนŒเธ‚เธญเธ‡เนเธ•เนˆเธฅเธฐเน€เธเธกเธˆเธฐเธญเธขเธนเนˆเนƒเธ™เธšเธฑเธ™เธ—เธถเธเธ‚เธญเธ‡เน€เธ‹เธชเธŠเธฑเธ™ เน€เธ›เธดเธ”เนƒเธŠเน‰เธ‡เธฒเธ™เน€เธชเธกเธญเน€เธกเธทเนˆเธญ GPU เน„เธกเนˆเนƒเธŠเนˆ Adreno เธฅเน‡เธญเธเน€เธ‹เธชเธŠเธฑเธ™เธฅเนˆเธฒเธชเธธเธ” เธฅเน‡เธญเธเน€เธ‹เธชเธŠเธฑเธ™เธ—เธตเนˆเธšเธฑเธ™เธ—เธถเธเน„เธงเน‰ เน€เธเน‡เธš %1$d เธฃเธฒเธขเธเธฒเธฃเธฅเนˆเธฒเธชเธธเธ” เธฅเน‰เธฒเธ‡เธฅเน‡เธญเธ + เธšเธฑเธ™เธ—เธถเธเน€เธ‹เธชเธŠเธฑเธ™เธ—เธตเนˆเธกเธตเธญเธขเธนเนˆ + เธขเธฑเธ‡เน„เธกเนˆเธกเธตเธšเธฑเธ™เธ—เธถเธเน€เธ‹เธชเธŠเธฑเธ™เธ—เธตเนˆเน€เธเน‡เธšเน„เธงเน‰ + เน„เธŸเธฅเนŒ ZIP เธ—เธตเนˆเนเธŠเธฃเนŒเนเธฅเธฐเธ—เธตเนˆเธšเธฑเธ™เธ—เธถเธเธˆเธฐเธฃเธงเธกเน€เธ‹เธชเธŠเธฑเธ™เธ—เธตเนˆเน€เธฅเธทเธญเธ เธžเธฃเน‰เธญเธกเธ‚เน‰เธญเธกเธนเธฅเธงเธดเธ™เธดเธˆเธ‰เธฑเธขเธ—เธตเนˆเน€เธเธตเนˆเธขเธงเธ‚เน‰เธญเธ‡เธ‚เธญเธ‡ Steam, เธฃเน‰เธฒเธ™เธ„เน‰เธฒ, เน€เธ„เธฃเธทเนˆเธญเธ‡เธกเธทเธญ เนเธฅเธฐ Battle.net + %1$s ยท %2$s + เน€เธ‹เธชเธŠเธฑเธ™เธ›เธฑเธˆเธˆเธธเธšเธฑเธ™ + เนเธŠเธฃเนŒ + เธšเธฑเธ™เธ—เธถเธเธฅเธ‡เนƒเธ™เธญเธธเธ›เธเธฃเธ“เนŒ + เธฅเธš + เธฅเธšเธšเธฑเธ™เธ—เธถเธเน€เธ‹เธชเธŠเธฑเธ™? + เธฅเธš %1$s? เน„เธกเนˆเธชเธฒเธกเธฒเธฃเธ–เธเธนเน‰เธ„เธทเธ™เน„เธ”เน‰ + เธšเธฑเธ™เธ—เธถเธเน€เธ‹เธชเธŠเธฑเธ™เน€เธฃเธตเธขเธšเธฃเน‰เธญเธขเนเธฅเน‰เธง + เน„เธกเนˆเธชเธฒเธกเธฒเธฃเธ–เธšเธฑเธ™เธ—เธถเธเน€เธ‹เธชเธŠเธฑเธ™เน„เธ”เน‰ + เน„เธกเนˆเธชเธฒเธกเธฒเธฃเธ–เธฅเธšเธšเธฑเธ™เธ—เธถเธเน€เธ‹เธชเธŠเธฑเธ™เน„เธ”เน‰ เธฃเธตเน€เธ‹เน‡เธ•เธเธฒเธฃเธ•เธฑเน‰เธ‡เธ„เนˆเธฒเธ—เธฑเน‰เธ‡เธซเธกเธ” เธ„เธทเธ™เธ„เนˆเธฒเธ—เธธเธเธเธฒเธฃเธ•เธฑเน‰เธ‡เธ„เนˆเธฒเน€เธ›เน‡เธ™เธ„เนˆเธฒเน€เธฃเธดเนˆเธกเธ•เน‰เธ™ เธฃเธตเน€เธ‹เน‡เธ• @@ -870,6 +923,8 @@ เนƒเธŠเน‰เน€เธ›เน‡เธ™เธซเธ™เน‰เธฒเธˆเธญเธซเธฅเธฑเธ DroidDeck เธชเธฒเธกเธฒเธฃเธ–เน€เธ›เน‡เธ™เนเธญเธ›เธซเธ™เน‰เธฒเธˆเธญเธซเธฅเธฑเธเน„เธ”เน‰ DroidDeck เธˆเธฐเน„เธกเนˆเธ–เธนเธเน€เธชเธ™เธญเนƒเธซเน‰เน€เธ›เน‡เธ™เนเธญเธ›เธซเธ™เน‰เธฒเธˆเธญเธซเธฅเธฑเธ + เธ›เธธเนˆเธกเน‚เธฎเธกเน€เธ›เธดเธ”เน„เธ›เธขเธฑเธ‡ + เธซเธ™เน‰เธฒเธ—เธตเนˆเนเธชเธ”เธ‡เน€เธกเธทเนˆเธญ DroidDeck เน€เธ›เน‡เธ™เนเธญเธ›เธซเธ™เน‰เธฒเธˆเธญเธซเธฅเธฑเธเนเธฅเธฐเธ„เธธเธ“เธเธ”เธ›เธธเนˆเธกเน‚เธฎเธก เนƒเธ™เน€เธžเธดเนˆเธกเน€เธเธก เนƒเธซเน‰เธ•เธฑเน‰เธ‡ DroidDeck เน€เธ›เน‡เธ™เธฃเธงเธก เธเธฒเธฃเธงเธฒเธ‡เนเธ™เธง เธเธฒเธฃเธงเธฒเธ‡เนเธ™เธงเธ‚เธญเธ‡เธ•เธฑเธงเน€เธ›เธดเธ”เนƒเธŠเน‰ @@ -883,15 +938,22 @@ เน€เธ•เน‡เธกเธˆเธญ เธ‹เนˆเธญเธ™เนเธ–เธšเธชเธ–เธฒเธ™เธฐเนเธฅเธฐเนเธ–เธšเธ™เธณเธ—เธฒเธ‡เธ‚เธญเธ‡ Android เนเธชเธ”เธ‡เนเธ–เธšเธชเธ–เธฒเธ™เธฐเนเธฅเธฐเนเธ–เธšเธ™เธณเธ—เธฒเธ‡เธ‚เธญเธ‡ Android + เธฅเธญเธ™เน€เธŠเธญเธฃเนŒเนเธšเธšเธชเธญเธ‡เธˆเธญ + เน‚เธซเธกเธ”เธญเธฑเธ•เน‚เธ™เธกเธฑเธ•เธดเธˆเธฐเนเธชเธ”เธ‡เธชเนˆเธงเธ™เธ•เนˆเธฒเธ‡เน† เธ‚เธญเธ‡เธฅเธญเธ™เน€เธŠเธญเธฃเนŒ (Steam, เธ„เธฅเธฑเธ‡เน€เธเธก, เธฃเน‰เธฒเธ™เธ„เน‰เธฒ เนเธฅเธฐเธชเนˆเธงเธ™เธญเธทเนˆเธ™เน†) เธšเธ™เธˆเธญเธ—เธตเนˆเธชเธญเธ‡เธ‚เธญเธ‡เน€เธ„เธฃเธทเนˆเธญเธ‡เน€เธฅเนˆเธ™เธžเธเธžเธฒเธ—เธตเนˆเธกเธตเธˆเธญเธ—เธตเนˆเธชเธญเธ‡เนƒเธ™เธ•เธฑเธง เน‚เธซเธกเธ”เน€เธ›เธดเธ”เนƒเธŠเน‰เธˆเธญเธ—เธตเนˆเธชเธญเธ‡เนƒเธ”เธเน‡เน„เธ”เน‰ เน‚เธซเธกเธ”เธ›เธดเธ”เธˆเธฐเนเธชเธ”เธ‡เธฅเธญเธ™เน€เธŠเธญเธฃเนŒเธšเธ™เธˆเธญเน€เธ”เธตเธขเธง + เน€เธ‹เธชเธŠเธฑเธ™เนเธšเธšเธชเธญเธ‡เธˆเธญ + เน‚เธซเธกเธ”เธญเธฑเธ•เน‚เธ™เธกเธฑเธ•เธดเธˆเธฐเธ•เธฃเธถเธ‡เน€เธกเธ™เธนเนƒเธ™เน€เธเธกเน„เธงเน‰เธšเธ™เธˆเธญเธ—เธตเนˆเธชเธญเธ‡เนƒเธ™เธ•เธฑเธงเนเธ—เธ™เธซเธ™เน‰เธฒเธ•เนˆเธฒเธ‡เธ›เนŠเธญเธ›เธญเธฑเธ› เน‚เธซเธกเธ”เน€เธ›เธดเธ”เนƒเธŠเน‰เธˆเธญเธ—เธตเนˆเธชเธญเธ‡เนƒเธ”เธเน‡เน„เธ”เน‰ เน‚เธซเธกเธ”เธ›เธดเธ”เธˆเธฐเน€เธเน‡เธšเน€เธกเธ™เธนเน„เธงเน‰เธšเธ™เธˆเธญเน€เธเธก เนเธ•เนˆเธขเธฑเธ‡เน€เธฅเธทเธญเธเธˆเธญเธ—เธตเนˆเธชเธญเธ‡เธˆเธฒเธเน€เธกเธ™เธนเน„เธ”เน‰ เธญเธฑเธ•เน‚เธ™เธกเธฑเธ•เธด เน€เธ›เธดเธ” เธ›เธดเธ” เธ›เธธเนˆเธกเธ„เธงเธšเธ„เธธเธกเธซเธ™เน‰เธฒเธˆเธญเธฅเนˆเธฒเธ‡เนƒเธ™เน€เธเธก + เธ„เธตเธขเนŒเธšเธญเธฃเนŒเธ” Android เธชเธณเธซเธฃเธฑเธšเธŠเนˆเธญเธ‡เธ‚เน‰เธญเธ„เธงเธฒเธก เน€เธ›เธดเธ”เนเธ—เธฃเน‡เธเนเธžเธ”เนเธฅเธฐเนเธ›เน‰เธ™เธžเธดเธกเธžเนŒเธšเธ™เธซเธ™เน‰เธฒเธˆเธญเธ—เธตเนˆเธชเธญเธ‡เน€เธกเธทเนˆเธญเน€เธฃเธดเนˆเธกเน€เธ‹เธชเธŠเธฑเธ™ เธเธณเธฅเธฑเธ‡เธžเธดเธกเธžเนŒเนƒเธซเน‰เธซเธ™เน‰เธฒเธˆเธญเธšเธ™ เน€เธชเธฃเน‡เธˆเธชเธดเน‰เธ™ เนเธญเธ›เธซเธ™เน‰เธฒเธˆเธญเธซเธฅเธฑเธเน€เธฃเธดเนˆเธกเธ•เน‰เธ™ เน€เธฅเธทเธญเธเนเธญเธ›เธซเธ™เน‰เธฒเธˆเธญเธซเธฅเธฑเธ + เธ‹เนˆเธญเธ™เนเธญเธ›เธซเธ™เน‰เธฒเธˆเธญเธซเธฅเธฑเธเธˆเธฒเธเธซเธ™เน‰เธฒเธˆเธญเนเธญเธ›เธฅเนˆเธฒเธชเธธเธ”เน€เธกเธทเนˆเธญเน„เธกเนˆเน„เธ”เน‰เนƒเธŠเน‰เธ‡เธฒเธ™ + เนƒเธŠเน‰เน€เธ‰เธžเธฒเธฐเน€เธกเธทเนˆเธญ DroidDeck เน€เธ›เน‡เธ™เนเธญเธ›เธซเธ™เน‰เธฒเธˆเธญเธซเธฅเธฑเธเน€เธฃเธดเนˆเธกเธ•เน‰เธ™เนเธฅเธฐเน„เธกเนˆเธกเธตเน€เธ‹เธชเธŠเธฑเธ™เธเธณเธฅเธฑเธ‡เธ—เธณเธ‡เธฒเธ™เธญเธขเธนเนˆ เน€เธฅเธทเธญเธ เนเธญเธ› Linux (เธ—เธ”เธฅเธญเธ‡) เน„เธŸเธฅเนŒ @@ -1003,9 +1065,172 @@ Preview เธเธฒเธฃเนเธเน‰เน„เธ‚เธฅเนˆเธฒเธชเธธเธ” เธเนˆเธญเธ™เธ–เธถเธ‡ Stable เน€เธ›เน‡เธ™เธฃเธธเนˆเธ™เธฅเนˆเธฒเธชเธธเธ”เนเธฅเน‰เธง + เธ„เธฑเธ”เธฅเธญเธเธฃเธฒเธขเธฅเธฐเน€เธญเธตเธขเธ”เธšเธดเธฅเธ”เนŒ + เธ„เธฑเธ”เธฅเธญเธเธฃเธฒเธขเธฅเธฐเน€เธญเธตเธขเธ”เธšเธดเธฅเธ”เนŒเนเธฅเน‰เธง + เนƒเธซเธกเนˆเธเธงเนˆเธฒ Preview + เธ„เธธเธ“เธ™เธณเธซเธ™เน‰เธฒ Preview + เธšเธดเธฅเธ”เนŒเธ™เธตเน‰เนƒเธซเธกเนˆเธเธงเนˆเธฒ Preview เธฅเนˆเธฒเธชเธธเธ” เธšเธดเธฅเธ”เนŒ Preview เธ–เธฑเธ”เน„เธ›เธˆเธฐเธญเธฑเธ›เน€เธ”เธ•เนƒเธซเน‰ + เน€เธฅเธทเธญเธเธšเธดเธฅเธ”เนŒเน€เธžเธทเนˆเธญเธ”เธนเธเธฒเธฃเน€เธ›เธฅเธตเนˆเธขเธ™เนเธ›เธฅเธ‡เธซเธฃเธทเธญเธ•เธดเธ”เธ•เธฑเน‰เธ‡ + เธ•เธดเธ”เธ•เธฑเน‰เธ‡เนเธฅเน‰เธง + เธ•เธดเธ”เธ•เธฑเน‰เธ‡เธšเธดเธฅเธ”เนŒเธ™เธตเน‰%1$s + เธขเน‰เธญเธ™เธเธฅเธฑเธšเน„เธ›เธšเธดเธฅเธ”เนŒเธ™เธตเน‰%1$s + versionCode %1$d + เธ„เธญเธกเธกเธดเธ• %1$s + เธซเธ™เน‰เธฒเธฃเธตเธฅเธตเธช + PR เธ™เธตเน‰เธกเธตเธ„เธญเธกเธกเธดเธ•เนƒเธซเธกเนˆเธเธงเนˆเธฒ (%1$s) เธšเธดเธฅเธ”เนŒเธ—เธ”เธชเธญเธšเธ‚เธญเธ‡เธ„เธญเธกเธกเธดเธ•เธ™เธฑเน‰เธ™เธขเธฑเธ‡เน„เธกเนˆเธžเธฃเน‰เธญเธก เธšเธดเธฅเธ”เนŒเธ™เธตเน‰เธˆเธถเธ‡เธขเธฑเธ‡เน„เธกเนˆเธกเธตเธ„เธญเธกเธกเธดเธ•เธ™เธฑเน‰เธ™ + เธกเธตเธ„เธญเธกเธกเธดเธ•เนƒเธซเธกเนˆ เธฃเธญเธšเธดเธฅเธ”เนŒ + เธซเธกเธฒเธขเน€เธฅเธ‚ PR เธŠเธทเนˆเธญ เธซเธฃเธทเธญเธœเธนเน‰เน€เธ‚เธตเธขเธ™ + เน„เธกเนˆเธกเธตเธšเธดเธฅเธ”เนŒเธ—เธ”เธชเธญเธšเธ—เธตเนˆเธ•เธฃเธ‡เธเธฑเธ™ + เธ•เน‰เธญเธ‡เธšเธดเธฅเธ”เนŒเนƒเธซเธกเนˆ (versionCode %1$d) + เธญเธฑเธ›เน€เธ”เธ•เธšเธดเธฅเธ”เนŒเธ—เธ”เธชเธญเธš + เธšเธดเธฅเธ”เนŒเธ—เธ”เธชเธญเธšเนƒเธซเธกเนˆเธ‚เธญเธ‡ PR #%1$d + %1$s เน€เธ›เธดเธ”เธญเธฑเธ›เน€เธ”เธ•เน€เธžเธทเนˆเธญเธ•เธดเธ”เธ•เธฑเน‰เธ‡ + เนเธชเธ”เธ‡เน€เธžเธดเนˆเธก (%1$d) + เธ•เน‰เธญเธ‡เธšเธดเธฅเธ”เนŒเนƒเธซเธกเนˆเธชเธณเธซเธฃเธฑเธš versionCode %2$d (%1$d) + เธšเธดเธฅเธ”เนŒ Preview เธšเธ™ main เธซเธฅเธฑเธ‡เธšเธดเธฅเธ”เนŒเธ—เธ”เธชเธญเธšเธ™เธตเน‰: %1$d เธšเธดเธฅเธ”เนŒเธ—เธ”เธชเธญเธš เธฅเธญเธ‡เธเธฒเธฃเนเธเน‰เน„เธ‚เธเนˆเธญเธ™เน€เธœเธขเนเธžเธฃเนˆเธˆเธฃเธดเธ‡ เน„เธกเนˆเธกเธตเนƒเธ™เธ‚เธ“เธฐเธ™เธตเน‰ + เธšเธดเธฅเธ”เนŒเธ—เธ”เธฅเธญเธ‡ + เธšเธดเธฅเธ”เนŒเธ—เธ”เธฅเธญเธ‡ + เธเธณเธฅเธฑเธ‡เนƒเธŠเน‰เธ‡เธฒเธ™ + เธซเธขเธธเธ”เธŠเธฑเนˆเธงเธ„เธฃเธฒเธงเธซเธฅเธฑเธ‡ Android เธ—เธณเธเธฒเธฃเธ›เธฃเธฑเธšเนเธ•เนˆเธ‡ DroidDeck เนƒเธซเธกเนˆ + เน„เธกเนˆเน„เธ”เน‰เน‚เธซเธฅเธ”: %1$s + เธฃเธญเธเธฒเธฃเธฃเธตเธชเธ•เธฒเธฃเนŒเธ— + เน€เธเน‡เธšเน„เธงเน‰ + เธชเธณเธซเธฃเธฑเธšเน€เธงเธญเธฃเนŒเธŠเธฑเธ™เธญเธทเนˆเธ™ + เธชเธฃเน‰เธฒเธ‡เนƒเธซเธกเนˆ + เธฅเธšเธšเธดเธฅเธ”เนŒเธ™เธตเน‰เธญเธญเธเธˆเธฒเธเธญเธธเธ›เธเธฃเธ“เนŒ + เธฃเธตเธชเธ•เธฒเธฃเนŒเธ—เธ”เน‰เธงเธขเธšเธดเธฅเธ”เนŒเธ™เธตเน‰ + เธ›เธดเธ” + เนƒเธŠเน‰ + เธฅเธš + เธฅเธšเธ•เธญเธ™เธ™เธตเน‰ + เน€เธ•เธฃเธตเธขเธกเธเธฒเธฃเธฃเธตเธชเธ•เธฒเธฃเนŒเธ—เน„เธกเนˆเธชเธณเน€เธฃเน‡เธˆ: %1$s เธˆเธฑเธšเธ„เธนเนˆเธเธฒเธฃเธ”เธตเธšเธฑเธเนเธšเธšเน„เธฃเน‰เธชเธฒเธขเนƒเธ™เธซเธ™เน‰เธฒเธ•เธฑเน‰เธ‡เธ„เนˆเธฒ เนเธฅเน‰เธงเธฅเธญเธ‡เธญเธตเธเธ„เธฃเธฑเน‰เธ‡ + เธ•เธดเธ”เธ•เธฑเน‰เธ‡เธšเธดเธฅเธ”เนŒเธ—เธ”เธฅเธญเธ‡เนเธฅเน‰เธง + DroidDeck เธฃเธตเธชเธ•เธฒเธฃเนŒเธ—เธ”เน‰เธงเธข %1$s เนเธฅเน‰เธง + เธซเธขเธธเธ”เธšเธดเธฅเธ”เนŒ Lab เธŠเธฑเนˆเธงเธ„เธฃเธฒเธง + Android เธ›เธฃเธฑเธšเนเธ•เนˆเธ‡ DroidDeck เนƒเธซเธกเนˆ เธˆเธถเธ‡เน„เธกเนˆเน„เธ”เน‰เน‚เธซเธฅเธ” %1$s เน€เธ›เธดเธ” Updates เน€เธžเธทเนˆเธญเน€เธฃเธดเนˆเธกเนƒเธซเธกเนˆเธ”เน‰เธงเธขเธšเธดเธฅเธ”เนŒเธ™เธฑเน‰เธ™ + เธ›เธดเธ”เธšเธดเธฅเธ”เนŒ Lab เนเธฅเน‰เธง + เธšเธดเธฅเธ”เนŒเธ™เธตเน‰เธชเธฃเน‰เธฒเธ‡เธชเธณเธซเธฃเธฑเธš DroidDeck เน€เธงเธญเธฃเนŒเธŠเธฑเธ™เธญเธทเนˆเธ™ เนเธฅเธฐเธ–เธนเธเน€เธเน‡เธšเน„เธงเน‰เนƒเธ™ Updates + DroidDeck เน€เธฃเธดเนˆเธกเธ”เน‰เธงเธขเธšเธดเธฅเธ”เนŒเธ™เธตเน‰เน„เธกเนˆเธชเธณเน€เธฃเน‡เธˆ 2 เธ„เธฃเธฑเน‰เธ‡ + เธœเธนเน‰เธŠเนˆเธงเธข + เธœเธนเน‰เธŠเนˆเธงเธข + เธœเธนเน‰เธŠเนˆเธงเธขเธเธณเธฅเธฑเธ‡เธ—เธณเธ‡เธฒเธ™ + เธ•เธดเธ”เธ•เธฑเน‰เธ‡ Claude Code เนƒเธ™เธžเธทเน‰เธ™เธ—เธตเนˆเธœเธนเน‰เนƒเธŠเน‰ Linux เน€เธžเธทเนˆเธญเนƒเธŠเน‰เธœเธนเน‰เธŠเนˆเธงเธข + เธ–เธฒเธกเน€เธเธตเนˆเธขเธงเธเธฑเธšเน€เธเธก เธญเธฒเธเธฒเธฃเนเธ„เธฃเธŠ เธซเธฃเธทเธญเธเธฒเธฃเน€เธ›เธฅเธตเนˆเธขเธ™เนเธ›เธฅเธ‡เนƒเธ™ DroidDeck + เธชเนˆเธ‡ + เธšเธ—เธชเธ™เธ—เธ™เธฒเนƒเธซเธกเนˆ + เธซเธขเธธเธ” + เธ—เธตเนˆเน€เธเน‡เธšเธ‚เน‰เธญเธกเธนเธฅ + เธฅเธš + เธฅเธšเธ•เธญเธ™เธ™เธตเน‰ + Claude Code + Codex + เธ‹เธญเธฃเนŒเธชเน‚เธ„เน‰เธ” DroidDeck + เนเธ„เธŠเธ—เธตเนˆเธ”เธฒเธงเธ™เนŒเน‚เธซเธฅเธ” + เธเธฒเธฃเน€เธ›เธฅเธตเนˆเธขเธ™เนเธ›เธฅเธ‡เธ—เธตเนˆเธขเธฑเธ‡เน„เธกเนˆเน„เธ”เน‰เธžเธธเธŠเธˆเธฐเธซเธฒเธขเน„เธ› + เธ•เธญเธ™เธชเธฃเน‰เธฒเธ‡เธšเธดเธฅเธ”เนŒเธˆเธฐเธ”เธฒเธงเธ™เนŒเน‚เธซเธฅเธ”เนƒเธซเธกเนˆเธญเธตเธเธ„เธฃเธฑเน‰เธ‡ + เธ•เธดเธ”เธ•เธฑเน‰เธ‡เนƒเธซเธกเนˆเน„เธ”เน‰เธˆเธฒเธเธเธฒเธฃเธ•เธฑเน‰เธ‡เธ„เนˆเธฒ เนเธฅเธฐเธขเธฑเธ‡เธ„เธ‡เธเธฒเธฃเน€เธ‚เน‰เธฒเธชเธนเนˆเธฃเธฐเธšเธšเน„เธงเน‰ + DroidDeck เน€เธฃเธดเนˆเธกเนƒเธซเธกเนˆเธ”เน‰เธงเธขเธšเธดเธฅเธ”เนŒ Lab เธ‚เธญเธ‡เธ„เธธเธ“ เธ—เธณเธ•เนˆเธญเน„เธ”เน‰เธˆเธฒเธเธ—เธตเนˆเธ„เน‰เธฒเธ‡เน„เธงเน‰ + เธ–เธฒเธกเธงเนˆเธฒเธ—เธณเน„เธกเน€เธเธกเธ–เธถเธ‡เน„เธกเนˆเน€เธฃเธดเนˆเธก เนƒเธซเน‰เธญเธ˜เธดเธšเธฒเธขเธฅเน‡เธญเธ เธซเธฃเธทเธญเนƒเธซเน‰เน€เธ›เธฅเธตเนˆเธขเธ™ DroidDeck เนเธฅเน‰เธงเธฅเธญเธ‡เธšเธ™เน€เธ„เธฃเธทเนˆเธญเธ‡เธ™เธตเน‰ + เธฅเน‰เธกเน€เธซเธฅเธง: %1$s + %1$s เธˆเธšเธเธฒเธฃเธ—เธณเธ‡เธฒเธ™ (เธฃเธซเธฑเธชเธญเธญเธ %2$d) + เธซเธขเธธเธ”เนเธฅเน‰เธง + เธˆเธšเน‚เธ”เธขเน„เธกเนˆเธกเธตเธ„เธณเธ•เธญเธš + เธฅเธญเธ‡เนƒเธซเธกเนˆ + เธเธณเธฅเธฑเธ‡เธ•เธฑเน‰เธ‡เธ„เนˆเธฒเธœเธนเน‰เธŠเนˆเธงเธข + เธชเธฃเน‰เธฒเธ‡เธšเธดเธฅเธ”เนŒ Lab %1$s เธ‚เธญเธ‡เธ‰เธฑเธ™เนƒเธซเธกเนˆเธชเธณเธซเธฃเธฑเธš DroidDeck เน€เธงเธญเธฃเนŒเธŠเธฑเธ™เธ—เธตเนˆเธ•เธดเธ”เธ•เธฑเน‰เธ‡เธญเธขเธนเนˆ เนเธฅเน‰เธงเน€เธฃเธดเนˆเธกเนƒเธซเธกเนˆเธ”เน‰เธงเธขเธšเธดเธฅเธ”เนŒเธ™เธฑเน‰เธ™ + %1$s เน€เธ‚เน‰เธฒ ยท %2$s เธญเธญเธ + เธเธณเธฅเธฑเธ‡เธ„เธดเธ” + เธ„เธงเธฒเธกเธ„เธดเธ” + เธเธณเธฅเธฑเธ‡เธ„เธดเธ” ยท %1$s + %1$s ยท %2$s + เธ‚เน‰เธญเธกเธนเธฅเน€เธ‚เน‰เธฒ + เธ‚เน‰เธญเธกเธนเธฅเธญเธญเธ + เธเธณเธฅเธฑเธ‡เธ—เธณเธ‡เธฒเธ™โ€ฆ + เน„เธกเนˆเธกเธตเธœเธฅเธฅเธฑเธžเธ˜เนŒ: เธฃเธญเธšเธชเธ™เธ—เธ™เธฒเธˆเธšเธฅเธ‡เธเนˆเธญเธ™ + เน„เธกเนˆเธกเธตเธ‚เน‰เธญเธกเธนเธฅเนเธชเธ”เธ‡เธœเธฅ + เธžเธดเธกเธžเนŒเน€เธžเธทเนˆเธญเน€เธ‚เน‰เธฒเธ„เธดเธงเธ‚เน‰เธญเธ„เธงเธฒเธกเธ–เธฑเธ”เน„เธ› + เน€เธ‚เน‰เธฒเธ„เธดเธง + เธ–เธฑเธ”เน„เธ›: %1$s + เน„เธกเนˆเธ•เน‰เธญเธ‡เธชเนˆเธ‡ + เนเธ™เธš + เธ™เธณเธญเธญเธ + เธ„เนˆเธฒเน€เธฃเธดเนˆเธกเธ•เน‰เธ™ + เธฃเธฐเธ”เธฑเธšเธเธฒเธฃเนƒเธŠเน‰เน€เธซเธ•เธธเธœเธฅ + เธ”เธณเน€เธ™เธดเธ™เธเธฒเธฃ + เนเธเน‰เน„เธ‚ + เธขเธฑเธ‡เน„เธกเนˆเธกเธตเธเธฒเธฃเน€เธ›เธฅเธตเนˆเธขเธ™เนเธ›เธฅเธ‡ + เธ”เธณเน€เธ™เธดเธ™เธเธฒเธฃเธ•เธฒเธกเนเธœเธ™เน„เธ”เน‰เน€เธฅเธข + เธชเนˆเธ‡เธ•เธญเธ™เธ™เธตเน‰ + เน€เธžเธดเนˆเธกเน€เธ•เธดเธก + เธ›เธดเธ” + เธฅเนˆเธฒเธชเธธเธ” + เธเธณเธฅเธฑเธ‡เธ—เธณเธ‡เธฒเธ™ + เธšเธฃเธดเธšเธ— + %1$s เธˆเธฒเธ %2$s + เธเธฒเธฃเธชเธ™เธ—เธ™เธฒเธ™เธตเน‰ ยท %1$s + เธเธฒเธฃเนƒเธŠเน‰เธ‡เธฒเธ™เธˆเธฐเนเธชเธ”เธ‡เธซเธฅเธฑเธ‡เธˆเธฒเธเธ•เธญเธšเธเธฅเธฑเธšเธ„เธฃเธฑเน‰เธ‡เนเธฃเธ + เธ‚เธตเธ”เธˆเธณเธเธฑเธ” %1$d เธŠเธฑเนˆเธงเน‚เธกเธ‡ + เธ‚เธตเธ”เธˆเธณเธเธฑเธ” %1$d เธ™เธฒเธ—เธต + เธ‚เธตเธ”เธˆเธณเธเธฑเธ”เธฃเธฒเธขเธชเธฑเธ›เธ”เธฒเธซเนŒ + %1$d%% ยท เธฃเธตเน€เธ‹เน‡เธ• %2$s + + %1$d เน„เธŸเธฅเนŒ + %1$d เน„เธŸเธฅเนŒ + + เธงเธฒเธ‡เนเธœเธ™เธเนˆเธญเธ™ + เธงเธฒเธ‡เนเธœเธ™ + เน€เธชเธ™เธญเนเธœเธ™เน‚เธ”เธขเน„เธกเนˆเน€เธ›เธฅเธตเนˆเธขเธ™เนเธ›เธฅเธ‡เธชเธดเนˆเธ‡เนƒเธ” + เธšเธ—เธชเธ™เธ—เธ™เธฒ + เธขเธฑเธ‡เน„เธกเนˆเธกเธตเธšเธ—เธชเธ™เธ—เธ™เธฒ + เน€เธกเธทเนˆเธญเธชเธฑเธเธ„เธฃเธนเนˆ + เธฅเธš + เธฅเธšเธ—เธฑเน‰เธ‡เธšเธ—เธชเธ™เธ—เธ™เธฒเนเธฅเธฐเน„เธŸเธฅเนŒเนเธ™เธš + เน‚เธ›เธฃเน€เธ‹เธช + เน„เธกเนˆเธกเธตเน‚เธ›เธฃเน€เธ‹เธชเนƒเธ”เธ—เธณเธ‡เธฒเธ™เนƒเธ™เธžเธทเน‰เธ™เธ—เธตเนˆเธœเธนเน‰เนƒเธŠเน‰เธ‚เธญเธ‡ Linux + เน€เธญเน€เธˆเธ™เธ•เนŒ + เธซเธขเธธเธ” + เธšเธดเธฅเธ”เนŒ Lab + เธเธณเธฅเธฑเธ‡เน€เธ•เธฃเธตเธขเธกเธšเธดเธฅเธ”เนŒ Lab + %1$d%% ยท เน€เธซเธฅเธทเธญเธญเธตเธเธ›เธฃเธฐเธกเธฒเธ“ %2$s + เน€เธซเธฅเธทเธญเธญเธตเธเธ›เธฃเธฐเธกเธฒเธ“ %1$s + เธขเธเน€เธฅเธดเธ + เธขเธเน€เธฅเธดเธเธšเธดเธฅเธ”เนŒ + เธเธณเธฅเธฑเธ‡เน€เธฃเธดเนˆเธก + %1$d%% + เธเธณเธฅเธฑเธ‡เธˆเธฑเธ”เธ—เธณเนเธžเน‡เธเน€เธเธˆ + เธเธณเธฅเธฑเธ‡เน€เธฃเธดเนˆเธก DroidDeck เนƒเธซเธกเนˆเธšเธ™เธ™เธฑเน‰เธ™ + เน€เธชเธฃเน‡เธˆเนเธฅเน‰เธง + เธฅเน‰เธกเน€เธซเธฅเธง: %1$s + เธ•เธฑเน‰เธ‡เธ„เนˆเธฒเน€เธญเน€เธˆเธ™เธ•เนŒ + เธ•เธดเธ”เธ•เธฑเน‰เธ‡เธฃเธฑเธ™เน„เธ—เธกเนŒ Linux เนƒเธ™เธซเธ™เน‰เธฒเธ•เธฑเน‰เธ‡เธ„เนˆเธฒเธเนˆเธญเธ™ + เธฅเธญเธ‡เธญเธตเธเธ„เธฃเธฑเน‰เธ‡ + เน€เธฃเธดเนˆเธกเธชเธ™เธ—เธ™เธฒ + เธเธฒเธฃเน€เธŠเธทเนˆเธญเธกเธ•เนˆเธญเธญเธธเธ›เธเธฃเธ“เนŒ + เธ”เธตเธšเธฑเธเนเธšเธšเน„เธฃเน‰เธชเธฒเธข เน€เธžเธทเนˆเธญเนƒเธซเน‰เน€เธญเน€เธˆเธ™เธ•เนŒเธกเธญเธ‡เน€เธซเน‡เธ™เนเธฅเธฐเธ„เธงเธšเธ„เธธเธก DroidDeck เน„เธ”เน‰ + เธ•เธดเธ”เธ•เธฑเน‰เธ‡ %1$s + เธฅเธ‡เนƒเธ™เธชเธ เธฒเธžเนเธงเธ”เธฅเน‰เธญเธกเธœเธนเน‰เนƒเธŠเน‰ Linux เธžเธฃเน‰เธญเธก git, gh เนเธฅเธฐ adb + เธฅเธ‡เธŠเธทเนˆเธญเน€เธ‚เน‰เธฒเนƒเธŠเน‰ %1$s + เน€เธ›เธดเธ”เน€เธšเธฃเธฒเธงเนŒเน€เธ‹เธญเธฃเนŒเธ‚เธญเธ‡เธ„เธธเธ“ + GitHub + เน„เธกเนˆเธšเธฑเธ‡เธ„เธฑเธš เธชเธณเธซเธฃเธฑเธšเน€เธ›เธดเธ”เธžเธนเธฅเธฃเธตเน€เธ„เธงเธชเธ•เนŒ + เน€เธ„เธฃเธทเนˆเธญเธ‡เธกเธทเธญเธšเธดเธฅเธ”เนŒ + เน„เธกเนˆเธšเธฑเธ‡เธ„เธฑเธš เธชเธณเธซเธฃเธฑเธšเธšเธดเธฅเธ”เนŒ Lab เธšเธ™เน€เธ„เธฃเธทเนˆเธญเธ‡เธ™เธตเน‰ ยท เธ›เธฃเธฐเธกเธฒเธ“ 5 GB + เน€เธญเน€เธˆเธ™เธ•เนŒเธžเธฃเน‰เธญเธกเนเธฅเน‰เธง + เธ•เธฑเน‰เธ‡เธ„เนˆเธฒเน€เธญเน€เธˆเธ™เธ•เนŒเนƒเธซเน‰เน€เธฃเธตเธขเธšเธฃเน‰เธญเธข + เธฅเธ‡เธŠเธทเนˆเธญเน€เธ‚เน‰เธฒเนƒเธŠเน‰ %1$s เนเธฅเน‰เธง + เธšเธดเธฅเธ”เนŒ Lab + เธšเธดเธฅเธ”เนŒเน€เธฃเน‡เธง + เธšเธดเธฅเธ”เนŒ Lab เนเธšเธšเน€เธฃเน‡เธง + เธ„เธญเธกเน„เธžเธฅเนŒเน€เธงเธญเธฃเนŒเธŠเธฑเธ™เธ™เธตเน‰เธฅเนˆเธงเธ‡เธซเธ™เน‰เธฒ เน€เธžเธทเนˆเธญเนƒเธซเน‰เธšเธดเธฅเธ”เนŒ Lab เนƒเธŠเน‰เน€เธงเธฅเธฒเน€เธžเธตเธขเธ‡เน„เธกเนˆเธเธตเนˆเธ™เธฒเธ—เธต ยท เธ—เธณเธ„เธฃเธฑเน‰เธ‡เน€เธ”เธตเธขเธง เธ›เธฃเธฐเธกเธฒเธ“ 20 เธ™เธฒเธ—เธต + เธเธณเธฅเธฑเธ‡เธ„เธญเธกเน„เธžเธฅเนŒ ยท %1$d%% ยท เน€เธซเธฅเธทเธญเธญเธตเธเธ›เธฃเธฐเธกเธฒเธ“ %2$s + เน€เธ•เธฃเธตเธขเธก + เน€เธŠเธทเนˆเธญเธกเธ•เนˆเธญเธเธฒเธฃเธ”เธตเธšเธฑเธเนเธšเธšเน„เธฃเน‰เธชเธฒเธขเน„เธกเนˆเน„เธ”เน‰; เธˆเธฑเธšเธ„เธนเนˆเธˆเธฐเน€เธ›เธดเธ”เนƒเธŠเน‰เธ‡เธฒเธ™ + เธˆเธฑเธšเธ„เธนเนˆ + เธ•เธดเธ”เธ•เธฑเน‰เธ‡ + เธฅเธ‡เธŠเธทเนˆเธญเน€เธ‚เน‰เธฒเนƒเธŠเน‰ PR #%1$d เน„เธกเนˆเน„เธ”เน‰เธชเธฃเน‰เธฒเธ‡เน„เธงเน‰เธชเธณเธซเธฃเธฑเธšเธชเธณเน€เธ™เธฒเธ™เธตเน‰เธ‚เธญเธ‡ DroidDeck เธญเธฑเธ›เน€เธ”เธ•เนเธฅเน‰เธง %1$s @@ -1241,6 +1466,9 @@ เนเธญเธ› เธเธฒเธฃเธ•เธฑเน‰เธ‡เธ„เนˆเธฒ เธเธฒเธฃเธญเธฑเธ›เน€เธ”เธ• + เน€เธžเธดเนˆเธกเน€เธ•เธดเธก + เนเธเน‰เน„เธ‚เนเธ—เน‡เธš + เนเธ—เน‡เธš %1$d%% เธ”เธณเน€เธ™เธดเธ™เธเธฒเธฃเธ•เนˆเธญ %1$s เนเธชเธ”เธ‡เน€เธ›เน‡เธ™ /root/ROMs เนƒเธ™เนเธ•เนˆเธฅเธฐเน€เธ‹เธชเธŠเธฑเธ™ เธžเธทเน‰เธ™เธ—เธตเนˆเธˆเธฑเธ”เน€เธเน‡เธšเธ เธฒเธขเนƒเธ™เธญเธขเธนเนˆเธ—เธตเนˆ /root/Storage @@ -1262,6 +1490,15 @@ เธขเธเน€เธฅเธดเธเธฃเธฒเธขเธเธฒเธฃเธ—เธตเนˆเธฃเธญเธญเธขเธนเนˆ เนเธ›เน‰เธ™เธžเธดเธกเธžเนŒ Android เธ‹เนˆเธญเธ™ โœ• + เธ‚เธ™เธฒเธ”เธšเธ™เธซเธ™เน‰เธฒเธˆเธญ + เธชเธฑเธ”เธชเนˆเธงเธ™เธซเธ™เน‰เธฒเธˆเธญเธ—เธตเนˆเธ„เธตเธขเนŒเธšเธญเธฃเนŒเธ”เนƒเธŠเน‰ เธฃเธงเธกเนเธ–เธšเธซเธฑเธงเธ”เน‰เธงเธข + เธ„เธงเธฒเธกเธ—เธถเธšเนเธชเธ‡ + เธฅเธ”เธ„เนˆเธฒเธ™เธตเน‰เน€เธžเธทเนˆเธญเนƒเธซเน‰เน€เธซเน‡เธ™เน€เธเธกเธ”เน‰เธฒเธ™เธซเธฅเธฑเธ‡เธ„เธตเธขเนŒเธšเธญเธฃเนŒเธ” + เธ›เธธเนˆเธกเธ—เธตเนˆเธ‹เนˆเธญเธ™เน„เธงเน‰ + เธ›เธธเนˆเธกเธ—เธตเนˆเนƒเธŠเน‰เน„เธกเนˆเธšเนˆเธญเธขเธˆเธฐเน„เธกเนˆเนเธชเธ”เธ‡เธšเธ™เธ„เธตเธขเนŒเธšเธญเธฃเนŒเธ” + Esc เนเธฅเธฐเนเธ–เธงเธ›เธธเนˆเธกเธŸเธฑเธ‡เธเนŒเธŠเธฑเธ™ + Ins / Del / Home / End / PgUp / PgDn + เธ›เธธเนˆเธกเธฅเธนเธเธจเธฃ เน€เธ›เธดเธ” %1$s เน€เธฅเธทเธญเธเธซเธ™เน‰เธฒเธˆเธญ เธซเธ™เน‰เธฒเธˆเธญเธ—เธตเนˆเธชเธญเธ‡: %1$s เธซเธ™เน‰เธฒเธˆเธญเธ—เธตเนˆเธชเธญเธ‡เน„เธกเนˆเธžเธฃเน‰เธญเธกเนƒเธŠเน‰เธ‡เธฒเธ™เนเธฅเน‰เธง @@ -1746,7 +1983,24 @@ เน€เธ—เธญเธฃเนŒเธกเธดเธ™เธฑเธฅ เธ›เธธเนˆเธกเธ”เน‰เธฒเธ™เธซเธฅเธฑเธ‡เนเธฅเธฐเนเธ—เธฃเน‡เธเนเธžเธ”เธ‚เธญเธ‡ Deck เนเธ”เธŠเธšเธญเธฃเนŒเธ” + เน€เธ”เธชเธเนŒเธ—เน‡เธญเธ› + เน€เธฃเธดเนˆเธกเน€เธ”เธชเธเนŒเธ—เน‡เธญเธ› + เน€เธ”เธชเธเนŒเธ—เน‡เธญเธ› ยท %1$s + เธ—เธฑเธŠเนเธžเธ” + เธชเธฑเธกเธœเธฑเธชเน‚เธ”เธขเธ•เธฃเธ‡ + เธ—เธฑเธŠเนเธžเธ” เนเธ•เธฐเน€เธžเธทเนˆเธญเนƒเธŠเน‰เธชเธฑเธกเธœเธฑเธชเน‚เธ”เธขเธ•เธฃเธ‡ + เธชเธฑเธกเธœเธฑเธชเน‚เธ”เธขเธ•เธฃเธ‡ เนเธ•เธฐเน€เธžเธทเนˆเธญเนƒเธŠเน‰เธ—เธฑเธŠเนเธžเธ” + เธเธณเธฅเธฑเธ‡เน€เธฃเธดเนˆเธกเน€เธ”เธชเธเนŒเธ—เน‡เธญเธ› KDEโ€ฆ + เน€เธ”เธชเธเนŒเธ—เน‡เธญเธ›เธ›เธดเธ”เนเธฅเน‰เธง + เน€เธฃเธดเนˆเธกเน€เธ”เธชเธเนŒเธ—เน‡เธญเธ›เน„เธกเนˆเน„เธ”เน‰ เธšเธฑเธ™เธ—เธถเธเธญเธขเธนเนˆเนƒเธ™เน‚เธŸเธฅเน€เธ”เธญเธฃเนŒ bottom-desktop เธ‚เธญเธ‡เน€เธ‹เธชเธŠเธฑเธ™เธ™เธตเน‰ + เน€เธ”เธชเธเนŒเธ—เน‡เธญเธ›เธ›เธดเธ”เธญเธขเธนเนˆ เธขเธฑเธ‡เน„เธกเนˆเธกเธตเธญเธฐเน„เธฃเนƒเธซเน‰เนเธชเธ”เธ‡เธ—เธตเนˆเธ™เธตเนˆ + เธชเธฅเธฑเธšเธซเธ™เน‰เธฒเธˆเธญ + เธซเธ™เน‰เธฒเธˆเธญเธฅเนˆเธฒเธ‡เน„เธกเนˆเธงเนˆเธฒเธ‡เธ•เธญเธ™เธ™เธตเน‰ + เธซเธ™เน‰เธฒเธˆเธญเน€เธเธก + เนเธชเธ”เธ‡เน€เธเธกเธ—เธตเนˆ + เธซเธ™เน‰เธฒเธˆเธญเธšเธ™ + เธซเธ™เน‰เธฒเธˆเธญเธฅเนˆเธฒเธ‡ เธ”เธฒเธงเธ™เนŒเน‚เธซเธฅเธ” เน„เธกเนˆเธกเธตเธเธฒเธฃเธ”เธฒเธงเธ™เนŒเน‚เธซเธฅเธ”เธ—เธตเนˆเธเธณเธฅเธฑเธ‡เธ—เธณเธ‡เธฒเธ™ Steam @@ -1781,6 +2035,20 @@ เน€เธŠเธทเน‰เธญเน€เธžเธฅเธดเธ‡, t เธซเธฅเธฑเธ %1$s t เธชเธณเธฃเธญเธ‡ %1$s t + เน€เธงเธฅเธฒเธ•เนˆเธญเน€เธŸเธฃเธก + เธขเน‰เธญเธ™เธซเธฅเธฑเธ‡ %1$d เธงเธดเธ™เธฒเธ—เธต + เน€เธŸเธฃเธกเน€เธ‰เธฅเธตเนˆเธข + เธ„เนˆเธฒ 1% เธ•เนˆเธณเธชเธธเธ” + เน€เธŸเธฃเธกเธ—เธตเนˆเน€เธเธดเธ™ 33 ms + %1$d / เธ™เธฒเธ—เธต + เน€เธฅเนˆเธ™เธกเธฒเนเธฅเน‰เธง %1$s + %1$d เธ„เธญเธฃเนŒ เธชเธนเธ‡เธชเธธเธ” %2$s GHz + %1$d เธ„เธญเธฃเนŒ + เน€เธเธก + FPS เธ—เธตเนˆ %1$d Hz + เธ‚เธตเธ”เธชเธตเนเธ”เธ‡เธ„เธทเธญเธˆเธธเธ”เธ—เธตเนˆ HUD เนเธชเธ”เธ‡เธญเธธเธ“เธซเธ เธนเธกเธดเน€เธ›เน‡เธ™เธชเธตเนเธ”เธ‡ + เธ—เธฑเน‰เธ‡เน€เธ„เธฃเธทเนˆเธญเธ‡ + เนเธšเธ•เน€เธ•เธญเธฃเธตเนˆ เธชเนˆเธ‡เธ‚เน‰เธญเธกเธนเธฅเนเธ”เธŠเธšเธญเธฃเนŒเธ” เธญเธฑเธ•เน‚เธ™เธกเธฑเธ•เธด เน€เธ›เธดเธ”เนƒเธŠเน‰เธชเธณเธซเธฃเธฑเธšเธ—เธธเธเน€เธเธกเธ—เธตเนˆเนเธชเธ”เธ‡เธ—เธตเนˆเธ™เธตเนˆ เธฃเธงเธกเธ–เธถเธ‡เน€เธเธกเธ—เธตเนˆเธžเธšเนƒเธ™เธ เธฒเธขเธซเธฅเธฑเธ‡ เน€เธเธกเธ—เธตเนˆเธ„เธธเธ“เธ›เธดเธ”เน„เธงเน‰เธˆเธฐเธขเธฑเธ‡เธ„เธ‡เธ›เธดเธ”เธญเธขเธนเนˆ @@ -1804,6 +2072,10 @@ เน„เธกเธ„เนŒเธ›เธดเธ”เธญเธขเธนเนˆเธชเธณเธซเธฃเธฑเธšเน€เธเธกเธ™เธตเน‰ เธซเธฒเธเธ•เน‰เธญเธ‡เธเธฒเธฃเธžเธนเธ” เนƒเธซเน‰เน€เธ›เธดเธ”เน„เธกเน‚เธ„เธฃเน‚เธŸเธ™เนƒเธ™เธเธฒเธฃเธ•เธฑเน‰เธ‡เธ„เนˆเธฒ Steam เธ‚เธญเธ‡ DroidDeck (เน€เธชเธตเธขเธ‡) เนเธฅเน‰เธงเน€เธฃเธดเนˆเธกเน€เธเธกเธญเธตเธเธ„เธฃเธฑเน‰เธ‡ เธฃเธฐเธ”เธฑเธšเน€เธชเธตเธขเธ‡ %1$d%% เธชเธ–เธดเธ•เธดเนƒเธ™เน€เธเธก + HUD เธซเธ™เน‰เธฒเธˆเธญเธฅเนˆเธฒเธ‡ + เนเธ–เธšเนƒเธ™เธ—เธธเธเนเธ—เน‡เธš + เธ„เนˆเธฒ 1% เนเธฅเธฐ 0.1% เธ•เนˆเธณเธชเธธเธ” + เธญเธธเธ“เธซเธ เธนเธกเธด CPU FPS CPU GPU @@ -1975,6 +2247,7 @@ เธเธณเธฅเธฑเธ‡เน€เธฃเธดเนˆเธกเน€เธ‹เธชเธŠเธฑเธ™โ€ฆ เธœเนˆเธฒเธ™เน„เธ› %1$d:%2$02d ยท เธขเธฑเธ‡เธ—เธณเธ‡เธฒเธ™เธญเธขเธนเนˆ เธเธณเธฅเธฑเธ‡เธ”เธฒเธงเธ™เนŒเน‚เธซเธฅเธ”เธญเธฑเธ›เน€เธ”เธ•เน„เธ„เธฅเน€เธญเธ™เธ•เนŒ Steam ยท %1$d%% + เธเธณเธฅเธฑเธ‡เธ•เธดเธ”เธ•เธฑเน‰เธ‡เธญเธฑเธ›เน€เธ”เธ•เน„เธ„เธฅเน€เธญเธ™เธ•เนŒ Steamโ€ฆ เธเธณเธฅเธฑเธ‡เธ”เธฒเธงเธ™เนŒเน‚เธซเธฅเธ”เน„เธ„เธฅเน€เธญเธ™เธ•เนŒ Steam ยท %1$s เธกเธตเธเธฒเธฃเธ•เธดเธ”เธ•เธฑเน‰เธ‡เน€เธ„เธฃเธทเนˆเธญเธ‡เธกเธทเธญเธ„เธงเธฒเธกเน€เธ‚เน‰เธฒเธเธฑเธ™เน„เธ”เน‰เธญเธทเนˆเธ™เธเธณเธฅเธฑเธ‡เธ—เธณเธ‡เธฒเธ™เธญเธขเธนเนˆเนเธฅเน‰เธง @@ -2051,11 +2324,29 @@ เน€เธชเน‰เธ™เธ‚เธญเธšเนเธšเธšเธเธฒเธฃเนŒเธ•เธนเธ™เธžเธฃเน‰เธญเธกเน€เธžเธดเนˆเธกเธ„เธงเธฒเธกเธ„เธกเธŠเธฑเธ” เน„เธกเนˆเนƒเธŠเนˆ GPU Adreno + เน„เธ”เธฃเน€เธงเธญเธฃเนŒ PowerVR เธ‚เธญเธ‡เธฃเธฐเธšเธš: เธ„เธงเธฒเธกเน€เธ‚เน‰เธฒเธเธฑเธ™เน„เธ”เน‰เนเธ•เธเธ•เนˆเธฒเธ‡เธเธฑเธ™เธ•เธฒเธกเธญเธธเธ›เธเธฃเธ“เนŒ + เธ—เธ”เธฅเธญเธ‡: RADV เธซเธฃเธทเธญเน„เธ”เธฃเน€เธงเธญเธฃเนŒ Xclipse เธ‚เธญเธ‡เธฃเธฐเธšเธš + PowerVR เธ‚เธญเธ‡เธฃเธฐเธšเธš + เนƒเธŠเน‰เน„เธ”เธฃเน€เธงเธญเธฃเนŒเนƒเธ™เธ•เธฑเธงเธชเธณเธซเธฃเธฑเธš GPU เธ™เธตเน‰ + เน„เธ”เธฃเน€เธงเธญเธฃเนŒ PowerVR เธ‚เธญเธ‡เธฃเธฐเธšเธšเธ–เธนเธเน€เธฅเธทเธญเธเนƒเธซเน‰เนƒเธŠเน‰เธเธฑเธšเธฃเธฑเธ™เน„เธ—เธกเนŒเนเธฅเธฐเธเธฒเธฃเนเธชเธ”เธ‡เธœเธฅเนเธฅเน‰เธง + เธขเธฑเธ‡เน„เธกเนˆเธกเธตเน„เธ”เธฃเน€เธงเธญเธฃเนŒเน‚เธญเน€เธžเธ™เธ‹เธญเธฃเนŒเธชเธ—เธตเนˆเธฃเธญเธ‡เธฃเธฑเธš Mali เธฃเธธเนˆเธ™เธ™เธตเน‰: เธˆเธถเธ‡เน€เธ›เธดเธ”เนƒเธŠเน‰เธšเธฃเธดเธ”เธˆเนŒ Mali + เธ™เธตเนˆเธ„เธทเธญเธšเธดเธฅเธ”เนŒเธ—เธ”เธชเธญเธšเธชเธณเธซเธฃเธฑเธšเน€เธ„เธฃเธทเนˆเธญเธ‡เธ—เธตเนˆเน„เธกเนˆเนƒเธŠเนˆ Snapdragon: เธšเธดเธฅเธ”เนŒเธ—เธฒเธ‡เธเธฒเธฃเธ—เธตเนˆเธ™เธตเนˆเธ—เธณเธ‡เธฒเธ™เน„เธ”เน‰เน€เธ‰เธžเธฒเธฐเธšเธ™ Adreno เธˆเธถเธ‡เน„เธกเนˆเธ•เธดเธ”เธ•เธฑเน‰เธ‡เธ—เธฑเธšเธšเธดเธฅเธ”เนŒเธ™เธตเน‰ เธšเธดเธฅเธ”เนŒเธ—เธ”เธชเธญเธšเนƒเธซเธกเนˆเธกเธตเธญเธขเธนเนˆเธ—เธตเนˆ github.com/The412Banner/droiddeck-nonadreno-drivers + เน€เธ‹เธชเธŠเธฑเธ™เธฅเนˆเธฒเธชเธธเธ”เธˆเธšเธฅเธ‡เน€เธžเธฃเธฒเธฐ Android เธ›เธดเธ” DroidDeck เน€เธžเธทเนˆเธญเธ„เธทเธ™เธซเธ™เนˆเธงเธขเธ„เธงเธฒเธกเธˆเธณ เน„เธกเนˆเนƒเธŠเนˆเน€เธžเธฃเธฒเธฐเนเธญเธ›เธ‚เธฑเธ”เธ‚เน‰เธญเธ‡ เธ›เธดเธ”เนเธญเธ›เธญเธทเนˆเธ™เธซเธฃเธทเธญเธฅเธ”เธ„เธธเธ“เธ เธฒเธžเธžเธทเน‰เธ™เธœเธดเธงเธ‚เธญเธ‡เน€เธเธก เนเธฅเน‰เธงเธฅเธญเธ‡เธญเธตเธเธ„เธฃเธฑเน‰เธ‡ + Mali (Venus) + เธšเธฃเธดเธ”เธˆเนŒ Mali + เธขเธฑเธ‡เน„เธกเนˆเธกเธตเน„เธ”เธฃเน€เธงเธญเธฃเนŒเน‚เธญเน€เธžเธ™เธ‹เธญเธฃเนŒเธชเธ—เธตเนˆเธฃเธญเธ‡เธฃเธฑเธš Mali เธฃเธธเนˆเธ™เธ™เธตเน‰: เธˆเธถเธ‡เนƒเธŠเน‰ %1$s เธšเธ™เน„เธ”เธฃเน€เธงเธญเธฃเนŒเธ‚เธญเธ‡เน€เธ„เธฃเธทเนˆเธญเธ‡เน€เธญเธ‡ + %1$s เธขเธฑเธ‡เน„เธกเนˆเน„เธ”เน‰เน€เธœเธขเนเธžเธฃเนˆ: เธˆเธถเธ‡เนƒเธŠเน‰ %2$s เน„เธ›เธˆเธ™เธเธงเนˆเธฒเธˆเธฐเน€เธœเธขเนเธžเธฃเนˆ + %1$s เธขเธฑเธ‡เนƒเธŠเน‰เธ‡เธฒเธ™เน„เธกเนˆเน„เธ”เน‰ เนเธฅเธฐเน„เธ”เธฃเน€เธงเธญเธฃเนŒเธ‚เธญเธ‡เน€เธ„เธฃเธทเนˆเธญเธ‡เธ™เธตเน‰เธฃเธฐเธšเธธ Vulkan %2$s (Venus เธ•เน‰เธญเธ‡เธเธฒเธฃ 1.2): เธˆเธถเธ‡เนƒเธŠเน‰เธšเธฃเธดเธ”เธˆเนŒ Mali + %1$s เธขเธฑเธ‡เน„เธกเนˆเน„เธ”เน‰เน€เธœเธขเนเธžเธฃเนˆ: เธฃเธฐเธšเธšเน€เธ›เธดเธ”เนƒเธŠเน‰เธšเธฃเธดเธ”เธˆเนŒ Mali เน„เธ›เธˆเธ™เธเธงเนˆเธฒเธˆเธฐเน€เธœเธขเนเธžเธฃเนˆ + เธญเธขเธนเนˆเนƒเธ™เธ„เธดเธง: %1$s (เธเธณเธฅเธฑเธ‡เธฃเธญเน„เธ”เธฃเน€เธงเธญเธฃเนŒเธฃเธฑเธ™เน„เธ—เธกเนŒเธ•เธฑเธงเธญเธทเนˆเธ™) + DXVK เธกเธฒเธˆเธฒเธเธฃเธฑเธ™เน„เธ—เธกเนŒ PowerVR เธ‚เธญเธ‡เธฃเธฐเธšเธš เนเธžเน‡เธเน€เธเธˆ DXVK เธญเธทเนˆเธ™เธˆเธฑเธ”เน€เธเน‡เธšเน„เธ”เน‰เนเธ•เนˆเธˆเธฐเน„เธกเนˆเธ–เธนเธเธ™เธณเน„เธ›เนƒเธŠเน‰เธเธฑเธšเน„เธ”เธฃเน€เธงเธญเธฃเนŒเธ™เธตเน‰ เธฃเธญเธ‡เธฃเธฑเธš เธ—เธ”เธฅเธญเธ‡: เน„เธ”เธฃเน€เธงเธญเธฃเนŒเน€เธ›เน‡เธ™เธšเธดเธฅเธ”เนŒเธ—เธ”เธชเธญเธš เธฃเธญเธ‡เธฃเธฑเธš Adreno 850 เนเธšเธšเธ—เธ”เธฅเธญเธ‡: เธ•เน‰เธญเธ‡เนƒเธŠเน‰เน„เธ”เธฃเน€เธงเธญเธฃเนŒเธˆเธญเนเธชเธ”เธ‡เธœเธฅเนเธฅเธฐเน„เธ”เธฃเน€เธงเธญเธฃเนŒเน€เธเธกเนเธšเธšเธ—เธ”เธฅเธญเธ‡เธ—เธตเนˆเน€เธ‚เน‰เธฒเธเธฑเธ™เน„เธ”เน‰ เธขเธฑเธ‡เน„เธกเนˆเน„เธ”เน‰เธ•เธฃเธงเธˆเธชเธญเธšเธšเธ™เธญเธธเธ›เธเธฃเธ“เนŒเธ™เธตเน‰ เธ•เนˆเธณเธเธงเนˆเธฒเธฎเธฒเธฃเนŒเธ”เนเธงเธฃเนŒเธ—เธตเนˆเธ—เธ”เธชเธญเธšเนเธฅเน‰เธง (Adreno 725 เนเธฅเธฐเธฃเธธเนˆเธ™เนƒเธซเธกเนˆเธเธงเนˆเธฒ): เธญเธฒเธˆเธฃเธฑเธ™เน„เธกเนˆเน„เธ”เน‰ เน„เธกเนˆเธฃเธญเธ‡เธฃเธฑเธš: เน„เธกเนˆเธกเธตเนเธšเน‡เธเน€เธญเธ™เธ”เนŒเธเธฃเธฒเธŸเธดเธเธ—เธตเนˆเน€เธ‚เน‰เธฒเธเธฑเธ™เน„เธ”เน‰เธชเธณเธซเธฃเธฑเธš GPU เธ™เธตเน‰ + เธ—เธณเธ‡เธฒเธ™เธœเนˆเธฒเธ™เธšเธฃเธดเธ”เธˆเนŒ Mali เธšเธ™เน„เธ”เธฃเน€เธงเธญเธฃเนŒ Vulkan เธ‚เธญเธ‡เน€เธ„เธฃเธทเนˆเธญเธ‡เน€เธญเธ‡ + เน„เธกเนˆเธฃเธญเธ‡เธฃเธฑเธšเน€เธกเธทเนˆเธญเธ›เธดเธ”เธšเธฃเธดเธ”เธˆเนŒ Mali: Turnip เธ•เน‰เธญเธ‡เธเธฒเธฃ GPU Adreno (Snapdragon) เธ•เธดเธ”เธ‚เธตเธ”เธˆเธณเธเธฑเธ”เธญเธฑเธ•เธฃเธฒเธ‚เธญเธ‡ GitHub - เธฅเธญเธ‡เนƒเธซเธกเนˆเนƒเธ™เธซเธฅเธฑเธ‡ GitHub เธ•เธญเธšเธเธฅเธฑเธšเธ”เน‰เธงเธข HTTP %1$d @@ -2164,7 +2455,6 @@ เธชเน‚เธ•เธฃเนŒ Steam เธเธณเธซเธ™เธ”เน€เธญเธ‡ - เธชเน‚เธ•เธฃเนŒ เธฃเธฐเธ”เธฑเธšเธ„เธงเธฒเธกเน€เธฃเน‡เธงเธเธฒเธฃเธ”เธฒเธงเธ™เนŒเน‚เธซเธฅเธ” เธชเธกเธ”เธธเธฅ เน€เธฃเน‡เธง @@ -2203,6 +2493,7 @@ เธเธณเธฅเธฑเธ‡เธฃเธญเธเธฒเธฃเธ”เธฒเธงเธ™เนŒเน‚เธซเธฅเธ” Battle.net เธญเธตเธเธฃเธฒเธขเธเธฒเธฃโ€ฆ เน€เธ›เธดเธ” Battle.net เนเธฅเธฐเธฅเธ‡เธŠเธทเนˆเธญเน€เธ‚เน‰เธฒเนƒเธŠเน‰เธซเธ™เธถเนˆเธ‡เธ„เธฃเธฑเน‰เธ‡ เนเธฅเน‰เธงเธ•เธดเธ”เธ•เธฑเน‰เธ‡เน€เธเธกเธˆเธฒเธเธ—เธตเนˆเธ™เธตเนˆ เธ•เธฑเธงเธ”เธฒเธงเธ™เนŒเน‚เธซเธฅเธ”เธ‚เธญเธ‡ Blizzard เธซเธขเธธเธ”เธ—เธณเธ‡เธฒเธ™: %1$s + เธ•เธฑเธงเธ”เธฒเธงเธ™เนŒเน‚เธซเธฅเธ”เธ‚เธญเธ‡ Blizzard เน„เธกเนˆเธ„เธทเธšเธซเธ™เน‰เธฒ เธ‚เน‰เธญเธœเธดเธ”เธžเธฅเธฒเธ”เธ‚เธญเธ‡ Blizzard %1$s เธญเธฑเธ›เน€เธ”เธ• เน€เธเธกเธ‚เธญเธ‡ Blizzard @@ -2210,6 +2501,7 @@ เธ–เธนเธเธ‚เธฑเธ”เธˆเธฑเธ‡เธซเธงเธฐ เธ•เธดเธ”เธ•เธฑเน‰เธ‡ ยท %1$s เธฃเธฑเธšเน„เธ›เน€เธฅเธขเธŸเธฃเธต + เธเธณเธฅเธฑเธ‡เน€เธžเธดเนˆเธกเธฅเธ‡เนƒเธ™เธ„เธฅเธฑเธ‡โ€ฆ เธ”เธนเธšเธ™ %1$s เธ‹เธทเน‰เธญ ยท %1$s เธ•เธดเธ”เธ•เธฑเน‰เธ‡เนเธฅเน‰เธง @@ -2256,6 +2548,12 @@ เธˆเธฑเธ”เน€เธฃเธตเธขเธ‡ เธ›เน‰เธฒเธขเนเธ–เธšเธ”เน‰เธฒเธ™เธ‚เน‰เธฒเธ‡ เนเธชเธ”เธ‡เธŠเธทเนˆเธญเนƒเธ•เน‰เน„เธญเธ„เธญเธ™เนƒเธ™เนเธ–เธšเธ”เน‰เธฒเธ™เธ‚เน‰เธฒเธ‡ เธ›เธดเธ”เน€เธžเธทเนˆเธญเนƒเธซเน‰เนเธ–เธšเธ”เน‰เธฒเธ™เธ‚เน‰เธฒเธ‡เนเธ„เธšเธฅเธ‡ + เธชเธฑเธ•เธงเนŒเน€เธฅเธตเน‰เธขเธ‡เน€เธญเน€เธˆเธ™เธ•เนŒ + DeeDee เธฅเธญเธขเน€เธซเธ™เธทเธญเนเธญเธ›เธซเธ™เน‰เธฒเธˆเธญเธซเธฅเธฑเธเนเธฅเธฐเน€เธเธก เธžเธฃเน‰เธญเธกเนเธชเธ”เธ‡เธชเธดเนˆเธ‡เธ—เธตเนˆเน€เธญเน€เธˆเธ™เธ•เนŒเธเธณเธฅเธฑเธ‡เธ—เธณเธญเธขเธนเนˆ + เน€เธซเธ™เธทเธญเนเธญเธ›เธญเธทเนˆเธ™ + เนƒเธซเน‰ DeeDee เธฅเธญเธขเน€เธซเธ™เธทเธญเธ—เธธเธเนเธญเธ›เนเธฅเธฐเน€เธ›เธดเธ”เนเธŠเธ—เน„เธ”เน‰เธˆเธฒเธเธ•เธฃเธ‡เธ™เธฑเน‰เธ™ + เธญเธ™เธธเธเธฒเธ• + เนเธŠเธ—เธเธฑเธš DeeDee เธเธฒเธฃเนเธชเธ”เธ‡เธœเธฅ เธเธฒเธฃเนŒเธ”เนƒเธซเธเนˆเธ‚เธถเน‰เธ™ เธเธฒเธฃเนŒเธ”เน€เธฅเน‡เธเธฅเธ‡ @@ -2538,7 +2836,14 @@ %1$s ยท เธ•เน‰เธญเธ‡เธฃเธตเธชเธ•เธฒเธฃเนŒเธ• เธญเธธเธ›เธเธฃเธ“เนŒเธ™เธตเน‰ เธฅเธš %1$s? - เธเธฒเธฃเธงเธดเธ™เธดเธˆเธ‰เธฑเธข + เธ™เธฑเธเธžเธฑเธ’เธ™เธฒ + เธฅเธฒเธขเธ™เน‰เธณเธ›เน‰เธฒเธขเธŠเธทเนˆเธญเธšเธดเธฅเธ”เนŒ + เนเธชเธ”เธ‡เธ›เน‰เธฒเธขเธŠเธทเนˆเธญเธšเธดเธฅเธ”เนŒเธ—เธ”เธชเธญเธšเธซเธฃเธทเธญเธšเธดเธฅเธ”เนŒ Lab เธšเธ™เธซเธ™เน‰เธฒเธˆเธญ เน€เธ›เธดเธ”เน„เธงเน‰เน‚เธ”เธขเธ„เนˆเธฒเน€เธฃเธดเนˆเธกเธ•เน‰เธ™ + เนเธŠเธฃเนŒเธŠเธธเธ”เธ‚เน‰เธญเธกเธนเธฅเธเธฒเธฃเธงเธดเธ™เธดเธˆเธ‰เธฑเธข + เน€เธ‹เธชเธŠเธฑเธ™เนเธฅเธฐเธญเธธเธ›เธเธฃเธ“เนŒ + เธเธฃเธฒเธŸเธดเธ + เน€เธเธกเนเธฅเธฐเธ„เธงเธฒเธกเน€เธ‚เน‰เธฒเธเธฑเธ™เน„เธ”เน‰ + เธ—เธธเธเธŠเธธเธ”เธ‚เน‰เธญเธกเธนเธฅ เธžเธฃเน‰เธญเธกเน€เธฅเนˆเธ™เนเธฅเน‰เธง เธขเธฑเธ‡เน„เธกเนˆเธžเธฃเน‰เธญเธกเน€เธฅเนˆเธ™ เธฃเธฑเธ™เน„เธ—เธกเนŒ %1$s @@ -2577,6 +2882,9 @@ เน€เธ›เธดเธ”เนƒเธŠเน‰เธ„เธงเธฒเธกเธชเธณเน€เธฃเน‡เธˆเธ‚เธญเธ‡ GOG เนƒเธ™เธเธฒเธฃเธ•เธฑเน‰เธ‡เธ„เนˆเธฒ Stores เน„เธกเนˆเธžเธšเธ„เธงเธฒเธกเธชเธณเน€เธฃเน‡เธˆ เธ•เธฃเธงเธˆเธชเธญเธšเธšเธฑเธ™เธ—เธถเธเน€เธ‹เธชเธŠเธฑเธ™ เธ›เธฅเธ”เธฅเน‡เธญเธเธ„เธงเธฒเธกเธชเธณเน€เธฃเน‡เธˆเนเธฅเน‰เธง + Mali (Venus): เธ›เธดเธ” + Mali (Venus): เน€เธ›เธดเธ” + เน„เธ”เธฃเน€เธงเธญเธฃเนŒเธšเธ™ %1$s เธฃเธฐเธšเธธ Vulkan %2$s เนเธ•เนˆ Mali (Venus) เธ•เน‰เธญเธ‡เธเธฒเธฃ Vulkan 1.2 เธ‚เธถเน‰เธ™เน„เธ› (gamescope เน„เธกเนˆเน€เธฃเธดเนˆเธกเธ—เธณเธ‡เธฒเธ™เธšเธ™เน€เธงเธญเธฃเนŒเธŠเธฑเธ™เธ—เธตเนˆเน€เธเนˆเธฒเธเธงเนˆเธฒ) เน€เธ‹เธชเธŠเธฑเธ™เธˆเธถเธ‡เธ‚เน‰เธฒเธก Venus เนเธฅเน‰เธงเนƒเธŠเน‰เธ„เธนเนˆเน„เธ”เธฃเน€เธงเธญเธฃเนŒ PanVK เนเธ—เธ™ เธงเธฒเธ‡ เธญเธ™เธฒเธฅเน‡เธญเธเธ‹เน‰เธฒเธข เธญเธ™เธฒเธฅเน‡เธญเธเธ‚เธงเธฒ @@ -2861,7 +3169,7 @@ เน€เธฅเธทเธญเธเน‚เธŸเธฅเน€เธ”เธญเธฃเนŒโ€ฆ เนƒเธŠเน‰เน‚เธŸเธฅเน€เธ”เธญเธฃเนŒเนƒเธ”เธเน‡เน„เธ”เน‰เธšเธ™เธเธฒเธฃเนŒเธ” SD เธซเธฃเธทเธญเน„เธ”เธฃเธŸเนŒ USB เน€เธเธกเธˆเธฐเธญเธขเธนเนˆเนƒเธ™เน‚เธŸเธฅเน€เธ”เธญเธฃเนŒ Games เธ เธฒเธขเนƒเธ™เธ•เธณเนเธซเธ™เนˆเธ‡เธ—เธตเนˆเน€เธฅเธทเธญเธ เน€เธเธกเธ—เธตเนˆเธกเธตเธญเธขเธนเนˆเธˆเธฐเน„เธกเนˆเธ–เธนเธเธขเน‰เธฒเธข - เน„เธ›เธญเธขเธนเนˆเธ—เธตเนˆเน„เธซเธ™ + เธชเธดเนˆเธ‡เธ—เธตเนˆเนƒเธŠเน‰เธžเธทเน‰เธ™เธ—เธตเนˆ เน€เธเธก Steam เธ‚เน‰เธญเธกเธนเธฅเน€เธเธก Prefix %1$s ยท เน€เธงเธดเธฃเนŒเธเธŠเธญเธ› %2$s ยท เน€เธŠเน€เธ”เธญเธฃเนŒ %3$s @@ -2930,6 +3238,7 @@ เธ•เธฑเธงเธ•เธดเธ”เธ•เธฑเน‰เธ‡ VC++ เนเธฅเธฐ DirectX เธ—เธตเนˆเน€เธเธกเธ•เน‰เธญเธ‡เนƒเธŠเน‰ เธฃเธฑเธ™เน€เธเธก Linux x86 เน€เธ„เธฃเธทเนˆเธญเธ‡เธกเธทเธญ Steam + Steam เธ”เธฒเธงเธ™เนŒเน‚เธซเธฅเธ”เธฃเธฒเธขเธเธฒเธฃเธ™เธตเน‰เนƒเธซเน‰เน€เธเธกเธ—เธตเนˆเธกเธตเธฃเธฐเธšเธšเธ›เน‰เธญเธ‡เธเธฑเธ™เธเธฒเธฃเน‚เธเธ‡ เนเธกเน‰เธฃเธฐเธšเธšเธ™เธฑเน‰เธ™เธˆเธฐเธ–เธนเธเธ›เธดเธ”เธญเธขเธนเนˆเธเน‡เธ•เธฒเธก เธเธฒเธฃเธฅเธšเธญเธญเธเธˆเธฐเธ—เธณเนƒเธซเน‰เธเธฒเธฃเธ•เธดเธ”เธ•เธฑเน‰เธ‡เน€เธเธกเน€เธซเธฅเนˆเธฒเธ™เธฑเน‰เธ™เธ„เน‰เธฒเธ‡เธญเธขเธนเนˆเธ—เธตเนˆ 0% DroidDeck เธฃเธฑเธ™เน€เธเธกเน„เธ”เน‰เน‚เธ”เธขเน„เธกเนˆเธ•เน‰เธญเธ‡เนƒเธŠเน‰เธฃเธฑเธ™เน„เธ—เธกเนŒเธ™เธตเน‰ Proton x86 เธ‹เธถเนˆเธ‡ DroidDeck เธฃเธฑเธ™เน„เธกเนˆเน„เธ”เน‰ เธ„เนˆเธฒเน€เธฃเธดเนˆเธกเธ•เน‰เธ™เธชเธณเธซเธฃเธฑเธšเธ—เธธเธเน€เธเธก @@ -2993,6 +3302,19 @@ เน€เธเน‡เธšเน„เธงเน‰ เน€เธเธกเธ™เธญเธ Steam เนเธฅเธฐ Prefix Steam เธ—เธตเนˆเนƒเธŠเน‰เธฃเนˆเธงเธกเธเธฑเธ™ Prefix เธ‚เธญเธ‡เน€เธเธกเธˆเธฒเธเธชเน‚เธ•เธฃเนŒเธซเธฃเธทเธญเธ—เธตเนˆเน€เธžเธดเนˆเธกเน€เธญเธ‡ + Prefix Steam เธ—เธตเนˆเนƒเธŠเน‰เธฃเนˆเธงเธกเธเธฑเธ™ + Steam เธฃเธฑเธ™เธ•เธฑเธงเธŠเนˆเธงเธข Windows เธ‚เธญเธ‡เธ•เธฑเธงเน€เธญเธ‡เธ—เธตเนˆเธ™เธตเนˆ + เธฅเธš prefix เธ™เธตเน‰ (%1$s) Steam เธˆเธฐเธชเธฃเน‰เธฒเธ‡เนƒเธซเธกเนˆเน€เธกเธทเนˆเธญเธ•เน‰เธญเธ‡เนƒเธŠเน‰เธ„เธฃเธฑเน‰เธ‡เธ–เธฑเธ”เน„เธ› + เนเธญเธ›เธชเน‚เธ•เธฃเนŒเนเธฅเธฐเน€เธเธกเธ—เธตเนˆเธ—เธณเธ‡เธฒเธ™เธเธฑเธšเนเธญเธ›เธ™เธฑเน‰เธ™ + เนƒเธŠเน‰เน‚เธ”เธข %1$s + เน€เธเธกเธ™เธญเธ Steam %1$s + เน„เธกเนˆเธ•เธฃเธ‡เธเธฑเธšเน€เธเธกเนƒเธ” เธˆเธถเธ‡เน€เธเน‡เธšเน„เธงเน‰ + เธ™เธณเธฃเธฒเธขเธเธฒเธฃเธ—เธตเนˆเน€เธฅเธทเธญเธเธญเธญเธ ยท %1$s + เธ–เธญเธ™เธเธฒเธฃเธ•เธดเธ”เธ•เธฑเน‰เธ‡เธฃเธฒเธขเธเธฒเธฃเธ—เธตเนˆเน€เธฅเธทเธญเธ ยท %1$s + Wine prefix + เน€เธ‹เธŸเนเธฅเธฐเธเธฒเธฃเธ•เธฑเน‰เธ‡เธ„เนˆเธฒเธ‚เน‰เธฒเธ‡เนƒเธ™เธˆเธฐเธซเธฒเธขเน„เธ› เน€เธ‹เธŸเนƒเธ™ Steam Cloud เธขเธฑเธ‡เธญเธขเธนเนˆเนƒเธ™เธšเธฑเธเธŠเธตเธ‚เธญเธ‡เธ„เธธเธ“ + เนเธ„เธŠเน€เธŠเน€เธ”เธญเธฃเนŒ + Prefix %1$s ยท เน€เธŠเน€เธ”เธญเธฃเนŒ %2$s เนเธžเน‡เธเน€เธเธˆเธ—เธตเนˆเธ”เธฒเธงเธ™เนŒเน‚เธซเธฅเธ” เธ•เน‰เธ™เธ‰เธšเธฑเธšเธ—เธตเนˆเน€เธเน‡เธšเน„เธงเน‰ เธขเธฑเธ‡เน„เธกเนˆเธกเธตเนเธžเน‡เธเน€เธเธˆเธ„เธญเธกเน‚เธžเน€เธ™เธ™เธ•เนŒเธ—เธตเนˆเธ”เธฒเธงเธ™เนŒเน‚เธซเธฅเธ” @@ -3027,6 +3349,8 @@ DroidDeck ยท %1$d fps 60 fps เธฅเธทเนˆเธ™เธเธงเนˆเธฒเนเธ•เนˆเนƒเธŠเน‰ CPU เธกเธฒเธเธ‚เธถเน‰เธ™เธฃเธฐเธซเธงเนˆเธฒเธ‡เธ—เธตเนˆ Steam เธเธณเธฅเธฑเธ‡เน€เธฃเธดเนˆเธก เธงเธดเธ”เธตเน‚เธญเธ—เธตเนˆเน€เธฅเธทเธญเธเนƒเธ™เธเธฒเธฃเธ•เธฑเน‰เธ‡เธ„เนˆเธฒเธ‚เธญเธ‡ Steam เน€เธญเธ‡เธˆเธฐเนเธชเธ”เธ‡เธ—เธตเนˆเธ™เธตเนˆเธ”เน‰เธงเธข เน€เธชเธตเธขเธ‡ + เธ‚เน‰เธฒเธกเธงเธดเธ”เธตเน‚เธญเน€เธฃเธดเนˆเธกเธ•เน‰เธ™ + เนƒเธŠเน‰เธ„เธฅเธดเธ›เธชเธตเธ”เธณเธ„เธงเธฒเธกเธขเธฒเธง 0.1 เธงเธดเธ™เธฒเธ—เธตเน€เธ›เน‡เธ™เธงเธดเธ”เธตเน‚เธญเน€เธฃเธดเนˆเธกเธ•เน‰เธ™เธ‚เธญเธ‡ Steam เธกเธตเธœเธฅเนƒเธ™เน€เธ‹เธชเธŠเธฑเธ™เธ–เธฑเธ”เน„เธ› เธงเธดเธ”เธตเน‚เธญเธ‚เธญเธ‡เธ„เธธเธ“เน€เธญเธ‡ MP4, MOV, MKV เธซเธฃเธทเธญ WebM เธฃเธนเธ›เนเธšเธšเธญเธทเนˆเธ™เนเธฅเธฐเน„เธŸเธฅเนŒเธ—เธตเนˆเนƒเธซเธเนˆเธเธงเนˆเธฒ %1$d MB เธˆเธฐเธ–เธนเธเนเธ›เธฅเธ‡เน€เธ›เน‡เธ™ WebM 720p เธšเธ™เธญเธธเธ›เธเธฃเธ“เนŒ เธ„เธงเธฒเธกเธขเธฒเธงเน„เธกเนˆเน€เธเธดเธ™ %2$d เธงเธดเธ™เธฒเธ—เธต เธ™เธณเน€เธ‚เน‰เธฒ @@ -3488,6 +3812,7 @@ เนƒเธซเน‰ Alt+Tab เธ›เธธเนˆเธก Win เนเธฅเธฐเธ›เธธเนˆเธกเน‚เธฎเธกเธ—เธณเธ‡เธฒเธ™เนƒเธ™เน€เธ‹เธชเธŠเธฑเธ™ DroidDeck เธ—เธตเนˆเนƒเธŠเน‰เธ‡เธฒเธ™เธญเธขเธนเนˆเนเธ—เธ™ Android เน€เธ›เธดเธ”เธ„เธงเธฒเธกเธชเธงเนˆเธฒเธ‡เนƒเธ™เธเธฒเธฃเธ•เธฑเน‰เธ‡เธ„เนˆเธฒ โ†’ เธเธฒเธฃเธœเธชเธฒเธ™เธฃเธงเธก Steam เธšเธฃเธดเธ”เธˆเนŒ Mali: เธ›เธดเธ” + %1$s เนƒเธŠเน‰เธšเธฃเธดเธ”เธˆเนŒ Mali เน„เธกเนˆเน„เธ”เน‰ (เธ•เน‰เธญเธ‡เธเธฒเธฃ GPU Mali เธ—เธตเนˆเธขเธฑเธ‡เน„เธกเนˆเธกเธตเน€เธชเน‰เธ™เธ—เธฒเธ‡เน„เธ”เธฃเน€เธงเธญเธฃเนŒเธฃเธฐเธšเธš) เธชเธงเธดเธ•เธŠเนŒเธ™เธตเน‰เธˆเธถเธ‡เน„เธกเนˆเธกเธตเธœเธฅเธšเธ™เน€เธ„เธฃเธทเนˆเธญเธ‡เธ™เธตเน‰ เธšเธฃเธดเธ”เธˆเนŒ Mali: เน€เธ›เธดเธ” %1$s เน„เธกเนˆเนƒเธŠเนˆ Adreno เธšเธฃเธดเธ”เธˆเนŒ Vulkan เธฃเธธเนˆเธ™เธ—เธ”เธฅเธญเธ‡เน€เธ›เธดเธ”เธญเธขเธนเนˆ: เน€เธ‹เธชเธŠเธฑเธ™เธงเธฒเธ”เธœเนˆเธฒเธ™เน„เธ”เธฃเน€เธงเธญเธฃเนŒเธ‚เธญเธ‡เน‚เธ—เธฃเธจเธฑเธžเธ—เนŒเน€เธญเธ‡ เธญเธฒเธˆเธžเธšเธšเธฑเนŠเธ เน‚เธ›เธฃเธ”เธชเนˆเธ‡เธšเธฑเธ™เธ—เธถเธเธ‚เธญเธ‡เน€เธ‹เธชเธŠเธฑเธ™ เน‚เธซเธกเธ”เธ›เธฅเธญเธ”เธ เธฑเธข @@ -3513,6 +3838,25 @@ เธขเน‰เธฒเธขเน„เธ›เธซเธฅเธฑเธ‡ เธเธฒเธฃเธ•เธฑเน‰เธ‡เธ„เนˆเธฒเธงเธดเธ”เน€เธˆเน‡เธ• เธ™เธณเธงเธดเธ”เน€เธˆเน‡เธ•เธญเธญเธ + เธฃเธนเธ›เธฅเธฑเธเธฉเธ“เนŒ + เธŠเธธเธ”เน„เธญเธ„เธญเธ™ + เธ„เนˆเธฒเน€เธฃเธดเนˆเธกเธ•เน‰เธ™เธ‚เธญเธ‡เธฃเธฐเธšเธš + เธžเธทเน‰เธ™เธซเธฅเธฑเธ‡เธชเธตเธ‚เธญเธ‡เนเธญเธ› + เธ‚เธ™เธฒเธ”เน„เธญเธ„เธญเธ™ + เน€เธฅเน‡เธ + เธ›เธฒเธ™เธเธฅเธฒเธ‡ + เนƒเธซเธเนˆ + เธ‹เนˆเธญเธ™เธŠเธทเนˆเธญเนเธญเธ› + เธฃเธฐเธขเธฐเธซเนˆเธฒเธ‡ + เธŠเธดเธ” + เธ›เธเธ•เธด + เธเธงเน‰เธฒเธ‡ + เน€เธ›เธฅเธตเนˆเธขเธ™เน„เธญเธ„เธญเธ™ + เธฃเธตเน€เธ‹เน‡เธ•เน„เธญเธ„เธญเธ™ + เธ„เน‰เธ™เธซเธฒเน„เธญเธ„เธญเธ™ + เธเธณเธฅเธฑเธ‡เน‚เธซเธฅเธ”เน„เธญเธ„เธญเธ™โ€ฆ + เน„เธกเนˆเธžเธšเน„เธญเธ„เธญเธ™ + เน„เธญเธ„เธญเธ™เธ—เธตเนˆเธเธณเธซเธ™เธ”เน€เธญเธ‡ เน€เธžเธดเนˆเธกเธฅเธ‡เนƒเธ™เน‚เธŸเธฅเน€เธ”เธญเธฃเนŒ เน‚เธŸเธฅเน€เธ”เธญเธฃเนŒเนƒเธซเธกเนˆ เธ™เธณเธญเธญเธเธˆเธฒเธเน‚เธŸเธฅเน€เธ”เธญเธฃเนŒ @@ -3627,5 +3971,81 @@ เน„เธกเนˆเธชเธฒเธกเธฒเธฃเธ–เธ™เธณเน€เธ‚เน‰เธฒเธเธฒเธฃเธˆเธฑเธ”เธงเธฒเธ‡เธ™เธตเน‰เน„เธ”เน‰ เธซเธดเธกเธฐเธชเธตเนเธ”เธ‡เธŠเธฒเธ” + เธžเธทเน‰เธ™เธœเธดเธงเธชเธตเธ‚เธฒเธงเธกเธตเธชเธตเนเธ”เธ‡เน€เธ›เน‡เธ™เธชเธตเน€เธ™เน‰เธ™ + เธ‹เธฒเธงเธ”เนŒเนเธ—เธฃเน‡เธ + เน€เธžเธฅเธ‡ + เธ•เธฑเธงเน€เธฅเธทเธญเธเธเธฒเธฃเน€เธฅเนˆเธ™ + เธฃเธฒเธขเธเธฒเธฃเน‚เธ›เธฃเธ” + เธ„เธญเธฅเน€เธฅเธเธŠเธฑเธ™ + เธขเธฑเธ‡เน„เธกเนˆเธกเธตเธ„เธญเธฅเน€เธฅเธเธŠเธฑเธ™ เนเธ•เธฐเน„เธญเธ„เธญเธ™เธšเธธเนŠเธเธกเธฒเธฃเนŒเธเน€เธžเธทเนˆเธญเธชเธฃเน‰เธฒเธ‡ + เธšเธฑเธ™เธ—เธถเธเนเธฅเน‰เธง + เธชเธฃเน‰เธฒเธ‡เธ„เธญเธฅเน€เธฅเธเธŠเธฑเธ™ + เธˆเธฑเธ”เธฃเธฐเน€เธšเธตเธขเธšเธฃเธฒเธขเธเธฒเธฃเธ—เธตเนˆเธšเธฑเธ™เธ—เธถเธเน„เธงเน‰ + เนƒเธซเธกเนˆ + เธชเธฃเน‰เธฒเธ‡ + เธŠเธทเนˆเธญเธ„เธญเธฅเน€เธฅเธเธŠเธฑเธ™ + เธ›เน‰เธญเธ™เธŠเธทเนˆเธญเธ—เธตเนˆเน„เธกเนˆเธ‹เน‰เธณเธเธฑเธšเธ„เธญเธฅเน€เธฅเธเธŠเธฑเธ™เธญเธทเนˆเธ™ + เธˆเธฑเธ”เธเธฒเธฃ + เน€เธ›เธฅเธตเนˆเธขเธ™เธŠเธทเนˆเธญ + เน€เธžเธดเนˆเธกเนเธ—เธฃเน‡เธ + เน€เธžเธดเนˆเธก (%1$d) + เน€เธญเธฒเนเธ—เธฃเน‡เธเธญเธญเธ + เธฅเธšเธ„เธญเธฅเน€เธฅเธเธŠเธฑเธ™ + เธฅเธš %1$s เธซเธฃเธทเธญเน„เธกเนˆ? + เนเธ—เธฃเน‡เธเธขเธฑเธ‡เธญเธขเธนเนˆเนƒเธ™เธญเธธเธ›เธเธฃเธ“เนŒเธ‚เธญเธ‡เธ„เธธเธ“ เธˆเธฐเธฅเธšเน€เธ‰เธžเธฒเธฐเธ„เธญเธฅเน€เธฅเธเธŠเธฑเธ™ + เน€เธฅเธทเธญเธ + เน€เธฅเธทเธญเธเธ—เธฑเน‰เธ‡เธซเธกเธ” + เธขเธเน€เธฅเธดเธเธเธฒเธฃเน€เธฅเธทเธญเธเธ—เธฑเน‰เธ‡เธซเธกเธ” + เน€เธฅเธทเธญเธเนเธฅเน‰เธง %1$d เธฃเธฒเธขเธเธฒเธฃ + เน€เธžเธดเนˆเธกเนƒเธ™เธ„เธญเธฅเน€เธฅเธเธŠเธฑเธ™ + เน€เธžเธดเนˆเธกเนƒเธ™เธฃเธฒเธขเธเธฒเธฃเน‚เธ›เธฃเธ” + เน€เธญเธฒเธญเธญเธเธˆเธฒเธเธ„เธญเธฅเน€เธฅเธเธŠเธฑเธ™ + เธ„เน‰เธ™เธซเธฒเนเธ—เธฃเน‡เธ + เธฅเธณเธ”เธฑเธšเธญเธฑเธฅเธšเธฑเน‰เธก + เธขเธฒเธงเธ—เธตเนˆเธชเธธเธ”เธเนˆเธญเธ™ + เธชเธฑเน‰เธ™เธ—เธตเนˆเธชเธธเธ”เธเนˆเธญเธ™ + เนเธ—เธฃเน‡เธ + เธฃเธฐเธ”เธฑเธšเน€เธชเธตเธขเธ‡ + เธฃเธตเน€เธ‹เน‡เธ• + เธ‚เน‰เธฒเธกเธŠเนˆเธงเธ‡เน€เธ‡เธตเธขเธš + เธ•เธฑเน‰เธ‡เน€เธงเธฅเธฒเธ›เธดเธ” + %1$d เธ™เธฒเธ—เธต + เธˆเธšเนเธ—เธฃเน‡เธ + เน€เธซเธฅเธทเธญ %1$s + เธญเธตเธ„เธงเธญเน„เธฅเน€เธ‹เธญเธฃเนŒ + เน€เธžเธดเนˆเธกเน€เธชเธตเธขเธ‡เน€เธšเธช + เธญเธธเธ›เธเธฃเธ“เนŒเธ™เธตเน‰เน„เธกเนˆเธฃเธญเธ‡เธฃเธฑเธšเธญเธตเธ„เธงเธญเน„เธฅเน€เธ‹เธญเธฃเนŒ + เน€เธ›เธดเธ”เนƒเธŠเน‰เธ‚เธ“เธฐเน€เธฅเนˆเธ™เน€เธเธก + เน€เธฅเนˆเธ™เธ‹เธฒเธงเธ”เนŒเนเธ—เธฃเน‡เธเธ•เนˆเธญเน„เธ›เธ‚เธ“เธฐเธ—เธตเนˆเน€เธเธกเธ—เธณเธ‡เธฒเธ™ + เธขเธฑเธ‡เน„เธกเนˆเธกเธตเธ‹เธฒเธงเธ”เนŒเนเธ—เธฃเน‡เธเธ—เธตเนˆเธ•เธดเธ”เธ•เธฑเน‰เธ‡ + เธ„เน‰เธ™เธซเธฒเธ‹เธฒเธงเธ”เนŒเนเธ—เธฃเน‡เธ + เน€เธžเธดเนˆเธกเน‚เธŸเธฅเน€เธ”เธญเธฃเนŒเธ‹เธฒเธงเธ”เนŒเนเธ—เธฃเน‡เธ + เน„เธกเนˆเธžเธšเน„เธŸเธฅเนŒเน€เธชเธตเธขเธ‡เนƒเธ™เน‚เธŸเธฅเน€เธ”เธญเธฃเนŒเธ™เธฑเน‰เธ™ + เธ„เธงเธฒเธกเธขเธฒเธงเธ—เธฑเน‰เธ‡เธซเธกเธ” + %1$d เนเธ—เธฃเน‡เธ / %2$s + เธ”เธดเธชเธเนŒ %1$s + เธชเธธเนˆเธก + เธเนˆเธญเธ™เธซเธ™เน‰เธฒ + เน€เธฅเนˆเธ™ + เธซเธขเธธเธ”เธŠเธฑเนˆเธงเธ„เธฃเธฒเธง + เธ–เธฑเธ”เน„เธ› + เธ›เธดเธ”เธเธฒเธฃเน€เธฅเนˆเธ™เธ‹เน‰เธณ + เน€เธฅเนˆเธ™เธ‹เน‰เธณเธ—เธฑเน‰เธ‡เธซเธกเธ” + เน€เธฅเนˆเธ™เธ‹เน‰เธณเธซเธ™เธถเนˆเธ‡เน€เธžเธฅเธ‡ + เธฃเธฐเธ”เธฑเธšเน€เธชเธตเธขเธ‡ + เน„เธกเนˆเธžเธšเน„เธŸเธฅเนŒเน€เธชเธตเธขเธ‡เนƒเธ™เธ‹เธฒเธงเธ”เนŒเนเธ—เธฃเน‡เธเธ™เธตเน‰ + เน„เธกเนˆเธชเธฒเธกเธฒเธฃเธ–เน€เธ›เธดเธ”เน„เธ”เน‰ + เน„เธกเนˆเธกเธตเน€เธงเน‡เธšเน€เธšเธฃเธฒเธงเนŒเน€เธ‹เธญเธฃเนŒเธ—เธตเนˆเน€เธ›เธดเธ”เธฅเธดเธ‡เธเนŒเธ™เธตเน‰เน„เธ”เน‰ + เธซเธขเธดเธš + เธงเธฒเธ‡ + เธšเธฑเธ™เธ—เธถเธ + เธเธ”เธ„เน‰เธฒเธ‡เน€เธžเธทเนˆเธญเธฃเธตเน€เธ‹เน‡เธ• + เธชเน‚เธ•เธฃเนŒ + เน€เธงเธฅเธฒเน€เธŸเธฃเธก + เธญเธฑเธ•เธฃเธฒเน€เธŸเธฃเธกเน€เธ‰เธฅเธตเนˆเธข + เน€เธ‹เธดเธฃเนŒเธŸเน€เธงเธญเธฃเนŒเนเธชเธ”เธ‡เธœเธฅ + เธชเธ–เธฒเธ™เธฐ HDR + เธ—เธตเนˆเนเธชเธ”เธ‡ + %1$d เธˆเธฒเธ %2$d diff --git a/app/src/main/res/values-tr/input_library.xml b/app/src/main/res/values-tr/input_library.xml new file mode 100644 index 0000000000..12d264ee81 --- /dev/null +++ b/app/src/main/res/values-tr/input_library.xml @@ -0,0 +1,132 @@ + + + Okunamayan giriลŸ ayarlarฤฑ bir kurtarma kopyasฤฑnda saklandฤฑ. Geri yรผklenen profilleri dรผzenlemeye devam edebilirsiniz. + ร–zellikler + Tฤฑklama รถzellikleri + %1$s ยท Tฤฑklama + DรผฤŸmeler + ร‡ubuklar, pedler ve tetikler + Araรงlarฤฑ gizle + Denetleyici + Denetleyici giriลŸini Steam Input\'a veya oyuna gรถnder. + Bu รถฤŸe denetleyici, fare veya klavye giriลŸi gรถndermez. + Fare tฤฑklamasฤฑ + DroidDeck eylemi + Eylem + Kaydฤฑrma hฤฑzฤฑ: %1$d adฤฑm/sn + + Yeni profil + + Yeni dรผzen + %1$s ยท %2$d profil tarafฤฑndan kullanฤฑlฤฑyor. DeฤŸiลŸiklikler bu atamalarฤฑ kullanan her profile uygulanฤฑr. + Yeniden adlandฤฑr + Sil + Eylemlerini atamadan รถnce dรผzene รถฤŸe ekleyin. + GiriลŸ ayarlarฤฑ kaydedilemedi + Ad + ลžuradan baลŸla + DรผฤŸme + ร‡ubuk + Dokunmatik yรผzey + Yรถn tuลŸlarฤฑ + Tetik + Bitti + Geri al + + Ekle + TaลŸฤฑmak iรงin sรผrรผkleyin. Boyutlandฤฑrmak iรงin bir kรถลŸeyi sรผrรผkleyin. Eylem atamak iรงin ร–zellikler\'e dokunun. + ฤฐkincil ekranda dรผzenleniyor + Seรงilen ekran kullanฤฑlamฤฑyor. Bu dรผzeni gerรงek boyutunda dรผzenlemek iรงin ekranฤฑ baฤŸlayฤฑn. + KaydedilmemiลŸ dรผzen deฤŸiลŸiklikleri atฤฑlsฤฑn mฤฑ? + Bu dรผzen %1$d profil tarafฤฑndan kullanฤฑlฤฑyor. Kaydedilen deฤŸiลŸiklikler hepsine uygulanฤฑr. + Varsayฤฑlan profiller + Masaรผstรผ modu + Oyun modu + Masaรผstรผ ve oyun iรงin varsayฤฑlan + Oyun modu iรงin varsayฤฑlan + Masaรผstรผ modu iรงin varsayฤฑlan + Cihaz ayarlarฤฑ + Kontroller + DรผฤŸmeler, รงubuklar, tetikler ve ek tuลŸlar + Profili kopyala + Eylemleri sฤฑfฤฑrla + %1$s iรงindeki eylemler temel profil varsayฤฑlanlarฤฑna sฤฑfฤฑrlansฤฑn mฤฑ? Dรผzenler ve diฤŸer profiller deฤŸiลŸmez. + %1$s silinsin mi? Onu kullanan modlar yerleลŸik varsayฤฑlan profillerine dรถner. Kaydedilen dรผzenler ve paylaลŸฤฑlan ayarlar kullanฤฑlabilir kalฤฑr. + Gรถrรผnรผrlรผk + Tรผm profillere uygulanฤฑr. Auto, oyun modunda denetleyici baฤŸlฤฑ deฤŸilken ana ekran kontrollerini gรถsterir. + Ekranda dรผzenle + Kaydedilen dรผzenlerโ€ฆ + Bir dรผzen seรงin veya kendinizinkini oluลŸturun + ฤฐkincil ekran oturum menรผsรผnde Profil kontrollerini seรงin. Denetleyici menรผsรผndeki Profil ve ฤฐkincil ekran seรงicileri hangi kontrollerin gรถsterileceฤŸini belirler. + DรผฤŸme eylemleri + %1$s ile paylaลŸฤฑlฤฑyor. Dรผzenlemeler o profillere de uygulanฤฑr. + Ayarlarฤฑ yeniden kullan + ลžuradan ayarlarฤฑ kullanโ€ฆ + BaลŸka bir profilden kopyala veya ayarlarฤฑ paylaลŸฤฑmlฤฑ tut + BaฤŸฤฑmsฤฑz yap + Mevcut kurulumu koru ve deฤŸiลŸiklikleri paylaลŸmayฤฑ bฤฑrak + Dรผzenler รถฤŸeleri ve konumlarฤฑnฤฑ saklar. Her profil kendi eylemlerini atayabilir. Hedef ekranda tam boyutta dรผzenleyin. + Geรงerli dรผzen + Kullanฤฑlmayan %1$s dรผzeni ve kaydedilmiลŸ eylemleri silinsin mi? + Geรงerli dรผzeni yeniden adlandฤฑr + %1$s รถฤŸesini baลŸka bir profilden yeniden kullan. DiฤŸer kontrol kaynaklarฤฑ deฤŸiลŸmez. + Fiziksel kontrolleri paylaลŸฤฑmlฤฑ tut + Varsayฤฑlan olarak tรผm kontroller ve รถzel dรผzenler baฤŸฤฑmsฤฑz kopyalardฤฑr. PaylaลŸฤฑm yalnฤฑzca fiziksel kontrolleri baฤŸlar. + Bu รถฤŸeleri ve konumlarฤฑ kullan. PaylaลŸฤฑm gelecekteki geometri deฤŸiลŸikliklerini eลŸitler; dรผฤŸme eylemleriniz baฤŸฤฑmsฤฑz kalฤฑr. Farklฤฑ bir dรผzen atanmamฤฑลŸ eylemlerle baลŸlar. + Bu kontrolleri ve eylemleri kopyala veya gelecekteki deฤŸiลŸiklikler iki profile de uygulanacak ลŸekilde baฤŸla. + PaylaลŸฤฑmlฤฑ tut + BaฤŸฤฑmsฤฑz kopya + ร‡ubuฤŸu dokunma noktasฤฑnda baลŸlat + KullanฤฑlmadฤฑฤŸฤฑnda รงubuฤŸu gizle + Araรงlar + Otomatik (%1$s) + ร–zel (%1$s) + Yeni profil olarak kaydet + Profil kontrolleri + Profil + Fare dokunmatik yรผzey hareketleri + Fare iลŸaretรงisine atandฤฑฤŸฤฑnda: tฤฑklamak iรงin dokunun, sรผrรผklemek iรงin basฤฑlฤฑ tutun ve iki parmakla kaydฤฑrฤฑn. + %1$s iรงin hฤฑzlฤฑ menรผ geรงersiz kฤฑlmasฤฑ var. Varsayฤฑlan profilini ve รผรง kayฤฑtlฤฑ bรถlรผmรผnรผ kullanmak iรงin orada Otomatik seรงin. + DroidDeck giriลŸi + ร‡ubuk herhangi bir yรถne hareket ettirildiฤŸinde basฤฑlฤฑ tutulur: %55 รผzerinde basฤฑlฤฑr, %35 altฤฑnda bฤฑrakฤฑlฤฑr. Her yรถnรผ ayrฤฑ atamak iรงin Yรถn tuลŸlarฤฑnฤฑ kullanฤฑn. DroidDeck komutlarฤฑ her sapma iรงin bir kez รงalฤฑลŸฤฑr. ร‡ubuk tฤฑklamasฤฑ ayrฤฑca yapฤฑlandฤฑrฤฑlฤฑr. + Dokunmatik yรผzeye dokunulduฤŸunda basฤฑlฤฑ tutulur; parmaฤŸฤฑnฤฑzฤฑ kaldฤฑrdฤฑฤŸฤฑnฤฑzda bฤฑrakฤฑlฤฑr. DroidDeck komutlarฤฑ her dokunuลŸ iรงin bir kez รงalฤฑลŸฤฑr. Dokunmatik yรผzey tฤฑklamasฤฑ ayrฤฑca yapฤฑlandฤฑrฤฑlฤฑr. + Tetik %55 i geรงtiฤŸinde basฤฑlฤฑ tutulur; %35 altฤฑnda bฤฑrakฤฑlฤฑr. DroidDeck komutlarฤฑ her basฤฑลŸ iรงin bir kez รงalฤฑลŸฤฑr. + Kaydฤฑrma yรถnรผ + Dikey + Yatay + Yatay kaydฤฑr + ร–lรงรผmler + Kaydฤฑ aรงฤฑn, รงalฤฑลŸan bir oturumda kontrolleri kullanฤฑn, sonra dรถnรผp sonuรงlarฤฑ okuyun. Yalnฤฑzca DroidDeck gรถnderme sรผresini รถlรงer, ekran gecikmesini deฤŸil. Kayฤฑt, uygulama sรผreci kapanฤฑnca sona erer. + %1$d kontrol + DiฤŸer kayฤฑtlฤฑ dรผzenler (%1$d) โ–พ + DiฤŸer kayฤฑtlฤฑ dรผzenleri gizle (%1$d) โ–ด + Ana sayfa / Guide + Geri ยท tek dokunuลŸ + Geri ยท รงift dokunuลŸ + Geri ยท Steam\'de iki kez, masaรผstรผnde bir kez + Steam modunda. Geri tuลŸunu basฤฑlฤฑ tutmak hฤฑzlฤฑ eriลŸimi de aรงar. + Varsayฤฑlana sฤฑfฤฑrla + Panel seรงiminiz hatฤฑrlanฤฑr. Masaรผstรผ ikinci bir รงalฤฑลŸma alanฤฑ aรงar; oturumu veya giriลŸ profilini deฤŸiลŸtirmez. + Sanal denetleyici + Steam veya oyunun gรถrdรผฤŸรผ denetleyici tรผrรผ. + Dokunmatik ekran + Oyun ekranฤฑndaki dokunuลŸlarฤฑn nasฤฑl iลŸlendiฤŸi. Profil dรผฤŸmeleri atanmฤฑลŸ eylemlerini korur. + Dokunma imleci + Oyun ekranฤฑndaki doฤŸrudan dokunuลŸlar iรงin iลŸaretรงi gรถster. + Dokun ve tut + Oyun ekranฤฑnda parmaฤŸฤฑnฤฑzฤฑ tutarken fare eylemi. + Geri dรผฤŸmesi dokunuลŸlarฤฑ + ฤฐlk eylem: tek dokunuลŸ. ฤฐkinci eylem: รงift dokunuลŸ. + Aรง/kapa dรผฤŸmesi + Basฤฑlฤฑ tutmak iรงin dokunun, bฤฑrakmak iรงin tekrar dokunun. Menรผ aรงmak veya profil deฤŸiลŸtirmek dรผฤŸmeyi bฤฑrakฤฑr. + ลžekil + YuvarlatฤฑlmฤฑลŸ + Kapsรผl + Daire + Dikdรถrtgen + DรผฤŸme etiketi + Metin + ฤฐรงe aktarฤฑlan gรถrsel + Ayrฤฑ รงapraz tuลŸlar + Her รงapraza bir tuลŸ atayฤฑn. BoลŸ รงapraz, iki komลŸu yรถnรผne basar. + KomลŸu yรถnler + Eski ekran tuลŸlarฤฑnฤฑz aลŸaฤŸฤฑda iรงe aktarฤฑlmฤฑลŸ profiller olarak kaydedildi. Kullanmak veya dรผzenlemek iรงin birini seรงin. Geรงerli profil seรงimleriniz korundu. + Eski ekran tuลŸlarฤฑ otomatik olarak iรงe aktarฤฑlamadฤฑ. ร–zgรผn ayarlar korundu. + diff --git a/app/src/main/res/values-tr/input_strings.xml b/app/src/main/res/values-tr/input_strings.xml new file mode 100644 index 0000000000..1a3fa61cad --- /dev/null +++ b/app/src/main/res/values-tr/input_strings.xml @@ -0,0 +1,38 @@ + + + GiriลŸ profilleri + Profiller + Fiziksel denetleyici + Ana ekran + ฤฐkincil ekran + Yerel / Steam Input + Yerel: %1$s + BaลŸka bir denetleyici denetimi gรถnder + Devre dฤฑลŸฤฑ + TuลŸ veya tuลŸ bileลŸimi + Yรถn tuลŸlarฤฑ + ฤฐลŸaretรงiyi taลŸฤฑ + ฤฐลŸaretรงi hฤฑzฤฑ: %1$d + Kaydฤฑr + Dikey kaydฤฑr + Fare sol dรผฤŸmesi + Fare saฤŸ dรผฤŸmesi + Fare orta dรผฤŸmesi + DroidDeck menรผsรผnรผ aรง + Klavyeyi gรถster + Steam menรผsรผnรผ aรง + Steam hฤฑzlฤฑ eriลŸimini aรง + Denetimi kaldฤฑr + Denetim ekle + Cihaza รถzel dรผฤŸmeler + Fiziksel dรผฤŸme ata + DรผฤŸmeyi bฤฑrakฤฑn, ardฤฑndan Dรผzenle, Yeniden dene veya ฤฐptal seรงin. B veya Geri, bฤฑraktฤฑktan sonra iptal eder. + Yeniden dene + Bir dรผฤŸmeye basฤฑn; klavye tuลŸu olarak bildirilen Geri dรผฤŸmesi de dahil. Ses ve Android sistem tuลŸlarฤฑ ayrฤฑlmฤฑลŸtฤฑr. Atama yalnฤฑzca bu cihaz iรงin geรงerlidir. + Atamayฤฑ kaldฤฑr + GiriลŸ tanฤฑlama + GiriลŸ gรถnderme sรผresini kaydet + ร–lรงรผmleri oku + Android\'den mevcut giriลŸ aktarฤฑmฤฑna yayฤฑna kadar รถlรงer. Bluetooth varฤฑลŸฤฑ, konuk yoklamasฤฑ, oluลŸturma ve ekran gecikmesi hariรงtir. Kayฤฑt varsayฤฑlan olarak kapalฤฑdฤฑr. + Normal giriลŸ atamasฤฑnฤฑ kullan + diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index 1d53a2d478..9623e13648 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -28,6 +28,8 @@ ลžimdi askฤฑya al Oturumu durdur Kare oluลŸturma + Bu oyunun ayarlarฤฑ + Varsayฤฑlan ayarlar Kare oluลŸturma modunu seรงin Kapalฤฑ DD-FG %1$dร— @@ -183,6 +185,7 @@ PowerVR grafik ortamฤฑ indirilemedi. BaฤŸlantฤฑyฤฑ kontrol edip tekrar deneyin. DirectAudio indirilemedi, bu yรผzden oyun sesi bu oturumda daha yavaลŸ yolu kullanฤฑyor. Bu program + Oturum ekrana gรถrรผntรผ รงizemedi: %1$s. Bu ekran, siyah bir ekran yerine nedenini gรถsteriyor; ayrฤฑntฤฑlar oturum gรผnlรผklerinde. Steam istemcisi indirilemedi. AฤŸฤฑnฤฑz veya VPN\'iniz Steam sunucularฤฑnฤฑ engelliyor olabilir; baฤŸlantฤฑyฤฑ kontrol edip yeniden deneyin. Steam istemcisi kurulamadฤฑ. BaฤŸlantฤฑnฤฑzฤฑ ve boลŸ depolama alanฤฑnฤฑ kontrol edip yeniden deneyin. %1$s x86 PC\'ler iรงin derlenmiลŸ ve FEX ile รงalฤฑลŸฤฑr, ancak FEX henรผz yรผklรผ deฤŸil. Oturum aรงmฤฑลŸken Steam\'i bir kez baลŸlatฤฑp FEX\'i ve Steam Linux Runtime\'ฤฑ indirmesini bekleyin, ardฤฑndan bunu yeniden baลŸlatฤฑn. @@ -385,6 +388,9 @@ Burada henรผz desteklenmiyor BileลŸenler yรผkleniyorโ€ฆ Yรผklenemedi: %1$s + Bu indirme gรผncellenmeli. + Gรผncelleme sฤฑraya alฤฑndฤฑ. + Gรผncellemeyi yeniden dene ฤฐndirildi %1$s indiriliyor Yรผkleniyor: %1$s @@ -415,6 +421,22 @@ Yalnฤฑzca dahili Klasรถr: %1$s ฤฐkinci kรผtรผphane + Ek Steam kitaplฤฑklarฤฑ + Steam รผzerinden oyun yรผklenip oynatฤฑlabilen klasรถrler; her biri kendi adฤฑyla listelenir. Birini kaldฤฑrmak oyunlarฤฑnฤฑ diskte bฤฑrakฤฑr. + Kitaplฤฑk ekle + Yeniden adlandฤฑr + Kitaplฤฑk adฤฑ + Kitaplฤฑk iรงin bir klasรถr seรงin + En fazla %1$d kitaplฤฑk eklenebilir + Bu klasรถr zaten bir kitaplฤฑk ya da bir kitaplฤฑฤŸฤฑn iรงinde yer alฤฑyor + %1$s ยท kullanฤฑlamฤฑyor + Sonraki Steam oturumundan itibaren geรงerli + Bu cihazda bulundu ยท %1$s ยท %2$s + Ekle + Dahili depolamadaki kitaplฤฑklarฤฑ bul + DroidDeck, diฤŸer uygulamalarฤฑn dahili depolamada sakladฤฑฤŸฤฑ Steam kitaplฤฑklarฤฑnฤฑ gรถrebilsin diye tรผm dosyalara eriลŸim izni verin. + ฤฐzin ver + %1$s eklendi: seรงtiฤŸiniz klasรถrรผn iรงindeki Steam kitaplฤฑฤŸฤฑ Varlฤฑklarฤฑ SD karttan veya paylaลŸฤฑlan depolamadan akฤฑลŸla yรผkleyen oyunlarda takฤฑlmalar olabilir. Depolama tanฤฑlamasฤฑ Ayฤฑrma sonuรงlarฤฑnฤฑ ve รถrneklenmiลŸ depolama sรผrelerini โ€œGรผnlรผkleri paylaลŸโ€ รงฤฑktฤฑsฤฑna ekler. Aรงฤฑkken yรผklemeleri yavaลŸlatabilir. Sonraki oturumda uygulanฤฑr. @@ -478,6 +500,7 @@ Aรงฤฑk Steam ile baลŸlar Steam olmadan baลŸlar + Oyun รงรถzรผnรผrlรผฤŸรผ Ayarlar %1$s Ayarlarฤฑ Varsayฤฑlan @@ -565,6 +588,8 @@ Oyun รงekirdekleri Oyun รงekirdekleri Oyunlar iรงin รงekirdekler. Tรผmรผ seรงiliyse Android serbestรงe zamanlar. + Kararlฤฑ oyunlarda gรผรง tasarrufu + Oyun kare hฤฑzฤฑnฤฑ sabit tutarken onu yavaลŸ รงekirdeklerde รงalฤฑลŸtฤฑrฤฑr, geride kalฤฑnca her zamanki รงekirdeklerine geri dรถndรผrรผr. ฤฐstemci arayรผzรผ ฤฐลŸ parรงacฤฑklฤฑ GL Steam menรผlerinin daha hฤฑzlฤฑ tepki vermesini saฤŸlayabilir. @@ -600,7 +625,10 @@ Proton\'un her oyunda CPU harcayan kumandayla gezinme yardฤฑmcฤฑsฤฑnฤฑ kapatฤฑr. proot\'u seccomp olmadan รงalฤฑลŸtฤฑr Bazฤฑ รงekirdeklerde eksik sistem รงaฤŸrฤฑsฤฑ hatalarฤฑnฤฑ dรผzeltebilir. Performansฤฑ dรผลŸรผrebilir. + proot olmadan รงalฤฑลŸtฤฑr (deneysel) + Linux tarafฤฑnฤฑ doฤŸrudan Android รผzerinde baลŸlatฤฑr. Sonraki oturumda geรงerli olur. Bir ลŸey baลŸlatฤฑlamazsa kapatฤฑn. proot hฤฑzlฤฑ yolu + proot olmadan kullanฤฑlmaz. proot\'un seccomp filtresi gerekir. Daha hฤฑzlฤฑ dosya aramalarฤฑ ve daha az takฤฑlma. Bir program dosyalarฤฑnฤฑ bulamฤฑyorsa kapatฤฑn. ฤฐmleci gamescope iรงinde รงiz @@ -683,6 +711,7 @@ Grafik belleฤŸi Takas alanฤฑ Pil seviyesi + Kalan pil sรผresi Gรผรง tรผketimi AฤŸ ร‡รถzรผnรผrlรผk @@ -809,6 +838,7 @@ Cihaz destekleniyor Test edilmemiลŸ GPU GPU desteklenmiyor + Mali kรถprรผsรผ รผzerinden GPU %1$s ยท %2$s %1$s: %2$s %1$s iรงin uyumlu bir grafik arka ucu yok. Steam siyah ekran gรถsterebilir. @@ -838,15 +868,38 @@ Oturum Oturum gรผnlรผkleri Her oturumdan sonra kaydedilir + Sonraki oturum iรงin geliลŸmiลŸ tanฤฑlama + Bir oturum iรงin ayrฤฑntฤฑlฤฑ gรผnlรผkler kaydeder. Performansฤฑ dรผลŸรผrebilir ve daha fazla depolama alanฤฑ kullanabilir. Oturum baลŸladฤฑฤŸฤฑnda kendiliฤŸinden kapanฤฑr; paylaลŸmadan รถnce gรผnlรผkleri inceleyin. Oyun hata ayฤฑklama gรผnlรผkleri Sonraki oyun baลŸlatmada Proton, Wine ve grafik tanฤฑlamalarฤฑnฤฑ ekler. Performansฤฑ dรผลŸรผrebilir ve daha fazla depolama kullanabilir. Oyun hata ayฤฑklama gรผnlรผklerini kaydetmek iรงin bu oturumu yeniden baลŸlatฤฑn Gรผnlรผk kaydฤฑ gรผncellenemedi. Anahtarฤฑ kontrol edip tekrar deneyin. Hata ayฤฑklama araรงlarฤฑ + Ayrฤฑntฤฑlฤฑ grafik gรผnlรผkleri + Steam arayรผzรผ: GPU ile รงizim + Xclipse sรผrรผcรผ ikilisi kullanฤฑldฤฑฤŸฤฑnda Steam, sayfalarฤฑnฤฑ yazฤฑlฤฑmla รงizer (GPU ile รงizimde bozuk dรถลŸemeler gรถrรผldรผ). Bu telefonda dรผzgรผn gรถrรผnรผyorsa daha hฤฑzlฤฑ bir Steam arayรผzรผ iรงin aรงฤฑn. + %1$s tarihinde derlendi + %1$s en yeni derlemeye gรผncellendi + Mali kรถprรผsรผ son oturumda %1$s รผzerinde kendi kendini testini geรงemedi (gรถrรผntรผler veya รงizimler), bu nedenle oturum yerine PanVK sรผrรผcรผ รงiftini kullandฤฑ. + Mali kรถprรผsรผ son oturumda %1$s รผzerinde sรผrรผcรผyle bellek paylaลŸmanฤฑn bir yolunu bulamadฤฑ, bu nedenle oturum yerine PanVK sรผrรผcรผ รงiftini kullandฤฑ. Kรถprรผ bu telefonda รงalฤฑลŸamaz; kapatmak PanVK รงiftini korur. + Her oyunun Proton, DXVK ve sรผrรผcรผ gรผnlรผkleri oturumun gรผnlรผklerinde yer alฤฑr. GPU bir Adreno deฤŸilse her zaman aรงฤฑktฤฑr. Son oturum gรผnlรผkleri Kayฤฑtlฤฑ oturum gรผnlรผkleri En yeni %1$d tanesini saklar Gรผnlรผkleri temizle + Kullanฤฑlabilir oturum gรผnlรผkleri + Henรผz kaydedilmiลŸ oturum gรผnlรผฤŸรผ yok. + PaylaลŸฤฑlan ve kaydedilen ZIP dosyalarฤฑ, seรงili oturumun yanฤฑ sฤฑra ilgili Steam, maฤŸaza, araรง ve Battle.net tanฤฑlama verilerini iรงerir. + %1$s ยท %2$s + Geรงerli oturum + PaylaลŸ + Cihaza kaydet + Sil + Oturum gรผnlรผkleri silinsin mi? + %1$s silinsin mi? Bu iลŸlem geri alฤฑnamaz. + Oturum gรผnlรผkleri kaydedildi. + Oturum gรผnlรผkleri kaydedilemedi. + Oturum gรผnlรผkleri silinemedi. ร‡evrimdฤฑลŸฤฑ mod ร–nce Steam\'de oturum aรงฤฑn BaลŸlatฤฑcฤฑ @@ -865,6 +918,8 @@ Ana ekran olarak kullan DroidDeck ana ekran uygulamasฤฑ olabilir DroidDeck hiรงbir zaman ana ekran uygulamasฤฑ olarak sunulmaz + Ana ekran tuลŸunun aรงtฤฑฤŸฤฑ sayfa + DroidDeck Ana ekran uygulamasฤฑyken Ana ekran tuลŸuna bastฤฑฤŸฤฑnฤฑzda gรถsterilen sayfa Oyun Ekle bรถlรผmรผnde DroidDeck\'i Dahil Et olarak ayarlayฤฑn Yรถn BaลŸlatฤฑcฤฑ yรถnรผ @@ -878,15 +933,22 @@ Tam ekran Android durum ve gezinme รงubuklarฤฑnฤฑ gizler Android durum ve gezinme รงubuklarฤฑnฤฑ gรถsterir + ร‡ift ekranlฤฑ baลŸlatฤฑcฤฑ + Otomatik, yerleลŸik ikinci ekranฤฑ olan el konsollarฤฑnda baลŸlatฤฑcฤฑ bรถlรผmlerini (Steam, Kitaplฤฑk, MaฤŸazalar ve diฤŸerleri) ikinci ekrana yerleลŸtirir. Aรงฤฑk, herhangi bir ikinci ekranฤฑ kullanฤฑr. Kapalฤฑ, baลŸlatฤฑcฤฑyฤฑ tek ekranda tutar. + ร‡ift ekranlฤฑ oturumlar + Otomatik, oyun iรงi menรผyรผ aรงฤฑlฤฑr pencere yerine yerleลŸik ikinci ekrana sabitler. Aรงฤฑk, herhangi bir ikinci ekranฤฑ kullanฤฑr. Kapalฤฑ, menรผyรผ oyun ekranฤฑnda tutar; yine de menรผden ikinci bir ekran seรงebilirsiniz. Otomatik Aรงฤฑk Kapalฤฑ Oyunlarda alt ekran kontrolleri + Metin alanlarฤฑ iรงin Android klavyesi Bir oturum baลŸladฤฑฤŸฤฑnda ikinci ekranda dokunmatik yรผzeyi ve klavyeyi aรงar. รœst ekran iรงin yazฤฑlฤฑyor Bitti Varsayฤฑlan ana ekran uygulamasฤฑ Ana ekran uygulamasฤฑ seรงin + BoลŸtayken baลŸlatฤฑcฤฑyฤฑ Son kullanฤฑlanlardan gizle + Yalnฤฑzca DroidDeck varsayฤฑlan Ana ekran uygulamasฤฑyken ve hiรงbir oturum รงalฤฑลŸmฤฑyorken geรงerlidir. Seรง Linux uygulamalarฤฑ (beta) Dosyalar @@ -998,9 +1060,172 @@ ร–nizleme En yeni dรผzeltmeler, Kararlฤฑ\'dan รถnce Gรผncel + Derleme ayrฤฑntฤฑlarฤฑnฤฑ kopyala + Derleme ayrฤฑntฤฑlarฤฑ kopyalandฤฑ + ร–nizlemeden yeni + ร–nizlemenin รถnรผndesiniz + Bu derleme en son ร–nizlemeden daha yeni. Bir sonraki ร–nizleme derlemesi onu gรผncelleyecek. + DeฤŸiลŸiklikleri gรถrmek veya yรผklemek iรงin bir derleme seรงin. + Yรผklรผ + Bu derlemeyi yรผkle%1$s + Bu derlemeye geri dรถn%1$s + versionCode %1$d + Commit %1$s + Sรผrรผm sayfasฤฑ + PR\'de daha yeni bir commit var (%1$s). Test derlemesi henรผz hazฤฑr deฤŸil, bu yรผzden bu derleme onu iรงermiyor. + Yeni commit var, derleme bekleniyor + PR numarasฤฑ, baลŸlฤฑk veya yazar + EลŸleลŸen test derlemesi yok + Yeniden derlenmeli (versionCode %1$d) + Test derlemesi gรผncellemeleri + PR #%1$d iรงin yeni test derlemesi + %1$s. Yรผklemek iรงin Gรผncellemeler\'i aรงฤฑn. + Daha fazla gรถster (%1$d) + versionCode %2$d iรงin yeniden derlenmeli (%1$d) + Bu test derlemesinden beri main รผzerindeki ร–nizleme derlemeleri: %1$d Test derlemeleri Yayฤฑnlanmadan รถnce bir dรผzeltmeyi deneyin ลžu anda yok + Deneysel derleme + Deneysel derlemeler + Kullanฤฑmda + Android, DroidDeck uygulamasฤฑnฤฑ yeniden optimize ettikten sonra duraklatฤฑldฤฑ + Yรผklenmedi: %1$s + Yeniden baลŸlatma bekleniyor + Korundu + BaลŸka bir sรผrรผm iรงin + Yeniden derle + Bu derlemeyi cihazdan siler + Bu derlemeyle yeniden baลŸlat + Kapat + Kullan + Sil + ลžimdi sil + Yeniden baลŸlatma hazฤฑrlanamadฤฑ: %1$s. Ayarlar bรถlรผmรผnde kablosuz hata ayฤฑklamayฤฑ eลŸleลŸtirip yeniden deneyin. + Deneysel derleme yรผklendi + DroidDeck, %1$s ile yeniden baลŸlatฤฑldฤฑ + Lab derlemesi duraklatฤฑldฤฑ + Android, DroidDeck\'i yeniden optimize ettiฤŸi iรงin %1$s yรผklenmedi. Bu derlemeyle yeniden baลŸlatmak iรงin Gรผncellemeler\'i aรงฤฑn. + Lab derlemesi kapatฤฑldฤฑ + DroidDeck\'in baลŸka bir sรผrรผmรผ iรงin derlendi. Gรผncellemeler\'de saklanฤฑyor. + DroidDeck bu derlemeyle iki kez baลŸlatฤฑlamadฤฑ + Ajan + Ajan + Ajan รงalฤฑลŸฤฑyor + Ajanฤฑ kullanmak iรงin Claude Code\'u Linux kullanฤฑcฤฑ alanฤฑna yรผkleyin. + Bir oyun, bir รงรถkme ya da DroidDeck\'te bir deฤŸiลŸiklik hakkฤฑnda sorun + Gรถnder + Yeni sohbet + Durdur + Depolama + Kaldฤฑr + ลžimdi kaldฤฑr + Claude Code + Codex + DroidDeck kaynak kodu + ฤฐndirme รถnbellekleri + Gรถnderilmeyen deฤŸiลŸiklikler kaybolur + Derlemeler bunlarฤฑ yeniden indirir + Kurulum bunu yeniden yรผkleyebilir; oturum bilgileri korunur + DroidDeck, Lab derlemenizle yeniden baลŸlatฤฑldฤฑ. KaldฤฑฤŸฤฑnฤฑz yerden devam edin. + Bir oyunun neden aรงฤฑlmadฤฑฤŸฤฑnฤฑ sorun, bir gรผnlรผฤŸรผ aรงฤฑklamasฤฑnฤฑ isteyin ya da DroidDeck\'i deฤŸiลŸtirip deฤŸiลŸikliฤŸi bu cihazda denemesini isteyin. + BaลŸarฤฑsฤฑz: %1$s + %1$s sonlandฤฑ (รงฤฑkฤฑลŸ %2$d) + Durduruldu + Yanฤฑt vermeden sonlandฤฑ + Yeniden dene + Ajan kuruluyor + %1$s Lab derlememi yรผklรผ DroidDeck sรผrรผmรผ iรงin yeniden derle ve bu derlemeyle yeniden baลŸlat. + %1$s giriลŸ ยท %2$s รงฤฑkฤฑลŸ + DรผลŸรผnรผyor + DรผลŸรผnce + DรผลŸรผnรผyor ยท %1$s + %1$s ยท %2$s + GฤฐRDฤฐ + ร‡IKTI + ร‡alฤฑลŸฤฑyorโ€ฆ + Sonuรง yok: tur รถnce sona erdi + ร‡ฤฑktฤฑ yok + Sonraki mesajฤฑ sฤฑraya almak iรงin yazฤฑn + Sฤฑraya ekle + Sฤฑradaki: %1$s + Gรถnderme + Ekle + Kaldฤฑr + Varsayฤฑlan + Akฤฑl yรผrรผtme รงabasฤฑ + Devam et + Revize et + Henรผz bir ลŸey deฤŸiลŸmedi + Planla devam et. + ลžimdi gรถnder + DiฤŸer + Kapat + En son + ร‡alฤฑลŸฤฑyor + BaฤŸlam + %1$s / %2$s + Bu konuลŸma ยท %1$s + Kullanฤฑm ilk yanฤฑttan sonra gรถrรผnรผr + %1$d saatlik sฤฑnฤฑr + %1$d dakikalฤฑk sฤฑnฤฑr + Haftalฤฑk sฤฑnฤฑr + %1$d%% ยท %2$s sฤฑfฤฑrlanฤฑr + + %1$d dosya + %1$d dosya + + ร–nce planla + Plan + Hiรงbir ลŸeyi deฤŸiลŸtirmeden bir plan รถnerir + KonuลŸmalar + Henรผz konuลŸma yok + Az รถnce + Sil + KonuลŸmayฤฑ ve eklerini siler + Sรผreรงler + Linux kullanฤฑcฤฑ alanฤฑnda hiรงbir ลŸey รงalฤฑลŸmฤฑyor + AJAN + Durdur + Lab derlemesi + Lab derlemeleri hazฤฑrlanฤฑyor + %1$d%% ยท yaklaลŸฤฑk %2$s kaldฤฑ + yaklaลŸฤฑk %1$s kaldฤฑ + ฤฐptal + Derlemeyi iptal et + BaลŸlatฤฑlฤฑyor + %1$d%% + Paketleniyor + DroidDeck รผzerinde yeniden baลŸlatฤฑlฤฑyor + Tamamlandฤฑ + BaลŸarฤฑsฤฑz: %1$s + Ajanฤฑ kur + ร–nce Kurulum\'da Linux รงalฤฑลŸma zamanฤฑnฤฑ yรผkleyin. + Yeniden dene + Sohbete baลŸla + Cihaz baฤŸlantฤฑsฤฑ + Kablosuz hata ayฤฑklama; ajan DroidDeck\'i gรถrรผp yรถnetebilsin diye + %1$s yรผkle + git, gh ve adb ile Linux kullanฤฑcฤฑ alanฤฑna + %1$s hesabฤฑna giriลŸ yap + Tarayฤฑcฤฑnฤฑzฤฑ aรงar + GitHub + ฤฐsteฤŸe baฤŸlฤฑ, pull request aรงmak iรงin + Derleme araรงlarฤฑ + ฤฐsteฤŸe baฤŸlฤฑ, bu cihazda Lab derlemeleri iรงin ยท yaklaลŸฤฑk 5 GB + Aracฤฑ hazฤฑr + Aracฤฑ kurulumunu tamamla + %1$s hesabฤฑna giriลŸ yapฤฑldฤฑ + Lab derlemeleri + hฤฑzlฤฑ derlemeler + Hฤฑzlฤฑ Lab derlemeleri + Bu sรผrรผmรผ รถnceden derler, bรถylece Lab derlemeleri dakikalar sรผrer ยท tek seferlik yaklaลŸฤฑk 20 dakika + Derleniyor ยท %1$d%% ยท yaklaลŸฤฑk %2$s kaldฤฑ + Hazฤฑrla + Kablosuz hata ayฤฑklamaya ulaลŸฤฑlamฤฑyor; EลŸleลŸtir ile aรงฤฑlฤฑr + EลŸleลŸtir + Yรผkle + GiriลŸ yap PR #%1$d Bu DroidDeck kopyasฤฑ iรงin derlenmedi Gรผncellendi %1$s @@ -1240,6 +1465,9 @@ Uygulamalar Kurulum Gรผncellemeler + DiฤŸer + Sekmeleri dรผzenle + Sekmeler %%%1$d Devam et: %1$s Her oturumda /root/ROMs olarak gรถrรผnรผr. Dahili depolama /root/Storage konumundadฤฑr. @@ -1261,6 +1489,15 @@ Sฤฑradakini iptal et Android klavyesi Gizle โœ• + Ekrandaki boyut + BaลŸlฤฑk dahil, klavyenin ekranda kapladฤฑฤŸฤฑ oran. + Opaklฤฑk + Klavyenin arkasฤฑndaki oyunu gรถrmek iรงin azaltฤฑn. + Gizli tuลŸlar + Az kullandฤฑฤŸฤฑnฤฑz tuลŸlar klavyede gรถsterilmez. + Esc ve iลŸlev tuลŸlarฤฑ sฤฑrasฤฑ + Ins / Del / Home / End / PgUp / PgDn + Ok tuลŸlarฤฑ BaลŸlat: %1$s Bir ekran seรงin. ฤฐkincil: %1$s. ฤฐkincil ekran artฤฑk kullanฤฑlamฤฑyor. @@ -1762,7 +1999,24 @@ Terminal Deck tutamaklarฤฑ + dokunmatik yรผzeyler Gรถsterge paneli + Masaรผstรผ + Masaรผstรผnรผ baลŸlat + Masaรผstรผ ยท %1$s + Dokunmatik yรผzey + DoฤŸrudan dokunma + Dokunmatik yรผzey. DoฤŸrudan dokunmaya geรงmek iรงin dokun + DoฤŸrudan dokunma. Dokunmatik yรผzeye geรงmek iรงin dokun + KDE masaรผstรผ baลŸlatฤฑlฤฑyorโ€ฆ + Masaรผstรผ kapandฤฑ. + Masaรผstรผ baลŸlatฤฑlamadฤฑ. Gรผnlรผkleri bu oturumun bottom-desktop klasรถrรผnde. + Masaรผstรผ kapalฤฑ. Burada henรผz gรถsterilecek bir ลŸey yok. + Ekranlarฤฑ deฤŸiลŸtir + Alt ekran ลŸu anda boลŸ deฤŸil + Oyun ekranฤฑ + Oyunun gรถsterileceฤŸi ekran + รœst ekran + Alt ekran ฤฐndirmeler Devam eden indirme yok. Steam @@ -1797,6 +2051,20 @@ Yakฤฑt, t Ana %1$s t Yedek %1$s t + Kare sรผresi + son %1$d sn + ort. kare + En dรผลŸรผk yรผzde 1 + 33 ms รผzeri kareler + %1$d / dk + %1$s sรผredir oynanฤฑyor + %1$d รงekirdek, en fazla %2$s GHz + %1$d รงekirdek + oyun + %1$d Hz\'de FPS + Kฤฑrmฤฑzฤฑ iลŸaret, sฤฑcaklฤฑฤŸฤฑn HUD รผzerinde kฤฑrmฤฑzฤฑ gรถrรผndรผฤŸรผ yerdir. + tรผm cihaz + pil Gรถsterge verilerini gรถnder Otomatik Sonradan bulunanlar dahil, burada listelenen her oyun iรงin aรงar. KapattฤฑฤŸฤฑnฤฑz oyunlar kapalฤฑ kalฤฑr. @@ -1820,6 +2088,10 @@ Bu oyun iรงin mikrofon kapalฤฑ. KonuลŸmak iรงin DroidDeck\'in Steam ayarlarฤฑnda (Ses) Mikrofon\'u aรงฤฑn ve oyunu yeniden baลŸlatฤฑn. Ses dรผzeyi %1$d%% Oyun iรงi istatistikler + Alt ekrandaki HUD + Her sekmede ลŸerit + En dรผลŸรผk yรผzde 1 ve 0,1 + CPU sฤฑcaklฤฑฤŸฤฑ FPS CPU GPU @@ -1992,6 +2264,7 @@ Oturum baลŸlatฤฑlฤฑyorโ€ฆ %1$d:%2$02d geรงti ยท hรขlรข รงalฤฑลŸฤฑyor Steam istemcisi gรผncellemesi indiriliyor ยท %1$d%% + Steam istemcisi gรผncellemesi uygulanฤฑyorโ€ฆ Steam istemcisi indiriliyor ยท %1$s Zaten รงalฤฑลŸan bir uyumluluk aracฤฑ yรผklemesi var @@ -2068,11 +2341,29 @@ ร‡izgi film konturlarฤฑ ve keskinleลŸtirme. Adreno GPU deฤŸil + Sistem PowerVR sรผrรผcรผsรผ: uyumluluk cihaza gรถre deฤŸiลŸir + Deneysel: RADV veya sistem Xclipse sรผrรผcรผsรผ + Sistem PowerVR + Bu GPU iรงin yerleลŸik sรผrรผcรผleri kullanฤฑr + ร‡alฤฑลŸma zamanฤฑ ve ekran iรงin sistem PowerVR sรผrรผcรผsรผ seรงili. + Bu Mali modelini henรผz aรงฤฑk kaynaklฤฑ bir sรผrรผcรผ desteklemiyor: Mali kรถprรผsรผ aรงฤฑk. + Bu, Snapdragon olmayan test sรผrรผmรผ: buradaki resmi sรผrรผmler yalnฤฑzca Adreno รผzerinde รงalฤฑลŸฤฑr, bu yรผzden bunun รผzerine kurulmaz. Yeni test sรผrรผmleri github.com/The412Banner/droiddeck-nonadreno-drivers adresinde. + Son oturum bir รงรถkme yรผzรผnden deฤŸil, Android bellek aรงmak iรงin DroidDeck uygulamasฤฑnฤฑ kapattฤฑฤŸฤฑ iรงin sona erdi. DiฤŸer uygulamalarฤฑ kapatฤฑn veya oyunun doku ayarlarฤฑnฤฑ dรผลŸรผrรผn, ardฤฑndan yeniden deneyin. + Mali (Venus) + Mali kรถprรผsรผ + Bu Mali modelini henรผz aรงฤฑk kaynaklฤฑ bir sรผrรผcรผ desteklemiyor: telefonun kendi sรผrรผcรผsรผ รผzerinde %1$s kullanฤฑlฤฑyor. + %1$s henรผz yayฤฑnlanmadฤฑ: yayฤฑnlanana kadar %2$s kullanฤฑlฤฑyor. + %1$s kullanฤฑlamฤฑyor ve bu telefonun sรผrรผcรผsรผ Vulkan %2$s sรผrรผmรผnรผ bildiriyor (Venus iรงin 1.2 gerekli): Mali kรถprรผsรผ kullanฤฑlฤฑyor. + %1$s henรผz yayฤฑnlanmadฤฑ: yayฤฑnlanana kadar Mali kรถprรผsรผ aรงฤฑk. + Sฤฑrada: %1$s (farklฤฑ bir รงalฤฑลŸma zamanฤฑ sรผrรผcรผsรผ bekleniyor) + DXVK, sistem PowerVR รงalฤฑลŸma zamanฤฑ tarafฤฑndan saฤŸlanฤฑr. DiฤŸer DXVK paketleri saklanabilir, ancak bu sรผrรผcรผyle uygulanmaz. Destekleniyor Deneysel: sรผrรผcรผleri test derlemeleri Deneysel Adreno 850 desteฤŸi: uyumlu deneysel ekran ve oyun sรผrรผcรผleri gerekir; bu cihazda doฤŸrulanmadฤฑ Test edilen donanฤฑmฤฑn altฤฑnda (Adreno 725 ve daha yenisi): รงalฤฑลŸmayabilir Desteklenmiyor: bu GPU iรงin uyumlu bir grafik arka ucu yok + Telefonun kendi Vulkan sรผrรผcรผsรผ รผzerinde, Mali kรถprรผsรผ aracฤฑlฤฑฤŸฤฑyla รงalฤฑลŸฤฑr + Mali kรถprรผsรผ kapalฤฑyken desteklenmez: Turnip, Adreno (Snapdragon) GPU gerektirir GitHub\'ฤฑn hฤฑz sฤฑnฤฑrฤฑna ulaลŸฤฑldฤฑ - daha sonra yeniden deneyin GitHub HTTP %1$d yanฤฑtฤฑ verdi @@ -2181,7 +2472,6 @@ MaฤŸazalar Steam ร–zel - MaฤŸazalar ฤฐndirme hฤฑzฤฑ katmanฤฑ Dengeli Hฤฑzlฤฑ @@ -2220,6 +2510,7 @@ DiฤŸer Battle.net indirmesi bekleniyorโ€ฆ Battle.net\'i aรงฤฑp bir kez oturum aรงฤฑn, ardฤฑndan oyunlarฤฑnฤฑ buradan yรผkleyin. Blizzard indiricisi durdu: %1$s + Blizzard indiricisi ilerlemeyi durdurdu. Blizzard hatasฤฑ %1$s Gรผncelle Blizzard oyunlarฤฑ @@ -2227,6 +2518,7 @@ Kesintiye uฤŸradฤฑ Yรผkle ยท %1$s รœcretsiz al + KitaplฤฑฤŸa ekleniyorโ€ฆ %1$s\'te gรถrรผntรผle Satฤฑn al ยท %1$s Yรผklรผ @@ -2273,6 +2565,12 @@ Sฤฑrala Kenar รงubuฤŸu etiketleri Kenar รงubuฤŸu simgelerinin altฤฑnda adlarฤฑ gรถsterir. Daha ince bir kenar รงubuฤŸu iรงin kapatฤฑn. + Ajan evcil hayvanฤฑ + DeeDee baลŸlatฤฑcฤฑnฤฑn ve oyunlarฤฑn รผzerinde gรถrรผnรผr; ajanฤฑn ne yaptฤฑฤŸฤฑnฤฑ gรถsterir. + DiฤŸer uygulamalarฤฑn รผzerinde + DeeDee\'nin her uygulamanฤฑn รผzerinde gรถrรผnmesine ve sohbetini orada aรงmasฤฑna izin ver + ฤฐzin ver + DeeDee ile sohbet et Gรถrรผnรผm Daha bรผyรผk kartlar Daha kรผรงรผk kartlar @@ -2554,7 +2852,14 @@ %1$s ยท yeniden baลŸlatma bekliyor Bu cihaz %1$s kaldฤฑrฤฑlsฤฑn mฤฑ? - Tanฤฑlama + GeliลŸtirici + Derleme etiketi filigranฤฑ + Test veya Lab derlemesinin etiketini ekranda gรถsterir. Varsayฤฑlan olarak aรงฤฑktฤฑr. + Tanฤฑlama paketlerini paylaลŸ + Oturum ve cihaz + Grafikler + Oyunlar ve uyumluluk + Tรผm paketler Oynamaya hazฤฑr Henรผz oynamaya hazฤฑr deฤŸil รงalฤฑลŸma ortamฤฑ %1$s @@ -2593,6 +2898,9 @@ MaฤŸaza ayarlarฤฑnda GOG baลŸarฤฑmlarฤฑnฤฑ aรง BaลŸarฤฑmlar kullanฤฑlamฤฑyor; oturum gรผnlรผklerini kontrol et BaลŸarฤฑmฤฑn kilidi aรงฤฑldฤฑ + Mali (Venus): kapalฤฑ + Mali (Venus): aรงฤฑk + %1$s รผzerindeki sรผrรผcรผ Vulkan %2$s sรผrรผmรผnรผ bildiriyor. Mali (Venus) iรงin Vulkan 1.2 veya รผzeri gerekir (daha eski sรผrรผmlerde gamescope baลŸlamaz), bu yรผzden oturumlar Venus yerine PanVK sรผrรผcรผ รงiftini kullanฤฑr. YapฤฑลŸtฤฑr Sol analog รงubuk SaฤŸ analog รงubuk @@ -2890,7 +3198,7 @@ Klasรถr seรงโ€ฆ SD kart veya USB sรผrรผcรผdeki herhangi bir klasรถrรผ kullanฤฑn Oyunlar, seรงilen konumdaki bir Games klasรถrรผne yรผklenir. Mevcut oyunlar taลŸฤฑnmaz. - Nereye gidiyor + Yer kaplayanlar Steam oyunlarฤฑ Oyun verileri ร–nekler %1$s ยท atรถlye %2$s ยท gรถlgelendiriciler %3$s @@ -2959,6 +3267,7 @@ Oyunlarฤฑn istediฤŸi VC++ ve DirectX yรผkleyicileri Linux x86 oyunlarฤฑnฤฑ รงalฤฑลŸtฤฑrฤฑr Steam aracฤฑ + Steam, anti-cheat ile gelen oyunlar iรงin bunu anti-cheat kapalฤฑyken de indirir. Kaldฤฑrฤฑrsanฤฑz bu oyunlarฤฑn kurulumu 0% noktasฤฑnda takฤฑlฤฑr. DroidDeck oyunlarฤฑ bu รงalฤฑลŸma zamanฤฑ olmadan รงalฤฑลŸtฤฑrฤฑr x86 Proton, DroidDeck bunu รงalฤฑลŸtฤฑramaz Her oyun iรงin varsayฤฑlan @@ -3022,6 +3331,19 @@ Korunan Steam dฤฑลŸฤฑ oyunlar ve Steam\'in ortak รถneki MaฤŸazalardan veya elle eklenen oyunlarฤฑn รถnekleri + Steam\'in ortak รถneki + Steam kendi Windows yardฤฑmcฤฑlarฤฑnฤฑ burada รงalฤฑลŸtฤฑrฤฑr + Siler (%1$s). Steam bir dahaki ihtiyacฤฑnda yenisini oluลŸturur. + Bir maฤŸaza uygulamasฤฑ ve onunla รงalฤฑลŸan oyunlar + Kullanan: %1$s + Steam dฤฑลŸฤฑ oyun %1$s + Bir oyunla eลŸleลŸmedi, bu yรผzden korunuyor + Seรงilenleri kaldฤฑr ยท %1$s + Seรงilenlerin yรผklemesini kaldฤฑr ยท %1$s + Wine รถnekleri + ฤฐรงindeki kayฤฑtlar ve ayarlar kaybolur; Steam Cloud kayฤฑtlarฤฑ hesabฤฑnฤฑzda kalฤฑr. + Gรถlgelendirici รถnbellekleri + ร–nek %1$s ยท gรถlgelendiriciler %2$s ฤฐndirilen paketler Kaydedilen orijinaller ฤฐndirilmiลŸ bileลŸen paketi yok. @@ -3056,6 +3378,8 @@ DroidDeck ยท %1$d fps 60 fps daha akฤฑcฤฑ gรถrรผnรผr ama Steam aรงฤฑlฤฑrken iลŸlemciyi daha รงok kullanฤฑr. Steam\'in kendi ayarlarฤฑnda seรงilen bir video da burada gรถrรผnรผr. Ses + AรงฤฑlฤฑลŸ videosunu atla + Steam\'in aรงฤฑlฤฑลŸ videosu olarak 0,1 saniyelik siyah bir klip kullanฤฑlฤฑr. Sonraki oturumda geรงerli olur. Kendi videon MP4, MOV, MKV veya WebM. DiฤŸer biรงimler ve %1$d MB รผzeri dosyalar cihazda 720p WebM\'e dรถnรผลŸtรผrรผlรผr, en fazla %2$d saniye. ฤฐรงe aktar @@ -3517,6 +3841,7 @@ Alt+Tab, Win tuลŸu ve Ana Ekran dรผฤŸmesini Android yerine etkin DroidDeck oturumunda tutar. Kurulum โ†’ Steam entegrasyonu bรถlรผmรผnde Parlaklฤฑk\'ฤฑ aรงฤฑn Mali kรถprรผsรผ: kapalฤฑ + %1$s Mali kรถprรผsรผnรผ kullanamaz (sistem sรผrรผcรผsรผ yolu olmayan bir Mali GPU gerekir), bu yรผzden bu anahtarฤฑn burada etkisi yok. Mali kรถprรผsรผ: aรงฤฑk %1$s bir Adreno deฤŸil. Deneysel Vulkan kรถprรผsรผ aรงฤฑk: oturum, telefonun kendi sรผrรผcรผsรผ รผzerinden รงizer. Hatalar olabilir; oturum gรผnlรผklerini gรถnderin. Gรผvenli mod @@ -3542,6 +3867,25 @@ Arkaya taลŸฤฑ Widget ayarlarฤฑ Widgetโ€™ฤฑ kaldฤฑr + Gรถrรผnรผm + Simge paketi + Sistem varsayฤฑlanฤฑ + Uygulama rengi arka plan + Simge boyutu + Kรผรงรผk + Orta + Bรผyรผk + Uygulama adlarฤฑnฤฑ gizle + Aralฤฑk + Dar + Normal + GeniลŸ + Simgeyi deฤŸiลŸtir + Simgeyi sฤฑfฤฑrla + Simge ara + Simgeler yรผkleniyorโ€ฆ + Simge bulunamadฤฑ. + ร–zel simgeler Klasรถre ekle Yeni klasรถr Klasรถrden รงฤฑkar @@ -3657,5 +4001,81 @@ Bu dรผzen iรงe aktarฤฑlamadฤฑ Kฤฑzฤฑl Kar + Kฤฑrmฤฑzฤฑ vurgulu beyaz yรผzeyler. + Oyun mรผzikleri + Mรผzik + Oynatma seรงenekleri + Favoriler + Koleksiyonlar + Henรผz koleksiyon yok. OluลŸturmak iรงin yer imi simgesine dokun. + Kaydedilenler + Koleksiyon oluลŸtur + Kayฤฑtlarฤฑnฤฑ dรผzenle + Yeni + OluลŸtur + Koleksiyon adฤฑ + BaลŸka bir koleksiyonun kullanmadฤฑฤŸฤฑ bir ad gir + Yรถnet + Yeniden adlandฤฑr + Parรงa ekle + Ekle (%1$d) + Parรงalarฤฑ kaldฤฑr + Koleksiyonu sil + %1$s silinsin mi? + Parรงalar cihazฤฑnda kalฤฑr. Yalnฤฑzca koleksiyon kaldฤฑrฤฑlฤฑr. + Seรง + Tรผmรผnรผ seรง + Tรผm seรงimleri kaldฤฑr + %1$d seรงildi + Koleksiyona ekle + Favorilere ekle + Koleksiyondan kaldฤฑr + Parรงa ara + Albรผm sฤฑrasฤฑ + ร–nce en uzun + ร–nce en kฤฑsa + Parรงalar + Perde + Sฤฑfฤฑrla + SessizliฤŸi atla + Uyku zamanlayฤฑcฤฑsฤฑ + %1$d dk + Parรงanฤฑn sonu + %1$s kaldฤฑ + Ekolayzฤฑr + Bas gรผรงlendirme + Ekolayzฤฑr bu cihazda kullanฤฑlamฤฑyor + Oyun iรงinde etkinleลŸtir + Oyun รงalฤฑลŸฤฑrken oyun mรผziฤŸi รงalmaya devam etsin + Henรผz oyun mรผziฤŸi yรผklenmedi. + Oyun mรผziklerinde ara + Oyun mรผziฤŸi klasรถrรผ ekle + Bu klasรถrde ses dosyasฤฑ yok + Toplam sรผre + %1$d parรงa / %2$s + Disk %1$s + KarฤฑลŸtฤฑr + ร–nceki + Oynat + Duraklat + Sonraki + Tekrar kapalฤฑ + Tรผmรผnรผ tekrarla + Birini tekrarla + Ses dรผzeyi + Bu oyun mรผziฤŸinde ses dosyasฤฑ yok + BaลŸlatma kullanฤฑlamฤฑyor + Bu baฤŸlantฤฑyฤฑ aรงmak iรงin kullanฤฑlabilir bir web tarayฤฑcฤฑsฤฑ yok. + Tut + Bฤฑrak + Kaydet + Sฤฑfฤฑrlamak iรงin basฤฑlฤฑ tut + MaฤŸazalar + Kare sรผresi + Ortalama kare hฤฑzฤฑ + Gรถrรผntรผ sunucusu + HDR durumu + Gรถsterilen + %1$d / %2$d diff --git a/app/src/main/res/values-uk/input_library.xml b/app/src/main/res/values-uk/input_library.xml new file mode 100644 index 0000000000..c00c0b1a39 --- /dev/null +++ b/app/src/main/res/values-uk/input_library.xml @@ -0,0 +1,132 @@ + + + ะะตั‡ะธั‚ะฝั– ะฝะฐะปะฐัˆั‚ัƒะฒะฐะฝะฝั ะฒะฒะตะดะตะฝะฝั ะทะฑะตั€ะตะถะตะฝะพ ะฒ ั€ะตะทะตั€ะฒะฝั–ะน ะบะพะฟั–ั—. ะ’ะธ ะผะพะถะตั‚ะต ะดะฐะปั– ั€ะตะดะฐะณัƒะฒะฐั‚ะธ ะฒั–ะดะฝะพะฒะปะตะฝั– ะฟั€ะพั„ั–ะปั–. + ะ’ะปะฐัั‚ะธะฒะพัั‚ั– + ะ’ะปะฐัั‚ะธะฒะพัั‚ั– ะฝะฐั‚ะธัะบะฐะฝะฝั + %1$s ยท ะะฐั‚ะธัะบะฐะฝะฝั + ะšะฝะพะฟะบะธ + ะกั‚ั–ะบะธ, ั‚ะฐั‡ะฟะฐะดะธ ะน ั‚ั€ะธะณะตั€ะธ + ะกั…ะพะฒะฐั‚ะธ ั–ะฝัั‚ั€ัƒะผะตะฝั‚ะธ + ะšะพะฝั‚ั€ะพะปะตั€ + ะะฐะดัะธะปะฐั‚ะธ ะฒะฒะตะดะตะฝะฝั ะบะพะฝั‚ั€ะพะปะตั€ะฐ ะฒ Steam Input ะฐะฑะพ ะณั€ัƒ. + ะฆะตะน ะตะปะตะผะตะฝั‚ ะฝะต ะฝะฐะดัะธะปะฐั” ะฒะฒะตะดะตะฝะฝั ะบะพะฝั‚ั€ะพะปะตั€ะฐ, ะผะธัˆั– ั‡ะธ ะบะปะฐะฒั–ะฐั‚ัƒั€ะธ. + ะะฐั‚ะธัะบะฐะฝะฝั ะผะธัˆั– + ะ”ั–ั DroidDeck + ะ”ั–ั + ะจะฒะธะดะบั–ัั‚ัŒ ะฟั€ะพะบั€ัƒั‚ะบะธ: %1$d ะบั€ะพะบั–ะฒ/ั + + ะะพะฒะธะน ะฟั€ะพั„ั–ะปัŒ + + ะะพะฒะต ะบะพะผะฟะพะฝัƒะฒะฐะฝะฝั + %1$s ยท ะ’ะธะบะพั€ะธัั‚ะพะฒัƒั”ั‚ัŒัั ะฟั€ะพั„ั–ะปัะผะธ: %2$d. ะ—ะผั–ะฝะธ ะทะฐัั‚ะพัะพะฒัƒัŽั‚ัŒัั ะดะพ ะบะพะถะฝะพะณะพ ะฟั€ะพั„ั–ะปัŽ ะท ั†ะธะผะธ ะฟั€ะธะฒ\'ัะทะบะฐะผะธ. + ะŸะตั€ะตะนะผะตะฝัƒะฒะฐั‚ะธ + ะ’ะธะดะฐะปะธั‚ะธ + ะ”ะพะดะฐะนั‚ะต ะตะปะตะผะตะฝั‚ะธ ะดะพ ะบะพะผะฟะพะฝัƒะฒะฐะฝะฝั, ะฟะตั€ัˆ ะฝั–ะถ ะฟั€ะธะทะฝะฐั‡ะฐั‚ะธ ั—ะผ ะดั–ั—. + ะะต ะฒะดะฐะปะพัั ะทะฑะตั€ะตะณั‚ะธ ะฝะฐะปะฐัˆั‚ัƒะฒะฐะฝะฝั ะฒะฒะตะดะตะฝะฝั + ะะฐะทะฒะฐ + ะŸะพั‡ะฐั‚ะธ ะท + ะšะฝะพะฟะบะฐ + ะกั‚ั–ะบ + ะขะฐั‡ะฟะฐะด + ะฅั€ะตัั‚ะพะฒะธะฝะฐ + ะขั€ะธะณะตั€ + ะ“ะพั‚ะพะฒะพ + ะกะบะฐััƒะฒะฐั‚ะธ + + ะ”ะพะดะฐั‚ะธ + ะŸะตั€ะตั‚ัะณะฝั–ั‚ัŒ, ั‰ะพะฑ ะฟะตั€ะตะผั–ัั‚ะธั‚ะธ. ะŸะพั‚ัะณะฝั–ั‚ัŒ ะทะฐ ะบัƒั‚, ั‰ะพะฑ ะทะผั–ะฝะธั‚ะธ ั€ะพะทะผั–ั€. ะขะพั€ะบะฝั–ั‚ัŒัั ยซะ’ะปะฐัั‚ะธะฒะพัั‚ั–ยป, ั‰ะพะฑ ะฟั€ะธะทะฝะฐั‡ะธั‚ะธ ะดั–ัŽ. + ะ ะตะดะฐะณัƒะฒะฐะฝะฝั ะฝะฐ ะดั€ัƒะณะพะผัƒ ะตะบั€ะฐะฝั– + ะ’ะธะฑั€ะฐะฝะธะน ะตะบั€ะฐะฝ ะฝะตะดะพัั‚ัƒะฟะฝะธะน. ะŸั–ะดะบะปัŽั‡ั–ั‚ัŒ ะนะพะณะพ, ั‰ะพะฑ ั€ะตะดะฐะณัƒะฒะฐั‚ะธ ั†ะต ะบะพะผะฟะพะฝัƒะฒะฐะฝะฝั ะฒ ั€ะตะฐะปัŒะฝะพะผัƒ ั€ะพะทะผั–ั€ั–. + ะ’ั–ะดั…ะธะปะธั‚ะธ ะฝะตะทะฑะตั€ะตะถะตะฝั– ะทะผั–ะฝะธ ะบะพะผะฟะพะฝัƒะฒะฐะฝะฝั? + ะฆะต ะบะพะผะฟะพะฝัƒะฒะฐะฝะฝั ะฒะธะบะพั€ะธัั‚ะพะฒัƒั”ั‚ัŒัั ะฟั€ะพั„ั–ะปัะผะธ: %1$d. ะ—ะฑะตั€ะตะถะตะฝั– ะทะผั–ะฝะธ ะทะฐัั‚ะพััƒัŽั‚ัŒัั ะดะพ ะฒัั–ั…. + ะŸั€ะพั„ั–ะปั– ะทะฐ ะทะฐะผะพะฒั‡ัƒะฒะฐะฝะฝัะผ + ะ ะตะถะธะผ ั€ะพะฑะพั‡ะพะณะพ ัั‚ะพะปัƒ + ะ†ะณั€ะพะฒะธะน ั€ะตะถะธะผ + ะ—ะฐ ะทะฐะผะพะฒั‡ัƒะฒะฐะฝะฝัะผ ะดะปั ั€ะพะฑะพั‡ะพะณะพ ัั‚ะพะปัƒ ะน ะณั€ะธ + ะ—ะฐ ะทะฐะผะพะฒั‡ัƒะฒะฐะฝะฝัะผ ะดะปั ั–ะณั€ะพะฒะพะณะพ ั€ะตะถะธะผัƒ + ะ—ะฐ ะทะฐะผะพะฒั‡ัƒะฒะฐะฝะฝัะผ ะดะปั ั€ะตะถะธะผัƒ ั€ะพะฑะพั‡ะพะณะพ ัั‚ะพะปัƒ + ะะฐะปะฐัˆั‚ัƒะฒะฐะฝะฝั ะฟั€ะธัั‚ั€ะพัŽ + ะšะตั€ัƒะฒะฐะฝะฝั + ะšะฝะพะฟะบะธ, ัั‚ั–ะบะธ, ั‚ั€ะธะณะตั€ะธ ั‚ะฐ ะดะพะดะฐั‚ะบะพะฒั– ะบะปะฐะฒั–ัˆั– + ะšะพะฟั–ัŽะฒะฐั‚ะธ ะฟั€ะพั„ั–ะปัŒ + ะกะบะธะฝัƒั‚ะธ ะดั–ั— + ะกะบะธะฝัƒั‚ะธ ะดั–ั— ะฒ %1$s ะดะพ ะทะฝะฐั‡ะตะฝัŒ ะฑะฐะทะพะฒะพะณะพ ะฟั€ะพั„ั–ะปัŽ? ะšะพะผะฟะพะฝัƒะฒะฐะฝะฝั ั‚ะฐ ั–ะฝัˆั– ะฟั€ะพั„ั–ะปั– ะทะฐะปะธัˆะฐั‚ัŒัั ะฑะตะท ะทะผั–ะฝ. + ะ’ะธะดะฐะปะธั‚ะธ %1$s? ะ ะตะถะธะผะธ, ั‰ะพ ะนะพะณะพ ะฒะธะบะพั€ะธัั‚ะพะฒัƒัŽั‚ัŒ, ะฟะพะฒะตั€ะฝัƒั‚ัŒัั ะดะพ ะฒะฑัƒะดะพะฒะฐะฝะพะณะพ ะฟั€ะพั„ั–ะปัŽ ะทะฐ ะทะฐะผะพะฒั‡ัƒะฒะฐะฝะฝัะผ. ะ—ะฑะตั€ะตะถะตะฝั– ะบะพะผะฟะพะฝัƒะฒะฐะฝะฝั ะน ัะฟั–ะปัŒะฝั– ะฝะฐะปะฐัˆั‚ัƒะฒะฐะฝะฝั ะทะฐะปะธัˆะฐั‚ัŒัั ะดะพัั‚ัƒะฟะฝะธะผะธ. + ะ’ะธะดะธะผั–ัั‚ัŒ + ะ—ะฐัั‚ะพัะพะฒัƒั”ั‚ัŒัั ะดะพ ะฒัั–ั… ะฟั€ะพั„ั–ะปั–ะฒ. Auto ะฟะพะบะฐะทัƒั” ะบะตั€ัƒะฒะฐะฝะฝั ะพัะฝะพะฒะฝะพะณะพ ะตะบั€ะฐะฝะฐ, ะบะพะปะธ ะฒ ั–ะณั€ะพะฒะพะผัƒ ั€ะตะถะธะผั– ะฝะต ะฟั–ะดะบะปัŽั‡ะตะฝะพ ะบะพะฝั‚ั€ะพะปะตั€. + ะ ะตะดะฐะณัƒะฒะฐั‚ะธ ะฝะฐ ะตะบั€ะฐะฝั– + ะ—ะฑะตั€ะตะถะตะฝั– ะบะพะผะฟะพะฝัƒะฒะฐะฝะฝัโ€ฆ + ะ’ะธะฑะตั€ั–ั‚ัŒ ะบะพะผะฟะพะฝัƒะฒะฐะฝะฝั ะฐะฑะพ ัั‚ะฒะพั€ั–ั‚ัŒ ัะฒะพั” + ะ’ะธะฑะตั€ั–ั‚ัŒ ยซะšะตั€ัƒะฒะฐะฝะฝั ะฟั€ะพั„ั–ะปัŽยป ะฒ ะผะตะฝัŽ ัะตะฐะฝััƒ ะดั€ัƒะณะพะณะพ ะตะบั€ะฐะฝะฐ. ะกะตะปะตะบั‚ะพั€ะธ ยซะŸั€ะพั„ั–ะปัŒยป ั– ยซะ”ั€ัƒะณะธะน ะตะบั€ะฐะฝยป ัƒ ะผะตะฝัŽ ะบะพะฝั‚ั€ะพะปะตั€ะฐ ะฒะธะทะฝะฐั‡ะฐัŽั‚ัŒ, ัะบะต ะบะตั€ัƒะฒะฐะฝะฝั ะฟะพะบะฐะทัƒะฒะฐั‚ะธ. + ะ”ั–ั— ะบะฝะพะฟะพะบ + ะกะฟั–ะปัŒะฝะธะน ะดะพัั‚ัƒะฟ ั–ะท %1$s. ะ—ะผั–ะฝะธ ะทะฐัั‚ะพััƒัŽั‚ัŒัั ะน ะดะพ ั†ะธั… ะฟั€ะพั„ั–ะปั–ะฒ. + ะŸะพะฒั‚ะพั€ะฝะพ ะฒะธะบะพั€ะธัั‚ะฐั‚ะธ ะฝะฐะปะฐัˆั‚ัƒะฒะฐะฝะฝั + ะ’ะธะบะพั€ะธัั‚ะฐั‚ะธ ะฝะฐะปะฐัˆั‚ัƒะฒะฐะฝะฝั ะทโ€ฆ + ะกะบะพะฟั–ัŽะฒะฐั‚ะธ ะท ั–ะฝัˆะพะณะพ ะฟั€ะพั„ั–ะปัŽ ะฐะฑะพ ะทะฐะปะธัˆะธั‚ะธ ะฝะฐะปะฐัˆั‚ัƒะฒะฐะฝะฝั ัะฟั–ะปัŒะฝะธะผะธ + ะ—ั€ะพะฑะธั‚ะธ ะฝะตะทะฐะปะตะถะฝะธะผ + ะ—ะฐะปะธัˆะธั‚ะธ ะฟะพั‚ะพั‡ะฝะต ะฝะฐะปะฐัˆั‚ัƒะฒะฐะฝะฝั ะน ะฟั€ะธะฟะธะฝะธั‚ะธ ะดั–ะปะธั‚ะธัั ะทะผั–ะฝะฐะผะธ + ะšะพะผะฟะพะฝัƒะฒะฐะฝะฝั ะทะฑะตั€ั–ะณะฐัŽั‚ัŒ ะตะปะตะผะตะฝั‚ะธ ั‚ะฐ ั—ั…ะฝั– ะฟะพะทะธั†ั–ั—. ะšะพะถะตะฝ ะฟั€ะพั„ั–ะปัŒ ะผะพะถะต ะฟั€ะธะทะฝะฐั‡ะฐั‚ะธ ะฒะปะฐัะฝั– ะดั–ั—. ะ ะตะดะฐะณัƒะนั‚ะต ะฒ ะฟะพะฒะฝะพะผัƒ ั€ะพะทะผั–ั€ั– ะฝะฐ ั†ั–ะปัŒะพะฒะพะผัƒ ะตะบั€ะฐะฝั–. + ะŸะพั‚ะพั‡ะฝะต ะบะพะผะฟะพะฝัƒะฒะฐะฝะฝั + ะ’ะธะดะฐะปะธั‚ะธ ะฝะตะฒะธะบะพั€ะธัั‚ะฐะฝะต ะบะพะผะฟะพะฝัƒะฒะฐะฝะฝั %1$s ั‚ะฐ ะนะพะณะพ ะทะฑะตั€ะตะถะตะฝั– ะดั–ั—? + ะŸะตั€ะตะนะผะตะฝัƒะฒะฐั‚ะธ ะฟะพั‚ะพั‡ะฝะต ะบะพะผะฟะพะฝัƒะฒะฐะฝะฝั + ะŸะพะฒั‚ะพั€ะฝะพ ะฒะธะบะพั€ะธัั‚ะฐั‚ะธ %1$s ะท ั–ะฝัˆะพะณะพ ะฟั€ะพั„ั–ะปัŽ. ะ†ะฝัˆั– ะดะถะตั€ะตะปะฐ ะบะตั€ัƒะฒะฐะฝะฝั ะทะฐะปะธัˆะฐั‚ัŒัั ะฑะตะท ะทะผั–ะฝ. + ะ—ะฐะปะธัˆะธั‚ะธ ั„ั–ะทะธั‡ะฝะต ะบะตั€ัƒะฒะฐะฝะฝั ัะฟั–ะปัŒะฝะธะผ + ะ—ะฐ ะทะฐะผะพะฒั‡ัƒะฒะฐะฝะฝัะผ ัƒัั– ะตะปะตะผะตะฝั‚ะธ ะบะตั€ัƒะฒะฐะฝะฝั ะน ะบะพั€ะธัั‚ัƒะฒะฐั†ัŒะบั– ะบะพะผะฟะพะฝัƒะฒะฐะฝะฝั โ€” ะฝะตะทะฐะปะตะถะฝั– ะบะพะฟั–ั—. ะกะฟั–ะปัŒะฝะธะน ะดะพัั‚ัƒะฟ ะฟะพะฒ\'ัะทัƒั” ะปะธัˆะต ั„ั–ะทะธั‡ะฝะต ะบะตั€ัƒะฒะฐะฝะฝั. + ะ’ะธะบะพั€ะธัั‚ะฐั‚ะธ ั†ั– ะตะปะตะผะตะฝั‚ะธ ะน ะฟะพะทะธั†ั–ั—. ะกะฟั–ะปัŒะฝะธะน ะดะพัั‚ัƒะฟ ัะธะฝั…ั€ะพะฝั–ะทัƒั” ะผะฐะนะฑัƒั‚ะฝั– ะทะผั–ะฝะธ ะณะตะพะผะตั‚ั€ั–ั—; ะดั–ั— ะบะฝะพะฟะพะบ ะทะฐะปะธัˆะฐั‚ัŒัั ะฝะตะทะฐะปะตะถะฝะธะผะธ. ะ†ะฝัˆะต ะบะพะผะฟะพะฝัƒะฒะฐะฝะฝั ะฟะพั‡ะธะฝะฐั”ั‚ัŒัั ะท ะฝะตะฟั€ะธะทะฝะฐั‡ะตะฝะธะผะธ ะดั–ัะผะธ. + ะกะบะพะฟั–ัŽะฒะฐั‚ะธ ั†ั– ะตะปะตะผะตะฝั‚ะธ ะบะตั€ัƒะฒะฐะฝะฝั ะน ะดั–ั— ะฐะฑะพ ะทะฒ\'ัะทะฐั‚ะธ ั—ั…, ั‰ะพะฑ ะผะฐะนะฑัƒั‚ะฝั– ะทะผั–ะฝะธ ะทะฐัั‚ะพัะพะฒัƒะฒะฐะปะธัั ะดะพ ะพะฑะพั… ะฟั€ะพั„ั–ะปั–ะฒ. + ะ—ะฐะปะธัˆะธั‚ะธ ัะฟั–ะปัŒะฝะธะผ + ะะตะทะฐะปะตะถะฝะฐ ะบะพะฟั–ั + ะŸะพั‡ะธะฝะฐั‚ะธ ัั‚ั–ะบ ะฒั–ะด ั‚ะพั‡ะบะธ ะดะพั‚ะธะบัƒ + ะฅะพะฒะฐั‚ะธ ัั‚ั–ะบ, ะบะพะปะธ ะฒั–ะฝ ะฝะต ะฒะธะบะพั€ะธัั‚ะพะฒัƒั”ั‚ัŒัั + ะ†ะฝัั‚ั€ัƒะผะตะฝั‚ะธ + ะะฒั‚ะพ (%1$s) + ะšะพั€ะธัั‚ัƒะฒะฐั†ัŒะบะธะน (%1$s) + ะ—ะฑะตั€ะตะณั‚ะธ ัะบ ะฝะพะฒะธะน ะฟั€ะพั„ั–ะปัŒ + ะšะตั€ัƒะฒะฐะฝะฝั ะฟั€ะพั„ั–ะปัŽ + ะŸั€ะพั„ั–ะปัŒ + ะ–ะตัั‚ะธ ั‚ะฐั‡ะฟะฐะดะฐ ะผะธัˆั– + ะฏะบั‰ะพ ะฟั€ะธะทะฝะฐั‡ะตะฝะพ ะฒะบะฐะทั–ะฒะฝะธะบัƒ ะผะธัˆั–: ั‚ะพั€ะบะฝั–ั‚ัŒัั ะดะปั ะบะปั–ะบัƒ, ัƒั‚ั€ะธะผัƒะนั‚ะต ะดะปั ะฟะตั€ะตั‚ัะณัƒะฒะฐะฝะฝั ั‚ะฐ ะฟั€ะพะบั€ัƒั‡ัƒะนั‚ะต ะดะฒะพะผะฐ ะฟะฐะปัŒั†ัะผะธ. + ะ”ะปั %1$s ะทะฐะดะฐะฝะพ ะฟะตั€ะตะฒะธะทะฝะฐั‡ะตะฝะฝั ัˆะฒะธะดะบะพะณะพ ะผะตะฝัŽ. ะ’ะธะฑะตั€ั–ั‚ัŒ ยซะะฒั‚ะพยป, ั‰ะพะฑ ะฒะธะบะพั€ะธัั‚ะฐั‚ะธ ะฟั€ะพั„ั–ะปัŒ ะทะฐ ะทะฐะผะพะฒั‡ัƒะฒะฐะฝะฝัะผ ั– ะฒัั– ั‚ั€ะธ ะทะฑะตั€ะตะถะตะฝั– ั‡ะฐัั‚ะธะฝะธ. + ะ’ะฒะตะดะตะฝะฝั DroidDeck + ะฃั‚ั€ะธะผัƒั”ั‚ัŒัั, ะฟะพะบะธ ัั‚ั–ะบ ะฒั–ะดั…ะธะปะตะฝะพ ะฒ ะฑัƒะดัŒ-ัะบะพะผัƒ ะฝะฐะฟั€ัะผะบัƒ: ะฝะฐั‚ะธัะบะฐะฝะฝั ะฒะธั‰ะต 55%, ะฒั–ะดะฟัƒัะบะฐะฝะฝั ะฝะธะถั‡ะต 35%. ะ’ะธะบะพั€ะธัั‚ะพะฒัƒะนั‚ะต ยซะšะปะฐะฒั–ัˆั– ะฝะฐะฟั€ัะผะบั–ะฒยป, ั‰ะพะฑ ะฟั€ะธะทะฝะฐั‡ะธั‚ะธ ะบะพะถะตะฝ ะฝะฐะฟั€ัะผะพะบ ะพะบั€ะตะผะพ. ะšะพะผะฐะฝะดะธ DroidDeck ัะฟั€ะฐั†ัŒะพะฒัƒัŽั‚ัŒ ั€ะฐะท ะฝะฐ ะฒั–ะดั…ะธะปะตะฝะฝั. ะะฐั‚ะธัะบะฐะฝะฝั ัั‚ั–ะบะฐ ะฝะฐะปะฐัˆั‚ะพะฒัƒั”ั‚ัŒัั ะพะบั€ะตะผะพ. + ะฃั‚ั€ะธะผัƒั”ั‚ัŒัั, ะฟะพะบะธ ะฒะธ ั‚ะพั€ะบะฐั”ั‚ะตััŒ ั‚ะฐั‡ะฟะฐะดะฐ; ะฒั–ะดะฟัƒัะบะฐั”ั‚ัŒัั, ะบะพะปะธ ะฟั–ะดะฝั–ะผะฐั”ั‚ะต ะฟะฐะปะตั†ัŒ. ะšะพะผะฐะฝะดะธ DroidDeck ัะฟั€ะฐั†ัŒะพะฒัƒัŽั‚ัŒ ั€ะฐะท ะฝะฐ ะดะพั‚ะธะบ. ะะฐั‚ะธัะบะฐะฝะฝั ั‚ะฐั‡ะฟะฐะดะฐ ะฝะฐะปะฐัˆั‚ะพะฒัƒั”ั‚ัŒัั ะพะบั€ะตะผะพ. + ะฃั‚ั€ะธะผัƒั”ั‚ัŒัั, ะบะพะปะธ ั‚ั€ะธะณะตั€ ะฟะตั€ะตั…ะพะดะธั‚ัŒ 55%; ะฒั–ะดะฟัƒัะบะฐั”ั‚ัŒัั ะฝะธะถั‡ะต 35%. ะšะพะผะฐะฝะดะธ DroidDeck ัะฟั€ะฐั†ัŒะพะฒัƒัŽั‚ัŒ ั€ะฐะท ะฝะฐ ะฝะฐั‚ะธัะบะฐะฝะฝั. + ะะฐะฟั€ัะผะพะบ ะฟั€ะพะบั€ัƒั‚ะบะธ + ะ’ะตั€ั‚ะธะบะฐะปัŒะฝะพ + ะ“ะพั€ะธะทะพะฝั‚ะฐะปัŒะฝะพ + ะŸั€ะพะบั€ัƒั‡ัƒะฒะฐั‚ะธ ะณะพั€ะธะทะพะฝั‚ะฐะปัŒะฝะพ + ะ’ะธะผั–ั€ัŽะฒะฐะฝะฝั + ะฃะฒั–ะผะบะฝั–ั‚ัŒ ะทะฐะฟะธั, ะฒะธะบะพั€ะธัั‚ะฐะนั‚ะต ะบะตั€ัƒะฒะฐะฝะฝั ะฒ ะทะฐะฟัƒั‰ะตะฝะพะผัƒ ัะตะฐะฝัั–, ะฟะพั‚ั–ะผ ะฟะพะฒะตั€ะฝั–ั‚ัŒัั ะน ะฟั€ะพั‡ะธั‚ะฐะนั‚ะต ั€ะตะทัƒะปัŒั‚ะฐั‚ะธ. ะ’ะธะผั–ั€ัŽั”ั‚ัŒัั ะปะธัˆะต ั‡ะฐั ะฝะฐะดัะธะปะฐะฝะฝั DroidDeck, ะฑะตะท ะทะฐั‚ั€ะธะผะบะธ ะตะบั€ะฐะฝะฐ. ะ—ะฐะฟะธั ะทะฐะฒะตั€ัˆัƒั”ั‚ัŒัั, ะบะพะปะธ ะฟั€ะพั†ะตั ะทะฐัั‚ะพััƒะฝะบัƒ ะทะฐะบั€ะธะฒะฐั”ั‚ัŒัั. + ะ•ะปะตะผะตะฝั‚ั–ะฒ ะบะตั€ัƒะฒะฐะฝะฝั: %1$d + ะ†ะฝัˆั– ะทะฑะตั€ะตะถะตะฝั– ะบะพะผะฟะพะฝัƒะฒะฐะฝะฝั (%1$d) โ–พ + ะกั…ะพะฒะฐั‚ะธ ั–ะฝัˆั– ะทะฑะตั€ะตะถะตะฝั– ะบะพะผะฟะพะฝัƒะฒะฐะฝะฝั (%1$d) โ–ด + ะ”ะพะผั–ะฒะบะฐ / Guide + ะะฐะทะฐะด ยท ะพะดะฝะต ะฝะฐั‚ะธัะบะฐะฝะฝั + ะะฐะทะฐะด ยท ะฟะพะดะฒั–ะนะฝะต ะฝะฐั‚ะธัะบะฐะฝะฝั + ะะฐะทะฐะด ยท ะดะฒั–ั‡ั– ะฒ Steam, ะพะดะธะฝ ั€ะฐะท ัƒ ั€ะพะฑะพั‡ะพะผัƒ ัั‚ะพะปั– + ะฃ ั€ะตะถะธะผั– Steam. ะฃั‚ั€ะธะผะฐะฝะฝั ยซะะฐะทะฐะดยป ั‚ะฐะบะพะถ ะฒั–ะดะบั€ะธะฒะฐั” ัˆะฒะธะดะบะธะน ะดะพัั‚ัƒะฟ. + ะ’ั–ะดะฝะพะฒะธั‚ะธ ั‚ะธะฟะพะฒะต + ะ’ะฐัˆ ะฒะธะฑั–ั€ ะฟะฐะฝะตะปั– ะทะฐะฟะฐะผ\'ัั‚ะพะฒัƒั”ั‚ัŒัั. ะ ะพะฑะพั‡ะธะน ัั‚ั–ะป ะฒั–ะดะบั€ะธะฒะฐั” ะดั€ัƒะณะธะน ั€ะพะฑะพั‡ะธะน ะฟั€ะพัั‚ั–ั€; ะฒั–ะฝ ะฝะต ะฟะตั€ะตะผะธะบะฐั” ัะตะฐะฝั ะฐะฑะพ ะนะพะณะพ ะฟั€ะพั„ั–ะปัŒ ะฒะฒะตะดะตะฝะฝั. + ะ’ั–ั€ั‚ัƒะฐะปัŒะฝะธะน ะบะพะฝั‚ั€ะพะปะตั€ + ะขะธะฟ ะบะพะฝั‚ั€ะพะปะตั€ะฐ, ัะบะธะน ะฑะฐั‡ะฐั‚ัŒ Steam ะฐะฑะพ ะณั€ะฐ. + ะกะตะฝัะพั€ะฝะธะน ะตะบั€ะฐะฝ + ะฏะบ ะพะฑั€ะพะฑะปััŽั‚ัŒัั ะดะพั‚ะธะบะธ ะฝะฐ ะตะบั€ะฐะฝั– ะณั€ะธ. ะšะฝะพะฟะบะธ ะฟั€ะพั„ั–ะปัŽ ะทะฑะตั€ั–ะณะฐัŽั‚ัŒ ะฟั€ะธะทะฝะฐั‡ะตะฝั– ะดั–ั—. + ะšัƒั€ัะพั€ ะดะพั‚ะธะบัƒ + ะŸะพะบะฐะทัƒะฒะฐั‚ะธ ะฒะบะฐะทั–ะฒะฝะธะบ ะดะปั ะฟั€ัะผะธั… ะดะพั‚ะธะบั–ะฒ ะฝะฐ ะตะบั€ะฐะฝั– ะณั€ะธ. + ะขะพั€ะบะฝัƒั‚ะธัั ะน ัƒั‚ั€ะธะผัƒะฒะฐั‚ะธ + ะ”ั–ั ะผะธัˆั– ะฟั€ะธ ัƒั‚ั€ะธะผะฐะฝะฝั– ะฟะฐะปัŒั†ั ะฝะฐ ะตะบั€ะฐะฝั– ะณั€ะธ. + ะะฐั‚ะธัะบะฐะฝะฝั ะบะฝะพะฟะบะธ ยซะะฐะทะฐะดยป + ะŸะตั€ัˆะฐ ะดั–ั: ะพะดะฝะต ะฝะฐั‚ะธัะบะฐะฝะฝั. ะ”ั€ัƒะณะฐ ะดั–ั: ะฟะพะดะฒั–ะนะฝะต ะฝะฐั‚ะธัะบะฐะฝะฝั. + ะšะฝะพะฟะบะฐ-ะฟะตั€ะตะผะธะบะฐั‡ + ะขะพั€ะบะฝั–ั‚ัŒัั, ั‰ะพะฑ ัƒั‚ั€ะธะผัƒะฒะฐั‚ะธ, ั‚ะพั€ะบะฝั–ั‚ัŒัั ั‰ะต ั€ะฐะท, ั‰ะพะฑ ะฒั–ะดะฟัƒัั‚ะธั‚ะธ. ะ’ั–ะดะบั€ะธั‚ั‚ั ะผะตะฝัŽ ะฐะฑะพ ะทะผั–ะฝะฐ ะฟั€ะพั„ั–ะปัŽ ะฒั–ะดะฟัƒัะบะฐั” ะบะฝะพะฟะบัƒ. + ะคะพั€ะผะฐ + ะ—ะฐะพะบั€ัƒะณะปะตะฝะฐ + ะšะฐะฟััƒะปะฐ + ะšะพะปะพ + ะŸั€ัะผะพะบัƒั‚ะฝะธะบ + ะŸั–ะดะฟะธั ะบะฝะพะฟะบะธ + ะขะตะบัั‚ + ะ†ะผะฟะพั€ั‚ะพะฒะฐะฝะต ะทะพะฑั€ะฐะถะตะฝะฝั + ะžะบั€ะตะผั– ะบะปะฐะฒั–ัˆั– ะดั–ะฐะณะพะฝะฐะปะตะน + ะŸั€ะธะทะฝะฐั‡ั‚ะต ะบะปะฐะฒั–ัˆัƒ ะบะพะถะฝั–ะน ะดั–ะฐะณะพะฝะฐะปั–. ะŸะพั€ะพะถะฝั ะดั–ะฐะณะพะฝะฐะปัŒ ะฝะฐั‚ะธัะบะฐั” ะดะฒะฐ ััƒัั–ะดะฝั– ะฝะฐะฟั€ัะผะบะธ. + ะกัƒัั–ะดะฝั– ะฝะฐะฟั€ัะผะบะธ + ะ’ะฐัˆั– ัั‚ะฐั€ั– ะตะบั€ะฐะฝะฝั– ะบะปะฐะฒั–ัˆั– ะทะฑะตั€ะตะถะตะฝะพ ะฝะธะถั‡ะต ัะบ ั–ะผะฟะพั€ั‚ะพะฒะฐะฝั– ะฟั€ะพั„ั–ะปั–. ะ’ะธะฑะตั€ั–ั‚ัŒ ะพะดะธะฝ, ั‰ะพะฑ ะฒะธะบะพั€ะธัั‚ะฐั‚ะธ ะฐะฑะพ ะทะผั–ะฝะธั‚ะธ. ะŸะพั‚ะพั‡ะฝั– ะฒะธะฑั€ะฐะฝั– ะฟั€ะพั„ั–ะปั– ะทะฑะตั€ะตะถะตะฝะพ. + ะกั‚ะฐั€ั– ะตะบั€ะฐะฝะฝั– ะบะปะฐะฒั–ัˆั– ะฝะต ะฒะดะฐะปะพัั ั–ะผะฟะพั€ั‚ัƒะฒะฐั‚ะธ ะฐะฒั‚ะพะผะฐั‚ะธั‡ะฝะพ. ะŸะพั‡ะฐั‚ะบะพะฒั– ะฝะฐะปะฐัˆั‚ัƒะฒะฐะฝะฝั ะทะฑะตั€ะตะถะตะฝะพ. + diff --git a/app/src/main/res/values-uk/input_strings.xml b/app/src/main/res/values-uk/input_strings.xml new file mode 100644 index 0000000000..665ae8d468 --- /dev/null +++ b/app/src/main/res/values-uk/input_strings.xml @@ -0,0 +1,38 @@ + + + ะŸั€ะพั„ั–ะปั– ะฒะฒะตะดะตะฝะฝั + ะŸั€ะพั„ั–ะปั– + ะคั–ะทะธั‡ะฝะธะน ะบะพะฝั‚ั€ะพะปะตั€ + ะ“ะพะปะพะฒะฝะธะน ะตะบั€ะฐะฝ + ะ”ะพะดะฐั‚ะบะพะฒะธะน ะตะบั€ะฐะฝ + ะ’ะปะฐัะฝะธะน / Steam Input + ะ’ะปะฐัะฝะธะน: %1$s + ะะฐะดั–ัะปะฐั‚ะธ ั–ะฝัˆัƒ ะบะพะผะฐะฝะดัƒ ะบะพะฝั‚ั€ะพะปะตั€ะฐ + ะ’ะธะผะบะฝะตะฝะพ + ะšะปะฐะฒั–ัˆะฐ ะฐะฑะพ ะบะพะผะฑั–ะฝะฐั†ั–ั ะบะปะฐะฒั–ัˆ + ะšะปะฐะฒั–ัˆั– ะฝะฐะฟั€ัะผะบั–ะฒ + ะ ัƒั…ะฐั‚ะธ ะฒะบะฐะทั–ะฒะฝะธะบ + ะจะฒะธะดะบั–ัั‚ัŒ ะฒะบะฐะทั–ะฒะฝะธะบะฐ: %1$d + ะŸั€ะพะบั€ัƒั‚ะบะฐ + ะŸั€ะพะบั€ัƒั‚ะบะฐ ะฒะตั€ั‚ะธะบะฐะปัŒะฝะพ + ะ›ั–ะฒะฐ ะบะฝะพะฟะบะฐ ะผะธัˆั– + ะŸั€ะฐะฒะฐ ะบะฝะพะฟะบะฐ ะผะธัˆั– + ะกะตั€ะตะดะฝั ะบะฝะพะฟะบะฐ ะผะธัˆั– + ะ’ั–ะดะบั€ะธั‚ะธ ะผะตะฝัŽ DroidDeck + ะŸะพะบะฐะทะฐั‚ะธ ะบะปะฐะฒั–ะฐั‚ัƒั€ัƒ + ะ’ั–ะดะบั€ะธั‚ะธ ะผะตะฝัŽ Steam + ะ’ั–ะดะบั€ะธั‚ะธ ัˆะฒะธะดะบะธะน ะดะพัั‚ัƒะฟ Steam + ะ’ะธะดะฐะปะธั‚ะธ ะตะปะตะผะตะฝั‚ + ะ”ะพะดะฐั‚ะธ ะตะปะตะผะตะฝั‚ + ะšะฝะพะฟะบะธ ะบะพะฝะบั€ะตั‚ะฝะพะณะพ ะฟั€ะธัั‚ั€ะพัŽ + ะŸั€ะธะทะฝะฐั‡ะธั‚ะธ ั„ั–ะทะธั‡ะฝัƒ ะบะฝะพะฟะบัƒ + ะ’ั–ะดะฟัƒัั‚ั–ั‚ัŒ ะบะฝะพะฟะบัƒ, ะฟะพั‚ั–ะผ ะฒะธะฑะตั€ั–ั‚ัŒ ยซะ ะตะดะฐะณัƒะฒะฐั‚ะธยป, ยซะŸะพะฒั‚ะพั€ะธั‚ะธยป ะฐะฑะพ ยซะกะบะฐััƒะฒะฐั‚ะธยป. B ะฐะฑะพ ยซะะฐะทะฐะดยป ัะบะฐัะพะฒัƒั” ะฟั–ัะปั ะฒั–ะดะฟัƒัะบะฐะฝะฝั. + ะŸะพะฒั‚ะพั€ะธั‚ะธ + ะะฐั‚ะธัะฝั–ั‚ัŒ ะบะฝะพะฟะบัƒ, ะทะพะบั€ะตะผะฐ ยซะะฐะทะฐะดยป, ัะบั‰ะพ ะฒะพะฝะฐ ะฟะตั€ะตะดะฐั”ั‚ัŒัั ัะบ ะบะปะฐะฒั–ัˆะฐ. ะšะปะฐะฒั–ัˆั– ะณัƒั‡ะฝะพัั‚ั– ั‚ะฐ ัะธัั‚ะตะผะฝั– ะบะปะฐะฒั–ัˆั– Android ะทะฐั€ะตะทะตั€ะฒะพะฒะฐะฝั–. ะŸั€ะธะทะฝะฐั‡ะตะฝะฝั ะดั–ั” ะปะธัˆะต ะฝะฐ ั†ัŒะพะผัƒ ะฟั€ะธัั‚ั€ะพั—. + ะ’ะธะดะฐะปะธั‚ะธ ะฟั€ะธะทะฝะฐั‡ะตะฝะฝั + ะ”ั–ะฐะณะฝะพัั‚ะธะบะฐ ะฒะฒะตะดะตะฝะฝั + ะ—ะฐะฟะธััƒะฒะฐั‚ะธ ั‡ะฐั ะฝะฐะดัะธะปะฐะฝะฝั ะฒะฒะตะดะตะฝะฝั + ะŸั€ะพั‡ะธั‚ะฐั‚ะธ ะฒะธะผั–ั€ัŽะฒะฐะฝะฝั + ะ’ะธะผั–ั€ัŽั” ัˆะปัั… ะฒั–ะด ะดะธัะฟะตั‚ั‡ะตั€ะธะทะฐั†ั–ั— Android ะดะพ ะฟัƒะฑะปั–ะบะฐั†ั–ั— ะฒ ะฝะฐัะฒะฝะพะผัƒ ั‚ั€ะฐะฝัะฟะพั€ั‚ั– ะฒะฒะตะดะตะฝะฝั. ะะต ะฒั€ะฐั…ะพะฒัƒั” ะฝะฐะดั…ะพะดะถะตะฝะฝั ั‡ะตั€ะตะท Bluetooth, ะพะฟะธั‚ัƒะฒะฐะฝะฝั ะณะพัั‚ัŒะพะฒะพั— ัะธัั‚ะตะผะธ, ั€ะตะฝะดะตั€ะธะฝะณ ั– ะทะฐั‚ั€ะธะผะบัƒ ะตะบั€ะฐะฝะฐ. ะ—ะฐะฟะธั ะฒะธะผะบะฝะตะฝะพ ะทะฐ ะทะฐะผะพะฒั‡ัƒะฒะฐะฝะฝัะผ. + ะ’ะธะบะพั€ะธัั‚ะพะฒัƒะฒะฐั‚ะธ ะทะฒะธั‡ะฐะนะฝะต ะฟั€ะธะทะฝะฐั‡ะตะฝะฝั ะฒะฒะตะดะตะฝะฝั + diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml index 79eb4138e0..15ab8c9c4d 100644 --- a/app/src/main/res/values-uk/strings.xml +++ b/app/src/main/res/values-uk/strings.xml @@ -28,6 +28,8 @@ ะŸั€ะธะทัƒะฟะธะฝะธั‚ะธ ะทะฐั€ะฐะท ะ—ะฐะฒะตั€ัˆะธั‚ะธ ัะตะฐะฝั ะ“ะตะฝะตั€ะฐั†ั–ั ะบะฐะดั€ั–ะฒ + ะะฐะปะฐัˆั‚ัƒะฒะฐะฝะฝั ั†ั–ั”ั— ะณั€ะธ + ะขะธะฟะพะฒั– ะฝะฐะปะฐัˆั‚ัƒะฒะฐะฝะฝั ะ’ะธะฑะตั€ั–ั‚ัŒ ั€ะตะถะธะผ ะณะตะฝะตั€ะฐั†ั–ั— ะบะฐะดั€ั–ะฒ ะ’ะธะผะบ. DD-FG %1$dร— @@ -183,6 +185,7 @@ ะะต ะฒะดะฐะปะพัั ะทะฐะฒะฐะฝั‚ะฐะถะธั‚ะธ ะณั€ะฐั„ั–ั‡ะฝะต ัะตั€ะตะดะพะฒะธั‰ะต PowerVR. ะŸะตั€ะตะฒั–ั€ั‚ะต ะฟั–ะดะบะปัŽั‡ะตะฝะฝั ะน ะฟะพะฒั‚ะพั€ั–ั‚ัŒ ัะฟั€ะพะฑัƒ. ะะต ะฒะดะฐะปะพัั ะทะฐะฒะฐะฝั‚ะฐะถะธั‚ะธ DirectAudio, ั‚ะพะผัƒ ะฒ ั†ัŒะพะผัƒ ัะตะฐะฝัั– ะทะฒัƒะบ ั–ะณะพั€ ั–ะดะต ะฟะพะฒั–ะปัŒะฝั–ัˆะธะผ ัˆะปัั…ะพะผ. ะฆั ะฟั€ะพะณั€ะฐะผะฐ + ะกะตะฐะฝั ะฝะต ะทะผั–ะณ ะฒะธะฒะตัั‚ะธ ะทะพะฑั€ะฐะถะตะฝะฝั ะฝะฐ ะตะบั€ะฐะฝ: %1$s. ะ—ะฐะผั–ัั‚ัŒ ั‡ะพั€ะฝะพะณะพ ะตะบั€ะฐะฝะฐ ั‚ัƒั‚ ะฟะพะบะฐะทะฐะฝะพ ะฟั€ะธั‡ะธะฝัƒ; ะฟะพะดั€ะพะฑะธั†ั– โ€” ัƒ ะถัƒั€ะฝะฐะปะฐั… ัะตะฐะฝััƒ. ะะต ะฒะดะฐะปะพัั ะทะฐะฒะฐะฝั‚ะฐะถะธั‚ะธ ะบะปั–ั”ะฝั‚ Steam. ะœะพะถะปะธะฒะพ, ะฒะฐัˆะฐ ะผะตั€ะตะถะฐ ะฐะฑะพ VPN ะฑะปะพะบัƒั” ัะตั€ะฒะตั€ะธ Steam; ะฟะตั€ะตะฒั–ั€ั‚ะต ะทโ€™ั”ะดะฝะฐะฝะฝั ั‚ะฐ ัะฟั€ะพะฑัƒะนั‚ะต ั‰ะต ั€ะฐะท. ะะต ะฒะดะฐะปะพัั ะฝะฐะปะฐัˆั‚ัƒะฒะฐั‚ะธ ะบะปั–ั”ะฝั‚ Steam. ะŸะตั€ะตะฒั–ั€ั‚ะต ะทโ€™ั”ะดะฝะฐะฝะฝั ั‚ะฐ ะฒั–ะปัŒะฝะต ะผั–ัั†ะต, ะฟะพั‚ั–ะผ ัะฟั€ะพะฑัƒะนั‚ะต ั‰ะต ั€ะฐะท. %1$s ะทั–ะฑั€ะฐะฝะพ ะดะปั ะŸะš x86; ะดะปั ะทะฐะฟัƒัะบัƒ ะฟะพั‚ั€ั–ะฑะตะฝ FEX, ัะบะธะน ั‰ะต ะฝะต ะฒัั‚ะฐะฝะพะฒะปะตะฝะพ. ะžะดะธะฝ ั€ะฐะท ะทะฐะฟัƒัั‚ั–ั‚ัŒ Steam, ัƒะฒั–ะนัˆะพะฒัˆะธ ะฒ ะพะฑะปั–ะบะพะฒะธะน ะทะฐะฟะธั, ะดะฐะนั‚ะต ะนะพะผัƒ ะทะฐะฒะฐะฝั‚ะฐะถะธั‚ะธ FEX ั– Steam Linux Runtime, ะฐ ะฟะพั‚ั–ะผ ะทะฐะฟัƒัั‚ั–ั‚ัŒ ั†ะต ะทะฝะพะฒัƒ. @@ -387,6 +390,9 @@ ะขัƒั‚ ะฟะพะบะธ ะฝะต ะฟั–ะดั‚ั€ะธะผัƒั”ั‚ัŒัั ะ—ะฐะฒะฐะฝั‚ะฐะถะตะฝะฝั ะบะพะผะฟะพะฝะตะฝั‚ั–ะฒโ€ฆ ะะต ะฒะดะฐะปะพัั ะฒัั‚ะฐะฝะพะฒะธั‚ะธ: %1$s + ะ”ะปั ั†ัŒะพะณะพ ะทะฐะฒะฐะฝั‚ะฐะถะตะฝะฝั ะฟะพั‚ั€ั–ะฑะฝะต ะพะฝะพะฒะปะตะฝะฝั. + ะžะฝะพะฒะปะตะฝะฝั ะฒ ั‡ะตั€ะทั–. + ะŸะพะฒั‚ะพั€ะธั‚ะธ ะพะฝะพะฒะปะตะฝะฝั ะ—ะฐะฒะฐะฝั‚ะฐะถะตะฝะพ ะ—ะฐะฒะฐะฝั‚ะฐะถะตะฝะฝั %1$s ะฃัั‚ะฐะฝะพะฒะปะตะฝะฝั: %1$s @@ -417,6 +423,22 @@ ะ›ะธัˆะต ะฒะฝัƒั‚ั€ั–ัˆะฝั ะฟะฐะผโ€™ัั‚ัŒ ะŸะฐะฟะบะฐ: %1$s ะ”ั€ัƒะณะฐ ะฑั–ะฑะปั–ะพั‚ะตะบะฐ + ะ”ะพะดะฐั‚ะบะพะฒั– ะฑั–ะฑะปั–ะพั‚ะตะบะธ Steam + ะŸะฐะฟะบะธ, ะฒ ัะบั– Steam ะผะพะถะต ะฒัั‚ะฐะฝะพะฒะปัŽะฒะฐั‚ะธ ั–ะณั€ะธ ั‚ะฐ ะท ัะบะธั… ะผะพะถะต ั—ั… ะทะฐะฟัƒัะบะฐั‚ะธ, ะบะพะถะฝะฐ ะฟั–ะด ะฒะปะฐัะฝะพัŽ ะฝะฐะทะฒะพัŽ. ะŸั–ัะปั ะฒะธะดะฐะปะตะฝะฝั ะฟะฐะฟะบะธ ั—ั— ั–ะณั€ะธ ะทะฐะปะธัˆะฐัŽั‚ัŒัั ะฝะฐ ะดะธัะบัƒ. + ะ”ะพะดะฐั‚ะธ ะฑั–ะฑะปั–ะพั‚ะตะบัƒ + ะŸะตั€ะตะนะผะตะฝัƒะฒะฐั‚ะธ + ะะฐะทะฒะฐ ะฑั–ะฑะปั–ะพั‚ะตะบะธ + ะ’ะธะฑะตั€ั–ั‚ัŒ ะฟะฐะฟะบัƒ ะดะปั ะฑั–ะฑะปั–ะพั‚ะตะบะธ + ะะต ะฑั–ะปัŒัˆะต %1$d ะดะพะดะฐะฝะธั… ะฑั–ะฑะปั–ะพั‚ะตะบ + ะฆั ะฟะฐะฟะบะฐ ะฒะถะต ั” ะฑั–ะฑะปั–ะพั‚ะตะบะพัŽ ะฐะฑะพ ะผั–ัั‚ะธั‚ัŒัั ะฒ ั–ะฝัˆั–ะน + %1$s ยท ะฝะตะดะพัั‚ัƒะฟะฝะฐ + ะ”ั–ั” ะท ะฝะฐัั‚ัƒะฟะฝะพะณะพ ัะตะฐะฝััƒ Steam + ะ—ะฝะฐะนะดะตะฝะพ ะฝะฐ ั†ัŒะพะผัƒ ะฟั€ะธัั‚ั€ะพั— ยท %1$s ยท %2$s + ะ”ะพะดะฐั‚ะธ + ะ—ะฝะฐะนั‚ะธ ะฑั–ะฑะปั–ะพั‚ะตะบะธ ัƒ ะฒะฝัƒั‚ั€ั–ัˆะฝัŒะพะผัƒ ัั…ะพะฒะธั‰ั– + ะ”ะพะทะฒะพะปัŒั‚ะต ะดะพัั‚ัƒะฟ ะดะพ ะฒัั–ั… ั„ะฐะนะปั–ะฒ, ั‰ะพะฑ DroidDeck ะผั–ะณ ะฑะฐั‡ะธั‚ะธ ะฑั–ะฑะปั–ะพั‚ะตะบะธ Steam, ัะบั– ั–ะฝัˆั– ะฟั€ะพะณั€ะฐะผะธ ะทะฑะตั€ั–ะณะฐัŽั‚ัŒ ัƒ ะฒะฝัƒั‚ั€ั–ัˆะฝัŒะพะผัƒ ัั…ะพะฒะธั‰ั– + ะ”ะพะทะฒะพะปะธั‚ะธ + ะ”ะพะดะฐะฝะพ %1$s โ€” ะฑั–ะฑะปั–ะพั‚ะตะบัƒ Steam ัƒ ะฒะธะฑั€ะฐะฝั–ะน ะฟะฐะฟั†ั– ะ†ะณั€ะธ, ัะบั– ะฟั–ะดะฒะฐะฝั‚ะฐะถัƒัŽั‚ัŒ ั€ะตััƒั€ัะธ ะท SD-ะบะฐั€ั‚ะธ ะฐะฑะพ ัะฟั–ะปัŒะฝะพะณะพ ัั…ะพะฒะธั‰ะฐ, ะผะพะถัƒั‚ัŒ ะฟั€ะฐั†ัŽะฒะฐั‚ะธ ั€ะธะฒะบะฐะผะธ. ะ”ั–ะฐะณะฝะพัั‚ะธะบะฐ ัั…ะพะฒะธั‰ะฐ ะ—ะฐะฟะธััƒั” ั€ะตะทัƒะปัŒั‚ะฐั‚ะธ ะฒะธะดั–ะปะตะฝะฝั ะผั–ัั†ั ั‚ะฐ ะฒะธะฑั–ั€ะบะพะฒั– ะทะฐะผั–ั€ะธ ัˆะฒะธะดะบะพัั‚ั– ัั…ะพะฒะธั‰ะฐ ะฒ ยซะŸะพะดั–ะปะธั‚ะธัั ะถัƒั€ะฝะฐะปะฐะผะธยป. ะŸะพะบะธ ะฒะฒั–ะผะบะฝะตะฝะพ, ะฒัั‚ะฐะฝะพะฒะปะตะฝะฝั ะผะพะถะต ัะฟะพะฒั–ะปัŒะฝัŽะฒะฐั‚ะธัั. ะ—ะฐัั‚ะพัะพะฒัƒั”ั‚ัŒัั ะฒ ะฝะฐัั‚ัƒะฟะฝะพะผัƒ ัะตะฐะฝัั–. @@ -482,6 +504,7 @@ ะฃะฒั–ะผะบะฝะตะฝะพ ะ—ะฐะฟัƒัะบะฐั”ั‚ัŒัั ะทั– Steam ะ—ะฐะฟัƒัะบะฐั”ั‚ัŒัั ะฑะตะท Steam + ะ ะพะทะดั–ะปัŒะฝะฐ ะทะดะฐั‚ะฝั–ัั‚ัŒ ะณั€ะธ ะะฐะปะฐัˆั‚ัƒะฒะฐะฝะฝั ะะฐะปะฐัˆั‚ัƒะฒะฐะฝะฝั %1$s ะ—ะฐ ะทะฐะผะพะฒั‡ัƒะฒะฐะฝะฝัะผ @@ -569,6 +592,8 @@ ะฏะดั€ะฐ ะดะปั ั–ะณะพั€ ะฏะดั€ะฐ ะดะปั ั–ะณะพั€ ะฏะดั€ะฐ ะดะปั ั–ะณะพั€. ะฏะบั‰ะพ ะฒะธะฑั€ะฐะฝะพ ะฒัั–, Android ั€ะพะทะฟะพะดั–ะปัั” ะฝะฐะฒะฐะฝั‚ะฐะถะตะฝะฝั ะฒั–ะปัŒะฝะพ. + ะ—ะฐะพั‰ะฐะดะถัƒะฒะฐั‚ะธ ะตะฝะตั€ะณั–ัŽ ะฒ ัั‚ะฐะฑั–ะปัŒะฝะธั… ั–ะณั€ะฐั… + ะ—ะฐะฟัƒัะบะฐั” ะณั€ัƒ ะฝะฐ ะฟะพะฒั–ะปัŒะฝั–ัˆะธั… ัะดั€ะฐั…, ะฟะพะบะธ ะฒะพะฝะฐ ั‚ั€ะธะผะฐั” ัั‚ะฐะฑั–ะปัŒะฝัƒ ั‡ะฐัั‚ะพั‚ัƒ ะบะฐะดั€ั–ะฒ, ั– ะฟะพะฒะตั€ั‚ะฐั” ั—ั— ะฝะฐ ะทะฒะธั‡ะฝั– ัะดั€ะฐ, ั‰ะพะนะฝะพ ะฒะพะฝะฐ ะฒั–ะดัั‚ะฐั”. ะ†ะฝั‚ะตั€ั„ะตะนั ะบะปั–ั”ะฝั‚ะฐ ะ‘ะฐะณะฐั‚ะพะฟะพั‚ะพะบะพะฒะธะน GL ะœะตะฝัŽ Steam ะผะพะถัƒั‚ัŒ ั€ะตะฐะณัƒะฒะฐั‚ะธ ัˆะฒะธะดัˆะต. @@ -604,7 +629,10 @@ ะ’ะธะผะธะบะฐั” ะฟะพะผั–ั‡ะฝะธะบ Proton ะดะปั ะฝะฐะฒั–ะณะฐั†ั–ั— ะณะตะนะผะฟะฐะดะพะผ, ัะบะธะน ัะฟะพะถะธะฒะฐั” ั€ะตััƒั€ัะธ CPU ะฒ ะบะพะถะฝั–ะน ะณั€ั–. ะ—ะฐะฟัƒัะบะฐั‚ะธ proot ะฑะตะท seccomp ะœะพะถะต ัƒััƒะฝัƒั‚ะธ ะฟะพะผะธะปะบะธ ะฒั–ะดััƒั‚ะฝั–ั… ัะธัั‚ะตะผะฝะธั… ะฒะธะบะปะธะบั–ะฒ ะฝะฐ ะดะตัะบะธั… ัะดั€ะฐั…. ะœะพะถะต ะทะฝะธะทะธั‚ะธ ะฟั€ะพะดัƒะบั‚ะธะฒะฝั–ัั‚ัŒ. + ะ—ะฐะฟัƒัะบ ะฑะตะท proot (ะตะบัะฟะตั€ะธะผะตะฝั‚ะฐะปัŒะฝะพ) + ะ—ะฐะฟัƒัะบะฐั” ัะตั€ะตะดะพะฒะธั‰ะต Linux ะฑะตะทะฟะพัะตั€ะตะดะฝัŒะพ ะฝะฐ Android. ะ”ั–ั” ะท ะฝะฐัั‚ัƒะฟะฝะพะณะพ ัะตะฐะฝััƒ. ะ’ะธะผะบะฝั–ั‚ัŒ, ัะบั‰ะพ ั‰ะพััŒ ะฝะต ะทะฐะฟัƒัะบะฐั”ั‚ัŒัั. ะจะฒะธะดะบะธะน ัˆะปัั… proot + ะะต ะฒะธะบะพั€ะธัั‚ะพะฒัƒั”ั‚ัŒัั ะฑะตะท proot. ะŸะพั‚ั€ะตะฑัƒั” ั„ั–ะปัŒั‚ั€ะฐ seccomp ัƒ proot. ะจะฒะธะดัˆะธะน ะฟะพัˆัƒะบ ั„ะฐะนะปั–ะฒ ั– ะผะตะฝัˆะต ะทะฐะฟะธะฝะพะบ. ะ’ะธะผะบะฝั–ั‚ัŒ, ัะบั‰ะพ ะฟั€ะพะณั€ะฐะผะฐ ะฝะต ะผะพะถะต ะทะฝะฐะนั‚ะธ ัะฒะพั— ั„ะฐะนะปะธ. ะœะฐะปัŽะฒะฐั‚ะธ ะบัƒั€ัะพั€ ัƒัะตั€ะตะดะธะฝั– gamescope @@ -687,6 +715,7 @@ ะ’ั–ะดะตะพะฟะฐะผ\'ัั‚ัŒ ะŸั–ะดะบะฐั‡ะบะฐ ะ—ะฐั€ัะด ะฑะฐั‚ะฐั€ะตั— + ะ—ะฐะปะธัˆะบะพะฒะธะน ั‡ะฐั ั€ะพะฑะพั‚ะธ ะฑะฐั‚ะฐั€ะตั— ะกะฟะพะถะธะฒะฐะฝะฐ ะฟะพั‚ัƒะถะฝั–ัั‚ัŒ ะœะตั€ะตะถะฐ ะ ะพะทะดั–ะปัŒะฝะฐ ะทะดะฐั‚ะฝั–ัั‚ัŒ @@ -815,6 +844,7 @@ ะŸั€ะธัั‚ั€ั–ะน ะฟั–ะดั‚ั€ะธะผัƒั”ั‚ัŒัั GPU ะฝะต ะฟะตั€ะตะฒั–ั€ะตะฝะพ GPU ะฝะต ะฟั–ะดั‚ั€ะธะผัƒั”ั‚ัŒัั + GPU ั‡ะตั€ะตะท ะผั–ัั‚ Mali %1$s ยท %2$s %1$s: %2$s ะ”ะปั %1$s ะฝะตะผะฐั” ััƒะผั–ัะฝะพะณะพ ะณั€ะฐั„ั–ั‡ะฝะพะณะพ ะฑะตะบะตะฝะดะฐ. Steam ะผะพะถะต ะฟะพะบะฐะทัƒะฒะฐั‚ะธ ั‡ะพั€ะฝะธะน ะตะบั€ะฐะฝ. @@ -844,15 +874,38 @@ ะกะตะฐะฝั ะ–ัƒั€ะฝะฐะปะธ ัะตะฐะฝััƒ ะ—ะฑะตั€ั–ะณะฐัŽั‚ัŒัั ะฟั–ัะปั ะบะพะถะฝะพะณะพ ัะตะฐะฝััƒ + ะ ะพะทัˆะธั€ะตะฝะฐ ะดั–ะฐะณะฝะพัั‚ะธะบะฐ ะดะปั ะฝะฐัั‚ัƒะฟะฝะพะณะพ ัะตะฐะฝััƒ + ะ—ะฑะธั€ะฐั” ะดะตั‚ะฐะปัŒะฝั– ะถัƒั€ะฝะฐะปะธ ะฟั€ะพั‚ัะณะพะผ ะพะดะฝะพะณะพ ัะตะฐะฝััƒ. ะœะพะถะต ะทะฝะธะทะธั‚ะธ ะฟั€ะพะดัƒะบั‚ะธะฒะฝั–ัั‚ัŒ ั– ะทะฐะนะฝัั‚ะธ ะฑั–ะปัŒัˆะต ะผั–ัั†ั. ะ’ะธะผะธะบะฐั”ั‚ัŒัั ะฐะฒั‚ะพะผะฐั‚ะธั‡ะฝะพ ะฝะฐ ะฟะพั‡ะฐั‚ะบัƒ ัะตะฐะฝััƒ; ะฟะตั€ะตะณะปัะฝัŒั‚ะต ะถัƒั€ะฝะฐะปะธ ะฟะตั€ะตะด ั‚ะธะผ, ัะบ ะดั–ะปะธั‚ะธัั ะฝะธะผะธ. ะ–ัƒั€ะฝะฐะปะธ ะฝะฐะปะฐะณะพะดะถะตะฝะฝั ั–ะณะพั€ ะ”ะพะดะฐะฒะฐั‚ะธ ะดั–ะฐะณะฝะพัั‚ะธะบัƒ Proton, Wine ั– ะณั€ะฐั„ั–ะบะธ ะฟั–ะด ั‡ะฐั ะฝะฐัั‚ัƒะฟะฝะพะณะพ ะทะฐะฟัƒัะบัƒ ะณั€ะธ. ะœะพะถะต ะทะฝะธะทะธั‚ะธ ะฟั€ะพะดัƒะบั‚ะธะฒะฝั–ัั‚ัŒ ั– ะทะฐะนะฝัั‚ะธ ะฑั–ะปัŒัˆะต ะผั–ัั†ั. ะŸะตั€ะตะทะฐะฟัƒัั‚ั–ั‚ัŒ ั†ะตะน ัะตะฐะฝั, ั‰ะพะฑ ะทะฑะตั€ั–ะณะฐั‚ะธ ะถัƒั€ะฝะฐะปะธ ะฝะฐะปะฐะณะพะดะถะตะฝะฝั ั–ะณะพั€ ะะต ะฒะดะฐะปะพัั ะพะฝะพะฒะธั‚ะธ ะถัƒั€ะฝะฐะปัŽะฒะฐะฝะฝั. ะŸะตั€ะตะฒั–ั€ั‚ะต ะฟะตั€ะตะผะธะบะฐั‡ ั– ัะฟั€ะพะฑัƒะนั‚ะต ั‰ะต ั€ะฐะท. ะ—ะฐัะพะฑะธ ะดั–ะฐะณะฝะพัั‚ะธะบะธ + ะ”ะตั‚ะฐะปัŒะฝั– ะถัƒั€ะฝะฐะปะธ ะณั€ะฐั„ั–ะบะธ + ะ†ะฝั‚ะตั€ั„ะตะนั Steam: ะผะฐะปัŽะฒะฐะฝะฝั ะฝะฐ GPU + ะ†ะท ะฟะฐั€ะพัŽ ะดั€ะฐะนะฒะตั€ั–ะฒ Xclipse Steam ะผะฐะปัŽั” ัะฒะพั— ัั‚ะพั€ั–ะฝะบะธ ะฟั€ะพะณั€ะฐะผะฝะพ (ะผะฐะปัŽะฒะฐะฝะฝั ะฝะฐ GPU ะดะฐะฒะฐะปะพ ะฟะพัˆะบะพะดะถะตะฝั– ั„ั€ะฐะณะผะตะฝั‚ะธ). ะฃะฒั–ะผะบะฝั–ั‚ัŒ ะดะปั ัˆะฒะธะดัˆะพะณะพ ั–ะฝั‚ะตั€ั„ะตะนััƒ Steam, ัะบั‰ะพ ะฝะฐ ั†ัŒะพะผัƒ ั‚ะตะปะตั„ะพะฝั– ะฒัะต ะฒะธะณะปัะดะฐั” ะฟั€ะฐะฒะธะปัŒะฝะพ. + ะทั–ะฑั€ะฐะฝะพ %1$s + %1$s ะพะฝะพะฒะปะตะฝะพ ะดะพ ะฝะฐะนะฝะพะฒั–ัˆะพั— ะทะฑั–ั€ะบะธ + ะœั–ัั‚ Mali ะฝะต ะฟั€ะพะนัˆะพะฒ ัะฐะผะพะฟะตั€ะตะฒั–ั€ะบัƒ ะฝะฐ %1$s ะฟั–ะด ั‡ะฐั ะผะธะฝัƒะปะพะณะพ ัะตะฐะฝััƒ (ะทะพะฑั€ะฐะถะตะฝะฝั ะฐะฑะพ ะฒั–ะดั€ะธัะพะฒะบะฐ), ั‚ะพะผัƒ ะฒ ะฝัŒะพะผัƒ ะฒะธะบะพั€ะธัั‚ะพะฒัƒะฒะฐะปะฐัั ะฟะฐั€ะฐ ะดั€ะฐะนะฒะตั€ั–ะฒ PanVK. + ะŸั–ะด ั‡ะฐั ะผะธะฝัƒะปะพะณะพ ัะตะฐะฝััƒ ะผั–ัั‚ Mali ะฝะต ะทะฝะฐะนัˆะพะฒ ัะฟะพัะพะฑัƒ ัะฟั–ะปัŒะฝะพ ะฒะธะบะพั€ะธัั‚ะพะฒัƒะฒะฐั‚ะธ ะฟะฐะผโ€™ัั‚ัŒ ั–ะท ะดั€ะฐะนะฒะตั€ะพะผ ะฝะฐ %1$s, ั‚ะพะผัƒ ะฒ ะฝัŒะพะผัƒ ะฒะธะบะพั€ะธัั‚ะพะฒัƒะฒะฐะปะฐัั ะฟะฐั€ะฐ ะดั€ะฐะนะฒะตั€ั–ะฒ PanVK. ะะฐ ั†ัŒะพะผัƒ ั‚ะตะปะตั„ะพะฝั– ะผั–ัั‚ ะฝะต ะผะพะถะต ะฟั€ะฐั†ัŽะฒะฐั‚ะธ; ัะบั‰ะพ ะฒะธะผะบะฝัƒั‚ะธ ะนะพะณะพ, ะฒะธะบะพั€ะธัั‚ะพะฒัƒะฒะฐั‚ะธะผะตั‚ัŒัั ะฟะฐั€ะฐ PanVK. + ะ–ัƒั€ะฝะฐะปะธ Proton, DXVK ั– ะดั€ะฐะนะฒะตั€ั–ะฒ ะดะปั ะบะพะถะฝะพั— ะณั€ะธ ะทะฑะตั€ั–ะณะฐัŽั‚ัŒัั ะฒ ะถัƒั€ะฝะฐะปะฐั… ัะตะฐะฝััƒ. ะ—ะฐะฒะถะดะธ ัƒะฒั–ะผะบะฝะตะฝะพ, ัะบั‰ะพ ั†ะต ะฝะต GPU Adreno. ะžัั‚ะฐะฝะฝั– ะถัƒั€ะฝะฐะปะธ ัะตะฐะฝััƒ ะ—ะฑะตั€ะตะถะตะฝั– ะถัƒั€ะฝะฐะปะธ ัะตะฐะฝััƒ ะ—ะฑะตั€ั–ะณะฐั” %1$d ะฝะฐะนะฝะพะฒั–ัˆะธั… ะžั‡ะธัั‚ะธั‚ะธ ะถัƒั€ะฝะฐะปะธ + ะ”ะพัั‚ัƒะฟะฝั– ะถัƒั€ะฝะฐะปะธ ัะตะฐะฝัั–ะฒ + ะ—ะฑะตั€ะตะถะตะฝะธั… ะถัƒั€ะฝะฐะปั–ะฒ ัะตะฐะฝัั–ะฒ ั‰ะต ะฝะตะผะฐั”. + ZIP-ะฐั€ั…ั–ะฒะธ ะดะปั ะฝะฐะดัะธะปะฐะฝะฝั ั‚ะฐ ะทะฑะตั€ะตะถะตะฝะฝั ะผั–ัั‚ัั‚ัŒ ะถัƒั€ะฝะฐะปะธ ะฒะธะฑั€ะฐะฝะพะณะพ ัะตะฐะฝััƒ ั‚ะฐ ะฟะพะฒโ€™ัะทะฐะฝั– ะดั–ะฐะณะฝะพัั‚ะธั‡ะฝั– ะดะฐะฝั– Steam, ะผะฐะณะฐะทะธะฝัƒ, ั–ะฝัั‚ั€ัƒะผะตะฝั‚ั–ะฒ ั– Battle.net. + %1$s ยท %2$s + ะŸะพั‚ะพั‡ะฝะธะน ัะตะฐะฝั + ะŸะพะดั–ะปะธั‚ะธัั + ะ—ะฑะตั€ะตะณั‚ะธ ะฝะฐ ะฟั€ะธัั‚ั€ะพั— + ะ’ะธะดะฐะปะธั‚ะธ + ะ’ะธะดะฐะปะธั‚ะธ ะถัƒั€ะฝะฐะปะธ ัะตะฐะฝััƒ? + ะ’ะธะดะฐะปะธั‚ะธ %1$s? ะฆัŽ ะดั–ัŽ ะฝะต ะผะพะถะฝะฐ ัะบะฐััƒะฒะฐั‚ะธ. + ะ–ัƒั€ะฝะฐะปะธ ัะตะฐะฝััƒ ะทะฑะตั€ะตะถะตะฝะพ. + ะะต ะฒะดะฐะปะพัั ะทะฑะตั€ะตะณั‚ะธ ะถัƒั€ะฝะฐะปะธ ัะตะฐะฝััƒ. + ะะต ะฒะดะฐะปะพัั ะฒะธะดะฐะปะธั‚ะธ ะถัƒั€ะฝะฐะปะธ ัะตะฐะฝััƒ. ะกะบะธะฝัƒั‚ะธ ะฒัั– ะฝะฐะปะฐัˆั‚ัƒะฒะฐะฝะฝั ะŸะพะฒะตั€ะฝัƒั‚ะธ ะบะพะถะฝะต ะฝะฐะปะฐัˆั‚ัƒะฒะฐะฝะฝั ะดะพ ั‚ะธะฟะพะฒะพะณะพ ะทะฝะฐั‡ะตะฝะฝั ะกะบะธะฝัƒั‚ะธ @@ -879,6 +932,8 @@ ะ’ะธะบะพั€ะธัั‚ะพะฒัƒะฒะฐั‚ะธ ัะบ ะณะพะปะพะฒะฝะธะน ะตะบั€ะฐะฝ DroidDeck ะผะพะถะต ะฑัƒั‚ะธ ะดะพะดะฐั‚ะบะพะผ ะณะพะปะพะฒะฝะพะณะพ ะตะบั€ะฐะฝะฐ DroidDeck ะฝั–ะบะพะปะธ ะฝะต ะฟั€ะพะฟะพะฝัƒั”ั‚ัŒัั ัะบ ะดะพะดะฐั‚ะพะบ ะณะพะปะพะฒะฝะพะณะพ ะตะบั€ะฐะฝะฐ + ะšะฝะพะฟะบะฐ ยซะ”ะพะดะพะผัƒยป ะฒั–ะดะบั€ะธะฒะฐั” + ะกั‚ะพั€ั–ะฝะบะฐ, ัะบะฐ ะฒั–ะดะบั€ะธะฒะฐั”ั‚ัŒัั, ะบะพะปะธ DroidDeck ั” ะทะฐัั‚ะพััƒะฝะบะพะผ ะณะพะปะพะฒะฝะพะณะพ ะตะบั€ะฐะฝะฐ ะน ะฒะธ ะฝะฐั‚ะธัะบะฐั”ั‚ะต ยซะ”ะพะดะพะผัƒยป ะฃ ั€ะพะทะดั–ะปั– ยซะ”ะพะดะฐั‚ะธ ั–ะณั€ะธยป ะฟะตั€ะตะผะบะฝั–ั‚ัŒ DroidDeck ะฝะฐ ยซะ’ะบะปัŽั‡ะธั‚ะธยป ะžั€ั–ั”ะฝั‚ะฐั†ั–ั ะžั€ั–ั”ะฝั‚ะฐั†ั–ั ะปะฐัƒะฝั‡ะตั€ะฐ @@ -892,15 +947,22 @@ ะŸะพะฒะฝะธะน ะตะบั€ะฐะฝ ะŸั€ะธั…ะพะฒัƒั” ั€ัะดะพะบ ัั‚ะฐะฝัƒ ั‚ะฐ ะฟะฐะฝะตะปัŒ ะฝะฐะฒั–ะณะฐั†ั–ั— Android ะŸะพะบะฐะทัƒั” ั€ัะดะพะบ ัั‚ะฐะฝัƒ ั‚ะฐ ะฟะฐะฝะตะปัŒ ะฝะฐะฒั–ะณะฐั†ั–ั— Android + ะ›ะฐัƒะฝั‡ะตั€ ะดะปั ะดะฒะพั… ะตะบั€ะฐะฝั–ะฒ + ะะฒั‚ะพะผะฐั‚ะธั‡ะฝะธะน ั€ะตะถะธะผ ั€ะพะทะผั–ั‰ัƒั” ั€ะพะทะดั–ะปะธ ะปะฐัƒะฝั‡ะตั€ะฐ (Steam, ะ‘ั–ะฑะปั–ะพั‚ะตะบะฐ, ะœะฐะณะฐะทะธะฝะธ ั‚ะพั‰ะพ) ะฝะฐ ะฒะฑัƒะดะพะฒะฐะฝะพะผัƒ ะดั€ัƒะณะพะผัƒ ะตะบั€ะฐะฝั– ะฟะพั€ั‚ะฐั‚ะธะฒะฝะธั… ะฟั€ะธัั‚ั€ะพั—ะฒ. ะฃ ั€ะตะถะธะผั– ยซะฃะฒั–ะผะบะฝะตะฝะพยป ะฒะธะบะพั€ะธัั‚ะพะฒัƒั”ั‚ัŒัั ะฑัƒะดัŒ-ัะบะธะน ะดั€ัƒะณะธะน ะดะธัะฟะปะตะน. ะฃ ั€ะตะถะธะผั– ยซะ’ะธะผะบะฝะตะฝะพยป ะปะฐัƒะฝั‡ะตั€ ะทะฐะปะธัˆะฐั”ั‚ัŒัั ะฝะฐ ะพะดะฝะพะผัƒ ะตะบั€ะฐะฝั–. + ะกะตะฐะฝัะธ ะดะปั ะดะฒะพั… ะตะบั€ะฐะฝั–ะฒ + ะะฒั‚ะพะผะฐั‚ะธั‡ะฝะธะน ั€ะตะถะธะผ ะทะฐะบั€ั–ะฟะปัŽั” ะผะตะฝัŽ ะฒ ะณั€ั– ะฝะฐ ะฒะฑัƒะดะพะฒะฐะฝะพะผัƒ ะดั€ัƒะณะพะผัƒ ะตะบั€ะฐะฝั– ะทะฐะผั–ัั‚ัŒ ัะฟะปะธะฒะฝะพะณะพ ะฒั–ะบะฝะฐ. ะฃ ั€ะตะถะธะผั– ยซะฃะฒั–ะผะบะฝะตะฝะพยป ะฒะธะบะพั€ะธัั‚ะพะฒัƒั”ั‚ัŒัั ะฑัƒะดัŒ-ัะบะธะน ะดั€ัƒะณะธะน ะดะธัะฟะปะตะน. ะฃ ั€ะตะถะธะผั– ยซะ’ะธะผะบะฝะตะฝะพยป ะผะตะฝัŽ ะทะฐะปะธัˆะฐั”ั‚ัŒัั ะฝะฐ ะตะบั€ะฐะฝั– ะณั€ะธ; ะท ะฝัŒะพะณะพ ะน ะดะฐะปั– ะผะพะถะฝะฐ ะฒะธะฑั€ะฐั‚ะธ ะดั€ัƒะณะธะน ะตะบั€ะฐะฝ. ะะฒั‚ะพะผะฐั‚ะธั‡ะฝะพ ะฃะฒั–ะผะบ. ะ’ะธะผะบ. ะšะตั€ัƒะฒะฐะฝะฝั ะฝะฐ ะฝะธะถะฝัŒะพะผัƒ ะตะบั€ะฐะฝั– ะฒ ั–ะณั€ะฐั… + ะšะปะฐะฒั–ะฐั‚ัƒั€ะฐ Android ะดะปั ั‚ะตะบัั‚ะพะฒะธั… ะฟะพะปั–ะฒ ะ’ั–ะดะบั€ะธะฒะฐั” ั‚ะฐั‡ะฟะฐะด ั– ะบะปะฐะฒั–ะฐั‚ัƒั€ัƒ ะฝะฐ ะดั€ัƒะณะพะผัƒ ะตะบั€ะฐะฝั– ะฟั–ะด ั‡ะฐั ะทะฐะฟัƒัะบัƒ ัะตะฐะฝััƒ. ะ’ะฒะตะดะตะฝะฝั ะดะปั ะฒะตั€ั…ะฝัŒะพะณะพ ะตะบั€ะฐะฝะฐ ะ“ะพั‚ะพะฒะพ ะกั‚ะฐะฝะดะฐั€ั‚ะฝะธะน ะดะพะดะฐั‚ะพะบ ะณะพะปะพะฒะฝะพะณะพ ะตะบั€ะฐะฝะฐ ะ’ะธะฑะตั€ั–ั‚ัŒ ะดะพะดะฐั‚ะพะบ ะณะพะปะพะฒะฝะพะณะพ ะตะบั€ะฐะฝะฐ + ะŸั€ะธั…ะพะฒัƒะฒะฐั‚ะธ ะปะฐัƒะฝั‡ะตั€ ัƒ ัะฟะธัะบัƒ ะพัั‚ะฐะฝะฝั–ั… ะฟั€ะพะณั€ะฐะผ ะฟั–ะด ั‡ะฐั ะฟั€ะพัั‚ะพัŽ + ะ”ั–ั” ะปะธัˆะต ั‚ะพะดั–, ะบะพะปะธ DroidDeck ั” ั‚ะธะฟะพะฒะธะผ ะทะฐัั‚ะพััƒะฝะบะพะผ ะณะพะปะพะฒะฝะพะณะพ ะตะบั€ะฐะฝะฐ ะน ะฝะต ะทะฐะฟัƒั‰ะตะฝะพ ะถะพะดะฝะพะณะพ ัะตะฐะฝััƒ. ะ’ะธะฑั€ะฐั‚ะธ ะ”ะพะดะฐั‚ะบะธ Linux (ะฑะตั‚ะฐ) ะคะฐะนะปะธ @@ -1012,9 +1074,174 @@ ะŸะพะฟะตั€ะตะดะฝั–ะน ะะฐะนะฝะพะฒั–ัˆั– ะฒะธะฟั€ะฐะฒะปะตะฝะฝั, ะดะพ ัั‚ะฐะฑั–ะปัŒะฝะพะณะพ ะบะฐะฝะฐะปัƒ ะะบั‚ัƒะฐะปัŒะฝะฐ ะฒะตั€ัั–ั + ะšะพะฟั–ัŽะฒะฐั‚ะธ ะฒั–ะดะพะผะพัั‚ั– ะฟั€ะพ ะทะฑั–ั€ะบัƒ + ะ’ั–ะดะพะผะพัั‚ั– ะฟั€ะพ ะทะฑั–ั€ะบัƒ ัะบะพะฟั–ะนะพะฒะฐะฝะพ + ะะพะฒั–ัˆะฐ ะทะฐ ะŸะพะฟะตั€ะตะดะฝั–ะน + ะ’ะธ ะฒะธะฟะตั€ะตะดะถะฐั”ั‚ะต ะŸะพะฟะตั€ะตะดะฝั–ะน ะบะฐะฝะฐะป + ะฆั ะทะฑั–ั€ะบะฐ ะฝะพะฒั–ัˆะฐ ะทะฐ ะพัั‚ะฐะฝะฝัŽ ะฟะพะฟะตั€ะตะดะฝัŽ. ะ‡ั— ะพะฝะพะฒะธั‚ัŒ ะฝะฐัั‚ัƒะฟะฝะฐ ะฟะพะฟะตั€ะตะดะฝั ะทะฑั–ั€ะบะฐ. + ะ’ะธะฑะตั€ั–ั‚ัŒ ะทะฑั–ั€ะบัƒ, ั‰ะพะฑ ะฟะพะฑะฐั‡ะธั‚ะธ ะทะผั–ะฝะธ ะฐะฑะพ ะฒัั‚ะฐะฝะพะฒะธั‚ะธ ั—ั—. + ะ’ัั‚ะฐะฝะพะฒะปะตะฝะพ + ะ’ัั‚ะฐะฝะพะฒะธั‚ะธ ั†ัŽ ะทะฑั–ั€ะบัƒ%1$s + ะŸะพะฒะตั€ะฝัƒั‚ะธัั ะดะพ ั†ั–ั”ั— ะทะฑั–ั€ะบะธ%1$s + versionCode %1$d + ะšะพะผั–ั‚ %1$s + ะกั‚ะพั€ั–ะฝะบะฐ ั€ะตะปั–ะทัƒ + ะฃ PR ั” ะฝะพะฒั–ัˆะธะน ะบะพะผั–ั‚ (%1$s). ะ™ะพะณะพ ั‚ะตัั‚ะพะฒะฐ ะทะฑั–ั€ะบะฐ ั‰ะต ะฝะต ะณะพั‚ะพะฒะฐ, ั‚ะพะถ ัƒ ั†ั–ะน ะนะพะณะพ ะฝะตะผะฐั”. + ะ„ ะฝะพะฒะธะน ะบะพะผั–ั‚, ะทะฑั–ั€ะบะฐ ะพั‡ั–ะบัƒั”ั‚ัŒัั + ะะพะผะตั€ PR, ะฝะฐะทะฒะฐ ะฐะฑะพ ะฐะฒั‚ะพั€ + ะะตะผะฐั” ะฒั–ะดะฟะพะฒั–ะดะฝะธั… ั‚ะตัั‚ะพะฒะธั… ะทะฑั–ั€ะพะบ + ะŸะพั‚ั€ั–ะฑะฝะฐ ะฟะตั€ะตะทะฑั–ั€ะบะฐ (versionCode %1$d) + ะžะฝะพะฒะปะตะฝะฝั ั‚ะตัั‚ะพะฒะธั… ะทะฑั–ั€ะพะบ + ะะพะฒะฐ ั‚ะตัั‚ะพะฒะฐ ะทะฑั–ั€ะบะฐ PR #%1$d + %1$s. ะ’ั–ะดะบั€ะธะนั‚ะต ะžะฝะพะฒะปะตะฝะฝั, ั‰ะพะฑ ะฒัั‚ะฐะฝะพะฒะธั‚ะธ ั—ั—. + ะŸะพะบะฐะทะฐั‚ะธ ั‰ะต (%1$d) + ะŸะพั‚ั€ั–ะฑะฝะฐ ะฟะตั€ะตะทะฑั–ั€ะบะฐ ะดะปั versionCode %2$d (%1$d) + ะŸะพะฟะตั€ะตะดะฝั–ั… ะทะฑั–ั€ะพะบ ัƒ main ะฟั–ัะปั ั†ั–ั”ั— ั‚ะตัั‚ะพะฒะพั— ะทะฑั–ั€ะบะธ: %1$d ะขะตัั‚ะพะฒั– ะทะฑั–ั€ะบะธ ะกะฟั€ะพะฑัƒะนั‚ะต ะฒะธะฟั€ะฐะฒะปะตะฝะฝั ะดะพ ะนะพะณะพ ะฒะธะฟัƒัะบัƒ ะŸะพะบะธ ั‰ะพ ะฝะตะผะฐั” + ะ•ะบัะฟะตั€ะธะผะตะฝั‚ะฐะปัŒะฝะฐ ะทะฑั–ั€ะบะฐ + ะ•ะบัะฟะตั€ะธะผะตะฝั‚ะฐะปัŒะฝั– ะทะฑั–ั€ะบะธ + ะ’ะธะบะพั€ะธัั‚ะพะฒัƒั”ั‚ัŒัั + ะŸั€ะธะทัƒะฟะธะฝะตะฝะพ ะฟั–ัะปั ั‚ะพะณะพ, ัะบ Android ะฟะพะฒั‚ะพั€ะฝะพ ะพะฟั‚ะธะผั–ะทัƒะฒะฐะฒ DroidDeck + ะะต ะทะฐะฒะฐะฝั‚ะฐะถะตะฝะพ: %1$s + ะžั‡ั–ะบัƒั” ะฟะตั€ะตะทะฐะฟัƒัะบัƒ + ะ—ะฐะปะธัˆะตะฝะพ + ะ”ะปั ั–ะฝัˆะพั— ะฒะตั€ัั–ั— + ะŸะตั€ะตะทั–ะฑั€ะฐั‚ะธ + ะ’ะธะดะฐะปัั” ั†ัŽ ะทะฑั–ั€ะบัƒ ะท ะฟั€ะธัั‚ั€ะพัŽ + ะŸะตั€ะตะทะฐะฟัƒัั‚ะธั‚ะธ ะฝะฐ ะฝั–ะน + ะ’ะธะผะบะฝัƒั‚ะธ + ะ’ะธะบะพั€ะธัั‚ะฐั‚ะธ + ะ’ะธะดะฐะปะธั‚ะธ + ะ’ะธะดะฐะปะธั‚ะธ ะทะฐั€ะฐะท + ะะต ะฒะดะฐะปะพัั ะฟั–ะดะณะพั‚ัƒะฒะฐั‚ะธ ะฟะตั€ะตะทะฐะฟัƒัะบ: %1$s. ะกั‚ะฒะพั€ั–ั‚ัŒ ะฟะฐั€ัƒ ะดะปั ะฑะตะทะดั€ะพั‚ะพะฒะพะณะพ ะฝะฐะปะฐะณะพะดะถะตะฝะฝั ะฒ ั€ะพะทะดั–ะปั– ยซะะฐะปะฐัˆั‚ัƒะฒะฐะฝะฝัยป ั‚ะฐ ัะฟั€ะพะฑัƒะนั‚ะต ั‰ะต ั€ะฐะท. + ะ•ะบัะฟะตั€ะธะผะตะฝั‚ะฐะปัŒะฝัƒ ะทะฑั–ั€ะบัƒ ะฒัั‚ะฐะฝะพะฒะปะตะฝะพ + DroidDeck ะฟะตั€ะตะทะฐะฟัƒั‰ะตะฝะพ ะฝะฐ %1$s + ะ—ะฑั–ั€ะบัƒ Lab ะฟั€ะธะทัƒะฟะธะฝะตะฝะพ + Android ะฟะพะฒั‚ะพั€ะฝะพ ะพะฟั‚ะธะผั–ะทัƒะฒะฐะฒ DroidDeck, ั‚ะพะผัƒ %1$s ะฝะต ะทะฐะฒะฐะฝั‚ะฐะถะตะฝะพ. ะ’ั–ะดะบั€ะธะนั‚ะต ยซะžะฝะพะฒะปะตะฝะฝัยป, ั‰ะพะฑ ะฟะตั€ะตะทะฐะฟัƒัั‚ะธั‚ะธัั ะฝะฐ ั†ั–ะน ะทะฑั–ั€ั†ั–. + ะ—ะฑั–ั€ะบัƒ Lab ะฒะธะผะบะฝะตะฝะพ + ะ‡ั— ะทั–ะฑั€ะฐะฝะพ ะดะปั ั–ะฝัˆะพั— ะฒะตั€ัั–ั— DroidDeck. ะ’ะพะฝะฐ ะทะฑะตั€ั–ะณะฐั”ั‚ัŒัั ะฒ ยซะžะฝะพะฒะปะตะฝะฝัั…ยป. + DroidDeck ะดะฒั–ั‡ั– ะฝะต ะทะฐะฟัƒัั‚ะธะฒัั ะฝะฐ ั†ั–ะน ะทะฑั–ั€ั†ั– + ะะณะตะฝั‚ + ะะณะตะฝั‚ + ะะณะตะฝั‚ ะฟั€ะฐั†ัŽั” + ะ’ัั‚ะฐะฝะพะฒั–ั‚ัŒ Claude Code ัƒ ะบะพั€ะธัั‚ัƒะฒะฐั†ัŒะบะพะผัƒ ัะตั€ะตะดะพะฒะธั‰ั– Linux, ั‰ะพะฑ ะบะพั€ะธัั‚ัƒะฒะฐั‚ะธัั ะฐะณะตะฝั‚ะพะผ. + ะ—ะฐะฟะธั‚ะฐะนั‚ะต ะฟั€ะพ ะณั€ัƒ, ะทะฑั–ะน ะฐะฑะพ ะทะผั–ะฝะธ ะฒ DroidDeck + ะะฐะดั–ัะปะฐั‚ะธ + ะะพะฒะฐ ั€ะพะทะผะพะฒะฐ + ะ—ัƒะฟะธะฝะธั‚ะธ + ะกั…ะพะฒะธั‰ะต + ะ’ะธะดะฐะปะธั‚ะธ + ะ’ะธะดะฐะปะธั‚ะธ ะทะฐั€ะฐะท + Claude Code + Codex + ะ’ะธั…ั–ะดะฝะธะน ะบะพะด DroidDeck + ะšะตัˆั– ะทะฐะฒะฐะฝั‚ะฐะถะตะฝัŒ + ะ—ะผั–ะฝะธ, ัะบั– ะฝะต ะฒั–ะดะฟั€ะฐะฒะปะตะฝะพ, ะฑัƒะดะต ะฒั‚ั€ะฐั‡ะตะฝะพ + ะ—ะฑั–ั€ะบะธ ะทะฐะฒะฐะฝั‚ะฐะถะฐั‚ัŒ ั—ั… ะทะฝะพะฒัƒ + ะะฐะปะฐัˆั‚ัƒะฒะฐะฝะฝั ะทะผะพะถะต ะฒัั‚ะฐะฝะพะฒะธั‚ะธ ั†ะต ะทะฝะพะฒัƒ; ะดะฐะฝั– ะดะปั ะฒั…ะพะดัƒ ะทะฑะตั€ั–ะณะฐัŽั‚ัŒัั + DroidDeck ะฟะตั€ะตะทะฐะฟัƒัั‚ะธะฒัั ะฝะฐ ะฒะฐัˆั–ะน ะทะฑั–ั€ั†ั– Lab. ะŸั€ะพะดะพะฒะถัƒะนั‚ะต ะท ั‚ะพะณะพ ะผั–ัั†ั, ะดะต ะทัƒะฟะธะฝะธะปะธัั. + ะ—ะฐะฟะธั‚ะฐะนั‚ะต, ั‡ะพะผัƒ ะณั€ะฐ ะฝะต ะทะฐะฟัƒัะบะฐั”ั‚ัŒัั, ะฟะพะฟั€ะพัั–ั‚ัŒ ะฟะพััะฝะธั‚ะธ ะถัƒั€ะฝะฐะป ะฐะฑะพ ะทะผั–ะฝะธั‚ะธ DroidDeck ั– ะฒะธะฟั€ะพะฑัƒะฒะฐั‚ะธ ะทะผั–ะฝัƒ ะฝะฐ ั†ัŒะพะผัƒ ะฟั€ะธัั‚ั€ะพั—. + ะŸะพะผะธะปะบะฐ: %1$s + %1$s ะทะฐะฒะตั€ัˆะธะฒัั (ะบะพะด ะฒะธั…ะพะดัƒ %2$d) + ะ—ัƒะฟะธะฝะตะฝะพ + ะ—ะฐะฒะตั€ัˆะตะฝะพ ะฑะตะท ะฒั–ะดะฟะพะฒั–ะดั– + ะŸะพะฒั‚ะพั€ะธั‚ะธ + ะะฐะปะฐัˆั‚ะพะฒัƒั”ะผะพ ะฐะณะตะฝั‚ะฐ + ะŸะตั€ะตะทั–ะฑั€ะฐั‚ะธ ะผะพัŽ ะทะฑั–ั€ะบัƒ Lab %1$s ะดะปั ะฒัั‚ะฐะฝะพะฒะปะตะฝะพั— ะฒะตั€ัั–ั— DroidDeck ั– ะฟะตั€ะตะทะฐะฟัƒัั‚ะธั‚ะธัั ะฝะฐ ะฝั–ะน. + %1$s ะฝะฐ ะฒั…ะพะดั– ยท %2$s ะฝะฐ ะฒะธั…ะพะดั– + ะœั–ั€ะบัƒั” + ะœั–ั€ะบัƒะฒะฐะฝะฝั + ะœั–ั€ะบัƒั” ยท %1$s + %1$s ยท %2$s + ะ’ะฅะ†ะ” + ะ’ะ˜ะฅะ†ะ” + ะ’ะธะบะพะฝัƒั”ั‚ัŒััโ€ฆ + ะะตะผะฐั” ั€ะตะทัƒะปัŒั‚ะฐั‚ัƒ: ั…ั–ะด ะทะฐะฒะตั€ัˆะธะฒัั ั€ะฐะฝั–ัˆะต + ะะตะผะฐั” ะฒะธะฒะพะดัƒ + ะ’ะฒะตะดั–ั‚ัŒ ั‚ะตะบัั‚, ั‰ะพะฑ ะฟะพัั‚ะฐะฒะธั‚ะธ ะฝะฐัั‚ัƒะฟะฝะต ะฟะพะฒั–ะดะพะผะปะตะฝะฝั ะฒ ั‡ะตั€ะณัƒ + ะŸะพัั‚ะฐะฒะธั‚ะธ ะฒ ั‡ะตั€ะณัƒ + ะ”ะฐะปั–: %1$s + ะะต ะฝะฐะดัะธะปะฐั‚ะธ + ะŸั€ะธะบั€ั–ะฟะธั‚ะธ + ะ’ะธะดะฐะปะธั‚ะธ + ะ—ะฐ ะทะฐะผะพะฒั‡ัƒะฒะฐะฝะฝัะผ + ะ ั–ะฒะตะฝัŒ ะผั–ั€ะบัƒะฒะฐะฝัŒ + ะŸะพั‡ะฐั‚ะธ + ะŸะตั€ะตะณะปัะฝัƒั‚ะธ + ะŸะพะบะธ ะฝั–ั‡ะพะณะพ ะฝะต ะทะผั–ะฝะตะฝะพ + ะ’ะธะบะพะฝะฐะนั‚ะต ะฟะปะฐะฝ. + ะะฐะดั–ัะปะฐั‚ะธ ะทะฐั€ะฐะท + ะฉะต + ะ—ะฐะบั€ะธั‚ะธ + ะะฐะนะฝะพะฒั–ัˆะต + ะŸั€ะฐั†ัŽั” + ะšะพะฝั‚ะตะบัั‚ + %1$s ะท %2$s + ะฆั ั€ะพะทะผะพะฒะฐ ยท %1$s + ะ’ะธะบะพั€ะธัั‚ะฐะฝะฝั ะฒั–ะดะพะฑั€ะฐะทะธั‚ัŒัั ะฟั–ัะปั ะฟะตั€ัˆะพั— ะฒั–ะดะฟะพะฒั–ะดั– + %1$d-ะณะพะดะธะฝะฝะธะน ะปั–ะผั–ั‚ + %1$d-ั…ะฒะธะปะธะฝะฝะธะน ะปั–ะผั–ั‚ + ะขะธะถะฝะตะฒะธะน ะปั–ะผั–ั‚ + %1$d%% ยท ัะบะธะดะฐะฝะฝั %2$s + + %1$d ั„ะฐะนะปะธ + %1$d ั„ะฐะนะปั–ะฒ + %1$d ั„ะฐะนะป + %1$d ั„ะฐะนะปั–ะฒ + + ะกะฟะพั‡ะฐั‚ะบัƒ ะฟะปะฐะฝ + ะŸะปะฐะฝ + ะŸั€ะพะฟะพะฝัƒั” ะฟะปะฐะฝ, ะฝั–ั‡ะพะณะพ ะฝะต ะทะผั–ะฝัŽัŽั‡ะธ + ะ ะพะทะผะพะฒะธ + ะ ะพะทะผะพะฒ ั‰ะต ะฝะตะผะฐั” + ะฉะพะนะฝะพ + ะ’ะธะดะฐะปะธั‚ะธ + ะ’ะธะดะฐะปัั” ั€ะพะทะผะพะฒัƒ ั‚ะฐ ั—ั— ะฒะบะปะฐะดะตะฝะฝั + ะŸั€ะพั†ะตัะธ + ะฃ ะบะพั€ะธัั‚ัƒะฒะฐั†ัŒะบะพะผัƒ ะฟั€ะพัั‚ะพั€ั– Linux ะฝั–ั‡ะพะณะพ ะฝะต ะทะฐะฟัƒั‰ะตะฝะพ + ะะ“ะ•ะะข + ะ—ัƒะฟะธะฝะธั‚ะธ + ะ›ะฐะฑะพั€ะฐั‚ะพั€ะฝะฐ ะทะฑั–ั€ะบะฐ + ะŸั–ะดะณะพั‚ะพะฒะบะฐ ะปะฐะฑะพั€ะฐั‚ะพั€ะฝะธั… ะทะฑั–ั€ะพะบ + %1$d%% ยท ะทะฐะปะธัˆะธะปะพัั ะฑะปะธะทัŒะบะพ %2$s + ะ—ะฐะปะธัˆะธะปะพัั ะฑะปะธะทัŒะบะพ %1$s + ะกะบะฐััƒะฒะฐั‚ะธ + ะกะบะฐััƒะฒะฐั‚ะธ ะทะฑั–ั€ะบัƒ + ะ—ะฐะฟัƒัะบ + %1$d%% + ะŸะฐะบัƒะฒะฐะฝะฝั + ะŸะตั€ะตะทะฐะฟัƒัะบ DroidDeck ะฝะฐ ะฝั–ะน + ะ“ะพั‚ะพะฒะพ + ะะต ะฒะดะฐะปะพัั: %1$s + ะะฐะปะฐัˆั‚ัƒะฒะฐั‚ะธ ะฐะณะตะฝั‚ะฐ + ะกะฟะพั‡ะฐั‚ะบัƒ ะฒัั‚ะฐะฝะพะฒั–ั‚ัŒ ัะตั€ะตะดะพะฒะธั‰ะต ะฒะธะบะพะฝะฐะฝะฝั Linux ัƒ ั€ะพะทะดั–ะปั– ะะฐะปะฐัˆั‚ัƒะฒะฐะฝะฝั. + ะŸะพะฒั‚ะพั€ะธั‚ะธ + ะŸะพั‡ะฐั‚ะธ ั€ะพะทะผะพะฒัƒ + ะŸั–ะดะบะปัŽั‡ะตะฝะฝั ะฟั€ะธัั‚ั€ะพัŽ + ะ‘ะตะทะดั€ะพั‚ะพะฒะต ะฝะฐะปะฐะณะพะดะถะตะฝะฝั, ั‰ะพะฑ ะฐะณะตะฝั‚ ะผั–ะณ ะฑะฐั‡ะธั‚ะธ DroidDeck ั– ะบะตั€ัƒะฒะฐั‚ะธ ะฝะธะผ + ะ’ัั‚ะฐะฝะพะฒะธั‚ะธ %1$s + ะฃ ะบะพั€ะธัั‚ัƒะฒะฐั†ัŒะบะธะน ะฟั€ะพัั‚ั–ั€ Linux, ั–ะท git, gh ั‚ะฐ adb + ะฃะฒั–ะนั‚ะธ ะฒ %1$s + ะ’ั–ะดะบั€ะธั” ะฑั€ะฐัƒะทะตั€ + GitHub + ะะตะพะฑะพะฒโ€™ัะทะบะพะฒะพ, ั‰ะพะฑ ะฒั–ะดะบั€ะธะฒะฐั‚ะธ pull requests + ะ†ะฝัั‚ั€ัƒะผะตะฝั‚ะธ ะทะฑะธั€ะฐะฝะฝั + ะะตะพะฑะพะฒโ€™ัะทะบะพะฒะพ, ะดะปั ะทะฑะธั€ะฐะฝัŒ Lab ะฝะฐ ั†ัŒะพะผัƒ ะฟั€ะธัั‚ั€ะพั— ยท ะฑะปะธะทัŒะบะพ 5 ะ“ะ‘ + ะะณะตะฝั‚ ะณะพั‚ะพะฒะธะน + ะ—ะฐะฒะตั€ัˆั–ั‚ัŒ ะฝะฐะปะฐัˆั‚ัƒะฒะฐะฝะฝั ะฐะณะตะฝั‚ะฐ + ะ’ะธ ัƒะฒั–ะนัˆะปะธ ะฒ %1$s + ะ—ะฑะธั€ะฐะฝะฝั Lab + ัˆะฒะธะดะบั– ะทะฑะธั€ะฐะฝะฝั + ะจะฒะธะดะบั– ะทะฑะธั€ะฐะฝะฝั Lab + ะšะพะผะฟั–ะปัŽั” ั†ัŽ ะฒะตั€ัั–ัŽ ะทะฐะทะดะฐะปะตะณั–ะดัŒ, ั‚ะพะผัƒ ะทะฑะธั€ะฐะฝะฝั Lab ะทะฐะนะผะฐัŽั‚ัŒ ะบั–ะปัŒะบะฐ ั…ะฒะธะปะธะฝ ยท ะฑะปะธะทัŒะบะพ 20 ั…ะฒะธะปะธะฝ ะพะดะธะฝ ั€ะฐะท + ะšะพะผะฟั–ะปัั†ั–ั ยท %1$d%% ยท ะทะฐะปะธัˆะธะปะพัั ะฑะปะธะทัŒะบะพ %2$s + ะŸั–ะดะณะพั‚ัƒะฒะฐั‚ะธ + ะ‘ะตะทะดั€ะพั‚ะพะฒะต ะฝะฐะปะฐะณะพะดะถะตะฝะฝั ะฝะตะดะพัั‚ัƒะฟะฝะต; ยซะกะฟะพะปัƒั‡ะธั‚ะธยป ัƒะฒั–ะผะบะฝะต ะนะพะณะพ + ะกะฟะพะปัƒั‡ะธั‚ะธ + ะฃัั‚ะฐะฝะพะฒะธั‚ะธ + ะฃะฒั–ะนั‚ะธ PR #%1$d ะะต ะทั–ะฑั€ะฐะฝะพ ะดะปั ั†ั–ั”ั— ะบะพะฟั–ั— DroidDeck ะžะฝะพะฒะปะตะฝะพ %1$s @@ -1262,6 +1489,9 @@ ะ”ะพะดะฐั‚ะบะธ ะะฐะปะฐัˆั‚ัƒะฒะฐะฝะฝั ะžะฝะพะฒะปะตะฝะฝั + ะฉะต + ะ ะตะดะฐะณัƒะฒะฐั‚ะธ ะฒะบะปะฐะดะบะธ + ะ’ะบะปะฐะดะบะธ %1$d%% ะŸั€ะพะดะพะฒะถะธั‚ะธ %1$s ะฃ ะบะพะถะฝะพะผัƒ ัะตะฐะฝัั– ะทโ€™ัะฒะปัั”ั‚ัŒัั ัะบ /root/ROMs. ะ’ะฝัƒั‚ั€ั–ัˆะฝั ะฟะฐะผโ€™ัั‚ัŒ ะดะพัั‚ัƒะฟะฝะฐ ะฒ /root/Storage. @@ -1283,6 +1513,15 @@ ะŸั€ะธะฑั€ะฐั‚ะธ ะท ั‡ะตั€ะณะธ ะšะปะฐะฒั–ะฐั‚ัƒั€ะฐ Android ะกั…ะพะฒะฐั‚ะธ โœ• + ะ ะพะทะผั–ั€ ะฝะฐ ะตะบั€ะฐะฝั– + ะงะฐัั‚ะบะฐ ะตะบั€ะฐะฝะฐ, ัะบัƒ ะทะฐะนะผะฐั” ะบะปะฐะฒั–ะฐั‚ัƒั€ะฐ, ะฒะบะปัŽั‡ะฝะพ ะท ะทะฐะณะพะปะพะฒะบะพะผ. + ะะตะฟั€ะพะทะพั€ั–ัั‚ัŒ + ะ—ะผะตะฝัˆั‚ะต, ั‰ะพะฑ ะฑะฐั‡ะธั‚ะธ ะณั€ัƒ ะฟั–ะด ะบะปะฐะฒั–ะฐั‚ัƒั€ะพัŽ. + ะŸั€ะธั…ะพะฒะฐะฝั– ะบะปะฐะฒั–ัˆั– + ะšะปะฐะฒั–ัˆั–, ัะบะธะผะธ ะฒะธ ั€ั–ะดะบะพ ะบะพั€ะธัั‚ัƒั”ั‚ะตัั, ะฝะต ะฒั–ะดะพะฑั€ะฐะถะฐัŽั‚ัŒัั ะฝะฐ ะบะปะฐะฒั–ะฐั‚ัƒั€ั–. + Esc ั– ั€ัะดะพะบ ั„ัƒะฝะบั†ั–ะนะฝะธั… ะบะปะฐะฒั–ัˆ + Ins / Del / Home / End / PgUp / PgDn + ะšะปะฐะฒั–ัˆั– ะทั– ัั‚ั€ั–ะปะบะฐะผะธ ะ—ะฐะฟัƒัั‚ะธั‚ะธ %1$s ะ’ะธะฑะตั€ั–ั‚ัŒ ะตะบั€ะฐะฝ. ะ”ะพะดะฐั‚ะบะพะฒะธะน: %1$s. ะ”ะพะดะฐั‚ะบะพะฒะธะน ะดะธัะฟะปะตะน ะฑั–ะปัŒัˆะต ะฝะต ะดะพัั‚ัƒะฟะฝะธะน. @@ -1818,7 +2057,24 @@ ะขะตั€ะผั–ะฝะฐะป ะ—ะฐะดะฝั– ะบะฝะพะฟะบะธ + ั‚ั€ะตะบะฟะฐะดะธ Deck ะŸะฐะฝะตะปัŒ + ะ ะพะฑะพั‡ะธะน ัั‚ั–ะป + ะ—ะฐะฟัƒัั‚ะธั‚ะธ ั€ะพะฑะพั‡ะธะน ัั‚ั–ะป + ะ ะพะฑะพั‡ะธะน ัั‚ั–ะป ยท %1$s + ะขะฐั‡ะฟะฐะด + ะŸั€ัะผะธะน ะดะพั‚ะธะบ + ะขะฐั‡ะฟะฐะด. ะขะพั€ะบะฝั–ั‚ัŒัั, ั‰ะพะฑ ะฟะตั€ะตะนั‚ะธ ะฝะฐ ะฟั€ัะผะธะน ะดะพั‚ะธะบ + ะŸั€ัะผะธะน ะดะพั‚ะธะบ. ะขะพั€ะบะฝั–ั‚ัŒัั, ั‰ะพะฑ ะฟะตั€ะตะนั‚ะธ ะฝะฐ ั‚ะฐั‡ะฟะฐะด + ะ—ะฐะฟัƒัะบ ั€ะพะฑะพั‡ะพะณะพ ัั‚ะพะปะฐ KDEโ€ฆ + ะ ะพะฑะพั‡ะธะน ัั‚ั–ะป ะทะฐะบั€ะธะฒัั. + ะะต ะฒะดะฐะปะพัั ะทะฐะฟัƒัั‚ะธั‚ะธ ั€ะพะฑะพั‡ะธะน ัั‚ั–ะป. ะ™ะพะณะพ ะถัƒั€ะฝะฐะปะธ โ€” ัƒ ะฟะฐะฟั†ั– bottom-desktop ั†ัŒะพะณะพ ัะตะฐะฝััƒ. + ะ ะพะฑะพั‡ะธะน ัั‚ั–ะป ะทะฐะบั€ะธั‚ะพ. ะขัƒั‚ ะฟะพะบะธ ะฝั–ั‡ะพะณะพ ะฟะพะบะฐะทะฐั‚ะธ. + ะŸะพะผั–ะฝัั‚ะธ ะตะบั€ะฐะฝะธ ะผั–ัั†ัะผะธ + ะะธะถะฝั–ะน ะตะบั€ะฐะฝ ะทะฐั€ะฐะท ะทะฐะนะฝัั‚ะธะน + ะ†ะณั€ะพะฒะธะน ะตะบั€ะฐะฝ + ะŸะพะบะฐะทัƒะฒะฐั‚ะธ ะณั€ัƒ ะฝะฐ + ะ’ะตั€ั…ะฝั–ะน ะตะบั€ะฐะฝ + ะะธะถะฝั–ะน ะตะบั€ะฐะฝ ะ—ะฐะฒะฐะฝั‚ะฐะถะตะฝะฝั ะะตะผะฐั” ะฐะบั‚ะธะฒะฝะธั… ะทะฐะฒะฐะฝั‚ะฐะถะตะฝัŒ. Steam @@ -1853,6 +2109,20 @@ ะŸะฐะปัŒะฝะต, t ะžัะฝะพะฒะฝะต %1$s t ะ ะตะทะตั€ะฒ %1$s t + ะงะฐั ะบะฐะดั€ัƒ + ะทะฐ ะพัั‚ะฐะฝะฝั– %1$d ั + ัƒ ัะตั€ะตะดะฝัŒะพะผัƒ + ะฝะฐะนะฝะธะถั‡ั– 1% + ะบะฐะดั€ะธ ะฟะพะฝะฐะด 33 ะผั + %1$d / ั…ะฒ + ะฃ ะณั€ั– ะฒะถะต %1$s + %1$d ัะดะตั€, ะดะพ %2$s ะ“ะ“ั† + %1$d ัะดะตั€ + ะณั€ะฐ + FPS ะฝะฐ %1$d ะ“ั† + ะงะตั€ะฒะพะฝะฐ ะฟะพะทะฝะฐั‡ะบะฐ โ€” ั†ะต ะฟะพั€ั–ะณ, ะฟั–ัะปั ัะบะพะณะพ HUD ะฟะพะบะฐะทัƒั” ั‚ะตะผะฟะตั€ะฐั‚ัƒั€ัƒ ั‡ะตั€ะฒะพะฝะธะผ. + ะฒะตััŒ ะฟั€ะธัั‚ั€ั–ะน + ะฐะบัƒะผัƒะปัั‚ะพั€ ะะฐะดัะธะปะฐั‚ะธ ะดะฐะฝั– ะดะปั ะฟะฐะฝะตะปั– ะะฒั‚ะพะผะฐั‚ะธั‡ะฝะพ ะ’ะผะธะบะฐั” ั†ะต ะดะปั ะบะพะถะฝะพั— ะณั€ะธ ะฒ ั†ัŒะพะผัƒ ัะฟะธัะบัƒ, ะทะพะบั€ะตะผะฐ ะดะปั ะทะฝะฐะนะดะตะฝะธั… ะฟั–ะทะฝั–ัˆะต. ะ†ะณั€ะธ, ัะบั– ะฒะธ ะฒะธะผะบะฝะตั‚ะต, ะปะธัˆะฐัŽั‚ัŒัั ะฒะธะผะบะฝะตะฝะธะผะธ. @@ -1876,6 +2146,10 @@ ะ”ะปั ั†ั–ั”ั— ะณั€ะธ ะผั–ะบั€ะพั„ะพะฝ ะฒะธะผะบะฝะตะฝะพ. ะฉะพะฑ ะณะพะฒะพั€ะธั‚ะธ, ัƒะฒั–ะผะบะฝั–ั‚ัŒ ยซะœั–ะบั€ะพั„ะพะฝยป ัƒ ะฝะฐะปะฐัˆั‚ัƒะฒะฐะฝะฝัั… Steam ัƒ DroidDeck (ะ—ะฒัƒะบ) ั– ะทะฐะฟัƒัั‚ั–ั‚ัŒ ะณั€ัƒ ะทะฝะพะฒัƒ. ะ“ัƒั‡ะฝั–ัั‚ัŒ %1$d%% ะ†ะณั€ะพะฒะฐ ัั‚ะฐั‚ะธัั‚ะธะบะฐ + HUD ะฝะฐ ะฝะธะถะฝัŒะพะผัƒ ะตะบั€ะฐะฝั– + ะกะผัƒะณะฐ ะฝะฐ ะบะพะถะฝั–ะน ะฒะบะปะฐะดั†ั– + ะะฐะนะฝะธะถั‡ั– 1% ั– 0,1% + ะขะตะผะฟะตั€ะฐั‚ัƒั€ะฐ ะฟั€ะพั†ะตัะพั€ะฐ FPS CPU GPU @@ -2050,6 +2324,7 @@ ะ—ะฐะฟัƒัะบ ัะตะฐะฝััƒโ€ฆ %1$d:%2$02d ะผะธะฝัƒะปะพ ยท ะดะพัั– ั‚ั€ะธะฒะฐั” ะ—ะฐะฒะฐะฝั‚ะฐะถะตะฝะฝั ะพะฝะพะฒะปะตะฝะฝั ะบะปั–ั”ะฝั‚ะฐ Steam ยท %1$d%% + ะ—ะฐัั‚ะพััƒะฒะฐะฝะฝั ะพะฝะพะฒะปะตะฝะฝั ะบะปั–ั”ะฝั‚ะฐ Steamโ€ฆ ะ—ะฐะฒะฐะฝั‚ะฐะถะตะฝะฝั ะบะปั–ั”ะฝั‚ะฐ Steam ยท %1$s ะ’ัั‚ะฐะฝะพะฒะปะตะฝะฝั ั–ะฝัั‚ั€ัƒะผะตะฝั‚ะฐ ััƒะผั–ัะฝะพัั‚ั– ะฒะถะต ั‚ั€ะธะฒะฐั” @@ -2126,11 +2401,29 @@ ะšะพะฝั‚ัƒั€ะธ ัƒ ัั‚ะธะปั– ะผัƒะปัŒั‚ั„ั–ะปัŒะผัƒ ะฟะปัŽั ั€ั–ะทะบั–ัั‚ัŒ. ะะต GPU Adreno + ะกะธัั‚ะตะผะฝะธะน ะดั€ะฐะนะฒะตั€ PowerVR: ััƒะผั–ัะฝั–ัั‚ัŒ ะทะฐะปะตะถะธั‚ัŒ ะฒั–ะด ะฟั€ะธัั‚ั€ะพัŽ + ะ•ะบัะฟะตั€ะธะผะตะฝั‚ะฐะปัŒะฝะพ: RADV ะฐะฑะพ ัะธัั‚ะตะผะฝะธะน ะดั€ะฐะนะฒะตั€ Xclipse + ะกะธัั‚ะตะผะฝะธะน PowerVR + ะ’ะธะบะพั€ะธัั‚ะพะฒัƒั” ะฒะฑัƒะดะพะฒะฐะฝั– ะดั€ะฐะนะฒะตั€ะธ ะดะปั ั†ัŒะพะณะพ ะณั€ะฐั„ั–ั‡ะฝะพะณะพ ะฟั€ะพั†ะตัะพั€ะฐ + ะ”ะปั ัะตั€ะตะดะพะฒะธั‰ะฐ ะฒะธะบะพะฝะฐะฝะฝั ั‚ะฐ ะฒั–ะดะพะฑั€ะฐะถะตะฝะฝั ะฒะธะฑั€ะฐะฝะพ ัะธัั‚ะตะผะฝะธะน ะดั€ะฐะนะฒะตั€ PowerVR. + ะ–ะพะดะตะฝ ะฒั–ะดะบั€ะธั‚ะธะน ะดั€ะฐะนะฒะตั€ ั‰ะต ะฝะต ะฟั–ะดั‚ั€ะธะผัƒั” ั†ะตะน Mali: ัƒะฒั–ะผะบะฝะตะฝะพ ะผั–ัั‚ Mali. + ะฆะต ั‚ะตัั‚ะพะฒะฐ ะทะฑั–ั€ะบะฐ ะดะปั ะฟั€ะธัั‚ั€ะพั—ะฒ ะฑะตะท Snapdragon: ะพั„ั–ั†ั–ะนะฝั– ะทะฑั–ั€ะบะธ ั‚ัƒั‚ ะฟั€ะฐั†ัŽัŽั‚ัŒ ะปะธัˆะต ะฝะฐ Adreno, ั‚ะพะผัƒ ั—ั… ะฝะต ะฒัั‚ะฐะฝะพะฒะปัŽัŽั‚ัŒ ะฟะพะฒะตั€ั… ะฝะตั—. ะะพะฒั– ั‚ะตัั‚ะพะฒั– ะทะฑั–ั€ะบะธ ั€ะพะทะผั–ั‰ะตะฝะพ ะฝะฐ github.com/The412Banner/droiddeck-nonadreno-drivers. + ะžัั‚ะฐะฝะฝั–ะน ัะตะฐะฝั ะทะฐะฒะตั€ัˆะธะฒัั ั‚ะพะผัƒ, ั‰ะพ Android ะทะฐะบั€ะธะฒ DroidDeck, ั‰ะพะฑ ะทะฒั–ะปัŒะฝะธั‚ะธ ะฟะฐะผ\'ัั‚ัŒ, ะฐ ะฝะต ั‡ะตั€ะตะท ะทะฑั–ะน. ะ—ะฐะบั€ะธะนั‚ะต ั–ะฝัˆั– ะฟั€ะพะณั€ะฐะผะธ ะฐะฑะพ ะทะฝะธะทัŒั‚ะต ะฝะฐะปะฐัˆั‚ัƒะฒะฐะฝะฝั ั‚ะตะบัั‚ัƒั€ ะณั€ะธ, ะฟะพั‚ั–ะผ ัะฟั€ะพะฑัƒะนั‚ะต ะทะฝะพะฒัƒ. + Mali (Venus) + ะผั–ัั‚ Mali + ะ–ะพะดะตะฝ ะฒั–ะดะบั€ะธั‚ะธะน ะดั€ะฐะนะฒะตั€ ั‰ะต ะฝะต ะฟั–ะดั‚ั€ะธะผัƒั” ั†ะตะน Mali: ะฒะธะบะพั€ะธัั‚ะพะฒัƒั”ั‚ัŒัั %1$s ะฝะฐ ะฒะปะฐัะฝะพะผัƒ ะดั€ะฐะนะฒะตั€ั– ั‚ะตะปะตั„ะพะฝัƒ. + %1$s ั‰ะต ะฝะต ะพะฟัƒะฑะปั–ะบะพะฒะฐะฝะพ: ะฟะพะบะธ ั‰ะพ ะฒะธะบะพั€ะธัั‚ะพะฒัƒั”ั‚ัŒัั %2$s. + %1$s ะฝะตะดะพัั‚ัƒะฟะฝะธะน, ะฐ ะดั€ะฐะนะฒะตั€ ั†ัŒะพะณะพ ั‚ะตะปะตั„ะพะฝัƒ ะฟะพะฒั–ะดะพะผะปัั” Vulkan %2$s (Venus ะฟะพั‚ั€ะตะฑัƒั” 1.2): ะฒะธะบะพั€ะธัั‚ะพะฒัƒั”ั‚ัŒัั ะผั–ัั‚ Mali. + %1$s ั‰ะต ะฝะต ะพะฟัƒะฑะปั–ะบะพะฒะฐะฝะพ: ะดะพ ั‚ะพะณะพ ั‡ะฐััƒ ัƒะฒั–ะผะบะฝะตะฝะพ ะผั–ัั‚ Mali. + ะฃ ั‡ะตั€ะทั–: %1$s (ะพั‡ั–ะบัƒะฒะฐะฝะฝั ั–ะฝัˆะพะณะพ ะดั€ะฐะนะฒะตั€ะฐ ัะตั€ะตะดะพะฒะธั‰ะฐ ะฒะธะบะพะฝะฐะฝะฝั) + DXVK ะฝะฐะดะฐั”ั‚ัŒัั ัะธัั‚ะตะผะฝะธะผ ัะตั€ะตะดะพะฒะธั‰ะตะผ ะฒะธะบะพะฝะฐะฝะฝั PowerVR. ะ†ะฝัˆั– ะฟะฐะบะตั‚ะธ DXVK ะผะพะถะฝะฐ ะทะฑะตั€ั–ะณะฐั‚ะธ, ะฐะปะต ะท ั†ะธะผ ะดั€ะฐะนะฒะตั€ะพะผ ะฒะพะฝะธ ะฝะต ะทะฐัั‚ะพัะพะฒัƒัŽั‚ัŒัั. ะŸั–ะดั‚ั€ะธะผัƒั”ั‚ัŒัั ะ•ะบัะฟะตั€ะธะผะตะฝั‚ะฐะปัŒะฝะพ: ะนะพะณะพ ะดั€ะฐะนะฒะตั€ะธ - ั‚ะตัั‚ะพะฒั– ะทะฑั–ั€ะบะธ ะ•ะบัะฟะตั€ะธะผะตะฝั‚ะฐะปัŒะฝะฐ ะฟั–ะดั‚ั€ะธะผะบะฐ Adreno 850: ะฟะพั‚ั€ั–ะฑะฝั– ััƒะผั–ัะฝั– ะตะบัะฟะตั€ะธะผะตะฝั‚ะฐะปัŒะฝั– ะดั€ะฐะนะฒะตั€ะธ ะดะธัะฟะปะตั ั‚ะฐ ั–ะณะพั€; ะฝะต ะฟะตั€ะตะฒั–ั€ะตะฝะพ ะฝะฐ ั†ัŒะพะผัƒ ะฟั€ะธัั‚ั€ะพั— ะะธะถั‡ะต ะทะฐ ะฟั€ะพั‚ะตัั‚ะพะฒะฐะฝะต ะพะฑะปะฐะดะฝะฐะฝะฝั (Adreno 725 ั– ะฝะพะฒั–ัˆั–): ะผะพะถะต ะฝะต ะทะฐะฟั€ะฐั†ัŽะฒะฐั‚ะธ ะะต ะฟั–ะดั‚ั€ะธะผัƒั”ั‚ัŒัั: ะดะปั ั†ัŒะพะณะพ GPU ะฝะตะผะฐั” ััƒะผั–ัะฝะพะณะพ ะณั€ะฐั„ั–ั‡ะฝะพะณะพ ะฑะตะบะตะฝะดะฐ + ะŸั€ะฐั†ัŽั” ั‡ะตั€ะตะท ะผั–ัั‚ Mali ะฝะฐ ะฒะปะฐัะฝะพะผัƒ ะดั€ะฐะนะฒะตั€ั– Vulkan ั‚ะตะปะตั„ะพะฝัƒ + ะะต ะฟั–ะดั‚ั€ะธะผัƒั”ั‚ัŒัั, ะบะพะปะธ ะผั–ัั‚ Mali ะฒะธะผะบะฝะตะฝะพ: Turnip ะฟะพั‚ั€ะตะฑัƒั” GPU Adreno (Snapdragon) ะŸะตั€ะตะฒะธั‰ะตะฝะพ ะปั–ะผั–ั‚ ะทะฐะฟะธั‚ั–ะฒ GitHub - ัะฟั€ะพะฑัƒะนั‚ะต ะฟั–ะทะฝั–ัˆะต GitHub ะฒั–ะดะฟะพะฒั–ะฒ HTTP %1$d @@ -2239,7 +2532,6 @@ ะœะฐะณะฐะทะธะฝะธ Steam ะ’ะปะฐัะฝะฐ - ะœะฐะณะฐะทะธะฝะธ ะ ั–ะฒะตะฝัŒ ัˆะฒะธะดะบะพัั‚ั– ะทะฐะฒะฐะฝั‚ะฐะถะตะฝะฝั ะ—ะฑะฐะปะฐะฝัะพะฒะฐะฝะธะน ะจะฒะธะดะบะธะน @@ -2278,6 +2570,7 @@ ะžั‡ั–ะบัƒะฒะฐะฝะฝั ั–ะฝัˆะพะณะพ ะทะฐะฒะฐะฝั‚ะฐะถะตะฝะฝั Battle.netโ€ฆ ะ’ั–ะดะบั€ะธะนั‚ะต Battle.net ั– ัƒะฒั–ะนะดั–ั‚ัŒ ะพะดะธะฝ ั€ะฐะท, ะฟะพั‚ั–ะผ ะฒัั‚ะฐะฝะพะฒะปัŽะนั‚ะต ะนะพะณะพ ั–ะณั€ะธ ั‚ัƒั‚. ะ—ะฐะฒะฐะฝั‚ะฐะถัƒะฒะฐั‡ Blizzard ะทัƒะฟะธะฝะธะฒัั: %1$s + ะ—ะฐะฒะฐะฝั‚ะฐะถัƒะฒะฐั‡ Blizzard ะฟะตั€ะตัั‚ะฐะฒ ะฟั€ะพััƒะฒะฐั‚ะธัั. ะŸะพะผะธะปะบะฐ Blizzard %1$s ะžะฝะพะฒะธั‚ะธ ะ†ะณั€ะธ Blizzard @@ -2285,6 +2578,7 @@ ะŸะตั€ะตั€ะฒะฐะฝะพ ะ’ัั‚ะฐะฝะพะฒะธั‚ะธ ยท %1$s ะžั‚ั€ะธะผะฐั‚ะธ ะฑะตะทะบะพัˆั‚ะพะฒะฝะพ + ะ”ะพะดะฐะฒะฐะฝะฝั ะดะพ ะฑั–ะฑะปั–ะพั‚ะตะบะธโ€ฆ ะŸะตั€ะตะณะปัะฝัƒั‚ะธ ะฝะฐ %1$s ะšัƒะฟะธั‚ะธ ยท %1$s ะ’ัั‚ะฐะฝะพะฒะปะตะฝะพ @@ -2331,6 +2625,12 @@ ะกะพั€ั‚ัƒะฒะฐั‚ะธ ะŸั–ะดะฟะธัะธ ะฑั–ั‡ะฝะพั— ะฟะฐะฝะตะปั– ะŸะพะบะฐะทัƒะฒะฐั‚ะธ ะฝะฐะทะฒะธ ะฟั–ะด ะทะฝะฐั‡ะบะฐะผะธ ะฑั–ั‡ะฝะพั— ะฟะฐะฝะตะปั–. ะ’ะธะผะบะฝั–ั‚ัŒ, ั‰ะพะฑ ะทั€ะพะฑะธั‚ะธ ะฟะฐะฝะตะปัŒ ะฒัƒะถั‡ะพัŽ. + ะ’ั–ั€ั‚ัƒะฐะปัŒะฝะธะน ัƒะปัŽะฑะปะตะฝะตั†ัŒ ะฐะณะตะฝั‚ะฐ + DeeDee ะฒั–ะดะพะฑั€ะฐะถะฐั”ั‚ัŒัั ะฟะพะฒะตั€ั… ะปะฐัƒะฝั‡ะตั€ะฐ ั‚ะฐ ั–ะณะพั€ ั– ะฟะพะบะฐะทัƒั”, ั‰ะพ ั€ะพะฑะธั‚ัŒ ะฐะณะตะฝั‚. + ะŸะพะฒะตั€ั… ั–ะฝัˆะธั… ะทะฐัั‚ะพััƒะฝะบั–ะฒ + ะ”ะพะทะฒะพะปะธั‚ะธ DeeDee ะฒั–ะดะพะฑั€ะฐะถะฐั‚ะธัั ะฟะพะฒะตั€ั… ัƒัั–ั… ะทะฐัั‚ะพััƒะฝะบั–ะฒ ั– ะฒั–ะดะบั€ะธะฒะฐั‚ะธ ั‚ะฐะผ ั‡ะฐั‚ + ะ”ะพะทะฒะพะปะธั‚ะธ + ะงะฐั‚ ะท DeeDee ะ’ะธะณะปัะด ะ’ะตะปะธะบั– ะบะฐั€ั‚ะบะธ ะœะฐะปั– ะบะฐั€ั‚ะบะธ @@ -2619,7 +2919,14 @@ %1$s ยท ะฟะพั‚ั€ั–ะฑะตะฝ ะฟะตั€ะตะทะฐะฟัƒัะบ ะฆะตะน ะฟั€ะธัั‚ั€ั–ะน ะ’ะธะดะฐะปะธั‚ะธ %1$s? - ะ”ั–ะฐะณะฝะพัั‚ะธะบะฐ + ะ ะพะทั€ะพะฑะฝะธะบ + ะ’ะพะดัะฝะธะน ะทะฝะฐะบ ั–ะท ะผั–ั‚ะบะพัŽ ะทะฑั–ั€ะบะธ + ะŸะพะบะฐะทัƒะฒะฐั‚ะธ ะฝะฐ ะตะบั€ะฐะฝั– ะผั–ั‚ะบัƒ ั‚ะตัั‚ะพะฒะพั— ะทะฑั–ั€ะบะธ ะฐะฑะพ ะทะฑั–ั€ะบะธ Lab. ะฃะฒั–ะผะบะฝะตะฝะพ ะทะฐ ะทะฐะผะพะฒั‡ัƒะฒะฐะฝะฝัะผ. + ะŸะพะดั–ะปะธั‚ะธัั ะฟะฐะบะตั‚ะฐะผะธ ะดั–ะฐะณะฝะพัั‚ะธะบะธ + ะกะตะฐะฝั ั– ะฟั€ะธัั‚ั€ั–ะน + ะ“ั€ะฐั„ั–ะบะฐ + ะ†ะณั€ะธ ั‚ะฐ ััƒะผั–ัะฝั–ัั‚ัŒ + ะฃัั– ะฟะฐะบะตั‚ะธ ะ“ะพั‚ะพะฒะพ ะดะพ ะณั€ะธ ะฉะต ะฝะต ะณะพั‚ะพะฒะพ ะดะพ ะณั€ะธ ัะตั€ะตะดะพะฒะธั‰ะต %1$s @@ -2658,6 +2965,9 @@ ะฃะฒั–ะผะบะฝั–ั‚ัŒ ะดะพััะณะฝะตะฝะฝั GOG ัƒ ะฝะฐะปะฐัˆั‚ัƒะฒะฐะฝะฝัั… ะผะฐะณะฐะทะธะฝั–ะฒ ะ”ะพััะณะฝะตะฝะฝั ะฝะตะดะพัั‚ัƒะฟะฝั–; ะฟะตั€ะตะฒั–ั€ั‚ะต ะถัƒั€ะฝะฐะปะธ ัะตัั–ั— ะ”ะพััะณะฝะตะฝะฝั ะฒั–ะดะบั€ะธั‚ะพ + Mali (Venus): ะฒะธะผะบะฝะตะฝะพ + Mali (Venus): ัƒะฒั–ะผะบะฝะตะฝะพ + ะ”ั€ะฐะนะฒะตั€ ะฝะฐ %1$s ะฟะพะฒั–ะดะพะผะปัั” Vulkan %2$s. Mali (Venus) ะฟะพั‚ั€ะตะฑัƒั” Vulkan 1.2 ะฐะฑะพ ะฝะพะฒั–ัˆะพั— ะฒะตั€ัั–ั— (ะฝะฐ ัั‚ะฐั€ั–ัˆะธั… gamescope ะฝะต ะทะฐะฟัƒัะบะฐั”ั‚ัŒัั), ั‚ะพะผัƒ ัะตะฐะฝัะธ ะฟั€ะพะฟัƒัะบะฐัŽั‚ัŒ Venus ั– ะฝะฐั‚ะพะผั–ัั‚ัŒ ะฒะธะบะพั€ะธัั‚ะพะฒัƒัŽั‚ัŒ ะฟะฐั€ัƒ ะดั€ะฐะนะฒะตั€ั–ะฒ PanVK. ะ’ัั‚ะฐะฒะธั‚ะธ ะ›ั–ะฒะธะน ัั‚ะธะบ ะŸั€ะฐะฒะธะน ัั‚ะธะบ @@ -2948,7 +3258,7 @@ ะ’ะธะฑั€ะฐั‚ะธ ะฟะฐะฟะบัƒโ€ฆ ะ‘ัƒะดัŒ-ัะบะฐ ะฟะฐะฟะบะฐ ะฝะฐ SD-ะบะฐั€ั‚ั†ั– ะฐะฑะพ USB-ะฝะฐะบะพะฟะธั‡ัƒะฒะฐั‡ั– ะ†ะณั€ะธ ะฟะพั‚ั€ะฐะฟะปััŽั‚ัŒ ัƒ ะฟะฐะฟะบัƒ Games ัƒ ะฒะธะฑั€ะฐะฝะพะผัƒ ะผั–ัั†ั–. ะะฐัะฒะฝั– ั–ะณั€ะธ ะฝะต ะฟะตั€ะตะผั–ั‰ัƒัŽั‚ัŒัั. - ะšัƒะดะธ ะนะดะต + ะฉะพ ะทะฐะนะผะฐั” ะผั–ัั†ะต ะ†ะณั€ะธ Steam ะ”ะฐะฝั– ั–ะณะพั€ ะŸั€ะตั„ั–ะบัะธ %1$s ยท ะผะฐะนัั‚ะตั€ะฝั %2$s ยท ัˆะตะนะดะตั€ะธ %3$s @@ -3017,6 +3327,7 @@ ะ†ะฝัั‚ะฐะปัั‚ะพั€ะธ VC++ ั– DirectX, ะฟะพั‚ั€ั–ะฑะฝั– ั–ะณั€ะฐะผ ะ—ะฐะฟัƒัะบะฐั” ั–ะณั€ะธ Linux x86 ะ†ะฝัั‚ั€ัƒะผะตะฝั‚ Steam + Steam ะทะฐะฒะฐะฝั‚ะฐะถัƒั” ั†ะต ะดะปั ั–ะณะพั€ ั–ะท ะฐะฝั‚ะธั‡ะธั‚ะพะผ, ะฝะฐะฒั–ั‚ัŒ ะบะพะปะธ ะนะพะณะพ ะฒะธะผะบะฝะตะฝะพ. ะ’ะธะดะฐะปะตะฝะฝั ะทัƒะฟะธะฝัั” ั—ั…ะฝั” ะฒัั‚ะฐะฝะพะฒะปะตะฝะฝั ะฝะฐ 0% DroidDeck ะทะฐะฟัƒัะบะฐั” ั–ะณั€ะธ ะฑะตะท ั†ัŒะพะณะพ ัะตั€ะตะดะพะฒะธั‰ะฐ ะฒะธะบะพะฝะฐะฝะฝั Proton x86, ัะบะธะน DroidDeck ะฝะต ะผะพะถะต ะทะฐะฟัƒัั‚ะธั‚ะธ ะขะธะฟะพะฒะต ะดะปั ะฒัั–ั… ั–ะณะพั€ @@ -3094,6 +3405,19 @@ ะ—ะฑะตั€ะตะถะตะฝะพ ะะต-Steam ั–ะณั€ะธ ั‚ะฐ ัะฟั–ะปัŒะฝะธะน ะฟั€ะตั„ั–ะบั Steam ะŸั€ะตั„ั–ะบัะธ ั–ะณะพั€ ั–ะท ะผะฐะณะฐะทะธะฝั–ะฒ ะฐะฑะพ ะดะพะดะฐะฝะธั… ะฒั€ัƒั‡ะฝัƒ + ะกะฟั–ะปัŒะฝะธะน ะฟั€ะตั„ั–ะบั Steam + Steam ะทะฐะฟัƒัะบะฐั” ั‚ัƒั‚ ะฒะปะฐัะฝั– ะดะพะฟะพะผั–ะถะฝั– ะฟั€ะพะณั€ะฐะผะธ Windows + ะ’ะธะดะฐะปัั” ะนะพะณะพ (%1$s). Steam ัั‚ะฒะพั€ะธั‚ัŒ ะฝะพะฒะธะน, ะบะพะปะธ ะฒั–ะฝ ะทะฝะพะฒัƒ ะทะฝะฐะดะพะฑะธั‚ัŒัั. + ะ—ะฐัั‚ะพััƒะฝะพะบ ะผะฐะณะฐะทะธะฝัƒ ั‚ะฐ ั–ะณั€ะธ, ัะบั– ะท ะฝะธะผ ะฟั€ะฐั†ัŽัŽั‚ัŒ + ะ’ะธะบะพั€ะธัั‚ะพะฒัƒั”ั‚ัŒัั: %1$s + ะะต-Steam ะณั€ะฐ %1$s + ะะต ะทั–ัั‚ะฐะฒะปะตะฝะพ ะท ะณั€ะพัŽ, ั‚ะพะผัƒ ะทะฑะตั€ั–ะณะฐั”ั‚ัŒัั + ะ’ะธะดะฐะปะธั‚ะธ ะฒะธะฑั€ะฐะฝั– ยท %1$s + ะ’ะธะดะฐะปะธั‚ะธ ะฒะธะฑั€ะฐะฝั– ยท %1$s + ะŸั€ะตั„ั–ะบัะธ Wine + ะ—ะฑะตั€ะตะถะตะฝะฝั ะน ะฝะฐะปะฐัˆั‚ัƒะฒะฐะฝะฝั ะฒ ะฝะธั… ะฑัƒะดะต ะฒั‚ั€ะฐั‡ะตะฝะพ; ะทะฑะตั€ะตะถะตะฝะฝั Steam Cloud ะทะฐะปะธัˆะฐัŽั‚ัŒัั ัƒ ะฒะฐัˆะพะผัƒ ะพะฑะปั–ะบะพะฒะพะผัƒ ะทะฐะฟะธัั–. + ะšะตัˆั– ัˆะตะนะดะตั€ั–ะฒ + ะŸั€ะตั„ั–ะบัะธ %1$s ยท ัˆะตะนะดะตั€ะธ %2$s ะ—ะฐะฒะฐะฝั‚ะฐะถะตะฝั– ะฟะฐะบะตั‚ะธ ะ—ะฑะตั€ะตะถะตะฝั– ะพั€ะธะณั–ะฝะฐะปะธ ะ–ะพะดะฝะพะณะพ ะทะฐะฒะฐะฝั‚ะฐะถะตะฝะพะณะพ ะฟะฐะบะตั‚ะฐ ะบะพะผะฟะพะฝะตะฝั‚ั–ะฒ. @@ -3132,6 +3456,8 @@ DroidDeck ยท %1$d ะบะฐะดั€/ั 60 ะบะฐะดั€/ั ะฒะธะณะปัะดะฐั” ะฟะปะฐะฒะฝั–ัˆะต, ะฐะปะต ะฑั–ะปัŒัˆะต ะฝะฐะฒะฐะฝั‚ะฐะถัƒั” ะฟั€ะพั†ะตัะพั€ ะฟั–ะด ั‡ะฐั ะทะฐะฟัƒัะบัƒ Steam. ะ’ั–ะดะตะพ, ะฒะธะฑั€ะฐะฝะต ะฒ ะฝะฐะปะฐัˆั‚ัƒะฒะฐะฝะฝัั… ัะฐะผะพะณะพ Steam, ั‚ะฐะบะพะถ ะท\'ัะฒะปัั”ั‚ัŒัั ั‚ัƒั‚. ะ—ะฒัƒะบ + ะŸั€ะพะฟัƒัะบะฐั‚ะธ ะฒั–ะดะตะพ ะทะฐะฟัƒัะบัƒ + ะ’ะธะบะพั€ะธัั‚ะพะฒัƒะฒะฐั‚ะธ 0,1-ัะตะบัƒะฝะดะฝะธะน ั‡ะพั€ะฝะธะน ะบะปั–ะฟ ัะบ ะฒัั‚ัƒะฟะฝะต ะฒั–ะดะตะพ Steam. ะ—ะฐัั‚ะพัะพะฒัƒั”ั‚ัŒัั ะท ะฝะฐัั‚ัƒะฟะฝะพะณะพ ัะตะฐะฝััƒ. ะ’ะปะฐัะฝะต ะฒั–ะดะตะพ MP4, MOV, MKV ะฐะฑะพ WebM. ะ†ะฝัˆั– ั„ะพั€ะผะฐั‚ะธ ะน ั„ะฐะนะปะธ ะฟะพะฝะฐะด %1$d ะœะ‘ ะฟะตั€ะตั‚ะฒะพั€ัŽัŽั‚ัŒัั ะฝะฐ ะฟั€ะธัั‚ั€ะพั— ะฝะฐ WebM 720p, ะดะพ %2$d ัะตะบัƒะฝะด. ะ†ะผะฟะพั€ั‚ @@ -3593,6 +3919,7 @@ ะ—ะฐะปะธัˆะฐั” Alt+Tab, ะบะปะฐะฒั–ัˆัƒ Win ั– ะบะฝะพะฟะบัƒ ยซะ”ะพะดะพะผัƒยป ะฒ ะฐะบั‚ะธะฒะฝะพะผัƒ ัะตะฐะฝัั– DroidDeck, ะฐ ะฝะต ะฒ Android. ะฃะฒั–ะผะบะฝั–ั‚ัŒ ยซะฏัะบั€ะฐะฒั–ัั‚ัŒยป ัƒ ยซะะฐะปะฐัˆั‚ัƒะฒะฐะฝะฝั โ†’ ะ†ะฝั‚ะตะณั€ะฐั†ั–ั ะทั– Steamยป ะœั–ัั‚ Mali: ะฒะธะผะบ. + %1$s ะฝะต ะผะพะถะต ะฒะธะบะพั€ะธัั‚ะพะฒัƒะฒะฐั‚ะธ ะผั–ัั‚ Mali (ะดะปั ั†ัŒะพะณะพ ะฟะพั‚ั€ั–ะฑะตะฝ GPU Mali ะฑะตะท ะผะฐั€ัˆั€ัƒั‚ัƒ ั‡ะตั€ะตะท ัะธัั‚ะตะผะฝะธะน ะดั€ะฐะนะฒะตั€), ั‚ะพะผัƒ ั†ะตะน ะฟะตั€ะตะผะธะบะฐั‡ ั‚ัƒั‚ ะฝะต ะดั–ั”. ะœั–ัั‚ Mali: ัƒะฒั–ะผะบ. %1$s โ€” ะฝะต Adreno. ะฃะฒั–ะผะบะฝะตะฝะพ ะตะบัะฟะตั€ะธะผะตะฝั‚ะฐะปัŒะฝะธะน ะผั–ัั‚ Vulkan: ัะตะฐะฝั ะผะฐะปัŽั” ั‡ะตั€ะตะท ะฒะปะฐัะฝะธะน ะดั€ะฐะนะฒะตั€ ั‚ะตะปะตั„ะพะฝะฐ. ะœะพะถะปะธะฒั– ะฟะพะผะธะปะบะธ; ะฝะฐะดั–ัˆะปั–ั‚ัŒ ะถัƒั€ะฝะฐะปะธ ัะตะฐะฝััƒ. ะ‘ะตะทะฟะตั‡ะฝะธะน ั€ะตะถะธะผ @@ -3618,6 +3945,25 @@ ะŸะตั€ะตะผั–ัั‚ะธั‚ะธ ะฟั–ะทะฝั–ัˆะต ะะฐะปะฐัˆั‚ัƒะฒะฐะฝะฝั ะฒั–ะดะถะตั‚ะฐ ะ’ะธะปัƒั‡ะธั‚ะธ ะฒั–ะดะถะตั‚ + ะ’ะธะณะปัะด + ะะฐะฑั–ั€ ะทะฝะฐั‡ะบั–ะฒ + ะฏะบ ัƒ ัะธัั‚ะตะผั– + ะคะพะฝ ะบะพะปัŒะพั€ัƒ ะทะฐัั‚ะพััƒะฝะบัƒ + ะ ะพะทะผั–ั€ ะทะฝะฐั‡ะบั–ะฒ + ะœะฐะปั– + ะกะตั€ะตะดะฝั– + ะ’ะตะปะธะบั– + ะกั…ะพะฒะฐั‚ะธ ะฝะฐะทะฒะธ ะทะฐัั‚ะพััƒะฝะบั–ะฒ + ะ’ั–ะดัั‚ัƒะฟะธ + ะ’ัƒะทัŒะบั– + ะกะตั€ะตะดะฝั– + ะจะธั€ะพะบั– + ะ—ะผั–ะฝะธั‚ะธ ะทะฝะฐั‡ะพะบ + ะกะบะธะฝัƒั‚ะธ ะทะฝะฐั‡ะพะบ + ะŸะพัˆัƒะบ ะทะฝะฐั‡ะบั–ะฒ + ะ—ะฐะฒะฐะฝั‚ะฐะถะตะฝะฝั ะทะฝะฐั‡ะบั–ะฒโ€ฆ + ะ—ะฝะฐั‡ะบั–ะฒ ะฝะต ะทะฝะฐะนะดะตะฝะพ. + ะ’ะปะฐัะฝั– ะทะฝะฐั‡ะบะธ ะ”ะพะดะฐั‚ะธ ะดะพ ะฟะฐะฟะบะธ ะะพะฒะฐ ะฟะฐะฟะบะฐ ะ’ะธะปัƒั‡ะธั‚ะธ ะท ะฟะฐะฟะบะธ @@ -3735,5 +4081,81 @@ ะะต ะฒะดะฐะปะพัั ั–ะผะฟะพั€ั‚ัƒะฒะฐั‚ะธ ั†ัŽ ั€ะพะทะบะปะฐะดะบัƒ ะ‘ะฐะณั€ัะฝะธะน ัะฝั–ะณ + ะ‘ั–ะปั– ะฟะพะฒะตั€ั…ะฝั– ะท ั‡ะตั€ะฒะพะฝะธะผะธ ะฐะบั†ะตะฝั‚ะฐะผะธ. + ะกะฐัƒะฝะดั‚ั€ะตะบะธ + ะœัƒะทะธะบะฐ + ะŸะฐั€ะฐะผะตั‚ั€ะธ ะฒั–ะดั‚ะฒะพั€ะตะฝะฝั + ะฃะปัŽะฑะปะตะฝะต + ะšะพะปะตะบั†ั–ั— + ะšะพะปะตะบั†ั–ะน ั‰ะต ะฝะตะผะฐั”. ะขะพั€ะบะฝั–ั‚ัŒัั ะทะฝะฐั‡ะบะฐ ะทะฐะบะปะฐะดะบะธ, ั‰ะพะฑ ัั‚ะฒะพั€ะธั‚ะธ. + ะ—ะฑะตั€ะตะถะตะฝะพ + ะกั‚ะฒะพั€ะธั‚ะธ ะบะพะปะตะบั†ั–ัŽ + ะฃะฟะพั€ัะดะบัƒะนั‚ะต ัะฒะพั— ะทะฑะตั€ะตะถะตะฝั– ั‚ั€ะตะบะธ + ะะพะฒะฐ + ะกั‚ะฒะพั€ะธั‚ะธ + ะะฐะทะฒะฐ ะบะพะปะตะบั†ั–ั— + ะ’ะฒะตะดั–ั‚ัŒ ะฝะฐะทะฒัƒ, ัะบัƒ ะฝะต ะฒะธะบะพั€ะธัั‚ะพะฒัƒั” ะถะพะดะฝะฐ ั–ะฝัˆะฐ ะบะพะปะตะบั†ั–ั + ะšะตั€ัƒะฒะฐั‚ะธ + ะŸะตั€ะตะนะผะตะฝัƒะฒะฐั‚ะธ + ะ”ะพะดะฐั‚ะธ ั‚ั€ะตะบะธ + ะ”ะพะดะฐั‚ะธ (%1$d) + ะ’ะธะปัƒั‡ะธั‚ะธ ั‚ั€ะตะบะธ + ะ’ะธะดะฐะปะธั‚ะธ ะบะพะปะตะบั†ั–ัŽ + ะ’ะธะดะฐะปะธั‚ะธ %1$s? + ะขั€ะตะบะธ ะทะฐะปะธัˆะฐัŽั‚ัŒัั ะฝะฐ ะฒะฐัˆะพะผัƒ ะฟั€ะธัั‚ั€ะพั—. ะ‘ัƒะดะต ะฒะธะดะฐะปะตะฝะพ ะปะธัˆะต ะบะพะปะตะบั†ั–ัŽ. + ะ’ะธะฑั€ะฐั‚ะธ + ะ’ะธะฑั€ะฐั‚ะธ ะฒัะต + ะกะบะฐััƒะฒะฐั‚ะธ ะฒะธะฑั–ั€ + ะ’ะธะฑั€ะฐะฝะพ: %1$d + ะ”ะพะดะฐั‚ะธ ะดะพ ะบะพะปะตะบั†ั–ั— + ะ”ะพะดะฐั‚ะธ ะดะพ ัƒะปัŽะฑะปะตะฝะพะณะพ + ะ’ะธะปัƒั‡ะธั‚ะธ ะท ะบะพะปะตะบั†ั–ั— + ะŸะพัˆัƒะบ ั‚ั€ะตะบั–ะฒ + ะŸะพั€ัะดะพะบ ะฒ ะฐะปัŒะฑะพะผั– + ะกะฟะพั‡ะฐั‚ะบัƒ ะฝะฐะนะดะพะฒัˆั– + ะกะฟะพั‡ะฐั‚ะบัƒ ะฝะฐะนะบะพั€ะพั‚ัˆั– + ะขั€ะตะบะธ + ะ’ะธัะพั‚ะฐ ั‚ะพะฝัƒ + ะกะบะธะฝัƒั‚ะธ + ะŸั€ะพะฟัƒัะบะฐั‚ะธ ั‚ะธัˆัƒ + ะขะฐะนะผะตั€ ัะฝัƒ + %1$d ั…ะฒ + ะšั–ะฝะตั†ัŒ ั‚ั€ะตะบัƒ + ะ—ะฐะปะธัˆะธะปะพััŒ %1$s + ะ•ะบะฒะฐะปะฐะนะทะตั€ + ะŸั–ะดัะธะปะตะฝะฝั ะฑะฐัั–ะฒ + ะ•ะบะฒะฐะปะฐะนะทะตั€ ะฝะตะดะพัั‚ัƒะฟะฝะธะน ะฝะฐ ั†ัŒะพะผัƒ ะฟั€ะธัั‚ั€ะพั— + ะ’ะผะธะบะฐั‚ะธ ะฒ ะณั€ั– + ะ’ั–ะดั‚ะฒะพั€ัŽะฒะฐั‚ะธ ัะฐัƒะฝะดั‚ั€ะตะบ, ะฟะพะบะธ ะทะฐะฟัƒั‰ะตะฝะพ ะณั€ัƒ + ะกะฐัƒะฝะดั‚ั€ะตะบะธ ั‰ะต ะฝะต ะฒัั‚ะฐะฝะพะฒะปะตะฝะพ. + ะŸะพัˆัƒะบ ัะฐัƒะฝะดั‚ั€ะตะบั–ะฒ + ะ”ะพะดะฐั‚ะธ ั‚ะตะบัƒ ัะฐัƒะฝะดั‚ั€ะตะบัƒ + ะฃ ั†ั–ะน ั‚ะตั†ั– ะฝะตะผะฐั” ะฐัƒะดั–ะพั„ะฐะนะปั–ะฒ + ะ—ะฐะณะฐะปัŒะฝะฐ ั‚ั€ะธะฒะฐะปั–ัั‚ัŒ + ะขั€ะตะบั–ะฒ: %1$d / %2$s + ะ”ะธัะบ %1$s + ะŸะตั€ะตะผั–ัˆะฐั‚ะธ + ะะฐะทะฐะด + ะ’ั–ะดั‚ะฒะพั€ะธั‚ะธ + ะŸะฐัƒะทะฐ + ะ”ะฐะปั– + ะŸะพะฒั‚ะพั€ ะฒะธะผะบะฝะตะฝะพ + ะŸะพะฒั‚ะพั€ัŽะฒะฐั‚ะธ ะฒัะต + ะŸะพะฒั‚ะพั€ัŽะฒะฐั‚ะธ ะพะดะธะฝ + ะ“ัƒั‡ะฝั–ัั‚ัŒ + ะฃ ั†ัŒะพะผัƒ ัะฐัƒะฝะดั‚ั€ะตะบัƒ ะฝะตะผะฐั” ะฐัƒะดั–ะพั„ะฐะนะปั–ะฒ + ะ—ะฐะฟัƒัะบ ะฝะตะดะพัั‚ัƒะฟะฝะธะน + ะะตะผะฐั” ะฒะตะฑะฑั€ะฐัƒะทะตั€ะฐ, ั‰ะพะฑ ะฒั–ะดะบั€ะธั‚ะธ ั†ะต ะฟะพัะธะปะฐะฝะฝั. + ะ’ะทัั‚ะธ + ะ’ั–ะดะฟัƒัั‚ะธั‚ะธ + ะ—ะฑะตั€ะตะณั‚ะธ + ะฃั‚ั€ะธะผัƒะนั‚ะต ะดะปั ัะบะธะดะฐะฝะฝั + ะœะฐะณะฐะทะธะฝะธ + ะงะฐั ะบะฐะดั€ัƒ + ะกะตั€ะตะดะฝั ั‡ะฐัั‚ะพั‚ะฐ ะบะฐะดั€ั–ะฒ + ะกะตั€ะฒะตั€ ะฒะธะฒะพะดัƒ + ะกั‚ะฐะฝ HDR + ะŸะพะบะฐะทะฐะฝะพ + %1$d ะท %2$d diff --git a/app/src/main/res/values-vi/input_library.xml b/app/src/main/res/values-vi/input_library.xml new file mode 100644 index 0000000000..6b75fe7fd8 --- /dev/null +++ b/app/src/main/res/values-vi/input_library.xml @@ -0,0 +1,132 @@ + + + Cร i ฤ‘แบทt ฤ‘แบงu vร o khรดng ฤ‘แปc ฤ‘ฦฐแปฃc ฤ‘รฃ ฤ‘ฦฐแปฃc giแปฏ trong bแบฃn sao khรดi phแปฅc. Bแบกn cรณ thแปƒ tiแบฟp tแปฅc chแป‰nh sแปญa cรกc hแป“ sฦก ฤ‘รฃ khรดi phแปฅc. + Thuแป™c tรญnh + Thuแป™c tรญnh nhแบฅp + %1$s ยท Nhแบฅp + Nรบt + Cแบงn, bร n phรญm cแบฃm แปฉng vร  cรฒ + แบจn cรดng cแปฅ + Tay cแบงm + Gแปญi ฤ‘แบงu vร o tay cแบงm tแป›i Steam Input hoแบทc trรฒ chฦกi. + Phแบงn tแปญ nร y khรดng gแปญi ฤ‘แบงu vร o tay cแบงm, chuแป™t hay bร n phรญm. + Nhแบฅp chuแป™t + Hร nh ฤ‘แป™ng DroidDeck + Hร nh ฤ‘แป™ng + Tแป‘c ฤ‘แป™ cuแป™n: %1$d bฦฐแป›c/giรขy + + Hแป“ sฦก mแป›i + + Bแป‘ cแปฅc mแป›i + %1$s ยท ฤฦฐแปฃc %2$d hแป“ sฦก sแปญ dแปฅng. Thay ฤ‘แป•i รกp dแปฅng cho mแปi hแป“ sฦก dรนng cรกc gรกn nร y. + ฤแป•i tรชn + Xรณa + Thรชm phแบงn tแปญ vร o bแป‘ cแปฅc trฦฐแป›c khi gรกn hร nh ฤ‘แป™ng cho chรบng. + Khรดng thแปƒ lฦฐu cร i ฤ‘แบทt ฤ‘แบงu vร o + Tรชn + Bแบฏt ฤ‘แบงu tแปซ + Nรบt + Cแบงn + Bร n di chuแป™t + Phรญm ฤ‘iแปu hฦฐแป›ng + Cรฒ + Xong + Hoร n tรกc + + Thรชm + Kรฉo ฤ‘แปƒ di chuyแปƒn. Kรฉo gรณc ฤ‘แปƒ ฤ‘แป•i kรญch thฦฐแป›c. Nhแบฅn Thuแป™c tรญnh ฤ‘แปƒ gรกn hร nh ฤ‘แป™ng. + ฤang chแป‰nh sแปญa trรชn mร n hรฌnh phแปฅ + Mร n hรฌnh ฤ‘รฃ chแปn khรดng khแบฃ dแปฅng. Kแบฟt nแป‘i nรณ ฤ‘แปƒ chแป‰nh sแปญa bแป‘ cแปฅc nร y แปŸ kรญch thฦฐแป›c thแบญt. + Bแป cรกc thay ฤ‘แป•i bแป‘ cแปฅc chฦฐa lฦฐu? + Bแป‘ cแปฅc nร y ฤ‘ฦฐแปฃc %1$d hแป“ sฦก sแปญ dแปฅng. Thay ฤ‘แป•i ฤ‘รฃ lฦฐu รกp dแปฅng cho tแบฅt cแบฃ. + Hแป“ sฦก mแบทc ฤ‘แป‹nh + Chแบฟ ฤ‘แป™ mรกy tรญnh + Chแบฟ ฤ‘แป™ chฦกi game + Mแบทc ฤ‘แป‹nh cho mรกy tรญnh vร  trรฒ chฦกi + Mแบทc ฤ‘แป‹nh cho chแบฟ ฤ‘แป™ chฦกi game + Mแบทc ฤ‘แป‹nh cho chแบฟ ฤ‘แป™ mรกy tรญnh + Cร i ฤ‘แบทt thiแบฟt bแป‹ + ฤiแปu khiแปƒn + Nรบt, cแบงn, cรฒ vร  phรญm bแป• sung + Sao chรฉp hแป“ sฦก + ฤแบทt lแบกi hร nh ฤ‘แป™ng + ฤแบทt lแบกi hร nh ฤ‘แป™ng trong %1$s vแป mแบทc ฤ‘แป‹nh cแปงa hแป“ sฦก gแป‘c? Bแป‘ cแปฅc vร  cรกc hแป“ sฦก khรกc giแปฏ nguyรชn. + Xรณa %1$s? Cรกc chแบฟ ฤ‘แป™ ฤ‘ang dรนng sแบฝ quay vแป hแป“ sฦก mแบทc ฤ‘แป‹nh tรญch hแปฃp. Bแป‘ cแปฅc ฤ‘รฃ lฦฐu vร  cร i ฤ‘แบทt chia sแบป vแบซn khแบฃ dแปฅng. + Hiแปƒn thแป‹ + รp dแปฅng cho mแปi hแป“ sฦก. Auto hiแป‡n ฤ‘iแปu khiแปƒn mร n hรฌnh chรญnh khi khรดng cรณ tay cแบงm kแบฟt nแป‘i แปŸ chแบฟ ฤ‘แป™ chฦกi game. + Chแป‰nh sแปญa trรชn mร n hรฌnh + Bแป‘ cแปฅc ฤ‘รฃ lฦฐuโ€ฆ + Chแปn mแป™t bแป‘ cแปฅc hoแบทc tแบกo bแป‘ cแปฅc riรชng + Chแปn ฤiแปu khiแปƒn hแป“ sฦก trong menu phiรชn cแปงa mร n hรฌnh phแปฅ. Bแป™ chแปn Hแป“ sฦก vร  Mร n hรฌnh phแปฅ trong menu tay cแบงm quyแบฟt ฤ‘แป‹nh ฤ‘iแปu khiแปƒn nร o ฤ‘ฦฐแปฃc hiแปƒn thแป‹. + Hร nh ฤ‘แป™ng cแปงa nรบt + Chia sแบป vแป›i %1$s. Chแป‰nh sแปญa cลฉng รกp dแปฅng cho cรกc hแป“ sฦก ฤ‘รณ. + Dรนng lแบกi cร i ฤ‘แบทt + Dรนng cร i ฤ‘แบทt tแปซโ€ฆ + Sao chรฉp tแปซ hแป“ sฦก khรกc hoแบทc giแปฏ cร i ฤ‘แบทt chia sแบป + Lร m cho ฤ‘แป™c lแบญp + Giแปฏ thiแบฟt lแบญp hiแป‡n tแบกi vร  ngแปซng chia sแบป thay ฤ‘แป•i + Bแป‘ cแปฅc lฦฐu phแบงn tแปญ vร  vแป‹ trรญ. Mแป—i hแป“ sฦก cรณ thแปƒ gรกn hร nh ฤ‘แป™ng riรชng. Chแป‰nh sแปญa แปŸ kรญch thฦฐแป›c ฤ‘แบงy ฤ‘แปง trรชn mร n hรฌnh ฤ‘รญch. + Bแป‘ cแปฅc hiแป‡n tแบกi + Xรณa bแป‘ cแปฅc khรดng dรนng %1$s vร  cรกc hร nh ฤ‘แป™ng ฤ‘รฃ lฦฐu? + ฤแป•i tรชn bแป‘ cแปฅc hiแป‡n tแบกi + Dรนng lแบกi %1$s tแปซ hแป“ sฦก khรกc. Cรกc nguแป“n ฤ‘iแปu khiแปƒn khรกc giแปฏ nguyรชn. + Giแปฏ ฤ‘iแปu khiแปƒn vแบญt lรฝ ฤ‘ฦฐแปฃc chia sแบป + Mแบทc ฤ‘แป‹nh, mแปi ฤ‘iแปu khiแปƒn vร  bแป‘ cแปฅc tรนy chแป‰nh lร  bแบฃn sao ฤ‘แป™c lแบญp. Chia sแบป chแป‰ liรชn kแบฟt ฤ‘iแปu khiแปƒn vแบญt lรฝ. + Dรนng cรกc phแบงn tแปญ vร  vแป‹ trรญ nร y. Chia sแบป giแปฏ cรกc thay ฤ‘แป•i hรฌnh hแปc sau nร y ฤ‘แป“ng bแป™; hร nh ฤ‘แป™ng nรบt cแปงa bแบกn vแบซn ฤ‘แป™c lแบญp. Bแป‘ cแปฅc khรกc bแบฏt ฤ‘แบงu vแป›i hร nh ฤ‘แป™ng chฦฐa gรกn. + Sao chรฉp cรกc ฤ‘iแปu khiแปƒn vร  hร nh ฤ‘แป™ng nร y, hoแบทc liรชn kแบฟt ฤ‘แปƒ thay ฤ‘แป•i sau nร y รกp dแปฅng cho cแบฃ hai hแป“ sฦก. + Giแปฏ chia sแบป + Bแบฃn sao ฤ‘แป™c lแบญp + Bแบฏt ฤ‘แบงu cแบงn tแบกi ฤ‘iแปƒm chแบกm + แบจn cแบงn khi khรดng dรนng + Cรดng cแปฅ + Tแปฑ ฤ‘แป™ng (%1$s) + Tรนy chแป‰nh (%1$s) + Lฦฐu thร nh hแป“ sฦก mแป›i + ฤiแปu khiแปƒn hแป“ sฦก + Hแป“ sฦก + Cแปญ chแป‰ bร n di chuแป™t + Khi gรกn cho con trแป chuแป™t: chแบกm ฤ‘แปƒ nhแบฅp, giแปฏ ฤ‘แปƒ kรฉo vร  cuแป™n bแบฑng hai ngรณn. + %1$s cรณ ghi ฤ‘รจ menu nhanh. Chแปn Tแปฑ ฤ‘แป™ng แปŸ ฤ‘รณ ฤ‘แปƒ dรนng hแป“ sฦก mแบทc ฤ‘แป‹nh vร  cแบฃ ba phแบงn ฤ‘รฃ lฦฐu. + ฤแบงu vร o DroidDeck + Giแปฏ khi cแบงn ฤ‘ฦฐแปฃc ฤ‘แบฉy theo mแปi hฦฐแป›ng: nhแบฅn trรชn 55%, nhแบฃ dฦฐแป›i 35%. Dรนng Phรญm hฦฐแป›ng ฤ‘แปƒ gรกn tแปซng hฦฐแป›ng riรชng. Lแป‡nh DroidDeck chแบกy mแป™t lแบงn mแป—i lแบงn lแป‡ch. Nhแบฅp cแบงn ฤ‘ฦฐแปฃc cแบฅu hรฌnh riรชng. + Giแปฏ khi chแบกm bร n di chuแป™t; nhแบฃ khi nhแบฅc ngรณn tay. Lแป‡nh DroidDeck chแบกy mแป™t lแบงn mแป—i lแบงn chแบกm. Nhแบฅp bร n di chuแป™t ฤ‘ฦฐแปฃc cแบฅu hรฌnh riรชng. + Giแปฏ khi cรฒ vฦฐแปฃt 55%; nhแบฃ dฦฐแป›i 35%. Lแป‡nh DroidDeck chแบกy mแป™t lแบงn mแป—i lแบงn nhแบฅn. + Hฦฐแป›ng cuแป™n + Dแปc + Ngang + Cuแป™n ngang + Sแป‘ ฤ‘o + Bแบญt ghi, dรนng ฤ‘iแปu khiแปƒn trong phiรชn ฤ‘ang chแบกy, rแป“i quay lแบกi ฤ‘แปc kแบฟt quแบฃ. Chแป‰ ฤ‘o thแปi gian gแปญi cแปงa DroidDeck, khรดng ฤ‘o ฤ‘แป™ trแป… mร n hรฌnh. Ghi kแบฟt thรบc khi tiแบฟn trรฌnh แปฉng dแปฅng ฤ‘รณng. + %1$d ฤ‘iแปu khiแปƒn + Bแป‘ cแปฅc ฤ‘รฃ lฦฐu khรกc (%1$d) โ–พ + แบจn bแป‘ cแปฅc ฤ‘รฃ lฦฐu khรกc (%1$d) โ–ด + Trang chแปง / Guide + Quay lแบกi ยท mแป™t lแบงn chแบกm + Quay lแบกi ยท chแบกm hai lแบงn + Quay lแบกi ยท hai lแบงn trong Steam, mแป™t lแบงn trรชn mรกy tรญnh + แปž chแบฟ ฤ‘แป™ Steam. Giแปฏ Quay lแบกi cลฉng mแปŸ truy cแบญp nhanh. + Khรดi phแปฅc mแบทc ฤ‘แป‹nh + Lแปฑa chแปn bแบฃng cแปงa bแบกn ฤ‘ฦฐแปฃc ghi nhแป›. Mรกy tรญnh mแปŸ khรดng gian lร m viแป‡c thแปฉ hai; khรดng chuyแปƒn phiรชn hay hแป“ sฦก ฤ‘แบงu vร o cแปงa nรณ. + Tay cแบงm แบฃo + Loแบกi tay cแบงm mร  Steam hoแบทc trรฒ chฦกi thแบฅy. + Mร n hรฌnh cแบฃm แปฉng + Cรกch xแปญ lรฝ cรกc lแบงn chแบกm trรชn mร n hรฌnh trรฒ chฦกi. Cรกc nรบt hแป“ sฦก giแปฏ hร nh ฤ‘แป™ng ฤ‘รฃ gรกn. + Con trแป chแบกm + Hiแป‡n con trแป cho cรกc lแบงn chแบกm trแปฑc tiแบฟp trรชn mร n hรฌnh trรฒ chฦกi. + Chแบกm vร  giแปฏ + Hร nh ฤ‘แป™ng chuแป™t khi giแปฏ ngรณn tay trรชn mร n hรฌnh trรฒ chฦกi. + Chแบกm nรบt Quay lแบกi + Hร nh ฤ‘แป™ng thแปฉ nhแบฅt: mแป™t lแบงn chแบกm. Hร nh ฤ‘แป™ng thแปฉ hai: hai lแบงn chแบกm. + Nรบt bแบญt/tแบฏt + Chแบกm ฤ‘แปƒ giแปฏ, chแบกm lแบกi ฤ‘แปƒ nhแบฃ. MแปŸ menu hoแบทc ฤ‘แป•i hแป“ sฦก sแบฝ nhแบฃ nรบt. + Hรฌnh dแบกng + Bo trรฒn + Viรชn nang + Trรฒn + Chแปฏ nhแบญt + Nhรฃn nรบt + Vฤƒn bแบฃn + Hรฌnh แบฃnh ฤ‘รฃ nhแบญp + Phรญm chรฉo riรชng + Gรกn phรญm cho tแปซng ฤ‘ฦฐแปng chรฉo. ฤฦฐแปng chรฉo trแป‘ng sแบฝ nhแบฅn hai hฦฐแป›ng bรชn cแบกnh. + Hฦฐแป›ng bรชn cแบกnh + Cรกc phรญm mร n hรฌnh cลฉ ฤ‘ฦฐแปฃc lฦฐu thร nh hแป“ sฦก ฤ‘รฃ nhแบญp bรชn dฦฐแป›i. Chแปn mแป™t ฤ‘แปƒ dรนng hoแบทc chแป‰nh sแปญa. Cรกc lแปฑa chแปn hแป“ sฦก hiแป‡n tแบกi ฤ‘ฦฐแปฃc giแปฏ nguyรชn. + Khรดng thแปƒ nhแบญp tแปฑ ฤ‘แป™ng cรกc phรญm mร n hรฌnh cลฉ. Cร i ฤ‘แบทt gแป‘c ฤ‘ฦฐแปฃc giแปฏ nguyรชn. + diff --git a/app/src/main/res/values-vi/input_strings.xml b/app/src/main/res/values-vi/input_strings.xml new file mode 100644 index 0000000000..3b2a6cff52 --- /dev/null +++ b/app/src/main/res/values-vi/input_strings.xml @@ -0,0 +1,38 @@ + + + Hแป“ sฦก ฤ‘แบงu vร o + Hแป“ sฦก + Tay cแบงm vแบญt lรฝ + Mร n hรฌnh chรญnh + Mร n hรฌnh phแปฅ + Gแป‘c / Steam Input + Gแป‘c: %1$s + Gแปญi ฤ‘iแปu khiแปƒn tay cแบงm khรกc + ฤรฃ tแบฏt + Phรญm hoแบทc tแป• hแปฃp phรญm + Phรญm hฦฐแป›ng + Di chuyแปƒn con trแป + Tแป‘c ฤ‘แป™ con trแป: %1$d + Cuแป™n + Cuแป™n dแปc + Nรบt chuแป™t trรกi + Nรบt chuแป™t phแบฃi + Nรบt chuแป™t giแปฏa + MแปŸ menu DroidDeck + Hiแป‡n bร n phรญm + MแปŸ menu Steam + MแปŸ truy cแบญp nhanh Steam + Xรณa ฤ‘iแปu khiแปƒn + Thรชm ฤ‘iแปu khiแปƒn + Nรบt riรชng cho thiแบฟt bแป‹ + Gรกn mแป™t nรบt vแบญt lรฝ + Nhแบฃ nรบt, sau ฤ‘รณ chแปn Sแปญa, Thแปญ lแบกi hoแบทc Hแปงy. B hoแบทc Quay lแบกi sแบฝ hแปงy sau khi nhแบฃ. + Thแปญ lแบกi + Nhแบฅn mแป™t nรบt, kแปƒ cแบฃ nรบt Quay lแบกi ฤ‘ฦฐแปฃc bรกo lร  phรญm. Cรกc phรญm รขm lฦฐแปฃng vร  hแป‡ thแป‘ng Android ฤ‘ฦฐแปฃc dร nh riรชng. Viแป‡c gรกn chแป‰ รกp dแปฅng cho thiแบฟt bแป‹ nร y. + Xรณa gรกn + Chแบฉn ฤ‘oรกn ฤ‘แบงu vร o + Ghi thแปi gian gแปญi ฤ‘แบงu vร o + ฤแปc sแป‘ ฤ‘o + ฤo quรก trรฌnh gแปญi tแปซ Android ฤ‘แบฟn khi cรดng bแป‘ vร o kรชnh ฤ‘แบงu vร o hiแป‡n cรณ. Khรดng gแป“m viแป‡c ฤ‘แบฟn qua Bluetooth, thฤƒm dรฒ khรกch, kแบฟt xuแบฅt vร  ฤ‘แป™ trแป… mร n hรฌnh. Ghi mแบทc ฤ‘แป‹nh tแบฏt. + Dรนng gรกn ฤ‘แบงu vร o thรดng thฦฐแปng + diff --git a/app/src/main/res/values-vi/strings.xml b/app/src/main/res/values-vi/strings.xml index 537168797a..f133ef3d94 100644 --- a/app/src/main/res/values-vi/strings.xml +++ b/app/src/main/res/values-vi/strings.xml @@ -28,6 +28,8 @@ Tแบกm dแปซng ngay Dแปซng phiรชn Tแบกo khung hรฌnh + Cร i ฤ‘แบทt cho trรฒ chฦกi nร y + Cร i ฤ‘แบทt mแบทc ฤ‘แป‹nh Chแปn chแบฟ ฤ‘แป™ tแบกo khung hรฌnh Tแบฏt DD-FG %1$dร— @@ -183,6 +185,7 @@ Khรดng thแปƒ tแบฃi mรดi trฦฐแปng ฤ‘แป“ hแปa PowerVR. Hรฃy kiแปƒm tra kแบฟt nแป‘i rแป“i thแปญ lแบกi. Khรดng thแปƒ tแบฃi DirectAudio, nรชn รขm thanh game dรนng ฤ‘ฦฐแปng chแบญm hฦกn trong phiรชn nร y. Chฦฐฦกng trรฌnh nร y + Phiรชn khรดng thแปƒ vแบฝ lรชn mร n hรฌnh: %1$s. Mร n hรฌnh nร y cho biแบฟt lรฝ do thay vรฌ mร n hรฌnh ฤ‘en; chi tiแบฟt nแบฑm trong nhแบญt kรฝ phiรชn. Khรดng thแปƒ tแบฃi xuแป‘ng client Steam. Mแบกng hoแบทc VPN cแปงa bแบกn cรณ thแปƒ ฤ‘ang chแบทn mรกy chแปง Steam; hรฃy kiแปƒm tra kแบฟt nแป‘i rแป“i thแปญ lแบกi. Khรดng thแปƒ thiแบฟt lแบญp client Steam. Hรฃy kiแปƒm tra kแบฟt nแป‘i vร  dung lฦฐแปฃng trแป‘ng rแป“i thแปญ lแบกi. %1$s ฤ‘ฦฐแปฃc build cho PC x86 vร  chแบกy qua FEX, hiแป‡n chฦฐa ฤ‘ฦฐแปฃc cร i. KhแปŸi ฤ‘แป™ng Steam mแป™t lแบงn khi ฤ‘รฃ ฤ‘ฤƒng nhแบญp vร  ฤ‘แปƒ nรณ tแบฃi FEX cรนng Steam Linux Runtime, sau ฤ‘รณ khแปŸi ฤ‘แป™ng lแบกi แปฉng dแปฅng nร y. @@ -384,6 +387,9 @@ Chฦฐa ฤ‘ฦฐแปฃc hแป— trแปฃ แปŸ ฤ‘รขy ฤang tแบฃi cรกc thร nh phแบงnโ€ฆ Khรดng thแปƒ cร i: %1$s + Bแบฃn tแบฃi xuแป‘ng nร y cแบงn ฤ‘ฦฐแปฃc cแบญp nhแบญt. + ฤรฃ ฤ‘ฦฐa bแบฃn cแบญp nhแบญt vร o hร ng ฤ‘แปฃi. + Thแปญ cแบญp nhแบญt lแบกi ฤรฃ tแบฃi ฤang tแบฃi %1$s ฤang cร i: %1$s @@ -414,6 +420,22 @@ Chแป‰ bแป™ nhแป› trong Thฦฐ mแปฅc: %1$s Thฦฐ viแป‡n thแปฉ hai + Thรชm thฦฐ viแป‡n Steam + Cรกc thฦฐ mแปฅc ฤ‘แปƒ Steam cร i ฤ‘แบทt vร  chแบกy game, mแป—i thฦฐ mแปฅc cรณ tรชn riรชng. Xรณa mแป™t thฦฐ mแปฅc vแบซn giแปฏ game trรชn bแป™ nhแป›. + Thรชm thฦฐ viแป‡n + ฤแป•i tรชn + Tรชn thฦฐ viแป‡n + Chแปn thฦฐ mแปฅc cho thฦฐ viแป‡n + Tแป‘i ฤ‘a %1$d thฦฐ viแป‡n ฤ‘ฦฐแปฃc thรชm + Thฦฐ mแปฅc ฤ‘รณ ฤ‘รฃ lร  thฦฐ viแป‡n hoแบทc nแบฑm trong mแป™t thฦฐ viแป‡n + %1$s ยท khรดng khแบฃ dแปฅng + Cรณ hiแป‡u lแปฑc tแปซ phiรชn Steam tiแบฟp theo + Tรฌm thแบฅy trรชn thiแบฟt bแป‹ nร y ยท %1$s ยท %2$s + Thรชm + Tรฌm thฦฐ viแป‡n trรชn bแป™ nhแป› trong + Cแบฅp quyแปn truy cแบญp tแบฅt cแบฃ tแป‡p ฤ‘แปƒ DroidDeck thแบฅy ฤ‘ฦฐแปฃc cรกc thฦฐ viแป‡n Steam do แปฉng dแปฅng khรกc lฦฐu trรชn bแป™ nhแป› trong + Cho phรฉp + ฤรฃ thรชm %1$s, thฦฐ viแป‡n Steam nแบฑm trong thฦฐ mแปฅc bแบกn chแปn Game truyแปn dแปฏ liแป‡u tแปซ thแบป SD hoแบทc bแป™ nhแป› dรนng chung cรณ thแปƒ bแป‹ giแบญt. Chแบฉn ฤ‘oรกn lฦฐu trแปฏ Ghi lแบกi kแบฟt quแบฃ cแบฅp phรกt vร  thแปi gian lฦฐu trแปฏ mแบซu vร o Share logs. Cรณ thแปƒ lร m chแบญm cร i ฤ‘แบทt khi ฤ‘ang bแบญt. รp dแปฅng tแปซ phiรชn sau. @@ -476,6 +498,7 @@ Bแบญt KhแปŸi ฤ‘แป™ng cรนng Steam KhแปŸi ฤ‘แป™ng khรดng cแบงn Steam + ฤแป™ phรขn giแบฃi trรฒ chฦกi Thiแบฟt lแบญp Thiแบฟt lแบญp %1$s Mแบทc ฤ‘แป‹nh @@ -563,6 +586,8 @@ Lรตi game Lรตi game Lรตi dร nh cho game. Khi chแปn tแบฅt cแบฃ, Android tแปฑ do lแบญp lแป‹ch. + Tiแบฟt kiแป‡m pin vแป›i game แป•n ฤ‘แป‹nh + Chแบกy game trรชn cรกc nhรขn chแบญm hฦกn khi game giแปฏ tแป‘c ฤ‘แป™ khung hรฌnh แป•n ฤ‘แป‹nh, vร  ฤ‘ฦฐa game vแป cรกc nhรขn thฦฐแปng dรนng khi bแป‹ tแปฅt lแบกi. Giao diแป‡n client GL ฤ‘a luแป“ng Cรณ thแปƒ giรบp menu Steam phแบฃn hแป“i nhanh hฦกn. @@ -598,7 +623,10 @@ Tแบฏt trรฌnh hแป— trแปฃ ฤ‘iแปu hฦฐแป›ng bแบฑng tay cแบงm cแปงa Proton, vแป‘n tแป‘n CPU trong mแปi game. Chแบกy proot khรดng cรณ seccomp Cรณ thแปƒ sแปญa lแป—i thiแบฟu syscall trรชn mแป™t sแป‘ kernel. Cรณ thแปƒ giแบฃm hiแป‡u nฤƒng. + Chแบกy khรดng dรนng proot (thแปญ nghiแป‡m) + KhแปŸi ฤ‘แป™ng phแบงn Linux trแปฑc tiแบฟp trรชn Android. รp dแปฅng tแปซ phiรชn tiแบฟp theo. Tแบฏt nแบฟu cรณ thร nh phแบงn khรดng khแปŸi ฤ‘แป™ng ฤ‘ฦฐแปฃc. Fast path cแปงa proot + Khรดng dรนng khi chแบกy khรดng cรณ proot. Cแบงn bแป™ lแปc seccomp cแปงa proot. Tra cแปฉu tแป‡p nhanh hฦกn vร  รญt giแบญt hฦกn. Tแบฏt nแบฟu mแป™t chฦฐฦกng trรฌnh khรดng tรฌm thแบฅy tแป‡p cแปงa nรณ. Vแบฝ con trแป bรชn trong gamescope @@ -681,6 +709,7 @@ Bแป™ nhแป› ฤ‘แป“ hแปa Bแป™ nhแป› swap Mแปฉc pin + Thแปi lฦฐแปฃng pin cรฒn lแบกi Cรดng suแบฅt tiรชu thแปฅ Mแบกng ฤแป™ phรขn giแบฃi @@ -806,6 +835,7 @@ Thiแบฟt bแป‹ ฤ‘ฦฐแปฃc hแป— trแปฃ GPU chฦฐa ฤ‘ฦฐแปฃc kiแปƒm thแปญ GPU khรดng ฤ‘ฦฐแปฃc hแป— trแปฃ + GPU qua cแบงu nแป‘i Mali %1$s ยท %2$s %1$s: %2$s Khรดng cรณ backend ฤ‘แป“ hแปa tฦฐฦกng thรญch cho %1$s. Steam cรณ thแปƒ hiแปƒn thแป‹ mร n hรฌnh ฤ‘en. @@ -835,15 +865,38 @@ Phiรชn Log phiรชn ฤฦฐแปฃc lฦฐu sau mแป—i phiรชn + Chแบฉn ฤ‘oรกn nรขng cao cho phiรชn tiแบฟp theo + Ghi nhแบญt kรฝ chi tiแบฟt trong mแป™t phiรชn. Cรณ thแปƒ lร m giแบฃm hiแป‡u nฤƒng vร  tแป‘n thรชm dung lฦฐแปฃng. Tแปฑ tแบฏt khi phiรชn bแบฏt ฤ‘แบงu; hรฃy xem lแบกi nhแบญt kรฝ trฦฐแป›c khi chia sแบป. Nhแบญt kรฝ gแปก lแป—i game Thรชm chแบฉn ฤ‘oรกn Proton, Wine vร  ฤ‘แป“ hแปa vร o lแบงn khแปŸi chแบกy game tiแบฟp theo. Cรณ thแปƒ giแบฃm hiแป‡u nฤƒng vร  tแป‘n thรชm bแป™ nhแป›. KhแปŸi ฤ‘แป™ng lแบกi phiรชn nร y ฤ‘แปƒ lฦฐu nhแบญt kรฝ gแปก lแป—i game Khรดng thแปƒ cแบญp nhแบญt ghi nhแบญt kรฝ. Hรฃy kiแปƒm tra cรดng tแบฏc rแป“i thแปญ lแบกi. Cรดng cแปฅ gแปก lแป—i + Nhแบญt kรฝ ฤ‘แป“ hแปa chi tiแบฟt + Giao diแป‡n Steam: vแบฝ bแบฑng GPU + Vแป›i cแบทp driver Xclipse, Steam vแบฝ cรกc trang bแบฑng phแบงn mแปm (vแบฝ bแบฑng GPU lร m vแปก cรกc รด hiแปƒn thแป‹). Bแบญt ฤ‘แปƒ cรณ giao diแป‡n Steam nhanh hฦกn nแบฟu hรฌnh hiแปƒn thแป‹ ฤ‘รบng trรชn mรกy nร y. + dแปฑng ngร y %1$s + %1$s ฤ‘รฃ ฤ‘ฦฐแปฃc cแบญp nhแบญt lรชn bแบฃn build mแป›i nhแบฅt + Cแบงu nแป‘i Mali khรดng ฤ‘แบกt bร i tแปฑ kiแปƒm tra trรชn %1$s แปŸ phiรชn trฦฐแป›c (hรฌnh แบฃnh hoแบทc lแป‡nh vแบฝ), nรชn phiรชn ฤ‘รณ ฤ‘รฃ dรนng cแบทp driver PanVK thay thแบฟ. + Cแบงu nแป‘i Mali khรดng tรฌm ฤ‘ฦฐแปฃc cรกch chia sแบป bแป™ nhแป› vแป›i driver trรชn %1$s แปŸ phiรชn trฦฐแป›c, nรชn phiรชn ฤ‘รณ ฤ‘รฃ dรนng cแบทp driver PanVK thay thแบฟ. Cแบงu nแป‘i nร y khรดng hoแบกt ฤ‘แป™ng ฤ‘ฦฐแปฃc trรชn ฤ‘iแป‡n thoแบกi nร y; tแบฏt ฤ‘i sแบฝ vแบซn giแปฏ cแบทp PanVK. + Nhแบญt kรฝ Proton, DXVK vร  driver cแปงa tแปซng game cรณ trong nhแบญt kรฝ cแปงa phiรชn. Luรดn bแบญt khi GPU khรดng phแบฃi Adreno. Log phiรชn gแบงn nhแบฅt Log phiรชn ฤ‘รฃ lฦฐu Giแปฏ lแบกi %1$d bแบฃn mแป›i nhแบฅt Xรณa log + Nhแบญt kรฝ phiรชn cรณ sแบตn + Chฦฐa cรณ nhแบญt kรฝ phiรชn nร o ฤ‘ฦฐแปฃc lฦฐu. + Tแป‡p ZIP chia sแบป vร  lฦฐu ฤ‘แปu bao gแป“m phiรชn ฤ‘รฃ chแปn cรนng dแปฏ liแป‡u chแบฉn ฤ‘oรกn liรชn quan cแปงa Steam, cแปญa hร ng, cรดng cแปฅ vร  Battle.net. + %1$s ยท %2$s + Phiรชn hiแป‡n tแบกi + Chia sแบป + Lฦฐu vร o thiแบฟt bแป‹ + Xรณa + Xรณa nhแบญt kรฝ phiรชn? + Xรณa %1$s? Thao tรกc nร y khรดng thแปƒ hoร n tรกc. + ฤรฃ lฦฐu nhแบญt kรฝ phiรชn. + Khรดng thแปƒ lฦฐu nhแบญt kรฝ phiรชn. + Khรดng thแปƒ xรณa nhแบญt kรฝ phiรชn. ฤแบทt lแบกi toร n bแป™ thiแบฟt lแบญp ฤฦฐa mแปi thiแบฟt lแบญp vแป giรก trแป‹ mแบทc ฤ‘แป‹nh ฤแบทt lแบกi @@ -870,6 +923,8 @@ Dรนng lร m mร n hรฌnh chรญnh DroidDeck cรณ thแปƒ lร  แปฉng dแปฅng Mร n hรฌnh chรญnh DroidDeck khรดng bao giแป ฤ‘ฦฐแปฃc ฤ‘แป xuแบฅt lร m แปฉng dแปฅng Mร n hรฌnh chรญnh + Nรบt Mร n hรฌnh chรญnh mแปŸ + Trang hiแปƒn thแป‹ khi DroidDeck lร  แปฉng dแปฅng Mร n hรฌnh chรญnh vร  bแบกn nhแบฅn nรบt Mร n hรฌnh chรญnh Trong Thรชm trรฒ chฦกi, ฤ‘แบทt DroidDeck thร nh Bao gแป“m Hฦฐแป›ng mร n hรฌnh Hฦฐแป›ng mร n hรฌnh launcher @@ -883,15 +938,22 @@ Toร n mร n hรฌnh แบจn thanh trแบกng thรกi vร  thanh ฤ‘iแปu hฦฐแป›ng cแปงa Android Hiแป‡n thanh trแบกng thรกi vร  thanh ฤ‘iแปu hฦฐแป›ng cแปงa Android + Trรฌnh khแปŸi chแบกy hai mร n hรฌnh + Tแปฑ ฤ‘แป™ng ฤ‘ฦฐa cรกc phแบงn cแปงa trรฌnh khแปŸi chแบกy (Steam, Thฦฐ viแป‡n, Cแปญa hร ng vร  phแบงn cรฒn lแบกi) lรชn mร n hรฌnh thแปฉ hai tรญch hแปฃp cแปงa mรกy cแบงm tay. Bแบญt dรนng bแบฅt kแปณ mร n hรฌnh thแปฉ hai nร o. Tแบฏt giแปฏ trรฌnh khแปŸi chแบกy trรชn mแป™t mร n hรฌnh. + Phiรชn chฦกi hai mร n hรฌnh + Tแปฑ ฤ‘แป™ng gแบฏn menu trong game lรชn mร n hรฌnh thแปฉ hai tรญch hแปฃp thay vรฌ dแบกng cแปญa sแป• nแป•i. Bแบญt dรนng bแบฅt kแปณ mร n hรฌnh thแปฉ hai nร o. Tแบฏt giแปฏ menu trรชn mร n hรฌnh chฦกi game; bแบกn vแบซn cรณ thแปƒ chแปn mร n hรฌnh thแปฉ hai tแปซ menu ฤ‘รณ. Tแปฑ ฤ‘แป™ng Bแบญt Tแบฏt ฤiแปu khiแปƒn mร n hรฌnh dฦฐแป›i khi chฦกi game + Bร n phรญm Android cho รด nhแบญp vฤƒn bแบฃn MแปŸ bร n di chuแป™t vร  bร n phรญm trรชn mร n hรฌnh thแปฉ hai khi phiรชn bแบฏt ฤ‘แบงu. ฤang nhแบญp cho mร n hรฌnh trรชn Xong แปจng dแปฅng Mร n hรฌnh chรญnh mแบทc ฤ‘แป‹nh Chแปn mแป™t แปฉng dแปฅng Mร n hรฌnh chรญnh + แบจn trรฌnh khแปŸi chแบกy khแปi mแปฅc Gแบงn ฤ‘รขy khi khรดng cรณ phiรชn chแบกy + Chแป‰ รกp dแปฅng khi DroidDeck lร  แปฉng dแปฅng Mร n hรฌnh chรญnh mแบทc ฤ‘แป‹nh vร  khรดng cรณ phiรชn nร o ฤ‘ang chแบกy. Chแปn แปจng dแปฅng Linux (beta) Tแป‡p @@ -1003,9 +1065,172 @@ Preview Cรกc bแบฃn sแปญa mแป›i nhแบฅt, trฦฐแป›c Stable ฤรฃ mแป›i nhแบฅt + Sao chรฉp chi tiแบฟt bแบฃn dแปฑng + ฤรฃ sao chรฉp chi tiแบฟt bแบฃn dแปฑng + Mแป›i hฦกn Preview + Bแบกn ฤ‘ang ฤ‘i trฦฐแป›c Preview + Bแบฃn dแปฑng nร y mแป›i hฦกn Preview mแป›i nhแบฅt. Bแบฃn Preview tiแบฟp theo sแบฝ cแบญp nhแบญt nรณ. + Chแปn mแป™t bแบฃn dแปฑng ฤ‘แปƒ xem thay ฤ‘แป•i hoแบทc cร i ฤ‘แบทt. + ฤรฃ cร i + Cร i bแบฃn dแปฑng nร y%1$s + Quay lแบกi bแบฃn dแปฑng nร y%1$s + versionCode %1$d + Commit %1$s + Trang phรกt hร nh + PR cรณ commit mแป›i hฦกn (%1$s). Bแบฃn thแปญ nghiแป‡m cแปงa nรณ chฦฐa sแบตn sร ng nรชn bแบฃn nร y chฦฐa cรณ. + Cรณ commit mแป›i, ฤ‘ang chแป bแบฃn dแปฑng + Sแป‘ PR, tiรชu ฤ‘แป hoแบทc tรกc giแบฃ + Khรดng cรณ bแบฃn thแปญ nghiแป‡m nร o khแป›p + Cแบงn dแปฑng lแบกi (versionCode %1$d) + Cแบญp nhแบญt bแบฃn thแปญ nghiแป‡m + Bแบฃn thแปญ nghiแป‡m mแป›i cแปงa PR #%1$d + %1$s. MแปŸ Cแบญp nhแบญt ฤ‘แปƒ cร i ฤ‘แบทt. + Xem thรชm (%1$d) + Cแบงn dแปฑng lแบกi cho versionCode %2$d (%1$d) + Bแบฃn Preview trรชn main kแปƒ tแปซ bแบฃn thแปญ nghiแป‡m nร y: %1$d Bแบฃn thแปญ nghiแป‡m Thแปญ mแป™t bแบฃn sแปญa trฦฐแป›c khi nรณ ฤ‘ฦฐแปฃc phรกt hร nh Hiแป‡n khรดng cรณ + Bแบฃn build thแปญ nghiแป‡m + Cรกc bแบฃn build thแปญ nghiแป‡m + ฤang dรนng + ฤรฃ tแบกm dแปซng sau khi Android tแป‘i ฦฐu lแบกi DroidDeck + Chฦฐa tแบฃi: %1$s + ฤang chแป khแปŸi ฤ‘แป™ng lแบกi + ฤรฃ giแปฏ lแบกi + Dร nh cho phiรชn bแบฃn khรกc + Tแบกo lแบกi + Xรณa bแบฃn build nร y khแปi thiแบฟt bแป‹ + KhแปŸi ฤ‘แป™ng lแบกi bแบฑng bแบฃn nร y + Tแบฏt + Dรนng + Xรณa + Xรณa ngay + Khรดng thแปƒ chuแบฉn bแป‹ thao tรกc khแปŸi ฤ‘แป™ng lแบกi: %1$s. Hรฃy ghรฉp ฤ‘รดi gแปก lแป—i khรดng dรขy trong Cร i ฤ‘แบทt rแป“i thแปญ lแบกi. + ฤรฃ cร i bแบฃn build thแปญ nghiแป‡m + DroidDeck ฤ‘รฃ khแปŸi ฤ‘แป™ng lแบกi trรชn %1$s + ฤรฃ tแบกm dแปซng bแบฃn dแปฑng thแปญ nghiแป‡m + Android ฤ‘รฃ tแป‘i ฦฐu hรณa lแบกi DroidDeck nรชn %1$s chฦฐa ฤ‘ฦฐแปฃc nแบกp. MแปŸ Cแบญp nhแบญt ฤ‘แปƒ khแปŸi ฤ‘แป™ng lแบกi bแบฑng bแบฃn dแปฑng ฤ‘รณ. + ฤรฃ tแบฏt bแบฃn dแปฑng thแปญ nghiแป‡m + Bแบฃn dแปฑng nร y ฤ‘ฦฐแปฃc tแบกo cho mแป™t phiรชn bแบฃn DroidDeck khรกc. Bแบฃn dแปฑng vแบซn ฤ‘ฦฐแปฃc giแปฏ trong Cแบญp nhแบญt. + DroidDeck ฤ‘รฃ khรดng khแปŸi ฤ‘แป™ng ฤ‘ฦฐแปฃc bแบฑng bแบฃn dแปฑng nร y hai lแบงn + Trแปฃ lรฝ + Trแปฃ lรฝ + Trแปฃ lรฝ ฤ‘ang xแปญ lรฝ + Cร i Claude Code trong mรดi trฦฐแปng ngฦฐแปi dรนng Linux ฤ‘แปƒ sแปญ dแปฅng trแปฃ lรฝ. + Hแปi vแป mแป™t trรฒ chฦกi, mแป™t sแปฑ cแป‘ hoแบทc mแป™t thay ฤ‘แป•i cho DroidDeck + Gแปญi + Cuแป™c hแป™i thoแบกi mแป›i + Dแปซng + Bแป™ nhแป› + Xรณa + Xรณa ngay + Claude Code + Codex + Mรฃ nguแป“n DroidDeck + Bแป™ nhแป› ฤ‘แป‡m tแบฃi xuแป‘ng + Cรกc thay ฤ‘แป•i chฦฐa ฤ‘ฦฐแปฃc ฤ‘แบฉy sแบฝ bแป‹ mแบฅt + Bแบฃn dแปฑng sแบฝ tแบฃi lแบกi cรกc tแป‡p nร y + Thiแบฟt lแบญp cรณ thแปƒ cร i lแบกi; thรดng tin ฤ‘ฤƒng nhแบญp ฤ‘ฦฐแปฃc giแปฏ nguyรชn + DroidDeck ฤ‘รฃ khแปŸi ฤ‘แป™ng lแบกi bแบฑng bแบฃn dแปฑng thแปญ nghiแป‡m cแปงa bแบกn. Tiแบฟp tแปฅc tแปซ chแป— bแบกn ฤ‘ang dแปŸ. + Hแปi tแบกi sao mแป™t trรฒ chฦกi khรดng khแปŸi ฤ‘แป™ng ฤ‘ฦฐแปฃc, yรชu cแบงu giแบฃi thรญch nhแบญt kรฝ, hoแบทc thay ฤ‘แป•i DroidDeck vร  thแปญ trรชn thiแบฟt bแป‹ nร y. + Thแบฅt bแบกi: %1$s + %1$s ฤ‘รฃ kแบฟt thรบc (mรฃ thoรกt %2$d) + ฤรฃ dแปซng + Kแบฟt thรบc mร  khรดng cรณ phแบฃn hแป“i + Thแปญ lแบกi + ฤang thiแบฟt lแบญp trแปฃ lรฝ + Dแปฑng lแบกi bแบฃn dแปฑng thแปญ nghiแป‡m %1$s cแปงa tรดi cho phiรชn bแบฃn DroidDeck ฤ‘รฃ cร i vร  khแปŸi ฤ‘แป™ng lแบกi bแบฑng bแบฃn dแปฑng ฤ‘รณ. + %1$s vร o ยท %2$s ra + ฤang suy nghฤฉ + Suy nghฤฉ + ฤang suy nghฤฉ ยท %1$s + %1$s ยท %2$s + ฤแบฆU Vร€O + ฤแบฆU RA + ฤang chแบกyโ€ฆ + Khรดng cรณ kแบฟt quแบฃ: lฦฐแปฃt ฤ‘รฃ kแบฟt thรบc trฦฐแป›c + Khรดng cรณ ฤ‘แบงu ra + Nhแบญp ฤ‘แปƒ xแบฟp tin nhแบฏn tiแบฟp theo vร o hร ng ฤ‘แปฃi + Xแบฟp hร ng + Tiแบฟp theo: %1$s + Khรดng gแปญi + ฤรญnh kรจm + Xรณa + Mแบทc ฤ‘แป‹nh + Mแปฉc ฤ‘แป™ lแบญp luแบญn + Thแปฑc hiแป‡n + Chแป‰nh sแปญa + Chฦฐa cรณ thay ฤ‘แป•i nร o + Hรฃy tiแบฟn hร nh kแบฟ hoแบกch. + Gแปญi ngay + Khรกc + ฤรณng + Mแป›i nhแบฅt + ฤang lร m viแป‡c + Ngแปฏ cแบฃnh + %1$s trong %2$s + Cuแป™c trรฒ chuyแป‡n nร y ยท %1$s + Mแปฉc sแปญ dแปฅng hiแปƒn thแป‹ sau phแบฃn hแป“i ฤ‘แบงu tiรชn + Giแป›i hแบกn %1$d giแป + Giแป›i hแบกn %1$d phรบt + Giแป›i hแบกn hร ng tuแบงn + %1$d%% ยท ฤ‘แบทt lแบกi %2$s + + %1$d tแป‡p + %1$d tแป‡p + + Lรชn kแบฟ hoแบกch trฦฐแป›c + Lรชn kแบฟ hoแบกch + ฤแป xuแบฅt kแบฟ hoแบกch mร  khรดng thay ฤ‘แป•i gรฌ + Cuแป™c hแป™i thoแบกi + Chฦฐa cรณ cuแป™c hแป™i thoแบกi nร o + Vแปซa xong + Xรณa + Xรณa cuแป™c hแป™i thoแบกi vร  cรกc tแป‡p ฤ‘รญnh kรจm + Tiแบฟn trรฌnh + Khรดng cรณ gรฌ ฤ‘ang chแบกy trong khรดng gian ngฦฐแปi dรนng Linux + TรC NHร‚N + Dแปซng + Bแบฃn dแปฑng Lab + ฤang chuแบฉn bแป‹ cรกc bแบฃn dแปฑng Lab + %1$d%% ยท cรฒn khoแบฃng %2$s + cรฒn khoแบฃng %1$s + Hแปงy + Hแปงy bแบฃn dแปฑng + ฤang khแปŸi ฤ‘แป™ng + %1$d%% + ฤang ฤ‘รณng gรณi + ฤang khแปŸi ฤ‘แป™ng lแบกi DroidDeck trรชn ฤ‘รณ + Hoร n tแบฅt + Thแบฅt bแบกi: %1$s + Thiแบฟt lแบญp tรกc nhรขn + Hรฃy cร i ฤ‘แบทt mรดi trฦฐแปng chแบกy Linux trong phแบงn Thiแบฟt lแบญp trฦฐแป›c. + Thแปญ lแบกi + Bแบฏt ฤ‘แบงu trรฒ chuyแป‡n + Kแบฟt nแป‘i thiแบฟt bแป‹ + Gแปก lแป—i khรดng dรขy ฤ‘แปƒ tรกc nhรขn cรณ thแปƒ quan sรกt vร  ฤ‘iแปu khiแปƒn DroidDeck + Cร i ฤ‘แบทt %1$s + Vร o mรดi trฦฐแปng ngฦฐแปi dรนng Linux, vแป›i git, gh vร  adb + ฤฤƒng nhแบญp vร o %1$s + MแปŸ trรฌnh duyแป‡t cแปงa bแบกn + GitHub + Tรนy chแปn, ฤ‘แปƒ mแปŸ pull request + Cรดng cแปฅ build + Tรนy chแปn, cho bแบฃn build Lab trรชn thiแบฟt bแป‹ nร y ยท khoแบฃng 5 GB + Agent sแบตn sร ng + Hoร n tแบฅt thiแบฟt lแบญp Agent + ฤรฃ ฤ‘ฤƒng nhแบญp vร o %1$s + Bแบฃn build Lab + bแบฃn build nhanh + Bแบฃn build Lab nhanh + Biรชn dแป‹ch sแบตn phiรชn bแบฃn nร y ฤ‘แปƒ bแบฃn build Lab chแป‰ mแบฅt vร i phรบt ยท khoแบฃng 20 phรบt cho mแป™t lแบงn + ฤang biรชn dแป‹ch ยท %1$d%% ยท cรฒn khoแบฃng %2$s + Chuแบฉn bแป‹ + Khรดng truy cแบญp ฤ‘ฦฐแปฃc gแปก lแป—i khรดng dรขy; Ghรฉp ฤ‘รดi sแบฝ bแบญt tรญnh nฤƒng nร y + Ghรฉp ฤ‘รดi + Cร i ฤ‘แบทt + ฤฤƒng nhแบญp PR #%1$d Khรดng ฤ‘ฦฐแปฃc build cho bแบฃn DroidDeck nร y ฤรฃ cแบญp nhแบญt %1$s @@ -1241,6 +1466,9 @@ แปจng dแปฅng Thiแบฟt lแบญp Cแบญp nhแบญt + Khรกc + Chแป‰nh sแปญa thแบป + Thแบป %1$d%% Tiแบฟp tแปฅc %1$s Hiแปƒn thแป‹ nhฦฐ /root/ROMs trong mแป—i phiรชn. Bแป™ nhแป› trong แปŸ /root/Storage. @@ -1262,6 +1490,15 @@ Hแปงy hร ng chแป Bร n phรญm Android แบจn โœ• + Kรญch thฦฐแป›c trรชn mร n hรฌnh + Tแปท lแป‡ mร n hรฌnh mร  bร n phรญm chiแบฟm, bao gแป“m cแบฃ thanh tiรชu ฤ‘แป. + ฤแป™ mแป + Giแบฃm giรก trแป‹ nร y ฤ‘แปƒ thแบฅy game phรญa sau bร n phรญm. + Phรญm แบฉn + Nhแปฏng phรญm รญt dรนng sแบฝ khรดng xuแบฅt hiแป‡n trรชn bร n phรญm. + Esc vร  hร ng phรญm chแปฉc nฤƒng + Ins / Del / Home / End / PgUp / PgDn + Phรญm mลฉi tรชn KhแปŸi chแบกy %1$s Chแปn mแป™t mร n hรฌnh. Phแปฅ: %1$s. Mร n hรฌnh phแปฅ khรดng cรฒn khแบฃ dแปฅng. @@ -1746,7 +1983,24 @@ Terminal Grip + trackpad Deck Bแบฃng ฤ‘iแปu khiแปƒn + Mรกy tรญnh ฤ‘แปƒ bร n + KhแปŸi ฤ‘แป™ng mรกy tรญnh ฤ‘แปƒ bร n + Mรกy tรญnh ฤ‘แปƒ bร n ยท %1$s + Bร n di chuแป™t + Chแบกm trแปฑc tiแบฟp + Bร n di chuแป™t. Nhแบฅn ฤ‘แปƒ dรนng chแบกm trแปฑc tiแบฟp + Chแบกm trแปฑc tiแบฟp. Nhแบฅn ฤ‘แปƒ dรนng bร n di chuแป™t + ฤang khแปŸi ฤ‘แป™ng mรกy tรญnh ฤ‘แปƒ bร n KDEโ€ฆ + Mรกy tรญnh ฤ‘แปƒ bร n ฤ‘รฃ ฤ‘รณng. + Mรกy tรญnh ฤ‘แปƒ bร n khรดng thแปƒ khแปŸi ฤ‘แป™ng. Nhแบญt kรฝ nแบฑm trong thฦฐ mแปฅc bottom-desktop cแปงa phiรชn nร y. + Mรกy tรญnh ฤ‘แปƒ bร n ฤ‘รฃ tแบฏt. Chฦฐa cรณ gรฌ ฤ‘แปƒ hiแปƒn thแป‹ แปŸ ฤ‘รขy. + Hoรกn ฤ‘แป•i mร n hรฌnh + Mร n hรฌnh dฦฐแป›i hiแป‡n ฤ‘ang bแบญn + Mร n hรฌnh trรฒ chฦกi + Hiแปƒn thแป‹ trรฒ chฦกi trรชn + Mร n hรฌnh trรชn + Mร n hรฌnh dฦฐแป›i Tแบฃi xuแป‘ng Khรดng cรณ lฦฐแปฃt tแบฃi nร o ฤ‘ang chแบกy. Steam @@ -1781,6 +2035,20 @@ Nhiรชn liแป‡u, t Chรญnh %1$s t Dแปฑ trแปฏ %1$s t + Thแปi gian khung hรฌnh + %1$d giรขy qua + khung hรฌnh trung bรฌnh + 1% thแบฅp nhแบฅt + khung hรฌnh trรชn 33 ms + %1$d / phรบt + ฤรฃ chฦกi %1$s + %1$d nhรขn, tแป‘i ฤ‘a %2$s GHz + %1$d nhรขn + trรฒ chฦกi + FPS tแบกi %1$d Hz + Vแบกch ฤ‘แป lร  vแป‹ trรญ HUD hiแปƒn thแป‹ nhiแป‡t ฤ‘แป™ bแบฑng mร u ฤ‘แป. + toร n thiแบฟt bแป‹ + pin Gแปญi dแปฏ liแป‡u bแบฃng ฤ‘แป“ng hแป“ Tแปฑ ฤ‘แป™ng Bแบญt cho mแปi game trong danh sรกch nร y, kแปƒ cแบฃ game ฤ‘ฦฐแปฃc tรฌm thแบฅy sau nร y. Game bแบกn ฤ‘รฃ tแบฏt sแบฝ vแบซn tแบฏt. @@ -1804,6 +2072,10 @@ Micro ฤ‘ang tแบฏt cho game nร y. ฤแปƒ nรณi chuyแป‡n, hรฃy bแบญt Micro trong thiแบฟt lแบญp Steam cแปงa DroidDeck (ร‚m thanh) rแป“i khแปŸi ฤ‘แป™ng lแบกi game. ร‚m lฦฐแปฃng %1$d%% Thรดng sแป‘ trong game + HUD mร n hรฌnh dฦฐแป›i + Thanh trรชn mแปi tab + 1% vร  0,1% thแบฅp nhแบฅt + Nhiแป‡t ฤ‘แป™ CPU FPS CPU GPU @@ -1975,6 +2247,7 @@ ฤang khแปŸi ฤ‘แป™ng phiรชnโ€ฆ %1$d:%2$02d ฤ‘รฃ trรดi qua ยท vแบซn ฤ‘ang xแปญ lรฝ ฤang tแบฃi bแบฃn cแบญp nhแบญt client Steam ยท %1$d%% + ฤang รกp dแปฅng bแบฃn cแบญp nhแบญt แปฉng dแปฅng Steamโ€ฆ ฤang tแบฃi client Steam ยท %1$s Mแป™t lฦฐแปฃt cร i cรดng cแปฅ tฦฐฦกng thรญch ฤ‘ang chแบกy @@ -2051,11 +2324,29 @@ Viแปn hoแบกt hรฌnh cแป™ng lร m nรฉt. Khรดng phแบฃi GPU Adreno + Trรฌnh ฤ‘iแปu khiแปƒn PowerVR cแปงa hแป‡ thแป‘ng: khแบฃ nฤƒng tฦฐฦกng thรญch tรนy thiแบฟt bแป‹ + Thแปญ nghiแป‡m: RADV hoแบทc trรฌnh ฤ‘iแปu khiแปƒn Xclipse cแปงa hแป‡ thแป‘ng + PowerVR hแป‡ thแป‘ng + Sแปญ dแปฅng trรฌnh ฤ‘iแปu khiแปƒn tรญch hแปฃp sแบตn cho GPU nร y + Trรฌnh ฤ‘iแปu khiแปƒn PowerVR cแปงa hแป‡ thแป‘ng ฤ‘ฦฐแปฃc chแปn cho runtime vร  hiแปƒn thแป‹. + Chฦฐa cรณ trรฌnh ฤ‘iแปu khiแปƒn mรฃ nguแป“n mแปŸ nร o hแป— trแปฃ Mali nร y: cแบงu nแป‘i Mali ฤ‘ang bแบญt. + ฤรขy lร  bแบฃn thแปญ nghiแป‡m cho mรกy khรดng dรนng Snapdragon: cรกc bแบฃn chรญnh thแปฉc แปŸ ฤ‘รขy chแป‰ chแบกy trรชn Adreno, nรชn khรดng ฤ‘ฦฐแปฃc cร i ฤ‘รจ lรชn bแบฃn nร y. Cรกc bแบฃn thแปญ nghiแป‡m mแป›i cรณ tแบกi github.com/The412Banner/droiddeck-nonadreno-drivers. + Phiรชn chแบกy trฦฐแป›c kแบฟt thรบc vรฌ Android ฤ‘รฃ ฤ‘รณng DroidDeck ฤ‘แปƒ giแบฃi phรณng bแป™ nhแป›, khรดng phแบฃi do sแปฑ cแป‘. Hรฃy ฤ‘รณng cรกc แปฉng dแปฅng khรกc hoแบทc giแบฃm thiแบฟt lแบญp texture cแปงa game, rแป“i thแปญ lแบกi. + Mali (Venus) + cแบงu nแป‘i Mali + Chฦฐa cรณ trรฌnh ฤ‘iแปu khiแปƒn mรฃ nguแป“n mแปŸ nร o hแป— trแปฃ Mali nร y: dรนng %1$s, trรชn trรฌnh ฤ‘iแปu khiแปƒn gแป‘c cแปงa mรกy. + %1$s chฦฐa ฤ‘ฦฐแปฃc phรกt hร nh: tแบกm dรนng %2$s cho ฤ‘แบฟn khi ra mแบฏt. + %1$s khรดng khแบฃ dแปฅng, vร  trรฌnh ฤ‘iแปu khiแปƒn gแป‘c cแปงa mรกy bรกo Vulkan %2$s (Venus cแบงn 1.2): cแบงu nแป‘i Mali ฤ‘ฦฐแปฃc dรนng. + %1$s chฦฐa ฤ‘ฦฐแปฃc phรกt hร nh: cแบงu nแป‘i Mali ฤ‘ang bแบญt cho ฤ‘แบฟn khi ra mแบฏt. + ฤรฃ xแบฟp hร ng: %1$s (ฤ‘ang ฤ‘แปฃi mแป™t trรฌnh ฤ‘iแปu khiแปƒn runtime khรกc) + DXVK ฤ‘ฦฐแปฃc cung cแบฅp bแปŸi runtime PowerVR cแปงa hแป‡ thแป‘ng. Cรกc gรณi DXVK khรกc vแบซn cรณ thแปƒ ฤ‘ฦฐแปฃc lฦฐu nhฦฐng khรดng ฤ‘ฦฐแปฃc รกp dแปฅng vแป›i trรฌnh ฤ‘iแปu khiแปƒn nร y. ฤฦฐแปฃc hแป— trแปฃ Thแปญ nghiแป‡m: driver cแปงa nรณ lร  bแบฃn build thแปญ nghiแป‡m Hแป— trแปฃ thแปญ nghiแป‡m Adreno 850: cแบงn driver hiแปƒn thแป‹ vร  driver game thแปญ nghiแป‡m tฦฐฦกng thรญch; chฦฐa ฤ‘ฦฐแปฃc xรกc minh trรชn thiแบฟt bแป‹ nร y Dฦฐแป›i mแปฉc phแบงn cแปฉng ฤ‘รฃ kiแปƒm thแปญ (Adreno 725 vร  mแป›i hฦกn): cรณ thแปƒ khรดng chแบกy ฤ‘ฦฐแปฃc Khรดng ฤ‘ฦฐแปฃc hแป— trแปฃ: khรดng cรณ backend ฤ‘แป“ hแปa tฦฐฦกng thรญch cho GPU nร y + Chแบกy qua cแบงu nแป‘i Mali, trรชn trรฌnh ฤ‘iแปu khiแปƒn Vulkan gแป‘c cแปงa mรกy + Khรดng hแป— trแปฃ khi tแบฏt cแบงu nแป‘i Mali: Turnip cแบงn GPU Adreno (Snapdragon) ฤรฃ ฤ‘แบกt giแป›i hแบกn tแป‘c ฤ‘แป™ cแปงa GitHub - hรฃy thแปญ lแบกi sau GitHub trแบฃ vแป HTTP %1$d @@ -2164,7 +2455,6 @@ Cแปญa hร ng game Steam Tรนy chแป‰nh - Cแปญa hร ng Mแปฉc tแป‘c ฤ‘แป™ tแบฃi Cรขn bแบฑng Nhanh @@ -2203,6 +2493,7 @@ ฤang chแป lฦฐแปฃt tแบฃi Battle.net khรกcโ€ฆ MแปŸ Battle.net vร  ฤ‘ฤƒng nhแบญp mแป™t lแบงn, sau ฤ‘รณ cร i trรฒ chฦกi cแปงa nรณ tแบกi ฤ‘รขy. Trรฌnh tแบฃi xuแป‘ng cแปงa Blizzard ฤ‘รฃ dแปซng: %1$s + Trรฌnh tแบฃi xuแป‘ng cแปงa Blizzard khรดng cรฒn tiแบฟn triแปƒn. Lแป—i Blizzard %1$s Cแบญp nhแบญt Trรฒ chฦกi Blizzard @@ -2210,6 +2501,7 @@ Bแป‹ giรกn ฤ‘oแบกn Cร i ยท %1$s Lแบฅy miแป…n phรญ + ฤang thรชm vร o thฦฐ viแป‡nโ€ฆ Xem trรชn %1$s Mua ยท %1$s ฤรฃ cร i @@ -2256,6 +2548,12 @@ Sแบฏp xแบฟp Nhรฃn thanh bรชn Hiแป‡n tรชn dฦฐแป›i cรกc biแปƒu tฦฐแปฃng thanh bรชn. Tแบฏt ฤ‘แปƒ thanh bรชn gแปn hฦกn. + Thรบ cฦฐng cแปงa trแปฃ lรฝ + DeeDee nแป•i trรชn trรฌnh khแปŸi chแบกy vร  cรกc trรฒ chฦกi, cho thแบฅy ฤ‘iแปu trแปฃ lรฝ ฤ‘ang lร m. + Trรชn cรกc แปฉng dแปฅng khรกc + Cho DeeDee nแป•i trรชn mแปi แปฉng dแปฅng vร  mแปŸ khung trรฒ chuyแป‡n cแปงa DeeDee ngay tแบกi ฤ‘รณ + Cho phรฉp + Trรฒ chuyแป‡n vแป›i DeeDee Hiแปƒn thแป‹ Thแบป lแป›n hฦกn Thแบป nhแป hฦกn @@ -2538,7 +2836,14 @@ %1$s ยท cแบงn khแปŸi ฤ‘แป™ng lแบกi Thiแบฟt bแป‹ nร y Xรณa %1$s? - Chแบฉn ฤ‘oรกn + Nhร  phรกt triแปƒn + Hรฌnh mแป nhรฃn bแบฃn dแปฑng + Hiแปƒn thแป‹ nhรฃn bแบฃn dแปฑng thแปญ nghiแป‡m hoแบทc Lab trรชn mร n hรฌnh. ฤฦฐแปฃc bแบญt theo mแบทc ฤ‘แป‹nh. + Chia sแบป cรกc gรณi chแบฉn ฤ‘oรกn + Phiรชn vร  thiแบฟt bแป‹ + ฤแป“ hแปa + Game vร  khแบฃ nฤƒng tฦฐฦกng thรญch + Tแบฅt cแบฃ cรกc gรณi Sแบตn sร ng ฤ‘แปƒ chฦกi Chฦฐa sแบตn sร ng ฤ‘แปƒ chฦกi runtime %1$s @@ -2577,6 +2882,9 @@ Bแบญt thร nh tรญch GOG trong phแบงn cร i ฤ‘แบทt Stores Khรดng cรณ thร nh tรญch; hรฃy kiแปƒm tra nhแบญt kรฝ phiรชn ฤรฃ mแปŸ khรณa thร nh tรญch + Mali (Venus): tแบฏt + Mali (Venus): bแบญt + Trรฌnh ฤ‘iแปu khiแปƒn trรชn %1$s bรกo Vulkan %2$s. Mali (Venus) cแบงn Vulkan 1.2 trแปŸ lรชn (gamescope khรดng khแปŸi ฤ‘แป™ng trรชn bแบฃn cลฉ hฦกn), nรชn cรกc phiรชn chแบกy bแป qua Venus vร  dรนng cแบทp trรฌnh ฤ‘iแปu khiแปƒn PanVK thay vร o ฤ‘รณ. Dรกn Cแบงn analog trรกi Cแบงn analog phแบฃi @@ -2861,7 +3169,7 @@ Chแปn thฦฐ mแปฅcโ€ฆ Dรนng bแบฅt kแปณ thฦฐ mแปฅc nร o trรชn thแบป SD hoแบทc แป• USB Game ฤ‘ฦฐแปฃc ฤ‘แบทt vร o thฦฐ mแปฅc Games bรชn trong vแป‹ trรญ ฤ‘รฃ chแปn. Game hiแป‡n cรณ khรดng bแป‹ di chuyแปƒn. - ฤi ฤ‘รขu + Mแปฅc chiแบฟm bแป™ nhแป› Game Steam Dแปฏ liแป‡u game Prefix %1$s ยท workshop %2$s ยท shader %3$s @@ -2930,6 +3238,7 @@ Bแป™ cร i VC++ vร  DirectX mร  game cแบงn Chแบกy game Linux x86 Cรดng cแปฅ Steam + Steam tแบฃi mแปฅc nร y cho cรกc game cรณ anti-cheat, kแปƒ cแบฃ khi ฤ‘ang tแบฏt. Xรณa nรณ sแบฝ khiแบฟn quรก trรฌnh cร i ฤ‘แบทt cแปงa cรกc game ฤ‘รณ bแป‹ kแบนt แปŸ 0% DroidDeck chแบกy game mร  khรดng cแบงn runtime nร y Proton x86, DroidDeck khรดng chแบกy ฤ‘ฦฐแปฃc Mแบทc ฤ‘แป‹nh cho mแปi game @@ -2993,6 +3302,19 @@ ฤรฃ giแปฏ Game ngoร i Steam vร  prefix Steam dรนng chung Prefix cแปงa game tแปซ cแปญa hร ng hoแบทc thรชm thแปง cรดng + Prefix Steam dรนng chung + Steam chแบกy cรกc trรฌnh hแป— trแปฃ Windows riรชng tแบกi ฤ‘รขy + Xรณa prefix nร y (%1$s). Steam sแบฝ tแบกo prefix mแป›i vร o lแบงn tแป›i khi cแบงn. + Mแป™t แปฉng dแปฅng cแปญa hร ng vร  cรกc game chแบกy cรนng nรณ + ฤฦฐแปฃc dรนng bแปŸi %1$s + Game ngoร i Steam %1$s + Khรดng khแป›p vแป›i game nร o nรชn ฤ‘ฦฐแปฃc giแปฏ lแบกi + Gแปก mแปฅc ฤ‘รฃ chแปn ยท %1$s + Gแปก cร i ฤ‘แบทt mแปฅc ฤ‘รฃ chแปn ยท %1$s + Prefix Wine + Bแบฃn lฦฐu vร  thiแบฟt lแบญp bรชn trong sแบฝ mแบฅt; bแบฃn lฦฐu Steam Cloud vแบซn แปŸ trong tร i khoแบฃn cแปงa bแบกn. + Bแป™ nhแป› ฤ‘แป‡m shader + Prefix %1$s ยท shader %2$s Gรณi ฤ‘รฃ tแบฃi Bแบฃn gแป‘c ฤ‘รฃ giแปฏ Chฦฐa tแบฃi gรณi thร nh phแบงn nร o. @@ -3027,6 +3349,8 @@ DroidDeck ยท %1$d fps 60 fps mฦฐแปฃt hฦกn nhฦฐng tแป‘n CPU hฦกn khi Steam ฤ‘ang khแปŸi ฤ‘แป™ng. Video chแปn trong cร i ฤ‘แบทt cแปงa chรญnh Steam cลฉng hiแป‡n แปŸ ฤ‘รขy. ร‚m thanh + Bแป qua phim khแปŸi ฤ‘แป™ng + Dรนng ฤ‘oแบกn clip ฤ‘en 0,1 giรขy lร m phim khแปŸi ฤ‘แป™ng cแปงa Steam. รp dแปฅng trong phiรชn chแบกy tiแบฟp theo. Video cแปงa bแบกn MP4, MOV, MKV hoแบทc WebM. ฤแป‹nh dแบกng khรกc vร  tแป‡p trรชn %1$d MB ฤ‘ฦฐแปฃc chuyแปƒn sang WebM 720p ngay trรชn thiแบฟt bแป‹, tแป‘i ฤ‘a %2$d giรขy. Nhแบญp @@ -3488,6 +3812,7 @@ Giแปฏ Alt+Tab, phรญm Win vร  nรบt Trang chแปง trong phiรชn DroidDeck ฤ‘ang dรนng thay vรฌ Android. Bแบญt ฤแป™ sรกng trong Thiแบฟt lแบญp โ†’ Tรญch hแปฃp Steam Cแบงu Mali: tแบฏt + %1$s khรดng thแปƒ dรนng cแบงu nแป‘i Mali (cแบงn GPU Mali khรดng cรณ ฤ‘ฦฐแปng dแบซn qua trรฌnh ฤ‘iแปu khiแปƒn hแป‡ thแป‘ng), nรชn cรดng tแบฏc nร y khรดng cรณ tรกc dแปฅng แปŸ ฤ‘รขy. Cแบงu Mali: bแบญt %1$s khรดng phแบฃi Adreno. Cแบงu Vulkan thแปญ nghiแป‡m ฤ‘ang bแบญt: phiรชn vแบฝ qua trรฌnh ฤ‘iแปu khiแปƒn cแปงa chรญnh ฤ‘iแป‡n thoแบกi. Cรณ thแปƒ gแบทp lแป—i; hรฃy gแปญi nhแบญt kรฝ phiรชn. Chแบฟ ฤ‘แป™ an toร n @@ -3513,6 +3838,25 @@ Chuyแปƒn ra sau Cร i ฤ‘แบทt tiแป‡n รญch Xรณa tiแป‡n รญch + Giao diแป‡n + Gรณi biแปƒu tฦฐแปฃng + Theo hแป‡ thแป‘ng + Nแปn theo mร u แปฉng dแปฅng + Kรญch thฦฐแป›c biแปƒu tฦฐแปฃng + Nhแป + Vแปซa + Lแป›n + แบจn tรชn แปฉng dแปฅng + Khoแบฃng cรกch + Hแบนp + Vแปซa + Rแป™ng + ฤแป•i biแปƒu tฦฐแปฃng + ฤแบทt lแบกi biแปƒu tฦฐแปฃng + Tรฌm biแปƒu tฦฐแปฃng + ฤang tแบฃi biแปƒu tฦฐแปฃngโ€ฆ + Khรดng tรฌm thแบฅy biแปƒu tฦฐแปฃng. + Biแปƒu tฦฐแปฃng tรนy chแป‰nh Thรชm vร o thฦฐ mแปฅc Thฦฐ mแปฅc mแป›i Xรณa khแปi thฦฐ mแปฅc @@ -3627,5 +3971,81 @@ Khรดng thแปƒ nhแบญp bแป‘ cแปฅc nร y Tuyแบฟt ฤ‘แป thแบซm + Bแป mแบทt trแบฏng vแป›i ฤ‘iแปƒm nhแบฅn mร u ฤ‘แป. + Nhแบกc nแปn + Nhแบกc + Tรนy chแปn phรกt + Yรชu thรญch + Bแป™ sฦฐu tแบญp + Chฦฐa cรณ bแป™ sฦฐu tแบญp nร o. Chแบกm vร o biแปƒu tฦฐแปฃng dแบฅu trang ฤ‘แปƒ tแบกo. + ฤรฃ lฦฐu + Tแบกo bแป™ sฦฐu tแบญp + Sแบฏp xแบฟp cรกc bร i ฤ‘รฃ lฦฐu + Mแป›i + Tแบกo + Tรชn bแป™ sฦฐu tแบญp + Nhแบญp tรชn chฦฐa ฤ‘ฦฐแปฃc bแป™ sฦฐu tแบญp nร o khรกc sแปญ dแปฅng + Quแบฃn lรฝ + ฤแป•i tรชn + Thรชm bร i hรกt + Thรชm (%1$d) + Xรณa bร i hรกt + Xรณa bแป™ sฦฐu tแบญp + Xรณa %1$s? + Cรกc bร i hรกt vแบซn cรฒn trรชn thiแบฟt bแป‹ cแปงa bแบกn. Chแป‰ bแป™ sฦฐu tแบญp bแป‹ xรณa. + Chแปn + Chแปn tแบฅt cแบฃ + Bแป chแปn tแบฅt cแบฃ + ฤรฃ chแปn %1$d + Thรชm vร o bแป™ sฦฐu tแบญp + Thรชm vร o yรชu thรญch + Xรณa khแปi bแป™ sฦฐu tแบญp + Tรฌm bร i hรกt + Thแปฉ tแปฑ album + Dร i nhแบฅt trฦฐแป›c + Ngแบฏn nhแบฅt trฦฐแป›c + Bร i hรกt + Cao ฤ‘แป™ + ฤแบทt lแบกi + Bแป qua khoแบฃng lแบทng + Hแบนn giแป ngแปง + %1$d phรบt + Hแบฟt bร i + Cรฒn %1$s + Bแป™ cรขn bแบฑng รขm + Tฤƒng รขm trแบงm + Thiแบฟt bแป‹ nร y khรดng cรณ bแป™ cรขn bแบฑng รขm + Bแบญt trong game + Tiแบฟp tแปฅc phรกt nhแบกc nแปn khi game ฤ‘ang chแบกy + Chฦฐa cรณ nhแบกc nแปn nร o ฤ‘ฦฐแปฃc cร i ฤ‘แบทt. + Tรฌm nhแบกc nแปn + Thรชm thฦฐ mแปฅc nhแบกc nแปn + Khรดng cรณ tแป‡p รขm thanh trong thฦฐ mแปฅc ฤ‘รณ + Tแป•ng thแปi lฦฐแปฃng + %1$d bร i / %2$s + ฤฤฉa %1$s + Phรกt ngแบซu nhiรชn + Trฦฐแป›c + Phรกt + Tแบกm dแปซng + Tiแบฟp + Tแบฏt lแบทp lแบกi + Lแบทp lแบกi tแบฅt cแบฃ + Lแบทp lแบกi mแป™t bร i + ร‚m lฦฐแปฃng + Khรดng cรณ tแป‡p รขm thanh trong nhแบกc nแปn nร y + Khรดng thแปƒ khแปŸi chแบกy + Khรดng cรณ trรฌnh duyแป‡t web nร o ฤ‘แปƒ mแปŸ liรชn kแบฟt nร y. + Nแบฏm + Thแบฃ + Lฦฐu + Giแปฏ ฤ‘แปƒ ฤ‘แบทt lแบกi + Cแปญa hร ng + Thแปi gian khung hรฌnh + Tแป‘c ฤ‘แป™ khung hรฌnh trung bรฌnh + Mรกy chแปง hiแปƒn thแป‹ + Trแบกng thรกi HDR + ฤang hiแปƒn thแป‹ + %1$d trรชn %2$d diff --git a/app/src/main/res/values-zh-rCN/input_library.xml b/app/src/main/res/values-zh-rCN/input_library.xml new file mode 100644 index 0000000000..00c716c4cc --- /dev/null +++ b/app/src/main/res/values-zh-rCN/input_library.xml @@ -0,0 +1,132 @@ + + + ๆ— ๆณ•่ฏปๅ–็š„่พ“ๅ…ฅ่ฎพ็ฝฎๅทฒไฟๅญ˜ๅœจๆขๅคๅ‰ฏๆœฌไธญใ€‚ไฝ ๅฏไปฅ็ปง็ปญ็ผ–่พ‘ๆขๅค็š„้…็ฝฎใ€‚ + ๅฑžๆ€ง + ็‚นๅ‡ปๅฑžๆ€ง + %1$s ยท ็‚นๅ‡ป + ๆŒ‰้”ฎ + ๆ‘‡ๆ†ใ€่งฆๆŽงๆฟๅ’Œๆ‰ณๆœบ + ้š่—ๅทฅๅ…ท + ๆ‰‹ๆŸ„ + ๆŠŠๆŸ„่พ“ๅ…ฅๅ‘้€็ป™ Steam Input ๆˆ–ๆธธๆˆใ€‚ + ๆญคๆŽงไปถไธๅ‘้€ๆ‰‹ๆŸ„ใ€้ผ ๆ ‡ๆˆ–้”ฎ็›˜่พ“ๅ…ฅใ€‚ + ้ผ ๆ ‡็‚นๅ‡ป + DroidDeck ๅŠจไฝœ + ๅŠจไฝœ + ๆปšๅŠจ้€Ÿๅบฆ๏ผš%1$d ๆญฅ/็ง’ + + ๆ–ฐๅปบ้…็ฝฎ + + ๆ–ฐๅปบๅธƒๅฑ€ + %1$s ยท ๆœ‰ %2$d ไธช้…็ฝฎๅœจ็”จใ€‚ไฟฎๆ”นไผšๅบ”็”จๅˆฐๆ‰€ๆœ‰ไฝฟ็”จ่ฟ™ไบ›็ป‘ๅฎš็š„้…็ฝฎใ€‚ + ้‡ๅ‘ฝๅ + ๅˆ ้™ค + ๅ…ˆๅพ€ๅธƒๅฑ€้‡ŒๆทปๅŠ ๆŽงไปถ๏ผŒๅ†ไธบๅฎƒไปฌๆŒ‡ๅฎšๅŠจไฝœใ€‚ + ๆ— ๆณ•ไฟๅญ˜่พ“ๅ…ฅ่ฎพ็ฝฎ + ๅ็งฐ + ่ตทๅง‹่‡ช + ๆŒ‰้”ฎ + ๆ‘‡ๆ† + ่งฆๆŽงๆฟ + ๅๅญ—้”ฎ + ๆ‰ณๆœบ + ๅฎŒๆˆ + ๆ’ค้”€ + + ๆทปๅŠ  + ๆ‹–ๅŠจๅฏ็งปๅŠจ๏ผŒๆ‹–่ง’ๅฏ่ฐƒๆ•ดๅคงๅฐ๏ผŒ็‚นใ€Œๅฑžๆ€งใ€ๅฏๆŒ‡ๅฎšๅŠจไฝœใ€‚ + ๆญฃๅœจๅ‰ฏๅฑไธŠ็ผ–่พ‘ + ๆ‰€้€‰ๆ˜พ็คบๅ™จไธๅฏ็”จใ€‚่ฟžไธŠๅฎƒๆ‰่ƒฝๆŒ‰ๅฎž้™…ๅฐบๅฏธ็ผ–่พ‘ๆญคๅธƒๅฑ€ใ€‚ + ไธขๅผƒๆœชไฟๅญ˜็š„ๅธƒๅฑ€ไฟฎๆ”น๏ผŸ + ๆญคๅธƒๅฑ€ๆœ‰ %1$d ไธช้…็ฝฎๅœจ็”จใ€‚ไฟๅญ˜็š„ไฟฎๆ”นไผšๅบ”็”จๅˆฐๅ…จ้ƒจใ€‚ + ้ป˜่ฎค้…็ฝฎ + ๆกŒ้ขๆจกๅผ + ๆธธๆˆๆจกๅผ + ๆกŒ้ขๅ’Œๆธธๆˆ็š„้ป˜่ฎค + ๆธธๆˆๆจกๅผ็š„้ป˜่ฎค + ๆกŒ้ขๆจกๅผ็š„้ป˜่ฎค + ่ฎพๅค‡่ฎพ็ฝฎ + ๆŽงๅˆถ + ๆŒ‰้”ฎใ€ๆ‘‡ๆ†ใ€ๆ‰ณๆœบๅ’Œ้ขๅค–ๆŒ‰้”ฎ + ๅคๅˆถ้…็ฝฎ + ้‡็ฝฎๅŠจไฝœ + ๆŠŠ %1$s ็š„ๅŠจไฝœ้‡็ฝฎไธบๅŸบ็ก€้…็ฝฎ็š„้ป˜่ฎคๅ€ผ๏ผŸๅธƒๅฑ€ๅ’Œๅ…ถๅฎƒ้…็ฝฎไธๅ˜ใ€‚ + ๅˆ ้™ค %1$s๏ผŸไฝฟ็”จๅฎƒ็š„ๆจกๅผไผšๅ›žๅˆฐๅ†…็ฝฎ้ป˜่ฎค้…็ฝฎใ€‚ๅทฒไฟๅญ˜็š„ๅธƒๅฑ€ๅ’Œๅ…ฑไบซ่ฎพ็ฝฎไปๅฏ็”จใ€‚ + ๆ˜พ็คบ + ๅฏนๆ‰€ๆœ‰้…็ฝฎ็”Ÿๆ•ˆใ€‚ๆธธๆˆๆจกๅผไธ‹ๆฒกๆŽฅๆ‰‹ๆŸ„ๆ—ถ๏ผŒAuto ไผšๆ˜พ็คบไธปๅฑๆŽงๅˆถใ€‚ + ๅœจๅฑๅน•ไธŠ็ผ–่พ‘ + ๅทฒไฟๅญ˜็š„ๅธƒๅฑ€โ€ฆ + ้€‰ๆ‹ฉไธ€ไธชๅธƒๅฑ€ๆˆ–่‡ชๅปบไธ€ไธช + ๅœจๅ‰ฏๅฑไผš่ฏ่œๅ•้‡Œ้€‰ใ€Œ้…็ฝฎๆŽงๅˆถใ€ใ€‚ๆŽงๅˆถ่œๅ•้‡Œ็š„้…็ฝฎๅ’Œๅ‰ฏๅฑ้€‰ๆ‹ฉๅ†ณๅฎšๆ˜พ็คบๅ“ชไบ›ๆŽงไปถใ€‚ + ๆŒ‰้”ฎๅŠจไฝœ + ไธŽ %1$s ๅ…ฑไบซใ€‚ไฟฎๆ”นไนŸไผšๅบ”็”จๅˆฐ่ฟ™ไบ›้…็ฝฎใ€‚ + ๅค็”จ่ฎพ็ฝฎ + ไฝฟ็”จ่ฎพ็ฝฎๆฅ่‡ชโ€ฆ + ไปŽๅฆไธ€ไธช้…็ฝฎๅคๅˆถ๏ผŒๆˆ–ไฟๆŒ่ฎพ็ฝฎๅ…ฑไบซ + ่ฎพไธบ็‹ฌ็ซ‹ + ไฟ็•™ๅฝ“ๅ‰่ฎพ็ฝฎๅนถๅœๆญขๅ…ฑไบซไฟฎๆ”น + ๅธƒๅฑ€ไฟๅญ˜ๆŽงไปถๅ’Œไฝ็ฝฎใ€‚ๆฏไธช้…็ฝฎๅฏๅ„่‡ชๆŒ‡ๅฎšๅŠจไฝœใ€‚ๅœจ็›ฎๆ ‡ๅฑๅน•ไธŠๆŒ‰ๅฎž้™…ๅฐบๅฏธ็ผ–่พ‘ใ€‚ + ๅฝ“ๅ‰ๅธƒๅฑ€ + ๅˆ ้™คๆœชไฝฟ็”จ็š„ๅธƒๅฑ€ %1$s ๅŠๅ…ถไฟๅญ˜็š„ๅŠจไฝœ๏ผŸ + ้‡ๅ‘ฝๅๅฝ“ๅ‰ๅธƒๅฑ€ + ไปŽๅฆไธ€ไธช้…็ฝฎๅค็”จ %1$sใ€‚ๅ…ถๅฎƒๆŽงๅˆถๆฅๆบไฟๆŒไธๅ˜ใ€‚ + ไฟๆŒ็‰ฉ็†ๆŽงๅˆถๅ…ฑไบซ + ้ป˜่ฎคๆƒ…ๅ†ตไธ‹ๆ‰€ๆœ‰ๆŽงไปถๅ’Œ่‡ชๅฎšไน‰ๅธƒๅฑ€้ƒฝๆ˜ฏ็‹ฌ็ซ‹ๅ‰ฏๆœฌใ€‚ๅ…ฑไบซๅช่ฟžๆŽฅ็‰ฉ็†ๆŽงๅˆถใ€‚ + ไฝฟ็”จ่ฟ™ไบ›ๆŽงไปถๅ’Œไฝ็ฝฎใ€‚ๅ…ฑไบซไผš่ฎฉไน‹ๅŽ็š„ๅ‡ ไฝ•ไฟฎๆ”นไฟๆŒๅŒๆญฅ๏ผŒๆŒ‰้”ฎๅŠจไฝœไปๅ„่‡ช็‹ฌ็ซ‹ใ€‚ๆข็”จๅ…ถๅฎƒๅธƒๅฑ€ๆ—ถๅŠจไฝœๆ˜ฏๆœชๆŒ‡ๅฎš็š„ใ€‚ + ๅคๅˆถ่ฟ™ไบ›ๆŽงไปถๅ’ŒๅŠจไฝœ๏ผŒๆˆ–้“พๆŽฅๅฎƒไปฌ๏ผŒ่ฎฉไน‹ๅŽ็š„ไฟฎๆ”นๅŒๆ—ถไฝœ็”จไบŽไธคไธช้…็ฝฎใ€‚ + ไฟๆŒๅ…ฑไบซ + ็‹ฌ็ซ‹ๅ‰ฏๆœฌ + ไปŽๆŒ‰ไธ‹ไฝ็ฝฎๅผ€ๅง‹ + ไธไฝฟ็”จๆ—ถ้š่—ๆ‘‡ๆ† + ๅทฅๅ…ท + ่‡ชๅŠจ (%1$s) + ่‡ชๅฎšไน‰ (%1$s) + ๅฆๅญ˜ไธบๆ–ฐ้…็ฝฎ + ้…็ฝฎๆŽงๅˆถ + ้…็ฝฎ + ้ผ ๆ ‡่งฆๆŽงๆฟๆ‰‹ๅŠฟ + ็ป‘ๅฎšๅˆฐ้ผ ๆ ‡ๆŒ‡้’ˆๆ—ถ๏ผš่ฝป็‚น็‚นๅ‡ปใ€ๆŒ‰ไฝๆ‹–ๅŠจใ€ๅŒๆŒ‡ๆปšๅŠจใ€‚ + %1$s ๆœ‰ๅฟซๆท่œๅ•่ฆ†็›–ใ€‚ๅœจ้‚ฃ้‡Œ้€‰ใ€Œ่‡ชๅŠจใ€ไผšไฝฟ็”จๅฎƒ็š„้ป˜่ฎค้…็ฝฎๅ’Œๅ…จ้ƒจไธ‰ไธชๅทฒไฟๅญ˜้ƒจๅˆ†ใ€‚ + DroidDeck ่พ“ๅ…ฅ + ๆ‘‡ๆ†ๆœไปปๆ„ๆ–นๅ‘ๆŽจๅŠจๆœŸ้—ดไฟๆŒ๏ผš่ถ…่ฟ‡ 55% ๆ—ถๆŒ‰ไธ‹๏ผŒไฝŽไบŽ 35% ๆ—ถๆพๅผ€ใ€‚็”จใ€Œๆ–นๅ‘้”ฎใ€้€ๆ–นๅ‘ๆŒ‡ๅฎšใ€‚DroidDeck ๅŠจไฝœๆฏๆฌกๆŽจๅŠจๅชๆ‰ง่กŒไธ€ๆฌกใ€‚ๆ‘‡ๆ†็‚นๅ‡ปๅ•็‹ฌ่ฎพ็ฝฎใ€‚ + ๆŒ‰ไฝ่งฆๆŽงๆฟๆœŸ้—ดไฟๆŒ๏ผŒๆŠฌๆ‰‹ๆ—ถๆพๅผ€ใ€‚DroidDeck ๅŠจไฝœๆฏๆฌก่งฆๆ‘ธๆ‰ง่กŒไธ€ๆฌกใ€‚่งฆๆŽงๆฟ็‚นๅ‡ปๅ•็‹ฌ่ฎพ็ฝฎใ€‚ + ๆ‰ณๆœบ่ถ…่ฟ‡ 55% ๆ—ถไฟๆŒ๏ผŒไฝŽไบŽ 35% ๆ—ถๆพๅผ€ใ€‚DroidDeck ๅŠจไฝœๆฏๆฌกๆŒ‰ไธ‹ๆ‰ง่กŒไธ€ๆฌกใ€‚ + ๆปšๅŠจๆ–นๅ‘ + ๅž‚็›ด + ๆฐดๅนณ + ๆฐดๅนณๆปšๅŠจ + ๆต‹้‡ + ๆ‰“ๅผ€่ฎฐๅฝ•๏ผŒๅœจ่ฟ่กŒไธญ็š„ไผš่ฏ้‡Œไฝฟ็”จๆŽงไปถ๏ผŒ็„ถๅŽๅ›žๆฅ่ฏปๅ–็ป“ๆžœใ€‚ๅชๆต‹ DroidDeck ็š„ๅ‘้€ๆ—ถ้—ด๏ผŒไธๅซๆ˜พ็คบๅปถ่ฟŸใ€‚App ่ฟ›็จ‹ๅ…ณ้—ญๆ—ถ่ฎฐๅฝ•็ป“ๆŸใ€‚ + %1$d ไธชๆŽงไปถ + ๅ…ถๅฎƒๅทฒไฟๅญ˜็š„ๅธƒๅฑ€ (%1$d) โ–พ + ้š่—ๅ…ถๅฎƒๅทฒไฟๅญ˜็š„ๅธƒๅฑ€ (%1$d) โ–ด + ไธป้กต / Guide + ่ฟ”ๅ›ž ยท ๅ•ๅ‡ป + ่ฟ”ๅ›ž ยท ๅŒๅ‡ป + ่ฟ”ๅ›ž ยท Steam ้‡Œไธคไธ‹๏ผŒๆกŒ้ขไธŠไธ€ไธ‹ + Steam ๆจกๅผไธ‹ใ€‚ๆŒ‰ไฝ่ฟ”ๅ›žไนŸไผšๆ‰“ๅผ€ๅฟซๆท่œๅ•ใ€‚ + ๆขๅค้ป˜่ฎค + ้ขๆฟ้€‰ๆ‹ฉไผš่ขซ่ฎฐไฝใ€‚ๆกŒ้ขไผšๆ‰“ๅผ€็ฌฌไบŒไธชๅทฅไฝœๅŒบ๏ผŒไธๅˆ‡ๆขไผš่ฏๆˆ–ๅฎƒ็š„่พ“ๅ…ฅ้…็ฝฎใ€‚ + ่™šๆ‹Ÿๆ‰‹ๆŸ„ + Steam ๆˆ–ๆธธๆˆ็œ‹ๅˆฐ็š„ๆ‰‹ๆŸ„็ฑปๅž‹ใ€‚ + ่งฆๆ‘ธๅฑ + ๆธธๆˆ็”ป้ขไธŠ็š„่งฆๆ‘ธๅฆ‚ไฝ•ๅค„็†ใ€‚้…็ฝฎ้‡Œ็š„ๆŒ‰้”ฎไฟๆŒๅ„่‡ชๆŒ‡ๅฎš็š„ๅŠจไฝœใ€‚ + ่งฆๆ‘ธๅ…‰ๆ ‡ + ๅœจๆธธๆˆ็”ป้ขไธŠ็›ดๆŽฅ่งฆๆ‘ธๆ—ถๆ˜พ็คบๆŒ‡้’ˆใ€‚ + ่งฆๆ‘ธๅนถๆŒ‰ไฝ + ๆ‰‹ๆŒ‡ๆŒ‰ไฝๆธธๆˆ็”ป้ขๆ—ถ็š„้ผ ๆ ‡ๅŠจไฝœใ€‚ + ่ฟ”ๅ›ž้”ฎ็‚นๅ‡ป + ็ฌฌไธ€ไธชๅŠจไฝœ๏ผšๅ•ๅ‡ปใ€‚็ฌฌไบŒไธชๅŠจไฝœ๏ผšๅŒๅ‡ปใ€‚ + ๅผ€ๅ…ณๆŒ‰้”ฎ + ็‚นไธ€ไธ‹ๆŒ‰ไฝ๏ผŒๅ†็‚นไธ€ไธ‹ๆพๅผ€ใ€‚ๆ‰“ๅผ€่œๅ•ๆˆ–ๅˆ‡ๆข้…็ฝฎไผšๆพๅผ€ๆŒ‰้”ฎใ€‚ + ๅฝข็Šถ + ๅœ†่ง’ + ่ƒถๅ›Š + ๅœ†ๅฝข + ็Ÿฉๅฝข + ๆŒ‰้”ฎๆ–‡ๅญ— + ๆ–‡ๅญ— + ๅฏผๅ…ฅ็š„ๅ›พ็‰‡ + ็‹ฌ็ซ‹ๆ–œๅ‘้”ฎ + ็ป™ๆฏไธชๆ–œๅ‘ๆŒ‡ๅฎšไธ€ไธช้”ฎใ€‚็ฉบ็š„ๆ–œๅ‘ไผšๆŒ‰็›ธ้‚ป็š„ไธคไธชๆ–นๅ‘ใ€‚ + ็›ธ้‚ปๆ–นๅ‘ + ๆ—ง็š„ๅฑๅน•ๆŒ‰้”ฎๅทฒๅญ˜ไธบไธ‹ๆ–น็š„ๅฏผๅ…ฅ้…็ฝฎใ€‚้€‰ไธ€ไธชไฝฟ็”จๆˆ–็ผ–่พ‘ใ€‚ๅฝ“ๅ‰้€‰ไธญ็š„้…็ฝฎไฟๆŒไธๅ˜ใ€‚ + ๆ— ๆณ•่‡ชๅŠจๅฏผๅ…ฅๆ—ง็š„ๅฑๅน•ๆŒ‰้”ฎใ€‚ๅŽŸ่ฎพ็ฝฎๅทฒไฟ็•™ใ€‚ + diff --git a/app/src/main/res/values-zh-rCN/input_strings.xml b/app/src/main/res/values-zh-rCN/input_strings.xml new file mode 100644 index 0000000000..dabfb3b4ee --- /dev/null +++ b/app/src/main/res/values-zh-rCN/input_strings.xml @@ -0,0 +1,38 @@ + + + ่พ“ๅ…ฅ้…็ฝฎ + ้…็ฝฎ + ็‰ฉ็†ๆ‰‹ๆŸ„ + ไธปๅฑ + ๅ‰ฏๅฑ + ๅŽŸ็”Ÿ / Steam Input + ๅŽŸ็”Ÿ๏ผš%1$s + ๅ‘้€ๅฆไธ€ไธชๆ‰‹ๆŸ„ๆŒ‰้”ฎ + ๅทฒ็ฆ็”จ + ๆŒ‰้”ฎๆˆ–็ป„ๅˆ้”ฎ + ๆ–นๅ‘้”ฎ + ็งปๅŠจๆŒ‡้’ˆ + ๆŒ‡้’ˆ้€Ÿๅบฆ๏ผš%1$d + ๆปšๅŠจ + ๅž‚็›ดๆปšๅŠจ + ้ผ ๆ ‡ๅทฆ้”ฎ + ้ผ ๆ ‡ๅณ้”ฎ + ้ผ ๆ ‡ไธญ้”ฎ + ๆ‰“ๅผ€ DroidDeck ่œๅ• + ๆ˜พ็คบ้”ฎ็›˜ + ๆ‰“ๅผ€ Steam ่œๅ• + ๆ‰“ๅผ€ Steam ๅฟซๆท่œๅ• + ็งป้™คๆŽงไปถ + ๆทปๅŠ ๆŽงไปถ + ๆœฌ่ฎพๅค‡ไธ“็”จๆŒ‰้”ฎ + ๆŒ‡ๅฎš็‰ฉ็†ๆŒ‰้”ฎ + ๆพๅผ€ๆŒ‰้”ฎ๏ผŒ็„ถๅŽ้€‰ๆ‹ฉ็ผ–่พ‘ใ€้‡่ฏ•ๆˆ–ๅ–ๆถˆใ€‚ๆพๅผ€ๅŽๆŒ‰ B ๆˆ–่ฟ”ๅ›žๅฏๅ–ๆถˆใ€‚ + ้‡่ฏ• + ๆŒ‰ไธ‹ไปปๆ„ๆŒ‰้”ฎ๏ผŒๅŒ…ๆ‹ฌ่ขซ่ฏ†ๅˆซไธบ้”ฎ็›˜ๆŒ‰้”ฎ็š„่ฟ”ๅ›ž้”ฎใ€‚้Ÿณ้‡้”ฎๅ’Œ Android ็ณป็ปŸ้”ฎไฟ็•™ใ€‚ๆŒ‡ๅฎšไป…ๅฏนๆœฌ่ฎพๅค‡็”Ÿๆ•ˆใ€‚ + ็งป้™คๆŒ‡ๅฎš + ่พ“ๅ…ฅ่ฏŠๆ–ญ + ่ฎฐๅฝ•่พ“ๅ…ฅๅ‘้€่€—ๆ—ถ + ่ฏปๅ–ๆต‹้‡็ป“ๆžœ + ๆต‹้‡ไปŽ Android ๆดพๅ‘ๅˆฐๅ‘้€่‡ณ็Žฐๆœ‰่พ“ๅ…ฅ้€š้“็š„่€—ๆ—ถใ€‚ไธๅซ่“็‰™ๆŽฅๆ”ถใ€ๅฎขๆˆทๆœบ่ฝฎ่ฏขใ€ๆธฒๆŸ“ๅ’Œๆ˜พ็คบๅปถ่ฟŸใ€‚้ป˜่ฎคไธ่ฎฐๅฝ•ใ€‚ + ไฝฟ็”จๆ™ฎ้€š่พ“ๅ…ฅ็ป‘ๅฎš + diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 8f0ab9c57b..0b5996252e 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -28,6 +28,8 @@ ็ซ‹ๅณๆš‚ๅœ ๅœๆญขไผš่ฏ ๅธง็”Ÿๆˆ + ๆญคๆธธๆˆ็š„่ฎพ็ฝฎ + ้ป˜่ฎค่ฎพ็ฝฎ ้€‰ๆ‹ฉๅธง็”Ÿๆˆๆจกๅผ ๅ…ณ้—ญ DD-FG %1$dร— @@ -183,6 +185,7 @@ ๆ— ๆณ•ไธ‹่ฝฝ PowerVR ๅ›พๅฝข็Žฏๅขƒใ€‚่ฏทๆฃ€ๆŸฅ็ฝ‘็ปœ่ฟžๆŽฅๅŽ้‡่ฏ•ใ€‚ ๆ— ๆณ•ไธ‹่ฝฝ DirectAudio๏ผŒๆœฌๆฌกไผš่ฏ็š„ๆธธๆˆ้Ÿณ้ข‘ๅฐ†ไฝฟ็”จ่พƒๆ…ข็š„่ทฏๅพ„ใ€‚ ๆญค็จ‹ๅบ + ไผš่ฏๆ— ๆณ•ๅ‘ๅฑๅน•็ป˜ๅˆถ็”ป้ข๏ผš%1$sใ€‚ๆญค็•Œ้ขๆ˜พ็คบๅŽŸๅ› ่€Œ้ž้ป‘ๅฑ๏ผ›่ฏฆๆƒ…่งไผš่ฏๆ—ฅๅฟ—ใ€‚ ๆ— ๆณ•ไธ‹่ฝฝ Steam ๅฎขๆˆท็ซฏใ€‚ไฝ ็š„็ฝ‘็ปœๆˆ– VPN ๅฏ่ƒฝๅฑ่”ฝไบ† Steam ็š„ๆœๅŠกๅ™จ๏ผ›่ฏทๆฃ€ๆŸฅ็ฝ‘็ปœ่ฟžๆŽฅๅŽ้‡่ฏ•ใ€‚ ๆ— ๆณ•่ฎพ็ฝฎ Steam ๅฎขๆˆท็ซฏใ€‚่ฏทๆฃ€ๆŸฅ็ฝ‘็ปœ่ฟžๆŽฅๅ’Œๅฏ็”จๅญ˜ๅ‚จ็ฉบ้—ด๏ผŒ็„ถๅŽ้‡่ฏ•ใ€‚ %1$s ้ขๅ‘ x86 PC ๆž„ๅปบ๏ผŒ้œ€็ป็”ฑ FEX ่ฟ่กŒ๏ผŒ่€Œ FEX ๅฐšๆœชๅฎ‰่ฃ…ใ€‚่ฏทๅœจ็™ปๅฝ•็Šถๆ€ไธ‹ๅฏๅŠจไธ€ๆฌก Steam๏ผŒ่ฎฉๅ…ถไธ‹่ฝฝ FEX ไธŽ Steam Linux Runtime๏ผŒ็„ถๅŽ้‡ๆ–ฐๅฏๅŠจใ€‚ @@ -384,6 +387,9 @@ ๆญคๅค„ๆš‚ไธๆ”ฏๆŒ ๆญฃๅœจๅŠ ่ฝฝ็ป„ไปถโ€ฆ ๆ— ๆณ•ๅฎ‰่ฃ…๏ผš%1$s + ๆญคไธ‹่ฝฝๅ†…ๅฎน้œ€่ฆๆ›ดๆ–ฐใ€‚ + ๆ›ดๆ–ฐๅทฒๆŽ’้˜Ÿใ€‚ + ้‡่ฏ•ๆ›ดๆ–ฐ ๅทฒไธ‹่ฝฝ ๆญฃๅœจไธ‹่ฝฝ %1$s ๆญฃๅœจๅฎ‰่ฃ…๏ผš%1$s @@ -414,6 +420,22 @@ ไป…ๅ†…้ƒจๅญ˜ๅ‚จ ๆ–‡ไปถๅคน๏ผš%1$s ็ฌฌไบŒไธชๅบ“ + ๆ›ดๅคš Steam ๅบ“ + Steam ๅฏๅฎ‰่ฃ…ๆธธๆˆๅนถไปŽไธญ่ฟ่กŒ็š„ๆ–‡ไปถๅคน๏ผŒๆฏไธช้ƒฝๆœ‰ๅ•็‹ฌๅ็งฐใ€‚็งป้™คๅŽ๏ผŒๅ…ถไธญ็š„ๆธธๆˆไปไฟ็•™ๅœจ็ฃ็›˜ไธŠใ€‚ + ๆทปๅŠ ๅบ“ + ้‡ๅ‘ฝๅ + ๅบ“ๅ็งฐ + ไธบๅบ“้€‰ๆ‹ฉๆ–‡ไปถๅคน + ๆœ€ๅคšๅฏๆทปๅŠ  %1$d ไธชๅบ“ + ่ฏฅๆ–‡ไปถๅคนๅทฒๆ˜ฏๅบ“๏ผŒๆˆ–ไฝไบŽๆŸไธชๅบ“ๅ†… + %1$s ยท ไธๅฏ็”จ + ไปŽไธ‹ๆฌก Steam ไผš่ฏ่ตท็”Ÿๆ•ˆ + ๅœจๆญค่ฎพๅค‡ไธŠๆ‰พๅˆฐ ยท %1$s ยท %2$s + ๆทปๅŠ  + ๆŸฅๆ‰พๅ†…้ƒจๅญ˜ๅ‚จไธญ็š„ๅบ“ + ๆŽˆไบˆๆ‰€ๆœ‰ๆ–‡ไปถ่ฎฟ้—ฎๆƒ้™๏ผŒไปฅไพฟ DroidDeck ๆŸฅ็œ‹ๅ…ถไป–ๅบ”็”จไฟๅญ˜ๅœจๅ†…้ƒจๅญ˜ๅ‚จไธญ็š„ Steam ๅบ“ + ๅ…่ฎธ + ๅทฒๆทปๅŠ  %1$s๏ผŒๅณๆ‰€้€‰ๆ–‡ไปถๅคนๅ†…็š„ Steam ๅบ“ ไปŽ SD ๅกๆˆ–ๅ…ฑไบซๅญ˜ๅ‚จๆตๅผ่ฏปๅ–่ต„ๆบ็š„ๆธธๆˆๅฏ่ƒฝๅ‡บ็Žฐๅก้กฟใ€‚ ๅญ˜ๅ‚จ่ฏŠๆ–ญ ๅœจๅˆ†ไบซๆ—ฅๅฟ—ไธญ่ฎฐๅฝ•ๅˆ†้…็ป“ๆžœๅ’Œๅญ˜ๅ‚จ้‡‡ๆ ท่€—ๆ—ถใ€‚ๅฏ็”จๆœŸ้—ดๅฏ่ƒฝๅ‡ๆ…ขๅฎ‰่ฃ…ใ€‚ๅฐ†ๅœจไธ‹ๆฌกไผš่ฏ็”Ÿๆ•ˆใ€‚ @@ -476,6 +498,7 @@ ๅผ€ ้š Steam ๅฏๅŠจ ไธ้€š่ฟ‡ Steam ๅฏๅŠจ + ๆธธๆˆๅˆ†่พจ็އ ่ฎพ็ฝฎ %1$s ่ฎพ็ฝฎ ้ป˜่ฎค @@ -563,6 +586,8 @@ ๆธธๆˆๆ ธๅฟƒ ๆธธๆˆๆ ธๅฟƒ ๅˆ†้…็ป™ๆธธๆˆ็š„ๆ ธๅฟƒใ€‚ๅ…จ้€‰ๆ—ถ็”ฑ Android ่‡ช็”ฑ่ฐƒๅบฆใ€‚ + ็จณๅฎš็š„ๆธธๆˆ็œ็”ต่ฟ่กŒ + ๆธธๆˆๅธง็އ็จณๅฎšๆ—ถๅœจ่พƒๆ…ข็š„ๆ ธๅฟƒไธŠ่ฟ่กŒ๏ผŒไธ€ๆ—ฆ่ทŸไธไธŠๅฐฑๅ›žๅˆฐๅŽŸๆฅ็š„ๆ ธๅฟƒใ€‚ ๅฎขๆˆท็ซฏ็•Œ้ข ็บฟ็จ‹ๅŒ– GL ๅฏ่ƒฝ่ฎฉ Steam ่œๅ•ๆ›ดๆต็•…ใ€‚ @@ -598,7 +623,10 @@ ็ฆ็”จ Proton ็š„ๆ‰‹ๆŸ„ๅฏผ่ˆชๅŠฉๆ‰‹๏ผŒๅฎƒไผšๅœจๆฏไธชๆธธๆˆไธญๆถˆ่€— CPUใ€‚ ไธๅฏ็”จ seccomp ่ฟ่กŒ proot ๅฏ่ƒฝไฟฎๅคๆŸไบ›ๅ†…ๆ ธไธŠ็š„็ผบๅคฑ็ณป็ปŸ่ฐƒ็”จ้”™่ฏฏใ€‚ๅฏ่ƒฝ้™ไฝŽๆ€ง่ƒฝใ€‚ + ไธไฝฟ็”จ proot ่ฟ่กŒ๏ผˆๅฎž้ชŒๆ€ง๏ผ‰ + Linux ็Žฏๅขƒ็›ดๆŽฅ่ฟ่กŒๅœจ Android ไธŠใ€‚ไปŽไธ‹ๆฌกไผš่ฏ่ตท็”Ÿๆ•ˆใ€‚่‹ฅๆœ‰็จ‹ๅบๆ— ๆณ•ๅฏๅŠจ๏ผŒ่ฏทๅ…ณ้—ญๆญค้กนใ€‚ proot ๅฟซ้€Ÿ่ทฏๅพ„ + ไธไฝฟ็”จ proot ๆ—ถไธไผšๅฏ็”จใ€‚ ้œ€่ฆ proot ็š„ seccomp ่ฟ‡ๆปคๅ™จใ€‚ ๆ–‡ไปถๆŸฅๆ‰พๆ›ดๅฟซใ€ๅก้กฟๆ›ดๅฐ‘ใ€‚่‹ฅๆŸไธช็จ‹ๅบๆ‰พไธๅˆฐๅฎƒ็š„ๆ–‡ไปถ๏ผŒ่ฏทๅ…ณ้—ญใ€‚ ๅœจ gamescope ๅ†…็ป˜ๅˆถๅ…‰ๆ ‡ @@ -681,6 +709,7 @@ ๆ˜พๅญ˜ ไบคๆข็ฉบ้—ด ็”ตๆฑ ็”ต้‡ + ๅ‰ฉไฝ™็”ตๆฑ ็ปญ่ˆชๆ—ถ้—ด ๅŠŸ่€— ็ฝ‘็ปœ ๅˆ†่พจ็އ @@ -836,15 +865,38 @@ ไผš่ฏ ไผš่ฏๆ—ฅๅฟ— ๆฏๆฌกไผš่ฏๅŽไฟๅญ˜ + ไธ‹ๆฌกไผš่ฏๅฏ็”จๅขžๅผบ่ฏŠๆ–ญ + ไป…ไธบไธ€ไธชไผš่ฏ้‡‡้›†่ฏฆ็ป†ๆ—ฅๅฟ—ใ€‚ๅฏ่ƒฝ้™ไฝŽๆ€ง่ƒฝๅนถๅ ็”จๆ›ดๅคšๅญ˜ๅ‚จใ€‚ไผš่ฏๅผ€ๅง‹ๅŽไผš่‡ชๅŠจๅ…ณ้—ญ๏ผ›ๅˆ†ไบซๅ‰่ฏทๅ…ˆๆŸฅ็œ‹ๆ—ฅๅฟ—ใ€‚ ๆธธๆˆ่ฐƒ่ฏ•ๆ—ฅๅฟ— ๅœจไธ‹ๆฌกๅฏๅŠจๆธธๆˆๆ—ถๅŒ…ๅซ Protonใ€Wine ๅ’Œๅ›พๅฝข่ฏŠๆ–ญไฟกๆฏใ€‚ๅฏ่ƒฝ้™ไฝŽๆ€ง่ƒฝๅนถๅ ็”จๆ›ดๅคšๅญ˜ๅ‚จ็ฉบ้—ดใ€‚ ้‡ๅฏๆญคไผš่ฏไปฅไฟๅญ˜ๆธธๆˆ่ฐƒ่ฏ•ๆ—ฅๅฟ— ๆ— ๆณ•ๆ›ดๆ–ฐๆ—ฅๅฟ—่ฎพ็ฝฎใ€‚่ฏทๆฃ€ๆŸฅๅผ€ๅ…ณๅŽ้‡่ฏ•ใ€‚ ่ฐƒ่ฏ•ๅทฅๅ…ท + ่ฏฆ็ป†ๅ›พๅฝขๆ—ฅๅฟ— + Steam ็•Œ้ข๏ผšGPU ็ป˜ๅˆถ + ไฝฟ็”จ Xclipse ้ฉฑๅŠจ็ป„ๅˆๆ—ถ๏ผŒSteam ไปฅ่ฝฏไปถๆ–นๅผ็ป˜ๅˆถ้กต้ข๏ผˆGPU ็ป˜ๅˆถไผšๅ‡บ็Žฐๅ›พๅ—้”™ไนฑ๏ผ‰ใ€‚่‹ฅๅœจ่ฟ™ๅฐๆ‰‹ๆœบไธŠ็”ป้ขๆญฃๅธธ๏ผŒๅผ€ๅฏๅณๅฏ่Žทๅพ—ๆ›ดๅฟซ็š„ Steam ็•Œ้ขใ€‚ + ๆž„ๅปบไบŽ %1$s + %1$s ๅทฒๆ›ดๆ–ฐ่‡ณๆœ€ๆ–ฐๆž„ๅปบ็‰ˆๆœฌ + Mali ๆกฅๆŽฅไธŠๆฌกไผš่ฏๅœจ %1$s ไธŠ็š„่‡ชๆฃ€ๅคฑ่ดฅ๏ผˆๅ›พๅƒๆˆ–็ป˜ๅˆถ๏ผ‰๏ผŒๅ› ๆญค่ฏฅไผš่ฏๆ”น็”จไบ† PanVK ้ฉฑๅŠจ็ป„ๅˆใ€‚ + Mali ๆกฅๆŽฅไธŠๆฌกไผš่ฏๅœจ %1$s ไธŠๆ‰พไธๅˆฐไธŽ้ฉฑๅŠจๅ…ฑไบซๅ†…ๅญ˜็š„ๆ–นๅผ๏ผŒๅ› ๆญค่ฏฅไผš่ฏๆ”น็”จไบ† PanVK ้ฉฑๅŠจ็ป„ๅˆใ€‚ๆญคๆกฅๆŽฅๆ— ๆณ•ๅœจ่ฟ™้ƒจๆ‰‹ๆœบไธŠๅทฅไฝœ๏ผ›ๅ…ณ้—ญๅฎƒไผš็ปง็ปญไฝฟ็”จ PanVK ็ป„ๅˆใ€‚ + ๆฏๆฌพๆธธๆˆ็š„ Protonใ€DXVK ๅ’Œ้ฉฑๅŠจๆ—ฅๅฟ—้ƒฝไผšๅŠ ๅ…ฅไผš่ฏๆ—ฅๅฟ—ใ€‚GPU ไธๆ˜ฏ Adreno ๆ—ถๅง‹็ปˆๅผ€ๅฏใ€‚ ๆœ€ๆ–ฐไผš่ฏๆ—ฅๅฟ— ๅทฒไฟๅญ˜็š„ไผš่ฏๆ—ฅๅฟ— ไฟ็•™ๆœ€ๆ–ฐ็š„ %1$d ไธช ๆธ…้™คๆ—ฅๅฟ— + ๅฏ็”จ็š„ไผš่ฏๆ—ฅๅฟ— + ่ฟ˜ๆฒกๆœ‰ๅทฒไฟๅญ˜็š„ไผš่ฏๆ—ฅๅฟ—ใ€‚ + ๅˆ†ไบซๅ’Œไฟๅญ˜็š„ ZIP ๅŒ…ๅซๆ‰€้€‰ไผš่ฏ๏ผŒไปฅๅŠ็›ธๅ…ณ็š„ Steamใ€ๅ•†ๅบ—ใ€ๅทฅๅ…ทๅ’Œ Battle.net ่ฏŠๆ–ญไฟกๆฏใ€‚ + %1$s ยท %2$s + ๅฝ“ๅ‰ไผš่ฏ + ๅˆ†ไบซ + ไฟๅญ˜ๅˆฐ่ฎพๅค‡ + ๅˆ ้™ค + ๅˆ ้™คไผš่ฏๆ—ฅๅฟ—๏ผŸ + ๅˆ ้™ค %1$s๏ผŸๆญคๆ“ไฝœๆ— ๆณ•ๆ’ค้”€ใ€‚ + ไผš่ฏๆ—ฅๅฟ—ๅทฒไฟๅญ˜ใ€‚ + ๆ— ๆณ•ไฟๅญ˜ไผš่ฏๆ—ฅๅฟ—ใ€‚ + ๆ— ๆณ•ๅˆ ้™คไผš่ฏๆ—ฅๅฟ—ใ€‚ ้‡็ฝฎๆ‰€ๆœ‰่ฎพ็ฝฎ ๅฐ†ๆ‰€ๆœ‰่ฎพ็ฝฎๆขๅคไธบ้ป˜่ฎคๅ€ผ ้‡็ฝฎ @@ -871,6 +923,8 @@ ็”จไฝœไธปๅฑๅน• DroidDeck ๅฏไปฅ่ฎพไธบไธปๅฑๅน•ๅบ”็”จ ็ณป็ปŸไธไผšๆŠŠ DroidDeck ไฝœไธบไธปๅฑๅน•ๅบ”็”จๆไพ› + ไธปๅฑๅน•้”ฎๆ‰“ๅผ€ + ๅฝ“ DroidDeck ๆ˜ฏ้ป˜่ฎคไธปๅฑๅน•ๅบ”็”จไธ”ไฝ ๆŒ‰ไธปๅฑๅน•้”ฎๆ—ถๆ˜พ็คบ็š„้กต้ข ่ฏทๅœจโ€œๆทปๅŠ ๆธธๆˆโ€ไธญๅฐ† DroidDeck ่ฎพไธบโ€œๅŒ…ๅซโ€ ๅฑๅน•ๆ–นๅ‘ ๅฏๅŠจๅ™จๆ–นๅ‘ @@ -884,15 +938,22 @@ ๅ…จๅฑ ้š่— Android ็Šถๆ€ๆ ๅ’Œๅฏผ่ˆชๆ  ๆ˜พ็คบ Android ็Šถๆ€ๆ ๅ’Œๅฏผ่ˆชๆ  + ๅŒๅฑๅฏๅŠจๅ™จ + ่‡ชๅŠจไผšๆŠŠๅฏๅŠจๅ™จ็š„ๅ„ไธชๆฟๅ—๏ผˆSteamใ€ๅบ“ใ€ๅ•†ๅบ—็ญ‰๏ผ‰ๆ”พๅˆฐๅธฆๅ†…็ฝฎๅ‰ฏๅฑ็š„ๆŽŒๆœบ็š„็ฌฌไบŒๅ—ๅฑๅน•ไธŠใ€‚ๅผ€ๅฏไฝฟ็”จไปปๆ„็ฌฌไบŒๅ—ๆ˜พ็คบๅฑใ€‚ๅ…ณ้—ญๅˆ™่ฎฉๅฏๅŠจๅ™จๅชๆ˜พ็คบๅœจไธ€ๅ—ๅฑๅน•ไธŠใ€‚ + ๅŒๅฑไผš่ฏ + ่‡ชๅŠจไผšๆŠŠๆธธๆˆๅ†…่œๅ•ๅœ้ ๅœจๅ†…็ฝฎๅ‰ฏๅฑไธŠ๏ผŒ่€Œไธๆ˜ฏๆ˜พ็คบไธบๆตฎๅฑ‚ใ€‚ๅผ€ๅฏไฝฟ็”จไปปๆ„็ฌฌไบŒๅ—ๆ˜พ็คบๅฑใ€‚ๅ…ณ้—ญๅˆ™่œๅ•็•™ๅœจๆธธๆˆๅฑๅน•ไธŠ๏ผ›ไปๅฏไปŽ่œๅ•ไธญ้€‰ๆ‹ฉ็ฌฌไบŒๅ—ๅฑๅน•ใ€‚ ่‡ชๅŠจ ๅผ€ๅฏ ๅ…ณ้—ญ ๆธธๆˆไธญ็š„ไธ‹ๅฑๆŽงๅˆถ + ๆ–‡ๆœฌๆก†ไฝฟ็”จ Android ้”ฎ็›˜ ไผš่ฏๅผ€ๅง‹ๆ—ถๅœจ็ฌฌไบŒๅ—ๅฑๅน•ไธŠๆ‰“ๅผ€่งฆๆŽงๆฟๅ’Œ้”ฎ็›˜ใ€‚ ๆญฃๅœจไธบไธŠๅฑ่พ“ๅ…ฅ ๅฎŒๆˆ ้ป˜่ฎคไธปๅฑๅน•ๅบ”็”จ ้€‰ๆ‹ฉไธปๅฑๅน•ๅบ”็”จ + ็ฉบ้—ฒๆ—ถไปŽๆœ€่ฟ‘ไปปๅŠกไธญ้š่—ๅฏๅŠจๅ™จ + ไป…ๅฝ“ DroidDeck ๆ˜ฏ้ป˜่ฎคไธปๅฑๅน•ๅบ”็”จไธ”ๆฒกๆœ‰ๆญฃๅœจ่ฟ่กŒ็š„ไผš่ฏๆ—ถ็”Ÿๆ•ˆใ€‚ ้€‰ๆ‹ฉ Linux ๅบ”็”จ๏ผˆๆต‹่ฏ•็‰ˆ๏ผ‰ ้ฉฑๅŠจๆ›ดๆ–ฐไผš็ญ‰ๅˆฐไผš่ฏ็ป“ๆŸๅŽ่ฟ›่กŒใ€‚ @@ -1087,9 +1148,172 @@ ้ข„่งˆ็‰ˆ ๆœ€ๆ–ฐไฟฎๅค๏ผŒๅ…ˆไบŽ็จณๅฎš็‰ˆ ๅทฒๆ˜ฏๆœ€ๆ–ฐ + ๅคๅˆถๆž„ๅปบไฟกๆฏ + ๅทฒๅคๅˆถๆž„ๅปบไฟกๆฏ + ๆฏ”้ข„่งˆ็‰ˆๆ–ฐ + ไฝ ้ข†ๅ…ˆไบŽ้ข„่งˆ็‰ˆ + ๆญคๆž„ๅปบๆฏ”ๆœ€ๆ–ฐ็š„้ข„่งˆ็‰ˆๆ›ดๆ–ฐใ€‚ไธ‹ไธ€ไธช้ข„่งˆ็‰ˆๆž„ๅปบไผšๆ›ดๆ–ฐๅฎƒใ€‚ + ้€‰ๆ‹ฉไธ€ไธชๆž„ๅปบไปฅๆŸฅ็œ‹ๅ…ถๆ›ดๆ”นๆˆ–ๅฎ‰่ฃ…ใ€‚ + ๅทฒๅฎ‰่ฃ… + ๅฎ‰่ฃ…ๆญคๆž„ๅปบ%1$s + ๅ›ž้€€ๅˆฐๆญคๆž„ๅปบ%1$s + versionCode %1$d + ๆไบค %1$s + ๅ‘ๅธƒ้กต้ข + ๆญค PR ๆœ‰ๆ›ดๆ–ฐ็š„ๆไบค๏ผˆ%1$s๏ผ‰ใ€‚ๅฎƒ็š„ๆต‹่ฏ•ๆž„ๅปบๅฐšๆœชๅฐฑ็ปช๏ผŒๅ› ๆญคๆญคๆž„ๅปบไธๅŒ…ๅซๅฎƒใ€‚ + ๅทฒๆŽจ้€ๆ–ฐๆไบค๏ผŒๆž„ๅปบๅพ…็”Ÿๆˆ + PR ็ผ–ๅทใ€ๆ ‡้ข˜ๆˆ–ไฝœ่€… + ๆฒกๆœ‰ๅŒน้…็š„ๆต‹่ฏ•ๆž„ๅปบ + ้œ€่ฆ้‡ๆ–ฐๆž„ๅปบ๏ผˆversionCode %1$d๏ผ‰ + ๆต‹่ฏ•ๆž„ๅปบๆ›ดๆ–ฐ + PR #%1$d ๆœ‰ๆ–ฐ็š„ๆต‹่ฏ•ๆž„ๅปบ + %1$sใ€‚ๆ‰“ๅผ€โ€œๆ›ดๆ–ฐโ€่ฟ›่กŒๅฎ‰่ฃ…ใ€‚ + ๆ˜พ็คบๆ›ดๅคš๏ผˆ%1$d๏ผ‰ + ้œ€่ฆไธบ versionCode %2$d ้‡ๆ–ฐๆž„ๅปบ๏ผˆ%1$d๏ผ‰ + ๆญคๆต‹่ฏ•ๆž„ๅปบไน‹ๅŽ main ไธŠ็š„้ข„่งˆ็‰ˆๆž„ๅปบ๏ผš%1$d ๆต‹่ฏ•ๆž„ๅปบ ๅœจไฟฎๅคๆญฃๅผๅ‘ๅธƒๅ‰ๅ…ˆ่ฏ•็”จ ๅฝ“ๅ‰ๆฒกๆœ‰ + ๅฎž้ชŒ็‰ˆ + ๅฎž้ชŒ็‰ˆๆœฌ + ไฝฟ็”จไธญ + Android ้‡ๆ–ฐไผ˜ๅŒ– DroidDeck ๅŽๅทฒๆš‚ๅœ + ๆœชๅŠ ่ฝฝ๏ผš%1$s + ็ญ‰ๅพ…้‡ๅฏ + ๅทฒไฟ็•™ + ้€‚็”จไบŽๅ…ถไป–็‰ˆๆœฌ + ้‡ๅปบ + ไผšไปŽ่ฎพๅค‡ไธญๅˆ ้™คๆญค็‰ˆๆœฌ + ็”จ่ฏฅ็‰ˆๆœฌ้‡ๅฏ + ๅ…ณ้—ญ + ไฝฟ็”จ + ๅˆ ้™ค + ็ซ‹ๅณๅˆ ้™ค + ๆ— ๆณ•ๅ‡†ๅค‡้‡ๅฏ๏ผš%1$sใ€‚่ฏทๅœจ่ฎพ็ฝฎไธญ้…ๅฏนๆ— ็บฟ่ฐƒ่ฏ•ๅŽ้‡่ฏ•ใ€‚ + ๅฎž้ชŒ็‰ˆๅทฒๅฎ‰่ฃ… + DroidDeck ๅทฒไฝฟ็”จ %1$s ้‡ๅฏ + ๅฎž้ชŒ็‰ˆๅทฒๆš‚ๅœ + Android ้‡ๆ–ฐไผ˜ๅŒ–ไบ† DroidDeck๏ผŒๆ‰€ไปฅ %1$s ๆœชๅŠ ่ฝฝใ€‚ๆ‰“ๅผ€ๆ›ดๆ–ฐๅณๅฏ้‡ๅฏๅˆฐ่ฏฅๆž„ๅปบใ€‚ + ๅฎž้ชŒๆž„ๅปบๅทฒๅœ็”จ + ๅฎƒไธบๅ…ถไป–็‰ˆๆœฌ็š„ DroidDeck ๆž„ๅปบ๏ผŒๅทฒไฟ็•™ๅœจๆ›ดๆ–ฐไธญใ€‚ + DroidDeck ๅœจ่ฏฅๆž„ๅปบไธŠไธคๆฌกๅฏๅŠจๅคฑ่ดฅ + ๆ™บ่ƒฝไฝ“ + ๆ™บ่ƒฝไฝ“ + ๆ™บ่ƒฝไฝ“ๆญฃๅœจๅทฅไฝœ + ๅœจ Linux ็”จๆˆท็ฉบ้—ดไธญๅฎ‰่ฃ… Claude Code ๆ‰่ƒฝไฝฟ็”จๆ™บ่ƒฝไฝ“ใ€‚ + ่ฏข้—ฎๆธธๆˆใ€ๅดฉๆบƒ๏ผŒๆˆ–่ฆๆฑ‚ไฟฎๆ”น DroidDeck + ๅ‘้€ + ๆ–ฐๅฏน่ฏ + ๅœๆญข + ๅญ˜ๅ‚จ + ็งป้™ค + ็ซ‹ๅณ็งป้™ค + Claude Code + Codex + DroidDeck ๆบ็  + ไธ‹่ฝฝ็ผ“ๅญ˜ + ๆœชๆŽจ้€็š„ๆ›ดๆ”นๅฐ†ไธขๅคฑ + ๆž„ๅปบๆ—ถไผš้‡ๆ–ฐไธ‹่ฝฝ + ่ฎพ็ฝฎๆต็จ‹ๅฏ้‡ๆ–ฐๅฎ‰่ฃ…๏ผŒ็™ปๅฝ•็Šถๆ€ไฟ็•™ + DroidDeck ๅทฒ้‡ๅฏๅˆฐไฝ ็š„ๅฎž้ชŒๆž„ๅปบ๏ผŒไปŽไธŠๆฌกๅœไธ‹็š„ๅœฐๆ–น็ปง็ปญใ€‚ + ่ฎฉๅฎƒๆŽ’ๆŸฅๆธธๆˆๆ— ๆณ•ๅฏๅŠจ็š„ๅŽŸๅ› ใ€่งฃ้‡Šๆ—ฅๅฟ—๏ผŒๆˆ–ไฟฎๆ”น DroidDeck ๅนถๅœจๆœฌ่ฎพๅค‡ไธŠ่ฏ•็”จๆ”นๅŠจใ€‚ + ๅคฑ่ดฅ๏ผš%1$s + %1$s ๅทฒ็ป“ๆŸ๏ผˆ้€€ๅ‡บ็  %2$d๏ผ‰ + ๅทฒๅœๆญข + ๅทฒ็ป“ๆŸ๏ผŒๆœชๆ”ถๅˆฐๅ›žๅค + ้‡่ฏ• + ๆญฃๅœจ่ฎพ็ฝฎๆ™บ่ƒฝไฝ“ + ไธบๅทฒๅฎ‰่ฃ…็š„ DroidDeck ็‰ˆๆœฌ้‡ๅปบๆˆ‘็š„ๅฎž้ชŒๆž„ๅปบ %1$s๏ผŒๅนถ้‡ๅฏๅˆฐ่ฏฅๆž„ๅปบใ€‚ + ่พ“ๅ…ฅ %1$s ยท ่พ“ๅ‡บ %2$s + ๆ€่€ƒไธญ + ๆ€่€ƒ + ๆ€่€ƒไธญ ยท %1$s + %1$s ยท %2$s + ่พ“ๅ…ฅ + ่พ“ๅ‡บ + ่ฟ่กŒไธญโ€ฆ + ๆ— ็ป“ๆžœ๏ผšๆœฌ่ฝฎๅฏน่ฏๅทฒๆๅ‰็ป“ๆŸ + ๆ— ่พ“ๅ‡บ + ่พ“ๅ…ฅไปฅๆŽ’้˜Ÿไธ‹ไธ€ๆกๆถˆๆฏ + ๆŽ’้˜Ÿ + ไธ‹ไธ€ๆก๏ผš%1$s + ไธๅ‘้€ + ๆทปๅŠ ้™„ไปถ + ็งป้™ค + ้ป˜่ฎค + ๆŽจ็†ๅผบๅบฆ + ๆ‰ง่กŒ + ไฟฎๆ”น + ๅฐšๆœชๆ›ดๆ”น + ๆŒ‰่ฎกๅˆ’ๆ‰ง่กŒใ€‚ + ็ซ‹ๅณๅ‘้€ + ๆ›ดๅคš + ๅ…ณ้—ญ + ๆœ€ๆ–ฐ + ๅค„็†ไธญ + ไธŠไธ‹ๆ–‡ + ๅทฒ็”จ %1$s๏ผŒๅ…ฑ %2$s + ๆœฌๆฌกๅฏน่ฏ ยท %1$s + ้ฆ–ๆฌกๅ›žๅคๅŽๆ˜พ็คบ็”จ้‡ + %1$d ๅฐๆ—ถ้™้ข + %1$d ๅˆ†้’Ÿ้™้ข + ๆฏๅ‘จ้™้ข + %1$d%% ยท %2$s ้‡็ฝฎ + + %1$d ไธชๆ–‡ไปถ + %1$d ไธชๆ–‡ไปถ + + ๅ…ˆ่ง„ๅˆ’ + ่ง„ๅˆ’ + ๅชๆๅ‡บ่ฎกๅˆ’๏ผŒไธๆ”นๅŠจไปปไฝ•ๅ†…ๅฎน + ไผš่ฏ + ่ฟ˜ๆฒกๆœ‰ไผš่ฏ + ๅˆšๅˆš + ๅˆ ้™ค + ๅฐ†ๅˆ ้™คไผš่ฏๅŠๅ…ถ้™„ไปถ + ่ฟ›็จ‹ + Linux ็”จๆˆท็ฉบ้—ดไธญๆฒกๆœ‰่ฟ่กŒไธญ็š„่ฟ›็จ‹ + ๆ™บ่ƒฝไฝ“ + ๅœๆญข + ๅฎž้ชŒ็‰ˆๆž„ๅปบ + ๆญฃๅœจๅ‡†ๅค‡ๅฎž้ชŒ็‰ˆๆž„ๅปบ + %1$d%% ยท ็บฆๅ‰ฉ %2$s + ็บฆๅ‰ฉ %1$s + ๅ–ๆถˆ + ๅ–ๆถˆๆž„ๅปบ + ๆญฃๅœจๅฏๅŠจ + %1$d%% + ๆญฃๅœจๆ‰“ๅŒ… + ๆญฃๅœจๅ…ถไธŠ้‡ๅฏ DroidDeck + ๅฎŒๆˆ + ๅคฑ่ดฅ๏ผš%1$s + ่ฎพ็ฝฎๆ™บ่ƒฝไฝ“ + ่ฏทๅ…ˆๅœจ่ฎพ็ฝฎไธญๅฎ‰่ฃ… Linux ่ฟ่กŒๆ—ถ + ้‡่ฏ• + ๅผ€ๅง‹ๅฏน่ฏ + ่ฎพๅค‡่ฟžๆŽฅ + ๅผ€ๅฏๆ— ็บฟ่ฐƒ่ฏ•๏ผŒไปฅไพฟๆ™บ่ƒฝไฝ“ๆŸฅ็œ‹ๅนถๆ“ๆŽง DroidDeck + ๅฎ‰่ฃ… %1$s + ่ฃ…ๅ…ฅ Linux ็”จๆˆท็ฉบ้—ด๏ผŒๅŒ…ๅซ gitใ€gh ๅ’Œ adb + ็™ปๅฝ• %1$s + ๆ‰“ๅผ€ๆต่งˆๅ™จ + GitHub + ๅฏ้€‰๏ผŒ็”จไบŽๅ‘่ตทๆ‹‰ๅ–่ฏทๆฑ‚ + ๆž„ๅปบๅทฅๅ…ท + ๅฏ้€‰๏ผŒ็”จไบŽๅœจๆญค่ฎพๅค‡ไธŠ่ฟ›่กŒ Lab ๆž„ๅปบ ยท ็บฆ 5 GB + ๆ™บ่ƒฝไฝ“ๅทฒๅฐฑ็ปช + ๅฎŒๆˆๆ™บ่ƒฝไฝ“่ฎพ็ฝฎ + ๅทฒ็™ปๅฝ• %1$s + Lab ๆž„ๅปบ + ๅฟซ้€Ÿๆž„ๅปบ + ๅฟซ้€Ÿ Lab ๆž„ๅปบ + ้ข„ๅ…ˆ็ผ–่ฏ‘ๆญค็‰ˆๆœฌ๏ผŒไน‹ๅŽ Lab ๆž„ๅปบๅช้œ€ๅ‡ ๅˆ†้’Ÿ ยท ไป…ไธ€ๆฌก๏ผŒ็บฆ 20 ๅˆ†้’Ÿ + ็ผ–่ฏ‘ไธญ ยท %1$d%% ยท ็บฆ่ฟ˜ๅ‰ฉ %2$s + ๅ‡†ๅค‡ + ๆ— ็บฟ่ฐƒ่ฏ•ๆ— ๆณ•่ฟžๆŽฅ๏ผ›้…ๅฏนๅณๅฏๅผ€ๅฏ + ้…ๅฏน + ๅฎ‰่ฃ… + ็™ปๅฝ• PR #%1$d ๆœชไธบๆญค DroidDeck ๅ‰ฏๆœฌๆž„ๅปบ ๅทฒไบŽ %1$s ๆ›ดๆ–ฐ @@ -1325,6 +1549,9 @@ ๅบ”็”จ ้…็ฝฎ ๆ›ดๆ–ฐ + ๆ›ดๅคš + ็ผ–่พ‘ๆ ‡็ญพ้กต + ๆ ‡็ญพ้กต %1$d%% ๆขๅค %1$s ๅœจๆฏไธชไผš่ฏไธญๆ˜พ็คบไธบ /root/ROMsใ€‚ๅ†…้ƒจๅญ˜ๅ‚จไฝไบŽ /root/Storageใ€‚ @@ -1346,6 +1573,15 @@ ๅ–ๆถˆๆŽ’้˜Ÿ Android ้”ฎ็›˜ ้š่— โœ• + ๅฑๅน•ๅ ๆฏ” + ้”ฎ็›˜ๅ ๅฑๅน•็š„ๆฏ”ไพ‹๏ผŒๅซๆ ‡้ข˜ๆ  + ไธ้€ๆ˜Žๅบฆ + ่ฐƒไฝŽๅณๅฏ็œ‹่ง้”ฎ็›˜ๅŽ็š„ๆธธๆˆ + ้š่—ๆŒ‰้”ฎ + ๅพˆๅฐ‘็”จ็š„ๆŒ‰้”ฎไธๆ˜พ็คบๅœจ้”ฎ็›˜ไธŠ + Esc ๅ’ŒๅŠŸ่ƒฝ้”ฎ่กŒ + Ins / Del / Home / End / PgUp / PgDn + ๆ–นๅ‘้”ฎ ๅฏๅŠจ %1$s ้€‰ๆ‹ฉๅฑๅน•ใ€‚ๅ‰ฏๅฑ๏ผš%1$sใ€‚ ๅ‰ฏๆ˜พ็คบๅ™จๅทฒไธๅฏ็”จใ€‚ @@ -1824,7 +2060,24 @@ ็ปˆ็ซฏ Deck ่ƒŒ้”ฎ + ่งฆๆŽงๆฟ ไปช่กจ็›˜ + ๆกŒ้ข + ๅฏๅŠจๆกŒ้ข + ๆกŒ้ข ยท %1$s + ่งฆๆŽงๆฟ + ็›ดๆŽฅ่งฆๆ‘ธ + ่งฆๆŽงๆฟใ€‚่ฝป่งฆๅˆ‡ๆขๅˆฐ็›ดๆŽฅ่งฆๆ‘ธ + ็›ดๆŽฅ่งฆๆ‘ธใ€‚่ฝป่งฆๅˆ‡ๆขๅˆฐ่งฆๆŽงๆฟ + ๆญฃๅœจๅฏๅŠจ KDE ๆกŒ้ขโ€ฆ + ๆกŒ้ขๅทฒๅ…ณ้—ญ + ๆกŒ้ขๆ— ๆณ•ๅฏๅŠจใ€‚ๆ—ฅๅฟ—ๅœจๆœฌไผš่ฏ็š„ bottom-desktop ็›ฎๅฝ•ใ€‚ + ๆกŒ้ขๅทฒๅ…ณ้—ญ ๆš‚ๆ— ๅ†…ๅฎนใ€‚ + ไบคๆขๅฑๅน• + ไธ‹ๅฑๆญฃ่ขซๅ ็”จ + ๆธธๆˆๅฑๅน• + ๆธธๆˆๆ˜พ็คบๅœจ + ไธŠๅฑ + ไธ‹ๅฑ ไธ‹่ฝฝ ๆฒกๆœ‰ๆญฃๅœจ่ฟ›่กŒ็š„ไธ‹่ฝฝใ€‚ Steam @@ -1859,6 +2112,20 @@ ็‡ƒๆ–™๏ผŒt ไธปๆฒน็ฎฑ %1$s t ๅค‡็”จ %1$s t + ๅธงๆ—ถ้—ด + ๆœ€่ฟ‘ %1$d ็ง’ + ๅนณๅ‡ๅธง + 1% ไฝŽๅธง็އ + ่ถ…่ฟ‡ 33 ๆฏซ็ง’็š„ๅธง + %1$d / ๅˆ†้’Ÿ + ๅทฒๆธธ็Žฉ %1$s + %1$d ๆ ธ๏ผŒๆœ€้ซ˜ %2$s GHz + %1$d ๆ ธ + ๆธธๆˆ + %1$d Hz ไธ‹็š„ๅธง็އ + ็บข่‰ฒๆ ‡่ฎฐๅค„๏ผŒHUD ไผšไปฅ็บข่‰ฒๆ˜พ็คบๆธฉๅบฆใ€‚ + ๆ•ดๆœบ + ็”ตๆฑ  ๅ‘้€ไปช่กจ็›˜ๆ•ฐๆฎ ่‡ชๅŠจ ไธบๆญคๅค„ๅˆ—ๅ‡บ็š„ๆ‰€ๆœ‰ๆธธๆˆๅผ€ๅฏ๏ผŒๅŒ…ๆ‹ฌไน‹ๅŽๅ‘็Žฐ็š„ๆธธๆˆใ€‚ไฝ ๆ‰‹ๅŠจๅ…ณ้—ญ็š„ๆธธๆˆไผšไฟๆŒๅ…ณ้—ญใ€‚ @@ -1882,6 +2149,10 @@ ๆญคๆธธๆˆ็š„้บฆๅ…‹้ฃŽๅทฒๅ…ณ้—ญใ€‚ๅฆ‚้œ€่ฏญ้Ÿณ้€š่ฏ๏ผŒ่ฏทๅœจ DroidDeck ็š„ Steam ่ฎพ็ฝฎ๏ผˆ้Ÿณ้ข‘๏ผ‰ไธญๅผ€ๅฏ้บฆๅ…‹้ฃŽ๏ผŒ็„ถๅŽ้‡ๆ–ฐๅฏๅŠจๆธธๆˆใ€‚ ้Ÿณ้‡ %1$d%% ๆธธๆˆๅ†…ๆ•ฐๆฎ + ไธ‹ๅฑ HUD + ๆ‰€ๆœ‰้กต็ญพๆ˜พ็คบๆจชๆก + 1% ๅ’Œ 0.1% ไฝŽๅธง็އ + CPU ๆธฉๅบฆ FPS CPU GPU @@ -2130,6 +2401,22 @@ ๅก้€šๆ่พนๅŠ ้”ๅŒ–ใ€‚ ไธๆ˜ฏ Adreno GPU + ็ณป็ปŸ PowerVR ้ฉฑๅŠจ๏ผšๅ…ผๅฎนๆ€งๅ› ่ฎพๅค‡่€Œๅผ‚ + ๅฎž้ชŒๆ€ง๏ผšRADV ๆˆ–็ณป็ปŸ Xclipse ้ฉฑๅŠจ + ็ณป็ปŸ PowerVR + ไฝฟ็”จๆญค GPU ็š„ๅ†…็ฝฎ้ฉฑๅŠจ + ่ฟ่กŒๆ—ถๅ’Œๆ˜พ็คบๅ‡ไฝฟ็”จ็ณป็ปŸ PowerVR ้ฉฑๅŠจใ€‚ + ๆš‚ๆ— ๅผ€ๆบ้ฉฑๅŠจๆ”ฏๆŒๆญค Mali๏ผšๅทฒๅฏ็”จ Mali ๆกฅๆŽฅใ€‚ + ่ฟ™ๆ˜ฏ้ž้ช้พ™ๆต‹่ฏ•็‰ˆๆœฌ๏ผšๆญคๅค„็š„ๅฎ˜ๆ–น็‰ˆๆœฌไป…่ƒฝๅœจ Adreno ไธŠ่ฟ่กŒ๏ผŒๅ› ๆญคไธไผš่ฆ†็›–ๅฎ‰่ฃ…ๅฎƒใ€‚ๆ–ฐ็š„ๆต‹่ฏ•็‰ˆๆœฌๅœจ github.com/The412Banner/droiddeck-nonadreno-drivers ๅ‘ๅธƒใ€‚ + ไธŠๆฌกไผš่ฏ็ป“ๆŸๆ˜ฏๅ› ไธบ Android ไธบ้‡Šๆ”พๅ†…ๅญ˜ๅ…ณ้—ญไบ† DroidDeck๏ผŒๅนถ้žๅดฉๆบƒใ€‚่ฏทๅ…ณ้—ญๅ…ถไป–ๅบ”็”จๆˆ–้™ไฝŽๆธธๆˆ็š„็บน็†่ฎพ็ฝฎๅŽ้‡่ฏ•ใ€‚ + Mali๏ผˆVenus๏ผ‰ + Mali ๆกฅๆŽฅ + ็›ฎๅ‰่ฟ˜ๆฒกๆœ‰ๅผ€ๆบ้ฉฑๅŠจ้€‚้…่ฟ™ๆฌพ Mali๏ผšไฝฟ็”จ %1$s๏ผŒๅŸบไบŽๆ‰‹ๆœบ่‡ชๅธฆ้ฉฑๅŠจใ€‚ + %1$s ๅฐšๆœชๅ‘ๅธƒ๏ผšๅœจๆญคไน‹ๅ‰ไฝฟ็”จ %2$sใ€‚ + %1$s ไธๅฏ็”จ๏ผŒไธ”่ฟ™ๆฌพๆ‰‹ๆœบ็š„้ฉฑๅŠจๆŠฅๅ‘Šไธบ Vulkan %2$s๏ผˆVenus ้œ€่ฆ 1.2๏ผ‰๏ผšๅฐ†ไฝฟ็”จ Mali ๆกฅๆŽฅใ€‚ + %1$s ๅฐšๆœชๅ‘ๅธƒ๏ผšๅœจๆญคไน‹ๅ‰ๅฏ็”จ Mali ๆกฅๆŽฅใ€‚ + ๅทฒๆŽ’้˜Ÿ๏ผš%1$s๏ผˆ็ญ‰ๅพ…ๅ…ถไป–่ฟ่กŒๆ—ถ้ฉฑๅŠจ๏ผ‰ + DXVK ็”ฑ็ณป็ปŸ PowerVR ่ฟ่กŒๆ—ถๆไพ›ใ€‚ๅ…ถไป– DXVK ๅŒ…ๅฏไปฅไฟๅญ˜๏ผŒไฝ†ๆญ้…ๆญค้ฉฑๅŠจๆ—ถไธไผš็”Ÿๆ•ˆใ€‚ ๅ—ๆ”ฏๆŒ ๅฎž้ชŒๆ€ง๏ผšๅ…ถ้ฉฑๅŠจไธบๆต‹่ฏ•ๆž„ๅปบ Adreno 850 ๅฎž้ชŒๆ”ฏๆŒ๏ผš้œ€่ฆ้…ๅฅ—็š„ๅฎž้ชŒ็‰ˆๆ˜พ็คบ้ฉฑๅŠจๅ’Œๆธธๆˆ้ฉฑๅŠจ๏ผ›ๅฐšๆœชๅœจๆญค่ฎพๅค‡ไธŠ้ชŒ่ฏ @@ -2245,7 +2532,6 @@ ๆธธๆˆๅ•†ๅบ— Steam ่‡ชๅฎšไน‰ - ๆธธๆˆๅ•†ๅบ— ไธ‹่ฝฝ้€Ÿๅบฆๆกฃไฝ ๅ‡่กก ๅฟซ้€Ÿ @@ -2284,6 +2570,7 @@ ๆญฃๅœจ็ญ‰ๅพ…ๅฆไธ€ไธช Battle.net ไธ‹่ฝฝโ€ฆ ่ฏทๅ…ˆๆ‰“ๅผ€ Battle.net ๅนถ็™ปๅฝ•ไธ€ๆฌก๏ผŒ็„ถๅŽๅœจ่ฟ™้‡Œๅฎ‰่ฃ…ๅ…ถๆธธๆˆใ€‚ ๆšด้›ชไธ‹่ฝฝๅ™จๅทฒๅœๆญข๏ผš%1$s + ๆšด้›ชไธ‹่ฝฝๅ™จๅทฒๅœๆญข่ฟ›ๅฑ•ใ€‚ ๆšด้›ช้”™่ฏฏ %1$s ๆ›ดๆ–ฐ ๆšด้›ชๆธธๆˆ @@ -2291,6 +2578,7 @@ ๅทฒไธญๆ–ญ ๅฎ‰่ฃ… ยท %1$s ๅ…่ดน้ข†ๅ– + ๆญฃๅœจๆทปๅŠ ๅˆฐๆธธๆˆๅบ“โ€ฆ ๅœจ %1$s ไธŠๆŸฅ็œ‹ ่ดญไนฐ ยท %1$s ๅทฒๅฎ‰่ฃ… @@ -2337,6 +2625,12 @@ ๆŽ’ๅบ ไพง่พนๆ ๆ ‡็ญพ ๅœจไพง่พนๆ ๅ›พๆ ‡ไธ‹ๆ–นๆ˜พ็คบๅ็งฐใ€‚ๅ…ณ้—ญๅŽไพง่พนๆ ๆ›ด็ช„ใ€‚ + ๆ™บ่ƒฝไฝ“ๅฎ ็‰ฉ + DeeDee ไผšๆ‚ฌๆตฎๅœจๅฏๅŠจๅ™จๅ’ŒๆธธๆˆไธŠๅฑ‚๏ผŒๅนถๆ˜พ็คบๆ™บ่ƒฝไฝ“ๆญฃๅœจๅšไป€ไนˆใ€‚ + ๆ˜พ็คบๅœจๅ…ถไป–ๅบ”็”จไธŠๅฑ‚ + ่ฎฉ DeeDee ๆ‚ฌๆตฎๅœจๆ‰€ๆœ‰ๅบ”็”จไธŠๅฑ‚๏ผŒๅนถๅœจ้‚ฃ้‡Œๆ‰“ๅผ€่Šๅคฉ + ๅ…่ฎธ + ไธŽ DeeDee ่Šๅคฉ ๆ˜พ็คบ ่พƒๅคงๅก็‰‡ ่พƒๅฐๅก็‰‡ @@ -2551,7 +2845,14 @@ ๅˆ†ๅˆซ่ฎพ็ฝฎ่ฟ่กŒๆ—ถ้ฉฑๅŠจๅ’Œๆ˜พ็คบ้ฉฑๅŠจ ไฝฟ็”จ %1$s๏ผŸ ็งป้™ค %1$s๏ผŸ - ่ฏŠๆ–ญ + ๅผ€ๅ‘่€… + ๆž„ๅปบๆ ‡็ญพๆฐดๅฐ + ๅœจๅฑๅน•ไธŠๆ˜พ็คบๆต‹่ฏ•็‰ˆๆˆ– Lab ๆž„ๅปบๆ ‡็ญพใ€‚้ป˜่ฎคๅฏ็”จใ€‚ + ๅˆ†ไบซ่ฏŠๆ–ญๅŒ… + ไผš่ฏไธŽ่ฎพๅค‡ + ๅ›พๅฝข + ๆธธๆˆไธŽๅ…ผๅฎนๆ€ง + ๅ…จ้ƒจ ๅฏไปฅๆธธ็Žฉไบ† ๆš‚ๆ—ถ่ฟ˜ไธ่ƒฝๆธธ็Žฉ ่ฟ่กŒๆ—ถ %1$s @@ -2581,6 +2882,9 @@ ๅœจใ€Œๅ•†ๅบ—ใ€่ฎพ็ฝฎไธญๅผ€ๅฏ GOG ๆˆๅฐฑ ๆˆๅฐฑไธๅฏ็”จ๏ผ›่ฏทๆŸฅ็œ‹ไผš่ฏๆ—ฅๅฟ— ๆˆๅฐฑๅทฒ่งฃ้” + Mali๏ผˆVenus๏ผ‰๏ผšๅ…ณ + Mali๏ผˆVenus๏ผ‰๏ผšๅผ€ + %1$s ไธŠ็š„้ฉฑๅŠจๆŠฅๅ‘Š Vulkan %2$sใ€‚Mali๏ผˆVenus๏ผ‰้œ€่ฆ Vulkan 1.2 ๆˆ–ๆ›ด้ซ˜็‰ˆๆœฌ๏ผˆๆ›ดไฝŽ็‰ˆๆœฌไธ‹ gamescope ๆ— ๆณ•ๅฏๅŠจ๏ผ‰๏ผŒๅ› ๆญคไผš่ฏไผš่ทณ่ฟ‡ Venus๏ผŒๆ”น็”จ PanVK ้ฉฑๅŠจ็ป„ๅˆใ€‚ ็ฒ˜่ดด ๅทฆๆ‘‡ๆ† ๅณๆ‘‡ๆ† @@ -2865,7 +3169,7 @@ ้€‰ๆ‹ฉๆ–‡ไปถๅคนโ€ฆ ไฝฟ็”จ SD ๅกๆˆ– USB ้ฉฑๅŠจๅ™จไธŠ็š„ไปปๆ„ๆ–‡ไปถๅคน ๆธธๆˆไผšๆ”พๅœจๆ‰€้€‰ไฝ็ฝฎไธญ็š„ Games ๆ–‡ไปถๅคนๅ†…ใ€‚็Žฐๆœ‰ๆธธๆˆไธไผš่ขซ็งปๅŠจใ€‚ - ๅ ็”จๅŽปๅ‘ + ๅ ็”จ็ฉบ้—ด็š„้กน็›ฎ Steam ๆธธๆˆ ๆธธๆˆๆ•ฐๆฎ ๅ‰็ผ€ %1$s ยท ๅˆ›ๆ„ๅทฅๅŠ %2$s ยท ็€่‰ฒๅ™จ %3$s @@ -2934,6 +3238,7 @@ ๆธธๆˆ่ฏทๆฑ‚็š„ VC++ ไธŽ DirectX ๅฎ‰่ฃ…็จ‹ๅบ ่ฟ่กŒ Linux x86 ๆธธๆˆ Steam ๅทฅๅ…ท + ๅฏนไบŽ่‡ชๅธฆๅไฝœๅผŠ็š„ๆธธๆˆ๏ผŒๅณไฝฟๅไฝœๅผŠๅค„ไบŽๅ…ณ้—ญ็Šถๆ€๏ผŒSteam ไนŸไผšไธ‹่ฝฝๆญค้กนใ€‚ๅˆ ้™คๅŽ่ฟ™ไบ›ๆธธๆˆ็š„ๅฎ‰่ฃ…ไผšๅกๅœจ 0% DroidDeck ๆ— ้œ€ๆญค่ฟ่กŒๆ—ถๅณๅฏ่ฟ่กŒๆธธๆˆ x86 Proton๏ผŒDroidDeck ๆ— ๆณ•่ฟ่กŒ ๆ‰€ๆœ‰ๆธธๆˆ็š„้ป˜่ฎค้กน @@ -2997,6 +3302,19 @@ ไฟ็•™ ้ž Steam ๆธธๆˆไธŽ Steam ็š„ๅ…ฑไบซๅ‰็ผ€ ไปŽๅ•†ๅบ—ๆˆ–ๆ‰‹ๅŠจๆทปๅŠ ็š„ๆธธๆˆ็š„ๅ‰็ผ€ + Steam ็š„ๅ…ฑไบซๅ‰็ผ€ + Steam ๅœจๆญค่ฟ่กŒๅ…ถ่‡ชๅธฆ็š„ Windows ่พ…ๅŠฉ็จ‹ๅบ + ๅˆ ้™ค่ฏฅๅ‰็ผ€๏ผˆ%1$s๏ผ‰ใ€‚Steam ไธ‹ๆฌก้œ€่ฆๆ—ถไผšๆ–ฐๅปบไธ€ไธชใ€‚ + ๅ•†ๅบ—ๅบ”็”จๅŠ้€š่ฟ‡ๅฎƒ่ฟ่กŒ็š„ๆธธๆˆ + ็”ฑ %1$s ไฝฟ็”จ + ้ž Steam ๆธธๆˆ %1$s + ๆœชๅŒน้…ๅˆฐๆธธๆˆ๏ผŒๅ› ๆญคไฟ็•™ + ็งป้™คๆ‰€้€‰ ยท %1$s + ๅธ่ฝฝๆ‰€้€‰ ยท %1$s + Wine ๅ‰็ผ€ + ๅ…ถไธญ็š„ๅญ˜ๆกฃๅ’Œ่ฎพ็ฝฎๅฐ†ไธขๅคฑ๏ผ›Steam Cloud ๅญ˜ๆกฃไปไฟ็•™ๅœจไฝ ็š„่ดฆๆˆทไธญใ€‚ + ็€่‰ฒๅ™จ็ผ“ๅญ˜ + ๅ‰็ผ€ %1$s ยท ็€่‰ฒๅ™จ %2$s ๅทฒไธ‹่ฝฝ็š„ๅŒ… ๅทฒไฟๅญ˜็š„ๅŽŸๅง‹ๆ–‡ไปถ ๆฒกๆœ‰ๅทฒไธ‹่ฝฝ็š„็ป„ไปถๅŒ…ใ€‚ @@ -3031,6 +3349,8 @@ DroidDeck ยท %1$d fps 60 fps ๆ›ดๆต็•…๏ผŒไฝ† Steam ๅฏๅŠจๆ—ถไผšๅ ็”จๆ›ดๅคš CPUใ€‚ๅœจ Steam ่‡ช่บซ่ฎพ็ฝฎไธญ้€‰ๆ‹ฉ็š„ๅŠจ็”ปไนŸไผšๆ˜พ็คบๅœจ่ฟ™้‡Œใ€‚ ๅฃฐ้Ÿณ + ่ทณ่ฟ‡ๅฏๅŠจๅฝฑ็‰‡ + ็”จไธ€ๆฎต 0.1 ็ง’็š„้ป‘่‰ฒ็‰‡ๆฎตไฝœไธบ Steam ็š„ๅฏๅŠจๅฝฑ็‰‡ใ€‚ไธ‹ๆฌกไผš่ฏ็”Ÿๆ•ˆใ€‚ ่‡ชๅฎšไน‰่ง†้ข‘ MP4ใ€MOVใ€MKV ๆˆ– WebMใ€‚ๅ…ถไป–ๆ ผๅผๅŠ่ถ…่ฟ‡ %1$d MB ็š„ๆ–‡ไปถไผšๅœจ่ฎพๅค‡ไธŠ่ฝฌๆขไธบ 720p WebM๏ผŒๆœ€้•ฟ %2$d ็ง’ใ€‚ ๅฏผๅ…ฅ @@ -3497,6 +3817,7 @@ ๆญค GPU ็š„ Vulkan ็‰ˆๆœฌๅฏน Proton ่‡ชๅธฆ็š„ DXVK ๆฅ่ฏดๅคชๆ—งๆ—ถ๏ผŒๆ”น็”จ่พƒๆ—ง็š„ DXVKใ€‚ ๆฏไธช Proton ้ƒฝไฝฟ็”จ่‡ชๅธฆ็š„ DXVK๏ผŒๅณไฝฟๆญค GPU ็š„ Vulkan ็‰ˆๆœฌๅฏ่ƒฝๅคชๆ—งใ€‚ Mali ๆกฅๆŽฅ๏ผšๅ…ณ + %1$s ๆ— ๆณ•ไฝฟ็”จ Mali ๆกฅๆŽฅ๏ผˆๅฎƒ่ฆๆฑ‚ Mali GPU ๆฒกๆœ‰็ณป็ปŸ้ฉฑๅŠจ่ทฏ็บฟ๏ผ‰๏ผŒๅ› ๆญคๆญคๅผ€ๅ…ณๅœจ่ฟ™้‡Œไธ่ตทไฝœ็”จใ€‚ Mali ๆกฅๆŽฅ๏ผšๅผ€ %1$s ไธๆ˜ฏ Adrenoใ€‚ๅฎž้ชŒๆ€ง Vulkan ๆกฅๆŽฅๅทฒๅผ€ๅฏ๏ผšไผš่ฏ้€š่ฟ‡ๆ‰‹ๆœบ่‡ชๅธฆ็š„้ฉฑๅŠจ็ป˜ๅˆถใ€‚ๅฏ่ƒฝไผšๆœ‰้—ฎ้ข˜๏ผŒ่ฏทๅ‘้€ไผš่ฏๆ—ฅๅฟ—ใ€‚ ๅฎ‰ๅ…จๆจกๅผ @@ -3517,6 +3838,25 @@ ๅŽ็งป ๅพฎไปถ่ฎพ็ฝฎ ็งป้™คๅพฎไปถ + ๅค–่ง‚ + ๅ›พๆ ‡ๅŒ… + ็ณป็ปŸ้ป˜่ฎค + ไฝฟ็”จๅบ”็”จ้ขœ่‰ฒไฝœไธบ่ƒŒๆ™ฏ + ๅ›พๆ ‡ๅคงๅฐ + ๅฐ + ไธญ + ๅคง + ้š่—ๅบ”็”จๅ็งฐ + ้—ด่ท + ็ดงๅ‡‘ + ๆญฃๅธธ + ๅฎฝๆพ + ๆ›ดๆขๅ›พๆ ‡ + ้‡็ฝฎๅ›พๆ ‡ + ๆœ็ดขๅ›พๆ ‡ + ๆญฃๅœจๅŠ ่ฝฝๅ›พๆ ‡โ€ฆ + ๆœชๆ‰พๅˆฐๅ›พๆ ‡ใ€‚ + ่‡ชๅฎšไน‰ๅ›พๆ ‡ ๆทปๅŠ ๅˆฐๆ–‡ไปถๅคน ๆ–ฐๅปบๆ–‡ไปถๅคน ไปŽๆ–‡ไปถๅคนไธญ็งป้™ค @@ -3631,5 +3971,81 @@ ๆ— ๆณ•ๅฏผๅ…ฅๆญคๅธƒๅฑ€ ็Œฉ็บขไน‹้›ช + ็™ฝ่‰ฒ็•Œ้ข้…็บข่‰ฒ็‚น็ผ€ใ€‚ + ๅŽŸๅฃฐ้Ÿณไน + ้Ÿณไน + ๆ’ญๆ”พ้€‰้กน + ๆ”ถ่— + ๅˆ้›† + ่ฟ˜ๆฒกๆœ‰ๅˆ้›†ใ€‚็‚นๆŒ‰ไนฆ็ญพๅ›พๆ ‡ๅณๅฏๅˆ›ๅปบใ€‚ + ๅทฒไฟๅญ˜ + ๅˆ›ๅปบๅˆ้›† + ๆ•ด็†ไฝ ็š„ๆ”ถ่— + ๆ–ฐๅปบ + ๅˆ›ๅปบ + ๅˆ้›†ๅ็งฐ + ่ฏท่พ“ๅ…ฅๆœช่ขซๅ…ถไป–ๅˆ้›†ไฝฟ็”จ็š„ๅ็งฐ + ็ฎก็† + ้‡ๅ‘ฝๅ + ๆทปๅŠ ๆ›ฒ็›ฎ + ๆทปๅŠ ๏ผˆ%1$d๏ผ‰ + ็งป้™คๆ›ฒ็›ฎ + ๅˆ ้™คๅˆ้›† + ๅˆ ้™ค %1$s๏ผŸ + ๆ›ฒ็›ฎไปไฟ็•™ๅœจไฝ ็š„่ฎพๅค‡ไธŠ๏ผŒๅชไผšๅˆ ้™คๅˆ้›†ใ€‚ + ้€‰ๆ‹ฉ + ๅ…จ้€‰ + ๅ–ๆถˆๅ…จ้€‰ + ๅทฒ้€‰ๆ‹ฉ %1$d ้กน + ๆทปๅŠ ๅˆฐๅˆ้›† + ๆทปๅŠ ๅˆฐๆ”ถ่— + ไปŽๅˆ้›†ไธญ็งป้™ค + ๆœ็ดขๆ›ฒ็›ฎ + ไธ“่พ‘้กบๅบ + ๆœ€้•ฟไผ˜ๅ…ˆ + ๆœ€็Ÿญไผ˜ๅ…ˆ + ๆ›ฒ็›ฎ + ้Ÿณ่ฐƒ + ้‡็ฝฎ + ่ทณ่ฟ‡้™้Ÿณ + ็ก็œ ๅฎšๆ—ถ + %1$d ๅˆ†้’Ÿ + ๆ›ฒ็›ฎ็ป“ๆŸ + ๅ‰ฉไฝ™ %1$s + ๅ‡่กกๅ™จ + ไฝŽ้Ÿณๅขžๅผบ + ๆญค่ฎพๅค‡ไธๆ”ฏๆŒๅ‡่กกๅ™จ + ๅœจๆธธๆˆไธญๅฏ็”จ + ๆธธๆˆ่ฟ่กŒๆ—ถ็ปง็ปญๆ’ญๆ”พๅŽŸๅฃฐ้Ÿณไน + ๅฐšๆœชๅฎ‰่ฃ…ไปปไฝ•ๅŽŸๅฃฐ้Ÿณไนใ€‚ + ๆœ็ดขๅŽŸๅฃฐ้Ÿณไน + ๆทปๅŠ ๅŽŸๅฃฐ้Ÿณไนๆ–‡ไปถๅคน + ่ฏฅๆ–‡ไปถๅคนไธญๆฒกๆœ‰้Ÿณ้ข‘ๆ–‡ไปถ + ๆ€ปๆ—ถ้•ฟ + %1$d ้ฆ–ๆ›ฒ็›ฎ / %2$s + ็ฌฌ %1$s ๅผ  + ้šๆœบๆ’ญๆ”พ + ไธŠไธ€้ฆ– + ๆ’ญๆ”พ + ๆš‚ๅœ + ไธ‹ไธ€้ฆ– + ๅ…ณ้—ญ้‡ๅค + ๅ…จ้ƒจ้‡ๅค + ๅ•ๆ›ฒ้‡ๅค + ้Ÿณ้‡ + ๆญคๅŽŸๅฃฐ้Ÿณไนไธญๆฒกๆœ‰้Ÿณ้ข‘ๆ–‡ไปถ + ๆ— ๆณ•ๅฏๅŠจ + ๆฒกๆœ‰ๅฏ็”จ็š„ๆต่งˆๅ™จๆฅๆ‰“ๅผ€ๆญค้“พๆŽฅใ€‚ + ๆŠ“ๅ– + ๆ”พไธ‹ + ไฟๅญ˜ + ้•ฟๆŒ‰้‡็ฝฎ + ๆธธๆˆๅ•†ๅบ— + ๅธงๆ—ถ้—ด + ๅนณๅ‡ๅธง็އ + ๆ˜พ็คบๆœๅŠกๅ™จ + HDR ็Šถๆ€ + ๅทฒๆ˜พ็คบ + %1$d / %2$d diff --git a/app/src/main/res/values-zh-rHK/input_library.xml b/app/src/main/res/values-zh-rHK/input_library.xml new file mode 100644 index 0000000000..20930002a7 --- /dev/null +++ b/app/src/main/res/values-zh-rHK/input_library.xml @@ -0,0 +1,132 @@ + + + ็„กๆณ•่ฎ€ๅ–็š„่ผธๅ…ฅ่จญๅฎšๅทฒๅ„ฒๅญ˜ๅœจ้‚„ๅŽŸๅ‰ฏๆœฌไธญใ€‚ไฝ ๅฏไปฅ็นผ็บŒ็ทจ่ผฏ้‚„ๅŽŸ็š„่จญๅฎšๆช”ใ€‚ + ๅฑฌๆ€ง + ้ปžๆ“Šๅฑฌๆ€ง + %1$s ยท ้ปžๆ“Š + ๆŒ‰้ต + ๆ–ๆกฟใ€่งธๆŽงๆฟ่ˆ‡ๆ‰ณๆฉŸ + ้šฑ่—ๅทฅๅ…ท + ๆŽงๅˆถๅ™จ + ๅฐ‡ๆŽงๅˆถๅ™จ่ผธๅ…ฅๅ‚ณ้€็ตฆ Steam Input ๆˆ–้Šๆˆฒใ€‚ + ๆญคๆŽงๅˆถ้ …ไธๆœƒๅ‚ณ้€ๆŽงๅˆถๅ™จใ€ๆป‘้ผ ๆˆ–้ต็›ค่ผธๅ…ฅใ€‚ + ๆป‘้ผ ้ปžๆ“Š + DroidDeck ๅ‹•ไฝœ + ๅ‹•ไฝœ + ๆฒๅ‹•้€Ÿๅบฆ๏ผš%1$d ๆญฅ/็ง’ + + ๆ–ฐๅขž่จญๅฎšๆช” + + ๆ–ฐๅขž็‰ˆ้ข + %1$s ยท ๆœ‰ %2$d ๅ€‹่จญๅฎšๆช”ไฝฟ็”จไธญใ€‚่ฎŠๆ›ดๆœƒๅฅ—็”จๅˆฐๆ‰€ๆœ‰ไฝฟ็”จ้€™ไบ›็ถๅฎš็š„่จญๅฎšๆช”ใ€‚ + ้‡ๆ–ฐๅ‘ฝๅ + ๅˆช้™ค + ๅ…ˆๅฐ‡ๆŽงๅˆถ้ …ๅŠ ๅ…ฅ็‰ˆ้ข๏ผŒๅ†ๆŒ‡ๆดพๅ‹•ไฝœใ€‚ + ็„กๆณ•ๅ„ฒๅญ˜่ผธๅ…ฅ่จญๅฎš + ๅ็จฑ + ่ตทๅง‹่‡ช + ๆŒ‰้ต + ๆ–ๆกฟ + ่งธๆŽงๆฟ + ๅๅญ—้ต + ๆ‰ณๆฉŸ + ๅฎŒๆˆ + ๅพฉๅŽŸ + + ๆ–ฐๅขž + ๆ‹–ๆ›ณๅฏ็งปๅ‹•๏ผŒๆ‹–ๆ›ณ่ง’่ฝๅฏ่ชฟๆ•ดๅคงๅฐ๏ผŒ้ปžไธ€ไธ‹ใ€Œๅฑฌๆ€งใ€ๅฏๆŒ‡ๆดพๅ‹•ไฝœใ€‚ + ๆญฃๅœจๅ‰ฏ่žขๅน•็ทจ่ผฏ + ๆ‰€้ธ้กฏ็คบๅ™จ็„กๆณ•ไฝฟ็”จใ€‚้€ฃๆŽฅๅพŒๆ‰่ƒฝไพๅฏฆ้š›ๅคงๅฐ็ทจ่ผฏๆญค็‰ˆ้ขใ€‚ + ๆจๆฃ„ๆœชๅ„ฒๅญ˜็š„็‰ˆ้ข่ฎŠๆ›ด๏ผŸ + ๆญค็‰ˆ้ขๆœ‰ %1$d ๅ€‹่จญๅฎšๆช”ไฝฟ็”จไธญใ€‚ๅ„ฒๅญ˜็š„่ฎŠๆ›ดๆœƒๅฅ—็”จๅˆฐๅ…จ้ƒจใ€‚ + ้ ่จญ่จญๅฎšๆช” + ๆกŒ้ขๆจกๅผ + ้Šๆˆฒๆจกๅผ + ๆกŒ้ข่ˆ‡้Šๆˆฒ็š„้ ่จญ + ้Šๆˆฒๆจกๅผ็š„้ ่จญ + ๆกŒ้ขๆจกๅผ็š„้ ่จญ + ่ฃ็ฝฎ่จญๅฎš + ๆŽงๅˆถ + ๆŒ‰้ตใ€ๆ–ๆกฟใ€ๆ‰ณๆฉŸ่ˆ‡้กๅค–ๆŒ‰้ต + ่ค‡่ฃฝ่จญๅฎšๆช” + ้‡่จญๅ‹•ไฝœ + ๅฐ‡ %1$s ็š„ๅ‹•ไฝœ้‡่จญ็‚บๅŸบ็คŽ่จญๅฎšๆช”็š„้ ่จญๅ€ผ๏ผŸ็‰ˆ้ข่ˆ‡ๅ…ถไป–่จญๅฎšๆช”ไธ่ฎŠใ€‚ + ๅˆช้™ค %1$s๏ผŸไฝฟ็”จๅฎƒ็š„ๆจกๅผๆœƒๅ›žๅˆฐๅ…งๅปบ้ ่จญ่จญๅฎšๆช”ใ€‚ๅทฒๅ„ฒๅญ˜็š„็‰ˆ้ข่ˆ‡ๅ…ฑ็”จ่จญๅฎšไปๅฏไฝฟ็”จใ€‚ + ้กฏ็คบ + ๅฐๆ‰€ๆœ‰่จญๅฎšๆช”็”Ÿๆ•ˆใ€‚้Šๆˆฒๆจกๅผไธ‹ๆœช้€ฃๆŽฅๆŽงๅˆถๅ™จๆ™‚๏ผŒAuto ๆœƒ้กฏ็คบไธป่žขๅน•ๆŽงๅˆถใ€‚ + ๅœจ่žขๅน•ไธŠ็ทจ่ผฏ + ๅทฒๅ„ฒๅญ˜็š„็‰ˆ้ขโ€ฆ + ้ธๆ“‡็‰ˆ้ขๆˆ–่‡ช่กŒๅปบ็ซ‹ + ๅœจๅ‰ฏ่žขๅน•ๅทฅไฝœ้šŽๆฎต้ธๅ–ฎไธญ้ธๆ“‡ใ€Œ่จญๅฎšๆช”ๆŽงๅˆถใ€ใ€‚ๆŽงๅˆถๅ™จ้ธๅ–ฎไธญ็š„่จญๅฎšๆช”่ˆ‡ๅ‰ฏ่žขๅน•้ธๆ“‡ๆฑบๅฎš้กฏ็คบๅ“ชไบ›ๆŽงๅˆถ้ …ใ€‚ + ๆŒ‰้ตๅ‹•ไฝœ + ่ˆ‡ %1$s ๅ…ฑ็”จใ€‚ไฟฎๆ”นไนŸๆœƒๅฅ—็”จๅˆฐ้€™ไบ›่จญๅฎšๆช”ใ€‚ + ้‡่ค‡ไฝฟ็”จ่จญๅฎš + ไฝฟ็”จ่จญๅฎšไพ†่‡ชโ€ฆ + ๅพžๅ…ถไป–่จญๅฎšๆช”่ค‡่ฃฝ๏ผŒๆˆ–ไฟๆŒ่จญๅฎšๅ…ฑ็”จ + ่จญ็‚บ็จ็ซ‹ + ไฟ็•™็›ฎๅ‰่จญๅฎšไธฆๅœๆญขๅ…ฑ็”จไฟฎๆ”น + ็‰ˆ้ขๅ„ฒๅญ˜ๆŽงๅˆถ้ …่ˆ‡ไฝ็ฝฎใ€‚ๆฏๅ€‹่จญๅฎšๆช”ๅฏๅ„่‡ชๆŒ‡ๅฎšๅ‹•ไฝœใ€‚่ซ‹ๅœจ็›ฎๆจ™่žขๅน•ไธŠไปฅๅฏฆ้š›ๅคงๅฐ็ทจ่ผฏใ€‚ + ็›ฎๅ‰็‰ˆ้ข + ๅˆช้™คๆœชไฝฟ็”จ็š„็‰ˆ้ข %1$s ๅŠๅ…ถๅ„ฒๅญ˜็š„ๅ‹•ไฝœ๏ผŸ + ้‡ๆ–ฐๅ‘ฝๅ็›ฎๅ‰็‰ˆ้ข + ๅพžๅฆไธ€ๅ€‹่จญๅฎšๆช”้‡่ค‡ไฝฟ็”จ %1$sใ€‚ๅ…ถไป–ๆŽงๅˆถไพ†ๆบไฟๆŒไธ่ฎŠใ€‚ + ไฟๆŒๅฏฆ้ซ”ๆŽงๅˆถๅ…ฑ็”จ + ้ ่จญๆƒ…ๆณไธ‹ๆ‰€ๆœ‰ๆŽงๅˆถ้ …่ˆ‡่‡ช่จ‚็‰ˆ้ข้ƒฝๆ˜ฏ็จ็ซ‹ๅ‰ฏๆœฌใ€‚ๅ…ฑ็”จๅช้€ฃ็ตๅฏฆ้ซ”ๆŽงๅˆถใ€‚ + ไฝฟ็”จ้€™ไบ›ๆŽงๅˆถ้ …่ˆ‡ไฝ็ฝฎใ€‚ๅ…ฑ็”จๆœƒ่ฎ“ไน‹ๅพŒ็š„ๅนพไฝ•ไฟฎๆ”นไฟๆŒๅŒๆญฅ๏ผŒๆŒ‰้ตๅ‹•ไฝœไปๅ„่‡ช็จ็ซ‹ใ€‚ๆ›็”จๅ…ถไป–็‰ˆ้ขๆ™‚ๅ‹•ไฝœๆ˜ฏๆœชๆŒ‡ๅฎš็š„ใ€‚ + ่ค‡่ฃฝ้€™ไบ›ๆŽงๅˆถ้ …่ˆ‡ๅ‹•ไฝœ๏ผŒๆˆ–้€ฃ็ตๅฎƒๅ€‘๏ผŒ่ฎ“ไน‹ๅพŒ็š„ไฟฎๆ”นๅŒๆ™‚ไฝœ็”จๆ–ผๅ…ฉๅ€‹่จญๅฎšๆช”ใ€‚ + ไฟๆŒๅ…ฑ็”จ + ็จ็ซ‹ๅ‰ฏๆœฌ + ๅพžๆŒ‰ไธ‹ไฝ็ฝฎ้–‹ๅง‹ + ไธไฝฟ็”จๆ™‚้šฑ่—ๆ–ๆกฟ + ๅทฅๅ…ท + ่‡ชๅ‹• (%1$s) + ่‡ช่จ‚ (%1$s) + ๅฆๅญ˜็‚บๆ–ฐ่จญๅฎšๆช” + ่จญๅฎšๆช”ๆŽงๅˆถ + ่จญๅฎšๆช” + ๆป‘้ผ ่งธๆŽงๆฟๆ‰‹ๅ‹ข + ็ถๅฎšๅˆฐๆป‘้ผ ๆŒ‡ๆจ™ๆ™‚๏ผš่ผ•้ปž้ปžๆ“Šใ€ๆŒ‰ไฝๆ‹–ๆ›ณใ€้›™ๆŒ‡ๆฒๅ‹•ใ€‚ + %1$s ๆœ‰ๅฟซ้€Ÿ้ธๅ–ฎ่ฆ†ๅฏซใ€‚ๅœจ้‚ฃ่ฃก้ธใ€Œ่‡ชๅ‹•ใ€ๆœƒไฝฟ็”จๅฎƒ็š„้ ่จญ่จญๅฎšๆช”่ˆ‡ๅ…จ้ƒจไธ‰ๅ€‹ๅทฒๅ„ฒๅญ˜้ƒจๅˆ†ใ€‚ + DroidDeck ่ผธๅ…ฅ + ๆ–ๆกฟๆœไปปๆ„ๆ–นๅ‘ๆŽจๅ‹•ๆœŸ้–“ไฟๆŒ๏ผš่ถ…้Ž 55% ๆ™‚ๆŒ‰ไธ‹๏ผŒไฝŽๆ–ผ 35% ๆ™‚ๆ”พ้–‹ใ€‚็”จใ€Œๆ–นๅ‘้ตใ€้€ๆ–นๅ‘ๆŒ‡ๅฎšใ€‚DroidDeck ๅ‹•ไฝœๆฏๆฌกๆŽจๅ‹•ๅชๅŸท่กŒไธ€ๆฌกใ€‚ๆ–ๆกฟ้ปžๆ“Šๅฆๅค–่จญๅฎšใ€‚ + ๆŒ‰ไฝ่งธๆŽงๆฟๆœŸ้–“ไฟๆŒ๏ผŒๆŠฌๆ‰‹ๆ™‚ๆ”พ้–‹ใ€‚DroidDeck ๅ‹•ไฝœๆฏๆฌก่งธ็ขฐๅŸท่กŒไธ€ๆฌกใ€‚่งธๆŽงๆฟ้ปžๆ“Šๅฆๅค–่จญๅฎšใ€‚ + ๆ‰ณๆฉŸ่ถ…้Ž 55% ๆ™‚ไฟๆŒ๏ผŒไฝŽๆ–ผ 35% ๆ™‚ๆ”พ้–‹ใ€‚DroidDeck ๅ‹•ไฝœๆฏๆฌกๆŒ‰ไธ‹ๅŸท่กŒไธ€ๆฌกใ€‚ + ๆฒๅ‹•ๆ–นๅ‘ + ๅž‚็›ด + ๆฐดๅนณ + ๆฐดๅนณๆฒๅ‹• + ๆธฌ้‡ + ้–‹ๅ•Ÿ่จ˜้Œ„๏ผŒๅœจๅŸท่กŒไธญ็š„ๅทฅไฝœ้šŽๆฎตไฝฟ็”จๆŽงๅˆถ้ …๏ผŒ็„ถๅพŒๅ›žไพ†่ฎ€ๅ–็ตๆžœใ€‚ๅชๆธฌ DroidDeck ็š„ๅ‚ณ้€ๆ™‚้–“๏ผŒไธๅซ้กฏ็คบๅปถ้ฒใ€‚App ็จ‹ๅบ้—œ้–‰ๆ™‚่จ˜้Œ„็ตๆŸใ€‚ + %1$d ๅ€‹ๆŽงๅˆถ้ … + ๅ…ถไป–ๅทฒๅ„ฒๅญ˜็š„็‰ˆ้ข (%1$d) โ–พ + ้šฑ่—ๅ…ถไป–ๅทฒๅ„ฒๅญ˜็š„็‰ˆ้ข (%1$d) โ–ด + ้ฆ–้  / Guide + ่ฟ”ๅ›ž ยท ๅ–ฎๆ“Š + ่ฟ”ๅ›ž ยท ้›™ๆ“Š + ่ฟ”ๅ›ž ยท Steam ่ฃกๅ…ฉไธ‹๏ผŒๆกŒ้ขไธŠไธ€ไธ‹ + Steam ๆจกๅผไธ‹ใ€‚ๆŒ‰ไฝ่ฟ”ๅ›žไนŸๆœƒ้–‹ๅ•Ÿๅฟซ้€Ÿ้ธๅ–ฎใ€‚ + ๆขๅพฉ้ ่จญ + ้ขๆฟ้ธๆ“‡ๆœƒ่ขซ่จ˜ไฝใ€‚ๆกŒ้ขๆœƒ้–‹ๅ•Ÿ็ฌฌไบŒๅ€‹ๅทฅไฝœๅ€๏ผŒไธๅˆ‡ๆ›ๅทฅไฝœ้šŽๆฎตๆˆ–ๅ…ถ่ผธๅ…ฅ่จญๅฎšๆช”ใ€‚ + ่™›ๆ“ฌๆŽงๅˆถๅ™จ + Steam ๆˆ–้Šๆˆฒ็œ‹ๅˆฐ็š„ๆŽงๅˆถๅ™จ้กžๅž‹ใ€‚ + ่งธๆŽง่žขๅน• + ้Šๆˆฒ็•ซ้ขไธŠ็š„่งธ็ขฐๅฆ‚ไฝ•่™•็†ใ€‚่จญๅฎšๆช”่ฃก็š„ๆŒ‰้ตไฟๆŒๅ„่‡ชๆŒ‡ๅฎš็š„ๅ‹•ไฝœใ€‚ + ่งธ็ขฐๆธธๆจ™ + ๅœจ้Šๆˆฒ็•ซ้ขไธŠ็›ดๆŽฅ่งธ็ขฐๆ™‚้กฏ็คบๆŒ‡ๆจ™ใ€‚ + ่งธ็ขฐไธฆๆŒ‰ไฝ + ๆ‰‹ๆŒ‡ๆŒ‰ไฝ้Šๆˆฒ็•ซ้ขๆ™‚็š„ๆป‘้ผ ๅ‹•ไฝœใ€‚ + ่ฟ”ๅ›ž้ต้ปžๆ“Š + ็ฌฌไธ€ๅ€‹ๅ‹•ไฝœ๏ผšๅ–ฎๆ“Šใ€‚็ฌฌไบŒๅ€‹ๅ‹•ไฝœ๏ผš้›™ๆ“Šใ€‚ + ้–‹้—œๆŒ‰้ต + ้ปžไธ€ไธ‹ๆŒ‰ไฝ๏ผŒๅ†้ปžไธ€ไธ‹ๆ”พ้–‹ใ€‚้–‹ๅ•Ÿ้ธๅ–ฎๆˆ–ๅˆ‡ๆ›่จญๅฎšๆช”ๆœƒๆ”พ้–‹ๆŒ‰้ตใ€‚ + ๅฝข็‹€ + ๅœ“่ง’ + ่† ๅ›Š + ๅœ“ๅฝข + ็Ÿฉๅฝข + ๆŒ‰้ตๆ–‡ๅญ— + ๆ–‡ๅญ— + ๅŒฏๅ…ฅ็š„ๅœ–็‰‡ + ็จ็ซ‹ๆ–œๅ‘้ต + ็ตฆๆฏๅ€‹ๆ–œๅ‘ๆŒ‡ๅฎšไธ€ๅ€‹้ตใ€‚็ฉบ็š„ๆ–œๅ‘ๆœƒๆŒ‰็›ธ้„ฐ็š„ๅ…ฉๅ€‹ๆ–นๅ‘ใ€‚ + ็›ธ้„ฐๆ–นๅ‘ + ่ˆŠ็š„่žขๅน•ๆŒ‰้ตๅทฒๅญ˜็‚บไธ‹ๆ–น็š„ๅŒฏๅ…ฅ่จญๅฎšๆช”ใ€‚้ธไธ€ๅ€‹ไฝฟ็”จๆˆ–็ทจ่ผฏใ€‚็›ฎๅ‰้ธๅ–็š„่จญๅฎšๆช”ไฟๆŒไธ่ฎŠใ€‚ + ็„กๆณ•่‡ชๅ‹•ๅŒฏๅ…ฅ่ˆŠ็š„่žขๅน•ๆŒ‰้ตใ€‚ๅŽŸ่จญๅฎšๅทฒไฟ็•™ใ€‚ + diff --git a/app/src/main/res/values-zh-rHK/input_strings.xml b/app/src/main/res/values-zh-rHK/input_strings.xml new file mode 100644 index 0000000000..713cc729e8 --- /dev/null +++ b/app/src/main/res/values-zh-rHK/input_strings.xml @@ -0,0 +1,38 @@ + + + ่ผธๅ…ฅ่จญๅฎšๆช” + ่จญๅฎšๆช” + ๅฏฆ้ซ”ๆŽงๅˆถๅ™จ + ไธป่žขๅน• + ๅ‰ฏ่žขๅน• + ๅŽŸ็”Ÿ / Steam Input + ๅŽŸ็”Ÿ๏ผš%1$s + ๅ‚ณ้€ๅฆไธ€ๅ€‹ๆŽงๅˆถๅ™จๆŒ‰้ต + ๅทฒๅœ็”จ + ๆŒ‰้ตๆˆ–็ต„ๅˆ้ต + ๆ–นๅ‘้ต + ็งปๅ‹•ๆŒ‡ๆจ™ + ๆŒ‡ๆจ™้€Ÿๅบฆ๏ผš%1$d + ๆฒๅ‹• + ๅž‚็›ดๆฒๅ‹• + ๆป‘้ผ ๅทฆ้ต + ๆป‘้ผ ๅณ้ต + ๆป‘้ผ ไธญ้ต + ้–‹ๅ•Ÿ DroidDeck ้ธๅ–ฎ + ้กฏ็คบ้ต็›ค + ้–‹ๅ•Ÿ Steam ้ธๅ–ฎ + ้–‹ๅ•Ÿ Steam ๅฟซ้€Ÿ้ธๅ–ฎ + ็งป้™คๆŽงๅˆถ้ … + ๆ–ฐๅขžๆŽงๅˆถ้ … + ๆญค่ฃ็ฝฎๅฐˆ็”จๆŒ‰้ต + ๆŒ‡ๅฎšๅฏฆ้ซ”ๆŒ‰้ต + ๆ”พ้–‹ๆŒ‰้ต๏ผŒ็„ถๅพŒ้ธๆ“‡็ทจ่ผฏใ€้‡่ฉฆๆˆ–ๅ–ๆถˆใ€‚ๆ”พ้–‹ๅพŒๆŒ‰ B ๆˆ–่ฟ”ๅ›žๅฏๅ–ๆถˆใ€‚ + ้‡่ฉฆ + ๆŒ‰ไธ‹ไปปๆ„ๆŒ‰้ต๏ผŒๅŒ…ๆ‹ฌ่ขซ่ญ˜ๅˆฅ็‚บ้ต็›คๆŒ‰้ต็š„่ฟ”ๅ›ž้ตใ€‚้Ÿณ้‡้ต่ˆ‡ Android ็ณป็ตฑ้ตๅทฒไฟ็•™ใ€‚ๆŒ‡ๅฎšๅƒ…้ฉ็”จๆ–ผๆญค่ฃ็ฝฎใ€‚ + ็งป้™คๆŒ‡ๅฎš + ่ผธๅ…ฅ่จบๆ–ท + ่จ˜้Œ„่ผธๅ…ฅๅ‚ณ้€ๆ™‚้–“ + ่ฎ€ๅ–ๆธฌ้‡็ตๆžœ + ๆธฌ้‡ๅพž Android ๆดพ้€ๅˆฐ็™ผไฝˆ่‡ณ็พๆœ‰่ผธๅ…ฅ้€š้“็š„ๆ™‚้–“ใ€‚ไธๅซ่—็‰™ๆŽฅๆ”ถใ€ๅฎข้ซ”่ผช่ฉขใ€็นช่ฃฝ่ˆ‡้กฏ็คบๅปถ้ฒใ€‚้ ่จญไธ่จ˜้Œ„ใ€‚ + ไฝฟ็”จไธ€่ˆฌ่ผธๅ…ฅ็ถๅฎš + diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index b8d2bf0846..709bda78c9 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -28,6 +28,8 @@ ็ซ‹ๅณๆšซๅœ ็ตๆŸๆœƒ่ฉฑ ๅน€็”Ÿๆˆ + ๆญค้Šๆˆฒ็š„่จญๅฎš + ้ ่จญ่จญๅฎš ้ธๆ“‡ๅน€็”Ÿๆˆๆจกๅผ ้—œ้–‰ DD-FG %1$dร— @@ -183,6 +185,7 @@ ็„กๆณ•ไธ‹่ผ‰ PowerVR ๅœ–ๅฝข็’ฐๅขƒใ€‚่ซ‹ๆชขๆŸฅ็ถฒ็ตก้€ฃ็ทšๅพŒๅ†่ฉฆใ€‚ ็„กๆณ•ไธ‹่ผ‰ DirectAudio๏ผŒๅ› ๆญคๆœฌๆฌกๆœƒ่ฉฑ็š„้Šๆˆฒ้Ÿณ่จŠๆœƒไฝฟ็”จ่ผƒๆ…ข็š„่ทฏๅพ‘ใ€‚ ๆญค็จ‹ๅผ + ๅทฅไฝœ้šŽๆฎต็„กๆณ•ๆŠŠ็•ซ้ข็นช่ฃฝๅˆฐ่žขๅน•๏ผš%1$sใ€‚้€™ๅ€‹็•ซ้ขๆœƒ้กฏ็คบๅŽŸๅ› ๏ผŒ่€Œไธๆ˜ฏ้ป‘็•ซ้ข๏ผ›่ฉณๆƒ…่ผ‰ๆ–ผๅทฅไฝœ้šŽๆฎต่จ˜้Œ„ใ€‚ ็„กๆณ•ไธ‹่ผ‰ Steam ็”จๆˆถ็ซฏใ€‚ไฝ ็š„็ถฒ็ตกๆˆ– VPN ๅฏ่ƒฝๅฐ้Ž–ไบ† Steam ็š„ไผบๆœๅ™จ๏ผ›่ซ‹ๆชขๆŸฅ้€ฃ็ทšๅพŒๅ†่ฉฆใ€‚ ็„กๆณ•่จญๅฎš Steam ็”จๆˆถ็ซฏใ€‚่ซ‹ๆชขๆŸฅ้€ฃ็ทšๅ’Œๅฏ็”จๅ„ฒๅญ˜็ฉบ้–“๏ผŒ็„ถๅพŒๅ†่ฉฆใ€‚ %1$s ๆ˜ฏ็‚บ x86 ้›ป่…ฆ่€Œ่จญ๏ผŒ้œ€้€้Ž FEX ๅŸท่กŒ๏ผŒไฝ† FEX ๅฐšๆœชๅฎ‰่ฃใ€‚่ซ‹ๅœจ็™ปๅ…ฅ็‹€ๆ…‹ไธ‹ๅ•Ÿๅ‹•ไธ€ๆฌก Steam๏ผŒ่ฎ“ๅฎƒไธ‹่ผ‰ FEX ๅ’Œ Steam Linux Runtime๏ผŒ็„ถๅพŒๅ†ๅ•Ÿๅ‹•ๆญค็จ‹ๅผใ€‚ @@ -384,6 +387,9 @@ ้€™่ฃๆšซไธๆ”ฏๆด ๆญฃๅœจ่ผ‰ๅ…ฅ็ต„ไปถโ€ฆ ็„กๆณ•ๅฎ‰่ฃ๏ผš%1$s + ้€™ๅ€‹ไธ‹่ผ‰้ …็›ฎ้œ€่ฆๆ›ดๆ–ฐใ€‚ + ๆ›ดๆ–ฐๅทฒๆŽ’้šŠใ€‚ + ้‡่ฉฆๆ›ดๆ–ฐ ๅทฒไธ‹่ผ‰ ๆญฃๅœจไธ‹่ผ‰ %1$s ๆญฃๅœจๅฎ‰่ฃ๏ผš%1$s @@ -414,6 +420,22 @@ ๅช้™ๅ…ง้ƒจๅ„ฒๅญ˜็ฉบ้–“ ่ณ‡ๆ–™ๅคพ๏ผš%1$s ็ฌฌไบŒๅ€‹ๆ”ถ่—ๅบซ + ๆ›ดๅคš Steam ็จ‹ๅผๅบซ + Steam ๅฏ็”จไพ†ๅฎ‰่ฃๅŠๅŸท่กŒ้Šๆˆฒ็š„่ณ‡ๆ–™ๅคพ๏ผŒๅ„ๆœ‰่‡ชๅทฑ็š„ๅ็จฑใ€‚็งป้™ค็จ‹ๅผๅบซไธๆœƒๅˆช้™ค็•ถไธญ็š„้Šๆˆฒใ€‚ + ๆ–ฐๅขž็จ‹ๅผๅบซ + ้‡ๆ–ฐๅ‘ฝๅ + ็จ‹ๅผๅบซๅ็จฑ + ็‚บ็จ‹ๅผๅบซ้ธๆ“‡่ณ‡ๆ–™ๅคพ + ๆœ€ๅคšๅฏๆ–ฐๅขž %1$d ๅ€‹็จ‹ๅผๅบซ + ้€™ๅ€‹่ณ‡ๆ–™ๅคพๅทฒๆ˜ฏ็จ‹ๅผๅบซ๏ผŒๆˆ–ไฝๆ–ผๅฆไธ€ๅ€‹็จ‹ๅผๅบซไน‹ๅ…ง + %1$s ยท ็„กๆณ•ไฝฟ็”จ + ็”ฑไธ‹ไธ€ๅ€‹ Steam ๅทฅไฝœ้šŽๆฎต่ตท็”Ÿๆ•ˆ + ๅœจๆญค่ฃ็ฝฎๆ‰พๅˆฐ ยท %1$s ยท %2$s + ๆ–ฐๅขž + ๅฐ‹ๆ‰พๅ…ง้ƒจๅ„ฒๅญ˜็ฉบ้–“ไธญ็š„็จ‹ๅผๅบซ + ๆŽˆไบˆๆ‰€ๆœ‰ๆช”ๆกˆๅญ˜ๅ–ๆฌŠ๏ผŒDroidDeck ๆ‰่ƒฝๆŸฅ็œ‹ๅ…ถไป–ๆ‡‰็”จ็จ‹ๅผๅญ˜ๆ”พๅœจๅ…ง้ƒจๅ„ฒๅญ˜็ฉบ้–“็š„ Steam ็จ‹ๅผๅบซ + ๅ…่จฑ + ๅทฒๆ–ฐๅขž %1$s๏ผŒๅณๆ‰€้ธ่ณ‡ๆ–™ๅคพๅ…ง็š„ Steam ็จ‹ๅผๅบซ ๅพž SD ๅกๆˆ–ๅ…ฑ็”จๅ„ฒๅญ˜็ฉบ้–“ไธฒๆต่ณ‡ๆบ็š„้Šๆˆฒๅฏ่ƒฝๆœƒๅก้ “ใ€‚ ๅ„ฒๅญ˜็ฉบ้–“่จบๆ–ท ๅœจๅˆ†ไบซ็š„่จ˜้Œ„ไธญๅŠ ๅ…ฅ็ฉบ้–“ๅˆ†้…็ตๆžœๅ’ŒๆŠฝๆจฃ็š„ๅ„ฒๅญ˜ๆ™‚้–“ๆ•ธๆ“šใ€‚ๅ•Ÿ็”จๆ™‚ๅฏ่ƒฝๆœƒๆธ›ๆ…ขๅฎ‰่ฃ้€Ÿๅบฆใ€‚ไธ‹ๆฌกๆœƒ่ฉฑ็”Ÿๆ•ˆใ€‚ @@ -476,6 +498,7 @@ ้–‹ ้šจ Steam ๅ•Ÿๅ‹• ไธ็ถ“ Steam ๅ•Ÿๅ‹• + ้Šๆˆฒ่งฃๅƒๅบฆ ่จญๅฎš %1$s ่จญๅฎš ้ ่จญ @@ -563,6 +586,8 @@ ้Šๆˆฒๆ ธๅฟƒ ้Šๆˆฒๆ ธๅฟƒ ไพ›้Šๆˆฒไฝฟ็”จ็š„ๆ ธๅฟƒใ€‚ๅ…จ้ธๆ™‚็”ฑ Android ่‡ช็”ฑๆŽ’็จ‹ใ€‚ + ็ฉฉๅฎš็š„้Šๆˆฒ็œ้›ป้‹่กŒ + ้Šๆˆฒๅน€็އ็ฉฉๅฎšๆ™‚ๅœจ่ผƒๆ…ข็š„ๆ ธๅฟƒไธŠ้‹่กŒ๏ผŒไธ€ๆ—ฆ่ทŸไธไธŠๅฐฑๅ›žๅˆฐๅŽŸไพ†็š„ๆ ธๅฟƒใ€‚ ็”จๆˆถ็ซฏไป‹้ข GL ๅคš็ทš็จ‹ ๅฏ่ƒฝ่ฎ“ Steam ้ธๅ–ฎๅๆ‡‰ๆ›ดๅฟซใ€‚ @@ -598,7 +623,10 @@ ๅœ็”จ Proton ็š„ๆŽงๅˆถๅ™จๅฐŽ่ฆฝ่ผ”ๅŠฉ็จ‹ๅผ๏ผŒๅฎƒๅœจๆฏๅ€‹้Šๆˆฒไธญ้ƒฝๆœƒไฝ”็”จ CPUใ€‚ ไธไฝฟ็”จ seccomp ๅŸท่กŒ proot ๅฏ่ƒฝไฟฎๆญฃ้ƒจๅˆ†ๅ…งๆ ธไธŠ็ผบๅฐ‘็ณป็ตฑๅ‘ผๅซ็š„้Œฏ่ชค๏ผŒไฝ†ๅฏ่ƒฝ้™ไฝŽๆ•ˆ่ƒฝใ€‚ + ไธไฝฟ็”จ proot ๅŸท่กŒ๏ผˆๅฏฆ้ฉ—ๆ€ง๏ผ‰ + ็›ดๆŽฅๅœจ Android ไธŠๅ•Ÿๅ‹• Linux ็’ฐๅขƒ๏ผŒๆ–ผไธ‹ไธ€ๅ€‹ๅทฅไฝœ้šŽๆฎต็”Ÿๆ•ˆใ€‚่‹ฅๆœ‰้ …็›ฎ็„กๆณ•ๅ•Ÿๅ‹•๏ผŒ่ซ‹้—œ้–‰ๆญค้ธ้ …ใ€‚ proot ๅฟซ้€Ÿ่ทฏๅพ‘ + ไธไฝฟ็”จ proot ๆ™‚ไธๆœƒ็”จๅˆฐใ€‚ ้œ€่ฆ proot ็š„ seccomp ็ฏฉ้ธๅ™จใ€‚ ๆช”ๆกˆๆŸฅๆ‰พๆ›ดๅฟซ๏ผŒๅก้ “ๆ›ดๅฐ‘ใ€‚ๅฆ‚ๆžœ็จ‹ๅผๆ‰พไธๅˆฐๅ…ถๆช”ๆกˆ๏ผŒ่ซ‹้—œ้–‰ๆญค้ …ใ€‚ ๅœจ gamescope ๅ…ง็นช่ฃฝๆธธๆจ™ @@ -681,6 +709,7 @@ ้กฏ็คบ่จ˜ๆ†ถ้ซ” ไบคๆ›็ฉบ้–“ ้›ปๆฑ ้›ป้‡ + ๅ‰ฉ้ค˜้›ปๆฑ ็บŒ่ˆชๆ™‚้–“ ๅŠŸ่€— ็ถฒ็ตก ่งฃๅƒๅบฆ @@ -835,15 +864,38 @@ ๆœƒ่ฉฑ ๆœƒ่ฉฑ่จ˜้Œ„ ๆฏๆฌกๆœƒ่ฉฑๅพŒๅ„ฒๅญ˜ + ็‚บไธ‹ไธ€ๅ€‹ๅทฅไฝœ้šŽๆฎตๅ•Ÿ็”จ้€ฒ้šŽ่จบๆ–ท + ๅช็‚บไธ€ๅ€‹ๅทฅไฝœ้šŽๆฎตๆ”ถ้›†่ฉณ็ดฐ่จ˜้Œ„๏ผŒๅฏ่ƒฝๅฝฑ้Ÿฟๆ•ˆ่ƒฝไธฆ่€—็”จ่ผƒๅคšๅ„ฒๅญ˜็ฉบ้–“ใ€‚ๅทฅไฝœ้šŽๆฎตๅ•Ÿๅ‹•ๅพŒๆœƒ่‡ชๅ‹•้—œ้–‰๏ผ›ๅˆ†ไบซๅ‰่ซ‹ๅ…ˆๆŸฅ็œ‹่จ˜้Œ„ใ€‚ ้Šๆˆฒๅต้Œฏ่จ˜้Œ„ ๅœจไธ‹ๆฌกๅ•Ÿๅ‹•้Šๆˆฒๆ™‚ๅŠ ๅ…ฅ Protonใ€Wine ๅ’Œๅœ–ๅฝข่จบๆ–ท่ณ‡่จŠใ€‚ๅฏ่ƒฝ้™ไฝŽๆ•ˆ่ƒฝไธฆไฝ”็”จๆ›ดๅคšๅ„ฒๅญ˜็ฉบ้–“ใ€‚ ้‡ๆ–ฐๅ•Ÿๅ‹•ๆญคๆœƒ่ฉฑไปฅๅ„ฒๅญ˜้Šๆˆฒๅต้Œฏ่จ˜้Œ„ ็„กๆณ•ๆ›ดๆ–ฐ่จ˜้Œ„่จญๅฎšใ€‚่ซ‹ๆชขๆŸฅ้–‹้—œๅพŒๅ†่ฉฆไธ€ๆฌกใ€‚ ๅต้Œฏๅทฅๅ…ท + ่ฉณ็ดฐๅœ–ๅฝข่จ˜้Œ„ + Steam ไป‹้ข๏ผšGPU ็นช่ฃฝ + ไฝฟ็”จ Xclipse ้ฉ…ๅ‹•็จ‹ๅผ็ต„ๅˆๆ™‚๏ผŒSteam ๆœƒไปฅ่ปŸไปถ็นช่ฃฝ้ ้ข๏ผˆGPU ็นช่ฃฝๆ›พๅ‡บ็พๅœ–ๅกŠ็ ดๆ๏ผ‰ใ€‚่‹ฅๅœจ้€™้ƒจๆ‰‹ๆฉŸไธŠ้กฏ็คบๆญฃๅธธ๏ผŒๅฏ้–‹ๅ•ŸไปฅๅŠ ๅฟซ Steam ไป‹้ขใ€‚ + ๅปบ็ฝฎๆ–ผ %1$s + %1$s ๅทฒๆ›ดๆ–ฐ่‡ณๆœ€ๆ–ฐๅปบ็ฝฎ + Mali ๆฉ‹ๆŽฅๅœจไธŠๆฌกๅทฅไฝœ้šŽๆฎตๆ–ผ %1$s ้€ฒ่กŒ่‡ชๆˆ‘ๆธฌ่ฉฆๆ™‚ๅคฑๆ•—๏ผˆๅฝฑๅƒๆˆ–็นช่ฃฝ๏ผ‰๏ผŒๅ› ๆญค่ฉฒๅทฅไฝœ้šŽๆฎตๆ”น็”จไบ† PanVK ้ฉ…ๅ‹•็จ‹ๅผ็ต„ๅˆใ€‚ + Mali ๆฉ‹ๆŽฅๅœจไธŠๆฌกๅทฅไฝœ้šŽๆฎตๆ‰พไธๅˆฐ่ˆ‡ %1$s ไธŠ็š„้ฉ…ๅ‹•็จ‹ๅผๅ…ฑ็”จ่จ˜ๆ†ถ้ซ”็š„ๆ–นๆณ•๏ผŒๅ› ๆญค่ฉฒๅทฅไฝœ้šŽๆฎตๆ”น็”จไบ† PanVK ้ฉ…ๅ‹•็จ‹ๅผ็ต„ๅˆใ€‚ๆญคๆฉ‹ๆŽฅ็„กๆณ•ๅœจ้€™้ƒจๆ‰‹ๆฉŸ้‹ไฝœ๏ผ›้—œ้–‰ๅฎƒๅฏ็นผ็บŒไฝฟ็”จ PanVK ็ต„ๅˆใ€‚ + ๅ„้Šๆˆฒ็š„ Protonใ€DXVK ๅŠ้ฉ…ๅ‹•็จ‹ๅผ่จ˜้Œ„ๆœƒๅŠ ๅ…ฅๅทฅไฝœ้šŽๆฎต่จ˜้Œ„ใ€‚GPU ไธๆ˜ฏ Adreno ๆ™‚ไธ€ๅพ‹้–‹ๅ•Ÿใ€‚ ๆœ€ๆ–ฐ็š„ๆœƒ่ฉฑ่จ˜้Œ„ ๅทฒๅ„ฒๅญ˜็š„ๆœƒ่ฉฑ่จ˜้Œ„ ไฟ็•™ๆœ€ๆ–ฐ็š„ %1$d ๅ€‹ ๆธ…้™ค่จ˜้Œ„ + ๅฏ็”จ็š„ๅทฅไฝœ้šŽๆฎต่จ˜้Œ„ + ๅฐšๆœชๅ„ฒๅญ˜ไปปไฝ•ๅทฅไฝœ้šŽๆฎต่จ˜้Œ„ใ€‚ + ๅˆ†ไบซๅŠๅ„ฒๅญ˜็š„ ZIP ๆช”ๅŒ…ๅซๆ‰€้ธๅทฅไฝœ้šŽๆฎต็š„่จ˜้Œ„๏ผŒไปฅๅŠ็›ธ้—œ็š„ Steamใ€ๅ•†ๅบ—ใ€ๅทฅๅ…ทๅŠ Battle.net ่จบๆ–ท่ณ‡ๆ–™ใ€‚ + %1$s ยท %2$s + ็›ฎๅ‰ๅทฅไฝœ้šŽๆฎต + ๅˆ†ไบซ + ๅ„ฒๅญ˜่‡ณ่ฃ็ฝฎ + ๅˆช้™ค + ๅˆช้™คๅทฅไฝœ้šŽๆฎต่จ˜้Œ„๏ผŸ + ๅˆช้™ค %1$s๏ผŸๆญคๅ‹•ไฝœ็„กๆณ•ๅพฉๅŽŸใ€‚ + ๅทฅไฝœ้šŽๆฎต่จ˜้Œ„ๅทฒๅ„ฒๅญ˜ใ€‚ + ็„กๆณ•ๅ„ฒๅญ˜ๅทฅไฝœ้šŽๆฎต่จ˜้Œ„ใ€‚ + ็„กๆณ•ๅˆช้™คๅทฅไฝœ้šŽๆฎต่จ˜้Œ„ใ€‚ ้‡่จญๆ‰€ๆœ‰่จญๅฎš ๅฐ‡ๆ‰€ๆœ‰่จญๅฎš้‚„ๅŽŸ็‚บ้ ่จญๅ€ผ ้‡่จญ @@ -870,6 +922,8 @@ ็”จไฝœไธป็•ซ้ข DroidDeck ๅฏ็”จไฝœไธป็•ซ้ขๆ‡‰็”จ็จ‹ๅผ DroidDeck ไธๆœƒไฝœ็‚บไธป็•ซ้ขๆ‡‰็”จ็จ‹ๅผ็š„้ธ้ … + ไธป้ ้ต้–‹ๅ•Ÿ + ็•ถ DroidDeck ็‚บไธป็•ซ้ขๆ‡‰็”จ็จ‹ๅผ๏ผŒๆŒ‰ไธ‹ไธป้ ้ตๆ™‚้กฏ็คบ็š„ๅˆ†้ ใ€‚ ่ซ‹ๅœจใ€Œๆ–ฐๅขž้Šๆˆฒใ€ไธญๅฐ‡ DroidDeck ่จญ็‚บใ€ŒๅŒ…ๅซใ€ ่žขๅน•ๆ–นๅ‘ ๅ•Ÿๅ‹•ๅ™จๆ–นๅ‘ @@ -883,15 +937,22 @@ ๅ…จ่žขๅน• ้šฑ่— Android ็‹€ๆ…‹ๅˆ—ๅ’ŒๅฐŽ่ฆฝๅˆ— ้กฏ็คบ Android ็‹€ๆ…‹ๅˆ—ๅ’ŒๅฐŽ่ฆฝๅˆ— + ้›™่žขๅน•ๅ•Ÿๅ‹•ๅ™จ + ่‡ชๅ‹•ๆœƒๆŠŠๅ•Ÿๅ‹•ๅ™จๅ„้ƒจๅˆ†๏ผˆSteamใ€ๆ”ถ่—ๅบซใ€ๅ•†ๅบ—ๅŠๅ…ถไป–้ƒจๅˆ†๏ผ‰ๆ”พๅˆฐๅ…งๅปบ้›™่žขๅน•ๆ‰‹ๆŒ่ฃ็ฝฎ็š„็ฌฌไบŒ่žขๅน•ใ€‚้–‹ๅ•Ÿๆœƒไฝฟ็”จไปปไฝ•็ฌฌไบŒ้กฏ็คบๅ™จใ€‚้—œ้–‰ๆœƒๅฐ‡ๅ•Ÿๅ‹•ๅ™จไฟๆŒๅœจๅ–ฎไธ€่žขๅน•ใ€‚ + ้›™่žขๅน•ๅทฅไฝœ้šŽๆฎต + ่‡ชๅ‹•ๆœƒๆŠŠ้Šๆˆฒๅ…ง้ธๅ–ฎๅ›บๅฎšๅœจๅ…งๅปบ็ฌฌไบŒ่žขๅน•๏ผŒ่€Œ้žไปฅๅฝˆๅ‡บๅผ่ฆ–็ช—้กฏ็คบใ€‚้–‹ๅ•Ÿๆœƒไฝฟ็”จไปปไฝ•็ฌฌไบŒ้กฏ็คบๅ™จใ€‚้—œ้–‰ๆœƒๆŠŠ้ธๅ–ฎ็•™ๅœจ้Šๆˆฒ็•ซ้ข๏ผ›ไฝ ไปๅฏๅพž้ธๅ–ฎ้ธๆ“‡็ฌฌไบŒ่žขๅน•ใ€‚ ่‡ชๅ‹• ้–‹ๅ•Ÿ ้—œ้–‰ ้Šๆˆฒไธญ็š„ไธ‹ๅฑๆŽงๅˆถ + ๆ–‡ๅญ—ๆฌ„ไฝไฝฟ็”จ Android ้ต็›ค ๅทฅไฝœ้šŽๆฎต้–‹ๅง‹ๆ™‚ๅœจ็ฌฌไบŒๅกŠ่žขๅน•ไธŠ้–‹ๅ•Ÿ่งธๆŽงๆฟๅ’Œ้ต็›คใ€‚ ๆญฃๅœจ็‚บไธŠๅฑ่ผธๅ…ฅ ๅฎŒๆˆ ้ ่จญไธป็•ซ้ขๆ‡‰็”จ็จ‹ๅผ ้ธๆ“‡ไธป็•ซ้ขๆ‡‰็”จ็จ‹ๅผ + ้–’็ฝฎๆ™‚ๅพžใ€Œๆœ€่ฟ‘ไฝฟ็”จใ€ไธญ้šฑ่—ไธป็•ซ้ข + ๅƒ…ๅœจ DroidDeck ็‚บ้ ่จญไธป็•ซ้ขๆ‡‰็”จ็จ‹ๅผ๏ผŒไธ”ๆฒ’ๆœ‰ๅทฅไฝœ้šŽๆฎตๆญฃๅœจๅŸท่กŒๆ™‚็”Ÿๆ•ˆใ€‚ ้ธๆ“‡ Linux ๆ‡‰็”จ็จ‹ๅผ๏ผˆๆธฌ่ฉฆ็‰ˆ๏ผ‰ ๆช”ๆกˆ @@ -1003,9 +1064,172 @@ ้ ่ฆฝ็‰ˆ ๆœ€ๆ–ฐไฟฎๆญฃ๏ผŒๆฏ”็ฉฉๅฎš็‰ˆๆ›ดๆ—ฉๆŽจๅ‡บ ๅทฒๆ˜ฏๆœ€ๆ–ฐ + ่ค‡่ฃฝ็‰ˆๆœฌ่ณ‡ๆ–™ + ๅทฒ่ค‡่ฃฝ็‰ˆๆœฌ่ณ‡ๆ–™ + ๆฏ”้ ่ฆฝ็‰ˆๆ–ฐ + ไฝ ้ ˜ๅ…ˆ้ ่ฆฝ็‰ˆ + ๆญค็‰ˆๆœฌๆฏ”ๆœ€ๆ–ฐ็š„้ ่ฆฝ็‰ˆๆ›ดๆ–ฐใ€‚ไธ‹ไธ€ๅ€‹้ ่ฆฝ็‰ˆๆœƒๆ›ดๆ–ฐๅฎƒใ€‚ + ้ธๆ“‡ไธ€ๅ€‹็‰ˆๆœฌไปฅๆŸฅ็œ‹ๅ…ถ่ฎŠๆ›ดๆˆ–ๅฎ‰่ฃใ€‚ + ๅทฒๅฎ‰่ฃ + ๅฎ‰่ฃๆญค็‰ˆๆœฌ%1$s + ้€€ๅ›žๆญค็‰ˆๆœฌ%1$s + versionCode %1$d + ๆไบค %1$s + ็™ผไฝˆ้ ้ข + ๆญค PR ๆœ‰่ผƒๆ–ฐ็š„ๆไบค๏ผˆ%1$s๏ผ‰ใ€‚ๅฎƒ็š„ๆธฌ่ฉฆ็‰ˆๆœฌๅฐšๆœชๆบ–ๅ‚™ๅฅฝ๏ผŒๅ› ๆญคๆญค็‰ˆๆœฌไธๅŒ…ๅซๅฎƒใ€‚ + ๅทฒๆŽจ้€ๆ–ฐๆไบค๏ผŒ็‰ˆๆœฌๅพ…ๅปบ็ซ‹ + PR ็ทจ่™Ÿใ€ๆจ™้กŒๆˆ–ไฝœ่€… + ๆฒ’ๆœ‰็›ธ็ฌฆ็š„ๆธฌ่ฉฆ็‰ˆๆœฌ + ้œ€่ฆ้‡ๆ–ฐๅปบ็ฝฎ๏ผˆversionCode %1$d๏ผ‰ + ๆธฌ่ฉฆ็‰ˆๆœฌๆ›ดๆ–ฐ + PR #%1$d ๆœ‰ๆ–ฐ็š„ๆธฌ่ฉฆ็‰ˆๆœฌ + %1$sใ€‚้–‹ๅ•Ÿใ€Œๆ›ดๆ–ฐใ€้€ฒ่กŒๅฎ‰่ฃใ€‚ + ้กฏ็คบๆ›ดๅคš๏ผˆ%1$d๏ผ‰ + ้œ€่ฆ็‚บ versionCode %2$d ้‡ๆ–ฐๅปบ็ฝฎ๏ผˆ%1$d๏ผ‰ + ๆญคๆธฌ่ฉฆ็‰ˆๆœฌไน‹ๅพŒ main ไธŠ็š„้ ่ฆฝ็‰ˆ๏ผš%1$d ๆธฌ่ฉฆ็‰ˆๆœฌ ๅœจๆญฃๅผ็™ผไฝˆๅ‰่ฉฆ็”จไฟฎๆญฃ ็›ฎๅ‰ๆฒ’ๆœ‰ + ๅฏฆ้ฉ—็‰ˆๆœฌ + ๅฏฆ้ฉ—็‰ˆๆœฌ + ไฝฟ็”จไธญ + Android ้‡ๆ–ฐๆœ€ไฝณๅŒ– DroidDeck ๅพŒๅทฒๆšซๅœ + ๆœช่ผ‰ๅ…ฅ๏ผš%1$s + ็ญ‰ๅพ…้‡ๆ–ฐๅ•Ÿๅ‹• + ๅทฒไฟ็•™ + ้ฉ็”จๆ–ผๅฆไธ€ๅ€‹็‰ˆๆœฌ + ้‡ๅปบ + ๆœƒๅพž่ฃ็ฝฎๅˆช้™ค้€™ๅ€‹็‰ˆๆœฌ + ไปฅๆญค็‰ˆๆœฌ้‡ๆ–ฐๅ•Ÿๅ‹• + ้—œ้–‰ + ไฝฟ็”จ + ๅˆช้™ค + ็ซ‹ๅณๅˆช้™ค + ็„กๆณ•ๆบ–ๅ‚™้‡ๆ–ฐๅ•Ÿๅ‹•๏ผš%1$sใ€‚่ซ‹ๅœจ่จญๅฎšไธญๅฎŒๆˆ็„ก็ทšๅต้Œฏ้…ๅฐ๏ผŒ็„ถๅพŒๅ†่ฉฆไธ€ๆฌกใ€‚ + ๅฏฆ้ฉ—็‰ˆๆœฌๅทฒๅฎ‰่ฃ + DroidDeck ๅทฒไปฅ %1$s ้‡ๆ–ฐๅ•Ÿๅ‹• + ๅฏฆ้ฉ—็‰ˆๆœฌๅทฒๆšซๅœ + Android ้‡ๆ–ฐๅ„ชๅŒ–ไบ† DroidDeck๏ผŒๅ› ๆญคๆฒ’ๆœ‰่ผ‰ๅ…ฅ %1$sใ€‚ๅˆฐใ€Œๆ›ดๆ–ฐใ€้‡ๆ–ฐๅ•Ÿๅ‹•ๅณๅฏไฝฟ็”จๅฎƒใ€‚ + ๅฏฆ้ฉ—็‰ˆๅทฒ้—œ้–‰ + ๅฎƒๆ˜ฏ็‚บๅฆไธ€ๅ€‹ DroidDeck ็‰ˆๆœฌๅปบ็ฝฎ็š„๏ผŒ็พไฟ็•™ๅœจใ€Œๆ›ดๆ–ฐใ€ใ€‚ + DroidDeck ๅ…ฉๆฌก้ƒฝ็„กๆณ•ๅœจ่ฉฒ็‰ˆๆœฌๅ•Ÿๅ‹• + ไปฃ็† + ไปฃ็† + ไปฃ็†ๆญฃๅœจ้‹ไฝœ + ๅœจ Linux ็”จๆˆถ็ฉบ้–“ๅฎ‰่ฃ Claude Code๏ผŒๆ‰ๅฏไฝฟ็”จไปฃ็†ใ€‚ + ๅฏๅ•้Šๆˆฒใ€็•ถๆฉŸๅŽŸๅ› ๏ผŒๆˆ– DroidDeck ๆ”นๅ‹• + ๅ‚ณ้€ + ๆ–ฐๅฐ่ฉฑ + ๅœๆญข + ๅ„ฒๅญ˜็ฉบ้–“ + ็งป้™ค + ็ซ‹ๅณ็งป้™ค + Claude Code + Codex + DroidDeck ๅŽŸๅง‹็ขผ + ไธ‹่ผ‰ๅฟซๅ– + ๆœชๆŽจ้€็š„่ฎŠๆ›ดๆœƒ้บๅคฑ + ๅปบ็ฝฎๆ™‚ๆœƒ้‡ๆ–ฐไธ‹่ผ‰ + ่จญๅฎšๆต็จ‹ๅฏ้‡ๆ–ฐๅฎ‰่ฃ๏ผ›็™ปๅ…ฅ่ณ‡ๆ–™ๆœƒไฟ็•™ + DroidDeck ๅทฒๅœจไฝ ็š„ๅฏฆ้ฉ—็‰ˆ้‡ๆ–ฐๅ•Ÿๅ‹•๏ผŒๅฏๅพžไธŠๆฌกๅœไธ‹็š„ๅœฐๆ–น็นผ็บŒใ€‚ + ๅซๅฎƒ่งฃ้‡‹้Šๆˆฒ็‚บไฝ•็„กๆณ•ๅ•Ÿๅ‹•ใ€่งฃ่ฎ€่จ˜้Œ„ๆช”๏ผŒๆˆ–ไฟฎๆ”น DroidDeck ไธฆๅœจ้€™้ƒจ่ฃ็ฝฎ่ฉฆ็”จๆ”นๅ‹•ใ€‚ + ๅคฑๆ•—๏ผš%1$s + %1$s ๅทฒ็ตๆŸ๏ผˆ้€€ๅ‡บ็ขผ %2$d๏ผ‰ + ๅทฒๅœๆญข + ๅทฒ็ตๆŸ๏ผŒๆฒ’ๆœ‰ๅ›ž่ฆ† + ้‡่ฉฆ + ๆญฃๅœจ่จญๅฎšไปฃ็† + ๆŠŠๆˆ‘็š„ๅฏฆ้ฉ—็‰ˆ %1$s ๆŒ‰็›ฎๅ‰ๅฎ‰่ฃ็š„ DroidDeck ็‰ˆๆœฌ้‡ๆ–ฐๅปบ็ฝฎ๏ผŒไธฆไปฅๅฎƒ้‡ๆ–ฐๅ•Ÿๅ‹•ใ€‚ + ่ผธๅ…ฅ %1$s ยท ่ผธๅ‡บ %2$s + ๆ€่€ƒไธญ + ๆ€่€ƒ้Ž็จ‹ + ๆ€่€ƒไธญ ยท %1$s + %1$s ยท %2$s + ่ผธๅ…ฅ + ่ผธๅ‡บ + ๅŸท่กŒไธญโ€ฆ + ๆฒ’ๆœ‰็ตๆžœ๏ผšๅ›žๅˆๅทฒๅ…ˆ็ตๆŸ + ๆฒ’ๆœ‰่ผธๅ‡บ + ่ผธๅ…ฅๅณๅฏๆŽ’ๅ…ฅไธ‹ไธ€ๅ‰‡่จŠๆฏ + ๆŽ’ๅ…ฅ + ไธ‹ไธ€ๅ‰‡๏ผš%1$s + ไธ่ฆๅ‚ณ้€ + ้™„ๅŠ  + ็งป้™ค + ้ ่จญ + ๆŽจ็†ๅผทๅบฆ + ๅŸท่กŒ + ไฟฎๆ”น + ๅฐšๆœชๆœ‰ไปปไฝ•ๆ›ดๆ”น + ๆŒ‰่จˆๅŠƒๅŸท่กŒใ€‚ + ็ซ‹ๅณๅ‚ณ้€ + ๆ›ดๅคš + ้—œ้–‰ + ๆœ€ๆ–ฐ + ่™•็†ไธญ + ไธŠไธ‹ๆ–‡ + %1$s / %2$s + ๆœฌๅฐ่ฉฑ ยท %1$s + ้ฆ–ๆฌกๅ›ž่ฆ†ๅพŒๆ‰ๆœƒ้กฏ็คบ็”จ้‡ + %1$d ๅฐๆ™‚ไธŠ้™ + %1$d ๅˆ†้˜ไธŠ้™ + ๆฏ้€ฑไธŠ้™ + %1$d%% ยท %2$s ้‡่จญ + + %1$d ๅ€‹ๆช”ๆกˆ + %1$d ๅ€‹ๆช”ๆกˆ + + ๅ…ˆ่ฆๅŠƒ + ่ฆๅŠƒ + ๅชๆๅ‡บ่ฆๅŠƒ๏ผŒไธ่ฎŠๆ›ดไปปไฝ•ๅ…งๅฎน + ๅฐ่ฉฑ + ๅฐšๆœชๆœ‰ๅฐ่ฉฑ + ๅ‰›ๅ‰› + ๅˆช้™ค + ๅฐ‡ๅˆช้™คๅฐ่ฉฑๅŠๅ…ถ้™„ๅŠ ๆช”ๆกˆ + ่™•็†็จ‹ๅบ + Linux ไฝฟ็”จ่€…็ฉบ้–“ไธญๆฒ’ๆœ‰็จ‹ๅผๅœจๅŸท่กŒ + ไปฃ็†็จ‹ๅผ + ๅœๆญข + ๅฏฆ้ฉ—็‰ˆๅปบ็ฝฎ + ๆญฃๅœจๆบ–ๅ‚™ๅฏฆ้ฉ—็‰ˆๅปบ็ฝฎ + %1$d%% ยท ็ด„ๅ‰ฉ %2$s + ็ด„ๅ‰ฉ %1$s + ๅ–ๆถˆ + ๅ–ๆถˆๅปบ็ฝฎ + ๆญฃๅœจๅ•Ÿๅ‹• + %1$d%% + ๆญฃๅœจๅฐ่ฃ + ๆญฃๅœจไปฅๅฏฆ้ฉ—็‰ˆ้‡ๆ–ฐๅ•Ÿๅ‹• DroidDeck + ๅฎŒๆˆ + ๅคฑๆ•—๏ผš%1$s + ่จญๅฎšไปฃ็†็จ‹ๅผ + ่ซ‹ๅ…ˆๅœจ่จญๅฎšไธญๅฎ‰่ฃ Linux ๅŸท่กŒ็’ฐๅขƒใ€‚ + ้‡่ฉฆ + ้–‹ๅง‹ๅฐ่ฉฑ + ่ฃ็ฝฎ้€ฃ็ทš + ้€้Ž็„ก็ทšๅต้Œฏ๏ผŒ่ฎ“ไปฃ็†็จ‹ๅผ่ƒฝๆŸฅ็œ‹ๅŠๆ“ไฝœ DroidDeck + ๅฎ‰่ฃ %1$s + ๅฎ‰่ฃ่‡ณ Linux ไฝฟ็”จ่€…็ฉบ้–“๏ผŒๅŒ…ๅซ gitใ€gh ๅŠ adb + ็™ปๅ…ฅ %1$s + ๆœƒ้–‹ๅ•Ÿ็€่ฆฝๅ™จ + GitHub + ้ธๅกซ๏ผŒ็”จไพ†็™ผ่ตทๆ‹‰ๅ–่ซ‹ๆฑ‚ + ๅปบ็ฝฎๅทฅๅ…ท + ้ธๅกซ๏ผŒไพ›ๆญค่ฃ็ฝฎ้€ฒ่กŒ Lab ๅปบ็ฝฎ ยท ็ด„ 5 GB + ไปฃ็†็จ‹ๅผๅทฒๅฐฑ็ท’ + ๅฎŒๆˆไปฃ็†็จ‹ๅผ่จญๅฎš + ๅทฒ็™ปๅ…ฅ %1$s + Lab ๅปบ็ฝฎ + ๅฟซ้€Ÿๅปบ็ฝฎ + ๅฟซ้€Ÿ Lab ๅปบ็ฝฎ + ้ ๅ…ˆ็ทจ่ญฏๆญค็‰ˆๆœฌ๏ผŒไปค Lab ๅปบ็ฝฎๅช้œ€ๆ•ธๅˆ†้˜ ยท ไธ€ๆฌกๆ€ง็ด„ 20 ๅˆ†้˜ + ็ทจ่ญฏไธญ ยท %1$d%% ยท ็ด„ๅ‰ฉ %2$s + ๆบ–ๅ‚™ + ็„ก็ทšๅต้Œฏ็„กๆณ•้€ฃ็ทš๏ผ›ๆŒ‰ใ€Œ้…ๅฐใ€ๅณๅฏ้–‹ๅ•Ÿ + ้…ๅฐ + ๅฎ‰่ฃ + ็™ปๅ…ฅ PR #%1$d ๆฒ’ๆœ‰็‚บๆญค DroidDeck ็‰ˆๆœฌๅปบ็ฝฎ ๅทฒๆ›ดๆ–ฐ %1$s @@ -1241,6 +1465,9 @@ ๆ‡‰็”จ็จ‹ๅผ ่จญๅฎš ๆ›ดๆ–ฐ + ๆ›ดๅคš + ็ทจ่ผฏๅˆ†้  + ๅˆ†้  %1$d%% ็นผ็บŒ %1$s ๅœจๆฏๅ€‹ๆœƒ่ฉฑไธญ้กฏ็คบ็‚บ /root/ROMsใ€‚ๅ…ง้ƒจๅ„ฒๅญ˜็ฉบ้–“ไฝๆ–ผ /root/Storageใ€‚ @@ -1262,6 +1489,15 @@ ๅ–ๆถˆๆŽ’้šŠ Android ้ต็›ค ้šฑ่— โœ• + ็•ซ้ขไฝ”ๆฏ” + ้ต็›คไฝ”็”จ็š„็•ซ้ขๆฏ”ไพ‹๏ผŒๅŒ…ๆ‹ฌๆจ™้กŒๅˆ—ใ€‚ + ไธ้€ๆ˜Žๅบฆ + ่ชฟไฝŽๅณๅฏ็œ‹ๅˆฐ้ต็›คๅพŒๆ–น็š„้Šๆˆฒ็•ซ้ขใ€‚ + ้šฑ่—ๆŒ‰้ต + ๅฐ‘็”จ็š„ๆŒ‰้ตไธๆœƒ้กฏ็คบๅœจ้ต็›คไธŠใ€‚ + Esc ่ˆ‡ๅŠŸ่ƒฝ้ตๅˆ— + Ins / Del / Home / End / PgUp / PgDn + ๆ–นๅ‘้ต ๅ•Ÿๅ‹• %1$s ้ธๆ“‡่žขๅน•ใ€‚ๅ‰ฏ่žขๅน•๏ผš%1$sใ€‚ ๅ‰ฏ่žขๅน•ๅทฒ็„กๆณ•ไฝฟ็”จใ€‚ @@ -1746,7 +1982,24 @@ ็ต‚็ซฏๆฉŸ Deck ๆกๆŠŠ + ่งธๆŽงๆฟ ๅ„€่กจๆฟ + ๆกŒ้ข + ๅ•Ÿๅ‹•ๆกŒ้ข + ๆกŒ้ข ยท %1$s + ่งธๆŽงๆฟ + ็›ดๆŽฅ่งธๆŽง + ่งธๆŽงๆฟใ€‚่ผ•่งธๅˆ‡ๆ›่‡ณ็›ดๆŽฅ่งธๆŽง + ็›ดๆŽฅ่งธๆŽงใ€‚่ผ•่งธๅˆ‡ๆ›่‡ณ่งธๆŽงๆฟ + ๆญฃๅœจๅ•Ÿๅ‹• KDE ๆกŒ้ขโ€ฆ + ๆกŒ้ขๅทฒ็ตๆŸใ€‚ + ๆกŒ้ข็„กๆณ•ๅ•Ÿๅ‹•ใ€‚ๅ…ถ่จ˜้Œ„ๆช”ไฝๆ–ผๆญคๅทฅไฝœ้šŽๆฎต็š„ bottom-desktop ่ณ‡ๆ–™ๅคพใ€‚ + ๆกŒ้ขๅทฒ้—œ้–‰ใ€‚ ็›ฎๅ‰ๆฒ’ๆœ‰ๅฏ้กฏ็คบ็š„ๅ…งๅฎนใ€‚ + ไบคๆ›่žขๅน• + ไธ‹ๆ–น่žขๅน•็พๆญฃ่ขซไฝ”็”จ + ้Šๆˆฒ่žขๅน• + ๅฐ‡้Šๆˆฒ้กฏ็คบๆ–ผ + ไธŠๆ–น่žขๅน• + ไธ‹ๆ–น่žขๅน• ไธ‹่ผ‰ ๆฒ’ๆœ‰้€ฒ่กŒไธญ็š„ไธ‹่ผ‰ใ€‚ Steam @@ -1781,6 +2034,20 @@ ็‡ƒๆ–™๏ผŒt ไธปๆฒน็ฎฑ %1$s t ๅ‚™็”จ %1$s t + ๅน€ๆ™‚้–“ + ๆœ€่ฟ‘ %1$d ็ง’ + ๅนณๅ‡ๅน€ๆ™‚้–“ + 1% ไฝŽๅน€็އ + ่ถ…้Ž 33 ๆฏซ็ง’็š„ๅน€ + %1$d / ๅˆ†้˜ + ๅทฒ้Š็Žฉ %1$s + %1$d ๆ ธๅฟƒ๏ผŒๆœ€้ซ˜ๅฏ้” %2$s GHz + %1$d ๆ ธๅฟƒ + ้Šๆˆฒ + %1$d Hz ไธ‹็š„ FPS + ็ด…่‰ฒๆจ™่จ˜ๆ˜ฏ HUD ๅฐ‡ๆบซๅบฆ้กฏ็คบ็‚บ็ด…่‰ฒ็š„็•Œ็ทšใ€‚ + ๆ•ดๆฉŸ + ้›ปๆฑ  ๅ‚ณ้€ๅ„€่กจๆฟ่ณ‡ๆ–™ ่‡ชๅ‹• ็‚บ้€™่ฃกๅˆ—ๅ‡บ็š„ๆ‰€ๆœ‰้Šๆˆฒ้–‹ๅ•Ÿ๏ผŒๅŒ…ๆ‹ฌไน‹ๅพŒๆ‰พๅˆฐ็š„้Šๆˆฒใ€‚ไฝ ้—œ้–‰็š„้Šๆˆฒๆœƒ็ถญๆŒ้—œ้–‰ใ€‚ @@ -1804,6 +2071,10 @@ ๆญค้Šๆˆฒ็š„้บฅๅ…‹้ขจๅทฒ้—œ้–‰ใ€‚่‹ฅ่ฆ่ชช่ฉฑ๏ผŒ่ซ‹ๅœจ DroidDeck ็š„ Steam ่จญๅฎš๏ผˆ้Ÿณ่จŠ๏ผ‰ไธญ้–‹ๅ•Ÿ้บฅๅ…‹้ขจ๏ผŒ็„ถๅพŒ้‡ๆ–ฐๅ•Ÿๅ‹•้Šๆˆฒใ€‚ ้Ÿณ้‡ %1$d%% ้Šๆˆฒๅ…งๆ•ธๆ“š + ไธ‹ๆ–น่žขๅน• HUD + ๅœจๆ‰€ๆœ‰ๅˆ†้ ้กฏ็คบ่ณ‡่จŠๅˆ— + 1% ๅŠ 0.1% ไฝŽๅน€็އ + CPU ๆบซๅบฆ FPS CPU GPU @@ -1975,6 +2246,7 @@ ๆญฃๅœจๅ•Ÿๅ‹•ๆœƒ่ฉฑโ€ฆ ๅทฒ้Ž %1$d:%2$02d ยท ไปๅœจ่™•็† ๆญฃๅœจไธ‹่ผ‰ Steam ็”จๆˆถ็ซฏๆ›ดๆ–ฐ ยท %1$d%% + ๆญฃๅœจๅฅ—็”จ Steam ็”จๆˆถ็ซฏๆ›ดๆ–ฐโ€ฆ ๆญฃๅœจไธ‹่ผ‰ Steam ็”จๆˆถ็ซฏ ยท %1$s ๅทฒๆœ‰ๅ…ผๅฎนๆ€งๅทฅๅ…ทๆญฃๅœจๅฎ‰่ฃ @@ -2051,6 +2323,22 @@ ๅก้€šๆ้‚ŠๅŠ ไธŠ้ŠณๅŒ–ใ€‚ ไธๆ˜ฏ Adreno GPU + ็ณป็ตฑ PowerVR ้ฉ…ๅ‹•็จ‹ๅผ๏ผš็›ธๅฎนๆ€งๅ› ่ฃ็ฝฎ่€Œ็•ฐ + ๅฏฆ้ฉ—ๆ€ง๏ผšRADV ๆˆ–็ณป็ตฑ Xclipse ้ฉ…ๅ‹•็จ‹ๅผ + ็ณป็ตฑ PowerVR + ไฝฟ็”จๆญค GPU ็š„ๅ…งๅปบ้ฉ…ๅ‹•็จ‹ๅผ + ๅทฒ็‚บๅŸท่กŒ็’ฐๅขƒๅŠ้กฏ็คบ้ธ็”จ็ณป็ตฑ PowerVR ้ฉ…ๅ‹•็จ‹ๅผใ€‚ + ็›ฎๅ‰ไปๆœชๆœ‰้–‹ๆบ้ฉ…ๅ‹•็จ‹ๅผๆ”ฏๆด้€™ๆฌพ Mali๏ผšๅทฒๅ•Ÿ็”จ Mali ๆฉ‹ๆŽฅใ€‚ + ้€™ๆ˜ฏ้ž Snapdragon ๆธฌ่ฉฆ็‰ˆๆœฌ๏ผš้€™่ฃก็š„ๅฎ˜ๆ–น็‰ˆๆœฌๅช่ƒฝๅœจ Adreno ไธŠๅŸท่กŒ๏ผŒๅ› ๆญคไธๆœƒ่ฆ†่“‹ๅฎ‰่ฃๅˆฐๆญค็‰ˆๆœฌใ€‚ๆ–ฐๆธฌ่ฉฆ็‰ˆๆœฌๅฏๆ–ผ github.com/The412Banner/droiddeck-nonadreno-drivers ๅ–ๅพ—ใ€‚ + ไธŠๆฌกๅŸท่กŒ็ตๆŸๆ˜ฏๅ› ็‚บ Android ็‚บ้‡‹ๆ”พ่จ˜ๆ†ถ้ซ”้—œ้–‰ไบ† DroidDeck๏ผŒไธฆ้ž็•ถๆฉŸใ€‚่ซ‹้—œ้–‰ๅ…ถไป–ๆ‡‰็”จ็จ‹ๅผๆˆ–่ชฟไฝŽ้Šๆˆฒ็š„่ฒผๅœ–่จญๅฎš๏ผŒๅ†่ฉฆไธ€ๆฌกใ€‚ + Mali (Venus) + Mali ๆฉ‹ๆŽฅ + ็›ฎๅ‰ไปๆœชๆœ‰้–‹ๆบ้ฉ…ๅ‹•็จ‹ๅผๆ”ฏๆด้€™ๆฌพ Mali๏ผšๆœƒไฝฟ็”จ %1$s๏ผŒๆญ้…ๆ‰‹ๆฉŸๆœฌ่บซ็š„้ฉ…ๅ‹•็จ‹ๅผใ€‚ + %1$s ๅฐšๆœช็™ผๅธƒ๏ผšๅœจ็™ผๅธƒๅ‰ๆœƒไฝฟ็”จ %2$sใ€‚ + %1$s ็„กๆณ•ไฝฟ็”จ๏ผŒ่€Œไธ”้€™้ƒจๆ‰‹ๆฉŸ็š„้ฉ…ๅ‹•็จ‹ๅผ้กฏ็คบ Vulkan %2$s๏ผˆVenus ้œ€่ฆ 1.2๏ผ‰๏ผšๆœƒๆ”น็”จ Mali ๆฉ‹ๆŽฅใ€‚ + %1$s ๅฐšๆœช็™ผๅธƒ๏ผšๅœจ็™ผๅธƒๅ‰ๆœƒๅ•Ÿ็”จ Mali ๆฉ‹ๆŽฅใ€‚ + ๅทฒๆŽ’ๅ…ฅ้šŠๅˆ—๏ผš%1$s๏ผˆๆญฃ็ญ‰ๅพ…ๅฆไธ€ๅ€‹ๅŸท่กŒ็’ฐๅขƒ้ฉ…ๅ‹•็จ‹ๅผ๏ผ‰ + DXVK ็”ฑ็ณป็ตฑ PowerVR ๅŸท่กŒ็’ฐๅขƒๆไพ›ใ€‚ๅ…ถไป– DXVK ๅฅ—ไปถๅฏไปฅๅ„ฒๅญ˜๏ผŒไฝ†ๆญ้…ๆญค้ฉ…ๅ‹•็จ‹ๅผๆ™‚ไธๆœƒๅฅ—็”จใ€‚ ๅ—ๆ”ฏๆด ๅฏฆ้ฉ—ๆ€ง๏ผšๅ…ถ้ฉ…ๅ‹•็จ‹ๅผ็‚บๆธฌ่ฉฆ็‰ˆๆœฌ Adreno 850 ๅฏฆ้ฉ—ๆ€งๆ”ฏๆด๏ผš้œ€่ฆ็›ธๅฎน็š„ๅฏฆ้ฉ—็‰ˆ้กฏ็คบ้ฉ…ๅ‹•็จ‹ๅผๅŠ้Šๆˆฒ้ฉ…ๅ‹•็จ‹ๅผ๏ผ›ๅฐšๆœชๅœจๆญค่ฃ็ฝฎไธŠ้ฉ—่ญ‰ @@ -2164,7 +2452,6 @@ ๅ•†ๅบ— Steam ่‡ช่จ‚ - ๅ•†ๅบ— ไธ‹่ผ‰้€Ÿๅบฆ็ญ‰็ดš ๅนณ่กก ๅฟซ้€Ÿ @@ -2203,6 +2490,7 @@ ๆญฃๅœจ็ญ‰ๅพ…ๅฆไธ€ๅ€‹ Battle.net ไธ‹่ผ‰โ€ฆ ่ซ‹ๅ…ˆ้–‹ๅ•Ÿ Battle.net ไธฆ็™ปๅ…ฅไธ€ๆฌก๏ผŒ็„ถๅพŒๅœจ้€™่ฃกๅฎ‰่ฃๅ…ถ้Šๆˆฒใ€‚ ๆšด้›ชไธ‹่ผ‰ๅ™จๅทฒๅœๆญข๏ผš%1$s + ๆšด้›ชไธ‹่ผ‰ๅ™จๅทฒๅœๆญข้€ฒๅฑ•ใ€‚ ๆšด้›ช้Œฏ่ชค %1$s ๆ›ดๆ–ฐ Blizzard ้Šๆˆฒ @@ -2210,6 +2498,7 @@ ๅทฒไธญๆ–ท ๅฎ‰่ฃ ยท %1$s ๅ…่ฒป้ ˜ๅ– + ๆญฃๅœจๅŠ ๅ…ฅ้Šๆˆฒๅบซโ€ฆ ๅœจ %1$s ๆŸฅ็œ‹ ่ณผ่ฒท ยท %1$s ๅทฒๅฎ‰่ฃ @@ -2256,6 +2545,12 @@ ๆŽ’ๅบ ๅด้‚Šๆฌ„ๆจ™็ฑค ๅœจๅด้‚Šๆฌ„ๅœ–็คบไธ‹ๆ–น้กฏ็คบๅ็จฑใ€‚้—œ้–‰ๅฏ่ฎ“ๅด้‚Šๆฌ„ๆ›ด็ช„ใ€‚ + ไปฃ็†ๅฏต็‰ฉ + DeeDee ๆœƒๆตฎๅ‹•ๆ–ผไธป็•ซ้ขๅŠ้Šๆˆฒไน‹ไธŠ๏ผŒไธฆ้กฏ็คบไปฃ็†ๆญฃๅœจๅš็”š้บผใ€‚ + ๆตฎๅ‹•ๆ–ผๅ…ถไป–ๆ‡‰็”จ็จ‹ๅผไน‹ไธŠ + ่ฎ“ DeeDee ๆตฎๅ‹•ๆ–ผๆ‰€ๆœ‰ๆ‡‰็”จ็จ‹ๅผไน‹ไธŠ๏ผŒไธฆๅฏๅœจ่ฉฒ่™•้–‹ๅ•Ÿๅฐ่ฉฑ + ๅ…่จฑ + ่ˆ‡ DeeDee ๅฐ่ฉฑ ้กฏ็คบ ่ผƒๅคงๅก็‰‡ ่ผƒๅฐๅก็‰‡ @@ -2538,7 +2833,14 @@ %1$s ยท ็ญ‰ๅพ…้‡ๆ–ฐๅ•Ÿๅ‹• ๆญค่ฃ็ฝฎ ็งป้™ค %1$s๏ผŸ - ่จบๆ–ท + ้–‹็™ผไบบๅ“ก + ๅปบ็ฝฎๆจ™็ฑคๆตฎๆฐดๅฐ + ๅœจ็•ซ้ขไธŠ้กฏ็คบๆธฌ่ฉฆ็‰ˆๆˆ– Lab ๅปบ็ฝฎๆจ™็ฑคใ€‚้ ่จญๅ•Ÿ็”จใ€‚ + ๅˆ†ไบซ่จบๆ–ท่ณ‡ๆ–™ๅŒ… + ๅทฅไฝœ้šŽๆฎต่ˆ‡่ฃ็ฝฎ + ๅœ–ๅฝข + ้Šๆˆฒ่ˆ‡็›ธๅฎนๆ€ง + ๅ…จ้ƒจ่ณ‡ๆ–™ๅŒ… ๅฏไปฅ้–‹ๅง‹้Šๆˆฒ ๅฐšๆœชๅฏไปฅ้–‹ๅง‹้Šๆˆฒ ้‹่กŒ็’ฐๅขƒ %1$s @@ -2577,6 +2879,9 @@ ๅœจใ€Œๅ•†ๅบ—ใ€่จญๅฎšไธญ้–‹ๅ•Ÿ GOG ๆˆๅฐฑ ๆˆๅฐฑไธๅฏ็”จ๏ผ›่ซ‹ๆŸฅ็œ‹ๅทฅไฝœ้šŽๆฎตๆ—ฅ่ชŒ ๆˆๅฐฑๅทฒ่งฃ้Ž– + Mali (Venus)๏ผš้—œ้–‰ + Mali (Venus)๏ผš้–‹ๅ•Ÿ + %1$s ไธŠ็š„้ฉ…ๅ‹•็จ‹ๅผ้กฏ็คบ Vulkan %2$sใ€‚Mali (Venus) ้œ€่ฆ Vulkan 1.2 ๆˆ–ๆ›ดๆ–ฐ็‰ˆๆœฌ๏ผˆ่ผƒ่ˆŠ็‰ˆๆœฌ็„กๆณ•ๅ•Ÿๅ‹• gamescope๏ผ‰๏ผŒๅ› ๆญคๅŸท่กŒๆ™‚ๆœƒ็•ฅ้Ž Venus๏ผŒๆ”น็”จ PanVK ้ฉ…ๅ‹•็จ‹ๅผ็ต„ๅˆใ€‚ ่ฒผไธŠ ๅทฆๆ–ๆกฟ ๅณๆ–ๆกฟ @@ -2861,7 +3166,7 @@ ้ธๆ“‡่ณ‡ๆ–™ๅคพโ€ฆ ไฝฟ็”จ SD ๅกๆˆ– USB ๅ„ฒๅญ˜่ฃ็ฝฎไธŠ็š„ไปปไฝ•่ณ‡ๆ–™ๅคพ ้Šๆˆฒๆœƒๆ”พๅœจๆ‰€้ธไฝ็ฝฎๅ…ง็š„ Games ่ณ‡ๆ–™ๅคพไธญใ€‚็พๆœ‰้Šๆˆฒไธๆœƒ็งปๅ‹•ใ€‚ - ็ฉบ้–“ๅŽปๅ‘ + ไฝ”็”จ็ฉบ้–“็š„้ …็›ฎ Steam ้Šๆˆฒ ้Šๆˆฒ่ณ‡ๆ–™ ๅ‰็ถด %1$s ยท ๅทฅไฝœๅŠ %2$s ยท ่‘—่‰ฒๅ™จ %3$s @@ -2930,6 +3235,7 @@ ้Šๆˆฒ่ฆๆฑ‚็š„ VC++ ่ˆ‡ DirectX ๅฎ‰่ฃ็จ‹ๅผ ้‹่กŒ Linux x86 ้Šๆˆฒ Steam ๅทฅๅ…ท + ๅณไฝฟ้˜ฒไฝœๅผŠๅŠŸ่ƒฝ้—œ้–‰๏ผŒSteam ไปๆœƒ็‚บ้™„ๆœ‰้˜ฒไฝœๅผŠ็š„้Šๆˆฒไธ‹่ผ‰ๆญค้ …็›ฎใ€‚็งป้™คๅพŒ๏ผŒ้€™ไบ›้Šๆˆฒ็š„ๅฎ‰่ฃๆœƒๅกๅœจ 0% DroidDeck ไธ้œ€่ฆๆญค้‹่กŒ็’ฐๅขƒๅณๅฏ้‹่กŒ้Šๆˆฒ x86 Proton๏ผŒDroidDeck ็„กๆณ•้‹่กŒ ๆ‰€ๆœ‰้Šๆˆฒ็š„้ ่จญ้ …็›ฎ @@ -2993,6 +3299,19 @@ ไฟ็•™ ้ž Steam ้Šๆˆฒ่ˆ‡ Steam ็š„ๅ…ฑ็”จๅ‰็ถด ๅพžๅ•†ๅบ—ๆˆ–ๆ‰‹ๅ‹•ๆ–ฐๅขž็š„้Šๆˆฒ็š„ๅ‰็ถด + Steam ็š„ๅ…ฑ็”จๅ‰็ถด + Steam ๅœจๆญคๅŸท่กŒๅ…ถ่‡ชๅธถ็š„ Windows ่ผ”ๅŠฉ็จ‹ๅผ + ๅˆช้™ค่ฉฒๅ‰็ถด๏ผˆ%1$s๏ผ‰ใ€‚Steam ไธ‹ๆฌก้œ€่ฆๆ™‚ๆœƒๆ–ฐๅปบไธ€ๅ€‹ใ€‚ + ๅ•†ๅบ—ๆ‡‰็”จ็จ‹ๅผๅŠ้€้ŽๅฎƒๅŸท่กŒ็š„้Šๆˆฒ + ็”ฑ %1$s ไฝฟ็”จ + ้ž Steam ้Šๆˆฒ %1$s + ๆœช้…ๅฐๅˆฐไปปไฝ•้Šๆˆฒ๏ผŒๅ› ๆญคไฟ็•™ + ็งป้™คๆ‰€้ธ ยท %1$s + ่งฃ้™คๅฎ‰่ฃๆ‰€้ธ ยท %1$s + Wine ๅ‰็ถด + ๅ…ถไธญ็š„ๅญ˜ๆช”ๅ’Œ่จญๅฎš้ƒฝๆœƒ้บๅคฑ๏ผ›Steam Cloud ๅญ˜ๆช”ไปไฟ็•™ๅœจไฝ ็š„ๅธณๆˆถไธญใ€‚ + ่‘—่‰ฒๅ™จๅฟซๅ– + ๅ‰็ถด %1$s ยท ่‘—่‰ฒๅ™จ %2$s ๅทฒไธ‹่ผ‰็š„ๅฅ—ไปถ ๅทฒๅ„ฒๅญ˜็š„ๅŽŸๅง‹ๆช”ๆกˆ ๆฒ’ๆœ‰ๅทฒไธ‹่ผ‰็š„็ต„ไปถๅฅ—ไปถใ€‚ @@ -3027,6 +3346,8 @@ DroidDeck ยท %1$d fps 60 fps ่ผƒๆตๆšข๏ผŒไฝ† Steam ๅ•Ÿๅ‹•ๆ™‚ๆœƒไฝฟ็”จ่ผƒๅคš CPUใ€‚ๅœจ Steam ๆœฌ่บซ่จญๅฎšไธญ้ธๆ“‡็š„ๅ‹•็•ซไนŸๆœƒ้กฏ็คบๅœจ้€™่ฃกใ€‚ ่ฒ้Ÿณ + ่ทณ้Žๅ•Ÿๅ‹•ๅฝฑ็‰‡ + ไปฅ 0.1 ็ง’ๅ…จ้ป‘็‰‡ๆฎตไฝœ็‚บ Steam ็š„ๅ•Ÿๅ‹•ๅฝฑ็‰‡ใ€‚ไธ‹ๆฌกๅทฅไฝœ้šŽๆฎต็”Ÿๆ•ˆใ€‚ ่‡ช่จ‚ๅฝฑ็‰‡ MP4ใ€MOVใ€MKV ๆˆ– WebMใ€‚ๅ…ถไป–ๆ ผๅผๅŠ่ถ…้Ž %1$d MB ็š„ๆช”ๆกˆๆœƒๅœจ่ฃ็ฝฎไธŠ่ฝ‰ๆ›็‚บ 720p WebM๏ผŒๆœ€้•ท %2$d ็ง’ใ€‚ ๅŒฏๅ…ฅ @@ -3493,6 +3814,7 @@ ๆญค GPU ็š„ Vulkan ็‰ˆๆœฌๅฐ Proton ๅ…งๅปบ็š„ DXVK ไพ†่ชชๅคช่ˆŠๆ™‚๏ผŒๆ”น็”จ่ผƒ่ˆŠ็š„ DXVKใ€‚ ๆฏๅ€‹ Proton ้ƒฝไฝฟ็”จๅ…งๅปบ็š„ DXVK๏ผŒๅณไฝฟๆญค GPU ็š„ Vulkan ็‰ˆๆœฌๅฏ่ƒฝๅคช่ˆŠใ€‚ Mali ๆฉ‹ๆŽฅ๏ผš้—œ + %1$s ็„กๆณ•ไฝฟ็”จ Mali ๆฉ‹ๆŽฅ๏ผˆ้€™้ …ๅŠŸ่ƒฝ้œ€่ฆๆฒ’ๆœ‰็ณป็ตฑ้ฉ…ๅ‹•็จ‹ๅผ้€”ๅพ‘็š„ Mali GPU๏ผ‰๏ผŒๅ› ๆญค้€™ๅ€‹้–‹้—œๅœจๆญค็„กๆ•ˆใ€‚ Mali ๆฉ‹ๆŽฅ๏ผš้–‹ %1$s ไธๆ˜ฏ Adrenoใ€‚ๅฏฆ้ฉ—ๆ€ง Vulkan ๆฉ‹ๆŽฅๅทฒ้–‹ๅ•Ÿ๏ผšๅทฅไฝœ้šŽๆฎต้€้Žๆ‰‹ๆฉŸๅ…งๅปบ็š„้ฉ…ๅ‹•็จ‹ๅผ็นช่ฃฝใ€‚ๅฏ่ƒฝๆœƒๆœ‰ๅ•้กŒ๏ผŒ่ซ‹ๅ‚ณ้€ๅทฅไฝœ้šŽๆฎต่จ˜้Œ„ใ€‚ ๅฎ‰ๅ…จๆจกๅผ @@ -3513,6 +3835,25 @@ ๅ‘ๅพŒ็งป ๅฐๅทฅๅ…ท่จญๅฎš ็งป้™คๅฐๅทฅๅ…ท + ๅค–่ง€ + ๅœ–็คบๅŒ… + ็ณป็ตฑ้ ่จญ + ไฝฟ็”จๆ‡‰็”จ็จ‹ๅผ้ก่‰ฒไฝœ็‚บ่ƒŒๆ™ฏ + ๅœ–็คบๅคงๅฐ + ๅฐ + ไธญ + ๅคง + ้šฑ่—ๆ‡‰็”จ็จ‹ๅผๅ็จฑ + ้–“่ท + ็ทŠๅฏ† + ๆญฃๅธธ + ๅฏฌ้ฌ† + ๆ›ดๆ”นๅœ–็คบ + ้‡่จญๅœ–็คบ + ๆœๅฐ‹ๅœ–็คบ + ๆญฃๅœจ่ผ‰ๅ…ฅๅœ–็คบโ€ฆ + ๆ‰พไธๅˆฐๅœ–็คบใ€‚ + ่‡ช่จ‚ๅœ–็คบ ๅŠ ๅ…ฅ่ณ‡ๆ–™ๅคพ ๆ–ฐ่ณ‡ๆ–™ๅคพ ๅพž่ณ‡ๆ–™ๅคพ็งป้™ค @@ -3630,5 +3971,81 @@ ็„กๆณ•ๅŒฏๅ…ฅๆญคไฝˆๅฑ€ ็ท‹็ด…ไน‹้›ช + ็™ฝ่‰ฒ่กจ้ข้…็ด…่‰ฒ้ปž็ถดใ€‚ + ๅŽŸ่ฒๅธถ + ้Ÿณๆจ‚ + ๆ’ญๆ”พ้ธ้ … + ๆœ€ๆ„› + ๅˆ้›† + ๆšซๆ™‚ๆœชๆœ‰ๅˆ้›†ใ€‚้ปžๆŒ‰ๆ›ธ็ฑคๅœ–็คบๅณๅฏๅปบ็ซ‹ใ€‚ + ๅทฒๅ„ฒๅญ˜ + ๅปบ็ซ‹ๅˆ้›† + ๆ•ด็†ไฝ ็š„ๆ”ถ่— + ๆ–ฐๅขž + ๅปบ็ซ‹ + ๅˆ้›†ๅ็จฑ + ่ซ‹่ผธๅ…ฅๆœช่ขซๅ…ถไป–ๅˆ้›†ไฝฟ็”จ็š„ๅ็จฑ + ็ฎก็† + ้‡ๆ–ฐๅ‘ฝๅ + ๆ–ฐๅขžๆ›ฒ็›ฎ + ๆ–ฐๅขž๏ผˆ%1$d๏ผ‰ + ็งป้™คๆ›ฒ็›ฎ + ๅˆช้™คๅˆ้›† + ๅˆช้™ค %1$s๏ผŸ + ๆ›ฒ็›ฎไปๆœƒไฟ็•™ๅœจไฝ ็š„่ฃ็ฝฎไธŠ๏ผŒๅชๆœƒๅˆช้™คๅˆ้›†ใ€‚ + ้ธๅ– + ๅ…จ้ธ + ๅ–ๆถˆๅ…จ้ธ + ๅทฒ้ธๅ– %1$d ้ … + ๅŠ ๅ…ฅๅˆ้›† + ๅŠ ๅ…ฅๆœ€ๆ„› + ๅพžๅˆ้›†ไธญ็งป้™ค + ๆœๅฐ‹ๆ›ฒ็›ฎ + ๅฐˆ่ผฏ้ †ๅบ + ๆœ€้•ทๅ„ชๅ…ˆ + ๆœ€็Ÿญๅ„ชๅ…ˆ + ๆ›ฒ็›ฎ + ้Ÿณ่ชฟ + ้‡่จญ + ็•ฅ้Ž้œ้Ÿณ + ็ก็œ ่จˆๆ™‚ๅ™จ + %1$d ๅˆ†้˜ + ๆ›ฒ็›ฎ็ตๆŸ + ๅ‰ฉ้ค˜ %1$s + ็ญ‰ๅŒ–ๅ™จ + ้‡ไฝŽ้Ÿณๅขžๅผท + ๆญค่ฃ็ฝฎไธๆ”ฏๆด็ญ‰ๅŒ–ๅ™จ + ๅœจ้Šๆˆฒไธญๅ•Ÿ็”จ + ้Šๆˆฒ้‹่กŒๆ™‚็นผ็บŒๆ’ญๆ”พๅŽŸ่ฒๅธถ + ๅฐšๆœชๅฎ‰่ฃไปปไฝ•ๅŽŸ่ฒๅธถใ€‚ + ๆœๅฐ‹ๅŽŸ่ฒๅธถ + ๆ–ฐๅขžๅŽŸ่ฒๅธถ่ณ‡ๆ–™ๅคพ + ่ฉฒ่ณ‡ๆ–™ๅคพไธญๆฒ’ๆœ‰้Ÿณ่จŠๆช”ๆกˆ + ็ธฝ้•ทๅบฆ + %1$d ้ฆ–ๆ›ฒ็›ฎ / %2$s + ็ฌฌ %1$s ๅผต + ้šจๆฉŸๆ’ญๆ”พ + ไธŠไธ€้ฆ– + ๆ’ญๆ”พ + ๆšซๅœ + ไธ‹ไธ€้ฆ– + ้—œ้–‰้‡่ค‡ + ๅ…จ้ƒจ้‡่ค‡ + ๅ–ฎๆ›ฒ้‡่ค‡ + ้Ÿณ้‡ + ๆญคๅŽŸ่ฒๅธถไธญๆฒ’ๆœ‰้Ÿณ่จŠๆช”ๆกˆ + ็„กๆณ•ๅ•Ÿๅ‹• + ๆฒ’ๆœ‰ๅฏ็”จ็š„็ถฒ้ ็€่ฆฝๅ™จๅฏ้–‹ๅ•Ÿๆญค้€ฃ็ตใ€‚ + ๆŠ“ๅ– + ๆ”พไธ‹ + ๅ„ฒๅญ˜ + ้•ทๆŒ‰้‡่จญ + ๅ•†ๅบ— + ๅน€ๆ™‚้–“ + ๅนณๅ‡ๅน€็އ + ้กฏ็คบๆœๅ‹™ + HDR ็‹€ๆ…‹ + ๅทฒ้กฏ็คบ + %1$d / %2$d diff --git a/app/src/main/res/values-zh-rTW/input_library.xml b/app/src/main/res/values-zh-rTW/input_library.xml new file mode 100644 index 0000000000..20930002a7 --- /dev/null +++ b/app/src/main/res/values-zh-rTW/input_library.xml @@ -0,0 +1,132 @@ + + + ็„กๆณ•่ฎ€ๅ–็š„่ผธๅ…ฅ่จญๅฎšๅทฒๅ„ฒๅญ˜ๅœจ้‚„ๅŽŸๅ‰ฏๆœฌไธญใ€‚ไฝ ๅฏไปฅ็นผ็บŒ็ทจ่ผฏ้‚„ๅŽŸ็š„่จญๅฎšๆช”ใ€‚ + ๅฑฌๆ€ง + ้ปžๆ“Šๅฑฌๆ€ง + %1$s ยท ้ปžๆ“Š + ๆŒ‰้ต + ๆ–ๆกฟใ€่งธๆŽงๆฟ่ˆ‡ๆ‰ณๆฉŸ + ้šฑ่—ๅทฅๅ…ท + ๆŽงๅˆถๅ™จ + ๅฐ‡ๆŽงๅˆถๅ™จ่ผธๅ…ฅๅ‚ณ้€็ตฆ Steam Input ๆˆ–้Šๆˆฒใ€‚ + ๆญคๆŽงๅˆถ้ …ไธๆœƒๅ‚ณ้€ๆŽงๅˆถๅ™จใ€ๆป‘้ผ ๆˆ–้ต็›ค่ผธๅ…ฅใ€‚ + ๆป‘้ผ ้ปžๆ“Š + DroidDeck ๅ‹•ไฝœ + ๅ‹•ไฝœ + ๆฒๅ‹•้€Ÿๅบฆ๏ผš%1$d ๆญฅ/็ง’ + + ๆ–ฐๅขž่จญๅฎšๆช” + + ๆ–ฐๅขž็‰ˆ้ข + %1$s ยท ๆœ‰ %2$d ๅ€‹่จญๅฎšๆช”ไฝฟ็”จไธญใ€‚่ฎŠๆ›ดๆœƒๅฅ—็”จๅˆฐๆ‰€ๆœ‰ไฝฟ็”จ้€™ไบ›็ถๅฎš็š„่จญๅฎšๆช”ใ€‚ + ้‡ๆ–ฐๅ‘ฝๅ + ๅˆช้™ค + ๅ…ˆๅฐ‡ๆŽงๅˆถ้ …ๅŠ ๅ…ฅ็‰ˆ้ข๏ผŒๅ†ๆŒ‡ๆดพๅ‹•ไฝœใ€‚ + ็„กๆณ•ๅ„ฒๅญ˜่ผธๅ…ฅ่จญๅฎš + ๅ็จฑ + ่ตทๅง‹่‡ช + ๆŒ‰้ต + ๆ–ๆกฟ + ่งธๆŽงๆฟ + ๅๅญ—้ต + ๆ‰ณๆฉŸ + ๅฎŒๆˆ + ๅพฉๅŽŸ + + ๆ–ฐๅขž + ๆ‹–ๆ›ณๅฏ็งปๅ‹•๏ผŒๆ‹–ๆ›ณ่ง’่ฝๅฏ่ชฟๆ•ดๅคงๅฐ๏ผŒ้ปžไธ€ไธ‹ใ€Œๅฑฌๆ€งใ€ๅฏๆŒ‡ๆดพๅ‹•ไฝœใ€‚ + ๆญฃๅœจๅ‰ฏ่žขๅน•็ทจ่ผฏ + ๆ‰€้ธ้กฏ็คบๅ™จ็„กๆณ•ไฝฟ็”จใ€‚้€ฃๆŽฅๅพŒๆ‰่ƒฝไพๅฏฆ้š›ๅคงๅฐ็ทจ่ผฏๆญค็‰ˆ้ขใ€‚ + ๆจๆฃ„ๆœชๅ„ฒๅญ˜็š„็‰ˆ้ข่ฎŠๆ›ด๏ผŸ + ๆญค็‰ˆ้ขๆœ‰ %1$d ๅ€‹่จญๅฎšๆช”ไฝฟ็”จไธญใ€‚ๅ„ฒๅญ˜็š„่ฎŠๆ›ดๆœƒๅฅ—็”จๅˆฐๅ…จ้ƒจใ€‚ + ้ ่จญ่จญๅฎšๆช” + ๆกŒ้ขๆจกๅผ + ้Šๆˆฒๆจกๅผ + ๆกŒ้ข่ˆ‡้Šๆˆฒ็š„้ ่จญ + ้Šๆˆฒๆจกๅผ็š„้ ่จญ + ๆกŒ้ขๆจกๅผ็š„้ ่จญ + ่ฃ็ฝฎ่จญๅฎš + ๆŽงๅˆถ + ๆŒ‰้ตใ€ๆ–ๆกฟใ€ๆ‰ณๆฉŸ่ˆ‡้กๅค–ๆŒ‰้ต + ่ค‡่ฃฝ่จญๅฎšๆช” + ้‡่จญๅ‹•ไฝœ + ๅฐ‡ %1$s ็š„ๅ‹•ไฝœ้‡่จญ็‚บๅŸบ็คŽ่จญๅฎšๆช”็š„้ ่จญๅ€ผ๏ผŸ็‰ˆ้ข่ˆ‡ๅ…ถไป–่จญๅฎšๆช”ไธ่ฎŠใ€‚ + ๅˆช้™ค %1$s๏ผŸไฝฟ็”จๅฎƒ็š„ๆจกๅผๆœƒๅ›žๅˆฐๅ…งๅปบ้ ่จญ่จญๅฎšๆช”ใ€‚ๅทฒๅ„ฒๅญ˜็š„็‰ˆ้ข่ˆ‡ๅ…ฑ็”จ่จญๅฎšไปๅฏไฝฟ็”จใ€‚ + ้กฏ็คบ + ๅฐๆ‰€ๆœ‰่จญๅฎšๆช”็”Ÿๆ•ˆใ€‚้Šๆˆฒๆจกๅผไธ‹ๆœช้€ฃๆŽฅๆŽงๅˆถๅ™จๆ™‚๏ผŒAuto ๆœƒ้กฏ็คบไธป่žขๅน•ๆŽงๅˆถใ€‚ + ๅœจ่žขๅน•ไธŠ็ทจ่ผฏ + ๅทฒๅ„ฒๅญ˜็š„็‰ˆ้ขโ€ฆ + ้ธๆ“‡็‰ˆ้ขๆˆ–่‡ช่กŒๅปบ็ซ‹ + ๅœจๅ‰ฏ่žขๅน•ๅทฅไฝœ้šŽๆฎต้ธๅ–ฎไธญ้ธๆ“‡ใ€Œ่จญๅฎšๆช”ๆŽงๅˆถใ€ใ€‚ๆŽงๅˆถๅ™จ้ธๅ–ฎไธญ็š„่จญๅฎšๆช”่ˆ‡ๅ‰ฏ่žขๅน•้ธๆ“‡ๆฑบๅฎš้กฏ็คบๅ“ชไบ›ๆŽงๅˆถ้ …ใ€‚ + ๆŒ‰้ตๅ‹•ไฝœ + ่ˆ‡ %1$s ๅ…ฑ็”จใ€‚ไฟฎๆ”นไนŸๆœƒๅฅ—็”จๅˆฐ้€™ไบ›่จญๅฎšๆช”ใ€‚ + ้‡่ค‡ไฝฟ็”จ่จญๅฎš + ไฝฟ็”จ่จญๅฎšไพ†่‡ชโ€ฆ + ๅพžๅ…ถไป–่จญๅฎšๆช”่ค‡่ฃฝ๏ผŒๆˆ–ไฟๆŒ่จญๅฎšๅ…ฑ็”จ + ่จญ็‚บ็จ็ซ‹ + ไฟ็•™็›ฎๅ‰่จญๅฎšไธฆๅœๆญขๅ…ฑ็”จไฟฎๆ”น + ็‰ˆ้ขๅ„ฒๅญ˜ๆŽงๅˆถ้ …่ˆ‡ไฝ็ฝฎใ€‚ๆฏๅ€‹่จญๅฎšๆช”ๅฏๅ„่‡ชๆŒ‡ๅฎšๅ‹•ไฝœใ€‚่ซ‹ๅœจ็›ฎๆจ™่žขๅน•ไธŠไปฅๅฏฆ้š›ๅคงๅฐ็ทจ่ผฏใ€‚ + ็›ฎๅ‰็‰ˆ้ข + ๅˆช้™คๆœชไฝฟ็”จ็š„็‰ˆ้ข %1$s ๅŠๅ…ถๅ„ฒๅญ˜็š„ๅ‹•ไฝœ๏ผŸ + ้‡ๆ–ฐๅ‘ฝๅ็›ฎๅ‰็‰ˆ้ข + ๅพžๅฆไธ€ๅ€‹่จญๅฎšๆช”้‡่ค‡ไฝฟ็”จ %1$sใ€‚ๅ…ถไป–ๆŽงๅˆถไพ†ๆบไฟๆŒไธ่ฎŠใ€‚ + ไฟๆŒๅฏฆ้ซ”ๆŽงๅˆถๅ…ฑ็”จ + ้ ่จญๆƒ…ๆณไธ‹ๆ‰€ๆœ‰ๆŽงๅˆถ้ …่ˆ‡่‡ช่จ‚็‰ˆ้ข้ƒฝๆ˜ฏ็จ็ซ‹ๅ‰ฏๆœฌใ€‚ๅ…ฑ็”จๅช้€ฃ็ตๅฏฆ้ซ”ๆŽงๅˆถใ€‚ + ไฝฟ็”จ้€™ไบ›ๆŽงๅˆถ้ …่ˆ‡ไฝ็ฝฎใ€‚ๅ…ฑ็”จๆœƒ่ฎ“ไน‹ๅพŒ็š„ๅนพไฝ•ไฟฎๆ”นไฟๆŒๅŒๆญฅ๏ผŒๆŒ‰้ตๅ‹•ไฝœไปๅ„่‡ช็จ็ซ‹ใ€‚ๆ›็”จๅ…ถไป–็‰ˆ้ขๆ™‚ๅ‹•ไฝœๆ˜ฏๆœชๆŒ‡ๅฎš็š„ใ€‚ + ่ค‡่ฃฝ้€™ไบ›ๆŽงๅˆถ้ …่ˆ‡ๅ‹•ไฝœ๏ผŒๆˆ–้€ฃ็ตๅฎƒๅ€‘๏ผŒ่ฎ“ไน‹ๅพŒ็š„ไฟฎๆ”นๅŒๆ™‚ไฝœ็”จๆ–ผๅ…ฉๅ€‹่จญๅฎšๆช”ใ€‚ + ไฟๆŒๅ…ฑ็”จ + ็จ็ซ‹ๅ‰ฏๆœฌ + ๅพžๆŒ‰ไธ‹ไฝ็ฝฎ้–‹ๅง‹ + ไธไฝฟ็”จๆ™‚้šฑ่—ๆ–ๆกฟ + ๅทฅๅ…ท + ่‡ชๅ‹• (%1$s) + ่‡ช่จ‚ (%1$s) + ๅฆๅญ˜็‚บๆ–ฐ่จญๅฎšๆช” + ่จญๅฎšๆช”ๆŽงๅˆถ + ่จญๅฎšๆช” + ๆป‘้ผ ่งธๆŽงๆฟๆ‰‹ๅ‹ข + ็ถๅฎšๅˆฐๆป‘้ผ ๆŒ‡ๆจ™ๆ™‚๏ผš่ผ•้ปž้ปžๆ“Šใ€ๆŒ‰ไฝๆ‹–ๆ›ณใ€้›™ๆŒ‡ๆฒๅ‹•ใ€‚ + %1$s ๆœ‰ๅฟซ้€Ÿ้ธๅ–ฎ่ฆ†ๅฏซใ€‚ๅœจ้‚ฃ่ฃก้ธใ€Œ่‡ชๅ‹•ใ€ๆœƒไฝฟ็”จๅฎƒ็š„้ ่จญ่จญๅฎšๆช”่ˆ‡ๅ…จ้ƒจไธ‰ๅ€‹ๅทฒๅ„ฒๅญ˜้ƒจๅˆ†ใ€‚ + DroidDeck ่ผธๅ…ฅ + ๆ–ๆกฟๆœไปปๆ„ๆ–นๅ‘ๆŽจๅ‹•ๆœŸ้–“ไฟๆŒ๏ผš่ถ…้Ž 55% ๆ™‚ๆŒ‰ไธ‹๏ผŒไฝŽๆ–ผ 35% ๆ™‚ๆ”พ้–‹ใ€‚็”จใ€Œๆ–นๅ‘้ตใ€้€ๆ–นๅ‘ๆŒ‡ๅฎšใ€‚DroidDeck ๅ‹•ไฝœๆฏๆฌกๆŽจๅ‹•ๅชๅŸท่กŒไธ€ๆฌกใ€‚ๆ–ๆกฟ้ปžๆ“Šๅฆๅค–่จญๅฎšใ€‚ + ๆŒ‰ไฝ่งธๆŽงๆฟๆœŸ้–“ไฟๆŒ๏ผŒๆŠฌๆ‰‹ๆ™‚ๆ”พ้–‹ใ€‚DroidDeck ๅ‹•ไฝœๆฏๆฌก่งธ็ขฐๅŸท่กŒไธ€ๆฌกใ€‚่งธๆŽงๆฟ้ปžๆ“Šๅฆๅค–่จญๅฎšใ€‚ + ๆ‰ณๆฉŸ่ถ…้Ž 55% ๆ™‚ไฟๆŒ๏ผŒไฝŽๆ–ผ 35% ๆ™‚ๆ”พ้–‹ใ€‚DroidDeck ๅ‹•ไฝœๆฏๆฌกๆŒ‰ไธ‹ๅŸท่กŒไธ€ๆฌกใ€‚ + ๆฒๅ‹•ๆ–นๅ‘ + ๅž‚็›ด + ๆฐดๅนณ + ๆฐดๅนณๆฒๅ‹• + ๆธฌ้‡ + ้–‹ๅ•Ÿ่จ˜้Œ„๏ผŒๅœจๅŸท่กŒไธญ็š„ๅทฅไฝœ้šŽๆฎตไฝฟ็”จๆŽงๅˆถ้ …๏ผŒ็„ถๅพŒๅ›žไพ†่ฎ€ๅ–็ตๆžœใ€‚ๅชๆธฌ DroidDeck ็š„ๅ‚ณ้€ๆ™‚้–“๏ผŒไธๅซ้กฏ็คบๅปถ้ฒใ€‚App ็จ‹ๅบ้—œ้–‰ๆ™‚่จ˜้Œ„็ตๆŸใ€‚ + %1$d ๅ€‹ๆŽงๅˆถ้ … + ๅ…ถไป–ๅทฒๅ„ฒๅญ˜็š„็‰ˆ้ข (%1$d) โ–พ + ้šฑ่—ๅ…ถไป–ๅทฒๅ„ฒๅญ˜็š„็‰ˆ้ข (%1$d) โ–ด + ้ฆ–้  / Guide + ่ฟ”ๅ›ž ยท ๅ–ฎๆ“Š + ่ฟ”ๅ›ž ยท ้›™ๆ“Š + ่ฟ”ๅ›ž ยท Steam ่ฃกๅ…ฉไธ‹๏ผŒๆกŒ้ขไธŠไธ€ไธ‹ + Steam ๆจกๅผไธ‹ใ€‚ๆŒ‰ไฝ่ฟ”ๅ›žไนŸๆœƒ้–‹ๅ•Ÿๅฟซ้€Ÿ้ธๅ–ฎใ€‚ + ๆขๅพฉ้ ่จญ + ้ขๆฟ้ธๆ“‡ๆœƒ่ขซ่จ˜ไฝใ€‚ๆกŒ้ขๆœƒ้–‹ๅ•Ÿ็ฌฌไบŒๅ€‹ๅทฅไฝœๅ€๏ผŒไธๅˆ‡ๆ›ๅทฅไฝœ้šŽๆฎตๆˆ–ๅ…ถ่ผธๅ…ฅ่จญๅฎšๆช”ใ€‚ + ่™›ๆ“ฌๆŽงๅˆถๅ™จ + Steam ๆˆ–้Šๆˆฒ็œ‹ๅˆฐ็š„ๆŽงๅˆถๅ™จ้กžๅž‹ใ€‚ + ่งธๆŽง่žขๅน• + ้Šๆˆฒ็•ซ้ขไธŠ็š„่งธ็ขฐๅฆ‚ไฝ•่™•็†ใ€‚่จญๅฎšๆช”่ฃก็š„ๆŒ‰้ตไฟๆŒๅ„่‡ชๆŒ‡ๅฎš็š„ๅ‹•ไฝœใ€‚ + ่งธ็ขฐๆธธๆจ™ + ๅœจ้Šๆˆฒ็•ซ้ขไธŠ็›ดๆŽฅ่งธ็ขฐๆ™‚้กฏ็คบๆŒ‡ๆจ™ใ€‚ + ่งธ็ขฐไธฆๆŒ‰ไฝ + ๆ‰‹ๆŒ‡ๆŒ‰ไฝ้Šๆˆฒ็•ซ้ขๆ™‚็š„ๆป‘้ผ ๅ‹•ไฝœใ€‚ + ่ฟ”ๅ›ž้ต้ปžๆ“Š + ็ฌฌไธ€ๅ€‹ๅ‹•ไฝœ๏ผšๅ–ฎๆ“Šใ€‚็ฌฌไบŒๅ€‹ๅ‹•ไฝœ๏ผš้›™ๆ“Šใ€‚ + ้–‹้—œๆŒ‰้ต + ้ปžไธ€ไธ‹ๆŒ‰ไฝ๏ผŒๅ†้ปžไธ€ไธ‹ๆ”พ้–‹ใ€‚้–‹ๅ•Ÿ้ธๅ–ฎๆˆ–ๅˆ‡ๆ›่จญๅฎšๆช”ๆœƒๆ”พ้–‹ๆŒ‰้ตใ€‚ + ๅฝข็‹€ + ๅœ“่ง’ + ่† ๅ›Š + ๅœ“ๅฝข + ็Ÿฉๅฝข + ๆŒ‰้ตๆ–‡ๅญ— + ๆ–‡ๅญ— + ๅŒฏๅ…ฅ็š„ๅœ–็‰‡ + ็จ็ซ‹ๆ–œๅ‘้ต + ็ตฆๆฏๅ€‹ๆ–œๅ‘ๆŒ‡ๅฎšไธ€ๅ€‹้ตใ€‚็ฉบ็š„ๆ–œๅ‘ๆœƒๆŒ‰็›ธ้„ฐ็š„ๅ…ฉๅ€‹ๆ–นๅ‘ใ€‚ + ็›ธ้„ฐๆ–นๅ‘ + ่ˆŠ็š„่žขๅน•ๆŒ‰้ตๅทฒๅญ˜็‚บไธ‹ๆ–น็š„ๅŒฏๅ…ฅ่จญๅฎšๆช”ใ€‚้ธไธ€ๅ€‹ไฝฟ็”จๆˆ–็ทจ่ผฏใ€‚็›ฎๅ‰้ธๅ–็š„่จญๅฎšๆช”ไฟๆŒไธ่ฎŠใ€‚ + ็„กๆณ•่‡ชๅ‹•ๅŒฏๅ…ฅ่ˆŠ็š„่žขๅน•ๆŒ‰้ตใ€‚ๅŽŸ่จญๅฎšๅทฒไฟ็•™ใ€‚ + diff --git a/app/src/main/res/values-zh-rTW/input_strings.xml b/app/src/main/res/values-zh-rTW/input_strings.xml new file mode 100644 index 0000000000..713cc729e8 --- /dev/null +++ b/app/src/main/res/values-zh-rTW/input_strings.xml @@ -0,0 +1,38 @@ + + + ่ผธๅ…ฅ่จญๅฎšๆช” + ่จญๅฎšๆช” + ๅฏฆ้ซ”ๆŽงๅˆถๅ™จ + ไธป่žขๅน• + ๅ‰ฏ่žขๅน• + ๅŽŸ็”Ÿ / Steam Input + ๅŽŸ็”Ÿ๏ผš%1$s + ๅ‚ณ้€ๅฆไธ€ๅ€‹ๆŽงๅˆถๅ™จๆŒ‰้ต + ๅทฒๅœ็”จ + ๆŒ‰้ตๆˆ–็ต„ๅˆ้ต + ๆ–นๅ‘้ต + ็งปๅ‹•ๆŒ‡ๆจ™ + ๆŒ‡ๆจ™้€Ÿๅบฆ๏ผš%1$d + ๆฒๅ‹• + ๅž‚็›ดๆฒๅ‹• + ๆป‘้ผ ๅทฆ้ต + ๆป‘้ผ ๅณ้ต + ๆป‘้ผ ไธญ้ต + ้–‹ๅ•Ÿ DroidDeck ้ธๅ–ฎ + ้กฏ็คบ้ต็›ค + ้–‹ๅ•Ÿ Steam ้ธๅ–ฎ + ้–‹ๅ•Ÿ Steam ๅฟซ้€Ÿ้ธๅ–ฎ + ็งป้™คๆŽงๅˆถ้ … + ๆ–ฐๅขžๆŽงๅˆถ้ … + ๆญค่ฃ็ฝฎๅฐˆ็”จๆŒ‰้ต + ๆŒ‡ๅฎšๅฏฆ้ซ”ๆŒ‰้ต + ๆ”พ้–‹ๆŒ‰้ต๏ผŒ็„ถๅพŒ้ธๆ“‡็ทจ่ผฏใ€้‡่ฉฆๆˆ–ๅ–ๆถˆใ€‚ๆ”พ้–‹ๅพŒๆŒ‰ B ๆˆ–่ฟ”ๅ›žๅฏๅ–ๆถˆใ€‚ + ้‡่ฉฆ + ๆŒ‰ไธ‹ไปปๆ„ๆŒ‰้ต๏ผŒๅŒ…ๆ‹ฌ่ขซ่ญ˜ๅˆฅ็‚บ้ต็›คๆŒ‰้ต็š„่ฟ”ๅ›ž้ตใ€‚้Ÿณ้‡้ต่ˆ‡ Android ็ณป็ตฑ้ตๅทฒไฟ็•™ใ€‚ๆŒ‡ๅฎšๅƒ…้ฉ็”จๆ–ผๆญค่ฃ็ฝฎใ€‚ + ็งป้™คๆŒ‡ๅฎš + ่ผธๅ…ฅ่จบๆ–ท + ่จ˜้Œ„่ผธๅ…ฅๅ‚ณ้€ๆ™‚้–“ + ่ฎ€ๅ–ๆธฌ้‡็ตๆžœ + ๆธฌ้‡ๅพž Android ๆดพ้€ๅˆฐ็™ผไฝˆ่‡ณ็พๆœ‰่ผธๅ…ฅ้€š้“็š„ๆ™‚้–“ใ€‚ไธๅซ่—็‰™ๆŽฅๆ”ถใ€ๅฎข้ซ”่ผช่ฉขใ€็นช่ฃฝ่ˆ‡้กฏ็คบๅปถ้ฒใ€‚้ ่จญไธ่จ˜้Œ„ใ€‚ + ไฝฟ็”จไธ€่ˆฌ่ผธๅ…ฅ็ถๅฎš + diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 8b883d4a89..c080ab3d47 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -28,6 +28,8 @@ ็ซ‹ๅณๆšซๅœ ็ตๆŸๆญคๅทฅไฝœ้šŽๆฎต ๅฝฑๆ ผ็”Ÿๆˆ + ๆญค้Šๆˆฒ็š„่จญๅฎš + ้ ่จญ่จญๅฎš ่ซ‹้ธๆ“‡ไฝ ่ฆไฝฟ็”จ็š„ๅฝฑๆ ผ็”Ÿๆˆๆจกๅผ ้—œ้–‰ DD-FG %1$dร— @@ -183,6 +185,7 @@ ็„กๆณ•ไธ‹่ผ‰ PowerVR ๅœ–ๅฝข็’ฐๅขƒใ€‚่ซ‹ๆชขๆŸฅ็ถฒ่ทฏ้€ฃ็ทšๅพŒๅ†่ฉฆใ€‚ ็„กๆณ•ไธ‹่ผ‰ DirectAudio๏ผŒๅ› ๆญคๆœฌๆฌกๅทฅไฝœ้šŽๆฎต็š„้Šๆˆฒ้Ÿณ่จŠๆœƒไฝฟ็”จ่ผƒๆ…ข็š„่ทฏๅพ‘ใ€‚ ๆญค็จ‹ๅผ + ๅทฅไฝœ้šŽๆฎต็„กๆณ•ๅœจ่žขๅน•ไธŠ็นช่ฃฝ็•ซ้ข๏ผš%1$sใ€‚ๆญค็•ซ้ขๆœƒ้กฏ็คบๅŽŸๅ› ๏ผŒ่€Œไธๆ˜ฏ้ป‘็•ซ้ข๏ผ›่ฉณ็ดฐ่ณ‡่จŠ่ซ‹่ฆ‹ๅทฅไฝœ้šŽๆฎต่จ˜้Œ„ใ€‚ ็„กๆณ•ไธ‹่ผ‰ Steam ็”จๆˆถ็ซฏใ€‚ไฝ ็š„็ถฒ่ทฏๆˆ– VPN ๅฏ่ƒฝๅฐ้Ž–ไบ† Steam ็š„ไผบๆœๅ™จ๏ผ›่ซ‹ๆชขๆŸฅ้€ฃ็ทšๅพŒๅ†่ฉฆไธ€ๆฌกใ€‚ ็„กๆณ•่จญๅฎš Steam ็”จๆˆถ็ซฏใ€‚่ซ‹ๆชขๆŸฅ้€ฃ็ทšๅ’Œๅฏ็”จๅ„ฒๅญ˜็ฉบ้–“๏ผŒ็„ถๅพŒๅ†่ฉฆไธ€ๆฌกใ€‚ %1$s ๆ˜ฏ็‚บ x86 ้›ป่…ฆ็ต„ๅปบ็š„๏ผŒ้œ€้€้Ž FEX ๅŸท่กŒ๏ผŒไฝ† FEX ๅฐšๆœชๅฎ‰่ฃใ€‚่ซ‹ๅœจ็™ปๅ…ฅ็‹€ๆ…‹ไธ‹ๅ•Ÿๅ‹•ไธ€ๆฌก Steam๏ผŒ่ฎ“ๅฎƒไธ‹่ผ‰ FEX ๅ’Œ Steam Linux Runtime๏ผŒ็„ถๅพŒๅ†้‡ๆ–ฐๅ•Ÿๅ‹•ๆญค็จ‹ๅผใ€‚ @@ -384,6 +387,9 @@ ้€™่ฃกๅฐšไธๆ”ฏๆด ๆญฃๅœจ่ผ‰ๅ…ฅๅ…ƒไปถโ€ฆ ็„กๆณ•ๅฎ‰่ฃ๏ผš%1$s + ๆญคไธ‹่ผ‰้ …็›ฎ้œ€่ฆๆ›ดๆ–ฐใ€‚ + ๅทฒๆŽ’ๅฎšๆ›ดๆ–ฐใ€‚ + ้‡่ฉฆๆ›ดๆ–ฐ ๅทฒไธ‹่ผ‰ ๆญฃๅœจไธ‹่ผ‰ %1$s ๆญฃๅœจๅฎ‰่ฃ๏ผš%1$s @@ -414,6 +420,22 @@ ๅƒ…ๅ…ง้ƒจๅ„ฒๅญ˜็ฉบ้–“ ่ณ‡ๆ–™ๅคพ๏ผš%1$s ็ฌฌไบŒๆ”ถ่—ๅบซ + ๆ›ดๅคš Steam ๆ”ถ่—ๅบซ + Steam ๅฏๅฎ‰่ฃ้ŠๆˆฒไธฆๅพžไธญๅŸท่กŒ็š„่ณ‡ๆ–™ๅคพ๏ผŒๅ„่‡ชไปฅๅ็จฑๅ€ๅˆ†ใ€‚็งป้™คๅพŒ๏ผŒ่ฃก้ข็š„้Šๆˆฒไปๆœƒไฟ็•™ๅœจๅ„ฒๅญ˜็ฉบ้–“ไธญใ€‚ + ๆ–ฐๅขžๆ”ถ่—ๅบซ + ้‡ๆ–ฐๅ‘ฝๅ + ๆ”ถ่—ๅบซๅ็จฑ + ็‚บๆ”ถ่—ๅบซ้ธๆ“‡่ณ‡ๆ–™ๅคพ + ๆœ€ๅคšๅฏๆ–ฐๅขž %1$d ๅ€‹ๆ”ถ่—ๅบซ + ่ฉฒ่ณ‡ๆ–™ๅคพๅทฒๆ˜ฏๆ”ถ่—ๅบซ๏ผŒๆˆ–ไฝๆ–ผๆŸๅ€‹ๆ”ถ่—ๅบซๅ…ง + %1$s ยท ็„กๆณ•ไฝฟ็”จ + ่‡ชไธ‹ๆฌก Steam ๅทฅไฝœ้šŽๆฎต่ตท็”Ÿๆ•ˆ + ๅœจๆญค่ฃ็ฝฎๆ‰พๅˆฐ ยท %1$s ยท %2$s + ๆ–ฐๅขž + ๅฐ‹ๆ‰พๅ…ง้ƒจๅ„ฒๅญ˜็ฉบ้–“ไธญ็š„ๆ”ถ่—ๅบซ + ๅ…่จฑๅญ˜ๅ–ๆ‰€ๆœ‰ๆช”ๆกˆ๏ผŒ่ฎ“ DroidDeck ่ƒฝๆ‰พๅˆฐๅ…ถไป–ๆ‡‰็”จ็จ‹ๅผๅญ˜ๆ”พๅœจๅ…ง้ƒจๅ„ฒๅญ˜็ฉบ้–“็š„ Steam ๆ”ถ่—ๅบซ + ๅ…่จฑ + ๅทฒๆ–ฐๅขž %1$s๏ผŒๅณๆ‰€้ธ่ณ‡ๆ–™ๅคพๅ…ง็š„ Steam ๆ”ถ่—ๅบซ ๅพž SD ๅกๆˆ–ๅ…ฑ็”จๅ„ฒๅญ˜็ฉบ้–“่ฎ€ๅ–่ณ‡ๆบ็š„้Šๆˆฒๅฏ่ƒฝๆœƒๅก้ “ใ€‚ ๅ„ฒๅญ˜็ฉบ้–“่จบๆ–ท ๅœจใ€Œๅˆ†ไบซๆ—ฅ่ชŒใ€ไธญ่จ˜้Œ„็ฉบ้–“้…็ฝฎ็ตๆžœๅ’Œๅ–ๆจฃ็š„ๅ„ฒๅญ˜ๅญ˜ๅ–ๆ™‚้–“ใ€‚ๅ•Ÿ็”จๆœŸ้–“ๅฏ่ƒฝๆœƒๆธ›ๆ…ขๅฎ‰่ฃ้€Ÿๅบฆใ€‚ไธ‹ๆฌกๅทฅไฝœ้šŽๆฎต็”Ÿๆ•ˆใ€‚ @@ -476,6 +498,7 @@ ้–‹ ้šจ Steam ๅ•Ÿๅ‹• ไธ็ถ“ Steam ๅ•Ÿๅ‹• + ้Šๆˆฒ่งฃๆžๅบฆ ่จญๅฎš %1$s ่จญๅฎš ้ ่จญ @@ -563,6 +586,8 @@ ้Šๆˆฒๆ ธๅฟƒ ้Šๆˆฒๆ ธๅฟƒ ไพ›้Šๆˆฒไฝฟ็”จ็š„ๆ ธๅฟƒใ€‚ๅ…จ้ธๆ™‚็”ฑ Android ่‡ช็”ฑๆŽ’็จ‹ใ€‚ + ็ฉฉๅฎš็š„้Šๆˆฒ็œ้›ปๅŸท่กŒ + ้Šๆˆฒๅฝฑๆ ผ็އ็ฉฉๅฎšๆ™‚ๅœจ่ผƒๆ…ข็š„ๆ ธๅฟƒไธŠๅŸท่กŒ๏ผŒไธ€ๆ—ฆ่ทŸไธไธŠๅฐฑๅ›žๅˆฐๅŽŸๆœฌ็š„ๆ ธๅฟƒใ€‚ ็”จๆˆถ็ซฏไป‹้ข GL ๅคšๅŸท่กŒ็ท’ ๅฏ่ƒฝ่ฎ“ Steam ้ธๅ–ฎๅ›žๆ‡‰ๆ›ดๅฟซใ€‚ @@ -598,7 +623,10 @@ ๅœ็”จ Proton ็š„ๆ‰‹ๆŠŠๅฐŽ่ฆฝ่ผ”ๅŠฉ็จ‹ๅผ๏ผŒ่ฉฒ็จ‹ๅผๆœƒๅœจๆฏๅ€‹้Šๆˆฒไธญไฝ”็”จ CPUใ€‚ ๅœจไธไฝฟ็”จ seccomp ็š„ๆƒ…ๆณไธ‹ๅŸท่กŒ proot ๅฏ่ƒฝไฟฎๆญฃๆŸไบ›ๆ ธๅฟƒไธŠ็ผบๅฐ‘็ณป็ตฑๅ‘ผๅซ็š„้Œฏ่ชค๏ผŒไฝ†ๅฏ่ƒฝ้™ไฝŽๆ•ˆ่ƒฝใ€‚ + ไธไฝฟ็”จ proot ๅŸท่กŒ๏ผˆๅฏฆ้ฉ—ๆ€ง๏ผ‰ + ็›ดๆŽฅๅœจ Android ไธŠๅ•Ÿๅ‹• Linux ็ซฏใ€‚ๆ–ผไธ‹ๆฌกๅทฅไฝœ้šŽๆฎต็”Ÿๆ•ˆ๏ผ›่‹ฅๆœ‰้ …็›ฎ็„กๆณ•ๅ•Ÿๅ‹•๏ผŒ่ซ‹้—œ้–‰ๆญค้ธ้ …ใ€‚ proot ๅฟซ้€Ÿ่ทฏๅพ‘ + ไธไฝฟ็”จ proot ๆ™‚ไธ็”Ÿๆ•ˆใ€‚ ้œ€่ฆ proot ็š„ seccomp ็ฏฉ้ธๅ™จใ€‚ ๆช”ๆกˆๅฐ‹ๆ‰พๆ›ดๅฟซใ€ๅก้ “ๆ›ดๅฐ‘ใ€‚ๅฆ‚ๆžœ็จ‹ๅผๆ‰พไธๅˆฐๆช”ๆกˆ๏ผŒ่ซ‹้—œ้–‰ๆญค้ …ใ€‚ ๅœจ gamescope ๅ…ง็นช่ฃฝๆธธๆจ™ @@ -681,6 +709,7 @@ ้กฏ็คบ่จ˜ๆ†ถ้ซ” ไบคๆ›็ฉบ้–“ ้›ปๆฑ ้›ป้‡ + ๅ‰ฉ้ค˜้›ปๆฑ ็บŒ่ˆชๆ™‚้–“ ๅŠŸ่€— ็ถฒ่ทฏ ่งฃๆžๅบฆ @@ -835,15 +864,38 @@ ๅทฅไฝœ้šŽๆฎต ๅทฅไฝœ้šŽๆฎตๆ—ฅ่ชŒ ๆฏๆฌกๅทฅไฝœ้šŽๆฎต็ตๆŸๅพŒๅ„ฒๅญ˜ + ไธ‹ๆฌกๅทฅไฝœ้šŽๆฎต็š„้€ฒ้šŽ่จบๆ–ท + ๅชๆ”ถ้›†ไธ€ๅ€‹ๅทฅไฝœ้šŽๆฎต็š„่ฉณ็ดฐ่จ˜้Œ„ใ€‚ๅฏ่ƒฝ้™ไฝŽๆ•ˆ่ƒฝไธฆไฝฟ็”จ่ผƒๅคšๅ„ฒๅญ˜็ฉบ้–“๏ผ›ๅทฅไฝœ้šŽๆฎตๅ•Ÿๅ‹•ๆ™‚ๆœƒ่‡ชๅ‹•้—œ้–‰๏ผŒๅˆ†ไบซๅ‰่ซ‹ๅ…ˆๆชข่ฆ–่จ˜้Œ„ใ€‚ ้Šๆˆฒๅต้Œฏๆ—ฅ่ชŒ ๅœจไธ‹ๆฌกๅ•Ÿๅ‹•้Šๆˆฒๆ™‚ๅŠ ๅ…ฅ Protonใ€Wine ๅ’Œๅœ–ๅฝข่จบๆ–ท่ณ‡่จŠใ€‚ๅฏ่ƒฝ้™ไฝŽๆ•ˆ่ƒฝไธฆไฝ”็”จๆ›ดๅคšๅ„ฒๅญ˜็ฉบ้–“ใ€‚ ้‡ๆ–ฐๅ•Ÿๅ‹•ๆญคๅทฅไฝœ้šŽๆฎตไปฅๅ„ฒๅญ˜้Šๆˆฒๅต้Œฏๆ—ฅ่ชŒ ็„กๆณ•ๆ›ดๆ–ฐๆ—ฅ่ชŒ่จญๅฎšใ€‚่ซ‹ๆชขๆŸฅ้–‹้—œๅพŒๅ†่ฉฆไธ€ๆฌกใ€‚ ๅต้Œฏๅทฅๅ…ท + ่ฉณ็ดฐๅœ–ๅฝข่จ˜้Œ„ + Steam ไป‹้ข๏ผšGPU ็นช่ฃฝ + ไฝฟ็”จ Xclipse ้ฉ…ๅ‹•็จ‹ๅผ็ต„ๅˆๆ™‚๏ผŒSteam ๆœƒๆ”น็”จ่ปŸ้ซ”็นช่ฃฝ้ ้ข๏ผˆGPU ็นช่ฃฝๆ›พๅ‡บ็พๅœ–ๅกŠ็ ดๆ๏ผ‰ใ€‚่‹ฅ้€™ๆ”ฏๆ‰‹ๆฉŸไธŠ้กฏ็คบๆญฃๅธธ๏ผŒ้–‹ๅ•Ÿๆญค้ธ้ …ๅฏๅŠ ๅฟซ Steam ไป‹้ขใ€‚ + ๅปบ็ฝฎ %1$s + %1$s ๅทฒๆ›ดๆ–ฐ่‡ณๆœ€ๆ–ฐๅปบ็ฝฎ + Mali ๆฉ‹ๆŽฅไธŠๆฌกๅทฅไฝœ้šŽๆฎตๅœจ %1$s ไธŠ็š„่‡ชๆˆ‘ๆธฌ่ฉฆๆœช้€š้Ž๏ผˆๅฝฑๅƒๆˆ–็นช่ฃฝ๏ผ‰๏ผŒๅ› ๆญค่ฉฒๅทฅไฝœ้šŽๆฎตๆ”น็”จ PanVK ้ฉ…ๅ‹•็จ‹ๅผ็ต„ใ€‚ + Mali ๆฉ‹ๆŽฅไธŠๆฌกๅทฅไฝœ้šŽๆฎตๅœจ %1$s ไธŠๆ‰พไธๅˆฐ่ˆ‡้ฉ…ๅ‹•็จ‹ๅผๅ…ฑ็”จ่จ˜ๆ†ถ้ซ”็š„ๆ–นๆณ•๏ผŒๅ› ๆญค่ฉฒๅทฅไฝœ้šŽๆฎตๆ”น็”จ PanVK ้ฉ…ๅ‹•็จ‹ๅผ็ต„ใ€‚้€™ๆ”ฏๆ‰‹ๆฉŸ็„กๆณ•ไฝฟ็”จๆฉ‹ๆŽฅๅŠŸ่ƒฝ๏ผ›้—œ้–‰ๅฎƒๅพŒไปๆœƒไฝฟ็”จ PanVK ้ฉ…ๅ‹•็จ‹ๅผ็ต„ใ€‚ + ๅ„้Šๆˆฒ็š„ Protonใ€DXVK ่ˆ‡้ฉ…ๅ‹•็จ‹ๅผ่จ˜้Œ„ๆœƒ็ดๅ…ฅ่ฉฒๅทฅไฝœ้šŽๆฎต็š„่จ˜้Œ„ใ€‚GPU ไธๆ˜ฏ Adreno ๆ™‚ไธ€ๅพ‹้–‹ๅ•Ÿใ€‚ ๆœ€ๆ–ฐๅทฅไฝœ้šŽๆฎตๆ—ฅ่ชŒ ๅทฒๅ„ฒๅญ˜็š„ๅทฅไฝœ้šŽๆฎตๆ—ฅ่ชŒ ไฟ็•™ๆœ€ๆ–ฐ็š„ %1$d ๅ€‹ ๆธ…้™คๆ—ฅ่ชŒ + ๅฏ็”จ็š„ๅทฅไฝœ้šŽๆฎต่จ˜้Œ„ + ๅฐš็„กๅ„ฒๅญ˜็š„ๅทฅไฝœ้šŽๆฎต่จ˜้Œ„ใ€‚ + ๅˆ†ไบซ่ˆ‡ๅ„ฒๅญ˜็š„ ZIP ๆช”ๅŒ…ๅซๆ‰€้ธๅทฅไฝœ้šŽๆฎต๏ผŒไปฅๅŠ็›ธ้—œ็š„ Steamใ€ๅ•†ๅบ—ใ€ๅทฅๅ…ท่ˆ‡ Battle.net ่จบๆ–ท่ณ‡่จŠใ€‚ + %1$s ยท %2$s + ็›ฎๅ‰ๅทฅไฝœ้šŽๆฎต + ๅˆ†ไบซ + ๅ„ฒๅญ˜่‡ณ่ฃ็ฝฎ + ๅˆช้™ค + ๅˆช้™คๅทฅไฝœ้šŽๆฎต่จ˜้Œ„๏ผŸ + ๅˆช้™ค %1$s๏ผŸๆญคๅ‹•ไฝœ็„กๆณ•ๅพฉๅŽŸใ€‚ + ๅทฅไฝœ้šŽๆฎต่จ˜้Œ„ๅทฒๅ„ฒๅญ˜ใ€‚ + ็„กๆณ•ๅ„ฒๅญ˜ๅทฅไฝœ้šŽๆฎต่จ˜้Œ„ใ€‚ + ็„กๆณ•ๅˆช้™คๅทฅไฝœ้šŽๆฎต่จ˜้Œ„ใ€‚ ้‡่จญๆ‰€ๆœ‰่จญๅฎš ๅฐ‡ๆ‰€ๆœ‰่จญๅฎš้‚„ๅŽŸ็‚บ้ ่จญๅ€ผ ้‡่จญ @@ -870,6 +922,8 @@ ็”จไฝœไธป่žขๅน• DroidDeck ๅฏไปฅไฝœ็‚บไธป่žขๅน•ๆ‡‰็”จ็จ‹ๅผ DroidDeck ไธๆœƒไฝœ็‚บไธป่žขๅน•ๆ‡‰็”จ็จ‹ๅผๆไพ› + ๆŒ‰ไธป็•ซ้ข้ต้–‹ๅ•Ÿ + ็•ถ DroidDeck ็‚บไธป็•ซ้ขๆ‡‰็”จ็จ‹ๅผ๏ผŒไธ”ๆŒ‰ไธ‹ไธป็•ซ้ข้ตๆ™‚้กฏ็คบ็š„้ ้ข ่ซ‹ๅœจใ€Œๆ–ฐๅขž้Šๆˆฒใ€ไธญๅฐ‡ DroidDeck ่จญ็‚บใ€ŒๅŒ…ๅซใ€ ่žขๅน•ๆ–นๅ‘ ๅ•Ÿๅ‹•ๅ™จๆ–นๅ‘ @@ -883,15 +937,22 @@ ๅ…จ่žขๅน• ้šฑ่— Android ็‹€ๆ…‹ๅˆ—ๅ’ŒๅฐŽ่ฆฝๅˆ— ้กฏ็คบ Android ็‹€ๆ…‹ๅˆ—ๅ’ŒๅฐŽ่ฆฝๅˆ— + ้›™่žขๅน•ๅ•Ÿๅ‹•ๅ™จ + ่‡ชๅ‹•๏ผšๅœจๅ…งๅปบ็ฌฌไบŒ่žขๅน•็š„ๆŽŒๆฉŸไธŠ๏ผŒๅฐ‡ๅ•Ÿๅ‹•ๅ™จๅ€ๅกŠ๏ผˆSteamใ€ๆ”ถ่—ๅบซใ€ๅ•†ๅบ—็ญ‰๏ผ‰ๆ”พๅˆฐ็ฌฌไบŒ่žขๅน•ใ€‚้–‹ๅ•Ÿ๏ผšไฝฟ็”จไปปไธ€็ฌฌไบŒ่žขๅน•ใ€‚้—œ้–‰๏ผšๅ•Ÿๅ‹•ๅ™จ็ถญๆŒๅœจๅ–ฎไธ€่žขๅน•ใ€‚ + ้›™่žขๅน•ๅทฅไฝœ้šŽๆฎต + ่‡ชๅ‹•๏ผšๅฐ‡้Šๆˆฒๅ…ง้ธๅ–ฎๅ›บๅฎšๅœจๅ…งๅปบ็ฌฌไบŒ่žขๅน•๏ผŒ่€Œไธไปฅๅฝˆๅ‡บ่ฆ–็ช—้กฏ็คบใ€‚้–‹ๅ•Ÿ๏ผšไฝฟ็”จไปปไธ€็ฌฌไบŒ่žขๅน•ใ€‚้—œ้–‰๏ผš้ธๅ–ฎ็ถญๆŒๅœจ้Šๆˆฒ็•ซ้ข๏ผŒไปๅฏๅพžไธญๆŒ‘้ธ็ฌฌไบŒ่žขๅน•ใ€‚ ่‡ชๅ‹• ้–‹ๅ•Ÿ ้—œ้–‰ ้Šๆˆฒไธญ็š„ไธ‹่žขๅน•ๆŽงๅˆถ + ๆ–‡ๅญ—ๆฌ„ไฝไฝฟ็”จ Android ้ต็›ค ๅทฅไฝœ้šŽๆฎต้–‹ๅง‹ๆ™‚ๅœจ็ฌฌไบŒๅ€‹่žขๅน•ไธŠ้–‹ๅ•Ÿ่งธๆŽงๆฟๅ’Œ้ต็›คใ€‚ ๆญฃๅœจ็‚บไธŠ่žขๅน•่ผธๅ…ฅ ๅฎŒๆˆ ้ ่จญไธป่žขๅน•ๆ‡‰็”จ็จ‹ๅผ ้ธๆ“‡ไธป่žขๅน•ๆ‡‰็”จ็จ‹ๅผ + ้–’็ฝฎๆ™‚ๅœจใ€Œๆœ€่ฟ‘ไฝฟ็”จ็š„ๆ‡‰็”จ็จ‹ๅผใ€ไธญ้šฑ่—ๅ•Ÿๅ‹•ๅ™จ + ๅƒ…ๅœจ DroidDeck ็‚บ้ ่จญไธป็•ซ้ขๆ‡‰็”จ็จ‹ๅผ๏ผŒไธ”ๆฒ’ๆœ‰ๅŸท่กŒไธญ็š„ๅทฅไฝœ้šŽๆฎตๆ™‚็”Ÿๆ•ˆใ€‚ ้ธๆ“‡ Linux ๆ‡‰็”จ็จ‹ๅผ๏ผˆๆธฌ่ฉฆ็‰ˆ๏ผ‰ ๆช”ๆกˆ @@ -1003,9 +1064,172 @@ ้ ่ฆฝ็‰ˆ ๆฏ”็ฉฉๅฎš็‰ˆๆ›ดๆ—ฉๅ–ๅพ—็š„ๆœ€ๆ–ฐไฟฎๆญฃ ๅทฒๆ˜ฏๆœ€ๆ–ฐ + ่ค‡่ฃฝ็ต„ๅปบ่ณ‡่จŠ + ๅทฒ่ค‡่ฃฝ็ต„ๅปบ่ณ‡่จŠ + ๆฏ”้ ่ฆฝ็‰ˆๆ–ฐ + ไฝ ้ ˜ๅ…ˆ้ ่ฆฝ็‰ˆ + ๆญค็ต„ๅปบๆฏ”ๆœ€ๆ–ฐ็š„้ ่ฆฝ็‰ˆๆ›ดๆ–ฐใ€‚ไธ‹ไธ€ๅ€‹้ ่ฆฝ็‰ˆ็ต„ๅปบๆœƒๆ›ดๆ–ฐๅฎƒใ€‚ + ้ธๆ“‡ไธ€ๅ€‹็ต„ๅปบไปฅๆŸฅ็œ‹ๅ…ถ่ฎŠๆ›ดๆˆ–ๅฎ‰่ฃใ€‚ + ๅทฒๅฎ‰่ฃ + ๅฎ‰่ฃๆญค็ต„ๅปบ%1$s + ้€€ๅ›žๆญค็ต„ๅปบ%1$s + versionCode %1$d + ๆไบค %1$s + ็™ผ่กŒ้ ้ข + ๆญค PR ๆœ‰่ผƒๆ–ฐ็š„ๆไบค๏ผˆ%1$s๏ผ‰ใ€‚ๅฎƒ็š„ๆธฌ่ฉฆ็ต„ๅปบๅฐšๆœชๅฐฑ็ท’๏ผŒๅ› ๆญคๆญค็ต„ๅปบไธๅŒ…ๅซๅฎƒใ€‚ + ๅทฒๆŽจ้€ๆ–ฐๆไบค๏ผŒ็ต„ๅปบๅพ…็”ข็”Ÿ + PR ็ทจ่™Ÿใ€ๆจ™้กŒๆˆ–ไฝœ่€… + ๆฒ’ๆœ‰็›ธ็ฌฆ็š„ๆธฌ่ฉฆ็ต„ๅปบ + ้œ€่ฆ้‡ๆ–ฐ็ต„ๅปบ๏ผˆversionCode %1$d๏ผ‰ + ๆธฌ่ฉฆ็ต„ๅปบๆ›ดๆ–ฐ + PR #%1$d ๆœ‰ๆ–ฐ็š„ๆธฌ่ฉฆ็ต„ๅปบ + %1$sใ€‚้–‹ๅ•Ÿใ€Œๆ›ดๆ–ฐใ€้€ฒ่กŒๅฎ‰่ฃใ€‚ + ้กฏ็คบๆ›ดๅคš๏ผˆ%1$d๏ผ‰ + ้œ€่ฆ็‚บ versionCode %2$d ้‡ๆ–ฐ็ต„ๅปบ๏ผˆ%1$d๏ผ‰ + ๆญคๆธฌ่ฉฆ็ต„ๅปบไน‹ๅพŒ main ไธŠ็š„้ ่ฆฝ็‰ˆ็ต„ๅปบ๏ผš%1$d ๆธฌ่ฉฆ็ต„ๅปบ็‰ˆๆœฌ ๅœจๆญฃๅผ็™ผๅธƒๅ‰่ฉฆ็”จไฟฎๆญฃ ็›ฎๅ‰ๆฒ’ๆœ‰ + ๅฏฆ้ฉ—็‰ˆ + ๅฏฆ้ฉ—็‰ˆๆœฌ + ไฝฟ็”จไธญ + Android ้‡ๆ–ฐๆœ€ไฝณๅŒ– DroidDeck ๅพŒๅทฒๆšซๅœ + ๆœช่ผ‰ๅ…ฅ๏ผš%1$s + ็ญ‰ๅพ…้‡ๆ–ฐๅ•Ÿๅ‹• + ๅทฒไฟ็•™ + ้ฉ็”จๆ–ผๅ…ถไป–็‰ˆๆœฌ + ้‡ๆ–ฐๅปบ็ฝฎ + ๆœƒๅพž่ฃ็ฝฎๅˆช้™คๆญค็‰ˆๆœฌ + ไปฅๆญค็‰ˆๆœฌ้‡ๆ–ฐๅ•Ÿๅ‹• + ้—œ้–‰ + ไฝฟ็”จ + ๅˆช้™ค + ็ซ‹ๅณๅˆช้™ค + ็„กๆณ•ๆบ–ๅ‚™้‡ๆ–ฐๅ•Ÿๅ‹•๏ผš%1$sใ€‚่ซ‹ๅœจ่จญๅฎšไธญ้…ๅฐ็„ก็ทšๅต้Œฏ๏ผŒ็„ถๅพŒๅ†่ฉฆไธ€ๆฌกใ€‚ + ๅฏฆ้ฉ—็‰ˆๅทฒๅฎ‰่ฃ + DroidDeck ๅทฒไฝฟ็”จ %1$s ้‡ๆ–ฐๅ•Ÿๅ‹• + ๅฏฆ้ฉ—็‰ˆๅทฒๆšซๅœ + Android ้‡ๆ–ฐๆœ€ไฝณๅŒ–ไบ† DroidDeck๏ผŒๅ› ๆญคๆœช่ผ‰ๅ…ฅ %1$sใ€‚่ซ‹ๅˆฐใ€Œๆ›ดๆ–ฐใ€ๆ”น็”จๅฎƒ้‡ๆ–ฐๅ•Ÿๅ‹•ใ€‚ + Lab ็‰ˆๆœฌๅทฒ้—œ้–‰ + ๅฎƒๆ˜ฏ็‚บๅฆไธ€ๅ€‹ DroidDeck ็‰ˆๆœฌๅปบ็ฝฎ็š„๏ผŒ็›ฎๅ‰ไฟ็•™ๅœจใ€Œๆ›ดๆ–ฐใ€ไธญใ€‚ + DroidDeck ็”จๅฎƒๅ•Ÿๅ‹•ๅคฑๆ•—ๅ…ฉๆฌก + AI ไปฃ็† + AI ไปฃ็† + AI ไปฃ็†ๆญฃๅœจ่™•็† + ่ซ‹ๅœจ Linux ไฝฟ็”จ่€…็’ฐๅขƒๅฎ‰่ฃ Claude Code๏ผŒๆ‰่ƒฝไฝฟ็”จ AI ไปฃ็†ใ€‚ + ๅ•ๅ•้Šๆˆฒใ€้–ƒ้€€๏ผŒๆˆ–ๆƒณๆ”น DroidDeck ็š„ๅœฐๆ–น + ๅ‚ณ้€ + ๆ–ฐๅฐ่ฉฑ + ๅœๆญข + ๅ„ฒๅญ˜็ฉบ้–“ + ็งป้™ค + ็ซ‹ๅณ็งป้™ค + Claude Code + Codex + DroidDeck ๅŽŸๅง‹็ขผ + ไธ‹่ผ‰ๅฟซๅ– + ๆœชๆŽจ้€็š„่ฎŠๆ›ดๆœƒ้บๅคฑ + ๅปบ็ฝฎๆ™‚ๆœƒ้‡ๆ–ฐไธ‹่ผ‰ + ่จญๅฎšๆต็จ‹ๅฏ้‡ๆ–ฐๅฎ‰่ฃ๏ผŒ็™ปๅ…ฅ็‹€ๆ…‹ๆœƒไฟ็•™ + DroidDeck ๅทฒ็”จไฝ ็š„ Lab ็‰ˆๆœฌ้‡ๆ–ฐๅ•Ÿๅ‹•๏ผŒๅฏๅพžไธŠๆฌก้›ข้–‹็š„ๅœฐๆ–น็นผ็บŒใ€‚ + ๅ•ๅฎƒ้Šๆˆฒ็‚บไป€้บผๆ‰“ไธ้–‹ใ€่ซ‹ๅฎƒ่งฃ่ฎ€่จ˜้Œ„ๆช”๏ผŒๆˆ–ๆ”น DroidDeck ไธฆๅœจ้€™ๅฐ่ฃ็ฝฎไธŠ่ฉฆ็”จไฟฎๆ”น็ตๆžœใ€‚ + ๅคฑๆ•—๏ผš%1$s + %1$s ๅทฒ็ตๆŸ๏ผˆ็ตๆŸ็ขผ %2$d๏ผ‰ + ๅทฒๅœๆญข + ๅทฒ็ตๆŸ๏ผŒไฝ†ๆฒ’ๆœ‰ๅ›ž่ฆ† + ้‡่ฉฆ + ๆญฃๅœจ่จญๅฎš AI ไปฃ็† + ไพ็›ฎๅ‰ๅฎ‰่ฃ็š„ DroidDeck ็‰ˆๆœฌ้‡ๆ–ฐๅปบ็ฝฎๆˆ‘็š„ Lab ็‰ˆๆœฌ %1$s๏ผŒไธฆๆ”น็”จๅฎƒ้‡ๆ–ฐๅ•Ÿๅ‹•ใ€‚ + ่ผธๅ…ฅ %1$s ยท ่ผธๅ‡บ %2$s + ๆ€่€ƒไธญ + ๆ€่€ƒๅ…งๅฎน + ๆ€่€ƒไธญ ยท %1$s + %1$s ยท %2$s + ่ผธๅ…ฅ + ่ผธๅ‡บ + ๅŸท่กŒไธญโ€ฆ + ๆฒ’ๆœ‰็ตๆžœ๏ผš้€™ๅ›žๅˆๅ…ˆ็ตๆŸไบ† + ๆฒ’ๆœ‰่ผธๅ‡บ + ่ผธๅ…ฅไปฅๆŽ’ๅ…ฅไธ‹ไธ€ๅ‰‡่จŠๆฏ + ๆŽ’ๅ…ฅไฝ‡ๅˆ— + ไธ‹ไธ€ๅ‰‡๏ผš%1$s + ไธ่ฆๅ‚ณ้€ + ้™„ๅŠ  + ็งป้™ค + ้ ่จญ + ๆŽจ็†ๅผทๅบฆ + ๅŸท่กŒ + ไฟฎๆ”น + ๅฐšๆœช่ฎŠๆ›ด + ๆŒ‰่จˆ็•ซๅŸท่กŒใ€‚ + ็ซ‹ๅณๅ‚ณ้€ + ๆ›ดๅคš + ้—œ้–‰ + ๆœ€ๆ–ฐ + ่™•็†ไธญ + ไธŠไธ‹ๆ–‡ + ๅทฒ็”จ %1$s๏ผŒๅ…ฑ %2$s + ๆœฌๆฌกๅฐ่ฉฑ ยท %1$s + ้ฆ–ๆฌกๅ›ž่ฆ†ๅพŒๆ‰ๆœƒ้กฏ็คบไฝฟ็”จ้‡ + %1$d ๅฐๆ™‚ไธŠ้™ + %1$d ๅˆ†้˜ไธŠ้™ + ๆฏ้€ฑไธŠ้™ + %1$d%% ยท ๅฐ‡ๆ–ผ %2$s ้‡่จญ + + %1$d ๅ€‹ๆช”ๆกˆ + %1$d ๅ€‹ๆช”ๆกˆ + + ๅ…ˆ่ฆๅŠƒ + ่ฆๅŠƒ + ๅชๆๅ‡บ่จˆ็•ซ๏ผŒไธ่ฎŠๆ›ดไปปไฝ•ๅ…งๅฎน + ๅฐ่ฉฑ + ๅฐš็„กๅฐ่ฉฑ + ๅ‰›ๅ‰› + ๅˆช้™ค + ๅฐ‡ๅˆช้™ค่ฉฒๅฐ่ฉฑๅŠๅ…ถ้™„ไปถ + ่™•็†็จ‹ๅบ + Linux ไฝฟ็”จ่€…็ฉบ้–“ไธญๆฒ’ๆœ‰ๅŸท่กŒไธญ็š„่™•็†็จ‹ๅบ + ไปฃ็†็จ‹ๅผ + ๅœๆญข + ๅฏฆ้ฉ—ๅฎคๅปบ็ฝฎ + ๆญฃๅœจๆบ–ๅ‚™ๅฏฆ้ฉ—ๅฎคๅปบ็ฝฎ + %1$d%% ยท ็ด„ๅ‰ฉ %2$s + ็ด„ๅ‰ฉ %1$s + ๅ–ๆถˆ + ๅ–ๆถˆๅปบ็ฝฎ + ๆญฃๅœจๅ•Ÿๅ‹• + %1$d%% + ๆญฃๅœจๅฐ่ฃ + ๆญฃๅœจๆ–ผ่ฉฒๅปบ็ฝฎไธŠ้‡ๆ–ฐๅ•Ÿๅ‹• DroidDeck + ๅฎŒๆˆ + ๅคฑๆ•—๏ผš%1$s + ่จญๅฎšไปฃ็†็จ‹ๅผ + ่ซ‹ๅ…ˆๅœจใ€Œ่จญๅฎšใ€ไธญๅฎ‰่ฃ Linux ๅŸท่กŒ็’ฐๅขƒใ€‚ + ้‡่ฉฆ + ้–‹ๅง‹ๅฐ่ฉฑ + ่ฃ็ฝฎ้€ฃ็ทš + ็„ก็ทšๅต้Œฏ๏ผŒ่ฎ“ไปฃ็†็จ‹ๅผ่ƒฝๆŸฅ็œ‹ไธฆๆ“ๆŽง DroidDeck + ๅฎ‰่ฃ %1$s + ๅฎ‰่ฃ่‡ณ Linux ไฝฟ็”จ่€…็ฉบ้–“๏ผŒๅŒ…ๅซ gitใ€gh ่ˆ‡ adb + ็™ปๅ…ฅ %1$s + ้–‹ๅ•Ÿ็€่ฆฝๅ™จ + GitHub + ้ธๅกซ๏ผŒ็”จๆ–ผ้–‹ๅ•Ÿๆๅ–่ฆๆฑ‚ + ๅปบ็ฝฎๅทฅๅ…ท + ้ธๅกซ๏ผŒ็”จๆ–ผๅœจๆญค่ฃ็ฝฎไธŠ้€ฒ่กŒ Lab ๅปบ็ฝฎ ยท ็ด„ 5 GB + ไปฃ็†็จ‹ๅผๅทฒๅฐฑ็ท’ + ๅฎŒๆˆไปฃ็†็จ‹ๅผ่จญๅฎš + ๅทฒ็™ปๅ…ฅ %1$s + Lab ๅปบ็ฝฎ + ๅฟซ้€Ÿๅปบ็ฝฎ + ๅฟซ้€Ÿ Lab ๅปบ็ฝฎ + ้ ๅ…ˆ็ทจ่ญฏๆญค็‰ˆๆœฌ๏ผŒ่ฎ“ Lab ๅปบ็ฝฎๅช้œ€ๅนพๅˆ†้˜ ยท ๅƒ…้œ€ไธ€ๆฌก๏ผŒ็ด„ 20 ๅˆ†้˜ + ็ทจ่ญฏไธญ ยท %1$d%% ยท ็ด„ๅ‰ฉ %2$s + ๆบ–ๅ‚™ + ็„ก็ทšๅต้Œฏ็„กๆณ•้€ฃ็ทš๏ผ›้…ๅฐๅณๅฏ้–‹ๅ•Ÿ + ้…ๅฐ + ๅฎ‰่ฃ + ็™ปๅ…ฅ PR #%1$d ๆœช็‚บๆญค DroidDeck ่ค‡ๆœฌ็ต„ๅปบ ๅทฒๆ›ดๆ–ฐ %1$s @@ -1241,6 +1465,9 @@ ๆ‡‰็”จ็จ‹ๅผ ่จญๅฎš ๆ›ดๆ–ฐ + ๆ›ดๅคš + ็ทจ่ผฏ้ ็ฑค + ้ ็ฑค %1$d%% ็นผ็บŒ %1$s ๆฏๅ€‹ๅทฅไฝœ้šŽๆฎตไธญ้กฏ็คบ็‚บ /root/ROMsใ€‚ๅ…ง้ƒจๅ„ฒๅญ˜็ฉบ้–“ไฝๆ–ผ /root/Storageใ€‚ @@ -1262,6 +1489,15 @@ ๅ–ๆถˆๆŽ’้šŠ Android ้ต็›ค ้šฑ่— โœ• + ๅœจ่žขๅน•ไธŠ็š„ๅคงๅฐ + ้ต็›คไฝ”็”จ่žขๅน•็š„ๆฏ”ไพ‹๏ผŒๅŒ…ๅซๆจ™้กŒๅˆ—ใ€‚ + ไธ้€ๆ˜Žๅบฆ + ่ชฟไฝŽๅณๅฏ็œ‹่ฆ‹้ต็›คๅพŒๆ–น็š„้Šๆˆฒ็•ซ้ขใ€‚ + ้šฑ่—ๆŒ‰้ต + ๅฐ‘็”จ็š„ๆŒ‰้ตไธๆœƒ้กฏ็คบๅœจ้ต็›คไธŠใ€‚ + Esc ่ˆ‡ๅŠŸ่ƒฝ้ตๅˆ— + Ins / Del / Home / End / PgUp / PgDn + ๆ–นๅ‘้ต ๅ•Ÿๅ‹• %1$s ้ธๆ“‡่žขๅน•ใ€‚ๅ‰ฏ่žขๅน•๏ผš%1$sใ€‚ ๅ‰ฏ่žขๅน•ๅทฒ็„กๆณ•ไฝฟ็”จใ€‚ @@ -1746,7 +1982,24 @@ ็ต‚็ซฏๆฉŸ Deck ๆกๆŠŠ + ่งธๆŽงๆฟ ๅ„€่กจๆฟ + ๆกŒ้ข + ๅ•Ÿๅ‹•ๆกŒ้ข + ๆกŒ้ข ยท %1$s + ่งธๆŽงๆฟ + ็›ดๆŽฅ่งธๆŽง + ่งธๆŽงๆฟใ€‚่ผ•่งธๅˆ‡ๆ›็‚บ็›ดๆŽฅ่งธๆŽง + ็›ดๆŽฅ่งธๆŽงใ€‚่ผ•่งธๅˆ‡ๆ›็‚บ่งธๆŽงๆฟ + ๆญฃๅœจๅ•Ÿๅ‹• KDE ๆกŒ้ขโ€ฆ + ๆกŒ้ขๅทฒ้—œ้–‰ใ€‚ + ๆกŒ้ข็„กๆณ•ๅ•Ÿๅ‹•ใ€‚่จ˜้Œ„ๆช”ไฝๆ–ผๆญคๅทฅไฝœ้šŽๆฎต็š„ bottom-desktop ่ณ‡ๆ–™ๅคพใ€‚ + ๆกŒ้ขๅทฒ้—œ้–‰ใ€‚ ็›ฎๅ‰ๆฒ’ๆœ‰ๅฏ้กฏ็คบ็š„ๅ…งๅฎนใ€‚ + ไบคๆ›่žขๅน• + ไธ‹่žขๅน•็›ฎๅ‰ๅทฒ่ขซไฝ”็”จ + ้Šๆˆฒ่žขๅน• + ้Šๆˆฒ้กฏ็คบๆ–ผ + ไธŠ่žขๅน• + ไธ‹่žขๅน• ไธ‹่ผ‰ ๆฒ’ๆœ‰้€ฒ่กŒไธญ็š„ไธ‹่ผ‰ใ€‚ Steam @@ -1781,6 +2034,20 @@ ็‡ƒๆ–™๏ผŒt ไธปๆฒน็ฎฑ %1$s t ๅ‚™็”จ %1$s t + ๅน€ๆ™‚้–“ + ๆœ€่ฟ‘ %1$d ็ง’ + ๅนณๅ‡ๅน€ + 1% ไฝŽๅน€็އ + ่ถ…้Ž 33 ms ็š„ๅน€ๆ•ธ + %1$d / ๅˆ†้˜ + ๅทฒ้Š็Žฉ %1$s + %1$d ๆ ธๅฟƒ๏ผŒๆœ€้ซ˜ %2$s GHz + %1$d ๆ ธๅฟƒ + ้Šๆˆฒ + %1$d Hz ็š„ FPS + ็ด…่‰ฒๆจ™่จ˜ๆ˜ฏ HUD ๅฐ‡ๆบซๅบฆ้กฏ็คบ็‚บ็ด…่‰ฒ็š„ไฝ็ฝฎใ€‚ + ๆ•ดๅฐ่ฃ็ฝฎ + ้›ปๆฑ  ๅ‚ณ้€ๅ„€่กจๆฟ่ณ‡ๆ–™ ่‡ชๅ‹• ็‚บ้€™่ฃกๅˆ—ๅ‡บ็š„ๆ‰€ๆœ‰้Šๆˆฒ้–‹ๅ•Ÿ๏ผŒๅŒ…ๆ‹ฌไน‹ๅพŒๆ‰พๅˆฐ็š„้Šๆˆฒใ€‚ไฝ ้—œ้–‰็š„้Šๆˆฒๆœƒ็ถญๆŒ้—œ้–‰ใ€‚ @@ -1804,6 +2071,10 @@ ๆญค้Šๆˆฒ็š„้บฅๅ…‹้ขจๅทฒ้—œ้–‰ใ€‚่‹ฅ่ฆ่ชช่ฉฑ๏ผŒ่ซ‹ๅœจ DroidDeck ็š„ Steam ่จญๅฎš๏ผˆ้Ÿณ่จŠ๏ผ‰ไธญ้–‹ๅ•Ÿ้บฅๅ…‹้ขจ๏ผŒ็„ถๅพŒ้‡ๆ–ฐๅ•Ÿๅ‹•้Šๆˆฒใ€‚ ้Ÿณ้‡ %1$d%% ้Šๆˆฒๅ…งๆ•ธๆ“š + ไธ‹่žขๅน• HUD + ๅœจๆฏๅ€‹ๅˆ†้ ้กฏ็คบ่ณ‡่จŠๅˆ— + 1% ่ˆ‡ 0.1% ไฝŽๅน€็އ + CPU ๆบซๅบฆ FPS CPU GPU @@ -1975,6 +2246,7 @@ ๆญฃๅœจๅ•Ÿๅ‹•ๅทฅไฝœ้šŽๆฎตโ€ฆ ๅทฒ็ถ“้Ž %1$d:%2$02d ยท ไปๅœจ่™•็†ไธญ ๆญฃๅœจไธ‹่ผ‰ Steam ็”จๆˆถ็ซฏๆ›ดๆ–ฐ ยท %1$d%% + ๆญฃๅœจๅฅ—็”จ Steam ็”จๆˆถ็ซฏๆ›ดๆ–ฐโ€ฆ ๆญฃๅœจไธ‹่ผ‰ Steam ็”จๆˆถ็ซฏ ยท %1$s ๅทฒๆœ‰็›ธๅฎนๆ€งๅทฅๅ…ทๆญฃๅœจๅฎ‰่ฃ @@ -2051,6 +2323,22 @@ ๅก้€šๆ้‚ŠๅŠ ไธŠ้ŠณๅŒ–ใ€‚ ไธๆ˜ฏ Adreno GPU + ็ณป็ตฑ PowerVR ้ฉ…ๅ‹•็จ‹ๅผ๏ผš็›ธๅฎนๆ€งไพ่ฃ็ฝฎ่€Œ็•ฐ + ๅฏฆ้ฉ—ๆ€ง๏ผšRADV ๆˆ–็ณป็ตฑ Xclipse ้ฉ…ๅ‹•็จ‹ๅผ + ็ณป็ตฑ PowerVR + ไฝฟ็”จๆญค GPU ็š„ๅ…งๅปบ้ฉ…ๅ‹•็จ‹ๅผ + ๅทฒ็‚บๅŸท่กŒ้šŽๆฎต่ˆ‡้กฏ็คบ้ธ็”จ็ณป็ตฑ PowerVR ้ฉ…ๅ‹•็จ‹ๅผใ€‚ + ็›ฎๅ‰้‚„ๆฒ’ๆœ‰้–‹ๆบ้ฉ…ๅ‹•็จ‹ๅผๆ”ฏๆด้€™้ก† Mali๏ผšMali ๆฉ‹ๆŽฅๅทฒ้–‹ๅ•Ÿใ€‚ + ้€™ๆ˜ฏ้ž Snapdragon ๆธฌ่ฉฆ็‰ˆ๏ผš้€™่ฃก็š„ๅฎ˜ๆ–น็‰ˆๆœฌๅช่ƒฝๅœจ Adreno ไธŠๅŸท่กŒ๏ผŒๅ› ๆญคไธๆœƒ่ฆ†่“‹ๅฎ‰่ฃ้€™ๅ€‹็‰ˆๆœฌใ€‚ๆ–ฐ็‰ˆๆธฌ่ฉฆ็‰ˆ่ซ‹่‡ณ github.com/The412Banner/droiddeck-nonadreno-driversใ€‚ + ไธŠๆฌกๅทฅไฝœ้šŽๆฎตๆœƒ็ตๆŸ๏ผŒๆ˜ฏๅ› ็‚บ Android ็‚บไบ†้‡‹ๆ”พ่จ˜ๆ†ถ้ซ”้—œ้–‰ไบ† DroidDeck๏ผŒไธฆ้ž็•ถๆฉŸใ€‚่ซ‹้—œ้–‰ๅ…ถไป–ๆ‡‰็”จ็จ‹ๅผๆˆ–่ชฟไฝŽ้Šๆˆฒ็š„ๆ่ณช่จญๅฎš๏ผŒ็„ถๅพŒๅ†่ฉฆไธ€ๆฌกใ€‚ + Mali (Venus) + Mali ๆฉ‹ๆŽฅ + ็›ฎๅ‰้‚„ๆฒ’ๆœ‰้–‹ๆบ้ฉ…ๅ‹•็จ‹ๅผๆ”ฏๆด้€™้ก† Mali๏ผšๆœƒไฝฟ็”จ %1$s๏ผŒไธฆไปฅๆ‰‹ๆฉŸๆœฌ่บซ็š„้ฉ…ๅ‹•็จ‹ๅผ้‹ไฝœใ€‚ + %1$s ๅฐšๆœช็™ผๅธƒ๏ผš็™ผๅธƒๅ‰ๆœƒๅ…ˆไฝฟ็”จ %2$sใ€‚ + %1$s ็„กๆณ•ไฝฟ็”จ๏ผŒไธ”้€™ๆ”ฏๆ‰‹ๆฉŸ็š„้ฉ…ๅ‹•็จ‹ๅผๅ›žๅ ฑ Vulkan %2$s๏ผˆVenus ้œ€่ฆ 1.2๏ผ‰๏ผšๅ› ๆญคไฝฟ็”จ Mali ๆฉ‹ๆŽฅใ€‚ + %1$s ๅฐšๆœช็™ผๅธƒ๏ผš็™ผๅธƒๅ‰ Mali ๆฉ‹ๆŽฅๆœƒไฟๆŒ้–‹ๅ•Ÿใ€‚ + ๅทฒๆŽ’ๅ…ฅไฝ‡ๅˆ—๏ผš%1$s๏ผˆ็ญ‰ๅพ…ๅฆไธ€ๅ€‹ๅŸท่กŒ็’ฐๅขƒ้ฉ…ๅ‹•็จ‹ๅผ๏ผ‰ + DXVK ็”ฑ็ณป็ตฑ PowerVR ๅŸท่กŒ็’ฐๅขƒๆไพ›ใ€‚ๅ…ถไป– DXVK ๅฅ—ไปถไปๅฏๅญ˜ๆ”พ๏ผŒไฝ†ๆญ้…ๆญค้ฉ…ๅ‹•็จ‹ๅผๆ™‚ไธๆœƒๅฅ—็”จใ€‚ ๅ—ๆ”ฏๆด ๅฏฆ้ฉ—ๆ€ง๏ผšๅ…ถ้ฉ…ๅ‹•็จ‹ๅผ็‚บๆธฌ่ฉฆ็‰ˆๆœฌ Adreno 850 ๅฏฆ้ฉ—ๆ€งๆ”ฏๆด๏ผš้œ€่ฆ็›ธๅฎน็š„ๅฏฆ้ฉ—็‰ˆ้กฏ็คบ้ฉ…ๅ‹•็จ‹ๅผๅŠ้Šๆˆฒ้ฉ…ๅ‹•็จ‹ๅผ๏ผ›ๅฐšๆœชๅœจๆญค่ฃ็ฝฎไธŠ้ฉ—่ญ‰ @@ -2164,7 +2452,6 @@ ้Šๆˆฒๅ•†ๅบ— Steam ่‡ช่จ‚ - ้Šๆˆฒๅ•†ๅบ— ไธ‹่ผ‰้€Ÿๅบฆ็ญ‰็ดš ๅนณ่กก ๅฟซ้€Ÿ @@ -2203,6 +2490,7 @@ ๆญฃๅœจ็ญ‰ๅพ…ๅฆไธ€ๅ€‹ Battle.net ไธ‹่ผ‰โ€ฆ ่ซ‹ๅ…ˆ้–‹ๅ•Ÿ Battle.net ไธฆ็™ปๅ…ฅไธ€ๆฌก๏ผŒ็„ถๅพŒๅœจ้€™่ฃกๅฎ‰่ฃๅ…ถ้Šๆˆฒใ€‚ ๆšด้›ชไธ‹่ผ‰ๅ™จๅทฒๅœๆญข๏ผš%1$s + ๆšด้›ชไธ‹่ผ‰ๅ™จๅทฒๅœๆญข้€ฒๅบฆใ€‚ ๆšด้›ช้Œฏ่ชค %1$s ๆ›ดๆ–ฐ Blizzard ้Šๆˆฒ @@ -2210,6 +2498,7 @@ ๅทฒไธญๆ–ท ๅฎ‰่ฃ ยท %1$s ๅ…่ฒปๅ–ๅพ— + ๆญฃๅœจๅŠ ๅ…ฅๆ”ถ่—ๅบซโ€ฆ ๅœจ %1$s ๆชข่ฆ– ่ณผ่ฒท ยท %1$s ๅทฒๅฎ‰่ฃ @@ -2256,6 +2545,12 @@ ๆŽ’ๅบ ๅด้‚Šๆฌ„ๆจ™็ฑค ๅœจๅด้‚Šๆฌ„ๅœ–็คบไธ‹ๆ–น้กฏ็คบๅ็จฑใ€‚้—œ้–‰ๅฏ่ฎ“ๅด้‚Šๆฌ„ๆ›ด็ช„ใ€‚ + ๅŠฉ็†ๅฏต็‰ฉ + DeeDee ๆœƒๆตฎๅ‹•้กฏ็คบๅœจๅ•Ÿๅ‹•ๅ™จ่ˆ‡้ŠๆˆฒไธŠๆ–น๏ผŒไธฆ้กฏ็คบๅŠฉ็†็›ฎๅ‰ๆญฃๅœจๅš็š„ไบ‹ใ€‚ + ้กฏ็คบๅœจๅ…ถไป–ๆ‡‰็”จ็จ‹ๅผไธŠๅฑค + ่ฎ“ DeeDee ๆตฎๅ‹•้กฏ็คบๅœจๆ‰€ๆœ‰ๆ‡‰็”จ็จ‹ๅผไธŠๆ–น๏ผŒไธฆๅœจ่ฉฒ่™•้–‹ๅ•Ÿ่ˆ‡ DeeDee ็š„่Šๅคฉ่ฆ–็ช— + ๅ…่จฑ + ่ˆ‡ DeeDee ่Šๅคฉ ้กฏ็คบ ่ผƒๅคง็š„ๅก็‰‡ ่ผƒๅฐ็š„ๅก็‰‡ @@ -2538,7 +2833,14 @@ %1$s ยท ็ญ‰ๅพ…้‡ๆ–ฐๅ•Ÿๅ‹• ๆญค่ฃ็ฝฎ ่ฆ็งป้™ค %1$s ๅ—Ž๏ผŸ - ่จบๆ–ท + ้–‹็™ผไบบๅ“ก + ็ต„ๅปบๆจ™็ฑคๆตฎๆฐดๅฐ + ๅœจ็•ซ้ขไธŠ้กฏ็คบๆธฌ่ฉฆ็‰ˆๆˆ– Lab ็ต„ๅปบๆจ™็ฑคใ€‚้ ่จญๅ•Ÿ็”จใ€‚ + ๅˆ†ไบซ่จบๆ–ท่ณ‡ๆ–™ๅŒ… + ๅทฅไฝœ้šŽๆฎต่ˆ‡่ฃ็ฝฎ + ๅœ–ๅฝข + ้Šๆˆฒ่ˆ‡็›ธๅฎนๆ€ง + ๆ‰€ๆœ‰่ณ‡ๆ–™ๅŒ… ๅทฒๅฏ้–‹ๅง‹้Šๆˆฒ ๅฐšๆœชๆบ–ๅ‚™ๅฅฝ้–‹ๅง‹้Šๆˆฒ ๅŸท่กŒ็’ฐๅขƒ %1$s @@ -2577,6 +2879,9 @@ ๅœจใ€Œๅ•†ๅบ—ใ€่จญๅฎšไธญ้–‹ๅ•Ÿ GOG ๆˆๅฐฑ ๆˆๅฐฑ็„กๆณ•ไฝฟ็”จ๏ผ›่ซ‹ๆŸฅ็œ‹ๅทฅไฝœ้šŽๆฎต่จ˜้Œ„ ๆˆๅฐฑๅทฒ่งฃ้Ž– + Mali (Venus)๏ผš้—œ้–‰ + Mali (Venus)๏ผš้–‹ๅ•Ÿ + %1$s ไธŠ็š„้ฉ…ๅ‹•็จ‹ๅผๅ›žๅ ฑ Vulkan %2$sใ€‚Mali (Venus) ้œ€่ฆ Vulkan 1.2 ๆˆ–ๆ›ดๆ–ฐ็‰ˆๆœฌ๏ผˆ่ผƒ่ˆŠ็‰ˆๆœฌ็„กๆณ•ๅ•Ÿๅ‹• gamescope๏ผ‰๏ผŒๅ› ๆญคๅทฅไฝœ้šŽๆฎตๆœƒ็•ฅ้Ž Venus๏ผŒๆ”น็”จ PanVK ้ฉ…ๅ‹•็จ‹ๅผ็ต„ๅˆใ€‚ ่ฒผไธŠ ๅทฆๆ–ๆกฟ ๅณๆ–ๆกฟ @@ -2861,7 +3166,7 @@ ้ธๆ“‡่ณ‡ๆ–™ๅคพโ€ฆ ไฝฟ็”จ SD ๅกๆˆ– USB ้šจ่บซ็ขŸไธŠ็š„ไปปไฝ•่ณ‡ๆ–™ๅคพ ้Šๆˆฒๆœƒๆ”พๅœจๆ‰€้ธไฝ็ฝฎๅ…ง็š„ Games ่ณ‡ๆ–™ๅคพไธญใ€‚็พๆœ‰้Šๆˆฒไธๆœƒ็งปๅ‹•ใ€‚ - ็ฉบ้–“ๅŽปๅ‘ + ไฝ”็”จ็ฉบ้–“็š„้ …็›ฎ Steam ้Šๆˆฒ ้Šๆˆฒ่ณ‡ๆ–™ ๅ‰็ถด %1$s ยท ๅทฅไฝœๅŠ %2$s ยท ่‘—่‰ฒๅ™จ %3$s @@ -2930,6 +3235,7 @@ ้Šๆˆฒ่ฆๆฑ‚็š„ VC++ ่ˆ‡ DirectX ๅฎ‰่ฃ็จ‹ๅผ ๅŸท่กŒ Linux x86 ้Šๆˆฒ Steam ๅทฅๅ…ท + ๅณไฝฟๅไฝœๅผŠๅทฒ้—œ้–‰๏ผŒSteam ไปๆœƒ็‚บๅ…งๅปบๅไฝœๅผŠๆฉŸๅˆถ็š„้Šๆˆฒไธ‹่ผ‰ๆญค้ …็›ฎใ€‚็งป้™คๅพŒ๏ผŒ้€™ไบ›้Šๆˆฒ็š„ๅฎ‰่ฃๆœƒๅกๅœจ 0% DroidDeck ไธ้œ€่ฆๆญคๅŸท่กŒ็’ฐๅขƒๅณๅฏๅŸท่กŒ้Šๆˆฒ x86 Proton๏ผŒDroidDeck ็„กๆณ•ๅŸท่กŒ ๆ‰€ๆœ‰้Šๆˆฒ็š„้ ่จญ้ …็›ฎ @@ -2993,6 +3299,19 @@ ไฟ็•™ ้ž Steam ้Šๆˆฒ่ˆ‡ Steam ็š„ๅ…ฑ็”จๅ‰็ถด ๅพžๅ•†ๅบ—ๆˆ–ๆ‰‹ๅ‹•ๆ–ฐๅขž็š„้Šๆˆฒ็š„ๅ‰็ถด + Steam ็š„ๅ…ฑ็”จๅ‰็ถด + Steam ๅœจๆญคๅŸท่กŒๅ…ถ่‡ชๅธถ็š„ Windows ่ผ”ๅŠฉ็จ‹ๅผ + ๅˆช้™ค่ฉฒๅ‰็ถด๏ผˆ%1$s๏ผ‰ใ€‚Steam ไธ‹ๆฌก้œ€่ฆๆ™‚ๆœƒๆ–ฐๅปบไธ€ๅ€‹ใ€‚ + ๅ•†ๅบ—ๆ‡‰็”จ็จ‹ๅผๅŠ้€้ŽๅฎƒๅŸท่กŒ็š„้Šๆˆฒ + ็”ฑ %1$s ไฝฟ็”จ + ้ž Steam ้Šๆˆฒ %1$s + ๆœช้…ๅฐๅˆฐไปปไฝ•้Šๆˆฒ๏ผŒๅ› ๆญคไฟ็•™ + ็งป้™คๆ‰€้ธ ยท %1$s + ่งฃ้™คๅฎ‰่ฃๆ‰€้ธ ยท %1$s + Wine ๅ‰็ถด + ๅ…ถไธญ็š„ๅญ˜ๆช”ๅ’Œ่จญๅฎš้ƒฝๆœƒ้บๅคฑ๏ผ›Steam Cloud ๅญ˜ๆช”ไปไฟ็•™ๅœจไฝ ็š„ๅธณๆˆถไธญใ€‚ + ่‘—่‰ฒๅ™จๅฟซๅ– + ๅ‰็ถด %1$s ยท ่‘—่‰ฒๅ™จ %2$s ๅทฒไธ‹่ผ‰็š„ๅฅ—ไปถ ๅทฒๅ„ฒๅญ˜็š„ๅŽŸๅง‹ๆช”ๆกˆ ๆฒ’ๆœ‰ๅทฒไธ‹่ผ‰็š„ๅ…ƒไปถๅฅ—ไปถใ€‚ @@ -3027,6 +3346,8 @@ DroidDeck ยท %1$d fps 60 fps ่ผƒๆตๆšข๏ผŒไฝ† Steam ๅ•Ÿๅ‹•ๆ™‚ๆœƒไฝฟ็”จ่ผƒๅคš CPUใ€‚ๅœจ Steam ๆœฌ่บซ่จญๅฎšไธญ้ธๆ“‡็š„ๅ‹•็•ซไนŸๆœƒ้กฏ็คบๅœจ้€™่ฃกใ€‚ ่ฒ้Ÿณ + ่ทณ้Žๅ•Ÿๅ‹•ๅฝฑ็‰‡ + ไฝฟ็”จ 0.1 ็ง’็š„้ป‘่‰ฒๅฝฑ็‰‡็‰‡ๆฎตไฝœ็‚บ Steam ็š„ๅ•Ÿๅ‹•ๅฝฑ็‰‡ใ€‚ๅฐ‡ๆ–ผไธ‹ๆฌกๅทฅไฝœ้šŽๆฎต็”Ÿๆ•ˆใ€‚ ่‡ช่จ‚ๅฝฑ็‰‡ MP4ใ€MOVใ€MKV ๆˆ– WebMใ€‚ๅ…ถไป–ๆ ผๅผๅŠ่ถ…้Ž %1$d MB ็š„ๆช”ๆกˆๆœƒๅœจ่ฃ็ฝฎไธŠ่ฝ‰ๆ›็‚บ 720p WebM๏ผŒๆœ€้•ท %2$d ็ง’ใ€‚ ๅŒฏๅ…ฅ @@ -3493,6 +3814,7 @@ ๆญค GPU ็š„ Vulkan ็‰ˆๆœฌๅฐ Proton ๅ…งๅปบ็š„ DXVK ไพ†่ชชๅคช่ˆŠๆ™‚๏ผŒๆ”น็”จ่ผƒ่ˆŠ็š„ DXVKใ€‚ ๆฏๅ€‹ Proton ้ƒฝไฝฟ็”จๅ…งๅปบ็š„ DXVK๏ผŒๅณไฝฟๆญค GPU ็š„ Vulkan ็‰ˆๆœฌๅฏ่ƒฝๅคช่ˆŠใ€‚ Mali ๆฉ‹ๆŽฅ๏ผš้—œ + %1$s ็„กๆณ•ไฝฟ็”จ Mali ๆฉ‹ๆŽฅ๏ผˆๅฎƒ้œ€่ฆๆฒ’ๆœ‰็ณป็ตฑ้ฉ…ๅ‹•็จ‹ๅผ่ทฏ็”ฑ็š„ Mali GPU๏ผ‰๏ผŒๅ› ๆญค้€™ๅ€‹้–‹้—œๅœจ้€™่ฃกไธๆœƒ็”Ÿๆ•ˆใ€‚ Mali ๆฉ‹ๆŽฅ๏ผš้–‹ %1$s ไธๆ˜ฏ Adrenoใ€‚ๅฏฆ้ฉ—ๆ€ง Vulkan ๆฉ‹ๆŽฅๅทฒ้–‹ๅ•Ÿ๏ผšๅทฅไฝœ้šŽๆฎต้€้Žๆ‰‹ๆฉŸๅ…งๅปบ็š„้ฉ…ๅ‹•็จ‹ๅผ็นช่ฃฝใ€‚ๅฏ่ƒฝๆœƒๆœ‰ๅ•้กŒ๏ผŒ่ซ‹ๅ‚ณ้€ๅทฅไฝœ้šŽๆฎต่จ˜้Œ„ใ€‚ ๅฎ‰ๅ…จๆจกๅผ @@ -3513,6 +3835,25 @@ ๅพ€ๅพŒ็งป ๅฐๅทฅๅ…ท่จญๅฎš ็งป้™คๅฐๅทฅๅ…ท + ๅค–่ง€ + ๅœ–็คบๅฅ—ไปถ + ็ณป็ตฑ้ ่จญ + ไฝฟ็”จๆ‡‰็”จ็จ‹ๅผ้ก่‰ฒไฝœ็‚บ่ƒŒๆ™ฏ + ๅœ–็คบๅคงๅฐ + ๅฐ + ไธญ + ๅคง + ้šฑ่—ๆ‡‰็”จ็จ‹ๅผๅ็จฑ + ้–“่ท + ็ทŠๅฏ† + ๆญฃๅธธ + ๅฏฌ้ฌ† + ่ฎŠๆ›ดๅœ–็คบ + ้‡่จญๅœ–็คบ + ๆœๅฐ‹ๅœ–็คบ + ๆญฃๅœจ่ผ‰ๅ…ฅๅœ–็คบโ€ฆ + ๆ‰พไธๅˆฐๅœ–็คบใ€‚ + ่‡ช่จ‚ๅœ–็คบ ๆ–ฐๅขž่‡ณ่ณ‡ๆ–™ๅคพ ๆ–ฐ่ณ‡ๆ–™ๅคพ ๅพž่ณ‡ๆ–™ๅคพ็งป้™ค @@ -3630,5 +3971,81 @@ ็„กๆณ•ๅŒฏๅ…ฅๆญค็‰ˆ้ข้…็ฝฎ ็ท‹็ด…ไน‹้›ช + ็™ฝ่‰ฒ่กจ้ขๆญ้…็ด…่‰ฒ้ปž็ถดใ€‚ + ๅŽŸ่ฒๅธถ + ้Ÿณๆจ‚ + ๆ’ญๆ”พ้ธ้ … + ๆˆ‘็š„ๆœ€ๆ„› + ๅˆ้›† + ๅฐš็„กๅˆ้›†ใ€‚้ปž้ธๆ›ธ็ฑคๅœ–็คบๅณๅฏๅปบ็ซ‹ใ€‚ + ๅทฒๅ„ฒๅญ˜ + ๅปบ็ซ‹ๅˆ้›† + ๆ•ด็†ไฝ ็š„ๆ”ถ่— + ๆ–ฐๅขž + ๅปบ็ซ‹ + ๅˆ้›†ๅ็จฑ + ่ซ‹่ผธๅ…ฅๆœช่ขซๅ…ถไป–ๅˆ้›†ไฝฟ็”จ็š„ๅ็จฑ + ็ฎก็† + ้‡ๆ–ฐๅ‘ฝๅ + ๆ–ฐๅขžๆ›ฒ็›ฎ + ๆ–ฐๅขž๏ผˆ%1$d๏ผ‰ + ็งป้™คๆ›ฒ็›ฎ + ๅˆช้™คๅˆ้›† + ๅˆช้™ค %1$s๏ผŸ + ๆ›ฒ็›ฎไปๆœƒไฟ็•™ๅœจไฝ ็š„่ฃ็ฝฎไธŠ๏ผŒๅชๆœƒๅˆช้™คๅˆ้›†ใ€‚ + ้ธๅ– + ๅ…จ้ธ + ๅ–ๆถˆๅ…จ้ธ + ๅทฒ้ธๅ– %1$d ้ … + ๅŠ ๅ…ฅๅˆ้›† + ๅŠ ๅ…ฅๆˆ‘็š„ๆœ€ๆ„› + ๅพžๅˆ้›†ไธญ็งป้™ค + ๆœๅฐ‹ๆ›ฒ็›ฎ + ๅฐˆ่ผฏ้ †ๅบ + ๆœ€้•ทๅ„ชๅ…ˆ + ๆœ€็Ÿญๅ„ชๅ…ˆ + ๆ›ฒ็›ฎ + ้Ÿณ่ชฟ + ้‡่จญ + ็•ฅ้Ž้œ้Ÿณ + ็ก็œ ่จˆๆ™‚ๅ™จ + %1$d ๅˆ†้˜ + ๆ›ฒ็›ฎ็ตๆŸ + ๅ‰ฉ้ค˜ %1$s + ็ญ‰ๅŒ–ๅ™จ + ้‡ไฝŽ้Ÿณๅขžๅผท + ๆญค่ฃ็ฝฎไธๆ”ฏๆด็ญ‰ๅŒ–ๅ™จ + ๅœจ้Šๆˆฒไธญๅ•Ÿ็”จ + ้ŠๆˆฒๅŸท่กŒๆ™‚็นผ็บŒๆ’ญๆ”พๅŽŸ่ฒๅธถ + ๅฐšๆœชๅฎ‰่ฃไปปไฝ•ๅŽŸ่ฒๅธถใ€‚ + ๆœๅฐ‹ๅŽŸ่ฒๅธถ + ๆ–ฐๅขžๅŽŸ่ฒๅธถ่ณ‡ๆ–™ๅคพ + ่ฉฒ่ณ‡ๆ–™ๅคพไธญๆฒ’ๆœ‰้Ÿณ่จŠๆช”ๆกˆ + ็ธฝ้•ทๅบฆ + %1$d ้ฆ–ๆ›ฒ็›ฎ / %2$s + ็ฌฌ %1$s ๅผต + ้šจๆฉŸๆ’ญๆ”พ + ไธŠไธ€้ฆ– + ๆ’ญๆ”พ + ๆšซๅœ + ไธ‹ไธ€้ฆ– + ้—œ้–‰้‡่ค‡ + ๅ…จ้ƒจ้‡่ค‡ + ๅ–ฎๆ›ฒ้‡่ค‡ + ้Ÿณ้‡ + ๆญคๅŽŸ่ฒๅธถไธญๆฒ’ๆœ‰้Ÿณ่จŠๆช”ๆกˆ + ็„กๆณ•ๅ•Ÿๅ‹• + ๆฒ’ๆœ‰ๅฏ็”จ็š„็ถฒ้ ็€่ฆฝๅ™จๅฏ้–‹ๅ•Ÿๆญค้€ฃ็ตใ€‚ + ๆŠ“ๅ– + ๆ”พไธ‹ + ๅ„ฒๅญ˜ + ้•ทๆŒ‰้‡่จญ + ้Šๆˆฒๅ•†ๅบ— + ๅน€ๆ™‚้–“ + ๅนณๅ‡ๅน€็އ + ้กฏ็คบไผบๆœๅ™จ + HDR ็‹€ๆ…‹ + ๅทฒ้กฏ็คบ + %1$d / %2$d diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 6a7a221a0b..5cedd4524d 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -55,6 +55,8 @@ Suspend now Stop session Frame generation + Settings for this game + Default settings Select the frame generation mode Off DD-FG %1$dร— @@ -526,6 +528,7 @@ On Starts with Steam Starts without Steam + Game resolution Settings %1$s Settings Default @@ -613,6 +616,8 @@ Game cores Game cores Cores for games. With all selected, Android schedules freely. + Save power on steady games + Runs a game on the slower cores while it holds a steady frame rate, and back on its usual cores once it falls behind. Client interface Threaded GL May make Steam menus more responsive. @@ -648,7 +653,10 @@ Disables Proton\'s gamepad navigation helper, which costs CPU in every game. Run proot without seccomp May fix missing-syscall errors on some kernels. Can reduce performance. + Run without proot (experimental) + Starts the Linux side directly on Android. Applies to the next session. Turn off if something fails to start. proot fast path + Not used without proot. Needs proot\'s seccomp filter. Faster file lookups and less stutter. Turn off if a program can\'t find its files. Draw the cursor inside gamescope @@ -731,6 +739,7 @@ Graphics memory Swap Battery level + Battery life remaining Power draw Network Resolution @@ -916,6 +925,8 @@ Saved after each session Enhanced diagnostics for next session Captures detailed logs for one session. May reduce performance and use more storage. Turns itself off when the session starts; review logs before sharing. + Build label watermark + Show the test or Lab build label on screen. On by default. Share diagnostic bundles Session and device Graphics @@ -977,6 +988,8 @@ Use as Home screen DroidDeck can be the Home app DroidDeck is never offered as a Home app + Home button opens + The page shown when DroidDeck is the Home app and you press Home In Add Games, set DroidDeck to Include Orientation Launcher orientation @@ -1004,6 +1017,8 @@ Done Default Home app Choose a Home app + Hide launcher from Recents while idle + Only applies when DroidDeck is the default Home app and no session is running. Choose Linux apps (beta) Files @@ -1115,9 +1130,201 @@ Preview Newest fixes, before Stable Up to date + Copy build details + Build details copied + Ahead of Preview + You\'re ahead of Preview + This build is newer than the latest Preview. The next Preview build will update it. + Pick a build to see its changes or install it. + Installed + Install this build%1$s + Roll back to this build%1$s + versionCode %1$d + Commit %1$s + Release page + The PR has a newer commit (%1$s). Its test build isn\'t ready yet, so this one doesn\'t include it. + Newer commit pushed, build pending + PR number, title or author + No test build matches + Needs a rebuild (versionCode %1$d) + Test build updates + New PR #%1$d test build + Show more (%1$d) + Need a rebuild for versionCode %2$d (%1$d) + Preview builds on main since this test build: %1$d + %1$s. Open Updates to install it. Test builds Try a fix before it\'s released None right now + Lab build + Lab builds + In use + Paused after Android re-optimized DroidDeck + Not loaded: %1$s + Waiting for a restart + Kept + For another version + Rebuild + Deletes this build from the device + Restart on it + Turn off + Use + Delete + Delete now + Could not prepare the restart: %1$s. Pair wireless debugging in Setup and try again. + Lab build installed + DroidDeck restarted on %1$s + Lab build paused + Android re-optimized DroidDeck, so %1$s is not loaded. Open Updates to restart on it. + Lab build turned off + It was built for another version of DroidDeck. It is kept in Updates. + DroidDeck did not start on it twice + Agent + Agent + Agent is working + MCP servers and skills + MCP servers + Skills in ~/.claude/skills + Asking Claude Codeโ€ฆ + Claude Code could not do that + No MCP servers yet + No skills yet + Remove + Name + URL, or the command that starts it + Added for every project + Add + Dictate + Stop dictating + DroidDeck needs the microphone to dictate + Attach what the game shows + Could not capture the game + Agent replies + Agent finished + Agent stopped with an error + Agent has a question + + %d step + %d steps + + Copy + Copy the reply + Search conversations + No conversation mentions that + Install Claude Code in the Linux userland to use the agent. + Ask about a game, a crash, or a change to DroidDeck + Send + New conversation + Stop + Storage + Remove + Remove now + Claude Code + Codex + DroidDeck source + Download caches + Changes that are not pushed are lost + Builds download these again + Setup can install it again; sign-ins are kept + DroidDeck restarted on your Lab build. Continue where you left off. + Ask it why a game won\'t start, to explain a log, or to change DroidDeck and try the change on this device. + Failed: %1$s + %1$s ended (exit %2$d) + Stopped + Ended without a reply + Retry + Setting up the agent + Rebuild my Lab build %1$s for the installed version of DroidDeck and restart on it. + %1$s in ยท %2$s out + Thinking + Thought + Thinking ยท %1$s + %1$s ยท %2$s + INPUT + OUTPUT + Runningโ€ฆ + No result: the turn ended first + No output + Type to queue the next message + Queue + Next: %1$s + Don\'t send + Attach + Remove + Default + Reasoning effort + Go + Revise + Nothing changed yet + Go ahead with the plan. + Send now + More + Close + Latest + Working + Context + %1$s of %2$s + This conversation ยท %1$s + Usage shows after the first reply + %1$d-hour limit + %1$d-minute limit + Weekly limit + %1$d%% ยท resets %2$s + + %1$d file + %1$d files + + Plan first + Plan + Proposes a plan without changing anything + Conversations + No conversations yet + Just now + Delete + Deletes it and its attachments + Processes + Nothing is running in the Linux userland + AGENT + Stop + Lab build + Preparing Lab builds + %1$d%% ยท about %2$s left + about %1$s left + Cancel + Cancel build + Starting + %1$d%% + Packaging + Restarting DroidDeck on it + Done + Failed: %1$s + Set up the agent + Install the Linux runtime in Setup first. + Retry + Start chatting + Device connection + Wireless debugging, so the agent can see and drive DroidDeck + Install %1$s + Into the Linux userland, with git, gh and adb + Sign in to %1$s + Opens your browser + GitHub + Optional, to open pull requests + Build tools + Optional, for Lab builds on this device ยท about 5 GB + Agent ready + Finish setting up the agent + Signed in to %1$s + Lab builds + fast builds + Fast Lab builds + Compiles this version ahead, so Lab builds take minutes ยท about 20 minutes once + Compiling ยท %1$d%% ยท about %2$s left + Prepare + Wireless debugging isn\'t reachable; Pair turns it on + Pair + Install + Sign in PR #%1$d Not built for this copy of DroidDeck Updated %1$s @@ -1238,6 +1445,25 @@ Move later Widget settings Remove widget + Appearance + Icon pack + System default + App color background + Icon size + Small + Medium + Large + Hide app names + Spacing + Tight + Normal + Roomy + Change icon + Reset icon + Search icons + Loading iconsโ€ฆ + No icons found. + Custom icons Add to folder New folder Remove from folder @@ -1399,6 +1625,9 @@ Apps Setup Updates + More + Edit tabs + Tabs %1$d%% Resume %1$s Shows up as /root/ROMs in each session. Internal storage is at /root/Storage. @@ -2415,7 +2644,6 @@ Stores Steam Custom - Stores Download speed tier Balanced Fast @@ -2454,6 +2682,7 @@ Waiting for the other Battle.net downloadโ€ฆ Open Battle.net and sign in once, then install its games here. Blizzard\'s downloader stopped: %1$s + Blizzard\'s downloader stopped making progress. Blizzard error %1$s Update Blizzard games @@ -2461,6 +2690,7 @@ Interrupted Install ยท %1$s Get for free + Adding to libraryโ€ฆ View on %1$s Buy ยท %1$s Installed @@ -2518,6 +2748,12 @@ Sort Sidebar labels Show names under the sidebar icons. Turn off for a slimmer sidebar. + Agent pet + DeeDee floats over the launcher and games and shows what the agent is doing. + Over other apps + Let DeeDee float over every app and open its chat there + Allow + Chat with DeeDee Display Larger cards Smaller cards @@ -2813,7 +3049,7 @@ %1$s ยท restart pending This device Remove %1$s? - Diagnostics + Developer Smart glasses Display and head-tracking settings are shared across DroidDeck menus, games and desktop sessions. Connect smart glasses to change their display and tracking settings. Your saved settings are kept when you disconnect. @@ -3147,7 +3383,7 @@ Choose folderโ€ฆ Use any folder on an SD card or USB drive Games go into a Games folder inside the selected location. Existing games are not moved. - Where it goes + Whatโ€™s using space Steam games Game data Prefixes %1$s ยท workshop %2$s ยท shaders %3$s @@ -3216,6 +3452,7 @@ VC++ and DirectX installers games ask for Runs Linux x86 games Steam tool + Steam downloads this for games that ship anti-cheat, even when it is off. Removing it stalls their install at 0% DroidDeck runs games without this runtime x86 Proton, which DroidDeck cannot run Default for every game @@ -3279,6 +3516,19 @@ Kept Non-Steam games and Steamโ€™s shared prefix Prefixes of games added from stores or by hand + Steamโ€™s shared prefix + Steam runs its own Windows helpers here + Deletes it (%1$s). Steam makes a new one the next time it needs it. + A store app and the games that run with it + Used by %1$s + Non-Steam game %1$s + Not matched to a game, so it is kept + Remove selected ยท %1$s + Uninstall selected ยท %1$s + Wine prefixes + Saves and settings inside them are lost; Steam Cloud saves stay in your account. + Shader caches + Prefix %1$s ยท shaders %2$s Downloaded packages Saved originals No component packages downloaded. @@ -3333,6 +3583,8 @@ DroidDeck ยท %1$d fps 60 fps looks smoother but uses more CPU while Steam starts. A movie picked in Steam\'s own settings shows up here too. Sound + Skip boot movie + Use a 0.1-second black clip as Steamโ€™s startup movie. Applies next session. Your own movie MP4, MOV, MKV or WebM. Other formats and files over %1$d MB are converted to 720p WebM on the device, up to %2$d seconds. Import @@ -3819,4 +4071,79 @@ Scarlet Snow White surfaces with red accents. + Soundtracks + Music + Playback options + Favorites + Collections + No collections yet. Tap the bookmark icon to create one. + Saved + Create a collection + Organise your saves + New + Create + Collection name + Enter a name that no other collection uses + Manage + Rename + Add tracks + Add (%1$d) + Remove tracks + Delete collection + Delete %1$s? + The tracks stay on your device. Only the collection is removed. + Select + Select all + Deselect all + %1$d selected + Add to collection + Add to favorites + Remove from collection + Search tracks + Album order + Longest first + Shortest first + Tracks + Pitch + Reset + Skip silence + Sleep timer + %1$d min + End of track + %1$s left + Equalizer + Bass boost + The equalizer is not available on this device + Music while playing + Keep the soundtrack playing while a game runs + No soundtracks installed yet. + Search soundtracks + Add a soundtrack folder + No audio files found in that folder + Total length + %1$d Tracks / %2$s + Disc %1$s + Shuffle + Previous + Play + Pause + Next + Repeat off + Repeat all + Repeat one + Volume + No audio files found in this soundtrack + Launch unavailable + No web browser is available to open this link. + Grab + Drop + Save + Hold to reset + Stores + Frame time + Average frame rate + Display server + HDR state + Shown + %1$d of %2$d diff --git a/app/src/main/resources/ea/graphql/GameImages.gql b/app/src/main/resources/ea/graphql/GameImages.gql new file mode 100644 index 0000000000..92d8a50b87 --- /dev/null +++ b/app/src/main/resources/ea/graphql/GameImages.gql @@ -0,0 +1,69 @@ +query GameImages($gameSlug: String!, $locale: Locale!) { + game(slug: $gameSlug, locale: $locale) { + id + slug + title + keyArt { + ...imageRenditionData + __typename + } + packArt { + ...PackArt + __typename + } + ...PrimaryLogo + __typename + } +} + +fragment imageRenditionData on ImageRendition { + path + aspect9x16Image { + path + __typename + } + aspect16x9Image { + path + __typename + } + aspect1x1Image { + path + __typename + } + largestImage { + path + __typename + } + rawImages { + path + __typename + } + __typename +} + +fragment PrimaryLogo on GameV2 { + primaryLogo(uiClientContexts: ["juno-web-game-tile"]) { + path + title + largestImage { + path + width + height + __typename + } + __typename + } + __typename +} + +fragment PackArt on ImageRendition { + aspect2x1Image { + path + __typename + } + aspect9x16Image { + path + __typename + } + __typename +} diff --git a/app/src/main/resources/ea/graphql/GetGameProductOfferIds.gql b/app/src/main/resources/ea/graphql/GetGameProductOfferIds.gql new file mode 100644 index 0000000000..9c1c1dbd5c --- /dev/null +++ b/app/src/main/resources/ea/graphql/GetGameProductOfferIds.gql @@ -0,0 +1,15 @@ +query GetGameProductOfferIds($slug: String!, $locale: Locale!, $overrideCountryCode: String!) { + game(slug: $slug, locale: $locale) { + id + isFreeToPlay + slug + lowestPriceGameProduct(availabilities: [ACQUIRABLE], overrideCountryCode: $overrideCountryCode) { + id + isFree + name + originOfferId + __typename + } + __typename + } +} diff --git a/app/src/main/resources/ea/graphql/GetUserPlayer.gql b/app/src/main/resources/ea/graphql/GetUserPlayer.gql new file mode 100644 index 0000000000..4094c264ab --- /dev/null +++ b/app/src/main/resources/ea/graphql/GetUserPlayer.gql @@ -0,0 +1,49 @@ +query GetUserPlayer { + me { + id: pd + pd + player { + ...Player + __typename + } + __typename + } +} + +fragment Player on Player { + id: pd + pd + psd + displayName + uniqueName + nickname + avatar { + ...Avatar + __typename + } + relationship + __typename +} + +fragment Avatar on AvatarList { + large { + ...image + __typename + } + medium { + ...image + __typename + } + small { + ...image + __typename + } + __typename +} + +fragment image on Image { + height + width + path + __typename +} diff --git a/app/src/main/resources/ea/graphql/availableBuilds.gql b/app/src/main/resources/ea/graphql/availableBuilds.gql new file mode 100644 index 0000000000..b410f0a7f9 --- /dev/null +++ b/app/src/main/resources/ea/graphql/availableBuilds.gql @@ -0,0 +1,9 @@ +query availableBuilds($offerId: String!) { + availableBuilds(offerId: $offerId) { + buildId + downloadType + gameVersion + buildLiveDate + __typename + } +} diff --git a/app/src/main/resources/ea/graphql/downloadUrl.gql b/app/src/main/resources/ea/graphql/downloadUrl.gql new file mode 100644 index 0000000000..0110c64f93 --- /dev/null +++ b/app/src/main/resources/ea/graphql/downloadUrl.gql @@ -0,0 +1,7 @@ +query downloadUrl($offerId: String!, $buildId: String) { + downloadUrl(offerId: $offerId, buildId: $buildId) { + url + syncUrl + __typename + } +} diff --git a/app/src/main/resources/ea/graphql/getLegacyCatalogDefs.gql b/app/src/main/resources/ea/graphql/getLegacyCatalogDefs.gql new file mode 100644 index 0000000000..6d3da0d9f8 --- /dev/null +++ b/app/src/main/resources/ea/graphql/getLegacyCatalogDefs.gql @@ -0,0 +1,66 @@ +query getLegacyCatalogDefs($offerIds: [String!]!, $locale: Locale) { + legacyOffers(offerIds: $offerIds, locale: $locale) { + offerId: id + contentId + basePlatform + primaryMasterTitleId + mdmProjectNumber + achievementSetOverride + gameLauncherURL + gameLauncherURLClientID + stagingKeyPath + mdmTitleIds + multiplayerId + executePathOverride + installationDirectory + installCheckOverride + monitorPlay + displayName + displayType + igoBrowserDefaultUrl + executeParameters + softwareLocales + dipManifestRelativePath + metadataInstallLocation + distributionSubType + downloads { + igoApiEnabled + downloadType + version + executeElevated + buildReleaseVersion + buildLiveDate + buildMetaData + gameVersion + treatUpdatesAsMandatory + enableDifferentialUpdate + __typename + } + locale + greyMarketControls + isDownloadable + isPreviewDownload + downloadStartDate + releaseDate + useEndDate + subscriptionUnlockDate + subscriptionUseEndDate + softwarePlatform + softwareId + downloadPackageType + installerPath + processorArchitecture + macBundleID + gameEditionTypeFacetKeyRankDesc + appliedCountryCode + cloudSaveConfigurationOverride + firstParties{ + partner + partnerId + partnerIdType + __typename + } + suppressedOfferIds + __typename + } +} diff --git a/app/src/main/resources/ea/graphql/getLegacyEntitlements.gql b/app/src/main/resources/ea/graphql/getLegacyEntitlements.gql new file mode 100644 index 0000000000..d4a6de1012 --- /dev/null +++ b/app/src/main/resources/ea/graphql/getLegacyEntitlements.gql @@ -0,0 +1,33 @@ +query getLegacyEntitlements($limit: Int, $next: String, $storeFronts: [UserLegacyEntitlementStorefront!]!) { + me { + legacyEntitlements( + paging: {limit: $limit, next: $next}, + storefronts: $storeFronts, + status: [ACTIVE, DISABLED] + ) { + next + items { + cdKey + entitlementTag + entitlementType + externalType + grantDate + groupName + id + isSubscription + isSubscriptionExpired + lastModifiedDate + originPermissions + productId + status + statusReasonCode + terminationDate + trialTimeRemainingSeconds + useCount + version + __typename + } + __typename + } + } +} \ No newline at end of file diff --git a/app/src/main/resources/ea/graphql/getPreloadedOwnedGames.gql b/app/src/main/resources/ea/graphql/getPreloadedOwnedGames.gql new file mode 100644 index 0000000000..b3a5a488eb --- /dev/null +++ b/app/src/main/resources/ea/graphql/getPreloadedOwnedGames.gql @@ -0,0 +1,69 @@ +query getPreloadedOwnedGames($next: String, $locale: Locale, $limit: Int, $type: [GameProductType!]!, $entitlementEnabled: Boolean, $isMac: Boolean = false, $storefronts: [UserGameProductStorefront!], $ownershipMethods: [OwnershipMethod!], $processorArchitectures: [ProcessorArchitecture!], $platforms: [GamePlatform!]!) { + me { + id: pd + ownedGameProducts(storefronts: $storefronts, locale: $locale, paging: {limit: $limit, next: $next}, productFound: true, orderBy: {field: NAME, direction: ASC}, ownershipMethod: $ownershipMethods, processorArchitectures: $processorArchitectures, type: $type, downloadableOnly: false, entitlementEnabled: $entitlementEnabled, platforms: $platforms) { + next + totalCount + items { + ...userGameProductFragment + __typename + } + __typename + } + __typename + } +} + +fragment userGameProductFragment on UserGameProduct { + id: originOfferId + originOfferId + status + product { + ...OwnedGameProductFragment + __typename + } + __typename +} + +fragment OwnedGameProductFragment on GameProduct { + id + name + downloadable + gameSlug + trialDetails { + trialType + __typename + } + baseItem(availabilities: [VISIBLE]) { + title + id + baseGameSlug + gameType + __typename + } + gamePlatformDetails @include(if: $isMac) { + gamePlatform + __typename + } + processorArchitectureDetails @include(if: $isMac) { + processorArchitecture + platform + __typename + } + gameProductUser(storefronts: $storefronts) { + ownershipMethods + initialEntitlementDate + entitlementId + gameProductUserTrial { + trialTimeRemainingSeconds + __typename + } + status + __typename + } + purchaseStatus { + repurchasable + __typename + } + __typename +} diff --git a/app/src/main/resources/ea/graphql/grantEntitlement.gql b/app/src/main/resources/ea/graphql/grantEntitlement.gql new file mode 100644 index 0000000000..9871d7231f --- /dev/null +++ b/app/src/main/resources/ea/graphql/grantEntitlement.gql @@ -0,0 +1,23 @@ +mutation grantEntitlement($input: GrantEntitlementInput!) { + grantEntitlement(input: $input) { + success + entitledOfferIds + entitlementType + errors { + ... on GrantEntitlementOfferDoesNotExistError { + __typename + } + ... on GrantEntitlementNotQualifiedError { + __typename + } + ... on GrantEntitlementNotFreeOrNoAppropriateSubscriptionError { + __typename + } + ... on GrantEntitlementUpstreamConflictError { + __typename + } + __typename + } + __typename + } +} diff --git a/app/src/main/resources/ea/graphql/sdkEntitlements.gql b/app/src/main/resources/ea/graphql/sdkEntitlements.gql new file mode 100644 index 0000000000..df6613663e --- /dev/null +++ b/app/src/main/resources/ea/graphql/sdkEntitlements.gql @@ -0,0 +1,27 @@ +query sdkEntitlements($productIds: [String!]!, $includeChildGroups: Boolean!, $groupNames: [String!]!, $entitlementTag: String!, $pageSize: Int!, $pageNumber: Int!) { + me { + sdkEntitlements( + productIds: $productIds, + includeChildGroups: $includeChildGroups, + groupNames: $groupNames, + entitlementTag: $entitlementTag, + paging: { + pageSize: $pageSize, pageNumber: $pageNumber + } + ) { + entitlements { + entitlementTag + entitlementType + grantDate + groupName + id + productId + terminationDate + useCount + version + __typename + } + __typename + } + } +} diff --git a/app/src/main/resources/rockstar/legacy-cipher.bin b/app/src/main/resources/rockstar/legacy-cipher.bin new file mode 100644 index 0000000000..b70beb43ed Binary files /dev/null and b/app/src/main/resources/rockstar/legacy-cipher.bin differ diff --git a/app/src/main/rust/stores/Cargo.lock b/app/src/main/rust/stores/Cargo.lock index 2fac37c5aa..6a470b3bea 100644 --- a/app/src/main/rust/stores/Cargo.lock +++ b/app/src/main/rust/stores/Cargo.lock @@ -195,10 +195,13 @@ dependencies = [ "libc", "lzma-rs", "reqwest", + "ruzstd", "serde_json", "sha1", "sha2", "tokio", + "tokio-rustls", + "webpki-roots", ] [[package]] @@ -897,6 +900,15 @@ version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" +[[package]] +name = "ruzstd" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7c1c839d570d835527c9a5e4db7cb2198683a988cb9d7293fc8674e6bd58fc8" +dependencies = [ + "twox-hash", +] + [[package]] name = "ryu" version = "1.0.23" @@ -1243,6 +1255,12 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +[[package]] +name = "twox-hash" +version = "2.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86a801b3cea342a06d468c8710662aa29e5e05e4f5c0d62f00bbb7f2ad7941c2" + [[package]] name = "typenum" version = "1.20.0" diff --git a/app/src/main/rust/stores/Cargo.toml b/app/src/main/rust/stores/Cargo.toml index 61d121a22a..97a27659a1 100644 --- a/app/src/main/rust/stores/Cargo.toml +++ b/app/src/main/rust/stores/Cargo.toml @@ -15,11 +15,14 @@ libc = "0.2" lzma-rs = { version = "0.3", default-features = false } flate2 = { version = "1", default-features = false, features = ["rust_backend"] } reqwest = { version = "0.12", default-features = false, features = ["rustls-tls", "gzip"] } -tokio = { version = "1", default-features = false, features = ["rt", "net", "time", "sync"] } +tokio = { version = "1", default-features = false, features = ["rt", "net", "time", "sync", "io-util"] } futures-util = { version = "0.3", default-features = false, features = ["std"] } serde_json = { version = "1", features = ["preserve_order"] } sha1 = "0.10" sha2 = "0.10" +tokio-rustls = { version = "0.26", default-features = false, features = ["ring", "tls12"] } +webpki-roots = "1" +ruzstd = "0.8" [build-dependencies] cc = "1" diff --git a/app/src/main/rust/stores/src/ea/ffi.rs b/app/src/main/rust/stores/src/ea/ffi.rs new file mode 100644 index 0000000000..7656c6b33e --- /dev/null +++ b/app/src/main/rust/stores/src/ea/ffi.rs @@ -0,0 +1,207 @@ +use std::panic::{catch_unwind, AssertUnwindSafe}; +use std::sync::atomic::{AtomicBool, Ordering}; +use std::sync::Arc; + +use jni::objects::{GlobalRef, JClass, JObject, JString, JValue}; +use jni::sys::{jlong, jstring, JNI_FALSE, JNI_TRUE}; +use jni::{JNIEnv, JavaVM}; +use serde_json::json; + +use super::install; +use crate::amazon::install::{Events, Stop}; + +fn read_string(env: &mut JNIEnv, value: &JString) -> String { + if value.is_null() { + return String::new(); + } + env.get_string(value).map(|s| s.to_string_lossy().into_owned()).unwrap_or_default() +} + +fn new_string(env: &mut JNIEnv, text: &str) -> jstring { + env.new_string(text).map(|s| s.into_raw()).unwrap_or(std::ptr::null_mut()) +} + +fn call(op: &str, request: &str) -> String { + let parsed: serde_json::Value = serde_json::from_str(request).unwrap_or(serde_json::Value::Null); + let url = parsed.get("url").and_then(|v| v.as_str()).unwrap_or(""); + let answer = match op { + "zip.size" => install::size(url).unwrap_or_else(|e| json!({ "error": e })), + _ => json!({ "error": format!("unknown operation {op}") }), + }; + answer.to_string() +} + +#[no_mangle] +pub extern "system" fn Java_com_droiddeck_launcher_stores_ea_EaNative_nativeCall( + mut env: JNIEnv, + _class: JClass, + op: JString, + request: JString, +) -> jstring { + let op = read_string(&mut env, &op); + let request = read_string(&mut env, &request); + match catch_unwind(AssertUnwindSafe(|| call(&op, &request))) { + Ok(text) => new_string(&mut env, &text), + Err(_) => std::ptr::null_mut(), + } +} + +struct Listener { + vm: JavaVM, + target: GlobalRef, +} + +impl Listener { + fn with_env(&self, fallback: R, f: impl FnOnce(&mut JNIEnv) -> R) -> R { + let Ok(mut env) = self.vm.attach_current_thread_as_daemon() else { + return fallback; + }; + let out = f(&mut env); + if env.exception_check().unwrap_or(false) { + let _ = env.exception_clear(); + } + out + } + + fn text(&self, method: &str, text: &str) { + self.with_env((), |env| { + let Ok(s) = env.new_string(text) else { return }; + let s = JObject::from(s); + let _ = env.call_method(self.target.as_obj(), method, "(Ljava/lang/String;)V", &[JValue::Object(&s)]); + let _ = env.delete_local_ref(s); + }); + } + + fn counts(&self, method: &str, a: u64, b: u64, c: u32, d: u32) { + self.with_env((), |env| { + let _ = env.call_method( + self.target.as_obj(), + method, + "(JJII)V", + &[ + JValue::Long(a.min(i64::MAX as u64) as i64), + JValue::Long(b.min(i64::MAX as u64) as i64), + JValue::Int(c.min(i32::MAX as u32) as i32), + JValue::Int(d.min(i32::MAX as u32) as i32), + ], + ); + }); + } + + fn complete(&self, success: bool, cancelled: bool, error: &str, result: &str) { + self.with_env((), |env| { + let (Ok(e), Ok(r)) = (env.new_string(error), env.new_string(result)) else { return }; + let (e, r) = (JObject::from(e), JObject::from(r)); + let _ = env.call_method( + self.target.as_obj(), + "onComplete", + "(ZZLjava/lang/String;Ljava/lang/String;)V", + &[ + JValue::Bool(if success { JNI_TRUE } else { JNI_FALSE }), + JValue::Bool(if cancelled { JNI_TRUE } else { JNI_FALSE }), + JValue::Object(&e), + JValue::Object(&r), + ], + ); + let _ = env.delete_local_ref(e); + let _ = env.delete_local_ref(r); + }); + } +} + +impl Events for Listener { + fn log(&self, line: &str) { + self.text("onLog", &crate::amazon::net::scrub_urls(line)); + } + + fn status(&self, text: &str) { + self.text("onStatus", text); + } + + fn checking(&self, done_bytes: u64, total_bytes: u64, files: u32, files_total: u32) { + self.counts("onCheck", done_bytes, total_bytes, files, files_total); + } + + fn sizes(&self, pending_bytes: u64, total_bytes: u64) { + self.with_env((), |env| { + let _ = env.call_method( + self.target.as_obj(), + "onSizes", + "(JJ)V", + &[ + JValue::Long(pending_bytes.min(i64::MAX as u64) as i64), + JValue::Long(total_bytes.min(i64::MAX as u64) as i64), + ], + ); + }); + } + + fn progress(&self, done: u64, total: u64, files: u32, files_total: u32) { + self.counts("onProgress", done, total, files, files_total); + } + + fn before_replace(&self) -> bool { + self.with_env(false, |env| match env.call_method(self.target.as_obj(), "beforeReplace", "()Z", &[]) { + Ok(v) => v.z().unwrap_or(false), + Err(_) => false, + }) + } +} + +#[no_mangle] +pub extern "system" fn Java_com_droiddeck_launcher_stores_ea_EaNative_nativeInstall( + mut env: JNIEnv, + _class: JClass, + request: JString, + listener: JObject, +) -> jlong { + if listener.is_null() { + return 0; + } + let Ok(vm) = env.get_java_vm() else { return 0 }; + let Ok(target) = env.new_global_ref(&listener) else { return 0 }; + let listener = Listener { vm, target }; + let text = read_string(&mut env, &request); + let parsed = serde_json::from_str::(&text) + .map_err(|_| "The install request could not be read".to_string()) + .and_then(|v| install::Request::from_json(&v)); + let request = match parsed { + Ok(r) => r, + Err(e) => { + listener.complete(false, false, &e, ""); + return 0; + } + }; + let cancel = Arc::new(AtomicBool::new(false)); + let worker_cancel = Arc::clone(&cancel); + let spawned = std::thread::Builder::new().name("ea-install".into()).spawn(move || { + crate::priority::background(); + let result = catch_unwind(AssertUnwindSafe(|| install::run(&request, &worker_cancel, &listener))) + .unwrap_or_else(|_| Err(Stop::Failed("The EA install stopped on an internal error".into()))); + match result { + Ok(done) => listener.complete(true, false, "", &done.to_json().to_string()), + Err(Stop::Cancelled) => listener.complete(false, true, "cancelled", ""), + Err(Stop::Failed(e)) => listener.complete(false, false, &e, ""), + } + }); + if spawned.is_err() { + return 0; + } + Box::into_raw(Box::new(cancel)) as jlong +} + +#[no_mangle] +pub extern "system" fn Java_com_droiddeck_launcher_stores_ea_EaNative_nativeCancel(_env: JNIEnv, _class: JClass, handle: jlong) { + let ptr = handle as *const Arc; + if let Some(cancel) = unsafe { ptr.as_ref() } { + cancel.store(true, Ordering::SeqCst); + } +} + +#[no_mangle] +pub extern "system" fn Java_com_droiddeck_launcher_stores_ea_EaNative_nativeRelease(_env: JNIEnv, _class: JClass, handle: jlong) { + let ptr = handle as *mut Arc; + if !ptr.is_null() { + drop(unsafe { Box::from_raw(ptr) }); + } +} diff --git a/app/src/main/rust/stores/src/ea/install.rs b/app/src/main/rust/stores/src/ea/install.rs new file mode 100644 index 0000000000..fb2cd80ef5 --- /dev/null +++ b/app/src/main/rust/stores/src/ea/install.rs @@ -0,0 +1,850 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +//! Installs or updates an EA game from its build archive: files whose size and CRC already match +//! are kept, everything else is fetched entry by entry with ranged reads and inflated in place. + +use std::collections::{HashMap, HashSet}; +use std::fs::{self, File, OpenOptions}; +use std::io::{Read, Write}; +use std::os::unix::fs::FileExt; +use std::path::{Path, PathBuf}; +use std::sync::atomic::{AtomicBool, AtomicU64, AtomicUsize, Ordering}; +use std::sync::Mutex; +use std::time::{Duration, Instant, UNIX_EPOCH}; + +use flate2::{Crc, Decompress, FlushDecompress, Status}; +use serde_json::{json, Value}; + +use super::net; +use super::zip::{self, Entry}; +use crate::amazon::install::check::{free_bytes, space_problem}; +use crate::amazon::install::{Events, ReplaceGate, Stop}; +use crate::fetch_core::{distinct_host_count, run_fetch, FetchItem, FetchOptions, FetchSink, SinkError}; + +pub const LEDGER: &str = ".droiddeck-ea-files"; +pub const IN_PROGRESS_MARKER: &str = ".droiddeck-ea-downloading"; +const TEMP_SUFFIX: &str = ".ddpart"; +const PROGRESS_EVERY_MS: u64 = 50; +const CHECK_REPORT_EVERY: Duration = Duration::from_millis(200); +const REQUEST_TIMEOUT: Duration = Duration::from_secs(120); +const INFLATE_BUFFER: usize = 256 * 1024; +/// Records larger than this are fetched as parallel ranges into a scratch file, then inflated, +/// so one big file does not ride a single connection. +pub const PART_BYTES: u64 = 16 * 1024 * 1024; +const SPLIT_SUFFIX: &str = ".ddzip"; + +struct Split { + tmp: PathBuf, + file: Mutex>, + received: Vec, + left: AtomicUsize, +} + +#[derive(Clone, Copy)] +enum Work { + Whole(usize), + Part { job: usize, part: usize, start: u64, len: u64 }, +} + +/// The fetches for each job: whole records, or byte ranges of one when it is large. +fn works(jobs: &[&Planned], part_bytes: u64) -> Vec { + let mut out = Vec::new(); + for (i, p) in jobs.iter().enumerate() { + let span = p.range_end - p.entry.local_offset + 1; + if span <= part_bytes * 2 { + out.push(Work::Whole(i)); + continue; + } + let mut start = 0; + let mut part = 0; + while start < span { + let len = part_bytes.min(span - start); + out.push(Work::Part { job: i, part, start, len }); + start += len; + part += 1; + } + } + out +} +pub const REPLACE_REFUSED: &str = "The install record could not be switched to updating; nothing was replaced"; + +pub struct Request { + pub url: String, + pub game_dir: PathBuf, + pub max_workers: usize, + pub process_workers: usize, + pub ca_bundle: String, + pub part_bytes: u64, +} + +impl Request { + pub fn from_json(v: &Value) -> Result { + let text = |k: &str| v.get(k).and_then(|x| x.as_str()).unwrap_or("").to_string(); + let game_dir = text("gameDir"); + if game_dir.is_empty() || !game_dir.starts_with('/') { + return Err("No install folder was given".into()); + } + let url = text("url"); + if !url.starts_with("https://") && !url.starts_with("http://") { + return Err("EA gave no download for this game".into()); + } + Ok(Request { + url, + game_dir: PathBuf::from(game_dir), + max_workers: v.get("maxWorkers").and_then(|n| n.as_u64()).unwrap_or(8) as usize, + process_workers: v.get("processWorkers").and_then(|n| n.as_u64()).unwrap_or(2) as usize, + ca_bundle: text("caBundle"), + part_bytes: v.get("partBytes").and_then(|n| n.as_u64()).filter(|n| *n > 0).unwrap_or(PART_BYTES), + }) + } +} + +#[derive(Debug, Default)] +pub struct Finished { + pub total_bytes: u64, + pub download_bytes: u64, + pub file_count: usize, + pub files_written: usize, + pub bytes_written: u64, + pub removed: usize, +} + +impl Finished { + pub fn to_json(&self) -> Value { + json!({ + "totalBytes": self.total_bytes, + "downloadBytes": self.download_bytes, + "fileCount": self.file_count, + "filesWritten": self.files_written, + "bytesWritten": self.bytes_written, + "removed": self.removed, + }) + } +} + +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +struct Known { + crc: u32, + size: u64, + modified: u64, +} + +fn modified_ms(path: &Path) -> u64 { + fs::metadata(path) + .and_then(|m| m.modified()) + .ok() + .and_then(|t| t.duration_since(UNIX_EPOCH).ok()) + .map(|d| d.as_millis() as u64) + .unwrap_or(0) +} + +fn read_ledger(dir: &Path) -> HashMap { + let Ok(text) = fs::read_to_string(dir.join(LEDGER)) else { return HashMap::new() }; + let mut out = HashMap::new(); + for line in text.lines() { + let mut parts = line.splitn(4, '\t'); + let (Some(crc), Some(size), Some(modified), Some(path)) = (parts.next(), parts.next(), parts.next(), parts.next()) else { + continue; + }; + let (Ok(crc), Ok(size), Ok(modified)) = (u32::from_str_radix(crc, 16), size.parse(), modified.parse()) else { + continue; + }; + out.insert(path.to_string(), Known { crc, size, modified }); + } + out +} + +fn ledger_line(path: &str, k: Known) -> String { + format!("{:08x}\t{}\t{}\t{path}\n", k.crc, k.size, k.modified) +} + +fn crc_of(path: &Path, cancel: &AtomicBool) -> Result, ()> { + let Ok(mut f) = File::open(path) else { return Ok(None) }; + let mut crc = Crc::new(); + let mut buf = vec![0u8; 1024 * 1024]; + loop { + if cancel.load(Ordering::Relaxed) { + return Err(()); + } + match f.read(&mut buf) { + Ok(0) => return Ok(Some(crc.sum())), + Ok(n) => crc.update(&buf[..n]), + Err(e) if e.kind() == std::io::ErrorKind::Interrupted => {} + Err(_) => return Ok(None), + } + } +} + +/// Whether two paths name one file, as they do for a case-only rename on case-insensitive storage. +fn same_file(a: &Path, b: &Path) -> bool { + use std::os::unix::fs::MetadataExt; + match (fs::metadata(a), fs::metadata(b)) { + (Ok(x), Ok(y)) => x.dev() == y.dev() && x.ino() == y.ino(), + _ => false, + } +} + +fn temp_path(dest: &Path) -> PathBuf { + let mut name = dest.as_os_str().to_owned(); + name.push(TEMP_SUFFIX); + PathBuf::from(name) +} + +pub struct Planned { + pub entry: Entry, + pub path: String, + pub range_end: u64, +} + +/// Every file entry with its safe path and the last byte its local record can occupy. +pub fn plan(entries: &[Entry], directory_offset: u64) -> Result, String> { + let mut offsets: Vec = entries.iter().map(|e| e.local_offset).collect(); + offsets.push(directory_offset); + offsets.sort_unstable(); + offsets.dedup(); + let mut seen = HashSet::new(); + let mut out = Vec::new(); + for e in entries.iter().filter(|e| !e.is_dir()) { + if e.method != zip::STORED && e.method != zip::DEFLATED { + return Err(format!("{} uses an unsupported compression method ({})", e.name, e.method)); + } + let path = zip::safe_path(&e.name).ok_or_else(|| format!("The archive names a file outside the game folder: {}", e.name))?; + if !seen.insert(path.to_lowercase()) { + continue; + } + let at = offsets.partition_point(|&o| o <= e.local_offset); + let next = offsets.get(at).copied().unwrap_or(directory_offset); + let minimum = e.local_offset + zip::LOCAL_FIXED as u64 + e.compressed; + if next < minimum { + return Err(format!("{} overlaps the next record in the archive", e.name)); + } + out.push(Planned { entry: e.clone(), path, range_end: next - 1 }); + } + Ok(out) +} + +struct Slot { + header: Vec, + payload_from: Option, + consumed: u64, + file: File, + tmp: PathBuf, + crc: Crc, + written: u64, + inflate: Option, + buffer: Vec, +} + +struct Placer<'a> { + jobs: &'a [&'a Planned], + game_dir: &'a Path, + slots: Vec>>, + splits: Vec>, + works: Vec, + placed: Vec, + ledger: Mutex>, + events: &'a dyn Events, + gate: &'a ReplaceGate, + stop: &'a AtomicBool, + failure: Mutex>, + base_done: u64, + base_files: u32, + total: u64, + total_files: u32, + placed_bytes: AtomicU64, + in_flight: AtomicU64, + shown: AtomicU64, + bytes_written: AtomicU64, + files_placed: AtomicUsize, + last_emit: AtomicU64, + started: Instant, +} + +fn discard(slot: Slot) { + drop(slot.file); + let _ = fs::remove_file(&slot.tmp); +} + +impl Placer<'_> { + fn fail(&self, message: String) -> String { + let mut slot = self.failure.lock().expect("failure lock"); + if slot.is_none() { + *slot = Some(message.clone()); + } + drop(slot); + self.stop.store(true, Ordering::SeqCst); + message + } + + fn emit(&self, force: bool) { + let now = self.started.elapsed().as_millis() as u64; + let last = self.last_emit.load(Ordering::Relaxed); + if !force && now < last + PROGRESS_EVERY_MS { + return; + } + if !force && self.last_emit.compare_exchange(last, now, Ordering::Relaxed, Ordering::Relaxed).is_err() { + return; + } + self.last_emit.store(now, Ordering::Relaxed); + let value = self.base_done + self.placed_bytes.load(Ordering::Relaxed) + self.in_flight.load(Ordering::Relaxed); + let shown = self.shown.fetch_max(value, Ordering::Relaxed).max(value); + self.events.progress( + shown.min(self.total), + self.total, + self.base_files + self.files_placed.load(Ordering::Relaxed) as u32, + self.total_files, + ); + } + + fn open(&self, job: &Planned) -> Result { + let dest = self.game_dir.join(&job.path); + if let Some(parent) = dest.parent() { + fs::create_dir_all(parent).map_err(|e| format!("Could not create the folder for {}: {e}", job.path))?; + } + let tmp = temp_path(&dest); + let file = File::create(&tmp).map_err(|e| format!("Could not write {}: {e}", job.path))?; + Ok(Slot { + header: Vec::new(), + payload_from: None, + consumed: 0, + file, + tmp, + crc: Crc::new(), + written: 0, + inflate: (job.entry.method == zip::DEFLATED).then(|| Decompress::new(false)), + buffer: Vec::new(), + }) + } + + fn write_out(&self, job: &Planned, slot: &mut Slot, data: &[u8]) -> Result<(), SinkError> { + if slot.written + data.len() as u64 > job.entry.size { + return Err(SinkError::Retry(format!("{}: more data than the archive lists", job.path))); + } + slot.file + .write_all(data) + .map_err(|e| SinkError::Fatal(self.fail(format!("Could not write {}: {e}", job.path))))?; + slot.crc.update(data); + slot.written += data.len() as u64; + self.bytes_written.fetch_add(data.len() as u64, Ordering::Relaxed); + Ok(()) + } + + fn feed(&self, job: &Planned, slot: &mut Slot, payload: &[u8], finish: bool) -> Result<(), SinkError> { + let Some(mut inflate) = slot.inflate.take() else { + return self.write_out(job, slot, payload); + }; + let mut out = std::mem::take(&mut slot.buffer); + out.resize(INFLATE_BUFFER, 0); + let result = self.inflate_into(job, slot, &mut inflate, &mut out, payload, finish); + slot.inflate = Some(inflate); + slot.buffer = out; + result + } + + fn inflate_into(&self, job: &Planned, slot: &mut Slot, inflate: &mut Decompress, out: &mut [u8], mut input: &[u8], finish: bool) -> Result<(), SinkError> { + let mode = if finish { FlushDecompress::Finish } else { FlushDecompress::None }; + loop { + let (in_before, out_before) = (inflate.total_in(), inflate.total_out()); + let status = inflate + .decompress(input, out, mode) + .map_err(|e| SinkError::Retry(format!("{}: the compressed data is damaged ({e})", job.path)))?; + let used = (inflate.total_in() - in_before) as usize; + let produced = (inflate.total_out() - out_before) as usize; + input = &input[used..]; + if produced > 0 { + self.write_out(job, slot, &out[..produced])?; + } + if status == Status::StreamEnd || (used == 0 && produced == 0) { + return Ok(()); + } + if input.is_empty() && !finish && produced < out.len() { + return Ok(()); + } + } + } + + fn piece(&self, i: usize, offset: u64, data: &[u8]) -> Result<(), SinkError> { + let job = self.jobs[i]; + let mut guard = self.slots[i].lock().expect("slot lock"); + if offset == 0 { + if let Some(old) = guard.take() { + self.in_flight.fetch_sub(old.consumed, Ordering::Relaxed); + discard(old); + } + *guard = Some(self.open(job).map_err(|e| SinkError::Fatal(self.fail(e)))?); + } + let Some(slot) = guard.as_mut() else { + return Err(SinkError::Retry(format!("{}: data arrived before the start of the record", job.path))); + }; + self.consume(job, slot, data) + } + + fn consume(&self, job: &Planned, slot: &mut Slot, data: &[u8]) -> Result<(), SinkError> { + if slot.payload_from.is_none() { + slot.header.extend_from_slice(data); + match zip::local_header_len(&slot.header) { + None => return Ok(()), + Some(Err(e)) => return Err(SinkError::Retry(format!("{}: {e}", job.path))), + Some(Ok(len)) if slot.header.len() < len => return Ok(()), + Some(Ok(len)) => { + slot.payload_from = Some(len); + let header = std::mem::take(&mut slot.header); + let rest = header[len..].to_vec(); + return self.payload(job, slot, &rest); + } + } + } + self.payload(job, slot, data) + } + + fn payload(&self, job: &Planned, slot: &mut Slot, data: &[u8]) -> Result<(), SinkError> { + let left = job.entry.compressed.saturating_sub(slot.consumed); + let take = &data[..(left.min(data.len() as u64) as usize)]; + if take.is_empty() { + return Ok(()); + } + slot.consumed += take.len() as u64; + self.in_flight.fetch_add(take.len() as u64, Ordering::Relaxed); + self.feed(job, slot, take, false)?; + self.emit(false); + Ok(()) + } + + fn finish(&self, i: usize) -> Result { + let job = self.jobs[i]; + let taken = self.slots[i].lock().expect("slot lock").take(); + let Some(slot) = taken else { + return Err(SinkError::Retry(format!("{}: the record arrived empty", job.path))); + }; + self.complete(i, slot) + } + + fn complete(&self, i: usize, mut slot: Slot) -> Result { + let job = self.jobs[i]; + self.in_flight.fetch_sub(slot.consumed, Ordering::Relaxed); + if slot.consumed != job.entry.compressed { + let got = slot.consumed; + discard(slot); + return Err(SinkError::Retry(format!("{}: {got} of {} compressed bytes arrived", job.path, job.entry.compressed))); + } + if slot.inflate.is_some() { + if let Err(e) = self.feed(job, &mut slot, &[], true) { + discard(slot); + return Err(e); + } + } + if slot.written != job.entry.size || slot.crc.sum() != job.entry.crc32 { + let got = slot.written; + discard(slot); + return Err(SinkError::Retry(format!("{}: {got} bytes inflated with a CRC mismatch", job.path))); + } + let Slot { file, tmp, .. } = slot; + if let Err(e) = file.sync_all() { + drop(file); + let _ = fs::remove_file(&tmp); + return Err(SinkError::Fatal(self.fail(format!("Could not write {}: {e}", job.path)))); + } + drop(file); + if self.stop.load(Ordering::SeqCst) { + let _ = fs::remove_file(&tmp); + return Ok(0); + } + if !self.gate.allow(self.events) { + let _ = fs::remove_file(&tmp); + return Err(SinkError::Fatal(self.fail(REPLACE_REFUSED.into()))); + } + let dest = self.game_dir.join(&job.path); + if let Err(e) = fs::rename(&tmp, &dest) { + let _ = fs::remove_file(&tmp); + return Err(SinkError::Fatal(self.fail(format!("Could not put {} in place: {e}", job.path)))); + } + self.record(job, &dest); + self.placed[i].store(true, Ordering::SeqCst); + self.placed_bytes.fetch_add(job.entry.compressed, Ordering::Relaxed); + self.files_placed.fetch_add(1, Ordering::Relaxed); + self.emit(true); + Ok(0) + } + + fn part_chunk(&self, i: usize, part: usize, start: u64, offset: u64, data: &[u8]) -> Result<(), SinkError> { + let job = self.jobs[i]; + let Some(split) = self.splits[i].as_ref() else { + return Err(SinkError::Fatal(format!("{}: no split state", job.path))); + }; + let mut file = split.file.lock().expect("split lock"); + if file.is_none() { + let dest = self.game_dir.join(&job.path); + if let Some(parent) = dest.parent() { + fs::create_dir_all(parent).map_err(|e| SinkError::Fatal(self.fail(format!("Could not create the folder for {}: {e}", job.path))))?; + } + *file = Some(File::create(&split.tmp).map_err(|e| SinkError::Fatal(self.fail(format!("Could not write {}: {e}", job.path))))?); + } + let handle = file.as_ref().expect("split file"); + if offset == 0 { + let old = split.received[part].swap(0, Ordering::Relaxed); + self.in_flight.fetch_sub(old, Ordering::Relaxed); + } + handle + .write_all_at(data, start + offset) + .map_err(|e| SinkError::Fatal(self.fail(format!("Could not write {}: {e}", job.path))))?; + drop(file); + split.received[part].fetch_add(data.len() as u64, Ordering::Relaxed); + self.in_flight.fetch_add(data.len() as u64, Ordering::Relaxed); + self.emit(false); + Ok(()) + } + + fn part_finish(&self, i: usize, part: usize, len: u64) -> Result { + let job = self.jobs[i]; + let Some(split) = self.splits[i].as_ref() else { + return Err(SinkError::Fatal(format!("{}: no split state", job.path))); + }; + let got = split.received[part].load(Ordering::Relaxed); + if got != len { + return Err(SinkError::Retry(format!("{}: part {part} got {got} of {len} bytes", job.path))); + } + if split.left.fetch_sub(1, Ordering::SeqCst) != 1 { + return Ok(0); + } + let received: u64 = split.received.iter().map(|r| r.swap(0, Ordering::Relaxed)).sum(); + self.in_flight.fetch_sub(received, Ordering::Relaxed); + let result = self.assemble(i, split); + let _ = fs::remove_file(&split.tmp); + *split.file.lock().expect("split lock") = None; + result.map_err(|e| match e { + SinkError::Retry(m) => SinkError::Fatal(self.fail(m)), + fatal => fatal, + }) + } + + fn assemble(&self, i: usize, split: &Split) -> Result { + let job = self.jobs[i]; + let mut source = File::open(&split.tmp).map_err(|e| SinkError::Fatal(self.fail(format!("Could not read {}: {e}", job.path))))?; + let mut slot = self.open(job).map_err(|e| SinkError::Fatal(self.fail(e)))?; + let mut buf = vec![0u8; 1024 * 1024]; + loop { + if self.stop.load(Ordering::Relaxed) { + self.in_flight.fetch_sub(slot.consumed, Ordering::Relaxed); + discard(slot); + return Ok(0); + } + let n = match source.read(&mut buf) { + Ok(0) => break, + Ok(n) => n, + Err(e) if e.kind() == std::io::ErrorKind::Interrupted => continue, + Err(e) => { + self.in_flight.fetch_sub(slot.consumed, Ordering::Relaxed); + discard(slot); + return Err(SinkError::Fatal(self.fail(format!("Could not read {}: {e}", job.path)))); + } + }; + if let Err(e) = self.consume(job, &mut slot, &buf[..n]) { + self.in_flight.fetch_sub(slot.consumed, Ordering::Relaxed); + discard(slot); + return Err(e); + } + if slot.consumed >= job.entry.compressed { + break; + } + } + self.complete(i, slot) + } + + fn record(&self, job: &Planned, dest: &Path) { + let known = Known { crc: job.entry.crc32, size: job.entry.size, modified: modified_ms(dest) }; + if let Some(file) = self.ledger.lock().expect("ledger lock").as_mut() { + let _ = file.write_all(ledger_line(&job.path, known).as_bytes()); + } + } +} + +struct Sink<'p, 'a>(&'p Placer<'a>); + +impl FetchSink for Sink<'_, '_> { + fn process(&self, item: &FetchItem, _body: Vec) -> Result { + Err(SinkError::Fatal(format!("item {} arrived whole; streaming was expected", item.id))) + } + + fn on_chunk(&self, item: &FetchItem, offset: u64, data: &[u8]) -> Result<(), SinkError> { + match self.0.works[item.id as usize] { + Work::Whole(i) => self.0.piece(i, offset, data), + Work::Part { job, part, start, .. } => self.0.part_chunk(job, part, start, offset, data), + } + } + + fn on_finish(&self, item: &FetchItem, _total_len: u64) -> Result { + match self.0.works[item.id as usize] { + Work::Whole(i) => self.0.finish(i), + Work::Part { job, part, len, .. } => self.0.part_finish(job, part, len), + } + } +} + +fn origin(url: &str) -> String { + let after = url.find("://").map(|i| i + 3).unwrap_or(0); + let end = url[after..].find('/').map(|i| after + i).unwrap_or(url.len()); + url[..end].to_string() +} + +fn cancelled(cancel: &AtomicBool) -> Result<(), Stop> { + if cancel.load(Ordering::SeqCst) { + Err(Stop::Cancelled) + } else { + Ok(()) + } +} + +pub fn run(req: &Request, cancel: &AtomicBool, ev: &dyn Events) -> Result { + let failed = Stop::Failed; + let started = Instant::now(); + fs::create_dir_all(&req.game_dir).map_err(|e| failed(format!("Could not create the install folder: {e}")))?; + let _ = File::create(req.game_dir.join(IN_PROGRESS_MARKER)); + + ev.status("Reading the buildโ€ฆ"); + let archive = net::read_archive(&req.url).map_err(|e| { + ev.log(&format!("archive: {e}")); + failed(format!("The EA build could not be read: {e}")) + })?; + cancelled(cancel)?; + let planned = plan(&archive.entries, archive.directory.offset).map_err(failed)?; + let total_size: u64 = planned.iter().map(|p| p.entry.size).sum(); + let total_compressed: u64 = planned.iter().map(|p| p.entry.compressed).sum(); + ev.log(&format!( + "archive bytes={} entries={} files={} size={total_size} compressed={total_compressed}", + archive.total, + archive.entries.len(), + planned.len() + )); + + for p in &planned { + let dest = req.game_dir.join(&p.path); + let _ = fs::remove_file(temp_path(&dest)); + let mut split = dest.into_os_string(); + split.push(SPLIT_SUFFIX); + let _ = fs::remove_file(split); + } + + ev.status("Checking filesโ€ฆ"); + let mut ledger = read_ledger(&req.game_dir); + let mut pending: Vec<&Planned> = Vec::new(); + let mut kept: Vec<(String, Known)> = Vec::new(); + let mut checked = 0u64; + let mut last_report = Instant::now(); + for (n, p) in planned.iter().enumerate() { + let dest = req.game_dir.join(&p.path); + let size_ok = fs::symlink_metadata(&dest).map(|m| m.is_file() && m.len() == p.entry.size).unwrap_or(false); + let mut complete = false; + if size_ok { + let modified = modified_ms(&dest); + let known = ledger.get(&p.path).copied(); + if known == Some(Known { crc: p.entry.crc32, size: p.entry.size, modified }) { + complete = true; + } else { + match crc_of(&dest, cancel) { + Err(()) => return Err(Stop::Cancelled), + Ok(Some(crc)) if crc == p.entry.crc32 => { + complete = true; + kept.push((p.path.clone(), Known { crc, size: p.entry.size, modified })); + } + Ok(_) => {} + } + } + } + if !complete { + pending.push(p); + } + checked += p.entry.size; + if last_report.elapsed() >= CHECK_REPORT_EVERY || n + 1 == planned.len() { + ev.checking(checked, total_size, (n + 1) as u32, planned.len() as u32); + last_report = Instant::now(); + } + cancelled(cancel)?; + } + for (path, known) in kept { + ledger.insert(path, known); + } + + let pending_size: u64 = pending.iter().map(|p| p.entry.size).sum(); + let pending_compressed: u64 = pending.iter().map(|p| p.entry.compressed).sum(); + ev.log(&format!( + "resume kept_files={} pending_files={} pending_bytes={pending_size} pending_download={pending_compressed}", + planned.len() - pending.len(), + pending.len() + )); + ev.sizes(pending_size, total_size); + if let Some(message) = space_problem(pending_size, free_bytes(&req.game_dir)) { + return Err(failed(message)); + } + + let gate = ReplaceGate::new(); + let (empty, remote): (Vec<&Planned>, Vec<&Planned>) = pending.into_iter().partition(|p| p.entry.size == 0 && p.entry.crc32 == 0); + for p in &empty { + let dest = req.game_dir.join(&p.path); + if let Some(parent) = dest.parent() { + fs::create_dir_all(parent).map_err(|e| failed(format!("Could not create the folder for {}: {e}", p.path)))?; + } + if !gate.allow(ev) { + return Err(failed(REPLACE_REFUSED.into())); + } + File::create(&dest).map_err(|e| failed(format!("Could not write {}: {e}", p.path)))?; + ledger.insert(p.path.clone(), Known { crc: 0, size: 0, modified: modified_ms(&dest) }); + } + + let mut text = String::new(); + for (path, known) in &ledger { + text.push_str(&ledger_line(path, *known)); + } + fs::write(req.game_dir.join(LEDGER), text).map_err(|e| failed(format!("Could not write the install record: {e}")))?; + let ledger_file = OpenOptions::new().append(true).open(req.game_dir.join(LEDGER)).ok(); + + let host = origin(&req.url); + let works = works(&remote, req.part_bytes); + let splits: Vec> = remote + .iter() + .enumerate() + .map(|(i, p)| { + let parts = works.iter().filter(|w| matches!(w, Work::Part { job, .. } if *job == i)).count(); + (parts > 0).then(|| { + let mut name = req.game_dir.join(&p.path).into_os_string(); + name.push(SPLIT_SUFFIX); + Split { + tmp: PathBuf::from(name), + file: Mutex::new(None), + received: (0..parts).map(|_| AtomicU64::new(0)).collect(), + left: AtomicUsize::new(parts), + } + }) + }) + .collect(); + let placer = Placer { + jobs: &remote, + game_dir: &req.game_dir, + slots: remote.iter().map(|_| Mutex::new(None)).collect(), + splits, + works: works.clone(), + placed: remote.iter().map(|_| AtomicBool::new(false)).collect(), + ledger: Mutex::new(ledger_file), + events: ev, + gate: &gate, + stop: cancel, + failure: Mutex::new(None), + base_done: total_compressed - pending_compressed, + base_files: (planned.len() - remote.len()) as u32, + total: total_compressed, + total_files: planned.len() as u32, + placed_bytes: AtomicU64::new(0), + in_flight: AtomicU64::new(0), + shown: AtomicU64::new(0), + bytes_written: AtomicU64::new(0), + files_placed: AtomicUsize::new(0), + last_emit: AtomicU64::new(0), + started: Instant::now(), + }; + let cores = std::thread::available_parallelism().map(|n| n.get()).unwrap_or(2); + let window = req.max_workers.clamp(1, 64); + let hosts = vec![host.clone()]; + let options = FetchOptions { + max_workers: window, + per_host_cap: window, + timeout: REQUEST_TIMEOUT, + headers: vec![("User-Agent".to_string(), net::user_agent())], + ca_bundle_path: req.ca_bundle.clone(), + process_workers: req.process_workers.max(cores / 2).max(1), + label: "ea".to_string(), + stream: true, + }; + let items: Vec = works + .iter() + .enumerate() + .map(|(n, w)| { + let range = match *w { + Work::Whole(i) => (remote[i].entry.local_offset, remote[i].range_end), + Work::Part { job, start, len, .. } => { + let at = remote[job].entry.local_offset + start; + (at, at + len - 1) + } + }; + FetchItem { id: n as u64, urls: vec![req.url.clone()], reserve: 0, range: Some(range) } + }) + .collect(); + ev.status("Downloadingโ€ฆ"); + ev.log(&format!("engine files={} requests={} window={window} hosts={}", remote.len(), items.len(), distinct_host_count(&hosts))); + placer.emit(true); + let log = |line: &str| ev.log(line); + let outcome = if items.is_empty() { + None + } else { + Some(run_fetch(items, &hosts, &options, &Sink(&placer), cancel, &|_: u64, _: u64| {}, &log)) + }; + for slot in &placer.slots { + if let Some(active) = slot.lock().expect("slot lock").take() { + discard(active); + } + } + for split in placer.splits.iter().flatten() { + *split.file.lock().expect("split lock") = None; + let _ = fs::remove_file(&split.tmp); + } + placer.emit(true); + let placed_all = placer.placed.iter().all(|p| p.load(Ordering::SeqCst)); + let bytes_written = placer.bytes_written.load(Ordering::Relaxed); + let files_written = placer.files_placed.load(Ordering::Relaxed) + empty.len(); + let elapsed = started.elapsed().as_secs_f64().max(0.001); + ev.log(&format!( + "summary files_written={files_written} bytes_written={bytes_written} elapsed_s={elapsed:.1} avg_mbps={:.1}", + bytes_written as f64 / 1_048_576.0 / elapsed + )); + if let Some(message) = placer.failure.lock().expect("failure lock").take() { + return Err(Stop::Failed(message)); + } + if !placed_all { + if let Some(error) = outcome.as_ref().and_then(|o| o.error.clone()) { + ev.log(&format!("download failed: {error}")); + return Err(Stop::Failed("A file failed to download".into())); + } + if cancel.load(Ordering::SeqCst) { + return Err(Stop::Cancelled); + } + return Err(Stop::Failed("The download ended before every file was written".into())); + } + + let wanted: HashSet<&str> = planned.iter().map(|p| p.path.as_str()).collect(); + let by_case: HashMap = planned.iter().map(|p| (p.path.to_lowercase(), p.path.as_str())).collect(); + let mut removed = 0; + let current = read_ledger(&req.game_dir); + let mut text = String::new(); + for (path, known) in ¤t { + if wanted.contains(path.as_str()) { + text.push_str(&ledger_line(path, *known)); + } else if by_case.get(&path.to_lowercase()).is_some_and(|kept| same_file(&req.game_dir.join(kept), &req.game_dir.join(path))) { + continue; + } else if zip::safe_path(path).as_deref() == Some(path.as_str()) && fs::remove_file(req.game_dir.join(path)).is_ok() { + removed += 1; + } + } + let _ = fs::write(req.game_dir.join(LEDGER), text); + if removed > 0 { + ev.log(&format!("removed {removed} files the new build no longer has")); + } + let _ = fs::remove_file(req.game_dir.join(IN_PROGRESS_MARKER)); + Ok(Finished { + total_bytes: total_size, + download_bytes: total_compressed, + file_count: planned.len(), + files_written, + bytes_written, + removed, + }) +} + +pub fn size(url: &str) -> Result { + let archive = net::read_archive(url)?; + let planned = plan(&archive.entries, archive.directory.offset)?; + Ok(json!({ + "totalBytes": planned.iter().map(|p| p.entry.size).sum::(), + "downloadBytes": planned.iter().map(|p| p.entry.compressed).sum::(), + "fileCount": planned.len(), + })) +} + +#[cfg(test)] +mod tests; diff --git a/app/src/main/rust/stores/src/ea/install/tests.rs b/app/src/main/rust/stores/src/ea/install/tests.rs new file mode 100644 index 0000000000..baf15a4345 --- /dev/null +++ b/app/src/main/rust/stores/src/ea/install/tests.rs @@ -0,0 +1,258 @@ +use std::io::{BufRead, BufReader, Write}; +use std::net::{TcpListener, TcpStream}; +use std::sync::atomic::{AtomicBool, AtomicUsize}; +use std::sync::{Arc, Mutex}; + +use flate2::write::DeflateEncoder; +use flate2::Compression; + +use super::*; + +struct Built { + bytes: Vec, +} + +fn build_zip(files: &[(&str, Vec, bool)]) -> Built { + let mut out = Vec::new(); + let mut central = Vec::new(); + for (name, data, deflate) in files { + let mut crc = Crc::new(); + crc.update(data); + let body = if *deflate { + let mut enc = DeflateEncoder::new(Vec::new(), Compression::default()); + enc.write_all(data).unwrap(); + enc.finish().unwrap() + } else { + data.clone() + }; + let method: u16 = if *deflate { 8 } else { 0 }; + let offset = out.len() as u32; + let extra = [0xAAu8, 0xBB, 2, 0, 1, 2]; + out.extend_from_slice(&0x0403_4b50u32.to_le_bytes()); + out.extend_from_slice(&[20, 0, 0, 0]); + out.extend_from_slice(&method.to_le_bytes()); + out.extend_from_slice(&[0, 0, 0, 0]); + out.extend_from_slice(&crc.sum().to_le_bytes()); + out.extend_from_slice(&(body.len() as u32).to_le_bytes()); + out.extend_from_slice(&(data.len() as u32).to_le_bytes()); + out.extend_from_slice(&(name.len() as u16).to_le_bytes()); + out.extend_from_slice(&(extra.len() as u16).to_le_bytes()); + out.extend_from_slice(name.as_bytes()); + out.extend_from_slice(&extra); + out.extend_from_slice(&body); + + central.extend_from_slice(&0x0201_4b50u32.to_le_bytes()); + central.extend_from_slice(&[20, 0, 20, 0, 0, 0]); + central.extend_from_slice(&method.to_le_bytes()); + central.extend_from_slice(&[0, 0, 0, 0]); + central.extend_from_slice(&crc.sum().to_le_bytes()); + central.extend_from_slice(&(body.len() as u32).to_le_bytes()); + central.extend_from_slice(&(data.len() as u32).to_le_bytes()); + central.extend_from_slice(&(name.len() as u16).to_le_bytes()); + central.extend_from_slice(&[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); + central.extend_from_slice(&offset.to_le_bytes()); + central.extend_from_slice(name.as_bytes()); + } + let cd_offset = out.len() as u32; + let count = files.len() as u16; + out.extend_from_slice(¢ral); + out.extend_from_slice(&0x0605_4b50u32.to_le_bytes()); + out.extend_from_slice(&[0, 0, 0, 0]); + out.extend_from_slice(&count.to_le_bytes()); + out.extend_from_slice(&count.to_le_bytes()); + out.extend_from_slice(&(central.len() as u32).to_le_bytes()); + out.extend_from_slice(&cd_offset.to_le_bytes()); + out.extend_from_slice(&[0, 0]); + Built { bytes: out } +} + +struct Server { + url: String, + requests: Arc, +} + +fn serve(body: Vec) -> Server { + let listener = TcpListener::bind("127.0.0.1:0").unwrap(); + let addr = listener.local_addr().unwrap(); + let body = Arc::new(body); + let requests = Arc::new(AtomicUsize::new(0)); + let counter = Arc::clone(&requests); + std::thread::spawn(move || { + for stream in listener.incoming() { + let Ok(stream) = stream else { continue }; + let body = Arc::clone(&body); + counter.fetch_add(1, Ordering::SeqCst); + std::thread::spawn(move || answer(stream, &body)); + } + }); + Server { url: format!("http://{addr}/build/game.zip?sig=abc"), requests } +} + +fn answer(mut stream: TcpStream, body: &[u8]) { + let mut reader = BufReader::new(stream.try_clone().unwrap()); + let mut first = String::new(); + if reader.read_line(&mut first).is_err() { + return; + } + let mut range = None; + loop { + let mut line = String::new(); + match reader.read_line(&mut line) { + Ok(0) | Err(_) => break, + Ok(_) if line == "\r\n" => break, + Ok(_) => { + if let Some(v) = line.to_ascii_lowercase().strip_prefix("range: bytes=") { + range = Some(v.trim().to_string()); + } + } + } + } + let total = body.len() as u64; + let Some(range) = range else { + let _ = stream.write_all(format!("HTTP/1.1 200 OK\r\nContent-Length: {total}\r\nConnection: close\r\n\r\n").as_bytes()); + let _ = stream.write_all(body); + return; + }; + let (a, b) = range.split_once('-').unwrap(); + let (start, end) = if a.is_empty() { + let n: u64 = b.parse().unwrap(); + (total.saturating_sub(n), total - 1) + } else { + let start: u64 = a.parse().unwrap(); + let end = if b.is_empty() { total - 1 } else { b.parse::().unwrap().min(total - 1) }; + (start, end) + }; + let slice = &body[start as usize..=end as usize]; + let head = format!( + "HTTP/1.1 206 Partial Content\r\nContent-Length: {}\r\nContent-Range: bytes {start}-{end}/{total}\r\nConnection: close\r\n\r\n", + slice.len() + ); + let _ = stream.write_all(head.as_bytes()); + let _ = stream.write_all(slice); +} + +#[derive(Default)] +struct Recorder { + logs: Mutex>, + gates: AtomicUsize, + last: Mutex<(u64, u64)>, +} + +impl Events for Recorder { + fn log(&self, line: &str) { + self.logs.lock().unwrap().push(line.to_string()); + } + fn status(&self, _text: &str) {} + fn checking(&self, _d: u64, _t: u64, _f: u32, _ft: u32) {} + fn sizes(&self, _pending: u64, _total: u64) {} + fn progress(&self, done: u64, total: u64, _files: u32, _files_total: u32) { + *self.last.lock().unwrap() = (done, total); + } + fn before_replace(&self) -> bool { + self.gates.fetch_add(1, Ordering::SeqCst); + true + } +} + +fn sample() -> Vec<(&'static str, Vec, bool)> { + let mut seed = 0x1234_5678u32; + let big: Vec = (0..900_000u32).map(|_| { seed = seed.wrapping_mul(1_103_515_245).wrapping_add(12_345); (seed >> 16) as u8 }).collect(); + vec![ + ("__Installer/installerdata.xml", b"".to_vec(), true), + ("Game.exe", big, true), + ("Data\\stored.bin", vec![9u8; 4096], false), + ("Data/", Vec::new(), false), + ("empty.txt", Vec::new(), false), + ] +} + +fn request(url: &str, dir: &Path) -> Request { + Request { url: url.to_string(), game_dir: dir.to_path_buf(), max_workers: 4, process_workers: 2, ca_bundle: String::new(), part_bytes: 64 * 1024 } +} + +fn temp_dir(name: &str) -> PathBuf { + let dir = std::env::temp_dir().join(format!("droiddeck-ea-{name}-{}", std::process::id())); + let _ = fs::remove_dir_all(&dir); + fs::create_dir_all(&dir).unwrap(); + dir +} + +#[test] +fn installs_every_file_and_keeps_them_on_the_next_run() { + let files = sample(); + let zip = build_zip(&files); + let server = serve(zip.bytes); + let dir = temp_dir("install"); + let ev = Recorder::default(); + let done = run(&request(&server.url, &dir), &AtomicBool::new(false), &ev).unwrap(); + assert_eq!(done.file_count, 4); + assert_eq!(fs::read(dir.join("Game.exe")).unwrap(), files[1].1); + assert_eq!(fs::read(dir.join("Data/stored.bin")).unwrap(), vec![9u8; 4096]); + assert!(dir.join("empty.txt").is_file()); + assert!(dir.join("__Installer/installerdata.xml").is_file()); + assert!(!dir.join(IN_PROGRESS_MARKER).exists()); + let (shown, total) = *ev.last.lock().unwrap(); + assert_eq!(shown, total); + + let before = server.requests.load(Ordering::SeqCst); + let again = run(&request(&server.url, &dir), &AtomicBool::new(false), &Recorder::default()).unwrap(); + assert_eq!(again.files_written, 0); + assert!(server.requests.load(Ordering::SeqCst) - before <= 2); + let _ = fs::remove_dir_all(&dir); +} + +#[test] +fn an_update_replaces_changed_files_and_drops_removed_ones() { + let dir = temp_dir("update"); + let first = serve(build_zip(&sample()).bytes); + run(&request(&first.url, &dir), &AtomicBool::new(false), &Recorder::default()).unwrap(); + + let mut next = sample(); + next[1].1[10] ^= 0xFF; + next.retain(|f| f.0 != "Data\\stored.bin"); + let second = serve(build_zip(&next).bytes); + let ev = Recorder::default(); + let done = run(&request(&second.url, &dir), &AtomicBool::new(false), &ev).unwrap(); + assert_eq!(done.files_written, 1); + assert_eq!(done.removed, 1); + assert_eq!(fs::read(dir.join("Game.exe")).unwrap(), next[1].1); + assert!(!dir.join("Data/stored.bin").exists()); + assert_eq!(ev.gates.load(Ordering::SeqCst), 1); + let _ = fs::remove_dir_all(&dir); +} + +#[test] +fn a_damaged_file_on_disk_is_downloaded_again() { + let dir = temp_dir("repair"); + let server = serve(build_zip(&sample()).bytes); + run(&request(&server.url, &dir), &AtomicBool::new(false), &Recorder::default()).unwrap(); + let mut data = fs::read(dir.join("Game.exe")).unwrap(); + data[5] ^= 1; + fs::write(dir.join("Game.exe"), &data).unwrap(); + let done = run(&request(&server.url, &dir), &AtomicBool::new(false), &Recorder::default()).unwrap(); + assert_eq!(done.files_written, 1); + assert_eq!(fs::read(dir.join("Game.exe")).unwrap(), sample()[1].1); + let _ = fs::remove_dir_all(&dir); +} + +#[test] +fn reports_the_archive_size() { + let server = serve(build_zip(&sample()).bytes); + let answer = size(&server.url).unwrap(); + assert_eq!(answer["fileCount"], 4); + let expected: usize = sample().iter().map(|f| f.1.len()).sum(); + assert_eq!(answer["totalBytes"], expected as u64); +} + +#[test] +fn large_records_arrive_in_parallel_parts() { + let dir = temp_dir("parts"); + let server = serve(build_zip(&sample()).bytes); + let before = server.requests.load(Ordering::SeqCst); + let done = run(&request(&server.url, &dir), &AtomicBool::new(false), &Recorder::default()).unwrap(); + assert_eq!(done.files_written, 4); + assert!(server.requests.load(Ordering::SeqCst) - before > 6); + assert_eq!(fs::read(dir.join("Game.exe")).unwrap(), sample()[1].1); + assert!(fs::read_dir(&dir).unwrap().all(|e| !e.unwrap().file_name().to_string_lossy().ends_with(".ddzip"))); + let _ = fs::remove_dir_all(&dir); +} diff --git a/app/src/main/rust/stores/src/ea/mod.rs b/app/src/main/rust/stores/src/ea/mod.rs new file mode 100644 index 0000000000..73ccb48ad4 --- /dev/null +++ b/app/src/main/rust/stores/src/ea/mod.rs @@ -0,0 +1,4 @@ +pub mod ffi; +pub mod install; +pub mod net; +pub mod zip; diff --git a/app/src/main/rust/stores/src/ea/net.rs b/app/src/main/rust/stores/src/ea/net.rs new file mode 100644 index 0000000000..8b31895472 --- /dev/null +++ b/app/src/main/rust/stores/src/ea/net.rs @@ -0,0 +1,98 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +//! Ranged reads of EA's build archives. + +use std::time::Duration; + +use super::zip::{self, Directory, Entry}; + +const CONNECT_TIMEOUT: Duration = Duration::from_secs(30); +const READ_TIMEOUT: Duration = Duration::from_secs(60); +const MAX_DIRECTORY: u64 = 512 * 1024 * 1024; + +pub fn user_agent() -> String { + crate::amazon::net::user_agent() +} + +pub struct Ranged { + pub body: Vec, + pub start: u64, + pub total: u64, +} + +fn content_range(value: &str) -> Option<(u64, u64)> { + let rest = value.trim().strip_prefix("bytes")?.trim_start(); + let (span, total) = rest.split_once('/')?; + let start = span.split_once('-')?.0.trim().parse().ok()?; + Some((start, total.trim().parse().ok()?)) +} + +pub fn get_range(url: &str, range: &str) -> Result { + let runtime = tokio::runtime::Builder::new_current_thread() + .enable_all() + .build() + .map_err(|e| format!("runtime: {e}"))?; + runtime.block_on(async { + let client = reqwest::Client::builder() + .user_agent(user_agent()) + .connect_timeout(CONNECT_TIMEOUT) + .read_timeout(READ_TIMEOUT) + .build() + .map_err(|e| format!("http client: {}", e.without_url()))?; + let response = client + .get(url) + .header(reqwest::header::RANGE, format!("bytes={range}")) + .send() + .await + .map_err(|e| format!("request failed: {}", e.without_url()))?; + let status = response.status().as_u16(); + if status == 403 || status == 404 { + return Err(format!("the download link was refused ({status})")); + } + if status != 206 { + return Err(format!("the server did not answer a ranged read ({status})")); + } + let (start, total) = response + .headers() + .get(reqwest::header::CONTENT_RANGE) + .and_then(|v| v.to_str().ok()) + .and_then(content_range) + .ok_or("the server gave no content range")?; + let body = response.bytes().await.map_err(|e| format!("answer could not be read: {}", e.without_url()))?.to_vec(); + Ok(Ranged { body, start, total }) + }) +} + +pub struct Archive { + pub total: u64, + pub directory: Directory, + pub entries: Vec, +} + +pub fn read_archive(url: &str) -> Result { + let tail = get_range(url, &format!("-{}", zip::TAIL_LEN))?; + let directory = zip::locate(&tail.body, tail.start)?; + if directory.size > MAX_DIRECTORY || directory.offset + directory.size > tail.total { + return Err("The archive directory is out of bounds".into()); + } + let bytes = if directory.offset >= tail.start { + let at = (directory.offset - tail.start) as usize; + let end = at + directory.size as usize; + tail.body.get(at..end).ok_or("The archive directory is cut short")?.to_vec() + } else { + let end = directory.offset + directory.size - 1; + get_range(url, &format!("{}-{end}", directory.offset))?.body + }; + let entries = zip::parse(&bytes, directory.entries)?; + Ok(Archive { total: tail.total, directory, entries }) +} + +#[cfg(test)] +mod tests { + use super::content_range; + + #[test] + fn reads_content_range() { + assert_eq!(content_range("bytes 100-199/5000"), Some((100, 5000))); + assert_eq!(content_range("bytes */5000"), None); + } +} diff --git a/app/src/main/rust/stores/src/ea/zip.rs b/app/src/main/rust/stores/src/ea/zip.rs new file mode 100644 index 0000000000..d7a8203e73 --- /dev/null +++ b/app/src/main/rust/stores/src/ea/zip.rs @@ -0,0 +1,288 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +//! The central directory of a remote ZIP archive, which is how EA publishes a game build. + +const EOCD: u32 = 0x0605_4b50; +const EOCD64: u32 = 0x0606_4b50; +const EOCD64_LOCATOR: u32 = 0x0706_4b50; +const CENTRAL: u32 = 0x0201_4b50; +const LOCAL: u32 = 0x0403_4b50; +const EOCD_LEN: usize = 22; +const LOCATOR_LEN: usize = 20; +const EOCD64_LEN: usize = 56; +pub const LOCAL_FIXED: usize = 30; +pub const TAIL_LEN: u64 = 128 * 1024; + +pub const STORED: u16 = 0; +pub const DEFLATED: u16 = 8; + +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct Entry { + pub name: String, + pub crc32: u32, + pub method: u16, + pub compressed: u64, + pub size: u64, + pub local_offset: u64, +} + +impl Entry { + pub fn is_dir(&self) -> bool { + self.name.ends_with('/') || self.name.ends_with('\\') + } +} + +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub struct Directory { + pub offset: u64, + pub size: u64, + pub entries: u64, +} + +fn u16_at(b: &[u8], at: usize) -> Option { + b.get(at..at + 2).map(|s| u16::from_le_bytes([s[0], s[1]])) +} + +fn u32_at(b: &[u8], at: usize) -> Option { + b.get(at..at + 4).map(|s| u32::from_le_bytes([s[0], s[1], s[2], s[3]])) +} + +fn u64_at(b: &[u8], at: usize) -> Option { + b.get(at..at + 8).map(|s| u64::from_le_bytes(s.try_into().unwrap_or([0; 8]))) +} + +/// Finds the central directory from the last bytes of the archive. `tail_start` is where `tail` +/// begins in the whole file. +pub fn locate(tail: &[u8], tail_start: u64) -> Result { + if tail.len() < EOCD_LEN { + return Err("The archive is too short to be a ZIP".into()); + } + let mut at = tail.len() - EOCD_LEN; + let found = loop { + if u32_at(tail, at) == Some(EOCD) { + let comment = u16_at(tail, at + 20).unwrap_or(0) as usize; + if at + EOCD_LEN + comment <= tail.len() { + break at; + } + } + if at == 0 { + return Err("The archive has no end of central directory".into()); + } + at -= 1; + }; + let entries = u16_at(tail, found + 10).unwrap_or(0) as u64; + let size = u32_at(tail, found + 12).unwrap_or(0) as u64; + let offset = u32_at(tail, found + 16).unwrap_or(0) as u64; + let wide = entries == 0xFFFF || size == 0xFFFF_FFFF || offset == 0xFFFF_FFFF; + if !wide { + return Ok(Directory { offset, size, entries }); + } + let locator = found.checked_sub(LOCATOR_LEN).filter(|&l| u32_at(tail, l) == Some(EOCD64_LOCATOR)); + let Some(locator) = locator else { + return Err("The archive needs ZIP64 but has no ZIP64 locator".into()); + }; + let record_at = u64_at(tail, locator + 8).unwrap_or(0); + let Some(rel) = record_at.checked_sub(tail_start).map(|r| r as usize) else { + return Err("The ZIP64 directory record lies before the fetched tail".into()); + }; + if u32_at(tail, rel) != Some(EOCD64) || rel + EOCD64_LEN > tail.len() { + return Err("The ZIP64 directory record is damaged".into()); + } + Ok(Directory { + entries: u64_at(tail, rel + 32).unwrap_or(0), + size: u64_at(tail, rel + 40).unwrap_or(0), + offset: u64_at(tail, rel + 48).unwrap_or(0), + }) +} + +fn wide_values(extra: &[u8], need_size: bool, need_compressed: bool, need_offset: bool) -> (Option, Option, Option) { + let mut at = 0; + while at + 4 <= extra.len() { + let id = u16_at(extra, at).unwrap_or(0); + let len = u16_at(extra, at + 2).unwrap_or(0) as usize; + let body = &extra[(at + 4).min(extra.len())..(at + 4 + len).min(extra.len())]; + if id == 0x0001 { + let mut p = 0; + let mut take = |want: bool| { + if !want { + return None; + } + let v = u64_at(body, p); + p += 8; + v + }; + let size = take(need_size); + let compressed = take(need_compressed); + let offset = take(need_offset); + return (size, compressed, offset); + } + at += 4 + len; + } + (None, None, None) +} + +pub fn parse(directory: &[u8], expected: u64) -> Result, String> { + let mut entries = Vec::with_capacity(expected.min(1 << 20) as usize); + let mut at = 0usize; + while at + 46 <= directory.len() { + if u32_at(directory, at) != Some(CENTRAL) { + break; + } + let flags = u16_at(directory, at + 8).unwrap_or(0); + let method = u16_at(directory, at + 10).unwrap_or(0); + let crc32 = u32_at(directory, at + 16).unwrap_or(0); + let compressed32 = u32_at(directory, at + 20).unwrap_or(0); + let size32 = u32_at(directory, at + 24).unwrap_or(0); + let name_len = u16_at(directory, at + 28).unwrap_or(0) as usize; + let extra_len = u16_at(directory, at + 30).unwrap_or(0) as usize; + let comment_len = u16_at(directory, at + 32).unwrap_or(0) as usize; + let offset32 = u32_at(directory, at + 42).unwrap_or(0); + let name_at = at + 46; + let end = name_at + name_len + extra_len + comment_len; + if end > directory.len() { + return Err("The archive directory is cut short".into()); + } + let raw = &directory[name_at..name_at + name_len]; + let name = if flags & 0x0800 != 0 { + String::from_utf8_lossy(raw).into_owned() + } else { + raw.iter().map(|&b| b as char).collect() + }; + let extra = &directory[name_at + name_len..name_at + name_len + extra_len]; + let (size, compressed, offset) = + wide_values(extra, size32 == 0xFFFF_FFFF, compressed32 == 0xFFFF_FFFF, offset32 == 0xFFFF_FFFF); + if flags & 0x0001 != 0 { + return Err(format!("{name} is encrypted")); + } + entries.push(Entry { + name, + crc32, + method, + compressed: compressed.unwrap_or(compressed32 as u64), + size: size.unwrap_or(size32 as u64), + local_offset: offset.unwrap_or(offset32 as u64), + }); + at = end; + } + if expected != 0 && entries.len() as u64 != expected { + return Err(format!("The archive directory lists {} of {expected} entries", entries.len())); + } + Ok(entries) +} + +/// Bytes before the compressed data of an entry, read from its local header. +pub fn local_header_len(header: &[u8]) -> Option> { + if header.len() < LOCAL_FIXED { + return None; + } + if u32_at(header, 0) != Some(LOCAL) { + return Some(Err("An entry has no local header where the directory points".into())); + } + let name = u16_at(header, 26).unwrap_or(0) as usize; + let extra = u16_at(header, 28).unwrap_or(0) as usize; + Some(Ok(LOCAL_FIXED + name + extra)) +} + +/// A relative path inside the install folder, or None for names that would leave it. +pub fn safe_path(name: &str) -> Option { + let unified = name.replace('\\', "/"); + if unified.starts_with('/') || unified.contains(':') || unified.contains('\0') { + return None; + } + let parts: Vec<&str> = unified.split('/').filter(|p| !p.is_empty() && *p != ".").collect(); + if parts.is_empty() || parts.iter().any(|p| *p == "..") { + return None; + } + Some(parts.join("/")) +} + +#[cfg(test)] +mod tests { + use super::*; + + fn central(name: &str, method: u16, crc: u32, compressed: u32, size: u32, offset: u32, extra: &[u8]) -> Vec { + let mut v = Vec::new(); + v.extend_from_slice(&CENTRAL.to_le_bytes()); + v.extend_from_slice(&[20, 0, 20, 0, 0, 0]); + v.extend_from_slice(&method.to_le_bytes()); + v.extend_from_slice(&[0, 0, 0, 0]); + v.extend_from_slice(&crc.to_le_bytes()); + v.extend_from_slice(&compressed.to_le_bytes()); + v.extend_from_slice(&size.to_le_bytes()); + v.extend_from_slice(&(name.len() as u16).to_le_bytes()); + v.extend_from_slice(&(extra.len() as u16).to_le_bytes()); + v.extend_from_slice(&[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); + v.extend_from_slice(&offset.to_le_bytes()); + v.extend_from_slice(name.as_bytes()); + v.extend_from_slice(extra); + v + } + + #[test] + fn reads_a_plain_directory() { + let mut dir = central("Game.exe", DEFLATED, 7, 10, 20, 0, &[]); + dir.extend(central("__Installer/", STORED, 0, 0, 0, 40, &[])); + let mut tail = vec![0u8; 5]; + tail.extend_from_slice(&dir); + let cd_size = dir.len() as u32; + tail.extend_from_slice(&EOCD.to_le_bytes()); + tail.extend_from_slice(&[0, 0, 0, 0, 2, 0, 2, 0]); + tail.extend_from_slice(&cd_size.to_le_bytes()); + tail.extend_from_slice(&1000u32.to_le_bytes()); + tail.extend_from_slice(&[0, 0]); + let found = locate(&tail, 995).unwrap(); + assert_eq!(found, Directory { offset: 1000, size: cd_size as u64, entries: 2 }); + let entries = parse(&dir, 2).unwrap(); + assert_eq!(entries[0].name, "Game.exe"); + assert_eq!(entries[0].size, 20); + assert!(entries[1].is_dir()); + } + + #[test] + fn reads_zip64_values() { + let mut extra = vec![1, 0, 24, 0]; + extra.extend_from_slice(&6_000_000_000u64.to_le_bytes()); + extra.extend_from_slice(&5_000_000_000u64.to_le_bytes()); + extra.extend_from_slice(&7_000_000_000u64.to_le_bytes()); + let dir = central("big.pak", DEFLATED, 1, 0xFFFF_FFFF, 0xFFFF_FFFF, 0xFFFF_FFFF, &extra); + let e = &parse(&dir, 1).unwrap()[0]; + assert_eq!((e.size, e.compressed, e.local_offset), (6_000_000_000, 5_000_000_000, 7_000_000_000)); + + let mut tail = Vec::new(); + let record_at = 9_000_000_000u64; + tail.extend_from_slice(&EOCD64.to_le_bytes()); + tail.extend_from_slice(&44u64.to_le_bytes()); + tail.extend_from_slice(&[45, 0, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0]); + tail.extend_from_slice(&3u64.to_le_bytes()); + tail.extend_from_slice(&3u64.to_le_bytes()); + tail.extend_from_slice(&500u64.to_le_bytes()); + tail.extend_from_slice(&8_000_000_000u64.to_le_bytes()); + tail.extend_from_slice(&EOCD64_LOCATOR.to_le_bytes()); + tail.extend_from_slice(&0u32.to_le_bytes()); + tail.extend_from_slice(&record_at.to_le_bytes()); + tail.extend_from_slice(&1u32.to_le_bytes()); + tail.extend_from_slice(&EOCD.to_le_bytes()); + tail.extend_from_slice(&[0, 0, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0]); + let found = locate(&tail, record_at).unwrap(); + assert_eq!(found, Directory { offset: 8_000_000_000, size: 500, entries: 3 }); + } + + #[test] + fn refuses_paths_that_leave_the_folder() { + assert_eq!(safe_path("Data\\Win32\\a.big").as_deref(), Some("Data/Win32/a.big")); + assert_eq!(safe_path("./x//y").as_deref(), Some("x/y")); + assert!(safe_path("../evil").is_none()); + assert!(safe_path("/etc/passwd").is_none()); + assert!(safe_path("C:/x").is_none()); + assert!(safe_path("a/../../b").is_none()); + } + + #[test] + fn local_header_length_counts_name_and_extra() { + let mut h = LOCAL.to_le_bytes().to_vec(); + h.extend_from_slice(&[0u8; 22]); + h.extend_from_slice(&5u16.to_le_bytes()); + h.extend_from_slice(&9u16.to_le_bytes()); + assert_eq!(local_header_len(&h), Some(Ok(44))); + assert_eq!(local_header_len(&h[..10]), None); + } +} diff --git a/app/src/main/rust/stores/src/lib.rs b/app/src/main/rust/stores/src/lib.rs index 87d278ab06..12a351138f 100644 --- a/app/src/main/rust/stores/src/lib.rs +++ b/app/src/main/rust/stores/src/lib.rs @@ -3,6 +3,8 @@ #![allow(clippy::missing_safety_doc, clippy::result_large_err)] pub mod amazon; +pub mod ubisoft; +pub mod ea; pub mod epic; pub mod fetch_core; pub mod fetch_tuning; diff --git a/app/src/main/rust/stores/src/ubisoft/demux.rs b/app/src/main/rust/stores/src/ubisoft/demux.rs new file mode 100644 index 0000000000..b54fee4430 --- /dev/null +++ b/app/src/main/rust/stores/src/ubisoft/demux.rs @@ -0,0 +1,154 @@ +use std::sync::Arc; +use std::time::Duration; + +use tokio::io::{AsyncReadExt, AsyncWriteExt}; +use tokio::net::TcpStream; +use tokio_rustls::client::TlsStream; +use tokio_rustls::rustls::{self, pki_types::ServerName, ClientConfig, RootCertStore}; +use tokio_rustls::TlsConnector; + +use super::pb::{self, Msg}; + +const HOST: &str = "dmx.upc.ubisoft.com"; +const PORT: u16 = 443; +const CLIENT_ID: &str = "uplay_pc"; +/// The Connect build number Demux expects first on a socket; older ones get ClientOutdatedPush and a closed socket. +pub const CLIENT_VERSION: u32 = 13247; +const READ_TIMEOUT: Duration = Duration::from_secs(20); +const MAX_FRAME: usize = 64 << 20; + +pub struct Demux { + tls: TlsStream, + next_id: u32, +} + +impl Demux { + pub async fn connect(ticket: &str) -> Result { + let mut roots = RootCertStore::empty(); + roots.extend(webpki_roots::TLS_SERVER_ROOTS.iter().cloned()); + let provider = Arc::new(rustls::crypto::ring::default_provider()); + let config = ClientConfig::builder_with_provider(provider) + .with_safe_default_protocol_versions() + .map_err(|e| format!("TLS setup: {e}"))? + .with_root_certificates(roots) + .with_no_client_auth(); + let tcp = tokio::time::timeout(READ_TIMEOUT, TcpStream::connect((HOST, PORT))) + .await + .map_err(|_| "Ubisoft's download service did not answer".to_string())? + .map_err(|e| format!("Could not reach Ubisoft's download service: {e}"))?; + let name = ServerName::try_from(HOST).map_err(|e| e.to_string())?.to_owned(); + let tls = TlsConnector::from(Arc::new(config)) + .connect(name, tcp) + .await + .map_err(|e| format!("TLS with Ubisoft's download service failed: {e}"))?; + let mut d = Demux { tls, next_id: 1 }; + d.send(Msg::new().msg(2, Msg::new().msg(4, Msg::new().uint(1, CLIENT_VERSION as u64)))).await?; + let id = d.id(); + let auth = Msg::new().uint(1, id as u64).msg( + 2, + Msg::new() + .msg(1, Msg::new().text(3, ticket)) + .text(2, CLIENT_ID) + .flag(4, false), + ); + d.send(Msg::new().msg(1, auth)).await?; + let rsp = d.response(id).await?; + let a = pb::fields(pb::sub(&pb::fields(&rsp)?, 2).ok_or("Ubisoft did not answer the sign-in")?)?; + if pb::num(&a, 1) != Some(1) { + let expired = pb::num(&a, 2) == Some(1); + return Err(if expired { "The Ubisoft sign-in expired".into() } else { "Ubisoft refused the sign-in".into() }); + } + Ok(d) + } + + fn id(&mut self) -> u32 { + let id = self.next_id; + self.next_id += 1; + id + } + + async fn send(&mut self, up: Msg) -> Result<(), String> { + let len = (up.0.len() as u32).to_be_bytes(); + self.tls.write_all(&len).await.map_err(|e| e.to_string())?; + self.tls.write_all(&up.0).await.map_err(|e| e.to_string())?; + self.tls.flush().await.map_err(|e| e.to_string()) + } + + async fn frame(&mut self) -> Result, String> { + let read = async { + let mut len = [0u8; 4]; + self.tls.read_exact(&mut len).await.map_err(|e| format!("Ubisoft closed the connection: {e}"))?; + let n = u32::from_be_bytes(len) as usize; + if n > MAX_FRAME { + return Err(format!("Ubisoft sent a {n}-byte frame")); + } + let mut body = vec![0u8; n]; + self.tls.read_exact(&mut body).await.map_err(|e| e.to_string())?; + Ok(body) + }; + tokio::time::timeout(READ_TIMEOUT, read).await.map_err(|_| "Ubisoft's download service stopped answering".to_string())? + } + + fn check_push(down: &[(u32, pb::Value<'_>)]) -> Result<(), String> { + if let Some(push) = pb::sub(down, 2) { + let p = pb::fields(push)?; + if pb::first(&p, 5).is_some() { + return Err("Ubisoft says this client version is outdated".into()); + } + } + Ok(()) + } + + async fn response(&mut self, id: u32) -> Result, String> { + for _ in 0..64 { + let frame = self.frame().await?; + let down = pb::fields(&frame)?; + Self::check_push(&down)?; + if let Some(rsp) = pb::sub(&down, 1) { + if pb::num(&pb::fields(rsp)?, 1) == Some(id as u64) { + return Ok(rsp.to_vec()); + } + } + } + Err("Ubisoft never answered the request".into()) + } + + pub async fn open(&mut self, service: &str) -> Result { + let id = self.id(); + self.send(Msg::new().msg(1, Msg::new().uint(1, id as u64).msg(3, Msg::new().text(2, service)))).await?; + let rsp = self.response(id).await?; + let o = pb::fields(pb::sub(&pb::fields(&rsp)?, 3).ok_or("no connection answer")?)?; + if pb::num(&o, 2) != Some(1) { + return Err(format!("Ubisoft refused the {service} connection")); + } + pb::num(&o, 1).map(|c| c as u32).ok_or_else(|| "no connection id".into()) + } + + /// One service request on a connection; the payload is length-prefixed inside the DataMessage both ways. + pub async fn call(&mut self, connection: u32, payload: Msg) -> Result, String> { + let mut framed = (payload.0.len() as u32).to_be_bytes().to_vec(); + framed.extend_from_slice(&payload.0); + self.send(Msg::new().msg(2, Msg::new().msg(1, Msg::new().uint(1, connection as u64).bytes(2, &framed)))).await?; + for _ in 0..64 { + let frame = self.frame().await?; + let down = pb::fields(&frame)?; + Self::check_push(&down)?; + let Some(push) = pb::sub(&down, 2) else { continue }; + let p = pb::fields(push)?; + if let Some(closed) = pb::sub(&p, 2) { + let c = pb::fields(closed)?; + if pb::num(&c, 1) == Some(connection as u64) { + return Err(format!("Ubisoft closed the service connection (code {})", pb::num(&c, 2).unwrap_or(0))); + } + } + let Some(data) = pb::sub(&p, 1) else { continue }; + let d = pb::fields(data)?; + if pb::num(&d, 1) != Some(connection as u64) { + continue; + } + let body = pb::sub(&d, 2).unwrap_or_default(); + return Ok(if body.len() >= 4 { body[4..].to_vec() } else { body.to_vec() }); + } + Err("Ubisoft never answered the service request".into()) + } +} diff --git a/app/src/main/rust/stores/src/ubisoft/ffi.rs b/app/src/main/rust/stores/src/ubisoft/ffi.rs new file mode 100644 index 0000000000..30df1ccd4f --- /dev/null +++ b/app/src/main/rust/stores/src/ubisoft/ffi.rs @@ -0,0 +1,269 @@ +use std::panic::{catch_unwind, AssertUnwindSafe}; +use std::sync::atomic::{AtomicBool, Ordering}; +use std::sync::Arc; + +use jni::objects::{GlobalRef, JClass, JObject, JString, JValue}; +use jni::sys::{jlong, jstring, JNI_FALSE, JNI_TRUE}; +use jni::{JNIEnv, JavaVM}; +use serde_json::json; + +use super::install; +use crate::amazon::install::{Events, Stop}; + +fn read_string(env: &mut JNIEnv, value: &JString) -> String { + if value.is_null() { + return String::new(); + } + env.get_string(value).map(|s| s.to_string_lossy().into_owned()).unwrap_or_default() +} + +fn new_string(env: &mut JNIEnv, text: &str) -> jstring { + env.new_string(text).map(|s| s.into_raw()).unwrap_or(std::ptr::null_mut()) +} + +fn owned(ticket: &str, session: &str) -> Result { + let rt = tokio::runtime::Builder::new_current_thread().enable_all().build().map_err(|e| e.to_string())?; + rt.block_on(async { + let mut d = super::demux::Demux::connect(ticket).await?; + let (mut ownership, mut games) = super::service::Ownership::open(&mut d, ticket, session).await?; + let missing: Vec = games.iter().filter(|g| g.owned && g.product_type == 0 && g.manifest.is_empty()).map(|g| g.product_id).collect(); + let (found, manifest_error) = match ownership.latest_manifests(&mut d, &missing).await { + Ok(m) => (m, String::new()), + Err(e) => (Vec::new(), e), + }; + for (product, manifest) in &found { + if let Some(g) = games.iter_mut().find(|g| g.product_id == *product) { + g.manifest = manifest.clone(); + } + } + Ok(json!({ "games": games.iter().map(|g| g.to_json()).collect::>(), + "manifestsAsked": missing.len(), "manifestsFound": found.len(), "manifestError": manifest_error })) + }) +} + +fn launch(ticket: &str, session: &str, product: u32) -> Result { + let rt = tokio::runtime::Builder::new_current_thread().enable_all().build().map_err(|e| e.to_string())?; + rt.block_on(async { + let mut d = super::demux::Demux::connect(ticket).await?; + let (mut ownership, games) = super::service::Ownership::open(&mut d, ticket, session).await?; + if !games.iter().any(|g| g.product_id == product && g.owned) { + return Err("Ubisoft says this account does not own the game".into()); + } + let pc_ticket = ownership.pc_ticket(&mut d, product, ticket, session).await?; + let owned: Vec = games.iter().filter(|g| g.in_session()).map(|g| g.product_id).collect(); + let products: Vec<_> = games.iter().filter(|g| g.in_session()).map(|g| json!({ "id": g.product_id, "type": g.product_type })).collect(); + Ok(json!({ "ticket": pc_ticket, "owned": owned, "products": products })) + }) +} + +fn unhex(s: &str) -> Result, String> { + if s.len() % 2 != 0 { + return Err("odd hex length".into()); + } + (0..s.len()).step_by(2).map(|i| u8::from_str_radix(&s[i..i + 2], 16).map_err(|e| e.to_string())).collect() +} + +fn denuvo(ticket: &str, session: &str, product: u32, challenge: &str) -> Result { + let challenge = unhex(challenge).map_err(|e| format!("challenge: {e}"))?; + let rt = tokio::runtime::Builder::new_current_thread().enable_all().build().map_err(|e| e.to_string())?; + rt.block_on(async { + let mut d = super::demux::Demux::connect(ticket).await?; + let (mut ownership, _) = super::service::Ownership::open(&mut d, ticket, session).await?; + let token = ownership.token(&mut d, product).await?; + let game = super::service::denuvo_token(&mut d, &token, &challenge).await?; + Ok(json!({ "token": game.iter().map(|b| format!("{b:02x}")).collect::() })) + }) +} + +fn call(op: &str, request: &str) -> String { + let parsed: serde_json::Value = serde_json::from_str(request).unwrap_or(serde_json::Value::Null); + let s = |k: &str| parsed.get(k).and_then(|v| v.as_str()).unwrap_or("").to_string(); + let answer = match op { + "owned" => owned(&s("ticket"), &s("sessionId")).unwrap_or_else(|e| json!({ "error": e })), + "denuvo" => denuvo(&s("ticket"), &s("sessionId"), parsed.get("productId").and_then(|v| v.as_u64()).unwrap_or(0) as u32, &s("challenge")) + .unwrap_or_else(|e| json!({ "error": e })), + "chunks" => install::Request::from_json(&parsed) + .and_then(|r| install::chunks(&r)) + .map(|m| json!({ "chunks": install::chunks_json(&m.chunks), "setup": install::setup_json(&m) })) + .unwrap_or_else(|e| json!({ "error": e })), + "launch" => launch(&s("ticket"), &s("sessionId"), parsed.get("productId").and_then(|v| v.as_u64()).unwrap_or(0) as u32) + .unwrap_or_else(|e| json!({ "error": e })), + _ => json!({ "error": format!("unknown operation {op}") }), + }; + answer.to_string() +} + +#[no_mangle] +pub extern "system" fn Java_com_droiddeck_launcher_stores_ubisoft_UbisoftNative_nativeCall( + mut env: JNIEnv, + _class: JClass, + op: JString, + request: JString, +) -> jstring { + let op = read_string(&mut env, &op); + let request = read_string(&mut env, &request); + match catch_unwind(AssertUnwindSafe(|| call(&op, &request))) { + Ok(text) => new_string(&mut env, &text), + Err(_) => std::ptr::null_mut(), + } +} + +struct Listener { + vm: JavaVM, + target: GlobalRef, +} + +impl Listener { + fn with_env(&self, fallback: R, f: impl FnOnce(&mut JNIEnv) -> R) -> R { + let Ok(mut env) = self.vm.attach_current_thread_as_daemon() else { + return fallback; + }; + let out = f(&mut env); + if env.exception_check().unwrap_or(false) { + let _ = env.exception_clear(); + } + out + } + + fn text(&self, method: &str, text: &str) { + self.with_env((), |env| { + let Ok(s) = env.new_string(text) else { return }; + let s = JObject::from(s); + let _ = env.call_method(self.target.as_obj(), method, "(Ljava/lang/String;)V", &[JValue::Object(&s)]); + let _ = env.delete_local_ref(s); + }); + } + + fn counts(&self, method: &str, a: u64, b: u64, c: u32, d: u32) { + self.with_env((), |env| { + let _ = env.call_method( + self.target.as_obj(), + method, + "(JJII)V", + &[ + JValue::Long(a.min(i64::MAX as u64) as i64), + JValue::Long(b.min(i64::MAX as u64) as i64), + JValue::Int(c.min(i32::MAX as u32) as i32), + JValue::Int(d.min(i32::MAX as u32) as i32), + ], + ); + }); + } + + fn complete(&self, success: bool, cancelled: bool, error: &str, result: &str) { + self.with_env((), |env| { + let (Ok(e), Ok(r)) = (env.new_string(error), env.new_string(result)) else { return }; + let (e, r) = (JObject::from(e), JObject::from(r)); + let _ = env.call_method( + self.target.as_obj(), + "onComplete", + "(ZZLjava/lang/String;Ljava/lang/String;)V", + &[ + JValue::Bool(if success { JNI_TRUE } else { JNI_FALSE }), + JValue::Bool(if cancelled { JNI_TRUE } else { JNI_FALSE }), + JValue::Object(&e), + JValue::Object(&r), + ], + ); + let _ = env.delete_local_ref(e); + let _ = env.delete_local_ref(r); + }); + } +} + +impl Events for Listener { + fn log(&self, line: &str) { + self.text("onLog", &crate::amazon::net::scrub_urls(line)); + } + + fn status(&self, text: &str) { + self.text("onStatus", text); + } + + fn checking(&self, done_bytes: u64, total_bytes: u64, files: u32, files_total: u32) { + self.counts("onCheck", done_bytes, total_bytes, files, files_total); + } + + fn sizes(&self, pending_bytes: u64, total_bytes: u64) { + self.with_env((), |env| { + let _ = env.call_method( + self.target.as_obj(), + "onSizes", + "(JJ)V", + &[ + JValue::Long(pending_bytes.min(i64::MAX as u64) as i64), + JValue::Long(total_bytes.min(i64::MAX as u64) as i64), + ], + ); + }); + } + + fn progress(&self, done: u64, total: u64, files: u32, files_total: u32) { + self.counts("onProgress", done, total, files, files_total); + } + + fn before_replace(&self) -> bool { + self.with_env(false, |env| match env.call_method(self.target.as_obj(), "beforeReplace", "()Z", &[]) { + Ok(v) => v.z().unwrap_or(false), + Err(_) => false, + }) + } +} + +#[no_mangle] +pub extern "system" fn Java_com_droiddeck_launcher_stores_ubisoft_UbisoftNative_nativeInstall( + mut env: JNIEnv, + _class: JClass, + request: JString, + listener: JObject, +) -> jlong { + if listener.is_null() { + return 0; + } + let Ok(vm) = env.get_java_vm() else { return 0 }; + let Ok(target) = env.new_global_ref(&listener) else { return 0 }; + let listener = Listener { vm, target }; + let text = read_string(&mut env, &request); + let parsed = serde_json::from_str::(&text) + .map_err(|_| "The install request could not be read".to_string()) + .and_then(|v| install::Request::from_json(&v)); + let request = match parsed { + Ok(r) => r, + Err(e) => { + listener.complete(false, false, &e, ""); + return 0; + } + }; + let cancel = Arc::new(AtomicBool::new(false)); + let worker_cancel = Arc::clone(&cancel); + let spawned = std::thread::Builder::new().name("ubisoft-install".into()).spawn(move || { + crate::priority::background(); + let result = catch_unwind(AssertUnwindSafe(|| install::run(&request, &worker_cancel, &listener))) + .unwrap_or_else(|_| Err(Stop::Failed("The Ubisoft install stopped on an internal error".into()))); + match result { + Ok(done) => listener.complete(true, false, "", &done.to_json().to_string()), + Err(Stop::Cancelled) => listener.complete(false, true, "cancelled", ""), + Err(Stop::Failed(e)) => listener.complete(false, false, &e, ""), + } + }); + if spawned.is_err() { + return 0; + } + Box::into_raw(Box::new(cancel)) as jlong +} + +#[no_mangle] +pub extern "system" fn Java_com_droiddeck_launcher_stores_ubisoft_UbisoftNative_nativeCancel(_env: JNIEnv, _class: JClass, handle: jlong) { + let ptr = handle as *const Arc; + if let Some(cancel) = unsafe { ptr.as_ref() } { + cancel.store(true, Ordering::SeqCst); + } +} + +#[no_mangle] +pub extern "system" fn Java_com_droiddeck_launcher_stores_ubisoft_UbisoftNative_nativeRelease(_env: JNIEnv, _class: JClass, handle: jlong) { + let ptr = handle as *mut Arc; + if !ptr.is_null() { + drop(unsafe { Box::from_raw(ptr) }); + } +} diff --git a/app/src/main/rust/stores/src/ubisoft/install.rs b/app/src/main/rust/stores/src/ubisoft/install.rs new file mode 100644 index 0000000000..fdb4357fab --- /dev/null +++ b/app/src/main/rust/stores/src/ubisoft/install.rs @@ -0,0 +1,408 @@ +use std::collections::HashMap; +use std::io::{Read, Seek, SeekFrom, Write}; +use std::path::{Component, Path, PathBuf}; +use std::sync::atomic::{AtomicBool, AtomicU64, Ordering}; +use std::sync::Mutex; +use std::time::{Duration, Instant}; + +use futures_util::stream::{self, StreamExt}; +use serde_json::{json, Value as Json}; +use sha1::{Digest, Sha1}; + +use super::demux::Demux; +use super::manifest::{self, File}; +use super::service::{Downloads, Ownership}; +use crate::amazon::install::{Events, Stop}; + +const SIGN_BATCH: usize = 200; +const WINDOW: usize = 16; +const TRIES: usize = 4; + +pub struct Request { + pub ticket: String, + pub session_id: String, + pub product_id: u32, + pub manifest: String, + pub folder: PathBuf, + pub language: String, +} + +impl Request { + pub fn from_json(v: &Json) -> Result { + let s = |k: &str| v.get(k).and_then(|x| x.as_str()).unwrap_or("").to_string(); + let product_id = v.get("productId").and_then(|x| x.as_u64()).ok_or("no product id")? as u32; + let folder = PathBuf::from(s("folder")); + if s("ticket").is_empty() || folder.as_os_str().is_empty() { + return Err("The install request is incomplete".into()); + } + Ok(Request { ticket: s("ticket"), session_id: s("sessionId"), product_id, manifest: s("manifest"), folder, language: s("language") }) + } +} + +pub struct Done { + pub files: usize, + pub bytes: u64, + pub chunks: Vec, + pub setup: Json, +} + +pub fn chunks_json(chunks: &[manifest::Chunk]) -> Json { + Json::Array(chunks.iter().map(|c| json!({ "id": c.id, "tags": c.tags })).collect()) +} + +pub fn setup_json(m: &manifest::Manifest) -> Json { + json!({ + "installRuns": m.install_runs.iter().map(|(exe, args, what)| json!({ "exe": exe, "arguments": args, "description": what })).collect::>(), + "registry": m.registry.iter().map(|(key, values)| json!({ "key": key, "values": values.iter().map(|(n, v)| json!({ "name": n, "value": v })).collect::>() })).collect::>(), + }) +} + +impl Done { + pub fn to_json(&self) -> Json { + json!({ "files": self.files, "bytes": self.bytes, "chunks": chunks_json(&self.chunks), "setup": self.setup.clone() }) + } +} + +pub fn safe_path(root: &Path, name: &str) -> Result { + let rel = Path::new(name.trim_start_matches('/')); + if rel.components().any(|c| !matches!(c, Component::Normal(_))) { + return Err(format!("The manifest names an unsafe path: {name}")); + } + Ok(root.join(rel)) +} + +fn sha1(b: &[u8]) -> Vec { + Sha1::digest(b).to_vec() +} + +/// The slice as served and as unpacked must both match the manifest, so a bad proxy or a truncated body never lands in the game. +pub fn checked(method: u64, raw: &[u8], s: &manifest::Slice) -> Result, String> { + if let Some(n) = s.download_size { + if raw.len() as u32 != n { + return Err(format!("a slice is {} bytes, the manifest says {n}", raw.len())); + } + } + if !s.download_sha1.is_empty() && sha1(raw) != s.download_sha1 { + return Err("a slice failed its download checksum".into()); + } + let out = manifest::decompress(method, raw)?; + if s.size != 0 && out.len() as u32 != s.size { + return Err(format!("a slice unpacked to {} bytes, the manifest says {}", out.len(), s.size)); + } + if s.content_sha1.len() == 20 && sha1(&out) != s.content_sha1 { + return Err("a slice failed its content checksum".into()); + } + Ok(out) +} + +/// Whether a file of the right size already holds every slice the manifest lists for it; a file that cannot be checked is fetched again. +fn already_installed(path: &Path, f: &File) -> bool { + if f.slices.iter().any(|s| s.content_sha1.len() != 20 || s.size == 0) { + return false; + } + let Ok(mut file) = std::fs::File::open(path) else { return false }; + let mut buf = Vec::new(); + f.slices.iter().all(|s| { + buf.resize(s.size as usize, 0); + file.seek(SeekFrom::Start(s.offset)).is_ok() && file.read_exact(&mut buf).is_ok() && sha1(&buf) == s.content_sha1 + }) +} + +fn slice_hash(s: &manifest::Slice) -> String { + manifest::hex_upper(if s.download_sha1.is_empty() { &s.content_sha1 } else { &s.download_sha1 }) +} + +struct Job { + file: usize, + slice: usize, + path: String, +} + +async fn fetch(client: &reqwest::Client, urls: &[String]) -> Result, String> { + let mut last = String::from("no URL"); + for attempt in 0..TRIES { + for u in urls { + match client.get(u).send().await { + Ok(r) if r.status().is_success() => match r.bytes().await { + Ok(b) => return Ok(b.to_vec()), + Err(e) => last = e.to_string(), + }, + Ok(r) => last = format!("HTTP {}", r.status().as_u16()), + Err(e) => last = e.to_string(), + } + } + tokio::time::sleep(Duration::from_millis(500 << attempt)).await; + } + Err(format!("a slice could not be downloaded ({last})")) +} + +/// A Demux login holding a download_service connection for one product. Ubisoft drops idle sockets +/// while slices download, so signing reconnects and retries when the connection is gone. +struct Session { + d: Demux, + dl: Downloads, +} + +const RECONNECTS: usize = 4; + +impl Session { + /// Opens a session, retrying a few times: Demux drops a connection now and then right after another closes. + async fn open(req: &Request) -> Result<(Self, Vec), String> { + let mut last = String::new(); + for attempt in 0..3u32 { + if attempt > 0 { + tokio::time::sleep(Duration::from_secs(2 << attempt)).await; + } + match Self::open_once(req).await { + Ok(s) => return Ok(s), + Err(e) => last = e, + } + } + Err(last) + } + + async fn open_once(req: &Request) -> Result<(Self, Vec), String> { + let mut d = Demux::connect(&req.ticket).await?; + let (mut own, owned) = Ownership::open(&mut d, &req.ticket, &req.session_id).await?; + let token = own.token(&mut d, req.product_id).await?; + let dl = Downloads::open(&mut d, &token).await?; + Ok((Session { d, dl }, owned)) + } + + async fn sign(&mut self, req: &Request, paths: &[String], events: &dyn Events) -> Result>, String> { + let mut last = String::new(); + for attempt in 0..=RECONNECTS { + if attempt > 0 { + events.log(&format!("ubisoft: reconnecting after: {last}")); + tokio::time::sleep(Duration::from_millis(500 << attempt.min(4))).await; + match Session::open(req).await { + Ok((fresh, _)) => *self = fresh, + Err(e) => { + last = e; + continue; + } + } + } + match self.dl.sign(&mut self.d, req.product_id, paths).await { + Ok(urls) => return Ok(urls), + Err(e) if e.contains("does not own") => return Err(e), + Err(e) => last = e, + } + } + Err(last) + } +} + +/// The manifest of an install, without downloading the game. +pub fn chunks(req: &Request) -> Result { + let rt = tokio::runtime::Builder::new_current_thread().enable_all().build().map_err(|e| e.to_string())?; + rt.block_on(async { + let (mut sess, owned) = Session::open(req).await?; + let manifest_id = if req.manifest.is_empty() { + owned.iter().find(|o| o.product_id == req.product_id).map(|o| o.manifest.clone()).unwrap_or_default() + } else { + req.manifest.clone() + }; + if manifest_id.is_empty() { + return Err("Ubisoft lists no download for this game".to_string()); + } + let client = reqwest::Client::builder().timeout(Duration::from_secs(120)).build().map_err(|e| e.to_string())?; + struct Quiet; + impl Events for Quiet { + fn log(&self, _: &str) {} + fn status(&self, _: &str) {} + fn checking(&self, _: u64, _: u64, _: u32, _: u32) {} + fn sizes(&self, _: u64, _: u64) {} + fn progress(&self, _: u64, _: u64, _: u32, _: u32) {} + fn before_replace(&self) -> bool { false } + } + let urls = sess.sign(req, &[format!("manifests/{manifest_id}.manifest")], &Quiet).await?; + let raw = fetch(&client, urls.first().map(|v| v.as_slice()).unwrap_or_default()).await?; + let language = if req.language.is_empty() { "en-US" } else { req.language.as_str() }; + let mut owned_ids: Vec = owned.iter().filter(|o| o.owned).map(|o| o.product_id).collect(); + owned_ids.push(req.product_id); + Ok(manifest::parse_owned(&manifest::decode(&raw)?, language, &owned_ids)?) + }) +} + +pub fn run(req: &Request, cancel: &AtomicBool, events: &dyn Events) -> Result { + let rt = tokio::runtime::Builder::new_current_thread().enable_all().build().map_err(|e| Stop::Failed(e.to_string()))?; + rt.block_on(install(req, cancel, events)) +} + +async fn install(req: &Request, cancel: &AtomicBool, events: &dyn Events) -> Result { + let fail = Stop::Failed; + events.status("Connecting to Ubisoft"); + let (mut sess, owned) = Session::open(req).await.map_err(fail)?; + let manifest_id = if req.manifest.is_empty() { + owned.iter().find(|o| o.product_id == req.product_id).map(|o| o.manifest.clone()).unwrap_or_default() + } else { + req.manifest.clone() + }; + if manifest_id.is_empty() { + return Err(Stop::Failed("Ubisoft lists no download for this game".into())); + } + let client = reqwest::Client::builder().timeout(Duration::from_secs(120)).build().map_err(|e| Stop::Failed(e.to_string()))?; + + events.status("Reading the game's file list"); + let urls = sess.sign(req, &[format!("manifests/{manifest_id}.manifest")], events).await.map_err(fail)?; + let raw = fetch(&client, urls.first().map(|v| v.as_slice()).unwrap_or_default()).await.map_err(fail)?; + let decoded = manifest::decode(&raw).map_err(fail)?; + let language = if req.language.is_empty() { "en-US" } else { req.language.as_str() }; + let mut owned_ids: Vec = owned.iter().filter(|o| o.owned).map(|o| o.product_id).collect(); + owned_ids.push(req.product_id); + let m = manifest::parse_owned(&decoded, language, &owned_ids).map_err(fail)?; + events.log(&format!("ubisoft: manifest {manifest_id} files={} chunks={} skipped={} compression={}", m.files.len(), m.chunks.len(), m.skipped.len(), m.compression)); + for name in &m.skipped { + if let Ok(path) = safe_path(&req.folder, name) { + if path.is_file() && std::fs::remove_file(&path).is_ok() { + events.log(&format!("ubisoft: removed {name}, which this install leaves out")); + } + } + } + + std::fs::create_dir_all(&req.folder).map_err(|e| Stop::Failed(format!("Could not create the game folder: {e}")))?; + let total: u64 = m.files.iter().map(|f| f.size).sum(); + let files_total = m.files.len() as u32; + let mut pending: Vec = Vec::new(); + let mut done_bytes = 0u64; + let mut done_files = 0u32; + for (i, f) in m.files.iter().enumerate() { + let path = safe_path(&req.folder, &f.name).map_err(fail)?; + if f.dir { + std::fs::create_dir_all(&path).map_err(|e| Stop::Failed(e.to_string()))?; + done_files += 1; + continue; + } + if std::fs::metadata(&path).map(|md| md.len() == f.size).unwrap_or(false) && already_installed(&path, f) { + done_bytes += f.size; + done_files += 1; + continue; + } + pending.push(i); + } + let pending_bytes: u64 = pending.iter().map(|&i| m.files[i].size).sum(); + events.sizes(pending_bytes, total); + events.log(&format!("ubisoft: {} of {} files to fetch, {pending_bytes} bytes", pending.len(), m.files.len())); + + let bucketed = match pending.iter().flat_map(|&i| m.files[i].slices.first()).next() { + None => true, + Some(s) => { + let h = slice_hash(s); + let probe = sess.sign(req, &[manifest::slice_path(true, &h), manifest::slice_path(false, &h)], events).await.map_err(fail)?; + let mut v3 = true; + for (layout, list) in [true, false].into_iter().zip(probe.iter()) { + if let Some(u) = list.first() { + if client.get(u).send().await.map(|r| r.status().is_success()).unwrap_or(false) { + v3 = layout; + break; + } + } + } + v3 + } + }; + + let mut parts: HashMap> = HashMap::new(); + let mut remaining: HashMap = HashMap::new(); + let mut jobs = Vec::new(); + for &i in &pending { + let f: &File = &m.files[i]; + let path = safe_path(&req.folder, &f.name).map_err(fail)?; + if let Some(parent) = path.parent() { + std::fs::create_dir_all(parent).map_err(|e| Stop::Failed(e.to_string()))?; + } + let part = path.with_extension(format!("{}part", path.extension().map(|e| format!("{}.", e.to_string_lossy())).unwrap_or_default())); + let file = std::fs::File::create(&part).map_err(|e| Stop::Failed(format!("Could not write {}: {e}", f.name)))?; + file.set_len(f.size).map_err(|e| Stop::Failed(e.to_string()))?; + parts.insert(i, Mutex::new(file)); + remaining.insert(i, f.slices.len()); + for (si, s) in f.slices.iter().enumerate() { + jobs.push(Job { file: i, slice: si, path: manifest::slice_path(bucketed, &slice_hash(s)) }); + } + } + + let progress = AtomicU64::new(done_bytes); + let mut finished_files = done_files; + let mut last_report = Instant::now(); + events.status("Downloading"); + for batch in jobs.chunks(SIGN_BATCH) { + if cancel.load(Ordering::SeqCst) { + return Err(Stop::Cancelled); + } + let paths: Vec = batch.iter().map(|j| j.path.clone()).collect(); + let signed = sess.sign(req, &paths, events).await.map_err(fail)?; + let mut slices = stream::iter(batch.iter().zip(signed.into_iter())) + .map(|(job, urls)| { + let client = &client; + let m = &m; + async move { + let s = &m.files[job.file].slices[job.slice]; + let raw = fetch(client, &urls).await?; + let out = checked(m.compression, &raw, s).map_err(|e| format!("{}: {e}", m.files[job.file].name))?; + Ok::<_, String>((job.file, job.slice, out)) + } + }) + .buffer_unordered(WINDOW); + while let Some(r) = slices.next().await { + if cancel.load(Ordering::SeqCst) { + return Err(Stop::Cancelled); + } + let (fi, si, data) = r.map_err(fail)?; + let s = &m.files[fi].slices[si]; + { + let mut f = parts[&fi].lock().unwrap(); + f.seek(SeekFrom::Start(s.offset)).and_then(|_| f.write_all(&data)).map_err(|e| Stop::Failed(format!("Could not write {}: {e}", m.files[fi].name)))?; + } + progress.fetch_add(data.len() as u64, Ordering::Relaxed); + let left = remaining.get_mut(&fi).unwrap(); + *left -= 1; + if *left == 0 { + let f = parts.remove(&fi).unwrap().into_inner().unwrap(); + f.sync_all().map_err(|e| Stop::Failed(e.to_string()))?; + drop(f); + let path = safe_path(&req.folder, &m.files[fi].name).map_err(fail)?; + let part = path.with_extension(format!("{}part", path.extension().map(|e| format!("{}.", e.to_string_lossy())).unwrap_or_default())); + std::fs::rename(&part, &path).map_err(|e| Stop::Failed(format!("Could not finish {}: {e}", m.files[fi].name)))?; + finished_files += 1; + } + if last_report.elapsed() > Duration::from_millis(250) { + events.progress(progress.load(Ordering::Relaxed), total, finished_files, files_total); + last_report = Instant::now(); + } + } + } + for i in pending.iter().copied().filter(|i| m.files[*i].slices.is_empty()) { + let path = safe_path(&req.folder, &m.files[i].name).map_err(fail)?; + parts.remove(&i); + let part = path.with_extension(format!("{}part", path.extension().map(|e| format!("{}.", e.to_string_lossy())).unwrap_or_default())); + std::fs::rename(&part, &path).map_err(|e| Stop::Failed(e.to_string()))?; + finished_files += 1; + } + events.progress(total, total, finished_files, files_total); + Ok(Done { files: m.files.len(), bytes: total, chunks: m.chunks.clone(), setup: setup_json(&m) }) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn refuses_paths_that_leave_the_folder() { + let root = Path::new("/games/x"); + assert!(safe_path(root, "../evil").is_err()); + assert!(safe_path(root, "a/../../evil").is_err()); + assert_eq!(safe_path(root, "/bin/game.exe").unwrap(), root.join("bin/game.exe")); + } + + #[test] + fn checks_a_slice_as_served_and_unpacked() { + let data = b"slice".to_vec(); + let ok = manifest::Slice { size: 5, download_size: Some(5), download_sha1: sha1(&data), content_sha1: Vec::new(), offset: 0 }; + assert_eq!(checked(0, &data, &ok).unwrap(), data); + let bad = manifest::Slice { download_sha1: vec![0; 20], ..ok.clone() }; + assert!(checked(0, &data, &bad).is_err()); + let short = manifest::Slice { download_size: Some(4), ..ok }; + assert!(checked(0, &data, &short).is_err()); + } +} diff --git a/app/src/main/rust/stores/src/ubisoft/manifest.rs b/app/src/main/rust/stores/src/ubisoft/manifest.rs new file mode 100644 index 0000000000..0487a58564 --- /dev/null +++ b/app/src/main/rust/stores/src/ubisoft/manifest.rs @@ -0,0 +1,230 @@ +use std::io::Read; + +use super::pb; + +/// Bytes Ubisoft prepends to a downloaded `.manifest` before the zlib stream. +pub const HEADER: usize = 356; +pub const DEFLATE: u64 = 1; +pub const ZSTD: u64 = 3; + +#[derive(Clone, Debug, PartialEq)] +pub struct Slice { + pub size: u32, + pub download_size: Option, + pub download_sha1: Vec, + pub content_sha1: Vec, + pub offset: u64, +} + +#[derive(Clone, Debug, PartialEq)] +pub struct File { + pub name: String, + pub size: u64, + pub dir: bool, + pub slices: Vec, +} + +/// A chunk the install keeps, as the game's launcher session reports it. +#[derive(Clone, Debug, PartialEq)] +pub struct Chunk { + pub id: u32, + pub tags: String, +} + +#[derive(Debug)] +pub struct Manifest { + pub compression: u64, + pub files: Vec, + pub chunks: Vec, + /// Files of chunks left out: other languages, and add-ons the account does not own. + pub skipped: Vec, + /// Prerequisite installers Connect runs after an install: exe, arguments, description. + pub install_runs: Vec<(String, String, String)>, + /// Registry keys Connect writes for the game, with their string values as (name, value). + pub registry: Vec<(String, Vec<(String, String)>)>, +} + +fn file(b: &[u8]) -> Result { + let f = pb::fields(b)?; + let hashes = pb::subs(&f, 4); + let mut offset = 0u64; + let mut slices = Vec::new(); + for (i, s) in pb::subs(&f, 7).into_iter().enumerate() { + let s = pb::fields(s)?; + let size = pb::num(&s, 1).unwrap_or(0) as u32; + let at = pb::num(&s, 4).unwrap_or(offset); + slices.push(Slice { + size, + download_size: pb::num(&s, 2).map(|v| v as u32), + download_sha1: pb::sub(&s, 3).unwrap_or_default().to_vec(), + content_sha1: hashes.get(i).map(|h| h.to_vec()).unwrap_or_default(), + offset: at, + }); + offset = at + size as u64; + } + if slices.is_empty() { + for h in &hashes { + slices.push(Slice { size: 0, download_size: None, download_sha1: Vec::new(), content_sha1: h.to_vec(), offset: 0 }); + } + } + Ok(File { + name: pb::string(&f, 1).unwrap_or_default().replace('\\', "/"), + size: pb::num(&f, 2).unwrap_or(0), + dir: pb::num(&f, 3) == Some(1), + slices, + }) +} + +/// Files of the chunks to install: those for every language plus the language asked for, of the +/// game itself or an optional add-on in `owned` (every add-on when `owned` is empty). +pub fn parse(decoded: &[u8], language: &str) -> Result { + parse_owned(decoded, language, &[]) +} + +pub fn parse_owned(decoded: &[u8], language: &str, owned: &[u32]) -> Result { + let m = pb::fields(decoded)?; + let wanted = language.to_ascii_lowercase(); + let prefix = wanted.split(['-', '_']).next().unwrap_or("").to_string(); + let mut files = Vec::new(); + let mut chunks = Vec::new(); + let mut skipped = Vec::new(); + for c in pb::subs(&m, 4) { + let c = pb::fields(c)?; + let lang = pb::string(&c, 5).unwrap_or_default().to_ascii_lowercase(); + let mut products: Vec = c.iter().filter_map(|(n, v)| match v { pb::Value::Varint(x) if *n == 8 => Some(*x as u32), _ => None }).collect(); + products.extend(pb::num(&c, 4).map(|v| v as u32)); + let in_language = lang.is_empty() || lang == wanted || (!prefix.is_empty() && lang.split(['-', '_']).next() == Some(prefix.as_str())); + let optional = pb::num(&c, 2) == Some(1); + let owned_product = !optional || owned.is_empty() || products.is_empty() || products.iter().any(|p| owned.contains(p)); + if !(in_language && owned_product) { + for f in pb::subs(&c, 3) { + skipped.push(file(f)?.name); + } + continue; + } + chunks.push(Chunk { id: pb::num(&c, 1).unwrap_or(0) as u32, tags: pb::string(&c, 7).unwrap_or_default() }); + for f in pb::subs(&c, 3) { + files.push(file(f)?); + } + } + let kept: std::collections::HashSet<&str> = files.iter().map(|f| f.name.as_str()).collect(); + skipped.retain(|n| !kept.contains(n.as_str())); + let mut install_runs = Vec::new(); + for r in pb::subs(&m, 2) { + let r = pb::fields(r)?; + install_runs.push((pb::string(&r, 1).unwrap_or_default(), pb::string(&r, 3).unwrap_or_default(), pb::string(&r, 4).unwrap_or_default())); + } + let mut registry = Vec::new(); + for r in pb::subs(&m, 5) { + let r = pb::fields(r)?; + let mut values = Vec::new(); + for e in pb::subs(&r, 3) { + let e = pb::fields(e)?; + values.push((pb::string(&e, 1).unwrap_or_default(), pb::string(&e, 2).unwrap_or_default())); + } + registry.push((pb::string(&r, 1).unwrap_or_default(), values)); + } + Ok(Manifest { compression: pb::num(&m, 21).unwrap_or(0), files, chunks, skipped, install_runs, registry }) +} + +pub fn decode(downloaded: &[u8]) -> Result, String> { + if downloaded.len() <= HEADER { + return Err(format!("the manifest is only {} bytes", downloaded.len())); + } + let mut out = Vec::new(); + flate2::read::ZlibDecoder::new(&downloaded[HEADER..]).read_to_end(&mut out).map_err(|e| format!("the manifest did not inflate: {e}"))?; + Ok(out) +} + +pub fn hex_upper(b: &[u8]) -> String { + b.iter().map(|x| format!("{x:02X}")).collect() +} + +/// The CDN bucket of a slice: the first byte of its hash with nibbles swapped, mapped onto base32. +pub fn bucket(hash_upper: &str) -> char { + const BASE32: &[u8; 32] = b"0123456789abcdefghijklmnopqrstuv"; + let b = hash_upper.as_bytes(); + let swapped = format!("{}{}", *b.get(1).unwrap_or(&b'0') as char, *b.first().unwrap_or(&b'0') as char); + let v = u8::from_str_radix(&swapped, 16).unwrap_or(0); + BASE32[(v / 16) as usize + if v % 2 == 0 { 0 } else { 16 }] as char +} + +pub fn slice_path(bucketed: bool, hash_upper: &str) -> String { + if bucketed { format!("slices_v3/{}/{}", bucket(hash_upper), hash_upper) } else { format!("slices/{hash_upper}") } +} + +pub fn decompress(method: u64, data: &[u8]) -> Result, String> { + match method { + ZSTD => { + let mut out = Vec::new(); + ruzstd::decoding::StreamingDecoder::new(data).map_err(|e| format!("zstd: {e}"))?.read_to_end(&mut out).map_err(|e| format!("zstd: {e}"))?; + Ok(out) + } + DEFLATE => { + let zlib = data.len() >= 2 && data[0] == 0x78; + let inflate = |z: bool| { + let mut out = Vec::new(); + let r = if z { flate2::read::ZlibDecoder::new(data).read_to_end(&mut out) } else { flate2::read::DeflateDecoder::new(data).read_to_end(&mut out) }; + r.map(|_| out) + }; + inflate(zlib).or_else(|_| inflate(!zlib)).map_err(|e| format!("deflate: {e}")) + } + _ => Ok(data.to_vec()), + } +} + +#[cfg(test)] +mod tests { + use super::super::pb::Msg; + use super::*; + + #[test] + fn buckets_follow_the_swapped_first_byte() { + assert_eq!(bucket("10ABCDEF"), 'g'); + assert_eq!(bucket("01ABCDEF"), '1'); + assert_eq!(slice_path(true, "01AB"), "slices_v3/1/01AB"); + assert_eq!(slice_path(false, "01AB"), "slices/01AB"); + } + + #[test] + fn keeps_shared_and_wanted_language_chunks() { + let f = |name: &str| Msg::new().text(1, name).uint(2, 10).flag(3, false) + .bytes(4, &[0xAA]).msg(7, Msg::new().uint(1, 10).uint(2, 4).bytes(3, &[0xBB])); + let m = Msg::new() + .msg(4, Msg::new().uint(1, 1).uint(2, 0).msg(3, f("Game\\game.exe"))) + .msg(4, Msg::new().uint(1, 2).uint(2, 1).msg(3, f("en.pak")).text(5, "en-US")) + .msg(4, Msg::new().uint(1, 3).uint(2, 1).msg(3, f("fr.pak")).text(5, "fr-FR")) + .uint(21, ZSTD); + let parsed = parse(&m.0, "en-US").unwrap(); + let names: Vec<_> = parsed.files.iter().map(|f| f.name.as_str()).collect(); + assert_eq!(names, ["Game/game.exe", "en.pak"]); + assert_eq!(parsed.compression, ZSTD); + assert_eq!(parsed.files[0].slices[0], Slice { size: 10, download_size: Some(4), download_sha1: vec![0xBB], content_sha1: vec![0xAA], offset: 0 }); + } + + #[test] + fn leaves_out_add_ons_the_account_does_not_own() { + let f = |name: &str| Msg::new().text(1, name).uint(2, 10).flag(3, false); + let m = Msg::new() + .msg(4, Msg::new().uint(1, 1).uint(2, 0).msg(3, f("base.forge")).uint(4, 9999)) + .msg(4, Msg::new().uint(1, 2).uint(2, 1).msg(3, f("dlc_24/east.forge")).uint(4, 5450)) + .msg(4, Msg::new().uint(1, 3).uint(2, 1).msg(3, f("dlc_25/west.forge")).uint(8, 5451).uint(8, 5452)) + .uint(21, ZSTD); + let parsed = parse_owned(&m.0, "en-US", &[5405, 5452]).unwrap(); + let names: Vec<_> = parsed.files.iter().map(|f| f.name.as_str()).collect(); + assert_eq!(names, ["base.forge", "dlc_25/west.forge"]); + assert_eq!(parsed.skipped, ["dlc_24/east.forge"]); + assert_eq!(parsed.chunks.iter().map(|c| c.id).collect::>(), [1, 3]); + } + + #[test] + fn inflates_both_deflate_framings() { + use std::io::Write; + let mut z = flate2::write::ZlibEncoder::new(Vec::new(), flate2::Compression::default()); + z.write_all(b"hello").unwrap(); + assert_eq!(decompress(DEFLATE, &z.finish().unwrap()).unwrap(), b"hello"); + let mut r = flate2::write::DeflateEncoder::new(Vec::new(), flate2::Compression::default()); + r.write_all(b"hello").unwrap(); + assert_eq!(decompress(DEFLATE, &r.finish().unwrap()).unwrap(), b"hello"); + } +} diff --git a/app/src/main/rust/stores/src/ubisoft/mod.rs b/app/src/main/rust/stores/src/ubisoft/mod.rs new file mode 100644 index 0000000000..eff0a806f0 --- /dev/null +++ b/app/src/main/rust/stores/src/ubisoft/mod.rs @@ -0,0 +1,6 @@ +pub mod demux; +pub mod ffi; +pub mod install; +pub mod manifest; +pub mod pb; +pub mod service; diff --git a/app/src/main/rust/stores/src/ubisoft/pb.rs b/app/src/main/rust/stores/src/ubisoft/pb.rs new file mode 100644 index 0000000000..f967cb60ca --- /dev/null +++ b/app/src/main/rust/stores/src/ubisoft/pb.rs @@ -0,0 +1,104 @@ +pub use crate::amazon::proto::{Fields, Value}; + +#[derive(Default)] +pub struct Msg(pub Vec); + +impl Msg { + pub fn new() -> Self { + Msg(Vec::new()) + } + + fn varint(&mut self, mut v: u64) { + loop { + let b = (v & 0x7f) as u8; + v >>= 7; + if v == 0 { + self.0.push(b); + return; + } + self.0.push(b | 0x80); + } + } + + fn key(&mut self, field: u32, wire: u8) { + self.varint((field as u64) << 3 | wire as u64); + } + + pub fn uint(mut self, field: u32, v: u64) -> Self { + self.key(field, 0); + self.varint(v); + self + } + + pub fn flag(self, field: u32, v: bool) -> Self { + self.uint(field, v as u64) + } + + pub fn bytes(mut self, field: u32, data: &[u8]) -> Self { + self.key(field, 2); + self.varint(data.len() as u64); + self.0.extend_from_slice(data); + self + } + + pub fn text(self, field: u32, s: &str) -> Self { + self.bytes(field, s.as_bytes()) + } + + pub fn msg(self, field: u32, m: Msg) -> Self { + self.bytes(field, &m.0) + } +} + +/// Every field of a message, in wire order; repeated fields appear once per value. +pub fn fields(data: &[u8]) -> Result)>, String> { + let mut out = Vec::new(); + let mut f = Fields::new(data); + while let Some(v) = f.next_field()? { + out.push(v); + } + Ok(out) +} + +pub fn first<'a>(all: &[(u32, Value<'a>)], field: u32) -> Option> { + all.iter().find(|(n, _)| *n == field).map(|(_, v)| *v) +} + +pub fn sub<'a>(all: &[(u32, Value<'a>)], field: u32) -> Option<&'a [u8]> { + match first(all, field) { + Some(Value::Bytes(b)) => Some(b), + _ => None, + } +} + +pub fn subs<'a>(all: &[(u32, Value<'a>)], field: u32) -> Vec<&'a [u8]> { + all.iter().filter_map(|(n, v)| match (n, v) { (n, Value::Bytes(b)) if *n == field => Some(*b), _ => None }).collect() +} + +pub fn num(all: &[(u32, Value<'_>)], field: u32) -> Option { + match first(all, field) { + Some(Value::Varint(v)) | Some(Value::Fixed64(v)) => Some(v), + Some(Value::Fixed32(v)) => Some(v as u64), + _ => None, + } +} + +pub fn string(all: &[(u32, Value<'_>)], field: u32) -> Option { + sub(all, field).map(|b| String::from_utf8_lossy(b).into_owned()) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn round_trips_nested_messages() { + let m = Msg::new().uint(1, 300).msg(2, Msg::new().text(1, "a").text(1, "b")).flag(3, true); + let all = fields(&m.0).unwrap(); + assert_eq!(num(&all, 1), Some(300)); + assert_eq!(num(&all, 3), Some(1)); + let inner = fields(sub(&all, 2).unwrap()).unwrap(); + let texts: Vec<_> = subs(&inner, 1).iter().map(|b| String::from_utf8_lossy(b).into_owned()).collect(); + assert_eq!(texts, ["a", "b"]); + } +} diff --git a/app/src/main/rust/stores/src/ubisoft/service.rs b/app/src/main/rust/stores/src/ubisoft/service.rs new file mode 100644 index 0000000000..bfdddc29a9 --- /dev/null +++ b/app/src/main/rust/stores/src/ubisoft/service.rs @@ -0,0 +1,206 @@ +use serde_json::{json, Value as Json}; + +use super::demux::Demux; +use super::pb::{self, Msg}; + +pub struct Owned { + pub product_id: u32, + pub space_id: String, + pub manifest: String, + pub product_type: u32, + pub state: u32, + pub owned: bool, + pub configuration: String, + pub app_id: String, + pub partner: u32, + pub activation: u32, + pub locked_by_subscription: bool, + pub associations: Vec, + pub download_id: u32, +} + +impl Owned { + /// Whether Connect lists the product among the session's owned ids: owned games and add-ons that are released. + pub fn in_session(&self) -> bool { + self.owned && self.product_type <= 1 && (self.state == 0 || self.state == 3) + } + + pub fn to_json(&self) -> Json { + json!({ + "productId": self.product_id, "spaceId": self.space_id, "manifest": self.manifest, + "productType": self.product_type, "state": self.state, "owned": self.owned, + "configuration": self.configuration, "appId": self.app_id, + "partner": self.partner, "activation": self.activation, "lockedBySubscription": self.locked_by_subscription, + "associations": self.associations, "downloadId": self.download_id, + }) + } +} + +pub struct Ownership { + conn: u32, + next: u64, +} + +fn owned_game(b: &[u8]) -> Result { + let f = pb::fields(b)?; + Ok(Owned { + product_id: pb::num(&f, 1).unwrap_or(0) as u32, + space_id: pb::string(&f, 30).unwrap_or_default(), + manifest: pb::string(&f, 21).unwrap_or_default(), + product_type: pb::num(&f, 8).unwrap_or(0) as u32, + state: pb::num(&f, 13).unwrap_or(0) as u32, + owned: pb::num(&f, 20).map(|v| v == 1).unwrap_or(true), + configuration: pb::string(&f, 17).unwrap_or_default(), + app_id: pb::string(&f, 31).unwrap_or_default(), + partner: pb::num(&f, 38).unwrap_or(0) as u32, + activation: pb::num(&f, 36).unwrap_or(0) as u32, + locked_by_subscription: pb::num(&f, 37) == Some(1), + associations: f.iter().filter_map(|(n, v)| match v { pb::Value::Varint(x) if *n == 16 => Some(*x as u32), _ => None }).collect(), + download_id: pb::num(&f, 5).unwrap_or(0) as u32, + }) +} + +impl Ownership { + /// Opens ownership_service and initializes it, which also returns the account's products. + pub async fn open(d: &mut Demux, ticket: &str, session_id: &str) -> Result<(Self, Vec), String> { + let conn = d.open("ownership_service").await?; + let init = Msg::new().flag(2, true).uint(3, 7); + let mut req = Msg::new().uint(1, 1).msg(2, init).text(30, ticket); + if !session_id.is_empty() { + req = req.text(31, session_id); + } + let raw = d.call(conn, Msg::new().msg(1, req)).await?; + let rsp = pb::fields(pb::sub(&pb::fields(&raw)?, 1).ok_or("no ownership answer")?)?; + let init = pb::fields(pb::sub(&rsp, 2).ok_or("no ownership initialize answer")?)?; + if pb::num(&init, 1) != Some(1) { + return Err("Ubisoft would not list the account's games".into()); + } + let mut games = Vec::new(); + if let Some(list) = pb::sub(&init, 2) { + for g in pb::subs(&pb::fields(list)?, 1) { + games.push(owned_game(g)?); + } + } + Ok((Ownership { conn, next: 2 }, games)) + } + + /// The latest manifest of each product that has one, for games whose ownership entry leaves it out. + pub async fn latest_manifests(&mut self, d: &mut Demux, products: &[u32]) -> Result, String> { + if products.is_empty() { + return Ok(Vec::new()); + } + let id = self.next; + self.next += 1; + let mut req = Msg::new(); + for p in products { + req = req.uint(1, *p as u64); + } + let raw = d.call(self.conn, Msg::new().msg(1, Msg::new().uint(1, id).msg(10, req))).await?; + let rsp = pb::fields(pb::sub(&pb::fields(&raw)?, 1).ok_or("no ownership answer")?)?; + let m = pb::fields(pb::sub(&rsp, 10).ok_or("no manifest answer")?)?; + if pb::num(&m, 1) != Some(1) { + return Err("Ubisoft would not list the latest manifests".into()); + } + let mut out = Vec::new(); + for entry in pb::subs(&m, 2) { + let e = pb::fields(entry)?; + if pb::num(&e, 1) != Some(1) { + continue; + } + if let (Some(product), Some(manifest)) = (pb::num(&e, 2), pb::string(&e, 3).filter(|s| !s.is_empty())) { + out.push((product as u32, manifest)); + } + } + Ok(out) + } + + /// The ticket a game receives in its launcher session (`GetUplayPCTicket`). + pub async fn pc_ticket(&mut self, d: &mut Demux, product_id: u32, ticket: &str, session_id: &str) -> Result { + let id = self.next; + self.next += 1; + let info = Msg::new().uint(1, product_id as u64).uint(2, 0).uint(3, product_id as u64); + let mut req = Msg::new().uint(1, id).msg(14, info).text(30, ticket); + if !session_id.is_empty() { + req = req.text(31, session_id); + } + let raw = d.call(self.conn, Msg::new().msg(1, req)).await?; + let rsp = pb::fields(pb::sub(&pb::fields(&raw)?, 1).ok_or("no ownership answer")?)?; + let t = pb::fields(pb::sub(&rsp, 13).ok_or("no game ticket answer")?)?; + if pb::num(&t, 1) != Some(1) { + return Err(format!("Ubisoft would not issue a game ticket (code {})", pb::num(&t, 3).unwrap_or(0))); + } + pb::string(&t, 2).filter(|s| !s.is_empty()).ok_or_else(|| "Ubisoft sent an empty game ticket".into()) + } + + pub async fn token(&mut self, d: &mut Demux, product_id: u32) -> Result { + let id = self.next; + self.next += 1; + let raw = d.call(self.conn, Msg::new().msg(1, Msg::new().uint(1, id).msg(28, Msg::new().uint(1, product_id as u64)))).await?; + let rsp = pb::fields(pb::sub(&pb::fields(&raw)?, 1).ok_or("no ownership answer")?)?; + let t = pb::fields(pb::sub(&rsp, 27).ok_or("no ownership token answer")?)?; + if pb::num(&t, 1) != Some(1) { + return Err("Ubisoft says this account does not own the game".into()); + } + pb::string(&t, 2).filter(|s| !s.is_empty()).ok_or_else(|| "Ubisoft sent an empty ownership token".into()) + } +} + +pub struct Downloads { + conn: u32, + next: u64, +} + +impl Downloads { + pub async fn open(d: &mut Demux, ownership_token: &str) -> Result { + let conn = d.open("download_service").await?; + let raw = d.call(conn, Msg::new().msg(1, Msg::new().uint(1, 1).msg(2, Msg::new().text(5, ownership_token)))).await?; + let rsp = pb::fields(pb::sub(&pb::fields(&raw)?, 1).ok_or("no download service answer")?)?; + let ok = pb::sub(&rsp, 2).map(pb::fields).transpose()?.and_then(|i| pb::num(&i, 1)) == Some(1); + if !ok { + return Err("Ubisoft's download service refused the ownership token".into()); + } + Ok(Downloads { conn, next: 2 }) + } + + /// Signed CDN URLs for paths under the product's download root, in request order; empty where none was given. + pub async fn sign(&mut self, d: &mut Demux, product_id: u32, paths: &[String]) -> Result>, String> { + let id = self.next; + self.next += 1; + let mut request = Msg::new().uint(1, product_id as u64); + for p in paths { + request = request.text(2, p); + } + let raw = d.call(self.conn, Msg::new().msg(1, Msg::new().uint(1, id).msg(3, Msg::new().msg(1, request)))).await?; + let rsp = pb::fields(pb::sub(&pb::fields(&raw)?, 1).ok_or("no download service answer")?)?; + let urls = pb::fields(pb::sub(&rsp, 3).ok_or("no signed URLs")?)?; + let mut out = Vec::new(); + for r in pb::subs(&urls, 1) { + let r = pb::fields(r)?; + if pb::num(&r, 1).unwrap_or(0) != 0 { + return Err("Ubisoft says this account does not own the game".into()); + } + for group in pb::subs(&r, 2) { + out.push(pb::subs(&pb::fields(group)?, 1).iter().map(|u| String::from_utf8_lossy(u).into_owned()).collect()); + } + } + if out.len() != paths.len() { + return Err(format!("Ubisoft signed {} of {} paths", out.len(), paths.len())); + } + Ok(out) + } +} + +/// Denuvo's activation for a game the account owns: the game's challenge and the product's ownership +/// token go to `denuvo_service`, which answers with the game token the game's aux DLL waits for. +pub async fn denuvo_token(d: &mut Demux, ownership_token: &str, challenge: &[u8]) -> Result, String> { + let conn = d.open("denuvo_service").await?; + let req = Msg::new().uint(1, 1).msg(2, Msg::new().text(1, ownership_token).bytes(2, challenge)); + let raw = d.call(conn, Msg::new().msg(1, req)).await?; + let rsp = pb::fields(pb::sub(&pb::fields(&raw)?, 1).ok_or("no denuvo answer")?)?; + let result = pb::num(&rsp, 2).unwrap_or(0); + if result != 0 { + return Err(format!("Ubisoft's activation service refused the game (result {result})")); + } + let t = pb::fields(pb::sub(&rsp, 3).ok_or("no game token answer")?)?; + pb::sub(&t, 1).filter(|b| !b.is_empty()).map(<[u8]>::to_vec).ok_or_else(|| "Ubisoft sent an empty game token".into()) +} diff --git a/app/src/test/java/com/droiddeck/launcher/HomeIconsTest.kt b/app/src/test/java/com/droiddeck/launcher/HomeIconsTest.kt new file mode 100644 index 0000000000..fc3ba72d75 --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/HomeIconsTest.kt @@ -0,0 +1,26 @@ +package com.droiddeck.launcher + +import com.droiddeck.launcher.ui.iconMatches +import org.junit.Assert.assertEquals +import org.junit.Assert.assertNull +import org.junit.Test + +class HomeIconsTest { + @Test fun aChoiceSurvivesEncoding() { + val choice = HomeIcons.Choice("com.pack", "chrome_alt") + assertEquals("com.app/.Main#10" to choice, HomeIcons.decode(HomeIcons.encode("com.app/.Main#10", choice))) + } + + @Test fun aDamagedEntryIsDropped() { + assertNull(HomeIcons.decode("com.app/.Main")) + assertNull(HomeIcons.decode("com.app/.Main\t\tchrome")) + } + + @Test fun iconsNamedLikeTheAppComeFirst() { + assertEquals(listOf("google_chrome", "alarm", "zoom"), iconMatches(listOf("alarm", "google_chrome", "zoom"), "Chrome", "")) + } + + @Test fun aSearchIgnoresCaseAndSeparators() { + assertEquals(listOf("google_chrome"), iconMatches(listOf("alarm", "google_chrome"), "Chrome", "Google Ch")) + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/IconPackTest.kt b/app/src/test/java/com/droiddeck/launcher/IconPackTest.kt new file mode 100644 index 0000000000..0c03ac3b7e --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/IconPackTest.kt @@ -0,0 +1,127 @@ +package com.droiddeck.launcher + +import android.graphics.Color +import android.util.Xml +import androidx.core.graphics.createBitmap +import org.junit.Assert.assertEquals +import org.junit.Assert.assertNull +import org.junit.Assert.assertTrue +import org.junit.Test +import org.junit.runner.RunWith +import org.robolectric.RobolectricTestRunner +import org.robolectric.annotation.Config +import org.robolectric.annotation.GraphicsMode +import java.io.StringReader + +@RunWith(RobolectricTestRunner::class) +@Config(sdk = [33]) +@GraphicsMode(GraphicsMode.Mode.NATIVE) +class IconPackTest { + private fun filter(xml: String) = IconPack.parse(Xml.newPullParser().also { it.setInput(StringReader(xml)) }) + + private fun parse(xml: String) = filter(xml).icons + + private fun plate(xml: String) = filter(xml).plate + + private fun solid(color: Int) = createBitmap(10, 10).also { it.eraseColor(color) } + + @Test fun plateTagsAreReadFromTheFilter() { + val xml = """ + + + + + + """ + assertEquals(IconPack.Plate("back", "mask", "upon", 0.75f), plate(xml)) + } + + @Test fun aPackWithoutPlateImagesHasNoPlateEvenWithAScale() { + assertNull(plate("""""")) + } + + @Test fun anInvalidScaleLeavesTheIconFullSize() { + assertEquals(1f, plate("""""")?.scale) + } + + @Test fun theMaskCutsTheIconWhereItIsOpaqueAndTheBackShowsThrough() { + val mask = createBitmap(10, 10).also { it.setPixel(0, 0, Color.BLACK) } + val out = IconPack.compose(solid(Color.RED), solid(Color.BLUE), mask, null, 1f) + assertEquals(Color.BLUE, out.getPixel(0, 0)) + assertEquals(Color.RED, out.getPixel(5, 5)) + } + + @Test fun theScaleShrinksTheIconOntoTheBack() { + val out = IconPack.compose(solid(Color.RED), solid(Color.BLUE), null, null, 0.5f) + assertEquals(Color.BLUE, out.getPixel(1, 1)) + assertEquals(Color.RED, out.getPixel(5, 5)) + } + + @Test fun anAppColorRepaintsTheBackInsideItsShape() { + val back = createBitmap(10, 10).also { it.setPixel(5, 5, Color.WHITE) } + val out = IconPack.compose(createBitmap(10, 10), back, null, null, 1f, Color.GREEN) + assertEquals(Color.GREEN, out.getPixel(5, 5)) + assertEquals(Color.TRANSPARENT, out.getPixel(0, 0)) + } + + @Test fun theUponImageDrawsOverEverything() { + val out = IconPack.compose(solid(Color.RED), solid(Color.BLUE), null, solid(Color.GREEN), 1f) + assertEquals(Color.GREEN, out.getPixel(5, 5)) + } + + @Test fun drawableXmlNamesAreDistinctAndInOrder() { + val xml = """""" + assertEquals(listOf("b", "a"), IconPack.parseNames(Xml.newPullParser().also { it.setInput(StringReader(xml)) })) + } + + @Test fun aClassNameStartingWithADotIsExpandedWithThePackage() { + assertEquals("com.example.app/com.example.app.Main", IconPack.componentKey("ComponentInfo{com.example.app/.Main}")) + } + + @Test fun entriesWithoutAUsableComponentOrDrawableAreSkipped() { + val icons = parse( + """ + + + + + + """, + ) + assertTrue(icons.toString(), icons.isEmpty()) + } + + @Test fun theFirstEntryForAComponentWins() { + val icons = parse( + """ + + + """, + ) + assertEquals("first", icons["com.example/com.example.Main"]) + } + + @Test fun aCalendarTriesTodaysIconBeforeItsStaticOne() { + val filter = filter( + """ + + + + """, + ) + assertEquals(listOf("calendar_7", "cal"), filter.names("com.example/com.example.Cal", 7)) + assertEquals(listOf("main"), filter.names("com.example/com.example.Main", 7)) + } + + @Test fun tagsThatAreNotItemsAreIgnored() { + val icons = parse( + """ + + + + + """, + ) + assertEquals(mapOf("com.example/com.example.Main" to "main"), icons) + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/agent/AgentBashrcTest.kt b/app/src/test/java/com/droiddeck/launcher/agent/AgentBashrcTest.kt new file mode 100644 index 0000000000..43f900f065 --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/agent/AgentBashrcTest.kt @@ -0,0 +1,22 @@ +package com.droiddeck.launcher.agent + +import org.junit.Assert.assertEquals +import org.junit.Rule +import org.junit.Test +import org.junit.rules.TemporaryFolder + +class AgentBashrcTest { + @get:Rule val tmp = TemporaryFolder() + + @Test fun aPinnedAdbPortGivesWayToTheLiveOne() { + val bashrc = tmp.newFile(".bashrc") + bashrc.writeText("alias ll='ls -l'\n# droiddeck-agent-path\nexport PATH=\"\$HOME/.local/bin:\$PATH\" ADB_SERIAL=127.0.0.1:5555 BROWSER=\"\$HOME/.local/bin/android-open\"\n") + AgentSetup.unpinAdbSerial(bashrc) + assertEquals( + "alias ll='ls -l'\n# droiddeck-agent-path\nexport PATH=\"\$HOME/.local/bin:\$PATH\" ADB_SERIAL=\"\${ADB_SERIAL:-127.0.0.1:5555}\" BROWSER=\"\$HOME/.local/bin/android-open\"\n", + bashrc.readText(), + ) + AgentSetup.unpinAdbSerial(bashrc) + assertEquals(1, Regex("ADB_SERIAL=").findAll(bashrc.readText()).count()) + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/agent/AgentCallReceiverTest.kt b/app/src/test/java/com/droiddeck/launcher/agent/AgentCallReceiverTest.kt new file mode 100644 index 0000000000..5a86993680 --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/agent/AgentCallReceiverTest.kt @@ -0,0 +1,58 @@ +package com.droiddeck.launcher.agent + +import android.content.Context +import android.content.Intent +import org.junit.After +import org.junit.Assert.assertEquals +import org.junit.Assert.assertFalse +import org.junit.Assert.assertTrue +import org.junit.Test +import org.junit.runner.RunWith +import org.robolectric.RobolectricTestRunner +import org.robolectric.RuntimeEnvironment +import org.robolectric.annotation.Config +import java.io.File +import java.util.concurrent.CountDownLatch +import java.util.concurrent.TimeUnit + +@RunWith(RobolectricTestRunner::class) +@Config(sdk = [28], manifest = Config.NONE) +class AgentCallReceiverTest { + private val original = AgentCallReceiver.call + + @After fun restore() { + AgentCallReceiver.call = original + } + + @Test fun aSlowCallIsAnsweredAfterTheBroadcastReturns() { + val context: Context = RuntimeEnvironment.getApplication() + val release = CountDownLatch(1) + val started = CountDownLatch(1) + AgentCallReceiver.call = { _, method, _, _ -> + started.countDown() + release.await(10, TimeUnit.SECONDS) + """{"ok":true,"method":"$method"}""" + } + val answer = File(context.getExternalFilesDir(null), "agent-calls/slow1.json").apply { delete() } + + AgentCallReceiver().onReceive(context, Intent().putExtra("method", "guest").putExtra("id", "slow1")) + + assertTrue(started.await(5, TimeUnit.SECONDS)) + assertFalse(answer.exists()) + release.countDown() + val deadline = System.nanoTime() + TimeUnit.SECONDS.toNanos(5) + while (!answer.exists() && System.nanoTime() < deadline) Thread.sleep(20) + assertEquals("""{"ok":true,"method":"guest"}""", answer.readText()) + } + + @Test fun anUnsafeIdIsIgnored() { + val context: Context = RuntimeEnvironment.getApplication() + var called = false + AgentCallReceiver.call = { _, _, _, _ -> called = true; "{}" } + + AgentCallReceiver().onReceive(context, Intent().putExtra("method", "state").putExtra("id", "../x")) + + Thread.sleep(100) + assertFalse(called) + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/agent/AgentChoicesTest.kt b/app/src/test/java/com/droiddeck/launcher/agent/AgentChoicesTest.kt new file mode 100644 index 0000000000..8751b64b09 --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/agent/AgentChoicesTest.kt @@ -0,0 +1,68 @@ +package com.droiddeck.launcher.agent + +import org.junit.Assert.assertEquals +import org.junit.Test + +class AgentChoicesTest { + @Test fun aTrailingChoicesBlockBecomesOptions() { + val reply = choices("Which build?\n\n```choices\n- Debug\n- Release\n```\n") + assertEquals("Which build?", reply.text) + assertEquals(listOf("Debug", "Release"), reply.options) + } + + @Test fun plainLinesAreOptionsToo() { + assertEquals(listOf("Yes", "No"), choices("Go on?\n```choices\nYes\nNo\n```").options) + } + + @Test fun aReplyWithoutTheBlockStaysWhole() { + val text = "Done.\n```kotlin\nval a = 1\n```" + assertEquals(Choices(text, emptyList()), choices(text)) + } + + @Test fun aChoicesBlockFollowedByAnotherFenceIsNotAQuestion() { + val text = "```choices\nA\nB\n```\nExplanation.\n```kotlin\nval x = 1\n```" + assertEquals(Choices(text, emptyList()), choices(text)) + } + + @Test fun aChoicesBlockFollowedByTextIsNotAQuestion() { + val text = "```choices\nA\nB\n```\nMore after it." + assertEquals(Choices(text, emptyList()), choices(text)) + } + + @Test fun backticksInsideAChoiceAreKept() { + val reply = choices("How?\n```choices\nUse ``` for code\nUse indentation\n```") + assertEquals("How?", reply.text) + assertEquals(listOf("Use ``` for code", "Use indentation"), reply.options) + } + + @Test fun aLongerOpenerNeedsAClosingFenceAsLong() { + val reply = choices("````choices\nA\n```\nB\n````") + assertEquals(listOf("A", "```", "B"), reply.options) + } + + @Test fun aChoicesExampleInsideACodeBlockStaysLiteral() { + val text = "Example:\n````markdown\n```choices\nA\nB\n````" + assertEquals(Choices(text, emptyList()), choices(text)) + } + + @Test fun anUnclosedChoicesBlockIsNotAQuestion() { + val text = "Pick:\n```choices\nA\nB" + assertEquals(Choices(text, emptyList()), choices(text)) + } + + @Test fun aChoicesExampleInsideAnUnclosedTildeFenceStaysLiteral() { + val text = "Example:\n~~~markdown\n```choices\nA\nB\n```" + assertEquals(Choices(text, emptyList()), choices(text)) + } + + @Test fun aChoicesBlockAfterAClosedTildeFenceCounts() { + val reply = choices("~~~\ncode\n~~~\nPick:\n```choices\nA\nB\n```") + assertEquals(listOf("A", "B"), reply.options) + } + + @Test fun aTildeChoicesBlockBecomesOptions() { + val reply = choices("Pick:\n~~~choices\nYes\nNo\n~~~") + assertEquals("Pick:", reply.text) + assertEquals(listOf("Yes", "No"), reply.options) + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/agent/AgentGuestPathTest.kt b/app/src/test/java/com/droiddeck/launcher/agent/AgentGuestPathTest.kt new file mode 100644 index 0000000000..794a0e95f4 --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/agent/AgentGuestPathTest.kt @@ -0,0 +1,18 @@ +package com.droiddeck.launcher.agent + +import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue +import org.junit.Test + +class AgentGuestPathTest { + private val dirs = AgentHost.GUEST_PATH.split(':') + + @Test fun includesTheSystemBinariesDpkgNeedsAsRoot() { + assertTrue(dirs.containsAll(listOf("/usr/local/sbin", "/usr/sbin", "/sbin"))) + } + + @Test fun keepsUserBinariesFirstAndTheStandardDirs() { + assertEquals("/root/.local/bin", dirs.first()) + assertTrue(dirs.containsAll(listOf("/usr/local/bin", "/usr/bin", "/bin"))) + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/agent/AgentHostTest.kt b/app/src/test/java/com/droiddeck/launcher/agent/AgentHostTest.kt new file mode 100644 index 0000000000..5cfc53ddee --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/agent/AgentHostTest.kt @@ -0,0 +1,272 @@ +package com.droiddeck.launcher.agent + +import com.droiddeck.launcher.agent.AgentHost.Entry +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.RobolectricTestRunner +import org.robolectric.annotation.Config +import java.io.File +import java.nio.file.Files + +@RunWith(RobolectricTestRunner::class) +@Config(sdk = [28], manifest = Config.NONE) +class AgentHostTest { + @Test fun claudeInitCarriesOnlyTheConversation() { + val event = ClaudeCode.parse("""{"type":"system","subtype":"init","session_id":"abc","tools":[]}""")!! + assertEquals("abc", event.conversation) + assertEquals(emptyList(), event.entries) + } + + @Test fun claudeTextThinkingAndToolUseBecomeEntries() { + val event = ClaudeCode.parse( + """{"type":"assistant","session_id":"abc","message":{"content":[ + {"type":"text","text":" Looking at the log. "}, + {"type":"tool_use","id":"t1","name":"Bash","input":{"command":"droiddeckctl state\nmore"}}, + {"type":"thinking","thinking":"why"}],"usage":{"input_tokens":10,"cache_read_input_tokens":90,"output_tokens":5}}}""", + )!! + assertEquals(listOf(Entry.Said("Looking at the log."), Entry.Used("t1", "Bash", "droiddeckctl state", "droiddeckctl state\nmore"), Entry.Thought("why")), event.entries) + assertEquals(105L, event.context) + } + + @Test fun aSubagentShowsOnlyItsToolCallsUnderItsParent() { + val event = ClaudeCode.parse( + """{"type":"assistant","session_id":"abc","parent_tool_use_id":"task1","message":{"content":[ + {"type":"text","text":"I will look."}, + {"type":"tool_use","id":"t2","name":"Grep","input":{"pattern":"crash"}}],"usage":{"input_tokens":10,"output_tokens":5}}}""", + )!! + assertEquals(listOf(Entry.Used("t2", "Grep", "crash", "{\n \"pattern\": \"crash\"\n}", parent = "task1")), event.entries) + assertNull(event.context) + assertNull(ClaudeCode.parse("""{"type":"stream_event","parent_tool_use_id":"task1","event":{"type":"content_block_delta","delta":{"type":"text_delta","text":"x"}}}""")) + } + + @Test fun aParentlessMessageReadsTheNullAsNoParent() { + val event = ClaudeCode.parse("""{"type":"assistant","parent_tool_use_id":null,"message":{"content":[{"type":"text","text":"hi"}]}}""")!! + assertEquals(listOf(Entry.Said("hi")), event.entries) + } + + @Test fun claudeStreamsTextAsItIsWritten() { + val event = ClaudeCode.parse("""{"type":"stream_event","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Hel"}}}""")!! + assertEquals("Hel", event.text) + assertEquals("hm", ClaudeCode.parse("""{"type":"stream_event","event":{"type":"content_block_delta","delta":{"type":"thinking_delta","thinking":"hm"}}}""")!!.thinking) + assertNull(ClaudeCode.parse("""{"type":"stream_event","event":{"type":"message_start"}}""")) + } + + @Test fun claudeToolResultsAnswerTheirCall() { + val event = ClaudeCode.parse( + """{"type":"user","message":{"content":[{"type":"tool_result","tool_use_id":"t1","content":[{"type":"text","text":"ok"}],"is_error":true}]}}""", + )!! + assertEquals(listOf(Entry.Result("t1", "ok", true)), event.entries) + val entries = mutableListOf(Entry.Used("t1", "Bash", "ls", "ls")) + assertTrue(AgentChats.merge(entries, event.entries.single())) + assertEquals(Entry.Used("t1", "Bash", "ls", "ls", "ok", true), entries.single()) + assertFalse(AgentChats.merge(entries, Entry.Result("unknown", "x", false))) + } + + @Test fun aClaudeResultEndsTheTurnWithItsUsage() { + val event = ClaudeCode.parse("""{"type":"result","subtype":"success","is_error":false,"result":"done","duration_ms":4200,"total_cost_usd":0.05,"usage":{"input_tokens":3,"output_tokens":7}}""")!! + assertEquals(listOf(Entry.Finished(null)), event.entries) + assertEquals(AgentHost.Usage(4200, 0.05, 3, 7), event.usage) + assertEquals(listOf(Entry.Finished("Invalid API key")), + ClaudeCode.parse("""{"type":"result","subtype":"success","is_error":true,"result":"Invalid API key"}""")!!.entries) + assertNull(ClaudeCode.parse("not json")) + } + + @Test fun aResultForALeftoverBackgroundTaskDoesNotEndTheTurn() { + val event = ClaudeCode.parse("""{"type":"result","is_error":false,"num_turns":0,"session_id":"s","total_cost_usd":0,"usage":{"input_tokens":0,"output_tokens":0},"origin":{"kind":"task-notification"}}""") + assertTrue(event == null || event.entries.none { it is Entry.Finished }) + } + + @Test fun claudeTurnsBypassPermissionsOrPlanAndTakeAModel() { + val first = ClaudeCode.turn("hi", null, AgentHarness.Options()) + assertTrue("bypassPermissions" in first && "--resume" !in first && "--model" !in first && "--include-partial-messages" in first) + val next = ClaudeCode.turn("hi", "abc", AgentHarness.Options(model = "opus", plan = true)) + assertEquals("abc", next[next.indexOf("--resume") + 1]) + assertEquals("opus", next[next.indexOf("--model") + 1]) + assertEquals("plan", next[next.indexOf("--permission-mode") + 1]) + } + + @Test fun claudeShowsWholeEditsAndTodos() { + assertEquals("a.kt\n-old\n+new", ClaudeCode.fullInput("Edit", org.json.JSONObject("""{"file_path":"a.kt","old_string":"old","new_string":"new"}"""))) + assertEquals("b.kt\n+one\n+two", ClaudeCode.fullInput("Write", org.json.JSONObject("""{"file_path":"b.kt","content":"one\ntwo"}"""))) + assertEquals("[x] read\n[~] fix\n[ ] test", ClaudeCode.fullInput("TodoWrite", org.json.JSONObject( + """{"todos":[{"content":"read","status":"completed"},{"content":"fix","status":"in_progress"},{"content":"test","status":"pending"}]}"""))) + } + + @Test fun codexEventsBecomeEntries() { + assertEquals("t1", Codex.parse("""{"type":"thread.started","thread_id":"t1"}""")!!.conversation) + assertEquals(listOf(Entry.Used("i1", "Shell", "uname -m", "uname -m")), + Codex.parse("""{"type":"item.started","item":{"id":"i1","type":"command_execution","command":"uname -m","status":"in_progress"}}""")!!.entries) + assertEquals(listOf(Entry.Result("i1", "aarch64\n", false)), + Codex.parse("""{"type":"item.completed","item":{"id":"i1","type":"command_execution","command":"uname -m","aggregated_output":"aarch64\n","exit_code":0}}""")!!.entries) + assertEquals(listOf(Entry.Said("It is aarch64.")), + Codex.parse("""{"type":"item.completed","item":{"id":"i2","type":"agent_message","text":"It is aarch64."}}""")!!.entries) + assertEquals(Entry.Used("i3", "Edit", "a.kt, b.kt", "a.kt\nb.kt"), + Codex.parse("""{"type":"item.completed","item":{"id":"i3","type":"file_change","status":"completed","changes":[{"path":"a.kt"},{"path":"b.kt"}]}}""")!!.entries.first()) + assertEquals(listOf(Entry.Finished(null)), Codex.parse("""{"type":"turn.completed","usage":{}}""")!!.entries) + assertEquals(listOf(Entry.Finished("quota")), Codex.parse("""{"type":"turn.failed","error":{"message":"quota"}}""")!!.entries) + assertNull(Codex.parse("""{"type":"error","message":"Reconnecting... 1/5 (stream disconnected before completion)"}""")) + assertEquals(listOf(Entry.Finished("unauthorized")), Codex.parse("""{"type":"error","message":"unauthorized"}""")!!.entries) + assertNull(Codex.parse("""{"type":"item.started","item":{"type":"reasoning"}}""")) + } + + @Test fun codexTurnsSkipItsSandboxResumeAndTakeAModel() { + assertEquals(listOf("/root/.local/bin/codex", "exec", "--json", "--dangerously-bypass-approvals-and-sandbox", "--skip-git-repo-check", "hi"), + Codex.turn("hi", null, AgentHarness.Options())) + assertEquals(listOf("/root/.local/bin/codex", "exec", "resume", "t1", "--json", "--dangerously-bypass-approvals-and-sandbox", "--skip-git-repo-check", "-m", "gpt", "hi"), + Codex.turn("hi", "t1", AgentHarness.Options(model = "gpt"))) + } + + @Test fun aToolIdUsedAgainInALaterTurnIsANewCall() { + val entries = mutableListOf(Entry.Asked("one"), Entry.Used("item_0", "Shell", "ls", "ls", "a"), Entry.Finished(null), Entry.Asked("two")) + assertFalse(AgentChats.merge(entries, Entry.Result("item_0", "late", false))) + assertTrue(AgentChats.merge(entries, Entry.Used("item_0", "Shell", "pwd", "pwd"))) + assertTrue(AgentChats.merge(entries, Entry.Result("item_0", "/root", false))) + assertEquals(Entry.Used("item_0", "Shell", "ls", "ls", "a"), entries[1]) + assertEquals(Entry.Used("item_0", "Shell", "pwd", "pwd", "/root"), entries.last()) + } + + @Test fun filesAttachedBeforeTheFirstMessageMoveIntoTheChat() { + val context = org.robolectric.RuntimeEnvironment.getApplication() + val dir = AgentAttachments.hostDir(context) + File(dir, "new").mkdirs() + File(dir, "new/a.png").writeText("x") + val moved = AgentAttachments.adopt(context, "42", listOf("/root/.cache/droiddeck/attachments/new/a.png", "/root/.cache/droiddeck/attachments/7/b.txt")) + assertEquals(listOf("/root/.cache/droiddeck/attachments/42/a.png", "/root/.cache/droiddeck/attachments/7/b.txt"), moved) + assertTrue(File(dir, "42/a.png").isFile) + assertFalse(File(dir, "new/a.png").exists()) + AgentChats.delete(context, "42") + assertFalse(File(dir, "42").exists()) + } + + @Test fun codexShellWrappersAreUnwrapped() { + assertEquals("uname -m", shellCommand("/bin/bash -lc 'uname -m'")) + assertEquals("echo 'hi'", shellCommand("/bin/bash -lc 'echo '\''hi'\'''")) + assertEquals("ls", shellCommand("ls")) + } + + @Test fun claudeCodeDefaultsToNoAttributionAndKeepsTheUsersChoice() { + val root = Files.createTempDirectory("rootfs").toFile() + val settings = File(root, "root/.claude/settings.json") + ClaudeCode.prepare(root) + val written = org.json.JSONObject(settings.readText()) + assertEquals(false, written.getBoolean("includeCoAuthoredBy")) + assertEquals("", written.getJSONObject("attribution").getString("commit")) + assertEquals("", written.getJSONObject("attribution").getString("pr")) + + settings.writeText("""{"includeCoAuthoredBy":true,"model":"opus"}""") + ClaudeCode.prepare(root) + val kept = org.json.JSONObject(settings.readText()) + assertEquals(true, kept.getBoolean("includeCoAuthoredBy")) + assertEquals("opus", kept.getString("model")) + assertTrue(kept.has("attribution")) + + settings.writeText("not json") + ClaudeCode.prepare(root) + assertEquals("not json", settings.readText()) + } + + @Test fun aTurnWithoutAnEndWasInterrupted() { + assertTrue(AgentHost.interrupted(listOf(Entry.Asked("hi"), Entry.Used("1", "Bash", "dd-lab-build")))) + assertEquals(false, AgentHost.interrupted(listOf(Entry.Asked("hi"), Entry.Finished(null)))) + } + + @Test fun aChatRoundTripsThroughItsFile() { + val file = Files.createTempFile("chat", ".jsonl").toFile() + AgentChats.start(file, "claude") + AgentChats.appendConversation(file, "abc") + val written = listOf( + Entry.Asked("hi", listOf("/root/x.png")), Entry.Said("hello"), Entry.Thought("hm"), Entry.Used("t1", "Read", "/root/x", "{}"), + Entry.Result("t1", "contents", false), Entry.Finished(null, usage = AgentHost.Usage(1, 0.5, 2, 3)), Entry.Finished("boom", stopped = true), + Entry.Finished(null, usage = AgentHost.Usage(1, 0.5, 2, 3, context = 40_000, window = 200_000), planned = true), + ) + written.forEach { AgentChats.append(file, it) } + file.appendText("broken line\n") + val loaded = AgentChats.read(file) + assertEquals("claude", loaded.harness) + assertEquals("abc", loaded.conversation) + assertEquals(listOf( + Entry.Asked("hi", listOf("/root/x.png")), Entry.Said("hello"), Entry.Thought("hm"), Entry.Used("t1", "Read", "/root/x", "{}", "contents", false), + Entry.Finished(null, usage = AgentHost.Usage(1, 0.5, 2, 3)), Entry.Finished("boom", stopped = true), + Entry.Finished(null, usage = AgentHost.Usage(1, 0.5, 2, 3, context = 40_000, window = 200_000), planned = true), + ), loaded.entries) + assertEquals(emptyList(), AgentChats.read(File(file.path + ".missing")).entries) + } + + @Test fun aTurnThatEndsWithNothingIsAnswerless() { + assertTrue(AgentHost.answerless(listOf(Entry.Said("x"), Entry.Asked("go on"), Entry.Finished(null)))) + assertFalse(AgentHost.answerless(listOf(Entry.Asked("go on"), Entry.Said("ok"), Entry.Finished(null)))) + assertFalse(AgentHost.answerless(listOf(Entry.Asked("go on"), Entry.Finished("boom")))) + assertFalse(AgentHost.answerless(listOf(Entry.Asked("go on"), Entry.Finished(null, stopped = true)))) + } + + @Test fun longOutputKeepsItsEnd() { + val clipped = AgentChats.clip("a".repeat(30_000) + "END") + assertTrue(clipped.endsWith("END") && clipped.length < 30_000) + } + + @Test fun attachmentsAreListedForTheAgent() { + assertEquals("look", AgentAttachments.prompt("look", emptyList())) + assertEquals("look\n\nAttached files (read them with your tools):\n- /root/a.png", AgentAttachments.prompt("look", listOf("/root/a.png"))) + } + + @Test fun procStatFieldsCountFromTheEndOfTheName() { + val stat = AgentProcesses.parseStat("1234 (java (x) y) S 1200 1234 1234 0 -1 4194304 10 0 0 0 150 50 0 0 20 0 30 0 98765 1000000 2048 18446744073709551615") + assertEquals(1200, stat.ppid) + assertEquals(200L, stat.ticks) + assertEquals(98765L, stat.startTicks) + assertEquals(2048L, stat.rssPages) + } + + @Test fun labProgressIsRead() { + val p = LabProgress.parse("""{"stage":"building","mode":"build","permille":420,"task":":app:compileReleaseKotlin","done":120,"total":300,"eta":95,"elapsed":30,"pid":77}""")!! + assertEquals(420, p.permille) + assertTrue(p.running && !p.prepare) + assertEquals(95, p.etaSeconds) + } + + @Test fun anEditBecomesALineDiffWithItsNearbyLines() { + assertEquals(" a\n b\n-c\n+C\n+D\n e\n f", lineDiff("x\na\nb\nc\ne\nf\ny", "x\na\nb\nC\nD\ne\nf\ny")) + assertEquals("+only", lineDiff("", "only")) + assertEquals("-gone", lineDiff("gone", "")) + assertEquals("+one\n+two", lineDiff("", "one\ntwo\n")) + } + + @Test fun claudeRateLimitsAndContextWindowAreRead() { + val event = ClaudeCode.parse("""{"type":"rate_limit_event","rate_limit_info":{"status":"allowed_warning","unifiedWindows":{"five_hour":{"utilization":0.07,"resetsAt":1794435600},"seven_day":{"utilization":0.85,"resetsAt":1794592800}}},"session_id":"s"}""")!! + assertEquals(listOf(AgentHost.Limit(300, 7, 1794435600), AgentHost.Limit(10_080, 85, 1794592800)), event.limits) + val result = ClaudeCode.parse("""{"type":"result","subtype":"success","is_error":false,"result":"done","usage":{},"modelUsage":{"claude-haiku":{"costUSD":0.01,"contextWindow":200000},"claude-sonnet":{"costUSD":0.7,"contextWindow":1000000}}}""")!! + assertEquals(1_000_000L, result.window) + } + + @Test fun codexTokenCountsCarryContextAndLimits() { + val event = Codex.tokenCount("""{"timestamp":"t","type":"event_msg","payload":{"type":"token_count","info":{"total_token_usage":{"total_tokens":90000},"last_token_usage":{"total_tokens":41000},"model_context_window":272000},"rate_limits":{"primary":{"used_percent":12.5,"window_minutes":300,"resets_at":1794435600},"secondary":{"used_percent":40.0,"window_minutes":10080,"resets_at":1794592800}}}}""")!! + assertEquals(41_000L, event.context) + assertEquals(272_000L, event.window) + assertEquals(listOf(AgentHost.Limit(300, 12, 1794435600), AgentHost.Limit(10_080, 40, 1794592800)), event.limits) + assertNull(Codex.tokenCount("""{"type":"event_msg","payload":{"type":"agent_message"}}""")) + } + + @Test fun codexUsageComesFromTheThreadsSessionLog() { + val root = Files.createTempDirectory("rootfs").toFile() + val log = File(root, "root/.codex/sessions/2026/11/12/rollout-2026-11-12T10-00-00-thread1.jsonl").apply { parentFile!!.mkdirs() } + log.writeText( + """{"type":"event_msg","payload":{"type":"token_count","info":{"last_token_usage":{"total_tokens":15692},"model_context_window":258400},"rate_limits":{"primary":{"used_percent":86.0,"window_minutes":10080,"resets_at":1794716485},"secondary":null}}}""" + "\n" + + """{"type":"response_item","payload":{"type":"additional_tools","tools":[{"description":"reports token_count as it goes"}]}}""" + "\n", + ) + val event = Codex.usage(root, "thread1")!! + assertEquals(15_692L, event.context) + assertEquals(258_400L, event.window) + assertEquals(listOf(AgentHost.Limit(10_080, 86, 1794716485)), event.limits) + assertNull(Codex.usage(root, "other")) + } + + @Test fun limitsRoundTripThroughPrefs() { + val limits = listOf(AgentHost.Limit(300, 7, 1794435600), AgentHost.Limit(10_080, 85, 1794592800)) + assertEquals(limits, AgentHost.decodeLimits(AgentHost.encodeLimits(limits))) + assertEquals(emptyList(), AgentHost.decodeLimits("not json")) + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/agent/AgentSetupRootTest.kt b/app/src/test/java/com/droiddeck/launcher/agent/AgentSetupRootTest.kt new file mode 100644 index 0000000000..5e5c1656c2 --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/agent/AgentSetupRootTest.kt @@ -0,0 +1,10 @@ +package com.droiddeck.launcher.agent + +import org.junit.Assert.assertEquals +import org.junit.Test + +class AgentSetupRootTest { + @Test fun onlyThePackageInstallRunsAsRoot() { + assertEquals(listOf(AgentSetup.Step.INSTALL), AgentSetup.Step.values().filter { AgentSetup.runsAsRoot(it) }) + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/agent/AgentStorageTest.kt b/app/src/test/java/com/droiddeck/launcher/agent/AgentStorageTest.kt new file mode 100644 index 0000000000..dc12206545 --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/agent/AgentStorageTest.kt @@ -0,0 +1,29 @@ +package com.droiddeck.launcher.agent + +import org.junit.Assert.assertEquals +import org.junit.Assert.assertFalse +import org.junit.Assert.assertTrue +import org.junit.Assume.assumeTrue +import org.junit.Test +import java.nio.file.Files + +class AgentStorageTest { + @Test fun removingAFolderKeepsWhatItsLinksPointAt() { + val base = Files.createTempDirectory("agent-storage") + val outside = Files.createDirectories(base.resolve("sdcard")) + Files.write(outside.resolve("save.dat"), ByteArray(100)) + val item = Files.createDirectories(base.resolve("rootfs/android-sdk")) + Files.write(item.resolve("a.jar"), ByteArray(10)) + val linked = runCatching { Files.createSymbolicLink(item.resolve("saves"), outside) }.isSuccess + assumeTrue("symbolic links need privileges on this OS", linked) + + assertTrue(AgentStorage.size(item) < 100) + AgentStorage.delete(item) + assertFalse(Files.exists(item)) + assertTrue(Files.exists(outside.resolve("save.dat"))) + } + + @Test fun aMissingPathHasNoSize() { + assertEquals(0L, AgentStorage.size(Files.createTempDirectory("agent-storage").resolve("gone"))) + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/agent/AgentToolsTest.kt b/app/src/test/java/com/droiddeck/launcher/agent/AgentToolsTest.kt new file mode 100644 index 0000000000..a806832b4e --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/agent/AgentToolsTest.kt @@ -0,0 +1,53 @@ +package com.droiddeck.launcher.agent + +import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue +import org.junit.Test +import java.io.File +import java.nio.file.Files + +class AgentToolsTest { + @Test fun serversAreReadFromTheListOutput() { + val output = "Checking MCP server healthโ€ฆ\n\nclaude.ai Claude Docs: https://api.anthropic.com/v1/pages/mcp - โœ” Connected\n" + + "files: npx -y @modelcontextprotocol/server-filesystem /root - โœ— Failed to connect\n" + val servers = AgentTools.parseServers(output) + assertEquals(listOf("claude.ai Claude Docs", "files"), servers.map { it.name }) + assertEquals("npx -y @modelcontextprotocol/server-filesystem /root", servers[1].target) + assertTrue(servers[0].account) + } + + @Test fun aUrlIsAddedOverHttpAndACommandOverStdio() { + assertEquals(listOf("mcp", "add", "--scope", "user", "--transport", "http", "sentry", "https://mcp.sentry.dev/mcp"), + AgentTools.addCommand("sentry", " https://mcp.sentry.dev/mcp ").drop(1)) + assertEquals(listOf("mcp", "add", "--scope", "user", "files", "--", "npx", "-y", "server", "/root"), + AgentTools.addCommand("files", "npx -y server /root").drop(1)) + } + + @Test fun aCommandKeepsItsQuotedArguments() { + assertEquals(listOf("python", "/root/My Tools/server.py", "--name", "it's", "a b"), + AgentTools.words("""python "/root/My Tools/server.py" --name "it's" a\ b""")) + assertEquals(listOf("sh", "-c", "echo \"hi\""), AgentTools.words("""sh -c 'echo "hi"'""")) + } + + @Test fun deletingASkillLeavesWhatItsLinksPointTo() { + val outside = Files.createTempDirectory("outside").toFile() + File(outside, "keep.txt").writeText("keep") + val skill = Files.createTempDirectory("skill").toFile() + File(skill, "SKILL.md").writeText("x") + Files.createSymbolicLink(File(skill, "resources").toPath(), outside.toPath()) + assertTrue(AgentTools.deleteTree(skill.toPath())) + assertTrue(!skill.exists()) + assertTrue(File(outside, "keep.txt").isFile) + outside.deleteRecursively() + } + + @Test fun aSkillsDescriptionComesFromItsFrontMatter() { + val file = Files.createTempFile("skill", ".md").toFile() + file.writeText("---\nname: deploy\ndescription: \"Ship the build\"\n---\nBody\n") + assertEquals("Ship the build", AgentTools.description(file)) + file.writeText("No front matter\ndescription: nope\n") + assertEquals("", AgentTools.description(file)) + file.delete() + assertEquals("", AgentTools.description(File(file.path))) + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/core/AddonPackTest.kt b/app/src/test/java/com/droiddeck/launcher/core/AddonPackTest.kt index 80c6ebd328..6e81d46a7d 100644 --- a/app/src/test/java/com/droiddeck/launcher/core/AddonPackTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/core/AddonPackTest.kt @@ -58,6 +58,29 @@ class AddonPackTest { assertFalse(AddonPack("sample", "", 0L, listOf("tool"), reuseDeviceCopy = false).installed(context)) } + @Test fun labBuildReusesInstalledPackDespiteDifferentSourcePin() { + installed("b".repeat(64)) + val pack = AddonPack("sample", "a".repeat(64), 1L, listOf("tool"), labBuild = true) + + assertTrue(pack.installed(context)) + assertEquals("b".repeat(64), pack.dir(context).name) + } + + @Test fun labBuildWithoutCompleteInstalledPackKeepsSourcePin() { + installed("b".repeat(64), complete = false) + val pack = AddonPack("sample", "a".repeat(64), 1L, listOf("tool"), labBuild = true) + + assertFalse(pack.installed(context)) + assertEquals("a".repeat(64), pack.dir(context).name) + } + + @Test fun aBuildWithoutThePackSaysSoWhenAwaited() { + val pack = AddonPack("sample", "", 0L, listOf("tool"), reuseDeviceCopy = false) + + assertFalse(pack.await(context)) + assertEquals("this build has no pack", pack.failure) + } + @Test fun localBuildInstallsTheBundledPackWithoutDownloading() { val archive = tarZst("tool" to "x") val pack = AddonPack("sample", Hashes.sha256(archive), archive.length(), listOf("tool"), bundle = { archive.inputStream() }) diff --git a/app/src/test/java/com/droiddeck/launcher/core/DownloaderFailureTest.kt b/app/src/test/java/com/droiddeck/launcher/core/DownloaderFailureTest.kt new file mode 100644 index 0000000000..c177d63f6b --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/core/DownloaderFailureTest.kt @@ -0,0 +1,85 @@ +package com.droiddeck.launcher.core + +import java.io.File +import java.net.ServerSocket +import java.nio.file.Files +import org.junit.After +import org.junit.Assert.assertEquals +import org.junit.Assert.assertFalse +import org.junit.Assert.assertNull +import org.junit.Assert.assertTrue +import org.junit.Before +import org.junit.Test + +class DownloaderFailureTest { + private lateinit var dir: File + + @Before fun setUp() { + dir = Files.createTempDirectory("downloader-failure").toFile() + } + + @After fun tearDown() { + dir.deleteRecursively() + } + + private fun serve(status: String, body: ByteArray = ByteArray(0)): ServerSocket { + val server = ServerSocket(0) + Thread { + runCatching { + server.accept().use { socket -> + val input = socket.getInputStream().bufferedReader(Charsets.ISO_8859_1) + while (true) { + val line = input.readLine() ?: break + if (line.isEmpty()) break + } + socket.getOutputStream().apply { + write("HTTP/1.1 $status\r\nContent-Length: ${body.size}\r\nConnection: close\r\n\r\n".toByteArray()) + write(body) + flush() + } + } + } + }.apply { isDaemon = true; start() } + return server + } + + private fun download(url: String): Boolean = + Downloader.downloadCandidates(url, listOf(url), File(dir, "file"), false, null, null) + + @Test fun anHttpRefusalIsReportedWithTheHostAndCode() { + serve("403 Forbidden").use { server -> + assertFalse(download("http://127.0.0.1:${server.localPort}/pack.tar.zst")) + } + assertEquals("127.0.0.1: HTTP 403", Downloader.lastFailure()) + } + + @Test fun aRefusedConnectionIsReportedWithItsException() { + val port = ServerSocket(0).use { it.localPort } + assertFalse(download("http://127.0.0.1:$port/pack.tar.zst")) + val failure = Downloader.lastFailure().orEmpty() + assertTrue(failure, failure.startsWith("127.0.0.1: ConnectException")) + } + + @Test fun aSuccessfulDownloadClearsTheEarlierFailure() { + serve("500 Internal Server Error").use { server -> + assertFalse(download("http://127.0.0.1:${server.localPort}/pack.tar.zst")) + } + serve("200 OK", "data".toByteArray()).use { server -> + assertTrue(download("http://127.0.0.1:${server.localPort}/pack.tar.zst")) + } + assertNull(Downloader.lastFailure()) + } + + @Test fun everyFailedSourceIsListedInOrder() { + val first = serve("403 Forbidden") + val second = serve("503 Service Unavailable") + val urls = listOf(first, second).map { "http://127.0.0.1:${it.localPort}/pack.tar.zst" } + try { + assertFalse(Downloader.downloadCandidates(urls[0], urls, File(dir, "file"), false, null, null)) + } finally { + first.close() + second.close() + } + assertEquals("127.0.0.1: HTTP 403; 127.0.0.1: HTTP 503", Downloader.lastFailure()) + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/core/GameResolutionTest.kt b/app/src/test/java/com/droiddeck/launcher/core/GameResolutionTest.kt new file mode 100644 index 0000000000..5a76e0525e --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/core/GameResolutionTest.kt @@ -0,0 +1,60 @@ +package com.droiddeck.launcher.core + +import com.droiddeck.launcher.session.NoSteamLaunch +import org.junit.Assert.assertEquals +import org.junit.Assert.assertNull +import org.junit.Test + +class GameResolutionTest { + @Test + fun choicesRoundTripThroughTheStoredValue() { + for (choice in listOf(GameResolution.Fixed(1280, 720), GameResolution.Scaled(1.5f), GameResolution.Scaled(2f))) { + assertEquals(choice, GameResolution.parse(GameResolution.format(choice))) + } + assertEquals("1280x720", GameResolution.format(GameResolution.Fixed(1280, 720))) + assertEquals("/1.5", GameResolution.format(GameResolution.Scaled(1.5f))) + } + + @Test + fun invalidValuesAreIgnored() { + for (value in listOf(null, "", "abc", "100x100", "1280", "1280x720x2", "/1", "/0.5", "/9")) { + assertNull(value, GameResolution.parse(value)) + } + } + + @Test + fun aScaleDividesTheOutputToEvenSides() { + assertEquals(1706 to 1066, GameResolution.resolve(GameResolution.Scaled(1.5f), 2560 to 1600)) + assertEquals(1280 to 800, GameResolution.resolve(GameResolution.Scaled(2f), 2560 to 1600)) + assertEquals(1280 to 720, GameResolution.resolve(GameResolution.Fixed(1280, 720), 2560 to 1600)) + } + + @Test + fun aspectRatiosAreNamed() { + assertEquals("16:9", GameResolution.aspectLabel(1920, 1080)) + assertEquals("16:10", GameResolution.aspectLabel(2560, 1600)) + assertEquals("4:3", GameResolution.aspectLabel(1024, 768)) + assertEquals("21:9", GameResolution.aspectLabel(2560, 1080)) + assertEquals("20:9", GameResolution.aspectLabel(2400, 1080)) + } + + @Test + fun presetsLargerThanThePanelAreLeftOut() { + val wide = GameResolution.aspects.first { it.label == "16:9" } + assertEquals(listOf(960 to 540, 1280 to 720, 1600 to 900, 1920 to 1080), + GameResolution.sizesFor(wide, 1920 to 1200).map { it.width to it.height }) + } + + @Test + fun theSessionFindsTheResolutionOfTheGameItStarts() { + val config = GameEnvironment.withGameResolution(GameEnvironment.Config(), "570", GameResolution.Fixed(1280, 800)) + val scope = NoSteamLaunch.scopeOf(NoSteamLaunch.PROTON_RUN, listOf("--app", "570")) + assertEquals("570", scope) + assertEquals(1280 to 800, NoSteamLaunch.resolution(config, scope, 2560 to 1600)) + assertNull(NoSteamLaunch.resolution(config, "440", 2560 to 1600)) + assertEquals("123", NoSteamLaunch.scopeOf(NoSteamLaunch.BATTLENET, listOf("launch", "WTCG")) { if (it == "WTCG") "123" else null }) + assertEquals(com.droiddeck.launcher.runtime.BattleNet.APP_ID.toString(), + NoSteamLaunch.scopeOf(NoSteamLaunch.BATTLENET, listOf("launch", "Pro"))) + assertNull(GameEnvironment.withGameResolution(config, "570", null).games["570"]) + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/frontend/AddedGamesCacheTest.kt b/app/src/test/java/com/droiddeck/launcher/frontend/AddedGamesCacheTest.kt index 7ef43d7b3c..e04022e806 100644 --- a/app/src/test/java/com/droiddeck/launcher/frontend/AddedGamesCacheTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/frontend/AddedGamesCacheTest.kt @@ -111,6 +111,38 @@ class AddedGamesCacheTest { assertEquals("Bastion", AddedGamesCache(file).name("named")) } + @Test fun aRewrittenManifestIsReadAgain() { + val folder = tmp.newFolder("Game") + val first = File(folder, "First.exe").apply { writeText("first") } + val second = File(folder, "Second.exe").apply { writeText("second") } + val manifest = File(folder, "MicrosoftGame.config").apply { writeText("") } + val files = tmp.newFolder("files") + val context = object : android.content.ContextWrapper(app) { + override fun getFilesDir() = files + } + AddedGames.scan(context) + assertEquals(first, AddedGames.rank(folder).exes.first()) + val modified = folder.lastModified() + manifest.writeText("") + folder.setLastModified(modified) + assertEquals(second, AddedGames.rank(folder, reuse = true).exes.first()) + } + + @Test fun aDeclaredExecutableThatArrivesLaterIsPicked() { + val folder = tmp.newFolder("Game") + val guessed = File(folder, "Game.exe").apply { writeText("game") } + val inner = File(folder, "Content").apply { mkdirs() } + File(folder, "MicrosoftGame.config").writeText("") + val files = tmp.newFolder("files") + val context = object : android.content.ContextWrapper(app) { + override fun getFilesDir() = files + } + AddedGames.scan(context) + assertEquals(guessed, AddedGames.rank(folder).exes.first()) + val late = File(inner, "Late.exe").apply { writeText("late") } + assertEquals(late, AddedGames.rank(folder, reuse = true).exes.first()) + } + @Test fun aRankingAScanReusedIsNotHandedToAFreshLookup() { val folder = tmp.newFolder("Game") val walked = File(folder, "Game.exe").apply { writeText("game") } diff --git a/app/src/test/java/com/droiddeck/launcher/frontend/SoundtrackCollectionsTest.kt b/app/src/test/java/com/droiddeck/launcher/frontend/SoundtrackCollectionsTest.kt new file mode 100644 index 0000000000..6aa9bb1640 --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/frontend/SoundtrackCollectionsTest.kt @@ -0,0 +1,43 @@ +package com.droiddeck.launcher.frontend + +import com.droiddeck.launcher.frontend.SoundtrackCollections.Collection +import com.droiddeck.launcher.frontend.SoundtrackCollections.TrackRef +import org.junit.Assert.assertEquals +import org.junit.Assert.assertFalse +import org.junit.Assert.assertTrue +import org.junit.Test +import org.junit.runner.RunWith +import org.robolectric.RobolectricTestRunner +import org.robolectric.annotation.Config + +@RunWith(RobolectricTestRunner::class) +@Config(sdk = [33]) +class SoundtrackCollectionsTest { + private fun ref(path: String) = TrackRef(path, path, "", "", 0) + + @Test fun toggledAddsThenRemoves() { + val once = SoundtrackCollections.toggled(emptyList(), ref("a")) + assertEquals(listOf("a"), once.map { it.path }) + assertTrue(SoundtrackCollections.toggled(once, ref("a")).isEmpty()) + } + + @Test fun mergedSkipsDuplicatesAndKeepsOrder() { + val result = SoundtrackCollections.merged(listOf(ref("a"), ref("b")), listOf(ref("b"), ref("c"), ref("c"))) + assertEquals(listOf("a", "b", "c"), result.map { it.path }) + } + + @Test fun cleanNameTrimsAndCollapsesSpaces() = assertEquals("My mix", SoundtrackCollections.cleanName(" My mix ")) + + @Test fun nameTakenIgnoresCaseAndExcludedId() { + val list = listOf(Collection(2_000_000_001, "Chill", emptyList())) + assertTrue(SoundtrackCollections.nameTaken(list, "chill")) + assertFalse(SoundtrackCollections.nameTaken(list, "chill", except = 2_000_000_001)) + assertFalse(SoundtrackCollections.nameTaken(list, "Focus")) + } + + @Test fun nextIdStartsAboveFavoritesAndGrows() { + assertEquals(SoundtrackCollections.FAVORITES_ID + 1, SoundtrackCollections.nextId(emptyList())) + val list = listOf(Collection(2_000_000_005, "x", emptyList())) + assertEquals(2_000_000_006, SoundtrackCollections.nextId(list)) + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/frontend/SoundtrackOrderTest.kt b/app/src/test/java/com/droiddeck/launcher/frontend/SoundtrackOrderTest.kt new file mode 100644 index 0000000000..167d2c96b9 --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/frontend/SoundtrackOrderTest.kt @@ -0,0 +1,34 @@ +package com.droiddeck.launcher.frontend + +import java.io.File +import org.junit.Assert.assertEquals +import org.junit.Test + +class SoundtrackOrderTest { + private fun track(name: String, disc: Int, number: Int) = Soundtrack.Track(File("/music/$name"), name, disc, number, 1000L) + + @Test fun savedOrderIsAppliedAndRenumbered() { + val disc = mapOf(1 to listOf(track("a", 1, 1), track("b", 1, 2), track("c", 1, 3))) + val result = SoundtrackOrder.ordered(disc, listOf("/music/c", "/music/a", "/music/b")) + assertEquals(listOf("c", "a", "b"), result.getValue(1).map { it.title }) + assertEquals(listOf(1, 2, 3), result.getValue(1).map { it.number }) + } + + @Test fun unknownTracksKeepTheirOrderAfterKnownOnes() { + val disc = mapOf(1 to listOf(track("a", 1, 1), track("b", 1, 2), track("c", 1, 3))) + val result = SoundtrackOrder.ordered(disc, listOf("/music/c")) + assertEquals(listOf("c", "a", "b"), result.getValue(1).map { it.title }) + } + + @Test fun discsStayApart() { + val disc = mapOf(1 to listOf(track("a", 1, 1), track("b", 1, 2)), 2 to listOf(track("c", 2, 1), track("d", 2, 2))) + val result = SoundtrackOrder.ordered(disc, listOf("/music/d", "/music/b", "/music/a", "/music/c")) + assertEquals(listOf("b", "a"), result.getValue(1).map { it.title }) + assertEquals(listOf("d", "c"), result.getValue(2).map { it.title }) + } + + @Test fun emptyOrderChangesNothing() { + val disc = mapOf(1 to listOf(track("a", 1, 1), track("b", 1, 2))) + assertEquals(disc, SoundtrackOrder.ordered(disc, emptyList())) + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/frontend/SoundtrackTest.kt b/app/src/test/java/com/droiddeck/launcher/frontend/SoundtrackTest.kt new file mode 100644 index 0000000000..ed96285429 --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/frontend/SoundtrackTest.kt @@ -0,0 +1,151 @@ +package com.droiddeck.launcher.frontend + +import org.junit.Assert.assertEquals +import org.junit.Assert.assertNull +import org.junit.Assert.assertTrue +import org.junit.Test +import java.io.File + +class SoundtrackTest { + private fun raw( + folder: String, name: String, disc: Int? = null, track: Int? = null, title: String? = null, size: Long = 1000L, + ) = Soundtrack.Raw(File("/music/album/${if (folder.isEmpty()) "" else "$folder/"}$name"), folder, disc, track, title, null, 60_000L, size) + + @Test fun titlesDropArtistAlbumAndNumber() { + assertEquals("Once Upon a Time", Soundtrack.cleanTitle("toby fox - UNDERTALE Soundtrack - 01 Once Upon a Time.mp3")) + assertEquals("ANOTHER HIM", Soundtrack.cleanTitle("001 ANOTHER HIM.flac")) + assertEquals("Chapter 5 Logo", Soundtrack.cleanTitle("166 Chapter 5 Logo.mp3")) + assertEquals("Query-", Soundtrack.cleanTitle("094 Query-.mp3")) + assertEquals("Ruins", Soundtrack.cleanTitle("Ruins.ogg")) + } + + @Test fun flatAlbumIsOneDiscOrderedByNumber() { + val disc = Soundtrack.group( + listOf(raw("", "toby fox - X - 10 Ten.mp3"), raw("", "toby fox - X - 02 Two.mp3"), raw("", "toby fox - X - 01 One.mp3")), + ) + assertEquals(listOf(0), disc.keys.toList()) + assertEquals(listOf("One", "Two", "Ten"), disc.getValue(0).map { it.title }) + assertEquals(listOf(1, 2, 3), disc.getValue(0).map { it.number }) + } + + @Test fun subfoldersBecomeDiscs() { + val disc = Soundtrack.group( + listOf(raw("2", "041 B.mp3"), raw("1", "001 A.mp3"), raw("10", "200 C.mp3"), raw("1", "002 A2.mp3")), + ) + assertEquals(listOf(1, 2, 3), disc.keys.toList()) + assertEquals(listOf("A", "A2"), disc.getValue(1).map { it.title }) + assertEquals(listOf("B"), disc.getValue(2).map { it.title }) + assertEquals(listOf("C"), disc.getValue(3).map { it.title }) + } + + @Test fun losslessCopyReplacesLossyDuplicateAndKeepsItsFolder() { + val disc = Soundtrack.group( + listOf( + raw("", "001 ANOTHER HIM.flac", size = 4_130_000L), + raw("", "002 Beginning.flac", size = 4_870_000L), + raw("1", "001 ANOTHER HIM.mp3", size = 1_940_000L), + raw("1", "002 Beginning.mp3", size = 2_320_000L), + raw("2", "041 Faint Glow.mp3"), + ), + ) + assertEquals(listOf(1, 2), disc.keys.toList()) + assertEquals(listOf("flac", "flac"), disc.getValue(1).map { it.file.extension }) + assertEquals(listOf("ANOTHER HIM", "Beginning"), disc.getValue(1).map { it.title }) + assertEquals(listOf("Faint Glow"), disc.getValue(2).map { it.title }) + } + + @Test fun tagsDecideDiscsAndFileNamesDecideOrder() { + val disc = Soundtrack.group( + listOf( + raw("3+4", "088 Late.mp3", disc = 4, track = 1, title = "Old wooden rafters"), + raw("3+4", "001 Early.mp3", disc = 3, track = 2, title = "Second"), + raw("3+4", "002 Early.mp3", disc = 3, track = 1, title = "First"), + ), + ) + assertEquals(listOf(3, 4), disc.keys.toList()) + assertEquals(listOf("Second", "First"), disc.getValue(3).map { it.title }) + assertEquals("Old wooden rafters", disc.getValue(4).single().title) + } + + @Test fun sameTagsCollapseDuplicates() { + val disc = Soundtrack.group( + listOf( + raw("", "a.flac", disc = 1, track = 1, title = "Song", size = 5000L), + raw("1", "a.mp3", disc = 1, track = 1, title = "Song", size = 900L), + ), + ) + assertEquals(1, disc.getValue(1).size) + assertEquals("flac", disc.getValue(1).single().file.extension) + } + + @Test fun renamedPunctuationStillMatchesAcrossFormats() { + val disc = Soundtrack.group( + listOf( + raw("", "094 Query?.flac", size = 5000L), + raw("3+4", "094 Query-.mp3", size = 900L), + raw("3+4", "095 Quiz!.mp3", size = 900L), + ), + ) + assertEquals(2, disc.getValue(0).size + disc.filterKeys { it != 0 }.values.sumOf { it.size }) + assertEquals(listOf("flac", "mp3"), disc.values.flatten().map { it.file.extension }) + } + + @Test fun sameTitleWithDifferentNumbersStaysSeparate() { + val disc = Soundtrack.group(listOf(raw("", "01 Fanfare.mp3"), raw("", "07 Fanfare.mp3"))) + assertEquals(2, disc.values.flatten().size) + } + + @Test fun folderDiscsKeepTheirFolderNameAsLabel() { + val disc = Soundtrack.group( + listOf(raw("3+4", "088 A.mp3", track = 1), raw("3+4", "165 B.mp3", track = 78), raw("5", "166 C.mp3", track = 1), raw("Bonus", "300 D.mp3")), + ) + assertEquals(listOf("3+4", "5", "3"), disc.values.map { it.first().discLabel }.let { it.take(2) + disc.getValue(3).first().discLabel }) + assertEquals(listOf("A", "B"), disc.getValue(1).map { it.title }) + } + + @Test fun tagsFromTheDroppedDuplicateFillTheKeptOne() { + val disc = Soundtrack.group( + listOf( + raw("", "165 Concert for you.flac", size = 90_000L), + raw("3+4", "165 Concert for you.mp3", track = 78, title = "Concert for you", size = 98_000L), + raw("", "088 Flashback (Excerpt).flac", size = 4_800_000L), + raw("3+4", "088 Flashback (Excerpt).mp3", track = 1, title = "Flashback (Excerpt)", size = 1_280_000L), + ), + ) + val tracks = disc.values.flatten() + assertEquals(listOf("Flashback (Excerpt)", "Concert for you"), tracks.map { it.title }) + assertEquals(listOf("flac", "flac"), tracks.map { it.file.extension }) + } + + @Test fun emptyInputGivesNothing() { + assertTrue(Soundtrack.group(emptyList()).isEmpty()) + } + + @Test fun lengthFormatting() { + assertEquals("0:48", Soundtrack.formatLength(48_000L)) + assertEquals("1:20", Soundtrack.formatLength(80_000L)) + assertEquals("4:15:37", Soundtrack.formatLength((4 * 3600 + 15 * 60 + 37) * 1000L)) + } + + @Test fun shortcutLinksRoundTrip() { + assertEquals(391540, SoundtrackShortcuts.parse(SoundtrackShortcuts.uri(391540))) + assertEquals(-5, SoundtrackShortcuts.parse(SoundtrackShortcuts.uri(-5))) + assertNull(SoundtrackShortcuts.parse("droiddeck://game/12")) + assertNull(SoundtrackShortcuts.parse(null)) + } + + @Test fun addedSoundtracksNeverCollideWithSteamIds() { + assertTrue(AddedSoundtracks.idOf("/storage/emulated/0/Music/Album") < 0) + } + + @Test fun addedIdsStayStableWhenAnotherFolderIsRemoved() { + assertEquals("Aa".hashCode(), "BB".hashCode()) + val first = AddedSoundtracks.Entry("/m/Aa", "A") + val second = AddedSoundtracks.Entry("/m/BB", "B") + val assigned = AddedSoundtracks.assignIds(listOf(first, second)) + assertTrue(assigned[0].id != assigned[1].id) + assertTrue(assigned.all { it.id < 0 }) + val after = AddedSoundtracks.assignIds(assigned.drop(1)) + assertEquals(assigned[1].id, after[0].id) + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/frontend/SoundtrackTracksTest.kt b/app/src/test/java/com/droiddeck/launcher/frontend/SoundtrackTracksTest.kt new file mode 100644 index 0000000000..c601653ca7 --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/frontend/SoundtrackTracksTest.kt @@ -0,0 +1,29 @@ +package com.droiddeck.launcher.frontend + +import org.junit.Assert.assertEquals +import org.junit.Assert.assertFalse +import org.junit.Assert.assertTrue +import org.junit.Test + +class SoundtrackTracksTest { + private class T(val title: String, val ms: Long) + private val items = listOf(T("banana", 300), T("Apple", 100), T("cherry", 200)) + private fun sorted(s: SoundtrackTracks.Sort) = SoundtrackTracks.sort(items, s, { it.title }, { it.ms }).map { it.title } + + @Test fun defaultKeepsOrder() = assertEquals(listOf("banana", "Apple", "cherry"), sorted(SoundtrackTracks.Sort.DEFAULT)) + @Test fun titleAscIgnoresCase() = assertEquals(listOf("Apple", "banana", "cherry"), sorted(SoundtrackTracks.Sort.TITLE_ASC)) + @Test fun titleDesc() = assertEquals(listOf("cherry", "banana", "Apple"), sorted(SoundtrackTracks.Sort.TITLE_DESC)) + @Test fun longestFirst() = assertEquals(listOf("banana", "cherry", "Apple"), sorted(SoundtrackTracks.Sort.LONGEST)) + @Test fun shortestFirst() = assertEquals(listOf("Apple", "cherry", "banana"), sorted(SoundtrackTracks.Sort.SHORTEST)) + + @Test fun blankQueryMatchesEverything() = assertTrue(SoundtrackTracks.matches(" ", "anything")) + @Test fun wordsMayHitDifferentFields() = assertTrue(SoundtrackTracks.matches("main theme", "Main Menu", "Theme Composer")) + @Test fun everyWordMustMatch() = assertFalse(SoundtrackTracks.matches("main boss", "Main Menu", "Composer")) + @Test fun matchIsCaseInsensitive() = assertTrue(SoundtrackTracks.matches("MENU", "main menu")) + + @Test fun rankOrdersExactPrefixContains() { + assertEquals(0, SoundtrackTracks.rank("Menu", "menu")) + assertEquals(1, SoundtrackTracks.rank("men", "Menu Theme")) + assertEquals(2, SoundtrackTracks.rank("theme", "Menu Theme")) + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/gpu/FrameGenTest.kt b/app/src/test/java/com/droiddeck/launcher/gpu/FrameGenTest.kt index f4c3b79ea0..5afd7f83a9 100644 --- a/app/src/test/java/com/droiddeck/launcher/gpu/FrameGenTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/gpu/FrameGenTest.kt @@ -2,6 +2,8 @@ package com.droiddeck.launcher.gpu import android.content.Context import org.junit.Assert.assertEquals +import org.junit.Assert.assertFalse +import org.junit.Assert.assertTrue import org.junit.Before import org.junit.Test import org.junit.runner.RunWith @@ -45,4 +47,22 @@ class FrameGenTest { .putString("engine", "winfg").putInt("multiplier", 2).commit() assertEquals(FrameGen.Mode(FrameGen.ENGINE_DDFG, 2), FrameGen.mode(context)) } + + @Test fun perGameOverrideIsIsolatedFromGlobalMode() { + val global = FrameGen.Mode(FrameGen.ENGINE_LSFG, target = 90) + val game = FrameGen.Mode(FrameGen.ENGINE_DDFG, 3) + + FrameGen.set(context, global) + FrameGen.setForGame(context, "12345", game) + + assertEquals(global, FrameGen.mode(context)) + assertEquals(game, FrameGen.mode(context, "12345")) + assertTrue(FrameGen.hasGameOverride(context, "12345")) + + FrameGen.clearGame(context, "12345") + + assertFalse(FrameGen.hasGameOverride(context, "12345")) + assertEquals(global, FrameGen.mode(context, "12345")) + } + } diff --git a/app/src/test/java/com/droiddeck/launcher/hud/CoreClockAverageTest.kt b/app/src/test/java/com/droiddeck/launcher/hud/CoreClockAverageTest.kt new file mode 100644 index 0000000000..80c1c7121c --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/hud/CoreClockAverageTest.kt @@ -0,0 +1,26 @@ +package com.droiddeck.launcher.hud + +import org.junit.Assert.assertEquals +import org.junit.Test + +class CoreClockAverageTest { + private val freqs = longArrayOf(902_400L, 1_459_200L, 2_803_200L) + + @Test fun aCoreShowsTheClockItRanAtThroughTheSample() { + val before = arrayOf(freqs, longArrayOf(100L, 50L, 10L)) + val after = arrayOf(freqs, longArrayOf(125L, 50L, 35L)) + assertEquals(1_852_800L, HudMetrics.averageKhz(before, after)) + } + + @Test fun theFirstSampleOrAChangedTableFallsBack() { + val after = arrayOf(freqs, longArrayOf(1L, 2L, 3L)) + assertEquals(-1L, HudMetrics.averageKhz(null, after)) + assertEquals(-1L, HudMetrics.averageKhz(arrayOf(longArrayOf(1L), longArrayOf(0L)), after)) + assertEquals(-1L, HudMetrics.averageKhz(after, after)) + } + + @Test fun theCpuClockIsTheFastestCore() { + assertEquals(2_803, HudMetrics.fastestCoreMhz(intArrayOf(902, 2_803, 1_459))) + assertEquals(null, HudMetrics.fastestCoreMhz(intArrayOf(0, 0))) + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/hud/DroidDeckHudPanelTest.kt b/app/src/test/java/com/droiddeck/launcher/hud/DroidDeckHudPanelTest.kt index a439e703b9..5a534ceb3a 100644 --- a/app/src/test/java/com/droiddeck/launcher/hud/DroidDeckHudPanelTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/hud/DroidDeckHudPanelTest.kt @@ -51,11 +51,12 @@ class DroidDeckHudPanelTest { key to if (mask and (1 shl index) != 0) "1" else "0" }.toMap() view.applyConfig(DroidDeckHudConfig.encode(DroidDeckHudConfig.DEFAULTS + - ("hudSize" to size.token) + settings)) + DroidDeckHudConfig.ORDER.associateWith { "0" } + settings + mapOf( + "hudSize" to size.token, "showFPSGraph" to "0", "showClock" to "0"))) view.showForTest(SNAPSHOT, "DXVK", 0L) val lines = view.linesForTest().joinToString(" ") for ((index, metric) in metrics.withIndex()) { - val supported = size != DroidDeckHudSize.TILES || index == 0 + val supported = metrics[index].first in size.rows val expected = supported && mask and (1 shl index) != 0 val label = Regex("(?): List { + val values = LinkedHashMap(DroidDeckHudConfig.DEFAULTS) + values["hudSize"] = DroidDeckHudSize.FULL.token + for ((key, value) in settings) values[key] = value + val view = DroidDeckHudView(RuntimeEnvironment.getApplication()) + view.applyConfig(DroidDeckHudConfig.encode(values)) + view.showForTest(SNAPSHOT, "DXVK", 0L) + return view.linesForTest() + } + assertTrue(full().toString(), full().any { "RAM67%" in it }) + val noRam = full("showRAM" to "0") + assertFalse(noRam.toString(), noRam.any { "RAM67%" in it }) + assertTrue(noRam.toString(), noRam.any { "FPS0.0" in it }) + } + + @Test fun theSavedOrderDecidesTheRowOrder() { + fun only(order: String): List { + val off = DroidDeckHudConfig.ORDER.associateWith { "0" } + val view = DroidDeckHudView(RuntimeEnvironment.getApplication()) + view.applyConfig(DroidDeckHudConfig.encode( + DroidDeckHudConfig.DEFAULTS + off + mapOf( + "hudSize" to DroidDeckHudSize.FULL.token, + "showPower" to "1", "showFPS" to "1", "showRAM" to "1", + "showFPSGraph" to "0", "showClock" to "0", "hudOrder" to order, + ))) + view.showForTest(SNAPSHOT, "DXVK", 0L) + return view.linesForTest().filter { !it.startsWith("DroidDeck") } + } + val powerFirst = only("full:showPower|showFPS|showRAM") + assertEquals(powerFirst.toString(), listOf("PWR", "FPS", "RAM"), powerFirst.map { it.take(3) }) + val ramFirst = only("full:showRAM|showFPS|showPower") + assertEquals(ramFirst.toString(), listOf("RAM", "FPS", "PWR"), ramFirst.map { it.take(3) }) + } + + @Test fun aSaveKeepsTheLegacyOrderForTheOtherSizes() { + val app = RuntimeEnvironment.getApplication() + SessionPrefs.setDroidDeckHudConfig(app, "hudSize=strip,hudOrder=showRAM|showFPS") + val saved = DroidDeckHudConfig.choose(app, emptyMap(), listOf("showFPS", "showRAM")) + assertEquals(listOf("showRAM", "showFPS"), DroidDeckHudConfig.storedOrder(saved, DroidDeckHudSize.FULL)) + assertEquals(listOf("showFPS", "showRAM"), DroidDeckHudConfig.storedOrder(saved, DroidDeckHudSize.STRIP)) + } + + @Test fun thePillHeroIsWhicheverRowTheUserPutsFirst() { + fun pill(order: String): List { + val off = DroidDeckHudConfig.ORDER.associateWith { "0" } + val view = DroidDeckHudView(RuntimeEnvironment.getApplication()) + view.applyConfig(DroidDeckHudConfig.encode( + DroidDeckHudConfig.DEFAULTS + off + mapOf( + "hudSize" to DroidDeckHudSize.PILL.token, + "showFPS" to "1", "showRAM" to "1", "showPower" to "1", + "showFPSGraph" to "0", "showClock" to "0", + "hudOrder" to order, + ))) + view.showForTest(SNAPSHOT, "DXVK", 0L) + return view.linesForTest() + } + val fpsFirst = pill("pill:showFPS|showRAM|showPower") + assertTrue(fpsFirst.toString(), fpsFirst.any { it.trim() == "0.0fps" }) + val fpsLast = pill("pill:showRAM|showPower|showFPS") + assertTrue(fpsLast.toString(), fpsLast.any { it.trim().startsWith("FPS") }) + assertFalse(fpsLast.toString(), fpsLast.any { it.trim() == "0.0fps" }) + } + @Test fun stripIsOneLineAcrossTheParentWithTheClockOnTheRight() { val app = RuntimeEnvironment.getApplication() val parent = FrameLayout(app) @@ -232,27 +297,24 @@ class DroidDeckHudPanelTest { } @Test fun pillShowsEachBatteryPartOnItsOwnSwitch() { - fun pill(vararg settings: Pair): List { + fun pill(vararg settings: Pair): String { val view = DroidDeckHudView(RuntimeEnvironment.getApplication()) view.applyConfig(DroidDeckHudConfig.encode(DroidDeckHudConfig.DEFAULTS + ("hudSize" to DroidDeckHudSize.PILL.token) + settings)) view.showForTest(SNAPSHOT, "DXVK", 0L) - return view.linesForTest() + return view.linesForTest().toString() } - val all = pill("showBattery" to "1") - assertTrue(all.toString(), all.any { "BAT 79% ยท 34ยฐC ยท 16.0W" in it }) - assertEquals(all.toString(), 1, all.count { "BAT" in it }) - assertFalse(all.toString(), all.single { "RAM" in it }.contains("BAT")) - - val noMemory = pill("showBattery" to "1", "showRAM" to "0") - assertTrue(noMemory.toString(), noMemory.none { "RAM" in it }) - assertTrue(noMemory.toString(), noMemory.any { "BAT 79% ยท 34ยฐC ยท 16.0W" in it }) - val defaults = pill() - assertTrue(defaults.toString(), defaults.any { "BAT 34ยฐC ยท 16.0W" in it }) - val wattsOnly = pill("showBatteryTemp" to "0") - assertTrue(wattsOnly.toString(), wattsOnly.any { "BAT 16.0W" in it }) - val nothing = pill("showBatteryTemp" to "0", "showPower" to "0") - assertTrue(nothing.toString(), nothing.none { "BAT" in it }) + assertTrue(defaults, defaults.contains("BAT.T")) + assertTrue(defaults, defaults.contains("PWR")) + assertFalse(defaults, defaults.contains("BAT79%")) + val levelOn = pill("showBattery" to "1") + assertTrue(levelOn, levelOn.contains("BAT79%")) + val tempOff = pill("showBatteryTemp" to "0") + assertFalse(tempOff, tempOff.contains("BAT.T")) + assertTrue(tempOff, tempOff.contains("PWR")) + val powerOff = pill("showPower" to "0") + assertFalse(powerOff, powerOff.contains("PWR")) + assertTrue(powerOff, powerOff.contains("BAT.T")) } @Test fun aLockedHudLetsTouchesThroughOnlyWhereAControlTakesThem() { diff --git a/app/src/test/java/com/droiddeck/launcher/hud/FrameStatsTest.kt b/app/src/test/java/com/droiddeck/launcher/hud/FrameStatsTest.kt index 724275fd35..20e83499e8 100644 --- a/app/src/test/java/com/droiddeck/launcher/hud/FrameStatsTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/hud/FrameStatsTest.kt @@ -81,6 +81,21 @@ class FrameStatsTest { assertEquals(0, stats.slowFrames(now, 60_000_000_000L)) } + @Test fun guestFrameTimesMoveByThePausedSessionsClockShift() { + val control = java.io.File.createTempFile("bl-clock", null) + try { + control.writeBytes(java.nio.ByteBuffer.allocate(8).order(java.nio.ByteOrder.LITTLE_ENDIAN).putLong(62_283_930_706L).array()) + val feed = GameFrameFeed(java.io.File("/nonexistent/droiddeck-hud/frames"), clockControl = control) + assertEquals(62_283_930_706L, feed.guestClockShift(1_000_000_000L, 1_000_000_000L)) + control.writeBytes(java.nio.ByteBuffer.allocate(8).order(java.nio.ByteOrder.LITTLE_ENDIAN).putLong(70_000_000_000L).array()) + assertEquals(62_283_930_706L, feed.guestClockShift(1_050_000_000L, 1_000_000_000L)) + assertEquals(70_000_000_000L, feed.guestClockShift(1_200_000_000L, 100_000_000L)) + assertEquals(0L, GameFrameFeed(java.io.File("/nonexistent/droiddeck-hud/frames")).guestClockShift(0L, 0L)) + } finally { + control.delete() + } + } + @Test fun compositorFramesDoNotCountAsLiveGamescopeFrames() { val feed = GameFrameFeed(java.io.File("/nonexistent/droiddeck-hud/frames")) var now = 1_000_000_000L diff --git a/app/src/test/java/com/droiddeck/launcher/hud/MangoReadingsTest.kt b/app/src/test/java/com/droiddeck/launcher/hud/MangoReadingsTest.kt index 4de40ea2a2..8d841612d6 100644 --- a/app/src/test/java/com/droiddeck/launcher/hud/MangoReadingsTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/hud/MangoReadingsTest.kt @@ -37,12 +37,14 @@ class MangoReadingsTest { assertEquals(100, m.cpu(stat)!!.percent) } - private fun battery(status: String, chargeNow: Long, chargeFull: Long, powerUw: Long) { + private fun battery(status: String, chargeNow: Long, chargeFull: Long, powerUw: Long, currentUa: Long = 1_000_000L) { val dir = File(tmp.root, "sys/power_supply/BAT1").apply { mkdirs() } File(dir, "status").writeText("$status\n") File(dir, "charge_now").writeText("$chargeNow\n") File(dir, "charge_full").writeText("$chargeFull\n") File(dir, "power_now").writeText("$powerUw\n") + File(dir, "current_now").writeText("$currentUa\n") + File(dir, "voltage_now").writeText("4000000\n") } @Test fun batteryHidesWattsWhileChargingAsMangoHudDoes() { @@ -50,13 +52,42 @@ class MangoReadingsTest { val discharging = readings().battery()!! assertEquals(94, discharging.percent) assertEquals(8.76f, discharging.watts, 0.001f) + assertEquals("3 hrs 37 mins", discharging.runtimeText) assertFalse(discharging.charging) battery("Charging", 3_622_942, 3_854_193, 8_760_000) val charging = readings().battery()!! assertEquals(0f, charging.watts, 0f) + assertEquals("Charging", charging.runtimeText) assertTrue(charging.charging) } + @Test fun dualBatteryRuntimeSumsBothPacksAndBothCurrents() { + battery("Discharging", 2_000_000, 3_000_000, 2_000_000, 500_000) + val second = File(tmp.root, "sys/power_supply/BAT2").apply { mkdirs() } + File(second, "status").writeText("Discharging\n") + File(second, "charge_now").writeText("2000000\n") + File(second, "charge_full").writeText("3000000\n") + File(second, "power_now").writeText("2000000\n") + File(second, "current_now").writeText("500000\n") + File(second, "voltage_now").writeText("4000000\n") + val result = readings().battery()!! + assertEquals(67, result.percent) + assertEquals("4 hrs", result.runtimeText) + assertEquals(4f, result.watts, 0.001f) + } + + @Test fun energyOnlyBatteryConvertsEnergyToChargeBeforeEstimatingRuntime() { + val dir = File(tmp.root, "sys/power_supply/BAT1").apply { mkdirs() } + File(dir, "status").writeText("Discharging\n") + File(dir, "energy_now").writeText("4000000\n") + File(dir, "energy_full").writeText("5000000\n") + File(dir, "current_now").writeText("1000000\n") + File(dir, "voltage_now").writeText("4000000\n") + val result = readings().battery()!! + assertEquals(80, result.percent) + assertEquals("1 hr", result.runtimeText) + } + @Test fun noBatteryFolderMeansNoReading() { assertNull(readings().battery()) } diff --git a/app/src/test/java/com/droiddeck/launcher/input/JoyConPadTest.kt b/app/src/test/java/com/droiddeck/launcher/input/JoyConPadTest.kt index 0b8c930ed0..cff58d665e 100644 --- a/app/src/test/java/com/droiddeck/launcher/input/JoyConPadTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/input/JoyConPadTest.kt @@ -147,6 +147,75 @@ class JoyConPadTest { assertNull(RecordingWriter.pads[2]) } + @Test fun aControllerThatDisconnectsWhileItsKeyIsHandledIsIgnored() { + for (lookups in 0..4) { + val event = key(right, KeyEvent.KEYCODE_BUTTON_A, BTN_SOUTH) + PadBridgeRoutingTest.RegisteredKeyEvent.lookupsLeft = lookups + try { + val handled = bridge.onKeyEvent(event) + if (lookups == 0) assertFalse(handled) + if (lookups >= 2) assertTrue(handled) + } finally { PadBridgeRoutingTest.RegisteredKeyEvent.lookupsLeft = -1 } + } + assertTrue(press(right, KeyEvent.KEYCODE_BUTTON_A, BTN_SOUTH)) + } + + @Test fun aControllerThatDisconnectsAfterTheFirstLookupStillDeliversItsEvents() { + val device = controller(0x045e, 0x0b13, MotionEvent.AXIS_X, MotionEvent.AXIS_Y) + val down = key(device, KeyEvent.KEYCODE_BUTTON_A, BTN_SOUTH) + val up = key(device, KeyEvent.KEYCODE_BUTTON_A, BTN_SOUTH, KeyEvent.ACTION_UP) + val move = motion(device, MotionEvent.AXIS_X to 0.5f, MotionEvent.AXIS_Y to -0.25f) + try { + PadBridgeRoutingTest.RegisteredKeyEvent.lookupsLeft = 1 + assertTrue(bridge.onKeyEvent(down)) + assertEquals(0, PadBridgeRoutingTest.RegisteredKeyEvent.lookupsLeft) + assertTrue(pad(0).isDown(PadState.A)) + PadBridgeRoutingTest.RegisteredKeyEvent.lookupsLeft = 1 + assertTrue(bridge.onKeyEvent(up)) + assertFalse(pad(0).isDown(PadState.A)) + PadBridgeRoutingTest.RegisteredMotionEvent.lookupsLeft = 1 + assertTrue(bridge.onMotionEvent(move)) + assertEquals(0, PadBridgeRoutingTest.RegisteredMotionEvent.lookupsLeft) + assertEquals(0.5f, pad(0).leftX) + assertEquals(-0.25f, pad(0).leftY) + } finally { + PadBridgeRoutingTest.RegisteredKeyEvent.lookupsLeft = -1 + PadBridgeRoutingTest.RegisteredMotionEvent.lookupsLeft = -1 + } + } + + @Test fun nonControllerInputStaysUnhandledWithOneLookup() { + val keyboard = InputDeviceBuilder.newBuilder().setId(nextId++).setName("Keyboard").setDescriptor("keyboard") + .setExternal(true).setSources(InputDevice.SOURCE_KEYBOARD) + .setKeyboardType(InputDevice.KEYBOARD_TYPE_ALPHABETIC) + .setKeyCharacterMap(KeyCharacterMap.load(KeyCharacterMap.VIRTUAL_KEYBOARD)).build().also(::register) + val typed = KeyEvent(0L, 0L, KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_A, 0, 0, keyboard.id, 30, 0, InputDevice.SOURCE_KEYBOARD) + val touch = MotionEvent.obtain(0L, 0L, MotionEvent.ACTION_MOVE, 1, arrayOf(MotionEvent.PointerProperties().apply { id = 0 }), + arrayOf(MotionEvent.PointerCoords().apply { x = 10f; y = 20f }), 0, 0, 1f, 1f, keyboard.id, 0, InputDevice.SOURCE_TOUCHSCREEN, 0) + try { + PadBridgeRoutingTest.RegisteredKeyEvent.lookupsLeft = 1 + assertFalse(bridge.onKeyEvent(typed)) + PadBridgeRoutingTest.RegisteredMotionEvent.lookupsLeft = 1 + assertFalse(bridge.onMotionEvent(touch)) + } finally { + PadBridgeRoutingTest.RegisteredKeyEvent.lookupsLeft = -1 + PadBridgeRoutingTest.RegisteredMotionEvent.lookupsLeft = -1 + } + assertNull(RecordingWriter.pads[0]) + } + + @Test fun wiredMotionKeepsItsAxesWhenDeviceDisappears() { + val device = controller(0x20d6, 0x2063, MotionEvent.AXIS_RX, MotionEvent.AXIS_RY, MotionEvent.AXIS_Z, MotionEvent.AXIS_RZ) + val event = motion(device, MotionEvent.AXIS_RX to 0.75f, MotionEvent.AXIS_RY to -0.5f, + MotionEvent.AXIS_Z to -1f, MotionEvent.AXIS_RZ to 1f) + PadBridgeRoutingTest.RegisteredMotionEvent.lookupsLeft = 2 + try { assertTrue(bridge.onMotionEvent(event)) } finally { PadBridgeRoutingTest.RegisteredMotionEvent.lookupsLeft = -1 } + assertEquals(0.75f, pad(0).rightX) + assertEquals(-0.5f, pad(0).rightY) + assertEquals(0f, pad(0).leftTrigger) + assertEquals(1f, pad(0).rightTrigger) + } + @Test fun joyConsHeldForVrAreLeftAlone() { bridge.setExcluded { it == left.id } assertFalse(bridge.onKeyEvent(key(left, KeyEvent.KEYCODE_BUTTON_L1, BTN_TL))) diff --git a/app/src/test/java/com/droiddeck/launcher/input/PadBridgeRoutingTest.kt b/app/src/test/java/com/droiddeck/launcher/input/PadBridgeRoutingTest.kt index a76da590a3..ea66f32136 100644 --- a/app/src/test/java/com/droiddeck/launcher/input/PadBridgeRoutingTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/input/PadBridgeRoutingTest.kt @@ -191,12 +191,24 @@ class PadBridgeRoutingTest { @Implements(KeyEvent::class) class RegisteredKeyEvent : ShadowKeyEvent() { @RealObject private lateinit var event: KeyEvent - @Implementation override fun getDevice(): InputDevice? = Shadow.directlyOn(event as InputEvent, InputEvent::class.java, "getDevice") + @Implementation override fun getDevice(): InputDevice? { + if (lookupsLeft == 0) return null + if (lookupsLeft > 0) lookupsLeft-- + return Shadow.directlyOn(event as InputEvent, InputEvent::class.java, "getDevice") + } + + companion object { @JvmField var lookupsLeft = -1 } } @Implements(MotionEvent::class) class RegisteredMotionEvent : ShadowMotionEvent() { @RealObject private lateinit var event: MotionEvent - @Implementation override fun getDevice(): InputDevice? = Shadow.directlyOn(event as InputEvent, InputEvent::class.java, "getDevice") + @Implementation override fun getDevice(): InputDevice? { + if (lookupsLeft == 0) return null + if (lookupsLeft > 0) lookupsLeft-- + return Shadow.directlyOn(event as InputEvent, InputEvent::class.java, "getDevice") + } + + companion object { @JvmField var lookupsLeft = -1 } } } diff --git a/app/src/test/java/com/droiddeck/launcher/input/PadPartialAxesTest.kt b/app/src/test/java/com/droiddeck/launcher/input/PadPartialAxesTest.kt index 2a2bade1c4..ae46c9d5e3 100644 --- a/app/src/test/java/com/droiddeck/launcher/input/PadPartialAxesTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/input/PadPartialAxesTest.kt @@ -126,11 +126,11 @@ class PadPartialAxesTest { @Test fun wiredXboxTriggerKeysDoNotOverrideTheirAxes() { val device = device(MotionEvent.AXIS_RX, MotionEvent.AXIS_RY, MotionEvent.AXIS_Z, MotionEvent.AXIS_RZ, wired = true) - motion(device, MotionEvent.AXIS_Z to 0f, MotionEvent.AXIS_RZ to -1f) + motion(device, MotionEvent.AXIS_Z to 0f, MotionEvent.AXIS_RZ to -0.6f) key(device, KeyEvent.KEYCODE_BUTTON_L2) key(device, KeyEvent.KEYCODE_BUTTON_R2) assertEquals(0.5f, pad().leftTrigger) - assertEquals(0f, pad().rightTrigger) + assertEquals(0.2f, pad().rightTrigger, 0.0001f) } @Test fun digitalTriggerKeysStillPressAndRelease() { @@ -148,11 +148,46 @@ class PadPartialAxesTest { } @Test fun keyTriggerDecision() { - assertEquals(1f, PadBridge.keyTrigger(0f, true, 0, false)) - assertEquals(0f, PadBridge.keyTrigger(1f, false, 0, false)) - assertEquals(0.25f, PadBridge.keyTrigger(0.25f, true, 1, false)) - assertEquals(0.25f, PadBridge.keyTrigger(0.25f, true, 0, true)) - assertEquals(0.25f, PadBridge.keyTrigger(0.25f, false, 0, true)) + val held = BooleanArray(2) + assertEquals(1f, PadBridge.keyTrigger(0f, true, 0, false, held, 0)) + assertEquals(0f, PadBridge.keyTrigger(1f, false, 0, false, held, 0)) + assertEquals(0.25f, PadBridge.keyTrigger(0.25f, true, 1, false, held, 0)) + assertEquals(0.25f, PadBridge.keyTrigger(0.25f, true, 0, true, held, 0)) + assertEquals(0.25f, PadBridge.keyTrigger(0.25f, false, 0, true, held, 0)) + assertEquals(1f, PadBridge.keyTrigger(0f, true, 0, true, held, 1)) + assertEquals(1f, PadBridge.axisTrigger(0f, held, 1)) + assertEquals(0f, PadBridge.keyTrigger(1f, false, 0, true, held, 1)) + assertEquals(0f, PadBridge.axisTrigger(0f, held, 1)) + } + + @Test fun silentTriggerAxesLetTheirKeysPress() { + val device = device(MotionEvent.AXIS_LTRIGGER, MotionEvent.AXIS_RTRIGGER) + motion(device) + key(device, KeyEvent.KEYCODE_BUTTON_L2) + key(device, KeyEvent.KEYCODE_BUTTON_R2) + assertEquals(1f, pad().leftTrigger) + assertEquals(1f, pad().rightTrigger) + motion(device, MotionEvent.AXIS_X to 0.8f) + key(device, KeyEvent.KEYCODE_BUTTON_L2, repeat = 1) + assertEquals(1f, pad().leftTrigger) + assertEquals(1f, pad().rightTrigger) + key(device, KeyEvent.KEYCODE_BUTTON_L2, KeyEvent.ACTION_UP) + assertEquals(0f, pad().leftTrigger) + assertEquals(1f, pad().rightTrigger) + key(device, KeyEvent.KEYCODE_BUTTON_R2, KeyEvent.ACTION_UP) + assertEquals(0f, pad().rightTrigger) + } + + @Test fun aLiveAxisTakesOverFromItsKey() { + val device = device(MotionEvent.AXIS_LTRIGGER) + key(device, KeyEvent.KEYCODE_BUTTON_L2) + assertEquals(1f, pad().leftTrigger) + motion(device, MotionEvent.AXIS_LTRIGGER to 0.4f) + assertEquals(0.4f, pad().leftTrigger) + motion(device, MotionEvent.AXIS_LTRIGGER to 0f) + assertEquals(0f, pad().leftTrigger) + key(device, KeyEvent.KEYCODE_BUTTON_L2, KeyEvent.ACTION_UP) + assertEquals(0f, pad().leftTrigger) } private fun pad(): PadState = requireNotNull(JoyConPadTest.RecordingWriter.pads[0]) diff --git a/app/src/test/java/com/droiddeck/launcher/input/SteamTouchConfigFilesTest.kt b/app/src/test/java/com/droiddeck/launcher/input/SteamTouchConfigFilesTest.kt index 96ff9a1c4e..845104bf51 100644 --- a/app/src/test/java/com/droiddeck/launcher/input/SteamTouchConfigFilesTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/input/SteamTouchConfigFilesTest.kt @@ -113,4 +113,34 @@ class SteamTouchConfigFilesTest { assertEquals(1, entries.findAll(File(dir, "configset_controller_mobile_touch.vdf").readText()).count()) assertEquals(0, entries.findAll(File(dir, "configset_MT-DROIDDECK0001.vdf").readText()).count()) } + + @Test fun savesLayoutWhenNoTouchConfigExistsOnDisk() { + val config = SteamTouchConfig.load(context, 413150) + assertEquals(null, config.file) + assertEquals(null, config.text) + val elements = listOf(SteamTouchConfig.Element(SteamTouchConfig.A, true, 0.5f, 0.6f)) + val saved = SteamTouchConfig.saveLayouts(context, 413150, config, mapOf(1 to elements)) + assertEquals(File(dir, "413150/controller_mobile_touch.vdf"), saved) + assertTrue(saved!!.readText().contains("\"touch_layout\"")) + val loaded = SteamTouchConfig.load(context, 413150) + assertEquals(saved, loaded.file) + val a = SteamTouchConfig.elementsFor(loaded, 1, emptyList()).first { it.type == SteamTouchConfig.A } + assertEquals(0.5f, a.x, 0.002f) + assertEquals(0.6f, a.y, 0.002f) + } + + @Test fun savingDoesNotOverwriteUnreadableExistingTouchConfig() { + configset("configset_controller_mobile_touch.vdf", "413150" to "\"autosave\"\t\t\"1\"") + val file = File(dir, "413150/controller_mobile_touch.vdf").apply { + parentFile!!.mkdirs() + writeText("\"controller_mappings\"\n{\n\t\"controller_type\"\t\t\"controller_mobile_touch\"\n\t\"touch_layout\"\t\t\"zz\"\n}\n") + } + val original = file.readBytes() + val config = SteamTouchConfig.load(context, 413150) + assertEquals(file, config.file) + assertEquals(null, config.text) + val saved = SteamTouchConfig.saveLayouts(context, 413150, config, emptyMap()) + assertEquals(null, saved) + assertTrue(original.contentEquals(file.readBytes())) + } } diff --git a/app/src/test/java/com/droiddeck/launcher/lab/LabOverlayTest.kt b/app/src/test/java/com/droiddeck/launcher/lab/LabOverlayTest.kt new file mode 100644 index 0000000000..ee60999fbc --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/lab/LabOverlayTest.kt @@ -0,0 +1,154 @@ +package com.droiddeck.launcher.lab + +import android.app.Application +import com.droiddeck.launcher.BuildConfig +import org.junit.After +import org.junit.Assert.assertEquals +import org.junit.Assert.assertFalse +import org.junit.Assert.assertNotNull +import org.junit.Assert.assertNull +import org.junit.Assert.assertTrue +import org.junit.Before +import org.junit.Test +import org.junit.runner.RunWith +import org.robolectric.RobolectricTestRunner +import org.robolectric.RuntimeEnvironment +import org.robolectric.annotation.Config +import java.io.File + +@RunWith(RobolectricTestRunner::class) +@Config(sdk = [33], manifest = Config.NONE) +class LabOverlayTest { + private lateinit var app: Application + private lateinit var root: File + private val injected = mutableListOf() + private val originalInject = LabOverlay.injectDex + private val originalResources = LabOverlay.openResources + + @Before fun prepare() { + app = RuntimeEnvironment.getApplication() + app.applicationInfo.sourceDir = "/data/app/~~test==/com.droiddeck.launcher-test==/base.apk" + root = LabOverlay.root(app).apply { deleteRecursively(); mkdirs() } + LabOverlay.injectDex = { _, apk -> injected += apk } + LabOverlay.openResources = { null } + } + + @After fun restore() { + LabOverlay.injectDex = originalInject + LabOverlay.openResources = originalResources + root.deleteRecursively() + } + + private fun stage(dir: String, commit: String = BuildConfig.SOURCE_COMMIT, apk: String = app.applicationInfo.sourceDir) = + File(root, dir).apply { + mkdirs() + File(this, "overlay.apk").writeText("dex") + File(this, "overlay.json").writeText("""{"label":"feat/x @ abc1234","baseCommit":"$commit","baseApk":"$apk"}""") + } + + @Test fun aBuildForThisInstallIsLoaded() { + stage("active") + LabOverlay.load(app, mainProcess = true) + assertEquals("feat/x @ abc1234", LabOverlay.active?.label) + assertEquals(listOf(File(root, "active/overlay.apk")), injected) + assertEquals(1, LabOverlay.failedStarts(root)) + } + + @Test fun aStagedBuildIsPromotedAtStart() { + stage("next") + File(root, "starts").writeText("2") + LabOverlay.load(app, mainProcess = true) + assertFalse(File(root, "next").exists()) + assertNotNull(LabOverlay.active) + assertEquals(1, LabOverlay.failedStarts(root)) + } + + @Test fun aBuildForAnotherInstallIsTurnedOff() { + stage("active", commit = "0000000") + LabOverlay.load(app, mainProcess = true) + assertNull(LabOverlay.active) + assertTrue(injected.isEmpty()) + assertFalse(File(root, "active").exists()) + assertEquals("OTHER_INSTALL", File(root, "last-off-reason").readText()) + } + + @Test fun aBuildForAnEarlierInstallOfTheSameCommitIsTurnedOff() { + stage("active", apk = "/data/app/old/base.apk") + LabOverlay.load(app, mainProcess = true) + assertNull(LabOverlay.active) + assertEquals("OTHER_INSTALL", File(root, "last-off-reason").readText()) + } + + @Test fun aBuildThatKeepsFailingToStartIsTurnedOff() { + stage("active") + File(root, "starts").writeText("2") + LabOverlay.load(app, mainProcess = true) + assertNull(LabOverlay.active) + assertEquals("DID_NOT_START", File(root, "last-off-reason").readText()) + } + + @Test fun otherProcessesLoadWithoutCountingStarts() { + stage("active") + LabOverlay.load(app, mainProcess = false) + assertNotNull(LabOverlay.active) + assertEquals(0, LabOverlay.failedStarts(root)) + } + + @Test fun noBuildMeansNothingIsLoaded() { + LabOverlay.load(app, mainProcess = true) + assertNull(LabOverlay.active) + assertTrue(injected.isEmpty()) + assertFalse(LabOverlay.promoted) + } + + @Test fun aNewBuildKeepsTheOneItReplaces() { + stage("active") + stage("next") + LabOverlay.load(app, mainProcess = true) + assertTrue(LabOverlay.promoted) + val saved = LabOverlay.saved(app).single() + assertEquals(LabOverlay.Reason.REPLACED, saved.reason) + assertTrue(saved.usable) + } + + @Test fun aRefusedBuildIsKeptButNotUsable() { + stage("active", commit = "0000000") + LabOverlay.load(app, mainProcess = true) + val saved = LabOverlay.saved(app).single() + assertEquals(LabOverlay.Reason.OTHER_INSTALL, saved.reason) + assertFalse(saved.usable) + } + + @Test fun aKeptBuildCanBeStagedAgain() { + stage("active", commit = "0000000") + LabOverlay.load(app, mainProcess = true) + stage("active") + LabOverlay.archive(root, File(root, "active"), LabOverlay.Reason.TURNED_OFF) + val usable = LabOverlay.saved(app).first { it.usable } + LabOverlay.stage(app, usable) + assertNotNull(LabOverlay.pending(app)) + assertEquals(1, LabOverlay.saved(app).size) + LabOverlay.load(app, mainProcess = true) + assertTrue(LabOverlay.promoted) + assertNotNull(LabOverlay.active) + } + + @Test fun stagingAKeptBuildKeepsTheOneThatWasWaiting() { + stage("builds/1") + stage("next") + File(root, "next/overlay.json").writeText("""{"label":"feat/y @ def5678","baseCommit":"${BuildConfig.SOURCE_COMMIT}","baseApk":"${app.applicationInfo.sourceDir}"}""") + LabOverlay.stage(app, LabOverlay.saved(app).single()) + assertEquals("feat/x @ abc1234", LabOverlay.pending(app)?.label) + val kept = LabOverlay.saved(app).single() + assertEquals("feat/y @ def5678", kept.info?.label) + assertEquals(LabOverlay.Reason.REPLACED, kept.reason) + } + + @Test fun onlyTheNewestBuildsAreKept() { + repeat(15) { + stage("active") + LabOverlay.archive(root, File(root, "active"), LabOverlay.Reason.TURNED_OFF) + } + assertEquals(12, LabOverlay.saved(app).size) + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/runtime/BattleNetTest.kt b/app/src/test/java/com/droiddeck/launcher/runtime/BattleNetTest.kt index 1af73baef4..f74528c725 100644 --- a/app/src/test/java/com/droiddeck/launcher/runtime/BattleNetTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/runtime/BattleNetTest.kt @@ -259,6 +259,29 @@ class BattleNetTest { BattleNet.hostFolder(context, "Z:/root/Games/Stores/Battle.net/Hearthstone/")) } + @Test fun aMappedWineDriveResolvesThroughItsLink() { + val devices = File(BattleNet.prefix(context), "pfx/dosdevices").apply { mkdirs() } + java.nio.file.Files.createSymbolicLink(File(devices, "d:").toPath(), java.nio.file.Paths.get("/root/Games/Card")) + java.nio.file.Files.createSymbolicLink(File(devices, "e:").toPath(), java.nio.file.Paths.get("../drive_c")) + assertEquals(File(LinuxRuntime.rootDir(context), "root/Games/Card/Battle.net/Hearthstone"), + BattleNet.hostFolder(context, "D:\\Battle.net\\Hearthstone")) + assertEquals(File(BattleNet.prefix(context), "pfx/drive_c/Games/X"), BattleNet.hostFolder(context, "E:\\Games\\X")) + assertNull(BattleNet.hostFolder(context, "F:\\Games\\X")) + assertNull(BattleNet.hostFolder(context, "D:\\..\\etc")) + } + + @Test fun aDriveLinkTheNativeUserlandMadeRelativeStillResolvesInTheGuest() { + val root = LinuxRuntime.rootDir(context) + val devices = File(BattleNet.prefix(context), "pfx/dosdevices").apply { mkdirs() } + java.nio.file.Files.createSymbolicLink(File(devices, "d:").toPath(), java.nio.file.Paths.get("/root/Games/Card")) + java.nio.file.Files.createSymbolicLink(File(devices, "g:").toPath(), java.nio.file.Paths.get("../../../../../../../../../../..")) + NativeGuest.relinkAbsoluteSymlinks(context, root) + assertFalse(java.nio.file.Files.readSymbolicLink(File(devices, "d:").toPath()).isAbsolute) + assertEquals(File(root, "root/Games/Card/Battle.net/Hearthstone"), + BattleNet.hostFolder(context, "D:\\Battle.net\\Hearthstone")) + assertNull(BattleNet.hostFolder(context, "G:\\etc\\passwd")) + } + @Test fun wowForeverIsListedBesideRetailInTheSharedWorldOfWarcraftFolder() { val pfx = File(BattleNet.prefix(context), "pfx").apply { mkdirs() } @@ -351,6 +374,20 @@ class BattleNetTest { } + @Test fun aScannedGamesShortcutReusesTheKeptRankingInsteadOfWalkingItsFolder() { + val added = com.droiddeck.launcher.frontend.AddedGames + val folder = File(BattleNet.prefix(context), "pfx/drive_c/Program Files (x86)/Kept Game").apply { mkdirs() } + File(folder, "Game.exe").writeBytes(byteArrayOf(0x4d, 0x5a)) + val kept = File(folder, "Other.exe").apply { writeBytes(byteArrayOf(0x4d, 0x5a)) } + com.droiddeck.launcher.frontend.AddedGamesCache(File(context.filesDir, com.droiddeck.launcher.frontend.AddedGamesCache.FILE)).apply { + keepRank(folder, com.droiddeck.launcher.frontend.GameExePicker.Ranking(listOf(kept), listOf(10), false)) + save() + } + added.scan(context) + assertEquals(kept, BattleNet.shortcut(context, BattleNet.Game("fenris", "Kept Game", "Fen", folder))!!.exe) + assertEquals("Game.exe", added.candidates(folder).first().name) + } + @Test fun aGamesShortcutHasBattleNetLaunchItInItsPrefix() { val folder = File(BattleNet.prefix(context), "pfx/drive_c/Program Files (x86)/Diablo IV").apply { mkdirs() } File(folder, "Diablo IV Launcher.exe").writeBytes(byteArrayOf(0x4d, 0x5a)) diff --git a/app/src/test/java/com/droiddeck/launcher/runtime/BwrapSpawnerTest.kt b/app/src/test/java/com/droiddeck/launcher/runtime/BwrapSpawnerTest.kt index a71063bf35..23db657ed5 100644 --- a/app/src/test/java/com/droiddeck/launcher/runtime/BwrapSpawnerTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/runtime/BwrapSpawnerTest.kt @@ -55,6 +55,26 @@ class BwrapSpawnerTest { assertTrue(Bind("/rootfs/etc/droiddeck/proc/stat", "/newproc/stat") in binds) } + @Test fun theSessionsRootfsSettingsStayOutOfTheSandbox() { + val rootfs = "/data/app/linuxfs" + val env = mutableMapOf( + "DDNATV_ROOT" to rootfs, "DDNATV_BINDS" to "/dev:/dev", "HOME" to "/root", + "SPA_PLUGIN_DIR" to "/usr/local/lib/droiddeck-pipewire/lib/spa-0.2", + "LD_PRELOAD" to "/run/droiddeck-preload/libblsession.so:$rootfs/usr/local/lib/libblsession.so:$rootfs/usr/lib/libddnatv-hook.so", + ) + BwrapSpawner.withoutRootfsSettings(env, rootfs) + assertEquals(mapOf("HOME" to "/root", "LD_PRELOAD" to "/run/droiddeck-preload/libblsession.so"), env) + val onlySession = mutableMapOf("LD_PRELOAD" to "$rootfs/usr/lib/libddnatv-hook.so") + BwrapSpawner.withoutRootfsSettings(onlySession, rootfs) + assertTrue(onlySession.isEmpty()) + val wayland = mutableMapOf("SDL_VIDEODRIVER" to "x11", "WAYLAND_DISPLAY" to "wayland-0") + BwrapSpawner.withoutRootfsSettings(wayland, rootfs) + assertEquals(mapOf("WAYLAND_DISPLAY" to "wayland-0"), wayland) + val x11 = mutableMapOf("SDL_VIDEODRIVER" to "x11", "WAYLAND_DISPLAY" to "wayland-0", "DISPLAY" to ":99") + BwrapSpawner.withoutRootfsSettings(x11, rootfs) + assertEquals("x11", x11["SDL_VIDEODRIVER"]) + } + @Test fun normalizeResolvesDotsLexically() { assertEquals("/usr/lib/x", BwrapSpawner.normalize("/usr/lib/GL/../x")) assertEquals("/", BwrapSpawner.normalize("/../..")) diff --git a/app/src/test/java/com/droiddeck/launcher/runtime/ElfSeccompPatchTest.kt b/app/src/test/java/com/droiddeck/launcher/runtime/ElfSeccompPatchTest.kt new file mode 100644 index 0000000000..386017d154 --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/runtime/ElfSeccompPatchTest.kt @@ -0,0 +1,53 @@ +package com.droiddeck.launcher.runtime + +import java.nio.ByteBuffer +import java.nio.ByteOrder +import org.junit.Assert.assertEquals +import org.junit.Test + +class ElfSeccompPatchTest { + private fun elfWith(vararg words: Int): ByteArray { + val data = ByteArray(0x200) + val b = ByteBuffer.wrap(data).order(ByteOrder.LITTLE_ENDIAN) + b.put(0, 0x7f); b.put(1, 'E'.code.toByte()); b.put(2, 'L'.code.toByte()); b.put(3, 'F'.code.toByte()) + b.put(4, 2); b.put(5, 1) + b.putShort(18, 183) + b.putLong(32, 64) + b.putShort(54, 56); b.putShort(56, 1) + b.putInt(64, 1); b.putInt(68, 5) + b.putLong(72, 0x100); b.putLong(96, 0x100) + words.forEachIndexed { i, w -> b.putInt(0x100 + i * 4, w) } + return data + } + + @Test + fun theSvcAfterEachBlockedCallIsAnsweredInPlace() { + val svc = 0xd4000001.toInt() + val data = elfWith(0xd2800c68.toInt(), 0xaa0003e1.toInt(), svc, 0xd28024a8.toInt(), svc, 0xd2803668.toInt(), svc) + assertEquals(3, ElfSeccompPatch.patch(data)) + val b = ByteBuffer.wrap(data).order(ByteOrder.LITTLE_ENDIAN) + assertEquals(0xd503201f.toInt(), b.getInt(0x108)) + assertEquals(0x928004a0.toInt(), b.getInt(0x110)) + assertEquals(0x928004a0.toInt(), b.getInt(0x118)) + assertEquals(0, ElfSeccompPatch.patch(data)) + } + + @Test + fun aSecondRunLeavesTheNextCallAlone() { + val svc = 0xd4000001.toInt() + val exit = 0xd2800ba8.toInt() + for (blocked in listOf(0xd2803668.toInt(), 0xd2800c68.toInt())) { + val data = elfWith(blocked, svc, 0xaa1303e0.toInt(), exit, svc) + assertEquals(1, ElfSeccompPatch.patch(data)) + assertEquals(0, ElfSeccompPatch.patch(data)) + assertEquals(svc, ByteBuffer.wrap(data).order(ByteOrder.LITTLE_ENDIAN).getInt(0x110)) + } + } + + @Test + fun otherSystemCallsAreLeftAlone() { + val svc = 0xd4000001.toInt() + val data = elfWith(0xd2800ba8.toInt(), svc) + assertEquals(0, ElfSeccompPatch.patch(data)) + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/runtime/LinuxRuntimeRootPrefixTest.kt b/app/src/test/java/com/droiddeck/launcher/runtime/LinuxRuntimeRootPrefixTest.kt new file mode 100644 index 0000000000..e956781db9 --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/runtime/LinuxRuntimeRootPrefixTest.kt @@ -0,0 +1,54 @@ +package com.droiddeck.launcher.runtime + +import android.app.Application +import android.system.Os +import android.system.StructUtsname +import androidx.test.core.app.ApplicationProvider +import org.junit.Assert.assertEquals +import org.junit.Assert.assertFalse +import org.junit.Assert.assertTrue +import org.junit.Test +import org.junit.runner.RunWith +import org.robolectric.RobolectricTestRunner +import org.robolectric.annotation.Config +import org.robolectric.annotation.Implementation +import org.robolectric.annotation.Implements +import java.io.File + +@RunWith(RobolectricTestRunner::class) +@Config(sdk = [33], manifest = Config.NONE, application = Application::class, shadows = [LinuxRuntimeRootPrefixTest.Uname::class]) +class LinuxRuntimeRootPrefixTest { + private val context: Application = ApplicationProvider.getApplicationContext() + private val root = File(context.filesDir, "rootfs") + private val guest = listOf("/usr/bin/dpkg", "--configure", "-a") + + @Test fun fakeRootEmulatesHardLinksForPackageManagers() { + val cmd = LinuxRuntime.commandWithBinds(context, root, emptyList(), guest, true) + assertTrue("-0" in cmd) + assertTrue("--link2symlink" in cmd) + assertFalse("-i" in cmd) + assertEquals(guest, cmd.takeLast(guest.size)) + } + + @Test fun rootSpawnerAndFakeRootCommandsShareOnePrefix() { + assertEquals(LinuxRuntime.rootPrefix(context, root, "/root"), + LinuxRuntime.commandWithBinds(context, root, emptyList(), emptyList(), true)) + } + + @Test fun userCommandsKeepTheAppUidAndRealLinks() { + val cmd = LinuxRuntime.commandWithBinds(context, root, emptyList(), guest) + val uid = android.os.Process.myUid() + assertFalse("-0" in cmd) + assertFalse("--link2symlink" in cmd) + assertEquals("$uid:$uid", cmd[cmd.indexOf("-i") + 1]) + assertEquals(LinuxRuntime.prootPrefix(context, root, "/root"), cmd.dropLast(guest.size)) + } + + @Implements(Os::class) + class Uname { + companion object { + @JvmStatic @Implementation + fun uname() = StructUtsname("Linux", "localhost", "6.1.0", "#1 SMP", "aarch64") + } + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/runtime/NativeGuestTest.kt b/app/src/test/java/com/droiddeck/launcher/runtime/NativeGuestTest.kt new file mode 100644 index 0000000000..3188eb4e62 --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/runtime/NativeGuestTest.kt @@ -0,0 +1,99 @@ +package com.droiddeck.launcher.runtime + +import java.io.File +import java.nio.file.Files +import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue +import org.junit.Test + +class NativeGuestTest { + private fun rootWithLoader(): File = Files.createTempDirectory("native-root").toFile().also { + File(it, "usr/lib").mkdirs() + File(it, "usr/lib/ld-linux-aarch64.so.1").writeText("") + } + + @Test + fun theSeccompSwitchNamesAHelperAndItsArgumentsInTheRootfs() { + val root = Files.createTempDirectory("rootfs").toFile() + assertEquals(null, NativeGuest.simulator(root)) + File(root, "usr/local/bin").mkdirs() + File(root, "usr/local/bin/seccomp-sim").writeText("") + File(root, "etc/droiddeck").mkdirs() + File(root, "etc/droiddeck/seccomp-sim").writeText("/usr/local/bin/seccomp-sim -f /etc/droiddeck/app.bpf\n") + assertEquals(listOf(File(root, "usr/local/bin/seccomp-sim").path, "-f", File(root, "etc/droiddeck/app.bpf").path), + NativeGuest.simulator(root)) + File(root, "etc/droiddeck/seccomp-sim").writeText("/usr/local/bin/missing") + assertEquals(null, NativeGuest.simulator(root)) + } + + @Test + fun aWorkingDirectoryInAMountIsItsSource() { + val root = Files.createTempDirectory("rootfs").toFile() + val storage = Files.createTempDirectory("storage").toFile() + File(root, "root").mkdirs() + // a mount spec is "src:dst"; Windows' drive letters cannot be written in one + org.junit.Assume.assumeFalse(storage.path.contains(':')) + val binds = listOf("${storage.path}:/root/Storage", "/proc") + assertEquals(storage, NativeGuest.workingDirectory(root, binds, "/root/Storage")) + assertEquals(File(root, "root"), NativeGuest.workingDirectory(root, binds, "/root")) + assertEquals(root, NativeGuest.workingDirectory(root, binds, "/nowhere")) + } + + @Test + fun commandRunsTheProgramThroughTheRootfsLoader() { + val root = rootWithLoader() + val command = NativeGuest.command(root, "/usr/bin/env", listOf("-i", "A=1")) + assertEquals(File(root, "usr/lib/ld-linux-aarch64.so.1").path, command[0]) + assertEquals(listOf("--argv0", "env", File(root, "usr/bin/env").path, "-i", "A=1"), command.drop(1)) + } + + @Test + fun mountsWithoutADestinationMapToThemselves() { + val root = rootWithLoader() + val env = NativeGuest.sessionEnvironment(root, listOf("/dev", "/a:/b")) + assertEquals("/dev:/dev|/a:/b", env["DDNATV_BINDS"]) + assertEquals(root.path, env["DDNATV_ROOT"]) + assertTrue(env.getValue("LD_PRELOAD").replace(File.separatorChar, '/').endsWith("usr/lib/libddnatv-hook.so")) + } + + private val linkRoot = "/data/user/0/app/files/linuxfs" + private val sdBinds = listOf( + "/mnt/media_rw/CARD/files/steam:/mnt/droiddeck-sd", + "/data/user/0/app/files/steam-libraries/x/steamapps/compatdata:/mnt/droiddeck-sd/steamapps/compatdata", + "/storage/emulated/0", + ) + + @Test + fun aDriveLinkToTheCardGetsItsGuestPathBack() { + assertEquals("/mnt/droiddeck-sd", NativeGuest.guestLinkTarget("/mnt/media_rw/CARD/files/steam", linkRoot, sdBinds)) + assertEquals("/mnt/droiddeck-sd/steamapps/compatdata/1", + NativeGuest.guestLinkTarget("/data/user/0/app/files/steam-libraries/x/steamapps/compatdata/1", linkRoot, sdBinds)) + } + + @Test + fun aDriveLinkIntoTheRootfsGetsItsGuestPathBack() { + assertEquals("/", NativeGuest.guestLinkTarget(linkRoot, linkRoot, sdBinds)) + assertEquals("/root/Games", NativeGuest.guestLinkTarget("$linkRoot/root/Games", linkRoot, sdBinds)) + } + + @Test + fun guestPathsStayAsTheyAre() { + assertEquals(null, NativeGuest.guestLinkTarget("/mnt/droiddeck-sd", linkRoot, sdBinds)) + assertEquals(null, NativeGuest.guestLinkTarget("/", linkRoot, sdBinds)) + assertEquals(null, NativeGuest.guestLinkTarget("../drive_c", linkRoot, sdBinds)) + assertEquals(null, NativeGuest.guestLinkTarget("/storage/emulated/0/Games", linkRoot, sdBinds)) + } + + @Test + fun aSiblingOfAMountSourceIsNotPartOfIt() { + assertEquals(null, NativeGuest.guestLinkTarget("/mnt/media_rw/CARD/files/steamx", linkRoot, sdBinds)) + assertEquals(null, NativeGuest.guestLinkTarget("${linkRoot}x/root", linkRoot, sdBinds)) + } + + @Test + fun theFirstOfMountsSharingASourceIsTheGuestPath() { + val binds = sdBinds + "/data/user/0/app/files/steam-libraries/x/steamapps/compatdata:/mnt/bannerlator-sd/steamapps/compatdata" + assertEquals("/mnt/droiddeck-sd/steamapps/compatdata/2", + NativeGuest.guestLinkTarget("/data/user/0/app/files/steam-libraries/x/steamapps/compatdata/2", linkRoot, binds)) + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/runtime/ProotFastPathTest.kt b/app/src/test/java/com/droiddeck/launcher/runtime/ProotFastPathTest.kt index 12fb45bf91..f413618942 100644 --- a/app/src/test/java/com/droiddeck/launcher/runtime/ProotFastPathTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/runtime/ProotFastPathTest.kt @@ -33,4 +33,8 @@ class ProotFastPathTest { assertFalse(ProotFastPath.allows(preference = false, noSeccomp = false, source = LinuxRuntime.PROOT_PACK)) assertFalse(ProotFastPath.allows(preference = true, noSeccomp = true, source = LinuxRuntime.PROOT_PACK)) } + + @Test fun fastPathStaysOffWithoutProot() { + assertFalse(ProotFastPath.allows(preference = true, noSeccomp = false, source = LinuxRuntime.PROOT_PACK, nativeUserland = true)) + } } diff --git a/app/src/test/java/com/droiddeck/launcher/runtime/RuntimeCatalogFailureTest.kt b/app/src/test/java/com/droiddeck/launcher/runtime/RuntimeCatalogFailureTest.kt new file mode 100644 index 0000000000..bf2bc01340 --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/runtime/RuntimeCatalogFailureTest.kt @@ -0,0 +1,72 @@ +package com.droiddeck.launcher.runtime + +import android.app.Application +import java.net.ServerSocket +import org.junit.Assert.assertEquals +import org.junit.Assert.assertNotNull +import org.junit.Assert.assertNull +import org.junit.Assert.assertTrue +import org.junit.Test +import org.junit.runner.RunWith +import org.robolectric.RobolectricTestRunner +import org.robolectric.annotation.Config + +@RunWith(RobolectricTestRunner::class) +@Config(sdk = [28], application = Application::class) +class RuntimeCatalogFailureTest { + private fun serve(body: String): ServerSocket { + val server = ServerSocket(0) + val bytes = body.toByteArray() + Thread { + runCatching { + server.accept().use { socket -> + val input = socket.getInputStream().bufferedReader(Charsets.ISO_8859_1) + while (true) { + val line = input.readLine() ?: break + if (line.isEmpty()) break + } + socket.getOutputStream().apply { + write("HTTP/1.1 200 OK\r\nContent-Length: ${bytes.size}\r\nConnection: close\r\n\r\n".toByteArray()) + write(bytes) + flush() + } + } + } + }.apply { isDaemon = true; start() } + return server + } + + private fun fetch(body: String): LinuxRuntimeInstaller.Release? = + serve(body).use { LinuxRuntimeInstaller.fetchRelease("http://127.0.0.1:${it.localPort}/linuxfs.json") } + + @Test fun anEmptyCatalogIsReported() { + assertNull(fetch("")) + assertEquals("empty catalog", LinuxRuntimeInstaller.catalogError()) + } + + @Test fun aMalformedCatalogIsReported() { + assertNull(fetch("captive portal")) + val error = LinuxRuntimeInstaller.catalogError().orEmpty() + assertTrue(error, error.startsWith("invalid catalog: ")) + } + + @Test fun aCatalogMissingFieldsIsReported() { + assertNull(fetch("""{"version":"1","url":"http://127.0.0.1/rootfs.tar.zst"}""")) + assertEquals("catalog lacks version, url or sha256", LinuxRuntimeInstaller.catalogError()) + } + + @Test fun anUnreachableCatalogKeepsTheDownloadReason() { + val port = ServerSocket(0).use { it.localPort } + assertNull(LinuxRuntimeInstaller.fetchRelease("http://127.0.0.1:$port/linuxfs.json")) + val error = LinuxRuntimeInstaller.catalogError().orEmpty() + assertTrue(error, error.startsWith("127.0.0.1: ConnectException")) + } + + @Test fun aValidCatalogClearsTheEarlierError() { + assertNull(fetch("")) + val release = fetch("""{"version":"2","url":"http://127.0.0.1/rootfs.tar.zst","sha256":"${"a".repeat(64)}","size":5}""") + assertNotNull(release) + assertEquals("2", release!!.version) + assertNull(LinuxRuntimeInstaller.catalogError()) + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/runtime/RuntimeInstallRollbackTest.kt b/app/src/test/java/com/droiddeck/launcher/runtime/RuntimeInstallRollbackTest.kt index 45b8019bb8..ac17c29c82 100644 --- a/app/src/test/java/com/droiddeck/launcher/runtime/RuntimeInstallRollbackTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/runtime/RuntimeInstallRollbackTest.kt @@ -40,7 +40,7 @@ class RuntimeInstallRollbackTest { private data class Attempt(val root: File, val staging: File, val old: File, val result: Boolean) - private fun attempt(failRollback: Boolean): Attempt { + private fun packedContext(): Context { val files = tmp.newFolder("files") val cache = tmp.newFolder("cache") val context = object : ContextWrapper(RuntimeEnvironment.getApplication()) { @@ -58,6 +58,29 @@ class RuntimeInstallRollbackTest { required.forEach { put(directory, it, "test pack") } put(directory, AddonPack.COMPLETE, version) } + return context + } + + private fun serveOnce(server: ServerSocket, head: String, body: ByteArray = ByteArray(0)) = Thread { + runCatching { + server.accept().use { socket -> + socket.soTimeout = 5000 + val input = socket.getInputStream().bufferedReader(Charsets.ISO_8859_1) + while (true) { + val line = input.readLine() ?: break + if (line.isEmpty()) break + } + val out = socket.getOutputStream() + out.write(("$head\r\nContent-Length: ${body.size}\r\nConnection: close\r\n\r\n").toByteArray()) + out.write(body) + out.flush() + } + } + }.apply { isDaemon = true; start() } + + private fun attempt(failRollback: Boolean): Attempt { + val context = packedContext() + val files = context.filesDir val root = LinuxRuntime.rootDir(context) val staging = File(files, LinuxRuntime.DIR + ".new") val old = File(files, LinuxRuntime.DIR + ".old") @@ -87,22 +110,7 @@ class RuntimeInstallRollbackTest { } else failRollback && path == File(old, "root/rollback-block").toPath() } val server = ServerSocket(0) - val thread = Thread { - runCatching { - server.accept().use { socket -> - socket.soTimeout = 5000 - val input = socket.getInputStream().bufferedReader(Charsets.ISO_8859_1) - while (true) { - val line = input.readLine() ?: break - if (line.isEmpty()) break - } - val out = socket.getOutputStream() - out.write(("HTTP/1.1 200 OK\r\nContent-Length: ${payload.size}\r\nConnection: close\r\n\r\n").toByteArray()) - out.write(payload) - out.flush() - } - } - }.apply { isDaemon = true; start() } + val thread = serveOnce(server, "HTTP/1.1 200 OK", payload) try { val release = LinuxRuntimeInstaller.Release("synthetic", "http://127.0.0.1:${server.localPort}/runtime.tar.zst", digest, payload.size.toLong()) val result = LinuxRuntimeInstaller.install(context, release, null) @@ -137,4 +145,212 @@ class RuntimeInstallRollbackTest { assertEquals("original app", File(attempt.root, "opt/appimages/user/game/app.AppImage").readText()) assertFalse(attempt.staging.exists()) } + + private fun failedInstall(context: Context, head: String): String? { + val server = ServerSocket(0) + val thread = serveOnce(server, head) + try { + val release = LinuxRuntimeInstaller.Release("synthetic", "http://127.0.0.1:${server.localPort}/runtime.tar.zst", "a".repeat(64), 1L) + assertFalse(LinuxRuntimeInstaller.install(context, release, null)) + return LinuxRuntimeInstaller.installError() + } finally { + server.close() + thread.join(1000) + } + } + + @Test fun aRefusedRuntimeDownloadNamesTheStepAndTheServerAnswer() { + val context = packedContext() + assertEquals("Cannot download the runtime: 127.0.0.1: HTTP 403", failedInstall(context, "HTTP/1.1 403 Forbidden")) + } + + @Test fun eachInstallReportsItsOwnFailureOnly() { + val context = packedContext() + failedInstall(context, "HTTP/1.1 403 Forbidden") + assertEquals("Cannot download the runtime: 127.0.0.1: HTTP 404", failedInstall(context, "HTTP/1.1 404 Not Found")) + } + + @Test fun anInstallInFlightKeepsTheLastFailureReadable() { + val context = packedContext() + val first = failedInstall(context, "HTTP/1.1 403 Forbidden") + val server = ServerSocket(0) + val accepted = java.util.concurrent.CountDownLatch(1) + val release = java.util.concurrent.CountDownLatch(1) + val stall = Thread { + runCatching { + server.accept().use { socket -> + accepted.countDown() + release.await() + socket.getOutputStream().write("HTTP/1.1 404 Not Found\r\nContent-Length: 0\r\nConnection: close\r\n\r\n".toByteArray()) + } + } + }.apply { isDaemon = true; start() } + var secondReason: String? = null + val second = Thread { + LinuxRuntimeInstaller.install(context, + LinuxRuntimeInstaller.Release("synthetic", "http://127.0.0.1:${server.localPort}/runtime.tar.zst", "a".repeat(64), 1L), null) + secondReason = LinuxRuntimeInstaller.installError() + }.apply { isDaemon = true; start() } + try { + assertTrue(accepted.await(10, java.util.concurrent.TimeUnit.SECONDS)) + assertTrue(LinuxRuntimeInstaller.isInstalling()) + assertEquals(first, LinuxRuntimeInstaller.installError()) + } finally { + release.countDown() + second.join(10000) + server.close() + stall.join(1000) + } + assertEquals("Cannot download the runtime: 127.0.0.1: HTTP 404", secondReason) + assertEquals(first, LinuxRuntimeInstaller.installError()) + } + + @Test fun anInstallRejectedDuringMaintenanceReportsItsOwnReason() { + val context = packedContext() + failedInstall(context, "HTTP/1.1 403 Forbidden") + val maintenance = LinuxRuntimeInstaller.beginMaintenance(context, "maintenance")!! + try { + assertFalse(LinuxRuntimeInstaller.install(context, + LinuxRuntimeInstaller.Release("synthetic", "http://127.0.0.1:1/runtime.tar.zst", "a".repeat(64), 1L), null)) + assertEquals("Runtime busy: maintenance in progress", LinuxRuntimeInstaller.installError()) + } finally { + assertTrue(maintenance.run(null) { null }) + } + assertEquals("Cannot download the runtime: 127.0.0.1: HTTP 404", failedInstall(context, "HTTP/1.1 404 Not Found")) + } + + @Test fun aRejectedInstallKeepsItsBusyReasonAfterALaterInstallCompletes() { + val context = packedContext() + val maintenance = LinuxRuntimeInstaller.beginMaintenance(context, "maintenance")!! + try { + assertFalse(LinuxRuntimeInstaller.install(context, + LinuxRuntimeInstaller.Release("synthetic", "http://127.0.0.1:1/runtime.tar.zst", "a".repeat(64), 1L), null)) + } finally { + assertTrue(maintenance.run(null) { null }) + } + var later: String? = null + Thread { later = failedInstall(context, "HTTP/1.1 404 Not Found") }.apply { start(); join(10000) } + assertEquals("Cannot download the runtime: 127.0.0.1: HTTP 404", later) + assertEquals("Runtime busy: maintenance in progress", LinuxRuntimeInstaller.installError()) + } + + @Test fun aJoinedInstallReportsTheReasonOfTheInstallItJoined() { + val context = packedContext() + val server = ServerSocket(0) + val accepted = java.util.concurrent.CountDownLatch(1) + val answer = java.util.concurrent.CountDownLatch(1) + val attached = java.util.concurrent.CountDownLatch(1) + val joinedDone = java.util.concurrent.CountDownLatch(1) + val readNow = java.util.concurrent.CountDownLatch(1) + val stall = Thread { + runCatching { + server.accept().use { socket -> + accepted.countDown() + answer.await() + socket.getOutputStream().write("HTTP/1.1 404 Not Found\r\nContent-Length: 0\r\nConnection: close\r\n\r\n".toByteArray()) + } + } + }.apply { isDaemon = true; start() } + val release = LinuxRuntimeInstaller.Release("synthetic", "http://127.0.0.1:${server.localPort}/runtime.tar.zst", "a".repeat(64), 1L) + val owner = Thread { LinuxRuntimeInstaller.install(context, release, null) }.apply { isDaemon = true; start() } + var joinedResult = true + var joinedReason: String? = null + val joiner = Thread { + joinedResult = LinuxRuntimeInstaller.install(context, release) { _, _ -> attached.countDown() } + joinedDone.countDown() + readNow.await() + joinedReason = LinuxRuntimeInstaller.installError() + } + try { + assertTrue(accepted.await(10, java.util.concurrent.TimeUnit.SECONDS)) + joiner.apply { isDaemon = true; start() } + assertTrue(attached.await(10, java.util.concurrent.TimeUnit.SECONDS)) + answer.countDown() + assertTrue(joinedDone.await(10, java.util.concurrent.TimeUnit.SECONDS)) + owner.join(10000) + assertEquals("Cannot download the runtime: 127.0.0.1: HTTP 403", failedInstall(context, "HTTP/1.1 403 Forbidden")) + readNow.countDown() + joiner.join(10000) + } finally { + answer.countDown() + readNow.countDown() + server.close() + stall.join(1000) + } + assertFalse(joinedResult) + assertEquals("Cannot download the runtime: 127.0.0.1: HTTP 404", joinedReason) + } + + @Test fun anInterruptedJoinKeepsItsInterruptedReasonWhenTheOwnerFinishesFirst() { + val context = packedContext() + val server = ServerSocket(0) + val accepted = java.util.concurrent.CountDownLatch(1) + val answer = java.util.concurrent.CountDownLatch(1) + val stall = Thread { + runCatching { + server.accept().use { socket -> + accepted.countDown() + answer.await() + socket.getOutputStream().write("HTTP/1.1 404 Not Found\r\nContent-Length: 0\r\nConnection: close\r\n\r\n".toByteArray()) + } + } + }.apply { isDaemon = true; start() } + val release = LinuxRuntimeInstaller.Release("synthetic", "http://127.0.0.1:${server.localPort}/runtime.tar.zst", "a".repeat(64), 1L) + val ownerReason = arrayOfNulls(1) + val owner = Thread { + LinuxRuntimeInstaller.install(context, release, null) + ownerReason[0] = LinuxRuntimeInstaller.installError() + }.apply { isDaemon = true; start() } + var joinedResult = true + var joinedReason: String? = null + val ownerFinished = AtomicBoolean() + lateinit var joiner: Thread + joiner = Thread { + joinedResult = LinuxRuntimeInstaller.install(context, release) { _, _ -> + if (Thread.currentThread() === joiner && ownerFinished.compareAndSet(false, true)) { + answer.countDown() + owner.join(10000) + Thread.currentThread().interrupt() + } + } + joinedReason = LinuxRuntimeInstaller.installError() + Thread.interrupted() + } + try { + assertTrue(accepted.await(10, java.util.concurrent.TimeUnit.SECONDS)) + joiner.apply { isDaemon = true; start() } + joiner.join(10000) + } finally { + answer.countDown() + owner.join(10000) + server.close() + stall.join(1000) + } + assertTrue(ownerFinished.get()) + assertFalse(owner.isAlive) + assertEquals("Cannot download the runtime: 127.0.0.1: HTTP 404", ownerReason[0]) + assertFalse(joinedResult) + assertEquals("Runtime install interrupted while waiting for the running install", joinedReason) + } + + @Test fun aFinishedInstallKeepsNoReferenceToItsListener() { + val context = packedContext() + val server = ServerSocket(0) + val thread = serveOnce(server, "HTTP/1.1 403 Forbidden") + try { + val release = LinuxRuntimeInstaller.Release("synthetic", "http://127.0.0.1:${server.localPort}/runtime.tar.zst", "a".repeat(64), 1L) + assertFalse(LinuxRuntimeInstaller.install(context, release) { _, _ -> }) + } finally { + server.close() + thread.join(1000) + } + val job = (LinuxRuntimeInstaller::class.java.getDeclaredField("LAST_INSTALL").apply { isAccessible = true }.get(null) as ThreadLocal<*>).get()!! + val listeners = job.javaClass.getDeclaredField("listeners").apply { isAccessible = true }.get(job) as Collection<*> + assertTrue(listeners.isEmpty()) + } + + @Test fun aFailedSwapNamesTheStep() { + assertFalse(attempt(failRollback = false).result) + assertTrue(LinuxRuntimeInstaller.installError().orEmpty().startsWith("Cannot carry user data into the new runtime")) + } } diff --git a/app/src/test/java/com/droiddeck/launcher/session/BatteryRuntimeEstimatorTest.kt b/app/src/test/java/com/droiddeck/launcher/session/BatteryRuntimeEstimatorTest.kt new file mode 100644 index 0000000000..f94b8f31af --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/session/BatteryRuntimeEstimatorTest.kt @@ -0,0 +1,25 @@ +package com.droiddeck.launcher.session + +import org.junit.Assert.assertEquals +import org.junit.Assert.assertNotNull +import org.junit.Test + +class BatteryRuntimeEstimatorTest { + @Test fun estimateUsesChargeDividedByRollingMeanCurrent() { + val estimator = BatteryRuntimeEstimator() + assertEquals(1.0, estimator.estimateHours(1_000_000.0, 1_000_000.0)!!, 0.0001) + assertEquals(1.3333, estimator.estimateHours(2_000_000.0, 2_000_000.0)!!, 0.001) + } + + @Test fun energyAndPowerFallbacksKeepMicroUnitsConsistent() { + assertEquals(1_000_000.0, BatteryRuntimeEstimator.chargeMicroampHoursFromEnergy(4_000_000.0, 4_000_000.0)!!, 0.0) + assertEquals(1_000_000.0, BatteryRuntimeEstimator.currentMicroampsFromPower(4_000_000.0, 4_000_000.0)!!, 0.0) + } + + @Test fun durationFormattingUsesHoursAndMinutes() { + assertEquals("2 hrs 15 mins", BatteryRuntimeEstimator.formatDuration(2.25)) + assertEquals("1 hr", BatteryRuntimeEstimator.formatDuration(1.0)) + assertEquals("5 mins", BatteryRuntimeEstimator.formatDuration(5.0 / 60.0)) + assertNotNull(BatteryRuntimeEstimator.formatDuration(0.01)) + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/session/BrowserHandoffTest.kt b/app/src/test/java/com/droiddeck/launcher/session/BrowserHandoffTest.kt new file mode 100644 index 0000000000..0d01833441 --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/session/BrowserHandoffTest.kt @@ -0,0 +1,58 @@ +package com.droiddeck.launcher.session + +import org.junit.Assert.assertFalse +import org.junit.Assert.assertTrue +import org.junit.Test + +class BrowserHandoffTest { + private fun hidden(handoff: BrowserHandoff, activityStarted: Boolean, now: Long) = + SessionVisibilityPolicy.isHidden(activityStarted || handoff.active(now), true, true, true) + + @Test fun pendingHandoffKeepsBackgroundedSessionAwake() { + val handoff = BrowserHandoff(1_000) + handoff.begin(0) + handoff.sessionHidden() + assertFalse(hidden(handoff, activityStarted = false, now = 500)) + } + + @Test fun handoffEndsWhenSessionViewReturns() { + val handoff = BrowserHandoff(1_000) + handoff.begin(0) + handoff.sessionHidden() + handoff.sessionShown() + assertFalse(handoff.active(10)) + assertTrue(hidden(handoff, activityStarted = false, now = 20)) + } + + @Test fun shownBeforeLeavingDoesNotEndHandoff() { + val handoff = BrowserHandoff(1_000) + handoff.begin(0) + handoff.sessionShown() + handoff.sessionHidden() + assertFalse(hidden(handoff, activityStarted = false, now = 100)) + } + + @Test fun handoffExpiresAfterTimeout() { + val handoff = BrowserHandoff(1_000) + handoff.begin(0) + handoff.sessionHidden() + assertTrue(handoff.active(999)) + assertTrue(hidden(handoff, activityStarted = false, now = 1_000)) + } + + @Test fun normalBackgroundingStillHidesSession() { + val handoff = BrowserHandoff(1_000) + handoff.sessionHidden() + assertFalse(handoff.active(0)) + assertTrue(hidden(handoff, activityStarted = false, now = 0)) + } + + @Test fun newHandoffRestartsTimer() { + val handoff = BrowserHandoff(1_000) + handoff.begin(0) + handoff.begin(900) + assertTrue(handoff.active(1_500)) + handoff.clear() + assertFalse(handoff.active(1_500)) + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/session/BuildWatermarkSettingTest.kt b/app/src/test/java/com/droiddeck/launcher/session/BuildWatermarkSettingTest.kt new file mode 100644 index 0000000000..f495d9e0bb --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/session/BuildWatermarkSettingTest.kt @@ -0,0 +1,99 @@ +package com.droiddeck.launcher.session + +import android.app.Activity +import android.app.Application +import android.content.Context +import android.content.Intent +import android.os.Looper +import android.view.View +import com.droiddeck.launcher.ui.BuildWatermark +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.ConscryptMode +import org.robolectric.annotation.GraphicsMode +import org.robolectric.annotation.Config +import java.io.File + +@RunWith(RobolectricTestRunner::class) +@ConscryptMode(ConscryptMode.Mode.OFF) +@GraphicsMode(GraphicsMode.Mode.LEGACY) +@Config(sdk = [34], manifest = Config.NONE, application = Application::class) +class BuildWatermarkSettingTest { + private val context get() = RuntimeEnvironment.getApplication() + private val originalLineProvider = BuildWatermark.lineProvider + + @Before fun clear() { + BuildWatermark.lineProvider = { + BuildWatermark.lines(pr = 1234, ci = true, commit = "abcdef0123", title = "Test build", branch = "") + } + listOf("build-watermark", "build-watermark.new", "build-watermark.bak", "build-watermark.lock").forEach { + File(context.filesDir, it).delete() + } + context.getSharedPreferences("session", Context.MODE_PRIVATE).edit().clear().commit() + } + + @After fun cleanUp() { + try { + clear() + } finally { + BuildWatermark.lineProvider = originalLineProvider + } + } + + @Test fun defaultsOnAndPreservesLegacyChoice() { + assertTrue(SessionPrefs.buildWatermarkEnabled(context)) + context.getSharedPreferences("session", Context.MODE_PRIVATE).edit().putBoolean("buildWatermark", false).commit() + assertFalse(SessionPrefs.buildWatermarkEnabled(context)) + } + + @Test fun sharedFileOverridesCachedPreferencesAndNotifiesOtherProcesses() { + context.getSharedPreferences("session", Context.MODE_PRIVATE).edit().putBoolean("buildWatermark", false).commit() + SessionPrefs.setBuildWatermarkEnabled(context, true) + assertTrue(SessionPrefs.buildWatermarkEnabled(context)) + val change = shadowOf(context).broadcastIntents.last { it.action == BuildWatermarkSetting.CHANGED } + assertEquals(context.packageName, change.`package`) + File(context.filesDir, "build-watermark").writeText("off") + assertFalse(SessionPrefs.buildWatermarkEnabled(context)) + } + + @Test fun lockOpenFailureFallsBackToPreferences() { + val lock = File(context.filesDir, "build-watermark.lock") + assertTrue(lock.mkdir()) + assertTrue(SessionPrefs.buildWatermarkEnabled(context)) + context.getSharedPreferences("session", Context.MODE_PRIVATE).edit().putBoolean("buildWatermark", false).commit() + assertFalse(SessionPrefs.buildWatermarkEnabled(context)) + assertThrows(java.io.IOException::class.java) { SessionPrefs.setBuildWatermarkEnabled(context, true) } + } + + @Test fun settingReadFailureFallsBackToPreferences() { + assertTrue(File(context.filesDir, "build-watermark").mkdir()) + context.getSharedPreferences("session", Context.MODE_PRIVATE).edit().putBoolean("buildWatermark", false).commit() + assertFalse(SessionPrefs.buildWatermarkEnabled(context)) + } + + @Test fun remoteChangeRefreshesExistingAndRecreatedActivities() { + BuildWatermark.install(context) + val activity = Robolectric.buildActivity(Activity::class.java).setup() + try { + assertNotNull(activity.get().window.decorView.findViewWithTag("build-watermark")) + File(context.filesDir, "build-watermark").writeText("off") + context.sendBroadcast(Intent(BuildWatermarkSetting.CHANGED).setPackage(context.packageName)) + shadowOf(Looper.getMainLooper()).idle() + assertNull(activity.get().window.decorView.findViewWithTag("build-watermark")) + activity.recreate() + assertNull(activity.get().window.decorView.findViewWithTag("build-watermark")) + SessionPrefs.setBuildWatermarkEnabled(context, true) + shadowOf(Looper.getMainLooper()).idle() + assertNotNull(activity.get().window.decorView.findViewWithTag("build-watermark")) + } finally { + activity.pause().stop().destroy() + } + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/session/NoSteamLaunchTest.kt b/app/src/test/java/com/droiddeck/launcher/session/NoSteamLaunchTest.kt index d0739df4ae..9800990e9d 100644 --- a/app/src/test/java/com/droiddeck/launcher/session/NoSteamLaunchTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/session/NoSteamLaunchTest.kt @@ -70,6 +70,13 @@ class NoSteamLaunchTest { assertEquals(NoSteamLaunch.EPIC to listOf("run"), epic.program to epic.args) } + @Test fun onlyAnAddedGameStartedFromItsOwnFilesHasItsFolderRead() { + assertTrue(NoSteamLaunch.needsAddedGame(shortcut)) + assertFalse(NoSteamLaunch.needsAddedGame(Library.SteamGame(shortcut.appId, shortcut.name, null, Library.ADDED, source = com.droiddeck.launcher.stores.Store.BATTLENET.id))) + assertFalse(NoSteamLaunch.needsAddedGame(steamGame)) + assertFalse(NoSteamLaunch.needsAddedGame(launcher)) + } + @Test fun anAddedGameOwnedOnSteamUsesItsSteamIdForSettingsAndLaunch() { val routed = AddedGames.Game( File("/x/Stardew Valley"), "Stardew Valley", File("/x/Stardew Valley/Stardew Valley.exe"), diff --git a/app/src/test/java/com/droiddeck/launcher/session/SelectedGameProfileTest.kt b/app/src/test/java/com/droiddeck/launcher/session/SelectedGameProfileTest.kt index 7955fde23b..d02d76d3db 100644 --- a/app/src/test/java/com/droiddeck/launcher/session/SelectedGameProfileTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/session/SelectedGameProfileTest.kt @@ -2,6 +2,7 @@ package com.droiddeck.launcher.session import com.droiddeck.launcher.core.GameEnvironment import com.droiddeck.launcher.frontend.Library +import com.droiddeck.launcher.gpu.FrameGen import org.junit.Assert.assertEquals import org.junit.Assert.assertFalse import org.junit.Assert.assertNull @@ -116,6 +117,17 @@ class SelectedGameProfileTest { assertEquals(ProfileValue("PERFORMANCE_TSO", true), resolve(environment = inherited)!!.fexPreset) } + @Test fun frameGenOverrideMakesProfileCustom() { + val profile = resolve( + frameGenMode = FrameGen.Mode.OFF, + frameGenInherited = false, + ) + + assertEquals(FrameGen.Mode.OFF, profile!!.frameGen) + assertFalse(profile.frameGenInherited) + assertTrue(profile.hasOverrides) + } + private fun resolve( selectedAppId: Long = 3180310, games: List = listOf(game), @@ -123,6 +135,8 @@ class SelectedGameProfileTest { gameChoice: ProtonDefault.GameChoice? = null, gameComponents: Map = emptyMap(), gameWindowsComponents: List = emptyList(), + frameGenMode: FrameGen.Mode = FrameGen.Mode.OFF, + frameGenInherited: Boolean = true, ) = SelectedGameProfile.resolve( selectedAppId = selectedAppId, games = games, @@ -134,6 +148,8 @@ class SelectedGameProfileTest { gameProtonId = "p1", gameComponents = gameComponents, gameWindowsComponents = gameWindowsComponents, + frameGenMode = frameGenMode, + frameGenInherited = frameGenInherited, ) private fun component(label: String) = diff --git a/app/src/test/java/com/droiddeck/launcher/session/SessionSuspendControllerTest.kt b/app/src/test/java/com/droiddeck/launcher/session/SessionSuspendControllerTest.kt index 230eb1f12e..44aa6c73cd 100644 --- a/app/src/test/java/com/droiddeck/launcher/session/SessionSuspendControllerTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/session/SessionSuspendControllerTest.kt @@ -273,9 +273,12 @@ class SessionSuspendControllerTest { val fixture = fixture(17) fixture.clock.writeBytes(shift(5_000_000L)) fixture.controller.freeze { assertTrue(it) } + fixture.clock.delete() + fixture.clock.writeBytes(shift(5_000_000L)) fixture.now += 90_000L fixture.controller.resume { assertTrue(it) } val expected = 5_000_000L + 90_000L * 1_000_000L + assertEquals(5_000_000L, fixture.clockAtMapping) assertEquals(expected, fixture.clockAtContinue) assertEquals(expected, shift(fixture.clock)) fixture.controller.resume { assertTrue(it) } @@ -478,6 +481,7 @@ class SessionSuspendControllerTest { val control = File(tmp, ".bl-zram") val clock = File(tmp, ".bl-clock") var clockAtContinue: Long? = null + var clockAtMapping: Long? = null val pagedOut = mutableListOf>() val pagedIn = mutableListOf>() var availableKb = 8_000_000L @@ -496,6 +500,7 @@ class SessionSuspendControllerTest { proc, ::signal, ::threadSignal, ::sleep, { now }, executor, zramControl = control, clockControl = clock, + mapClockControl = { clockAtMapping = ByteBuffer.wrap(it.readBytes()).order(ByteOrder.LITTLE_ENDIAN).long }, nowNanos = { now * 1_000_000L }, pagedOut = { processes, unacknowledged, resident, swap, _, _ -> pagedOut += Triple(processes, resident, swap) diff --git a/app/src/test/java/com/droiddeck/launcher/session/SteamLibrariesTest.kt b/app/src/test/java/com/droiddeck/launcher/session/SteamLibrariesTest.kt index 5a3fdb26c8..5317e5ca33 100644 --- a/app/src/test/java/com/droiddeck/launcher/session/SteamLibrariesTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/session/SteamLibrariesTest.kt @@ -65,6 +65,26 @@ class SteamLibrariesTest { assertTrue(SteamLibraries.add(app, nested.path) is SteamLibraries.AddResult.Refused) } + @Test fun aGamesFolderIsOfferedWholeUnlessItIsAlreadyALibrary() { + val games = "/storage/card/GameNative" + assertTrue(SteamLibraries.offered(emptyList(), listOf(games), games)) + assertFalse(SteamLibraries.offered(emptyList(), listOf(games), "$games/Steam")) + assertFalse(SteamLibraries.offered(emptyList(), listOf(games), "/storage/card")) + assertFalse(SteamLibraries.offered(listOf(games), listOf(games), games)) + assertTrue(SteamLibraries.offered(listOf("/storage/card/Other"), listOf(games), "/storage/card/New")) + } + + @Test fun aGamesFolderRemainsDiscoverableBesideChosenGameStorage() { + val card = tmp.newFolder("card") + val games = File(card, "GameNative").path + val selected = File(card, "Selected").apply { mkdirs() } + SessionPrefs.setGameStorage(app, selected.path, "Selected") + val effective = GameStorage.effective(app)!! + assertTrue(SteamLibraries.offered(listOf(effective.path), listOf(games), games)) + SessionPrefs.setGameStorage(app, card.path, "Card") + assertFalse(SteamLibraries.offered(listOf(GameStorage.effective(app)!!.path), listOf(games), games)) + } + private fun library(dir: File): File = dir.apply { File(this, "steamapps").mkdirs(); File(this, "steamapps/appmanifest_220.acf").writeText("x") } @Test fun pickingTheFolderAboveALibraryAddsTheLibraryInside() { @@ -124,6 +144,14 @@ class SteamLibrariesTest { assertEquals("${lib.guest}/steamapps/common/Game", AddedGames.guestPath(app, scanned.folder)) } + @Test fun rawAndStorageMountViewsOverlapButDistinctFoldersDoNot() { + val raw = SteamLibraries.canonical(File("/mnt/media_rw/ABCD-1234/Games")) + val storage = SteamLibraries.canonical(File("/storage/ABCD-1234/Games")) + assertEquals(storage, raw) + assertTrue(SteamLibraries.overlaps(raw, SteamLibraries.canonical(File("/storage/ABCD-1234/Games/Steam")))) + assertFalse(SteamLibraries.overlaps(raw, SteamLibraries.canonical(File("/storage/ABCD-1234/Other")))) + } + @Test fun unreadableOrInvalidEntriesAreDropped() { assertTrue(SteamLibraries.parse("{oops").isEmpty()) assertEquals(listOf("2"), SteamLibraries.parse("""[{"id":"../x","path":"/a"},{"id":"2","path":"/b","label":""}]""").map { it.id }) diff --git a/app/src/test/java/com/droiddeck/launcher/session/SteamUserDefaultsTest.kt b/app/src/test/java/com/droiddeck/launcher/session/SteamUserDefaultsTest.kt new file mode 100644 index 0000000000..468b5728f8 --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/session/SteamUserDefaultsTest.kt @@ -0,0 +1,71 @@ +package com.droiddeck.launcher.session + +import org.junit.Assert.* +import org.junit.Rule +import org.junit.Test +import org.junit.rules.TemporaryFolder +import java.io.File + +class SteamUserDefaultsTest { + @get:Rule val temp = TemporaryFolder() + + private val battery = "\"CachedBatteryPreferences\"\t\t\"{\\\"bShowBatteryPercentage\\\":true}\"" + + private fun home(body: String): File = temp.newFolder().also { + File(it, "userdata/123/config").mkdirs() + File(it, "userdata/123/config/localconfig.vdf").writeText("\"UserLocalConfigStore\"\n{\n$body}\n") + } + + private fun text(home: File) = File(home, "userdata/123/config/localconfig.vdf").readText() + private fun bits(text: String) = Regex("\"displayratesasbits\"\\s+\"([^\"]*)\"").find(text)?.groupValues?.get(1) + + @Test fun freshAccountGetsBothDefaults() { + val home = home("") + SessionFiles.seedUserDefaults(home) + assertEquals("0", bits(text(home))) + assertTrue(text(home).contains(battery)) + assertTrue(File(home, "userdata/123/config/droiddeck-user-defaults-initialized").isFile) + } + + @Test fun existingBlocksGainTheKeysBesideOtherSettings() { + val home = home("\t\"system\"\n\t{\n\t\t\"PushToTalkKey\"\t\t\"0\"\n\t}\n\t\"WebStorage\"\n\t{\n\t\t\"Other\"\t\t\"{\\\"a\\\":1}\"\n\t}\n") + SessionFiles.seedUserDefaults(home) + val t = text(home) + assertEquals("0", bits(t)) + assertTrue(t.contains("\"PushToTalkKey\"\t\t\"0\"")) + assertTrue(t.contains("\"Other\"\t\t\"{\\\"a\\\":1}\"")) + assertTrue(t.contains(battery)) + } + + @Test fun aChoiceAlreadyMadeIsKept() { + val home = home("\t\"system\"\n\t{\n\t\t\"displayratesasbits\"\t\t\"1\"\n\t}\n\t\"WebStorage\"\n\t{\n\t\t\"CachedBatteryPreferences\"\t\t\"{\\\"bShowBatteryPercentage\\\":false}\"\n\t}\n") + SessionFiles.seedUserDefaults(home) + assertEquals("1", bits(text(home))) + assertTrue(text(home).contains("false")) + } + + @Test fun laterChangesAreNotReseeded() { + val home = home("") + SessionFiles.seedUserDefaults(home) + File(home, "userdata/123/config/localconfig.vdf").writeText(text(home).replace("\"displayratesasbits\"\t\t\"0\"", "\"displayratesasbits\"\t\t\"1\"")) + SessionFiles.seedUserDefaults(home) + assertEquals("1", bits(text(home))) + } + + @Test fun missingLocalConfigIsRetriedLater() { + val home = temp.newFolder() + File(home, "userdata/123/config").mkdirs() + SessionFiles.seedUserDefaults(home) + assertFalse(File(home, "userdata/123/config/droiddeck-user-defaults-initialized").exists()) + } + + @Test fun librarySortsByRecentlyPlayed() { + val fresh = home("") + SessionFiles.seedUserDefaults(fresh) + assertTrue(text(fresh).contains("\\\"bSortedByRecent\\\":true")) + val existing = home("\t\"WebStorage\"\n\t{\n\t\t\"UIStoreLocalSteamUIState\"\t\t\"{\\\"nVersion\\\":1,\\\"bSortedByRecent\\\":false,\\\"eGameListView\\\":1}\"\n\t}\n") + SessionFiles.seedUserDefaults(existing) + assertTrue(text(existing).contains("\\\"bSortedByRecent\\\":true,\\\"eGameListView\\\":1")) + assertEquals(1, Regex("UIStoreLocalSteamUIState").findAll(text(existing)).count()) + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/storage/SteamStorageTest.kt b/app/src/test/java/com/droiddeck/launcher/storage/SteamStorageTest.kt index 0cfbf2e054..4740b58073 100644 --- a/app/src/test/java/com/droiddeck/launcher/storage/SteamStorageTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/storage/SteamStorageTest.kt @@ -50,6 +50,8 @@ class SteamStorageTest { assertEquals(SteamStorage.Kind.X86_PROTON, SteamStorage.kind(manifest(1493710, "Proton - Experimental"))) assertEquals(SteamStorage.Kind.X86_PROTON, SteamStorage.kind(manifest(2805730, "Proton 9.0"))) assertEquals(SteamStorage.Kind.REQUIRED, SteamStorage.kind(manifest(228980, "Steamworks Shared"))) + assertEquals(SteamStorage.Kind.REQUIRED, SteamStorage.kind(manifest(1826330, "Proton EasyAntiCheat Runtime"))) + assertEquals(SteamStorage.Kind.REQUIRED, SteamStorage.kind(manifest(1161040, "Proton BattlEye Runtime"))) assertTrue(SteamStorage.isTool(manifest(2805730, "Proton 9.0"))) assertFalse(SteamStorage.isTool(manifest(204360, "CastleCrashers"))) } @@ -179,6 +181,37 @@ class SteamStorageTest { assertEquals(452280, SteamStorage.leftoverId("452280")) } + @Test fun shortcutIdsReadBothSignedAndUnsignedFolderNames() { + assertEquals(3207321049L, SteamStorage.shortcutId("3207321049")) + assertEquals(2526420341L, SteamStorage.shortcutId("-1768546955")) + assertNull(SteamStorage.shortcutId("0")) + assertNull(SteamStorage.shortcutId("452280")) + assertNull(SteamStorage.shortcutId("pfx")) + assertNull(SteamStorage.shortcutId("4294967296")) + } + + @Test fun sharedPrefixComesFromTheCompatDataPathInLaunchOptions() { + assertEquals(2929927072L, SteamStorage.sharedPrefixId("STEAM_COMPAT_DATA_PATH=/root/.local/share/Steam/steamapps/compatdata/2929927072 %command%")) + assertEquals(2596113170L, SteamStorage.sharedPrefixId("STEAM_COMPAT_DATA_PATH=/x/compatdata/2596113170/ %command% --exec=\"launch WoW\"")) + assertNull(SteamStorage.sharedPrefixId("%command% -windowed")) + assertNull(SteamStorage.sharedPrefixId("STEAM_COMPAT_DATA_PATH=/x/compatdata/0 %command%")) + assertEquals(3000000002L, SteamStorage.sharedPrefixId("STEAM_COMPAT_DATA_PATH=\"/root/My Games/steamapps/compatdata/3000000002\" %command%")) + assertEquals(3000000002L, SteamStorage.sharedPrefixId("STEAM_COMPAT_DATA_PATH='/x/compatdata/3000000002/' %command%")) + } + + @Test fun gameFolderHintReadsTheFolderWineRecorded() { + val prefix = tmp.newFolder("compatdata", "3000000002") + File(prefix, "pfx").mkdirs() + File(prefix, "pfx/system.reg").writeText( + "\"Path\"=\"Z:\\\\usr\\\\local\\\\share\\\\fonts\\\\a.ttf\"\n" + + "\"A\"=\"Z:\\\\root\\\\Games\\\\Stores\\\\Ubisoft\\\\Tom Clancy's Splinter Cell\\\\\"\n" + + "\"B\"=\"Z:\\\\root\\\\Games\\\\Stores\\\\Ubisoft\\\\Tom Clancy's Splinter Cell\\\\system\\\\x.exe\"\n", + ) + File(prefix, "pfx/user.reg").writeText("\"C\"=\"Z:\\\\mnt\\\\droiddeck-lib\\\\1\\\\steamapps\\\\common\\\\198X\\\\198X.exe\"\n") + assertEquals("Tom Clancy's Splinter Cell", SteamStorage.gameFolderHint(prefix)) + assertNull(SteamStorage.gameFolderHint(tmp.newFolder("compatdata", "3000000003"))) + } + @Test fun stubPrefixes() { val stub = tmp.newFolder("compatdata", "10") assertTrue(SteamStorage.isStubPrefix(stub)) diff --git a/app/src/test/java/com/droiddeck/launcher/stores/StoreAccountsCipherTest.kt b/app/src/test/java/com/droiddeck/launcher/stores/StoreAccountsCipherTest.kt index cd14c66602..9924c2b50a 100644 --- a/app/src/test/java/com/droiddeck/launcher/stores/StoreAccountsCipherTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/stores/StoreAccountsCipherTest.kt @@ -132,6 +132,17 @@ class StoreAccountsCipherTest { assertEquals("test@example.test", StoreAccounts.signedInAs(app, Store.XBOX)) } + @Test fun rockstarNeverFallsBackToPlaintextWhenKeystoreFails() { + StoreAccounts.keys = broken + org.junit.Assert.assertThrows(IllegalStateException::class.java) { + StoreAccounts.write(app, Store.ROCKSTAR, JSONObject().put("access_token", "synthetic-secret")) + } + assertFalse(file(Store.ROCKSTAR).exists()) + StoreAccounts.keys = fake + StoreAccounts.write(app, Store.ROCKSTAR, creds) + assertTrue(CredentialCipher.isEnvelope(JSONObject(file(Store.ROCKSTAR).readText()))) + } + @Test fun xboxShowsTheGamertagElseAMaskedEmail() { StoreAccounts.write(app, Store.XBOX, JSONObject().put("username", "player@example.test")) assertEquals("pโ€ขโ€ขโ€ข@example.test", StoreAccounts.displayName(app, Store.XBOX)) diff --git a/app/src/test/java/com/droiddeck/launcher/stores/StoreSizesTest.kt b/app/src/test/java/com/droiddeck/launcher/stores/StoreSizesTest.kt new file mode 100644 index 0000000000..2a306aeff8 --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/stores/StoreSizesTest.kt @@ -0,0 +1,96 @@ +package com.droiddeck.launcher.stores + +import java.util.concurrent.CompletableFuture +import java.util.concurrent.ConcurrentHashMap +import org.junit.After +import org.junit.Assert.assertEquals +import org.junit.Assert.assertNotSame +import org.junit.Assert.assertSame +import org.junit.Assert.assertTrue +import org.junit.Test + +class StoreSizesTest { + private val ea = CatalogItem(Store.EA, "Origin.OFR.50.0001", "Game", imageUrl = null, owned = true) + + @After fun clear() { + StoreSizes.known.clear() + } + + @Test fun anUnresolvedSizeIsUnknown() { + assertEquals(0L, StoreSizes.size(ea)) + } + + @Test fun aResolvedSizeReplacesTheCatalogValue() { + StoreSizes.known[ea.key] = 4_200_000_000L + assertEquals(4_200_000_000L, StoreSizes.size(ea)) + } + + @Test fun aResolvedSizeOnlyAppliesToItsOwnGame() { + StoreSizes.known[ea.key] = 4_200_000_000L + assertEquals(0L, StoreSizes.size(ea.copy(id = "Origin.OFR.50.0002"))) + assertEquals(7L, StoreSizes.size(ea.copy(id = "Origin.OFR.50.0002", sizeBytes = 7L))) + } + + @Test fun anEaSizeDoesNotReplaceAnotherStoresCatalogSize() { + StoreSizes.known[ea.key] = 4_200_000_000L + val epic = ea.copy(store = Store.EPIC, id = "Epic.Game", sizeBytes = 7L) + assertEquals(7L, StoreSizes.size(epic)) + } + + @Test fun aFailedLookupIsRetriedOnTheNextRequest() { + val requests = ConcurrentHashMap>() + val failed = StoreSizes.shared(requests, ea.key) { CompletableFuture.completedFuture(null) } + assertEquals(null, failed.get()) + val retried = StoreSizes.shared(requests, ea.key) { CompletableFuture.completedFuture(9L) } + assertNotSame(failed, retried) + assertEquals(9L, retried.get()) + } + + @Test fun aResolvedLookupIsSharedAndKept() { + val requests = ConcurrentHashMap>() + val first = StoreSizes.shared(requests, ea.key) { CompletableFuture.completedFuture(5L) } + val second = StoreSizes.shared(requests, ea.key) { CompletableFuture.completedFuture(6L) } + assertSame(first, second) + assertEquals(5L, second.get()) + } + + @Test fun anInFlightLookupIsSharedBetweenRequests() { + val requests = ConcurrentHashMap>() + val pending = CompletableFuture() + val first = StoreSizes.shared(requests, ea.key) { pending } + val second = StoreSizes.shared(requests, ea.key) { CompletableFuture.completedFuture(1L) } + assertSame(first, second) + pending.complete(null) + assertEquals(null, second.get()) + assertEquals(0, requests.size) + } + + @Test fun aContinuationThatRequestsAgainAfterAFailureStartsANewLookup() { + val requests = ConcurrentHashMap>() + val pending = CompletableFuture() + val first = StoreSizes.shared(requests, ea.key) { pending } + val retried = CompletableFuture() + first.thenAccept { bytes -> + if (bytes == null) retried.complete(StoreSizes.shared(requests, ea.key) { CompletableFuture.completedFuture(9L) }.get()) + } + pending.complete(null) + assertEquals(9L, retried.get()) + } + + @Test fun concurrentCallersShareOneLookup() { + val requests = ConcurrentHashMap>() + val pending = CompletableFuture() + var starts = 0 + val callers = (1..3).map { StoreSizes.shared(requests, ea.key) { starts++; pending } } + pending.complete(3L) + assertEquals(1, starts) + callers.forEach { assertEquals(3L, it.get()) } + } + + @Test fun synchronousStartFailureCompletesAndAllowsRetry() { + val requests = ConcurrentHashMap>() + val failed = StoreSizes.shared(requests, ea.key) { throw IllegalStateException("boom") } + assertTrue(failed.isCompletedExceptionally) + assertEquals(4L, StoreSizes.shared(requests, ea.key) { CompletableFuture.completedFuture(4L) }.get()) + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/stores/battlenet/BattleNetInstallTest.kt b/app/src/test/java/com/droiddeck/launcher/stores/battlenet/BattleNetInstallTest.kt index 05a5708158..92d1716292 100644 --- a/app/src/test/java/com/droiddeck/launcher/stores/battlenet/BattleNetInstallTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/stores/battlenet/BattleNetInstallTest.kt @@ -2,12 +2,15 @@ package com.droiddeck.launcher.stores.battlenet import com.droiddeck.launcher.runtime.BattleNet import com.droiddeck.launcher.stores.CatalogItem +import com.droiddeck.launcher.stores.InstalledStoreGame import com.droiddeck.launcher.stores.Store +import com.droiddeck.launcher.stores.StoreGameSidecar 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 java.io.File import java.nio.file.Files import java.util.Locale @@ -89,4 +92,13 @@ class BattleNetInstallTest { assertEquals(BattleNetInstall.Step.APPLYING, BattleNetInstall.step(1003, 2000, 1, 9)) assertEquals(BattleNetInstall.Step.APPLYING, BattleNetInstall.step(1004, 1000, 0, 0)) } + + @Test fun aSavedUpdateComesBackAsAnUpdateOfItsOwnFolder() { + val folder = File("/data/Games/Stores/Battle.net/World of Warcraft") + val game = InstalledStoreGame(StoreGameSidecar(Store.BATTLENET, "wow", "World of Warcraft", "Wow.exe"), folder) + val item = BattleNetInstall.updateItem(game, "wow_enus") + assertEquals("wow_enus", item.extra[BattleNetInstall.INSTALL_UID]) + assertEquals(folder, BattleNetInstall.updateFolder(item)) + assertNull(BattleNetInstall.updateFolder(CatalogItem(Store.BATTLENET, "wow", "World of Warcraft", null))) + } } diff --git a/app/src/test/java/com/droiddeck/launcher/stores/download/DownloadQueueRemovalTest.kt b/app/src/test/java/com/droiddeck/launcher/stores/download/DownloadQueueRemovalTest.kt new file mode 100644 index 0000000000..5ad355f8ec --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/stores/download/DownloadQueueRemovalTest.kt @@ -0,0 +1,276 @@ +package com.droiddeck.launcher.stores.download + +import com.droiddeck.launcher.stores.InstalledStoreGame +import com.droiddeck.launcher.stores.Store +import com.droiddeck.launcher.stores.StoreGameSidecar +import com.droiddeck.launcher.stores.StoreInstalls +import com.droiddeck.launcher.stores.StoresState +import java.io.File +import java.util.concurrent.CountDownLatch +import java.util.concurrent.TimeUnit +import java.util.concurrent.atomic.AtomicInteger +import org.junit.After +import org.junit.Assert.assertEquals +import org.junit.Assert.assertFalse +import org.junit.Assert.assertTrue +import org.junit.Assert.fail +import org.junit.Test +import org.junit.runner.RunWith +import org.robolectric.RobolectricTestRunner +import org.robolectric.RuntimeEnvironment +import org.robolectric.annotation.Config + +@RunWith(RobolectricTestRunner::class) +@Config(sdk = [33]) +class DownloadQueueRemovalTest { + private val app get() = RuntimeEnvironment.getApplication() + + @After fun cleanRows() { DownloadQueue.dismissFinished() } + + private class BlockingCleanup { + val started = CountDownLatch(1) + val release = CountDownLatch(1) + val cancels = AtomicInteger() + fun job() = object : DownloadQueue.DownloadJob { + override fun run(handle: DownloadQueue.JobHandle): String? = throw IllegalStateException("fails on purpose") + override fun cancel(deleteFiles: Boolean) { + cancels.incrementAndGet() + started.countDown() + release.await(5, TimeUnit.SECONDS) + } + } + } + + private fun failedEntry(id: String, cleanup: BlockingCleanup): String { + val entry = DownloadEntry(Store.GOG, id, id) + DownloadQueue.enqueue(app, entry) { cleanup.job() } + val until = System.nanoTime() + TimeUnit.SECONDS.toNanos(5) + while (System.nanoTime() < until) { + if (DownloadQueue.entry(entry.key)?.state == DownloadState.FAILED) return entry.key + Thread.sleep(10) + } + fail("job never failed: ${DownloadQueue.entry(entry.key)}") + return entry.key + } + + private fun awaitHold(key: String) { + val until = System.nanoTime() + TimeUnit.SECONDS.toNanos(5) + while (System.nanoTime() < until) { + if (DownloadQueue.holdForRemoval(key)) return + Thread.sleep(10) + } + fail("removal hold never became available for $key") + } + + @Test fun aRemovalHoldIsExclusiveUntilReleased() { + val key = "gog:removal-hold-test" + assertTrue(DownloadQueue.holdForRemoval(key)) + assertFalse(DownloadQueue.holdForRemoval(key)) + DownloadQueue.releaseRemoval(key) + assertTrue(DownloadQueue.holdForRemoval(key)) + DownloadQueue.releaseRemoval(key) + } + + @Test fun clearingFirstKeepsRemovalOutUntilItsCleanupFinishes() { + val cleanup = BlockingCleanup() + val key = failedEntry("clear-then-hold", cleanup) + DownloadQueue.clear(app, key) + assertTrue(cleanup.started.await(5, TimeUnit.SECONDS)) + assertFalse(DownloadQueue.holdForRemoval(key)) + cleanup.release.countDown() + awaitHold(key) + DownloadQueue.releaseRemoval(key) + } + + @Test fun cancellingFirstKeepsRemovalOutUntilItsCleanupFinishes() { + val cleanup = BlockingCleanup() + val key = failedEntry("cancel-then-hold", cleanup) + DownloadQueue.cancel(app, key) + assertTrue(cleanup.started.await(5, TimeUnit.SECONDS)) + assertFalse(DownloadQueue.holdForRemoval(key)) + cleanup.release.countDown() + awaitHold(key) + DownloadQueue.releaseRemoval(key) + } + + @Test fun holdingFirstStopsClearAndCancelFromStartingCleanup() { + val cleared = BlockingCleanup() + val clearKey = failedEntry("hold-then-clear", cleared) + assertTrue(DownloadQueue.holdForRemoval(clearKey)) + DownloadQueue.clear(app, clearKey) + val cancelled = BlockingCleanup() + val cancelKey = failedEntry("hold-then-cancel", cancelled) + assertTrue(DownloadQueue.holdForRemoval(cancelKey)) + DownloadQueue.cancel(app, cancelKey) + assertFalse(cleared.started.await(300, TimeUnit.MILLISECONDS)) + assertFalse(cancelled.started.await(300, TimeUnit.MILLISECONDS)) + assertEquals(0, cleared.cancels.get() + cancelled.cancels.get()) + DownloadQueue.releaseRemoval(clearKey) + DownloadQueue.releaseRemoval(cancelKey) + cleared.release.countDown() + cancelled.release.countDown() + } + + @Test fun aReinstallWaitsForTheCancelledDownloadsCleanup() { + val cleanup = BlockingCleanup() + val key = failedEntry("reinstall-after-clear", cleanup) + DownloadQueue.clear(app, key) + assertTrue(cleanup.started.await(5, TimeUnit.SECONDS)) + val ran = CountDownLatch(1) + DownloadQueue.enqueue(app, DownloadEntry(Store.GOG, "reinstall-after-clear", "again")) { + object : DownloadQueue.DownloadJob { + override fun run(handle: DownloadQueue.JobHandle): String? { ran.countDown(); return "/done" } + override fun cancel(deleteFiles: Boolean) {} + } + } + assertFalse(ran.await(300, TimeUnit.MILLISECONDS)) + assertEquals(DownloadState.QUEUED, DownloadQueue.entry(key)?.state) + cleanup.release.countDown() + assertTrue(ran.await(5, TimeUnit.SECONDS)) + } + + @Test fun cleanupCollectsTheDeletionWorkerAnInstallerStarts() { + val folder = File(app.filesDir, "collected-discard").apply { mkdirs() } + File(folder, "part.bin").writeText("x") + val workers = StoreInstalls.collectingDiscards { StoreInstalls.discard(app, folder, emptyList()) } + assertEquals(1, workers.size) + workers.forEach { it.join(5000) } + assertFalse(folder.exists()) + assertFalse(StoreInstalls.isDiscarding(folder)) + } + + private fun idleUntil(condition: () -> Boolean): Boolean { + val until = System.nanoTime() + TimeUnit.SECONDS.toNanos(5) + while (System.nanoTime() < until) { + org.robolectric.shadows.ShadowLooper.idleMainLooper() + if (condition()) return true + Thread.sleep(10) + } + return false + } + + @Test fun uninstallWaitsForAnInstallersDiscardThenRemovesTheGame() { + val folder = File(app.filesDir, "discarding-game").apply { mkdirs() } + File(folder, "game.bin").writeText("x") + val game = InstalledStoreGame(StoreGameSidecar(Store.GOG, "discarding", "Discarding", exe = "game.bin"), folder) + StoreInstalls.beginDiscard(folder) + val done = CountDownLatch(1) + try { + StoresState.uninstall(app, game) { done.countDown() } + Thread.sleep(300) + org.robolectric.shadows.ShadowLooper.idleMainLooper() + assertEquals(1L, done.count) + assertTrue(File(folder, "game.bin").isFile) + } finally { + StoreInstalls.endDiscard(folder) + } + assertTrue(idleUntil { done.count == 0L }) + assertFalse(folder.exists()) + } + + @Test fun uninstallWaitsForACancelledUpdatesCleanupThenRemovesTheGame() { + val cleanup = BlockingCleanup() + val key = failedEntry("cancel-then-uninstall", cleanup) + val folder = File(app.filesDir, "cancel-then-uninstall").apply { mkdirs() } + File(folder, "game.bin").writeText("x") + val game = InstalledStoreGame(StoreGameSidecar(Store.GOG, "cancel-then-uninstall", "Cancelled", exe = "game.bin"), folder) + assertEquals(key, game.key) + DownloadQueue.cancel(app, key) + assertTrue(cleanup.started.await(5, TimeUnit.SECONDS)) + val done = CountDownLatch(1) + StoresState.uninstall(app, game) { done.countDown() } + Thread.sleep(300) + org.robolectric.shadows.ShadowLooper.idleMainLooper() + assertEquals(1L, done.count) + assertTrue(File(folder, "game.bin").isFile) + cleanup.release.countDown() + assertTrue(idleUntil { done.count == 0L }) + assertFalse(folder.exists()) + } + + private fun blockDiscards(): CountDownLatch { + val release = CountDownLatch(1) + StoreInstalls.beforeDiscard = { release.await(5, TimeUnit.SECONDS) } + return release + } + + @After fun restoreDiscards() { StoreInstalls.beforeDiscard = {} } + + @Test fun aDiscardStartedInsideARunningJobKeepsTheGameHeld() { + val folder = File(app.filesDir, "run-discard").apply { mkdirs() } + val release = blockDiscards() + val entry = DownloadEntry(Store.GOG, "run-discard", "run") + DownloadQueue.enqueue(app, entry) { + object : DownloadQueue.DownloadJob { + override fun run(handle: DownloadQueue.JobHandle): String? { + StoreInstalls.discard(app, folder, emptyList()) + return null + } + override fun cancel(deleteFiles: Boolean) {} + } + } + assertTrue(idleUntil { DownloadQueue.entry(entry.key)?.state == DownloadState.FAILED }) + assertFalse(DownloadQueue.holdForRemoval(entry.key)) + release.countDown() + awaitHold(entry.key) + DownloadQueue.releaseRemoval(entry.key) + } + + @Test fun aJobThatThrowsAfterStartingADiscardStillKeepsTheGameHeld() { + val folder = File(app.filesDir, "throw-after-discard").apply { mkdirs() } + val release = blockDiscards() + val entry = DownloadEntry(Store.GOG, "throw-after-discard", "throws") + DownloadQueue.enqueue(app, entry) { + object : DownloadQueue.DownloadJob { + override fun run(handle: DownloadQueue.JobHandle): String? { + StoreInstalls.discard(app, folder, emptyList()) + throw IllegalStateException("fails after discard") + } + override fun cancel(deleteFiles: Boolean) {} + } + } + assertTrue(idleUntil { DownloadQueue.entry(entry.key)?.state == DownloadState.FAILED }) + assertFalse(DownloadQueue.holdForRemoval(entry.key)) + val reinstalled = CountDownLatch(1) + DownloadQueue.enqueue(app, DownloadEntry(Store.GOG, "throw-after-discard", "again")) { + object : DownloadQueue.DownloadJob { + override fun run(handle: DownloadQueue.JobHandle): String? { reinstalled.countDown(); return "/done" } + override fun cancel(deleteFiles: Boolean) {} + } + } + assertFalse(reinstalled.await(300, TimeUnit.MILLISECONDS)) + assertEquals(DownloadState.QUEUED, DownloadQueue.entry(entry.key)?.state) + release.countDown() + assertTrue(reinstalled.await(5, TimeUnit.SECONDS)) + assertTrue(idleUntil { DownloadQueue.entry(entry.key)?.state == DownloadState.INSTALLED }) + } + + @Test fun cancellingARunningJobTwiceWaitsForEveryDiscard() { + val folder = File(app.filesDir, "double-cancel").apply { mkdirs() } + val release = blockDiscards() + val running = CountDownLatch(1) + val stop = CountDownLatch(1) + val entry = DownloadEntry(Store.GOG, "double-cancel", "twice") + DownloadQueue.enqueue(app, entry) { + object : DownloadQueue.DownloadJob { + override fun run(handle: DownloadQueue.JobHandle): String? { + running.countDown() + stop.await(5, TimeUnit.SECONDS) + return null + } + override fun cancel(deleteFiles: Boolean) { + if (deleteFiles) StoreInstalls.discard(app, folder, emptyList()) + } + } + } + assertTrue(running.await(5, TimeUnit.SECONDS)) + DownloadQueue.cancel(app, entry.key) + DownloadQueue.cancel(app, entry.key) + stop.countDown() + assertTrue(idleUntil { DownloadQueue.entry(entry.key)?.state != DownloadState.RUNNING }) + assertFalse(DownloadQueue.holdForRemoval(entry.key)) + release.countDown() + awaitHold(entry.key) + DownloadQueue.releaseRemoval(entry.key) + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/stores/ea/EaTest.kt b/app/src/test/java/com/droiddeck/launcher/stores/ea/EaTest.kt new file mode 100644 index 0000000000..b9deb11a11 --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/stores/ea/EaTest.kt @@ -0,0 +1,416 @@ +package com.droiddeck.launcher.stores.ea + +import com.droiddeck.launcher.stores.CatalogItem +import com.droiddeck.launcher.stores.Store +import com.droiddeck.launcher.stores.StoreGameSidecar +import com.droiddeck.launcher.stores.StoreLaunch +import org.json.JSONObject +import org.junit.Assert.assertEquals +import org.junit.Assert.assertFalse +import org.junit.Assert.assertNotNull +import org.junit.Assert.assertNull +import org.junit.Assert.assertTrue +import org.junit.Test +import org.junit.runner.RunWith +import org.robolectric.RobolectricTestRunner +import java.io.File +import java.nio.file.Files +import java.time.LocalDate + +@RunWith(RobolectricTestRunner::class) +class EaTest { + private val wine = EaOoa.Hardware( + boardManufacturer = "Wine", boardSerial = "None", biosManufacturer = "The Wine Project", biosSerial = "0", + osInstallDate = "20240101000000.000000+000", osSerial = "12345-OEM", volumeSerial = "43000000", + gpuPnpId = "PCI\\VEN_5143&DEV_0001&SUBSYS_00000000&REV_00\\0&DEADBEEF&0&DEAD", + cpuVendor = "GenuineIntel", cpuEdx = "BFEBFBFF", cpuEax = "000906EA", cpuEcx = "7ffafbbf", brand = "FEX CPU", hostname = "myhost", + ) + + @Test fun machineHashFollowsTheActivationVersion() { + assertEquals("01804062be939efcd4462c65de292af3a56359b5", EaOoa.machineHash(wine, 4)) + assertEquals("41fa9c614390c5a82534becd338b798197cc5b", EaOoa.machineHash(wine, 3)) + } + + @Test fun launchCodeAndSessionKeyMatchTheProtocol() { + assertEquals(1196115787L, EaCrypto.rtpCode(LocalDate.of(2026, 11, 7))) + assertEquals("f057eb86a0bf8c57537b1aa6b98c6495", EaCrypto.hex(EaCrypto.lsxKey(0x6162))) + assertEquals(EaCrypto.hex(EaCrypto.LSX_DEFAULT_KEY), EaCrypto.hex(EaCrypto.lsxKey(0))) + val answer = EaCrypto.challengeAnswer("abc") + assertEquals("abc", String(EaCrypto.ecbDecrypt(EaCrypto.unhex(answer), EaCrypto.LSX_DEFAULT_KEY))) + assertEquals((answer[0].code shl 8) or answer[1].code, EaCrypto.challengeSeed("3", answer)) + assertNull(EaCrypto.challengeSeed("9", answer)) + } + + @Test fun onlyTokenRejectionsAreRetried() { + val rejected = EaReply(409, "".toByteArray(), emptyMap()) + val notEntitled = EaReply(409, "".toByteArray(), emptyMap()) + var authCalls = 0 + val success = EaReply(200, ByteArray(0), emptyMap()) + val result = EaOoa.retryTokenRejected { + authCalls++ + if (authCalls == 1) rejected else success + } + assertEquals(2, authCalls) + assertEquals(200, result.status) + + var entitlementCalls = 0 + val refused = EaOoa.retryTokenRejected { + entitlementCalls++ + notEntitled + } + assertEquals(1, entitlementCalls) + assertEquals(409, refused.status) + + val otherAuthFailure = EaReply(409, "".toByteArray(), emptyMap()) + var otherAuthCalls = 0 + val otherRefused = EaOoa.retryTokenRejected { + otherAuthCalls++ + otherAuthFailure + } + assertEquals(1, otherAuthCalls) + assertEquals(409, otherRefused.status) + + var failedCalls = 0 + EaOoa.retryTokenRejected { + failedCalls++ + rejected + } + assertEquals(4, failedCalls) + } + + @Test fun licenceRoundTripsThroughTheFileFormat() { + val xml = "kh" + + "12349tokgsn" + val l = EaOoa.parseLicense(xml, "c2ln") + assertEquals("tok", l.gameToken) + assertEquals("1234", l.contentId) + val blob = EaOoa.licenseBlob(l, encoded = true) + assertEquals("c2ln", String(blob.copyOfRange(0, 4))) + assertEquals(0, blob[64].toInt()) + val back = String(EaCrypto.licenseDecrypt(blob.copyOfRange(65, blob.size))) + assertTrue(back.contains("tok")) + assertEquals("sig", String(EaOoa.licenseBlob(l, encoded = false).copyOfRange(0, 3))) + } + + @Test fun readsTheVersionOfTheActivationLibrary() { + val pe = ByteArray(64) + val fixed = byteArrayOf(0xBD.toByte(), 0x04, 0xEF.toByte(), 0xFE.toByte(), 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 4, 0, 0, 0, 6, 0) + System.arraycopy(fixed, 0, pe, 10, fixed.size) + assertEquals(Triple(4, 7, 6), EaOoa.productVersion(pe)) + } + + @Test fun manifestNamesTheLauncherAndTouchup() { + val xml = """ + + + + [HKEY_LOCAL_MACHINE\SOFTWARE\EA Games\Game\Install Dir]trial.exetrue + [HKEY_LOCAL_MACHINE\SOFTWARE\EA Games\Game\Install Dir]bin\Game.exe-dx12false + + /__Installer/Touchup.exe-locale {locale} -installPath "{installLocation}" + """ + val m = EaManifest.parse(xml) + assertEquals("1.0.64.43203", m.version) + assertEquals("bin/Game.exe", EaPaths.relative(m.launcher()!!.path)) + assertEquals("-dx12", m.launcher()!!.parameters) + assertEquals("/__Installer/Touchup.exe", m.touchupPath) + val r = EaPaths.registered(m.launcher()!!.path)!! + assertEquals("HKEY_LOCAL_MACHINE\\SOFTWARE\\EA Games\\Game", r.key) + assertEquals("Install Dir", r.value) + val utf16 = byteArrayOf(0xFF.toByte(), 0xFE.toByte()) + "".toByteArray(Charsets.UTF_16LE) + assertEquals("1.0", EaManifest.parse(EaManifest.decode(utf16)).version) + } + + @Test fun findsFilesWhateverTheirCase() { + val dir = Files.createTempDirectory("ea").toFile() + File(dir, "Bin").mkdirs() + File(dir, "Bin/GAME.exe").writeText("x") + assertEquals("Bin/GAME.exe", EaPaths.relativeOnDisk(dir, "bin/game.exe")) + assertNull(EaPaths.relativeOnDisk(dir, "bin/other.exe")) + assertEquals(listOf("-a", "two words", "-c"), EaPaths.splitArgs("-a \"two words\" -c")) + dir.deleteRecursively() + } + + @Test fun lsxRequestsAreParsed() { + val m = EaLsx.parse("")!! + assertEquals("GetSetting", m.name) + assertEquals("4", m.id) + assertEquals("ENVIRONMENT", m.attrs["SettingId"]) + val c = EaLsx.parse("1Game")!! + assertEquals(listOf("ContentId" to "1", "Title" to "Game"), c.children) + assertNull(EaLsx.parse("")) + } + + @Test fun socketOwnerIsReadFromTheProcTable() { + val rows = listOf( + " sl local_address rem_address st tx_queue rx_queue tr tm->when retrnsmt uid timeout inode", + " 0: 0100007F:C350 0100007F:0C90 01 00000000:00000000 00:00000000 00000000 10234 0 1 1 0", + ) + assertEquals(10234, EaLsx.owner(rows, 0xC350)) + assertNull(EaLsx.owner(rows, 1234)) + assertNull(EaLsx.owner(emptyList(), 0xC350)) + } + + @Test fun rapidConnectionsNeverPassTheClientCap() { + fun session() = EaLsx.Session(java.net.Socket(), java.io.ByteArrayOutputStream(), false) + EaLsx.sessions.clear() + val first = (1..8).map { session().also { s -> assertTrue(EaLsx.admit(s)) } } + first[0].claimed = true + repeat(20) { assertTrue(EaLsx.admit(session())) } + assertEquals(8, EaLsx.sessions.count { !it.evicted }) + assertFalse(first[0].evicted) + EaLsx.sessions.forEach { it.trusted = true } + assertFalse(EaLsx.admit(session())) + EaLsx.sessions.clear() + } + + @Test fun anEvictedSessionCannotBecomeTrusted() { + val s = EaLsx.Session(java.net.Socket(), java.io.ByteArrayOutputStream(), true) + s.evicted = true + EaLsx.promote(s, true) + assertFalse(s.trusted) + val ok = EaLsx.Session(java.net.Socket(), java.io.ByteArrayOutputStream(), true) + EaLsx.promote(ok, true) + assertTrue(ok.trusted) + EaLsx.stop() + } + + @Test fun aPeerAndroidCannotNameIsTrustedOnlyForTheClaimedGame() { + val hidden = EaLsx.Session(java.net.Socket(), java.io.ByteArrayOutputStream(), false, unverifiable = true) + assertFalse(hidden.mayTrust) + hidden.claimed = true + assertTrue(hidden.mayTrust) + val other = EaLsx.Session(java.net.Socket(), java.io.ByteArrayOutputStream(), false) + other.claimed = true + assertFalse(other.mayTrust) + } + + @Test fun aSessionFromAnOlderLaunchCannotBecomeTrusted() { + val old = EaLsx.Session(java.net.Socket(), java.io.ByteArrayOutputStream(), true) + EaLsx.generation++ + EaLsx.promote(old, true) + assertFalse(old.trusted) + EaLsx.stop() + } + + @Test fun lateExitDoesNotStopANewerLaunch() { + val game = EaLsx.Game("Origin.OFR.2", "2", "Two", "1", "en_US", null, 0) + EaLsx.game = game + EaLsx.stop("Origin.OFR.1") + assertEquals(game, EaLsx.game) + EaLsx.stop("Origin.OFR.2") + assertNull(EaLsx.game) + } + + @Test fun redirectCarriesTheCode() { + assertEquals("QUOX", EaAuth.redirectValue("qrc:///html/login_successful.html?code=QUOX&state=1", "code")) + assertEquals("tok", EaAuth.redirectValue("qrc:/html/login_successful.html#access_token=tok&token_type=Bearer", "access_token")) + assertNull(EaAuth.redirectValue("https://signin.ea.com/p/x", "code")) + } + + @Test fun pcSignIsSigned() { + val sign = EaAuth.pcSign("ab12", java.util.Date(0), "v1") + val (payload, signature) = sign.split('.') + val json = JSONObject(String(java.util.Base64.getUrlDecoder().decode(payload))) + assertEquals("v1", json.getString("sv")) + assertEquals("1970-01-01 00:00:00:000", json.getString("ts")) + assertEquals(EaCrypto.base64Url(EaCrypto.hmacSha256("ISa3dpGOc8wW7Adn4auACSQmaccrOyR2".toByteArray(), payload.toByteArray())), signature) + } + + @Test fun libraryKeepsOneEntryPerGame() { + fun owned(id: String, slug: String, base: String = "", type: String = "BASE_GAME", trial: Boolean = false) = + EaApi.OwnedProduct(id, "p$id", "Game $id", slug, base, type, true, trial, emptyList()) + fun offer(id: String, type: String = "FullGame") = EaApi.Offer(id, "c$id", "", type, true, "", "", "", "", "", "1.0", "", emptyList()) + val list = listOf(owned("1", "game"), owned("2", "game-deluxe", base = "game"), owned("3", "other"), owned("4", "trial", trial = true), owned("5", "dlc", type = "EXTRA_CONTENT")) + val picked = EaLibrary.pick(list, list.associate { it.offerId to offer(it.offerId) }) + assertEquals(listOf("1", "3"), picked.map { it.first.offerId }) + } + + @Test fun anOwnedProductWithoutAnActiveGameDownloadIsLeftOut() { + fun row(id: String, type: String, tag: String = type, status: String = "ACTIVE") = + JSONObject().put("productId", id).put("entitlementType", type).put("entitlementTag", tag).put("status", status) + val rows = listOf( + row("DR:106479900", "DEFAULT", "VALIDATED_ONLINE_ACCESS"), + row("DR:231813200", "ORIGIN_DOWNLOAD", status = "DISABLED"), + row("Origin.OFR.50.0003426", "ONLINE_ACCESS"), + row("Origin.OFR.50.0003426", "ORIGIN_DOWNLOAD"), + row("Origin.OFR.50.0005237", "ORIGIN_DOWNLOAD"), + ) + assertEquals(setOf("DR:106479900", "DR:231813200"), EaLibrary.withoutGameDownload(rows).keys) + assertTrue(EaLibrary.withoutGameDownload(emptyList()).isEmpty()) + } + + @Test fun theStorePageNamesEachGameWithItsPrice() { + val game = { slug: String, title: String, date: String, price: String, sale: String, off: Int, free: Boolean -> + """{"slug":"$slug","title":"$title +","isFreeToPlay":$free,"franchiseSlug":"f","tier":"Tier1","releaseDate":"$date", + "packArt":{"ar16X9":"https://img/$slug-wide","ar2X3":"https://img/$slug-tall"},"genres":[{"name":"RPG"}], + "price":{"displayTotal":"$price","displayTotalWithDiscount":"$sale","discountPercentage":$off,"currency":"USD"}}""" + } + val html = """" + val (items, total) = EaStore.parsePage(html, "USD") + assertEquals("", EaStore.parsePage(html, "EUR").first.first().finalPrice) + assertEquals(40, total) + val ultima = items.first() + assertEquals("Ultima VII", ultima.title) + assertEquals("$2.49", ultima.finalPrice) + assertEquals("$4.99", ultima.originalPrice) + assertEquals(50, ultima.discountPercent) + assertEquals("https://www.ea.com/games/f/ultima-7", ultima.storeUrl) + assertTrue(items[1].isFree) + val shelves = EaStore.shelves(items, java.time.Instant.parse("2026-11-12T00:00:00Z")) + assertEquals(listOf("Ultima VII", "REDSEC"), shelves.whatsNew.map { it.title }) + assertEquals(listOf("Ultima VII"), shelves.deals.map { it.title }) + assertEquals(listOf("REDSEC"), shelves.free.map { it.title }) + val owned = CatalogItem(Store.EA, "Origin.OFR.1", "Ultimaโ„ข VII", null, owned = true, extra = mapOf("slug" to "other")) + val marked = com.droiddeck.launcher.stores.StoreFront.markOwned(shelves, listOf(owned), EaStore::sameGame) + assertEquals("Origin.OFR.1", marked.deals.single().id) + assertEquals("https://img/ultima-7-wide", marked.deals.single().imageUrl) + val bf = CatalogItem(Store.EA, "Origin.OFR.50.0005511", "Battlefieldโ„ข", null, owned = true, extra = mapOf("slug" to "glacier", "productName" to "Battlefieldโ„ข 6")) + assertTrue(EaStore.sameGame(CatalogItem(Store.EA, "ea-store:battlefield-6", "Battlefieldโ„ข 6", null, extra = mapOf("slug" to "battlefield-6")), bf)) + assertFalse(EaStore.sameGame(CatalogItem(Store.EA, "ea-store:bf-2042", "Battlefieldโ„ข 2042", null), bf)) + } + + @Test fun titlesMatchAcrossMarksAndAccentsButNeverWhenEmpty() { + assertEquals("pokemon", com.droiddeck.launcher.stores.StoreFront.titleKey("Pokรฉmonโ„ข")) + assertEquals("ใƒ•ใ‚กใ‚คใƒŠใƒซ 7", com.droiddeck.launcher.stores.StoreFront.titleKey("ใƒ•ใ‚กใ‚คใƒŠใƒซยฎ 7")) + val shelf = CatalogItem(Store.EA, "ea-store:a", "โ„ข", null) + assertFalse(EaStore.sameGame(shelf, CatalogItem(Store.EA, "Origin.OFR.2", "ยฎ", null, owned = true))) + } + + @Test fun ownedPageParses() { + val page = JSONObject( + """{"me":{"ownedGameProducts":{"next":"100","items":[{"originOfferId":"Origin.OFR.50.0001","product":{"id":"x","name":"N","downloadable":true,"gameSlug":"titanfall-2", + "baseItem":{"title":"Titanfall 2","gameType":"BASE_GAME","baseGameSlug":null},"gameProductUser":{"ownershipMethods":["PURCHASE"]}}}]}}}""", + ) + val (items, next) = EaApi.parseOwned(page) + assertEquals("100", next) + assertEquals("Titanfall 2", items.single().name) + assertEquals("", items.single().baseSlug) + val offers = EaApi.parseOffers(JSONObject("""{"legacyOffers":[{"offerId":"Origin.OFR.50.0001","contentId":"1035052","displayType":"FullGame","isDownloadable":true, + "downloads":[{"downloadType":"LIVE","gameVersion":"2.0.11.0"}],"softwareLocales":["en_US","fr_FR"],"executeParameters":null}]}""")) + assertEquals("2.0.11.0", offers.single().gameVersion) + assertEquals("", offers.single().executeParameters) + assertNotNull(EaApi.query("getPreloadedOwnedGames")) + } + + @Test fun launcherReadsTheSessionFileOnce() { + val text = StoreLaunch.launcherText(StoreGameSidecar(Store.EA, "Origin.OFR.1", "Game", exe = "bin/Game.exe", args = listOf("-dx12"))) + assertTrue(text.contains("for /f \"usebackq tokens=1,* delims==\" %%a in (\"%~dp0.droiddeck-ea-env\") do set \"%%a=%%b\"")) + assertTrue(text.contains("del \"%~dp0.droiddeck-ea-env\"")) + assertTrue(text.contains("start \"\" \"${StoreLaunch.EA_ORIGIN}\"\r\n\"%~dp0bin\\Game.exe\" -dx12\r\n")) + assertTrue(text.trimEnd().endsWith("taskkill /f /im Origin.exe >nul 2>&1")) + } + + @Test fun environmentCarriesTheSession() { + val account = EaAuth.Account("a", "r", 0, "1001", "2002", "Name", "EaId") + val env = EaLaunch.environment("Origin.OFR.1", "1035052", "fr_FR", "generic", "jwt", "opaque", account, "session") + assertEquals("generic", env["EAGenericAuthToken"]) + assertEquals("jwt", env["EAAccessTokenJWS"]) + assertEquals("3216", env["EALsxPort"]) + assertEquals("opaque", env["EALaunchUserAuthToken"]) + assertEquals("EaId", env["EALaunchEAID"]) + assertEquals("1035052", env["ContentId"]) + assertEquals("fr_FR", env["EAGameLocale"]) + } + + @Test fun activationCoreSitsBesideTheExe() { + val dir = Files.createTempDirectory("ea").toFile() + File(dir, "Binaries/Win32/Core").mkdirs() + File(dir, "Binaries/Win32/Core/EACore.dll").writeText("x") + val core = EaOoa.coreDir(dir, "Binaries/Win32/MassEffect3.exe") + assertEquals(File(dir, "Binaries/Win32/Core").canonicalPath, core?.canonicalPath) + assertTrue(EaOoa.legacyCore(core)) + assertNull(EaOoa.coreDir(dir, "Game.exe")) + File(dir, "Core").mkdirs() + assertEquals(File(dir, "Core").canonicalPath, EaOoa.coreDir(dir, "Game.exe")?.canonicalPath) + dir.deleteRecursively() + } + + @Test fun anIncompleteProbeIsNotHashed() { + val empty = EaOoa.Hardware.fromJson(JSONObject()) + assertTrue(!empty.complete(0) && !empty.complete(4)) + val wmiOnly = EaOoa.Hardware.fromJson(JSONObject().put("boardManufacturer", "Intel Corporation").put("biosManufacturer", "The Wine Project") + .put("osSerial", "00330").put("osInstallDate", "2026").put("hostname", "DROIDDECK")) + assertTrue(wmiOnly.complete(0)) + assertTrue(!wmiOnly.complete(4)) + assertTrue(wine.complete(4)) + assertTrue(wine.complete(2)) + val noInstallDate = EaOoa.Hardware.fromJson(JSONObject().put("boardManufacturer", "Wine").put("biosManufacturer", "Wine").put("osSerial", "1") + .put("volumeSerial", "43000000").put("cpuVendor", "GenuineIntel").put("cpuEdx", "BFEBFBFF").put("cpuEax", "000906EA").put("cpuEcx", "7ffafbbf")) + assertTrue(!noInstallDate.complete(2)) + assertTrue(noInstallDate.complete(3) && noInstallDate.complete(4)) + } + + @Test fun legacyManifestNamesItsContentAndTitle() { + val xml = """7107371183 + RUMass Effect 3 + /__Installer/touchup.exeinstall -locale {locale}""" + val m = EaManifest.parse(xml) + assertEquals(listOf("71073", "71183"), m.contentIds) + assertEquals("Mass Effect 3", m.title("en_US")) + assertEquals("RU", m.title("ru_RU")) + assertEquals("Mass Effect 3", m.title("de_DE")) + assertEquals("/__Installer/touchup.exe", m.touchupPath) + } + + @Test fun aNumericTrialFlagKeepsTheTrialExeOut() { + val xml = """ + [HKEY_LOCAL_MACHINE\SOFTWARE\EA Games\Need for Speed Heat\Install Dir]NeedForSpeedHeatTrial.exe1 + [HKEY_LOCAL_MACHINE\SOFTWARE\EA Games\Need for Speed Heat\Install Dir]NeedForSpeedHeat.exe0 + """ + assertTrue(EaManifest.parse(xml).launcher()!!.path.endsWith("NeedForSpeedHeat.exe")) + } + + @Test fun aSyncRequestedWhileOneRunsIsNotLost() { + val gate = SyncGate() + assertTrue(gate.enter()) + assertTrue(!gate.enter()) + assertTrue(gate.leave()) + assertTrue(!gate.leave()) + assertTrue(gate.enter()) + assertTrue(!gate.leave()) + } + + @Test fun aRequestRacingTheRunnersExitIsPickedUpBySomeone() { + repeat(200) { + val gate = SyncGate() + val runs = java.util.concurrent.atomic.AtomicInteger() + assertTrue(gate.enter()) + val latch = java.util.concurrent.CountDownLatch(1) + val requester = Thread { latch.await(); if (gate.enter()) { runs.incrementAndGet(); while (gate.leave()) runs.incrementAndGet() } } + requester.start() + latch.countDown() + while (gate.leave()) runs.incrementAndGet() + requester.join() + assertTrue("the second request was dropped", runs.get() >= 1) + } + } + + @Test fun aSyncThatSnapshottedBeforeSignOutCannotWriteItsLibrary() { + val app = org.robolectric.RuntimeEnvironment.getApplication() + val game = EaGame("Origin.OFR.1", "1", "Old account game", "old") + val (gen, _) = EaLibrary.snapshot(app) + EaLibrary.reset(app) + assertTrue(!EaLibrary.storeCache(app, listOf(game), gen)) + assertTrue(EaLibrary.cached(app).isEmpty()) + val (fresh, cache) = EaLibrary.snapshot(app) + assertTrue(cache.isEmpty()) + assertTrue(EaLibrary.storeCache(app, listOf(game), fresh)) + assertEquals("Old account game", EaLibrary.cached(app).single().title) + EaLibrary.reset(app) + } + + @Test fun aRefreshFinishingAfterSignOutDoesNotRestoreTheSignIn() { + val app = org.robolectric.RuntimeEnvironment.getApplication() + com.droiddeck.launcher.stores.StoreAccounts.write(app, Store.EA, JSONObject().put("access_token", "old").put("refresh_token", "r").put("user_id", "1")) + assertTrue(EaAuth.storeRefreshed(app, "newer", 3600, "r2")) + assertEquals("newer", EaAuth.load(app)?.accessToken) + EaAuth.signOut(app) + assertTrue(!EaAuth.storeRefreshed(app, "late", 3600, "r3")) + assertNull(EaAuth.load(app)) + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/stores/epic/EpicClientTest.kt b/app/src/test/java/com/droiddeck/launcher/stores/epic/EpicClientTest.kt index 1b92f1f1a0..6cc80dc47f 100644 --- a/app/src/test/java/com/droiddeck/launcher/stores/epic/EpicClientTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/stores/epic/EpicClientTest.kt @@ -225,8 +225,9 @@ class EpicClientTest { } @Test fun launcherVersionComesFromTheRedirect() { - val location = "https://content-download-egs.distro.on.epicgames.com/Builds/EGLv2/0.95.2%2Bgfa9ad49/Linux/EpicGamesLauncher-x86_64.AppImage?launcherfilename=EpicGamesLauncher-x86_64.AppImage" - assertEquals("0.95.2+gfa9ad49", EpicClientSources.launcherVersion(location)) + val location = "https://content-download-egs.distro.on.epicgames.com/Builds/EGLv2/0.113.0%2Bg2164614/Linux/EpicGamesLauncher-x86_64.deb?launcherfilename=EpicGamesLauncher-x86_64.deb" + assertEquals("0.113.0+g2164614", EpicClientSources.launcherVersion(location)) + assertTrue(EpicClientSources.LAUNCHER_URL.endsWith("/" + EpicClientSources.LAUNCHER_FILE)) assertNull(EpicClientSources.launcherVersion("http://content-download-egs.distro.on.epicgames.com/Builds/EGLv2/1.0/Linux/a")) assertNull(EpicClientSources.launcherVersion("https://example.com/Builds/EGLv2/..%2F..%2Fetc/Linux/a")) assertNull(EpicClientSources.launcherVersion("https://example.com/other/path")) @@ -256,11 +257,33 @@ class EpicClientTest { assertEquals(true, EpicClientSources.etagMatches(file, hex(md5(data)))) } - @Test fun appImageMagicIsRequired() { - val good = File(tmp.root, "a").apply { writeBytes(byteArrayOf(0x7f, 'E'.code.toByte(), 'L'.code.toByte(), 'F'.code.toByte(), 2, 1, 1, 0, 'A'.code.toByte(), 'I'.code.toByte(), 2, 0)) } - val bad = File(tmp.root, "b").apply { writeBytes(ByteArray(16)) } - assertTrue(EpicClientSources.isAppImage(good)) - assertFalse(EpicClientSources.isAppImage(bad)) + @Test fun debianPackageMagicIsRequired() { + val good = File(tmp.root, "a").apply { writeBytes("!\ndebian-binary/ 0 0 0 100644 4 `\n2.0\n".toByteArray()) } + val plainAr = File(tmp.root, "b").apply { writeBytes("!\ndata.tar.gz/".toByteArray()) } + val appImage = File(tmp.root, "c").apply { writeBytes(byteArrayOf(0x7f, 'E'.code.toByte(), 'L'.code.toByte(), 'F'.code.toByte(), 2, 1, 1, 0, 'A'.code.toByte(), 'I'.code.toByte(), 2, 0)) } + val short = File(tmp.root, "d").apply { writeBytes("!".toByteArray()) } + assertTrue(EpicClientSources.isDeb(good)) + assertFalse(EpicClientSources.isDeb(plainAr)) + assertFalse(EpicClientSources.isDeb(appImage)) + assertFalse(EpicClientSources.isDeb(short)) + assertFalse(EpicClientSources.isDeb(File(tmp.root, "missing"))) + } + + @Test fun desktopPackagesArePinnedWithAFallbackMirror() { + val packages = EpicClientSources.DESKTOP + assertTrue(packages.isNotEmpty()) + assertEquals(packages.size, packages.map { it.file }.toSet().size) + assertTrue(packages.any { it.file.startsWith("libwebkit2gtk-4.1-0_") }) + assertTrue(packages.any { it.file.startsWith("libjavascriptcoregtk-4.1-0_") }) + assertTrue(packages.any { it.file.startsWith("libgtk-3-0t64_") }) + packages.forEach { p -> + assertTrue(p.path, Regex("^pool/main/[a-z0-9]+/[^/]+/[^/]+_amd64\\.deb$").matches(p.path)) + assertTrue(p.path, Regex("^[0-9a-f]{64}$").matches(p.sha256)) + assertTrue(p.path, p.size > 0) + assertEquals(listOf(EpicClientSources.DEBIAN + p.path, EpicClientSources.SNAPSHOT + p.path), p.urls) + assertTrue(p.urls.all { it.startsWith("https://") && it.endsWith("/" + p.file) }) + } + assertTrue(EpicClientSources.GLES_FILE !in packages.map { it.file }) } @Test fun signInUrlsMustRedirectToLoopback() { diff --git a/app/src/test/java/com/droiddeck/launcher/stores/gog/GogMaintenanceTest.kt b/app/src/test/java/com/droiddeck/launcher/stores/gog/GogMaintenanceTest.kt index 06c88bfd11..c98c1da30e 100644 --- a/app/src/test/java/com/droiddeck/launcher/stores/gog/GogMaintenanceTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/stores/gog/GogMaintenanceTest.kt @@ -302,10 +302,17 @@ class GogMaintenanceTest { File(folder, "Game.bin").writeText("original") assertThrows(IllegalArgumentException::class.java) { GogFiles.validate(JSONArray("""[{"path":"game.bin"}]"""), folder) } assertThrows(IllegalArgumentException::class.java) { GogFiles.validate(JSONArray("""[{"path":".droiddeck-store.json"}]"""), folder) } + val data = File(folder, "Data").apply { mkdirs() } + val installed = JSONArray() + for (i in 0 until 2000) { File(data, "Part$i.bin").writeText(""); installed.put(JSONObject().put("path", "Data/Part$i.bin")) } + GogFiles.validate(installed, folder) + assertThrows(IllegalArgumentException::class.java) { GogFiles.validate(JSONArray("""[{"path":"Data/Part0.bin"},{"path":"Data/part1.bin"}]"""), folder) } val outside = temporary.newFolder() try { Files.createSymbolicLink(File(folder, "link").toPath(), outside.toPath()) } catch (_: java.nio.file.FileSystemException) { return } assertThrows(IllegalArgumentException::class.java) { GogFiles.inside(folder, "link/game.exe") } + assertThrows(IllegalArgumentException::class.java) { GogFiles.validate(JSONArray("""[{"path":"Data/Part0.bin"},{"path":"link/game.exe"}]"""), folder) } + assertThrows(IllegalArgumentException::class.java) { GogFiles.validate(JSONArray("""[{"path":"a/./file"}]"""), folder) } } @Test fun resumedInstallSpaceCountsOnlyFilesStillMissing() { diff --git a/app/src/test/java/com/droiddeck/launcher/stores/rockstar/RockstarLaunchCipherTest.kt b/app/src/test/java/com/droiddeck/launcher/stores/rockstar/RockstarLaunchCipherTest.kt new file mode 100644 index 0000000000..39031e7c47 --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/stores/rockstar/RockstarLaunchCipherTest.kt @@ -0,0 +1,35 @@ +package com.droiddeck.launcher.stores.rockstar + +import org.junit.Assert.assertArrayEquals +import org.junit.Assert.assertThrows +import org.junit.Test + +class RockstarLaunchCipherTest { + private fun bytes(hex: String) = ByteArray(hex.length / 2) { hex.substring(it * 2, it * 2 + 2).toInt(16).toByte() } + + @Test + fun decodesSyntheticCbcVectorsWithBothKeySchedules() { + val outer = bytes("f49a68fe243848826077b14d60b2f43c00000000000000000000000000000000") + val inner = bytes("864b81362b7d5bb23cd69b9bdb1980c500000000000000000000000000000000") + assertArrayEquals("launch-test-0000".toByteArray(), RockstarLaunchCipher.decrypt(outer, bytes("b804c12ac4af4d8962636fa63c00dda6"), false)) + assertArrayEquals("launch-test-0000".toByteArray(), RockstarLaunchCipher.decrypt(inner, bytes("50a6ad87e83fcde3593f86ae889cdaef"), true)) + } + + @Test + fun rejectsBadPaddingAndInvalidCipherSizes() { + val cipher = bytes("f49a68fe243848826077b14d60b2f43c00000000000000000000000000000000") + cipher[15] = (cipher[15].toInt() xor 1).toByte() + assertThrows(IllegalArgumentException::class.java) { RockstarLaunchCipher.decrypt(cipher, ByteArray(16), false) } + for (size in listOf(0, 15, 65552)) { + assertThrows(IllegalArgumentException::class.java) { RockstarLaunchCipher.decrypt(ByteArray(size), ByteArray(16), false) } + } + assertThrows(IllegalArgumentException::class.java) { RockstarLaunchCipher.decode("A".repeat(90001), "") } + } + + @Test + fun rejectsExternalDocumentTypesBeforeXmlParsing() { + assertThrows(IllegalArgumentException::class.java) { + RockstarRos.parse("") + } + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/stores/rockstar/RockstarMetadataTest.kt b/app/src/test/java/com/droiddeck/launcher/stores/rockstar/RockstarMetadataTest.kt new file mode 100644 index 0000000000..cb07f0914e --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/stores/rockstar/RockstarMetadataTest.kt @@ -0,0 +1,78 @@ +package com.droiddeck.launcher.stores.rockstar + +import org.junit.Assert.* +import org.junit.Test +import org.junit.runner.RunWith +import org.robolectric.RobolectricTestRunner +import org.robolectric.annotation.Config +import java.nio.ByteBuffer +import java.nio.ByteOrder +import javax.crypto.Cipher +import javax.crypto.spec.IvParameterSpec +import javax.crypto.spec.SecretKeySpec + +@RunWith(RobolectricTestRunner::class) +@Config(sdk = [33], application = android.app.Application::class) +class RockstarMetadataTest { + @Test fun findsRootMetadataAfterManyOtherFiles() { + val root = java.nio.file.Files.createTempDirectory("rockstar-many-files").toFile() + try { + repeat(300) { java.io.File(root, "asset-$it.dat").writeText("asset") } + java.io.File(root, "title.rgl").writeBytes(container("""{"titleId":"game","rosTitleId":123,"principalFileName":"Game.exe"}""")) + assertEquals("game", RockstarMetadata.find(root)?.id) + java.io.File(root, "title.rgl").delete() + java.io.File(root, "Title.RGL").writeBytes(container("""{"titleId":"game","rosTitleId":123,"principalFileName":"Game.exe"}""")) + assertEquals("game", RockstarMetadata.find(root)?.id) + } finally { + root.deleteRecursively() + } + } + + private fun container(json: String): ByteArray { + val iv = ByteArray(16) { it.toByte() } + val cipher = Cipher.getInstance("AES/CBC/PKCS5Padding") + cipher.init(Cipher.ENCRYPT_MODE, SecretKeySpec(ByteArray(32), "AES"), IvParameterSpec(iv)) + val payload = iv + cipher.doFinal(json.toByteArray()) + val header = ByteBuffer.allocate(80).order(ByteOrder.LITTLE_ENDIAN) + header.put(byteArrayOf(82, 71, 76, 77)).putInt(1).putInt(payload.size) + return header.array() + payload + } + + @Test fun decodesInstalledTitleWithoutAnAppIdAllowlist() { + val title = RockstarMetadata.decode(container("""{"titleId":"new_title","rosTitleId":123,"principalFileName":"Game/Binaries/Win64/Game.exe"}"""))!! + assertEquals("new_title", title.id) + assertEquals(123, title.rosId) + assertEquals("Game/Binaries/Win64/Game.exe", title.exe) + } + + @Test fun rejectsBrokenContainersAndEscapingExecutables() { + val valid = container("""{"titleId":"game","rosTitleId":123,"principalFileName":"Game.exe"}""") + assertNull(RockstarMetadata.decode(valid.copyOf(90))) + assertNull(RockstarMetadata.decode(valid.copyOf().also { it[4] = 2 })) + assertNull(RockstarMetadata.decode(valid + byteArrayOf(0))) + assertNull(RockstarMetadata.decode(container("""{"titleId":"game","rosTitleId":1.5,"principalFileName":"Game.exe"}"""))) + for (exe in listOf("../outside.exe", "C:/outside.exe", "/outside.exe")) { + assertNull(RockstarMetadata.decode(container("""{"titleId":"game","rosTitleId":123,"principalFileName":"$exe"}"""))) + } + } + + @Test fun doesNotFollowMetadataSymlinksOutsideTheGame() { + val root = java.nio.file.Files.createTempDirectory("rockstar-metadata").toFile() + val outside = java.io.File.createTempFile("rockstar-external", ".rgl") + try { + outside.writeBytes(container("""{"titleId":"game","rosTitleId":123,"principalFileName":"Game.exe"}""")) + val link = java.io.File(root, "title.rgl").toPath() + try { java.nio.file.Files.createSymbolicLink(link, outside.toPath()) } + catch (e: java.nio.file.FileSystemException) { org.junit.Assume.assumeNoException(e) } + assertNull(RockstarMetadata.find(root)) + java.nio.file.Files.delete(link) + java.io.File(root, "nested").mkdir() + outside.copyTo(java.io.File(root, "nested/title.rgl")) + assertEquals("game", RockstarMetadata.find(root)?.id) + assertEquals("nested/Game.exe", RockstarMetadata.find(root)?.exe) + } finally { + root.deleteRecursively() + outside.delete() + } + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/stores/rockstar/RockstarTest.kt b/app/src/test/java/com/droiddeck/launcher/stores/rockstar/RockstarTest.kt new file mode 100644 index 0000000000..755bd7320c --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/stores/rockstar/RockstarTest.kt @@ -0,0 +1,365 @@ +package com.droiddeck.launcher.stores.rockstar + +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.RobolectricTestRunner +import org.robolectric.annotation.Config + +@RunWith(RobolectricTestRunner::class) +@Config(sdk = [33], application = android.app.Application::class) +class RockstarTest { + @Test fun sdkTicketExportsOnlyTheShortLivedServerResponse() { + val root = RockstarRos.parse("""1opaque-game-ticket456session-keysession-ticketexample.invalidservice-refresh-secretrefresh-secret123Playerplayer@example.invalidnested-refresh-secret""") + val sdk = RockstarRos.parse(RockstarAuth.sdkTicket(root)) + assertEquals("opaque-game-ticket", RockstarRos.text(sdk, "Ticket")) + assertEquals("session-key", RockstarRos.text(sdk, "SessionKey")) + assertEquals("123", RockstarRos.text(sdk, "RockstarId")) + assertEquals("456", RockstarRos.text(sdk, "PlayerAccountId")) + assertEquals("1", RockstarRos.first(sdk, "Services")?.getAttribute("Count")) + assertEquals("example.invalid", RockstarRos.text(sdk, "Host")) + assertNull(RockstarRos.first(sdk, "ScAuthToken")) + assertFalse(RockstarAuth.sdkTicket(root).contains("refresh-secret")) + } + + @Test fun sdkTitleStateRequiresAnOwnedPackageInsteadOfCatalogVisibility() { + val visible = RockstarApp("1", "future_title", "123", emptyList()) + val featured = RockstarAccountApps(listOf(visible), listOf(RockstarPackage("future_title", true))) + assertFalse(RockstarLibrary.owns(featured, 123, "future_title")) + val owned = RockstarAccountApps(listOf(visible), listOf(RockstarPackage("future_title", false))) + assertTrue(RockstarLibrary.owns(owned, 123, "future_title")) + assertFalse(RockstarLibrary.owns(owned, 124, "other_title")) + } + + @Test fun directLaunchPreservesArgumentsThroughTheWindowsBatchInterpreter() { + org.junit.Assume.assumeTrue(java.io.File.separatorChar == '\\') + val root = java.nio.file.Files.createTempDirectory("rockstar-batch").toFile() + try { + java.io.File(System.getenv("SystemRoot"), "System32/cscript.exe").copyTo(java.io.File(root, "Game.exe")) + java.io.File(root, "probe.vbs").writeText(""" + Set output = CreateObject("Scripting.FileSystemObject").CreateTextFile("args.txt", True) + For Each arg In WScript.Arguments + output.WriteLine(arg) + Next + output.Close + """.trimIndent()) + val args = listOf("", "&literal", "one argument", "%PATH%", "!PATH!", "^&|<>()") + val game = com.droiddeck.launcher.stores.StoreGameSidecar(com.droiddeck.launcher.stores.Store.ROCKSTAR, + "future_title", "Game", "Game.exe", args = listOf("//nologo", "probe.vbs") + args) + com.droiddeck.launcher.stores.StoreLaunch.writeLauncher(root, game) + val process = ProcessBuilder("cmd.exe", "/d", "/c", java.io.File(root, com.droiddeck.launcher.stores.StoreLaunch.LAUNCHER).path) + .directory(root).redirectErrorStream(true).start() + assertTrue(process.waitFor(10, java.util.concurrent.TimeUnit.SECONDS)) + assertEquals(process.inputStream.bufferedReader().readText(), 0, process.exitValue()) + assertEquals(args, java.io.File(root, "args.txt").readLines()) + } finally { + root.deleteRecursively() + } + } + + @Test fun launcherAdoptionDoesNotFollowSymbolicLinks() { + val folder = java.nio.file.Files.createTempDirectory("rockstar-launch-link").toFile() + val outside = java.io.File.createTempFile("rockstar-keep", ".txt").apply { writeText("keep") } + val link = java.io.File(folder, com.droiddeck.launcher.stores.StoreLaunch.LAUNCHER) + try { + try { + java.nio.file.Files.createSymbolicLink(link.toPath(), outside.toPath()) + } catch (e: java.nio.file.FileSystemException) { + org.junit.Assume.assumeNoException(e) + } + java.io.File(folder, "gta3.exe").writeText("game") + val game = com.droiddeck.launcher.stores.StoreGameSidecar(com.droiddeck.launcher.stores.Store.ROCKSTAR, "gta3", "GTA III", "gta3.exe", launcher = com.droiddeck.launcher.stores.StoreLaunch.LAUNCHER) + assertNull(com.droiddeck.launcher.stores.StoreLaunch.adopt(folder, game).launcher) + assertNull(com.droiddeck.launcher.stores.StoreLaunch.writeLauncher(folder, game).launcher) + assertEquals("keep", outside.readText()) + assertTrue(java.nio.file.Files.isSymbolicLink(link.toPath())) + } finally { + java.nio.file.Files.deleteIfExists(link.toPath()) + folder.deleteRecursively() + outside.delete() + } + } + + @Test fun resumeHashingStopsWhenCancelled() { + val file = java.io.File.createTempFile("rockstar-hash", ".bin") + try { + val bytes = ByteArray(1024 * 1024) + file.writeBytes(bytes) + val hash = java.security.MessageDigest.getInstance("SHA-256").digest(bytes).joinToString("") { "%02x".format(it) } + val chunk = RockstarChunk("1", "1", hash, 0, bytes.size.toLong()) + var checks = 0 + assertFalse(RockstarManifest.verified(file, chunk) { ++checks >= 3 }) + assertEquals(3, checks) + assertTrue(RockstarManifest.verified(file, chunk)) + } finally { + file.delete() + } + } + + @Test fun otherRockstarGamesRegisterAndLaunchTheirInstalledExecutable() { + val app = org.robolectric.RuntimeEnvironment.getApplication() + com.droiddeck.launcher.session.SessionPrefs.setGameStorage(app, com.droiddeck.launcher.session.SessionPrefs.GAME_STORAGE_OFF, "") + val folder = java.io.File(com.droiddeck.launcher.stores.StoreInstallRoot.storeDir(com.droiddeck.launcher.stores.StoreInstallRoot.installRoot(app), com.droiddeck.launcher.stores.Store.ROCKSTAR), "RDR2").apply { mkdirs() } + try { + val game = com.droiddeck.launcher.stores.StoreGameSidecar(com.droiddeck.launcher.stores.Store.ROCKSTAR, "rdr2", "RDR2", "RDR2.exe") + java.io.File(folder, game.exe).writeText("installed game") + val script = java.io.File(folder, com.droiddeck.launcher.stores.StoreLaunch.LAUNCHER) + script.writeText("old launcher") + val finished = com.droiddeck.launcher.stores.StoreLaunch.writeLauncher(folder, game) + finished.write(folder) + assertFalse(RockstarLaunch.usesClassicLauncher(game.id)) + assertEquals(com.droiddeck.launcher.stores.StoreLaunch.LAUNCHER, finished.launcher) + assertTrue(script.readText().contains("\"%~dp0RDR2.exe\"")) + assertTrue(script.readText().contains("if not exist \"C:\\Program Files\\Rockstar Games\\Launcher\\launch.json\" goto direct")) + assertTrue(java.io.File(folder, game.exe).isFile) + } finally { + folder.deleteRecursively() + } + } + + @Test fun otherRockstarGamesCanRegisterShortcuts() { + org.junit.Assume.assumeTrue(java.io.File.separatorChar == '/') + val app = org.robolectric.RuntimeEnvironment.getApplication() + com.droiddeck.launcher.session.SessionPrefs.setGameStorage(app, com.droiddeck.launcher.session.SessionPrefs.GAME_STORAGE_OFF, "") + val folder = java.io.File(com.droiddeck.launcher.stores.StoreInstallRoot.storeDir(com.droiddeck.launcher.stores.StoreInstallRoot.installRoot(app), com.droiddeck.launcher.stores.Store.ROCKSTAR), "RDR2").apply { mkdirs() } + try { + java.io.File(folder, "RDR2.exe").writeText("installed game") + com.droiddeck.launcher.stores.StoreGameSidecar(com.droiddeck.launcher.stores.Store.ROCKSTAR, "rdr2", "RDR2", "RDR2.exe").write(folder) + val game = com.droiddeck.launcher.frontend.AddedGames.single(app, folder.path) + assertTrue(game != null) + assertTrue(game!!.guestExe.endsWith("/" + com.droiddeck.launcher.stores.StoreLaunch.LAUNCHER)) + } finally { + folder.deleteRecursively() + } + } + + @Test fun existingRockstarLaunchScriptsAreRefreshed() { + val folder = java.nio.file.Files.createTempDirectory("rockstar-launch").toFile() + try { + java.io.File(folder, "gta3.exe").writeBytes(byteArrayOf(1)) + val game = com.droiddeck.launcher.stores.StoreGameSidecar(com.droiddeck.launcher.stores.Store.ROCKSTAR, "gta3", "GTA III", "gta3.exe", launcher = com.droiddeck.launcher.stores.StoreLaunch.LAUNCHER) + val script = java.io.File(folder, com.droiddeck.launcher.stores.StoreLaunch.LAUNCHER) + script.writeText("old launch script") + com.droiddeck.launcher.stores.StoreLaunch.adopt(folder, game) + assertTrue(script.readText().contains("Rockstar Games\\Launcher\\Launcher.exe")) + assertFalse(script.readText().contains("old launch script")) + } finally { + folder.deleteRecursively() + } + } + + @Test + @Config(sdk = [28]) + fun classicLaunchDefaultsAreSetBeforeWineAndKeepExplicitSettings() { + val app = org.robolectric.RuntimeEnvironment.getApplication() + val explicit = com.droiddeck.launcher.core.GameEnvironment.Config(games = mapOf( + "100" to mapOf("FEX_X87REDUCEDPRECISION" to "1"), + "104" to mapOf("PROTON_USE_WINED3D" to "0"), + )) + com.droiddeck.launcher.session.GameEnvironmentStore.save(app, explicit) + RockstarLaunch.applyDefaults(app, "gta3", 100) + RockstarLaunch.applyDefaults(app, "gta3", 101) + RockstarLaunch.applyDefaults(app, "gtasa", 102) + RockstarLaunch.applyDefaults(app, "gtavc", 103) + RockstarLaunch.applyDefaults(app, "gtasa", 104) + val config = com.droiddeck.launcher.session.GameEnvironmentStore.read(app) + assertEquals("1", config.games["100"]?.get("FEX_X87REDUCEDPRECISION")) + assertEquals("0", config.games["101"]?.get("FEX_X87REDUCEDPRECISION")) + assertEquals(mapOf("PROTON_USE_WINED3D" to "1"), config.games["102"]) + assertEquals("0", config.games["104"]?.get("PROTON_USE_WINED3D")) + assertFalse(config.games.containsKey("103")) + } + + @Test fun classicTitlesUseTheirObservedPipeNames() { + assertEquals(mapOf("gta3" to "GTA3_Pipe", "gtavc" to "GTA-VC_Pipe", "gtasa" to "GTA_SA_Pipe", "gta4" to "GTAIV_Pipe", "lanoire" to "LANOIRE_Pipe"), RockstarLaunch.pipes) + for (id in RockstarLaunch.pipes.keys) assertTrue(RockstarLaunch.usesClassicLauncher(id)) + } + + @Test fun signingOutClearsOwnedShelfCards() { + val store = com.droiddeck.launcher.stores.Store.ROCKSTAR + com.droiddeck.launcher.stores.StoresState.library[store] = emptyList() + com.droiddeck.launcher.stores.StoresState.shelves[store] = com.droiddeck.launcher.stores.StoreShelves() + RockstarLibrary.reset() + org.robolectric.shadows.ShadowLooper.idleMainLooper() + assertFalse(com.droiddeck.launcher.stores.StoresState.library.containsKey(store)) + assertFalse(com.droiddeck.launcher.stores.StoresState.shelves.containsKey(store)) + } + + @Test fun resumedChunksMustStillMatchTheirFiles() { + val folder = java.nio.file.Files.createTempDirectory("rockstar-resume").toFile() + try { + val file = java.io.File(folder, "game.bin") + val bytes = "verified chunk".toByteArray() + val hash = java.security.MessageDigest.getInstance("SHA-256").digest(bytes).joinToString("") { "%02x".format(it) } + val chunk = RockstarChunk("1", "2", hash, 2, bytes.size.toLong()) + assertFalse(RockstarManifest.verified(file, chunk)) + file.writeBytes(byteArrayOf(0, 0) + bytes) + assertTrue(RockstarManifest.verified(file, chunk)) + java.io.RandomAccessFile(file, "rw").use { it.setLength(4) } + assertFalse(RockstarManifest.verified(file, chunk)) + file.writeBytes(ByteArray(bytes.size + 2)) + assertFalse(RockstarManifest.verified(file, chunk)) + } finally { + folder.deleteRecursively() + } + } + + @Test fun manifestWritesRejectSymbolicLinks() { + val folder = java.nio.file.Files.createTempDirectory("rockstar-path").toFile() + val outside = java.nio.file.Files.createTempDirectory("rockstar-outside").toFile() + try { + val link = java.io.File(folder, "linked") + try { + java.nio.file.Files.createSymbolicLink(link.toPath(), outside.toPath()) + } catch (e: java.nio.file.FileSystemException) { + org.junit.Assume.assumeNoException(e) + } + assertTrue(runCatching { RockstarManifest.inside(folder, "linked/game.bin") }.isFailure) + assertEquals(java.io.File(folder.canonicalFile, "normal/game.bin"), RockstarManifest.inside(folder, "normal/game.bin")) + java.nio.file.Files.deleteIfExists(link.toPath()) + } finally { + folder.deleteRecursively() + outside.deleteRecursively() + } + } + + @Test + fun rockstarLaunchScriptsContainNoCredentials() { + val sidecar = com.droiddeck.launcher.stores.StoreGameSidecar( + com.droiddeck.launcher.stores.Store.ROCKSTAR, "gtavc", "Vice City", "gta-vc.exe", + ) + val text = com.droiddeck.launcher.stores.StoreLaunch.launcherText(sidecar) + assertTrue(text.contains("\"C:\\Program Files\\Rockstar Games\\Launcher\\Launcher.exe\"")) + assertTrue(text.contains("exit /b %errorlevel%")) + assertTrue(text.contains("goto direct")) + assertTrue(text.contains("\"%~dp0gta-vc.exe\"")) + assertFalse(text.contains("ticket", true)) + assertFalse(text.contains("rem ", true)) + } + + private val apps = """ +1 + + BRANCHACCESS token="L" + + + + + BRANCHACCESS token="S" + + + BRANCHACCESS token="B" + BRANCHACCESS token="D" + + + + {"title":"gta4","isFeatured":false,"packageType":"title"} + {"title":"rdr2","isFeatured":false,"packageType":"title"} + {"title":"gtatrilogy","isFeatured":true,"packageType":"bundle"} + {"title":"gta5","isFeatured":false,"packageType":"title"} +""" + + private fun account(xml: String = apps) = RockstarRos.parse(xml).let { RockstarAccountApps(RockstarApps.parse(it), RockstarApps.packages(it)) } + + private val manifest = """ +1 + + + Launcher.exe + + FF + + + ThirdParty\Steam\steam_api64.dll + + ee + + false""" + + @Test fun branchesNeedARealBuild() { + val parsed = account().apps + val gta4 = parsed.first { it.name == "gta4" } + assertEquals("31", RockstarApps.branch(gta4)!!.id) + assertNull(RockstarApps.branch(parsed.first { it.name == "rdr2_sp_steam" })) + assertNull(RockstarApps.branch(parsed.first { it.name == "gta5" })) + } + + @Test fun ownedTitlesAreTheAccountsOwnPackagesNotTheFeaturedOnes() { + assertEquals(listOf("gta4", "rdr2", "gta5"), RockstarLibrary.owned(account()).map { it.id }) + } + + @Test fun libraryListsOnlyOwnedTitlesRockstarDelivers() { + val games = RockstarLibrary.games(account()) + assertEquals(listOf("gta4"), games.map { it.id }) + assertEquals("gta4", games[0].extra["app"]) + assertTrue(games.all { it.owned }) + } + + @Test fun anOwnedTrilogyBundleIsAllThreeDefinitiveEditions() { + val owned = RockstarLibrary.owned(account(apps.replace("\"isFeatured\":true,\"packageType\":\"bundle\"", "\"isFeatured\":false,\"packageType\":\"bundle\""))) + assertTrue(owned.map { it.id }.containsAll(listOf("gta3unreal", "gtavcunreal", "gtasaunreal"))) + } + + @Test fun manifestFilesCarryTheirChunksAndWindowsPathsBecomeRelative() { + val build = RockstarManifest.parse(RockstarRos.parse(manifest)) + assertEquals("1311", build.buildId) + assertFalse(build.preload) + assertEquals(34L, build.bytes) + val exe = build.files[0] + assertEquals(listOf("46859", "46860"), exe.chunks.map { it.chunkId }) + assertEquals("ab", exe.chunks[0].sha256) + assertEquals("ff", exe.sha256) + assertEquals("ThirdParty/Steam/steam_api64.dll", build.files[1].path) + } + + @Test fun pathsThatLeaveTheInstallAreRefused() { + assertNull(RockstarManifest.safePath("..\\..\\Windows\\x.dll")) + assertNull(RockstarManifest.safePath("C:\\x.dll")) + assertEquals("a/b.rpf", RockstarManifest.safePath("\\a\\.\\b.rpf")) + } + + @Test fun urlBatchesStayWithinTheirByteAndCountLimits() { + val chunks = (1..5).map { RockstarChunk("1", "$it", "", 0, if (it == 3) 100 else 10) } + val batches = RockstarManifest.batches(chunks, maxBytes = 30, maxCount = 2) + assertEquals(listOf(listOf("1", "2"), listOf("3"), listOf("4", "5")), batches.map { b -> b.map { it.chunkId } }) + } + + @Test fun rosErrorsNameTheirCode() { + val root = RockstarRos.parse("0") + assertEquals("AuthenticationFailed", RockstarRos.first(root, "Error")!!.getAttribute("Code")) + } + + @Test fun ticketAnswerGivesTheAccountAndExpiry() { + val root = RockstarRos.parse("""1TK + S86399 + 42player""") + val t = RockstarAuth.parseTicket(root, now = 1000L)!! + assertEquals("T", t.ticket) + assertEquals("42", t.rockstarId) + assertEquals("player", t.nickname) + assertEquals(1000L + 86_399_000L, t.expiresAt) + } + + @Test fun gatewayStateIsWrittenAsThePageWritesIt() { + val fp = RockstarAuth.fingerprintOf("DROIDDECK-DUO", "0a0b0c0d", "0011223344556677") + assertEquals("{\"fp\": {\"device_name\":\"DROIDDECK-DUO\",\"machine_name\":\"DROIDDECK-DUO\",\"os_version\":\"10.0.19045\",\"volume_serial\":\"0a0b0c0d\",\"cpu_info\":\"0011223344556677\"}}", + RockstarAuth.state(fp)) + } + + @Test fun bridgeAnswersTheLauncherQueriesAndHandsBackTheCode() { + val js = RockstarAuth.bridgeScript(RockstarAuth.fingerprintOf("D", "1", "2"), "launcher") + for (m in listOf("GetWindowConfig", "GetDeviceId", "GetVersionInfo", "GetProfileList", "OnStartAuth", "CallAuthResult", "rgscQueryCancel", "/signin/user-form?cid=launcher")) + assertTrue(m, m in js) + assertTrue(RockstarAuth.isCodeUrl(RockstarAuth.CODE_URL + "?code=abc")) + assertEquals("a+b/c", RockstarAuth.codeFrom(RockstarAuth.CODE_URL + "?code=a%2Bb%2Fc")) + } + + @Test fun subAppsResolveToTheirGame() { + assertEquals("rdr2", RockstarTitles.byId("rdr2_sp_rgl")!!.id) + assertEquals("gtasaunreal", RockstarTitles.byId("gtatrilogy")!!.id) + assertNull(RockstarTitles.byId("launcher")) + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/stores/ubisoft/UbisoftTest.kt b/app/src/test/java/com/droiddeck/launcher/stores/ubisoft/UbisoftTest.kt new file mode 100644 index 0000000000..aecf4ca779 --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/stores/ubisoft/UbisoftTest.kt @@ -0,0 +1,101 @@ +package com.droiddeck.launcher.stores.ubisoft + +import com.droiddeck.launcher.stores.CatalogItem +import com.droiddeck.launcher.stores.Store +import com.droiddeck.launcher.stores.StoreGameSidecar +import com.droiddeck.launcher.stores.StoreLaunch +import org.json.JSONArray +import org.json.JSONObject +import org.junit.Assert.assertArrayEquals +import org.junit.Assert.assertEquals +import org.junit.Assert.assertNull +import org.junit.Assert.assertTrue +import org.junit.Test +import org.junit.runner.RunWith +import org.robolectric.RobolectricTestRunner +import org.robolectric.annotation.Config + +@RunWith(RobolectricTestRunner::class) +@Config(sdk = [33], application = android.app.Application::class) +class UbisoftTest { + private val steamConfig = "version: 2.0\r\nroot:\r\n name: Assassin's Creed Syndicate\r\n start_game:\r\n steam:\r\n steam_app_id: 368500\r\n" + + " third_party_platform:\r\n name: Steam\r\n override_uplayid: 1875\r\n" + + private fun listed(space: String, name: String) = CatalogItem(Store.UBISOFT, space, name, null, owned = true, extra = mapOf("spaceId" to space)) + + private val owned = JSONObject().put("games", JSONArray() + .put(JSONObject().put("productId", 1957).put("spaceId", "space-s").put("productType", 0).put("owned", true).put("configuration", steamConfig)) + .put(JSONObject().put("productId", 109).put("spaceId", "space-sc").put("productType", 0).put("owned", true).put("manifest", "AB").put("configuration", "root: {}")) + .put(JSONObject().put("productId", 1961).put("spaceId", "space-addon").put("productType", 1).put("owned", true).put("manifest", "CD").put("configuration", steamConfig)) + .put(JSONObject().put("productId", 720).put("spaceId", "space-plus").put("productType", 0).put("owned", false).put("manifest", "EF").put("configuration", "root: {}")) + .put(JSONObject().put("productId", 3539).put("spaceId", "space-o").put("productType", 0).put("owned", true).put("configuration", "root: {}"))) + + @Test fun onlyGamesConnectDeliversAreInTheLibrary() { + val profile = listOf(listed("space-sc", "Splinter Cell"), listed("space-s", "Syndicate"), listed("space-plus", "Ubisoft+ Game"), listed("space-gone", "Free Weekend"), listed("space-o", "Origins")) + val games = UbisoftLibrary.assemble(profile, owned) + assertEquals(listOf("space-o", "space-sc"), games.map { it.id }) + assertEquals(listOf("3539", "109"), games.map { it.extra["productId"] }) + assertEquals(null, games.first().extra["manifest"]) + assertEquals("Steam", UbisoftLibrary.thirdParty(steamConfig)) + } + + @Test fun withoutAnOwnershipAnswerTheProfileListStays() { + val profile = listOf(listed("space-sc", "Splinter Cell"), listed("space-gone", "Free Weekend")) + assertEquals(listOf("space-gone", "space-sc"), UbisoftLibrary.assemble(profile, JSONObject().put("error", "demux closed")).map { it.id }) + assertEquals(listOf("space-gone", "space-sc"), UbisoftLibrary.assemble(profile, null).map { it.id }) + } + + @Test fun theStoreSearchNamesEachGameWithItsPrice() { + fun hit(id: String, title: String, price: Double, base: Double, off: String, date: String, free: String = "") = JSONObject() + .put("objectID", id).put("title", title).put("price", JSONObject().put("USD", price)).put("default_price", JSONObject().put("USD", base)) + .put("promotion_percentage", off).put("release_date", date).put("Free_offer", free).put("link", "https://store.ubisoft.com/us/$id.html") + .put("image_link", "https://img/$id.jpg?sw=300").put("productLauncherIDString", id.takeLast(3)).put("Rating", "esrb-m") + val answer = JSONObject().put("hits", JSONArray() + .put(hit("p-109", "Far Cryยฎ 6", 15.0, 60.0, "75", "2021-10-07T00:00:00.000Z")) + .put(hit("p-110", "Far Cryยฎ 6 - Gold Edition", 30.0, 100.0, "70", "2021-10-07T00:00:00.000Z")) + .put(hit("p-111", "Some Demo", 0.0, 0.0, "", "2021-10-07T00:00:00.000Z", free = "demo")) + .put(hit("p-112", "Next Year", 70.0, 70.0, "", "2030-01-01T00:00:00.000Z"))) + val items = UbisoftStore.parse(answer, "USD", java.time.Instant.parse("2026-11-12T00:00:00Z")) + assertEquals(listOf("Far Cryยฎ 6"), items.map { it.title }) + val game = items.single() + assertEquals("$15.00", game.finalPrice) + assertEquals("$60.00", game.originalPrice) + assertEquals(75, game.discountPercent) + assertEquals("https://img/p-109.jpg", game.imageUrl) + assertTrue(game.mature) + val owned = CatalogItem(Store.UBISOFT, "space-fc6", "Far Cry 6", null, owned = true, extra = mapOf("productId" to "5266")) + val ezio = CatalogItem(Store.UBISOFT, "ubisoft-store:x", "Assassin's Creedยฎ The Ezio Collection", null) + assertTrue(UbisoftStore.sameGame(game, owned)) + assertTrue(!UbisoftStore.sameGame(ezio, CatalogItem(Store.UBISOFT, "space-ac", "Assassin's Creedโ„ข", null, owned = true))) + } + + @Test fun theBaseEditionStandsForItsGameWhicheverComesFirst() { + fun hit(id: String, title: String) = JSONObject().put("objectID", id).put("title", title).put("price", JSONObject().put("USD", 10.0)) + val answer = JSONObject().put("hits", JSONArray().put(hit("gold", "Far Cryยฎ 6 - Gold Edition")).put(hit("base", "Far Cryยฎ 6"))) + assertEquals(listOf("ubisoft-store:base"), UbisoftStore.parse(answer, "USD").map { it.id }) + } + + @Test fun theEntitlementNamesTheGamesApplication() { + val body = JSONObject().put("items", JSONArray() + .put(JSONObject().put("productId", 82).put("applicationId", "app-82")) + .put(JSONObject().put("productId", 109).put("applicationId", "app-109"))).toString() + assertEquals("app-109", UbisoftLaunch.applicationId(body, 109)) + assertNull(UbisoftLaunch.applicationId(body, 1651)) + } + + @Test fun theLauncherStartsTheServiceOnlyWithAFreshLaunchFile() { + val text = StoreLaunch.launcherText(StoreGameSidecar(Store.UBISOFT, "space-sc", "Splinter Cell", "system/SplinterCell.exe")) + val lines = text.trimEnd().split("\r\n") + assertTrue(lines.contains("if not exist \"%~dp0.droiddeck-ubisoft.json\" goto direct")) + assertTrue(lines.contains("\"Z:\\usr\\local\\lib\\droiddeck-ubisoft\\droiddeck-upc.exe\" \"%~dp0.droiddeck-ubisoft.json\"")) + assertEquals("\"%~dp0system\\SplinterCell.exe\"", lines.last()) + assertTrue(lines.indexOf(":direct") < lines.lastIndex) + } + + @Test fun activationPayloadsSurviveTheHexHop() { + val bytes = byteArrayOf(0, 1, 0x7f, -1, -128, 42) + assertEquals("00017fff802a", UbisoftActivation.hex(bytes)) + assertArrayEquals(bytes, UbisoftActivation.unhex("00017fff802a")) + assertNull(UbisoftActivation.unhex("abc")) + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/ui/AgentChangesTest.kt b/app/src/test/java/com/droiddeck/launcher/ui/AgentChangesTest.kt new file mode 100644 index 0000000000..2481c64c74 --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/ui/AgentChangesTest.kt @@ -0,0 +1,46 @@ +package com.droiddeck.launcher.ui + +import com.droiddeck.launcher.agent.AgentHost.Entry +import org.junit.Assert.assertEquals +import org.junit.Assert.assertNull +import org.junit.Test + +class AgentChangesTest { + @Test fun aTurnAddsUpTheEditsItMade() { + val entries = listOf( + Entry.Asked("before"), Entry.Used("e0", "Edit", "old.kt", "old.kt\n-a\n+b"), Entry.Finished(null), + Entry.Asked("fix it"), + Entry.Used("e1", "Edit", "a.kt", "src/a.kt\n x\n-y\n+z\n+w"), + Entry.Used("e2", "Write", "b.kt", "src/b.kt\n+one"), + Entry.Used("e3", "Edit", "a.kt", "src/a.kt\n-q", failed = true), + Entry.Used("e4", "Edit", "a.kt", "src/a.kt\n-r"), + Entry.Used("b1", "Bash", "ls", "ls"), + Entry.Finished(null), + ) + assertEquals(Changes(files = 2, added = 3, removed = 2), turnChanges(entries, entries.lastIndex)) + assertEquals(Changes(1, 1, 1), turnChanges(entries, 2)) + } + + @Test fun onlyEditsCarryingADiffCount() { + assertNull(diffOf(Entry.Used("c", "Edit", "a.kt, b.kt", "a.kt\nb.kt"))) + assertNull(diffOf(Entry.Used("b", "Bash", "ls", "ls\n+x"))) + assertEquals(2, diffOf(Entry.Used("e", "Edit", "a.kt", "a.kt\n\n- old\n\n+ new"))?.lines?.size) + assertNull(turnChanges(listOf(Entry.Asked("hi"), Entry.Said("hello"), Entry.Finished(null)), 2)) + } + + @Test fun aSavedPlanIsNotAChange() { + val entries = listOf(Entry.Asked("plan it"), Entry.Used("w", "Write", "plan.md", "/root/.claude/plans/plan.md\n+step"), Entry.Finished(null)) + assertNull(turnChanges(entries, 2)) + } + + @Test fun bigCountsReadAsMillions() { + assertEquals("1M", tokens(1_000_000)) + assertEquals("1.5M", tokens(1_500_000)) + assertEquals("23k", tokens(23_400)) + } + + @Test fun aTurnsReplyIsEverythingItSaid() { + val turn = listOf(Entry.Said("One."), Entry.Used("e1", "Bash", "ls"), Entry.Said("Two.")) + assertEquals("One.\n\nTwo.", turnReply(turn)) + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/ui/AgentMarkdownTest.kt b/app/src/test/java/com/droiddeck/launcher/ui/AgentMarkdownTest.kt new file mode 100644 index 0000000000..171fe16f9f --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/ui/AgentMarkdownTest.kt @@ -0,0 +1,176 @@ +package com.droiddeck.launcher.ui + +import android.content.Intent +import android.content.ClipboardManager +import android.text.Selection +import android.text.Spannable +import io.noties.markwon.ext.tables.TableRowSpan +import android.graphics.Color +import android.text.Spanned +import android.text.style.ClickableSpan +import android.widget.TextView +import org.junit.Assert.* +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.ConscryptMode +import org.robolectric.annotation.Config + +@RunWith(RobolectricTestRunner::class) +@Config(sdk = [28], manifest = Config.NONE) +@ConscryptMode(ConscryptMode.Mode.OFF) +class AgentMarkdownTest { + private val context get() = RuntimeEnvironment.getApplication() + private val renderer get() = agentMarkdownRenderer(context, Color.BLUE, Color.DKGRAY) + private fun Spanned.links() = getSpans(0, length, ClickableSpan::class.java).toList() + + @Test fun namedPullRequestLinksKeepTheirLabelsAndOpenAnExternalBrowser() { + val text = renderer.toMarkdown("Created [**PR #2540**](https://github.com/Droid-Deck/DroidDeck/pull/2540).") + assertEquals("Created PR #2540.", text.toString()) + val link = text.links().single() + assertEquals("PR #2540", text.subSequence(text.getSpanStart(link), text.getSpanEnd(link)).toString()) + link.onClick(TextView(context)) + val intent = shadowOf(context).nextStartedActivity + assertEquals(Intent.ACTION_VIEW, intent.action) + assertEquals("https://github.com/Droid-Deck/DroidDeck/pull/2540", intent.dataString) + val browser = requireNotNull(intent.selector) + assertEquals(Intent.ACTION_MAIN, browser.action) + assertTrue(browser.hasCategory(Intent.CATEGORY_APP_BROWSER)) + assertTrue(intent.flags and Intent.FLAG_ACTIVITY_NEW_TASK != 0) + } + + @Test fun bareUrlsAndAutolinksAreClickableWithoutTrailingPunctuation() { + val text = renderer.toMarkdown("Visit https://github.com/Droid-Deck/DroidDeck/pull/2540. Also .") + assertEquals(2, text.links().size) + val labels = text.links().map { text.subSequence(text.getSpanStart(it), text.getSpanEnd(it)).toString() } + assertTrue(labels.contains("https://github.com/Droid-Deck/DroidDeck/pull/2540")) + assertTrue(labels.contains("https://example.org/help")) + } + + @Test fun referenceLinksAndEscapedParenthesesAreParsed() { + val text = renderer.toMarkdown("[Docs][guide] and [details](https://example.org/a\\(b\\)).\n\n[guide]: https://example.org/docs") + assertEquals("Docs and details.", text.toString().trimEnd()) + assertEquals(2, text.links().size) + } + + @Test fun codeStaysLiteralAndDoesNotBecomeClickable() { + val text = renderer.toMarkdown("`[PR](https://example.org)`\n\n~~~kotlin\nval url = \"https://example.org\"\n~~~") + assertTrue(text.toString().contains("[PR](https://example.org)")) + assertTrue(text.toString().contains("val url = \"https://example.org\"")) + assertTrue(text.links().isEmpty()) + } + + @Test fun commonMarkdownBlocksAndNestedFormattingRenderWithoutMarkers() { + val text = renderer.toMarkdown("# Heading\n\n> A **bold and *italic*** quote\n\n1. First\n - Nested\n2. Second\n\n~~Removed~~\n\n- [x] Done\n- [ ] Pending") + val result = text.toString() + for (word in listOf("Heading", "A bold and italic quote", "First", "Nested", "Second", "Removed", "Done", "Pending")) { + assertTrue(result, result.contains(word)) + } + for (marker in listOf("# Heading", "**", "~~", "[x]", "[ ]")) assertFalse(result, result.contains(marker)) + } + + @Test fun tablesAreParsedWithLinksInsideCells() { + val root = renderer.parse("| Result | Link |\n| --- | --- |\n| Ready | [PR](https://github.com/owner/repo/pull/1) |") + assertEquals("TableBlock", root.firstChild.javaClass.simpleName) + var links = 0 + root.accept(object : org.commonmark.node.AbstractVisitor() { + override fun visit(link: org.commonmark.node.Link) { + links++ + assertEquals("https://github.com/owner/repo/pull/1", link.destination) + } + }) + assertEquals(1, links) + renderer.render(root) + } + + @Test fun colorChangesPreserveSelectionAndRefreshLinkSpans() { + val source = "Read [the PR](https://github.com/owner/repo/pull/1)" + val view = TextView(context).apply { setTextIsSelectable(true) } + val original = renderer + setAgentMarkdown(view, original, original.toMarkdown(source)) + Selection.setSelection(view.text as Spannable, 5, 11) + val updated = agentMarkdownRenderer(context, Color.RED, Color.LTGRAY) + val rendered = updated.toMarkdown(source) + setAgentMarkdown(view, updated, rendered) + assertEquals(5, view.selectionStart) + assertEquals(11, view.selectionEnd) + assertSame(rendered, view.tag) + val paint = android.text.TextPaint() + (view.text as Spanned).links().single().updateDrawState(paint) + assertEquals(Color.RED, paint.color) + } + + @Test fun reversedSelectionsAndCursorsSurviveColorChangesButNotContentChanges() { + val view = TextView(context).apply { setTextIsSelectable(true) } + val original = renderer + val updated = agentMarkdownRenderer(context, Color.RED, Color.LTGRAY) + setAgentMarkdown(view, original, original.toMarkdown("A long reply")) + for ((start, end) in listOf(8 to 2, 4 to 4)) { + Selection.setSelection(view.text as Spannable, start, end) + setAgentMarkdown(view, updated, updated.toMarkdown("A long reply")) + assertEquals(start, view.selectionStart) + assertEquals(end, view.selectionEnd) + } + setAgentMarkdown(view, updated, updated.toMarkdown("New")) + assertFalse(view.selectionStart == 4 && view.selectionEnd == 4) + } + + @Test fun tableCellsRemainInNativeCopyAndAccessibilityTextOnAndroid28() { + val source = "Before\n\n| Result | Link |\n| --- | --- |\n| **Ready** | [PR](https://github.com/owner/repo/pull/1) |\n| Pending | `code` |\n\nAfter" + val markwon = renderer + val rendered = markwon.toMarkdown(source) + val view = TextView(context).apply { setTextIsSelectable(true) } + setAgentMarkdown(view, markwon, rendered) + val expected = "Result | Link\nReady | PR\nPending | code" + assertTrue(rendered.toString(), rendered.toString().contains(expected)) + assertTrue(view.createAccessibilityNodeInfo().text.toString().contains(expected)) + Selection.setSelection(view.text as Spannable, 0, view.text.length) + assertTrue(view.onTextContextMenuItem(android.R.id.copy)) + val copied = context.getSystemService(ClipboardManager::class.java).primaryClip!!.getItemAt(0).text.toString() + assertEquals(rendered.toString(), copied) + val rows = rendered.getSpans(0, rendered.length, TableRowSpan::class.java) + assertEquals(3, rows.size) + assertTrue(rows.all { rendered.getSpanEnd(it) > rendered.getSpanStart(it) }) + } + + @Test fun tableLinksStillOpenTheBrowserAfterExposingCellText() { + val markwon = renderer + val rendered = markwon.toMarkdown("| Result | Link |\n| --- | --- |\n| Ready | [PR](https://github.com/owner/repo/pull/1) |") + val view = TextView(context).apply { setTextIsSelectable(true) } + setAgentMarkdown(view, markwon, rendered) + view.measure(android.view.View.MeasureSpec.makeMeasureSpec(900, android.view.View.MeasureSpec.EXACTLY), + android.view.View.MeasureSpec.makeMeasureSpec(2000, android.view.View.MeasureSpec.AT_MOST)) + view.layout(0, 0, 900, view.measuredHeight) + val canvas = android.graphics.Canvas(android.graphics.Bitmap.createBitmap(900, 2000, android.graphics.Bitmap.Config.ARGB_8888)) + view.draw(canvas) + val row = rendered.getSpans(0, rendered.length, TableRowSpan::class.java).maxBy { rendered.getSpanStart(it) } + val cell = requireNotNull(row.findLayoutForHorizontalOffset(row.cellWidth() + 1)) + (cell.text as Spanned).links().single().onClick(view) + assertEquals("https://github.com/owner/repo/pull/1", shadowOf(context).nextStartedActivity.dataString) + } + + @Test fun multipleTablesAndEmptyCellsKeepTheirOwnTextAndRowSpans() { + val rendered = renderer.toMarkdown("| One | Two |\n| --- | --- |\n| | X |\n\nBetween\n\n| Three | Four |\n| --- | --- |\n| Y | |") + val text = rendered.toString() + assertTrue(text, text.contains("One | Two\n | X")) + assertTrue(text, text.contains("Three | Four\nY | ")) + assertTrue(text, text.contains("Between")) + assertEquals(4, rendered.getSpans(0, rendered.length, TableRowSpan::class.java).size) + } + + @Test fun unfinishedStreamingMarkdownDoesNotLoseTextOrCrash() { + val source = "Read [the PR](https://github.com/owner/repo/pull/1)\n\n```kotlin\nval x = 1" + for (end in 1..source.length) renderer.toMarkdown(source.take(end)) + assertTrue(renderer.toMarkdown(source).toString().contains("val x = 1")) + } + + @Test fun browserIntentsOnlyAcceptAbsoluteWebLinks() { + for (link in listOf("javascript:alert(1)", "file:///etc/passwd", "intent://open", "content://private", "/local/file", "https:")) { + assertNull(link, agentBrowserIntent(link)) + } + assertNotNull(agentBrowserIntent("http://example.org")) + assertNotNull(agentBrowserIntent("https://github.com/owner/repo/pull/1?diff=split#discussion")) + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/ui/AppScaleTest.kt b/app/src/test/java/com/droiddeck/launcher/ui/AppScaleTest.kt index 56a6db50b5..e3e741b65a 100644 --- a/app/src/test/java/com/droiddeck/launcher/ui/AppScaleTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/ui/AppScaleTest.kt @@ -87,4 +87,12 @@ class AppScaleTest { assertEquals(540, base.screenHeightDp) assertEquals(320, base.densityDpi) } + + @Test fun homePageDefaultsToSteamAndIgnoresAnUnknownStoredPage() { + assertEquals(AppUiPrefs.HOME_PAGE_STEAM, AppUiPrefs.homePage(context)) + AppUiPrefs.setHomePage(context, AppUiPrefs.HOME_PAGE_APPS) + assertEquals(AppUiPrefs.HOME_PAGE_APPS, AppUiPrefs.homePage(context)) + context.getSharedPreferences("app-ui", Context.MODE_PRIVATE).edit().putString("home-page", "gone").commit() + assertEquals(AppUiPrefs.HOME_PAGE_STEAM, AppUiPrefs.homePage(context)) + } } diff --git a/app/src/test/java/com/droiddeck/launcher/ui/AppsGridTest.kt b/app/src/test/java/com/droiddeck/launcher/ui/AppsGridTest.kt new file mode 100644 index 0000000000..6f09411ac1 --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/ui/AppsGridTest.kt @@ -0,0 +1,21 @@ +package com.droiddeck.launcher.ui + +import android.content.Context +import androidx.test.core.app.ApplicationProvider +import org.junit.Assert.assertEquals +import org.junit.Test +import org.junit.runner.RunWith +import org.robolectric.RobolectricTestRunner +import org.robolectric.annotation.Config + +@RunWith(RobolectricTestRunner::class) +@Config(sdk = [33]) +class AppsGridTest { + @Test fun anUnknownStoredGridValueFallsBackToTheDefault() { + val context: Context = ApplicationProvider.getApplicationContext() + context.getSharedPreferences("home_launcher", Context.MODE_PRIVATE).edit().putInt("grid_icon", 999).putInt("grid_spacing", 7).commit() + AppsGrid.load(context) + assertEquals(AppsGrid.MEDIUM, AppsGrid.iconDp) + assertEquals(AppsGrid.NORMAL, AppsGrid.spacing) + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/ui/DragTargetTest.kt b/app/src/test/java/com/droiddeck/launcher/ui/DragTargetTest.kt new file mode 100644 index 0000000000..3a35e77f23 --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/ui/DragTargetTest.kt @@ -0,0 +1,20 @@ +package com.droiddeck.launcher.ui + +import org.junit.Assert.assertEquals +import org.junit.Test + +class DragTargetTest { + @Test fun smallMovesStayInPlace() = assertEquals(5, dragTarget(20f, 100f, 5, 0, 9)) + + @Test fun halfRowMovesToNextSlot() { + assertEquals(6, dragTarget(60f, 100f, 5, 0, 9)) + assertEquals(4, dragTarget(-60f, 100f, 5, 0, 9)) + } + + @Test fun longMovesSkipSeveralRows() = assertEquals(8, dragTarget(310f, 100f, 5, 0, 9)) + + @Test fun staysInsideTheDisc() { + assertEquals(9, dragTarget(900f, 100f, 5, 0, 9)) + assertEquals(2, dragTarget(-900f, 100f, 5, 2, 9)) + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/ui/EdgeFlingTest.kt b/app/src/test/java/com/droiddeck/launcher/ui/EdgeFlingTest.kt new file mode 100644 index 0000000000..5a0e298541 --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/ui/EdgeFlingTest.kt @@ -0,0 +1,27 @@ +package com.droiddeck.launcher.ui + +import org.junit.Assert.assertEquals +import org.junit.Assert.assertFalse +import org.junit.Assert.assertTrue +import org.junit.Test + +class EdgeFlingTest { + private val density = 2f + + @Test fun aQuickFlickGoesTheWayItWasThrownFromAnywhere() { + assertFalse(EdgeFling.toRight(centerX = 1800f, span = 1920f, vx = -1500f, density = density)) + assertTrue(EdgeFling.toRight(centerX = 100f, span = 1920f, vx = 1500f, density = density)) + } + + @Test fun aSlowReleaseGoesWhereItWouldCoast() { + assertTrue(EdgeFling.toRight(centerX = 1000f, span = 1920f, vx = 0f, density = density)) + assertFalse(EdgeFling.toRight(centerX = 900f, span = 1920f, vx = 0f, density = density)) + assertFalse(EdgeFling.toRight(centerX = 1100f, span = 1920f, vx = -1100f, density = density)) + } + + @Test fun theHeightCarriesOnWithTheThrowAndStaysOnScreen() { + assertEquals(436f, EdgeFling.restY(400f, 200f, 0f, 1000f), 0.01f) + assertEquals(1000f, EdgeFling.restY(900f, 5000f, 0f, 1000f), 0.01f) + assertEquals(24f, EdgeFling.restY(100f, -5000f, 24f, 1000f), 0.01f) + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/ui/LibraryFavoritesTest.kt b/app/src/test/java/com/droiddeck/launcher/ui/LibraryFavoritesTest.kt new file mode 100644 index 0000000000..699ca03720 --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/ui/LibraryFavoritesTest.kt @@ -0,0 +1,53 @@ +package com.droiddeck.launcher.ui + +import com.droiddeck.launcher.frontend.Library +import com.droiddeck.launcher.stores.CatalogItem +import com.droiddeck.launcher.stores.Store +import org.junit.Assert.assertEquals +import org.junit.Assert.assertFalse +import org.junit.Assert.assertTrue +import org.junit.Test + +class LibraryFavoritesTest { + private fun steam(id: Int, name: String) = LibraryEntry("app:$id", Library.SOURCE_STEAM, name, Library.SteamGame(id, name, null, "Steam library"), null, true) + + private fun owned(id: String, name: String): LibraryEntry { + val item = CatalogItem(Store.GOG, id, name, imageUrl = null, owned = true) + return LibraryEntry("app:gog:$id", Store.GOG.id, name, null, item, false) + } + + @Test fun togglingAddsThenRemovesAKey() { + val on = toggled(emptySet(), "app:440") + assertEquals(setOf("app:440"), on) + assertEquals(emptySet(), toggled(on, "app:440")) + } + + @Test fun aStoreGameIsKeyedByItsStoreProductSoInstallingItKeepsTheHeart() { + val entry = owned("123", "Witcher") + assertEquals("gog:123", entry.favoriteKey) + val installed = LibraryEntry("app:-5", "gog", "Game", Library.SteamGame(-5, "Game", null, Library.ADDED, source = "gog", storeId = "123"), null, true) + assertEquals(entry.favoriteKey, installed.favoriteKey) + } + + @Test fun aGameWithoutAStoreIsKeyedByItsLibraryKey() { + assertEquals("app:440", steam(440, "Team Fortress 2").favoriteKey) + } + + @Test fun theFavoritesSourceKeepsOnlyHeartedGamesFromEveryStore() { + val tf2 = steam(440, "Team Fortress 2") + val witcher = owned("123", "Witcher") + val other = steam(10, "Counter-Strike") + val hearts = setOf(tf2.favoriteKey, witcher.favoriteKey) + val shown = listOf(tf2, witcher, other).filter { inLibrarySource(LIBRARY_FAVORITES, it, hearts) } + assertEquals(listOf(tf2, witcher), shown) + assertTrue(inLibrarySource(LIBRARY_ALL, other, hearts)) + assertFalse(inLibrarySource(Store.GOG.id, tf2, hearts)) + } + + @Test fun theFavoritesTabComesFirstAndOnlyAppearsOnceSomethingIsHearted() { + val entries = listOf(steam(440, "Team Fortress 2"), owned("123", "Witcher")) + assertEquals(listOf("steam", "gog"), librarySources(entries, listOf("gog"))) + assertEquals(listOf(LIBRARY_FAVORITES, "steam", "gog"), librarySources(entries, listOf("gog"), favorites = setOf("gog:123"))) + assertEquals(listOf("steam", "gog"), librarySources(entries, listOf("gog"), favorites = setOf("gog:999"))) + } +} diff --git a/app/src/test/java/com/droiddeck/launcher/ui/NavTabsTest.kt b/app/src/test/java/com/droiddeck/launcher/ui/NavTabsTest.kt new file mode 100644 index 0000000000..c7ff2b12b4 --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/ui/NavTabsTest.kt @@ -0,0 +1,221 @@ +package com.droiddeck.launcher.ui + +import android.content.Context +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.height +import androidx.compose.runtime.CompositionLocalProvider +import androidx.compose.ui.Modifier +import androidx.compose.ui.test.assertIsDisplayed +import androidx.compose.ui.test.hasTestTag +import androidx.compose.ui.test.hasText +import androidx.compose.ui.test.onNodeWithTag +import androidx.compose.ui.test.performClick +import androidx.compose.ui.test.performKeyPress +import androidx.compose.ui.test.requestFocus +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.verticalScroll +import androidx.compose.ui.unit.dp +import androidx.test.core.app.ApplicationProvider +import org.junit.After +import org.junit.Assert.assertEquals +import org.junit.Assert.assertFalse +import org.junit.Assert.assertTrue +import org.junit.Before +import org.junit.Rule +import org.junit.Test +import org.junit.runner.RunWith +import org.robolectric.RobolectricTestRunner +import org.robolectric.annotation.Config + +@RunWith(RobolectricTestRunner::class) +@Config(sdk = [34], qualifiers = "w1200dp-h752dp-land", application = android.app.Application::class) +class NavTabsTest { + @get:Rule val compose = createRobolectricComposeRule() + private val ctx: Context = ApplicationProvider.getApplicationContext() + + @Before @After fun reset() { + ctx.getSharedPreferences("session", Context.MODE_PRIVATE).edit().clear().commit() + NavTabs.load(ctx) + com.droiddeck.launcher.agent.AgentTab.load(ctx) + } + + @Test fun musicStartsInMore() { + assertEquals(listOf("steam", "games", "stores", "desktop", "components", "setup", "updates", NavTabs.MORE), navigationKeys(state())) + assertEquals(listOf("soundtracks"), NavTabs.more(state())) + assertEquals(setOf("soundtracks", "agent"), NavTabs.shelved) + assertTrue(com.droiddeck.launcher.agent.AgentTab.shown) + } + + @Test fun showingMusicOnceKeepsItShownAfterReload() { + place("soundtracks", TabPlace.BAR) + NavTabs.load(ctx) + assertEquals(listOf("steam", "games", "soundtracks", "stores", "desktop", "components", "setup", "updates"), navigationKeys(state())) + } + + @Test fun shelvedTabsLeaveTheBarAndAddMoreAtTheEnd() { + place("stores", TabPlace.MORE) + place("components", TabPlace.MORE) + val s = state() + assertEquals(listOf("components", "soundtracks", "stores"), NavTabs.more(s)) + assertEquals(NavTabs.MORE, navigationKeys(s).last()) + assertFalse("stores" in navigationKeys(s)) + } + + @Test fun hiddenTabsAreNowhereAndSetupCannotBeHidden() { + place("updates", TabPlace.HIDDEN) + place("setup", TabPlace.HIDDEN) + val s = state() + assertFalse("updates" in navigationKeys(s)) + assertFalse("updates" in NavTabs.more(s)) + assertTrue("setup" in navigationKeys(s)) + } + + @Test fun disabledStoresFeatureReadsAsHidden() { + assertEquals(TabPlace.HIDDEN, NavTabs.place(state(storesOn = false), "stores")) + } + + @Test fun movingSwapsWithTheNextVisibleTabAndPersists() { + place("soundtracks", TabPlace.BAR) + moveTab("stores", -1) + assertEquals(listOf("steam", "games", "stores", "soundtracks"), navigationKeys(state()).take(4)) + NavTabs.load(ctx) + assertEquals(listOf("steam", "games", "stores", "soundtracks"), navigationKeys(state()).take(4)) + } + + @Test fun tabsMissingFromASavedOrderSlotInAfterTheirDefaultNeighbour() { + assertEquals(listOf("updates", "steam", "games", "soundtracks", "stores", "desktop", "agent", "components", "android-apps", "setup"), + NavTabs.arrange(listOf("updates", "steam"))) + assertEquals(listOf("games", "soundtracks", "steam", "setup", "stores", "desktop", "agent", "components", "android-apps", "updates"), + NavTabs.arrange(listOf("games", "steam", "setup", "stores", "desktop", "components", "android-apps", "updates", "bogus"))) + } + + @Test fun moreCarriesTheDownloadCountAndBadgesOfShelvedTabs() { + place("stores", TabPlace.MORE) + place("setup", TabPlace.MORE) + val s = state(downloads = 3, setupReady = false) + assertEquals(3, railCount(s, NavTabs.MORE)) + assertTrue(railBadge(s, NavTabs.MORE)) + place("stores", TabPlace.BAR) + assertEquals(0, railCount(s, NavTabs.MORE)) + assertEquals(3, railCount(s, "stores")) + } + + @Test fun sideRailShowsTheDownloadCountOnMoreWhenStoresIsShelved() { + place("stores", TabPlace.MORE) + val s = state(downloads = 2) + compose.setContent { + DroidDeckTheme { + CompositionLocalProvider(LocalFrontFocus provides FrontFocus()) { + Box(Modifier.height(752.dp)) { SideRail(s, "steam", {}, {}, actions(), Modifier) } + } + } + } + compose.onNodeWithTag("rail-stores").assertDoesNotExist() + compose.onNode(hasTestTag("rail-more")).assertIsDisplayed() + compose.onNode(hasText("2") and hasParentTag("rail-more"), useUnmergedTree = true).assertIsDisplayed() + } + + @Test fun morePageListsShelvedTabsWithTheirCount() { + place("stores", TabPlace.MORE) + place("components", TabPlace.MORE) + val s = state(downloads = 4) + compose.setContent { + DroidDeckTheme { + CompositionLocalProvider(LocalFrontFocus provides FrontFocus()) { + FocusGlideHost { Box(Modifier.fillMaxSize()) { MorePage(s, actions(), {}, Modifier.fillMaxSize()) } } + } + } + } + compose.onNodeWithTag("more-stores").assertIsDisplayed() + compose.onNodeWithTag("more-components").assertIsDisplayed() + compose.onNode(hasText("4") and hasParentTag("more-stores"), useUnmergedTree = true).assertIsDisplayed() + } + + @Test fun backFromAShelvedTabReturnsToMore() { + place("desktop", TabPlace.MORE) + var back: androidx.activity.OnBackPressedDispatcher? = null + compose.mainClock.autoAdvance = false + compose.setContent { + back = androidx.activity.compose.LocalOnBackPressedDispatcherOwner.current?.onBackPressedDispatcher + DroidDeckTheme { FrontEndScreen(state(), actions(), page = null) } + } + compose.mainClock.advanceTimeBy(2_000) + compose.onNodeWithTag("rail-more").performClick() + compose.mainClock.advanceTimeBy(2_000) + compose.onNodeWithTag("more-desktop").performClick() + compose.mainClock.advanceTimeBy(2_000) + compose.onNodeWithTag("more-desktop").assertDoesNotExist() + compose.runOnIdle { back!!.onBackPressed() } + compose.mainClock.advanceTimeBy(2_000) + compose.onNodeWithTag("more-desktop").assertIsDisplayed() + } + + @Test fun startupWithSteamHiddenNeverLandsOnABareComponentsSelection() { + place("steam", TabPlace.HIDDEN) + repeat(NavTabs.ALL.size) { moveTab("components", -1) } + assertEquals("components", navigationKeys(state()).first()) + compose.mainClock.autoAdvance = false + compose.setContent { DroidDeckTheme { FrontEndScreen(state(), actions(), page = null) } } + compose.mainClock.advanceTimeBy(2_000) + compose.onNode(hasText(ctx.getString(com.droiddeck.launcher.R.string.content_page_gone))).assertDoesNotExist() + compose.onNode(hasTestTag("rail-games") and androidx.compose.ui.test.isSelected()).assertExists() + } + + @Test fun setupListMovesATabAcrossTheMoreLineWithTheControllerAndHidesWithItsSwitch() { + compose.setContent { + DroidDeckTheme { + CompositionLocalProvider(LocalFrontFocus provides FrontFocus()) { + androidx.compose.foundation.layout.Column(Modifier.height(752.dp).verticalScroll(rememberScrollState())) { + TabsSettingsGroup(MenuHost(), state(), actions()) + } + } + } + } + val last = navigationKeys(state()).last { it != NavTabs.MORE } + compose.onNodeWithTag("tab-row-$last").requestFocus() + compose.onNodeWithTag("tab-row-$last").performKeyPress(pad(android.view.KeyEvent.KEYCODE_BUTTON_Y)) + compose.onNodeWithTag("tab-row-$last").performKeyPress(pad(android.view.KeyEvent.KEYCODE_DPAD_DOWN)) + compose.onNodeWithTag("tab-row-$last").performKeyPress(pad(android.view.KeyEvent.KEYCODE_BUTTON_Y)) + compose.runOnIdle { assertEquals(last, NavTabs.more(state()).first()) } + compose.onNodeWithTag("tab-shown-desktop").performClick() + compose.runOnIdle { assertFalse("desktop" in navigationKeys(state())) } + compose.onNodeWithTag("tab-shown-setup").performClick() + compose.runOnIdle { assertTrue("setup" in navigationKeys(state())) } + } + + private fun pad(code: Int) = androidx.compose.ui.input.key.KeyEvent(android.view.KeyEvent(android.view.KeyEvent.ACTION_DOWN, code)) + + private fun place(key: String, where: TabPlace, s: FrontEndState = state()) { + NavTabs.setHidden(ctx, key, where == TabPlace.HIDDEN) + if (where == TabPlace.HIDDEN) return + val keys = NavTabs.listed(s) + val more = keys.filter { if (it == key) where == TabPlace.MORE else it in NavTabs.shelved } + NavTabs.rearrange(ctx, s, keys - more.toSet(), more) + } + + private fun moveTab(key: String, step: Int, s: FrontEndState = state()) { + val keys = NavTabs.listed(s) + val rows = moveTabRow(tabRows(keys.filter { it !in NavTabs.shelved }, keys.filter { it in NavTabs.shelved }), key, step) ?: return + val split = rows.indexOf(rows.first { it !in keys }) + NavTabs.rearrange(ctx, s, rows.subList(0, split), rows.subList(split + 1, rows.size)) + } + + private fun hasParentTag(tag: String) = androidx.compose.ui.test.hasAnyAncestor(hasTestTag(tag)) + + private fun state(storesOn: Boolean = true, downloads: Int = 0, setupReady: Boolean = true) = FrontEndState( + installed = "r9", ready = setupReady, available = null, busy = false, stage = "", percent = -1, + desktopInstalled = true, offlineAccount = null, offline = false, frameGenLabel = "", romsDir = null, logsEnabled = false, + steamGames = emptyList(), emulators = emptyList(), running = null, + gameStoresEnabled = storesOn, storeDownloadsActive = downloads, + ) + + private fun actions() = FrontEndActions( + onPlay = {}, onPlayDesktopUi = {}, onSteamGame = {}, onDesktop = {}, onEmulator = {}, onRom = {}, onResume = {}, + onSteamSettings = {}, onDesktopSettings = {}, onInstallPackage = {}, onRemovePackage = {}, + onRuntime = {}, onFrameGenPick = {}, onImportLossless = {}, onProtons = {}, onComponents = {}, + onPerformance = {}, onRoms = {}, onFiles = {}, onLogs = {}, onOffline = {}, + onWirelessAdbPair = { _, _, _, _ -> }, onWirelessAdbApply = { _, _, _, _ -> }, + onSetPhantomProcessLimit = { _, _ -> }, onRemoveDesktop = {}, + ) +} diff --git a/app/src/test/java/com/droiddeck/launcher/ui/PortraitLayoutTest.kt b/app/src/test/java/com/droiddeck/launcher/ui/PortraitLayoutTest.kt index e1210893f0..25ba697759 100644 --- a/app/src/test/java/com/droiddeck/launcher/ui/PortraitLayoutTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/ui/PortraitLayoutTest.kt @@ -93,6 +93,21 @@ class PortraitLayoutTest { compose.onNodeWithContentDescription("Resume Steam").assertIsDisplayed() } + @Test fun bottomBarFollowsSidebarLabelsSetting() { + val context = org.robolectric.RuntimeEnvironment.getApplication() + RailLabels.set(context, false) + compose.setContent { + DroidDeckTheme { BottomBar(state, "steam", {}, {}, actions, Modifier.size(480.dp, 64.dp)) } + } + compose.mainClock.advanceTimeBy(1_000) + compose.onNodeWithText("Library").assertDoesNotExist() + compose.onNodeWithContentDescription("Library").assertIsDisplayed() + compose.runOnIdle { RailLabels.set(context, true) } + androidx.compose.runtime.snapshots.Snapshot.sendApplyNotifications() + compose.mainClock.advanceTimeBy(1_000) + compose.onNodeWithText("Library").assertIsDisplayed() + } + @Test fun compactHeaderKeepsAllActionsReachable() { compose.setContent { DroidDeckTheme { diff --git a/app/src/test/java/com/droiddeck/launcher/ui/SessionDrawerPageTest.kt b/app/src/test/java/com/droiddeck/launcher/ui/SessionDrawerPageTest.kt index 35561a41d5..15888d289f 100644 --- a/app/src/test/java/com/droiddeck/launcher/ui/SessionDrawerPageTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/ui/SessionDrawerPageTest.kt @@ -26,4 +26,11 @@ class SessionDrawerPageTest { assertEquals(SessionDrawerPage.SESSION, pages.step(SessionDrawerPage.GAMES, 1)) } } + + @Test fun theAgentPageComesBeforeSessionOnlyWhenTheAgentIsInstalled() { + val with = sessionDrawerPages(false, hasAgent = true) + assertEquals(SessionDrawerPage.AGENT, with.step(SessionDrawerPage.GAMES, 1)) + assertEquals(SessionDrawerPage.SESSION, with.step(SessionDrawerPage.AGENT, 1)) + assertFalse(SessionDrawerPage.AGENT in sessionDrawerPages(false, hasAgent = false)) + } } diff --git a/app/src/test/java/com/droiddeck/launcher/ui/StorageComponentsBulkConfirmTest.kt b/app/src/test/java/com/droiddeck/launcher/ui/StorageComponentsBulkConfirmTest.kt index 3b47a84904..dec06e5ac4 100644 --- a/app/src/test/java/com/droiddeck/launcher/ui/StorageComponentsBulkConfirmTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/ui/StorageComponentsBulkConfirmTest.kt @@ -37,7 +37,7 @@ class StorageComponentsBulkConfirmTest { components = components, flatpakApps = emptyList(), flatpakRuntimes = 0L, - otherPrefixes = 0L, + kept = emptyList(), leftoversChecked = true, ) diff --git a/app/src/test/java/com/droiddeck/launcher/update/AppUpdatesTest.kt b/app/src/test/java/com/droiddeck/launcher/update/AppUpdatesTest.kt index 1dad18e921..21fa491d30 100644 --- a/app/src/test/java/com/droiddeck/launcher/update/AppUpdatesTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/update/AppUpdatesTest.kt @@ -357,4 +357,80 @@ class AppUpdatesTest { assertEquals(AppUpdates.Channel.TEST, g.follow.channel) assertTrue(g.certain) } + + private fun preview(commit: String, committedAt: Long, versionCode: Int = 9) = AppUpdates.Release( + "main-${commit.take(7)}", commit, "", commit, 0, null, versionCode, committedAt, "", apk(versionCode), + committedAt = committedAt, + ) + + private val history = listOf( + preview("1".repeat(40), 300L), + preview("2".repeat(40), 200L), + preview("3".repeat(40), 100L, versionCode = 8), + ) + private val withHistory = AppUpdates.Catalog(stable, history.first(), emptyList(), 0L, previews = history) + + @Test + fun previewOffersOnlyNewerBuildsAsUpdates() { + val nightly = Follow(Channel.NIGHTLY) + assertEquals(Offer.CURRENT, AppUpdates.offer(withHistory, nightly, me("1".repeat(40)))) + assertEquals(Offer.UPDATE, AppUpdates.offer(withHistory, nightly, me("2222222"))) + val newer = Installed("4".repeat(40), 0, "0.2.0", 9, updatable = true, committedAt = 400L) + assertEquals(Offer.AHEAD, AppUpdates.offer(withHistory, nightly, newer)) + val older = Installed("5".repeat(40), 0, "0.2.0", 9, updatable = true, committedAt = 50L) + assertEquals(Offer.UPDATE, AppUpdates.offer(withHistory, nightly, older)) + } + + @Test + fun previewHistoryListsEveryBuildAndWhereTheInstalledOneSits() { + val behind = AppUpdates.previewHistory(withHistory, me("2".repeat(40), ciBuild = false))!! + assertEquals(PreviewHistoryKind.BEHIND, behind.kind) + assertEquals(1, behind.installedIndex) + assertEquals(3, behind.builds.size) + assertEquals(PreviewHistoryKind.RECENT, AppUpdates.previewHistory(withHistory, me("9".repeat(40)))!!.kind) + } + + @Test + fun anOlderVersionCodePreviewCannotBeInstalledButASameCodeRollbackCan() { + val mine = me("1".repeat(40)) + assertFalse(AppUpdates.installable(history[0], mine)) + assertTrue(AppUpdates.installable(history[1], mine)) + assertFalse(AppUpdates.installable(history[2], mine)) + } + + @Test + fun aTestBuildBehindItsPrHeadIsFlaggedAndCountsLaterPreviews() { + val test = AppUpdates.Release("pr-7", "t", "", "abcdef1", 7, null, 9, 150L, "", apk(), headCommit = "1234567890") + assertTrue(test.newerCommitPushed) + val current = AppUpdates.Release("pr-7", "t", "", "abcdef1", 7, null, 9, 150L, "", apk(), headCommit = "abcdef1234") + assertFalse(current.newerCommitPushed) + val rebuiltHigher = AppUpdates.Release("pr-7", "t", "", "abcdef1", 7, null, 10, 150L, "", apk(10)) + assertFalse(AppUpdates.isRunning(rebuiltHigher, me("abcdef1234", pr = 7))) + assertTrue(AppUpdates.isRunning(current, me("abcdef1234", pr = 7))) + assertEquals(2, AppUpdates.previewsSince(withHistory, test)) + val rebuilt = AppUpdates.Release("pr-7", "t", "", "abcdef1", 7, null, 9, 150L, "", apk(), builtAt = 250L) + assertEquals(1, AppUpdates.previewsSince(withHistory, rebuilt)) + } + + @Test + fun publishedCatalogReadsEveryPreviewWithItsAuthorAndKeepsThemInTheCache() { + val entry = JSONObject(publishedCatalog().getJSONObject("preview").toString()) + .put("author", "maxjivi05").put("committedAt", 5L).put("mergedPr", 2602) + val bad = JSONObject(entry.toString()).put("commit", "feedbee1234567").put("author", "not a login") + val raw = publishedCatalog().put("previews", JSONArray().put(entry).put(bad)) + val parsed = AppUpdates.readPublishedCatalog(raw, "com.droiddeck.launcher", 1L) + assertEquals(2, parsed.previews.size) + assertEquals("maxjivi05", parsed.previews[0].author) + assertEquals(2602, parsed.previews[0].linkedPr) + assertEquals("", parsed.previews[1].author) + val cached = AppUpdates.readCachedCatalog(AppUpdates.writeCatalog(parsed)) + assertEquals(2, cached.previews.size) + assertEquals(5L, cached.previews[0].committedAt) + } + + @Test + fun aCatalogWithoutTheFullListStillOffersItsNewestPreview() { + val parsed = AppUpdates.readPublishedCatalog(publishedCatalog(), "com.droiddeck.launcher", 1L) + assertEquals(listOf("main-deadbee"), parsed.previewBuilds.map { it.tag }) + } } diff --git a/docs/agent-control.md b/docs/agent-control.md index 7a1fed1d0e..4ac8706706 100644 --- a/docs/agent-control.md +++ b/docs/agent-control.md @@ -28,7 +28,7 @@ Player controls and observations work over authorized ADB on any build: `state`, `resume`, `wait`, `launch`, `quit`, `focus`, `input`, `ui`, `logs`, `screenshot`, `record`, `pacing`, `thermal`, `displays`, `wake`, `glasses` (except `glasses raw`), and `access`. -**Setup > Diagnostics > Debugging tools** is off by default in every build, including debug builds. +**Setup > Developer > Debugging tools** is off by default in every build, including debug builds. It enables `run`, `guest`, `cdp`, all `env` operations, `override`, `prefs`, and `glasses raw`. The toggle switches directly without a confirmation dialog. The bridge refuses to change it through `ui` or preference writes. The existing preference key, `setting-agent-commands` test tag, JSON command diff --git a/docs/development/ea-store.md b/docs/development/ea-store.md new file mode 100644 index 0000000000..89a345c80f --- /dev/null +++ b/docs/development/ea-store.md @@ -0,0 +1,31 @@ +# EA store + +EA games install, update and start without the EA app. The research behind it is in +[ea-ubisoft-stores.md](ea-ubisoft-stores.md). + +## Pieces + +| Piece | Where | What it does | +|---|---|---| +| Sign-in | `stores/ea/EaAuth.kt`, `EaLogin` in `EaBackend.kt` | `JUNO_PC_CLIENT` OAuth with PKCE in the store login WebView; the code comes back on EA's `qrc:///html/login_successful.html` redirect. Tokens refresh with the refresh token. | +| Library | `EaApi.kt`, `EaLibrary.kt` | Owned games (`getPreloadedOwnedGames`, EA storefront), their offers (`getLegacyCatalogDefs`) and art (`GameImages`, SteamGridDB when EA has no portrait). Editions of one game collapse onto the base offer; trials, DLC and non-downloadable offers are left out. | +| Queries | `app/src/main/resources/ea/graphql/*.gql` | EA's own query texts, byte for byte. The gateway matches persisted queries by SHA-256, so these files must not be reformatted (`-text` in `.gitattributes`). | +| Downloads | Rust `src/ea/` in `libdroiddeckstores.so`, `EaInstaller.kt` | A build is one ZIP on EA's CDN. The engine reads its central directory with ranged reads, keeps files whose size and CRC match, and streams every other entry through inflate into place. `.droiddeck-ea-files` records what it placed, so a resume or update does not re-hash those files; files a new build drops are removed. | +| Updates | `EaUpdates` in `EaBackend.kt` | The game page compares the installed version with the offer's live `gameVersion` (every 30 minutes at most). Update runs the same install, which only fetches changed files. | +| Launch, guest | `droiddeck-store-launch` (`prepare_ea`) | Creates the prefix, reads the machine as Wine reports it (`wmic`, `vol`, `hostname`; cached in `pfx/.droiddeck-ea-hw.json`), writes EA app presence keys and the game's `Install Dir` keys in both registry views, runs the build's Touchup once per installed build, then asks the app for the session and writes any licence files. | +| Launch, app | `EaLaunch.kt`, `EaOoa.kt`, `EaLsx.kt` | Answers `ea-prepare`: starts the LSX endpoint on `127.0.0.1:3216`, mints the short-lived opaque token, writes `.droiddeck-ea-env` (read once and deleted by the launcher `.bat`), and for games with a `Core` folder requests an online-activation licence for the machine hash. | +| LSX | `EaLsx.kt` | The local endpoint EA's SDK talks to instead of the EA app: challenge, AES session key, config, profile, settings, game info, auth codes for the game's own client ids, licences with Denuvo tokens, entitlements. Friends, presence and the overlay answer empty. | + +## Machine hash + +The licence names a hash of the machine the game's activation layer computes itself. The hash +version follows the activation library's product version (`Core/activation.dll` or `awc.dll`): +5.x โ†’ 4, 4.7.6+ โ†’ 3, 4.7.x โ†’ 2, 4.x โ†’ 1. Versions 2 and 3 also need CPUID leaf 1 ECX, which Wine's +WMI does not expose, so those use `00000000` unless the probe learns it. + +## Not done yet + +- Cloud saves (`cloudsync.juno.ea.com`). +- Steam copies of EA games still install the EA app (#2036). +- Pre-DiP games (no `installerdata.xml`) fall back to the exe picker. +- Javelin anti-cheat games do not run under Proton. diff --git a/docs/development/ea-ubisoft-stores.md b/docs/development/ea-ubisoft-stores.md new file mode 100644 index 0000000000..4d13710a3d --- /dev/null +++ b/docs/development/ea-ubisoft-stores.md @@ -0,0 +1,245 @@ +# EA app and Ubisoft Connect as stores: research and plan + +Research as of 2026-11-07, against `origin/main` at `914b3588e`. Nothing here is implemented yet. + +## Summary + +Both stores can follow the path Battle.net took (#979, then #1602): first the vendor client in its own +Proton prefix, then more of it done by DroidDeck itself. Unlike Battle.net, both now have open-source +clients that already handle sign-in, library and downloads without the vendor app. So the second step +can go further than Battle.net's did. + +| | EA | Ubisoft | +|---|---|---| +| Sign-in without the client | Yes: OAuth `JUNO_PC_CLIENT` in a WebView | Yes: UbiServices session (ticket + remember-me) through Ubisoft's WebAuth page | +| Owned library without the client | Yes: juno GraphQL `ownedGameProducts` | Yes: Demux ownership service (protobuf over TLS), or the GraphQL library | +| Downloads without the client | Yes: a build is one ZIP on EA's CDN, read with HTTP Range per entry (Maxima) | Yes: Demux download service โ†’ manifest โ†’ zstd/deflate slices (Optima, ubi-cli-mvp) | +| Launch without the client | **Yes, legitimately**: LSX server on `127.0.0.1:3216` plus a real OOA licence from `proxy.novafusion.ea.com` (Maxima) | **Only by replacing Ubisoft's DRM DLLs** (Optima, Re0xCat loaders). Don't ship that. Modern titles need the real Connect anyway | +| Cloud saves without the client | Yes: `cloudsync.juno.ea.com` (Maxima) | Not researched; Connect handles them | +| Effectively out of scope | Javelin kernel anti-cheat titles (Battlefield, FC, Apex) | Kernel AC and online-only titles that misbehave under Proton | + +**Recommendation** + +- **EA should go fully native in-app**: sign-in, library, downloads, launch and cloud saves in Kotlin + and Rust, with no EA app in the prefix. The EA app stays as an optional fallback, like the Epic + launcher option (`EpicClient`). The LSX and licence half also fixes Steam's EA titles, which today + install the whole EA app (#2036) just to answer `link2ea://`. +- **Ubisoft should be hybrid**: native sign-in, library and downloads in Rust, then **register the + files with the real Ubisoft Connect and launch through `uplay://`**. That means a Connect prefix + managed the way Battle.net's is. +- Ubisoft's launch step is the biggest open question (see "Unknowns"). If Connect can't be made to + adopt natively downloaded files cleanly, start with the Connect-driven download, as #979 did for + Battle.net. + +## What DroidDeck already has, and how much of it each store reuses + +| Existing piece | Where | EA | Ubisoft | +|---|---|---|---| +| `Store` enum + `StoreBackend` (signIn, syncLibrary, loadShelves, install, uninstall) | `stores/Store.kt`, `stores/StoresState.kt:355` | Reuse as is: new `EA` entry | Reuse as is: new `UBISOFT` entry | +| WebView sign-in with redirect capture (`StoreLoginActivity.Flow`) | `stores/LoginFlows.kt`, `StoreLoginActivity.kt` | Reuse: the redirect is `qrc:///html/login_successful.html?code=โ€ฆ`, caught in `isRedirect` | Reuse: capture the `ubi_v1` ticket from the WebAuth page, then exchange it for a full session | +| Keystore-backed account store | `stores/StoreAccounts.kt`, `CredentialCipher.kt` | Reuse | Reuse | +| Rust store engine `libdroiddeckstores.so` (JNI, `fetch_core.rs`, hand-rolled protobuf in `amazon/proto.rs`) | `app/src/main/rust/stores` | Reuse: ZIP central directory + Range fetch + inflate (`flate2` is already a dependency) | Reuse `fetch_core`. **New:** a TLS socket client for Demux, a protobuf schema, and a zstd decoder (`ruzstd` is pure Rust; the `zstd` crate needs `cc`, which the crate already has) | +| Download queue: pause, resume, cancel, tiers, Downloads tab | `stores/download/*` | Reuse | Reuse | +| Install roots: internal, other storage, Games folder | `StoreInstallRoot.kt` | Reuse | Reuse | +| Cloud saves: plan, paths, transport | `stores/CloudSaves.kt`, `CloudPlan.kt`, `CloudSavePaths.kt` | Reuse with a new EA transport | Later, or leave to Connect | +| Vendor client in its own prefix, a guest Python driver, a headless helper under gamescope, FEX choice, memory policy | `runtime/BattleNet.kt`, `tools/linuxfs/overlay/usr/local/bin/droiddeck-battlenet` | Fallback only | **Needed**: `droiddeck-ubisoft` modelled on `droiddeck-battlenet` | +| "Use the vendor launcher instead" option | `stores/epic/EpicClient*.kt` | Pattern for the EA app fallback | Pattern for "Open Ubisoft Connect" | +| Steam install-script seeding that lets EA app and Ubisoft Connect installers run | `droiddeck-seed-redists` (#1449, #2036) | Replaced by the LSX stub for Steam EA titles | Unchanged | +| Ubisoft registry handoff for Ubisoft titles bought on Epic | open PR #1445 | n/a | Same registry key (`HKLM\SOFTWARE\WOW6432Node\Ubisoft\Launcher\Installs\\InstallDir`); merge or share it | +| Library, Steam shortcuts, art, game page, sidecars | `frontend/Library.kt`, `SteamLiveShortcuts.kt`, `StoreArt.kt`, `StoreGameSidecar.kt` | Reuse | Reuse | +| Clean-room process for store modules | `docs/development/epic-cleanroom.md`, `amazon-cleanroom.md` | Use: spec from Maxima, then implement from the spec | Use: spec from Optima/ubi-cli-mvp/YoobieRE | + +Genuinely new engineering: + +1. **An LSX server (EA).** EA's local SDK protocol is XML over TCP on 3216, with a challenge handshake, + GetConfig, GetProfile, GetGameInfo, license and entitlement requests. Add a Wine-side stub registered + as the `link2ea://` / `origin2://` handler with EA app presence keys, plus OOA licence requests. + This half is new; the other EA parts are the familiar store pattern. +2. **The EA machine hash.** Licences are bound to a `machineHash` built from WMI/BIOS/disk/CPUID + values. They have to match what the game computes inside Wine under FEX on the phone. + Nobody has shown that on Android yet, so it has to be measured on device. +3. **A Demux client (Ubisoft).** This is a TLS socket to `dmx.upc.ubisoft.com` speaking protobuf, with + patch negotiation, auth, ownership tokens and download-service URL signing. No store we have uses + a socket protocol. +4. **A way for Connect to adopt files (Ubisoft).** Connect keeps its own DPAPI-encrypted sign-in, tied + to the Wine `MachineGuid`. Our session can't be handed to it (ubi-cli-mvp checked). Connect also has + to consider the game installed before `uplay://launch` works. + +## Prior art + +### EA + +| Project | Licence | State | What it gives us | +|---|---|---|---| +| [ArmchairDevelopers/Maxima](https://github.com/ArmchairDevelopers/Maxima) (Rust, `maxima-lib`) | GPL-3.0 | Pre-alpha by its own README; last commit 2026-01; open issues through 2026-11. Backs KYBER | The whole stack: OAuth (`JUNO_PC_CLIENT`, localhost 31033 redirect), juno GraphQL (`.gql` files for owned games, `downloadUrl`, `availableBuilds`, achievements), the ZIP/Range downloader, OOA licences (`ooa/mod.rs`, `machineHash`), the LSX server (`lsx/`), cloud sync, the hardware hash (`auth/hardware.rs`), Wine registry setup. Unsupported: Battlefield 3/4 (Battlelog), pre-DiP games (Dead Space 2, BFBC2), DLC installs | +| [Maxima #71](https://github.com/ArmchairDevelopers/Maxima/issues/71) | | 2026-11 | Games never connect to LSX unless `HKLM\SOFTWARE\WOW6432Node\Origin` is right, and `INSTALLED_LANGUAGE` must be answered. Check ours against it | +| [Maxima #49](https://github.com/ArmchairDevelopers/Maxima/issues/49) | | | ARM64: the hash must match what `Activation.dll` reads from CPUID under Rosetta/Box64/FEX. Directly our problem | +| unifideck `docs/feasibility/ea.md` | GPL-3.0 | 2026-07 | EA app installer runs unattended (`/quiet`), login renders on GE-Proton11-1, `origin2://game/launch?offerIds=&autoDownload=1` is the install idiom, ~2.5 GB client, aggressive self-update | +| Lutris `services/ea_app.py` | GPL-3.0 | Maintained | juno queries, `installerdata.xml` scan for installed games | +| BellezaEmporium/galaxy-integration-ead | **none** | Maintained | Facts only: OAuth params, `pc_sign` fallback | +| erri120/GameFinder wiki | GPL-3.0 | | Encrypted `IS` file format (only for reading EA app installs) | +| Heroic | | wontfix #352 | No EA support beyond Epic-hosted EA titles | + +### Ubisoft + +| Project | Licence | State | What it gives us | +|---|---|---|---| +| [xXJSONDeruloXx/ubi-cli-mvp](https://github.com/xXJSONDeruloXx/ubi-cli-mvp) (yours, TypeScript) | MIT | 2026-07 | The best-tested data plane: session login with `Ubi-Challenge` replay, `ubi_2fa_v1`, refresh; Demux ownership, ownership tokens and signed URLs; manifest decode; slice layouts (`slices_v3//` and flat `slices/`); zstd and both deflates; integrity and path safety. On the Connect side: `connect-install` (`uplay://install/`), **`connect-seed`** (let Connect start the official download, pause, exit, then fill the staging area with verified files), remembered-auth migration between prefixes, `ubi play` via `uplay://`. Docs: `research.md`, `validation.md`, `DEMUX_JOURNAL.md`, `optima-comparison.md` | +| [Starkka15/Optima](https://github.com/Starkka15/Optima) (Rust) | GPL-3.0 | 0.2.0, 2026-08 | Rust version of the same data plane (`auth.rs`, `demux.rs`, `install.rs`, `proto/*.proto`), plus launcherless launch through replacement `uplay_r1_loader` / `ubiorbitapi_r2_loader` DLLs, a self-signed certificate that mimics Ubisoft's (imported into the prefix's Root store so Watch_Dogs accepts it), and an EAX shim. Powers GameVault's Ubisoft extension | +| YoobieRE: `ubisoft-demux-node`, `ubisoft-dmx-decode`, `ubisoft-manifest-downloader`, `uplay-install-reverse`, `product-db-archive` | mixed or none | 2022โ€“2024 | The original protocol reversing that both of the above build on | +| Re0xCat `uplay-r1-loader`, `ubiorbitapi-r2-loader` | | | The DRM-DLL replacements (see Risks) | +| [mubaraknumann/unifideck](https://github.com/mubaraknumann/unifideck) `stores/ubisoft/` | GPL-3.0 | Shipping, active | The full Connect-wrapper archetype in Python: three-prefix model (auth / template / per-game, shared `MachineGuid`), credential capture and fan-out, parsing Connect's binary `configurations` and `ownership` catalogs, leveldb `spaceId โ†” ubisoftConnectGameId`, a manual-install watcher, `uplay://launch//0`, session capture after exit. `docs/ubisoft-store-spec.md` is a good map of what breaks | +| Heroic | | | Installs Ubisoft Connect automatically for Ubisoft titles from Epic; no Ubisoft store | +| DroidDeck #1445 (open), #1449, #2286 / #2295 / #2317 / #2292 / #2050 | | | Our own Ubisoft-under-Proton knowledge: the `Installs` registry key, `UplayLaunch.exe` being a stub, the bundled `UplayInstaller.exe`, legacy installer layouts, SD-card staging, helper processes during the exit watch | + +Licences: Maxima, Optima, unifideck and Lutris are GPL-3.0, which is compatible with +DroidDeck (GPL-3.0). ubi-cli-mvp is MIT. Even so, the Epic and Amazon modules were written clean-room, +so do the same here: write the spec from these sources, implement from the spec, and credit them in +the README the way #1602 does. + +## Design + +### EA + +```text +StoreLoginActivity (OAuth JUNO_PC_CLIENT) โ”€โ–บ EaAccount (access + refresh token, persona) +EaLibrary โ”€โ”€ juno GraphQL ownedGameProducts / legacyOffers โ”€โ–บ CatalogItem(offerId, contentId, slug) +EaInstaller (DownloadQueue job) โ”€โ”€ downloadUrl โ”€โ–บ build ZIP โ”€โ–บ Rust: central directory, Range per entry, inflate, CRC + โ””โ”€ writes __Installer/installerdata.xml as EA's own layout expects +Launch: droiddeck-ea (guest) โ”€โ”€ registers stub for link2ea:// origin2:// + Origin/EA Desktop keys + app-side EaLsxServer on 3216 โ—„โ”€โ”€ game (OriginSDK / EA SDK) + before launch: OOA licence (novafusion, machineHash) โ†’ ProgramData/Electronic Arts/EA Services/License + before/after: cloudsync pull / push through CloudSaves +``` + +- **Where the LSX server runs.** In the Android app. DroidDeck's guest shares + the network namespace, so an app-side server on 127.0.0.1:3216 is reachable from Wine. Keeping it + in Kotlin or Rust, not a guest daemon, matches how DroidDeck owns other store logic. Check this + against proot networking first. +- **The stub.** A protocol handler for `link2ea://` / `origin2://` that hands the request to DroidDeck. +- **Steam's EA titles.** Use the same stub and LSX path, keyed by `link2ea://` in the launch config, + plus entitlement refresh and Steam account linking. #2036's EA app install becomes + the fallback. +- **The EA app fallback.** Its own prefix (a `compatdata` id like Battle.net's `2596113170`), installed + with `EAappInstaller.exe /quiet`, opened from the store row. That's for titles the LSX path can't + start (pre-DiP, Battlelog) and for buying games. + +### Ubisoft + +```text +StoreLoginActivity (Ubisoft WebAuth) โ”€โ–บ ticket โ”€โ–บ full session (expiry, rememberMe); refresh ~3 h +UbisoftLibrary โ”€โ”€ Demux ownership โ”€โ–บ products + config YAML (name, exe, uplay id, space id) +UbisoftInstaller (DownloadQueue job) โ”€โ”€ Rust Demux: ownership token โ†’ download_service urlReq + โ†’ manifest (356-byte header, zlib) โ†’ slices (zstd/deflate) โ†’ files, verified +Register + launch: droiddeck-ubisoft (guest, like droiddeck-battlenet) + Connect in its own prefix, signed in once in its own window (DPAPI/MachineGuid bound) + adopt files: Installs\\InstallDir registry (+ whatever state Connect checks) + or ubi-cli-mvp's connect-seed: official download starts, pause, seed, let Connect verify + launch: upc.exe uplay://launch//0, Connect closed or minimised once the game runs (#979's 20 s rule) +``` + +- **One Connect prefix, not one per game.** unifideck uses per-game prefixes because Steam on the + Deck gives each shortcut its own. DroidDeck already runs Battle.net games inside Battle.net's prefix, + which avoids unifideck's whole credential fan-out problem. +- **Two stages, like Battle.net:** + 1. Connect in its prefix, install by `uplay://install/`, and Downloads shows an indeterminate + "Installing in Ubisoft Connect" until the folder settles. That is #979's level. + 2. Native downloads in the Rust engine with real progress, pause and resume, then Connect adopts the + files. Like #1602, but we own the transfer instead of driving the vendor's downloader. If Connect + has a scriptable local API (Battle.net's Agent had one), that's a cheaper middle stage, but none is + known. +- **Launcherless DRM shims: don't ship them.** See Risks. + +## Known + +- EA sign-in, library, downloads, licences, LSX and cloud sync all work outside the EA app on Linux + (Maxima). +- The EA app installs unattended and its login renders under GE-Proton 11 on x86 (unifideck). +- Ubisoft sign-in, refresh, Demux ownership, signed URLs, manifests and slice reconstruction work + (ubi-cli-mvp `validation.md`, Optima). A session ticket lasts about 3 hours and remember-me renews it. +- Connect's sign-in can't be created from our session. It is DPAPI-encrypted and tied to + `MachineGuid`, but it can be copied between prefixes that share that identity. +- Connect has repeatedly broken under Proton after its own updates (2023, and a single-source April 2026 + report). #1449 and the open Ubisoft PRs show the same churn here. +- Javelin titles don't run under Proton. EA's March 2026 job listing mentions future Linux/Proton work; + nothing has shipped. + +## Unknowns, in the order to settle them + +| # | Question | How to find out | Blocks | +|---|---|---|---| +| U1 | Does an EA OOA licence fetched with our `machineHash` validate inside DroidDeck-Proton under FEX on Adreno phones? Which WMI/CPUID values does the game see? | Prototype: Maxima's hash code against values read through Wine in our prefix; one DiP single-player title and one Denuvo title. | EA launch | +| U2 | Can the app-side LSX server on 127.0.0.1:3216 be reached from proot + Wine, and do games connect with our registry keys (Maxima #71)? | Spike with a Steam EA title already in the library | EA launch, Steam EA titles | +| U3 | What does EA's CDN serve for a current title: one ZIP, multiple, or delta? How do language selection and `installerdata.xml` work? | Maxima `content/` + `downloadUrl.gql`, one real download through the Rust engine | EA install | +| U4 | Does Connect accept a tree we downloaded once the `Installs` registry key is written, or does it re-verify or re-download? Does `connect-seed` work under FEX on a phone? | Spike with a small owned title (ubi-cli-mvp used Splinter Cell / product 109). #1445's registry work is the start | Ubisoft stage 2 | +| U5 | Does Ubisoft Connect (Qt + CEF) run acceptably under FEX in our prefix? How much RAM does it hold while a game runs? | Install it like Battle.net; measure with the Memory readout from #979 | Ubisoft stage 1 | +| U6 | Ubisoft's WebAuth page in an Android WebView: captcha, 2FA, `Ubi-Challenge` | Real sign-in on device | Ubisoft sign-in | +| U7 | Demux over TLS from Android (certificate pinning, patch-version negotiation drift) | Rust spike against `dmx.upc.ubisoft.com` | Ubisoft library and downloads | +| U8 | Ubisoft+ subscription entitlements in Demux ownership | Account with Ubisoft+ | Library completeness | +| U9 | EA Play subscription entitlements in `ownedGameProducts` | Account with EA Play | Library completeness | +| U10 | Ubisoft cloud saves outside Connect | Not researched; Connect handles them while it's in the path | Later | + +## Plan + +Each step is its own PR, tested on device as usual (REDMAGIC tablet, Fold7, Thor). + +### EA + +1. **Spike (no PR):** settle U1โ€“U3 with throwaway code against one owned DiP title and one Steam EA title. +2. **Steam EA titles without the EA app:** the `link2ea` stub, app-side LSX server, OOA licence and + entitlement refresh. It replaces #2036's EA app install where it works and falls back to it otherwise. + This ships value first and proves the hard half. +3. **EA store: sign-in, library, shelves:** a `Store.EA` entry, OAuth flow, juno library, art, + a "not installable here" flag for Javelin titles. +4. **EA downloads:** a Rust `ea` module (ZIP/Range/inflate on `fetch_core`), with Downloads progress, + pause, resume, cancel, updates and uninstall. +5. **EA cloud saves** through `CloudSaves`. +6. **EA app fallback** prefix and store-row button, for pre-DiP and Battlelog titles. +7. Clean-room record: `docs/development/ea-cleanroom.md`. + +### Ubisoft + +1. **Spike (no PR):** U4, U5 and U7. +2. **Ubisoft Connect in its prefix (#979 level):** `droiddeck-ubisoft`, the store row, sign-in inside + Connect, the installed-games scan (registry `Installs` keys), Play by `uplay://launch`, Connect closed + once the game runs, install handed to Connect with indeterminate progress. Fold in #1445. +3. **Ubisoft store sign-in and library natively:** the WebAuth flow, session refresh, a Rust Demux + client, the owned library and art, without opening Connect. +4. **Native Ubisoft downloads:** a Rust `ubisoft` module (manifest, slices, zstd), then hand off to + Connect for registration (U4). Updates come from the manifest version. +5. Clean-room record: `docs/development/ubisoft-cleanroom.md`. + +The two stores share almost nothing beyond the existing store layer, so they can run in parallel. +EA step 2 has the best ratio of value to risk and could start first. + +## Risks + +- **DRM circumvention.** Optima's launcherless mode replaces Ubisoft's DRM loader DLLs, answers the + game's ownership calls itself, and installs a certificate mimicking Ubisoft's so Authenticode checks + pass. Gating it on real ownership doesn't change that it bypasses Ubisoft's access control. Keep it + out of DroidDeck. EA is different: Maxima requests real licences from EA's licence + service and speak EA's documented-by-reversing launcher protocol. Nothing is forged. +- **Terms of service.** Both publishers' terms broadly forbid unofficial clients. No bans are known + for Linux or alt-launcher users (Maxima, Lutris, unifideck, GameVault). This is the same position as + our Epic, GOG and Amazon modules. +- **Vendor churn:** juno schema changes (EA already killed the Origin-era integrations once), Demux + patch versions, and Connect or EA app updates that break under Proton. Plan for tests on recorded + responses, as Epic has. +- **Memory.** A resident Connect costs a phone RAM, so reuse #979's close-on-launch policy and zRAM work + (#1882). EA's native path avoids the client entirely. +- **FEX hardware fingerprint (EA, U1)**, if FEX's CPUID differs from what licences are bound to. +- **Kernel anti-cheat:** Javelin, and whatever Ubisoft titles use one. Flag them in the catalog + instead of letting launches fail. + +## Sources + +- DroidDeck: #979, #1602, #1610, #1611, #1662, #2087 (Battle.net); #1449, #2036 (Steam Ubisoft/EA + installers); #1445, #2050, #2286, #2292, #2295, #2317 (Ubisoft); `docs/development/epic-cleanroom.md`. +- Maxima: README, `maxima-lib/src/{core/launch.rs, core/endpoints.rs, ooa/mod.rs, core/auth/*, content/*, lsx/*}`, issues #49, #71. +- Optima: README, `TODO-hardening.md`, `src/install.rs`, `src/launch.rs`. +- ubi-cli-mvp: README, `docs/optima-comparison.md`, `research.md`, `validation.md`. +- unifideck: `docs/feasibility/{README,ea,battlenet}.md`, `docs/ubisoft-store-spec.md`. +- [Heroic: Ubisoft Connect on Linux and Mac](https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher/wiki/How-to-install-Ubisoft-Connect-on-Linux-and-Mac). +- [GamingOnLinux: EA Javelin job listing mentions Linux and Proton (2026-03)](https://gamingonlinux.com/2026/03/ea-javelin-anticheat-job-listing-mentions-future-support-for-linux-and-proton). +- [GamingOnLinux: KYBER goes open source (2026-01)](https://www.gamingonlinux.com/2026/01/star-wars-battlefront-ii-private-server-and-mod-launcher-kyber-goes-open-source). +- [PC Gamer: Ubisoft's launcher broke Steam games on Linux and Steam Deck](https://www.pcgamer.com/ubisofts-launcher-broke-steam-games-on-linux-and-steam-deck). diff --git a/docs/development/game-environment.md b/docs/development/game-environment.md index 79206aa03a..5fb2f1be40 100644 --- a/docs/development/game-environment.md +++ b/docs/development/game-environment.md @@ -104,7 +104,7 @@ Run the batch/reference and work-budget regressions with ## Game debug logs -Under **Setup > Diagnostics**, enable **Session logs** and **Game debug logs** +Under **Setup > Developer**, enable **Session logs** and **Game debug logs** before reproducing a Windows game problem. Game debug logs is off by default and is available when Session logs is enabled. It applies to the next game launch through DroidDeck's Valve or third-party Proton wrapper, including added games and store shortcuts. @@ -142,7 +142,7 @@ that diagnostics were skipped instead of writing uncollected files elsewhere. ## Enhanced diagnostics -Use **Setup > Diagnostics > Enhanced diagnostics for next session** when normal +Use **Setup > Developer > Enhanced diagnostics for next session** when normal session logs are not enough. The setting is one-shot: DroidDeck creates and retains the next session's log directory, records the diagnostic profile, then turns the setting off. It also enables the existing game diagnostic environment @@ -254,6 +254,14 @@ The former feature-level rules for Caravan SandWitch, RoboCop: Rogue City, ReSkate and Cyberpunk 2077 compensated for the global `12_2` override and are removed. Stellar Blade also uses automatic detection. The separate Deep Rock Galactic GDK ray-tracing opt-out and Mali bridge capability cap remain. + +"Skip GL error checks" (under "Client interface") sets `MESA_NO_ERROR=1` for the client +interface and Chromium apps only. Games keep Mesa's GL error checks: with +`MESA_NO_ERROR`, an invalid call such as `glBufferData` with no buffer bound reads +a NULL buffer object instead of returning `GL_INVALID_OPERATION`, and the game's +render thread stops. A game profile entry, or `MESA_NO_ERROR` in the session's own +environment, still applies to games. + Other picker suggestions are editable starting values and are enabled only when added and saved. Older or custom components can support a different set of options. Android Wine wrapper, diff --git a/docs/development/low-memory.md b/docs/development/low-memory.md index 4b8e9b459e..81055ff0b1 100644 --- a/docs/development/low-memory.md +++ b/docs/development/low-memory.md @@ -9,8 +9,10 @@ Every five seconds the monitor reads `MemAvailable`, swap headroom and memory PS headroom means less than one fifth of total RAM (bounded to 512โ€“1536 MiB), or at least 1% `some avg10` memory stall with less than one third of RAM available. Pressure requests target only the launcher processes already recognized by the monitor, never the game. They require -at least 128 MiB launcher RSS and enough free swap to cover its entire RSS while leaving -one fifth of swap (at least 256 MiB) free. The regular automatic client request uses the +at least 128 MiB launcher RSS and enough free swap to cover its anonymous RSS while leaving +one fifth of swap (at least 256 MiB) free. File-backed resident pages do not consume this +budget: the page-out helper targets private anonymous mappings. If `RssAnon` is absent from a +process's status, its full RSS is used instead. The regular automatic client request uses the same swap guard. An explicit session RAM cap retains its existing behavior. Pressure requests are at least 30 seconds apart. Reclaiming less than 16 MiB doubles the @@ -41,27 +43,32 @@ reduced aggregate launcher RSS only from 263 to 255 MiB and backed off. Thus lau does not resolve this load failure, and this run did not exhaust swap. The unevictable/shmem growth needs allocation attribution before treating it as a driver or GPU-memory diagnosis. -## Low-RAM devices: compressing idle game memory +## Pressure reclaim: compressing idle game memory -On devices with at most 13 GiB `MemTotal` (every 12 GB phone and handheld and below), the -monitor also compresses the game session itself when memory runs out. The trigger is absolute -headroom, not a percentage: Android's `lmkd` killed a session on a 7.5 GiB device with +The monitor also compresses the game session itself when observed pressure approaches the +system kill boundary. There is no RAM-size gate. The trigger is absolute real headroom, not a +percentage: Android's `lmkd` killed a session on a 7.5 GiB device with 490 MiB still available, so a 95% used threshold (about 400 MiB left on 8 GB) is already past the kill. A world load added 1 GiB of GPU memory in about ten seconds, and compressing 1.4 GiB took 2.6 seconds, so the request has to leave room for both. -The session request runs when available memory falls below a quarter of RAM (bounded to -768โ€“2560 MiB, 1.85 GiB on an 8 GB device), or below one and a half times that with at least 1% -`some avg10` memory stall. One request pages out every session process that loaded -`libblsession.so`: the game, Wine and its services, plus the launcher processes unless their -compression is turned off, under a single wait. It runs before the launcher-only check, which -can wait up to 12 seconds for acknowledgements. While a game runs and available memory is under -twice that level, memory is read every second instead of every five. Requests are at least 30 seconds apart and need the same swap reserve as launcher -requests. When the session has read back more than half of what the previous request compressed, -that memory is in use: the request is skipped and the wait doubles, up to five minutes. A -request whose memory stayed compressed resets it to 30 seconds. Below half the headroom the -wait is ignored and only the 30-second spacing applies. The state resets when the game exits. Devices above 13 GiB keep the -launcher-only behaviour. +The session request runs when real headroom falls below a quarter of RAM (bounded to +768โ€“2560 MiB), or below one and a half times that with at least 1% `some` or `full avg10` +memory stall. Real headroom subtracts positive growth in KGSL allocation, `Unevictable`, and +`Shmem` from `MemAvailable`; a rapid fall also qualifies near twice the headroom. The monitor +may first request page-out of idle Steam and hidden launchers, subject to the Performance +setting and client reclaim limits. When both qualify, both requests are sent before waiting +for either to complete, so a slow launcher acknowledgement does not delay the game request. Until the client +request finishes, its anonymous RSS remains reserved from the session's swap budget. Completion +and backoff are measured against the processes that received each request, even if a later scan +finds different processes. The session request targets processes that loaded +`libblsession.so`: the game, Wine and its services, and excludes Steam and hidden launchers. +Requests are at least 30 seconds apart and need the same +swap reserve as launcher requests. When the session has read back more than half of what the +previous request compressed, that memory is in use: the request is skipped and the wait doubles, +up to five minutes. A request whose memory stayed compressed resets it to 30 seconds. Below half +the headroom the wait is ignored and only the 30-second spacing applies. The state resets when +the game exits. Measured on a Retroid Pocket Duo (7.5 GiB, kernel 6.6, 6 GiB lzo-rle zram plus a 4 GiB swap file) entering the world in World of Warcraft: Forever, one run each: @@ -91,7 +98,8 @@ A second run on that build showed the trigger arriving too late: character selec there. During the load, available memory crossed the headroom 9 seconds after Enter World, but the launcher check ran first and waited 12 seconds for acknowledgements; the game request started at 21 seconds, moved about 200 MiB, and `lmkd` ended the session at 30 seconds. The quarter-of-RAM -level and the game-first single request address both. +level starts reclaim earlier. Sending both requests before waiting removes the launcher +acknowledgement delay; it does not guarantee that reclaim can keep up with every loading peak. Without root an app cannot write its memory cgroup's `memory.reclaim` (owned by `system`), `process_madvise` on another process returns `EPERM`, `PAGEMAP_SCAN` is absent before Linux 6.7, diff --git a/docs/development/proot-performance.md b/docs/development/proot-performance.md index bcf3424c1e..634b7bc63a 100644 --- a/docs/development/proot-performance.md +++ b/docs/development/proot-performance.md @@ -204,7 +204,7 @@ call can be answered in-process with the 0014 design. | syscalls | why proot traps them | can it bypass proot? | |---|---|---| | `openat`/`open`/`creat`, `newfstatat`/`stat`/`lstat`, `statx`, `faccessat`/`access`, `readlinkat` (exit), `mkdirat`, `unlinkat`, `renameat(2)`, `symlinkat`, `linkat`, `fchmodat`, `fchownat`, `utimensat`, `truncate`, `*xattr`, `inotify_add_watch`, `name_to_handle_at` | path translation (guest โ†’ host), plus exit fixups for `readlink` and `rename` | **Yes, through libc wrappers.** The prototype covers open, stat, statx, access, readlink, opendir and fopen; the write family is next. Raw `svc` and glibc's internal callers (ld.so, fts, realpath, nss) still go to proot. | -| `chdir`/`fchdir`, `getcwd` (exit) | proot emulates the cwd; until 0014 the kernel's cwd never moved | With 0014 the kernel's cwd follows the guest's. `getcwd` stays in proot (cheap, rare). | +| `chdir`/`fchdir`, `getcwd` (exit) | proot emulates the cwd; until 0014 the kernel's cwd never moved | With 0014 the kernel's cwd follows the guest's. With 0028 `fchdir` takes the path of the open directory from `/proc//fd` instead of walking it again. `getcwd` stays in proot (cheap, rare). | | `execve`/`execveat` | runs the loader, maps `PT_INTERP` inside the rootfs, shebangs, tracks `/proc/self/exe` | **No.** This is the core of what proot is for. Costs 0.4โ€“0.8 ms per exec; the session scripts already avoid exec-heavy loops (`nap`). | | `brk` (entry and exit) | heap emulation: programs are mapped by proot's loader, so the kernel's brk area is the loader's | No (`PR_SET_MM` needs `CAP_SYS_RESOURCE`). **Fewer calls:** `GLIBC_TUNABLES=glibc.malloc.top_pad=โ€ฆ` grows the heap in larger steps. | | `bind`, `connect`, `accept(4)`, `getsockname`, `getpeername` | `sun_path` of Unix sockets | Same-path binds (runtime dir, files dir) need no translation, but the filter can't see the address. Possible fast-path candidate. | @@ -325,7 +325,7 @@ or repeatedly hit a path the wrappers cannot resolve. ### Opt-in tracer profiling -With **Setup > Diagnostics > Debugging tools** enabled, queue profiling for one session: +With **Setup > Developer > Debugging tools** enabled, queue profiling for one session: ```sh tools/droiddeckctl proot-profile enable --slow-us 1000 diff --git a/docs/development/soundtracks.md b/docs/development/soundtracks.md new file mode 100644 index 0000000000..a1b11a3997 --- /dev/null +++ b/docs/development/soundtracks.md @@ -0,0 +1,78 @@ +# Soundtracks + +Steam soundtracks get their own tab under Library, a built-in music player, and an Android media session. + +## Where soundtracks live + +Steam installs a soundtrack to `/steamapps/music/`, next to a normal `appmanifest_.acf`. This holds for the internal Steam library and for a second library folder. + +`Library.steamGames()` skips any manifest whose install directory exists only under `steamapps/music`. `Library.soundtracks()` returns exactly those entries, marked with `SteamGame.soundtrack`. While the Music tab is enabled, games and soundtracks therefore never mix in the Library tab, the launch drawer, game file sync or component preparation. + +Folders added by hand (Soundtracks tab, plus button) are stored in `added-soundtracks.json` and carry a negative app id, so they cannot collide with a Steam app id. + +## Turning it off + +Setup > Launcher > Soundtracks. When off, the tab disappears and installed Steam soundtracks show in Library again, as they did before. + +## Tracks, discs and duplicates + +`Soundtrack.load()` walks the folder (four levels deep) for mp3, flac, ogg, opus, wav, m4a and aac. Tags come from `MediaMetadataRetriever` and are cached per folder in `files/soundtrack-index`, keyed by path, size and modification time. + +`Soundtrack.group()` is pure and unit tested: + +1. The same track in several formats collapses to one. Identity is disc and track number when both tags exist, otherwise the cleaned title. Lossless wins over lossy. +2. Disc comes from the disc tag, otherwise from the subfolder (natural order), labelled with the folder name when it is numeric (for example `3+4`). A folder with no subfolders is one disc and shows no disc headers. Tags missing on the kept copy are filled from its duplicates, since FLAC files often use tag names Android does not read. +3. Tracks sort by the number at the start of the file name, then by track tag, then by name. This matches Valve's soundtrack documentation, which says the Steam music player takes play order from file names and not from metadata. Numbers shown on screen are positions inside the disc. +4. Titles come from the tag, otherwise from the file name with the artist, album and track number removed. + +## Cover art + +Steam's own library cache image first, then `AlbumArtwork`, `cover`, `folder` and similar files in the soundtrack folder. When none exists, the picture embedded in the first track that has one is used, so the grid shows it without opening the album. The player page shows the embedded picture of the track that is playing and falls back to the album cover for tracks without one. The media notification and the system media panel follow the same rule: while a track plays, its embedded picture replaces the item artwork in place, which does not restart playback, unless a cover was chosen in the art changer. The SteamGridDB artwork changer applies to Steam soundtracks like any other Steam entry. + +## Player page + +The layout follows Steam's soundtrack page and uses the DroidDeck theme colors and shapes, so every theme works. Cover, title, artist and total length sit on the left with seek, shuffle, previous, play or pause, next, repeat and volume. The track list with disc headers sits on the right. Portrait stacks the two. The action buttons (game files, shortcut, edit art, uninstall) use the same wide pill style as Steam's See More button. + +Controller: d-pad moves between buttons and rows, A confirms, B goes back, the sliders respond to left and right. + +Shortcuts use `droiddeck://soundtrack/` and open the soundtrack page. + +## Playback and Android media controls + +`SoundtrackService` is a media3 `MediaSessionService` with an `ExoPlayer`. It runs as a foreground service of type `mediaPlayback`, so playback keeps going when DroidDeck is closed and the notification and lock screen controls show the cover, title and artist. `SoundtrackController` connects a `MediaController` to it and exposes Compose state. + +Launching a game pauses the music unless Enable ingame is on (see Playing during games). Audio focus and headphone unplug are handled by ExoPlayer. + +Added dependencies: `androidx.media3:media3-exoplayer` and `androidx.media3:media3-session` 1.3.1. + +## Playback options + +The player page has a Playback options button that opens a panel with: + +- Speed and pitch, from 0.5x to 2x in 0.05 steps, applied through ExoPlayer's playback parameters. +- Skip silence. +- A sleep timer for 15, 30 or 60 minutes or the end of the current track. The timer runs in `SoundtrackService`, so it still fires when DroidDeck is closed. +- An equalizer with the device presets, one slider per band, and bass boost where the device supports it. The effects are attached to the player's audio session in the service. + +Settings are saved in `soundtrack_settings` and sent to the service whenever the controller connects. The last album, track and position are saved too, so the play button on an album resumes where it stopped. The position is saved on track changes, pauses and seeks. + +## Playing during games + +Setup โ€บ Launcher has an Enable ingame toggle, shown while soundtracks are on. When it is off, launching a game pauses the soundtrack. When it is on, the soundtrack keeps playing and the service stops requesting audio focus, so the game's own audio mixes with it. The setting is sent to the service with the `INGAME` session command and is read again when the service starts. + +## Searching and sorting + +Inside a soundtrack, a search field above the track list filters by title, artist and album, and a sort button orders the list by album order, title or length. Track numbers always count from 1 by position in the list shown. + +Custom (added) soundtracks, collections and Favorites can be reordered: select tracks first (long-press one, or use the select button), then with Album order selected and no search text, long-press a selected track and drag it. The order of an added soundtrack is stored in `soundtrack-order.json` and applied by `Soundtrack.load` within each disc; a collection stores its order in `soundtrack-collections.json`. Steam soundtracks cannot be reordered. The Music tab search also looks up tracks: soundtracks and collections whose names match come first, followed by a Tracks section. + +## Favorites and collections + +- The heart under the transport controls adds or removes the current track from Favorites. The bookmark button next to it opens the Saved panel to add the track to a collection or create one. +- The Music tab has a Collections chip. Favorites is the first entry under it. The bookmark in the Music header opens the same Saved panel to open or create a collection. +- Long-press a track to select. The selection bar has Select all, Deselect all, Add to collection, Add to favorites and, on a collection page, Remove from collection. +- A collection page has a Manage button to rename, add tracks, remove tracks or delete. Favorites cannot be renamed or deleted. +- Collection pages have Manage, Playback options, Shortcut and Edit art. Edit art changes the cover only, from a track cover or an image of your own, and is stored in `soundtrack-art/`. Added soundtracks have the same Edit art, with the images in their folder and the first track cover as the choices; Steam soundtracks keep the Steam art editor. +- Collections are stored in `soundtrack-collections.json` in the app files directory as snapshots of path, title, artist, album, length and cover. Tracks whose files are gone are skipped when a collection is played. +- Collection and Favorites playback does not overwrite the saved resume position of an album. + diff --git a/docs/development/steam-game-imports.md b/docs/development/steam-game-imports.md index 04065e3a55..2e4a0cc3e7 100644 --- a/docs/development/steam-game-imports.md +++ b/docs/development/steam-game-imports.md @@ -52,6 +52,12 @@ again. A failed title lookup undoes nothing. The launcher likewise drops artwork fetched for the app the files named before and fetches it again; pictures the user chose are kept. +A game that stays a shortcut but sits in a Steam install directory with a single matching +manifest links its shortcut prefix to that app's existing `compatdata/`, so cloud +saves the client downloaded are the ones the shortcut sees. A Steam library install only +uses its own library's prefix. An existing shortcut prefix is never replaced, a link to a +missing prefix is removed first, and nothing is copied. + The account's `.droiddeck-routes.json` maps shortcut IDs to real Steam app IDs so the Android launcher uses the same title and Proton prefix as Steam. Other accounts do not inherit those routes. Managed shortcuts are replaced; user-created shortcuts and diff --git a/docs/development/ubisoft-launch.md b/docs/development/ubisoft-launch.md new file mode 100644 index 0000000000..5c18429758 --- /dev/null +++ b/docs/development/ubisoft-launch.md @@ -0,0 +1,112 @@ +# Ubisoft launch without Ubisoft Connect + +A Ubisoft game never holds its own ticket. Its DRM loader opens Ubisoft's API DLL from the Connect +folder, and that DLL asks the running launcher for the session over local named pipes. DroidDeck +answers those pipes with `droiddeck-upc.exe`, a small Windows program that runs in the game's prefix. +The game and every Ubisoft DLL stay unmodified, and there is no Connect client, CEF or background +service. The session the game receives is real: its ticket comes from Ubisoft's ownership service for +the signed-in account. + +This file is the specification `tools/ubisoft-launcher` was written from. The facts come from the +protobuf descriptors embedded in Ubisoft's own `uplay_r1.dll` (`proto_uplaydll/UplayDll.proto`) and +from the public notes in [Foxtrot47/Ubisoft-Connect-RE](https://github.com/Foxtrot47/Ubisoft-Connect-RE) +(`docs/06-launch.md`, `docs/10-denuvo.md`). No code was taken from either. + +## Pieces + +| Piece | Where | Job | +|---|---|---| +| Ubisoft runtime | `C:\Program Files (x86)\Ubisoft\Ubisoft Game Launcher\` in the shared prefix | Ubisoft's own `uplay_r1(64).dll`, `uplay_aux_r1(64).dll`, `uplay_r2(64).dll`, `ubiorbitapi_r2(64).dll`, `UbisoftGameLauncher(64).exe`, the starter's imports (`discord-rpc.x86/x64.dll`, `steam_api(64).dll`) and `overlay(64).dll`. `droiddeck-store-launch` extracts exactly these 16 files with `7z` from the official `UbisoftConnectInstaller.exe`, then deletes the installer | +| Registry | `HKLM\Software\[Wow6432Node\]Ubisoft\Launcher` | `InstallDir` points at the runtime folder in both views; `Installs\\InstallDir` points at the game, with forward slashes and a trailing slash, as Connect writes it | +| Shared prefix | `compatdata/2929927072` | Every Ubisoft game runs here (`UbisoftConnect.launchOptions` sets `STEAM_COMPAT_DATA_PATH`), so the runtime is extracted once | +| Launch file | `/.droiddeck-ubisoft.json` | Written by `droiddeck-store-launch` before every launch from the app's `ubisoft-launch` answer: the account, the owned product ids, a fresh PC ticket, the entitlement's application id and the save folder. Removed first, so a failed refresh falls back to starting the game directly | +| Launcher | `/.droiddeck-launch.bat` | Runs `Z:\usr\local\lib\droiddeck-ubisoft\droiddeck-upc.exe ` when both exist | +| Tickets | app, Rust `ubisoft/service.rs` | Demux `ownership_service`: initialize (owned products), then `GetUplayPCTicketReq` (field 14) answered in field 13 `{1: success, 2: ticket}` | + +## Pipes + +All pipes are `\\.\pipe\terminal__`, where `` is +`ProcessIdToSessionId(GetCurrentProcessId())` (1 under Wine). They are byte-mode duplex pipes with +unlimited instances, created before the game starts. Every message is a 4-byte big-endian length +followed by a proto2 message, except on `uplay_service_ipc_pipe_`. + +| Pipe | Client | Exchange | +|---|---|---| +| `game_start_ipc_pipe_` | `UbisoftGameLauncher.exe` | `game_starter.Upstream{1:{1:{1: build, 2: product, 10: exe, 11: arguments, ...}}}` โ†’ `Downstream{2:{1:{1:0 (overlay off), 2:0, 3: / + "/" + , 4: /, 8:3, 9:{1:{1,113,0,1,0} 1:{3,123,0,0,0}}}}}` | +| `uplay_api_process_ipc_pipe_` | game | `Req.initProcessReq{1: product, 2: game pid, 5: env set}` โ†’ `Rsp.initProcessRsp(13){1:1, 3:0 (overlay off), 4:3, 6:0}`. Kept open. Answering it is what releases the starter (below). Far Cry 3 Blood Dragon sends only `{2: pid, 5:1}`; a missing pid is taken from the pipe's client process | +| `uplay_ipc_pipe_` | game (`uplay_r1.dll`, `uplay_r2.dll`) | `Req.initReq(1)` โ†’ `Rsp.initRsp(1)`, answered every time it is asked. `Req.installerReq(13)` with `initInstallerReq` โ†’ `Rsp.installerRsp(10){1:{1:1, 2:"", 3: language}}`. `Req.userReq(11).getCredentialsReq(1){1: id}` โ†’ `Rsp.userRsp(8).getCredentialsRsp(1){1: id, 2: username, 3: "" (password), 4: userId, 5: email}`. `Req.streamingReq(27)` โ†’ `Rsp.streamingRsp(20){1: id, 2:1, 4:{1:0}}` for the streaming type (not streamed), `{1: id, 2:4}` for any other streaming query | +| `uplay_aux_ipc_pipe_` | `uplay_aux_r1(64).dll` (Denuvo) | `{1: rid, 2: init}` โ†’ `{1: rid, 2:{1:1, 2: pid, 3:3367, 3:3368, 3:3962}}`; `{1: rid, 3:{2:{2: challenge}}}` โ†’ `{1: rid, 3:{2:{2:1, 3:0, 4: game token, 5:""}}}` | +| `uplay_service_ipc_pipe_` | Ubisoft helpers | Server sends `{3:{1:1, 3:{1: }}}` once, then only reads, unframed | +| `orbit_ipc_pipe_` | game (`ubiorbitapi_r2.dll`) | `mg.protocol.orbitdll` from the DLL's own `proto_orbitdll/OrbitDll.proto`. `Req{1: id, 12: init{1: product}}` โ†’ `Rsp{1: id, 12:{1: save folder, 2:1}}`; `getLoginDetails(2)` โ†’ `{1: username, 2:"", 3:""}`; `getOsi(3){1: sub}` โ†’ `{2:1}` (failed, no online-services pipe) | +| `upc_api_process_ipc_pipe_standard`, `uplay_protocol_ipc_pipe_`, `uplay_overlay_ipc_pipe_`, `uplay_crash_reporter_ipc_pipe_` | โ€” | Held open, never answered | + +### The session (`InitRsp`) + +| Field | Value | +|---|---| +| 1 result | 1 (`InitResult_Success`) | +| 2 account | `{1: userId, 2: username, 3: nameOnPlatform, 4: email, 5: "" (password), 6: country}` | +| 3 connected | 1 | +| 4 gameUplayId | the product | +| 5 uplayIds | every owned product whose ownership entry is owned, of type 0 or 1, in state 0 or 3 | +| 6 gameCdKeys | `{1: product, 2: ""}` | +| 7 isInOfflineMode | 0 | +| 8 upcTicket | the PC ticket from `GetUplayPCTicket`, never the Denuvo token | +| 11, 12, 15, 16, 18, 19, 21, 23 | the values a real launch carries (`{1:0}`, 0, overlay `{1:0, 2:3}`, hardware score `{6211, 22395, 1.0f}`, empty, `{1:1, 2:1}`, `{2:1}`, empty) | +| 14 gameInstall | `{1:1, 2: installed chunks, 3: language}` | +| 17 storage | `{1: "C:/users/steamuser/Saved Games/Ubisoft///"}`; the game appends file names directly, so the trailing slash matters | +| 22 ubiServices | `{1: applicationId}` from the account's entitlements, left out when unknown | + +### R2 titles + +`uplay_r2.dll` speaks the same `mg.protocol.uplaydll` messages (its embedded `UplayDll.proto` is identical to +`uplay_r1.dll`'s), but its `InitReq` names the subsystems the game uses: fields 4 to 11 (friend, overlay, +product, storage, install, multiplayer, store, streaming). Its `ApiContext` creates one object per requested +subsystem and copies the session into them. Friends, overlay, game session, store and crossboot are checked +for a missing object first; install and storage are not. A `gameInstall` sent to a game that did not ask for +install is copied into a null object: Prince of Persia: The Lost Crown (6145) asks for overlay, product and store +only, and crashed reading `0x68` in `uplay_r264.dll+0xaca2` two seconds after the session arrived. + +So when the request names subsystems, 14 is sent only with `subSystemInstall` (8), 17 only with +`subSystemStorage` (7), and an empty `multiplayerInit` (20) is added, which `uplay_r2.dll` asks for even when +empty. A request that names none gets the session above unchanged. The Lost Crown also opens a second context +that asks for every subsystem, and it gets the full session. + +The overlay is reported off in all three places. `uplay_r1.dll` still loads `overlay.dll` from the +runtime folder right after the session arrives, whatever the session says; without that file it gives up +with `UplayAPI [ERROR]: Startup failed: cannot load uplay library` (Assassin's Creed Chronicles: China +then sits on a black screen and aborts with code 3 after about 160 s), so the runtime includes it. + +### Orbit titles + +Older titles such as Far Cry 3 Blood Dragon (205) load `ubiorbitapi_r2.dll` next to `uplay_r1.dll` and ask +`orbit_ipc_pipe_` for `init` before anything else; unanswered, the game waits forever on a black screen. The DLL +keeps savegames itself as `*.save` files in the folder `init` returns, the same save folder as field 17 above. + +## Start sequence + +1. `droiddeck-upc.exe` creates the pipes and an auto-reset event marked inheritable, then starts the + game's own exe with handle inheritance, in the install folder, with no extra arguments. +2. The exe sees it was not started by Connect and starts `UbisoftGameLauncher.exe + -gamelauncher_wait_handle -upc_uplay_id ...` (it exits with code 3; that is normal). +3. The starter asks `game_start` and starts the real game from the reply. +4. The game announces itself on `uplay_api_process`; the answer sets the event, which lets the starter + exit. Without it the starter times out and its job object ends the game after about 15 seconds. +5. `uplay_r1.dll` asks `uplay_ipc` for the session. +6. `droiddeck-upc.exe` waits for the announced process, allows 15 s for a restart, then exits with the + game's code so Steam sees the game end. + +A log of every exchange is written to `~/.cache/droiddeck/ubisoft/upc-.log` in the guest. + +## Denuvo + +For protected titles the aux pipe carries the activation challenge. `droiddeck-upc.exe` writes it to +`~/.cache/droiddeck/ubisoft/bridge-/denuvo-.req` and waits 90 s for `.rsp`. Answering it +needs `denuvo_service` with an ownership token (`OwnershipTokenReq`, field 28) and is the next step; +titles without Denuvo never open the aux pipe. + +## Not covered yet + +- R2 titles other than The Lost Crown, and R2 requests beyond the session, credentials, product list and streaming type. +- Orbit's online-services pipe (`getOsi` is declined) and Orbit titles other than Far Cry 3 Blood Dragon. +- Achievements, friends, overlay, cloud saves. diff --git a/docs/development/vram-budget.md b/docs/development/vram-budget.md index c9e6820efe..8877bd7bf3 100644 --- a/docs/development/vram-budget.md +++ b/docs/development/vram-budget.md @@ -1,6 +1,6 @@ # Reported video memory budget -The Performance VRAM setting enables `VK_LAYER_DROIDDECK_vram_cap` for games and reports smaller device-local `VK_EXT_memory_budget` budgets. DXVK exposes these through DXGI's `QueryVideoMemoryInfo`, including to D3D12 games using DXVK's DXGI alongside vkd3d-proton. Games that consult this budget can choose smaller working sets. The driver still supplies real heap sizes, usage figures, memory types, and actual allocation results. DXVK also receives its existing `dxgi.maxDeviceMemory` setting, which separately reduces the adapter's advertised dedicated video memory. A lower driver budget remains lower; the layer never increases it. +The Performance VRAM setting enables `VK_LAYER_DROIDDECK_vram_cap` for games and reports smaller device-local `VK_EXT_memory_budget` budgets. DXVK exposes these through DXGI's `QueryVideoMemoryInfo`, including to D3D12 games using DXVK's DXGI alongside vkd3d-proton. Games that consult this budget can choose smaller working sets. The driver still supplies real heap sizes, usage figures, memory types, and actual allocation results. DXVK also receives `dxgi.maxDeviceMemory` and `dxgi.maxSharedMemory`, which separately reduce the adapter's advertised dedicated and shared video memory (on a single-heap GPU DXVK reports the heap as both, so a game adding the two would otherwise still see the whole heap as shared), and, for caps below DXVK's 4096 MiB D3D9 default, `d3d9.maxAvailableMemory`, which caps the texture memory DXVK's D3D9 frontend reports, since D3D9 games do not read the DXGI setting. Higher caps leave the D3D9 setting alone so DXVK's lower per-game limits still apply. OpenGL games are not covered. A lower driver budget remains lower; the layer never increases it. This does not make vkd3d-proton automatically enforce the selected budget. In the [upstream allocator inspected during this investigation](https://github.com/HansKristian-Work/vkd3d-proton/blob/865b12ba0cc20796b3709397ce5d6d3b8a205b04/libs/vkd3d/memory.c), `heapBudget` is used for diagnostic reporting, while the [DXVK adapter](https://github.com/doitsujin/dxvk/blob/cf0a0d90f8965147741ad17dcd0b263817572ab3/src/dxgi/dxgi_adapter.cpp) returns the Vulkan budget to applications. Seeing a smaller budget in a VKD3D log verifies reporting, not reduced allocation or eviction. diff --git a/docs/lab-builds.md b/docs/lab-builds.md new file mode 100644 index 0000000000..2e01e3b9d8 --- /dev/null +++ b/docs/lab-builds.md @@ -0,0 +1,72 @@ +# Lab builds + +A Lab build is DroidDeck app code and resources built on the device itself, by the on-device agent +or by hand, and loaded over the installed APK at the next start. Nothing is reinstalled or +re-signed, so a tester on a release build keeps their games, sign-ins and settings while trying a +change. + +While a Lab build is active, add-on packs reuse the newest complete copy already installed on the +device, even when the checkout pins another version. This keeps helpers such as proot available +after restarting. If no complete copy exists, the pack uses the checkout's pin. + +## How it works + +- `tools/agent/dd-lab-build` builds the checkout with Gradle on the device (`processReleaseResources` + and `mergeDexRelease`), packs the linked resources and dex files into `overlay.apk`, writes + `overlay.json`, and stages both in the app's `files/lab/next`. It then recompiles the app without + an app image and restarts DroidDeck. +- Run by the app's own agent (`DD_AGENT` set), it writes `files/agent/lab-request` instead, and the + app runs the build in a process of its own, logging to `~/.cache/dd-lab-build.log`; the agent's + copy follows that log and exits with the build. A turn's processes end with the turn, so a build + started there would otherwise die when the agent stops or finishes early. +- At start, `LabOverlay` (called from `App.attachBaseContext`) promotes `next` to `active`, checks + that the build was made for this install, puts its dex files ahead of the APK's, and adds its + resources through `ResourcesLoader` to the app and every activity. Contexts made from them + (presentations on the second screen) inherit the loader. +- The watermark shows `LAB | @ `. When the app comes back on a new build it posts + a "Lab build installed" notification, so the restart does not look like a crash. +- A build that is replaced, turned off or refused is kept in `files/lab/builds` (the newest 12). + Updates lists them under Lab builds: the one in use can be turned off, one built for this + install can be used again, and any can be deleted. + +The build targets the package owning `DD_AGENT_INBOX` when run from the Agent tab. +For a manual build of another package, set `DROIDDECK_PACKAGE`, for example +`DROIDDECK_PACKAGE=com.tencent.ig dd-lab-build`. This also selects the control provider, +Lab storage, and package to restart. + +## What a Lab build cannot change + +The manifest, native code (`cpp`, `jniLibs`, Rust), Gradle files, `App`, `AppLanguage`, and `LabOverlay` itself: +they are loaded before a Lab build can be, or are not part of it. `dd-lab-build` refuses those +changes; they need a new APK. + +## Safety + +- A build is only used on the install it was built for: `overlay.json` carries the APK's commit + (`apkCommit` in `droiddeckctl state`) and the APK's path, which changes with every install and + update. A build for another install is turned off. +- Two starts in a row that do not reach a resumed activity for 10 seconds turn the build off. +- It needs Android 11 or later (`ResourcesLoader`) and no app image (classes in one load before the + Lab build). `dd-lab-build` runs `cmd package compile -m verify` before restarting. Android's + background optimization can bring an app image back; the build is then paused, a notification + says so, and Restart in Updates recompiles through the app's wireless debugging pairing. + +## Setting up a device + +From the DroidDeck terminal, in a checkout of this repository: + +```sh +tools/agent/setup +``` + +It installs Claude Code, git, gh and loopback adb, plus the build toolchain: JDK 17, the Android +SDK platform, and Google's x86-64 `aapt2` run under `qemu-user`. The first Lab build compiles the +whole app and takes about 8 minutes on a Snapdragon 865; later ones compile only what changed. +That needs the Kotlin daemon: Kotlin's in-process compiles always redo the whole app. BuildConfig +is given the installed commit, so committing a change does not change it. Setup +does that first build ahead of time with `dd-lab-build --prepare`, which compiles the installed +commit without making a Lab build. +`~/.cache/dd-lab-build.json` reports the stage, the current task, progress in thousandths and the +seconds left, estimated from how long each task took the last time (`~/.cache/dd-lab-build-times`). +`~/.cache/dd-lab-build-base` holds the installed commit the last successful build compiled, so the +Agent tab can offer to prepare again after DroidDeck updates. diff --git a/tools/agent/android-open b/tools/agent/android-open new file mode 100755 index 0000000000..9d8c550486 --- /dev/null +++ b/tools/agent/android-open @@ -0,0 +1,9 @@ +#!/bin/sh +# Opens a URL in Android's browser on the bottom screen. +url=$1 +[ -n "$url" ] || exit 1 +serial=${ADB_SERIAL:-127.0.0.1:5555} +adb connect "$serial" >/dev/null 2>&1 +quoted=$(printf "%s" "$url" | sed "s/'/'\\\\''/g") +adb -s "$serial" shell "am start --display 2 -a android.intent.action.VIEW -d '$quoted'" >/dev/null 2>&1 || + echo "Open this on any device: $url" >&2 diff --git a/tools/agent/dd-agent b/tools/agent/dd-agent new file mode 100755 index 0000000000..9a1b4d4132 --- /dev/null +++ b/tools/agent/dd-agent @@ -0,0 +1,5 @@ +#!/bin/sh +# Claude Code in the DroidDeck checkout, with sign-in links opened in Android's browser. +export ADB_SERIAL=${ADB_SERIAL:-127.0.0.1:5555} PATH="$HOME/.local/bin:$PATH" BROWSER="$HOME/.local/bin/android-open" +adb connect "$ADB_SERIAL" >/dev/null 2>&1 +cd "$HOME/DroidDeck" && exec claude "$@" diff --git a/tools/agent/dd-gh-login b/tools/agent/dd-gh-login new file mode 100755 index 0000000000..f9b0b7734a --- /dev/null +++ b/tools/agent/dd-gh-login @@ -0,0 +1,52 @@ +#!/bin/bash +# Starts GitHub's device login, floats its code over Android's browser and opens the approval page. +url=https://github.com/login/device +inbox=${DD_AGENT_INBOX:-} + +# DroidDeck takes $inbox/device-code within a few seconds when it can float the code. +float_code() { + [ -n "$inbox" ] && [ -d "$inbox" ] || return 1 + rm -f "$inbox/device-code.result" + printf '%s %s\n' "$1" "$url" > "$inbox/device-code.part" && mv -f "$inbox/device-code.part" "$inbox/device-code" || return 1 + i=0 + while [ $i -lt 40 ] && [ -e "$inbox/device-code" ]; do + sleep 0.2 + i=$((i + 1)) + done + if [ -e "$inbox/device-code" ]; then + rm -f "$inbox/device-code" + return 1 + fi + # DroidDeck writes "ok" or "failed" once it has tried to open the page; no answer counts as failed. + i=0 + while [ $i -lt 50 ] && [ ! -e "$inbox/device-code.result" ]; do + sleep 0.2 + i=$((i + 1)) + done + result=$(cat "$inbox/device-code.result" 2>/dev/null) + rm -f "$inbox/device-code.result" + [ "$result" = ok ] +} + +coproc GH { BROWSER=true gh auth login --hostname github.com --git-protocol https --web 2>&1; } +gh_pid=$GH_PID +exec {ghout}<&"${GH[0]}" {ghin}>&"${GH[1]}" +shown= +while IFS= read -r line <&"$ghout"; do + code=$(grep -oE '[A-Z0-9]{4}-[A-Z0-9]{4}' <<<"$line" | head -1) + # gh's own prompts would push the code out of the one line the setup card shows. + case "$line" in + *"one-time code"* | *"Press Enter"* | *"Open this URL"*) ;; + *) printf '%s\n' "$line" ;; + esac + if [ -n "$code" ] && [ -z "$shown" ]; then + shown=1 + echo >&"$ghin" + printf 'GitHub device code: %s ยท github.com/login/device\n' "$code" + float_code "$code" || android-open "$url" + fi +done +wait "$gh_pid" +status=$? +[ -n "$shown" ] && [ -n "$inbox" ] && [ -d "$inbox" ] && : > "$inbox/device-code" +exit $status diff --git a/tools/agent/dd-lab-build b/tools/agent/dd-lab-build new file mode 100755 index 0000000000..b29c6bc5a6 --- /dev/null +++ b/tools/agent/dd-lab-build @@ -0,0 +1,245 @@ +#!/bin/bash +# Builds this checkout as a Lab build of the installed DroidDeck and restarts the app on it. +# Usage: dd-lab-build [--no-restart | --prepare] [--explain] +# --prepare compiles the installed commit without making a Lab build, so later builds only +# compile what changed. Setup runs it once; it takes the longest. +# --explain logs why each task ran and Kotlin's build report, to find out what makes a build slow. +set -euo pipefail +pkg=${DROIDDECK_PACKAGE:-} +if [ -z "$pkg" ] && [[ ${DD_AGENT_INBOX:-} =~ ^/data/(user/[0-9]+|data)/([^/]+)/files/agent$ ]]; then + pkg=${BASH_REMATCH[2]} +fi +pkg=${pkg:-com.droiddeck.launcher} +serial=${ADB_SERIAL:-127.0.0.1:5555} +mode=build +explain=() +for arg in "$@"; do + case $arg in + --package=*) pkg=${arg#--package=} ;; + --no-restart) mode=no-restart ;; + --prepare) mode=prepare ;; + --explain) explain=(--info -Pkotlin.build.report.output=file) ;; + esac +done +started=$(date +%s) +cache=$HOME/.cache +progress_file=$cache/dd-lab-build.json +times_file=$cache/dd-lab-build-times +mkdir -p "$cache" +# The Agent tab reads this file to show how far the build has got and how long is left. +progress() { # stage [permille task done total eta] + local task=${3:-}; task=${task//\\/}; task=${task//\"/\'}; task=${task//$'\n'/ } + printf '{"stage":"%s","mode":"%s","permille":%d,"task":"%s","done":%d,"total":%d,"eta":%d,"elapsed":%d,"pid":%d}\n' \ + "$1" "$mode" "${2:-0}" "$task" "${4:-0}" "${5:-0}" "${6:--1}" $(( $(date +%s) - started )) $$ > "$progress_file.part.$BASHPID" + mv "$progress_file.part.$BASHPID" "$progress_file" +} +fail() { progress failed 0 "$*"; echo "dd-lab-build: $*" >&2; exit 1; } +trap 'progress failed 0 stopped; exit 143' INT TERM +trap 'progress failed 0 "a command failed on line $LINENO"' ERR +[[ $pkg =~ ^[A-Za-z][A-Za-z0-9_]*(\.[A-Za-z][A-Za-z0-9_]*)+$ ]] || fail "invalid Android package: $pkg" +export DROIDDECK_PACKAGE=$pkg +device() { adb -s "$serial" shell "$@" | tr -d '\r'; } + +# The app's agent loses every process it started when its turn ends, a build included, so it asks +# the app to run the build in a process of its own and follows that build here. +agent=${DD_AGENT_INBOX:-/data/user/0/$pkg/files/agent} +if [ -n "${DD_AGENT:-}" ] && [ -z "${DD_LAB_DETACHED:-}" ] && [ -d "$agent" ]; then + trap - ERR + log=$cache/dd-lab-build.log + rm -f "$progress_file" + python3 -c 'import json,os,sys; print(json.dumps({"cwd": os.getcwd(), "args": [*sys.argv[1:], "--package=" + os.environ["DROIDDECK_PACKAGE"]]}))' "$@" > "$agent/lab-request.part" + mv "$agent/lab-request.part" "$agent/lab-request" + echo "DroidDeck runs this build itself, so it keeps going if this turn ends. Its log follows." + for _ in $(seq 1 30); do [ -f "$progress_file" ] && break; sleep 1; done + [ -f "$progress_file" ] || { echo "dd-lab-build: DroidDeck did not start the build; is it running?" >&2; exit 1; } + tail -n +1 -F "$log" 2>/dev/null & follow=$! + result=1 + while sleep 2; do + stage=$(sed -n 's/.*"stage":"\([a-z]*\)".*/\1/p' "$progress_file") + pid=$(sed -n 's/.*"pid":\([0-9]*\).*/\1/p' "$progress_file") + case $stage in + ready|prepared) result=0; break ;; + failed) break ;; + esac + [ -n "$pid" ] && [ -d "/proc/$pid" ] || break + done + sleep 1; kill $follow 2>/dev/null || true + exit $result +fi + +progress checking +repo=$(git rev-parse --show-toplevel) || fail "run it inside the DroidDeck checkout" +cd "$repo" +adb connect "$serial" >/dev/null 2>&1 || true + +state=$(python3 tools/droiddeckctl state 2>/dev/null | sed -n '/^{/,$p') || fail "could not read DroidDeck's state; is it running and is adb connected?" +# A Lab build reports its own label, so the APK's commit comes from apkCommit when the app has it. +label=$(python3 -c 'import json,sys; s=json.load(sys.stdin); print(s.get("apkCommit") or s["build"].rsplit(" at ", 1)[-1])' <<<"$state") || + fail "DroidDeck's state did not say which build is installed" +installed_label=$(python3 -c 'import json,re,sys; print(re.sub(r"^(?:\w+ \w+ ยท |lab on )+", "", json.load(sys.stdin)["build"]))' <<<"$state") +if ! base=$(git rev-parse --verify --quiet "$label^{commit}"); then + progress fetching 0 "the installed commit" + git fetch --quiet --tags origin >/dev/null 2>&1 || true + git fetch --quiet origin main >/dev/null 2>&1 || true + base=$(git rev-parse --verify --quiet "$label^{commit}") || fail "the installed build ($label) is not in this checkout or on GitHub's main; fetch it first" +fi + +if [ $mode = prepare ]; then + # Compiling the installed commit itself gives later builds of branches on it incremental caches. + if ! git merge-base --is-ancestor "$base" HEAD; then + git diff --quiet && git diff --cached --quiet || fail "HEAD does not build on the installed commit and has uncommitted changes" + was=$(git branch --show-current) + git checkout --quiet --detach "$base" + echo "Checked out the installed commit ${base:0:9} to prepare it${was:+; $was is unchanged}" + fi +else + git diff --quiet && git diff --cached --quiet || fail "commit your changes first" + git merge-base --is-ancestor "$base" HEAD || fail "HEAD does not build on the installed commit ${base:0:9}; branch from it" + blocked=$(git diff --name-only "$base" HEAD | grep -E 'AndroidManifest\.xml$|/cpp/|/jniLibs/|\.rs$|(^|/)build\.gradle$|/App\.kt$|/AppLanguage\.kt$|/lab/LabOverlay\.kt$' || true) + [ -z "$blocked" ] || fail "these need a new APK, not a Lab build: $(echo $blocked)" +fi +apk=$(device pm path $pkg | sed -n 's/^package://p' | grep 'base\.apk$' | head -1) +[ -n "$apk" ] || fail "DroidDeck is not installed" + +export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-arm64 ANDROID_HOME=$HOME/android-sdk +# BuildConfig describes the installed base, not each Lab commit; its commit changing would make the +# Kotlin compile redo the whole app (the overlay's own label names the Lab build). Updates reads the +# installed variant (non-adreno) from the build label. +export DROIDDECK_SOURCE_COMMIT=$base DROIDDECK_BUILD_LABEL="lab on $installed_label" DROIDDECK_BUILD_TREE_STATE=clean GITHUB_HEAD_REF=lab +printf 'sdk.dir=%s\n' "$ANDROID_HOME" > local.properties +if [ ! -d "$ANDROID_HOME/platforms/android-34" ]; then + progress sdk + (set +o pipefail; yes | "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" --licenses >/dev/null) + "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" "platforms;android-34" "build-tools;35.0.0" >/dev/null +fi + +# A full Kotlin compile of the app needs about 2.5 GB of heap and Gradle about 1 GB; smaller devices get +# what they can spare. Both daemons end with this script's process when the build is done. +total_mb=$(awk '/^MemTotal:/ {print int($2 / 1024)}' /proc/meminfo) +heap=$(( total_mb / 2 )); [ $heap -gt 4096 ] && heap=4096; [ $heap -lt 2048 ] && heap=2048 +heap=${DD_LAB_HEAP_MB:-$heap} +kotlin_heap=$(( heap * 2 / 3 )); gradle_heap=$(( heap - kotlin_heap )) + +# Only the Kotlin daemon compiles incrementally; in-process compiles always redo the whole app, and the +# caches they leave behind make the daemon's first incremental compile fail. +if [ "$(cat "$cache/dd-lab-build-strategy" 2>/dev/null)" != daemon ]; then + rm -rf app/build/kotlin/compileReleaseKotlin + echo daemon > "$cache/dd-lab-build-strategy" +fi + +# Google publishes aapt2 for x86-64 Linux only; setup wraps it in qemu-user at ~/aapt2/aapt2. +gradle=(./gradlew :app:processReleaseResources :app:mergeDexRelease --max-workers=2 -PskipRust=true -x buildVkBridgeServer + -Pandroid.aapt2FromMavenOverride=$HOME/aapt2/aapt2 -Pkotlin.compiler.execution.strategy=daemon + -Pkotlin.daemon.jvmargs=-Xmx${kotlin_heap}m -Dorg.gradle.jvmargs=-Xmx${gradle_heap}m --console=plain) +progress planning +plan_file=$cache/dd-lab-build-plan +plan_key=$( + { + printf '%s\n' "$repo" "${gradle[@]}" + git ls-files -z -- '*gradle*' | xargs -0 -r sha256sum + } | sha256sum | cut -d ' ' -f1 +) +if [ "$(head -n 1 "$plan_file" 2>/dev/null)" != "$plan_key" ]; then + plan_output=$("${gradle[@]}" --dry-run) || fail "Gradle planning failed: $plan_output" + { printf '%s\n' "$plan_key"; awk '/^:/ {print $1}' <<<"$plan_output"; } > "$plan_file.part" + mv "$plan_file.part" "$plan_file" +fi +mapfile -t plan < <(tail -n +2 "$plan_file") +total=${#plan[@]} + +# Each task's estimate is how long it took last time; a full compile of the app takes about 15 minutes. +declare -A estimate +[ -f "$times_file" ] && while read -r t s; do estimate[$t]=$s; done < "$times_file" +estimate_of() { local e=${estimate[$1]:-}; [ -n "$e" ] && echo "$e" || { [[ $1 == *compileReleaseKotlin ]] && echo 900 || echo 2; }; } +planned=0 +for t in "${plan[@]}"; do planned=$(( planned + $(estimate_of "$t") )); done +[ $planned -gt 0 ] || planned=1 + +current=$(mktemp) +measured=$(mktemp) +# " " +echo "0 starting $(date +%s) 0 0" > "$current" +report() { + local n task since done_s cur_est now part permille left + read -r n task since done_s cur_est < "$current" + now=$(date +%s) + part=$(( now - since )); [ $part -gt $(( cur_est * 95 / 100 )) ] && part=$(( cur_est * 95 / 100 )) + permille=$(( (done_s + part) * 1000 / planned )); [ $permille -gt 990 ] && permille=990 + left=$(( planned - done_s - part )); [ $left -lt 0 ] && left=0 + progress building "$permille" "$task" "$n" "$total" "$left" + echo "$n $task $(( (now - started) / 60 )) $left" +} +( + beat=0 + while sleep 5; do + set -- $(report) + beat=$(( beat + 1 )) + [ $(( beat % 12 )) = 0 ] && echo "[build $1/$total] still on $2, $3m in, about $(( $4 / 60 + 1 ))m left" + done +) & +heartbeat=$! +trap 'kill $heartbeat 2>/dev/null || true; rm -f "$current" "$measured"' EXIT +set +o pipefail +"${gradle[@]}" ${explain[@]+"${explain[@]}"} 2>&1 | { + n=0 done_s=0 task="" since=0 cur_est=0 ran=0 + while IFS= read -r line; do + printf '%s\n' "$line" + case $line in + "> Task "*) + now=$(date +%s) + # A task's line comes when it starts, or when it ends for one that did no work. + if [ -n "$task" ]; then + done_s=$(( done_s + cur_est )) + [ $ran = 1 ] && echo "$task $(( now - since ))" >> "$measured" + fi + rest=${line#> Task }; task=${rest%% *} + case $rest in *" "*) ran=0 ;; *) ran=1 ;; esac + n=$((n + 1)); since=$now; cur_est=$(estimate_of "$task") + echo "$n $task $since $done_s $cur_est" > "$current" + [ $ran = 1 ] && report >/dev/null && echo "[build $n/$total] $task" ;; + esac + done + if [ -n "$task" ] && [ $ran = 1 ]; then echo "$task $(( $(date +%s) - since ))" >> "$measured"; fi +} +status=${PIPESTATUS[0]} +set -o pipefail +kill $heartbeat 2>/dev/null || true +[ "$status" = 0 ] || fail "Gradle failed (exit $status); the reason is above" +# Tasks that did no work this time keep their earlier time. +{ [ -f "$times_file" ] && cat "$times_file"; cat "$measured"; } | awk '{t[$1] = $2} END {for (k in t) print k, t[k]}' > "$times_file.part" +mv "$times_file.part" "$times_file" +# The app reads which installed commit the build caches are warm for. +echo "$base" > "$cache/dd-lab-build-base" + +if [ $mode = prepare ]; then + progress prepared 1000 + echo "Prepared: Lab builds of branches on ${base:0:9} now compile only what changed ($(( ($(date +%s) - started) / 60 ))m)" + exit 0 +fi + +progress packaging 995 +linked=$(ls app/build/intermediates/linked_resources_binary_format/release/processReleaseResources/*.ap_ | head -1) +work=$(mktemp -d) +cp "$linked" "$work/overlay.apk" +(cd app/build/intermediates/dex/release/mergeDexRelease && zip -q "$work/overlay.apk" classes*.dex) +name="$(git branch --show-current) @ $(git rev-parse --short HEAD)" +python3 -c 'import json,sys,time; print(json.dumps({"label": sys.argv[1], "baseCommit": sys.argv[2], "baseApk": sys.argv[3], "built": int(time.time())}))' \ + "$name" "$label" "$apk" > "$work/overlay.json" + +lab=/data/user/0/$pkg/files/lab +mkdir -p "$lab" +rm -rf "$lab/next.part" "$lab/next" +mv "$work" "$lab/next.part" +mv "$lab/next.part" "$lab/next" +progress ready 1000 "$name" +echo "Lab build ready: $name ($(du -h "$lab/next/overlay.apk" | cut -f1)) in $(( ($(date +%s) - started) / 60 ))m" +[ $mode = build ] || exit 0 + +# Classes in an app image load before the Lab build can, so the app is recompiled without one. +device cmd package compile -m verify -f $pkg >/dev/null +progress restarting 1000 "$name" +echo "Restarting DroidDeck on the Lab build; it shows a notification when it is back" +# The app's own agent ends with the app, so it is told to carry on once the app is back. +if [ -n "${DD_AGENT:-}" ]; then mkdir -p "$agent" && : > "$agent/resume"; fi +device "nohup sh -c 'sleep 3; monkey -p $pkg -c android.intent.category.LAUNCHER 1' >/dev/null 2>&1 &" +for pid in $(device pidof $pkg); do kill "$pid" 2>/dev/null || true; done diff --git a/tools/agent/setup b/tools/agent/setup new file mode 100755 index 0000000000..e3b649db5e --- /dev/null +++ b/tools/agent/setup @@ -0,0 +1,79 @@ +#!/bin/bash +# Sets up the on-device agent inside DroidDeck's Linux userland: Claude Code, git and gh, loopback +# adb for droiddeckctl, and the toolchain dd-lab-build uses to build Lab builds on the device. +# Run it from the DroidDeck terminal, inside a checkout of the DroidDeck repository. +set -euo pipefail +here=$(cd "$(dirname "$0")" && pwd) +export DEBIAN_FRONTEND=noninteractive +tmp=$(mktemp -d) +trap 'rm -rf "$tmp"' EXIT + +apt-get update +apt-get install -y --no-install-recommends git gh adb python3 zip unzip curl openjdk-17-jdk-headless qemu-user zipalign apksigner + +command -v claude >/dev/null || [ -x "$HOME/.local/bin/claude" ] || + { curl -fsSL -o "$tmp/install-claude.sh" https://claude.ai/install.sh && bash "$tmp/install-claude.sh"; } + +mkdir -p "$HOME/.local/bin" +for tool in dd-agent dd-lab-build dd-gh-login android-open; do install -m755 "$here/$tool" "$HOME/.local/bin/$tool"; done +# DroidDeck passes the live loopback adb port; a fixed one here would go stale whenever wireless debugging is toggled. +sed -i 's|ADB_SERIAL=127.0.0.1:5555 |ADB_SERIAL="${ADB_SERIAL:-127.0.0.1:5555}" |' "$HOME/.bashrc" 2>/dev/null || true +grep -q 'droiddeck-agent-path' "$HOME/.bashrc" 2>/dev/null || + printf '\n# droiddeck-agent-path\nexport PATH="$HOME/.local/bin:$PATH" ADB_SERIAL="${ADB_SERIAL:-127.0.0.1:5555}" BROWSER="$HOME/.local/bin/android-open"\n' >> "$HOME/.bashrc" + +# Google publishes aapt2 for x86-64 Linux only; it runs here under qemu-user with Ubuntu's x86-64 runtime. +x86=$HOME/x86root +mkdir -p "$HOME/aapt2/x86" "$x86/etc" +if [ ! -x "$HOME/aapt2/x86/aapt2" ]; then + agp=$(sed -n "s/.*com.android.tools.build:gradle:\([0-9.]*\).*/\1/p" "$here/../../build.gradle" | head -1) + [ -n "$agp" ] || { echo "setup: no Android Gradle plugin version in build.gradle" >&2; exit 1; } + aapt2=$(curl -fsSL "https://dl.google.com/android/maven2/com/android/tools/build/aapt2/maven-metadata.xml" | + { grep -o "$agp-[0-9]*" || true; } | tail -1 | sed 's/<[^>]*>//g') + [ -n "$aapt2" ] || { echo "setup: Google publishes no aapt2 for AGP $agp" >&2; exit 1; } + curl -fsSL -o "$tmp/aapt2.jar" "https://dl.google.com/android/maven2/com/android/tools/build/aapt2/$aapt2/aapt2-$aapt2-linux.jar" + unzip -o -q "$tmp/aapt2.jar" aapt2 -d "$HOME/aapt2/x86" + chmod +x "$HOME/aapt2/x86/aapt2" +fi +if [ ! -e "$x86/lib64/ld-linux-x86-64.so.2" ]; then + codename=$(. /etc/os-release && echo "$VERSION_CODENAME") + curl -fsSL "https://archive.ubuntu.com/ubuntu/dists/$codename/main/binary-amd64/Packages.gz" | gunzip > "$tmp/amd64-packages" + for package in libc6 libgcc-s1 libstdc++6 zlib1g; do + read -r file sum < <(awk -v p="$package" '$0 == "Package: " p {found = 1} found && /^Filename:/ {f = $2} + found && /^SHA256:/ {s = $2} found && /^$/ {exit} END {print f, s}' "$tmp/amd64-packages") + [ -n "$sum" ] || { echo "setup: $package is not in Ubuntu $codename's amd64 index" >&2; exit 1; } + curl -fsSL -o "$tmp/$package.deb" "https://archive.ubuntu.com/ubuntu/$file" + echo "$sum $tmp/$package.deb" | sha256sum -c --quiet - + dpkg-deb -x "$tmp/$package.deb" "$x86" + done + ln -sfn usr/lib64 "$x86/lib64" + ln -sfn usr/lib "$x86/lib" + : > "$x86/etc/ld.so.preload" +fi +# AGP only accepts a custom aapt2 whose file is named aapt2. +printf '#!/bin/sh\nexec qemu-x86_64 -L %s %s/aapt2/x86/aapt2 "$@"\n' "$x86" "$HOME" > "$HOME/aapt2/aapt2" +chmod +x "$HOME/aapt2/aapt2" +"$HOME/aapt2/aapt2" version + +sdk=$HOME/android-sdk +if [ ! -x "$sdk/cmdline-tools/latest/bin/sdkmanager" ]; then + mkdir -p "$sdk/cmdline-tools" + curl -fsSL -o "$tmp/cmdline-tools.zip" https://dl.google.com/android/repository/commandlinetools-linux-13114758_latest.zip + unzip -q -o "$tmp/cmdline-tools.zip" -d "$sdk/cmdline-tools" + rm -rf "$sdk/cmdline-tools/latest" + mv "$sdk/cmdline-tools/cmdline-tools" "$sdk/cmdline-tools/latest" +fi +export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-arm64 +(set +o pipefail; yes | "$sdk/cmdline-tools/latest/bin/sdkmanager" --licenses >/dev/null) +"$sdk/cmdline-tools/latest/bin/sdkmanager" "platforms;android-34" "build-tools;35.0.0" >/dev/null + +adb connect 127.0.0.1:5555 || true +# The first build compiles the whole app; doing it now makes the agent's Lab builds incremental. +if [ "${DD_SKIP_PREPARE:-}" != 1 ]; then + echo "Approve the USB debugging prompt if one appears." + if timeout 120 adb -s 127.0.0.1:5555 wait-for-device; then + "$here/dd-lab-build" --prepare || echo "The first Lab build will compile the whole app" + else + echo "adb did not connect, so the first Lab build will compile the whole app" + fi +fi +echo "Done. Run dd-agent." diff --git a/tools/build_local.sh b/tools/build_local.sh index 041d6b3131..ee891aee97 100755 --- a/tools/build_local.sh +++ b/tools/build_local.sh @@ -133,6 +133,7 @@ docker run --rm --platform "${docker_platform}" \ aarch64-linux-gnu-gcc -shared -fPIC -O2 -Wall -pthread \ -o "$d/libblfastpath.so" tools/proot/fastpath/fastpath.c -ldl aarch64-linux-gnu-strip --strip-unneeded "$d/libblfastpath.so" + bash tools/nativeguest/build.sh "$d/libddnatv-hook.so" aarch64-linux-gnu-gcc -shared -fPIC -O2 -Wall -nostdlib -ffreestanding -fno-stack-protector \ -fno-tree-loop-distribute-patterns -Wl,-z,defs -o "$d/libblaudit.so" tools/proot/fastpath/audit.c aarch64-linux-gnu-strip --strip-unneeded "$d/libblaudit.so" @@ -424,6 +425,22 @@ if ! restore_step comet "${comet_key}" "${comet_out}"; then DROIDDECK_BUILD_IMAGE="${image_name}" bash tools/comet/build-local.sh save_step comet "${comet_key}" "${comet_out}" fi +if [[ "${DROIDDECK_SKIP_RUST:-0}" != 1 ]]; then + upc_out="${linuxfs_dir}/usr/local/lib/droiddeck-ubisoft" + upc_key=$(inputs_hash "x86_64-pc-windows-gnu" tools/ubisoft-launcher/src tools/ubisoft-launcher/Cargo.toml tools/ubisoft-launcher/Cargo.lock tools/ubisoft-launcher/build.sh) + if ! restore_step ubisoft "${upc_key}" "${upc_out}"; then + command -v x86_64-w64-mingw32-gcc >/dev/null 2>&1 || { echo "x86_64-w64-mingw32-gcc is required for the Ubisoft launcher service (droiddeck-upc.exe)." >&2; exit 1; } + CARGO_TARGET_DIR="${cache_dir}/ubisoft-target" bash tools/ubisoft-launcher/build.sh "${upc_out}" + save_step ubisoft "${upc_key}" "${upc_out}" + fi + rockstar_out="${repo_root}/app/src/main/resources/rockstar/helpers" + rockstar_key=$(inputs_hash "windows-gnu" tools/rockstar-launcher/src tools/rockstar-launcher/Cargo.toml tools/rockstar-launcher/Cargo.lock tools/rockstar-launcher/build.sh) + if ! restore_step rockstar "${rockstar_key}" "${rockstar_out}"; then + command -v i686-w64-mingw32-gcc >/dev/null 2>&1 || { echo "i686-w64-mingw32-gcc is required for the Rockstar launcher service." >&2; exit 1; } + CARGO_TARGET_DIR="${cache_dir}/rockstar-target" bash tools/rockstar-launcher/build.sh "${rockstar_out}" + save_step rockstar "${rockstar_key}" "${rockstar_out}" + fi +fi python3 tools/powervr/fetch.py bash tools/packs/build.sh app/build/packs python3 tools/release/runtime_inputs.py record diff --git a/tools/ci/install-ubuntu-packages.sh b/tools/ci/install-ubuntu-packages.sh index dcccc0eb6b..d1bd5e698a 100644 --- a/tools/ci/install-ubuntu-packages.sh +++ b/tools/ci/install-ubuntu-packages.sh @@ -31,15 +31,22 @@ install_packages() { if install_packages; then exit 0 fi -echo "::warning::Runner mirror failed or timed out; retrying with the official Ubuntu mirror." [ -f "$ubuntu_sources" ] || exit 1 sources=$(mktemp --suffix=.sources) trap 'rm -f "$sources"' EXIT -mirror=https://archive.ubuntu.com/ubuntu +# The last mirror of each list is outside Canonical's network, so it still answers when runners cannot reach Canonical. +mirrors=(https://archive.ubuntu.com/ubuntu https://mirrors.edge.kernel.org/ubuntu) case "$(dpkg --print-architecture)" in - arm64) mirror=https://ports.ubuntu.com/ubuntu-ports ;; + arm64) mirrors=(https://ports.ubuntu.com/ubuntu-ports https://mirrors.ocf.berkeley.edu/ubuntu-ports) ;; esac -sed -E "s@^URIs:.*@URIs: $mirror@" "$ubuntu_sources" > "$sources" -chmod 644 "$sources" -options[1]="Dir::Etc::sourcelist=$sources" -install_packages +status=1 +for mirror in "${mirrors[@]}"; do + echo "::warning::Ubuntu mirror failed or timed out; retrying with $mirror." + sed -E "s@^URIs:.*@URIs: $mirror@" "$ubuntu_sources" > "$sources" + chmod 644 "$sources" + options[1]="Dir::Etc::sourcelist=$sources" + status=0 + install_packages || status=$? + [ "$status" = 0 ] && exit 0 +done +exit "$status" diff --git a/tools/components/build-arm64-preloads.sh b/tools/components/build-arm64-preloads.sh index a38a1edaaa..e06aa2afc1 100644 --- a/tools/components/build-arm64-preloads.sh +++ b/tools/components/build-arm64-preloads.sh @@ -12,6 +12,7 @@ aarch64-linux-gnu-strip --strip-unneeded "$D/libblsession.so" aarch64-linux-gnu-gcc -shared -fPIC -O2 -Wall -pthread \ -o "$D/libblfastpath.so" tools/proot/fastpath/fastpath.c -ldl aarch64-linux-gnu-strip --strip-unneeded "$D/libblfastpath.so" +bash tools/nativeguest/build.sh "$D/libddnatv-hook.so" aarch64-linux-gnu-gcc -shared -fPIC -O2 -Wall -nostdlib -ffreestanding -fno-stack-protector \ -fno-tree-loop-distribute-patterns -Wl,-z,defs -o "$D/libblaudit.so" tools/proot/fastpath/audit.c aarch64-linux-gnu-strip --strip-unneeded "$D/libblaudit.so" diff --git a/tools/components/preloads.py b/tools/components/preloads.py index 808d510463..36d0b3dcc8 100644 --- a/tools/components/preloads.py +++ b/tools/components/preloads.py @@ -51,6 +51,7 @@ def source_files(group, root=ROOT, commit=None, patterns=None): if not paths: raise ValueError('No preload inputs found') result = {} + listed = set(paths) pending = list(paths) while pending: path = pending.pop() @@ -58,7 +59,13 @@ def source_files(group, root=ROOT, commit=None, patterns=None): continue if path.startswith('../') or path.startswith('/'): raise ValueError('Preload include escapes repository') - content = read(path).replace(b'\r\n', b'\n') + try: + content = read(path).replace(b'\r\n', b'\n') + except (OSError, subprocess.CalledProcessError): + # a header the build generates (gosys/gosys_blob.h, included behind __has_include) + if path in listed: + raise + continue result[path] = sha(content) for include in re.findall(rb'^\s*#\s*include\s*"([^"\n]+)"', content, re.M): pending.append(posixpath.normpath(posixpath.join(posixpath.dirname(path), include.decode()))) @@ -126,13 +133,15 @@ def artifact_bytes(origin, cache): if len(names) != 1: raise ValueError('Expected one original APK') with ZipFile(io.BytesIO(archive.read(names[0]))) as apk: - return {name: apk.read('assets/linuxfs/' + name) for name in FILES} + present = set(apk.namelist()) + return {name: apk.read('assets/linuxfs/' + name) for name in FILES if 'assets/linuxfs/' + name in present} def validate_lock(data): if data.get('version') != 1 or set(data['groups']) != set(INPUTS): raise ValueError('Unsupported preload snapshot') - if set(data['outputs']) != FILES: + # A lock made before a recipe gained an output lacks it; that group is rebuilt (restore) + if not set(data['outputs']) <= FILES: raise ValueError('Unexpected preload output set') for digest in [data['archive_sha256'], *data['outputs'].values()]: if len(digest) != 64 or any(c not in '0123456789abcdef' for c in digest): @@ -160,7 +169,7 @@ def producer_sources(group, commit, root=ROOT): def prove_origin(data, cache, root=ROOT): content = artifact_bytes(data['origin'], cache) - if {name: sha(value) for name, value in content.items()} != data['outputs']: + if {name: sha(value) for name, value in content.items() if name in data['outputs']} != data['outputs']: raise ValueError('Snapshot binaries differ from the original main APK') commit = data['origin']['commit'] run('git', 'fetch', '--no-tags', 'origin', commit, root=root) @@ -183,7 +192,7 @@ def unpack(content, data): total = 0 with tarfile.open(fileobj=io.BytesIO(content), mode='r:gz') as archive: for entry in archive: - if entry.name not in FILES or entry.name in result or not entry.isfile() or entry.size > 32 * 1024 * 1024: + if entry.name not in data['outputs'] or entry.name in result or not entry.isfile() or entry.size > 32 * 1024 * 1024: raise ValueError('Unsafe or unexpected preload archive entry') total += entry.size if total > 64 * 1024 * 1024: @@ -192,7 +201,7 @@ def unpack(content, data): if sha(value) != data['outputs'][entry.name]: raise ValueError('Preload binary checksum mismatch') result[entry.name] = value - if set(result) != FILES: + if set(result) != set(data['outputs']): raise ValueError('Incomplete preload archive') return result @@ -203,6 +212,8 @@ def restore(root=ROOT): matching = {group: source_files(group, root) == data['groups'][group] for group in INPUTS} matching['arm64'] &= recipe(root) == data['arm64_recipe'] matching['x86'] &= x86_recipe(root) == data.get('x86_recipe') + for group in matching: + matching[group] &= all(name in data['outputs'] for name in OUTPUTS[group]) if os.environ.get('FORCE_PRELOAD_REBUILD') == 'true': matching = dict.fromkeys(INPUTS, False) if any(matching.values()): diff --git a/tools/components/recipes.json b/tools/components/recipes.json index b5789aa7ea..92fcc548a4 100644 --- a/tools/components/recipes.json +++ b/tools/components/recipes.json @@ -164,7 +164,8 @@ "tools/components/build-arm64-preloads.sh", "tools/linuxfs/preload", "app/src/main/cpp/fakeinput_steam.cpp", - "tools/components/recipes/arm64-preloads.sh" + "tools/components/recipes/arm64-preloads.sh", + "tools/nativeguest" ], "outputs": [ "app/src/main/assets/linuxfs/libfakeinput.so", @@ -172,7 +173,8 @@ "app/src/main/assets/linuxfs/libblfastpath.so", "app/src/main/assets/linuxfs/libblaudit.so", "app/src/main/assets/linuxfs/libssbs.so", - "app/src/main/assets/linuxfs/usr/local/bin/droiddeck-clipboard" + "app/src/main/assets/linuxfs/usr/local/bin/droiddeck-clipboard", + "app/src/main/assets/linuxfs/libddnatv-hook.so" ], "packages": [ "gcc-aarch64-linux-gnu", @@ -187,7 +189,8 @@ "tools/quest/kgsl_compat.h", "tools/proot/fastpath", "tools/linuxfs/ssbs", - "tools/linuxfs/clipboard" + "tools/linuxfs/clipboard", + "tools/nativeguest" ], "snapshot_outputs": [ "libfakeinput.so", @@ -195,7 +198,8 @@ "libblfastpath.so", "libblaudit.so", "libssbs.so", - "usr/local/bin/droiddeck-clipboard" + "usr/local/bin/droiddeck-clipboard", + "libddnatv-hook.so" ] }, "preload-snapshot": { diff --git a/tools/droiddeckctl b/tools/droiddeckctl index 8d08288d01..ea82343888 100755 --- a/tools/droiddeckctl +++ b/tools/droiddeckctl @@ -101,6 +101,10 @@ def encode_request(request: dict) -> str: def receiver_call(adb: str, serial: str, method: str, arg: str | None, request: dict | None, timeout: float) -> dict: """The agent bridge through a broadcast, for shells without the `content` command.""" + # Its receiver is registered by the running app; a broadcast does not start the app the way `content call` does + running = run_adb(adb, serial, "shell", f"pidof {PACKAGE}", timeout=30) + if not running.stdout.decode(errors="replace").strip(): + raise ControlError(f"{PACKAGE} is not running and this shell has no `content` command to start it; open DroidDeck once", "APP_NOT_RUNNING") call_id = uuid.uuid4().hex[:16] remote = f"/sdcard/Android/data/{PACKAGE}/files/agent-calls/{call_id}.json" command = ["shell", "am", "broadcast", "-a", f"{PACKAGE}.AGENT_CALL", "-p", PACKAGE, @@ -132,7 +136,8 @@ def provider_call(adb: str, serial: str, method: str, arg: str | None = None, re command.extend(["--extra", f"request:s:{encoded}"]) result = run_adb(adb, serial, *command, timeout=timeout) output = (result.stdout + result.stderr).decode(errors="replace") - if "content: inaccessible or not found" in output: + # Only the shell's own answer for a missing `content` binary, never a command's output that quotes it + if result.returncode == 127 and "Result:" not in output and "content: inaccessible or not found" in result.stderr.decode(errors="replace") + output: return receiver_call(adb, serial, method, arg, request, timeout) response = _content_result(output) if result.returncode != 0 and response.get("ok") is not False: @@ -166,6 +171,9 @@ def start_agent_activity(adb: str, serial: str, request: dict) -> None: output = (result.stdout + result.stderr).decode(errors="replace") if result.returncode != 0 or "status: ok" not in output.lower(): raise ControlError(output.strip() or "The agent start Activity did not launch", "ACTIVITY_START_FAILED") + if "activity not started" in output.lower(): + raise ControlError("Android handed the start request to an existing DroidDeck task instead of starting it: " + + output.strip(), "ACTIVITY_START_FAILED") def confirm_start(adb: str, serial: str, request: dict, previous: dict) -> dict: @@ -563,7 +571,7 @@ def unpack_logs(archive: Path, destination: Path, session_id: str) -> None: def require_commands(adb: str, serial: str) -> dict: access = checked(provider_call(adb, serial, "access"), "ACCESS_FAILED") if access.get("commands") is not True: - raise ControlError("Debugging tools are off: turn on Setup > Diagnostics > Debugging tools on the device", + raise ControlError("Debugging tools are off: turn on Setup > Developer > Debugging tools on the device", "AGENT_COMMANDS_DISABLED") return access @@ -781,6 +789,28 @@ def execute(args: argparse.Namespace, adb: str, serial: str) -> dict: f"{(response.get('stderr') or {}).get('text', '')[-400:]}", "GUEST_EXIT") return add_serial(response, serial) + if command == "native": + argv = args.argv[1:] if args.argv[:1] == ["--"] else args.argv + if not argv: + raise ControlError("native needs a command after --", "INVALID_ARGUMENTS") + if not 0 < args.timeout <= 600: + raise ControlError("--timeout must be more than 0 and at most 600 seconds", "INVALID_ARGUMENTS") + env = {} + for item in args.env or []: + key, sep, value = item.partition("=") + if not sep: + raise ControlError(f"--env takes KEY=VALUE, not {item}", "INVALID_ARGUMENTS") + env[key] = value + request = {"argv": argv, "timeout": args.timeout, "env": env} + if args.cwd: + request["cwd"] = args.cwd + if args.stdin is not None: + request["stdin"] = args.stdin + if args.preload: + request["preload"] = args.preload + response = checked(provider_call(adb, serial, "native", request=request, timeout=args.timeout + 40), "NATIVE_FAILED") + return add_serial(response, serial) + if command == "cdp": if args.cdp_op == "targets": request = {"op": "targets"} @@ -1015,6 +1045,14 @@ def build_parser() -> argparse.ArgumentParser: guest.add_argument("--check", action="store_true", help="fail unless the command exits 0") guest.add_argument("argv", nargs=argparse.REMAINDER) + native = commands.add_parser("native", help="run a command in the rootfs without proot (debugging tools)") + native.add_argument("--timeout", type=float, default=30) + native.add_argument("--env", action="append", metavar="KEY=VALUE") + native.add_argument("--cwd") + native.add_argument("--stdin") + native.add_argument("--preload", action="append", help="guest path of another library to preload before the hook") + native.add_argument("argv", nargs=argparse.REMAINDER) + cdp = commands.add_parser("cdp", help="the Steam client's DevTools (debugging tools)") cdp_ops = cdp.add_subparsers(dest="cdp_op", required=True) cdp_ops.add_parser("targets", help="list DevTools targets") diff --git a/tools/linuxfs/overlay/usr/local/bin/droiddeck-battlenet b/tools/linuxfs/overlay/usr/local/bin/droiddeck-battlenet index 1ea487e873..b43bd25a6f 100755 --- a/tools/linuxfs/overlay/usr/local/bin/droiddeck-battlenet +++ b/tools/linuxfs/overlay/usr/local/bin/droiddeck-battlenet @@ -41,6 +41,9 @@ FEX_WAIT = 120 START_GRACE = 90 POLL = 2 STOP_WAIT = 5 +DRIVES = "defghijklmnopqruvwxy" +PRODUCT_DB = ("ProgramData", "Battle.net", "Agent", "product.db") +INSTALL_FOLDER = (1, 3, 1) CLOSE_GRACE = 15 HANDOFF_WAIT = 120 GAME_SETTLE = 20 @@ -85,6 +88,8 @@ COUNTRY = re.compile(r"[A-Z]{3}") REGION = re.compile(r"[A-Z]{2}") REPORT = "BNET" ETA_LIMIT = 30 * 86400 +STALL = 600 +MOVING = ("download_current", "download_total", "progress", "playable_progress", "state", "phase", "paused", "error") DONE_STATE = 1004 REPORTED = ("progress", "playable_progress", "download_rate", "download_remaining", "estimated_time_in_sec", "state", "playable", "paused", "download_complete", "installed", "error") @@ -115,6 +120,12 @@ function field(text, name) { return m ? m[1] : ""; } +function job(text) { + if (/"error"\s*:\s*[1-9]/.test(text)) return false; + var bare = text.replace(/"extended_status"\s*:\s*\{[^}]*\}/, ""); + return /"state"\s*:\s*\d+/.test(bare) || /"download_current"\s*:/.test(bare); +} + function install() { // Blizzard's China repository moved to cn.patch.battlenet.com.cn; cn.patch.battle.net only redirects away from it. var patch = zone == "cn" ? "cn.patch.battlenet.com.cn" : zone + ".patch.battle.net"; @@ -123,7 +134,7 @@ function install() { save(".form", form); if (form.indexOf('"' + lang + '"') < 0) lang = "enUS"; var locale = lang.toLowerCase(); - call("POST", "/install/" + uid, '{"account_country":"' + country + '","finalized":true,"game_dir":"' + dir + '","geo_ip_country":"' + + call("POST", "/install/" + uid, '{"account_country":"' + country + '","finalized":true,"game_dir":"' + dir.replace(/\\/g, "\\\\").replace(/"/g, '\\"') + '","geo_ip_country":"' + region + '","language":["' + locale + '"],"selected_asset_locale":"' + locale + '","selected_locale":"' + locale + '","shortcut":"none","tome_torrent":""}'); watch("/install/" + uid); @@ -137,7 +148,7 @@ function watch(path) { if (/"error"\s*:\s*[1-9]/.test(s)) break; var state = /"state"\s*:\s*(\d+)/.exec(s.replace(/"extended_status"\s*:\s*\{[^}]*\}/, "")), complete = /"download_complete"\s*:\s*true/.test(s); state = state ? +state[1] : 0; - if (state == 1000 || state == 1003 || !complete) started = true; + if (state == 1000 || state == 1003 || job(s) && !complete) started = true; if (started && (state == 1004 || complete && /"playable"\s*:\s*true/.test(s))) break; if (!started && state == 1004 && i >= 20) break; if (!started && i >= 180) { @@ -226,8 +237,72 @@ def installed(root): return os.path.isfile(launcher(root)) -def install_path(library): - return "Z:" + library.rstrip("/") +def dosdevices(root): + return os.path.join(prefix(root), "pfx", "dosdevices") + + +def volume_root(path): + device = os.stat(path).st_dev + while path != "/": + parent = os.path.dirname(path) + if os.stat(parent).st_dev != device: + break + path = parent + return path + + +def inside(path, folder): + return path == folder or path.startswith(folder.rstrip("/") + "/") + + +def mapped_drive(root, path, volume): + folder = dosdevices(root) + try: + names = sorted(os.listdir(folder)) + except OSError: + return None + for name in names: + link = os.path.join(folder, name) + if len(name) == 2 and name[0].lower() in DRIVES and name[1] == ":" and os.path.islink(link): + target = os.path.realpath(link) + if inside(target, volume) and inside(path, target): + return name[0].lower(), target + return None + + +def map_drive(root, volume): + folder = dosdevices(root) + for letter in DRIVES: + link = os.path.join(folder, letter + ":") + if not os.path.lexists(link): + try: + os.makedirs(folder, exist_ok=True) + os.symlink(volume, link) + except OSError as error: + say("%s not mapped to a Wine drive: %s" % (volume, error)) + return None + say("Wine drive %s: is %s" % (letter.upper(), volume)) + return letter, volume + say("%s not mapped to a Wine drive: every letter is taken" % volume) + return None + + +def install_path(root, library): + library = library.rstrip("/") or "/" + try: + path = os.path.realpath(library) + volume = volume_root(path) + except OSError: + return "Z:" + library + if volume == "/": + return "Z:" + library + drive = mapped_drive(root, path, volume) + if drive is None and not wine_processes(os.path.join(prefix(root), "pfx")): + drive = map_drive(root, volume) + if drive is None: + return "Z:" + library + letter, target = drive + return letter.upper() + ":\\" + path[len(target):].strip("/").replace("/", "\\") def write_config(root, library=None): @@ -254,8 +329,8 @@ def write_config(root, library=None): client["HardwareAcceleration"] = "false" changes.append("acceleration") if library and isinstance(client.setdefault("Install", {}), dict) \ - and str(client["Install"].get("DefaultInstallPath", "")).rstrip("/\\") != install_path(library): - client["Install"]["DefaultInstallPath"] = install_path(library) + and str(client["Install"].get("DefaultInstallPath", "")).rstrip("/\\") != install_path(root, library).rstrip("\\"): + client["Install"]["DefaultInstallPath"] = install_path(root, library) changes.append("library") games = config.setdefault("Games", {}) for uid in CLIENT_32_BIT if isinstance(games, dict) else (): @@ -417,13 +492,106 @@ def wallpaper(root): def windows_path(root, path): - found = re.match(r"(?i)^([cz]):[\\/](.*)$", path.strip()) + found = re.match(r"(?i)^([a-z]):[\\/](.*)$", path.strip()) if not found: return None parts = [part for part in re.split(r"[\\/]+", found.group(2)) if part] - if not parts or ".." in parts: + if ".." in parts: return None - return os.path.join(drive_c(root) if found.group(1).lower() == "c" else "/", *parts) + letter = found.group(1).lower() + link = os.path.join(dosdevices(root), letter + ":") + if letter == "c": + target = drive_c(root) + elif os.path.islink(link): + target = os.path.realpath(link) + elif letter == "z": + target = "/" + else: + return None + return os.path.join(target, *parts) + + +def varint(data, at): + value = shift = 0 + while at < len(data) and shift < 64: + byte = data[at] + at += 1 + value |= (byte & 0x7F) << shift + if not byte & 0x80: + return value, at + shift += 7 + raise ValueError("varint") + + +def encode_varint(value): + out = bytearray() + while value > 0x7F: + out.append(value & 0x7F | 0x80) + value >>= 7 + out.append(value) + return bytes(out) + + +def rewrite_field(data, path, change): + out, at = bytearray(), 0 + while at < len(data): + start = at + tag, at = varint(data, at) + kind = tag & 7 + if kind == 0: + at = varint(data, at)[1] + elif kind == 1: + at += 8 + elif kind == 5: + at += 4 + elif kind == 2: + size, body = varint(data, at) + at = body + size + else: + raise ValueError("wire type") + if at > len(data): + raise ValueError("length") + if kind == 2 and tag >> 3 == path[0]: + value = data[body:at] + value = change(value) if len(path) == 1 else rewrite_field(value, path[1:], change) + out += encode_varint(tag) + encode_varint(len(value)) + value + else: + out += data[start:at] + return bytes(out) + + +def drive_folder(root, value): + try: + text = value.decode("utf-8") + except UnicodeDecodeError: + return value + if not re.match(r"(?i)^z:[\\/]", text): + return value + folder = windows_path(root, text) + if not folder or not os.path.isdir(folder): + return value + moved = install_path(root, folder) + return value if moved.startswith("Z:") else moved.replace("\\", "/").encode("utf-8") + + +def move_installs(root): + path = os.path.join(drive_c(root), *PRODUCT_DB) + try: + with open(path, "rb") as f: + data = f.read() + moved = rewrite_field(data, INSTALL_FOLDER, lambda value: drive_folder(root, value)) + if moved == data or wine_processes(os.path.join(prefix(root), "pfx")): + return False + with open(path, "rb") as f: + if f.read() != data: + return False + except (OSError, ValueError): + return False + with open(path + ".tmp", "wb") as f: + f.write(moved) + shutil.copymode(path, path + ".tmp") + os.replace(path + ".tmp", path) + return True def wow_folders(root): @@ -533,6 +701,11 @@ def configure(root, library=None): except OSError as error: say("Battle.net's config not written: %s" % error) return + try: + if move_installs(root): + say("Battle.net's installed games on a mapped volume now use its Wine drive") + except OSError as error: + say("Battle.net's installed games not moved to their Wine drive: %s" % error) try: wallpaper(root) except OSError as error: @@ -1211,7 +1384,7 @@ def summary(status): return out -def agent_job(root, action, uid, product="", folder="", locale="enUS", country="USA", region="US", poll=None, wait=None): +def agent_job(root, action, uid, product="", folder="", locale="enUS", country="USA", region="US", poll=None, wait=None, stall=None): pfx = os.path.join(prefix(root), "pfx") if not installed(root) or agent_exe(root) is None: emit("ERROR", "client") @@ -1227,7 +1400,6 @@ def agent_job(root, action, uid, product="", folder="", locale="enUS", country=" say("%s not made: %s" % (folder, error)) emit("ERROR", "folder") return 2 - windows = "Z:" + folder told = None while True: processes = wine_processes(pfx) @@ -1244,6 +1416,8 @@ def agent_job(root, action, uid, product="", folder="", locale="enUS", country=" time.sleep(POLL if poll is None else poll) with lock: stop_leftovers(pfx) + if action == "install": + windows = install_path(root, folder) emit("STATE", "starting") base = os.path.join(CACHE, "agent-%s" % uid) for suffix in (".json", ".game", ".form", ".error"): @@ -1266,6 +1440,7 @@ def agent_job(root, action, uid, product="", folder="", locale="enUS", country=" os.replace(output, output + ".1") except OSError: pass + before = {pid for pid, _ in wine_processes(pfx)} with open(output, "ab") as log: try: child = subprocess.Popen(cmd, stdin=subprocess.DEVNULL, stdout=log, stderr=log, env=env) @@ -1273,6 +1448,9 @@ def agent_job(root, action, uid, product="", folder="", locale="enUS", country=" emit("ERROR", "stopped gamescope: %s" % error) return 1 seen = None + mark = None + moved = time.monotonic() + stalled = False while True: done = child.poll() is not None status = read_status(base + ".json") @@ -1281,12 +1459,27 @@ def agent_job(root, action, uid, product="", folder="", locale="enUS", country=" if brief != seen: emit("PROGRESS", json.dumps(brief, sort_keys=True)) seen = brief + signature = tuple(brief.get(key) for key in MOVING) + if signature != mark: + mark = signature + moved = time.monotonic() if done: break + if action != "uninstall" and time.monotonic() - moved > (STALL if stall is None else stall): + say("the %s of %s made no progress for %d s; stopping it" % (action, uid, STALL if stall is None else stall)) + stalled = True + child.kill() + child.wait() + break time.sleep(POLL if poll is None else poll) leftovers = wine_processes(pfx) if leftovers and idle(leftovers): stop(leftovers) + elif stalled: + stop([(pid, argv) for pid, argv in leftovers if pid not in before and program(argv) == AGENT]) + if stalled: + emit("ERROR", "stalled") + return 6 answer = read_status(base + ".game") game = answer or {} status = read_status(base + ".json") or {} diff --git a/tools/linuxfs/overlay/usr/local/bin/droiddeck-epic b/tools/linuxfs/overlay/usr/local/bin/droiddeck-epic index 6f95cabe42..34dea7de31 100644 --- a/tools/linuxfs/overlay/usr/local/bin/droiddeck-epic +++ b/tools/linuxfs/overlay/usr/local/bin/droiddeck-epic @@ -4,7 +4,6 @@ import collections import fcntl import filecmp import http.client -import io import json import os import re @@ -72,6 +71,14 @@ APP_ID = "com.epicgames.eglv2" DBUS_NAME = APP_ID + ".SingleInstance" DBUS_PATH = "/" + APP_ID.replace(".", "/") + "/SingleInstance" DBUS_METHOD = "org.SingleInstance.DBus.ExecuteCallback" +APP_BIN = "usr/bin/EpicGamesLauncher" +DEB_ICON = "usr/share/icons/hicolor/256x256@2/apps/EpicGamesLauncher.png" +ICON = "epic-games-launcher.png" +DESKTOP = "desktop" +DESKTOP_KEEP = ("usr/lib/x86_64-linux-gnu/", "usr/share/glib-2.0/schemas/") +DESKTOP_LIB = DESKTOP + "/usr/lib/x86_64-linux-gnu" +WEBKIT_DIR = "webkit2gtk-4.1" +WEBKIT_LIB = "libwebkit2gtk-4.1.so.0" SKIPPED = ("lib/i386-linux-gnu", "lib32", "libx32", "i686-pc-linux-gnu", "share/doc", "include") SETTINGS_SEED = { "minimizeToTray": False, @@ -254,6 +261,35 @@ def inside(root, path): return real == root or real.startswith(root + os.sep) +def unpack_member(archive, member, staging, root, name, link): + target = os.path.join(staging, name) + if not inside(root, os.path.dirname(target)): + return False + if member.isdir(): + os.makedirs(target, exist_ok=True) + return False + os.makedirs(os.path.dirname(target), exist_ok=True) + if not inside(root, os.path.dirname(target)): + return False + if member.issym(): + remove(target) + os.symlink(link(target, member.linkname), target) + elif member.islnk(): + source = safe_name(member.linkname) + source = os.path.join(staging, source) if source else None + if source and os.path.isfile(source) and inside(root, source): + remove(target) + shutil.copy2(source, target) + elif member.isfile(): + remove(target) + with archive.extractfile(member) as src, open(target, "wb") as out: + shutil.copyfileobj(src, out, 1 << 20) + os.chmod(target, (member.mode & 0o777) | 0o600) + else: + return False + return True + + def extract_runtime(tarball, dest): staging = dest + ".staging" remove(staging) @@ -271,32 +307,12 @@ def extract_runtime(tarball, dest): continue if top == "files" and rest and skipped(rest): continue - target = os.path.join(staging, name) - if not inside(root, os.path.dirname(target)): - continue - if member.isdir(): - os.makedirs(target, exist_ok=True) - continue - os.makedirs(os.path.dirname(target), exist_ok=True) - if not inside(root, os.path.dirname(target)): - continue - if member.issym(): - remove(target) - os.symlink(rooted_link(files_root, target, member.linkname) if top == "files" else member.linkname, target) - elif member.islnk(): - source = safe_name(member.linkname) - source = os.path.join(staging, source) if source else None - if source and os.path.isfile(source) and inside(root, source): - remove(target) - shutil.copy2(source, target) - elif member.isfile(): - remove(target) - with archive.extractfile(member) as src, open(target, "wb") as out: - shutil.copyfileobj(src, out, 1 << 20) - os.chmod(target, (member.mode & 0o777) | 0o600) + if top == "files": + link = lambda target, linkname: rooted_link(files_root, target, linkname) else: - continue - count += 1 + link = lambda target, linkname: linkname + if unpack_member(archive, member, staging, root, name, link): + count += 1 if not os.path.isfile(os.path.join(files_root, "lib", "x86_64-linux-gnu", "libc.so.6")) and \ not os.path.islink(os.path.join(files_root, "lib", "x86_64-linux-gnu", "libc.so.6")): remove(staging) @@ -306,63 +322,129 @@ def extract_runtime(tarball, dest): return staging, count -def ar_members(path): +@contextlib.contextmanager +def deb_data(path, reason): with open(path, "rb") as f: if f.read(8) != b"!\n": - raise Failure("gles-format") + raise Failure(reason) while True: header = f.read(60) if len(header) < 60: - return + raise Failure(reason) name = header[:16].decode("ascii", "replace").strip().rstrip("/") size = int(header[48:58].decode("ascii").strip()) - data = f.read(size) - if size % 2: - f.read(1) - yield name, data + if name.startswith("data.tar"): + with tarfile.open(fileobj=f, mode="r|*") as archive: + yield archive + return + f.seek(size + size % 2, os.SEEK_CUR) + + +def is_deb(path): + try: + with open(path, "rb") as f: + return f.read(21) == b"!\ndebian-binary" + except OSError: + return False def install_gles(deb, files_root): libdir = os.path.join(files_root, "lib", "x86_64-linux-gnu") os.makedirs(libdir, exist_ok=True) - for name, data in ar_members(deb): - if not name.startswith("data.tar"): - continue - with tarfile.open(fileobj=io.BytesIO(data), mode="r:*") as archive: - for member in archive: - base = os.path.basename(member.name) - if not base.startswith("libGLESv2.so"): - continue - target = os.path.join(libdir, base) - remove(target) - if member.issym(): - os.symlink(os.path.basename(member.linkname), target) - elif member.isfile(): - with archive.extractfile(member) as src, open(target, "wb") as out: - shutil.copyfileobj(src, out) - os.chmod(target, 0o644) - if os.path.exists(os.path.join(libdir, "libGLESv2.so.2")): - return - raise Failure("gles-missing") + with deb_data(deb, "gles-format") as archive: + for member in archive: + base = os.path.basename(member.name) + if not base.startswith("libGLESv2.so"): + continue + target = os.path.join(libdir, base) + remove(target) + if member.issym(): + os.symlink(os.path.basename(member.linkname), target) + elif member.isfile(): + with archive.extractfile(member) as src, open(target, "wb") as out: + shutil.copyfileobj(src, out) + os.chmod(target, 0o644) + if not os.path.exists(os.path.join(libdir, "libGLESv2.so.2")): + raise Failure("gles-missing") -def extract_app(image, dest): +def extract_deb(deb, dest, wanted=None): + root = os.path.realpath(dest) + + def link(target, linkname): + if not linkname.startswith("/"): + return linkname + return os.path.relpath(os.path.join(dest, linkname.lstrip("/")), os.path.dirname(target)) + + count = 0 + with deb_data(deb, "app-format") as archive: + for member in archive: + name = safe_name(member.name) + if name is None or (wanted is not None and not wanted(name)): + continue + if unpack_member(archive, member, dest, root, name, link): + count += 1 + return count + + +def extract_app(image, dest, desktop=()): staging = dest + ".staging" remove(staging) os.makedirs(staging) - status = subprocess.call([os.path.join(BIN_DIR, "droiddeck-fex"), "extract", os.path.abspath(image)], - cwd=staging, stdout=subprocess.DEVNULL) - root = os.path.realpath(os.path.join(staging, "squashfs-root")) - if status != 0 or not app_complete(root): + try: + if not is_deb(image): + raise Failure("app-format") + extract_deb(image, staging) + layer = os.path.join(staging, DESKTOP) + if not inside(os.path.realpath(staging), layer): + raise Failure("app-extract") + os.makedirs(layer, exist_ok=True) + for package in desktop: + if not is_deb(package): + raise Failure("desktop-format") + extract_deb(package, layer, lambda name: any(name.startswith(prefix) for prefix in DESKTOP_KEEP)) + icon = os.path.join(staging, DEB_ICON) + if os.path.isfile(icon): + remove(os.path.join(staging, ICON)) + shutil.copyfile(icon, os.path.join(staging, ICON)) + if not app_complete(staging): + raise Failure("app-extract") + except Exception: remove(staging) - raise Failure("app-extract") + raise remove(dest) - os.rename(root, dest) - remove(staging) + os.rename(staging, dest) def app_complete(root): - return os.path.isfile(os.path.join(root, "AppRun")) and os.path.isfile(os.path.join(root, "usr", "bin", "EpicGamesLauncher")) + if not os.path.isfile(os.path.join(root, APP_BIN)): + return False + return os.path.isfile(os.path.join(root, "AppRun")) or os.path.isfile(os.path.join(root, DESKTOP_LIB, WEBKIT_LIB)) + + +def app_command(app_dir): + apprun = os.path.join(app_dir, "AppRun") + return apprun if os.path.isfile(apprun) else os.path.join(app_dir, APP_BIN) + + +def desktop_libs(app_dir): + path = os.path.join(app_dir, DESKTOP_LIB) + return path if os.path.isdir(path) else None + + +def link_webkit(files, libs): + target = os.path.join(files, "lib", "x86_64-linux-gnu", WEBKIT_DIR) + if os.path.isdir(target) and not os.path.islink(target): + return + source = os.path.join(libs, WEBKIT_DIR) if libs else None + if source is None or not os.path.isdir(source): + remove(target) + return + link = os.path.relpath(source, os.path.dirname(target)) + if os.path.islink(target) and os.readlink(target) == link: + return + remove(target) + os.symlink(link, target) def ready(path): @@ -396,8 +478,11 @@ def install(options): image = options.get("app") if not image or not os.path.isfile(image): raise Failure("no-app-image") - say("unpacking the Epic Games Launcher %s" % app) - extract_app(image, app_dir) + desktop = options.get("desktop") or [] + if not all(os.path.isfile(package) for package in desktop): + raise Failure("no-desktop-package") + say("unpacking the Epic Games Launcher %s (%d desktop packages)" % (app, len(desktop))) + extract_app(image, app_dir, desktop) mark_ready(app_dir) if not ready(runtime_dir): tarball, deb = options.get("runtime"), options.get("gles") @@ -729,11 +814,16 @@ def fex_environment(fex, files, env): return result -def client_environment(base, fex, files, display, bus, broker, a11y=None, hidden=False): +def client_environment(base, fex, files, display, bus, broker, a11y=None, hidden=False, libs=None): env = {name: base[name] for name in KEPT_ENV if base.get(name)} env.setdefault("HOME", HOME) env.setdefault("LANG", "C.UTF-8") env["PATH"] = SHIMS + ":/usr/bin:/bin" + if libs: + env["LD_LIBRARY_PATH"] = libs + data = os.path.normpath(os.path.join(os.path.dirname(libs), "..", "share")) + env["XDG_DATA_DIRS"] = data + ":/usr/local/share:/usr/share" + env["GSETTINGS_SCHEMA_DIR"] = os.path.join(data, "glib-2.0", "schemas") env["DISPLAY"] = display env["DBUS_SESSION_BUS_ADDRESS"] = bus env[BROKER_ENV] = broker @@ -1238,6 +1328,8 @@ class Session: seed_settings() install_shims() install_preload(files) + libs = desktop_libs(app_dir) + link_webkit(files, libs) fex_module()["install_fonts"](files) clear_playing() sync_installations() @@ -1254,8 +1346,8 @@ class Session: path = broker_path() self.broker = Broker(path, self.mode, base) write_json(instance_file(), {"pid": os.getpid(), "mode": self.mode, "bus": bus, "broker": path}) - env = client_environment(base, fex, files, display, bus, path, self.a11y, hidden=self.mode == "hidden") - self.command = [fex["bin"], os.path.join(app_dir, "AppRun")] + env = client_environment(base, fex, files, display, bus, path, self.a11y, hidden=self.mode == "hidden", libs=libs) + self.command = [fex["bin"], app_command(app_dir)] self.env = env say("starting the Epic Games Launcher %s (%s, display %s)" % (current.get("app"), self.mode, display)) self.start_client() @@ -1471,12 +1563,14 @@ def forward(bus, url): return False -def parse_options(args, flags=()): +def parse_options(args, flags=(), lists=()): options, rest = {}, [] while args: arg = args.pop(0) if arg.startswith("--") and arg[2:] in flags: options[arg[2:]] = True + elif arg.startswith("--") and arg[2:] in lists and args: + options.setdefault(arg[2:], []).append(args.pop(0)) elif arg.startswith("--") and args: options[arg[2:]] = args.pop(0) else: @@ -1830,7 +1924,7 @@ def main(argv): if action == "xdg-open": return shim_open(args) if action == "install": - options, _ = parse_options(args) + options, _ = parse_options(args, lists=("desktop",)) try: return install(options) except (ValueError, tarfile.TarError, OSError) as error: diff --git a/tools/linuxfs/overlay/usr/local/bin/droiddeck-game-env b/tools/linuxfs/overlay/usr/local/bin/droiddeck-game-env index 5ed1f7f11d..bbe3c868d7 100755 --- a/tools/linuxfs/overlay/usr/local/bin/droiddeck-game-env +++ b/tools/linuxfs/overlay/usr/local/bin/droiddeck-game-env @@ -10,24 +10,46 @@ import sys import tempfile from pathlib import Path -GAME_TU_DEBUG = "DROIDDECK_GAME_TU_DEBUG" +GAME_PREFIX = "DROIDDECK_GAME_" +GAME_SPLIT_KEYS = ("TU_DEBUG", "MESA_NO_ERROR") CHROMIUM_FILES = {"chrome-sandbox", "chrome_100_percent.pak", "v8_context_snapshot.bin"} +D3D9_DEFAULT_MEMORY_MB = 4096 SYNC_KEYS = ("BL_SYNC", "BL_SYNC_FALLBACK", "BL_FSYNC_FIRST", "BL_SYNC_MIN_NOFILE", "PROTON_NO_ESYNC", "PROTON_NO_FSYNC", "PROTON_NO_NTSYNC", "WINEESYNC") SEED_REDISTS = "/usr/local/bin/droiddeck-seed-redists" PACK_KEYS = ("WINESERVER", "BL_SYNC_PACK", "WINEESYNC", "PROTON_NO_ESYNC", "PROTON_NO_FSYNC") +# Prefixes several games share; the game itself is the Steam app being launched. +SHARED_PREFIXES = {"2929927072"} + + +def app_number(value): + if not re.fullmatch(r"-?[0-9]+", value or ""): + return None + number = int(value) + if not -(2**31) <= number < 2**32 or number == 0: + return None + return str(number % 2**32) + + def game_id(env): prefix = env.get("STEAM_COMPAT_DATA_PATH", "").rstrip("/") if not prefix: return None - value = prefix.rsplit("/", 1)[-1] - if not re.fullmatch(r"-?[0-9]+", value): + found = app_number(prefix.rsplit("/", 1)[-1]) + if found in SHARED_PREFIXES: + return app_number(env.get("SteamAppId", "")) or shortcut_number(env.get("SteamGameId", "")) or found + return found + + +def shortcut_number(value): + """The shortcut appid inside Steam's 64-bit shortcut game id `(appid << 32) | 0x02000000`.""" + if not re.fullmatch(r"[0-9]{1,20}", value or ""): return None number = int(value) - if not -(2**31) <= number < 2**32 or number == 0: + if number >= 2**64 or number & 0xFFFFFFFF != 0x02000000: return None - return str(number % 2**32) + return app_number(str(number >> 32)) DOTNET_FEX = { @@ -124,6 +146,12 @@ def deep_rock_gdk_raytracing(game): return {}, ["-noraytracing", "-ini:Engine:[/Script/Engine.RendererSettings]:r.RayTracing=False"], "Deep Rock Galactic GDK: ray tracing off (D3D12 pipeline creation fails on Thor)" +@fix +def ff7_rebirth_feature_level(game): + if game.stem in ("ff7rebirth", "ff7rebirth_"): + return {"VKD3D_FEATURE_LEVEL": "12_2"}, [], "Final Fantasy VII Rebirth: D3D12 feature level 12_2 (the device-reported level fails its DX12 check)" + + @fix def arkham_city_x87(game): if "batmanac.exe" in game.files: @@ -358,16 +386,19 @@ def chromium_app(folder): def game_gpu(env, keep=False): - if GAME_TU_DEBUG not in env: + if not any(GAME_PREFIX + key in env for key in GAME_SPLIT_KEYS): return env result = env.copy() - value = result.pop(GAME_TU_DEBUG) - if keep: - return result - if value: - result["TU_DEBUG"] = value - else: - result.pop("TU_DEBUG", None) + for key in GAME_SPLIT_KEYS: + if GAME_PREFIX + key not in result: + continue + value = result.pop(GAME_PREFIX + key) + if keep: + continue + if value: + result[key] = value + else: + result.pop(key, None) return result @@ -376,7 +407,9 @@ def vram_cap(env): if not re.fullmatch(r"[1-9][0-9]{0,6}", value): return env result = env.copy() - cap = "dxgi.maxDeviceMemory = %d" % int(value) + cap = "dxgi.maxDeviceMemory = {0}; dxgi.maxSharedMemory = {0}".format(int(value)) + if int(value) < D3D9_DEFAULT_MEMORY_MB: + cap += "; d3d9.maxAvailableMemory = {0}".format(int(value)) own = result.get("DXVK_CONFIG", "").strip().strip(";").strip() result["DXVK_CONFIG"] = cap + "; " + own if own else cap result["DROIDDECK_VRAM_CAP"] = "1" @@ -1250,6 +1283,10 @@ def main(): if scripts and install_scripts_done(scripts, env): print("droiddeck-game-env: install scripts already run in this prefix; evaluator skipped", file=sys.stderr) return 0 + if scripts and not env.get("DBUS_SESSION_BUS_ADDRESS"): + # libdbus would autolaunch a session bus under the evaluator's reaper, which then waits for it + # forever: Steam keeps seeing the app as running and cannot move or update it + env["DBUS_SESSION_BUS_ADDRESS"] = "disabled:" try: digest = scripts_digest(scripts) if scripts else None except OSError: diff --git a/tools/linuxfs/overlay/usr/local/bin/droiddeck-open b/tools/linuxfs/overlay/usr/local/bin/droiddeck-open index bf0aaff7c1..d39942a2cc 100644 --- a/tools/linuxfs/overlay/usr/local/bin/droiddeck-open +++ b/tools/linuxfs/overlay/usr/local/bin/droiddeck-open @@ -17,6 +17,7 @@ PROTON_RUN = os.path.join(BIN, "droiddeck-proton-run") APPIMAGE_RUN = os.path.join(BIN, "droiddeck-appimage-run") SCRIPT_RUN = os.path.join(BIN, "droiddeck-script-run") STEAM_LAUNCH = os.path.join(BIN, "droiddeck-steam-launch") +STORE_LAUNCH = os.path.join(BIN, "droiddeck-store-launch") PROGRAMS = os.path.join(BIN, "droiddeck-desktop-programs") CACHE = os.path.join(HOME, ".cache", "droiddeck") IMPORTS = {"appimage": ("/opt/appimages/user", "app"), "folder": ("/opt/droiddeck-apps", "entry")} @@ -272,12 +273,32 @@ def steam_title(path): return None +def exe_prefix(path): + try: + run = runpy.run_path(PROTON_RUN) + root = os.environ.get("STEAM_COMPAT_CLIENT_INSTALL_PATH") or run["STEAM_ROOT"] + target = run["locate"](path, root) + return ["--prefix", target.appid, "--compatdata", target.compatdata] + except (OSError, ValueError, KeyError, IndexError): + return None + + +def store_launcher(path): + try: + return runpy.run_path(STORE_LAUNCH)["store_launcher"](path) + except (OSError, ValueError, KeyError): + return None + + def command(path, args, what, window=False, appid=None): folder = os.path.dirname(path) if what == "steam": return [STEAM_LAUNCH, "desktop", appid], folder if what == "windows": - return [PROTON_RUN] + (["--window"] if window else []) + [path] + args, folder + launcher = None if args else store_launcher(path) + prefix = exe_prefix(path) if launcher else None + keep = prefix or [] + return [PROTON_RUN] + (["--window"] if window else []) + keep + [launcher or path] + args, folder if what == "x86 script": return [FEX, "run", "--mode", "on", "--for", folder, "--"] + interpreter(path) + [path] + args, folder if what == "script": diff --git a/tools/linuxfs/overlay/usr/local/bin/droiddeck-pace-cores b/tools/linuxfs/overlay/usr/local/bin/droiddeck-pace-cores new file mode 100755 index 0000000000..0b1c62f7c9 --- /dev/null +++ b/tools/linuxfs/overlay/usr/local/bin/droiddeck-pace-cores @@ -0,0 +1,266 @@ +#!/usr/bin/python3 +import os +import signal +import struct +import sys +import time +from pathlib import Path + +MAGIC = 0x46484444 +HEADER = 128 +POLL = 0.5 +SETTLE = 3.0 +WINDOW = 1.0 +LATE = 1.5 +PACED_LATE_SHARE = 0.02 +RELEASE_LATE_SHARE = 0.05 +SLOWER = 1.04 +MAX_INTERVAL = 1e9 / 30 +SPREAD = 0.08 +BACKOFF = 30.0 +BACKOFF_MAX = 600.0 + + +def log(message): + print("droiddeck-pace-cores: " + message, flush=True) + + +def parse_cores(text): + cores = set() + for part in text.strip().split(","): + if not part: + continue + first, _, last = part.partition("-") + cores.update(range(int(first), int(last or first) + 1)) + return cores + + +def efficient_cores(cpu=Path("/sys/devices/system/cpu"), own=None): + try: + online = parse_cores((cpu / "online").read_text()) + except (OSError, ValueError): + online = set(range(os.cpu_count() or 0)) + online &= own if own is not None else os.sched_getaffinity(0) + for name in ("cpu_capacity", "cpufreq/cpuinfo_max_freq"): + try: + speed = {core: int((cpu / f"cpu{core}/{name}").read_text()) for core in online} + except (OSError, ValueError): + continue + top = max(speed.values(), default=0) + return {core for core, value in speed.items() if value < top} + return set() + + +class Frames: + """gamescope's per-frame feed for the HUD: frame intervals of the focused app, its pid and whether Steam is in front.""" + + def __init__(self, path): + self.path = Path(path) + self.count = None + + def read(self): + try: + data = self.path.read_bytes() + except OSError: + return None + if len(data) < HEADER or struct.unpack_from(" LATE * period) / len(intervals) + + +def paced_interval(intervals): + """The interval of a game a cap holds at 30 fps or more; a starved or uncapped game spreads.""" + if len(intervals) < 2: + return None + ordered = sorted(intervals) + held = ordered[len(ordered) // 2] + if held > 1.04 * MAX_INTERVAL: + return None + if ordered[len(ordered) // 10] < (1 - SPREAD) * held or ordered[len(ordered) * 9 // 10] > (1 + SPREAD) * held: + return None + if late_share(intervals, held) > PACED_LATE_SHARE: + return None + return held + + +class Cores: + + def get(self, tid): + return os.sched_getaffinity(tid) + + def set(self, tid, cpus): + os.sched_setaffinity(tid, cpus) + + +class Parker: + """Keeps one process's threads off the fastest cores and puts back what each had.""" + + def __init__(self, efficient, proc=Path("/proc"), cores=None): + self.efficient = efficient + self.proc = proc + self.cores = cores or Cores() + self.pid = None + self.before = {} + self.present = None + self.own = set() + + def tasks(self, pid): + try: + return [int(tid) for tid in os.listdir(self.proc / str(pid) / "task") if tid.isdigit()] + except OSError: + return [] + + def park(self, pid): + self.pid = pid + tids = self.tasks(pid) + if self.present is None: + self.present = set(tids) + masks = {} + for tid in tids: + if tid not in self.before: + try: + masks[tid] = self.cores.get(tid) + except OSError: + continue + # A mask the game gave one of its own threads may be passed on by it, not by a parked thread. + self.own.update(frozenset(now) for tid, now in masks.items() if tid in self.present) + inherited = {} + for before, parked in self.before.values(): + inherited[frozenset(parked)] = inherited.get(frozenset(parked), set()) | before + for tid, now in masks.items(): + try: + wanted = now & self.efficient + if wanted and wanted != now: + self.cores.set(tid, wanted) + self.before[tid] = (now, wanted) + elif tid not in self.present and frozenset(now) in inherited and frozenset(now) not in self.own: + self.before[tid] = (inherited[frozenset(now)], now) + except OSError: + continue + + def release(self): + for tid, (before, parked) in self.before.items(): + try: + if self.cores.get(tid) == parked: + self.cores.set(tid, before) + except OSError: + continue + self.pid = None + self.present = None + self.own.clear() + self.before.clear() + + +class Governor: + def __init__(self, frames, parker, clock=time.monotonic): + self.frames = frames + self.parker = parker + self.clock = clock + self.pid = None + self.window = [] + self.since = None + self.held = None + self.blocked = {} + + def tick(self): + read = self.frames.read() + if read is None: + return + pid, steam, intervals = read + now = self.clock() + if steam or not pid or pid != self.pid: + if self.parker.pid is not None: + self.release(now, "focus left the game", backoff=False) + self.pid = None if steam else pid + self.window, self.since = [], now + return + self.window.extend((now, value) for value in intervals) + if self.parker.pid is None and not intervals: + self.window, self.since = [], now + return + if self.parker.pid is None: + self.consider(now) + else: + self.watch(now) + + def consider(self, now): + self.window = [entry for entry in self.window if entry[0] >= now - SETTLE] + if now - self.since < SETTLE or now < self.blocked.get(self.pid, (0, 0))[0]: + return + intervals = [value for _, value in self.window] + if sum(intervals) < 0.9 * SETTLE * 1e9: + return + held = paced_interval(intervals) + if held is None: + return + self.held = held + self.parker.park(self.pid) + if self.parker.before: + self.window = [] + self.since = now + log(f"pid {self.pid} holds {1e9 / held:.0f} fps, {len(self.parker.before)} thread(s) off the fastest cores") + else: + self.parker.release() + + def watch(self, now): + self.parker.park(self.pid) + self.window = [entry for entry in self.window if entry[0] >= now - WINDOW] + intervals = [value for _, value in self.window] + if now - self.since < WINDOW: + return + if len(intervals) < 0.5 * WINDOW * 1e9 / self.held: + self.release(now, "frames stalled") + return + if late_share(intervals, self.held) > RELEASE_LATE_SHARE or median(intervals) > SLOWER * self.held: + self.release(now, "frames fell behind") + + def release(self, now, why, backoff=True): + pid = self.parker.pid + self.parker.release() + if backoff: + _, wait = self.blocked.get(pid, (0, BACKOFF / 2)) + wait = min(wait * 2, BACKOFF_MAX) + self.blocked[pid] = (now + wait, wait) + log(f"pid {pid} back on every core: {why}; not again for {wait:.0f} s") + else: + log(f"pid {pid} back on every core: {why}") + self.window, self.since = [], now + + def stop(self, *_): + self.parker.release() + sys.exit(0) + + +def main(argv): + if len(argv) != 1: + print("usage: droiddeck-pace-cores ", file=sys.stderr) + return 2 + efficient = efficient_cores() + if not efficient: + return 0 + governor = Governor(Frames(argv[0]), Parker(efficient)) + for sig in (signal.SIGTERM, signal.SIGHUP, signal.SIGINT): + signal.signal(sig, governor.stop) + while True: + governor.tick() + time.sleep(POLL) + + +if __name__ == "__main__": + sys.exit(main(sys.argv[1:])) diff --git a/tools/linuxfs/overlay/usr/local/bin/droiddeck-proton-run b/tools/linuxfs/overlay/usr/local/bin/droiddeck-proton-run index 164dbd0288..6dfcbadb25 100644 --- a/tools/linuxfs/overlay/usr/local/bin/droiddeck-proton-run +++ b/tools/linuxfs/overlay/usr/local/bin/droiddeck-proton-run @@ -315,8 +315,8 @@ def locate(program, root): os.path.dirname(program), root, "own") -def fixed(program, root, appid): - return Target(appid, os.path.join(root, "steamapps", "compatdata", str(appid)), +def fixed(program, root, appid, compatdata=None): + return Target(appid, compatdata or os.path.join(root, "steamapps", "compatdata", str(appid)), os.path.dirname(program), root, "fixed") @@ -451,6 +451,7 @@ def arguments(program, args, desktop=None, compatdata=None): def main(argv): window = False prefix = None + compatdata = None verb = VERB game_id = None desktop = None @@ -461,6 +462,8 @@ def main(argv): window = True elif option == "--prefix" and argv and prefix_id(argv[0]): prefix = argv.pop(0) + elif option == "--compatdata" and argv and os.path.isabs(argv[0]): + compatdata = argv.pop(0) elif option == "--verb" and argv and argv[0] in VERBS: verb = argv.pop(0) elif option == "--game-id" and argv and argv[0].isdigit() and argv[0] != "0": @@ -484,7 +487,7 @@ def main(argv): say("%s is not an app id" % app) return 2 if not argv and app is None: - say("usage: droiddeck-proton-run [--window] [--prefix ID] [--verb run] [--game-id ID] [--desktop WxH] PROGRAM [ARGS...]") + say("usage: droiddeck-proton-run [--window] [--prefix ID [--compatdata DIR]] [--verb run] [--game-id ID] [--desktop WxH] PROGRAM [ARGS...]") return 2 root = os.environ.get("STEAM_COMPAT_CLIENT_INSTALL_PATH") or STEAM_ROOT if options is None: @@ -509,7 +512,7 @@ def main(argv): if app is not None and int(app) >= STEAM_APP_LIMIT: target = shortcut_target(app, program, start, root) elif prefix: - target = fixed(program, root, prefix) + target = fixed(program, root, prefix, compatdata) else: target = locate(program, root) available = tools(root) diff --git a/tools/linuxfs/overlay/usr/local/bin/droiddeck-seed-redists b/tools/linuxfs/overlay/usr/local/bin/droiddeck-seed-redists index babcb86d3d..d2d2809bd3 100755 --- a/tools/linuxfs/overlay/usr/local/bin/droiddeck-seed-redists +++ b/tools/linuxfs/overlay/usr/local/bin/droiddeck-seed-redists @@ -56,18 +56,75 @@ libraries="$steam_root" for library in $LIBRARIES; do libraries="$libraries $library"; done libraries=$(printf '%s\n%s\n' "$libraries" "$(sed -n 's/^[[:space:]]*"path"[[:space:]]*"\(.*\)"[[:space:]]*$/\1/p' "$steam_root/steamapps/libraryfolders.vdf" 2>/dev/null)" | awk 'NF && !seen[$0]++') -sig=$(while IFS= read -r library; do ls -l --time-style=+%s "$library"/steamapps/appmanifest_*.acf 2>/dev/null; done <<<"$libraries" | cksum) -if [ "$(head -n 1 "$cache" 2>/dev/null)" != "$sig" ]; then - { - printf '%s\n' "$sig" - while IFS= read -r library; do - [ -d "$library/steamapps/common" ] || continue - find "$library/steamapps/common" -mindepth 2 -maxdepth 5 -iname 'installscript*.vdf' \ - -not -path '*/Steamworks Shared/*' 2>/dev/null - done <<<"$libraries" | sort -u - } >"$cache.tmp" && mv -f "$cache.tmp" "$cache" +games=$(while IFS= read -r library; do + library="$library" awk ' + function flush() { if (dir != "") printf "%s|%s|%s|%s\t%s/steamapps/common/%s\n", file, build, updated, size, ENVIRON["library"], dir } + FNR == 1 { flush(); file = FILENAME; dir = build = updated = size = "" } + { + n = split($0, part, "\"") + for (i = 2; i + 2 <= n; i += 2) { + name = tolower(part[i]) + if (name == "installdir" && dir == "") dir = part[i + 2] + else if (name == "buildid" && build == "") build = part[i + 2] + else if (name == "lastupdated" && updated == "") updated = part[i + 2] + else if (name == "sizeondisk" && size == "") size = part[i + 2] + else continue + i += 2 + } + } + END { flush() } + ' "$library"/steamapps/appmanifest_*.acf 2>/dev/null +done <<<"$libraries") +legacy= +[ -s "$cache" ] && ! grep -q $'\t' "$cache" && legacy=$(tail -n +2 "$cache"; echo .) +declare -A scanned=() current=() +read_scanned() { + scanned=() + while IFS=$'\t' read -r key _; do + [ -n "$key" ] && scanned[$key]=1 + done < <(grep $'\t' "$cache" 2>/dev/null) +} +read_scanned +later= +fresh=() +while IFS=$'\t' read -r key dir; do + [ -n "$key" ] || continue + current[$key]=1 + [ -z "${scanned[$key]:-}" ] || continue + if [ -z "$legacy" ] && [ -n "${DROIDDECK_SEED_SCRIPTS:-}${DROIDDECK_SEED_LATER:-}" ]; then + [ -z "${DROIDDECK_SEED_LATER:-}" ] || later=1 + continue + fi + [ -d "$dir" ] || continue + scanned[$key]=1 + if [ -n "$legacy" ] && [ "$cache" -nt "${key%%|*}" ]; then + found=$(printf '%s\n' "${legacy%.}" | dir="$dir" awk 'index($0, ENVIRON["dir"] "/") == 1') + else + found=$(find "$dir" -mindepth 1 -maxdepth 4 -iname 'installscript*.vdf' \ + -not -path '*/Steamworks Shared/*' 2>/dev/null) || continue + found=$(printf '%s\n' "$found" | sort -u) + fi + fresh+=("$key" "$found") +done <<<"$games" +exec 9>"$cache.lock" && command -v flock >/dev/null 2>&1 && flock 9 +if [ ${#fresh[@]} -gt 0 ]; then + read_scanned + for ((i = 0; i < ${#fresh[@]}; i += 2)); do + [ -z "${scanned[${fresh[i]}]:-}" ] || continue + printf '%s\n' "${fresh[i + 1]}" | key="${fresh[i]}" awk '{ print ENVIRON["key"] "\t" $0 }' >>"$cache" + done fi -game_scripts() { { tail -n +2 "$cache" 2>/dev/null; printf '%s\n' "${DROIDDECK_SEED_SCRIPTS:-}"; } | sed '/^$/d' | tr '\n' '\0'; } +if [ -n "$later" ]; then + (DROIDDECK_SEED_LATER= DROIDDECK_SEED_SCRIPTS= DROIDDECK_SEED_DEFERRED=1 setsid "$0" "$steam_root" >/dev/null 2>&1 9>&- &) +fi +if [ -e "$cache" ]; then + keys=$(printf '%s\n' "${!current[@]}") awk -F'\t' ' + BEGIN { n = split(ENVIRON["keys"], key, "\n"); for (i = 1; i <= n; i++) want[key[i]] = 1 } + NF > 1 && ($1 in want) + ' "$cache" >"$cache.tmp" && { cmp -s "$cache.tmp" "$cache" && rm -f "$cache.tmp" || mv -f "$cache.tmp" "$cache"; } +fi +[ -z "${DROIDDECK_SEED_DEFERRED:-}" ] || ! pgrep -x wineserver >/dev/null 2>&1 || exit 0 +game_scripts() { { cut -s -f2- "$cache" 2>/dev/null; printf '%s\n' "${DROIDDECK_SEED_SCRIPTS:-}"; } | sed '/^$/d' | tr '\n' '\0'; } game_pairs=$(game_scripts | read_scripts) [ -n "$(printf '%s' "$game_pairs" | tr -d '[:space:]')" ] && pairs=$(printf '%s\n%s\n' "$pairs" "$game_pairs" | sort -u | sed '/^$/d') declare -A vulkan=() diff --git a/tools/linuxfs/overlay/usr/local/bin/droiddeck-session b/tools/linuxfs/overlay/usr/local/bin/droiddeck-session index df301aadaf..90bd191b4d 100755 --- a/tools/linuxfs/overlay/usr/local/bin/droiddeck-session +++ b/tools/linuxfs/overlay/usr/local/bin/droiddeck-session @@ -132,8 +132,7 @@ clear_stale_tmp() { [ -z "${BL_INSIDE:-}" ] && clear_stale_tmp if [ -z "${BL_INSIDE:-}" ]; then if [ "${BL_ZRAM:-0}" = 1 ]; then printf 0 > /tmp/.bl-zram; else rm -f /tmp/.bl-zram; fi - rm -f /tmp/.bl-clock - head -c 8 /dev/zero > /tmp/.bl-clock + dd if=/dev/zero of=/tmp/.bl-clock bs=8 count=1 conv=notrunc status=none fi steam_devtools() { @@ -512,6 +511,12 @@ if [ -z "${BL_INSIDE:-}" ]; then echo "== gamescope: games at ${nested}x${nested_h} stretched to the ${width}x${height} output" fi fi + if [ "$mode" = run ] && [ "${BL_GAME_WIDTH:-0}" -gt 0 ] && [ "${BL_GAME_HEIGHT:-0}" -gt 0 ]; then + nested=$BL_GAME_WIDTH + nested_h=$BL_GAME_HEIGHT + game_size=1 + echo "== gamescope: the game runs at ${nested}x${nested_h}, scaled to the ${width}x${height} output with its proportions kept" + fi backend=${BL_GAMESCOPE_BACKEND:-wayland} case "$backend" in wayland) ;; @@ -529,7 +534,7 @@ if [ -z "${BL_INSIDE:-}" ]; then echo "== gamescope: composites every frame (Mali bridge: the Steam UI flickers on separate planes)" fi args=(--backend "$backend" --expose-wayland -f -W "$width" -H "$height" -w "$nested" -h "$nested_h") - if [ "$nested" != "$width" ] || [ "$nested_h" != "$height" ]; then + if [ "${game_size:-0}" != 1 ] && { [ "$nested" != "$width" ] || [ "$nested_h" != "$height" ]; }; then args+=(-S stretch) export BL_STRETCHED=1 fi @@ -812,19 +817,30 @@ case $mode in fi } bl_zram_usage() { - local _p _k _v _u _rss=0 _swap=0 + local _p _k _v _u _resident _anonymous _rss=0 _anon=0 _swap=0 for _p in "$@"; do + _resident=0 _anonymous=-1 while read -r _k _v _u; do - case $_k in VmRSS:) _rss=$((_rss + _v)) ;; VmSwap:) _swap=$((_swap + _v)) ;; esac + case $_v in ''|*[!0-9]*) continue ;; esac + case $_k in + VmRSS:) _resident=$_v ;; + RssAnon:) _anonymous=$_v ;; + VmSwap:) _swap=$((_swap + _v)) ;; + esac done 2>/dev/null < "/proc/$_p/status" + [ "$_anonymous" -ge 0 ] || _anonymous=$_resident + _rss=$((_rss + _resident)) _anon=$((_anon + _anonymous)) done - _bl_rss=$_rss + _bl_rss=$_rss _bl_anon=$_anon _bl_swap=$_swap echo "$# processes, resident $((_rss / 1024)) MB, in zram $((_swap / 1024)) MB" } bl_memory_read() { - local _k _v _u _kind _fields _avg - _bl_mem_total=0 _bl_available=-1 _bl_swap_total=0 _bl_swap_free=-1 _bl_psi=0 + local _k _v _u _kind _fields _avg _whole _frac _gpu_bytes _growth _saved_growth _saved_fall + _saved_growth=${_bl_preserved_growth:-0} _saved_fall=${_bl_preserved_fall:-0} + _bl_preserved_growth=0 _bl_preserved_fall=0 + _bl_mem_total=0 _bl_available=-1 _bl_swap_total=0 _bl_swap_free=-1 + _bl_psi_some=0 _bl_psi_full=0 _bl_gpu=0 _bl_unevictable=0 _bl_shmem=0 while read -r _k _v _u; do case $_v in ''|*[!0-9]*) continue ;; esac case $_k in @@ -832,15 +848,50 @@ case $mode in MemAvailable:) _bl_available=$_v ;; SwapTotal:) _bl_swap_total=$_v ;; SwapFree:) _bl_swap_free=$_v ;; + Unevictable:) _bl_unevictable=$_v ;; + Shmem:) _bl_shmem=$_v ;; esac done 2>/dev/null < /proc/meminfo if [ -r /proc/pressure/memory ]; then while read -r _kind _fields; do - [ "$_kind" = some ] || continue - _avg=${_fields#avg10=} _avg=${_avg%% *} _avg=${_avg%%.*} - case $_avg in ''|*[!0-9]*) ;; *) _bl_psi=$((10#$_avg)) ;; esac + [ "$_kind" = some ] || [ "$_kind" = full ] || continue + _avg=${_fields#avg10=} _avg=${_avg%% *} + _whole=${_avg%%.*} _frac=${_avg#*.} + [ "$_frac" = "$_avg" ] && _frac=00 + _frac=${_frac}00 + _frac=${_frac:0:2} + case $_whole$_frac in ''|*[!0-9]*) continue ;; esac + if [ "$_kind" = some ]; then + _bl_psi_some=$((10#$_whole * 100 + 10#$_frac)) + else + _bl_psi_full=$((10#$_whole * 100 + 10#$_frac)) + fi done 2>/dev/null < /proc/pressure/memory fi + if [ -r /sys/class/kgsl/kgsl/page_alloc ]; then + read -r _gpu_bytes _u < /sys/class/kgsl/kgsl/page_alloc + case $_gpu_bytes in ''|*[!0-9]*) _gpu_bytes=0 ;; esac + _bl_gpu=$((_gpu_bytes / 1024)) + fi + _bl_psi=$_bl_psi_some + [ "$_bl_psi_full" -gt "$_bl_psi" ] && _bl_psi=$_bl_psi_full + if [ "${_bl_sample_at:-}" = "" ]; then + _bl_growth=0 _bl_fall=0 + _bl_sample_at=$SECONDS _bl_sample_available=$_bl_available _bl_sample_gpu=$_bl_gpu + _bl_sample_unevictable=$_bl_unevictable _bl_sample_shmem=$_bl_shmem + elif [ "$SECONDS" -gt "$_bl_sample_at" ]; then + _bl_growth=0 _bl_fall=0 + _growth=$((_bl_gpu - _bl_sample_gpu)); [ "$_growth" -gt 0 ] && _bl_growth=$((_bl_growth + _growth)) + _growth=$((_bl_unevictable - _bl_sample_unevictable)); [ "$_growth" -gt 0 ] && _bl_growth=$((_bl_growth + _growth)) + _growth=$((_bl_shmem - _bl_sample_shmem)); [ "$_growth" -gt 0 ] && _bl_growth=$((_bl_growth + _growth)) + _bl_fall=$((_bl_sample_available - _bl_available)) + [ "$_saved_growth" -gt "$_bl_growth" ] && _bl_growth=$_saved_growth + [ "$_saved_fall" -gt "$_bl_fall" ] && _bl_fall=$_saved_fall + _bl_sample_at=$SECONDS _bl_sample_available=$_bl_available _bl_sample_gpu=$_bl_gpu + _bl_sample_unevictable=$_bl_unevictable _bl_sample_shmem=$_bl_shmem + fi + _bl_real_available=$_bl_available + [ "$_bl_real_available" -ge 0 ] && _bl_real_available=$((_bl_real_available - _bl_growth)) _bl_headroom=$((_bl_mem_total / 5)) [ "$_bl_headroom" -ge $((512 * 1024)) ] || _bl_headroom=$((512 * 1024)) [ "$_bl_headroom" -le $((1536 * 1024)) ] || _bl_headroom=$((1536 * 1024)) @@ -852,25 +903,29 @@ case $mode in } bl_memory_tight() { [ "$_bl_mem_total" -gt 0 ] && [ "$_bl_available" -ge 0 ] && - { [ "$_bl_available" -lt "$_bl_headroom" ] || - { [ "$_bl_psi" -ge 1 ] && [ "$_bl_available" -lt $((_bl_mem_total / 3)) ]; }; } + { [ "$_bl_real_available" -lt "$_bl_headroom" ] || + { [ "$_bl_psi" -ge 100 ] && [ "$_bl_real_available" -lt $((_bl_mem_total / 3)) ]; } || + { [ "$_bl_fall" -ge $((256 * 1024)) ] && [ "$_bl_real_available" -lt $((_bl_headroom * 2)) ]; }; } } bl_client_can_pageout() { bl_memory_read bl_zram_usage "${_bl_pids[@]}" > /dev/null - [ "$_bl_mem_total" -gt 0 ] && [ "$_bl_swap_total" -gt 0 ] && - [ $((_bl_swap_free - _bl_rss)) -ge "$_bl_swap_reserve" ] + [ "$_bl_mem_total" -gt 0 ] && bl_zram_has_room + } + bl_zram_has_room() { + [ "$_bl_swap_total" -gt 0 ] && + [ $((_bl_swap_free - _bl_anon - ${_bl_client_reserve:-0})) -ge "$_bl_swap_reserve" ] } bl_client_can_readback() { bl_memory_read bl_zram_usage "${_bl_pids[@]}" > /dev/null - [ "$_bl_mem_total" -gt 0 ] && ! bl_memory_tight && - [ "$_bl_available" -ge $((_bl_swap * 2)) ] && - [ $((_bl_available - _bl_swap)) -ge "$_bl_headroom" ] + [ "$_bl_mem_total" -gt 0 ] && ! bl_memory_tight && ! bl_memory_critical && + [ "$_bl_real_available" -ge $((_bl_swap * 2)) ] && + [ $((_bl_real_available - _bl_swap)) -ge "$_bl_headroom" ] } bl_client_pressure() { [ "${BL_ZRAM_CLIENT:-1}" = 1 ] && [ "$_bl_game" = 1 ] && - [ "${#_bl_pids[@]}" -gt 0 ] && bl_memory_tight || return 0 + [ "${#_bl_pids[@]}" -gt 0 ] && { bl_memory_tight || bl_memory_critical; } || return 0 [ "$_bl_pressure_at" -lt 0 ] || [ $((SECONDS - _bl_pressure_at)) -ge "$_bl_pressure_backoff" ] || return 0 [ "$_bl_packed" -lt 0 ] || [ $((SECONDS - _bl_packed)) -ge 30 ] || return 0 @@ -880,12 +935,29 @@ case $mode in return 0 fi [ "$_bl_rss" -ge $((128 * 1024)) ] || return 0 - local _before=$_bl_rss - bl_zram_send 1 "memory pressure, compressing the client (available $((_bl_available / 1024)) MB, swap free $((_bl_swap_free / 1024)) MB)" client + _bl_pressure_before=$_bl_rss + if [ "${1:-}" = defer ]; then + _bl_client_reserve=$_bl_anon + _bl_client_pending=1 + fi + bl_zram_send 1 "memory pressure, compressing the client (available $((_bl_available / 1024)) MB, swap free $((_bl_swap_free / 1024)) MB)" client "${1:-}" _bl_packed=$SECONDS + if [ "${1:-}" = defer ]; then + _bl_client_targets=("${_bl_zram_targets[@]}") + else + bl_client_pressure_result + fi + } + bl_client_pressure_finish() { + [ "${_bl_client_pending:-0}" = 1 ] || return 0 + bl_zram_finish 1 "${_bl_client_targets[@]}" + bl_client_pressure_result "${_bl_client_targets[@]}" + _bl_client_pending=0 _bl_client_reserve=0 _bl_client_targets=() + } + bl_client_pressure_result() { [ "${_bl_pageout_complete:-0}" = 1 ] || return 0 - bl_zram_usage "${_bl_pids[@]}" > /dev/null - if [ $((_before - _bl_rss)) -lt $((16 * 1024)) ]; then + if [ "$#" -gt 0 ]; then bl_zram_usage "$@" > /dev/null; else bl_zram_usage "${_bl_pids[@]}" > /dev/null; fi + if [ $((_bl_pressure_before - _bl_rss)) -lt $((16 * 1024)) ]; then _bl_pressure_backoff=$((_bl_pressure_backoff * 2 > 300 ? 300 : _bl_pressure_backoff * 2)) else _bl_pressure_backoff=30 @@ -893,15 +965,13 @@ case $mode in } bl_memory_critical() { [ "$_bl_mem_total" -gt 0 ] && [ "$_bl_available" -ge 0 ] && - { [ "$_bl_available" -lt "$_bl_tier_headroom" ] || - { [ "$_bl_psi" -ge 1 ] && [ "$_bl_available" -lt $((_bl_tier_headroom * 3 / 2)) ]; }; } - } - bl_low_ram() { - [ "$_bl_mem_total" -gt 0 ] && [ "$_bl_mem_total" -le $((13 * 1024 * 1024)) ] + { [ "$_bl_real_available" -lt "$_bl_tier_headroom" ] || + { [ "$_bl_psi" -ge 100 ] && [ "$_bl_real_available" -lt $((_bl_tier_headroom * 3 / 2)) ]; } || + { [ "$_bl_fall" -ge $((256 * 1024)) ] && [ "$_bl_real_available" -lt $((_bl_tier_headroom * 2)) ]; }; } } bl_session_pressure() { bl_memory_read - [ "$_bl_game" = 1 ] && bl_low_ram && bl_memory_critical || return 0 + [ "$_bl_game" = 1 ] && bl_memory_critical || return 0 local _wait=$_bl_tier_backoff _before _pids _targets [ "$_bl_available" -ge $((_bl_headroom / 2)) ] || [ "$_bl_tier_pushed" -lt 0 ] || _wait=30 [ "$_bl_tier_at" -lt 0 ] || [ $((SECONDS - _bl_tier_at)) -ge "$_wait" ] || return 0 @@ -917,21 +987,18 @@ case $mode in fi fi _bl_tier_at=$SECONDS _bl_tier_pushed=0 - bl_zram_pick game + bl_zram_pick session bl_zram_usage "${_pids[@]}" > /dev/null [ "$_bl_rss" -ge $((256 * 1024)) ] || return 0 - if [ "$_bl_swap_total" -le 0 ] || [ $((_bl_swap_free - _bl_rss)) -lt "$_bl_swap_reserve" ]; then + if ! bl_zram_has_room; then step "zRAM: low-memory page-out skipped, swap headroom too small ($((_bl_swap_free / 1024)) MB free)" return 0 fi _targets=("${_pids[@]}") _before=$_bl_swap - bl_zram_send 1 "low memory (available $((_bl_available / 1024)) MB), compressing idle game memory" game + bl_zram_send 1 "low memory (available $((_bl_real_available / 1024)) MB), compressing idle game memory" session bl_zram_usage "${_targets[@]}" > /dev/null _bl_tier_pushed=$((_bl_swap - _before)) bl_tier_note "${_targets[@]}" - if [ "${_bl_pageout_complete:-0}" = 1 ] && [ "${BL_ZRAM_CLIENT:-1}" = 1 ] && [ "${#_bl_pids[@]}" -gt 0 ]; then - _bl_pressure_at=$SECONDS _bl_packed=$SECONDS - fi } bl_proc_start() { local _s= @@ -962,7 +1029,7 @@ case $mode in } bl_watch_nap() { local _i - if [ "$_bl_game" = 1 ] && bl_low_ram && [ "$_bl_available" -ge 0 ] && [ "$_bl_available" -lt $((_bl_tier_headroom * 2)) ]; then + if [ "$_bl_game" = 1 ] && [ "$_bl_available" -ge 0 ] && [ "$_bl_real_available" -lt $((_bl_tier_headroom * 2)) ]; then for _i in 1 2 3 4 5; do nap 1 bl_memory_read @@ -1018,10 +1085,16 @@ case $mode in for _p in "${_pids[@]}"; do rm -f "/tmp/.bl-zram.ack.$_p"; done printf '%s' "$_mode" > /tmp/.bl-zram [ "${#_pids[@]}" = 0 ] || kill -URG "${_pids[@]}" 2>/dev/null - if [ "$_mode" = 1 ]; then bl_zram_wait "${_pids[@]}"; else nap 5; fi + _bl_zram_targets=("${_pids[@]}") + [ "${4:-}" != defer ] || return 0 + bl_zram_finish "$_mode" "${_pids[@]}" + } + bl_zram_finish() { + local _mode=$1 + shift + if [ "$_mode" = 1 ]; then bl_zram_wait "$@"; else nap 5; fi bl_zram_scan - bl_zram_pick "$_which" - step "zRAM: done ($(bl_zram_usage "${_pids[@]}"))" + step "zRAM: done ($(bl_zram_usage "$@"))" } bl_game_focused() { if [ "${BL_DESKTOP:-}" = 1 ] || [ -z "${BL_LAUNCH_DIR:-}" ]; then @@ -1048,6 +1121,8 @@ case $mode in } _bl_since=-1 _bl_since_apps= _bl_packed=-1 _bl_measured=-1 _bl_unpack=0 _bl_capped=-1 _bl_backoff=30 _bl_pressure_at=-1 _bl_pressure_backoff=30 _bl_tier_at=-1 _bl_tier_backoff=30 _bl_tier_pushed=0 _bl_tier_back=0 _bl_tier_targets=() _bl_tier_swaps=() _bl_tier_starts=() + _bl_client_pending=0 _bl_client_reserve=0 _bl_client_targets=() + _bl_sample_at= _bl_sample_available=0 _bl_sample_gpu=0 _bl_sample_unevictable=0 _bl_sample_shmem=0 while kill -0 $$ 2>/dev/null; do bl_zram_scan bl_memory_read @@ -1074,8 +1149,11 @@ case $mode in _bl_backoff=30 fi fi + _bl_preserved_growth=$_bl_growth _bl_preserved_fall=$_bl_fall + bl_client_pressure defer + _bl_preserved_growth=$_bl_growth _bl_preserved_fall=$_bl_fall bl_session_pressure - bl_client_pressure + bl_client_pressure_finish if [ "$_bl_game" = 1 ] && bl_game_focused; then if [ "$_bl_since" -lt 0 ] || [ "$_bl_since_apps" != "$_bl_apps" ]; then _bl_since=$SECONDS _bl_since_apps=$_bl_apps @@ -1105,6 +1183,10 @@ case $mode in && [ "${BL_STEAM_UI:-}" != desktop ] && [ -x /usr/local/bin/droiddeck-launcher-cores ]; then /usr/local/bin/droiddeck-launcher-cores "$BL_LAUNCH_DIR/agent/focus.json" 2>&1 & fi + if [ "${BL_PACE_CORES:-1}" != 0 ] && [ -n "${DROIDDECK_HUD_FRAMES:-}" ] && [ -z "${BL_DESKTOP:-}" ] \ + && [ -x /usr/local/bin/droiddeck-pace-cores ]; then + /usr/local/bin/droiddeck-pace-cores "$DROIDDECK_HUD_FRAMES" 2>&1 & + fi if [ "$steam_x64" = 0 ]; then step "registering the app's game library with Steam" @@ -1118,7 +1200,7 @@ case $mode in step "adding the app's own games to the client's library" droiddeck-steam-shortcuts "$steam_root" "$BL_ADDED_GAMES" || true fi - droiddeck-seed-redists "$steam_root" || true + DROIDDECK_SEED_LATER=1 droiddeck-seed-redists "$steam_root" || true else _bl_x64_tool=$(droiddeck-steam-x64 --default-tool) if [ -n "$_bl_x64_tool" ]; then @@ -1132,7 +1214,7 @@ case $mode in if [ -z "${BL_DESKTOP:-}" ] && [ "${BL_STEAM_UI:-}" != desktop ]; then droiddeck-steam-ui-scale "$steam_root" "${BL_WIDTH:-1280}" "${BL_HEIGHT:-720}" || true fi - droiddeck-seed-redists "$steam_root" || true + DROIDDECK_SEED_LATER=1 droiddeck-seed-redists "$steam_root" || true fi if [ -n "${BL_SHADER_PRECACHE:-}" ]; then droiddeck-steam-shaders "$BL_SHADER_PRECACHE" "$XDG_DATA_HOME/Steam" \ @@ -1396,6 +1478,8 @@ case $mode in decky_stop() { [ -z "$decky_child" ] || kill "$decky_child" 2>/dev/null; [ -z "$decky_child" ] || wait "$decky_child" 2>/dev/null; exit 0; } trap decky_stop TERM INT HUP decky_exits=0 + # The guest has no "deck" user, which Decky otherwise requires at startup. + export UNPRIVILEGED_USER=root while :; do if [ "$decky_arch" = x86_64 ]; then /usr/local/bin/droiddeck-fex run --mode on -- "$decky_loader" >>"$HOME/homebrew/services/PluginLoader.log" 2>&1 & else "$decky_loader" >>"$HOME/homebrew/services/PluginLoader.log" 2>&1 & @@ -1458,6 +1542,9 @@ case $mode in _bl_cef=(-cef-disable-gpu -cef-disable-gpu-compositing) echo "== steam: browser UI in software (Mali bridge)" elif [ "${_bl_cef[0]}" = -cef-force-gpu ]; then + # With Steam's own web helper layout the Deck UI's footer and overlays flicker on the bridge + # (Mali-G78 MP14). ANGLE on Vulkan without Chromium's Vulkan compositing draws them steadily. + : "${BL_VKBRIDGE_CEF_ANGLE=vulkan}" "${BL_VKBRIDGE_CEF_VULKAN=0}" _bl_cef=(-cef-force-gpu -cef-use-gl=angle -cef-use-angle="${BL_VKBRIDGE_CEF_ANGLE:-vulkan}") fi [ "${BL_VKBRIDGE_CEF_LOG:-0}" = 1 ] && _bl_cef+=(-cef-enable-logging=stderr -cef-v=1) diff --git a/tools/linuxfs/overlay/usr/local/bin/droiddeck-steam-games b/tools/linuxfs/overlay/usr/local/bin/droiddeck-steam-games index c902676d3f..ac8213d41e 100755 --- a/tools/linuxfs/overlay/usr/local/bin/droiddeck-steam-games +++ b/tools/linuxfs/overlay/usr/local/bin/droiddeck-steam-games @@ -71,7 +71,11 @@ def store_game(game): def manifest_ids(steamapps, name): matches = [] - for manifest in Path(steamapps).glob("appmanifest_*.acf"): + try: + manifests = list(Path(steamapps).glob("appmanifest_*.acf")) + except OSError: + return matches + for manifest in manifests: try: install = re.search(r'"installdir"\s*"([^"\\]*)"', manifest.read_text(), re.I) if install and install[1] == name: @@ -81,13 +85,21 @@ def manifest_ids(steamapps, name): return matches -def identify(game): +def manifest_identity(game): folder = Path(game["folder"]) steamapps = folder.parent.parent for library in ([steamapps] if folder.parent.name == "common" and steamapps.name == "steamapps" else []) + [folder.parent / WINNATIVE]: matches = [appid for appid in manifest_ids(library, folder.name) if appid != SPACEWAR] if matches: - return matches[0] if len(matches) == 1 else None + return (matches[0], library) if len(matches) == 1 else None + return False + + +def identify(game): + folder = Path(game["folder"]) + found = manifest_identity(game) + if found is not False: + return found[0] if found is not None else None ids = set() for parent in {folder, Path(game["exe"]).parent}: try: @@ -508,6 +520,57 @@ def release(steam_root, game, stale, reason): print(f"droiddeck-steam-games: {game.get('name', appid)} {reason}; it is no longer Steam app {appid}") +PREFIX_LINKS = ".droiddeck-prefix-links.json" + + +def steam_prefix(steam_root, game): + identity = manifest_identity(game) + if not identity or not identity[0]: + return None, None + appid, steamapps = identity + installed = steamapps == Path(game["folder"]).parent.parent + for library in [steamapps.parent] if installed else dict.fromkeys([steamapps.parent] + libraries(steam_root)): + prefix = library / "steamapps/compatdata" / str(appid) + if (prefix / "pfx/drive_c").is_dir(): + return appid, str(prefix) + return appid, None + + +def share_prefix(steam_root, game): + shortcut = Path(steam_root) / "steamapps/compatdata" / str(game["appid"] & 0xFFFFFFFF) + record = Path(steam_root) / "steamapps" / PREFIX_LINKS + links = read_json(record, {}) + if not isinstance(links, dict): + links = {} + before = dict(links) + key = str(shortcut) + name = game.get("name", "game") + appid, target = steam_prefix(steam_root, game) + try: + current = os.readlink(shortcut) if os.path.islink(shortcut) else None + if current is not None and links.get(key) == current and current != target: + if target is not None or (not os.path.exists(shortcut) and Path(current).parent.parent.is_dir()): + shortcut.unlink() + current = None + if current is None: + links.pop(key, None) + if current is None and os.path.lexists(shortcut): + if target is not None: + print(f"droiddeck-steam-games: {name} keeps its own prefix; Steam app {appid} saves are in {target}") + elif current is None and target is not None: + shortcut.parent.mkdir(parents=True, exist_ok=True) + shortcut.symlink_to(target) + links[key] = target + print(f"droiddeck-steam-games: {name} shares the saves prefix of Steam app {appid}") + except OSError as error: + print(f"droiddeck-steam-games: {name} keeps its own prefix ({error})") + if links != before: + try: + save_json(record, links) + except OSError as error: + print(f"droiddeck-steam-games: prefix links not recorded ({error})") + + def route(steam_root, acct, games): snapshot = read_json(Path(acct) / "config" / STATE, {}) if not isinstance(snapshot, dict): @@ -557,6 +620,7 @@ def route(steam_root, acct, games): elif named and seeded(steamapps, game, appid): routes[str(game["appid"])] = appid continue + share_prefix(steam_root, game) shortcuts.append(game) try: park(steamapps) diff --git a/tools/linuxfs/overlay/usr/local/bin/droiddeck-steam-x64 b/tools/linuxfs/overlay/usr/local/bin/droiddeck-steam-x64 index 481d25d194..0aeb0e594c 100755 --- a/tools/linuxfs/overlay/usr/local/bin/droiddeck-steam-x64 +++ b/tools/linuxfs/overlay/usr/local/bin/droiddeck-steam-x64 @@ -449,7 +449,11 @@ mkdir -p "$srt_libs" for d in "$STEAM_X64"/steamrt64/pv-runtime/steam-runtime-steamrt/steamrt3c_platform_*/files/lib/x86_64-linux-gnu \ "$STEAM_X64"/steamrt64/pv-runtime/steam-runtime-steamrt/steamrt3c_platform_*/files/usr/lib/x86_64-linux-gnu; do [ -d "$d" ] || continue - for f in "$d"/*.so*; do [ -e "$srt_libs/$(basename "$f")" ] || ln -s "$f" "$srt_libs/"; done + for f in "$d"/*.so*; do + [ -e "$f" ] || [ -L "$f" ] || continue + s="$srt_libs/$(basename "$f")" + { [ -e "$s" ] || [ -L "$s" ]; } || ln -s "$f" "$srt_libs/" + done done FEX_ROOTFS=$ROOTFS /usr/local/bin/FEX "$ROOTFS/usr/sbin/ldconfig.real" -n "$srt_libs" >>"$LOG" 2>&1 || step "ldconfig on $srt_libs failed" sniper_compat=$X64_HOME/sniper-compat @@ -458,6 +462,7 @@ mkdir -p "$sniper_compat" hb=$(ls "$srt_libs"/libharfbuzz.so.0.* 2>/dev/null | head -n 1) if [ -n "$hb" ]; then ln -s "$hb" "$sniper_compat/libharfbuzz.so.0"; else step "warning: no HarfBuzz in Valve's runtime for the newer-runtime titles"; fi for f in "$srt_libs"/*; do + [ -e "$f" ] || [ -L "$f" ] || continue n=$(basename "$f") if [ -e "$ROOTFS/usr/lib/x86_64-linux-gnu/$n" ] || [ -e "$ROOTFS/lib/x86_64-linux-gnu/$n" ]; then rm -f "$f"; fi done diff --git a/tools/linuxfs/overlay/usr/local/bin/droiddeck-store-launch b/tools/linuxfs/overlay/usr/local/bin/droiddeck-store-launch index b2e2b870e0..3d07aaba6a 100755 --- a/tools/linuxfs/overlay/usr/local/bin/droiddeck-store-launch +++ b/tools/linuxfs/overlay/usr/local/bin/droiddeck-store-launch @@ -5,6 +5,7 @@ import binascii import json import os import re +import shlex import shutil import sys import time @@ -47,14 +48,14 @@ def sidecar_at(folder): return sidecar -def find_store_game(argv): +def find_store_game(argv, depth=MAX_DEPTH): for raw in argv: arg = raw.strip().strip('"').strip("'").replace("\\", "/") low = arg.lower() if not (low.endswith(LAUNCHER) or low.endswith(".exe") or low.endswith(".bat")) or "/" not in arg: continue folder = Path(arg).parent - for _ in range(MAX_DEPTH): + for _ in range(depth): sidecar = sidecar_at(folder) if sidecar is not None: return folder, sidecar @@ -64,6 +65,21 @@ def find_store_game(argv): return None +def store_launcher(path): + real = os.path.realpath(path) + for start in dict.fromkeys([os.path.abspath(path), real]): + found = find_store_game([start], depth=len(Path(start).parts)) + if found is None: + continue + folder, sidecar = found + launcher, exe = str(sidecar.get("launcher") or ""), str(sidecar.get("exe") or "") + if not launcher or not exe or (folder / launcher).is_symlink() or not (folder / launcher).is_file(): + continue + if os.path.realpath(folder / exe).lower() == real.lower(): + return str(folder / launcher) + return None + + def drop_stale(folder, now=None): code = folder / EPIC_CODE try: @@ -270,12 +286,22 @@ def cloud_on(sidecar): def exited(argv, code=0): found = find_store_game(argv) launch_dir = os.environ.get("BL_LAUNCH_DIR", "") + if found is not None and launch_dir and str(found[1].get("store")) == "rockstar": + ask(Path(launch_dir) / "stores", {"op": "rockstar-exited", "store": "rockstar", "id": str(found[1].get("id"))}, timeout=1.0) + compat_data = os.environ.get("STEAM_COMPAT_DATA_PATH") + if compat_data: + (Path(compat_data) / "pfx" / ROCKSTAR_FOLDER / "launch.json").unlink(missing_ok=True) + return 0 if found is not None and str(found[1].get("store")) == "epic" and os.environ.get(EPIC_HANDLED) != "1" \ and os.access(EPIC_CLIENT, os.X_OK): try: subprocess.run([EPIC_CLIENT, "exited", "--code", str(code)], stdin=subprocess.DEVNULL, stdout=subprocess.DEVNULL, timeout=10) except (OSError, subprocess.TimeoutExpired): pass + if found is not None and launch_dir and str(found[1].get("store")) == "ea": + ask(Path(launch_dir) / "stores", {"op": "ea-exited", "store": "ea", "id": str(found[1].get("id"))}, timeout=1.0) + log("ea %s exited" % found[1].get("id")) + return 0 if found is None or not launch_dir or not cloud_on(found[1]): return 0 store, game = str(found[1].get("store")), str(found[1].get("id")) @@ -284,6 +310,443 @@ def exited(argv, code=0): return 0 +UBISOFT_DIR = "drive_c/Program Files (x86)/Ubisoft/Ubisoft Game Launcher" +UBISOFT_WINDOWS_DIR = "C:\\Program Files (x86)\\Ubisoft\\Ubisoft Game Launcher\\" +UBISOFT_INSTALLER_URL = "https://static3.cdn.ubi.com/orbit/launcher_installer/UbisoftConnectInstaller.exe" +ROCKSTAR_SERVICE = Path("/usr/local/lib/droiddeck-rockstar") +ROCKSTAR_FOLDER = "drive_c/Program Files/Rockstar Games/Launcher" +ROCKSTAR_TITLES = {"gta3": "Grand Theft Auto III", "gtavc": "Grand Theft Auto: Vice City", "gtasa": "GTA: San Andreas", + "gta4": "Grand Theft Auto IV", "lanoire": "LANoireMTL"} + + +def rockstar_sdk(folder, sidecar): + if str(sidecar.get("id")) in ("gta4", "lanoire"): + return True + root = folder.resolve() + exe = (folder / str(sidecar.get("exe") or "").replace("\\", "/")).resolve() + if not exe.is_relative_to(root): + return False + for directory in {root, exe.parent}: + if directory.is_dir() and any(p.is_file() and not p.is_symlink() and p.name.lower() in ("socialclub.dll", "socialclub64.dll") + for p in directory.iterdir()): + return True + if str(sidecar.get("id")) in ROCKSTAR_TITLES: + return False + level = [root] + for _ in range(4): + children = [] + for directory in level: + for path in directory.iterdir(): + if path.is_symlink(): + continue + if path.name.lower() == "title.rgl" and path.is_file() and path.resolve().is_relative_to(root) and 112 <= path.stat().st_size <= 1048576: + with path.open("rb") as source: + if source.read(4) == b"RGLM": + return True + if len(children) < 256 and path.is_dir() and path.resolve().is_relative_to(root): + children.append(path) + level = children + return False + + +def rockstar_registry(folder, title, compat_data, proton, sdk_arch=None): + pfx = Path(compat_data) / "pfx" + launcher = r"C:\Program Files\Rockstar Games\Launcher" + values = [(r"Rockstar Games\Launcher", launcher)] + if title: + values.append(("Rockstar Games\\" + title, windows_path(str(folder)))) + entries = [("Software\\" + view + key, value) for view in ("", "Wow6432Node\\") for key, value in values] + if sdk_arch: + entries.append((r"Software\Rockstar Games\Rockstar Games Social Club", r"C:\Program Files\Rockstar Games\Social Club")) + program = "Program Files (x86)" if sdk_arch == "x86" else "Program Files" + entries.append((r"Software\Wow6432Node\Rockstar Games\Rockstar Games Social Club", "C:\\" + program + r"\Rockstar Games\Social Club")) + reg = pfx / "system.reg" + if all(has_value(reg, "[" + key.replace("\\", "\\\\") + "]", "InstallFolder", value) for key, value in entries): + return True + if wait_for_server(pfx, 2): + return all(set_value(reg, "[" + key.replace("\\", "\\\\") + "]", "InstallFolder", value) for key, value in entries) + with tempfile.TemporaryDirectory(prefix="droiddeck-rockstar-") as temp: + path = Path(temp) / "install.reg" + text = "Windows Registry Editor Version 5.00\r\n\r\n" + text += "\r\n".join('[HKEY_LOCAL_MACHINE\\%s]\r\n"InstallFolder"="%s"\r\n' % (key, reg_escape(value)) for key, value in entries) + path.write_text(text, encoding="utf-16") + result = subprocess.run([proton, "run", "reg.exe", "import", windows_path(str(path))], + stdin=subprocess.DEVNULL, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, timeout=45) + return result.returncode == 0 + + +def rockstar_runtime(folder, exe, compat_data, arch): + if arch == "x86": + rockstar_runtime(folder, exe, compat_data, "x64") + pfx = Path(compat_data) / "pfx" + target = pfx / "drive_c" / ("Program Files (x86)" if arch == "x86" else "Program Files") / "Rockstar Games/Social Club" + if not target.resolve().is_relative_to(pfx.resolve()): + raise ValueError("invalid Social Club destination") + required = ("socialclub.dll", "socialclub.pak") + (("SocialClubHelper.exe",) if arch == "x64" else ()) + marker = target / ".droiddeck-installing" + if all((target / name).is_file() for name in required) and not marker.exists(): + return "present" + root = folder.resolve() + installers = [base / sub / "Social-Club-Setup.exe" for base in (root, exe.parent) + for sub in ("Redistributables", "Installers")] + installer = next((p for p in installers if p.is_file() and p.resolve().is_relative_to(root) and p.stat().st_size <= 256 * 1024 * 1024), None) + if installer is None: + return "game-runtime" + tool = shutil.which("7z") + if not tool: + return "no-unpacker" + listing = subprocess.run([tool, "l", "-t7z", "-slt", "-ba", str(installer)], capture_output=True, + stdin=subprocess.DEVNULL, timeout=30) + if listing.returncode: + return "installer-unreadable" + entries, size = [], 0 + for block in listing.stdout.decode("utf-8", "replace").split("\n\n"): + fields = dict(line.split(" = ", 1) for line in block.splitlines() if " = " in line) + name = fields.get("Path", "").replace("\\", "/") + if not name.startswith(arch + "/"): + continue + if ".." in name.split("/") or ":" in name or fields.get("Symbolic Link") or fields.get("Hard Link"): + raise ValueError("invalid Social Club archive path") + entry_size = int(fields.get("Size", "0")) + if entry_size < 0: + raise ValueError("invalid Social Club member size") + size += entry_size + entries.append(name) + if not entries or len(entries) > 2048 or size > 768 * 1024 * 1024: + raise ValueError("invalid Social Club archive size") + with tempfile.TemporaryDirectory(prefix="droiddeck-socialclub-") as temporary: + result = subprocess.run([tool, "x", "-t7z", "-y", "-o" + temporary, str(installer), arch + "/*"], + stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, stdin=subprocess.DEVNULL, timeout=180) + source = Path(temporary) / arch + if result.returncode or not all((source / name).is_file() for name in required): + return "installer-incomplete" + target.mkdir(parents=True, exist_ok=True) + if marker.is_symlink(): + raise ValueError("invalid Social Club install marker") + marker.touch() + for path in source.rglob("*"): + if path.is_symlink() or not path.resolve().is_relative_to(source.resolve()): + raise ValueError("invalid Social Club archive member") + if not path.is_file(): + continue + output = target / path.relative_to(source) + if not output.resolve().is_relative_to(pfx.resolve()): + raise ValueError("invalid Social Club output path") + output.parent.mkdir(parents=True, exist_ok=True) + with tempfile.NamedTemporaryFile(dir=output.parent, delete=False) as stage: + stage_path = Path(stage.name) + try: + with path.open("rb") as stream: + shutil.copyfileobj(stream, stage) + except BaseException: + stage_path.unlink(missing_ok=True) + raise + os.replace(stage_path, output) + marker.unlink() + return "installed" + + +def prepare_rockstar(folder, sidecar, compat_data, launch_dir, proton="", ask_app=None): + if not compat_data: + return "no-prefix" + target = Path(compat_data) / "pfx" / ROCKSTAR_FOLDER + if not target.resolve().is_relative_to((Path(compat_data) / "pfx").resolve()): + return "invalid-service-path" + config = target / "launch.json" + config.unlink(missing_ok=True) + legacy = str(sidecar.get("id")) in ROCKSTAR_TITLES + sdk = rockstar_sdk(folder, sidecar) + title = ROCKSTAR_TITLES.get(str(sidecar.get("id"))) + if not launch_dir: + return "no-channel" + root = folder.resolve() + exe = (folder / str(sidecar.get("exe") or "").replace("\\", "/")).resolve() + if not exe.is_relative_to(root): + return "invalid-game-path" + workdir = (folder / str(sidecar["workdir"])).resolve() if sidecar.get("workdir") is not None else exe.parent + if not workdir.is_relative_to(root) or not exe.is_file() or legacy and not any((p / "MTLX.dll").is_file() for p in (root, exe.parent)): + return "invalid-game-path" + args = sidecar.get("args") or [] + if not isinstance(args, list) or any(not isinstance(arg, str) or "\0" in arg for arg in args): + return "invalid-game-arguments" + with exe.open("rb") as source: + if source.read(2) != b"MZ": + return "invalid-game-exe" + source.seek(0x3c) + raw = source.read(4) + if len(raw) != 4: + return "invalid-game-exe" + source.seek(int.from_bytes(raw, "little")) + signature = source.read(6) + if len(signature) != 6 or signature[:4] != b"PE\0\0" or signature[4:] not in (b"\x4c\x01", b"\x64\x86"): + return "invalid-game-exe" + service = ROCKSTAR_SERVICE / ("Launcher32.exe" if signature[4:] == b"\x4c\x01" else "Launcher64.exe") + if not service.is_file(): + return "no-service" + made = "present" if (Path(compat_data) / "pfx/user.reg").is_file() else create_prefix(compat_data, proton) + if made not in ("created", "present"): + return "prefix-" + made + arch = "x86" if signature[4:] == b"\x4c\x01" else "x64" + if sdk: + log("rockstar runtime: " + rockstar_runtime(folder, exe, compat_data, arch)) + if not rockstar_registry(folder, title, compat_data, proton, sdk_arch=arch if sdk else None): + return "registry-unavailable" + target.mkdir(parents=True, exist_ok=True) + with tempfile.NamedTemporaryFile(prefix="Launcher-", suffix=".exe", dir=target, delete=False) as temporary: + temporary_path = Path(temporary.name) + try: + with service.open("rb") as source: + shutil.copyfileobj(source, temporary) + except BaseException: + temporary_path.unlink(missing_ok=True) + raise + os.replace(temporary_path, target / "Launcher.exe") + answer = (ask_app or ask)(Path(launch_dir) / "stores", {"op": "rockstar-launch", "store": "rockstar", "id": str(sidecar.get("id"))}, timeout=120.0) + if not isinstance(answer, dict) or not answer.get("ok"): + return "session-" + (str(answer.get("reason") or "refused") if isinstance(answer, dict) else "timeout") + if legacy and (not isinstance(answer.get("material"), str) or not re.fullmatch(r"[0-9A-Fa-f]{640}", answer["material"])): + return "invalid-material" + expires = answer.get("expiresAt") + if not isinstance(expires, int) or not time.time() * 1000 < expires <= time.time() * 1000 + 120_000: + return "invalid-expiry" + launch = {"folder": windows_path(str(root)), "exe": windows_path(str(exe)), "workdir": windows_path(str(workdir)), + "args": args, "expiresAt": expires} + if legacy: + launch.update(pipe=answer.get("pipe"), material=answer["material"]) + if sdk: + session = answer.get("session") + if not isinstance(session, dict) or not isinstance(session.get("accountId"), str) \ + or not re.fullmatch(r"[1-9][0-9]{0,19}", session["accountId"]) or int(session["accountId"]) > 2**64 - 1 \ + or any(not isinstance(session.get(key), str) or not session[key] or "\0" in session[key] + or len(session[key].encode("utf-8")) > limit for key, limit in (("identity", 512), ("ticket", 49152))): + return "invalid-sdk-session" + launch["session"] = {key: session[key] for key in ("accountId", "identity", "ticket")} + if "titleId" in session: + if not isinstance(session["titleId"], str) or not re.fullmatch(r"[a-z][a-z0-9_]{0,63}", session["titleId"]): + return "invalid-sdk-title" + launch["session"]["titleId"] = session["titleId"] + if len(json.dumps(launch).encode("utf-8")) > 65536: + return "handoff-too-large" + with tempfile.NamedTemporaryFile(mode="w", prefix="launch-", suffix=".json", dir=target, delete=False) as temporary: + temporary_path = Path(temporary.name) + try: + json.dump(launch, temporary) + except BaseException: + temporary_path.unlink(missing_ok=True) + raise + os.replace(temporary_path, config) + return "ready" + + +UBISOFT_CACHE = Path("/root/.cache/droiddeck/ubisoft") +UBISOFT_LAUNCH = ".droiddeck-ubisoft.json" +UBISOFT_SERVICE = Path("/usr/local/lib/droiddeck-ubisoft/droiddeck-upc.exe") +UBISOFT_ASK_WAIT = 45.0 +UBISOFT_EXTRACT_WAIT = 300 +# Ubisoft's own game-side runtime from the Connect installer, unmodified: the API and aux DLLs the +# game's loader opens from InstallDir, the starter it re-executes into and its imports, and the overlay +# DLLs uplay_r1.dll loads even with the overlay off (its startup fails without them). +UBISOFT_RUNTIME = ("uplay_r1.dll", "uplay_r164.dll", "uplay_aux_r1.dll", "uplay_aux_r164.dll", + "uplay_r2.dll", "uplay_r264.dll", "ubiorbitapi_r2.dll", "ubiorbitapi_r264.dll", + "UbisoftGameLauncher.exe", "UbisoftGameLauncher64.exe", "discord-rpc.x86.dll", + "discord-rpc.x64.dll", "steam_api.dll", "steam_api64.dll", "overlay.dll", "overlay64.dll") +UBISOFT_VIEWS = ("[Software\\\\Ubisoft\\\\Launcher%s]", "[Software\\\\Wow6432Node\\\\Ubisoft\\\\Launcher%s]") +MIN_INSTALLER = 1 << 20 + + +def ubisoft_runtime_dir(compat_data): + return Path(compat_data) / "pfx" / UBISOFT_DIR + + +def ubisoft_runtime_ready(compat_data): + folder = ubisoft_runtime_dir(compat_data) + return all((folder / name).is_file() for name in UBISOFT_RUNTIME) + + +def fetch_installer(url=UBISOFT_INSTALLER_URL, folder=UBISOFT_CACHE): + target = folder / "UbisoftConnectInstaller.exe" + if target.is_file() and target.stat().st_size >= MIN_INSTALLER: + return target + import urllib.request + folder.mkdir(parents=True, exist_ok=True) + part = target.with_name(target.name + ".part") + request = urllib.request.Request(url, headers={"User-Agent": "Mozilla/5.0"}) + with urllib.request.urlopen(request, timeout=60) as reply, open(part, "wb") as out: + shutil.copyfileobj(reply, out) + if part.stat().st_size < MIN_INSTALLER: + part.unlink() + raise OSError("installer too small") + os.replace(part, target) + return target + + +def install_runtime(compat_data, wait=UBISOFT_EXTRACT_WAIT): + if ubisoft_runtime_ready(compat_data): + return "present" + if not (Path(compat_data) / "pfx").is_dir(): + return "no-prefix" + try: + installer = fetch_installer() + except OSError as error: + return "download-failed-" + type(error).__name__ + target = ubisoft_runtime_dir(compat_data) + target.mkdir(parents=True, exist_ok=True) + with tempfile.TemporaryDirectory(prefix="droiddeck-ubisoft-", dir=str(UBISOFT_CACHE)) as tmp: + try: + subprocess.run(["7z", "e", "-y", "-o" + tmp, str(installer)] + list(UBISOFT_RUNTIME), stdin=subprocess.DEVNULL, + stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, timeout=wait) + except subprocess.TimeoutExpired: + return "extract-timeout" + except OSError: + return "no-7z" + missing = [name for name in UBISOFT_RUNTIME if not (Path(tmp) / name).is_file()] + if missing: + return "extract-missing-" + ",".join(missing) + for name in UBISOFT_RUNTIME: + shutil.copyfile(Path(tmp) / name, target / name) + if not ubisoft_runtime_ready(compat_data): + return "copy-failed" + try: + installer.unlink() + except OSError: + pass + return "installed" + + +def ubisoft_product(sidecar): + extra = sidecar.get("extra") if isinstance(sidecar.get("extra"), dict) else {} + try: + return int(str(extra.get("productId") or "")) + except ValueError: + return None + + +def ubisoft_install_dir(folder): + return windows_path(str(folder)).replace("\\", "/").rstrip("/") + "/" + + +def register_ubisoft(folder, product, compat_data): + reg = Path(compat_data) / "pfx" / "system.reg" + if not reg.is_file(): + return "no-registry" + if not wait_for_server(reg.parent): + return "server-running" + for view in UBISOFT_VIEWS: + set_value(reg, view % "", "InstallDir", UBISOFT_WINDOWS_DIR) + set_value(reg, view % ("\\\\Installs\\\\%d" % product), "InstallDir", ubisoft_install_dir(folder)) + return "registered %d" % product + + +UBISOFT_HIVES = {"HKEY_LOCAL_MACHINE": "system.reg", "HKEY_CURRENT_USER": "user.reg"} + + +def manifest_value(values, folder, language): + """The value Connect writes for a manifest registry entry: the install folder, the entry for the + language being played, or the only entry there is.""" + entries = [v for v in values if isinstance(v, dict)] + if not entries: + return None + names = [str(v.get("name") or "") for v in entries] + if "$INSTALL_DIR" in names: + return windows_path(str(folder)).rstrip("\\") + "\\" + for v in entries: + if str(v.get("value") or "").lower() == language.lower(): + return str(v.get("value")) + prefix = language.split("-")[0].lower() + for v in entries: + if str(v.get("value") or "").lower().split("-")[0] == prefix: + return str(v.get("value")) + return str(entries[0].get("value") or entries[0].get("name") or "") + + +def apply_manifest_registry(compat_data, registry, folder, language): + written = 0 + for item in registry or []: + if not isinstance(item, dict): + continue + path = str(item.get("key") or "").replace("/", "\\") + hive, _, rest = path.partition("\\") + target = UBISOFT_HIVES.get(hive.upper()) + if not target or "\\" not in rest: + continue + subkey, _, name = rest.rpartition("\\") + value = manifest_value(item.get("values"), folder, language) + if value is None or not name: + continue + reg = Path(compat_data) / "pfx" / target + parts = subkey.split("\\") + views = [parts] + if target == "system.reg" and len(parts) > 1 and parts[0].lower() == "software" and parts[1].lower() != "wow6432node": + views.append(parts[:1] + ["Wow6432Node"] + parts[1:]) + for view in views: + key = "[" + "\\\\".join(view) + "]" + if set_value(reg, key, name, value): + written += 1 + return written + + +def ubisoft_launch(folder, sidecar, product, compat_data, answer): + """The launch file droiddeck-upc.exe reads: the game, the account and this launch's ticket.""" + account = answer.get("account") if isinstance(answer.get("account"), dict) else {} + user = str(account.get("userId") or "user") + saves = Path(compat_data) / "pfx" / "drive_c/users/steamuser/Saved Games/Ubisoft" / user / str(product) + saves.mkdir(parents=True, exist_ok=True) + exe = str(sidecar.get("exe") or "").replace("\\", "/") + workdir = folder / str(sidecar.get("workdir")) if sidecar.get("workdir") else folder + UBISOFT_CACHE.mkdir(parents=True, exist_ok=True) + return { + "productId": product, + "exe": windows_path(str(folder / exe)), + "args": " ".join(str(a) for a in sidecar.get("args") or []), + "workdir": windows_path(str(workdir)), + "account": account, + "ticket": str(answer.get("ticket") or ""), + "owned": [int(i) for i in answer.get("owned") or [] if str(i).isdigit()], + "products": [p for p in answer.get("products") or [] if isinstance(p, dict) and isinstance(p.get("id"), int)], + "appId": str(answer.get("appId") or ""), + "chunks": [c for c in answer.get("chunks") or [] if isinstance(c, dict) and isinstance(c.get("id"), int)], + "saves": "C:/users/steamuser/Saved Games/Ubisoft/%s/%d/" % (user, product), + "language": str(answer.get("language") or "en-US"), + "bridge": windows_path(str(UBISOFT_CACHE / ("bridge-%d" % product))), + "log": windows_path(str(UBISOFT_CACHE / ("upc-%d.log" % product))), + } + + +def prepare_ubisoft(folder, sidecar, compat_data, launch_dir, proton="", ask_app=None): + launch = folder / UBISOFT_LAUNCH + try: + launch.unlink() + except OSError: + pass + if not compat_data: + return "no-prefix" + product = ubisoft_product(sidecar) + if product is None: + return "no-product" + if not UBISOFT_SERVICE.is_file(): + return "no-service" + made = create_prefix(compat_data, proton) if not (Path(compat_data) / "pfx/user.reg").is_file() else "present" + if made not in ("present", "created"): + return "prefix " + made + runtime = install_runtime(compat_data) + if not ubisoft_runtime_ready(compat_data): + return "runtime " + runtime + registry = register_ubisoft(folder, product, compat_data) + if not launch_dir: + return "runtime %s, %s, no-channel" % (runtime, registry) + answer = (ask_app or ask)(Path(launch_dir) / "stores", {"op": "ubisoft-launch", "store": "ubisoft", "id": str(sidecar.get("id"))}, + timeout=UBISOFT_ASK_WAIT) + if not isinstance(answer, dict) or not answer.get("ok") or not answer.get("ticket"): + reason = "timeout" if answer is None else str(answer.get("reason") or "refused") + return "runtime %s, %s, session %s" % (runtime, registry, reason) + written = 0 + if answer.get("registry") and wait_for_server(Path(compat_data) / "pfx"): + written = apply_manifest_registry(compat_data, answer.get("registry"), folder, str(answer.get("language") or "en-US")) + tmp = launch.with_name(launch.name + ".tmp") + tmp.write_text(json.dumps(ubisoft_launch(folder, sidecar, product, compat_data, answer))) + os.replace(tmp, launch) + return "runtime %s, %s, %d manifest value(s), session ready" % (runtime, registry, written) + COMET_DIR = Path("/usr/local/lib/droiddeck-comet") @@ -613,6 +1076,344 @@ def apply_gog_registry(folder, compat_data, proton, timeout=90, installation=Non return "import-failed" + note +EA_HARDWARE = ".droiddeck-ea-hw.json" +EA_CLIENT = "C:\\Program Files (x86)\\Origin\\Origin.exe" +EA_WMI = ( + ("boardManufacturer", "Win32_BaseBoard", "Manufacturer"), + ("boardSerial", "Win32_BaseBoard", "SerialNumber"), + ("biosManufacturer", "Win32_BIOS", "Manufacturer"), + ("biosSerial", "Win32_BIOS", "SerialNumber"), + ("osInstallDate", "Win32_OperatingSystem", "InstallDate"), + ("osSerial", "Win32_OperatingSystem", "SerialNumber"), + ("gpuPnpId", "Win32_VideoController", "PNPDeviceID"), + ("cpuManufacturer", "Win32_Processor", "Manufacturer"), + ("processorId", "Win32_Processor", "ProcessorId"), + ("brand", "Win32_Processor", "Name"), +) +EA_ROOTS = {"HKLM": "HKEY_LOCAL_MACHINE", "HKCU": "HKEY_CURRENT_USER"} + + +def decode_output(data): + if data[:2] in (b"\xff\xfe", b"\xfe\xff") or (len(data) > 1 and data[1:2] == b"\x00"): + return data.decode("utf-16", "replace") + return data.decode("utf-8", "replace") + + +def wmi_value(text): + rows = [row.strip() for row in text.replace("\r", "\n").split("\n") if row.strip()] + return rows[1] if len(rows) > 1 else "" + + +CPUID_LEAVES = (0, 1, 0x80000002, 0x80000003, 0x80000004) + + +def cpuid_exe(): + """A 32-bit console program that writes the raw CPUID leaves an x86 game sees under the emulator.""" + import struct + base, rva = 0x400000, 0x1000 + buf, written = base + rva + 0x180, base + rva + 0x1D0 + iat = base + rva + 0x138 + code = b"\x53\x57\xbf" + struct.pack(" "%s"' % (cls, prop, windows_path(str(folder / (key + ".txt"))))) + lines.append('vol C: > "%s"' % windows_path(str(folder / "volume.txt"))) + lines.append('hostname > "%s"' % windows_path(str(folder / "hostname.txt"))) + (folder / "cpuid.exe").write_bytes(cpuid_exe()) + lines.append('"%s" > "%s"' % (windows_path(str(folder / "cpuid.exe")), windows_path(str(folder / "cpuid.bin")))) + bat = folder / "probe.bat" + bat.write_bytes(("\r\n".join(lines) + "\r\n").encode()) + try: + subprocess.run([proton, "run", "cmd.exe", "/d", "/c", windows_path(str(bat))], stdin=subprocess.DEVNULL, + stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, timeout=timeout) + except subprocess.TimeoutExpired: + return {}, "timeout" + except OSError: + return {}, "failed" + for key, _, _ in EA_WMI: + try: + values[key] = wmi_value(decode_output((folder / (key + ".txt")).read_bytes())) + except OSError: + values[key] = "" + try: + found = re.search(r"([0-9A-Fa-f]{4})-([0-9A-Fa-f]{4})", decode_output((folder / "volume.txt").read_bytes())) + values["volumeSerial"] = (found.group(1) + found.group(2)).lower() if found else "" + except OSError: + values["volumeSerial"] = "" + try: + values["hostname"] = decode_output((folder / "hostname.txt").read_bytes()).strip().splitlines()[0].strip() + except (OSError, IndexError): + values["hostname"] = "" + try: + values.update(cpuid_values((folder / "cpuid.bin").read_bytes())) + except OSError: + pass + if probe_complete(values): + try: + cache.write_text(json.dumps(values)) + except OSError: + pass + return values, "probed" + return values, "incomplete" + + +def ea_registry_entries(folder, sidecar): + install = windows_path(str(folder)).rstrip("\\") + "\\" + extra = sidecar.get("extra") if isinstance(sidecar.get("extra"), dict) else {} + title = str(extra.get("displayName") or sidecar.get("title") or folder.name).strip() + locale = str(extra.get("locale") or "en_US") + entries = [ + ("HKEY_LOCAL_MACHINE\\SOFTWARE\\Electronic Arts\\EA Desktop", "InstallSuccessful", "true"), + ("HKEY_LOCAL_MACHINE\\SOFTWARE\\Electronic Arts\\Origin", "InstallSuccessful", "true"), + ("HKEY_LOCAL_MACHINE\\SOFTWARE\\Electronic Arts\\Origin", "ClientPath", EA_CLIENT), + ("HKEY_LOCAL_MACHINE\\SOFTWARE\\Origin", "ClientPath", EA_CLIENT), + ] + for content in [c.strip() for c in str(extra.get("contentIds") or extra.get("contentId") or "").split(",")]: + if re.fullmatch(r"[A-Za-z0-9._-]{1,64}", content): + key = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Origin Games\\" + content + entries += [(key, "DisplayName", title), (key, "Install Dir", install), (key, "Locale", locale)] + try: + keys = json.loads(extra.get("registry") or "[]") + except ValueError: + keys = [] + for pair in keys if isinstance(keys, list) else []: + if not isinstance(pair, list) or len(pair) != 2: + continue + key, name = str(pair[0]), str(pair[1]) + root, _, rest = key.partition("\\") + key = EA_ROOTS.get(root.upper(), root) + ("\\" + rest if rest else "") + if key.upper().startswith(("HKEY_LOCAL_MACHINE\\", "HKEY_CURRENT_USER\\")) and name and "\n" not in key + name: + entries.append((key, name, install)) + if title: + entries.append((key, "DisplayName", title)) + entries.append((key, "Locale", locale)) + return entries + + +def ea_registry(folder, sidecar, compat_data, proton, timeout=90): + if not compat_data or not proton or not Path(proton).is_file(): + return "no-proton" + pfx = Path(compat_data) / "pfx" + text = "Windows Registry Editor Version 5.00\r\n\r\n" + "".join( + '[%s]\r\n"%s"="%s"\r\n\r\n' % (key, reg_escape(name), reg_escape(value)) for key, name, value in ea_registry_entries(folder, sidecar)) + stamp = hashlib.sha256(text.encode("utf-8")).hexdigest() + marker = pfx / (".droiddeck-ea-registry-" + re.sub(r"[^A-Za-z0-9._-]", "_", str(sidecar.get("id")))) + try: + if marker.is_file() and marker.read_text() == stamp and (pfx / "system.reg").is_file(): + return "ready" + with tempfile.TemporaryDirectory(prefix="droiddeck-ea-") as tmp: + source = Path(tmp) / "registry.reg" + source.write_bytes(b"\xff\xfe" + text.encode("utf-16-le")) + executable = pfx / "drive_c/windows/system32/reg.exe" + for view in ("/reg:32", "/reg:64"): + run = subprocess.run([proton, "run", str(executable) if executable.is_file() else "reg.exe", "import", windows_path(str(source)), view], + stdin=subprocess.DEVNULL, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, timeout=timeout) + if run.returncode: + return "import-failed" + marker.write_text(stamp) + return "written" + except subprocess.TimeoutExpired: + return "timeout" + except OSError: + return "import-failed" + + +def find_case(folder, relative): + current = Path(folder) + for part in [p for p in relative.replace("\\", "/").split("/") if p and p != "."]: + exact = current / part + if exact.exists(): + current = exact + continue + try: + current = next(c for c in current.iterdir() if c.name.lower() == part.lower()) + except (OSError, StopIteration): + return None + return current if current != Path(folder) else None + + +def touchup_args(raw, locale, install): + raw = raw.replace("{locale}", locale) + raw = raw.replace('"{installLocation}"', '"%s"' % install).replace("{installLocation}", install) + try: + return shlex.split(raw.replace("\\", "\\\\")) + except ValueError: + return raw.split() + + +def ea_touchup(folder, sidecar, compat_data, proton, timeout=900): + extra = sidecar.get("extra") if isinstance(sidecar.get("extra"), dict) else {} + relative = str(extra.get("touchup") or "") + if not relative: + return "none" + exe = find_case(folder, relative) + if exe is None or not exe.is_file(): + return "missing" + if not compat_data or not proton or not Path(proton).is_file(): + return "no-proton" + pfx = Path(compat_data) / "pfx" + stamp = str(sidecar.get("installVersion") or "") + " " + str(sidecar.get("installedAt") or "") + marker = pfx / (".droiddeck-ea-touchup-" + re.sub(r"[^A-Za-z0-9._-]", "_", str(sidecar.get("id")))) + try: + if marker.is_file() and marker.read_text() == stamp: + return "done" + except OSError: + pass + args = touchup_args(str(extra.get("touchupArgs") or ""), str(extra.get("locale") or "en_US"), windows_path(str(folder)).rstrip("\\")) + try: + run = subprocess.run([proton, "run", str(exe)] + args, cwd=str(exe.parent), stdin=subprocess.DEVNULL, + stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, timeout=timeout) + result = "ok" if run.returncode == 0 else "exit-%d" % run.returncode + except subprocess.TimeoutExpired: + result = "timeout" + except OSError: + return "failed" + try: + marker.write_text(stamp) + except OSError: + pass + return result + + +def write_licenses(compat_data, licenses): + if not compat_data: + return 0 + root = Path(compat_data) / "pfx/drive_c" + written = 0 + for item in licenses or []: + relative = str(item.get("path") or "") if isinstance(item, dict) else "" + if not relative or relative.startswith("/") or ".." in relative.split("/"): + continue + target = root / relative + try: + target.parent.mkdir(parents=True, exist_ok=True) + target.write_bytes(base64.b64decode(item.get("data") or "")) + written += 1 + except (OSError, binascii.Error): + pass + return written + + +def prepare_ea(folder, sidecar, compat_data, launch_dir): + game = str(sidecar.get("id")) + proton = os.environ.get("BL_STORE_PROTON", "") + made = create_prefix(compat_data, proton) + ready = made in ("present", "created") or (compat_data and (Path(compat_data) / "pfx/user.reg").is_file()) + stub = install_origin_stub(compat_data) if ready else "no-prefix" + hardware, probe = ea_hardware(compat_data, proton) if ready else ({}, "no-prefix") + answer = None + if launch_dir: + answer = ask(Path(launch_dir) / "stores", {"op": "ea-prepare", "store": "ea", "id": game, "hardware": hardware}, timeout=40.0) + sidecar = sidecar_at(Path(folder)) or sidecar + log("ea %s prefix=%s stub=%s hardware=%s registry=%s touchup=%s" % ( + game, made, stub, probe, ea_registry(folder, sidecar, compat_data, proton), ea_touchup(folder, sidecar, compat_data, proton))) + if answer is None: + log("ea %s session=no reason=%s" % (game, "timeout" if launch_dir else "no-channel")) + return + written = write_licenses(compat_data, answer.get("licenses")) + log("ea %s session=%s reason=%s lsx=%s licence=%s files=%d" % ( + game, "yes" if answer.get("ok") else "no", answer.get("reason", ""), answer.get("lsx"), answer.get("license", ""), written)) + + def gog_support_actions(folder): found = [] for script in sorted(Path(folder).glob(GOG_SCRIPTS)): @@ -771,6 +1572,28 @@ def main(argv): prepare_gog(sidecar, compat_data, launch_dir) log("gog registry: " + apply_gog_registry(folder, compat_data, os.environ.get("BL_STORE_PROTON", ""))) log("gog support data: " + gog_support_data(folder, compat_data, os.environ.get("BL_STORE_PROTON", ""))) + if store == "rockstar": + if game not in ROCKSTAR_TITLES and not rockstar_sdk(folder, sidecar): + if compat_data: + (Path(compat_data) / "pfx" / ROCKSTAR_FOLDER / "launch.json").unlink(missing_ok=True) + return STORE_GAME + try: + state = prepare_rockstar(folder, sidecar, compat_data, launch_dir, os.environ.get("BL_STORE_PROTON", "")) + except (OSError, ValueError, subprocess.TimeoutExpired): + state = "preparation-failed" + log("rockstar %s: %s" % (game, state)) + if state != "ready" and launch_dir: + ask(Path(launch_dir) / "stores", {"op": "rockstar-exited", "store": "rockstar", "id": game}, timeout=1.0) + return STORE_GAME if state == "ready" else RAN_FAILED + if store == "ubisoft": + try: + log("ubisoft %s: %s" % (game, prepare_ubisoft(folder, sidecar, compat_data, launch_dir, os.environ.get("BL_STORE_PROTON", "")))) + except OSError as e: + try: + (folder / UBISOFT_LAUNCH).unlink() + except OSError: + pass + log("ubisoft %s: not prepared (%s), starting directly" % (game, e)) if store == "epic": handled = os.environ.get(EPIC_HANDLED) == "1" and (folder / EPIC_ARGS).is_file() if not handled: @@ -808,6 +1631,9 @@ def main(argv): got = bool(answer.get("code")) log("epic launch id=%s code=%s reason=%s" % (game, "yes" if got else "no", answer.get("reason", ""))) log("epic prefix=%s %s" % (prefix_id or "?", provision_prefix(compat_data))) + if store == "ea": + prepare_ea(folder, sidecar, compat_data, launch_dir) + return STORE_GAME if not cloud_on(sidecar): if store in CLOUD_STORES: log("cloud %s %s down result=skipped reason=off" % (store, game)) diff --git a/tools/linuxfs/overlay/usr/local/bin/droiddeck-wine-pe b/tools/linuxfs/overlay/usr/local/bin/droiddeck-wine-pe index 7034bf3013..65c3446a2a 100755 --- a/tools/linuxfs/overlay/usr/local/bin/droiddeck-wine-pe +++ b/tools/linuxfs/overlay/usr/local/bin/droiddeck-wine-pe @@ -1,4 +1,5 @@ #!/usr/bin/python3 +import re from pathlib import Path @@ -75,8 +76,16 @@ def pe_has_arm64ec_metadata(path): return False +# Only x64 code and members of the same runtime family import these, so an x64 copy loads in an +# ARM64EC prefix, and games check for a newer version than Wine's builtins report. +VC_RUNTIME = re.compile(r"(msvc[pr]\d.*|vcruntime\d.*|vcomp\d*|vcamp\d.*|vccorlib\d.*|concrt\d.*|mfcm?\d.*)\.dll", + re.IGNORECASE) + + def machine_compatible(path, machines, machine=None): machine = pe_machine(path) if machine is None else machine + if machine == 0x8664 and 0xA641 in machines and VC_RUNTIME.fullmatch(Path(path).name): + return True if machine == 0x8664 and pe_has_arm64ec_metadata(path): return 0xA641 in machines return machine in machines diff --git a/tools/linuxfs/overlay/usr/local/bin/steam-compatibility b/tools/linuxfs/overlay/usr/local/bin/steam-compatibility index 4a2cbcb15b..cf616c86fc 100755 --- a/tools/linuxfs/overlay/usr/local/bin/steam-compatibility +++ b/tools/linuxfs/overlay/usr/local/bin/steam-compatibility @@ -152,6 +152,13 @@ bl_components() { else cm_app="" fi + if [ "$cm_app" = 2929927072 ] && [[ "${SteamAppId:-}" =~ ^[0-9]{1,10}$ ]] && (( 10#$SteamAppId > 0 && 10#$SteamAppId <= 4294967295 )); then + cm_app=$((10#$SteamAppId)) + elif [ "$cm_app" = 2929927072 ] && [[ "${SteamGameId:-}" =~ ^[1-9][0-9]{9,19}$ ]] && + { [ ${#SteamGameId} -lt 20 ] || [[ ! "$SteamGameId" > 18446744073709551615 ]]; } && + (( (10#$SteamGameId & 0xFFFFFFFF) == 0x02000000 && ((10#$SteamGameId >> 32) & 0xFFFFFFFF) != 0 )); then + cm_app=$(( (10#$SteamGameId >> 32) & 0xFFFFFFFF )) + fi if [ -z "$cm_app" ]; then echo "droiddeck-proton: components: invalid game prefix, left as it is" >&2 return 0 @@ -1533,7 +1540,7 @@ def register_default(config_path, apps=(), protect=(), default=None, catalog=Non auto = followers(state, current) known = {app for app in state.get("owned", ()) if isinstance(app, str)} if isinstance(state.get("owned"), list) else set() pinned = {app: current[app] for app in set(owned) - known - if current.get(app) in {TOOL, previous} | gone and app not in auto} + if app in current and current.get(app) in {TOOL, previous} | gone and app not in auto} if pinned and isinstance(auto, dict): state["auto"] = dict(auto, **pinned) state["owned"] = sorted(set(owned), key=app_order) diff --git a/tools/linuxfs/preload/binfmt.c b/tools/linuxfs/preload/binfmt.c index eb912efe11..dbe2977265 100644 --- a/tools/linuxfs/preload/binfmt.c +++ b/tools/linuxfs/preload/binfmt.c @@ -18,6 +18,8 @@ typedef int (*spawn_fn)(pid_t *, const char *, const posix_spawn_file_actions_t *, const posix_spawnattr_t *, char *const[], char *const[]); +__attribute__((visibility("hidden"))) +char *const *bl_webhelper_argv(const char *path, char *const argv[], char *const envp[]); #if defined(__aarch64__) || defined(BINFMT_TEST) @@ -141,21 +143,26 @@ __attribute__((visibility("hidden"))) int bl_binfmt_spawn(pid_t *pid, const char } int execvpe(const char *file, char *const argv[], char *const envp[]) { + char resolved[PATH_MAX]; + const char *path = lookup(file, resolved, sizeof resolved) ? resolved : file; + char *const *adjusted = bl_webhelper_argv(path, argv, envp); static int (*real)(const char *, char *const[], char *const[]); if (!real) real = (int (*)(const char *, char *const[], char *const[]))dlsym(RTLD_NEXT, "execvpe"); - bl_binfmt_before_search(file, argv, envp); - real(file, argv, envp); - return bl_binfmt_after_search(file, argv, envp, errno); + bl_binfmt_before_search(file, (char *const *)adjusted, envp); + real(file, (char *const *)adjusted, envp); + return bl_binfmt_after_search(file, (char *const *)adjusted, envp, errno); } int posix_spawnp(pid_t *pid, const char *file, const posix_spawn_file_actions_t *fa, const posix_spawnattr_t *attr, char *const argv[], char *const envp[]) { + char path[PATH_MAX]; + int found = lookup(file, path, sizeof path); + char *const *adjusted = bl_webhelper_argv(found ? path : file, argv, envp); static spawn_fn real, spawn; if (!real) real = (spawn_fn)dlsym(RTLD_NEXT, "posix_spawnp"); if (!spawn) spawn = (spawn_fn)dlsym(RTLD_NEXT, "posix_spawn"); - char path[PATH_MAX]; - if (!handing_off() || !lookup(file, path, sizeof path)) return real(pid, file, fa, attr, argv, envp); - return bl_binfmt_spawn(pid, path, fa, attr, argv, envp, spawn); + if (!handing_off() || !found) return real(pid, file, fa, attr, (char *const *)adjusted, envp); + return bl_binfmt_spawn(pid, path, fa, attr, (char *const *)adjusted, envp, spawn); } #else diff --git a/tools/linuxfs/preload/clockpause.c b/tools/linuxfs/preload/clockpause.c index 19a1d728ab..eed7a401d7 100644 --- a/tools/linuxfs/preload/clockpause.c +++ b/tools/linuxfs/preload/clockpause.c @@ -81,7 +81,6 @@ static void cp_init(void) { struct stat st; void *map; int fd; - if (strcmp(program_invocation_short_name, "plasmashell") != 0) return; if (!cp_find_cond_bit()) return; fd = open(CP_CTL, O_RDONLY | O_CLOEXEC); if (fd < 0) return; diff --git a/tools/linuxfs/preload/descriptor.c b/tools/linuxfs/preload/descriptor.c new file mode 100644 index 0000000000..681dce999e --- /dev/null +++ b/tools/linuxfs/preload/descriptor.c @@ -0,0 +1,291 @@ +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define DESCRIPTOR "user.wine.sd" +#define STORE "/.droiddeck-descriptors" +#define ENTRY_MAX (PATH_MAX * 2) + +int bl_is_wineserver(void) __attribute__((visibility("hidden"))); + +static int store_seen; + +static int kept(const char *name) { + return name != NULL && strcmp(name, DESCRIPTOR) == 0 && bl_is_wineserver(); +} + +static int store_root(char *out, size_t size) { + const char *prefix = getenv("WINEPREFIX"); + int n; + + if (prefix == NULL || prefix[0] != '/') return -1; + n = snprintf(out, size, "%s" STORE, prefix); + return n > 0 && (size_t)n < size ? n : -1; +} + +static int store_exists(void) { + char root[PATH_MAX]; + + if (store_seen) return 1; + if (store_root(root, sizeof(root)) < 0) return 0; + store_seen = access(root, F_OK) == 0; + return store_seen; +} + +static int entry_for(const char *path, char *out, size_t size, const char *suffix, int create) { + int used = store_root(out, size); + const char *part = path, *end; + + if (used < 0 || path[0] != '/') return -1; + if (create && mkdir(out, 0700) != 0 && errno != EEXIST) return -1; + while (*part == '/') part++; + if (*part == '\0') return -1; + for (;;) { + size_t length; + const char *tail; + + end = strchr(part, '/'); + length = end ? (size_t)(end - part) : strlen(part); + tail = end ? ".d" : suffix; + if (length + strlen(tail) > NAME_MAX || used + length + strlen(tail) + 2 > size) return -1; + out[used++] = '/'; + memcpy(out + used, part, length); + used += (int)length; + strcpy(out + used, tail); + used += (int)strlen(tail); + if (!end) break; + if (create && mkdir(out, 0700) != 0 && errno != EEXIST) return -1; + part = end + 1; + } + if (create) store_seen = 1; + return 0; +} + +static int path_of(int fd, char *out, size_t size) { + char link[40]; + ssize_t n; + + snprintf(link, sizeof(link), "/proc/self/fd/%d", fd); + n = readlink(link, out, size - 1); + if (n <= 0 || out[0] != '/') return -1; + out[n] = '\0'; + return 0; +} + +static int resolved(const char *path, char *out, size_t size) { + int fd, result; + + if (path == NULL) return -1; + fd = open(path, O_PATH | O_NOFOLLOW | O_CLOEXEC); + if (fd < 0) return -1; + result = path_of(fd, out, size); + close(fd); + return result; +} + +static int entry_of(int fd, char *out, size_t size, int create) { + char path[PATH_MAX]; + + if (path_of(fd, path, sizeof(path)) != 0) return -1; + return entry_for(path, out, size, ".sd", create); +} + +static ssize_t stored_read(int fd, void *value, size_t size) { + char entry[ENTRY_MAX]; + struct stat st; + ssize_t got = 0; + int file; + + if (entry_of(fd, entry, sizeof(entry), 0) != 0) return -2; + file = open(entry, O_RDONLY | O_NOFOLLOW | O_CLOEXEC); + if (file < 0) { + if (errno != ENOENT) return -2; + errno = ENODATA; + return -1; + } + if (fstat(file, &st) != 0) { + close(file); + return -2; + } + if (size == 0) { + close(file); + return (ssize_t)st.st_size; + } + if ((size_t)st.st_size > size) { + close(file); + errno = ERANGE; + return -1; + } + while (got < st.st_size) { + ssize_t n = read(file, (char *)value + got, (size_t)(st.st_size - got)); + if (n <= 0) { + close(file); + return -2; + } + got += n; + } + close(file); + return got; +} + +static int stored_write(int fd, const void *value, size_t size) { + char entry[ENTRY_MAX], fresh[ENTRY_MAX + 8]; + size_t put = 0; + int file; + + if (entry_of(fd, entry, sizeof(entry), 1) != 0) return -1; + snprintf(fresh, sizeof(fresh), "%s.new", entry); + file = open(fresh, O_WRONLY | O_CREAT | O_TRUNC | O_NOFOLLOW | O_CLOEXEC, 0600); + if (file < 0) return -1; + while (put < size) { + ssize_t n = write(file, (const char *)value + put, size - put); + if (n <= 0) { + close(file); + unlinkat(AT_FDCWD, fresh, 0); + return -1; + } + put += (size_t)n; + } + if (close(file) != 0 || renameat(AT_FDCWD, fresh, AT_FDCWD, entry) != 0) { + unlinkat(AT_FDCWD, fresh, 0); + return -1; + } + return 0; +} + +ssize_t fgetxattr(int fd, const char *name, void *value, size_t size) { + static ssize_t (*next)(int, const char *, void *, size_t); + ssize_t result; + + if (next == NULL) next = dlsym(RTLD_NEXT, "fgetxattr"); + if (next == NULL) { + errno = ENOSYS; + return -1; + } + result = next(fd, name, value, size); + if (result >= 0 || errno != ENOTSUP || !kept(name)) return result; + result = stored_read(fd, value, size); + if (result == -2) { + errno = ENOTSUP; + return -1; + } + return result; +} + +int fsetxattr(int fd, const char *name, const void *value, size_t size, int flags) { + static int (*next)(int, const char *, const void *, size_t, int); + int saved = errno, result; + + if (next == NULL) next = dlsym(RTLD_NEXT, "fsetxattr"); + if (next == NULL) { + errno = ENOSYS; + return -1; + } + result = next(fd, name, value, size, flags); + if (result == 0 || errno != ENOTSUP || !kept(name)) return result; + if (stored_write(fd, value, size) != 0) { + errno = ENOTSUP; + return -1; + } + errno = saved; + return 0; +} + +int fremovexattr(int fd, const char *name) { + static int (*next)(int, const char *); + char entry[ENTRY_MAX]; + int saved = errno, result; + + if (next == NULL) next = dlsym(RTLD_NEXT, "fremovexattr"); + if (next == NULL) { + errno = ENOSYS; + return -1; + } + result = next(fd, name); + if (result == 0 || errno != ENOTSUP || !kept(name)) return result; + if (entry_of(fd, entry, sizeof(entry), 0) != 0) { + errno = ENOTSUP; + return -1; + } + if (unlinkat(AT_FDCWD, entry, 0) != 0) { + errno = errno == ENOENT ? ENODATA : ENOTSUP; + return -1; + } + errno = saved; + return 0; +} + +static int tracked(const char *path, char *out, size_t size) { + int saved = errno, found; + + found = bl_is_wineserver() && store_exists() && resolved(path, out, size) == 0; + errno = saved; + return found; +} + +static void forget(const char *path, int folder) { + char entry[ENTRY_MAX]; + int saved = errno; + + if (entry_for(path, entry, sizeof(entry), ".sd", 0) == 0) unlinkat(AT_FDCWD, entry, 0); + if (folder && entry_for(path, entry, sizeof(entry), ".d", 0) == 0) unlinkat(AT_FDCWD, entry, AT_REMOVEDIR); + errno = saved; +} + +static void follow(const char *from, const char *to) { + static const char *const kinds[] = {".sd", ".d"}; + char old[ENTRY_MAX], new[ENTRY_MAX]; + int saved = errno; + + for (size_t i = 0; i < 2; i++) { + if (entry_for(from, old, sizeof(old), kinds[i], 0) != 0) continue; + if (access(old, F_OK) != 0) { + if (i == 0 && entry_for(to, new, sizeof(new), kinds[i], 0) == 0) unlinkat(AT_FDCWD, new, 0); + continue; + } + if (entry_for(to, new, sizeof(new), kinds[i], 1) != 0 || renameat(AT_FDCWD, old, AT_FDCWD, new) != 0) { + if (i == 0) unlinkat(AT_FDCWD, old, 0); + } + } + errno = saved; +} + +__attribute__((visibility("hidden"))) +int bl_descriptor_unlink(const char *path, int (*real)(const char *)) { + char target[PATH_MAX]; + int known = tracked(path, target, sizeof(target)), result = real(path); + + if (result == 0 && known) forget(target, 0); + return result; +} + +__attribute__((visibility("hidden"))) +int bl_descriptor_rmdir(const char *path, int (*real)(const char *)) { + char target[PATH_MAX]; + int known = tracked(path, target, sizeof(target)), result = real(path); + + if (result == 0 && known) forget(target, 1); + return result; +} + +__attribute__((visibility("hidden"))) +int bl_descriptor_remove(const char *path, int (*real)(const char *)) { + return bl_descriptor_rmdir(path, real); +} + +__attribute__((visibility("hidden"))) +int bl_descriptor_rename(const char *from, const char *to, int (*real)(const char *, const char *)) { + char old[PATH_MAX], new[PATH_MAX]; + int known = tracked(from, old, sizeof(old)), result = real(from, to); + + if (result == 0 && known && tracked(to, new, sizeof(new))) follow(old, new); + return result; +} diff --git a/tools/linuxfs/preload/dircache.c b/tools/linuxfs/preload/dircache.c index 296faa616b..a94717bd78 100644 --- a/tools/linuxfs/preload/dircache.c +++ b/tools/linuxfs/preload/dircache.c @@ -83,6 +83,19 @@ static int notify = -1; static int forked; static struct { dev_t dev; int fuse; } devs[8]; static int ndevs; +// Libraries preloaded after this one can call back in while a lock is held (the native userland +// hook's inotify_add_watch calls mkdir() by name); such calls go straight to the next library. +static __thread int holding; + +static void take(pthread_mutex_t *m) { + pthread_mutex_lock(m); + holding++; +} + +static void give(pthread_mutex_t *m) { + holding--; + pthread_mutex_unlock(m); +} static long long now_ns(void) { struct timespec t; @@ -109,32 +122,32 @@ static int enabled(void) { } static int eligible(const char *path) { - if (path == NULL || path[0] != '/' || !enabled()) return 0; + if (holding || path == NULL || path[0] != '/' || !enabled()) return 0; const char *s = strstr(path, "/steamapps"); return s && (s[10] == '/' || s[10] == 0); } static int on_fuse(dev_t dev, const char *path) { - pthread_mutex_lock(&lock); + take(&lock); for (int i = 0; i < ndevs; i++) { if (devs[i].dev == dev) { int fuse = devs[i].fuse; - pthread_mutex_unlock(&lock); + give(&lock); return fuse; } } - pthread_mutex_unlock(&lock); + give(&lock); struct statfs fs; int saved = errno; int fuse = statfs(path, &fs) == 0 && (unsigned long)fs.f_type == FUSE_MAGIC; errno = saved; - pthread_mutex_lock(&lock); + take(&lock); if (ndevs < 8) { devs[ndevs].dev = dev; devs[ndevs].fuse = fuse; ndevs++; } - pthread_mutex_unlock(&lock); + give(&lock); return fuse; } @@ -404,7 +417,7 @@ __attribute__((constructor)) static void resolve(void) { #pragma GCC diagnostic pop static DIR *hit(const struct stat *st, struct handle *h, long long now) { - pthread_mutex_lock(&lock); + take(&lock); if (!changing) pump(NULL, 0); int slot = find(st->st_dev, st->st_ino); if (slot >= 0 && same(table[slot], st) && now - table[slot]->filled < DIR_TTL_NS && records(table[slot]) == 0) { @@ -413,7 +426,7 @@ static DIR *hit(const struct stat *st, struct handle *h, long long now) { h->snap->used = now; DIR *d = wrap(h); if (d) { - pthread_mutex_unlock(&lock); + give(&lock); return d; } unref(h->snap); @@ -421,7 +434,7 @@ static DIR *hit(const struct stat *st, struct handle *h, long long now) { } else if (slot >= 0) { drop(slot); } - pthread_mutex_unlock(&lock); + give(&lock); return NULL; } @@ -462,11 +475,11 @@ static int above(struct handle *h, const char *path) { } static int track(struct handle *h, const char *path) { - pthread_mutex_lock(&lock); + take(&lock); h->wd = watch(path, WATCHED); DIR *d = h->wd >= 0 && above(h, path) ? wrap(h) : NULL; if (d == NULL) let_go(h->wd, h->up, h->nup); - pthread_mutex_unlock(&lock); + give(&lock); return d != NULL; } @@ -486,11 +499,11 @@ static void filling(struct handle *h, DIR *real, const struct stat *st, long lon } static void untrack(struct handle *h) { - pthread_mutex_lock(&lock); + take(&lock); int i = registered((DIR *)h); if (i >= 0) __atomic_store_n(&handles[i], NULL, __ATOMIC_RELEASE); let_go(h->wd, h->up, h->nup); - pthread_mutex_unlock(&lock); + give(&lock); } DIR *opendir(const char *path) { @@ -553,11 +566,11 @@ static void finish(struct handle *h) { h->fill = NULL; int current = stat(h->path, &st) == 0 && same(l, &st); if (current) l->folds = folds(h->path, &st); - pthread_mutex_lock(&lock); + take(&lock); if (!changing) pump(NULL, 0); if (current && !__atomic_load_n(&h->dirty, __ATOMIC_RELAXED)) install(l); else destroy(l); - pthread_mutex_unlock(&lock); + give(&lock); } static struct dirent64 *entry(struct handle *h) { @@ -624,7 +637,8 @@ int readdir_r(DIR *d, struct dirent *out, struct dirent **result) { int closedir(DIR *d) { NEXT(closedir); - pthread_mutex_lock(&lock); + if (holding && registered(d) < 0) return next_closedir(d); + take(&lock); int i = registered(d); struct handle *h = i >= 0 ? handles[i] : NULL; if (h) { @@ -632,7 +646,7 @@ int closedir(DIR *d) { if (h->snap) unref(h->snap); let_go(h->wd, h->up, h->nup); } - pthread_mutex_unlock(&lock); + give(&lock); if (h == NULL) return next_closedir(d); int r = 0; if (h->real) r = next_closedir(h->real); @@ -704,10 +718,10 @@ static int watching(const char *path) { } static void begin(void) { - pthread_mutex_lock(&lock); + take(&lock); pump(NULL, 0); changing = 1; - pthread_mutex_unlock(&lock); + give(&lock); } static void before(struct side *s) { @@ -796,10 +810,10 @@ static int patch(struct side *s, int what, uint32_t event, int ok, int error, co } static void end(struct expect *x, int nx) { - pthread_mutex_lock(&lock); + take(&lock); pump(x, nx); changing = 0; - pthread_mutex_unlock(&lock); + give(&lock); } int bl_dircache_create(int dirfd, const char *path, int flags, mode_t mode, @@ -809,17 +823,17 @@ int bl_dircache_create(int dirfd, const char *path, int flags, mode_t mode, struct side s; if (!(flags & O_CREAT) || (dirfd != AT_FDCWD && (path == NULL || path[0] != '/')) || !watching(path) || !split(path, &s)) return real(dirfd, path, flags, mode); - pthread_mutex_lock(&oplock); + take(&oplock); begin(); before(&s); int fd = real(dirfd, path, flags, mode); int saved = errno; struct expect x; - pthread_mutex_lock(&lock); + take(&lock); int nx = patch(&s, ADDED, IN_CREATE, fd >= 0, saved, path, &x); - pthread_mutex_unlock(&lock); + give(&lock); end(&x, nx); - pthread_mutex_unlock(&oplock); + give(&oplock); errno = saved; return fd; } @@ -829,26 +843,34 @@ int bl_dircache_create(int dirfd, const char *path, int flags, mode_t mode, NEXT(name); \ struct side s; \ if (!watching(path) || !split(path, &s)) return call; \ - pthread_mutex_lock(&oplock); \ + take(&oplock); \ begin(); \ before(&s); \ int r = call; \ int saved = errno; \ struct expect x; \ - pthread_mutex_lock(&lock); \ + take(&lock); \ int nx = patch(&s, what, event, r == 0, saved, what == ADDED ? path : NULL, &x); \ if (r == 0 && what == REMOVED) forget_below(path); \ - pthread_mutex_unlock(&lock); \ + give(&lock); \ end(&x, nx); \ - pthread_mutex_unlock(&oplock); \ + give(&oplock); \ errno = saved; \ return r; \ } ONE_PATH(mkdir, ADDED, IN_CREATE, next_mkdir(path, mode), mode_t mode) -ONE_PATH(rmdir, REMOVED, IN_DELETE, next_rmdir(path)) -ONE_PATH(unlink, REMOVED, IN_DELETE, next_unlink(path)) -ONE_PATH(remove, REMOVED, IN_DELETE, next_remove(path)) +int bl_descriptor_unlink(const char *path, int (*real)(const char *)) __attribute__((visibility("hidden"))); +int bl_descriptor_rmdir(const char *path, int (*real)(const char *)) __attribute__((visibility("hidden"))); +int bl_descriptor_remove(const char *path, int (*real)(const char *)) __attribute__((visibility("hidden"))); +int bl_descriptor_rename(const char *from, const char *to, int (*real)(const char *, const char *)) + __attribute__((visibility("hidden"))); + +static int moved(const char *from, const char *to) { return bl_descriptor_rename(from, to, next_rename); } + +ONE_PATH(rmdir, REMOVED, IN_DELETE, bl_descriptor_rmdir(path, next_rmdir)) +ONE_PATH(unlink, REMOVED, IN_DELETE, bl_descriptor_unlink(path, next_unlink)) +ONE_PATH(remove, REMOVED, IN_DELETE, bl_descriptor_remove(path, next_remove)) #define TWO_PATHS(name, gone, event, call) \ int name(const char *from, const char *to) { \ @@ -856,7 +878,7 @@ ONE_PATH(remove, REMOVED, IN_DELETE, next_remove(path)) struct side a, b; \ int track_a = gone && watching(from) && split(from, &a), track_b = watching(to) && split(to, &b); \ if (!track_a && !track_b) return call(from, to); \ - pthread_mutex_lock(&oplock); \ + take(&oplock); \ begin(); \ if (track_a) before(&a); \ if (track_b) before(&b); \ @@ -864,16 +886,16 @@ ONE_PATH(remove, REMOVED, IN_DELETE, next_remove(path)) int saved = errno; \ struct expect x[2]; \ int nx = 0; \ - pthread_mutex_lock(&lock); \ + take(&lock); \ if (track_a) nx += patch(&a, REMOVED, IN_MOVED_FROM, r == 0, saved, NULL, &x[nx]); \ if (track_b) { \ if (track_a && strcmp(a.dir, b.dir) == 0) b.known = stat(b.dir, &b.before) == 0; \ nx += patch(&b, ADDED, event, r == 0, saved, to, &x[nx]); \ } \ if (r == 0 && gone) { forget_below(from); forget_below(to); } \ - pthread_mutex_unlock(&lock); \ + give(&lock); \ end(x, nx); \ - pthread_mutex_unlock(&oplock); \ + give(&oplock); \ errno = saved; \ return r; \ } @@ -881,7 +903,7 @@ ONE_PATH(remove, REMOVED, IN_DELETE, next_remove(path)) int bl_link_lock(const char *oldpath, const char *newpath, int result) __attribute__((visibility("hidden"))); static int link_or_lock(const char *from, const char *to) { return bl_link_lock(from, to, next_link(from, to)); } -TWO_PATHS(rename, 1, IN_MOVED_TO, next_rename) +TWO_PATHS(rename, 1, IN_MOVED_TO, moved) TWO_PATHS(link, 0, IN_CREATE, link_or_lock) TWO_PATHS(symlink, 0, IN_CREATE, next_symlink) @@ -923,13 +945,13 @@ int bl_dircache_absent(const char *path) { for (const char *c = s.name; *c; c++) if ((unsigned char)*c >= 0x80) return 0; long long now = now_ns(); - pthread_mutex_lock(&lock); + take(&lock); int absent = 0; if (!changing) { pump(NULL, 0); absent = listed_absent(s.dir, s.name, now); } - pthread_mutex_unlock(&lock); + give(&lock); return absent; } diff --git a/tools/linuxfs/preload/net.c b/tools/linuxfs/preload/net.c index 4946db7f9c..e45ed9c5c0 100644 --- a/tools/linuxfs/preload/net.c +++ b/tools/linuxfs/preload/net.c @@ -271,7 +271,8 @@ __attribute__((visibility("hidden"))) void bl_binfmt_before(const char *path, ch __attribute__((visibility("hidden"))) int bl_binfmt_retry(const char *path, char *const argv[], char *const envp[], int error); __attribute__((visibility("hidden"))) void bl_binfmt_before_search(const char *file, char *const argv[], char *const envp[]); __attribute__((visibility("hidden"))) int bl_binfmt_after_search(const char *file, char *const argv[], char *const envp[], int error); -__attribute__((visibility("hidden"))) char *const *bl_webhelper_argv(const char *path, char *const argv[]); +__attribute__((visibility("hidden"))) +char *const *bl_webhelper_argv(const char *path, char *const argv[], char *const envp[]); __attribute__((visibility("hidden"))) int bl_binfmt_spawn(pid_t *pid, const char *path, const posix_spawn_file_actions_t *fa, const posix_spawnattr_t *attr, char *const argv[], char *const envp[], spawn_fn real); @@ -341,7 +342,7 @@ static char **web_helper_redirect(const char *path, char *const argv[], const ch } int execve(const char *path, char *const argv_in[], char *const envp[]) { - char *const *argv = bl_webhelper_argv(path, argv_in); + char *const *argv = bl_webhelper_argv(path, argv_in, envp); static int (*real)(const char *, char *const[], char *const[]); if (!real) real = (int (*)(const char *, char *const[], char *const[]))dlsym(RTLD_NEXT, "execve"); maybe_answer_lsof(path, argv); @@ -372,7 +373,7 @@ static int answer_lsof_via_spawn(const char *path, char *const argv[], pid_t *pi } int execvp(const char *file, char *const argv_in[]) { - char *const *argv = bl_webhelper_argv(file, argv_in); + char *const *argv = bl_webhelper_argv(file, argv_in, environ); static int (*real)(const char *, char *const[]); if (!real) real = (int (*)(const char *, char *const[]))dlsym(RTLD_NEXT, "execvp"); maybe_answer_lsof(file, argv); @@ -382,7 +383,7 @@ int execvp(const char *file, char *const argv_in[]) { } int execv(const char *path, char *const argv_in[]) { - char *const *argv = bl_webhelper_argv(path, argv_in); + char *const *argv = bl_webhelper_argv(path, argv_in, environ); static int (*real)(const char *, char *const[]); if (!real) real = (int (*)(const char *, char *const[]))dlsym(RTLD_NEXT, "execv"); maybe_answer_lsof(path, argv); @@ -406,5 +407,6 @@ int posix_spawn(pid_t *pid, const char *path, const posix_spawn_file_actions_t * } static spawn_fn real; if (!real) real = (spawn_fn)dlsym(RTLD_NEXT, "posix_spawn"); - return bl_binfmt_spawn(pid, path, fa, attr, argv, envp, real); + char *const *adjusted = bl_webhelper_argv(path, argv, envp); + return bl_binfmt_spawn(pid, path, fa, attr, (char *const *)adjusted, envp, real); } diff --git a/tools/linuxfs/preload/owner.c b/tools/linuxfs/preload/owner.c index 78ada3bf00..1e493f8a80 100644 --- a/tools/linuxfs/preload/owner.c +++ b/tools/linuxfs/preload/owner.c @@ -12,7 +12,8 @@ #define FAT_MAGIC 0x4d44 #define EXFAT_MAGIC 0x2011bab0 -static int is_wineserver(void) { +__attribute__((visibility("hidden"))) +int bl_is_wineserver(void) { static int cached = -1; char exe[PATH_MAX]; const char *base; @@ -43,7 +44,7 @@ void bl_storage_owner(int fd, struct stat *st) { int saved = errno; uid_t uid; - if (st != NULL && is_wineserver()) { + if (st != NULL && bl_is_wineserver()) { uid = getuid(); if (st->st_uid != uid && has_no_unix_owner(fd)) st->st_uid = uid; } @@ -60,7 +61,7 @@ int fchmod(int fd, mode_t mode) { return -1; } result = next_fchmod(fd, mode); - if (result != 0 && errno == EPERM && is_wineserver()) { + if (result != 0 && errno == EPERM && bl_is_wineserver()) { if (has_no_unix_owner(fd)) { errno = saved; return 0; diff --git a/tools/linuxfs/preload/tracer.c b/tools/linuxfs/preload/tracer.c index 572cf13e09..7f5ac8e8cd 100644 --- a/tools/linuxfs/preload/tracer.c +++ b/tools/linuxfs/preload/tracer.c @@ -81,7 +81,10 @@ __attribute__((visibility("hidden"))) int bl_status_without_tracer(const char *p long pid; if ((flags & O_ACCMODE) != O_RDONLY || (pid = status_pid(path)) < 0 || is_web_helper(caller) || bl_from_ntdll(caller)) return -1; - int in = (int)syscall(SYS_openat, AT_FDCWD, path, O_RDONLY | O_CLOEXEC); + // through the next open(): the native userland's hook gives the app's ids as root's there + static int (*next_open)(const char *, int, ...) = NULL; + if (!next_open) next_open = (int (*)(const char *, int, ...))dlsym(RTLD_NEXT, "open"); + int in = next_open ? next_open(path, O_RDONLY | O_CLOEXEC) : (int)syscall(SYS_openat, AT_FDCWD, path, O_RDONLY | O_CLOEXEC); if (in < 0) goto done; for (;;) { ssize_t n = read(in, text + len, sizeof(text) - 1 - len); diff --git a/tools/linuxfs/preload/venus.c b/tools/linuxfs/preload/venus.c index 4feb9ee03a..aae9ebbec2 100644 --- a/tools/linuxfs/preload/venus.c +++ b/tools/linuxfs/preload/venus.c @@ -12,7 +12,14 @@ #include #include +extern char **environ; + __attribute__((constructor)) static void bl_venus_keep_kopper(void) { + static const char name[] = "LIBGL_KOPPER_DISABLE="; const char *debug = getenv("VN_DEBUG"); - if (debug && strstr(debug, "vtest")) unsetenv("LIBGL_KOPPER_DISABLE"); + if (!debug || !strstr(debug, "vtest") || !environ) return; + char **out = environ; + for (char **in = environ; *in; in++) + if (strncmp(*in, name, sizeof name - 1)) *out++ = *in; + *out = NULL; } diff --git a/tools/linuxfs/preload/webhelper.c b/tools/linuxfs/preload/webhelper.c index 9494872797..7642a34632 100644 --- a/tools/linuxfs/preload/webhelper.c +++ b/tools/linuxfs/preload/webhelper.c @@ -26,6 +26,14 @@ static char *join_features(const char *have, const char *add) { return strcat(out, add); } +static int electron_node_mode(char *const envp[]) { + static const char variable[] = "ELECTRON_RUN_AS_NODE="; + for (int i = 0; envp && envp[i]; i++) + if (!strncmp(envp[i], variable, sizeof variable - 1)) + return envp[i][sizeof variable - 1] != 0; + return 0; +} + static char *const *chromium_argv(const char *path, char *const argv[]) { const char *slash = path ? strrchr(path, '/') : NULL; if (!slash || !argv || !argv[0]) return argv; @@ -48,7 +56,9 @@ static char *const *chromium_argv(const char *path, char *const argv[]) { return out; } -__attribute__((visibility("hidden"))) char *const *bl_webhelper_argv(const char *path, char *const argv[]) { +__attribute__((visibility("hidden"))) +char *const *bl_webhelper_argv(const char *path, char *const argv[], char *const envp[]) { + if (electron_node_mode(envp)) return argv; if (!is_webhelper_browser(path, argv)) return chromium_argv(path, argv); const char *spec = getenv("BL_WEBHELPER_ARGS"); if (!spec || !*spec) spec = WEBHELPER_DEFAULT; diff --git a/tools/nativeguest/LICENSE b/tools/nativeguest/LICENSE new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/tools/nativeguest/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/tools/nativeguest/README.md b/tools/nativeguest/README.md new file mode 100644 index 0000000000..19571de96c --- /dev/null +++ b/tools/nativeguest/README.md @@ -0,0 +1,34 @@ +# Native userland (no proot) + +`libddnatv-hook.so` is an `LD_PRELOAD` library that lets the glibc rootfs run directly on Android: +it maps the guest's absolute paths into the rootfs (plus the mounts proot used to provide, from +`DDNATV_BINDS`), starts every program through the rootfs's `ld.so`, and answers the system calls +Android's seccomp policy kills a process for (`SIGSYS` handler). There is no tracer. The app side +is `runtime/NativeGuest.kt`; the setting is Performance > "Run without proot (experimental)". + +The hook is derived from the Apache-2.0 `libcortex-hook` of +[ssfuisu/cortex](https://github.com/ssfuisu/cortex) (see `LICENSE`), renamed (`cortex` -> `ddnatv`, +same length: the code compares environment names by length) and extended with: + +- `DDNATV_BINDS` mounts, `DDNATV_PRELOAD` (what `/etc/ld.so.preload` does for proot), and mapping of + guest paths inside `LD_PRELOAD`; +- POSIX `shm_open`/`shm_unlink` through `/dev/shm`; +- starting Wine without its static preloader, which opens files with raw system calls. + +Build: `tools/nativeguest/build.sh out.so` with an aarch64 glibc cross compiler. + +## Testing under Android's seccomp filter + +Some devices (eng builds, `setenforce 0` ROMs) run apps with no seccomp filter, so a hook that +passes there can still die with SIGSYS on a stock phone (`GUEST_EXIT 159`). `seccomp-sim.c` applies +a filter that answers the calls Android blocks with SIGSYS, then runs the program: + +``` +aarch64-linux-gnu-gcc -static -O2 -o seccomp-sim tools/nativeguest/seccomp-sim.c +# copy it into the rootfs, then name it for every native launch: +echo /usr/local/bin/seccomp-sim > /etc/droiddeck/seccomp-sim +``` + +`grep Seccomp: /proc//status` should then show `2` for the session's processes. Empty the file +to turn it off. `seccomp-sim -a NR,NR PROGRAM` leaves the listed calls allowed, to find which one +kills a program. diff --git a/tools/nativeguest/app-seccomp-dump.c b/tools/nativeguest/app-seccomp-dump.c new file mode 100644 index 0000000000..1ec09ea256 --- /dev/null +++ b/tools/nativeguest/app-seccomp-dump.c @@ -0,0 +1,50 @@ +// Writes the seccomp filter Android's zygote gives an app (from the device's libandroid_runtime.so) +// to a file, as the raw sock_filter array, for seccomp-sim -f on devices whose zygote skips it +// (a permissive SELinux). A bionic program, built with the NDK and run from adb shell: +// aarch64-linux-android33-clang -O2 -rdynamic -o app-seccomp-dump app-seccomp-dump.c -ldl +// app-seccomp-dump OUT +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static const char *g_out; +static int g_dumped; + +// the runtime's own prctl() call lands here first +__attribute__((visibility("default"))) int prctl(int option, ...) { + va_list ap; + va_start(ap, option); + unsigned long a2 = va_arg(ap, unsigned long), a3 = va_arg(ap, unsigned long); + unsigned long a4 = va_arg(ap, unsigned long), a5 = va_arg(ap, unsigned long); + va_end(ap); + if (option == PR_SET_SECCOMP && a2 == SECCOMP_MODE_FILTER && g_out) { + const struct sock_fprog *prog = (const struct sock_fprog *)a3; + FILE *f = fopen(g_out, "wb"); + if (f) { + fwrite(prog->filter, sizeof(prog->filter[0]), prog->len, f); + fclose(f); + fprintf(stderr, "app-seccomp-dump: %u instructions to %s\n", prog->len, g_out); + g_dumped = 1; + } + return 0; // not installed in this process + } + return (int)syscall(SYS_prctl, option, a2, a3, a4, a5); +} + +int main(int argc, char **argv) { + if (argc != 2) { fprintf(stderr, "usage: %s OUT\n", argv[0]); return 2; } + g_out = argv[1]; + void *rt = dlopen("libandroid_runtime.so", RTLD_NOW); + if (!rt) { fprintf(stderr, "%s\n", dlerror()); return 2; } + int (*set_app_filter)(void) = (int (*)(void))dlsym(rt, "_Z22set_app_seccomp_filterv"); + if (!set_app_filter) { fprintf(stderr, "no set_app_seccomp_filter\n"); return 2; } + set_app_filter(); + return g_dumped ? 0 : 1; +} diff --git a/tools/nativeguest/build-gosys.sh b/tools/nativeguest/build-gosys.sh new file mode 100755 index 0000000000..ce05326c1e --- /dev/null +++ b/tools/nativeguest/build-gosys.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +# Builds the code the native userland adds to static Go programs (gosys/gosys.c) into the C header +# the hook includes (gosys/gosys_blob.h, not kept in the repository; build.sh makes it each time). +# +# The code is AArch64 whatever the machine this runs on: it is compiled freestanding with an +# aarch64 cross compiler (gcc-aarch64-linux-gnu: the one that builds the hook; or clang with lld). +# +# usage: tools/nativeguest/build-gosys.sh [output header] +set -euo pipefail + +here=$(cd "$(dirname "$0")" && pwd) +src=$here/gosys +out=${1:-$src/gosys_blob.h} + +if command -v aarch64-linux-gnu-gcc >/dev/null 2>&1; then + CC=(aarch64-linux-gnu-gcc) + LD=(aarch64-linux-gnu-ld) + OBJCOPY=(aarch64-linux-gnu-objcopy) + NM=(aarch64-linux-gnu-nm) + OBJDUMP=(aarch64-linux-gnu-objdump) +elif command -v clang >/dev/null 2>&1 && command -v ld.lld >/dev/null 2>&1; then + CC=(clang --target=aarch64-linux-gnu) + LD=(ld.lld) + OBJCOPY=(llvm-objcopy) + NM=(llvm-nm) + OBJDUMP=(llvm-objdump) +else + echo "build-gosys.sh: needs aarch64-linux-gnu-gcc (apt install gcc-aarch64-linux-gnu) or clang with lld" >&2 + exit 1 +fi + +tmp=$(mktemp -d) +trap 'rm -rf "$tmp"' EXIT + +"${CC[@]}" -std=gnu11 -O2 -Wall -Wextra -Werror \ + -ffreestanding -fno-builtin -nostdlib -fPIE -fvisibility=hidden -fno-stack-protector \ + -fno-asynchronous-unwind-tables -fno-unwind-tables -fno-tree-loop-distribute-patterns \ + -mcmodel=tiny -mgeneral-regs-only -mno-outline-atomics -ffixed-x18 -ffixed-x28 \ + -c "$src/gosys.c" -o "$tmp/gosys.o" +"${LD[@]}" -T "$src/gosys.ld" -nostdlib -o "$tmp/gosys.elf" "$tmp/gosys.o" +"${OBJCOPY[@]}" -O binary "$tmp/gosys.elf" "$tmp/gosys.bin" + +# It must stand on its own: nothing undefined, no writable data, and nothing that depends on the +# address it is loaded at (adrp assumes the page offset of the link address; adr does not) +if [ -n "$("${NM[@]}" -u "$tmp/gosys.elf")" ]; then + echo "build-gosys.sh: gosys.c needs symbols it does not define:" >&2 + "${NM[@]}" -u "$tmp/gosys.elf" >&2 + exit 1 +fi +if "${OBJDUMP[@]}" -d "$tmp/gosys.elf" | grep -q -w adrp; then + echo "build-gosys.sh: gosys.c uses adrp, which is not position-independent at any address" >&2 + exit 1 +fi +sections=$("${OBJDUMP[@]}" -h "$tmp/gosys.elf" | awk '$1 ~ /^[0-9]+$/ {print $2}' | tr '\n' ' ') +for s in $sections; do + case $s in + .hdr|.thunks|.text|.rodata|.trailer|.symtab|.strtab|.shstrtab) ;; + *) echo "build-gosys.sh: unexpected section $s in gosys.elf (sections: $sections)" >&2; exit 1 ;; + esac +done + +size=$(stat -c %s "$tmp/gosys.bin") +entry=$("${NM[@]}" "$tmp/gosys.elf" | awk '$3 == "cxgo_entry" {print $1}') +thunks=$("${NM[@]}" "$tmp/gosys.elf" | awk '$3 == "g_thunks" {print $1}') +if [ -z "$entry" ] || [ -z "$thunks" ]; then + echo "build-gosys.sh: cxgo_entry or g_thunks not found" >&2 + exit 1 +fi +[ "$(head -c 8 "$tmp/gosys.bin")" = "CXGOSYS1" ] || { echo "build-gosys.sh: the header is not first" >&2; exit 1; } +[ "$(tail -c 64 "$tmp/gosys.bin" | head -c 8)" = "CXGOEND1" ] || { echo "build-gosys.sh: the trailer is not last" >&2; exit 1; } + +{ + echo "// Generated by tools/nativeguest/build-gosys.sh from gosys/gosys.c. Do not edit." + echo "#define GOSYS_BLOB_SIZE $size" + echo "#define GOSYS_ENTRY_OFF 0x$entry" + echo "#define GOSYS_THUNKS_OFF 0x$thunks" + echo "static const unsigned char gosys_blob[GOSYS_BLOB_SIZE] = {" + od -An -v -tx1 "$tmp/gosys.bin" | sed -e 's/^ *//' -e 's/ /, 0x/g' -e 's/^/0x/' -e 's/$/,/' + echo "};" +} > "$out.tmp" +mv "$out.tmp" "$out" +echo "build-gosys.sh: $out ($size bytes, entry 0x$entry)" diff --git a/tools/nativeguest/build.sh b/tools/nativeguest/build.sh new file mode 100755 index 0000000000..46002f248c --- /dev/null +++ b/tools/nativeguest/build.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +# Builds libddnatv-hook.so, the library that lets the glibc rootfs run on Android without proot. +# usage: tools/nativeguest/build.sh [compiler, default aarch64-linux-gnu-gcc] +set -euo pipefail +here=$(cd "$(dirname "$0")" && pwd) +out=${1:?output path} +cc=${2:-aarch64-linux-gnu-gcc} +gen=$(mktemp -d) +trap 'rm -rf "$gen"' EXIT +mkdir -p "$gen/gosys" +bash "$here/build-gosys.sh" "$gen/gosys/gosys_blob.h" +"$cc" -std=gnu11 -shared -fPIC -O2 -fno-delete-null-pointer-checks -Wall -Wno-nonnull-compare \ + -Wno-format-truncation -Wno-stringop-truncation -Wl,-z,max-page-size=16384 -I "$gen" \ + -o "$out" "$here/ddnatv-hook.c" -ldl +"${cc%gcc}strip" --strip-unneeded "$out" diff --git a/tools/nativeguest/ddnatv-hook.c b/tools/nativeguest/ddnatv-hook.c new file mode 100644 index 0000000000..954991c261 --- /dev/null +++ b/tools/nativeguest/ddnatv-hook.c @@ -0,0 +1,87 @@ +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef RENAME_EXCHANGE +#define RENAME_EXCHANGE (1 << 1) +#endif + +// The code that is added to static Go programs (gosys/gosys.c), built by scripts/build-gosys.sh. A +// build without it works as before, only without Go support. It is AArch64 code: the 32-bit hook +// has none (a 32-bit phone cannot run 64-bit programs). +#if defined(__has_include) && defined(__LP64__) +#if __has_include("gosys/gosys_blob.h") +#include "gosys/gosys_abi.h" +#include "gosys/gosys_blob.h" +#define DDNATV_HAVE_GOSYS 1 +#endif +#endif + +// The hook is one translation unit split into parts by topic, in this order (later parts use +// the static functions of earlier ones). +#include "hook/syscalls.c" +#include "hook/paths.c" +#include "hook/hardlinks.c" +#include "hook/signals.c" +#include "hook/setup.c" +#include "hook/files.c" +#include "hook/fileops.c" +#include "hook/identity.c" +#include "hook/privileged.c" +#include "hook/env.c" +#include "hook/exec_probe.c" +#include "hook/static_programs.c" +#include "hook/go_programs.c" +#include "hook/exec.c" +#include "hook/net.c" +#include "hook/sockets.c" +#include "hook/sysv_shm.c" +#include "hook/posix_shm.c" diff --git a/tools/nativeguest/gosys/gosys.c b/tools/nativeguest/gosys/gosys.c new file mode 100644 index 0000000000..fb8230ce4a --- /dev/null +++ b/tools/nativeguest/gosys/gosys.c @@ -0,0 +1,510 @@ +// The code The native userland adds to a static Go program so that it sees the rootfs (see gosys_abi.h). +// +// Built freestanding (scripts/build-gosys.sh) as a flat, position-independent binary with no +// writable data, no libc and no relocations: the hook copies it into the program's file. It is +// entered from the one place where Go's system calls are made, in place of the "svc #0" of +// internal/runtime/syscall.Syscall6, with the registers of that call: arguments in x0 to x5, +// the number in x8 (passed again as the eighth argument). It returns what the kernel would, and it +// may use every register but x28 (the current goroutine), x29, x30 and sp, which it keeps. +// +// It does for Go what libddnatv-hook.so does for C programs: maps absolute Ubuntu paths into the +// rootfs (the same rules as hook/paths.c), shortens the Unix socket paths that do not fit, shows +// the program the paths it expects from getcwd and /proc/self/exe, and starts Ubuntu programs +// through the rootfs's dynamic linker and env, which then go through the hook. + +#include "gosys_abi.h" + +typedef int64_t i64; +typedef uint64_t u64; +typedef uint32_t u32; +typedef uint16_t u16; + +#define AT_FDCWD (-100) +#define SLOT_PATH_A 0u +#define SLOT_PATH_B 4096u +#define SLOT_ARGV 8192u +#define SLOT_ENV 16384u +#define SLOT_PATH_CAP 4096u +#define ARGV_CAP 1000u // entries of the argv array that starts a program +#define ENV_CAP 2000u + +// The numbers of AArch64 Linux (the same for every kernel) +enum { + NR_SETXATTR = 5, NR_LSETXATTR = 6, NR_GETXATTR = 8, NR_LGETXATTR = 9, NR_LISTXATTR = 11, + NR_LLISTXATTR = 12, NR_REMOVEXATTR = 14, NR_LREMOVEXATTR = 15, NR_GETCWD = 17, + NR_INOTIFY_ADD_WATCH = 27, NR_MKNODAT = 33, NR_MKDIRAT = 34, NR_UNLINKAT = 35, NR_SYMLINKAT = 36, + NR_LINKAT = 37, NR_RENAMEAT = 38, NR_STATFS = 43, NR_TRUNCATE = 45, NR_FACCESSAT = 48, + NR_CHDIR = 49, NR_CHROOT = 51, NR_FCHMODAT = 53, NR_FCHOWNAT = 54, NR_OPENAT = 56, + NR_READLINKAT = 78, NR_NEWFSTATAT = 79, NR_UTIMENSAT = 88, NR_BIND = 200, NR_CONNECT = 203, + NR_EXECVE = 221, NR_NAME_TO_HANDLE_AT = 264, NR_RENAMEAT2 = 276, NR_STATX = 291, + NR_OPENAT2 = 437, NR_FACCESSAT2 = 439, NR_FCHMODAT2 = 452, +}; + +__attribute__((section(".hdr"), used)) +static const volatile struct gosys_hdr g_hdr = { .magic = "CXGOSYS1", .version = GOSYS_VERSION }; + +// Filled by the patcher; the instructions that connect the call site to cxgo_entry +__attribute__((section(".thunks"), used)) +static const volatile u32 g_thunks[GOSYS_THUNK_BYTES / 4]; + +__attribute__((section(".trailer"), used)) +static const volatile struct gosys_trailer g_trailer = { .magic = "CXGOEND1", .version = GOSYS_VERSION }; + +static inline const struct gosys_hdr *hdr(void) { + const struct gosys_hdr *h = (const struct gosys_hdr *)&g_hdr; + __asm__("" : "+r"(h)); // the compiler must not assume it knows the contents + return h; +} + +static inline i64 sc(i64 nr, i64 a0, i64 a1, i64 a2, i64 a3, i64 a4, i64 a5) { + register i64 x8 __asm__("x8") = nr; + register i64 x0 __asm__("x0") = a0; + register i64 x1 __asm__("x1") = a1; + register i64 x2 __asm__("x2") = a2; + register i64 x3 __asm__("x3") = a3; + register i64 x4 __asm__("x4") = a4; + register i64 x5 __asm__("x5") = a5; + __asm__ volatile("svc #0" : "+r"(x0) : "r"(x8), "r"(x1), "r"(x2), "r"(x3), "r"(x4), "r"(x5) : "memory", "cc"); + return x0; +} + +static u64 slen(const char *s) { + u64 n = 0; + while (s[n]) n++; + return n; +} + +static void mcopy(char *d, const char *s, u64 n) { + for (u64 i = 0; i < n; i++) d[i] = s[i]; +} + +// Moves n bytes down (d < s) +static void mmove_down(char *d, const char *s, u64 n) { + for (u64 i = 0; i < n; i++) d[i] = s[i]; +} + +static int pre(const char *path, const char *lit, u64 n) { + for (u64 i = 0; i < n; i++) + if (path[i] != lit[i]) return 0; + return path[n] == '/' || path[n] == '\0'; +} + +// Whether path is the rootfs or in it +static int in_root(const struct gosys_hdr *h, const char *p) { + u64 n = h->root_len; + if (n == 0) return 0; + for (u64 i = 0; i < n; i++) + if (p[i] != h->root[i]) return 0; + return p[n] == '/' || p[n] == '\0'; +} + +// Android's own mounts and files, which must never be redirected into the rootfs (hook/paths.c) +static int is_host_path(const char *path) { + switch (path[1]) { + case 'a': return pre(path, "/apex", 5); + case 'c': return pre(path, "/config", 7); + case 'd': return pre(path, "/dev", 4) || pre(path, "/d", 2) || pre(path, "/data", 5); + case 'l': return pre(path, "/linkerconfig", 13); + case 'o': return pre(path, "/odm", 4) || pre(path, "/oem", 4); + case 'p': return pre(path, "/proc", 5) || pre(path, "/product", 8); + case 's': return pre(path, "/sbin/su", 8) || pre(path, "/su", 3) || pre(path, "/sys", 4) || + pre(path, "/system", 7) || pre(path, "/system_ext", 11) || + pre(path, "/sdcard", 7) || pre(path, "/storage", 8); + case 'v': return pre(path, "/vendor", 7); + default: return 0; + } +} + +// An absolute Ubuntu path mapped into the rootfs: `path` itself when it needs no change, else buf +// (hook/paths.c rewrite_path_in_root). A result that would not fit is the path unchanged: the +// kernel then answers as it would for a path that long. +static const char *rw_path(const struct gosys_hdr *h, const char *path, char *buf, u64 cap) { + if (path[0] != '/' || h->root_len == 0) return path; + while (path[0] == '/' && path[1] == '/') path++; + while (path[0] == '/' && path[1] == '.' && (path[2] == '/' || path[2] == '\0')) { + if (path[2] == '/') { + path += 2; + } else { + path = "/"; + break; + } + } + u64 rl = h->root_len; + if (path[1] == '\0') { + mcopy(buf, h->root, rl); + buf[rl] = '\0'; + return buf; + } + if (in_root(h, path)) return path; + if (pre(path, "/dev/shm", 8)) { + u64 rest = slen(path + 8); + if (rl + 8 + rest + 1 > cap) return path; + mcopy(buf, h->root, rl); + mcopy(buf + rl, "/tmp/shm", 8); + mcopy(buf + rl + 8, path + 8, rest + 1); + return buf; + } + if (is_host_path(path)) return path; + u64 pl = slen(path); + if (rl + pl + 1 > cap) return path; + mcopy(buf, h->root, rl); + mcopy(buf + rl, path, pl + 1); + return buf; +} + +// Whether the rootfs is where the code was told it is. In root mode the program runs in a chroot of +// that very rootfs, where the real paths are the Ubuntu ones and the rootfs's own path does not +// exist: then nothing is mapped and the program works as any other. Looked at once for each process +// (the scratch memory starts as zero, and a forked child keeps what its parent found). +static int rewriting(const struct gosys_hdr *h) { + volatile u32 *mode = (volatile u32 *)((char *)h + h->scratch_rel + 4); + u32 m = *mode; + if (m == 0) { + m = sc(NR_FACCESSAT, AT_FDCWD, (i64)h->root, 0, 0, 0, 0) == 0 ? 1u : 2u; + *mode = m; + } + return m == 1; +} + +#define NO_SLOT 0xffffffffu +#define NR_SCHED_YIELD 124 + +// Who is making the call: the goroutine (x28 holds it, and the code is built not to touch x28). A +// goroutine makes one call at a time, and the vfork child that a goroutine makes runs with the same +// x28 as the goroutine does. (TPIDR_EL0 does not tell the threads of a Go program apart: its runtime +// leaves it unset without cgo.) +static inline u64 thread_tag(void) { + u64 t; + __asm__ volatile("mov %0, x28" : "=r"(t)); + return t; +} + +// How many execve calls have not returned (state area, offset 8). One that works never does: it is +// made by a vfork child, and the slot its path was in stays marked as the goroutine's, which goes on +// when the child is gone (the same x28, a call of its own). Without this, goroutines that each +// started a program held a slot each for good, and after the sixty-fourth all the others waited. +static inline u32 *execs_on_their_way(const struct gosys_hdr *h) { + return (u32 *)((char *)h + h->scratch_rel + 8); +} + +static void count_down(u32 *count) { + u32 n = __atomic_load_n(count, __ATOMIC_RELAXED); + while (n != 0 && !__atomic_compare_exchange_n(count, &n, n - 1, 0, __ATOMIC_RELAXED, __ATOMIC_RELAXED)) { + } +} + +// Gives back what this goroutine's vfork child left (see above). Every call looks at one counter +// for it; the list of slots is only looked through while an execve is on its way. +static void reclaim_left_slots(const struct gosys_hdr *h) { + u32 *count = execs_on_their_way(h); + if (__atomic_load_n(count, __ATOMIC_RELAXED) == 0) return; + u64 *owner = (u64 *)((char *)h + h->scratch_rel + 64); + u64 me = thread_tag() | 1; + for (u32 i = 0; i < GOSYS_SLOTS; i++) { + if (__atomic_load_n(&owner[i], __ATOMIC_RELAXED) != me) continue; + __atomic_store_n(&owner[i], 0, __ATOMIC_RELEASE); + count_down(count); + } +} + +// A slot for the call this goroutine is making; *held is its number, to give back when the call is +// done. Each slot has a word of its own that holds who has it (0: nobody), so that taking one is one +// compare-and-swap, and no other goroutine can ever mistake it for its own. +static char *take_slot(const struct gosys_hdr *h, u32 *held) { + char *base = (char *)h + h->scratch_rel; + u64 *owner = (u64 *)(base + 64); + u64 me = thread_tag() | 1; // never 0 + u32 mine = NO_SLOT; + // A slot of this goroutine that is still taken now (cxgo_entry gives back those of its vfork + // children) is its own again + for (u32 i = 0; i < GOSYS_SLOTS; i++) { + if (__atomic_load_n(&owner[i], __ATOMIC_RELAXED) != me) continue; + if (mine == NO_SLOT) + mine = i; + else + __atomic_store_n(&owner[i], 0, __ATOMIC_RELEASE); + } + while (mine == NO_SLOT) { + for (u32 i = 0; i < GOSYS_SLOTS && mine == NO_SLOT; i++) { + u64 none = 0; + if (__atomic_load_n(&owner[i], __ATOMIC_RELAXED) == 0 && + __atomic_compare_exchange_n(&owner[i], &none, me, 0, __ATOMIC_ACQUIRE, __ATOMIC_RELAXED)) + mine = i; + } + if (mine == NO_SLOT) sc(NR_SCHED_YIELD, 0, 0, 0, 0, 0, 0); // all taken: the others finish soon + } + *held = mine; + return base + GOSYS_STATE_SIZE + (u64)mine * GOSYS_SLOT_SIZE; +} + +static void put_slot(const struct gosys_hdr *h, u32 held) { + if (held == NO_SLOT) return; + char *base = (char *)h + h->scratch_rel; + __atomic_store_n((u64 *)(base + 64) + held, 0, __ATOMIC_RELEASE); +} + +// A path as the program expects to see it, from one of the kernel's: the rootfs prefix removed. +// Returns the new length of the n bytes at buf (a path, not NUL-terminated unless `nul`). +static i64 unmap_prefix(const struct gosys_hdr *h, char *buf, i64 n, int nul) { + u64 rl = h->root_len; + if (rl == 0 || n <= 0 || (u64)n < rl + (nul ? 1 : 0)) return n; + for (u64 i = 0; i < rl; i++) + if (buf[i] != h->root[i]) return n; + u64 end = (u64)n - (nul ? 1 : 0); // the path's own length + if (end == rl) { // exactly the rootfs + buf[0] = '/'; + if (nul) { + buf[1] = '\0'; + return 2; + } + return 1; + } + if (buf[rl] != '/') return n; + mmove_down(buf, buf + rl, (u64)n - rl); + return n - (i64)rl; +} + +// ---- Unix sockets ------------------------------------------------------------------------ + +static void put_hex16(char *out, u64 v) { + static const char digits[] = "0123456789abcdef"; + for (int i = 15; i >= 0; i--) { + out[i] = digits[v & 15]; + v >>= 4; + } +} + +// bind() and connect() of a Unix socket with a path: mapped like hook/setup.c does, and hashed +// into /tmp when it does not fit the 108 bytes of sun_path (the same name, so a Go server and a +// program using the C library find each other) +static i64 with_sockaddr(const struct gosys_hdr *h, u32 *held, i64 nr, i64 a0, i64 a1, i64 a2) { + const unsigned char *sa = (const unsigned char *)a1; + if (!sa || a2 < 4 || a2 > 128 || sa[0] != 1 /* AF_UNIX */ || sa[1] != 0 || sa[2] != '/') + return sc(nr, a0, a1, a2, 0, 0, 0); + char *slot = take_slot(h, held); + char *orig = slot + SLOT_PATH_A; + u64 max = (u64)a2 - 2; + if (max > 108) max = 108; + mcopy(orig, (const char *)sa + 2, max); + orig[max] = '\0'; + const char *rw = rw_path(h, orig, slot + SLOT_PATH_B, SLOT_PATH_CAP); + u64 rl = slen(rw); + char *out = slot + SLOT_ARGV; + out[0] = 1; + out[1] = 0; + if (rl < 108) { + mcopy(out + 2, rw, rl + 1); + return sc(nr, a0, (i64)out, (i64)(2 + rl + 1), 0, 0, 0); + } + u64 hash = 14695981039346656037ULL; + for (const char *p = rw; *p; p++) { + hash ^= (unsigned char)*p; + hash *= 1099511628211ULL; + } + u64 n = h->root_len; + if (n + 5 + 11 + 16 + 1 > 108) return sc(nr, a0, a1, a2, 0, 0, 0); + mcopy(out + 2, h->root, n); + mcopy(out + 2 + n, "/tmp/.ctx_sock_", 15); + put_hex16(out + 2 + n + 15, hash); + out[2 + n + 15 + 16] = '\0'; + return sc(nr, a0, (i64)out, (i64)(2 + n + 15 + 16 + 1), 0, 0, 0); +} + +// ---- Starting programs ------------------------------------------------------------------- + +static int starts_with(const char *s, const char *lit) { + for (u64 i = 0; lit[i]; i++) + if (s[i] != lit[i]) return 0; + return 1; +} + +// A program of Android's gets the environment it expects, as from hook/env.c clean_env_for_system(): +// without the hook and the rootfs's libraries, and with Android's directories in its PATH +static i64 exec_host(const struct gosys_hdr *h, char *slot, const char *p, i64 a1, char *const *envp) { + (void)h; + static const char android_path[] = "PATH=/system/bin:/system/xbin:/sbin:/vendor/bin"; + u32 envc = 0; + while (envp && envp[envc]) envc++; + if (envc + 2 > ENV_CAP) return sc(NR_EXECVE, (i64)p, a1, (i64)envp, 0, 0, 0); + char **ne = (char **)(slot + SLOT_ENV); + char *path_str = slot + SLOT_PATH_B; + u32 n = 0; + int has_path = 0; + for (u32 i = 0; i < envc; i++) { + char *e = envp[i]; + if (starts_with(e, "LD_PRELOAD=") || starts_with(e, "LD_LIBRARY_PATH=") || starts_with(e, "GLIBC_TUNABLES=")) + continue; + if (starts_with(e, "PATH=")) { + u64 len = slen(e); + has_path = 1; + if (len + sizeof(android_path) + 1 < SLOT_PATH_CAP) { + mcopy(path_str, android_path, sizeof(android_path) - 1); + path_str[sizeof(android_path) - 1] = ':'; + mcopy(path_str + sizeof(android_path), e + 5, len - 5 + 1); + ne[n++] = path_str; + continue; + } + } + ne[n++] = e; + } + if (!has_path) ne[n++] = (char *)android_path; + ne[n] = 0; + return sc(NR_EXECVE, (i64)p, a1, (i64)ne, 0, 0, 0); +} + +// execve(): a program of the rootfs is started as +// --preload --library-path -c 'exec -a "$0" "$@"' ... +// so that bash, a program of the rootfs with the hook loaded, starts it the way every program of +// The native userland is started (Ubuntu's dynamic programs through ld.so, scripts through their interpreter, +// static programs patched first), with the argv[0] the caller chose. Without bash it is env, +// which cannot set argv[0]. The path is passed as the caller wrote it. +static i64 with_execve(const struct gosys_hdr *h, u32 *held, i64 a0, i64 a1, i64 a2) { + const char *path = (const char *)a0; + char *const *argv = (char *const *)a1; + char *const *envp = (char *const *)a2; + if (!path || path[0] == '\0') return sc(NR_EXECVE, a0, a1, a2, 0, 0, 0); + + char *slot = take_slot(h, held); + const char *p = path[0] == '/' ? rw_path(h, path, slot + SLOT_PATH_A, SLOT_PATH_CAP) : path; + int wrap = h->ldso_len != 0 && h->runner_len != 0 && (path[0] != '/' || in_root(h, p)); + if (!wrap) { + if (path[0] == '/' && !in_root(h, p)) return exec_host(h, slot, p, a1, envp); + return sc(NR_EXECVE, (i64)p, a1, a2, 0, 0, 0); + } + + // A program that is not there is reported to the caller, as execve() does + i64 r = sc(NR_FACCESSAT, AT_FDCWD, (i64)p, 0, 0, 0, 0); + if (r < 0) return r; + + u32 argc = 0; + while (argv && argv[argc]) argc++; + if (argc + 12 > ARGV_CAP) return sc(NR_EXECVE, (i64)p, a1, a2, 0, 0, 0); + + // DDNATV_ROOT must reach env even when the caller built an environment of its own + char *const *env = envp; + u32 envc = 0; + int has_root = 0; + while (envp && envp[envc]) { + const char *e = envp[envc]; + if (e[0] == 'D' && e[1] == 'D' && e[2] == 'N' && e[3] == 'A' && e[4] == 'T' && e[5] == 'V' && + e[6] == '_' && e[7] == 'R' && e[8] == 'O' && e[9] == 'O' && e[10] == 'T' && e[11] == '=') + has_root = 1; + envc++; + } + if (!has_root) { + if (envc + 2 > ENV_CAP) return sc(NR_EXECVE, (i64)p, a1, a2, 0, 0, 0); + char **ne = (char **)(slot + SLOT_ENV); + char *kv = slot + SLOT_PATH_B; + mcopy(kv, "DDNATV_ROOT=", 12); + mcopy(kv + 12, h->root, h->root_len + 1); + for (u32 i = 0; i < envc; i++) ne[i] = envp[i]; + ne[envc] = kv; + ne[envc + 1] = 0; + env = ne; + } + + char **v = (char **)(slot + SLOT_ARGV); + u32 n = 0; + v[n++] = (char *)h->ldso; + if (h->hook_len) { + v[n++] = (char *)"--preload"; + v[n++] = (char *)h->hook; + } + v[n++] = (char *)"--library-path"; + v[n++] = (char *)h->libs; + v[n++] = (char *)h->runner; + if (h->flags & GOSYS_FLAG_RUNNER_IS_BASH) { + v[n++] = (char *)"-c"; + v[n++] = (char *)"exec -a \"$0\" \"$@\""; + v[n++] = (argc > 0 && argv[0]) ? argv[0] : (char *)path; + } else { + v[n++] = (char *)"--"; + } + v[n++] = (char *)path; + for (u32 i = 1; i < argc; i++) v[n++] = argv[i]; + v[n] = 0; + return sc(NR_EXECVE, (i64)h->ldso, (i64)v, (i64)env, 0, 0, 0); +} + +// ---- The entry --------------------------------------------------------------------------- + +// Rewrites the path arguments `i1` and `i2` (an index into a[], -1: none) that are absolute, makes +// the call, and shows the program the paths it expects in what the call returns. +static i64 with_paths(const struct gosys_hdr *h, u32 *held, i64 nr, i64 *a, int i1, int i2) { + char *slot = 0; + int proc_link = 0; + int idx[2] = { i1, i2 }; + for (int k = 0; k < 2; k++) { + int i = idx[k]; + if (i < 0) continue; + const char *p = (const char *)a[i]; + if (!p || p[0] != '/') continue; + if (!slot) slot = take_slot(h, held); + if (nr == NR_READLINKAT && k == 0 && pre(p, "/proc", 5)) proc_link = 1; + a[i] = (i64)rw_path(h, p, slot + (k ? SLOT_PATH_B : SLOT_PATH_A), SLOT_PATH_CAP); + } + i64 r = sc(nr, a[0], a[1], a[2], a[3], a[4], a[5]); + if (proc_link && r > 0) r = unmap_prefix(h, (char *)a[2], r, 0); + return r; +} + +// The call itself; a slot that it takes is given back by cxgo_entry +static i64 handle(const struct gosys_hdr *h, u32 *held, i64 nr, i64 a0, i64 a1, i64 a2, i64 a3, i64 a4, i64 a5) { + i64 a[6] = { a0, a1, a2, a3, a4, a5 }; + switch (nr) { + case NR_OPENAT: case NR_FACCESSAT: case NR_FACCESSAT2: case NR_FCHMODAT: case NR_FCHMODAT2: + case NR_FCHOWNAT: case NR_NEWFSTATAT: case NR_STATX: case NR_READLINKAT: case NR_MKDIRAT: + case NR_MKNODAT: case NR_UNLINKAT: case NR_UTIMENSAT: case NR_OPENAT2: case NR_NAME_TO_HANDLE_AT: + case NR_INOTIFY_ADD_WATCH: case NR_CHDIR: case NR_CHROOT: case NR_STATFS: case NR_TRUNCATE: + case NR_SETXATTR: case NR_LSETXATTR: case NR_GETXATTR: case NR_LGETXATTR: case NR_LISTXATTR: + case NR_LLISTXATTR: case NR_REMOVEXATTR: case NR_LREMOVEXATTR: case NR_RENAMEAT: case NR_RENAMEAT2: + case NR_LINKAT: case NR_SYMLINKAT: case NR_GETCWD: case NR_BIND: case NR_CONNECT: case NR_EXECVE: + // The calls that carry paths: not mapped where the rootfs is not in its own place (above) + if (!rewriting(h)) return sc(nr, a0, a1, a2, a3, a4, a5); + break; + default: + return sc(nr, a0, a1, a2, a3, a4, a5); + } + switch (nr) { + case NR_OPENAT: case NR_FACCESSAT: case NR_FACCESSAT2: case NR_FCHMODAT: case NR_FCHMODAT2: + case NR_FCHOWNAT: case NR_NEWFSTATAT: case NR_STATX: case NR_READLINKAT: case NR_MKDIRAT: + case NR_MKNODAT: case NR_UNLINKAT: case NR_UTIMENSAT: case NR_OPENAT2: case NR_NAME_TO_HANDLE_AT: + case NR_INOTIFY_ADD_WATCH: + return with_paths(h, held, nr, a, 1, -1); + case NR_CHDIR: case NR_CHROOT: case NR_STATFS: case NR_TRUNCATE: case NR_SETXATTR: + case NR_LSETXATTR: case NR_GETXATTR: case NR_LGETXATTR: case NR_LISTXATTR: case NR_LLISTXATTR: + case NR_REMOVEXATTR: case NR_LREMOVEXATTR: + return with_paths(h, held, nr, a, 0, -1); + case NR_RENAMEAT: case NR_RENAMEAT2: case NR_LINKAT: + return with_paths(h, held, nr, a, 1, 3); + case NR_SYMLINKAT: // the target is data, only the link is a path + return with_paths(h, held, nr, a, 2, -1); + case NR_GETCWD: { + i64 r = sc(nr, a0, a1, 0, 0, 0, 0); + return r > 0 ? unmap_prefix(h, (char *)a0, r, 1) : r; + } + case NR_BIND: case NR_CONNECT: + return with_sockaddr(h, held, nr, a0, a1, a2); + case NR_EXECVE: { + // Counted while it is on its way: when it works it does not return (see execs_on_their_way) + u32 *count = execs_on_their_way(h); + __atomic_fetch_add(count, 1, __ATOMIC_RELAXED); + i64 r = with_execve(h, held, a0, a1, a2); + count_down(count); // it did return: it failed, and cxgo_entry gives its slot back + return r; + } + default: + return sc(nr, a0, a1, a2, a3, a4, a5); + } +} + +__attribute__((section(".text.cxgo_entry"), used, noinline)) +i64 cxgo_entry(i64 a0, i64 a1, i64 a2, i64 a3, i64 a4, i64 a5, i64 unused, i64 nr) { + (void)unused; + const struct gosys_hdr *h = hdr(); + u32 held = NO_SLOT; + reclaim_left_slots(h); + i64 r = handle(h, &held, nr, a0, a1, a2, a3, a4, a5); + put_slot(h, held); + return r; +} diff --git a/tools/nativeguest/gosys/gosys.ld b/tools/nativeguest/gosys/gosys.ld new file mode 100644 index 0000000000..ba5a6ba34f --- /dev/null +++ b/tools/nativeguest/gosys/gosys.ld @@ -0,0 +1,14 @@ +/* The layout of gosys.c's flat binary: the header at 0 (the patcher fills it in), the room for the + call site's connecting code, the code with its entry first, read-only data, the trailer last. */ +OUTPUT_FORMAT(elf64-littleaarch64) +ENTRY(cxgo_entry) +SECTIONS +{ + . = 0; + .hdr : { KEEP(*(.hdr)) } + .thunks : { . = ALIGN(16); KEEP(*(.thunks)) } + .text : { . = ALIGN(16); KEEP(*(.text.cxgo_entry)) *(.text .text.*) } + .rodata : { . = ALIGN(16); *(.rodata .rodata.*) } + .trailer : { . = ALIGN(64); KEEP(*(.trailer)) } + /DISCARD/ : { *(.comment) *(.note*) *(.eh_frame*) *(.gnu*) *(.interp) } +} diff --git a/tools/nativeguest/gosys/gosys_abi.h b/tools/nativeguest/gosys/gosys_abi.h new file mode 100644 index 0000000000..e0c4807d34 --- /dev/null +++ b/tools/nativeguest/gosys/gosys_abi.h @@ -0,0 +1,79 @@ +// What the hook and the code it adds to a static Go program (gosys.c) agree on. +// +// A Go program built without cgo makes its system calls itself, so the preloaded hook never sees +// them and Ubuntu's paths (/etc/resolv.conf, /usr/bin/git, ...) mean nothing to it. Before such a +// program starts, the hook adds a small piece of position-independent code to its file (see +// go_programs.c): the program's one system call function, internal/runtime/syscall.Syscall6, jumps +// to it, and it maps paths into the rootfs like the hook does, then makes the call. +// +// This header has no dependencies beyond , so that the freestanding code and the hook, +// which are built with different flags, can both include it. + +#ifndef DDNATV_GOSYS_ABI_H +#define DDNATV_GOSYS_ABI_H + +#include + +#ifndef GOSYS_VERSION +#define GOSYS_VERSION 3u // raised when the code or its header changes: patched programs are patched again +#endif + +// The scratch memory for rewritten paths: a small state area and 64 slots, in zero-filled memory the +// patcher appends to the program's data segment (so nothing is allocated per call). A slot belongs to +// the thread that took it until its call is over: a word in the state area for each slot says +// which goroutine (x28) has it. A slot that a vfork child kept by a successful execve is given back +// at the next call of the goroutine that made the child (the state area counts the execve calls +// that have not returned, [8]). +// (A ring of slots shared by every call was tried first: a thread that was descheduled for a +// moment between taking a slot and the call let sixteen others go round the ring and overwrite its +// path, so a Go program opened another file than it asked for.) +#define GOSYS_SLOTS 64u +#define GOSYS_SLOT_SIZE 32768u // two paths (4K each), an argv array (8K), an environment array (16K) +#define GOSYS_STATE_SIZE 1024u // [4] rewriting mode, [8] execve calls on their way, [64 + 8 * slot] who has the slot (0: nobody) +#define GOSYS_SCRATCH_SIZE (GOSYS_STATE_SIZE + GOSYS_SLOTS * GOSYS_SLOT_SIZE) + +#define GOSYS_THUNK_BYTES 256u // room for the small code that connects a call site to the code + +#define GOSYS_ROOT_MAX 448 +#define GOSYS_PATH_MAX 448 +#define GOSYS_LIBS_MAX 1024 + +struct gosys_hdr { + char magic[8]; // "CXGOSYS1" + uint32_t version; // GOSYS_VERSION + uint32_t flags; + int64_t scratch_rel; // scratch memory, relative to this header (the same in any load address) + uint32_t root_len; // the rootfs, as Android sees it + uint32_t ldso_len; // the rootfs's dynamic linker + uint32_t hook_len; // libddnatv-hook.so; 0: none + uint32_t libs_len; // the rootfs's library directories, ':' separated + uint32_t runner_len; // the rootfs's bash, or env without it; 0: Ubuntu programs cannot be started + uint32_t reserved; + char root[GOSYS_ROOT_MAX]; + char ldso[GOSYS_PATH_MAX]; + char hook[GOSYS_PATH_MAX]; + char libs[GOSYS_LIBS_MAX]; + char runner[GOSYS_PATH_MAX]; +}; + +#define GOSYS_FLAG_RUNNER_IS_BASH 1u // gosys_hdr.flags + +// The last 64 bytes of the added code: where it is, and what the patcher changed to add it. +struct gosys_trailer { + char magic[8]; // "CXGOEND1" + uint32_t version; + uint32_t total_size; // the added code, header to trailer + uint64_t text_orig_filesz; // the segment that holds it: its size before + uint64_t rw_orig_memsz; // the data segment: its size before + uint32_t text_index; // their numbers in the program header table + uint32_t rw_index; + uint32_t text_orig_flags; + uint32_t reserved; + uint64_t site_file_off; // the instruction that was replaced (a "svc #0") + uint64_t reserved2; +}; + +_Static_assert(sizeof(struct gosys_trailer) == 64, "the trailer is 64 bytes"); +_Static_assert(sizeof(struct gosys_hdr) % 16 == 0, "the header keeps the code after it aligned"); + +#endif diff --git a/tools/nativeguest/hook/env.c b/tools/nativeguest/hook/env.c new file mode 100644 index 0000000000..e95083c25e --- /dev/null +++ b/tools/nativeguest/hook/env.c @@ -0,0 +1,309 @@ +// Part of libddnatv-hook.so, included by ddnatv-hook.c (one translation unit, so the +// parts share their static functions and are built with the same command as before). +// +// The environment of started programs: Android programs get it without the hook, rootfs +// programs with it. + +#ifndef DDNATV_HOST_TEST + +static const char *ddnatv_hook_library(char *buf, size_t bufsz); + +static char **clean_env_for_system(char *const envp[]) { + int count = 0; + while (envp && envp[count]) count++; + char **new_env = calloc(count + 3, sizeof(char *)); + int dst = 0; + int has_path = 0; + for (int i = 0; i < count; i++) { + char first = envp[i][0]; + if (!((first == 'L' && (strncmp(envp[i], "LD_PRELOAD=", 11) == 0 || + strncmp(envp[i], "LD_LIBRARY_PATH=", 16) == 0)) || + (first == 'G' && strncmp(envp[i], "GLIBC_TUNABLES=", 15) == 0))) { + if (first == 'P' && strncmp(envp[i], "PATH=", 5) == 0) { + has_path = 1; + size_t plen = strlen(envp[i]); + char *new_path = malloc(plen + 64); + if (new_path) { + snprintf(new_path, plen + 64, "PATH=/system/bin:/system/xbin:/sbin:/vendor/bin:%s", envp[i] + 5); + new_env[dst++] = new_path; + } else { + new_env[dst++] = envp[i]; + } + } else { + new_env[dst++] = envp[i]; + } + } + } + if (!has_path) { + new_env[dst++] = strdup("PATH=/system/bin:/system/xbin:/sbin:/vendor/bin"); + } + new_env[dst] = NULL; + return new_env; +} + +// LD_PRELOAD with every absolute path that is not in the rootfs yet mapped into it. Entries are +// separated by ':' or ' '. free() the result. +static char *map_preload_paths(const char *value) { + if (!value) return NULL; + size_t cap = strlen(value) + (g_ddnatv_root_len + 1) * 16 + 16; + char *out = malloc(cap); + if (!out) return NULL; + size_t used = 0; + out[0] = '\0'; + const char *p = value; + while (*p) { + size_t len = strcspn(p, ": "); + if (len > 0 && len < PATH_MAX) { + char entry[PATH_MAX]; + memcpy(entry, p, len); + entry[len] = '\0'; + char buf[PATH_MAX]; + const char *mapped = entry[0] == '/' ? rewrite_path_in_root(entry, buf, sizeof(buf)) : entry; + size_t mlen = strlen(mapped); + if (used + mlen + 2 >= cap) break; + if (used) out[used++] = ':'; + memcpy(out + used, mapped, mlen); + used += mlen; + out[used] = '\0'; + } + p += len; + if (*p) p++; + } + return out; +} + +static char **prepare_ddnatv_env(char *const envp[], const char *real_exe) { + init_ddnatv_hook(); + int count = 0; + int has_preload = 0; + int has_ld_library_path = 0; + int has_root = 0; + int has_tunables = 0; + int has_path = 0; + int has_tmp = 0; + int has_threads_max = 0; + int has_xz_opt = 0; + int has_xz_defaults = 0; + int has_frontend = 0; + int has_debconf_frontend = 0; + int has_debconf_seen = 0; + + const char *chosen_real_exe = (real_exe && real_exe[0] != '\0') ? real_exe : (g_real_exe[0] != '\0' ? g_real_exe : NULL); + + // Every variable is looked at on every exec, so only the names that start with its first letter + // are compared (this was 13 strncmp() calls for each of the 30 or so variables) + int has_nt = 0; + int has_binds = 0; + int has_hostname = 0; + int has_link_root = 0; + int has_preload_list = 0; + const char *preload_value = NULL; + while (envp && envp[count]) { + const char *e = envp[count]; + switch (e[0]) { + case 'L': + if (strncmp(e, "LD_PRELOAD=", 11) == 0) { has_preload = 1; preload_value = e + 11; } + else if (strncmp(e, "LD_LIBRARY_PATH=", 16) == 0) has_ld_library_path = 1; + break; + case 'G': + if (strncmp(e, "GLIBC_TUNABLES=", 15) == 0) has_tunables = 1; + break; + case 'P': + if (strncmp(e, "PATH=", 5) == 0) has_path = 1; + break; + case 'T': + if (strncmp(e, "TMPDIR=", 7) == 0) has_tmp = 1; + break; + case 'X': + if (strncmp(e, "XZ_OPT=", 7) == 0) has_xz_opt = 1; + else if (strncmp(e, "XZ_DEFAULTS=", 12) == 0) has_xz_defaults = 1; + break; + case 'D': + if (strncmp(e, "DDNATV_ROOT=", 12) == 0) has_root = 1; + else if (strncmp(e, "DDNATV_NT=", 10) == 0) has_nt = 1; + else if (strncmp(e, "DDNATV_BINDS=", 13) == 0) has_binds = 1; + else if (strncmp(e, "DDNATV_PRELOAD=", 15) == 0) has_preload_list = 1; + else if (strncmp(e, "DDNATV_HOSTNAME=", 16) == 0) has_hostname = 1; + else if (strncmp(e, "DDNATV_LINK_ROOT=", 17) == 0) has_link_root = 1; + else if (strncmp(e, "DPKG_DEB_THREADS_MAX=", 21) == 0) has_threads_max = 1; + else if (strncmp(e, "DEBIAN_FRONTEND=", 16) == 0) has_frontend = 1; + else if (strncmp(e, "DEBCONF_FRONTEND=", 17) == 0) has_debconf_frontend = 1; + else if (strncmp(e, "DEBCONF_NONINTERACTIVE_SEEN=", 28) == 0) has_debconf_seen = 1; + break; + default: + break; + } + count++; + } + + char **new_env = calloc(count + 24, sizeof(char *)); + int dst = 0; + for (int i = 0; i < count; i++) { + if (has_preload && envp[i][0] == 'L' && strncmp(envp[i], "LD_PRELOAD=", 11) == 0) { + // ld.so opens these itself: the guest's paths are mapped to the rootfs, and the libraries every + // program loads (DDNATV_PRELOAD) come first + char *mapped = map_preload_paths(preload_value); + if (mapped) { + size_t chain = g_preload_host ? strlen(g_preload_host) : 0; + int has_chain = chain > 0 && strstr(mapped, g_preload_host) != NULL; + size_t len = 11 + chain + 1 + strlen(mapped) + 1; + char *str = malloc(len); + if (str) { + if (chain > 0 && !has_chain) snprintf(str, len, "LD_PRELOAD=%s:%s", g_preload_host, mapped); + else snprintf(str, len, "LD_PRELOAD=%s", mapped); + new_env[dst++] = str; + free(mapped); + continue; + } + free(mapped); + } + } + // If we have an explicit real executable, drop the inherited entry to replace with the fresh target + if (chosen_real_exe && envp[i][0] == 'D' && strncmp(envp[i], "DDNATV_REAL_EXE=", 16) == 0) { + continue; + } + new_env[dst++] = envp[i]; + } + + // Exact-size strings: this runs before every exec, often in a freshly forked child where each + // newly touched page is a copy-on-write fault. + if (chosen_real_exe) { + size_t len = strlen(chosen_real_exe); + char *str = malloc(16 + len + 1); + if (str) { + memcpy(str, "DDNATV_REAL_EXE=", 16); + memcpy(str + 16, chosen_real_exe, len + 1); + new_env[dst++] = str; + } + } + + char hook_buf[PATH_MAX]; + const char *hook = (!has_preload && g_ddnatv_root[0] != '\0') ? ddnatv_hook_library(hook_buf, sizeof(hook_buf)) : NULL; + if (hook) { + size_t hook_len = strlen(hook); + size_t host_len = g_preload_host ? strlen(g_preload_host) + 1 : 0; + size_t size = 11 + host_len + hook_len + 1; + char *str = malloc(size); + if (str) { + size_t n = ddnatv_append(str, size, 0, "LD_PRELOAD=", 11); + if (host_len) { + n = ddnatv_append(str, size, n, g_preload_host, host_len - 1); + n = ddnatv_append(str, size, n, ":", 1); + } + ddnatv_append(str, size, n, hook, hook_len); + new_env[dst++] = str; + } + } + if (!has_preload_list && g_preload_guest) { + size_t len = strlen(g_preload_guest); + char *str = malloc(15 + len + 1); + if (str) { + memcpy(str, "DDNATV_PRELOAD=", 15); + memcpy(str + 15, g_preload_guest, len + 1); + new_env[dst++] = str; + } + } + if (!has_ld_library_path && g_ddnatv_root[0] != '\0') { + size_t size = 16 + 1; + for (size_t i = 0; i < sizeof(k_rootfs_lib_dirs) / sizeof(k_rootfs_lib_dirs[0]); i++) { + char dir[PATH_MAX]; + size += 1 + strlen(rewrite_path_in_root(k_rootfs_lib_dirs[i], dir, sizeof(dir))); + } + char *str = malloc(size); + if (str) { + size_t n = ddnatv_append(str, size, 0, "LD_LIBRARY_PATH=", 16); + append_rootfs_lib_dirs(str, size, n, 0); + new_env[dst++] = str; + } + } + if (!has_root && g_ddnatv_root[0] != '\0') { + char *str = malloc(PATH_MAX + 16); + if (str) { + snprintf(str, PATH_MAX + 16, "DDNATV_ROOT=%s", g_ddnatv_root); + new_env[dst++] = str; + } + } + if (!has_link_root && g_link_root_len) { + char *str = malloc(17 + g_link_root_len + 1); + if (str) { + memcpy(str, "DDNATV_LINK_ROOT=", 17); + memcpy(str + 17, g_link_root, g_link_root_len + 1); + new_env[dst++] = str; + } + } + if (!has_hostname && g_hostname[0]) { + char *str = malloc(16 + sizeof(g_hostname)); + if (str) { + snprintf(str, 16 + sizeof(g_hostname), "DDNATV_HOSTNAME=%s", g_hostname); + new_env[dst++] = str; + } + } + if (!has_binds && g_binds_raw) { + size_t len = strlen(g_binds_raw); + char *str = malloc(13 + len + 1); + if (str) { + memcpy(str, "DDNATV_BINDS=", 13); + memcpy(str + 13, g_binds_raw, len + 1); + new_env[dst++] = str; + } + } + // This process looked for the ARM translator's files and found none: the programs it starts + // need not look again (it takes a look at /proc/self/fd in each of them, see privileged.c) + if (!has_nt && g_no_translator) { + new_env[dst++] = strdup("DDNATV_NT=0"); + } + if (!has_tunables) { + new_env[dst++] = strdup("GLIBC_TUNABLES=glibc.pthread.rseq=0"); + } + if (!has_path) { + new_env[dst++] = strdup("PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"); + } + if (!has_tmp && g_ddnatv_root[0] != '\0') { + char *str = malloc(PATH_MAX + 16); + if (str) { + snprintf(str, PATH_MAX + 16, "TMPDIR=%s/tmp", g_ddnatv_root); + new_env[dst++] = str; + } + } + if (!has_threads_max) { + new_env[dst++] = strdup("DPKG_DEB_THREADS_MAX=1"); + } + if (!has_xz_opt) { + new_env[dst++] = strdup("XZ_OPT=-T1"); + } + if (!has_xz_defaults) { + new_env[dst++] = strdup("XZ_DEFAULTS=-T1"); + } + if (!has_frontend) { + new_env[dst++] = strdup("DEBIAN_FRONTEND=noninteractive"); + } + if (!has_debconf_frontend) { + new_env[dst++] = strdup("DEBCONF_FRONTEND=noninteractive"); + } + if (!has_debconf_seen) { + new_env[dst++] = strdup("DEBCONF_NONINTERACTIVE_SEEN=true"); + } + new_env[dst] = NULL; + return new_env; +} + +static void free_modified_env(char **modified_env, char *const orig_env[]) { + if (!modified_env) return; + for (int i = 0; modified_env[i] != NULL; i++) { + int is_orig = 0; + if (orig_env) { + for (int j = 0; orig_env[j] != NULL; j++) { + if (modified_env[i] == orig_env[j]) { + is_orig = 1; + break; + } + } + } + if (!is_orig) { + free(modified_env[i]); + } + } + free(modified_env); +} + +#endif /* !DDNATV_HOST_TEST */ diff --git a/tools/nativeguest/hook/exec.c b/tools/nativeguest/hook/exec.c new file mode 100644 index 0000000000..90df96f8fe --- /dev/null +++ b/tools/nativeguest/hook/exec.c @@ -0,0 +1,1127 @@ +// Part of libddnatv-hook.so, included by ddnatv-hook.c (one translation unit, so the +// parts share their static functions and are built with the same command as before). +// +// execve() and posix_spawn(): rootfs programs through ld.so with the hook, scripts through their +// interpreter, Android programs with Android's environment. + +#ifndef DDNATV_HOST_TEST + +// Runs before every exec, mostly in a child a shell has just forked: the copies write only the +// string (ddnatv_copy_cstr), not the whole PATH_MAX buffer, since each page written there is a +// copy-on-write fault. +static void resolve_symlinks(const char *path, char *out, size_t out_size, int depth) { + if (!path || !out || out_size == 0) return; + ddnatv_copy_cstr(out, out_size, path); + if (depth > 8) return; + + char link_target[PATH_MAX]; + ssize_t len = readlink(path, link_target, sizeof(link_target) - 1); + if (len < 0) return; + link_target[len] = '\0'; + + char next_path[PATH_MAX]; + if (link_target[0] == '/') { + char rw_buf[PATH_MAX]; + const char *rewritten = rewrite_path(link_target, rw_buf, sizeof(rw_buf)); + ddnatv_copy_cstr(next_path, sizeof(next_path), rewritten); + } else { + const char *slash = strrchr(path, '/'); + if (slash) { + size_t dir_len = (size_t)(slash - path); + if (dir_len > sizeof(next_path) - 1) dir_len = sizeof(next_path) - 1; + memcpy(next_path, path, dir_len); + next_path[dir_len] = '\0'; + size_t n = ddnatv_append(next_path, sizeof(next_path), dir_len, "/", 1); + ddnatv_append(next_path, sizeof(next_path), n, link_target, (size_t)len); + } else { + ddnatv_copy_cstr(next_path, sizeof(next_path), link_target); + } + } + // proot's link2symlink leaves hard links as ".l2s.*" files that programs must not see by name + const char *next_base = strrchr(next_path, '/'); + next_base = next_base ? next_base + 1 : next_path; + if (strncmp(next_base, ".l2s.", 5) == 0) return; + resolve_symlinks(next_path, out, out_size, depth + 1); +} + +static char **ensure_hook_in_envp(char *const envp[], const char *real_exe) { + return prepare_ddnatv_env(envp, real_exe); +} + +// The file whose header decides how to start `target`: the symlink-resolved ELF (so ld.so and +// /proc/self/exe see the real program, as with the kernel), else `target` itself (scripts, +// links to ld.so). `probe` describes the returned file. +static const char *select_exec_target(const char *target, char *resolved, size_t resolved_size, struct exec_probe *probe) { + resolve_symlinks(target, resolved, resolved_size, 0); + probe_exec_file(resolved, probe); + if (probe->is_elf && !is_ld_linux(resolved)) return resolved; + if (strcmp(resolved, target) != 0) probe_exec_file(target, probe); + return target; +} + +// The library children get with --preload: the one this process runs from, so that a program +// always starts with the same build as its parent, else the first of usr/lib and lib that exists; +// NULL if neither does. +// The path dladdr() finds is kept (it does not change): set once, read by every later exec, and +// set before a fork by prepare_exec_in_parent() so that the children only read it. +static char g_hook_library[PATH_MAX]; +static int g_hook_library_known = 0; + +static const char *ddnatv_hook_library(char *buf, size_t bufsz) { + static const char usr_lib[] = "/usr/lib/libddnatv-hook.so"; + static const char lib[] = "/lib/libddnatv-hook.so"; + if (__atomic_load_n(&g_hook_library_known, __ATOMIC_ACQUIRE)) return g_hook_library; + Dl_info info; + if (dladdr((void *)ddnatv_hook_library, &info) && info.dli_fname && info.dli_fname[0] == '/' && + strlen(info.dli_fname) < sizeof(g_hook_library)) { + // loaded from there, so it exists + ddnatv_copy_cstr(g_hook_library, sizeof(g_hook_library), info.dli_fname); + __atomic_store_n(&g_hook_library_known, 1, __ATOMIC_RELEASE); + return g_hook_library; + } + size_t n = ddnatv_append(buf, bufsz, 0, g_ddnatv_root, g_ddnatv_root_len); + ddnatv_append(buf, bufsz, n, usr_lib, sizeof(usr_lib) - 1); + if (access(buf, F_OK) == 0) return buf; + n = ddnatv_append(buf, bufsz, 0, g_ddnatv_root, g_ddnatv_root_len); + ddnatv_append(buf, bufsz, n, lib, sizeof(lib) - 1); + return access(buf, F_OK) == 0 ? buf : NULL; +} + +// ld.so does not need the exec bit on the program it loads, but other tools look at it: set +// it as the old access(X_OK)/chmod() pair did, using the mode the probe already has. +static void ensure_exec_bit(const char *path, mode_t mode) { + if (S_ISDIR(mode) || (mode & 0111) != 0) return; + if (strstr(path, "/bin/") || strstr(path, "/sbin/")) return; + chmod(path, 0755); +} + +// Rootfs path of a "#!" interpreter; a missing /bin/sh falls back to Android's shell. +static const char *shebang_interpreter(const char *interp, char *buf, size_t bufsz) { + const char *rewritten = rewrite_path(interp, buf, bufsz); + if (strcmp(interp, "/bin/sh") == 0 && access(rewritten, F_OK) != 0 && access("/system/bin/sh", X_OK) == 0) { + return "/system/bin/sh"; + } + return rewritten; +} + +static const char *exec_prog_name(const char *target) { + const char *slash = strrchr(target, '/'); + return slash ? slash + 1 : target; +} + +// Hook execve +typedef int (*orig_execve_f_type)(const char *filename, char *const argv[], char *const envp[]); + +// glibc's execve(), looked up once (also by prepare_exec_in_parent() before a fork) +static orig_execve_f_type g_orig_execve = NULL; + +static orig_execve_f_type real_execve(void) { + orig_execve_f_type f = __atomic_load_n(&g_orig_execve, __ATOMIC_RELAXED); + if (!f) { + f = (orig_execve_f_type)dlsym(RTLD_NEXT, "execve"); + __atomic_store_n(&g_orig_execve, f, __ATOMIC_RELAXED); + } + return f; +} + +// prepare_exec_in_parent() rehearses an exec in the parent: everything up to the execve() itself, +// which this then skips. Only in the thread that rehearses: another thread's exec at that moment +// is a real one. +static int g_exec_rehearsal = 0; +static pthread_t g_exec_rehearsal_thread; + +static int in_exec_rehearsal(void) { + return __atomic_load_n(&g_exec_rehearsal, __ATOMIC_ACQUIRE) && + pthread_equal(pthread_self(), g_exec_rehearsal_thread); +} + +static int run_execve(orig_execve_f_type f, const char *path, char *const argv[], char *const envp[]) { + if (in_exec_rehearsal()) { + errno = 0; + return 0; + } + return f(path, argv, envp); +} + +// ldconfig does nothing in The native userland (its cache is for paths that ld.so opens without the hook), but the +// exec code reads /etc/ld.so.conf(.d) again when /etc/ld.so.cache changes: "sudo ldconfig" after an +// edit of a .conf file marks it changed, as the real ldconfig would by writing it. A cache asked +// for with -C is made (empty): Flatpak mounts the one it generates over /etc/ld.so.cache. +static void ldconfig_mark_cache(char *const argv[]) { + if (g_ddnatv_root[0] == '\0') return; + char path[PATH_MAX]; + const char *cache = NULL; + for (int i = 1; argv && argv[i]; i++) { + if (strcmp(argv[i], "-C") == 0 && argv[i + 1]) cache = argv[++i]; + else if (strncmp(argv[i], "-C", 2) == 0 && argv[i][2] != '\0') cache = argv[i] + 2; + } + const char *target = path; + if (cache) { + target = rewrite_path_in_root(cache, path, sizeof(path)); + } else { + size_t n = ddnatv_append(path, sizeof(path), 0, g_ddnatv_root, g_ddnatv_root_len); + ddnatv_append(path, sizeof(path), n, "/etc/ld.so.cache", 16); + } + int fd = (int)syscall(SYS_openat, AT_FDCWD, target, O_WRONLY | O_CREAT | O_CLOEXEC, 0644); + if (fd < 0) return; + syscall(SYS_utimensat, fd, NULL, NULL, 0); + syscall(SYS_close, fd); +} + +static int is_ldconfig_name(const char *name) { + return strcmp(name, "ldconfig") == 0 || strcmp(name, "ldconfig.real") == 0; +} + +static int ddnatv_execve(const char *filename, char *const argv[], char *const envp[], int depth) { + orig_execve_f_type orig_execve = real_execve(); + if (!orig_execve) { + errno = ENOSYS; + return -1; + } + + // Scripts get the path exactly as the caller wrote it ("./x.sh" stays "./x.sh" in $0), + // like the kernel would pass it; routing below uses the absolute form. + const char *caller_path = filename; + char abs_buf[PATH_MAX]; + filename = absolutize_exec_path(filename, abs_buf, sizeof(abs_buf)); + + char buf[PATH_MAX]; + const char *target = rewrite_path(filename, buf, sizeof(buf)); + + init_ddnatv_hook(); + + const char *f_base = (filename != NULL) ? strrchr(filename, '/') : NULL; + f_base = (f_base != NULL) ? f_base + 1 : (filename != NULL ? filename : ""); + + const char *prog_name = strrchr(target, '/'); + prog_name = (prog_name != NULL) ? prog_name + 1 : target; + + // Wine's preloader is a static program that opens the program and the dynamic linker it loads with + // system calls of its own, which no hook can map, to reserve address ranges before the linker runs. + // The program is started without it: its libc and ntdll reserve what Wine needs themselves. + if ((strcmp(prog_name, "wine-preloader") == 0 || strcmp(prog_name, "wine64-preloader") == 0) && + argv && argv[0] && argv[1] && depth < DDNATV_MAX_SHEBANG_DEPTH) { + return ddnatv_execve(argv[1], argv + 1, envp, depth + 1); + } + + // Intercept utilities that fail or cause issues in unprivileged Android environment + if (strcmp(f_base, "ldconfig") == 0 || + strcmp(f_base, "ldconfig.real") == 0 || + strcmp(f_base, "systemd-machine-id-setup") == 0 || + strcmp(f_base, "systemd-sysusers") == 0 || + strcmp(f_base, "systemd-tmpfiles") == 0 || + strcmp(f_base, "start-stop-daemon") == 0 || + strcmp(f_base, "mandb") == 0 || + strcmp(f_base, "mandb.real") == 0 || + strcmp(f_base, "update-mime-database") == 0 || + strcmp(f_base, "update-desktop-database") == 0 || + strcmp(f_base, "install-info") == 0 || + strcmp(f_base, "install-sgmlcatalog") == 0 || + strcmp(prog_name, "ldconfig") == 0 || + strcmp(prog_name, "ldconfig.real") == 0 || + strcmp(prog_name, "systemd-machine-id-setup") == 0 || + strcmp(prog_name, "systemd-sysusers") == 0 || + strcmp(prog_name, "systemd-tmpfiles") == 0 || + strcmp(prog_name, "start-stop-daemon") == 0 || + strcmp(prog_name, "mandb") == 0 || + strcmp(prog_name, "mandb.real") == 0 || + strcmp(prog_name, "update-mime-database") == 0 || + strcmp(prog_name, "update-desktop-database") == 0 || + strcmp(prog_name, "install-info") == 0 || + strcmp(prog_name, "install-sgmlcatalog") == 0) { + if (is_ldconfig_name(f_base) || is_ldconfig_name(prog_name)) ldconfig_mark_cache(argv); + _exit(0); + } + if (strcmp(f_base, "mountpoint") == 0 || strcmp(prog_name, "mountpoint") == 0) { + int is_virtual_fs = 0; + for (int i = 1; argv && argv[i]; i++) { + if (strcmp(argv[i], "/proc") == 0 || strcmp(argv[i], "/proc/") == 0 || + strcmp(argv[i], "/sys") == 0 || strcmp(argv[i], "/sys/") == 0 || + strcmp(argv[i], "/dev") == 0 || strcmp(argv[i], "/dev/") == 0 || + strcmp(argv[i], "/dev/pts") == 0) { + is_virtual_fs = 1; + break; + } + } + if (is_virtual_fs) { + _exit(0); + } + } + if (strcmp(f_base, "policy-rc.d") == 0 || strcmp(prog_name, "policy-rc.d") == 0) { + _exit(101); + } + + // A static program inside the rootfs, to be made safe to start (prepare_static_program) + const char *static_elf = NULL; + char resolved_target[PATH_MAX]; + + // Only intercept binaries/scripts within DDNATV_ROOT + if ((g_ddnatv_root[0] != '\0' && strncmp(target, g_ddnatv_root, g_ddnatv_root_len) == 0) || is_mapped_guest_path(filename)) { + struct exec_probe probe; + const char *elf_target = select_exec_target(target, resolved_target, sizeof(resolved_target), &probe); + if (probe.is_elf && !probe.is_dynamic) static_elf = elf_target; + // A Go program built for Android asks for Android's linker, so it is started like the dynamic + // ones, but it makes its own system calls: it gets the code of the static Go programs (#42) + if (probe.is_dynamic && probe.android_interp) prepare_static_program_ex(elf_target, 1); + + // 1. Transparently route dynamically linked glibc ELF binaries through ld.so + // Note: Statically linked binaries (PT_INTERP absent, e.g. Meta Muse Code) must execute directly! + if (probe.is_dynamic) { + char ld_so[PATH_MAX]; + ld_so[0] = '\0'; + if (find_dynamic_linker_for_machine(g_ddnatv_root, probe.e_machine, ld_so, sizeof(ld_so)) && strcmp(elf_target, ld_so) != 0) { + ensure_exec_bit(elf_target, probe.mode); + + if (!in_exec_rehearsal()) ddnatv_copy_cstr(g_real_exe, sizeof(g_real_exe), elf_target); + + char hook_buf[PATH_MAX]; + const char *hook_so = ddnatv_hook_library(hook_buf, sizeof(hook_buf)); + char ld_lib_path[PATH_MAX * 6]; + build_ld_library_path(envp, probe.runpath, probe.runpath_is_rpath, elf_target, ld_lib_path, sizeof(ld_lib_path)); + char **new_argv = build_ldso_argv(ld_so, hook_so, ld_lib_path, elf_target, exec_prog_name(target), argv); + if (!new_argv) { + errno = ENOMEM; + return -1; + } + char **new_env = ensure_hook_in_envp(envp, elf_target); + int ret = run_execve(orig_execve, ld_so, new_argv, new_env); + if (errno == EACCES && chmod(ld_so, 0755) == 0) { + // ld.so without its exec bit (an unusual restore): fix it once and retry + ret = run_execve(orig_execve, ld_so, new_argv, new_env); + } + int saved_errno = errno; + free(new_argv); + free_modified_env(new_env, envp); + errno = saved_errno; + return ret; + } + } + + // ld.so started directly (ldd, "ld.so --list PROGRAM", "ld.so PROGRAM"): the program it loads + // gets the --library-path a start of its own gets, or ldd reports its libraries as not found, + // and its path mapped into the rootfs, since ld.so opens it without the hook + if (probe.is_elf && !probe.is_dynamic && is_ld_linux(elf_target)) { + int caller_lib_path = 0; + int pi = ldso_program_index(argv, &caller_lib_path); + if (pi > 0 && caller_lib_path) { + // the caller's own --library-path stays as it is; only the program is mapped (when it is + // in the rootfs: a caller can also name a file by its real path) + char prog_buf[PATH_MAX]; + const char *prog = argv[pi]; + if (prog[0] == '/') { + const char *mapped = rewrite_path(prog, prog_buf, sizeof(prog_buf)); + int fd = mapped != prog ? (int)syscall(SYS_openat, AT_FDCWD, mapped, O_PATH | O_CLOEXEC) : -1; + if (fd >= 0) { + syscall(SYS_close, fd); + prog = mapped; + } + } + int argc = 0; + while (argv[argc]) argc++; + char **new_argv = (char **)malloc(sizeof(char *) * (size_t)(argc + 1)); + if (!new_argv) { + errno = ENOMEM; + return -1; + } + for (int i = 0; i <= argc; i++) new_argv[i] = argv[i]; + new_argv[pi] = (char *)prog; + prepare_static_program(static_elf); // ld.so is a static program itself + char **ddnatv_env = prepare_ddnatv_env(envp, target); + int ret = run_execve(orig_execve, target, new_argv, ddnatv_env); + int saved_errno = errno; + free_modified_env(ddnatv_env, envp); + free(new_argv); + errno = saved_errno; + return ret; + } + if (pi > 0) { + char prog_buf[PATH_MAX]; + const char *prog = argv[pi][0] == '/' ? rewrite_path(argv[pi], prog_buf, sizeof(prog_buf)) : argv[pi]; + struct exec_probe prog_probe; + probe_exec_file(prog, &prog_probe); + char ld_lib_path[PATH_MAX * 6]; + build_ld_library_path(envp, prog_probe.runpath, prog_probe.runpath_is_rpath, + prog[0] == '/' ? prog : NULL, ld_lib_path, sizeof(ld_lib_path)); + int argc = 0; + while (argv[argc]) argc++; + char **new_argv = (char **)malloc(sizeof(char *) * (size_t)(argc + 3)); + if (!new_argv) { + errno = ENOMEM; + return -1; + } + new_argv[0] = argv[0]; + new_argv[1] = (char *)"--library-path"; + new_argv[2] = ld_lib_path; + for (int i = 1; i <= argc; i++) new_argv[i + 2] = argv[i]; + new_argv[pi + 2] = (char *)prog; // ld.so opens it itself: "ldd /usr/bin/adb" as well + prepare_static_program(static_elf); // ld.so is a static program itself + char **ddnatv_env = prepare_ddnatv_env(envp, target); + int ret = run_execve(orig_execve, target, new_argv, ddnatv_env); + int saved_errno = errno; + free_modified_env(ddnatv_env, envp); + free(new_argv); + errno = saved_errno; + return ret; + } + } + + // 2. Handle scripts with shebang lines (e.g., #!/bin/sh, #!/usr/bin/perl) + if (!probe.is_elf && probe.n >= 2 && probe.hdr[0] == '#' && probe.hdr[1] == '!') { + char *interp; + char *interp_arg; + parse_shebang(probe.hdr, &interp, &interp_arg); + char interp_buf[PATH_MAX]; + const char *rewritten_interp = shebang_interpreter(interp, interp_buf, sizeof(interp_buf)); + const char *script = (caller_path && caller_path[0] != '/') ? caller_path : target; + char **new_argv = build_script_argv(rewritten_interp, interp_arg, script, argv); + if (!new_argv) { + errno = ENOMEM; + return -1; + } + int ret; + if (is_host_interpreter(rewritten_interp)) { + char **sys_env = clean_env_for_system(envp); + ret = run_execve(orig_execve, rewritten_interp, new_argv, sys_env); + int saved_errno = errno; + free_modified_env(sys_env, envp); + errno = saved_errno; + } else if (depth >= DDNATV_MAX_SHEBANG_DEPTH) { + errno = ELOOP; + ret = -1; + } else { + char **ddnatv_env = prepare_ddnatv_env(envp, NULL); + ret = ddnatv_execve(rewritten_interp, new_argv, ddnatv_env, depth + 1); + int saved_errno = errno; + free_modified_env(ddnatv_env, envp); + errno = saved_errno; + } + free(new_argv); + return ret; + } + } else { + // Any binary outside DDNATV_ROOT is an Android host binary (e.g. /system/bin/su, /sbin/su, /data/adb/...) + char **sys_env = clean_env_for_system(envp); + int ret = run_execve(orig_execve, target, argv, sys_env); + int saved_errno = errno; + free_modified_env(sys_env, envp); + errno = saved_errno; + return ret; + } + + if (static_elf) prepare_static_program(static_elf); + char **ddnatv_env = prepare_ddnatv_env(envp, target); + int ret = run_execve(orig_execve, target, argv, ddnatv_env); + int saved_errno = errno; + free_modified_env(ddnatv_env, envp); + errno = saved_errno; + return ret; +} + +int execve(const char *filename, char *const argv[], char *const envp[]) { + return ddnatv_execve(filename, argv, envp, 0); +} + +// ---- fork() --------------------------------------------------------------------------------- +// A shell (and make, dpkg, perl, ...) starts a program with fork() and then execve() in the child. +// What the exec code above needs for the first time in a process (glibc's execve, fstat and readlink +// behind the hooks, the rootfs' ld.so, the path of this library) it found in the child, where every +// page it writes is a copy of the parent's: some 40 copy-on-write faults before each program even +// started, where a shell's child without the hook has fewer than ten. Now the parent finds them at +// its first fork(), and the children inherit them and only read them. At its eighth fork() the +// parent also rehearses an exec (everything but the execve() itself), which binds the calls the +// exec code makes and touches the code it runs. That costs about as much as it saves in four +// children, so only a process that keeps forking (a shell running a loop or a long script, make, +// dpkg) does it; one that forks a few times (sh -c with a pipe) does not pay for it. +#define DDNATV_FORKS_BEFORE_REHEARSAL 8 +static int g_exec_prepared = 0; // 1 after the first fork(), 2 after the rehearsal +static pthread_mutex_t g_exec_prepare_lock = PTHREAD_MUTEX_INITIALIZER; + +static void rehearse_exec(void) { + static const char rehearsal_target[] = "/usr/bin/true"; + char target_buf[PATH_MAX]; + const char *target = rewrite_path(rehearsal_target, target_buf, sizeof(target_buf)); + struct exec_probe probe; + // A dynamic program only: it takes the one way through ddnatv_execve() that ends in run_execve() + probe_exec_file(target, &probe); + if (!probe.is_elf || !probe.is_dynamic) return; + extern char **environ; + char *rehearsal_argv[] = { (char *)"true", NULL }; + g_exec_rehearsal_thread = pthread_self(); + __atomic_store_n(&g_exec_rehearsal, 1, __ATOMIC_RELEASE); + ddnatv_execve(rehearsal_target, rehearsal_argv, environ, 0); + __atomic_store_n(&g_exec_rehearsal, 0, __ATOMIC_RELEASE); +} + +static void prepare_exec_in_parent(int level) { + // One thread prepares (two rehearsing at once would take each other for the other's thread). + // Not waiting for the lock: a signal handler that forks while its thread is preparing would wait + // for itself; a busy lock leaves the preparation to a later fork(). + if (pthread_mutex_trylock(&g_exec_prepare_lock) != 0) return; + int done = __atomic_load_n(&g_exec_prepared, __ATOMIC_ACQUIRE); + if (done >= level) { + pthread_mutex_unlock(&g_exec_prepare_lock); + return; + } + int saved_errno = errno; + init_ddnatv_hook(); + real_execve(); + if (g_ddnatv_root[0] != '\0') { + if (done < 1) { + char ld_so[PATH_MAX]; +#if defined(__aarch64__) + uint16_t machine = 183; +#elif defined(__arm__) + uint16_t machine = 40; +#elif defined(__x86_64__) + uint16_t machine = 62; +#else + uint16_t machine = 0; +#endif + if (machine && find_dynamic_linker_for_machine(g_ddnatv_root, machine, ld_so, sizeof(ld_so))) { + // readlink(), open(), read() and close() behind the hooks, as the probe calls them + char resolved[PATH_MAX]; + struct exec_probe probe; + resolve_symlinks(ld_so, resolved, sizeof(resolved), 0); + probe_exec_file(ld_so, &probe); + } + char hook_buf[PATH_MAX]; + ddnatv_hook_library(hook_buf, sizeof(hook_buf)); + struct stat st; + probe_fstat(-1, &st); // looks fstat() up; -1 only fails with EBADF + char conf[PATH_MAX * 2]; + ldconf_dirs(conf, sizeof(conf)); // ld.so.conf read here, so the children only compare times + } + if (level >= 2) rehearse_exec(); + } + __atomic_store_n(&g_exec_prepared, level, __ATOMIC_RELEASE); + pthread_mutex_unlock(&g_exec_prepare_lock); + errno = saved_errno; +} + +pid_t fork(void) { + static pid_t (*orig_fork)(void) = NULL; + if (!orig_fork) orig_fork = (pid_t (*)(void))dlsym(RTLD_NEXT, "fork"); + if (!orig_fork) { + errno = ENOSYS; + return -1; + } + int done = __atomic_load_n(&g_exec_prepared, __ATOMIC_ACQUIRE); + if (done < 2) { + static int forks = 0; + int n = __atomic_add_fetch(&forks, 1, __ATOMIC_RELAXED); + if (n == 1 || n >= DDNATV_FORKS_BEFORE_REHEARSAL) prepare_exec_in_parent(n >= DDNATV_FORKS_BEFORE_REHEARSAL ? 2 : 1); + } + pid_t pid = orig_fork(); + // A child forked from a signal handler that interrupted a rehearsal is not rehearsing: its + // execve() is a real one (only read in the usual case, so no page is copied for it) + if (pid == 0 && __atomic_load_n(&g_exec_rehearsal, __ATOMIC_RELAXED)) __atomic_store_n(&g_exec_rehearsal, 0, __ATOMIC_RELAXED); + return pid; +} + +extern char **environ; + +int execv(const char *path, char *const argv[]) { + return execve(path, argv, environ); +} + +int execl(const char *path, const char *arg0, ...) { + va_list args; + va_start(args, arg0); + int count = (arg0 != NULL) ? 1 : 0; + if (arg0 != NULL) { + while (va_arg(args, const char *) != NULL) { + count++; + } + } + va_end(args); + + char **argv = (char **)calloc(count + 1, sizeof(char *)); + if (!argv) { + errno = ENOMEM; + return -1; + } + if (count > 0) { + argv[0] = (char *)arg0; + va_start(args, arg0); + for (int i = 1; i < count; i++) { + argv[i] = va_arg(args, char *); + } + va_end(args); + } + argv[count] = NULL; + int ret = execv(path, argv); + free(argv); + return ret; +} + +int execlp(const char *file, const char *arg0, ...) { + va_list args; + va_start(args, arg0); + int count = (arg0 != NULL) ? 1 : 0; + if (arg0 != NULL) { + while (va_arg(args, const char *) != NULL) { + count++; + } + } + va_end(args); + + char **argv = (char **)calloc(count + 1, sizeof(char *)); + if (!argv) { + errno = ENOMEM; + return -1; + } + if (count > 0) { + argv[0] = (char *)arg0; + va_start(args, arg0); + for (int i = 1; i < count; i++) { + argv[i] = va_arg(args, char *); + } + va_end(args); + } + argv[count] = NULL; + int ret = execvp(file, argv); + free(argv); + return ret; +} + +int execle(const char *path, const char *arg0, ...) { + va_list args; + va_start(args, arg0); + int count = (arg0 != NULL) ? 1 : 0; + if (arg0 != NULL) { + while (va_arg(args, const char *) != NULL) { + count++; + } + } + char *const *envp = va_arg(args, char *const *); + va_end(args); + + char **argv = (char **)calloc(count + 1, sizeof(char *)); + if (!argv) { + errno = ENOMEM; + return -1; + } + if (count > 0) { + argv[0] = (char *)arg0; + va_start(args, arg0); + for (int i = 1; i < count; i++) { + argv[i] = va_arg(args, char *); + } + va_end(args); + } + argv[count] = NULL; + int ret = execve(path, argv, (char *const *)envp); + free(argv); + return ret; +} + +int execvp(const char *file, char *const argv[]) { + if (!file || !*file) { + errno = ENOENT; + return -1; + } + if (strchr(file, '/')) { + return execve(file, argv, environ); + } + const char *path_env = getenv("PATH"); + if (!path_env) path_env = "/usr/bin:/bin"; + char path_copy[4096]; + strncpy(path_copy, path_env, sizeof(path_copy) - 1); + path_copy[sizeof(path_copy) - 1] = '\0'; + char *saveptr = NULL; + char *token = strtok_r(path_copy, ":", &saveptr); + while (token) { + char candidate[PATH_MAX]; + snprintf(candidate, sizeof(candidate), "%s/%s", token, file); + if (access(candidate, F_OK) == 0) { + return execve(candidate, argv, environ); + } + token = strtok_r(NULL, ":", &saveptr); + } + const char *standard_paths[] = {"/usr/bin", "/bin", "/usr/sbin", "/sbin", "/usr/local/bin", NULL}; + for (int i = 0; standard_paths[i] != NULL; i++) { + char candidate[PATH_MAX]; + snprintf(candidate, sizeof(candidate), "%s/%s", standard_paths[i], file); + if (access(candidate, F_OK) == 0) { + return execve(candidate, argv, environ); + } + } + return execve(file, argv, environ); +} + +int execvpe(const char *file, char *const argv[], char *const envp[]) { + if (!file || !*file) { + errno = ENOENT; + return -1; + } + if (strchr(file, '/')) { + return execve(file, argv, envp); + } + const char *path_env = NULL; + if (envp) { + for (char *const *ep = envp; *ep; ep++) { + if (strncmp(*ep, "PATH=", 5) == 0) { + path_env = *ep + 5; + break; + } + } + } + if (!path_env) path_env = getenv("PATH"); + if (!path_env) path_env = "/usr/bin:/bin"; + char path_copy[4096]; + strncpy(path_copy, path_env, sizeof(path_copy) - 1); + path_copy[sizeof(path_copy) - 1] = '\0'; + char *saveptr = NULL; + char *token = strtok_r(path_copy, ":", &saveptr); + while (token) { + char candidate[PATH_MAX]; + snprintf(candidate, sizeof(candidate), "%s/%s", token, file); + if (access(candidate, F_OK) == 0) { + return execve(candidate, argv, envp); + } + token = strtok_r(NULL, ":", &saveptr); + } + const char *standard_paths[] = {"/usr/bin", "/bin", "/usr/sbin", "/sbin", "/usr/local/bin", NULL}; + for (int i = 0; standard_paths[i] != NULL; i++) { + char candidate[PATH_MAX]; + snprintf(candidate, sizeof(candidate), "%s/%s", standard_paths[i], file); + if (access(candidate, F_OK) == 0) { + return execve(candidate, argv, envp); + } + } + return execve(file, argv, envp); +} + +typedef int (*orig_posix_spawn_f_type)(pid_t *, const char *, const posix_spawn_file_actions_t *, + const posix_spawnattr_t *, char *const [], char *const []); + +static orig_posix_spawn_f_type real_posix_spawn(void) { + static orig_posix_spawn_f_type orig_posix_spawn = NULL; + if (!orig_posix_spawn) orig_posix_spawn = (orig_posix_spawn_f_type)dlsym(RTLD_NEXT, "posix_spawn"); + return orig_posix_spawn; +} + +static int ddnatv_posix_spawn(pid_t *pid, const char *path, + const posix_spawn_file_actions_t *file_actions, + const posix_spawnattr_t *attrp, + char *const argv[], char *const envp[], int depth); + +// A rootfs script: start its interpreter with the same file actions and attributes. Handing the +// script to the kernel resolves "#!/bin/sh" to Android's own shell, which crashed on the glibc +// hook in LD_PRELOAD (and "#!/usr/bin/env" etc. used to fall back to fork() + execve(), which +// dropped the file actions). +static int spawn_script(pid_t *pid, const char *script, struct exec_probe *probe, + const posix_spawn_file_actions_t *file_actions, const posix_spawnattr_t *attrp, + char *const argv[], char *const envp[], int depth) { + char *interp; + char *interp_arg; + parse_shebang(probe->hdr, &interp, &interp_arg); + char interp_buf[PATH_MAX]; + const char *rewritten_interp = shebang_interpreter(interp, interp_buf, sizeof(interp_buf)); + char **new_argv = build_script_argv(rewritten_interp, interp_arg, script, argv); + if (!new_argv) return ENOMEM; + int ret; + if (is_host_interpreter(rewritten_interp)) { + orig_posix_spawn_f_type orig_posix_spawn = real_posix_spawn(); + char **sys_env = clean_env_for_system(envp); + ret = orig_posix_spawn ? orig_posix_spawn(pid, rewritten_interp, file_actions, attrp, new_argv, sys_env) : ENOSYS; + free_modified_env(sys_env, envp); + } else { + ret = ddnatv_posix_spawn(pid, rewritten_interp, file_actions, attrp, new_argv, envp, depth + 1); + } + free(new_argv); + return ret; +} + +static int ddnatv_posix_spawn(pid_t *pid, const char *path, + const posix_spawn_file_actions_t *file_actions, + const posix_spawnattr_t *attrp, + char *const argv[], char *const envp[], int depth) { + orig_posix_spawn_f_type orig_posix_spawn = real_posix_spawn(); + + const char *caller_path = path; + char abs_buf[PATH_MAX]; + path = absolutize_exec_path(path, abs_buf, sizeof(abs_buf)); + + char buf[PATH_MAX]; + const char *target = rewrite_path(path, buf, sizeof(buf)); + + init_ddnatv_hook(); + + const char *f_base = (path != NULL) ? strrchr(path, '/') : NULL; + f_base = (f_base != NULL) ? f_base + 1 : (path != NULL ? path : ""); + + const char *prog_name = exec_prog_name(target); + + if (strcmp(f_base, "ldconfig") == 0 || + strcmp(f_base, "ldconfig.real") == 0 || + strcmp(f_base, "systemd-machine-id-setup") == 0 || + strcmp(f_base, "systemd-sysusers") == 0 || + strcmp(f_base, "systemd-tmpfiles") == 0 || + strcmp(f_base, "start-stop-daemon") == 0 || + strcmp(prog_name, "ldconfig") == 0 || + strcmp(prog_name, "ldconfig.real") == 0 || + strcmp(prog_name, "systemd-machine-id-setup") == 0 || + strcmp(prog_name, "systemd-sysusers") == 0 || + strcmp(prog_name, "systemd-tmpfiles") == 0 || + strcmp(prog_name, "start-stop-daemon") == 0) { + pid_t child = fork(); + if (child == 0) { + if (is_ldconfig_name(f_base) || is_ldconfig_name(prog_name)) ldconfig_mark_cache(argv); + _exit(0); + } else if (child > 0) { + if (pid) *pid = child; + return 0; + } + return errno; + } + if (strcmp(f_base, "mountpoint") == 0 || strcmp(prog_name, "mountpoint") == 0) { + int is_virtual_fs = 0; + for (int i = 1; argv && argv[i]; i++) { + if (strcmp(argv[i], "/proc") == 0 || strcmp(argv[i], "/proc/") == 0 || + strcmp(argv[i], "/sys") == 0 || strcmp(argv[i], "/sys/") == 0 || + strcmp(argv[i], "/dev") == 0 || strcmp(argv[i], "/dev/") == 0 || + strcmp(argv[i], "/dev/pts") == 0) { + is_virtual_fs = 1; + break; + } + } + if (is_virtual_fs) { + pid_t child = fork(); + if (child == 0) { + _exit(0); + } else if (child > 0) { + if (pid) *pid = child; + return 0; + } + return errno; + } + } + if (strcmp(f_base, "policy-rc.d") == 0 || strcmp(prog_name, "policy-rc.d") == 0) { + pid_t child = fork(); + if (child == 0) { + _exit(101); + } else if (child > 0) { + if (pid) *pid = child; + return 0; + } + return errno; + } + + char *const *orig_ep = envp ? envp : environ; + int in_root = (g_ddnatv_root[0] != '\0' && strncmp(target, g_ddnatv_root, g_ddnatv_root_len) == 0) || is_mapped_guest_path(path); + + struct exec_probe probe; + char resolved_target[PATH_MAX]; + const char *elf_target = target; + if (in_root) { + elf_target = select_exec_target(target, resolved_target, sizeof(resolved_target), &probe); + if (!probe.is_elf && probe.n >= 2 && probe.hdr[0] == '#' && probe.hdr[1] == '!') { + // Like the kernel, give up after a few nested "#!" interpreters. + if (depth >= DDNATV_MAX_SHEBANG_DEPTH) return ELOOP; + const char *script = (caller_path && caller_path[0] != '/') ? caller_path : target; + return spawn_script(pid, script, &probe, file_actions, attrp, argv, orig_ep, depth); + } + } else { + probe.hdr[0] = '\0'; + probe.n = -1; + probe.is_elf = 0; + probe.is_dynamic = 0; + probe.android_interp = 0; + probe.e_machine = 0; + probe.mode = 0; + probe.runpath[0] = '\0'; + probe.runpath_is_rpath = 0; + } + + char ld_so[PATH_MAX]; + ld_so[0] = '\0'; + int has_ld_so = probe.is_dynamic ? find_dynamic_linker_for_machine(g_ddnatv_root, probe.e_machine, ld_so, sizeof(ld_so)) : 0; + + // Android programs get Android's environment, as execve() gives them: the glibc hook in + // LD_PRELOAD crashes them. + char **new_envp = in_root ? ensure_hook_in_envp(orig_ep, elf_target) : clean_env_for_system(orig_ep); + + int ret = -1; + if (has_ld_so && strcmp(elf_target, ld_so) != 0) { + ensure_exec_bit(elf_target, probe.mode); + if (probe.android_interp) prepare_static_program_ex(elf_target, 1); // a Go program built for Android (#42) + + char hook_buf[PATH_MAX]; + const char *hook_so = ddnatv_hook_library(hook_buf, sizeof(hook_buf)); + char ld_lib_path[PATH_MAX * 6]; + build_ld_library_path(orig_ep, probe.runpath, probe.runpath_is_rpath, elf_target, ld_lib_path, sizeof(ld_lib_path)); + char **new_argv = build_ldso_argv(ld_so, hook_so, ld_lib_path, elf_target, prog_name, argv); + if (!new_argv) { + ret = ENOMEM; + } else { + if (orig_posix_spawn) { + ret = orig_posix_spawn(pid, ld_so, file_actions, attrp, new_argv, new_envp); + if (ret == EACCES && chmod(ld_so, 0755) == 0) { + // ld.so without its exec bit (an unusual restore): fix it once and retry + ret = orig_posix_spawn(pid, ld_so, file_actions, attrp, new_argv, new_envp); + } + } + free(new_argv); + } + } else { + if (in_root && probe.is_elf && !probe.is_dynamic) prepare_static_program(elf_target); + if (orig_posix_spawn) { + ret = orig_posix_spawn(pid, target, file_actions, attrp, argv, new_envp); + } + } + + if (!orig_posix_spawn) { + pid_t child = fork(); + if (child < 0) { + free_modified_env(new_envp, orig_ep); + return errno; + } else if (child == 0) { + execve(target, argv, new_envp); + _exit(127); + } else { + if (pid) *pid = child; + free_modified_env(new_envp, orig_ep); + return 0; + } + } + free_modified_env(new_envp, orig_ep); + return ret; +} + +static int apply_closefrom(posix_spawn_file_actions_t *actions); + +int posix_spawn(pid_t *pid, const char *path, + const posix_spawn_file_actions_t *file_actions, + const posix_spawnattr_t *attrp, + char *const argv[], char *const envp[]) { + if (file_actions) { + int bad = apply_closefrom((posix_spawn_file_actions_t *)file_actions); + if (bad) return bad; + } + posix_spawnattr_t sanitized; + return ddnatv_posix_spawn(pid, path, file_actions, spawn_attr_for_android(attrp, &sanitized), argv, envp, 0); +} + +int posix_spawnp(pid_t *pid, const char *file, + const posix_spawn_file_actions_t *file_actions, + const posix_spawnattr_t *attrp, + char *const argv[], char *const envp[]) { + if (!file || !*file) { + return ENOENT; + } + if (strchr(file, '/')) { + return posix_spawn(pid, file, file_actions, attrp, argv, envp); + } + const char *path_env = NULL; + if (envp) { + for (char *const *ep = envp; *ep; ep++) { + if (strncmp(*ep, "PATH=", 5) == 0) { + path_env = *ep + 5; + break; + } + } + } + if (!path_env) path_env = getenv("PATH"); + if (!path_env) path_env = "/usr/bin:/bin"; + char path_copy[4096]; + strncpy(path_copy, path_env, sizeof(path_copy) - 1); + path_copy[sizeof(path_copy) - 1] = '\0'; + char *saveptr = NULL; + char *token = strtok_r(path_copy, ":", &saveptr); + while (token) { + char candidate[PATH_MAX]; + snprintf(candidate, sizeof(candidate), "%s/%s", token, file); + if (access(candidate, F_OK) == 0) { + return posix_spawn(pid, candidate, file_actions, attrp, argv, envp); + } + token = strtok_r(NULL, ":", &saveptr); + } + const char *standard_paths[] = {"/usr/bin", "/bin", "/usr/sbin", "/sbin", "/usr/local/bin", NULL}; + for (int i = 0; standard_paths[i] != NULL; i++) { + char candidate[PATH_MAX]; + snprintf(candidate, sizeof(candidate), "%s/%s", standard_paths[i], file); + if (access(candidate, F_OK) == 0) { + return posix_spawn(pid, candidate, file_actions, attrp, argv, envp); + } + } + // If not found in PATH or standard paths, return ENOENT without spawning zombie + return ENOENT; +} + +// ---- system(), popen() and pclose() --------------------------------------------------------- +// glibc starts the shell of system() and popen() from inside the C library (its own posix_spawn and +// execve), where the hook's execve() is not called: the kernel ran the machine's /bin/sh, which on +// Android is the system's own shell, and that one failed to link against Ubuntu's libraries +// ("CANNOT LINK EXECUTABLE sh: ...libc.so has bad ELF magic", #49). They start Ubuntu's /bin/sh here. + +extern char **environ; + +static pid_t start_shell(const char *command, int child_fd, int target_fd, const sigset_t *mask, + const struct sigaction *intr, const struct sigaction *quit, int close_popen_streams); + +// While system() waits, SIGINT and SIGQUIT are ignored; with several threads in system() at once, the +// first one in saves the dispositions and the last one out puts them back (as glibc does) +static pthread_mutex_t g_system_lock = PTHREAD_MUTEX_INITIALIZER; +static int g_system_waiting; +static struct sigaction g_system_intr, g_system_quit; + +// system(3) as POSIX describes it: SIGINT and SIGQUIT ignored and SIGCHLD blocked while it waits +int system(const char *command) { + if (!command) return access("/bin/sh", X_OK) == 0; // whether there is a shell (Ubuntu's) + pthread_mutex_lock(&g_system_lock); + if (g_system_waiting++ == 0) { + struct sigaction ignore; + memset(&ignore, 0, sizeof(ignore)); + ignore.sa_handler = SIG_IGN; + sigemptyset(&ignore.sa_mask); + sigaction(SIGINT, &ignore, &g_system_intr); + sigaction(SIGQUIT, &ignore, &g_system_quit); + } + struct sigaction intr = g_system_intr, quit = g_system_quit; + pthread_mutex_unlock(&g_system_lock); + sigset_t block, old; + sigemptyset(&block); + sigaddset(&block, SIGCHLD); + sigprocmask(SIG_BLOCK, &block, &old); + + int status = -1; + pid_t pid = start_shell(command, -1, -1, &old, &intr, &quit, 0); + if (pid > 0) { + while (waitpid(pid, &status, 0) < 0) { + if (errno != EINTR) { + status = -1; + break; + } + } + } + int saved = errno; + pthread_mutex_lock(&g_system_lock); + if (--g_system_waiting == 0) { + sigaction(SIGINT, &g_system_intr, NULL); + sigaction(SIGQUIT, &g_system_quit, NULL); + } + pthread_mutex_unlock(&g_system_lock); + sigprocmask(SIG_SETMASK, &old, NULL); + errno = saved; + return status; +} + +// The streams popen() made, with their shells: pclose() waits for the one of its stream +struct ddnatv_popen { + FILE *fp; + pid_t pid; + struct ddnatv_popen *next; +}; +static struct ddnatv_popen *g_popen_streams; +static pthread_mutex_t g_popen_lock = PTHREAD_MUTEX_INITIALIZER; + +static pid_t start_shell(const char *command, int child_fd, int target_fd, const sigset_t *mask, + const struct sigaction *intr, const struct sigaction *quit, int close_popen_streams) { + pid_t pid = fork(); + if (pid != 0) return pid; + if (intr) sigaction(SIGINT, intr, NULL); + if (quit) sigaction(SIGQUIT, quit, NULL); + if (mask) sigprocmask(SIG_SETMASK, mask, NULL); + if (child_fd >= 0) { + if (child_fd == target_fd) { + fcntl(target_fd, F_SETFD, 0); + } else if (dup2(child_fd, target_fd) < 0) { + _exit(127); + } + } + // POSIX: the streams of earlier popen() calls are not open in the new shell + if (close_popen_streams) { + for (struct ddnatv_popen *p = g_popen_streams; p; p = p->next) { + int fd = fileno(p->fp); + if (fd >= 0 && fd != target_fd) close(fd); + } + } + char *const argv[] = { (char *)"sh", (char *)"-c", (char *)command, NULL }; + ddnatv_execve("/bin/sh", argv, environ, 0); + _exit(127); +} + +FILE *popen(const char *command, const char *type) { + if (!command || !type || (type[0] != 'r' && type[0] != 'w')) { + errno = EINVAL; + return NULL; + } + int reading = type[0] == 'r'; + int keep_on_exec = strchr(type, 'e') == NULL; + int fds[2]; + if (pipe2(fds, O_CLOEXEC) != 0) return NULL; + int parent_end = reading ? fds[0] : fds[1]; + int child_end = reading ? fds[1] : fds[0]; + struct ddnatv_popen *entry = (struct ddnatv_popen *)malloc(sizeof(*entry)); + if (!entry) { + close(fds[0]); + close(fds[1]); + errno = ENOMEM; + return NULL; + } + pthread_mutex_lock(&g_popen_lock); + pid_t pid = start_shell(command, child_end, reading ? STDOUT_FILENO : STDIN_FILENO, NULL, NULL, NULL, 1); + int saved = errno; + close(child_end); + FILE *fp = NULL; + if (pid > 0) { + if (keep_on_exec) fcntl(parent_end, F_SETFD, 0); + fp = fdopen(parent_end, reading ? "r" : "w"); + saved = errno; + } + if (!fp) { + close(parent_end); + pthread_mutex_unlock(&g_popen_lock); + free(entry); + if (pid > 0) { + // A shell nobody will read or write: it is not left to run (or waited for while it does) + kill(pid, SIGKILL); + while (waitpid(pid, NULL, 0) < 0 && errno == EINTR) {} + } + errno = saved; + return NULL; + } + entry->fp = fp; + entry->pid = pid; + entry->next = g_popen_streams; + g_popen_streams = entry; + pthread_mutex_unlock(&g_popen_lock); + return fp; +} + +int pclose(FILE *stream) { + struct ddnatv_popen *found = NULL; + pthread_mutex_lock(&g_popen_lock); + for (struct ddnatv_popen **p = &g_popen_streams; *p; p = &(*p)->next) { + if ((*p)->fp == stream) { + found = *p; + *p = found->next; + break; + } + } + // Closed before the lock is let go: a popen() in between would fork a shell that keeps this pipe open, + // and the shell of this stream would wait for its end of it + if (found) fclose(stream); + pthread_mutex_unlock(&g_popen_lock); + if (!found) { + // Not one of ours: glibc's own + static int (*orig_pclose)(FILE *) = NULL; + if (!orig_pclose) orig_pclose = (int (*)(FILE *))dlsym(RTLD_NEXT, "pclose"); + if (!orig_pclose) { + errno = ECHILD; + return -1; + } + return orig_pclose(stream); + } + pid_t pid = found->pid; + free(found); + int status = -1; + pid_t r; + do { + r = waitpid(pid, &status, 0); + } while (r < 0 && errno == EINTR); + return r < 0 ? -1 : status; +} + +#endif /* !DDNATV_HOST_TEST */ diff --git a/tools/nativeguest/hook/exec_probe.c b/tools/nativeguest/hook/exec_probe.c new file mode 100644 index 0000000000..f877175e58 --- /dev/null +++ b/tools/nativeguest/hook/exec_probe.c @@ -0,0 +1,1027 @@ +// Part of libddnatv-hook.so, included by ddnatv-hook.c (one translation unit, so the +// parts share their static functions and are built with the same command as before). +// +// What execve() and posix_spawn() need to know about a program: its ld.so, whether it is a +// dynamic ELF, a script and its interpreter, and the argument lists built from that. + +// Relative exec paths ("./configure", "bin/tool", "../x.sh") must go through the same +// DDNATV_ROOT routing as absolute ones. Without this they were mistaken for Android host +// binaries and handed to the kernel unchanged, which then resolved "#!/bin/bash" (or a glibc +// PT_INTERP) literally and failed with "bad interpreter: No such file or directory". +// getcwd() is not virtualised, so cwd + path is a real path that starts with DDNATV_ROOT. +static const char *absolutize_exec_path(const char *path, char *buffer, size_t bufsize) { + if (!path || path[0] == '\0' || path[0] == '/') return path; + char cwd[PATH_MAX]; + static char *(*real_getcwd)(char *, size_t) = NULL; + if (!real_getcwd) real_getcwd = (char *(*)(char *, size_t))dlsym(RTLD_NEXT, "getcwd"); + if (!real_getcwd || !real_getcwd(cwd, sizeof(cwd))) return path; + + while (path[0] == '.' && path[1] == '/') { + path += 2; + while (path[0] == '/') path++; + } + if (path[0] == '\0' || strcmp(path, ".") == 0) return path; + + size_t cwd_len = strlen(cwd); + while (cwd_len > 1 && cwd[cwd_len - 1] == '/') cwd[--cwd_len] = '\0'; + int n = snprintf(buffer, bufsize, "%s%s%s", cwd, (cwd_len == 1 && cwd[0] == '/') ? "" : "/", path); + if (n < 0 || (size_t)n >= bufsize) return path; + return buffer; +} + +static char s_cached_ld_so[PATH_MAX] = {0}; +static char s_cached_ld_root[PATH_MAX] = {0}; +static uint16_t s_cached_e_machine = 0; + +// ld.so inside `ddnatv_root` for an ELF with machine type `e_machine` (0 when unknown). +static int find_dynamic_linker_for_machine(const char *ddnatv_root, uint16_t e_machine, char *out_ld_so, size_t max_len) { + if (!ddnatv_root || ddnatv_root[0] == '\0' || !out_ld_so || max_len == 0) return 0; + + if (s_cached_ld_so[0] != '\0' && strcmp(s_cached_ld_root, ddnatv_root) == 0 && + e_machine != 0 && e_machine == s_cached_e_machine) { + ddnatv_copy_cstr(out_ld_so, max_len, s_cached_ld_so); + return 1; + } + + const char *aarch64_cands[] = { + "/usr/lib/aarch64-linux-gnu/ld-linux-aarch64.so.1", + "/usr/lib/aarch64-linux-gnu/ld-2.39.so", + "/lib/ld-linux-aarch64.so.1", + "/lib/aarch64-linux-gnu/ld-linux-aarch64.so.1", + "/usr/lib/ld-linux-aarch64.so.1", + "/usr/lib64/ld-linux-aarch64.so.1", + "/lib64/ld-linux-aarch64.so.1", + "/lib/aarch64-linux-gnu/ld-2.39.so", + NULL + }; + + const char *armhf_cands[] = { + "/usr/lib/arm-linux-gnueabihf/ld-linux-armhf.so.3", + "/usr/lib/arm-linux-gnueabihf/ld-2.39.so", + "/lib/ld-linux-armhf.so.3", + "/lib/arm-linux-gnueabihf/ld-linux-armhf.so.3", + "/usr/lib/ld-linux-armhf.so.3", + "/lib/arm-linux-gnueabihf/ld-2.39.so", + "/usr/lib/arm-linux-gnueabi/ld-linux.so.3", + "/lib/arm-linux-gnueabi/ld-linux.so.3", + NULL + }; + + const char *x86_64_cands[] = { + "/lib64/ld-linux-x86-64.so.2", + "/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2", + "/usr/lib/x86_64-linux-gnu/ld-2.39.so", + "/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2", + NULL + }; + + const char **primary = NULL; + const char **secondary = NULL; + + if (e_machine == 183) { // EM_AARCH64 + primary = aarch64_cands; + secondary = NULL; + } else if (e_machine == 40) { // EM_ARM + primary = armhf_cands; + secondary = NULL; + } else if (e_machine == 62) { // EM_X86_64 + primary = x86_64_cands; + secondary = NULL; + } else if (e_machine == 3) { // EM_386 + primary = NULL; + secondary = NULL; + } else { + #if defined(__aarch64__) + primary = aarch64_cands; + secondary = armhf_cands; + #elif defined(__arm__) + primary = armhf_cands; + secondary = aarch64_cands; + #else + primary = x86_64_cands; + #endif + } + + if (primary) { + for (int i = 0; primary[i] != NULL; i++) { + snprintf(out_ld_so, max_len, "%s%s", ddnatv_root, primary[i]); + if (access(out_ld_so, F_OK) == 0) { + if (e_machine != 0) { + ddnatv_copy_cstr(s_cached_ld_so, sizeof(s_cached_ld_so), out_ld_so); + ddnatv_copy_cstr(s_cached_ld_root, sizeof(s_cached_ld_root), ddnatv_root); + s_cached_e_machine = e_machine; + } + return 1; + } + } + } + if (secondary) { + for (int i = 0; secondary[i] != NULL; i++) { + snprintf(out_ld_so, max_len, "%s%s", ddnatv_root, secondary[i]); + if (access(out_ld_so, F_OK) == 0) { + if (e_machine != 0) { + ddnatv_copy_cstr(s_cached_ld_so, sizeof(s_cached_ld_so), out_ld_so); + ddnatv_copy_cstr(s_cached_ld_root, sizeof(s_cached_ld_root), ddnatv_root); + s_cached_e_machine = e_machine; + } + return 1; + } + } + } + + return 0; +} + +#ifdef DDNATV_HOST_TEST +// Test entry point taking a program instead of its machine type (ddnatv-pty.c, which the tests +// include too, has a find_dynamic_linker of its own). +static int hook_find_dynamic_linker(const char *ddnatv_root, const char *cmd, char *out_ld_so, size_t max_len) { + if (!ddnatv_root || ddnatv_root[0] == '\0' || !out_ld_so || max_len == 0) return 0; + + uint16_t e_machine = 0; + if (cmd && cmd[0] != '\0') { + int fd = open(cmd, O_RDONLY); + if (fd >= 0) { + unsigned char ehdr[20]; + ssize_t n = read(fd, ehdr, sizeof(ehdr)); + close(fd); + if (n >= 20 && ehdr[0] == 0x7f && ehdr[1] == 'E' && ehdr[2] == 'L' && ehdr[3] == 'F') { + e_machine = (uint16_t)(ehdr[18] | (ehdr[19] << 8)); + } + } + } + return find_dynamic_linker_for_machine(ddnatv_root, e_machine, out_ld_so, max_len); +} +#endif + +static int check_elf_dynamic(int fd, const unsigned char *ehdr, ssize_t n) { + if (n < 52 || ehdr[0] != 0x7f || ehdr[1] != 'E' || ehdr[2] != 'L' || ehdr[3] != 'F') { + return 0; + } + if ((ehdr[4] != 1 && ehdr[4] != 2) || ehdr[5] != 1 /* ELFDATA2LSB */) { + return 0; + } + int is_64 = (ehdr[4] == 2); + uint64_t phoff = 0; + uint16_t phentsize = 0; + uint16_t phnum = 0; + if (is_64) { + if (n < 64) return 0; + memcpy(&phoff, ehdr + 32, sizeof(uint64_t)); + memcpy(&phentsize, ehdr + 54, sizeof(uint16_t)); + memcpy(&phnum, ehdr + 56, sizeof(uint16_t)); + } else { + uint32_t phoff32 = 0; + memcpy(&phoff32, ehdr + 28, sizeof(uint32_t)); + phoff = phoff32; + memcpy(&phentsize, ehdr + 42, sizeof(uint16_t)); + memcpy(&phnum, ehdr + 44, sizeof(uint16_t)); + } + uint16_t min_phentsize = is_64 ? 56 : 32; + if (phoff == 0 || phentsize < min_phentsize || phentsize > 4096 || phnum == 0) { + return 0; + } + if ((off_t)phoff < 0 || (uint64_t)(off_t)phoff != phoff) { + return 0; + } + if (lseek(fd, (off_t)phoff, SEEK_SET) < 0) { + return 0; + } + for (int i = 0; i < phnum && i < 128; i++) { + uint32_t p_type = 0; + if (read(fd, &p_type, sizeof(p_type)) != sizeof(p_type)) break; + if (p_type == 3 /* PT_INTERP */) { + return 1; + } + if (lseek(fd, (off_t)(phentsize - sizeof(p_type)), SEEK_CUR) < 0) break; + } + return 0; +} + +// check_elf_dynamic() on the bytes already read: 1 or 0, or -1 when a program header lies past +// the buffer and the file has to be read after all. Program headers normally follow the ELF +// header directly, so this saves the lseek()/read() pairs. +static int elf_interp_in_buffer(const unsigned char *ehdr, ssize_t n) { + if (n < 52 || ehdr[0] != 0x7f || ehdr[1] != 'E' || ehdr[2] != 'L' || ehdr[3] != 'F') { + return 0; + } + if ((ehdr[4] != 1 && ehdr[4] != 2) || ehdr[5] != 1 /* ELFDATA2LSB */) { + return 0; + } + int is_64 = (ehdr[4] == 2); + uint64_t phoff = 0; + uint16_t phentsize = 0; + uint16_t phnum = 0; + if (is_64) { + if (n < 64) return 0; + memcpy(&phoff, ehdr + 32, sizeof(uint64_t)); + memcpy(&phentsize, ehdr + 54, sizeof(uint16_t)); + memcpy(&phnum, ehdr + 56, sizeof(uint16_t)); + } else { + uint32_t phoff32 = 0; + memcpy(&phoff32, ehdr + 28, sizeof(uint32_t)); + phoff = phoff32; + memcpy(&phentsize, ehdr + 42, sizeof(uint16_t)); + memcpy(&phnum, ehdr + 44, sizeof(uint16_t)); + } + uint16_t min_phentsize = is_64 ? 56 : 32; + if (phoff == 0 || phentsize < min_phentsize || phentsize > 4096 || phnum == 0) { + return 0; + } + if ((off_t)phoff < 0 || (uint64_t)(off_t)phoff != phoff) { + return 0; + } + for (int i = 0; i < phnum && i < 128; i++) { + uint64_t off = phoff + (uint64_t)i * phentsize; + if (off > (uint64_t)n || (uint64_t)n - off < sizeof(uint32_t)) return -1; + uint32_t p_type = 0; + memcpy(&p_type, ehdr + off, sizeof(p_type)); + if (p_type == 3 /* PT_INTERP */) { + return 1; + } + } + return 0; +} + +// Whether the interpreter of a 64-bit ELF is Android's own linker (/system/bin/linker64). A Go +// program built with GOOS=android is a PIE that asks for it, so it has a PT_INTERP and looks like a +// dynamic program, but it has no C library and makes its own system calls like every Go program +// (#42). `h` holds the `n` first bytes of the file; the program headers usually are among them. +static int elf_interp_is_android(int fd, const unsigned char *h, ssize_t n) { + if (n < 64 || h[4] != 2) return 0; + uint64_t phoff = 0; + uint16_t phentsize = 0, phnum = 0; + memcpy(&phoff, h + 32, sizeof(phoff)); + memcpy(&phentsize, h + 54, sizeof(phentsize)); + memcpy(&phnum, h + 56, sizeof(phnum)); + if (phoff == 0 || phoff > (1ULL << 40) || phentsize < 56 || phentsize > 4096 || phnum == 0) return 0; + for (int i = 0; i < phnum && i < 128; i++) { + unsigned char e[56]; + uint64_t off = phoff + (uint64_t)i * phentsize; + if (off + sizeof(e) <= (uint64_t)n) { + memcpy(e, h + off, sizeof(e)); + } else if (pread(fd, e, sizeof(e), (off_t)off) != (ssize_t)sizeof(e)) { + return 0; + } + uint32_t p_type = 0; + memcpy(&p_type, e, sizeof(p_type)); + if (p_type != 3 /* PT_INTERP */) continue; + uint64_t p_offset = 0, p_filesz = 0; + memcpy(&p_offset, e + 8, sizeof(p_offset)); + memcpy(&p_filesz, e + 32, sizeof(p_filesz)); + char interp[48]; + size_t want = p_filesz < sizeof(interp) - 1 ? (size_t)p_filesz : sizeof(interp) - 1; + if (want == 0 || p_offset > (1ULL << 40)) return 0; + ssize_t got = pread(fd, interp, want, (off_t)p_offset); + if (got <= 0) return 0; + interp[got] = '\0'; + return strncmp(interp, "/system/bin/linker", 18) == 0; + } + return 0; +} + +// The kernel follows at most four nested "#!" interpreters, then fails with ELOOP. +#define DDNATV_MAX_SHEBANG_DEPTH 4 + +// What execve()/posix_spawn() need to know about the file they are about to start, from a +// single open()/read() (they used to open it up to three times). +struct exec_probe { + char hdr[256]; // first bytes of the file, NUL-terminated for "#!" parsing + ssize_t n; // bytes read; -1 when the file could not be opened + int is_elf; + int is_dynamic; // ELF with PT_INTERP: has to be started through ld.so + int android_interp; // AArch64 ELF whose PT_INTERP is Android's linker (a Go program for GOOS=android) + uint16_t e_machine; + mode_t mode; // st_mode, filled in for dynamic ELF files only + int runpath_is_rpath; // runpath holds a DT_RPATH (searched before LD_LIBRARY_PATH), not a DT_RUNPATH + char runpath[1024]; // DT_RUNPATH (else DT_RPATH) of a dynamic ELF as written in it, or "" +}; + +// The DT_RUNPATH of a dynamic ELF (its DT_RPATH when it has none, as ld.so does) into `out`, as +// written in the file. ld.so looks for the program's libraries there, but it opens those +// directories itself, without the hook: an absolute one such as /usr/lib/aarch64-linux-gnu/android +// (Ubuntu's adb and fastboot keep their own libbase, liblog, libssl... there) is looked for in +// Android's tree and the program does not start. The exec adds the rootfs copies to the +// --library-path it gives ld.so (build_ld_library_path). Returns 1 for a DT_RUNPATH, 2 for a +// DT_RPATH, 0 when there is neither. The headers are read in pieces, so that their number does +// not matter; a list longer than `out` keeps its first whole entries (ld.so still has the rest). +static int elf_read_dynamic(int fd, const unsigned char *h, ssize_t n, char *out, size_t outsz, + char *needed, size_t needed_size, int *needed_count); + +static int elf_read_runpath(int fd, const unsigned char *h, ssize_t n, char *out, size_t outsz) { + return elf_read_dynamic(fd, h, n, out, outsz, NULL, 0, NULL); +} + +// elf_read_runpath(), and with `needed` the DT_NEEDED names too: one after the other, each ended by a +// NUL, their number in *needed_count (as many as fit). +#define ELF_MAX_NEEDED 128 +static int elf_read_dynamic(int fd, const unsigned char *h, ssize_t n, char *out, size_t outsz, + char *needed, size_t needed_size, int *needed_count) { + if (needed_count) *needed_count = 0; + if (!out || outsz < 2) return 0; + out[0] = '\0'; + if (n < 52 || h[0] != 0x7f || h[1] != 'E' || h[2] != 'L' || h[3] != 'F' || h[5] != 1 /* LSB */) return 0; + int is_64 = (h[4] == 2); + if (!is_64 && h[4] != 1) return 0; + if (is_64 && n < 64) return 0; + uint64_t phoff = 0; + uint16_t phentsize = 0, phnum = 0; + if (is_64) { + memcpy(&phoff, h + 32, 8); + memcpy(&phentsize, h + 54, 2); + memcpy(&phnum, h + 56, 2); + } else { + uint32_t off32 = 0; + memcpy(&off32, h + 28, 4); + phoff = off32; + memcpy(&phentsize, h + 42, 2); + memcpy(&phnum, h + 44, 2); + } + size_t ph_size = is_64 ? 56 : 32; + if (phoff == 0 || phoff > (1ULL << 40) || phentsize < ph_size || phentsize > 1024 || phnum == 0) return 0; + + // PT_DYNAMIC, and the PT_LOAD segments that map an address of the file to its offset + unsigned char buf[2048]; + uint64_t dyn_off = 0, dyn_size = 0; + uint64_t load_vaddr[16], load_off[16], load_size[16]; + int loads = 0; + size_t per_read = sizeof(buf) / phentsize; + for (size_t first = 0; first < phnum; first += per_read) { + size_t count = phnum - first < per_read ? phnum - first : per_read; + size_t bytes = count * phentsize; + if (pread(fd, buf, bytes, (off_t)(phoff + first * phentsize)) != (ssize_t)bytes) return 0; + for (size_t i = 0; i < count; i++) { + const unsigned char *e = buf + i * phentsize; + uint32_t type = 0; + memcpy(&type, e, 4); + uint64_t off = 0, vaddr = 0, filesz = 0; + if (is_64) { + memcpy(&off, e + 8, 8); + memcpy(&vaddr, e + 16, 8); + memcpy(&filesz, e + 32, 8); + } else { + uint32_t v = 0; + memcpy(&v, e + 4, 4); off = v; + memcpy(&v, e + 8, 4); vaddr = v; + memcpy(&v, e + 16, 4); filesz = v; + } + if (type == 2 /* PT_DYNAMIC */) { + dyn_off = off; + dyn_size = filesz; + } else if (type == 1 /* PT_LOAD */ && loads < 16) { + load_vaddr[loads] = vaddr; + load_off[loads] = off; + load_size[loads] = filesz; + loads++; + } + } + } + if (dyn_size == 0 || dyn_off > (1ULL << 40)) return 0; + if (dyn_size > (1u << 20)) dyn_size = 1u << 20; + + size_t ent = is_64 ? 16 : 8; + uint64_t strtab = 0, runpath = 0, rpath = 0; + int has_strtab = 0, has_runpath = 0, has_rpath = 0, done = 0; + uint64_t needed_at[ELF_MAX_NEEDED]; + int nneeded = 0; + for (uint64_t at = 0; at + ent <= dyn_size && !done;) { + size_t want = dyn_size - at < sizeof(buf) ? (size_t)(dyn_size - at) : sizeof(buf); + want -= want % ent; + ssize_t got = pread(fd, buf, want, (off_t)(dyn_off + at)); + if (got < (ssize_t)ent) break; + for (size_t i = 0; i + ent <= (size_t)got; i += ent) { + int64_t tag = 0; + uint64_t val = 0; + if (is_64) { + memcpy(&tag, buf + i, 8); + memcpy(&val, buf + i + 8, 8); + } else { + int32_t tv = 0; + uint32_t vv = 0; + memcpy(&tv, buf + i, 4); + memcpy(&vv, buf + i + 4, 4); + tag = tv; + val = vv; + } + if (tag == 0 /* DT_NULL */) { done = 1; break; } + if (tag == 5 /* DT_STRTAB */) { strtab = val; has_strtab = 1; } + else if (tag == 29 /* DT_RUNPATH */) { runpath = val; has_runpath = 1; } + else if (tag == 15 /* DT_RPATH */) { rpath = val; has_rpath = 1; } + else if (tag == 1 /* DT_NEEDED */ && needed && nneeded < ELF_MAX_NEEDED) needed_at[nneeded++] = val; + } + at += (uint64_t)got - (uint64_t)got % ent; + } + if (!has_strtab || (!has_runpath && !has_rpath)) return 0; + uint64_t str_index = has_runpath ? runpath : rpath; + + // DT_STRTAB is an address: the file offset is that of the PT_LOAD segment holding it + uint64_t strtab_off = 0; + int mapped = 0; + for (int i = 0; i < loads; i++) { + if (strtab >= load_vaddr[i] && strtab - load_vaddr[i] < load_size[i]) { + strtab_off = load_off[i] + (strtab - load_vaddr[i]); + mapped = 1; + break; + } + } + if (!mapped || str_index > (1ULL << 32)) return 0; + if (needed && needed_count && needed_size > 0) { + size_t used = 0; + for (int i = 0; i < nneeded; i++) { + char name[256]; + ssize_t got = pread(fd, name, sizeof(name) - 1, (off_t)(strtab_off + needed_at[i])); + if (got <= 0) continue; + name[got] = '\0'; + size_t len = strnlen(name, (size_t)got); + if (len == 0 || len == (size_t)got || used + len + 1 > needed_size) continue; + memcpy(needed + used, name, len + 1); + used += len + 1; + (*needed_count)++; + } + } + ssize_t len = pread(fd, out, outsz - 1, (off_t)(strtab_off + str_index)); + if (len <= 0) { + out[0] = '\0'; + return 0; + } + out[len] = '\0'; + if (strnlen(out, (size_t)len) == (size_t)len) { + // Longer than `out`: its whole entries up to there + char *last = strrchr(out, ':'); + if (!last) { + out[0] = '\0'; + return 0; + } + *last = '\0'; + } + if (out[0] == '\0') return 0; + return has_runpath ? 1 : 2; +} + +// Appends dir[0..len) to the ':'-separated out_buf[0..used) unless it is there already. +static size_t append_lib_dir(char *out_buf, size_t out_size, size_t used, const char *dir, size_t len) { + if (len == 0 || lib_dir_list_has(out_buf, dir, len)) return used; + size_t need = (used > 0 ? 1 : 0) + len; + if (used + need >= out_size) return used; + if (used > 0) out_buf[used++] = ':'; + memcpy(out_buf + used, dir, len); + used += len; + out_buf[used] = '\0'; + return used; +} + +// The directories of `runpath` (a DT_RUNPATH or DT_RPATH), in their order, appended to +// out_buf[0..used): the absolute ones that lie in the rootfs mapped into it, and those that start +// with $ORIGIN with it replaced by the directory of `exe` (the program's real path, in the rootfs +// already), so that both keep their places. ld.so opens them itself, without the hook, so +// /usr/lib/aarch64-linux-gnu/android would be looked for in Android's tree. Others ($LIB, +// $PLATFORM, directories outside the rootfs) are left to ld.so. Returns the new length. +static size_t append_runpath_dirs(char *out_buf, size_t out_size, size_t used, const char *runpath, const char *exe) { + size_t origin_len = 0; + if (exe) { + const char *slash = strrchr(exe, '/'); + if (slash) origin_len = slash > exe ? (size_t)(slash - exe) : 1; + } + for (const char *p = runpath; p && *p;) { + const char *end = strchr(p, ':'); + size_t len = end ? (size_t)(end - p) : strlen(p); + if (len > 0 && len < PATH_MAX) { + char tok[PATH_MAX]; + memcpy(tok, p, len); + tok[len] = '\0'; + size_t skip = 0; + if (strncmp(tok, "$ORIGIN", 7) == 0) skip = 7; + else if (strncmp(tok, "${ORIGIN}", 9) == 0) skip = 9; + if (skip && (tok[skip] == '\0' || tok[skip] == '/') && origin_len > 0 && !strchr(tok + skip, '$')) { + char full[PATH_MAX]; + size_t rest = len - skip; + if (origin_len + rest < sizeof(full)) { + memcpy(full, exe, origin_len); + memcpy(full + origin_len, tok + skip, rest); + full[origin_len + rest] = '\0'; + used = append_lib_dir(out_buf, out_size, used, full, origin_len + rest); + } + } else if (tok[0] == '/' && len > 1 && !strchr(tok, '$')) { + char rw_buf[PATH_MAX]; + const char *rw = rewrite_path_in_root(tok, rw_buf, sizeof(rw_buf)); + if (strcmp(rw, tok) != 0) used = append_lib_dir(out_buf, out_size, used, rw, strlen(rw)); + } + } + if (!end) break; + p = end + 1; + } + return used; +} + +// Whether dir[0..len) is one of the rootfs library directories The native userland adds itself (also what its +// shells export in LD_LIBRARY_PATH). +static int is_rootfs_default_lib_dir(const char *dir, size_t len) { + if (len <= g_ddnatv_root_len || memcmp(dir, g_ddnatv_root, g_ddnatv_root_len) != 0) return 0; + const char *rel = dir + g_ddnatv_root_len; + size_t rel_len = len - g_ddnatv_root_len; + for (size_t i = 0; i < sizeof(k_rootfs_lib_dirs) / sizeof(k_rootfs_lib_dirs[0]); i++) { + if (strlen(k_rootfs_lib_dirs[i]) == rel_len && memcmp(k_rootfs_lib_dirs[i], rel, rel_len) == 0) return 1; + } + return 0; +} + +// Where the program is among the arguments of ld.so started directly (ldd runs "ld.so PROGRAM" with +// LD_TRACE_LOADED_OBJECTS set; "ld.so --list PROGRAM" and "ld.so --verify PROGRAM" are the same): its +// index, or -1 when there is none; *has_library_path says whether the caller gives --library-path itself. +static int ldso_program_index(char *const argv[], int *has_library_path) { + if (has_library_path) *has_library_path = 0; + if (!argv || !argv[0]) return -1; + static const char *const with_value[] = { "--library-path", "--preload", "--argv0", "--inhibit-rpath", "--audit", + "--glibc-hwcaps-prepend", "--glibc-hwcaps-mask" }; + for (int i = 1; argv[i]; i++) { + const char *a = argv[i]; + if (strcmp(a, "--library-path") == 0 && has_library_path) *has_library_path = 1; + if (a[0] != '-' || a[1] != '-') return i; + if (a[2] == '\0') return argv[i + 1] ? i + 1 : -1; + int takes_value = 0; + for (size_t k = 0; k < sizeof(with_value) / sizeof(with_value[0]); k++) { + if (strcmp(a, with_value[k]) == 0) takes_value = 1; + } + if (takes_value) { + if (!argv[i + 1]) return -1; + i++; + } + } + return -1; +} + +// ---- dlopen() of a library with a RUNPATH --------------------------------------------------- +// A library that a program loads with dlopen() looks for its own dependencies in its RUNPATH, which ld.so +// opens without the hook: PulseAudio's modules (RUNPATH /usr/lib/aarch64-linux-gnu/pulseaudio) and many +// plugins did not load. Before the real dlopen(), the dependencies found in the rootfs copies of those +// directories are loaded by their full path, depth first; ld.so then finds them loaded, by their name. +#define DLOPEN_PRELOAD_DEPTH 6 + +static int dlopen_preload_deps(const char *path, void *(*orig_dlopen)(const char *, int), int depth) { + if (depth > DLOPEN_PRELOAD_DEPTH || !path || path[0] != '/') return 0; + int fd = (int)syscall(SYS_openat, AT_FDCWD, path, O_RDONLY | O_CLOEXEC); + if (fd < 0) return 0; + unsigned char hdr[64]; + ssize_t n = pread(fd, hdr, sizeof(hdr), 0); + char runpath[1024]; + char needed[4096]; + int count = 0; + int kind = n > 0 ? elf_read_dynamic(fd, hdr, n, runpath, sizeof(runpath), needed, sizeof(needed), &count) : 0; + syscall(SYS_close, fd); + if (!kind || count == 0) return 0; + // the RUNPATH's directories, mapped into the rootfs ($ORIGIN from this library's own place) + char dirs[PATH_MAX * 2]; + dirs[0] = '\0'; + size_t used = append_runpath_dirs(dirs, sizeof(dirs), 0, runpath, path); + if (used == 0) return 0; + int loaded = 0; + const char *name = needed; + for (int i = 0; i < count; i++, name += strlen(name) + 1) { + if (strchr(name, '/')) continue; + void *already = orig_dlopen(name, RTLD_LAZY | RTLD_NOLOAD); + if (already) { + dlclose(already); + continue; + } + for (const char *p = dirs; *p;) { + const char *end = strchr(p, ':'); + size_t len = end ? (size_t)(end - p) : strlen(p); + char candidate[PATH_MAX]; + if (len + 1 + strlen(name) < sizeof(candidate)) { + memcpy(candidate, p, len); + candidate[len] = '/'; + strcpy(candidate + len + 1, name); + int probe_fd = (int)syscall(SYS_openat, AT_FDCWD, candidate, O_PATH | O_CLOEXEC); + if (probe_fd >= 0) { + syscall(SYS_close, probe_fd); + dlopen_preload_deps(candidate, orig_dlopen, depth + 1); + if (orig_dlopen(candidate, RTLD_LAZY | RTLD_LOCAL)) loaded++; + break; + } + } + if (!end) break; + p = end + 1; + } + } + return loaded; +} + +// ---- /etc/ld.so.conf ------------------------------------------------------------------------- +// The library directories of /etc/ld.so.conf and the files it includes (/etc/ld.so.conf.d/*.conf), +// mapped into the rootfs. On Linux, ldconfig turns them into /etc/ld.so.cache, which ld.so reads. +// Here ld.so would read Android's /etc/ld.so.cache, and the paths in the cache are not mapped into +// the rootfs either, so the exec hands the directories to ld.so in --library-path instead. They are +// read again only when /etc/ld.so.conf, /etc/ld.so.conf.d or /etc/ld.so.cache changes: a .conf file +// added or removed counts at once, an edit of one after ldconfig, as on Linux. +#define LDCONF_MAX_DEPTH 4 +#define LDCONF_MAX_INCLUDES 64 + +struct ldconf_sig { + int64_t t[6]; // mtimes (seconds, nanoseconds) of ld.so.conf, ld.so.conf.d and ld.so.cache; 0 if missing +}; + +static struct { + int valid; + struct ldconf_sig sig; + char root[PATH_MAX]; + char dirs[PATH_MAX * 2]; +} g_ldconf; +static pthread_mutex_t g_ldconf_lock = PTHREAD_MUTEX_INITIALIZER; + +// fstatat() behind the hook's stat emulation (which would map the hard link table in a child that is +// about to exec): only the times are wanted. +static int ldconf_stat_time(const char *real, int64_t *sec, int64_t *nsec) { + static int (*f)(int, const char *, struct stat64 *, int) = NULL; + int (*fn)(int, const char *, struct stat64 *, int) = __atomic_load_n(&f, __ATOMIC_RELAXED); + if (!fn) { + fn = (int (*)(int, const char *, struct stat64 *, int))dlsym(RTLD_NEXT, "fstatat64"); + if (!fn) return -1; + __atomic_store_n(&f, fn, __ATOMIC_RELAXED); + } + struct stat64 st; + if (fn(AT_FDCWD, real, &st, 0) != 0) return -1; + *sec = (int64_t)st.st_mtim.tv_sec; + *nsec = (int64_t)st.st_mtim.tv_nsec; + return 0; +} + +static void ldconf_signature(struct ldconf_sig *sig) { + static const char *const files[3] = { "/etc/ld.so.conf", "/etc/ld.so.conf.d", "/etc/ld.so.cache" }; + for (int i = 0; i < 3; i++) { + char path[PATH_MAX]; + size_t n = ddnatv_append(path, sizeof(path), 0, g_ddnatv_root, g_ddnatv_root_len); + ddnatv_append(path, sizeof(path), n, files[i], strlen(files[i])); + if (ldconf_stat_time(path, &sig->t[i * 2], &sig->t[i * 2 + 1]) != 0) { + sig->t[i * 2] = 0; + sig->t[i * 2 + 1] = 0; + } + } +} + +// The whole of the rootfs file `logical` (an absolute path inside Ubuntu) into buf, NUL-terminated. +static ssize_t ldconf_read(const char *logical, char *buf, size_t bufsz) { + char rw_buf[PATH_MAX]; + const char *real = rewrite_path_in_root(logical, rw_buf, sizeof(rw_buf)); + int fd = (int)syscall(SYS_openat, AT_FDCWD, real, O_RDONLY | O_CLOEXEC); + if (fd < 0) return -1; + size_t got = 0; + while (got + 1 < bufsz) { + ssize_t n = (ssize_t)syscall(SYS_read, fd, buf + got, bufsz - 1 - got); + if (n <= 0) break; + got += (size_t)n; + } + syscall(SYS_close, fd); + buf[got] = '\0'; + return (ssize_t)got; +} + +static int ldconf_name_cmp(const void *a, const void *b) { + return strcmp(*(const char *const *)a, *(const char *const *)b); +} + +static void ldconf_parse_file(const char *logical, char *out, size_t outsz, size_t *used, int depth, int *includes); + +// include PATTERN: the files of one directory that match a shell pattern, in name order (as glob()). +// Patterns in the directory part are not supported (Ubuntu uses /etc/ld.so.conf.d/*.conf). +static void ldconf_include(const char *pattern, char *out, size_t outsz, size_t *used, int depth, int *includes) { + const char *slash = strrchr(pattern, '/'); + if (!slash || slash == pattern) return; + size_t dir_len = (size_t)(slash - pattern); + if (dir_len >= PATH_MAX || memchr(pattern, '*', dir_len) || memchr(pattern, '?', dir_len) || memchr(pattern, '[', dir_len)) return; + char dir[PATH_MAX]; + memcpy(dir, pattern, dir_len); + dir[dir_len] = '\0'; + const char *name_pattern = slash + 1; + if (!strpbrk(name_pattern, "*?[")) { + ldconf_parse_file(pattern, out, outsz, used, depth + 1, includes); + return; + } + char rw_buf[PATH_MAX]; + const char *real = rewrite_path_in_root(dir, rw_buf, sizeof(rw_buf)); + int fd = (int)syscall(SYS_openat, AT_FDCWD, real, O_RDONLY | O_DIRECTORY | O_CLOEXEC); + if (fd < 0) return; + char names_buf[4096]; + char *names[LDCONF_MAX_INCLUDES]; + int count = 0; + size_t names_used = 0; + char dents[4096]; + for (;;) { + long n = syscall(SYS_getdents64, fd, dents, sizeof(dents)); + if (n <= 0) break; + for (long at = 0; at < n;) { + unsigned short reclen; + memcpy(&reclen, dents + at + 16, sizeof(reclen)); + const char *name = dents + at + 19; + if (reclen == 0) break; + size_t len = strnlen(name, (size_t)reclen - 19); + if (count < LDCONF_MAX_INCLUDES && names_used + len + 1 <= sizeof(names_buf) && + fnmatch(name_pattern, name, FNM_PERIOD) == 0) { + memcpy(names_buf + names_used, name, len + 1); + names[count++] = names_buf + names_used; + names_used += len + 1; + } + at += reclen; + } + } + syscall(SYS_close, fd); + qsort(names, (size_t)count, sizeof(names[0]), ldconf_name_cmp); + for (int i = 0; i < count; i++) { + char file[PATH_MAX]; + if (dir_len + 1 + strlen(names[i]) >= sizeof(file)) continue; + snprintf(file, sizeof(file), "%s/%s", dir, names[i]); + ldconf_parse_file(file, out, outsz, used, depth + 1, includes); + } +} + +// One ld.so.conf-style file: a directory per line, "include PATTERN..." (relative to the file's own +// directory), "#" comments, and the old "hwcap" lines, which are skipped as glibc does. +static void ldconf_parse_file(const char *logical, char *out, size_t outsz, size_t *used, int depth, int *includes) { + if (depth > LDCONF_MAX_DEPTH || ++*includes > LDCONF_MAX_INCLUDES) return; + char text[8192]; + if (ldconf_read(logical, text, sizeof(text)) < 0) return; + for (char *line = text; line && *line;) { + char *next = strchr(line, '\n'); + if (next) *next++ = '\0'; + char *hash = strchr(line, '#'); + if (hash) *hash = '\0'; + while (*line == ' ' || *line == '\t' || *line == '\r') line++; + size_t len = strlen(line); + while (len > 0 && (line[len - 1] == ' ' || line[len - 1] == '\t' || line[len - 1] == '\r')) line[--len] = '\0'; + if (len == 0) { + line = next; + continue; + } + if (strncmp(line, "include", 7) == 0 && (line[7] == ' ' || line[7] == '\t')) { + for (char *p = line + 8; *p;) { + while (*p == ' ' || *p == '\t') p++; + if (!*p) break; + char *end = p; + while (*end && *end != ' ' && *end != '\t') end++; + char saved = *end; + *end = '\0'; + char pattern[PATH_MAX]; + if (p[0] == '/') { + snprintf(pattern, sizeof(pattern), "%s", p); + } else { + const char *slash = strrchr(logical, '/'); + int base = slash ? (int)(slash - logical) : 0; + snprintf(pattern, sizeof(pattern), "%.*s/%s", base, logical, p); + } + ldconf_include(pattern, out, outsz, used, depth, includes); + *end = saved; + p = end; + } + } else if (strncmp(line, "hwcap", 5) == 0 && (line[5] == ' ' || line[5] == '\t')) { + // ignored by ldconfig since glibc 2.37 + } else if (line[0] == '/') { + // "DIR" or the old "DIR=TYPE" / "DIR TYPE" + size_t dlen = strcspn(line, "= \t"); + while (dlen > 1 && line[dlen - 1] == '/') dlen--; + if (dlen > 0 && dlen < PATH_MAX) { + char dir[PATH_MAX]; + memcpy(dir, line, dlen); + dir[dlen] = '\0'; + char rw_buf[PATH_MAX]; + const char *rw = rewrite_path_in_root(dir, rw_buf, sizeof(rw_buf)); + if (strcmp(rw, dir) != 0) *used = append_lib_dir(out, outsz, *used, rw, strlen(rw)); + } + } + line = next; + } +} + +static void ldconf_parse(char *out, size_t outsz) { + out[0] = '\0'; + size_t used = 0; + int includes = 0; + ldconf_parse_file("/etc/ld.so.conf", out, outsz, &used, 0, &includes); +} + +// The ld.so.conf directories into out (':'-separated, "" when there are none). Uses the copy of an +// earlier call while the files have not changed: the parent finds it when it first forks, and its +// children only compare the three times. Never waits for the lock: a child forked while another +// thread held it reads the files itself. +static void ldconf_dirs(char *out, size_t outsz) { + if (!out || outsz == 0) return; + out[0] = '\0'; + if (g_ddnatv_root[0] == '\0') return; + struct ldconf_sig sig; + ldconf_signature(&sig); + if (sig.t[0] == 0 && sig.t[1] == 0) return; // neither ld.so.conf nor ld.so.conf.d + if (pthread_mutex_trylock(&g_ldconf_lock) != 0) { + ldconf_parse(out, outsz); + return; + } + if (!g_ldconf.valid || memcmp(&g_ldconf.sig, &sig, sizeof(sig)) != 0 || strcmp(g_ldconf.root, g_ddnatv_root) != 0) { + ldconf_parse(g_ldconf.dirs, sizeof(g_ldconf.dirs)); + g_ldconf.sig = sig; + snprintf(g_ldconf.root, sizeof(g_ldconf.root), "%s", g_ddnatv_root); + g_ldconf.valid = 1; + } + snprintf(out, outsz, "%s", g_ldconf.dirs); + pthread_mutex_unlock(&g_ldconf_lock); +} + +// The --library-path ld.so is given for the rootfs program `exe`, in the order ld.so searches on +// Linux: the program's RPATH, the caller's LD_LIBRARY_PATH (the rootfs paths in it mapped), its +// RUNPATH, the directories of /etc/ld.so.conf (ld.so's cache), and the rootfs defaults last. The native userland's +// shells export the defaults in LD_LIBRARY_PATH too, where Linux has none; when there is anything to +// put before them they move to the end, so that a library the program keeps for itself wins over +// one of the same name in /usr/lib. Runs after the hook's setup, so the +// rewrites are those of rewrite_path(). +static void build_ld_library_path(char *const envp[], const char *runpath, int is_rpath, const char *exe, + char *out_buf, size_t out_size) { + if (!out_buf || out_size == 0) return; + out_buf[0] = '\0'; + + const char *caller_ld = NULL; + if (envp) { + for (int i = 0; envp[i] != NULL; i++) { + if (envp[i][0] == 'L' && strncmp(envp[i], "LD_LIBRARY_PATH=", 16) == 0) { + caller_ld = envp[i] + 16; + break; + } + } + } + if (!caller_ld) { + caller_ld = getenv("LD_LIBRARY_PATH"); + } + int has_runpath = runpath && runpath[0]; + char conf[PATH_MAX * 2]; + ldconf_dirs(conf, sizeof(conf)); + // The rootfs defaults that The native userland's shells export in LD_LIBRARY_PATH go to the end, after the + // program's and ld.so.conf's own directories, as on Linux (where LD_LIBRARY_PATH has none of them) + int move_defaults = has_runpath || conf[0] != '\0'; + + size_t used = 0; + if (has_runpath && is_rpath) used = append_runpath_dirs(out_buf, out_size, used, runpath, exe); + + // The caller's directories (those inside the rootfs rewritten), written straight into out_buf: + // this runs in nearly every child a shell forks, where two 8 KB copies of the list on the stack + // were pages more to copy before the exec. + size_t cap = used + PATH_MAX * 2 < out_size ? used + PATH_MAX * 2 : out_size; // the caller's part, as before + for (const char *p = caller_ld; p && *p;) { + const char *end = strchr(p, ':'); + size_t len = end ? (size_t)(end - p) : strlen(p); + if (len > 0 && len < PATH_MAX) { + char tok[PATH_MAX]; + memcpy(tok, p, len); + tok[len] = '\0'; + char rw_buf[PATH_MAX]; + const char *rw = (tok[0] == '/') ? rewrite_path_in_root(tok, rw_buf, sizeof(rw_buf)) : tok; + size_t rw_len = strlen(rw); + size_t need = (used > 0 ? 1 : 0) + rw_len; + if (move_defaults && is_rootfs_default_lib_dir(rw, rw_len)) { + // after the program's own directories, with the other defaults + } else if (used + need < cap) { + if (used > 0) out_buf[used++] = ':'; + memcpy(out_buf + used, rw, rw_len); + used += rw_len; + out_buf[used] = '\0'; + } + } + if (!end) break; + p = end + 1; + } + if (has_runpath && !is_rpath) used = append_runpath_dirs(out_buf, out_size, used, runpath, exe); + // ld.so.conf, as ld.so's cache: after LD_LIBRARY_PATH and RUNPATH, before the default directories + for (const char *p = conf; *p;) { + const char *end = strchr(p, ':'); + size_t len = end ? (size_t)(end - p) : strlen(p); + used = append_lib_dir(out_buf, out_size, used, p, len); + if (!end) break; + p = end + 1; + } + append_rootfs_lib_dirs_missing_from(out_buf, out_size, used, used > 0, out_buf); +} + +// fstat() without the hook's stat emulation: the probe wants the mode bits only, and the +// emulation would map the hard link table and look up the app's ids in a child that is about to +// exec (new pages there, each a copy-on-write fault). Resolved by prepare_exec_in_parent() when the +// process forks, so that its children find it set. +static int (*g_probe_fstat)(int, struct stat *) = NULL; + +static int probe_fstat(int fd, struct stat *st) { + int (*f)(int, struct stat *) = __atomic_load_n(&g_probe_fstat, __ATOMIC_RELAXED); + if (!f) { + f = (int (*)(int, struct stat *))dlsym(RTLD_NEXT, "fstat"); + if (!f) return fstat(fd, st); + __atomic_store_n(&g_probe_fstat, f, __ATOMIC_RELAXED); + } + return f(fd, st); +} + +static void probe_exec_file(const char *path, struct exec_probe *p) { + p->hdr[0] = '\0'; + p->n = -1; + p->is_elf = 0; + p->is_dynamic = 0; + p->android_interp = 0; + p->e_machine = 0; + p->mode = 0; + p->runpath[0] = '\0'; + p->runpath_is_rpath = 0; + if (!path || path[0] == '\0') return; + int fd = open(path, O_RDONLY | O_CLOEXEC); + if (fd < 0) return; + ssize_t n = read(fd, p->hdr, sizeof(p->hdr) - 1); + p->n = n; + p->hdr[n > 0 ? n : 0] = '\0'; + const unsigned char *h = (const unsigned char *)p->hdr; + if (n >= 4 && h[0] == 0x7f && h[1] == 'E' && h[2] == 'L' && h[3] == 'F') { + p->is_elf = 1; + if (n >= 20) p->e_machine = (uint16_t)(h[18] | (h[19] << 8)); + int dynamic = elf_interp_in_buffer(h, n); + if (dynamic < 0) dynamic = check_elf_dynamic(fd, h, n); + p->is_dynamic = dynamic; + if (dynamic && p->e_machine == 183 /* EM_AARCH64 */) p->android_interp = elf_interp_is_android(fd, h, n); + if (dynamic && !p->android_interp) p->runpath_is_rpath = elf_read_runpath(fd, h, n, p->runpath, sizeof(p->runpath)) == 2; + struct stat st; + if (dynamic && probe_fstat(fd, &st) == 0) p->mode = st.st_mode; + } + close(fd); +} + +static int is_ld_linux(const char *path) { + if (!path) return 0; + const char *base = strrchr(path, '/'); + base = base ? base + 1 : path; + return (strncmp(base, "ld-linux", 8) == 0 || strncmp(base, "ld-2.", 5) == 0); +} + +// Splits a "#!" line (NUL-terminated `hdr`, modified in place) into the interpreter and its +// optional argument, the way execve() always has. +static void parse_shebang(char *hdr, char **interp, char **interp_arg) { + char *newline = strchr(hdr, '\n'); + if (newline) *newline = '\0'; + char *p = hdr + 2; + while (*p == ' ' || *p == '\t') p++; + char *arg = strchr(p, ' '); + if (arg) { + *arg = '\0'; + arg++; + while (*arg == ' ' || *arg == '\t') arg++; + } + *interp = p; + *interp_arg = arg; +} + +// Interpreters outside the rootfs (Android's /system/bin/sh) run with Android's environment. +static int is_host_interpreter(const char *interp) { + return strncmp(interp, "/system", 7) == 0 || + (g_ddnatv_root[0] != '\0' && strncmp(interp, g_ddnatv_root, g_ddnatv_root_len) != 0); +} + +// argv for running `script` with its interpreter: interp [arg] script args... (the script's own +// argv[0] is dropped, as the kernel does). free() the result. +static char **build_script_argv(const char *interp, const char *interp_arg, const char *script, char *const argv[]) { + int argc = 0; + while (argv && argv[argc]) argc++; + int has_arg = (interp_arg && *interp_arg) ? 1 : 0; + char **v = (char **)calloc(argc + has_arg + 3, sizeof(char *)); + if (!v) return NULL; + int n = 0; + v[n++] = (char *)interp; + if (has_arg) v[n++] = (char *)interp_arg; + v[n++] = (char *)script; + for (int i = 1; i < argc; i++) v[n++] = argv[i]; + v[n] = NULL; + return v; +} + +// argv for "ld.so [--preload hook] --library-path dirs --argv0 name program args...". +// free() the result; the strings stay owned by the caller. +static char **build_ldso_argv(const char *ld_so, const char *hook, const char *lib_path, + const char *program, const char *prog_name, char *const argv[]) { + int argc = 0; + while (argv && argv[argc]) argc++; + char **v = (char **)calloc(argc + 16, sizeof(char *)); + if (!v) return NULL; + int n = 0; + v[n++] = (char *)ld_so; + if (hook) { + v[n++] = (char *)"--preload"; + v[n++] = (char *)hook; + } + v[n++] = (char *)"--library-path"; + v[n++] = (char *)lib_path; + v[n++] = (char *)"--argv0"; + v[n++] = (char *)((argc > 0 && argv[0]) ? argv[0] : prog_name); + v[n++] = (char *)program; + for (int i = 1; i < argc; i++) v[n++] = argv[i]; + v[n] = NULL; + return v; +} + +// POSIX_SPAWN_RESETIDS makes glibc's spawn child call setresuid() and setresgid() after it has reset +// every signal handler to its default, which includes the SIGSYS handler that emulates the calls +// Android's seccomp filter blocks, so the child died of SIGSYS (GNU make asks for the flag on every +// command it starts). The native userland shows one fixed user id and never runs set-user-id programs: there is +// no id to reset, so the flag is left out and everything else is passed on. +static const posix_spawnattr_t *spawn_attr_for_android(const posix_spawnattr_t *attrp, posix_spawnattr_t *copy) { + short flags = 0; + if (!attrp || posix_spawnattr_getflags(attrp, &flags) != 0 || !(flags & POSIX_SPAWN_RESETIDS)) return attrp; + memcpy(copy, attrp, sizeof(*copy)); + posix_spawnattr_setflags(copy, (short)(flags & ~POSIX_SPAWN_RESETIDS)); + return copy; +} diff --git a/tools/nativeguest/hook/fileops.c b/tools/nativeguest/hook/fileops.c new file mode 100644 index 0000000000..9ee7976505 --- /dev/null +++ b/tools/nativeguest/hook/fileops.c @@ -0,0 +1,805 @@ +// Part of libddnatv-hook.so, included by ddnatv-hook.c (one translation unit, so the +// parts share their static functions and are built with the same command as before). +// +// Other file operations: access, chmod, unlink, mkdir, rename, readlink, extended attributes, +// links, times, truncate, statfs, the working directory, realpath and scandir. + +#ifndef DDNATV_HOST_TEST + +// Hook faccessat +int faccessat(int dirfd, const char *pathname, int mode, int flags) { + init_ddnatv_hook(); + if (!pathname) { + errno = EFAULT; + return -1; + } + DDNATV_AT_REMAP(dirfd, pathname); + + struct stat st; + int stat_flags = (flags & AT_SYMLINK_NOFOLLOW) ? AT_SYMLINK_NOFOLLOW : 0; + if (fstatat(dirfd, pathname, &st, stat_flags) != 0) { + return -1; + } + + if (mode == F_OK) { + return 0; + } + + if (mode & X_OK) { + if (S_ISDIR(st.st_mode)) return 0; + if ((st.st_mode & 0111) != 0) return 0; + if (strstr(pathname, "/bin/") || strstr(pathname, "/sbin/")) return 0; + errno = EACCES; + return -1; + } + + return 0; +} + +int faccessat2(int dirfd, const char *pathname, int mode, int flags) { + return faccessat(dirfd, pathname, mode, flags); +} + +// Hook access +int access(const char *pathname, int mode) { + return faccessat(AT_FDCWD, pathname, mode, 0); +} + +// Hook euidaccess and eaccess +int euidaccess(const char *pathname, int mode) { + return faccessat(AT_FDCWD, pathname, mode, AT_EACCESS); +} + +int eaccess(const char *pathname, int mode) { + return faccessat(AT_FDCWD, pathname, mode, AT_EACCESS); +} + +// Hook chmod +int chmod(const char *pathname, mode_t mode) { + static int (*orig_chmod)(const char *, mode_t) = NULL; + if (!orig_chmod) orig_chmod = (int (*)(const char *, mode_t))dlsym(RTLD_NEXT, "chmod"); + if (!orig_chmod) return -1; + char buf[PATH_MAX]; + const char *target = rewrite_path_follow(pathname, buf, sizeof(buf)); + int ret = orig_chmod(target, mode); + if (ret != 0 && ((mode & 06000) != 0 || errno == EPERM || errno == EACCES || errno == ENOSYS)) { + ret = orig_chmod(target, mode & 01777); + } + if (ret != 0 && (errno == EPERM || errno == EACCES)) { + errno = 0; + return 0; + } + return ret; +} + +// Hook fchmod +int fchmod(int fd, mode_t mode) { + static int (*orig_fchmod)(int, mode_t) = NULL; + if (!orig_fchmod) orig_fchmod = (int (*)(int, mode_t))dlsym(RTLD_NEXT, "fchmod"); + if (!orig_fchmod) return -1; + int ret = orig_fchmod(fd, mode); + if (ret != 0 && ((mode & 06000) != 0 || errno == EPERM || errno == EACCES || errno == ENOSYS)) { + ret = orig_fchmod(fd, mode & 01777); + } + if (ret != 0 && (errno == EPERM || errno == EACCES)) { + errno = 0; + return 0; + } + return ret; +} + +// Hook fchmodat +int fchmodat(int dirfd, const char *pathname, mode_t mode, int flags) { + static int (*orig_fchmodat)(int, const char *, mode_t, int) = NULL; + if (!orig_fchmodat) orig_fchmodat = (int (*)(int, const char *, mode_t, int))dlsym(RTLD_NEXT, "fchmodat"); + if (!orig_fchmodat) return -1; + DDNATV_AT_REMAP(dirfd, pathname); + char buf[PATH_MAX]; + const char *target = (pathname && pathname[0] == '/') ? rewrite_path(pathname, buf, sizeof(buf)) : pathname; + int ret = orig_fchmodat(dirfd, target, mode, flags); + if (ret != 0 && ((mode & 06000) != 0 || errno == EPERM || errno == EACCES || errno == ENOSYS)) { + ret = orig_fchmodat(dirfd, target, mode & 01777, flags); + } + if (ret != 0 && (errno == EPERM || errno == EACCES)) { + errno = 0; + return 0; + } + return ret; +} + +// Hook unlink +int unlink(const char *pathname) { + static int (*orig_unlink)(const char *) = NULL; + if (!orig_unlink) orig_unlink = (int (*)(const char *))dlsym(RTLD_NEXT, "unlink"); + char buf[PATH_MAX]; + const char *target = rewrite_path(pathname, buf, sizeof(buf)); + unlink_mapped_unix_socket(target); + dev_t hl_dev = 0; + ino_t hl_ino = 0; + int hardlinked = lookup_emulated_hardlink_at(AT_FDCWD, target, &hl_dev, &hl_ino); + int ret = orig_unlink(target); + if (ret != 0 && refused_in_repaired_dir(AT_FDCWD, target)) { + // The name could not be looked up while its directory was closed + hardlinked = lookup_emulated_hardlink_at(AT_FDCWD, target, &hl_dev, &hl_ino); + ret = orig_unlink(target); + } + if (ret == 0 && hardlinked) unregister_emulated_hardlink(hl_dev, hl_ino); + return ret; +} + +// Hook unlinkat +int unlinkat(int dirfd, const char *pathname, int flags) { + static int (*orig_unlinkat)(int, const char *, int) = NULL; + if (!orig_unlinkat) orig_unlinkat = (int (*)(int, const char *, int))dlsym(RTLD_NEXT, "unlinkat"); + DDNATV_AT_REMAP(dirfd, pathname); + char buf[PATH_MAX]; + const char *target = (pathname && pathname[0] == '/') ? rewrite_path(pathname, buf, sizeof(buf)) : pathname; + dev_t hl_dev = 0; + ino_t hl_ino = 0; + int hardlinked = 0; + if (target) { + unlink_mapped_unix_socket(target); + hardlinked = lookup_emulated_hardlink_at(dirfd, target, &hl_dev, &hl_ino); + } + int ret = orig_unlinkat ? orig_unlinkat(dirfd, target, flags) : -1; + if (ret != 0 && orig_unlinkat && refused_in_repaired_dir(dirfd, target)) { + hardlinked = target ? lookup_emulated_hardlink_at(dirfd, target, &hl_dev, &hl_ino) : 0; + ret = orig_unlinkat(dirfd, target, flags); + } + if (ret == 0 && hardlinked) unregister_emulated_hardlink(hl_dev, hl_ino); + return ret; +} + +// Hook rmdir +int rmdir(const char *pathname) { + static int (*orig_rmdir)(const char *) = NULL; + if (!orig_rmdir) orig_rmdir = (int (*)(const char *))dlsym(RTLD_NEXT, "rmdir"); + char buf[PATH_MAX]; + const char *target = rewrite_path(pathname, buf, sizeof(buf)); + int ret = orig_rmdir(target); + if (ret != 0 && refused_in_repaired_dir(AT_FDCWD, target)) ret = orig_rmdir(target); + return ret; +} + +// glibc's remove() calls its internal unlinkat, which no preload can see: GLib's g_file_delete() +// got ENOENT for every guest path, and Flatpak could not replace an app's "current" link +int remove(const char *pathname) { + if (unlink(pathname) == 0) return 0; + if (errno != EISDIR) return -1; + return rmdir(pathname); +} + +// glob() and nftw() walk directories with glibc's internal calls too. glob() is given the hook's +// own through GLOB_ALTDIRFUNC; nftw() walks the mapped directory and its callback is given guest paths. +static int glob_alt_stat(const char *path, void *st) { return stat(path, (struct stat *)st); } +static int glob_alt_lstat(const char *path, void *st) { return lstat(path, (struct stat *)st); } +static void *glob_alt_opendir(const char *path) { return opendir(path); } +static void *glob_alt_readdir(void *dir) { return readdir((DIR *)dir); } +static void glob_alt_closedir(void *dir) { closedir((DIR *)dir); } + +int glob(const char *pattern, int flags, int (*errfunc)(const char *, int), glob_t *pglob) { + static int (*orig_glob)(const char *, int, int (*)(const char *, int), glob_t *) = NULL; + if (!orig_glob) orig_glob = (int (*)(const char *, int, int (*)(const char *, int), glob_t *))dlsym(RTLD_NEXT, "glob"); + if (pglob && !(flags & GLOB_ALTDIRFUNC)) { + init_ddnatv_hook(); + pglob->gl_closedir = glob_alt_closedir; + pglob->gl_readdir = (struct dirent *(*)(void *))glob_alt_readdir; + pglob->gl_opendir = glob_alt_opendir; + pglob->gl_lstat = (int (*)(const char *, struct stat *))glob_alt_lstat; + pglob->gl_stat = (int (*)(const char *, struct stat *))glob_alt_stat; + flags |= GLOB_ALTDIRFUNC; + } + return orig_glob ? orig_glob(pattern, flags, errfunc, pglob) : GLOB_NOSPACE; +} + +int glob64(const char *pattern, int flags, int (*errfunc)(const char *, int), glob64_t *pglob) { + return glob(pattern, flags, errfunc, (glob_t *)pglob); +} + +static __thread struct { + const char *host, *guest; + size_t host_len, guest_len; + int (*nftw_fn)(const char *, const struct stat *, int, struct FTW *); + int (*ftw_fn)(const char *, const struct stat *, int); +} t_walk; + +static const char *walk_guest_path(const char *path, char *buf, size_t size, int *base) { + if (!t_walk.host || strncmp(path, t_walk.host, t_walk.host_len) != 0) return path; + const char *rest = path + t_walk.host_len; + if (*rest != '\0' && *rest != '/') return path; + // a walk of "/" gives "/etc", not "//etc" + size_t guest_len = (t_walk.guest_len == 1 && *rest == '/') ? 0 : t_walk.guest_len; + size_t n = ddnatv_append(buf, size, 0, t_walk.guest, guest_len); + ddnatv_append(buf, size, n, rest, strlen(rest)); + if (base) *base = *base - (int)t_walk.host_len + (int)guest_len; + return buf; +} + +static int walk_nftw_cb(const char *path, const struct stat *st, int type, struct FTW *ftwbuf) { + char buf[PATH_MAX]; + struct FTW guest_ftw = *ftwbuf; + return t_walk.nftw_fn(walk_guest_path(path, buf, sizeof(buf), &guest_ftw.base), st, type, &guest_ftw); +} + +static int walk_ftw_cb(const char *path, const struct stat *st, int type) { + char buf[PATH_MAX]; + return t_walk.ftw_fn(walk_guest_path(path, buf, sizeof(buf), NULL), st, type); +} + +int nftw(const char *dir, int (*fn)(const char *, const struct stat *, int, struct FTW *), int fds, int flags) { + static int (*orig_nftw)(const char *, int (*)(const char *, const struct stat *, int, struct FTW *), int, int) = NULL; + if (!orig_nftw) orig_nftw = (int (*)(const char *, int (*)(const char *, const struct stat *, int, struct FTW *), int, int))dlsym(RTLD_NEXT, "nftw"); + if (!orig_nftw) { errno = ENOSYS; return -1; } + char buf[PATH_MAX]; + const char *target = rewrite_path(dir, buf, sizeof(buf)); + if (target == dir || !fn) return orig_nftw(dir, fn, fds, flags); + __typeof__(t_walk) saved = t_walk; + t_walk.host = target; t_walk.host_len = strlen(target); + while (t_walk.host_len > 1 && target[t_walk.host_len - 1] == '/') t_walk.host_len--; + t_walk.guest = dir; t_walk.guest_len = strlen(dir); + while (t_walk.guest_len > 1 && dir[t_walk.guest_len - 1] == '/') t_walk.guest_len--; + t_walk.nftw_fn = fn; + int ret = orig_nftw(target, walk_nftw_cb, fds, flags); + t_walk = saved; + return ret; +} + +int nftw64(const char *dir, int (*fn)(const char *, const struct stat64 *, int, struct FTW *), int fds, int flags) { + return nftw(dir, (int (*)(const char *, const struct stat *, int, struct FTW *))fn, fds, flags); +} + +int ftw(const char *dir, int (*fn)(const char *, const struct stat *, int), int fds) { + static int (*orig_ftw)(const char *, int (*)(const char *, const struct stat *, int), int) = NULL; + if (!orig_ftw) orig_ftw = (int (*)(const char *, int (*)(const char *, const struct stat *, int), int))dlsym(RTLD_NEXT, "ftw"); + if (!orig_ftw) { errno = ENOSYS; return -1; } + char buf[PATH_MAX]; + const char *target = rewrite_path(dir, buf, sizeof(buf)); + if (target == dir || !fn) return orig_ftw(dir, fn, fds); + __typeof__(t_walk) saved = t_walk; + t_walk.host = target; t_walk.host_len = strlen(target); + while (t_walk.host_len > 1 && target[t_walk.host_len - 1] == '/') t_walk.host_len--; + t_walk.guest = dir; t_walk.guest_len = strlen(dir); + while (t_walk.guest_len > 1 && dir[t_walk.guest_len - 1] == '/') t_walk.guest_len--; + t_walk.ftw_fn = fn; + int ret = orig_ftw(target, walk_ftw_cb, fds); + t_walk = saved; + return ret; +} + +int ftw64(const char *dir, int (*fn)(const char *, const struct stat64 *, int), int fds) { + return ftw(dir, (int (*)(const char *, const struct stat *, int))fn, fds); +} + +// The app is root for the programs it runs, and root enters and writes every directory whatever its +// mode; the app does not. dpkg makes each new directory with mode 0 and sets the mode a moment later, +// and a chmod that fails is reported as done (see chmod), which left directories nobody could put a +// file in: "Permission denied" in /usr/share/applications and others (#44). So a directory always +// keeps its owner's read, write and search rights. +#define NEW_DIR_OWNER_RIGHTS S_IRWXU + +// Hook mkdir +int mkdir(const char *pathname, mode_t mode) { + static int (*orig_mkdir)(const char *, mode_t) = NULL; + if (!orig_mkdir) orig_mkdir = (int (*)(const char *, mode_t))dlsym(RTLD_NEXT, "mkdir"); + char buf[PATH_MAX]; + const char *target = rewrite_path(pathname, buf, sizeof(buf)); + int ret = orig_mkdir(target, mode | NEW_DIR_OWNER_RIGHTS); + if (ret != 0 && refused_in_repaired_dir(AT_FDCWD, target)) ret = orig_mkdir(target, mode | NEW_DIR_OWNER_RIGHTS); + return ret; +} + +// Hook mkdirat +int mkdirat(int dirfd, const char *pathname, mode_t mode) { + static int (*orig_mkdirat)(int, const char *, mode_t) = NULL; + if (!orig_mkdirat) orig_mkdirat = (int (*)(int, const char *, mode_t))dlsym(RTLD_NEXT, "mkdirat"); + DDNATV_AT_REMAP(dirfd, pathname); + char buf[PATH_MAX]; + const char *target = (pathname && pathname[0] == '/') ? rewrite_path(pathname, buf, sizeof(buf)) : pathname; + int ret = orig_mkdirat(dirfd, target, mode | NEW_DIR_OWNER_RIGHTS); + if (ret != 0 && refused_in_repaired_dir(dirfd, target)) ret = orig_mkdirat(dirfd, target, mode | NEW_DIR_OWNER_RIGHTS); + return ret; +} + +static void ensure_dir_exists(const char *path) { + if (!path || path[0] == '\0') return; + char tmp[PATH_MAX]; + strncpy(tmp, path, sizeof(tmp) - 1); + tmp[sizeof(tmp) - 1] = '\0'; + for (char *p = tmp + 1; *p; p++) { + if (*p == '/') { + *p = '\0'; + mkdir(tmp, 0755); + *p = '/'; + } + } + mkdir(tmp, 0755); +} + +// Hook inotify_add_watch +int inotify_add_watch(int fd, const char *pathname, uint32_t mask) { + static int (*orig_inotify_add_watch)(int, const char *, uint32_t) = NULL; + if (!orig_inotify_add_watch) orig_inotify_add_watch = (int (*)(int, const char *, uint32_t))dlsym(RTLD_NEXT, "inotify_add_watch"); + if (!pathname) return -1; + char buf[PATH_MAX]; + const char *target = rewrite_path(pathname, buf, sizeof(buf)); + if (!orig_inotify_add_watch) return -1; + int wd = orig_inotify_add_watch(fd, target, mask); + if (wd < 0 && errno == ENOENT && (mask & IN_ONLYDIR)) { + ensure_dir_exists(target); + wd = orig_inotify_add_watch(fd, target, mask); + } + return wd; +} + +// Hook rename +int rename(const char *oldpath, const char *newpath) { + static int (*orig_rename)(const char *, const char *) = NULL; + if (!orig_rename) orig_rename = (int (*)(const char *, const char *))dlsym(RTLD_NEXT, "rename"); + char buf1[PATH_MAX]; + char buf2[PATH_MAX]; + const char *target_old = rewrite_path(oldpath, buf1, sizeof(buf1)); + const char *target_new = rewrite_path(newpath, buf2, sizeof(buf2)); + dev_t hl_dev = 0; + ino_t hl_ino = 0; + int hardlinked = lookup_emulated_hardlink_at(AT_FDCWD, target_new, &hl_dev, &hl_ino); + int ret = orig_rename(target_old, target_new); + if (ret != 0 && errno == EACCES) { + // Both directories: the old name is taken out of one, the new put in the other + int refused = errno; + int fixed_old = refused_in_repaired_dir(AT_FDCWD, target_old); + errno = refused; + int fixed_new = refused_in_repaired_dir(AT_FDCWD, target_new); + if (fixed_old || fixed_new) { + hardlinked = lookup_emulated_hardlink_at(AT_FDCWD, target_new, &hl_dev, &hl_ino); + ret = orig_rename(target_old, target_new); + } + } + if (ret == 0 && hardlinked) unregister_emulated_hardlink(hl_dev, hl_ino); + return ret; +} + +// Hook renameat +int renameat(int olddirfd, const char *oldpath, int newdirfd, const char *newpath) { + static int (*orig_renameat)(int, const char *, int, const char *) = NULL; + if (!orig_renameat) orig_renameat = (int (*)(int, const char *, int, const char *))dlsym(RTLD_NEXT, "renameat"); + DDNATV_AT_REMAP_NAMED(olddirfd, oldpath, ddnatv_at_old); + DDNATV_AT_REMAP_NAMED(newdirfd, newpath, ddnatv_at_new); + char buf1[PATH_MAX]; + char buf2[PATH_MAX]; + const char *target_old = (oldpath && oldpath[0] == '/') ? rewrite_path(oldpath, buf1, sizeof(buf1)) : oldpath; + const char *target_new = (newpath && newpath[0] == '/') ? rewrite_path(newpath, buf2, sizeof(buf2)) : newpath; + dev_t hl_dev = 0; + ino_t hl_ino = 0; + int hardlinked = lookup_emulated_hardlink_at(newdirfd, target_new, &hl_dev, &hl_ino); + int ret = orig_renameat(olddirfd, target_old, newdirfd, target_new); + if (ret != 0 && errno == EACCES) { + int refused = errno; + int fixed_old = refused_in_repaired_dir(olddirfd, target_old); + errno = refused; + int fixed_new = refused_in_repaired_dir(newdirfd, target_new); + if (fixed_old || fixed_new) { + hardlinked = lookup_emulated_hardlink_at(newdirfd, target_new, &hl_dev, &hl_ino); + ret = orig_renameat(olddirfd, target_old, newdirfd, target_new); + } + } + if (ret == 0 && hardlinked) unregister_emulated_hardlink(hl_dev, hl_ino); + return ret; +} + +// Hook renameat2 +int renameat2(int olddirfd, const char *oldpath, int newdirfd, const char *newpath, unsigned int flags) { + static int (*orig_renameat2)(int, const char *, int, const char *, unsigned int) = NULL; + if (!orig_renameat2) { + orig_renameat2 = (int (*)(int, const char *, int, const char *, unsigned int))dlsym(RTLD_NEXT, "renameat2"); + if (!orig_renameat2) return renameat(olddirfd, oldpath, newdirfd, newpath); + } + DDNATV_AT_REMAP_NAMED(olddirfd, oldpath, ddnatv_at_old); + DDNATV_AT_REMAP_NAMED(newdirfd, newpath, ddnatv_at_new); + char buf1[PATH_MAX]; + char buf2[PATH_MAX]; + const char *target_old = (oldpath && oldpath[0] == '/') ? rewrite_path(oldpath, buf1, sizeof(buf1)) : oldpath; + const char *target_new = (newpath && newpath[0] == '/') ? rewrite_path(newpath, buf2, sizeof(buf2)) : newpath; + dev_t hl_dev = 0; + ino_t hl_ino = 0; + // RENAME_EXCHANGE keeps both files, so nothing is replaced. + int hardlinked = !(flags & RENAME_EXCHANGE) && lookup_emulated_hardlink_at(newdirfd, target_new, &hl_dev, &hl_ino); + int ret = orig_renameat2(olddirfd, target_old, newdirfd, target_new, flags); + if (ret != 0 && errno == EACCES) { + int refused = errno; + int fixed_old = refused_in_repaired_dir(olddirfd, target_old); + errno = refused; + int fixed_new = refused_in_repaired_dir(newdirfd, target_new); + if (fixed_old || fixed_new) { + hardlinked = !(flags & RENAME_EXCHANGE) && lookup_emulated_hardlink_at(newdirfd, target_new, &hl_dev, &hl_ino); + ret = orig_renameat2(olddirfd, target_old, newdirfd, target_new, flags); + } + } + if (ret == 0 && hardlinked) unregister_emulated_hardlink(hl_dev, hl_ino); + return ret; +} + +// Hook readlink +ssize_t readlink(const char *pathname, char *buf, size_t bufsiz) { + if (is_proc_self_exe(pathname)) { + ssize_t exe_len = handle_proc_self_exe(buf, bufsiz); + if (exe_len >= 0) return exe_len; + } + static ssize_t (*orig_readlink)(const char *, char *, size_t) = NULL; + if (!orig_readlink) orig_readlink = (ssize_t (*)(const char *, char *, size_t))dlsym(RTLD_NEXT, "readlink"); + char pbuf[PATH_MAX]; + const char *target = rewrite_path(pathname, pbuf, sizeof(pbuf)); + ssize_t ret = orig_readlink ? orig_readlink(target, buf, bufsiz) : -1; + if (ret < 0 && errno == ENOENT) { + char alt[PATH_MAX]; + const char *retry = usrmerge_retry_path(target, alt, sizeof(alt)); + if (retry) ret = orig_readlink(retry, buf, bufsiz); + } + return postprocess_readlink(pathname, buf, ret, bufsiz); +} + +// Hook readlinkat +ssize_t readlinkat(int dirfd, const char *pathname, char *buf, size_t bufsiz) { + static ssize_t (*orig_readlinkat)(int, const char *, char *, size_t) = NULL; + if (!orig_readlinkat) orig_readlinkat = (ssize_t (*)(int, const char *, char *, size_t))dlsym(RTLD_NEXT, "readlinkat"); + DDNATV_AT_REMAP(dirfd, pathname); + // after the remap: "proc/self/exe" relative to a descriptor for "/" is /proc/self/exe as well + if (is_proc_self_exe(pathname)) { + ssize_t exe_len = handle_proc_self_exe(buf, bufsiz); + if (exe_len >= 0) return exe_len; + } + char pbuf[PATH_MAX]; + const char *target = (pathname && pathname[0] == '/') ? rewrite_path(pathname, pbuf, sizeof(pbuf)) : pathname; + ssize_t ret = orig_readlinkat ? orig_readlinkat(dirfd, target, buf, bufsiz) : -1; + if (ret < 0 && errno == ENOENT && pathname && pathname[0] == '/') { + char alt[PATH_MAX]; + const char *retry = usrmerge_retry_path(target, alt, sizeof(alt)); + if (retry) ret = orig_readlinkat(dirfd, retry, buf, bufsiz); + } + return postprocess_readlink(pathname, buf, ret, bufsiz); +} + +// Fortified readlink variants used by dpkg / update-alternatives +ssize_t __readlink_chk(const char *pathname, char *buf, size_t bufsiz, size_t buflen) { + return readlink(pathname, buf, bufsiz); +} + +ssize_t __readlinkat_chk(int dirfd, const char *pathname, char *buf, size_t bufsiz, size_t buflen) { + return readlinkat(dirfd, pathname, buf, bufsiz); +} + +// Ubuntu's programs find Android's SELinux (enforcing) through libselinux and then ask its policy +// questions it has no answers for. The one that mattered: PAM's pam_rootok, which lets root +// change its own entries, asks "may this user be root" and was refused, so chfn, chsh and +// `adduser --gecos` (the installation of PostgreSQL) failed with "PAM: Authentication failure". +// Ubuntu does not use SELinux, so for its programs it is off, as its labels are hidden below. +int is_selinux_enabled(void) { return 0; } + +// Extended attributes take the same paths as stat(). Without these hooks coreutils read +// security.selinux with the Ubuntu path itself: `ls -l` printed an error line for every file +// Android lacks (/etc/os-release) and showed Android's own label for the ones it has +// (/etc/passwd). Ubuntu does not use SELinux, so its label is hidden altogether: `ls -l` looks as +// on Ubuntu and cp/tar/rsync do not try to copy Android's labels. +ssize_t getxattr(const char *path, const char *name, void *value, size_t size) { + static ssize_t (*orig_getxattr)(const char *, const char *, void *, size_t) = NULL; + if (!orig_getxattr) orig_getxattr = (ssize_t (*)(const char *, const char *, void *, size_t))dlsym(RTLD_NEXT, "getxattr"); + if (is_selinux_xattr(name)) { + errno = ENODATA; + return -1; + } + char pbuf[PATH_MAX]; + return orig_getxattr ? orig_getxattr(rewrite_path_follow(path, pbuf, sizeof(pbuf)), name, value, size) : -1; +} + +ssize_t lgetxattr(const char *path, const char *name, void *value, size_t size) { + static ssize_t (*orig_lgetxattr)(const char *, const char *, void *, size_t) = NULL; + if (!orig_lgetxattr) orig_lgetxattr = (ssize_t (*)(const char *, const char *, void *, size_t))dlsym(RTLD_NEXT, "lgetxattr"); + if (is_selinux_xattr(name)) { + errno = ENODATA; + return -1; + } + char pbuf[PATH_MAX]; + return orig_lgetxattr ? orig_lgetxattr(rewrite_path(path, pbuf, sizeof(pbuf)), name, value, size) : -1; +} + +ssize_t listxattr(const char *path, char *list, size_t size) { + static ssize_t (*orig_listxattr)(const char *, char *, size_t) = NULL; + if (!orig_listxattr) orig_listxattr = (ssize_t (*)(const char *, char *, size_t))dlsym(RTLD_NEXT, "listxattr"); + char pbuf[PATH_MAX]; + ssize_t ret = orig_listxattr ? orig_listxattr(rewrite_path_follow(path, pbuf, sizeof(pbuf)), list, size) : -1; + return size > 0 ? drop_selinux_xattr(list, ret) : ret; +} + +ssize_t llistxattr(const char *path, char *list, size_t size) { + static ssize_t (*orig_llistxattr)(const char *, char *, size_t) = NULL; + if (!orig_llistxattr) orig_llistxattr = (ssize_t (*)(const char *, char *, size_t))dlsym(RTLD_NEXT, "llistxattr"); + char pbuf[PATH_MAX]; + ssize_t ret = orig_llistxattr ? orig_llistxattr(rewrite_path(path, pbuf, sizeof(pbuf)), list, size) : -1; + return size > 0 ? drop_selinux_xattr(list, ret) : ret; +} + +ssize_t fgetxattr(int fd, const char *name, void *value, size_t size) { + static ssize_t (*orig_fgetxattr)(int, const char *, void *, size_t) = NULL; + if (!orig_fgetxattr) orig_fgetxattr = (ssize_t (*)(int, const char *, void *, size_t))dlsym(RTLD_NEXT, "fgetxattr"); + if (is_selinux_xattr(name)) { + errno = ENODATA; + return -1; + } + return orig_fgetxattr ? orig_fgetxattr(fd, name, value, size) : -1; +} + +ssize_t flistxattr(int fd, char *list, size_t size) { + static ssize_t (*orig_flistxattr)(int, char *, size_t) = NULL; + if (!orig_flistxattr) orig_flistxattr = (ssize_t (*)(int, char *, size_t))dlsym(RTLD_NEXT, "flistxattr"); + ssize_t ret = orig_flistxattr ? orig_flistxattr(fd, list, size) : -1; + return size > 0 ? drop_selinux_xattr(list, ret) : ret; +} + +int setxattr(const char *path, const char *name, const void *value, size_t size, int flags) { + static int (*orig_setxattr)(const char *, const char *, const void *, size_t, int) = NULL; + if (!orig_setxattr) orig_setxattr = (int (*)(const char *, const char *, const void *, size_t, int))dlsym(RTLD_NEXT, "setxattr"); + char pbuf[PATH_MAX]; + return orig_setxattr ? orig_setxattr(rewrite_path_follow(path, pbuf, sizeof(pbuf)), name, value, size, flags) : -1; +} + +int lsetxattr(const char *path, const char *name, const void *value, size_t size, int flags) { + static int (*orig_lsetxattr)(const char *, const char *, const void *, size_t, int) = NULL; + if (!orig_lsetxattr) orig_lsetxattr = (int (*)(const char *, const char *, const void *, size_t, int))dlsym(RTLD_NEXT, "lsetxattr"); + char pbuf[PATH_MAX]; + return orig_lsetxattr ? orig_lsetxattr(rewrite_path(path, pbuf, sizeof(pbuf)), name, value, size, flags) : -1; +} + +int removexattr(const char *path, const char *name) { + static int (*orig_removexattr)(const char *, const char *) = NULL; + if (!orig_removexattr) orig_removexattr = (int (*)(const char *, const char *))dlsym(RTLD_NEXT, "removexattr"); + char pbuf[PATH_MAX]; + return orig_removexattr ? orig_removexattr(rewrite_path(path, pbuf, sizeof(pbuf)), name) : -1; +} + +int lremovexattr(const char *path, const char *name) { + static int (*orig_lremovexattr)(const char *, const char *) = NULL; + if (!orig_lremovexattr) orig_lremovexattr = (int (*)(const char *, const char *))dlsym(RTLD_NEXT, "lremovexattr"); + char pbuf[PATH_MAX]; + return orig_lremovexattr ? orig_lremovexattr(rewrite_path(path, pbuf, sizeof(pbuf)), name) : -1; +} + +// Hook symlink +int symlink(const char *target, const char *linkpath) { + static int (*orig_symlink)(const char *, const char *) = NULL; + if (!orig_symlink) orig_symlink = (int (*)(const char *, const char *))dlsym(RTLD_NEXT, "symlink"); + char pbuf[PATH_MAX], tbuf[PATH_MAX]; + const char *newlink = rewrite_path(linkpath, pbuf, sizeof(pbuf)); + const char *newtarget = (target && target[0] == '/') ? rewrite_path(target, tbuf, sizeof(tbuf)) : target; + int ret = orig_symlink ? orig_symlink(newtarget, newlink) : -1; + if (ret != 0 && orig_symlink && refused_in_repaired_dir(AT_FDCWD, newlink)) ret = orig_symlink(newtarget, newlink); + return ret; +} + +// Hook symlinkat +int symlinkat(const char *target, int newdirfd, const char *linkpath) { + static int (*orig_symlinkat)(const char *, int, const char *) = NULL; + if (!orig_symlinkat) orig_symlinkat = (int (*)(const char *, int, const char *))dlsym(RTLD_NEXT, "symlinkat"); + DDNATV_AT_REMAP(newdirfd, linkpath); + char pbuf[PATH_MAX], tbuf[PATH_MAX]; + const char *newlink = (linkpath && linkpath[0] == '/') ? rewrite_path(linkpath, pbuf, sizeof(pbuf)) : linkpath; + const char *newtarget = (target && target[0] == '/') ? rewrite_path(target, tbuf, sizeof(tbuf)) : target; + int ret = orig_symlinkat ? orig_symlinkat(newtarget, newdirfd, newlink) : -1; + if (ret != 0 && orig_symlinkat && refused_in_repaired_dir(newdirfd, newlink)) ret = orig_symlinkat(newtarget, newdirfd, newlink); + return ret; +} + +// Hook linkat +int linkat(int olddirfd, const char *oldpath, int newdirfd, const char *newpath, int flags) { + static int (*orig_linkat)(int, const char *, int, const char *, int) = NULL; + if (!orig_linkat) orig_linkat = (int (*)(int, const char *, int, const char *, int))dlsym(RTLD_NEXT, "linkat"); + DDNATV_AT_REMAP_NAMED(olddirfd, oldpath, ddnatv_at_old); + DDNATV_AT_REMAP_NAMED(newdirfd, newpath, ddnatv_at_new); + char obuf[PATH_MAX], nbuf[PATH_MAX]; + const char *rold = (oldpath && oldpath[0] == '/') ? rewrite_path(oldpath, obuf, sizeof(obuf)) : oldpath; + const char *rnew = (newpath && newpath[0] == '/') ? rewrite_path(newpath, nbuf, sizeof(nbuf)) : newpath; + int ret = orig_linkat ? orig_linkat(olddirfd, rold, newdirfd, rnew, flags) : -1; + if (ret != 0 && orig_linkat && refused_in_repaired_dir(newdirfd, rnew)) ret = orig_linkat(olddirfd, rold, newdirfd, rnew, flags); + if (ret != 0 && (errno == EXDEV || errno == EPERM || errno == EACCES || errno == ENOTSUP || errno == ENOSYS)) { + ret = ddnatv_emulate_hardlinkat(olddirfd, rold, newdirfd, rnew); + } + return ret; +} + +// Hook link +int link(const char *oldpath, const char *newpath) { + return linkat(AT_FDCWD, oldpath, AT_FDCWD, newpath, 0); +} + +// Hook utime / utimes / lutimes / futimesat / utimensat +int utime(const char *filename, const struct utimbuf *times) { + static int (*orig_utime)(const char *, const struct utimbuf *) = NULL; + if (!orig_utime) orig_utime = (int (*)(const char *, const struct utimbuf *))dlsym(RTLD_NEXT, "utime"); + char buf[PATH_MAX]; + const char *target = rewrite_path_follow(filename, buf, sizeof(buf)); + return orig_utime ? orig_utime(target, times) : -1; +} + +int utimes(const char *filename, const struct timeval times[2]) { + static int (*orig_utimes)(const char *, const struct timeval[2]) = NULL; + if (!orig_utimes) orig_utimes = (int (*)(const char *, const struct timeval[2]))dlsym(RTLD_NEXT, "utimes"); + char buf[PATH_MAX]; + const char *target = rewrite_path_follow(filename, buf, sizeof(buf)); + return orig_utimes ? orig_utimes(target, times) : -1; +} + +int lutimes(const char *filename, const struct timeval times[2]) { + static int (*orig_lutimes)(const char *, const struct timeval[2]) = NULL; + if (!orig_lutimes) orig_lutimes = (int (*)(const char *, const struct timeval[2]))dlsym(RTLD_NEXT, "lutimes"); + char buf[PATH_MAX]; + const char *target = rewrite_path(filename, buf, sizeof(buf)); + return orig_lutimes ? orig_lutimes(target, times) : -1; +} + +int futimesat(int dirfd, const char *pathname, const struct timeval times[2]) { + static int (*orig_futimesat)(int, const char *, const struct timeval[2]) = NULL; + if (!orig_futimesat) orig_futimesat = (int (*)(int, const char *, const struct timeval[2]))dlsym(RTLD_NEXT, "futimesat"); + char buf[PATH_MAX]; + const char *target = (pathname && pathname[0] == '/') ? rewrite_path(pathname, buf, sizeof(buf)) : pathname; + return orig_futimesat ? orig_futimesat(dirfd, target, times) : -1; +} + +int utimensat(int dirfd, const char *pathname, const struct timespec times[2], int flags) { + static int (*orig_utimensat)(int, const char *, const struct timespec[2], int) = NULL; + if (!orig_utimensat) orig_utimensat = (int (*)(int, const char *, const struct timespec[2], int))dlsym(RTLD_NEXT, "utimensat"); + DDNATV_AT_REMAP(dirfd, pathname); + char buf[PATH_MAX]; + const char *target = (pathname && pathname[0] == '/') ? rewrite_path(pathname, buf, sizeof(buf)) : pathname; + return orig_utimensat ? orig_utimensat(dirfd, target, times, flags) : -1; +} + +// Hook truncate +int truncate(const char *path, off_t length) { + static int (*orig_truncate)(const char *, off_t) = NULL; + if (!orig_truncate) orig_truncate = (int (*)(const char *, off_t))dlsym(RTLD_NEXT, "truncate"); + char buf[PATH_MAX]; + const char *target = rewrite_path_follow(path, buf, sizeof(buf)); + return orig_truncate(target, length); +} + +// Hook statfs / statfs64 / statvfs / statvfs64 +int statfs(const char *path, struct statfs *buf) { + static int (*orig_statfs)(const char *, struct statfs *) = NULL; + if (!orig_statfs) orig_statfs = (int (*)(const char *, struct statfs *))dlsym(RTLD_NEXT, "statfs"); + char pbuf[PATH_MAX]; + const char *target = rewrite_path_follow(path, pbuf, sizeof(pbuf)); + return orig_statfs ? orig_statfs(target, buf) : -1; +} + +int statvfs(const char *path, struct statvfs *buf) { + static int (*orig_statvfs)(const char *, struct statvfs *) = NULL; + if (!orig_statvfs) orig_statvfs = (int (*)(const char *, struct statvfs *))dlsym(RTLD_NEXT, "statvfs"); + char pbuf[PATH_MAX]; + const char *target = rewrite_path_follow(path, pbuf, sizeof(pbuf)); + return orig_statvfs ? orig_statvfs(target, buf) : -1; +} + +// Hook chdir +int chdir(const char *path) { + static int (*orig_chdir)(const char *) = NULL; + if (!orig_chdir) orig_chdir = (int (*)(const char *))dlsym(RTLD_NEXT, "chdir"); + char buf[PATH_MAX]; + const char *target = rewrite_path_follow(path, buf, sizeof(buf)); + return orig_chdir ? orig_chdir(target) : -1; +} + +// Hook fchdir +int fchdir(int fd) { + static int (*orig_fchdir)(int) = NULL; + if (!orig_fchdir) orig_fchdir = (int (*)(int))dlsym(RTLD_NEXT, "fchdir"); + return orig_fchdir ? orig_fchdir(fd) : -1; +} + +// Hook getcwd +char *getcwd(char *buf, size_t size) { + static char *(*orig_getcwd)(char *, size_t) = NULL; + if (!orig_getcwd) orig_getcwd = (char *(*)(char *, size_t))dlsym(RTLD_NEXT, "getcwd"); + char *res = orig_getcwd ? orig_getcwd(buf, size) : NULL; + if (res) { + size_t len = strlen(res); + guest_path_of_mount_source(res, len, buf ? size : len + 1, NULL); + } + return res; +} + +extern void __chk_fail(void) __attribute__((__noreturn__)); +char *__getcwd_chk(char *buf, size_t size, size_t buflen) { + if (size > buflen) __chk_fail(); + return getcwd(buf, size); +} + +// Hook realpath and canonicalize_file_name +char *realpath(const char *path, char *resolved_path) { + static char *(*orig_realpath)(const char *, char *) = NULL; + if (!orig_realpath) orig_realpath = (char *(*)(const char *, char *))dlsym(RTLD_NEXT, "realpath"); + if (!path) { + errno = EINVAL; + return NULL; + } + init_ddnatv_hook(); + if (is_proc_self_exe(path)) { + char tmp[PATH_MAX]; + ssize_t n = handle_proc_self_exe(tmp, sizeof(tmp) - 1); + if (n > 0) { + tmp[n] = '\0'; + if (resolved_path) { + strncpy(resolved_path, tmp, PATH_MAX - 1); + resolved_path[PATH_MAX - 1] = '\0'; + return resolved_path; + } else { + return strdup(tmp); + } + } + } + char pbuf[PATH_MAX]; + const char *target = rewrite_path(path, pbuf, sizeof(pbuf)); + char *res = orig_realpath ? orig_realpath(target, resolved_path) : NULL; + if (res && g_ddnatv_root[0] != '\0') { + size_t rlen = g_ddnatv_root_len; + if (strncmp(res, g_ddnatv_root, rlen) == 0 && (res[rlen] == '/' || res[rlen] == '\0')) { + size_t rem_len = strlen(res + rlen); + if (rem_len == 0) { + res[0] = '/'; + res[1] = '\0'; + } else { + memmove(res, res + rlen, rem_len + 1); + } + } + } + if (res) guest_path_of_mount_source(res, strlen(res), resolved_path ? PATH_MAX : strlen(res) + 1, NULL); + return res; +} + +char *__realpath_chk(const char *path, char *resolved_path, size_t resolved_len) { + return realpath(path, resolved_path); +} + +char *canonicalize_file_name(const char *path) { + return realpath(path, NULL); +} + +// Hook scandir and scandir64 +int scandir(const char *dirp, struct dirent ***namelist, + int (*filter)(const struct dirent *), + int (*compar)(const struct dirent **, const struct dirent **)) { + static int (*orig_scandir)(const char *, struct dirent ***, + int (*)(const struct dirent *), + int (*)(const struct dirent **, const struct dirent **)) = NULL; + if (!orig_scandir) orig_scandir = (int (*)(const char *, struct dirent ***, + int (*)(const struct dirent *), + int (*)(const struct dirent **, const struct dirent **)))dlsym(RTLD_NEXT, "scandir"); + char buf[PATH_MAX]; + const char *target = rewrite_path(dirp, buf, sizeof(buf)); + return orig_scandir ? orig_scandir(target, namelist, filter, compar) : -1; +} + +#if defined(__LP64__) +// Export 64-bit Large File Support (LFS) symbol aliases on 64-bit platforms so that +// calls from libraries compiled with LFS (such as libstdc++ calling fopen64) are intercepted. +__asm__( + ".globl open64\n" ".set open64, open\n" + ".globl openat64\n" ".set openat64, openat\n" + ".globl __open64_2\n" ".set __open64_2, __open_2\n" + ".globl __openat64_2\n" ".set __openat64_2, __openat_2\n" + ".globl creat64\n" ".set creat64, creat\n" + ".globl fopen64\n" ".set fopen64, fopen\n" + ".globl freopen64\n" ".set freopen64, freopen\n" + ".globl stat64\n" ".set stat64, stat\n" + ".globl lstat64\n" ".set lstat64, lstat\n" + ".globl fstatat64\n" ".set fstatat64, fstatat\n" + ".globl truncate64\n" ".set truncate64, truncate\n" + ".globl statfs64\n" ".set statfs64, statfs\n" + ".globl statvfs64\n" ".set statvfs64, statvfs\n" + ".globl scandir64\n" ".set scandir64, scandir\n" + ".globl mkstemp64\n" ".set mkstemp64, mkstemp\n" + ".globl mkostemp64\n" ".set mkostemp64, mkostemp\n" + ".globl mkstemps64\n" ".set mkstemps64, mkstemps\n" + ".globl mkostemps64\n" ".set mkostemps64, mkostemps\n" + ".globl tmpfile64\n" ".set tmpfile64, tmpfile\n" +); +#endif + +#endif /* !DDNATV_HOST_TEST */ diff --git a/tools/nativeguest/hook/files.c b/tools/nativeguest/hook/files.c new file mode 100644 index 0000000000..6c52f70adf --- /dev/null +++ b/tools/nativeguest/hook/files.c @@ -0,0 +1,813 @@ +// Part of libddnatv-hook.so, included by ddnatv-hook.c (one translation unit, so the +// parts share their static functions and are built with the same command as before). +// +// Opening, creating and inspecting files: open, fopen, temporary files, directories, the stat family. + +#ifndef DDNATV_HOST_TEST + +#ifndef O_TMPFILE +#define O_TMPFILE (020000000 | 00200000) +#endif + +static inline int open_needs_mode(int flags) { +#ifdef O_TMPFILE + return ((flags & O_CREAT) != 0) || ((flags & O_TMPFILE) == O_TMPFILE); +#else + return (flags & O_CREAT) != 0; +#endif +} + +// The app is root for the programs it runs, and root puts names in every directory and takes them out +// whatever the mode of the directory; the app does not. A directory that is the app's own can have lost +// its owner's rights: an earlier version left the directories dpkg makes (with mode 0) at mode 0 when the +// chmod that follows did not take effect, and a package can ship a read-only one (#44). When a call that +// makes or removes a name is refused in such a directory, the directory is given its owner's rights and the +// call is made once more. Returns 1 when the directory was repaired (the call can be made again). +static int give_dir_owner_rights(int dirfd, const char *name) { + static int (*orig_fchmodat)(int, const char *, mode_t, int) = NULL; + if (!name || !*name) return 0; + char parent[PATH_MAX]; + size_t len = strlen(name); + if (len >= sizeof(parent)) return 0; + memcpy(parent, name, len + 1); + while (len > 1 && parent[len - 1] == '/') parent[--len] = '\0'; + char *slash = strrchr(parent, '/'); + if (!slash) { + strcpy(parent, "."); + } else if (slash == parent) { + parent[1] = '\0'; + } else { + *slash = '\0'; + } + struct stat st; + if (real_fstatat(dirfd, parent, &st, 0) != 0 || !S_ISDIR(st.st_mode)) return 0; + if (__atomic_load_n(&g_app_uid, __ATOMIC_RELAXED) == (uid_t)-1) load_app_ids(); + if (st.st_uid != __atomic_load_n(&g_app_uid, __ATOMIC_RELAXED)) return 0; + if ((st.st_mode & 0700) == 0700) return 0; + if (!orig_fchmodat) orig_fchmodat = (int (*)(int, const char *, mode_t, int))dlsym(RTLD_NEXT, "fchmodat"); + return orig_fchmodat && orig_fchmodat(dirfd, parent, (st.st_mode | 0700) & 07777, 0) == 0; +} + +// For the calls that were refused (EACCES): whether the directory of `name` was repaired, so that the call +// can be made again. errno stays what the call left when it was not. +static int refused_in_repaired_dir(int dirfd, const char *name) { + if (errno != EACCES) return 0; + int saved = errno; + int fixed = give_dir_owner_rights(dirfd, name); + if (!fixed) errno = saved; + return fixed; +} + +static int dlopen_preload_deps(const char *path, void *(*orig_dlopen)(const char *, int), int depth); + +// Hook dlopen and dlmopen +void *dlopen(const char *filename, int flags) { + static void *(*orig_dlopen)(const char *, int) = NULL; + if (!orig_dlopen) orig_dlopen = (void *(*)(const char *, int))dlsym(RTLD_NEXT, "dlopen"); + if (!filename) return orig_dlopen ? orig_dlopen(NULL, flags) : NULL; + if (!orig_dlopen) return NULL; + + char buf[PATH_MAX]; + const char *target = rewrite_path_follow(filename, buf, sizeof(buf)); + void *handle = orig_dlopen(target, flags); + if (!handle && target[0] == '/' && !(flags & RTLD_NOLOAD)) { + // Its dependencies may be in its RUNPATH, which ld.so looked for outside the rootfs + int saved = errno; + if (dlopen_preload_deps(target, orig_dlopen, 0) > 0) handle = orig_dlopen(target, flags); + if (!handle) errno = saved; + } + return handle; +} + +void *dlmopen(Lmid_t lmid, const char *filename, int flags) { + static void *(*orig_dlmopen)(Lmid_t, const char *, int) = NULL; + if (!orig_dlmopen) orig_dlmopen = (void *(*)(Lmid_t, const char *, int))dlsym(RTLD_NEXT, "dlmopen"); + if (!filename) return orig_dlmopen ? orig_dlmopen(lmid, NULL, flags) : NULL; + + char buf[PATH_MAX]; + const char *target = rewrite_path(filename, buf, sizeof(buf)); + return orig_dlmopen ? orig_dlmopen(lmid, target, flags) : NULL; +} + +// /proc//status (and a thread's) give the app's own ids, which every other call presents as +// root: process monitors comparing them with getuid() showed none of the session's processes. Only +// such tools are given root's there: Chromium (Steam's web helper) checks the ids of the processes it +// sandboxes in those files, and with them all 0 every helper exited and Steam never drew a frame. +static int reader_compares_process_ids(void) { + static const char *const k_readers[] = { + "ps", "top", "htop", "btop", "atop", "pgrep", "pkill", "pidof", "pstree", "w", "glances", + "ksystemstats", "plasma-systemmonitor", "ksysguard", "ksysguardd", "kinfocenter", "gnome-system-monitor", + }; + const char *me = program_invocation_short_name; + if (!me) return 0; + for (size_t i = 0; i < sizeof(k_readers) / sizeof(k_readers[0]); i++) { + if (strcmp(me, k_readers[i]) == 0) return 1; + } + return 0; +} + +static int is_proc_status_path(const char *p) { + if (!p || strncmp(p, "/proc/", 6) != 0) return 0; + p += 6; + if (strncmp(p, "self/", 5) == 0) p += 5; + else if (strncmp(p, "thread-self/", 12) == 0) p += 12; + else { + if (*p < '0' || *p > '9') return 0; + while (*p >= '0' && *p <= '9') p++; + if (*p++ != '/') return 0; + if (strncmp(p, "task/", 5) == 0) { + p += 5; + if (*p < '0' || *p > '9') return 0; + while (*p >= '0' && *p <= '9') p++; + if (*p++ != '/') return 0; + } + } + return strcmp(p, "status") == 0; +} + +static void proc_status_root_ids(char *text, size_t len, const char *field, unsigned long id) { + size_t flen = strlen(field); + for (size_t at = 0; at + flen <= len; at++) { + if ((at != 0 && text[at - 1] != '\n') || memcmp(text + at, field, flen) != 0) continue; + char *p = text + at + flen; + char *end = memchr(p, '\n', len - (size_t)(p - text)); + if (!end) end = text + len; + char out[128]; + size_t used = 0; + while (p < end && used + 24 < sizeof(out)) { + while (p < end && (*p == '\t' || *p == ' ')) out[used++] = *p++; + char *num = p; + while (p < end && *p >= '0' && *p <= '9') p++; + if (p == num) break; + unsigned long v = strtoul(num, NULL, 10); + used += (size_t)snprintf(out + used, sizeof(out) - used, "%lu", v == id ? 0UL : v); + } + if (p != end) return; + // the line shrinks or stays (an id becomes 0), so it is rewritten in place + size_t old_len = (size_t)(end - (text + at + flen)); + if (used > old_len) return; + memcpy(text + at + flen, out, used); + memmove(text + at + flen + used, end, len - (size_t)(end - text) + 1); + return; + } +} + +// The status file with the app's ids as root's, in a memory file; -2 when `path` is no such file +// or is opened for writing. +static int open_proc_status(const char *path, int flags) { + if ((flags & O_ACCMODE) != O_RDONLY || !is_proc_status_path(path) || !reader_compares_process_ids()) return -2; + int fd = (int)syscall(SYS_openat, AT_FDCWD, path, O_RDONLY | O_CLOEXEC); + if (fd < 0) return -1; + char text[16384]; + size_t len = 0; + for (;;) { + ssize_t n = (ssize_t)syscall(SYS_read, fd, text + len, sizeof(text) - 1 - len); + if (n <= 0) break; + len += (size_t)n; + if (len >= sizeof(text) - 1) break; + } + syscall(SYS_close, fd); + text[len] = '\0'; + if (__atomic_load_n(&g_app_uid, __ATOMIC_RELAXED) == (uid_t)-1) load_app_ids(); + proc_status_root_ids(text, len, "Uid:", (unsigned long)__atomic_load_n(&g_app_uid, __ATOMIC_RELAXED)); + len = strlen(text); + proc_status_root_ids(text, len, "Gid:", (unsigned long)__atomic_load_n(&g_app_gid, __ATOMIC_RELAXED)); + len = strlen(text); + int mfd = (int)syscall(SYS_memfd_create, "status", (flags & O_CLOEXEC) ? MFD_CLOEXEC : 0); + if (mfd < 0) return (int)syscall(SYS_openat, AT_FDCWD, path, flags, 0); + size_t written = 0; + while (written < len) { + ssize_t n = (ssize_t)syscall(SYS_write, mfd, text + written, len - written); + if (n <= 0) break; + written += (size_t)n; + } + syscall(SYS_lseek, mfd, 0, SEEK_SET); + return mfd; +} + +// openat(dirfd, "status") with dirfd on /proc/ or a thread of it +static int open_proc_status_at(int dirfd, const char *name, int flags) { + if (dirfd < 0 || !name || strcmp(name, "status") != 0 || (flags & O_ACCMODE) != O_RDONLY) return -2; + char link[48], dir[PATH_MAX]; + snprintf(link, sizeof(link), "/proc/self/fd/%d", dirfd); + long n = syscall(SYS_readlinkat, AT_FDCWD, link, dir, sizeof(dir) - 8); + if (n <= 0) return -2; + dir[n] = '\0'; + memcpy(dir + n, "/status", 8); + return open_proc_status(dir, flags); +} + +// Hook open +int open(const char *pathname, int flags, ...) { + static int (*orig_open)(const char *, int, ...) = NULL; + if (!orig_open) orig_open = (int (*)(const char *, int, ...))dlsym(RTLD_NEXT, "open"); + init_ddnatv_hook(); + char exe_buf[PATH_MAX]; + if (is_proc_self_exe(pathname)) { + if (g_real_exe[0] != '\0') { + pathname = g_real_exe; + } else if (handle_proc_self_exe(exe_buf, sizeof(exe_buf)) > 0) { + pathname = exe_buf; + } + } + int status_fd = open_proc_status(pathname, flags); + if (status_fd != -2) return status_fd; + char buf[PATH_MAX]; + const char *target = ((flags & O_NOFOLLOW) ? rewrite_path : rewrite_path_follow)(pathname, buf, sizeof(buf)); + if (open_needs_mode(flags)) { + va_list args; + va_start(args, flags); + mode_t mode = va_arg(args, mode_t); + va_end(args); + int fd = orig_open(target, flags, mode); + if (fd < 0 && (flags & O_CREAT) && refused_in_repaired_dir(AT_FDCWD, target)) fd = orig_open(target, flags, mode); + return fd; + } + return orig_open(target, flags); +} + +// Hook openat +int openat(int dirfd, const char *pathname, int flags, ...) { + static int (*orig_openat)(int, const char *, int, ...) = NULL; + if (!orig_openat) orig_openat = (int (*)(int, const char *, int, ...))dlsym(RTLD_NEXT, "openat"); + init_ddnatv_hook(); + DDNATV_AT_REMAP(dirfd, pathname); + char exe_buf[PATH_MAX]; + if (is_proc_self_exe(pathname)) { + if (g_real_exe[0] != '\0') { + pathname = g_real_exe; + } else if (handle_proc_self_exe(exe_buf, sizeof(exe_buf)) > 0) { + pathname = exe_buf; + } + } + int status_fd = (pathname && pathname[0] == '/') ? open_proc_status(pathname, flags) : open_proc_status_at(dirfd, pathname, flags); + if (status_fd != -2) return status_fd; + char buf[PATH_MAX]; + const char *target = (pathname && pathname[0] == '/') ? ((flags & O_NOFOLLOW) ? rewrite_path : rewrite_path_follow)(pathname, buf, sizeof(buf)) : pathname; + if (open_needs_mode(flags)) { + va_list args; + va_start(args, flags); + mode_t mode = va_arg(args, mode_t); + va_end(args); + int fd = orig_openat(dirfd, target, flags, mode); + if (fd < 0 && (flags & O_CREAT) && refused_in_repaired_dir(dirfd, target)) fd = orig_openat(dirfd, target, flags, mode); + return fd; + } + return orig_openat(dirfd, target, flags); +} + +// Hook creat +int creat(const char *pathname, mode_t mode) { + return open(pathname, O_CREAT | O_WRONLY | O_TRUNC, mode); +} + +// Fortified open variants used by GNU tar and other coreutils compiled with _FORTIFY_SOURCE=2/3 +int __open_2(const char *pathname, int flags) { + return open(pathname, flags); +} + +int __openat_2(int dirfd, const char *pathname, int flags) { + return openat(dirfd, pathname, flags); +} + +// openat2/open_how local definition: avoids depending on , +// which old NDK/cross headers may lack. Layout matches UAPI ver0 +// (flags, mode, resolve = 3 x __u64); extra fields are never read here. +struct ddnatv_open_how { + uint64_t flags; + uint64_t mode; + uint64_t resolve; +}; +#ifndef RESOLVE_BENEATH +#define RESOLVE_BENEATH 0x08 +#endif +#ifndef __NR_openat2 +#define __NR_openat2 437 +#endif +#ifndef __NR_fchmodat2 +#define __NR_fchmodat2 452 +#endif + +static long call_orig_syscall(long number, unsigned long a1, unsigned long a2, unsigned long a3, unsigned long a4, unsigned long a5, unsigned long a6) { + static long (*orig_syscall)(long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long) = NULL; + if (!orig_syscall) { + orig_syscall = (long (*)(long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long))dlsym(RTLD_NEXT, "syscall"); + } + return orig_syscall ? orig_syscall(number, a1, a2, a3, a4, a5, a6) : syscall(number, a1, a2, a3, a4, a5, a6); +} + +// Hook openat2 (used by GNU tar 1.35+/gnulib for RESOLVE_BENEATH traversal). +// Rewrites absolute paths like openat, then delegates; on ENOSYS (kernels +// without openat2, e.g. Android < 5.6) emulates with plain openat instead of +// trusting every caller to implement the fallback itself. +int openat2(int dirfd, const char *pathname, struct ddnatv_open_how *how, size_t usize) { + static int (*orig_openat2)(int, const char *, struct ddnatv_open_how *, size_t) = NULL; + if (!orig_openat2) orig_openat2 = (int (*)(int, const char *, struct ddnatv_open_how *, size_t))dlsym(RTLD_NEXT, "openat2"); + if (!pathname) { + errno = EFAULT; + return -1; + } + const char *given = pathname; + DDNATV_AT_REMAP(dirfd, pathname); + // a remapped path is absolute, which RESOLVE_BENEATH and the like refuse: the caller walks it itself + if (pathname != given && how && how->resolve != 0) { + errno = ENOSYS; + return -1; + } + char exe_buf[PATH_MAX]; + if (is_proc_self_exe(pathname)) { + if (g_real_exe[0] != '\0') { + pathname = g_real_exe; + } else if (handle_proc_self_exe(exe_buf, sizeof(exe_buf)) > 0) { + pathname = exe_buf; + } + } + char buf[PATH_MAX]; + const char *target = (pathname[0] == '/') ? rewrite_path(pathname, buf, sizeof(buf)) : pathname; + if (orig_openat2) { + int ret = orig_openat2(dirfd, target, how, usize); + if (ret >= 0 || errno != ENOSYS) return ret; + } +#ifdef __NR_openat2 + long sret = call_orig_syscall(__NR_openat2, (unsigned long)dirfd, (unsigned long)target, (unsigned long)how, (unsigned long)usize, 0, 0); + if (sret >= 0 || errno != ENOSYS) { + return (int)sret; + } +#endif + if (!how || usize < 16) { + errno = EINVAL; + return -1; + } + int flags = (int)(how->flags & 0xffffffffu); + mode_t mode = (mode_t)(how->mode & 07777u); + + // RESOLVE_BENEATH, RESOLVE_NO_SYMLINKS and the other resolve flags restrict every component of + // the path, which a plain openat() cannot do (a symlink in the middle would still be followed). + // Say so: callers such as gnulib's openat2 (GNU tar) then walk the path safely themselves. + if (how->resolve != 0) { + errno = ENOSYS; + return -1; + } + + if (open_needs_mode(flags)) { + return openat(dirfd, target, flags, mode); + } + return openat(dirfd, target, flags); +} + +// Hook fchmodat2 (used by GNU tar for lchmod-style symlink chmod). +// Delegates when the libc symbol exists, otherwise emulates: symlinks cannot +// be chmod'ed without kernel support, so skip them (return 0) like gnulib, +// and route everything else through fchmodat. +int fchmodat2(int dirfd, const char *pathname, mode_t mode, int flags) { + static int (*orig_fchmodat2)(int, const char *, mode_t, int) = NULL; + if (!orig_fchmodat2) orig_fchmodat2 = (int (*)(int, const char *, mode_t, int))dlsym(RTLD_NEXT, "fchmodat2"); + if (!pathname) { + errno = EFAULT; + return -1; + } + char buf[PATH_MAX]; + const char *target = (pathname[0] == '/') ? rewrite_path(pathname, buf, sizeof(buf)) : pathname; + if (orig_fchmodat2) { + int ret = orig_fchmodat2(dirfd, target, mode, flags); + if (ret == 0 || errno != ENOSYS) return ret; + } + if ((flags & AT_SYMLINK_NOFOLLOW) != 0) { + struct stat st; + if (fstatat(dirfd, target, &st, AT_SYMLINK_NOFOLLOW) == 0 && S_ISLNK(st.st_mode)) { + return 0; + } + } + return fchmodat(dirfd, target, mode, 0); +} + + +// Hook fopen +FILE *fopen(const char *pathname, const char *mode) { + static FILE *(*orig_fopen)(const char *, const char *) = NULL; + if (!orig_fopen) orig_fopen = (FILE *(*)(const char *, const char *))dlsym(RTLD_NEXT, "fopen"); + if (mode && mode[0] == 'r' && !strchr(mode, '+')) { + int status_fd = open_proc_status(pathname, O_RDONLY | (strchr(mode, 'e') ? O_CLOEXEC : 0)); + if (status_fd >= 0) return fdopen(status_fd, mode); + if (status_fd == -1) return NULL; + } + char buf[PATH_MAX]; + const char *target = rewrite_path_follow(pathname, buf, sizeof(buf)); + return orig_fopen(target, mode); +} + +// Hook freopen +FILE *freopen(const char *pathname, const char *mode, FILE *stream) { + static FILE *(*orig_freopen)(const char *, const char *, FILE *) = NULL; + if (!orig_freopen) orig_freopen = (FILE *(*)(const char *, const char *, FILE *))dlsym(RTLD_NEXT, "freopen"); + char buf[PATH_MAX]; + const char *target = rewrite_path_follow(pathname, buf, sizeof(buf)); + return orig_freopen(target, mode, stream); +} + +// Hook write +ssize_t write(int fd, const void *buf, size_t count) { + static ssize_t (*orig_write)(int, const void *, size_t) = NULL; + if (!orig_write) orig_write = (ssize_t (*)(int, const void *, size_t))dlsym(RTLD_NEXT, "write"); + return orig_write ? orig_write(fd, buf, count) : -1; +} + +// Hook mkstemp +int mkstemp(char *template) { + static int (*orig_mkstemp)(char *) = NULL; + if (!orig_mkstemp) orig_mkstemp = (int (*)(char *))dlsym(RTLD_NEXT, "mkstemp"); + if (!template) { errno = EINVAL; return -1; } + + char buf[PATH_MAX]; + const char *target = rewrite_path(template, buf, sizeof(buf)); + if (target == template) { + return orig_mkstemp ? orig_mkstemp(template) : -1; + } + + char tmp_buf[PATH_MAX]; + strncpy(tmp_buf, target, sizeof(tmp_buf) - 1); + tmp_buf[sizeof(tmp_buf) - 1] = '\0'; + + int fd = orig_mkstemp ? orig_mkstemp(tmp_buf) : -1; + if (fd >= 0) { + size_t orig_len = strlen(template); + size_t tmp_len = strlen(tmp_buf); + if (orig_len >= 6 && tmp_len >= 6) { + memcpy(template + orig_len - 6, tmp_buf + tmp_len - 6, 6); + } + } + return fd; +} + +// Hook mkostemp +int mkostemp(char *template, int flags) { + static int (*orig_mkostemp)(char *, int) = NULL; + if (!orig_mkostemp) orig_mkostemp = (int (*)(char *, int))dlsym(RTLD_NEXT, "mkostemp"); + if (!template) { errno = EINVAL; return -1; } + + char buf[PATH_MAX]; + const char *target = rewrite_path(template, buf, sizeof(buf)); + if (target == template) { + return orig_mkostemp ? orig_mkostemp(template, flags) : -1; + } + + char tmp_buf[PATH_MAX]; + strncpy(tmp_buf, target, sizeof(tmp_buf) - 1); + tmp_buf[sizeof(tmp_buf) - 1] = '\0'; + + int fd = orig_mkostemp ? orig_mkostemp(tmp_buf, flags) : -1; + if (fd >= 0) { + size_t orig_len = strlen(template); + size_t tmp_len = strlen(tmp_buf); + if (orig_len >= 6 && tmp_len >= 6) { + memcpy(template + orig_len - 6, tmp_buf + tmp_len - 6, 6); + } + } + return fd; +} + +// Hook mkstemps +int mkstemps(char *template, int suffixlen) { + static int (*orig_mkstemps)(char *, int) = NULL; + if (!orig_mkstemps) orig_mkstemps = (int (*)(char *, int))dlsym(RTLD_NEXT, "mkstemps"); + if (!template) { errno = EINVAL; return -1; } + + char buf[PATH_MAX]; + const char *target = rewrite_path(template, buf, sizeof(buf)); + if (target == template) { + return orig_mkstemps ? orig_mkstemps(template, suffixlen) : -1; + } + + char tmp_buf[PATH_MAX]; + strncpy(tmp_buf, target, sizeof(tmp_buf) - 1); + tmp_buf[sizeof(tmp_buf) - 1] = '\0'; + + int fd = orig_mkstemps ? orig_mkstemps(tmp_buf, suffixlen) : -1; + if (fd >= 0) { + size_t orig_len = strlen(template); + size_t tmp_len = strlen(tmp_buf); + if (orig_len >= (size_t)(suffixlen + 6) && tmp_len >= (size_t)(suffixlen + 6)) { + memcpy(template + orig_len - suffixlen - 6, tmp_buf + tmp_len - suffixlen - 6, 6); + } + } + return fd; +} + +// Hook mkostemps +int mkostemps(char *template, int suffixlen, int flags) { + static int (*orig_mkostemps)(char *, int, int) = NULL; + if (!orig_mkostemps) orig_mkostemps = (int (*)(char *, int, int))dlsym(RTLD_NEXT, "mkostemps"); + if (!template) { errno = EINVAL; return -1; } + + char buf[PATH_MAX]; + const char *target = rewrite_path(template, buf, sizeof(buf)); + if (target == template) { + return orig_mkostemps ? orig_mkostemps(template, suffixlen, flags) : -1; + } + + char tmp_buf[PATH_MAX]; + strncpy(tmp_buf, target, sizeof(tmp_buf) - 1); + tmp_buf[sizeof(tmp_buf) - 1] = '\0'; + + int fd = orig_mkostemps ? orig_mkostemps(tmp_buf, suffixlen, flags) : -1; + if (fd >= 0) { + size_t orig_len = strlen(template); + size_t tmp_len = strlen(tmp_buf); + if (orig_len >= (size_t)(suffixlen + 6) && tmp_len >= (size_t)(suffixlen + 6)) { + memcpy(template + orig_len - suffixlen - 6, tmp_buf + tmp_len - suffixlen - 6, 6); + } + } + return fd; +} + +// Hook mkdtemp +char *mkdtemp(char *template) { + static char *(*orig_mkdtemp)(char *) = NULL; + if (!orig_mkdtemp) orig_mkdtemp = (char *(*)(char *))dlsym(RTLD_NEXT, "mkdtemp"); + if (!template) { errno = EINVAL; return NULL; } + + char buf[PATH_MAX]; + const char *target = rewrite_path(template, buf, sizeof(buf)); + if (target == template) { + return orig_mkdtemp ? orig_mkdtemp(template) : NULL; + } + + char tmp_buf[PATH_MAX]; + strncpy(tmp_buf, target, sizeof(tmp_buf) - 1); + tmp_buf[sizeof(tmp_buf) - 1] = '\0'; + + char *res = orig_mkdtemp ? orig_mkdtemp(tmp_buf) : NULL; + if (res) { + size_t orig_len = strlen(template); + size_t tmp_len = strlen(tmp_buf); + if (orig_len >= 6 && tmp_len >= 6) { + memcpy(template + orig_len - 6, tmp_buf + tmp_len - 6, 6); + } + return template; + } + return NULL; +} + +// Hook tmpfile +FILE *tmpfile(void) { + init_ddnatv_hook(); + char template_buf[PATH_MAX]; + if (g_ddnatv_root[0] != '\0') { + snprintf(template_buf, sizeof(template_buf), "%s/tmp/tmpfile.XXXXXX", g_ddnatv_root); + } else { + snprintf(template_buf, sizeof(template_buf), "/tmp/tmpfile.XXXXXX"); + } + int fd = mkstemp(template_buf); + if (fd < 0) return NULL; + unlink(template_buf); + FILE *f = fdopen(fd, "w+b"); + if (!f) { + int saved_errno = errno; + close(fd); + errno = saved_errno; + } + return f; +} + +#ifndef __USE_FILE_OFFSET64 +// Programs built with _LARGEFILE64_SOURCE call this name. With _FILE_OFFSET_BITS=64 (the 32-bit ARM +// build) the headers already export the definition above as tmpfile64. +FILE *tmpfile64(void) { + return tmpfile(); +} +#endif + +// Hook opendir +DIR *opendir(const char *name) { + static DIR *(*orig_opendir)(const char *) = NULL; + if (!orig_opendir) orig_opendir = (DIR *(*)(const char *))dlsym(RTLD_NEXT, "opendir"); + char buf[PATH_MAX]; + const char *target = rewrite_path_follow(name, buf, sizeof(buf)); + return orig_opendir(target); +} + +// Hook stat +int stat(const char *pathname, struct stat *statbuf) { + static int (*orig_stat)(const char *, struct stat *) = NULL; + if (!orig_stat) orig_stat = (int (*)(const char *, struct stat *))dlsym(RTLD_NEXT, "stat"); + char buf[PATH_MAX]; + const char *target = rewrite_path_follow(pathname, buf, sizeof(buf)); + int ret = orig_stat ? orig_stat(target, statbuf) : -1; + if (ret != 0 && errno == ENOENT) { + char alt[PATH_MAX]; + const char *retry = usrmerge_retry_path(target, alt, sizeof(alt)); + if (retry) ret = orig_stat(retry, statbuf); + } + if (ret == 0) apply_stat_emulation(statbuf); + return ret; +} + +// Hook lstat +int lstat(const char *pathname, struct stat *statbuf) { + static int (*orig_lstat)(const char *, struct stat *) = NULL; + if (!orig_lstat) orig_lstat = (int (*)(const char *, struct stat *))dlsym(RTLD_NEXT, "lstat"); + char buf[PATH_MAX]; + const char *target = rewrite_path(pathname, buf, sizeof(buf)); + int ret = orig_lstat ? orig_lstat(target, statbuf) : -1; + char alt[PATH_MAX]; + if (ret != 0 && errno == ENOENT) { + const char *retry = usrmerge_retry_path(target, alt, sizeof(alt)); + if (retry) { + ret = orig_lstat(retry, statbuf); + if (ret == 0) target = retry; + } + } + if (ret == 0 && statbuf && S_ISLNK(statbuf->st_mode) && g_ddnatv_root[0] != '\0' && target && + readlink_result_may_change(pathname, (long long)statbuf->st_size)) { + char link_buf[PATH_MAX]; + static ssize_t (*orig_readlink)(const char *, char *, size_t) = NULL; + if (!orig_readlink) orig_readlink = (ssize_t (*)(const char *, char *, size_t))dlsym(RTLD_NEXT, "readlink"); + ssize_t llen = orig_readlink ? orig_readlink(target, link_buf, sizeof(link_buf) - 1) : -1; + if (llen > 0) { + ssize_t post_len = postprocess_readlink(pathname, link_buf, llen, sizeof(link_buf)); + if (post_len > 0) { + statbuf->st_size = post_len; + } + } + } + if (ret == 0) apply_stat_emulation(statbuf); + return ret; +} + +// Hook fstatat +int fstatat(int dirfd, const char *pathname, struct stat *statbuf, int flags) { + static int (*orig_fstatat)(int, const char *, struct stat *, int) = NULL; + if (!orig_fstatat) orig_fstatat = (int (*)(int, const char *, struct stat *, int))dlsym(RTLD_NEXT, "fstatat"); + DDNATV_AT_REMAP(dirfd, pathname); + char buf[PATH_MAX]; + const char *target = (pathname && pathname[0] == '/') ? ((flags & AT_SYMLINK_NOFOLLOW) ? rewrite_path : rewrite_path_follow)(pathname, buf, sizeof(buf)) : pathname; + int ret = orig_fstatat ? orig_fstatat(dirfd, target, statbuf, flags) : -1; + char alt[PATH_MAX]; + if (ret != 0 && errno == ENOENT && pathname && pathname[0] == '/') { + const char *retry = usrmerge_retry_path(target, alt, sizeof(alt)); + if (retry) { + ret = orig_fstatat(dirfd, retry, statbuf, flags); + if (ret == 0) target = retry; + } + } + if (ret == 0 && statbuf && (flags & AT_SYMLINK_NOFOLLOW) && S_ISLNK(statbuf->st_mode) && g_ddnatv_root[0] != '\0' && target && + readlink_result_may_change(pathname, (long long)statbuf->st_size)) { + char link_buf[PATH_MAX]; + static ssize_t (*orig_readlinkat)(int, const char *, char *, size_t) = NULL; + if (!orig_readlinkat) orig_readlinkat = (ssize_t (*)(int, const char *, char *, size_t))dlsym(RTLD_NEXT, "readlinkat"); + ssize_t llen = orig_readlinkat ? orig_readlinkat(dirfd, target, link_buf, sizeof(link_buf) - 1) : -1; + if (llen > 0) { + ssize_t post_len = postprocess_readlink(pathname, link_buf, llen, sizeof(link_buf)); + if (post_len > 0) { + statbuf->st_size = post_len; + } + } + } + if (ret == 0) apply_stat_emulation(statbuf); + return ret; +} + +// Hook fstat +int fstat(int fd, struct stat *statbuf) { + static int (*orig_fstat)(int, struct stat *) = NULL; + if (!orig_fstat) orig_fstat = (int (*)(int, struct stat *))dlsym(RTLD_NEXT, "fstat"); + int ret = orig_fstat ? orig_fstat(fd, statbuf) : -1; + if (ret == 0) apply_stat_emulation(statbuf); + return ret; +} + +// Glibc __xstat compatibility hooks, what programs built against glibc before 2.33 call (Firefox): +// they present owners like stat() does, or Firefox saw $HOME owned by the app's uid while geteuid() +// said 0 and refused to start ("as root in a regular user's session"). +int __xstat(int ver, const char *pathname, struct stat *statbuf) { + static int (*orig___xstat)(int, const char *, struct stat *) = NULL; + if (!orig___xstat) orig___xstat = (int (*)(int, const char *, struct stat *))dlsym(RTLD_NEXT, "__xstat"); + if (!orig___xstat) return stat(pathname, statbuf); + char buf[PATH_MAX]; + int ret = orig___xstat(ver, rewrite_path_follow(pathname, buf, sizeof(buf)), statbuf); + if (ret == 0) apply_stat_emulation(statbuf); + return ret; +} + +int __xstat64(int ver, const char *pathname, struct stat64 *statbuf) { + static int (*orig___xstat64)(int, const char *, struct stat64 *) = NULL; + if (!orig___xstat64) orig___xstat64 = (int (*)(int, const char *, struct stat64 *))dlsym(RTLD_NEXT, "__xstat64"); + if (!orig___xstat64) return stat(pathname, (struct stat *)statbuf); + char buf[PATH_MAX]; + int ret = orig___xstat64(ver, rewrite_path_follow(pathname, buf, sizeof(buf)), statbuf); + if (ret == 0) apply_stat_emulation((struct stat *)statbuf); + return ret; +} + +int __lxstat(int ver, const char *pathname, struct stat *statbuf) { + static int (*orig___lxstat)(int, const char *, struct stat *) = NULL; + if (!orig___lxstat) orig___lxstat = (int (*)(int, const char *, struct stat *))dlsym(RTLD_NEXT, "__lxstat"); + if (!orig___lxstat) return lstat(pathname, statbuf); + char buf[PATH_MAX]; + int ret = orig___lxstat(ver, rewrite_path(pathname, buf, sizeof(buf)), statbuf); + if (ret == 0) apply_stat_emulation(statbuf); + return ret; +} + +int __lxstat64(int ver, const char *pathname, struct stat64 *statbuf) { + static int (*orig___lxstat64)(int, const char *, struct stat64 *) = NULL; + if (!orig___lxstat64) orig___lxstat64 = (int (*)(int, const char *, struct stat64 *))dlsym(RTLD_NEXT, "__lxstat64"); + if (!orig___lxstat64) return lstat(pathname, (struct stat *)statbuf); + char buf[PATH_MAX]; + int ret = orig___lxstat64(ver, rewrite_path(pathname, buf, sizeof(buf)), statbuf); + if (ret == 0) apply_stat_emulation((struct stat *)statbuf); + return ret; +} + +int __fxstat(int ver, int fd, struct stat *statbuf) { + static int (*orig___fxstat)(int, int, struct stat *) = NULL; + if (!orig___fxstat) orig___fxstat = (int (*)(int, int, struct stat *))dlsym(RTLD_NEXT, "__fxstat"); + if (!orig___fxstat) return fstat(fd, statbuf); + int ret = orig___fxstat(ver, fd, statbuf); + if (ret == 0) apply_stat_emulation(statbuf); + return ret; +} + +int __fxstat64(int ver, int fd, struct stat64 *statbuf) { + static int (*orig___fxstat64)(int, int, struct stat64 *) = NULL; + if (!orig___fxstat64) orig___fxstat64 = (int (*)(int, int, struct stat64 *))dlsym(RTLD_NEXT, "__fxstat64"); + if (!orig___fxstat64) return fstat(fd, (struct stat *)statbuf); + int ret = orig___fxstat64(ver, fd, statbuf); + if (ret == 0) apply_stat_emulation((struct stat *)statbuf); + return ret; +} + +int __fxstatat(int ver, int dirfd, const char *pathname, struct stat *statbuf, int flags) { + static int (*orig___fxstatat)(int, int, const char *, struct stat *, int) = NULL; + if (!orig___fxstatat) orig___fxstatat = (int (*)(int, int, const char *, struct stat *, int))dlsym(RTLD_NEXT, "__fxstatat"); + if (!orig___fxstatat) return fstatat(dirfd, pathname, statbuf, flags); + DDNATV_AT_REMAP(dirfd, pathname); + char buf[PATH_MAX]; + const char *target = (pathname && pathname[0] == '/') ? ((flags & AT_SYMLINK_NOFOLLOW) ? rewrite_path : rewrite_path_follow)(pathname, buf, sizeof(buf)) : pathname; + int ret = orig___fxstatat(ver, dirfd, target, statbuf, flags); + if (ret == 0) apply_stat_emulation(statbuf); + return ret; +} + +int __fxstatat64(int ver, int dirfd, const char *pathname, struct stat64 *statbuf, int flags) { + static int (*orig___fxstatat64)(int, int, const char *, struct stat64 *, int) = NULL; + if (!orig___fxstatat64) orig___fxstatat64 = (int (*)(int, int, const char *, struct stat64 *, int))dlsym(RTLD_NEXT, "__fxstatat64"); + if (!orig___fxstatat64) return fstatat(dirfd, pathname, (struct stat *)statbuf, flags); + DDNATV_AT_REMAP(dirfd, pathname); + char buf[PATH_MAX]; + const char *target = (pathname && pathname[0] == '/') ? ((flags & AT_SYMLINK_NOFOLLOW) ? rewrite_path : rewrite_path_follow)(pathname, buf, sizeof(buf)) : pathname; + int ret = orig___fxstatat64(ver, dirfd, target, statbuf, flags); + if (ret == 0) apply_stat_emulation((struct stat *)statbuf); + return ret; +} + +// Hook statx +int statx(int dirfd, const char *pathname, int flags, unsigned int mask, struct statx *statxbuf) { + // Rust's standard library asks whether statx exists by calling it with a NULL path and buffer + // (EFAULT means it does). glibc's header declares both as nonnull, so the compiler would drop + // the NULL check below and read the path: every Rust program (rg, rustc, cargo...) crashed. + __asm__ volatile("" : "+r"(pathname), "+r"(statxbuf)); + static int (*orig_statx)(int, const char *, int, unsigned int, struct statx *) = NULL; + if (!orig_statx) orig_statx = (int (*)(int, const char *, int, unsigned int, struct statx *))dlsym(RTLD_NEXT, "statx"); + DDNATV_AT_REMAP(dirfd, pathname); + char buf[PATH_MAX]; + const char *target = (pathname && pathname[0] == '/') ? ((flags & AT_SYMLINK_NOFOLLOW) ? rewrite_path : rewrite_path_follow)(pathname, buf, sizeof(buf)) : pathname; + int ret = orig_statx ? orig_statx(dirfd, target, flags, mask, statxbuf) : -1; + if (ret == 0 && statxbuf && hardlinks_maybe_any()) { + const unsigned int needed = STATX_INO | STATX_NLINK | STATX_MTIME; + struct statx full; + const struct statx *sx = statxbuf; + if ((statxbuf->stx_mask & needed) != needed) { + // The caller asked for less ("stat -c %h" for the link count only): what an emulated + // link is recognized by + int saved_errno = errno; + sx = orig_statx(dirfd, target, flags, needed, &full) == 0 && (full.stx_mask & needed) == needed ? &full : NULL; + errno = saved_errno; + } + if (sx) { + struct stat st; + memset(&st, 0, sizeof(st)); + st.st_dev = makedev(sx->stx_dev_major, sx->stx_dev_minor); + st.st_ino = sx->stx_ino; + st.st_nlink = sx->stx_nlink; + st.st_mtim.tv_sec = sx->stx_mtime.tv_sec; + st.st_mtim.tv_nsec = sx->stx_mtime.tv_nsec; + apply_emulated_hardlink(&st); + if (st.st_ino != sx->stx_ino || st.st_nlink != sx->stx_nlink) { + statxbuf->stx_ino = st.st_ino; + statxbuf->stx_nlink = st.st_nlink; + statxbuf->stx_mask |= STATX_INO | STATX_NLINK; + } + } + } + if (ret == 0 && statxbuf) { + uid_t uid = (uid_t)statxbuf->stx_uid; + gid_t gid = (gid_t)statxbuf->stx_gid; + present_owner_as_root((statxbuf->stx_mask & STATX_UID) ? &uid : NULL, (statxbuf->stx_mask & STATX_GID) ? &gid : NULL); + statxbuf->stx_uid = (uint32_t)uid; + statxbuf->stx_gid = (uint32_t)gid; + } + return ret; +} + +#endif /* !DDNATV_HOST_TEST */ diff --git a/tools/nativeguest/hook/go_programs.c b/tools/nativeguest/hook/go_programs.c new file mode 100644 index 0000000000..987d0132ee --- /dev/null +++ b/tools/nativeguest/hook/go_programs.c @@ -0,0 +1,465 @@ +// Part of libddnatv-hook.so, included by ddnatv-hook.c (one translation unit, so the +// parts share their static functions and are built with the same command as before). +// +// Static Go programs: they make their system calls themselves, so Ubuntu's paths mean nothing to +// them. The code of gosys/gosys.c is added to their file. + +// ---- Static Go programs ------------------------------------------------------------------- +// A Go program built without cgo (all of Ubuntu's, and the single files downloaded from a project's +// releases) has no C library: the preloaded hook is never loaded into it, so "/etc/resolv.conf" is +// a file of Android's that does not exist, and so is every program it starts. Go makes all of its +// system calls but a few of its runtime's in one assembly function, internal/runtime/syscall. +// Syscall6, which loads the number and the arguments from the stack and executes "svc #0". +// +// Before such a program (AArch64, Go 1.19 or newer) starts, The native userland changes its file in place, once: +// - the code of gosys/gosys.c is put after the program's code, in the zero padding that the Go +// linker leaves between its segments (the segment is made longer, and executable if it only +// was readable), +// - zero-filled memory for it is added to the end of the program's data segment, +// - the "svc #0" of Syscall6 becomes a branch to a few instructions in that code, which call it +// and go back to the instruction after the "svc". +// The code maps the paths of the calls into the rootfs, as the hook does for C programs, and starts +// the programs of the rootfs through the hook. The file keeps its size, its times and its mode; +// only the program headers, the padding and one instruction differ. The file is changed back and +// patched again when the code of a newer The native userland differs (the trailer says what to undo). + +#ifdef DDNATV_HAVE_GOSYS + +#define GO_MAX_PH 32 +#define GO_PF_X 1u +#define GO_PF_W 2u +#define GO_ET_EXEC 2 +#define GO_ET_DYN 3 + +struct go_ph { + uint32_t type, flags; + uint64_t offset, vaddr, filesz, memsz; + uint64_t pos; // where the entry is in the file +}; + +static uint64_t go_rd64(const unsigned char *p) { return (uint64_t)rd32(p) | ((uint64_t)rd32(p + 4) << 32); } +static void go_wr64(unsigned char *p, uint64_t v) { wr32(p, (uint32_t)v); wr32(p + 4, (uint32_t)(v >> 32)); } + +// The program headers of a 64-bit little-endian ELF; their number, or -1 +static int go_read_phdrs(int fd, struct go_ph *ph, uint16_t *etype, uint16_t *machine) { + unsigned char eh[64]; + if (pread(fd, eh, sizeof(eh), 0) != (ssize_t)sizeof(eh) || memcmp(eh, "\x7f" "ELF", 4) != 0 || eh[4] != 2 || eh[5] != 1) + return -1; + *etype = rd16(eh + 16); + *machine = rd16(eh + 18); + uint64_t phoff = go_rd64(eh + 32); + uint16_t phentsize = rd16(eh + 54), phnum = rd16(eh + 56); + if (phentsize != 56 || phnum == 0 || phnum > GO_MAX_PH) return -1; + for (int i = 0; i < phnum; i++) { + unsigned char e[56]; + uint64_t pos = phoff + (uint64_t)i * 56; + if (pread(fd, e, sizeof(e), (off_t)pos) != (ssize_t)sizeof(e)) return -1; + ph[i].type = rd32(e); + ph[i].flags = rd32(e + 4); + ph[i].offset = go_rd64(e + 8); + ph[i].vaddr = go_rd64(e + 16); + ph[i].filesz = go_rd64(e + 32); + ph[i].memsz = go_rd64(e + 40); + ph[i].pos = pos; + } + return phnum; +} + +// The instructions of Syscall6 up to its system call: x8 and x0 to x5 loaded from the stack +// (ldr x8, [sp, #8]; ldr x0, [sp, #16] ... ldr x5, [sp, #56]), then "svc #0" and "cmn x0, #4095" +static const uint32_t k_go_syscall6[7] = { + 0xf94007e8u, 0xf9400be0u, 0xf9400fe1u, 0xf94013e2u, 0xf94017e3u, 0xf9401be4u, 0xf9401fe5u, +}; +#define GO_SVC 0xd4000001u +#define GO_CMN_X0_4095 0xb13ffc1fu + +// Where Syscall6 makes its call: the file offset of the instruction after the seven loads (the +// "svc #0", or the branch that replaced it). *found counts the places; the first is returned. +static int64_t go_find_syscall6(int fd, const struct go_ph *ph, int n, int *found) { + int64_t first = -1; + *found = 0; + enum { CHUNK = 1 << 20, KEEP = 36 }; + unsigned char *buf = (unsigned char *)malloc(CHUNK + KEEP); + if (!buf) return -1; + for (int i = 0; i < n; i++) { + if (ph[i].type != 1 /* PT_LOAD */ || !(ph[i].flags & GO_PF_X) || ph[i].filesz == 0) continue; + uint64_t pos = 0; + while (pos < ph[i].filesz) { + uint64_t want = ph[i].filesz - pos; + if (want > CHUNK + KEEP) want = CHUNK + KEEP; + ssize_t got = pread(fd, buf, (size_t)want, (off_t)(ph[i].offset + pos)); + if (got <= KEEP) break; + for (ssize_t o = 0; o + 36 <= got; o += 4) { + if (rd32(buf + o) != k_go_syscall6[0]) continue; + int same = 1; + for (int k = 1; k < 7 && same; k++) same = rd32(buf + o + 4 * k) == k_go_syscall6[k]; + if (!same || rd32(buf + o + 32) != GO_CMN_X0_4095) continue; + if (*found == 0) first = (int64_t)(ph[i].offset + pos + (uint64_t)o + 28); + (*found)++; + } + if (pos + (uint64_t)got >= ph[i].filesz) break; + pos += (uint64_t)got - (KEEP - 4); // the next chunk starts where the last place of this could begin, no place is split or counted twice + } + } + free(buf); + return first; +} + +// "b " / "bl " for a distance in bytes, or 0 when it does not fit +static uint32_t go_branch(uint32_t base, int64_t delta) { + if ((delta & 3) != 0 || delta >= (1LL << 27) || delta < -(1LL << 27)) return 0; + return base | (uint32_t)((delta >> 2) & 0x3ffffff); +} + +static uint64_t go_align_up(uint64_t v, uint64_t a) { return (v + a - 1) & ~(a - 1); } + +// The strings the added code needs, as they are now +static int go_make_header(struct gosys_hdr *h) { + if (g_ddnatv_root_len == 0 || g_ddnatv_root_len >= GOSYS_ROOT_MAX) return -1; + memcpy(h->root, g_ddnatv_root, g_ddnatv_root_len); + h->root_len = (uint32_t)g_ddnatv_root_len; + + char buf[PATH_MAX]; + if (find_dynamic_linker_for_machine(g_ddnatv_root, EM_AARCH64, buf, sizeof(buf)) && strlen(buf) < GOSYS_PATH_MAX) { + h->ldso_len = (uint32_t)strlen(buf); + memcpy(h->ldso, buf, h->ldso_len); + } + static const char *const hooks[] = { "/usr/lib/libddnatv-hook.so", "/lib/libddnatv-hook.so" }; + for (size_t i = 0; i < sizeof(hooks) / sizeof(hooks[0]); i++) { + size_t n = ddnatv_append(buf, sizeof(buf), 0, g_ddnatv_root, g_ddnatv_root_len); + n = ddnatv_append(buf, sizeof(buf), n, hooks[i], strlen(hooks[i])); + if (n < GOSYS_PATH_MAX && access(buf, F_OK) == 0) { + h->hook_len = (uint32_t)n; + memcpy(h->hook, buf, n); + break; + } + } + // The program that starts the others: bash, which can give them the argv[0] they are asked for + static const char *const runners[] = { "/usr/bin/bash", "/bin/bash", "/usr/bin/env", "/bin/env" }; + for (size_t i = 0; i < sizeof(runners) / sizeof(runners[0]); i++) { + size_t n = ddnatv_append(buf, sizeof(buf), 0, g_ddnatv_root, g_ddnatv_root_len); + n = ddnatv_append(buf, sizeof(buf), n, runners[i], strlen(runners[i])); + if (n < GOSYS_PATH_MAX && access(buf, F_OK) == 0) { + h->runner_len = (uint32_t)n; + memcpy(h->runner, buf, n); + if (i < 2) h->flags |= GOSYS_FLAG_RUNNER_IS_BASH; + break; + } + } + // The directories the programs of an AArch64 rootfs load their libraries from + static const int dirs[] = { 0, 1, 4, 5, 6 }; + size_t used = 0; + for (size_t i = 0; i < sizeof(dirs) / sizeof(dirs[0]); i++) { + const char *d = k_rootfs_lib_dirs[dirs[i]]; + if (i > 0) used = ddnatv_append(buf, sizeof(buf), used, ":", 1); + used = ddnatv_append(buf, sizeof(buf), used, g_ddnatv_root, g_ddnatv_root_len); + used = ddnatv_append(buf, sizeof(buf), used, d, strlen(d)); + } + if (used < GOSYS_LIBS_MAX) { + h->libs_len = (uint32_t)used; + memcpy(h->libs, buf, used); + } + if (h->ldso_len == 0 || h->runner_len == 0) h->runner_len = 0; // Ubuntu programs cannot be started + return 0; +} + +static int go_pwrite_all(int fd, const void *buf, size_t len, uint64_t off) { + return pwrite(fd, buf, len, (off_t)off) == (ssize_t)len ? 0 : -1; +} + +static int go_open_for_write(int fd, const struct stat *st, const char *path, int *made_writable) { + int wfd = open(path, O_WRONLY | O_CLOEXEC); + if (wfd < 0 && errno == EACCES && fchmod(fd, (st->st_mode | S_IWUSR) & 07777) == 0) { + *made_writable = 1; + wfd = open(path, O_WRONLY | O_CLOEXEC); + } + return wfd; // ETXTBSY: the program is running right now, patched at its next start +} + +// The bytes of the added code for a given place: the code with its header (the strings, and where +// the scratch memory is), the instructions that connect the call site to it, and the trailer that +// says what was changed to put it there. +static void go_build_image(unsigned char *img, const struct gosys_hdr *strings, uint64_t cave_v, uint64_t scratch_v, + uint32_t to_entry, uint32_t back, const struct gosys_trailer *info) { + memcpy(img, gosys_blob, GOSYS_BLOB_SIZE); + struct gosys_hdr h = *strings; + h.scratch_rel = (int64_t)scratch_v - (int64_t)cave_v; + memcpy(img, &h, sizeof(h)); + unsigned char *th = img + GOSYS_THUNKS_OFF; + wr32(th + 0, 0xd10043ffu); // sub sp, sp, #16 + wr32(th + 4, 0xf90003feu); // str x30, [sp] + wr32(th + 8, 0xaa0803e7u); // mov x7, x8 (the number is the eighth argument) + wr32(th + 12, to_entry); // bl entry + wr32(th + 16, 0xf94003feu); // ldr x30, [sp] + wr32(th + 20, 0x910043ffu); // add sp, sp, #16 + wr32(th + 24, back); // b + struct gosys_trailer t; + memcpy(&t, img + GOSYS_BLOB_SIZE - sizeof(t), sizeof(t)); + t.version = GOSYS_VERSION; + t.total_size = GOSYS_BLOB_SIZE; + t.text_orig_filesz = info->text_orig_filesz; + t.text_orig_flags = info->text_orig_flags; + t.rw_orig_memsz = info->rw_orig_memsz; + t.text_index = info->text_index; + t.rw_index = info->rw_index; + t.site_file_off = info->site_file_off; + memcpy(img + GOSYS_BLOB_SIZE - sizeof(t), &t, sizeof(t)); +} + +// A short fingerprint of the added code, so that a program patched by an older The native userland is looked at +// again (the marker of a prepared program has it) +static uint32_t go_blob_fingerprint(void) { + static uint32_t fp; + if (fp == 0) { + uint32_t h = 2166136261u; + for (size_t i = 0; i < GOSYS_BLOB_SIZE; i++) h = (h ^ gosys_blob[i]) * 16777619u; + fp = h ? h : 1; + } + return fp; +} + +// Gives the program its old segments and call back: the added code is zeroed, the data segment +// is shortened, the instruction is a "svc #0" again. +static int go_undo(int wfd, struct go_ph *ph, int cave_seg, const struct gosys_trailer *tr, int64_t site_off) { + uint64_t cave_off = ph[cave_seg].offset + ph[cave_seg].filesz - tr->total_size; + unsigned char word[4]; + wr32(word, GO_SVC); + if (go_pwrite_all(wfd, word, 4, (uint64_t)site_off) != 0) return -1; + unsigned char sz[16]; + go_wr64(sz, tr->text_orig_filesz); + go_wr64(sz + 8, tr->text_orig_filesz); + if (go_pwrite_all(wfd, sz, 16, ph[cave_seg].pos + 32) != 0) return -1; + wr32(word, tr->text_orig_flags); + if (go_pwrite_all(wfd, word, 4, ph[cave_seg].pos + 4) != 0) return -1; + if (tr->rw_index < GO_MAX_PH) { + unsigned char mem[8]; + go_wr64(mem, tr->rw_orig_memsz); + if (go_pwrite_all(wfd, mem, 8, ph[tr->rw_index].pos + 40) != 0) return -1; + } + unsigned char *zero = (unsigned char *)calloc(1, tr->total_size); + if (!zero) return -1; + int rc = go_pwrite_all(wfd, zero, tr->total_size, cave_off); + free(zero); + return rc; +} + +// DDNATV_NO_GOSYS=1 (any value but empty or 0): no code is added to Go programs, and the code that is +// in one is taken out again, so that a program can be run as it was built, to see whether a fault +// is the program's or the code's. The marker of a prepared program says it (static_marker). +static int go_disabled(void) { + const char *v = getenv("DDNATV_NO_GOSYS"); + return v && v[0] != '\0' && strcmp(v, "0") != 0; +} + +// The three branches that connect the call site and the code: site -> thunk, thunk -> entry (bl), +// thunk -> the instruction after the site. 0 when one of them is too far. +static int go_branches(uint64_t cave_v, uint64_t site_v, uint32_t *to_thunk, uint32_t *to_entry, uint32_t *back) { + uint64_t thunk_v = cave_v + GOSYS_THUNKS_OFF; + *to_thunk = go_branch(0x14000000u, (int64_t)thunk_v - (int64_t)site_v); + *to_entry = go_branch(0x94000000u, (int64_t)(cave_v + GOSYS_ENTRY_OFF) - (int64_t)(thunk_v + 12)); + *back = go_branch(0x14000000u, (int64_t)(site_v + 4) - (int64_t)(thunk_v + 24)); + return *to_thunk && *to_entry && *back; +} + +// Adds the code to the program, or brings it up to date. Returns 1 when it changed the file, 0 when +// there was nothing to do (not a Go program of a kind the code can serve, or already done), -1 when +// the file could not be changed (it is started as it is). +static int prepare_go_program(int fd, const char *path, const struct stat *st) { + struct go_ph ph[GO_MAX_PH]; + uint16_t etype = 0, machine = 0; + int n = go_read_phdrs(fd, ph, &etype, &machine); + if (n < 0) return -1; + if (machine != EM_AARCH64 || (etype != GO_ET_EXEC && etype != GO_ET_DYN)) return 0; + + int found = 0; + int64_t site_off = go_find_syscall6(fd, ph, n, &found); + if (found != 1) return 0; // not a Go of 1.19 or newer (or its function is not there once) + + // The loadable segments, by address + int order[GO_MAX_PH], nl = 0; + for (int i = 0; i < n; i++) { + if (ph[i].type != 1 /* PT_LOAD */) continue; + int k = nl++; + while (k > 0 && ph[order[k - 1]].vaddr > ph[i].vaddr) { + order[k] = order[k - 1]; + k--; + } + order[k] = i; + } + if (nl < 2) return 0; + + // The call site must be in a segment that is mapped as code + uint64_t site_v = 0; + for (int i = 0; i < nl; i++) { + const struct go_ph *s = &ph[order[i]]; + if ((s->flags & GO_PF_X) && (uint64_t)site_off >= s->offset && (uint64_t)site_off < s->offset + s->filesz) + site_v = s->vaddr + ((uint64_t)site_off - s->offset); + } + if (site_v == 0) return 0; + + struct gosys_hdr strings; + memset(&strings, 0, sizeof(strings)); + memcpy(strings.magic, "CXGOSYS1", 8); + strings.version = GOSYS_VERSION; + if (go_make_header(&strings) != 0) return 0; + + unsigned char *img = (unsigned char *)malloc(GOSYS_BLOB_SIZE); + unsigned char *have = (unsigned char *)malloc(GOSYS_BLOB_SIZE); + if (!img || !have) { + free(img); + free(have); + return -1; + } + int wfd = -1, made_writable = 0, changed = 0, rc = 0; + unsigned char word[4]; + + // An earlier run's code: it ends the segment it is in, and says what it changed + int cave_seg = -1; + struct gosys_trailer tr; + memset(&tr, 0, sizeof(tr)); + for (int i = 0; i < nl && cave_seg < 0; i++) { + const struct go_ph *s = &ph[order[i]]; + if (s->filesz < sizeof(tr) + sizeof(struct gosys_hdr)) continue; + struct gosys_trailer t; + if (pread(fd, &t, sizeof(t), (off_t)(s->offset + s->filesz - sizeof(t))) != (ssize_t)sizeof(t)) continue; + if (memcmp(t.magic, "CXGOEND1", 8) != 0 || t.total_size > s->filesz || t.total_size < sizeof(t) + sizeof(struct gosys_hdr)) continue; + tr = t; + cave_seg = order[i]; + } + + if (go_disabled()) { + if (cave_seg >= 0) { + wfd = go_open_for_write(fd, st, path, &made_writable); + if (wfd < 0) { + rc = -1; + } else { + rc = go_undo(wfd, ph, cave_seg, &tr, site_off); + changed = rc == 0; + } + } + goto done; + } + + if (cave_seg >= 0) { + uint64_t cave_off = ph[cave_seg].offset + ph[cave_seg].filesz - tr.total_size; + uint64_t cave_v = ph[cave_seg].vaddr + (cave_off - ph[cave_seg].offset); + int same = 0, site_ok = 0; + uint32_t to_thunk = 0, to_entry = 0, back = 0; + // Is it what would be put there now? (the code of an older The native userland differs) + if (tr.total_size == GOSYS_BLOB_SIZE && tr.rw_index < (uint32_t)n && ph[tr.rw_index].type == 1 && + go_branches(cave_v, site_v, &to_thunk, &to_entry, &back)) { + uint64_t scratch_v = go_align_up(ph[tr.rw_index].vaddr + tr.rw_orig_memsz, 64); + go_build_image(img, &strings, cave_v, scratch_v, to_entry, back, &tr); + same = pread(fd, have, GOSYS_BLOB_SIZE, (off_t)cave_off) == (ssize_t)GOSYS_BLOB_SIZE && + memcmp(have, img, GOSYS_BLOB_SIZE) == 0 && + ph[tr.rw_index].memsz == scratch_v - ph[tr.rw_index].vaddr + GOSYS_SCRATCH_SIZE; + } + unsigned char cur[4]; + site_ok = same && pread(fd, cur, 4, (off_t)site_off) == 4 && rd32(cur) == to_thunk; + if (same && site_ok) goto done; + + wfd = go_open_for_write(fd, st, path, &made_writable); + if (wfd < 0) { + rc = -1; + goto done; + } + if (same) { + // The code is there, only the branch is not (a patch that was cut short) + wr32(word, to_thunk); + rc = go_pwrite_all(wfd, word, 4, (uint64_t)site_off); + changed = rc == 0; + goto done; + } + // An older code, or other strings: back to the plain program, then patch again + if (go_undo(wfd, ph, cave_seg, &tr, site_off) != 0) { + rc = -1; + goto done; + } + close(wfd); + wfd = -1; + if (made_writable) fchmod(fd, st->st_mode & 07777); + free(img); + free(have); + return prepare_go_program(fd, path, st); + } + + // A place for the code: the end of a segment that is followed by padding up to the next one + uint64_t total = GOSYS_BLOB_SIZE; + int text = -1; + uint64_t cave_v = 0, cave_off = 0; + for (int pass = 0; pass < 2 && text < 0; pass++) { + for (int k = 0; k + 1 < nl && text < 0; k++) { + const struct go_ph *s = &ph[order[k]], *nx = &ph[order[k + 1]]; + if (pass == 0 ? !(s->flags & GO_PF_X) : (s->flags & GO_PF_W)) continue; + if (s->memsz != s->filesz || s->filesz == 0) continue; + uint64_t v = go_align_up(s->vaddr + s->filesz, 64); + uint64_t off = s->offset + (v - s->vaddr); + if (v + total > nx->vaddr || (nx->vaddr & 0x3fff) != 0) continue; + if (off + total > nx->offset || off + total > (uint64_t)st->st_size) continue; + // Only padding may be written over + uint64_t pad_from = s->offset + s->filesz, pad_len = off + total - pad_from; + unsigned char *pad = (unsigned char *)malloc(pad_len); + if (!pad) continue; + int zero = pread(fd, pad, pad_len, (off_t)pad_from) == (ssize_t)pad_len; + for (uint64_t i = 0; zero && i < pad_len; i++) zero = pad[i] == 0; + free(pad); + if (!zero) continue; + text = order[k]; + cave_v = v; + cave_off = off; + } + } + int rw = order[nl - 1]; + uint32_t to_thunk = 0, to_entry = 0, back = 0; + if (text < 0 || !(ph[rw].flags & GO_PF_W) || rw == text || !go_branches(cave_v, site_v, &to_thunk, &to_entry, &back)) goto done; + + uint64_t scratch_v = go_align_up(ph[rw].vaddr + ph[rw].memsz, 64); + struct gosys_trailer info; + memset(&info, 0, sizeof(info)); + info.text_orig_filesz = ph[text].filesz; + info.text_orig_flags = ph[text].flags; + info.rw_orig_memsz = ph[rw].memsz; + info.text_index = (uint32_t)text; + info.rw_index = (uint32_t)rw; + info.site_file_off = (uint64_t)site_off; + go_build_image(img, &strings, cave_v, scratch_v, to_entry, back, &info); + + wfd = go_open_for_write(fd, st, path, &made_writable); + if (wfd < 0) { + rc = -1; + goto done; + } + // The code first and the call site last: whatever is cut short leaves a program that runs + unsigned char sz[16]; + unsigned char mem[8]; + go_wr64(mem, scratch_v - ph[rw].vaddr + GOSYS_SCRATCH_SIZE); + go_wr64(sz, cave_v + GOSYS_BLOB_SIZE - ph[text].vaddr); + go_wr64(sz + 8, cave_v + GOSYS_BLOB_SIZE - ph[text].vaddr); + rc = go_pwrite_all(wfd, img, GOSYS_BLOB_SIZE, cave_off); + if (rc == 0) rc = go_pwrite_all(wfd, mem, 8, ph[rw].pos + 40); + if (rc == 0) rc = go_pwrite_all(wfd, sz, 16, ph[text].pos + 32); + if (rc == 0 && !(ph[text].flags & GO_PF_X)) { + wr32(word, ph[text].flags | GO_PF_X); + rc = go_pwrite_all(wfd, word, 4, ph[text].pos + 4); + } + if (rc == 0) { + wr32(word, to_thunk); + rc = go_pwrite_all(wfd, word, 4, (uint64_t)site_off); + } + changed = rc == 0; + +done: + free(img); + free(have); + if (wfd >= 0) { + // Keep the times: make and friends must not see a rebuilt program. + const struct timespec times[2] = { st->st_atim, st->st_mtim }; + futimens(wfd, times); + close(wfd); + } + if (made_writable) fchmod(fd, st->st_mode & 07777); + if (rc != 0) return -1; + return changed ? 1 : 0; +} + +#endif /* DDNATV_HAVE_GOSYS */ diff --git a/tools/nativeguest/hook/hardlinks.c b/tools/nativeguest/hook/hardlinks.c new file mode 100644 index 0000000000..ed8a32f7b2 --- /dev/null +++ b/tools/nativeguest/hook/hardlinks.c @@ -0,0 +1,628 @@ +// Part of libddnatv-hook.so, included by ddnatv-hook.c (one translation unit, so the +// parts share their static functions and are built with the same command as before). +// +// Hard links: link() falls back to a copy that reports the link count of a real link, in every +// process of the rootfs. + +// Emulated hard links. Android does not let apps create hard links, so link() falls back to a copy +// (ddnatv_emulate_hardlinkat). Programs that check the result through the link count, such as the +// lock files of shadow (link(file.PID, file.lock), then stat(file.PID).st_nlink == 2), and those +// that look for files linked to each other (tar, rsync -H, du, find -samefile), are shown what a +// real link would give: every copy of one emulated link reports the inode number of the original +// and the number of copies as its link count. +// +// The copies are recorded in a table that every process of the rootfs maps +// ($DDNATV_ROOT/var/lib/ddnatv/hardlinks), so "ln a b" in one process and "stat a" in the next +// agree, also after the app restarts. Copies are recorded by device and inode, so a relative name, +// an absolute name and an open descriptor of the same file all match, and with their modification +// time: a copy written to since (it no longer shares the original's content) or a new file that got +// the inode number of a removed copy (removed outside the hook, e.g. in root mode) do not match. +// +// Readers (every stat) take no lock: a sequence number that writers make odd while they change the +// table tells them to read again. Writers (link, unlink, rename) take an fcntl lock on the file. +// Without a rootfs (or when the file cannot be made) the table is private to the process and its +// children, as it was before. + +#define DDNATV_HL_MAGIC 0x6b6e6c43u // "Clnk" +#define DDNATV_HL_VERSION 1u +#define DDNATV_HL_SLOTS 8192u // a power of two +#define DDNATV_HL_MAX_USED 6144u // at most 3/4 full, so that lookups stay short +#define DDNATV_HL_EMPTY 0u +#define DDNATV_HL_USED 1u +#define DDNATV_HL_DELETED 2u + +typedef struct { + uint64_t dev, ino; // this copy + int64_t mtime_sec, mtime_nsec; // its modification time when it was linked (compared in whole + // seconds: stat() and statx() need not agree on the fraction) + uint64_t group_dev, group_ino; // the original, whose inode number every copy reports + uint32_t state; + uint32_t nlink; // copies in the group + uint32_t pad[2]; +} ddnatv_hl_slot_t; + +typedef struct { + uint32_t magic, version; + uint32_t seq; // odd while a writer changes the table + uint32_t used, deleted; + uint32_t pad[11]; + ddnatv_hl_slot_t slots[DDNATV_HL_SLOTS]; +} ddnatv_hl_table_t; + +// The file and the mapping, in whole 64 KB: a size that is a multiple of every page size +#define DDNATV_HL_MAP_SIZE ((sizeof(ddnatv_hl_table_t) + 0xffff) & ~(size_t)0xffff) + +static ddnatv_hl_table_t *g_hl_table = NULL; // set once, then never changed (until a test resets it) +static int g_hl_shared = 0; // mapped from the rootfs' file +static long g_hl_next_try = 0; // when to look for the file again (monotonic seconds) +static pthread_mutex_t g_hardlinks_lock = PTHREAD_MUTEX_INITIALIZER; + +#ifndef DDNATV_HOST_TEST +static void init_ddnatv_hook(void); +#endif + +static size_t hl_table_path(char *buf, size_t size) { +#ifndef DDNATV_HOST_TEST + // The rootfs is known once a path was rewritten; "ln a b" or "stat a" name only relative ones + init_ddnatv_hook(); +#endif + if (g_ddnatv_root_len == 0) return 0; + size_t n = ddnatv_append(buf, size, 0, g_ddnatv_root, g_ddnatv_root_len); + static const char rel[] = "/var/lib/ddnatv/hardlinks"; + n = ddnatv_append(buf, size, n, rel, sizeof(rel) - 1); + return n == g_ddnatv_root_len + sizeof(rel) - 1 ? n : 0; +} + +static long hl_now_seconds(void) { + struct timespec ts; +#ifdef CLOCK_MONOTONIC_COARSE + if (clock_gettime(CLOCK_MONOTONIC_COARSE, &ts) == 0) return (long)ts.tv_sec; +#endif + if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) return (long)ts.tv_sec; + return 0; +} + +static int hl_open_file(const char *path, int create) { + return (int)syscall(SYS_openat, AT_FDCWD, path, O_RDWR | O_CLOEXEC | (create ? O_CREAT : 0), 0600); +} + +// Takes the writers' lock on the table's file (blocking); -1 when there is no file to lock. +static int hl_lock_file(void) { + if (!g_hl_shared) return -1; + char path[PATH_MAX]; + if (!hl_table_path(path, sizeof(path))) return -1; + int fd = hl_open_file(path, 0); + if (fd < 0) return -1; + struct flock fl; + memset(&fl, 0, sizeof(fl)); + fl.l_type = F_WRLCK; + fl.l_whence = SEEK_SET; + while (fcntl(fd, F_SETLKW, &fl) != 0 && errno == EINTR) { + } + return fd; +} + +static void hl_unlock_file(int fd) { + if (fd >= 0) syscall(SYS_close, fd); // closing the file drops the lock +} + +static void hl_init_header(ddnatv_hl_table_t *t) { + memset(t, 0, sizeof(*t)); + t->version = DDNATV_HL_VERSION; + __atomic_store_n(&t->magic, DDNATV_HL_MAGIC, __ATOMIC_RELEASE); +} + +// The size of an open file. Not fstat(): this library's own fstat() looks into the table, which +// would wait for the lock that the caller holds. +static off_t hl_file_size(int fd) { + return lseek(fd, 0, SEEK_END); +} + +// Maps the table. Readers (create = 0) get NULL while no process has made the file yet, and look +// for it again a second later; writers make it, or fall back to a table of this process. Readers +// never wait for the lock (a stat() while it is held, or in a child forked while another thread +// held it, would wait forever): they find no table then. +static ddnatv_hl_table_t *hl_table(int create) { + ddnatv_hl_table_t *t = __atomic_load_n(&g_hl_table, __ATOMIC_ACQUIRE); + if (t) return t; + if (!create && __atomic_load_n(&g_hl_next_try, __ATOMIC_RELAXED) > hl_now_seconds()) return NULL; + int saved_errno = errno; + if (create) { + pthread_mutex_lock(&g_hardlinks_lock); + } else if (pthread_mutex_trylock(&g_hardlinks_lock) != 0) { + errno = saved_errno; + return NULL; + } + t = g_hl_table; + if (!t) { + char path[PATH_MAX]; + path[0] = '\0'; + int have_path = hl_table_path(path, sizeof(path)) != 0; + int fd = have_path ? hl_open_file(path, 0) : -1; + if (fd < 0 && create && path[0]) { + // var/lib/ddnatv may not exist yet + char dir[PATH_MAX]; + size_t n = ddnatv_append(dir, sizeof(dir), 0, path, strlen(path) - strlen("/hardlinks")); + if (n > 0) syscall(SYS_mkdirat, AT_FDCWD, dir, 0700); + fd = hl_open_file(path, 1); + } + if (fd >= 0) { + off_t size = hl_file_size(fd); + int ok = size >= 0; + if (ok && (size_t)size < DDNATV_HL_MAP_SIZE) { + // New (or an older, shorter format): made by a writer, under the lock + ok = 0; + if (create) { + struct flock fl; + memset(&fl, 0, sizeof(fl)); + fl.l_type = F_WRLCK; + fl.l_whence = SEEK_SET; + while (fcntl(fd, F_SETLKW, &fl) != 0 && errno == EINTR) { + } + size = hl_file_size(fd); + ok = size >= 0 && + ((size_t)size >= DDNATV_HL_MAP_SIZE || ftruncate(fd, DDNATV_HL_MAP_SIZE) == 0); + } + } + if (ok) { + void *m = mmap(NULL, DDNATV_HL_MAP_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); + if (m != MAP_FAILED) { + t = (ddnatv_hl_table_t *)m; + if (t->magic != DDNATV_HL_MAGIC || t->version != DDNATV_HL_VERSION) { + if (create) { + // Still under the lock taken above when the file was new; otherwise take it + struct flock fl; + memset(&fl, 0, sizeof(fl)); + fl.l_type = F_WRLCK; + fl.l_whence = SEEK_SET; + while (fcntl(fd, F_SETLKW, &fl) != 0 && errno == EINTR) { + } + if (t->magic != DDNATV_HL_MAGIC || t->version != DDNATV_HL_VERSION) hl_init_header(t); + } else { + munmap(m, DDNATV_HL_MAP_SIZE); + t = NULL; + } + } + if (t) g_hl_shared = 1; + } + } + syscall(SYS_close, fd); // the mapping stays; also drops the lock + } + if (!t && create) { + // No rootfs file: this process and its children share a table + void *m = mmap(NULL, DDNATV_HL_MAP_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANONYMOUS, -1, 0); + if (m != MAP_FAILED) { + t = (ddnatv_hl_table_t *)m; + hl_init_header(t); + g_hl_shared = 0; + } + } + if (t) { + __atomic_store_n(&g_hl_table, t, __ATOMIC_RELEASE); + } else if (have_path) { + // No table yet: looked for again a second later (without a rootfs there is none to wait for) + __atomic_store_n(&g_hl_next_try, hl_now_seconds() + 1, __ATOMIC_RELAXED); + } + } + pthread_mutex_unlock(&g_hardlinks_lock); + errno = saved_errno; + return t; +} + +// Whether any emulated link may exist; what the stat() hooks check first. +static inline int hardlinks_maybe_any(void) { + ddnatv_hl_table_t *t = hl_table(0); + return t && __atomic_load_n(&t->used, __ATOMIC_RELAXED) > 0; +} + +static inline uint32_t hl_hash(uint64_t dev, uint64_t ino) { + uint64_t h = ino * 0x9E3779B97F4A7C15ull ^ (dev + 0x632BE59BD9B4E019ull) * 0xC2B2AE3D27D4EB4Full; + return (uint32_t)(h >> 40) & (DDNATV_HL_SLOTS - 1); +} + +// The slot of a copy, or -1. Writers only (under the locks). +static long hl_find_locked(ddnatv_hl_table_t *t, uint64_t dev, uint64_t ino) { + uint32_t i = hl_hash(dev, ino); + for (uint32_t n = 0; n < DDNATV_HL_SLOTS; n++, i = (i + 1) & (DDNATV_HL_SLOTS - 1)) { + ddnatv_hl_slot_t *s = &t->slots[i]; + if (s->state == DDNATV_HL_EMPTY) return -1; + if (s->state == DDNATV_HL_USED && s->ino == ino && s->dev == dev) return (long)i; + } + return -1; +} + +// Writers: the process' mutex, the file's lock, then the sequence number made odd. +static int hl_write_begin(ddnatv_hl_table_t *t) { + pthread_mutex_lock(&g_hardlinks_lock); + int fd = hl_lock_file(); + uint32_t seq = __atomic_load_n(&t->seq, __ATOMIC_RELAXED); + // An odd number left by a writer that died: the lock was given up with it + if (!(seq & 1)) seq++; + __atomic_store_n(&t->seq, seq, __ATOMIC_RELAXED); + __atomic_thread_fence(__ATOMIC_RELEASE); + return fd; +} + +static void hl_write_end(ddnatv_hl_table_t *t, int fd) { + __atomic_store_n(&t->seq, __atomic_load_n(&t->seq, __ATOMIC_RELAXED) + 1, __ATOMIC_RELEASE); + hl_unlock_file(fd); + pthread_mutex_unlock(&g_hardlinks_lock); +} + +// Rebuilds the table without the slots of removed copies, which make every lookup longer. +static void hl_compact_locked(ddnatv_hl_table_t *t) { + ddnatv_hl_slot_t *keep = (ddnatv_hl_slot_t *)malloc(sizeof(ddnatv_hl_slot_t) * DDNATV_HL_MAX_USED); + if (!keep) return; + uint32_t n = 0; + for (uint32_t i = 0; i < DDNATV_HL_SLOTS && n < DDNATV_HL_MAX_USED; i++) { + if (t->slots[i].state == DDNATV_HL_USED) keep[n++] = t->slots[i]; + } + memset(t->slots, 0, sizeof(t->slots)); + for (uint32_t k = 0; k < n; k++) { + uint32_t i = hl_hash(keep[k].dev, keep[k].ino); + while (t->slots[i].state != DDNATV_HL_EMPTY) i = (i + 1) & (DDNATV_HL_SLOTS - 1); + t->slots[i] = keep[k]; + } + t->used = n; + t->deleted = 0; + free(keep); +} + +static int hl_put_locked(ddnatv_hl_table_t *t, const struct stat *st, uint64_t group_dev, uint64_t group_ino) { + long i = hl_find_locked(t, st->st_dev, st->st_ino); + if (i < 0) { + if (t->used >= DDNATV_HL_MAX_USED) return -1; + if (t->used + t->deleted >= DDNATV_HL_SLOTS - DDNATV_HL_SLOTS / 8) hl_compact_locked(t); + uint32_t j = hl_hash(st->st_dev, st->st_ino); + while (t->slots[j].state == DDNATV_HL_USED) j = (j + 1) & (DDNATV_HL_SLOTS - 1); + if (t->slots[j].state == DDNATV_HL_DELETED) t->deleted--; + i = (long)j; + t->used++; + } + ddnatv_hl_slot_t *s = &t->slots[i]; + s->dev = st->st_dev; + s->ino = st->st_ino; + s->mtime_sec = st->st_mtim.tv_sec; + s->mtime_nsec = st->st_mtim.tv_nsec; + s->group_dev = group_dev; + s->group_ino = group_ino; + s->nlink = 1; + s->state = DDNATV_HL_USED; + return 0; +} + +static void hl_remove_locked(ddnatv_hl_table_t *t, long i) { + t->slots[i].state = DDNATV_HL_DELETED; + t->used--; + t->deleted++; +} + +// Gives every copy of a group its size; a group of one is a plain file again. +static void hl_update_group_locked(ddnatv_hl_table_t *t, uint64_t group_dev, uint64_t group_ino) { + uint32_t n = 0; + long last = -1; + for (uint32_t i = 0; i < DDNATV_HL_SLOTS; i++) { + ddnatv_hl_slot_t *s = &t->slots[i]; + if (s->state == DDNATV_HL_USED && s->group_ino == group_ino && s->group_dev == group_dev) { + n++; + last = (long)i; + } + } + if (n == 1) { + hl_remove_locked(t, last); + return; + } + for (uint32_t i = 0; i < DDNATV_HL_SLOTS && n > 1; i++) { + ddnatv_hl_slot_t *s = &t->slots[i]; + if (s->state == DDNATV_HL_USED && s->group_ino == group_ino && s->group_dev == group_dev) s->nlink = n; + } +} + +// Removes the copy in slot i. A group reports the inode number of one of its copies (the original); +// when that copy goes, the group reports another one's: the number of a removed file can be given to +// a new file, which must not show up as linked to the copies that are left. +static void hl_remove_copy_locked(ddnatv_hl_table_t *t, long i) { + uint64_t group_dev = t->slots[i].group_dev, group_ino = t->slots[i].group_ino; + int reported = t->slots[i].dev == group_dev && t->slots[i].ino == group_ino; + hl_remove_locked(t, i); + if (reported) { + uint64_t new_dev = 0, new_ino = 0; + int found = 0; + for (uint32_t j = 0; j < DDNATV_HL_SLOTS; j++) { + ddnatv_hl_slot_t *s = &t->slots[j]; + if (s->state != DDNATV_HL_USED || s->group_ino != group_ino || s->group_dev != group_dev) continue; + if (!found) { + new_dev = s->dev; + new_ino = s->ino; + found = 1; + } + s->group_dev = new_dev; + s->group_ino = new_ino; + } + if (found) { + group_dev = new_dev; + group_ino = new_ino; + } + } + hl_update_group_locked(t, group_dev, group_ino); +} + +// Records that the file [copy] is an emulated hard link of [old]. +static void register_emulated_hardlink(const struct stat *old, const struct stat *copy) { + ddnatv_hl_table_t *t = hl_table(1); + if (!t) return; + int saved_errno = errno; + int fd = hl_write_begin(t); + uint64_t group_dev = old->st_dev, group_ino = old->st_ino; + long i = hl_find_locked(t, old->st_dev, old->st_ino); + if (i >= 0 && t->slots[i].mtime_sec == old->st_mtim.tv_sec) { + // Linking a copy again: the new copy joins the same group + group_dev = t->slots[i].group_dev; + group_ino = t->slots[i].group_ino; + } else { + // A stale slot of an earlier file with this inode number + if (i >= 0) hl_remove_copy_locked(t, i); + hl_put_locked(t, old, group_dev, group_ino); + } + if (hl_put_locked(t, copy, group_dev, group_ino) == 0 || hl_find_locked(t, old->st_dev, old->st_ino) >= 0) { + hl_update_group_locked(t, group_dev, group_ino); + } + hl_write_end(t, fd); + errno = saved_errno; +} + +// Forgets a copy whose name was removed; the last copy of a group goes back to a plain file. +static void unregister_emulated_hardlink(dev_t dev, ino_t ino) { + ddnatv_hl_table_t *t = hl_table(0); + if (!t || __atomic_load_n(&t->used, __ATOMIC_RELAXED) == 0) return; + int saved_errno = errno; + int fd = hl_write_begin(t); + long i = hl_find_locked(t, dev, ino); + if (i >= 0) hl_remove_copy_locked(t, i); + hl_write_end(t, fd); + errno = saved_errno; +} + +// Reads the slot of a copy without a lock: 1 and [out] when there is one. +static int hl_read(ddnatv_hl_table_t *t, uint64_t dev, uint64_t ino, ddnatv_hl_slot_t *out) { + for (int tries = 0; tries < 64; tries++) { + uint32_t seq = __atomic_load_n(&t->seq, __ATOMIC_ACQUIRE); + if (seq & 1) { + sched_yield(); + continue; + } + int found = 0; + uint32_t i = hl_hash(dev, ino); + for (uint32_t n = 0; n < DDNATV_HL_SLOTS; n++, i = (i + 1) & (DDNATV_HL_SLOTS - 1)) { + const volatile ddnatv_hl_slot_t *s = &t->slots[i]; + uint32_t state = s->state; + if (state == DDNATV_HL_EMPTY) break; + if (state == DDNATV_HL_USED && s->ino == ino && s->dev == dev) { + memcpy(out, (const void *)s, sizeof(*out)); + found = 1; + break; + } + } + __atomic_thread_fence(__ATOMIC_ACQUIRE); + if (__atomic_load_n(&t->seq, __ATOMIC_RELAXED) == seq) return found; + } + return 0; // a writer that does not finish: as if there were no links +} + +// Makes a stat() result of an emulated hard link look like a real one: the inode number of the +// original and the number of copies as the link count. +static void apply_emulated_hardlink(struct stat *st) { + if (!st || !hardlinks_maybe_any()) return; + ddnatv_hl_slot_t s; + if (!hl_read(g_hl_table, st->st_dev, st->st_ino, &s)) return; + if (s.mtime_sec != (int64_t)st->st_mtim.tv_sec) return; + if (s.nlink > (uint32_t)st->st_nlink) st->st_nlink = (nlink_t)s.nlink; + st->st_ino = (ino_t)s.group_ino; +} + +// The app's own user and group, which the hook presents as root: getuid() and getpwuid() say so, +// and stat() does as well, so that a program that compares a file's owner with getuid() sees the +// files it made as its own (git's "dubious ownership", sshd's /run/sshd, tmux's socket directory, +// ssh's ~/.ssh/config). -1 until known; a test sets them. +static uid_t g_app_uid = (uid_t)-1; +static gid_t g_app_gid = (gid_t)-1; + +static void load_app_ids(void) { +#ifdef DDNATV_HOST_TEST + uid_t uid = getuid(); + gid_t gid = getgid(); +#else + // The real ones (getuid() and syscall() are the hook's own, which answer 0) + static uid_t (*orig_getuid)(void) = NULL; + static gid_t (*orig_getgid)(void) = NULL; + if (!orig_getuid) orig_getuid = (uid_t (*)(void))dlsym(RTLD_NEXT, "getuid"); + if (!orig_getgid) orig_getgid = (gid_t (*)(void))dlsym(RTLD_NEXT, "getgid"); + if (!orig_getuid || !orig_getgid) return; + uid_t uid = orig_getuid(); + gid_t gid = orig_getgid(); +#endif + __atomic_store_n(&g_app_gid, gid, __ATOMIC_RELAXED); + __atomic_store_n(&g_app_uid, uid, __ATOMIC_RELAXED); +} + +static void present_owner_as_root(uid_t *uid, gid_t *gid) { + if (__atomic_load_n(&g_app_uid, __ATOMIC_RELAXED) == (uid_t)-1) load_app_ids(); + uid_t app_uid = __atomic_load_n(&g_app_uid, __ATOMIC_RELAXED); + gid_t app_gid = __atomic_load_n(&g_app_gid, __ATOMIC_RELAXED); + if (app_uid == (uid_t)-1) return; + if (uid && *uid == app_uid) *uid = 0; + if (gid && *gid == app_gid) *gid = 0; +} + +// What the stat() family returns: emulated hard links as real ones, the app's files as root's. +static void apply_stat_emulation(struct stat *st) { + if (!st) return; + apply_emulated_hardlink(st); + present_owner_as_root(&st->st_uid, &st->st_gid); +} + +static int real_fstatat(int dirfd, const char *path, struct stat *st, int flags) { +#ifdef DDNATV_HOST_TEST + return fstatat(dirfd, path, st, flags); +#else + static int (*orig_fstatat)(int, const char *, struct stat *, int) = NULL; + if (!orig_fstatat) orig_fstatat = (int (*)(int, const char *, struct stat *, int))dlsym(RTLD_NEXT, "fstatat"); + return orig_fstatat ? orig_fstatat(dirfd, path, st, flags) : fstatat(dirfd, path, st, flags); +#endif +} + +// Before a name is removed or replaced (unlink, rename over it): whether it is an emulated hard +// link, and which. Costs nothing until the process has made one. +static int lookup_emulated_hardlink_at(int dirfd, const char *path, dev_t *dev, ino_t *ino) { + if (!path || !hardlinks_maybe_any()) return 0; + int saved_errno = errno; + struct stat st; + int found = 0; + if (real_fstatat(dirfd, path, &st, AT_SYMLINK_NOFOLLOW) == 0) { + ddnatv_hl_slot_t s; + found = hl_read(g_hl_table, st.st_dev, st.st_ino, &s); + *dev = st.st_dev; + *ino = st.st_ino; + } + errno = saved_errno; + return found; +} + +static int ddnatv_emulate_hardlinkat(int olddirfd, const char *rold, int newdirfd, const char *rnew) { + if (!rold || !rnew) { + errno = EINVAL; + return -1; + } + struct stat st; +#ifdef DDNATV_HOST_TEST + if (fstatat(olddirfd, rold, &st, 0) != 0) { + return -1; + } +#else + static int (*orig_fstatat)(int, const char *, struct stat *, int) = NULL; + if (!orig_fstatat) orig_fstatat = (int (*)(int, const char *, struct stat *, int))dlsym(RTLD_NEXT, "fstatat"); + if (orig_fstatat) { + if (orig_fstatat(olddirfd, rold, &st, 0) != 0) return -1; + } else { + if (fstatat(olddirfd, rold, &st, 0) != 0) return -1; + } +#endif + if (S_ISDIR(st.st_mode)) { + errno = EPERM; + return -1; + } + + // Clean up stale dangling symlink or stale dead-process lock file at rnew +#ifndef DDNATV_HOST_TEST + struct stat lst; + int have_lst = 0; + if (orig_fstatat) { + if (orig_fstatat(newdirfd, rnew, &lst, AT_SYMLINK_NOFOLLOW) == 0) have_lst = 1; + } else { + if (fstatat(newdirfd, rnew, &lst, AT_SYMLINK_NOFOLLOW) == 0) have_lst = 1; + } + if (have_lst) { + if (S_ISLNK(lst.st_mode)) { + unlinkat(newdirfd, rnew, 0); + } else if (strstr(rnew, ".lock")) { + static int (*orig_openat)(int, const char *, int, ...) = NULL; + if (!orig_openat) orig_openat = (int (*)(int, const char *, int, ...))dlsym(RTLD_NEXT, "openat"); + int rfd = orig_openat ? orig_openat(newdirfd, rnew, O_RDONLY | O_CLOEXEC) + : openat(newdirfd, rnew, O_RDONLY | O_CLOEXEC); + if (rfd >= 0) { + char pbuf[32] = {0}; + ssize_t pr = read(rfd, pbuf, sizeof(pbuf) - 1); + close(rfd); + if (pr > 0) { + pid_t lpid = (pid_t)atoi(pbuf); + if (lpid > 0 && kill(lpid, 0) == -1 && errno == ESRCH) { + unlinkat(newdirfd, rnew, 0); + } + } else { + unlinkat(newdirfd, rnew, 0); + } + } + } + } +#endif + +#ifdef DDNATV_HOST_TEST + int fd_new = openat(newdirfd, rnew, O_WRONLY | O_CREAT | O_EXCL | O_CLOEXEC, st.st_mode & 0777); + if (fd_new < 0) return -1; + int fd_old = openat(olddirfd, rold, O_RDONLY | O_CLOEXEC); +#else + static int (*orig_openat)(int, const char *, int, ...) = NULL; + if (!orig_openat) orig_openat = (int (*)(int, const char *, int, ...))dlsym(RTLD_NEXT, "openat"); + int fd_new = orig_openat ? orig_openat(newdirfd, rnew, O_WRONLY | O_CREAT | O_EXCL | O_CLOEXEC, st.st_mode & 0777) + : openat(newdirfd, rnew, O_WRONLY | O_CREAT | O_EXCL | O_CLOEXEC, st.st_mode & 0777); + if (fd_new < 0) return -1; + int fd_old = orig_openat ? orig_openat(olddirfd, rold, O_RDONLY | O_CLOEXEC) + : openat(olddirfd, rold, O_RDONLY | O_CLOEXEC); +#endif + if (fd_old < 0) { + int err = errno; + close(fd_new); + unlinkat(newdirfd, rnew, 0); + errno = err; + return -1; + } + + ssize_t sent = 0; + int copy_failed = 0; + while (sent < st.st_size) { + ssize_t s = sendfile(fd_new, fd_old, NULL, (size_t)(st.st_size - sent)); + if (s > 0) { + sent += s; + } else { + break; + } + } + if (sent < st.st_size) { + char cbuf[16384]; + ssize_t nread; + while ((nread = read(fd_old, cbuf, sizeof(cbuf))) > 0) { + ssize_t nwritten = 0; + while (nwritten < nread) { + ssize_t w = write(fd_new, cbuf + nwritten, nread - nwritten); + if (w < 0) { + copy_failed = 1; + break; + } + nwritten += w; + } + if (copy_failed) break; + } + if (nread < 0) copy_failed = 1; + } + + fchmod(fd_new, st.st_mode & 0777); + // A hard link shares the times of the original (tar, dpkg and make compare them). + const struct timespec times[2] = { st.st_atim, st.st_mtim }; + futimens(fd_new, times); + struct stat st_new; + memset(&st_new, 0, sizeof(st_new)); +#ifndef DDNATV_HOST_TEST + static int (*orig_fstat)(int, struct stat *) = NULL; + if (!orig_fstat) orig_fstat = (int (*)(int, struct stat *))dlsym(RTLD_NEXT, "fstat"); + if (orig_fstat) orig_fstat(fd_new, &st_new); + else fstat(fd_new, &st_new); +#else + fstat(fd_new, &st_new); +#endif + + close(fd_old); + close(fd_new); + + if (copy_failed) { + unlinkat(newdirfd, rnew, 0); + errno = EIO; + return -1; + } + + register_emulated_hardlink(&st, &st_new); + return 0; +} + +static inline int ddnatv_emulate_hardlink(const char *rold, const char *rnew) { + return ddnatv_emulate_hardlinkat(AT_FDCWD, rold, AT_FDCWD, rnew); +} diff --git a/tools/nativeguest/hook/identity.c b/tools/nativeguest/hook/identity.c new file mode 100644 index 0000000000..9599d7e0b2 --- /dev/null +++ b/tools/nativeguest/hook/identity.c @@ -0,0 +1,838 @@ +// Part of libddnatv-hook.so, included by ddnatv-hook.c (one translation unit, so the +// parts share their static functions and are built with the same command as before). +// +// Fake root: user and group ids, the shadow lock, and passwd/group lookups from the rootfs. + +#ifndef DDNATV_HOST_TEST + +// Fakeroot identity hooks for APT and DPKG to operate without superuser restrictions +uid_t getuid(void) { return 0; } +uid_t geteuid(void) { return 0; } +gid_t getgid(void) { return 0; } +gid_t getegid(void) { return 0; } + +int setuid(uid_t uid) { (void)uid; return 0; } +int seteuid(uid_t uid) { (void)uid; return 0; } +int setgid(gid_t gid) { (void)gid; return 0; } +int setegid(gid_t gid) { (void)gid; return 0; } +int setreuid(uid_t ruid, uid_t euid) { (void)ruid; (void)euid; return 0; } +int setregid(gid_t rgid, gid_t egid) { (void)rgid; (void)egid; return 0; } +int setresuid(uid_t ruid, uid_t euid, uid_t suid) { (void)ruid; (void)euid; (void)suid; return 0; } +int setresgid(gid_t rgid, gid_t egid, gid_t sgid) { (void)rgid; (void)egid; (void)sgid; return 0; } + +int getgroups(int size, gid_t list[]) { + if (size > 0 && list != NULL) list[0] = 0; + return 1; +} +// What programs built with _FORTIFY_SOURCE call when the buffer's size is known (the check is +// glibc's): without it the count came from the hook (1) and the list from the kernel (the app's +// groups, more than one), and sshd ended the login on "getgroups: Invalid argument" +extern void __chk_fail(void) __attribute__((__noreturn__)); +int __getgroups_chk(int size, gid_t list[], size_t listlen) { + if (size > 0 && (size_t)size * sizeof(gid_t) > listlen) __chk_fail(); + return getgroups(size, list); +} +int setgroups(size_t size, const gid_t *list) { (void)size; (void)list; return 0; } +int initgroups(const char *user, gid_t group) { (void)user; (void)group; return 0; } + +int getgrouplist(const char *user, gid_t group, gid_t *groups, int *ngroups) { + (void)user; + if (!ngroups) { + errno = EINVAL; + return -1; + } + if (*ngroups > 0 && groups) { + groups[0] = group; + *ngroups = 1; + return 1; + } + // Too small (a caller asking for the size first): -1 and the number needed, as glibc does. + *ngroups = 1; + return -1; +} + +// The session's host name, as proot's --kernel-release gave it: Steam names the device after it +int uname(struct utsname *buf) { + static int (*orig_uname)(struct utsname *) = NULL; + if (!orig_uname) orig_uname = (int (*)(struct utsname *))dlsym(RTLD_NEXT, "uname"); + int ret = orig_uname ? orig_uname(buf) : -1; + if (ret == 0 && buf && g_hostname[0]) { + ddnatv_copy_cstr(buf->nodename, sizeof(buf->nodename), g_hostname); + ddnatv_copy_cstr(buf->domainname, sizeof(buf->domainname), "localdomain"); + } + return ret; +} + +int gethostname(char *name, size_t len) { + static int (*orig_gethostname)(char *, size_t) = NULL; + if (!orig_gethostname) orig_gethostname = (int (*)(char *, size_t))dlsym(RTLD_NEXT, "gethostname"); + if (!g_hostname[0]) return orig_gethostname ? orig_gethostname(name, len) : -1; + size_t n = strlen(g_hostname) + 1; + if (!name || n > len) { + if (name && len) memcpy(name, g_hostname, len); + errno = ENAMETOOLONG; + return -1; + } + memcpy(name, g_hostname, n); + return 0; +} + +#endif /* !DDNATV_HOST_TEST */ + +static uid_t real_uid(void) { +#ifdef DDNATV_HOST_TEST + return 10000; +#else + static uid_t (*orig_getuid)(void) = NULL; + if (!orig_getuid) orig_getuid = (uid_t (*)(void))dlsym(RTLD_NEXT, "getuid"); + return orig_getuid ? orig_getuid() : 0; +#endif +} + +static gid_t real_gid(void) { +#ifdef DDNATV_HOST_TEST + return 10000; +#else + static gid_t (*orig_getgid)(void) = NULL; + if (!orig_getgid) orig_getgid = (gid_t (*)(void))dlsym(RTLD_NEXT, "getgid"); + return orig_getgid ? orig_getgid() : 0; +#endif +} + +#ifdef DDNATV_HOST_TEST +#define DDNATV_NSS_SYM(name) hook_##name +#define DDNATV_SHADOW_SYM(name) hook_##name +static int g_test_orig_nss_r_ret = 0; +static int g_test_orig_nss_r_found = 0; + +int hook_link(const char *oldpath, const char *newpath) { + int ret = link(oldpath, newpath); + if (ret != 0 && (errno == EXDEV || errno == EPERM || errno == EACCES || errno == ENOTSUP || errno == ENOSYS)) { + ret = ddnatv_emulate_hardlink(oldpath, newpath); + } + return ret; +} + +int hook_linkat(int olddirfd, const char *oldpath, int newdirfd, const char *newpath, int flags) { + int ret = linkat(olddirfd, oldpath, newdirfd, newpath, flags); + if (ret != 0 && (errno == EXDEV || errno == EPERM || errno == EACCES || errno == ENOTSUP || errno == ENOSYS)) { + ret = ddnatv_emulate_hardlinkat(olddirfd, oldpath, newdirfd, newpath); + } + return ret; +} + +int hook_stat(const char *path, struct stat *st) { + int ret = stat(path, st); + if (ret == 0) apply_stat_emulation(st); + return ret; +} + +int hook_unlink(const char *path) { + dev_t hl_dev = 0; + ino_t hl_ino = 0; + int hardlinked = lookup_emulated_hardlink_at(AT_FDCWD, path, &hl_dev, &hl_ino); + int ret = unlink(path); + if (ret == 0 && hardlinked) unregister_emulated_hardlink(hl_dev, hl_ino); + return ret; +} +#else +#define DDNATV_NSS_SYM(name) name +#define DDNATV_SHADOW_SYM(name) name +#endif + +// Hook lckpwdf and ulckpwdf (shadow password database locking) +// In glibc, lckpwdf() attempts to open /etc/.pwd.lock directly using internal syscalls +// which fails with EROFS on Android because host /etc is mounted read-only. +static int g_pwd_lock_fd = -1; +static pthread_mutex_t g_pwd_lock_mutex = PTHREAD_MUTEX_INITIALIZER; + +int DDNATV_SHADOW_SYM(lckpwdf)(void) { +#ifndef DDNATV_HOST_TEST + init_ddnatv_hook(); + pthread_mutex_lock(&g_pwd_lock_mutex); + if (g_pwd_lock_fd != -1) { + pthread_mutex_unlock(&g_pwd_lock_mutex); + return 0; // Already locked + } + char buf[PATH_MAX]; + const char *target = rewrite_path("/etc/.pwd.lock", buf, sizeof(buf)); + static int (*orig_open)(const char *, int, ...) = NULL; + if (!orig_open) orig_open = (int (*)(const char *, int, ...))dlsym(RTLD_NEXT, "open"); + if (orig_open && target) { + g_pwd_lock_fd = orig_open(target, O_WRONLY | O_CREAT | O_CLOEXEC, 0600); + if (g_pwd_lock_fd >= 0) { + struct flock fl; + memset(&fl, 0, sizeof(fl)); + fl.l_type = F_WRLCK; + fl.l_whence = SEEK_SET; + if (fcntl(g_pwd_lock_fd, F_SETLK, &fl) != 0) { + int saved = errno; + close(g_pwd_lock_fd); + g_pwd_lock_fd = -1; + pthread_mutex_unlock(&g_pwd_lock_mutex); + errno = saved; + return -1; + } + } + } + if (g_pwd_lock_fd < 0) { + g_pwd_lock_fd = -2; // In-memory lock held + } + pthread_mutex_unlock(&g_pwd_lock_mutex); +#endif + return 0; +} + +int DDNATV_SHADOW_SYM(ulckpwdf)(void) { +#ifndef DDNATV_HOST_TEST + pthread_mutex_lock(&g_pwd_lock_mutex); + if (g_pwd_lock_fd >= 0) { + close(g_pwd_lock_fd); + } + g_pwd_lock_fd = -1; + pthread_mutex_unlock(&g_pwd_lock_mutex); +#endif + return 0; +} + + +// Group lookup helper: reads $DDNATV_ROOT/etc/group or falls back to known entries +static int ddnatv_lookup_group(const char *search_name, gid_t search_gid, int by_name, + struct group *grp, char *buf, size_t buflen) { + if (!grp || !buf || buflen < 64) { + return ERANGE; + } + + int found = 0; + char found_name[64] = {0}; + char found_pass[32] = {0}; + gid_t found_gid = 0; + char found_members[256] = {0}; + + // 1. Try reading /etc/group from The native userland rootfs +#ifndef DDNATV_HOST_TEST + char path_buf[PATH_MAX]; + const char *grp_path = rewrite_path("/etc/group", path_buf, sizeof(path_buf)); + static int (*orig_open)(const char *, int, ...) = NULL; + if (!orig_open) orig_open = (int (*)(const char *, int, ...))dlsym(RTLD_NEXT, "open"); + int fd = (orig_open && grp_path) ? orig_open(grp_path, O_RDONLY | O_CLOEXEC) : -1; + if (fd >= 0) { + char file_buf[8192]; + ssize_t n = read(fd, file_buf, sizeof(file_buf) - 1); + close(fd); + if (n > 0) { + file_buf[n] = '\0'; + char *line = file_buf; + while (*line && !found) { + char *next_line = strchr(line, '\n'); + if (next_line) { + *next_line = '\0'; + } + size_t llen = strlen(line); + if (llen > 0 && line[llen - 1] == '\r') line[llen - 1] = '\0'; + + // format: name:pass:gid:members + char *p1 = strchr(line, ':'); + if (p1) { + *p1 = '\0'; + char *p2 = strchr(p1 + 1, ':'); + if (p2) { + *p2 = '\0'; + char *p3 = strchr(p2 + 1, ':'); + if (p3) { + *p3 = '\0'; + const char *gname = line; + const char *gpass = p1 + 1; + gid_t ggid = (gid_t)strtoul(p2 + 1, NULL, 10); + const char *gmem = p3 + 1; + + if (by_name && search_name && strcmp(gname, search_name) == 0) { + snprintf(found_name, sizeof(found_name), "%s", gname); + snprintf(found_pass, sizeof(found_pass), "%s", gpass); + found_gid = ggid; + snprintf(found_members, sizeof(found_members), "%s", gmem); + found = 1; + } else if (!by_name && ggid == search_gid) { + snprintf(found_name, sizeof(found_name), "%s", gname); + snprintf(found_pass, sizeof(found_pass), "%s", gpass); + found_gid = ggid; + snprintf(found_members, sizeof(found_members), "%s", gmem); + found = 1; + } + } + } + } + if (!next_line) break; + line = next_line + 1; + } + } + } +#endif + + // 2. Fallbacks for well-known groups if absent from file + if (!found) { + if (by_name) { + if (!search_name) return ENOENT; + if (strcmp(search_name, "root") == 0 || strcmp(search_name, "ddnatv") == 0) { + snprintf(found_name, sizeof(found_name), "%s", search_name); + snprintf(found_pass, sizeof(found_pass), "x"); + found_gid = 0; + snprintf(found_members, sizeof(found_members), "%s", search_name); + found = 1; + } else if (strcmp(search_name, "_ssh") == 0) { + snprintf(found_name, sizeof(found_name), "_ssh"); + snprintf(found_pass, sizeof(found_pass), "x"); + found_gid = 100; + found = 1; + } else if (strcmp(search_name, "ssh") == 0) { + snprintf(found_name, sizeof(found_name), "ssh"); + snprintf(found_pass, sizeof(found_pass), "x"); + found_gid = 101; + found = 1; + } else if (strcmp(search_name, "nogroup") == 0 || strcmp(search_name, "nobody") == 0) { + snprintf(found_name, sizeof(found_name), "%s", search_name); + snprintf(found_pass, sizeof(found_pass), "x"); + found_gid = 65534; + found = 1; + } + } else { + if (search_gid == 0 || search_gid == real_gid()) { + snprintf(found_name, sizeof(found_name), "root"); + snprintf(found_pass, sizeof(found_pass), "x"); + found_gid = search_gid; + snprintf(found_members, sizeof(found_members), "root"); + found = 1; + } + } + } + + if (!found) { + return ENOENT; + } + + // 3. Assemble struct group into caller's buf + size_t mem_ptr_count = 1; + char *m_copy = found_members; + while (*m_copy) { + if (*m_copy == ',') mem_ptr_count++; + m_copy++; + } + if (found_members[0] != '\0') mem_ptr_count++; + + size_t mem_array_bytes = (mem_ptr_count + 1) * sizeof(char *); + mem_array_bytes = (mem_array_bytes + sizeof(void *) - 1) & ~(sizeof(void *) - 1); + + size_t name_len = strlen(found_name) + 1; + size_t pass_len = strlen(found_pass) + 1; + size_t mem_str_len = strlen(found_members) + 1; + + if (mem_array_bytes + name_len + pass_len + mem_str_len > buflen) { + return ERANGE; + } + + char **mem_array = (char **)buf; + char *str_cursor = buf + mem_array_bytes; + + grp->gr_name = str_cursor; + memcpy(str_cursor, found_name, name_len); + str_cursor += name_len; + + grp->gr_passwd = str_cursor; + memcpy(str_cursor, found_pass, pass_len); + str_cursor += pass_len; + + grp->gr_gid = found_gid; + + size_t m_idx = 0; + if (found_members[0] != '\0') { + char *m_tok = str_cursor; + memcpy(str_cursor, found_members, mem_str_len); + str_cursor += mem_str_len; + + char *curr = m_tok; + while (curr && *curr) { + char *comma = strchr(curr, ','); + if (comma) { + *comma = '\0'; + } + if (*curr) { + mem_array[m_idx++] = curr; + } + curr = comma ? comma + 1 : NULL; + } + } + mem_array[m_idx] = NULL; + grp->gr_mem = mem_array; + + return 0; +} + +// Passwd lookup helper: reads $DDNATV_ROOT/etc/passwd or falls back to known entries +static int ddnatv_lookup_passwd(const char *search_name, uid_t search_uid, int by_name, + struct passwd *pwd, char *buf, size_t buflen) { + if (!pwd || !buf || buflen < 128) { + return ERANGE; + } + + int found = 0; + char found_name[64] = {0}; + char found_pass[32] = {0}; + uid_t found_uid = 0; + gid_t found_gid = 0; + char found_gecos[64] = {0}; + char found_dir[128] = {0}; + char found_shell[64] = {0}; + + // 1. Try reading /etc/passwd from The native userland rootfs +#ifndef DDNATV_HOST_TEST + char path_buf[PATH_MAX]; + const char *pwd_path = rewrite_path("/etc/passwd", path_buf, sizeof(path_buf)); + static int (*orig_open)(const char *, int, ...) = NULL; + if (!orig_open) orig_open = (int (*)(const char *, int, ...))dlsym(RTLD_NEXT, "open"); + int fd = (orig_open && pwd_path) ? orig_open(pwd_path, O_RDONLY | O_CLOEXEC) : -1; + if (fd >= 0) { + char file_buf[8192]; + ssize_t n = read(fd, file_buf, sizeof(file_buf) - 1); + close(fd); + if (n > 0) { + file_buf[n] = '\0'; + char *line = file_buf; + while (*line && !found) { + char *next_line = strchr(line, '\n'); + if (next_line) { + *next_line = '\0'; + } + size_t llen = strlen(line); + if (llen > 0 && line[llen - 1] == '\r') line[llen - 1] = '\0'; + + // format: name:pass:uid:gid:gecos:dir:shell + char *f[7] = {0}; + char *curr = line; + int f_idx = 0; + while (curr && f_idx < 7) { + f[f_idx++] = curr; + char *col = strchr(curr, ':'); + if (col && f_idx < 7) { + *col = '\0'; + curr = col + 1; + } else { + break; + } + } + if (f_idx >= 7) { + const char *uname = f[0]; + const char *upass = f[1]; + uid_t uuid = (uid_t)strtoul(f[2], NULL, 10); + gid_t ugid = (gid_t)strtoul(f[3], NULL, 10); + const char *ugecos = f[4]; + const char *udir = f[5]; + const char *ushell = f[6]; + + if (by_name && search_name && strcmp(uname, search_name) == 0) { + snprintf(found_name, sizeof(found_name), "%s", uname); + snprintf(found_pass, sizeof(found_pass), "%s", upass); + found_uid = uuid; + found_gid = ugid; + snprintf(found_gecos, sizeof(found_gecos), "%s", ugecos); + snprintf(found_dir, sizeof(found_dir), "%s", udir); + snprintf(found_shell, sizeof(found_shell), "%s", ushell); + found = 1; + } else if (!by_name && uuid == search_uid) { + snprintf(found_name, sizeof(found_name), "%s", uname); + snprintf(found_pass, sizeof(found_pass), "%s", upass); + found_uid = uuid; + found_gid = ugid; + snprintf(found_gecos, sizeof(found_gecos), "%s", ugecos); + snprintf(found_dir, sizeof(found_dir), "%s", udir); + snprintf(found_shell, sizeof(found_shell), "%s", ushell); + found = 1; + } + } + if (!next_line) break; + line = next_line + 1; + } + } + } +#endif + + // 2. Fallbacks for well-known users if absent from file + if (!found) { + if (by_name) { + if (!search_name) return ENOENT; + if (strcmp(search_name, "root") == 0) { + snprintf(found_name, sizeof(found_name), "root"); + snprintf(found_pass, sizeof(found_pass), "x"); + found_uid = 0; + found_gid = 0; + snprintf(found_gecos, sizeof(found_gecos), "root"); + snprintf(found_dir, sizeof(found_dir), "/root"); + snprintf(found_shell, sizeof(found_shell), "/bin/bash"); + found = 1; + } else if (strcmp(search_name, "ddnatv") == 0) { + snprintf(found_name, sizeof(found_name), "ddnatv"); + snprintf(found_pass, sizeof(found_pass), "x"); + found_uid = 0; + found_gid = 0; + snprintf(found_gecos, sizeof(found_gecos), "The native userland"); + snprintf(found_dir, sizeof(found_dir), "/home/ddnatv"); + snprintf(found_shell, sizeof(found_shell), "/bin/bash"); + found = 1; + } else if (strcmp(search_name, "_ssh") == 0) { + snprintf(found_name, sizeof(found_name), "_ssh"); + snprintf(found_pass, sizeof(found_pass), "x"); + found_uid = 100; + found_gid = 100; + snprintf(found_gecos, sizeof(found_gecos), "OpenSSH daemon"); + snprintf(found_dir, sizeof(found_dir), "/run/sshd"); + snprintf(found_shell, sizeof(found_shell), "/usr/sbin/nologin"); + found = 1; + } else if (strcmp(search_name, "sshd") == 0) { + snprintf(found_name, sizeof(found_name), "sshd"); + snprintf(found_pass, sizeof(found_pass), "x"); + found_uid = 101; + found_gid = 101; + snprintf(found_gecos, sizeof(found_gecos), "Privilege-separated SSH"); + snprintf(found_dir, sizeof(found_dir), "/run/sshd"); + snprintf(found_shell, sizeof(found_shell), "/usr/sbin/nologin"); + found = 1; + } else if (strcmp(search_name, "nobody") == 0) { + snprintf(found_name, sizeof(found_name), "nobody"); + snprintf(found_pass, sizeof(found_pass), "x"); + found_uid = 65534; + found_gid = 65534; + snprintf(found_gecos, sizeof(found_gecos), "nobody"); + snprintf(found_dir, sizeof(found_dir), "/nonexistent"); + snprintf(found_shell, sizeof(found_shell), "/usr/sbin/nologin"); + found = 1; + } + } else { + if (search_uid == 0 || search_uid == real_uid()) { + snprintf(found_name, sizeof(found_name), "root"); + snprintf(found_pass, sizeof(found_pass), "x"); + found_uid = search_uid; + found_gid = 0; + snprintf(found_gecos, sizeof(found_gecos), "root"); + snprintf(found_dir, sizeof(found_dir), "/home"); + snprintf(found_shell, sizeof(found_shell), "/bin/bash"); + found = 1; + } + } + } + + if (!found) { + return ENOENT; + } + + // 3. Assemble struct passwd into caller's buf + size_t name_len = strlen(found_name) + 1; + size_t pass_len = strlen(found_pass) + 1; + size_t gecos_len = strlen(found_gecos) + 1; + size_t dir_len = strlen(found_dir) + 1; + size_t shell_len = strlen(found_shell) + 1; + + size_t total_str_bytes = name_len + pass_len + gecos_len + dir_len + shell_len; + if (total_str_bytes > buflen) { + return ERANGE; + } + + char *str_cursor = buf; + + pwd->pw_name = str_cursor; + memcpy(str_cursor, found_name, name_len); + str_cursor += name_len; + + pwd->pw_passwd = str_cursor; + memcpy(str_cursor, found_pass, pass_len); + str_cursor += pass_len; + + pwd->pw_uid = found_uid; + pwd->pw_gid = found_gid; + + pwd->pw_gecos = str_cursor; + memcpy(str_cursor, found_gecos, gecos_len); + str_cursor += gecos_len; + + pwd->pw_dir = str_cursor; + memcpy(str_cursor, found_dir, dir_len); + str_cursor += dir_len; + + pwd->pw_shell = str_cursor; + memcpy(str_cursor, found_shell, shell_len); + str_cursor += shell_len; + + return 0; +} + +#ifndef DDNATV_HOST_TEST +// The shadow database (/etc/shadow) of the rootfs. libc reads the real /etc/shadow of the machine, +// which Android does not have: pam_unix's account check for root found no entry and answered +// "Authentication failure", so chfn, chsh and `adduser --gecos` (the installation of PostgreSQL) +// failed. The fields are "name:hash:lastchange:min:max:warn:inactive:expire:flag", numbers empty +// when unset (libc stores -1 then). +static int ddnatv_lookup_shadow(const char *name, struct spwd *sp, char *buf, size_t buflen) { + if (!name || !sp || !buf) return EINVAL; + char path_buf[PATH_MAX]; + const char *path = rewrite_path("/etc/shadow", path_buf, sizeof(path_buf)); + static int (*orig_open)(const char *, int, ...) = NULL; + if (!orig_open) orig_open = (int (*)(const char *, int, ...))dlsym(RTLD_NEXT, "open"); + int fd = (orig_open && path) ? orig_open(path, O_RDONLY | O_CLOEXEC) : -1; + if (fd < 0) return ENOENT; + FILE *f = fdopen(fd, "r"); + if (!f) { + close(fd); + return ENOENT; + } + size_t name_len = strlen(name); + char line[1024]; + int err = ENOENT; + while (fgets(line, sizeof(line), f)) { + if (strncmp(line, name, name_len) != 0 || line[name_len] != ':') continue; + line[strcspn(line, "\r\n")] = '\0'; + char *fields[9] = {0}; + int n = 0; + char *cursor = line; + while (n < 9) { + fields[n++] = cursor; + char *colon = strchr(cursor, ':'); + if (!colon) break; + *colon = '\0'; + cursor = colon + 1; + } + size_t need = strlen(fields[0]) + 1 + strlen(fields[1] ? fields[1] : "") + 1; + if (n < 2 || need > buflen) { + err = n < 2 ? ENOENT : ERANGE; + break; + } + char *out = buf; + sp->sp_namp = out; + memcpy(out, fields[0], strlen(fields[0]) + 1); + out += strlen(fields[0]) + 1; + sp->sp_pwdp = out; + memcpy(out, fields[1], strlen(fields[1]) + 1); + long number[6]; + for (int i = 0; i < 6; i++) { + const char *v = (2 + i < n) ? fields[2 + i] : NULL; + number[i] = (v && v[0] != '\0') ? strtol(v, NULL, 10) : -1; + } + sp->sp_lstchg = number[0]; + sp->sp_min = number[1]; + sp->sp_max = number[2]; + sp->sp_warn = number[3]; + sp->sp_inact = number[4]; + sp->sp_expire = number[5]; + sp->sp_flag = (8 < n && fields[8][0] != '\0') ? strtoul(fields[8], NULL, 10) : (unsigned long)-1; + err = 0; + break; + } + fclose(f); + return err; +} + +int getspnam_r(const char *name, struct spwd *spbuf, char *buf, size_t buflen, struct spwd **result) { + static int (*orig_getspnam_r)(const char *, struct spwd *, char *, size_t, struct spwd **) = NULL; + if (!orig_getspnam_r) orig_getspnam_r = (int (*)(const char *, struct spwd *, char *, size_t, struct spwd **))dlsym(RTLD_NEXT, "getspnam_r"); + int ret = ENOENT; + if (orig_getspnam_r) { + ret = orig_getspnam_r(name, spbuf, buf, buflen, result); + if ((ret == 0 && result && *result) || ret == ERANGE) return ret; + } + int err = ddnatv_lookup_shadow(name, spbuf, buf, buflen); + if (err == 0) { + if (result) *result = spbuf; + return 0; + } + if (result) *result = NULL; + return err == ENOENT ? (ret != 0 ? ret : ENOENT) : err; +} + +struct spwd *getspnam(const char *name) { + static struct spwd entry; + static char entry_buf[1024]; + struct spwd *found = NULL; + int err = getspnam_r(name, &entry, entry_buf, sizeof(entry_buf), &found); + if (err != 0) { + errno = err; + return NULL; + } + return found; +} +#endif /* !DDNATV_HOST_TEST */ + +static struct group s_grp_storage; +static char s_grp_buf[2048]; +static struct passwd s_pwd_storage; +static char s_pwd_buf[2048]; + +struct group *DDNATV_NSS_SYM(getgrgid)(gid_t gid) { +#ifndef DDNATV_HOST_TEST + static struct group *(*orig_getgrgid)(gid_t) = NULL; + if (!orig_getgrgid) orig_getgrgid = (struct group *(*)(gid_t))dlsym(RTLD_NEXT, "getgrgid"); + struct group *res = orig_getgrgid ? orig_getgrgid(gid) : NULL; + if (res) return res; +#endif + + int err = ddnatv_lookup_group(NULL, gid, 0, &s_grp_storage, s_grp_buf, sizeof(s_grp_buf)); + if (err == 0) return &s_grp_storage; + return NULL; +} + +struct group *DDNATV_NSS_SYM(getgrnam)(const char *name) { +#ifndef DDNATV_HOST_TEST + static struct group *(*orig_getgrnam)(const char *) = NULL; + if (!orig_getgrnam) orig_getgrnam = (struct group *(*)(const char *))dlsym(RTLD_NEXT, "getgrnam"); + struct group *res = orig_getgrnam ? orig_getgrnam(name) : NULL; + if (res) return res; +#endif + + int err = ddnatv_lookup_group(name, 0, 1, &s_grp_storage, s_grp_buf, sizeof(s_grp_buf)); + if (err == 0) return &s_grp_storage; + return NULL; +} + +int DDNATV_NSS_SYM(getgrgid_r)(gid_t gid, struct group *grp, char *buf, size_t buflen, struct group **result) { +#ifndef DDNATV_HOST_TEST + static int (*orig_getgrgid_r)(gid_t, struct group *, char *, size_t, struct group **) = NULL; + if (!orig_getgrgid_r) orig_getgrgid_r = (int (*)(gid_t, struct group *, char *, size_t, struct group **))dlsym(RTLD_NEXT, "getgrgid_r"); + int ret = orig_getgrgid_r ? orig_getgrgid_r(gid, grp, buf, buflen, result) : ENOENT; +#else + int ret = g_test_orig_nss_r_ret; + if (result) *result = (ret == 0 && g_test_orig_nss_r_found) ? grp : NULL; +#endif + if (ret == 0 && result && *result != NULL) return 0; + if (ret != 0 && ret != ENOENT) { + if (result) *result = NULL; + return ret; + } + + int err = ddnatv_lookup_group(NULL, gid, 0, grp, buf, buflen); + if (err == 0) { + if (result) *result = grp; + return 0; + } + if (result) *result = NULL; + return (err == ERANGE) ? ERANGE : 0; +} + +int DDNATV_NSS_SYM(getgrnam_r)(const char *name, struct group *grp, char *buf, size_t buflen, struct group **result) { +#ifndef DDNATV_HOST_TEST + static int (*orig_getgrnam_r)(const char *, struct group *, char *, size_t, struct group **) = NULL; + if (!orig_getgrnam_r) orig_getgrnam_r = (int (*)(const char *, struct group *, char *, size_t, struct group **))dlsym(RTLD_NEXT, "getgrnam_r"); + int ret = orig_getgrnam_r ? orig_getgrnam_r(name, grp, buf, buflen, result) : ENOENT; +#else + int ret = g_test_orig_nss_r_ret; + if (result) *result = (ret == 0 && g_test_orig_nss_r_found) ? grp : NULL; +#endif + if (ret == 0 && result && *result != NULL) return 0; + if (ret != 0 && ret != ENOENT) { + if (result) *result = NULL; + return ret; + } + + int err = ddnatv_lookup_group(name, 0, 1, grp, buf, buflen); + if (err == 0) { + if (result) *result = grp; + return 0; + } + if (result) *result = NULL; + return (err == ERANGE) ? ERANGE : 0; +} + +// sshd's privilege-separated user is root's ids: The native userland cannot drop privileges (setuid() and +// setgid() only pretend to), and sshd's unprivileged part checks after dropping them that it cannot +// take them back, which ended it ("permanently_set_uid: was able to restore old [e]gid"). Like apt's +// sandbox user (APT::Sandbox::User "root"), it then runs as the rest does. +// +// The app's own ids are root's as well: the rootfs lists root with them for proot, and a server +// that allows "localuser:root" compares getpwnam("root") with a peer's credentials, which the hook +// reports as 0. Xwayland refused gamescope's own connection when the two disagreed. +static struct passwd *present_privsep_user_as_root(struct passwd *pwd) { + if (pwd && pwd->pw_name && strcmp(pwd->pw_name, "sshd") == 0) { + pwd->pw_uid = 0; + pwd->pw_gid = 0; + } + if (pwd && pwd->pw_uid == real_uid()) pwd->pw_uid = 0; + if (pwd && pwd->pw_gid == real_gid()) pwd->pw_gid = 0; + return pwd; +} + +struct passwd *DDNATV_NSS_SYM(getpwuid)(uid_t uid) { +#ifndef DDNATV_HOST_TEST + static struct passwd *(*orig_getpwuid)(uid_t) = NULL; + if (!orig_getpwuid) orig_getpwuid = (struct passwd *(*)(uid_t))dlsym(RTLD_NEXT, "getpwuid"); + struct passwd *res = orig_getpwuid ? orig_getpwuid(uid) : NULL; + if (res) return present_privsep_user_as_root(res); +#endif + + int err = ddnatv_lookup_passwd(NULL, uid, 0, &s_pwd_storage, s_pwd_buf, sizeof(s_pwd_buf)); + if (err == 0) return present_privsep_user_as_root(&s_pwd_storage); + return NULL; +} + +struct passwd *DDNATV_NSS_SYM(getpwnam)(const char *name) { +#ifndef DDNATV_HOST_TEST + static struct passwd *(*orig_getpwnam)(const char *) = NULL; + if (!orig_getpwnam) orig_getpwnam = (struct passwd *(*)(const char *))dlsym(RTLD_NEXT, "getpwnam"); + struct passwd *res = orig_getpwnam ? orig_getpwnam(name) : NULL; + if (res) return present_privsep_user_as_root(res); +#endif + + int err = ddnatv_lookup_passwd(name, 0, 1, &s_pwd_storage, s_pwd_buf, sizeof(s_pwd_buf)); + if (err == 0) return present_privsep_user_as_root(&s_pwd_storage); + return NULL; +} + +int DDNATV_NSS_SYM(getpwuid_r)(uid_t uid, struct passwd *pwd, char *buf, size_t buflen, struct passwd **result) { +#ifndef DDNATV_HOST_TEST + static int (*orig_getpwuid_r)(uid_t, struct passwd *, char *, size_t, struct passwd **) = NULL; + if (!orig_getpwuid_r) orig_getpwuid_r = (int (*)(uid_t, struct passwd *, char *, size_t, struct passwd **))dlsym(RTLD_NEXT, "getpwuid_r"); + int ret = orig_getpwuid_r ? orig_getpwuid_r(uid, pwd, buf, buflen, result) : ENOENT; +#else + int ret = g_test_orig_nss_r_ret; + if (result) *result = (ret == 0 && g_test_orig_nss_r_found) ? pwd : NULL; +#endif + if (ret == 0 && result && *result != NULL) { + present_privsep_user_as_root(*result); + return 0; + } + if (ret != 0 && ret != ENOENT) { + if (result) *result = NULL; + return ret; + } + + int err = ddnatv_lookup_passwd(NULL, uid, 0, pwd, buf, buflen); + if (err == 0) { + present_privsep_user_as_root(pwd); + if (result) *result = pwd; + return 0; + } + if (result) *result = NULL; + return (err == ERANGE) ? ERANGE : 0; +} + +int DDNATV_NSS_SYM(getpwnam_r)(const char *name, struct passwd *pwd, char *buf, size_t buflen, struct passwd **result) { +#ifndef DDNATV_HOST_TEST + static int (*orig_getpwnam_r)(const char *, struct passwd *, char *, size_t, struct passwd **) = NULL; + if (!orig_getpwnam_r) orig_getpwnam_r = (int (*)(const char *, struct passwd *, char *, size_t, struct passwd **))dlsym(RTLD_NEXT, "getpwnam_r"); + int ret = orig_getpwnam_r ? orig_getpwnam_r(name, pwd, buf, buflen, result) : ENOENT; +#else + int ret = g_test_orig_nss_r_ret; + if (result) *result = (ret == 0 && g_test_orig_nss_r_found) ? pwd : NULL; +#endif + if (ret == 0 && result && *result != NULL) { + present_privsep_user_as_root(*result); + return 0; + } + if (ret != 0 && ret != ENOENT) { + if (result) *result = NULL; + return ret; + } + + int err = ddnatv_lookup_passwd(name, 0, 1, pwd, buf, buflen); + if (err == 0) { + present_privsep_user_as_root(pwd); + if (result) *result = pwd; + return 0; + } + if (result) *result = NULL; + return (err == ERANGE) ? ERANGE : 0; +} diff --git a/tools/nativeguest/hook/net.c b/tools/nativeguest/hook/net.c new file mode 100644 index 0000000000..19424c5796 --- /dev/null +++ b/tools/nativeguest/hook/net.c @@ -0,0 +1,1054 @@ +// Part of libddnatv-hook.so, included by ddnatv-hook.c (one translation unit, so the +// parts share their static functions and are built with the same command as before). +// +// Name resolution: DNS packets, the network's DNS servers, the fallback resolver, getaddrinfo() +// and the resolver state, and DNS queries to loopback redirected to a real server. + +// ---- DNS packets and servers ------------------------------------------------------------- +// Pure functions (no syscalls apart from if_nametoindex), so tests/native can check them directly. + +#define DDNATV_DNS_TYPE_A 1 +#define DDNATV_DNS_TYPE_AAAA 28 +#define DDNATV_DNS_MAX_SERVERS 8 + +typedef struct { + struct sockaddr_storage addr; + socklen_t len; +} ddnatv_dns_server_t; + +// Fills `server` with the DNS server `text` (an IPv4 or IPv6 address, IPv6 optionally with a +// "%interface" scope) on port 53. Returns 0 for loopback and unspecified addresses (nothing answers +// there on Android), for a link-local IPv6 address without a scope, and for anything invalid. +static int dns_server_from_string(const char *text, ddnatv_dns_server_t *server) { + memset(server, 0, sizeof(*server)); + if (!text) return 0; + struct in_addr a4; + if (inet_pton(AF_INET, text, &a4) == 1) { + if ((ntohl(a4.s_addr) >> 24) == 127 || a4.s_addr == 0) return 0; + struct sockaddr_in *sin = (struct sockaddr_in *)&server->addr; + sin->sin_family = AF_INET; + sin->sin_port = htons(53); + sin->sin_addr = a4; + server->len = sizeof(*sin); + return 1; + } + char host[INET6_ADDRSTRLEN + IF_NAMESIZE + 2]; + if (strlen(text) >= sizeof(host)) return 0; + strcpy(host, text); + unsigned int scope = 0; + char *pct = strchr(host, '%'); + if (pct) { + *pct++ = '\0'; + if (*pct >= '0' && *pct <= '9') { + scope = (unsigned int)strtoul(pct, NULL, 10); + } else { + scope = if_nametoindex(pct); + } + } + struct in6_addr a6; + if (inet_pton(AF_INET6, host, &a6) != 1) return 0; + if (IN6_IS_ADDR_LOOPBACK(&a6) || IN6_IS_ADDR_UNSPECIFIED(&a6)) return 0; + if (IN6_IS_ADDR_V4MAPPED(&a6) && (a6.s6_addr[12] == 127 || (a6.s6_addr[12] | a6.s6_addr[13] | a6.s6_addr[14] | a6.s6_addr[15]) == 0)) return 0; + if (IN6_IS_ADDR_LINKLOCAL(&a6) && scope == 0) return 0; + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)&server->addr; + sin6->sin6_family = AF_INET6; + sin6->sin6_port = htons(53); + sin6->sin6_addr = a6; + sin6->sin6_scope_id = scope; + server->len = sizeof(*sin6); + return 1; +} + +// The "nameserver" lines of a resolv.conf, in order: up to `max` usable servers, IPv4 and IPv6. +static int parse_nameservers(const char *text, ddnatv_dns_server_t *out, int max) { + int count = 0; + const char *line = text; + while (line && *line && count < max) { + const char *next = strchr(line, '\n'); + size_t len = next ? (size_t)(next - line) : strlen(line); + char buf[256]; + if (len >= sizeof(buf)) len = sizeof(buf) - 1; + memcpy(buf, line, len); + buf[len] = '\0'; + char *p = buf; + while (*p == ' ' || *p == '\t') p++; + if (strncmp(p, "nameserver", 10) == 0 && (p[10] == ' ' || p[10] == '\t')) { + p += 10; + while (*p == ' ' || *p == '\t') p++; + char *end = p; + while (*end && *end != ' ' && *end != '\t' && *end != '\r' && *end != '#' && *end != ';') end++; + *end = '\0'; + if (dns_server_from_string(p, &out[count])) count++; + } + line = next ? next + 1 : NULL; + } + return count; +} + +static int dns_server_equal(const ddnatv_dns_server_t *a, const ddnatv_dns_server_t *b) { + return a->len == b->len && memcmp(&a->addr, &b->addr, a->len) == 0; +} + +// Builds a recursive query for one name and record type; returns its length, or -1 when the name +// is not a valid DNS name (an empty label, a label over 63 bytes, over 253 bytes in all). +static int dns_build_query(const char *name, int qtype, uint16_t txid, unsigned char *packet, size_t size) { + if (!name || !packet || size < 12) return -1; + size_t name_len = strlen(name); + if (name_len > 0 && name[name_len - 1] == '.') name_len--; // "example.com." is absolute + if (name_len == 0 || name_len > 253) return -1; + memset(packet, 0, 12); + packet[0] = (unsigned char)(txid >> 8); + packet[1] = (unsigned char)(txid & 0xff); + packet[2] = 0x01; // recursion desired + packet[5] = 0x01; // one question + size_t pos = 12; + size_t start = 0; + for (;;) { + size_t end = start; + while (end < name_len && name[end] != '.') end++; + size_t len = end - start; + if (len == 0 || len > 63 || pos + 1 + len + 1 + 4 > size) return -1; + packet[pos++] = (unsigned char)len; + memcpy(packet + pos, name + start, len); + pos += len; + if (end == name_len) break; + start = end + 1; + } + packet[pos++] = 0; + packet[pos++] = (unsigned char)(qtype >> 8); + packet[pos++] = (unsigned char)(qtype & 0xff); + packet[pos++] = 0x00; + packet[pos++] = 0x01; // class IN + return (int)pos; +} + +// Offset after the (possibly compressed) name at `off`, or -1 when it is malformed. +static int dns_skip_name(const unsigned char *msg, int n, int off) { + for (int labels = 0; labels < 128; labels++) { + if (off >= n) return -1; + unsigned char len = msg[off]; + if (len == 0) return off + 1; + if ((len & 0xc0) == 0xc0) return off + 2 <= n ? off + 2 : -1; + if (len & 0xc0) return -1; + off += 1 + len; + } + return -1; +} + +// Copies the first address of type `qtype` (4 bytes for A, 16 for AAAA) from the reply `msg` to the +// query `txid` and returns 0. Returns 1 when the reply says there is no such address (the name does +// not exist, or has no record of that type): asking other servers would only send the name to more +// of them. Returns -1 for anything that is worth asking another server about: a failure (SERVFAIL, +// REFUSED), a truncated, malformed or foreign reply. +static int dns_parse_answer(const unsigned char *msg, int n, uint16_t txid, int qtype, unsigned char *out) { + if (!msg || n < 12) return -1; + if (((msg[0] << 8) | msg[1]) != txid) return -1; + if (!(msg[2] & 0x80)) return -1; // not a reply + int rcode = msg[3] & 0x0f; + if (rcode == 3) return 1; // NXDOMAIN + if (rcode != 0) return -1; + int qdcount = (msg[4] << 8) | msg[5]; + int ancount = (msg[6] << 8) | msg[7]; + int off = 12; + for (int q = 0; q < qdcount; q++) { + off = dns_skip_name(msg, n, off); + if (off < 0 || off + 4 > n) return -1; + off += 4; + } + int want = qtype == DDNATV_DNS_TYPE_AAAA ? 16 : 4; + for (int a = 0; a < ancount; a++) { + off = dns_skip_name(msg, n, off); + if (off < 0 || off + 10 > n) return -1; + int rtype = (msg[off] << 8) | msg[off + 1]; + int rclass = (msg[off + 2] << 8) | msg[off + 3]; + int rdlen = (msg[off + 8] << 8) | msg[off + 9]; + off += 10; + if (off + rdlen > n) return -1; + if (rtype == qtype && rclass == 1 && rdlen == want) { + memcpy(out, msg + off, (size_t)want); + return 0; + } + off += rdlen; + } + return (msg[2] & 0x02) ? -1 : 1; // no such record, unless the reply was truncated +} + +// ---- Sockets bound to a port the program chose ---------------------------------------------- +// Which descriptors are TCP/UDP sockets that bind() gave a port the program asked for (not 0, +// where the kernel picks one). listen() reports only those to the app, which connects to a +// reported port to see whether it serves web pages (sockets.c). Descriptors past the bitmap +// are taken as not chosen: they are not reported. +#define DDNATV_CHOSEN_PORT_FDS 65536 +static unsigned char g_chosen_port_fds[DDNATV_CHOSEN_PORT_FDS / 8]; + +static void set_chosen_port_fd(int fd, int chosen) { + if (fd < 0 || fd >= DDNATV_CHOSEN_PORT_FDS) return; + unsigned char bit = (unsigned char)(1u << (fd & 7)); + // Written only when it changes: a page of the bitmap is copied for a forked child only then + if (chosen) { + if (!(__atomic_load_n(&g_chosen_port_fds[fd >> 3], __ATOMIC_RELAXED) & bit)) + __atomic_fetch_or(&g_chosen_port_fds[fd >> 3], bit, __ATOMIC_RELAXED); + } else if (__atomic_load_n(&g_chosen_port_fds[fd >> 3], __ATOMIC_RELAXED) & bit) { + __atomic_fetch_and(&g_chosen_port_fds[fd >> 3], (unsigned char)~bit, __ATOMIC_RELAXED); + } +} + +static int is_chosen_port_fd(int fd) { + if (fd < 0 || fd >= DDNATV_CHOSEN_PORT_FDS) return 0; + return (__atomic_load_n(&g_chosen_port_fds[fd >> 3], __ATOMIC_RELAXED) >> (fd & 7)) & 1; +} + +#ifndef DDNATV_HOST_TEST + +// DNS resolution hooking and localhost DNS redirect +#define DNS_REDIRECT_MAX 64 +static struct { + int fd; + struct sockaddr_storage orig; + socklen_t orig_len; + uint32_t active; +} g_dns_redirects[DNS_REDIRECT_MAX]; +static pthread_mutex_t g_dns_redirect_mutex = PTHREAD_MUTEX_INITIALIZER; + +static void record_dns_redirect(int fd, const struct sockaddr *orig, socklen_t orig_len) { + if (fd < 0 || !orig) return; + if (orig_len > sizeof(struct sockaddr_storage)) orig_len = sizeof(struct sockaddr_storage); + pthread_mutex_lock(&g_dns_redirect_mutex); + int target_idx = (fd >= 0 ? fd : -fd) % DNS_REDIRECT_MAX; + g_dns_redirects[target_idx].fd = fd; + memcpy(&g_dns_redirects[target_idx].orig, orig, orig_len); + g_dns_redirects[target_idx].orig_len = orig_len; + g_dns_redirects[target_idx].active = 1; + pthread_mutex_unlock(&g_dns_redirect_mutex); +} + +static void clear_dns_redirect(int fd) { + if (fd < 0) return; + int target_idx = (fd >= 0 ? fd : -fd) % DNS_REDIRECT_MAX; + if (!g_dns_redirects[target_idx].active || g_dns_redirects[target_idx].fd != fd) { + return; + } + pthread_mutex_lock(&g_dns_redirect_mutex); + if (g_dns_redirects[target_idx].active && g_dns_redirects[target_idx].fd == fd) { + g_dns_redirects[target_idx].active = 0; + g_dns_redirects[target_idx].fd = -1; + g_dns_redirects[target_idx].orig_len = 0; + } + pthread_mutex_unlock(&g_dns_redirect_mutex); +} + +int close(int fd) { + static int (*orig_close)(int) = NULL; + if (!orig_close) orig_close = (int (*)(int))dlsym(RTLD_NEXT, "close"); + // The ARM translator's memory file (privileged.c): left open, as if it were closed + if (g_kept_fd_count > 0 && is_kept_fd(fd)) return 0; + clear_dns_redirect(fd); + set_chosen_port_fd(fd, 0); + return orig_close ? orig_close(fd) : -1; +} + +int dup2(int oldfd, int newfd) { + static int (*orig_dup2)(int, int) = NULL; + if (!orig_dup2) orig_dup2 = (int (*)(int, int))dlsym(RTLD_NEXT, "dup2"); + if (oldfd != newfd) { + clear_dns_redirect(newfd); + set_chosen_port_fd(newfd, is_chosen_port_fd(oldfd)); + } + return orig_dup2 ? orig_dup2(oldfd, newfd) : -1; +} + +int dup3(int oldfd, int newfd, int flags) { + static int (*orig_dup3)(int, int, int) = NULL; + if (!orig_dup3) orig_dup3 = (int (*)(int, int, int))dlsym(RTLD_NEXT, "dup3"); + if (oldfd != newfd) { + clear_dns_redirect(newfd); + set_chosen_port_fd(newfd, is_chosen_port_fd(oldfd)); + } + return orig_dup3 ? orig_dup3(oldfd, newfd, flags) : -1; +} + +static int get_dns_redirect(int fd, struct sockaddr_storage *orig, socklen_t *orig_len) { + if (fd < 0) return 0; + int found = 0; + pthread_mutex_lock(&g_dns_redirect_mutex); + int target_idx = (fd >= 0 ? fd : -fd) % DNS_REDIRECT_MAX; + if (g_dns_redirects[target_idx].active && g_dns_redirects[target_idx].fd == fd) { + if (orig) *orig = g_dns_redirects[target_idx].orig; + if (orig_len) *orig_len = g_dns_redirects[target_idx].orig_len; + found = 1; + } + pthread_mutex_unlock(&g_dns_redirect_mutex); + return found; +} + +// A DNS query to 127.0.0.0/8 or ::1 (or ::ffff:127.x), where nothing listens on Android. +static inline int is_loopback_dns(const struct sockaddr *addr, socklen_t addrlen) { + if (!addr || addrlen < sizeof(sa_family_t)) return 0; + if (addr->sa_family == AF_INET && addrlen >= sizeof(struct sockaddr_in)) { + const struct sockaddr_in *sin = (const struct sockaddr_in *)addr; + return (sin->sin_port == htons(53) && ((ntohl(sin->sin_addr.s_addr) >> 24) == 127)); + } + if (addr->sa_family == AF_INET6 && addrlen >= sizeof(struct sockaddr_in6)) { + const struct sockaddr_in6 *sin6 = (const struct sockaddr_in6 *)addr; + if (sin6->sin6_port != htons(53)) return 0; + return IN6_IS_ADDR_LOOPBACK(&sin6->sin6_addr) || + (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr) && sin6->sin6_addr.s6_addr[12] == 127); + } + return 0; +} + +static in_addr_t get_primary_dns(void) { + static in_addr_t cached_dns = 0; + static time_t last_check = 0; + static pthread_mutex_t dns_mutex = PTHREAD_MUTEX_INITIALIZER; + + struct timespec ts; + clock_gettime(CLOCK_MONOTONIC, &ts); + time_t now = ts.tv_sec; + + // Fast path: cached value valid within 5s TTL + if (cached_dns != 0 && (now - last_check < 5)) { + return cached_dns; + } + + pthread_mutex_lock(&dns_mutex); + if (cached_dns != 0 && (now - last_check < 5)) { + in_addr_t val = cached_dns; + pthread_mutex_unlock(&dns_mutex); + return val; + } + last_check = now; + + in_addr_t new_dns = 0; + init_ddnatv_hook(); + + // 1. Check Android system property net.dns1 via Bionic libc + static int (*orig_sys_prop_get)(const char *, char *) = NULL; + static int prop_lookup_done = 0; + if (!prop_lookup_done) { + orig_sys_prop_get = (int (*)(const char *, char *))dlsym(RTLD_DEFAULT, "__system_property_get"); + prop_lookup_done = 1; + } + if (orig_sys_prop_get) { + char prop_val[256]; + if (orig_sys_prop_get("net.dns1", prop_val) > 0 && prop_val[0] != '\0') { + struct in_addr a; + if (inet_aton(prop_val, &a)) { + if ((ntohl(a.s_addr) >> 24) != 127 && a.s_addr != 0) { + new_dns = a.s_addr; + } + } + } + } + + // 2. Parse /etc/resolv.conf in The native userland rootfs + char resolv_path[PATH_MAX]; + if (g_ddnatv_root[0] != '\0') { + snprintf(resolv_path, sizeof(resolv_path), "%s/etc/resolv.conf", g_ddnatv_root); + } else { + snprintf(resolv_path, sizeof(resolv_path), "/etc/resolv.conf"); + } + + struct stat st; + if (stat(resolv_path, &st) == 0) { + if (new_dns == 0) { + FILE *f = fopen(resolv_path, "r"); + if (f) { + char line[256]; + while (fgets(line, sizeof(line), f)) { + char *p = line; + while (*p == ' ' || *p == '\t') p++; + if (strncmp(p, "nameserver", 10) == 0) { + p += 10; + while (*p == ' ' || *p == '\t') p++; + char *end = p; + while (*end && *end != ' ' && *end != '\t' && *end != '\r' && *end != '\n') end++; + *end = '\0'; + struct in_addr a; + if (inet_aton(p, &a)) { + // Only accept valid, non-loopback DNS servers + if ((ntohl(a.s_addr) >> 24) != 127 && a.s_addr != 0) { + new_dns = a.s_addr; + break; + } + } + } + } + fclose(f); + } + } + } + + if (new_dns == 0) { + new_dns = inet_addr("8.8.8.8"); + } + + cached_dns = new_dns; + pthread_mutex_unlock(&dns_mutex); + return cached_dns; +} + + +// The DNS servers in the rootfs resolv.conf (which the app writes from Android's network settings), +// read again at most every 5 seconds. +static int get_dns_servers(ddnatv_dns_server_t *out, int max) { + static ddnatv_dns_server_t cached[DDNATV_DNS_MAX_SERVERS]; + static int cached_count = 0; + static time_t last_check = 0; + static int checked = 0; + static pthread_mutex_t servers_mutex = PTHREAD_MUTEX_INITIALIZER; + + struct timespec ts; + clock_gettime(CLOCK_MONOTONIC, &ts); + pthread_mutex_lock(&servers_mutex); + if (!checked || ts.tv_sec - last_check >= 5) { + checked = 1; + last_check = ts.tv_sec; + init_ddnatv_hook(); + char path[PATH_MAX]; + snprintf(path, sizeof(path), "%s/etc/resolv.conf", g_ddnatv_root[0] ? g_ddnatv_root : ""); + char text[4096]; + ssize_t n = -1; + int fd = open(path, O_RDONLY | O_CLOEXEC); + if (fd >= 0) { + n = read(fd, text, sizeof(text) - 1); + close(fd); + } + text[n > 0 ? n : 0] = '\0'; + cached_count = parse_nameservers(text, cached, DDNATV_DNS_MAX_SERVERS); + } + int count = cached_count < max ? cached_count : max; + memcpy(out, cached, (size_t)count * sizeof(cached[0])); + pthread_mutex_unlock(&servers_mutex); + return count; +} + +// Where a DNS query to a loopback address goes instead: the network's DNS server, in the family of +// the socket (an IPv6 socket gets the first IPv6 server, else the IPv4 one as ::ffff:a.b.c.d). +// Returns the length of the address written to `out`. +static socklen_t dns_redirect_target(const struct sockaddr *orig, struct sockaddr_storage *out) { + memset(out, 0, sizeof(*out)); + if (orig->sa_family == AF_INET) { + memcpy(out, orig, sizeof(struct sockaddr_in)); + ((struct sockaddr_in *)out)->sin_addr.s_addr = get_primary_dns(); + return sizeof(struct sockaddr_in); + } + struct sockaddr_in6 *dst = (struct sockaddr_in6 *)out; + memcpy(dst, orig, sizeof(*dst)); + ddnatv_dns_server_t servers[DDNATV_DNS_MAX_SERVERS]; + int n = get_dns_servers(servers, DDNATV_DNS_MAX_SERVERS); + for (int i = 0; i < n; i++) { + if (servers[i].addr.ss_family == AF_INET6) { + const struct sockaddr_in6 *s6 = (const struct sockaddr_in6 *)&servers[i].addr; + dst->sin6_addr = s6->sin6_addr; + dst->sin6_scope_id = s6->sin6_scope_id; + return sizeof(*dst); + } + } + in_addr_t v4 = get_primary_dns(); + memset(&dst->sin6_addr, 0, sizeof(dst->sin6_addr)); + dst->sin6_addr.s6_addr[10] = 0xff; + dst->sin6_addr.s6_addr[11] = 0xff; + memcpy(&dst->sin6_addr.s6_addr[12], &v4, 4); + dst->sin6_scope_id = 0; + return sizeof(*dst); +} + +// Puts the loopback address that a DNS socket was redirected from back into the source address of a +// reply (`cap` is the size of the caller's buffer), so resolvers that check the sender accept it. +static void restore_dns_source(int fd, struct sockaddr *addr, socklen_t cap, socklen_t *len) { + if (!addr || cap < sizeof(sa_family_t)) return; + in_port_t port; + if (addr->sa_family == AF_INET && cap >= sizeof(struct sockaddr_in)) { + port = ((const struct sockaddr_in *)addr)->sin_port; + } else if (addr->sa_family == AF_INET6 && cap >= sizeof(struct sockaddr_in6)) { + port = ((const struct sockaddr_in6 *)addr)->sin6_port; + } else { + return; + } + if (port != htons(53)) return; + struct sockaddr_storage orig; + socklen_t orig_len = 0; + if (!get_dns_redirect(fd, &orig, &orig_len) || orig.ss_family != addr->sa_family) return; + memcpy(addr, &orig, orig_len < cap ? orig_len : cap); + if (len) *len = orig_len; +} + +#define DDNATV_ADDRINFO_MAGIC 0x434f5254 + +// One addrinfo for an IPv4 (4 bytes) or IPv6 (16 bytes) address; freed by the freeaddrinfo hook. +static struct addrinfo *alloc_addrinfo(const char *node, int family, const void *addr, int port, int socktype, int protocol) { + struct addrinfo *ai = (struct addrinfo *)calloc(1, sizeof(struct addrinfo)); + if (!ai) return NULL; + socklen_t len = family == AF_INET6 ? sizeof(struct sockaddr_in6) : sizeof(struct sockaddr_in); + void *sa = calloc(1, len); + if (!sa) { + free(ai); + return NULL; + } + if (family == AF_INET6) { + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa; + sin6->sin6_family = AF_INET6; + sin6->sin6_port = htons((uint16_t)port); + memcpy(&sin6->sin6_addr, addr, 16); + } else { + struct sockaddr_in *sin = (struct sockaddr_in *)sa; + sin->sin_family = AF_INET; + sin->sin_port = htons((uint16_t)port); + memcpy(&sin->sin_addr, addr, 4); + } + + ai->ai_flags = DDNATV_ADDRINFO_MAGIC; + ai->ai_family = family; + ai->ai_socktype = socktype ? socktype : SOCK_STREAM; + ai->ai_protocol = protocol; + ai->ai_addrlen = len; + ai->ai_addr = (struct sockaddr *)sa; + ai->ai_canonname = node ? strdup(node) : NULL; + ai->ai_next = NULL; + return ai; +} + +static uint16_t generate_dns_txid(void) { + uint16_t txid = 0; + static ssize_t (*libc_getrandom)(void *, size_t, unsigned int) = NULL; + static int getrandom_checked = 0; + if (!getrandom_checked) { + libc_getrandom = (ssize_t (*)(void *, size_t, unsigned int))dlsym(RTLD_DEFAULT, "getrandom"); + getrandom_checked = 1; + } + if (libc_getrandom) { + if (libc_getrandom(&txid, sizeof(txid), 1 /* GRND_NONBLOCK */) == sizeof(txid) && txid != 0) { + return txid; + } + } +#if defined(SYS_getrandom) || defined(__NR_getrandom) +#ifndef __NR_getrandom +#define __NR_getrandom SYS_getrandom +#endif + long r = syscall(__NR_getrandom, &txid, sizeof(txid), 1 /* GRND_NONBLOCK */); + if (r == (long)sizeof(txid) && txid != 0) { + return txid; + } +#endif + struct timespec ts; + clock_gettime(CLOCK_MONOTONIC, &ts); + uint32_t val = (uint32_t)(ts.tv_nsec ^ (ts.tv_sec << 16) ^ (uintptr_t)&txid); + txid = (uint16_t)((val & 0xffff) ^ (val >> 16)); + if (txid == 0) txid = 0x5a6b; + return txid; +} + +static void add_dns_server(ddnatv_dns_server_t *list, int *count, int max, const ddnatv_dns_server_t *server) { + if (*count >= max) return; + for (int i = 0; i < *count; i++) { + if (dns_server_equal(&list[i], server)) return; + } + list[(*count)++] = *server; +} + +// Looks one address of `name` up itself, for when glibc found none: asks the network's DNS servers, +// then public ones (IPv4 first, then IPv6, for IPv6-only networks without IPv4 translation), and +// stops at the first that answers. `qtype` is DDNATV_DNS_TYPE_A (4 bytes into `out`) or +// DDNATV_DNS_TYPE_AAAA (16 bytes). `*server` is -1 to ask them in turn, or the index of the only +// server to ask; on return it holds the server that answered (-1 when none did). +static int dns_lookup(const char *name, int qtype, unsigned char *out, int *server) { + if (!name || !out) return -1; + int family = qtype == DDNATV_DNS_TYPE_AAAA ? AF_INET6 : AF_INET; + if (inet_pton(family, name, out) == 1) return 0; + + static const char *const k_public_dns[] = { + "8.8.8.8", "1.1.1.1", "9.9.9.9", "2001:4860:4860::8888", "2606:4700:4700::1111", + }; + ddnatv_dns_server_t servers[DDNATV_DNS_MAX_SERVERS + 6]; + int max = (int)(sizeof(servers) / sizeof(servers[0])); + int count = 0; + ddnatv_dns_server_t s; + // the network's own servers in resolv.conf's order first, its IPv6 ones too: the first IPv4 one + // (get_primary_dns) can be the app's public fallback, which must not see private names first + ddnatv_dns_server_t network[DDNATV_DNS_MAX_SERVERS]; + int network_count = get_dns_servers(network, DDNATV_DNS_MAX_SERVERS); + for (int i = 0; i < network_count; i++) add_dns_server(servers, &count, max, &network[i]); + char primary[INET_ADDRSTRLEN]; + in_addr_t p_dns = get_primary_dns(); // also covers net.dns1 of older Android versions + if (inet_ntop(AF_INET, &p_dns, primary, sizeof(primary)) && dns_server_from_string(primary, &s)) { + add_dns_server(servers, &count, max, &s); + } + for (size_t i = 0; i < sizeof(k_public_dns) / sizeof(k_public_dns[0]); i++) { + if (dns_server_from_string(k_public_dns[i], &s)) add_dns_server(servers, &count, max, &s); + } + + unsigned char packet[512]; + uint16_t txid = generate_dns_txid(); + int packet_len = dns_build_query(name, qtype, txid, packet, sizeof(packet)); + if (packet_len < 0) return -1; + + int only = *server; + *server = -1; + for (int i = (only >= 0 ? only : 0); i < count && (only < 0 || i == only); i++) { + int sock = socket(servers[i].addr.ss_family, SOCK_DGRAM | SOCK_CLOEXEC, 0); + if (sock < 0) continue; + + struct timeval tv; + tv.tv_sec = 0; + tv.tv_usec = 600000; // 600ms fast failover + setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv)); + + // A connected socket only receives datagrams from that server. + if (connect(sock, (const struct sockaddr *)&servers[i].addr, servers[i].len) != 0 || + send(sock, packet, (size_t)packet_len, 0) != packet_len) { + close(sock); + continue; + } + unsigned char resp[1500]; + ssize_t n = recv(sock, resp, sizeof(resp), 0); + close(sock); + int result = n > 0 ? dns_parse_answer(resp, (int)n, txid, qtype, out) : -1; + if (result >= 0) { + *server = i; + return result == 0 ? 0 : -1; + } + } + return -1; +} + +// Whether the network's DNS servers are all IPv6 ones, as on an IPv6-only mobile network. +static int network_dns_is_ipv6_only(void) { + ddnatv_dns_server_t servers[DDNATV_DNS_MAX_SERVERS]; + int n = get_dns_servers(servers, DDNATV_DNS_MAX_SERVERS); + for (int i = 0; i < n; i++) { + if (servers[i].addr.ss_family != AF_INET6) return 0; + } + return n > 0; +} + +// glibc reads /etc/services with an open() of its own, which the path hooks never see, so a service +// name was looked up where Android has no such file: getaddrinfo(host, "https") failed with +// EAI_SERVICE. The rootfs's file is read here when glibc finds nothing. 0, ENOENT or ERANGE. +static int ddnatv_lookup_service(const char *name, int port, const char *proto, + struct servent *out, char *buf, size_t buflen) { + char path_buf[PATH_MAX]; + const char *path = rewrite_path("/etc/services", path_buf, sizeof(path_buf)); + FILE *f = path ? fopen(path, "re") : NULL; + if (!f) return ENOENT; + char line[512]; + int result = ENOENT; + while (result == ENOENT && fgets(line, sizeof(line), f)) { + char *hash = strchr(line, '#'); + if (hash) *hash = '\0'; + char *save = NULL; + char *svc = strtok_r(line, " \t\r\n", &save); + char *pp = svc ? strtok_r(NULL, " \t\r\n", &save) : NULL; + char *slash = pp ? strchr(pp, '/') : NULL; + if (!slash) continue; + *slash = '\0'; + const char *svc_proto = slash + 1; + int svc_port = atoi(pp); + if (proto && strcmp(proto, svc_proto) != 0) continue; + char *aliases[16]; + int naliases = 0; + int matched = name ? strcmp(svc, name) == 0 : svc_port == port; + for (char *a = strtok_r(NULL, " \t\r\n", &save); a && naliases < 15; a = strtok_r(NULL, " \t\r\n", &save)) { + aliases[naliases++] = a; + if (name && strcmp(a, name) == 0) matched = 1; + } + if (!matched) continue; + // buf holds the alias pointers, then the strings + size_t need = sizeof(char *) * (size_t)(naliases + 1) + strlen(svc) + 1 + strlen(svc_proto) + 1; + for (int i = 0; i < naliases; i++) need += strlen(aliases[i]) + 1; + if (need > buflen) { result = ERANGE; break; } + char **list = (char **)(void *)buf; + char *p = buf + sizeof(char *) * (size_t)(naliases + 1); + out->s_name = strcpy(p, svc); p += strlen(svc) + 1; + out->s_proto = strcpy(p, svc_proto); p += strlen(svc_proto) + 1; + for (int i = 0; i < naliases; i++) { list[i] = strcpy(p, aliases[i]); p += strlen(aliases[i]) + 1; } + list[naliases] = NULL; + out->s_aliases = list; + out->s_port = (int)htons((uint16_t)svc_port); + result = 0; + } + fclose(f); + return result; +} + +int getservbyname_r(const char *name, const char *proto, struct servent *result_buf, char *buf, size_t buflen, + struct servent **result) { + static int (*orig)(const char *, const char *, struct servent *, char *, size_t, struct servent **) = NULL; + if (!orig) orig = (int (*)(const char *, const char *, struct servent *, char *, size_t, struct servent **))dlsym(RTLD_NEXT, "getservbyname_r"); + int ret = orig ? orig(name, proto, result_buf, buf, buflen, result) : ENOENT; + if (ret == 0 && result && *result) return 0; + if (!name || !result_buf || !buf) return ret; + int err = ddnatv_lookup_service(name, 0, proto, result_buf, buf, buflen); + if (result) *result = err == 0 ? result_buf : NULL; + return err == ERANGE ? ERANGE : 0; +} + +int getservbyport_r(int port, const char *proto, struct servent *result_buf, char *buf, size_t buflen, + struct servent **result) { + static int (*orig)(int, const char *, struct servent *, char *, size_t, struct servent **) = NULL; + if (!orig) orig = (int (*)(int, const char *, struct servent *, char *, size_t, struct servent **))dlsym(RTLD_NEXT, "getservbyport_r"); + int ret = orig ? orig(port, proto, result_buf, buf, buflen, result) : ENOENT; + if (ret == 0 && result && *result) return 0; + if (!result_buf || !buf) return ret; + int err = ddnatv_lookup_service(NULL, ntohs((uint16_t)port), proto, result_buf, buf, buflen); + if (result) *result = err == 0 ? result_buf : NULL; + return err == ERANGE ? ERANGE : 0; +} + +struct servent *getservbyname(const char *name, const char *proto) { + static __thread struct servent entry; + static __thread char buf[1024]; + struct servent *found = NULL; + return getservbyname_r(name, proto, &entry, buf, sizeof(buf), &found) == 0 ? found : NULL; +} + +struct servent *getservbyport(int port, const char *proto) { + static __thread struct servent entry; + static __thread char buf[1024]; + struct servent *found = NULL; + return getservbyport_r(port, proto, &entry, buf, sizeof(buf), &found) == 0 ? found : NULL; +} + +static int synthesize_fallback_addrinfo(const char *node, const char *service, + const struct addrinfo *hints, + struct addrinfo **res) { + if (!node || !res) return EAI_NONAME; + + int socktype = (hints && hints->ai_socktype) ? hints->ai_socktype : SOCK_STREAM; + int protocol = (hints && hints->ai_protocol) ? hints->ai_protocol + : socktype == SOCK_DGRAM ? IPPROTO_UDP : socktype == SOCK_STREAM ? IPPROTO_TCP : 0; + int family = hints ? hints->ai_family : AF_UNSPEC; + if (family != AF_UNSPEC && family != AF_INET && family != AF_INET6) return EAI_FAMILY; + + // As glibc: no service is port 0, a number is that port, a name comes from /etc/services + int port = 0; + if (service && *service) { + char *end = NULL; + errno = 0; + long p = strtol(service, &end, 10); + if (end && *end == '\0' && errno == 0) { + if (p < 0 || p > 65535) return EAI_SERVICE; + port = (int)p; + } else { + struct servent se, *found = NULL; + char se_buf[1024]; + if (getservbyname_r(service, socktype == SOCK_DGRAM ? "udp" : "tcp", &se, se_buf, sizeof(se_buf), &found) != 0 || !found) + return EAI_SERVICE; + port = ntohs((uint16_t)found->s_port); + } + } + + // The address families the caller asked for: an IPv6-only caller must not get an IPv4 address, + // and AF_UNSPEC gets both, IPv6 first on a network whose DNS servers are all IPv6 ones. The second + // lookup only asks the server that answered the first, and is skipped when none answered. + int want4 = family == AF_UNSPEC || family == AF_INET; + int want6 = family == AF_UNSPEC || family == AF_INET6; + int v6_first = want6 && (!want4 || network_dns_is_ipv6_only()); + unsigned char resolved[16]; + int server = -1; + struct addrinfo *first = NULL; + struct addrinfo *second = NULL; + if (dns_lookup(node, v6_first ? DDNATV_DNS_TYPE_AAAA : DDNATV_DNS_TYPE_A, resolved, &server) == 0) { + first = alloc_addrinfo(node, v6_first ? AF_INET6 : AF_INET, resolved, port, socktype, protocol); + } + if (want4 && want6 && server >= 0 && + dns_lookup(node, v6_first ? DDNATV_DNS_TYPE_A : DDNATV_DNS_TYPE_AAAA, resolved, &server) == 0) { + second = alloc_addrinfo(node, v6_first ? AF_INET : AF_INET6, resolved, port, socktype, protocol); + } + if (first && second) { + first->ai_next = second; + } + struct addrinfo *ai = first ? first : second; + if (ai) { + *res = ai; + return 0; + } + + return EAI_NONAME; +} + +int getaddrinfo(const char *node, const char *service, + const struct addrinfo *hints, + struct addrinfo **res) { + static int (*orig_getaddrinfo)(const char *, const char *, const struct addrinfo *, struct addrinfo **) = NULL; + if (!orig_getaddrinfo) orig_getaddrinfo = (int (*)(const char *, const char *, const struct addrinfo *, struct addrinfo **))dlsym(RTLD_NEXT, "getaddrinfo"); + + struct addrinfo mod_hints; + if (hints) { + mod_hints = *hints; + // On Android, unprivileged apps are blocked by SELinux from querying netlink routing interfaces. + // Glibc's AI_ADDRCONFIG flag causes getaddrinfo to fail or return no addresses when netlink fails. + // Clearing AI_ADDRCONFIG ensures normal, robust DNS resolution. + mod_hints.ai_flags &= ~AI_ADDRCONFIG; + } else { + memset(&mod_hints, 0, sizeof(mod_hints)); + mod_hints.ai_family = AF_UNSPEC; + mod_hints.ai_flags = 0; + } + + int ret = orig_getaddrinfo ? orig_getaddrinfo(node, service, &mod_hints, res) : EAI_FAIL; + // A numeric-only lookup must never turn into a DNS query. + if ((ret != 0 || !res || !*res) && node && !(hints && (hints->ai_flags & AI_NUMERICHOST))) { + int fallback = synthesize_fallback_addrinfo(node, service, hints, res); + // When the fallback finds nothing either, glibc's own error (EAI_AGAIN: try again later, + // EAI_NONAME: no such name) is the more precise one. + // A request the fallback rejects outright (no such service, an unsupported family) is that + // error whatever glibc's was + if (fallback == 0 || ret == 0 || fallback == EAI_SERVICE || fallback == EAI_FAMILY) ret = fallback; + } + return ret; +} + +void freeaddrinfo(struct addrinfo *res) { + static void (*orig_freeaddrinfo)(struct addrinfo *) = NULL; + if (!orig_freeaddrinfo) orig_freeaddrinfo = (void (*)(struct addrinfo *))dlsym(RTLD_NEXT, "freeaddrinfo"); + + if (!res) return; + if (res->ai_flags == DDNATV_ADDRINFO_MAGIC) { + struct addrinfo *curr = res; + while (curr) { + struct addrinfo *next = curr->ai_next; + if (curr->ai_canonname) free(curr->ai_canonname); + if (curr->ai_addr) free(curr->ai_addr); + free(curr); + curr = next; + } + return; + } + if (orig_freeaddrinfo) orig_freeaddrinfo(res); +} + +// gethostbyname() and gethostbyname2() read /etc/resolv.conf with glibc's own open(), on Android's +// /etc, so they asked no DNS server and only /etc/hosts answered. When glibc finds nothing, the +// name is looked up with getaddrinfo() above, which knows the network's servers; a name DNS does +// not have still gets no address (HOST_NOT_FOUND). +static int hostent_from_getaddrinfo(const char *name, int af, struct hostent *ret, char *buf, size_t buflen, + struct hostent **result, int *herr) { + *result = NULL; + if (!name || (af != AF_INET && af != AF_INET6)) { *herr = NO_RECOVERY; return EINVAL; } + struct addrinfo hints; + memset(&hints, 0, sizeof(hints)); + hints.ai_family = af; + hints.ai_socktype = SOCK_STREAM; + hints.ai_flags = AI_CANONNAME; + struct addrinfo *res = NULL; + int rc = getaddrinfo(name, NULL, &hints, &res); + if (rc != 0 || !res) { + *herr = (rc == EAI_NONAME || rc == EAI_NODATA || rc == EAI_ADDRFAMILY) ? HOST_NOT_FOUND + : rc == EAI_AGAIN ? TRY_AGAIN : NO_RECOVERY; + if (res) freeaddrinfo(res); + return rc == EAI_AGAIN ? EAGAIN : ENOENT; + } + size_t addr_len = af == AF_INET ? sizeof(struct in_addr) : sizeof(struct in6_addr); + int count = 0; + for (struct addrinfo *a = res; a && count < 16; a = a->ai_next) if (a->ai_family == af) count++; + const char *canon = res->ai_canonname ? res->ai_canonname : name; + size_t canon_len = strlen(canon) + 1; + size_t need = sizeof(char *) * (size_t)(count + 1) + sizeof(char *) + addr_len * (size_t)count + canon_len + sizeof(void *); + if (count == 0 || need > buflen) { + freeaddrinfo(res); + if (count == 0) { *herr = NO_DATA; return ENOENT; } + *herr = NETDB_INTERNAL; + return ERANGE; + } + // pointers first, aligned, then the addresses and the name + char *p = buf + ((sizeof(void *) - ((uintptr_t)buf % sizeof(void *))) % sizeof(void *)); + char **addr_list = (char **)p; + p += sizeof(char *) * (size_t)(count + 1); + char **aliases = (char **)p; + p += sizeof(char *); + aliases[0] = NULL; + int i = 0; + for (struct addrinfo *a = res; a && i < count; a = a->ai_next) { + if (a->ai_family != af) continue; + const void *src = af == AF_INET ? (const void *)&((struct sockaddr_in *)a->ai_addr)->sin_addr + : (const void *)&((struct sockaddr_in6 *)a->ai_addr)->sin6_addr; + memcpy(p, src, addr_len); + addr_list[i++] = p; + p += addr_len; + } + addr_list[i] = NULL; + memcpy(p, canon, canon_len); + ret->h_name = p; + ret->h_aliases = aliases; + ret->h_addrtype = af; + ret->h_length = (int)addr_len; + ret->h_addr_list = addr_list; + freeaddrinfo(res); + *result = ret; + *herr = 0; + return 0; +} + +int gethostbyname2_r(const char *name, int af, struct hostent *ret, char *buf, size_t buflen, + struct hostent **result, int *h_errnop) { + static int (*orig)(const char *, int, struct hostent *, char *, size_t, struct hostent **, int *) = NULL; + if (!orig) orig = (int (*)(const char *, int, struct hostent *, char *, size_t, struct hostent **, int *))dlsym(RTLD_NEXT, "gethostbyname2_r"); + int herr = 0; + int rc = orig ? orig(name, af, ret, buf, buflen, result, &herr) : ENOSYS; + if (rc == 0 && result && *result) { if (h_errnop) *h_errnop = 0; return 0; } + if (rc == ERANGE) { if (h_errnop) *h_errnop = herr; return rc; } + int fallback_herr = 0; + struct hostent *found = NULL; + rc = hostent_from_getaddrinfo(name, af, ret, buf, buflen, &found, &fallback_herr); + if (result) *result = found; + if (h_errnop) *h_errnop = fallback_herr; + return rc; +} + +int gethostbyname_r(const char *name, struct hostent *ret, char *buf, size_t buflen, + struct hostent **result, int *h_errnop) { + return gethostbyname2_r(name, AF_INET, ret, buf, buflen, result, h_errnop); +} + +static __thread struct hostent t_hostent; +static __thread char t_hostent_buf[4096]; + +struct hostent *gethostbyname2(const char *name, int af) { + struct hostent *result = NULL; + int herr = 0; + gethostbyname2_r(name, af, &t_hostent, t_hostent_buf, sizeof(t_hostent_buf), &result, &herr); + h_errno = result ? 0 : herr; + return result; +} + +struct hostent *gethostbyname(const char *name) { + return gethostbyname2(name, AF_INET); +} + +// Whether a resolver state names a server other than loopback. glibc keeps IPv6 servers in the +// extension (their nsaddr_list entry has family 0), so an IPv6-only resolv.conf counts too. +// The network's own servers, IPv6 ones too (an IPv6-only network has no IPv4 server to ask), for a +// state glibc left with none it can use: it read no /etc/resolv.conf. glibc frees the IPv6 entries. +static void fill_fallback_servers(res_state statp) { + ddnatv_dns_server_t servers[DDNATV_DNS_MAX_SERVERS]; + int n = get_dns_servers(servers, DDNATV_DNS_MAX_SERVERS); + for (int i = 0; i < MAXNS; i++) { + free(statp->_u._ext.nsaddrs[i]); + statp->_u._ext.nsaddrs[i] = NULL; + } + int count = 0; + for (int i = 0; i < n && count < MAXNS; i++) { + if (servers[i].addr.ss_family == AF_INET) { + memcpy(&statp->nsaddr_list[count], &servers[i].addr, sizeof(struct sockaddr_in)); + statp->nsaddr_list[count].sin_port = htons(53); + statp->_u._ext.nsaddrs[count] = NULL; + count++; + } else if (servers[i].addr.ss_family == AF_INET6) { + struct sockaddr_in6 *six = malloc(sizeof(*six)); + if (!six) continue; + memcpy(six, &servers[i].addr, sizeof(*six)); + six->sin6_port = htons(53); + memset(&statp->nsaddr_list[count], 0, sizeof(statp->nsaddr_list[count])); + statp->_u._ext.nsaddrs[count] = six; + count++; + } + } + if (count == 0) { + statp->nsaddr_list[0].sin_family = AF_INET; + statp->nsaddr_list[0].sin_port = htons(53); + statp->nsaddr_list[0].sin_addr.s_addr = get_primary_dns(); + statp->nsaddr_list[1].sin_family = AF_INET; + statp->nsaddr_list[1].sin_port = htons(53); + inet_pton(AF_INET, "8.8.8.8", &statp->nsaddr_list[1].sin_addr); + count = 2; + } + statp->nscount = count; +} + +static int res_state_has_usable_server(res_state statp) { + for (int i = 0; i < statp->nscount && i < MAXNS; i++) { + if (statp->nsaddr_list[i].sin_family == AF_INET) { + in_addr_t a = statp->nsaddr_list[i].sin_addr.s_addr; + if ((ntohl(a) >> 24) != 127 && a != 0) return 1; + } else if (statp->_u._ext.nsaddrs[i] != NULL) { + const struct in6_addr *a6 = &statp->_u._ext.nsaddrs[i]->sin6_addr; + if (!IN6_IS_ADDR_LOOPBACK(a6) && !IN6_IS_ADDR_UNSPECIFIED(a6)) return 1; + } + } + return 0; +} + +int res_init(void) { + static int (*orig_res_init)(void) = NULL; + // glibc's symbols are __res_init and __res_ninit (resolv.h makes the names macros): looked up as + // res_init and res_ninit they were never found, the state stayed without RES_INIT, and Chromium + // (Steam's store) failed to read a DNS configuration + if (!orig_res_init) orig_res_init = (int (*)(void))dlsym(RTLD_NEXT, "__res_init"); + if (!orig_res_init) orig_res_init = (int (*)(void))dlsym(RTLD_NEXT, "res_init"); + int ret = orig_res_init ? orig_res_init() : 0; + res_state statp = __res_state(); + if (statp) { + if (!res_state_has_usable_server(statp)) fill_fallback_servers(statp); + statp->retrans = 1; + statp->retry = 2; + } + return ret; +} + +int res_ninit(res_state statp) { + static int (*orig_res_ninit)(res_state) = NULL; + if (!orig_res_ninit) orig_res_ninit = (int (*)(res_state))dlsym(RTLD_NEXT, "__res_ninit"); + if (!orig_res_ninit) orig_res_ninit = (int (*)(res_state))dlsym(RTLD_NEXT, "res_ninit"); + if (statp) { + memset(statp, 0, sizeof(*statp)); + statp->_vcsock = -1; + for (int i = 0; i < MAXNS; i++) { + statp->_u._ext.nssocks[i] = -1; + } + } + int ret = orig_res_ninit ? orig_res_ninit(statp) : 0; + if (statp) { + if (!res_state_has_usable_server(statp)) fill_fallback_servers(statp); + statp->retrans = 1; + statp->retry = 2; + } + return ret; +} + +int res_nquery(res_state statp, const char *dname, int class, int type, + unsigned char *answer, int anslen) { + static int (*orig_res_nquery)(res_state, const char *, int, int, unsigned char *, int) = NULL; + if (!orig_res_nquery) orig_res_nquery = (int (*)(res_state, const char *, int, int, unsigned char *, int))dlsym(RTLD_NEXT, "res_nquery"); + // DNS SRV queries are optional for APT mirrors and frequently cause delays or issues + if (type == 33 /* T_SRV */) { + h_errno = NO_DATA; + return -1; + } + return orig_res_nquery ? orig_res_nquery(statp, dname, class, type, answer, anslen) : -1; +} + +int res_query(const char *dname, int class, int type, + unsigned char *answer, int anslen) { + static int (*orig_res_query)(const char *, int, int, unsigned char *, int) = NULL; + if (!orig_res_query) orig_res_query = (int (*)(const char *, int, int, unsigned char *, int))dlsym(RTLD_NEXT, "res_query"); + if (type == 33 /* T_SRV */) { + h_errno = NO_DATA; + return -1; + } + return orig_res_query ? orig_res_query(dname, class, type, answer, anslen) : -1; +} + +int res_nsearch(res_state statp, const char *dname, int class, int type, + unsigned char *answer, int anslen) { + static int (*orig_res_nsearch)(res_state, const char *, int, int, unsigned char *, int) = NULL; + if (!orig_res_nsearch) orig_res_nsearch = (int (*)(res_state, const char *, int, int, unsigned char *, int))dlsym(RTLD_NEXT, "res_nsearch"); + if (type == 33 /* T_SRV */) { + h_errno = NO_DATA; + return -1; + } + return orig_res_nsearch ? orig_res_nsearch(statp, dname, class, type, answer, anslen) : -1; +} + +int res_search(const char *dname, int class, int type, + unsigned char *answer, int anslen) { + static int (*orig_res_search)(const char *, int, int, unsigned char *, int) = NULL; + if (!orig_res_search) orig_res_search = (int (*)(const char *, int, int, unsigned char *, int))dlsym(RTLD_NEXT, "res_search"); + if (type == 33 /* T_SRV */) { + h_errno = NO_DATA; + return -1; + } + return orig_res_search ? orig_res_search(dname, class, type, answer, anslen) : -1; +} + +#endif /* !DDNATV_HOST_TEST */ diff --git a/tools/nativeguest/hook/paths.c b/tools/nativeguest/hook/paths.c new file mode 100644 index 0000000000..f6361f6133 --- /dev/null +++ b/tools/nativeguest/hook/paths.c @@ -0,0 +1,818 @@ +// Part of libddnatv-hook.so, included by ddnatv-hook.c (one translation unit, so the +// parts share their static functions and are built with the same command as before). +// +// Path translation: Ubuntu paths (/usr, /etc, ...) mapped into the rootfs, Android's own mounts +// left alone, and the library directories of the rootfs. + +// ---- Path translation ------------------------------------------------------------------- +// Pure string functions (no syscalls), so tests/native can check them directly. They run on +// every file-system call, so they avoid snprintf and compute the rootfs prefix length once. + +static char g_ddnatv_root[PATH_MAX] = {0}; +static size_t g_ddnatv_root_len = 0; + +static void ddnatv_set_root(const char *root, size_t len) { + if (!root) len = 0; + if (len > sizeof(g_ddnatv_root) - 1) len = sizeof(g_ddnatv_root) - 1; + if (len > 0) memcpy(g_ddnatv_root, root, len); + g_ddnatv_root[len] = '\0'; + g_ddnatv_root_len = len; +} + +// Mounts that proot used to provide: "src:dst" pairs from DDNATV_BINDS ('|' separated), longest dst first. +// A path under dst is read from src; src equal to dst keeps a host path that would otherwise be +// looked up in the rootfs. +struct ddnatv_bind { + char *src, *dst; + size_t src_len, dst_len; + int identity; + int order; // position in DDNATV_BINDS: the earlier of two mounts of one folder is its guest path +}; +// as many as the session has: a fixed table dropped what came after its 128th entry +static struct ddnatv_bind *g_binds = NULL; +static int g_nbinds = 0; +static char *g_binds_raw = NULL; +// The session's host name (DDNATV_HOSTNAME), what proot put in uname(): Android's kernel says "localhost" +static char g_hostname[65]; +// A Flatpak sandbox's: the session's rootfs (DDNATV_LINK_ROOT), whose hook stored absolute guest +// link targets as paths in it, as the kernel follows them there; in the sandbox they are guest paths +static char g_link_root[PATH_MAX]; +static size_t g_link_root_len = 0; + +static int ddnatv_bind_longer_first(const void *a, const void *b) { + const struct ddnatv_bind *x = a, *y = b; + return (y->dst_len > x->dst_len) - (y->dst_len < x->dst_len); +} + +static void ddnatv_load_binds(const char *spec) { + if (!spec || !spec[0]) return; + char *raw = strdup(spec); + char *copy = strdup(spec); + if (!raw || !copy) { free(raw); free(copy); return; } + char *save = NULL; + size_t count = 1; + for (const char *c = spec; *c; c++) count += *c == '|'; + g_binds = calloc(count, sizeof(*g_binds)); + if (!g_binds) { free(raw); free(copy); return; } + for (char *entry = strtok_r(copy, "|", &save); entry && (size_t)g_nbinds < count; entry = strtok_r(NULL, "|", &save)) { + char *colon = strchr(entry, ':'); + const char *src = entry; + const char *dst = colon ? colon + 1 : entry; + if (colon) *colon = '\0'; + if (src[0] != '/' || dst[0] != '/' || strcmp(dst, "/") == 0) continue; + struct ddnatv_bind *b = &g_binds[g_nbinds++]; + b->src = strdup(src); + b->dst = strdup(dst); + b->src_len = strlen(src); + b->dst_len = strlen(dst); + while (b->dst_len > 1 && b->dst[b->dst_len - 1] == '/') b->dst[--b->dst_len] = '\0'; + while (b->src_len > 1 && b->src[b->src_len - 1] == '/') b->src[--b->src_len] = '\0'; + b->identity = strcmp(b->src, b->dst) == 0; + b->order = g_nbinds - 1; + } + free(copy); + qsort(g_binds, (size_t)g_nbinds, sizeof(g_binds[0]), ddnatv_bind_longer_first); + g_binds_raw = raw; +} + +// Appends s[0..len) to out[0..used) and NUL-terminates, truncating like snprintf. +// Returns the new length. +static size_t ddnatv_append(char *out, size_t outsz, size_t used, const char *s, size_t len) { + if (outsz == 0) return 0; + size_t room = used < outsz - 1 ? outsz - 1 - used : 0; + if (len > room) len = room; + if (len > 0) memcpy(out + used, s, len); + out[used + len] = '\0'; + return used + len; +} + +// Copies the string src into out[0..outsz), truncated and NUL-terminated as strncpy() followed by +// out[outsz - 1] = '\0' leaves it, but writes only the bytes of the string: strncpy() fills the rest +// of a PATH_MAX buffer with zeros, 4 KB of writes for a path of 30 characters, and in a child that a +// shell has just forked every page written is a copy-on-write fault. +static size_t ddnatv_copy_cstr(char *out, size_t outsz, const char *src) { + if (outsz == 0) return 0; + size_t len = strnlen(src, outsz - 1); + memcpy(out, src, len); + out[len] = '\0'; + return len; +} + +static inline int is_path_prefix(const char *path, const char *prefix, size_t prefix_len) { + if (strncmp(path, prefix, prefix_len) != 0) return 0; + return path[prefix_len] == '/' || path[prefix_len] == '\0'; +} + +static inline const char *get_rootfs_subpath(const char *target) { + if (!target || g_ddnatv_root_len == 0) return NULL; + if (strncmp(target, g_ddnatv_root, g_ddnatv_root_len) == 0 && + (target[g_ddnatv_root_len] == '/' || target[g_ddnatv_root_len] == '\0')) { + return target + g_ddnatv_root_len; + } + return NULL; +} + +// A guest path that a session mount puts outside the rootfs (/run/droiddeck, a game library): a +// program or script there is the guest's, and a script's "#!/bin/sh" is the rootfs shell. The +// kernel ran them with Android's /system/bin/sh, which found no /usr/bin/kwin_wayland. +static int is_mapped_guest_path(const char *path) { + if (!path || path[0] != '/') return 0; + for (int i = 0; i < g_nbinds; i++) { + const struct ddnatv_bind *b = &g_binds[i]; + if (b->identity) continue; + if (is_path_prefix(path, b->dst, b->dst_len)) return 1; + // its real place too: a relative program is made absolute from the real working directory + if (is_path_prefix(path, b->src, b->src_len) && get_rootfs_subpath(b->src) == NULL) return 1; + } + return 0; +} + +// Android's own mounts and files, which must never be redirected into the rootfs. +// `path` starts with '/'; a prefix can only match when its second character does. +static int is_android_host_path(const char *path) { + switch (path[1]) { + case 'a': return is_path_prefix(path, "/apex", 5); + case 'c': return is_path_prefix(path, "/config", 7); + case 'd': return is_path_prefix(path, "/dev", 4) || is_path_prefix(path, "/d", 2) || + is_path_prefix(path, "/data", 5); + case 'l': return is_path_prefix(path, "/linkerconfig", 13); + case 'o': return is_path_prefix(path, "/odm", 4) || is_path_prefix(path, "/oem", 4); + case 'p': return is_path_prefix(path, "/proc", 5) || is_path_prefix(path, "/product", 8); + case 's': return strcmp(path, "/sbin/su") == 0 || strcmp(path, "/su") == 0 || + is_path_prefix(path, "/sys", 4) || is_path_prefix(path, "/system", 7) || + is_path_prefix(path, "/system_ext", 11) || is_path_prefix(path, "/sdcard", 7) || + is_path_prefix(path, "/storage", 8); + case 'v': return is_path_prefix(path, "/vendor", 7); + default: return 0; + } +} + +static const char *rewrite_path_in_root(const char *path, char *buffer, size_t bufsize); + +#if defined(__aarch64__) +static long raw_readlinkat(int dirfd, const char *path, char *buf, size_t size) { + register long x8 __asm__("x8") = 78; // readlinkat, made directly: the hook's own readlink would map the path again + register long x0 __asm__("x0") = dirfd; + register long x1 __asm__("x1") = (long)path; + register long x2 __asm__("x2") = (long)buf; + register long x3 __asm__("x3") = (long)size; + __asm__ volatile("svc #0" : "+r"(x0) : "r"(x8), "r"(x1), "r"(x2), "r"(x3) : "memory"); + return x0; +} +#endif + +static __thread int t_bind_link_depth = 0; + +static void normalize_path(char *path); + +#if defined(__aarch64__) +static long raw_link_dir(const char *link, char *out, size_t size) { + const char *slash = strrchr(link, '/'); + if (!slash || (size_t)(slash - link) >= PATH_MAX) return -1; + char dir[PATH_MAX]; + size_t dlen = slash == link ? 1 : (size_t)(slash - link); + memcpy(dir, link, dlen); + dir[dlen] = '\0'; + register long x8 __asm__("x8") = 56; + register long x0 __asm__("x0") = AT_FDCWD; + register long x1 __asm__("x1") = (long)dir; + register long x2 __asm__("x2") = O_PATH | O_DIRECTORY | O_CLOEXEC; + register long x3 __asm__("x3") = 0; + __asm__ volatile("svc #0" : "+r"(x0) : "r"(x8), "r"(x1), "r"(x2), "r"(x3) : "memory"); + long fd = x0; + if (fd < 0) return -1; + char proc[32]; + snprintf(proc, sizeof(proc), "/proc/self/fd/%ld", fd); + long n = raw_readlinkat(AT_FDCWD, proc, out, size - 1); + register long c8 __asm__("x8") = 57; + register long c0 __asm__("x0") = fd; + __asm__ volatile("svc #0" : "+r"(c0) : "r"(c8) : "memory"); + if (n <= 0 || out[0] != '/') return -1; + out[n] = '\0'; + return n; +} + +static int climbs_past_root(const char *dir, const char *target) { + long depth = 0; + for (const char *p = dir; *p; p++) + if (*p != '/' && (p == dir || p[-1] == '/')) depth++; + for (const char *p = target; *p;) { + while (*p == '/') p++; + const char *end = p; + while (*end && *end != '/') end++; + size_t len = (size_t)(end - p); + if (len == 2 && p[0] == '.' && p[1] == '.') { + if (--depth < 0) return 1; + } else if (len > 0 && !(len == 1 && p[0] == '.')) { + depth++; + } + p = end; + } + return 0; +} + +static size_t guest_path_of_mount_source(char *buf, size_t len, size_t cap, int *converted); + +static const char *guest_path_of_host_dir(const char *dir, char *out, size_t size) { + const char *sub = get_rootfs_subpath(dir); + if (sub) { + ddnatv_copy_cstr(out, size, sub[0] ? sub : "/"); + return out; + } + if (dir[0] != '/') return NULL; + size_t len = ddnatv_copy_cstr(out, size, dir); + int converted = 0; + guest_path_of_mount_source(out, len, size, &converted); + if (converted) return out; + for (int i = 0; i < g_nbinds; i++) { + const struct ddnatv_bind *b = &g_binds[i]; + if (b->identity && is_path_prefix(dir, b->dst, b->dst_len)) { + ddnatv_copy_cstr(out, size, dir); + return out; + } + } + return NULL; +} + +static int join_into_bind(const char *dir, const char *target, const char *rest, char *out, size_t size) { + char guest_dir_buf[PATH_MAX]; + const char *guest_dir = guest_path_of_host_dir(dir, guest_dir_buf, sizeof(guest_dir_buf)); + if (!guest_dir) return 0; + char joined[PATH_MAX]; + size_t used = ddnatv_append(joined, sizeof(joined), 0, guest_dir, strlen(guest_dir)); + used = ddnatv_append(joined, sizeof(joined), used, "/", 1); + used = ddnatv_append(joined, sizeof(joined), used, target, strlen(target)); + if (used + 1 >= sizeof(joined)) return 0; + normalize_path(joined); + used = ddnatv_append(out, size, 0, joined, strlen(joined)); + if (used + 1 >= size) return 0; + if (rest[0] == '/' && used > 0 && out[used - 1] == '/') rest++; + size_t rest_len = strlen(rest); + if (used + rest_len + 1 >= size) return 0; + ddnatv_append(out, size, used, rest, rest_len); + return out[0] == '/'; +} + +static int relative_link_into_bind(const char *link, const char *target, const char *rest, char *out, size_t size) { + char dir[PATH_MAX]; + if (raw_link_dir(link, dir, sizeof(dir)) >= 0) return join_into_bind(dir, target, rest, out, size); + const char *slash = strrchr(link, '/'); + if (!slash) return 0; + size_t dlen = (size_t)(slash - link); + memcpy(dir, link, dlen); + dir[dlen] = '\0'; + return join_into_bind(dir, target, rest, out, size); +} +#endif + +// A mount stand-in can hold symbolic links with absolute guest targets (/sys/class/hidraw/hidraw16 -> +// /sys/devices/droiddeck/...): proot follows them inside the guest, the kernel on Android's own /sys. +// A link met on the way to a deeper path is replaced by its target, mapped again; the last component is +// left as it is (lstat() and readlink() must see the link). +static const char *resolve_bind_links(const char *host, size_t src_len, char *buffer, size_t bufsize) { +#if defined(__aarch64__) + size_t len = strlen(host); + if (len >= PATH_MAX || t_bind_link_depth >= 8) return host; + for (size_t i = src_len + 1; i < len; i++) { + if (host[i] != '/') continue; + char prefix[PATH_MAX]; + memcpy(prefix, host, i); + prefix[i] = '\0'; + char target[PATH_MAX]; + long n = raw_readlinkat(AT_FDCWD, prefix, target, sizeof(target) - 1); + if (n <= 0) continue; + target[n] = '\0'; + char guest[PATH_MAX]; + if (target[0] != '/') { + if (!relative_link_into_bind(prefix, target, host + i, guest, sizeof(guest))) continue; + } else { + size_t used = ddnatv_append(guest, sizeof(guest), 0, target, (size_t)n); + ddnatv_append(guest, sizeof(guest), used, host + i, len - i); + } + t_bind_link_depth++; + const char *mapped = rewrite_path_in_root(guest, buffer, bufsize); + if (mapped != buffer) ddnatv_copy_cstr(buffer, bufsize, mapped); + t_bind_link_depth--; + return buffer; + } +#else + (void)src_len; (void)bufsize; +#endif + return host == buffer ? buffer : host; +} + +// Wine opens every file through its prefix's drive link (dosdevices/z: -> /), so the link must be +// followed in the guest's view even where the prefix is plain rootfs: the kernel would look for the +// rest of the path on Android's own tree. Only that component is checked, not each one of every path. +static const char *resolve_drive_links(const char *host, char *buffer, size_t bufsize) { + const char *devices = strstr(host, "/dosdevices/"); + if (!devices) return host; + return resolve_bind_links(host, (size_t)(devices - host) + 11, buffer, bufsize); +} + +// Maps an absolute Ubuntu path into the rootfs. Returns `path` (possibly advanced past +// redundant leading "/" and "/." components) when it needs no change, else `buffer`. +static const char *rewrite_path_in_root(const char *path, char *buffer, size_t bufsize) { + if (!path) return NULL; + if (path[0] != '/' || g_ddnatv_root_len == 0) return path; + + // Strip multiple redundant leading slashes: //foo -> /foo + while (path[0] == '/' && path[1] == '/') { + path++; + } + + // Strip leading /./: /./boot -> /boot + while (path[0] == '/' && path[1] == '.' && (path[2] == '/' || path[2] == '\0')) { + if (path[2] == '/') { + path += 2; + } else { + path = "/"; + break; + } + } + + // Root directory + if (path[1] == '\0') { + ddnatv_append(buffer, bufsize, 0, g_ddnatv_root, g_ddnatv_root_len); + return buffer; + } + + for (int i = 0; i < g_nbinds; i++) { + const struct ddnatv_bind *b = &g_binds[i]; + if (path[1] == b->dst[1] && is_path_prefix(path, b->dst, b->dst_len)) { + if (b->identity) return path; + size_t n = ddnatv_append(buffer, bufsize, 0, b->src, b->src_len); + ddnatv_append(buffer, bufsize, n, path + b->dst_len, strlen(path + b->dst_len)); + return resolve_bind_links(buffer, b->src_len, buffer, bufsize); + } + } + + // Already inside The native userland rootfs + const char *sub = get_rootfs_subpath(path); + if (sub != NULL) { + if (sub[0] == '/' && t_bind_link_depth < 8) { + for (int i = 0; i < g_nbinds; i++) { + const struct ddnatv_bind *b = &g_binds[i]; + if (b->identity || sub[1] != b->dst[1] || !is_path_prefix(sub, b->dst, b->dst_len)) continue; + char guest[PATH_MAX]; + ddnatv_copy_cstr(guest, sizeof(guest), sub); + t_bind_link_depth++; + const char *mapped = rewrite_path_in_root(guest, buffer, bufsize); + if (mapped != buffer) ddnatv_copy_cstr(buffer, bufsize, mapped); + t_bind_link_depth--; + return buffer; + } + } + return resolve_drive_links(path, buffer, bufsize); + } + + // The real place of a mounted folder, which getcwd() and /proc/self/fd links answer for it: Steam + // made a game's path from one on the SD card library and found no sekiro.exe in the rootfs + for (int i = 0; i < g_nbinds; i++) { + const struct ddnatv_bind *b = &g_binds[i]; + if (!b->identity && path[1] == b->src[1] && is_path_prefix(path, b->src, b->src_len)) + return resolve_drive_links(path, buffer, bufsize); + } + + // POSIX shared memory (/dev/shm) redirection to The native userland rootfs tmp/shm + if (strncmp(path, "/dev/shm", 8) == 0 && (path[8] == '/' || path[8] == '\0')) { + size_t n = ddnatv_append(buffer, bufsize, 0, g_ddnatv_root, g_ddnatv_root_len); + n = ddnatv_append(buffer, bufsize, n, "/tmp/shm", 8); + ddnatv_append(buffer, bufsize, n, path + 8, strlen(path + 8)); + return buffer; + } + + // Real host Android kernel & system mounts + if (is_android_host_path(path)) { + return path; + } + + // Any other absolute path belongs to The native userland rootfs (/boot, /media, /snap, /etc, /usr, ...) + size_t n = ddnatv_append(buffer, bufsize, 0, g_ddnatv_root, g_ddnatv_root_len); + ddnatv_append(buffer, bufsize, n, path, strlen(path)); + return resolve_drive_links(buffer, buffer, bufsize); +} + +// A link target the session's hook stored as a path in its rootfs, given back as the guest path it +// stands for (see g_link_root). Rewrites target[0..len) in place; returns the new length. +static size_t link_root_guest_target(char *target, size_t len) { + if (!g_link_root_len || len < g_link_root_len || memcmp(target, g_link_root, g_link_root_len) != 0) return len; + if (len == g_link_root_len) { target[0] = '/'; target[1] = '\0'; return 1; } + if (target[g_link_root_len] != '/') return len; + memmove(target, target + g_link_root_len, len - g_link_root_len + 1); + return len - g_link_root_len; +} + +// The guest path a symbolic link at absolute guest path `path` leads to, followed in the guest's +// view: the kernel resolves a relative target next to the link's real place, and in a mount that is +// elsewhere (Flatpak's /run/user/0/wayland-0 -> ../../flatpak/wayland-0, where /run/flatpak/wayland-0 +// is another mount). Returns `path` when it is no link. +static const char *follow_guest_link(const char *path, char *out, size_t outsz) { +#if defined(__aarch64__) + const char *cur = path; + for (int depth = 0; depth < 8; depth++) { + char host_buf[PATH_MAX]; + const char *host = rewrite_path_in_root(cur, host_buf, sizeof(host_buf)); + // /dev/stdin and /dev/fd are mounts of /proc/self/fd, whose links ("pipe:[123]") only the kernel opens + if (strncmp(host, "/proc/", 6) == 0) return cur; + char target[PATH_MAX]; + long n = raw_readlinkat(AT_FDCWD, host, target, sizeof(target) - 1); + if (n <= 0) return cur; + target[n] = '\0'; + n = (long)link_root_guest_target(target, (size_t)n); + char joined[PATH_MAX]; + if (target[0] == '/') { + ddnatv_copy_cstr(joined, sizeof(joined), target); + } else { + const char *slash = strrchr(cur, '/'); + size_t dir_len = slash ? (size_t)(slash - cur) : 0; + size_t used = ddnatv_append(joined, sizeof(joined), 0, cur, dir_len); + used = ddnatv_append(joined, sizeof(joined), used, "/", 1); + ddnatv_append(joined, sizeof(joined), used, target, strlen(target)); + } + // lexically, as the guest sees it + size_t len = 0; + out[0] = '\0'; + for (const char *p = joined; *p;) { + while (*p == '/') p++; + const char *end = strchr(p, '/'); + size_t part = end ? (size_t)(end - p) : strlen(p); + if (part == 0) break; + if (part == 1 && p[0] == '.') { + } else if (part == 2 && p[0] == '.' && p[1] == '.') { + while (len > 0 && out[len - 1] != '/') len--; + if (len > 0) len--; + out[len] = '\0'; + } else if (len + 1 + part < outsz) { + out[len++] = '/'; + memcpy(out + len, p, part); + len += part; + out[len] = '\0'; + } + p += part; + } + if (len == 0) { out[0] = '/'; out[1] = '\0'; } + cur = out; + } + return cur; +#else + (void)out; (void)outsz; + return path; +#endif +} + +// On ENOENT, stat()/lstat()/readlink() retry /usr/bin <-> /bin and /usr/sbin <-> /sbin, for +// rootfs trees where bin and sbin are real directories. Returns 1 for the bin pair, 2 for the +// sbin pair (with the other spelling in `alt`), 0 when `sub` is in neither. +#define DDNATV_USRMERGE_BIN 1 +#define DDNATV_USRMERGE_SBIN 2 +static int usrmerge_alt_path(const char *sub, char *alt, size_t altsz) { + const char *dir; + const char *rest; + int pair; + if (strncmp(sub, "/usr/bin/", 9) == 0) { + dir = "/bin/"; rest = sub + 9; pair = DDNATV_USRMERGE_BIN; + } else if (strncmp(sub, "/bin/", 5) == 0) { + dir = "/usr/bin/"; rest = sub + 5; pair = DDNATV_USRMERGE_BIN; + } else if (strncmp(sub, "/usr/sbin/", 10) == 0) { + dir = "/sbin/"; rest = sub + 10; pair = DDNATV_USRMERGE_SBIN; + } else if (strncmp(sub, "/sbin/", 6) == 0) { + dir = "/usr/sbin/"; rest = sub + 6; pair = DDNATV_USRMERGE_SBIN; + } else { + return 0; + } + size_t n = ddnatv_append(alt, altsz, 0, g_ddnatv_root, g_ddnatv_root_len); + n = ddnatv_append(alt, altsz, n, dir, strlen(dir)); + ddnatv_append(alt, altsz, n, rest, strlen(rest)); + return pair; +} + +// Whether postprocess_readlink() below can change a link's target of length target_len, read +// through linkpath: only a target that starts with the rootfs path (at least that long) or a relative +// one into /etc/alternatives (at least "../alternatives", 15 characters, from a directory next to it; +// any "../" under /etc/alternatives itself). lstat() of a link reads it only then, to report its +// rewritten length. +static int readlink_result_may_change(const char *linkpath, long long target_len) { + if (g_ddnatv_root_len > 0 && target_len >= (long long)g_ddnatv_root_len) return 1; + if (!linkpath || linkpath[0] != '/') return 0; + if (strncmp(linkpath, "/etc/alternatives", 17) == 0) return target_len >= 2; + return target_len >= 15; +} + +// Helper for path normalization +static void normalize_path(char *path) { + if (!path || !*path) return; + int is_abs = (path[0] == '/'); + char *stack[128]; + int top = 0; + + char tmp[4096]; + strncpy(tmp, path, sizeof(tmp) - 1); + tmp[sizeof(tmp) - 1] = '\0'; + + char *saveptr = NULL; + char *tok = strtok_r(tmp, "/", &saveptr); + while (tok) { + if (strcmp(tok, ".") == 0) { + // ignore + } else if (strcmp(tok, "..") == 0) { + if (top > 0) top--; + } else { + if (top < 128) stack[top++] = tok; + } + tok = strtok_r(NULL, "/", &saveptr); + } + + char *dst = path; + if (is_abs) *dst++ = '/'; + for (int i = 0; i < top; i++) { + size_t len = strlen(stack[i]); + memcpy(dst, stack[i], len); + dst += len; + if (i + 1 < top) *dst++ = '/'; + } + if (dst == path && is_abs) *dst++ = '/'; + *dst = '\0'; +} + +// /proc/self/fd/N, /proc/thread-self/fd/N and /proc/PID/fd/N: the real path of an open file. A program +// that finds a path this way (Bun and Zig programs do: their realpath() is an open and a readlink of +// this) goes on with system calls of its own, which the hook does not see, so a path inside the rootfs +// has to keep its real beginning there: "/home" for $DDNATV_ROOT/home is a path that does not exist +// for them ("ENOENT, realpath '/home'" in Kilo). It is what getcwd() answers, too. +static int is_proc_fd_link(const char *path) { + if (!path || strncmp(path, "/proc/", 6) != 0) return 0; + const char *p = path + 6; + if (strncmp(p, "self/", 5) == 0) { + p += 5; + } else if (strncmp(p, "thread-self/", 12) == 0) { + p += 12; + } else { + if (*p < '0' || *p > '9') return 0; + while (*p >= '0' && *p <= '9') p++; + if (*p != '/') return 0; + p++; + } + // fd/N and nothing after it: a path beneath the link goes through it to somewhere else + if (strncmp(p, "fd/", 3) != 0) return 0; + p += 3; + if (*p < '0' || *p > '9') return 0; + while (*p >= '0' && *p <= '9') p++; + return *p == '\0'; +} + +// The guest path of a folder that a session mount puts outside the rootfs, for what the kernel +// reports as its real place (getcwd(), /proc/self/cwd and fd links). Wine found no DOS drive for +// Sekiro's folder on the SD card library ("starting in the Windows directory"), and the game quit. +// Rewrites buf[0..len) in place when the guest path fits in cap; returns the new length. +static size_t guest_path_of_mount_source(char *buf, size_t len, size_t cap, int *converted) { + if (converted) *converted = 0; + const struct ddnatv_bind *best = NULL; + for (int i = 0; i < g_nbinds; i++) { + const struct ddnatv_bind *b = &g_binds[i]; + if (b->identity || get_rootfs_subpath(b->src) != NULL || len < b->src_len) continue; + if (memcmp(buf, b->src, b->src_len) != 0 || (len > b->src_len && buf[b->src_len] != '/')) continue; + if (!best || b->src_len > best->src_len || (b->src_len == best->src_len && b->order < best->order)) best = b; + } + if (!best) return len; + size_t rest = len - best->src_len; + if (best->dst_len + rest + 1 > cap) return len; + memmove(buf + best->dst_len, buf + best->src_len, rest); + memcpy(buf, best->dst, best->dst_len); + buf[best->dst_len + rest] = '\0'; + if (converted) *converted = 1; + return best->dst_len + rest; +} + +static ssize_t postprocess_readlink(const char *linkpath, char *buf, ssize_t ret, size_t bufsiz) { + if (ret <= 0) return ret; + if ((size_t)ret < bufsiz) { + buf[ret] = '\0'; + ret = (ssize_t)link_root_guest_target(buf, (size_t)ret); + } + ret = (ssize_t)guest_path_of_mount_source(buf, (size_t)ret, bufsiz, NULL); + + // 1. Strip g_ddnatv_root if target starts with it + if (g_ddnatv_root_len > 0 && !is_proc_fd_link(linkpath)) { + size_t rlen = g_ddnatv_root_len; + if ((size_t)ret >= rlen && memcmp(buf, g_ddnatv_root, rlen) == 0 && + ((size_t)ret == rlen || buf[rlen] == '/')) { + size_t new_len = ret - rlen; + if (new_len == 0) { + buf[0] = '/'; + return 1; + } else { + memmove(buf, buf + rlen, new_len); + return (ssize_t)new_len; + } + } + } + + // 2. Normalize relative alternatives links. The result can only start with /etc/alternatives + // (or the link be in it) when "alternatives" is in the target or in the link's own path: the + // normalized path is made of their components. Most relative links have neither (the ones of + // /usr/lib and /usr/share/doc), and these skip the copies and the normalization, which were a + // tenth of what "cp -a" of a tree of them cost. + if (linkpath && linkpath[0] == '/' && (size_t)ret < PATH_MAX && ret >= 2 && buf[0] == '.' && buf[1] == '.' && + (memmem(buf, (size_t)ret, "alternatives", 12) != NULL || strstr(linkpath, "alternatives") != NULL)) { + char link_copy[PATH_MAX]; + memcpy(link_copy, buf, ret); + link_copy[ret] = '\0'; + + if (strncmp(link_copy, "..", 2) == 0) { + char parent[PATH_MAX]; + snprintf(parent, sizeof(parent), "%s", linkpath); + char *last_slash = strrchr(parent, '/'); + if (last_slash) { + if (last_slash == parent) { + *(last_slash + 1) = '\0'; + } else { + *last_slash = '\0'; + } + } + char combined[PATH_MAX * 2]; + snprintf(combined, sizeof(combined), "%s/%s", parent, link_copy); + normalize_path(combined); + + if (strncmp(combined, "/etc/alternatives", 17) == 0 || + strncmp(linkpath, "/etc/alternatives", 17) == 0) { + size_t clen = strlen(combined); + if (clen <= bufsiz) { + memcpy(buf, combined, clen); + return (ssize_t)clen; + } + } + } + } + + return ret; +} + +// Android's SELinux label, which the xattr hooks keep away from Ubuntu programs. +static const char k_selinux_xattr[] = "security.selinux"; + +static int is_selinux_xattr(const char *name) { + return name != NULL && strcmp(name, k_selinux_xattr) == 0; +} + +// Removes "security.selinux" from a listxattr() result (NUL-separated names); returns the new length. +static ssize_t drop_selinux_xattr(char *list, ssize_t len) { + if (!list || len <= 0) return len; + ssize_t out = 0; + ssize_t i = 0; + while (i < len) { + size_t name_len = strnlen(list + i, (size_t)(len - i)); + ssize_t entry = (ssize_t)name_len + 1; + if (entry > len - i) entry = len - i; + if (name_len != sizeof(k_selinux_xattr) - 1 || memcmp(list + i, k_selinux_xattr, name_len) != 0) { + memmove(list + out, list + i, (size_t)entry); + out += entry; + } + i += entry; + } + return out; +} + +// Library directories of the rootfs, in the order ld.so searches them. ld.so tries every +// directory for every library, so the multiarch ones that hold nearly all libraries come first +// (as in glibc's own default order). Keep in sync with Environment.kt, 00-env.sh and su.sh. +static const char *const k_rootfs_lib_dirs[] = { + "/lib/aarch64-linux-gnu", "/usr/lib/aarch64-linux-gnu", + "/lib/arm-linux-gnueabihf", "/usr/lib/arm-linux-gnueabihf", + "/lib", "/usr/lib", "/usr/local/lib", + "/usr/lib/systemd", "/lib/systemd", + "/usr/lib/aarch64-linux-gnu/systemd", "/lib/aarch64-linux-gnu/systemd", + "/usr/lib/arm-linux-gnueabihf/systemd", "/lib/arm-linux-gnueabihf/systemd", +}; + +// Whether the ':'-separated list holds the directory dir[0..dir_len) as one of its entries. +static int lib_dir_list_has(const char *list, const char *dir, size_t dir_len) { + if (!list) return 0; + for (const char *p = list; *p;) { + const char *end = strchr(p, ':'); + size_t len = end ? (size_t)(end - p) : strlen(p); + if (len == dir_len && memcmp(p, dir, len) == 0) return 1; + if (!end) break; + p = end + 1; + } + return 0; +} + +// Appends the rootfs library directories as a ':'-separated list (with a leading ':' when +// `separate` is set), leaving out those that `have` (a list too, or NULL) names already: the +// caller's LD_LIBRARY_PATH is usually this very list, and ld.so spends time on every directory of +// the list it is given, in every program that is started, and tries it again for each library that +// is not found. Returns the new length. +static size_t append_rootfs_lib_dirs_missing_from(char *out, size_t outsz, size_t used, int separate, const char *have) { + for (size_t i = 0; i < sizeof(k_rootfs_lib_dirs) / sizeof(k_rootfs_lib_dirs[0]); i++) { + // a Flatpak sandbox mounts /usr from its runtime + char buf[PATH_MAX]; + const char *full = rewrite_path_in_root(k_rootfs_lib_dirs[i], buf, sizeof(buf)); + size_t n = strlen(full); + if (have && have[0] != '\0' && lib_dir_list_has(have, full, n)) continue; + // whole directories only: a cut-off one would be searched in the wrong place + if (used + (separate ? 1 : 0) + n >= outsz) continue; + if (separate) used = ddnatv_append(out, outsz, used, ":", 1); + separate = 1; + used = ddnatv_append(out, outsz, used, full, n); + } + return used; +} + +// All of them. +static size_t append_rootfs_lib_dirs(char *out, size_t outsz, size_t used, int separate) { + return append_rootfs_lib_dirs_missing_from(out, outsz, used, separate, NULL); +} + +#ifndef DDNATV_HOST_TEST +// Relative *at() calls. A program that walks a path one component at a time (systemd's chase(), used +// by libudev; fts) opens "/" and then "sys", "class", ... relative to the last descriptor, and those +// names never pass through rewrite_path(): "/" is the rootfs, whose own sys/ is empty, so the stand-ins +// mounted at /sys/class/hidraw and the host's /sys were out of reach. The directories on the way to a +// mount (every proper ancestor of a mount's guest path) are recorded by device and inode; a name given +// relative to one of them is joined to its guest path and mapped like an absolute one. +struct ddnatv_at_dir { + unsigned long dev, ino; + char *guest; +}; +static struct ddnatv_at_dir *g_at_dirs = NULL; +static int g_n_at_dirs = 0; +static pthread_once_t g_at_once = PTHREAD_ONCE_INIT; + +#if defined(__aarch64__) +static long raw_fstatat(int dirfd, const char *path, struct stat *st, int flags) { + register long x8 __asm__("x8") = 79; // newfstatat + register long x0 __asm__("x0") = dirfd; + register long x1 __asm__("x1") = (long)path; + register long x2 __asm__("x2") = (long)st; + register long x3 __asm__("x3") = flags; + __asm__ volatile("svc #0" : "+r"(x0) : "r"(x8), "r"(x1), "r"(x2), "r"(x3) : "memory"); + return x0; +} +#endif + +static void ddnatv_add_at_dir(const char *guest) { +#if defined(__aarch64__) + for (int i = 0; i < g_n_at_dirs; i++) if (strcmp(g_at_dirs[i].guest, guest) == 0) return; + char buf[PATH_MAX]; + const char *host = rewrite_path_in_root(guest, buf, sizeof(buf)); + struct stat st; + if (raw_fstatat(AT_FDCWD, host, &st, 0) != 0 || !S_ISDIR(st.st_mode)) return; + struct ddnatv_at_dir *grown = realloc(g_at_dirs, sizeof(*grown) * (size_t)(g_n_at_dirs + 1)); + if (!grown) return; + g_at_dirs = grown; + g_at_dirs[g_n_at_dirs].dev = (unsigned long)st.st_dev; + g_at_dirs[g_n_at_dirs].ino = (unsigned long)st.st_ino; + g_at_dirs[g_n_at_dirs].guest = strdup(guest); + if (g_at_dirs[g_n_at_dirs].guest) g_n_at_dirs++; +#else + (void)guest; +#endif +} + +static void ddnatv_build_at_dirs(void) { + if (g_nbinds == 0) return; + ddnatv_add_at_dir("/"); + for (int i = 0; i < g_nbinds; i++) { + char guest[PATH_MAX]; + ddnatv_copy_cstr(guest, sizeof(guest), g_binds[i].dst); + for (char *slash = strrchr(guest, '/'); slash && slash > guest; slash = strrchr(guest, '/')) { + *slash = '\0'; + ddnatv_add_at_dir(guest); + } + } +} + +// The absolute host path for `rel` given relative to `dirfd`, or NULL when the call needs no change. +static const char *map_at(int dirfd, const char *rel, char *buf, size_t size) { +#if defined(__aarch64__) + if (dirfd == AT_FDCWD || !rel || rel[0] == '\0' || rel[0] == '/' || g_nbinds == 0) return NULL; + pthread_once(&g_at_once, ddnatv_build_at_dirs); + if (g_n_at_dirs == 0) return NULL; + struct stat st; + if (raw_fstatat(dirfd, "", &st, AT_EMPTY_PATH) != 0) return NULL; + for (int i = 0; i < g_n_at_dirs; i++) { + if (g_at_dirs[i].ino != (unsigned long)st.st_ino || g_at_dirs[i].dev != (unsigned long)st.st_dev) continue; + char guest[PATH_MAX]; + const char *base = g_at_dirs[i].guest; + size_t used = ddnatv_append(guest, sizeof(guest), 0, base, strlen(base)); + if (used > 1) used = ddnatv_append(guest, sizeof(guest), used, "/", 1); + ddnatv_append(guest, sizeof(guest), used, rel, strlen(rel)); + const char *mapped = rewrite_path_in_root(guest, buf, size); + if (mapped != buf) ddnatv_copy_cstr(buf, size, mapped); + return buf; + } +#else + (void)dirfd; (void)rel; (void)buf; (void)size; +#endif + return NULL; +} + +#define DDNATV_AT_REMAP_NAMED(dirfd, pathname, buf) \ + char buf[PATH_MAX]; \ + if (map_at((dirfd), (pathname), buf, sizeof(buf))) { \ + (dirfd) = AT_FDCWD; \ + (pathname) = buf; \ + } +#define DDNATV_AT_REMAP(dirfd, pathname) DDNATV_AT_REMAP_NAMED(dirfd, pathname, ddnatv_at_buf) +#endif /* !DDNATV_HOST_TEST */ diff --git a/tools/nativeguest/hook/posix_shm.c b/tools/nativeguest/hook/posix_shm.c new file mode 100644 index 0000000000..afd8a6f655 --- /dev/null +++ b/tools/nativeguest/hook/posix_shm.c @@ -0,0 +1,174 @@ +// Part of libddnatv-hook.so, included by ddnatv-hook.c. +// +// shm_open() and shm_unlink() of glibc open /dev/shm/NAME with a system call of their own, which +// the path hooks never see and Android has no /dev/shm for. They go through open() and unlink() +// here, which map /dev/shm. + +#ifndef DDNATV_HOST_TEST + +static int posix_shm_path(const char *name, char *path, size_t size) { + if (!name) { errno = EINVAL; return -1; } + while (*name == '/') name++; + size_t len = strlen(name); + if (len == 0 || len > NAME_MAX || strchr(name, '/') || strcmp(name, ".") == 0 || strcmp(name, "..") == 0) { + errno = len > NAME_MAX ? ENAMETOOLONG : EINVAL; + return -1; + } + if (snprintf(path, size, "/dev/shm/%s", name) >= (int)size) { errno = ENAMETOOLONG; return -1; } + return 0; +} + +int shm_open(const char *name, int oflag, mode_t mode) { + char path[PATH_MAX]; + if (posix_shm_path(name, path, sizeof(path)) < 0) return -1; + return open(path, (oflag & (O_ACCMODE | O_CREAT | O_EXCL | O_TRUNC)) | O_NOFOLLOW | O_CLOEXEC, mode); +} + +int shm_unlink(const char *name) { + char path[PATH_MAX]; + if (posix_shm_path(name, path, sizeof(path)) < 0) return -1; + return unlink(path); +} + +#endif /* !DDNATV_HOST_TEST */ + +#ifndef DDNATV_HOST_TEST +// glibc's posix_spawn child resets every signal handler to its default, the hook's SIGSYS handler +// included, before it runs the file actions, and "close everything from N" is close_range(), which +// Android's seccomp filter answers with SIGSYS: the child died of it (Python's subprocess with +// close_fds does this). It becomes one close per descriptor, added when the program is spawned so +// that descriptors opened in between and the ones earlier actions make are closed too; the targets +// of actions added after it stay open, as they would. A close of a descriptor that is not open is +// no error to glibc. +#define CLOSEFROM_SLOTS 64 +#define CLOSEFROM_KEEP 32 +static struct closefrom_entry { + posix_spawn_file_actions_t *actions; + int from; // -1: no close-from yet, only targets of actions seen + int highest; // the highest descriptor an action before close-from makes + int nkeep; + int keep[CLOSEFROM_KEEP]; + int closed_to; // the descriptors up to this one are closed by actions already added + int bad_source; // a dup2 after close-from duplicates a descriptor it closed: glibc's EBADF +} g_closefrom[CLOSEFROM_SLOTS]; +static pthread_mutex_t g_closefrom_lock = PTHREAD_MUTEX_INITIALIZER; + +static struct closefrom_entry *closefrom_entry(posix_spawn_file_actions_t *actions, int create) { + struct closefrom_entry *free_slot = NULL; + for (int i = 0; i < CLOSEFROM_SLOTS; i++) { + if (g_closefrom[i].actions == actions) return &g_closefrom[i]; + if (!g_closefrom[i].actions && !free_slot) free_slot = &g_closefrom[i]; + } + if (!create || !free_slot) return NULL; + memset(free_slot, 0, sizeof(*free_slot)); + free_slot->actions = actions; + free_slot->from = -1; + free_slot->highest = -1; + free_slot->closed_to = -1; + return free_slot; +} + +static void closefrom_note_target(posix_spawn_file_actions_t *actions, int fd) { + pthread_mutex_lock(&g_closefrom_lock); + struct closefrom_entry *e = closefrom_entry(actions, 1); + if (e) { + if (e->from < 0) { + if (fd > e->highest) e->highest = fd; + } else if (e->nkeep < CLOSEFROM_KEEP) { + e->keep[e->nkeep++] = fd; + } + } + pthread_mutex_unlock(&g_closefrom_lock); +} + +int posix_spawn_file_actions_addclosefrom_np(posix_spawn_file_actions_t *actions, int from) { + if (!actions || from < 0) return EINVAL; + pthread_mutex_lock(&g_closefrom_lock); + struct closefrom_entry *e = closefrom_entry(actions, 1); + if (e && (e->from < 0 || from < e->from)) e->from = from; + pthread_mutex_unlock(&g_closefrom_lock); + return e ? 0 : ENOMEM; +} + +int posix_spawn_file_actions_addopen(posix_spawn_file_actions_t *actions, int fd, const char *path, int oflag, mode_t mode) { + static int (*orig)(posix_spawn_file_actions_t *, int, const char *, int, mode_t) = NULL; + if (!orig) orig = (int (*)(posix_spawn_file_actions_t *, int, const char *, int, mode_t))dlsym(RTLD_NEXT, "posix_spawn_file_actions_addopen"); + int ret = orig ? orig(actions, fd, path, oflag, mode) : ENOSYS; + if (ret == 0) closefrom_note_target(actions, fd); + return ret; +} + +int posix_spawn_file_actions_adddup2(posix_spawn_file_actions_t *actions, int fd, int newfd) { + static int (*orig)(posix_spawn_file_actions_t *, int, int) = NULL; + if (!orig) orig = (int (*)(posix_spawn_file_actions_t *, int, int))dlsym(RTLD_NEXT, "posix_spawn_file_actions_adddup2"); + int ret = orig ? orig(actions, fd, newfd) : ENOSYS; + if (ret == 0) { + pthread_mutex_lock(&g_closefrom_lock); + struct closefrom_entry *e = closefrom_entry(actions, 0); + if (e && e->from >= 0 && fd >= e->from) { + int reopened = 0; + for (int k = 0; k < e->nkeep; k++) reopened |= e->keep[k] == fd; + if (!reopened) e->bad_source = 1; + } + pthread_mutex_unlock(&g_closefrom_lock); + closefrom_note_target(actions, newfd); + } + return ret; +} + +int posix_spawn_file_actions_init(posix_spawn_file_actions_t *actions) { + static int (*orig)(posix_spawn_file_actions_t *) = NULL; + if (!orig) orig = (int (*)(posix_spawn_file_actions_t *))dlsym(RTLD_NEXT, "posix_spawn_file_actions_init"); + pthread_mutex_lock(&g_closefrom_lock); + struct closefrom_entry *e = closefrom_entry(actions, 0); + if (e) e->actions = NULL; + pthread_mutex_unlock(&g_closefrom_lock); + return orig ? orig(actions) : ENOSYS; +} + +int posix_spawn_file_actions_destroy(posix_spawn_file_actions_t *actions) { + static int (*orig)(posix_spawn_file_actions_t *) = NULL; + if (!orig) orig = (int (*)(posix_spawn_file_actions_t *))dlsym(RTLD_NEXT, "posix_spawn_file_actions_destroy"); + pthread_mutex_lock(&g_closefrom_lock); + struct closefrom_entry *e = closefrom_entry(actions, 0); + if (e) e->actions = NULL; + pthread_mutex_unlock(&g_closefrom_lock); + return orig ? orig(actions) : ENOSYS; +} + +static int apply_closefrom(posix_spawn_file_actions_t *actions) { + pthread_mutex_lock(&g_closefrom_lock); + struct closefrom_entry *e = closefrom_entry(actions, 0); + if (!e || e->from < 0) { + pthread_mutex_unlock(&g_closefrom_lock); + return 0; + } + if (e->bad_source) { + pthread_mutex_unlock(&g_closefrom_lock); + return EBADF; + } + int highest = e->highest; + DIR *dir = opendir("/proc/self/fd"); + if (dir) { + int self = dirfd(dir); + struct dirent *entry; + while ((entry = readdir(dir)) != NULL) { + if (entry->d_name[0] < '0' || entry->d_name[0] > '9') continue; + int fd = atoi(entry->d_name); + if (fd != self && fd > highest) highest = fd; + } + closedir(dir); + } + int start = e->from > e->closed_to + 1 ? e->from : e->closed_to + 1; + for (int fd = start; fd <= highest; fd++) { + int kept = 0; + for (int k = 0; k < e->nkeep; k++) kept |= e->keep[k] == fd; + if (!kept && posix_spawn_file_actions_addclose(actions, fd) != 0) break; + e->closed_to = fd; + } + pthread_mutex_unlock(&g_closefrom_lock); + return 0; +} +#else +static int apply_closefrom(posix_spawn_file_actions_t *actions) { (void)actions; return 0; } +#endif diff --git a/tools/nativeguest/hook/privileged.c b/tools/nativeguest/hook/privileged.c new file mode 100644 index 0000000000..6b527ae4f3 --- /dev/null +++ b/tools/nativeguest/hook/privileged.c @@ -0,0 +1,815 @@ +// Part of libddnatv-hook.so, included by ddnatv-hook.c (one translation unit, so the +// parts share their static functions and are built with the same command as before). +// +// Calls an app may not make (chown, mknod, capabilities, prctl, landlock, seccomp, namespaces, +// close_range) and the generic syscall() entry point. + +// The ARM translator of x86 devices and emulators (ndk_translation, houdini) keeps memory files of +// its own open in the process (ndk_translation at descriptor 3) and needs them whenever it +// translates more code: a program that closes every descriptor it did not open (sshd at start, +// closefrom(3)) made it abort later ("CHECK failed" in mmap_posix.cc). Its memory files open when +// the hook starts survive close(), close_range() and closefrom(); phones that run ARM code +// themselves have none. +#define DDNATV_MAX_KEPT_FDS 4 +static int g_kept_fds[DDNATV_MAX_KEPT_FDS]; // ascending +static int g_kept_fd_count = 0; + +static int is_kept_fd(int fd) { + for (int i = 0; i < g_kept_fd_count; i++) { + if (g_kept_fds[i] == fd) return 1; + } + return 0; +} + +// Calls fn for each part of [first, last] that leaves out the descriptors in kept (ascending); +// the first nonzero answer of fn is returned, else 0. +static int for_each_range_without(unsigned int first, unsigned int last, const int *kept, int nkept, + int (*fn)(unsigned int, unsigned int, void *), void *arg) { + unsigned int from = first; + for (int i = 0; i < nkept && from <= last; i++) { + if (kept[i] < 0 || (unsigned int)kept[i] < from || (unsigned int)kept[i] > last) continue; + unsigned int k = (unsigned int)kept[i]; + if (k > from) { + int r = fn(from, k - 1, arg); + if (r != 0) return r; + } + if (k == last) return 0; + from = k + 1; + } + return from <= last ? fn(from, last, arg) : 0; +} + +#ifndef DDNATV_HOST_TEST + +// ndk_translation's file is "/memfd:child"; any memory file counts in a process whose executable is +// a translator's runner (houdini). ndk_translation shows a program its own path as /proc/self/exe, +// so the name is what tells there. +// +// This runs at the start of every program, so it costs three system calls on a phone that runs ARM +// code itself: the descriptors that are open (/proc/self/fd, read at once) are all that are asked +// about, where asking about each of the numbers from 3 to 63 was 61 readlink() calls in every +// process that was started. +// Set once this process knows that it has none (it looked, or was told by DDNATV_NT=0 in its +// environment, which prepare_ddnatv_env hands on to the programs it starts) +static int g_no_translator = 0; + +__attribute__((constructor(102))) static void find_translator_files(void) { + // The first program of a session looks; the ones it starts are told (a translator is there for + // all the programs of a machine or for none, and where it is not known they look as before) + const char *known = getenv("DDNATV_NT"); + if (known && known[0] == '0' && known[1] == '\0') { + g_no_translator = 1; + return; + } + ssize_t (*real_readlink)(const char *, char *, size_t) = (ssize_t (*)(const char *, char *, size_t))dlsym(RTLD_NEXT, "readlink"); + int (*real_open)(const char *, int, ...) = (int (*)(const char *, int, ...))dlsym(RTLD_NEXT, "open"); + int (*real_close)(int) = (int (*)(int))dlsym(RTLD_NEXT, "close"); + ssize_t (*real_getdents64)(int, void *, size_t) = (ssize_t (*)(int, void *, size_t))dlsym(RTLD_NEXT, "getdents64"); + if (!real_readlink || !real_open || !real_close) return; + int dir = real_getdents64 ? real_open("/proc/self/fd", O_RDONLY | O_DIRECTORY | O_CLOEXEC) : -1; + if (dir < 0) return; + // The numbers of the descriptors open now, those from 3 to 63 (the directory's own left out) + char entries[2048]; + unsigned char open_fds[64]; + int nopen = 0; + for (;;) { + long n = real_getdents64(dir, entries, sizeof(entries)); + if (n <= 0) break; + for (long off = 0; off < n;) { + // struct linux_dirent64: d_ino (8), d_off (8), d_reclen (2), d_type (1), then d_name + unsigned short reclen; + memcpy(&reclen, entries + off + 16, sizeof(reclen)); + const char *name = entries + off + 19; + off += reclen ? reclen : n; // a record without a length ends the buffer + if (name[0] < '0' || name[0] > '9') continue; // "." and ".." + int fd = atoi(name); + if (fd >= 3 && fd < 64 && fd != dir) open_fds[nopen++] = (unsigned char)fd; + } + // A short answer is the whole directory; asking again would only be told "no more" + if ((size_t)n + 64 <= sizeof(entries)) break; + } + real_close(dir); + if (nopen == 0) { + g_no_translator = 1; + return; + } + + char path[PATH_MAX]; + int runner = 0; + ssize_t n = real_readlink("/proc/self/exe", path, sizeof(path) - 1); + if (n > 0) { + path[n] = '\0'; + const char *base = strrchr(path, '/'); + base = base ? base + 1 : path; + runner = strncmp(base, "ndk_translation", 15) == 0 || strncmp(base, "houdini", 7) == 0; + } + // In ascending order, as the list is kept + for (int i = 0; i < nopen - 1; i++) { + for (int j = i + 1; j < nopen; j++) { + if (open_fds[j] < open_fds[i]) { + unsigned char t = open_fds[i]; + open_fds[i] = open_fds[j]; + open_fds[j] = t; + } + } + } + for (int i = 0; i < nopen && g_kept_fd_count < DDNATV_MAX_KEPT_FDS; i++) { + char link[32], target[64]; + snprintf(link, sizeof(link), "/proc/self/fd/%d", open_fds[i]); + ssize_t m = real_readlink(link, target, sizeof(target) - 1); + if (m <= 0) continue; + target[m] = '\0'; + if (strncmp(target, "/memfd:child", 12) == 0 || (runner && strncmp(target, "/memfd:", 7) == 0)) { + g_kept_fds[g_kept_fd_count++] = open_fds[i]; + } + } + if (g_kept_fd_count == 0) g_no_translator = 1; +} + +int chown(const char *pathname, uid_t owner, gid_t group) { (void)pathname; (void)owner; (void)group; return 0; } +int fchown(int fd, uid_t owner, gid_t group) { (void)fd; (void)owner; (void)group; return 0; } +int lchown(const char *pathname, uid_t owner, gid_t group) { (void)pathname; (void)owner; (void)group; return 0; } +int fchownat(int dirfd, const char *pathname, uid_t owner, gid_t group, int flags) { + DDNATV_AT_REMAP(dirfd, pathname); + (void)dirfd; (void)pathname; (void)owner; (void)group; (void)flags; return 0; +} +int chroot(const char *path) { (void)path; return 0; } + +// Hook mkfifo / mkfifoat / mknod / mknodat +int mkfifo(const char *pathname, mode_t mode); +int mkfifoat(int dirfd, const char *pathname, mode_t mode); + +int mknodat(int dirfd, const char *pathname, mode_t mode, dev_t dev) { + DDNATV_AT_REMAP(dirfd, pathname); + (void)dev; + if (!pathname) { + errno = EFAULT; + return -1; + } + char buf[PATH_MAX]; + const char *target = (pathname[0] == '/') ? rewrite_path(pathname, buf, sizeof(buf)) : pathname; + // A file type of 0 means a regular file, as in mknod(2), which also fails with EEXIST instead + // of touching an existing file. + if (S_ISREG(mode) || (mode & S_IFMT) == 0) { + // mknod(2) returns 0 on success, never a file descriptor: close the + // transient fd instead of leaking one per call (tar/dpkg extract + // thousands of files; leaked fds exhaust the table -> EBADF noise). + int fd = openat(dirfd, target, O_CREAT | O_EXCL | O_WRONLY | O_CLOEXEC, mode & 07777); + if (fd >= 0) { + close(fd); + return 0; + } + return -1; + } + if (S_ISFIFO(mode)) { + return mkfifoat(dirfd, target, mode); + } + return 0; +} + +int mknod(const char *pathname, mode_t mode, dev_t dev) { + return mknodat(AT_FDCWD, pathname, mode, dev); +} + +int mkfifoat(int dirfd, const char *pathname, mode_t mode) { + static int (*orig_mkfifoat)(int, const char *, mode_t) = NULL; + if (!orig_mkfifoat) orig_mkfifoat = (int (*)(int, const char *, mode_t))dlsym(RTLD_NEXT, "mkfifoat"); + if (!pathname) { + errno = EFAULT; + return -1; + } + char buf[PATH_MAX]; + const char *target = (pathname[0] == '/') ? rewrite_path(pathname, buf, sizeof(buf)) : pathname; + if (orig_mkfifoat) { + return orig_mkfifoat(dirfd, target, mode); + } + static int (*orig_mkfifo)(const char *, mode_t) = NULL; + if (!orig_mkfifo) orig_mkfifo = (int (*)(const char *, mode_t))dlsym(RTLD_NEXT, "mkfifo"); + if (orig_mkfifo && dirfd == AT_FDCWD) { + return orig_mkfifo(target, mode); + } + return -1; +} + +int mkfifo(const char *pathname, mode_t mode) { + return mkfifoat(AT_FDCWD, pathname, mode); +} + +// Hook sync / syncfs to prevent Android flash storage stalls during dpkg operations +void sync(void) { + // No-op +} + +int syncfs(int fd) { + (void)fd; + return 0; +} + +int capget(void *hdrp, void *datap) { + static int (*orig_capget)(void *, void *) = NULL; + if (!orig_capget) orig_capget = (int (*)(void *, void *))dlsym(RTLD_NEXT, "capget"); + if (orig_capget && orig_capget(hdrp, datap) == 0) { + return 0; + } + if (datap) { + uint32_t ver = hdrp ? *(const uint32_t *)hdrp : 0; + size_t nbytes = (ver == 0x20071026U || ver == 0x20080522U) ? 24 : 12; + memset(datap, 0, nbytes); + } + errno = 0; + return 0; +} +int capset(void *hdrp, const void *datap) { (void)hdrp; (void)datap; return 0; } + +int prctl(int option, ...) { + va_list ap; + va_start(ap, option); + unsigned long arg2 = va_arg(ap, unsigned long); + unsigned long arg3 = va_arg(ap, unsigned long); + unsigned long arg4 = va_arg(ap, unsigned long); + unsigned long arg5 = va_arg(ap, unsigned long); + va_end(ap); + + // PR_SET_NO_NEW_PRIVS = 38, PR_GET_NO_NEW_PRIVS = 39 +#ifdef PR_SET_NO_NEW_PRIVS + if (option == PR_SET_NO_NEW_PRIVS) return 0; +#endif + if (option == 38) return 0; +#ifdef PR_GET_NO_NEW_PRIVS + if (option == PR_GET_NO_NEW_PRIVS) return 1; +#endif + if (option == 39) return 1; + + // PR_SET_SECCOMP = 22, PR_GET_SECCOMP = 21 +#ifdef PR_SET_SECCOMP + if (option == PR_SET_SECCOMP) { errno = EINVAL; return -1; } +#endif + if (option == 22) { errno = EINVAL; return -1; } +#ifdef PR_GET_SECCOMP + if (option == PR_GET_SECCOMP) return 0; +#endif + if (option == 21) return 0; + + // PR_SET_SPECULATION_CTRL = 47 + if (option == 47) return 0; + + static int (*orig_prctl)(int, unsigned long, unsigned long, unsigned long, unsigned long) = NULL; + if (!orig_prctl) orig_prctl = (int (*)(int, unsigned long, unsigned long, unsigned long, unsigned long))dlsym(RTLD_NEXT, "prctl"); + return orig_prctl ? orig_prctl(option, arg2, arg3, arg4, arg5) : 0; +} + +// Limits that leave a process no new descriptors (RLIMIT_NOFILE below 16) or no file writes +// (RLIMIT_FSIZE 0) are not applied. Sandboxes give them to their unprivileged part (sshd's before +// login sets 1 and 0, with the seccomp filter above), and Android's ARM translator (emulators, x86 +// devices) needs new descriptors and memory files in the process: sshd's died in it ("CHECK failed" +// in its mmap) and the client's connection was reset. Other limits are set as asked. +static int sandbox_only_limit(int resource, const struct rlimit *rlim) { + if (!rlim) return 0; + if (resource == RLIMIT_NOFILE) return rlim->rlim_cur < 16; + if (resource == RLIMIT_FSIZE) return rlim->rlim_cur == 0; + return 0; +} + +int setrlimit(__rlimit_resource_t resource, const struct rlimit *rlim) { + if (sandbox_only_limit((int)resource, rlim)) return 0; + static int (*orig_setrlimit)(__rlimit_resource_t, const struct rlimit *) = NULL; +#if defined(__USE_FILE_OFFSET64) && !defined(__LP64__) + // With 64-bit file offsets on a 32-bit system this function is setrlimit64 + if (!orig_setrlimit) orig_setrlimit = (int (*)(__rlimit_resource_t, const struct rlimit *))dlsym(RTLD_NEXT, "setrlimit64"); +#else + if (!orig_setrlimit) orig_setrlimit = (int (*)(__rlimit_resource_t, const struct rlimit *))dlsym(RTLD_NEXT, "setrlimit"); +#endif + if (!orig_setrlimit) { + errno = ENOSYS; + return -1; + } + return orig_setrlimit(resource, rlim); +} +#if defined(__LP64__) +__asm__(".globl setrlimit64\n" ".set setrlimit64, setrlimit\n"); +#endif + +#ifndef LANDLOCK_CREATE_RULESET_VERSION +#define LANDLOCK_CREATE_RULESET_VERSION (1U << 0) +#endif + +#ifndef __NR_landlock_create_ruleset +#define __NR_landlock_create_ruleset 444 +#endif +#ifndef __NR_landlock_add_rule +#define __NR_landlock_add_rule 445 +#endif +#ifndef __NR_landlock_restrict_self +#define __NR_landlock_restrict_self 446 +#endif + +#ifndef __NR_seccomp +#if defined(__aarch64__) +#define __NR_seccomp 277 +#elif defined(__x86_64__) +#define __NR_seccomp 317 +#elif defined(__arm__) +#define __NR_seccomp 383 +#else +#define __NR_seccomp 277 +#endif +#endif + +#ifndef __NR_unshare +#if defined(__aarch64__) +#define __NR_unshare 97 +#elif defined(__x86_64__) +#define __NR_unshare 272 +#elif defined(__arm__) +#define __NR_unshare 337 +#else +#define __NR_unshare 97 +#endif +#endif + +#ifndef __NR_setns +#if defined(__aarch64__) +#define __NR_setns 268 +#elif defined(__x86_64__) +#define __NR_setns 308 +#elif defined(__arm__) +#define __NR_setns 375 +#else +#define __NR_setns 268 +#endif +#endif + +#ifndef __NR_clone3 +#define __NR_clone3 435 +#endif +#ifndef __NR_pidfd_open +#define __NR_pidfd_open 434 +#endif +#ifndef __NR_pidfd_send_signal +#define __NR_pidfd_send_signal 424 +#endif +#ifndef __NR_pidfd_getfd +#define __NR_pidfd_getfd 438 +#endif +#ifndef __NR_close_range +#define __NR_close_range 436 +#endif +#ifndef __NR_faccessat +#if defined(__aarch64__) +#define __NR_faccessat 48 +#elif defined(__arm__) +#define __NR_faccessat 334 +#elif defined(__x86_64__) +#define __NR_faccessat 269 +#endif +#endif +#ifndef __NR_faccessat2 +#define __NR_faccessat2 439 +#endif +#ifndef __NR_statx +#if defined(__aarch64__) || defined(__arm__) +#define __NR_statx 291 +#elif defined(__x86_64__) +#define __NR_statx 332 +#endif +#endif + +#ifndef SECCOMP_SET_MODE_STRICT +#define SECCOMP_SET_MODE_STRICT 0 +#endif +#ifndef SECCOMP_SET_MODE_FILTER +#define SECCOMP_SET_MODE_FILTER 1 +#endif +#ifndef SECCOMP_GET_ACTION_AVAIL +#define SECCOMP_GET_ACTION_AVAIL 2 +#endif + +int landlock_create_ruleset(const void *attr, size_t size, uint32_t flags) { + (void)attr; + (void)size; + (void)flags; + errno = ENOSYS; + return -1; +} + +int landlock_add_rule(int ruleset_fd, int rule_type, const void *rule_attr, uint32_t flags) { + (void)ruleset_fd; + (void)rule_type; + (void)rule_attr; + (void)flags; + errno = ENOSYS; + return -1; +} + +int landlock_restrict_self(int ruleset_fd, uint32_t flags) { + (void)ruleset_fd; + (void)flags; + errno = ENOSYS; + return -1; +} + +int seccomp(unsigned int operation, unsigned int flags, void *args) { + (void)flags; + (void)args; + if (operation != SECCOMP_SET_MODE_STRICT && + operation != SECCOMP_SET_MODE_FILTER && + operation != SECCOMP_GET_ACTION_AVAIL && + operation != 3 /* SECCOMP_GET_NOTIF_SIZES */) { + errno = EINVAL; + return -1; + } + errno = ENOSYS; + return -1; +} + +int unshare(int flags) { + (void)flags; + errno = ENOSYS; + return -1; +} + +int setns(int fd, int nstype) { + (void)fd; + (void)nstype; + errno = ENOSYS; + return -1; +} + +#ifndef CLOSE_RANGE_CLOEXEC +#define CLOSE_RANGE_CLOEXEC (1U << 2) +#endif + +static int close_range_all(unsigned int first, unsigned int last, int flags); + +static int close_range_part(unsigned int first, unsigned int last, void *flags) { + return close_range_all(first, last, *(int *)flags); +} + +int close_range(unsigned int first, unsigned int last, int flags) { + // Close-on-exec only (CLOSE_RANGE_CLOEXEC) leaves the translator's files open + if (g_kept_fd_count > 0 && !(flags & CLOSE_RANGE_CLOEXEC)) { + return for_each_range_without(first, last, g_kept_fds, g_kept_fd_count, close_range_part, &flags); + } + return close_range_all(first, last, flags); +} + +// glibc's closefrom() makes the close_range system call itself, past the function above +void closefrom(int lowfd) { + close_range(lowfd < 0 ? 0U : (unsigned int)lowfd, ~0U, 0); +} + +static int close_range_all(unsigned int first, unsigned int last, int flags) { + static int (*orig_close_range)(unsigned int, unsigned int, int) = NULL; + if (!orig_close_range) { + orig_close_range = (int (*)(unsigned int, unsigned int, int))dlsym(RTLD_NEXT, "close_range"); + } +#ifdef __NR_close_range + static long (*orig_raw_syscall)(long, ...) = NULL; + if (!orig_raw_syscall) orig_raw_syscall = (long (*)(long, ...))dlsym(RTLD_NEXT, "syscall"); + if (orig_raw_syscall) { + long sret = orig_raw_syscall(__NR_close_range, first, last, flags); + if (sret == 0) return 0; + if (sret < 0 && errno != ENOSYS) return -1; + } +#endif + if (orig_close_range) { + int cret = orig_close_range(first, last, flags); + if (cret == 0) return 0; + if (cret < 0 && errno != ENOSYS) return -1; + } + + int set_cloexec = (flags & CLOSE_RANGE_CLOEXEC) != 0; + + DIR *d = opendir("/proc/self/fd"); + if (d) { + int dfd = dirfd(d); + struct dirent *de; + while ((de = readdir(d)) != NULL) { + if (de->d_name[0] == '.') continue; + int fd = atoi(de->d_name); + if (fd >= (int)first && (last == ~0U || (unsigned int)fd <= last) && fd != dfd) { + if (set_cloexec) { + int fl = fcntl(fd, F_GETFD); + if (fl >= 0) { + fcntl(fd, F_SETFD, fl | FD_CLOEXEC); + } + } else { + close(fd); + } + } + } + closedir(d); + return 0; + } + int max_fd = (int)sysconf(_SC_OPEN_MAX); + if (max_fd <= 0 || max_fd > 1024) max_fd = 1024; + int end = (last < (unsigned int)max_fd) ? (int)last : max_fd; + for (int fd = (int)first; fd <= end; fd++) { + if (set_cloexec) { + int fl = fcntl(fd, F_GETFD); + if (fl >= 0) { + fcntl(fd, F_SETFD, fl | FD_CLOEXEC); + } + } else { + close(fd); + } + } + return 0; +} + +static __thread int t_syscall_redirect = 0; + +long syscall(long number, ...) { + va_list ap; + va_start(ap, number); + unsigned long arg1 = va_arg(ap, unsigned long); + unsigned long arg2 = va_arg(ap, unsigned long); + unsigned long arg3 = va_arg(ap, unsigned long); + unsigned long arg4 = va_arg(ap, unsigned long); + unsigned long arg5 = va_arg(ap, unsigned long); + unsigned long arg6 = va_arg(ap, unsigned long); + va_end(ap); + +#if defined(__NR_readlinkat) + if (number == __NR_readlinkat) { + return (long)readlinkat((int)arg1, (const char *)arg2, (char *)arg3, (size_t)arg4); + } +#endif +#if defined(__NR_readlink) + if (number == __NR_readlink) { + return (long)readlink((const char *)arg1, (char *)arg2, (size_t)arg3); + } +#endif +#if defined(__NR_linkat) + if (number == __NR_linkat) { + return (long)linkat((int)arg1, (const char *)arg2, (int)arg3, (const char *)arg4, (int)arg5); + } +#endif +#if defined(__NR_link) + if (number == __NR_link) { + return (long)link((const char *)arg1, (const char *)arg2); + } +#endif + +#ifdef __NR_landlock_create_ruleset + if (number == __NR_landlock_create_ruleset) { + return (long)landlock_create_ruleset((const void *)arg1, (size_t)arg2, (uint32_t)arg3); + } + if (number == __NR_landlock_add_rule) { + return (long)landlock_add_rule((int)arg1, (int)arg2, (const void *)arg3, (uint32_t)arg4); + } + if (number == __NR_landlock_restrict_self) { + return (long)landlock_restrict_self((int)arg1, (uint32_t)arg2); + } +#endif + +#ifdef __NR_seccomp + if (number == __NR_seccomp) { + return (long)seccomp((unsigned int)arg1, (unsigned int)arg2, (void *)arg3); + } +#endif + +#ifdef __NR_unshare + if (number == __NR_unshare) { + return (long)unshare((int)arg1); + } +#endif + +#ifdef __NR_setns + if (number == __NR_setns) { + return (long)setns((int)arg1, (int)arg2); + } +#endif + +#ifdef __NR_clone3 + if (number == __NR_clone3) { + errno = ENOSYS; + return -1; + } +#endif + +#ifdef __NR_pidfd_open + if (number == __NR_pidfd_open) { + errno = ENOSYS; + return -1; + } +#endif +#ifdef __NR_pidfd_send_signal + if (number == __NR_pidfd_send_signal) { + errno = ENOSYS; + return -1; + } +#endif +#ifdef __NR_pidfd_getfd + if (number == __NR_pidfd_getfd) { + errno = ENOSYS; + return -1; + } +#endif + +#ifdef __NR_close_range + if (number == __NR_close_range) { + // libblsession's close_range() calls syscall() again: the nested call goes straight to the kernel + if (t_syscall_redirect) return call_orig_syscall(number, arg1, arg2, arg3, 0, 0, 0); + t_syscall_redirect++; + long ret = (long)close_range((unsigned int)arg1, (unsigned int)arg2, (int)arg3); + t_syscall_redirect--; + return ret; + } +#endif + +#ifdef __NR_openat2 + if (number == __NR_openat2) { + // libblsession's openat2() calls syscall() again (an endless loop until the stack ran out): the nested + // call maps the path and goes straight to the kernel + if (t_syscall_redirect) { + char nested_buf[PATH_MAX]; + const char *path = (const char *)arg2; + if (path && path[0] == '/') path = rewrite_path(path, nested_buf, sizeof(nested_buf)); + return call_orig_syscall(number, arg1, (unsigned long)path, arg3, arg4, 0, 0); + } + t_syscall_redirect++; + long ret = (long)openat2((int)arg1, (const char *)arg2, (struct ddnatv_open_how *)arg3, (size_t)arg4); + t_syscall_redirect--; + return ret; + } +#endif + +#ifdef __NR_fchmodat2 + if (number == __NR_fchmodat2) { + return (long)fchmodat2((int)arg1, (const char *)arg2, (mode_t)arg3, (int)arg4); + } +#endif + +#if defined(__NR_statx) + if (number == __NR_statx) { + return (long)statx((int)arg1, (const char *)arg2, (int)arg3, (unsigned int)arg4, (struct statx *)arg5); + } +#endif + +#if defined(__NR_faccessat) + if (number == __NR_faccessat) { + if (t_syscall_redirect) { + char nested_buf[PATH_MAX]; + const char *path = (const char *)arg2; + if (path && path[0] == '/') path = rewrite_path(path, nested_buf, sizeof(nested_buf)); + return call_orig_syscall(number, arg1, (unsigned long)path, arg3, 0, 0, 0); + } + t_syscall_redirect++; + long ret = (long)faccessat((int)arg1, (const char *)arg2, (int)arg3, 0); + t_syscall_redirect--; + return ret; + } +#endif + +#if defined(__NR_faccessat2) + if (number == __NR_faccessat2) { + return (long)faccessat2((int)arg1, (const char *)arg2, (int)arg3, (int)arg4); + } +#endif + +#if defined(__NR_mknodat) + if (number == __NR_mknodat) { + return (long)mknodat((int)arg1, (const char *)arg2, (mode_t)arg3, (dev_t)arg4); + } +#endif + +#if defined(__NR_mknod) + if (number == __NR_mknod) { + return (long)mknod((const char *)arg1, (mode_t)arg2, (dev_t)arg3); + } +#endif + +#if defined(__NR_mkfifoat) + if (number == __NR_mkfifoat) { + return (long)mkfifoat((int)arg1, (const char *)arg2, (mode_t)arg3); + } +#endif + +#if defined(__NR_setresuid) + if (number == __NR_setresuid) return 0; +#endif +#if defined(__NR_setresuid32) + if (number == __NR_setresuid32) return 0; +#endif +#if defined(__NR_setresgid) + if (number == __NR_setresgid) return 0; +#endif +#if defined(__NR_setresgid32) + if (number == __NR_setresgid32) return 0; +#endif +#if defined(__NR_setuid) + if (number == __NR_setuid) return 0; +#endif +#if defined(__NR_setuid32) + if (number == __NR_setuid32) return 0; +#endif +#if defined(__NR_setgid) + if (number == __NR_setgid) return 0; +#endif +#if defined(__NR_setgid32) + if (number == __NR_setgid32) return 0; +#endif +#if defined(__NR_setreuid) + if (number == __NR_setreuid) return 0; +#endif +#if defined(__NR_setreuid32) + if (number == __NR_setreuid32) return 0; +#endif +#if defined(__NR_setregid) + if (number == __NR_setregid) return 0; +#endif +#if defined(__NR_setregid32) + if (number == __NR_setregid32) return 0; +#endif +#if defined(__NR_setgroups) + if (number == __NR_setgroups) return 0; +#endif +#if defined(__NR_setgroups32) + if (number == __NR_setgroups32) return 0; +#endif +#if defined(__NR_setfsuid) + if (number == __NR_setfsuid) return 0; +#endif +#if defined(__NR_setfsuid32) + if (number == __NR_setfsuid32) return 0; +#endif +#if defined(__NR_setfsgid) + if (number == __NR_setfsgid) return 0; +#endif +#if defined(__NR_setfsgid32) + if (number == __NR_setfsgid32) return 0; +#endif +#if defined(__NR_getuid) + if (number == __NR_getuid) return 0; +#endif +#if defined(__NR_getuid32) + if (number == __NR_getuid32) return 0; +#endif +#if defined(__NR_geteuid) + if (number == __NR_geteuid) return 0; +#endif +#if defined(__NR_geteuid32) + if (number == __NR_geteuid32) return 0; +#endif +#if defined(__NR_getgid) + if (number == __NR_getgid) return 0; +#endif +#if defined(__NR_getgid32) + if (number == __NR_getgid32) return 0; +#endif +#if defined(__NR_getegid) + if (number == __NR_getegid) return 0; +#endif +#if defined(__NR_getegid32) + if (number == __NR_getegid32) return 0; +#endif +#if defined(__NR_getresuid) + if (number == __NR_getresuid) { + uid_t *ruid = (uid_t *)arg1; + uid_t *euid = (uid_t *)arg2; + uid_t *suid = (uid_t *)arg3; + if (ruid) *ruid = 0; + if (euid) *euid = 0; + if (suid) *suid = 0; + return 0; + } +#endif +#if defined(__NR_getresuid32) + if (number == __NR_getresuid32) { + uid_t *ruid = (uid_t *)arg1; + uid_t *euid = (uid_t *)arg2; + uid_t *suid = (uid_t *)arg3; + if (ruid) *ruid = 0; + if (euid) *euid = 0; + if (suid) *suid = 0; + return 0; + } +#endif +#if defined(__NR_getresgid) + if (number == __NR_getresgid) { + gid_t *rgid = (gid_t *)arg1; + gid_t *egid = (gid_t *)arg2; + gid_t *sgid = (gid_t *)arg3; + if (rgid) *rgid = 0; + if (egid) *egid = 0; + if (sgid) *sgid = 0; + return 0; + } +#endif +#if defined(__NR_getresgid32) + if (number == __NR_getresgid32) { + gid_t *rgid = (gid_t *)arg1; + gid_t *egid = (gid_t *)arg2; + gid_t *sgid = (gid_t *)arg3; + if (rgid) *rgid = 0; + if (egid) *egid = 0; + if (sgid) *sgid = 0; + return 0; + } +#endif + + return call_orig_syscall(number, arg1, arg2, arg3, arg4, arg5, arg6); +} + +#endif /* !DDNATV_HOST_TEST */ diff --git a/tools/nativeguest/hook/setup.c b/tools/nativeguest/hook/setup.c new file mode 100644 index 0000000000..90c5d87afe --- /dev/null +++ b/tools/nativeguest/hook/setup.c @@ -0,0 +1,384 @@ +// Part of libddnatv-hook.so, included by ddnatv-hook.c (one translation unit, so the +// parts share their static functions and are built with the same command as before). +// +// Start-up (DDNATV_ROOT, certificate and time zone defaults), /proc/self/exe, rewrite_path() and +// the short names of Unix sockets. + +#ifndef DDNATV_HOST_TEST + +static char g_real_exe[PATH_MAX] = {0}; +// DDNATV_PRELOAD: guest paths of libraries every program loads before the hook (what +// /etc/ld.so.preload does for programs run by the rootfs's own ld.so), and the same as host paths. +static char *g_preload_guest = NULL; +static char *g_preload_host = NULL; +static int g_initialized = 0; + +static void init_ddnatv_hook(void) { + if (g_initialized) return; + const char *root = getenv("DDNATV_ROOT"); + if (root && strlen(root) > 0) { + size_t len = strlen(root); + if (len > sizeof(g_ddnatv_root) - 1) len = sizeof(g_ddnatv_root) - 1; + if (root[len - 1] == '/') len--; + ddnatv_set_root(root, len); + } else { + Dl_info info; + if (dladdr((void *)init_ddnatv_hook, &info) && info.dli_fname) { + const char *p = strstr(info.dli_fname, "/usr/lib/libddnatv-hook"); + if (p && p > info.dli_fname) { + size_t len = p - info.dli_fname; + if (len < sizeof(g_ddnatv_root)) { + ddnatv_set_root(info.dli_fname, len); + } + } + } + } + ddnatv_load_binds(getenv("DDNATV_BINDS")); + const char *hostname = getenv("DDNATV_HOSTNAME"); + if (hostname && hostname[0] && strlen(hostname) < sizeof(g_hostname)) ddnatv_copy_cstr(g_hostname, sizeof(g_hostname), hostname); + const char *link_root = getenv("DDNATV_LINK_ROOT"); + if (link_root && link_root[0] == '/' && strlen(link_root) < sizeof(g_link_root)) { + ddnatv_copy_cstr(g_link_root, sizeof(g_link_root), link_root); + g_link_root_len = strlen(g_link_root); + while (g_link_root_len > 1 && g_link_root[g_link_root_len - 1] == '/') g_link_root[--g_link_root_len] = 0; + } + const char *preload = getenv("DDNATV_PRELOAD"); + if (preload && preload[0] && g_ddnatv_root_len > 0) { + size_t libs = 1; + for (const char *p = preload; *p; p++) libs += *p == ':'; + size_t cap = libs * (PATH_MAX + 1); + char *host = malloc(cap); + if (host) { + size_t used = 0; + host[0] = '\0'; + char *copy = strdup(preload); + char *save = NULL; + for (char *lib = copy ? strtok_r(copy, ":", &save) : NULL; lib; lib = strtok_r(NULL, ":", &save)) { + if (lib[0] != '/') continue; + char mapped_buf[PATH_MAX]; + const char *mapped = rewrite_path_in_root(lib, mapped_buf, sizeof(mapped_buf)); + size_t mapped_len = strlen(mapped); + if (used + mapped_len + 2 > cap) break; + if (used) host[used++] = ':'; + used = ddnatv_append(host, cap, used, mapped, mapped_len); + } + free(copy); + g_preload_host = host; + g_preload_guest = strdup(preload); + } + } + const char *curr_real_exe = getenv("DDNATV_REAL_EXE"); + if (curr_real_exe && curr_real_exe[0] != '\0') { + ddnatv_copy_cstr(g_real_exe, sizeof(g_real_exe), curr_real_exe); + } + if (g_ddnatv_root[0] != '\0') { + const char *curr_tzdir = getenv("TZDIR"); + if (!curr_tzdir || curr_tzdir[0] == '\0') { + char tzdir_buf[PATH_MAX]; + snprintf(tzdir_buf, sizeof(tzdir_buf), "%s/usr/share/zoneinfo", g_ddnatv_root); + setenv("TZDIR", tzdir_buf, 0); + } + + const char *curr_cert = getenv("SSL_CERT_FILE"); + if (!curr_cert || curr_cert[0] == '\0' || strcmp(curr_cert, "/etc/ssl/certs/ca-certificates.crt") == 0) { + char cert_buf[PATH_MAX]; + snprintf(cert_buf, sizeof(cert_buf), "%s/etc/ssl/certs/ca-certificates.crt", g_ddnatv_root); + setenv("SSL_CERT_FILE", cert_buf, 1); + } + + const char *curr_cert_dir = getenv("SSL_CERT_DIR"); + if (!curr_cert_dir || curr_cert_dir[0] == '\0' || strcmp(curr_cert_dir, "/etc/ssl/certs") == 0) { + char cert_dir_buf[PATH_MAX]; + snprintf(cert_dir_buf, sizeof(cert_dir_buf), "%s/etc/ssl/certs:/system/etc/security/cacerts", g_ddnatv_root); + setenv("SSL_CERT_DIR", cert_dir_buf, 1); + } + + const char *curr_curl = getenv("CURL_CA_BUNDLE"); + if (!curr_curl || curr_curl[0] == '\0' || strcmp(curr_curl, "/etc/ssl/certs/ca-certificates.crt") == 0) { + char curl_buf[PATH_MAX]; + snprintf(curl_buf, sizeof(curl_buf), "%s/etc/ssl/certs/ca-certificates.crt", g_ddnatv_root); + setenv("CURL_CA_BUNDLE", curl_buf, 1); + } + + const char *curr_godebug = getenv("GODEBUG"); + if (!curr_godebug || curr_godebug[0] == '\0') { + setenv("GODEBUG", "netdns=cgo", 0); + } else if (strstr(curr_godebug, "netdns") == NULL) { + char godebug_buf[512]; + snprintf(godebug_buf, sizeof(godebug_buf), "%s,netdns=cgo", curr_godebug); + setenv("GODEBUG", godebug_buf, 1); + } + } + g_initialized = 1; +} + +// Before the program runs: init_ddnatv_hook() sets variables, and setenv() may move the block the +// environment is kept in. A program that had changed its environment (putenv, setenv) and passed it +// to execv() before its first call into the hook handed the exec code a block that was freed by the +// time it was read. +__attribute__((constructor(103))) static void init_ddnatv_hook_early(void) { + init_ddnatv_hook(); + // The kernel names the process after what it executed, the rootfs ld.so: process monitors, and + // the app's own checks of /proc//comm (steam, wineserver), saw only "ld-linux-aarch64.so.1" + const char *name = program_invocation_short_name; + if (g_ddnatv_root[0] != '\0' && name && name[0] && strncmp(name, "ld-linux", 8) != 0) { + prctl(PR_SET_NAME, (unsigned long)name, 0, 0, 0); + } +} + +void tzset(void) { + static void (*orig_tzset)(void) = NULL; + if (!orig_tzset) orig_tzset = (void (*)(void))dlsym(RTLD_NEXT, "tzset"); + init_ddnatv_hook(); + if (g_ddnatv_root[0] != '\0') { + const char *curr_tzdir = getenv("TZDIR"); + if (!curr_tzdir || curr_tzdir[0] == '\0') { + char tzdir_buf[PATH_MAX]; + snprintf(tzdir_buf, sizeof(tzdir_buf), "%s/usr/share/zoneinfo", g_ddnatv_root); + setenv("TZDIR", tzdir_buf, 0); + } + } + if (orig_tzset) orig_tzset(); +} + +static int is_proc_self_exe(const char *path) { + if (!path) return 0; + if (strcmp(path, "/proc/self/exe") == 0 || + strcmp(path, "/proc/thread-self/exe") == 0) { + return 1; + } + if (strncmp(path, "/proc/", 6) == 0) { + const char *p = path + 6; + while (*p >= '0' && *p <= '9') p++; + if (strcmp(p, "/exe") == 0) { + pid_t pid = (pid_t)atoi(path + 6); + if (pid == getpid()) { + return 1; + } + } + } + return 0; +} + +static ssize_t handle_proc_self_exe(char *buf, size_t bufsiz) { + if (!buf || bufsiz == 0) { + errno = EINVAL; + return -1; + } + init_ddnatv_hook(); + if (g_real_exe[0] == '\0') { + int fd = open("/proc/self/cmdline", O_RDONLY); + if (fd >= 0) { + char cmdline[8192]; + ssize_t n = read(fd, cmdline, sizeof(cmdline) - 1); + close(fd); + if (n > 0) { + cmdline[n] = '\0'; + char *args[64] = {0}; + int ac = 0; + char *p = cmdline; + while (p < cmdline + n && ac < 64) { + args[ac++] = p; + p += strlen(p) + 1; + } + for (int i = 0; i < ac; i++) { + if (strcmp(args[i], "--argv0") == 0 && i + 2 < ac) { + strncpy(g_real_exe, args[i + 2], sizeof(g_real_exe) - 1); + g_real_exe[sizeof(g_real_exe) - 1] = '\0'; + break; + } + } + if (g_real_exe[0] == '\0' && ac > 0 && args[0] && args[0][0] != '\0') { + strncpy(g_real_exe, args[0], sizeof(g_real_exe) - 1); + g_real_exe[sizeof(g_real_exe) - 1] = '\0'; + } + } + } + } + + if (g_real_exe[0] != '\0') { + char stripped[PATH_MAX]; + const char *out_path = g_real_exe; + if (g_ddnatv_root[0] != '\0') { + size_t rlen = g_ddnatv_root_len; + if (strncmp(g_real_exe, g_ddnatv_root, rlen) == 0 && + (g_real_exe[rlen] == '/' || g_real_exe[rlen] == '\0')) { + out_path = g_real_exe + rlen; + if (out_path[0] == '\0') out_path = "/"; + } + } + strncpy(stripped, out_path, sizeof(stripped) - 1); + stripped[sizeof(stripped) - 1] = '\0'; + + size_t len = strlen(stripped); + size_t copy_len = (len < bufsiz) ? len : bufsiz; + memcpy(buf, stripped, copy_len); + return (ssize_t)copy_len; + } + return -1; +} + +static const char *rewrite_path(const char *path, char *buffer, size_t bufsize) { + if (!path) return NULL; + // Relative paths must NEVER be rewritten to rootfs root + if (path[0] != '/') return path; + init_ddnatv_hook(); + return rewrite_path_in_root(path, buffer, bufsize); +} + +// rewrite_path() for calls that follow a symbolic link in the last component. In a mount whose +// source is elsewhere the kernel would follow the link's absolute guest target on Android's own +// tree (a Flatpak app's /app/bin/PINBALL.DAT -> /app/extra/Pinball/PINBALL.DAT), so the link is +// followed in the guest's view first. The rootfs's own links were made relative already. +static const char *rewrite_path_follow(const char *path, char *buffer, size_t bufsize) { + if (!path) return NULL; + if (path[0] != '/') return path; + init_ddnatv_hook(); + int moved = 0; + for (int i = 0; i < g_nbinds; i++) { + const struct ddnatv_bind *b = &g_binds[i]; + if (path[1] == b->dst[1] && is_path_prefix(path, b->dst, b->dst_len)) { moved = !b->identity; break; } + } + char from_source[PATH_MAX]; + if (!moved) { + // or a mount's real place, as /proc/self/exe and getcwd() give it (a Flatpak app's checkout) + const struct ddnatv_bind *best = NULL; + for (int i = 0; i < g_nbinds; i++) { + const struct ddnatv_bind *b = &g_binds[i]; + if (b->identity || !is_path_prefix(path, b->src, b->src_len)) continue; + if (!best || b->src_len > best->src_len) best = b; + } + if (!best) { + const char *host = rewrite_path_in_root(path, buffer, bufsize); +#if defined(__aarch64__) + // A link in the rootfs with an absolute guest target that the hook did not write (one made + // under proot, or copied from Proton's template prefix, as Wine's "z:" -> "/") is followed + // by the kernel on Android's own tree: Wine found no drive for any path and gave games + // \\?\unix\ names, which an NW.js game could not load its DLLs from. + if (is_android_host_path(path)) return host; + char target[PATH_MAX]; + long n = raw_readlinkat(AT_FDCWD, host, target, sizeof(target) - 1); + if (n <= 0 || target[0] != '/') return host; + target[n] = '\0'; + if (is_android_host_path(target) || + (g_ddnatv_root_len && strncmp(target, g_ddnatv_root, g_ddnatv_root_len) == 0)) return host; + char guest_path[PATH_MAX]; + ddnatv_copy_cstr(guest_path, sizeof(guest_path), path); + char guest_target[PATH_MAX]; + const char *followed = follow_guest_link(guest_path, guest_target, sizeof(guest_target)); + char mapped[PATH_MAX]; + ddnatv_copy_cstr(buffer, bufsize, rewrite_path_in_root(followed, mapped, sizeof(mapped))); + return buffer; +#else + return host; +#endif + } + size_t n = ddnatv_append(from_source, sizeof(from_source), 0, best->dst, best->dst_len); + ddnatv_append(from_source, sizeof(from_source), n, path + best->src_len, strlen(path + best->src_len)); + path = from_source; + } + char guest[PATH_MAX]; + const char *followed = follow_guest_link(path, guest, sizeof(guest)); + char mapped[PATH_MAX]; + const char *host = rewrite_path_in_root(followed, mapped, sizeof(mapped)); + // the result may be `followed` or `path` itself, which can live here + ddnatv_copy_cstr(buffer, bufsize, host); + return buffer; +} + +// Whether the rootfs keeps bin (pair DDNATV_USRMERGE_BIN) or sbin as a symlink into /usr, as +// Ubuntu 24.04 does. Checked once per process with one readlink(). +static int rootfs_pair_is_merged(int pair) { + static int known[3] = { 0, -1, -1 }; + if (known[pair] >= 0) return known[pair]; + static ssize_t (*orig_readlink)(const char *, char *, size_t) = NULL; + if (!orig_readlink) orig_readlink = (ssize_t (*)(const char *, char *, size_t))dlsym(RTLD_NEXT, "readlink"); + const char *dir = (pair == DDNATV_USRMERGE_BIN) ? "/bin" : "/sbin"; + const char *usr_dir = (pair == DDNATV_USRMERGE_BIN) ? "usr/bin" : "usr/sbin"; + char path[PATH_MAX]; + char link[16]; + size_t n = ddnatv_append(path, sizeof(path), 0, g_ddnatv_root, g_ddnatv_root_len); + ddnatv_append(path, sizeof(path), n, dir, strlen(dir)); + int saved_errno = errno; + ssize_t len = orig_readlink ? orig_readlink(path, link, sizeof(link) - 1) : -1; + errno = saved_errno; + int merged = 0; + if (len > 0) { + link[len] = '\0'; + size_t ulen = strlen(usr_dir); + merged = strncmp(link, usr_dir, ulen) == 0 && (link[ulen] == '\0' || (link[ulen] == '/' && link[ulen + 1] == '\0')); + } + known[pair] = merged; + return merged; +} + +// The other spelling of a missing rootfs path under bin/sbin, or NULL when there is none or both +// spellings reach the same directory (the retry could only fail again). +static const char *usrmerge_retry_path(const char *target, char *alt, size_t altsz) { + const char *sub = get_rootfs_subpath(target); + if (!sub) return NULL; + int pair = usrmerge_alt_path(sub, alt, altsz); + if (pair == 0 || rootfs_pair_is_merged(pair)) return NULL; + return alt; +} + +static const char *rewrite_unix_socket_path(const char *sun_path, char *out_buf, size_t out_size) { + if (!sun_path || out_size == 0) return sun_path; + // Abstract sockets start with null byte (\0); leave untouched + if (sun_path[0] == '\0') { + return sun_path; + } + + char full[PATH_MAX]; + const char *rw = (sun_path[0] == '/') ? rewrite_path(sun_path, full, sizeof(full)) : sun_path; + size_t rw_len = strlen(rw); + + // If rewritten path fits safely in sockaddr_un.sun_path (usually 108 bytes) + if (rw_len < out_size) { + strncpy(out_buf, rw, out_size - 1); + out_buf[out_size - 1] = '\0'; + return out_buf; + } + + // Path exceeds sockaddr_un 108-byte limit! + // Deterministically hash the path into /tmp to guarantee it fits safely (< 80 bytes) + // while remaining 100% deterministic between server and client. + unsigned long long hash = 14695981039346656037ULL; + for (const char *p = rw; *p; p++) { + hash ^= (unsigned char)(*p); + hash *= 1099511628211ULL; + } + + init_ddnatv_hook(); + if (g_ddnatv_root[0] != '\0') { + snprintf(out_buf, out_size, "%s/tmp/.ctx_sock_%016llx", g_ddnatv_root, hash); + } else { + snprintf(out_buf, out_size, "/tmp/.ctx_sock_%016llx", hash); + } + out_buf[out_size - 1] = '\0'; + return out_buf; +} + +static void unlink_mapped_unix_socket(const char *target) { + if (!target) return; + size_t t_len = strlen(target); + if (t_len >= 107) { + unsigned long long hash = 14695981039346656037ULL; + for (const char *p = target; *p; p++) { + hash ^= (unsigned char)(*p); + hash *= 1099511628211ULL; + } + char short_path[PATH_MAX]; + init_ddnatv_hook(); + if (g_ddnatv_root[0] != '\0') { + snprintf(short_path, sizeof(short_path), "%s/tmp/.ctx_sock_%016llx", g_ddnatv_root, hash); + } else { + snprintf(short_path, sizeof(short_path), "/tmp/.ctx_sock_%016llx", hash); + } + static int (*orig_unlink)(const char *) = NULL; + if (!orig_unlink) orig_unlink = (int (*)(const char *))dlsym(RTLD_NEXT, "unlink"); + if (orig_unlink) orig_unlink(short_path); + } +} + +#endif /* !DDNATV_HOST_TEST */ diff --git a/tools/nativeguest/hook/signals.c b/tools/nativeguest/hook/signals.c new file mode 100644 index 0000000000..0b5765070d --- /dev/null +++ b/tools/nativeguest/hook/signals.c @@ -0,0 +1,233 @@ +// Part of libddnatv-hook.so, included by ddnatv-hook.c (one translation unit, so the +// parts share their static functions and are built with the same command as before). +// +// The SIGSYS handler for system calls Android's seccomp filter blocks, and the signal hooks that +// keep programs from replacing or blocking it. + +#ifndef DDNATV_HOST_TEST + +#ifndef SYS_SECCOMP +#define SYS_SECCOMP 1 +#endif + +static int (*get_real_sigaction(void))(int, const struct sigaction *, struct sigaction *); + +// A program's own SIGSYS handler, for the traps of a seccomp filter it installed itself (Firefox's +// and Chromium's sandboxes emulate the calls they trap there). Android's app filter traps with data +// 0; such a sandbox's traps carry their own nonzero data, which the kernel gives as si_errno. +static struct sigaction g_app_sigsys; +static int g_app_sigsys_set = 0; + +static void remember_app_sigsys(const struct sigaction *act, struct sigaction *oldact) { + if (oldact) { + if (g_app_sigsys_set) { + *oldact = g_app_sigsys; + } else { + memset(oldact, 0, sizeof(*oldact)); + oldact->sa_handler = SIG_DFL; + } + } + if (act) { + g_app_sigsys = *act; + g_app_sigsys_set = act->sa_handler != SIG_DFL && act->sa_handler != SIG_IGN; + } +} + +// Intercept SECCOMP blocked syscalls (SIGSYS), resolve sandbox/landlock gracefully, and advance PC +static void ddnatv_sigsys_handler(int sig, siginfo_t *info, void *ctx) { + if (!ctx || !info) return; + if (info->si_code != SYS_SECCOMP) { + int (*real_sig)(int, const struct sigaction *, struct sigaction *) = get_real_sigaction(); + if (real_sig) { + struct sigaction sa_dfl; + memset(&sa_dfl, 0, sizeof(sa_dfl)); + sa_dfl.sa_handler = SIG_DFL; + sigemptyset(&sa_dfl.sa_mask); + real_sig(sig, &sa_dfl, NULL); + } + raise(sig); + return; + } + if (info->si_errno != 0 && g_app_sigsys_set) { + if (g_app_sigsys.sa_flags & SA_SIGINFO) g_app_sigsys.sa_sigaction(sig, info, ctx); + else g_app_sigsys.sa_handler(sig); + return; + } + ucontext_t *uctx = (ucontext_t *)ctx; + + int sys_nr = info->si_syscall; + long ret_val = is_sigsys_synthetic_success_syscall(sys_nr) ? 0 : -ENOSYS; + +#if defined(__aarch64__) + uctx->uc_mcontext.regs[0] = (uint64_t)ret_val; + if (uctx->uc_mcontext.pc >= 4) { + uint32_t insn_at_pc = 0; + uint32_t insn_before_pc = 0; + memcpy(&insn_at_pc, (const void *)uctx->uc_mcontext.pc, sizeof(insn_at_pc)); + memcpy(&insn_before_pc, (const void *)(uctx->uc_mcontext.pc - 4), sizeof(insn_before_pc)); + // On SECCOMP_RET_TRAP, the kernel already advanced PC past svc #0 (*(pc - 4) is svc #0). + // Only advance PC if PC itself points to svc #0 and *(pc - 4) does not. + int at_is_svc = ((insn_at_pc & 0xffe0001fU) == 0xd4000001U); + int prev_is_svc = ((insn_before_pc & 0xffe0001fU) == 0xd4000001U); + if (at_is_svc && !prev_is_svc) { + uctx->uc_mcontext.pc += 4; + } + } +#elif defined(__arm__) + uctx->uc_mcontext.arm_r0 = (unsigned long)ret_val; + if (uctx->uc_mcontext.arm_pc >= 4) { + if (uctx->uc_mcontext.arm_cpsr & 0x20) { + uint16_t insn_at_pc = 0; + uint16_t insn_before_pc = 0; + memcpy(&insn_at_pc, (const void *)uctx->uc_mcontext.arm_pc, sizeof(insn_at_pc)); + memcpy(&insn_before_pc, (const void *)(uctx->uc_mcontext.arm_pc - 2), sizeof(insn_before_pc)); + int at_is_svc = ((insn_at_pc & 0xff00U) == 0xdf00U); + int prev_is_svc = ((insn_before_pc & 0xff00U) == 0xdf00U); + if (at_is_svc && !prev_is_svc) { + uctx->uc_mcontext.arm_pc += 2; + } + } else { + uint32_t insn_at_pc = 0; + uint32_t insn_before_pc = 0; + memcpy(&insn_at_pc, (const void *)uctx->uc_mcontext.arm_pc, sizeof(insn_at_pc)); + memcpy(&insn_before_pc, (const void *)(uctx->uc_mcontext.arm_pc - 4), sizeof(insn_before_pc)); + int at_is_svc = ((insn_at_pc & 0x0f000000U) == 0x0f000000U); + int prev_is_svc = ((insn_before_pc & 0x0f000000U) == 0x0f000000U); + if (at_is_svc && !prev_is_svc) { + uctx->uc_mcontext.arm_pc += 4; + } + } + } +#elif defined(__x86_64__) && defined(REG_RAX) + uctx->uc_mcontext.gregs[REG_RAX] = (greg_t)ret_val; + if (uctx->uc_mcontext.gregs[REG_RIP] >= 2) { + unsigned char insn_at[2] = {0}; + unsigned char insn_prev[2] = {0}; + memcpy(insn_at, (const void *)uctx->uc_mcontext.gregs[REG_RIP], sizeof(insn_at)); + memcpy(insn_prev, (const void *)(uctx->uc_mcontext.gregs[REG_RIP] - 2), sizeof(insn_prev)); + int at_is_sys = (insn_at[0] == 0x0f && insn_at[1] == 0x05); + int prev_is_sys = (insn_prev[0] == 0x0f && insn_prev[1] == 0x05); + if (at_is_sys && !prev_is_sys) { + uctx->uc_mcontext.gregs[REG_RIP] += 2; + } + } +#elif defined(__i386__) && defined(REG_EAX) + uctx->uc_mcontext.gregs[REG_EAX] = (greg_t)ret_val; + if (uctx->uc_mcontext.gregs[REG_EIP] >= 2) { + unsigned char insn_at[2] = {0}; + unsigned char insn_prev[2] = {0}; + memcpy(insn_at, (const void *)uctx->uc_mcontext.gregs[REG_EIP], sizeof(insn_at)); + memcpy(insn_prev, (const void *)(uctx->uc_mcontext.gregs[REG_EIP] - 2), sizeof(insn_prev)); + int at_is_sys = (insn_at[0] == 0xcd && insn_at[1] == 0x80); + int prev_is_sys = (insn_prev[0] == 0xcd && insn_prev[1] == 0x80); + if (at_is_sys && !prev_is_sys) { + uctx->uc_mcontext.gregs[REG_EIP] += 2; + } + } +#endif +} + +static int (*get_real_sigaction(void))(int, const struct sigaction *, struct sigaction *) { + static int (*real_sigaction)(int, const struct sigaction *, struct sigaction *) = NULL; + if (!real_sigaction) { + real_sigaction = (int (*)(int, const struct sigaction *, struct sigaction *))dlsym(RTLD_NEXT, "sigaction"); + if (!real_sigaction) { + real_sigaction = (int (*)(int, const struct sigaction *, struct sigaction *))dlsym(RTLD_DEFAULT, "sigaction"); + } + } + return real_sigaction; +} + +__attribute__((constructor(101))) static void install_sigsys_handler(void) { + int (*real_sig)(int, const struct sigaction *, struct sigaction *) = get_real_sigaction(); + if (!real_sig) return; + + struct sigaction sa; + memset(&sa, 0, sizeof(sa)); + sa.sa_sigaction = ddnatv_sigsys_handler; + sa.sa_flags = SA_SIGINFO | SA_RESTART; + sigemptyset(&sa.sa_mask); + real_sig(SIGSYS, &sa, NULL); +} + +int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact) { + int (*real_sig)(int, const struct sigaction *, struct sigaction *) = get_real_sigaction(); + if (!real_sig) return -1; + + if (signum == SIGSYS) { + if (act && act->sa_sigaction == ddnatv_sigsys_handler) { + return real_sig(signum, act, oldact); + } + remember_app_sigsys(act, oldact); + return 0; + } + return real_sig(signum, act, oldact); +} + +int rt_sigaction(int signum, const struct sigaction *act, struct sigaction *oldact, size_t sigsetsize) { + static int (*orig_rt_sigaction)(int, const struct sigaction *, struct sigaction *, size_t) = NULL; + if (!orig_rt_sigaction) orig_rt_sigaction = (int (*)(int, const struct sigaction *, struct sigaction *, size_t))dlsym(RTLD_NEXT, "rt_sigaction"); + + if (signum == SIGSYS) { + if (act && act->sa_sigaction == ddnatv_sigsys_handler) { + return orig_rt_sigaction ? orig_rt_sigaction(signum, act, oldact, sigsetsize) : 0; + } + remember_app_sigsys(act, oldact); + return 0; + } + return orig_rt_sigaction ? orig_rt_sigaction(signum, act, oldact, sigsetsize) : -1; +} + +int __libc_sigaction(int signum, const struct sigaction *act, struct sigaction *oldact) { + return sigaction(signum, act, oldact); +} + +typedef void (*sighandler_t)(int); +sighandler_t signal(int signum, sighandler_t handler) { + static sighandler_t (*orig_signal)(int, sighandler_t) = NULL; + if (!orig_signal) orig_signal = (sighandler_t (*)(int, sighandler_t))dlsym(RTLD_NEXT, "signal"); + if (signum == SIGSYS) { + struct sigaction act, old; + memset(&act, 0, sizeof(act)); + act.sa_handler = handler; + remember_app_sigsys(&act, &old); + return old.sa_handler; + } + return orig_signal ? orig_signal(signum, handler) : NULL; +} + +int sigprocmask(int how, const sigset_t *set, sigset_t *oldset) { + static int (*orig_sigprocmask)(int, const sigset_t *, sigset_t *) = NULL; + if (!orig_sigprocmask) orig_sigprocmask = (int (*)(int, const sigset_t *, sigset_t *))dlsym(RTLD_NEXT, "sigprocmask"); + if (set && (how == SIG_BLOCK || how == SIG_SETMASK)) { + sigset_t mod_set = *set; + sigdelset(&mod_set, SIGSYS); + return orig_sigprocmask ? orig_sigprocmask(how, &mod_set, oldset) : 0; + } + return orig_sigprocmask ? orig_sigprocmask(how, set, oldset) : 0; +} + +int pthread_sigmask(int how, const sigset_t *set, sigset_t *oldset) { + static int (*orig_pthread_sigmask)(int, const sigset_t *, sigset_t *) = NULL; + if (!orig_pthread_sigmask) orig_pthread_sigmask = (int (*)(int, const sigset_t *, sigset_t *))dlsym(RTLD_NEXT, "pthread_sigmask"); + if (set && (how == SIG_BLOCK || how == SIG_SETMASK)) { + sigset_t mod_set = *set; + sigdelset(&mod_set, SIGSYS); + return orig_pthread_sigmask ? orig_pthread_sigmask(how, &mod_set, oldset) : 0; + } + return orig_pthread_sigmask ? orig_pthread_sigmask(how, set, oldset) : 0; +} + +int rt_sigprocmask(int how, const sigset_t *set, sigset_t *oldset, size_t sigsetsize) { + static int (*orig_rt_sigprocmask)(int, const sigset_t *, sigset_t *, size_t) = NULL; + if (!orig_rt_sigprocmask) orig_rt_sigprocmask = (int (*)(int, const sigset_t *, sigset_t *, size_t))dlsym(RTLD_NEXT, "rt_sigprocmask"); + if (set && (how == SIG_BLOCK || how == SIG_SETMASK)) { + sigset_t mod_set; + memcpy(&mod_set, set, sizeof(mod_set)); + sigdelset(&mod_set, SIGSYS); + return orig_rt_sigprocmask ? orig_rt_sigprocmask(how, &mod_set, oldset, sigsetsize) : 0; + } + return orig_rt_sigprocmask ? orig_rt_sigprocmask(how, set, oldset, sigsetsize) : 0; +} + +#endif /* !DDNATV_HOST_TEST */ diff --git a/tools/nativeguest/hook/sockets.c b/tools/nativeguest/hook/sockets.c new file mode 100644 index 0000000000..2903505f9b --- /dev/null +++ b/tools/nativeguest/hook/sockets.c @@ -0,0 +1,351 @@ +// Part of libddnatv-hook.so, included by ddnatv-hook.c (one translation unit, so the +// parts share their static functions and are built with the same command as before). +// +// Sockets: Unix socket paths in the rootfs, the redirected DNS queries of loopback DNS, and the +// TCP servers programs start (the app offers to open them in the browser). + +// The TCP port a listening socket was bound to, 0 for other sockets. +static int listening_tcp_port(int fd) { + struct sockaddr_storage ss; + socklen_t len = sizeof(ss); + memset(&ss, 0, sizeof(ss)); + if (syscall(SYS_getsockname, fd, (struct sockaddr *)&ss, &len) != 0) return 0; + if (ss.ss_family == AF_INET && len >= (socklen_t)sizeof(struct sockaddr_in)) + return ntohs(((struct sockaddr_in *)&ss)->sin_port); + if (ss.ss_family == AF_INET6 && len >= (socklen_t)sizeof(struct sockaddr_in6)) + return ntohs(((struct sockaddr_in6 *)&ss)->sin6_port); + return 0; +} + +// Tells the app that this program listens on [port]: $DDNATV_ROOT/run/ddnatv/listening/PORT with +// "PID NAME" (ListeningPorts). Raw system calls: nothing of this library runs again. +static void report_listening_port(const char *root, size_t root_len, int port, const char *name) { + if (root_len == 0 || port <= 0 || port > 65535) return; + char path[PATH_MAX]; + int n = snprintf(path, sizeof(path), "%.*s/run/ddnatv/listening/%d", (int)root_len, root, port); + if (n <= 0 || n >= (int)sizeof(path)) return; + int out = (int)syscall(SYS_openat, AT_FDCWD, path, O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC, 0600); + if (out < 0) return; // no app watching (the directory is the app's) + char line[160]; + int m = snprintf(line, sizeof(line), "%d %.100s\n", (int)getpid(), name && name[0] ? name : "?"); + if (m > 0) syscall(SYS_write, out, line, (size_t)(m < (int)sizeof(line) ? m : (int)sizeof(line) - 1)); + syscall(SYS_close, out); +} + +// The first port of the kernel's range for ports it picks itself, from the text of +// /proc/sys/net/ipv4/ip_local_port_range ("32768\t60999"); 32768, Linux's default, when there is none. +static int ephemeral_port_low(const char *range) { + if (!range) return 32768; + while (*range == ' ' || *range == '\t') range++; + int low = 0, digits = 0; + while (*range >= '0' && *range <= '9' && digits < 6) low = low * 10 + (*range++ - '0'), digits++; + return (digits > 0 && low > 0 && low <= 65535) ? low : 32768; +} + +// Whether listen() tells the app about a server on `port`, which it then connects to and sends an +// HTTP request (LocalServers). Only for a port the program chose (`chosen`) below the kernel's own +// range: a server whose port the kernel picked, or one in that range, is how programs talk to +// each other (Gradle's daemon, the Kotlin daemon, a JVM's debugger, test runners). Such a server +// often accepts one connection, so the app's own took the place of the program it waited for: +// that one read EOF ("Did not receive connection preamble" from Gradle, #51). Web servers people +// open (npm run dev, vite, python3 -m http.server, jupyter) are on ports such as 3000, 5173, 8000. +static int listening_port_is_reported(int chosen, int port, int ephemeral_low) { + return chosen && port > 0 && port < ephemeral_low; +} + +#ifndef DDNATV_HOST_TEST + +// The kernel's range, read once (raw system calls: nothing of this library runs again) +static int kernel_ephemeral_port_low(void) { + static int low = 0; + int v = __atomic_load_n(&low, __ATOMIC_RELAXED); + if (v) return v; + char text[64]; + ssize_t n = -1; + int fd = (int)syscall(SYS_openat, AT_FDCWD, "/proc/sys/net/ipv4/ip_local_port_range", O_RDONLY | O_CLOEXEC); + if (fd >= 0) { + n = syscall(SYS_read, fd, text, sizeof(text) - 1); + syscall(SYS_close, fd); + } + if (n > 0) text[n] = '\0'; + v = ephemeral_port_low(n > 0 ? text : NULL); + __atomic_store_n(&low, v, __ATOMIC_RELAXED); + return v; +} + +int listen(int sockfd, int backlog) { + static int (*orig_listen)(int, int) = NULL; + if (!orig_listen) orig_listen = (int (*)(int, int))dlsym(RTLD_NEXT, "listen"); + if (!orig_listen) { + errno = ENOSYS; + return -1; + } + int ret = orig_listen(sockfd, backlog); + if (ret == 0) { + int saved_errno = errno; + int port = is_chosen_port_fd(sockfd) ? listening_tcp_port(sockfd) : 0; + if (listening_port_is_reported(port > 0, port, kernel_ephemeral_port_low())) { + init_ddnatv_hook(); + extern char *program_invocation_short_name; + report_listening_port(g_ddnatv_root, g_ddnatv_root_len, port, program_invocation_short_name); + } + errno = saved_errno; + } + return ret; +} + +int bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen) { + static int (*orig_bind)(int, const struct sockaddr *, socklen_t) = NULL; + if (!orig_bind) orig_bind = (int (*)(int, const struct sockaddr *, socklen_t))dlsym(RTLD_NEXT, "bind"); + + if (addr && addrlen > offsetof(struct sockaddr_un, sun_path) && addr->sa_family == AF_UNIX) { + const struct sockaddr_un *sun = (const struct sockaddr_un *)addr; + if (sun->sun_path[0] != '\0') { + struct sockaddr_un mod_sun; + memset(&mod_sun, 0, sizeof(mod_sun)); + mod_sun.sun_family = AF_UNIX; + rewrite_unix_socket_path(sun->sun_path, mod_sun.sun_path, sizeof(mod_sun.sun_path)); + return orig_bind ? orig_bind(sockfd, (struct sockaddr *)&mod_sun, sizeof(mod_sun)) : -1; + } + } + int ret = orig_bind ? orig_bind(sockfd, addr, addrlen) : -1; + if (ret == 0 && addr) { + int saved_errno = errno; + int chosen = 0; + if (addr->sa_family == AF_INET && addrlen >= (socklen_t)sizeof(struct sockaddr_in)) + chosen = ((const struct sockaddr_in *)addr)->sin_port != 0; + else if (addr->sa_family == AF_INET6 && addrlen >= (socklen_t)sizeof(struct sockaddr_in6)) + chosen = ((const struct sockaddr_in6 *)addr)->sin6_port != 0; + set_chosen_port_fd(sockfd, chosen); + errno = saved_errno; + } + return ret; +} + +int connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen) { + static int (*orig_connect)(int, const struct sockaddr *, socklen_t) = NULL; + if (!orig_connect) orig_connect = (int (*)(int, const struct sockaddr *, socklen_t))dlsym(RTLD_NEXT, "connect"); + + if (addr && addrlen > offsetof(struct sockaddr_un, sun_path) && addr->sa_family == AF_UNIX) { + const struct sockaddr_un *sun = (const struct sockaddr_un *)addr; + if (sun->sun_path[0] != '\0') { + struct sockaddr_un mod_sun; + memset(&mod_sun, 0, sizeof(mod_sun)); + mod_sun.sun_family = AF_UNIX; + char guest[sizeof(sun->sun_path) + 1]; + size_t max = addrlen - offsetof(struct sockaddr_un, sun_path); + if (max > sizeof(sun->sun_path)) max = sizeof(sun->sun_path); + memcpy(guest, sun->sun_path, max); + guest[max] = '\0'; + char followed[PATH_MAX]; + const char *path = guest[0] == '/' ? follow_guest_link(guest, followed, sizeof(followed)) : guest; + rewrite_unix_socket_path(path, mod_sun.sun_path, sizeof(mod_sun.sun_path)); + return orig_connect ? orig_connect(sockfd, (struct sockaddr *)&mod_sun, sizeof(mod_sun)) : -1; + } + } + + if (addr && is_loopback_dns(addr, addrlen)) { + struct sockaddr_storage redirected; + socklen_t redirected_len = dns_redirect_target(addr, &redirected); + int ret = orig_connect ? orig_connect(sockfd, (struct sockaddr *)&redirected, redirected_len) : -1; + if (ret == 0 || errno == EINPROGRESS) { + int saved_errno = errno; + record_dns_redirect(sockfd, addr, addrlen); + errno = saved_errno; + } + return ret; + } + return orig_connect ? orig_connect(sockfd, addr, addrlen) : -1; +} + +ssize_t sendto(int sockfd, const void *buf, size_t len, int flags, + const struct sockaddr *dest_addr, socklen_t addrlen) { + static ssize_t (*orig_sendto)(int, const void *, size_t, int, const struct sockaddr *, socklen_t) = NULL; + if (!orig_sendto) orig_sendto = (ssize_t (*)(int, const void *, size_t, int, const struct sockaddr *, socklen_t))dlsym(RTLD_NEXT, "sendto"); + + if (dest_addr && is_loopback_dns(dest_addr, addrlen)) { + struct sockaddr_storage redirected; + socklen_t redirected_len = dns_redirect_target(dest_addr, &redirected); + record_dns_redirect(sockfd, dest_addr, addrlen); + return orig_sendto ? orig_sendto(sockfd, buf, len, flags, (struct sockaddr *)&redirected, redirected_len) : -1; + } + return orig_sendto ? orig_sendto(sockfd, buf, len, flags, dest_addr, addrlen) : -1; +} + +#if defined(__NR_getuid32) +#define DDNATV_NR_REAL_GETUID __NR_getuid32 +#define DDNATV_NR_REAL_GETGID __NR_getgid32 +#else +#define DDNATV_NR_REAL_GETUID __NR_getuid +#define DDNATV_NR_REAL_GETGID __NR_getgid +#endif + +// Credentials sent over a Unix socket (SCM_CREDENTIALS) have to be the process's own: the kernel +// refuses others with EPERM, and programs fill them in with getuid(), which is root's 0 here. +// PulseAudio's clients send them on every connection, which then failed ("Connection terminated"). +// Returns 1 with the message copied into mod (its control data into ctrl) and the ids made real. +static int real_scm_credentials(const struct msghdr *msg, struct msghdr *mod, char *ctrl, size_t ctrl_size) { + if (!msg || !msg->msg_control || msg->msg_controllen < sizeof(struct cmsghdr) || msg->msg_controllen > ctrl_size) return 0; + int found = 0; + for (struct cmsghdr *c = CMSG_FIRSTHDR(msg); c; c = CMSG_NXTHDR((struct msghdr *)msg, c)) { + if (c->cmsg_level == SOL_SOCKET && c->cmsg_type == SCM_CREDENTIALS) found = 1; + } + if (!found) return 0; + memcpy(mod, msg, sizeof(*mod)); + memcpy(ctrl, msg->msg_control, msg->msg_controllen); + mod->msg_control = ctrl; + for (struct cmsghdr *c = CMSG_FIRSTHDR(mod); c; c = CMSG_NXTHDR(mod, c)) { + if (c->cmsg_level != SOL_SOCKET || c->cmsg_type != SCM_CREDENTIALS || c->cmsg_len < CMSG_LEN(sizeof(struct ucred))) continue; + // a record that claims more than the buffer holds is the kernel's to refuse, not ours to read + if (c->cmsg_len > mod->msg_controllen - (size_t)((char *)c - ctrl)) break; + struct ucred cred; + memcpy(&cred, CMSG_DATA(c), sizeof(cred)); + cred.pid = getpid(); + cred.uid = (uid_t)call_orig_syscall(DDNATV_NR_REAL_GETUID, 0, 0, 0, 0, 0, 0); + cred.gid = (gid_t)call_orig_syscall(DDNATV_NR_REAL_GETGID, 0, 0, 0, 0, 0, 0); + memcpy(CMSG_DATA(c), &cred, sizeof(cred)); + } + return 1; +} + +ssize_t sendmsg(int sockfd, const struct msghdr *msg, int flags) { + static ssize_t (*orig_sendmsg)(int, const struct msghdr *, int) = NULL; + if (!orig_sendmsg) orig_sendmsg = (ssize_t (*)(int, const struct msghdr *, int))dlsym(RTLD_NEXT, "sendmsg"); + struct msghdr cred_msg; + char cred_ctrl[512] __attribute__((aligned(8))); + if (real_scm_credentials(msg, &cred_msg, cred_ctrl, sizeof(cred_ctrl))) msg = &cred_msg; + + if (msg && msg->msg_name && is_loopback_dns((const struct sockaddr *)msg->msg_name, msg->msg_namelen)) { + struct sockaddr_storage redirected; + socklen_t redirected_len = dns_redirect_target((const struct sockaddr *)msg->msg_name, &redirected); + struct msghdr mod_msg; + memcpy(&mod_msg, msg, sizeof(mod_msg)); + mod_msg.msg_name = &redirected; + mod_msg.msg_namelen = redirected_len; + record_dns_redirect(sockfd, (const struct sockaddr *)msg->msg_name, msg->msg_namelen); + return orig_sendmsg ? orig_sendmsg(sockfd, &mod_msg, flags) : -1; + } + return orig_sendmsg ? orig_sendmsg(sockfd, msg, flags) : -1; +} + +static void present_peer_as_root(struct ucred *cred) { + if (cred->uid == (uid_t)call_orig_syscall(DDNATV_NR_REAL_GETUID, 0, 0, 0, 0, 0, 0)) cred->uid = 0; + if (cred->gid == (gid_t)call_orig_syscall(DDNATV_NR_REAL_GETGID, 0, 0, 0, 0, 0, 0)) cred->gid = 0; +} + +// A server compares a peer's credentials with the user the peer claims, which is getuid()'s 0 +// here, while the kernel reports the app's ids: dbus-daemon refused every EXTERNAL login ("Did not +// receive a reply"), so the Plasma desktop never started. +int getsockopt(int sockfd, int level, int optname, void *optval, socklen_t *optlen) { + static int (*orig_getsockopt)(int, int, int, void *, socklen_t *) = NULL; + if (!orig_getsockopt) orig_getsockopt = (int (*)(int, int, int, void *, socklen_t *))dlsym(RTLD_NEXT, "getsockopt"); + if (!orig_getsockopt) { + errno = ENOSYS; + return -1; + } + int ret = orig_getsockopt(sockfd, level, optname, optval, optlen); + if (ret == 0 && level == SOL_SOCKET && optname == SO_PEERCRED && optval && optlen && *optlen >= sizeof(struct ucred)) { + struct ucred cred; + memcpy(&cred, optval, sizeof(cred)); + present_peer_as_root(&cred); + memcpy(optval, &cred, sizeof(cred)); + } + return ret; +} + +static void received_credentials_as_root(struct msghdr *msg) { + if (!msg || !msg->msg_control || msg->msg_controllen < sizeof(struct cmsghdr)) return; + for (struct cmsghdr *c = CMSG_FIRSTHDR(msg); c; c = CMSG_NXTHDR(msg, c)) { + if (c->cmsg_level != SOL_SOCKET || c->cmsg_type != SCM_CREDENTIALS || c->cmsg_len < CMSG_LEN(sizeof(struct ucred))) continue; + struct ucred cred; + memcpy(&cred, CMSG_DATA(c), sizeof(cred)); + present_peer_as_root(&cred); + memcpy(CMSG_DATA(c), &cred, sizeof(cred)); + } +} + +ssize_t recvfrom(int sockfd, void *buf, size_t len, int flags, + struct sockaddr *src_addr, socklen_t *addrlen) { + static ssize_t (*orig_recvfrom)(int, void *, size_t, int, struct sockaddr *, socklen_t *) = NULL; + if (!orig_recvfrom) orig_recvfrom = (ssize_t (*)(int, void *, size_t, int, struct sockaddr *, socklen_t *))dlsym(RTLD_NEXT, "recvfrom"); + + socklen_t cap = addrlen ? *addrlen : 0; + ssize_t ret = orig_recvfrom ? orig_recvfrom(sockfd, buf, len, flags, src_addr, addrlen) : -1; + if (ret > 0 && src_addr && addrlen) { + int saved_errno = errno; + restore_dns_source(sockfd, src_addr, cap, addrlen); + errno = saved_errno; + } + return ret; +} + +// What programs built with _FORTIFY_SOURCE call when the buffer's size is known; the check is +// glibc's +extern void __chk_fail(void) __attribute__((__noreturn__)); +ssize_t __recvfrom_chk(int sockfd, void *buf, size_t len, size_t buflen, int flags, + struct sockaddr *src_addr, socklen_t *addrlen) { + if (len > buflen) __chk_fail(); + return recvfrom(sockfd, buf, len, flags, src_addr, addrlen); +} + +ssize_t recvmsg(int sockfd, struct msghdr *msg, int flags) { + static ssize_t (*orig_recvmsg)(int, struct msghdr *, int) = NULL; + if (!orig_recvmsg) orig_recvmsg = (ssize_t (*)(int, struct msghdr *, int))dlsym(RTLD_NEXT, "recvmsg"); + + socklen_t cap = msg ? msg->msg_namelen : 0; + ssize_t ret = orig_recvmsg ? orig_recvmsg(sockfd, msg, flags) : -1; + if (ret >= 0) received_credentials_as_root(msg); + if (ret > 0 && msg && msg->msg_name) { + int saved_errno = errno; + restore_dns_source(sockfd, (struct sockaddr *)msg->msg_name, cap, &msg->msg_namelen); + errno = saved_errno; + } + return ret; +} + +int getpeername(int sockfd, struct sockaddr *addr, socklen_t *addrlen) { + static int (*orig_getpeername)(int, struct sockaddr *, socklen_t *) = NULL; + if (!orig_getpeername) orig_getpeername = (int (*)(int, struct sockaddr *, socklen_t *))dlsym(RTLD_NEXT, "getpeername"); + + socklen_t cap = addrlen ? *addrlen : 0; + int ret = orig_getpeername ? orig_getpeername(sockfd, addr, addrlen) : -1; + if (ret == 0 && addr && addrlen) restore_dns_source(sockfd, addr, cap, addrlen); + return ret; +} + +// accept() as accept4() without flags, the call bionic makes for both: Android's seccomp filter +// for apps is made from what bionic calls. On the x86_64 emulator a translated accept() answered +// with its system call number (43) as the new descriptor, and sshd failed every connection with +// "fcntl(43, F_GETFL): Bad file descriptor" (Perl, Python and nginx use accept4 themselves). +int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen) { + static int (*orig_accept4)(int, struct sockaddr *, socklen_t *, int) = NULL; + if (!orig_accept4) orig_accept4 = (int (*)(int, struct sockaddr *, socklen_t *, int))dlsym(RTLD_NEXT, "accept4"); + if (!orig_accept4) { + errno = ENOSYS; + return -1; + } + return orig_accept4(sockfd, addr, addrlen, 0); +} + +#ifndef AF_NETLINK +#define AF_NETLINK 16 +#endif +#ifndef NETLINK_AUDIT +#define NETLINK_AUDIT 9 +#endif + +int socket(int domain, int type, int protocol) { + static int (*orig_socket)(int, int, int) = NULL; + if (!orig_socket) orig_socket = (int (*)(int, int, int))dlsym(RTLD_NEXT, "socket"); + if (domain == AF_NETLINK && protocol == NETLINK_AUDIT) { + errno = EPROTONOSUPPORT; + return -1; + } + int fd = orig_socket ? orig_socket(domain, type, protocol) : -1; + // A new socket has not chosen a port, whatever the descriptor's last one had (close_range() and + // raw close system calls do not pass the hook's close()) + if (fd >= 0) set_chosen_port_fd(fd, 0); + return fd; +} + +#endif /* !DDNATV_HOST_TEST */ diff --git a/tools/nativeguest/hook/static_programs.c b/tools/nativeguest/hook/static_programs.c new file mode 100644 index 0000000000..406fca0da9 --- /dev/null +++ b/tools/nativeguest/hook/static_programs.c @@ -0,0 +1,345 @@ +// Part of libddnatv-hook.so, included by ddnatv-hook.c (one translation unit, so the +// parts share their static functions and are built with the same command as before). +// +// Statically linked programs: their seccomp-blocked system calls are patched before they run. + +// ---- Static programs ---------------------------------------------------------------------- +// A statically linked program (gcc -static) carries its own copy of glibc, whose system calls the +// preloaded hook never sees. The ones Android's seccomp filter answers with SIGSYS therefore kill it: +// set_robust_list at start-up, clone3 for every thread, rseq, and the others the hook's SIGSYS +// handler catches for dynamic programs. Before such a program runs, The native userland patches those call sites +// in its file to what that handler answers (0 for set_robust_list and the set*id family, -ENOSYS, +// which glibc falls back from, for the rest), as scripts/patch-bootstrap-ld.py does to the rootfs +// ld.so and libc at build time. The scanning is a pure function over a buffer, so tests/native can +// check it against the script. + +#define DDNATV_STATIC_WINDOW 16 // instructions between "mov x8, #nr" and its "svc #0" + +// AArch64: what the SIGSYS handler answers for syscall `nr`: 1 for 0, 2 for -ENOSYS, 0 to leave it. +// set_robust_list keeps the script's no-op (x0 then holds its non-error first argument). +static int a64_blocked_syscall(unsigned int nr) { + switch (nr) { + case 99: // set_robust_list + return 3; + case 100: // get_robust_list + case 143: case 144: case 145: case 146: case 147: case 149: // setregid setgid setreuid setuid setresuid setresgid + case 151: case 152: case 159: // setfsuid setfsgid setgroups + return 1; + case 97: case 217: case 218: case 219: // unshare add_key request_key keyctl + case 268: case 277: case 280: case 293: // setns seccomp bpf rseq + return 2; + default: + return (nr >= 424 && nr < 512) ? 2 : 0; // newer than Android's filter (clone3, close_range, ...) + } +} + +static uint32_t rd32(const unsigned char *p) { return (uint32_t)p[0] | ((uint32_t)p[1] << 8) | ((uint32_t)p[2] << 16) | ((uint32_t)p[3] << 24); } +static uint16_t rd16(const unsigned char *p) { return (uint16_t)(p[0] | (p[1] << 8)); } +static void wr32(unsigned char *p, uint32_t v) { p[0] = v & 0xff; p[1] = (v >> 8) & 0xff; p[2] = (v >> 16) & 0xff; p[3] = (v >> 24) & 0xff; } +static void wr16(unsigned char *p, uint16_t v) { p[0] = v & 0xff; p[1] = (v >> 8) & 0xff; } + +// An AArch64 instruction that ends the search for the "svc #0" of a "mov x8, #nr": a branch, another +// svc, or anything with x8 in its first register field (another write to x8, most likely). +static int a64_ends_syscall_window(uint32_t insn) { + if ((insn & 0x1f) == 8) return 1; + if ((insn & 0xffe0001f) == 0xd4000001u) return 1; // svc #imm + if ((insn & 0x7c000000u) == 0x14000000u) return 1; // b, bl + if ((insn & 0xff000010u) == 0x54000000u) return 1; // b.cond + if ((insn & 0x7e000000u) == 0x34000000u) return 1; // cbz, cbnz + if ((insn & 0x7e000000u) == 0x36000000u) return 1; // tbz, tbnz + if ((insn & 0xfe000000u) == 0xd6000000u) return 1; // br, blr, ret + return 0; +} + +static size_t a64_patch_seccomp_syscalls(unsigned char *data, size_t start, size_t end) { + size_t patched = 0; + start = (start + 3) & ~(size_t)3; + for (size_t pos = start; pos + 4 <= end; pos += 4) { + uint32_t insn = rd32(data + pos); + // movz x8, #nr / movz w8, #nr + if ((insn & 0x7fe0001fu) != 0x52800008u) continue; + int result = a64_blocked_syscall((insn >> 5) & 0xffff); + if (!result) continue; + for (size_t s = pos + 4, i = 0; s + 4 <= end && i < DDNATV_STATIC_WINDOW; s += 4, i++) { + uint32_t next = rd32(data + s); + if (next == 0xd4000001u) { // svc #0 + wr32(data + s, result == 3 ? 0xd503201fu /* nop */ + : result == 1 ? 0xd2800000u /* mov x0, #0 */ + : 0x928004a0u); /* mov x0, #-38 */ + patched++; + break; + } + if (a64_ends_syscall_window(next)) break; + } + } + return patched; +} + +// 32-bit ARM: the three calls glibc makes on its own, with the exact patterns of the script +// (ARM mode, Thumb-2 with r7, and Thumb-2 through __libc_do_syscall with r12). +static long thumb_bl_target(const unsigned char *data, size_t size, size_t off) { + if (off + 4 > size) return -1; + uint16_t hw1 = rd16(data + off), hw2 = rd16(data + off + 2); + if ((hw1 & 0xf800) != 0xf000 || (hw2 & 0xd000) != 0xd000) return -1; + long s = (hw1 >> 10) & 1; + long imm10 = hw1 & 0x3ff; + long j1 = (hw2 >> 13) & 1, j2 = (hw2 >> 11) & 1; + long imm11 = hw2 & 0x7ff; + long i1 = (j1 ^ s) ^ 1, i2 = (j2 ^ s) ^ 1; + long imm25 = (s << 24) | (i1 << 23) | (i2 << 22) | (imm10 << 12) | (imm11 << 1); + if (s) imm25 -= (1L << 25); + return (long)off + 4 + imm25; +} + +static size_t arm_patch_seccomp_syscalls(unsigned char *data, size_t start, size_t end) { + static const struct { uint32_t movw_r7; uint32_t repl; } arm[] = { + { 0xe3007152u, 0xe320f000u }, // movw r7, #338 (set_robust_list) -> nop + { 0xe30071b3u, 0xe3e00025u }, // movw r7, #435 (clone3) -> mvn r0, #37 + { 0xe300718eu, 0xe3e00025u }, // movw r7, #398 (rseq) -> mvn r0, #37 + }; + static const struct { uint16_t hw1, hw2; int nop_only; } thumb_r7[] = { + { 0xf240, 0x1752, 1 }, // movw r7, #338 + { 0xf240, 0x17b3, 0 }, // movw r7, #435 + { 0xf240, 0x178e, 0 }, // movw r7, #398 + }; + static const struct { uint16_t hw1, hw2; uint16_t repl1, repl2; } thumb_r12[] = { + { 0xf44f, 0x7ca9, 0xf04f, 0x0000 }, // mov.w r12, #338 -> mov.w r0, #0 + { 0xf44f, 0x7cc7, 0xf06f, 0x0025 }, // mov.w r12, #398 -> mvn.w r0, #37 + { 0xf240, 0x1cb3, 0xf06f, 0x0025 }, // movw r12, #435 -> mvn.w r0, #37 + }; + static const unsigned char do_syscall_stub[6] = { 0x80, 0xb5, 0x67, 0x46, 0x00, 0xdf }; + size_t patched = 0; + + size_t a4 = (start + 3) & ~(size_t)3, e4 = end & ~(size_t)3; + for (size_t pos = a4; pos + 4 < e4; pos += 4) { + uint32_t insn = rd32(data + pos); + for (size_t k = 0; k < sizeof(arm) / sizeof(arm[0]); k++) { + if (insn != arm[k].movw_r7) continue; + for (size_t s = pos + 4; s < e4 && s < pos + 68; s += 4) { + if (rd32(data + s) == 0xef000000u) { // svc #0 + wr32(data + s, arm[k].repl); + patched++; + break; + } + } + } + } + + size_t a2 = (start + 1) & ~(size_t)1, e2 = end & ~(size_t)1; + for (size_t t = a2; t + 4 < e2; t += 2) { + uint16_t hw1 = rd16(data + t), hw2 = rd16(data + t + 2); + int matched_r7 = 0; + for (size_t k = 0; k < sizeof(thumb_r7) / sizeof(thumb_r7[0]); k++) { + if (hw1 != thumb_r7[k].hw1 || hw2 != thumb_r7[k].hw2) continue; + matched_r7 = 1; + size_t limit = (e2 - 2 < t + 64 ? e2 - 2 : t + 64) + 2; + for (size_t s = t + 4; s < limit; s += 2) { + if (rd16(data + s) == 0xdf00) { // svc #0 + if (!thumb_r7[k].nop_only) { + wr16(data + t, 0xf06f); // mvn.w r0, #37 in place of the movw + wr16(data + t + 2, 0x0025); + } + wr16(data + s, 0xbf00); // nop + patched++; + break; + } + } + break; + } + if (matched_r7) continue; + for (size_t k = 0; k < sizeof(thumb_r12) / sizeof(thumb_r12[0]); k++) { + if (hw1 != thumb_r12[k].hw1 || hw2 != thumb_r12[k].hw2) continue; + size_t limit = (e2 - 4 < t + 48 ? e2 - 4 : t + 48) + 2; + for (size_t s = t + 4; s < limit; s += 2) { + long target = thumb_bl_target(data, end, s); + if (target >= (long)start && target + 6 <= (long)end && memcmp(data + target, do_syscall_stub, 6) == 0) { + wr16(data + s, thumb_r12[k].repl1); + wr16(data + s + 2, thumb_r12[k].repl2); + patched++; + break; + } + } + break; + } + } + return patched; +} + +#ifndef EM_ARM +#define EM_ARM 40 +#endif +#ifndef EM_AARCH64 +#define EM_AARCH64 183 +#endif + +// Patches the blocked syscalls in data[start, end), code of an ELF for `e_machine`; returns how many. +static size_t patch_seccomp_syscalls(unsigned char *data, size_t start, size_t end, uint16_t e_machine) { + if (!data || end <= start) return 0; + if (e_machine == EM_AARCH64) return a64_patch_seccomp_syscalls(data, start, end); + if (e_machine == EM_ARM) return arm_patch_seccomp_syscalls(data, start, end); + return 0; +} + +// Reads the program headers of an ELF file into `ph` (as 64-bit fields); returns their number, or -1. +struct ddnatv_phdr { uint32_t type, flags; uint64_t offset, filesz; }; +static int read_elf_phdrs(int fd, uint16_t *machine, struct ddnatv_phdr *ph, int max) { + unsigned char eh[64]; + if (pread(fd, eh, sizeof(eh), 0) < 52 || memcmp(eh, "\x7f" "ELF", 4) != 0 || eh[5] != 1) return -1; + int is64 = eh[4] == 2; + uint64_t phoff = is64 ? ((uint64_t)rd32(eh + 32) | ((uint64_t)rd32(eh + 36) << 32)) : rd32(eh + 28); + uint16_t phentsize = rd16(eh + (is64 ? 54 : 42)); + uint16_t phnum = rd16(eh + (is64 ? 56 : 44)); + *machine = rd16(eh + 18); + if (phentsize < (is64 ? 56 : 32) || phnum == 0 || phnum > max) return -1; + for (int i = 0; i < phnum; i++) { + unsigned char e[64]; + if (pread(fd, e, phentsize < sizeof(e) ? phentsize : sizeof(e), (off_t)(phoff + (uint64_t)i * phentsize)) < (is64 ? 56 : 32)) return -1; + ph[i].type = rd32(e); + if (is64) { + ph[i].flags = rd32(e + 4); + ph[i].offset = (uint64_t)rd32(e + 8) | ((uint64_t)rd32(e + 12) << 32); + ph[i].filesz = (uint64_t)rd32(e + 32) | ((uint64_t)rd32(e + 36) << 32); + } else { + ph[i].offset = rd32(e + 4); + ph[i].filesz = rd32(e + 16); + ph[i].flags = rd32(e + 24); + } + } + return phnum; +} + +// Whether the ELF has a Go build-ID note: Go programs make their own system calls and never these. +static int elf_is_go(int fd, const struct ddnatv_phdr *ph, int n) { + for (int i = 0; i < n; i++) { + if (ph[i].type != 4 /* PT_NOTE */ || ph[i].filesz < 16) continue; + unsigned char note[16]; + if (pread(fd, note, sizeof(note), (off_t)ph[i].offset) != sizeof(note)) continue; + if (rd32(note) == 4 && memcmp(note + 12, "Go\0\0", 4) == 0) return 1; + } + return 0; +} + +#define DDNATV_STATIC_XATTR "user.ddnatv.seccomp" +#define DDNATV_STATIC_MAX_CODE (256u * 1024 * 1024) + +#ifdef DDNATV_HAVE_GOSYS +static int prepare_go_program(int fd, const char *path, const struct stat *st); +static uint32_t go_blob_fingerprint(void); +static int go_disabled(void); +#endif + +// What was done to a file is recorded with its size and time, with the rootfs (a Go program carries +// the paths of it) and with the code Go programs are given (go_programs.c): a newer The native userland looks at +// the programs again. +static void static_marker(const struct stat *st, char *buf, size_t size) { + unsigned fingerprint = 0; + const char *off = ""; +#ifdef DDNATV_HAVE_GOSYS + fingerprint = go_blob_fingerprint(); + if (go_disabled()) off = " off"; +#endif + snprintf(buf, size, "3 %lld %lld.%09ld %08x %s%s", (long long)st->st_size, (long long)st->st_mtim.tv_sec, + (long)st->st_mtim.tv_nsec, fingerprint, g_ddnatv_root, off); +} + +// Makes a static program safe to start (see above). Runs before every start of one, so a program +// already handled (marked by an extended attribute that holds its size and modification time) costs +// one fstat and one getxattr; without extended attributes it is scanned again each time. Returns the +// number of patched calls, 0 when there was nothing to do, -1 when the file could not be handled +// (it is then started as it is). +// go_only: leave the file alone unless it is an AArch64 Go program. That is for a program that asks for +// Android's linker (GOOS=android): it is started like the dynamic ones, but it makes its own system +// calls, so it gets the code of the static Go programs (#42). +static int prepare_static_program_ex(const char *path, int go_only) { + int fd = open(path, O_RDONLY | O_CLOEXEC); + if (fd < 0) return -1; + struct stat st; + char marker[PATH_MAX + 96], seen[PATH_MAX + 96]; + if (fstat(fd, &st) != 0 || !S_ISREG(st.st_mode)) { + close(fd); + return -1; + } + static_marker(&st, marker, sizeof(marker)); + ssize_t seen_len = fgetxattr(fd, DDNATV_STATIC_XATTR, seen, sizeof(seen) - 1); + if (seen_len > 0) { + seen[seen_len] = '\0'; + if (strcmp(seen, marker) == 0) { + close(fd); + return 0; + } + } + + struct ddnatv_phdr ph[64]; + uint16_t machine = 0; + int n = read_elf_phdrs(fd, &machine, ph, 64); + if (go_only && !(n >= 0 && machine == EM_AARCH64 && elf_is_go(fd, ph, n))) { + close(fd); + return 0; + } + if (n < 0 || (machine != EM_AARCH64 && machine != EM_ARM) || elf_is_go(fd, ph, n)) { + // A Go program has no C library for the hook to be loaded into: it gets code of its own + int go_rc = 0; +#ifdef DDNATV_HAVE_GOSYS + if (n >= 0 && machine == EM_AARCH64 && elf_is_go(fd, ph, n)) go_rc = prepare_go_program(fd, path, &st); +#endif + if (n >= 0 && go_rc >= 0) { + struct stat after; + if (fstat(fd, &after) == 0) static_marker(&after, marker, sizeof(marker)); + fsetxattr(fd, DDNATV_STATIC_XATTR, marker, strlen(marker), 0); + } + close(fd); + return n < 0 || go_rc < 0 ? -1 : 0; + } + + int total = 0; + int wfd = -1; + int made_writable = 0; + for (int i = 0; i < n; i++) { + if (ph[i].type != 1 /* PT_LOAD */ || !(ph[i].flags & 1 /* PF_X */) || ph[i].filesz == 0) continue; + if (ph[i].filesz > DDNATV_STATIC_MAX_CODE || ph[i].offset > (uint64_t)st.st_size || + ph[i].filesz > (uint64_t)st.st_size - ph[i].offset) continue; + size_t len = (size_t)ph[i].filesz; + unsigned char *code = (unsigned char *)malloc(len); + if (!code) continue; + if (pread(fd, code, len, (off_t)ph[i].offset) != (ssize_t)len) { + free(code); + continue; + } + size_t patched = patch_seccomp_syscalls(code, 0, len, machine); + if (patched > 0) { + if (wfd < 0) { + wfd = open(path, O_WRONLY | O_CLOEXEC); + if (wfd < 0 && errno == EACCES && fchmod(fd, (st.st_mode | S_IWUSR) & 07777) == 0) { + made_writable = 1; + wfd = open(path, O_WRONLY | O_CLOEXEC); + } + } + // ETXTBSY: the program is running right now, so it was handled when it started. + if (wfd < 0 || pwrite(wfd, code, len, (off_t)ph[i].offset) != (ssize_t)len) { + free(code); + total = -1; + break; + } + total += (int)patched; + } + free(code); + } + if (wfd >= 0) { + // Keep the times: make and friends must not see a rebuilt program. + const struct timespec times[2] = { st.st_atim, st.st_mtim }; + futimens(wfd, times); + close(wfd); + } + if (made_writable) fchmod(fd, st.st_mode & 07777); + if (total >= 0) { + struct stat after; + if (fstat(fd, &after) == 0) { + static_marker(&after, marker, sizeof(marker)); + fsetxattr(fd, DDNATV_STATIC_XATTR, marker, strlen(marker), 0); + } + } + close(fd); + return total; +} + +static int prepare_static_program(const char *path) { return prepare_static_program_ex(path, 0); } diff --git a/tools/nativeguest/hook/syscalls.c b/tools/nativeguest/hook/syscalls.c new file mode 100644 index 0000000000..06cacd8646 --- /dev/null +++ b/tools/nativeguest/hook/syscalls.c @@ -0,0 +1,128 @@ +// Part of libddnatv-hook.so, included by ddnatv-hook.c (one translation unit, so the +// parts share their static functions and are built with the same command as before). +// +// The system calls that Android's seccomp filter answers with SIGSYS, and which of them the +// SIGSYS handler (signals.c) turns into a fake success. + +static int is_sigsys_synthetic_success_syscall(int sys_nr) { +#if defined(__NR_setuid) + if (sys_nr == __NR_setuid) return 1; +#endif +#if defined(__NR_setuid32) + if (sys_nr == __NR_setuid32) return 1; +#endif +#if defined(__NR_setgid) + if (sys_nr == __NR_setgid) return 1; +#endif +#if defined(__NR_setgid32) + if (sys_nr == __NR_setgid32) return 1; +#endif +#if defined(__NR_setreuid) + if (sys_nr == __NR_setreuid) return 1; +#endif +#if defined(__NR_setreuid32) + if (sys_nr == __NR_setreuid32) return 1; +#endif +#if defined(__NR_setregid) + if (sys_nr == __NR_setregid) return 1; +#endif +#if defined(__NR_setregid32) + if (sys_nr == __NR_setregid32) return 1; +#endif +#if defined(__NR_setresuid) + if (sys_nr == __NR_setresuid) return 1; +#endif +#if defined(__NR_setresuid32) + if (sys_nr == __NR_setresuid32) return 1; +#endif +#if defined(__NR_setresgid) + if (sys_nr == __NR_setresgid) return 1; +#endif +#if defined(__NR_setresgid32) + if (sys_nr == __NR_setresgid32) return 1; +#endif +#if defined(__NR_setfsuid) + if (sys_nr == __NR_setfsuid) return 1; +#endif +#if defined(__NR_setfsuid32) + if (sys_nr == __NR_setfsuid32) return 1; +#endif +#if defined(__NR_setfsgid) + if (sys_nr == __NR_setfsgid) return 1; +#endif +#if defined(__NR_setfsgid32) + if (sys_nr == __NR_setfsgid32) return 1; +#endif +#if defined(__NR_setgroups) + if (sys_nr == __NR_setgroups) return 1; +#endif +#if defined(__NR_setgroups32) + if (sys_nr == __NR_setgroups32) return 1; +#endif +#if defined(__NR_set_robust_list) + if (sys_nr == __NR_set_robust_list) return 1; +#endif +#if defined(__NR_get_robust_list) + if (sys_nr == __NR_get_robust_list) return 1; +#endif + return 0; +} + +static int is_handled_sigsys_syscall(int sys_nr) { + if (is_sigsys_synthetic_success_syscall(sys_nr)) { + return 1; + } + + // Unified Linux 5.1+ syscall numbers across architectures + if (sys_nr >= 424 && sys_nr < 512) { + return 1; + } + + // Architecture-specific syscall numbers guarded per target ABI +#if defined(__aarch64__) + if (sys_nr == 97 /* __NR_unshare */ || + sys_nr == 217 /* __NR_add_key */ || + sys_nr == 218 /* __NR_request_key */ || + sys_nr == 219 /* __NR_keyctl */ || + sys_nr == 268 /* __NR_setns */ || + sys_nr == 277 /* __NR_seccomp */ || + sys_nr == 280 /* __NR_bpf */ || + sys_nr == 293 /* __NR_rseq */) { + return 1; + } +#elif defined(__arm__) + if (sys_nr == 309 /* __NR_add_key */ || + sys_nr == 310 /* __NR_request_key */ || + sys_nr == 311 /* __NR_keyctl */ || + sys_nr == 337 /* __NR_unshare */ || + sys_nr == 375 /* __NR_setns */ || + sys_nr == 383 /* __NR_seccomp */ || + sys_nr == 386 /* __NR_bpf */ || + sys_nr == 398 /* __NR_rseq */) { + return 1; + } +#elif defined(__x86_64__) + if (sys_nr == 248 /* __NR_add_key */ || + sys_nr == 249 /* __NR_request_key */ || + sys_nr == 250 /* __NR_keyctl */ || + sys_nr == 272 /* __NR_unshare */ || + sys_nr == 308 /* __NR_setns */ || + sys_nr == 317 /* __NR_seccomp */ || + sys_nr == 321 /* __NR_bpf */ || + sys_nr == 334 /* __NR_rseq */) { + return 1; + } +#elif defined(__i386__) + if (sys_nr == 286 /* __NR_add_key */ || + sys_nr == 287 /* __NR_request_key */ || + sys_nr == 288 /* __NR_keyctl */ || + sys_nr == 310 /* __NR_unshare */ || + sys_nr == 346 /* __NR_setns */ || + sys_nr == 354 /* __NR_seccomp */ || + sys_nr == 357 /* __NR_bpf */ || + sys_nr == 386 /* __NR_rseq */) { + return 1; + } +#endif + return 0; +} diff --git a/tools/nativeguest/hook/sysv_shm.c b/tools/nativeguest/hook/sysv_shm.c new file mode 100644 index 0000000000..0b43e1fe2c --- /dev/null +++ b/tools/nativeguest/hook/sysv_shm.c @@ -0,0 +1,561 @@ +// Part of libddnatv-hook.so, included by ddnatv-hook.c (one translation unit, so the +// parts share their static functions and are built with the same command as before). +// +// System V shared memory (shmget, shmat, shmdt, shmctl). Android's seccomp filter blocks these system +// calls for apps (the SIGSYS handler turns them into ENOSYS), but X uses them: a program draws an image +// into a segment and the X server reads it from there (the MIT-SHM extension), and Qt, GTK and SDL +// programs expect it. The segments are files of their own in /tmp/.ddnatv-sysv-shm of the rootfs, +// which every process of the app can open and map: +// +// id-N the segment's description: "PID KEY MODE SIZE" (who made it, its key, its rights, its size) +// seg-N its memory (a file of SIZE bytes, mapped MAP_SHARED) +// key-K for a segment with a key: the N it belongs to (K in hex) +// att-N-P process P has the segment attached (made by shmat(), removed by its last shmdt()) +// +// N is chosen at random and claimed with O_EXCL, so processes never pick the same one. IPC_RMID +// removes the files at once: programs that attached the segment keep their mapping (as on Linux), +// later attaches fail, which is what X programs expect (they remove a segment as soon as the X +// server has attached it). A segment nobody removed stays until the session's directory is cleared. + +#ifndef DDNATV_HOST_TEST + +#ifndef MAP_FIXED_NOREPLACE +#define MAP_FIXED_NOREPLACE 0x100000 +#endif +#ifndef SHM_REMAP +#define SHM_REMAP 040000 +#endif + +#define SHM_DIR "/tmp/.ddnatv-sysv-shm" +#define SHM_MAX_ATTACH 512 + +struct shm_meta { + int pid; + long key; + unsigned mode; + size_t size; +}; + +struct shm_attach { + void *addr; + size_t size; + int id; +}; + +static struct shm_attach g_shm_attach[SHM_MAX_ATTACH]; +static pthread_mutex_t g_shm_lock = PTHREAD_MUTEX_INITIALIZER; + +// root + /tmp/.ddnatv-sysv-shm[/name] +static int shm_path(char *out, size_t outsz, const char *name) { + int n = snprintf(out, outsz, "%s%s%s%s", g_ddnatv_root, SHM_DIR, name ? "/" : "", name ? name : ""); + return n > 0 && (size_t)n < outsz ? 0 : -1; +} + +static int shm_open_file(const char *name, int flags, unsigned mode) { + char path[PATH_MAX]; + if (shm_path(path, sizeof(path), name) != 0) return -1; + return (int)syscall(SYS_openat, AT_FDCWD, path, flags | O_CLOEXEC, mode); +} + +static void shm_unlink_file(const char *name) { + char path[PATH_MAX]; + if (shm_path(path, sizeof(path), name) == 0) syscall(SYS_unlinkat, AT_FDCWD, path, 0); +} + +static int shm_ensure_dir(void) { + char path[PATH_MAX]; + if (shm_path(path, sizeof(path), NULL) != 0) return -1; + if (syscall(SYS_mkdirat, AT_FDCWD, path, 0700) == 0 || errno == EEXIST) return 0; + // /tmp of the rootfs missing too (a rootfs being set up) + char tmp[PATH_MAX]; + snprintf(tmp, sizeof(tmp), "%s/tmp", g_ddnatv_root); + syscall(SYS_mkdirat, AT_FDCWD, tmp, 01777); + return (syscall(SYS_mkdirat, AT_FDCWD, path, 0700) == 0 || errno == EEXIST) ? 0 : -1; +} + +static int shm_read_small(const char *name, char *buf, size_t bufsz) { + int fd = shm_open_file(name, O_RDONLY, 0); + if (fd < 0) return -1; + ssize_t n = (ssize_t)syscall(SYS_read, fd, buf, bufsz - 1); + syscall(SYS_close, fd); + if (n < 0) return -1; + buf[n] = '\0'; + return (int)n; +} + +// The description of segment `id`; waits a moment for one being written. 0, or -1 (errno EINVAL). +static int shm_read_meta(int id, struct shm_meta *meta) { + char name[32], text[128]; + snprintf(name, sizeof(name), "id-%d", id); + for (int attempt = 0; attempt < 50; attempt++) { + int n = shm_read_small(name, text, sizeof(text)); + if (n < 0) break; + unsigned long size = 0; + if (n > 0 && sscanf(text, "%d %lx %o %lu", &meta->pid, &meta->key, &meta->mode, &size) == 4) { + meta->size = (size_t)size; + return 0; + } + struct timespec pause = { 0, 1000000 }; + nanosleep(&pause, NULL); + } + errno = EINVAL; + return -1; +} + +static int shm_process_alive(int pid) { + return pid > 0 && (kill(pid, 0) == 0 || errno == EPERM); +} + +static void shm_remove(int id, long key) { + char name[32]; + if (key != IPC_PRIVATE) { + // only when the key still names this segment + char text[32]; + snprintf(name, sizeof(name), "key-%lx", key); + if (shm_read_small(name, text, sizeof(text)) > 0 && atoi(text) == id) shm_unlink_file(name); + } + snprintf(name, sizeof(name), "seg-%d", id); + shm_unlink_file(name); + snprintf(name, sizeof(name), "id-%d", id); + shm_unlink_file(name); +} + +static int shm_mark_attached(int id, int attached) { + char name[48]; + snprintf(name, sizeof(name), "att-%d-%d", id, (int)getpid()); + if (!attached) { + shm_unlink_file(name); + return 0; + } + int fd = shm_open_file(name, O_WRONLY | O_CREAT, 0600); + if (fd < 0) return -1; + syscall(SYS_close, fd); + return 0; +} + +// The collector holds this exclusively while it scans and removes, shmat() shared while it checks a +// segment, maps it and marks itself, so that no segment is collected while it is being attached. +static int shm_lock_dir(int op) { + int fd = shm_open_file(".lock", O_RDWR | O_CREAT, 0600); + if (fd < 0) return -1; + long rc; + do { + rc = syscall(SYS_flock, fd, op); + } while (rc != 0 && errno == EINTR); + if (rc != 0) { + syscall(SYS_close, fd); + return -1; + } + return fd; +} + +static void shm_unlock_dir(int fd) { + if (fd >= 0) syscall(SYS_close, fd); +} + +// Deletes the marks of attached processes that have ended. Every segment stays until IPC_RMID, as on +// Linux: a private one's maker can hand its id to a process that attaches after the maker has ended. +static void shm_collect(void) { + char path[PATH_MAX]; + if (shm_path(path, sizeof(path), NULL) != 0) return; + int lock = shm_lock_dir(LOCK_EX); + if (lock < 0) return; + int dfd = (int)syscall(SYS_openat, AT_FDCWD, path, O_RDONLY | O_DIRECTORY | O_CLOEXEC); + if (dfd < 0) { + shm_unlock_dir(lock); + return; + } + char dents[4096]; + for (;;) { + long n = syscall(SYS_getdents64, dfd, dents, sizeof(dents)); + if (n <= 0) break; + for (long at = 0; at < n;) { + unsigned short reclen; + memcpy(&reclen, dents + at + 16, sizeof(reclen)); + if (reclen == 0) break; + const char *entry = dents + at + 19; + int id = 0, pid = 0; + if (strncmp(entry, "att-", 4) == 0 && sscanf(entry + 4, "%d-%d", &id, &pid) == 2 && !shm_process_alive(pid)) + shm_unlink_file(entry); + at += reclen; + } + } + syscall(SYS_close, dfd); + shm_unlock_dir(lock); +} + +static int shm_create(long key, size_t size, unsigned mode) { + // a different sequence of ids for every call, also within one second and one process + static unsigned calls = 0; + struct timespec now; + clock_gettime(CLOCK_MONOTONIC, &now); + unsigned seed = (unsigned)getpid() * 2654435761u ^ (unsigned)now.tv_nsec ^ (unsigned)now.tv_sec * 40503u ^ + __atomic_add_fetch(&calls, 1, __ATOMIC_RELAXED) * 0x9e3779b9u; + for (int attempt = 0; attempt < 64; attempt++) { + seed = seed * 1103515245u + 12345u; + int id = (int)((seed >> 1) & 0x3fffffff); + if (id == 0) continue; + char name[32]; + snprintf(name, sizeof(name), "id-%d", id); + int meta_fd = shm_open_file(name, O_WRONLY | O_CREAT | O_EXCL, 0600); + if (meta_fd < 0) { + if (errno == EEXIST) continue; + return -1; + } + snprintf(name, sizeof(name), "seg-%d", id); + int seg_fd = shm_open_file(name, O_RDWR | O_CREAT | O_TRUNC, 0600); + long page = sysconf(_SC_PAGESIZE); + if (page <= 0) page = 4096; + if (size > (size_t)INTPTR_MAX - (size_t)page) { + // no file (and no mapping) can be that large + if (seg_fd >= 0) syscall(SYS_close, seg_fd); + syscall(SYS_close, meta_fd); + shm_remove(id, IPC_PRIVATE); + errno = EINVAL; + return -1; + } + size_t rounded = (size + (size_t)page - 1) / (size_t)page * (size_t)page; + if (seg_fd < 0 || ftruncate(seg_fd, (off_t)rounded) != 0) { + int saved = errno; + if (seg_fd >= 0) syscall(SYS_close, seg_fd); + syscall(SYS_close, meta_fd); + shm_remove(id, IPC_PRIVATE); + errno = saved == EFBIG ? EINVAL : (saved ? saved : ENOMEM); + return -1; + } + syscall(SYS_close, seg_fd); + char text[128]; + int len = snprintf(text, sizeof(text), "%d %lx %o %lu\n", getpid(), key, mode & 0777, (unsigned long)size); + ssize_t written = (ssize_t)syscall(SYS_write, meta_fd, text, (size_t)len); + syscall(SYS_close, meta_fd); + if (written != len) { + shm_remove(id, IPC_PRIVATE); + errno = ENOSPC; + return -1; + } + return id; + } + errno = ENOSPC; + return -1; +} + +// Writes `text` to the file `name` at once: into "new-ID" first, then renamed over it (`exclusive`: only +// when `name` does not exist yet, else -1 with EEXIST). Readers see the old file or the whole new one. +static int shm_publish(const char *name, int id, const char *text, size_t len, int exclusive) { + char tmp_name[32], tmp[PATH_MAX], path[PATH_MAX]; + snprintf(tmp_name, sizeof(tmp_name), "new-%d", id); + if (shm_path(tmp, sizeof(tmp), tmp_name) != 0 || shm_path(path, sizeof(path), name) != 0) { + errno = ENAMETOOLONG; + return -1; + } + int fd = (int)syscall(SYS_openat, AT_FDCWD, tmp, O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC, 0600); + if (fd < 0) return -1; + ssize_t written = (ssize_t)syscall(SYS_write, fd, text, len); + syscall(SYS_close, fd); + if (written != (ssize_t)len) { + syscall(SYS_unlinkat, AT_FDCWD, tmp, 0); + errno = ENOSPC; + return -1; + } + long rc; + if (exclusive) { + rc = syscall(SYS_renameat2, AT_FDCWD, tmp, AT_FDCWD, path, 1 /* RENAME_NOREPLACE */); + if (rc != 0 && (errno == ENOSYS || errno == EINVAL)) { + // a kernel or file system without RENAME_NOREPLACE: claim the name, then write it + int kfd = (int)syscall(SYS_openat, AT_FDCWD, path, O_WRONLY | O_CREAT | O_EXCL | O_CLOEXEC, 0600); + syscall(SYS_unlinkat, AT_FDCWD, tmp, 0); + if (kfd < 0) return -1; + written = (ssize_t)syscall(SYS_write, kfd, text, len); + syscall(SYS_close, kfd); + if (written == (ssize_t)len) return 0; + syscall(SYS_unlinkat, AT_FDCWD, path, 0); + errno = ENOSPC; + return -1; + } + } else { + rc = syscall(SYS_renameat2, AT_FDCWD, tmp, AT_FDCWD, path, 0); +#ifdef SYS_renameat + if (rc != 0 && errno == ENOSYS) rc = syscall(SYS_renameat, AT_FDCWD, tmp, AT_FDCWD, path); +#endif + } + if (rc != 0) { + int saved = errno; + syscall(SYS_unlinkat, AT_FDCWD, tmp, 0); + errno = saved; + return -1; + } + return 0; +} + +int shmget(key_t key, size_t size, int shmflg) { + init_ddnatv_hook(); + if (g_ddnatv_root[0] == '\0') { + errno = ENOSYS; + return -1; + } + if (shm_ensure_dir() != 0) return -1; + if ((shmflg & IPC_CREAT) || key == IPC_PRIVATE) shm_collect(); + if (key == IPC_PRIVATE) { + if (size == 0) { + errno = EINVAL; + return -1; + } + return shm_create(IPC_PRIVATE, size, (unsigned)shmflg); + } + char key_name[32]; + snprintf(key_name, sizeof(key_name), "key-%lx", (long)key); + for (int attempt = 0; attempt < 8; attempt++) { + char text[32]; + if (shm_read_small(key_name, text, sizeof(text)) > 0) { + int id = atoi(text); + struct shm_meta meta; + if (id > 0 && shm_read_meta(id, &meta) == 0) { + if ((shmflg & IPC_CREAT) && (shmflg & IPC_EXCL)) { + errno = EEXIST; + return -1; + } + if (size > meta.size) { + errno = EINVAL; + return -1; + } + return id; + } + shm_unlink_file(key_name); // names a segment that is gone + } + if (!(shmflg & IPC_CREAT)) { + errno = ENOENT; + return -1; + } + if (size == 0) { + errno = EINVAL; + return -1; + } + int id = shm_create((long)key, size, (unsigned)shmflg); + if (id < 0) return -1; + // The key file appears with its id in it, never empty: written under a name of its own, then + // renamed to the key's name unless another process made the key's segment meanwhile + int len = snprintf(text, sizeof(text), "%d\n", id); + int published = shm_publish(key_name, id, text, (size_t)len, 1); + if (published == 0) return id; + int saved = errno; + shm_remove(id, IPC_PRIVATE); + if (saved != EEXIST) { + errno = saved; + return -1; + } + // another process made the key's segment at the same time: use that one + } + errno = EAGAIN; + return -1; +} + +static void *shmat_locked(int shmid, const void *shmaddr, int shmflg); + +void *shmat(int shmid, const void *shmaddr, int shmflg) { + init_ddnatv_hook(); + // without the lock the collector could remove the segment mid-attach + int lock = g_ddnatv_root[0] != '\0' ? shm_lock_dir(LOCK_SH) : -1; + if (lock < 0) { + errno = EINVAL; + return (void *)-1; + } + void *addr = shmat_locked(shmid, shmaddr, shmflg); + int saved = errno; + shm_unlock_dir(lock); + errno = saved; + return addr; +} + +static int shm_attached_here_locked(int id); + +static void *shmat_locked(int shmid, const void *shmaddr, int shmflg) { + struct shm_meta meta; + if (g_ddnatv_root[0] == '\0' || shm_read_meta(shmid, &meta) != 0) { + errno = EINVAL; + return (void *)-1; + } + int readonly = (shmflg & SHM_RDONLY) != 0; + char name[32]; + snprintf(name, sizeof(name), "seg-%d", shmid); + int fd = shm_open_file(name, readonly ? O_RDONLY : O_RDWR, 0); + if (fd < 0) { + errno = EINVAL; + return (void *)-1; + } + void *want = (void *)shmaddr; + int flags = MAP_SHARED; + if (want) { + if (shmflg & SHM_RND) want = (void *)((uintptr_t)want & ~((uintptr_t)SHMLBA - 1)); + else if ((uintptr_t)want & ((uintptr_t)sysconf(_SC_PAGESIZE) - 1)) { + syscall(SYS_close, fd); + errno = EINVAL; + return (void *)-1; + } + // an address in use is replaced only with SHM_REMAP, as on Linux (MAP_FIXED_NOREPLACE: a kernel + // older than 4.17 takes it as a hint, which the check below catches) + flags |= (shmflg & SHM_REMAP) ? MAP_FIXED : MAP_FIXED_NOREPLACE; + } + // a place in the table first, so that every attach can be detached + int slot = -1; + pthread_mutex_lock(&g_shm_lock); + for (int i = 0; i < SHM_MAX_ATTACH; i++) { + if (!g_shm_attach[i].addr && !g_shm_attach[i].size) { + g_shm_attach[i].size = 1; // reserved + slot = i; + break; + } + } + pthread_mutex_unlock(&g_shm_lock); + if (slot < 0) { + syscall(SYS_close, fd); + errno = EMFILE; + return (void *)-1; + } + void *addr = mmap(want, meta.size, readonly ? PROT_READ : (PROT_READ | PROT_WRITE), flags, fd, 0); + int saved = errno; + syscall(SYS_close, fd); + if (addr != MAP_FAILED && want && addr != want) { + munmap(addr, meta.size); + addr = MAP_FAILED; + saved = EINVAL; + } + pthread_mutex_lock(&g_shm_lock); + // the mark keeps the segment from being collected; without one the attach is undone + if (addr != MAP_FAILED && shm_mark_attached(shmid, 1) != 0) { + saved = errno; + if (shm_attached_here_locked(shmid) == 0) shm_mark_attached(shmid, 0); + munmap(addr, meta.size); + addr = MAP_FAILED; + if (saved != ENOMEM) saved = EINVAL; + } + if (addr == MAP_FAILED) { + g_shm_attach[slot].size = 0; + } else { + g_shm_attach[slot].addr = addr; + g_shm_attach[slot].size = meta.size; + g_shm_attach[slot].id = shmid; + } + pthread_mutex_unlock(&g_shm_lock); + if (addr == MAP_FAILED) { + errno = saved == ENOMEM ? ENOMEM : EINVAL; + return (void *)-1; + } + return addr; +} + +int shmdt(const void *shmaddr) { + pthread_mutex_lock(&g_shm_lock); + for (int i = 0; i < SHM_MAX_ATTACH; i++) { + if (g_shm_attach[i].addr && g_shm_attach[i].addr == shmaddr) { + void *addr = g_shm_attach[i].addr; + size_t size = g_shm_attach[i].size; + int id = g_shm_attach[i].id; + g_shm_attach[i].addr = NULL; + g_shm_attach[i].size = 0; + // counted and unmarked under the lock, so that an attach of this process meanwhile keeps its mark + if (shm_attached_here_locked(id) == 0) shm_mark_attached(id, 0); + pthread_mutex_unlock(&g_shm_lock); + munmap(addr, size); + return 0; + } + } + pthread_mutex_unlock(&g_shm_lock); + errno = EINVAL; + return -1; +} + +static int shm_attached_here_locked(int id) { + int count = 0; + for (int i = 0; i < SHM_MAX_ATTACH; i++) { + if (g_shm_attach[i].addr && g_shm_attach[i].id == id) count++; + } + return count; +} + +static int shm_attached_here(int id) { + int count = 0; + pthread_mutex_lock(&g_shm_lock); + for (int i = 0; i < SHM_MAX_ATTACH; i++) { + if (g_shm_attach[i].addr && g_shm_attach[i].id == id) count++; + } + pthread_mutex_unlock(&g_shm_lock); + return count; +} + +int shmctl(int shmid, int cmd, struct shmid_ds *buf) { + init_ddnatv_hook(); + if (g_ddnatv_root[0] == '\0') { + errno = ENOSYS; + return -1; + } + switch (cmd) { + case IPC_INFO: + case SHM_INFO: + if (buf) { + // the caller's buffer is the structure of the command (struct shminfo or struct shm_info) + memset(buf, 0, cmd == IPC_INFO ? sizeof(struct shminfo) : sizeof(struct shm_info)); + if (cmd == IPC_INFO) { + struct shminfo *info = (struct shminfo *)buf; + info->shmmax = sizeof(unsigned long) > 4 ? (unsigned long)1 << 40 : 0x7fffffffUL; + info->shmmin = 1; + info->shmmni = 4096; + info->shmseg = 4096; + info->shmall = (unsigned long)1 << 30; + } + } + return 0; + case SHM_LOCK: + case SHM_UNLOCK: + return 0; + default: + break; + } + struct shm_meta meta; + if (shm_read_meta(shmid, &meta) != 0) { + errno = EINVAL; + return -1; + } + switch (cmd) { + case IPC_STAT: + case SHM_STAT: + case SHM_STAT_ANY: + if (!buf) { + errno = EFAULT; + return -1; + } + memset(buf, 0, sizeof(*buf)); + buf->shm_perm.__key = (key_t)meta.key; + // The owner's rights for everyone of the app: X compares the uid of its client with the owner's, + // and the two can differ in The native userland (root emulated for one, not the other) + unsigned owner = meta.mode & 0600; + buf->shm_perm.mode = (unsigned short)(owner | (owner >> 3) | (owner >> 6)); + buf->shm_perm.uid = buf->shm_perm.cuid = geteuid(); + buf->shm_perm.gid = buf->shm_perm.cgid = getegid(); + buf->shm_segsz = meta.size; + buf->shm_cpid = meta.pid; + buf->shm_lpid = getpid(); + buf->shm_nattch = (shmatt_t)(shm_attached_here(shmid) + (meta.pid != getpid() ? 1 : 0)); + buf->shm_ctime = time(NULL); + return cmd == IPC_STAT ? 0 : shmid; + case IPC_SET: { + if (!buf) { + errno = EFAULT; + return -1; + } + // the new rights are kept (owner and group stay the app's: there is no other user to give it to) + char name[32], text[128]; + snprintf(name, sizeof(name), "id-%d", shmid); + int len = snprintf(text, sizeof(text), "%d %lx %o %lu\n", meta.pid, meta.key, buf->shm_perm.mode & 0777u, + (unsigned long)meta.size); + return shm_publish(name, shmid, text, (size_t)len, 0) == 0 ? 0 : -1; + } + case IPC_RMID: + shm_remove(shmid, meta.key); + return 0; + default: + errno = EINVAL; + return -1; + } +} + +#endif /* !DDNATV_HOST_TEST */ diff --git a/tools/nativeguest/seccomp-sim.c b/tools/nativeguest/seccomp-sim.c new file mode 100644 index 0000000000..e1b50a09c6 --- /dev/null +++ b/tools/nativeguest/seccomp-sim.c @@ -0,0 +1,92 @@ +// Runs a program under a seccomp filter that answers the system calls Android's app policy blocks +// with SIGSYS, the way a stock app process does, for testing on builds that have no filter: +// seccomp-sim [-a NR,NR...] PROGRAM [ARGS...] +// seccomp-sim -f FILTER PROGRAM [ARGS...] +// -a leaves the listed system calls allowed (to find which one kills a program). -f installs a +// filter as it is (raw struct sock_filter entries), such as the app filter a device's zygote makes. +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static const int blocked[] = {99, 100, 97, 217, 218, 219, 268, 277, 280, 293, 143, 144, 145, 146, 147, 149, 151, 152, 159}; + +#define MAX_ALLOWED 64 +#define NBLOCKED (sizeof(blocked) / sizeof(blocked[0])) + +static int run_filter_file(const char *path, char **argv) { + static struct sock_filter filter[BPF_MAXINSNS]; + FILE *f = fopen(path, "rb"); + if (!f) { + perror("seccomp-sim: -f"); + return 2; + } + size_t n = fread(filter, sizeof(filter[0]), BPF_MAXINSNS, f); + int extra = fgetc(f) != EOF; + fclose(f); + if (n == 0 || extra) { + fprintf(stderr, "seccomp-sim: %s holds no filter of at most %d instructions\n", path, BPF_MAXINSNS); + return 2; + } + struct sock_fprog prog = { .len = (unsigned short)n, .filter = filter }; + if (prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0) || prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, &prog)) { + perror("seccomp-sim"); + return 1; + } + execv(argv[0], argv); + perror("seccomp-sim: exec"); + return 127; +} + +int main(int argc, char **argv) { + if (argc > 3 && strcmp(argv[1], "-f") == 0) return run_filter_file(argv[2], argv + 3); + int skip[MAX_ALLOWED], nskip = 0, arg = 1; + if (argc > 3 && strcmp(argv[1], "-a") == 0) { + for (char *p = argv[2];; p++) { + char *end = NULL; + long nr = strtol(p, &end, 10); + if (end == p || (*end != '\0' && *end != ',') || *p < '0' || *p > '9' || + nr < 0 || nr > 1023 || nskip == MAX_ALLOWED) { + fprintf(stderr, "seccomp-sim: -a takes up to %d comma-separated system call numbers, not \"%s\"\n", MAX_ALLOWED, argv[2]); + return 2; + } + skip[nskip++] = (int)nr; + if (*end == '\0') break; + p = end; + } + arg = 3; + } + if (arg >= argc) return 2; + struct sock_filter filter[4 + 2 * MAX_ALLOWED + 2 + 2 * NBLOCKED + 1]; + int n = 0; + filter[n++] = (struct sock_filter)BPF_STMT(BPF_LD | BPF_W | BPF_ABS, offsetof(struct seccomp_data, arch)); + filter[n++] = (struct sock_filter)BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, AUDIT_ARCH_AARCH64, 1, 0); + filter[n++] = (struct sock_filter)BPF_STMT(BPF_RET | BPF_K, SECCOMP_RET_ALLOW); + filter[n++] = (struct sock_filter)BPF_STMT(BPF_LD | BPF_W | BPF_ABS, offsetof(struct seccomp_data, nr)); + for (int i = 0; i < nskip; i++) { + filter[n++] = (struct sock_filter)BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, skip[i], 0, 1); + filter[n++] = (struct sock_filter)BPF_STMT(BPF_RET | BPF_K, SECCOMP_RET_ALLOW); + } + filter[n++] = (struct sock_filter)BPF_JUMP(BPF_JMP | BPF_JGE | BPF_K, 424, 0, 1); + filter[n++] = (struct sock_filter)BPF_STMT(BPF_RET | BPF_K, SECCOMP_RET_TRAP); + for (size_t i = 0; i < NBLOCKED; i++) { + filter[n++] = (struct sock_filter)BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, blocked[i], 0, 1); + filter[n++] = (struct sock_filter)BPF_STMT(BPF_RET | BPF_K, SECCOMP_RET_TRAP); + } + filter[n++] = (struct sock_filter)BPF_STMT(BPF_RET | BPF_K, SECCOMP_RET_ALLOW); + struct sock_fprog prog = { .len = (unsigned short)n, .filter = filter }; + if (prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0) || prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, &prog)) { + perror("seccomp-sim"); + return 1; + } + execv(argv[arg], argv + arg); + perror("seccomp-sim: exec"); + return 127; +} diff --git a/tools/packs/build.sh b/tools/packs/build.sh index 7b7e7e76fd..4ea6a41932 100755 --- a/tools/packs/build.sh +++ b/tools/packs/build.sh @@ -77,6 +77,7 @@ pack tracking "$work/tracking" hand_landmarker.task hand_landmarker_lite.task po pack xbox "$linuxfs/droiddeck-xbox" version xodus-cli xodus-service pack comet "$linuxfs/droiddeck-comet" version comet pack powervr "$repo/app/src/main/assets/hybris" runtime.tzst version.txt +[ ! -f "$linuxfs/droiddeck-ubisoft/droiddeck-upc.exe" ] || pack ubisoft "$linuxfs/droiddeck-ubisoft" droiddeck-upc.exe mkdir "$work/butler" fetch "https://broth.itch.zone/butler/linux-arm64/${BUTLER_VERSION}/archive/default" \ diff --git a/tools/proot/PATCHES.md b/tools/proot/PATCHES.md index c4173a48c7..6347023473 100644 --- a/tools/proot/PATCHES.md +++ b/tools/proot/PATCHES.md @@ -162,9 +162,26 @@ Prototype (inert unless `PROOT_FASTPATH` is set; see `docs/development/proot-per `ENOSYS`, because its arguments are host paths; the fast path then stops for that process and repeats the call through a plain `svc`, which the guest's filter traps with the guest path. `bench/guest-trap.c` installs a tagged `openat` trap and checks its handler answers the call. + The kernel and filesystems also return `ENOSYS` themselves: Android's FUSE daemon has no + `symlink`, so `symlinkat` on a storage card fails with it. The fast path therefore asks again + with the same call number and invalid arguments. A trap answers `ENOSYS` again and the fast path + stops for the process; any other error means the call reached the kernel, so only that one call + is repeated through a plain `svc` and the fast path stays on. Old kernel fixes: +- `0028-fchdir-open-directory.patch` - `fchdir` resolved the directory again from its guest path, + one `lstat` per path component, then an `lstat` and an `O_PATH` open of the result. The + descriptor is already open, so `/proc//fd/` gives its host path and one `stat` through + that link confirms it is a live directory. The guest path it maps to is checked to map back to + the same host path, and the parent of the binding it falls under is checked to still resolve + to itself, so the cwd PRoot records is the one the old walk produced; a deleted directory, a + path outside the guest, a binding whose ancestor became a symlink, or anything else that does + not round-trip takes the old walk. Listing a directory in Wine does `fchdir` there and back: on a memory card behind + Android's FUSE daemon the old walk cost about 4 ms per call in the single tracer thread, 8.4 s + of an 8.8 s tracer total across one program start, and is now under 0.1 ms. + `bench/fchdir.py [directory...]` checks the cwd after `fchdir` to plain, bound, symlinked, + renamed and deleted directories and prints the per-call cost. - `0015-lost-fork-events.patch` - works around a problem reported on Xiaomi's msm 4.14 kernel: the kernel sometimes reports a new process or thread but gives its ID as zero. Without that ID, PRoot cannot finish setting it up, which can leave the session stuck. The patch searches `/proc` diff --git a/tools/proot/bench/fchdir.py b/tools/proot/bench/fchdir.py new file mode 100644 index 0000000000..e8d5c9141f --- /dev/null +++ b/tools/proot/bench/fchdir.py @@ -0,0 +1,105 @@ +import errno +import os +import sys +import tempfile +import time + + +def report(label, check): + try: + print(label, check()) + except OSError as error: + print(label, "ERR", errno.errorcode.get(error.errno, error.errno)) + + +def enter(path): + fd = os.open(path, os.O_RDONLY | os.O_DIRECTORY) + try: + os.fchdir(fd) + return os.getcwd(), os.readlink("/proc/self/cwd"), os.path.samefile(".", path) + finally: + os.close(fd) + + +def enter_file(base): + fd = os.open(base + "/real/file", os.O_RDONLY) + try: + os.fchdir(fd) + finally: + os.close(fd) + + +def enter_deleted(base): + os.mkdir(base + "/gone") + fd = os.open(base + "/gone", os.O_RDONLY) + os.rmdir(base + "/gone") + try: + os.fchdir(fd) + return "ok" + finally: + os.close(fd) + os.chdir("/") + + +def enter_renamed(base): + os.mkdir(base + "/before") + fd = os.open(base + "/before", os.O_RDONLY) + os.rename(base + "/before", base + "/after") + try: + os.fchdir(fd) + return os.getcwd() == base + "/after" + finally: + os.close(fd) + os.chdir("/") + os.rmdir(base + "/after") + + +def relative(base): + fd = os.open(base, os.O_RDONLY) + os.fchdir(fd) + os.close(fd) + seen = os.path.exists("real/file"), os.path.exists("link/file") + os.chdir("real") + inside = os.getcwd() == base + "/real" + os.chdir("..") + return seen + (inside, os.getcwd() == base) + + +def cost(path, rounds=300): + fd = os.open(path, os.O_RDONLY) + back = os.open("/", os.O_RDONLY) + start = time.perf_counter() + for _ in range(rounds): + os.fchdir(fd) + os.fchdir(back) + elapsed = time.perf_counter() - start + os.close(fd) + os.close(back) + return round(elapsed / rounds / 2 * 1e6, 1) + + +def main(): + extra = sys.argv[1:] + base = tempfile.mkdtemp(prefix="fchdir-") + os.mkdir(base + "/real") + os.symlink(base + "/real", base + "/link") + os.mkdir(base + "/dot.") + open(base + "/real/file", "w").close() + for path in ["/", "/tmp", "/usr/lib", "/proc/self", "/dev", base + "/real", base + "/link", base + "/dot."] + extra: + report(path, lambda: enter(path)) + report("file", lambda: enter_file(base)) + report("deleted", lambda: enter_deleted(base)) + report("renamed", lambda: enter_renamed(base)) + report("badfd", lambda: os.fchdir(987)) + report("relative", lambda: relative(base)) + os.chdir("/") + for path in ["/usr/lib"] + extra: + print("fchdir_us", path, cost(path)) + os.unlink(base + "/real/file") + os.unlink(base + "/link") + os.rmdir(base + "/dot.") + os.rmdir(base + "/real") + os.rmdir(base) + + +main() diff --git a/tools/proot/fastpath/fastpath.c b/tools/proot/fastpath/fastpath.c index 8d645eddd2..bcc745852a 100644 --- a/tools/proot/fastpath/fastpath.c +++ b/tools/proot/fastpath/fastpath.c @@ -41,7 +41,7 @@ typedef long (*stub_fn)(long nr, long a, long b, long c, long d, long e, long f) static stub_fn fp_sys; static int fp_on; -struct bind { char *host; size_t hlen; char *guest; size_t glen; int canon; int dropped; }; +struct bind { char *host; size_t hlen; char *guest; size_t glen; int canon; int dropped; int fuse; }; static struct bind binds[MAX_BINDS]; static int nbinds; static char root[PATH_MAX]; @@ -59,10 +59,10 @@ static int optional_syscall(long nr) { nr == SYS_openat2 || nr == SYS_renameat2; } static long sc(long nr, long a, long b, long c, long d, long e) { - if (fp_refused) return -ENOSYS; + if (fp_refused && nr != SYS_close) return -ENOSYS; long r = fp_sys(nr, a, b, c, d, e, 0); if (r == -ENOSYS && !optional_syscall(nr)) { - __atomic_store_n(&fp_on, 0, __ATOMIC_RELAXED); + if (fp_sys(nr, -1, -1, -1, -1, -1, 0) == -ENOSYS) __atomic_store_n(&fp_on, 0, __ATOMIC_RELAXED); fp_refused = 1; } return r; @@ -133,7 +133,8 @@ static long tracer; static pthread_mutex_t cache_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t bind_lock; static pthread_mutex_t long_lock; -static void after_fork(void) { pthread_mutex_init(&cache_lock, NULL); pthread_mutex_init(&bind_lock, NULL); pthread_mutex_init(&long_lock, NULL); } +static pthread_mutex_t dir_lock = PTHREAD_MUTEX_INITIALIZER; +static void after_fork(void) { pthread_mutex_init(&cache_lock, NULL); pthread_mutex_init(&bind_lock, NULL); pthread_mutex_init(&long_lock, NULL); pthread_mutex_init(&dir_lock, NULL); } static int traced_by_match(const char *key) { static char buf[32768]; @@ -414,6 +415,212 @@ static int host_bind(const char *h) { return -1; } +static unsigned hash_of(const char *s); +static long long now_ns(void); +#define DIRS 64 +#define DIR_FD_FLOOR 1000 +struct dirslot { unsigned hash, epoch; int fd, refs; dev_t dev; ino_t ino; long tag; long long stamp; char path[PATH_MAX]; char seen[PATH_MAX]; }; +static struct dirslot dirs[DIRS]; +static unsigned dir_epoch; +struct near { long fd; int slot, own; const char *name; }; + +static int fuse_bind(const char *h) { + int i = host_bind(h); + if (i < 0) return -1; + int f = __atomic_load_n(&binds[i].fuse, __ATOMIC_ACQUIRE); + if (!f) { + struct statfs fs; + f = sc(SYS_statfs, (long)binds[i].host, (long)&fs, 0, 0, 0) == 0 && fs.f_type == 0x65735546 ? 1 : 2; + __atomic_store_n(&binds[i].fuse, f, __ATOMIC_RELEASE); + } + return f == 1 ? i : -1; +} + +static long fd_path(long fd, char *out) { + char link[40]; + snprintf(link, sizeof link, "/proc/self/fd/%ld", fd); + long n = sc(SYS_readlinkat, AT_FDCWD, (long)link, (long)out, PATH_MAX - 1, 0); + if (n <= 0 || n >= PATH_MAX - 1) return -1; + out[n] = 0; + return 0; +} + +static int fd_id(long fd, dev_t *dev, ino_t *ino) { + struct stat st; + if (sc(SYS_newfstatat, fd, (long)"", (long)&st, AT_EMPTY_PATH, 0) != 0) return -1; + *dev = st.st_dev; + *ino = st.st_ino; + return 0; +} + +static long dir_tag(void) { + static uint64_t state; + uint64_t z = __atomic_add_fetch(&state, 0x9e3779b97f4a7c15ULL, __ATOMIC_RELAXED), seed = 0; + const void *random = (const void *)getauxval(AT_RANDOM); + if (random) memcpy(&seed, random, sizeof seed); + z += seed; + z = (z ^ (z >> 30)) * 0xbf58476d1ce4e5b9ULL; + z = (z ^ (z >> 27)) * 0x94d049bb133111ebULL; + return (long)((z ^ (z >> 31)) & 0xffffffffffULL) + 1; +} + +static int dir_owned(const struct dirslot *e) { + dev_t dev; + ino_t ino; + return e->fd > 0 && sc(SYS_lseek, e->fd, 0, SEEK_CUR, 0, 0) == e->tag + && fd_id(e->fd, &dev, &ino) == 0 && dev == e->dev && ino == e->ino; +} + +static int dir_fresh(struct dirslot *e, const char *dir) { + long long t = now_ns(); + if (t - __atomic_load_n(&e->stamp, __ATOMIC_RELAXED) < ttl_ns) return 1; + struct stat st; + if (sc(SYS_newfstatat, AT_FDCWD, (long)dir, (long)&st, 0, 0) != 0 || st.st_dev != e->dev || st.st_ino != e->ino) { + __atomic_add_fetch(&dir_epoch, 1, __ATOMIC_RELEASE); + return 0; + } + __atomic_store_n(&e->stamp, t, __ATOMIC_RELAXED); + return 1; +} + +static void dirs_drop(const char *host) { + size_t len = strlen(host); + if (pthread_mutex_trylock(&dir_lock) != 0) { + __atomic_add_fetch(&dir_epoch, 1, __ATOMIC_RELEASE); + return; + } + for (int i = 0; i < DIRS; i++) + if (dirs[i].path[0] && under(dirs[i].path, host, len)) dirs[i].path[0] = 0; + pthread_mutex_unlock(&dir_lock); +} + +static void near_put(struct near *n) { + if (n->own) sc(SYS_close, n->fd, 0, 0, 0, 0); + else if (n->slot >= 0) __atomic_sub_fetch(&dirs[n->slot].refs, 1, __ATOMIC_RELEASE); + n->fd = AT_FDCWD; + n->slot = -1; + n->own = 0; +} + +static int dir_cached(const char *dir, struct near *n) { + unsigned h = hash_of(dir); + struct dirslot *e = &dirs[h % DIRS]; + if (pthread_mutex_trylock(&dir_lock) != 0) return 0; + int hit = e->fd >= 0 && e->hash == h && e->path[0] && strcmp(e->path, dir) == 0 + && e->epoch == __atomic_load_n(&dir_epoch, __ATOMIC_ACQUIRE); + if (hit) __atomic_add_fetch(&e->refs, 1, __ATOMIC_ACQUIRE); + pthread_mutex_unlock(&dir_lock); + if (!hit) return 0; + char now[PATH_MAX]; + if (fd_path(e->fd, now) == 0 && strcmp(now, e->seen) == 0 && dir_fresh(e, dir)) { + n->fd = e->fd; + n->slot = (int)(e - dirs); + n->own = 0; + return 1; + } + __atomic_sub_fetch(&e->refs, 1, __ATOMIC_RELEASE); + if (pthread_mutex_trylock(&dir_lock) == 0) { + if (e->hash == h && strcmp(e->path, dir) == 0) e->path[0] = 0; + pthread_mutex_unlock(&dir_lock); + } + return 0; +} + +static int dir_keep(const char *dir, long fd, struct near *n) { + long high = sc(SYS_fcntl, fd, F_DUPFD_CLOEXEC, DIR_FD_FLOOR, 0, 0); + sc(SYS_close, fd, 0, 0, 0, 0); + if (high < 0) return -1; + n->fd = high; + n->slot = -1; + n->own = 1; + char seen[PATH_MAX]; + dev_t dev; + ino_t ino; + long tag = dir_tag(); + struct stat st; + if (fd_id(high, &dev, &ino) < 0 || strlen(dir) >= PATH_MAX + || sc(SYS_newfstatat, AT_FDCWD, (long)dir, (long)&st, 0, 0) != 0 || st.st_dev != dev || st.st_ino != ino) { + near_put(n); + return -1; + } + if (fd_path(high, seen) < 0 || sc(SYS_lseek, high, tag, SEEK_SET, 0, 0) != tag) return 0; + unsigned h = hash_of(dir); + struct dirslot *e = &dirs[h % DIRS]; + if (pthread_mutex_trylock(&dir_lock) != 0) return 0; + if (__atomic_load_n(&e->refs, __ATOMIC_ACQUIRE) == 0) { + if (dir_owned(e)) sc(SYS_close, e->fd, 0, 0, 0, 0); + e->hash = h; + e->epoch = __atomic_load_n(&dir_epoch, __ATOMIC_ACQUIRE); + e->tag = tag; + e->stamp = now_ns(); + e->fd = (int)high; + e->dev = dev; + e->ino = ino; + e->refs = 1; + strcpy(e->path, dir); + strcpy(e->seen, seen); + n->slot = (int)(e - dirs); + n->own = 0; + } + pthread_mutex_unlock(&dir_lock); + return 0; +} + +static int dir_get(char *dir, size_t floor, struct near *n) { + size_t len = strlen(dir), at = len; + while (!dir_cached(dir, n)) { + if (at <= floor) { + long fd = sc(SYS_openat, AT_FDCWD, (long)dir, O_RDONLY | O_DIRECTORY | O_CLOEXEC, 0, 0); + if (fd < 0 || dir_keep(dir, fd, n) < 0) return -1; + break; + } + char *slash = strrchr(dir, '/'); + if (!slash || (size_t)(slash - dir) < floor) return -1; + *slash = 0; + at = slash - dir; + } + while (at < len) { + dir[at] = '/'; + const char *name = dir + at + 1; + size_t next = at + 1 + strlen(name); + long fd = sc(SYS_openat, n->fd, (long)name, O_RDONLY | O_DIRECTORY | O_NOFOLLOW | O_CLOEXEC, 0, 0); + near_put(n); + if (fd < 0 || dir_keep(dir, fd, n) < 0) return -1; + at = next; + } + return 0; +} + +static long near_get(const char *host, struct near *n) { + n->fd = AT_FDCWD; + n->slot = -1; + n->own = 0; + n->name = host; + if (ttl_ns <= 0 || host[0] != '/') return n->fd; + int i = fuse_bind(host); + if (i < 0) return n->fd; + const char *slash = strrchr(host, '/'); + size_t plen = slash - host; + if (plen < binds[i].hlen || !slash[1] || plen >= PATH_MAX) return n->fd; + char dir[PATH_MAX]; + memcpy(dir, host, plen); + dir[plen] = 0; + if (dir_get(dir, binds[i].hlen, n) < 0) { + near_put(n); + return n->fd; + } + n->name = slash + 1; + return n->fd; +} + +static long hsc(long nr, const char *host, long a, long b, long c) { + struct near n; + long fd = near_get(host, &n); + long rs = sc(nr, fd, (long)n.name, a, b, c); + near_put(&n); + return rs; +} + static int guest_text(const char *h, char *g) { if (h[0] == '/' && under(h, root, rootlen)) return to_guest(h, g, PATH_MAX); int i = h[0] == '/' ? host_bind(h) : -1; @@ -556,7 +763,7 @@ static long proc_readlink(const struct res *r, char *text, size_t size, int *cha return name[0] == 'e' ? own_exe(text) : own_cwd(text); } char h[PATH_MAX]; - long t = sc(SYS_readlinkat, AT_FDCWD, (long)r->host, (long)h, sizeof h - 1, 0); + long t = hsc(SYS_readlinkat, r->host, (long)h, sizeof h - 1, 0); if (t < 0) return t; if (t >= (long)sizeof h - 1) return FP_SLOW; if (size && (size_t)t > size) t = size; @@ -579,7 +786,7 @@ static long proc_link(struct res *r, char *text, int final) { if (!under(r->host, "/proc", 5)) return FP_SLOW; r->moving = 1; if (!strcmp(r->guest, "/proc/self") || !strcmp(r->guest, "/proc/thread-self")) { - long t = sc(SYS_readlinkat, AT_FDCWD, (long)r->host, (long)text, PATH_MAX - 1, 0); + long t = hsc(SYS_readlinkat, r->host, (long)text, PATH_MAX - 1, 0); if (t <= 0 || t >= PATH_MAX - 1) return FP_SLOW; text[t] = 0; return t; @@ -628,7 +835,7 @@ static long walk(struct res *r, const char *text, int follow, int last) { if (reserved(r->guest)) return FP_SLOW; struct bind *through; if (to_host(r->guest, r->host, &through) < 0) return FP_SLOW; - long s = sc(SYS_newfstatat, AT_FDCWD, (long)r->host, (long)&r->st, AT_SYMLINK_NOFOLLOW, 0); + long s = hsc(SYS_newfstatat, r->host, (long)&r->st, AT_SYMLINK_NOFOLLOW, 0); if (s < 0) { int glue = glue_above_binding(r->guest, glen + n); if (glue < 0) return FP_SLOW; @@ -648,13 +855,13 @@ static long walk(struct res *r, const char *text, int follow, int last) { t = proc_link(r, target, final && last); if (t == FP_SLOW) return FP_SLOW; if (t == 0) { - if (sc(SYS_newfstatat, AT_FDCWD, (long)r->host, (long)&r->st, 0, 0) < 0) return FP_SLOW; + if (hsc(SYS_newfstatat, r->host, (long)&r->st, 0, 0) < 0) return FP_SLOW; r->magic = 1; r->exists = 1; return 0; } } else { - t = sc(SYS_readlinkat, AT_FDCWD, (long)r->host, (long)target, sizeof target - 1, 0); + t = hsc(SYS_readlinkat, r->host, (long)target, sizeof target - 1, 0); if (t <= 0 || t >= (long)sizeof target - 1) return FP_SLOW; target[t] = 0; if (detranslated(target, r->host) == FP_SLOW) return FP_SLOW; @@ -676,7 +883,7 @@ static long walk(struct res *r, const char *text, int follow, int last) { } if (!stated) { if (to_host(r->guest, r->host, NULL) < 0) return FP_SLOW; - long s = sc(SYS_newfstatat, AT_FDCWD, (long)r->host, (long)&r->st, AT_SYMLINK_NOFOLLOW, 0); + long s = hsc(SYS_newfstatat, r->host, (long)&r->st, AT_SYMLINK_NOFOLLOW, 0); if (s < 0 && strcmp(r->guest, "/") != 0 && glue_above_binding(r->guest, strlen(r->guest))) return FP_SLOW; if (s < 0) return s == -ENOENT ? FP_SLOW : s; } @@ -699,7 +906,7 @@ static long bound_literal(const char *literal, struct res *r) { struct bind *bd; if (reserved(literal) || bind_of(literal, &bd) < 0 || !bd || bd->glen != strlen(literal) || bd->glen < 2) return FP_SLOW; if (snprintf(r->host, PATH_MAX, "%s", bd->host) >= PATH_MAX) return FP_SLOW; - if (sc(SYS_newfstatat, AT_FDCWD, (long)r->host, (long)&r->st, AT_SYMLINK_NOFOLLOW, 0) < 0 || S_ISLNK(r->st.st_mode)) return FP_SLOW; + if (hsc(SYS_newfstatat, r->host, (long)&r->st, AT_SYMLINK_NOFOLLOW, 0) < 0 || S_ISLNK(r->st.st_mode)) return FP_SLOW; snprintf(r->guest, PATH_MAX, "%s", literal); r->exists = 1; r->moving = 0; @@ -822,8 +1029,8 @@ static long fp_open(int dirfd, const char *path, int flags, mode_t mode) { long rs = resolve(dirfd, path, follow | MAY_BE_UNSEEN, &r); if (rs < 0) return rs; if (rs == 1 && !(flags & O_CREAT)) return -ENOENT; - if (rs == UNSEEN) return sc(SYS_openat, AT_FDCWD, (long)r.host, flags, (flags & O_CREAT) ? mode : 0, 0); - return sc(SYS_openat, AT_FDCWD, (long)r.host, flags | (follow && !r.magic ? O_NOFOLLOW : 0), (flags & O_CREAT) ? mode : 0, 0); + if (rs == UNSEEN) return hsc(SYS_openat, r.host, flags, (flags & O_CREAT) ? mode : 0, 0); + return hsc(SYS_openat, r.host, flags | (follow && !r.magic ? O_NOFOLLOW : 0), (flags & O_CREAT) ? mode : 0, 0); } static int do_openat(int dirfd, const char *path, int flags, mode_t mode, int (*real)(int, const char *, int, ...)) { @@ -864,7 +1071,7 @@ static long fp_stat(int dirfd, const char *path, int flags, struct stat *st) { long rs = resolve(dirfd, path, (flags & AT_SYMLINK_NOFOLLOW ? 0 : 1) | MAY_BE_UNSEEN, &r); if (rs < 0) return rs; if (rs == 1) return -ENOENT; - if (rs == UNSEEN) return sc(SYS_newfstatat, AT_FDCWD, (long)r.host, (long)st, flags, 0); + if (rs == UNSEEN) return hsc(SYS_newfstatat, r.host, (long)st, flags, 0); *st = r.st; return 0; } @@ -1007,7 +1214,7 @@ static long fp_access(int dirfd, const char *path, int mode, int flags) { ? resolve(dirfd, path, (flags & AT_SYMLINK_NOFOLLOW ? 0 : 1) | MAY_BE_UNSEEN, &r) : FP_SLOW; if (rs == 1) rs = -ENOENT; if (rs == 0 && S_ISLNK(r.st.st_mode)) rs = FP_SLOW; - if (rs == 0 || rs == UNSEEN) rs = sc(SYS_faccessat, AT_FDCWD, (long)r.host, mode, 0, 0); + if (rs == 0 || rs == UNSEEN) rs = hsc(SYS_faccessat, r.host, mode, 0, 0); return rs; } @@ -1030,7 +1237,7 @@ static long link_text(const struct res *r, char *text, size_t size, int *changed *changed = 0; if (in_proc != under(r->host, "/proc", 5)) return FP_SLOW; if (in_proc) return proc_readlink(r, text, size, changed); - long t = sc(SYS_readlinkat, AT_FDCWD, (long)r->host, (long)text, PATH_MAX - 1, 0); + long t = hsc(SYS_readlinkat, r->host, (long)text, PATH_MAX - 1, 0); if (t < 0) return t; if (t >= PATH_MAX - 1) return FP_SLOW; if (size && (size_t)t > size) t = size; @@ -1135,7 +1342,7 @@ char *__getcwd_chk(char *buf, size_t size, size_t room) { static long fp_mkdir(int dirfd, const char *path, mode_t mode) { struct res r; long rs = resolve(dirfd, path, MAY_BE_UNSEEN, &r); - if (rs == 0 || rs == 1 || rs == UNSEEN) rs = sc(SYS_mkdirat, AT_FDCWD, (long)r.host, mode, 0, 0); + if (rs == 0 || rs == 1 || rs == UNSEEN) rs = hsc(SYS_mkdirat, r.host, mode, 0, 0); return rs; } int mkdirat(int dirfd, const char *path, mode_t mode) { @@ -1172,7 +1379,7 @@ static long fp_unlink(int dirfd, const char *path, int flags) { if (rs == 0 && (flags & AT_REMOVEDIR) && strcmp(r.guest, "/") == 0) rs = FP_SLOW; if (rs == 0 || rs == UNSEEN) { int changes_paths = (flags & AT_REMOVEDIR) || rs == UNSEEN || S_ISLNK(r.st.st_mode); - rs = sc(SYS_unlinkat, AT_FDCWD, (long)r.host, flags, 0, 0); + rs = hsc(SYS_unlinkat, r.host, flags, 0, 0); if (rs == 0 && changes_paths) forget(); } return rs; @@ -1196,9 +1403,14 @@ static long fp_rename(int olddirfd, const char *old, int newdirfd, const char *n if (rt < 0) rs = rt; else if (rt == 0 && S_ISDIR(to.st.st_mode)) rs = FP_SLOW; else { - rs = flags ? sc(SYS_renameat2, AT_FDCWD, (long)from.host, AT_FDCWD, (long)to.host, flags) - : sc(SYS_renameat, AT_FDCWD, (long)from.host, AT_FDCWD, (long)to.host, 0); - if (rs == 0) forget(); + struct near a, b; + near_get(from.host, &a); + near_get(to.host, &b); + rs = flags ? sc(SYS_renameat2, a.fd, (long)a.name, b.fd, (long)b.name, flags) + : sc(SYS_renameat, a.fd, (long)a.name, b.fd, (long)b.name, 0); + near_put(&a); + near_put(&b); + if (rs == 0 && (S_ISLNK(from.st.st_mode) || (rt == 0 && S_ISLNK(to.st.st_mode)))) forget(); } } return rs; @@ -1236,7 +1448,10 @@ static long fp_chmod(int dirfd, const char *path, mode_t mode, int flags) { struct res r; long rs = flags ? FP_SLOW : resolve(dirfd, path, 1 | MAY_BE_UNSEEN, &r); if (rs == 1) rs = -ENOENT; - if (rs == 0 || rs == UNSEEN) rs = sc(SYS_fchmodat, AT_FDCWD, (long)r.host, mode, 0, 0); + if (rs == 0 || rs == UNSEEN) { + rs = hsc(SYS_fchmodat, r.host, mode, 0, 0); + if (rs == 0) dirs_drop(r.host); + } return rs; } int fchmodat(int dirfd, const char *path, mode_t mode, int flags) { @@ -1249,7 +1464,10 @@ static long fp_chown(int dirfd, const char *path, uid_t uid, gid_t gid, int flag struct res r; long rs = flags & ~AT_SYMLINK_NOFOLLOW ? FP_SLOW : resolve(dirfd, path, (flags & AT_SYMLINK_NOFOLLOW ? 0 : 1) | MAY_BE_UNSEEN, &r); if (rs == 1) rs = -ENOENT; - if (rs == 0 || rs == UNSEEN) rs = sc(SYS_fchownat, AT_FDCWD, (long)r.host, (long)uid, (long)gid, flags); + if (rs == 0 || rs == UNSEEN) { + rs = hsc(SYS_fchownat, r.host, (long)uid, (long)gid, flags); + if (rs == 0) dirs_drop(r.host); + } return rs; } int fchownat(int dirfd, const char *path, uid_t uid, gid_t gid, int flags) { @@ -1267,7 +1485,7 @@ static long fp_utimens(int dirfd, const char *path, const struct timespec times[ } else { rs = flags & ~AT_SYMLINK_NOFOLLOW ? FP_SLOW : resolve(dirfd, path, (flags & AT_SYMLINK_NOFOLLOW ? 0 : 1) | MAY_BE_UNSEEN, &r); if (rs == 1) rs = -ENOENT; - if (rs == 0 || rs == UNSEEN) rs = sc(SYS_utimensat, AT_FDCWD, (long)r.host, (long)times, flags, 0); + if (rs == 0 || rs == UNSEEN) rs = hsc(SYS_utimensat, r.host, (long)times, flags, 0); } return rs; } @@ -1509,7 +1727,7 @@ static long socket_address(const struct sockaddr *addr, socklen_t len, int follo char *slash = strrchr(r.host, '/'); if (!slash || slash == r.host) return FP_SLOW; *slash = 0; - *dir = sc(SYS_openat, AT_FDCWD, (long)r.host, O_PATH | O_DIRECTORY | O_CLOEXEC, 0, 0); + *dir = hsc(SYS_openat, r.host, O_PATH | O_DIRECTORY | O_CLOEXEC, 0, 0); if (*dir < 0) return FP_SLOW; hlen = snprintf(out->sun_path, room, "/proc/self/fd/%ld/%s", *dir, slash + 1); if (hlen >= room) { sc(SYS_close, *dir, 0, 0, 0, 0); *dir = -1; return FP_SLOW; } diff --git a/tools/proot/patches/0028-fchdir-open-directory.patch b/tools/proot/patches/0028-fchdir-open-directory.patch new file mode 100644 index 0000000000..8e1a494386 --- /dev/null +++ b/tools/proot/patches/0028-fchdir-open-directory.patch @@ -0,0 +1,108 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: maxjivi05 +Date: Thu, 12 Nov 2026 22:00:00 -0500 +Subject: [PATCH] fchdir: take the path of the open directory instead of resolving + it again component by component + +--- +--- a/src/syscall/enter.c ++++ b/src/syscall/enter.c +@@ -46,8 +46,66 @@ + #include "tracee/abi.h" + #include "path/path.h" + #include "path/canon.h" ++#include "path/binding.h" + #include "arch.h" + ++static int translate_open_directory(Tracee *tracee, char path[PATH_MAX], int fd, struct stat *statl) ++{ ++ char guest[PATH_MAX]; ++ char mount[PATH_MAX]; ++ char parent[PATH_MAX]; ++ char link[32]; ++ char *slash; ++ const Binding *binding; ++ size_t length; ++ int status; ++ ++ status = readlink_proc_pid_fd(tracee->pid, fd, path); ++ if (status < 0 || path[0] != '/') ++ return 1; ++ ++ strcpy(guest, path); ++ status = detranslate_path(tracee, guest, NULL); ++ if (status < 0) ++ return 1; ++ ++ binding = get_binding(tracee, GUEST, guest); ++ if (binding == NULL) ++ return 1; ++ ++ strcpy(parent, binding->guest.path); ++ slash = strrchr(parent, '/'); ++ if (slash != NULL && slash != parent) { ++ if ((size_t) (slash - parent) + 3 > PATH_MAX) ++ return 1; ++ ++ strcpy(slash, "/."); ++ strcpy(mount, "/"); ++ status = canonicalize(tracee, parent, true, mount, 0); ++ if (status < 0 || strcmp(mount, parent) != 0) ++ return 1; ++ } ++ ++ status = substitute_binding(tracee, GUEST, guest); ++ if (status < 0 || strcmp(guest, path) != 0) ++ return 1; ++ ++ status = snprintf(link, sizeof(link), "/proc/%d/fd/%d", tracee->pid, fd); ++ if (status < 0 || (size_t) status >= sizeof(link)) ++ return 1; ++ ++ status = stat(link, statl); ++ if (status < 0 || !S_ISDIR(statl->st_mode) || statl->st_nlink == 0) ++ return 1; ++ ++ length = strlen(path); ++ if (length + 2 >= PATH_MAX) ++ return 1; ++ ++ strcpy(path + (length == 1 ? 0 : length), "/."); ++ return 0; ++} ++ + /** + * Translate @path and put the result in the @tracee's memory address + * space pointed to by the @reg argument of the current syscall. See +@@ -193,13 +251,16 @@ + dirfd = peek_reg(tracee, CURRENT, SYSARG_1); + } + +- status = translate_path(tracee, path, dirfd, oldpath, true); +- if (status < 0) +- break; ++ if (syscall_number == PR_chdir ++ || translate_open_directory(tracee, path, dirfd, &statl) != 0) { ++ status = translate_path(tracee, path, dirfd, oldpath, true); ++ if (status < 0) ++ break; + +- status = lstat(path, &statl); +- if (status < 0) +- break; ++ status = lstat(path, &statl); ++ if (status < 0) ++ break; ++ } + + /* Check this directory is accessible. */ + if ((statl.st_mode & S_IXUSR) == 0) +@@ -208,7 +269,7 @@ + + + +- if (getenv("PROOT_FASTPATH") != NULL) { ++ if (syscall_number == PR_chdir && getenv("PROOT_FASTPATH") != NULL) { + int fd = open(path, O_PATH | O_DIRECTORY | O_CLOEXEC); + + diff --git a/tools/release/publish-ci.sh b/tools/release/publish-ci.sh index 987ef622dd..1b3a9ae477 100644 --- a/tools/release/publish-ci.sh +++ b/tools/release/publish-ci.sh @@ -17,8 +17,9 @@ $(cat signed/SHA256SUMS.txt) gh release delete "$tag" -R "$CI_REPO" --yes --cleanup-tag 2>/dev/null || true gh release create "$tag" -R "$CI_REPO" --target main --prerelease \ --title "main ${GITHUB_SHA::7}" --notes "$notes" signed/* -gh release list -R "$CI_REPO" -L 200 --json tagName,publishedAt \ - --jq '[.[] | select(.tagName | startswith("main-"))] | sort_by(.publishedAt) | reverse | .['"$KEEP"':][] | .tagName' | +cutoff=$(date -u -d "-${KEEP_DAYS} days" +%Y-%m-%dT%H:%M:%SZ) +gh release list -R "$CI_REPO" -L 1000 --exclude-drafts --json tagName,publishedAt \ + --jq '.[] | select((.tagName | startswith("main-")) and .publishedAt < "'"$cutoff"'") | .tagName' | while IFS= read -r old; do if [ "$old" = "$tag" ]; then continue diff --git a/tools/release/runtime_inputs.py b/tools/release/runtime_inputs.py index 806c49f79e..12ac22eabb 100644 --- a/tools/release/runtime_inputs.py +++ b/tools/release/runtime_inputs.py @@ -14,19 +14,20 @@ ROOT = Path(__file__).resolve().parents[2] MANIFEST = Path('app/build/runtime-inputs.json') PACKS = Path('app/build/packs') PACKED = {'assets/linuxfs/usr/local/lib/droiddeck-xbox/': 'xbox', 'assets/linuxfs/usr/local/lib/droiddeck-comet/': 'comet', + 'assets/linuxfs/usr/local/lib/droiddeck-ubisoft/': 'ubisoft', 'assets/directaudio/': 'directaudio', 'assets/hybris/': 'powervr'} PACKED_FILES = {'lib/arm64-v8a/libproot.so': ('proot', 'libproot.so'), 'lib/arm64-v8a/libproot-loader.so': ('proot', 'libproot-loader.so')} PACKED_LIBRARIES = ['lib/arm64-v8a/libopencv_java4.so', 'lib/arm64-v8a/libmediapipe_tasks_jni.so'] -PACK_NAMES = ['proot', 'directaudio', 'tracking', 'xbox', 'comet', 'butler', 'powervr'] +PACK_NAMES = ['proot', 'directaudio', 'tracking', 'xbox', 'comet', 'butler', 'powervr', 'ubisoft'] SOURCE_PATHS = ['app/build.gradle', 'app/src/main/cpp/fakeinput_steam.cpp', 'app/src/main/assets/pulseaudio.tzst', 'tools/linuxfs', 'tools/proot', 'tools/aaudio-sink', 'tools/directaudio', 'tools/packs', 'tools/gamescope/release.env', 'tools/droiddeck-esync/release.env', - 'tools/mangoapp', 'tools/msitools', 'tools/pipewire', 'tools/comet', 'tools/xbox', 'tools/dirt-ws2', 'tools/components', 'tools/ci', 'tools/build_local.sh', + 'tools/mangoapp', 'tools/msitools', 'tools/pipewire', 'tools/comet', 'tools/xbox', 'tools/dirt-ws2', 'tools/ubisoft-launcher', 'tools/rockstar-launcher', 'tools/components', 'tools/ci', 'tools/build_local.sh', 'tools/powervr', 'tools/hybris', 'tools/dxvk', 'tools/vulkan-wsi', 'tools/release/runtime_inputs.py', 'app/src/main/assets/desktop-removal', 'tools/quest', 'tools/vr/src', 'tools/vr/driver_droiddeck', 'tools/vr/layer', 'tools/vr/build.sh', - 'tools/gpuload', + 'tools/gpuload', 'app/src/main/resources/rockstar/legacy-cipher.bin', 'app/src/main/cpp/waylandcomp/src/headpose_shm.h', 'app/src/main/cpp/venc/venc_proto.h', 'app/src/main/cpp/waylandcomp/src/spatialpose_shm.h', @@ -76,7 +77,7 @@ def required(): paths += [f'assets/graphics_driver/adrenotools-{name}.tzst' for name in ['turnip26.3.0-a6xx', 'turnip26.3.0-quest2']] paths += ['assets/linuxfs/' + name for name in ['libfakeinput.so', 'libblsession.so', - 'libblfastpath.so', 'libssbs.so', 'usr/local/bin/droiddeck-clipboard', + 'libblfastpath.so', 'libddnatv-hook.so', 'libssbs.so', 'usr/local/bin/droiddeck-clipboard', 'usr/local/bin/droiddeck-gog-maintenance', 'usr/local/bin/gamescope', 'usr/local/lib/droiddeck/uruntime', 'usr/local/lib/droiddeck-pipewire.tzst']] @@ -211,7 +212,8 @@ def pack_digests(root, name): def check_apk(apk, root=ROOT): data = verify(root) - packs = {name: pack_digests(root, name) for name in PACK_NAMES} + packs = {name: pack_digests(root, name) for name in PACK_NAMES + if name != 'ubisoft' or (root / PACKS / 'ubisoft.tar.zst').is_file()} with ZipFile(apk) as package: names = set(package.namelist()) for library in PACKED_LIBRARIES: @@ -231,7 +233,7 @@ def check_apk(apk, root=ROOT): if prefix: if name in names: raise ValueError('APK still carries ' + name + ', which the ' + PACKED[prefix] + ' pack provides') - if packs[PACKED[prefix]].get(name[len(prefix):]) != output['sha256']: + if packs.get(PACKED[prefix], {}).get(name[len(prefix):]) != output['sha256']: raise ValueError('Add-on pack ' + PACKED[prefix] + ' is missing or has a stale ' + name) continue try: diff --git a/tools/release/sign-apk.sh b/tools/release/sign-apk.sh index 160d49b5ea..a7cfd8f531 100755 --- a/tools/release/sign-apk.sh +++ b/tools/release/sign-apk.sh @@ -27,7 +27,7 @@ if [ "$pkg" = "$P" ]; then else python3 "$here/axml_rename.py" "$in" "$work/renamed.apk" \ "$P=$pkg" "$P.androidx-startup=$pkg.androidx-startup" "$P.logs=$pkg.logs" \ - "$P.pairingguide=$pkg.pairingguide" "$P.pin=$pkg.pin" \ + "$P.pairingguide=$pkg.pairingguide" "$P.devicecode=$pkg.devicecode" "$P.pin=$pkg.pin" \ "$P.documents=$pkg.documents" "$P.home=$pkg.home" "$P.agent=$pkg.agent" \ "$P.vr_recovery=$pkg.vr_recovery" "$P.dualscreen=$pkg.dualscreen" "$P.typing=$pkg.typing" \ "$P.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION=$pkg.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION" diff --git a/tools/release/update_catalog.py b/tools/release/update_catalog.py index 94ecd1ce5c..8ceadb5fcb 100755 --- a/tools/release/update_catalog.py +++ b/tools/release/update_catalog.py @@ -17,6 +17,7 @@ API = "https://api.github.com" SHA256 = re.compile(r"^[0-9a-f]{64}$") PR_TAG = re.compile(r"^pr-([1-9][0-9]*)$") MAIN_TAG = re.compile(r"^main-([0-9a-f]{7,40})$") +MERGED_PR = re.compile(r"\[PR #([1-9][0-9]*)\]\(") class ApiError(RuntimeError): @@ -53,6 +54,20 @@ class GitHub: def get(self, path: str): return self.request("GET", path) + def get_all(self, path: str, limit: int = 1000) -> list: + items = [] + page = 1 + sep = "&" if "?" in path else "?" + while len(items) < limit: + batch = self.get(f"{path}{sep}per_page=100&page={page}") + if not batch: + break + items.extend(batch) + if len(batch) < 100: + break + page += 1 + return items + def put(self, path: str, body): return self.request("PUT", path, body) @@ -100,15 +115,20 @@ def parse_variants(text: str) -> list[tuple[str, str]]: return out -def published_millis(release: dict, prefer_updated: bool = False) -> int: - value = ( - release.get("updated_at") if prefer_updated else None - ) or release.get("published_at") or release.get("created_at") +def iso_millis(value: str | None) -> int: if not value: return 0 return int(dt.datetime.fromisoformat(value.replace("Z", "+00:00")).timestamp() * 1000) +def published_millis(release: dict, prefer_updated: bool = False) -> int: + return iso_millis( + (release.get("updated_at") if prefer_updated else None) + or release.get("published_at") + or release.get("created_at") + ) + + def paragraphs(markdown: str) -> list[str]: return [p.strip() for p in re.split(r"\n\s*\n", markdown.replace("\r", "")) if p.strip()] @@ -195,6 +215,7 @@ def release_entry( title: str, summary: str, prefer_updated: bool = False, + extra: dict | None = None, ): suffixes = [suffix for _, suffix in variants] apks = {} @@ -220,6 +241,7 @@ def release_entry( "versionCode": version_code, "publishedAt": published_millis(release, prefer_updated), "url": release.get("html_url") or "", + **(extra or {}), "apks": apks, } @@ -289,8 +311,52 @@ def stable_app_release(releases: list[dict]) -> dict | None: return max(apps, key=lambda r: r.get("published_at") or r.get("created_at") or "", default=None) -def build_catalog(source: GitHub, ci: GitHub, source_repo: str, ci_repo: str) -> dict: - stable_release = stable_app_release(source.get(f"/repos/{source_repo}/releases?per_page=100")) +def merged_pr(release: dict) -> int: + ps = paragraphs(release.get("body") or "") + match = MERGED_PR.search(ps[0]) if ps else None + return int(match.group(1)) if match else 0 + + +class Cache: + """Commit facts carried over from the published catalog, so a run only asks GitHub about new builds.""" + + def __init__(self, previous: dict | None): + self.commits: dict[str, dict] = {} + for entry in (previous or {}).get("previews") or []: + commit = (entry.get("commit") or "").lower() + if commit and entry.get("committedAt"): + self.commits[commit] = {"author": entry.get("author") or "", "committedAt": entry["committedAt"]} + + def commit(self, gh: GitHub, repo: str, sha: str) -> dict: + sha = sha.lower() + if sha not in self.commits: + try: + obj = gh.get(f"/repos/{repo}/commits/{q(sha)}") + self.commits[sha] = { + "author": (obj.get("author") or {}).get("login") or "", + "committedAt": iso_millis(((obj.get("commit") or {}).get("committer") or {}).get("date")), + } + except ApiError: + self.commits[sha] = {"author": "", "committedAt": 0} + return self.commits[sha] + + +def unique_previews(previews: list[dict]) -> list[dict]: + ordered = sorted(previews, key=lambda r: (r.get("committedAt") or r["publishedAt"], r["publishedAt"]), reverse=True) + result = [] + seen = set() + for preview in ordered: + commit = preview["commit"].lower() + if commit in seen: + continue + seen.add(commit) + result.append(preview) + return result + + +def build_catalog(source: GitHub, ci: GitHub, source_repo: str, ci_repo: str, previous: dict | None = None) -> dict: + cache = Cache(previous) + stable_release = stable_app_release(source.get_all(f"/repos/{source_repo}/releases", limit=300)) stable = None if stable_release: @@ -307,9 +373,11 @@ def build_catalog(source: GitHub, ci: GitHub, source_repo: str, ci_repo: str) -> signer, title, summary, + extra={"committedAt": cache.commit(source, source_repo, stable_commit)["committedAt"]}, ) - releases = ci.get(f"/repos/{ci_repo}/releases?per_page=100") + main_code, _, main_variants, main_signer = source_meta(source, source_repo, "main") + releases = ci.get_all(f"/repos/{ci_repo}/releases") previews = [] preview_history = [] tests = [] @@ -322,12 +390,20 @@ def build_catalog(source: GitHub, ci: GitHub, source_repo: str, ci_repo: str) -> commit = main_commit(release) if not commit: continue - try: - code, _, variants, signer = source_meta(source, source_repo, commit) - except ApiError: - continue + code_text = release_body_value(release.get("body") or "", "VersionCode") + if code_text and code_text.isdigit(): + code, variants, signer = int(code_text), main_variants, main_signer + else: + try: + code, _, variants, signer = source_meta(source, source_repo, commit) + except ApiError: + continue + facts = cache.commit(source, source_repo, commit) title, summary = ci_description(release) - preview = release_entry(release, commit, 0, None, code, variants, signer, title, summary) + preview = release_entry( + release, commit, 0, None, code, variants, signer, title, summary, + extra={"mergedPr": merged_pr(release), "author": facts["author"], "committedAt": facts["committedAt"]}, + ) previews.append(preview) history_entry = preview_history_entry(release, preview, variants) if history_entry: @@ -350,16 +426,15 @@ def build_catalog(source: GitHub, ci: GitHub, source_repo: str, ci_repo: str) -> commit = release_body_value(body, "Commit") if not commit or not re.fullmatch(r"[0-9a-f]{7,40}", commit): continue - base_ref = release_body_value(body, "Base") or pull["base"]["sha"] - try: - base_code, _, variants, signer = source_meta(source, source_repo, base_ref) - except ApiError: - continue version_code_text = release_body_value(body, "VersionCode") if version_code_text and version_code_text.isdigit(): version_code = int(version_code_text) else: - version_code = base_code + base_ref = release_body_value(body, "Base") or pull["base"]["sha"] + try: + version_code = source_meta(source, source_repo, base_ref)[0] + except ApiError: + continue try: changed = source.get(f"/repos/{source_repo}/pulls/{pr}/files?per_page=100") if any(item.get("filename") == "app/build.gradle" for item in changed): @@ -375,52 +450,69 @@ def build_catalog(source: GitHub, ci: GitHub, source_repo: str, ci_repo: str) -> pr, None, version_code, - variants, - signer, + main_variants, + main_signer, title, summary, prefer_updated=True, + extra={ + "author": (pull.get("user") or {}).get("login") or "", + "headCommit": (pull.get("head") or {}).get("sha") or "", + "builtAt": max( + (iso_millis(a.get("updated_at") or a.get("created_at")) + for a in release.get("assets") or [] if (a.get("name") or "").endswith(".apk")), + default=0, + ), + }, ) ) - previews.sort(key=lambda r: r["publishedAt"], reverse=True) + ordered = unique_previews(previews) tests.sort(key=lambda r: r["publishedAt"], reverse=True) return { "schema": 1, "sourceRepo": source_repo, "ciRepo": ci_repo, "generatedAt": int(time.time() * 1000), + "mainVersionCode": main_code, "stable": stable, - "preview": previews[0] if previews else None, + "preview": ordered[0] if ordered else None, "recentPreviews": recent_previews(preview_history), + "previews": ordered, "tests": tests, } -def current_file(ci: GitHub, repo: str, path: str): +def current_file(ci: GitHub, repo: str, path: str, branch: str = "main"): try: - return ci.get(f"/repos/{repo}/contents/{q(path)}?ref=main") + return ci.get(f"/repos/{repo}/contents/{q(path)}?ref={q(branch)}") except ApiError as e: if e.status == 404: return None raise -def publish_catalog(source: GitHub, ci: GitHub, source_repo: str, ci_repo: str, path: str): +def previous_catalog(old: dict | None) -> dict | None: + try: + return json.loads(base64.b64decode(old["content"])) if old and old.get("content") else None + except Exception: + return None + + +def publish_catalog(source: GitHub, ci: GitHub, source_repo: str, ci_repo: str, path: str, branch: str = "main"): for attempt in range(4): - catalog = build_catalog(source, ci, source_repo, ci_repo) - content = (json.dumps(catalog, indent=2, sort_keys=False) + "\n").encode() - old = current_file(ci, ci_repo, path) + old = current_file(ci, ci_repo, path, branch) + catalog = build_catalog(source, ci, source_repo, ci_repo, previous_catalog(old)) + content = (json.dumps(catalog, separators=(",", ":")) + "\n").encode() body = { "message": "ci: refresh DroidDeck update catalog", "content": base64.b64encode(content).decode(), - "branch": "main", + "branch": branch, } if old: body["sha"] = old["sha"] try: - old_bytes = base64.b64decode(old["content"]) - old_json = json.loads(old_bytes) + old_json = dict(previous_catalog(old) or {}) old_json.pop("generatedAt", None) new_json = dict(catalog) new_json.pop("generatedAt", None) @@ -431,7 +523,7 @@ def publish_catalog(source: GitHub, ci: GitHub, source_repo: str, ci_repo: str, pass try: ci.put(f"/repos/{ci_repo}/contents/{q(path)}", body) - print(f"published https://raw.githubusercontent.com/{ci_repo}/main/{path}") + print(f"published https://raw.githubusercontent.com/{ci_repo}/{branch}/{path}") return catalog except ApiError as e: if e.status not in (409, 422) or attempt == 3: @@ -445,6 +537,7 @@ def main(): parser.add_argument("--source-repo", default="Droid-Deck/DroidDeck") parser.add_argument("--ci-repo", default="Droid-Deck/DroidDeck-CI") parser.add_argument("--path", default="catalog.json") + parser.add_argument("--branch", default="main") parser.add_argument("--dry-run", action="store_true") args = parser.parse_args() @@ -455,7 +548,7 @@ def main(): else: if not os.environ.get("CI_GITHUB_TOKEN"): raise SystemExit("CI_GITHUB_TOKEN is required to publish") - publish_catalog(source, ci, args.source_repo, args.ci_repo, args.path) + publish_catalog(source, ci, args.source_repo, args.ci_repo, args.path, args.branch) if __name__ == "__main__": diff --git a/tools/rockstar-launcher/.gitignore b/tools/rockstar-launcher/.gitignore new file mode 100644 index 0000000000..b83d22266a --- /dev/null +++ b/tools/rockstar-launcher/.gitignore @@ -0,0 +1 @@ +/target/ diff --git a/tools/rockstar-launcher/Cargo.lock b/tools/rockstar-launcher/Cargo.lock new file mode 100644 index 0000000000..f73866571d --- /dev/null +++ b/tools/rockstar-launcher/Cargo.lock @@ -0,0 +1,105 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "droiddeck-rockstar-launcher" +version = "0.1.0" +dependencies = [ + "serde_json", +] + +[[package]] +name = "itoa" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bd1574e617a9a6c1f8f8181bd7e841e1f20e4277607ef28945765188d6284d4" + +[[package]] +name = "memchr" +version = "2.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" + +[[package]] +name = "proc-macro2" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "serde" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba" +dependencies = [ + "serde_core", +] + +[[package]] +name = "serde_core" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.154" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "syn" +version = "3.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8593e8e72159ed2257d083c7a454a85cbf854f37a0966d8d483aff8c8a3ebcee" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d245f478577f809a851594d02313b640fb437e0bb33866753cff937863096954" + +[[package]] +name = "zmij" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" diff --git a/tools/rockstar-launcher/Cargo.toml b/tools/rockstar-launcher/Cargo.toml new file mode 100644 index 0000000000..4b5ec1f37b --- /dev/null +++ b/tools/rockstar-launcher/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "droiddeck-rockstar-launcher" +version = "0.1.0" +edition = "2021" +license = "GPL-3.0-only" +publish = false + +[[bin]] +name = "Launcher" +path = "src/main.rs" + +[dependencies] +serde_json = "1" + +[profile.release] +opt-level = "s" +lto = true +panic = "abort" +strip = true diff --git a/tools/rockstar-launcher/README.md b/tools/rockstar-launcher/README.md new file mode 100644 index 0000000000..2965084713 --- /dev/null +++ b/tools/rockstar-launcher/README.md @@ -0,0 +1,36 @@ +# Rockstar launcher service + +`Launcher.exe` starts the selected installed game and serves its launcher pipes. The Android app obtains title authorization from Rockstar. Refresh credentials stay in Android Keystore-backed storage. + +The handoff is mode 0600, expires after 90 seconds and is deleted before starting the game. Legacy launches carry server-issued launch material. SDK launches also carry a short-lived ROS ticket and account identity; those values are kept in memory after the handoff is consumed and are not logged. Pipes reject remote clients and check the client process against the launched child. No game files are patched. + +GTA III, Vice City and San Andreas use body-length MTLX replies. GTA IV and L.A. Noire use total-length, terminated replies. Titles with installed Social Club metadata or SDK binaries use the SDK IPC adapter, including user-info, login, ticket, initialization and authorized title-state synchronization. The title metadata supplies the ROS identity and principal executable; it is checked against Rockstar's catalog before title authorization. Other titles retain Play and Steam shortcuts and attempt the normal executable launch path. + +The SDK runtime is extracted from the game's own Social-Club-Setup.exe when present. Architecture-specific payloads are staged into the prefix, archive paths and sizes are checked, interrupted copies are retried, and both registry views are registered. The helper discovers launcher identity pipe names in the game executable and answers bounded INIT challenges from the launched process. No vendor executables or runtime files are bundled with this tool. SDK initialization has a 90-second deadline. SDK wire tests and fixture clients do not establish gameplay compatibility for every title; per-title ROS ticket exchange and secondary SDK channels remain unverified. + +GTA III defaults to full x87 precision for FEX before Wine starts, because reduced precision crashed new-game initialization on the test device. San Andreas defaults to WineD3D, because DXVK intermittently corrupted its textures; full precision and conservative memory ordering did not prevent that corruption. These defaults use DroidDeck's per-game settings and preserve explicit per-game overrides. + +Raw launcher identity requests use `INIT::` with a terminating colon. Framed requests carry their payload length. The reply echoes the complete challenge after `TINI:launcher:`; partial reads do not complete a raw request. + +`build.sh` builds 32-bit and 64-bit executables with the GNU Windows targets and stages them as APK resources. `legacy-cipher.bin` contains the fixed client protocol tables, not account credentials or APK signing keys. + +Run the protocol tests with: + +```sh +cargo test --locked --manifest-path tools/rockstar-launcher/Cargo.toml +``` + +The optional `capture` example records a first-party launcher reply to a new local file. Run it on Windows or Wine while launching the corresponding game in Rockstar's launcher: + +```powershell +cargo run --release --example capture --manifest-path tools/rockstar-launcher/Cargo.toml -- --pipe GTA-VC_Pipe --output 'C:\captures\reply.bin' +``` + +On Linux, cross-compile the example and run it in the same Wine prefix as Rockstar's launcher: + +```sh +cargo build --release --locked --example capture --target x86_64-pc-windows-gnu --manifest-path tools/rockstar-launcher/Cargo.toml +WINEPREFIX=/path/to/launcher-prefix wine tools/rockstar-launcher/target/x86_64-pc-windows-gnu/release/examples/capture.exe --pipe GTA-VC_Pipe --output 'Z:\tmp\reply.bin' +``` + +Captures contain live launch material. Keep them outside source control; the tool prints only the message tag and payload length. diff --git a/tools/rockstar-launcher/build.sh b/tools/rockstar-launcher/build.sh new file mode 100644 index 0000000000..1f7360f741 --- /dev/null +++ b/tools/rockstar-launcher/build.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +set -euo pipefail +here=$(cd "$(dirname "$0")" && pwd) +out=${1:-"$here/../../app/src/main/resources/rockstar/helpers"} +mkdir -p "$out" +for target in i686-pc-windows-gnu x86_64-pc-windows-gnu; do + rustup target add "$target" >/dev/null 2>&1 || true + cargo build --manifest-path "$here/Cargo.toml" --release --locked --target "$target" + name=Launcher64.exe + [[ "$target" == i686-* ]] && name=Launcher32.exe + install -m644 "${CARGO_TARGET_DIR:-$here/target}/$target/release/Launcher.exe" "$out/$name" +done diff --git a/tools/rockstar-launcher/examples/capture.rs b/tools/rockstar-launcher/examples/capture.rs new file mode 100644 index 0000000000..8516cbca17 --- /dev/null +++ b/tools/rockstar-launcher/examples/capture.rs @@ -0,0 +1,65 @@ +#[cfg(windows)] +fn main() -> std::io::Result<()> { + use droiddeck_rockstar_launcher::{pipe::Pipe, Frame, Length}; + use std::fs::OpenOptions; + use std::io::{self, Read, Write}; + use std::time::Duration; + + struct Recording<'a> { + source: &'a mut Pipe, + output: &'a mut std::fs::File, + } + + impl Read for Recording<'_> { + fn read(&mut self, buffer: &mut [u8]) -> io::Result { + let size = self.source.read(buffer)?; + self.output.write_all(&buffer[..size])?; + Ok(size) + } + } + + let args: Vec<_> = std::env::args_os().collect(); + let output = args + .windows(2) + .find(|pair| pair[0] == "--output") + .map(|pair| pair[1].clone()) + .map(std::path::PathBuf::from) + .unwrap_or(std::env::current_exe()?.with_file_name("reference-reply.bin")); + let mut file = OpenOptions::new() + .create_new(true) + .write(true) + .open(output)?; + let pipe_name = args + .windows(2) + .find(|pair| pair[0] == "--pipe") + .map(|pair| pair[1].to_string_lossy().into_owned()) + .unwrap_or_else(|| "GTA-VC_Pipe".to_owned()); + let mut pipe = Pipe::connect(&pipe_name, Duration::from_secs(90))?; + Frame { + tag: *b"COLE", + payload: Vec::new(), + nul_terminated: true, + } + .write(&mut pipe, Length::Total)?; + let reply = Frame::read( + &mut Recording { + source: &mut pipe, + output: &mut file, + }, + Length::Body, + ); + file.sync_all()?; + let reply = reply?; + println!( + "Received {} ({} payload bytes)", + String::from_utf8_lossy(&reply.tag), + reply.payload.len() + ); + Ok(()) +} + +#[cfg(not(windows))] +fn main() { + eprintln!("The reference pipe client runs on Windows or Wine."); + std::process::exit(1); +} diff --git a/tools/rockstar-launcher/examples/sdk_probe.rs b/tools/rockstar-launcher/examples/sdk_probe.rs new file mode 100644 index 0000000000..b280ce0409 --- /dev/null +++ b/tools/rockstar-launcher/examples/sdk_probe.rs @@ -0,0 +1,80 @@ +#[cfg(windows)] +fn run() -> Result<(), Box> { + use droiddeck_rockstar_launcher::{pipe::Pipe, sdk::Message, Frame, Length}; + use std::io::{Read, Write}; + for (path, framed) in [ + (b"\\\\.\\pipe\\ProbeLauncherPipe\0".as_slice(), true), + (b"\\\\.\\pipe\\RawProbeLauncher_Pipe\0".as_slice(), false), + ] { + let name = std::str::from_utf8(&path[9..path.len() - 1])?; + let mut pipe = Pipe::connect(name, std::time::Duration::from_secs(10))?; + let request = b"INIT:42:"; + if framed { + let mut bytes = (request.len() as u32).to_le_bytes().to_vec(); + bytes.extend_from_slice(request); + pipe.write_all(&bytes)?; + let response = Frame::read(&mut pipe, Length::Body)?; + if response.tag != *b"TINI" || response.payload != b"launcher:42:" { + return Err("invalid framed launcher identity reply".into()); + } + } else { + pipe.write_all(b"INIT:4")?; + std::thread::sleep(std::time::Duration::from_millis(20)); + pipe.write_all(b"2:")?; + let mut response = vec![0; b"TINI:launcher:42:".len()]; + pipe.read_exact(&mut response)?; + if response != b"TINI:launcher:42:" { + return Err("invalid raw launcher identity reply".into()); + } + } + } + let args: Vec<_> = std::env::args().collect(); + let instance: u32 = args + .iter() + .find_map(|arg| arg.strip_prefix("-processInstance=")) + .ok_or("missing instance")? + .parse()?; + let output = args + .windows(2) + .find(|pair| pair[0] == "--result") + .map(|pair| &pair[1]) + .ok_or("missing result path")?; + let mut pipe = Pipe::connect( + &format!("chrome.rgsc_gameinst_{instance}"), + std::time::Duration::from_secs(10), + )?; + if Message::read(&mut pipe)?.kind != 0xffff { + return Err("missing transport hello".into()); + } + Message { + routing: i32::MAX, + kind: 0x40000, + flags: 2, + payload: 4u32.to_le_bytes().to_vec(), + } + .write(&mut pipe)?; + let expected = [0x30002, 0x30003, 0x30004, 0x30000]; + for kind in expected { + let message = Message::read(&mut pipe)?; + if message.kind != kind || message.routing != i32::MAX || message.flags != 2 { + return Err("unexpected SDK message envelope".into()); + } + if kind == 0x30002 && message.payload != [3, 0, 0, 0, 123, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + { + return Err("unexpected fixture account".into()); + } + if kind == 0x30000 && message.payload != 4u32.to_le_bytes() { + return Err("launcher hello lost its context".into()); + } + } + std::fs::write(output, "SDK handshake accepted")?; + Ok(()) +} + +fn main() { + #[cfg(windows)] + if let Err(error) = run() { + eprintln!("SDK probe failed: {error}"); + std::process::exit(1); + } +} diff --git a/tools/rockstar-launcher/src/identity.rs b/tools/rockstar-launcher/src/identity.rs new file mode 100644 index 0000000000..795d56da1a --- /dev/null +++ b/tools/rockstar-launcher/src/identity.rs @@ -0,0 +1,170 @@ +use std::collections::BTreeSet; +use std::io::{self, Read}; + +const LIMIT: usize = 4096; + +fn invalid() -> io::Error { + io::Error::new( + io::ErrorKind::InvalidData, + "invalid launcher identity request", + ) +} + +fn collect(bytes: &[u8], names: &mut BTreeSet) { + let prefix = br"\\.\pipe\"; + for (index, window) in bytes.windows(prefix.len()).enumerate() { + if window != prefix { + continue; + } + let tail = &bytes[index + prefix.len()..]; + let Some(end) = tail.iter().take(97).position(|byte| *byte == 0) else { + continue; + }; + let name = &tail[..end]; + if !name.is_empty() + && name + .iter() + .all(|byte| byte.is_ascii_alphanumeric() || b"_-".contains(byte)) + { + let name = std::str::from_utf8(name).unwrap(); + if name.ends_with("LauncherPipe") || name.ends_with("Launcher_Pipe") { + names.insert(name.to_owned()); + } + } + } +} + +pub fn pipe_names(reader: &mut impl Read) -> io::Result> { + let mut names = BTreeSet::new(); + let mut carry = Vec::new(); + let mut chunk = [0; 65536]; + let mut total = 0usize; + loop { + let count = reader.read(&mut chunk)?; + if count == 0 { + break; + } + total += count; + if total > 256 * 1024 * 1024 { + return Err(invalid()); + } + carry.extend_from_slice(&chunk[..count]); + collect(&carry, &mut names); + for offset in 0..2 { + let ascii: Vec<_> = carry[offset..] + .chunks_exact(2) + .map(|pair| if pair[1] == 0 { pair[0] } else { 0 }) + .collect(); + collect(&ascii, &mut names); + } + if names.len() > 4 { + return Err(invalid()); + } + carry.drain(..carry.len().saturating_sub(256)); + } + Ok(names.into_iter().collect()) +} + +pub fn exchange(reader: &mut impl Read) -> io::Result> { + let mut header = [0; 4]; + reader.read_exact(&mut header)?; + let framed = header != *b"INIT"; + let mut request = if framed { + let size = u32::from_le_bytes(header) as usize; + if !(6..=LIMIT).contains(&size) { + return Err(invalid()); + } + let mut bytes = vec![0; size]; + reader.read_exact(&mut bytes)?; + bytes + } else { + let mut bytes = header.to_vec(); + let mut byte = [0]; + reader.read_exact(&mut byte)?; + if byte[0] != b':' { + return Err(invalid()); + } + bytes.push(b':'); + loop { + reader.read_exact(&mut byte)?; + if !(32..127).contains(&byte[0]) || bytes.len() >= 261 { + return Err(invalid()); + } + bytes.push(byte[0]); + if byte[0] == b':' { + break; + } + } + bytes + }; + if request.last() == Some(&0) { + request.pop(); + } + let challenge = request.strip_prefix(b"INIT:").ok_or_else(invalid)?; + if challenge.is_empty() + || !framed && challenge == b":" + || challenge.len() > 256 + || !challenge.iter().all(|byte| (32..127).contains(byte)) + { + return Err(invalid()); + } + let mut reply = b"TINI:launcher:".to_vec(); + reply.extend_from_slice(challenge); + if framed { + let mut bytes = (reply.len() as u32).to_le_bytes().to_vec(); + bytes.extend_from_slice(&reply); + Ok(bytes) + } else { + Ok(reply) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use std::io::Cursor; + + #[test] + fn discovers_ascii_and_wide_pipe_names_across_chunks() { + let mut bytes = vec![0; 65530]; + bytes.extend_from_slice(br"\\.\pipe\GameLauncherPipe"); + bytes.push(0); + for value in "\\\\.\\pipe\\OtherLauncher_Pipe\0".encode_utf16() { + bytes.extend_from_slice(&value.to_le_bytes()); + } + bytes.extend_from_slice(br"\\.\pipe\..\outsideLauncherPipe"); + bytes.push(0); + assert_eq!( + pipe_names(&mut Cursor::new(bytes)).unwrap(), + ["GameLauncherPipe", "OtherLauncher_Pipe"] + ); + } + + #[test] + fn identity_replies_echo_only_a_valid_challenge() { + struct Split(R); + impl Read for Split { + fn read(&mut self, buffer: &mut [u8]) -> io::Result { + let size = buffer.len().min(2); + self.0.read(&mut buffer[..size]) + } + } + assert_eq!( + exchange(&mut Split(Cursor::new(b"INIT:123456789:\0"))).unwrap(), + b"TINI:launcher:123456789:" + ); + let request = b"INIT:nonce:123:"; + let mut bytes = (request.len() as u32).to_le_bytes().to_vec(); + bytes.extend_from_slice(request); + let reply = exchange(&mut Cursor::new(bytes)).unwrap(); + assert_eq!( + u32::from_le_bytes(reply[..4].try_into().unwrap()) as usize, + reply.len() - 4 + ); + assert_eq!(&reply[4..], b"TINI:launcher:nonce:123:"); + assert!(exchange(&mut Cursor::new(b"INIT:")).is_err()); + assert!(exchange(&mut Cursor::new(b"INIT:a\0b")).is_err()); + assert!(exchange(&mut Cursor::new(b"INIT:unterminated")).is_err()); + assert!(exchange(&mut Cursor::new([255; 4])).is_err()); + } +} diff --git a/tools/rockstar-launcher/src/lib.rs b/tools/rockstar-launcher/src/lib.rs new file mode 100644 index 0000000000..e37ff76d85 --- /dev/null +++ b/tools/rockstar-launcher/src/lib.rs @@ -0,0 +1,351 @@ +use std::io::{self, Read, Write}; + +#[cfg(windows)] +pub mod pipe; + +pub mod identity; +pub mod sdk; + +pub const MAX_FRAME_BYTES: usize = 64 * 1024; +const OVERHEAD: usize = 4 + 4 + 1; + +pub fn wait_for_game( + child: &mut std::process::Child, + handshake: std::sync::mpsc::Receiver>, +) -> io::Result { + use std::sync::mpsc::RecvTimeoutError; + loop { + match handshake.recv_timeout(std::time::Duration::from_millis(10)) { + Ok(Ok(())) => return child.wait(), + result @ (Ok(Err(_)) | Err(RecvTimeoutError::Disconnected)) => { + let error = match result { + Ok(Err(error)) => error, + _ => io::Error::new( + io::ErrorKind::BrokenPipe, + "Rockstar handshake worker stopped", + ), + }; + let _ = child.kill(); + child.wait()?; + return Err(error); + } + Err(RecvTimeoutError::Timeout) => { + if let Some(status) = child.try_wait()? { + return Ok(status); + } + } + } + } +} + +#[derive(Clone, Copy)] +pub enum Length { + Total, + Body, +} + +impl Length { + fn header_bytes(self) -> usize { + match self { + Self::Total => 0, + Self::Body => 4, + } + } +} + +#[derive(Debug, PartialEq, Eq)] +pub struct Frame { + pub tag: [u8; 4], + pub payload: Vec, + pub nul_terminated: bool, +} + +fn invalid(message: &'static str) -> io::Error { + io::Error::new(io::ErrorKind::InvalidData, message) +} + +impl Frame { + pub fn read(reader: &mut impl Read, length: Length) -> io::Result { + let mut header = [0; 4]; + reader.read_exact(&mut header)?; + let size = (u32::from_le_bytes(header) as usize) + .checked_add(length.header_bytes()) + .ok_or_else(|| invalid("invalid Rockstar pipe frame length"))?; + if !(OVERHEAD..=MAX_FRAME_BYTES).contains(&size) { + return Err(invalid("invalid Rockstar pipe frame length")); + } + let mut body = vec![0; size - header.len()]; + reader.read_exact(&mut body)?; + let nul_terminated = body.last() == Some(&0); + let end = body.len() - usize::from(nul_terminated); + if body[4] != b':' || body[..4].contains(&b':') || body[..end].contains(&0) { + return Err(invalid("invalid Rockstar pipe frame envelope")); + } + Ok(Self { + tag: body[..4].try_into().unwrap(), + payload: body[5..end].to_vec(), + nul_terminated, + }) + } + + pub fn write(&self, writer: &mut impl Write, length: Length) -> io::Result<()> { + let size = self + .payload + .len() + .checked_add(OVERHEAD + usize::from(self.nul_terminated)) + .filter(|size| *size <= MAX_FRAME_BYTES) + .ok_or_else(|| invalid("Rockstar pipe frame exceeds size limit"))?; + if self.tag.contains(&0) || self.tag.contains(&b':') || self.payload.contains(&0) { + return Err(invalid("Rockstar pipe frame contains a delimiter")); + } + let mut encoded = Vec::with_capacity(size); + encoded.extend_from_slice(&((size - length.header_bytes()) as u32).to_le_bytes()); + encoded.extend_from_slice(&self.tag); + encoded.push(b':'); + encoded.extend_from_slice(&self.payload); + if self.nul_terminated { + encoded.push(0); + } + writer.write_all(&encoded)?; + writer.flush() + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn launcher_era_reply_uses_total_length_and_a_terminator() { + let mut bytes = Vec::new(); + Frame { + tag: *b"DUNN", + payload: vec![b'A'; 640], + nul_terminated: true, + } + .write(&mut bytes, Length::Total) + .unwrap(); + assert_eq!(bytes.len(), 650); + assert_eq!(&bytes[..9], &[138, 2, 0, 0, b'D', b'U', b'N', b'N', b':']); + assert_eq!(bytes[649], 0); + } + use std::io::Cursor; + + #[test] + #[ignore] + fn sleeping_game() { + std::thread::sleep(std::time::Duration::from_secs(30)); + } + + fn sleeping_child() -> std::process::Child { + std::process::Command::new(std::env::current_exe().unwrap()) + .args(["--exact", "tests::sleeping_game", "--ignored"]) + .stdout(std::process::Stdio::null()) + .stderr(std::process::Stdio::null()) + .spawn() + .unwrap() + } + + #[test] + fn failed_handshake_terminates_and_reaps_the_game() { + let mut child = sleeping_child(); + let (sender, receiver) = std::sync::mpsc::channel(); + sender + .send(Err(io::Error::new(io::ErrorKind::TimedOut, "test timeout"))) + .unwrap(); + let start = std::time::Instant::now(); + assert_eq!( + wait_for_game(&mut child, receiver).unwrap_err().kind(), + io::ErrorKind::TimedOut + ); + assert!(start.elapsed() < std::time::Duration::from_secs(3)); + assert!(child.try_wait().unwrap().is_some()); + } + + #[test] + fn stopped_handshake_worker_terminates_and_reaps_the_game() { + let mut child = sleeping_child(); + let (sender, receiver) = std::sync::mpsc::channel(); + drop(sender); + assert_eq!( + wait_for_game(&mut child, receiver).unwrap_err().kind(), + io::ErrorKind::BrokenPipe + ); + assert!(child.try_wait().unwrap().is_some()); + } + + #[test] + fn an_exited_game_does_not_wait_for_its_handshake() { + let mut child = std::process::Command::new(std::env::current_exe().unwrap()) + .args(["--exact", "no_test_with_this_name"]) + .stdout(std::process::Stdio::null()) + .stderr(std::process::Stdio::null()) + .spawn() + .unwrap(); + let (_sender, receiver) = std::sync::mpsc::channel(); + assert!(wait_for_game(&mut child, receiver).unwrap().success()); + } + + struct Fragmented(T); + + impl Read for Fragmented { + fn read(&mut self, buffer: &mut [u8]) -> io::Result { + let size = buffer.len().min(1); + self.0.read(&mut buffer[..size]) + } + } + + impl Write for Fragmented { + fn write(&mut self, buffer: &[u8]) -> io::Result { + self.0.write(&buffer[..buffer.len().min(1)]) + } + + fn flush(&mut self) -> io::Result<()> { + self.0.flush() + } + } + + #[test] + fn reads_observed_greeting_across_partial_reads() { + let bytes = b"\x0a\0\0\0COLE:\0"; + assert_eq!( + Frame::read(&mut Fragmented(&bytes[..]), Length::Total).unwrap(), + Frame { + tag: *b"COLE", + payload: Vec::new(), + nul_terminated: true, + } + ); + } + + #[test] + fn writes_the_observed_total_length_even_with_partial_writes() { + let mut bytes = Fragmented(Vec::new()); + Frame { + tag: *b"COLE", + payload: Vec::new(), + nul_terminated: true, + } + .write(&mut bytes, Length::Total) + .unwrap(); + assert_eq!(bytes.0, b"\x0a\0\0\0COLE:\0"); + } + + #[test] + fn keeps_colons_in_payload_and_leaves_the_next_frame_unread() { + let frame = Frame { + tag: *b"DUNN", + payload: b"one:two".to_vec(), + nul_terminated: false, + }; + let mut bytes = Vec::new(); + frame.write(&mut bytes, Length::Total).unwrap(); + bytes.extend_from_slice(b"\x0a\0\0\0COLE:\0"); + let mut reader = Cursor::new(bytes); + assert_eq!(Frame::read(&mut reader, Length::Total).unwrap(), frame); + assert_eq!( + Frame::read(&mut reader, Length::Total).unwrap().tag, + *b"COLE" + ); + } + + #[test] + fn rejects_invalid_lengths_before_reading_a_body() { + for size in [0u32, 4, 8, MAX_FRAME_BYTES as u32 + 1, u32::MAX] { + let mut reader = Cursor::new(size.to_le_bytes()); + assert_eq!( + Frame::read(&mut reader, Length::Total).unwrap_err().kind(), + io::ErrorKind::InvalidData + ); + assert_eq!(reader.position(), 4); + } + } + + #[test] + fn rejects_truncated_or_malformed_frames() { + for bytes in [&b"\x0a\0\0"[..], &b"\x0a\0\0\0COLE:"[..]] { + assert_eq!( + Frame::read(&mut &bytes[..], Length::Total) + .unwrap_err() + .kind(), + io::ErrorKind::UnexpectedEof + ); + } + for bytes in [ + b"\x0a\0\0\0COLE=\0", + b"\x0a\0\0\0CO:E:x", + b"\x0a\0\0\0CO\0E:\0", + ] { + assert_eq!( + Frame::read(&mut &bytes[..], Length::Total) + .unwrap_err() + .kind(), + io::ErrorKind::InvalidData + ); + } + } + + #[test] + fn rejects_invalid_output_before_writing_any_bytes() { + let mut bytes = Vec::new(); + for frame in [ + Frame { + tag: *b"DUNN", + payload: vec![b'x'; MAX_FRAME_BYTES], + nul_terminated: false, + }, + Frame { + tag: *b"DUNN", + payload: b"one\0two".to_vec(), + nul_terminated: false, + }, + Frame { + tag: *b"CO:E", + payload: Vec::new(), + nul_terminated: false, + }, + ] { + assert!(frame.write(&mut bytes, Length::Total).is_err()); + assert!(bytes.is_empty()); + } + } + + #[test] + fn accepts_the_observed_unterminated_launch_reply_shape() { + let payload = vec![b'A'; 640]; + let mut bytes = 645u32.to_le_bytes().to_vec(); + bytes.extend_from_slice(b"DUNN:"); + bytes.extend_from_slice(&payload); + let frame = Frame::read(&mut Fragmented(&bytes[..]), Length::Body).unwrap(); + assert_eq!(bytes.len(), 649); + assert_eq!(frame.tag, *b"DUNN"); + assert_eq!(frame.payload, payload); + assert!(!frame.nul_terminated); + let mut encoded = Vec::new(); + frame.write(&mut encoded, Length::Body).unwrap(); + assert_eq!(encoded, bytes); + } + + #[test] + fn presents_a_complete_reply_to_the_pipe_in_one_write() { + struct Writes(Vec); + impl Write for Writes { + fn write(&mut self, bytes: &[u8]) -> io::Result { + self.0.push(bytes.len()); + Ok(bytes.len()) + } + fn flush(&mut self) -> io::Result<()> { + Ok(()) + } + } + let mut writer = Writes(Vec::new()); + Frame { + tag: *b"DUNN", + payload: vec![b'A'; 640], + nul_terminated: false, + } + .write(&mut writer, Length::Body) + .unwrap(); + assert_eq!(writer.0, vec![649]); + } +} diff --git a/tools/rockstar-launcher/src/main.rs b/tools/rockstar-launcher/src/main.rs new file mode 100644 index 0000000000..0913c6d548 --- /dev/null +++ b/tools/rockstar-launcher/src/main.rs @@ -0,0 +1,275 @@ +#![cfg_attr(windows, windows_subsystem = "windows")] + +#[cfg(windows)] +fn log(message: &str) { + use std::io::Write; + let Ok(exe) = std::env::current_exe() else { + return; + }; + let path = exe.with_file_name("launcher.log"); + if let Ok(metadata) = std::fs::symlink_metadata(&path) { + if !metadata.is_file() || metadata.len() > 65536 { + return; + } + } + if let Ok(mut file) = std::fs::OpenOptions::new() + .create(true) + .append(true) + .open(path) + { + let _ = writeln!(file, "{message}"); + } +} + +#[cfg(windows)] +fn run() -> Result> { + use droiddeck_rockstar_launcher::{ + pipe::Listener, + sdk::{Message, Session}, + wait_for_game, Frame, Length, + }; + use std::io::{Read, Write}; + use std::time::{Duration, SystemTime, UNIX_EPOCH}; + + let config_path = std::env::current_exe()?.with_file_name("launch.json"); + let mut data = Vec::new(); + std::fs::File::open(&config_path)? + .take(65537) + .read_to_end(&mut data)?; + std::fs::remove_file(&config_path)?; + if data.len() > 65536 { + return Err("launch handoff exceeds size limit".into()); + } + let config: serde_json::Value = serde_json::from_slice(&data)?; + let text = |key| { + config + .get(key) + .and_then(|value| value.as_str()) + .ok_or("missing launch field") + }; + let expires = config + .get("expiresAt") + .and_then(|value| value.as_u64()) + .ok_or("missing launch expiry")?; + let now = SystemTime::now().duration_since(UNIX_EPOCH)?.as_millis() as u64; + if expires <= now || expires - now > 120_000 { + return Err("launch handoff expired".into()); + } + let legacy = if config.get("pipe").is_some() { + let pipe_name = text("pipe")?.to_owned(); + if !matches!( + pipe_name.as_str(), + "GTA3_Pipe" | "GTA-VC_Pipe" | "GTA_SA_Pipe" | "GTAIV_Pipe" | "LANOIRE_Pipe" + ) { + return Err("invalid Rockstar launch pipe".into()); + } + let material = text("material")?.as_bytes().to_vec(); + if material.len() != 640 || !material.iter().all(u8::is_ascii_hexdigit) { + return Err("invalid launch material".into()); + } + Some((pipe_name, material)) + } else { + None + }; + let session = config + .get("session") + .map(|value| -> Result> { + let account = value + .get("accountId") + .and_then(|v| v.as_str()) + .ok_or("missing SDK account")? + .parse::()?; + let identity = value + .get("identity") + .and_then(|v| v.as_str()) + .ok_or("missing SDK identity")?; + let ticket = value + .get("ticket") + .and_then(|v| v.as_str()) + .ok_or("missing SDK ticket")?; + let session = Session::new(account, identity.to_owned(), ticket.to_owned())?; + Ok(if let Some(title) = value.get("titleId") { + session.with_title(title.as_str().ok_or("invalid SDK title")?.to_owned())? + } else { + session + }) + }) + .transpose()?; + if legacy.is_none() && session.is_none() { + return Err("missing launch protocol".into()); + } + let root = std::fs::canonicalize(text("folder")?)?; + let exe = std::fs::canonicalize(text("exe")?)?; + let workdir = std::fs::canonicalize(text("workdir")?)?; + if !exe.is_file() + || !exe.starts_with(&root) + || !workdir.starts_with(&root) + || legacy.is_some() + && !root.join("MTLX.dll").is_file() + && !exe.parent().unwrap_or(&root).join("MTLX.dll").is_file() + { + return Err("invalid Rockstar game path".into()); + } + if let Some(index) = + std::env::args().position(|arg| arg.eq_ignore_ascii_case("-launchTitleInFolder")) + { + let folder = std::env::args() + .nth(index + 1) + .ok_or("missing game folder")?; + if std::fs::canonicalize(folder)? != root { + return Err("Rockstar launch folder mismatch".into()); + } + } + let args = config + .get("args") + .and_then(|value| value.as_array()) + .ok_or("missing game arguments")?; + let args: Result, _> = args + .iter() + .map(|value| value.as_str().ok_or("invalid game argument")) + .collect(); + log("launch handoff accepted"); + let legacy = legacy + .map(|(name, material)| { + let terminated = matches!(name.as_str(), "GTAIV_Pipe" | "LANOIRE_Pipe"); + Listener::new(&name, Duration::from_secs(90)) + .map(|listener| (listener, material, terminated)) + }) + .transpose()?; + let instance = std::process::id(); + let sdk_listener = if session.is_some() { + Some(Listener::new( + &format!("chrome.rgsc_gameinst_{instance}"), + Duration::from_secs(90), + )?) + } else { + None + }; + let mut identity_listeners = Vec::new(); + if session.is_some() { + for name in + droiddeck_rockstar_launcher::identity::pipe_names(&mut std::fs::File::open(&exe)?)? + { + identity_listeners.push(Listener::new(&name, Duration::from_secs(90))?); + } + } + log("launcher pipes created"); + let mut command = std::process::Command::new(exe); + command.current_dir(workdir).args(args?); + if session.is_some() { + command.arg(format!("-processInstance={instance}")); + } + let mut child = command.spawn()?; + let pid = child.id(); + log("game process started"); + for listener in identity_listeners { + std::thread::spawn(move || { + let serve = || -> std::io::Result<()> { + let mut pipe = listener.accept()?.with_deadline(Duration::from_secs(90)); + if pipe.client_pid()? != pid { + return Err(std::io::Error::new( + std::io::ErrorKind::PermissionDenied, + "unexpected launcher identity client", + )); + } + let reply = droiddeck_rockstar_launcher::identity::exchange(&mut pipe)?; + pipe.write_all(&reply)?; + log("launcher identity challenge complete"); + pipe = pipe.with_timeout(Duration::from_secs(86400)); + let mut progress = [0; 4096]; + while matches!(pipe.read(&mut progress), Ok(size) if size > 0) {} + Ok(()) + }; + if let Err(error) = serve() { + log(&format!("launcher identity exchange ended: {error}")); + } + }); + } + let (result, handshake) = std::sync::mpsc::sync_channel(1); + std::thread::spawn(move || { + let serve = || -> std::io::Result<()> { + if let Some((listener, material, terminated)) = legacy { + let mut pipe = listener.accept()?; + log("legacy launcher pipe connected"); + if pipe.client_pid()? != pid { + return Err(std::io::Error::new( + std::io::ErrorKind::PermissionDenied, + "unexpected Rockstar pipe client", + )); + } + let request = Frame::read(&mut pipe, Length::Total)?; + if request.tag != *b"COLE" || !request.payload.is_empty() { + return Err(std::io::Error::new( + std::io::ErrorKind::InvalidData, + "unexpected Rockstar greeting", + )); + } + Frame { + tag: *b"DUNN", + payload: material, + nul_terminated: terminated, + } + .write( + &mut pipe, + if terminated { + Length::Total + } else { + Length::Body + }, + )?; + log("legacy launcher handshake complete"); + } + if let (Some(listener), Some(session)) = (sdk_listener, session) { + let mut pipe = listener.accept()?.with_deadline(Duration::from_secs(90)); + if pipe.client_pid()? != pid { + return Err(std::io::Error::new( + std::io::ErrorKind::PermissionDenied, + "unexpected Rockstar SDK client", + )); + } + Message::hello(instance).write(&mut pipe)?; + let mut authenticated = false; + loop { + let request = match Message::read(&mut pipe) { + Ok(request) => request, + Err(_) if authenticated => return Ok(()), + Err(error) => return Err(error), + }; + let responses = session.respond(&request)?; + let sends_login = request.kind == 0x40000; + for response in responses { + response.write(&mut pipe)?; + } + if sends_login && !authenticated { + authenticated = true; + pipe = pipe.with_timeout(Duration::from_secs(86400)); + log("SDK login sent"); + let _ = result.send(Ok(())); + } + } + } + Ok(()) + }; + let outcome = serve(); + if let Err(error) = &outcome { + log(&format!("launcher handshake failed: {error}")); + } + let _ = result.send(outcome); + }); + Ok(wait_for_game(&mut child, handshake)?.code().unwrap_or(1)) +} + +fn main() { + #[cfg(windows)] + let code = match run() { + Ok(code) => code, + Err(error) => { + log(&format!("launch failed: {error}")); + eprintln!("Rockstar launch failed: {error}"); + 1 + } + }; + #[cfg(not(windows))] + let code = 1; + std::process::exit(code); +} diff --git a/tools/rockstar-launcher/src/pipe.rs b/tools/rockstar-launcher/src/pipe.rs new file mode 100644 index 0000000000..9bffedde38 --- /dev/null +++ b/tools/rockstar-launcher/src/pipe.rs @@ -0,0 +1,450 @@ +use std::ffi::c_void; +use std::io::{self, Read, Write}; +use std::os::windows::ffi::OsStrExt; +use std::ptr::{null, null_mut}; +use std::time::{Duration, Instant}; + +type Handle = *mut c_void; +const INVALID_HANDLE: Handle = -1isize as Handle; +const ERROR_IO_PENDING: i32 = 997; +const ERROR_MORE_DATA: i32 = 234; + +#[repr(C)] +struct Overlapped { + internal: usize, + internal_high: usize, + offset: u32, + offset_high: u32, + event: Handle, +} + +#[link(name = "kernel32")] +extern "system" { + fn CreateNamedPipeW( + name: *const u16, + open: u32, + mode: u32, + max: u32, + output: u32, + input: u32, + timeout: u32, + security: *const c_void, + ) -> Handle; + fn ConnectNamedPipe(handle: Handle, overlapped: *mut Overlapped) -> i32; + fn GetNamedPipeClientProcessId(handle: Handle, pid: *mut u32) -> i32; + fn CreateFileW( + name: *const u16, + access: u32, + share: u32, + security: *const c_void, + creation: u32, + flags: u32, + template: Handle, + ) -> Handle; + fn WaitNamedPipeW(name: *const u16, timeout: u32) -> i32; + fn CreateEventW(security: *const c_void, manual: i32, initial: i32, name: *const u16) + -> Handle; + fn CloseHandle(handle: Handle) -> i32; + fn ReadFile( + handle: Handle, + buffer: *mut u8, + size: u32, + read: *mut u32, + overlapped: *mut Overlapped, + ) -> i32; + fn WriteFile( + handle: Handle, + buffer: *const u8, + size: u32, + written: *mut u32, + overlapped: *mut Overlapped, + ) -> i32; + fn WaitForSingleObject(handle: Handle, timeout: u32) -> u32; + fn CancelIoEx(handle: Handle, overlapped: *mut Overlapped) -> i32; + fn GetOverlappedResult( + handle: Handle, + overlapped: *mut Overlapped, + transferred: *mut u32, + wait: i32, + ) -> i32; +} + +struct OwnedHandle(Handle); + +unsafe impl Send for OwnedHandle {} + +impl Drop for OwnedHandle { + fn drop(&mut self) { + unsafe { + CloseHandle(self.0); + } + } +} + +pub struct Pipe { + handle: OwnedHandle, + timeout: Duration, + deadline: Option, +} + +pub struct Listener(Pipe); + +impl Listener { + pub fn new(name: &str, timeout: Duration) -> io::Result { + if name.is_empty() || name.contains(['\\', '/', '\0']) { + return Err(io::Error::new( + io::ErrorKind::InvalidInput, + "invalid pipe name", + )); + } + let path = format!(r"\\.\pipe\{name}"); + let wide: Vec<_> = std::ffi::OsStr::new(&path) + .encode_wide() + .chain(Some(0)) + .collect(); + let handle = unsafe { + CreateNamedPipeW( + wide.as_ptr(), + 3 | 0x4000_0000 | 0x0008_0000, + 8, + 1, + 65536, + 65536, + 0, + null(), + ) + }; + if handle == INVALID_HANDLE { + return Err(io::Error::last_os_error()); + } + Ok(Self(Pipe { + handle: OwnedHandle(handle), + timeout, + deadline: None, + })) + } + + pub fn accept(self) -> io::Result { + let event = unsafe { CreateEventW(null(), 1, 0, null()) }; + if event.is_null() { + return Err(io::Error::last_os_error()); + } + let event = OwnedHandle(event); + let mut overlapped = Overlapped { + internal: 0, + internal_high: 0, + offset: 0, + offset_high: 0, + event: event.0, + }; + if unsafe { ConnectNamedPipe(self.0.handle.0, &mut overlapped) } != 0 { + return Ok(self.0); + } + let error = io::Error::last_os_error(); + if error.raw_os_error() == Some(535) { + return Ok(self.0); + } + if error.raw_os_error() != Some(ERROR_IO_PENDING) { + return Err(error); + } + let wait = unsafe { + WaitForSingleObject( + event.0, + self.0.timeout.as_millis().min(u32::MAX as u128 - 1) as u32, + ) + }; + let mut transferred = 0; + if wait != 0 { + let error = if wait == 258 { + io::Error::new(io::ErrorKind::TimedOut, "waiting for Rockstar game") + } else { + io::Error::last_os_error() + }; + unsafe { + CancelIoEx(self.0.handle.0, &mut overlapped); + GetOverlappedResult(self.0.handle.0, &mut overlapped, &mut transferred, 1); + } + return Err(error); + } + if unsafe { GetOverlappedResult(self.0.handle.0, &mut overlapped, &mut transferred, 0) } + == 0 + { + return Err(io::Error::last_os_error()); + } + Ok(self.0) + } +} + +impl Pipe { + pub fn with_timeout(mut self, timeout: Duration) -> Self { + self.timeout = timeout; + self.deadline = None; + self + } + + pub fn with_deadline(mut self, timeout: Duration) -> Self { + self.timeout = timeout; + self.deadline = Some(Instant::now() + timeout); + self + } + + pub fn client_pid(&self) -> io::Result { + let mut pid = 0; + if unsafe { GetNamedPipeClientProcessId(self.handle.0, &mut pid) } == 0 || pid == 0 { + return Err(io::Error::last_os_error()); + } + Ok(pid) + } + pub fn connect(name: &str, timeout: Duration) -> io::Result { + if name.is_empty() || name.contains(['\\', '/', '\0']) { + return Err(io::Error::new( + io::ErrorKind::InvalidInput, + "invalid pipe name", + )); + } + let path = format!(r"\\.\pipe\{name}"); + let wide: Vec<_> = std::ffi::OsStr::new(&path) + .encode_wide() + .chain(Some(0)) + .collect(); + let deadline = Instant::now() + timeout; + loop { + let handle = unsafe { + CreateFileW( + wide.as_ptr(), + 0xc000_0000, + 0, + null(), + 3, + 0x4000_0000, + null_mut(), + ) + }; + if handle != INVALID_HANDLE { + return Ok(Self { + handle: OwnedHandle(handle), + timeout, + deadline: None, + }); + } + let error = io::Error::last_os_error(); + if !matches!(error.raw_os_error(), Some(2 | 231)) { + return Err(error); + } + let remaining = deadline.saturating_duration_since(Instant::now()); + if remaining.is_zero() { + return Err(io::Error::new( + io::ErrorKind::TimedOut, + "waiting for Rockstar pipe", + )); + } + unsafe { + WaitNamedPipeW(wide.as_ptr(), remaining.as_millis().min(50) as u32); + } + std::thread::sleep(remaining.min(Duration::from_millis(2))); + } + } + + fn transfer(&self, buffer: *mut u8, size: usize, writing: bool) -> io::Result { + if size == 0 { + return Ok(0); + } + let timeout = self + .deadline + .map(|deadline| deadline.saturating_duration_since(Instant::now())) + .unwrap_or(self.timeout); + if timeout.is_zero() { + return Err(io::Error::new( + io::ErrorKind::TimedOut, + "Rockstar pipe deadline exceeded", + )); + } + let event = unsafe { CreateEventW(null(), 1, 0, null()) }; + if event.is_null() { + return Err(io::Error::last_os_error()); + } + let event = OwnedHandle(event); + let mut overlapped = Overlapped { + internal: 0, + internal_high: 0, + offset: 0, + offset_high: 0, + event: event.0, + }; + let mut transferred = 0; + let size = size.min(u32::MAX as usize) as u32; + let ok = unsafe { + if writing { + WriteFile( + self.handle.0, + buffer, + size, + &mut transferred, + &mut overlapped, + ) + } else { + ReadFile( + self.handle.0, + buffer, + size, + &mut transferred, + &mut overlapped, + ) + } + }; + if ok != 0 { + return Ok(transferred as usize); + } + let error = io::Error::last_os_error(); + if error.raw_os_error() == Some(ERROR_MORE_DATA) && !writing && transferred > 0 { + return Ok(transferred as usize); + } + if error.raw_os_error() != Some(ERROR_IO_PENDING) { + return Err(error); + } + let wait = unsafe { + WaitForSingleObject( + event.0, + timeout.as_millis().min(u32::MAX as u128 - 1) as u32, + ) + }; + if wait != 0 { + let error = if wait == 258 { + io::Error::new(io::ErrorKind::TimedOut, "Rockstar pipe operation timed out") + } else { + io::Error::last_os_error() + }; + unsafe { + CancelIoEx(self.handle.0, &mut overlapped); + GetOverlappedResult(self.handle.0, &mut overlapped, &mut transferred, 1); + } + return Err(error); + } + let ok = + unsafe { GetOverlappedResult(self.handle.0, &mut overlapped, &mut transferred, 0) }; + if ok != 0 { + return Ok(transferred as usize); + } + let error = io::Error::last_os_error(); + if error.raw_os_error() == Some(ERROR_MORE_DATA) && !writing && transferred > 0 { + return Ok(transferred as usize); + } + Err(error) + } +} + +impl Read for Pipe { + fn read(&mut self, buffer: &mut [u8]) -> io::Result { + self.transfer(buffer.as_mut_ptr(), buffer.len(), false) + } +} + +impl Write for Pipe { + fn write(&mut self, buffer: &[u8]) -> io::Result { + self.transfer(buffer.as_ptr() as *mut u8, buffer.len(), true) + } + + fn flush(&mut self) -> io::Result<()> { + Ok(()) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::{Frame, Length}; + use std::sync::mpsc; + use std::time::{SystemTime, UNIX_EPOCH}; + + fn name() -> String { + format!( + "dd-rockstar-test-{}-{}", + std::process::id(), + SystemTime::now() + .duration_since(UNIX_EPOCH) + .unwrap() + .as_nanos() + ) + } + + #[test] + fn initialization_deadline_survives_partial_reads() { + let name = name(); + let listener = Listener::new(&name, Duration::from_secs(2)).unwrap(); + let worker = std::thread::spawn(move || { + let mut server = listener + .accept() + .unwrap() + .with_deadline(Duration::from_millis(150)); + let mut byte = [0]; + server.read_exact(&mut byte).unwrap(); + std::thread::sleep(Duration::from_millis(180)); + assert_eq!( + server.read(&mut byte).unwrap_err().kind(), + io::ErrorKind::TimedOut + ); + }); + let mut client = Pipe::connect(&name, Duration::from_secs(2)).unwrap(); + client.write_all(&[1]).unwrap(); + worker.join().unwrap(); + } + + #[test] + fn real_pipe_exchanges_both_framing_modes_and_identifies_the_client() { + let name = name(); + let listener = Listener::new(&name, Duration::from_secs(2)).unwrap(); + let worker = std::thread::spawn(move || { + let mut server = listener.accept().unwrap(); + assert_eq!(server.client_pid().unwrap(), std::process::id()); + assert_eq!( + Frame::read(&mut server, Length::Total).unwrap().tag, + *b"COLE" + ); + Frame { + tag: *b"DUNN", + payload: vec![b'A'; 640], + nul_terminated: false, + } + .write(&mut server, Length::Body) + .unwrap(); + }); + let mut client = Pipe::connect(&name, Duration::from_secs(2)).unwrap(); + Frame { + tag: *b"COLE", + payload: Vec::new(), + nul_terminated: true, + } + .write(&mut client, Length::Total) + .unwrap(); + let response = Frame::read(&mut client, Length::Body).unwrap(); + assert_eq!(response.payload.len(), 640); + assert!(!response.nul_terminated); + worker.join().unwrap(); + } + + #[test] + fn timed_out_accept_releases_the_first_pipe_instance() { + let name = name(); + let listener = Listener::new(&name, Duration::from_millis(20)).unwrap(); + assert!(matches!(listener.accept(), Err(error) if error.kind() == io::ErrorKind::TimedOut)); + assert!(Listener::new(&name, Duration::from_millis(20)).is_ok()); + } + + #[test] + fn timed_out_read_cancels_the_pending_operation() { + let name = name(); + let listener = Listener::new(&name, Duration::from_secs(2)).unwrap(); + let (done, wait) = mpsc::channel(); + let worker = std::thread::spawn(move || { + let _server = listener.accept().unwrap(); + wait.recv_timeout(Duration::from_secs(2)).unwrap(); + }); + let mut client = Pipe::connect(&name, Duration::from_millis(30)).unwrap(); + assert_eq!( + client.read(&mut [0u8; 4]).unwrap_err().kind(), + io::ErrorKind::TimedOut + ); + done.send(()).unwrap(); + worker.join().unwrap(); + } +} diff --git a/tools/rockstar-launcher/src/sdk.rs b/tools/rockstar-launcher/src/sdk.rs new file mode 100644 index 0000000000..9361ad54c2 --- /dev/null +++ b/tools/rockstar-launcher/src/sdk.rs @@ -0,0 +1,328 @@ +use std::io::{self, Read, Write}; + +const HEADER: usize = 16; +const MAX_BYTES: usize = 64 * 1024; +const CONTROL: i32 = i32::MAX; + +#[derive(PartialEq, Eq)] +pub struct Message { + pub routing: i32, + pub kind: u32, + pub flags: u32, + pub payload: Vec, +} + +impl std::fmt::Debug for Message { + fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .debug_struct("Message") + .field("routing", &self.routing) + .field("kind", &self.kind) + .field("flags", &self.flags) + .field("payload_bytes", &self.payload.len()) + .finish() + } +} + +fn invalid() -> io::Error { + io::Error::new(io::ErrorKind::InvalidData, "invalid Rockstar SDK message") +} + +impl Message { + pub fn read(reader: &mut impl Read) -> io::Result { + let mut header = [0; HEADER]; + reader.read_exact(&mut header)?; + let size = u32::from_le_bytes(header[..4].try_into().unwrap()) as usize; + if size > MAX_BYTES - HEADER { + return Err(invalid()); + } + let mut payload = vec![0; size]; + reader.read_exact(&mut payload)?; + Ok(Self { + routing: i32::from_le_bytes(header[4..8].try_into().unwrap()), + kind: u32::from_le_bytes(header[8..12].try_into().unwrap()), + flags: u32::from_le_bytes(header[12..16].try_into().unwrap()), + payload, + }) + } + + pub fn write(&self, writer: &mut impl Write) -> io::Result<()> { + if self.payload.len() > MAX_BYTES - HEADER { + return Err(invalid()); + } + let mut bytes = Vec::with_capacity(HEADER + self.payload.len()); + bytes.extend_from_slice(&(self.payload.len() as u32).to_le_bytes()); + bytes.extend_from_slice(&self.routing.to_le_bytes()); + bytes.extend_from_slice(&self.kind.to_le_bytes()); + bytes.extend_from_slice(&self.flags.to_le_bytes()); + bytes.extend_from_slice(&self.payload); + writer.write_all(&bytes) + } + + fn control(kind: u32, payload: Payload) -> Self { + Self { + routing: CONTROL, + kind, + flags: 2, + payload: payload.0, + } + } + + pub fn hello(pid: u32) -> Self { + Self { + routing: -2, + kind: 0xffff, + flags: 2, + payload: pid.to_le_bytes().to_vec(), + } + } +} + +#[derive(Default)] +struct Payload(Vec); + +impl Payload { + fn raw(mut self, bytes: &[u8]) -> Self { + self.0.resize((self.0.len() + 3) & !3, 0); + self.0.extend_from_slice(bytes); + self + } + + fn u32(self, value: u32) -> Self { + self.raw(&value.to_le_bytes()) + } + fn u64(self, value: u64) -> Self { + self.raw(&value.to_le_bytes()) + } + fn string(self, value: &str) -> Self { + self.u32(value.len() as u32).raw(value.as_bytes()) + } +} + +pub struct Session { + account: u64, + identity: String, + ticket: String, + title: Option, + api: std::cell::Cell, +} + +impl Session { + pub fn new(account: u64, identity: String, ticket: String) -> io::Result { + if account == 0 + || identity.is_empty() + || identity.len() > 512 + || ticket.is_empty() + || ticket.len() > 48 * 1024 + || identity.contains('\0') + || ticket.contains('\0') + { + return Err(invalid()); + } + Ok(Self { + account, + identity, + ticket, + title: None, + api: std::cell::Cell::new(3), + }) + } + + pub fn with_title(mut self, title: String) -> io::Result { + if title.is_empty() + || title.len() > 64 + || !title.as_bytes()[0].is_ascii_lowercase() + || !title + .bytes() + .all(|value| value.is_ascii_lowercase() || value.is_ascii_digit() || value == b'_') + { + return Err(invalid()); + } + self.title = Some(title); + Ok(self) + } + + fn app_sync(&self, challenge: u64) -> io::Result { + let mut payload = Payload::default().u32(u32::from(self.title.is_some())); + if let Some(title) = &self.title { + payload = payload + .u64(u64::MAX) + .u64(0) + .u64(0) + .string(title) + .u32(1) + .u32(1) + .string(""); + } + let mut inner = Vec::new(); + Message::control(0x80006, payload).write(&mut inner)?; + Ok(Message::control( + 0x80002, + Payload::default().u64(challenge).string(&base64(&inner)), + )) + } + + pub fn login(&self) -> Vec { + let offset = u32::from(self.api.get() >= 4); + vec![ + Message::control( + 0x30001 + offset, + Payload::default().u32(3).u64(self.account).u32(0), + ), + Message::control( + 0x30002 + offset, + Payload::default() + .u64(self.account) + .u32(0) + .string(&self.identity), + ), + Message::control( + 0x30003 + offset, + Payload::default() + .string(&self.identity) + .string(&self.ticket), + ), + ] + } + + pub fn respond(&self, message: &Message) -> io::Result> { + match message.kind { + 0x80000 => { + if message.payload.len() != 8 { + return Err(invalid()); + } + let challenge = u64::from_le_bytes(message.payload[..8].try_into().unwrap()); + Ok(vec![self.app_sync(challenge)?]) + } + 0x40000 => { + if message.payload.len() < 4 { + return Err(invalid()); + } + let context = u32::from_le_bytes(message.payload[..4].try_into().unwrap()); + self.api.set(context); + let mut result = self.login(); + result.push(Message::control(0x30000, Payload::default().u32(context))); + Ok(result) + } + 0x40005 | 0x40007 => Ok(vec![Message::control( + 0x30004 + u32::from(self.api.get() >= 4), + Payload::default(), + )]), + _ => Ok(Vec::new()), + } + } +} + +fn base64(bytes: &[u8]) -> String { + const ALPHABET: &[u8] = b"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + let mut output = String::with_capacity(bytes.len().div_ceil(3) * 4); + for part in bytes.chunks(3) { + let value = ((part[0] as u32) << 16) + | ((part.get(1).copied().unwrap_or(0) as u32) << 8) + | part.get(2).copied().unwrap_or(0) as u32; + output.push(ALPHABET[(value >> 18) as usize] as char); + output.push(ALPHABET[((value >> 12) & 63) as usize] as char); + output.push(if part.len() > 1 { + ALPHABET[((value >> 6) & 63) as usize] as char + } else { + '=' + }); + output.push(if part.len() > 2 { + ALPHABET[(value & 63) as usize] as char + } else { + '=' + }); + } + output +} + +#[cfg(test)] +mod tests { + use super::*; + use std::io::Cursor; + + #[test] + fn app_sync_echoes_challenge_without_inventing_owned_titles() { + let session = Session::new(123, "name".into(), "ticket".into()).unwrap(); + let request = Message::control(0x80000, Payload::default().u64(42)); + let response = session.respond(&request).unwrap().remove(0); + assert_eq!(response.kind, 0x80002); + assert_eq!(&response.payload[..8], &42u64.to_le_bytes()); + assert_eq!(&response.payload[12..], b"BAAAAP///38GAAgAAgAAAAAAAAA="); + assert_eq!(base64(b"f"), "Zg=="); + assert_eq!(base64(b"fo"), "Zm8="); + assert_eq!(base64(b"foo"), "Zm9v"); + assert!(session.with_title("../game".into()).is_err()); + } + + #[test] + fn transport_hello_matches_wire_layout() { + let mut bytes = Vec::new(); + Message::hello(0x1234).write(&mut bytes).unwrap(); + assert_eq!( + bytes, + [4, 0, 0, 0, 254, 255, 255, 255, 255, 255, 0, 0, 2, 0, 0, 0, 52, 18, 0, 0] + ); + } + + #[test] + fn login_preserves_string_lengths_and_alignment() { + let session = Session::new(0x1122334455667788, "a@b".into(), "ticket".into()).unwrap(); + let login = session.login(); + assert_eq!( + login[0].payload, + [3, 0, 0, 0, 136, 119, 102, 85, 68, 51, 34, 17, 0, 0, 0, 0] + ); + assert_eq!( + login[1].payload, + [136, 119, 102, 85, 68, 51, 34, 17, 0, 0, 0, 0, 3, 0, 0, 0, 97, 64, 98] + ); + assert_eq!( + login[2].payload, + [3, 0, 0, 0, 97, 64, 98, 0, 6, 0, 0, 0, 116, 105, 99, 107, 101, 116] + ); + } + + #[test] + fn init_sends_authenticated_state_before_launcher_hello() { + let session = Session::new(123, "name".into(), "ticket".into()).unwrap(); + for (api, expected) in [ + (3, [0x30001, 0x30002, 0x30003, 0x30000]), + (4, [0x30002, 0x30003, 0x30004, 0x30000]), + ] { + let request = Message::control(0x40000, Payload::default().u32(api)); + let result = session.respond(&request).unwrap(); + assert_eq!(result.iter().map(|m| m.kind).collect::>(), expected); + assert_eq!( + result[0].payload, + [3, 0, 0, 0, 123, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + ); + assert_eq!(result[3].payload, api.to_le_bytes()); + } + } + + #[test] + fn malformed_frames_and_sessions_are_rejected() { + assert!(Session::new(0, "name".into(), "ticket".into()).is_err()); + assert!(Session::new(123, "name".into(), "".into()).is_err()); + let session = Session::new(123, "name".into(), "ticket".into()).unwrap(); + assert!(session + .respond(&Message::control(0x40000, Payload::default())) + .is_err()); + assert!(Message::read(&mut Cursor::new(vec![255; 16])).is_err()); + assert!(Message::read(&mut Cursor::new(vec![0; 15])).is_err()); + } + + #[test] + fn concatenated_messages_remain_separate() { + let session = Session::new(123, "name".into(), "ticket".into()).unwrap(); + let mut bytes = Vec::new(); + for message in session.login() { + message.write(&mut bytes).unwrap(); + } + let mut reader = Cursor::new(bytes); + for message in session.login() { + assert_eq!(Message::read(&mut reader).unwrap(), message); + } + } +} diff --git a/tools/tests/test_battlenet.py b/tools/tests/test_battlenet.py index 5f3d72c1b6..2dbe844e72 100644 --- a/tools/tests/test_battlenet.py +++ b/tools/tests/test_battlenet.py @@ -198,6 +198,155 @@ class ConfigAndMenuTest(Temp): self.assertEqual(path.stat().st_mtime_ns, mtime) +class DriveTest(Temp): + def setUp(self): + super().setUp() + self.root = str(self.tmp / "Steam") + self.devices = Path(BNET["dosdevices"](self.root)) + self.card = self.tmp / "card" + self.library = self.card / "Games/Battle.net" + self.library.mkdir(parents=True) + self.running = [] + patcher = mock.patch.dict(BNET, {"say": lambda message: None, "wine_processes": lambda pfx, proc="/proc": list(self.running), + "volume_root": lambda path: str(self.card) if BNET["inside"](path, str(self.card)) else "/"}) + patcher.start() + self.addCleanup(patcher.stop) + + def test_a_volume_ends_where_the_device_changes(self): + devices = {"/": 1, "/mnt": 1, "/mnt/card": 7, "/mnt/card/Games": 7, "/mnt/card/Games/Battle.net": 7, "/root": 1, "/root/Games": 1} + with mock.patch.object(os, "stat", lambda path: mock.Mock(st_dev=devices[path])): + volume_root = runpy.run_path(str(BIN / "droiddeck-battlenet"))["volume_root"] + self.assertEqual(volume_root("/mnt/card/Games/Battle.net"), "/mnt/card") + self.assertEqual(volume_root("/mnt/card"), "/mnt/card") + self.assertEqual(volume_root("/root/Games"), "/") + self.assertEqual(volume_root("/"), "/") + + def test_a_library_on_the_root_volume_keeps_its_path_and_gets_no_drive(self): + library = self.tmp / "root/Games/Battle.net" + library.mkdir(parents=True) + self.assertEqual(BNET["install_path"](self.root, str(library) + "/"), "Z:" + str(library)) + self.assertFalse(self.devices.exists()) + + def test_a_library_on_another_volume_gets_a_drive_at_the_volume_root(self): + self.assertEqual(BNET["install_path"](self.root, str(self.library)), "D:\\Games\\Battle.net") + self.assertEqual(os.readlink(self.devices / "d:"), str(self.card)) + self.assertEqual(BNET["install_path"](self.root, str(self.library / "World of Warcraft")), "D:\\Games\\Battle.net\\World of Warcraft") + self.assertEqual(BNET["install_path"](self.root, str(self.card)), "D:\\") + self.assertEqual(sorted(os.listdir(self.devices)), ["d:"]) + + def test_drives_in_use_and_the_ones_proton_owns_are_left_alone(self): + self.devices.mkdir(parents=True) + os.symlink("/somewhere/else", self.devices / "d:") + os.symlink(str(self.card), self.devices / "s:") + self.assertEqual(BNET["install_path"](self.root, str(self.library)), "E:\\Games\\Battle.net") + self.assertEqual(os.readlink(self.devices / "d:"), "/somewhere/else") + for letter in BNET["DRIVES"]: + if not os.path.lexists(self.devices / (letter + ":")): + os.symlink("/somewhere/else", self.devices / (letter + ":")) + os.unlink(self.devices / "e:") + os.symlink("/somewhere/else", self.devices / "e:") + self.assertEqual(BNET["install_path"](self.root, str(self.library)), "Z:" + str(self.library)) + self.assertNotIn("s", BNET["DRIVES"]) + self.assertNotIn("t", BNET["DRIVES"]) + + def test_a_running_prefix_gets_no_new_drive_but_uses_the_ones_it_started_with(self): + self.running = [(5, ["C:\\Program Files (x86)\\Battle.net\\Battle.net.exe"])] + self.assertEqual(BNET["install_path"](self.root, str(self.library)), "Z:" + str(self.library)) + self.assertFalse(self.devices.exists()) + self.running = [] + self.assertEqual(BNET["install_path"](self.root, str(self.library)), "D:\\Games\\Battle.net") + self.running = [(5, ["C:\\Program Files (x86)\\Battle.net\\Battle.net.exe"])] + self.assertEqual(BNET["install_path"](self.root, str(self.library)), "D:\\Games\\Battle.net") + + def test_a_drive_mapped_inside_the_volume_is_reused(self): + self.devices.mkdir(parents=True) + os.symlink(str(self.card / "Games"), self.devices / "g:") + self.assertEqual(BNET["install_path"](self.root, str(self.library)), "G:\\Battle.net") + self.assertEqual(sorted(os.listdir(self.devices)), ["g:"]) + + def test_the_config_stores_the_drive_path_once(self): + path = self.tmp / ("Steam/steamapps/compatdata/%s/pfx/drive_c/users/steamuser/AppData/Roaming/Battle.net/Battle.net.config" + % BNET["APP_ID"]) + BNET["write_config"](self.root) + self.assertEqual(BNET["write_config"](self.root, str(self.library)), "library") + self.assertEqual(json.loads(path.read_text())["Client"]["Install"]["DefaultInstallPath"], "D:\\Games\\Battle.net") + self.assertIsNone(BNET["write_config"](self.root, str(self.library))) + + def test_registered_paths_resolve_through_their_drive(self): + BNET["install_path"](self.root, str(self.library)) + self.assertEqual(BNET["windows_path"](self.root, "D:/Games/Battle.net/World of Warcraft"), + str(self.library / "World of Warcraft")) + self.assertEqual(BNET["windows_path"](self.root, "Z:\\mnt\\card\\World of Warcraft"), "/mnt/card/World of Warcraft") + self.assertEqual(BNET["windows_path"](self.root, "C:/Program Files (x86)/World of Warcraft"), + os.path.join(BNET["drive_c"](self.root), "Program Files (x86)/World of Warcraft")) + self.assertIsNone(BNET["windows_path"](self.root, "E:/Games/X")) + self.assertIsNone(BNET["windows_path"](self.root, "D:/../etc")) + self.assertEqual(BNET["windows_path"](self.root, "D:\\"), str(self.library.parent.parent)) + + def field(self, number, value): + varint = BNET["encode_varint"] + return varint(number << 3 | 2) + varint(len(value)) + value + + def product(self, uid, folder, filler=b""): + settings = self.field(1, folder.encode()) + self.field(2, b"us") + b"\x18\x02" + filler + return self.field(1, self.field(1, uid.encode()) + self.field(2, uid.encode()) + self.field(3, settings) + + b"\x21" + bytes(8) + b"\x2d" + bytes(4)) + + def database(self, *products): + path = Path(BNET["drive_c"](self.root)) / "ProgramData/Battle.net/Agent/product.db" + path.parent.mkdir(parents=True, exist_ok=True) + path.write_bytes(b"".join(products) + self.field(7, b"tail")) + path.chmod(0o600) + return path + + def test_games_registered_through_the_root_drive_move_to_their_volume_drive(self): + game = self.library / "World of Warcraft" + game.mkdir() + other = self.tmp / "root/Games/Other" + other.mkdir(parents=True) + client = self.product("battle.net", "C:/Program Files (x86)/Battle.net") + local = self.product("other", "Z:" + str(other)) + gone = self.product("gone", "Z:" + str(self.card / "Missing")) + path = self.database(client, self.product("wow", "Z:" + str(game), bytes(200)), local, gone) + self.assertTrue(BNET["move_installs"](self.root)) + self.assertEqual(path.read_bytes(), client + self.product("wow", "D:/Games/Battle.net/World of Warcraft", bytes(200)) + + local + gone + self.field(7, b"tail")) + self.assertEqual(path.stat().st_mode & 0o777, 0o600) + self.assertEqual(os.readlink(self.devices / "d:"), str(self.card)) + self.assertFalse(BNET["move_installs"](self.root)) + + def test_registrations_stay_while_the_prefix_runs_or_the_database_is_unreadable(self): + game = self.library / "World of Warcraft" + game.mkdir() + path = self.database(self.product("wow", "Z:" + str(game))) + before = path.read_bytes() + self.running = [(5, ["C:\\ProgramData\\Battle.net\\Agent\\Agent.exe"])] + self.assertFalse(BNET["move_installs"](self.root)) + self.assertEqual(path.read_bytes(), before) + self.running = [] + for broken in (before[:-3], b"\x0a\xff", b"\x0b\x01"): + path.write_bytes(broken) + self.assertFalse(BNET["move_installs"](self.root)) + self.assertEqual(path.read_bytes(), broken) + os.unlink(path) + self.assertFalse(BNET["move_installs"](self.root)) + + def test_a_database_written_while_it_was_being_read_is_left_as_written(self): + game = self.library / "World of Warcraft" + game.mkdir() + path = self.database(self.product("wow", "Z:" + str(game))) + newer = path.read_bytes() + self.field(7, b"newer") + + def processes(pfx, proc="/proc"): + path.write_bytes(newer) + return [] + + with mock.patch.dict(BNET, {"wine_processes": processes}): + self.assertFalse(BNET["move_installs"](self.root)) + self.assertEqual(path.read_bytes(), newer) + self.assertTrue(BNET["move_installs"](self.root)) + + class GamepadTest(Temp): def registry(self, *entries): rows = ["WINE REGISTRY Version 2"] @@ -772,7 +921,7 @@ class Harness(Temp): "stop": lambda processes, wait=0: self.calls.append(("stop", sorted(pid for pid, _ in processes))), "start": lambda exe, verb=None: self.calls.append(("start", os.path.basename(exe), verb)) or self.Proton(), "spawn": lambda program, verb, args=(): self.calls.append(("spawn", os.path.basename(program), verb, list(args))), - "acquire": lambda folder=None: self.lock, + "acquire": lambda folder=None: self.lock, "volume_root": lambda path: "/", "POLL": 0, "READY_SETTLE": 0, "GAME_GRACE": 0, "CLIENT_WAIT": 0, }) patcher.start() @@ -1170,6 +1319,7 @@ class AgentTest(Temp): script = BNET["AGENT_SCRIPT"] self.assertIn("port = a(0), action = a(1), uid = a(2), product = a(3), dir = a(4)", script) self.assertIn("lang = a(5), country = a(6), region = a(7), out = a(8)", script) + self.assertIn(r'''"game_dir":"' + dir.replace(/\\/g, "\\\\").replace(/"/g, '\\"') + '","geo''', script) self.assertIn('"--internalclienttools"', (BIN / "droiddeck-battlenet").read_text()) def test_the_driver_asks_blizzards_chinese_repository_for_chinese_installs(self): @@ -1230,6 +1380,40 @@ class AgentJobTest(Harness): self.assertEqual([kind for kind, _ in self.lines], ["STATE", "PROGRESS", "DONE"]) self.assertEqual(json.loads(self.lines[-1][1]), {"install_dir": "Z:" + folder, "exe": "WarcraftRumble.exe", "version": "16.1.2.119725"}) + def test_an_install_on_another_volume_is_handed_over_by_its_drive_once_the_prefix_is_stopped(self): + self.install() + card = self.tmp / "card" + folder = str(card / "Games/Battle.net/Warcraft Rumble") + self.files = {".json": json.dumps({"progress": 1.0, "download_complete": True, "state": 1004}), + ".game": json.dumps({"installed": True, "install_dir": "D:/Games/Battle.net/Warcraft Rumble", "local_version": "1", + "binaries": {"game": {"relative_path": "WarcraftRumble.exe"}}})} + self.states = [[(7, self.AGENT)]] + events = [] + real_map = BNET["map_drive"] + + def acquire(folder=None): + events.append("lock") + return self.lock + + def stop(pfx): + events.append(("stop", not self.lock.closed)) + self.states = [[]] + return True + + def map_drive(root, volume): + events.append(("map", not self.lock.closed)) + return real_map(root, volume) + + with mock.patch.dict(BNET, {"volume_root": lambda path: str(card), "stop_leftovers": stop, "map_drive": map_drive, + "acquire": acquire}): + code = BNET["agent_job"](self.root, "install", "gryphon", "gryphon", folder, "enUS", "USA", "US", poll=0) + self.assertEqual(code, 0) + self.assertEqual(events, ["lock", ("stop", True), ("map", True)]) + self.assertTrue(self.lock.closed) + cmd = self.started[0] + self.assertEqual(cmd[cmd.index("--") + 6], "D:\\Games\\Battle.net\\Warcraft Rumble") + self.assertEqual(os.readlink(os.path.join(BNET["dosdevices"](self.root), "d:")), str(card)) + def test_an_agent_error_is_reported_with_its_code(self): self.install() self.files = {".json": json.dumps({"error": 2421, "progress": 0.0})} @@ -1257,6 +1441,138 @@ class AgentJobTest(Harness): self.assertEqual(BNET["agent_job"](self.root, "update", "gryphon", poll=0), 1) self.assertEqual(self.lines[-1][0], "ERROR") + def test_a_job_that_stops_moving_is_ended_as_stalled_and_its_agent_stopped(self): + self.install() + self.files = {".json": json.dumps({"state": 1003, "paused": True, "download_current": [10, 0, 0], "download_total": [99, 0, 0]})} + killed = [] + stopped = [] + + class Hung: + returncode = None + + def __init__(self, cmd, **kwargs): + base = cmd[-1][2:].replace("\\", "/") + with open(base + ".json", "wb") as f: + f.write(self_files[".json"].encode("utf-16")) + + def poll(self): + return None + + def kill(self): + killed.append(True) + + def wait(self): + return -9 + + self_files = self.files + with mock.patch.object(BNET["subprocess"], "Popen", Hung), \ + mock.patch.dict(BNET, {"wine_processes": lambda pfx: [(5, ["agent.exe"])], "stop": lambda p: stopped.append(p)}): + code = BNET["agent_job"](self.root, "install", "s1", "s1", str(self.tmp / "S1"), "enUS", "USA", "US", poll=0, stall=0.05) + self.assertEqual(code, 6) + self.assertEqual(killed, [True]) + self.assertEqual(stopped, [[(5, ["agent.exe"])]]) + self.assertEqual(self.lines[-1], ("ERROR", "stalled")) + + def test_a_stalled_job_leaves_a_game_or_client_in_the_prefix_running(self): + self.install() + self.files = {".json": json.dumps({"state": 1003, "download_current": [10, 0, 0], "download_total": [99, 0, 0]})} + stopped = [] + calls = [] + + class Hung: + returncode = None + + def __init__(self, cmd, **kwargs): + calls.append(True) + + def poll(self): + return None + + def kill(self): + pass + + def wait(self): + return -9 + + def processes(pfx): + if not calls: + return [(3, ["agent.exe"])] + return [(3, ["agent.exe"]), (5, ["Agent.exe"]), (6, ["wineserver"]), (7, ["Wow.exe"])] + + with mock.patch.object(BNET["subprocess"], "Popen", Hung), \ + mock.patch.dict(BNET, {"wine_processes": processes, "stop": lambda p: stopped.append(p)}): + code = BNET["agent_job"](self.root, "install", "s1", "s1", str(self.tmp / "S1"), "enUS", "USA", "US", poll=0, stall=0.05) + self.assertEqual(code, 6) + self.assertEqual(stopped, [[(5, ["Agent.exe"])]]) + + def test_only_a_changing_rate_or_estimate_does_not_hold_off_the_stall(self): + self.install() + clock = [0.0] + + class Spinning: + returncode = None + + def __init__(self, cmd, **kwargs): + self.base = cmd[-1][2:].replace("\\", "/") + self.polls = 0 + + def poll(self): + self.polls += 1 + if self.polls > 10: + raise AssertionError("the stall timeout never ended the job") + clock[0] += 10 + with open(self.base + ".json", "wb") as f: + f.write(json.dumps({"state": 1003, "download_current": [4, 0, 0], "download_total": [9, 0, 0], + "download_rate": self.polls, "estimated_time_in_sec": self.polls}).encode("utf-16")) + return None + + def kill(self): + pass + + def wait(self): + return -9 + + fake = mock.Mock(monotonic=lambda: clock[0], sleep=lambda s: None) + with mock.patch.object(BNET["subprocess"], "Popen", Spinning), mock.patch.dict(BNET, {"time": fake, "stop": lambda p: None}): + code = BNET["agent_job"](self.root, "update", "gryphon", poll=0, stall=25) + self.assertEqual(code, 6) + self.assertEqual(self.lines[-1], ("ERROR", "stalled")) + + def test_a_moving_job_is_not_ended_as_stalled(self): + self.install() + done = json.dumps({"installed": True, "playable": True, "install_dir": "Z:/g", "local_version": "2"}) + clock = [0.0] + + class Moving: + returncode = 0 + + def __init__(self, cmd, **kwargs): + self.base = cmd[-1][2:].replace("\\", "/") + self.polls = 0 + + def poll(self): + self.polls += 1 + clock[0] += 10 + with open(self.base + ".json", "wb") as f: + f.write(json.dumps({"state": 1003, "download_current": [self.polls, 0, 0], "download_total": [9, 0, 0]}).encode("utf-16")) + if self.polls < 6: + return None + with open(self.base + ".game", "wb") as f: + f.write(done.encode("utf-16")) + return 0 + + fake = mock.Mock(monotonic=lambda: clock[0], sleep=lambda s: None) + with mock.patch.object(BNET["subprocess"], "Popen", Moving), mock.patch.dict(BNET, {"time": fake}): + code = BNET["agent_job"](self.root, "update", "gryphon", poll=0, stall=15) + self.assertEqual(code, 0) + self.assertNotIn(("ERROR", "stalled"), self.lines) + + def test_only_a_real_job_reply_counts_as_started(self): + script = BNET["AGENT_SCRIPT"] + self.assertIn("if (state == 1000 || state == 1003 || job(s) && !complete) started = true;", script) + self.assertIn('return /"state"\\s*:\\s*\\d+/.test(bare) || /"download_current"\\s*:/.test(bare);', script) + self.assertIn('if (/"error"\\s*:\\s*[1-9]/.test(text)) return false;', script) + def test_the_driver_only_stops_once_the_agent_has_really_run(self): script = BNET["AGENT_SCRIPT"] self.assertIn("if (started && (state == 1004 || complete && /\"playable\"\\s*:\\s*true/.test(s))) break;", script) diff --git a/tools/tests/test_binfmt_preload.py b/tools/tests/test_binfmt_preload.py index 8314d39e40..9966b28505 100644 --- a/tools/tests/test_binfmt_preload.py +++ b/tools/tests/test_binfmt_preload.py @@ -22,22 +22,29 @@ extern char **environ; int main(int argc, char **argv) { if (argc < 3) return 2; const char *how = argv[1], *file = argv[2]; + char *node_env[] = {"ELECTRON_RUN_AS_NODE=1", NULL}; + char *const *child_env = !strcmp(how, "execve-node") || !strcmp(how, "execvpe-node") || + !strcmp(how, "spawn-node") || !strcmp(how, "spawnp-node") ? node_env : environ; char **args = argv + 2; if (!strcmp(how, "access")) { int result = access(file, X_OK); printf("access %d %d\n", result, result ? errno : 0); return 0; } - if (!strcmp(how, "spawn") || !strcmp(how, "spawnp")) { + if (!strcmp(how, "spawn") || !strcmp(how, "spawnp") || !strcmp(how, "spawn-node") || + !strcmp(how, "spawnp-node")) { pid_t pid; - int error = how[5] ? posix_spawnp(&pid, file, NULL, NULL, args, environ) : posix_spawn(&pid, file, NULL, NULL, args, environ); + int spawnp = !strcmp(how, "spawnp") || !strcmp(how, "spawnp-node"); + int error = spawnp ? posix_spawnp(&pid, file, NULL, NULL, args, child_env) + : posix_spawn(&pid, file, NULL, NULL, args, child_env); if (error) { printf("errno %d\n", error); return 3; } int status; waitpid(pid, &status, 0); printf("exit %d\n", WEXITSTATUS(status)); return 0; } - if (!strcmp(how, "execve")) execve(file, args, environ); + if (!strcmp(how, "execve") || !strcmp(how, "execve-node")) execve(file, args, (char *const *)child_env); + else if (!strcmp(how, "execvpe-node")) execvpe(file, args, (char *const *)child_env); else if (!strcmp(how, "execv")) execv(file, args); else if (!strcmp(how, "execvp")) execvp(file, args); else if (!strcmp(how, "execvpe")) execvpe(file, args, environ); @@ -88,6 +95,15 @@ class BinfmtPreloadTest(unittest.TestCase): path.chmod(mode) return path + def chromium_script(self): + folder = self.dir / "vscode" + folder.mkdir() + executable = folder / "code" + executable.write_text("#!/bin/sh\nprintf '%s\\n' \"$@\"\n") + executable.chmod(0o755) + (folder / "chrome-sandbox").touch() + return executable + def environment(self, desktop=True, **extra): env = {"PATH": "%s:/usr/bin:/bin" % self.dir, "LD_PRELOAD": str(self.library), "HANDLER_LOG": str(self.log)} if desktop: @@ -161,6 +177,17 @@ class BinfmtPreloadTest(unittest.TestCase): self.file("script.sh", b"#!/bin/sh\nexit 5\n") self.assertEqual(self.run_program("spawnp", "script.sh"), (0, "exit 5", None)) + def test_explicit_node_child_environment_skips_injection_for_execve_and_spawn(self): + code = self.chromium_script() + self.assertEqual(self.run_program("execve-node", code, "--version"), (0, "--version", None)) + self.assertEqual(self.run_program("execvpe-node", code, "--version"), (0, "--version", None)) + self.assertEqual(self.run_program("spawn-node", code, "--version"), (0, "--version\nexit 0", None)) + self.assertEqual(self.run_program("spawnp-node", code, "--version"), (0, "--version\nexit 0", None)) + + def test_chromium_gui_launch_without_node_mode_still_receives_no_sandbox(self): + code = self.chromium_script() + self.assertEqual(self.run_program("execve", code, "--version"), (0, "--no-sandbox\n--version", None)) + def test_the_hand_off_switch_works_without_the_desktop(self): tool = self.x86() for how in ("execve", "execvp"): diff --git a/tools/tests/test_ci_checks.py b/tools/tests/test_ci_checks.py index f2e258a020..125dba0398 100644 --- a/tools/tests/test_ci_checks.py +++ b/tools/tests/test_ci_checks.py @@ -58,11 +58,17 @@ class CiChecksTest(unittest.TestCase): with tempfile.TemporaryDirectory() as directory: root = Path(directory) sudo = root / 'sudo' - sudo.write_text('#!/bin/bash\nprintf "%s\\n" "$*" >> "$APT_LOG"\nexit "${APT_RESULT:-0}"\n') + sudo.write_text('#!/bin/bash\nprintf "%s\\n" "$*" >> "$APT_LOG"\n' + 'for arg; do case "$arg" in Dir::Etc::sourcelist=*) ' + 'grep -h "^URIs:" "${arg#*=}" >> "$APT_LOG.mirrors";; esac; done\n' + 'exit "${APT_RESULT:-0}"\n') sudo.chmod(0o755) query = root / 'dpkg-query' query.write_text('#!/bin/sh\nexit 1\n') query.chmod(0o755) + dpkg = root / 'dpkg' + dpkg.write_text('#!/bin/sh\necho "${DPKG_ARCH:-amd64}"\n') + dpkg.chmod(0o755) log = root / 'apt.log' sources = root / 'ubuntu.sources' sources.write_text('URIs: http://mirror.invalid/ubuntu\n') @@ -71,8 +77,23 @@ class CiChecksTest(unittest.TestCase): installer = ROOT / 'tools/ci/install-ubuntu-packages.sh' result = subprocess.run(['bash', str(installer), 'qemu-user'], env=dict(env, APT_RESULT='17')) self.assertEqual(result.returncode, 17) - self.assertEqual(len(log.read_text().splitlines()), 2) + self.assertEqual(len(log.read_text().splitlines()), 3) + mirrors = Path(str(log) + '.mirrors') + self.assertEqual(mirrors.read_text().splitlines(), [ + 'URIs: http://mirror.invalid/ubuntu', + 'URIs: https://archive.ubuntu.com/ubuntu', + 'URIs: https://mirrors.edge.kernel.org/ubuntu', + ]) log.unlink() + mirrors.unlink() + result = subprocess.run(['bash', str(installer), 'qemu-user'], env=dict(env, APT_RESULT='17', DPKG_ARCH='arm64')) + self.assertEqual(result.returncode, 17) + self.assertEqual(mirrors.read_text().splitlines()[1:], [ + 'URIs: https://ports.ubuntu.com/ubuntu-ports', + 'URIs: https://mirrors.ocf.berkeley.edu/ubuntu-ports', + ]) + log.unlink() + mirrors.unlink() subprocess.run(['bash', str(installer), 'qemu-user'], env=env, check=True) update, install = log.read_text().splitlines() for command in (update, install): diff --git a/tools/tests/test_client_zram_focus.py b/tools/tests/test_client_zram_focus.py index 5cd7d3cd4a..db2d3f80e1 100644 --- a/tools/tests/test_client_zram_focus.py +++ b/tools/tests/test_client_zram_focus.py @@ -121,6 +121,7 @@ step() { :; } bl_zram_scan() { :; } bl_memory_read() { :; } bl_client_pressure() { :; } +bl_client_pressure_finish() { :; } bl_session_pressure() { :; } bl_client_can_pageout() { return 0; } bl_client_can_readback() { [ "${readback:-1}" = 1 ]; } diff --git a/tools/tests/test_clock_pause_preload.py b/tools/tests/test_clock_pause_preload.py index 6523811125..06ddd65a49 100644 --- a/tools/tests/test_clock_pause_preload.py +++ b/tools/tests/test_clock_pause_preload.py @@ -1,19 +1,34 @@ import os from pathlib import Path +import queue +import re +import shlex import shutil import struct import subprocess import tempfile +import threading import unittest PRELOAD = Path(__file__).resolve().parents[1] / "linuxfs/preload" + +def clock_reset_command(control): + script = (PRELOAD.parent / "overlay/usr/local/bin/droiddeck-session").read_text() + start = script.index('if [ -z "${BL_INSIDE:-}" ]; then\n if [ "${BL_ZRAM:-0}"') + end = script.index("\nfi", start) + len("\nfi") + paths = {"/tmp/.bl-clock": shlex.quote(str(control)), + "/tmp/.bl-zram": shlex.quote(str(control.parent / "zram"))} + pattern = "|".join(re.escape(token) for token in paths) + return 'BL_INSIDE=; BL_ZRAM=0; ' + re.sub(pattern, lambda match: paths[match.group(0)], script[start:end]) + PROGRAM = r""" #define _GNU_SOURCE #include #include #include #include +#include #include #include #include @@ -36,12 +51,26 @@ static int64_t start; static void begin(void) { start = ns(CLOCK_BOOTTIME); } static void end(const char *name) { printf("%s %lld\n", name, (long long)((ns(CLOCK_BOOTTIME) - start) / 1000000LL)); } +static unsigned long long memory_probe(void) { + static volatile unsigned char memory[4 * 1024 * 1024]; + unsigned long long checksum = 0; + for (size_t i = 0; i < sizeof(memory); i += 4096) memory[i] = (unsigned char)(i / 4096 + 1); + for (size_t i = 0; i < sizeof(memory); i += 4096) checksum += memory[i]; + return checksum; +} + int main(void) { const int64_t wait = 60000000LL; printf("gap %lld\n", (long long)((ns(CLOCK_BOOTTIME) - ns(CLOCK_MONOTONIC)) / 1000000LL)); struct timespec raw; syscall(SYS_clock_gettime, CLOCK_MONOTONIC, &raw); printf("rawgap %lld\n", (long long)((ns(CLOCK_BOOTTIME) - ((int64_t)raw.tv_sec * 1000000000LL + raw.tv_nsec)) / 1000000LL)); + printf("memory %llu\n", memory_probe()); + if (getenv("CLOCK_PAUSE_WAIT")) { puts("ready"); fflush(stdout); getchar(); } + if (getenv("CLOCK_PAUSE_WAIT")) { + printf("livegap %lld\n", (long long)((ns(CLOCK_BOOTTIME) - ns(CLOCK_MONOTONIC)) / 1000000LL)); + printf("livememory %llu\n", memory_probe()); + } pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; pthread_condattr_t attr; @@ -124,14 +153,124 @@ class ClockPausePreloadTest(unittest.TestCase): self.assertGreaterEqual(paused[name], 50, name) self.assertLess(paused[name], 1000, name) - def test_other_programs_keep_the_real_clock(self): + def test_program_without_preload_keeps_the_real_clock(self): plain = self.run_program(self.other, 0, preload=False) - paused = self.run_program(self.other, SHIFT_MS) + paused = self.run_program(self.other, SHIFT_MS, preload=False) self.assertAlmostEqual(paused["gap"], plain["gap"], delta=50) for name in ("cond_mono", "clockwait", "sem", "nanosleep", "timerfd", "futex"): self.assertGreaterEqual(paused[name], 50, name) self.assertLess(paused[name], 1000, name) + def test_every_session_program_stops_monotonic_clock_and_keeps_memory_access(self): + plain = self.run_program(self.other, 0) + paused = self.run_program(self.other, SHIFT_MS) + self.assertAlmostEqual(paused["gap"] - plain["gap"], SHIFT_MS, delta=50) + self.assertAlmostEqual(paused["rawgap"] - plain["rawgap"], SHIFT_MS, delta=50) + self.assertEqual(plain["memory"], 130560) + self.assertEqual(paused["memory"], 130560) + + def test_running_session_program_observes_pause_offset_update(self): + self.check_running_offset_update(False) + + def test_session_reset_preserves_live_guest_mapping(self): + self.check_running_offset_update(True) + + def check_running_offset_update(self, reset): + self.control.write_bytes(struct.pack(" "$HOME/selected-package"\nexit 1\n') + for tool in bin_dir.iterdir(): + tool.chmod(0o755) + env.pop('DROIDDECK_PACKAGE') + env['DD_LAB_DETACHED'] = '1' + env['PATH'] = str(bin_dir) + os.pathsep + env['PATH'] + result = subprocess.run(['bash', str(SCRIPT), *payload['args']], env=env, + capture_output=True, text=True, timeout=10, cwd=SCRIPT.parents[2]) + self.assertNotEqual(0, result.returncode) + self.assertIn('could not read DroidDeck', result.stderr) + self.assertEqual('com.example.target', (root / 'selected-package').read_text()) + + def test_invalid_packages_are_rejected_before_handoff(self): + with tempfile.TemporaryDirectory() as tmp: + inbox = Path(tmp) / 'agent' + inbox.mkdir() + for package in ('bad;touch injected', '../other', '', 'com.example/other'): + with self.subTest(package=package): + env = {**os.environ, 'HOME': tmp, 'DD_AGENT': '1', 'DD_AGENT_INBOX': str(inbox)} + result = subprocess.run(['bash', str(SCRIPT), '--package=' + package], env=env, + capture_output=True, text=True, timeout=10) + self.assertNotEqual(0, result.returncode) + self.assertIn('invalid Android package', result.stderr) + self.assertFalse((inbox / 'lab-request').exists()) diff --git a/tools/tests/test_descriptor_preload.py b/tools/tests/test_descriptor_preload.py new file mode 100644 index 0000000000..f83df2e9b2 --- /dev/null +++ b/tools/tests/test_descriptor_preload.py @@ -0,0 +1,245 @@ +import os +from pathlib import Path +import shutil +import subprocess +import tempfile +import unittest + +PRELOAD = Path(__file__).resolve().parents[1] / "linuxfs/preload" + +FAKE = r""" +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include +#include + +static int answer(int fd) { + char link[32], path[4096]; + snprintf(link, sizeof(link), "/proc/self/fd/%d", fd); + long n = syscall(SYS_readlinkat, AT_FDCWD, link, path, sizeof(path) - 1); + path[n > 0 ? n : 0] = '\0'; + if (strstr(path, "/card/")) return ENOTSUP; + if (strstr(path, "/denied/")) return EACCES; + return ENODATA; +} + +ssize_t fgetxattr(int fd, const char *name, void *value, size_t size) { + (void)name; (void)value; (void)size; + errno = answer(fd); + return -1; +} + +int fsetxattr(int fd, const char *name, const void *value, size_t size, int flags) { + (void)name; (void)value; (void)size; (void)flags; + int error = answer(fd); + if (error == ENODATA) return 0; + errno = error; + return -1; +} + +int fremovexattr(int fd, const char *name) { + (void)name; + errno = answer(fd); + return -1; +} +""" + +PROGRAM = r""" +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include + +static const char *error(void) { + return errno == ENOTSUP ? "unsupported" : errno == ENODATA ? "none" : errno == ERANGE ? "range" : + errno == EACCES ? "denied" : "other"; +} + +int main(int argc, char **argv) { + for (int i = 1; i < argc; i++) { + const char *op = argv[i]; + if (!strcmp(op, "unlink") || !strcmp(op, "rmdir")) { + const char *path = argv[++i]; + printf("%s\n", (op[0] == 'u' ? unlink(path) : rmdir(path)) == 0 ? "ok" : "failed"); + continue; + } + if (!strcmp(op, "remove-path")) { + printf("%s\n", remove(argv[++i]) == 0 ? "ok" : "failed"); + continue; + } + if (!strcmp(op, "rename")) { + const char *from = argv[++i], *to = argv[++i]; + printf("%s\n", rename(from, to) == 0 ? "ok" : "failed"); + continue; + } + int fd = open(argv[++i], O_RDONLY); + char value[64]; + if (!strcmp(op, "set")) { + const char *text = argv[++i]; + errno = 1234; + int result = fsetxattr(fd, "user.wine.sd", text, strlen(text), 0); + printf("%s\n", result == 0 ? errno == 1234 ? "ok" : "errno" : error()); + } else if (!strcmp(op, "get")) { + ssize_t n = fgetxattr(fd, "user.wine.sd", value, sizeof(value)); + if (n < 0) printf("%s\n", error()); + else printf("=%.*s\n", (int)n, value); + } else if (!strcmp(op, "size")) { + ssize_t n = fgetxattr(fd, "user.wine.sd", NULL, 0); + if (n < 0) printf("%s\n", error()); + else printf("%d\n", (int)n); + } else if (!strcmp(op, "short")) { + ssize_t n = fgetxattr(fd, "user.wine.sd", value, 2); + printf("%s\n", n < 0 ? error() : "read"); + } else if (!strcmp(op, "remove")) { + errno = 1234; + int result = fremovexattr(fd, "user.wine.sd"); + printf("%s\n", result == 0 ? errno == 1234 ? "ok" : "errno" : error()); + } else if (!strcmp(op, "other")) { + ssize_t n = fgetxattr(fd, "user.other", value, sizeof(value)); + printf("%s\n", n < 0 ? error() : "read"); + } + close(fd); + } + return 0; +} +""" + + +@unittest.skipUnless(shutil.which("cc"), "needs a C compiler") +class DescriptorPreloadTest(unittest.TestCase): + @classmethod + def setUpClass(cls): + cls.build_dir = tempfile.TemporaryDirectory() + build = Path(cls.build_dir.name) + (build / "fake.c").write_text(FAKE) + (build / "program.c").write_text(PROGRAM) + cls.preload = build / "libblsession.so" + cls.fake = build / "fake.so" + subprocess.run(["cc", "-shared", "-fPIC", "-O2", "-Wall", "-pthread", "-o", str(cls.preload), + *map(str, sorted(PRELOAD.glob("*.c"))), "-ldl"], check=True) + subprocess.run(["cc", "-shared", "-fPIC", "-O2", "-o", str(cls.fake), str(build / "fake.c")], check=True) + cls.wineserver = build / "wineserver" + subprocess.run(["cc", "-O2", "-o", str(cls.wineserver), str(build / "program.c")], check=True) + cls.other = build / "wine64-preloader" + shutil.copy(cls.wineserver, cls.other) + + @classmethod + def tearDownClass(cls): + cls.build_dir.cleanup() + + def setUp(self): + self.temp = tempfile.TemporaryDirectory() + self.dir = Path(os.path.realpath(self.temp.name)) + self.prefix = self.dir / "prefix" + self.prefix.mkdir() + self.store = self.prefix / ".droiddeck-descriptors" + for kind in ("card", "disk", "denied"): + (self.dir / kind / "game").mkdir(parents=True) + (self.dir / kind / "game" / "file").write_text("x") + + def tearDown(self): + self.temp.cleanup() + + def path(self, *parts): + return str(self.dir.joinpath(*parts)) + + def run_as(self, program, *args, prefix=True): + env = dict(os.environ, LD_PRELOAD="%s:%s" % (self.preload, self.fake)) + env.pop("WINEPREFIX", None) + if prefix: + env["WINEPREFIX"] = str(self.prefix) + result = subprocess.run([str(program), *args], env=env, capture_output=True, text=True, check=True) + return result.stdout.split() + + def server(self, *args, **kwargs): + return self.run_as(self.wineserver, *args, **kwargs) + + def test_a_descriptor_is_kept_where_the_volume_cannot_store_it(self): + file, folder = self.path("card", "game", "file"), self.path("card", "game") + self.assertEqual(["none", "ok", "ok"], self.server("get", file, "set", file, "one", "set", folder, "two")) + self.assertEqual(["=one", "3", "=two"], self.server("get", file, "size", file, "get", folder)) + + def test_a_descriptor_is_replaced_and_removed(self): + file = self.path("card", "game", "file") + self.assertEqual(["ok", "ok", "=longer"], self.server("set", file, "one", "set", file, "longer", "get", file)) + self.assertEqual(["range", "ok", "none", "none"], self.server("short", file, "remove", file, "get", file, "remove", file)) + + def test_a_volume_that_stores_descriptors_is_left_alone(self): + file = self.path("disk", "game", "file") + self.assertEqual(["ok", "none", "none"], self.server("set", file, "one", "get", file, "remove", file)) + self.assertFalse(self.store.exists()) + + def test_other_failures_keep_their_error(self): + file = self.path("denied", "game", "file") + self.assertEqual(["denied", "denied", "denied"], self.server("set", file, "one", "get", file, "remove", file)) + self.assertFalse(self.store.exists()) + + def test_other_programs_and_other_attributes_are_unchanged(self): + file = self.path("card", "game", "file") + self.assertEqual(["unsupported", "unsupported", "unsupported"], + self.run_as(self.other, "set", file, "one", "get", file, "remove", file)) + self.assertEqual(["ok", "unsupported"], self.server("set", file, "one", "other", file)) + self.assertEqual(["unsupported"], self.run_as(self.other, "get", file)) + + def test_nothing_is_kept_without_a_prefix(self): + file = self.path("card", "game", "file") + self.assertEqual(["unsupported", "unsupported", "unsupported"], + self.server("set", file, "one", "get", file, "remove", file, prefix=False)) + + def test_a_deleted_file_loses_its_descriptor(self): + file, folder = self.path("card", "game", "file"), self.path("card", "game") + self.assertEqual(["ok", "ok", "ok"], self.server("set", file, "one", "set", folder, "two", "unlink", file)) + Path(file).write_text("x") + self.assertEqual(["none", "ok", "ok"], self.server("get", file, "unlink", file, "rmdir", folder)) + Path(folder).mkdir() + self.assertEqual(["none"], self.server("get", folder)) + + def test_a_removed_file_or_folder_loses_its_descriptor(self): + file, folder = self.path("card", "game", "file"), self.path("card", "game") + self.assertEqual(["ok", "ok", "ok", "ok"], + self.server("set", file, "one", "set", folder, "two", "remove-path", file, "remove-path", folder)) + Path(folder).mkdir() + Path(file).write_text("x") + self.assertEqual(["none", "none"], self.server("get", folder, "get", file)) + + def test_a_file_deleted_through_a_link_loses_its_descriptor(self): + file = self.path("card", "game", "file") + os.symlink(self.path("card"), self.path("drive")) + self.assertEqual(["ok", "ok"], self.server("set", file, "one", "unlink", self.path("drive", "game", "file"))) + Path(file).write_text("x") + self.assertEqual(["none"], self.server("get", file)) + + def test_a_descriptor_follows_a_rename(self): + file, moved = self.path("card", "game", "file"), self.path("card", "game", "moved") + self.assertEqual(["ok", "ok", "=one"], self.server("set", file, "one", "rename", file, moved, "get", moved)) + Path(file).write_text("x") + self.assertEqual(["none", "ok", "none"], self.server("get", file, "rename", file, moved, "get", moved)) + + def test_descriptors_follow_a_renamed_folder(self): + file, folder, moved = self.path("card", "game", "file"), self.path("card", "game"), self.path("card", "moved") + self.assertEqual(["ok", "ok", "ok"], self.server("set", file, "one", "set", folder, "two", "rename", folder, moved)) + self.assertEqual(["=two", "=one"], self.server("get", moved, "get", self.path("card", "moved", "file"))) + Path(folder).mkdir() + (Path(folder) / "file").write_text("x") + self.assertEqual(["none", "none"], self.server("get", folder, "get", file)) + + def test_deletes_outside_the_store_cost_nothing_before_it_exists(self): + file = self.path("disk", "game", "file") + self.assertEqual(["ok"], self.server("unlink", file)) + self.assertFalse(self.store.exists()) + + def test_a_name_too_long_to_keep_reports_no_support(self): + long_file = self.path("card", "game", "n" * 254) + Path(long_file).write_text("x") + self.assertEqual(["unsupported", "unsupported"], self.server("set", long_file, "one", "get", long_file)) + + +if __name__ == "__main__": + unittest.main() diff --git a/tools/tests/test_desktop_open.py b/tools/tests/test_desktop_open.py index c32baf71a6..a7840cfa53 100644 --- a/tools/tests/test_desktop_open.py +++ b/tools/tests/test_desktop_open.py @@ -136,6 +136,30 @@ class CommandTest(Temp): self.assertEqual(OPEN["command"](script, [], "x86 script")[0], [OPEN["FEX"], "run", "--mode", "on", "--for", str(self.tmp), "--", "/bin/sh", script]) + def test_a_store_games_exe_runs_through_its_launcher(self): + exe, launcher = str(self.tmp / "game.exe"), str(self.tmp / "launch.bat") + with mock.patch.dict(OPEN, {"store_launcher": lambda path: launcher if path == exe else None, + "exe_prefix": lambda path: ["--prefix", "4242", "--compatdata", "/c/4242"]}): + keep = ["--prefix", "4242", "--compatdata", "/c/4242"] + self.assertEqual(OPEN["command"](exe, [], "windows")[0], [OPEN["PROTON_RUN"]] + keep + [launcher]) + self.assertEqual(OPEN["command"](exe, [], "windows", True)[0], + [OPEN["PROTON_RUN"], "--window"] + keep + [launcher]) + self.assertEqual(OPEN["command"](exe, ["-x"], "windows")[0], [OPEN["PROTON_RUN"], exe, "-x"]) + other = str(self.tmp / "other.exe") + self.assertEqual(OPEN["command"](other, [], "windows")[0], [OPEN["PROTON_RUN"], other]) + + def test_a_store_games_launcher_keeps_the_exes_prefix(self): + exe = self.tmp / "game.exe" + exe.write_text("x") + root = str(self.tmp / "steam") + with mock.patch.dict(os.environ, {"STEAM_COMPAT_CLIENT_INSTALL_PATH": root}), \ + mock.patch.dict(OPEN, {"PROTON_RUN": str(BIN / "droiddeck-proton-run"), + "store_launcher": lambda path: str(self.tmp / "launch.bat")}): + command = OPEN["command"](str(exe), [], "windows")[0] + located = RUN["locate"](str(exe), root) + self.assertEqual(command[1:5], ["--prefix", located.appid, "--compatdata", located.compatdata]) + self.assertEqual(str(RUN["own_id"](str(exe))), str(RUN["locate"](str(exe), root).appid)) + def test_a_native_program_on_noexec_storage_runs_from_a_copy(self): program = self.write("storage/tool", elf(183)) x86 = self.write("storage/game.x86_64", elf(62)) @@ -737,6 +761,20 @@ class ProtonRunTest(Temp): self.assertEqual(env["STEAM_COMPAT_DATA_PATH"], str(signed)) self.assertFalse((self.root / "steamapps/compatdata/2733369024").exists()) + def test_a_launcher_run_keeps_the_resolved_compatdata_folder(self): + bat = self.write("Games/Epic/Game/.droiddeck-launch.bat", b"@echo off") + signed = self.root / "steamapps/compatdata/-1561598272" + signed.mkdir(parents=True) + other = self.tmp / "Library2/steamapps/compatdata/555" + other.mkdir(parents=True) + for compatdata, appid in ((signed, "2733369024"), (other, "555")): + with self.subTest(compatdata=str(compatdata)): + code, calls, dirs = self.run_main(["--prefix", appid, "--compatdata", str(compatdata), str(bat)]) + self.assertIsNone(code) + self.assertEqual(calls[0][2]["STEAM_COMPAT_DATA_PATH"], str(compatdata)) + code, calls, dirs = self.run_main(["--prefix", "555", str(bat)]) + self.assertEqual(calls[0][2]["STEAM_COMPAT_DATA_PATH"], str(self.root / "steamapps/compatdata/555")) + def test_prefix_folder_prefers_initialized_unsigned_over_empty_signed(self): signed = self.root / "steamapps/compatdata/-1561598272" signed.mkdir(parents=True) diff --git a/tools/tests/test_dircache_preload.py b/tools/tests/test_dircache_preload.py index 42db6817ce..f7b2d9008a 100644 --- a/tools/tests/test_dircache_preload.py +++ b/tools/tests/test_dircache_preload.py @@ -83,9 +83,25 @@ int inotify_add_watch(int fd, const char *path, uint32_t mask) { errno = ENOSPC; return -1; } + if (getenv("NESTED") && (mask & IN_ONLYDIR)) { + static DIR *(*uncounted)(const char *); + if (!uncounted) uncounted = dlsym(RTLD_NEXT, "opendir"); + mkdir(path, 0755); + DIR *d = uncounted("/proc/self/fd"); + while (d && readdir(d)) {} + if (d) closedir(d); + } return next(fd, path, mask); } +int remove(const char *path) { + static int (*next)(const char *); + if (!next) next = dlsym(RTLD_NEXT, "remove"); + if (!getenv("NESTED")) return next(path); + if (unlink(path) == 0) return 0; + return errno == EISDIR ? rmdir(path) : -1; +} + int statfs(const char *path, struct statfs *out) { static int (*next)(const char *, struct statfs *); if (!next) next = dlsym(RTLD_NEXT, "statfs"); @@ -337,9 +353,9 @@ class DirCachePreloadTest(unittest.TestCase): environment.update(env or {}) return environment - def run_program(self, *args, program=None, env=None): + def run_program(self, *args, program=None, env=None, timeout=60): result = subprocess.run([str(program or self.steam), *map(str, args)], env=self.environment(env), - capture_output=True, text=True, check=True, timeout=60) + capture_output=True, text=True, check=True, timeout=timeout) return result.stdout.splitlines() def run_paused(self, *args, between, env=None): @@ -675,6 +691,20 @@ class DirCachePreloadTest(unittest.TestCase): env={"BL_NO_DIR_CACHE": "1"}) self.assertEqual(["-1 2", "-1 2", "2"], out[1:]) + def test_a_preload_below_calling_back_while_a_folder_is_watched_does_not_hang(self): + common = self.lib / "common/Game" + common.mkdir(parents=True) + (common / "game.exe").touch() + out = self.run_program("list", self.staging, "list", common, "list", common, "opens", + env={"NESTED": "1"}, timeout=20) + self.assertEqual(["a.bundle,b.bundle", "game.exe", "game.exe", "2"], out) + + def test_a_preload_below_removing_through_unlink_does_not_hang(self): + s = self.staging + out = self.run_program("list", s, "remove", s / "a.bundle", "list", s, "raw", s, "opens", + env={"NESTED": "1"}, timeout=20) + self.assertEqual(["a.bundle,b.bundle", "b.bundle", "b.bundle", "1"], out) + def test_can_be_turned_off(self): out = self.run_program("list", self.staging, "list", self.staging, "opens", env={"BL_NO_DIR_CACHE": "1"}) self.assertEqual("2", out[-1]) diff --git a/tools/tests/test_droiddeck_epic.py b/tools/tests/test_droiddeck_epic.py index 297168b00e..39304d777d 100644 --- a/tools/tests/test_droiddeck_epic.py +++ b/tools/tests/test_droiddeck_epic.py @@ -175,17 +175,27 @@ class RuntimeExtractTest(EpicTestCase): old = self.state / "app/0.1" old.mkdir(parents=True) - def extract_app(image, dest): - os.makedirs(os.path.join(dest, "usr/bin")) - Path(dest, "AppRun").write_text("run") - Path(dest, "usr/bin/EpicGamesLauncher").write_text("bin") + layers = [] + def extract_app(image, dest, desktop=()): + layers.append(list(desktop)) + os.makedirs(os.path.join(dest, "usr/bin")) + os.makedirs(os.path.join(dest, "desktop/usr/lib/x86_64-linux-gnu")) + Path(dest, "usr/bin/EpicGamesLauncher").write_text("bin") + Path(dest, "desktop/usr/lib/x86_64-linux-gnu/libwebkit2gtk-4.1.so.0").write_text("webkit") + + package = self.tmp / "libwebkit.deb" + package.write_bytes(b"x") with mock.patch.dict(G, {"extract_app": extract_app, "fex_tool": lambda request=False: {"bin": "/fex", "server": "/s"}}), \ mock.patch("sys.stdout", new_callable=io.StringIO) as out: image = self.tmp / "image" image.write_bytes(b"x") + with self.assertRaises(G["Failure"]): + G["install"]({"app": str(image), "app-version": "0.95.2+g1", "runtime": str(tarball), + "runtime-version": "4.0.1", "gles": str(deb), "desktop": [str(self.tmp / "missing.deb")]}) code = G["install"]({"app": str(image), "app-version": "0.95.2+g1", "runtime": str(tarball), - "runtime-version": "4.0.1", "gles": str(deb)}) + "runtime-version": "4.0.1", "gles": str(deb), "desktop": [str(package)]}) + self.assertEqual([[str(package)]], layers) self.assertEqual(0, code) report = json.loads(out.getvalue()) self.assertTrue(report["installed"]) @@ -197,6 +207,147 @@ class RuntimeExtractTest(EpicTestCase): self.assertTrue((self.state / "app/0.95.2+g1/.droiddeck-ready").is_file()) +def deb(path, entries, compression="gz"): + data = io.BytesIO() + with tarfile.open(fileobj=data, mode="w:" + compression) as archive: + for entry in entries: + tar_add(archive, *entry[:1], **entry[1]) + path.write_bytes(ar([("debian-binary", b"2.0\n"), ("control.tar.xz", b"c"), ("data.tar." + compression, data.getvalue())])) + return path + + +class LauncherDebTest(EpicTestCase): + def launcher(self, extra=()): + return deb(self.tmp / "EpicGamesLauncher-x86_64.deb", [ + ("./usr", {"kind": "dir"}), + ("./usr/bin/EpicGamesLauncher", {"data": b"egl", "mode": 0o755}), + ("./usr/lib/epic-games-launcher/libEOSSDK-Linux-Shipping.so", {"data": b"eos"}), + ("./usr/share/icons/hicolor/256x256@2/apps/EpicGamesLauncher.png", {"data": b"png"}), + ("./usr/share/applications/epic-games-launcher.desktop", {"data": b"[Desktop Entry]\n"}), + ("./usr/bin/egl", {"link": "/usr/bin/EpicGamesLauncher"}), + ("../escape", {"data": b"x"}), + *extra, + ]) + + def webkit(self): + return deb(self.tmp / "libwebkit2gtk-4.1-0_amd64.deb", [ + ("./usr/lib/x86_64-linux-gnu/libwebkit2gtk-4.1.so.0.19.1", {"data": b"webkit"}), + ("./usr/lib/x86_64-linux-gnu/libwebkit2gtk-4.1.so.0", {"link": "libwebkit2gtk-4.1.so.0.19.1"}), + ("./usr/lib/x86_64-linux-gnu/webkit2gtk-4.1/WebKitNetworkProcess", {"data": b"net", "mode": 0o755}), + ("./usr/lib/x86_64-linux-gnu/webkit2gtk-4.1/injected-bundle/libwebkit2gtkinjectedbundle.so", {"data": b"bundle"}), + ("./usr/share/glib-2.0/schemas/org.gnome.GWeather4.gschema.xml", {"data": b"schema"}), + ("./usr/share/doc/libwebkit2gtk-4.1-0/copyright", {"data": b"c"}), + ("./usr/share/locale/fr/LC_MESSAGES/WebKitGTK-4.1.mo", {"data": b"fr"}), + ], "xz") + + def test_the_launcher_and_its_desktop_layer_come_out_of_debs(self): + dest = self.state / "app/0.113.0+g1" + G["extract_app"](str(self.launcher()), str(dest), [str(self.webkit())]) + self.assertEqual(b"egl", (dest / "usr/bin/EpicGamesLauncher").read_bytes()) + self.assertTrue(os.access(dest / "usr/bin/EpicGamesLauncher", os.X_OK)) + self.assertEqual(b"eos", (dest / "usr/lib/epic-games-launcher/libEOSSDK-Linux-Shipping.so").read_bytes()) + self.assertEqual("EpicGamesLauncher", os.readlink(dest / "usr/bin/egl")) + self.assertEqual(b"png", (dest / "epic-games-launcher.png").read_bytes()) + libs = dest / "desktop/usr/lib/x86_64-linux-gnu" + self.assertEqual(b"webkit", (libs / "libwebkit2gtk-4.1.so.0").read_bytes()) + self.assertEqual(b"net", (libs / "webkit2gtk-4.1/WebKitNetworkProcess").read_bytes()) + self.assertEqual(b"schema", (dest / "desktop/usr/share/glib-2.0/schemas/org.gnome.GWeather4.gschema.xml").read_bytes()) + self.assertFalse((dest / "desktop/usr/share/doc").exists()) + self.assertFalse((self.state / "app/escape").exists()) + self.assertFalse((self.state / "app/0.113.0+g1.staging").exists()) + self.assertTrue(G["app_complete"](str(dest))) + self.assertEqual(str(dest / "usr/bin/EpicGamesLauncher"), G["app_command"](str(dest))) + self.assertEqual(str(libs), G["desktop_libs"](str(dest))) + + def test_archive_symlinks_cannot_redirect_the_desktop_layer_or_icon(self): + outside = self.tmp / "outside" + outside.mkdir() + dest = self.state / "app/0.113.0+g1" + escape = os.path.relpath(outside, Path(str(dest) + ".staging")) + launcher = self.launcher([("./desktop", {"link": escape}), + ("./epic-games-launcher.png", {"link": escape + "/target"})]) + with self.assertRaises(G["Failure"]) as caught: + G["extract_app"](str(launcher), str(dest), [str(self.webkit())]) + self.assertEqual("app-extract", str(caught.exception)) + self.assertFalse((outside / "usr").exists()) + self.assertFalse((outside / "target").exists()) + + icon_dest = self.state / "app/0.113.0+g2" + icon_escape = os.path.relpath(outside / "target", Path(str(icon_dest) + ".staging")) + G["extract_app"](str(self.launcher([("./epic-games-launcher.png", {"link": icon_escape})])), + str(icon_dest), [str(self.webkit())]) + self.assertEqual(b"png", (icon_dest / "epic-games-launcher.png").read_bytes()) + self.assertFalse((outside / "target").exists()) + + def test_a_launcher_without_its_desktop_layer_is_refused(self): + dest = self.state / "app/0.113.0+g1" + with self.assertRaises(G["Failure"]) as caught: + G["extract_app"](str(self.launcher()), str(dest)) + self.assertEqual("app-extract", str(caught.exception)) + self.assertFalse(dest.exists()) + self.assertFalse(Path(str(dest) + ".staging").exists()) + + def test_anything_but_a_deb_is_refused_and_leaves_nothing_behind(self): + image = self.tmp / "EpicGamesLauncher-x86_64.AppImage" + image.write_bytes(b"\x7fELF\x02\x01\x01\x00AI\x02" + bytes(64)) + dest = self.state / "app/0.95.2+g1" + with self.assertRaises(G["Failure"]) as caught: + G["extract_app"](str(image), str(dest), [str(self.webkit())]) + self.assertEqual("app-format", str(caught.exception)) + plain = self.tmp / "plain.deb" + plain.write_bytes(ar([("data.tar.gz", b"x")])) + with self.assertRaises(G["Failure"]) as caught: + G["extract_app"](str(self.launcher()), str(dest), [str(plain)]) + self.assertEqual("desktop-format", str(caught.exception)) + self.assertFalse(dest.exists()) + self.assertFalse(Path(str(dest) + ".staging").exists()) + + def test_an_installed_appimage_launcher_still_runs_through_apprun(self): + app = self.state / "app/0.95.2+g1" + (app / "usr/bin").mkdir(parents=True) + (app / "AppRun").write_text("run") + (app / "usr/bin/EpicGamesLauncher").write_text("bin") + self.assertTrue(G["app_complete"](str(app))) + self.assertEqual(str(app / "AppRun"), G["app_command"](str(app))) + self.assertIsNone(G["desktop_libs"](str(app))) + (app / "usr/bin/EpicGamesLauncher").unlink() + self.assertFalse(G["app_complete"](str(app))) + + def test_the_webkit_helpers_are_linked_into_the_runtime(self): + dest = self.state / "app/0.113.0+g1" + G["extract_app"](str(self.launcher()), str(dest), [str(self.webkit())]) + files = self.state / "runtime/4.0.1/files" + (files / "lib/x86_64-linux-gnu").mkdir(parents=True) + link = files / "lib/x86_64-linux-gnu/webkit2gtk-4.1" + G["link_webkit"](str(files), G["desktop_libs"](str(dest))) + self.assertFalse(os.path.isabs(os.readlink(link))) + self.assertEqual(b"net", (link / "WebKitNetworkProcess").read_bytes()) + G["link_webkit"](str(files), G["desktop_libs"](str(dest))) + self.assertEqual(b"net", (link / "WebKitNetworkProcess").read_bytes()) + G["link_webkit"](str(files), None) + self.assertFalse(os.path.lexists(link)) + link.mkdir() + (link / "own").write_text("x") + G["link_webkit"](str(files), G["desktop_libs"](str(dest))) + self.assertTrue((link / "own").is_file()) + self.assertTrue((dest / "desktop/usr/lib/x86_64-linux-gnu/webkit2gtk-4.1/WebKitNetworkProcess").is_file()) + + def test_only_the_deb_launcher_gets_the_desktop_libraries(self): + with mock.patch.dict(G, {"fex_environment": lambda fex, files, base: {}}): + plain = G["client_environment"]({"LD_LIBRARY_PATH": "/host"}, None, None, ":0", "bus", "broker") + layered = G["client_environment"]({}, None, None, ":0", "bus", "broker", libs="/app/desktop/usr/lib/x86_64-linux-gnu") + self.assertNotIn("LD_LIBRARY_PATH", plain) + self.assertEqual("/app/desktop/usr/lib/x86_64-linux-gnu", layered["LD_LIBRARY_PATH"]) + self.assertEqual("/app/desktop/usr/share:/usr/local/share:/usr/share", layered["XDG_DATA_DIRS"]) + self.assertEqual("/app/desktop/usr/share/glib-2.0/schemas", layered["GSETTINGS_SCHEMA_DIR"]) + + def test_every_desktop_package_reaches_the_install(self): + options, rest = G["parse_options"](["--app", "a.deb", "--desktop", "one.deb", "--desktop", "two.deb", "x"], lists=("desktop",)) + self.assertEqual({"app": "a.deb", "desktop": ["one.deb", "two.deb"]}, options) + self.assertEqual(["x"], rest) + self.assertEqual({"desktop": "two.deb"}, G["parse_options"](["--desktop", "one.deb", "--desktop", "two.deb"])[0]) + + class ArgumentsTest(EpicTestCase): def test_client_arguments_win_and_paths_become_windows_paths(self): ovt = self.tmp / "ovt" diff --git a/tools/tests/test_droiddeckctl.py b/tools/tests/test_droiddeckctl.py index c0fb5742b8..1f7e32cdff 100644 --- a/tools/tests/test_droiddeckctl.py +++ b/tools/tests/test_droiddeckctl.py @@ -213,6 +213,18 @@ class DroiddeckctlTest(FakeAdbTest): started = [e["args"] for e in self.calls() if e["args"][:3] == ["shell", "am", "start"]] self.assertIn("com.antutu.benchmark.full/com.droiddeck.launcher.agent.AgentStartActivity", started[0]) + def test_a_start_delivered_to_an_existing_task_is_a_failure(self): + output = (b"Starting: Intent { cmp=com.droiddeck.launcher/.agent.AgentStartActivity (has extras) }\n" + b"Warning: Activity not started, intent has been delivered to currently running top-most instance.\n" + b"Status: ok\nActivity: com.droiddeck.launcher/.FrontEndActivity\nComplete\n") + + def adb(_adb, _serial, *args, timeout=30): + return ctl.subprocess.CompletedProcess(args, 0, output, b"") + + with unittest.mock.patch.object(ctl, "run_adb", adb), self.assertRaises(ctl.ControlError) as caught: + ctl.start_agent_activity("adb", "fake-1", {"mode": "steam"}) + self.assertEqual("ACTIVITY_START_FAILED", caught.exception.code) + def test_a_malformed_package_is_refused_before_adb(self): with unittest.mock.patch.dict(os.environ, {"DROIDDECK_PACKAGE": "com.example;reboot"}): variant = load("droiddeckctl") @@ -291,7 +303,7 @@ class DroiddeckctlTest(FakeAdbTest): code, out = self.run_ctl("run", "/usr/bin/sh", "--", "-c", "true") self.assertEqual(7, code) self.assertEqual("AGENT_COMMANDS_DISABLED", out["error"]["code"]) - self.assertIn("Setup > Diagnostics > Debugging tools", out["error"]["message"]) + self.assertIn("Setup > Developer > Debugging tools", out["error"]["message"]) self.assertEqual(["access"], [c.get("method") for c in self.calls()]) def test_override_checks_names_before_pushing_any_file(self): @@ -417,12 +429,14 @@ class DroiddeckctlTest(FakeAdbTest): return ctl.subprocess.CompletedProcess(args, 127, b"", b"/system/bin/sh: content: inaccessible or not found") if args[:2] == ("shell", "am"): return ctl.subprocess.CompletedProcess(args, 0, b"Broadcast completed: result=0", b"") + if args[:2] == ("shell", "pidof " + ctl.PACKAGE): + return ctl.subprocess.CompletedProcess(args, 0, b"4940\n", b"") return ctl.subprocess.CompletedProcess(args, 0, next(answers), b"") with unittest.mock.patch.object(ctl, "run_adb", adb), unittest.mock.patch.object(ctl.time, "sleep"): answer = ctl.provider_call("adb", "fake-1", "state", arg="a b", request={"x": 1}) self.assertEqual({"ok": True, "command": "state"}, answer) - broadcast = calls[1] + broadcast = next(c for c in calls if c[:2] == ("shell", "am")) self.assertEqual(("shell", "am", "broadcast", "-a", ctl.PACKAGE + ".AGENT_CALL", "-p", ctl.PACKAGE), broadcast[:7]) self.assertIn("'a b'", broadcast) self.assertEqual(ctl.encode_request({"x": 1}), broadcast[broadcast.index("request") + 1]) @@ -823,5 +837,48 @@ class ScenarioTest(FakeAdbTest): self.assertEqual([{"appId": 7, "timeout": 15.0}] * 2, [c["request"] for c in self.calls("quit")]) +class ProviderFallbackTest(unittest.TestCase): + MISSING = "/system/bin/sh: content: inaccessible or not found\n" + + def adb(self, answers): + calls = [] + + def run(adb, serial, *args, timeout=None): + calls.append(args) + for prefix, (code, out, err) in answers: + if " ".join(args).startswith(" ".join(prefix)): + return unittest.mock.Mock(returncode=code, stdout=out.encode(), stderr=err.encode()) + raise AssertionError(f"unexpected adb call {args}") + return calls, unittest.mock.patch.object(ctl, "run_adb", run) + + def test_a_command_that_prints_the_shell_error_is_not_run_again(self): + result = 'Result: Bundle[{json={"ok":true,"stdout":{"text":"' + self.MISSING.strip() + '"}}}]' + calls, patch = self.adb([(["shell", "content"], (0, result, ""))]) + with patch: + self.assertTrue(ctl.provider_call("adb", "s", "native", request={"argv": ["x"]})["ok"]) + self.assertEqual(1, len(calls)) + + def test_a_shell_without_content_uses_the_broadcast(self): + calls, patch = self.adb([ + (["shell", "content"], (127, "", self.MISSING)), + (["shell", "pidof"], (0, "4940\n", "")), + (["shell", "am", "broadcast"], (0, "Broadcast completed", "")), + (["shell"], (0, '{"ok": true}', "")), + ]) + with patch: + self.assertTrue(ctl.provider_call("adb", "s", "state")["ok"]) + self.assertEqual(["shell", "am", "broadcast"], list(calls[2][:3])) + + def test_the_broadcast_needs_the_app_running(self): + calls, patch = self.adb([ + (["shell", "content"], (127, "", self.MISSING)), + (["shell", "pidof"], (1, "", "")), + ]) + with patch, self.assertRaises(ctl.ControlError) as raised: + ctl.provider_call("adb", "s", "state") + self.assertEqual("APP_NOT_RUNNING", raised.exception.code) + self.assertFalse(any(c[:3] == ("shell", "am", "broadcast") for c in calls)) + + if __name__ == "__main__": unittest.main() diff --git a/tools/tests/test_fastpath_fuse_dirs.py b/tools/tests/test_fastpath_fuse_dirs.py new file mode 100644 index 0000000000..b8b45f851a --- /dev/null +++ b/tools/tests/test_fastpath_fuse_dirs.py @@ -0,0 +1,314 @@ +import os +from pathlib import Path +import shutil +import subprocess +import tempfile +import unittest + +USERNS = shutil.which("unshare") is not None and subprocess.run(["unshare", "-Urm", "true"], capture_output=True).returncode == 0 + +FASTPATH = Path(__file__).resolve().parents[1] / "proot/fastpath/fastpath.c" + +PROGRAM = r""" +#include "FASTPATH" +#include + +static const char *race_from, *race_to; +static dev_t race_dev; +static ino_t race_ino; + +static long trapped_nr = -1, unsupported_nr = -1; + +static long host_sys(long nr, long a, long b, long c, long d, long e, long f) { + if (nr == trapped_nr || (nr == unsupported_nr && a != -1)) return -ENOSYS; + long r = syscall(nr, a, b, c, d, e, f); + struct stat fs; + if (r >= 0 && nr == SYS_fcntl && b == F_DUPFD_CLOEXEC && c == DIR_FD_FLOOR && race_from + && syscall(SYS_fstat, a, &fs) == 0 && fs.st_dev == race_dev && fs.st_ino == race_ino) { + syscall(SYS_renameat, AT_FDCWD, race_from, AT_FDCWD, race_to); + race_from = NULL; + } + return r < 0 ? -errno : r; +} + +static void show(long r) { + if (r == FP_SLOW) puts("SLOW"); + else if (r < 0) printf("E%ld\n", -r); + else puts("ok"); +} + +static int high_fds(void) { + int n = 0; + for (int fd = DIR_FD_FLOOR; fd < DIR_FD_FLOOR + 4 * DIRS; fd++) + if (fcntl(fd, F_GETFD) >= 0) n++; + return n; +} + +int main(int argc, char **argv) { + static char hosts[MAX_BINDS][PATH_MAX], guests[MAX_BINDS][512]; + static int taken[DIRS]; + int ntaken = 0; + fp_sys = host_sys; + snprintf(root, sizeof root, "%s", argv[1]); + rootlen = strlen(root); + int i = 2; + for (; i + 1 < argc && strcmp(argv[i], "--"); i += 2) { + struct bind *bd = &binds[nbinds]; + bd->host = hosts[nbinds]; + bd->guest = guests[nbinds]; + snprintf(bd->host, PATH_MAX, "%s", argv[i]); + snprintf(bd->guest, sizeof guests[0], "%s", argv[i + 1]); + bd->hlen = strlen(bd->host); + bd->glen = strlen(bd->guest); + nbinds++; + } + pthread_once(&init_once, fp_init); + fp_on = 1; + for (i++; i < argc; i++) { + const char *op = argv[i]; + if (!strcmp(op, "fuse")) { + for (int b = 0; b < nbinds; b++) binds[b].fuse = 1; + } else if (!strcmp(op, "touch")) { + long fd = fp_open(AT_FDCWD, argv[++i], O_CREAT | O_WRONLY | O_CLOEXEC, 0644); + if (fd >= 0) close((int)fd); + show(fd); + } else if (!strcmp(op, "stat")) { + struct stat st; + show(fp_stat(AT_FDCWD, argv[++i], AT_SYMLINK_NOFOLLOW, &st)); + } else if (!strcmp(op, "symlink")) { + long r = fp_symlink("target", AT_FDCWD, argv[++i]); + if (refused()) puts("REFUSED"); + else show(r); + } else if (!strcmp(op, "trap-symlink")) { + trapped_nr = SYS_symlinkat; + } else if (!strcmp(op, "no-symlinks")) { + unsupported_nr = SYS_symlinkat; + } else if (!strcmp(op, "on")) { + printf("%d\n", fp_ready()); + } else if (!strcmp(op, "no-folders")) { + unsupported_nr = SYS_mkdirat; + } else if (!strcmp(op, "busy-cache")) { + pthread_mutex_lock(&dir_lock); + } else if (!strcmp(op, "mkdir")) { + long r = fp_mkdir(AT_FDCWD, argv[++i], 0755); + if (refused()) puts("REFUSED"); + else show(r); + } else if (!strcmp(op, "mv")) { + show(fp_rename(AT_FDCWD, argv[i + 1], AT_FDCWD, argv[i + 2], 0)); + i += 2; + } else if (!strcmp(op, "rm")) { + show(fp_unlink(AT_FDCWD, argv[++i], 0)); + } else if (!strcmp(op, "host-mv")) { + show(host_sys(SYS_renameat, AT_FDCWD, (long)argv[i + 1], AT_FDCWD, (long)argv[i + 2], 0, 0)); + i += 2; + } else if (!strcmp(op, "race-mv")) { + struct stat rs; + race_from = argv[i + 1]; + race_to = argv[i + 2]; + i += 2; + show(host_sys(SYS_newfstatat, AT_FDCWD, (long)race_from, (long)&rs, 0, 0, 0)); + race_dev = rs.st_dev; + race_ino = rs.st_ino; + } else if (!strcmp(op, "host-rmdir")) { + show(host_sys(SYS_unlinkat, AT_FDCWD, (long)argv[++i], AT_REMOVEDIR, 0, 0, 0)); + } else if (!strcmp(op, "host-mkdir")) { + show(host_sys(SYS_mkdirat, AT_FDCWD, (long)argv[++i], 0755, 0, 0, 0)); + } else if (!strcmp(op, "clobber")) { + long null = host_sys(SYS_openat, AT_FDCWD, (long)"/dev/null", O_RDONLY, 0, 0, 0); + for (int fd = DIR_FD_FLOOR; fd < DIR_FD_FLOOR + DIRS; fd++) host_sys(SYS_dup3, null, fd, 0, 0, 0, 0); + host_sys(SYS_close, null, 0, 0, 0, 0, 0); + puts("ok"); + } else if (!strcmp(op, "first-fd")) { + char link[40], out[PATH_MAX]; + snprintf(link, sizeof link, "/proc/self/fd/%d", DIR_FD_FLOOR); + long n = host_sys(SYS_readlinkat, AT_FDCWD, (long)link, (long)out, sizeof out - 1, 0, 0); + out[n > 0 ? n : 0] = 0; + puts(out); + } else if (!strcmp(op, "fds")) { + printf("%d\n", high_fds()); + } else if (!strcmp(op, "ttl")) { + ttl_ns = atoll(argv[++i]) * 1000000LL; + } else if (!strcmp(op, "sleep")) { + usleep(atoi(argv[++i]) * 1000); + } else if (!strcmp(op, "chmod")) { + show(fp_chmod(AT_FDCWD, argv[i + 1], strtol(argv[i + 2], NULL, 8), 0)); + i += 2; + } else if (!strcmp(op, "host-mount")) { + show(mount("tmpfs", argv[++i], "tmpfs", 0, NULL) == 0 ? 0 : -errno); + } else if (!strcmp(op, "take-over")) { + for (int fd = DIR_FD_FLOOR; fd < DIR_FD_FLOOR + DIRS; fd++) { + char link[40], out[PATH_MAX]; + snprintf(link, sizeof link, "/proc/self/fd/%d", fd); + long n = host_sys(SYS_readlinkat, AT_FDCWD, (long)link, (long)out, sizeof out - 1, 0, 0); + if (n <= 0) continue; + out[n] = 0; + long mine = host_sys(SYS_openat, AT_FDCWD, (long)out, O_RDONLY | O_DIRECTORY, 0, 0, 0); + host_sys(SYS_dup3, mine, fd, 0, 0, 0, 0); + host_sys(SYS_close, mine, 0, 0, 0, 0, 0); + taken[ntaken++] = fd; + } + puts("ok"); + } else if (!strcmp(op, "taken")) { + int open_fds = 0; + for (int t = 0; t < ntaken; t++) + if (lseek(taken[t], 0, SEEK_CUR) == 0) open_fds++; + printf("%d/%d\n", open_fds, ntaken); + } + } + return 0; +} +""" + + +class FastPathFuseDirsTest(unittest.TestCase): + @classmethod + def setUpClass(cls): + if shutil.which("gcc") is None: + raise unittest.SkipTest("gcc is not available") + cls.build = tempfile.TemporaryDirectory() + source = Path(cls.build.name) / "fuse_dirs.c" + source.write_text(PROGRAM.replace("FASTPATH", str(FASTPATH))) + cls.program = Path(cls.build.name) / "fuse_dirs" + subprocess.run(["gcc", "-O1", "-Wall", "-Wextra", "-Werror", "-Wno-format-truncation", "-pthread", "-o", str(cls.program), str(source), "-ldl"], check=True) + + @classmethod + def tearDownClass(cls): + cls.build.cleanup() + + def setUp(self): + self.temp = tempfile.TemporaryDirectory() + self.addCleanup(self.temp.cleanup) + base = Path(self.temp.name) + self.root = base / "root" + (self.root / "mnt").mkdir(parents=True) + self.card = base / "card" + (self.card / "Games/steamapps/common/Game/Data").mkdir(parents=True) + + def ask(self, *ops, wrap=()): + argv = [*wrap, str(self.program), str(self.root), str(self.card), "/mnt/card", "--", *ops] + return subprocess.run(argv, capture_output=True, text=True, timeout=20, check=True).stdout.split() + + def test_files_deep_in_a_fuse_library_are_created_renamed_and_removed(self): + data = "/mnt/card/Games/steamapps/common/Game/Data" + out = self.ask("fuse", "touch", f"{data}/a.tmp", "mv", f"{data}/a.tmp", f"{data}/a.idx", + "stat", f"{data}/a.idx", "stat", f"{data}/a.tmp", "rm", f"{data}/a.idx", + "stat", f"{data}/a.idx", "fds") + self.assertEqual(["ok", "ok", "ok", "E2", "ok", "E2"], out[:-1]) + self.assertGreater(int(out[-1]), 0) + self.assertEqual([], list((self.card / "Games/steamapps/common/Game/Data").iterdir())) + + def test_a_folder_renamed_behind_the_cache_is_not_reused(self): + game = self.card / "Games/steamapps/common/Game" + (game / "Data/keep").write_text("x") + out = self.ask("fuse", "stat", "/mnt/card/Games/steamapps/common/Game/Data/keep", + "host-mv", str(game), str(game.parent / "Moved"), + "stat", "/mnt/card/Games/steamapps/common/Game/Data/keep", + "stat", "/mnt/card/Games/steamapps/common/Moved/Data/keep") + self.assertEqual(["ok", "ok", "E2", "ok"], out) + + def test_a_folder_renamed_while_it_is_opened_is_not_used_under_its_old_name(self): + game = self.card / "Games/steamapps/common/Game" + (game / "Data/keep").write_text("x") + out = self.ask("fuse", "race-mv", str(game / "Data"), str(game / "Moved"), + "stat", "/mnt/card/Games/steamapps/common/Game/Data/keep", + "touch", "/mnt/card/Games/steamapps/common/Game/Data/new", "fds") + self.assertEqual(["ok", "E2", "E2"], out[:3]) + self.assertEqual(["keep"], [p.name for p in (game / "Moved").iterdir()]) + self.assertLessEqual(int(out[-1]), 64) + + def test_a_folder_deleted_and_made_again_is_looked_up_fresh(self): + data = self.card / "Games/steamapps/common/Game/Data" + out = self.ask("fuse", "touch", "/mnt/card/Games/steamapps/common/Game/Data/old", + "rm", "/mnt/card/Games/steamapps/common/Game/Data/old", + "host-rmdir", str(data), "host-mkdir", str(data), + "touch", "/mnt/card/Games/steamapps/common/Game/Data/new") + self.assertEqual(["ok"] * 5, out) + self.assertEqual(["new"], [p.name for p in data.iterdir()]) + + def test_folders_deleted_and_made_again_many_times_keep_descriptors_bounded(self): + data = self.card / "Games/steamapps/common/Game/Data" + ops = ["fuse"] + for _ in range(200): + ops += ["touch", "/mnt/card/Games/steamapps/common/Game/Data/x", + "rm", "/mnt/card/Games/steamapps/common/Game/Data/x", + "host-rmdir", str(data), "host-mkdir", str(data)] + out = self.ask(*ops, "fds") + self.assertEqual(["ok"] * 800, out[:-1]) + self.assertLessEqual(int(out[-1]), 64) + + def test_descriptors_the_program_takes_over_are_left_alone(self): + data = "/mnt/card/Games/steamapps/common/Game/Data" + out = self.ask("fuse", "touch", f"{data}/a", "clobber", "touch", f"{data}/b", + "stat", f"{data}/a", "first-fd") + self.assertEqual(["ok", "ok", "ok", "ok", "/dev/null"], out) + self.assertEqual({"a", "b"}, {p.name for p in (self.card / "Games/steamapps/common/Game/Data").iterdir()}) + + def test_a_folder_the_program_opened_itself_stays_open_when_the_cache_moves_on(self): + data = self.card / "Games/steamapps/common/Game/Data" + ops = ["fuse", "touch", "/mnt/card/Games/steamapps/common/Game/Data/a", "take-over"] + for n in range(200): + (data / f"d{n}").mkdir() + ops += ["touch", f"/mnt/card/Games/steamapps/common/Game/Data/d{n}/x"] + out = self.ask(*ops, "taken") + self.assertEqual(["ok"] * 202, out[:-1]) + opened, total = map(int, out[-1].split("/")) + self.assertGreater(total, 0) + self.assertEqual(total, opened) + self.assertEqual(200, len(list(data.glob("d*/x")))) + + @unittest.skipIf(os.geteuid() == 0, "root passes folder permissions") + def test_a_parent_folder_closed_by_the_program_stops_cached_access_at_once(self): + game = self.card / "Games/steamapps/common/Game" + (game / "Data/keep").write_text("x") + self.addCleanup(os.chmod, game, 0o755) + out = self.ask("fuse", "stat", "/mnt/card/Games/steamapps/common/Game/Data/keep", + "chmod", "/mnt/card/Games/steamapps/common/Game", "000", + "stat", "/mnt/card/Games/steamapps/common/Game/Data/keep", + "touch", "/mnt/card/Games/steamapps/common/Game/Data/new") + self.assertEqual(["ok", "ok"], out[:2]) + self.assertNotIn("ok", out[2:]) + os.chmod(game, 0o755) + self.assertEqual(["keep"], [p.name for p in (game / "Data").iterdir()]) + + @unittest.skipUnless(USERNS, "mount namespaces are not available") + def test_a_mount_placed_over_a_cached_folder_receives_later_writes(self): + data = self.card / "Games/steamapps/common/Game/Data" + out = self.ask("fuse", "ttl", "1", "touch", "/mnt/card/Games/steamapps/common/Game/Data/under", + "host-mount", str(data), "sleep", "20", + "touch", "/mnt/card/Games/steamapps/common/Game/Data/over", + "stat", "/mnt/card/Games/steamapps/common/Game/Data/under", wrap=("unshare", "-Urm")) + self.assertEqual(["ok", "ok", "ok", "E2"], out) + self.assertEqual(["under"], [p.name for p in data.iterdir()]) + + def test_a_call_the_filesystem_does_not_implement_leaves_the_fast_path_on(self): + data = "/mnt/card/Games/steamapps/common/Game/Data" + out = self.ask("fuse", "no-symlinks", "touch", f"{data}/a", "symlink", f"{data}/link", "on", + "stat", f"{data}/a", "symlink", f"{data}/link", "on", "touch", f"{data}/b") + self.assertEqual(["ok", "REFUSED", "1", "ok", "REFUSED", "1", "ok"], out) + self.assertEqual(["a", "b"], sorted(p.name for p in (self.card / "Games/steamapps/common/Game/Data").iterdir())) + + def test_repeated_unsupported_calls_close_the_folders_they_opened(self): + data = "/mnt/card/Games/steamapps/common/Game/Data" + ops = [op for n in range(40) for op in ("mkdir", f"{data}/new{n}")] + out = self.ask("fuse", "no-folders", "busy-cache", *ops, "on", "fds") + self.assertEqual(["REFUSED"] * 40 + ["1", "0"], out) + + def test_a_trapped_call_still_stops_the_fast_path_for_the_process(self): + data = "/mnt/card/Games/steamapps/common/Game/Data" + out = self.ask("fuse", "trap-symlink", "symlink", f"{data}/link", "on") + self.assertEqual(["REFUSED", "0"], out) + + def test_a_symlink_is_made_where_the_filesystem_allows_it(self): + data = "/mnt/card/Games/steamapps/common/Game/Data" + out = self.ask("fuse", "symlink", f"{data}/link", "on") + self.assertEqual(["ok", "1"], out) + self.assertEqual("target", os.readlink(self.card / "Games/steamapps/common/Game/Data/link")) + + def test_other_filesystems_keep_absolute_paths_and_open_no_folders(self): + data = "/mnt/card/Games/steamapps/common/Game/Data" + out = self.ask("touch", f"{data}/a", "mv", f"{data}/a", f"{data}/b", "rm", f"{data}/b", "fds") + self.assertEqual(["ok", "ok", "ok", "0"], out) + + +if __name__ == "__main__": + unittest.main() diff --git a/tools/tests/test_game_environment.py b/tools/tests/test_game_environment.py index ce902817a0..04864df7f3 100644 --- a/tools/tests/test_game_environment.py +++ b/tools/tests/test_game_environment.py @@ -950,6 +950,22 @@ class GameEnvironmentTest(unittest.TestCase): self.assertEqual(MODULE["apply_config"](env, config, "42")["TU_DEBUG"], "sysmem") self.assertNotIn("TU_DEBUG", MODULE["apply_config"](env, config, "43")) + def test_games_run_with_gl_error_checks_unless_the_user_turns_them_off(self): + gpu = MODULE["game_gpu"] + session = {"MESA_NO_ERROR": "1", "DROIDDECK_GAME_MESA_NO_ERROR": "", "KEEP": "1"} + self.assertEqual(gpu(session), {"KEEP": "1"}) + self.assertEqual(gpu(session, True), {"MESA_NO_ERROR": "1", "KEEP": "1"}) + self.assertEqual(gpu({"MESA_NO_ERROR": "1"}), {"MESA_NO_ERROR": "1"}) + self.assertEqual(gpu({"MESA_NO_ERROR": "1", "DROIDDECK_GAME_MESA_NO_ERROR": "1"}), {"MESA_NO_ERROR": "1"}) + both = gpu({"MESA_NO_ERROR": "1", "DROIDDECK_GAME_MESA_NO_ERROR": "", "TU_DEBUG": "sysmem", "DROIDDECK_GAME_TU_DEBUG": "nolrz"}) + self.assertEqual(both, {"TU_DEBUG": "nolrz"}) + self.assertEqual(gpu({"TU_DEBUG": "sysmem", "DROIDDECK_GAME_TU_DEBUG": "", "MESA_NO_ERROR": "1"}), + {"MESA_NO_ERROR": "1"}) + config = {"version": 1, "games": {"42": {"MESA_NO_ERROR": "1"}}} + env = gpu(session) + self.assertEqual(MODULE["apply_config"](env, config, "42")["MESA_NO_ERROR"], "1") + self.assertNotIn("MESA_NO_ERROR", MODULE["apply_config"](env, config, "43")) + def test_a_chromium_app_keeps_the_sessions_turnip_debug(self): gpu = MODULE["game_gpu"] self.assertEqual(gpu({"TU_DEBUG": "sysmem", "DROIDDECK_GAME_TU_DEBUG": "", "KEEP": "1"}, True), @@ -992,9 +1008,11 @@ class GameEnvironmentTest(unittest.TestCase): def test_the_vram_cap_comes_before_the_games_own_dxvk_settings(self): cap = MODULE["vram_cap"] - self.assertEqual(cap({"BL_VRAM_MB": "4096"})["DXVK_CONFIG"], "dxgi.maxDeviceMemory = 4096") + self.assertEqual(cap({"BL_VRAM_MB": "4096"})["DXVK_CONFIG"], "dxgi.maxDeviceMemory = 4096; dxgi.maxSharedMemory = 4096") + self.assertEqual(cap({"BL_VRAM_MB": "8192"})["DXVK_CONFIG"], "dxgi.maxDeviceMemory = 8192; dxgi.maxSharedMemory = 8192") + self.assertEqual(cap({"BL_VRAM_MB": "4095"})["DXVK_CONFIG"], "dxgi.maxDeviceMemory = 4095; dxgi.maxSharedMemory = 4095; d3d9.maxAvailableMemory = 4095") self.assertEqual(cap({"BL_VRAM_MB": "2048", "DXVK_CONFIG": "dxvk.maxFrameRate = 60;"})["DXVK_CONFIG"], - "dxgi.maxDeviceMemory = 2048; dxvk.maxFrameRate = 60") + "dxgi.maxDeviceMemory = 2048; dxgi.maxSharedMemory = 2048; d3d9.maxAvailableMemory = 2048; dxvk.maxFrameRate = 60") for off in ({}, {"BL_VRAM_MB": "0"}, {"BL_VRAM_MB": "lots"}, {"BL_VRAM_MB": "ยฒ"}, {"BL_VRAM_MB": "-1"}): self.assertNotIn("DXVK_CONFIG", cap(off)) self.assertNotIn("DROIDDECK_VRAM_CAP", cap(off)) @@ -1124,6 +1142,23 @@ class GameEnvironmentTest(unittest.TestCase): scope = MODULE["game_id"](env) expected = "untouched" if scope is None else scope if scope in {"42", "4294967295", "2147483648"} else "*" self.assertEqual(target.read_text(), expected) + for app, expected in (("42", "42"), ("4294967295", "4294967295"), ("43", "*"), ("", "*"), ("x", "*")): + with self.subTest(shared=app): + env = dict(os.environ, HOME=str(root), STEAM_COMPAT_DATA_PATH="/steam/compatdata/2929927072", SteamAppId=app) + target.write_text("untouched") + subprocess.run(["bash", "-c", script, "test", str(base)], env=env, check=True, capture_output=True) + self.assertEqual(MODULE["game_id"](env), app if app in {"42", "4294967295", "43"} else "2929927072") + self.assertEqual(target.read_text(), expected) + for game, expected in ( + (str(42 << 32 | 0x02000000), "42"), (str(4294967295 << 32 | 0x02000000), "4294967295"), + (str(42 << 32 | 0x02000001), "*"), (str(42 << 32 | 0x02000000 | 1 << 64), "*"), ("33554432", "*"), ("x", "*"), + ): + with self.subTest(direct=game): + env = dict(os.environ, HOME=str(root), STEAM_COMPAT_DATA_PATH="/steam/compatdata/2929927072", SteamAppId="0", SteamGameId=game) + target.write_text("untouched") + subprocess.run(["bash", "-c", script, "test", str(base)], env=env, check=True, capture_output=True) + self.assertEqual(MODULE["game_id"](env), expected if expected != "*" else "2929927072") + self.assertEqual(target.read_text(), expected) def test_engine_fixes_follow_the_games_files(self): with tempfile.TemporaryDirectory() as tmp: @@ -1503,6 +1538,19 @@ class GameEnvironmentTest(unittest.TestCase): config = {"version": 1, "shared": {}, "games": {"42": values}} self.assertEqual(MODULE["apply_config"]({}, config, "42", env), values, name) + def test_ff7_rebirth_runs_at_feature_level_12_2_unless_the_game_overrides_it(self): + with tempfile.TemporaryDirectory() as tmp: + root = Path(tmp) / "FINAL FANTASY VII REBIRTH" + game = root / "End/Binaries/Win64/ff7rebirth_.exe" + game.parent.mkdir(parents=True) + for exe in (root / "ff7rebirth.exe", game): + exe.touch() + env, extra, notes = MODULE["engine_fixes"](str(exe), []) + self.assertEqual(env, {"VKD3D_FEATURE_LEVEL": "12_2"}, exe.name) + self.assertTrue(notes) + config = {"version": 1, "shared": {}, "games": {"42": {"VKD3D_FEATURE_LEVEL": "12_1"}}} + self.assertEqual(MODULE["apply_config"]({}, config, "42", env), {"VKD3D_FEATURE_LEVEL": "12_1"}) + def test_unity_players_keep_tso_over_the_preset(self): with tempfile.TemporaryDirectory() as tmp: def game(*names): @@ -1628,6 +1676,10 @@ class GameEnvironmentTest(unittest.TestCase): self.assertIsNone(MODULE["game_id"]({"STEAM_COMPAT_DATA_PATH": prefix})) self.assertEqual(MODULE["game_id"]({"STEAM_COMPAT_DATA_PATH": "/a/compatdata/42/"}), "42") self.assertEqual(MODULE["game_id"]({"STEAM_COMPAT_DATA_PATH": "/a/compatdata/-1"}), "4294967295") + shared = {"STEAM_COMPAT_DATA_PATH": "/a/compatdata/2929927072", "SteamAppId": "2424921676"} + self.assertEqual(MODULE["game_id"](shared), "2424921676") + self.assertEqual(MODULE["game_id"]({"STEAM_COMPAT_DATA_PATH": "/a/compatdata/2929927072"}), "2929927072") + self.assertEqual(MODULE["game_id"]({"STEAM_COMPAT_DATA_PATH": "/a/compatdata/42", "SteamAppId": "7"}), "42") def test_launch_reads_updates_preserves_argv_and_does_not_execute_values(self): with tempfile.TemporaryDirectory() as tmp: @@ -2717,6 +2769,17 @@ class ForeignSystemDllTest(unittest.TestCase): self.assertFalse((system32 / "ucrtbase.dll").is_symlink()) self.assertEqual(0x8664, MODULE["pe_machine"](system32 / "userlib.dll")) + def test_x64_visual_cpp_runtime_in_arm64_system32_is_kept(self): + with tempfile.TemporaryDirectory() as tmp: + proton, compat, windows = self.prefix(tmp) + builtins = proton.parent / "files/lib/wine/aarch64-windows" + for name in ("msvcp140.dll", "VCRUNTIME140.dll", "msvcp_win.dll"): + (builtins / name.lower()).write_bytes(pe_image(0xAA64)) + (windows / "system32" / name).write_bytes(pe_image(0x8664)) + self.assertEqual(["system32/msvcp_win.dll (machine 0x8664)"], self.run_repair(compat, proton)) + self.assertFalse((windows / "system32/msvcp140.dll").is_symlink()) + self.assertFalse((windows / "system32/VCRUNTIME140.dll").is_symlink()) + def test_final_arm64ec_image_is_not_repaired_as_a_foreign_x64_dll(self): with tempfile.TemporaryDirectory() as tmp: proton, compat, windows = self.prefix(tmp) diff --git a/tools/tests/test_game_gpu_launchers.py b/tools/tests/test_game_gpu_launchers.py index 09b3aef85a..b4ddd3cbf4 100644 --- a/tools/tests/test_game_gpu_launchers.py +++ b/tools/tests/test_game_gpu_launchers.py @@ -9,7 +9,7 @@ from pathlib import Path BIN = Path(__file__).resolve().parents[1] / "linuxfs/overlay/usr/local/bin" KEYS = ("TU_DEBUG", "DROIDDECK_GAME_TU_DEBUG", "MESA_LOADER_DRIVER_OVERRIDE", "GALLIUM_DRIVER", - "LIBGL_KOPPER_DRI2", "VK_ICD_FILENAMES", "VK_DRIVER_FILES") + "LIBGL_KOPPER_DRI2", "VK_ICD_FILENAMES", "VK_DRIVER_FILES", "MESA_NO_ERROR", "DROIDDECK_GAME_MESA_NO_ERROR") SESSION = {"TU_DEBUG": "sysmem", "DROIDDECK_GAME_TU_DEBUG": ""} GPU_SESSION = {"MESA_LOADER_DRIVER_OVERRIDE": "zink", "GALLIUM_DRIVER": "zink", "LIBGL_KOPPER_DRI2": "true", "VK_ICD_FILENAMES": "/runtime/turnip.json", @@ -68,6 +68,15 @@ class GameGpuLaunchersTest(unittest.TestCase): self.chromium() self.assertEqual("sysmem", self.wrapper("--for", str(self.app / "files"))["TU_DEBUG"]) + def test_programs_get_gl_error_checks_back_while_chromium_keeps_the_client_setting(self): + session = dict(GPU_SESSION, MESA_NO_ERROR="1", DROIDDECK_GAME_MESA_NO_ERROR="") + values = self.wrapper(session=session) + self.assertEqual(("unset", "unset"), (values["MESA_NO_ERROR"], values["DROIDDECK_GAME_MESA_NO_ERROR"])) + self.assertEqual(GPU_SESSION, {key: values[key] for key in GPU_SESSION}) + self.assertEqual("1", self.wrapper("--chromium", session=session)["MESA_NO_ERROR"]) + self.assertEqual("unset", self.flatpak(session)["MESA_NO_ERROR"]) + self.assertEqual("1", self.wrapper(session={"MESA_NO_ERROR": "1"})["MESA_NO_ERROR"]) + def test_without_the_game_setting_the_wrapper_changes_nothing(self): self.assertEqual("sysmem", self.wrapper(session={"TU_DEBUG": "sysmem"})["TU_DEBUG"]) self.assertEqual("unset", self.wrapper(session={})["TU_DEBUG"]) diff --git a/tools/tests/test_game_resolution.py b/tools/tests/test_game_resolution.py new file mode 100644 index 0000000000..78c5fb3d98 --- /dev/null +++ b/tools/tests/test_game_resolution.py @@ -0,0 +1,53 @@ +import os +from pathlib import Path +import subprocess +import tempfile +import unittest + + +SESSION = Path(__file__).resolve().parents[1] / 'linuxfs/overlay/usr/local/bin/droiddeck-session' + + +class GameResolutionTest(unittest.TestCase): + def launch(self, mode, **overrides): + source = SESSION.read_text() + start = source.index(' width=${BL_WIDTH:-1280}') + end = source.index('\nfi\n\nbl_displays()', start) + block = source[start:end].replace('/usr/local/bin/droiddeck-pipewire', 'pipewire_stub') + with tempfile.TemporaryDirectory() as directory: + env = dict(os.environ, XDG_RUNTIME_DIR=directory, BL_REFRESH='60', BL_MANGOAPP='0', + BL_WIDTH='2560', BL_HEIGHT='1600') + for name in ('BL_GAME_WIDTH', 'BL_GAME_HEIGHT', 'BL_FOLLOW_OUTPUT', 'BL_GAMESCOPE_STRETCH_16X9'): + env.pop(name, None) + env.update(overrides) + fake = Path(directory) / 'gamescope' + fake.write_text('#!/bin/bash\nprintf "ARG:%s\\n" "$@"\n') + fake.chmod(0o755) + env['PATH'] = directory + os.pathsep + env['PATH'] + script = f''' +set -u +mode={mode} +pipewire_stub() {{ return 1; }} +run_gamescope() {{ printf 'ARG:%s\n' "$@"; }} +''' + block + result = subprocess.run(['bash', '-c', script], env=env, capture_output=True, text=True, timeout=5) + self.assertEqual(0, result.returncode, result.stderr) + return [line.removeprefix('ARG:') for line in result.stdout.splitlines() if line.startswith('ARG:')] + + def test_a_game_started_without_steam_runs_at_its_resolution_with_proportions_kept(self): + args = self.launch('run', BL_GAME_WIDTH='1280', BL_GAME_HEIGHT='720') + self.assertEqual(['2560', '1600'], [args[args.index('-W') + 1], args[args.index('-H') + 1]]) + self.assertEqual(['1280', '720'], [args[args.index('-w') + 1], args[args.index('-h') + 1]]) + self.assertNotIn('-S', args) + + def test_without_a_game_resolution_the_game_matches_the_output(self): + args = self.launch('run') + self.assertEqual(['2560', '1600'], [args[args.index('-w') + 1], args[args.index('-h') + 1]]) + + def test_steam_ignores_the_game_resolution(self): + args = self.launch('steam', BL_GAME_WIDTH='1280', BL_GAME_HEIGHT='720') + self.assertEqual(['2560', '1600'], [args[args.index('-w') + 1], args[args.index('-h') + 1]]) + + +if __name__ == '__main__': + unittest.main() diff --git a/tools/tests/test_memory_pressure.py b/tools/tests/test_memory_pressure.py index 13f9e2f8d3..01c32c3f82 100644 --- a/tools/tests/test_memory_pressure.py +++ b/tools/tests/test_memory_pressure.py @@ -2,7 +2,7 @@ from pathlib import Path import tempfile import unittest -from tools.tests.test_client_zram_focus import function_source, run_bash +from tools.tests.test_client_zram_focus import SCRIPT, function_source, run_bash class MemoryPressureTest(unittest.TestCase): @@ -20,8 +20,8 @@ class MemoryPressureTest(unittest.TestCase): def run_policy(self, body): functions = '\n'.join(function_source(name) for name in ( - 'bl_memory_read', 'bl_memory_tight', 'bl_client_can_pageout', - 'bl_client_can_readback', 'bl_client_pressure')) + 'bl_memory_read', 'bl_memory_tight', 'bl_memory_critical', 'bl_client_can_pageout', + 'bl_client_can_readback', 'bl_client_pressure', 'bl_client_pressure_result', 'bl_zram_has_room')) functions = functions.replace('/proc/meminfo', str(self.root / 'meminfo')) functions = functions.replace('/proc/pressure/memory', str(self.root / 'pressure')) harness = ''' @@ -29,7 +29,7 @@ set -u _bl_pids=(123) _bl_game=1 _bl_packed=-1 _bl_pressure_at=-1 _bl_pressure_backoff=30 rss=$((384 * 1024)) client_swap=$((512 * 1024)) reclaimed=$((128 * 1024)) step() { :; } -bl_zram_usage() { _bl_rss=$rss _bl_swap=$client_swap; } +bl_zram_usage() { _bl_rss=$rss _bl_anon=${anon:-$rss} _bl_swap=$client_swap; } bl_zram_send() { echo "send:$1:$3"; rss=$((rss - reclaimed)); _bl_pageout_complete=${pageout_complete:-1}; } ''' + functions + '\nbl_memory_read\n' + body result = run_bash('NOW=0\n' + harness.replace('SECONDS', 'NOW')) @@ -80,6 +80,13 @@ if bl_client_can_readback; then echo yes; else echo no; fi self.assertEqual(['no'], self.run_policy(''' bl_client_pressure if bl_client_can_pageout; then echo yes; else echo no; fi +''')) + + def test_client_swap_budget_excludes_file_backed_memory(self): + self.memory(swap_free=1536) + self.assertEqual(['send:1:client'], self.run_policy(''' +rss=$((2048 * 1024)) anon=$((256 * 1024)) +bl_client_pressure ''')) def test_without_swap_automatic_pageout_is_disabled(self): @@ -152,20 +159,20 @@ class SessionPressureTest(unittest.TestCase): def run_policy(self, body): functions = '\n'.join(function_source(name) for name in ( - 'bl_memory_read', 'bl_memory_tight', 'bl_memory_critical', 'bl_low_ram', - 'bl_session_pressure', 'bl_watch_nap', 'bl_zram_pick', 'bl_tier_note', 'bl_tier_readback')) + 'bl_memory_read', 'bl_memory_tight', 'bl_memory_critical', + 'bl_session_pressure', 'bl_zram_has_room', 'bl_watch_nap', 'bl_zram_pick', 'bl_tier_note', 'bl_tier_readback')) functions = functions.replace('/proc/meminfo', str(self.root / 'meminfo')) functions = functions.replace('/proc/pressure/memory', str(self.root / 'pressure')) harness = ''' set -u _bl_game=1 _bl_tier_at=-1 _bl_tier_backoff=30 _bl_tier_pushed=0 _bl_tier_back=0 _bl_tier_targets=() _bl_tier_swaps=() _bl_tier_starts=() _bl_pids=(999) _bl_pressure_at=-1 _bl_packed=-1 -rss=$((1536 * 1024)) swap=0 pushed=$((1024 * 1024)) alive=999 started=100 complete=1 +rss=$((1536 * 1024)) swap=0 pushed=$((1024 * 1024)) alive="999 321 654" started=100 complete=1 step() { :; } bl_proc_start() { _bl_start=; case " $alive " in *" $1 "*) _bl_start=$started; return 0 ;; esac; return 1; } nap() { echo "nap:$1"; } bl_session_others() { _bl_session=(321 654); } -bl_zram_usage() { _bl_rss=$rss _bl_swap=$swap; } +bl_zram_usage() { _bl_rss=$rss _bl_anon=${anon:-$rss} _bl_swap=$swap; } bl_zram_send() { echo "send:$1:$3"; rss=$((rss - pushed)); swap=$((swap + pushed)); _bl_pageout_complete=$complete; } ''' + functions + '\nbl_memory_read\n' + body result = run_bash('NOW=0\n' + harness.replace('SECONDS', 'NOW')) @@ -174,19 +181,27 @@ bl_zram_send() { echo "send:$1:$3"; rss=$((rss - pushed)); swap=$((swap + pushed return result.stdout.splitlines() def test_low_headroom_compresses_the_game_session_at_most_every_30_seconds(self): - self.assertEqual(['send:1:game', 'send:1:game'], self.run_policy(''' + self.assertEqual(['send:1:session', 'send:1:session'], self.run_policy(''' SECONDS=0; bl_session_pressure SECONDS=10; bl_session_pressure SECONDS=29; bl_session_pressure SECONDS=30; bl_session_pressure ''')) - def test_twelve_gigabyte_devices_are_included_and_larger_ones_are_not(self): - for total, expected in ((11264, ['send:1:game']), (12288, ['send:1:game']), (15360, [])): + def test_pressure_policy_is_independent_of_ram_size(self): + for total, expected in ((11264, ['send:1:session']), (12288, ['send:1:session']), (16384, ['send:1:session'])): with self.subTest(total=total): self.memory(total=total) self.assertEqual(expected, self.run_policy('bl_session_pressure')) + def test_large_device_with_real_headroom_does_not_reclaim(self): + self.memory(total=16384, available=5120, psi='12.34') + self.assertEqual([], self.run_policy('bl_session_pressure')) + + def test_large_device_with_psi_and_moderate_headroom_reclaims(self): + self.memory(total=16384, available=3072, psi='1.23') + self.assertEqual(['send:1:session'], self.run_policy('bl_session_pressure')) + def test_no_game_does_not_compress_the_session(self): self.assertEqual([], self.run_policy('_bl_game=0; bl_session_pressure')) @@ -196,15 +211,26 @@ SECONDS=30; bl_session_pressure def test_stalls_with_moderate_headroom_compress_before_the_hard_limit(self): self.memory(available=2048, psi='1.50') - self.assertEqual(['send:1:game'], self.run_policy('bl_session_pressure')) + self.assertEqual(['send:1:session'], self.run_policy('bl_session_pressure')) def test_moderate_headroom_without_stalls_waits(self): self.memory(available=2048) self.assertEqual([], self.run_policy('bl_session_pressure')) + def test_same_second_memory_read_preserves_the_pressure_baseline(self): + self.memory(available=2048) + meminfo = self.root / 'meminfo' + self.assertEqual(['1048576:524288:2097152'], self.run_policy(f''' +SECONDS=100 +_bl_sample_at=100 _bl_sample_available=2097152 _bl_growth=0 _bl_fall=524288 +sed -i 's/MemAvailable: 2097152 kB/MemAvailable: 1048576 kB/' {meminfo} +bl_memory_read +echo "$_bl_available:$_bl_fall:$_bl_sample_available" +''')) + def test_game_reading_back_most_of_a_pageout_skips_and_doubles_the_wait(self): - self.assertEqual(['send:1:game', 'backoff:60', 'send:1:game', 'backoff:60', - 'send:1:game', 'backoff:30'], self.run_policy(''' + self.assertEqual(['send:1:session', 'backoff:60', 'send:1:session', 'backoff:60', + 'send:1:session', 'backoff:30'], self.run_policy(''' pushed=$((512 * 1024)) SECONDS=0; bl_session_pressure swap=$((swap / 4)) @@ -226,7 +252,7 @@ echo "backoff:$_bl_tier_backoff" def test_nearly_out_of_memory_ignores_the_backoff_but_keeps_30_seconds(self): self.memory(available=512) - self.assertEqual(['send:1:game', 'send:1:game'], self.run_policy(''' + self.assertEqual(['send:1:session', 'send:1:session'], self.run_policy(''' _bl_tier_backoff=300 SECONDS=0; bl_session_pressure SECONDS=20; bl_session_pressure @@ -235,7 +261,7 @@ SECONDS=30; bl_session_pressure def test_nearly_out_of_memory_still_backs_off_when_the_game_reads_its_pageout_back(self): self.memory(available=512) - self.assertEqual(['send:1:game', 'backoff:60', 'send:1:game'], self.run_policy(''' + self.assertEqual(['send:1:session', 'backoff:60', 'send:1:session'], self.run_policy(''' SECONDS=0; bl_session_pressure swap=0 SECONDS=30; bl_session_pressure @@ -247,7 +273,7 @@ SECONDS=90; bl_session_pressure def test_nearly_out_of_memory_retries_a_skipped_pageout_after_30_seconds(self): self.memory(available=512) - self.assertEqual(['send:1:game', 'send:1:game'], self.run_policy(''' + self.assertEqual(['send:1:session', 'send:1:session'], self.run_policy(''' SECONDS=0; bl_session_pressure swap=0 SECONDS=30; bl_session_pressure @@ -263,6 +289,24 @@ SECONDS=360; bl_session_pressure self.memory(swap_free=1536, swap_total=2048) self.assertEqual([], self.run_policy('bl_session_pressure')) + def test_file_backed_resident_memory_does_not_consume_the_swap_budget(self): + self.memory(swap_free=3088, swap_total=6144) + self.assertEqual(['send:1:session'], self.run_policy(''' +rss=$((4096 * 1024)) anon=$((1024 * 1024)) +bl_session_pressure +''')) + + def test_anonymous_memory_and_pending_client_still_need_the_full_swap_reserve(self): + self.memory(swap_free=3088, swap_total=6144) + self.assertEqual([], self.run_policy(''' +rss=$((4096 * 1024)) anon=$((2048 * 1024)) +bl_session_pressure +''')) + self.assertEqual([], self.run_policy(''' +rss=$((4096 * 1024)) anon=$((1536 * 1024)) _bl_client_reserve=$((512 * 1024)) +bl_session_pressure +''')) + def test_small_session_is_left_alone(self): self.assertEqual([], self.run_policy('rss=$((128 * 1024)); bl_session_pressure')) @@ -275,10 +319,10 @@ SECONDS=360; bl_session_pressure self.assertEqual(['nap:5'], self.run_policy('bl_watch_nap')) self.assertEqual(['nap:5'], self.run_policy('_bl_game=0; bl_watch_nap')) - def test_one_push_compresses_the_game_and_the_launcher_and_restarts_the_launcher_wait(self): - self.assertEqual(['send:1:game', 'pids:321 654 999', 'client:0:0'], self.run_policy(''' + def test_session_push_preserves_client_timestamps(self): + self.assertEqual(['send:1:session', 'pids:321 654', 'client:-1:-1'], self.run_policy(''' SECONDS=0; bl_session_pressure -bl_zram_pick game; echo "pids:${_pids[*]}" +bl_zram_pick session; echo "pids:${_pids[*]}" echo "client:$_bl_pressure_at:$_bl_packed" ''')) @@ -286,19 +330,19 @@ echo "client:$_bl_pressure_at:$_bl_packed" self.assertEqual(['pids:321 654', 'client:-1:-1'], self.run_policy(''' BL_ZRAM_CLIENT=0 SECONDS=0; bl_session_pressure -bl_zram_pick game; echo "pids:${_pids[*]}" +bl_zram_pick session; echo "pids:${_pids[*]}" echo "client:$_bl_pressure_at:$_bl_packed" ''')[1:]) def test_low_ram_devices_compress_with_a_quarter_of_memory_left(self): self.memory(available=1700) - self.assertEqual(['send:1:game'], self.run_policy('bl_session_pressure')) + self.assertEqual(['send:1:session'], self.run_policy('bl_session_pressure')) self.memory(available=1900) self.assertEqual([], self.run_policy('bl_session_pressure')) def test_a_compressed_process_that_exits_is_not_counted_as_read_back(self): - self.assertEqual(['send:1:game', 'send:1:game', 'backoff:30'], self.run_policy(''' + self.assertEqual(['send:1:session', 'send:1:session', 'backoff:30'], self.run_policy(''' SECONDS=0; bl_session_pressure alive=""; swap=0 SECONDS=30; bl_session_pressure @@ -306,7 +350,7 @@ echo "backoff:$_bl_tier_backoff" ''')) def test_a_process_that_starts_after_a_pageout_is_not_in_its_read_back(self): - self.assertEqual(['send:1:game', 'targets:999', 'send:1:game', 'backoff:30'], self.run_policy(''' + self.assertEqual(['send:1:session', 'targets:321 654', 'send:1:session', 'backoff:30'], self.run_policy(''' SECONDS=0; bl_session_pressure echo "targets:${_bl_tier_targets[*]}" alive="999 1234" @@ -315,7 +359,7 @@ echo "backoff:$_bl_tier_backoff" ''')) def test_an_incomplete_pageout_does_not_restart_the_launcher_wait(self): - self.assertEqual(['send:1:game', 'client:-1:-1'], self.run_policy(''' + self.assertEqual(['send:1:session', 'client:-1:-1'], self.run_policy(''' complete=0 SECONDS=0; bl_session_pressure echo "client:$_bl_pressure_at:$_bl_packed" @@ -323,7 +367,7 @@ echo "client:$_bl_pressure_at:$_bl_packed" def test_a_reused_process_id_is_not_counted_as_read_back(self): - self.assertEqual(['send:1:game', 'send:1:game', 'backoff:30'], self.run_policy(''' + self.assertEqual(['send:1:session', 'send:1:session', 'backoff:30'], self.run_policy(''' SECONDS=0; bl_session_pressure started=200; swap=0 SECONDS=30; bl_session_pressure @@ -344,5 +388,112 @@ echo "backoff:$_bl_tier_backoff" self.assertEqual(['gone'], result.stdout.split()) +class ReclaimDispatchTest(unittest.TestCase): + def run_cycle(self, client=1, game=1, anonymous=384, complete=1, reclaimed=128, body=None, available=1024, fall=0, tick=0): + with tempfile.TemporaryDirectory() as directory: + root = Path(directory) + (root / 'meminfo').write_text( + f'MemTotal: 7340032 kB\nMemAvailable: {available * 1024} kB\n' + 'SwapTotal: 6291456 kB\nSwapFree: 4194304 kB\n') + (root / 'pressure').write_text('some avg10=0.00 avg60=0.00 avg300=0.00 total=0\n') + names = ('bl_memory_read', 'bl_memory_tight', 'bl_memory_critical', + 'bl_zram_has_room', 'bl_client_can_pageout', 'bl_client_pressure', + 'bl_client_pressure_result', 'bl_client_pressure_finish', + 'bl_session_pressure', 'bl_zram_send', 'bl_zram_finish', 'bl_zram_pick') + source = '\n'.join(function_source(name) for name in names) + source = source.replace('/proc/meminfo', str(root / 'meminfo')) + source = source.replace('/proc/pressure/memory', str(root / 'pressure')) + source = source.replace('/tmp/.bl-zram', str(root / 'ctl')) + monitor = SCRIPT.read_text() + start = monitor.index(' _bl_preserved_growth=$_bl_growth', monitor.index('while kill -0 $$')) + stop = monitor.index(' if [ "$_bl_game" = 1 ] && bl_game_focused', start) + cycle = monitor[start:stop] if body is None else body + script = f''' +set -u +BL_ZRAM_CLIENT={client} _bl_game={game} _bl_pids=(123) _bl_others=(321) +_bl_pressure_at=-1 _bl_pressure_backoff=30 _bl_packed=-1 +_bl_tier_at=-1 _bl_tier_backoff=30 _bl_tier_pushed=0 +_bl_client_reserve=0 client_rss=393216 client_anon={anonymous * 1024} +step() {{ :; }} +bl_session_others() {{ _bl_session=(321); }} +bl_zram_scan() {{ _bl_pids=(456); }} +nap() {{ echo "nap:$*:at:$NOW"; }} +bl_zram_usage() {{ + if [ "$1" = 123 ]; then + _bl_rss=$client_rss _bl_anon=$client_anon _bl_swap=0 + else + _bl_rss=3145728 _bl_anon=1572864 _bl_swap=0 + fi +}} +kill() {{ echo "signal:$*:at:$NOW"; NOW=$((NOW + {tick})); }} +bl_zram_wait() {{ + echo "wait:$*:at:$NOW" + NOW=$((NOW + 12)) + _bl_pageout_complete={complete} + [ "$1" != 123 ] || client_rss=$((client_rss - {reclaimed * 1024})) +}} +bl_tier_note() {{ :; }} +''' + source + f''' +bl_memory_read +_bl_fall={fall * 1024} +''' + cycle + ''' +echo "client:$_bl_pressure_backoff:${_bl_client_reserve:-0}:${_bl_client_pending:-0}" +''' + result = run_bash('NOW=0\n' + script.replace('SECONDS', 'NOW')) + self.assertEqual(0, result.returncode, result.stderr) + self.assertEqual('', result.stderr) + return result.stdout.splitlines() + + def test_both_requests_are_sent_before_either_wait(self): + self.assertEqual(['signal:-URG 123:at:0', 'signal:-URG 321:at:0', + 'wait:321:at:0', 'wait:123:at:12', 'client:30:0:0'], self.run_cycle()) + + def test_disabled_client_is_never_signalled_or_waited_for(self): + self.assertEqual(['signal:-URG 321:at:0', 'wait:321:at:0', 'client:30:0:0'], + self.run_cycle(client=0)) + + def test_no_game_requests_nothing(self): + self.assertEqual(['client:30:0:0'], self.run_cycle(game=0)) + + def test_a_client_with_no_anonymous_pages_still_finishes_its_request(self): + self.assertEqual(['signal:-URG 123:at:0', 'signal:-URG 321:at:0', + 'wait:321:at:0', 'wait:123:at:12', 'client:30:0:0'], + self.run_cycle(anonymous=0)) + + def test_falling_headroom_survives_a_tick_between_requests(self): + self.assertEqual(['signal:-URG 123:at:0', 'signal:-URG 321:at:1', + 'wait:321:at:2', 'wait:123:at:14', 'client:30:0:0'], + self.run_cycle(available=2304, fall=512, tick=1)) + + def test_deferred_ineffective_reclaim_still_doubles_the_backoff(self): + self.assertEqual('client:60:0:0', self.run_cycle(reclaimed=0)[-1]) + + def test_deferred_incomplete_reclaim_does_not_double_the_backoff(self): + self.assertEqual('client:30:0:0', self.run_cycle(reclaimed=0, complete=0)[-1]) + + def test_explicit_combined_send_keeps_its_synchronous_wait(self): + self.assertEqual(['signal:-URG 321 123:at:0', 'wait:321 123:at:0', 'client:30:0:0'], + self.run_cycle(body='bl_zram_send 1 cap game\n')) + self.assertEqual(['signal:-URG 321:at:0', 'wait:321:at:0', 'client:30:0:0'], + self.run_cycle(client=0, body='bl_zram_send 1 cap game\n')) + + def test_readback_keeps_its_synchronous_delay(self): + self.assertEqual(['signal:-URG 123:at:0', 'nap:5:at:0', 'client:30:0:0'], + self.run_cycle(body='bl_zram_send 0 readback client\n')) + + def test_usage_sums_anonymous_rss_and_falls_back_per_process(self): + with tempfile.TemporaryDirectory() as directory: + root = Path(directory) + for pid, contents in ((123, 'VmRSS: 2000 kB\nRssAnon: 300 kB\nVmSwap: 100 kB\n'), + (321, 'VmRSS: 4000 kB\nVmSwap: 200 kB\n'), + (654, 'VmRSS: 1000 kB\nRssAnon: 0 kB\n')): + (root / str(pid)).mkdir() + (root / str(pid) / 'status').write_text(contents) + source = function_source('bl_zram_usage').replace('/proc/', str(root) + '/') + result = run_bash(source + '\nbl_zram_usage 123 321 654 > /dev/null; echo "$_bl_rss:$_bl_anon:$_bl_swap"') + self.assertEqual(0, result.returncode, result.stderr) + self.assertEqual('7000:4300:300', result.stdout.strip()) + + if __name__ == '__main__': unittest.main() diff --git a/tools/tests/test_native_hook_mounts.py b/tools/tests/test_native_hook_mounts.py new file mode 100644 index 0000000000..ff46a0fa18 --- /dev/null +++ b/tools/tests/test_native_hook_mounts.py @@ -0,0 +1,224 @@ +import os +from pathlib import Path +import subprocess +import tempfile +import unittest + +from tools.tests.test_usr2_preload import runner + +HOOK_BUILD = Path(__file__).resolve().parents[1] / "nativeguest/build.sh" + +PROBE = r""" +#include +#include +#include +#include +#include +#include + +int main(int argc, char **argv) { + char cwd[4096]; + for (int i = 1; i < argc; i++) { + struct stat st; + if (strncmp(argv[i], "cd:", 3) == 0) { + int ok = chdir(argv[i] + 3) == 0 && getcwd(cwd, sizeof(cwd)) != NULL; + printf("%s\t%s\n", argv[i], ok ? cwd : "-"); + continue; + } + if (strncmp(argv[i], "at:", 3) == 0) { + int dfd = open(argv[i] + 3, O_RDONLY | O_DIRECTORY); + printf("%s\t%d\t%d\n", argv[i], fstatat(AT_FDCWD, argv[i] + 3, &st, 0) == 0, dfd >= 0); + if (dfd >= 0) close(dfd); + continue; + } + if (strncmp(argv[i], "ls:", 3) == 0) { + DIR *dir = opendir(argv[i] + 3); + char names[1024] = ""; + struct dirent *de; + while (dir && (de = readdir(dir)) != NULL) { + if (de->d_name[0] == '.') continue; + if (names[0]) strncat(names, ",", sizeof(names) - strlen(names) - 1); + strncat(names, de->d_name, sizeof(names) - strlen(names) - 1); + } + if (dir) closedir(dir); + printf("%s\t%s\n", argv[i], dir ? names : "-"); + continue; + } + int fd = open(argv[i], O_RDONLY); + char data[64] = "-"; + if (fd >= 0) { + ssize_t n = read(fd, data, sizeof(data) - 1); + data[n > 0 ? n : 0] = 0; + close(fd); + } + printf("%s\t%d\t%s\n", argv[i], stat(argv[i], &st) == 0, data); + } + return 0; +} +""" + +GAME = "/mnt/library/Some Game" + + +class NativeHookMountTest(unittest.TestCase): + @classmethod + def setUpClass(cls): + cls.cc, cls.prefix = runner() + if cls.cc is None: + raise unittest.SkipTest("no aarch64 compiler and runner") + cls.tmp = tempfile.TemporaryDirectory() + tmp = Path(cls.tmp.name) + cls.hook = tmp / "hook.so" + subprocess.run(["bash", str(HOOK_BUILD), str(cls.hook), cls.cc], check=True, capture_output=True) + (tmp / "probe.c").write_text(PROBE) + subprocess.run([cls.cc, "-O1", "-o", str(tmp / "probe"), str(tmp / "probe.c")], check=True) + cls.probe = tmp / "probe" + cls.root = tmp / "root" + cls.library = tmp / "storage/PC GAMES" + (cls.root / "etc").mkdir(parents=True) + (cls.root / "etc/hostname").write_text("rootfs") + (cls.root / "mnt/library/Some Game").mkdir(parents=True) + (cls.root / "mnt/library/Some Game/game.txt").write_text("mount point") + (cls.library / "Some Game").mkdir(parents=True) + (cls.library / "Some Game/game.txt").write_text("library") + for name, target in (("native", str(cls.root)), ("guest", "/")): + devices = cls.root / "pfx" / name / "dosdevices" + devices.mkdir(parents=True) + os.symlink(target, devices / "z:") + relinked = cls.root / "pfx/relinked" + (relinked / "dosdevices").mkdir(parents=True) + (relinked / "drive_c").mkdir() + (relinked / "drive_c/c.txt").write_text("drive c") + os.symlink(os.path.relpath(cls.root, relinked / "dosdevices"), relinked / "dosdevices/z:") + os.symlink("../drive_c", relinked / "dosdevices/c:") + copied = cls.root / "pfx/copied/dosdevices" + copied.mkdir(parents=True) + os.symlink("../" * 12 + "..", copied / "z:") + elsewhere = tmp / "elsewhere" + (elsewhere / "outside/pfx/dosdevices").mkdir(parents=True) + (elsewhere / "mnt/library/Some Game").mkdir(parents=True) + (elsewhere / "mnt/library/Some Game/game.txt").write_text("elsewhere") + os.symlink("../../..", elsewhere / "outside/pfx/dosdevices/z:") + os.symlink(str(elsewhere / "outside/pfx"), cls.root / "pfx/outside") + cls.private = tmp / "private" + private_pfx = cls.private / "123/pfx/dosdevices" + private_pfx.mkdir(parents=True) + os.symlink(os.path.relpath("/", "/mnt/private/123/pfx/dosdevices"), private_pfx / "z:") + private_copy = cls.private / "456/pfx/dosdevices" + private_copy.mkdir(parents=True) + os.symlink("../" * 12 + "..", private_copy / "z:") + cls.eqlen_src = tmp / "eqsrcdir" + cls.eqlen_dst = "/" + "d" * (len(str(cls.eqlen_src)) - 1) + eqlen_pfx = cls.eqlen_src / "123/pfx/dosdevices" + eqlen_pfx.mkdir(parents=True) + os.symlink(os.path.relpath("/", f"{cls.eqlen_dst}/123/pfx/dosdevices"), eqlen_pfx / "z:") + + @classmethod + def tearDownClass(cls): + cls.tmp.cleanup() + + def run_probe(self, *args): + binds = f"{self.library}:/mnt/library|{self.private}:/mnt/private|{self.eqlen_src}:{self.eqlen_dst}" + hook_env = {"DDNATV_ROOT": str(self.root), "DDNATV_BINDS": binds, "LD_PRELOAD": str(self.hook)} + env = {k: v for k, v in os.environ.items() if k != "LD_PRELOAD"} + if self.prefix: + cmd = list(self.prefix) + [arg for key, value in hook_env.items() for arg in ("-E", f"{key}={value}")] + else: + cmd = [] + env.update(hook_env) + out = subprocess.run(cmd + [str(self.probe), *args], env=env, capture_output=True, text=True, timeout=120, + cwd=self.tmp.name) + self.assertEqual(out.returncode, 0, out.stderr) + return {line.split("\t")[0]: line.split("\t")[1:] for line in out.stdout.splitlines()} + + def test_drive_link_stored_as_rootfs_path_reaches_the_mount(self): + path = f"/pfx/native/dosdevices/z:{GAME}/game.txt" + self.assertEqual(self.run_probe(path)[path], ["1", "library"]) + + def test_working_directory_through_a_drive_link_is_the_mount(self): + arg = f"cd:/pfx/native/dosdevices/z:{GAME}/" + self.assertEqual(self.run_probe(arg)[arg], [GAME]) + + def test_rootfs_path_under_a_mount_point_reaches_the_mount(self): + path = f"{self.root}{GAME}/game.txt" + self.assertEqual(self.run_probe(path)[path], ["1", "library"]) + + def test_guest_drive_link_is_unchanged(self): + path = f"/pfx/guest/dosdevices/z:{GAME}/game.txt" + self.assertEqual(self.run_probe(path)[path], ["1", "library"]) + + def test_rootfs_paths_outside_mounts_are_unchanged(self): + paths = ["/pfx/native/dosdevices/z:/etc/hostname", f"{self.root}/etc/hostname", "/etc/hostname"] + result = self.run_probe(*paths) + for path in paths: + self.assertEqual(result[path], ["1", "rootfs"], path) + + def test_wine_lookup_steps_reach_the_mount(self): + for pfx in ("/pfx/native", "/pfx/guest", "/pfx/relinked", f"{self.root}/pfx/native", f"{self.root}/pfx/guest", + f"{self.root}/pfx/relinked"): + drive = f"{pfx}/dosdevices/z:" + args = [f"at:{drive}{GAME}/", f"at:{drive}{GAME}", f"ls:{drive}/mnt/library", f"ls:{drive}{GAME}"] + result = self.run_probe(*args) + self.assertEqual(result[args[0]], ["1", "1"], pfx) + self.assertEqual(result[args[1]], ["1", "1"], pfx) + self.assertEqual(result[args[2]], ["Some Game"], pfx) + self.assertEqual(result[args[3]], ["game.txt"], pfx) + + def test_relative_drive_link_reaches_the_mount(self): + path = f"/pfx/relinked/dosdevices/z:{GAME}/game.txt" + cd = f"cd:/pfx/relinked/dosdevices/z:{GAME}/" + result = self.run_probe(path, cd) + self.assertEqual(result[path], ["1", "library"]) + self.assertEqual(result[cd], [GAME]) + + def test_relative_links_outside_mounts_are_unchanged(self): + paths = ["/pfx/relinked/dosdevices/z:/etc/hostname", "/pfx/relinked/dosdevices/c:/c.txt", + f"{self.root}/pfx/relinked/dosdevices/c:/c.txt"] + result = self.run_probe(*paths) + self.assertEqual(result[paths[0]], ["1", "rootfs"]) + self.assertEqual(result[paths[1]], ["1", "drive c"]) + self.assertEqual(result[paths[2]], ["1", "drive c"]) + + def test_suffix_after_a_relative_link_is_not_collapsed(self): + path = "/pfx/relinked/dosdevices/z:/mnt/library/missing/../Some Game/game.txt" + self.assertEqual(self.run_probe(path)[path], ["0", "-"]) + + def test_relative_drive_link_climbing_past_the_root_reaches_the_mount(self): + path = f"/pfx/copied/dosdevices/z:{GAME}/game.txt" + cd = f"cd:/pfx/copied/dosdevices/z:{GAME}/" + result = self.run_probe(path, cd) + self.assertEqual(result[path], ["1", "library"]) + self.assertEqual(result[cd], [GAME]) + + def test_relative_link_climbing_past_the_root_stays_in_the_rootfs(self): + path = "/pfx/copied/dosdevices/z:/etc/hostname" + self.assertEqual(self.run_probe(path)[path], ["1", "rootfs"]) + + def test_relative_link_is_resolved_from_its_real_directory(self): + path = f"/pfx/outside/dosdevices/z:{GAME}/game.txt" + self.assertEqual(self.run_probe(path)[path], ["1", "elsewhere"]) + + def test_drive_link_in_a_bound_prefix_reaches_the_mount(self): + path = f"/mnt/private/123/pfx/dosdevices/z:{GAME}/game.txt" + cd = f"cd:/mnt/private/123/pfx/dosdevices/z:{GAME}/" + result = self.run_probe(path, cd) + self.assertEqual(result[path], ["1", "library"]) + self.assertEqual(result[cd], [GAME]) + + def test_drive_link_copied_into_a_bound_prefix_reaches_the_mount(self): + path = f"/mnt/private/456/pfx/dosdevices/z:{GAME}/game.txt" + cd = f"cd:/mnt/private/456/pfx/dosdevices/z:{GAME}/" + result = self.run_probe(path, cd) + self.assertEqual(result[path], ["1", "library"]) + self.assertEqual(result[cd], [GAME]) + + def test_drive_link_in_equal_length_bound_prefix_reaches_the_mount(self): + path = f"{self.eqlen_dst}/123/pfx/dosdevices/z:{GAME}/game.txt" + cd = f"cd:{self.eqlen_dst}/123/pfx/dosdevices/z:{GAME}/" + result = self.run_probe(path, cd) + self.assertEqual(result[path], ["1", "library"]) + self.assertEqual(result[cd], [GAME]) + + +if __name__ == "__main__": + unittest.main() diff --git a/tools/tests/test_pace_cores.py b/tools/tests/test_pace_cores.py new file mode 100644 index 0000000000..564edb24be --- /dev/null +++ b/tools/tests/test_pace_cores.py @@ -0,0 +1,241 @@ +from pathlib import Path +import runpy +import struct +import tempfile +import unittest + + +BIN = Path(__file__).resolve().parents[1] / 'linuxfs/overlay/usr/local/bin' +MODULE = runpy.run_path(str(BIN / 'droiddeck-pace-cores')) +Frames = MODULE['Frames'] +Parker = MODULE['Parker'] +Governor = MODULE['Governor'] +efficient_cores = MODULE['efficient_cores'] +paced_interval = MODULE['paced_interval'] + +ALL = set(range(8)) +EFFICIENT = set(range(6)) +VBLANK = 1e9 / 60 +CAPACITY = 1024 + + +class FakeCores: + + def __init__(self, tids): + self.state = {tid: set(ALL) for tid in tids} + + def get(self, tid): + if tid not in self.state: + raise ProcessLookupError(tid) + return set(self.state[tid]) + + def set(self, tid, cpus): + if tid not in self.state: + raise ProcessLookupError(tid) + self.state[tid] = set(cpus) + + +class FeedWriter: + + def __init__(self, path): + self.path = path + self.count = 0 + self.data = bytearray(128 + CAPACITY * 16) + struct.pack_into('= 6 else '792\n') + self.assertEqual(efficient_cores(cpu, set(ALL)), EFFICIENT) + self.assertEqual(efficient_cores(cpu, {6, 7}), set()) + + def test_one_tier_has_none(self): + with tempfile.TemporaryDirectory() as temp: + cpu = Path(temp) + (cpu / 'online').write_text('0-3\n') + for core in range(4): + (cpu / f'cpu{core}').mkdir() + (cpu / f'cpu{core}/cpu_capacity').write_text('1024\n') + self.assertEqual(efficient_cores(cpu, set(range(4))), set()) + + +class GovernorTest(unittest.TestCase): + PID = 400 + TIDS = (400, 401, 402) + + def setUp(self): + temp = tempfile.TemporaryDirectory() + self.addCleanup(temp.cleanup) + root = Path(temp.name) + for tid in self.TIDS: + (root / f'proc/{self.PID}/task/{tid}').mkdir(parents=True) + self.cores = FakeCores(self.TIDS) + self.feed = FeedWriter(root / 'frames') + self.feed.focus(self.PID) + self.now = 0.0 + self.governor = Governor(Frames(root / 'frames'), Parker(EFFICIENT, root / 'proc', self.cores), + clock=lambda: self.now) + self.governor.tick() + + def run_for(self, seconds, interval): + for _ in range(int(seconds / 0.5)): + self.now += 0.5 + self.feed.frames(*([interval] * int(0.5e9 / interval))) + self.governor.tick() + + def test_parks_a_game_that_holds_its_pace(self): + self.run_for(4, VBLANK) + self.assertEqual(self.governor.parker.pid, self.PID) + self.assertTrue(all(cpus == EFFICIENT for cpus in self.cores.state.values())) + + def test_releases_when_frames_fall_behind_and_backs_off(self): + self.run_for(4, VBLANK) + self.run_for(2, 2 * VBLANK) + self.assertIsNone(self.governor.parker.pid) + self.assertTrue(all(cpus == ALL for cpus in self.cores.state.values())) + self.run_for(10, VBLANK) + self.assertIsNone(self.governor.parker.pid) + self.run_for(30, VBLANK) + self.assertEqual(self.governor.parker.pid, self.PID) + + def test_struggling_game_stays_on_every_core(self): + for step in range(20): + self.now += 0.5 + self.feed.frames(*([VBLANK, 2 * VBLANK] * 10)) + self.governor.tick() + self.assertIsNone(self.governor.parker.pid) + self.assertTrue(all(cpus == ALL for cpus in self.cores.state.values())) + + def test_steam_in_front_releases_without_backoff(self): + self.run_for(4, VBLANK) + self.feed.focus(self.PID, steam=True) + self.now += 0.5 + self.governor.tick() + self.assertTrue(all(cpus == ALL for cpus in self.cores.state.values())) + self.feed.focus(self.PID) + self.run_for(4, VBLANK) + self.assertEqual(self.governor.parker.pid, self.PID) + + def test_a_mask_the_game_set_itself_is_kept(self): + self.run_for(4, VBLANK) + self.cores.state[401] = {7} + self.run_for(2, 2 * VBLANK) + self.assertEqual(self.cores.state[401], {7}) + self.assertEqual(self.cores.state[400], ALL) + + def idle_for(self, seconds): + for _ in range(int(seconds / 0.5)): + self.now += 0.5 + self.governor.tick() + + def test_thread_born_parked_is_restored(self): + self.run_for(4, VBLANK) + (self.governor.parker.proc / f'{self.PID}/task/403').mkdir() + self.cores.state[403] = set(EFFICIENT) + self.run_for(1, VBLANK) + self.run_for(2, 2 * VBLANK) + self.assertEqual(self.cores.state[403], ALL) + + def test_a_thread_already_on_efficient_cores_keeps_its_mask(self): + self.cores.state[402] = set(EFFICIENT) + self.run_for(4, VBLANK) + self.run_for(1, VBLANK) + self.run_for(2, 2 * VBLANK) + self.assertEqual(self.cores.state[402], EFFICIENT) + self.assertEqual(self.cores.state[400], ALL) + + def test_a_child_of_a_game_pinned_thread_keeps_its_mask(self): + self.cores.state[402] = set(EFFICIENT) + self.run_for(4, VBLANK) + (self.governor.parker.proc / f'{self.PID}/task/404').mkdir() + self.cores.state[404] = set(EFFICIENT) + self.run_for(1, VBLANK) + self.run_for(2, 2 * VBLANK) + self.assertEqual(self.cores.state[404], EFFICIENT) + self.assertEqual(self.cores.state[400], ALL) + + def test_a_child_of_a_game_pinned_thread_that_exited_keeps_its_mask(self): + self.cores.state[402] = set(EFFICIENT) + self.run_for(4, VBLANK) + (self.governor.parker.proc / f'{self.PID}/task/402').rmdir() + del self.cores.state[402] + (self.governor.parker.proc / f'{self.PID}/task/404').mkdir() + self.cores.state[404] = set(EFFICIENT) + self.run_for(1, VBLANK) + self.run_for(2, 2 * VBLANK) + self.assertEqual(self.cores.state[404], EFFICIENT) + self.assertEqual(self.cores.state[400], ALL) + + def test_born_parked_thread_gets_every_original_it_could_have_had(self): + for tid in self.TIDS: + self.cores.state[tid] = EFFICIENT | {6} + self.cores.state[402] = EFFICIENT | {7} + self.run_for(4, VBLANK) + (self.governor.parker.proc / f'{self.PID}/task/404').mkdir() + self.cores.state[404] = set(EFFICIENT) + self.run_for(1, VBLANK) + self.run_for(2, 2 * VBLANK) + self.assertEqual(self.cores.state[404], ALL) + self.assertEqual(self.cores.state[402], EFFICIENT | {7}) + + def test_a_stalled_game_is_not_parked_on_old_frames(self): + self.run_for(0.5, VBLANK) + self.idle_for(3) + self.assertIsNone(self.governor.parker.pid) + self.run_for(2, VBLANK) + self.assertIsNone(self.governor.parker.pid) + + def test_a_parked_game_that_stops_presenting_is_released(self): + self.run_for(4, VBLANK) + self.run_for(1, 1e9) + self.idle_for(1) + self.assertIsNone(self.governor.parker.pid) + self.assertTrue(all(cpus == ALL for cpus in self.cores.state.values())) + + def test_threads_pinned_to_fast_cores_are_left_alone(self): + self.cores.state[402] = {6, 7} + self.run_for(4, VBLANK) + self.assertEqual(self.cores.state[402], {6, 7}) + self.assertEqual(self.cores.state[400], EFFICIENT) + + +if __name__ == '__main__': + unittest.main() diff --git a/tools/tests/test_preload_snapshots.py b/tools/tests/test_preload_snapshots.py index 6629d1ab22..2d0ee01642 100644 --- a/tools/tests/test_preload_snapshots.py +++ b/tools/tests/test_preload_snapshots.py @@ -150,6 +150,30 @@ class PreloadSnapshotTest(unittest.TestCase): with self.assertRaisesRegex(ValueError, 'successful main'): snapshots.artifact_bytes(self.data['origin'], self.root / 'cache') + def test_origin_apk_without_a_newer_output_reads_the_rest(self): + from zipfile import ZipFile + newest = 'libddnatv-hook.so' + apk = io.BytesIO() + with ZipFile(apk, 'w') as z: + for name, value in self.binaries.items(): + if name != newest: + z.writestr('assets/linuxfs/' + name, value) + outer = io.BytesIO() + with ZipFile(outer, 'w') as z: + z.writestr('app-release.apk', apk.getvalue()) + digest = snapshots.sha(outer.getvalue()) + origin = dict(self.data['origin'], artifact_sha256=digest) + build = dict(event='push', head_branch='main', conclusion='success', head_sha=origin['commit'], + path='.github/workflows/build.yml', repository=dict(full_name=snapshots.REPO)) + artifact = dict(name='droiddeck-apk', workflow_run=dict(id=origin['run']), digest='sha256:' + digest) + cache = self.root / 'cache' + cache.mkdir() + (cache / (digest + '.zip')).write_bytes(outer.getvalue()) + with patch.object(snapshots, 'api', side_effect=[build, artifact]): + content = snapshots.artifact_bytes(origin, cache) + self.assertNotIn(newest, content) + self.assertEqual(set(content), snapshots.FILES - {newest}) + def test_corrupt_archive_is_rejected(self): with self.assertRaisesRegex(ValueError, 'checksum'): snapshots.unpack(self.content + b'tampered', self.data) diff --git a/tools/tests/test_runtime_inputs.py b/tools/tests/test_runtime_inputs.py index 60c0fc9920..906bef4c2f 100644 --- a/tools/tests/test_runtime_inputs.py +++ b/tools/tests/test_runtime_inputs.py @@ -33,6 +33,9 @@ class RuntimeInputsTest(unittest.TestCase): self.source = self.root / 'tools/linuxfs/preload/test.c' self.source.parent.mkdir(parents=True) self.source.write_text('current source') + service = self.root / 'app/src/main/assets/linuxfs/usr/local/lib/droiddeck-ubisoft/droiddeck-upc.exe' + service.parent.mkdir(parents=True) + service.write_bytes(b'MZ service') self.audio(['pactl', 'modules/arm64/module-aaudio-sink.so', 'modules/arm64/module-directaudio-native-sink.so']) self.packs() @@ -179,6 +182,13 @@ class RuntimeInputsTest(unittest.TestCase): with self.assertRaisesRegex(ValueError, 'xbox pack provides'): runtime.check_apk(apk, self.root) + def test_an_apk_still_carrying_the_ubisoft_service_is_rejected(self): + name = 'assets/linuxfs/usr/local/lib/droiddeck-ubisoft/droiddeck-upc.exe' + self.assertIn(name, runtime.outputs(self.root)) + apk = self.current_apk(self.root / 'bundled.apk', {name: b'MZ service'}) + with self.assertRaisesRegex(ValueError, 'ubisoft pack provides'): + runtime.check_apk(apk, self.root) + def test_an_apk_still_carrying_the_powervr_runtime_is_rejected(self): apk = self.current_apk(self.root / 'bundled.apk', {'assets/hybris/runtime.tzst': b'runtime'}) with self.assertRaisesRegex(ValueError, 'powervr pack provides'): diff --git a/tools/tests/test_seed_redists.py b/tools/tests/test_seed_redists.py index 1440b41b0f..f00dc1ae26 100644 --- a/tools/tests/test_seed_redists.py +++ b/tools/tests/test_seed_redists.py @@ -2,6 +2,7 @@ import os import shutil import subprocess import tempfile +import time import unittest from pathlib import Path @@ -128,6 +129,67 @@ class SeedRedistsTest(unittest.TestCase): self.run_seed(str(sd)) self.assertIn('"VCRedist2022"=dword:00000001', self.reg.read_text()) + def manifest(self, name, build): + path = self.steam / "steamapps/appmanifest_77.acf" + path.write_text('"AppState"\n{\n\t"installdir"\t\t"%s"\n\t"buildid"\t\t"%s"\n}\n' % (name, build)) + return path + + def test_a_game_is_searched_again_only_when_its_build_changes(self): + late = self.steam / "steamapps/common/Late Game/installscript.vdf" + late.parent.mkdir(parents=True) + manifest = self.manifest("Late Game", "1") + self.run_seed() + late.write_text(GAME_SCRIPT) + manifest.write_text(manifest.read_text() + "\n") + self.run_seed() + self.assertNotIn("VCRedist2022", self.reg.read_text()) + self.manifest("Late Game", "2") + self.run_seed() + self.assertIn('"VCRedist2022"=dword:00000001', self.reg.read_text()) + + def test_one_changed_game_leaves_the_other_games_unsearched(self): + other = self.game("Other Game").parent / "installscript_extra.vdf" + self.manifest("Late Game", "1") + self.run_seed() + other.write_text(GAME_SCRIPT.replace("VCRedist2022", "Unsearched")) + self.manifest("Late Game", "2") + self.run_seed() + self.assertNotIn("Unsearched", self.reg.read_text()) + + def test_a_call_that_names_its_scripts_does_not_search_the_libraries(self): + script = self.game() + named = self.tmp / "legacycompat/evaluatorscript_1.vdf" + named.parent.mkdir(parents=True) + named.write_text(GAME_SCRIPT.replace("VCRedist2022", "Named")) + env = dict(os.environ, DROIDDECK_LIBRARIES="", DROIDDECK_SEED_SCRIPTS=str(named)) + subprocess.run(["bash", str(SCRIPT), str(self.steam)], env=env, capture_output=True, text=True, check=True) + reg = self.reg.read_text() + self.assertIn('"Named"=dword:00000001', reg) + self.assertNotIn("VCRedist2022", reg) + self.run_seed() + self.assertIn('"VCRedist2022"=dword:00000001', self.reg.read_text()) + self.assertIn(str(script), (self.steam / ".droiddeck-game-scripts").read_text()) + + def test_a_removed_game_leaves_the_list(self): + script = self.game() + self.run_seed() + cache = self.steam / ".droiddeck-game-scripts" + self.assertIn(str(script), cache.read_text()) + for manifest in (self.steam / "steamapps").glob("appmanifest_*.acf"): + manifest.unlink() + self.run_seed() + self.assertEqual("", cache.read_text()) + + def test_a_list_from_an_earlier_version_is_taken_over_without_a_search(self): + script = self.steam / "steamapps/common/Old Game/a/b/c/d/e/installscript.vdf" + script.parent.mkdir(parents=True) + script.write_text(GAME_SCRIPT) + self.manifest("Old Game", "1") + (self.steam / ".droiddeck-game-scripts").write_text("123 456\n%s\n" % script) + self.run_seed() + self.assertIn('"VCRedist2022"=dword:00000001', self.reg.read_text()) + self.assertIn("\t%s\n" % script, (self.steam / ".droiddeck-game-scripts").read_text()) + def test_current_user_and_machine_markers_go_to_their_own_registries(self): self.game(script=GAME_SCRIPT + GAME_SCRIPT.replace("HKEY_LOCAL_MACHINE", "HKEY_CURRENT_USER").replace("VCRedist2022", "UserRedist")) with self.reg.open("a") as out: @@ -398,6 +460,62 @@ class SeedRedistsTest(unittest.TestCase): self.assertEqual(self.reg.read_text().count('"Vulkan111080"'), 2) + def test_a_session_start_leaves_the_library_search_to_a_later_run(self): + self.game(script=GAME_SCRIPT.replace("Software\\\\Valve\\\\Steam\\\\Apps\\\\CommonRedist\\\\vcredist\\\\2022", "SOFTWARE\\\\AGEIA Technologies").replace("VCRedist2022", "PhysX Version")) + shim = self.tmp / "bin" + shim.mkdir() + go = self.tmp / "go" + (shim / "find").write_text('#!/bin/sh\ncase "$*" in *"installscript*"*) n=0; while [ ! -e "%s" ] && [ $n -lt 600 ]; do sleep 0.1; n=$((n + 1)); done;; esac\nexec %s "$@"\n' % (go, shutil.which("find"))) + (shim / "find").chmod(0o755) + env = dict(os.environ, DROIDDECK_LIBRARIES="", DROIDDECK_SEED_LATER="1", PATH="%s:%s" % (shim, os.environ["PATH"])) + marker = '"PhysX Version"=dword:00000001' + subprocess.run(["bash", str(SCRIPT), str(self.steam)], env=env, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, check=True) + self.assertNotIn(marker, self.reg.read_text()) + go.touch() + deadline = time.monotonic() + 30 + while marker not in self.reg.read_text() and time.monotonic() < deadline: + time.sleep(0.2) + self.assertIn(marker, self.reg.read_text()) + before = self.reg.read_text() + subprocess.run(["bash", str(SCRIPT), str(self.steam)], env=env, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, check=True) + time.sleep(0.5) + self.assertEqual(before, self.reg.read_text()) + + def test_a_game_whose_search_failed_is_searched_again(self): + self.game() + broken = self.tmp / "broken" + broken.touch() + shim = self.tmp / "bin" + shim.mkdir() + (shim / "find").write_text('#!/bin/sh\n%s "$@"\n[ ! -e "%s" ]\n' % (shutil.which("find"), broken)) + (shim / "find").chmod(0o755) + env = dict(os.environ, DROIDDECK_LIBRARIES="", PATH="%s:%s" % (shim, os.environ["PATH"])) + subprocess.run(["bash", str(SCRIPT), str(self.steam)], env=env, capture_output=True, check=True) + self.assertNotIn("VCRedist2022", self.reg.read_text()) + broken.unlink() + subprocess.run(["bash", str(SCRIPT), str(self.steam)], env=env, capture_output=True, check=True) + self.assertIn('"VCRedist2022"=dword:00000001', self.reg.read_text()) + + def test_a_later_run_leaves_the_registry_alone_while_a_wine_server_runs(self): + self.game(script=GAME_SCRIPT.replace("Software\\\\Valve\\\\Steam\\\\Apps\\\\CommonRedist\\\\vcredist\\\\2022", "SOFTWARE\\\\AGEIA Technologies").replace("VCRedist2022", "PhysX Version")) + shim = self.tmp / "bin" + shim.mkdir() + (shim / "pgrep").write_text("#!/bin/sh\nexit 0\n") + (shim / "pgrep").chmod(0o755) + env = dict(os.environ, DROIDDECK_LIBRARIES="", DROIDDECK_SEED_LATER="1", PATH="%s:%s" % (shim, os.environ["PATH"])) + subprocess.run(["bash", str(SCRIPT), str(self.steam)], env=env, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, check=True) + cache = self.steam / ".droiddeck-game-scripts" + deadline = time.monotonic() + 30 + while not (cache.exists() and "installscript" in cache.read_text().lower()) and time.monotonic() < deadline: + time.sleep(0.2) + self.assertIn("installscript", cache.read_text().lower()) + time.sleep(1) + self.assertNotIn("PhysX Version", self.reg.read_text()) + env.pop("DROIDDECK_SEED_LATER") + env["PATH"] = os.environ["PATH"] + subprocess.run(["bash", str(SCRIPT), str(self.steam)], env=env, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, check=True) + self.assertIn('"PhysX Version"=dword:00000001', self.reg.read_text()) + def evaluator(self, appid, install_script): script = self.tmp / ("legacycompat/evaluatorscript_%s.vdf" % appid) script.parent.mkdir(parents=True) diff --git a/tools/tests/test_session_webhelper_layout.py b/tools/tests/test_session_webhelper_layout.py index f14afd61da..0a6ba0b27f 100644 --- a/tools/tests/test_session_webhelper_layout.py +++ b/tools/tests/test_session_webhelper_layout.py @@ -43,6 +43,34 @@ class WebhelperLayoutTest(unittest.TestCase): def test_the_steam_block_uses_it(self): self.assertIn("BL_WEBHELPER_ARGS=$(bl_webhelper_layout)", SESSION.read_text()) + def test_the_gpu_ui_on_the_bridge_defaults_to_angle_on_vulkan_without_vulkan_compositing(self): + text = SESSION.read_text() + gpu = text.index('elif [ "${_bl_cef[0]}" = -cef-force-gpu ]; then') + software = text.rindex('_bl_cef=(-cef-disable-gpu -cef-disable-gpu-compositing)', 0, gpu) + defaults = text.index(': "${BL_VKBRIDGE_CEF_ANGLE=vulkan}" "${BL_VKBRIDGE_CEF_VULKAN=0}"', gpu) + self.assertLess(software, gpu) + self.assertLess(defaults, text.index("BL_WEBHELPER_ARGS=$(bl_webhelper_layout)", gpu)) + self.assertLess(defaults, text.index("\n fi\n", gpu)) + + def test_the_defaults_give_way_to_settings(self): + script = ': "${BL_VKBRIDGE_CEF_ANGLE=vulkan}" "${BL_VKBRIDGE_CEF_VULKAN=0}"\n' + layout_function() + "bl_webhelper_layout\n" + env = {k: v for k, v in os.environ.items() if k not in KEYS} + run = lambda **s: subprocess.run(["bash", "-c", "set -u\n" + script], env={**env, **s}, + capture_output=True, text=True, check=True).stdout.strip() + self.assertEqual(run(), "--use-gl=angle --use-angle=vulkan") + self.assertEqual(run(BL_VKBRIDGE_CEF_VULKAN="1"), + "--use-gl=angle --use-angle=vulkan +Vulkan +VulkanFromANGLE +DefaultANGLEVulkan") + self.assertEqual(run(BL_VKBRIDGE_CEF_ANGLE="gl"), "--use-gl=angle --use-angle=gl") + + def test_empty_settings_are_kept_as_set(self): + script = ': "${BL_VKBRIDGE_CEF_ANGLE=vulkan}" "${BL_VKBRIDGE_CEF_VULKAN=0}"\n' + layout_function() + "bl_webhelper_layout\n" + env = {k: v for k, v in os.environ.items() if k not in KEYS} + run = lambda **s: subprocess.run(["bash", "-c", "set -u\n" + script], env={**env, **s}, + capture_output=True, text=True, check=True).stdout.strip() + self.assertEqual(run(BL_VKBRIDGE_CEF_ANGLE=""), "stock") + self.assertEqual(run(BL_VKBRIDGE_CEF_VULKAN=""), + "--use-gl=angle --use-angle=vulkan +Vulkan +VulkanFromANGLE +DefaultANGLEVulkan") + if __name__ == "__main__": unittest.main() diff --git a/tools/tests/test_steam_compat_x64.py b/tools/tests/test_steam_compat_x64.py index 9f9abc478a..9d9bf109e0 100644 --- a/tools/tests/test_steam_compat_x64.py +++ b/tools/tests/test_steam_compat_x64.py @@ -99,6 +99,31 @@ class X64RepointTest(unittest.TestCase): self.assertEqual(COMPAT["x64_repoint"](str(self.root), None), []) self.assertEqual((self.root / "config" / "config.vdf").read_text(), before) + def test_new_owned_shortcut_gets_the_x64_default_and_explicit_choice_stays(self): + app = "2350879490" + chosen = "proton-cachyos-a64" + config = self.root / "config" / "config.vdf" + state = self.root / "droiddeck-compat" + self.assertEqual(COMPAT["register_default"]( + str(config), apps=[app], protect={chosen: "proton-cachyos-a64"}, + default="GE-Proton11-7-a64", directory=str(state), + linux_tool="droiddeck-direct", owned=[app]), "GE-Proton11-7-a64") + self.assertEqual(self.mapping()[app], "GE-Proton11-7-a64") + self.assertEqual(COMPAT["register_default"]( + str(config), apps=[app], protect={chosen: "proton-cachyos-a64"}, + default="GE-Proton11-7-a64", directory=str(state), + linux_tool="droiddeck-direct", owned=[app]), "GE-Proton11-7-a64") + self.assertEqual(self.mapping()[app], "GE-Proton11-7-a64") + tokens = COMPAT["tokenize"](config.read_text()) + mapping = COMPAT["mapping_block"](tokens) + COMPAT["set_mapping"](tokens, mapping, app, chosen) + config.write_text(COMPAT["serialize"](tokens)) + COMPAT["register_default"]( + str(config), apps=[app], protect={chosen: "proton-cachyos-a64"}, + default="GE-Proton11-7-a64", directory=str(state), + linux_tool="droiddeck-direct", owned=[app]) + self.assertEqual(self.mapping()[app], chosen) + if __name__ == "__main__": unittest.main() diff --git a/tools/tests/test_steam_games.py b/tools/tests/test_steam_games.py index 16c08e142f..13235e68b4 100644 --- a/tools/tests/test_steam_games.py +++ b/tools/tests/test_steam_games.py @@ -3,6 +3,7 @@ import importlib.util import json import os from pathlib import Path +import shutil import subprocess import tempfile import unittest @@ -56,6 +57,171 @@ class ImportsTest(unittest.TestCase): self.assertEqual(self.folder, (self.steam / 'steamapps/common/DroidDeck-42').resolve()) self.assertEqual(b'game', self.exe.read_bytes()) + def steam_install(self, appid=42): + library = self.root / 'Library' + folder = library / 'steamapps/common/Example' + folder.mkdir(parents=True) + (folder / 'Example.exe').write_bytes(b'game') + (library / f'steamapps/appmanifest_{appid}.acf').write_text(f'"AppState"\n{{\n"appid" "{appid}"\n"installdir" "Example"\n}}\n') + saves = library / f'steamapps/compatdata/{appid}/pfx/drive_c/users/steamuser' + saves.mkdir(parents=True) + (saves / 'save.dat').write_bytes(b'cloud') + return dict(self.game, folder=str(folder), exe=str(folder / 'Example.exe'), dir=str(folder)), library + + def shortcut_prefix(self): + return self.steam / 'steamapps/compatdata' / str(self.game['appid'] & 0xFFFFFFFF) + + def link_shortcut_prefix(self, target, owned=True): + (self.steam / 'steamapps/compatdata').mkdir(parents=True, exist_ok=True) + self.shortcut_prefix().symlink_to(target) + if owned: + imports.save_json(self.steam / 'steamapps' / imports.PREFIX_LINKS, + {str(self.shortcut_prefix()): str(target)}) + + def test_shortcut_of_a_steam_install_shares_the_steam_apps_prefix(self): + game, library = self.steam_install() + (self.steam / 'steamapps').mkdir(parents=True) + (self.steam / 'steamapps/libraryfolders.vdf').write_text(f'"libraryfolders"\n{{\n"1" {{ "path" "{library}" }}\n}}\n') + games, routes = imports.route(self.steam, self.acct, [game]) + self.assertEqual(([game], {}), (games, routes)) + self.assertEqual(library / 'steamapps/compatdata/42', self.shortcut_prefix().resolve()) + self.assertEqual(b'cloud', (self.shortcut_prefix() / 'pfx/drive_c/users/steamuser/save.dat').read_bytes()) + + def test_matching_install_prefix_precedes_an_older_prefix_in_another_library(self): + game, library = self.steam_install() + (self.steam / 'steamapps').mkdir(parents=True) + (self.steam / 'steamapps/libraryfolders.vdf').write_text(f'"libraryfolders"\n{{\n"1" {{ "path" "{library}" }}\n}}\n') + older = self.steam / 'steamapps/compatdata/42/pfx/drive_c/users/steamuser' + older.mkdir(parents=True) + (older / 'save.dat').write_bytes(b'old') + imports.route(self.steam, self.acct, [game]) + self.assertEqual(library / 'steamapps/compatdata/42', self.shortcut_prefix().resolve()) + self.assertEqual(b'cloud', (self.shortcut_prefix() / 'pfx/drive_c/users/steamuser/save.dat').read_bytes()) + self.assertEqual(b'old', (older / 'save.dat').read_bytes()) + + def test_an_existing_shortcut_prefix_is_never_replaced(self): + game, library = self.steam_install() + (self.steam / 'steamapps').mkdir(parents=True, exist_ok=True) + (self.steam / 'steamapps/libraryfolders.vdf').write_text(f'"libraryfolders"\n{{\n"1" {{ "path" "{library}" }}\n}}\n') + local = self.shortcut_prefix() / 'pfx/drive_c' + local.mkdir(parents=True) + (local / 'local.dat').write_bytes(b'local') + imports.route(self.steam, self.acct, [game]) + self.assertFalse(self.shortcut_prefix().is_symlink()) + self.assertEqual(b'local', (local / 'local.dat').read_bytes()) + self.assertEqual(b'cloud', (library / 'steamapps/compatdata/42/pfx/drive_c/users/steamuser/save.dat').read_bytes()) + + def test_shortcuts_without_a_manifest_identity_keep_their_own_prefix(self): + game, library = self.steam_install() + (self.steam / 'steamapps').mkdir(parents=True, exist_ok=True) + (self.steam / 'steamapps/libraryfolders.vdf').write_text(f'"libraryfolders"\n{{\n"1" {{ "path" "{library}" }}\n}}\n') + imports.route(self.steam, self.acct, [self.game, dict(game, folder=str(self.folder.parent / 'Other'))]) + self.assertFalse(os.path.lexists(self.shortcut_prefix())) + + def test_a_manifest_without_a_steam_prefix_links_nothing(self): + game, library = self.steam_install() + shutil.rmtree(library / 'steamapps/compatdata/42') + (self.steam / 'steamapps').mkdir(parents=True, exist_ok=True) + (self.steam / 'steamapps/libraryfolders.vdf').write_text(f'"libraryfolders"\n{{\n"1" {{ "path" "{library}" }}\n}}\n') + imports.route(self.steam, self.acct, [game]) + self.assertFalse(os.path.lexists(self.shortcut_prefix())) + + def test_an_older_prefix_in_another_library_is_not_linked_for_a_steam_install(self): + game, library = self.steam_install() + shutil.rmtree(library / 'steamapps/compatdata/42') + (self.steam / 'steamapps').mkdir(parents=True, exist_ok=True) + (self.steam / 'steamapps/libraryfolders.vdf').write_text(f'"libraryfolders"\n{{\n"1" {{ "path" "{library}" }}\n}}\n') + (self.steam / 'steamapps/compatdata/42/pfx/drive_c').mkdir(parents=True) + imports.route(self.steam, self.acct, [game]) + self.assertFalse(os.path.lexists(self.shortcut_prefix())) + + def test_a_dangling_shortcut_prefix_link_is_replaced(self): + game, library = self.steam_install() + self.link_shortcut_prefix(self.root / 'moved') + imports.route(self.steam, self.acct, [game]) + self.assertEqual(library / 'steamapps/compatdata/42', self.shortcut_prefix().resolve()) + + def test_a_dangling_shortcut_prefix_link_is_removed_without_a_replacement(self): + game, library = self.steam_install() + shutil.rmtree(library / 'steamapps/compatdata/42') + self.link_shortcut_prefix(self.root / 'moved') + imports.route(self.steam, self.acct, [game]) + self.assertFalse(os.path.lexists(self.shortcut_prefix())) + + def test_a_link_the_user_made_is_never_changed(self): + game, library = self.steam_install() + for target in (self.root / 'moved', library / 'steamapps/compatdata/42', self.folder): + if os.path.lexists(self.shortcut_prefix()): + self.shortcut_prefix().unlink() + self.link_shortcut_prefix(target, owned=False) + imports.route(self.steam, self.acct, [game]) + self.assertEqual(str(target), os.readlink(self.shortcut_prefix())) + + def test_a_user_link_to_the_matching_prefix_is_never_recorded_or_removed(self): + game, library = self.steam_install() + target = library / 'steamapps/compatdata/42' + self.link_shortcut_prefix(target, owned=False) + imports.route(self.steam, self.acct, [game]) + self.assertEqual(str(target), os.readlink(self.shortcut_prefix())) + self.assertNotIn(str(self.shortcut_prefix()), imports.read_json(self.steam / 'steamapps' / imports.PREFIX_LINKS, {})) + shutil.rmtree(target) + imports.route(self.steam, self.acct, [game]) + self.assertTrue(os.path.islink(self.shortcut_prefix())) + self.assertEqual(str(target), os.readlink(self.shortcut_prefix())) + + def test_our_link_survives_a_library_that_is_temporarily_missing(self): + game, library = self.steam_install() + imports.route(self.steam, self.acct, [game]) + hidden = self.root / 'Hidden' + library.rename(hidden) + imports.route(self.steam, self.acct, [game]) + self.assertTrue(os.path.islink(self.shortcut_prefix())) + hidden.rename(library) + imports.route(self.steam, self.acct, [game]) + self.assertEqual(library / 'steamapps/compatdata/42', self.shortcut_prefix().resolve()) + self.assertEqual(b'cloud', (self.shortcut_prefix() / 'pfx/drive_c/users/steamuser/save.dat').read_bytes()) + + def test_our_link_is_dropped_once_its_prefix_is_deleted(self): + game, library = self.steam_install() + imports.route(self.steam, self.acct, [game]) + shutil.rmtree(library / 'steamapps/compatdata/42') + imports.route(self.steam, self.acct, [game]) + self.assertFalse(os.path.lexists(self.shortcut_prefix())) + self.assertEqual({}, imports.read_json(self.steam / 'steamapps' / imports.PREFIX_LINKS, None)) + + def test_a_replaced_link_record_is_forgotten_when_the_user_makes_a_real_prefix(self): + game, library = self.steam_install() + imports.route(self.steam, self.acct, [game]) + self.shortcut_prefix().unlink() + (self.shortcut_prefix() / 'pfx/drive_c').mkdir(parents=True) + imports.route(self.steam, self.acct, [game]) + self.assertFalse(self.shortcut_prefix().is_symlink()) + self.assertEqual({}, imports.read_json(self.steam / 'steamapps' / imports.PREFIX_LINKS, None)) + + def test_a_shortcut_prefix_with_its_own_saves_is_reported_and_kept(self): + game, library = self.steam_install() + local = self.shortcut_prefix() / 'pfx/drive_c' + local.mkdir(parents=True) + with patch('builtins.print') as printed: + imports.route(self.steam, self.acct, [game]) + self.assertTrue(local.is_dir()) + self.assertIn('keeps its own prefix', printed.call_args_list[-1][0][0]) + + def test_a_winnative_game_shares_the_prefix_the_steam_client_uses(self): + self.winnative_manifest() + (self.steam / 'steamapps/libraryfolders.vdf').parent.mkdir(parents=True, exist_ok=True) + saves = self.steam / 'steamapps/compatdata/42/pfx/drive_c/users/steamuser' + saves.mkdir(parents=True) + (saves / 'save.dat').write_bytes(b'cloud') + imports.share_prefix(self.steam, self.game) + self.assertEqual(self.steam / 'steamapps/compatdata/42', self.shortcut_prefix().resolve()) + + def test_an_unreadable_library_does_not_stop_the_routing(self): + with patch.object(Path, 'glob', side_effect=PermissionError): + games, routes = imports.route(self.steam, self.acct, [self.game]) + self.assertEqual([self.game], games) + self.assertFalse(os.path.lexists(self.shortcut_prefix())) + def test_store_installs_stay_shortcuts_even_when_owned_on_steam(self): self.snapshot() game = dict(self.game, store='amazon') diff --git a/tools/tests/test_steam_x64_runtime_libs.py b/tools/tests/test_steam_x64_runtime_libs.py new file mode 100644 index 0000000000..6f3f71c3f4 --- /dev/null +++ b/tools/tests/test_steam_x64_runtime_libs.py @@ -0,0 +1,67 @@ +import os +from pathlib import Path +import re +import subprocess +import tempfile +import unittest + + +SCRIPT = Path(__file__).resolve().parents[1] / 'linuxfs/overlay/usr/local/bin/droiddeck-steam-x64' +SOURCE = SCRIPT.read_text() +LIBRARY_LOOP = re.search(r'^for d in "\$STEAM_X64"/steamrt64/.*?^done\nFEX_ROOTFS=', SOURCE, re.M | re.S).group() +LIBRARY_LOOP = LIBRARY_LOOP[:LIBRARY_LOOP.rfind('\nFEX_ROOTFS=')] + + +class SteamX64RuntimeLibsTest(unittest.TestCase): + def setUp(self): + self.temp = tempfile.TemporaryDirectory() + self.addCleanup(self.temp.cleanup) + self.root = Path(self.temp.name) + self.steam = self.root / 'Steam' + self.runtime = self.steam / 'steamrt64/pv-runtime/steam-runtime-steamrt' + self.lib = self.runtime / 'steamrt3c_platform_a/files/lib/x86_64-linux-gnu' + self.usr_lib = self.runtime / 'steamrt3c_platform_a/files/usr/lib/x86_64-linux-gnu' + self.lib.mkdir(parents=True) + self.usr_lib.mkdir(parents=True) + self.dest = self.root / 'steamrt-libs' + self.dest.mkdir() + + def run_loop(self): + shell = 'srt_libs="$DEST"\n' + LIBRARY_LOOP + env = dict(os.environ, STEAM_X64=str(self.steam), DEST=str(self.dest)) + return subprocess.run(['bash', '-eu', '-c', shell], env=env, capture_output=True, text=True, timeout=10) + + def test_empty_library_directory_is_skipped(self): + (self.usr_lib / 'libexample.so.1').touch() + result = self.run_loop() + self.assertEqual(0, result.returncode, result.stderr) + self.assertTrue((self.dest / 'libexample.so.1').is_symlink()) + + def test_two_platform_versions_with_empty_lib_dirs_use_usr_lib(self): + platform_b = self.runtime / 'steamrt3c_platform_b' + (platform_b / 'files/lib/x86_64-linux-gnu').mkdir(parents=True) + usr_lib_b = platform_b / 'files/usr/lib/x86_64-linux-gnu' + usr_lib_b.mkdir(parents=True) + (self.usr_lib / 'libexample.so.1').touch() + (usr_lib_b / 'libother.so.1').touch() + result = self.run_loop() + self.assertEqual(0, result.returncode, result.stderr) + self.assertTrue((self.dest / 'libexample.so.1').is_symlink()) + self.assertTrue((self.dest / 'libother.so.1').is_symlink()) + + def test_stale_literal_glob_link_does_not_abort(self): + (self.dest / '*.so*').symlink_to('/missing/*.so*') + result = self.run_loop() + self.assertEqual(0, result.returncode, result.stderr) + self.assertTrue((self.dest / '*.so*').is_symlink()) + + def test_existing_dangling_library_link_is_not_recreated(self): + (self.lib / 'libexample.so.1').touch() + (self.dest / 'libexample.so.1').symlink_to('/missing/libexample.so.1') + result = self.run_loop() + self.assertEqual(0, result.returncode, result.stderr) + self.assertEqual('/missing/libexample.so.1', os.readlink(self.dest / 'libexample.so.1')) + + +if __name__ == '__main__': + unittest.main() diff --git a/tools/tests/test_store_launch.py b/tools/tests/test_store_launch.py index 863eb679a9..36a1b7c9a1 100644 --- a/tools/tests/test_store_launch.py +++ b/tools/tests/test_store_launch.py @@ -797,3 +797,102 @@ class GogRegistry(unittest.TestCase): store.main([str(folder / store.LAUNCHER)]) apply.assert_called_once_with(folder, root + '/compat', '/chosen/proton') support.assert_called_once_with(folder, root + '/compat', '/chosen/proton') + + +class Ubisoft(unittest.TestCase): + def setUp(self): + self.tmp = tempfile.TemporaryDirectory() + self.root = Path(self.tmp.name) + self.compat_data = self.root / 'compatdata/2929927072' + (self.compat_data / 'pfx').mkdir(parents=True) + (self.compat_data / 'pfx/system.reg').write_text('WINE REGISTRY Version 2\n') + (self.compat_data / 'pfx/user.reg').write_text('WINE REGISTRY Version 2\n') + self.folder = self.root / 'Games/Stores/Ubisoft/Splinter Cell' + (self.folder / 'system').mkdir(parents=True) + self.sidecar = {'store': 'ubisoft', 'id': 'space-1', 'exe': 'system/SplinterCell.exe', 'extra': {'productId': '109'}} + service = self.root / 'droiddeck-upc.exe' + service.write_bytes(b'MZ') + for patcher in (patch.object(store, 'UBISOFT_SERVICE', service), patch.object(store, 'UBISOFT_CACHE', self.root / 'cache'), + patch.object(store, 'wait_for_server', return_value=True)): + patcher.start() + self.addCleanup(patcher.stop) + + def tearDown(self): + self.tmp.cleanup() + + def runtime(self): + folder = store.ubisoft_runtime_dir(self.compat_data) + folder.mkdir(parents=True, exist_ok=True) + for name in store.UBISOFT_RUNTIME: + (folder / name).write_bytes(b'MZ') + + def answer(self, *_args, **_kwargs): + return {'ok': True, 'ticket': 'PC', 'owned': [82, 109], 'appId': 'app', + 'account': {'userId': 'u1', 'username': 'name', 'nameOnPlatform': 'name', 'email': 'e@x', 'country': 'US'}} + + def prepare(self, ask_app): + return store.prepare_ubisoft(self.folder, self.sidecar, str(self.compat_data), str(self.root / 'launch'), '/proton', ask_app=ask_app) + + def test_an_extracted_runtime_is_not_extracted_again(self): + self.runtime() + with patch.object(store.subprocess, 'run') as run: + self.assertEqual('present', store.install_runtime(str(self.compat_data))) + run.assert_not_called() + + def test_the_runtime_comes_from_the_installer_through_7z(self): + installer = self.root / 'UbisoftConnectInstaller.exe' + + def run(command, **_kwargs): + self.assertEqual(['7z', 'e', '-y'], command[:3]) + self.assertEqual(str(installer), command[4]) + out = Path(command[3][2:]) + for name in command[5:]: + (out / name).write_bytes(b'MZ') + + (self.root / 'cache').mkdir() + with patch.object(store, 'fetch_installer', return_value=installer), patch.object(store.subprocess, 'run', side_effect=run): + self.assertEqual('installed', store.install_runtime(str(self.compat_data))) + self.assertTrue(store.ubisoft_runtime_ready(str(self.compat_data))) + + def test_a_launch_registers_the_game_and_writes_the_session_for_the_service(self): + self.runtime() + result = self.prepare(self.answer) + self.assertEqual('runtime present, registered 109, 0 manifest value(s), session ready', result) + reg = (self.compat_data / 'pfx/system.reg').read_text() + for view in ('[Software\\\\Ubisoft\\\\Launcher]', '[Software\\\\Wow6432Node\\\\Ubisoft\\\\Launcher]'): + self.assertIn(view, reg) + self.assertIn('[Software\\\\Wow6432Node\\\\Ubisoft\\\\Launcher\\\\Installs\\\\109]', reg) + self.assertIn('"InstallDir"="C:\\\\Program Files (x86)\\\\Ubisoft\\\\Ubisoft Game Launcher\\\\"', reg) + launch = json.loads((self.folder / store.UBISOFT_LAUNCH).read_text()) + self.assertEqual(109, launch['productId']) + self.assertEqual('PC', launch['ticket']) + self.assertEqual([82, 109], launch['owned']) + self.assertEqual(store.windows_path(str(self.folder / 'system/SplinterCell.exe')), launch['exe']) + self.assertEqual('C:/users/steamuser/Saved Games/Ubisoft/u1/109/', launch['saves']) + self.assertTrue((self.compat_data / 'pfx/drive_c/users/steamuser/Saved Games/Ubisoft/u1/109').is_dir()) + + def test_without_a_session_the_launch_file_is_removed_and_the_game_starts_as_is(self): + self.runtime() + (self.folder / store.UBISOFT_LAUNCH).write_text('{}') + result = self.prepare(lambda *_a, **_k: {'ok': False, 'reason': 'signed-out'}) + self.assertEqual('runtime present, registered 109, session signed-out', result) + self.assertFalse((self.folder / store.UBISOFT_LAUNCH).exists()) + + def test_a_game_without_a_product_is_left_alone(self): + self.sidecar['extra'] = {} + self.assertEqual('no-product', self.prepare(self.answer)) + + def test_the_manifest_registry_lands_in_both_views_with_the_install_folder_and_language(self): + self.runtime() + registry = [{'key': r'HKEY_LOCAL_MACHINE\SOFTWARE\Ubisoft\Launcher\Installs\109\Language', + 'values': [{'name': 'French', 'value': 'fr-FR'}, {'name': 'English', 'value': 'en-US'}]}, + {'key': r'HKEY_LOCAL_MACHINE\SOFTWARE\Ubisoft\Splinter Cell\GamePath', 'values': [{'name': '$INSTALL_DIR', 'value': ''}]}] + answer = dict(self.answer(), registry=registry, language='en-US') + result = self.prepare(lambda *_a, **_k: answer) + self.assertEqual('runtime present, registered 109, 4 manifest value(s), session ready', result) + reg = (self.compat_data / 'pfx/system.reg').read_text() + self.assertIn(r'[SOFTWARE\\Wow6432Node\\Ubisoft\\Launcher\\Installs\\109]', reg) + self.assertIn(r'[SOFTWARE\\Ubisoft\\Launcher\\Installs\\109]', reg) + self.assertIn('"Language"="en-US"', reg) + folder = store.windows_path(str(self.folder)).replace('\\', '\\\\') + self.assertIn('"GamePath"="%s\\\\"' % folder, reg) diff --git a/tools/tests/test_store_launch_ea.py b/tools/tests/test_store_launch_ea.py new file mode 100644 index 0000000000..9096d2d3c8 --- /dev/null +++ b/tools/tests/test_store_launch_ea.py @@ -0,0 +1,175 @@ +import base64 +import importlib.machinery +import importlib.util +import json +from pathlib import Path +import tempfile +import unittest +from unittest.mock import patch + +BIN = Path(__file__).resolve().parents[1] / 'linuxfs/overlay/usr/local/bin' +loader = importlib.machinery.SourceFileLoader('droiddeck_store_launch_ea', str(BIN / 'droiddeck-store-launch')) +spec = importlib.util.spec_from_loader(loader.name, loader) +store = importlib.util.module_from_spec(spec) +loader.exec_module(store) + + +class EaHook(unittest.TestCase): + def test_wmi_output_reads_the_value_under_the_header(self): + text = 'Manufacturer \r\r\nThe Wine Project \r\r\n\r\r\n' + self.assertEqual(store.wmi_value(text), 'The Wine Project') + self.assertEqual(store.wmi_value(store.decode_output('Name\r\nFEX CPU\r\n'.encode('utf-16'))), 'FEX CPU') + self.assertEqual(store.wmi_value(''), '') + + def test_registry_points_the_game_keys_at_the_install_folder(self): + sidecar = {'id': 'Origin.OFR.50.0001', 'title': 'Mass Effect 3', 'extra': {'registry': json.dumps([ + [r'HKEY_LOCAL_MACHINE\SOFTWARE\EA Games\Game', 'Install Dir'], + [r'HKLM\SOFTWARE\Respawn\Titanfall2', 'Install Dir'], + [r'HKEY_CLASSES_ROOT\x', 'y'], + ])}} + entries = store.ea_registry_entries(Path('/root/Games/Stores/EA/Game'), sidecar) + self.assertIn((r'HKEY_LOCAL_MACHINE\SOFTWARE\Origin', 'ClientPath', store.EA_CLIENT), entries) + game = [e for e in entries if e[1] == 'Install Dir'] + self.assertEqual([e[0] for e in game], [r'HKEY_LOCAL_MACHINE\SOFTWARE\EA Games\Game', r'HKEY_LOCAL_MACHINE\SOFTWARE\Respawn\Titanfall2']) + self.assertEqual(game[0][2], 'Z:' + '\\'.join(['', 'root', 'Games', 'Stores', 'EA', 'Game', ''])) + self.assertIn((r'HKEY_LOCAL_MACHINE\SOFTWARE\EA Games\Game', 'DisplayName', 'Mass Effect 3'), entries) + self.assertIn((r'HKEY_LOCAL_MACHINE\SOFTWARE\Respawn\Titanfall2', 'DisplayName', 'Mass Effect 3'), entries) + + def test_the_games_exe_maps_to_its_launcher_only(self): + with tempfile.TemporaryDirectory() as tmp: + folder = Path(tmp) / 'Game' + (folder / 'bin').mkdir(parents=True) + for name in ('bin/Game.exe', 'bin/Other.exe', store.LAUNCHER): + (folder / name).write_text('x') + sidecar = {'store': 'ea', 'id': 'Origin.OFR.50.1', 'exe': 'bin/Game.exe', 'launcher': store.LAUNCHER} + (folder / store.SIDECAR).write_text(json.dumps(sidecar)) + self.assertEqual(store.store_launcher(str(folder / 'bin/Game.exe')), str(folder / store.LAUNCHER)) + self.assertEqual(store.store_launcher(str(folder / 'bin/game.exe')), str(folder / store.LAUNCHER)) + self.assertIsNone(store.store_launcher(str(folder / 'bin/Other.exe'))) + self.assertIsNone(store.store_launcher(str(Path(tmp) / 'Elsewhere.exe'))) + (folder / store.SIDECAR).write_text(json.dumps(dict(sidecar, launcher=''))) + self.assertIsNone(store.store_launcher(str(folder / 'bin/Game.exe'))) + + def test_a_symlinked_or_deep_exe_still_finds_its_launcher(self): + with tempfile.TemporaryDirectory() as tmp: + folder = Path(tmp) / 'Game' + deep = folder / 'a/b/c/d/e/f' + deep.mkdir(parents=True) + (deep / 'Game.exe').write_text('x') + (folder / store.LAUNCHER).write_text('x') + sidecar = {'store': 'ea', 'id': 'Origin.OFR.50.1', 'exe': 'a/b/c/d/e/f/Game.exe', 'launcher': store.LAUNCHER} + (folder / store.SIDECAR).write_text(json.dumps(sidecar)) + link = Path(tmp) / 'x/y/z/Link.exe' + link.parent.mkdir(parents=True) + link.symlink_to(deep / 'Game.exe') + expected = str(folder.resolve() / store.LAUNCHER) + self.assertEqual(store.store_launcher(str(deep / 'Game.exe')), expected) + self.assertEqual(store.store_launcher(str(link)), expected) + self.assertIsNone(store.find_store_game([str(deep / 'Game.exe')])) + + def test_a_symlinked_exe_finds_the_sidecar_beside_the_link(self): + with tempfile.TemporaryDirectory() as tmp: + outside = Path(tmp) / 'Real/Game.exe' + outside.parent.mkdir() + outside.write_text('x') + folder = Path(tmp) / 'Game' + folder.mkdir() + (folder / store.LAUNCHER).write_text('x') + (folder / 'Game.exe').symlink_to(outside) + sidecar = {'store': 'ea', 'id': 'Origin.OFR.50.1', 'exe': 'Game.exe', 'launcher': store.LAUNCHER} + (folder / store.SIDECAR).write_text(json.dumps(sidecar)) + self.assertEqual(store.store_launcher(str(folder / 'Game.exe')), str(folder / store.LAUNCHER)) + self.assertIsNone(store.store_launcher(str(outside))) + + def test_legacy_games_are_registered_by_content_id(self): + sidecar = {'id': 'Origin.OFR.50.0005237', 'title': 'Mass Effect 3 (2012)', + 'extra': {'contentIds': '71073,71183, bad id', 'displayName': 'Mass Effect 3', 'locale': 'fr_FR'}} + entries = store.ea_registry_entries(Path('/root/Games/ME3'), sidecar) + key = r'HKEY_LOCAL_MACHINE\SOFTWARE\Origin Games' + '\\' + self.assertIn((key + '71073', 'DisplayName', 'Mass Effect 3'), entries) + self.assertIn((key + '71183', 'Locale', 'fr_FR'), entries) + self.assertFalse(any('bad id' in e[0] for e in entries)) + + def test_cpuid_probe_is_a_32_bit_console_program(self): + import struct + exe = store.cpuid_exe() + self.assertEqual(exe[:2], b'MZ') + self.assertEqual(exe[0x40:0x44], b'PE\0\0') + self.assertEqual(struct.unpack_from(' +#include +int unsetenv(const char *name) { return -1; } +int setenv(const char *name, const char *value, int overwrite) { return -1; } +int putenv(char *string) { return -1; } +int main(void) { + const char *names[] = {"LIBGL_KOPPER_DISABLE", "LIBGL_KOPPER_DISABLE_X", "ZINK_DEBUG", "VN_DEBUG"}; + for (int i = 0; i < 4; i++) { + const char *value = getenv(names[i]); + printf("%s=%s\n", names[i], value ? value : "(unset)"); + } + return 0; +} +""" + + +@unittest.skipUnless(shutil.which("cc"), "needs cc") +class VenusPreloadTest(unittest.TestCase): + @classmethod + def setUpClass(cls): + cls.tmp = Path(tempfile.mkdtemp()) + source = cls.tmp / "program.c" + source.write_text(PROGRAM) + cls.program = cls.tmp / "program" + cls.library = cls.tmp / "libvenus.so" + subprocess.run(["cc", "-O2", "-Wall", "-Werror", "-o", str(cls.program), str(source)], check=True) + subprocess.run(["cc", "-O2", "-Wall", "-Werror", "-shared", "-fPIC", "-o", str(cls.library), + str(PRELOAD / "venus.c")], check=True) + + @classmethod + def tearDownClass(cls): + shutil.rmtree(cls.tmp, ignore_errors=True) + + def values(self, **extra): + env = {"PATH": os.environ.get("PATH", ""), "LD_PRELOAD": str(self.library), **extra} + result = subprocess.run([str(self.program)], env=env, capture_output=True, text=True, check=True) + return dict(line.split("=", 1) for line in result.stdout.splitlines()) + + def test_kopper_is_kept_when_environment_changes_are_refused(self): + values = self.values(VN_DEBUG="vtest", LIBGL_KOPPER_DISABLE="true", LIBGL_KOPPER_DISABLE_X="1", + ZINK_DEBUG="mem") + self.assertEqual(values["LIBGL_KOPPER_DISABLE"], "(unset)") + self.assertEqual(values["LIBGL_KOPPER_DISABLE_X"], "1") + self.assertEqual(values["ZINK_DEBUG"], "mem") + self.assertEqual(values["VN_DEBUG"], "vtest") + + def test_other_sessions_keep_kopper_disabled(self): + self.assertEqual(self.values(LIBGL_KOPPER_DISABLE="true")["LIBGL_KOPPER_DISABLE"], "true") + self.assertEqual(self.values(VN_DEBUG="init", LIBGL_KOPPER_DISABLE="true")["LIBGL_KOPPER_DISABLE"], "true") + + def test_absent_variable_is_harmless(self): + self.assertEqual(self.values(VN_DEBUG="vtest")["LIBGL_KOPPER_DISABLE"], "(unset)") + + +if __name__ == "__main__": + unittest.main() diff --git a/tools/tests/test_wayland_clock_domain.py b/tools/tests/test_wayland_clock_domain.py new file mode 100644 index 0000000000..a805ff9c09 --- /dev/null +++ b/tools/tests/test_wayland_clock_domain.py @@ -0,0 +1,267 @@ +import ctypes +import mmap +import shutil +from pathlib import Path +import struct +import subprocess +import tempfile +import unittest + +from tools.tests.test_clock_pause_preload import clock_reset_command +from tools.tests.test_output_refresh import extract_function as extract_void_function +from tools.tests.test_scene_limit_hold import extract_function + +SOURCE = Path(__file__).resolve().parents[2] / "app/src/main/cpp/waylandcomp/src/clock_domain.c" +HEADER = SOURCE.with_suffix(".h") + + +@unittest.skipUnless(shutil.which("cc"), "needs a C compiler") +class WaylandClockDomainTest(unittest.TestCase): + def test_host_timestamp_uses_the_guest_domain(self): + with tempfile.TemporaryDirectory() as directory: + root = Path(directory) + control = root / "clock" + control.write_bytes(struct.pack("\n' + '#include "clock_domain.h"\n' + 'int main(int argc, char **argv) { (void)argc;\n' + ' droiddeck_clock_domain_set_control(argv[1]);\n' + ' printf("%lld %u %lld\\n", (long long)droiddeck_clock_domain_adjust_ns(30LL * 1000000000LL), ' + ' droiddeck_clock_domain_now_ms(), (long long)droiddeck_clock_domain_adjust_ns(5LL * 1000000000LL));\n' + ' return 0;\n' + '}\n' + ) + binary = root / "program" + subprocess.run(["cc", "-Wall", "-Wextra", "-Werror", "-O2", "-I", str(SOURCE.parent), "-o", str(binary), str(program), str(SOURCE)], + check=True) + result = subprocess.run([str(binary), str(control)], capture_output=True, text=True, check=True) + adjusted, now_ms, clamped = map(int, result.stdout.split()) + self.assertEqual(adjusted, 20_000_000_000) + self.assertGreaterEqual(now_ms, 0) + self.assertLessEqual(now_ms, 0xFFFFFFFF) + self.assertEqual(clamped, 0) + + def test_paced_release_uses_kernel_time_across_pause_offsets(self): + compositor = SOURCE.with_name("compositor.c").read_text() + functions = extract_function(compositor, "now_ns") + "\n" + extract_void_function(compositor, "arm_release_timer") + harness = r''' +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include +#include +#include +#include "clock_domain.h" + +struct pending_release { void *buffer; int64_t at_ns; struct pending_release *next; }; +static struct pending_release *g_pending_releases; +static int g_release_timer_fd; +#define wl_list_for_each(pr, list, link) for (pr = *(list); pr; pr = pr->next) +static int buffer_release_blocked(void *buffer) { return buffer != NULL; } + +@FUNCTIONS@ + +int main(int argc, char **argv) { + (void)argc; + droiddeck_clock_domain_set_control(argv[1]); + int control = open(argv[1], O_WRONLY); + assert(control >= 0); + g_release_timer_fd = timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK | TFD_CLOEXEC); + assert(g_release_timer_fd >= 0); + const int64_t offsets[] = {0, 10000000000LL, 300000000000LL}; + for (unsigned i = 0; i < sizeof(offsets) / sizeof(offsets[0]); i++) { + assert(pwrite(control, &offsets[i], sizeof(offsets[i]), 0) == sizeof(offsets[i])); + struct timespec started, ended; + clock_gettime(CLOCK_MONOTONIC, &started); + int64_t start = now_ns(); + struct pending_release blocked = {(void *)1, start + 1000000LL, NULL}; + struct pending_release release = {NULL, start + 60000000LL, &blocked}; + g_pending_releases = &release; + arm_release_timer(); + int64_t next_offset = offsets[i] + 10000000000LL; + assert(pwrite(control, &next_offset, sizeof(next_offset), 0) == sizeof(next_offset)); + struct pollfd pollfd = {g_release_timer_fd, POLLIN, 0}; + assert(poll(&pollfd, 1, 1000) == 1); + clock_gettime(CLOCK_MONOTONIC, &ended); + int64_t elapsed = (ended.tv_sec - started.tv_sec) * 1000000000LL + ended.tv_nsec - started.tv_nsec; + assert(elapsed >= 50000000LL && elapsed < 1000000000LL); + uint64_t expirations; + assert(read(g_release_timer_fd, &expirations, sizeof(expirations)) == sizeof(expirations)); + assert(expirations == 1); + g_pending_releases = &blocked; + arm_release_timer(); + struct itimerspec remaining; + assert(timerfd_gettime(g_release_timer_fd, &remaining) == 0); + assert(remaining.it_value.tv_sec == 0 && remaining.it_value.tv_nsec == 0); + } + close(g_release_timer_fd); + close(control); + return 0; +} +''' + with tempfile.TemporaryDirectory() as directory: + root = Path(directory) + control = root / "clock" + control.write_bytes(struct.pack("\n' + '#include "clock_domain.h"\n' + 'int main(int argc, char **argv) { (void)argc;\n' + ' droiddeck_clock_domain_set_control(argv[1]);\n' + ' printf("%lld\\n", (long long)droiddeck_clock_domain_adjust_ns(30LL * 1000000000LL));\n' + ' droiddeck_clock_domain_set_control(argv[2]);\n' + ' printf("%lld\\n", (long long)droiddeck_clock_domain_adjust_ns(30LL * 1000000000LL));\n' + ' return 0;\n' + '}\n' + ) + binary = root / "program" + subprocess.run(["cc", "-Wall", "-Wextra", "-Werror", "-O2", "-I", str(SOURCE.parent), "-o", str(binary), str(program), str(SOURCE)], + check=True) + result = subprocess.run([str(binary), str(control), str(root / "missing")], capture_output=True, text=True, check=True) + self.assertEqual(result.stdout.split(), ["30000000000", "30000000000"]) + + def test_replaced_control_file_updates_offset_without_invalidating_readers(self): + with tempfile.TemporaryDirectory() as directory: + root = Path(directory) + control = root / "clock" + replacement = root / "replacement" + control.write_bytes(struct.pack("\n' + '#include "clock_domain.h"\n' + 'int main(int argc, char **argv) { (void)argc;\n' + ' droiddeck_clock_domain_set_control(argv[1]);\n' + ' printf("%lld\\n", (long long)droiddeck_clock_domain_adjust_ns(30LL * 1000000000LL));\n' + ' if (rename(argv[2], argv[1]) != 0) return 1;\n' + ' droiddeck_clock_domain_set_control(argv[1]);\n' + ' printf("%lld\\n", (long long)droiddeck_clock_domain_adjust_ns(30LL * 1000000000LL));\n' + ' return 0;\n' + '}\n' + ) + binary = root / "program" + subprocess.run(["cc", "-Wall", "-Wextra", "-Werror", "-O2", "-I", str(SOURCE.parent), "-o", str(binary), str(program), str(SOURCE)], + check=True) + result = subprocess.run([str(binary), str(control), str(replacement)], capture_output=True, text=True, check=True) + self.assertEqual(result.stdout.split(), ["20000000000", "10000000000"]) + + def test_session_transition_clears_stale_offset_but_live_failures_preserve_it(self): + harness = r''' +#include +#include +#include +#include +#include "clock_domain.h" + +int main(int argc, char **argv) { + (void)argc; + int64_t shift = 10000000000LL; + int fd = open(argv[1], O_CREAT | O_RDWR, 0600); + assert(fd >= 0); + assert(write(fd, &shift, sizeof(shift)) == sizeof(shift)); + droiddeck_clock_domain_set_control(argv[1]); + assert(droiddeck_clock_domain_adjust_ns(30000000000LL) == 20000000000LL); + assert(unlink(argv[1]) == 0); + droiddeck_clock_domain_set_control(argv[1]); + assert(droiddeck_clock_domain_adjust_ns(30000000000LL) == 20000000000LL); + int replacement = open(argv[1], O_CREAT | O_RDWR, 0600); + assert(replacement >= 0); + droiddeck_clock_domain_set_control(argv[1]); + assert(droiddeck_clock_domain_adjust_ns(30000000000LL) == 20000000000LL); + droiddeck_clock_domain_set_control(NULL); + droiddeck_clock_domain_set_control(argv[1]); + assert(droiddeck_clock_domain_adjust_ns(30000000000LL) == 30000000000LL); + shift = 20000000000LL; + assert(write(replacement, &shift, sizeof(shift)) == sizeof(shift)); + droiddeck_clock_domain_set_control(argv[1]); + assert(droiddeck_clock_domain_adjust_ns(30000000000LL) == 10000000000LL); + close(replacement); + close(fd); + return 0; +} +''' + with tempfile.TemporaryDirectory() as directory: + root = Path(directory) + program = root / "program.c" + program.write_text(harness) + binary = root / "program" + subprocess.run(["cc", "-Wall", "-Wextra", "-Werror", "-O2", "-I", str(SOURCE.parent), + "-o", str(binary), str(program), str(SOURCE)], check=True) + subprocess.run([str(binary), str(root / "clock")], check=True, timeout=5) + host = SOURCE.parents[3] / "java/com/droiddeck/launcher/wayland/CompositorHost.kt" + self.assertIn("nativeSetClockControl(null)", host.read_text().split("fun newSession() {", 1)[1].split("}", 1)[0]) + + def test_startup_reset_keeps_host_and_guest_on_the_same_inode(self): + with tempfile.TemporaryDirectory() as directory: + root = Path(directory) + control = root / "clock" + control.write_bytes(struct.pack("\n' + '#include "clock_domain.h"\n' + 'int main(int argc, char **argv) { (void)argc;\n' + ' droiddeck_clock_domain_set_control(argv[1]);\n' + ' printf("%lld\\n", (long long)droiddeck_clock_domain_adjust_ns(30LL * 1000000000LL));\n' + ' if (rename(argv[2], argv[1]) != 0) return 1;\n' + ' droiddeck_clock_domain_set_control(argv[1]);\n' + ' printf("%lld\\n", (long long)droiddeck_clock_domain_adjust_ns(30LL * 1000000000LL));\n' + ' return 0;\n' + '}\n' + ) + binary = root / "program" + subprocess.run(["cc", "-Wall", "-Wextra", "-Werror", "-O2", "-I", str(SOURCE.parent), + "-o", str(binary), str(program), str(SOURCE)], check=True) + result = subprocess.run([str(binary), str(control), str(replacement)], capture_output=True, text=True, check=True) + self.assertEqual(result.stdout.split(), ["30000000000", "10000000000"]) + + +if __name__ == "__main__": + unittest.main() diff --git a/tools/tests/test_webhelper_preload.py b/tools/tests/test_webhelper_preload.py index 7c49e1d765..a7476945ce 100644 --- a/tools/tests/test_webhelper_preload.py +++ b/tools/tests/test_webhelper_preload.py @@ -9,9 +9,16 @@ PRELOAD = Path(__file__).resolve().parents[1] / "linuxfs/preload" PROGRAM = r""" #include -char *const *bl_webhelper_argv(const char *path, char *const argv[]); +#include +char *const *bl_webhelper_argv(const char *path, char *const argv[], char *const envp[]); int main(int argc, char **argv) { - char *const *out = bl_webhelper_argv(argv[1], argv + 1); + const char *mode = getenv("TEST_NODE_MODE_CHILD"); + static char node[64]; + snprintf(node, sizeof node, "ELECTRON_RUN_AS_NODE=%s", mode ? mode : ""); + char *node_env[] = {node, NULL}; + char *plain_env[] = {"PATH=/usr/bin", NULL}; + char *const *envp = mode ? node_env : plain_env; + char *const *out = bl_webhelper_argv(argv[1], argv + 1, (char *const *)envp); for (int i = 0; out[i]; i++) printf("%s\n", out[i]); return 0; } @@ -35,13 +42,28 @@ class WebhelperPreloadTest(unittest.TestCase): def tearDownClass(cls): shutil.rmtree(cls.tmp, ignore_errors=True) - def argv(self, *args, spec=None): + def argv(self, *args, spec=None, node_child=False, parent_node=False): env = {k: v for k, v in os.environ.items() if k != "BL_WEBHELPER_ARGS"} + env.pop("ELECTRON_RUN_AS_NODE", None) if spec is not None: env["BL_WEBHELPER_ARGS"] = spec + if node_child is not False: + env["TEST_NODE_MODE_CHILD"] = "1" if node_child is True else node_child + else: + env.pop("TEST_NODE_MODE_CHILD", None) + if parent_node: + env["ELECTRON_RUN_AS_NODE"] = "1" result = subprocess.run([str(self.program), *args], env=env, capture_output=True, text=True, check=True) return result.stdout.splitlines() + def chromium(self, directory, name): + root = self.tmp / directory + root.mkdir(exist_ok=True) + executable = root / name + executable.touch() + (root / "chrome-sandbox").touch() + return str(executable) + def test_the_browser_process_keeps_its_helpers_in_process(self): out = self.argv(WEBHELPER, "-lang=en_US", "--enable-features=A", "--no-sandbox", "--disable-features=B,C") self.assertEqual(out, [WEBHELPER, "-lang=en_US", "--no-sandbox", "--no-zygote", "--in-process-gpu", @@ -57,6 +79,31 @@ class WebhelperPreloadTest(unittest.TestCase): other = ["/usr/bin/steam", "--enable-features=A"] self.assertEqual(self.argv(*other), other) + def test_node_mode_from_the_child_environment_skips_sandbox_injection(self): + code = self.chromium("vscode", "code") + self.assertEqual(self.argv(code, node_child=True), [code]) + + def test_any_nonempty_node_mode_value_skips_sandbox_injection(self): + code = self.chromium("vscode-true", "code") + for value in ("true", "0", "yes"): + self.assertEqual(self.argv(code, node_child=value), [code]) + + def test_empty_node_mode_value_still_gets_sandbox_flag(self): + chrome = self.chromium("chromium-empty-mode", "chrome") + self.assertEqual(self.argv(chrome, node_child=""), [chrome, "--no-sandbox"]) + + def test_non_browser_helper_beside_chrome_sandbox_skips_injection_in_node_mode(self): + helper = self.chromium("vscode-helper", "remote-cli") + self.assertEqual(self.argv(helper, node_child=True), [helper]) + + def test_chromium_gui_launch_still_gets_sandbox_flag_from_explicit_environment(self): + chrome = self.chromium("chromium", "chrome") + self.assertEqual(self.argv(chrome), [chrome, "--no-sandbox"]) + + def test_parent_node_mode_does_not_override_the_explicit_child_environment(self): + chrome = self.chromium("chromium-parent-mode", "chrome") + self.assertEqual(self.argv(chrome, parent_node=True), [chrome, "--no-sandbox"]) + def test_stock_turns_it_off(self): args = [WEBHELPER, "--enable-features=A"] self.assertEqual(self.argv(*args, spec="stock"), args) diff --git a/tools/tests/test_wincomponents.py b/tools/tests/test_wincomponents.py index e6ad95e2d6..7423fb2bbf 100644 --- a/tools/tests/test_wincomponents.py +++ b/tools/tests/test_wincomponents.py @@ -92,6 +92,18 @@ class WinComponentsTest(unittest.TestCase): self.assertEqual(names, ["ucrtbase"]) self.assertEqual(MODULE["pe_machine"](self.pfx / "system32/ucrtbase.dll"), 0x8664) + def test_x64_visual_cpp_runtime_is_placed_in_arm64_system32(self): + proton = self.proton() + self.component("vc", ["msvcp140", "vcruntime140_1"], { + "system32/msvcp140.dll": self.pe_image(0x8664), + "system32/vcruntime140_1.dll": self.pe_image(0x8664), + }) + self.pick("vc") + names, _ = self.apply(proton) + self.assertEqual(names, ["msvcp140", "vcruntime140_1"]) + self.assertEqual(MODULE["pe_machine"](self.pfx / "system32/msvcp140.dll"), 0x8664) + self.assertEqual(MODULE["pe_machine"](self.pfx / "system32/vcruntime140_1.dll"), 0x8664) + def test_compatible_copy_keeps_override_when_other_architecture_copy_is_skipped(self): proton = self.proton() self.component("vc", ["ucrtbase"], { diff --git a/tools/ubisoft-launcher/.gitignore b/tools/ubisoft-launcher/.gitignore new file mode 100644 index 0000000000..90de6fc989 --- /dev/null +++ b/tools/ubisoft-launcher/.gitignore @@ -0,0 +1,2 @@ +target/ +out/ diff --git a/tools/ubisoft-launcher/Cargo.lock b/tools/ubisoft-launcher/Cargo.lock new file mode 100644 index 0000000000..a2bc2229ea --- /dev/null +++ b/tools/ubisoft-launcher/Cargo.lock @@ -0,0 +1,105 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "droiddeck-ubisoft-launcher" +version = "0.1.0" +dependencies = [ + "serde_json", +] + +[[package]] +name = "itoa" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bd1574e617a9a6c1f8f8181bd7e841e1f20e4277607ef28945765188d6284d4" + +[[package]] +name = "memchr" +version = "2.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" + +[[package]] +name = "proc-macro2" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "serde" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba" +dependencies = [ + "serde_core", +] + +[[package]] +name = "serde_core" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.154" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "syn" +version = "3.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563" + +[[package]] +name = "zmij" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" diff --git a/tools/ubisoft-launcher/Cargo.toml b/tools/ubisoft-launcher/Cargo.toml new file mode 100644 index 0000000000..e90819761e --- /dev/null +++ b/tools/ubisoft-launcher/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "droiddeck-ubisoft-launcher" +version = "0.1.0" +edition = "2021" +license = "GPL-3.0-only" +publish = false + +[[bin]] +name = "droiddeck-upc" +path = "src/main.rs" + +[dependencies] +serde_json = "1" + +[profile.release] +opt-level = "s" +lto = true +panic = "abort" +strip = true diff --git a/tools/ubisoft-launcher/build.sh b/tools/ubisoft-launcher/build.sh new file mode 100755 index 0000000000..437d2c2df0 --- /dev/null +++ b/tools/ubisoft-launcher/build.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +# Builds droiddeck-upc.exe for Wine and stages it with the guest scripts. +set -euo pipefail +here=$(cd "$(dirname "$0")" && pwd) +out=${1:-"$here/../../app/src/main/assets/linuxfs/usr/local/lib/droiddeck-ubisoft"} +target=x86_64-pc-windows-gnu +rustup target add "$target" >/dev/null 2>&1 || true +cargo build --manifest-path "$here/Cargo.toml" --release --locked --target "$target" +mkdir -p "$out" +install -m644 "${CARGO_TARGET_DIR:-$here/target}/$target/release/droiddeck-upc.exe" "$out/droiddeck-upc.exe" diff --git a/tools/ubisoft-launcher/src/launcher.rs b/tools/ubisoft-launcher/src/launcher.rs new file mode 100644 index 0000000000..343708dba0 --- /dev/null +++ b/tools/ubisoft-launcher/src/launcher.rs @@ -0,0 +1,513 @@ +//! What Ubisoft Connect answers on its local pipes, built from the launch configuration. +//! +//! Field numbers follow `mg.protocol.uplaydll` and `game_starter` as embedded in Ubisoft's own +//! `uplay_r1.dll`; see docs/development/ubisoft-launch.md. + +use crate::pb::{self, Msg, Value}; +use serde_json::Value as Json; + +pub const GAME_START: &str = "game_start_ipc_pipe_"; +pub const API_PROCESS: &str = "uplay_api_process_ipc_pipe_"; +pub const SESSION: &str = "uplay_ipc_pipe_"; +pub const AUX: &str = "uplay_aux_ipc_pipe_"; +pub const SERVICE: &str = "uplay_service_ipc_pipe_"; +pub const ORBIT: &str = "orbit_ipc_pipe_"; +/// Pipes Connect creates that the game may open; they are held open without answers. +pub const QUIET: &[&str] = &[ + "upc_api_process_ipc_pipe_standard", + "uplay_protocol_ipc_pipe_", + "uplay_overlay_ipc_pipe_", + "uplay_crash_reporter_ipc_pipe_", +]; +/// `GetOsiRsp.Status.Failed`: no online-services pipe is offered. +const OSI_FAILED: u64 = 1; +/// The add-on list Connect returns from the aux init; the game echoes it back. +const AUX_ADDONS: [u64; 3] = [3367, 3368, 3962]; +/// `OverlayInjectionMethod_None`. +const OVERLAY_NONE: u64 = 1; +const HWSCORE: &str = "C:/ProgramData/Ubisoft/Ubisoft Game Launcher/cache//statistics/hwscore"; + +pub struct Config { + pub product: u32, + pub exe: String, + pub args: String, + pub workdir: String, + pub user_id: String, + pub username: String, + pub name_on_platform: String, + pub email: String, + pub country: String, + pub ticket: String, + pub owned: Vec, + pub app_id: String, + pub saves: String, + pub language: String, + pub bridge: String, + pub log: String, + /// Installed chunks of the game's manifest: id and tags. + pub chunks: Vec<(u32, String)>, + /// Owned products and their ownership type (0 game, 1 add-on). + pub products: Vec<(u32, u32)>, +} + +fn s(j: &Json, k: &str) -> String { + j.get(k).and_then(|v| v.as_str()).unwrap_or_default().to_string() +} + +impl Config { + pub fn parse(text: &str) -> Result { + let j: Json = serde_json::from_str(text).map_err(|e| format!("config: {e}"))?; + let product = j.get("productId").and_then(|v| v.as_u64()).ok_or("config: no productId")? as u32; + let account = j.get("account").cloned().unwrap_or(Json::Null); + let mut owned: Vec = j.get("owned").and_then(|v| v.as_array()).map(|a| a.iter().filter_map(|v| v.as_u64()).map(|v| v as u32).collect()).unwrap_or_default(); + if !owned.contains(&product) { + owned.push(product); + } + let mut saves = s(&j, "saves").replace('\\', "/"); + if !saves.ends_with('/') { + saves.push('/'); + } + let c = Config { + product, + exe: s(&j, "exe"), + args: s(&j, "args"), + workdir: s(&j, "workdir"), + user_id: s(&account, "userId"), + username: s(&account, "username"), + name_on_platform: s(&account, "nameOnPlatform"), + email: s(&account, "email"), + country: s(&account, "country"), + ticket: s(&j, "ticket"), + owned, + app_id: s(&j, "appId"), + saves, + language: Some(s(&j, "language")).filter(|l| !l.is_empty()).unwrap_or_else(|| "en-US".into()), + bridge: s(&j, "bridge"), + log: s(&j, "log"), + chunks: j.get("chunks").and_then(|v| v.as_array()).map(|a| a.iter().filter_map(|c| { + Some((c.get("id")?.as_u64()? as u32, c.get("tags").and_then(|t| t.as_str()).unwrap_or("").to_string())) + }).collect()).unwrap_or_default(), + products: j.get("products").and_then(|v| v.as_array()).map(|a| a.iter().filter_map(|p| { + Some((p.get("id")?.as_u64()? as u32, p.get("type").and_then(|t| t.as_u64()).unwrap_or(0) as u32)) + }).collect()).unwrap_or_default(), + }; + if c.exe.is_empty() || c.ticket.is_empty() { + return Err("config: exe and ticket are required".into()); + } + Ok(c) + } + + fn root(&self) -> String { + let mut r = self.workdir.replace('\\', "/"); + if !r.ends_with('/') { + r.push('/'); + } + r + } + + /// The executable the way Connect hands it back: the install root, a slash, then the path under it. + pub fn reply_exe(&self, requested: &str) -> String { + let root = self.root(); + let base = root.trim_end_matches('/'); + let exe = requested.replace('\\', "/"); + let rel = if !base.is_empty() && exe.to_lowercase().starts_with(&(base.to_lowercase() + "/")) { &exe[base.len() + 1..] } else { &exe[..] }; + format!("{root}/{rel}") + } + + /// `game_starter.Downstream` granting the start the starter asked for. + pub fn game_start(&self, request: &[u8]) -> Vec { + let requested = pb::find(request, 10, 4).map(|b| String::from_utf8_lossy(b).into_owned()).unwrap_or_else(|| self.exe.clone()); + let progress = Msg::new() + .msg(1, Msg::new().uint(1, 1).uint(2, 113).uint(3, 0).uint(4, 1).uint(5, 0)) + .msg(1, Msg::new().uint(1, 3).uint(2, 123).uint(3, 0).uint(4, 0).uint(5, 0)); + let granted = Msg::new() + .uint(1, 0) + .uint(2, 0) + .text(3, &self.reply_exe(&requested)) + .text(4, &self.root()) + .uint(8, 3) + .msg(9, progress); + Msg::new().msg(2, Msg::new().msg(1, granted)).0 + } + + /// `Chunks`: every installed chunk, marked downloaded. + fn chunks(&self) -> Msg { + let mut m = Msg::new(); + for (id, tags) in &self.chunks { + m = m.msg(1, Msg::new().uint(1, *id as u64).uint(2, 1).text(3, tags)); + } + m + } + + /// `Rsp.initProcessRsp` for the game announcing its process. The overlay is reported off + /// everywhere: with it on, `uplay_r1.dll` loads `overlay.dll` and fails its startup without it. + pub fn init_process(&self) -> Vec { + Msg::new().msg(13, Msg::new().uint(1, 1).uint(3, 0).uint(4, OVERLAY_NONE).uint(6, 0)).0 + } + + /// `Rsp.initRsp`: the account, its products and the PC ticket. `uplay_r2.dll` copies the + /// install and storage state into objects it only creates for the subsystems the game asked + /// for, without checking them, so those parts follow the request when it names subsystems. + pub fn session(&self, wants: Option) -> Vec { + let account = Msg::new() + .text(1, &self.user_id) + .text(2, &self.username) + .text(3, &self.name_on_platform) + .text(4, &self.email) + .text(5, "") + .text(6, &self.country); + let mut body = Msg::new().uint(1, 1).msg(2, account).uint(3, 1).uint(4, self.product as u64); + for id in &self.owned { + body = body.uint(5, *id as u64); + } + body = body + .msg(6, Msg::new().uint(1, self.product as u64).text(2, "")) + .uint(7, 0) + .text(8, &self.ticket); + if wants.map_or(true, |w| w.install) { + body = body.msg(14, Msg::new().uint(1, 1).msg(2, self.chunks()).text(3, &self.language)); + } + body = body + .msg(11, Msg::new().uint(1, 0)) + .uint(12, 0) + .msg(15, Msg::new().uint(1, 0).uint(2, OVERLAY_NONE)) + .msg(16, Msg::new().uint(1, 6211).uint(2, 22395).float(3, 1.0)); + if wants.map_or(true, |w| w.storage) { + body = body.msg(17, Msg::new().text(1, &self.saves)); + } + body = body + .bytes(18, b"") + .msg(19, Msg::new().uint(1, 1).uint(2, 1)) + .msg(21, Msg::new().uint(2, 1)); + if wants.is_some() { + body = body.bytes(20, b""); + } + if !self.app_id.is_empty() { + body = body.msg(22, Msg::new().text(1, &self.app_id)); + } + Msg::new().msg(1, body.bytes(23, b"")).0 + } + + /// `Rsp.userRsp.getCredentialsRsp`: the account without its password, which DroidDeck never holds. + pub fn credentials(&self, request_id: u64) -> Vec { + let rsp = Msg::new().uint(1, request_id).text(2, &self.username).text(3, "").text(4, &self.user_id).text(5, &self.email); + Msg::new().msg(8, Msg::new().msg(1, rsp)).0 + } + + /// `Rsp.installerRsp.initInstallerRsp`. + pub fn installer(&self) -> Vec { + Msg::new().msg(10, Msg::new().msg(1, Msg::new().uint(1, 1).msg(2, self.chunks()).text(3, &self.language))).0 + } + + /// `Rsp.productRsp.getProductListRsp`: every owned product as owned, playable and purchased. + pub fn product_list(&self, request_id: u64) -> Vec { + let mut list = Msg::new().uint(1, request_id).uint(2, 1); + let products: Vec<(u32, u32)> = if self.products.is_empty() { self.owned.iter().map(|id| (*id, 0)).collect() } else { self.products.clone() }; + for (id, kind) in products { + list = list.msg(3, Msg::new().uint(1, id as u64).uint(2, if kind == 1 { 2 } else { 1 }).uint(3, 1).uint(4, 3).uint(6, 1)); + } + Msg::new().msg(15, Msg::new().msg(1, list)).0 + } + + pub fn service_hello(&self) -> Vec { + Msg::new().msg(3, Msg::new().uint(1, 1).msg(3, Msg::new().text(1, HWSCORE))).0 + } + + /// `mg.protocol.orbitdll.Rsp`. The DLL keeps its own `*.save` files in the folder `init` returns. + pub fn orbit(&self, body: &[u8]) -> Option<(Vec, String)> { + let f = pb::fields(body)?; + let id = pb::num(&f, 1)?; + let rsp = Msg::new().uint(1, id); + if let Some(init) = pb::sub(&f, 12) { + let product = pb::fields(init).and_then(|i| pb::num(&i, 1)).unwrap_or(0); + return Some((rsp.msg(12, Msg::new().text(1, &self.saves).uint(2, 1)).0, format!("init {id} for {product} answered"))); + } + if pb::has(&f, 2) { + let login = Msg::new().text(1, &self.username).text(2, "").text(3, ""); + return Some((rsp.msg(2, login).0, format!("login details {id} answered"))); + } + if let Some(osi) = pb::sub(&f, 3) { + let sub = pb::fields(osi).and_then(|o| pb::num(&o, 1)).unwrap_or(0); + return Some((rsp.msg(3, Msg::new().uint(2, OSI_FAILED)).0, format!("osi {id} for {sub} declined"))); + } + None + } +} + +/// Requests answered with only their id and a result: (`Req` field, its request) to (`Rsp` field, its +/// response, `OperationResult`). 1 is ok and 4 not found. +const ACKNOWLEDGED: &[(u32, u32, u32, u32, u64)] = &[ + (8, 1, 5, 1, 1), // achievements: list (none) + (8, 2, 5, 2, 4), // achievements: image + (8, 3, 5, 3, 1), // achievements: earn + (9, 1, 6, 1, 1), // overlay: show + (9, 2, 6, 2, 1), // overlay: shop url + (9, 4, 6, 3, 1), // overlay: browser url + (9, 5, 6, 4, 1), // overlay: notification + (9, 6, 6, 5, 1), // overlay: friend invitation + (9, 7, 6, 6, 1), // overlay: friend selection + (9, 8, 6, 8, 1), // overlay: micro app + (10, 1, 7, 1, 4), // avatar + (20, 1, 14, 1, 1), // store products (none) + (23, 3, 15, 5, 1), // track add-on + (25, 1, 17, 1, 4), // user lookup + (25, 3, 17, 3, 1), // rich presence + (25, 4, 17, 4, 1), // played with +]; + +/// `Rsp.streamingRsp` (20) for `Req.streamingReq` (27): the game is not streamed, so its streaming +/// type is `StreamingType_None` and every other streaming query is not found. +fn streaming(req: &[(u32, Value<'_>)]) -> (Vec, String) { + let id = pb::num(req, 1).unwrap_or(0); + let rsp = if pb::has(req, 3) { + Msg::new().uint(1, id).uint(2, 1).msg(4, Msg::new().uint(1, 0)) + } else { + Msg::new().uint(1, id).uint(2, 4) + }; + (Msg::new().msg(20, rsp).0, format!("streaming id {id} -> not streamed")) +} + +/// The id-and-result answer to a request in [ACKNOWLEDGED] or a streaming query, with a name for the log. +pub fn acknowledge(body: &[u8]) -> Option<(Vec, String)> { + let f = pb::fields(body)?; + if let Some(req) = pb::sub(&f, 27).and_then(pb::fields) { + return Some(streaming(&req)); + } + for &(req, sub, rsp, rsp_sub, result) in ACKNOWLEDGED { + let Some(inner) = pb::sub(&f, req).and_then(pb::fields) else { continue }; + let Some(leaf) = pb::sub(&inner, sub).and_then(pb::fields) else { continue }; + let id = pb::num(&leaf, 1).unwrap_or(0); + let answer = Msg::new().msg(rsp, Msg::new().msg(rsp_sub, Msg::new().uint(1, id).uint(2, result))).0; + return Some((answer, format!("{req}.{sub} id {id} -> {result}"))); + } + None +} + +/// The subsystems an `InitReq` asks for (fields 4 to 11). +#[derive(Clone, Copy, Debug, Default, PartialEq)] +pub struct Subsystems { + pub install: bool, + pub storage: bool, +} + +impl Subsystems { + /// `None` when the request names no subsystem at all. + pub fn of(init: &[u8]) -> Option { + let f = pb::fields(init)?; + if !(4..=11).any(|n| pb::has(&f, n)) { + return None; + } + let on = |n| pb::num(&f, n).unwrap_or(0) != 0; + Some(Subsystems { storage: on(7), install: on(8) }) + } +} + +pub enum SessionReq { + Init(Option), + Installer, + ProductList(u64), + Credentials(u64), + Other, +} + +pub fn session_request(body: &[u8]) -> SessionReq { + let Some(f) = pb::fields(body) else { return SessionReq::Other }; + let leaf = |req, sub| pb::sub(&f, req).and_then(pb::fields).and_then(|r| pb::sub(&r, sub).and_then(pb::fields)); + if pb::sub(&f, 13).and_then(pb::fields).is_some_and(|i| pb::has(&i, 1)) { + SessionReq::Installer + } else if pb::has(&f, 1) { + SessionReq::Init(pb::sub(&f, 1).and_then(Subsystems::of)) + } else if let Some(get) = leaf(11, 1) { + SessionReq::Credentials(pb::num(&get, 1).unwrap_or(0)) + } else if let Some(list) = leaf(23, 1) { + SessionReq::ProductList(pb::num(&list, 1).unwrap_or(0)) + } else { + SessionReq::Other + } +} + +/// The product and game process announced on the api-process pipe, each when the game names it +/// (Far Cry 3 Blood Dragon sends only its process). +pub fn announced(body: &[u8]) -> Option<(Option, Option)> { + let f = pb::fields(body)?; + let r = pb::fields(pb::sub(&f, 2)?)?; + let named = |n| pb::num(&r, n).map(|v| v as u32).filter(|v| *v != 0); + Some((named(1), named(2))) +} + +pub enum AuxReq<'a> { + Init(u64), + Activate(u64, &'a [u8]), + Other(u64), +} + +/// `UplayAuxDll.Req`: an init, or an activation carrying the game's Denuvo request token. +pub fn aux_request(body: &[u8]) -> AuxReq<'_> { + let Some(f) = pb::fields(body) else { return AuxReq::Other(0) }; + let rid = pb::num(&f, 1).unwrap_or(0); + let Some(activate) = pb::sub(&f, 3) else { + return if pb::has(&f, 2) { AuxReq::Init(rid) } else { AuxReq::Other(rid) }; + }; + let token = pb::fields(activate) + .and_then(|a| pb::sub(&a, 2).and_then(pb::fields)) + .and_then(|t| t.iter().find_map(|(n, v)| match v { Value::Bytes(b) if *n == 2 => Some(*b), _ => None })); + match token { + Some(t) => AuxReq::Activate(rid, t), + None => AuxReq::Other(rid), + } +} + +pub fn aux_init(rid: u64, pid: u32) -> Vec { + let mut init = Msg::new().uint(1, 1).uint(2, pid as u64); + for a in AUX_ADDONS { + init = init.uint(3, a); + } + Msg::new().uint(1, rid).msg(2, init).0 +} + +pub fn aux_token(rid: u64, game_token: &[u8]) -> Vec { + let answer = Msg::new().uint(2, 1).uint(3, 0).bytes(4, game_token).bytes(5, b""); + Msg::new().uint(1, rid).msg(3, Msg::new().msg(2, answer)).0 +} + +#[cfg(test)] +mod tests { + use super::*; + + fn config() -> Config { + Config::parse(r#"{"productId":109,"exe":"Z:/games/sc/system/splintercell.exe","workdir":"Z:/games/sc","ticket":"T", + "account":{"userId":"u1","username":"name","nameOnPlatform":"name","email":"e@x","country":"US"}, + "owned":[82],"appId":"a-b","saves":"Z:/saves/u1/109","chunks":[{"id":0,"tags":""},{"id":64,"tags":"custo05"}]}"#).unwrap() + } + + #[test] + fn the_owned_list_always_holds_the_game_and_saves_end_with_a_slash() { + let c = config(); + assert_eq!(c.owned, vec![82, 109]); + assert_eq!(c.saves, "Z:/saves/u1/109/"); + } + + #[test] + fn the_start_reply_names_the_exe_under_the_root_with_connects_double_slash() { + let c = config(); + assert_eq!(c.reply_exe("Z:\\games\\sc\\system\\splintercell.exe"), "Z:/games/sc//system/splintercell.exe"); + let req = Msg::new().msg(1, Msg::new().msg(1, Msg::new().uint(1, 13389).uint(2, 109).text(10, "Z:/games/sc/system/splintercell.exe"))); + let rsp = c.game_start(&req.0); + let granted = pb::fields(pb::sub(&pb::fields(pb::sub(&pb::fields(&rsp).unwrap(), 2).unwrap()).unwrap(), 1).unwrap()).unwrap(); + assert_eq!(pb::num(&granted, 1), Some(0)); + assert_eq!(pb::sub(&granted, 3), Some(&b"Z:/games/sc//system/splintercell.exe"[..])); + assert_eq!(pb::sub(&granted, 4), Some(&b"Z:/games/sc/"[..])); + assert_eq!(pb::num(&granted, 8), Some(3)); + } + + #[test] + fn the_session_carries_the_ticket_products_and_save_root() { + let rsp = config().session(None); + let init = pb::fields(pb::sub(&pb::fields(&rsp).unwrap(), 1).unwrap()).unwrap(); + assert_eq!(pb::num(&init, 1), Some(1)); + assert_eq!(pb::num(&init, 4), Some(109)); + let owned: Vec = init.iter().filter_map(|(n, v)| match v { Value::Int(x) if *n == 5 => Some(*x), _ => None }).collect(); + assert_eq!(owned, vec![82, 109]); + assert_eq!(pb::sub(&init, 8), Some(&b"T"[..])); + let saves = pb::fields(pb::sub(&init, 17).unwrap()).unwrap(); + assert_eq!(pb::sub(&saves, 1), Some(&b"Z:/saves/u1/109/"[..])); + let account = pb::fields(pb::sub(&init, 2).unwrap()).unwrap(); + assert_eq!(pb::sub(&account, 1), Some(&b"u1"[..])); + assert_eq!(pb::sub(&account, 5), Some(&b""[..])); + let install = pb::fields(pb::sub(&init, 14).unwrap()).unwrap(); + assert_eq!(pb::num(&install, 1), Some(1)); + let chunks = pb::fields(pb::sub(&install, 2).unwrap()).unwrap(); + let second = pb::fields(match &chunks[1].1 { Value::Bytes(b) => b, _ => panic!() }).unwrap(); + assert_eq!((pb::num(&second, 1), pb::num(&second, 2), pb::sub(&second, 3)), (Some(64), Some(1), Some(&b"custo05"[..]))); + } + + fn session_fields(rsp: &[u8]) -> Vec { + let init = pb::fields(pb::sub(&pb::fields(rsp).unwrap(), 1).unwrap()).unwrap(); + init.iter().map(|(n, _)| *n).collect() + } + + #[test] + fn an_r2_session_leaves_out_the_install_and_storage_the_game_did_not_ask_for() { + let req = Msg::new().msg(1, Msg::new().uint(1, 6145).uint(2, 512).uint(3, 2).uint(4, 1).uint(5, 1).uint(7, 1).uint(8, 0)); + let SessionReq::Init(wants) = session_request(&req.0) else { panic!() }; + assert_eq!(wants, Some(Subsystems { install: false, storage: true })); + let fields = session_fields(&config().session(wants)); + assert!(!fields.contains(&14)); + assert!(fields.contains(&17)); + assert!(fields.contains(&20)); + let all = session_fields(&config().session(Some(Subsystems { install: true, storage: true }))); + assert!(all.contains(&14) && all.contains(&17)); + } + + #[test] + fn streaming_queries_say_the_game_is_not_streamed() { + let (answer, _) = acknowledge(&[0xda, 0x01, 0x06, 0x08, 0x80, 0x80, 0x08, 0x1a, 0x00]).unwrap(); + let rsp = pb::fields(pb::sub(&pb::fields(&answer).unwrap(), 20).unwrap()).unwrap(); + assert_eq!((pb::num(&rsp, 1), pb::num(&rsp, 2)), (Some(0x20000), Some(1))); + assert_eq!(pb::num(&pb::fields(pb::sub(&rsp, 4).unwrap()).unwrap(), 1), Some(0)); + let (answer, _) = acknowledge(&Msg::new().msg(27, Msg::new().uint(1, 7).bytes(2, b"")).0).unwrap(); + let rsp = pb::fields(pb::sub(&pb::fields(&answer).unwrap(), 20).unwrap()).unwrap(); + assert_eq!((pb::num(&rsp, 1), pb::num(&rsp, 2)), (Some(7), Some(4))); + } + + #[test] + fn an_r1_session_without_subsystems_keeps_install_and_storage() { + let SessionReq::Init(wants) = session_request(&Msg::new().msg(1, Msg::new().uint(1, 109).uint(2, 4242)).0) else { panic!() }; + assert_eq!(wants, None); + let fields = session_fields(&config().session(wants)); + assert!(fields.contains(&14) && fields.contains(&17)); + assert!(!fields.contains(&20)); + } + + #[test] + fn requests_are_told_apart() { + assert!(matches!(session_request(&Msg::new().msg(1, Msg::new().uint(1, 109)).0), SessionReq::Init(None))); + assert!(matches!(session_request(&Msg::new().msg(13, Msg::new().bytes(1, b"")).0), SessionReq::Installer)); + assert!(matches!(session_request(&[0xba, 0x01, 0x06, 0x0a, 0x04, 0x08, 0x80, 0x80, 0x04]), SessionReq::ProductList(65536))); + let (answer, _) = acknowledge(&[0x42, 0x08, 0x0a, 0x06, 0x08, 0x80, 0x80, 0x08, 0x10, 0x00]).unwrap(); + let rsp = pb::fields(pb::sub(&pb::fields(pb::sub(&pb::fields(&answer).unwrap(), 5).unwrap()).unwrap(), 1).unwrap()).unwrap(); + assert_eq!((pb::num(&rsp, 1), pb::num(&rsp, 2)), (Some(0x20000), Some(1))); + assert!(acknowledge(&Msg::new().msg(1, Msg::new().uint(1, 1)).0).is_none()); + assert_eq!(announced(&Msg::new().msg(2, Msg::new().uint(1, 109).uint(2, 4242).uint(5, 1)).0), Some((Some(109), Some(4242)))); + assert_eq!(announced(&[0x12, 0x05, 0x10, 0x88, 0x04, 0x28, 0x01]), Some((None, Some(520)))); + assert!(matches!(session_request(&[0x5a, 0x04, 0x0a, 0x02, 0x08, 0x00]), SessionReq::Credentials(0))); + let activate = Msg::new().uint(1, 2).msg(3, Msg::new().msg(2, Msg::new().bytes(2, b"challenge").uint(3, 0))); + assert!(matches!(aux_request(&activate.0), AuxReq::Activate(2, b"challenge"))); + assert!(matches!(aux_request(&Msg::new().uint(1, 1).msg(2, Msg::new().uint(1, 109)).0), AuxReq::Init(1))); + } + + #[test] + fn orbit_init_answers_with_the_save_folder() { + let (rsp, what) = config().orbit(&[0x08, 0x01, 0x62, 0x03, 0x08, 0xcd, 0x01]).unwrap(); + assert_eq!(what, "init 1 for 205 answered"); + let f = pb::fields(&rsp).unwrap(); + assert_eq!(pb::num(&f, 1), Some(1)); + let init = pb::fields(pb::sub(&f, 12).unwrap()).unwrap(); + assert_eq!(pb::sub(&init, 1), Some(&b"Z:/saves/u1/109/"[..])); + assert_eq!(pb::num(&init, 2), Some(1)); + } + + #[test] + fn orbit_login_details_carry_no_password_and_osi_is_declined() { + let c = config(); + let (rsp, _) = c.orbit(&Msg::new().uint(1, 2).bytes(2, b"").0).unwrap(); + let f = pb::fields(&rsp).unwrap(); + let login = pb::fields(pb::sub(&f, 2).unwrap()).unwrap(); + assert_eq!((pb::sub(&login, 1), pb::sub(&login, 2), pb::sub(&login, 3)), (Some(&b"name"[..]), Some(&b""[..]), Some(&b""[..]))); + let (rsp, what) = c.orbit(&Msg::new().uint(1, 3).msg(3, Msg::new().uint(1, 7)).0).unwrap(); + assert_eq!(what, "osi 3 for 7 declined"); + let osi = pb::fields(pb::sub(&pb::fields(&rsp).unwrap(), 3).unwrap()).unwrap(); + assert_eq!((pb::num(&osi, 2), pb::has(&osi, 1)), (Some(OSI_FAILED), false)); + assert!(c.orbit(&Msg::new().uint(1, 4).0).is_none()); + } + + #[test] + fn credentials_name_the_account_without_a_password() { + let rsp = config().credentials(7); + let user = pb::fields(pb::sub(&pb::fields(&rsp).unwrap(), 8).unwrap()).unwrap(); + let get = pb::fields(pb::sub(&user, 1).unwrap()).unwrap(); + assert_eq!(pb::num(&get, 1), Some(7)); + assert_eq!((pb::sub(&get, 2), pb::sub(&get, 3), pb::sub(&get, 4), pb::sub(&get, 5)), + (Some(&b"name"[..]), Some(&b""[..]), Some(&b"u1"[..]), Some(&b"e@x"[..]))); + } +} diff --git a/tools/ubisoft-launcher/src/main.rs b/tools/ubisoft-launcher/src/main.rs new file mode 100644 index 0000000000..0b7126a919 --- /dev/null +++ b/tools/ubisoft-launcher/src/main.rs @@ -0,0 +1,355 @@ +//! Stands in for Ubisoft Connect on the local pipes a Ubisoft game talks to, and starts the game. +//! +//! Usage: droiddeck-upc.exe + +#![cfg_attr(windows, windows_subsystem = "windows")] + +mod launcher; +mod pb; +#[cfg(windows)] +mod win; + +#[cfg(not(windows))] +fn main() { + eprintln!("droiddeck-upc runs inside Wine"); + std::process::exit(2); +} + +#[cfg(windows)] +fn main() { + std::process::exit(service::run()); +} + +#[cfg(windows)] +mod service { + use crate::launcher::{self, AuxReq, Config, SessionReq}; + use crate::win::{self, Handle}; + use std::fs::OpenOptions; + use std::io::Write; + use std::path::PathBuf; + use std::sync::atomic::{AtomicU32, Ordering}; + use std::sync::{Arc, Mutex}; + use std::thread; + use std::time::{Duration, Instant}; + + const MAX_FRAME: usize = 16 << 20; + const ANNOUNCE_WAIT: Duration = Duration::from_secs(120); + const RESTART_WAIT: Duration = Duration::from_secs(15); + const DENUVO_WAIT: Duration = Duration::from_secs(90); + + struct State { + cfg: Config, + prefix: String, + log: Mutex>, + event: Handle, + game: AtomicU32, + started: Instant, + } + + impl State { + fn say(&self, line: &str) { + let text = format!("[{:7.2}] {line}\n", self.started.elapsed().as_secs_f32()); + eprint!("droiddeck-upc: {text}"); + if let Some(f) = self.log.lock().unwrap().as_mut() { + let _ = f.write_all(text.as_bytes()); + } + } + } + + struct Frames<'a> { + pipe: &'a Handle, + buf: Vec, + } + + impl<'a> Frames<'a> { + fn new(pipe: &'a Handle) -> Self { + Frames { pipe, buf: Vec::new() } + } + + fn fill(&mut self) -> bool { + let mut chunk = vec![0u8; 65536]; + match self.pipe.read(&mut chunk) { + Some(n) => { + self.buf.extend_from_slice(&chunk[..n]); + true + } + None => false, + } + } + + /// The next message without its 4-byte big-endian length. + fn next(&mut self) -> Option> { + while self.buf.len() < 4 { + if !self.fill() { + return None; + } + } + let n = u32::from_be_bytes(self.buf[..4].try_into().unwrap()) as usize; + if n > MAX_FRAME { + return None; + } + while self.buf.len() < 4 + n { + if !self.fill() { + return None; + } + } + let body = self.buf[4..4 + n].to_vec(); + self.buf.drain(..4 + n); + Some(body) + } + } + + fn send(pipe: &Handle, body: &[u8]) -> bool { + let mut framed = (body.len() as u32).to_be_bytes().to_vec(); + framed.extend_from_slice(body); + pipe.write_all(&framed) + } + + fn hold(state: &State, name: &str, frames: &mut Frames) { + while let Some(body) = frames.next() { + state.say(&format!("{name}: {} B left unanswered", body.len())); + } + } + + fn game_start(state: &State, pipe: Handle) { + let mut frames = Frames::new(&pipe); + let Some(req) = frames.next() else { return }; + send(&pipe, &state.cfg.game_start(&req)); + state.say("game_start: start granted"); + hold(state, "game_start", &mut frames); + } + + fn api_process(state: &State, pipe: Handle) { + let mut frames = Frames::new(&pipe); + let Some(req) = frames.next() else { return }; + match launcher::announced(&req) { + Some((product, named)) => { + let product = product.unwrap_or(state.cfg.product); + match named.or_else(|| pipe.client_pid()) { + Some(pid) => { + state.say(&format!("api_process: product {product} is process {pid}")); + state.game.store(pid, Ordering::SeqCst); + } + None => state.say(&format!("api_process: product {product} named no process")), + } + } + None => state.say(&format!("api_process: {} B announcement not understood {}", req.len(), hex(&req, 32))), + } + send(&pipe, &state.cfg.init_process()); + state.event.set(); + hold(state, "api_process", &mut frames); + } + + fn session(state: &State, pipe: Handle) { + let mut frames = Frames::new(&pipe); + let mut pushes = 0; + while let Some(req) = frames.next() { + match launcher::session_request(&req) { + SessionReq::Init(wants) => { + pushes += 1; + send(&pipe, &state.cfg.session(wants)); + let asked = wants.map_or("no subsystems named".to_string(), |w| format!("install {}, storage {}", w.install, w.storage)); + state.say(&format!("session: init answered ({pushes}; {asked}; {})", hex(&req, 48))); + } + SessionReq::Installer => { + send(&pipe, &state.cfg.installer()); + state.say("session: installer init answered"); + } + SessionReq::Credentials(id) => { + send(&pipe, &state.cfg.credentials(id)); + state.say(&format!("session: credentials {id} answered")); + } + SessionReq::ProductList(id) => { + send(&pipe, &state.cfg.product_list(id)); + state.say(&format!("session: product list {id} answered")); + } + SessionReq::Other => match launcher::acknowledge(&req) { + Some((answer, what)) => { + send(&pipe, &answer); + state.say(&format!("session: {what}")); + } + None => state.say(&format!("session: {} B request {} not handled", req.len(), hex(&req, 24))), + }, + } + } + state.say("session: closed"); + } + + fn denuvo(state: &State, rid: u64, challenge: &[u8]) -> Option> { + if state.cfg.bridge.is_empty() { + return None; + } + let dir = PathBuf::from(&state.cfg.bridge); + let _ = std::fs::create_dir_all(&dir); + let rsp = dir.join(format!("denuvo-{rid}.rsp")); + let _ = std::fs::remove_file(&rsp); + let part = dir.join(format!("denuvo-{rid}.req.part")); + std::fs::write(&part, challenge).ok()?; + std::fs::rename(&part, dir.join(format!("denuvo-{rid}.req"))).ok()?; + let deadline = Instant::now() + DENUVO_WAIT; + while Instant::now() < deadline { + if let Ok(token) = std::fs::read(&rsp) { + let _ = std::fs::remove_file(&rsp); + return (!token.is_empty()).then_some(token); + } + thread::sleep(Duration::from_millis(200)); + } + None + } + + fn aux(state: &State, pipe: Handle) { + let mut frames = Frames::new(&pipe); + while let Some(req) = frames.next() { + match launcher::aux_request(&req) { + AuxReq::Init(rid) => { + send(&pipe, &launcher::aux_init(rid, win::pid())); + state.say("aux: init answered"); + } + AuxReq::Activate(rid, challenge) => { + state.say(&format!("aux: activation {rid} with a {} B challenge", challenge.len())); + match denuvo(state, rid, challenge) { + Some(token) => { + send(&pipe, &launcher::aux_token(rid, &token)); + state.say(&format!("aux: activation {rid} answered ({} B)", token.len())); + } + None => state.say(&format!("aux: no game token for activation {rid}")), + } + } + AuxReq::Other(rid) => state.say(&format!("aux: request {rid} not handled ({} B)", req.len())), + } + } + } + + fn service(state: &State, pipe: Handle) { + send(&pipe, &state.cfg.service_hello()); + let mut chunk = vec![0u8; 65536]; + while pipe.read(&mut chunk).is_some() {} + } + + fn orbit(state: &State, pipe: Handle) { + let mut frames = Frames::new(&pipe); + while let Some(req) = frames.next() { + match state.cfg.orbit(&req) { + Some((answer, what)) => { + send(&pipe, &answer); + state.say(&format!("orbit: {what}")); + } + None => state.say(&format!("orbit: {} B request {} not handled", req.len(), hex(&req, 24))), + } + } + state.say("orbit: closed"); + } + + fn quiet(state: &State, name: &str, pipe: Handle) { + state.say(&format!("{name}: connected")); + let mut chunk = vec![0u8; 65536]; + while let Some(n) = pipe.read(&mut chunk) { + state.say(&format!("{name}: {n} B unanswered {}", hex(&chunk[..n], 64))); + } + } + + fn serve(state: Arc, name: &'static str) { + thread::spawn(move || { + let full = format!("{}{name}", state.prefix); + loop { + let Some(pipe) = win::accept(&full) else { + state.say(&format!("{name}: cannot serve the pipe (error {})", win::last_error())); + return; + }; + let s = state.clone(); + thread::spawn(move || match name { + launcher::GAME_START => game_start(&s, pipe), + launcher::API_PROCESS => api_process(&s, pipe), + launcher::SESSION => session(&s, pipe), + launcher::AUX => aux(&s, pipe), + launcher::SERVICE => service(&s, pipe), + launcher::ORBIT => orbit(&s, pipe), + _ => quiet(&s, name, pipe), + }); + } + }); + } + + fn hex(b: &[u8], n: usize) -> String { + b.iter().take(n).map(|x| format!("{x:02x}")).collect() + } + + fn command_line(cfg: &Config) -> String { + let mut c = format!("\"{}\"", cfg.exe); + if !cfg.args.trim().is_empty() { + c.push(' '); + c.push_str(cfg.args.trim()); + } + c + } + + pub fn run() -> i32 { + let Some(path) = std::env::args().nth(1) else { + eprintln!("usage: droiddeck-upc "); + return 2; + }; + let parsed = std::fs::read_to_string(&path).map_err(|e| e.to_string()).and_then(|t| Config::parse(&t)); + let _ = std::fs::remove_file(&path); + let cfg = match parsed { + Ok(c) => c, + Err(e) => { + eprintln!("droiddeck-upc: {e}"); + return 2; + } + }; + let log = (!cfg.log.is_empty()).then(|| OpenOptions::new().create(true).append(true).open(&cfg.log).ok()).flatten(); + let state = Arc::new(State { + prefix: format!(r"\\.\pipe\terminal_{}_", win::session_id()), + cfg, + log: Mutex::new(log), + event: win::inheritable_event(), + game: AtomicU32::new(0), + started: Instant::now(), + }); + state.say(&format!("product {} on {}*", state.cfg.product, state.prefix)); + for name in [launcher::GAME_START, launcher::API_PROCESS, launcher::SESSION, launcher::AUX, launcher::SERVICE, launcher::ORBIT] + .into_iter() + .chain(launcher::QUIET.iter().copied()) + { + serve(state.clone(), name); + } + thread::sleep(Duration::from_millis(300)); + + let (child, pid) = match win::spawn(&command_line(&state.cfg), &state.cfg.workdir) { + Ok(c) => c, + Err(e) => { + state.say(&format!("cannot start {} (error {e})", state.cfg.exe)); + return 1; + } + }; + state.say(&format!("started {} as process {pid}", state.cfg.exe)); + while !child.wait(1000) {} + let mut code = child.exit_code(); + state.say(&format!("process {pid} exited with 0x{code:08x}")); + + let mut waiting = Instant::now(); + let mut limit = ANNOUNCE_WAIT; + loop { + let game = state.game.swap(0, Ordering::SeqCst); + if game != 0 { + match win::open_process(game) { + Some(h) => { + while !h.wait(1000) {} + code = h.exit_code(); + state.say(&format!("game process {game} exited with 0x{code:08x}")); + } + None => state.say(&format!("game process {game} is already gone")), + } + waiting = Instant::now(); + limit = RESTART_WAIT; + continue; + } + if waiting.elapsed() >= limit { + break; + } + thread::sleep(Duration::from_millis(500)); + } + state.say("done"); + code as i32 + } +} diff --git a/tools/ubisoft-launcher/src/pb.rs b/tools/ubisoft-launcher/src/pb.rs new file mode 100644 index 0000000000..d0ae27d160 --- /dev/null +++ b/tools/ubisoft-launcher/src/pb.rs @@ -0,0 +1,168 @@ +//! The protobuf wire format, enough to build and read the launcher messages by field number. + +pub fn varint(mut n: u64, out: &mut Vec) { + loop { + let b = (n & 0x7f) as u8; + n >>= 7; + if n == 0 { + out.push(b); + return; + } + out.push(b | 0x80); + } +} + +#[derive(Default, Clone)] +pub struct Msg(pub Vec); + +impl Msg { + pub fn new() -> Self { + Msg(Vec::new()) + } + + fn key(mut self, field: u32, wire: u8) -> Self { + varint(((field as u64) << 3) | wire as u64, &mut self.0); + self + } + + pub fn uint(self, field: u32, value: u64) -> Self { + let mut m = self.key(field, 0); + varint(value, &mut m.0); + m + } + + pub fn bytes(self, field: u32, value: &[u8]) -> Self { + let mut m = self.key(field, 2); + varint(value.len() as u64, &mut m.0); + m.0.extend_from_slice(value); + m + } + + pub fn text(self, field: u32, value: &str) -> Self { + self.bytes(field, value.as_bytes()) + } + + pub fn msg(self, field: u32, value: Msg) -> Self { + self.bytes(field, &value.0) + } + + pub fn float(self, field: u32, value: f32) -> Self { + let mut m = self.key(field, 5); + m.0.extend_from_slice(&value.to_le_bytes()); + m + } +} + +#[derive(Debug, Clone, PartialEq)] +pub enum Value<'a> { + Int(u64), + Bytes(&'a [u8]), +} + +fn read_varint(b: &[u8], i: &mut usize) -> Option { + let mut r = 0u64; + let mut shift = 0; + loop { + let c = *b.get(*i)?; + *i += 1; + if shift >= 64 { + return None; + } + r |= ((c & 0x7f) as u64) << shift; + if c & 0x80 == 0 { + return Some(r); + } + shift += 7; + } +} + +/// The top-level fields of a message, or `None` when it does not parse. +pub fn fields(b: &[u8]) -> Option)>> { + let mut out = Vec::new(); + let mut i = 0; + while i < b.len() { + let key = read_varint(b, &mut i)?; + let field = (key >> 3) as u32; + match key & 7 { + 0 => out.push((field, Value::Int(read_varint(b, &mut i)?))), + 1 => { + let v = b.get(i..i + 8)?; + i += 8; + out.push((field, Value::Int(u64::from_le_bytes(v.try_into().ok()?)))); + } + 2 => { + let n = read_varint(b, &mut i)? as usize; + let v = b.get(i..i.checked_add(n)?)?; + i += n; + out.push((field, Value::Bytes(v))); + } + 5 => { + let v = b.get(i..i + 4)?; + i += 4; + out.push((field, Value::Int(u32::from_le_bytes(v.try_into().ok()?) as u64))); + } + _ => return None, + } + } + Some(out) +} + +pub fn sub<'a>(f: &[(u32, Value<'a>)], field: u32) -> Option<&'a [u8]> { + f.iter().find_map(|(n, v)| match v { + Value::Bytes(b) if *n == field => Some(*b), + _ => None, + }) +} + +pub fn num(f: &[(u32, Value<'_>)], field: u32) -> Option { + f.iter().find_map(|(n, v)| match v { + Value::Int(x) if *n == field => Some(*x), + _ => None, + }) +} + +pub fn has(f: &[(u32, Value<'_>)], field: u32) -> bool { + f.iter().any(|(n, _)| *n == field) +} + +/// The first length-delimited `field` at any depth up to `depth`, searching breadth first. +pub fn find(b: &[u8], field: u32, depth: u32) -> Option<&[u8]> { + let f = fields(b)?; + if let Some(v) = sub(&f, field) { + return Some(v); + } + if depth == 0 { + return None; + } + f.iter().find_map(|(_, v)| match v { + Value::Bytes(inner) => find(inner, field, depth - 1), + _ => None, + }) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn round_trip() { + let m = Msg::new().uint(1, 300).text(2, "hi").msg(3, Msg::new().uint(4, 1)).float(5, 1.0); + let f = fields(&m.0).unwrap(); + assert_eq!(num(&f, 1), Some(300)); + assert_eq!(sub(&f, 2), Some(&b"hi"[..])); + assert_eq!(num(&fields(sub(&f, 3).unwrap()).unwrap(), 4), Some(1)); + assert_eq!(num(&f, 5), Some(0x3f80_0000)); + } + + #[test] + fn finds_nested_fields() { + let m = Msg::new().msg(1, Msg::new().msg(1, Msg::new().uint(2, 109).text(10, "C:/game.exe"))); + assert_eq!(find(&m.0, 10, 4), Some(&b"C:/game.exe"[..])); + assert_eq!(find(&m.0, 11, 4), None); + } + + #[test] + fn rejects_truncated_input() { + assert!(fields(&[0x0a, 0x05, 1, 2]).is_none()); + } +} diff --git a/tools/ubisoft-launcher/src/win.rs b/tools/ubisoft-launcher/src/win.rs new file mode 100644 index 0000000000..e6953f46d1 --- /dev/null +++ b/tools/ubisoft-launcher/src/win.rs @@ -0,0 +1,189 @@ +//! The handful of kernel32 calls the launcher needs. + +#![allow(non_snake_case, clippy::upper_case_acronyms)] + +use std::ffi::c_void; +use std::os::windows::ffi::OsStrExt; + +pub type HANDLE = *mut c_void; +pub const INVALID: HANDLE = -1isize as HANDLE; +const PIPE_ACCESS_DUPLEX: u32 = 3; +const PIPE_TYPE_BYTE: u32 = 0; +const PIPE_READMODE_BYTE: u32 = 0; +const PIPE_WAIT: u32 = 0; +const PIPE_UNLIMITED_INSTANCES: u32 = 255; +const ERROR_PIPE_CONNECTED: u32 = 535; +const HANDLE_FLAG_INHERIT: u32 = 1; +const SYNCHRONIZE: u32 = 0x0010_0000; +const PROCESS_QUERY_LIMITED_INFORMATION: u32 = 0x1000; +pub const WAIT_OBJECT_0: u32 = 0; +const BUFFER: u32 = 65536; + +#[repr(C)] +struct STARTUPINFOW { + cb: u32, + lpReserved: *mut u16, + lpDesktop: *mut u16, + lpTitle: *mut u16, + dwX: u32, + dwY: u32, + dwXSize: u32, + dwYSize: u32, + dwXCountChars: u32, + dwYCountChars: u32, + dwFillAttribute: u32, + dwFlags: u32, + wShowWindow: u16, + cbReserved2: u16, + lpReserved2: *mut u8, + hStdInput: HANDLE, + hStdOutput: HANDLE, + hStdError: HANDLE, +} + +#[repr(C)] +struct PROCESS_INFORMATION { + hProcess: HANDLE, + hThread: HANDLE, + dwProcessId: u32, + dwThreadId: u32, +} + +#[link(name = "kernel32")] +extern "system" { + fn CreateNamedPipeW(name: *const u16, open: u32, mode: u32, max: u32, out: u32, inp: u32, timeout: u32, sa: *mut c_void) -> HANDLE; + fn ConnectNamedPipe(h: HANDLE, ov: *mut c_void) -> i32; + fn ReadFile(h: HANDLE, buf: *mut u8, n: u32, read: *mut u32, ov: *mut c_void) -> i32; + fn WriteFile(h: HANDLE, buf: *const u8, n: u32, written: *mut u32, ov: *mut c_void) -> i32; + fn FlushFileBuffers(h: HANDLE) -> i32; + fn CloseHandle(h: HANDLE) -> i32; + fn GetLastError() -> u32; + fn CreateEventW(sa: *mut c_void, manual: i32, initial: i32, name: *const u16) -> HANDLE; + fn SetEvent(h: HANDLE) -> i32; + fn SetHandleInformation(h: HANDLE, mask: u32, flags: u32) -> i32; + fn CreateProcessW(app: *const u16, cmd: *mut u16, pa: *mut c_void, ta: *mut c_void, inherit: i32, flags: u32, + env: *mut c_void, cwd: *const u16, si: *mut STARTUPINFOW, pi: *mut PROCESS_INFORMATION) -> i32; + fn WaitForSingleObject(h: HANDLE, ms: u32) -> u32; + fn GetExitCodeProcess(h: HANDLE, code: *mut u32) -> i32; + fn OpenProcess(access: u32, inherit: i32, pid: u32) -> HANDLE; + fn ProcessIdToSessionId(pid: u32, session: *mut u32) -> i32; + fn GetNamedPipeClientProcessId(pipe: HANDLE, pid: *mut u32) -> i32; + fn GetCurrentProcessId() -> u32; +} + +pub fn wide(s: &str) -> Vec { + std::ffi::OsStr::new(s).encode_wide().chain(Some(0)).collect() +} + +pub fn last_error() -> u32 { + unsafe { GetLastError() } +} + +pub fn pid() -> u32 { + unsafe { GetCurrentProcessId() } +} + +pub fn session_id() -> u32 { + let mut s = 0; + if unsafe { ProcessIdToSessionId(GetCurrentProcessId(), &mut s) } == 0 { + return 1; + } + s +} + +pub struct Handle(pub HANDLE); +unsafe impl Send for Handle {} +unsafe impl Sync for Handle {} + +impl Drop for Handle { + fn drop(&mut self) { + if !self.0.is_null() && self.0 != INVALID { + unsafe { CloseHandle(self.0) }; + } + } +} + +impl Handle { + pub fn read(&self, buf: &mut [u8]) -> Option { + let mut n = 0u32; + let ok = unsafe { ReadFile(self.0, buf.as_mut_ptr(), buf.len() as u32, &mut n, std::ptr::null_mut()) }; + (ok != 0 && n > 0).then_some(n as usize) + } + + pub fn write_all(&self, mut data: &[u8]) -> bool { + while !data.is_empty() { + let mut n = 0u32; + if unsafe { WriteFile(self.0, data.as_ptr(), data.len() as u32, &mut n, std::ptr::null_mut()) } == 0 || n == 0 { + return false; + } + data = &data[n as usize..]; + } + unsafe { FlushFileBuffers(self.0) }; + true + } + + pub fn wait(&self, ms: u32) -> bool { + unsafe { WaitForSingleObject(self.0, ms) == WAIT_OBJECT_0 } + } + + pub fn exit_code(&self) -> u32 { + let mut c = 0; + unsafe { GetExitCodeProcess(self.0, &mut c) }; + c + } + + pub fn set(&self) { + unsafe { SetEvent(self.0) }; + } + + pub fn client_pid(&self) -> Option { + let mut pid = 0; + (unsafe { GetNamedPipeClientProcessId(self.0, &mut pid) } != 0 && pid != 0).then_some(pid) + } +} + +/// A new instance of the named pipe, waiting for its client; `None` when it cannot be created. +pub fn accept(name: &str) -> Option { + let w = wide(name); + let h = unsafe { + CreateNamedPipeW(w.as_ptr(), PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT, + PIPE_UNLIMITED_INSTANCES, BUFFER, BUFFER, 0, std::ptr::null_mut()) + }; + if h == INVALID { + return None; + } + let pipe = Handle(h); + if unsafe { ConnectNamedPipe(h, std::ptr::null_mut()) } == 0 && last_error() != ERROR_PIPE_CONNECTED { + return None; + } + Some(pipe) +} + +/// An auto-reset event the started process inherits. +pub fn inheritable_event() -> Handle { + let h = unsafe { CreateEventW(std::ptr::null_mut(), 0, 0, std::ptr::null()) }; + unsafe { SetHandleInformation(h, HANDLE_FLAG_INHERIT, HANDLE_FLAG_INHERIT) }; + Handle(h) +} + +pub fn spawn(command_line: &str, cwd: &str) -> Result<(Handle, u32), u32> { + let mut cmd = wide(command_line); + let dir = wide(cwd); + let mut si: STARTUPINFOW = unsafe { std::mem::zeroed() }; + si.cb = std::mem::size_of::() as u32; + let mut pi: PROCESS_INFORMATION = unsafe { std::mem::zeroed() }; + let ok = unsafe { + CreateProcessW(std::ptr::null(), cmd.as_mut_ptr(), std::ptr::null_mut(), std::ptr::null_mut(), 1, 0, + std::ptr::null_mut(), if cwd.is_empty() { std::ptr::null() } else { dir.as_ptr() }, &mut si, &mut pi) + }; + if ok == 0 { + return Err(last_error()); + } + drop(Handle(pi.hThread)); + Ok((Handle(pi.hProcess), pi.dwProcessId)) +} + +pub fn open_process(pid: u32) -> Option { + let h = unsafe { OpenProcess(SYNCHRONIZE | PROCESS_QUERY_LIMITED_INFORMATION, 0, pid) }; + (!h.is_null()).then(|| Handle(h)) +}