mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-12-03 03:25:39 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b70199bf4d |
No files matched your search
@@ -221,6 +221,14 @@ jobs:
|
||||
with:
|
||||
path: pa13
|
||||
key: pulseaudio-src-${{ steps.plan.outputs.pulseaudio-source }}
|
||||
- name: Cache proot
|
||||
id: proot
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
app/src/main/jniLibs/arm64-v8a/libproot.so
|
||||
app/src/main/jniLibs/arm64-v8a/libproot-loader.so
|
||||
key: proot-v2-${{ steps.plan.outputs.proot }}
|
||||
- name: Cache GOG Galaxy companion
|
||||
id: comet
|
||||
uses: actions/cache@v4
|
||||
@@ -279,6 +287,10 @@ jobs:
|
||||
- name: Build the AAudio sink into the audio bundle
|
||||
run: python3 tools/components/prepare.py audio
|
||||
|
||||
- name: Build proot
|
||||
if: steps.proot.outputs.cache-hit != 'true'
|
||||
run: python3 tools/components/prepare.py proot
|
||||
|
||||
- name: Build the non-Adreno test additions (Mali bridge client, Venus GL probe, Xclipse layer)
|
||||
run: |
|
||||
set -euo pipefail
|
||||
@@ -662,6 +674,20 @@ jobs:
|
||||
export NDK="$ANDROID_HOME/ndk/$NDK_VERSION"
|
||||
tools/syncthing/build.sh app/src/main/jniLibs/arm64-v8a
|
||||
|
||||
- name: Check the proot pack pin against this build
|
||||
run: |
|
||||
set -euo pipefail
|
||||
# shellcheck disable=SC1091
|
||||
source tools/packs/proot/release.env
|
||||
sha=$(sha256sum app/build/packs/proot.tar.zst | cut -d' ' -f1)
|
||||
size=$(stat -c %s app/build/packs/proot.tar.zst)
|
||||
if [ "$sha" != "$PROOT_PACK_SHA256" ] || [ "$size" != "$PROOT_PACK_SIZE" ]; then
|
||||
level=warning
|
||||
if [ "$GITHUB_EVENT_NAME" = pull_request ]; then level=error; fi
|
||||
echo "::$level::built proot pack $sha ($size bytes) does not match tools/packs/proot/release.env ($PROOT_PACK_SHA256, $PROOT_PACK_SIZE bytes). Source builds download the pinned pack, so set PROOT_PACK_SHA256=$sha and PROOT_PACK_SIZE=$size in tools/packs/proot/release.env."
|
||||
if [ "$level" = error ]; then exit 1; fi
|
||||
fi
|
||||
|
||||
- name: Check out MaliBridge
|
||||
run: git submodule update --init external/MaliBridge
|
||||
- name: Fetch the Mali (Venus) component (tools/venus/release.env)
|
||||
|
||||
@@ -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 directaudio tracking xbox comet butler powervr ubisoft rockstar dirt epic; do
|
||||
for name in proot directaudio tracking xbox comet butler powervr ubisoft rockstar dirt epic; 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)
|
||||
|
||||
@@ -39,8 +39,7 @@ DroidDeck brings the SteamOS experience to Android: Steam Gaming Mode, full Linu
|
||||
1. Android 9 or newer on Adreno 730 or newer, or any 8xx. Adreno 6xx, Mali, Xclipse and PowerVR are experimental. Adreno 710 is currently unsupported. No root needed.
|
||||
2. About 3 GB free for the runtime, plus 1.1 GB for the desktop and emulators.
|
||||
3. Install the [APK](https://github.com/Droid-Deck/DroidDeck/releases/download/0.7.11/DroidDeck-0.7.11.apk), install the Linux runtime, press **Play** and sign in to Steam.
|
||||
|
||||
Current Preview builds handle Android’s child-process limit during launch. The linked 0.7.11 release still uses the setup steps in its release notes.
|
||||
4. On Android 14 and newer, turn on **Disable child process restrictions** in Developer options. On Android 12 and 13, Steam's first launch shows a **Fix it for me** button that walks you through it.
|
||||
|
||||
Smart glasses setup is in the [support matrix](docs/smart-glasses-support.md). Release notes are in [docs/releases](docs/releases).
|
||||
|
||||
@@ -71,13 +70,14 @@ DroidDeck is [GPL-3.0](LICENSE). Steam and Proton belong to Valve Corporation. V
|
||||
- [FEX](https://github.com/FEX-Emu/FEX) (MIT) runs x86 code. DroidDeck's build puts the platform name under `AT_PLATFORM` so [sharun](https://github.com/VHSgunzo/sharun) AppImages by VHSgunzo (MIT) start through its [userland-execve](https://crates.io/crates/userland-execve) loader (MIT), and its GL thunk hands X errors to the program's own error handler. FEX's code disk cache was checked in its source. The fix for host stack left behind when a program leaves a signal handler without returning follows the approach suggested in [FEX-Emu/FEX#2487](https://github.com/FEX-Emu/FEX/issues/2487). The host stack fix for system calls that end a block is a backport of Ryan Houdek's [FEX-Emu/FEX#6122](https://github.com/FEX-Emu/FEX/pull/6122).
|
||||
- x86-64 programs on Wayland reach the GPU through FEX's Wayland client, wayland-egl and EGL thunks. The guest `wl_list` and `wl_array` helpers follow [libwayland](https://gitlab.freedesktop.org/wayland/wayland)'s `src/wayland-util.c` (MIT). The EGL extension table comes from the [Khronos EGL registry](https://github.com/KhronosGroup/EGL-Registry) (Apache-2.0) and Mesa's `egl_other.xml` (MIT).
|
||||
- x86 AppImages, and arm64 ones whose runtime can't unpack on Android, are unpacked with [uruntime](https://github.com/VHSgunzo/uruntime) by VHSgunzo (MIT), shipped unmodified with its licence.
|
||||
- DwarFS AppImages are unpacked by `dwarfsextract` from [DwarFS](https://github.com/mhx/dwarfs) by Marcus Holland-Moritz (MIT), the release binary uruntime embeds, taken out of its self-extracting wrapper and shipped with its licence.
|
||||
- DwarFS AppImages are unpacked without proot by `dwarfsextract` from [DwarFS](https://github.com/mhx/dwarfs) by Marcus Holland-Moritz (MIT), the release binary uruntime embeds, taken out of its self-extracting wrapper and shipped with its licence.
|
||||
- x86 programs linking OpenSSL 3 use the copy in the [Steam Linux Runtime 4.0](https://gitlab.steamos.cloud/steamrt/steamrt). x86 Linux games get the `/etc/asound.conf` that [pressure-vessel](https://gitlab.steamos.cloud/steamrt/steam-runtime-tools) writes.
|
||||
- `WriteProcessMemory` hooks fall back to `/proc/<pid>/mem` the way [Wine](https://gitlab.winehq.org/wine/wine)'s `server/ptrace.c` did before Wine 11.
|
||||
- Windows programs on noexec storage get executable copies of their image pages, following [@yujikaido](https://github.com/yujikaido)'s finding in [droiddeck-rp4pro](https://github.com/yujikaido/droiddeck-rp4pro) that Wine's own processes need the noexec shim.
|
||||
- Wine write watches use userfaultfd support in [Proton](https://github.com/ValveSoftware/wine)'s `dlls/ntdll/unix/virtual.c` (LGPL-2.1-or-later). libddsession supplies the arm64 syscall number and answers `PAGEMAP_SCAN` from `/proc/self/pagemap`.
|
||||
- libddsession runs Wine's arm64 `SIGUSR2` context handler (`dlls/ntdll/unix/signal_arm64.c`, LGPL-2.1-or-later) in place on a frame laid out like [Linux](https://github.com/torvalds/linux)'s `arch/arm64/kernel/signal.c`, and serves `fill_vm_counters` in `dlls/ntdll/unix/process.c` the kernel's own `/proc/<pid>/status`.
|
||||
- droiddeck-ntsync follows the [Linux](https://github.com/torvalds/linux) ntsync semantics in `Documentation/userspace-api/ntsync.rst` (GPL-2.0).
|
||||
- The proot fast path orders bindings like [PRoot](https://github.com/proot-me/proot)'s `path/binding.c` (GPL-2.0-or-later).
|
||||
- DiRT 3 and DiRT Showdown keep their telemetry socket the way RoccoC's DiRTTelemetryErrorFix (MIT) does, based on the fix by Carsten Gottschling.
|
||||
- Zink on PowerVR keeps colour textures in colour with Icenowy Zheng's upstream [Mesa](https://gitlab.freedesktop.org/mesa/mesa) fix d55418dae7 (MIT), carried as a runtime patch.
|
||||
- Games and AppImage, Flatpak and Snap programs such as emulators use `TU_DEBUG=sysmem` by default, as does the Steam client. Turnip sysmem rendering can be turned off in Performance settings, except with the Adreno 710/720 driver, which always uses it.
|
||||
|
||||
+10
-4
@@ -90,10 +90,16 @@ def desktopKde = rootProject.file('tools/desktop-kde/release.env').readLines()
|
||||
def trackingPack = rootProject.file('tools/packs/tracking/release.env').readLines()
|
||||
.findAll { it.contains('=') && !it.startsWith('#') }
|
||||
.collectEntries { def kv = it.split('=', 2); [(kv[0].trim()): kv[1].trim()] }
|
||||
def addonPacks = ['directaudio', 'tracking', 'xbox', 'comet', 'butler', 'powervr', 'ubisoft', 'rockstar', 'dirt', 'epic'].collectEntries { name ->
|
||||
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', 'ubisoft', 'rockstar', 'dirt', 'epic'].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")
|
||||
if (name == 'proot' && prootPackPin.PROOT_PACK_SHA256) {
|
||||
return [(name): [sha256: prootPackPin.PROOT_PACK_SHA256, size: (prootPackPin.PROOT_PACK_SIZE ?: '0') as long]]
|
||||
}
|
||||
return [(name): [sha256: '', size: 0L]]
|
||||
}
|
||||
def digest = java.security.MessageDigest.getInstance('SHA-256')
|
||||
@@ -207,7 +213,7 @@ android {
|
||||
jniLibs {
|
||||
useLegacyPackaging = true
|
||||
pickFirsts += ['**/libtermux.so']
|
||||
excludes += ['**/libproot.so', '**/libproot-loader.so', '**/libopencv_java4.so', '**/libmediapipe_tasks_jni.so']
|
||||
excludes += ['**/libproot.so', '**/libopencv_java4.so', '**/libmediapipe_tasks_jni.so']
|
||||
}
|
||||
}
|
||||
|
||||
@@ -268,9 +274,9 @@ tasks.named('preBuild').configure { dependsOn(stageSessionScripts) }
|
||||
def runtimeAssetsDir = layout.buildDirectory.dir('runtimeAssets')
|
||||
def stageRuntimeAssets = tasks.register('stageRuntimeAssets', Sync) {
|
||||
dependsOn(stageSessionScripts)
|
||||
from(layout.projectDirectory.dir('src/main/assets')) { exclude 'pulseaudio.tzst', 'linuxfs/libddfastpath.so', 'linuxfs/libddaudit.so' }
|
||||
from(layout.projectDirectory.dir('src/main/assets')) { exclude 'pulseaudio.tzst' }
|
||||
from(rootProject.file('tools/linuxfs/innoextract'))
|
||||
from(rootProject.file('tools')) { include 'droiddeckctl', 'droiddeck-scenario', 'adb_device.py'; into('agent/ctl') }
|
||||
from(rootProject.file('tools')) { include 'droiddeckctl', 'droiddeck-scenario', 'adb_device.py', 'proot_profile.py'; into('agent/ctl') }
|
||||
from(rootProject.file('tools/agent/AGENTS.md')) { into('agent/ctl') }
|
||||
from(rootProject.file('docs/agent-control.md')) { into('agent/ctl') }
|
||||
from(rootProject.file('tools/agent/skills')) { into('agent/skills') }
|
||||
|
||||
@@ -417,69 +417,5 @@
|
||||
android:name="backend:com.google.android.datatransport.cct.CctBackendFactory"
|
||||
tools:node="remove" />
|
||||
</service>
|
||||
<service android:name=".runtime.GuestWorker0" android:exported="false" android:process=":g0" />
|
||||
<service android:name=".runtime.GuestWorker1" android:exported="false" android:process=":g1" />
|
||||
<service android:name=".runtime.GuestWorker2" android:exported="false" android:process=":g2" />
|
||||
<service android:name=".runtime.GuestWorker3" android:exported="false" android:process=":g3" />
|
||||
<service android:name=".runtime.GuestWorker4" android:exported="false" android:process=":g4" />
|
||||
<service android:name=".runtime.GuestWorker5" android:exported="false" android:process=":g5" />
|
||||
<service android:name=".runtime.GuestWorker6" android:exported="false" android:process=":g6" />
|
||||
<service android:name=".runtime.GuestWorker7" android:exported="false" android:process=":g7" />
|
||||
<service android:name=".runtime.GuestWorker8" android:exported="false" android:process=":g8" />
|
||||
<service android:name=".runtime.GuestWorker9" android:exported="false" android:process=":g9" />
|
||||
<service android:name=".runtime.GuestWorker10" android:exported="false" android:process=":g10" />
|
||||
<service android:name=".runtime.GuestWorker11" android:exported="false" android:process=":g11" />
|
||||
<service android:name=".runtime.GuestWorker12" android:exported="false" android:process=":g12" />
|
||||
<service android:name=".runtime.GuestWorker13" android:exported="false" android:process=":g13" />
|
||||
<service android:name=".runtime.GuestWorker14" android:exported="false" android:process=":g14" />
|
||||
<service android:name=".runtime.GuestWorker15" android:exported="false" android:process=":g15" />
|
||||
<service android:name=".runtime.GuestWorker16" android:exported="false" android:process=":g16" />
|
||||
<service android:name=".runtime.GuestWorker17" android:exported="false" android:process=":g17" />
|
||||
<service android:name=".runtime.GuestWorker18" android:exported="false" android:process=":g18" />
|
||||
<service android:name=".runtime.GuestWorker19" android:exported="false" android:process=":g19" />
|
||||
<service android:name=".runtime.GuestWorker20" android:exported="false" android:process=":g20" />
|
||||
<service android:name=".runtime.GuestWorker21" android:exported="false" android:process=":g21" />
|
||||
<service android:name=".runtime.GuestWorker22" android:exported="false" android:process=":g22" />
|
||||
<service android:name=".runtime.GuestWorker23" android:exported="false" android:process=":g23" />
|
||||
<service android:name=".runtime.GuestWorker24" android:exported="false" android:process=":g24" />
|
||||
<service android:name=".runtime.GuestWorker25" android:exported="false" android:process=":g25" />
|
||||
<service android:name=".runtime.GuestWorker26" android:exported="false" android:process=":g26" />
|
||||
<service android:name=".runtime.GuestWorker27" android:exported="false" android:process=":g27" />
|
||||
<service android:name=".runtime.GuestWorker28" android:exported="false" android:process=":g28" />
|
||||
<service android:name=".runtime.GuestWorker29" android:exported="false" android:process=":g29" />
|
||||
<service android:name=".runtime.GuestWorker30" android:exported="false" android:process=":g30" />
|
||||
<service android:name=".runtime.GuestWorker31" android:exported="false" android:process=":g31" />
|
||||
<service android:name=".runtime.GuestWorker32" android:exported="false" android:process=":g32" />
|
||||
<service android:name=".runtime.GuestWorker33" android:exported="false" android:process=":g33" />
|
||||
<service android:name=".runtime.GuestWorker34" android:exported="false" android:process=":g34" />
|
||||
<service android:name=".runtime.GuestWorker35" android:exported="false" android:process=":g35" />
|
||||
<service android:name=".runtime.GuestWorker36" android:exported="false" android:process=":g36" />
|
||||
<service android:name=".runtime.GuestWorker37" android:exported="false" android:process=":g37" />
|
||||
<service android:name=".runtime.GuestWorker38" android:exported="false" android:process=":g38" />
|
||||
<service android:name=".runtime.GuestWorker39" android:exported="false" android:process=":g39" />
|
||||
<service android:name=".runtime.GuestWorker40" android:exported="false" android:process=":g40" />
|
||||
<service android:name=".runtime.GuestWorker41" android:exported="false" android:process=":g41" />
|
||||
<service android:name=".runtime.GuestWorker42" android:exported="false" android:process=":g42" />
|
||||
<service android:name=".runtime.GuestWorker43" android:exported="false" android:process=":g43" />
|
||||
<service android:name=".runtime.GuestWorker44" android:exported="false" android:process=":g44" />
|
||||
<service android:name=".runtime.GuestWorker45" android:exported="false" android:process=":g45" />
|
||||
<service android:name=".runtime.GuestWorker46" android:exported="false" android:process=":g46" />
|
||||
<service android:name=".runtime.GuestWorker47" android:exported="false" android:process=":g47" />
|
||||
<service android:name=".runtime.GuestWorker48" android:exported="false" android:process=":g48" />
|
||||
<service android:name=".runtime.GuestWorker49" android:exported="false" android:process=":g49" />
|
||||
<service android:name=".runtime.GuestWorker50" android:exported="false" android:process=":g50" />
|
||||
<service android:name=".runtime.GuestWorker51" android:exported="false" android:process=":g51" />
|
||||
<service android:name=".runtime.GuestWorker52" android:exported="false" android:process=":g52" />
|
||||
<service android:name=".runtime.GuestWorker53" android:exported="false" android:process=":g53" />
|
||||
<service android:name=".runtime.GuestWorker54" android:exported="false" android:process=":g54" />
|
||||
<service android:name=".runtime.GuestWorker55" android:exported="false" android:process=":g55" />
|
||||
<service android:name=".runtime.GuestWorker56" android:exported="false" android:process=":g56" />
|
||||
<service android:name=".runtime.GuestWorker57" android:exported="false" android:process=":g57" />
|
||||
<service android:name=".runtime.GuestWorker58" android:exported="false" android:process=":g58" />
|
||||
<service android:name=".runtime.GuestWorker59" android:exported="false" android:process=":g59" />
|
||||
<service android:name=".runtime.GuestWorker60" android:exported="false" android:process=":g60" />
|
||||
<service android:name=".runtime.GuestWorker61" android:exported="false" android:process=":g61" />
|
||||
<service android:name=".runtime.GuestWorker62" android:exported="false" android:process=":g62" />
|
||||
<service android:name=".runtime.GuestWorker63" android:exported="false" android:process=":g63" />
|
||||
</application>
|
||||
</manifest>
|
||||
@@ -39,7 +39,7 @@
|
||||
// - Same push constants as cas.frag: ndc, input size, sharpness [0..1].
|
||||
// CasSetup's const1.x = -1 / lerp(8, 5, sharpness) is computed here.
|
||||
// - The input is the effect chain's previous target at the same size, so the
|
||||
// output pixel reads the input pixel 1:1 (texel centres, edges clamped).
|
||||
// output pixel reads the input pixel 1:1 (texelFetch, edges clamped).
|
||||
// =============================================================================
|
||||
|
||||
// DD_HALF is set for the *_half_frag.h build (gen_shaders.sh): colour and
|
||||
@@ -64,8 +64,8 @@ layout(location = 0) in highp vec2 fragTexCoord;
|
||||
layout(location = 0) out vec4 outColor;
|
||||
|
||||
vec3 CasLoad(ivec2 p) {
|
||||
highp vec2 uv = (vec2(p) + 0.5) / pc.resolution;
|
||||
return textureLod(InputTexture, uv, 0.0).rgb;
|
||||
ivec2 sz = textureSize(InputTexture, 0);
|
||||
return texelFetch(InputTexture, clamp(p, ivec2(0), sz - ivec2(1)), 0).rgb;
|
||||
}
|
||||
|
||||
float AMin3F1(float x, float y, float z) { return min(x, min(y, z)); }
|
||||
|
||||
@@ -1,213 +1,214 @@
|
||||
// 1115.1.0
|
||||
// 1116.2.0
|
||||
#pragma once
|
||||
const uint32_t cas_ffx_half_code[] = {
|
||||
0x07230203,0x00010000,0x0008000b,0x000000d7,0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
|
||||
0x0007000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x00000047,0x000000d1,0x00030010,
|
||||
0x00000004,0x00000007,0x00030003,0x00000002,0x000001c2,0x00040005,0x00000004,0x6e69616d,
|
||||
0x00000000,0x00060005,0x0000000d,0x4c736143,0x2864616f,0x3b326976,0x00000000,0x00030005,
|
||||
0x0000000c,0x00000070,0x00070005,0x00000014,0x6e694d41,0x28314633,0x663b3166,0x31663b31,
|
||||
0x0000003b,0x00030005,0x00000011,0x00000078,0x00030005,0x00000012,0x00000079,0x00030005,
|
||||
0x00000013,0x0000007a,0x00070005,0x00000019,0x78614d41,0x28314633,0x663b3166,0x31663b31,
|
||||
0x0000003b,0x00030005,0x00000016,0x00000078,0x00030005,0x00000017,0x00000079,0x00030005,
|
||||
0x00000018,0x0000007a,0x00030005,0x0000001d,0x00007675,0x00030005,0x00000024,0x00004350,
|
||||
0x00040006,0x00000024,0x00000000,0x0063646e,0x00060006,0x00000024,0x00000001,0x6f736572,
|
||||
0x6974756c,0x00006e6f,0x00060006,0x00000024,0x00000002,0x72616873,0x73656e70,0x00000073,
|
||||
0x00030005,0x00000026,0x00006370,0x00060005,0x0000002f,0x75706e49,0x78655474,0x65727574,
|
||||
0x00000000,0x00030005,0x00000045,0x00007073,0x00060005,0x00000047,0x67617266,0x43786554,
|
||||
0x64726f6f,0x00000000,0x00040005,0x0000004d,0x6b616570,0x00000000,0x00030005,0x0000005a,
|
||||
0x00000062,0x00040005,0x00000060,0x61726170,0x0000006d,0x00030005,0x00000062,0x00000064,
|
||||
0x00040005,0x00000066,0x61726170,0x0000006d,0x00030005,0x00000068,0x00000065,0x00040005,
|
||||
0x00000069,0x61726170,0x0000006d,0x00030005,0x0000006c,0x00000066,0x00040005,0x00000070,
|
||||
0x61726170,0x0000006d,0x00030005,0x00000072,0x00000068,0x00040005,0x00000076,0x61726170,
|
||||
0x0000006d,0x00030005,0x00000078,0x00476e6d,0x00040005,0x00000079,0x61726170,0x0000006d,
|
||||
0x00040005,0x0000007e,0x61726170,0x0000006d,0x00040005,0x00000081,0x61726170,0x0000006d,
|
||||
0x00040005,0x00000085,0x61726170,0x0000006d,0x00040005,0x00000086,0x61726170,0x0000006d,
|
||||
0x00040005,0x00000089,0x61726170,0x0000006d,0x00030005,0x0000008d,0x0047786d,0x00040005,
|
||||
0x0000008e,0x61726170,0x0000006d,0x00040005,0x00000091,0x61726170,0x0000006d,0x00040005,
|
||||
0x00000094,0x61726170,0x0000006d,0x00040005,0x00000098,0x61726170,0x0000006d,0x00040005,
|
||||
0x00000099,0x61726170,0x0000006d,0x00040005,0x0000009c,0x61726170,0x0000006d,0x00040005,
|
||||
0x000000a0,0x4d706372,0x00000047,0x00040005,0x000000a5,0x47706d61,0x00000000,0x00030005,
|
||||
0x000000af,0x00004777,0x00050005,0x000000b3,0x57706372,0x68676965,0x00000074,0x00030005,
|
||||
0x000000b9,0x00786970,0x00050005,0x000000d1,0x4374756f,0x726f6c6f,0x00000000,0x00030047,
|
||||
0x0000000d,0x00000000,0x00030047,0x00000011,0x00000000,0x00030047,0x00000012,0x00000000,
|
||||
0x00030047,0x00000013,0x00000000,0x00030047,0x00000014,0x00000000,0x00030047,0x00000016,
|
||||
0x00000000,0x00030047,0x00000017,0x00000000,0x00030047,0x00000018,0x00000000,0x00030047,
|
||||
0x00000019,0x00000000,0x00030047,0x00000024,0x00000002,0x00050048,0x00000024,0x00000000,
|
||||
0x00000023,0x00000000,0x00050048,0x00000024,0x00000001,0x00000023,0x00000010,0x00040048,
|
||||
0x00000024,0x00000002,0x00000000,0x00050048,0x00000024,0x00000002,0x00000023,0x00000018,
|
||||
0x00030047,0x0000002f,0x00000000,0x00040047,0x0000002f,0x00000021,0x00000000,0x00040047,
|
||||
0x0000002f,0x00000022,0x00000000,0x00030047,0x00000030,0x00000000,0x00030047,0x00000033,
|
||||
0x00000000,0x00030047,0x00000034,0x00000000,0x00030047,0x00000037,0x00000000,0x00030047,
|
||||
0x00000038,0x00000000,0x00030047,0x00000039,0x00000000,0x00030047,0x0000003a,0x00000000,
|
||||
0x00030047,0x0000003b,0x00000000,0x00030047,0x0000003e,0x00000000,0x00030047,0x0000003f,
|
||||
0x00000000,0x00030047,0x00000040,0x00000000,0x00030047,0x00000041,0x00000000,0x00030047,
|
||||
0x00000042,0x00000000,0x00040047,0x00000047,0x0000001e,0x00000000,0x00030047,0x0000004d,
|
||||
0x00000000,0x00030047,0x00000054,0x00000000,0x00030047,0x00000056,0x00000000,0x00030047,
|
||||
0x00000057,0x00000000,0x00030047,0x00000058,0x00000000,0x00030047,0x0000005a,0x00000000,
|
||||
0x00030047,0x00000061,0x00000000,0x00030047,0x00000062,0x00000000,0x00030047,0x00000067,
|
||||
0x00000000,0x00030047,0x00000068,0x00000000,0x00030047,0x0000006b,0x00000000,0x00030047,
|
||||
0x0000006c,0x00000000,0x00030047,0x00000071,0x00000000,0x00030047,0x00000072,0x00000000,
|
||||
0x00030047,0x00000077,0x00000000,0x00030047,0x00000078,0x00000000,0x00030047,0x00000079,
|
||||
0x00000000,0x00030047,0x0000007d,0x00000000,0x00030047,0x0000007e,0x00000000,0x00030047,
|
||||
0x00000080,0x00000000,0x00030047,0x00000081,0x00000000,0x00030047,0x00000083,0x00000000,
|
||||
0x00030047,0x00000084,0x00000000,0x00030047,0x00000085,0x00000000,0x00030047,0x00000086,
|
||||
0x00000000,0x00030047,0x00000088,0x00000000,0x00030047,0x00000089,0x00000000,0x00030047,
|
||||
0x0000008b,0x00000000,0x00030047,0x0000008c,0x00000000,0x00030047,0x0000008d,0x00000000,
|
||||
0x00030047,0x0000008e,0x00000000,0x00030047,0x00000090,0x00000000,0x00030047,0x00000091,
|
||||
0x00000000,0x00030047,0x00000093,0x00000000,0x00030047,0x00000094,0x00000000,0x00030047,
|
||||
0x00000096,0x00000000,0x00030047,0x00000097,0x00000000,0x00030047,0x00000098,0x00000000,
|
||||
0x00030047,0x00000099,0x00000000,0x00030047,0x0000009b,0x00000000,0x00030047,0x0000009c,
|
||||
0x00000000,0x00030047,0x0000009e,0x00000000,0x00030047,0x0000009f,0x00000000,0x00030047,
|
||||
0x000000a0,0x00000000,0x00030047,0x000000a1,0x00000000,0x00030047,0x000000a3,0x00000000,
|
||||
0x00030047,0x000000a4,0x00000000,0x00030047,0x000000a5,0x00000000,0x00030047,0x000000a6,
|
||||
0x00000000,0x00030047,0x000000a7,0x00000000,0x00030047,0x000000a8,0x00000000,0x00030047,
|
||||
0x000000a9,0x00000000,0x00030047,0x000000aa,0x00000000,0x00030047,0x000000ab,0x00000000,
|
||||
0x00030047,0x000000ac,0x00000000,0x00030047,0x000000ad,0x00000000,0x00030047,0x000000ae,
|
||||
0x00000000,0x00030047,0x000000af,0x00000000,0x00030047,0x000000b0,0x00000000,0x00030047,
|
||||
0x000000b1,0x00000000,0x00030047,0x000000b2,0x00000000,0x00030047,0x000000b3,0x00000000,
|
||||
0x00030047,0x000000b5,0x00000000,0x00030047,0x000000b6,0x00000000,0x00030047,0x000000b7,
|
||||
0x00000000,0x00030047,0x000000b8,0x00000000,0x00030047,0x000000b9,0x00000000,0x00030047,
|
||||
0x000000ba,0x00000000,0x00030047,0x000000bb,0x00000000,0x00030047,0x000000bc,0x00000000,
|
||||
0x00030047,0x000000bd,0x00000000,0x00030047,0x000000be,0x00000000,0x00030047,0x000000bf,
|
||||
0x00000000,0x00030047,0x000000c0,0x00000000,0x00030047,0x000000c1,0x00000000,0x00030047,
|
||||
0x000000c2,0x00000000,0x00030047,0x000000c3,0x00000000,0x00030047,0x000000c4,0x00000000,
|
||||
0x00030047,0x000000c5,0x00000000,0x00030047,0x000000c6,0x00000000,0x00030047,0x000000c7,
|
||||
0x00000000,0x00030047,0x000000c8,0x00000000,0x00030047,0x000000c9,0x00000000,0x00030047,
|
||||
0x000000ca,0x00000000,0x00030047,0x000000cb,0x00000000,0x00030047,0x000000cc,0x00000000,
|
||||
0x00030047,0x000000cd,0x00000000,0x00030047,0x000000ce,0x00000000,0x00030047,0x000000cf,
|
||||
0x00000000,0x00030047,0x000000d1,0x00000000,0x00040047,0x000000d1,0x0000001e,0x00000000,
|
||||
0x00030047,0x000000d2,0x00000000,0x00030047,0x000000d3,0x00000000,0x00030047,0x000000d4,
|
||||
0x00000000,0x00030047,0x000000d5,0x00000000,0x00030047,0x000000d6,0x00000000,0x00020013,
|
||||
0x00000002,0x00030021,0x00000003,0x00000002,0x00040015,0x00000006,0x00000020,0x00000001,
|
||||
0x00040017,0x00000007,0x00000006,0x00000002,0x00040020,0x00000008,0x00000007,0x00000007,
|
||||
0x00030016,0x00000009,0x00000020,0x00040017,0x0000000a,0x00000009,0x00000003,0x00040021,
|
||||
0x0000000b,0x0000000a,0x00000008,0x00040020,0x0000000f,0x00000007,0x00000009,0x00060021,
|
||||
0x00000010,0x00000009,0x0000000f,0x0000000f,0x0000000f,0x00040017,0x0000001b,0x00000009,
|
||||
0x00000002,0x00040020,0x0000001c,0x00000007,0x0000001b,0x0004002b,0x00000009,0x00000020,
|
||||
0x3f000000,0x00040017,0x00000023,0x00000009,0x00000004,0x0005001e,0x00000024,0x00000023,
|
||||
0x0000001b,0x00000009,0x00040020,0x00000025,0x00000009,0x00000024,0x0004003b,0x00000025,
|
||||
0x00000026,0x00000009,0x0004002b,0x00000006,0x00000027,0x00000001,0x00040020,0x00000028,
|
||||
0x00000009,0x0000001b,0x00090019,0x0000002c,0x00000009,0x00000001,0x00000000,0x00000000,
|
||||
0x00000000,0x00000001,0x00000000,0x0003001b,0x0000002d,0x0000002c,0x00040020,0x0000002e,
|
||||
0x00000000,0x0000002d,0x0004003b,0x0000002e,0x0000002f,0x00000000,0x0004002b,0x00000009,
|
||||
0x00000032,0x00000000,0x00040020,0x00000046,0x00000001,0x0000001b,0x0004003b,0x00000046,
|
||||
0x00000047,0x00000001,0x0004002b,0x00000009,0x0000004e,0xbf800000,0x0004002b,0x00000009,
|
||||
0x0000004f,0x41000000,0x0004002b,0x00000009,0x00000050,0x40a00000,0x0004002b,0x00000006,
|
||||
0x00000051,0x00000002,0x00040020,0x00000052,0x00000009,0x00000009,0x0004002b,0x00000009,
|
||||
0x00000055,0x3f800000,0x00040020,0x00000059,0x00000007,0x0000000a,0x0004002b,0x00000006,
|
||||
0x0000005c,0x00000000,0x0004002b,0x00000006,0x0000005d,0xffffffff,0x0005002c,0x00000007,
|
||||
0x0000005e,0x0000005c,0x0000005d,0x0005002c,0x00000007,0x00000064,0x0000005d,0x0000005c,
|
||||
0x0005002c,0x00000007,0x0000006e,0x00000027,0x0000005c,0x0005002c,0x00000007,0x00000074,
|
||||
0x0000005c,0x00000027,0x00040015,0x0000007a,0x00000020,0x00000000,0x0004002b,0x0000007a,
|
||||
0x0000007b,0x00000001,0x0004002b,0x00000009,0x000000a2,0x3a800000,0x0004002b,0x00000009,
|
||||
0x000000b4,0x40800000,0x00040020,0x000000d0,0x00000003,0x00000023,0x0004003b,0x000000d0,
|
||||
0x000000d1,0x00000003,0x00050036,0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,
|
||||
0x00000005,0x0004003b,0x00000008,0x00000045,0x00000007,0x0004003b,0x0000000f,0x0000004d,
|
||||
0x00000007,0x0004003b,0x00000059,0x0000005a,0x00000007,0x0004003b,0x00000008,0x00000060,
|
||||
0x00000007,0x0004003b,0x00000059,0x00000062,0x00000007,0x0004003b,0x00000008,0x00000066,
|
||||
0x00000007,0x0004003b,0x00000059,0x00000068,0x00000007,0x0004003b,0x00000008,0x00000069,
|
||||
0x00000007,0x0004003b,0x00000059,0x0000006c,0x00000007,0x0004003b,0x00000008,0x00000070,
|
||||
0x00000007,0x0004003b,0x00000059,0x00000072,0x00000007,0x0004003b,0x00000008,0x00000076,
|
||||
0x00000007,0x0004003b,0x0000000f,0x00000078,0x00000007,0x0004003b,0x0000000f,0x00000079,
|
||||
0x00000007,0x0004003b,0x0000000f,0x0000007e,0x00000007,0x0004003b,0x0000000f,0x00000081,
|
||||
0x00000007,0x0004003b,0x0000000f,0x00000085,0x00000007,0x0004003b,0x0000000f,0x00000086,
|
||||
0x00000007,0x0004003b,0x0000000f,0x00000089,0x00000007,0x0004003b,0x0000000f,0x0000008d,
|
||||
0x00000007,0x0004003b,0x0000000f,0x0000008e,0x00000007,0x0004003b,0x0000000f,0x00000091,
|
||||
0x00000007,0x0004003b,0x0000000f,0x00000094,0x00000007,0x0004003b,0x0000000f,0x00000098,
|
||||
0x00000007,0x0004003b,0x0000000f,0x00000099,0x00000007,0x0004003b,0x0000000f,0x0000009c,
|
||||
0x00000007,0x0004003b,0x0000000f,0x000000a0,0x00000007,0x0004003b,0x0000000f,0x000000a5,
|
||||
0x00000007,0x0004003b,0x0000000f,0x000000af,0x00000007,0x0004003b,0x0000000f,0x000000b3,
|
||||
0x00000007,0x0004003b,0x00000059,0x000000b9,0x00000007,0x0004003d,0x0000001b,0x00000048,
|
||||
0x00000047,0x00050041,0x00000028,0x00000049,0x00000026,0x00000027,0x0004003d,0x0000001b,
|
||||
0x0000004a,0x00000049,0x00050085,0x0000001b,0x0000004b,0x00000048,0x0000004a,0x0004006e,
|
||||
0x00000007,0x0000004c,0x0000004b,0x0003003e,0x00000045,0x0000004c,0x00050041,0x00000052,
|
||||
0x00000053,0x00000026,0x00000051,0x0004003d,0x00000009,0x00000054,0x00000053,0x0008000c,
|
||||
0x00000009,0x00000056,0x00000001,0x0000002b,0x00000054,0x00000032,0x00000055,0x0008000c,
|
||||
0x00000009,0x00000057,0x00000001,0x0000002e,0x0000004f,0x00000050,0x00000056,0x00050088,
|
||||
0x00000009,0x00000058,0x0000004e,0x00000057,0x0003003e,0x0000004d,0x00000058,0x0004003d,
|
||||
0x00000007,0x0000005b,0x00000045,0x00050080,0x00000007,0x0000005f,0x0000005b,0x0000005e,
|
||||
0x0003003e,0x00000060,0x0000005f,0x00050039,0x0000000a,0x00000061,0x0000000d,0x00000060,
|
||||
0x0003003e,0x0000005a,0x00000061,0x0004003d,0x00000007,0x00000063,0x00000045,0x00050080,
|
||||
0x00000007,0x00000065,0x00000063,0x00000064,0x0003003e,0x00000066,0x00000065,0x00050039,
|
||||
0x0000000a,0x00000067,0x0000000d,0x00000066,0x0003003e,0x00000062,0x00000067,0x0004003d,
|
||||
0x00000007,0x0000006a,0x00000045,0x0003003e,0x00000069,0x0000006a,0x00050039,0x0000000a,
|
||||
0x0000006b,0x0000000d,0x00000069,0x0003003e,0x00000068,0x0000006b,0x0004003d,0x00000007,
|
||||
0x0000006d,0x00000045,0x00050080,0x00000007,0x0000006f,0x0000006d,0x0000006e,0x0003003e,
|
||||
0x00000070,0x0000006f,0x00050039,0x0000000a,0x00000071,0x0000000d,0x00000070,0x0003003e,
|
||||
0x0000006c,0x00000071,0x0004003d,0x00000007,0x00000073,0x00000045,0x00050080,0x00000007,
|
||||
0x00000075,0x00000073,0x00000074,0x0003003e,0x00000076,0x00000075,0x00050039,0x0000000a,
|
||||
0x00000077,0x0000000d,0x00000076,0x0003003e,0x00000072,0x00000077,0x00050041,0x0000000f,
|
||||
0x0000007c,0x00000062,0x0000007b,0x0004003d,0x00000009,0x0000007d,0x0000007c,0x0003003e,
|
||||
0x00000079,0x0000007d,0x00050041,0x0000000f,0x0000007f,0x00000068,0x0000007b,0x0004003d,
|
||||
0x00000009,0x00000080,0x0000007f,0x0003003e,0x0000007e,0x00000080,0x00050041,0x0000000f,
|
||||
0x00000082,0x0000006c,0x0000007b,0x0004003d,0x00000009,0x00000083,0x00000082,0x0003003e,
|
||||
0x00000081,0x00000083,0x00070039,0x00000009,0x00000084,0x00000014,0x00000079,0x0000007e,
|
||||
0x00000081,0x0003003e,0x00000085,0x00000084,0x00050041,0x0000000f,0x00000087,0x0000005a,
|
||||
0x0000007b,0x0004003d,0x00000009,0x00000088,0x00000087,0x0003003e,0x00000086,0x00000088,
|
||||
0x00050041,0x0000000f,0x0000008a,0x00000072,0x0000007b,0x0004003d,0x00000009,0x0000008b,
|
||||
0x0000008a,0x0003003e,0x00000089,0x0000008b,0x00070039,0x00000009,0x0000008c,0x00000014,
|
||||
0x00000085,0x00000086,0x00000089,0x0003003e,0x00000078,0x0000008c,0x00050041,0x0000000f,
|
||||
0x0000008f,0x00000062,0x0000007b,0x0004003d,0x00000009,0x00000090,0x0000008f,0x0003003e,
|
||||
0x0000008e,0x00000090,0x00050041,0x0000000f,0x00000092,0x00000068,0x0000007b,0x0004003d,
|
||||
0x00000009,0x00000093,0x00000092,0x0003003e,0x00000091,0x00000093,0x00050041,0x0000000f,
|
||||
0x00000095,0x0000006c,0x0000007b,0x0004003d,0x00000009,0x00000096,0x00000095,0x0003003e,
|
||||
0x00000094,0x00000096,0x00070039,0x00000009,0x00000097,0x00000019,0x0000008e,0x00000091,
|
||||
0x00000094,0x0003003e,0x00000098,0x00000097,0x00050041,0x0000000f,0x0000009a,0x0000005a,
|
||||
0x0000007b,0x0004003d,0x00000009,0x0000009b,0x0000009a,0x0003003e,0x00000099,0x0000009b,
|
||||
0x00050041,0x0000000f,0x0000009d,0x00000072,0x0000007b,0x0004003d,0x00000009,0x0000009e,
|
||||
0x0000009d,0x0003003e,0x0000009c,0x0000009e,0x00070039,0x00000009,0x0000009f,0x00000019,
|
||||
0x00000098,0x00000099,0x0000009c,0x0003003e,0x0000008d,0x0000009f,0x0004003d,0x00000009,
|
||||
0x000000a1,0x0000008d,0x0007000c,0x00000009,0x000000a3,0x00000001,0x00000028,0x000000a1,
|
||||
0x000000a2,0x00050088,0x00000009,0x000000a4,0x00000055,0x000000a3,0x0003003e,0x000000a0,
|
||||
0x000000a4,0x0004003d,0x00000009,0x000000a6,0x00000078,0x0004003d,0x00000009,0x000000a7,
|
||||
0x0000008d,0x00050083,0x00000009,0x000000a8,0x00000055,0x000000a7,0x0007000c,0x00000009,
|
||||
0x000000a9,0x00000001,0x00000025,0x000000a6,0x000000a8,0x0004003d,0x00000009,0x000000aa,
|
||||
0x000000a0,0x00050085,0x00000009,0x000000ab,0x000000a9,0x000000aa,0x0008000c,0x00000009,
|
||||
0x000000ac,0x00000001,0x0000002b,0x000000ab,0x00000032,0x00000055,0x0003003e,0x000000a5,
|
||||
0x000000ac,0x0004003d,0x00000009,0x000000ad,0x000000a5,0x0006000c,0x00000009,0x000000ae,
|
||||
0x00000001,0x0000001f,0x000000ad,0x0003003e,0x000000a5,0x000000ae,0x0004003d,0x00000009,
|
||||
0x000000b0,0x000000a5,0x0004003d,0x00000009,0x000000b1,0x0000004d,0x00050085,0x00000009,
|
||||
0x000000b2,0x000000b0,0x000000b1,0x0003003e,0x000000af,0x000000b2,0x0004003d,0x00000009,
|
||||
0x000000b5,0x000000af,0x00050085,0x00000009,0x000000b6,0x000000b4,0x000000b5,0x00050081,
|
||||
0x00000009,0x000000b7,0x00000055,0x000000b6,0x00050088,0x00000009,0x000000b8,0x00000055,
|
||||
0x000000b7,0x0003003e,0x000000b3,0x000000b8,0x0004003d,0x0000000a,0x000000ba,0x0000005a,
|
||||
0x0004003d,0x00000009,0x000000bb,0x000000af,0x0005008e,0x0000000a,0x000000bc,0x000000ba,
|
||||
0x000000bb,0x0004003d,0x0000000a,0x000000bd,0x00000062,0x0004003d,0x00000009,0x000000be,
|
||||
0x000000af,0x0005008e,0x0000000a,0x000000bf,0x000000bd,0x000000be,0x00050081,0x0000000a,
|
||||
0x000000c0,0x000000bc,0x000000bf,0x0004003d,0x0000000a,0x000000c1,0x0000006c,0x0004003d,
|
||||
0x00000009,0x000000c2,0x000000af,0x0005008e,0x0000000a,0x000000c3,0x000000c1,0x000000c2,
|
||||
0x00050081,0x0000000a,0x000000c4,0x000000c0,0x000000c3,0x0004003d,0x0000000a,0x000000c5,
|
||||
0x00000072,0x0004003d,0x00000009,0x000000c6,0x000000af,0x0005008e,0x0000000a,0x000000c7,
|
||||
0x000000c5,0x000000c6,0x00050081,0x0000000a,0x000000c8,0x000000c4,0x000000c7,0x0004003d,
|
||||
0x0000000a,0x000000c9,0x00000068,0x00050081,0x0000000a,0x000000ca,0x000000c8,0x000000c9,
|
||||
0x0004003d,0x00000009,0x000000cb,0x000000b3,0x0005008e,0x0000000a,0x000000cc,0x000000ca,
|
||||
0x000000cb,0x00060050,0x0000000a,0x000000cd,0x00000032,0x00000032,0x00000032,0x00060050,
|
||||
0x0000000a,0x000000ce,0x00000055,0x00000055,0x00000055,0x0008000c,0x0000000a,0x000000cf,
|
||||
0x00000001,0x0000002b,0x000000cc,0x000000cd,0x000000ce,0x0003003e,0x000000b9,0x000000cf,
|
||||
0x0004003d,0x0000000a,0x000000d2,0x000000b9,0x00050051,0x00000009,0x000000d3,0x000000d2,
|
||||
0x00000000,0x00050051,0x00000009,0x000000d4,0x000000d2,0x00000001,0x00050051,0x00000009,
|
||||
0x000000d5,0x000000d2,0x00000002,0x00070050,0x00000023,0x000000d6,0x000000d3,0x000000d4,
|
||||
0x000000d5,0x00000055,0x0003003e,0x000000d1,0x000000d6,0x000100fd,0x00010038,0x00050036,
|
||||
0x0000000a,0x0000000d,0x00000000,0x0000000b,0x00030037,0x00000008,0x0000000c,0x000200f8,
|
||||
0x0000000e,0x0004003b,0x0000001c,0x0000001d,0x00000007,0x0004003d,0x00000007,0x0000001e,
|
||||
0x0000000c,0x0004006f,0x0000001b,0x0000001f,0x0000001e,0x00050050,0x0000001b,0x00000021,
|
||||
0x00000020,0x00000020,0x00050081,0x0000001b,0x00000022,0x0000001f,0x00000021,0x00050041,
|
||||
0x00000028,0x00000029,0x00000026,0x00000027,0x0004003d,0x0000001b,0x0000002a,0x00000029,
|
||||
0x00050088,0x0000001b,0x0000002b,0x00000022,0x0000002a,0x0003003e,0x0000001d,0x0000002b,
|
||||
0x0004003d,0x0000002d,0x00000030,0x0000002f,0x0004003d,0x0000001b,0x00000031,0x0000001d,
|
||||
0x00070058,0x00000023,0x00000033,0x00000030,0x00000031,0x00000002,0x00000032,0x0008004f,
|
||||
0x0000000a,0x00000034,0x00000033,0x00000033,0x00000000,0x00000001,0x00000002,0x000200fe,
|
||||
0x00000034,0x00010038,0x00050036,0x00000009,0x00000014,0x00000000,0x00000010,0x00030037,
|
||||
0x0000000f,0x00000011,0x00030037,0x0000000f,0x00000012,0x00030037,0x0000000f,0x00000013,
|
||||
0x000200f8,0x00000015,0x0004003d,0x00000009,0x00000037,0x00000011,0x0004003d,0x00000009,
|
||||
0x00000038,0x00000012,0x0004003d,0x00000009,0x00000039,0x00000013,0x0007000c,0x00000009,
|
||||
0x0000003a,0x00000001,0x00000025,0x00000038,0x00000039,0x0007000c,0x00000009,0x0000003b,
|
||||
0x00000001,0x00000025,0x00000037,0x0000003a,0x000200fe,0x0000003b,0x00010038,0x00050036,
|
||||
0x00000009,0x00000019,0x00000000,0x00000010,0x00030037,0x0000000f,0x00000016,0x00030037,
|
||||
0x0000000f,0x00000017,0x00030037,0x0000000f,0x00000018,0x000200f8,0x0000001a,0x0004003d,
|
||||
0x00000009,0x0000003e,0x00000016,0x0004003d,0x00000009,0x0000003f,0x00000017,0x0004003d,
|
||||
0x00000009,0x00000040,0x00000018,0x0007000c,0x00000009,0x00000041,0x00000001,0x00000028,
|
||||
0x0000003f,0x00000040,0x0007000c,0x00000009,0x00000042,0x00000001,0x00000028,0x0000003e,
|
||||
0x00000041,0x000200fe,0x00000042,0x00010038
|
||||
0x07230203,0x00010000,0x0008000b,0x000000d7,0x00000000,0x00020011,0x00000001,0x00020011,
|
||||
0x00000032,0x0006000b,0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,
|
||||
0x00000000,0x00000001,0x0007000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x00000043,
|
||||
0x000000d1,0x00030010,0x00000004,0x00000007,0x00030003,0x00000002,0x000001c2,0x00040005,
|
||||
0x00000004,0x6e69616d,0x00000000,0x00060005,0x0000000d,0x4c736143,0x2864616f,0x3b326976,
|
||||
0x00000000,0x00030005,0x0000000c,0x00000070,0x00070005,0x00000014,0x6e694d41,0x28314633,
|
||||
0x663b3166,0x31663b31,0x0000003b,0x00030005,0x00000011,0x00000078,0x00030005,0x00000012,
|
||||
0x00000079,0x00030005,0x00000013,0x0000007a,0x00070005,0x00000019,0x78614d41,0x28314633,
|
||||
0x663b3166,0x31663b31,0x0000003b,0x00030005,0x00000016,0x00000078,0x00030005,0x00000017,
|
||||
0x00000079,0x00030005,0x00000018,0x0000007a,0x00030005,0x0000001b,0x00007a73,0x00060005,
|
||||
0x0000001f,0x75706e49,0x78655474,0x65727574,0x00000000,0x00030005,0x00000040,0x00007073,
|
||||
0x00060005,0x00000043,0x67617266,0x43786554,0x64726f6f,0x00000000,0x00030005,0x00000045,
|
||||
0x00004350,0x00040006,0x00000045,0x00000000,0x0063646e,0x00060006,0x00000045,0x00000001,
|
||||
0x6f736572,0x6974756c,0x00006e6f,0x00060006,0x00000045,0x00000002,0x72616873,0x73656e70,
|
||||
0x00000073,0x00030005,0x00000047,0x00006370,0x00040005,0x0000004d,0x6b616570,0x00000000,
|
||||
0x00030005,0x0000005b,0x00000062,0x00040005,0x00000060,0x61726170,0x0000006d,0x00030005,
|
||||
0x00000062,0x00000064,0x00040005,0x00000066,0x61726170,0x0000006d,0x00030005,0x00000068,
|
||||
0x00000065,0x00040005,0x00000069,0x61726170,0x0000006d,0x00030005,0x0000006c,0x00000066,
|
||||
0x00040005,0x00000070,0x61726170,0x0000006d,0x00030005,0x00000072,0x00000068,0x00040005,
|
||||
0x00000076,0x61726170,0x0000006d,0x00030005,0x00000078,0x00476e6d,0x00040005,0x00000079,
|
||||
0x61726170,0x0000006d,0x00040005,0x0000007e,0x61726170,0x0000006d,0x00040005,0x00000081,
|
||||
0x61726170,0x0000006d,0x00040005,0x00000085,0x61726170,0x0000006d,0x00040005,0x00000086,
|
||||
0x61726170,0x0000006d,0x00040005,0x00000089,0x61726170,0x0000006d,0x00030005,0x0000008d,
|
||||
0x0047786d,0x00040005,0x0000008e,0x61726170,0x0000006d,0x00040005,0x00000091,0x61726170,
|
||||
0x0000006d,0x00040005,0x00000094,0x61726170,0x0000006d,0x00040005,0x00000098,0x61726170,
|
||||
0x0000006d,0x00040005,0x00000099,0x61726170,0x0000006d,0x00040005,0x0000009c,0x61726170,
|
||||
0x0000006d,0x00040005,0x000000a0,0x4d706372,0x00000047,0x00040005,0x000000a5,0x47706d61,
|
||||
0x00000000,0x00030005,0x000000af,0x00004777,0x00050005,0x000000b3,0x57706372,0x68676965,
|
||||
0x00000074,0x00030005,0x000000b9,0x00786970,0x00050005,0x000000d1,0x4374756f,0x726f6c6f,
|
||||
0x00000000,0x00030047,0x0000000d,0x00000000,0x00030047,0x00000011,0x00000000,0x00030047,
|
||||
0x00000012,0x00000000,0x00030047,0x00000013,0x00000000,0x00030047,0x00000014,0x00000000,
|
||||
0x00030047,0x00000016,0x00000000,0x00030047,0x00000017,0x00000000,0x00030047,0x00000018,
|
||||
0x00000000,0x00030047,0x00000019,0x00000000,0x00030047,0x0000001f,0x00000000,0x00040047,
|
||||
0x0000001f,0x00000021,0x00000000,0x00040047,0x0000001f,0x00000022,0x00000000,0x00030047,
|
||||
0x00000020,0x00000000,0x00030047,0x00000024,0x00000000,0x00030047,0x0000002e,0x00000000,
|
||||
0x00030047,0x0000002f,0x00000000,0x00030047,0x00000032,0x00000000,0x00030047,0x00000033,
|
||||
0x00000000,0x00030047,0x00000034,0x00000000,0x00030047,0x00000035,0x00000000,0x00030047,
|
||||
0x00000036,0x00000000,0x00030047,0x00000039,0x00000000,0x00030047,0x0000003a,0x00000000,
|
||||
0x00030047,0x0000003b,0x00000000,0x00030047,0x0000003c,0x00000000,0x00030047,0x0000003d,
|
||||
0x00000000,0x00040047,0x00000043,0x0000001e,0x00000000,0x00030047,0x00000045,0x00000002,
|
||||
0x00050048,0x00000045,0x00000000,0x00000023,0x00000000,0x00050048,0x00000045,0x00000001,
|
||||
0x00000023,0x00000010,0x00040048,0x00000045,0x00000002,0x00000000,0x00050048,0x00000045,
|
||||
0x00000002,0x00000023,0x00000018,0x00030047,0x0000004d,0x00000000,0x00030047,0x00000054,
|
||||
0x00000000,0x00030047,0x00000057,0x00000000,0x00030047,0x00000058,0x00000000,0x00030047,
|
||||
0x00000059,0x00000000,0x00030047,0x0000005b,0x00000000,0x00030047,0x00000061,0x00000000,
|
||||
0x00030047,0x00000062,0x00000000,0x00030047,0x00000067,0x00000000,0x00030047,0x00000068,
|
||||
0x00000000,0x00030047,0x0000006b,0x00000000,0x00030047,0x0000006c,0x00000000,0x00030047,
|
||||
0x00000071,0x00000000,0x00030047,0x00000072,0x00000000,0x00030047,0x00000077,0x00000000,
|
||||
0x00030047,0x00000078,0x00000000,0x00030047,0x00000079,0x00000000,0x00030047,0x0000007d,
|
||||
0x00000000,0x00030047,0x0000007e,0x00000000,0x00030047,0x00000080,0x00000000,0x00030047,
|
||||
0x00000081,0x00000000,0x00030047,0x00000083,0x00000000,0x00030047,0x00000084,0x00000000,
|
||||
0x00030047,0x00000085,0x00000000,0x00030047,0x00000086,0x00000000,0x00030047,0x00000088,
|
||||
0x00000000,0x00030047,0x00000089,0x00000000,0x00030047,0x0000008b,0x00000000,0x00030047,
|
||||
0x0000008c,0x00000000,0x00030047,0x0000008d,0x00000000,0x00030047,0x0000008e,0x00000000,
|
||||
0x00030047,0x00000090,0x00000000,0x00030047,0x00000091,0x00000000,0x00030047,0x00000093,
|
||||
0x00000000,0x00030047,0x00000094,0x00000000,0x00030047,0x00000096,0x00000000,0x00030047,
|
||||
0x00000097,0x00000000,0x00030047,0x00000098,0x00000000,0x00030047,0x00000099,0x00000000,
|
||||
0x00030047,0x0000009b,0x00000000,0x00030047,0x0000009c,0x00000000,0x00030047,0x0000009e,
|
||||
0x00000000,0x00030047,0x0000009f,0x00000000,0x00030047,0x000000a0,0x00000000,0x00030047,
|
||||
0x000000a1,0x00000000,0x00030047,0x000000a3,0x00000000,0x00030047,0x000000a4,0x00000000,
|
||||
0x00030047,0x000000a5,0x00000000,0x00030047,0x000000a6,0x00000000,0x00030047,0x000000a7,
|
||||
0x00000000,0x00030047,0x000000a8,0x00000000,0x00030047,0x000000a9,0x00000000,0x00030047,
|
||||
0x000000aa,0x00000000,0x00030047,0x000000ab,0x00000000,0x00030047,0x000000ac,0x00000000,
|
||||
0x00030047,0x000000ad,0x00000000,0x00030047,0x000000ae,0x00000000,0x00030047,0x000000af,
|
||||
0x00000000,0x00030047,0x000000b0,0x00000000,0x00030047,0x000000b1,0x00000000,0x00030047,
|
||||
0x000000b2,0x00000000,0x00030047,0x000000b3,0x00000000,0x00030047,0x000000b5,0x00000000,
|
||||
0x00030047,0x000000b6,0x00000000,0x00030047,0x000000b7,0x00000000,0x00030047,0x000000b8,
|
||||
0x00000000,0x00030047,0x000000b9,0x00000000,0x00030047,0x000000ba,0x00000000,0x00030047,
|
||||
0x000000bb,0x00000000,0x00030047,0x000000bc,0x00000000,0x00030047,0x000000bd,0x00000000,
|
||||
0x00030047,0x000000be,0x00000000,0x00030047,0x000000bf,0x00000000,0x00030047,0x000000c0,
|
||||
0x00000000,0x00030047,0x000000c1,0x00000000,0x00030047,0x000000c2,0x00000000,0x00030047,
|
||||
0x000000c3,0x00000000,0x00030047,0x000000c4,0x00000000,0x00030047,0x000000c5,0x00000000,
|
||||
0x00030047,0x000000c6,0x00000000,0x00030047,0x000000c7,0x00000000,0x00030047,0x000000c8,
|
||||
0x00000000,0x00030047,0x000000c9,0x00000000,0x00030047,0x000000ca,0x00000000,0x00030047,
|
||||
0x000000cb,0x00000000,0x00030047,0x000000cc,0x00000000,0x00030047,0x000000cd,0x00000000,
|
||||
0x00030047,0x000000ce,0x00000000,0x00030047,0x000000cf,0x00000000,0x00030047,0x000000d1,
|
||||
0x00000000,0x00040047,0x000000d1,0x0000001e,0x00000000,0x00030047,0x000000d2,0x00000000,
|
||||
0x00030047,0x000000d3,0x00000000,0x00030047,0x000000d4,0x00000000,0x00030047,0x000000d5,
|
||||
0x00000000,0x00030047,0x000000d6,0x00000000,0x00020013,0x00000002,0x00030021,0x00000003,
|
||||
0x00000002,0x00040015,0x00000006,0x00000020,0x00000001,0x00040017,0x00000007,0x00000006,
|
||||
0x00000002,0x00040020,0x00000008,0x00000007,0x00000007,0x00030016,0x00000009,0x00000020,
|
||||
0x00040017,0x0000000a,0x00000009,0x00000003,0x00040021,0x0000000b,0x0000000a,0x00000008,
|
||||
0x00040020,0x0000000f,0x00000007,0x00000009,0x00060021,0x00000010,0x00000009,0x0000000f,
|
||||
0x0000000f,0x0000000f,0x00090019,0x0000001c,0x00000009,0x00000001,0x00000000,0x00000000,
|
||||
0x00000000,0x00000001,0x00000000,0x0003001b,0x0000001d,0x0000001c,0x00040020,0x0000001e,
|
||||
0x00000000,0x0000001d,0x0004003b,0x0000001e,0x0000001f,0x00000000,0x0004002b,0x00000006,
|
||||
0x00000021,0x00000000,0x0005002c,0x00000007,0x00000026,0x00000021,0x00000021,0x0004002b,
|
||||
0x00000006,0x00000028,0x00000001,0x0005002c,0x00000007,0x00000029,0x00000028,0x00000028,
|
||||
0x00040017,0x0000002d,0x00000009,0x00000004,0x00040017,0x00000041,0x00000009,0x00000002,
|
||||
0x00040020,0x00000042,0x00000001,0x00000041,0x0004003b,0x00000042,0x00000043,0x00000001,
|
||||
0x0005001e,0x00000045,0x0000002d,0x00000041,0x00000009,0x00040020,0x00000046,0x00000009,
|
||||
0x00000045,0x0004003b,0x00000046,0x00000047,0x00000009,0x00040020,0x00000048,0x00000009,
|
||||
0x00000041,0x0004002b,0x00000009,0x0000004e,0xbf800000,0x0004002b,0x00000009,0x0000004f,
|
||||
0x41000000,0x0004002b,0x00000009,0x00000050,0x40a00000,0x0004002b,0x00000006,0x00000051,
|
||||
0x00000002,0x00040020,0x00000052,0x00000009,0x00000009,0x0004002b,0x00000009,0x00000055,
|
||||
0x00000000,0x0004002b,0x00000009,0x00000056,0x3f800000,0x00040020,0x0000005a,0x00000007,
|
||||
0x0000000a,0x0004002b,0x00000006,0x0000005d,0xffffffff,0x0005002c,0x00000007,0x0000005e,
|
||||
0x00000021,0x0000005d,0x0005002c,0x00000007,0x00000064,0x0000005d,0x00000021,0x0005002c,
|
||||
0x00000007,0x0000006e,0x00000028,0x00000021,0x0005002c,0x00000007,0x00000074,0x00000021,
|
||||
0x00000028,0x00040015,0x0000007a,0x00000020,0x00000000,0x0004002b,0x0000007a,0x0000007b,
|
||||
0x00000001,0x0004002b,0x00000009,0x000000a2,0x3a800000,0x0004002b,0x00000009,0x000000b4,
|
||||
0x40800000,0x00040020,0x000000d0,0x00000003,0x0000002d,0x0004003b,0x000000d0,0x000000d1,
|
||||
0x00000003,0x00050036,0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,
|
||||
0x0004003b,0x00000008,0x00000040,0x00000007,0x0004003b,0x0000000f,0x0000004d,0x00000007,
|
||||
0x0004003b,0x0000005a,0x0000005b,0x00000007,0x0004003b,0x00000008,0x00000060,0x00000007,
|
||||
0x0004003b,0x0000005a,0x00000062,0x00000007,0x0004003b,0x00000008,0x00000066,0x00000007,
|
||||
0x0004003b,0x0000005a,0x00000068,0x00000007,0x0004003b,0x00000008,0x00000069,0x00000007,
|
||||
0x0004003b,0x0000005a,0x0000006c,0x00000007,0x0004003b,0x00000008,0x00000070,0x00000007,
|
||||
0x0004003b,0x0000005a,0x00000072,0x00000007,0x0004003b,0x00000008,0x00000076,0x00000007,
|
||||
0x0004003b,0x0000000f,0x00000078,0x00000007,0x0004003b,0x0000000f,0x00000079,0x00000007,
|
||||
0x0004003b,0x0000000f,0x0000007e,0x00000007,0x0004003b,0x0000000f,0x00000081,0x00000007,
|
||||
0x0004003b,0x0000000f,0x00000085,0x00000007,0x0004003b,0x0000000f,0x00000086,0x00000007,
|
||||
0x0004003b,0x0000000f,0x00000089,0x00000007,0x0004003b,0x0000000f,0x0000008d,0x00000007,
|
||||
0x0004003b,0x0000000f,0x0000008e,0x00000007,0x0004003b,0x0000000f,0x00000091,0x00000007,
|
||||
0x0004003b,0x0000000f,0x00000094,0x00000007,0x0004003b,0x0000000f,0x00000098,0x00000007,
|
||||
0x0004003b,0x0000000f,0x00000099,0x00000007,0x0004003b,0x0000000f,0x0000009c,0x00000007,
|
||||
0x0004003b,0x0000000f,0x000000a0,0x00000007,0x0004003b,0x0000000f,0x000000a5,0x00000007,
|
||||
0x0004003b,0x0000000f,0x000000af,0x00000007,0x0004003b,0x0000000f,0x000000b3,0x00000007,
|
||||
0x0004003b,0x0000005a,0x000000b9,0x00000007,0x0004003d,0x00000041,0x00000044,0x00000043,
|
||||
0x00050041,0x00000048,0x00000049,0x00000047,0x00000028,0x0004003d,0x00000041,0x0000004a,
|
||||
0x00000049,0x00050085,0x00000041,0x0000004b,0x00000044,0x0000004a,0x0004006e,0x00000007,
|
||||
0x0000004c,0x0000004b,0x0003003e,0x00000040,0x0000004c,0x00050041,0x00000052,0x00000053,
|
||||
0x00000047,0x00000051,0x0004003d,0x00000009,0x00000054,0x00000053,0x0008000c,0x00000009,
|
||||
0x00000057,0x00000001,0x0000002b,0x00000054,0x00000055,0x00000056,0x0008000c,0x00000009,
|
||||
0x00000058,0x00000001,0x0000002e,0x0000004f,0x00000050,0x00000057,0x00050088,0x00000009,
|
||||
0x00000059,0x0000004e,0x00000058,0x0003003e,0x0000004d,0x00000059,0x0004003d,0x00000007,
|
||||
0x0000005c,0x00000040,0x00050080,0x00000007,0x0000005f,0x0000005c,0x0000005e,0x0003003e,
|
||||
0x00000060,0x0000005f,0x00050039,0x0000000a,0x00000061,0x0000000d,0x00000060,0x0003003e,
|
||||
0x0000005b,0x00000061,0x0004003d,0x00000007,0x00000063,0x00000040,0x00050080,0x00000007,
|
||||
0x00000065,0x00000063,0x00000064,0x0003003e,0x00000066,0x00000065,0x00050039,0x0000000a,
|
||||
0x00000067,0x0000000d,0x00000066,0x0003003e,0x00000062,0x00000067,0x0004003d,0x00000007,
|
||||
0x0000006a,0x00000040,0x0003003e,0x00000069,0x0000006a,0x00050039,0x0000000a,0x0000006b,
|
||||
0x0000000d,0x00000069,0x0003003e,0x00000068,0x0000006b,0x0004003d,0x00000007,0x0000006d,
|
||||
0x00000040,0x00050080,0x00000007,0x0000006f,0x0000006d,0x0000006e,0x0003003e,0x00000070,
|
||||
0x0000006f,0x00050039,0x0000000a,0x00000071,0x0000000d,0x00000070,0x0003003e,0x0000006c,
|
||||
0x00000071,0x0004003d,0x00000007,0x00000073,0x00000040,0x00050080,0x00000007,0x00000075,
|
||||
0x00000073,0x00000074,0x0003003e,0x00000076,0x00000075,0x00050039,0x0000000a,0x00000077,
|
||||
0x0000000d,0x00000076,0x0003003e,0x00000072,0x00000077,0x00050041,0x0000000f,0x0000007c,
|
||||
0x00000062,0x0000007b,0x0004003d,0x00000009,0x0000007d,0x0000007c,0x0003003e,0x00000079,
|
||||
0x0000007d,0x00050041,0x0000000f,0x0000007f,0x00000068,0x0000007b,0x0004003d,0x00000009,
|
||||
0x00000080,0x0000007f,0x0003003e,0x0000007e,0x00000080,0x00050041,0x0000000f,0x00000082,
|
||||
0x0000006c,0x0000007b,0x0004003d,0x00000009,0x00000083,0x00000082,0x0003003e,0x00000081,
|
||||
0x00000083,0x00070039,0x00000009,0x00000084,0x00000014,0x00000079,0x0000007e,0x00000081,
|
||||
0x0003003e,0x00000085,0x00000084,0x00050041,0x0000000f,0x00000087,0x0000005b,0x0000007b,
|
||||
0x0004003d,0x00000009,0x00000088,0x00000087,0x0003003e,0x00000086,0x00000088,0x00050041,
|
||||
0x0000000f,0x0000008a,0x00000072,0x0000007b,0x0004003d,0x00000009,0x0000008b,0x0000008a,
|
||||
0x0003003e,0x00000089,0x0000008b,0x00070039,0x00000009,0x0000008c,0x00000014,0x00000085,
|
||||
0x00000086,0x00000089,0x0003003e,0x00000078,0x0000008c,0x00050041,0x0000000f,0x0000008f,
|
||||
0x00000062,0x0000007b,0x0004003d,0x00000009,0x00000090,0x0000008f,0x0003003e,0x0000008e,
|
||||
0x00000090,0x00050041,0x0000000f,0x00000092,0x00000068,0x0000007b,0x0004003d,0x00000009,
|
||||
0x00000093,0x00000092,0x0003003e,0x00000091,0x00000093,0x00050041,0x0000000f,0x00000095,
|
||||
0x0000006c,0x0000007b,0x0004003d,0x00000009,0x00000096,0x00000095,0x0003003e,0x00000094,
|
||||
0x00000096,0x00070039,0x00000009,0x00000097,0x00000019,0x0000008e,0x00000091,0x00000094,
|
||||
0x0003003e,0x00000098,0x00000097,0x00050041,0x0000000f,0x0000009a,0x0000005b,0x0000007b,
|
||||
0x0004003d,0x00000009,0x0000009b,0x0000009a,0x0003003e,0x00000099,0x0000009b,0x00050041,
|
||||
0x0000000f,0x0000009d,0x00000072,0x0000007b,0x0004003d,0x00000009,0x0000009e,0x0000009d,
|
||||
0x0003003e,0x0000009c,0x0000009e,0x00070039,0x00000009,0x0000009f,0x00000019,0x00000098,
|
||||
0x00000099,0x0000009c,0x0003003e,0x0000008d,0x0000009f,0x0004003d,0x00000009,0x000000a1,
|
||||
0x0000008d,0x0007000c,0x00000009,0x000000a3,0x00000001,0x00000028,0x000000a1,0x000000a2,
|
||||
0x00050088,0x00000009,0x000000a4,0x00000056,0x000000a3,0x0003003e,0x000000a0,0x000000a4,
|
||||
0x0004003d,0x00000009,0x000000a6,0x00000078,0x0004003d,0x00000009,0x000000a7,0x0000008d,
|
||||
0x00050083,0x00000009,0x000000a8,0x00000056,0x000000a7,0x0007000c,0x00000009,0x000000a9,
|
||||
0x00000001,0x00000025,0x000000a6,0x000000a8,0x0004003d,0x00000009,0x000000aa,0x000000a0,
|
||||
0x00050085,0x00000009,0x000000ab,0x000000a9,0x000000aa,0x0008000c,0x00000009,0x000000ac,
|
||||
0x00000001,0x0000002b,0x000000ab,0x00000055,0x00000056,0x0003003e,0x000000a5,0x000000ac,
|
||||
0x0004003d,0x00000009,0x000000ad,0x000000a5,0x0006000c,0x00000009,0x000000ae,0x00000001,
|
||||
0x0000001f,0x000000ad,0x0003003e,0x000000a5,0x000000ae,0x0004003d,0x00000009,0x000000b0,
|
||||
0x000000a5,0x0004003d,0x00000009,0x000000b1,0x0000004d,0x00050085,0x00000009,0x000000b2,
|
||||
0x000000b0,0x000000b1,0x0003003e,0x000000af,0x000000b2,0x0004003d,0x00000009,0x000000b5,
|
||||
0x000000af,0x00050085,0x00000009,0x000000b6,0x000000b4,0x000000b5,0x00050081,0x00000009,
|
||||
0x000000b7,0x00000056,0x000000b6,0x00050088,0x00000009,0x000000b8,0x00000056,0x000000b7,
|
||||
0x0003003e,0x000000b3,0x000000b8,0x0004003d,0x0000000a,0x000000ba,0x0000005b,0x0004003d,
|
||||
0x00000009,0x000000bb,0x000000af,0x0005008e,0x0000000a,0x000000bc,0x000000ba,0x000000bb,
|
||||
0x0004003d,0x0000000a,0x000000bd,0x00000062,0x0004003d,0x00000009,0x000000be,0x000000af,
|
||||
0x0005008e,0x0000000a,0x000000bf,0x000000bd,0x000000be,0x00050081,0x0000000a,0x000000c0,
|
||||
0x000000bc,0x000000bf,0x0004003d,0x0000000a,0x000000c1,0x0000006c,0x0004003d,0x00000009,
|
||||
0x000000c2,0x000000af,0x0005008e,0x0000000a,0x000000c3,0x000000c1,0x000000c2,0x00050081,
|
||||
0x0000000a,0x000000c4,0x000000c0,0x000000c3,0x0004003d,0x0000000a,0x000000c5,0x00000072,
|
||||
0x0004003d,0x00000009,0x000000c6,0x000000af,0x0005008e,0x0000000a,0x000000c7,0x000000c5,
|
||||
0x000000c6,0x00050081,0x0000000a,0x000000c8,0x000000c4,0x000000c7,0x0004003d,0x0000000a,
|
||||
0x000000c9,0x00000068,0x00050081,0x0000000a,0x000000ca,0x000000c8,0x000000c9,0x0004003d,
|
||||
0x00000009,0x000000cb,0x000000b3,0x0005008e,0x0000000a,0x000000cc,0x000000ca,0x000000cb,
|
||||
0x00060050,0x0000000a,0x000000cd,0x00000055,0x00000055,0x00000055,0x00060050,0x0000000a,
|
||||
0x000000ce,0x00000056,0x00000056,0x00000056,0x0008000c,0x0000000a,0x000000cf,0x00000001,
|
||||
0x0000002b,0x000000cc,0x000000cd,0x000000ce,0x0003003e,0x000000b9,0x000000cf,0x0004003d,
|
||||
0x0000000a,0x000000d2,0x000000b9,0x00050051,0x00000009,0x000000d3,0x000000d2,0x00000000,
|
||||
0x00050051,0x00000009,0x000000d4,0x000000d2,0x00000001,0x00050051,0x00000009,0x000000d5,
|
||||
0x000000d2,0x00000002,0x00070050,0x0000002d,0x000000d6,0x000000d3,0x000000d4,0x000000d5,
|
||||
0x00000056,0x0003003e,0x000000d1,0x000000d6,0x000100fd,0x00010038,0x00050036,0x0000000a,
|
||||
0x0000000d,0x00000000,0x0000000b,0x00030037,0x00000008,0x0000000c,0x000200f8,0x0000000e,
|
||||
0x0004003b,0x00000008,0x0000001b,0x00000007,0x0004003d,0x0000001d,0x00000020,0x0000001f,
|
||||
0x00040064,0x0000001c,0x00000022,0x00000020,0x00050067,0x00000007,0x00000023,0x00000022,
|
||||
0x00000021,0x0003003e,0x0000001b,0x00000023,0x0004003d,0x0000001d,0x00000024,0x0000001f,
|
||||
0x0004003d,0x00000007,0x00000025,0x0000000c,0x0004003d,0x00000007,0x00000027,0x0000001b,
|
||||
0x00050082,0x00000007,0x0000002a,0x00000027,0x00000029,0x0008000c,0x00000007,0x0000002b,
|
||||
0x00000001,0x0000002d,0x00000025,0x00000026,0x0000002a,0x00040064,0x0000001c,0x0000002c,
|
||||
0x00000024,0x0007005f,0x0000002d,0x0000002e,0x0000002c,0x0000002b,0x00000002,0x00000021,
|
||||
0x0008004f,0x0000000a,0x0000002f,0x0000002e,0x0000002e,0x00000000,0x00000001,0x00000002,
|
||||
0x000200fe,0x0000002f,0x00010038,0x00050036,0x00000009,0x00000014,0x00000000,0x00000010,
|
||||
0x00030037,0x0000000f,0x00000011,0x00030037,0x0000000f,0x00000012,0x00030037,0x0000000f,
|
||||
0x00000013,0x000200f8,0x00000015,0x0004003d,0x00000009,0x00000032,0x00000011,0x0004003d,
|
||||
0x00000009,0x00000033,0x00000012,0x0004003d,0x00000009,0x00000034,0x00000013,0x0007000c,
|
||||
0x00000009,0x00000035,0x00000001,0x00000025,0x00000033,0x00000034,0x0007000c,0x00000009,
|
||||
0x00000036,0x00000001,0x00000025,0x00000032,0x00000035,0x000200fe,0x00000036,0x00010038,
|
||||
0x00050036,0x00000009,0x00000019,0x00000000,0x00000010,0x00030037,0x0000000f,0x00000016,
|
||||
0x00030037,0x0000000f,0x00000017,0x00030037,0x0000000f,0x00000018,0x000200f8,0x0000001a,
|
||||
0x0004003d,0x00000009,0x00000039,0x00000016,0x0004003d,0x00000009,0x0000003a,0x00000017,
|
||||
0x0004003d,0x00000009,0x0000003b,0x00000018,0x0007000c,0x00000009,0x0000003c,0x00000001,
|
||||
0x00000028,0x0000003a,0x0000003b,0x0007000c,0x00000009,0x0000003d,0x00000001,0x00000028,
|
||||
0x00000039,0x0000003c,0x000200fe,0x0000003d,0x00010038
|
||||
};
|
||||
@@ -7,7 +7,6 @@
|
||||
#include "droiddeck-ahb-v1-server-protocol.h"
|
||||
#include <android/hardware_buffer.h>
|
||||
#include <errno.h>
|
||||
#include <linux/sync_file.h>
|
||||
#include <fcntl.h>
|
||||
#include <poll.h>
|
||||
#include <pthread.h>
|
||||
@@ -146,12 +145,6 @@ static void handle_released(uint64_t id, int fd) {
|
||||
if (poll(&p, 1, 0) > 0) {
|
||||
close(fd);
|
||||
} else {
|
||||
if (ab->fence_src) {
|
||||
struct sync_merge_data m = {.name = "droiddeck-release", .fd2 = fd};
|
||||
if (ioctl(ab->fence_fd, SYNC_IOC_MERGE, &m) == 0) { close(fd); fd = m.fence; }
|
||||
wl_event_source_remove(ab->fence_src);
|
||||
close(ab->fence_fd);
|
||||
}
|
||||
ab->fence_fd = fd;
|
||||
ab->fence_src = wl_event_loop_add_fd(g_loop, fd, WL_EVENT_READABLE, on_fence_readable, ab);
|
||||
if (!ab->fence_src) { close(fd); ab->fence_fd = -1; }
|
||||
@@ -159,7 +152,6 @@ static void handle_released(uint64_t id, int fd) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ab->fence_src) return;
|
||||
send_deferred_release(ab);
|
||||
maybe_free(ab);
|
||||
}
|
||||
@@ -205,19 +197,15 @@ int ahb_swapchain_present(struct dmabuf_buffer *b, struct surface *s, int scene_
|
||||
struct droiddeck_dma_buf_sync_file exp = {.flags = DROIDDECK_DMA_BUF_SYNC_READ, .fd = -1};
|
||||
if (dmabuf_fd >= 0 && ioctl(dmabuf_fd, DROIDDECK_DMA_BUF_IOCTL_EXPORT_SYNC_FILE, &exp) == 0 && exp.fd >= 0) {
|
||||
acquire = exp.fd;
|
||||
} else {
|
||||
} else if (dmabuf_fd >= 0) {
|
||||
if (!g_export_failed_logged) {
|
||||
g_export_failed_logged = 1;
|
||||
droiddeck_log("layer", "zero-copy: no acquire fence from the game's dma-buf (%s): %s",
|
||||
dmabuf_fd >= 0 ? strerror(errno) : "no dma-buf fd",
|
||||
draw ? "its frames are copied instead" : "it cannot be copied, so each frame is waited for on the CPU");
|
||||
droiddeck_log("layer", "zero-copy: DMA_BUF_IOCTL_EXPORT_SYNC_FILE failed (%s): waiting for each frame on the CPU instead",
|
||||
strerror(errno));
|
||||
}
|
||||
if (dmabuf_fd >= 0) {
|
||||
struct pollfd p = {.fd = dmabuf_fd, .events = POLLIN};
|
||||
int r;
|
||||
do { r = poll(&p, 1, 100); } while (r < 0 && errno == EINTR);
|
||||
}
|
||||
if (draw) return -1;
|
||||
struct pollfd p = {.fd = dmabuf_fd, .events = POLLIN};
|
||||
int r;
|
||||
do { r = poll(&p, 1, 100); } while (r < 0 && errno == EINTR);
|
||||
}
|
||||
int r = sc_layer_present_ahb(ab->ahb, ab->w, ab->h, acquire, (void *)(uintptr_t)ab->id, scene_w, scene_h, draw,
|
||||
s ? droiddeck_surface_color(s) : NULL, ab->format);
|
||||
|
||||
@@ -2272,69 +2272,6 @@ static void bind_output(struct wl_client *c, void *data, uint32_t ver, uint32_t
|
||||
|
||||
struct draw_list { struct vkp_draw *d; int n, cap; };
|
||||
|
||||
#define ZERO_COPY_FALLBACK_SIGNATURES 32u
|
||||
enum zero_copy_fallback_reason {
|
||||
ZERO_COPY_NO_SURFACE_BUFFER = 1,
|
||||
ZERO_COPY_NO_GRALLOC_AHB = 2,
|
||||
ZERO_COPY_AHB_PRESENT_FAILED = 3
|
||||
};
|
||||
struct zero_copy_fallback_signature {
|
||||
uint32_t reason, format, stride, offset;
|
||||
int width, height;
|
||||
uint64_t modifier;
|
||||
};
|
||||
static struct zero_copy_fallback_signature g_zero_copy_fallbacks[ZERO_COPY_FALLBACK_SIGNATURES];
|
||||
static uint32_t g_zero_copy_fallback_count;
|
||||
static int g_zero_copy_fallback_limit_logged;
|
||||
|
||||
static int zero_copy_fallback_should_log(const struct dmabuf_buffer *b, uint32_t reason) {
|
||||
const struct zero_copy_fallback_signature key = {
|
||||
.reason = reason, .format = b ? b->format : 0,
|
||||
.stride = b && b->n_planes ? b->stride[0] : 0,
|
||||
.offset = b && b->n_planes ? b->offset[0] : 0,
|
||||
.width = b ? b->width : 0, .height = b ? b->height : 0,
|
||||
.modifier = b ? b->modifier : 0};
|
||||
for (uint32_t i = 0; i < g_zero_copy_fallback_count; i++) {
|
||||
const struct zero_copy_fallback_signature *seen = &g_zero_copy_fallbacks[i];
|
||||
if (seen->reason == key.reason && seen->format == key.format && seen->stride == key.stride &&
|
||||
seen->offset == key.offset && seen->width == key.width && seen->height == key.height &&
|
||||
seen->modifier == key.modifier)
|
||||
return 0;
|
||||
}
|
||||
if (g_zero_copy_fallback_count >= ZERO_COPY_FALLBACK_SIGNATURES) {
|
||||
if (!g_zero_copy_fallback_limit_logged) {
|
||||
g_zero_copy_fallback_limit_logged = 1;
|
||||
droiddeck_log("layer", "zero-copy: further fallback diagnostics suppressed after %u distinct buffer signatures",
|
||||
ZERO_COPY_FALLBACK_SIGNATURES);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
g_zero_copy_fallbacks[g_zero_copy_fallback_count++] = key;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void note_zero_copy_fallback(struct surface *s, const struct dmabuf_buffer *b, uint32_t reason,
|
||||
int scene_w, int scene_h, int present_result) {
|
||||
if (!zero_copy_fallback_should_log(b, reason)) return;
|
||||
char name[160] = "unknown surface";
|
||||
if (s) describe(s, name, sizeof(name));
|
||||
if (reason == ZERO_COPY_NO_SURFACE_BUFFER) {
|
||||
droiddeck_log("layer", "zero-copy: layer candidate %s has no associated Wayland surface buffer; using the layer-copy path",
|
||||
name);
|
||||
} else {
|
||||
droiddeck_log("layer", "zero-copy: %s buffer %c%c%c%c %dx%d stride %u offset %u modifier 0x%llx %s; "
|
||||
"scene %dx%d will use the layer-copy path (direct-present result %d)",
|
||||
name, b->format & 0xff, (b->format >> 8) & 0xff, (b->format >> 16) & 0xff,
|
||||
(b->format >> 24) & 0xff, b->width, b->height,
|
||||
b->n_planes ? b->stride[0] : 0, b->n_planes ? b->offset[0] : 0,
|
||||
(unsigned long long)b->modifier,
|
||||
reason == ZERO_COPY_NO_GRALLOC_AHB
|
||||
? "has no registered gralloc AHardwareBuffer"
|
||||
: "has a registered gralloc AHardwareBuffer but direct presentation failed",
|
||||
scene_w, scene_h, present_result);
|
||||
}
|
||||
}
|
||||
|
||||
static int add_cursor(struct draw_list *dl, int scene_w);
|
||||
|
||||
static struct vkp_image *surface_image(struct surface *s) {
|
||||
@@ -2454,53 +2391,17 @@ static int black_fill_below(const struct draw_list *dl, int n) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
#define LAYER_CANDIDATE_DIAGNOSTICS 32u
|
||||
static unsigned g_layer_candidate_diag_count;
|
||||
static int g_layer_candidate_diag_limit;
|
||||
|
||||
static void note_layer_candidate_skip(const struct vkp_draw *d, int index, int reason,
|
||||
int scene_w, int scene_h) {
|
||||
static int seen[LAYER_CANDIDATE_DIAGNOSTICS][8];
|
||||
const int key[8] = {index, reason, scene_w, scene_h, d->dx, d->dy, d->dw, d->dh};
|
||||
for (unsigned i = 0; i < g_layer_candidate_diag_count; i++)
|
||||
if (!memcmp(seen[i], key, sizeof(key))) return;
|
||||
if (g_layer_candidate_diag_count >= LAYER_CANDIDATE_DIAGNOSTICS) {
|
||||
if (!g_layer_candidate_diag_limit++) droiddeck_log("layer", "zero-copy: further candidate-rejection details suppressed after %u signatures",
|
||||
LAYER_CANDIDATE_DIAGNOSTICS);
|
||||
return;
|
||||
}
|
||||
memcpy(seen[g_layer_candidate_diag_count++], key, sizeof(key));
|
||||
const char *why = reason == 1 ? "translucent draw" :
|
||||
reason == 2 ? "image is not DMA-BUF" :
|
||||
reason == 3 ? "source rectangle is outside/invalid" :
|
||||
reason == 4 ? "draw rectangle is outside scene or invalid" :
|
||||
"not fullscreen and no black backing below";
|
||||
droiddeck_log("layer", "zero-copy: candidate draw %d rejected: %s; scene %dx%d, dst %dx%d at %d,%d, src %.2f,%.2f %.2fx%.2f, image %dx%d",
|
||||
index, why, scene_w, scene_h, d->dw, d->dh, d->dx, d->dy,
|
||||
d->sx, d->sy, d->sw, d->sh, vkp_image_width(d->img), vkp_image_height(d->img));
|
||||
}
|
||||
|
||||
static int layer_candidate(const struct draw_list *dl, int scene_w, int scene_h) {
|
||||
for (int i = dl->n - 1; i >= 0 && i >= dl->n - 2; i--) {
|
||||
const struct vkp_draw *d = &dl->d[i];
|
||||
if (d->blend) { note_layer_candidate_skip(d, i, 1, scene_w, scene_h); continue; }
|
||||
if (!vkp_image_is_dmabuf(d->img)) { note_layer_candidate_skip(d, i, 2, scene_w, scene_h); continue; }
|
||||
if (d->blend) continue;
|
||||
if (!vkp_image_is_dmabuf(d->img)) continue;
|
||||
if (d->sx < 0 || d->sy < 0 || d->sw < 1.0f || d->sh < 1.0f ||
|
||||
d->sx + d->sw >= vkp_image_width(d->img) + 1.0f ||
|
||||
d->sy + d->sh >= vkp_image_height(d->img) + 1.0f) {
|
||||
note_layer_candidate_skip(d, i, 3, scene_w, scene_h);
|
||||
continue;
|
||||
}
|
||||
d->sy + d->sh >= vkp_image_height(d->img) + 1.0f) continue;
|
||||
if (d->dx == 0 && d->dy == 0 && d->dw == scene_w && d->dh == scene_h) return i;
|
||||
if (d->dx < 0 || d->dy < 0 || d->dw <= 0 || d->dh <= 0 || d->dx + d->dw > scene_w ||
|
||||
d->dy + d->dh > scene_h) {
|
||||
note_layer_candidate_skip(d, i, 4, scene_w, scene_h);
|
||||
continue;
|
||||
}
|
||||
if (!black_fill_below(dl, i)) {
|
||||
note_layer_candidate_skip(d, i, 5, scene_w, scene_h);
|
||||
continue;
|
||||
}
|
||||
d->dy + d->dh > scene_h || !black_fill_below(dl, i)) continue;
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
@@ -2521,56 +2422,6 @@ static void note_copy_scene(const struct draw_list *dl, int scene_w, int scene_h
|
||||
vkp_image_is_dmabuf(t->img) ? "GPU" : "memory", t->blend ? ", translucent" : "");
|
||||
}
|
||||
|
||||
static struct surface *surface_for_image(const struct vkp_image *img);
|
||||
|
||||
static void note_layer_candidate_rejected(const struct draw_list *dl, int scene_w, int scene_h) {
|
||||
static int seen[32][14];
|
||||
static unsigned seen_count;
|
||||
static int limit_logged;
|
||||
static time_t window_start;
|
||||
struct timespec now_ts;
|
||||
const struct vkp_draw *a = dl->n > 0 ? &dl->d[dl->n - 1] : NULL;
|
||||
const struct vkp_draw *b = dl->n > 1 ? &dl->d[dl->n - 2] : NULL;
|
||||
struct surface *sa = a ? surface_for_image(a->img) : NULL;
|
||||
struct surface *sb = b ? surface_for_image(b->img) : NULL;
|
||||
const int signature[14] = {
|
||||
dl->n, scene_w, scene_h,
|
||||
a ? a->dw : 0, a ? a->dh : 0,
|
||||
a ? vkp_image_width(a->img) : 0, a ? vkp_image_height(a->img) : 0,
|
||||
a ? vkp_image_is_dmabuf(a->img) : 0, a ? a->blend : 0, sa && sa->dmabuf_buf ? 1 : 0,
|
||||
b ? b->dw : 0, b ? b->dh : 0, b ? vkp_image_is_dmabuf(b->img) : 0, sb && sb->dmabuf_buf ? 1 : 0
|
||||
};
|
||||
clock_gettime(CLOCK_MONOTONIC, &now_ts);
|
||||
if (!window_start || now_ts.tv_sec - window_start >= 30) {
|
||||
seen_count = 0;
|
||||
limit_logged = 0;
|
||||
window_start = now_ts.tv_sec;
|
||||
}
|
||||
for (unsigned i = 0; i < seen_count; i++)
|
||||
if (!memcmp(signature, seen[i], sizeof(signature))) return;
|
||||
if (seen_count >= 32) {
|
||||
if (!limit_logged++) droiddeck_log("layer", "zero-copy: further fullscreen-candidate rejection details suppressed after 32 signatures in 30 seconds");
|
||||
return;
|
||||
}
|
||||
memcpy(seen[seen_count++], signature, sizeof(signature));
|
||||
char below[48];
|
||||
if (b)
|
||||
snprintf(below, sizeof(below), "%s %dx%d",
|
||||
vkp_image_is_dmabuf(b->img) ? "DMA-BUF" : "non-DMA-BUF", b->dw, b->dh);
|
||||
else
|
||||
snprintf(below, sizeof(below), "none");
|
||||
droiddeck_log("layer", "zero-copy: no eligible fullscreen DMA-BUF layer candidate: scene %dx%d, %d draws; "
|
||||
"top draw %dx%d at %d,%d image %dx%d %s%s surface=%s dmabuf=%s; "
|
||||
"draw below %s",
|
||||
scene_w, scene_h, dl->n, a ? a->dw : 0, a ? a->dh : 0, a ? a->dx : 0, a ? a->dy : 0,
|
||||
a ? vkp_image_width(a->img) : 0, a ? vkp_image_height(a->img) : 0,
|
||||
a && vkp_image_is_dmabuf(a->img) ? "DMA-BUF" : "non-DMA-BUF",
|
||||
a && a->blend ? " blended" : "",
|
||||
sa ? "associated" : "unassociated",
|
||||
sa && sa->dmabuf_buf ? "yes" : "no",
|
||||
below);
|
||||
}
|
||||
|
||||
static struct surface *surface_for_image(const struct vkp_image *img) {
|
||||
struct surface *s;
|
||||
wl_list_for_each(s, &g_surfaces, link)
|
||||
@@ -2579,56 +2430,16 @@ static struct surface *surface_for_image(const struct vkp_image *img) {
|
||||
}
|
||||
|
||||
static struct surface *ahb_layer_only_candidate(int scene_w, int scene_h) {
|
||||
static struct {
|
||||
const struct surface *surface;
|
||||
int reason, scene_w, scene_h, w, h, buf_w, buf_h, x, y, src_set, dst_set, children;
|
||||
} seen[32];
|
||||
static unsigned seen_count;
|
||||
static int limit_logged;
|
||||
struct surface *s;
|
||||
int w = 0, h = 0, reason = 0;
|
||||
int w, h;
|
||||
if (wl_list_empty(&g_toplevels)) return NULL;
|
||||
s = wl_container_of(g_toplevels.prev, s, toplevel_link);
|
||||
if (!s->dmabuf_buf) reason = 1;
|
||||
else if (s->dmabuf_buf->img) reason = 2;
|
||||
else if (!ahb_swapchain_has_ahb(s->dmabuf_buf)) reason = 3;
|
||||
else if ((g_desktop && !s->placed) || s->x != 0 || s->y != 0 || s->src_set || s->dst_set) reason = 4;
|
||||
else if (!wl_list_empty(&s->children)) reason = 5;
|
||||
else if (g_hide_shell && !strcmp(client_name(wl_resource_get_client(s->resource)), "explorer.exe")) reason = 6;
|
||||
if (!s->dmabuf_buf || s->dmabuf_buf->img || !ahb_swapchain_has_ahb(s->dmabuf_buf)) return NULL;
|
||||
if ((g_desktop && !s->placed) || s->x != 0 || s->y != 0 || s->src_set || s->dst_set) return NULL;
|
||||
if (!wl_list_empty(&s->children)) return NULL;
|
||||
if (g_hide_shell && !strcmp(client_name(wl_resource_get_client(s->resource)), "explorer.exe")) return NULL;
|
||||
surface_size(s, &w, &h);
|
||||
if (!reason && (w != scene_w || h != scene_h || s->buf_w != scene_w || s->buf_h != scene_h)) reason = 7;
|
||||
if (reason) {
|
||||
int found = 0;
|
||||
for (unsigned i = 0; i < seen_count; i++) {
|
||||
if (seen[i].surface == s && seen[i].reason == reason && seen[i].scene_w == scene_w &&
|
||||
seen[i].scene_h == scene_h && seen[i].w == w && seen[i].h == h &&
|
||||
seen[i].buf_w == s->buf_w && seen[i].buf_h == s->buf_h && seen[i].x == s->x &&
|
||||
seen[i].y == s->y && seen[i].src_set == s->src_set && seen[i].dst_set == s->dst_set &&
|
||||
seen[i].children == !wl_list_empty(&s->children)) { found = 1; break; }
|
||||
}
|
||||
if (!found && seen_count < 32) {
|
||||
seen[seen_count].surface = s; seen[seen_count].reason = reason;
|
||||
seen[seen_count].scene_w = scene_w; seen[seen_count].scene_h = scene_h;
|
||||
seen[seen_count].w = w; seen[seen_count].h = h; seen[seen_count].buf_w = s->buf_w; seen[seen_count].buf_h = s->buf_h;
|
||||
seen[seen_count].x = s->x; seen[seen_count].y = s->y; seen[seen_count].src_set = s->src_set;
|
||||
seen[seen_count].dst_set = s->dst_set; seen[seen_count].children = !wl_list_empty(&s->children);
|
||||
seen_count++;
|
||||
const char *why = reason == 1 ? "no DMA-BUF buffer" :
|
||||
reason == 2 ? "buffer is already importable by Vulkan" :
|
||||
reason == 3 ? "no registered gralloc AHardwareBuffer" :
|
||||
reason == 4 ? "surface is positioned/cropped/scaled" :
|
||||
reason == 5 ? "surface has child surfaces" :
|
||||
reason == 6 ? "hidden shell surface" : "surface or buffer dimensions differ from scene";
|
||||
char name[160]; describe(s, name, sizeof(name));
|
||||
droiddeck_log("layer", "zero-copy: AHardwareBuffer-only candidate rejected: %s; %s, scene %dx%d, surface %dx%d at %d,%d, buffer %dx%d, crop=%d destination=%d children=%d",
|
||||
why, name, scene_w, scene_h, w, h, s->x, s->y, s->buf_w, s->buf_h,
|
||||
s->src_set, s->dst_set, !wl_list_empty(&s->children));
|
||||
} else if (!found && !limit_logged) {
|
||||
limit_logged = 1;
|
||||
droiddeck_log("layer", "zero-copy: further AHardwareBuffer-only candidate diagnostics suppressed after 32 signatures");
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
if (w != scene_w || h != scene_h || s->buf_w != scene_w || s->buf_h != scene_h) return NULL;
|
||||
return s;
|
||||
}
|
||||
|
||||
@@ -3071,10 +2882,7 @@ static void render_scene(void) {
|
||||
struct surface *ls = li >= 0 ? surface_for_image(dl.d[li].img) : NULL;
|
||||
const struct vkp_draw *ld = li >= 0 ? &dl.d[li] : NULL;
|
||||
if (li < 0) ls = layer_only;
|
||||
if (g_zero_copy && li < 0 && !ls && !blocked && !cardboard) {
|
||||
if (!cursor_on && !bfi) note_layer_candidate_rejected(&dl, w, h);
|
||||
note_copy_scene(&dl, w, h, cursor_on);
|
||||
}
|
||||
if (g_zero_copy && li < 0 && !ls && !blocked && !cardboard) note_copy_scene(&dl, w, h, cursor_on);
|
||||
if (cardboard) ls = NULL;
|
||||
if (cursor_on) ls = NULL;
|
||||
if (bfi) ls = NULL;
|
||||
@@ -3102,30 +2910,15 @@ static void render_scene(void) {
|
||||
r = generated >= 0 ? 0 : -1;
|
||||
else if (generated >= 0 && !(fx_on && li >= 0) && ls && ls->dmabuf_buf && ahb_swapchain_has_ahb(ls->dmabuf_buf))
|
||||
r = ahb_swapchain_present(ls->dmabuf_buf, ls, w, h, ld);
|
||||
if (!fg_pass && generated >= 0 && !fx_on && !framegen && r != 0) {
|
||||
if (!ls || !ls->dmabuf_buf)
|
||||
note_zero_copy_fallback(ls, NULL, ZERO_COPY_NO_SURFACE_BUFFER, w, h, r);
|
||||
else if (!ahb_swapchain_has_ahb(ls->dmabuf_buf))
|
||||
note_zero_copy_fallback(ls, ls->dmabuf_buf, ZERO_COPY_NO_GRALLOC_AHB, w, h, r);
|
||||
else
|
||||
note_zero_copy_fallback(ls, ls->dmabuf_buf, ZERO_COPY_AHB_PRESENT_FAILED, w, h, r);
|
||||
}
|
||||
if (r == 0 && !fg_pass) g_zero_copy_shown = ls;
|
||||
else settle_unwaited();
|
||||
int ov = 0, ov_done = 0;
|
||||
if (!fg_pass && generated >= 0 && r != 0 && li >= 0) {
|
||||
if (fx_on) {
|
||||
r = sc_layer_present_pass(&dl.d[li], 1, w, h);
|
||||
} else {
|
||||
r = sc_layer_present(dl.d[li].img, w, h, ld, ls ? droiddeck_surface_color(ls) : NULL,
|
||||
over == 1 ? &dl.d[li + 1] : NULL, &ov);
|
||||
ov_done = 1;
|
||||
}
|
||||
}
|
||||
if (!fg_pass && generated >= 0 && r != 0 && li >= 0)
|
||||
r = fx_on ? sc_layer_present_pass(&dl.d[li], 1, w, h)
|
||||
: sc_layer_present(dl.d[li].img, w, h, ld, ls ? droiddeck_surface_color(ls) : NULL);
|
||||
if (r == 0) {
|
||||
if (ls) ls->drawn = 1;
|
||||
int go[8];
|
||||
if (!ov_done && over == 1 && li >= 0 && vkp_map_draw(&dl.d[li + 1], go))
|
||||
int go[8], ov = 0;
|
||||
if (over == 1 && li >= 0 && vkp_map_draw(&dl.d[li + 1], go))
|
||||
ov = sc_layer_present_overlay(dl.d[li + 1].img, go, dl.d[li + 1].blend) == 0 ? 1 : -1;
|
||||
if (ov <= 0) sc_layer_hide_overlay();
|
||||
if (ov < 0) {
|
||||
|
||||
@@ -62,40 +62,8 @@ struct entry {
|
||||
static struct wl_list g_entries;
|
||||
static struct wl_event_loop *g_loop;
|
||||
static uint64_t g_next_id = 1;
|
||||
static int g_refused_logged;
|
||||
static int g_ubwc_promised;
|
||||
|
||||
#define DISPLAY_BUFFER_MISMATCH_SIGNATURES 64u
|
||||
struct display_buffer_mismatch_signature {
|
||||
uint32_t kind, format, stride, offset;
|
||||
int width, height;
|
||||
uint64_t modifier;
|
||||
};
|
||||
static struct display_buffer_mismatch_signature g_mismatch_signatures[DISPLAY_BUFFER_MISMATCH_SIGNATURES];
|
||||
static uint32_t g_mismatch_signature_count;
|
||||
static int g_mismatch_limit_logged;
|
||||
|
||||
static int mismatch_should_log(const struct dmabuf_buffer *b, uint32_t kind) {
|
||||
const struct display_buffer_mismatch_signature key = {
|
||||
.kind = kind, .format = b->format, .stride = b->stride[0], .offset = b->offset[0],
|
||||
.width = b->width, .height = b->height, .modifier = b->modifier};
|
||||
for (uint32_t i = 0; i < g_mismatch_signature_count; i++) {
|
||||
const struct display_buffer_mismatch_signature *seen = &g_mismatch_signatures[i];
|
||||
if (seen->kind == key.kind && seen->format == key.format && seen->stride == key.stride &&
|
||||
seen->offset == key.offset && seen->width == key.width && seen->height == key.height &&
|
||||
seen->modifier == key.modifier)
|
||||
return 0;
|
||||
}
|
||||
if (g_mismatch_signature_count >= DISPLAY_BUFFER_MISMATCH_SIGNATURES) {
|
||||
if (!g_mismatch_limit_logged) {
|
||||
g_mismatch_limit_logged = 1;
|
||||
droiddeck_log("layer", "display buffers: further mismatch diagnostics suppressed after %u distinct buffer signatures",
|
||||
DISPLAY_BUFFER_MISMATCH_SIGNATURES);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
g_mismatch_signatures[g_mismatch_signature_count++] = key;
|
||||
return 1;
|
||||
}
|
||||
static int g_ubwc_probed[2];
|
||||
|
||||
static uint32_t ahb_format_of(uint32_t drm, uint64_t modifier) {
|
||||
@@ -270,51 +238,16 @@ static void handle_alloc(struct peer *p, const struct display_buffers_request *q
|
||||
} else {
|
||||
if (ahb) AHardwareBuffer_release(ahb);
|
||||
fd = -1;
|
||||
static struct {
|
||||
pid_t pid;
|
||||
uint32_t width, height, format, stride, offset, reason;
|
||||
uint64_t size, modifier;
|
||||
} refused[32];
|
||||
static unsigned refused_count;
|
||||
static int refused_limit_logged;
|
||||
uint32_t reason = !sized ? 1u : !sane ? 2u : !wanted ? 3u :
|
||||
!ahb_swapchain_advertised() ? 4u :
|
||||
p->count >= DISPLAY_BUFFERS_MAX_PER_CLIENT ? 5u : 6u;
|
||||
int seen = 0;
|
||||
for (unsigned i = 0; i < refused_count; i++) {
|
||||
if (refused[i].pid == p->pid && refused[i].width == q->width && refused[i].height == q->height &&
|
||||
refused[i].format == q->format && refused[i].stride == q->stride && refused[i].offset == q->offset &&
|
||||
refused[i].size == q->size && refused[i].modifier == q->modifier && refused[i].reason == reason) {
|
||||
seen = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!seen && refused_count < 32) {
|
||||
refused[refused_count].pid = p->pid;
|
||||
refused[refused_count].width = q->width;
|
||||
refused[refused_count].height = q->height;
|
||||
refused[refused_count].format = q->format;
|
||||
refused[refused_count].stride = q->stride;
|
||||
refused[refused_count].offset = q->offset;
|
||||
refused[refused_count].size = q->size;
|
||||
refused[refused_count].modifier = q->modifier;
|
||||
refused[refused_count].reason = reason;
|
||||
refused_count++;
|
||||
const char *why = reason == 1 ? "invalid dimensions, format, or stride" :
|
||||
reason == 2 ? "size/offset/layout sanity check failed" :
|
||||
reason == 3 ? "zero-copy or UBWC offering is disabled" :
|
||||
reason == 4 ? "AHardwareBuffer swapchain is not advertised" :
|
||||
reason == 5 ? "per-client allocation limit reached" :
|
||||
"gralloc allocation/fd/size validation failed";
|
||||
droiddeck_log(compressed ? "error" : "layer",
|
||||
"display buffers: allocation refused for pid %d: %s; request %ux%u %c%c%c%c %s stride=%u offset=%u size=%llu modifier=0x%llx (client has %d allocations)",
|
||||
(int)p->pid, why, q->width, q->height,
|
||||
q->format & 0xff, (q->format >> 8) & 0xff, (q->format >> 16) & 0xff, (q->format >> 24) & 0xff,
|
||||
compressed ? "UBWC" : "linear", q->stride, q->offset,
|
||||
(unsigned long long)q->size, (unsigned long long)q->modifier, p->count);
|
||||
} else if (!seen && !refused_limit_logged) {
|
||||
refused_limit_logged = 1;
|
||||
droiddeck_log("layer", "display buffers: further allocation-refusal diagnostics suppressed after 32 signatures");
|
||||
if (sized && wanted && (compressed || !g_refused_logged)) {
|
||||
g_refused_logged = 1;
|
||||
droiddeck_log(compressed ? "error" : "layer", "display buffers: no gralloc buffer matches pid %d's %ux%u "
|
||||
"%c%c%c%c %s layout (stride %u bytes, pixels at %u, %llu bytes; gralloc's layout has pixels at "
|
||||
"%llu, %llu bytes): %s", (int)p->pid, q->width, q->height,
|
||||
q->format & 0xff, (q->format >> 8) & 0xff, (q->format >> 16) & 0xff, (q->format >> 24) & 0xff,
|
||||
compressed ? "UBWC" : "linear", q->stride, q->offset, (unsigned long long)q->size,
|
||||
(unsigned long long)(compressed ? ubwc_meta_size(q->width, q->height) : 0),
|
||||
(unsigned long long)(compressed ? ubwc_size(q->width, q->height, q->stride) : q->size),
|
||||
compressed ? "its compressed frames cannot be shown" : "its frames keep the copy path");
|
||||
}
|
||||
}
|
||||
if (reply(p, &r, fd) != 0 && e) entry_free(e);
|
||||
@@ -366,18 +299,9 @@ static int on_listen(int fd, uint32_t mask, void *data) {
|
||||
}
|
||||
|
||||
void display_buffers_match(struct wl_client *c, struct wl_resource *buffer, struct dmabuf_buffer *b) {
|
||||
static int invalid_logged;
|
||||
struct stat st;
|
||||
struct entry *e;
|
||||
if (!g_loop || wl_list_empty(&g_entries)) return;
|
||||
if (b->n_planes != 1 || b->offset[0] != 0 || fstat(b->fd[0], &st) != 0) {
|
||||
if (!invalid_logged) {
|
||||
invalid_logged = 1;
|
||||
droiddeck_log("layer", "display buffers: cannot associate %s's DMA-BUF with gralloc (plane count %u; expected one plane at offset 0, or fstat failed)",
|
||||
droiddeck_client_name(c), b->n_planes);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (!g_loop || wl_list_empty(&g_entries) || b->n_planes != 1 || b->offset[0] != 0 || fstat(b->fd[0], &st) != 0) return;
|
||||
wl_list_for_each(e, &g_entries, link) {
|
||||
if (e->dev != st.st_dev || e->ino != st.st_ino) continue;
|
||||
AHardwareBuffer_Desc d;
|
||||
@@ -387,27 +311,11 @@ void display_buffers_match(struct wl_client *c, struct wl_resource *buffer, stru
|
||||
(uint32_t)b->height == e->height
|
||||
: (b->modifier == MOD_LINEAR || b->modifier == MOD_INVALID) &&
|
||||
e->stride == b->stride[0];
|
||||
const uint32_t expected_format = ahb_format_of(b->format, e->modifier);
|
||||
const int dimensions = b->width > 0 && b->height > 0 &&
|
||||
(uint32_t)b->width <= d.width && (uint32_t)b->height <= d.height;
|
||||
if (laid_out && e->format == expected_format && dimensions) {
|
||||
if (laid_out && e->format == ahb_format_of(b->format, e->modifier) && b->width > 0 && b->height > 0 &&
|
||||
(uint32_t)b->width <= d.width && (uint32_t)b->height <= d.height)
|
||||
ahb_swapchain_adopt(c, buffer, b, e->ahb, e->modifier);
|
||||
} else if (mismatch_should_log(b, 2)) {
|
||||
droiddeck_log("layer", "display buffers: gralloc DMA-BUF identity matched but layout was rejected for %s: %c%c%c%c %dx%d stride %u offset %u modifier 0x%llx; gralloc %ux%u stride %u format 0x%x, expected format 0x%x (layout %s, dimensions %s)",
|
||||
droiddeck_client_name(c), b->format & 0xff, (b->format >> 8) & 0xff,
|
||||
(b->format >> 16) & 0xff, (b->format >> 24) & 0xff, b->width, b->height,
|
||||
b->stride[0], b->offset[0], (unsigned long long)b->modifier,
|
||||
e->width, e->height, e->stride, e->format, expected_format,
|
||||
laid_out ? "ok" : "mismatch", dimensions ? "ok" : "mismatch");
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (mismatch_should_log(b, 1)) {
|
||||
droiddeck_log("layer", "display buffers: no registered gralloc allocation matches %s's DMA-BUF identity: %c%c%c%c %dx%d stride %u offset %u modifier 0x%llx; imported normally, copy path only",
|
||||
droiddeck_client_name(c), b->format & 0xff, (b->format >> 8) & 0xff,
|
||||
(b->format >> 16) & 0xff, (b->format >> 24) & 0xff, b->width, b->height,
|
||||
b->stride[0], b->offset[0], (unsigned long long)b->modifier);
|
||||
}
|
||||
}
|
||||
|
||||
void display_buffers_init(struct wl_display *display) {
|
||||
|
||||
@@ -187,8 +187,6 @@ struct layer {
|
||||
static struct layer g_layers[SC_LAYER_COUNT];
|
||||
static void apply_frame_rate(ASurfaceTransaction *tx, struct layer *l);
|
||||
static void coverage_text(const struct layer *l, char *out, size_t n);
|
||||
static int overlay_slot(struct layer *l, struct vkp_image *src, int *idx, int *wait_fd);
|
||||
static int overlay_shown(struct layer *l, int idx, const int geo[8], int translucent);
|
||||
static int g_layers_ready;
|
||||
static pthread_mutex_t g_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||
static int g_pending_cb;
|
||||
@@ -723,15 +721,9 @@ static int layer_geometry(int w, int h, int scene_w, int scene_h, const struct v
|
||||
static ARect g_game_src, g_game_dst;
|
||||
static int g_game_geo_known;
|
||||
|
||||
static void note_game_geometry(const int r[8]) {
|
||||
g_game_src = (ARect){r[0], r[1], r[2], r[3]};
|
||||
g_game_dst = (ARect){r[4], r[5], r[6], r[7]};
|
||||
g_game_geo_known = 1;
|
||||
}
|
||||
|
||||
static void apply_geometry(ASurfaceTransaction *tx, struct layer *l, const int r[8]) {
|
||||
ARect srcR = {r[0], r[1], r[2], r[3]}, dstR = {r[4], r[5], r[6], r[7]};
|
||||
if (l == &g_layers[SC_LAYER_GAME]) note_game_geometry(r);
|
||||
if (l == &g_layers[SC_LAYER_GAME]) { g_game_src = srcR; g_game_dst = dstR; g_game_geo_known = 1; }
|
||||
if (!l->geo_valid || memcmp(&srcR, &l->geo_src, sizeof(srcR)) || memcmp(&dstR, &l->geo_dst, sizeof(dstR))) {
|
||||
api.setGeometry(tx, l->sc, &srcR, &dstR, 0 );
|
||||
l->geo_src = srcR; l->geo_dst = dstR; l->geo_valid = 1;
|
||||
@@ -1006,40 +998,19 @@ unavailable:
|
||||
}
|
||||
|
||||
int sc_layer_present(struct vkp_image *src, int scene_w, int scene_h, const struct vkp_draw *draw,
|
||||
const struct droiddeck_color *color, const struct vkp_draw *over, int *over_shown) {
|
||||
const struct droiddeck_color *color) {
|
||||
struct layer *l = layer_of(SC_LAYER_GAME);
|
||||
*over_shown = 0;
|
||||
if (!src || ensure_sc(l) != 0) return -1;
|
||||
int sw = vkp_image_width(src), sh = vkp_image_height(src);
|
||||
int r[8];
|
||||
int g = layer_geometry(sw, sh, scene_w, scene_h, draw, r);
|
||||
if (g < 0) return -1;
|
||||
int og[8];
|
||||
if (over && !vkp_map_draw(over, og)) over = NULL;
|
||||
if (g == 0) {
|
||||
sc_layer_hide();
|
||||
if (over) *over_shown = sc_layer_present_overlay(over->img, og, over->blend) == 0 ? 1 : -1;
|
||||
return 0;
|
||||
}
|
||||
if (g == 0) { sc_layer_hide(); return 0; }
|
||||
|
||||
struct vkp_blit blits[2] = {{.src = src, .wait_fd = -1}, {.src = over ? over->img : NULL, .wait_fd = -1}};
|
||||
int idx = take_free_slot(l, sw, sh, AHB_RGBA8, &blits[0].wait_fd);
|
||||
if (idx < 0) {
|
||||
log_drop(l);
|
||||
if (g_alloc_failed) return -1;
|
||||
if (over) *over_shown = sc_layer_present_overlay(over->img, og, over->blend) == 0 ? 1 : -1;
|
||||
return 0;
|
||||
}
|
||||
blits[0].dst = l->slots[idx].img;
|
||||
struct layer *ol = layer_of(SC_LAYER_OVERLAY);
|
||||
int over_idx = -1;
|
||||
if (over) {
|
||||
note_game_geometry(r);
|
||||
const int taken = overlay_slot(ol, over->img, &over_idx, &blits[1].wait_fd);
|
||||
*over_shown = taken < 0 ? -1 : 1;
|
||||
if (taken > 0) blits[1].dst = ol->slots[over_idx].img;
|
||||
}
|
||||
if (vkp_blit_images(blits, over_idx >= 0 ? 2 : 1) != 0) return -1;
|
||||
int wait_fd;
|
||||
int idx = take_free_slot(l, sw, sh, AHB_RGBA8, &wait_fd);
|
||||
if (idx < 0) { log_drop(l); return g_alloc_failed ? -1 : 0; }
|
||||
if (vkp_blit_image(src, l->slots[idx].img, wait_fd) != 0) return -1;
|
||||
if (present_slot(l, idx, r, color, 0) != 0) return -1;
|
||||
if (color && color->dataspace) droiddeck_color_frame_shown(color, DROIDDECK_HDR_LAYER_COPY, AHB_RGBA8);
|
||||
if (!l->first_logged) {
|
||||
@@ -1049,7 +1020,6 @@ int sc_layer_present(struct vkp_image *src, int scene_w, int scene_h, const stru
|
||||
pool_kind(l->pool_modifier), l->pool_n);
|
||||
}
|
||||
vkp_signal_first_frame();
|
||||
if (over_idx >= 0 && overlay_shown(ol, over_idx, og, over->blend) != 0) *over_shown = -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1239,19 +1209,17 @@ int sc_layer_overlay_affordable(void) {
|
||||
return ok;
|
||||
}
|
||||
|
||||
static int overlay_slot(struct layer *l, struct vkp_image *src, int *idx, int *wait_fd) {
|
||||
*wait_fd = -1;
|
||||
if (!src) return -1;
|
||||
int sc_layer_present_overlay(struct vkp_image *src, const int geo[8], int translucent) {
|
||||
struct layer *l = layer_of(SC_LAYER_OVERLAY);
|
||||
if (!src || !geo) return -1;
|
||||
if (!sc_layer_overlay_affordable()) return -1;
|
||||
if (ensure_sc(l) != 0) return -1;
|
||||
int sw = vkp_image_width(src), sh = vkp_image_height(src);
|
||||
if (sw <= 0 || sh <= 0) return -1;
|
||||
*idx = take_free_slot(l, sw, sh, AHB_RGBA8, wait_fd);
|
||||
if (*idx < 0) { log_drop(l); return g_alloc_failed ? -1 : 0; }
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int overlay_shown(struct layer *l, int idx, const int geo[8], int translucent) {
|
||||
int wait_fd;
|
||||
int idx = take_free_slot(l, sw, sh, AHB_RGBA8, &wait_fd);
|
||||
if (idx < 0) { log_drop(l); return g_alloc_failed ? -1 : 0; }
|
||||
if (vkp_blit_image(src, l->slots[idx].img, wait_fd) != 0) return -1;
|
||||
if (present_slot(l, idx, geo, NULL, translucent) != 0) return -1;
|
||||
if (!l->first_logged) {
|
||||
l->first_logged = 1;
|
||||
@@ -1260,18 +1228,6 @@ static int overlay_shown(struct layer *l, int idx, const int geo[8], int translu
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sc_layer_present_overlay(struct vkp_image *src, const int geo[8], int translucent) {
|
||||
struct layer *l = layer_of(SC_LAYER_OVERLAY);
|
||||
if (!geo) return -1;
|
||||
int idx;
|
||||
struct vkp_blit blit = {.src = src, .wait_fd = -1};
|
||||
const int taken = overlay_slot(l, src, &idx, &blit.wait_fd);
|
||||
if (taken <= 0) return taken;
|
||||
blit.dst = l->slots[idx].img;
|
||||
if (vkp_blit_images(&blit, 1) != 0) return -1;
|
||||
return overlay_shown(l, idx, geo, translucent);
|
||||
}
|
||||
|
||||
static int hide_layer(struct layer *l) {
|
||||
if (!l->sc || !l->shown || api.state != 1) return 0;
|
||||
ASurfaceTransaction *tx = api.txCreate();
|
||||
|
||||
@@ -22,7 +22,7 @@ void sc_layer_hdr_symbols(char *out, size_t size);
|
||||
|
||||
|
||||
int sc_layer_present(struct vkp_image *src, int scene_w, int scene_h, const struct vkp_draw *draw,
|
||||
const struct droiddeck_color *color, const struct vkp_draw *over, int *over_shown);
|
||||
const struct droiddeck_color *color);
|
||||
|
||||
int sc_layer_present_pass(const struct vkp_draw *draws, int n, int scene_w, int scene_h);
|
||||
int sc_layer_present_generated(const struct vkp_draw *draws, int n_draws, const struct vkp_hdr_frame *hf,
|
||||
|
||||
@@ -20,8 +20,6 @@
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <poll.h>
|
||||
#include <linux/sync_file.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <time.h>
|
||||
#include <pthread.h>
|
||||
#include <stdarg.h>
|
||||
@@ -3164,38 +3162,8 @@ static void blit_to_layer(VkCommandBuffer cmd, VkImage src, VkImageLayout src_la
|
||||
0, 0, NULL, 0, NULL, 1, &release);
|
||||
}
|
||||
|
||||
static int merge_wait_fds(int a, int b) {
|
||||
if (a < 0) return b;
|
||||
if (b < 0) return a;
|
||||
struct sync_merge_data m = {.name = "droiddeck-layer-copy", .fd2 = b};
|
||||
if (ioctl(a, SYNC_IOC_MERGE, &m) == 0) {
|
||||
close(a);
|
||||
close(b);
|
||||
return m.fence;
|
||||
}
|
||||
struct pollfd p = {.fd = b, .events = POLLIN};
|
||||
int r;
|
||||
do { r = poll(&p, 1, 100); } while (r < 0 && errno == EINTR);
|
||||
close(b);
|
||||
if (r != 0) return a;
|
||||
p.fd = a;
|
||||
do { r = poll(&p, 1, 100); } while (r < 0 && errno == EINTR);
|
||||
close(a);
|
||||
return -2;
|
||||
}
|
||||
|
||||
int vkp_blit_images(const struct vkp_blit *blits, int n) {
|
||||
int wait_fd = -1;
|
||||
for (int i = 0; i < n; i++) {
|
||||
if (wait_fd == -2) { if (blits[i].wait_fd >= 0) close(blits[i].wait_fd); continue; }
|
||||
wait_fd = merge_wait_fds(wait_fd, blits[i].wait_fd);
|
||||
}
|
||||
int valid = n > 0 && wait_fd != -2;
|
||||
for (int i = 0; valid && i < n; i++) {
|
||||
const struct vkp_image *src = blits[i].src, *dst = blits[i].dst;
|
||||
if (!src || src->blit_dst || !dst || !dst->blit_dst) valid = 0;
|
||||
}
|
||||
if (!valid || dev_init() != 0) {
|
||||
int vkp_blit_image(struct vkp_image *src, struct vkp_image *dst, int wait_fd) {
|
||||
if (!src || src->blit_dst || !dst || !dst->blit_dst || dev_init() != 0) {
|
||||
if (wait_fd >= 0) close(wait_fd);
|
||||
return -1;
|
||||
}
|
||||
@@ -3208,35 +3176,32 @@ int vkp_blit_images(const struct vkp_blit *blits, int n) {
|
||||
VkCommandBufferBeginInfo bi = {.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO,
|
||||
.flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT};
|
||||
g_vk.BeginCommandBuffer(g_cmd, &bi);
|
||||
for (int i = 0; i < n; i++) {
|
||||
struct vkp_image *src = blits[i].src, *dst = blits[i].dst;
|
||||
stage_linear_dmabuf(g_cmd, src);
|
||||
struct vkp_external_client_barrier_pair src_pair;
|
||||
const int src_external = vkp_external_client_barrier_pair(
|
||||
src->image, g_qfam, foreign_image(src), src->blit_dst, &src_pair);
|
||||
VkImageMemoryBarrier acq = src_external ? src_pair.acquire : (VkImageMemoryBarrier){
|
||||
.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, .oldLayout = VK_IMAGE_LAYOUT_UNDEFINED,
|
||||
.newLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
|
||||
.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
|
||||
.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
|
||||
.image = src->image, .subresourceRange = range, .dstAccessMask = VK_ACCESS_TRANSFER_READ_BIT};
|
||||
if (!src_external) {
|
||||
acq.oldLayout = src->in_general ? VK_IMAGE_LAYOUT_GENERAL : VK_IMAGE_LAYOUT_PREINITIALIZED;
|
||||
acq.newLayout = VK_IMAGE_LAYOUT_GENERAL;
|
||||
acq.srcAccessMask = VK_ACCESS_HOST_WRITE_BIT;
|
||||
src->in_general = 1;
|
||||
}
|
||||
g_vk.CmdPipelineBarrier(g_cmd, VK_PIPELINE_STAGE_HOST_BIT | VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
|
||||
VK_PIPELINE_STAGE_TRANSFER_BIT, 0, 0, NULL, 0, NULL, 1, &acq);
|
||||
int bw = src->w < dst->w ? src->w : dst->w, bh = src->h < dst->h ? src->h : dst->h;
|
||||
VkImageBlit blit = {.srcSubresource = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 0, 1},
|
||||
.srcOffsets = {{0, 0, 0}, {bw, bh, 1}},
|
||||
.dstSubresource = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 0, 1},
|
||||
.dstOffsets = {{0, 0, 0}, {bw, bh, 1}}};
|
||||
blit_to_layer(g_cmd, src->image, src_external ? VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL : VK_IMAGE_LAYOUT_GENERAL,
|
||||
dst, &blit, VK_FILTER_NEAREST);
|
||||
release_external_client_image(g_cmd, src);
|
||||
stage_linear_dmabuf(g_cmd, src);
|
||||
struct vkp_external_client_barrier_pair src_pair;
|
||||
const int src_external = vkp_external_client_barrier_pair(
|
||||
src->image, g_qfam, foreign_image(src), src->blit_dst, &src_pair);
|
||||
VkImageMemoryBarrier acq = src_external ? src_pair.acquire : (VkImageMemoryBarrier){
|
||||
.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, .oldLayout = VK_IMAGE_LAYOUT_UNDEFINED,
|
||||
.newLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
|
||||
.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
|
||||
.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
|
||||
.image = src->image, .subresourceRange = range, .dstAccessMask = VK_ACCESS_TRANSFER_READ_BIT};
|
||||
if (!src_external) {
|
||||
acq.oldLayout = src->in_general ? VK_IMAGE_LAYOUT_GENERAL : VK_IMAGE_LAYOUT_PREINITIALIZED;
|
||||
acq.newLayout = VK_IMAGE_LAYOUT_GENERAL;
|
||||
acq.srcAccessMask = VK_ACCESS_HOST_WRITE_BIT;
|
||||
src->in_general = 1;
|
||||
}
|
||||
g_vk.CmdPipelineBarrier(g_cmd, VK_PIPELINE_STAGE_HOST_BIT | VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
|
||||
VK_PIPELINE_STAGE_TRANSFER_BIT, 0, 0, NULL, 0, NULL, 1, &acq);
|
||||
int bw = src->w < dst->w ? src->w : dst->w, bh = src->h < dst->h ? src->h : dst->h;
|
||||
VkImageBlit blit = {.srcSubresource = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 0, 1},
|
||||
.srcOffsets = {{0, 0, 0}, {bw, bh, 1}},
|
||||
.dstSubresource = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 0, 1},
|
||||
.dstOffsets = {{0, 0, 0}, {bw, bh, 1}}};
|
||||
blit_to_layer(g_cmd, src->image, src_external ? VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL : VK_IMAGE_LAYOUT_GENERAL,
|
||||
dst, &blit, VK_FILTER_NEAREST);
|
||||
release_external_client_image(g_cmd, src);
|
||||
g_vk.EndCommandBuffer(g_cmd);
|
||||
|
||||
VkPipelineStageFlags wait_stage = VK_PIPELINE_STAGE_TRANSFER_BIT;
|
||||
|
||||
@@ -105,11 +105,7 @@ int vkp_render_hdr(int scene_w, int scene_h, const struct vkp_draw *draws, int n
|
||||
int vkp_pass_begin_hdr(int scene_w, int scene_h, const struct vkp_draw *draws, int n,
|
||||
const struct vkp_hdr_frame *hf, int *rw, int *rh);
|
||||
|
||||
struct vkp_blit {
|
||||
struct vkp_image *src, *dst;
|
||||
int wait_fd;
|
||||
};
|
||||
int vkp_blit_images(const struct vkp_blit *blits, int n);
|
||||
int vkp_blit_image(struct vkp_image *src, struct vkp_image *dst, int wait_fd);
|
||||
int vkp_image_readback(struct vkp_image *src, uint32_t *out, int max_px);
|
||||
int vkp_update_map(int scene_w, int scene_h);
|
||||
int vkp_map_draw(const struct vkp_draw *d, int out[8]);
|
||||
|
||||
@@ -20,10 +20,6 @@ class App : Application() {
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
if (android.os.Build.VERSION.SDK_INT >= 28 &&
|
||||
com.droiddeck.launcher.runtime.GuestWorker.isWorkerProcess(this, Application.getProcessName())) return
|
||||
if (android.os.Build.VERSION.SDK_INT >= 28 && Application.getProcessName() == packageName)
|
||||
com.droiddeck.launcher.runtime.GuestWorkers.attach(this)
|
||||
com.droiddeck.launcher.runtime.NativeGuest.init(this)
|
||||
com.droiddeck.launcher.session.Onboarding.attach(this)
|
||||
Thread({ runCatching { EnhancedSessionLogShare.cleanupAbandonedStages(this) } }, "diagnostic-stage-cleanup").start()
|
||||
@@ -92,6 +88,7 @@ class App : Application() {
|
||||
Thread({
|
||||
runCatching {
|
||||
if (com.droiddeck.launcher.runtime.LinuxRuntime.rootDir(app).isDirectory) {
|
||||
if (!com.droiddeck.launcher.runtime.LinuxRuntime.patchedProot(app)) com.droiddeck.launcher.core.AddonPack.PROOT.ensure(app)
|
||||
com.droiddeck.launcher.core.AddonPack.DIRECTAUDIO.ensure(app)
|
||||
com.droiddeck.launcher.session.SessionFiles.ensureDirtStandIn(app)
|
||||
}
|
||||
|
||||
@@ -57,6 +57,8 @@ import com.droiddeck.launcher.session.LaunchCoordinator
|
||||
import com.droiddeck.launcher.session.LaunchTicket
|
||||
import com.droiddeck.launcher.core.CpuCores
|
||||
import com.droiddeck.launcher.core.DownloadSource
|
||||
import com.droiddeck.launcher.core.PhantomProcessLimit
|
||||
import com.droiddeck.launcher.core.PhantomProcessStatus
|
||||
import com.droiddeck.launcher.core.WirelessAdbFix
|
||||
import com.droiddeck.launcher.core.WifiDiscovery
|
||||
import com.droiddeck.launcher.core.SteamIntegration
|
||||
@@ -187,9 +189,14 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
private var gamescopeRealtime by mutableStateOf(false)
|
||||
private var paceCores by mutableStateOf(true)
|
||||
private var gpuClockPin by mutableStateOf(false)
|
||||
private var desktopAsUser by mutableStateOf(false)
|
||||
private var prootNoSeccomp by mutableStateOf(false)
|
||||
private var prootFastPath by mutableStateOf(true)
|
||||
private var nativeUserland by mutableStateOf(true)
|
||||
private var cursorComposite by mutableStateOf(true)
|
||||
private var guestHostname by mutableStateOf(SessionPrefs.DEFAULT_GUEST_HOSTNAME)
|
||||
private var phantomWarning by mutableStateOf<String?>(null)
|
||||
private var phantomProcessStatus by mutableStateOf(PhantomProcessStatus.NOT_APPLICABLE)
|
||||
private var showPhantomGate by mutableStateOf(false)
|
||||
private var directAudio by mutableStateOf(false)
|
||||
private var picturePosition by mutableStateOf("center")
|
||||
private var integerScaling by mutableStateOf(false)
|
||||
@@ -929,6 +936,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
switchPoll?.let { ui.removeCallbacks(it) }
|
||||
switchPoll = null
|
||||
switchingTo = null
|
||||
queuedLaunch.clear()
|
||||
cancelCompatLaunch()
|
||||
startActivity(Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_LAUNCHER)
|
||||
.setComponent(LauncherIcon.activity(this))
|
||||
@@ -1086,7 +1094,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
com.droiddeck.launcher.frontend.GameLaunchLink.steamUrl(game.gameIdString))
|
||||
}
|
||||
}
|
||||
.playing(game))
|
||||
.playing(game), steamSession = true)
|
||||
}
|
||||
|
||||
private fun Intent.playing(game: Library.SteamGame): Intent =
|
||||
@@ -1244,7 +1252,8 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
}
|
||||
|
||||
private fun startSessionOrWait(next: Intent): Boolean {
|
||||
val started = startSession(next)
|
||||
val started = startSession(next, steamSession = next.hasExtra(SessionService.EXTRA_STEAM_URL) ||
|
||||
next.getStringExtra(SessionService.EXTRA_PROGRAM) in setOf(com.droiddeck.launcher.session.NoSteamLaunch.PROTON_RUN, com.droiddeck.launcher.session.NoSteamLaunch.BATTLENET))
|
||||
if (!started && (busy || LinuxRuntimeInstaller.isBusy())) android.widget.Toast.makeText(this, R.string.main_wait_install_game, android.widget.Toast.LENGTH_SHORT).show()
|
||||
return started
|
||||
}
|
||||
@@ -1330,6 +1339,10 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
val handoff = if (savedInstanceState == null && intent.getBooleanExtra(EXTRA_RESTARTED, false)) LauncherHandoff.take() else null
|
||||
val saved = savedInstanceState ?: handoff
|
||||
pendingSessionLogExport = saved?.getString(KEY_PENDING_SESSION_LOG_EXPORT)?.let(::File)
|
||||
queuedLaunch.restore(
|
||||
saved?.let { androidx.core.os.BundleCompat.getParcelable(it, STATE_PENDING_GATE_LAUNCH, Intent::class.java) },
|
||||
saved?.getLong(STATE_PENDING_GATE_LAUNCH_AT, 0L) ?: 0L, System.currentTimeMillis(),
|
||||
)
|
||||
homeChoiceOpen = saved?.getBoolean(STATE_HOME_CHOICE_OPEN) == true
|
||||
gameSpaceOffered = saved?.getBoolean(STATE_GAME_SPACE_OFFERED) == true
|
||||
if (savedInstanceState == null) readIntegrationIntent(intent)
|
||||
@@ -1344,7 +1357,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
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
|
||||
refreshAdbPairing()
|
||||
refreshPhantomStatus()
|
||||
if (!SessionState.running) com.droiddeck.launcher.core.BackgroundAppLimit.restoreAsync(this)
|
||||
theme = SessionPrefs.theme(this)
|
||||
frameGenLabel = getString(R.string.frame_gen_off)
|
||||
@@ -1376,6 +1389,10 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
applyLauncherFullscreen()
|
||||
updates.start()
|
||||
setContent {
|
||||
val prootPack by com.droiddeck.launcher.core.AddonPack.PROOT.state.collectAsState()
|
||||
androidx.compose.runtime.LaunchedEffect(prootPack) {
|
||||
if (prootPack == com.droiddeck.launcher.core.AddonPack.State.Ready && installed == null) refresh()
|
||||
}
|
||||
val appsTabShown = "android-apps" !in com.droiddeck.launcher.ui.NavTabs.hidden
|
||||
androidx.compose.runtime.LaunchedEffect(appsTabShown) { if (appsTabShown && androidApps.isEmpty()) refreshAndroidApps() }
|
||||
DroidDeckTheme(theme, appScale = appScale) {
|
||||
@@ -1449,6 +1466,8 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
oscMode = oscMode,
|
||||
controller = controllerSettings,
|
||||
updates = updates.state(),
|
||||
phantomProcessStatus = phantomProcessStatus,
|
||||
showPhantomGate = showPhantomGate,
|
||||
orientation = orientation,
|
||||
launcherOrientation = launcherOrientation,
|
||||
homePage = homePage,
|
||||
@@ -1476,15 +1495,19 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
),
|
||||
FrontEndActions(
|
||||
onPlay = { playSteam() },
|
||||
onQueuePlaySteam = {
|
||||
queuedLaunch.queue(Intent(this, SessionActivity::class.java).putExtra(SessionActivity.EXTRA_STEAMVR, false), System.currentTimeMillis())
|
||||
},
|
||||
onPlaySteamVr = { playSteamVr() },
|
||||
onSteamUrl = { url ->
|
||||
if (!SessionState.running) startSession(
|
||||
Intent(this, SessionActivity::class.java).putExtra(SessionService.EXTRA_STEAM_URL, url),
|
||||
Intent(this, SessionActivity::class.java).putExtra(SessionService.EXTRA_STEAM_URL, url), steamSession = true,
|
||||
)
|
||||
},
|
||||
onPlayDesktopUi = {
|
||||
startSession(Intent(this, SessionActivity::class.java)
|
||||
.putExtra(SessionService.EXTRA_MODE, SessionService.MODE_STEAM)
|
||||
.putExtra(SessionService.EXTRA_STEAM_UI, "desktop"))
|
||||
.putExtra(SessionService.EXTRA_STEAM_UI, "desktop"), steamSession = true)
|
||||
},
|
||||
onSteamGame = { g ->
|
||||
if (shortcutPicker) chooseGameShortcut(g)
|
||||
@@ -1853,9 +1876,31 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
SessionPrefs.setBackActionsInverted(this, inverted)
|
||||
backActionsInverted = inverted
|
||||
},
|
||||
onRefreshPhantomStatus = { refreshPhantomStatus() },
|
||||
onOpenDeveloperOptions = { displayId -> openDeveloperOptions(displayId) },
|
||||
onStartWirelessAdbPairing = { WirelessAdbPairingService.start(this) },
|
||||
onStartPairingGuide = { displayId -> PairingGuideActivity.start(this, displayId) },
|
||||
onSetPhantomProcessLimit = { enabled, complete ->
|
||||
Thread({
|
||||
val result = runCatching { WirelessAdbFix.setUsingSavedPairing(this@FrontEndActivity, enabled) }
|
||||
val error = result.exceptionOrNull()?.let { it.localizedMessage ?: getString(R.string.main_wadb_unavailable) }
|
||||
ui.post {
|
||||
if (error == null) refreshPhantomStatus()
|
||||
complete(error)
|
||||
}
|
||||
}, "wireless-adb-setting").start()
|
||||
},
|
||||
onCopyPhantomCommand = { enabled ->
|
||||
(getSystemService(CLIPBOARD_SERVICE) as ClipboardManager).setPrimaryClip(
|
||||
ClipData.newPlainText(getString(R.string.main_adb_clip_label), PhantomProcessLimit.adbCommand(enabled)),
|
||||
)
|
||||
android.widget.Toast.makeText(this, R.string.main_adb_copied, android.widget.Toast.LENGTH_SHORT).show()
|
||||
},
|
||||
onDismissPhantomGate = { queuedLaunch.clear(); showPhantomGate = false },
|
||||
onShowPhantomGate = {
|
||||
refreshPhantomStatus()
|
||||
showPhantomGate = true
|
||||
},
|
||||
onStartWirelessAdbPairing = { enabled -> WirelessAdbPairingService.start(this, enabled) },
|
||||
onStartPairingGuide = { displayId, toggleOnly -> PairingGuideActivity.start(this, displayId, toggleOnly) },
|
||||
onEnsureNotifications = { done -> ensureNotifications(done) },
|
||||
updates = updates.actions(),
|
||||
controller = ControllerActions(
|
||||
@@ -2037,7 +2082,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
}
|
||||
|
||||
private fun startSteamSession(steamVr: Boolean = false) {
|
||||
startSession(Intent(this, SessionActivity::class.java).putExtra(SessionActivity.EXTRA_STEAMVR, steamVr))
|
||||
startSession(Intent(this, SessionActivity::class.java).putExtra(SessionActivity.EXTRA_STEAMVR, steamVr), steamSession = true, queueIfBlocked = !steamVr)
|
||||
}
|
||||
|
||||
@Suppress("OVERRIDE_DEPRECATION")
|
||||
@@ -2295,7 +2340,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
com.droiddeck.launcher.ui.QuitFlood.take()?.let { c ->
|
||||
returning = ReturningFlood(c, com.droiddeck.launcher.ui.LaunchOrigin.takeReturn())
|
||||
}
|
||||
refreshAdbPairing()
|
||||
refreshPhantomStatus()
|
||||
syncLossless()
|
||||
updates.onResume()
|
||||
drivers.checkOnOpen()
|
||||
@@ -2369,6 +2414,10 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
outState.putBoolean(STATE_HOME_CHOICE_OPEN, homeChoiceOpen)
|
||||
outState.putBoolean(STATE_GAME_SPACE_OFFERED, gameSpaceOffered)
|
||||
pendingSessionLogExport?.let { outState.putString(KEY_PENDING_SESSION_LOG_EXPORT, it.absolutePath) }
|
||||
queuedLaunch.launch?.let {
|
||||
outState.putParcelable(STATE_PENDING_GATE_LAUNCH, it)
|
||||
outState.putLong(STATE_PENDING_GATE_LAUNCH_AT, queuedLaunch.queuedAt)
|
||||
}
|
||||
if (slowUsbNever) SessionPrefs.setSlowUsbWarningOff(this)
|
||||
saveCompatLaunch(outState)
|
||||
pendingSwitch?.let { outState.putParcelable(KEY_PENDING_SWITCH, it) }
|
||||
@@ -2406,6 +2455,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
override fun onDestroy() {
|
||||
// The queued launch was saved before this; a restored activity keeps its copy, and this one must not start it too.
|
||||
if (com.droiddeck.launcher.session.Onboarding.onFirstRunReady === firstRunReady) com.droiddeck.launcher.session.Onboarding.onFirstRunReady = null
|
||||
queuedLaunchRunner.destroy()
|
||||
triggerKeys.cancel()
|
||||
launchCoordinator.cancelAll()
|
||||
cancelCompatLaunch()
|
||||
@@ -2999,8 +3049,8 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
fsyncFirst = fsyncFirst,
|
||||
gamescopeRealtime = gamescopeRealtime,
|
||||
gpuClockPin = gpuClockPin,
|
||||
desktopAsUser = desktopAsUser, cursorComposite = cursorComposite,
|
||||
guestHostname = guestHostname,
|
||||
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 },
|
||||
@@ -3013,7 +3063,9 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
onFsyncFirst = { on -> SessionPrefs.setFsyncFirst(this, on); fsyncFirst = on },
|
||||
onGamescopeRealtime = { on -> SessionPrefs.setGamescopeRealtime(this, on); gamescopeRealtime = on },
|
||||
onGpuClockPin = { on -> SessionPrefs.setGpuClockPin(this, on); gpuClockPin = on },
|
||||
onDesktopAsUser = { on -> SessionPrefs.setDesktopAsUser(this, on); desktopAsUser = on },
|
||||
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 ->
|
||||
@@ -3329,10 +3381,12 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
gamescopeRealtime = SessionPrefs.gamescopeRealtime(this)
|
||||
paceCores = SessionPrefs.paceCores(this)
|
||||
gpuClockPin = SessionPrefs.gpuClockPin(this)
|
||||
desktopAsUser = SessionPrefs.desktopAsUser(this)
|
||||
prootNoSeccomp = SessionPrefs.prootNoSeccomp(this)
|
||||
prootFastPath = SessionPrefs.prootFastPath(this)
|
||||
nativeUserland = SessionPrefs.nativeUserland(this)
|
||||
cursorComposite = SessionPrefs.cursorComposite(this)
|
||||
guestHostname = SessionPrefs.guestHostname(this)
|
||||
refreshAdbPairing()
|
||||
refreshPhantomStatus()
|
||||
}
|
||||
|
||||
private fun gameDebugLogsNeedsRestart(): Boolean =
|
||||
@@ -3515,7 +3569,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
install(release)
|
||||
}
|
||||
|
||||
private fun startSession(intent: Intent): Boolean {
|
||||
private fun startSession(intent: Intent, steamSession: Boolean = false, queueIfBlocked: Boolean = false): Boolean {
|
||||
if (busy || LinuxRuntimeInstaller.isBusy()) return false
|
||||
if (SessionState.installing != null && !SessionState.running) {
|
||||
android.widget.Toast.makeText(this, R.string.main_wait_desktop_install, android.widget.Toast.LENGTH_SHORT).show()
|
||||
@@ -3529,6 +3583,12 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
android.widget.Toast.makeText(this, R.string.steam_store_session_wait, android.widget.Toast.LENGTH_SHORT).show()
|
||||
return false
|
||||
}
|
||||
refreshPhantomStatus()
|
||||
if (steamSession && PhantomProcessLimit.blocksSteam(phantomProcessStatus)) {
|
||||
if (queueIfBlocked) queuedLaunch.queue(intent, System.currentTimeMillis())
|
||||
showPhantomGate = true
|
||||
return false
|
||||
}
|
||||
val warn = installed == null && !com.droiddeck.launcher.core.DeviceSupport.canDraw(this)
|
||||
if (warn && available != null) { showNonAdreno = available; return false }
|
||||
startActivity(intent)
|
||||
@@ -3573,14 +3633,42 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
done(granted)
|
||||
}
|
||||
|
||||
private fun refreshAdbPairing() {
|
||||
private val queuedLaunch = com.droiddeck.launcher.session.QueuedLaunch<Intent>(GATE_LAUNCH_MS)
|
||||
private val queuedLaunchRunner = com.droiddeck.launcher.session.QueuedLaunchRunner(
|
||||
queue = queuedLaunch,
|
||||
now = System::currentTimeMillis,
|
||||
blocked = { PhantomProcessLimit.blocksSteam(phantomProcessStatus) },
|
||||
busy = ::steamStartBusy,
|
||||
schedule = { delay, task -> if (delay <= 0L) ui.post(task) else ui.postDelayed(task, delay) },
|
||||
unschedule = ui::removeCallbacks,
|
||||
start = { launch -> startSession(launch, steamSession = true, queueIfBlocked = true) },
|
||||
retryMs = GATE_LAUNCH_RETRY_MS,
|
||||
)
|
||||
|
||||
/** The conditions under which a Steam start waits instead of being refused: setup, a runtime or desktop install, a storage cleanup, or a Steam store download. */
|
||||
private fun steamStartBusy(): Boolean = busy || LinuxRuntimeInstaller.isBusy() || com.droiddeck.launcher.session.Onboarding.settling() ||
|
||||
(SessionState.installing != null && !SessionState.running) || com.droiddeck.launcher.storage.StorageState.cleaning ||
|
||||
(!SessionState.running && com.droiddeck.launcher.stores.steam.SteamStore.downloading())
|
||||
|
||||
private fun refreshPhantomStatus() {
|
||||
phantomProcessStatus = PhantomProcessLimit.read(this)
|
||||
if (queuedLaunch.launch != null && !PhantomProcessLimit.blocksSteam(phantomProcessStatus)) showPhantomGate = false
|
||||
queuedLaunchRunner.poke()
|
||||
adbPaired = WirelessAdbFix.hasSavedPairing(this)
|
||||
phantomWarning = if (PhantomProcessLimit.blocksSteam(phantomProcessStatus)) {
|
||||
getString(
|
||||
R.string.phantom_warning, PhantomProcessLimit.title(this, phantomProcessStatus),
|
||||
PhantomProcessLimit.instructions(this, phantomProcessStatus), PhantomProcessLimit.adbCommand(),
|
||||
)
|
||||
} else null
|
||||
}
|
||||
|
||||
private fun openDeveloperOptions(displayId: Int?) {
|
||||
val highlight = if (PhantomProcessLimit.hasDeveloperToggle() &&
|
||||
WirelessAdbPairingService.stage.value == WirelessAdbPairingService.Stage.Idle) "disable_phantom_process_monitor" else "toggle_adb_wireless"
|
||||
val intent = Intent(android.provider.Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS)
|
||||
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
.putExtra(":settings:fragment_args_key", "toggle_adb_wireless")
|
||||
.apply { if (highlight != null) putExtra(":settings:fragment_args_key", highlight) }
|
||||
try {
|
||||
if (displayId == null) startActivity(intent)
|
||||
else startActivity(intent, ActivityOptions.makeBasic().setLaunchDisplayId(displayId).toBundle())
|
||||
@@ -3702,6 +3790,10 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
private const val REQUEST_NOTIFICATIONS = 7103
|
||||
private const val EXTRA_RESTARTED = "com.droiddeck.launcher.extra.RESTARTED"
|
||||
private const val STATE_HOME_CHOICE_OPEN = "home_choice_open"
|
||||
private const val STATE_PENDING_GATE_LAUNCH = "pending_gate_launch"
|
||||
private const val STATE_PENDING_GATE_LAUNCH_AT = "pending_gate_launch_at"
|
||||
private const val GATE_LAUNCH_MS = 15 * 60_000L
|
||||
private const val GATE_LAUNCH_RETRY_MS = 2_000L
|
||||
private const val KEY_PENDING_SESSION_LOG_EXPORT = "pending_session_log_export"
|
||||
private const val STATE_GAME_SPACE_OFFERED = "game_space_offered"
|
||||
private const val TAG = "MainActivity"
|
||||
|
||||
@@ -58,6 +58,7 @@ import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.droiddeck.launcher.core.AppLanguage
|
||||
import com.droiddeck.launcher.core.GlobalSettings
|
||||
import com.droiddeck.launcher.core.PhantomProcessLimit
|
||||
import com.droiddeck.launcher.core.WirelessAdbPairingService
|
||||
import com.droiddeck.launcher.core.WirelessAdbPairingService.Stage
|
||||
import com.droiddeck.launcher.ui.DroidDeckTheme
|
||||
@@ -67,9 +68,10 @@ import com.droiddeck.launcher.ui.SecondaryButton
|
||||
import kotlinx.coroutines.delay
|
||||
|
||||
class PairingGuideActivity : ComponentActivity() {
|
||||
enum class Step { BUILD_NUMBER, WIRELESS_DEBUGGING, PAIR, CODE, WORKING, DONE, FAILED }
|
||||
enum class Step { BUILD_NUMBER, CHILD_PROCESS, WIRELESS_DEBUGGING, PAIR, CODE, WORKING, DONE, FAILED }
|
||||
|
||||
private var settingsDisplay: Int? = null
|
||||
private var toggleOnly = false
|
||||
private var inPip by mutableStateOf(false)
|
||||
private var launchPending = false
|
||||
|
||||
@@ -78,6 +80,7 @@ class PairingGuideActivity : ComponentActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
settingsDisplay = intent.getIntExtra(EXTRA_DISPLAY, -1).takeIf { it >= 0 }
|
||||
toggleOnly = intent.getBooleanExtra(EXTRA_TOGGLE_ONLY, false)
|
||||
setContent { DroidDeckTheme { Guide() } }
|
||||
launchPending = savedInstanceState == null
|
||||
}
|
||||
@@ -86,6 +89,7 @@ class PairingGuideActivity : ComponentActivity() {
|
||||
super.onNewIntent(intent)
|
||||
setIntent(intent)
|
||||
settingsDisplay = intent.getIntExtra(EXTRA_DISPLAY, -1).takeIf { it >= 0 }
|
||||
toggleOnly = intent.getBooleanExtra(EXTRA_TOGGLE_ONLY, false)
|
||||
launchPending = true
|
||||
}
|
||||
|
||||
@@ -116,7 +120,7 @@ class PairingGuideActivity : ComponentActivity() {
|
||||
|
||||
private fun launchSettings() {
|
||||
launchPending = false
|
||||
openSettings(stepFor(SettingsState.read(this), WirelessAdbPairingService.stage.value))
|
||||
openSettings(stepFor(SettingsState.read(this), WirelessAdbPairingService.stage.value, toggleOnly))
|
||||
}
|
||||
|
||||
private fun enterPip() {
|
||||
@@ -130,7 +134,7 @@ class PairingGuideActivity : ComponentActivity() {
|
||||
Intent(Settings.ACTION_DEVICE_INFO_SETTINGS).putExtra(HIGHLIGHT_KEY, "build_number")
|
||||
} else {
|
||||
Intent(Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS).apply {
|
||||
putExtra(HIGHLIGHT_KEY, "toggle_adb_wireless")
|
||||
if (step != Step.CHILD_PROCESS) putExtra(HIGHLIGHT_KEY, "toggle_adb_wireless")
|
||||
}
|
||||
}.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
val display = settingsDisplay
|
||||
@@ -157,10 +161,10 @@ class PairingGuideActivity : ComponentActivity() {
|
||||
delay(500)
|
||||
}
|
||||
}
|
||||
val step = stepFor(settingsState, stage)
|
||||
val step = stepFor(settingsState, stage, toggleOnly)
|
||||
var previous by remember { mutableStateOf(step) }
|
||||
LaunchedEffect(step) {
|
||||
if (previous == Step.BUILD_NUMBER && step == Step.WIRELESS_DEBUGGING) openSettings(step)
|
||||
if (previous == Step.BUILD_NUMBER && (step == Step.WIRELESS_DEBUGGING || step == Step.CHILD_PROCESS)) openSettings(step)
|
||||
previous = step
|
||||
when (step) {
|
||||
Step.DONE -> { delay(1_500); returnToApp() }
|
||||
@@ -168,7 +172,7 @@ class PairingGuideActivity : ComponentActivity() {
|
||||
else -> Unit
|
||||
}
|
||||
}
|
||||
LaunchedEffect(stage) { if (stage == Stage.Idle) finish() }
|
||||
LaunchedEffect(stage) { if (stage == Stage.Idle && !toggleOnly) finish() }
|
||||
BackHandler(enabled = !inPip && settingsDisplay == null) { enterPip() }
|
||||
|
||||
Box(Modifier.fillMaxSize().background(MaterialTheme.colorScheme.background), contentAlignment = Alignment.Center) {
|
||||
@@ -195,7 +199,7 @@ class PairingGuideActivity : ComponentActivity() {
|
||||
Modifier.widthIn(max = 520.dp).fillMaxWidth().padding(24.dp),
|
||||
verticalArrangement = Arrangement.spacedBy(16.dp),
|
||||
) {
|
||||
Text(stringResource(R.string.adbpair_title_pair), style = MaterialTheme.typography.headlineSmall,
|
||||
Text(stringResource(R.string.gate_title), style = MaterialTheme.typography.headlineSmall,
|
||||
fontWeight = FontWeight.Bold, color = MaterialTheme.colorScheme.onBackground)
|
||||
Text(instruction(step, stage), style = MaterialTheme.typography.titleMedium, color = MaterialTheme.colorScheme.onBackground)
|
||||
StepVisual(step, compact = false)
|
||||
@@ -209,7 +213,7 @@ class PairingGuideActivity : ComponentActivity() {
|
||||
openSettings(step)
|
||||
})
|
||||
SecondaryButton(stringResource(R.string.common_cancel), onClick = {
|
||||
WirelessAdbPairingService.cancel(this@PairingGuideActivity)
|
||||
if (!toggleOnly) WirelessAdbPairingService.cancel(this@PairingGuideActivity)
|
||||
returnToApp()
|
||||
})
|
||||
}
|
||||
@@ -220,11 +224,12 @@ class PairingGuideActivity : ComponentActivity() {
|
||||
@Composable
|
||||
private fun instruction(step: Step, stage: Stage): String = when (step) {
|
||||
Step.BUILD_NUMBER -> stringResource(R.string.pairguide_build_number)
|
||||
Step.CHILD_PROCESS -> stringResource(R.string.pairguide_child_process)
|
||||
Step.WIRELESS_DEBUGGING -> stringResource(R.string.pairguide_wireless)
|
||||
Step.PAIR -> stringResource(R.string.pairguide_pair)
|
||||
Step.CODE -> (stage as? Stage.CodeNeeded)?.error ?: stringResource(R.string.gate_step3)
|
||||
Step.WORKING -> (stage as? Stage.Working)?.step ?: stringResource(R.string.adbpair_title_pair)
|
||||
Step.DONE -> stringResource(R.string.adbpair_paired)
|
||||
Step.WORKING -> (stage as? Stage.Working)?.step ?: stringResource(R.string.adbpair_title_working)
|
||||
Step.DONE -> stringResource(R.string.adbpair_title_done)
|
||||
Step.FAILED -> (stage as? Stage.Failed)?.error ?: stringResource(R.string.adbpair_title_failed)
|
||||
}
|
||||
|
||||
@@ -236,6 +241,7 @@ class PairingGuideActivity : ComponentActivity() {
|
||||
val beat by pulse.animateFloat(0f, 1f, infiniteRepeatable(tween(900, easing = LinearEasing), RepeatMode.Restart), label = "beat")
|
||||
val label = when (step) {
|
||||
Step.BUILD_NUMBER -> stringResource(R.string.pairguide_row_build_number)
|
||||
Step.CHILD_PROCESS -> stringResource(R.string.pairguide_row_child_process)
|
||||
Step.WIRELESS_DEBUGGING -> stringResource(R.string.pairguide_row_wireless)
|
||||
Step.PAIR -> stringResource(R.string.pairguide_row_pair)
|
||||
Step.CODE -> stringResource(R.string.adbpair_enter_code)
|
||||
@@ -250,7 +256,7 @@ class PairingGuideActivity : ComponentActivity() {
|
||||
Text(label, style = if (compact) MaterialTheme.typography.labelMedium else MaterialTheme.typography.bodyLarge,
|
||||
color = colors.onSurface, maxLines = 1, overflow = TextOverflow.Ellipsis, modifier = Modifier.weight(1f))
|
||||
when (step) {
|
||||
Step.WIRELESS_DEBUGGING -> Toggle(on = beat > 0.5f, accent = accent, compact = compact)
|
||||
Step.WIRELESS_DEBUGGING, Step.CHILD_PROCESS -> Toggle(on = beat > 0.5f, accent = accent, compact = compact)
|
||||
else -> Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(6.dp)) {
|
||||
if (step == Step.BUILD_NUMBER) Text("×7", style = MaterialTheme.typography.labelLarge, color = accent)
|
||||
Box(contentAlignment = Alignment.Center) {
|
||||
@@ -277,7 +283,8 @@ class PairingGuideActivity : ComponentActivity() {
|
||||
@Composable
|
||||
private fun StepDots(step: Step) {
|
||||
val accent = LocalPalette.current.signal
|
||||
val shown = listOf(Step.BUILD_NUMBER, Step.WIRELESS_DEBUGGING, Step.PAIR, Step.CODE)
|
||||
val shown = if (toggleOnly) listOf(Step.BUILD_NUMBER, Step.CHILD_PROCESS)
|
||||
else listOf(Step.BUILD_NUMBER, Step.WIRELESS_DEBUGGING, Step.PAIR, Step.CODE)
|
||||
val at = shown.indexOf(step).takeIf { it >= 0 } ?: shown.size
|
||||
Row(horizontalArrangement = Arrangement.spacedBy(5.dp), verticalAlignment = Alignment.CenterVertically) {
|
||||
shown.forEachIndexed { index, _ ->
|
||||
@@ -291,20 +298,27 @@ class PairingGuideActivity : ComponentActivity() {
|
||||
private data class SettingsState(
|
||||
val developerOptions: Boolean,
|
||||
val wirelessDebugging: Boolean,
|
||||
val childProcessBlocked: Boolean,
|
||||
) {
|
||||
companion object {
|
||||
fun read(context: Context) = SettingsState(
|
||||
GlobalSettings.developerOptionsOn(context),
|
||||
GlobalSettings.wirelessDebuggingOn(context),
|
||||
PhantomProcessLimit.blocksSteam(PhantomProcessLimit.read(context)),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val EXTRA_DISPLAY = "settingsDisplay"
|
||||
private const val EXTRA_TOGGLE_ONLY = "toggleOnly"
|
||||
private const val HIGHLIGHT_KEY = ":settings:fragment_args_key"
|
||||
|
||||
private fun stepFor(settings: SettingsState, stage: Stage): Step = when (stage) {
|
||||
private fun stepFor(settings: SettingsState, stage: Stage, toggleOnly: Boolean): Step = if (toggleOnly) when {
|
||||
!settings.developerOptions -> Step.BUILD_NUMBER
|
||||
settings.childProcessBlocked -> Step.CHILD_PROCESS
|
||||
else -> Step.DONE
|
||||
} else when (stage) {
|
||||
is Stage.Working -> Step.WORKING
|
||||
Stage.Done -> Step.DONE
|
||||
is Stage.Failed -> Step.FAILED
|
||||
@@ -328,10 +342,11 @@ class PairingGuideActivity : ComponentActivity() {
|
||||
return mode == AppOpsManager.MODE_ALLOWED
|
||||
}
|
||||
|
||||
fun start(context: Context, settingsDisplay: Int?): Boolean {
|
||||
fun start(context: Context, settingsDisplay: Int?, toggleOnly: Boolean = false): Boolean {
|
||||
if (settingsDisplay == null && !canFloat(context)) return false
|
||||
context.startActivity(Intent(context, PairingGuideActivity::class.java)
|
||||
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
.putExtra(EXTRA_TOGGLE_ONLY, toggleOnly)
|
||||
.apply { if (settingsDisplay != null) putExtra(EXTRA_DISPLAY, settingsDisplay) })
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -807,7 +807,6 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
}
|
||||
private var isHomeApp by mutableStateOf(false)
|
||||
private var androidApps by mutableStateOf<List<HomeApp.LaunchableApp>>(emptyList())
|
||||
private var padConnected by mutableStateOf(false)
|
||||
|
||||
private val deviceListener = object : InputManager.InputDeviceListener {
|
||||
override fun onInputDeviceAdded(deviceId: Int) {
|
||||
@@ -1263,10 +1262,9 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
glasses.usesSpatialControllers(glassesSettings) && glassesSettings.joyConTracking)
|
||||
joyConVr?.let { { it.recenter() } } else null,
|
||||
) { headTracker?.recenter() }
|
||||
val showGlassesShortcut = com.droiddeck.launcher.ui.rememberShowGlassesShortcut()
|
||||
if (!phonePanel && glasses.present && showGlassesShortcut && !drawerOpen && !pcKeyboardOpen && !loading.visible) com.droiddeck.launcher.ui.GlassesCornerButton(glassesSlot,
|
||||
if (!phonePanel && glasses.present && !drawerOpen && !pcKeyboardOpen && !loading.visible) com.droiddeck.launcher.ui.GlassesCornerButton(glassesSlot,
|
||||
controllerSettings?.tint ?: android.graphics.Color.rgb(90, 160, 255), controllerSettings?.opacity ?: 100) {
|
||||
drawerPage = com.droiddeck.launcher.ui.SessionDrawerPage.VR
|
||||
drawerPage = com.droiddeck.launcher.ui.SessionDrawerPage.GLASSES
|
||||
drawerOpen = true
|
||||
}
|
||||
if (!drawerOpen && !pcKeyboardOpen && !loading.visible) {
|
||||
@@ -1453,10 +1451,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
}
|
||||
}
|
||||
LaunchedEffect(drawerOpen, achievementsOpen, AgentGuest.focusRevision, StoreAchievements.revision) {
|
||||
if (!drawerOpen && !achievementsOpen) {
|
||||
achievementsInFront = null
|
||||
return@LaunchedEffect
|
||||
}
|
||||
if (!drawerOpen && !achievementsOpen) return@LaunchedEffect
|
||||
val found = kotlinx.coroutines.withContext(kotlinx.coroutines.Dispatchers.IO) {
|
||||
runCatching { resolveAchievementsInFront() }
|
||||
.onFailure { Log.w(TAG, "achievements in front: ${it.javaClass.simpleName}") }.getOrNull()
|
||||
@@ -1792,7 +1787,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
onBlackFrameInsertion = { on ->
|
||||
SessionPrefs.setBlackFrameInsertion(this@SessionActivity, on)
|
||||
blackFrameInsertion = on
|
||||
CompositorHost.setBlackFrameInsertion(on, refreshHz(), compositorFpsLimit())
|
||||
CompositorHost.setBlackFrameInsertion(on, refreshHz(), outputFpsLimit())
|
||||
},
|
||||
hdr = hdrWanted,
|
||||
hdrAvailable = hdrAvailable,
|
||||
@@ -1829,9 +1824,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
onRumble = { on -> updateControllerPrefs { ControllerPrefs.setRumble(this@SessionActivity, on) } },
|
||||
onSteamMenu = if (SessionState.mode == SessionService.MODE_STEAM) ({ sendSteamGuide() }) else null,
|
||||
onQam = if (SessionState.mode == SessionService.MODE_STEAM) ({ triggerSteamQam() }) else null,
|
||||
controllerConnected = padConnected,
|
||||
achievementsGame = achievementsInFront?.game,
|
||||
achievementsTitle = achievementsInFront?.title,
|
||||
onAchievements = achievementsInFront?.let { { drawerOpen = false; achievementsOpen = true } },
|
||||
achievementsProgress = achievementsInFront?.progress,
|
||||
padType = if (SessionState.mode == SessionService.MODE_STEAM && SessionState.deckPad) padType else null,
|
||||
onPadType = { id ->
|
||||
@@ -1952,13 +1945,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
onResume = { SessionService.resume(this@SessionActivity) },
|
||||
orientation = sessionOrientation,
|
||||
onOrientation = { value ->
|
||||
when (SessionState.mode) {
|
||||
SessionService.MODE_STEAM, SessionService.MODE_RUN ->
|
||||
SessionPrefs.setOrientation(this@SessionActivity, "steam", value)
|
||||
SessionService.MODE_DESKTOP ->
|
||||
SessionPrefs.setOrientation(this@SessionActivity, "desktop", value)
|
||||
else -> SessionPrefs.setOrientation(this@SessionActivity, value)
|
||||
}
|
||||
SessionPrefs.setOrientation(this@SessionActivity, value)
|
||||
sessionOrientation = value
|
||||
applyFollowOrientation(resources.configuration)
|
||||
},
|
||||
@@ -2737,7 +2724,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
oscTrackpads = SessionPrefs.oscTrackpads(this)
|
||||
backHold = SessionPrefs.backHold(this)
|
||||
dockedMenuController = SessionPrefs.dockedMenuController(this)
|
||||
sessionOrientation = SessionPrefs.orientation(this, SessionState.mode)
|
||||
sessionOrientation = SessionPrefs.orientation(this)
|
||||
dualScreenSessionMode = SessionPrefs.dualScreenSessionMode(this)
|
||||
backActionsInverted = SessionPrefs.backActionsInverted(this)
|
||||
physicalShortcuts.bindings = PhysicalShortcuts.read(this)
|
||||
@@ -3003,7 +2990,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
CompositorHost.startOrAttach(
|
||||
this, holder.surface, runtimeDir.path,
|
||||
driverId?.let { turnip.driverPath(it) }, driverId?.let { turnip.libraryName(it) },
|
||||
applicationInfo.nativeLibraryDir, size.first, size.second, refreshHz(holder), compositorFpsLimit(),
|
||||
applicationInfo.nativeLibraryDir, size.first, size.second, refreshHz(holder), outputFpsLimit(),
|
||||
)
|
||||
onOutputAttached(holder)
|
||||
if (SessionState.running && size != previous) {
|
||||
@@ -3069,7 +3056,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
WaylandCompositor.nativeResizeOutput(size.first, size.second)
|
||||
}
|
||||
|
||||
private fun followPortrait(): Boolean = glassesScreen == null && SessionPrefs.portrait(this, SessionState.mode)
|
||||
private fun followPortrait(): Boolean = glassesScreen == null && SessionPrefs.portrait(this)
|
||||
|
||||
private fun applyFollowChoice() {
|
||||
val scale = SessionState.followScales.let { if (followPortrait()) it.second else it.first }
|
||||
@@ -3078,7 +3065,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
}
|
||||
|
||||
private fun applyFollowOrientation(config: android.content.res.Configuration) {
|
||||
val wanted = SessionPrefs.windowOrientation(this, SessionState.followScreen, config.smallestScreenWidthDp, SessionState.mode)
|
||||
val wanted = SessionPrefs.windowOrientation(this, SessionState.followScreen, config.smallestScreenWidthDp)
|
||||
if (requestedOrientation != wanted) requestedOrientation = wanted
|
||||
}
|
||||
|
||||
@@ -3141,13 +3128,13 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
private fun displayMode(): String = SessionPrefs.displayMode(this,
|
||||
intent.getStringExtra(SessionService.EXTRA_MODE) ?: SessionService.MODE_STEAM, intent.getStringExtra(SessionService.EXTRA_PROGRAM))
|
||||
|
||||
private fun portraitOutput(): Boolean = SessionPrefs.portrait(this, SessionState.mode) && !controlsBelowWanted()
|
||||
private fun portraitOutput(): Boolean = SessionPrefs.portrait(this) && !controlsBelowWanted()
|
||||
|
||||
private fun outputSize(): Pair<Int, Int> =
|
||||
com.droiddeck.launcher.session.SessionDisplay.resolveChoice(com.droiddeck.launcher.session.SessionDisplay.panelSize(this),
|
||||
resolutionChoice(), portraitOutput())
|
||||
|
||||
private fun resolutionChoice(portrait: Boolean = SessionPrefs.portrait(this, SessionState.mode)): String {
|
||||
private fun resolutionChoice(portrait: Boolean = SessionPrefs.portrait(this)): String {
|
||||
val mode = displayMode()
|
||||
val program = intent.getStringExtra(SessionService.EXTRA_PROGRAM)
|
||||
return if (intent.getStringExtra(SessionService.EXTRA_MODE) == SessionService.MODE_RUN &&
|
||||
@@ -3194,18 +3181,6 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
|
||||
private fun outputFpsLimit(): Int = outputFpsLimit(pipUi)
|
||||
|
||||
// Android holds the window to the Game Mode override while the panel runs faster; the guest paces to the panel,
|
||||
// so without this cap every frame past the override is drawn and dropped.
|
||||
private fun hostFrameCap(): Int {
|
||||
if (glassesScreen != null || bottomOutputActive) return 0
|
||||
val display = (if (Build.VERSION.SDK_INT >= 30) display else @Suppress("DEPRECATION") windowManager.defaultDisplay) ?: return 0
|
||||
return SessionPrefs.hostFrameCap(display.refreshRate, display.mode.refreshRate)
|
||||
}
|
||||
|
||||
private fun compositorFpsLimit(): Int = SessionPrefs.compositorFpsLimit(
|
||||
mirrorRefreshLimit(), if (noSteamSession()) SessionState.fpsLimit else 0, pipUi, hostFrameCap(),
|
||||
)
|
||||
|
||||
private fun outputFpsLimit(pip: Boolean): Int =
|
||||
SessionPrefs.compositorFpsLimit(mirrorRefreshLimit(), if (noSteamSession()) SessionState.fpsLimit else 0, pip)
|
||||
|
||||
@@ -3243,7 +3218,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
)
|
||||
val hz = refreshHz()
|
||||
val changed = kotlin.math.abs(SessionState.refreshHz - hz) > 0.1f
|
||||
CompositorHost.updatePacing(hz, compositorFpsLimit())
|
||||
CompositorHost.updatePacing(hz, outputFpsLimit())
|
||||
pushCardboard(activeCardboard)
|
||||
if (changed && ::surfaceView.isInitialized) applyFrameGen()
|
||||
}
|
||||
@@ -3637,6 +3612,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
presentationFaultHint()?.let { return it }
|
||||
if (log == null || !log.isFile) return null
|
||||
return try {
|
||||
var enosys = 0
|
||||
var fexMissing = false
|
||||
val size = log.length()
|
||||
val text = java.io.RandomAccessFile(log, "r").use { f ->
|
||||
@@ -3647,6 +3623,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
String(bytes, Charsets.ISO_8859_1)
|
||||
}
|
||||
text.lineSequence().forEach { line ->
|
||||
if (line.contains("Function not implemented")) enosys++
|
||||
if (line.contains(FEX_MISSING)) fexMissing = true
|
||||
}
|
||||
val steamSetup = com.droiddeck.launcher.session.SteamClientSetupFailure.find(text.lineSequence())
|
||||
@@ -3668,6 +3645,9 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
} else if (fexMissing) {
|
||||
val what = com.droiddeck.launcher.frontend.Library.nameForProgram(SessionState.program) ?: getString(R.string.session_end_program)
|
||||
EndHint(getString(R.string.session_end_fex_missing, what), evenOnSuccess = true)
|
||||
} else if (enosys >= 8) {
|
||||
EndHint(resources.getQuantityString(R.plurals.session_hint_enosys, enosys, enosys,
|
||||
getString(R.string.perf_title), getString(R.string.perf_seccomp), getString(R.string.perf_xalia)))
|
||||
} else null
|
||||
} catch (e: Exception) {
|
||||
null
|
||||
@@ -3809,7 +3789,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
if (fromController && (event.keyCode == KeyEvent.KEYCODE_BUTTON_L1 || event.keyCode == KeyEvent.KEYCODE_BUTTON_R1)) {
|
||||
if (event.action == KeyEvent.ACTION_DOWN && event.repeatCount == 0) {
|
||||
// The bumpers walk the tabs on the strip; a page kept inside More counts as the More tab.
|
||||
val pages = sessionDrawerPages(achievementsInFront != null)
|
||||
val pages = sessionDrawerPages(glasses.present)
|
||||
drawerPage = pages.strip().step(pages.tabFor(drawerPage), if (event.keyCode == KeyEvent.KEYCODE_BUTTON_R1) 1 else -1)
|
||||
releaseDrawerDirection()
|
||||
}
|
||||
@@ -4965,7 +4945,6 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
}
|
||||
|
||||
private fun refreshControls() {
|
||||
padConnected = controllerConnected()
|
||||
applyUnfoldedControls()
|
||||
updateOnScreenControls()
|
||||
}
|
||||
@@ -6406,7 +6385,6 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
}
|
||||
(getSystemService(INPUT_SERVICE) as? InputManager)
|
||||
?.registerInputDeviceListener(deviceListener, Handler(Looper.getMainLooper()))
|
||||
padConnected = controllerConnected()
|
||||
padBridge?.setStickDeadZone(ControllerPrefs.deadZone(this))
|
||||
refreshSecondScreenDisplays()
|
||||
if (SessionState.guestPid > 1) padBridge?.syncConnectedControllers()
|
||||
|
||||
@@ -7,7 +7,7 @@ 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: the paired
|
||||
* 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.
|
||||
|
||||
@@ -3,9 +3,13 @@ package com.droiddeck.launcher.agent
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import com.droiddeck.launcher.runtime.LinuxRuntime
|
||||
import com.droiddeck.launcher.runtime.ProotFastPath
|
||||
import com.droiddeck.launcher.session.SessionPhase
|
||||
import com.droiddeck.launcher.session.SessionState
|
||||
import org.json.JSONArray
|
||||
import org.json.JSONObject
|
||||
import java.io.File
|
||||
import java.security.MessageDigest
|
||||
import java.nio.file.Files
|
||||
import java.nio.file.LinkOption.NOFOLLOW_LINKS
|
||||
import java.nio.file.StandardOpenOption.READ
|
||||
@@ -54,7 +58,10 @@ object AgentEnv {
|
||||
fun override(context: Context, name: String): JSONObject = synchronized(lock) {
|
||||
AgentAccess.requireCommands(context)
|
||||
if (NAME.matchEntire(name) == null || name in setOf(".", "..")) throw AgentException("INVALID_NAME", "Override names are letters, digits, '.', '_' and '-'")
|
||||
if (name in retiredOverrides) throw AgentException("INVALID_NAME", "The Fast Path override was retired")
|
||||
if (name == LEGACY_FAST_PATH) throw AgentException("INVALID_NAME", "The fast-path library is now $FAST_PATH")
|
||||
if (name == "libddfastpath.so" && (SessionState.running || SessionState.guestPid > 0 || SessionState.phase == SessionPhase.STOPPING)) {
|
||||
throw AgentException("SESSION_ACTIVE", "Stop the session before installing a fast-path library")
|
||||
}
|
||||
val source = File(inbox(context), name)
|
||||
if (Files.isSymbolicLink(source.toPath())) throw AgentException("INVALID_NAME", "The override must be a regular file")
|
||||
if (!source.isFile) throw AgentException("NO_SUCH_FILE", "Push the binary to ${source.path} first")
|
||||
@@ -67,6 +74,10 @@ object AgentEnv {
|
||||
staged.delete()
|
||||
throw AgentException("OVERRIDE_FAILED", "Could not stage the override")
|
||||
}
|
||||
if (name == "libddfastpath.so" && !arm64SharedLibrary(staged)) {
|
||||
staged.delete()
|
||||
throw AgentException("INVALID_LIBRARY", "The fast path must be a 64-bit little-endian ARM64 ELF shared library")
|
||||
}
|
||||
if (!staged.setExecutable(true, false) || !staged.renameTo(target)) {
|
||||
staged.delete()
|
||||
throw AgentException("OVERRIDE_FAILED", "Could not install $name in the rootfs")
|
||||
@@ -76,9 +87,42 @@ object AgentEnv {
|
||||
state.put("pendingOverrides", JSONArray(merge(strings(state.optJSONArray("pendingOverrides")), listOf(name))))
|
||||
save(context, state)
|
||||
state.put("installed", "$GUEST_BIN/$name")
|
||||
if (name == "libddfastpath.so") {
|
||||
val digest = MessageDigest.getInstance("SHA-256")
|
||||
target.inputStream().use { input ->
|
||||
val buffer = ByteArray(65536)
|
||||
while (true) {
|
||||
val count = input.read(buffer)
|
||||
if (count < 0) break
|
||||
digest.update(buffer, 0, count)
|
||||
}
|
||||
}
|
||||
state.put("sha256", digest.digest().joinToString("") { "%02x".format(it) })
|
||||
}
|
||||
state
|
||||
}
|
||||
|
||||
fun fastPathLibrary(context: Context): String = synchronized(lock) {
|
||||
if (!AgentAccess.commandsAllowed(context)) return@synchronized ProotFastPath.LIBRARY
|
||||
if ("libddfastpath.so" !in strings(load(context).optJSONArray("activeOverrides"))) return@synchronized ProotFastPath.LIBRARY
|
||||
val file = File(bin(context), "libddfastpath.so")
|
||||
if (!file.isFile || Files.isSymbolicLink(file.toPath())) return@synchronized ProotFastPath.LIBRARY
|
||||
"$GUEST_BIN/libddfastpath.so"
|
||||
}
|
||||
|
||||
private fun arm64SharedLibrary(file: File): Boolean = file.inputStream().use { input ->
|
||||
val header = ByteArray(20)
|
||||
var count = 0
|
||||
while (count < header.size) {
|
||||
val read = input.read(header, count, header.size - count)
|
||||
if (read < 0) return@use false
|
||||
count += read
|
||||
}
|
||||
header.take(7) == listOf<Byte>(0x7f, 0x45, 0x4c, 0x46, 2, 1, 1) &&
|
||||
header[16] == 3.toByte() && header[17] == 0.toByte() &&
|
||||
header[18] == 183.toByte() && header[19] == 0.toByte()
|
||||
}
|
||||
|
||||
fun beginSession(context: Context): List<String> = synchronized(lock) {
|
||||
if (!AgentAccess.commandsAllowed(context)) {
|
||||
revoke(context)
|
||||
@@ -86,12 +130,18 @@ object AgentEnv {
|
||||
}
|
||||
val state = load(context)
|
||||
val active = strings(state.optJSONArray("pending"))
|
||||
val overrides = strings(state.optJSONArray("pendingOverrides"))
|
||||
bin(context).listFiles()?.filter { it.name !in overrides }?.forEach { it.delete() }
|
||||
val queued = strings(state.optJSONArray("pendingOverrides"))
|
||||
val legacy = File(bin(context), LEGACY_FAST_PATH)
|
||||
val stranded = FAST_PATH in queued && legacy.isFile && !File(bin(context), FAST_PATH).exists() &&
|
||||
!legacy.renameTo(File(bin(context), FAST_PATH))
|
||||
if (stranded) Log.w(TAG, "could not rename the queued $LEGACY_FAST_PATH; it stays queued for the next session")
|
||||
val overrides = if (stranded) queued - FAST_PATH else queued
|
||||
bin(context).listFiles()
|
||||
?.filter { it.name !in overrides && !(stranded && it.name == LEGACY_FAST_PATH) }?.forEach { it.delete() }
|
||||
val lines = strings(state.optJSONArray("persistent")) + active
|
||||
val withPath = if (overrides.isEmpty()) lines else lines + "PATH=$GUEST_BIN:${pathOf(lines)}"
|
||||
val withPath = if (overrides.none { it != "libddfastpath.so" }) lines else lines + "PATH=$GUEST_BIN:${pathOf(lines)}"
|
||||
state.put("active", JSONArray(active)).put("pending", JSONArray())
|
||||
state.put("activeOverrides", JSONArray(overrides)).put("pendingOverrides", JSONArray())
|
||||
state.put("activeOverrides", JSONArray(overrides)).put("pendingOverrides", JSONArray(if (stranded) listOf(FAST_PATH) else emptyList()))
|
||||
save(context, state)
|
||||
if (withPath.isNotEmpty()) Log.i(TAG, "agent environment keys for this session: ${withPath.map { it.substringBefore('=') }}")
|
||||
withPath
|
||||
@@ -114,7 +164,8 @@ object AgentEnv {
|
||||
save(context, state)
|
||||
}
|
||||
|
||||
private val retiredOverrides = setOf("libddfastpath.so", "libblfastpath.so")
|
||||
private const val FAST_PATH = "libddfastpath.so"
|
||||
private const val LEGACY_FAST_PATH = "libblfastpath.so"
|
||||
|
||||
private fun pathOf(lines: List<String>) =
|
||||
lines.lastOrNull { it.startsWith("PATH=") }?.substringAfter('=')?.takeIf { it.isNotBlank() } ?: LinuxRuntime.GUEST_PATH
|
||||
@@ -145,7 +196,7 @@ object AgentEnv {
|
||||
if (!state.has(key)) state.put(key, JSONArray())
|
||||
}
|
||||
for (key in listOf("pendingOverrides", "activeOverrides")) {
|
||||
state.put(key, JSONArray(strings(state.optJSONArray(key)).filterNot { it in retiredOverrides }.distinct()))
|
||||
state.put(key, JSONArray(strings(state.optJSONArray(key)).map { if (it == LEGACY_FAST_PATH) FAST_PATH else it }.distinct()))
|
||||
}
|
||||
return state
|
||||
}
|
||||
|
||||
@@ -373,7 +373,7 @@ object Codex : AgentHarness {
|
||||
override val plans = false
|
||||
override val efforts = listOf("low", "medium", "high")
|
||||
|
||||
// Codex's sandbox needs Landlock and seccomp, which the Android guest cannot provide, so commands run unsandboxed
|
||||
// Codex's sandbox needs Landlock and seccomp, which proot does not provide, so commands run unsandboxed
|
||||
// and "untrusted" is what makes Codex ask before each one that is not known to be safe.
|
||||
override val permissions = listOf(
|
||||
AgentHarness.Permission(AgentHarness.ASK, R.string.agent_permission_ask, R.string.agent_permission_ask_hint),
|
||||
|
||||
@@ -14,6 +14,7 @@ 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
|
||||
|
||||
@@ -67,7 +68,7 @@ object AgentHost {
|
||||
|
||||
/** 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, aarch64), " +
|
||||
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. " +
|
||||
"DroidDeck's rules for working here are in your global instructions file (~/.claude/CLAUDE.md or ~/.codex/AGENTS.md); " +
|
||||
"if they are not loaded, read ${AgentSetup.CTL}/AGENTS.md before acting on the device. " +
|
||||
@@ -544,23 +545,34 @@ object AgentHost {
|
||||
state = if (installed) State.IDLE else State.MISSING
|
||||
}
|
||||
|
||||
fun guest(app: Context, command: List<String>, workdir: String = "/root", connectAdb: Boolean = true): ProcessBuilder {
|
||||
/**
|
||||
* 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<String>, 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}",
|
||||
"ADB_SERVER_SOCKET=localfilesystem:${File(app.noBackupFilesDir, "agent-adb.sock").path}",
|
||||
"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 root = LinuxRuntime.rootDir(app)
|
||||
val mounts = LinuxRuntime.binds(app, null, null, LinuxRuntime.sharedStorage(app), null)
|
||||
return com.droiddeck.launcher.runtime.NativeGuest.processBuilder(app, root, mounts, env + shell + command)
|
||||
.redirectErrorStream(true)
|
||||
val proot = LinuxRuntime.command(app, null, null, LinuxRuntime.sharedStorage(app), 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 {
|
||||
@@ -699,6 +711,7 @@ object AgentHost {
|
||||
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)
|
||||
|
||||
@@ -7,13 +7,15 @@ import org.json.JSONArray
|
||||
import org.json.JSONObject
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
/** Runs a native guest program (`droiddeckctl native`), for testing the native userland. */
|
||||
/** 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) }
|
||||
|
||||
@@ -5,6 +5,10 @@ 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,
|
||||
@@ -20,7 +24,7 @@ object AgentProcesses {
|
||||
|
||||
/** Guest processes, those under [turnPid] (the agent's current turn) first. */
|
||||
@Synchronized
|
||||
fun snapshot(root: File, turnPid: Int): List<Proc> {
|
||||
fun snapshot(turnPid: Int): List<Proc> {
|
||||
val me = Process.myPid()
|
||||
val uid = Process.myUid()
|
||||
val stats = HashMap<Int, Stat>()
|
||||
@@ -36,15 +40,14 @@ object AgentProcesses {
|
||||
val now = SystemClock.elapsedRealtime()
|
||||
val uptimeTicks = now * HZ / 1000
|
||||
val elapsed = (now - lastAt).coerceAtLeast(1)
|
||||
val launchers = com.droiddeck.launcher.runtime.GuestWorkers.guestPids().toSet() + turnPid +
|
||||
com.droiddeck.launcher.session.SessionState.guestPid
|
||||
val rootPath = root.path.trimEnd('/') + "/"
|
||||
fun ancestors(pid: Int) = generateSequence(stats[pid]?.ppid) { stats[it]?.ppid }.takeWhile { it > 1 }.take(64)
|
||||
fun nativeGuest(pid: Int): Boolean = pid in launchers || args[pid].orEmpty().split(' ').take(2).any {
|
||||
it.startsWith(rootPath)
|
||||
fun isProot(pid: Int): Boolean {
|
||||
val argv = args[pid].orEmpty().split(' ')
|
||||
val program = if (argv.first().endsWith("/linker64")) argv.getOrElse(1) { "" } else argv.first()
|
||||
return program.endsWith("proot.so") || program.endsWith("/proot")
|
||||
}
|
||||
fun ancestors(pid: Int) = generateSequence(stats[pid]?.ppid) { stats[it]?.ppid }.takeWhile { it > 1 }.take(64)
|
||||
val out = stats.values.filter { s ->
|
||||
args[s.pid].orEmpty().isNotEmpty() && (nativeGuest(s.pid) || ancestors(s.pid).any(::nativeGuest))
|
||||
!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
|
||||
|
||||
@@ -144,6 +144,8 @@ object AgentSetup {
|
||||
"apt -f install -y --fix-missing; " +
|
||||
"apt install -y --no-install-recommends git gh adb curl ca-certificates python3; $harnessInstall"
|
||||
|
||||
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) = run(context, step, null)
|
||||
|
||||
@@ -187,7 +189,7 @@ object AgentSetup {
|
||||
val result = runCatching {
|
||||
installHelpers(app)
|
||||
runCatching { harness.prepare(LinuxRuntime.rootDir(app)) }
|
||||
val child = AgentHost.guest(app, command).start()
|
||||
val child = AgentHost.guest(app, command, fakeRoot = runsAsRoot(step)).start()
|
||||
val pid = AgentProcesses.pidOf(child)
|
||||
OrphanReaper.keep(pid)
|
||||
try {
|
||||
@@ -196,7 +198,7 @@ object AgentSetup {
|
||||
child.inputStream.bufferedReader().forEachLine { line ->
|
||||
log.appendLine(line)
|
||||
val text = line.trim()
|
||||
if (text.isNotEmpty()) main.post {
|
||||
if (text.isNotEmpty() && !noise(text)) main.post {
|
||||
detail[step] = text.take(160)
|
||||
if (step == Step.GITHUB && text.startsWith("GitHub device code:")) AgentHostService.update(app)
|
||||
}
|
||||
@@ -257,7 +259,7 @@ object AgentSetup {
|
||||
// A running or newer Allow owns the row, including the instructions it shows while it waits.
|
||||
if (step == Step.CONNECTION && (generation != connectionGeneration || status[step] == Status.WORKING)) return@post
|
||||
if (status[step] != Status.WORKING) status[step] = if (ok) Status.DONE else Status.TODO
|
||||
val last = output.lines().lastOrNull { it.isNotBlank() }?.trim()?.take(160)
|
||||
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(
|
||||
@@ -268,6 +270,9 @@ object AgentSetup {
|
||||
}
|
||||
}
|
||||
|
||||
/** 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 }
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ public class DirectAudioRelayComponent extends SessionPart {
|
||||
}
|
||||
}
|
||||
final java.io.PrintWriter log = out;
|
||||
pid = HostProcess.startUncounted(command.toString(), env.toArray(new String[0]),
|
||||
pid = HostProcess.start(command.toString(), env.toArray(new String[0]),
|
||||
app().getFilesDir(), null,
|
||||
line -> {
|
||||
Log.i(TAG, line);
|
||||
|
||||
@@ -186,16 +186,13 @@ public class PulseAudioComponent extends SessionPart {
|
||||
env.add("LD_LIBRARY_PATH=/system/lib64:" + modules + ":" + workingDir.getAbsolutePath());
|
||||
env.add("HOME=" + workingDir);
|
||||
env.add("TMPDIR=" + workingDir);
|
||||
// The daemon closes every fd at start but this one; in a worker process it is the binder
|
||||
// fd whose closing Android takes for the process's death.
|
||||
env.add("PULSE_PASSED_FD=" + com.droiddeck.launcher.runtime.GuestWorker.BINDER_FD_TOKEN);
|
||||
|
||||
String command = String.join(" ", HostProcess.dataExecutable(workingDir.getAbsolutePath() + "/libpulseaudio.so"))
|
||||
+ " --system=false --disable-shm=true --fail=false"
|
||||
+ " -n --file=default.pa --daemonize=false --use-pid-file=false --exit-idle-time=-1"
|
||||
+ " --log-level=info";
|
||||
final java.io.PrintWriter out = openLog();
|
||||
if (!host.launch(generation, () -> HostProcess.startUncounted(command, env.toArray(new String[0]), workingDir, status -> {
|
||||
if (!host.launch(generation, () -> HostProcess.start(command, env.toArray(new String[0]), workingDir, status -> {
|
||||
if (host.exited(generation)) {
|
||||
Log.w(TAG, "audio host exited with status " + status + "; restarting");
|
||||
start(generation);
|
||||
|
||||
@@ -152,6 +152,9 @@ internal class AddonPack(
|
||||
const val COMPLETE = ".complete"
|
||||
private val scope = CoroutineScope(SupervisorJob() + Dispatchers.IO)
|
||||
|
||||
@JvmField
|
||||
val PROOT = AddonPack("proot", BuildConfig.PACK_PROOT_SHA256, BuildConfig.PACK_PROOT_SIZE,
|
||||
listOf("libproot.so", "libproot-loader.so"))
|
||||
@JvmField
|
||||
val DIRECTAUDIO = AddonPack("directaudio", BuildConfig.PACK_DIRECTAUDIO_SHA256, BuildConfig.PACK_DIRECTAUDIO_SIZE,
|
||||
listOf("linux-wine11/version.txt", "linux-wine11-systhread/version.txt"))
|
||||
|
||||
@@ -284,6 +284,11 @@ object DeviceReport {
|
||||
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("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))
|
||||
k("Guest host name", SessionPrefs.guestHostname(context))
|
||||
k("DirectAudio for games", SessionPrefs.directAudio(context))
|
||||
k("Stretch 16:9 to panel", SessionPrefs.stretch16x9(context))
|
||||
@@ -303,8 +308,7 @@ object DeviceReport {
|
||||
})
|
||||
|
||||
h("Android process limits")
|
||||
k("Guest-worker handoff available", com.droiddeck.launcher.runtime.GuestWorkers.enabled(context))
|
||||
k("Session root in guest worker", com.droiddeck.launcher.runtime.GuestWorkers.sessionRootUncounted ?: "no session")
|
||||
k("Phantom proc monitor", PhantomProcessLimit.reportValue(PhantomProcessLimit.read(context)))
|
||||
|
||||
h("Device switch files")
|
||||
SessionService.envSwitchFile(context)?.takeIf { it.isFile }?.let { f ->
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.droiddeck.launcher.core
|
||||
|
||||
import android.os.ParcelFileDescriptor
|
||||
import android.util.Log
|
||||
import java.io.File
|
||||
import java.util.function.Consumer
|
||||
@@ -8,9 +7,6 @@ import java.util.function.Consumer
|
||||
object HostProcess {
|
||||
private const val TAG = "HostProcess"
|
||||
private const val LINKER = "/system/bin/linker64"
|
||||
// sh -c WORKER_CD sh DIR NAME=VALUE... -- PROGRAM ARGS...
|
||||
private const val WORKER_CD = "cd \"\$1\" || exit 126; shift; " +
|
||||
"while [ \$# -gt 0 ] && [ \"\$1\" != -- ]; do export \"\$1\"; shift; done; shift; exec \"\$@\""
|
||||
|
||||
/** Android 10+ refuses to execute app data files for targetSdk 29+; its linker still loads them. */
|
||||
@JvmStatic
|
||||
@@ -69,77 +65,6 @@ object HostProcess {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* As [start], but the program runs as the main process of one of the app's worker processes,
|
||||
* which Android does not count against the app's child processes (docs/phantom-processes.md).
|
||||
* Falls back to [start] when no worker is available. The exit status is the program's exit
|
||||
* code, or 128 plus the signal that ended it, as Process.waitFor() reports it.
|
||||
*/
|
||||
@JvmStatic
|
||||
@JvmOverloads
|
||||
fun startUncounted(command: String, env: Array<String>?, dir: File?, onExit: Consumer<Int>?, onLine: Consumer<String>?,
|
||||
outputFile: File? = null, onOutputComplete: Runnable? = null): Int {
|
||||
val context = com.droiddeck.launcher.runtime.GuestWorkers.context
|
||||
val argv = split(command)
|
||||
// A missing working directory fails the launch (start() returns -1 for it), not the program
|
||||
if (context == null || argv.isEmpty() || !com.droiddeck.launcher.runtime.GuestWorkers.enabled(context) ||
|
||||
(dir != null && !dir.isDirectory)) {
|
||||
return start(command, env, dir, onExit, onLine, outputFile, onOutputComplete)
|
||||
}
|
||||
val environment = LinkedHashMap(System.getenv())
|
||||
env?.forEach { line ->
|
||||
val eq = line.indexOf('=')
|
||||
if (eq > 0) environment[line.substring(0, eq)] = line.substring(eq + 1)
|
||||
}
|
||||
val assignments = environment.map { (k, v) -> "$k=$v" }
|
||||
// A worker cannot chdir before its exec, so Android's shell does it. The shell starts with an
|
||||
// environment of its own (the program's LD_PRELOAD of glibc libraries would stop it loading)
|
||||
// and exports the program's before the exec.
|
||||
val launch = if (dir != null) {
|
||||
listOf("/system/bin/sh", "-c", WORKER_CD, "sh", dir.path) + assignments + listOf("--") + argv
|
||||
} else argv
|
||||
val workerEnv = if (dir != null) listOf("PATH=/system/bin") else assignments
|
||||
var input: ParcelFileDescriptor? = null
|
||||
var reader: ParcelFileDescriptor? = null
|
||||
var output: ParcelFileDescriptor? = null
|
||||
val pid = try {
|
||||
input = ParcelFileDescriptor.open(File("/dev/null"), ParcelFileDescriptor.MODE_READ_ONLY)
|
||||
output = when {
|
||||
onLine != null -> ParcelFileDescriptor.createPipe().let { reader = it[0]; it[1] }
|
||||
outputFile != null -> ParcelFileDescriptor.open(outputFile,
|
||||
ParcelFileDescriptor.MODE_WRITE_ONLY or ParcelFileDescriptor.MODE_CREATE or ParcelFileDescriptor.MODE_APPEND)
|
||||
else -> ParcelFileDescriptor.open(File("/dev/null"), ParcelFileDescriptor.MODE_WRITE_ONLY)
|
||||
}
|
||||
com.droiddeck.launcher.runtime.GuestWorkers.start(context, launch, workerEnv, listOf(input, output, output)) { status ->
|
||||
onExit?.accept(if (status < 0) -1 else if (status and 0x7f == 0) (status shr 8) and 0xff else 128 + (status and 0x7f))
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, "no worker for ${argv.first()}", e)
|
||||
-1
|
||||
} finally {
|
||||
runCatching { input?.close() }
|
||||
runCatching { output?.close() }
|
||||
}
|
||||
if (pid <= 0) {
|
||||
reader?.close()
|
||||
return start(command, env, dir, onExit, onLine, outputFile, onOutputComplete)
|
||||
}
|
||||
Log.i(TAG, "started pid $pid outside the child-process count: ${argv.first()} (${argv.size - 1} arguments)")
|
||||
reader?.let { pipe ->
|
||||
Thread({
|
||||
try {
|
||||
ParcelFileDescriptor.AutoCloseInputStream(pipe).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() }
|
||||
}
|
||||
return pid
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun pidOf(process: Process): Int = try {
|
||||
val field = process.javaClass.getDeclaredField("pid")
|
||||
|
||||
@@ -81,7 +81,7 @@ object NetworkReport {
|
||||
append("\netc/droiddeck-net (the link as the session sees it):\n")
|
||||
FileUtils.readString(netdev)?.lines()?.forEach { append(" ").append(it).append('\n') }
|
||||
}
|
||||
append("\nThe session uses the phone's connection\n")
|
||||
append("\nproot makes no network namespace, so the session uses the phone's connection\n")
|
||||
append("directly: IPv4 and IPv6 both pass through, and there is nothing to forward.\n")
|
||||
append("Steam reads Android's transport, connectivity and metering through the runtime's\n")
|
||||
append("NetworkManager D-Bus bridge. Android settings manage Wi-Fi and cellular connections.\n")
|
||||
|
||||
@@ -0,0 +1,136 @@
|
||||
package com.droiddeck.launcher.core
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Build
|
||||
import android.provider.Settings
|
||||
import com.droiddeck.launcher.R
|
||||
|
||||
enum class PhantomProcessStatus {
|
||||
NOT_APPLICABLE,
|
||||
DISABLED,
|
||||
ENABLED,
|
||||
UNSET,
|
||||
UNREADABLE,
|
||||
}
|
||||
|
||||
object PhantomProcessLimit {
|
||||
private const val SETTING = "settings_enable_monitor_phantom_procs"
|
||||
|
||||
private const val MAX_PHANTOM = "2147483647"
|
||||
private const val PREFS = "phantom-process-limit"
|
||||
private const val PREF_ANDROID_12_OFF = "android12-off"
|
||||
|
||||
fun usesDeviceConfig(sdk: Int = Build.VERSION.SDK_INT): Boolean = sdk == Build.VERSION_CODES.S
|
||||
|
||||
fun shellCommands(enabled: Boolean, sdk: Int = Build.VERSION.SDK_INT): List<String> = when {
|
||||
usesDeviceConfig(sdk) && enabled -> listOf(
|
||||
"device_config delete activity_manager max_phantom_processes",
|
||||
"device_config set_sync_disabled_for_tests none",
|
||||
"settings put global $SETTING true",
|
||||
)
|
||||
usesDeviceConfig(sdk) -> listOf(
|
||||
"device_config set_sync_disabled_for_tests persistent",
|
||||
"device_config put activity_manager max_phantom_processes $MAX_PHANTOM",
|
||||
"settings put global $SETTING false",
|
||||
)
|
||||
else -> listOf("settings put global $SETTING ${if (enabled) "true" else "false"}")
|
||||
}
|
||||
|
||||
fun verifyCommand(sdk: Int = Build.VERSION.SDK_INT): String =
|
||||
if (usesDeviceConfig(sdk)) "device_config get activity_manager max_phantom_processes"
|
||||
else "settings get global $SETTING"
|
||||
|
||||
fun verified(output: String, enabled: Boolean, sdk: Int = Build.VERSION.SDK_INT): Boolean {
|
||||
val value = output.trim()
|
||||
return if (usesDeviceConfig(sdk)) (value == MAX_PHANTOM) != enabled
|
||||
else value == if (enabled) "true" else "false"
|
||||
}
|
||||
|
||||
fun adbCommand(enabled: Boolean, sdk: Int = Build.VERSION.SDK_INT): String =
|
||||
shellCommands(enabled, sdk).joinToString(" && ") { "adb shell $it" }
|
||||
|
||||
fun adbCommand(): String = adbCommand(false)
|
||||
|
||||
fun rememberAndroid12(context: Context, off: Boolean) {
|
||||
context.getSharedPreferences(PREFS, Context.MODE_PRIVATE).edit().putBoolean(PREF_ANDROID_12_OFF, off).apply()
|
||||
}
|
||||
|
||||
fun read(context: Context, sdk: Int = Build.VERSION.SDK_INT): PhantomProcessStatus {
|
||||
if (sdk < Build.VERSION_CODES.S) return PhantomProcessStatus.NOT_APPLICABLE
|
||||
if (usesDeviceConfig(sdk)) {
|
||||
val off = context.getSharedPreferences(PREFS, Context.MODE_PRIVATE).getBoolean(PREF_ANDROID_12_OFF, false)
|
||||
val global = try {
|
||||
GlobalSettings.read(context, SETTING)
|
||||
} catch (_: Exception) {
|
||||
null
|
||||
}
|
||||
return android12Status(off, global, systemProperty(OVERRIDE_PROPERTY))
|
||||
}
|
||||
val global = try {
|
||||
GlobalSettings.read(context, SETTING)
|
||||
} catch (_: Exception) {
|
||||
return PhantomProcessStatus.UNREADABLE
|
||||
}
|
||||
return status(global, systemProperty(OVERRIDE_PROPERTY))
|
||||
}
|
||||
|
||||
fun android12Status(rememberedOff: Boolean, global: String?, override: String?): PhantomProcessStatus =
|
||||
if (rememberedOff || status(global, override) == PhantomProcessStatus.DISABLED) PhantomProcessStatus.DISABLED
|
||||
else PhantomProcessStatus.UNREADABLE
|
||||
|
||||
fun status(global: String?, override: String?): PhantomProcessStatus {
|
||||
val value = global?.trim()?.lowercase()?.takeIf { it.isNotEmpty() }
|
||||
?: override?.trim()?.lowercase()?.takeIf { it.isNotEmpty() }
|
||||
return when (value) {
|
||||
"false", "0" -> PhantomProcessStatus.DISABLED
|
||||
null -> PhantomProcessStatus.UNSET
|
||||
else -> PhantomProcessStatus.ENABLED
|
||||
}
|
||||
}
|
||||
|
||||
private const val OVERRIDE_PROPERTY = "persist.sys.fflag.override.$SETTING"
|
||||
|
||||
private fun systemProperty(name: String): String? = try {
|
||||
Class.forName("android.os.SystemProperties")
|
||||
.getMethod("get", String::class.java)
|
||||
.invoke(null, name) as? String
|
||||
} catch (_: Exception) {
|
||||
null
|
||||
}
|
||||
|
||||
fun hasDeveloperToggle(sdk: Int = Build.VERSION.SDK_INT): Boolean = sdk >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE
|
||||
|
||||
fun blocksSteam(status: PhantomProcessStatus): Boolean =
|
||||
status != PhantomProcessStatus.NOT_APPLICABLE && status != PhantomProcessStatus.DISABLED
|
||||
|
||||
fun title(context: Context, status: PhantomProcessStatus): String = context.getString(when (status) {
|
||||
PhantomProcessStatus.ENABLED -> R.string.phantom_title_on
|
||||
PhantomProcessStatus.UNSET -> R.string.phantom_title_unset
|
||||
PhantomProcessStatus.UNREADABLE -> R.string.phantom_title_unreadable
|
||||
PhantomProcessStatus.DISABLED -> R.string.phantom_title_off
|
||||
PhantomProcessStatus.NOT_APPLICABLE -> R.string.phantom_title_not_required
|
||||
})
|
||||
|
||||
fun instructions(context: Context, status: PhantomProcessStatus): String = when (status) {
|
||||
PhantomProcessStatus.ENABLED, PhantomProcessStatus.UNSET, PhantomProcessStatus.UNREADABLE ->
|
||||
context.getString(R.string.phantom_instructions_fix, fixSentence(context))
|
||||
PhantomProcessStatus.DISABLED -> context.getString(R.string.phantom_instructions_off)
|
||||
PhantomProcessStatus.NOT_APPLICABLE -> context.getString(R.string.phantom_instructions_not_applicable)
|
||||
}
|
||||
|
||||
fun gateInstructions(context: Context, status: PhantomProcessStatus): String = when (status) {
|
||||
PhantomProcessStatus.ENABLED, PhantomProcessStatus.UNSET, PhantomProcessStatus.UNREADABLE -> fixSentence(context)
|
||||
else -> instructions(context, status)
|
||||
}
|
||||
|
||||
fun fixSentence(context: Context, sdk: Int = Build.VERSION.SDK_INT): String =
|
||||
context.getString(if (hasDeveloperToggle(sdk)) R.string.phantom_fix_toggle else R.string.phantom_fix_no_toggle)
|
||||
|
||||
fun reportValue(status: PhantomProcessStatus): String = when (status) {
|
||||
PhantomProcessStatus.DISABLED -> "disabled (good - the OS will not kill the session's children)"
|
||||
PhantomProcessStatus.ENABLED -> "ENABLED (the OS may kill the session with no log; turn off Restrict child processes)"
|
||||
PhantomProcessStatus.UNSET -> "not set (ROM default applies; DroidDeck requires an explicit disabled value)"
|
||||
PhantomProcessStatus.UNREADABLE -> "unreadable (DroidDeck could not verify the setting)"
|
||||
PhantomProcessStatus.NOT_APPLICABLE -> "not applicable before Android 12"
|
||||
}
|
||||
}
|
||||
@@ -28,18 +28,17 @@ object SessionLogCapture {
|
||||
out.flush()
|
||||
writer = out
|
||||
this.target = target
|
||||
pid = HostProcess.startUncounted(
|
||||
pid = HostProcess.start(
|
||||
command(Process.myPid(), sinceMillis),
|
||||
null, target.parentFile, null,
|
||||
onLine = { line ->
|
||||
synchronized(this) {
|
||||
try {
|
||||
writer?.apply { write(line); newLine(); flush() }
|
||||
} catch (e: Exception) {
|
||||
}
|
||||
) { line ->
|
||||
synchronized(this) {
|
||||
try {
|
||||
writer?.apply { write(line); newLine(); flush() }
|
||||
} catch (e: Exception) {
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
if (pid == -1) {
|
||||
out.write("logcat could not be started; this ROM may not hand an app its own entries.\n")
|
||||
out.flush()
|
||||
|
||||
@@ -161,13 +161,7 @@ object WirelessAdbFix {
|
||||
}
|
||||
}.getOrDefault(address is Inet4Address)
|
||||
|
||||
fun verifyLocalPairing(context: Context) {
|
||||
val port = localConnectPort(context) ?: error(context.getString(R.string.adbpair_command_failed))
|
||||
check(acceptsKey(context, LOOPBACK, port)) { context.getString(R.string.adbpair_command_failed) }
|
||||
saveConnection(context, LOOPBACK, port)
|
||||
}
|
||||
|
||||
private fun localConnectPort(context: Context): Int? =
|
||||
fun localConnectPort(context: Context): Int? =
|
||||
tlsPortProperty()
|
||||
?: findConnectPort(context, LOOPBACK)
|
||||
|
||||
@@ -248,6 +242,26 @@ object WirelessAdbFix {
|
||||
return resolvedPort.get().takeIf { it in 1..65535 }
|
||||
}
|
||||
|
||||
fun setChildProcessLimit(context: Context, host: String, port: Int, enabled: Boolean) {
|
||||
loadOrCreateIdentity(context.applicationContext)
|
||||
Kadb.create(host, port).use { adb ->
|
||||
PhantomProcessLimit.shellCommands(enabled).forEach { command ->
|
||||
val change = adb.shell(command)
|
||||
check(change.exitCode == 0) { change.allOutput.ifBlank { context.getString(R.string.adbfix_command_failed, change.exitCode) } }
|
||||
}
|
||||
val result = adb.shell(PhantomProcessLimit.verifyCommand())
|
||||
check(result.exitCode == 0 && PhantomProcessLimit.verified(result.output, enabled)) {
|
||||
context.getString(R.string.adbfix_not_confirmed, result.allOutput.trim())
|
||||
}
|
||||
}
|
||||
if (PhantomProcessLimit.usesDeviceConfig()) PhantomProcessLimit.rememberAndroid12(context, !enabled)
|
||||
saveConnection(context, host, port)
|
||||
}
|
||||
|
||||
fun setUsingSavedPairing(context: Context, enabled: Boolean) {
|
||||
withSavedPairing(context) { appContext, host, port -> setChildProcessLimit(appContext, host, port, enabled) }
|
||||
}
|
||||
|
||||
fun hasSavedPairing(context: Context): Boolean = savedConnection(context.applicationContext) != null
|
||||
|
||||
fun savedPairingIsLocal(context: Context): Boolean = savedConnection(context.applicationContext)?.host
|
||||
|
||||
@@ -38,6 +38,7 @@ class WirelessAdbPairingService : Service() {
|
||||
private var pairingHost: String? = null
|
||||
private var pairingPort: Int? = null
|
||||
@Volatile private var working = false
|
||||
@Volatile private var limitEnabled = false
|
||||
@Volatile private var session = 0
|
||||
private val timeout = Runnable { finish(Stage.Failed(getString(R.string.adbpair_timed_out))) }
|
||||
|
||||
@@ -51,14 +52,15 @@ class WirelessAdbPairingService : Service() {
|
||||
onCode(code)
|
||||
}
|
||||
ACTION_CANCEL -> finish(Stage.Idle)
|
||||
else -> begin()
|
||||
else -> begin(intent?.getBooleanExtra(EXTRA_ENABLE_LIMIT, false) == true)
|
||||
}
|
||||
return START_NOT_STICKY
|
||||
}
|
||||
|
||||
private fun begin() {
|
||||
private fun begin(enableLimit: Boolean) {
|
||||
if (working) return
|
||||
session++
|
||||
limitEnabled = enableLimit
|
||||
pairingHost = null
|
||||
pairingPort = null
|
||||
working = false
|
||||
@@ -121,6 +123,7 @@ class WirelessAdbPairingService : Service() {
|
||||
}
|
||||
working = true
|
||||
val owner = session
|
||||
val enable = limitEnabled
|
||||
show(Stage.Working(getString(R.string.adbpair_pairing)))
|
||||
Thread({
|
||||
val paired = runCatching { kotlinx.coroutines.runBlocking { WirelessAdbFix.pair(this@WirelessAdbPairingService, WirelessAdbFix.LOOPBACK, port, code) } }
|
||||
@@ -138,7 +141,12 @@ class WirelessAdbPairingService : Service() {
|
||||
stopDiscovery()
|
||||
show(Stage.Working(getString(R.string.adbpair_connecting)))
|
||||
}
|
||||
val result = runCatching { WirelessAdbFix.verifyLocalPairing(this) }
|
||||
val result = runCatching {
|
||||
val connectPort = WirelessAdbFix.localConnectPort(this)
|
||||
?: error(getString(R.string.adbpair_port_not_found))
|
||||
main.post { if (owner == session) show(Stage.Working(getString(R.string.adbpair_applying))) }
|
||||
WirelessAdbFix.setChildProcessLimit(this, WirelessAdbFix.LOOPBACK, connectPort, enable)
|
||||
}
|
||||
main.post {
|
||||
working = false
|
||||
if (owner != session) return@post
|
||||
@@ -227,15 +235,15 @@ class WirelessAdbPairingService : Service() {
|
||||
.addAction(Notification.Action.Builder(null, getString(R.string.common_cancel), cancel).build())
|
||||
}
|
||||
is Stage.Working -> builder
|
||||
.setContentTitle(getString(R.string.adbpair_title_pair))
|
||||
.setContentTitle(getString(R.string.adbpair_title_working))
|
||||
.setContentText(stage.step)
|
||||
.setProgress(0, 0, true)
|
||||
.setOngoing(true)
|
||||
.setOnlyAlertOnce(true)
|
||||
Stage.Done -> builder
|
||||
.setContentTitle(getString(R.string.adbpair_paired))
|
||||
.setContentText(getString(R.string.adbpair_return_to_app))
|
||||
.setStyle(Notification.BigTextStyle().bigText(getString(R.string.adbpair_return_to_app)))
|
||||
.setContentTitle(getString(R.string.adbpair_title_done))
|
||||
.setContentText(getString(R.string.adbpair_done_text))
|
||||
.setStyle(Notification.BigTextStyle().bigText(getString(R.string.adbpair_done_text)))
|
||||
.setAutoCancel(true)
|
||||
is Stage.Failed -> builder
|
||||
.setContentTitle(getString(R.string.adbpair_title_failed))
|
||||
@@ -254,6 +262,7 @@ class WirelessAdbPairingService : Service() {
|
||||
private const val ACTION_CODE = "com.droiddeck.launcher.action.WIRELESS_ADB_CODE"
|
||||
private const val ACTION_CANCEL = "com.droiddeck.launcher.action.WIRELESS_ADB_CANCEL"
|
||||
private const val KEY_CODE = "code"
|
||||
private const val EXTRA_ENABLE_LIMIT = "enable_limit"
|
||||
private const val TIMEOUT_MS = 5 * 60_000L
|
||||
|
||||
private val current = MutableStateFlow<Stage>(Stage.Idle)
|
||||
@@ -261,10 +270,10 @@ class WirelessAdbPairingService : Service() {
|
||||
|
||||
private fun publish(stage: Stage) { current.value = stage }
|
||||
|
||||
fun start(context: Context) {
|
||||
fun start(context: Context, enableLimit: Boolean = false) {
|
||||
context.getSystemService(NotificationManager::class.java)?.cancel(NOTIFICATION_ID)
|
||||
publish(Stage.Waiting)
|
||||
val intent = Intent(context, WirelessAdbPairingService::class.java)
|
||||
val intent = Intent(context, WirelessAdbPairingService::class.java).putExtra(EXTRA_ENABLE_LIMIT, enableLimit)
|
||||
if (Build.VERSION.SDK_INT >= 26) context.startForegroundService(intent) else context.startService(intent)
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.droiddeck.launcher.runtime
|
||||
import android.content.Context
|
||||
import android.graphics.BitmapFactory
|
||||
import android.os.StatFs
|
||||
import android.system.Os
|
||||
import android.util.Log
|
||||
import androidx.annotation.StringRes
|
||||
import com.droiddeck.launcher.R
|
||||
@@ -115,6 +116,7 @@ object AppImageManager {
|
||||
|
||||
private fun extract(context: Context, dir: File, file: File, onProgress: (String) -> Unit): String? {
|
||||
val image = File(dir, "image.AppImage")
|
||||
val links = File(dir, ".links").apply { mkdirs() }
|
||||
try {
|
||||
dir.mkdirs()
|
||||
onProgress(context.getString(R.string.user_apps_copying, file.name))
|
||||
@@ -129,15 +131,30 @@ object AppImageManager {
|
||||
"cd \"$1\" && rm -rf squashfs-root AppDir && { $unpack; } >/dev/null && " +
|
||||
"rm -rf app && mv \"$(readlink -f squashfs-root)\" app && rm -f squashfs-root",
|
||||
"extract", "$GUEST_DIR/${dir.name}",
|
||||
), logName = "appimage-import") { line -> if (out.length < 2000) out.appendLine(line) }
|
||||
), logName = "appimage-import", linkDir = links) { line -> if (out.length < 2000) out.appendLine(line) }
|
||||
if (status != 0 || !File(dir, "app").isDirectory) {
|
||||
listOf("squashfs-root", "AppDir").forEach { FileUtils.delete(File(dir, it)) }
|
||||
return out.lines().lastOrNull { it.isNotBlank() }?.let { context.getString(R.string.appimg_extract_failed_detail, it) }
|
||||
?: context.getString(R.string.appimg_extract_failed)
|
||||
}
|
||||
copyLinkedFiles(File(dir, "app"), links)
|
||||
return null
|
||||
} finally {
|
||||
image.delete()
|
||||
FileUtils.delete(links)
|
||||
}
|
||||
}
|
||||
|
||||
private fun copyLinkedFiles(app: File, links: File) {
|
||||
val roots = setOf(links.path + "/", links.canonicalPath + "/")
|
||||
app.walkTopDown().onEnter { !Files.isLink(it) }.forEach { f ->
|
||||
if (!Files.isLink(f)) return@forEach
|
||||
val target = runCatching { Os.readlink(f.path) }.getOrNull() ?: return@forEach
|
||||
if (roots.none { target.startsWith(it) }) return@forEach
|
||||
val data = f.toPath().toRealPath()
|
||||
java.nio.file.Files.delete(f.toPath())
|
||||
java.nio.file.Files.copy(data, f.toPath())
|
||||
if (java.nio.file.Files.isExecutable(data)) f.setExecutable(true, false)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -325,7 +325,7 @@ object BwrapSpawner {
|
||||
private const val PRELOAD_DIR = "/run/droiddeck-preload"
|
||||
private const val NET_LINK = "etc/droiddeck-net"
|
||||
|
||||
private const val ZYPAK_SHIM = "#!/bin/sh\nprogram=\$1\nshift\nexec \"\$program\" --no-sandbox \"\$@\"\n"
|
||||
private const val ZYPAK_SHIM = "#!/bin/sh\nprogram=\$1\nshift\nif [ -n \"\${ELECTRON_RUN_AS_NODE:-}\" ]; then\n exec \"\$program\" \"\$@\"\nfi\nexec \"\$program\" --no-sandbox \"\$@\"\n"
|
||||
|
||||
private fun zypakShims(binds: List<Bind>, root: File, dir: File): List<Bind> {
|
||||
val wrappers = listOf("/app/bin/zypak-wrapper.sh", "/app/bin/zypak-wrapper").filter { guest ->
|
||||
@@ -397,7 +397,7 @@ object BwrapSpawner {
|
||||
|
||||
/**
|
||||
* 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).
|
||||
* 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<List<String>, Map<String, String>>? {
|
||||
val rootfs = LinuxRuntime.rootDir(context)
|
||||
@@ -415,15 +415,15 @@ object BwrapSpawner {
|
||||
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)")
|
||||
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
|
||||
// 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", it) }
|
||||
.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()}")
|
||||
}
|
||||
@@ -496,7 +496,7 @@ object BwrapSpawner {
|
||||
* 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. The mount normally hides
|
||||
* 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 {
|
||||
@@ -524,7 +524,7 @@ object BwrapSpawner {
|
||||
}
|
||||
}
|
||||
} catch (e: java.io.IOException) {
|
||||
Log.e(TAG, "native userland: could not make a place for ${bind.guest}", e)
|
||||
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()
|
||||
@@ -558,12 +558,38 @@ object BwrapSpawner {
|
||||
return f
|
||||
}
|
||||
|
||||
internal fun prootEnvironment(plan: Plan, startsThroughEnvTool: Boolean): Map<String, String> =
|
||||
if (startsThroughEnvTool) emptyMap() else plan.env - "LD_PRELOAD"
|
||||
|
||||
private fun run(context: Context, plan: Plan, client: LocalSocket, out: DataOutputStream, id: Int) {
|
||||
val (command, environment) = nativeLaunch(context, plan)
|
||||
?: throw IOException("The sandbox does not have a compatible native runtime")
|
||||
val builder = ProcessBuilder(command).redirectErrorStream(true)
|
||||
.directory(File(hostPath(plan.binds, plan.root.path, plan.cwd)).takeIf { it.isDirectory } ?: plan.root)
|
||||
.also { b -> b.environment().apply { clear(); putAll(environment) } }
|
||||
val verbose = plan.env["DROIDDECK_PROOT_VERBOSE"]?.toIntOrNull()
|
||||
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("-v"); cmd.add(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()
|
||||
putAll(prootEnvironment(plan, envTool))
|
||||
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)
|
||||
com.droiddeck.launcher.session.OrphanReaper.keep(pid)
|
||||
@@ -591,8 +617,8 @@ object BwrapSpawner {
|
||||
while (true) {
|
||||
val n = try { stream.read(buffer) } catch (e: IOException) { -1 }
|
||||
if (n < 0) break
|
||||
if (logged < 4096) {
|
||||
String(buffer, 0, minOf(n, 4096 - logged)).lines().filter { it.isNotBlank() }
|
||||
if (logged < 4096 || verbose != null) {
|
||||
String(buffer, 0, if (verbose != null) n else minOf(n, 4096 - logged)).lines().filter { it.isNotBlank() }
|
||||
.forEach { Log.i(TAG, "sandbox $id: $it") }
|
||||
logged += n
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ object CurseForgeApp {
|
||||
}
|
||||
|
||||
internal var guest: (Context, List<String>, AtomicBoolean?, (String) -> Unit) -> Int = { context, argv, cancelled, onLine ->
|
||||
GuestCommand.run(context, argv, logName = "curseforge", extraBinds = BattleNetInstall.binds(context),
|
||||
GuestCommand.run(context, argv, logName = "curseforge", extraBinds = BattleNetInstall.binds(context), fastPath = true,
|
||||
cancelled = cancelled, redact = INSPECTOR, onLine = onLine)
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,8 @@ import java.nio.ByteOrder
|
||||
* 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).
|
||||
* `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()
|
||||
@@ -37,11 +38,6 @@ object ElfSeccompPatch {
|
||||
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) {
|
||||
if (patchTermiosRequest(buffer, pos, end)) {
|
||||
patched++
|
||||
pos += 4
|
||||
continue
|
||||
}
|
||||
val replacement = when (buffer.getInt(pos)) {
|
||||
MOV_X8_SET_ROBUST_LIST -> NOP
|
||||
MOV_X8_CLONE3, MOV_X8_RSEQ -> MOV_X0_ENOSYS
|
||||
@@ -69,40 +65,6 @@ object ElfSeccompPatch {
|
||||
return patched
|
||||
}
|
||||
|
||||
/**
|
||||
* glibc 2.42 and later read and set a terminal with TCGETS2 and TCSETS2/W2/F2, which Android's
|
||||
* SELinux policy refuses on an app's pseudo-terminal slaves (EACCES): isatty() was false in every
|
||||
* Konsole, ssh and tmux session, so bash had no prompt or job control and stdout was not line
|
||||
* buffered. TCGETS and TCSETS* carry the same struct without its two speed fields, which glibc
|
||||
* then takes from c_cflag. A site is `movz xN, #lo` then `movk xN, #hi, lsl #16`; the movz gets
|
||||
* the old request and the movk becomes a no-op.
|
||||
*/
|
||||
private fun patchTermiosRequest(buffer: ByteBuffer, pos: Int, end: Int): Boolean {
|
||||
val movz = buffer.getInt(pos)
|
||||
if ((movz and 0x7fe00000) != 0x52800000) return false
|
||||
val low = (movz ushr 5) and 0xffff
|
||||
if (low !in 0x542a..0x542d) return false
|
||||
val register = movz and 0x1f
|
||||
var next = pos + 4
|
||||
while (next < minOf(end, pos + 4 + 4 * 4)) {
|
||||
val movk = buffer.getInt(next)
|
||||
if ((movk and 0x7fe00000) == 0x72a00000 && (movk and 0x1f) == register) {
|
||||
val request = when ((movk ushr 5) and 0xffff) {
|
||||
0x802c -> if (low == 0x542a) 0x5401 else return false
|
||||
0x402c -> if (low != 0x542a) 0x5402 + (low - 0x542b) else return false
|
||||
else -> return false
|
||||
}
|
||||
buffer.putInt(pos, (movz and 0x1f.inv() and (0xffff shl 5).inv()) or (request shl 5) or register)
|
||||
buffer.putInt(next, NOP)
|
||||
return true
|
||||
}
|
||||
// Anything between that might read or write the register would see the old low half
|
||||
if (intArrayOf(0, 5, 10, 16).any { (movk ushr it) and 0x1f == register }) return false
|
||||
next += 4
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
/** Patches the file behind [path] (symlinks followed) if it still has unpatched call sites. */
|
||||
fun patchFile(path: File): Int {
|
||||
val target = path.canonicalFile
|
||||
|
||||
@@ -79,9 +79,9 @@ object FlatpakManager {
|
||||
?.maxByOrNull { it.first }?.second
|
||||
}
|
||||
|
||||
private fun runGuest(context: Context, argv: List<String>, onLine: (String) -> Unit): Int {
|
||||
private fun runGuest(context: Context, argv: List<String>, fakeRoot: Boolean, onLine: (String) -> Unit): Int {
|
||||
val name = "flatpak-" + (argv.getOrNull(2)?.takeIf { argv.getOrNull(1) == HELPER } ?: "setup")
|
||||
return GuestCommand.run(context, argv, name, onLine = onLine)
|
||||
return GuestCommand.run(context, argv, fakeRoot, name, onLine = onLine)
|
||||
}
|
||||
|
||||
private inline fun <T> exclusive(what: String, ifBusy: () -> T, block: () -> T): T {
|
||||
@@ -96,7 +96,7 @@ object FlatpakManager {
|
||||
if (!LinuxRuntime.isInstalled(context)) return context.getString(R.string.user_apps_runtime_required)
|
||||
return exclusive("setup", { context.getString(R.string.flatpakmgr_busy) }) {
|
||||
var failure: String? = null
|
||||
val status = runGuest(context, listOf("/bin/bash", SETUP)) { line ->
|
||||
val status = runGuest(context, listOf("/bin/bash", SETUP), fakeRoot = true) { line ->
|
||||
Log.i(TAG, "setup: $line")
|
||||
when {
|
||||
line.startsWith("== STEP ") -> onProgress(line.removePrefix("== STEP "), -1)
|
||||
@@ -120,7 +120,7 @@ object FlatpakManager {
|
||||
var error: String? = null
|
||||
var step = context.getString(R.string.flatpakmgr_starting)
|
||||
val argv = listOfNotNull("/usr/bin/python3", HELPER, verb, id)
|
||||
val status = runGuest(context, argv) { line ->
|
||||
val status = runGuest(context, argv, fakeRoot = false) { line ->
|
||||
val o = runCatching { JSONObject(line) }.getOrNull()
|
||||
if (o == null) { Log.i(TAG, "$verb: $line"); return@runGuest }
|
||||
when (o.optString("e")) {
|
||||
@@ -195,7 +195,7 @@ object FlatpakManager {
|
||||
if (!ready(context)) return emptySet()
|
||||
var apps: Set<String>? = null
|
||||
exclusive("updates", {}) {
|
||||
runGuest(context, listOf("/usr/bin/python3", HELPER, "updates")) { line ->
|
||||
runGuest(context, listOf("/usr/bin/python3", HELPER, "updates"), fakeRoot = false) { line ->
|
||||
val o = runCatching { JSONObject(line) }.getOrNull() ?: return@runGuest
|
||||
if (o.optString("e") == "updates") {
|
||||
val a = o.optJSONArray("apps")
|
||||
|
||||
@@ -6,12 +6,13 @@ import com.droiddeck.launcher.core.HostProcess
|
||||
import com.droiddeck.launcher.session.OrphanReaper
|
||||
import com.droiddeck.launcher.session.SessionFiles
|
||||
import com.droiddeck.launcher.session.SessionPaths
|
||||
import com.droiddeck.launcher.session.SessionPrefs
|
||||
import java.io.File
|
||||
import java.util.concurrent.atomic.AtomicBoolean
|
||||
|
||||
object GuestCommand {
|
||||
fun run(context: Context, argv: List<String>, logName: String? = null,
|
||||
extraBinds: List<String>? = null, cancelled: AtomicBoolean? = null,
|
||||
fun run(context: Context, argv: List<String>, fakeRoot: Boolean = false, logName: String? = null,
|
||||
linkDir: File? = null, extraBinds: List<String>? = null, fastPath: Boolean = false, cancelled: AtomicBoolean? = null,
|
||||
redact: Regex? = null, onLine: (String) -> Unit): Int {
|
||||
val log = logName?.let {
|
||||
try {
|
||||
@@ -20,7 +21,7 @@ object GuestCommand {
|
||||
}
|
||||
log?.println("== ${java.util.Date()} ${redacted(argv.joinToString(" "), redact)}")
|
||||
try {
|
||||
return runLogged(context, argv, extraBinds, cancelled) { line -> log?.println(redacted(line, redact)); log?.flush(); onLine(line) }
|
||||
return runLogged(context, argv, fakeRoot, linkDir, extraBinds, fastPath, cancelled) { line -> log?.println(redacted(line, redact)); log?.flush(); onLine(line) }
|
||||
} finally {
|
||||
log?.close()
|
||||
}
|
||||
@@ -28,14 +29,16 @@ object GuestCommand {
|
||||
|
||||
internal fun redacted(text: String, redact: Regex?): String = redact?.replace(text, "<redacted>") ?: text
|
||||
|
||||
private fun runLogged(context: Context, argv: List<String>, extraBinds: List<String>?,
|
||||
cancelled: AtomicBoolean?, onLine: (String) -> Unit): Int {
|
||||
private fun runLogged(context: Context, argv: List<String>, fakeRoot: Boolean, linkDir: File?, extraBinds: List<String>?,
|
||||
fastPath: Boolean, cancelled: AtomicBoolean?, onLine: (String) -> Unit): Int {
|
||||
val root = LinuxRuntime.rootDir(context)
|
||||
LinuxRuntime.writeAccounts(context)
|
||||
SessionFiles.stage(context, root)
|
||||
LinuxNetworkLinkComponent(context, root).publish()
|
||||
val runtimeDir = File(context.filesDir, ".flatpak-rt").apply { mkdirs() }
|
||||
val binds = LinuxRuntime.binds(context, null, runtimeDir, LinuxRuntime.sharedStorage(context), extraBinds)
|
||||
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}",
|
||||
@@ -50,8 +53,26 @@ object GuestCommand {
|
||||
"no_proxy=localhost,127.0.0.1,::1", "NO_PROXY=localhost,127.0.0.1,::1",
|
||||
)
|
||||
}
|
||||
fastPathKey?.let { guest += ProotFastPath.guestEnv(root, binds, it) }
|
||||
guest += argv
|
||||
val builder = NativeGuest.processBuilder(context, root, binds, guest).redirectErrorStream(true)
|
||||
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("--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()
|
||||
val pid = HostProcess.pidOf(process)
|
||||
|
||||
@@ -1,886 +0,0 @@
|
||||
package com.droiddeck.launcher.runtime
|
||||
|
||||
import android.app.ActivityManager
|
||||
import android.app.Service
|
||||
import android.content.ComponentName
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.ServiceConnection
|
||||
import android.net.LocalServerSocket
|
||||
import android.net.LocalSocket
|
||||
import android.os.Binder
|
||||
import android.os.Handler
|
||||
import android.os.IBinder
|
||||
import android.os.Looper
|
||||
import android.os.Parcel
|
||||
import android.os.ParcelFileDescriptor
|
||||
import android.os.Process
|
||||
import android.system.ErrnoException
|
||||
import android.system.Os
|
||||
import android.system.OsConstants
|
||||
import android.system.StructPollfd
|
||||
import android.util.Log
|
||||
import org.json.JSONObject
|
||||
import java.io.DataInputStream
|
||||
import java.io.File
|
||||
import java.util.concurrent.CountDownLatch
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
/**
|
||||
* A guest program run as the main process of its own Android process.
|
||||
*
|
||||
* Android counts the processes in an app process's cgroup against its child-process limit, but not
|
||||
* the app processes themselves. The worker execs the program in place; its binder fd stays open
|
||||
* across the exec, so the system keeps the process as a live service process. The program's own
|
||||
* children are still counted. See docs/phantom-processes.md.
|
||||
*/
|
||||
open class GuestWorker : Service() {
|
||||
private val binder = object : Binder() {
|
||||
override fun onTransact(code: Int, data: Parcel, reply: Parcel?, flags: Int): Boolean {
|
||||
if (code != RUN) return super.onTransact(code, data, reply, flags)
|
||||
val argv = data.createStringArray() ?: return false
|
||||
val env = data.createStringArray() ?: return false
|
||||
val fds = List(data.readInt()) { data.readFileDescriptor() }
|
||||
val targets = data.createIntArray() ?: IntArray(fds.size) { it }
|
||||
val fillBinderFd = data.readInt() != 0
|
||||
val go = data.readFileDescriptor()
|
||||
val nice = data.readInt()
|
||||
reply?.writeInt(Process.myPid())
|
||||
Handler(Looper.getMainLooper()).post {
|
||||
// The app writes a byte once it has the reply and has taken the launch on: an exec
|
||||
// before then would end this process with the reply undelivered, and with none (the
|
||||
// app gave up and starts the program another way) the program must not run here.
|
||||
var why = ""
|
||||
// poll() with a timeout counts as network I/O to StrictMode on the main thread
|
||||
android.os.StrictMode.setThreadPolicy(android.os.StrictMode.ThreadPolicy.LAX)
|
||||
val committed = runCatching {
|
||||
fun byte(timeout: Int): Int {
|
||||
val poll = StructPollfd().apply { fd = go.fileDescriptor; events = OsConstants.POLLIN.toShort() }
|
||||
val ready = Os.poll(arrayOf(poll), timeout)
|
||||
return (if (ready > 0) Os.read(go.fileDescriptor, ByteArray(1), 0, 1) else -1)
|
||||
.also { why = "poll $ready revents ${poll.revents} read $it" }
|
||||
}
|
||||
// The commit, an answer, and the app's word that it has the answer: the app may
|
||||
// have stopped waiting for it (and started the program another way) meanwhile.
|
||||
// That last word comes, or the app closes its end (a byte or EOF): no timeout,
|
||||
// which could drop a launch the app has already reported as started.
|
||||
byte(GO_TIMEOUT_MS) == 1 && Os.write(go.fileDescriptor, byteArrayOf(1), 0, 1) == 1 && byte(-1) == 1
|
||||
}.getOrElse { why = it.toString(); false }
|
||||
go.close()
|
||||
if (committed) exec(argv, env, fds, targets, fillBinderFd, nice)
|
||||
else {
|
||||
Log.w(TAG, "launch not committed ($why): not running ${argv.firstOrNull()}")
|
||||
Process.killProcess(Process.myPid())
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
override fun onBind(intent: Intent): IBinder = binder
|
||||
|
||||
private fun exec(argv: Array<String>, env: Array<String>, fds: List<ParcelFileDescriptor?>, targets: IntArray, fillBinderFd: Boolean,
|
||||
nice: Int) {
|
||||
try {
|
||||
val top = targets.maxOrNull() ?: 2
|
||||
val (binderTop, binderFd) = keepBinderOpen(maxOf(BINDER_FDS, top + 1))
|
||||
// Out of the way first, so that placing one fd cannot overwrite another not yet placed.
|
||||
val above = maxOf(MOVED_FDS, top + 1, binderTop + 1)
|
||||
val moved = fds.map { pfd -> pfd?.let { Os.fcntlInt(it.fileDescriptor, OsConstants.F_DUPFD, above) } }
|
||||
moved.forEachIndexed { i, fd ->
|
||||
if (fd == null || i >= targets.size) return@forEachIndexed
|
||||
val source = ParcelFileDescriptor.adoptFd(fd).also { kept.add(it) }.fileDescriptor
|
||||
Os.dup2(source, targets[i])
|
||||
Os.fcntlInt(source, OsConstants.F_SETFD, OsConstants.FD_CLOEXEC)
|
||||
}
|
||||
// A session of its own: in zygote's process group, a program signalling its group
|
||||
// (kill(0, sig)) would reach every process of the app.
|
||||
runCatching { Os.setsid() }
|
||||
// The native hook closes the binder fds in every other process (hook/handoff.c). Only an
|
||||
// app launch asks for the number (a whole argument or variable value), never a guest's.
|
||||
val fill = { arg: String ->
|
||||
if (!fillBinderFd) arg
|
||||
else if (arg == BINDER_FD_TOKEN) binderFd.toString()
|
||||
else if (arg.endsWith("=$BINDER_FD_TOKEN")) arg.removeSuffix(BINDER_FD_TOKEN) + binderFd
|
||||
else arg
|
||||
}
|
||||
// This thread blocks SIGQUIT, SIGUSR1 and SIGPIPE (Android's runtime), and an exec keeps
|
||||
// that: the program's hook sets DDH_SIGMASK instead (none blocked, unless the request says).
|
||||
val mask = if (env.any { it.startsWith("DDH_SIGMASK=") }) emptyList() else listOf("DDH_SIGMASK=0")
|
||||
// Android raised this thread to THREAD_PRIORITY_TOP_APP_BOOST (a service the top app binds with
|
||||
// BIND_IMPORTANT is scheduled as the top app); the program and its threads would keep it and
|
||||
// run ahead of the game. They get the asker's priority instead, as a forked child would.
|
||||
runCatching { Process.setThreadPriority(nice) }
|
||||
Os.execve(argv[0], argv.map(fill).toTypedArray(),
|
||||
env.filterNot { it.startsWith("DDH_WORKER_PID=") }.map(fill).toTypedArray() + mask +
|
||||
"DDH_WORKER_PID=${Process.myPid()}")
|
||||
} catch (e: ErrnoException) {
|
||||
Log.e(TAG, "could not exec ${argv.firstOrNull()}", e)
|
||||
}
|
||||
Process.killProcess(Process.myPid())
|
||||
}
|
||||
|
||||
/**
|
||||
* Binder fds stay open across the exec, at [from] or above, where no fd of the program goes.
|
||||
* Returns the highest fd used and the one on /dev/binder, whose closing Android takes for
|
||||
* the death of this process.
|
||||
*/
|
||||
private fun keepBinderOpen(from: Int): Pair<Int, Int> {
|
||||
var highest = from - 1
|
||||
var binder = -1
|
||||
File("/proc/self/fd").listFiles()?.forEach { link ->
|
||||
val target = runCatching { Os.readlink(link.path) }.getOrNull() ?: return@forEach
|
||||
if (target !in BINDER_DEVICES && !target.startsWith("/dev/binderfs/")) return@forEach
|
||||
// A copy, not adoptFd(): some of these fds are owned (fdsan) by a ParcelFileDescriptor.
|
||||
val copy = runCatching { ParcelFileDescriptor.fromFd(link.name.toIntOrNull() ?: return@forEach) }.getOrNull()
|
||||
?: return@forEach
|
||||
val kept = Os.fcntlInt(copy.fileDescriptor, OsConstants.F_DUPFD, from)
|
||||
highest = maxOf(highest, kept)
|
||||
if (target.substringAfterLast('/') == "binder") binder = kept
|
||||
copy.close()
|
||||
}
|
||||
return highest to binder
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val RUN = IBinder.FIRST_CALL_TRANSACTION
|
||||
/** An argument, or a variable's whole value, in an app launch: replaced by the number of its kept binder fd. */
|
||||
const val BINDER_FD_TOKEN = "@DDH_WORKER_BINDER_FD@"
|
||||
// Longer than the app may wait for the hook's "go" (GuestWorkers.ACK_TIMEOUT_MS) before it commits
|
||||
private const val GO_TIMEOUT_MS = 15000
|
||||
private val BINDER_DEVICES = setOf("/dev/binder", "/dev/hwbinder", "/dev/vndbinder")
|
||||
private const val BINDER_FDS = 900
|
||||
private const val MOVED_FDS = 1200
|
||||
private const val TAG = "GuestWorker"
|
||||
private val kept = ArrayList<ParcelFileDescriptor>()
|
||||
|
||||
fun isWorkerProcess(context: Context, process: String?): Boolean =
|
||||
process != null && process.startsWith(context.packageName + ":g") &&
|
||||
process.substring(context.packageName.length + 2).all { it.isDigit() }
|
||||
}
|
||||
}
|
||||
|
||||
class GuestWorker0 : GuestWorker()
|
||||
class GuestWorker1 : GuestWorker()
|
||||
class GuestWorker2 : GuestWorker()
|
||||
class GuestWorker3 : GuestWorker()
|
||||
class GuestWorker4 : GuestWorker()
|
||||
class GuestWorker5 : GuestWorker()
|
||||
class GuestWorker6 : GuestWorker()
|
||||
class GuestWorker7 : GuestWorker()
|
||||
class GuestWorker8 : GuestWorker()
|
||||
class GuestWorker9 : GuestWorker()
|
||||
class GuestWorker10 : GuestWorker()
|
||||
class GuestWorker11 : GuestWorker()
|
||||
class GuestWorker12 : GuestWorker()
|
||||
class GuestWorker13 : GuestWorker()
|
||||
class GuestWorker14 : GuestWorker()
|
||||
class GuestWorker15 : GuestWorker()
|
||||
class GuestWorker16 : GuestWorker()
|
||||
class GuestWorker17 : GuestWorker()
|
||||
class GuestWorker18 : GuestWorker()
|
||||
class GuestWorker19 : GuestWorker()
|
||||
class GuestWorker20 : GuestWorker()
|
||||
class GuestWorker21 : GuestWorker()
|
||||
class GuestWorker22 : GuestWorker()
|
||||
class GuestWorker23 : GuestWorker()
|
||||
class GuestWorker24 : GuestWorker()
|
||||
class GuestWorker25 : GuestWorker()
|
||||
class GuestWorker26 : GuestWorker()
|
||||
class GuestWorker27 : GuestWorker()
|
||||
class GuestWorker28 : GuestWorker()
|
||||
class GuestWorker29 : GuestWorker()
|
||||
class GuestWorker30 : GuestWorker()
|
||||
class GuestWorker31 : GuestWorker()
|
||||
class GuestWorker32 : GuestWorker()
|
||||
class GuestWorker33 : GuestWorker()
|
||||
class GuestWorker34 : GuestWorker()
|
||||
class GuestWorker35 : GuestWorker()
|
||||
class GuestWorker36 : GuestWorker()
|
||||
class GuestWorker37 : GuestWorker()
|
||||
class GuestWorker38 : GuestWorker()
|
||||
class GuestWorker39 : GuestWorker()
|
||||
class GuestWorker40 : GuestWorker()
|
||||
class GuestWorker41 : GuestWorker()
|
||||
class GuestWorker42 : GuestWorker()
|
||||
class GuestWorker43 : GuestWorker()
|
||||
class GuestWorker44 : GuestWorker()
|
||||
class GuestWorker45 : GuestWorker()
|
||||
class GuestWorker46 : GuestWorker()
|
||||
class GuestWorker47 : GuestWorker()
|
||||
class GuestWorker48 : GuestWorker()
|
||||
class GuestWorker49 : GuestWorker()
|
||||
class GuestWorker50 : GuestWorker()
|
||||
class GuestWorker51 : GuestWorker()
|
||||
class GuestWorker52 : GuestWorker()
|
||||
class GuestWorker53 : GuestWorker()
|
||||
class GuestWorker54 : GuestWorker()
|
||||
class GuestWorker55 : GuestWorker()
|
||||
class GuestWorker56 : GuestWorker()
|
||||
class GuestWorker57 : GuestWorker()
|
||||
class GuestWorker58 : GuestWorker()
|
||||
class GuestWorker59 : GuestWorker()
|
||||
class GuestWorker60 : GuestWorker()
|
||||
class GuestWorker61 : GuestWorker()
|
||||
class GuestWorker62 : GuestWorker()
|
||||
class GuestWorker63 : GuestWorker()
|
||||
|
||||
/** The pool of [GuestWorker] processes, and the socket guests ask it through (`droiddeck-spawn`). */
|
||||
object GuestWorkers {
|
||||
private const val TAG = "GuestWorkers"
|
||||
private val classes: List<Class<out GuestWorker>> = listOf(
|
||||
GuestWorker0::class.java, GuestWorker1::class.java, GuestWorker2::class.java,
|
||||
GuestWorker3::class.java, GuestWorker4::class.java, GuestWorker5::class.java,
|
||||
GuestWorker6::class.java, GuestWorker7::class.java, GuestWorker8::class.java,
|
||||
GuestWorker9::class.java, GuestWorker10::class.java, GuestWorker11::class.java,
|
||||
GuestWorker12::class.java, GuestWorker13::class.java, GuestWorker14::class.java,
|
||||
GuestWorker15::class.java, GuestWorker16::class.java, GuestWorker17::class.java,
|
||||
GuestWorker18::class.java, GuestWorker19::class.java, GuestWorker20::class.java,
|
||||
GuestWorker21::class.java, GuestWorker22::class.java, GuestWorker23::class.java,
|
||||
GuestWorker24::class.java, GuestWorker25::class.java, GuestWorker26::class.java,
|
||||
GuestWorker27::class.java, GuestWorker28::class.java, GuestWorker29::class.java,
|
||||
GuestWorker30::class.java, GuestWorker31::class.java, GuestWorker32::class.java,
|
||||
GuestWorker33::class.java, GuestWorker34::class.java, GuestWorker35::class.java,
|
||||
GuestWorker36::class.java, GuestWorker37::class.java, GuestWorker38::class.java,
|
||||
GuestWorker39::class.java, GuestWorker40::class.java, GuestWorker41::class.java,
|
||||
GuestWorker42::class.java, GuestWorker43::class.java, GuestWorker44::class.java,
|
||||
GuestWorker45::class.java, GuestWorker46::class.java, GuestWorker47::class.java,
|
||||
GuestWorker48::class.java, GuestWorker49::class.java, GuestWorker50::class.java,
|
||||
GuestWorker51::class.java, GuestWorker52::class.java, GuestWorker53::class.java,
|
||||
GuestWorker54::class.java, GuestWorker55::class.java, GuestWorker56::class.java,
|
||||
GuestWorker57::class.java, GuestWorker58::class.java, GuestWorker59::class.java,
|
||||
GuestWorker60::class.java, GuestWorker61::class.java, GuestWorker62::class.java,
|
||||
GuestWorker63::class.java,
|
||||
)
|
||||
|
||||
private class Slot(val index: Int) {
|
||||
lateinit var connection: ServiceConnection
|
||||
val connected = CountDownLatch(1)
|
||||
@Volatile var service: IBinder? = null
|
||||
@Volatile var pid = -1
|
||||
@Volatile var guest = false
|
||||
/** The session it runs a program for ([serve]'s number). */
|
||||
@Volatile var session = 0
|
||||
@Volatile var onExit: ((Int) -> Unit)? = null
|
||||
/** The priority it runs its program at: the asker's (a guest, or the app thread that started it). */
|
||||
@Volatile var nice = 0
|
||||
/** Set once its program was handed over: only then does its end count as the program's. */
|
||||
@Volatile var started = false
|
||||
/** Between the pid and the last word of a launch (under the slots lock): its end is held back. */
|
||||
var launching = false
|
||||
/** It ended while launching: reported once the launch turns out to have run, never otherwise. */
|
||||
var endedLaunching = false
|
||||
}
|
||||
|
||||
private val slots = arrayOfNulls<Slot>(classes.size)
|
||||
// Workers bound ahead of need while a session runs: a zygote fork and the bind take about
|
||||
// 60-100 ms, which every program the session starts would otherwise wait for.
|
||||
private val warm = ArrayDeque<Slot>()
|
||||
@Volatile private var warmTarget = 0
|
||||
// Numbers the sessions: an old session's teardown can still be running when the next one starts.
|
||||
@Volatile private var session = 0
|
||||
// The latest session whose teardown has begun
|
||||
@Volatile private var stopped = 0
|
||||
// Held for a launch's last word and for marking a session stopped
|
||||
private val authorizing = Any()
|
||||
private val warming = java.util.concurrent.atomic.AtomicBoolean(false)
|
||||
private const val WARM_WORKERS = 2
|
||||
// A game's start hands off a burst of programs (Wine's services, the agent's checks) within a few
|
||||
// seconds: bound ahead while the client starts it, not forked while the game draws its first frames.
|
||||
private const val LAUNCH_WORKERS = 16
|
||||
private const val LAUNCH_MS = 20_000L
|
||||
@Volatile private var launchUntil = 0L
|
||||
private val launches = java.util.concurrent.atomic.AtomicInteger()
|
||||
private const val ACK_TIMEOUT_MS = 5000
|
||||
private const val ANSWER_TIMEOUT_MS = 5000
|
||||
private const val RECEIVE_TIMEOUT_MS = 10000
|
||||
// argv and the environment of one exec, with room: Linux caps them at a quarter of the stack
|
||||
private const val MAX_REQUEST_BYTES = 8 shl 20
|
||||
private const val MAX_RECEIVING = 32
|
||||
private val receiving = java.util.concurrent.atomic.AtomicInteger()
|
||||
private val connections = java.util.concurrent.Executors.newSingleThreadExecutor { Thread(it, "guest-worker-binder").apply { isDaemon = true } }
|
||||
@Volatile private var server: Thread? = null
|
||||
// Android sets a worker's main thread to THREAD_PRIORITY_TOP_APP_BOOST again each time the app returns to the top
|
||||
private const val TOP_APP_BOOST = -10
|
||||
private const val PRIORITY_CHECK_MS = 2000L
|
||||
@Volatile private var keeper: Thread? = null
|
||||
|
||||
/** The app, once [attach] or [serve] ran in its main process; null before. */
|
||||
@Volatile var context: Context? = null
|
||||
private set
|
||||
|
||||
/** Whether this Android version and runtime can hand off guest programs to workers. */
|
||||
fun enabled(context: Context): Boolean =
|
||||
android.os.Build.VERSION.SDK_INT >= 30 &&
|
||||
NativeGuest.enabled(context)
|
||||
|
||||
/** How the running session's root was started: in a worker (true) or counted (false); null with none running. */
|
||||
@Volatile var sessionRootUncounted: Boolean? = null
|
||||
|
||||
/** Whether pid is a program running in one of the workers. */
|
||||
fun runsInWorker(pid: Int): Boolean = pid > 0 && synchronized(slots) { slots.any { it != null && it.started && it.pid == pid } }
|
||||
|
||||
fun socketName(context: Context): String = "droiddeck-spawn." + context.packageName + "." + Process.myUid()
|
||||
|
||||
/**
|
||||
* Runs [argv] (a host command line) as the main process of a free worker with [env] and the
|
||||
* fds in [stdio] as its 0, 1 and 2. Returns its pid, or -1. Blocks: not for the main thread.
|
||||
* [onExit] runs once the process is gone.
|
||||
*/
|
||||
fun start(context: Context, argv: List<String>, env: List<String>, stdio: List<ParcelFileDescriptor>, onExit: (Int) -> Unit): Int =
|
||||
start(context, argv, env, stdio, IntArray(stdio.size) { it }, onExit)
|
||||
|
||||
/** As [start], with the fds in [fds] placed at the numbers in [targets]. */
|
||||
fun start(context: Context, argv: List<String>, env: List<String>, fds: List<ParcelFileDescriptor>, targets: IntArray,
|
||||
onExit: (Int) -> Unit): Int = start(context, argv, env, fds, targets, false, onExit)
|
||||
|
||||
/**
|
||||
* [guest]: one of the session's guest programs, which [guestPids] lists and [stopGuests] ends.
|
||||
* [commit] runs with the pid before the worker may run the program; false, and it does not.
|
||||
* [confirmed] runs once the worker has taken it on, just before it is told to run it; false, and it does not.
|
||||
* [owner]: the session asking (the one a guest's request names), else the latest.
|
||||
*/
|
||||
private fun start(context: Context, argv: List<String>, env: List<String>, fds: List<ParcelFileDescriptor>, targets: IntArray,
|
||||
guest: Boolean, onExit: (Int) -> Unit, commit: (Int) -> Boolean = { true },
|
||||
confirmed: () -> Boolean = { true }, owner: Int = session,
|
||||
nice: Int = Process.getThreadPriority(Process.myTid())): Int {
|
||||
val app = context.applicationContext
|
||||
if (guest && owner <= stopped) {
|
||||
Log.w(TAG, (if (owner == 0) "a request naming no session" else "session $owner is stopping") +
|
||||
": not starting ${argv.firstOrNull()}")
|
||||
return -1
|
||||
}
|
||||
val slot = takeWarm() ?: bind(app)?.takeIf { fresh ->
|
||||
fresh.connected.await(10, TimeUnit.SECONDS).also { if (!it) release(app, fresh) }
|
||||
} ?: run {
|
||||
Log.w(TAG, "no worker started for ${argv.firstOrNull()}")
|
||||
return -1
|
||||
}
|
||||
slot.guest = guest
|
||||
slot.session = owner
|
||||
slot.onExit = onExit
|
||||
slot.nice = nice
|
||||
// during a game's start the pool drains instead: its refill would fork while the game starts
|
||||
if (android.os.SystemClock.elapsedRealtime() >= launchUntil) refill(app)
|
||||
// The worker execs once a byte comes through this socket: after the reply has reached us, so
|
||||
// that its exec does not cut the reply off, and after the slot is marked started. Closed
|
||||
// without one, the worker ends without running the program (the caller starts it another way).
|
||||
// It answers with a byte of its own: without that it gave up waiting, and nothing runs.
|
||||
var go: Array<ParcelFileDescriptor>? = null
|
||||
var data: Parcel? = Parcel.obtain()
|
||||
val reply = Parcel.obtain()
|
||||
try {
|
||||
go = ParcelFileDescriptor.createSocketPair()
|
||||
data!!.writeStringArray(argv.toTypedArray())
|
||||
data.writeStringArray(env.toTypedArray())
|
||||
data.writeInt(fds.size)
|
||||
fds.forEach { data.writeFileDescriptor(it.fileDescriptor) }
|
||||
data.writeIntArray(targets)
|
||||
data.writeInt(if (guest) 0 else 1)
|
||||
data.writeFileDescriptor(go[0].fileDescriptor)
|
||||
data.writeInt(nice)
|
||||
slot.service!!.transact(GuestWorker.RUN, data, reply, 0)
|
||||
// The worker has its own copy: with ours closed (and the request's, which holds one too),
|
||||
// a worker that gave up leaves no reader
|
||||
data.recycle()
|
||||
data = null
|
||||
go[0].close()
|
||||
val pid = reply.readInt()
|
||||
// Once a session's teardown has begun (stopGuests), none of its programs may start: it
|
||||
// would not find them.
|
||||
val stopping = { guest && owner <= stopped }
|
||||
if (stopping() || !commit(pid)) {
|
||||
Log.w(TAG, "worker ${slot.index}: ${argv.firstOrNull()} was not taken on")
|
||||
release(app, slot)
|
||||
return -1
|
||||
}
|
||||
// launching, not started yet: an end before the last word is reported only if the launch ran
|
||||
val live = synchronized(slots) {
|
||||
(slots[slot.index] === slot && !stopping()).also { if (it) { slot.pid = pid; slot.launching = true } }
|
||||
}
|
||||
if (!live) {
|
||||
Log.w(TAG, "worker ${slot.index} ended, or its session is stopping, before running ${argv.firstOrNull()}")
|
||||
release(app, slot)
|
||||
return -1
|
||||
}
|
||||
Os.write(go[1].fileDescriptor, byteArrayOf(1), 0, 1)
|
||||
val answer = StructPollfd().apply { fd = go[1].fileDescriptor; events = OsConstants.POLLIN.toShort() }
|
||||
// then the word to run it: given only here, once its answer is in, so that a worker whose
|
||||
// answer came too late never runs a program this call reports as not started. [confirmed]
|
||||
// goes first: a caller that hears nothing runs the program itself, so it must have heard
|
||||
// before the worker may run it (an app dying in between loses the program, not doubles it).
|
||||
// The word and a teardown's start exclude each other: a launch is authorized before stopGuests()
|
||||
// marks the session stopped, and is then stopped with the pids it takes (guestPids lists a
|
||||
// launching slot), or never.
|
||||
val answered = Os.poll(arrayOf(answer), ANSWER_TIMEOUT_MS) > 0 && Os.read(go[1].fileDescriptor, ByteArray(1), 0, 1) == 1
|
||||
val accepted = answered && synchronized(authorizing) {
|
||||
!stopping() && confirmed() && Os.write(go[1].fileDescriptor, byteArrayOf(1), 0, 1) == 1
|
||||
}
|
||||
val endedRunning = synchronized(slots) {
|
||||
slot.launching = false
|
||||
if (accepted && !slot.endedLaunching) slot.started = true
|
||||
accepted && slot.endedLaunching
|
||||
}
|
||||
if (!accepted) {
|
||||
Log.w(TAG, "worker ${slot.index} did not take ${argv.firstOrNull()} on")
|
||||
release(app, slot)
|
||||
return -1
|
||||
}
|
||||
// it ran and was already gone by now: its end, once
|
||||
if (endedRunning) reportEnd(app, slot)
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, "worker ${slot.index} refused ${argv.firstOrNull()}", e)
|
||||
synchronized(slots) { slot.launching = false }
|
||||
release(app, slot)
|
||||
return -1
|
||||
} finally {
|
||||
data?.recycle()
|
||||
reply.recycle()
|
||||
go?.forEach { runCatching { it.close() } }
|
||||
}
|
||||
Log.i(TAG, "worker ${slot.index} (pid ${slot.pid}) runs ${argv.lastOrNull { !it.startsWith("-") }}")
|
||||
return slot.pid
|
||||
}
|
||||
|
||||
/** Binds a free worker; its [Slot.connected] opens once it is up. Null when all are in use. */
|
||||
private fun bind(app: Context): Slot? {
|
||||
val slot = synchronized(slots) {
|
||||
val index = slots.indexOfFirst { it == null }
|
||||
if (index < 0) {
|
||||
Log.w(TAG, "all ${slots.size} workers are busy")
|
||||
return null
|
||||
}
|
||||
Slot(index).also { slots[index] = it }
|
||||
}
|
||||
slot.connection = object : ServiceConnection {
|
||||
override fun onServiceConnected(name: ComponentName, binder: IBinder) {
|
||||
slot.service = binder
|
||||
slot.connected.countDown()
|
||||
}
|
||||
|
||||
override fun onServiceDisconnected(name: ComponentName) = release(app, slot)
|
||||
|
||||
override fun onBindingDied(name: ComponentName) = release(app, slot)
|
||||
}
|
||||
// Callbacks off the main thread: start() waits for onServiceConnected, and a caller holding a
|
||||
// lock the main thread is waiting for (PulseAudio's launch) would otherwise wait out the timeout.
|
||||
val bound = runCatching {
|
||||
app.bindService(Intent(app, classes[slot.index]), Context.BIND_AUTO_CREATE or Context.BIND_IMPORTANT,
|
||||
connections, slot.connection)
|
||||
}.onFailure { Log.w(TAG, "worker ${slot.index} could not be bound", it) }.getOrDefault(false)
|
||||
if (!bound) {
|
||||
release(app, slot)
|
||||
return null
|
||||
}
|
||||
return slot
|
||||
}
|
||||
|
||||
private fun takeWarm(): Slot? = synchronized(slots) {
|
||||
while (warm.isNotEmpty()) {
|
||||
val slot = warm.removeFirst()
|
||||
if (slots[slot.index] === slot && slot.service?.isBinderAlive == true) return slot
|
||||
}
|
||||
null
|
||||
}
|
||||
|
||||
/** Brings the warm workers back up to [warmTarget], one at a time, off the caller's thread. */
|
||||
private fun refill(app: Context) {
|
||||
if (warmTarget == 0 || !warming.compareAndSet(false, true)) return
|
||||
Thread({
|
||||
try {
|
||||
while (true) {
|
||||
val missing = warmTarget - synchronized(slots) { warm.size }
|
||||
if (missing <= 0) break
|
||||
// all at once: the zygote forks them in parallel
|
||||
val fresh = (1..missing).mapNotNull { bind(app) }
|
||||
if (fresh.isEmpty()) break
|
||||
for (slot in fresh) {
|
||||
if (!slot.connected.await(10, TimeUnit.SECONDS)) {
|
||||
release(app, slot)
|
||||
continue
|
||||
}
|
||||
// decided once, under the lock: kept warm, or released
|
||||
val kept = synchronized(slots) {
|
||||
(slots[slot.index] === slot && warmTarget > 0).also { if (it) warm.addLast(slot) }
|
||||
}
|
||||
if (!kept) release(app, slot)
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
warming.set(false)
|
||||
}
|
||||
}, "guest-worker-warm").apply { isDaemon = true; start() }
|
||||
}
|
||||
|
||||
/** A game is about to start: [LAUNCH_WORKERS] bound ahead, back to [WARM_WORKERS] once it is up. */
|
||||
fun expectLaunch(context: Context) {
|
||||
val app = context.applicationContext
|
||||
val raised = synchronized(slots) { (warmTarget > 0).also { if (it) warmTarget = LAUNCH_WORKERS } }
|
||||
if (!raised) return
|
||||
launchUntil = android.os.SystemClock.elapsedRealtime() + LAUNCH_MS
|
||||
val launch = launches.incrementAndGet()
|
||||
refill(app)
|
||||
Thread({
|
||||
try {
|
||||
Thread.sleep(LAUNCH_MS)
|
||||
} catch (_: InterruptedException) {
|
||||
return@Thread
|
||||
}
|
||||
if (launches.get() != launch) return@Thread
|
||||
val extra = synchronized(slots) {
|
||||
if (warmTarget != LAUNCH_WORKERS) emptyList()
|
||||
else {
|
||||
warmTarget = WARM_WORKERS
|
||||
List((warm.size - WARM_WORKERS).coerceAtLeast(0)) { warm.removeLast() }
|
||||
}
|
||||
}
|
||||
extra.forEach { release(app, it) }
|
||||
refill(app)
|
||||
}, "guest-worker-launch").apply { isDaemon = true; start() }
|
||||
}
|
||||
|
||||
private fun release(app: Context, slot: Slot) {
|
||||
var report = false
|
||||
val removed = synchronized(slots) {
|
||||
warm.remove(slot)
|
||||
if (slot.launching) slot.endedLaunching = true else report = slot.started
|
||||
(slots[slot.index] === slot).also { if (it) slots[slot.index] = null }
|
||||
}
|
||||
if (!removed) return
|
||||
runCatching { app.unbindService(slot.connection) }
|
||||
if (report) reportEnd(app, slot)
|
||||
}
|
||||
|
||||
private fun reportEnd(app: Context, slot: Slot) {
|
||||
val onExit = slot.onExit ?: return
|
||||
Thread({ onExit(exitStatus(app, slot.pid)) }, "guest-worker-exit").start()
|
||||
}
|
||||
|
||||
/** The worker's exit as a wait status (exit code << 8, or the signal), -1 when unknown. */
|
||||
private fun exitStatus(app: Context, pid: Int): Int {
|
||||
if (pid <= 0 || android.os.Build.VERSION.SDK_INT < 30) return -1
|
||||
val am = app.getSystemService(ActivityManager::class.java)
|
||||
var recorded = false
|
||||
repeat(20) {
|
||||
am.getHistoricalProcessExitReasons(app.packageName, pid, 1).firstOrNull()?.let {
|
||||
recorded = true
|
||||
// an exit code only when the process exited itself; a signal number otherwise (a native crash)
|
||||
if (it.reason == android.app.ApplicationExitInfo.REASON_EXIT_SELF) return (it.status and 0xff) shl 8
|
||||
if (it.status in 1..64) return it.status and 0x7f
|
||||
// Android records the death first and the zygote's status later (as UNKNOWN, 0, then
|
||||
// EXIT_SELF): a reason without a status may still be completed
|
||||
if (it.reason != android.app.ApplicationExitInfo.REASON_UNKNOWN) return OsConstants.SIGKILL
|
||||
}
|
||||
Thread.sleep(50)
|
||||
}
|
||||
// killed by Android with no signal recorded, not a clean exit
|
||||
return if (recorded) OsConstants.SIGKILL else -1
|
||||
}
|
||||
|
||||
/** The pids of session [of]'s guest programs running in workers. */
|
||||
fun guestPids(of: Int = session): List<Int> =
|
||||
synchronized(slots) { slots.mapNotNull { s -> s?.takeIf { it.guest && it.session == of }?.pid?.takeIf { it > 0 } } }
|
||||
|
||||
/** Ends session [of]'s guest programs that are still running, and, for the latest session, the warm workers. */
|
||||
fun stopGuests(of: Int = session) {
|
||||
// the check and the reset together: a new session's serve() may be under way
|
||||
val drained = synchronized(authorizing) {
|
||||
synchronized(slots) {
|
||||
stopped = maxOf(stopped, of)
|
||||
if (of != session) emptyList() else { warmTarget = 0; warm.toList().also { warm.clear() } }
|
||||
}
|
||||
}
|
||||
context?.let { app -> drained.forEach { release(app, it) } }
|
||||
val pids = guestPids(of)
|
||||
if (pids.isEmpty()) return
|
||||
pids.forEach { Process.sendSignal(it, OsConstants.SIGTERM) }
|
||||
Thread.sleep(500)
|
||||
pids.forEach { Process.killProcess(it) }
|
||||
}
|
||||
|
||||
/** Listens for `droiddeck-spawn` requests from the session's guests. */
|
||||
fun attach(context: Context) {
|
||||
this.context = context.applicationContext
|
||||
}
|
||||
|
||||
/** Puts a running program's main thread back to its asker's priority after Android boosted it (once started, never stops). */
|
||||
private fun keepPriorities() {
|
||||
synchronized(this) {
|
||||
if (keeper != null) return
|
||||
keeper = Thread({
|
||||
while (true) {
|
||||
try {
|
||||
Thread.sleep(PRIORITY_CHECK_MS)
|
||||
} catch (_: InterruptedException) {
|
||||
return@Thread
|
||||
}
|
||||
val running = synchronized(slots) {
|
||||
slots.filterNotNull().filter { it.started && it.pid > 0 && it.nice != TOP_APP_BOOST }
|
||||
}
|
||||
for (s in running) runCatching {
|
||||
if (Process.getThreadPriority(s.pid) == TOP_APP_BOOST) Process.setThreadPriority(s.pid, s.nice)
|
||||
}
|
||||
}
|
||||
}, "guest-worker-priority").apply { isDaemon = true; start() }
|
||||
}
|
||||
}
|
||||
|
||||
/** Starts a session's use of the workers (and the spawn socket, once); returns its number. */
|
||||
fun serve(context: Context): Int {
|
||||
val app = context.applicationContext
|
||||
this.context = app
|
||||
val number = synchronized(slots) { warmTarget = WARM_WORKERS; ++session }
|
||||
refill(app)
|
||||
keepPriorities()
|
||||
synchronized(this) {
|
||||
if (server != null) return number
|
||||
server = Thread({
|
||||
val socket = try {
|
||||
LocalServerSocket(socketName(app))
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "no spawn socket", e)
|
||||
synchronized(this) { server = null }
|
||||
return@Thread
|
||||
}
|
||||
while (true) {
|
||||
val client = runCatching { socket.accept() }.getOrNull()
|
||||
if (client == null) {
|
||||
Thread.sleep(100) // out of fds, for one: do not spin
|
||||
continue
|
||||
}
|
||||
// A bounded number of requests still coming in: a stalled sender holds a thread
|
||||
if (receiving.incrementAndGet() > MAX_RECEIVING) {
|
||||
receiving.decrementAndGet()
|
||||
Log.w(TAG, "$MAX_RECEIVING spawn requests are still coming in: refusing another")
|
||||
runCatching { client.close() }
|
||||
continue
|
||||
}
|
||||
Thread({
|
||||
try {
|
||||
handle(app, client) { receiving.decrementAndGet() }
|
||||
} catch (e: Throwable) {
|
||||
Log.w(TAG, "spawn request failed", e)
|
||||
}
|
||||
}, "guest-spawn").start()
|
||||
}
|
||||
}, "guest-spawn-server").apply { isDaemon = true; start() }
|
||||
}
|
||||
return number
|
||||
}
|
||||
|
||||
private fun handle(app: Context, client: LocalSocket, received: () -> Unit) {
|
||||
var receiving = true
|
||||
val done = { if (receiving) { receiving = false; received() } }
|
||||
try {
|
||||
handleRequest(app, client, done)
|
||||
} finally {
|
||||
done()
|
||||
}
|
||||
}
|
||||
|
||||
private fun handleRequest(app: Context, client: LocalSocket, received: () -> Unit) {
|
||||
client.use {
|
||||
if (client.peerCredentials.uid != Process.myUid()) return
|
||||
// The whole request and its fds within this, however slowly they come (the wait for a
|
||||
// program's exit is not): each read gets what is left of it
|
||||
val deadline = android.os.SystemClock.elapsedRealtime() + RECEIVE_TIMEOUT_MS
|
||||
fun left() {
|
||||
val ms = deadline - android.os.SystemClock.elapsedRealtime()
|
||||
if (ms <= 0) throw java.net.SocketTimeoutException("spawn request not received in time")
|
||||
client.soTimeout = ms.toInt()
|
||||
}
|
||||
val input = DataInputStream(client.inputStream)
|
||||
val fds = ArrayList<ParcelFileDescriptor>()
|
||||
fun take() {
|
||||
val received = client.ancillaryFileDescriptors.orEmpty()
|
||||
try {
|
||||
received.forEach { fds.add(ParcelFileDescriptor.dup(it)) }
|
||||
} finally {
|
||||
received.forEach { runCatching { Os.close(it) } }
|
||||
}
|
||||
}
|
||||
// fds can come with any read, the request's own bytes too: each read's are taken at once
|
||||
fun fill(bytes: ByteArray) {
|
||||
var got = 0
|
||||
while (got < bytes.size) {
|
||||
left()
|
||||
val n = input.read(bytes, got, bytes.size - got)
|
||||
take()
|
||||
if (n < 0) throw java.io.EOFException("spawn request ended at $got of ${bytes.size} bytes")
|
||||
got += n
|
||||
}
|
||||
}
|
||||
// Until start() has them: closed on every way out before that, from the first byte on
|
||||
var handedOver = false
|
||||
try {
|
||||
val length = ByteArray(4).also { fill(it) }.let { java.nio.ByteBuffer.wrap(it).int }
|
||||
if (length !in 1..MAX_REQUEST_BYTES) {
|
||||
Log.w(TAG, "spawn request of $length bytes refused")
|
||||
return
|
||||
}
|
||||
val payload = ByteArray(length).also { fill(it) }
|
||||
val request = JSONObject(String(payload))
|
||||
if (request.has("fdchunks")) {
|
||||
// The hook sends its fds after the request, a chunk with each byte (hook/handoff.c)
|
||||
val total = (request.optJSONArray("fds")?.length() ?: 0) + (if (request.has("table")) 1 else 0)
|
||||
while (fds.size < total) {
|
||||
left()
|
||||
if (input.read() < 0) throw java.io.EOFException("fds ended at ${fds.size} of $total")
|
||||
take()
|
||||
}
|
||||
} else {
|
||||
take()
|
||||
}
|
||||
received()
|
||||
val argv = request.getJSONArray("argv").let { a -> List(a.length()) { a.getString(it) } }
|
||||
val env = LinkedHashMap<String, String>()
|
||||
request.optJSONObject("env")?.let { o -> o.keys().forEach { env[it] = o.getString(it) } }
|
||||
request.optJSONArray("envlist")?.let { a ->
|
||||
for (i in 0 until a.length()) a.getString(i).split('=', limit = 2).let { if (it.size == 2) env[it[0]] = it[1] }
|
||||
}
|
||||
// What the hook told the program that asked (it may run in a worker itself) is not this one's
|
||||
env.keys.removeAll { it.startsWith("DDH_") }
|
||||
val cwd = request.optString("cwd", "/")
|
||||
val wait = request.optBoolean("wait", false)
|
||||
// A path without a slash names a file in the cwd, as execve() takes it, not one on PATH
|
||||
val file = request.optString("file", "").let { if (it.isNotEmpty() && '/' !in it) "./$it" else it }
|
||||
// The handoff table (the hook's) comes last among the fds; the rest go to these numbers.
|
||||
val tableIndex = request.optInt("table", -1)
|
||||
val numbers = request.optJSONArray("fds")?.let { a -> IntArray(a.length()) { a.getInt(it) } } ?: IntArray(3) { it }
|
||||
val table = fds.getOrNull(tableIndex)?.takeIf { pfd ->
|
||||
runCatching { Os.readlink("/proc/self/fd/${pfd.fd}") }.getOrNull()?.contains("ddnatv-handoff") == true
|
||||
}
|
||||
val slot = request.optInt("slot", -1)
|
||||
val parent = request.optInt("parent", -1)
|
||||
var programFds = fds.filterIndexed { i, _ -> i != tableIndex }
|
||||
var targets = numbers
|
||||
if (table != null && slot >= 0) {
|
||||
// The program reports its own exit status into the table (hook/handoff.c)
|
||||
val tableFd = (numbers.maxOrNull() ?: 2) + 1
|
||||
programFds = programFds + table
|
||||
targets = numbers + tableFd
|
||||
env["DDH_TABLE"] = "$tableFd:$slot:$parent:${request.optInt("child", -1)}"
|
||||
}
|
||||
val root = env["DDNATV_ROOT"]?.let(::File)
|
||||
val out = client.outputStream
|
||||
if (root == null || argv.isEmpty()) {
|
||||
out.write("error no guest root or program\n".toByteArray())
|
||||
return
|
||||
}
|
||||
val shell = listOf("/usr/bin/bash", "/bin/bash").first { File(root, it.removePrefix("/")).isFile }
|
||||
val args = if (file.isNotEmpty()) {
|
||||
listOf("-c", "unset DDH_WRAPPER; cd -- \"\$1\" 2>/dev/null; a=\$2; f=\$3; shift 3; exec -a \"\$a\" \"\$f\" \"\$@\"",
|
||||
"droiddeck-spawn", cwd, argv[0], file) + argv.drop(1)
|
||||
} else {
|
||||
listOf("-c", "unset DDH_WRAPPER; cd -- \"\$1\" 2>/dev/null; shift; exec \"\$@\"", "droiddeck-spawn", cwd) + argv
|
||||
}
|
||||
val command = NativeGuest.command(root, shell, args)
|
||||
env["DDNATV_REAL_EXE"] = File(root, shell.removePrefix("/")).path
|
||||
// The hook restores these in the program (tools/nativeguest/hook/handoff.c).
|
||||
if (request.has("sigign")) env["DDH_SIGIGN"] = request.getLong("sigign").toString()
|
||||
if (request.has("nofile")) {
|
||||
env["DDH_NOFILE"] = request.getLong("nofile").toString() +
|
||||
(if (request.has("nofilemax")) ":" + request.getLong("nofilemax") else "")
|
||||
}
|
||||
if (request.has("umask")) env["DDH_UMASK"] = request.getLong("umask").toString()
|
||||
if (request.has("pgid")) env["DDH_PGID"] = request.getLong("pgid").toString()
|
||||
if (request.has("anchor")) env["DDH_ANCHOR"] = request.getLong("anchor").toString()
|
||||
if (request.has("pstart")) env["DDH_PSTART"] = request.getLong("pstart").toString()
|
||||
if (request.has("astart")) env["DDH_ASTART"] = request.getLong("astart").toString()
|
||||
env["DDH_SIGMASK"] = request.optLong("sigmask", 0L).toString()
|
||||
// The shell above: the hook restores nothing there (bash changes its own signal mask),
|
||||
// only in the program it execs, which no longer has this.
|
||||
env["DDH_WRAPPER"] = "1"
|
||||
val child = request.optInt("child", -1)
|
||||
val exited = CountDownLatch(1)
|
||||
var status = -1
|
||||
var worker = -1
|
||||
// The hook answers the pid with "go" (ack): without it (it died, or gave up and runs the
|
||||
// program itself) the worker must not run it too.
|
||||
val ack = request.optBoolean("ack", false)
|
||||
var answered = false
|
||||
// the hook's last word, sent once the worker has taken the program on and before it runs it
|
||||
var confirmedToHook = false
|
||||
// The session whose guest asks, not the latest: a new session can start (serve()) while an
|
||||
// older one's guests are still sending, and that older one's teardown must find its programs.
|
||||
// A request that names none is refused (start() runs nothing for session 0): the hook and
|
||||
// droiddeck-spawn always name it, and which session's it is cannot be told otherwise.
|
||||
val owner = request.optInt("session", 0).coerceAtLeast(0)
|
||||
// The sender is the forked child (or droiddeck-spawn): its priority is the one the program would inherit
|
||||
val nice = runCatching { Process.getThreadPriority(client.peerCredentials.pid) }.getOrDefault(Process.THREAD_PRIORITY_DEFAULT)
|
||||
val pid = start(app, command, env.map { (k, v) -> "$k=$v" }, programFds, targets, true, owner = owner, nice = nice, onExit = { code ->
|
||||
status = code
|
||||
if (table != null && slot >= 0) reportExit(table, slot, code, parent, child, worker)
|
||||
exited.countDown()
|
||||
}, confirmed = {
|
||||
!ack || runCatching {
|
||||
out.write("ok\n".toByteArray())
|
||||
out.flush()
|
||||
confirmedToHook = true
|
||||
}.isSuccess
|
||||
}, commit = { started ->
|
||||
worker = started
|
||||
if (!ack) return@start true
|
||||
runCatching {
|
||||
out.write("pid $started\n".toByteArray())
|
||||
out.flush()
|
||||
answered = true
|
||||
client.soTimeout = ACK_TIMEOUT_MS
|
||||
// the whole line: a hook whose write stopped short treats it as failed and runs the program itself
|
||||
val line = StringBuilder()
|
||||
var ended = false
|
||||
while (!ended) {
|
||||
val c = input.read()
|
||||
if (c < 0) break
|
||||
if (c == '\n'.code) ended = true else line.append(c.toChar())
|
||||
}
|
||||
ended && line.toString() == "go"
|
||||
}.getOrDefault(false)
|
||||
})
|
||||
handedOver = true
|
||||
programFds.filter { it !== table }.forEach { runCatching { it.close() } }
|
||||
if (pid <= 0) table?.let { runCatching { it.close() } }
|
||||
if (!answered) {
|
||||
out.write(if (pid > 0) "pid $pid\n".toByteArray() else "error no worker\n".toByteArray())
|
||||
out.flush()
|
||||
} else if (!confirmedToHook) {
|
||||
// nothing runs it in a worker: the hook runs it itself
|
||||
runCatching { out.write("error not started\n".toByteArray()); out.flush() }
|
||||
}
|
||||
if (pid > 0 && wait) {
|
||||
exited.await()
|
||||
// droiddeck-spawn exits with this: an exit code, or 128 plus the signal
|
||||
val code = if (status < 0) 1 else if (status and 0x7f == 0) (status shr 8) and 0xff else 128 + (status and 0x7f)
|
||||
out.write("exit $code\n".toByteArray())
|
||||
out.flush()
|
||||
}
|
||||
} finally {
|
||||
if (!handedOver) fds.forEach { runCatching { it.close() } }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Layout of the hook's table (tools/nativeguest/hook/handoff.c): a 64-byte header, then 64-byte
|
||||
// entries of int32 child, real, parent, state, ..., and at 32 the app's report: int32 status, child.
|
||||
// The report is one 8-byte write tagged with the child it is for; only the hook changes an
|
||||
// entry's state, so a report that lands after the entry went to another child is ignored there.
|
||||
private fun reportExit(table: ParcelFileDescriptor, slot: Int, status: Int, parent: Int, child: Int, worker: Int) {
|
||||
runCatching {
|
||||
val entry = 64L + slot * 64L
|
||||
val head = java.nio.ByteBuffer.allocate(16).order(java.nio.ByteOrder.nativeOrder())
|
||||
Os.pread(table.fileDescriptor, head, entry)
|
||||
val real = head.getInt(4)
|
||||
val state = head.getInt(12)
|
||||
// Also while the hook holds the entry (TAKEN) or has already guessed its end (EXITED):
|
||||
// the report is for this child only, and wins over the timeout's guess (ddh_status)
|
||||
if (head.getInt(0) != child || head.getInt(8) != parent || (real != 0 && real != worker) || state !in 1..4)
|
||||
return@runCatching
|
||||
// An exit Android has no record of is reported as a failure, not as a signal.
|
||||
val report = java.nio.ByteBuffer.allocate(8).order(java.nio.ByteOrder.nativeOrder())
|
||||
.putInt(0, if (status < 0) 1 shl 8 else status).putInt(4, child)
|
||||
Os.pwrite(table.fileDescriptor, report, entry + 32)
|
||||
if (parent > 0) Process.sendSignal(parent, OsConstants.SIGCHLD)
|
||||
}.onFailure { Log.w(TAG, "could not report an exit to the guest's parent", it) }
|
||||
runCatching { table.close() }
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,13 @@
|
||||
package com.droiddeck.launcher.runtime;
|
||||
|
||||
import com.droiddeck.launcher.core.AddonPack;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.os.Process;
|
||||
import android.system.ErrnoException;
|
||||
import android.system.Os;
|
||||
import android.system.StructStat;
|
||||
import android.system.StructUtsname;
|
||||
import com.droiddeck.launcher.gpu.SystemVulkanDriver;
|
||||
import com.droiddeck.launcher.session.SessionPrefs;
|
||||
|
||||
@@ -55,8 +58,70 @@ public final class LinuxRuntime {
|
||||
return dir;
|
||||
}
|
||||
|
||||
public static File prootTempDir(Context context) {
|
||||
File dir = new File(liveDir(context), "proot");
|
||||
dir.mkdirs();
|
||||
return dir;
|
||||
}
|
||||
|
||||
private static final String HOST_DIR = "opt/android-host";
|
||||
public static final String PROOT_PACK = "add-on pack";
|
||||
public static final String PROOT_ROOTFS = "rootfs fallback";
|
||||
public static final String PROOT_MISSING = "missing";
|
||||
|
||||
private static File rootfsProot(Context context) {
|
||||
return new File(rootDir(context), HOST_DIR + "/proot");
|
||||
}
|
||||
|
||||
private static File rootfsLoader(Context context) {
|
||||
return new File(rootDir(context), HOST_DIR + "/loader");
|
||||
}
|
||||
|
||||
private static boolean rootfsProotReady(Context context) {
|
||||
return Build.VERSION.SDK_INT < 29 && rootfsProot(context).isFile() && rootfsLoader(context).isFile();
|
||||
}
|
||||
|
||||
/** proot execs its loader, and targetSdk 29+ may exec only the APK's libraries, which hold the pack's matching loader. */
|
||||
public static boolean stockProotAllowed(Context context) {
|
||||
return Build.VERSION.SDK_INT < 29 && SessionPrefs.allowStockProot(context);
|
||||
}
|
||||
|
||||
/** Android 10+ refuses to execute files from app data for targetSdk 29+, but executes the APK's extracted libraries. */
|
||||
private static File bundledLoader(Context context) {
|
||||
File file = new File(context.getApplicationInfo().nativeLibraryDir, "libproot-loader.so");
|
||||
return file.isFile() ? file : null;
|
||||
}
|
||||
|
||||
public static boolean patchedProot(Context context) {
|
||||
return AddonPack.PROOT.installed(context);
|
||||
}
|
||||
|
||||
public static File prootBinary(Context context) {
|
||||
if (AddonPack.PROOT.installed(context)) return AddonPack.PROOT.file(context, "libproot.so");
|
||||
if (stockProotAllowed(context)) return rootfsProot(context);
|
||||
return AddonPack.PROOT.file(context, "libproot.so");
|
||||
}
|
||||
|
||||
public static File prootLoader(Context context) {
|
||||
File bundled = bundledLoader(context);
|
||||
if (AddonPack.PROOT.installed(context)) return bundled != null ? bundled : AddonPack.PROOT.file(context, "libproot-loader.so");
|
||||
if (stockProotAllowed(context)) return rootfsLoader(context);
|
||||
return bundled != null ? bundled : AddonPack.PROOT.file(context, "libproot-loader.so");
|
||||
}
|
||||
|
||||
public static String prootSource(Context context) {
|
||||
File bin = prootBinary(context);
|
||||
if (!bin.isFile()) return PROOT_MISSING;
|
||||
return patchedProot(context) && !bin.equals(rootfsProot(context)) ? PROOT_PACK : PROOT_ROOTFS;
|
||||
}
|
||||
|
||||
public static String prootLibraryPath(Context context) {
|
||||
File dir = new File(rootDir(context), HOST_DIR);
|
||||
return dir.equals(prootBinary(context).getParentFile()) ? dir.getPath() : "";
|
||||
}
|
||||
|
||||
public static boolean isInstalled(Context context) {
|
||||
return hasRootfs(context) && NativeGuest.INSTANCE.loader(rootDir(context)) != null;
|
||||
return hasRootfs(context) && (patchedProot(context) || rootfsProotReady(context));
|
||||
}
|
||||
|
||||
public static boolean hasRootfs(Context context) {
|
||||
@@ -77,9 +142,42 @@ public final class LinuxRuntime {
|
||||
return manifests.length > 0 ? manifests[0] : null;
|
||||
}
|
||||
|
||||
public static List<String> command(Context context, File sessionRoot, File runtimeDir,
|
||||
File externalStorage, List<String> guestCommand) {
|
||||
return command(context, sessionRoot, runtimeDir, externalStorage, null, guestCommand);
|
||||
}
|
||||
|
||||
public static List<String> command(Context context, File sessionRoot, File runtimeDir,
|
||||
File externalStorage, List<String> extraBinds,
|
||||
List<String> guestCommand) {
|
||||
return command(context, sessionRoot, runtimeDir, externalStorage, extraBinds, guestCommand, false);
|
||||
}
|
||||
|
||||
public static List<String> command(Context context, File sessionRoot, File runtimeDir,
|
||||
File externalStorage, List<String> extraBinds,
|
||||
List<String> guestCommand, boolean fakeRoot) {
|
||||
File root = rootDir(context);
|
||||
List<String> binds = binds(context, sessionRoot, runtimeDir, externalStorage, extraBinds);
|
||||
if (sessionRoot != null) lastBinds = binds;
|
||||
return commandWithBinds(context, root, binds, guestCommand, fakeRoot);
|
||||
}
|
||||
|
||||
public static List<String> commandWithBinds(Context context, File root, List<String> binds,
|
||||
List<String> guestCommand) {
|
||||
return commandWithBinds(context, root, binds, guestCommand, false);
|
||||
}
|
||||
|
||||
public static List<String> commandWithBinds(Context context, File root, List<String> binds,
|
||||
List<String> guestCommand, boolean fakeRoot) {
|
||||
List<String> cmd = fakeRoot ? rootPrefix(context, root, "/root") : prootPrefix(context, root, "/root");
|
||||
for (String spec : binds) bind(cmd, spec);
|
||||
cmd.addAll(guestCommand);
|
||||
return cmd;
|
||||
}
|
||||
|
||||
private static volatile List<String> lastBinds;
|
||||
|
||||
/** The mounts of the running session, which sandboxes and root helpers see too. */
|
||||
/** The mounts of a session started without proot, which sandboxes and root helpers see too. */
|
||||
public static void rememberSessionBinds(List<String> binds) {
|
||||
lastBinds = binds;
|
||||
}
|
||||
@@ -95,6 +193,36 @@ public final class LinuxRuntime {
|
||||
return SessionPrefs.mountSharedStorage(context) ? android.os.Environment.getExternalStorageDirectory() : null;
|
||||
}
|
||||
|
||||
public static List<String> prootPrefix(Context context, File root, String cwd) {
|
||||
return prootPrefix(context, root, cwd, false);
|
||||
}
|
||||
|
||||
public static List<String> rootPrefix(Context context, File root, String cwd) {
|
||||
List<String> cmd = prootPrefix(context, root, cwd, true);
|
||||
cmd.add("--link2symlink");
|
||||
return cmd;
|
||||
}
|
||||
|
||||
public static List<String> prootPrefix(Context context, File root, String cwd, boolean fakeRoot) {
|
||||
NativeGuest.relinkAfterProot(root);
|
||||
List<String> cmd = new ArrayList<>();
|
||||
cmd.addAll(com.droiddeck.launcher.core.HostProcess.dataExecutable(prootBinary(context).getPath()));
|
||||
cmd.add("--kill-on-exit");
|
||||
cmd.add("--kernel-release=" + guestUtsname(SessionPrefs.guestHostname(context)));
|
||||
int uid = Process.myUid();
|
||||
if (fakeRoot) {
|
||||
cmd.add("-0");
|
||||
} else {
|
||||
cmd.add("-i");
|
||||
cmd.add(uid + ":" + uid);
|
||||
}
|
||||
cmd.add("-r");
|
||||
cmd.add(root.getPath());
|
||||
cmd.add("-w");
|
||||
cmd.add(cwd);
|
||||
return cmd;
|
||||
}
|
||||
|
||||
public static List<String> binds(Context context, File sessionRoot, File runtimeDir,
|
||||
File externalStorage, List<String> extraBinds) {
|
||||
File root = rootDir(context);
|
||||
@@ -192,7 +320,9 @@ public final class LinuxRuntime {
|
||||
if (extraBinds != null) {
|
||||
for (String spec : extraBinds) bind(cmd, spec);
|
||||
}
|
||||
return cmd;
|
||||
List<String> specs = new ArrayList<>();
|
||||
for (int i = 0; i + 1 < cmd.size(); i += 2) specs.add(cmd.get(i + 1));
|
||||
return specs;
|
||||
}
|
||||
|
||||
private static void bindPowerVrGpuNode(Context context, List<String> cmd) {
|
||||
@@ -467,9 +597,16 @@ public final class LinuxRuntime {
|
||||
}
|
||||
|
||||
private static void bind(List<String> cmd, String spec) {
|
||||
cmd.add("-b");
|
||||
cmd.add(spec);
|
||||
}
|
||||
|
||||
static String guestUtsname(String hostname) {
|
||||
StructUtsname host = Os.uname();
|
||||
return "\\" + host.sysname + "\\" + hostname + "\\" + host.release
|
||||
+ "\\" + host.version + "\\" + host.machine + "\\localdomain\\-1\\";
|
||||
}
|
||||
|
||||
public static synchronized void writeAccounts(Context context) throws IOException {
|
||||
File root = rootDir(context);
|
||||
int uid = Process.myUid();
|
||||
|
||||
@@ -184,6 +184,10 @@ public final class LinuxRuntimeInstaller {
|
||||
}
|
||||
};
|
||||
boolean desktop = DesktopCatalog.INSTANCE.desktopInstalled(app);
|
||||
if (packsOnly(app, release, progress)) {
|
||||
job.ok = true;
|
||||
return true;
|
||||
}
|
||||
job.ok = installOnce(app, release, progress);
|
||||
if (job.ok && desktop) keepDesktop(app, progress);
|
||||
return job.ok;
|
||||
@@ -352,6 +356,22 @@ public final class LinuxRuntimeInstaller {
|
||||
};
|
||||
}
|
||||
|
||||
private static boolean packsOnly(Context context, Release release, ProgressListener listener) {
|
||||
if (!LinuxRuntime.hasRootfs(context) || LinuxRuntime.isInstalled(context) || !release.version.equals(rootfsVersion(context))) return false;
|
||||
File root = LinuxRuntime.rootDir(context);
|
||||
try {
|
||||
recoverInterruptedSwap(root, new File(root.getParentFile(), LinuxRuntime.DIR + ".new"), new File(root.getParentFile(), LinuxRuntime.DIR + ".old"));
|
||||
} catch (IOException e) {
|
||||
Log.w(TAG, "packs only: " + e);
|
||||
return false;
|
||||
}
|
||||
String downloading = context.getString(R.string.rtinst_downloading);
|
||||
if (listener != null) listener.onProgress(Step.DOWNLOADING, downloading, 0);
|
||||
return AddonPack.PROOT.await(context, () -> true, packProgress(listener, downloading))
|
||||
&& AddonPack.DIRECTAUDIO.await(context, () -> true, packProgress(listener, downloading))
|
||||
&& LinuxRuntime.isInstalled(context);
|
||||
}
|
||||
|
||||
private static boolean installOnce(Context context, Release release, ProgressListener listener) {
|
||||
File archive = new File(context.getCacheDir(), archiveName(release));
|
||||
boolean keepPartial = false;
|
||||
@@ -363,6 +383,9 @@ public final class LinuxRuntimeInstaller {
|
||||
emptyTrash(LinuxRuntime.rootDir(context).getParentFile());
|
||||
String downloading = context.getString(R.string.rtinst_downloading);
|
||||
if (listener != null) listener.onProgress(Step.DOWNLOADING, downloading, 0);
|
||||
if (!LinuxRuntime.patchedProot(context) && !AddonPack.PROOT.await(context, () -> true, packProgress(listener, downloading))
|
||||
&& !LinuxRuntime.stockProotAllowed(context))
|
||||
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) -> {
|
||||
|
||||
@@ -6,7 +6,7 @@ import java.io.File
|
||||
import java.nio.file.Files
|
||||
|
||||
/**
|
||||
* Starts guest programs directly on the Android kernel: the glibc loader of the
|
||||
* 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.
|
||||
*/
|
||||
@@ -15,16 +15,24 @@ object 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 guest program loads before the native hook. */
|
||||
/** Libraries every native program loads before the hook, as /etc/ld.so.preload does for proot. */
|
||||
fun preloadList(root: File): List<String> {
|
||||
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 =
|
||||
available(LinuxRuntime.rootDir(context))
|
||||
SessionPrefs.nativeUserland(context) && available(LinuxRuntime.rootDir(context))
|
||||
|
||||
@Volatile var sessionPrepared = false
|
||||
/** 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)
|
||||
@@ -85,7 +93,7 @@ object NativeGuest {
|
||||
|
||||
private fun hostProgram(root: File, program: String): File = File(root, program.removePrefix("/"))
|
||||
|
||||
/** The environment of the session process: the hook's root, the guest mounts, the preload list. */
|
||||
/** 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<String>, program: String, hostname: String? = null): Map<String, String> {
|
||||
val preload = preloadList(root)
|
||||
return linkedMapOf(
|
||||
@@ -103,11 +111,9 @@ object NativeGuest {
|
||||
fun workingDirectory(root: File, binds: List<String>, 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 with [binds], in guest directory [cwd]. */
|
||||
/** A process for [guest] (argv) started as proot would with [binds], in guest directory [cwd]. */
|
||||
fun processBuilder(context: Context, root: File, binds: List<String>, guest: List<String>, cwd: String = "/root"): ProcessBuilder {
|
||||
if (!available(root)) com.droiddeck.launcher.session.SessionFiles.stage(context, root)
|
||||
check(available(root)) { "The installed Linux runtime is missing its native loader or hook" }
|
||||
if (!sessionPrepared) prepare(context, root)
|
||||
if (sessionMode == null) prepare(context, root)
|
||||
return ProcessBuilder(command(root, guest.first(), guest.drop(1)))
|
||||
.directory(workingDirectory(root, binds, cwd))
|
||||
.also { builder ->
|
||||
@@ -168,15 +174,21 @@ object NativeGuest {
|
||||
|
||||
private const val RELINK_STAMP = "etc/droiddeck/native-symlinks"
|
||||
|
||||
@JvmStatic
|
||||
fun relinkAfterProot(root: File) {
|
||||
File(root, RELINK_STAMP).delete()
|
||||
}
|
||||
|
||||
private val HOST_LINK_TARGETS = listOf("/proc", "/dev", "/sys", "/sdcard", "/storage", "/data", "/system", "/vendor", "/apex",
|
||||
"/system_ext", "/product", "/odm", "/linkerconfig", "/mnt", "/root/Storage")
|
||||
|
||||
/**
|
||||
* Symbolic links the kernel follows by itself (ld.so, Steam, anything that skips the hook) read
|
||||
* their absolute target on Android's own filesystem. Rewrite rootfs links as relative paths so
|
||||
* the loader resolves them inside the guest. Rerun when the runtime changes.
|
||||
* 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 {
|
||||
fun relinkAbsoluteSymlinks(context: Context, root: File, commands: () -> Sequence<List<String>> = ::procCommands): Int {
|
||||
val stamp = File(root, RELINK_STAMP)
|
||||
val version = com.droiddeck.launcher.runtime.LinuxRuntimeInstaller.installedVersion(context).orEmpty() + "/3"
|
||||
if (stamp.isFile && stamp.readText() == version) return 0
|
||||
@@ -204,11 +216,20 @@ object NativeGuest {
|
||||
|
||||
override fun visitFileFailed(file: java.nio.file.Path, exc: java.io.IOException) = java.nio.file.FileVisitResult.CONTINUE
|
||||
})
|
||||
stamp.parentFile?.mkdirs()
|
||||
stamp.writeText(version)
|
||||
if (!prootRunning(LinuxRuntime.prootBinary(context).path, commands())) {
|
||||
stamp.parentFile?.mkdirs()
|
||||
stamp.writeText(version)
|
||||
}
|
||||
return rewritten
|
||||
}
|
||||
|
||||
internal fun prootRunning(proot: String, commands: Sequence<List<String>>): Boolean =
|
||||
commands.any { args -> args.take(2).any { it == proot } }
|
||||
|
||||
private fun procCommands(): Sequence<List<String>> = (File("/proc").listFiles() ?: emptyArray()).asSequence()
|
||||
.filter { it.name.all(Char::isDigit) }
|
||||
.mapNotNull { runCatching { File(it, "cmdline").readText().split('\u0000') }.getOrNull() }
|
||||
|
||||
/**
|
||||
* 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
|
||||
@@ -233,8 +254,8 @@ object NativeGuest {
|
||||
|
||||
/**
|
||||
* Wine prefixes' drive links (dosdevices) hold guest paths ("s:" -> /mnt/droiddeck-sd), which
|
||||
* the native hook follows inside a mount. Earlier builds pointed them at host paths, so convert
|
||||
* those links back to guest paths.
|
||||
* 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<String>): Int {
|
||||
val compatdata = listOf(File(root, "root/.local/share/Steam/steamapps/compatdata")) + binds.mapNotNull { spec ->
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.droiddeck.launcher.runtime
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Build
|
||||
import android.util.Log
|
||||
import com.droiddeck.launcher.session.SessionPrefs
|
||||
import java.io.File
|
||||
import java.security.MessageDigest
|
||||
|
||||
object ProotFastPath {
|
||||
private const val TAG = "ProotFastPath"
|
||||
const val LIBRARY = "/usr/local/lib/libddfastpath.so"
|
||||
const val MAX_BINDS = 256
|
||||
|
||||
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, nativeUserland)
|
||||
if (preference && !noSeccomp && !nativeUserland && !on)
|
||||
Log.i(TAG, "proot: fast path off - binary is $source, not the patched proot")
|
||||
return on
|
||||
}
|
||||
|
||||
fun key(root: File, binds: List<String>): String? {
|
||||
if (binds.size > MAX_BINDS || binds.any { it.contains('|') } || root.path.contains('|')) return null
|
||||
val digest = MessageDigest.getInstance("SHA-256")
|
||||
.digest((root.path + "\n" + binds.joinToString("\n")).toByteArray())
|
||||
return digest.take(12).joinToString("") { "%02x".format(it) }
|
||||
}
|
||||
|
||||
fun hostEnv(key: String): Pair<String, String> = "PROOT_FASTPATH" to key
|
||||
|
||||
fun guestEnv(root: File, binds: List<String>, key: String, sdk: Int = Build.VERSION.SDK_INT): List<String> = listOf(
|
||||
"PROOT_FP_ROOT=" + root.path,
|
||||
"PROOT_FP_BINDS=" + binds.joinToString("|"),
|
||||
"PROOT_FP_KEY=$key",
|
||||
"PROOT_FP_ANDROID_API=$sdk",
|
||||
)
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import android.os.Process
|
||||
import android.util.Log
|
||||
import com.droiddeck.launcher.core.HostProcess
|
||||
import com.droiddeck.launcher.session.OrphanReaper
|
||||
import com.droiddeck.launcher.session.SessionPrefs
|
||||
import org.json.JSONObject
|
||||
import java.io.DataInputStream
|
||||
import java.io.DataOutputStream
|
||||
@@ -116,7 +117,22 @@ object RootSpawner {
|
||||
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 = NativeGuest.processBuilder(context, root, binds, guest, cwd)
|
||||
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 {
|
||||
builder.redirectInput(streams[0].redirect ?: ProcessBuilder.Redirect.PIPE)
|
||||
|
||||
@@ -34,10 +34,12 @@ object BottomDesktop {
|
||||
val guest: List<String>,
|
||||
val binds: List<String>,
|
||||
val sessionRoot: File,
|
||||
val hostEnvironment: Array<String>,
|
||||
val root: File,
|
||||
val sessionDir: File,
|
||||
val generation: Int,
|
||||
val installed: Boolean,
|
||||
val nativeUserland: Boolean,
|
||||
val sharedStorage: File?,
|
||||
)
|
||||
|
||||
@@ -55,10 +57,10 @@ object BottomDesktop {
|
||||
private var service: Messenger? = null
|
||||
private var binding: ServiceConnection? = null
|
||||
private var pendingAttach: Message? = null
|
||||
/** The desktop guest's process: -1 when there is none, 0 while it is being started. */
|
||||
/** The desktop guest's proot: -1 when there is none, 0 while it is being started. */
|
||||
@Volatile private var guestPid = -1
|
||||
|
||||
/** The process to freeze with the session when it pauses. */
|
||||
/** The proot to freeze with the session when it pauses. */
|
||||
val suspendPid: Int get() = guestPid
|
||||
private var guestGeneration = 0
|
||||
var outputSize = 0 to 0
|
||||
@@ -85,14 +87,16 @@ object BottomDesktop {
|
||||
guest: List<String>,
|
||||
binds: List<String>,
|
||||
sessionRoot: File,
|
||||
hostEnvironment: Array<String>,
|
||||
root: File,
|
||||
sessionDir: File,
|
||||
generation: Int,
|
||||
nativeUserland: Boolean,
|
||||
sharedStorage: File?,
|
||||
stillCurrent: () -> Boolean,
|
||||
) {
|
||||
val prepared = Launch(ArrayList(guest), ArrayList(binds), sessionRoot, root, sessionDir, generation,
|
||||
DesktopCatalog.desktopInstalled(root), sharedStorage)
|
||||
val prepared = Launch(ArrayList(guest), ArrayList(binds), sessionRoot, hostEnvironment.copyOf(), root, sessionDir, generation,
|
||||
DesktopCatalog.desktopInstalled(root), nativeUserland, sharedStorage)
|
||||
synchronized(launchLock) { if (stillCurrent()) launch = prepared }
|
||||
}
|
||||
|
||||
@@ -320,9 +324,15 @@ object BottomDesktop {
|
||||
add("DD_IME_DIR=" + imeDir.path)
|
||||
add(SCRIPT)
|
||||
}
|
||||
val command = com.droiddeck.launcher.runtime.NativeGuest.command(current.root, guest.first(), guest.drop(1))
|
||||
val environment = com.droiddeck.launcher.runtime.NativeGuest.sessionEnvironment(current.root, binds, guest.first(), SessionPrefs.guestHostname(context))
|
||||
.map { (k, v) -> "$k=$v" }.toTypedArray()
|
||||
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, guest.first(), SessionPrefs.guestHostname(context))
|
||||
.map { (k, v) -> "$k=$v" }.toTypedArray()
|
||||
} else current.hostEnvironment
|
||||
val line = command.joinToString(" ") { it.replace("\\", "\\\\").replace(" ", "\\ ") }
|
||||
val pid = HostProcess.start(line, environment, current.root, { status ->
|
||||
main.post {
|
||||
@@ -333,7 +343,7 @@ object BottomDesktop {
|
||||
guestGeneration++
|
||||
setState(if (state == State.RUNNING || status == 0) State.ENDED else State.FAILED)
|
||||
}
|
||||
}, null, File(dir, "process.log"))
|
||||
}, null, File(dir, "proot.log"))
|
||||
main.post {
|
||||
if (generation != guestGeneration || launch !== current) {
|
||||
if (pid > 1) SessionService.stopTerminalProcess(context, pid)
|
||||
|
||||
@@ -217,7 +217,7 @@ object GraphicsReport {
|
||||
}
|
||||
if (guestLines.any { it.contains("MEM_EXEC_INIT") }) {
|
||||
appendLine("note: kbase refused KBASE_IOCTL_MEM_EXEC_INIT with EPERM. That answer comes from the kbase driver")
|
||||
appendLine(" itself (Android's seccomp would kill or return ENOSYS; SELinux")
|
||||
appendLine(" itself (proot does not filter ioctls; Android's seccomp would kill or return ENOSYS; SELinux")
|
||||
appendLine(" would return EACCES), so it is the kernel's policy for this context, not the session's.")
|
||||
}
|
||||
appendLine("-- driver lines from the session log (${guestLines.size})")
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.droiddeck.launcher.session
|
||||
|
||||
import java.io.File
|
||||
|
||||
/** Finds the processes a session left running, including processes reparented to init. */
|
||||
/** Finds the processes a session left running, also once proot is gone and they belong to init. */
|
||||
object GuestLeftovers {
|
||||
private const val MARKER = "DD_DEBUG_DIR="
|
||||
|
||||
@@ -15,6 +15,7 @@ object GuestLeftovers {
|
||||
parentOf(proc)?.let { parents[pid] = it }
|
||||
if (pid in skip) return@forEach
|
||||
val exe = runCatching { File(proc, "exe").canonicalPath }.getOrNull()
|
||||
// proot runs a guest through its loader, which is then the process's executable
|
||||
if (exe?.startsWith(rootfs) == true ||
|
||||
marker != null && carries(runCatching { File(proc, "environ").readBytes() }.getOrNull(), marker)) {
|
||||
matched.add(pid)
|
||||
|
||||
@@ -47,11 +47,12 @@ object ProtonExtras {
|
||||
Tool("ge", "GE-Proton", "GE-Proton", "GloriousEggroll/proton-ge-custom", Regex("aarch64\\.tar\\.(gz|xz)$")),
|
||||
Tool("cachyos", "proton-cachyos", "proton-cachyos", "CachyOS/proton-cachyos", Regex("arm64\\.tar\\.(gz|xz)$")),
|
||||
Tool("droiddeck", "DroidDeck-Proton", "DroidDeck-Proton", "Droid-Deck/DroidDeck-Proton", Regex("^DroidDeck-Proton-.*aarch64\\.tar\\.(gz|xz)$")),
|
||||
// Bionic (Android libc) Proton started outside the Linux userland; test builds are prereleases.
|
||||
// Bionic (Android libc) Proton started outside the Linux userland; test builds are prereleases. No-proot only.
|
||||
Tool(BIONIC, "DroidDeck-Bionic", "DroidDeck-Bionic", "Droid-Deck/DroidDeck-Proton", Regex("^DroidDeck-Bionic-.*aarch64\\.tar\\.(gz|xz)$"), prereleases = true),
|
||||
)
|
||||
|
||||
fun offered(context: Context): List<Tool> = tools.filter { it.id != BIONIC || LinuxRuntime.isInstalled(context) }
|
||||
/** The sources offered on this device: DroidDeck-Bionic only with Run without proot on. */
|
||||
fun offered(context: Context): List<Tool> = tools.filter { it.id != BIONIC || NativeGuest.enabled(context) }
|
||||
|
||||
private fun home(context: Context) = File(LinuxRuntime.rootDir(context), "root")
|
||||
private fun requests(context: Context) = File(home(context), ".dd-proton-extra")
|
||||
@@ -393,8 +394,20 @@ object ProtonExtras {
|
||||
internal fun guestProcess(context: Context, guest: List<String>): ProcessBuilder {
|
||||
val root = LinuxRuntime.rootDir(context)
|
||||
val runtimeDir = File(context.filesDir, ".proton-install-rt").apply { mkdirs() }
|
||||
return NativeGuest.processBuilder(context, root,
|
||||
LinuxRuntime.binds(context, null, runtimeDir, null, null), guest).redirectErrorStream(true)
|
||||
return 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 }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal fun releases(tool: Tool): JSONArray? = releases(tool) { page ->
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.droiddeck.launcher.session
|
||||
|
||||
/** A launch the user asked for that waits for something else to finish first, and is forgotten if it waits too long. */
|
||||
class QueuedLaunch<T : Any>(private val lifetimeMs: Long = 15 * 60_000L) {
|
||||
var launch: T? = null
|
||||
private set
|
||||
var queuedAt: Long = 0L
|
||||
private set
|
||||
|
||||
fun queue(launch: T, now: Long) {
|
||||
this.launch = launch
|
||||
queuedAt = now
|
||||
}
|
||||
|
||||
/** Takes back a saved launch with the time it was first queued; one without a valid time or past its lifetime is dropped. */
|
||||
fun restore(launch: T?, queuedAt: Long, now: Long) {
|
||||
if (launch != null && fresh(queuedAt, now)) {
|
||||
this.launch = launch
|
||||
this.queuedAt = queuedAt
|
||||
} else {
|
||||
clear()
|
||||
}
|
||||
}
|
||||
|
||||
/** The launch if it is still wanted; an expired one is cleared. */
|
||||
fun current(now: Long): T? {
|
||||
val queued = launch ?: return null
|
||||
if (fresh(queuedAt, now)) return queued
|
||||
clear()
|
||||
return null
|
||||
}
|
||||
|
||||
fun clear() {
|
||||
launch = null
|
||||
}
|
||||
|
||||
private fun fresh(queuedAt: Long, now: Long) = now - queuedAt in 0..lifetimeMs
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.droiddeck.launcher.session
|
||||
|
||||
/**
|
||||
* Starts a queued launch once nothing stands in its way and retries until it can or it expires. One runner belongs to one
|
||||
* activity: destroying it clears its queue and cancels its retry, so a restored activity is the only one that starts the launch.
|
||||
*/
|
||||
class QueuedLaunchRunner<T : Any>(
|
||||
private val queue: QueuedLaunch<T>,
|
||||
private val now: () -> Long,
|
||||
private val blocked: () -> Boolean,
|
||||
private val busy: () -> Boolean,
|
||||
private val schedule: (delayMs: Long, task: Runnable) -> Unit,
|
||||
private val unschedule: (Runnable) -> Unit,
|
||||
private val start: (T) -> Unit,
|
||||
private val retryMs: Long = 2_000L,
|
||||
) {
|
||||
private var posted = false
|
||||
private var retry: Runnable? = null
|
||||
private var destroyed = false
|
||||
|
||||
/** Call whenever the blocking setting may have changed. */
|
||||
fun poke() {
|
||||
if (destroyed || posted) return
|
||||
val launch = queue.current(now()) ?: return
|
||||
if (blocked()) return
|
||||
posted = true
|
||||
schedule(0L, Runnable {
|
||||
posted = false
|
||||
attempt(launch)
|
||||
})
|
||||
}
|
||||
|
||||
private fun attempt(launch: T) {
|
||||
if (destroyed || queue.current(now()) !== launch) return
|
||||
if (busy()) {
|
||||
val again = Runnable { if (!destroyed && queue.launch === launch) poke() }
|
||||
retry = again
|
||||
schedule(retryMs, again)
|
||||
return
|
||||
}
|
||||
queue.clear()
|
||||
start(launch)
|
||||
}
|
||||
|
||||
fun destroy() {
|
||||
destroyed = true
|
||||
queue.clear()
|
||||
retry?.let(unschedule)
|
||||
retry = null
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,7 @@ import com.droiddeck.launcher.runtime.BwrapSpawner
|
||||
import com.droiddeck.launcher.runtime.DesktopCatalog
|
||||
import com.droiddeck.launcher.runtime.LegacyNames
|
||||
import com.droiddeck.launcher.runtime.LinuxRuntime
|
||||
import com.droiddeck.launcher.runtime.ProotFastPath
|
||||
import java.io.File
|
||||
|
||||
object SessionFiles {
|
||||
@@ -120,15 +121,15 @@ object SessionFiles {
|
||||
"usr/local/bin/droiddeck-fex" to "usr/local/bin/droiddeck-fex",
|
||||
"libddsession.so" to "usr/local/lib/libddsession.so",
|
||||
"libfakeinput.so" to "usr/local/lib/libfakeinput.so",
|
||||
"libddfastpath.so" to "usr/local/lib/libddfastpath.so",
|
||||
"libddnatv-hook.so" to "usr/lib/libddnatv-hook.so",
|
||||
"libddaudit.so" to "usr/local/lib/libddaudit.so",
|
||||
"libssbs.so" to "usr/local/lib/libssbs.so",
|
||||
"usr/local/bin/droiddeck-session" to "usr/local/bin/droiddeck-session",
|
||||
"usr/local/bin/droiddeck-fonts" to "usr/local/bin/droiddeck-fonts",
|
||||
"usr/local/bin/droiddeck-agent" to "usr/local/bin/droiddeck-agent",
|
||||
"usr/local/bin/steam-compatibility" to "usr/local/bin/steam-compatibility",
|
||||
"usr/local/bin/droiddeck-clipboard" to "usr/local/bin/droiddeck-clipboard",
|
||||
"usr/local/bin/droiddeck-spawn" to "usr/local/bin/droiddeck-spawn",
|
||||
"usr/local/bin/droiddeck-log-writer" to "usr/local/bin/droiddeck-log-writer",
|
||||
"usr/local/bin/droiddeck-desktop-clipboard" to "usr/local/bin/droiddeck-desktop-clipboard",
|
||||
"usr/local/bin/droiddeck-gpu-window" to "usr/local/bin/droiddeck-gpu-window",
|
||||
"usr/local/bin/droiddeck-steam-install" to "usr/local/bin/droiddeck-steam-install",
|
||||
@@ -153,7 +154,6 @@ object SessionFiles {
|
||||
"usr/local/bin/droiddeck-desktop-bookmarks" to "usr/local/bin/droiddeck-desktop-bookmarks",
|
||||
"usr/local/bin/droiddeck-downloads" to "usr/local/bin/droiddeck-downloads",
|
||||
"usr/local/bin/droiddeck-root" to "usr/local/bin/droiddeck-root",
|
||||
"usr/local/bin/droiddeck-user" to "usr/local/bin/droiddeck-user",
|
||||
"usr/local/bin/droiddeck-text" to "usr/local/bin/droiddeck-text",
|
||||
"usr/local/bin/droiddeck-snapd" to "usr/local/bin/droiddeck-snapd",
|
||||
"usr/local/bin/droiddeck-emulators" to "usr/local/bin/droiddeck-emulators",
|
||||
@@ -338,25 +338,26 @@ object SessionFiles {
|
||||
if (!File(Environment.getExternalStorageDirectory(), NO_PAD_SWITCH).exists()) {
|
||||
preload.append("/usr/local/lib/libfakeinput.so\n")
|
||||
}
|
||||
com.droiddeck.launcher.runtime.NativeGuest.prepare(context, root)
|
||||
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())
|
||||
File(etc, "ld.so.preload.staged").delete()
|
||||
File(etc, "ld.so.preload").takeIf { it.isFile }?.let { legacy ->
|
||||
val managed = setOf("/usr/local/lib/libddsession.so", "/usr/local/lib/libfakeinput.so")
|
||||
val remaining = legacy.readLines().filterNot { it.trim() in managed || it.trim().endsWith("/libddfastpath.so") }
|
||||
if (remaining.all { it.isBlank() }) legacy.delete()
|
||||
else FileUtils.writeString(legacy, remaining.joinToString("\n", postfix = "\n"))
|
||||
val staged = File(etc, "ld.so.preload.staged")
|
||||
if (!FileUtils.writeString(staged, preload.toString())
|
||||
|| !staged.renameTo(File(etc, "ld.so.preload"))) {
|
||||
staged.delete()
|
||||
Log.e(TAG, "could not write ld.so.preload")
|
||||
}
|
||||
File(root, "usr/local/lib/libddfastpath.so").delete()
|
||||
File(root, "usr/local/lib/libddaudit.so").delete()
|
||||
|
||||
if (!FileUtils.writeString(File(etc, "steam-compatibility-label"), context.getString(R.string.steam_compat_label))) {
|
||||
Log.e(TAG, "could not write steam-compatibility-label")
|
||||
}
|
||||
writeCjkFontConfig(root, etc)
|
||||
writeSessionBusPolicy(etc)
|
||||
writeDesktopStrings(context, File(etc, "droiddeck").apply { mkdirs() })
|
||||
val droiddeckEtc = File(etc, "droiddeck").apply { mkdirs() }
|
||||
val stagedSocket = File(droiddeckEtc, "bwrap-socket.staged")
|
||||
@@ -879,24 +880,6 @@ object SessionFiles {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A session bus admits only its owner, and with droiddeck-user (the native hook's ordinary
|
||||
* user) a root process and a user's share the bus while the kernel sees one Android uid.
|
||||
*/
|
||||
private fun writeSessionBusPolicy(etc: File) {
|
||||
val xml = """<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN"
|
||||
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
|
||||
<busconfig>
|
||||
<policy context="default">
|
||||
<allow user="*"/>
|
||||
</policy>
|
||||
</busconfig>
|
||||
"""
|
||||
val conf = File(etc, "dbus-1/session.d/droiddeck-users.conf")
|
||||
conf.parentFile?.mkdirs()
|
||||
if (!FileUtils.writeString(conf, xml)) Log.e(TAG, "could not write the session bus policy")
|
||||
}
|
||||
|
||||
private fun writeCjkFontConfig(root: File, etc: File) {
|
||||
try {
|
||||
val confDir = File(etc, "fonts/conf.d").apply { mkdirs() }
|
||||
|
||||
@@ -63,24 +63,6 @@ object SessionPrefs {
|
||||
.takeIf { value -> orientationOptions.any { it.first == value } }
|
||||
?: ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE
|
||||
|
||||
fun orientation(context: Context, mode: String?): Int {
|
||||
val key = when (mode) {
|
||||
"steam", SessionService.MODE_STEAM, SessionService.MODE_RUN -> "orientation.steam"
|
||||
"desktop", SessionService.MODE_DESKTOP -> "orientation.desktop"
|
||||
else -> null
|
||||
} ?: return orientation(context)
|
||||
val stored = prefs(context).getInt(key, Int.MIN_VALUE)
|
||||
return if (stored == Int.MIN_VALUE) orientation(context)
|
||||
else stored.takeIf { value -> orientationOptions.any { it.first == value } } ?: orientation(context)
|
||||
}
|
||||
|
||||
fun setOrientation(context: Context, mode: String, orientation: Int) {
|
||||
require(mode == "steam" || mode == "desktop")
|
||||
require(orientationOptions.any { it.first == orientation })
|
||||
val key = if (mode == "steam") "orientation.steam" else "orientation.desktop"
|
||||
prefs(context).edit().putInt(key, orientation).apply()
|
||||
}
|
||||
|
||||
/** The session menu's width in dp the user dragged it to; null keeps the default. */
|
||||
fun drawerWidthDp(context: Context): Int? = prefs(context).getInt("drawerWidthDp", 0).takeIf { it > 0 }
|
||||
|
||||
@@ -93,19 +75,11 @@ object SessionPrefs {
|
||||
prefs(context).edit().putInt("orientation", orientation).apply()
|
||||
}
|
||||
|
||||
fun windowOrientation(context: Context, followScreen: Boolean, smallestWidthDp: Int, mode: String? = null): Int {
|
||||
val modeKey = when (mode) {
|
||||
"steam", SessionService.MODE_STEAM, SessionService.MODE_RUN -> "orientation.steam"
|
||||
"desktop", SessionService.MODE_DESKTOP -> "orientation.desktop"
|
||||
else -> null
|
||||
}
|
||||
val preferences = prefs(context)
|
||||
if (modeKey != null && preferences.contains(modeKey)) return orientation(context, mode)
|
||||
return if (followScreen && smallestWidthDp >= SessionDisplay.UNFOLDED_MIN_DP && !preferences.contains("orientation"))
|
||||
fun windowOrientation(context: Context, followScreen: Boolean, smallestWidthDp: Int): Int =
|
||||
if (followScreen && smallestWidthDp >= SessionDisplay.UNFOLDED_MIN_DP && !prefs(context).contains("orientation"))
|
||||
ActivityInfo.SCREEN_ORIENTATION_USER else orientation(context)
|
||||
}
|
||||
|
||||
fun portrait(context: Context, mode: String? = null): Boolean = when (orientation(context, mode)) {
|
||||
fun portrait(context: Context): Boolean = when (orientation(context)) {
|
||||
ActivityInfo.SCREEN_ORIENTATION_PORTRAIT -> true
|
||||
ActivityInfo.SCREEN_ORIENTATION_USER ->
|
||||
context.resources.configuration.orientation == android.content.res.Configuration.ORIENTATION_PORTRAIT
|
||||
@@ -519,17 +493,6 @@ object SessionPrefs {
|
||||
prefs(context).edit().putString("drawerPageHidden", keys.joinToString(",")).apply()
|
||||
}
|
||||
|
||||
fun drawerSections(context: Context): Map<String, Boolean> =
|
||||
idList(prefs(context).getString("drawerSections", null)).mapNotNull { entry ->
|
||||
val at = entry.lastIndexOf('=').takeIf { it > 0 } ?: return@mapNotNull null
|
||||
entry.substring(0, at) to (entry.substring(at + 1) == "1")
|
||||
}.toMap()
|
||||
|
||||
fun setDrawerSections(context: Context, sections: Map<String, Boolean>) {
|
||||
prefs(context).edit().putString("drawerSections", sections.entries.filter { ',' !in it.key }
|
||||
.joinToString(",") { "${it.key}=${if (it.value) 1 else 0}" }).apply()
|
||||
}
|
||||
|
||||
fun setNavTabHidden(context: Context, keys: Set<String>) {
|
||||
prefs(context).edit().putString("navTabHidden", keys.joinToString(",")).apply()
|
||||
}
|
||||
@@ -1129,11 +1092,22 @@ object SessionPrefs {
|
||||
prefs(context).edit().putBoolean("mountSharedStorage", on).apply()
|
||||
}
|
||||
|
||||
/** Whether the Plasma desktop, and so its apps and shells, runs as an ordinary user instead of root (native userland only). */
|
||||
fun desktopAsUser(context: Context): Boolean = prefs(context).getBoolean("desktopAsUser", false)
|
||||
fun prootNoSeccomp(context: Context): Boolean = prefs(context).getBoolean("prootNoSeccomp", false)
|
||||
|
||||
fun setDesktopAsUser(context: Context, on: Boolean) {
|
||||
prefs(context).edit().putBoolean("desktopAsUser", on).apply()
|
||||
fun setProotNoSeccomp(context: Context, on: Boolean) {
|
||||
prefs(context).edit().putBoolean("prootNoSeccomp", on).apply()
|
||||
}
|
||||
|
||||
fun nativeUserland(context: Context): Boolean = prefs(context).getBoolean("nativeUserland", true)
|
||||
|
||||
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) {
|
||||
prefs(context).edit().putBoolean("prootFastPath", on).apply()
|
||||
}
|
||||
|
||||
fun cursorComposite(context: Context): Boolean = prefs(context).getBoolean("cursorComposite", true)
|
||||
@@ -1142,6 +1116,10 @@ object SessionPrefs {
|
||||
prefs(context).edit().putBoolean("cursorComposite", on).apply()
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun allowStockProot(context: Context): Boolean =
|
||||
context.getExternalFilesDir(null)?.let { File(it, "droiddeck-stock-proot").isFile } == true
|
||||
|
||||
const val DEFAULT_GUEST_HOSTNAME = "DroidDeck"
|
||||
|
||||
@JvmStatic
|
||||
@@ -1829,15 +1807,16 @@ object SessionPrefs {
|
||||
|
||||
const val PIP_FPS = 30
|
||||
|
||||
fun compositorFpsLimit(mirrorRefreshLimit: Int, sessionLimit: Int = 0, pip: Boolean = false, hostCap: Int = 0): Int {
|
||||
val limit = listOf(mirrorRefreshLimit, sessionLimit, hostCap).filter { it > 0 }.minOrNull() ?: FPS_UNPACED
|
||||
fun compositorFpsLimit(mirrorRefreshLimit: Int, sessionLimit: Int = 0, pip: Boolean = false): Int {
|
||||
val limit = when {
|
||||
mirrorRefreshLimit <= 0 && sessionLimit <= 0 -> FPS_UNPACED
|
||||
mirrorRefreshLimit <= 0 -> sessionLimit
|
||||
sessionLimit <= 0 -> mirrorRefreshLimit
|
||||
else -> minOf(mirrorRefreshLimit, sessionLimit)
|
||||
}
|
||||
return if (pip && mirrorRefreshLimit <= 0 && (limit <= 0 || limit > PIP_FPS)) PIP_FPS else limit
|
||||
}
|
||||
|
||||
/** The per-app rate Android holds this window to (Game Mode's FPS override), or 0 when the panel's rate applies. */
|
||||
fun hostFrameCap(overrideHz: Float, panelHz: Float): Int =
|
||||
if (overrideHz > 1f && panelHz - overrideHz > 1f) Math.round(overrideHz) else 0
|
||||
|
||||
val upscalerChoices = listOf(
|
||||
2 to "Nearest", 0 to "Linear", 4 to "AMD FSR 1", 3 to "Snapdragon GSR",
|
||||
8 to "Snapdragon GSR (quality)", 7 to "NVIDIA NIS", 6 to "Sharpen only",
|
||||
@@ -2138,12 +2117,6 @@ object SessionPrefs {
|
||||
(resolutionChosen(context, SessionService.MODE_DESKTOP) || resolutionChosen(context, SessionService.MODE_DESKTOP, true))) SessionService.MODE_DESKTOP
|
||||
else prefMode(mode)
|
||||
|
||||
fun showGlassesShortcut(context: Context): Boolean = prefs(context).getBoolean("showGlassesShortcut", true)
|
||||
|
||||
fun setShowGlassesShortcut(context: Context, show: Boolean) {
|
||||
prefs(context).edit().putBoolean("showGlassesShortcut", show).apply()
|
||||
}
|
||||
|
||||
fun pipAutoEnter(context: Context): Boolean = prefs(context).getBoolean("pipAutoEnter", true)
|
||||
|
||||
fun setPipAutoEnter(context: Context, enabled: Boolean) {
|
||||
|
||||
@@ -47,6 +47,7 @@ import com.droiddeck.launcher.input.SteamControllerBle
|
||||
import com.droiddeck.launcher.runtime.BwrapSpawner
|
||||
import com.droiddeck.launcher.runtime.LinuxNetworkLinkComponent
|
||||
import com.droiddeck.launcher.runtime.LinuxRuntime
|
||||
import com.droiddeck.launcher.runtime.ProotFastPath
|
||||
import com.droiddeck.launcher.runtime.UserApps
|
||||
import com.droiddeck.launcher.wayland.WaylandCompositor
|
||||
import java.io.File
|
||||
@@ -522,6 +523,7 @@ class SessionService : Service() {
|
||||
val runtimeDir = File(filesDir, ".wayland-rt").apply { mkdirs() }
|
||||
killStragglers()
|
||||
val stillStarting = { gen == sessionGen && SessionState.running }
|
||||
val prootPack = LinuxRuntime.patchedProot(this) || AddonPack.PROOT.await(this, stillStarting)
|
||||
val directAudioPack = AddonPack.DIRECTAUDIO.await(this, stillStarting)
|
||||
val systemVulkan = SystemVulkanDriver.usesDefault(SessionPrefs.linuxDriver(this))
|
||||
val powerVrPack = !systemVulkan || (stillStarting() && AddonPack.POWERVR.await(this, stillStarting))
|
||||
@@ -542,6 +544,17 @@ class SessionService : Service() {
|
||||
Toast.makeText(this, R.string.session_directaudio_missing, Toast.LENGTH_LONG).show()
|
||||
}
|
||||
}
|
||||
if (!LinuxRuntime.patchedProot(this)) {
|
||||
if (LinuxRuntime.stockProotAllowed(this)) {
|
||||
Log.w(TAG, "proot: patched proot missing; droiddeck-stock-proot allows the rootfs copy")
|
||||
} else {
|
||||
val message = getString(R.string.session_proot_missing)
|
||||
Log.e(TAG, "$message (pack ready=$prootPack)")
|
||||
failSession(gen, "PROOT_MISSING", message, -1)
|
||||
stopSession(-1, gen)
|
||||
return
|
||||
}
|
||||
}
|
||||
val agentEnvironment = runCatching { com.droiddeck.launcher.agent.AgentEnv.beginSession(this) }
|
||||
.onFailure { Log.w(TAG, "agent environment skipped", it) }
|
||||
.getOrDefault(emptyList())
|
||||
@@ -590,6 +603,11 @@ class SessionService : Service() {
|
||||
return
|
||||
}
|
||||
val sessionLog = File(sessionDir, "session.log")
|
||||
val prootLine = "== proot: ${LinuxRuntime.prootBinary(this).path} (${LinuxRuntime.prootSource(this)})"
|
||||
Log.i(TAG, prootLine)
|
||||
runCatching { sessionLog.appendText(prootLine + "\n") }
|
||||
.onFailure { Log.w(TAG, "could not write the proot line to ${sessionLog.path}", it) }
|
||||
|
||||
Log.i(TAG, SessionEvents.step("gpu-clock-pin") { GpuClockPin.start(this) })
|
||||
Log.i(TAG, SessionEvents.step("thread-hints") { GameThreadHints.start(this) })
|
||||
|
||||
@@ -614,6 +632,7 @@ class SessionService : Service() {
|
||||
return
|
||||
}
|
||||
if (steamHere) guest.add("DD_EPIC_APP_ID=" + com.droiddeck.launcher.stores.epic.EpicClient.shortcutAppId)
|
||||
val fastPathAt = guest.size
|
||||
|
||||
val pulse = SessionEvents.step("audio") { startAudio(guest, sessionDir, directAudioPack) }
|
||||
SessionEvents.step("vk-bridge") { startVkBridge(guest, sessionDir) }
|
||||
@@ -642,7 +661,7 @@ class SessionService : Service() {
|
||||
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, SessionState.mode) == android.content.pm.ActivityInfo.SCREEN_ORIENTATION_USER)
|
||||
SessionPrefs.orientation(this) == android.content.pm.ActivityInfo.SCREEN_ORIENTATION_USER)
|
||||
guest.add("DD_FOLLOW_OUTPUT=1")
|
||||
if (SessionState.hdr) {
|
||||
guest.add("DD_HDR=1")
|
||||
@@ -686,25 +705,10 @@ class SessionService : Service() {
|
||||
if (com.droiddeck.launcher.gpu.Lossless.owned(this)) guest.add("DD_LOSSLESS_OWNED=1")
|
||||
}
|
||||
guest.add("DD_LAUNCH_DIR=" + sessionRoot.path)
|
||||
// this session's worker number: the shared field may be a newer session's by the time it is used
|
||||
var ownWorkers = 0
|
||||
if (com.droiddeck.launcher.runtime.GuestWorkers.enabled(this)) {
|
||||
// Under the lock a stop takes its number with: a stop either comes first (and this session
|
||||
// starts no workers) or owns them
|
||||
ownWorkers = synchronized(stopLock) {
|
||||
if (gen != sessionGen || !SessionState.running) 0
|
||||
else com.droiddeck.launcher.runtime.GuestWorkers.serve(this).also { guestWorkerSession = it }
|
||||
}
|
||||
if (ownWorkers > 0) {
|
||||
guest.add("DD_SPAWN=" + com.droiddeck.launcher.runtime.GuestWorkers.socketName(this))
|
||||
guest.add("DD_SPAWN_SESSION=$ownWorkers")
|
||||
}
|
||||
}
|
||||
// Proton builds up to 11.12 report X11 text fields under this name.
|
||||
guest.add("BL_LAUNCH_DIR=" + sessionRoot.path)
|
||||
GameStorage.effective(this)?.let { guest.add("DD_LIBRARY_LABEL=" + it.label.replace('"', ' ')) }
|
||||
if (SessionState.mode == MODE_STEAM && SessionState.steamUi == "desktop") guest.add("DD_STEAM_UI=desktop")
|
||||
if (SessionPrefs.desktopAsUser(this)) guest.add("DD_DESKTOP_USER=1")
|
||||
// Detailed graphics logs: per-game logs and the guest's Vulkan summary (a GPU that is not
|
||||
// an Adreno, or Setup's switch), and graphics-report.txt for every session.
|
||||
if (GraphicsReport.detailed(this)) guest.add("DD_GAME_LOGS=1")
|
||||
@@ -740,27 +744,63 @@ class SessionService : Service() {
|
||||
SessionEvents.step("shm-clear") { FileUtils.clear(File(LinuxRuntime.liveDir(this), "shm")) }
|
||||
|
||||
val sharedStorage = LinuxRuntime.sharedStorage(this)
|
||||
val binds = sessionBinds(controllersOn, fakeInputDir, sessionDir, guest, sharedStorage)
|
||||
if (!com.droiddeck.launcher.runtime.NativeGuest.available(root)) {
|
||||
val message = getString(R.string.session_native_missing)
|
||||
failSession(gen, "NATIVE_RUNTIME_MISSING", message, -1)
|
||||
stopSession(-1, gen)
|
||||
abandonStart(gen, sessionDir)
|
||||
return
|
||||
}
|
||||
val binds = sessionBinds(controllersOn, fakeInputDir, sessionDir, guest, sessionRoot, runtimeDir, sharedStorage)
|
||||
val nativeUserland = com.droiddeck.launcher.runtime.NativeGuest.enabled(this)
|
||||
synchronized(stopLock) {
|
||||
if (gen == sessionGen && SessionState.running) com.droiddeck.launcher.runtime.NativeGuest.sessionPrepared = true
|
||||
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, sharedStorage, binds,
|
||||
)
|
||||
val root = LinuxRuntime.rootDir(this)
|
||||
ProotFastPath.key(root, prootBinds)?.also { key ->
|
||||
val env = ProotFastPath.guestEnv(root, prootBinds, key)
|
||||
guest.addAll(fastPathAt, env)
|
||||
shellGuest.addAll(fastPathAt, env)
|
||||
Log.i(TAG, "proot: fast path on (${prootBinds.size} binds)")
|
||||
} ?: run {
|
||||
Log.w(TAG, "proot: fast path off - ${prootBinds.size} binds (it holds ${ProotFastPath.MAX_BINDS}) or a path it cannot be told")
|
||||
null
|
||||
}
|
||||
} else null
|
||||
|
||||
val sessionBindSpecs = LinuxRuntime.binds(this, sessionRoot, runtimeDir, sharedStorage, binds)
|
||||
LinuxRuntime.rememberSessionBinds(sessionBindSpecs)
|
||||
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, sharedStorage, binds, guest)
|
||||
}
|
||||
|
||||
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 { prootEnv[key] = it }
|
||||
}
|
||||
val prootLibs = LinuxRuntime.prootLibraryPath(this)
|
||||
if (prootLibs.isNotEmpty()) prootEnv["LD_LIBRARY_PATH"] = prootLibs
|
||||
|
||||
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 command = com.droiddeck.launcher.runtime.NativeGuest.command(root, guest.first(), guest.drop(1))
|
||||
val hostEnv = HostEnvironment().also { env ->
|
||||
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, guest.first(), 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, sharedStorage, binds, shellGuest)
|
||||
}
|
||||
val terminalCommand = com.droiddeck.launcher.runtime.NativeGuest.command(root, shellGuest.first(), shellGuest.drop(1))
|
||||
val terminalHostEnvironment = LinkedHashMap(System.getenv())
|
||||
hostEnv.asArray().forEach { entry ->
|
||||
val separator = entry.indexOf('=')
|
||||
@@ -768,7 +808,9 @@ class SessionService : Service() {
|
||||
}
|
||||
if (gen == sessionGen && SessionState.running) {
|
||||
SessionTerminal.prepare(terminalCommand, terminalHostEnvironment.map { (key, value) -> "$key=$value" }.toTypedArray(), root, gen)
|
||||
BottomDesktop.prepare(desktopGuest, binds, sessionRoot, root, sessionDir, gen, sharedStorage,
|
||||
val (fastPathName, _) = ProotFastPath.hostEnv("")
|
||||
BottomDesktop.prepare(desktopGuest, binds, sessionRoot,
|
||||
prootEnv.asArray().filterNot { it.startsWith("$fastPathName=") }.toTypedArray(), root, sessionDir, gen, nativeUserland, sharedStorage,
|
||||
) { gen == sessionGen && SessionState.running }
|
||||
}
|
||||
|
||||
@@ -821,15 +863,15 @@ class SessionService : Service() {
|
||||
watchLaunchRequests(sessionRoot)
|
||||
watchSyncWanted(root)
|
||||
EsyncPacks.fetchInBackground(this, root)
|
||||
val pid = SessionEvents.step("guest-launch") { HostProcess.startUncounted(line, hostEnv.asArray(), root, { status ->
|
||||
val pid = SessionEvents.step("guest-launch") { HostProcess.start(line, hostEnv.asArray(), root, { status ->
|
||||
if (gen != sessionGen) {
|
||||
Log.i(TAG, "an earlier session's process ended ($status); the current one carries on")
|
||||
return@startUncounted
|
||||
return@start
|
||||
}
|
||||
val program = programStatus(sessionRoot)
|
||||
Log.i(TAG, "session ended: $status" + if (program != null) " (program $program)" else "")
|
||||
stopSession(program ?: status ?: -1, gen)
|
||||
}, null, null) }
|
||||
}, null, sessionLog.takeIf { "PROOT_PROFILE=1" in hostEnv.asArray() }) }
|
||||
Log.i(TAG, "session pid $pid, log ${sessionLog.path}")
|
||||
if (gen != sessionGen || !SessionState.running) {
|
||||
Log.i(TAG, "session stopped while its guest was starting; taking it down")
|
||||
@@ -840,21 +882,12 @@ class SessionService : Service() {
|
||||
syncWatcher = null
|
||||
}
|
||||
abandonStart(gen, sessionDir, started)
|
||||
val workers = ownWorkers
|
||||
if (pid > 1) Thread({ teardown(pid, workerSession = workers) }, "session-teardown").start()
|
||||
else com.droiddeck.launcher.runtime.GuestWorkers.stopGuests(workers)
|
||||
if (pid > 1) Thread({ teardown(pid) }, "session-teardown").start()
|
||||
return
|
||||
}
|
||||
sessionPid = pid
|
||||
// Under the lock Stop clears it with, and only while this session still runs: a Stop since the
|
||||
// check above has cleared it already, and this would set it again for no running session.
|
||||
val uncounted = com.droiddeck.launcher.runtime.GuestWorkers.runsInWorker(pid)
|
||||
SessionEvents.record("guest.worker", mapOf("handoff" to uncounted))
|
||||
synchronized(stopLock) {
|
||||
if (gen == sessionGen && SessionState.running)
|
||||
com.droiddeck.launcher.runtime.GuestWorkers.sessionRootUncounted = uncounted
|
||||
}
|
||||
if (pid > 1) {
|
||||
raiseTracer(pid, gen)
|
||||
SessionEvents.guestStarted(pid)
|
||||
} else {
|
||||
SessionEvents.record("guest.start_failed", mapOf("pid" to pid))
|
||||
@@ -1223,6 +1256,8 @@ class SessionService : Service() {
|
||||
fakeInputDir: File,
|
||||
sessionDir: File,
|
||||
guest: MutableList<String>,
|
||||
sessionRoot: File,
|
||||
runtimeDir: File,
|
||||
sharedStorage: File?,
|
||||
): ArrayList<String> {
|
||||
val binds = ArrayList<String>()
|
||||
@@ -1350,6 +1385,9 @@ class SessionService : Service() {
|
||||
if (storageDiagnosticLibrary != null && library != null) libraries.add(SecondaryLibrary.CARD_GUESTS[0] to library.label)
|
||||
val gamesLibraries = GameStorage.gamesFolderLibraries(this)
|
||||
if (gamesLibraries.isNotEmpty()) {
|
||||
var room = if (ProotFastPath.enabled(this)) {
|
||||
ProotFastPath.MAX_BINDS - LinuxRuntime.binds(this, sessionRoot, runtimeDir, sharedStorage, binds).size
|
||||
} else Int.MAX_VALUE
|
||||
for (games in gamesLibraries) {
|
||||
if (games.host.path + ":" + games.guest !in binds) continue
|
||||
val problem = GameStorage.prepare(this, games.host.path)
|
||||
@@ -1359,7 +1397,12 @@ class SessionService : Service() {
|
||||
}
|
||||
try {
|
||||
val extra = SecondaryLibrary.binds(filesDir, games.host, listOf(games.guest)).drop(1)
|
||||
if (extra.size > room) {
|
||||
Log.w(TAG, "steam library: ${games.host} needs ${extra.size} binds, $room left for the fast path; not a library this session")
|
||||
continue
|
||||
}
|
||||
binds.addAll(extra)
|
||||
room -= extra.size
|
||||
libraries.add(games.guest to games.label)
|
||||
Log.i(TAG, "steam library: ${games.host} -> ${games.guest} (\"${games.label}\")")
|
||||
} catch (e: Exception) {
|
||||
@@ -1384,8 +1427,15 @@ class SessionService : Service() {
|
||||
continue
|
||||
}
|
||||
try {
|
||||
val room = if (ProotFastPath.enabled(this)) {
|
||||
ProotFastPath.MAX_BINDS - LinuxRuntime.binds(this, sessionRoot, runtimeDir, sharedStorage, binds).size
|
||||
} else Int.MAX_VALUE
|
||||
val content = SecondaryLibrary.contentPath(entry.host)
|
||||
val extra = SecondaryLibrary.binds(filesDir, entry.host, listOf(entry.guest), content = content)
|
||||
if (extra.size > room) {
|
||||
Log.w(TAG, "added steam library: ${entry.path} needs ${extra.size} binds, $room left for the fast path; not a library this session")
|
||||
continue
|
||||
}
|
||||
File(LinuxRuntime.rootDir(this), entry.guest.removePrefix("/")).mkdirs()
|
||||
binds.addAll(extra)
|
||||
libraries.add(entry.guest to entry.label)
|
||||
@@ -1406,10 +1456,17 @@ class SessionService : Service() {
|
||||
if (problem != null) {
|
||||
Log.w(TAG, "x86-64 steam library: $problem")
|
||||
} else try {
|
||||
val room = if (ProotFastPath.enabled(this)) {
|
||||
ProotFastPath.MAX_BINDS - LinuxRuntime.binds(this, sessionRoot, runtimeDir, sharedStorage, binds).size
|
||||
} else Int.MAX_VALUE
|
||||
val extra = SecondaryLibrary.binds(filesDir, x64, listOf(GameStorage.X64_CARD_GUEST)).drop(1)
|
||||
binds.addAll(extra)
|
||||
x64Libraries.put(org.json.JSONObject().put("path", GameStorage.X64_CARD_GUEST).put("label", library.label.replace('"', ' ').replace('\\', ' ')))
|
||||
Log.i(TAG, "x86-64 steam library: $x64 -> ${GameStorage.X64_CARD_GUEST} (\"${library.label}\")")
|
||||
if (extra.size > room) {
|
||||
Log.w(TAG, "x86-64 steam library: $x64 needs ${extra.size} binds, $room left for the fast path; not a library this session")
|
||||
} else {
|
||||
binds.addAll(extra)
|
||||
x64Libraries.put(org.json.JSONObject().put("path", GameStorage.X64_CARD_GUEST).put("label", library.label.replace('"', ' ').replace('\\', ' ')))
|
||||
Log.i(TAG, "x86-64 steam library: $x64 -> ${GameStorage.X64_CARD_GUEST} (\"${library.label}\")")
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, "x86-64 steam library: $x64 private directories could not be prepared", e)
|
||||
}
|
||||
@@ -1421,7 +1478,14 @@ class SessionService : Service() {
|
||||
continue
|
||||
}
|
||||
try {
|
||||
val room = if (ProotFastPath.enabled(this)) {
|
||||
ProotFastPath.MAX_BINDS - LinuxRuntime.binds(this, sessionRoot, runtimeDir, sharedStorage, binds).size
|
||||
} else Int.MAX_VALUE
|
||||
val extra = SecondaryLibrary.binds(filesDir, entry.x64Host, listOf(entry.x64Guest)).drop(1)
|
||||
if (extra.size > room) {
|
||||
Log.w(TAG, "x86-64 steam library: ${entry.x64Host} needs ${extra.size} binds, $room left for the fast path; not a library this session")
|
||||
continue
|
||||
}
|
||||
binds.addAll(extra)
|
||||
x64Libraries.put(org.json.JSONObject().put("path", entry.x64Guest).put("label", entry.label))
|
||||
} catch (e: Exception) {
|
||||
@@ -1450,11 +1514,15 @@ class SessionService : Service() {
|
||||
try {
|
||||
val listing = File(filesDir, "session/desktop-volumes.json").apply { parentFile?.mkdirs() }
|
||||
val volumes = org.json.JSONArray()
|
||||
var room = if (ProotFastPath.enabled(this)) {
|
||||
ProotFastPath.MAX_BINDS - LinuxRuntime.binds(this, sessionRoot, runtimeDir, sharedStorage, binds).size
|
||||
} else Int.MAX_VALUE
|
||||
for (root in com.droiddeck.launcher.files.StorageRoots.list(this)) {
|
||||
if (!root.removable || !root.readable) continue
|
||||
val path = root.dir.absolutePath
|
||||
if (':' in path || '|' in path) continue
|
||||
if (':' in path || '|' in path || room <= 0) continue
|
||||
binds.add(path)
|
||||
room--
|
||||
volumes.put(org.json.JSONObject().put("path", path).put("label", root.label))
|
||||
}
|
||||
listing.writeText(volumes.toString())
|
||||
@@ -1467,22 +1535,17 @@ class SessionService : Service() {
|
||||
return binds
|
||||
}
|
||||
|
||||
// The workers' session number of the session running now (GuestWorkers.serve)
|
||||
@Volatile private var guestWorkerSession = 0
|
||||
|
||||
private fun teardown(guestPid: Int, expectedStartTime: Long? = null, workerSession: Int = guestWorkerSession) {
|
||||
fun stillSameProcess(): Boolean = expectedStartTime == null || readStat(guestPid)?.second == expectedStartTime
|
||||
private fun teardown(prootPid: Int, expectedStartTime: Long? = null) {
|
||||
fun stillSameProcess(): Boolean = expectedStartTime == null || readStat(prootPid)?.second == expectedStartTime
|
||||
if (!stillSameProcess()) return
|
||||
// The session's programs that run in worker processes are not descendants of its root.
|
||||
val workers = if (expectedStartTime == null) com.droiddeck.launcher.runtime.GuestWorkers.guestPids(workerSession) else emptyList()
|
||||
val tree = descendants(guestPid) + workers.flatMap { pid -> listOfNotNull(readStat(pid)?.let { Pair(pid, it.second) }) + descendants(pid) }
|
||||
val tree = descendants(prootPid)
|
||||
if (!stillSameProcess()) return
|
||||
saveWineRegistries(tree)
|
||||
android.os.Process.sendSignal(guestPid, 15)
|
||||
if (!waitForExit(guestPid, GRACE_MS)) {
|
||||
android.os.Process.sendSignal(prootPid, 15)
|
||||
if (!waitForExit(prootPid, GRACE_MS)) {
|
||||
if (!stillSameProcess()) return
|
||||
Log.w(TAG, "guest $guestPid did not exit on SIGTERM; killing it")
|
||||
android.os.Process.killProcess(guestPid)
|
||||
Log.w(TAG, "proot $prootPid did not exit on SIGTERM; killing it")
|
||||
android.os.Process.killProcess(prootPid)
|
||||
}
|
||||
var killed = 0
|
||||
for ((pid, started) in tree) {
|
||||
@@ -1491,8 +1554,7 @@ class SessionService : Service() {
|
||||
android.os.Process.killProcess(pid)
|
||||
killed++
|
||||
}
|
||||
if (killed > 0) Log.i(TAG, "swept $killed guest process(es)")
|
||||
if (expectedStartTime == null) com.droiddeck.launcher.runtime.GuestWorkers.stopGuests(workerSession)
|
||||
if (killed > 0) Log.i(TAG, "swept $killed process(es) proot left behind")
|
||||
}
|
||||
|
||||
private fun clearCachedApps() {
|
||||
@@ -1552,8 +1614,8 @@ class SessionService : Service() {
|
||||
return try { Pair(fields[1].toInt(), fields[19].toLong()) } catch (e: NumberFormatException) { null }
|
||||
}
|
||||
|
||||
private fun askSteamToExit(guestPid: Int) {
|
||||
if (!File("/proc/$guestPid").exists()) return
|
||||
private fun askSteamToExit(prootPid: Int) {
|
||||
if (!File("/proc/$prootPid").exists()) return
|
||||
val request = File(LinuxRuntime.sessionRoot(this), "steam-stop")
|
||||
try {
|
||||
request.writeText("")
|
||||
@@ -1562,11 +1624,11 @@ class SessionService : Service() {
|
||||
return
|
||||
}
|
||||
val started = System.currentTimeMillis()
|
||||
if (waitForExit(guestPid, STEAM_PICKUP_MS) || request.exists()) {
|
||||
if (waitForExit(prootPid, STEAM_PICKUP_MS) || request.exists()) {
|
||||
request.delete()
|
||||
return
|
||||
}
|
||||
val exited = waitForExit(guestPid, STEAM_EXIT_MS)
|
||||
val exited = waitForExit(prootPid, STEAM_EXIT_MS)
|
||||
Log.i(TAG, "Steam client ${if (exited) "exited" else "did not exit"} after ${System.currentTimeMillis() - started} ms")
|
||||
}
|
||||
|
||||
@@ -1667,7 +1729,6 @@ class SessionService : Service() {
|
||||
SessionEvents.record("steam.game_launch_requested", mapOf("gameId" to gameId, "generation" to gen))
|
||||
watchGameExit(gameId, gen, exitWatchToken, pendingSteamPreviousGameId)
|
||||
Log.i(TAG, "queued Steam game $gameId for the running client")
|
||||
com.droiddeck.launcher.runtime.GuestWorkers.expectLaunch(this)
|
||||
}
|
||||
|
||||
private fun watchGameExit(
|
||||
@@ -1845,7 +1906,7 @@ class SessionService : Service() {
|
||||
val rootfs = try { File(filesDir, "linuxfs").canonicalPath } catch (e: Exception) { return } + "/"
|
||||
val leftovers = GuestLeftovers.find(rootfs, ended, OrphanReaper.spared() + android.os.Process.myPid())
|
||||
leftovers.forEach { android.os.Process.killProcess(it) }
|
||||
if (leftovers.isNotEmpty()) Log.w(TAG, "killed ${leftovers.size} guest process(es)")
|
||||
if (leftovers.isNotEmpty()) Log.w(TAG, "killed ${leftovers.size} guest process(es) proot no longer tracked")
|
||||
}
|
||||
|
||||
private fun killStragglers() {
|
||||
@@ -2234,6 +2295,24 @@ class SessionService : Service() {
|
||||
}
|
||||
}
|
||||
|
||||
private fun raiseTracer(pid: Int, gen: Int) {
|
||||
Thread({
|
||||
try {
|
||||
Thread.sleep(2000)
|
||||
} catch (e: InterruptedException) {
|
||||
return@Thread
|
||||
}
|
||||
if (gen != sessionGen || sessionPid != pid) return@Thread
|
||||
val nice = try {
|
||||
WaylandCompositor.nativeRaisePriority(pid, TRACER_NICE)
|
||||
} catch (t: Throwable) {
|
||||
Log.w(TAG, "tracer priority", t)
|
||||
return@Thread
|
||||
}
|
||||
Log.i(TAG, "proot tracer $pid: nice $nice (asked for $TRACER_NICE)")
|
||||
}, "tracer-priority").start()
|
||||
}
|
||||
|
||||
private fun failSession(gen: Int, code: String, message: String, status: Int?) {
|
||||
synchronized(stopLock) {
|
||||
if (gen == sessionGen) SessionEvents.fail(code, message, status)
|
||||
@@ -2246,16 +2325,12 @@ class SessionService : Service() {
|
||||
return
|
||||
}
|
||||
completeNativeSleep()
|
||||
var workers = 0
|
||||
val (ended, endedArch) = synchronized(stopLock) {
|
||||
if (gen != null && gen != sessionGen) return
|
||||
// as it is when running is cleared: startup registers its workers under this lock too
|
||||
workers = guestWorkerSession
|
||||
cancelQueuedSteamGame()
|
||||
gameExitWatchToken++
|
||||
// also when startup stopped before the guest ran
|
||||
com.droiddeck.launcher.runtime.NativeGuest.sessionPrepared = false
|
||||
com.droiddeck.launcher.runtime.GuestWorkers.sessionRootUncounted = null
|
||||
com.droiddeck.launcher.runtime.NativeGuest.sessionMode = null
|
||||
if (!SessionState.running) return
|
||||
if (relaunch) SessionState.confirmRelaunchStop()
|
||||
SessionEvents.record("guest.exited", mapOf("status" to status))
|
||||
@@ -2283,7 +2358,7 @@ class SessionService : Service() {
|
||||
launchWatcher = null
|
||||
syncWatcher?.stopWatching()
|
||||
syncWatcher = null
|
||||
val guestPid = sessionPid
|
||||
val prootPid = sessionPid
|
||||
sessionPid = -1
|
||||
// The kept shell goes through the same teardown, which reads its descendants before signalling it.
|
||||
val shell = SessionTerminal.detach(sessionGen)?.let { pid -> readStat(pid)?.second?.let { pid to it } }
|
||||
@@ -2311,13 +2386,12 @@ class SessionService : Service() {
|
||||
com.droiddeck.launcher.input.SteamTouchDevice.release()
|
||||
val steamClientMayRun = SessionState.mode == MODE_STEAM || SessionState.mode == MODE_DESKTOP
|
||||
val finishAfterTeardown: () -> Unit = {
|
||||
if (guestPid > 1 || auxiliary.isNotEmpty()) {
|
||||
if (prootPid > 1 || auxiliary.isNotEmpty()) {
|
||||
Thread({
|
||||
if (guestPid > 1 && steamClientMayRun) askSteamToExit(guestPid)
|
||||
if (prootPid > 1 && steamClientMayRun) askSteamToExit(prootPid)
|
||||
com.droiddeck.launcher.stores.gog.GogComet.end(stoppedSession)
|
||||
auxiliary.forEach { (pid, started) -> teardown(pid, started) }
|
||||
if (guestPid > 1) teardown(guestPid, workerSession = workers)
|
||||
else com.droiddeck.launcher.runtime.GuestWorkers.stopGuests(workers)
|
||||
if (prootPid > 1) teardown(prootPid)
|
||||
killGuestLeftovers(ended)
|
||||
pruneSystemVulkanRuntime()
|
||||
finishSessionStop(status, stoppedGen, collectEnded)
|
||||
@@ -2326,14 +2400,13 @@ class SessionService : Service() {
|
||||
} else {
|
||||
Thread({ pruneSystemVulkanRuntime() }, "system-vulkan-prune").start()
|
||||
Thread({
|
||||
com.droiddeck.launcher.runtime.GuestWorkers.stopGuests(workers)
|
||||
com.droiddeck.launcher.stores.gog.GogComet.end(stoppedSession)
|
||||
finishSessionStop(status, stoppedGen, collectEnded)
|
||||
if (launcherEnded) importLauncherGames()
|
||||
}, "gog-session-stop").start()
|
||||
}
|
||||
}
|
||||
if (guestPid > 1) acquireLocks()
|
||||
if (prootPid > 1) acquireLocks()
|
||||
if (controller != null) controller.closeAndResume(finishAfterTeardown) else finishAfterTeardown()
|
||||
}
|
||||
|
||||
@@ -2577,6 +2650,7 @@ class SessionService : Service() {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "SessionService"
|
||||
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_PREFIX = "DROIDDECK_GAME_"
|
||||
@@ -2616,7 +2690,7 @@ class SessionService : Service() {
|
||||
private const val ACTION_AUXILIARY_EXITED = "com.droiddeck.launcher.AUXILIARY_EXITED"
|
||||
private const val EXTRA_AUXILIARY_PID = "auxiliaryPid"
|
||||
private val STRAGGLERS = listOf("droiddeck-session", "gamescope", "Xwayland", "steamrtarm64",
|
||||
"steamwebhelper", "pulseaudio/libpulseaudio.so")
|
||||
"steamwebhelper", "linuxfs/opt/android-host/proot", "/libproot.so", "pulseaudio/libpulseaudio.so")
|
||||
private const val GRACE_MS = 1200L
|
||||
private const val WINE_SAVE_MS = 3000L
|
||||
private const val STEAM_PICKUP_MS = 1500L
|
||||
|
||||
@@ -18,11 +18,11 @@ object SettingsReset {
|
||||
"storesInstallLanguage",
|
||||
"hud", "hudDeck", "hudFps", "hudBattery", "hudGraph", "hudColor", "hudOpacity", "__KEEP_droidDeckHud__", "__KEEP_droidDeckHudPos__", "backHold", "dockedMenuController", "backActionsInverted", "backDoubleTapMs", "touch", "pen", "penButton", "osc", "shape", "steamController",
|
||||
"gamepadLeft", "gamepadRight", "pipAutoEnter", "unfoldedControls", "unfoldedControlsWithController",
|
||||
"stretch16x9", "avoidNotch", "picturePosition", "integerScaling", "railLabels", "developerTools", "navTabOrder", "navTabShelved", "navTabHidden", "drawerPageOrder", "drawerPageHidden", "drawerSections", "pcKeyboardSize", "pcKeyboardOpacity", "pcKeyboardHiddenKeys",
|
||||
"stretch16x9", "avoidNotch", "picturePosition", "integerScaling", "railLabels", "developerTools", "navTabOrder", "navTabShelved", "navTabHidden", "drawerPageOrder", "drawerPageHidden", "pcKeyboardSize", "pcKeyboardOpacity", "pcKeyboardHiddenKeys",
|
||||
"gpuDriverMode", "androidDriver", "linuxDriver", "linuxDriver.steam", "linuxDriver.desktop",
|
||||
"tuSysmem", "glThread", "noGlError", "zinkLazy", "mangoapp", "gpuClockPin", "gamescopeRealtime", "paceCores",
|
||||
"directAudio", "mic", "wifiDiscovery", "clientCpusOverride", "clientCpus", "gameCpus",
|
||||
"noXalia", "fastSync", "fsyncFirst", "syncFallback", "cursorComposite", "mountSharedStorage",
|
||||
"noXalia", "fastSync", "fsyncFirst", "syncFallback", "prootNoSeccomp", "prootFastPath", "nativeUserland", "cursorComposite", "mountSharedStorage",
|
||||
"guestHostname", "fexPreset", "forceSsbs", "logs", "gameDebugLogsEnabled", "enhancedDiagnosticsNext", "storageDiagnostics", "buildWatermark",
|
||||
"upscaler", "upscaleSharpness", "screenEffects", "blackFrameInsertion", "textureAnisotropy", "textureLodBias",
|
||||
"steamDownloadsInBackground", "steam_offline", "steam_offline_auto", "steam_offline_by_network", "bootMovie", "bootMovieSound", "bootMovieVolume", "bootMovieSeconds", "skipBootMovie",
|
||||
|
||||
@@ -12,6 +12,8 @@ import org.json.JSONObject
|
||||
/** Steam libraries the user added beside the internal one and the card library, each a folder of its own. */
|
||||
object SteamLibraries {
|
||||
const val GUEST_ROOT = "/mnt/droiddeck-lib"
|
||||
// Each library costs a bind per redirected tool and prefix folder; the PRoot fast path holds 256 in all.
|
||||
const val MAX = 4
|
||||
private val lock = Any()
|
||||
|
||||
class Entry(val id: String, val path: String, val label: String) {
|
||||
@@ -50,6 +52,7 @@ object SteamLibraries {
|
||||
|
||||
fun add(context: Context, picked: String, label: String? = null): AddResult {
|
||||
val entries = list(context)
|
||||
if (entries.size >= MAX) return AddResult.Refused(context.getString(R.string.libraries_full, MAX))
|
||||
val path = innerLibrary(File(picked))?.path ?: picked
|
||||
val host = canonical(File(path))
|
||||
if (taken(context, entries).any { overlaps(it, host) }) return AddResult.Refused(context.getString(R.string.libraries_overlap))
|
||||
@@ -58,6 +61,7 @@ object SteamLibraries {
|
||||
GameStorage.prepare(context, path)?.let { return AddResult.Refused(it) }
|
||||
synchronized(lock) {
|
||||
val current = list(context)
|
||||
if (current.size >= MAX) return AddResult.Refused(context.getString(R.string.libraries_full, MAX))
|
||||
if (current.any { overlaps(canonical(it.host), host) }) return AddResult.Refused(context.getString(R.string.libraries_overlap))
|
||||
// A removed library's mount stays registered with Steam until its next session, so ids are never reused.
|
||||
val next = maxOf(SessionPrefs.steamLibraryNextId(context), (current.maxOfOrNull { it.id.toInt() } ?: 0) + 1)
|
||||
|
||||
@@ -10,23 +10,9 @@ import java.io.File
|
||||
// browser view placed outside the Big Picture window, composition capped at "notification" so gamescope keeps the game
|
||||
// focused, and gamepad focus on the main UI. The hold is a lease the app renews, so Steam recovers if the app goes away.
|
||||
object SteamQam {
|
||||
/** [mainPath] is Steam's main menu page, shown beside the quick access menu in the split layout. */
|
||||
data class Target(val port: Int, val path: String, val mainPath: String? = null)
|
||||
data class Target(val port: Int, val path: String)
|
||||
|
||||
const val MAIN_MENU = 1
|
||||
const val QUICK_ACCESS = 2
|
||||
|
||||
/** Height in CSS pixels both menus are laid out at in the split layout, so they show at one scale. */
|
||||
const val SPLIT_CSS_HEIGHT = 480
|
||||
|
||||
/** Steam's own width for the main menu; quick access takes the rest of the panel. */
|
||||
const val MAIN_CSS_WIDTH = 240
|
||||
|
||||
/** Holds the parked main menu in place and spreads its item rows (not dividers) over the full height, at most 80 px each. */
|
||||
private const val MAIN_PARKED_CSS =
|
||||
".BasicUI > .Panel { transform: none !important; width: 100% !important; height: 100% !important; margin: 0 !important; } " +
|
||||
".BasicUI > .Panel > :has(> .Focusable) { flex: 1 1 0 !important; height: auto !important; max-height: 80px; } " +
|
||||
".BasicUI > .Panel > :has(> .Focusable) > .Panel { height: 100% !important; }"
|
||||
const val LEASE_MS = 5_000
|
||||
private const val TAG = "SteamQam"
|
||||
private const val EVAL_MS = 6_000L
|
||||
@@ -40,54 +26,21 @@ object SteamQam {
|
||||
* Takes or renews the lease for [owner], or releases it. A live lease held by a newer panel is never taken back by an
|
||||
* older one, so a late request from a panel being torn down cannot end its replacement's lease or change its layout.
|
||||
*/
|
||||
internal fun leaseScript(on: Boolean, owner: Long, aspect: Float = 0f, split: Boolean = false): String =
|
||||
internal fun leaseScript(on: Boolean, owner: Long, aspect: Float = 0f): String =
|
||||
if (on) "if (!(g.__ddQamUntil > Date.now()) || !(g.__ddQamOwner > $owner)) { g.__ddQamOwner = $owner; g.__ddQamUntil = Date.now() + $LEASE_MS;" +
|
||||
(if (aspect > 0f) " g.__ddQamAspect = $aspect;" else "") + " g.__ddQamSplit = $split; }"
|
||||
(if (aspect > 0f) " g.__ddQamAspect = $aspect;" else "") + " }"
|
||||
else "if (g.__ddQamOwner === $owner) g.__ddQamUntil = 0;"
|
||||
|
||||
/**
|
||||
* [aspect] is the panel's width over height: the menu is laid out at that shape so every tab shows at one scale. With
|
||||
* [split], Steam's main menu is kept rendered at its own width beside the quick access menu, which gets the rest.
|
||||
*/
|
||||
internal fun script(on: Boolean, aspect: Float = 0f, owner: Long = 0, split: Boolean = false): String = """(() => {
|
||||
const g = globalThis, QAM = 2, MAIN = 1;
|
||||
/** [aspect] is the panel's width over height: the menu is laid out at that shape so every tab shows at one scale. */
|
||||
internal fun script(on: Boolean, aspect: Float = 0f, owner: Long = 0): String = """(() => {
|
||||
const g = globalThis, QAM = 2;
|
||||
const W = SteamUIStore.WindowStore.SteamUIWindows[0];
|
||||
const m = W.MenuStore, c = W.m_CompositionStateStore;
|
||||
const nav = W.m_FocusNavContext;
|
||||
const popup = g_PopupManager.GetExistingPopup("SP BPM_uid0");
|
||||
const held = () => g.__ddQamUntil > Date.now();
|
||||
const split = () => held() && g.__ddQamSplit === true;
|
||||
// Steam's views carry no names: the main menu's is the one Steam focuses while the main menu is open. Until Steam
|
||||
// has shown it, the main menu is opened once with its view parked like the quick access menu's.
|
||||
const probing = () => g.__ddMainProbe > Date.now();
|
||||
const ours = () => held() && !g.__ddQamTop && (m.m_eOpenSideMenu === QAM || (probing() && m.m_eOpenSideMenu === MAIN));
|
||||
const ours = () => held() && m.m_eOpenSideMenu === QAM && !g.__ddQamTop;
|
||||
const width = (h) => g.__ddQamAspect > 0 ? Math.round(h * g.__ddQamAspect) : 0;
|
||||
const parkX = () => popup.m_popup.innerWidth + 64;
|
||||
const mainSize = () => [$MAIN_CSS_WIDTH, $SPLIT_CSS_HEIGHT];
|
||||
const qamSplitSize = () => [Math.max(Math.round($SPLIT_CSS_HEIGHT * (g.__ddQamAspect > 0 ? g.__ddQamAspect : 1)) - $MAIN_CSS_WIDTH, 320), $SPLIT_CSS_HEIGHT];
|
||||
const size = (w, h) => split() ? qamSplitSize() : [width(h) || w, h];
|
||||
const mainView = () => views().find(v => v.__ddMain);
|
||||
// Only the quick access view is parked: the one Steam focuses while quick access is open. Before Steam has
|
||||
// focused it, any view but the main menu's and the header's web page (Store and other pages) may be it.
|
||||
const headerView = () => W.m_HeaderStore?.m_currentBrowserAndBackstack?.m_browserView;
|
||||
const isQam = (v) => !v.__ddMain && v !== headerView() &&
|
||||
(!!v.__ddQamView || !views().some(o => o.__ddQamView) || (probing() && m.m_eOpenSideMenu === MAIN));
|
||||
const mainParked = () => split() && (m.m_eOpenSideMenu !== MAIN || probing());
|
||||
const mainDoc = () => {
|
||||
for (const s of SteamUIStore.m_GamepadNavigationManager?.m_rgGamepadInputSources || []) {
|
||||
try { const d = s.m_targetWindow?.document; if (d?.title?.startsWith("MainMenu")) return d; } catch (e) {}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
// Steam slides the main menu out whenever it is not the open side menu; parked, it stays in place and fills its view.
|
||||
const mainStyle = (on) => {
|
||||
const d = mainDoc();
|
||||
let s = d?.getElementById("dd-main-split");
|
||||
if (!on) { s?.remove(); return; }
|
||||
if (!d?.head) return;
|
||||
if (!s) { s = d.createElement("style"); s.id = "dd-main-split"; d.head.appendChild(s); }
|
||||
if (s.textContent !== "$MAIN_PARKED_CSS") s.textContent = "$MAIN_PARKED_CSS";
|
||||
};
|
||||
if (!c.__ddQam) {
|
||||
c.__ddQam = c.ComputeOverallMinimumRequestedComposition;
|
||||
m.__ddQam = m.OnMenuDeactivated;
|
||||
@@ -106,18 +59,6 @@ object SteamQam {
|
||||
return without >= 2 ? v : 1;
|
||||
};
|
||||
}
|
||||
// Steam frosts its Store page while a side menu is open; a parked menu is not over it.
|
||||
const inst = m.m_Instance;
|
||||
if (inst?.SetStoreBrowserGlass && !inst.__ddQamGlass) {
|
||||
inst.__ddQamGlass = inst.SetStoreBrowserGlass;
|
||||
inst.SetStoreBrowserGlass = function (e) { return inst.__ddQamGlass.call(this, ours() ? 0 : e); };
|
||||
}
|
||||
const glass = () => {
|
||||
const on = !ours() && m.m_eOpenSideMenu !== 0;
|
||||
if (g.__ddQamGlassOn === on) return;
|
||||
g.__ddQamGlassOn = on;
|
||||
inst?.SetStoreBrowserGlass?.(m.m_eOpenSideMenu);
|
||||
};
|
||||
const views = () => popup?.m_rgChildBrowserViews || [];
|
||||
const backdrop = (hide) => {
|
||||
const doc = popup?.m_popup?.document;
|
||||
@@ -134,61 +75,16 @@ object SteamQam {
|
||||
};
|
||||
const keep = () => {
|
||||
for (const v of views()) {
|
||||
if (!v.__ddQam) v.__ddQam = v.SetBounds;
|
||||
if (v.__ddQamW === 4) continue;
|
||||
v.__ddQamW = 4;
|
||||
v.__ddQamVis = v.__ddQamVis || v.SetVisible;
|
||||
v.__ddQamFocus = v.__ddQamFocus || v.SetFocus;
|
||||
if (v.__ddQam) continue;
|
||||
v.__ddQam = v.SetBounds;
|
||||
v.SetBounds = function (x, y, w, h, ...r) {
|
||||
if (v.__ddMain && mainParked()) {
|
||||
if (w > 0) v.__ddMainAsked = [x, y, w, h];
|
||||
[w, h] = mainSize();
|
||||
v.__ddMainOn = true; v.__ddMainW = w; v.__ddMainH = h;
|
||||
return v.__ddQam.call(this, parkX(), 0, w, h, ...r);
|
||||
}
|
||||
if (v.__ddMain && w > 0) mainStyle(false);
|
||||
v.__ddAsked = [x, y, w, h];
|
||||
if (w > 0 && ours() && isQam(v)) { x = parkX(); [w, h] = size(w, h); }
|
||||
if (w > 0 && ours()) { x = popup.m_popup.innerWidth + 64; w = width(h) || w; }
|
||||
v.__ddAt = x;
|
||||
v.__ddW = w;
|
||||
v.__ddH = h;
|
||||
return v.__ddQam.call(this, x, y, w, h, ...r);
|
||||
};
|
||||
v.SetVisible = function (on, ...r) {
|
||||
return v.__ddQamVis.call(this, on || (!!v.__ddMain && mainParked()), ...r);
|
||||
};
|
||||
v.SetFocus = function (on, ...r) {
|
||||
if (on && m.m_eOpenSideMenu === MAIN && v !== headerView()) {
|
||||
for (const o of views()) if (o !== v) delete o.__ddMain;
|
||||
v.__ddMain = true;
|
||||
delete v.__ddQamView;
|
||||
}
|
||||
if (on && m.m_eOpenSideMenu === QAM && !v.__ddMain && v !== headerView()) {
|
||||
for (const o of views()) if (o !== v) delete o.__ddQamView;
|
||||
v.__ddQamView = true;
|
||||
}
|
||||
return v.__ddQamFocus.call(this, on, ...r);
|
||||
};
|
||||
}
|
||||
if (g.__ddMainProbe && !probing()) { g.__ddMainProbe = 0; g.__ddMainProbed = true; }
|
||||
if (probing() && mainView()) { g.__ddMainProbe = 0; g.__ddMainProbed = true; }
|
||||
const mv = mainView();
|
||||
if (mv && !probing()) {
|
||||
if (mainParked()) {
|
||||
const [w, h] = mainSize();
|
||||
if (!mv.__ddMainOn || mv.__ddMainW !== w || mv.__ddMainH !== h) {
|
||||
mv.__ddQam.call(mv, parkX(), 0, w, h);
|
||||
mv.__ddQamVis.call(mv, true);
|
||||
mv.__ddMainOn = true; mv.__ddMainW = w; mv.__ddMainH = h;
|
||||
}
|
||||
} else if (mv.__ddMainOn) {
|
||||
mv.__ddMainOn = false;
|
||||
if (m.m_eOpenSideMenu !== MAIN) { mv.__ddQamVis.call(mv, false); mv.__ddQam.call(mv, 0, 0, 0, 0); }
|
||||
else if (mv.__ddMainAsked) mv.__ddQam.call(mv, ...mv.__ddMainAsked);
|
||||
}
|
||||
}
|
||||
mainStyle(!!mv && mainParked() && !probing());
|
||||
glass();
|
||||
if (!held()) {
|
||||
const parked = !g.__ddQamTop;
|
||||
g.__ddQamTop = false;
|
||||
@@ -228,25 +124,6 @@ object SteamQam {
|
||||
}
|
||||
g.__ddQamTop = false;
|
||||
}
|
||||
// Each Split activation gets a fresh probe budget, and a spent one refills after a backoff, so a Steam that was
|
||||
// still loading does not leave the main menu undiscovered for good.
|
||||
if (split() !== !!g.__ddQamSplitOn) { g.__ddQamSplitOn = split(); if (split()) g.__ddMainProbes = 0; }
|
||||
if (split() && !mv) {
|
||||
if (probing()) return;
|
||||
if ((g.__ddMainProbes || 0) >= 3 && Date.now() - (g.__ddMainProbeLast || 0) > 30000) g.__ddMainProbes = 0;
|
||||
if ((g.__ddMainProbes || 0) < 3 && m.m_eOpenSideMenu !== MAIN) {
|
||||
g.__ddMainProbes = (g.__ddMainProbes || 0) + 1;
|
||||
g.__ddMainProbeLast = Date.now();
|
||||
g.__ddMainProbe = Date.now() + 1500;
|
||||
m.OpenMainMenu();
|
||||
c.EnsureCorrectComposition?.();
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (g.__ddMainProbed) {
|
||||
g.__ddMainProbed = false;
|
||||
if (m.m_eOpenSideMenu === MAIN) m.OpenQuickAccessMenu(g.__ddQamTab ?? undefined);
|
||||
}
|
||||
const decky = !!g.DeckyPluginLoader?.tabsHook?.qamBrowserViewPatch;
|
||||
// Decky hooks the menu after Steam starts; the menu has to unmount for its tab to appear, so reopen on the next tick.
|
||||
if (m.m_eOpenSideMenu === QAM && decky && !g.__ddQamDecky) { g.__ddQamDecky = true; m.CloseSideMenus(); return; }
|
||||
@@ -259,26 +136,18 @@ object SteamQam {
|
||||
if (m.m_eQuickAccessTab != null) g.__ddQamTab = m.m_eQuickAccessTab;
|
||||
if (!g.__ddQamOn) { g.__ddQamOn = true; c.EnsureCorrectComposition?.(); }
|
||||
for (const v of views()) {
|
||||
if (v.__ddMain) continue;
|
||||
if (!isQam(v)) {
|
||||
// A view parked before the quick access view was known goes back where Steam asked for it.
|
||||
const a = v.__ddAsked;
|
||||
if (a?.[2] > 0 && v.__ddAt >= popup.m_popup.innerWidth) { v.__ddQam.call(v, ...a); v.__ddAt = a[0]; v.__ddW = a[2]; v.__ddH = a[3]; }
|
||||
continue;
|
||||
}
|
||||
if (!v.__ddAsked) {
|
||||
const b = v.GetBounds?.();
|
||||
if (b && b.width > 0) { v.__ddAsked = [b.x, b.y, b.width, b.height]; v.__ddAt = b.x; v.__ddW = b.width; v.__ddH = b.height; }
|
||||
if (b && b.width > 0) { v.__ddAsked = [b.x, b.y, b.width, b.height]; v.__ddAt = b.x; v.__ddW = b.width; }
|
||||
}
|
||||
const a = v.__ddAsked;
|
||||
const [w, h] = a?.[2] > 0 ? size(a[2], a[3]) : [0, 0];
|
||||
if (a?.[2] > 0 && (v.__ddAt < popup.m_popup.innerWidth || v.__ddW !== w || v.__ddH !== h)) v.SetBounds(...a);
|
||||
if (a?.[2] > 0 && (v.__ddAt < popup.m_popup.innerWidth || (width(a[3]) && v.__ddW !== width(a[3])))) v.SetBounds(...a);
|
||||
}
|
||||
const main = nav?.m_rgGamepadNavigationTrees?.find(t => t.m_ID === "GamepadUI_Full_Root");
|
||||
if (main && /^(QuickAccess|MainMenu)/.test(nav.m_LastActiveNavTree?.m_ID ?? "")) nav.SetActiveNavTree(main);
|
||||
if (main && nav.m_LastActiveNavTree?.m_ID?.startsWith("QuickAccess")) nav.SetActiveNavTree(main);
|
||||
backdrop(true);
|
||||
};
|
||||
${leaseScript(on, owner, aspect, split)}
|
||||
${leaseScript(on, owner, aspect)}
|
||||
keep();
|
||||
if (held() && !g.__ddQamTimer) {
|
||||
g.__ddQamTimer = setInterval(() => {
|
||||
@@ -292,8 +161,7 @@ object SteamQam {
|
||||
/** [open] is Steam's open side menu; [top] is true while the menu is shown on the top screen. */
|
||||
data class Hold(val open: Int, val top: Boolean)
|
||||
|
||||
fun hold(context: Context, aspect: Float, owner: Long, split: Boolean = false): Hold? =
|
||||
eval(context, script(true, aspect, owner, split))?.let(::parseHold)
|
||||
fun hold(context: Context, aspect: Float, owner: Long): Hold? = eval(context, script(true, aspect, owner))?.let(::parseHold)
|
||||
|
||||
internal fun parseHold(text: String): Hold? = runCatching {
|
||||
val a = JSONArray(text)
|
||||
@@ -313,9 +181,7 @@ object SteamQam {
|
||||
fun target(context: Context): Target? = runCatching {
|
||||
val devtools = File(AgentGuest.dir(context), "cdp-port").readText().trim().toInt()
|
||||
val (relay, secret) = parseRelay(helper(context, "start", devtools.toString())) ?: return null
|
||||
val found = runCatching {
|
||||
parseTarget(relay, get(relay, "/$secret/json"))?.let { t -> t.copy(path = "/$secret${t.path}", mainPath = t.mainPath?.let { "/$secret$it" }) }
|
||||
}
|
||||
val found = runCatching { parseTarget(relay, get(relay, "/$secret/json"))?.let { it.copy(path = "/$secret${it.path}") } }
|
||||
if (found.getOrNull() == null) helper(context, "stop", relay.toString())
|
||||
found.getOrThrow()
|
||||
}.onFailure { android.util.Log.e(TAG, "no quick access target: $it") }.getOrNull()
|
||||
@@ -366,16 +232,14 @@ object SteamQam {
|
||||
|
||||
internal fun parseTarget(port: Int, json: String): Target? {
|
||||
val list = JSONArray(json)
|
||||
fun page(prefix: String): String? {
|
||||
for (i in 0 until list.length()) {
|
||||
val t = list.optJSONObject(i) ?: continue
|
||||
if (!t.optString("title").startsWith(prefix)) continue
|
||||
val ws = t.optString("webSocketDebuggerUrl")
|
||||
Regex("^ws://[^/]+(/devtools/page/[A-Za-z0-9-]+)$").find(ws)?.groupValues?.get(1)?.let { return it }
|
||||
}
|
||||
return null
|
||||
for (i in 0 until list.length()) {
|
||||
val t = list.optJSONObject(i) ?: continue
|
||||
if (!t.optString("title").startsWith("QuickAccess")) continue
|
||||
val ws = t.optString("webSocketDebuggerUrl")
|
||||
val path = Regex("^ws://[^/]+(/devtools/page/[A-Za-z0-9-]+)$").find(ws)?.groupValues?.get(1) ?: continue
|
||||
return Target(port, path)
|
||||
}
|
||||
return page("QuickAccess")?.let { Target(port, it, page("MainMenu")) }
|
||||
return null
|
||||
}
|
||||
|
||||
private fun eval(context: Context, expression: String): String? = runCatching {
|
||||
|
||||
@@ -64,8 +64,8 @@ internal class StoreArchiveUnpacker(
|
||||
val binds = if (listOf(app.filesDir, app.cacheDir).any { work.absolutePath.startsWith(it.absolutePath + "/") }) null
|
||||
else listOf(work.absolutePath)
|
||||
fun bsdtar(args: List<String>, onLine: (String) -> Unit) =
|
||||
GuestCommand.run(app, listOf("/usr/bin/bsdtar") + args, logName = logName, extraBinds = binds, cancelled = cancelled) { line ->
|
||||
onLine(line)
|
||||
GuestCommand.run(app, listOf("/usr/bin/bsdtar") + args, logName = logName, extraBinds = binds, fastPath = true, cancelled = cancelled) { line ->
|
||||
if (!line.startsWith("proot ")) onLine(line)
|
||||
}
|
||||
var entries = 0L
|
||||
var size = 0L
|
||||
|
||||
@@ -82,7 +82,7 @@ object BattleNetInstall {
|
||||
internal fun run(context: Context, args: List<String>, cancelled: AtomicBoolean?, onLine: (String) -> Unit): Int =
|
||||
GuestCommand.run(
|
||||
context, listOf(BattleNet.PROGRAM) + args, logName = "battlenet-agent",
|
||||
extraBinds = binds(context), cancelled = cancelled, onLine = onLine,
|
||||
extraBinds = binds(context), fastPath = true, cancelled = cancelled, onLine = onLine,
|
||||
)
|
||||
|
||||
fun enqueue(context: Context, item: CatalogItem, folder: File, update: Boolean = false) {
|
||||
|
||||
@@ -67,7 +67,7 @@ object EaLsx {
|
||||
}
|
||||
|
||||
@Volatile var game: Game? = null
|
||||
@Volatile internal var account: Account? = 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
|
||||
@@ -333,11 +333,10 @@ object EaLsx {
|
||||
|
||||
private fun now() = LocalDateTime.now(ZoneOffset.UTC).format(DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss"))
|
||||
|
||||
internal fun answer(session: Session, m: Message): String? {
|
||||
private fun answer(session: Session, m: Message): String? {
|
||||
val g = game
|
||||
val who = account
|
||||
val person = who?.takeIf { session.trusted }
|
||||
val profile = who?.takeIf { session.trusted || session.claimed }
|
||||
val locale = g?.locale ?: "en_US"
|
||||
return when (m.name) {
|
||||
"ChallengeResponse" -> {
|
||||
@@ -356,16 +355,15 @@ object EaLsx {
|
||||
"GetConfig" -> tag("GetConfigResponse", body = SERVICES.joinToString("") { tag("Service", "Name" to it.first, "Facility" to it.second) })
|
||||
"GetProfile" -> tag(
|
||||
"GetProfileResponse",
|
||||
"Persona" to profile?.persona.orEmpty(), "SubscriberLevel" to 0, "CommerceCurrency" to "USD", "IsTrialSubscriber" to false,
|
||||
"Country" to "US", "UserId" to profile?.userId.orEmpty(), "GeoCountry" to "US", "AvatarId" to "", "IsSubscriber" to false,
|
||||
"IsSteamSubscriber" to false, "PersonaId" to profile?.personaId.orEmpty(), "IsUnderAge" to false, "UserIndex" to 0,
|
||||
"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"
|
||||
})
|
||||
"GetSettings" -> tag("GetSettingsResponse", "IsIGOAvailable" to false, "IsIGOEnabled" to false, "IsTelemetryEnabled" to false, "IsManualOffline" to false)
|
||||
"GetGameInfo" -> tag("GetGameInfoResponse", "GameInfo" to when (m.attrs["GameInfoId"]) {
|
||||
"FREETRIAL" -> "false"
|
||||
"LANGUAGES" -> LANGUAGES
|
||||
@@ -405,7 +403,7 @@ object EaLsx {
|
||||
)
|
||||
})
|
||||
}
|
||||
"GetPresence" -> tag("GetPresenceResponse", "UserId" to profile?.userId.orEmpty(), "Presence" to "INGAME")
|
||||
"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 = "")
|
||||
|
||||
@@ -249,7 +249,7 @@ internal class EpicClientInstaller(private val app: Context) : DownloadQueue.Dow
|
||||
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, logName = "epic-client") { line ->
|
||||
val code = GuestCommand.run(app, argv, fakeRoot = true, logName = "epic-client") { line ->
|
||||
if (line.startsWith("{")) runCatching { JSONObject(line) }.getOrNull()?.let { answer = it }
|
||||
}
|
||||
val result = answer
|
||||
|
||||
@@ -8,6 +8,7 @@ import androidx.compose.runtime.setValue
|
||||
import com.droiddeck.launcher.core.AddonPack
|
||||
import com.droiddeck.launcher.runtime.LinuxRuntime
|
||||
import com.droiddeck.launcher.session.SessionEvents
|
||||
import com.droiddeck.launcher.session.SessionPrefs
|
||||
import com.droiddeck.launcher.session.SessionState
|
||||
import com.droiddeck.launcher.stores.Store
|
||||
import com.droiddeck.launcher.stores.AchievementNotifications
|
||||
@@ -138,10 +139,22 @@ object GogComet {
|
||||
val data = File(context.filesDir, "gog-achievements").apply { mkdirs() }
|
||||
val ready = CountDownLatch(1)
|
||||
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")
|
||||
try {
|
||||
val pb = if (com.droiddeck.launcher.runtime.NativeGuest.forSession(context)) {
|
||||
val root = LinuxRuntime.rootDir(context)
|
||||
val pb = com.droiddeck.launcher.runtime.NativeGuest.processBuilder(context, root,
|
||||
com.droiddeck.launcher.runtime.NativeGuest.processBuilder(context, root,
|
||||
LinuxRuntime.binds(context, null, null, LinuxRuntime.sharedStorage(context), null), guest).redirectErrorStream(true)
|
||||
} else {
|
||||
ProcessBuilder(LinuxRuntime.command(context, null, null, LinuxRuntime.sharedStorage(context), 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()
|
||||
process = child; account = user; session = SessionState.sessionId
|
||||
Thread({
|
||||
|
||||
@@ -101,9 +101,11 @@ internal object ItchPatch {
|
||||
.distinct().takeIf { it.isNotEmpty() }
|
||||
val tail = ArrayDeque<String>()
|
||||
val code = try {
|
||||
GuestCommand.run(app, args, logName = "itch-butler", extraBinds = binds, cancelled = cancelled) { line ->
|
||||
if (tail.size == 4) tail.removeFirst()
|
||||
tail.addLast(line)
|
||||
GuestCommand.run(app, args, logName = "itch-butler", extraBinds = binds, fastPath = true, cancelled = cancelled) { line ->
|
||||
if (!line.startsWith("proot ")) {
|
||||
if (tail.size == 4) tail.removeFirst()
|
||||
tail.addLast(line)
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
StoreInstalls.deleteTree(staging)
|
||||
|
||||
@@ -61,7 +61,18 @@ internal class XboxCredentials(private val app: Context, expectedGeneration: Str
|
||||
}
|
||||
|
||||
private fun identity(pid: Int, root: Int): String? {
|
||||
if (root <= 0 || pid <= 0 || !descendsFrom(pid, root)) return null
|
||||
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()
|
||||
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
|
||||
|
||||
@@ -4,6 +4,8 @@ import android.content.Context
|
||||
import com.droiddeck.launcher.core.AddonPack
|
||||
import com.droiddeck.launcher.runtime.LinuxNetworkLinkComponent
|
||||
import com.droiddeck.launcher.runtime.LinuxRuntime
|
||||
import com.droiddeck.launcher.runtime.ProotFastPath
|
||||
import com.droiddeck.launcher.session.SessionPrefs
|
||||
import com.droiddeck.launcher.stores.StoreInstallRoot
|
||||
import org.json.JSONObject
|
||||
import java.io.Closeable
|
||||
@@ -82,15 +84,33 @@ internal object Xodus {
|
||||
val external = LinuxRuntime.sharedStorage(app)
|
||||
val extraBinds = StoreInstallRoot.externalBindSpecsForXodus(app)
|
||||
val binds = LinuxRuntime.binds(app, null, null, external, extraBinds)
|
||||
val fastPathPreloaded = runCatching {
|
||||
File(root, "etc/ld.so.preload").useLines { lines -> lines.any { it.trim() == ProotFastPath.LIBRARY } }
|
||||
}.getOrDefault(false)
|
||||
val 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",
|
||||
"XDG_RUNTIME_DIR=${runtime.path}", "DROIDDECK_XBOX_CREDENTIAL_SOCKET=${credentials.name}", binary,
|
||||
)
|
||||
fastPathKey?.let { key ->
|
||||
guestCommand.addAll(guestCommand.lastIndex, ProotFastPath.guestEnv(root, binds, key))
|
||||
}
|
||||
guestCommand.addAll(args)
|
||||
val builder = com.droiddeck.launcher.runtime.NativeGuest.processBuilder(app, root, binds, guestCommand)
|
||||
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
|
||||
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)
|
||||
if (SessionPrefs.prootNoSeccomp(app)) put("PROOT_NO_SECCOMP", "1")
|
||||
fastPathKey?.let { ProotFastPath.hostEnv(it).let { (key, value) -> put(key, value) } }
|
||||
LinuxRuntime.prootLibraryPath(app).takeIf { it.isNotEmpty() }?.let { put("LD_LIBRARY_PATH", it) }
|
||||
}
|
||||
val digest = java.security.MessageDigest.getInstance("SHA-256")
|
||||
File(pack, binary.removePrefix("$DIR/")).inputStream().use { input ->
|
||||
val buffer = ByteArray(65536)
|
||||
|
||||
@@ -223,7 +223,7 @@ internal fun AgentProcessList(modifier: Modifier) {
|
||||
var procs by remember { mutableStateOf<List<AgentProcesses.Proc>?>(null) }
|
||||
LaunchedEffect(refresh) {
|
||||
while (true) {
|
||||
procs = withContext(Dispatchers.IO) { AgentProcesses.snapshot(com.droiddeck.launcher.runtime.LinuxRuntime.rootDir(context), AgentHost.turnPid) }
|
||||
procs = withContext(Dispatchers.IO) { AgentProcesses.snapshot(AgentHost.turnPid) }
|
||||
delay(2_000)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -283,6 +283,7 @@ private fun action(step: Step): Int = when (step) {
|
||||
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 (QuestExperimental.isSupported()) return AgentSetup.trustOnDevice(context)
|
||||
if (!WirelessAdbPairingService.notificationsEnabled(context)) {
|
||||
@@ -292,5 +293,5 @@ private fun pair(context: android.content.Context) {
|
||||
return
|
||||
}
|
||||
WirelessAdbPairingService.start(context)
|
||||
PairingGuideActivity.start(context, null)
|
||||
PairingGuideActivity.start(context, null, false)
|
||||
}
|
||||
@@ -8,14 +8,11 @@ import androidx.compose.foundation.Canvas
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.BoxWithConstraints
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.fillMaxHeight
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.outlined.AlignHorizontalCenter
|
||||
import androidx.compose.material.icons.outlined.AlignHorizontalLeft
|
||||
import androidx.compose.material.icons.outlined.AlignHorizontalRight
|
||||
import androidx.compose.material.icons.outlined.VerticalSplit
|
||||
import androidx.compose.material.icons.outlined.WidthFull
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
@@ -75,8 +72,7 @@ internal enum class QamFit(val id: String, @StringRes val label: Int, val icon:
|
||||
FULL("full", R.string.bottom_qam_layout_full, Icons.Outlined.WidthFull, 0),
|
||||
LEFT("left", R.string.bottom_qam_layout_left, Icons.Outlined.AlignHorizontalLeft, -1),
|
||||
CENTER("center", R.string.bottom_qam_layout_center, Icons.Outlined.AlignHorizontalCenter, 0),
|
||||
RIGHT("right", R.string.bottom_qam_layout_right, Icons.Outlined.AlignHorizontalRight, 1),
|
||||
SPLIT("split", R.string.bottom_qam_layout_split, Icons.Outlined.VerticalSplit, 0);
|
||||
RIGHT("right", R.string.bottom_qam_layout_right, Icons.Outlined.AlignHorizontalRight, 1);
|
||||
|
||||
val next: QamFit get() = entries[(ordinal + 1) % entries.size]
|
||||
|
||||
@@ -96,7 +92,6 @@ internal enum class QamFit(val id: String, @StringRes val label: Int, val icon:
|
||||
|
||||
internal object QamLayout {
|
||||
private const val WIDE_CSS = "div.BasicUI { width: 100% !important; } div[class*=\\\"tab_\\\"] { max-width: none !important; }"
|
||||
private const val PARKED_CSS = " #Footer { display: none !important; }"
|
||||
|
||||
/** Scale and left edge of the menu in a box; [align] -1, 0 or 1 places a narrower menu left, centred or right. */
|
||||
fun fit(boxWidth: Float, boxHeight: Float, contentRight: Float, cssHeight: Float, align: Int = 0): Pair<Float, Float> {
|
||||
@@ -107,13 +102,10 @@ internal object QamLayout {
|
||||
fun toCss(x: Float, y: Float, scale: Float, left: Float): Pair<Float, Float> = (x - left) / scale to y / scale
|
||||
|
||||
/** Makes the menu follow the panel-shaped view (Steam sizes it once, on open) and lifts each tab's 300 px cap, then measures where the content ends. */
|
||||
/**
|
||||
* [wide] is false while the menu is shown on the top screen, where it keeps Steam's own layout. [parked] hides the
|
||||
* button-hint footer Steam draws in a game, which stays an empty black strip while the controller is not on the menu.
|
||||
*/
|
||||
fun contentScript(wide: Boolean, parked: Boolean = wide): String = "(() => { let s = document.getElementById('dd-qam-wide'); " +
|
||||
/** [wide] is false while the menu is shown on the top screen, where it keeps Steam's own layout. */
|
||||
fun contentScript(wide: Boolean): String = "(() => { let s = document.getElementById('dd-qam-wide'); " +
|
||||
"if (!s) { s = document.createElement('style'); s.id = 'dd-qam-wide'; document.head.appendChild(s); } " +
|
||||
"const css = '${(if (wide) WIDE_CSS else "") + (if (parked) PARKED_CSS else "")}'; " +
|
||||
"const css = '${if (wide) WIDE_CSS else ""}'; " +
|
||||
"if (s.textContent !== css) s.textContent = css; if (document.scrollingElement.scrollLeft) document.scrollingElement.scrollLeft = 0; " +
|
||||
"const w = innerWidth; let right = 0; for (const e of document.body.querySelectorAll('*')) { " +
|
||||
"const r = e.getBoundingClientRect(); const tab = /(^| )tab_/.test(String(e.className)); " +
|
||||
@@ -125,90 +117,17 @@ private const val TICK_MS = 1_000L
|
||||
private const val FAST_TICK_MS = 150L
|
||||
private const val MAX_RETRY_MS = 4_000L
|
||||
|
||||
/** One of Steam's menu pages streamed to the panel; the last frame is kept so returning to the panel shows it at once. */
|
||||
internal class MenuStream {
|
||||
@Volatile var page: CdpPage? = null
|
||||
val live = java.util.concurrent.atomic.AtomicBoolean(false)
|
||||
val image = mutableStateOf<ImageBitmap?>(null)
|
||||
val shape = mutableStateOf<FloatArray?>(null)
|
||||
|
||||
fun show(frame: ImageBitmap) {
|
||||
image.value = frame
|
||||
live.set(true)
|
||||
}
|
||||
|
||||
/** Connects to [path] and starts its screencast; false when the page cannot be reached. */
|
||||
fun connect(port: Int, path: String): Boolean {
|
||||
page?.close()
|
||||
page = null
|
||||
live.set(false)
|
||||
val p = runCatching {
|
||||
CdpPage(port, path) { method, params ->
|
||||
if (method == "Page.screencastFrame") {
|
||||
page?.send("Page.screencastFrameAck", JSONObject().put("sessionId", params.optInt("sessionId")))
|
||||
decodeFrame(params.optString("data"))?.let(::show)
|
||||
}
|
||||
}
|
||||
}.onFailure { android.util.Log.w("SteamQam", "devtools connect: $it") }.getOrNull() ?: return false
|
||||
page = p
|
||||
p.send("Page.enable")
|
||||
val started = p.call("Page.startScreencast", JSONObject().put("format", "jpeg").put("quality", 85)
|
||||
.put("maxWidth", 1920).put("maxHeight", 1440))
|
||||
if (started == null || started.has("error") || !started.has("result")) {
|
||||
p.close()
|
||||
page = null
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
/** Runs [script], which returns the page's [width, height, pixel ratio, content right], and refreshes a still page. */
|
||||
fun refresh(script: String) {
|
||||
val p = page ?: return
|
||||
// The screencast sends frames only when the menu repaints, so a still menu needs one screenshot.
|
||||
if (!live.get()) {
|
||||
p.call("Page.captureScreenshot", JSONObject().put("format", "jpeg").put("quality", 85))
|
||||
?.optJSONObject("result")?.optString("data")?.let(::decodeFrame)?.let(::show)
|
||||
}
|
||||
(p.evaluate(script) as? String)?.let { text ->
|
||||
runCatching {
|
||||
val a = JSONArray(text)
|
||||
val layout = FloatArray(4) { a.getDouble(it).toFloat() }
|
||||
if (!layout.contentEquals(shape.value)) shape.value = layout
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Stops the stream and runs [restore] on the page, which outlives this connection. */
|
||||
fun stop(restore: String) {
|
||||
val p = page ?: return
|
||||
page = null
|
||||
runCatching { p.send("Page.stopScreencast") }
|
||||
runCatching { p.evaluate(restore) }
|
||||
p.close()
|
||||
}
|
||||
|
||||
fun frame(): QamFrame? {
|
||||
val img = image.value
|
||||
val l = shape.value
|
||||
return if (img != null && l != null && l[0] > 0f) QamFrame(img, l[0], l[1], l[3].coerceIn(l[0] * 0.25f, l[0])) else null
|
||||
}
|
||||
}
|
||||
|
||||
/** Steam's main menu beside the quick access menu; Steam's side of the hold keeps it in place and filling its view. */
|
||||
internal object MainMenuLayout {
|
||||
const val CONTENT_SCRIPT = "JSON.stringify([innerWidth, innerHeight, devicePixelRatio, innerWidth])"
|
||||
}
|
||||
|
||||
/** Panel streams kept across visits to the panel. */
|
||||
/** The last frame shown, so returning to the panel shows the menu at once while the live stream reconnects. */
|
||||
private object QamCache {
|
||||
val qam = MenuStream()
|
||||
val main = MenuStream()
|
||||
@Volatile var image: ImageBitmap? = null
|
||||
@Volatile var shape: FloatArray? = null
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun SteamQamPanel() {
|
||||
val context = LocalContext.current.applicationContext
|
||||
var image by remember { mutableStateOf(QamCache.image) }
|
||||
var shape by remember { mutableStateOf(QamCache.shape) }
|
||||
var failed by remember { mutableStateOf(false) }
|
||||
var slow by remember { mutableStateOf(false) }
|
||||
LaunchedEffect(Unit) {
|
||||
@@ -216,67 +135,78 @@ internal fun SteamQamPanel() {
|
||||
slow = true
|
||||
}
|
||||
val fit = QamFit.current(context)
|
||||
val qam = QamCache.qam
|
||||
val mainMenu = QamCache.main
|
||||
val holder = remember { arrayOfNulls<CdpPage>(1) }
|
||||
val owner = remember { SteamQam.newOwner() }
|
||||
val relay = remember { intArrayOf(0) }
|
||||
val mainPath = remember { arrayOfNulls<String>(1) }
|
||||
val live = remember { java.util.concurrent.atomic.AtomicBoolean(false) }
|
||||
val aspect = remember { floatArrayOf(0f) }
|
||||
val measure = Modifier.fillMaxSize().onSizeChanged { if (it.height > 0) aspect[0] = it.width.toFloat() / it.height }
|
||||
val show = { frame: ImageBitmap -> image = frame; QamCache.image = frame; live.set(true) }
|
||||
LaunchedEffect(Unit) {
|
||||
withContext(Dispatchers.IO) {
|
||||
var misses = 0
|
||||
// The main menu page backs off on its own, so Quick Access stays available while its neighbour cannot connect.
|
||||
var mainMisses = 0
|
||||
var mainRetryAt = 0L
|
||||
fun split() = QamFit.current(context) == QamFit.SPLIT
|
||||
// The lease is renewed on its own, so slow discovery or a retry backoff never lets the held menu lapse.
|
||||
val renew = launch {
|
||||
while (isActive) {
|
||||
if (SessionState.phase == SessionPhase.READY && aspect[0] > 0f) SteamQam.hold(context, aspect[0], owner, split())
|
||||
if (SessionState.phase == SessionPhase.READY && aspect[0] > 0f) SteamQam.hold(context, aspect[0], owner)
|
||||
delay(TICK_MS)
|
||||
}
|
||||
}
|
||||
try {
|
||||
while (isActive) {
|
||||
// Holding the menu before Steam's first frame keeps gamescope from presenting it.
|
||||
if (SessionState.phase != SessionPhase.READY || aspect[0] == 0f) {
|
||||
if (SessionState.phase != SessionPhase.READY) {
|
||||
delay(FAST_TICK_MS)
|
||||
continue
|
||||
}
|
||||
val split = split()
|
||||
val held = SteamQam.hold(context, aspect[0], owner, split)
|
||||
if (aspect[0] == 0f) {
|
||||
delay(FAST_TICK_MS)
|
||||
continue
|
||||
}
|
||||
val held = SteamQam.hold(context, aspect[0], owner)
|
||||
ensureActive()
|
||||
var reached = held != null
|
||||
if (held?.open == SteamQam.QUICK_ACCESS) {
|
||||
if (qam.page?.closed != false) {
|
||||
val t = SteamQam.target(context)
|
||||
if (t != null) {
|
||||
var page = holder[0]
|
||||
if (page == null || page.closed) {
|
||||
page?.close()
|
||||
live.set(false)
|
||||
page = SteamQam.target(context)?.let { t ->
|
||||
if (relay[0] != 0 && relay[0] != t.port) SteamQam.stopRelay(context, relay[0])
|
||||
relay[0] = t.port
|
||||
mainPath[0] = t.mainPath
|
||||
qam.connect(t.port, t.path)
|
||||
mainMenu.stop(MainMenuLayout.CONTENT_SCRIPT)
|
||||
runCatching {
|
||||
CdpPage(t.port, t.path) { method, params ->
|
||||
if (method == "Page.screencastFrame") {
|
||||
holder[0]?.send("Page.screencastFrameAck", JSONObject().put("sessionId", params.optInt("sessionId")))
|
||||
decodeFrame(params.optString("data"))?.let(show)
|
||||
}
|
||||
}
|
||||
}.onFailure { android.util.Log.w("SteamQam", "devtools connect: $it") }.getOrNull()
|
||||
}
|
||||
holder[0] = page
|
||||
ensureActive()
|
||||
page?.send("Page.enable")
|
||||
val started = page?.call("Page.startScreencast", JSONObject().put("format", "jpeg").put("quality", 85)
|
||||
.put("maxWidth", 1920).put("maxHeight", 1440))
|
||||
if (page != null && (started == null || started.has("error") || !started.has("result"))) {
|
||||
page.close()
|
||||
page = null
|
||||
holder[0] = null
|
||||
}
|
||||
}
|
||||
reached = qam.page?.closed == false
|
||||
val wide = !held.top && (QamFit.current(context) == QamFit.FULL || split)
|
||||
qam.refresh(QamLayout.contentScript(wide, parked = !held.top))
|
||||
val path = mainPath[0]
|
||||
if (split && path != null) {
|
||||
val now = android.os.SystemClock.elapsedRealtime()
|
||||
if (mainMenu.page?.closed != false && now >= mainRetryAt) {
|
||||
if (mainMenu.connect(relay[0], path)) {
|
||||
mainMisses = 0
|
||||
} else {
|
||||
mainMisses++
|
||||
mainRetryAt = now + minOf(TICK_MS shl minOf(mainMisses - 1, 2), MAX_RETRY_MS)
|
||||
}
|
||||
// The screencast sends frames only when the menu repaints, so a still menu needs one screenshot.
|
||||
if (!live.get()) {
|
||||
page?.call("Page.captureScreenshot", JSONObject().put("format", "jpeg").put("quality", 85))
|
||||
?.optJSONObject("result")?.optString("data")?.let(::decodeFrame)?.let(show)
|
||||
}
|
||||
reached = page != null
|
||||
val wide = !held.top && QamFit.current(context) == QamFit.FULL
|
||||
(page?.evaluate(QamLayout.contentScript(wide)) as? String)?.let { text ->
|
||||
runCatching {
|
||||
val a = JSONArray(text)
|
||||
val layout = floatArrayOf(a.getDouble(0).toFloat(), a.getDouble(1).toFloat(), a.getDouble(2).toFloat(), a.getDouble(3).toFloat())
|
||||
if (!layout.contentEquals(shape)) { shape = layout; QamCache.shape = layout }
|
||||
}
|
||||
mainMenu.refresh(MainMenuLayout.CONTENT_SCRIPT)
|
||||
} else if (!split) {
|
||||
mainMenu.stop(MainMenuLayout.CONTENT_SCRIPT)
|
||||
}
|
||||
}
|
||||
failed = !reached
|
||||
@@ -284,7 +214,7 @@ internal fun SteamQamPanel() {
|
||||
misses = if (reached) 0 else misses + 1
|
||||
val wait = when {
|
||||
!reached -> minOf(TICK_MS shl minOf(misses - 1, 2), MAX_RETRY_MS)
|
||||
qam.live.get() && (!split || mainMenu.live.get() || mainMenu.page?.closed != false) -> TICK_MS
|
||||
live.get() -> TICK_MS
|
||||
else -> FAST_TICK_MS
|
||||
}
|
||||
val used = QamFit.current(context)
|
||||
@@ -295,46 +225,35 @@ internal fun SteamQamPanel() {
|
||||
} finally {
|
||||
withContext(NonCancellable) {
|
||||
renew.cancelAndJoin()
|
||||
// The pages outlive these connections, so the widened layouts would otherwise stay on the top screen.
|
||||
qam.stop(QamLayout.contentScript(wide = false))
|
||||
mainMenu.stop(MainMenuLayout.CONTENT_SCRIPT)
|
||||
val page = holder[0]
|
||||
holder[0] = null
|
||||
runCatching { page?.send("Page.stopScreencast") }
|
||||
// The page outlives this connection, so the widened layout would otherwise stay on the top screen.
|
||||
runCatching { page?.evaluate(QamLayout.contentScript(wide = false)) }
|
||||
page?.close()
|
||||
SteamQam.release(context, relay[0], owner)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
val qamFrame = qam.frame()
|
||||
if (qamFrame == null) {
|
||||
val img = image
|
||||
val l = shape
|
||||
val f = remember(img, l) {
|
||||
if (img != null && l != null && l[0] > 0f) QamFrame(img, l[0], l[1], l[3].coerceIn(l[0] * 0.25f, l[0])) else null
|
||||
}
|
||||
if (f == null) {
|
||||
Box(measure) {
|
||||
if (slow) PanelNote(stringResource(if (failed) R.string.bottom_qam_unavailable else R.string.achievements_reading))
|
||||
}
|
||||
return
|
||||
}
|
||||
if (fit != QamFit.SPLIT) {
|
||||
MenuCanvas(qamFrame, fit.align, measure) { qam.page }
|
||||
return
|
||||
}
|
||||
// Each side is as wide as its menu at the shared scale, so neither is shrunk nor padded with empty space.
|
||||
val mainFrame = mainMenu.frame()
|
||||
val mainWidth = mainFrame?.cssWidth ?: SteamQam.MAIN_CSS_WIDTH.toFloat()
|
||||
Row(measure) {
|
||||
val left = Modifier.weight(mainWidth).fillMaxHeight()
|
||||
if (mainFrame != null) MenuCanvas(mainFrame, -1, left) { mainMenu.page }
|
||||
else Box(left.background(qamFrame.fill))
|
||||
MenuCanvas(qamFrame, -1, Modifier.weight(qamFrame.cssWidth).fillMaxHeight()) { qam.page }
|
||||
}
|
||||
}
|
||||
|
||||
/** Draws [f] scaled into the box, placed by [align], and forwards touches on it to [page]. */
|
||||
@Composable
|
||||
private fun MenuCanvas(f: QamFrame, align: Int, modifier: Modifier, page: () -> CdpPage?) {
|
||||
BoxWithConstraints(modifier.background(f.fill)) {
|
||||
BoxWithConstraints(measure.background(f.fill)) {
|
||||
val density = LocalDensity.current
|
||||
val boxW = with(density) { maxWidth.toPx() }
|
||||
val boxH = with(density) { maxHeight.toPx() }
|
||||
val (scale, left) = QamLayout.fit(boxW, boxH, f.contentRight, f.cssHeight, align)
|
||||
val (scale, left) = QamLayout.fit(boxW, boxH, f.contentRight, f.cssHeight, fit.align)
|
||||
Canvas(
|
||||
Modifier.fillMaxSize().pointerInput(f.cssWidth, f.contentRight, boxW, boxH, align) {
|
||||
Modifier.fillMaxSize().pointerInput(f.cssWidth, f.contentRight, boxW, boxH, fit) {
|
||||
var touching = false
|
||||
var target: CdpPage? = null
|
||||
try {
|
||||
@@ -349,7 +268,7 @@ private fun MenuCanvas(f: QamFrame, align: Int, modifier: Modifier, page: () ->
|
||||
PointerEventType.Release -> "touchEnd"
|
||||
else -> null
|
||||
}?.takeIf { it == "touchStart" || touching } ?: continue
|
||||
if (type == "touchStart") target = page()
|
||||
if (type == "touchStart") target = holder[0]
|
||||
touching = type != "touchEnd"
|
||||
val points = if (type == "touchEnd") JSONArray()
|
||||
else JSONArray().put(JSONObject().put("x", x.toDouble()).put("y", y.toDouble()))
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
package com.droiddeck.launcher.ui
|
||||
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.shape.CircleShape
|
||||
import androidx.compose.material3.AlertDialog
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextButton
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.droiddeck.launcher.R
|
||||
|
||||
@Composable
|
||||
fun DeveloperDisplayChoiceDialog(
|
||||
displays: List<Pair<Int, String>>,
|
||||
onMainScreen: () -> Unit,
|
||||
onSecondaryScreen: (Int) -> Unit,
|
||||
onDismiss: () -> Unit,
|
||||
) {
|
||||
AlertDialog(
|
||||
onDismissRequest = onDismiss,
|
||||
title = { Text(stringResource(R.string.setup_adb_pair_button)) },
|
||||
text = {
|
||||
Column(verticalArrangement = Arrangement.spacedBy(4.dp), modifier = Modifier.fillMaxWidth()) {
|
||||
Text(stringResource(R.string.gate_choose_display))
|
||||
TextButton(modifier = Modifier.fillMaxWidth().focusGlide(CircleShape), onClick = onMainScreen) { Text(stringResource(R.string.gate_main_screen)) }
|
||||
displays.forEach { (id, label) ->
|
||||
TextButton(modifier = Modifier.fillMaxWidth().focusGlide(CircleShape), onClick = { onSecondaryScreen(id) }) { Text(label) }
|
||||
}
|
||||
}
|
||||
},
|
||||
confirmButton = { TextButton(onClick = onDismiss, modifier = Modifier.focusGlide(CircleShape)) { Text(stringResource(R.string.common_cancel)) } },
|
||||
)
|
||||
}
|
||||
@@ -1,142 +0,0 @@
|
||||
package com.droiddeck.launcher.ui
|
||||
|
||||
import android.content.Context
|
||||
import androidx.compose.animation.AnimatedVisibility
|
||||
import androidx.compose.animation.core.animateFloatAsState
|
||||
import androidx.compose.animation.expandVertically
|
||||
import androidx.compose.animation.fadeIn
|
||||
import androidx.compose.animation.fadeOut
|
||||
import androidx.compose.animation.shrinkVertically
|
||||
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.interaction.collectIsFocusedAsState
|
||||
import androidx.compose.foundation.interaction.collectIsHoveredAsState
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.ColumnScope
|
||||
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.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.outlined.ExpandMore
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.CompositionLocalProvider
|
||||
import androidx.compose.runtime.compositionLocalOf
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateMapOf
|
||||
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.draw.rotate
|
||||
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.semantics.stateDescription
|
||||
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.session.SessionPrefs
|
||||
|
||||
/**
|
||||
* Inside the session menu every top-level settings group folds to its header and a summary of its values.
|
||||
* Groups start folded; a group the player opens or folds stays that way across sessions.
|
||||
*/
|
||||
internal object DrawerSectionState {
|
||||
private val chosen = mutableStateMapOf<String, Boolean>()
|
||||
|
||||
fun load(context: Context) {
|
||||
if (DevPreview.drawer != null) return
|
||||
chosen.clear()
|
||||
chosen.putAll(SessionPrefs.drawerSections(context))
|
||||
}
|
||||
|
||||
fun isOpen(key: String) = chosen[key] ?: false
|
||||
|
||||
fun toggle(context: Context, key: String) {
|
||||
chosen[key] = !isOpen(key)
|
||||
if (DevPreview.drawer == null) SessionPrefs.setDrawerSections(context, chosen.toMap())
|
||||
}
|
||||
}
|
||||
|
||||
internal class DrawerSections(val context: Context, val track: (String) -> Modifier)
|
||||
|
||||
internal val LocalDrawerSections = compositionLocalOf<DrawerSections?> { null }
|
||||
|
||||
@Composable
|
||||
internal fun DrawerSection(
|
||||
sections: DrawerSections, key: String, title: String, summary: String?, tag: String?,
|
||||
content: @Composable ColumnScope.() -> Unit,
|
||||
) {
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val pal = LocalPalette.current
|
||||
val open = DrawerSectionState.isOpen(key)
|
||||
val source = remember { MutableInteractionSource() }
|
||||
val hot = source.collectIsFocusedAsState().value || source.collectIsHoveredAsState().value
|
||||
val rotation by animateFloatAsState(if (open) 180f else 0f, Motion.tw(180), label = "sectionArrow")
|
||||
val state = stringResource(if (open) R.string.widgets_expanded else R.string.widgets_collapsed)
|
||||
val toggle = { DrawerSectionState.toggle(sections.context, key) }
|
||||
val shape = RoundedCornerShape(14.dp)
|
||||
Column(
|
||||
Modifier.fillMaxWidth().padding(top = 6.dp).clip(shape)
|
||||
.background(colors.surface).border(1.dp, if (open) pal.line2 else pal.line, shape),
|
||||
) {
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
||||
modifier = Modifier.fillMaxWidth().heightIn(min = 48.dp)
|
||||
.then(sections.track("section-$key"))
|
||||
.testTag("drawer-section-$key")
|
||||
.background(if (hot) pal.signal.copy(alpha = 0.12f) else androidx.compose.ui.graphics.Color.Transparent)
|
||||
.glideBorder(hot, shape, pal.signal)
|
||||
.hoverable(source)
|
||||
.clickable(interactionSource = source, indication = LocalIndication.current, role = Role.Button, onClick = toggle)
|
||||
.controllerConfirm(onClick = toggle)
|
||||
.semantics { contentDescription = title; stateDescription = state }
|
||||
.padding(start = 12.dp, end = 8.dp, top = 6.dp, bottom = 6.dp),
|
||||
) {
|
||||
Column(Modifier.weight(1f)) {
|
||||
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(6.dp)) {
|
||||
Text(title.uppercase(), fontSize = 12.sp, fontWeight = FontWeight.SemiBold, letterSpacing = 1.2.sp,
|
||||
color = if (open) colors.onBackground else colors.onSurfaceVariant, maxLines = 1, overflow = TextOverflow.Ellipsis,
|
||||
modifier = Modifier.weight(1f, fill = false))
|
||||
if (tag != null) Text(
|
||||
tag, fontSize = 10.sp, fontWeight = FontWeight.SemiBold, color = pal.signal, maxLines = 1,
|
||||
modifier = Modifier.clip(RoundedCornerShape(6.dp)).background(pal.signal.copy(alpha = 0.14f))
|
||||
.padding(horizontal = 6.dp, vertical = 2.dp),
|
||||
)
|
||||
}
|
||||
if (!open && !summary.isNullOrEmpty()) Text(
|
||||
summary, fontSize = 12.sp, color = colors.onSurfaceVariant, maxLines = 1, overflow = TextOverflow.Ellipsis,
|
||||
modifier = Modifier.padding(top = 2.dp),
|
||||
)
|
||||
}
|
||||
Icon(Icons.Outlined.ExpandMore, contentDescription = null, tint = colors.onSurfaceVariant,
|
||||
modifier = Modifier.size(22.dp).rotate(rotation))
|
||||
}
|
||||
AnimatedVisibility(open, enter = expandVertically(Motion.tw(200)) + fadeIn(Motion.tw(160)),
|
||||
exit = shrinkVertically(Motion.tw(160)) + fadeOut(Motion.tw(120))) {
|
||||
Column(Modifier.fillMaxWidth()) {
|
||||
Box(Modifier.fillMaxWidth().height(1.dp).background(pal.line))
|
||||
// Only top-level groups fold; groups and dialogs opened from inside one draw normally.
|
||||
CompositionLocalProvider(LocalDrawerSections provides null) { content() }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -26,8 +26,7 @@ internal fun DroidDeckHudSettings(host: MenuHost, a: DrawerActions, track: (Stri
|
||||
fun on(key: String) = cfg[key] == "1"
|
||||
fun int(key: String, fallback: Int) = cfg[key]?.toIntOrNull() ?: fallback
|
||||
|
||||
SettingsGroup(stringResource(R.string.drawer_hud), key = "performance-hud",
|
||||
detail = stringResource(if (a.hudOn) R.string.widgets_on else R.string.widgets_off)) {
|
||||
SettingsGroup(stringResource(R.string.drawer_hud)) {
|
||||
ToggleRow(host, "hud", stringResource(R.string.drawer_hud), null, a.hudOn, chipModifier = track("hud"), onChange = a.onHud)
|
||||
if (a.hudOn) ToggleRow(
|
||||
host, "hud-only-during-game", stringResource(R.string.hud_only_during_game),
|
||||
@@ -63,7 +62,7 @@ internal fun DroidDeckHudSettings(host: MenuHost, a: DrawerActions, track: (Stri
|
||||
if (a.dashboardAvailable && a.secondScreenDisplays.isNotEmpty()) BottomStripSettings(host, track)
|
||||
if (!a.hudOn) return
|
||||
|
||||
SettingsGroup(stringResource(R.string.hud_group_look), key = "performance-hud-look") {
|
||||
SettingsGroup(stringResource(R.string.hud_group_look)) {
|
||||
SliderRow(stringResource(R.string.hud_scale), null, int("hudScale", 100), 50..150, step = 5, format = { "$it%" },
|
||||
modifier = track("hud-scale")) { a.onHudSetting("hudScale", it.toString()) }
|
||||
SliderRow(stringResource(R.string.drawer_hud_opacity), null, int("hudOpacity", 80), 0..100, step = 5, format = { "$it%" },
|
||||
@@ -86,7 +85,7 @@ internal fun DroidDeckHudSettings(host: MenuHost, a: DrawerActions, track: (Stri
|
||||
}
|
||||
|
||||
var editing by remember { mutableStateOf(false) }
|
||||
SettingsGroup(stringResource(R.string.hud_group_metrics), key = "performance-hud-metrics") {
|
||||
SettingsGroup(stringResource(R.string.hud_group_metrics)) {
|
||||
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)
|
||||
@@ -104,7 +103,7 @@ internal fun DroidDeckHudSettings(host: MenuHost, a: DrawerActions, track: (Stri
|
||||
)
|
||||
}
|
||||
|
||||
if (on("showTemp") || on("showGpuTemp") || on("showBatteryTemp")) SettingsGroup(stringResource(R.string.hud_group_temps), key = "performance-hud-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) }
|
||||
@@ -130,7 +129,7 @@ internal fun DroidDeckHudSettings(host: MenuHost, a: DrawerActions, track: (Stri
|
||||
}
|
||||
}
|
||||
|
||||
SettingsGroup(stringResource(R.string.hud_group_more), key = "performance-hud-more") {
|
||||
SettingsGroup(stringResource(R.string.hud_group_more)) {
|
||||
ActionRow(stringResource(R.string.hud_export), stringResource(R.string.hud_export_hint),
|
||||
stringResource(R.string.hud_export_button), onClick = a.onHudExport, modifier = track("hud-export"))
|
||||
ActionRow(stringResource(R.string.hud_reset), null, stringResource(R.string.hud_reset_button),
|
||||
@@ -146,7 +145,7 @@ private fun BottomStripSettings(host: MenuHost, track: (String) -> Modifier) {
|
||||
var hudOn by remember { mutableStateOf(SessionPrefs.bottomHud(context)) }
|
||||
var onTabs by remember { mutableStateOf(SessionPrefs.bottomStripOnTabs(context)) }
|
||||
var shown by remember { mutableStateOf(SessionPrefs.bottomStripMetrics(context)) }
|
||||
SettingsGroup(stringResource(R.string.bottom_hud_group), key = "performance-bottom-hud") {
|
||||
SettingsGroup(stringResource(R.string.bottom_hud_group)) {
|
||||
ToggleRow(host, "bottom-hud", stringResource(R.string.bottom_hud_group), null, hudOn,
|
||||
chipModifier = track("bottom-hud")) { on ->
|
||||
hudOn = on
|
||||
|
||||
@@ -1,171 +1,52 @@
|
||||
package com.droiddeck.launcher.ui
|
||||
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.PaddingValues
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material3.ButtonDefaults
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.OutlinedButton
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.focus.FocusRequester
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.droiddeck.launcher.R
|
||||
import com.droiddeck.launcher.gpu.FrameGen
|
||||
import com.droiddeck.launcher.gpu.Lossless
|
||||
|
||||
@Composable
|
||||
internal fun FrameGenMenu(
|
||||
mode: FrameGen.Mode,
|
||||
lossless: Lossless.State,
|
||||
host: MenuHost, mode: FrameGen.Mode, lossless: Lossless.State,
|
||||
onPick: (FrameGen.Mode) -> Unit,
|
||||
onImportLossless: () -> Unit,
|
||||
gameProfileId: String? = null,
|
||||
hasGameOverride: Boolean = false,
|
||||
onResetGame: () -> Unit = {},
|
||||
focusModifier: Modifier = Modifier,
|
||||
legacyButtons: Boolean = false,
|
||||
) {
|
||||
val need = when {
|
||||
lossless.ready -> null
|
||||
lossless.owned -> stringResource(R.string.lsfg_needs_install)
|
||||
else -> stringResource(R.string.lsfg_needs_steam)
|
||||
}
|
||||
val selectedEngine = mode.engine.takeIf { it != FrameGen.ENGINE_OFF }
|
||||
val offLabel = FrameGen.label(LocalContext.current, FrameGen.Mode.OFF)
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val engines = listOf(FrameGen.ENGINE_LSFG to "LSFG", FrameGen.ENGINE_DDFG to "DDFG")
|
||||
|
||||
Column(Modifier.fillMaxWidth().padding(start = 10.dp, end = 10.dp, top = 0.dp, bottom = 8.dp)) {
|
||||
if (!legacyButtons) OutlinedButton(
|
||||
onClick = { onPick(FrameGen.Mode.OFF.copy(multiplier = mode.multiplier)) },
|
||||
modifier = Modifier.fillMaxWidth().controllerConfirm(
|
||||
onClick = { onPick(FrameGen.Mode.OFF.copy(multiplier = mode.multiplier)) },
|
||||
),
|
||||
contentPadding = PaddingValues(horizontal = 12.dp, vertical = 8.dp),
|
||||
colors = ButtonDefaults.outlinedButtonColors(
|
||||
containerColor = if (selectedEngine == null) colors.primary.copy(alpha = 0.16f) else colors.surface,
|
||||
contentColor = if (selectedEngine == null) colors.primary else colors.onSurface,
|
||||
),
|
||||
) { Text(offLabel) }
|
||||
|
||||
Row(Modifier.fillMaxWidth().then(if (legacyButtons) Modifier else Modifier.padding(top = 8.dp)), horizontalArrangement = Arrangement.spacedBy(8.dp)) {
|
||||
val focusIndex = engines.indexOfFirst { (engine, _) ->
|
||||
selectedEngine == engine || engine != FrameGen.ENGINE_LSFG || lossless.ready
|
||||
}
|
||||
engines.forEachIndexed { index, (engine, label) ->
|
||||
val selected = selectedEngine == engine
|
||||
val enabled = selected || engine != FrameGen.ENGINE_LSFG || lossless.ready
|
||||
val pick = {
|
||||
onPick(if (selected) FrameGen.Mode.OFF.copy(multiplier = mode.multiplier) else FrameGen.Mode(engine, mode.multiplier.coerceIn(2, 4)))
|
||||
}
|
||||
OutlinedButton(
|
||||
onClick = pick,
|
||||
enabled = enabled,
|
||||
modifier = (if (index == focusIndex) focusModifier else Modifier)
|
||||
.weight(1f).controllerConfirm(enabled = enabled, onClick = pick),
|
||||
contentPadding = PaddingValues(horizontal = 12.dp, vertical = 8.dp),
|
||||
colors = ButtonDefaults.outlinedButtonColors(
|
||||
containerColor = if (selected) colors.primary.copy(alpha = 0.16f) else colors.surface,
|
||||
contentColor = if (selected) colors.primary else colors.onSurface,
|
||||
),
|
||||
) { Text(label) }
|
||||
}
|
||||
val context = LocalContext.current
|
||||
AnchoredMenu(host.open == "fg", onDismiss = { if (host.open == "fg") host.open = null }, title = stringResource(R.string.frame_gen_title)) { firstItemFocus ->
|
||||
val need = when {
|
||||
lossless.ready -> null
|
||||
lossless.owned -> stringResource(R.string.lsfg_needs_install)
|
||||
else -> stringResource(R.string.lsfg_needs_steam)
|
||||
}
|
||||
|
||||
if (selectedEngine != null) {
|
||||
val multiplierEnabled = mode.engine != FrameGen.ENGINE_LSFG || lossless.ready
|
||||
Row(
|
||||
Modifier.fillMaxWidth().padding(top = 8.dp),
|
||||
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
||||
) {
|
||||
(2..4).forEach { multiplier ->
|
||||
val selected = mode.multiplier == multiplier && mode.target == 0
|
||||
val pickMultiplier = {
|
||||
onPick(mode.copy(multiplier = multiplier, target = 0))
|
||||
}
|
||||
OutlinedButton(
|
||||
onClick = pickMultiplier,
|
||||
enabled = multiplierEnabled,
|
||||
modifier = Modifier.weight(1f).controllerConfirm(
|
||||
enabled = multiplierEnabled,
|
||||
onClick = pickMultiplier,
|
||||
),
|
||||
contentPadding = PaddingValues(horizontal = 12.dp, vertical = 8.dp),
|
||||
colors = ButtonDefaults.outlinedButtonColors(
|
||||
containerColor = if (selected) colors.secondary.copy(alpha = 0.18f) else colors.surface,
|
||||
contentColor = if (selected) colors.secondary else colors.onSurface,
|
||||
),
|
||||
) { Text("${multiplier}×") }
|
||||
}
|
||||
@Composable
|
||||
fun item(m: FrameGen.Mode, enabled: Boolean = true, detail: String? = null, focus: FocusRequester? = null) =
|
||||
MenuItem(FrameGen.label(context, m), checked = mode == m, enabled = enabled, detail = detail, focusRequester = focus) {
|
||||
onPick(m); host.open = null
|
||||
}
|
||||
}
|
||||
|
||||
if (selectedEngine == FrameGen.ENGINE_LSFG) {
|
||||
Row(
|
||||
Modifier.fillMaxWidth().padding(top = 8.dp),
|
||||
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
||||
) {
|
||||
FrameGen.ADAPTIVE_TARGETS.forEach { target ->
|
||||
val adaptiveMode = FrameGen.Mode(FrameGen.ENGINE_LSFG, target = target)
|
||||
val selected = mode.target == target
|
||||
val pickTarget = { onPick(adaptiveMode) }
|
||||
OutlinedButton(
|
||||
onClick = pickTarget,
|
||||
enabled = lossless.ready,
|
||||
modifier = Modifier.weight(1f).controllerConfirm(
|
||||
enabled = lossless.ready,
|
||||
onClick = pickTarget,
|
||||
),
|
||||
contentPadding = PaddingValues(horizontal = 8.dp, vertical = 8.dp),
|
||||
colors = ButtonDefaults.outlinedButtonColors(
|
||||
containerColor = if (selected) colors.secondary.copy(alpha = 0.18f) else colors.surface,
|
||||
contentColor = if (selected) colors.secondary else colors.onSurface,
|
||||
),
|
||||
) {
|
||||
Text(FrameGen.label(LocalContext.current, adaptiveMode))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (selectedEngine == FrameGen.ENGINE_LSFG && !lossless.ready) {
|
||||
Text(need.orEmpty(), color = colors.onSurfaceVariant,
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
modifier = Modifier.padding(top = 6.dp))
|
||||
}
|
||||
|
||||
item(FrameGen.Mode.OFF, focus = firstItemFocus)
|
||||
if (gameProfileId != null) {
|
||||
val resetGame = onResetGame
|
||||
OutlinedButton(
|
||||
onClick = resetGame,
|
||||
modifier = Modifier.fillMaxWidth().padding(top = 8.dp)
|
||||
.controllerConfirm(onClick = resetGame),
|
||||
contentPadding = PaddingValues(horizontal = 12.dp, vertical = 8.dp),
|
||||
) {
|
||||
Text(stringResource(R.string.comp_game_use_general) + if (hasGameOverride) "" else " ✓")
|
||||
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) }
|
||||
lsfg.forEachIndexed { i, m -> item(m, enabled = lossless.ready, detail = need.takeIf { i == 0 }) }
|
||||
if (lossless.owned) {
|
||||
val using = when (lossless.source) {
|
||||
Lossless.Source.STEAM -> stringResource(R.string.lsfg_using_steam)
|
||||
Lossless.Source.IMPORT -> stringResource(R.string.lsfg_using_import)
|
||||
Lossless.Source.NONE -> null
|
||||
}
|
||||
OutlinedButton(
|
||||
onClick = onImportLossless,
|
||||
modifier = Modifier.fillMaxWidth().padding(top = 8.dp)
|
||||
.controllerConfirm(onClick = onImportLossless),
|
||||
contentPadding = PaddingValues(horizontal = 12.dp, vertical = 8.dp),
|
||||
) {
|
||||
Text(stringResource(R.string.lsfg_import) + (using?.let { " · $it" } ?: ""))
|
||||
}
|
||||
MenuItem(stringResource(R.string.lsfg_import), checked = false, detail = using) { host.open = null; onImportLossless() }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -107,7 +107,7 @@ import java.io.File
|
||||
internal fun Pane(
|
||||
s: FrontEndState, selected: String, a: FrontEndActions, page: (@Composable () -> Unit)?, modifier: Modifier,
|
||||
onSelect: (String) -> Unit, onAndroidAppClick: (HomeApp.LaunchableApp) -> Unit,
|
||||
onPairWirelessDebugging: () -> Unit,
|
||||
onOpenDeveloperOptions: () -> Unit, onRequestWirelessAdb: (Boolean) -> Unit, onPairWirelessDebugging: () -> Unit,
|
||||
) {
|
||||
BoxWithConstraints(modifier = modifier) {
|
||||
CompositionLocalProvider(LocalNarrowPane provides (maxWidth < NarrowPaneWidth)) {
|
||||
@@ -174,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 if (key == "soundtracks") soundShown[0] else key, a, Modifier.fillMaxSize(), onSelect, onAndroidAppClick, 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",
|
||||
)
|
||||
@@ -237,7 +237,7 @@ private fun romFor(s: FrontEndState, selected: String): Pair<Library.Emulator, L
|
||||
private fun Content(
|
||||
s: FrontEndState, selected: String, a: FrontEndActions, modifier: Modifier,
|
||||
onSelect: (String) -> Unit, onAndroidAppClick: (HomeApp.LaunchableApp) -> Unit,
|
||||
onPairWirelessDebugging: () -> Unit,
|
||||
onOpenDeveloperOptions: () -> Unit, onRequestWirelessAdb: (Boolean) -> Unit, onPairWirelessDebugging: () -> Unit,
|
||||
) {
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val detailPosterWidth = if (LocalConfiguration.current.screenHeightDp < 600) 72.dp else 120.dp
|
||||
@@ -247,7 +247,7 @@ private fun Content(
|
||||
val padV = if (narrow) 12.dp else 18.dp
|
||||
if (selected == "setup") {
|
||||
Column(modifier = modifier.padding(horizontal = padH).padding(top = padV)) {
|
||||
SetupPanel(s, a, onPairWirelessDebugging)
|
||||
SetupPanel(s, a, onOpenDeveloperOptions, onRequestWirelessAdb, onPairWirelessDebugging)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@@ -94,6 +94,7 @@ import androidx.compose.ui.layout.boundsInRoot
|
||||
import androidx.compose.ui.layout.LayoutCoordinates
|
||||
import androidx.compose.ui.layout.onGloballyPositioned
|
||||
import androidx.compose.ui.layout.onPlaced
|
||||
import com.droiddeck.launcher.core.PhantomProcessLimit
|
||||
|
||||
internal val AttentionAmber: Color @Composable get() = LocalPalette.current.warning
|
||||
|
||||
@@ -211,7 +212,8 @@ internal fun railLabelIcon(key: String): Pair<Int, ImageVector> = when (key) {
|
||||
else -> R.string.rail_updates to updatesIcon(RunningBuild.kind())
|
||||
}
|
||||
|
||||
internal fun setupNeedsAttention(s: FrontEndState): Boolean = !s.ready || (s.available != null && s.available != s.installed)
|
||||
internal fun setupNeedsAttention(s: FrontEndState): Boolean = !s.ready || (s.available != null && s.available != s.installed) ||
|
||||
PhantomProcessLimit.blocksSteam(s.phantomProcessStatus)
|
||||
|
||||
internal fun railBadge(s: FrontEndState, key: String, setupNeedsAttention: Boolean = setupNeedsAttention(s)): Boolean = when (key) {
|
||||
"setup" -> setupNeedsAttention
|
||||
|
||||
@@ -86,6 +86,8 @@ import com.droiddeck.launcher.gpu.FrameGen
|
||||
import com.droiddeck.launcher.gpu.Lossless
|
||||
import com.droiddeck.launcher.input.SecondScreenDisplay
|
||||
import com.droiddeck.launcher.core.DownloadSource
|
||||
import com.droiddeck.launcher.core.PhantomProcessLimit
|
||||
import com.droiddeck.launcher.core.PhantomProcessStatus
|
||||
import com.droiddeck.launcher.session.SessionPrefs
|
||||
import kotlin.math.roundToInt
|
||||
import kotlinx.coroutines.withTimeoutOrNull
|
||||
@@ -163,12 +165,14 @@ class FrontEndState(
|
||||
val buildLabel: String = "local",
|
||||
val oscMode: String = SessionPrefs.OSC_AUTO,
|
||||
val controller: com.droiddeck.launcher.input.ControllerPrefs.Settings? = null,
|
||||
val phantomProcessStatus: PhantomProcessStatus = PhantomProcessStatus.NOT_APPLICABLE,
|
||||
val adreno: Boolean = true,
|
||||
val vkBridge: Boolean = false,
|
||||
val venus: Boolean = false,
|
||||
val venusHostVulkan: String? = null,
|
||||
val vkBridgeSafe: Boolean = true,
|
||||
val bridgeProtonDxvk: Boolean = false,
|
||||
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,
|
||||
@@ -311,9 +315,15 @@ class FrontEndActions(
|
||||
val onIntegrationLocation: () -> Unit = {},
|
||||
val onAndroidApp: (HomeApp.LaunchableApp, Int?) -> Unit = { _, _ -> },
|
||||
val onBackActionsInverted: (Boolean) -> Unit = {},
|
||||
val onRefreshPhantomStatus: () -> Unit = {},
|
||||
val onOpenDeveloperOptions: (Int?) -> Unit = {},
|
||||
val onStartWirelessAdbPairing: () -> Unit = {},
|
||||
val onStartPairingGuide: (Int?) -> Boolean = { false },
|
||||
val onSetPhantomProcessLimit: (Boolean, (String?) -> Unit) -> Unit,
|
||||
val onCopyPhantomCommand: (Boolean) -> Unit = {},
|
||||
val onDismissPhantomGate: () -> Unit = {},
|
||||
val onStartWirelessAdbPairing: (Boolean) -> Unit = {},
|
||||
val onStartPairingGuide: (Int?, Boolean) -> Boolean = { _, _ -> false },
|
||||
val onShowPhantomGate: () -> Unit = {},
|
||||
val onQueuePlaySteam: () -> Unit = {},
|
||||
val onEnsureNotifications: ((Boolean) -> Unit) -> Unit = { it(true) },
|
||||
val controller: ControllerActions? = null,
|
||||
val updates: UpdatesActions = UpdatesActions(),
|
||||
@@ -501,39 +511,92 @@ private fun FrontEndScreenBody(s: FrontEndState, a: FrontEndActions, page: (@Com
|
||||
if (com.droiddeck.launcher.stores.StoresState.openGameRequest != null) selected = "stores"
|
||||
}
|
||||
var showDeveloperDisplayChoice by rememberSaveable { mutableStateOf(false) }
|
||||
var developerChoiceGuided by rememberSaveable { mutableStateOf(false) }
|
||||
var developerChoiceToggle by rememberSaveable { mutableStateOf(false) }
|
||||
var guidedLimitEnabled by rememberSaveable { mutableStateOf(false) }
|
||||
var appToChooseDisplay by remember { mutableStateOf<HomeApp.LaunchableApp?>(null) }
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val pal = LocalPalette.current
|
||||
val ctx = LocalContext.current
|
||||
val openPairingOn: (Int?) -> Unit = { displayId ->
|
||||
a.onStartWirelessAdbPairing()
|
||||
if (!a.onStartPairingGuide(displayId)) a.onOpenDeveloperOptions(displayId)
|
||||
val phantomGateVisible = s.showPhantomGate && PhantomProcessLimit.blocksSteam(s.phantomProcessStatus)
|
||||
val processSettingsPageVisible = phantomGateVisible || showDeveloperDisplayChoice
|
||||
val requestDeveloperOptions = {
|
||||
developerChoiceGuided = false
|
||||
developerChoiceToggle = false
|
||||
if (s.secondScreenDisplays.isEmpty()) a.onOpenDeveloperOptions(null)
|
||||
else showDeveloperDisplayChoice = true
|
||||
}
|
||||
val startGuidedPairing: () -> Unit = {
|
||||
val openDeveloperOptionsOn: (Int?) -> Unit = { displayId ->
|
||||
if (developerChoiceGuided) a.onStartWirelessAdbPairing(guidedLimitEnabled)
|
||||
val guided = developerChoiceGuided || developerChoiceToggle
|
||||
if (!guided || !a.onStartPairingGuide(displayId, developerChoiceToggle)) a.onOpenDeveloperOptions(displayId)
|
||||
developerChoiceGuided = false
|
||||
developerChoiceToggle = false
|
||||
}
|
||||
val requestChildProcessToggle = {
|
||||
if (!PhantomProcessLimit.hasDeveloperToggle() || com.droiddeck.launcher.core.GlobalSettings.developerOptionsOn(ctx)) {
|
||||
requestDeveloperOptions()
|
||||
} else {
|
||||
developerChoiceGuided = false
|
||||
developerChoiceToggle = true
|
||||
if (s.secondScreenDisplays.isEmpty()) openDeveloperOptionsOn(null)
|
||||
else showDeveloperDisplayChoice = true
|
||||
}
|
||||
}
|
||||
val startGuidedPairing: (Boolean) -> Unit = { enabled ->
|
||||
a.onEnsureNotifications { granted ->
|
||||
if (granted) {
|
||||
if (s.secondScreenDisplays.isEmpty()) openPairingOn(null)
|
||||
guidedLimitEnabled = enabled
|
||||
developerChoiceGuided = true
|
||||
if (s.secondScreenDisplays.isEmpty()) openDeveloperOptionsOn(null)
|
||||
else showDeveloperDisplayChoice = true
|
||||
}
|
||||
}
|
||||
}
|
||||
val childProcessRequest = androidx.compose.runtime.rememberUpdatedState {
|
||||
if (PhantomProcessLimit.hasDeveloperToggle()) requestChildProcessToggle() else a.onShowPhantomGate()
|
||||
}
|
||||
DisposableEffect(Unit) {
|
||||
val handler: () -> Unit = { childProcessRequest.value() }
|
||||
ChildProcessSetup.request = handler
|
||||
onDispose { if (ChildProcessSetup.request === handler) ChildProcessSetup.request = null }
|
||||
}
|
||||
var applyingSavedPairing by remember { mutableStateOf(false) }
|
||||
val fixPhantomLimit = {
|
||||
if (!s.adbPaired || !com.droiddeck.launcher.core.GlobalSettings.wirelessDebuggingOn(ctx)) startGuidedPairing(false)
|
||||
else if (!applyingSavedPairing) {
|
||||
applyingSavedPairing = true
|
||||
a.onSetPhantomProcessLimit(false) { error ->
|
||||
applyingSavedPairing = false
|
||||
if (error != null) startGuidedPairing(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
LaunchedEffect(s.showPhantomGate, s.phantomProcessStatus) {
|
||||
if (phantomGateVisible) {
|
||||
while (true) {
|
||||
kotlinx.coroutines.delay(2_000)
|
||||
a.onRefreshPhantomStatus()
|
||||
}
|
||||
}
|
||||
}
|
||||
val pageBack = { if (!Hops.back(a.onPageBack)) a.onPageBack() }
|
||||
BackHandler(enabled = !showDeveloperDisplayChoice && s.pageKey != null && page != null) { pageBack() }
|
||||
BackHandler(enabled = !processSettingsPageVisible && s.pageKey != null && page != null) { pageBack() }
|
||||
LaunchedEffect(s.pageKey, selected) { Hops.forget(s.pageKey ?: selected) }
|
||||
BackHandler(enabled = !showDeveloperDisplayChoice && s.pageKey == null && Hops.origin?.page == selected) {
|
||||
BackHandler(enabled = !processSettingsPageVisible && s.pageKey == null && Hops.origin?.page == selected) {
|
||||
val rail = Hops.origin?.rail ?: return@BackHandler
|
||||
Hops.back { selected = rail }
|
||||
}
|
||||
val density = androidx.compose.ui.platform.LocalDensity.current.density
|
||||
remember(density) { Hops.density = density; true }
|
||||
BackHandler(
|
||||
enabled = !showDeveloperDisplayChoice && (s.pageKey == null || page == null) &&
|
||||
enabled = !processSettingsPageVisible && (s.pageKey == null || page == null) &&
|
||||
(selected.startsWith("emu:") || selected.startsWith("rom:") || selected.startsWith("user:") || selected == "store"),
|
||||
) {
|
||||
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 = !showDeveloperDisplayChoice && backToMore) {
|
||||
BackHandler(enabled = !processSettingsPageVisible && backToMore) {
|
||||
selected = NavTabs.MORE
|
||||
}
|
||||
LaunchedEffect(s.soundtracksEnabled) {
|
||||
@@ -635,8 +698,8 @@ private fun FrontEndScreenBody(s: FrontEndState, a: FrontEndActions, page: (@Com
|
||||
.onFocusChanged { anyFocused = it.hasFocus },
|
||||
) {
|
||||
val bottomNavigation = maxHeight > maxWidth
|
||||
LaunchedEffect(showDeveloperDisplayChoice) {
|
||||
if (showDeveloperDisplayChoice) return@LaunchedEffect
|
||||
LaunchedEffect(processSettingsPageVisible) {
|
||||
if (processSettingsPageVisible) return@LaunchedEffect
|
||||
snapshotFlow { window.isWindowFocused }.first { it }
|
||||
if (inputModeManager.inputMode != InputMode.Keyboard) inputModeManager.requestInputMode(InputMode.Keyboard)
|
||||
if (s.dualScreen && frontFocus.primaryAttached == 0) focusDualPane()
|
||||
@@ -646,12 +709,12 @@ private fun FrontEndScreenBody(s: FrontEndState, a: FrontEndActions, page: (@Com
|
||||
LaunchedEffect(s.pageKey) {
|
||||
val closed = openPage != null && s.pageKey == null
|
||||
openPage = s.pageKey
|
||||
if (!closed || frontFocus.focusedRail != null || showDeveloperDisplayChoice || inputModeManager.inputMode != InputMode.Keyboard) return@LaunchedEffect
|
||||
if (!closed || frontFocus.focusedRail != null || processSettingsPageVisible || inputModeManager.inputMode != InputMode.Keyboard) return@LaunchedEffect
|
||||
withFrameNanos { }
|
||||
runCatching { frontFocus.paneEntry().requestFocus() }
|
||||
}
|
||||
LaunchedEffect(selected, s.pageKey, showDeveloperDisplayChoice) {
|
||||
if (showDeveloperDisplayChoice) return@LaunchedEffect
|
||||
LaunchedEffect(selected, s.pageKey, processSettingsPageVisible) {
|
||||
if (processSettingsPageVisible) return@LaunchedEffect
|
||||
kotlinx.coroutines.delay(Motion.ms(PAGE_EXIT_MS).toLong())
|
||||
if (inputModeManager.inputMode != InputMode.Keyboard) return@LaunchedEffect
|
||||
if (s.pageKey == "performance") {
|
||||
@@ -666,7 +729,7 @@ private fun FrontEndScreenBody(s: FrontEndState, a: FrontEndActions, page: (@Com
|
||||
else focusWithinFrames({ anyFocused }) { if (frontFocus.primaryAttached > 0) frontFocus.primary else frontFocus.railFor(railSelection) }
|
||||
}
|
||||
LaunchedEffect(railPicks) {
|
||||
if (railPicks == 0 || showDeveloperDisplayChoice) return@LaunchedEffect
|
||||
if (railPicks == 0 || processSettingsPageVisible) return@LaunchedEffect
|
||||
kotlinx.coroutines.delay(Motion.ms(PAGE_EXIT_MS).toLong())
|
||||
if (inputModeManager.inputMode != InputMode.Keyboard) return@LaunchedEffect
|
||||
val entry = withTimeoutOrNull(1_000) { snapshotFlow { frontFocus.primaryAttached > 0 }.first { it } }
|
||||
@@ -704,7 +767,7 @@ private fun FrontEndScreenBody(s: FrontEndState, a: FrontEndActions, page: (@Com
|
||||
}
|
||||
var screenAt by remember { mutableStateOf(Offset.Zero) }
|
||||
if (s.dualScreen) DualPanelPublisher(s, railSelection, openTab, { key ->
|
||||
if (showDeveloperDisplayChoice) return@DualPanelPublisher
|
||||
if (processSettingsPageVisible) return@DualPanelPublisher
|
||||
if (inputModeManager.inputMode != InputMode.Keyboard) inputModeManager.requestInputMode(InputMode.Keyboard)
|
||||
focusManager.clearFocus(force = true)
|
||||
onRailSelect(key)
|
||||
@@ -713,7 +776,7 @@ private fun FrontEndScreenBody(s: FrontEndState, a: FrontEndActions, page: (@Com
|
||||
val pageKeyNow = androidx.compose.runtime.rememberUpdatedState(s.pageKey)
|
||||
var railHold by remember { mutableStateOf<kotlinx.coroutines.Job?>(null) }
|
||||
val tabStep = androidx.compose.runtime.rememberUpdatedState { step: Int ->
|
||||
if (!showDeveloperDisplayChoice) {
|
||||
if (!processSettingsPageVisible) {
|
||||
val keys = navigationKeys(s)
|
||||
keys.getOrNull(keys.indexOf(railSelectionNow.value) + step)?.let { key ->
|
||||
PageSwipe.direction = step
|
||||
@@ -758,7 +821,7 @@ private fun FrontEndScreenBody(s: FrontEndState, a: FrontEndActions, page: (@Com
|
||||
) {
|
||||
Pane(
|
||||
s, selected, a, page,
|
||||
Modifier.fillMaxSize().then(paneFocus).pageSwipe({ !showDeveloperDisplayChoice && appToChooseDisplay == null }, edgeGuard = { !bottomNavigation }) { dir ->
|
||||
Modifier.fillMaxSize().then(paneFocus).pageSwipe({ !processSettingsPageVisible && appToChooseDisplay == null }, edgeGuard = { !bottomNavigation }) { dir ->
|
||||
val keys = navigationKeys(s)
|
||||
val at = keys.indexOf(railSelectionNow.value)
|
||||
if (at >= 0) keys.getOrNull(at + dir)?.let { key ->
|
||||
@@ -771,7 +834,9 @@ private fun FrontEndScreenBody(s: FrontEndState, a: FrontEndActions, page: (@Com
|
||||
if (s.secondScreenDisplays.isEmpty() && s.ownScreen == null) a.onAndroidApp(app, null)
|
||||
else appToChooseDisplay = app
|
||||
},
|
||||
onPairWirelessDebugging = startGuidedPairing,
|
||||
onOpenDeveloperOptions = requestChildProcessToggle,
|
||||
onPairWirelessDebugging = { startGuidedPairing(false) },
|
||||
onRequestWirelessAdb = startGuidedPairing,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -803,6 +868,18 @@ private fun FrontEndScreenBody(s: FrontEndState, a: FrontEndActions, page: (@Com
|
||||
onDismiss = { appToChooseDisplay = null },
|
||||
)
|
||||
}
|
||||
if (phantomGateVisible) {
|
||||
Box(Modifier.fillMaxSize().background(colors.background)) {
|
||||
PhantomProcessGatePage(
|
||||
status = s.phantomProcessStatus,
|
||||
onDismiss = a.onDismissPhantomGate,
|
||||
onOpenDeveloperOptions = requestChildProcessToggle,
|
||||
applyingSavedPairing = applyingSavedPairing,
|
||||
onFixWithWirelessDebugging = fixPhantomLimit,
|
||||
onCopyCommand = { a.onCopyPhantomCommand(false) },
|
||||
)
|
||||
}
|
||||
}
|
||||
if (showDeveloperDisplayChoice) {
|
||||
DeveloperDisplayChoiceDialog(
|
||||
displays = s.secondScreenDisplays.map { display ->
|
||||
@@ -810,14 +887,16 @@ private fun FrontEndScreenBody(s: FrontEndState, a: FrontEndActions, page: (@Com
|
||||
},
|
||||
onMainScreen = {
|
||||
showDeveloperDisplayChoice = false
|
||||
openPairingOn(null)
|
||||
openDeveloperOptionsOn(null)
|
||||
},
|
||||
onSecondaryScreen = { displayId ->
|
||||
showDeveloperDisplayChoice = false
|
||||
openPairingOn(displayId)
|
||||
openDeveloperOptionsOn(displayId)
|
||||
},
|
||||
onDismiss = {
|
||||
showDeveloperDisplayChoice = false
|
||||
developerChoiceGuided = false
|
||||
developerChoiceToggle = false
|
||||
},
|
||||
)
|
||||
}
|
||||
@@ -826,7 +905,7 @@ private fun FrontEndScreenBody(s: FrontEndState, a: FrontEndActions, page: (@Com
|
||||
(s.pageKey == null && Hops.origin?.page == selected) ||
|
||||
((s.pageKey == null || page == null) &&
|
||||
(selected.startsWith("emu:") || selected.startsWith("rom:") || selected.startsWith("user:") || selected == "store"))
|
||||
val exitArmed = !showDeveloperDisplayChoice && !hasBackTarget
|
||||
val exitArmed = !processSettingsPageVisible && !hasBackTarget
|
||||
LaunchedEffect(exitArmed, selected) { ExitGesture.reset() }
|
||||
BackHandler(enabled = exitArmed && DevPreview.drawer == null) {
|
||||
when (ExitGesture.back()) {
|
||||
@@ -843,6 +922,10 @@ private fun FrontEndScreenBody(s: FrontEndState, a: FrontEndActions, page: (@Com
|
||||
}
|
||||
}
|
||||
|
||||
internal object ChildProcessSetup {
|
||||
@Volatile var request: (() -> Unit)? = null
|
||||
}
|
||||
|
||||
internal object MainTabSteps {
|
||||
@Volatile var handler: ((Int) -> Unit)? = null
|
||||
@Volatile var otherKeys = 0
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
package com.droiddeck.launcher.ui
|
||||
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.lifecycle.Lifecycle
|
||||
import androidx.lifecycle.LifecycleEventObserver
|
||||
import androidx.compose.ui.platform.LocalLifecycleOwner
|
||||
import androidx.compose.ui.focus.focusRequester
|
||||
import androidx.compose.ui.focus.FocusRequester
|
||||
import android.os.Build
|
||||
@@ -53,7 +50,6 @@ 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.collectAsState
|
||||
import androidx.compose.runtime.getValue
|
||||
@@ -83,6 +79,8 @@ import androidx.compose.ui.layout.onGloballyPositioned
|
||||
import com.droiddeck.launcher.core.AppLanguage
|
||||
import com.droiddeck.launcher.core.DeviceSupport
|
||||
import com.droiddeck.launcher.core.DownloadSource
|
||||
import com.droiddeck.launcher.core.PhantomProcessLimit
|
||||
import com.droiddeck.launcher.core.PhantomProcessStatus
|
||||
import com.droiddeck.launcher.session.SessionPrefs
|
||||
import com.droiddeck.launcher.stores.download.StoreDownloadTier
|
||||
import com.droiddeck.launcher.R
|
||||
@@ -148,24 +146,28 @@ internal fun CheckRow(state: CheckState, title: String, detail: String?, divider
|
||||
internal fun SetupPanel(
|
||||
s: FrontEndState,
|
||||
a: FrontEndActions,
|
||||
onOpenDeveloperOptions: () -> Unit,
|
||||
onRequestWirelessAdb: (Boolean) -> Unit,
|
||||
onPairWirelessDebugging: () -> Unit,
|
||||
) {
|
||||
val host = rememberMenuHost()
|
||||
val ctx = LocalContext.current
|
||||
var steamOrientation by remember { mutableStateOf(SessionPrefs.orientation(ctx, "steam")) }
|
||||
var desktopOrientation by remember { mutableStateOf(SessionPrefs.orientation(ctx, "desktop")) }
|
||||
val lifecycleOwner = LocalLifecycleOwner.current
|
||||
DisposableEffect(lifecycleOwner, ctx) {
|
||||
val observer = LifecycleEventObserver { _, event ->
|
||||
if (event == Lifecycle.Event.ON_RESUME) {
|
||||
steamOrientation = SessionPrefs.orientation(ctx, "steam")
|
||||
desktopOrientation = SessionPrefs.orientation(ctx, "desktop")
|
||||
var hideHomeFromRecents by remember { mutableStateOf(com.droiddeck.launcher.core.AppUiPrefs.hideHomeFromRecents(ctx)) }
|
||||
var processLimitBusy by remember { mutableStateOf(false) }
|
||||
var processLimitMessage by remember { mutableStateOf<String?>(null) }
|
||||
val setProcessLimit: (Boolean) -> Unit = { enabled ->
|
||||
processLimitBusy = true
|
||||
processLimitMessage = null
|
||||
a.onSetPhantomProcessLimit(enabled) { error ->
|
||||
processLimitBusy = false
|
||||
if (error == null) {
|
||||
a.onRefreshPhantomStatus()
|
||||
} else {
|
||||
processLimitMessage = ctx.getString(R.string.setup_limit_adb_failed)
|
||||
onRequestWirelessAdb(enabled)
|
||||
}
|
||||
}
|
||||
lifecycleOwner.lifecycle.addObserver(observer)
|
||||
onDispose { lifecycleOwner.lifecycle.removeObserver(observer) }
|
||||
}
|
||||
var hideHomeFromRecents by remember { mutableStateOf(com.droiddeck.launcher.core.AppUiPrefs.hideHomeFromRecents(ctx)) }
|
||||
val runtime = when {
|
||||
s.busy -> stringResource(R.string.common_working)
|
||||
s.removalPending -> stringResource(R.string.setup_retry_removal)
|
||||
@@ -178,7 +180,9 @@ internal fun SetupPanel(
|
||||
val gpu = remember { com.droiddeck.launcher.gpu.GpuInfo.detect() }
|
||||
val gpuOk = gpu.support == com.droiddeck.launcher.gpu.GpuInfo.Support.TESTED || s.vkBridge
|
||||
val gpuName = remember { DeviceSupport.gpuName(ctx) }
|
||||
val limitBlocks = PhantomProcessLimit.blocksSteam(s.phantomProcessStatus)
|
||||
val signedIn = s.offlineAccount != null
|
||||
var showLimitDetails by rememberSaveable { mutableStateOf(false) }
|
||||
var editSgdbKey by remember { mutableStateOf(false) }
|
||||
var editDownloadPrefix by remember { mutableStateOf(false) }
|
||||
var editDownloadProxy by remember { mutableStateOf(false) }
|
||||
@@ -210,6 +214,12 @@ internal fun SetupPanel(
|
||||
var tabTurned by remember { mutableStateOf(false) }
|
||||
val pick: (Int) -> Unit = { i -> tab = i; tabTurned = true; searching = false; query = ""; if (i == DEVELOPER_TAB) logsRefresh++ }
|
||||
val inputModeManager = LocalInputModeManager.current
|
||||
LaunchedEffect(Unit) {
|
||||
while (true) {
|
||||
kotlinx.coroutines.delay(2_000)
|
||||
a.onRefreshPhantomStatus()
|
||||
}
|
||||
}
|
||||
LaunchedEffect(tab) {
|
||||
if (tabTurned && inputModeManager.inputMode == InputMode.Keyboard) {
|
||||
androidx.compose.runtime.withFrameNanos { }
|
||||
@@ -217,7 +227,7 @@ internal fun SetupPanel(
|
||||
}
|
||||
}
|
||||
val runtimeOk = s.ready && !s.busy && !s.removalPending
|
||||
val checks = listOf(gpuOk, runtimeOk, signedIn)
|
||||
val checks = listOf(gpuOk, runtimeOk, !limitBlocks, signedIn)
|
||||
val passing = checks.count { it }
|
||||
var showChecks by rememberSaveable { mutableStateOf(s.vkBridge) }
|
||||
Rise(0, Modifier.fillMaxSize()) {
|
||||
@@ -244,7 +254,7 @@ internal fun SetupPanel(
|
||||
if (listing) SettingsSearchResults(query) { section -> pick(section.ordinal) }
|
||||
else when (tab) {
|
||||
OVERVIEW_TAB -> {
|
||||
OnboardingCard()
|
||||
OnboardingCard(limitBlocks, a.onShowPhantomGate)
|
||||
// Setup's "Safe mode" row, under the GPU row while the bridge is on and can be used here.
|
||||
val bridgeModeRow = !s.adreno && s.vkBridge && com.droiddeck.launcher.core.DeviceSupport.bridgeUsable()
|
||||
val gpuCheck: @Composable (Boolean) -> Unit = { divider ->
|
||||
@@ -333,6 +343,41 @@ internal fun SetupPanel(
|
||||
if (divider) Box(Modifier.fillMaxWidth().height(1.dp).background(pal.line))
|
||||
}
|
||||
}
|
||||
val limitCheck: @Composable (Boolean) -> Unit = { divider ->
|
||||
CheckRow(
|
||||
if (limitBlocks) CheckState.WARN else CheckState.OK,
|
||||
stringResource(R.string.setup_limit),
|
||||
when (s.phantomProcessStatus) {
|
||||
PhantomProcessStatus.ENABLED -> stringResource(R.string.setup_limit_on)
|
||||
PhantomProcessStatus.UNSET -> stringResource(R.string.setup_limit_unset)
|
||||
PhantomProcessStatus.UNREADABLE -> stringResource(R.string.setup_limit_unknown)
|
||||
else -> PhantomProcessLimit.title(ctx, s.phantomProcessStatus)
|
||||
},
|
||||
divider = divider && !showLimitDetails,
|
||||
) {
|
||||
if (limitBlocks) PrimaryButton(stringResource(R.string.setup_fix_it), compact = true, onClick = a.onShowPhantomGate)
|
||||
else if (s.phantomProcessStatus != PhantomProcessStatus.NOT_APPLICABLE) {
|
||||
SecondaryButton(if (showLimitDetails) stringResource(R.string.common_hide) else stringResource(R.string.setup_details), compact = true) { showLimitDetails = !showLimitDetails }
|
||||
}
|
||||
}
|
||||
AnimatedVisibility(showLimitDetails, enter = expandVertically(Motion.sp(1f)) + fadeIn(Motion.sp(1f)), exit = shrinkVertically(Motion.sp(1f)) + fadeOut(Motion.sp(1f))) {
|
||||
Column(modifier = Modifier.fillMaxWidth().padding(start = 56.dp, end = 14.dp, top = 4.dp, bottom = 10.dp)) {
|
||||
Text(
|
||||
if (limitBlocks) PhantomProcessLimit.gateInstructions(ctx, s.phantomProcessStatus)
|
||||
else PhantomProcessLimit.instructions(ctx, s.phantomProcessStatus),
|
||||
fontSize = 14.sp, color = colors.onSurfaceVariant, modifier = Modifier.padding(vertical = 4.dp),
|
||||
)
|
||||
Actions {
|
||||
if (s.phantomProcessStatus == PhantomProcessStatus.DISABLED) {
|
||||
SecondaryButton(stringResource(R.string.setup_limit_turn_on), compact = true, enabled = !processLimitBusy) { setProcessLimit(true) }
|
||||
}
|
||||
}
|
||||
if (processLimitBusy) LinearProgressIndicator(modifier = Modifier.fillMaxWidth().padding(vertical = 6.dp))
|
||||
processLimitMessage?.let { Text(it, fontSize = 14.sp, color = colors.onSurfaceVariant, modifier = Modifier.padding(vertical = 4.dp)) }
|
||||
}
|
||||
}
|
||||
if (divider && showLimitDetails) Box(Modifier.fillMaxWidth().height(1.dp).background(pal.line))
|
||||
}
|
||||
val accountCheck: @Composable (Boolean) -> Unit = { divider ->
|
||||
CheckRow(
|
||||
if (signedIn) CheckState.OK else CheckState.WARN,
|
||||
@@ -347,12 +392,13 @@ internal fun SetupPanel(
|
||||
divider = divider,
|
||||
)
|
||||
}
|
||||
val all = listOf(gpuCheck, runtimeCheck, accountCheck)
|
||||
val all = listOf(gpuCheck, runtimeCheck, limitCheck, accountCheck)
|
||||
ReadinessCard(
|
||||
passing, checks.size,
|
||||
listOfNotNull(
|
||||
gpu.displayName(ctx),
|
||||
s.installed?.let { stringResource(R.string.setup_ready_runtime, it) },
|
||||
stringResource(R.string.setup_ready_limit_off).takeIf { !limitBlocks },
|
||||
s.offlineAccount?.takeIf { it.isNotEmpty() }?.let { stringResource(R.string.setup_ready_signed_in, it) },
|
||||
).joinToString(" · "),
|
||||
open = showChecks, onDetails = { showChecks = !showChecks },
|
||||
@@ -470,27 +516,7 @@ internal fun SetupPanel(
|
||||
ChoiceRow(
|
||||
host, "orientation", stringResource(R.string.setup_session_orientation), stringResource(R.string.setup_session_orientation_hint),
|
||||
SessionPrefs.orientationOptions.map { (value, label) -> value to stringResource(label) },
|
||||
s.orientation, onPick = { value ->
|
||||
a.onOrientation(value)
|
||||
steamOrientation = SessionPrefs.orientation(ctx, "steam")
|
||||
desktopOrientation = SessionPrefs.orientation(ctx, "desktop")
|
||||
},
|
||||
)
|
||||
ChoiceRow(
|
||||
host, "orientation-steam", stringResource(R.string.setup_session_orientation) + " (Steam)", stringResource(R.string.setup_session_orientation_hint),
|
||||
SessionPrefs.orientationOptions.map { (value, label) -> value to stringResource(label) },
|
||||
steamOrientation, onPick = { value ->
|
||||
steamOrientation = value
|
||||
SessionPrefs.setOrientation(ctx, "steam", value)
|
||||
},
|
||||
)
|
||||
ChoiceRow(
|
||||
host, "orientation-desktop", stringResource(R.string.setup_session_orientation) + " (Desktop)", stringResource(R.string.setup_session_orientation_hint),
|
||||
SessionPrefs.orientationOptions.map { (value, label) -> value to stringResource(label) },
|
||||
desktopOrientation, onPick = { value ->
|
||||
desktopOrientation = value
|
||||
SessionPrefs.setOrientation(ctx, "desktop", value)
|
||||
},
|
||||
s.orientation, onPick = a.onOrientation,
|
||||
)
|
||||
ToggleRow(
|
||||
host, "launcher-fullscreen", stringResource(R.string.setup_fullscreen),
|
||||
@@ -766,7 +792,7 @@ internal fun ReadinessCard(
|
||||
|
||||
@Composable
|
||||
private fun FrameGenMenu(s: FrontEndState, a: FrontEndActions, host: MenuHost) {
|
||||
FrameGenMenu(s.frameGen, s.lossless, a.onFrameGenPick, a.onImportLossless, legacyButtons = true)
|
||||
FrameGenMenu(host, s.frameGen, s.lossless, a.onFrameGenPick, a.onImportLossless)
|
||||
}
|
||||
|
||||
@Composable
|
||||
@@ -814,7 +840,8 @@ internal fun LaunchSettings(s: FrontEndState, a: FrontEndActions, host: MenuHost
|
||||
) {
|
||||
host.open = if (host.open == "fg") null else "fg"
|
||||
}
|
||||
if (host.open == "fg") FrameGenMenu(
|
||||
FrameGenMenu(
|
||||
host = host,
|
||||
mode = if (frameGenProfileKey != null) gameFrameGenMode else s.frameGen,
|
||||
lossless = s.lossless,
|
||||
onPick = { mode ->
|
||||
@@ -828,7 +855,6 @@ internal fun LaunchSettings(s: FrontEndState, a: FrontEndActions, host: MenuHost
|
||||
}
|
||||
},
|
||||
onImportLossless = a.onImportLossless,
|
||||
legacyButtons = true,
|
||||
gameProfileId = frameGenProfileKey,
|
||||
hasGameOverride = gameFrameGenOverride,
|
||||
onResetGame = {
|
||||
@@ -1255,7 +1281,7 @@ private fun CustomColorRows() {
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun OnboardingCard() {
|
||||
internal fun OnboardingCard(limitBlocks: Boolean = false, onSetUpLimit: () -> Unit = {}) {
|
||||
val active by com.droiddeck.launcher.session.Onboarding.active.collectAsState()
|
||||
val failed by com.droiddeck.launcher.session.Onboarding.failed.collectAsState()
|
||||
val facts by com.droiddeck.launcher.session.Onboarding.facts.collectAsState()
|
||||
@@ -1301,5 +1327,18 @@ internal fun OnboardingCard() {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (limitBlocks) {
|
||||
Box(Modifier.fillMaxWidth().height(1.dp).background(pal.line))
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(12.dp),
|
||||
modifier = Modifier.fillMaxWidth().padding(horizontal = 14.dp, vertical = 10.dp),
|
||||
) {
|
||||
Column(Modifier.weight(1f)) {
|
||||
Text(stringResource(R.string.setup_limit), fontSize = 15.sp, fontWeight = FontWeight.SemiBold, color = colors.onBackground)
|
||||
Text(stringResource(R.string.onboarding_limit_reason), fontSize = 13.sp, color = colors.onSurfaceVariant)
|
||||
}
|
||||
PrimaryButton(stringResource(R.string.onboarding_limit_action), compact = true, onClick = onSetUpLimit)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,9 +23,6 @@ import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.DisposableEffect
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.draw.clip
|
||||
@@ -34,7 +31,6 @@ import androidx.compose.ui.semantics.Role
|
||||
import androidx.compose.ui.unit.IntOffset
|
||||
import androidx.compose.ui.unit.sp
|
||||
import androidx.compose.runtime.getValue
|
||||
import com.droiddeck.launcher.session.SessionPrefs
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.SolidColor
|
||||
@@ -71,21 +67,6 @@ internal val GlassesIcon: ImageVector by lazy {
|
||||
}.build()
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun rememberShowGlassesShortcut(): Boolean {
|
||||
val context = LocalContext.current
|
||||
var show by remember(context) { mutableStateOf(SessionPrefs.showGlassesShortcut(context)) }
|
||||
DisposableEffect(context) {
|
||||
val preferences = context.getSharedPreferences("session", android.content.Context.MODE_PRIVATE)
|
||||
val listener = android.content.SharedPreferences.OnSharedPreferenceChangeListener { _, key ->
|
||||
if (key == "showGlassesShortcut") show = SessionPrefs.showGlassesShortcut(context)
|
||||
}
|
||||
preferences.registerOnSharedPreferenceChangeListener(listener)
|
||||
onDispose { preferences.unregisterOnSharedPreferenceChangeListener(listener) }
|
||||
}
|
||||
return show
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun rememberGlasses(): Pair<GlassesState, GlassesSettings> {
|
||||
val g by Glasses.state.collectAsState()
|
||||
@@ -107,7 +88,7 @@ internal fun VrControllerGroups(host: MenuHost, track: (String) -> Modifier = {
|
||||
androidx.compose.runtime.LaunchedEffect(Unit) { com.droiddeck.launcher.input.VrControllers.load(context) }
|
||||
val c by com.droiddeck.launcher.input.VrControllers.settings.collectAsState()
|
||||
val emulate = com.droiddeck.launcher.input.VrControllers.Emulate.entries
|
||||
SettingsGroup(stringResource(R.string.vr_controllers_group), key = "vr-controllers") {
|
||||
SettingsGroup(stringResource(R.string.vr_controllers_group)) {
|
||||
ChoiceRow(host, "vr-emulate", stringResource(R.string.vr_controllers_emulate), stringResource(R.string.vr_controllers_emulate_hint),
|
||||
emulate.map { it to stringResource(when (it) {
|
||||
com.droiddeck.launcher.input.VrControllers.Emulate.OFF -> R.string.vr_controllers_off
|
||||
@@ -152,7 +133,6 @@ internal fun GlassesGroups(
|
||||
) {
|
||||
val display = tab == null || tab == GlassesTab.DISPLAY
|
||||
val vr = tab == null || tab == GlassesTab.VR
|
||||
val showShortcut = rememberShowGlassesShortcut()
|
||||
val picture = GlassesRendering.picture(s, g.sbs, steamVrRunning)
|
||||
val usesGlasses = GlassesRendering.usesGlasses(g, outputActive, steamVrRunning)
|
||||
val spatialTracking = g.spatialConnected && s.positionalTracking
|
||||
@@ -162,13 +142,13 @@ internal fun GlassesGroups(
|
||||
val directView = usesGlasses && picture == GlassesRendering.Picture.STEREO
|
||||
val menuScreen = !inSession && g.usable && s.gameOnGlasses && s.screen3dof
|
||||
if (g.canControl && onRecenter != null && s.headTracking && (virtualScreen || menuScreen || (directView && steamVrRunning))) {
|
||||
SettingsGroup(stringResource(R.string.glasses_quick_actions), compact = true, key = "vr-glasses-quick") {
|
||||
SettingsGroup(stringResource(R.string.glasses_quick_actions), compact = true) {
|
||||
ActionRow(stringResource(R.string.glasses_recenter),
|
||||
if (virtualScreen || menuScreen) stringResource(R.string.glasses_recenter_screen_hint) else null,
|
||||
stringResource(R.string.cardboard_recenter_button), onRecenter)
|
||||
}
|
||||
}
|
||||
if (display) SettingsGroup(g.model, key = "vr-glasses") {
|
||||
if (display) SettingsGroup(g.model) {
|
||||
if (g.experimental) SettingsRow(stringResource(R.string.glasses_control), stringResource(
|
||||
if (g.supportsDisplayModeControl) R.string.glasses_xreal_experimental else R.string.glasses_pro2_experimental)) {}
|
||||
val status = if (g.hasDisplay) stringResource(R.string.glasses_status, g.width, g.height, kotlin.math.round(g.hz).toInt(),
|
||||
@@ -188,15 +168,9 @@ internal fun GlassesGroups(
|
||||
}
|
||||
ToggleRow(host, "glasses-game", stringResource(R.string.glasses_game_on), stringResource(R.string.glasses_game_on_hint),
|
||||
s.gameOnGlasses, chipModifier = track("glasses-game")) { Glasses.setGameOnGlasses(it) }
|
||||
if (inSession) {
|
||||
val context = androidx.compose.ui.platform.LocalContext.current
|
||||
ToggleRow(host, "glasses-shortcut", stringResource(R.string.glasses_show_shortcut),
|
||||
stringResource(R.string.glasses_show_shortcut_hint), showShortcut,
|
||||
chipModifier = track("glasses-shortcut")) { SessionPrefs.setShowGlassesShortcut(context, it) }
|
||||
}
|
||||
}
|
||||
if (display && g.canControl && g.supportsDisplayModeControl && (inSession || g.sbs || g.sbsSupport == GlassesState.SBS_FAILS)) {
|
||||
SettingsGroup(stringResource(R.string.glasses_display_mode), key = "vr-glasses-mode") {
|
||||
SettingsGroup(stringResource(R.string.glasses_display_mode)) {
|
||||
if (g.sbsSupport == GlassesState.SBS_FAILS && !g.sbs) {
|
||||
ActionRow(stringResource(R.string.glasses_3d), stringResource(R.string.glasses_3d_failed),
|
||||
stringResource(R.string.stores_dl_retry), { Glasses.set3d(true) })
|
||||
@@ -208,12 +182,12 @@ internal fun GlassesGroups(
|
||||
val profiles = if (inSession) listOf(GlassesDisplayModes.profile(g.sbs, false))
|
||||
else listOf(GlassesDisplayProfile.TWO_D, GlassesDisplayProfile.THREE_D)
|
||||
for (profile in profiles) SettingsGroup(stringResource(if (profile == GlassesDisplayProfile.TWO_D)
|
||||
R.string.glasses_output_2d else R.string.glasses_output_3d), key = "vr-glasses-output-${profile.name.lowercase()}") {
|
||||
R.string.glasses_output_2d else R.string.glasses_output_3d)) {
|
||||
GlassesResolutionRow(host, g, s, profile, track)
|
||||
if ((profile == GlassesDisplayProfile.THREE_D) == g.sbs) GlassesRefreshRow(host, g, s, track)
|
||||
}
|
||||
}
|
||||
if (display && (g.canControl || g.hasDisplay)) SettingsGroup(stringResource(R.string.glasses_picture_group), key = "vr-glasses-picture") {
|
||||
if (display && (g.canControl || g.hasDisplay)) SettingsGroup(stringResource(R.string.glasses_picture_group)) {
|
||||
ChoiceRow(host, "glasses-picture", stringResource(R.string.glasses_picture), stringResource(R.string.glasses_picture_hint),
|
||||
listOf(
|
||||
GlassesSettings.PICTURE_AUTO to stringResource(R.string.glasses_picture_auto),
|
||||
@@ -239,7 +213,7 @@ internal fun GlassesGroups(
|
||||
format = { SpatialMeasurements.distance(it / 10f) }, modifier = track("glasses-distance")) { Glasses.setScreenDistanceDm(it) }
|
||||
}
|
||||
}
|
||||
if (vr && (g.canControl || g.hasDisplay)) SettingsGroup(stringResource(R.string.cardboard_steamvr), key = "vr-glasses-steamvr") {
|
||||
if (vr && (g.canControl || g.hasDisplay)) SettingsGroup(stringResource(R.string.cardboard_steamvr)) {
|
||||
steamVr()
|
||||
if (g.supportsDisplayModeControl) ToggleRow(host, "glasses-auto3d", stringResource(R.string.glasses_auto3d),
|
||||
stringResource(R.string.glasses_auto3d_hint), s.auto3d, chipModifier = track("glasses-auto3d")) { Glasses.setAuto3d(it) }
|
||||
@@ -252,7 +226,7 @@ internal fun GlassesGroups(
|
||||
format = { "$it°" }, modifier = track("glasses-vr-fov")) { Glasses.setVrFovDeg(it) }
|
||||
}
|
||||
if ((tab == null || tab == GlassesTab.TRACKING) && g.canControl) {
|
||||
SettingsGroup(stringResource(R.string.glasses_head_tracking), key = "vr-glasses-tracking") {
|
||||
SettingsGroup(stringResource(R.string.glasses_head_tracking)) {
|
||||
val trackingHint = when {
|
||||
inSession && !usesGlasses -> R.string.glasses_screen_no_output
|
||||
spatialVr -> R.string.glasses_head_tracking_spatial_vr_hint
|
||||
@@ -266,13 +240,13 @@ internal fun GlassesGroups(
|
||||
chipModifier = track("glasses-tracking")) { Glasses.setHeadTracking(it) }
|
||||
}
|
||||
val calibration by Glasses.calibration.collectAsState()
|
||||
if (calibration.supported) SettingsGroup(stringResource(R.string.glasses_calibration), key = "vr-glasses-calibration") {
|
||||
if (calibration.supported) SettingsGroup(stringResource(R.string.glasses_calibration)) {
|
||||
GlassesCalibrationControls(calibration,
|
||||
onStart = Glasses::startCalibration, onCancel = Glasses::cancelCalibration,
|
||||
onReset = Glasses::resetCalibration, onDone = { onRecenter?.invoke() })
|
||||
}
|
||||
}
|
||||
if ((tab == null || tab == GlassesTab.HARDWARE) && g.canControl && g.hardwareControls) SettingsGroup(stringResource(R.string.glasses_hardware), key = "vr-glasses-hardware") {
|
||||
if ((tab == null || tab == GlassesTab.HARDWARE) && g.canControl && g.hardwareControls) SettingsGroup(stringResource(R.string.glasses_hardware)) {
|
||||
if (g.brightnessMax > 0) SliderRow(stringResource(R.string.glasses_brightness), null, g.brightness.coerceAtLeast(0), 0..g.brightnessMax, step = 1,
|
||||
modifier = track("glasses-brightness")) { Glasses.setBrightness(it) }
|
||||
if (g.volumeMax > 0) SliderRow(stringResource(R.string.glasses_volume), null, g.volume.coerceAtLeast(0), 0..g.volumeMax, step = 1,
|
||||
@@ -285,7 +259,7 @@ internal fun GlassesGroups(
|
||||
androidx.compose.runtime.LaunchedEffect(Unit) { HandTracking.load(context) }
|
||||
if ((tab == null || tab == GlassesTab.TRACKING) && g.canControl) {
|
||||
if (g.spatialConnected) {
|
||||
SettingsGroup(stringResource(R.string.glasses_experimental), key = "vr-glasses-experimental") {
|
||||
SettingsGroup(stringResource(R.string.glasses_experimental)) {
|
||||
val spatial by SpatialTracking.status.collectAsState()
|
||||
ToggleRow(host, "glasses-position", stringResource(R.string.glasses_position), stringResource(R.string.glasses_position_hint),
|
||||
s.positionalTracking, chipModifier = track("glasses-position")) { Glasses.setPositionalTracking(it) }
|
||||
@@ -308,7 +282,7 @@ internal fun GlassesGroups(
|
||||
s.joyConTracking, enabled = s.positionalTracking, chipModifier = track("glasses-joycons")) { Glasses.setJoyConTracking(it) }
|
||||
}
|
||||
}
|
||||
if (hands.usable) SettingsGroup(stringResource(R.string.phone_camera_tracking_group), key = "vr-hand-camera") {
|
||||
if (hands.usable) SettingsGroup(stringResource(R.string.phone_camera_tracking_group)) {
|
||||
HandCameraRows(host, track, inSession)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,20 +21,12 @@ internal fun GlassesSetupPanel() {
|
||||
val (glasses, settings) = rememberGlasses()
|
||||
val host = rememberMenuHost()
|
||||
val tabs = glassesTabs(glasses)
|
||||
val context = androidx.compose.ui.platform.LocalContext.current
|
||||
val showShortcut = rememberShowGlassesShortcut()
|
||||
var selectedTab by rememberSaveable { mutableStateOf(GlassesTab.DISPLAY) }
|
||||
val tab = selectedTab.takeIf { selected -> tabs.any { it.first == selected } } ?: GlassesTab.DISPLAY
|
||||
LaunchedEffect(tab, glasses.present, glasses.canControl, glasses.model) { host.open = null }
|
||||
|
||||
Column(Modifier.fillMaxWidth(), verticalArrangement = Arrangement.spacedBy(12.dp)) {
|
||||
Note(stringResource(R.string.setup_glasses_scope))
|
||||
SettingsGroup(stringResource(R.string.glasses_shortcut_group), key = "glasses-shortcut") {
|
||||
ToggleRow(host, "glasses-shortcut", stringResource(R.string.glasses_show_shortcut),
|
||||
stringResource(R.string.glasses_show_shortcut_hint), showShortcut) {
|
||||
com.droiddeck.launcher.session.SessionPrefs.setShowGlassesShortcut(context, it)
|
||||
}
|
||||
}
|
||||
if (!glasses.present && !glasses.hasDisplay && !glasses.canControl) {
|
||||
Note(stringResource(R.string.setup_glasses_connect))
|
||||
} else {
|
||||
|
||||
@@ -44,7 +44,6 @@ import com.droiddeck.launcher.session.SessionPrefs
|
||||
import kotlin.math.abs
|
||||
import kotlin.math.atan2
|
||||
import kotlin.math.hypot
|
||||
import kotlin.math.max
|
||||
import kotlin.math.min
|
||||
|
||||
@SuppressLint("ViewConstructor")
|
||||
@@ -64,7 +63,6 @@ class InputSurfaceView(
|
||||
private val art by lazy(LazyThreadSafetyMode.NONE) { PadArt(context) }
|
||||
private var artworkDpad = emptyList<HoldButton>()
|
||||
private val artworkDpadBounds = RectF()
|
||||
private var crossDpads = emptyList<Pair<List<HoldButton>, RectF>>()
|
||||
private var requestedLayout = customLayout
|
||||
init { customLayout = surfaceStyle.shown(customLayout); addView(content, LayoutParams(-1, -1)); renderCustom(pad) }
|
||||
|
||||
@@ -187,7 +185,6 @@ class InputSurfaceView(
|
||||
|
||||
private fun renderCustom(pad: PadBridge?) {
|
||||
artworkDpad = emptyList()
|
||||
crossDpads = emptyList()
|
||||
val canvas = object : ViewGroup(context) {
|
||||
override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
|
||||
val layout = customLayout
|
||||
@@ -206,7 +203,6 @@ class InputSurfaceView(
|
||||
child.layout(x, y, x + child.measuredWidth, y + child.measuredHeight)
|
||||
}
|
||||
updateArtworkDpad(this)
|
||||
updateCrossDpad(this)
|
||||
}
|
||||
|
||||
override fun dispatchDraw(canvas: Canvas) {
|
||||
@@ -248,39 +244,11 @@ class InputSurfaceView(
|
||||
canvas.getChildAt(index) as? HoldButton
|
||||
}
|
||||
val previous = artworkDpad
|
||||
artworkDpad = if (crossed(buttons, artworkDpadBounds)) buttons else emptyList()
|
||||
artworkDpad = if (crossed(buttons)) buttons else emptyList()
|
||||
if (artworkDpad != previous) (previous + artworkDpad).forEach { it.invalidate() }
|
||||
}
|
||||
|
||||
private fun updateCrossDpad(canvas: ViewGroup) {
|
||||
val buttons = (0 until canvas.childCount).map(canvas::getChildAt).filterIsInstance<HoldButton>()
|
||||
val (ups, rights, downs, lefts) = DIRECTIONS.map { direction -> buttons.filter { (it.tag as? InputSurfaceElement)?.control == direction } }
|
||||
crossDpads = ups.flatMap { up -> rights.flatMap { right -> downs.flatMap { down ->
|
||||
lefts.mapNotNull { left -> listOf(up, right, down, left).let { arms -> hole(arms)?.let { arms to it } } } } } }
|
||||
}
|
||||
|
||||
private fun hole(buttons: List<HoldButton>): RectF? {
|
||||
val (up, right, down, left) = buttons
|
||||
val hole = RectF(left.right.toFloat(), up.bottom.toFloat(), right.left.toFloat(), down.top.toFloat())
|
||||
val across = max(up.left, down.left) to min(up.right, down.right)
|
||||
val along = max(left.top, right.top) to min(left.bottom, right.bottom)
|
||||
return hole.takeIf {
|
||||
!it.isEmpty && across.first < across.second && along.first < along.second &&
|
||||
across.first < it.right && across.second > it.left && along.first < it.bottom && along.second > it.top
|
||||
}
|
||||
}
|
||||
|
||||
private fun crossTarget(x: Float, y: Float): HoldButton? {
|
||||
val first = crossDpads.firstOrNull()?.first?.first() ?: return null
|
||||
val hx = x - (originX(first) - first.left)
|
||||
val hy = y - (originY(first) - first.top)
|
||||
return crossDpads.filter { (arms, hole) -> arms.all { it.visibility == VISIBLE } && hole.contains(hx, hy) }
|
||||
.flatMap { it.first }.distinct().minByOrNull { arm ->
|
||||
hypot(max(max(arm.left - hx, hx - arm.right), 0f), max(max(arm.top - hy, hy - arm.bottom), 0f))
|
||||
}
|
||||
}
|
||||
|
||||
private fun crossed(buttons: List<HoldButton>, bounds: RectF): Boolean {
|
||||
private fun crossed(buttons: List<HoldButton>): Boolean {
|
||||
if (buttons.size != DIRECTIONS.size) return false
|
||||
val (up, right, down, left) = buttons
|
||||
val centerX = (left.left + right.right) / 2f
|
||||
@@ -290,7 +258,7 @@ class InputSurfaceView(
|
||||
kotlin.math.abs((left.top + left.bottom) / 2f - centerY) > 2f ||
|
||||
kotlin.math.abs((right.top + right.bottom) / 2f - centerY) > 2f ||
|
||||
up.bottom >= down.top || left.right >= right.left) return false
|
||||
bounds.set(left.left.toFloat(), up.top.toFloat(), right.right.toFloat(), down.bottom.toFloat())
|
||||
artworkDpadBounds.set(left.left.toFloat(), up.top.toFloat(), right.right.toFloat(), down.bottom.toFloat())
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -316,7 +284,6 @@ class InputSurfaceView(
|
||||
val views = (canvas.childCount - 1 downTo 0).map(canvas::getChildAt).filter { it.visibility == VISIBLE }
|
||||
views.firstOrNull { !(it is StickView && it.adaptive) && hits(it, x, y, 0f) }?.let { return it }
|
||||
views.filter { it is HoldButton && hits(it, x, y, slack(it)) }.minByOrNull { distance(it, x, y) }?.let { return it }
|
||||
crossTarget(x, y)?.let { return it }
|
||||
if (views.any { it is HoldButton && hits(it, x, y, slack(it) + ADAPTIVE_CLEARANCE_PX) }) return null
|
||||
return views.filter { it is StickView && it.adaptive && it !in owners.values && (hits(it, x, y, 0f) || it.captures(x - originX(it), y - originY(it))) }
|
||||
.minByOrNull { distance(it, x, y) }
|
||||
|
||||
@@ -487,7 +487,7 @@ fun ModeSheetRows(s: ModeSettings, a: ModeSettingsActions, tab: String, extras:
|
||||
}
|
||||
}
|
||||
}
|
||||
for (found in s.foundSteamLibraries) {
|
||||
if (s.steamLibraries.size < com.droiddeck.launcher.session.SteamLibraries.MAX) for (found in s.foundSteamLibraries) {
|
||||
SettingsRow(
|
||||
found.label,
|
||||
stringResource(R.string.libraries_found_hint, pluralStringResource(R.plurals.mode_added_count, found.games, found.games), found.shown),
|
||||
@@ -495,17 +495,19 @@ fun ModeSheetRows(s: ModeSettings, a: ModeSettingsActions, tab: String, extras:
|
||||
SecondaryButton(stringResource(R.string.libraries_add_found), compact = true) { a.onAddFoundSteamLibrary(found.path) }
|
||||
}
|
||||
}
|
||||
if (s.allFilesAccessMissing) {
|
||||
if (s.allFilesAccessMissing && s.steamLibraries.size < com.droiddeck.launcher.session.SteamLibraries.MAX) {
|
||||
SettingsRow(stringResource(R.string.libraries_access_title), stringResource(R.string.libraries_access_hint)) {
|
||||
SecondaryButton(stringResource(R.string.libraries_access_allow), compact = true, onClick = a.onAllowAllFilesAccess)
|
||||
}
|
||||
}
|
||||
SettingsRow(
|
||||
stringResource(R.string.libraries_add),
|
||||
stringResource(R.string.libraries_hint),
|
||||
if (s.steamLibraries.size < com.droiddeck.launcher.session.SteamLibraries.MAX) stringResource(R.string.libraries_hint)
|
||||
else stringResource(R.string.libraries_full, com.droiddeck.launcher.session.SteamLibraries.MAX),
|
||||
) {
|
||||
SecondaryButton(
|
||||
stringResource(R.string.mode_choose_folder),
|
||||
enabled = s.steamLibraries.size < com.droiddeck.launcher.session.SteamLibraries.MAX,
|
||||
onClick = a.onAddSteamLibrary,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -116,7 +116,10 @@ internal object NavTabs {
|
||||
|
||||
fun more(s: FrontEndState) = listed(s).filter { place(s, it) == TabPlace.MORE }
|
||||
|
||||
fun bar(s: FrontEndState): List<String> = listed(s).filter { place(s, it) == TabPlace.BAR } + MORE
|
||||
fun bar(s: FrontEndState): List<String> {
|
||||
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)) hidden + key else hidden - key
|
||||
|
||||
@@ -11,7 +11,7 @@ internal fun PenSettingsGroup(
|
||||
host: MenuHost, pen: SessionPrefs.Pen, track: (String) -> Modifier = { Modifier },
|
||||
onPick: (key: String, value: String) -> Unit,
|
||||
) {
|
||||
SettingsGroup(stringResource(R.string.mode_pen), key = "controller-pen") {
|
||||
SettingsGroup(stringResource(R.string.mode_pen)) {
|
||||
ChoiceRow(host, "pen", stringResource(R.string.mode_pen), null,
|
||||
listOf(SessionPrefs.PEN_MOUSE to stringResource(R.string.mode_pen_mouse),
|
||||
SessionPrefs.PEN_TOUCH to stringResource(R.string.mode_pen_touch)),
|
||||
|
||||
@@ -46,9 +46,12 @@ fun PerformancePage(
|
||||
fsyncFirst: Boolean,
|
||||
gamescopeRealtime: Boolean,
|
||||
gpuClockPin: Boolean,
|
||||
desktopAsUser: Boolean,
|
||||
prootNoSeccomp: Boolean,
|
||||
prootFastPath: Boolean,
|
||||
nativeUserland: Boolean,
|
||||
cursorComposite: Boolean,
|
||||
guestHostname: String,
|
||||
phantomWarning: String?,
|
||||
onClientOverride: (Boolean) -> Unit,
|
||||
onPaceCores: (Boolean) -> Unit,
|
||||
onTuSysmem: (Boolean) -> Unit,
|
||||
@@ -61,7 +64,9 @@ fun PerformancePage(
|
||||
onFsyncFirst: (Boolean) -> Unit,
|
||||
onGamescopeRealtime: (Boolean) -> Unit,
|
||||
onGpuClockPin: (Boolean) -> Unit,
|
||||
onDesktopAsUser: (Boolean) -> Unit,
|
||||
onProotNoSeccomp: (Boolean) -> Unit,
|
||||
onProotFastPath: (Boolean) -> Unit,
|
||||
onNativeUserland: (Boolean) -> Unit,
|
||||
onCursorComposite: (Boolean) -> Unit,
|
||||
onGuestHostname: (String) -> Unit,
|
||||
onClientCore: (Int, Boolean) -> Unit,
|
||||
@@ -145,6 +150,26 @@ fun PerformancePage(
|
||||
stringResource(R.string.perf_fastsync_hint),
|
||||
fastSync, onChange = onFastSync,
|
||||
)
|
||||
ToggleRow(
|
||||
host, "seccomp", stringResource(R.string.perf_seccomp),
|
||||
stringResource(R.string.perf_seccomp_hint),
|
||||
prootNoSeccomp, onChange = onProotNoSeccomp,
|
||||
)
|
||||
ToggleRow(
|
||||
host, "fastpath", stringResource(R.string.perf_fastpath),
|
||||
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),
|
||||
stringResource(R.string.perf_cursor_composite_hint),
|
||||
@@ -169,12 +194,16 @@ fun PerformancePage(
|
||||
modifier = Modifier.width(220.dp).focusGlide(),
|
||||
)
|
||||
}
|
||||
ToggleRow(
|
||||
host, "desktopasuser", stringResource(R.string.perf_desktop_as_user),
|
||||
stringResource(R.string.perf_desktop_as_user_hint),
|
||||
desktopAsUser,
|
||||
onChange = onDesktopAsUser,
|
||||
)
|
||||
}
|
||||
if (phantomWarning != null) {
|
||||
Spacer(Modifier.height(16.dp))
|
||||
Column(
|
||||
modifier = Modifier.fillMaxWidth().clip(RoundedCornerShape(12.dp)).background(colors.error.copy(alpha = 0.08f))
|
||||
.border(1.dp, colors.error.copy(alpha = 0.4f), RoundedCornerShape(12.dp)).padding(12.dp),
|
||||
) {
|
||||
Text(stringResource(R.string.perf_phantom_warning), fontSize = 14.sp, fontWeight = FontWeight.SemiBold, color = colors.error)
|
||||
Text(phantomWarning, fontSize = 12.sp, color = colors.onSurfaceVariant, modifier = Modifier.padding(top = 4.dp))
|
||||
}
|
||||
}
|
||||
}
|
||||
if (embedded) Column {
|
||||
@@ -189,7 +218,7 @@ fun PerformancePage(
|
||||
|
||||
@Composable
|
||||
internal fun GpuClockGroup(host: MenuHost, on: Boolean, chipModifier: Modifier = Modifier, onChange: (Boolean) -> Unit) {
|
||||
SettingsGroup(stringResource(R.string.perf_gpu), key = "performance-gpu") {
|
||||
SettingsGroup(stringResource(R.string.perf_gpu)) {
|
||||
ToggleRow(
|
||||
host, "gpuclock", stringResource(R.string.perf_gpuclock),
|
||||
null,
|
||||
|
||||
@@ -0,0 +1,306 @@
|
||||
package com.droiddeck.launcher.ui
|
||||
|
||||
import androidx.compose.foundation.shape.CircleShape
|
||||
import com.droiddeck.launcher.R
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import android.content.Context
|
||||
import android.net.ConnectivityManager
|
||||
import android.net.NetworkCapabilities
|
||||
import android.os.Build
|
||||
import androidx.activity.compose.BackHandler
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.BoxWithConstraints
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.ColumnScope
|
||||
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.widthIn
|
||||
import com.droiddeck.launcher.ui.GlideAlertDialog as AlertDialog
|
||||
import androidx.compose.material3.CircularProgressIndicator
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextButton
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.collectAsState
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.produceState
|
||||
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.platform.LocalContext
|
||||
import androidx.compose.ui.text.font.FontFamily
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import com.droiddeck.launcher.core.PhantomProcessLimit
|
||||
import com.droiddeck.launcher.core.PhantomProcessStatus
|
||||
import com.droiddeck.launcher.core.WirelessAdbPairingService
|
||||
import com.droiddeck.launcher.core.WirelessAdbPairingService.Stage
|
||||
import com.droiddeck.launcher.session.QuestExperimental
|
||||
|
||||
@Composable
|
||||
fun PhantomProcessGatePage(
|
||||
status: PhantomProcessStatus,
|
||||
applyingSavedPairing: Boolean,
|
||||
onDismiss: () -> Unit,
|
||||
onOpenDeveloperOptions: () -> Unit,
|
||||
onFixWithWirelessDebugging: () -> Unit,
|
||||
onCopyCommand: () -> Unit,
|
||||
) {
|
||||
BackHandler(onBack = onDismiss)
|
||||
val context = LocalContext.current
|
||||
val stage by WirelessAdbPairingService.stage.collectAsState()
|
||||
val environment by produceState(GateEnvironment.read(context)) {
|
||||
while (true) {
|
||||
value = GateEnvironment.read(context)
|
||||
kotlinx.coroutines.delay(2_000)
|
||||
}
|
||||
}
|
||||
val hasToggle = PhantomProcessLimit.hasDeveloperToggle()
|
||||
val sideQuest = QuestExperimental.isSupported()
|
||||
|
||||
BoxWithConstraints(Modifier.fillMaxWidth()) {
|
||||
val compact = maxWidth < 620.dp && maxHeight < 500.dp
|
||||
SettingsPage(
|
||||
host = rememberMenuHost(),
|
||||
title = stringResource(R.string.gate_title),
|
||||
eyebrow = stringResource(R.string.gate_eyebrow),
|
||||
lede = if (compact) null else stringResource(R.string.gate_lede),
|
||||
onBack = onDismiss,
|
||||
scrollContent = true,
|
||||
compactLayout = compact,
|
||||
) {
|
||||
BoxWithConstraints(Modifier.fillMaxWidth()) {
|
||||
val wide = maxWidth >= 620.dp
|
||||
val fix: @Composable ColumnScope.() -> Unit = {
|
||||
if (sideQuest) SideQuestGroup(compact, onCopyCommand)
|
||||
else FixGroup(hasToggle, stage, environment, compact, applyingSavedPairing, onOpenDeveloperOptions, onFixWithWirelessDebugging,
|
||||
onCancel = { WirelessAdbPairingService.cancel(context) })
|
||||
}
|
||||
val side: @Composable ColumnScope.() -> Unit = {
|
||||
StatusGroup(status, compact)
|
||||
if (!sideQuest) OtherWays(hasToggle, compact, onOpenDeveloperOptions, onFixWithWirelessDebugging, onCopyCommand)
|
||||
}
|
||||
if (wide) {
|
||||
Row(horizontalArrangement = Arrangement.spacedBy(14.dp), modifier = Modifier.widthIn(max = 900.dp).fillMaxWidth()) {
|
||||
Column(Modifier.weight(1.2f), content = fix)
|
||||
Column(Modifier.weight(1f), content = side)
|
||||
}
|
||||
} else {
|
||||
Column(Modifier.widthIn(max = 600.dp).fillMaxWidth()) {
|
||||
fix()
|
||||
side()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private data class GateEnvironment(val onWifi: Boolean) {
|
||||
companion object {
|
||||
fun read(context: Context): GateEnvironment {
|
||||
val connectivity = context.getSystemService(ConnectivityManager::class.java)
|
||||
val wifi = runCatching {
|
||||
connectivity?.allNetworks?.any { network ->
|
||||
connectivity.getNetworkCapabilities(network)?.hasTransport(NetworkCapabilities.TRANSPORT_WIFI) == true
|
||||
} == true
|
||||
}.getOrDefault(true)
|
||||
return GateEnvironment(wifi)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun FixGroup(
|
||||
hasToggle: Boolean,
|
||||
stage: Stage,
|
||||
environment: GateEnvironment,
|
||||
compact: Boolean,
|
||||
applyingSavedPairing: Boolean,
|
||||
onOpenDeveloperOptions: () -> Unit,
|
||||
onFixWithWirelessDebugging: () -> Unit,
|
||||
onCancel: () -> Unit,
|
||||
) {
|
||||
val pairing = stage is Stage.Waiting || stage is Stage.CodeNeeded || stage is Stage.Working
|
||||
SettingsGroup(if (hasToggle) stringResource(R.string.setup_dev_options) else stringResource(R.string.gate_fix_for_me), compact = compact) {
|
||||
Column(
|
||||
modifier = Modifier.fillMaxWidth().padding(if (compact) 10.dp else 14.dp),
|
||||
verticalArrangement = Arrangement.spacedBy(8.dp),
|
||||
) {
|
||||
when {
|
||||
applyingSavedPairing -> Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(10.dp)) {
|
||||
CircularProgressIndicator(Modifier.size(18.dp), strokeWidth = 2.dp)
|
||||
Body(stringResource(R.string.adbpair_applying))
|
||||
}
|
||||
pairing -> PairingProgress(stage, onCancel)
|
||||
hasToggle -> {
|
||||
Body(stringResource(R.string.gate_toggle_steps))
|
||||
PrimaryButton(stringResource(R.string.gate_open_dev), compact = compact, onClick = onOpenDeveloperOptions)
|
||||
SecondaryButton(stringResource(R.string.gate_use_wireless_instead), compact = compact, enabled = environment.onWifi, onClick = onFixWithWirelessDebugging)
|
||||
}
|
||||
else -> {
|
||||
Body(stringResource(R.string.gate_no_toggle))
|
||||
(stage as? Stage.Failed)?.let { Body(it.error, error = true) }
|
||||
PrimaryButton(
|
||||
if (stage is Stage.Failed) stringResource(R.string.store_try_again) else stringResource(R.string.gate_fix_for_me),
|
||||
compact = compact,
|
||||
enabled = environment.onWifi,
|
||||
onClick = onFixWithWirelessDebugging,
|
||||
)
|
||||
}
|
||||
}
|
||||
if (!hasToggle && !pairing) {
|
||||
if (!environment.onWifi) {
|
||||
Body(stringResource(R.string.gate_needs_wifi), warn = true)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun PairingProgress(stage: Stage, onCancel: () -> Unit) {
|
||||
val steps = listOf(
|
||||
stringResource(R.string.gate_step1),
|
||||
stringResource(R.string.gate_step2),
|
||||
stringResource(R.string.gate_step3),
|
||||
)
|
||||
val active = when (stage) {
|
||||
Stage.Waiting -> 1
|
||||
is Stage.CodeNeeded -> 2
|
||||
else -> 3
|
||||
}
|
||||
steps.forEachIndexed { index, step ->
|
||||
val done = index < active
|
||||
val current = index == active
|
||||
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(8.dp)) {
|
||||
Text(if (done) "✓" else "${index + 1}", fontSize = 13.sp, fontWeight = FontWeight.SemiBold,
|
||||
color = if (done) LocalPalette.current.good else MaterialTheme.colorScheme.onSurfaceVariant)
|
||||
Text(step, style = MaterialTheme.typography.bodySmall,
|
||||
color = if (current) MaterialTheme.colorScheme.onBackground else MaterialTheme.colorScheme.onSurfaceVariant)
|
||||
}
|
||||
}
|
||||
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(8.dp)) {
|
||||
CircularProgressIndicator(modifier = Modifier.size(16.dp), strokeWidth = 2.dp)
|
||||
Text(
|
||||
when (stage) {
|
||||
Stage.Waiting -> stringResource(R.string.gate_waiting)
|
||||
is Stage.CodeNeeded -> stage.error ?: stringResource(R.string.gate_code_needed)
|
||||
is Stage.Working -> stage.step
|
||||
else -> ""
|
||||
},
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = if (stage is Stage.CodeNeeded && stage.error != null) MaterialTheme.colorScheme.error else MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
modifier = Modifier.weight(1f),
|
||||
)
|
||||
SecondaryButton(stringResource(R.string.common_cancel), compact = true, onClick = onCancel)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun StatusGroup(status: PhantomProcessStatus, compact: Boolean) {
|
||||
SettingsGroup(stringResource(R.string.gate_status), compact = compact) {
|
||||
Column(Modifier.fillMaxWidth().padding(if (compact) 10.dp else 14.dp), verticalArrangement = Arrangement.spacedBy(2.dp)) {
|
||||
Text(PhantomProcessLimit.title(LocalContext.current, status), style = MaterialTheme.typography.bodyMedium, color = MaterialTheme.colorScheme.onBackground)
|
||||
Body(stringResource(R.string.gate_polling))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun OtherWays(
|
||||
hasToggle: Boolean,
|
||||
compact: Boolean,
|
||||
onOpenDeveloperOptions: () -> Unit,
|
||||
onFixWithWirelessDebugging: () -> Unit,
|
||||
onCopyCommand: () -> Unit,
|
||||
) {
|
||||
var open by rememberSaveable { mutableStateOf(false) }
|
||||
SettingsGroup(stringResource(R.string.gate_other_ways), compact = compact) {
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
modifier = Modifier.fillMaxWidth().clickable { open = !open }.padding(horizontal = 14.dp, vertical = 10.dp),
|
||||
) {
|
||||
Body(if (hasToggle) stringResource(R.string.gate_other_toggle) else stringResource(R.string.gate_other_no_toggle), modifier = Modifier.weight(1f))
|
||||
Text(if (open) "▴" else "▾", fontSize = 12.sp, color = MaterialTheme.colorScheme.onSurfaceVariant)
|
||||
}
|
||||
if (open) Column(
|
||||
modifier = Modifier.fillMaxWidth().padding(start = 14.dp, end = 14.dp, bottom = 14.dp),
|
||||
verticalArrangement = Arrangement.spacedBy(8.dp),
|
||||
) {
|
||||
if (!hasToggle) {
|
||||
Body(stringResource(R.string.gate_some_roms))
|
||||
SecondaryButton(stringResource(R.string.gate_open_dev), compact = true, onClick = onOpenDeveloperOptions)
|
||||
}
|
||||
Body(stringResource(R.string.gate_from_computer))
|
||||
AdbCommand()
|
||||
SecondaryButton(stringResource(R.string.gate_copy_command), compact = true, onClick = onCopyCommand)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun SideQuestGroup(compact: Boolean, onCopyCommand: () -> Unit) {
|
||||
SettingsGroup(stringResource(R.string.gate_sidequest), compact = compact) {
|
||||
Column(
|
||||
modifier = Modifier.fillMaxWidth().padding(if (compact) 10.dp else 14.dp),
|
||||
verticalArrangement = Arrangement.spacedBy(8.dp),
|
||||
) {
|
||||
Body(stringResource(R.string.gate_sidequest_steps))
|
||||
AdbCommand()
|
||||
PrimaryButton(stringResource(R.string.gate_copy_command), compact = compact, onClick = onCopyCommand)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun AdbCommand() {
|
||||
Text(
|
||||
PhantomProcessLimit.adbCommand(),
|
||||
style = MaterialTheme.typography.bodySmall.copy(fontFamily = FontFamily.Monospace, fontSize = 11.sp),
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
)
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun Body(text: String, modifier: Modifier = Modifier, error: Boolean = false, warn: Boolean = false) {
|
||||
Text(
|
||||
text,
|
||||
modifier = modifier,
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = when {
|
||||
error -> MaterialTheme.colorScheme.error
|
||||
warn -> androidx.compose.ui.graphics.Color(0xFFFFB86B)
|
||||
else -> MaterialTheme.colorScheme.onSurfaceVariant
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun DeveloperDisplayChoiceDialog(
|
||||
displays: List<Pair<Int, String>>,
|
||||
onMainScreen: () -> Unit,
|
||||
onSecondaryScreen: (Int) -> Unit,
|
||||
onDismiss: () -> Unit,
|
||||
) {
|
||||
AlertDialog(
|
||||
onDismissRequest = onDismiss,
|
||||
title = { Text(stringResource(R.string.gate_open_dev)) },
|
||||
text = {
|
||||
Column(verticalArrangement = Arrangement.spacedBy(4.dp), modifier = Modifier.fillMaxWidth()) {
|
||||
Text(stringResource(R.string.gate_choose_display))
|
||||
TextButton(modifier = Modifier.fillMaxWidth().focusGlide(CircleShape), onClick = onMainScreen) { Text(stringResource(R.string.gate_main_screen)) }
|
||||
displays.forEach { (id, label) ->
|
||||
TextButton(modifier = Modifier.fillMaxWidth().focusGlide(CircleShape), onClick = { onSecondaryScreen(id) }) { Text(label) }
|
||||
}
|
||||
}
|
||||
},
|
||||
confirmButton = { TextButton(onClick = onDismiss, modifier = Modifier.focusGlide(CircleShape)) { Text(stringResource(R.string.common_cancel)) } },
|
||||
)
|
||||
}
|
||||
@@ -6,19 +6,17 @@ import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.setValue
|
||||
import com.droiddeck.launcher.session.SessionPrefs
|
||||
|
||||
/** HUD holds the Performance page and GAMES the Game page; the names stay because saved page orders use them. */
|
||||
internal enum class SessionDrawerPage(val firstControl: String) {
|
||||
CONTROLLER("section-controller-input"),
|
||||
HUD("section-performance-pacing"),
|
||||
FRAMEGEN("fg"),
|
||||
DISPLAY("section-display"),
|
||||
EFFECTS("section-effects-look"),
|
||||
GAMES("section-game-profile"),
|
||||
VR("section-vr-steamvr"),
|
||||
SESSION("pause"),
|
||||
MORE("more-edit"),
|
||||
ACHIEVEMENTS("achievements"),
|
||||
CONTROLLER("input-profile"),
|
||||
GLASSES("glasses-game"),
|
||||
DISPLAY("fg"),
|
||||
HUD("hud"),
|
||||
EFFECTS("look"),
|
||||
GAMES("anisotropy"),
|
||||
AGENT("agent-input"),
|
||||
SESSION("suspend"),
|
||||
MORE("more-edit"),
|
||||
VR("steamvr"),
|
||||
}
|
||||
|
||||
internal object DrawerPages {
|
||||
@@ -73,16 +71,16 @@ internal object DrawerPages {
|
||||
}
|
||||
|
||||
internal fun offeredDrawerPages(
|
||||
hasAchievements: Boolean = false, hasAgent: Boolean = com.droiddeck.launcher.agent.AgentTab.shown,
|
||||
hasGlasses: Boolean = false, hasAgent: Boolean = com.droiddeck.launcher.agent.AgentTab.shown,
|
||||
): List<SessionDrawerPage> =
|
||||
DrawerPages.order.filter {
|
||||
(hasAchievements || it != SessionDrawerPage.ACHIEVEMENTS) &&
|
||||
(hasGlasses || it != SessionDrawerPage.GLASSES) &&
|
||||
(hasAgent || it != SessionDrawerPage.AGENT)
|
||||
}
|
||||
|
||||
internal fun sessionDrawerPages(
|
||||
hasAchievements: Boolean = false, hasAgent: Boolean = com.droiddeck.launcher.agent.AgentTab.shown,
|
||||
): List<SessionDrawerPage> = offeredDrawerPages(hasAchievements, hasAgent).filter { it !in DrawerPages.hidden }
|
||||
hasGlasses: Boolean = false, hasAgent: Boolean = com.droiddeck.launcher.agent.AgentTab.shown,
|
||||
): List<SessionDrawerPage> = offeredDrawerPages(hasGlasses, hasAgent).filter { it !in DrawerPages.hidden }
|
||||
|
||||
/** The pages shown as tabs: everything up to and including the More tab. */
|
||||
internal fun List<SessionDrawerPage>.strip(): List<SessionDrawerPage> {
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -65,6 +65,7 @@ internal object SettingsIndex {
|
||||
|
||||
val entries: List<SettingsEntry> = listOf(
|
||||
s(SettingsSection.OVERVIEW, R.string.setup_runtime, "ubuntu", "linux", "repair", "update"),
|
||||
s(SettingsSection.OVERVIEW, R.string.setup_limit, "phantom", "process", "killed", "background"),
|
||||
s(SettingsSection.OVERVIEW, R.string.setup_account, "steam", "login", "sign in"),
|
||||
|
||||
s(SettingsSection.PERFORMANCE, R.string.perf_override, "steam client cores", "cpu"),
|
||||
@@ -83,9 +84,11 @@ internal object SettingsIndex {
|
||||
s(SettingsSection.PERFORMANCE, R.string.perf_esync, "esync", "sync", "wine"),
|
||||
s(SettingsSection.PERFORMANCE, R.string.perf_fsync, "fsync", "sync", "wine"),
|
||||
s(SettingsSection.PERFORMANCE, R.string.perf_fastsync, "ntsync", "sync", "wine"),
|
||||
s(SettingsSection.PERFORMANCE, R.string.perf_seccomp, "proot"),
|
||||
s(SettingsSection.PERFORMANCE, R.string.perf_fastpath, "proot"),
|
||||
s(SettingsSection.PERFORMANCE, R.string.perf_native_userland, "proot"),
|
||||
s(SettingsSection.PERFORMANCE, R.string.perf_cursor_composite, "mouse", "cursor"),
|
||||
s(SettingsSection.PERFORMANCE, R.string.perf_hostname, "name"),
|
||||
s(SettingsSection.PERFORMANCE, R.string.perf_desktop_as_user, "root", "user", "sudo", "fakeroot"),
|
||||
|
||||
s(SettingsSection.CONTROLLER, R.string.setup_tab_controller, "gamepad", "buttons", "mapping", "profile", "remap"),
|
||||
SettingsEntry(SettingsPlace.TAB, R.string.rail_storage, tab = "storage", words = listOf("sd card", "space", "uninstall", "disk")),
|
||||
|
||||
@@ -443,11 +443,7 @@ fun ValueChip(text: String, open: Boolean, enabled: Boolean = true, modifier: Mo
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun SettingsGroup(title: String, compact: Boolean = false, detail: String? = null, key: String? = null, tag: String? = null, content: @Composable ColumnScope.() -> Unit) {
|
||||
LocalDrawerSections.current?.let { sections ->
|
||||
DrawerSection(sections, key ?: title, title, detail, tag, content)
|
||||
return
|
||||
}
|
||||
fun SettingsGroup(title: String, compact: Boolean = false, detail: String? = null, content: @Composable ColumnScope.() -> Unit) {
|
||||
val tight = compact || LocalCompactSettings.current
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val pal = LocalPalette.current
|
||||
@@ -466,7 +462,7 @@ fun SettingsGroup(title: String, compact: Boolean = false, detail: String? = nul
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun SettingsRow(label: String, hint: String?, highlighted: Boolean = false, hintLines: Int? = null, stacked: Boolean = false, tightControlSpacing: Boolean = false, control: @Composable () -> Unit) {
|
||||
fun SettingsRow(label: String, hint: String?, highlighted: Boolean = false, hintLines: Int? = null, stacked: Boolean = false, control: @Composable () -> Unit) {
|
||||
val compact = LocalCompactSettings.current
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val pal = LocalPalette.current
|
||||
@@ -488,13 +484,13 @@ fun SettingsRow(label: String, hint: String?, highlighted: Boolean = false, hint
|
||||
} else if (stacked || LocalNarrowPane.current) Column(
|
||||
modifier = Modifier.fillMaxWidth().background(bg).padding(
|
||||
horizontal = if (compact) 10.dp else 14.dp,
|
||||
vertical = if (tightControlSpacing) 2.dp else if (compact) 6.dp else 12.dp),
|
||||
vertical = if (compact) 6.dp else 12.dp),
|
||||
) {
|
||||
Text(label, fontSize = if (compact) 13.sp else 15.sp,
|
||||
lineHeight = if (compact) 16.sp else androidx.compose.ui.unit.TextUnit.Unspecified,
|
||||
fontWeight = FontWeight.SemiBold, color = colors.onBackground)
|
||||
if (hint != null || hintLines != null) hintText(if (compact) 11.sp else 13.sp)
|
||||
Box(Modifier.padding(top = if (tightControlSpacing) 2.dp else if (compact) 6.dp else 8.dp)) { control() }
|
||||
Box(Modifier.padding(top = if (compact) 6.dp else 8.dp)) { control() }
|
||||
} else Row(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
modifier = Modifier.fillMaxWidth().background(bg).padding(horizontal = 14.dp, vertical = 11.dp),
|
||||
|
||||
@@ -13,7 +13,7 @@ internal fun FrameGenGroup(s: FrontEndState, a: FrontEndActions) {
|
||||
SettingsRow(stringResource(R.string.frame_gen_title), stringResource(R.string.frame_gen_hint), highlighted = host.open == "fg") {
|
||||
Box {
|
||||
ValueChip(s.frameGenLabel, host.open == "fg") { host.open = if (host.open == "fg") null else "fg" }
|
||||
if (host.open == "fg") FrameGenMenu(s.frameGen, s.lossless, a.onFrameGenPick, a.onImportLossless)
|
||||
FrameGenMenu(host, s.frameGen, s.lossless, a.onFrameGenPick, a.onImportLossless)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -177,6 +177,7 @@ internal fun SteamHome(s: FrontEndState, a: FrontEndActions, modifier: Modifier)
|
||||
val onboardingRows = com.droiddeck.launcher.session.Onboarding.rows(onboardingActive, onboardingFailed, onboardingFacts)
|
||||
val firstRun by com.droiddeck.launcher.session.Onboarding.firstRun.collectAsState()
|
||||
val settling = firstRun && onboardingActive.isNotEmpty() && com.droiddeck.launcher.session.Onboarding.pending(onboardingRows)
|
||||
val limitBlocks = com.droiddeck.launcher.core.PhantomProcessLimit.blocksSteam(s.phantomProcessStatus)
|
||||
val mark: @Composable () -> Unit = {
|
||||
Wordmark(if (narrow) 30.dp else 40.dp)
|
||||
}
|
||||
@@ -184,7 +185,7 @@ internal fun SteamHome(s: FrontEndState, a: FrontEndActions, modifier: Modifier)
|
||||
if (!settling && (s.busy || (s.available != null && s.available != s.installed))) RuntimeChip(s)
|
||||
else if (!settling && setupNeedsAttention(s)) SecondaryButton(stringResource(R.string.play_needs_you), compact = true,
|
||||
modifier = Modifier.testTag("play-needs-you")) { SetupTabs.openSection = SettingsSection.OVERVIEW }
|
||||
else if (!settling && s.integration.suggested && signedIn)
|
||||
else if (!settling && s.integration.suggested && signedIn && !limitBlocks)
|
||||
IntegrationSuggestion(s.integration, { a.onSteamIntegration(null) }, a.onDismissIntegration)
|
||||
}
|
||||
if (narrow) Column(
|
||||
@@ -207,10 +208,18 @@ internal fun SteamHome(s: FrontEndState, a: FrontEndActions, modifier: Modifier)
|
||||
val firstRun by com.droiddeck.launcher.session.Onboarding.firstRun.collectAsState()
|
||||
val settling = firstRun && onboardingActive.isNotEmpty() && com.droiddeck.launcher.session.Onboarding.pending(onboardingRows)
|
||||
val overall = com.droiddeck.launcher.session.Onboarding.overall(onboardingRows)
|
||||
val limitBlocks = com.droiddeck.launcher.core.PhantomProcessLimit.blocksSteam(s.phantomProcessStatus)
|
||||
LaunchedEffect(settling) {
|
||||
while (settling) {
|
||||
kotlinx.coroutines.delay(2_000)
|
||||
a.onRefreshPhantomStatus()
|
||||
}
|
||||
a.onRefreshPhantomStatus()
|
||||
}
|
||||
if (settling) PrimaryButton(
|
||||
stringResource(R.string.onboarding_button_getting_ready, overall),
|
||||
enabled = false, main = true, large = true, progress = overall / 100f,
|
||||
modifier = Modifier.testTag("play-steam"), onClick = {},
|
||||
stringResource(if (limitBlocks) R.string.onboarding_button_finish else R.string.onboarding_button_getting_ready, overall),
|
||||
enabled = limitBlocks, main = true, large = true, progress = overall / 100f,
|
||||
modifier = Modifier.testTag("play-steam"), onClick = { a.onQueuePlaySteam(); ChildProcessSetup.request?.invoke() ?: a.onShowPhantomGate() },
|
||||
) else PrimaryButton(stringResource(R.string.games_play_steam), enabled = !s.busy, main = true, large = true, icon = Icons.Filled.PlayArrow, modifier = Modifier.testTag("play-steam"), onClick = click)
|
||||
},
|
||||
rows = { tab -> a.modeSheet(mode, tab, extras) },
|
||||
|
||||
@@ -56,7 +56,6 @@ import androidx.compose.ui.draw.alpha
|
||||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.focus.FocusRequester
|
||||
import androidx.compose.ui.focus.focusRequester
|
||||
import androidx.compose.ui.focus.onFocusChanged
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.layout.ContentScale
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
@@ -359,67 +358,6 @@ internal fun SessionAchievementsPanel(label: String, state: AchievementsState, t
|
||||
}
|
||||
}
|
||||
|
||||
/** The Achievements page of the session menu: the same list as the full panel, inside the menu's own scroll. */
|
||||
@Composable
|
||||
internal fun DrawerAchievementsPage(game: StoreAchievements.Game, title: String?, track: (String) -> Modifier) {
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val pal = LocalPalette.current
|
||||
val label = StoreAchievements.forSource(game.source)?.label.orEmpty()
|
||||
val state = rememberAchievements(game) ?: AchievementsState.READING
|
||||
val kinds = remember(state.list) {
|
||||
val list = state.list.orEmpty()
|
||||
val split = groups(list)
|
||||
if (split.size < 2) emptyList() else listOf(R.string.stores_tab_all to list) + split
|
||||
}
|
||||
var pick by remember { mutableIntStateOf(0) }
|
||||
if (pick >= kinds.size) pick = 0
|
||||
var noteHadFocus by remember { mutableStateOf(false) }
|
||||
val firstRow = remember { FocusRequester() }
|
||||
val loaded = !state.list.isNullOrEmpty()
|
||||
LaunchedEffect(loaded) {
|
||||
if (loaded && noteHadFocus) {
|
||||
noteHadFocus = false
|
||||
withFrameNanos { }
|
||||
runCatching { firstRow.requestFocus() }
|
||||
}
|
||||
}
|
||||
Column(Modifier.fillMaxWidth().padding(top = 8.dp, start = 4.dp, end = 4.dp)) {
|
||||
Row(verticalAlignment = Alignment.CenterVertically, modifier = Modifier.fillMaxWidth()) {
|
||||
Text(title.orEmpty(), fontSize = 13.sp, color = colors.onSurfaceVariant, maxLines = 1, overflow = TextOverflow.Ellipsis, modifier = Modifier.weight(1f))
|
||||
state.list?.takeIf { it.isNotEmpty() }?.let { list ->
|
||||
if (state.all) Trophy(18.dp, Modifier.padding(end = 6.dp))
|
||||
Text(stringResource(R.string.achievements_count_short, state.done, list.size), fontSize = 15.sp, fontWeight = FontWeight.SemiBold, color = pal.signal)
|
||||
}
|
||||
}
|
||||
val list = state.list
|
||||
if (list.isNullOrEmpty()) {
|
||||
Text(achievementsNote(state, label).orEmpty(), fontSize = 13.sp, color = colors.onSurfaceVariant,
|
||||
modifier = Modifier.padding(top = 12.dp).then(track("achievements"))
|
||||
.onFocusChanged { if (it.isFocused) noteHadFocus = true }.focusable())
|
||||
return@Column
|
||||
}
|
||||
LinearProgressIndicator(
|
||||
progress = { state.done / list.size.toFloat() }, color = pal.signal, trackColor = pal.line,
|
||||
modifier = Modifier.padding(top = 8.dp).fillMaxWidth().height(4.dp).clip(RoundedCornerShape(2.dp)),
|
||||
)
|
||||
if (kinds.isNotEmpty()) TabStrip(
|
||||
kinds.map { (name, group) -> if (name == R.string.stores_tab_all) stringResource(name) + " · " + group.size else stringResource(name, group.size) },
|
||||
pick, { pick = it }, Modifier.padding(top = 10.dp), bumpers = false, compact = true,
|
||||
)
|
||||
val shown = kinds.getOrNull(pick)?.second ?: list
|
||||
val sections = if (pick == 0) groups(shown).filter { it.second.isNotEmpty() } else listOf(null to shown)
|
||||
val first = sections.firstOrNull()?.second?.firstOrNull()?.id
|
||||
Column(Modifier.padding(top = 6.dp), verticalArrangement = Arrangement.spacedBy(6.dp)) {
|
||||
for ((group, items) in sections) {
|
||||
if (group != null) AchievementGroupLabel(stringResource(group, items.size))
|
||||
for (a in items) androidx.compose.runtime.key(a.id) {
|
||||
AchievementRow(a, compact = true, if (a.id == first) track("achievements").focusRequester(firstRow) else Modifier)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun DrawerAchievementsRow(progress: Pair<Int, Int>?, modifier: Modifier = Modifier, onClick: () -> Unit) {
|
||||
val colors = MaterialTheme.colorScheme
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="512"
|
||||
android:viewportHeight="512">
|
||||
<path android:fillColor="#FFFFFFFF" android:fillType="evenOdd" android:pathData="M 142 335 L 148 343 L 148 345 L 155 352 L 165 365 L 166 368 L 169 370 L 171 374 L 176 379 L 177 382 L 179 383 L 181 387 L 187 393 L 187 395 L 193 401 L 196 400 L 200 392 L 206 386 L 259 419 L 262 418 L 266 411 L 264 406 L 250 398 L 249 396 L 242 391 L 237 389 L 236 387 L 231 385 L 227 381 L 215 374 L 215 371 L 222 361 L 222 356 L 220 353 Z M 472 198 L 463 195 L 446 195 L 436 198 L 431 198 L 426 200 L 418 201 L 415 203 L 382 209 L 375 212 L 361 214 L 353 217 L 349 224 L 349 226 L 346 229 L 339 245 L 336 248 L 281 354 L 274 365 L 275 370 L 279 376 L 279 379 L 311 450 L 311 453 L 317 465 L 325 473 L 327 474 L 339 474 L 348 470 L 353 465 L 360 454 L 369 436 L 369 434 L 372 430 L 374 424 L 385 404 L 388 396 L 399 376 L 463 246 L 466 243 L 470 232 L 480 214 L 479 205 Z M 444 224 L 445 226 L 337 439 L 334 435 L 332 428 L 316 393 L 315 388 L 312 384 L 312 381 L 305 367 L 305 364 L 307 362 L 348 282 L 369 244 L 369 242 L 372 239 L 381 238 L 386 236 L 390 236 L 395 234 L 409 232 L 423 228 L 432 227 L 440 224 Z M 211 187 L 201 192 L 201 194 L 203 196 L 203 198 L 228 249 L 225 251 L 166 265 L 165 266 L 169 280 L 234 264 L 242 278 L 242 280 L 265 327 L 278 321 L 278 319 L 250 261 L 252 259 L 313 244 L 310 229 L 244 246 L 235 230 L 235 228 L 226 211 L 226 209 L 224 207 L 215 186 Z M 233 127 L 233 129 L 235 131 L 240 133 L 243 136 L 248 138 L 287 162 L 287 165 L 279 178 L 281 181 L 288 183 L 290 182 L 304 186 L 310 186 L 313 188 L 316 187 L 320 189 L 343 192 L 350 195 L 352 194 L 357 196 L 362 196 L 354 186 L 351 184 L 350 181 L 347 179 L 339 168 L 335 165 L 335 163 L 324 152 L 323 149 L 320 147 L 311 135 L 307 134 L 302 136 L 302 138 L 297 144 L 297 146 L 295 148 L 292 148 L 282 141 L 276 139 L 266 132 L 264 132 L 253 125 L 247 123 L 242 119 L 237 120 Z M 221 73 L 212 70 L 195 70 L 175 75 L 170 75 L 154 80 L 140 82 L 135 84 L 130 84 L 123 87 L 103 91 L 95 103 L 88 119 L 86 121 L 79 136 L 75 141 L 73 147 L 66 158 L 59 174 L 56 177 L 23 240 L 24 245 L 34 266 L 34 269 L 44 289 L 44 292 L 60 326 L 63 335 L 67 342 L 72 347 L 76 349 L 91 348 L 95 346 L 106 334 L 118 310 L 118 308 L 120 306 L 229 88 L 228 80 Z M 193 99 L 194 100 L 190 107 L 190 109 L 183 121 L 183 123 L 181 125 L 176 137 L 174 139 L 132 224 L 130 226 L 123 242 L 112 261 L 89 307 L 88 311 L 85 314 L 58 250 L 53 241 L 62 223 L 74 202 L 118 117 L 121 114 L 129 113 L 134 111 L 139 111 L 162 105 L 167 105 L 188 99 Z" />
|
||||
</vector>
|
||||
@@ -200,6 +200,7 @@
|
||||
<string name="app_fex_hint">يشغّل FEX برامج Linux المخصصة لـ x86 على جهاز ARM64 هذا. يستخدمه الخيار «تلقائي» عندما يكون البرنامج مبنيًا لـ x86.</string>
|
||||
<string name="app_fex_x86">%1$s عبر FEX</string>
|
||||
<string name="app_fex_not_ready">هذا البرنامج مبني لأجهزة كمبيوتر %1$s ويعمل عبر FEX، الذي لم يتم إعداده بعد. افتح Steam مرة واحدة أثناء تسجيل الدخول: سيجعله DroidDeck يُنزّل FEX وSteam Linux Runtime اللازمة، ثم يُفتح هذا البرنامج.</string>
|
||||
<string name="session_proot_missing">تعذّر تنزيل proot الخاص بـ DroidDeck. تحقّق من الاتصال وحاول مرة أخرى. لم تبدأ الجلسة لأن proot الاحتياطي أبطأ من أن يصلح للعب.</string>
|
||||
<string name="session_powervr_missing">تعذّر تنزيل بيئة رسومات PowerVR. تحقق من الاتصال وحاول مرة أخرى.</string>
|
||||
<string name="session_graphics_runtime_failed">تعذّر تجهيز بيئة الرسومات، لذا لم تبدأ الجلسة.</string>
|
||||
<string name="session_game_environment_failed">تعذّر إعداد بيئة اللعبة، لذا لم تبدأ الجلسة.</string>
|
||||
@@ -449,6 +450,7 @@
|
||||
<string name="libraries_rename">إعادة التسمية</string>
|
||||
<string name="libraries_rename_title">اسم المكتبة</string>
|
||||
<string name="libraries_pick">اختر مجلدًا للمكتبة</string>
|
||||
<string name="libraries_full">الحد الأقصى للمكتبات المضافة: %1$d</string>
|
||||
<string name="libraries_overlap">هذا المجلد مكتبة بالفعل أو داخل مكتبة أخرى</string>
|
||||
<string name="libraries_missing">%1$s · غير متاح</string>
|
||||
<string name="libraries_applies_next">يسري بدءًا من جلسة Steam التالية</string>
|
||||
@@ -638,14 +640,21 @@
|
||||
<string name="perf_fsync_hint">يشغّل خاصية fsync المدمجة في Proton على ملفات Proton الأصلية، مع توفير futex_waitv في مساحة المستخدم، فلا يحتاج إلى حزمة ويستمر في العمل لحظة تحديث Steam لـ Proton. أثناء تفعيله، تستخدمه الألعاب قبل droiddeck-esync، باستثناء القليل الذي يبقيه Proton معطّلًا لـ fsync. يُطبَّق في الجلسة التالية.</string>
|
||||
<string name="perf_esync_hint">تنتظر مؤشرات ترابط Windows في اللعبة بعضها بعضًا عبر eventfd والذاكرة المشتركة، بدلًا من رحلات ذهاب وعودة عبر wineserver. يستخدم حزمة droiddeck-esync مُعدّة لإصدار Proton ذاك بالضبط؛ وتُجلَب الحزم تلقائيًا. وإلى أن تتوفر حزمة لإصدار Proton جديد، يحل droiddeck-fsync محله. يُطبَّق في الجلسة التالية.</string>
|
||||
<string name="perf_xalia_hint">يعطّل مساعد التنقّل بوحدة التحكم في Proton، الذي يستهلك CPU في كل لعبة.</string>
|
||||
<string name="perf_seccomp">تشغيل proot بلا seccomp</string>
|
||||
<string name="perf_seccomp_hint">قد يُصلح أخطاء استدعاءات النظام (syscall) الناقصة على بعض الأنوية. قد يقلّل الأداء.</string>
|
||||
<string name="perf_native_userland">التشغيل دون proot (تجريبي)</string>
|
||||
<string name="perf_native_userland_hint">يبدأ تشغيل جانب Linux مباشرة على Android. يسري على الجلسة التالية. أوقفه إذا تعذر تشغيل أي شيء.</string>
|
||||
<string name="perf_fastpath">مسار proot السريع</string>
|
||||
<string name="perf_fastpath_needs_proot">لا يُستخدم دون proot.</string>
|
||||
<string name="perf_fastpath_needs_seccomp">يحتاج إلى مرشّح seccomp في proot.</string>
|
||||
<string name="perf_fastpath_hint">عمليات بحث أسرع عن الملفات وتقطّع أقل. أوقفه إذا تعذّر على برنامج العثور على ملفاته.</string>
|
||||
<string name="perf_cursor_composite">رسم المؤشر داخل gamescope</string>
|
||||
<string name="perf_cursor_composite_hint">يرسم Gamescope المؤشر بنفسه بدلًا من تسليمه إلى Android. فعّله لمؤشر تتحكّم فيه وحدة التحكم. الإيقاف أسرع على الهاتف. يُطبَّق في الجلسة التالية.</string>
|
||||
<string name="perf_identity">هوية الجلسة</string>
|
||||
<string name="perf_hostname">اسم المضيف</string>
|
||||
<string name="perf_hostname_hint">الاسم الذي يراه Steam لهذا الجهاز. اتركه خاليًا للاستعادة إلى %1$s.</string>
|
||||
<string name="perf_hostname_invalid">أحرف وأرقام وشرطات داخلية فقط، حتى 63 حرفًا.</string>
|
||||
<string name="perf_desktop_as_user">تشغيل سطح المكتب كمستخدم</string>
|
||||
<string name="perf_desktop_as_user_hint">يعمل سطح المكتب وتطبيقاته وطرفياته كمستخدم عادي باسم deck بدلًا من root، للتطبيقات التي ترفض root. يظل sudo يعمل. يسري على سطح المكتب التالي.</string>
|
||||
<string name="perf_phantom_warning">Android مهيَّأ لإنهاء هذه الجلسة</string>
|
||||
<string name="driver_installed">مثبّت</string>
|
||||
<string name="driver_available">متاح للتنزيل</string>
|
||||
<string name="driver_nothing_new">لا جديد منذ آخر تحقّق.</string>
|
||||
@@ -840,6 +849,7 @@
|
||||
<string name="setup_check_done">تم</string>
|
||||
<string name="setup_check_warn">يحتاج إلى انتباه</string>
|
||||
<string name="setup_check_busy">قيد التنفيذ</string>
|
||||
<string name="setup_limit_adb_failed">تحقّق من عنوان IP والمنفذ في تصحيح الأخطاء اللاسلكي، أو أعد الإقران إذا أزال Android هذا الجهاز.</string>
|
||||
<string name="setup_install">تثبيت</string>
|
||||
<string name="setup_manage">إدارة</string>
|
||||
<string name="setup_tab_overview">نظرة عامة</string>
|
||||
@@ -863,10 +873,16 @@
|
||||
<string name="setup_installed">مثبّت</string>
|
||||
<string name="setup_runtime_update">%1$s · يتوفر تحديث</string>
|
||||
<string name="setup_runtime_current">%1$s · محدَّث</string>
|
||||
<string name="setup_limit">حد العمليات الفرعية</string>
|
||||
<string name="setup_limit_on">مفعَّل · قد يُغلق Android تطبيق Steam. إيقافه يستغرق دقيقة.</string>
|
||||
<string name="setup_limit_unset">غير مُحدَّد · قد يُغلق Android تطبيق Steam. إيقافه يستغرق دقيقة.</string>
|
||||
<string name="setup_limit_unknown">تعذّر التحقّق منه · إيقافه يستغرق دقيقة.</string>
|
||||
<string name="setup_fix_it">إصلاح</string>
|
||||
<string name="setup_details">التفاصيل</string>
|
||||
<string name="setup_dev_options">خيارات المطوّرين</string>
|
||||
<string name="setup_use_wireless">استخدام تصحيح الأخطاء اللاسلكي</string>
|
||||
<string name="setup_check_again">التحقّق مرة أخرى</string>
|
||||
<string name="setup_limit_turn_on">تفعيل الحد</string>
|
||||
<string name="setup_account">حساب Steam</string>
|
||||
<string name="setup_signed_in_offline">تم تسجيل الدخول باسم %1$s · وضع عدم الاتصال</string>
|
||||
<string name="setup_signed_in">تم تسجيل الدخول باسم %1$s</string>
|
||||
@@ -1286,14 +1302,35 @@
|
||||
<item quantity="many">آخر التغييرات · %1$d إصدارًا</item>
|
||||
<item quantity="other">آخر التغييرات · %1$d إصدار</item>
|
||||
</plurals>
|
||||
<string name="gate_title">إعداد واحد في Android يجب تغييره</string>
|
||||
<string name="gate_eyebrow">Steam</string>
|
||||
<string name="gate_lede">يوقف Android التطبيقات التي تبدأ عمليات خلفية كثيرة، وSteam يبدأ عشرات منها. وإلى أن يتغيّر هذا، تُغلَق الألعاب دون أي خطأ.</string>
|
||||
<string name="gate_fix_for_me">إصلاحه لي</string>
|
||||
<string name="gate_toggle_steps">فعِّل «إيقاف القيود المفروضة على العمليات الثانوية»، ثم عُد. اترك خيارات المطوّرين مفعّلة، وإلا سيُعاد تعطيل المفتاح.</string>
|
||||
<string name="gate_open_dev">فتح خيارات المطوّرين</string>
|
||||
<string name="gate_no_toggle">لا يحتوي إصدار Android هذا على مفتاح لذلك، لذا يغيّره DroidDeck عبر تصحيح الأخطاء اللاسلكي. يستغرق نحو دقيقة، ولا يحتاج إلى جهاز كمبيوتر.</string>
|
||||
<string name="gate_needs_wifi">يحتاج تصحيح الأخطاء اللاسلكي إلى Wi-Fi. تعمل أي شبكة؛ فهو لا يحتاج إلى اتصال بالإنترنت.</string>
|
||||
<string name="gate_step1">افتح الإعدادات ← خيارات المطوّرين ← تصحيح الأخطاء اللاسلكي وفعِّله</string>
|
||||
<string name="gate_step2">اضغط على «إقران جهاز برمز إقران»</string>
|
||||
<string name="gate_step3">أدخل الرمز في إشعار DroidDeck</string>
|
||||
<string name="pairguide_build_number">في «لمحة عن الهاتف»، انقر على «رقم الإصدار» 7 مرات</string>
|
||||
<string name="pairguide_wireless">فعّل «تصحيح الأخطاء اللاسلكي»</string>
|
||||
<string name="pairguide_pair">افتح «تصحيح الأخطاء اللاسلكي»، ثم انقر على «إقران الجهاز باستخدام رمز الإقران»</string>
|
||||
<string name="pairguide_child_process">فعّل «إيقاف قيود العمليات الفرعية»</string>
|
||||
<string name="pairguide_row_child_process">إيقاف قيود العمليات الفرعية</string>
|
||||
<string name="pairguide_row_build_number">رقم الإصدار</string>
|
||||
<string name="pairguide_row_wireless">تصحيح الأخطاء اللاسلكي</string>
|
||||
<string name="pairguide_row_pair">إقران الجهاز باستخدام رمز الإقران</string>
|
||||
<string name="gate_waiting">في انتظار نافذة الإقران المنبثقة…</string>
|
||||
<string name="gate_code_needed">تم العثور على النافذة المنبثقة. أدخل رمزها في الإشعار.</string>
|
||||
<string name="gate_status">الحالة</string>
|
||||
<string name="gate_polling">يتم التحقّق كل ثانيتين. تُغلَق هذه الصفحة عند إيقافه.</string>
|
||||
<string name="gate_other_ways">طرق أخرى</string>
|
||||
<string name="gate_use_wireless_instead">استخدام تصحيح الأخطاء اللاسلكي بدلًا من ذلك</string>
|
||||
<string name="gate_some_roms">تضيف بعض إصدارات ROM هذا المفتاح رغم ذلك. ابحث عن «العمليات الفرعية» في خيارات المطوّرين.</string>
|
||||
<string name="gate_from_computer">من جهاز كمبيوتر يحتوي على ADB:</string>
|
||||
<string name="gate_copy_command">نسخ الأمر</string>
|
||||
<string name="gate_sidequest_steps">وصّل النظارة بالكمبيوتر وافتح SideQuest. اختر “Run ADB Command” ثم “Custom Command”، واكتب الأمر الظاهر أدناه، ثم اختر “Run Command”.</string>
|
||||
<string name="gate_choose_display">اختر الشاشة التي ستُفتَح فيها إعدادات Android.</string>
|
||||
<string name="gate_main_screen">الشاشة الرئيسية</string>
|
||||
<string name="ctrl_color">اللون</string>
|
||||
@@ -1770,6 +1807,14 @@
|
||||
<string name="session_ended_desktop">توقّف سطح المكتب بشكل غير متوقَّع. شارِك السجلات مع بلاغ عن الخطأ، أو حاوِل مرة أخرى.</string>
|
||||
<string name="session_ended_detail">حالة الخروج %1$d · %2$s</string>
|
||||
<string name="session_ended_no_log">لا يوجد سجل</string>
|
||||
<plurals name="session_hint_enosys">
|
||||
<item quantity="zero">يُظهر السجل %1$d خطأ من نوع «Function not implemented»: تسريع seccomp في proot يتسبّب في فشل أداة مساعدة على هذا الجهاز. جرِّب %2$s → «%3$s» (أو «%4$s») وابدأ من جديد.</item>
|
||||
<item quantity="one">يُظهر السجل خطأً واحدًا من نوع «Function not implemented»: تسريع seccomp في proot يتسبّب في فشل أداة مساعدة على هذا الجهاز. جرِّب %2$s → «%3$s» (أو «%4$s») وابدأ من جديد.</item>
|
||||
<item quantity="two">يُظهر السجل خطأين من نوع «Function not implemented»: تسريع seccomp في proot يتسبّب في فشل أداة مساعدة على هذا الجهاز. جرِّب %2$s → «%3$s» (أو «%4$s») وابدأ من جديد.</item>
|
||||
<item quantity="few">يُظهر السجل %1$d أخطاء من نوع «Function not implemented»: تسريع seccomp في proot يتسبّب في فشل أداة مساعدة على هذا الجهاز. جرِّب %2$s → «%3$s» (أو «%4$s») وابدأ من جديد.</item>
|
||||
<item quantity="many">يُظهر السجل %1$d خطأً من نوع «Function not implemented»: تسريع seccomp في proot يتسبّب في فشل أداة مساعدة على هذا الجهاز. جرِّب %2$s → «%3$s» (أو «%4$s») وابدأ من جديد.</item>
|
||||
<item quantity="other">يُظهر السجل %1$d خطأ من نوع «Function not implemented»: تسريع seccomp في proot يتسبّب في فشل أداة مساعدة على هذا الجهاز. جرِّب %2$s → «%3$s» (أو «%4$s») وابدأ من جديد.</item>
|
||||
</plurals>
|
||||
<string name="mode_decky_plugins">الإضافات</string>
|
||||
<string name="mode_decky_plugins_hint">ثبِّت ملف ZIP لإضافة في جلسة Steam التالية.</string>
|
||||
<string name="mode_decky_plugin_downloading">جارٍ التنزيل…</string>
|
||||
@@ -2191,7 +2236,6 @@
|
||||
<string name="bottom_qam_layout_left">يسار</string>
|
||||
<string name="bottom_qam_layout_center">وسط</string>
|
||||
<string name="bottom_qam_layout_right">يمين</string>
|
||||
<string name="bottom_qam_layout_split">مقسّم</string>
|
||||
<string name="bottom_qam_unavailable">قائمة الوصول السريع في Steam غير متاحة بعد.</string>
|
||||
<string name="bottom_page_telemetry">إحصاءات داخل اللعبة</string>
|
||||
<string name="bottom_hud_group">مؤشرات الشاشة السفلية</string>
|
||||
@@ -2322,6 +2366,7 @@
|
||||
<string name="deckymgr_restore_failed">تعذّر استعادة الإضافة الحالية</string>
|
||||
<string name="adbfix_save_failed">تعذّر حفظ هوية تصحيح الأخطاء اللاسلكي</string>
|
||||
<string name="adbfix_command_failed">فشل أمر ADB (%1$d)</string>
|
||||
<string name="adbfix_not_confirmed">لم يؤكّد Android تغيير حدّ العمليات الفرعية: %1$s</string>
|
||||
<string name="adbfix_no_pairing">لا يوجد إقران محفوظ لتصحيح الأخطاء اللاسلكي</string>
|
||||
<string name="adbfix_enter_address">أدخِل عنوان IP الحالي ورقم المنفذ لتصحيح الأخطاء اللاسلكي</string>
|
||||
<string name="adbpair_timed_out">انتهت مهلة انتظار النافذة المنبثقة للإقران. حاوِل مرة أخرى من DroidDeck.</string>
|
||||
@@ -2331,6 +2376,8 @@
|
||||
<string name="adbpair_pairing">جارٍ الإقران…</string>
|
||||
<string name="adbpair_code_rejected">لم ينجح هذا الرمز. افتح النافذة المنبثقة للإقران مرة أخرى وأدخِل رمزها الجديد.</string>
|
||||
<string name="adbpair_connecting">تم الإقران. جارٍ الاتصال…</string>
|
||||
<string name="adbpair_port_not_found">تم الإقران، لكن لم يتم العثور على منفذ تصحيح الأخطاء اللاسلكي. اترك تصحيح الأخطاء اللاسلكي مفعَّلاً وحاوِل مرة أخرى.</string>
|
||||
<string name="adbpair_applying">جارٍ تطبيق الإعداد…</string>
|
||||
<string name="adbpair_command_failed">فشل أمر تصحيح الأخطاء اللاسلكي</string>
|
||||
<string name="adbpair_channel_name">إعداد تصحيح الأخطاء اللاسلكي</string>
|
||||
<string name="adbpair_progress_channel_name">تقدّم إعداد تصحيح الأخطاء اللاسلكي</string>
|
||||
@@ -2343,6 +2390,9 @@
|
||||
<string name="adbpair_title_code">أدخِل رمز إقران Wi-Fi</string>
|
||||
<string name="adbpair_title_retry">أعِد تجربة الرمز</string>
|
||||
<string name="adbpair_enter_code">إدخال الرمز</string>
|
||||
<string name="adbpair_title_working">جارٍ إعداد Steam</string>
|
||||
<string name="adbpair_title_done">Steam جاهز</string>
|
||||
<string name="adbpair_done_text">اضغط للعودة إلى DroidDeck. يمكنك إيقاف تصحيح الأخطاء اللاسلكي الآن.</string>
|
||||
<string name="adbpair_title_failed">توقَّف إعداد تصحيح الأخطاء اللاسلكي</string>
|
||||
<string name="selfinst_download_failed">فشل التنزيل</string>
|
||||
<string name="selfinst_size_mismatch">حجم التنزيل غير مطابق لملف APK المنشور، وتم تجاهله - حاوِل مرة أخرى</string>
|
||||
@@ -2492,6 +2542,16 @@
|
||||
<string name="hdr_none">لا تُعلن هذه الشاشة عن دعم HDR</string>
|
||||
<string name="hdr_not_hdr10">تدعم هذه الشاشة %1$s، وليس HDR10</string>
|
||||
<string name="gpu_this_gpu">وحدة GPU هذه</string>
|
||||
<string name="phantom_title_on">حدّ العمليات الفرعية مفعَّل</string>
|
||||
<string name="phantom_title_unset">حدّ العمليات الفرعية غير محدَّد</string>
|
||||
<string name="phantom_title_unreadable">تعذّر التحقّق من حدّ العمليات الفرعية</string>
|
||||
<string name="phantom_title_off">حدّ العمليات الفرعية غير مفعَّل</string>
|
||||
<string name="phantom_title_not_required">حدّ العمليات الفرعية غير مطلوب</string>
|
||||
<string name="phantom_instructions_fix">%1$s إذا لم يكن ذلك ممكنًا، وصِّل هذا الجهاز بكمبيوتر يستخدم ADB ونفِّذ الأمر أدناه. عُد إلى هنا وتحقَّق مرة أخرى.</string>
|
||||
<string name="phantom_instructions_off">يمكن بدء جلسات Steam.</string>
|
||||
<string name="phantom_instructions_not_applicable">لا يستخدم إصدار Android هذا هذا الحدّ.</string>
|
||||
<string name="phantom_fix_toggle">فعِّل «إيقاف القيود المفروضة على العمليات الثانوية» في خيارات المطوّرين، واترك خيارات المطوّرين مفعَّلة بعد ذلك.</string>
|
||||
<string name="phantom_fix_no_toggle">لا يحتوي إصدار Android هذا على مفتاح لذلك. استخدِم تصحيح الأخطاء اللاسلكي لتغييره من هذا الجهاز.</string>
|
||||
<string name="upd_block_no_apk">لا يتوفّر تنزيل لهذا الإصدار الخاص بهذه النسخة من DroidDeck.</string>
|
||||
<string name="upd_block_version_code">لن يثبِّته Android فوق هذا الإصدار لأن versionCode %1$d أقل من %2$d المثبَّت.</string>
|
||||
<string name="upd_fail_downgrade">لن يثبِّت Android إصدارًا أقدم فوق إصدار أحدث. ابقَ على هذا الإصدار إلى أن تلحق به قناة التحديثات.</string>
|
||||
@@ -2520,12 +2580,14 @@
|
||||
<string name="gstore_volume_free">%1$s · %2$s متاحة</string>
|
||||
<string name="mode_storage_auto_short">تلقائي</string>
|
||||
<string name="appupd_catalog_rejected">فشل كتالوج التحديثات في اختباراته (%1$s)</string>
|
||||
<string name="main_adb_clip_label">إعداد العمليات الفرعية لـ DroidDeck</string>
|
||||
<string name="setup_signed_in_offline_unnamed">تم تسجيل الدخول · وضع عدم الاتصال</string>
|
||||
<string name="setup_signed_in_unnamed">تم تسجيل الدخول</string>
|
||||
<string name="driver_tag_bundled">مرفق</string>
|
||||
<string name="driver_tag_downloaded">منزَّل</string>
|
||||
<string name="driver_tag_imported">مستورَد</string>
|
||||
<string name="driver_tag_bundle">Android + Linux</string>
|
||||
<string name="phantom_warning">%1$s. %2$s\n\n%3$s</string>
|
||||
<string name="display_session">شاشة الجلسة</string>
|
||||
<string name="display_zero_copy">العرض بدون نسخ</string>
|
||||
<string name="display_resolution_landscape">دقة الوضع الأفقي</string>
|
||||
@@ -2964,6 +3026,7 @@
|
||||
<string name="setup_ready">جاهز للّعب</string>
|
||||
<string name="setup_not_ready">غير جاهز للّعب بعد</string>
|
||||
<string name="setup_ready_runtime">بيئة التشغيل %1$s</string>
|
||||
<string name="setup_ready_limit_off">حدّ العمليات الفرعية غير مفعَّل</string>
|
||||
<string name="setup_ready_signed_in">تم تسجيل الدخول باسم %1$s</string>
|
||||
<string name="setup_needs_you">عندما يحتاج الأمر إلى تدخّلك</string>
|
||||
<string name="setup_group_look">المظهر</string>
|
||||
@@ -4252,7 +4315,4 @@
|
||||
<string name="steam_store_linux_build">تثبّت هذه اللعبة إصدار Linux الخاص بها. ثبّتها من Steam.</string>
|
||||
<string name="game_zoom_title">تكبير اللعبة</string>
|
||||
<string name="game_zoom_hint">اضبط تكبير اللعبة من 100% إلى 300%</string>
|
||||
<string name="glasses_shortcut_group">اختصار داخل اللعبة</string>
|
||||
<string name="glasses_show_shortcut">إظهار اختصار النظارات الذكية</string>
|
||||
<string name="glasses_show_shortcut_hint">إظهار زر النظارات الذكية العائم فوق اللعبة.</string>
|
||||
</resources>
|
||||
@@ -200,6 +200,7 @@
|
||||
<string name="app_fex_hint">FEX ejecuta programas Linux x86 en este dispositivo ARM64. Auto lo usa cuando el programa es para x86.</string>
|
||||
<string name="app_fex_x86">%1$s con FEX</string>
|
||||
<string name="app_fex_not_ready">Este programa está hecho para PC %1$s y se ejecuta con FEX, que aún no está listo. Abre Steam una vez con tu sesión iniciada: DroidDeck hará que descargue FEX y el Steam Linux Runtime que necesita, y después se abrirá.</string>
|
||||
<string name="session_proot_missing">No se pudo descargar el proot de DroidDeck. Revisa la conexión e inténtalo de nuevo. La sesión no se inició porque el proot alternativo es demasiado lento para jugar.</string>
|
||||
<string name="session_powervr_missing">No se pudo descargar el entorno gráfico de PowerVR. Revisa la conexión e inténtalo de nuevo.</string>
|
||||
<string name="session_graphics_runtime_failed">No se pudo preparar el entorno gráfico, así que la sesión no se inició.</string>
|
||||
<string name="session_game_environment_failed">No se pudo configurar el entorno del juego, así que la sesión no se inició.</string>
|
||||
@@ -446,6 +447,7 @@
|
||||
<string name="libraries_rename">Cambiar nombre</string>
|
||||
<string name="libraries_rename_title">Nombre de la biblioteca</string>
|
||||
<string name="libraries_pick">Elige una carpeta para la biblioteca</string>
|
||||
<string name="libraries_full">Como máximo %1$d bibliotecas agregadas</string>
|
||||
<string name="libraries_overlap">Esa carpeta ya es una biblioteca o está dentro de una</string>
|
||||
<string name="libraries_missing">%1$s · no disponible</string>
|
||||
<string name="libraries_applies_next">Se aplica a partir de la próxima sesión de Steam</string>
|
||||
@@ -632,14 +634,21 @@
|
||||
<string name="perf_fsync_hint">Usa el fsync propio de Proton con los archivos originales de Proton, con futex_waitv proporcionado en espacio de usuario, así que no necesita paquete y sigue funcionando en cuanto Steam actualiza Proton. Mientras está activado, los juegos lo usan antes que droiddeck-esync, salvo los pocos que Proton mantiene sin fsync. Se aplica en la próxima sesión.</string>
|
||||
<string name="perf_esync_hint">Los hilos de Windows de los juegos se esperan entre sí mediante eventfd y memoria compartida, sin pasar por wineserver. Usa un paquete droiddeck-esync hecho para esa versión exacta de Proton; los paquetes se descargan automáticamente. Mientras no exista uno para una versión nueva de Proton, droiddeck-fsync lo sustituye. Se aplica en la próxima sesión.</string>
|
||||
<string name="perf_xalia_hint">Desactiva el asistente de navegación con control de Proton, que consume CPU en cada juego.</string>
|
||||
<string name="perf_seccomp">Ejecutar proot sin seccomp</string>
|
||||
<string name="perf_seccomp_hint">Puede corregir errores de syscalls ausentes en algunos kernels. Puede reducir el rendimiento.</string>
|
||||
<string name="perf_native_userland">Ejecutar sin proot (experimental)</string>
|
||||
<string name="perf_native_userland_hint">Inicia el entorno Linux directamente en Android. Se aplica a la próxima sesión. Desactívalo si algo falla al iniciar.</string>
|
||||
<string name="perf_fastpath">Ruta rápida de proot</string>
|
||||
<string name="perf_fastpath_needs_proot">No se usa sin proot.</string>
|
||||
<string name="perf_fastpath_needs_seccomp">Requiere el filtro seccomp de proot.</string>
|
||||
<string name="perf_fastpath_hint">Búsquedas de archivos más rápidas y menos microcortes. Desactívalo si un programa no encuentra sus archivos.</string>
|
||||
<string name="perf_cursor_composite">Dibujar el cursor dentro de gamescope</string>
|
||||
<string name="perf_cursor_composite_hint">Gamescope dibuja el puntero por sí mismo en lugar de pasárselo a Android. Actívalo para un cursor manejado con el control. Desactivado es más rápido en un celular. Se aplica en la próxima sesión.</string>
|
||||
<string name="perf_identity">Identidad de la sesión</string>
|
||||
<string name="perf_hostname">Nombre del host</string>
|
||||
<string name="perf_hostname_hint">El nombre que Steam ve para este dispositivo. En blanco restaura %1$s.</string>
|
||||
<string name="perf_hostname_invalid">Solo letras, dígitos y guiones internos, hasta 63 caracteres.</string>
|
||||
<string name="perf_desktop_as_user">El escritorio se ejecuta como usuario</string>
|
||||
<string name="perf_desktop_as_user_hint">El escritorio, sus apps y sus terminales se ejecutan como el usuario común deck en lugar de root, para las apps que rechazan root. sudo sigue funcionando. Se aplica al próximo escritorio.</string>
|
||||
<string name="perf_phantom_warning">Android está configurado para cerrar esta sesión</string>
|
||||
<string name="driver_installed">Instalado</string>
|
||||
<string name="driver_available">Disponible para descargar</string>
|
||||
<string name="driver_nothing_new">Nada nuevo desde la última comprobación.</string>
|
||||
@@ -858,6 +867,7 @@
|
||||
<string name="setup_check_done">Hecho</string>
|
||||
<string name="setup_check_warn">Requiere atención</string>
|
||||
<string name="setup_check_busy">Trabajando</string>
|
||||
<string name="setup_limit_adb_failed">Revisa la dirección IP y el puerto de la Depuración inalámbrica, o vincula de nuevo si Android quitó este dispositivo.</string>
|
||||
<string name="setup_install">Instalar</string>
|
||||
<string name="setup_manage">Administrar</string>
|
||||
<string name="setup_tab_overview">Resumen</string>
|
||||
@@ -881,10 +891,16 @@
|
||||
<string name="setup_installed">Instalado</string>
|
||||
<string name="setup_runtime_update">%1$s · actualización disponible</string>
|
||||
<string name="setup_runtime_current">%1$s · al día</string>
|
||||
<string name="setup_limit">Límite de procesos secundarios</string>
|
||||
<string name="setup_limit_on">Activado · Android puede cerrar Steam. Desactivarlo tarda un minuto.</string>
|
||||
<string name="setup_limit_unset">Sin definir · Android puede cerrar Steam. Desactivarlo tarda un minuto.</string>
|
||||
<string name="setup_limit_unknown">No se pudo comprobar · desactivarlo tarda un minuto.</string>
|
||||
<string name="setup_fix_it">Solucionar</string>
|
||||
<string name="setup_details">Detalles</string>
|
||||
<string name="setup_dev_options">Opciones de desarrollador</string>
|
||||
<string name="setup_use_wireless">Usar Depuración inalámbrica</string>
|
||||
<string name="setup_check_again">Comprobar de nuevo</string>
|
||||
<string name="setup_limit_turn_on">Activar límite</string>
|
||||
<string name="setup_account">Cuenta de Steam</string>
|
||||
<string name="setup_signed_in_offline">Sesión iniciada como %1$s · modo sin conexión</string>
|
||||
<string name="setup_signed_in">Sesión iniciada como %1$s</string>
|
||||
@@ -1292,14 +1308,35 @@
|
||||
<item quantity="other">Cambios recientes · %1$d versiones</item>
|
||||
<item quantity="many">Cambios recientes · %1$d versiones</item>
|
||||
</plurals>
|
||||
<string name="gate_title">Un ajuste de Android por cambiar</string>
|
||||
<string name="gate_eyebrow">Steam</string>
|
||||
<string name="gate_lede">Android detiene las apps que inician muchos procesos en segundo plano, y Steam inicia decenas. Hasta que esto cambie, los juegos se cierran sin mostrar ningún error.</string>
|
||||
<string name="gate_fix_for_me">Solucionarlo por mí</string>
|
||||
<string name="gate_toggle_steps">Activa “Inhabilitar restricciones de procesos secundarios” y vuelve. Deja activadas las Opciones de desarrollador o el interruptor se desactivará de nuevo.</string>
|
||||
<string name="gate_open_dev">Abrir Opciones de desarrollador</string>
|
||||
<string name="gate_no_toggle">Esta versión de Android no tiene un interruptor para ello, así que DroidDeck lo cambia mediante la Depuración inalámbrica. Tarda un minuto y no necesitas una computadora.</string>
|
||||
<string name="gate_needs_wifi">La Depuración inalámbrica necesita Wi-Fi. Sirve cualquier red; no necesita internet.</string>
|
||||
<string name="gate_step1">Abre Ajustes → Opciones de desarrollador → Depuración inalámbrica y actívala</string>
|
||||
<string name="gate_step2">Toca “Vincular dispositivo con código de vinculación”</string>
|
||||
<string name="gate_step3">Escribe el código en la notificación de DroidDeck</string>
|
||||
<string name="pairguide_build_number">En Acerca del teléfono, toca Número de compilación 7 veces</string>
|
||||
<string name="pairguide_wireless">Activa la Depuración inalámbrica</string>
|
||||
<string name="pairguide_pair">Abre Depuración inalámbrica y toca “Vincular dispositivo con código de vinculación”</string>
|
||||
<string name="pairguide_child_process">Activa “Inhabilitar restricciones de procesos secundarios”</string>
|
||||
<string name="pairguide_row_child_process">Inhabilitar restricciones de procesos secundarios</string>
|
||||
<string name="pairguide_row_build_number">Número de compilación</string>
|
||||
<string name="pairguide_row_wireless">Depuración inalámbrica</string>
|
||||
<string name="pairguide_row_pair">Vincular dispositivo con código de vinculación</string>
|
||||
<string name="gate_waiting">Esperando la ventana de vinculación…</string>
|
||||
<string name="gate_code_needed">Ventana encontrada. Ingresa su código en la notificación.</string>
|
||||
<string name="gate_status">Estado</string>
|
||||
<string name="gate_polling">Se comprueba cada 2 segundos. Esta página se cierra cuando esté desactivado.</string>
|
||||
<string name="gate_other_ways">Otras formas</string>
|
||||
<string name="gate_use_wireless_instead">Usar Depuración inalámbrica en su lugar</string>
|
||||
<string name="gate_some_roms">Algunas ROM agregan el interruptor de todos modos. Busca “procesos secundarios” en Opciones de desarrollador.</string>
|
||||
<string name="gate_from_computer">Desde una computadora con ADB:</string>
|
||||
<string name="gate_copy_command">Copiar comando</string>
|
||||
<string name="gate_sidequest_steps">Conecta el visor a una computadora y abre SideQuest. Elige “Run ADB Command” y luego “Custom Command”, escribe el comando que aparece abajo y selecciona “Run Command”.</string>
|
||||
<string name="gate_choose_display">Elige en qué pantalla abrir los Ajustes de Android.</string>
|
||||
<string name="gate_main_screen">Pantalla principal</string>
|
||||
<string name="ctrl_color">Color</string>
|
||||
@@ -1789,6 +1826,11 @@
|
||||
<string name="session_ended_desktop">El escritorio se detuvo inesperadamente. Comparte los registros en un informe de error o inténtalo de nuevo.</string>
|
||||
<string name="session_ended_detail">Código de salida %1$d · %2$s</string>
|
||||
<string name="session_ended_no_log">sin registro</string>
|
||||
<plurals name="session_hint_enosys">
|
||||
<item quantity="one">El registro muestra %1$d error \\"Function not implemented\\": la aceleración seccomp de proot hace fallar un proceso auxiliar en este dispositivo. Prueba %2$s → \\"%3$s\\" (o \\"%4$s\\") y vuelve a iniciar.</item>
|
||||
<item quantity="other">El registro muestra %1$d errores \\"Function not implemented\\": la aceleración seccomp de proot hace fallar un proceso auxiliar en este dispositivo. Prueba %2$s → \\"%3$s\\" (o \\"%4$s\\") y vuelve a iniciar.</item>
|
||||
<item quantity="many">El registro muestra %1$d errores \\"Function not implemented\\": la aceleración seccomp de proot hace fallar un proceso auxiliar en este dispositivo. Prueba %2$s → \\"%3$s\\" (o \\"%4$s\\") y vuelve a iniciar.</item>
|
||||
</plurals>
|
||||
<string name="mode_decky_plugins">Plugins</string>
|
||||
<string name="mode_decky_plugins_hint">Instala un ZIP de plugin para la próxima sesión de Steam.</string>
|
||||
<string name="mode_decky_plugin_downloading">Descargando…</string>
|
||||
@@ -2189,7 +2231,6 @@
|
||||
<string name="bottom_qam_layout_left">Izquierda</string>
|
||||
<string name="bottom_qam_layout_center">Centro</string>
|
||||
<string name="bottom_qam_layout_right">Derecha</string>
|
||||
<string name="bottom_qam_layout_split">Dividido</string>
|
||||
<string name="bottom_qam_unavailable">El menú de acceso rápido de Steam aún no está disponible.</string>
|
||||
<string name="bottom_page_telemetry">Estadísticas del juego</string>
|
||||
<string name="bottom_hud_group">HUD de la pantalla inferior</string>
|
||||
@@ -2317,6 +2358,7 @@
|
||||
<string name="deckymgr_restore_failed">No se pudo restaurar el plugin existente</string>
|
||||
<string name="adbfix_save_failed">No se pudo guardar la identidad de la Depuración inalámbrica</string>
|
||||
<string name="adbfix_command_failed">Falló el comando ADB (%1$d)</string>
|
||||
<string name="adbfix_not_confirmed">Android no confirmó el cambio del límite de procesos secundarios: %1$s</string>
|
||||
<string name="adbfix_no_pairing">No hay ninguna vinculación de Depuración inalámbrica guardada</string>
|
||||
<string name="adbfix_enter_address">Ingresa la dirección IP y el puerto actuales de la Depuración inalámbrica</string>
|
||||
<string name="adbpair_timed_out">Se agotó el tiempo de espera de la ventana de vinculación. Inténtalo de nuevo desde DroidDeck.</string>
|
||||
@@ -2326,6 +2368,8 @@
|
||||
<string name="adbpair_pairing">Vinculando…</string>
|
||||
<string name="adbpair_code_rejected">Ese código no funcionó. Vuelve a abrir la ventana de vinculación e ingresa su nuevo código.</string>
|
||||
<string name="adbpair_connecting">Vinculado. Conectando…</string>
|
||||
<string name="adbpair_port_not_found">Vinculado, pero no se encontró el puerto de la Depuración inalámbrica. Deja activada la Depuración inalámbrica e inténtalo de nuevo.</string>
|
||||
<string name="adbpair_applying">Aplicando el ajuste…</string>
|
||||
<string name="adbpair_command_failed">Falló el comando de la Depuración inalámbrica</string>
|
||||
<string name="adbpair_channel_name">Configuración de la Depuración inalámbrica</string>
|
||||
<string name="adbpair_progress_channel_name">Progreso de la configuración de la Depuración inalámbrica</string>
|
||||
@@ -2338,6 +2382,9 @@
|
||||
<string name="adbpair_title_code">Ingresa el código de vinculación Wi-Fi</string>
|
||||
<string name="adbpair_title_retry">Vuelve a probar el código</string>
|
||||
<string name="adbpair_enter_code">Ingresar código</string>
|
||||
<string name="adbpair_title_working">Preparando Steam</string>
|
||||
<string name="adbpair_title_done">Steam está listo</string>
|
||||
<string name="adbpair_done_text">Toca para volver a DroidDeck. Ya puedes desactivar la Depuración inalámbrica.</string>
|
||||
<string name="adbpair_title_failed">Se detuvo la configuración de la Depuración inalámbrica</string>
|
||||
<string name="selfinst_download_failed">Error en la descarga</string>
|
||||
<string name="selfinst_size_mismatch">El tamaño de la descarga no coincidía con el APK publicado y se descartó - inténtalo de nuevo</string>
|
||||
@@ -2487,6 +2534,16 @@
|
||||
<string name="hdr_none">esta pantalla no indica compatibilidad con HDR</string>
|
||||
<string name="hdr_not_hdr10">esta pantalla admite %1$s, no HDR10</string>
|
||||
<string name="gpu_this_gpu">esta GPU</string>
|
||||
<string name="phantom_title_on">El límite de procesos secundarios está activado</string>
|
||||
<string name="phantom_title_unset">El límite de procesos secundarios no está definido</string>
|
||||
<string name="phantom_title_unreadable">No se pudo comprobar el límite de procesos secundarios</string>
|
||||
<string name="phantom_title_off">El límite de procesos secundarios está desactivado</string>
|
||||
<string name="phantom_title_not_required">El límite de procesos secundarios no es necesario</string>
|
||||
<string name="phantom_instructions_fix">%1$s Si no es posible, conecta este dispositivo a una computadora con ADB y ejecuta el comando de abajo. Después vuelve aquí y comprueba de nuevo.</string>
|
||||
<string name="phantom_instructions_off">Ya se pueden iniciar sesiones de Steam.</string>
|
||||
<string name="phantom_instructions_not_applicable">Esta versión de Android no usa este límite.</string>
|
||||
<string name="phantom_fix_toggle">Activa “Inhabilitar restricciones de procesos secundarios” en Opciones de desarrollador y deja activadas las Opciones de desarrollador después.</string>
|
||||
<string name="phantom_fix_no_toggle">Esta versión de Android no tiene un interruptor para ello. Usa la Depuración inalámbrica para cambiarlo desde este dispositivo.</string>
|
||||
<string name="upd_block_no_apk">Esta versión no tiene descarga para esta copia de DroidDeck.</string>
|
||||
<string name="upd_block_version_code">Android no la instalará sobre esta versión porque su versionCode %1$d es inferior al %2$d instalado.</string>
|
||||
<string name="upd_fail_downgrade">Android no instala una versión anterior sobre una más reciente. Quédate en esta versión hasta que el canal la alcance.</string>
|
||||
@@ -2515,12 +2572,14 @@
|
||||
<string name="gstore_volume_free">%1$s · %2$s libres</string>
|
||||
<string name="mode_storage_auto_short">Automático</string>
|
||||
<string name="appupd_catalog_rejected">El catálogo de actualizaciones no superó las comprobaciones (%1$s)</string>
|
||||
<string name="main_adb_clip_label">Ajuste de procesos secundarios de DroidDeck</string>
|
||||
<string name="setup_signed_in_offline_unnamed">Sesión iniciada · modo sin conexión</string>
|
||||
<string name="setup_signed_in_unnamed">Sesión iniciada</string>
|
||||
<string name="driver_tag_bundled">INCLUIDO</string>
|
||||
<string name="driver_tag_downloaded">DESCARGADO</string>
|
||||
<string name="driver_tag_imported">IMPORTADO</string>
|
||||
<string name="driver_tag_bundle">ANDROID + LINUX</string>
|
||||
<string name="phantom_warning">%1$s. %2$s\n\n%3$s</string>
|
||||
<string name="display_session">Pantalla de la sesión</string>
|
||||
<string name="display_zero_copy">Presentación sin copia</string>
|
||||
<string name="display_resolution_landscape">Resolución horizontal</string>
|
||||
@@ -2927,6 +2986,7 @@
|
||||
<string name="setup_ready">Listo para jugar</string>
|
||||
<string name="setup_not_ready">Aún no está listo para jugar</string>
|
||||
<string name="setup_ready_runtime">runtime %1$s</string>
|
||||
<string name="setup_ready_limit_off">límite de procesos desactivado</string>
|
||||
<string name="setup_ready_signed_in">sesión iniciada como %1$s</string>
|
||||
<string name="setup_needs_you">Cuando algo requiera tu atención</string>
|
||||
<string name="setup_group_look">Aspecto</string>
|
||||
@@ -4133,7 +4193,4 @@
|
||||
<string name="steam_store_close_steam">Cierra Steam primero</string>
|
||||
<string name="steam_store_session_wait">Pausa primero la descarga de Steam</string>
|
||||
<string name="steam_store_linux_build">Este juego instala su versión para Linux. Instálalo desde Steam.</string>
|
||||
<string name="glasses_shortcut_group">Acceso directo en el juego</string>
|
||||
<string name="glasses_show_shortcut">Mostrar acceso directo de Smart Glasses</string>
|
||||
<string name="glasses_show_shortcut_hint">Mostrar el botón flotante de Smart Glasses sobre el juego.</string>
|
||||
</resources>
|
||||
@@ -200,6 +200,7 @@
|
||||
<string name="app_fex_hint">FEX стартира x86 Linux програми на това ARM64 устройство. Автоматично го използва, когато програмата е компилирана за x86.</string>
|
||||
<string name="app_fex_x86">%1$s през FEX</string>
|
||||
<string name="app_fex_not_ready">Тази програма е компилирана за %1$s компютри и се стартира през FEX, който още не е настроен. Отворете Steam веднъж, докато сте влезли: DroidDeck ще изтегли FEX и необходимата Steam Linux Runtime, след което тя ще се отвори.</string>
|
||||
<string name="session_proot_missing">proot на DroidDeck не можа да бъде изтеглен. Проверете връзката и опитайте пак. Сесията не беше стартирана, защото резервният proot е твърде бавен за игра.</string>
|
||||
<string name="session_powervr_missing">Графичната среда за PowerVR не можа да бъде изтеглена. Проверете връзката и опитайте отново.</string>
|
||||
<string name="session_graphics_runtime_failed">Графичната среда не можа да бъде подготвена, затова сесията не беше стартирана.</string>
|
||||
<string name="session_game_environment_failed">Средата на играта не можа да бъде настроена, затова сесията не беше стартирана.</string>
|
||||
@@ -445,6 +446,7 @@
|
||||
<string name="libraries_rename">Преименувай</string>
|
||||
<string name="libraries_rename_title">Име на библиотеката</string>
|
||||
<string name="libraries_pick">Избери папка за библиотеката</string>
|
||||
<string name="libraries_full">Най-много %1$d добавени библиотеки</string>
|
||||
<string name="libraries_overlap">Тази папка вече е библиотека или се намира в такава</string>
|
||||
<string name="libraries_missing">%1$s · не е налична</string>
|
||||
<string name="libraries_applies_next">Влиза в сила от следващата сесия на Steam</string>
|
||||
@@ -630,14 +632,21 @@
|
||||
<string name="perf_fsync_hint">Стартира собствения fsync на Proton върху оригиналните файлове на Proton, с futex_waitv, подаден от потребителско ниво, затова не изисква пакет и продължава да работи веднага след актуализация на Proton от Steam. Докато е включен, игрите го използват преди droiddeck-esync, освен малкото, които Proton държи извън fsync. Прилага се от следващата сесия.</string>
|
||||
<string name="perf_esync_hint">Windows нишките на игрите се изчакват взаимно чрез eventfd и обща памет, вместо през обиколки през wineserver. Използва пакет droiddeck-esync, направен точно за тази версия на Proton; пакетите се извличат автоматично. Докато не съществува такъв за нова версия на Proton, droiddeck-fsync го замества. Прилага се от следващата сесия.</string>
|
||||
<string name="perf_xalia_hint">Изключва помощника на Proton за навигация с контролер, който използва процесорно време във всяка игра.</string>
|
||||
<string name="perf_seccomp">Стартиране на proot без seccomp</string>
|
||||
<string name="perf_seccomp_hint">Може да отстрани грешки с липсващи системни извиквания на някои ядра. Може да намали производителността.</string>
|
||||
<string name="perf_native_userland">Стартиране без proot (експериментално)</string>
|
||||
<string name="perf_native_userland_hint">Стартира Linux частта директно в Android. Влиза в сила от следващата сесия. Изключи, ако нещо не се стартира.</string>
|
||||
<string name="perf_fastpath">Бърз път на proot</string>
|
||||
<string name="perf_fastpath_needs_proot">Не се използва без proot.</string>
|
||||
<string name="perf_fastpath_needs_seccomp">Изисква филтъра seccomp на proot.</string>
|
||||
<string name="perf_fastpath_hint">По-бързо търсене на файлове и по-малко заекване. Изключете, ако програма не може да намери файловете си.</string>
|
||||
<string name="perf_cursor_composite">Изобразяване на курсора в gamescope</string>
|
||||
<string name="perf_cursor_composite_hint">Gamescope сам рисува показалеца, вместо да го предава на Android. Включете за курсор, управляван с контролер. Изключено е по-бързо на телефон. Прилага се от следващата сесия.</string>
|
||||
<string name="perf_identity">Идентичност на сесията</string>
|
||||
<string name="perf_hostname">Име на хоста</string>
|
||||
<string name="perf_hostname_hint">Името, което Steam вижда за това устройство. Оставено празно възстановява %1$s.</string>
|
||||
<string name="perf_hostname_invalid">Само букви, цифри и тирета по средата, до 63 знака.</string>
|
||||
<string name="perf_desktop_as_user">Работният плот работи като потребител</string>
|
||||
<string name="perf_desktop_as_user_hint">Работният плот, приложенията и терминалите му работят като обикновения потребител deck вместо root, за приложения, които отказват root. sudo продължава да работи. Важи за следващия работен плот.</string>
|
||||
<string name="perf_phantom_warning">Android е настроен да прекратява тази сесия</string>
|
||||
<string name="driver_installed">Инсталиран</string>
|
||||
<string name="driver_available">Налично за изтегляне</string>
|
||||
<string name="driver_nothing_new">Нищо ново от последната проверка.</string>
|
||||
@@ -828,6 +837,7 @@
|
||||
<string name="setup_check_done">Готово</string>
|
||||
<string name="setup_check_warn">Нужно е внимание</string>
|
||||
<string name="setup_check_busy">Обработва се</string>
|
||||
<string name="setup_limit_adb_failed">Проверете IP адреса и порта за безжично отстраняване на грешки или сдвоете отново, ако Android е премахнал това устройство.</string>
|
||||
<string name="setup_install">Инсталиране</string>
|
||||
<string name="setup_manage">Управление</string>
|
||||
<string name="setup_tab_overview">Общ преглед</string>
|
||||
@@ -851,10 +861,16 @@
|
||||
<string name="setup_installed">Инсталирано</string>
|
||||
<string name="setup_runtime_update">%1$s · налична актуализация</string>
|
||||
<string name="setup_runtime_current">%1$s · актуално</string>
|
||||
<string name="setup_limit">Ограничение на дъщерните процеси</string>
|
||||
<string name="setup_limit_on">Включено · Android може да затвори Steam. Изключването отнема минута.</string>
|
||||
<string name="setup_limit_unset">Не е зададено · Android може да затвори Steam. Изключването отнема минута.</string>
|
||||
<string name="setup_limit_unknown">Не можа да се провери · изключването отнема минута.</string>
|
||||
<string name="setup_fix_it">Поправи</string>
|
||||
<string name="setup_details">Подробности</string>
|
||||
<string name="setup_dev_options">Опции за програмисти</string>
|
||||
<string name="setup_use_wireless">Използване на безжично отстраняване на грешки</string>
|
||||
<string name="setup_check_again">Проверка отново</string>
|
||||
<string name="setup_limit_turn_on">Включване на ограничението</string>
|
||||
<string name="setup_account">Акаунт в Steam</string>
|
||||
<string name="setup_signed_in_offline">Влезли сте като %1$s · офлайн режим</string>
|
||||
<string name="setup_signed_in">Влезли сте като %1$s</string>
|
||||
@@ -1258,14 +1274,35 @@
|
||||
<item quantity="one">Скорошни промени · %1$d версия</item>
|
||||
<item quantity="other">Скорошни промени · %1$d версии</item>
|
||||
</plurals>
|
||||
<string name="gate_title">Една настройка на Android за промяна</string>
|
||||
<string name="gate_eyebrow">Steam</string>
|
||||
<string name="gate_lede">Android спира приложения, които стартират много фонови процеси, а Steam стартира десетки. Докато това не се промени, игрите се затварят без грешка.</string>
|
||||
<string name="gate_fix_for_me">Поправи го вместо мен</string>
|
||||
<string name="gate_toggle_steps">Включете „Деактивиране на ограниченията за дъщерните процеси“, след което се върнете. Оставете Опции за програмисти включени, иначе превключвателят се изключва отново.</string>
|
||||
<string name="gate_open_dev">Отваряне на Опции за програмисти</string>
|
||||
<string name="gate_no_toggle">Тази версия на Android няма превключвател за това, затова DroidDeck го променя чрез безжично отстраняване на грешки. Отнема около минута, не е нужен компютър.</string>
|
||||
<string name="gate_needs_wifi">Безжичното отстраняване на грешки изисква Wi-Fi. Работи с всяка мрежа; не е необходим интернет.</string>
|
||||
<string name="gate_step1">Отворете Настройки → Опции за програмисти → Безжично отстраняване на грешки и го включете</string>
|
||||
<string name="gate_step2">Докоснете „Сдвояване на устройство с код за сдвояване“</string>
|
||||
<string name="gate_step3">Въведете кода в известието на DroidDeck</string>
|
||||
<string name="pairguide_build_number">В „Всичко за телефона“ докоснете „Номер на версията“ 7 пъти</string>
|
||||
<string name="pairguide_wireless">Включете „Безжично отстраняване на грешки“</string>
|
||||
<string name="pairguide_pair">Отворете „Безжично отстраняване на грешки“, след което докоснете „Сдвояване на устройството с код за сдвояване“</string>
|
||||
<string name="pairguide_child_process">Включете „Деактивиране на ограниченията за дъщерните процеси“</string>
|
||||
<string name="pairguide_row_child_process">Деактивиране на ограниченията за дъщерните процеси</string>
|
||||
<string name="pairguide_row_build_number">Номер на версията</string>
|
||||
<string name="pairguide_row_wireless">Безжично отстраняване на грешки</string>
|
||||
<string name="pairguide_row_pair">Сдвояване на устройството с код за сдвояване</string>
|
||||
<string name="gate_waiting">Изчакване на изскачащия прозорец за сдвояване…</string>
|
||||
<string name="gate_code_needed">Изскачащият прозорец е намерен. Въведете кода му в известието.</string>
|
||||
<string name="gate_status">Състояние</string>
|
||||
<string name="gate_polling">Проверява се на всеки 2 секунди. Тази страница се затваря, когато е изключено.</string>
|
||||
<string name="gate_other_ways">Други начини</string>
|
||||
<string name="gate_use_wireless_instead">Използване на безжично отстраняване на грешки вместо това</string>
|
||||
<string name="gate_some_roms">Някои ROM-и добавят превключвателя въпреки това. Потърсете „child process“ в Опции за програмисти.</string>
|
||||
<string name="gate_from_computer">От компютър с ADB:</string>
|
||||
<string name="gate_copy_command">Копиране на командата</string>
|
||||
<string name="gate_sidequest_steps">Свържете шлема с компютър и отворете SideQuest. Изберете „Run ADB Command“, после „Custom Command“, въведете командата, показана по-долу, и изберете „Run Command“.</string>
|
||||
<string name="gate_choose_display">Изберете на кой екран да се отворят настройките на Android.</string>
|
||||
<string name="gate_main_screen">Основен екран</string>
|
||||
<string name="ctrl_color">Цвят</string>
|
||||
@@ -1702,6 +1739,10 @@
|
||||
<string name="session_ended_desktop">Работният плот спря неочаквано. Сподели логовете в отчет за грешка или опитай отново.</string>
|
||||
<string name="session_ended_detail">Код на изход %1$d · %2$s</string>
|
||||
<string name="session_ended_no_log">няма лог</string>
|
||||
<plurals name="session_hint_enosys">
|
||||
<item quantity="one">Логът показва %1$d грешка „Function not implemented“: ускорението на proot чрез seccomp се проваля при помощен процес на това устройство. Пробвай %2$s → „%3$s“ (или „%4$s“) и стартирай отново.</item>
|
||||
<item quantity="other">Логът показва %1$d грешки „Function not implemented“: ускорението на proot чрез seccomp се проваля при помощен процес на това устройство. Пробвай %2$s → „%3$s“ (или „%4$s“) и стартирай отново.</item>
|
||||
</plurals>
|
||||
<string name="mode_decky_plugins">Плъгини</string>
|
||||
<string name="mode_decky_plugins_hint">Инсталирай ZIP с плъгин за следващата сесия на Steam.</string>
|
||||
<string name="mode_decky_plugin_downloading">Изтегляне…</string>
|
||||
@@ -2095,7 +2136,6 @@
|
||||
<string name="bottom_qam_layout_left">Вляво</string>
|
||||
<string name="bottom_qam_layout_center">В центъра</string>
|
||||
<string name="bottom_qam_layout_right">Вдясно</string>
|
||||
<string name="bottom_qam_layout_split">Разделено</string>
|
||||
<string name="bottom_qam_unavailable">Менюто за бърз достъп на Steam още не е налично.</string>
|
||||
<string name="bottom_page_telemetry">Статистика в играта</string>
|
||||
<string name="bottom_hud_group">HUD на долния екран</string>
|
||||
@@ -2222,6 +2262,7 @@
|
||||
<string name="deckymgr_restore_failed">Съществуващият плъгин не можа да бъде възстановен</string>
|
||||
<string name="adbfix_save_failed">Идентичността на безжичното отстраняване на грешки не можа да бъде запазена</string>
|
||||
<string name="adbfix_command_failed">Командата на ADB се провали (%1$d)</string>
|
||||
<string name="adbfix_not_confirmed">Android не потвърди промяната на ограничението за дъщерни процеси: %1$s</string>
|
||||
<string name="adbfix_no_pairing">Няма запазено чифтосване за безжично отстраняване на грешки</string>
|
||||
<string name="adbfix_enter_address">Въведи текущия IP адрес и порт за безжично отстраняване на грешки</string>
|
||||
<string name="adbpair_timed_out">Изтече времето за изчакване на изскачащия прозорец за чифтосване. Опитай отново от DroidDeck.</string>
|
||||
@@ -2231,6 +2272,8 @@
|
||||
<string name="adbpair_pairing">Чифтосване…</string>
|
||||
<string name="adbpair_code_rejected">Този код не работи. Отвори отново изскачащия прозорец за чифтосване и въведи новия му код.</string>
|
||||
<string name="adbpair_connecting">Чифтосано. Свързване…</string>
|
||||
<string name="adbpair_port_not_found">Чифтосано, но портът за безжично отстраняване на грешки не беше намерен. Остави безжичното отстраняване на грешки включено и опитай отново.</string>
|
||||
<string name="adbpair_applying">Прилагане на настройката…</string>
|
||||
<string name="adbpair_command_failed">Командата за безжично отстраняване на грешки се провали</string>
|
||||
<string name="adbpair_channel_name">Настройка на безжично отстраняване на грешки</string>
|
||||
<string name="adbpair_progress_channel_name">Напредък на настройката на безжичното отстраняване на грешки</string>
|
||||
@@ -2243,6 +2286,9 @@
|
||||
<string name="adbpair_title_code">Въведи кода за чифтосване по Wi-Fi</string>
|
||||
<string name="adbpair_title_retry">Опитай кода отново</string>
|
||||
<string name="adbpair_enter_code">Въвеждане на код</string>
|
||||
<string name="adbpair_title_working">Настройка на Steam</string>
|
||||
<string name="adbpair_title_done">Steam е готов</string>
|
||||
<string name="adbpair_done_text">Докосни, за да се върнеш в DroidDeck. Вече можеш да изключиш безжичното отстраняване на грешки.</string>
|
||||
<string name="adbpair_title_failed">Настройката на безжичното отстраняване на грешки спря</string>
|
||||
<string name="selfinst_download_failed">Изтеглянето не успя</string>
|
||||
<string name="selfinst_size_mismatch">Размерът на изтеглянето не съответстваше на публикуваното APK и беше отхвърлен - опитай отново</string>
|
||||
@@ -2392,6 +2438,16 @@
|
||||
<string name="hdr_none">този екран не отчита поддръжка на HDR</string>
|
||||
<string name="hdr_not_hdr10">този екран поддържа %1$s, не HDR10</string>
|
||||
<string name="gpu_this_gpu">този GPU</string>
|
||||
<string name="phantom_title_on">Ограничението за дъщерни процеси е включено</string>
|
||||
<string name="phantom_title_unset">Ограничението за дъщерни процеси не е зададено</string>
|
||||
<string name="phantom_title_unreadable">Ограничението за дъщерни процеси не можа да бъде проверено</string>
|
||||
<string name="phantom_title_off">Ограничението за дъщерни процеси е изключено</string>
|
||||
<string name="phantom_title_not_required">Ограничението за дъщерни процеси не е необходимо</string>
|
||||
<string name="phantom_instructions_fix">%1$s Ако това не е възможно, свържи устройството с компютър с ADB и изпълни командата отдолу. Върни се тук и провери отново.</string>
|
||||
<string name="phantom_instructions_off">Сесиите на Steam могат да стартират.</string>
|
||||
<string name="phantom_instructions_not_applicable">Тази версия на Android не използва това ограничение.</string>
|
||||
<string name="phantom_fix_toggle">Включи „Деактивиране на ограниченията за дъщерните процеси“ в Опции за програмисти и остави Опции за програмисти включени след това.</string>
|
||||
<string name="phantom_fix_no_toggle">Тази версия на Android няма превключвател за това. Използвай безжично отстраняване на грешки, за да го промениш от това устройство.</string>
|
||||
<string name="upd_block_no_apk">Тази версия няма изтегляне за това копие на DroidDeck.</string>
|
||||
<string name="upd_block_version_code">Android няма да я инсталира върху тази версия, защото нейният versionCode %1$d е по-нисък от инсталираното %2$d.</string>
|
||||
<string name="upd_fail_downgrade">Android няма да инсталира по-стара версия върху по-нова. Остани на тази версия, докато каналът я настигне.</string>
|
||||
@@ -2420,12 +2476,14 @@
|
||||
<string name="gstore_volume_free">%1$s · %2$s свободни</string>
|
||||
<string name="mode_storage_auto_short">Автоматично</string>
|
||||
<string name="appupd_catalog_rejected">Каталогът с актуализации не премина проверките (%1$s)</string>
|
||||
<string name="main_adb_clip_label">Настройка на DroidDeck за дъщерни процеси</string>
|
||||
<string name="setup_signed_in_offline_unnamed">Вписан · офлайн режим</string>
|
||||
<string name="setup_signed_in_unnamed">Вписан</string>
|
||||
<string name="driver_tag_bundled">ВГРАДЕН</string>
|
||||
<string name="driver_tag_downloaded">ИЗТЕГЛЕН</string>
|
||||
<string name="driver_tag_imported">ИМПОРТИРАН</string>
|
||||
<string name="driver_tag_bundle">ANDROID + LINUX</string>
|
||||
<string name="phantom_warning">%1$s. %2$s\n\n%3$s</string>
|
||||
<string name="display_session">Екран на сесията</string>
|
||||
<string name="display_zero_copy">Представяне без копиране</string>
|
||||
<string name="display_resolution_landscape">Резолюция в пейзажен режим</string>
|
||||
@@ -2856,6 +2914,7 @@
|
||||
<string name="setup_ready">Готово за игра</string>
|
||||
<string name="setup_not_ready">Още не е готово за игра</string>
|
||||
<string name="setup_ready_runtime">среда %1$s</string>
|
||||
<string name="setup_ready_limit_off">ограничението за процеси е изключено</string>
|
||||
<string name="setup_ready_signed_in">вписан като %1$s</string>
|
||||
<string name="setup_needs_you">Когато нещо изисква действие</string>
|
||||
<string name="setup_group_look">Визия</string>
|
||||
@@ -4096,7 +4155,4 @@
|
||||
<string name="steam_store_linux_build">Тази игра инсталира версията си за Linux. Инсталирайте я от Steam.</string>
|
||||
<string name="game_zoom_title">Мащабиране на играта</string>
|
||||
<string name="game_zoom_hint">Регулирайте увеличението на играта от 100% до 300%</string>
|
||||
<string name="glasses_shortcut_group">Пряк път в играта</string>
|
||||
<string name="glasses_show_shortcut">Показване на прекия път за Smart Glasses</string>
|
||||
<string name="glasses_show_shortcut_hint">Показва плаващия бутон за Smart Glasses върху играта.</string>
|
||||
</resources>
|
||||
@@ -200,6 +200,7 @@
|
||||
<string name="app_fex_hint">FEX spouští programy pro x86 Linux na tomto zařízení ARM64. Automaticky ho použije, když je program sestaven pro x86.</string>
|
||||
<string name="app_fex_x86">%1$s přes FEX</string>
|
||||
<string name="app_fex_not_ready">Tento program je sestaven pro PC %1$s a běží přes FEX, který ještě není nastaven. Jednou spusťte přihlášený Steam: DroidDeck tím stáhne FEX a Steam Linux Runtime, který potřebuje, a pak se tento program otevře.</string>
|
||||
<string name="session_proot_missing">Proot od DroidDeck se nepodařilo stáhnout. Zkontrolujte připojení a zkuste to znovu. Relace nebyla spuštěna, protože záložní proot je na hraní příliš pomalý.</string>
|
||||
<string name="session_powervr_missing">Grafické prostředí PowerVR se nepodařilo stáhnout. Zkontrolujte připojení a zkuste to znovu.</string>
|
||||
<string name="session_graphics_runtime_failed">Grafické prostředí se nepodařilo připravit, a proto relace nebyla spuštěna.</string>
|
||||
<string name="session_game_environment_failed">Herní prostředí se nepodařilo nastavit, a proto relace nebyla spuštěna.</string>
|
||||
@@ -447,6 +448,7 @@
|
||||
<string name="libraries_rename">Přejmenovat</string>
|
||||
<string name="libraries_rename_title">Název knihovny</string>
|
||||
<string name="libraries_pick">Vyberte složku pro knihovnu</string>
|
||||
<string name="libraries_full">Nejvýše %1$d přidaných knihoven</string>
|
||||
<string name="libraries_overlap">Tato složka už je knihovnou nebo leží uvnitř jiné</string>
|
||||
<string name="libraries_missing">%1$s · není k dispozici</string>
|
||||
<string name="libraries_applies_next">Platí od další relace Steam</string>
|
||||
@@ -634,14 +636,21 @@
|
||||
<string name="perf_fsync_hint">Spouští vlastní fsync Protonu na původních souborech Protonu, s futex_waitv dodaným v uživatelském prostoru, takže nepotřebuje balíček a funguje i hned po aktualizaci Protonu Steamem. Když je zapnuto, hry ho používají před droiddeck-esync, kromě těch pár, které Proton u fsync nechává vypnuté. Použije se od příští relace.</string>
|
||||
<string name="perf_esync_hint">Vlákna Windows her na sebe čekají přes eventfd a sdílenou paměť místo zpráv přes wineserver. Používá balíček droiddeck-esync vytvořený přesně pro dané sestavení Protonu; balíčky se stahují automaticky. Dokud pro nové sestavení Protonu žádný neexistuje, zastupuje ho droiddeck-fsync. Použije se od příští relace.</string>
|
||||
<string name="perf_xalia_hint">Vypne pomocníka Protonu pro navigaci gamepadem, který stojí výkon CPU v každé hře.</string>
|
||||
<string name="perf_seccomp">Spustit proot bez seccomp</string>
|
||||
<string name="perf_seccomp_hint">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.</string>
|
||||
<string name="perf_native_userland">Spustit bez proot (experimentální)</string>
|
||||
<string name="perf_native_userland_hint">Spustí linuxovou část přímo na Androidu. Platí pro další relaci. Vypněte, pokud se něco nespustí.</string>
|
||||
<string name="perf_fastpath">Rychlá cesta proot</string>
|
||||
<string name="perf_fastpath_needs_proot">Bez proot se nepoužije.</string>
|
||||
<string name="perf_fastpath_needs_seccomp">Vyžaduje filtr seccomp od proot.</string>
|
||||
<string name="perf_fastpath_hint">Rychlejší vyhledávání souborů a méně zadrhávání. Vypněte, pokud program nemůže najít své soubory.</string>
|
||||
<string name="perf_cursor_composite">Kreslit kurzor v gamescope</string>
|
||||
<string name="perf_cursor_composite_hint">Gamescope kreslí ukazatel sám, místo aby ho předal Androidu. Zapněte pro kurzor ovládaný ovladačem. Vypnuto je na telefonu rychlejší. Použije se od příští relace.</string>
|
||||
<string name="perf_identity">Identita relace</string>
|
||||
<string name="perf_hostname">Název hostitele</string>
|
||||
<string name="perf_hostname_hint">Název, který Steam vidí pro toto zařízení. Prázdné obnoví %1$s.</string>
|
||||
<string name="perf_hostname_invalid">Pouze písmena, číslice a vnitřní pomlčky, až 63 znaků.</string>
|
||||
<string name="perf_desktop_as_user">Plocha běží jako uživatel</string>
|
||||
<string name="perf_desktop_as_user_hint">Plocha, její aplikace a terminály běží jako běžný uživatel deck místo root, kvůli aplikacím, které root odmítají. sudo dál funguje. Projeví se u příští plochy.</string>
|
||||
<string name="perf_phantom_warning">Android je nastaven tak, aby tuto relaci ukončil</string>
|
||||
<string name="driver_installed">Nainstalováno</string>
|
||||
<string name="driver_available">K dispozici ke stažení</string>
|
||||
<string name="driver_nothing_new">Od poslední kontroly nic nového.</string>
|
||||
@@ -834,6 +843,7 @@
|
||||
<string name="setup_check_done">Hotovo</string>
|
||||
<string name="setup_check_warn">Vyžaduje pozornost</string>
|
||||
<string name="setup_check_busy">Zpracovává se</string>
|
||||
<string name="setup_limit_adb_failed">Zkontrolujte IP adresu a port pro Bezdrátové ladění, nebo zařízení znovu spárujte, pokud ho Android odstranil.</string>
|
||||
<string name="setup_install">Instalovat</string>
|
||||
<string name="setup_manage">Správa</string>
|
||||
<string name="setup_tab_overview">Přehled</string>
|
||||
@@ -857,10 +867,16 @@
|
||||
<string name="setup_installed">Nainstalováno</string>
|
||||
<string name="setup_runtime_update">%1$s · dostupná aktualizace</string>
|
||||
<string name="setup_runtime_current">%1$s · aktuální</string>
|
||||
<string name="setup_limit">Limit podprocesů</string>
|
||||
<string name="setup_limit_on">Zapnuto · Android může Steam zavřít. Vypnutí trvá minutu.</string>
|
||||
<string name="setup_limit_unset">Nenastaveno · Android může Steam zavřít. Vypnutí trvá minutu.</string>
|
||||
<string name="setup_limit_unknown">Nelze zkontrolovat · vypnutí trvá minutu.</string>
|
||||
<string name="setup_fix_it">Opravit</string>
|
||||
<string name="setup_details">Podrobnosti</string>
|
||||
<string name="setup_dev_options">Možnosti pro vývojáře</string>
|
||||
<string name="setup_use_wireless">Použít Bezdrátové ladění</string>
|
||||
<string name="setup_check_again">Zkontrolovat znovu</string>
|
||||
<string name="setup_limit_turn_on">Zapnout limit</string>
|
||||
<string name="setup_account">Účet Steam</string>
|
||||
<string name="setup_signed_in_offline">Přihlášen jako %1$s · režim offline</string>
|
||||
<string name="setup_signed_in">Přihlášen jako %1$s</string>
|
||||
@@ -1272,14 +1288,35 @@
|
||||
<item quantity="many">Nedávné změny · %1$d sestav</item>
|
||||
<item quantity="other">Nedávné změny · %1$d sestav</item>
|
||||
</plurals>
|
||||
<string name="gate_title">Je třeba změnit jedno nastavení Androidu</string>
|
||||
<string name="gate_eyebrow">Steam</string>
|
||||
<string name="gate_lede">Android zastavuje aplikace, které spouštějí mnoho procesů na pozadí, a Steam jich spouští desítky. Dokud se to nezmění, hry se zavírají bez chybové zprávy.</string>
|
||||
<string name="gate_fix_for_me">Oprav to za mě</string>
|
||||
<string name="gate_toggle_steps">Zapněte „Deaktivace omezení podřízených procesů“ a vraťte se zpět. Nechte Možnosti pro vývojáře zapnuté, jinak se přepínač znovu vypne.</string>
|
||||
<string name="gate_open_dev">Otevřít Možnosti pro vývojáře</string>
|
||||
<string name="gate_no_toggle">Tato verze Androidu pro to nemá přepínač, proto to DroidDeck změní přes Bezdrátové ladění. Zabere to asi minutu, počítač není potřeba.</string>
|
||||
<string name="gate_needs_wifi">Bezdrátové ladění potřebuje Wi-Fi. Funguje jakákoli síť, internet není nutný.</string>
|
||||
<string name="gate_step1">Otevřete Nastavení → Možnosti pro vývojáře → Bezdrátové ladění a zapněte ho</string>
|
||||
<string name="gate_step2">Klepněte na „Spárovat zařízení pomocí párovacího kódu“</string>
|
||||
<string name="gate_step3">Zadejte kód do oznámení DroidDecku</string>
|
||||
<string name="pairguide_build_number">V části O telefonu klepněte 7krát na Číslo sestavení</string>
|
||||
<string name="pairguide_wireless">Zapněte Bezdrátové ladění</string>
|
||||
<string name="pairguide_pair">Otevřete Bezdrátové ladění a klepněte na „Spárovat zařízení pomocí párovacího kódu“</string>
|
||||
<string name="pairguide_child_process">Zapněte „Deaktivace omezení podřízených procesů“</string>
|
||||
<string name="pairguide_row_child_process">Deaktivace omezení podřízených procesů</string>
|
||||
<string name="pairguide_row_build_number">Číslo sestavení</string>
|
||||
<string name="pairguide_row_wireless">Bezdrátové ladění</string>
|
||||
<string name="pairguide_row_pair">Spárovat zařízení pomocí párovacího kódu</string>
|
||||
<string name="gate_waiting">Čekání na párovací okno…</string>
|
||||
<string name="gate_code_needed">Okno nalezeno. Zadejte jeho kód do oznámení.</string>
|
||||
<string name="gate_status">Stav</string>
|
||||
<string name="gate_polling">Kontroluje se každé 2 sekundy. Tato stránka se zavře, až bude vypnuto.</string>
|
||||
<string name="gate_other_ways">Jiné způsoby</string>
|
||||
<string name="gate_use_wireless_instead">Použít místo toho Bezdrátové ladění</string>
|
||||
<string name="gate_some_roms">Některé ROM přepínač přidávají i tak. Hledejte v Možnostech pro vývojáře „child process“.</string>
|
||||
<string name="gate_from_computer">Z počítače s ADB:</string>
|
||||
<string name="gate_copy_command">Kopírovat příkaz</string>
|
||||
<string name="gate_sidequest_steps">Připojte headset k počítači a otevřete SideQuest. Zvolte „Run ADB Command“, pak „Custom Command“, opište příkaz zobrazený níže a vyberte „Run Command“.</string>
|
||||
<string name="gate_choose_display">Vyberte, na kterém displeji se má otevřít Nastavení Androidu.</string>
|
||||
<string name="gate_main_screen">Hlavní obrazovka</string>
|
||||
<string name="ctrl_color">Barva</string>
|
||||
@@ -1736,6 +1773,12 @@
|
||||
<string name="session_ended_desktop">Plocha neočekávaně skončila. Přiložte logy k hlášení chyby, nebo zkuste znovu.</string>
|
||||
<string name="session_ended_detail">Návratový kód %1$d · %2$s</string>
|
||||
<string name="session_ended_no_log">žádný log</string>
|
||||
<plurals name="session_hint_enosys">
|
||||
<item quantity="one">V logu je %1$d chyba „Function not implemented“: akcelerace seccomp v proot zde selhává u pomocné funkce na tomto zařízení. Zkuste %2$s → „%3$s“ (nebo „%4$s“) a spusťte to znovu.</item>
|
||||
<item quantity="few">V logu jsou %1$d chyby „Function not implemented“: akcelerace seccomp v proot zde selhává u pomocné funkce na tomto zařízení. Zkuste %2$s → „%3$s“ (nebo „%4$s“) a spusťte to znovu.</item>
|
||||
<item quantity="many">V logu je %1$d chyb „Function not implemented“: akcelerace seccomp v proot zde selhává u pomocné funkce na tomto zařízení. Zkuste %2$s → „%3$s“ (nebo „%4$s“) a spusťte to znovu.</item>
|
||||
<item quantity="other">V logu je %1$d chyb „Function not implemented“: akcelerace seccomp v proot zde selhává u pomocné funkce na tomto zařízení. Zkuste %2$s → „%3$s“ (nebo „%4$s“) a spusťte to znovu.</item>
|
||||
</plurals>
|
||||
<string name="mode_decky_plugins">Pluginy</string>
|
||||
<string name="mode_decky_plugins_hint">Nainstalujte ZIP s pluginem pro další relaci Steamu.</string>
|
||||
<string name="mode_decky_plugin_downloading">Stahování…</string>
|
||||
@@ -2143,7 +2186,6 @@
|
||||
<string name="bottom_qam_layout_left">Vlevo</string>
|
||||
<string name="bottom_qam_layout_center">Na střed</string>
|
||||
<string name="bottom_qam_layout_right">Vpravo</string>
|
||||
<string name="bottom_qam_layout_split">Rozděleno</string>
|
||||
<string name="bottom_qam_unavailable">Nabídka rychlého přístupu Steamu zatím není k dispozici.</string>
|
||||
<string name="bottom_page_telemetry">Statistiky ve hře</string>
|
||||
<string name="bottom_hud_group">HUD na spodní obrazovce</string>
|
||||
@@ -2272,6 +2314,7 @@
|
||||
<string name="deckymgr_restore_failed">Nepodařilo se obnovit stávající plugin</string>
|
||||
<string name="adbfix_save_failed">Nepodařilo se uložit identitu bezdrátového ladění</string>
|
||||
<string name="adbfix_command_failed">Příkaz ADB se nezdařil (%1$d)</string>
|
||||
<string name="adbfix_not_confirmed">Android nepotvrdil změnu limitu procesů potomků: %1$s</string>
|
||||
<string name="adbfix_no_pairing">Není uloženo žádné párování bezdrátového ladění</string>
|
||||
<string name="adbfix_enter_address">Zadejte aktuální IP adresu a port bezdrátového ladění</string>
|
||||
<string name="adbpair_timed_out">Čekání na vyskakovací okno pro párování vypršelo. Zkuste to znovu z DroidDecku.</string>
|
||||
@@ -2281,6 +2324,8 @@
|
||||
<string name="adbpair_pairing">Párování…</string>
|
||||
<string name="adbpair_code_rejected">Tento kód nefungoval. Otevřete znovu vyskakovací okno pro párování a zadejte jeho nový kód.</string>
|
||||
<string name="adbpair_connecting">Zpárováno. Připojování…</string>
|
||||
<string name="adbpair_port_not_found">Zpárováno, ale port bezdrátového ladění nebyl nalezen. Ponechte bezdrátové ladění zapnuté a zkuste to znovu.</string>
|
||||
<string name="adbpair_applying">Použití nastavení…</string>
|
||||
<string name="adbpair_command_failed">Příkaz bezdrátového ladění se nezdařil</string>
|
||||
<string name="adbpair_channel_name">Nastavení bezdrátového ladění</string>
|
||||
<string name="adbpair_progress_channel_name">Průběh nastavení bezdrátového ladění</string>
|
||||
@@ -2293,6 +2338,9 @@
|
||||
<string name="adbpair_title_code">Zadejte párovací kód Wi-Fi</string>
|
||||
<string name="adbpair_title_retry">Zkusit kód znovu</string>
|
||||
<string name="adbpair_enter_code">Zadat kód</string>
|
||||
<string name="adbpair_title_working">Nastavování Steamu</string>
|
||||
<string name="adbpair_title_done">Steam je připraven</string>
|
||||
<string name="adbpair_done_text">Klepnutím se vrátíte do DroidDecku. Bezdrátové ladění teď můžete vypnout.</string>
|
||||
<string name="adbpair_title_failed">Nastavení bezdrátového ladění bylo zastaveno</string>
|
||||
<string name="selfinst_download_failed">Stahování selhalo</string>
|
||||
<string name="selfinst_size_mismatch">Velikost stahování neodpovídala zveřejněnému APK a bylo zahozeno - zkuste to znovu</string>
|
||||
@@ -2442,6 +2490,16 @@
|
||||
<string name="hdr_none">tento displej neuvádí podporu HDR</string>
|
||||
<string name="hdr_not_hdr10">tento displej podporuje %1$s, ne HDR10</string>
|
||||
<string name="gpu_this_gpu">toto GPU</string>
|
||||
<string name="phantom_title_on">Limit procesů potomků je zapnutý</string>
|
||||
<string name="phantom_title_unset">Limit procesů potomků není nastavený</string>
|
||||
<string name="phantom_title_unreadable">Limit procesů potomků se nepodařilo zkontrolovat</string>
|
||||
<string name="phantom_title_off">Limit procesů potomků je vypnutý</string>
|
||||
<string name="phantom_title_not_required">Limit procesů potomků není vyžadován</string>
|
||||
<string name="phantom_instructions_fix">%1$s Pokud to není možné, připojte toto zařízení k počítači s ADB a spusťte příkaz níže. Vraťte se sem a zkontrolujte to znovu.</string>
|
||||
<string name="phantom_instructions_off">Relace Steamu se mohou spouštět.</string>
|
||||
<string name="phantom_instructions_not_applicable">Tato verze Androidu tento limit nepoužívá.</string>
|
||||
<string name="phantom_fix_toggle">Zapněte „Deaktivace omezení podřízených procesů“ v Možnostech pro vývojáře a pak je nechte zapnuté.</string>
|
||||
<string name="phantom_fix_no_toggle">Tato verze Androidu pro to nemá přepínač. Použijte bezdrátové ladění a změňte to z tohoto zařízení.</string>
|
||||
<string name="upd_block_no_apk">Toto sestavení nemá stažení pro tuto kopii DroidDecku.</string>
|
||||
<string name="upd_block_version_code">Android to nenainstaluje přes toto sestavení, protože jeho versionCode %1$d je nižší než nainstalovaný %2$d.</string>
|
||||
<string name="upd_fail_downgrade">Android nenainstaluje starší verzi přes novější. Zůstaňte na tomto sestavení, dokud kanál nedohoní.</string>
|
||||
@@ -2470,12 +2528,14 @@
|
||||
<string name="gstore_volume_free">%1$s · %2$s volných</string>
|
||||
<string name="mode_storage_auto_short">Automaticky</string>
|
||||
<string name="appupd_catalog_rejected">Katalog aktualizací neprošel kontrolou (%1$s)</string>
|
||||
<string name="main_adb_clip_label">Nastavení procesů potomků DroidDecku</string>
|
||||
<string name="setup_signed_in_offline_unnamed">Přihlášeno · offline režim</string>
|
||||
<string name="setup_signed_in_unnamed">Přihlášeno</string>
|
||||
<string name="driver_tag_bundled">PŘIBALENÝ</string>
|
||||
<string name="driver_tag_downloaded">STAŽENÝ</string>
|
||||
<string name="driver_tag_imported">IMPORTOVANÝ</string>
|
||||
<string name="driver_tag_bundle">ANDROID + LINUX</string>
|
||||
<string name="phantom_warning">%1$s. %2$s\n\n%3$s</string>
|
||||
<string name="display_session">Obrazovka relace</string>
|
||||
<string name="display_zero_copy">Zobrazení bez kopírování</string>
|
||||
<string name="display_resolution_landscape">Rozlišení na šířku</string>
|
||||
@@ -2910,6 +2970,7 @@
|
||||
<string name="setup_ready">Připraveno ke hraní</string>
|
||||
<string name="setup_not_ready">Ještě není připraveno ke hraní</string>
|
||||
<string name="setup_ready_runtime">runtime %1$s</string>
|
||||
<string name="setup_ready_limit_off">omezení procesů vypnuto</string>
|
||||
<string name="setup_ready_signed_in">přihlášen jako %1$s</string>
|
||||
<string name="setup_needs_you">Když je potřeba váš zásah</string>
|
||||
<string name="setup_group_look">Vzhled</string>
|
||||
@@ -4174,7 +4235,4 @@
|
||||
<string name="steam_store_linux_build">Tato hra instaluje svou verzi pro Linux. Nainstalujte ji ze Steamu.</string>
|
||||
<string name="game_zoom_title">Přiblížení hry</string>
|
||||
<string name="game_zoom_hint">Nastavte zvětšení hry od 100 % do 300 %</string>
|
||||
<string name="glasses_shortcut_group">Zkratka ve hře</string>
|
||||
<string name="glasses_show_shortcut">Zobrazit zkratku Smart Glasses</string>
|
||||
<string name="glasses_show_shortcut_hint">Zobrazit plovoucí tlačítko Smart Glasses nad hrou.</string>
|
||||
</resources>
|
||||
@@ -200,6 +200,7 @@
|
||||
<string name="app_fex_hint">FEX kører x86-Linux-programmer på denne ARM64-enhed. Auto bruger det, når programmet er bygget til x86.</string>
|
||||
<string name="app_fex_x86">%1$s via FEX</string>
|
||||
<string name="app_fex_not_ready">Dette program er bygget til %1$s-pc’er og køres via FEX, som ikke er sat op endnu. Åbn Steam én gang, mens du er logget ind: DroidDeck downloader så FEX og den Steam Linux Runtime, det kræver, hvorefter dette åbner.</string>
|
||||
<string name="session_proot_missing">DroidDecks proot kunne ikke downloades. Tjek forbindelsen, og prøv igen. Sessionen blev ikke startet, fordi reserve-proot er for langsom at spille på.</string>
|
||||
<string name="session_powervr_missing">PowerVR-grafikmiljøet kunne ikke hentes. Tjek forbindelsen, og prøv igen.</string>
|
||||
<string name="session_graphics_runtime_failed">Grafikmiljøet kunne ikke klargøres, så sessionen blev ikke startet.</string>
|
||||
<string name="session_game_environment_failed">Spilmiljøet kunne ikke sættes op, så sessionen blev ikke startet.</string>
|
||||
@@ -445,6 +446,7 @@
|
||||
<string name="libraries_rename">Omdøb</string>
|
||||
<string name="libraries_rename_title">Bibliotekets navn</string>
|
||||
<string name="libraries_pick">Vælg en mappe til biblioteket</string>
|
||||
<string name="libraries_full">Højst %1$d tilføjede biblioteker</string>
|
||||
<string name="libraries_overlap">Mappen er allerede et bibliotek eller ligger i et</string>
|
||||
<string name="libraries_missing">%1$s · ikke tilgængelig</string>
|
||||
<string name="libraries_applies_next">Gælder fra næste Steam-session</string>
|
||||
@@ -630,14 +632,21 @@
|
||||
<string name="perf_fsync_hint">Kører Protons egen fsync på de uændrede Proton-filer, med futex_waitv leveret i brugerrum, så det kræver ingen pack og fortsætter med at virke, lige så snart Steam opdaterer Proton. Mens den er til, bruger spil den før droiddeck-esync, undtagen de få, Proton holder uden for fsync. Gælder fra næste session.</string>
|
||||
<string name="perf_esync_hint">Spils Windows-tråde venter på hinanden via eventfd og delt hukommelse i stedet for ture gennem wineserver. Bruger en droiddeck-esync-pack lavet til netop denne Proton-build; packs hentes automatisk. Indtil der findes en til en ny Proton-build, dækker droiddeck-fsync i stedet. Gælder fra næste session.</string>
|
||||
<string name="perf_xalia_hint">Deaktiverer Protons gamepad-navigationshjælper, som koster CPU i hvert spil.</string>
|
||||
<string name="perf_seccomp">Kør proot uden seccomp</string>
|
||||
<string name="perf_seccomp_hint">Kan afhjælpe fejl om manglende systemkald på nogle kerner. Kan reducere ydelsen.</string>
|
||||
<string name="perf_native_userland">Kør uden proot (eksperimentelt)</string>
|
||||
<string name="perf_native_userland_hint">Starter Linux-delen direkte på Android. Gælder fra næste session. Slå fra, hvis noget ikke kan starte.</string>
|
||||
<string name="perf_fastpath">proot-hurtigvej</string>
|
||||
<string name="perf_fastpath_needs_proot">Bruges ikke uden proot.</string>
|
||||
<string name="perf_fastpath_needs_seccomp">Kræver prootets seccomp-filter.</string>
|
||||
<string name="perf_fastpath_hint">Hurtigere filopslag og mindre hak. Slå fra, hvis et program ikke kan finde sine filer.</string>
|
||||
<string name="perf_cursor_composite">Tegn markøren i gamescope</string>
|
||||
<string name="perf_cursor_composite_hint">Gamescope tegner selv markøren i stedet for at overlade den til Android. Slå til for en controllerstyret markør. Fra er hurtigere på en telefon. Gælder fra næste session.</string>
|
||||
<string name="perf_identity">Sessionsidentitet</string>
|
||||
<string name="perf_hostname">Værtsnavn</string>
|
||||
<string name="perf_hostname_hint">Navnet Steam ser for denne enhed. Tomt gendanner %1$s.</string>
|
||||
<string name="perf_hostname_invalid">Kun bogstaver, tal og bindestreger i midten, op til 63 tegn.</string>
|
||||
<string name="perf_desktop_as_user">Skrivebordet kører som bruger</string>
|
||||
<string name="perf_desktop_as_user_hint">Skrivebordet, dets apps og terminaler kører som den almindelige bruger deck i stedet for root, til apps der afviser root. sudo virker stadig. Gælder fra næste skrivebord.</string>
|
||||
<string name="perf_phantom_warning">Android er sat til at lukke denne session</string>
|
||||
<string name="driver_installed">Installeret</string>
|
||||
<string name="driver_available">Tilgængelig til download</string>
|
||||
<string name="driver_nothing_new">Intet nyt siden sidste kontrol.</string>
|
||||
@@ -828,6 +837,7 @@
|
||||
<string name="setup_check_done">Klar</string>
|
||||
<string name="setup_check_warn">Kræver handling</string>
|
||||
<string name="setup_check_busy">Arbejder</string>
|
||||
<string name="setup_limit_adb_failed">Kontroller IP-adressen og porten for Trådløs fejlretning, eller par igen, hvis Android har fjernet denne enhed.</string>
|
||||
<string name="setup_install">Installer</string>
|
||||
<string name="setup_manage">Administrer</string>
|
||||
<string name="setup_tab_overview">Oversigt</string>
|
||||
@@ -851,10 +861,16 @@
|
||||
<string name="setup_installed">Installeret</string>
|
||||
<string name="setup_runtime_update">%1$s · opdatering tilgængelig</string>
|
||||
<string name="setup_runtime_current">%1$s · opdateret</string>
|
||||
<string name="setup_limit">Grænse for underprocesser</string>
|
||||
<string name="setup_limit_on">Til · Android kan lukke Steam. Det tager et minut at slå den fra.</string>
|
||||
<string name="setup_limit_unset">Ikke angivet · Android kan lukke Steam. Det tager et minut at slå den fra.</string>
|
||||
<string name="setup_limit_unknown">Kunne ikke kontrolleres · det tager et minut at slå den fra.</string>
|
||||
<string name="setup_fix_it">Ret det</string>
|
||||
<string name="setup_details">Detaljer</string>
|
||||
<string name="setup_dev_options">Udviklerindstillinger</string>
|
||||
<string name="setup_use_wireless">Brug Trådløs fejlretning</string>
|
||||
<string name="setup_check_again">Kontroller igen</string>
|
||||
<string name="setup_limit_turn_on">Slå grænsen til</string>
|
||||
<string name="setup_account">Steam-konto</string>
|
||||
<string name="setup_signed_in_offline">Logget ind som %1$s · offlinetilstand</string>
|
||||
<string name="setup_signed_in">Logget ind som %1$s</string>
|
||||
@@ -1258,14 +1274,35 @@
|
||||
<item quantity="one">Seneste ændringer · %1$d build</item>
|
||||
<item quantity="other">Seneste ændringer · %1$d builds</item>
|
||||
</plurals>
|
||||
<string name="gate_title">Én Android-indstilling, der skal ændres</string>
|
||||
<string name="gate_eyebrow">Steam</string>
|
||||
<string name="gate_lede">Android lukker apps, der starter mange baggrundsprocesser, og Steam starter dusinvis. Indtil dette ændres, lukker spil uden en fejlmeddelelse.</string>
|
||||
<string name="gate_fix_for_me">Ret det for mig</string>
|
||||
<string name="gate_toggle_steps">Slå “Deaktiver begrænsningerne for underprocesser” til, og kom så tilbage. Lad Udviklerindstillinger stå til, ellers slås kontakten fra igen.</string>
|
||||
<string name="gate_open_dev">Åbn Udviklerindstillinger</string>
|
||||
<string name="gate_no_toggle">Denne Android-version har ingen kontakt til det, så DroidDeck ændrer det via Trådløs fejlretning. Tager omkring et minut, ingen computer nødvendig.</string>
|
||||
<string name="gate_needs_wifi">Trådløs fejlretning kræver Wi-Fi. Alle netværk fungerer; det kræver ikke internet.</string>
|
||||
<string name="gate_step1">Åbn Indstillinger → Udviklerindstillinger → Trådløs fejlretning, og slå den til</string>
|
||||
<string name="gate_step2">Tryk på “Par enhed med parringskode”</string>
|
||||
<string name="gate_step3">Indtast koden i DroidDeck-notifikationen</string>
|
||||
<string name="pairguide_build_number">Tryk 7 gange på Buildnummer under Om telefonen</string>
|
||||
<string name="pairguide_wireless">Slå Trådløs fejlretning til</string>
|
||||
<string name="pairguide_pair">Åbn Trådløs fejlretning, og tryk på “Par enhed med parringskode”</string>
|
||||
<string name="pairguide_child_process">Slå “Deaktiver begrænsningerne for underprocesser” til</string>
|
||||
<string name="pairguide_row_child_process">Deaktiver begrænsningerne for underprocesser</string>
|
||||
<string name="pairguide_row_build_number">Buildnummer</string>
|
||||
<string name="pairguide_row_wireless">Trådløs fejlretning</string>
|
||||
<string name="pairguide_row_pair">Par enhed med parringskode</string>
|
||||
<string name="gate_waiting">Venter på parringsvinduet…</string>
|
||||
<string name="gate_code_needed">Vindue fundet. Indtast dets kode i notifikationen.</string>
|
||||
<string name="gate_status">Status</string>
|
||||
<string name="gate_polling">Kontrollerer hvert 2. sekund. Denne side lukker, når den er fra.</string>
|
||||
<string name="gate_other_ways">Andre måder</string>
|
||||
<string name="gate_use_wireless_instead">Brug Trådløs fejlretning i stedet</string>
|
||||
<string name="gate_some_roms">Nogle ROM’er tilføjer kontakten alligevel. Kig efter “underprocesser” i Udviklerindstillinger.</string>
|
||||
<string name="gate_from_computer">Fra en computer med ADB:</string>
|
||||
<string name="gate_copy_command">Kopier kommando</string>
|
||||
<string name="gate_sidequest_steps">Slut headsettet til en computer, og åbn SideQuest. Vælg “Run ADB Command” og derefter “Custom Command”, skriv kommandoen vist nedenfor, og vælg “Run Command”.</string>
|
||||
<string name="gate_choose_display">Vælg, hvilken skærm Android-indstillinger skal åbnes på.</string>
|
||||
<string name="gate_main_screen">Hovedskærm</string>
|
||||
<string name="ctrl_color">Farve</string>
|
||||
@@ -1702,6 +1739,10 @@
|
||||
<string name="session_ended_desktop">Skrivebordet stoppede uventet. Del logs med en fejlrapport, eller prøv igen.</string>
|
||||
<string name="session_ended_detail">Afslutningsstatus %1$d · %2$s</string>
|
||||
<string name="session_ended_no_log">ingen log</string>
|
||||
<plurals name="session_hint_enosys">
|
||||
<item quantity="one">Loggen viser %1$d \"Function not implemented\"-fejl: proots seccomp-acceleration fejler i en hjælpeproces på denne enhed. Prøv %2$s → \"%3$s\" (eller \"%4$s\"), og start igen.</item>
|
||||
<item quantity="other">Loggen viser %1$d \"Function not implemented\"-fejl: proots seccomp-acceleration fejler i en hjælpeproces på denne enhed. Prøv %2$s → \"%3$s\" (eller \"%4$s\"), og start igen.</item>
|
||||
</plurals>
|
||||
<string name="mode_decky_plugins">Plugins</string>
|
||||
<string name="mode_decky_plugins_hint">Installer en plugin-ZIP til den næste Steam-session.</string>
|
||||
<string name="mode_decky_plugin_downloading">Downloader…</string>
|
||||
@@ -2095,7 +2136,6 @@
|
||||
<string name="bottom_qam_layout_left">Venstre</string>
|
||||
<string name="bottom_qam_layout_center">Midte</string>
|
||||
<string name="bottom_qam_layout_right">Højre</string>
|
||||
<string name="bottom_qam_layout_split">Delt</string>
|
||||
<string name="bottom_qam_unavailable">Steams menu til hurtig adgang er ikke tilgængelig endnu.</string>
|
||||
<string name="bottom_page_telemetry">Statistik i spillet</string>
|
||||
<string name="bottom_hud_group">HUD på nederste skærm</string>
|
||||
@@ -2222,6 +2262,7 @@
|
||||
<string name="deckymgr_restore_failed">Kunne ikke gendanne det eksisterende plugin</string>
|
||||
<string name="adbfix_save_failed">Kunne ikke gemme identitet til Trådløs fejlretning</string>
|
||||
<string name="adbfix_command_failed">ADB-kommando mislykkedes (%1$d)</string>
|
||||
<string name="adbfix_not_confirmed">Android bekræftede ikke, at procesgrænsen blev ændret: %1$s</string>
|
||||
<string name="adbfix_no_pairing">Ingen parring for Trådløs fejlretning er gemt</string>
|
||||
<string name="adbfix_enter_address">Indtast den aktuelle IP-adresse og port for Trådløs fejlretning</string>
|
||||
<string name="adbpair_timed_out">Der opstod timeout under venten på parringsvinduet. Forsøg igen fra DroidDeck.</string>
|
||||
@@ -2231,6 +2272,8 @@
|
||||
<string name="adbpair_pairing">Parrer…</string>
|
||||
<string name="adbpair_code_rejected">Den kode virkede ikke. Åbn parringsvinduet igen, og indtast dens nye kode.</string>
|
||||
<string name="adbpair_connecting">Parret. Forbinder…</string>
|
||||
<string name="adbpair_port_not_found">Parret, men porten til Trådløs fejlretning blev ikke fundet. Lad Trådløs fejlretning være tændt, og forsøg igen.</string>
|
||||
<string name="adbpair_applying">Anvender indstillingen…</string>
|
||||
<string name="adbpair_command_failed">Kommando til Trådløs fejlretning mislykkedes</string>
|
||||
<string name="adbpair_channel_name">Opsætning af Trådløs fejlretning</string>
|
||||
<string name="adbpair_progress_channel_name">Status for opsætning af trådløs fejlretning</string>
|
||||
@@ -2243,6 +2286,9 @@
|
||||
<string name="adbpair_title_code">Indtast Wi-Fi-parringskoden</string>
|
||||
<string name="adbpair_title_retry">Forsøg koden igen</string>
|
||||
<string name="adbpair_enter_code">Indtast kode</string>
|
||||
<string name="adbpair_title_working">Sætter Steam op</string>
|
||||
<string name="adbpair_title_done">Steam er klar</string>
|
||||
<string name="adbpair_done_text">Tryk for at gå tilbage til DroidDeck. Du kan slukke Trådløs fejlretning nu.</string>
|
||||
<string name="adbpair_title_failed">Opsætning af Trådløs fejlretning stoppet</string>
|
||||
<string name="selfinst_download_failed">Hentningen mislykkedes</string>
|
||||
<string name="selfinst_size_mismatch">Downloadets størrelse passede ikke med den udgivne APK og blev kasseret - forsøg igen</string>
|
||||
@@ -2392,6 +2438,16 @@
|
||||
<string name="hdr_none">denne skærm rapporterer ingen HDR-understøttelse</string>
|
||||
<string name="hdr_not_hdr10">denne skærm understøtter %1$s, ikke HDR10</string>
|
||||
<string name="gpu_this_gpu">denne GPU</string>
|
||||
<string name="phantom_title_on">Procesgrænse er tændt</string>
|
||||
<string name="phantom_title_unset">Procesgrænse er ikke sat</string>
|
||||
<string name="phantom_title_unreadable">Procesgrænse kunne ikke tjekkes</string>
|
||||
<string name="phantom_title_off">Procesgrænse er slået fra</string>
|
||||
<string name="phantom_title_not_required">Procesgrænse er ikke nødvendig</string>
|
||||
<string name="phantom_instructions_fix">%1$s Hvis det ikke er muligt, så forbind enheden til en computer med ADB, og køre kommandoen nedenfor. Kom tilbage hertil, og tjek igen.</string>
|
||||
<string name="phantom_instructions_off">Steam-sessioner kan starte.</string>
|
||||
<string name="phantom_instructions_not_applicable">Denne Android-version bruger ikke denne grænse.</string>
|
||||
<string name="phantom_fix_toggle">Tænd „Deaktiver begrænsningerne for underprocesser“ i Udvikleremuligheder, og lad Udvikleremuligheder være tændt bagefter.</string>
|
||||
<string name="phantom_fix_no_toggle">Denne Android-version har ingen kontakt til det. Brug Trådløs fejlretning til at ændre det fra denne enhed.</string>
|
||||
<string name="upd_block_no_apk">Denne version har ingen download til denne kopi af DroidDeck.</string>
|
||||
<string name="upd_block_version_code">Android installerer den ikke over denne version, fordi dens versionCode %1$d er under den installerede %2$d.</string>
|
||||
<string name="upd_fail_downgrade">Android installerer ikke en ældre version over en nyere. Bliv på denne version, indtil kanalen følger efter.</string>
|
||||
@@ -2420,12 +2476,14 @@
|
||||
<string name="gstore_volume_free">%1$s · %2$s fri</string>
|
||||
<string name="mode_storage_auto_short">Automatisk</string>
|
||||
<string name="appupd_catalog_rejected">Opdateringskataloget bestod ikke sine kontroller (%1$s)</string>
|
||||
<string name="main_adb_clip_label">DroidDeck-indstilling for procesgrænse</string>
|
||||
<string name="setup_signed_in_offline_unnamed">Logget ind · offline-tilstand</string>
|
||||
<string name="setup_signed_in_unnamed">Logget ind</string>
|
||||
<string name="driver_tag_bundled">INDBYGGET</string>
|
||||
<string name="driver_tag_downloaded">DOWNLOADET</string>
|
||||
<string name="driver_tag_imported">IMPORTERET</string>
|
||||
<string name="driver_tag_bundle">ANDROID + LINUX</string>
|
||||
<string name="phantom_warning">%1$s. %2$s\n\n%3$s</string>
|
||||
<string name="display_session">Sessionsskærm</string>
|
||||
<string name="display_zero_copy">Præsentation uden kopiering</string>
|
||||
<string name="display_resolution_landscape">Opløsning i landskab</string>
|
||||
@@ -2856,6 +2914,7 @@
|
||||
<string name="setup_ready">Klar til at spille</string>
|
||||
<string name="setup_not_ready">Ikke klar til at spille endnu</string>
|
||||
<string name="setup_ready_runtime">runtime %1$s</string>
|
||||
<string name="setup_ready_limit_off">procesgrænse fra</string>
|
||||
<string name="setup_ready_signed_in">logget ind som %1$s</string>
|
||||
<string name="setup_needs_you">Når noget kræver dig</string>
|
||||
<string name="setup_group_look">Udseende</string>
|
||||
@@ -4096,7 +4155,4 @@
|
||||
<string name="steam_store_linux_build">Dette spil installerer sin Linux-version. Installer det fra Steam.</string>
|
||||
<string name="game_zoom_title">Spilzoom</string>
|
||||
<string name="game_zoom_hint">Juster spillets forstørrelse fra 100 % til 300 %</string>
|
||||
<string name="glasses_shortcut_group">Genvej i spillet</string>
|
||||
<string name="glasses_show_shortcut">Vis Smart Glasses-genvej</string>
|
||||
<string name="glasses_show_shortcut_hint">Vis den flydende Smart Glasses-knap oven på spillet.</string>
|
||||
</resources>
|
||||
@@ -200,6 +200,7 @@
|
||||
<string name="app_fex_hint">FEX führt x86-Linux-Programme auf diesem ARM64-Gerät aus. Auto nutzt es, wenn das Programm für x86 gebaut ist.</string>
|
||||
<string name="app_fex_x86">%1$s über FEX</string>
|
||||
<string name="app_fex_not_ready">Dieses Programm ist für %1$s-PCs gebaut und läuft über FEX, das noch nicht eingerichtet ist. Öffne Steam einmal, während du angemeldet bist: DroidDeck lässt es FEX und die nötige Steam Linux Runtime herunterladen, danach lässt sich das Programm öffnen.</string>
|
||||
<string name="session_proot_missing">DroidDecks proot konnte nicht heruntergeladen werden. Prüfe die Verbindung und versuch es erneut. Die Sitzung wurde nicht gestartet, da das Ersatz-proot zum Spielen zu langsam ist.</string>
|
||||
<string name="session_powervr_missing">Die PowerVR-Grafikumgebung konnte nicht heruntergeladen werden. Prüfe die Verbindung und versuch es erneut.</string>
|
||||
<string name="session_graphics_runtime_failed">Die Grafikumgebung konnte nicht vorbereitet werden, daher wurde die Sitzung nicht gestartet.</string>
|
||||
<string name="session_game_environment_failed">Die Spielumgebung konnte nicht eingerichtet werden, daher wurde die Sitzung nicht gestartet.</string>
|
||||
@@ -445,6 +446,7 @@
|
||||
<string name="libraries_rename">Umbenennen</string>
|
||||
<string name="libraries_rename_title">Bibliotheksname</string>
|
||||
<string name="libraries_pick">Ordner für die Bibliothek auswählen</string>
|
||||
<string name="libraries_full">Höchstens %1$d hinzugefügte Bibliotheken</string>
|
||||
<string name="libraries_overlap">Dieser Ordner ist bereits eine Bibliothek oder liegt innerhalb einer</string>
|
||||
<string name="libraries_missing">%1$s · nicht verfügbar</string>
|
||||
<string name="libraries_applies_next">Gilt ab der nächsten Steam-Sitzung</string>
|
||||
@@ -630,14 +632,21 @@
|
||||
<string name="perf_fsync_hint">Führt Protons eigenes fsync mit den unveränderten Proton-Dateien aus, wobei futex_waitv im Userspace bereitgestellt wird. Es braucht daher kein Pack und funktioniert weiter, sobald Steam Proton aktualisiert. Solange es aktiv ist, nutzen Spiele es vor droiddeck-esync, außer den wenigen, die Proton von fsync fernhält. Gilt ab der nächsten Sitzung.</string>
|
||||
<string name="perf_esync_hint">Die Windows-Threads von Spielen warten über eventfd und gemeinsamen Speicher aufeinander statt über Umwege durch wineserver. Nutzt ein droiddeck-esync-Pack, das für genau diesen Proton-Build erstellt wurde; Packs werden automatisch geladen. Bis es eines für einen neuen Proton-Build gibt, springt droiddeck-fsync ein. Gilt ab der nächsten Sitzung.</string>
|
||||
<string name="perf_xalia_hint">Deaktiviert Protons Gamepad-Navigationshilfe, die in jedem Spiel CPU-Leistung kostet.</string>
|
||||
<string name="perf_seccomp">proot ohne seccomp ausführen</string>
|
||||
<string name="perf_seccomp_hint">Kann Fehler wegen fehlender Syscalls auf manchen Kerneln beheben. Kann die Leistung mindern.</string>
|
||||
<string name="perf_native_userland">Ohne proot ausführen (experimentell)</string>
|
||||
<string name="perf_native_userland_hint">Startet die Linux-Umgebung direkt unter Android. Gilt ab der nächsten Sitzung. Bei Startproblemen deaktivieren.</string>
|
||||
<string name="perf_fastpath">proot-Schnellpfad</string>
|
||||
<string name="perf_fastpath_needs_proot">Wird ohne proot nicht verwendet.</string>
|
||||
<string name="perf_fastpath_needs_seccomp">Benötigt den seccomp-Filter von proot.</string>
|
||||
<string name="perf_fastpath_hint">Schnellere Dateisuche und weniger Ruckler. Deaktivieren, wenn ein Programm seine Dateien nicht findet.</string>
|
||||
<string name="perf_cursor_composite">Zeiger in gamescope zeichnen</string>
|
||||
<string name="perf_cursor_composite_hint">Gamescope zeichnet den Zeiger selbst, statt ihn an Android zu übergeben. Für einen per Controller gesteuerten Zeiger einschalten. Aus ist auf einem Smartphone schneller. Gilt ab der nächsten Sitzung.</string>
|
||||
<string name="perf_identity">Sitzungsidentität</string>
|
||||
<string name="perf_hostname">Hostname</string>
|
||||
<string name="perf_hostname_hint">Der Name, den Steam für dieses Gerät sieht. Leer lassen stellt %1$s wieder her.</string>
|
||||
<string name="perf_hostname_invalid">Nur Buchstaben, Ziffern und innere Bindestriche, bis zu 63 Zeichen.</string>
|
||||
<string name="perf_desktop_as_user">Desktop läuft als Benutzer</string>
|
||||
<string name="perf_desktop_as_user_hint">Der Desktop, seine Apps und Terminals laufen als normaler Benutzer deck statt als root, für Apps, die root ablehnen. sudo funktioniert weiterhin. Gilt ab dem nächsten Desktop.</string>
|
||||
<string name="perf_phantom_warning">Android ist so eingestellt, dass es diese Sitzung beendet</string>
|
||||
<string name="driver_installed">Installiert</string>
|
||||
<string name="driver_available">Zum Download verfügbar</string>
|
||||
<string name="driver_nothing_new">Nichts Neues seit der letzten Prüfung.</string>
|
||||
@@ -828,6 +837,7 @@
|
||||
<string name="setup_check_done">Fertig</string>
|
||||
<string name="setup_check_warn">Handlungsbedarf</string>
|
||||
<string name="setup_check_busy">In Arbeit</string>
|
||||
<string name="setup_limit_adb_failed">Prüfe IP-Adresse und Port unter „Debugging über WLAN“ oder kopple erneut, falls Android dieses Gerät entfernt hat.</string>
|
||||
<string name="setup_install">Installieren</string>
|
||||
<string name="setup_manage">Verwalten</string>
|
||||
<string name="setup_tab_overview">Übersicht</string>
|
||||
@@ -851,10 +861,16 @@
|
||||
<string name="setup_installed">Installiert</string>
|
||||
<string name="setup_runtime_update">%1$s · Update verfügbar</string>
|
||||
<string name="setup_runtime_current">%1$s · aktuell</string>
|
||||
<string name="setup_limit">Limit für Kindprozesse</string>
|
||||
<string name="setup_limit_on">An · Android kann Steam schließen. Das Abschalten dauert eine Minute.</string>
|
||||
<string name="setup_limit_unset">Nicht gesetzt · Android kann Steam schließen. Das Abschalten dauert eine Minute.</string>
|
||||
<string name="setup_limit_unknown">Konnte nicht geprüft werden · das Abschalten dauert eine Minute.</string>
|
||||
<string name="setup_fix_it">Beheben</string>
|
||||
<string name="setup_details">Details</string>
|
||||
<string name="setup_dev_options">Entwickleroptionen</string>
|
||||
<string name="setup_use_wireless">„Debugging über WLAN“ verwenden</string>
|
||||
<string name="setup_check_again">Erneut prüfen</string>
|
||||
<string name="setup_limit_turn_on">Limit aktivieren</string>
|
||||
<string name="setup_account">Steam-Konto</string>
|
||||
<string name="setup_signed_in_offline">Angemeldet als %1$s · Offlinemodus</string>
|
||||
<string name="setup_signed_in">Angemeldet als %1$s</string>
|
||||
@@ -1250,14 +1266,35 @@
|
||||
<item quantity="one">Neueste Änderungen · %1$d Build</item>
|
||||
<item quantity="other">Neueste Änderungen · %1$d Builds</item>
|
||||
</plurals>
|
||||
<string name="gate_title">Eine Android-Einstellung muss geändert werden</string>
|
||||
<string name="gate_eyebrow">Steam</string>
|
||||
<string name="gate_lede">Android stoppt Apps, die viele Hintergrundprozesse starten, und Steam startet Dutzende. Solange das so bleibt, werden Spiele ohne Fehlermeldung geschlossen.</string>
|
||||
<string name="gate_fix_for_me">Für mich beheben</string>
|
||||
<string name="gate_toggle_steps">Aktiviere „Beschränkungen für Unterprozesse deaktivieren“ und kehre dann zurück. Lass die Entwickleroptionen aktiviert, sonst geht der Schalter wieder aus.</string>
|
||||
<string name="gate_open_dev">Entwickleroptionen öffnen</string>
|
||||
<string name="gate_no_toggle">Diese Android-Version hat dafür keinen Schalter, deshalb ändert DroidDeck es über „Debugging über WLAN“. Dauert etwa eine Minute, kein Computer nötig.</string>
|
||||
<string name="gate_needs_wifi">„Debugging über WLAN“ braucht eine Wi-Fi-Verbindung. Jedes Netzwerk geht; Internet ist nicht nötig.</string>
|
||||
<string name="gate_step1">Öffne Einstellungen → Entwickleroptionen → Debugging über WLAN und aktiviere es</string>
|
||||
<string name="gate_step2">Tippe auf „Gerät über einen Kopplungscode koppeln“</string>
|
||||
<string name="gate_step3">Gib den Code in die DroidDeck-Benachrichtigung ein</string>
|
||||
<string name="pairguide_build_number">Tippe unter „Über das Telefon“ 7-mal auf „Build-Nummer“</string>
|
||||
<string name="pairguide_wireless">Aktiviere „Debugging über WLAN“</string>
|
||||
<string name="pairguide_pair">Öffne „Debugging über WLAN“ und tippe dann auf „Gerät mit Kopplungscode koppeln“</string>
|
||||
<string name="pairguide_child_process">Aktiviere „Beschränkungen für Unterprozesse deaktivieren“</string>
|
||||
<string name="pairguide_row_child_process">Beschränkungen für Unterprozesse deaktivieren</string>
|
||||
<string name="pairguide_row_build_number">Build-Nummer</string>
|
||||
<string name="pairguide_row_wireless">Debugging über WLAN</string>
|
||||
<string name="pairguide_row_pair">Gerät mit Kopplungscode koppeln</string>
|
||||
<string name="gate_waiting">Warte auf das Kopplungs-Pop-up…</string>
|
||||
<string name="gate_code_needed">Pop-up gefunden. Gib seinen Code in der Benachrichtigung ein.</string>
|
||||
<string name="gate_status">Status</string>
|
||||
<string name="gate_polling">Prüft alle 2 Sekunden. Diese Seite schließt sich, sobald es aus ist.</string>
|
||||
<string name="gate_other_ways">Andere Wege</string>
|
||||
<string name="gate_use_wireless_instead">Stattdessen „Debugging über WLAN“ verwenden</string>
|
||||
<string name="gate_some_roms">Manche ROMs haben den Schalter trotzdem. Suche in den Entwickleroptionen nach „untergeordnete Prozesse“.</string>
|
||||
<string name="gate_from_computer">Von einem Computer mit ADB:</string>
|
||||
<string name="gate_copy_command">Befehl kopieren</string>
|
||||
<string name="gate_sidequest_steps">Verbinde das Headset mit einem Computer und öffne SideQuest. Wähle „Run ADB Command“, dann „Custom Command“, tippe den unten gezeigten Befehl ein und wähle „Run Command“.</string>
|
||||
<string name="gate_choose_display">Wähle, auf welchem Display die Android-Einstellungen geöffnet werden.</string>
|
||||
<string name="gate_main_screen">Hauptbildschirm</string>
|
||||
<string name="ctrl_color">Farbe</string>
|
||||
@@ -1694,6 +1731,10 @@
|
||||
<string name="session_ended_desktop">Der Desktop wurde unerwartet beendet. Teile die Protokolle mit einem Fehlerbericht oder versuche es erneut.</string>
|
||||
<string name="session_ended_detail">Exit-Status %1$d · %2$s</string>
|
||||
<string name="session_ended_no_log">kein Protokoll</string>
|
||||
<plurals name="session_hint_enosys">
|
||||
<item quantity="one">Das Protokoll zeigt %1$d Fehler „Function not implemented“: Die seccomp-Beschleunigung von proot lässt auf diesem Gerät einen Helfer scheitern. Versuche %2$s → „%3$s“ (oder „%4$s“) und starte neu.</item>
|
||||
<item quantity="other">Das Protokoll zeigt %1$d Fehler „Function not implemented“: Die seccomp-Beschleunigung von proot lässt auf diesem Gerät einen Helfer scheitern. Versuche %2$s → „%3$s“ (oder „%4$s“) und starte neu.</item>
|
||||
</plurals>
|
||||
<string name="mode_decky_plugins">Plugins</string>
|
||||
<string name="mode_decky_plugins_hint">Installiere eine Plugin-ZIP für die nächste Steam-Sitzung.</string>
|
||||
<string name="mode_decky_plugin_downloading">Wird heruntergeladen…</string>
|
||||
@@ -2087,7 +2128,6 @@
|
||||
<string name="bottom_qam_layout_left">Links</string>
|
||||
<string name="bottom_qam_layout_center">Mitte</string>
|
||||
<string name="bottom_qam_layout_right">Rechts</string>
|
||||
<string name="bottom_qam_layout_split">Geteilt</string>
|
||||
<string name="bottom_qam_unavailable">Das Schnellzugriffsmenü von Steam ist noch nicht verfügbar.</string>
|
||||
<string name="bottom_page_telemetry">Spielstatistiken</string>
|
||||
<string name="bottom_hud_group">HUD für den unteren Bildschirm</string>
|
||||
@@ -2214,6 +2254,7 @@
|
||||
<string name="deckymgr_restore_failed">Das vorhandene Plugin konnte nicht wiederhergestellt werden</string>
|
||||
<string name="adbfix_save_failed">Identität für Debugging über WLAN konnte nicht gespeichert werden</string>
|
||||
<string name="adbfix_command_failed">ADB-Befehl fehlgeschlagen (%1$d)</string>
|
||||
<string name="adbfix_not_confirmed">Android hat nicht bestätigt, dass das Limit für untergeordnete Prozesse geändert wurde: %1$s</string>
|
||||
<string name="adbfix_no_pairing">Keine Kopplung für Debugging über WLAN gespeichert</string>
|
||||
<string name="adbfix_enter_address">Aktuelle IP-Adresse & Port von Debugging über WLAN eingeben</string>
|
||||
<string name="adbpair_timed_out">Zeitüberschreitung beim Warten auf das Kopplungs-Pop-up. Versuche es erneut über DroidDeck.</string>
|
||||
@@ -2223,6 +2264,8 @@
|
||||
<string name="adbpair_pairing">Wird gekoppelt…</string>
|
||||
<string name="adbpair_code_rejected">Dieser Code hat nicht funktioniert. Öffne das Kopplungs-Pop-up erneut und gib den neuen Code ein.</string>
|
||||
<string name="adbpair_connecting">Gekoppelt. Verbindung wird hergestellt…</string>
|
||||
<string name="adbpair_port_not_found">Gekoppelt, aber der Port für Debugging über WLAN wurde nicht gefunden. Lass Debugging über WLAN aktiviert und versuche es erneut.</string>
|
||||
<string name="adbpair_applying">Einstellung wird angewendet…</string>
|
||||
<string name="adbpair_command_failed">Befehl für Debugging über WLAN fehlgeschlagen</string>
|
||||
<string name="adbpair_channel_name">Einrichtung von Debugging über WLAN</string>
|
||||
<string name="adbpair_progress_channel_name">Fortschritt der Einrichtung von Debugging über WLAN</string>
|
||||
@@ -2235,6 +2278,9 @@
|
||||
<string name="adbpair_title_code">WLAN-Kopplungscode eingeben</string>
|
||||
<string name="adbpair_title_retry">Code noch einmal eingeben</string>
|
||||
<string name="adbpair_enter_code">Code eingeben</string>
|
||||
<string name="adbpair_title_working">Steam wird eingerichtet</string>
|
||||
<string name="adbpair_title_done">Steam ist bereit</string>
|
||||
<string name="adbpair_done_text">Tippe, um zu DroidDeck zurückzukehren. Du kannst Debugging über WLAN jetzt deaktivieren.</string>
|
||||
<string name="adbpair_title_failed">Einrichtung von Debugging über WLAN abgebrochen</string>
|
||||
<string name="selfinst_download_failed">Download fehlgeschlagen</string>
|
||||
<string name="selfinst_size_mismatch">Der Download hatte nicht die Größe der veröffentlichten APK und wurde verworfen - versuche es erneut</string>
|
||||
@@ -2384,6 +2430,16 @@
|
||||
<string name="hdr_none">dieses Display meldet keine HDR-Unterstützung</string>
|
||||
<string name="hdr_not_hdr10">dieses Display unterstützt %1$s, aber nicht HDR10</string>
|
||||
<string name="gpu_this_gpu">diese GPU</string>
|
||||
<string name="phantom_title_on">Limit für untergeordnete Prozesse ist aktiv</string>
|
||||
<string name="phantom_title_unset">Limit für untergeordnete Prozesse ist nicht festgelegt</string>
|
||||
<string name="phantom_title_unreadable">Limit für untergeordnete Prozesse konnte nicht geprüft werden</string>
|
||||
<string name="phantom_title_off">Limit für untergeordnete Prozesse ist aus</string>
|
||||
<string name="phantom_title_not_required">Limit für untergeordnete Prozesse nicht erforderlich</string>
|
||||
<string name="phantom_instructions_fix">%1$s Falls das nicht möglich ist, verbinde dieses Gerät per ADB mit einem Computer und führe den Befehl unten aus. Kehre dann hierher zurück und prüfe erneut.</string>
|
||||
<string name="phantom_instructions_off">Steam-Sitzungen können starten.</string>
|
||||
<string name="phantom_instructions_not_applicable">Diese Android-Version nutzt dieses Limit nicht.</string>
|
||||
<string name="phantom_fix_toggle">Aktiviere „Beschränkungen für Unterprozesse deaktivieren“ in den Entwickleroptionen und lass die Entwickleroptionen danach aktiviert.</string>
|
||||
<string name="phantom_fix_no_toggle">Diese Android-Version hat dafür keinen Schalter. Nutze Debugging über WLAN, um es auf diesem Gerät zu ändern.</string>
|
||||
<string name="upd_block_no_apk">Dieser Build hat keinen Download für diese DroidDeck-Installation.</string>
|
||||
<string name="upd_block_version_code">Android installiert ihn nicht über diesen Build, weil sein versionCode %1$d unter dem installierten %2$d liegt.</string>
|
||||
<string name="upd_fail_downgrade">Android installiert keine ältere Version über eine neuere. Bleib bei diesem Build, bis der Kanal aufholt.</string>
|
||||
@@ -2412,12 +2468,14 @@
|
||||
<string name="gstore_volume_free">%1$s · %2$s frei</string>
|
||||
<string name="mode_storage_auto_short">Automatisch</string>
|
||||
<string name="appupd_catalog_rejected">Der Update-Katalog hat seine Prüfungen nicht bestanden (%1$s)</string>
|
||||
<string name="main_adb_clip_label">DroidDeck-Einstellung für untergeordnete Prozesse</string>
|
||||
<string name="setup_signed_in_offline_unnamed">Angemeldet · Offlinemodus</string>
|
||||
<string name="setup_signed_in_unnamed">Angemeldet</string>
|
||||
<string name="driver_tag_bundled">MITGELIEFERT</string>
|
||||
<string name="driver_tag_downloaded">HERUNTERGELADEN</string>
|
||||
<string name="driver_tag_imported">IMPORTIERT</string>
|
||||
<string name="driver_tag_bundle">ANDROID + LINUX</string>
|
||||
<string name="phantom_warning">%1$s. %2$s\n\n%3$s</string>
|
||||
<string name="display_session">Sitzungsanzeige</string>
|
||||
<string name="display_zero_copy">Kopierfreie Darstellung</string>
|
||||
<string name="display_resolution_landscape">Auflösung im Querformat</string>
|
||||
@@ -2845,6 +2903,7 @@
|
||||
<string name="setup_ready">Bereit zum Spielen</string>
|
||||
<string name="setup_not_ready">Noch nicht bereit zum Spielen</string>
|
||||
<string name="setup_ready_runtime">Laufzeit %1$s</string>
|
||||
<string name="setup_ready_limit_off">Prozesslimit aus</string>
|
||||
<string name="setup_ready_signed_in">angemeldet als %1$s</string>
|
||||
<string name="setup_needs_you">Wenn etwas deine Aufmerksamkeit braucht</string>
|
||||
<string name="setup_group_look">Aussehen</string>
|
||||
@@ -4096,7 +4155,4 @@
|
||||
<string name="steam_store_linux_build">Dieses Spiel installiert seine Linux-Version. Installiere es über Steam.</string>
|
||||
<string name="game_zoom_title">Spielzoom</string>
|
||||
<string name="game_zoom_hint">Spielvergrößerung von 100 % bis 300 % anpassen</string>
|
||||
<string name="glasses_shortcut_group">Ingame-Verknüpfung</string>
|
||||
<string name="glasses_show_shortcut">Smart-Glasses-Verknüpfung anzeigen</string>
|
||||
<string name="glasses_show_shortcut_hint">Die schwebende Smart-Glasses-Schaltfläche über dem Spiel anzeigen.</string>
|
||||
</resources>
|
||||
Loaded 100 of 344 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user