Compare commits
24
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
53fdc2c9ad | ||
|
|
e9877e27f7 | ||
|
|
b67a69542c | ||
|
|
02e7eff284 | ||
|
|
439d9afe5e | ||
|
|
f0557302ac | ||
|
|
a8c1a9ff4d | ||
|
|
37a816c212 | ||
|
|
1ab090405e | ||
|
|
dc98b6b96a | ||
|
|
6188c9ac0d | ||
|
|
758e7983fa | ||
|
|
f65e7a3d43 | ||
|
|
3d0c38c1d3 | ||
|
|
81e238b92e | ||
|
|
a20528c62b | ||
|
|
9b5d7870a3 | ||
|
|
b6391ed8c0 | ||
|
|
c7ff93ec19 | ||
|
|
1cada9ad50 | ||
|
|
9375ed0948 | ||
|
|
946e9c41e0 | ||
|
|
259d5d184b | ||
|
|
9a93f59fbf |
No files matched your search
@@ -152,6 +152,9 @@ jobs:
|
||||
runs-on: ${{ fromJSON(needs.components-runner.outputs.labels) }}
|
||||
timeout-minutes: 40
|
||||
steps:
|
||||
- name: Reclaim files a cancelled container build left owned by root
|
||||
if: runner.environment == 'self-hosted'
|
||||
run: sudo -n chown -R "$(id -u):$(id -g)" "$GITHUB_WORKSPACE" || echo "::warning::could not reclaim $GITHUB_WORKSPACE"
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
|
||||
@@ -350,6 +353,9 @@ jobs:
|
||||
outputs:
|
||||
variants: ${{ steps.variants.outputs.list }}
|
||||
steps:
|
||||
- name: Reclaim files a cancelled container build left owned by root
|
||||
if: runner.environment == 'self-hosted'
|
||||
run: sudo -n chown -R "$(id -u):$(id -g)" "$GITHUB_WORKSPACE" || echo "::warning::could not reclaim $GITHUB_WORKSPACE"
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
|
||||
|
||||
@@ -55,7 +55,7 @@ jobs:
|
||||
jq -r --arg n "$2" '.assets // [] | .[] | select(.name == $n) | .digest // empty'
|
||||
}
|
||||
commit=$(gh api "repos/$GITHUB_REPOSITORY/actions/runs/$BUILD_RUN" --jq .head_sha 2>/dev/null || echo "$GITHUB_SHA")
|
||||
for name in proot directaudio tracking xbox comet butler powervr ubisoft; do
|
||||
for name in proot directaudio tracking xbox comet butler powervr ubisoft rockstar dirt; 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)
|
||||
|
||||
+1
-1
@@ -36,4 +36,4 @@ __pycache__/
|
||||
app/src/main/assets/directaudio/
|
||||
app/src/main/assets/hybris/
|
||||
/tools/vr/out/
|
||||
app/src/main/resources/rockstar/helpers/
|
||||
app/src/main/assets/linuxfs/usr/local/lib/droiddeck-rockstar/
|
||||
@@ -74,6 +74,7 @@ DroidDeck is [GPL-3.0](LICENSE). Steam and Proton belong to Valve Corporation. V
|
||||
- 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.
|
||||
- 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). libblsession supplies the arm64 syscall number and answers `PAGEMAP_SCAN` from `/proc/self/pagemap`.
|
||||
- libblsession 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).
|
||||
@@ -98,7 +99,7 @@ DroidDeck is [GPL-3.0](LICENSE). Steam and Proton belong to Valve Corporation. V
|
||||
- Battle.net installs drive Blizzard's Agent the way [@barncastle](https://github.com/barncastle)'s [Battle.Net-Installer](https://github.com/barncastle/Battle.Net-Installer) does, with requests from [wowdev.wiki](https://wowdev.wiki/Agent). Read without taking code: [@mubaraknumann](https://github.com/mubaraknumann)'s [unifideck](https://github.com/mubaraknumann/unifideck), [@djmittens](https://github.com/djmittens)'s [neo-mittens](https://github.com/djmittens/neo-mittens) `bnetswitch`, [@BCD1210](https://github.com/BCD1210)'s [soju](https://github.com/BCD1210/soju) and [Lutris](https://github.com/lutris/lutris)'s `product.db` reader.
|
||||
- World of Warcraft addon imports replace an addon's folder from a temporary copy, as [WowUp](https://github.com/WowUp/WowUp) does, and read flavour folders the way [WoWDeck](https://github.com/sigboe/wowdeck) does. No code from either is used.
|
||||
- The World of Warcraft addon Download window searches [WoWInterface](https://www.wowinterface.com) through its MMOUI API. [CurseForge](https://www.curseforge.com/wow) opens in the user's browser, with no API and no key.
|
||||
- Xbox games load [@domsvoboda](https://github.com/domsvoboda)'s [xodus-nexus](https://github.com/domsvoboda/xodus-nexus) modules (LGPL-2.1-or-later), including `wintypes.dll`. Content licensing sends delegation-compact device tickets in the licensing wire form, following the [nexus-backend](https://github.com/domsvoboda/nexus-backend) commit `27c335e`. Minecraft's GameInput setup was checked against [@Wyze3306](https://github.com/Wyze3306)'s [BedrockOnLinux](https://github.com/Wyze3306/BedrockOnLinux) (MIT).
|
||||
- The Xbox store runs [@domsvoboda](https://github.com/domsvoboda)'s [nexus-backend](https://github.com/domsvoboda/nexus-backend) 0.2.15 (GPL-3.0, a fork of [Xodus](https://github.com/xodus-gaming/xodus)), and Xbox games load the Windows modules of his [nexus-runtime](https://github.com/domsvoboda/nexus-runtime) (LGPL-2.1-or-later), including the C++ [nexus-xgameruntime](https://github.com/domsvoboda/nexus-xgameruntime) and `wintypes.dll`. Content licensing sends delegation-compact device tickets in the licensing wire form, as nexus-backend's Store license path (commit `27c335e`) does. Minecraft's GameInput setup was checked against [@Wyze3306](https://github.com/Wyze3306)'s [BedrockOnLinux](https://github.com/Wyze3306/BedrockOnLinux) (MIT).
|
||||
- The Xbox Cloud Gaming player uses the WebRTC client of [@unknownskl](https://github.com/unknownskl)'s [Greenlight](https://github.com/unknownskl/greenlight) (MIT), and its offer tweaks and sharpening follow [@redphx](https://github.com/redphx)'s [Better xCloud](https://github.com/redphx/better-xcloud) (MIT). See `tools/xcloud-player/NOTICE.md`.
|
||||
- The itch.io butler pack ships butler's `7z.so`, itch.io's build of [7-Zip](https://www.7-zip.org) by Igor Pavlov (LGPL-2.1, unRAR restriction on RAR code), unmodified. Other archives use Apache Commons Compress and the runtime's bsdtar (libarchive).
|
||||
- The Store uses [Flatpak](https://github.com/flatpak/flatpak) (LGPL-2.1) through DroidDeck's own bubblewrap shim. Chromium and Electron apps start directly, since [zypak](https://github.com/refi64/zypak) by [@refi64](https://github.com/refi64) (BSD-3-Clause) always uses Flatpak's spawn portal.
|
||||
@@ -113,6 +114,7 @@ DroidDeck is [GPL-3.0](LICENSE). Steam and Proton belong to Valve Corporation. V
|
||||
- The DroidDeck HUD is [@The412Banner](https://github.com/The412Banner)'s [FusionHUD](https://github.com/The412Banner/FusionHUD) (GPL-3.0 with an attribution term). Its readings match Valve's [MangoHud](https://github.com/flightlessmango/MangoHud) build (MIT), with frame times from gamescope patch 0125.
|
||||
- The HUD's CPU, GPU load, thermal and battery readers come from [@xXJSONDeruloXx](https://github.com/xXJSONDeruloXx)'s work.
|
||||
- LSFG frame generation comes from Camille LaVey and the [Eden](https://eden-emu.dev) project, following [lsfg-vk](https://github.com/PancakeTAS/lsfg-vk), ported by [@maxjivi05](https://github.com/maxjivi05). It needs your own copy of [Lossless Scaling](https://store.steampowered.com/app/993090/) and ships none of its shaders.
|
||||
- Black frame insertion follows the design of [@artzox](https://github.com/artzox)'s [BFI Presenter](https://github.com/artzox/BFI-Presenter) (GPL-3.0): the strobe runs on the display's refresh clock and the game is paced to the lit refresh. Both build on [Blur Busters](https://blurbusters.com)' research on MPRT and motion blur. No BFI Presenter code is used.
|
||||
- Remote Play decodes through Android's MediaCodec or the [FFmpeg](https://ffmpeg.org) (LGPL-2.1-or-later) in Steam's runtime. Qualcomm low latency settings follow [Moonlight](https://github.com/moonlight-stream/moonlight-android) (GPL-3.0).
|
||||
- [PipeWire](https://gitlab.freedesktop.org/pipewire/pipewire) (MIT) sockets use the settings in its `module-access.c`, and [WirePlumber](https://gitlab.freedesktop.org/pipewire/wireplumber) (MIT) keeps those clients at full permissions.
|
||||
|
||||
|
||||
+7
-9
@@ -93,7 +93,7 @@ def trackingPack = rootProject.file('tools/packs/tracking/release.env').readLine
|
||||
def prootPackPin = rootProject.file('tools/packs/proot/release.env').readLines()
|
||||
.findAll { it.contains('=') && !it.startsWith('#') }
|
||||
.collectEntries { def kv = it.split('=', 2); [(kv[0].trim()): kv[1].trim()] }
|
||||
def addonPacks = ['proot', 'directaudio', 'tracking', 'xbox', 'comet', 'butler', 'powervr', 'ubisoft'].collectEntries { name ->
|
||||
def addonPacks = ['proot', 'directaudio', 'tracking', 'xbox', 'comet', 'butler', 'powervr', 'ubisoft', 'rockstar', 'dirt'].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")
|
||||
@@ -130,7 +130,7 @@ android {
|
||||
defaultConfig {
|
||||
applicationId "com.droiddeck.launcher"
|
||||
minSdkVersion 26
|
||||
targetSdkVersion 28
|
||||
targetSdkVersion 34
|
||||
versionCode 19
|
||||
versionName "0.7.1"
|
||||
buildConfigField "String", "BUILD_LABEL", "\"${escapedBuildLabel}\""
|
||||
@@ -201,12 +201,8 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
lint {
|
||||
disable 'ExpiredTargetSdkVersion'
|
||||
}
|
||||
|
||||
androidResources {
|
||||
ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~:<dir>droiddeck-xbox:<dir>droiddeck-comet:<dir>droiddeck-ubisoft:<dir>directaudio:<dir>hybris'
|
||||
ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~:<dir>droiddeck-xbox:<dir>droiddeck-comet:<dir>droiddeck-ubisoft:<dir>droiddeck-rockstar:<dir>droiddeck-dirt:<dir>directaudio:<dir>hybris'
|
||||
}
|
||||
|
||||
packagingOptions {
|
||||
@@ -216,7 +212,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']
|
||||
}
|
||||
}
|
||||
|
||||
@@ -278,8 +274,10 @@ def stageRuntimeAssets = tasks.register('stageRuntimeAssets', Sync) {
|
||||
dependsOn(stageSessionScripts)
|
||||
from(layout.projectDirectory.dir('src/main/assets')) { exclude 'pulseaudio.tzst' }
|
||||
from(rootProject.file('tools/linuxfs/innoextract'))
|
||||
from(rootProject.file('tools')) { include 'droiddeckctl', 'adb_device.py', 'proot_profile.py'; into('agent/ctl') }
|
||||
from(rootProject.file('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') }
|
||||
from(layout.buildDirectory.dir('prepared-assets'))
|
||||
into(runtimeAssetsDir)
|
||||
}
|
||||
|
||||
@@ -36,7 +36,12 @@
|
||||
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
<uses-permission android:name="android.permission.HIGH_SAMPLING_RATE_SENSORS" />
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />
|
||||
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
@@ -48,7 +53,8 @@
|
||||
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
<uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
|
||||
<uses-feature android:name="android.hardware.vulkan.version" android:version="0x401000" android:required="true" />
|
||||
@@ -70,6 +76,7 @@
|
||||
android:hardwareAccelerated="true"
|
||||
android:largeHeap="true"
|
||||
android:extractNativeLibs="true"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:appCategory="game"
|
||||
android:isGame="true">
|
||||
|
||||
@@ -312,7 +319,11 @@
|
||||
android:configChanges="orientation|screenSize|screenLayout|smallestScreenSize|keyboard|keyboardHidden|navigation|uiMode|density"
|
||||
android:theme="@style/SessionTheme" />
|
||||
|
||||
<service android:name=".agent.AgentHostService" android:exported="false" />
|
||||
<service android:name=".agent.AgentHostService" android:exported="false"
|
||||
android:foregroundServiceType="specialUse">
|
||||
<property android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
|
||||
android:value="Keeps the user's on-device assistant running between screens" />
|
||||
</service>
|
||||
<service
|
||||
android:name=".update.UpdateWatch"
|
||||
android:permission="android.permission.BIND_JOB_SERVICE"
|
||||
@@ -320,7 +331,11 @@
|
||||
<service
|
||||
android:name=".session.SessionService"
|
||||
android:exported="false"
|
||||
android:stopWithTask="false" />
|
||||
android:stopWithTask="false"
|
||||
android:foregroundServiceType="specialUse">
|
||||
<property android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
|
||||
android:value="Runs the user's Linux gaming session while its window is in the background" />
|
||||
</service>
|
||||
<!-- The compositor's native state is one per process, so the bottom-screen desktop's compositor runs in its own. -->
|
||||
<service
|
||||
android:name=".wayland.BottomDesktopCompositorService"
|
||||
@@ -328,10 +343,15 @@
|
||||
android:exported="false" />
|
||||
<service
|
||||
android:name=".runtime.RuntimeInstallService"
|
||||
android:exported="false" />
|
||||
android:exported="false"
|
||||
android:foregroundServiceType="dataSync" />
|
||||
<service
|
||||
android:name=".core.WirelessAdbPairingService"
|
||||
android:exported="false" />
|
||||
android:exported="false"
|
||||
android:foregroundServiceType="specialUse">
|
||||
<property android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
|
||||
android:value="Waits for the wireless debugging pairing code the user enters" />
|
||||
</service>
|
||||
<service
|
||||
android:name=".stores.download.StoreDownloadService"
|
||||
android:exported="false"
|
||||
|
||||
Executable
+2
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
exec python3 /root/.local/share/droiddeck/ctl/droiddeck-scenario "$@"
|
||||
@@ -40,6 +40,12 @@ add_library(gpuclock SHARED gpuclock/kgsl_clock.c gpuclock/kgsl_busy.c)
|
||||
|
||||
add_library(termux SHARED termux/termux.c)
|
||||
|
||||
# An executable packaged as a library: the only place a targetSdk 29+ app may execute files from.
|
||||
add_library(ddexec SHARED ddexec/ddexec.c)
|
||||
target_compile_options(ddexec PRIVATE -O2 -ffreestanding -fno-builtin -fno-stack-protector -fno-asynchronous-unwind-tables)
|
||||
target_link_options(ddexec PRIVATE -nostdlib -Wl,-e,_start -Wl,-z,noexecstack -Wl,--no-undefined -Wl,-Bsymbolic
|
||||
-Wl,-z,max-page-size=16384)
|
||||
|
||||
add_library(ddvenc SHARED venc/venc_server.cpp)
|
||||
target_compile_features(ddvenc PRIVATE cxx_std_17)
|
||||
target_link_libraries(ddvenc mediandk log)
|
||||
|
||||
@@ -0,0 +1,274 @@
|
||||
// libddexec.so: starts an ELF program from the app's data directory.
|
||||
//
|
||||
// usage: libddexec.so <file> <argv0> [args...]
|
||||
//
|
||||
// From targetSdk 29, Android refuses execve() of app data files, but still lets the app map them
|
||||
// executable, and executes the APK's extracted libraries. This executable is one of those libraries:
|
||||
// it maps <file> (and its PT_INTERP, if it names one) the way the kernel's ELF loader would, builds the
|
||||
// stack the kernel would have built for "<argv0> [args...]", and jumps to the entry point.
|
||||
// It is freestanding: no libc, no relocations, so the kernel can run it as a static PIE.
|
||||
|
||||
#include <elf.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#define SYS_faccessat 48
|
||||
#define SYS_openat 56
|
||||
#define SYS_close 57
|
||||
#define SYS_pread64 67
|
||||
#define SYS_write 64
|
||||
#define SYS_exit_group 94
|
||||
#define SYS_munmap 215
|
||||
#define SYS_mmap 222
|
||||
#define SYS_mprotect 226
|
||||
|
||||
#define AT_FDCWD_ (-100)
|
||||
#define O_RDONLY_ 0
|
||||
#define O_CLOEXEC_ 02000000
|
||||
#define PROT_READ_ 1
|
||||
#define PROT_WRITE_ 2
|
||||
#define PROT_EXEC_ 4
|
||||
#define MAP_PRIVATE_ 0x02
|
||||
#define MAP_FIXED_ 0x10
|
||||
#define MAP_ANONYMOUS_ 0x20
|
||||
#define MAX_PHDRS 64
|
||||
#define STACK_GAP 65536
|
||||
|
||||
static long sys6(long n, long a, long b, long c, long d, long e, long f) {
|
||||
register long x8 __asm__("x8") = n;
|
||||
register long x0 __asm__("x0") = a;
|
||||
register long x1 __asm__("x1") = b;
|
||||
register long x2 __asm__("x2") = c;
|
||||
register long x3 __asm__("x3") = d;
|
||||
register long x4 __asm__("x4") = e;
|
||||
register long x5 __asm__("x5") = f;
|
||||
__asm__ volatile("svc #0" : "+r"(x0) : "r"(x8), "r"(x1), "r"(x2), "r"(x3), "r"(x4), "r"(x5) : "memory", "cc");
|
||||
return x0;
|
||||
}
|
||||
|
||||
static size_t slen(const char *s) {
|
||||
size_t n = 0;
|
||||
while (s[n]) n++;
|
||||
return n;
|
||||
}
|
||||
|
||||
static void out(const char *s) { sys6(SYS_write, 2, (long)s, (long)slen(s), 0, 0, 0); }
|
||||
|
||||
static void out_num(long v) {
|
||||
char buf[24];
|
||||
int i = (int)sizeof(buf) - 1;
|
||||
buf[i] = 0;
|
||||
unsigned long u = v < 0 ? (unsigned long)-v : (unsigned long)v;
|
||||
do {
|
||||
buf[--i] = (char)('0' + u % 10);
|
||||
u /= 10;
|
||||
} while (u && i > 1);
|
||||
if (v < 0) buf[--i] = '-';
|
||||
out(buf + i);
|
||||
}
|
||||
|
||||
__attribute__((noreturn)) static void die(const char *what, const char *path, long err) {
|
||||
out("libddexec: ");
|
||||
if (path) {
|
||||
out(path);
|
||||
out(": ");
|
||||
}
|
||||
out(what);
|
||||
if (err) {
|
||||
out(" (");
|
||||
out_num(err);
|
||||
out(")");
|
||||
}
|
||||
out("\n");
|
||||
sys6(SYS_exit_group, 127, 0, 0, 0, 0, 0);
|
||||
__builtin_unreachable();
|
||||
}
|
||||
|
||||
static long xpread(int fd, void *buf, size_t len, long off) {
|
||||
size_t done = 0;
|
||||
while (done < len) {
|
||||
long n = sys6(SYS_pread64, fd, (long)((char *)buf + done), (long)(len - done), off + (long)done, 0, 0);
|
||||
if (n <= 0) return n < 0 ? n : -1;
|
||||
done += (size_t)n;
|
||||
}
|
||||
return (long)done;
|
||||
}
|
||||
|
||||
struct image {
|
||||
uintptr_t base;
|
||||
uintptr_t phdr;
|
||||
uintptr_t entry;
|
||||
unsigned long phnum;
|
||||
unsigned long phent;
|
||||
char interp[256];
|
||||
};
|
||||
|
||||
static uintptr_t trunc_page(uintptr_t v, uintptr_t page) { return v & ~(page - 1); }
|
||||
static uintptr_t round_page(uintptr_t v, uintptr_t page) { return (v + page - 1) & ~(page - 1); }
|
||||
|
||||
static int prot_of(uint32_t flags) {
|
||||
return ((flags & PF_R) ? PROT_READ_ : 0) | ((flags & PF_W) ? PROT_WRITE_ : 0) | ((flags & PF_X) ? PROT_EXEC_ : 0);
|
||||
}
|
||||
|
||||
static void map_failed(const char *path, long r) { die("cannot map a segment", path, r); }
|
||||
|
||||
static void load(const char *path, struct image *im, uintptr_t page) {
|
||||
int fd = (int)sys6(SYS_openat, AT_FDCWD_, (long)path, O_RDONLY_ | O_CLOEXEC_, 0, 0, 0);
|
||||
if (fd < 0) die("cannot open", path, fd);
|
||||
Elf64_Ehdr eh;
|
||||
if (xpread(fd, &eh, sizeof(eh), 0) != (long)sizeof(eh)) die("not an ELF file", path, 0);
|
||||
if (eh.e_ident[EI_MAG0] != ELFMAG0 || eh.e_ident[EI_MAG1] != ELFMAG1 || eh.e_ident[EI_MAG2] != ELFMAG2 ||
|
||||
eh.e_ident[EI_MAG3] != ELFMAG3 || eh.e_ident[EI_CLASS] != ELFCLASS64 || eh.e_machine != EM_AARCH64 ||
|
||||
(eh.e_type != ET_EXEC && eh.e_type != ET_DYN) || eh.e_phentsize != sizeof(Elf64_Phdr) ||
|
||||
eh.e_phnum == 0 || eh.e_phnum > MAX_PHDRS)
|
||||
die("not a 64-bit ARM ELF program", path, 0);
|
||||
Elf64_Phdr ph[MAX_PHDRS];
|
||||
long size = (long)eh.e_phnum * (long)sizeof(Elf64_Phdr);
|
||||
if (xpread(fd, ph, (size_t)size, (long)eh.e_phoff) != size) die("truncated program headers", path, 0);
|
||||
|
||||
uintptr_t lo = UINTPTR_MAX, hi = 0;
|
||||
for (int i = 0; i < eh.e_phnum; i++) {
|
||||
if (ph[i].p_type != PT_LOAD) continue;
|
||||
uintptr_t s = trunc_page(ph[i].p_vaddr, page), e = round_page(ph[i].p_vaddr + ph[i].p_memsz, page);
|
||||
if (s < lo) lo = s;
|
||||
if (e > hi) hi = e;
|
||||
}
|
||||
if (lo >= hi) die("no loadable segments", path, 0);
|
||||
|
||||
uintptr_t bias = 0;
|
||||
if (eh.e_type == ET_DYN) {
|
||||
long r = sys6(SYS_mmap, 0, (long)(hi - lo), 0, MAP_PRIVATE_ | MAP_ANONYMOUS_, -1, 0);
|
||||
if (r < 0 && r > -4096) map_failed(path, r);
|
||||
bias = (uintptr_t)r - lo;
|
||||
}
|
||||
|
||||
for (int i = 0; i < eh.e_phnum; i++) {
|
||||
Elf64_Phdr *p = &ph[i];
|
||||
if (p->p_type != PT_LOAD || p->p_memsz == 0) continue;
|
||||
int prot = prot_of(p->p_flags);
|
||||
uintptr_t seg = bias + p->p_vaddr;
|
||||
uintptr_t start = trunc_page(seg, page);
|
||||
uintptr_t file_end = seg + p->p_filesz;
|
||||
uintptr_t mem_end = round_page(seg + p->p_memsz, page);
|
||||
int zero_tail = p->p_memsz > p->p_filesz && (file_end & (page - 1)) != 0;
|
||||
if (p->p_filesz > 0) {
|
||||
uintptr_t len = round_page(file_end, page) - start;
|
||||
long r = sys6(SYS_mmap, (long)start, (long)len, prot | (zero_tail ? PROT_WRITE_ : 0),
|
||||
MAP_PRIVATE_ | MAP_FIXED_, fd, (long)trunc_page(p->p_offset, page));
|
||||
if (r < 0 && r > -4096) map_failed(path, r);
|
||||
if (zero_tail) {
|
||||
for (volatile char *z = (volatile char *)file_end; (uintptr_t)z < round_page(file_end, page); z++) *z = 0;
|
||||
if (!(prot & PROT_WRITE_)) sys6(SYS_mprotect, (long)trunc_page(file_end, page), (long)page, prot, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
uintptr_t anon = p->p_filesz > 0 ? round_page(file_end, page) : start;
|
||||
if (mem_end > anon) {
|
||||
long r = sys6(SYS_mmap, (long)anon, (long)(mem_end - anon), prot, MAP_PRIVATE_ | MAP_FIXED_ | MAP_ANONYMOUS_, -1, 0);
|
||||
if (r < 0 && r > -4096) map_failed(path, r);
|
||||
}
|
||||
}
|
||||
|
||||
im->base = bias;
|
||||
im->entry = bias + eh.e_entry;
|
||||
im->phnum = eh.e_phnum;
|
||||
im->phent = eh.e_phentsize;
|
||||
im->phdr = 0;
|
||||
im->interp[0] = 0;
|
||||
for (int i = 0; i < eh.e_phnum; i++) {
|
||||
if (ph[i].p_type == PT_PHDR) im->phdr = bias + ph[i].p_vaddr;
|
||||
if (ph[i].p_type == PT_INTERP) {
|
||||
if (ph[i].p_filesz == 0 || ph[i].p_filesz >= sizeof(im->interp)) die("bad PT_INTERP", path, 0);
|
||||
if (xpread(fd, im->interp, ph[i].p_filesz, (long)ph[i].p_offset) != (long)ph[i].p_filesz)
|
||||
die("truncated PT_INTERP", path, 0);
|
||||
im->interp[ph[i].p_filesz] = 0;
|
||||
}
|
||||
}
|
||||
if (!im->phdr) {
|
||||
for (int i = 0; i < eh.e_phnum; i++) {
|
||||
Elf64_Phdr *p = &ph[i];
|
||||
if (p->p_type == PT_LOAD && eh.e_phoff >= p->p_offset && eh.e_phoff < p->p_offset + p->p_filesz) {
|
||||
im->phdr = bias + p->p_vaddr + (eh.e_phoff - p->p_offset);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!im->phdr) die("program headers are not in a loaded segment", path, 0);
|
||||
sys6(SYS_close, fd, 0, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
static unsigned long auxv_get(const uintptr_t *auxv, unsigned long type, unsigned long fallback) {
|
||||
for (; auxv[0] != AT_NULL; auxv += 2)
|
||||
if (auxv[0] == type) return auxv[1];
|
||||
return fallback;
|
||||
}
|
||||
|
||||
__attribute__((used, noreturn)) void ddexec_main(uintptr_t *sp) {
|
||||
long argc = (long)sp[0];
|
||||
char **argv = (char **)(sp + 1);
|
||||
char **envp = argv + argc + 1;
|
||||
long nenv = 0;
|
||||
while (envp[nenv]) nenv++;
|
||||
uintptr_t *auxv = (uintptr_t *)(envp + nenv + 1);
|
||||
long naux = 0;
|
||||
while (auxv[naux * 2] != AT_NULL) naux++;
|
||||
if (argc < 3) die("usage: libddexec.so <file> <argv0> [args...]", 0, 0);
|
||||
|
||||
uintptr_t page = auxv_get(auxv, AT_PAGESZ, 4096);
|
||||
const char *path = argv[1];
|
||||
struct image prog, interp;
|
||||
load(path, &prog, page);
|
||||
int has_interp = prog.interp[0] != 0;
|
||||
if (has_interp) load(prog.interp, &interp, page);
|
||||
|
||||
// The new stack: argc, argv, envp and auxv as the kernel lays them out, below the current one.
|
||||
// The strings stay where the kernel put them.
|
||||
static const unsigned long replaced[] = {AT_PHDR, AT_PHENT, AT_PHNUM, AT_BASE, AT_ENTRY, AT_EXECFN};
|
||||
long nreplaced = (long)(sizeof(replaced) / sizeof(replaced[0]));
|
||||
long new_argc = argc - 2;
|
||||
long words = 1 + (new_argc + 1) + (nenv + 1) + (naux + nreplaced + 1) * 2;
|
||||
uintptr_t *nsp = (uintptr_t *)(((uintptr_t)sp - STACK_GAP - (uintptr_t)words * sizeof(uintptr_t)) & ~(uintptr_t)15);
|
||||
uintptr_t *w = nsp;
|
||||
*w++ = (uintptr_t)new_argc;
|
||||
for (long i = 0; i < new_argc; i++) *w++ = (uintptr_t)argv[i + 2];
|
||||
*w++ = 0;
|
||||
for (long i = 0; i < nenv; i++) *w++ = (uintptr_t)envp[i];
|
||||
*w++ = 0;
|
||||
for (long i = 0; i < naux; i++) {
|
||||
unsigned long type = auxv[i * 2];
|
||||
int skip = 0;
|
||||
for (long r = 0; r < nreplaced; r++)
|
||||
if (type == replaced[r]) skip = 1;
|
||||
if (skip) continue;
|
||||
*w++ = type;
|
||||
*w++ = auxv[i * 2 + 1];
|
||||
}
|
||||
*w++ = AT_PHDR;
|
||||
*w++ = prog.phdr;
|
||||
*w++ = AT_PHENT;
|
||||
*w++ = prog.phent;
|
||||
*w++ = AT_PHNUM;
|
||||
*w++ = prog.phnum;
|
||||
*w++ = AT_BASE;
|
||||
*w++ = has_interp ? interp.base : 0;
|
||||
*w++ = AT_ENTRY;
|
||||
*w++ = prog.entry;
|
||||
*w++ = AT_EXECFN;
|
||||
*w++ = (uintptr_t)path;
|
||||
*w++ = AT_NULL;
|
||||
*w++ = 0;
|
||||
|
||||
uintptr_t entry = has_interp ? interp.entry : prog.entry;
|
||||
__asm__ volatile("mov sp, %0\n"
|
||||
"mov x0, #0\n"
|
||||
"br %1\n"
|
||||
:
|
||||
: "r"(nsp), "r"(entry)
|
||||
: "memory");
|
||||
__builtin_unreachable();
|
||||
}
|
||||
|
||||
__attribute__((naked, noreturn)) void _start(void) {
|
||||
__asm__ volatile("mov x0, sp\n"
|
||||
"and sp, x0, #~15\n"
|
||||
"bl ddexec_main\n");
|
||||
}
|
||||
@@ -305,6 +305,14 @@ static int g_fallback_armed;
|
||||
volatile int g_fps_limit;
|
||||
volatile int g_release_unpaced;
|
||||
|
||||
volatile int g_bfi;
|
||||
volatile int g_bfi_picture_hold;
|
||||
static int g_bfi_running;
|
||||
static unsigned g_bfi_phase;
|
||||
static const char *g_bfi_blocked;
|
||||
static int g_scene_layer_only;
|
||||
static struct { unsigned lit, dark, failed; } g_bfi_stats;
|
||||
|
||||
volatile int g_hide_shell;
|
||||
|
||||
volatile int g_zero_copy;
|
||||
@@ -2278,6 +2286,10 @@ static void render_scene(void) {
|
||||
if (hdr_route == 3) { fx_on = 0; framegen = 0; }
|
||||
struct surface *ahb_only = ahb_layer_only_candidate(w, h);
|
||||
struct surface *layer_only = ahb_only ? ahb_only : hdr_unimported_fullscreen(&dl, w, h);
|
||||
g_scene_layer_only = hdr_route == 3 || layer_only;
|
||||
const int bfi = g_bfi_running && !g_scene_layer_only;
|
||||
/* The compositor pass BFI needs is route 2; a fullscreen HDR scene on route 0 would lose its HDR there too. */
|
||||
if (bfi && (hdr_route == 1 || (hdr_route == 0 && hs.n_hdr > 0))) hdr_route = 2;
|
||||
const int cursor_on = hdr_route == 3 || layer_only ? 0 : add_cursor(&dl, w);
|
||||
static int cursor_layer_said;
|
||||
if (layer_only && atomic_load(&g_cursor_composite) && !cursor_layer_said) {
|
||||
@@ -2328,19 +2340,21 @@ static void render_scene(void) {
|
||||
rendered = vkp_render(w, h, dl.d, dl.n) == 0;
|
||||
} else if (hdr_route == 0 || hdr_route == 3) {
|
||||
const int pass_on = fx_on || framegen;
|
||||
int li = (g_zero_copy && !framegen && !cardboard && !cursor_on) ? layer_candidate(&dl, w, h) : -1;
|
||||
int li = (g_zero_copy && !framegen && !bfi && !cardboard && !cursor_on) ? layer_candidate(&dl, w, h) : -1;
|
||||
int over = li >= 0 ? dl.n - 1 - li : 0;
|
||||
const int fx_blocks = (li >= 0 && fx_on && over > 0);
|
||||
if (fx_blocks) { li = -1; over = 0; }
|
||||
const int ov_blocks = (li >= 0 && over > 0 && !fx_blocks && !sc_layer_overlay_affordable());
|
||||
if (ov_blocks) { li = -1; over = 0; }
|
||||
const int blocked = framegen ? 1 : (fx_blocks ? 2 : (ov_blocks ? 3 : 0));
|
||||
const int blocked = framegen ? 1 : bfi ? 4 : (fx_blocks ? 2 : (ov_blocks ? 3 : 0));
|
||||
if (g_zero_copy && !cursor_on && blocked != g_zero_copy_paused) {
|
||||
g_zero_copy_paused = blocked;
|
||||
if (blocked == 1)
|
||||
droiddeck_log("framegen", "zero-copy paused: frame generation needs the compositor pass");
|
||||
else if (blocked == 2)
|
||||
droiddeck_log("effects", "zero-copy paused: a window above the game needs the compositor pass for the whole scene");
|
||||
else if (blocked == 4)
|
||||
droiddeck_log("bfi", "zero-copy paused: black frame insertion needs the compositor pass");
|
||||
else if (blocked == 3)
|
||||
droiddeck_log("layer", "zero-copy paused: a window above the game would need a second display layer, "
|
||||
"which this display cannot compose in hardware - whole scene on the copy path");
|
||||
@@ -2351,6 +2365,7 @@ static void render_scene(void) {
|
||||
if (li < 0) ls = layer_only;
|
||||
if (cardboard) ls = NULL;
|
||||
if (cursor_on) ls = NULL;
|
||||
if (bfi) ls = NULL;
|
||||
if (ls && pass_on && li < 0 && !g_zero_copy_fx_skip_said) {
|
||||
g_zero_copy_fx_skip_said = 1;
|
||||
droiddeck_log(framegen ? "framegen" : "effects",
|
||||
@@ -2392,6 +2407,7 @@ static void render_scene(void) {
|
||||
: fx_blocks ? "a window is above it and screen effects need the whole scene"
|
||||
: !g_zero_copy ? "zero-copy presentation is off"
|
||||
: framegen ? "frame generation needs the compositor pass"
|
||||
: bfi ? "black frame insertion needs the compositor pass"
|
||||
: "it is not the one fullscreen window (only that one gets its own display layer)";
|
||||
}
|
||||
}
|
||||
@@ -2434,7 +2450,8 @@ static int on_fallback_timer(void *data) {
|
||||
}
|
||||
|
||||
static int commit_renders_on(void) {
|
||||
return g_render_on_commit && g_release_unpaced && !atomic_load(&g_stream_on) && !vkp_framegen_active();
|
||||
return g_render_on_commit && g_release_unpaced && !atomic_load(&g_stream_on) && !vkp_framegen_active() &&
|
||||
!g_bfi_running;
|
||||
}
|
||||
|
||||
static int render_on_commit(void) {
|
||||
@@ -2470,6 +2487,61 @@ static void on_commit_idle(void *data) {
|
||||
render_scene();
|
||||
}
|
||||
|
||||
/* Black frame insertion strobes on the display's refresh tick and paces the game to the lit refresh,
|
||||
* the design of BFI Presenter by artzox (https://github.com/artzox/BFI-Presenter, GPL-3.0), after Blur Busters'
|
||||
* research on MPRT and motion blur (https://blurbusters.com). No BFI Presenter code is used. */
|
||||
/* The panel's refresh from its display mode, not the measured tick rate: BFI's own presents can make ticks run
|
||||
* late under load, and a measured rate would then dip under the limit and switch BFI off and on many times a
|
||||
* second. 99 Hz lets panels that report 99.9 Hz for 100 Hz through. */
|
||||
#define BFI_MIN_REFRESH_MHZ 99000
|
||||
|
||||
static const char *bfi_blocked(void) {
|
||||
if (atomic_load(&g_stream_on)) return "the picture is being streamed";
|
||||
if (vkp_framegen_active()) return "frame generation is on";
|
||||
if (vkp_cardboard_active()) return "Cardboard VR is on";
|
||||
if (vkp_quest_layer_presentation()) return "this headset composes its own layers";
|
||||
if (g_scene_layer_only) return "the game's frames cannot be imported, so it is shown on its own display layer";
|
||||
if (atomic_load(&g_output_refresh_mhz) < BFI_MIN_REFRESH_MHZ) return "the screen runs below 100 Hz";
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void bfi_update(void) {
|
||||
const char *why = g_bfi ? bfi_blocked() : NULL;
|
||||
const int run = g_bfi && !why;
|
||||
if (g_bfi && why && why != g_bfi_blocked)
|
||||
droiddeck_log("bfi", "black frame insertion waits: %s", why);
|
||||
g_bfi_blocked = why;
|
||||
if (run == g_bfi_running) return;
|
||||
g_bfi_running = run;
|
||||
g_bfi_phase = 0;
|
||||
g_dirty = 1;
|
||||
if (run) {
|
||||
const int mhz = atomic_load(&g_output_refresh_mhz);
|
||||
droiddeck_log("bfi", "black frame insertion on: %.0f Hz screen, a black refresh after every picture, "
|
||||
"the game is paced to %.0f fps", mhz / 1000.0, mhz / 2000.0);
|
||||
} else {
|
||||
/* Lit refreshes advanced the frame deadline without being held to it; a stale one would stall rendering. */
|
||||
g_scene_due_ns = 0;
|
||||
droiddeck_log("bfi", "black frame insertion off");
|
||||
}
|
||||
}
|
||||
|
||||
static void bfi_tick(void) {
|
||||
/* A capture copies the surface's last buffer: present pictures only, still composed into that surface. */
|
||||
if (g_bfi_picture_hold) {
|
||||
g_bfi_phase = 0;
|
||||
g_bfi_stats.lit++;
|
||||
render_scene();
|
||||
} else if ((g_bfi_phase++ & 1) == 0) {
|
||||
g_bfi_stats.lit++;
|
||||
render_scene();
|
||||
} else if (vkp_render_plain(g_scene_w, g_scene_h) == 0) {
|
||||
g_bfi_stats.dark++;
|
||||
} else {
|
||||
g_bfi_stats.failed++;
|
||||
}
|
||||
}
|
||||
|
||||
static void on_vsync(int64_t frame_time_ns) {
|
||||
int64_t now = now_ns();
|
||||
g_perf.ticks++;
|
||||
@@ -2491,6 +2563,12 @@ static void on_vsync(int64_t frame_time_ns) {
|
||||
if (vkp_effects_sync()) tick_change = 1;
|
||||
if (vkp_cardboard_pose_changed()) tick_change = 1;
|
||||
if (tick_change) g_dirty = 1;
|
||||
bfi_update();
|
||||
if (g_bfi_running) {
|
||||
g_tick_held = 0;
|
||||
bfi_tick();
|
||||
return;
|
||||
}
|
||||
if (g_tick_held && g_dirty) g_hold_missed_ns = now;
|
||||
g_tick_held = 0;
|
||||
if (!tick_change && commit_renders_on() && g_dirty_since_ns && now - g_dirty_since_ns < g_refresh_ns &&
|
||||
@@ -3862,6 +3940,11 @@ static int on_stats_timer(void *data) {
|
||||
g_pace.renders, g_pace.commit_renders, (unsigned long long)game, g_pace.reattaches, g_pace.null_attaches, g_pace.distinct,
|
||||
g_pace.presented, g_pace.replaced, g_pace.undrawn);
|
||||
}
|
||||
if (g_bfi_stats.lit || g_bfi_stats.dark || g_bfi_stats.failed) {
|
||||
droiddeck_log("bfi", "last 10 s: %u pictures, %u black refreshes, %u black refreshes not presented",
|
||||
g_bfi_stats.lit, g_bfi_stats.dark, g_bfi_stats.failed);
|
||||
memset(&g_bfi_stats, 0, sizeof(g_bfi_stats));
|
||||
}
|
||||
{
|
||||
const uint64_t seen = g_game_frames;
|
||||
memset(&g_pace, 0, sizeof(g_pace));
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "quest_device.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
#include <sys/system_properties.h>
|
||||
#include <unistd.h>
|
||||
@@ -416,8 +417,13 @@ static void update_map(int scene_w, int scene_h) {
|
||||
if (mode == VKP_MODE_FILL) aspect = sx > sy ? sx : sy;
|
||||
else if (mode == VKP_MODE_INTEGER) {
|
||||
float m = sx < sy ? sx : sy;
|
||||
aspect = (float)(int)m;
|
||||
if (aspect < 1.0f) aspect = 1.0f;
|
||||
float nearest = roundf(m);
|
||||
if (nearest >= 1.0f && nearest > m &&
|
||||
nearest - m < 0.15f) {
|
||||
aspect = nearest;
|
||||
} else {
|
||||
aspect = m >= 1.0f ? (float)(int)m : m;
|
||||
}
|
||||
} else aspect = sx < sy ? sx : sy;
|
||||
g_map.kx = g_map.ky = aspect;
|
||||
g_map.off_x = (float)(g_map.rx + (int)((g_map.rw - scene_w * aspect) * 0.5f));
|
||||
@@ -2000,7 +2006,9 @@ static int render_impl(int scene_w, int scene_h, const struct vkp_draw *draws, i
|
||||
1 + vkp_framegen_extra_images(), vkp_framegen_extra_images() ? "s" : "");
|
||||
destroy_swapchain();
|
||||
}
|
||||
const int want_hdr = hf && !hf->tonemap && g_colorspace_ext && !g_swap_hdr_unavailable;
|
||||
/* A black refresh carries no HDR frame; it keeps the swapchain's colour mode rather than flipping it. */
|
||||
const int want_hdr = (g_plain_frame && !hf) ? (g_swapchain && g_swap_is_hdr)
|
||||
: (hf && !hf->tonemap && g_colorspace_ext && !g_swap_hdr_unavailable);
|
||||
if (g_swapchain && want_hdr != g_swap_is_hdr) {
|
||||
droiddeck_log("color", want_hdr ? "HDR frames with frame generation: rebuilding the screen swapchain as HDR10"
|
||||
: hf ? "HDR output switched off: rebuilding the screen swapchain as SDR (frames tone-mapped)"
|
||||
|
||||
@@ -42,6 +42,8 @@ extern void droiddeck_wayland_set_output_refresh_rate(int mhz);
|
||||
extern volatile int g_fps_limit;
|
||||
extern volatile int g_release_unpaced;
|
||||
extern volatile int g_render_on_commit;
|
||||
extern volatile int g_bfi;
|
||||
extern volatile int g_bfi_picture_hold;
|
||||
extern volatile int g_hide_shell;
|
||||
extern volatile int g_zero_copy;
|
||||
extern volatile unsigned g_zero_copy_last;
|
||||
@@ -669,6 +671,17 @@ Java_com_droiddeck_launcher_wayland_WaylandCompositor_nativeSetRenderOnCommit(JN
|
||||
__android_log_print(ANDROID_LOG_INFO, TAG, "render on commit %s", on ? "on" : "off");
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_droiddeck_launcher_wayland_WaylandCompositor_nativeSetBlackFrameInsertion(JNIEnv *env, jclass clazz, jboolean on) {
|
||||
g_bfi = on ? 1 : 0;
|
||||
__android_log_print(ANDROID_LOG_INFO, TAG, "black frame insertion %s", on ? "requested" : "off");
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_droiddeck_launcher_wayland_WaylandCompositor_nativeSetPictureHold(JNIEnv *env, jclass clazz, jboolean on) {
|
||||
g_bfi_picture_hold = on ? 1 : 0;
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_droiddeck_launcher_wayland_WaylandCompositor_nativeSetFpsLimit(JNIEnv *env, jclass clazz, jint fps) {
|
||||
g_fps_limit = fps > 0 ? fps : 0;
|
||||
|
||||
@@ -20,6 +20,7 @@ class App : Application() {
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
com.droiddeck.launcher.runtime.NativeGuest.init(this)
|
||||
Thread({ runCatching { EnhancedSessionLogShare.cleanupAbandonedStages(this) } }, "diagnostic-stage-cleanup").start()
|
||||
com.droiddeck.launcher.ui.Themes.loadGradient(this)
|
||||
com.droiddeck.launcher.ui.BuildWatermark.install(this)
|
||||
@@ -82,14 +83,17 @@ class App : Application() {
|
||||
Thread({
|
||||
runCatching {
|
||||
if (com.droiddeck.launcher.runtime.LinuxRuntime.rootDir(app).isDirectory) {
|
||||
com.droiddeck.launcher.core.AddonPack.PROOT.ensure(app)
|
||||
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)
|
||||
}
|
||||
if (com.droiddeck.launcher.stores.gog.GogComet.enabled(app)) com.droiddeck.launcher.core.AddonPack.COMET.ensure(app)
|
||||
if (com.droiddeck.launcher.stores.StoreAccounts.signedInAs(app, com.droiddeck.launcher.stores.Store.XBOX) != null)
|
||||
com.droiddeck.launcher.core.AddonPack.XBOX.ensure(app)
|
||||
if (com.droiddeck.launcher.stores.StoreAccounts.signedInAs(app, com.droiddeck.launcher.stores.Store.UBISOFT) != null)
|
||||
com.droiddeck.launcher.session.SessionFiles.ensureUbisoftService(app)
|
||||
if (com.droiddeck.launcher.stores.StoreAccounts.signedInAs(app, com.droiddeck.launcher.stores.Store.ROCKSTAR) != null)
|
||||
com.droiddeck.launcher.session.SessionFiles.ensureRockstarService(app)
|
||||
com.droiddeck.launcher.handtracking.HandTracking.load(app)
|
||||
}.onFailure { android.util.Log.w("App", "add-on pack prefetch failed", it) }
|
||||
}, "addon-packs").start()
|
||||
|
||||
@@ -195,6 +195,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
private var showPhantomGate by mutableStateOf(false)
|
||||
private var directAudio by mutableStateOf(false)
|
||||
private var picturePosition by mutableStateOf("center")
|
||||
private var integerScaling by mutableStateOf(false)
|
||||
private var stretch16x9 by mutableStateOf(false)
|
||||
private var orientation by mutableStateOf(android.content.pm.ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE)
|
||||
private var launcherOrientation by mutableStateOf(android.content.pm.ActivityInfo.SCREEN_ORIENTATION_USER)
|
||||
@@ -1862,15 +1863,24 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
}
|
||||
}
|
||||
|
||||
if (savedInstanceState == null) ui.post { startSteamAtStartupIfEnabled(cold = true) }
|
||||
else {
|
||||
val askAllFiles = Build.VERSION.SDK_INT >= 30 && com.droiddeck.launcher.files.AllFilesAccess.missing() &&
|
||||
!SessionPrefs.allFilesAsked(this)
|
||||
if (savedInstanceState == null) {
|
||||
if (!askAllFiles) ui.post { startSteamAtStartupIfEnabled(cold = true) }
|
||||
} else {
|
||||
restoreCompatLaunch(savedInstanceState)
|
||||
pendingSwitch = savedIntent(savedInstanceState, KEY_PENDING_SWITCH)
|
||||
savedIntent(savedInstanceState, KEY_SWITCHING_TO)?.let { awaitSessionEnd(it, savedInstanceState.getLong(KEY_SWITCH_DEADLINE)) }
|
||||
}
|
||||
|
||||
val wanted = ArrayList<String>()
|
||||
if (checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
|
||||
if (Build.VERSION.SDK_INT >= 30) {
|
||||
// From targetSdk 30, shared storage outside the app's own folders is all-files access or nothing.
|
||||
if (askAllFiles) {
|
||||
SessionPrefs.setAllFilesAsked(this)
|
||||
com.droiddeck.launcher.files.AllFilesAccess.open(this)
|
||||
}
|
||||
} else if (checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
|
||||
wanted.add(Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
||||
}
|
||||
if (SessionPrefs.micEnabled(this) && !SessionPrefs.micAsked(this)
|
||||
@@ -2551,6 +2561,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
backActionsInverted = backActionsInverted,
|
||||
directAudio = if (mode == SessionService.MODE_STEAM) directAudio else null,
|
||||
picturePosition = if (mode == SessionService.MODE_STEAM) picturePosition else null,
|
||||
integerScaling = if (mode == SessionService.MODE_STEAM) integerScaling else null,
|
||||
stretch16x9 = if (mode == SessionService.MODE_STEAM) stretch16x9 else null,
|
||||
mic = if (mode == SessionService.MODE_STEAM) mic else null,
|
||||
gameStorage = if (mode == SessionService.MODE_STEAM) gameStorage else null,
|
||||
@@ -2612,6 +2623,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
},
|
||||
onDirectAudio = { on -> SessionPrefs.setDirectAudio(this, on); directAudio = on },
|
||||
onPicturePosition = { value -> SessionPrefs.setPicturePosition(this, value); picturePosition = value },
|
||||
onIntegerScaling = { on -> SessionPrefs.setIntegerScaling(this, on); integerScaling = on },
|
||||
onStretch16x9 = { on -> SessionPrefs.setStretch16x9(this, on); stretch16x9 = on },
|
||||
onMic = { on ->
|
||||
SessionPrefs.setMicEnabled(this, on)
|
||||
@@ -2949,6 +2961,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
backActionsInverted = SessionPrefs.backActionsInverted(this)
|
||||
directAudio = SessionPrefs.directAudio(this)
|
||||
picturePosition = SessionPrefs.picturePosition(this)
|
||||
integerScaling = SessionPrefs.integerScaling(this)
|
||||
stretch16x9 = SessionPrefs.stretch16x9(this)
|
||||
mic = SessionPrefs.micEnabled(this)
|
||||
refreshWifiDiscovery()
|
||||
|
||||
@@ -173,11 +173,12 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
private var adaptiveSticks by mutableStateOf<Boolean?>(null)
|
||||
private var quickButtons by mutableStateOf<Map<InputCommand, Boolean>>(emptyMap())
|
||||
private var picturePosition by mutableStateOf("center")
|
||||
private var integerScaling by mutableStateOf(false)
|
||||
|
||||
private fun applyGameAlignment() {
|
||||
if (!CompositorHost.isStarted) return
|
||||
val active = SessionState.mode == SessionService.MODE_STEAM &&
|
||||
!pipUi && !isInPictureInPictureMode && !cardboard.enabled
|
||||
!pipUi && !isInPictureInPictureMode && !activeCardboard.enabled
|
||||
val alignment = if (!active) ALIGN_CENTER else when (picturePosition) {
|
||||
"top" -> ALIGN_PICTURE_TOP
|
||||
"bottom" -> ALIGN_PICTURE_BOTTOM
|
||||
@@ -185,7 +186,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
"right" -> ALIGN_PICTURE_RIGHT
|
||||
else -> ALIGN_CENTER
|
||||
}
|
||||
WaylandCompositor.nativeSetScaleMode(SCALE_FIT, alignment)
|
||||
WaylandCompositor.nativeSetScaleMode(if (active && integerScaling) SCALE_INTEGER else SCALE_FIT, alignment)
|
||||
}
|
||||
private var unfoldedPanel by mutableStateOf<OnScreenControls?>(null)
|
||||
private var unfoldedColumn: android.widget.LinearLayout? = null
|
||||
@@ -499,6 +500,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
private var drawerGameProfileId by mutableStateOf<Long?>(null)
|
||||
private var drawerGameProfileSelectionMade = false
|
||||
private var fpsLimit by mutableStateOf(SessionState.fpsLimit)
|
||||
private var blackFrameInsertion by mutableStateOf(false)
|
||||
|
||||
private fun noSteamSession(): Boolean = (SessionState.mode == SessionService.MODE_RUN &&
|
||||
SessionState.program in setOf(
|
||||
@@ -848,6 +850,11 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
}
|
||||
SteamControllerBle.listener = { uiHandler.post { updatePadMotion(); refreshControls() } }
|
||||
steamController = SteamControllerBle(this, inputRouter).also { it.start() }
|
||||
if (Build.VERSION.SDK_INT >= 31 && checkSelfPermission(BLUETOOTH_CONNECT) != android.content.pm.PackageManager.PERMISSION_GRANTED &&
|
||||
!SessionPrefs.bluetoothAsked(this)) {
|
||||
SessionPrefs.setBluetoothAsked(this)
|
||||
requestPermissions(arrayOf(BLUETOOTH_CONNECT), REQUEST_BLUETOOTH)
|
||||
}
|
||||
padMotion = com.droiddeck.launcher.input.PadMotion(this) {
|
||||
@Suppress("DEPRECATION")
|
||||
(if (Build.VERSION.SDK_INT >= 30) display else windowManager.defaultDisplay)?.rotation ?: android.view.Surface.ROTATION_0
|
||||
@@ -1085,7 +1092,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
secondScreenPresentation?.closeFieldKeyboard()
|
||||
}
|
||||
}
|
||||
androidx.compose.runtime.LaunchedEffect(picturePosition, SessionState.running, pipUi, cardboard.enabled) { applyGameAlignment() }
|
||||
androidx.compose.runtime.LaunchedEffect(picturePosition, integerScaling, SessionState.running, pipUi, cardboard.enabled) { applyGameAlignment() }
|
||||
DroidDeckTheme {
|
||||
if (pipUi) {
|
||||
if (SessionState.suspended) androidx.compose.foundation.layout.Box(
|
||||
@@ -1440,6 +1447,12 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
onHudReset = { hudConfig = DroidDeckHudConfig.reset(this@SessionActivity); hud.applyConfig() },
|
||||
onHudOrderReset = { hudConfig = DroidDeckHudConfig.clearOrder(this@SessionActivity); hud.applyConfig() },
|
||||
onHudExport = { exportHudDiagnostics() },
|
||||
integerScaling = integerScaling,
|
||||
onIntegerScaling = { enabled ->
|
||||
SessionPrefs.setIntegerScaling(this@SessionActivity, enabled)
|
||||
integerScaling = enabled
|
||||
applyGameAlignment()
|
||||
},
|
||||
onUpscaler = { m ->
|
||||
val target = effectsEditorTarget ?: screenEffectsTarget
|
||||
val activeProfileId =
|
||||
@@ -1587,6 +1600,13 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
fpsLimit = fps
|
||||
applyOutputPacing()
|
||||
},
|
||||
blackFrameInsertion = blackFrameInsertion,
|
||||
blackFrameInsertionAvailable = blackFrameInsertion || blackFrameInsertionAvailable(),
|
||||
onBlackFrameInsertion = { on ->
|
||||
SessionPrefs.setBlackFrameInsertion(this@SessionActivity, on)
|
||||
blackFrameInsertion = on
|
||||
CompositorHost.setBlackFrameInsertion(on, refreshHz(), outputFpsLimit())
|
||||
},
|
||||
onFrameGenPick = { mode ->
|
||||
val appId = frameGenTargetGameId()
|
||||
|
||||
@@ -2399,7 +2419,9 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
unfoldedControls = SessionPrefs.unfoldedControls(this)
|
||||
unfoldedControlsWithController = SessionPrefs.unfoldedControlsWithController(this)
|
||||
picturePosition = SessionPrefs.picturePosition(this)
|
||||
integerScaling = SessionPrefs.integerScaling(this)
|
||||
hudOn = SessionPrefs.hudEnabled(this)
|
||||
blackFrameInsertion = SessionPrefs.blackFrameInsertion(this)
|
||||
hudConfig = DroidDeckHudConfig.load(this)
|
||||
hudColor = SessionPrefs.hudColor(this)
|
||||
hudOpacity = SessionPrefs.hudOpacity(this)
|
||||
@@ -2589,7 +2611,10 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
runCatching { com.droiddeck.launcher.runtime.RuntimeInstallService.start(this, release) }
|
||||
val ok = com.droiddeck.launcher.runtime.LinuxRuntimeInstaller.install(this, release,
|
||||
progressFor(RUNTIME_LINES, release.size / 1_000_000))
|
||||
if (ok) return null
|
||||
if (ok) {
|
||||
com.droiddeck.launcher.session.SessionFiles.ensureDirtStandIn(this)
|
||||
return null
|
||||
}
|
||||
SessionEvents.record("runtime.failed", mapOf("step" to "install", "reason" to com.droiddeck.launcher.runtime.LinuxRuntimeInstaller.installError()))
|
||||
return getString(R.string.session_runtime_install_failed)
|
||||
}
|
||||
@@ -2651,7 +2676,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
runCatching { GameEnvironmentStore.publish(this) }
|
||||
.onFailure { Log.e(TAG, "Could not update game environment", it) }
|
||||
}, "game-env-publish").start()
|
||||
WaylandCompositor.nativeSetScaleMode(SCALE_FIT, ALIGN_CENTER)
|
||||
applyGameAlignment()
|
||||
val activeProfileId = currentScreenEffectsProfileId()
|
||||
val activeUpscaler = SessionPrefs.screenEffectsUpscaler(this, activeProfileId)
|
||||
val activeEffects = SessionPrefs.screenEffects(this, activeProfileId)
|
||||
@@ -2866,6 +2891,17 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
return if (capped > 1f) capped else 60f
|
||||
}
|
||||
|
||||
private fun blackFrameInsertionAvailable(): Boolean {
|
||||
// Glasses that present the game run at their own rate, uncapped, as refreshHz() reads them.
|
||||
glassesScreen?.display?.let { glasses ->
|
||||
return (glasses.supportedModes?.maxOfOrNull { it.refreshRate } ?: 0f) >= PerfMode.BFI_MIN_REFRESH_HZ
|
||||
}
|
||||
val display = bottomGame?.takeIf { bottomOutputActive }?.display
|
||||
?: if (Build.VERSION.SDK_INT >= 30) display else @Suppress("DEPRECATION") windowManager.defaultDisplay
|
||||
val peak = display?.supportedModes?.maxOfOrNull { it.refreshRate } ?: 0f
|
||||
return minOf(peak, PerfMode.peakRefreshCap(this)) >= PerfMode.BFI_MIN_REFRESH_HZ
|
||||
}
|
||||
|
||||
private fun mirrorRefreshLimit(): Int =
|
||||
GlassesRendering.mirrorRefreshLimit(glassesSettings, glasses, glassesScreen != null)
|
||||
|
||||
@@ -4189,19 +4225,35 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
onFrame(null)
|
||||
return
|
||||
}
|
||||
try {
|
||||
android.view.PixelCopy.request(source, bitmap, { result ->
|
||||
if (result != android.view.PixelCopy.SUCCESS) {
|
||||
bitmap.recycle()
|
||||
onFrame(null)
|
||||
} else onFrame(bitmap)
|
||||
}, uiHandler)
|
||||
} catch (_: IllegalArgumentException) {
|
||||
bitmap.recycle()
|
||||
onFrame(null)
|
||||
withPictureFrame { done ->
|
||||
try {
|
||||
android.view.PixelCopy.request(source, bitmap, { result ->
|
||||
done()
|
||||
if (result != android.view.PixelCopy.SUCCESS) {
|
||||
bitmap.recycle()
|
||||
onFrame(null)
|
||||
} else onFrame(bitmap)
|
||||
}, uiHandler)
|
||||
} catch (_: IllegalArgumentException) {
|
||||
done()
|
||||
bitmap.recycle()
|
||||
onFrame(null)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** PixelCopy reads the last queued buffer, which black frame insertion makes black every other refresh. */
|
||||
private fun withPictureFrame(copy: (done: () -> Unit) -> Unit) {
|
||||
if (!CompositorHost.holdPicture()) return copy {}
|
||||
uiHandler.postDelayed({
|
||||
var released = false
|
||||
copy {
|
||||
if (!released) CompositorHost.releasePicture()
|
||||
released = true
|
||||
}
|
||||
}, BFI_PICTURE_SETTLE_MS)
|
||||
}
|
||||
|
||||
private fun tapSteamButton() {
|
||||
if (SessionState.mode == SessionService.MODE_STEAM) padBridge?.triggerSteamMenu()
|
||||
}
|
||||
@@ -4633,25 +4685,18 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
gamePictureBounds[2], gamePictureBounds[3]
|
||||
)
|
||||
|
||||
val nativeWidth: Int
|
||||
val nativeHeight: Int
|
||||
if (glassesOutputActive) {
|
||||
val mode = glassesScreen?.display?.mode ?: return null
|
||||
val outputWidth = mode.physicalWidth.takeIf { it > 0 } ?: return null
|
||||
val outputHeight = mode.physicalHeight.takeIf { it > 0 } ?: return null
|
||||
val scaleX = width.toFloat() / outputWidth
|
||||
val scaleY = height.toFloat() / outputHeight
|
||||
|
||||
return android.graphics.RectF(
|
||||
rect.left * scaleX,
|
||||
rect.top * scaleY,
|
||||
rect.right * scaleX,
|
||||
rect.bottom * scaleY
|
||||
)
|
||||
nativeWidth = mode.physicalWidth.takeIf { it > 0 } ?: return null
|
||||
nativeHeight = mode.physicalHeight.takeIf { it > 0 } ?: return null
|
||||
} else {
|
||||
val nativeSize = IntArray(2)
|
||||
if (!WaylandCompositor.nativeOutputSize(nativeSize)) return null
|
||||
nativeWidth = nativeSize[0].takeIf { it > 0 } ?: return null
|
||||
nativeHeight = nativeSize[1].takeIf { it > 0 } ?: return null
|
||||
}
|
||||
|
||||
val nativeSize = IntArray(2)
|
||||
if (!WaylandCompositor.nativeOutputSize(nativeSize)) return null
|
||||
val nativeWidth = nativeSize[0].takeIf { it > 0 } ?: return null
|
||||
val nativeHeight = nativeSize[1].takeIf { it > 0 } ?: return null
|
||||
val scaleX = width.toFloat() / nativeWidth
|
||||
val scaleY = height.toFloat() / nativeHeight
|
||||
|
||||
@@ -4860,7 +4905,8 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
private fun dispatchDirectTouch(event: MotionEvent): Boolean {
|
||||
val rect = drawnRect() ?: return false
|
||||
if (event.actionMasked == MotionEvent.ACTION_DOWN)
|
||||
ignoreGameTouch = topPictureMapped && !rect.contains(event.x, event.y)
|
||||
ignoreGameTouch = topPictureMapped && !glassesOutputActive &&
|
||||
!rect.contains(event.x, event.y)
|
||||
if (ignoreGameTouch) {
|
||||
if (event.actionMasked == MotionEvent.ACTION_DOWN) {
|
||||
directTouchHold.cancel()
|
||||
@@ -5312,17 +5358,21 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
val left = surfaceAt[0] - overlayAt[0]
|
||||
val top = surfaceAt[1] - overlayAt[1]
|
||||
val bounds = android.graphics.Rect(left, top, left + width, top + height)
|
||||
try {
|
||||
android.view.PixelCopy.request(surfaceView, bitmap, { result ->
|
||||
if (result == android.view.PixelCopy.SUCCESS && !isDestroyed) {
|
||||
pausedFrame = com.droiddeck.launcher.ui.PausedFrame(bitmap.asImageBitmap(), bounds)
|
||||
pausedFrameWanted = false
|
||||
} else {
|
||||
bitmap.recycle()
|
||||
}
|
||||
}, uiHandler)
|
||||
} catch (_: IllegalArgumentException) {
|
||||
bitmap.recycle()
|
||||
withPictureFrame { done ->
|
||||
try {
|
||||
android.view.PixelCopy.request(surfaceView, bitmap, { result ->
|
||||
done()
|
||||
if (result == android.view.PixelCopy.SUCCESS && !isDestroyed) {
|
||||
pausedFrame = com.droiddeck.launcher.ui.PausedFrame(bitmap.asImageBitmap(), bounds)
|
||||
pausedFrameWanted = false
|
||||
} else {
|
||||
bitmap.recycle()
|
||||
}
|
||||
}, uiHandler)
|
||||
} catch (_: IllegalArgumentException) {
|
||||
done()
|
||||
bitmap.recycle()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5386,7 +5436,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
listOf(PointerGestures.BTN_LEFT, PointerGestures.BTN_RIGHT, PointerGestures.BTN_MIDDLE).forEach {
|
||||
heldButtons.set(1, it, false)
|
||||
}
|
||||
WaylandCompositor.nativeSetScaleMode(SCALE_FIT, ALIGN_CENTER)
|
||||
applyGameAlignment()
|
||||
}
|
||||
} else if (!isFinishing && !isDestroyed) {
|
||||
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
|
||||
@@ -5747,6 +5797,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
cardboard = c
|
||||
val e = effectiveCardboard(c)
|
||||
activeCardboard = e
|
||||
applyGameAlignment()
|
||||
if (CompositorHost.isStarted) pushCardboard(e)
|
||||
if (e.enabled && !was.enabled) headTracker?.recenter()
|
||||
updateHeadTracker()
|
||||
@@ -6314,8 +6365,17 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
finish()
|
||||
}
|
||||
|
||||
override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<out String>, grantResults: IntArray) {
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults)
|
||||
if (requestCode != REQUEST_BLUETOOTH || grantResults.firstOrNull() != android.content.pm.PackageManager.PERMISSION_GRANTED) return
|
||||
steamController?.stop()
|
||||
steamController = SteamControllerBle(this, inputRouter).also { it.start() }
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val EXTRA_RETURN_HOME = "returnHome"
|
||||
private const val BLUETOOTH_CONNECT = "android.permission.BLUETOOTH_CONNECT"
|
||||
private const val REQUEST_BLUETOOTH = 31
|
||||
const val EXTRA_LINK_TASK = "linkTask"
|
||||
const val EXTRA_STEAMVR = "steamVr"
|
||||
const val EXTRA_PLAYED_GAME = "com.droiddeck.launcher.PLAYED_GAME"
|
||||
@@ -6323,6 +6383,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
private const val LEAVE_TIMEOUT_MS = 1_500L
|
||||
private const val TEXT_FIELD_TAP_MS = 1_000L
|
||||
private const val PAUSED_FRAME_MAX_EDGE = 1920f
|
||||
private const val BFI_PICTURE_SETTLE_MS = 50L
|
||||
private const val PAUSED_FRAME_REDRAW_MS = 150L
|
||||
private const val BOTTOM_RECOVERY_MS = 1_000L
|
||||
private const val BOTTOM_RECOVERY_TRIES = 3
|
||||
@@ -6366,6 +6427,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
private val steamVrWorker = java.util.concurrent.ThreadPoolExecutor(0, 1, 30, java.util.concurrent.TimeUnit.SECONDS,
|
||||
java.util.concurrent.LinkedBlockingQueue()) { Thread(it, "steamvr") }
|
||||
private const val SCALE_FIT = 1
|
||||
private const val SCALE_INTEGER = 4
|
||||
private const val ALIGN_CENTER = 0
|
||||
private const val ALIGN_PICTURE_TOP = 3
|
||||
private const val ALIGN_PICTURE_BOTTOM = 4
|
||||
|
||||
@@ -84,6 +84,7 @@ object AgentChats {
|
||||
internal fun encode(entry: Entry): String = when (entry) {
|
||||
is Entry.Asked -> JSONObject().put("asked", entry.text).apply { if (entry.files.isNotEmpty()) put("files", JSONArray(entry.files)) }
|
||||
is Entry.Said -> JSONObject().put("said", entry.text)
|
||||
is Entry.Notice -> JSONObject().put("notice", entry.text)
|
||||
is Entry.Thought -> JSONObject().put("thought", entry.text)
|
||||
is Entry.Result -> JSONObject().put("result", entry.id).put("output", entry.output).put("failed", entry.failed)
|
||||
is Entry.Used -> JSONObject().put("used", entry.tool).put("detail", entry.detail).put("id", entry.id).put("input", entry.input)
|
||||
@@ -119,6 +120,7 @@ object AgentChats {
|
||||
private fun decode(o: JSONObject): Entry? = when {
|
||||
o.has("asked") -> Entry.Asked(o.getString("asked"), o.optJSONArray("files")?.let { a -> (0 until a.length()).map { a.getString(it) } }.orEmpty())
|
||||
o.has("said") -> Entry.Said(o.getString("said"))
|
||||
o.has("notice") -> Entry.Notice(o.getString("notice"))
|
||||
o.has("thought") -> Entry.Thought(o.getString("thought"))
|
||||
o.has("used") -> Entry.Used(o.optString("id"), o.getString("used"), o.optString("detail"), o.optString("input"),
|
||||
if (o.has("output")) o.optString("output") else null, o.optBoolean("failed"), o.optString("parent"))
|
||||
|
||||
@@ -5,7 +5,7 @@ import org.json.JSONArray
|
||||
import org.json.JSONObject
|
||||
import java.io.File
|
||||
|
||||
/** One coding agent CLI in the Linux userland, run one process per turn. */
|
||||
/** One coding agent CLI in the Linux userland, run one process per turn (or kept open, see [input]). */
|
||||
interface AgentHarness {
|
||||
val id: String
|
||||
val name: String
|
||||
@@ -27,8 +27,18 @@ interface AgentHarness {
|
||||
fun models(rootfs: File): List<Model>
|
||||
/** The guest command for one turn; [conversation] is null for the first one. */
|
||||
fun turn(message: String, conversation: String?, options: Options): List<String>
|
||||
/**
|
||||
* The line that hands [message] to a [turn] process over stdin, or null when the message is already in the
|
||||
* command. A process that takes its messages this way stays open between turns, so work it started in the
|
||||
* background can wake it, as it does in the CLI's own terminal.
|
||||
*/
|
||||
fun input(message: String): String? = null
|
||||
/** One line of the CLI's output, or null when it carries nothing to show. */
|
||||
fun parse(line: String): AgentEvent?
|
||||
/** The folder, under the userland's root, where the CLI loads user skills (`<name>/SKILL.md`). */
|
||||
val skills: String
|
||||
/** The CLI's global instructions file under the userland's root, where DroidDeck keeps its rules in a marked block. */
|
||||
val instructions: String
|
||||
/** Sets the CLI's own defaults in the userland before it runs; [rootfs] is the userland's root. */
|
||||
fun prepare(rootfs: File) {}
|
||||
/** Context and plan limits the CLI keeps on disk rather than printing, read once a turn of [conversation] is done. */
|
||||
@@ -56,9 +66,13 @@ data class AgentEvent(
|
||||
val window: Long? = null,
|
||||
val limits: List<AgentHost.Limit>? = null,
|
||||
val usage: AgentHost.Usage? = null,
|
||||
/** This ends a turn the CLI started itself, such as the answer to a finished background task. */
|
||||
val background: Boolean = false,
|
||||
/** The error a background turn ended with, if it failed. */
|
||||
val backgroundError: String? = null,
|
||||
)
|
||||
|
||||
/** Claude Code: `claude -p` with stream-json output, resumed by session id. */
|
||||
/** Claude Code: `claude -p` with stream-json input and output, resumed by session id. */
|
||||
object ClaudeCode : AgentHarness {
|
||||
override val id = "claude"
|
||||
override val name = "Claude Code"
|
||||
@@ -73,6 +87,8 @@ object ClaudeCode : AgentHarness {
|
||||
* Commits and pull requests the agent makes carry no Claude Code credit or co-author line by
|
||||
* default. Only keys the user has not set are written, so their own choice stays.
|
||||
*/
|
||||
override val skills = "root/.claude/skills"
|
||||
override val instructions = "root/.claude/CLAUDE.md"
|
||||
override fun prepare(rootfs: File) {
|
||||
val file = File(rootfs, "root/.claude/settings.json")
|
||||
val settings = if (file.exists()) runCatching { JSONObject(file.readText()) }.getOrNull() ?: return else JSONObject()
|
||||
@@ -97,7 +113,7 @@ object ClaudeCode : AgentHarness {
|
||||
|
||||
// DroidDeck runs the agent unattended on the user's own device; permission prompts have no one to answer them.
|
||||
override fun turn(message: String, conversation: String?, options: AgentHarness.Options) = buildList {
|
||||
addAll(listOf(binary, "-p", message, "--output-format", "stream-json", "--verbose", "--include-partial-messages"))
|
||||
addAll(listOf(binary, "-p", "--input-format", "stream-json", "--output-format", "stream-json", "--verbose", "--include-partial-messages"))
|
||||
addAll(listOf("--permission-mode", if (options.plan) "plan" else "bypassPermissions"))
|
||||
options.model?.let { addAll(listOf("--model", it)) }
|
||||
options.effort?.let { addAll(listOf("--effort", it)) }
|
||||
@@ -105,6 +121,11 @@ object ClaudeCode : AgentHarness {
|
||||
if (conversation != null) addAll(listOf("--resume", conversation))
|
||||
}
|
||||
|
||||
override fun input(message: String): String? = JSONObject()
|
||||
.put("type", "user")
|
||||
.put("message", JSONObject().put("role", "user").put("content", JSONArray().put(JSONObject().put("type", "text").put("text", message))))
|
||||
.toString()
|
||||
|
||||
override fun parse(line: String): AgentEvent? {
|
||||
val o = runCatching { JSONObject(line) }.getOrNull() ?: return null
|
||||
val conversation = o.optString("session_id").takeIf { it.isNotEmpty() }
|
||||
@@ -130,7 +151,11 @@ object ClaudeCode : AgentHarness {
|
||||
"thinking" -> if (parent != null) null else block.optString("thinking").trim().takeIf { it.isNotEmpty() }?.let { AgentHost.Entry.Thought(it) }
|
||||
"tool_use" -> {
|
||||
val input = block.optJSONObject("input")
|
||||
AgentHost.Entry.Used(block.optString("id"), block.optString("name"), detail(input), fullInput(block.optString("name"), input), parent = parent.orEmpty())
|
||||
AgentHost.Entry.Used(
|
||||
block.optString("id"), block.optString("name"), detail(input), fullInput(block.optString("name"), input),
|
||||
parent = parent.orEmpty(),
|
||||
background = input?.optBoolean("run_in_background") == true || block.optString("name") == "Monitor",
|
||||
)
|
||||
}
|
||||
else -> null
|
||||
}
|
||||
@@ -148,17 +173,25 @@ object ClaudeCode : AgentHarness {
|
||||
AgentEvent(conversation, results)
|
||||
}
|
||||
"rate_limit_event" -> AgentEvent(conversation, limits = limits(o.optJSONObject("rate_limit_info")))
|
||||
// A resumed session first answers background tasks the last run left behind; that result is not the turn's.
|
||||
"result" -> if (o.optJSONObject("origin")?.optString("kind") == "task-notification") conversation?.let { AgentEvent(it) } else AgentEvent(
|
||||
conversation,
|
||||
listOf(AgentHost.Entry.Finished(if (o.optBoolean("is_error")) o.optString("result").ifEmpty { o.optString("subtype") } else null)),
|
||||
window = window(o.optJSONObject("modelUsage")),
|
||||
usage = AgentHost.Usage(
|
||||
// The CLI starts turns of its own for background tasks (a resumed session first answers the ones the last
|
||||
// run left behind). Such a result is not the end of the user's turn; the host decides what it ends.
|
||||
"result" -> {
|
||||
val usage = AgentHost.Usage(
|
||||
o.optLong("duration_ms"), o.optDouble("total_cost_usd", 0.0),
|
||||
o.optJSONObject("usage")?.let { it.optLong("input_tokens") + it.optLong("cache_read_input_tokens") + it.optLong("cache_creation_input_tokens") } ?: 0,
|
||||
o.optJSONObject("usage")?.optLong("output_tokens") ?: 0,
|
||||
),
|
||||
)
|
||||
)
|
||||
if (o.optJSONObject("origin")?.optString("kind") == "task-notification") AgentEvent(
|
||||
conversation, usage = usage, background = true,
|
||||
backgroundError = if (o.optBoolean("is_error")) o.optString("result").ifEmpty { o.optString("subtype") } else null,
|
||||
)
|
||||
else AgentEvent(
|
||||
conversation,
|
||||
listOf(AgentHost.Entry.Finished(if (o.optBoolean("is_error")) o.optString("result").ifEmpty { o.optString("subtype") } else null)),
|
||||
window = window(o.optJSONObject("modelUsage")),
|
||||
usage = usage,
|
||||
)
|
||||
}
|
||||
else -> conversation?.let { AgentEvent(it) }
|
||||
}
|
||||
}
|
||||
@@ -227,6 +260,8 @@ object Codex : AgentHarness {
|
||||
override val id = "codex"
|
||||
override val name = "Codex"
|
||||
override val binary = "/root/.local/bin/codex"
|
||||
override val skills = "root/.codex/skills"
|
||||
override val instructions = "root/.codex/AGENTS.md"
|
||||
// Code mode runs in a helper that each release ships as its own download.
|
||||
private const val HOST = "/root/.local/bin/codex-code-mode-host"
|
||||
override val files get() = listOf(binary, HOST)
|
||||
|
||||
@@ -21,18 +21,23 @@ import java.nio.file.Files
|
||||
|
||||
/**
|
||||
* The launcher's agent: a coding agent CLI ([AgentHarness]) from the Linux userland, run headless
|
||||
* one process per turn, outside any game or desktop session. Conversations are kept on disk
|
||||
* outside any game or desktop session: one process per turn, or for a CLI that takes its messages over
|
||||
* stdin one process kept open between turns, so background work can start a turn of its own. Conversations are kept on disk
|
||||
* ([AgentChats]), so a restart (a Lab build, a crash) continues the same one.
|
||||
*/
|
||||
object AgentHost {
|
||||
sealed interface Entry {
|
||||
data class Asked(val text: String, val files: List<String> = emptyList()) : Entry
|
||||
data class Said(val text: String) : Entry
|
||||
data class Notice(val text: String) : Entry
|
||||
data class Thought(val text: String) : Entry
|
||||
/** A tool call; [output] stays null until its result arrives. [parent] is the subagent call it was made under, if any. */
|
||||
/**
|
||||
* A tool call; [output] stays null until its result arrives. [parent] is the subagent call it was made under, if any.
|
||||
* [background]: the call starts work that can wake the CLI after its turn (run_in_background, Monitor).
|
||||
*/
|
||||
data class Used(
|
||||
val id: String, val tool: String, val detail: String, val input: String = "", val output: String? = null, val failed: Boolean = false,
|
||||
val parent: String = "",
|
||||
val parent: String = "", val background: Boolean = false,
|
||||
) : Entry
|
||||
data class Result(val id: String, val output: String, val failed: Boolean) : Entry
|
||||
/** [planned]: the turn ran in plan mode, so it ends on a plan that nothing has carried out yet. */
|
||||
@@ -63,18 +68,10 @@ object AgentHost {
|
||||
@VisibleForTesting
|
||||
internal const val BRIEF = "You run inside DroidDeck on the user's handheld, in its Linux userland (Ubuntu under proot, aarch64), " +
|
||||
"and the user talks to you from DroidDeck's Agent tab, often on a small screen, so keep replies short. " +
|
||||
"droiddeckctl inspects and drives the app over loopback adb (\$ADB_SERIAL); its guide is ${AgentSetup.CTL}/agent-control.md. " +
|
||||
"Steam, the desktop and games run in DroidDeck's session, a separate guest from yours: a program you start here is not in it and has no screen. " +
|
||||
"Reach the session through droiddeckctl: state, start steam, stop, launch, quit, focus, screenshot, logs, and guest to run a command inside it. " +
|
||||
"Starting, stopping or restarting a session leaves you running. " +
|
||||
"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. " +
|
||||
"Never kill by a command-line pattern (pkill -f, pgrep -f piped to kill): your own command line holds the user's message, so the pattern matches you. " +
|
||||
"End a game with droiddeckctl quit, the session with droiddeckctl stop, anything else by its pid. " +
|
||||
"dd-lab-build builds the checkout as a Lab build and restarts DroidDeck on it (docs/lab-builds.md). DroidDeck runs the build in a " +
|
||||
"process of its own and shows the user its progress and time left; dd-lab-build follows that build's log until it is done. " +
|
||||
"Run it with run_in_background and keep checking its output, so the user can talk to you meanwhile. " +
|
||||
"The restart ends this process, and this conversation continues on the new build. " +
|
||||
"Files the user attaches are listed at the end of their message, under /root/.cache/droiddeck/attachments. " +
|
||||
"Commits and pull requests you make are the user's own: add no co-author line, AI credit or generated-by note. " +
|
||||
"To have the user pick between options, end your reply with a fenced code block whose language is choices, one short option per line, " +
|
||||
"and end your turn: DroidDeck shows them as buttons and sends the one picked as the next message."
|
||||
|
||||
@@ -126,10 +123,24 @@ object AgentHost {
|
||||
var lab by mutableStateOf<LabProgress?>(null)
|
||||
private set
|
||||
|
||||
private class Turn(val process: Process, val pid: Int)
|
||||
private class Turn(val process: Process, val pid: Int, val stdin: java.io.OutputStream? = null) {
|
||||
var writingGeneration: Int? = null
|
||||
var exitStatus: Int? = null
|
||||
var costs: AgentCostTracker? = null
|
||||
var clearingCosts = false
|
||||
}
|
||||
|
||||
private val main = Handler(Looper.getMainLooper())
|
||||
private var turn: Turn? = null
|
||||
/**
|
||||
* The CLI process when it takes its messages over stdin. It outlives a turn, so work it started in the
|
||||
* background can wake it: the answer to a finished task then arrives without a message from the user.
|
||||
*/
|
||||
private var session: Turn? = null
|
||||
private var sessionKey: String? = null
|
||||
/** The running turn is one the CLI started itself, not an answer to the user. */
|
||||
private var background = false
|
||||
private val reap = Runnable { if (state != State.WORKING) dropSession() }
|
||||
/** Counts turns, so a process that starts after its turn was stopped is not adopted by the next one. */
|
||||
private var generation = 0
|
||||
private var labProcess: Process? = null
|
||||
@@ -142,6 +153,8 @@ object AgentHost {
|
||||
private var turnPlanned = false
|
||||
private var loaded = false
|
||||
private var appContext: Context? = null
|
||||
/** A tool call in this CLI process started work that can wake it after its turn (run_in_background). */
|
||||
private var launchedBackground = false
|
||||
|
||||
val turnPid: Int get() = turn?.pid ?: 0
|
||||
|
||||
@@ -197,6 +210,7 @@ object AgentHost {
|
||||
AgentSetup.forget()
|
||||
refresh(app)
|
||||
}
|
||||
dropSession()
|
||||
load(app, id)
|
||||
prefs(app).edit().putString(CHAT_KEY, id).apply()
|
||||
}
|
||||
@@ -285,11 +299,42 @@ object AgentHost {
|
||||
live = ""
|
||||
liveThinking = ""
|
||||
turnStarted = SystemClock.elapsedRealtime()
|
||||
AgentHostService.start(app)
|
||||
AgentHostService.start(app)?.let { serviceWarning(app, it) }
|
||||
val current = harness
|
||||
val prompt = AgentAttachments.prompt(message, attached)
|
||||
turnPlanned = plan && current.plans
|
||||
val command = current.turn(prompt, conversation, AgentHarness.Options(model, turnPlanned, BRIEF, effort))
|
||||
val options = AgentHarness.Options(model, turnPlanned, BRIEF, effort)
|
||||
val command = current.turn(prompt, conversation, options)
|
||||
val line = current.input(prompt)
|
||||
val key = "${current.id}|$id|$model|$turnPlanned|$effort"
|
||||
background = false
|
||||
val kept = session
|
||||
if (kept != null && line != null && sessionKey == key && kept.process.isAlive) {
|
||||
main.removeCallbacks(reap)
|
||||
turn = kept
|
||||
kept.writingGeneration = gen
|
||||
kept.clearingCosts = prompt == "/clear"
|
||||
Thread({
|
||||
val written = runCatching { synchronized(kept) { kept.stdin?.apply { write((line + "\n").toByteArray()); flush() } != null } }.getOrDefault(false)
|
||||
// The process died between turns: the same message goes to a new one, which resumes the conversation.
|
||||
main.post {
|
||||
if (kept.writingGeneration == gen) kept.writingGeneration = null
|
||||
if (generation == gen && session === kept) {
|
||||
if (!written) {
|
||||
dropSession()
|
||||
turn = null
|
||||
spawn(app, gen, current, current.turn(prompt, conversation, options), line, key)
|
||||
} else kept.exitStatus?.let { processExited(app, kept, current, it) }
|
||||
}
|
||||
}
|
||||
}, "agent-input").start()
|
||||
return
|
||||
}
|
||||
dropSession()
|
||||
spawn(app, gen, current, command, line, key)
|
||||
}
|
||||
|
||||
private fun spawn(app: Context, gen: Int, current: AgentHarness, command: List<String>, line: String?, key: String) {
|
||||
val workdir = workspace(app)
|
||||
var threadConversation = conversation
|
||||
Thread({
|
||||
@@ -304,40 +349,100 @@ object AgentHost {
|
||||
main.post { if (generation == gen) finish(app, e.message ?: "could not start") }
|
||||
return@Thread
|
||||
}
|
||||
val started = Turn(child, AgentProcesses.pidOf(child))
|
||||
val started = Turn(child, AgentProcesses.pidOf(child), if (line != null) child.outputStream else null).apply {
|
||||
if (current === ClaudeCode && line != null) costs = AgentCostTracker()
|
||||
}
|
||||
OrphanReaper.keep(started.pid)
|
||||
main.post { if (generation == gen && state == State.WORKING && turn == null) turn = started else AgentProcesses.killTree(started.pid) }
|
||||
child.outputStream.close()
|
||||
var ended = false
|
||||
main.post {
|
||||
if (generation == gen && state == State.WORKING && turn == null) {
|
||||
turn = started
|
||||
if (line != null) { session = started; sessionKey = key }
|
||||
} else AgentProcesses.killTree(started.pid)
|
||||
}
|
||||
if (line != null) runCatching { child.outputStream.apply { write((line + "\n").toByteArray()); flush() } } else child.outputStream.close()
|
||||
val raw = runCatching {
|
||||
val log = File(app.filesDir, TURN_LOG).apply { parentFile?.mkdirs() }
|
||||
log.renameTo(File(app.filesDir, "$TURN_LOG.1"))
|
||||
log.bufferedWriter()
|
||||
}.getOrNull()
|
||||
runCatching {
|
||||
child.inputStream.bufferedReader().forEachLine { line ->
|
||||
runCatching { raw?.apply { write(line); newLine(); flush() } }
|
||||
val parsed = current.parse(line) ?: return@forEachLine
|
||||
child.inputStream.bufferedReader().forEachLine { output ->
|
||||
runCatching { raw?.apply { write(output); newLine(); flush() } }
|
||||
val parsed = current.parse(output) ?: return@forEachLine
|
||||
parsed.conversation?.let { threadConversation = it }
|
||||
val done = parsed.entries.any { it is Entry.Finished }
|
||||
if (done) ended = true
|
||||
val event = if (!done) parsed else runCatching { current.usage(LinuxRuntime.rootDir(app), threadConversation) }.getOrNull()
|
||||
?.let { parsed.copy(context = it.context ?: parsed.context, window = it.window ?: parsed.window, limits = it.limits ?: parsed.limits) } ?: parsed
|
||||
main.post { if (turn === started) apply(app, event) }
|
||||
main.post { if (turn === started || session === started) handle(app, started, event) }
|
||||
}
|
||||
}
|
||||
runCatching { raw?.close() }
|
||||
val status = runCatching { child.waitFor() }.getOrDefault(-1)
|
||||
OrphanReaper.release(started.pid)
|
||||
main.post {
|
||||
if (turn === started) {
|
||||
turn = null
|
||||
if (state == State.WORKING && !ended) finish(app, app.getString(R.string.agent_exited, current.name, status))
|
||||
}
|
||||
if (started.writingGeneration != null) started.exitStatus = status
|
||||
else processExited(app, started, current, status)
|
||||
}
|
||||
}, "agent-output").start()
|
||||
}
|
||||
|
||||
private fun processExited(app: Context, exited: Turn, current: AgentHarness, status: Int) {
|
||||
if (session === exited) {
|
||||
session = null
|
||||
launchedBackground = false
|
||||
main.removeCallbacks(reap)
|
||||
AgentHostService.backgroundDone(app)
|
||||
}
|
||||
if (turn === exited) {
|
||||
turn = null
|
||||
if (state == State.WORKING) finish(app, app.getString(R.string.agent_exited, current.name, status))
|
||||
}
|
||||
}
|
||||
|
||||
private fun serviceWarning(app: Context, error: Throwable) {
|
||||
record(app, Entry.Notice("Unable to keep the agent running in the background: ${error.message ?: error.javaClass.simpleName}"))
|
||||
}
|
||||
|
||||
/** One event from the CLI, which may belong to a turn it started on its own once the user's has ended. */
|
||||
private fun handle(app: Context, from: Turn, event: AgentEvent) {
|
||||
if (event.background) {
|
||||
// A leftover task answered before the user's message is not the user's turn; one the CLI started is its own.
|
||||
if (background && state == State.WORKING) finish(app, event.backgroundError, usage = event.usage?.let { from.costs?.perTurn(it) ?: it })
|
||||
return
|
||||
}
|
||||
val content = event.text != null || event.thinking != null || event.entries.any { it !is Entry.Finished }
|
||||
if (content && state == State.IDLE && session === from) {
|
||||
main.removeCallbacks(reap)
|
||||
background = true
|
||||
turn = from
|
||||
turnPlanned = false
|
||||
state = State.WORKING
|
||||
live = ""
|
||||
liveThinking = ""
|
||||
turnStarted = SystemClock.elapsedRealtime()
|
||||
AgentHostService.start(app)?.let { serviceWarning(app, it) }
|
||||
}
|
||||
val finished = event.entries.filterIsInstance<Entry.Finished>().firstOrNull()
|
||||
if (finished != null && state == State.WORKING && from.clearingCosts) {
|
||||
if (finished.error == null) from.costs?.reset()
|
||||
from.clearingCosts = false
|
||||
}
|
||||
val applied = if (finished != null && state == State.WORKING && event.usage != null)
|
||||
event.copy(usage = from.costs?.perTurn(event.usage) ?: event.usage) else event
|
||||
apply(app, applied)
|
||||
}
|
||||
|
||||
/** Ends the CLI process kept between turns, and with it whatever it still runs in the background. */
|
||||
private fun dropSession() {
|
||||
main.removeCallbacks(reap)
|
||||
launchedBackground = false
|
||||
appContext?.let { AgentHostService.backgroundDone(it) }
|
||||
val kept = session ?: return
|
||||
session = null
|
||||
AgentProcesses.killTree(kept.pid)
|
||||
kept.process.destroy()
|
||||
}
|
||||
|
||||
/** Ends the turn now: its process and everything it started, a build included. */
|
||||
fun stop(context: Context) {
|
||||
val app = context.applicationContext
|
||||
@@ -349,6 +454,7 @@ object AgentHost {
|
||||
AgentProcesses.killTree(running.pid)
|
||||
running.process.destroy()
|
||||
}
|
||||
dropSession()
|
||||
if (state == State.WORKING) finish(app, null, stopped = true)
|
||||
}
|
||||
|
||||
@@ -443,19 +549,25 @@ object AgentHost {
|
||||
private fun finish(app: Context, error: String?, stopped: Boolean = false, usage: Usage? = null) {
|
||||
if (state != State.WORKING) return
|
||||
turn = null
|
||||
val answeredTask = background
|
||||
background = false
|
||||
main.removeCallbacks(reap)
|
||||
if (session != null) main.postDelayed(reap, LINGER_MS)
|
||||
if (!stopped) labFromTurn = false
|
||||
live = ""
|
||||
liveThinking = ""
|
||||
val held = if (context > 0) (usage ?: Usage(0, 0.0, 0, 0)).copy(context = context, window = window) else usage
|
||||
record(app, Entry.Finished(error, stopped, held, planned = turnPlanned && !stopped && error == null))
|
||||
state = State.IDLE
|
||||
unseen = true
|
||||
failed = error != null
|
||||
AgentHostService.stop(app)
|
||||
if (session != null && launchedBackground) {
|
||||
AgentHostService.waitForBackground(app)?.let { serviceWarning(app, it) }
|
||||
} else AgentHostService.stop(app)
|
||||
record(app, Entry.Finished(error, stopped, held, planned = turnPlanned && !stopped && error == null))
|
||||
// Claude Code now and then ends a resumed turn at once without reading the message; nothing
|
||||
// happened, so the message is sent once more.
|
||||
val asked = entries.lastOrNull { it is Entry.Asked } as? Entry.Asked
|
||||
if (!stopped && error == null && asked != null && answerless(entries) && !retrying) {
|
||||
if (!stopped && error == null && !answeredTask && asked != null && answerless(entries) && !retrying) {
|
||||
retrying = true
|
||||
val retryChat = chat
|
||||
resend = Runnable {
|
||||
@@ -493,6 +605,7 @@ object AgentHost {
|
||||
|
||||
private fun record(app: Context, entry: Entry) {
|
||||
if (!AgentChats.merge(entries, entry)) return
|
||||
if (entry is Entry.Used && entry.background) launchedBackground = true
|
||||
chat?.let { AgentChats.append(AgentChats.file(app, it), entry) }
|
||||
}
|
||||
|
||||
@@ -645,6 +758,8 @@ object AgentHost {
|
||||
/** The raw output of the latest turn, for working out what a CLI did when the chat shows nothing. */
|
||||
private const val TURN_LOG = "agent/turn.log"
|
||||
private const val RETRY_MS = 3_000L
|
||||
/** How long the CLI process stays open after a turn, waiting for background work to wake it. */
|
||||
private const val LINGER_MS = 20 * 60_000L
|
||||
|
||||
private fun modelKey(harness: AgentHarness) = "model_${harness.id}"
|
||||
private fun limitsKey(harness: AgentHarness) = "limits_${harness.id}"
|
||||
@@ -694,3 +809,17 @@ internal fun choices(reply: String): Choices {
|
||||
val options = lines.subList(found.first + 1, found.last).map { it.trim().removePrefix("- ").removePrefix("* ").trim() }.filter { it.isNotEmpty() }
|
||||
return Choices(lines.subList(0, found.first).joinToString("\n").trimEnd(), options)
|
||||
}
|
||||
|
||||
internal class AgentCostTracker {
|
||||
private var previous = 0.0
|
||||
|
||||
fun reset() { previous = 0.0 }
|
||||
|
||||
fun perTurn(usage: AgentHost.Usage): AgentHost.Usage {
|
||||
val total = usage.costUsd
|
||||
if (total == 0.0 && previous > 0.0) return usage
|
||||
val delta = if (total >= previous) total - previous else total
|
||||
previous = total
|
||||
return usage.copy(costUsd = delta)
|
||||
}
|
||||
}
|
||||
@@ -42,19 +42,37 @@ class AgentHostService : Service() {
|
||||
/** Setup steps that keep the app alive while they run, besides the agent's turn. */
|
||||
private var setupSteps = 0
|
||||
|
||||
fun start(context: Context) {
|
||||
fun start(context: Context): Throwable? {
|
||||
if (started) { update(context); return null }
|
||||
lastText = null
|
||||
started = true
|
||||
runCatching { context.startForegroundService(Intent(context, AgentHostService::class.java)) }
|
||||
.onSuccess { awaiting++ }
|
||||
return runCatching { context.startForegroundService(Intent(context, AgentHostService::class.java)) }
|
||||
.onSuccess { started = true; awaiting++ }
|
||||
.exceptionOrNull()
|
||||
}
|
||||
|
||||
fun stop(context: Context) {
|
||||
if (setupSteps > 0) return
|
||||
if (setupSteps > 0 || waiting) return
|
||||
started = false
|
||||
if (awaiting == 0) context.stopService(Intent(context, AgentHostService::class.java))
|
||||
}
|
||||
|
||||
/**
|
||||
* The turn has ended but its CLI process stays open with background work that can wake it; the app must stay
|
||||
* alive to read that answer, so the service keeps running until the process is dropped.
|
||||
*/
|
||||
@Volatile private var waiting = false
|
||||
|
||||
fun waitForBackground(context: Context): Throwable? {
|
||||
waiting = true
|
||||
return if (started) { update(context); null } else start(context)
|
||||
}
|
||||
|
||||
fun backgroundDone(context: Context) {
|
||||
if (!waiting) return
|
||||
waiting = false
|
||||
if (AgentHost.state != AgentHost.State.WORKING) stop(context)
|
||||
}
|
||||
|
||||
fun setupStarted(context: Context) {
|
||||
setupSteps++
|
||||
start(context)
|
||||
@@ -80,7 +98,8 @@ class AgentHostService : Service() {
|
||||
AgentSetup.detail[AgentSetup.Step.GITHUB]?.takeIf {
|
||||
AgentSetup.status[AgentSetup.Step.GITHUB] == AgentSetup.Status.WORKING && it.startsWith("GitHub device code:")
|
||||
}?.let { return it }
|
||||
if (AgentHost.state != AgentHost.State.WORKING) return context.getString(R.string.agent_setting_up)
|
||||
if (AgentHost.state != AgentHost.State.WORKING)
|
||||
return context.getString(if (waiting && setupSteps == 0) R.string.agent_waiting_background else R.string.agent_setting_up)
|
||||
val tool = AgentHost.running()
|
||||
val elapsed = minutes((SystemClock.elapsedRealtime() - AgentHost.turnStarted) / 1000)
|
||||
return if (tool != null) "${tool.tool} · ${tool.detail}".take(120) + " · $elapsed" else context.getString(R.string.agent_thinking_for, elapsed)
|
||||
|
||||
@@ -40,7 +40,11 @@ object AgentProcesses {
|
||||
val now = SystemClock.elapsedRealtime()
|
||||
val uptimeTicks = now * HZ / 1000
|
||||
val elapsed = (now - lastAt).coerceAtLeast(1)
|
||||
fun isProot(pid: Int) = args[pid].orEmpty().substringBefore(' ').endsWith("proot.so") || args[pid].orEmpty().substringBefore(' ').endsWith("/proot")
|
||||
fun 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 ->
|
||||
!isProot(s.pid) && args[s.pid].orEmpty().isNotEmpty() && ancestors(s.pid).any { isProot(it) }
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.content.Context
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateListOf
|
||||
import androidx.compose.runtime.mutableStateMapOf
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.setValue
|
||||
@@ -40,7 +41,9 @@ object AgentSetup {
|
||||
private val main = Handler(Looper.getMainLooper())
|
||||
private const val REPO = "https://github.com/Droid-Deck/DroidDeck.git"
|
||||
private const val CHECKOUT = "/root/DroidDeck"
|
||||
private val HELPERS = listOf("android-open", "dd-gh-login", "droiddeckctl")
|
||||
private val HELPERS = listOf("android-open", "dd-gh-login", "droiddeckctl", "droiddeck-scenario")
|
||||
/** DroidDeck's own skills (tools/agent/skills), given to every harness. */
|
||||
private const val SKILLS = "agent/skills"
|
||||
internal const val CTL = "/root/.local/share/droiddeck/ctl"
|
||||
private const val PROBE_TIMEOUT_S = 60L
|
||||
|
||||
@@ -187,11 +190,98 @@ object AgentSetup {
|
||||
/** Written before every step, so the helpers a step relies on are there and match this DroidDeck version. */
|
||||
internal fun installHelpers(app: Context) {
|
||||
val root = LinuxRuntime.rootDir(app)
|
||||
val failed = mutableListOf<String>()
|
||||
fun attempt(what: String, block: () -> Unit) = runCatching(block).onFailure {
|
||||
android.util.Log.w("AgentSetup", "could not install $what", it)
|
||||
failed += what
|
||||
}
|
||||
val bin = File(root, "root/.local/bin").apply { mkdirs() }
|
||||
for (name in HELPERS) copyAsset(app, "agent/$name", File(bin, name))
|
||||
for (name in HELPERS) attempt(name) { copyAsset(app, "agent/$name", File(bin, name)) }
|
||||
val ctl = File(root, CTL.removePrefix("/")).apply { mkdirs() }
|
||||
for (name in app.assets.list("agent/ctl").orEmpty()) copyAsset(app, "agent/ctl/$name", File(ctl, name))
|
||||
for (name in app.assets.list("agent/ctl").orEmpty()) attempt("ctl/$name") { copyAsset(app, "agent/ctl/$name", File(ctl, name)) }
|
||||
val skills = app.assets.list(SKILLS).orEmpty().associateWith { app.assets.list("$SKILLS/$it").orEmpty().toList() }
|
||||
failed += installSkills(root, skills) { app.assets.open("$SKILLS/$it") }
|
||||
attempt("AGENTS.md") {
|
||||
val rules = app.assets.open("agent/ctl/AGENTS.md").use { it.readBytes().decodeToString() }
|
||||
failed += installInstructions(root, rules)
|
||||
}
|
||||
unpinAdbSerial(File(root, "root/.bashrc"))
|
||||
main.post { problems.clear(); problems.addAll(failed.distinct()) }
|
||||
}
|
||||
|
||||
/** What [installHelpers] could not install last time, shown in the Agent tab; empty when all is in place. */
|
||||
val problems = mutableStateListOf<String>()
|
||||
|
||||
/**
|
||||
* Writes each of DroidDeck's [skills] (name to its files) into every harness's skills folder, so
|
||||
* Claude Code, Codex and any later harness load the same ones, as of this DroidDeck version.
|
||||
* Skills the user added there are left alone. Returns the skills that could not be written.
|
||||
*/
|
||||
internal fun installSkills(root: File, skills: Map<String, List<String>>, open: (String) -> java.io.InputStream): List<String> {
|
||||
val failed = mutableListOf<String>()
|
||||
for (harness in AgentHarness.all) for ((name, files) in skills) runCatching {
|
||||
val dir = File(root, "${harness.skills}/$name")
|
||||
// A folder of that name without DroidDeck's mark is the user's own skill: keep it.
|
||||
if (dir.exists() && !File(dir, SKILL_MARK).exists()) return@runCatching
|
||||
dir.mkdirs()
|
||||
// Marked before copying, so a copy that fails part way is retried next turn, not taken for the user's.
|
||||
File(dir, SKILL_MARK).writeText("Installed by DroidDeck and replaced on every turn. Delete this file to keep your own edits.\n")
|
||||
for (file in files) open("$name/$file").use { replaceFile(it, File(dir, file), executable = false) }
|
||||
}.onFailure {
|
||||
android.util.Log.w("AgentSetup", "could not install skill $name for ${harness.name}", it)
|
||||
failed += "skill $name"
|
||||
}
|
||||
return failed
|
||||
}
|
||||
|
||||
/** Marks a skill folder as DroidDeck's, so it may be replaced; one without it belongs to the user. */
|
||||
internal const val SKILL_MARK = ".droiddeck"
|
||||
|
||||
/**
|
||||
* Where [file] really is when it is a symlink, as the guest sees it: an absolute target is a
|
||||
* userland path, so it is looked up under [root]. A dotfiles link keeps working that way.
|
||||
*/
|
||||
internal fun guestTarget(root: File, file: File): File {
|
||||
var current = file
|
||||
repeat(8) {
|
||||
val path = current.toPath()
|
||||
if (!java.nio.file.Files.isSymbolicLink(path)) return current
|
||||
val target = java.nio.file.Files.readSymbolicLink(path).toString()
|
||||
current = if (target.startsWith("/")) File(root, target.removePrefix("/")) else File(current.parentFile, target)
|
||||
}
|
||||
return current
|
||||
}
|
||||
|
||||
internal const val BLOCK_BEGIN = "<!-- BEGIN DroidDeck: replaced on every turn. Write your own rules outside this block. -->"
|
||||
internal const val BLOCK_END = "<!-- END DroidDeck -->"
|
||||
|
||||
/**
|
||||
* Puts DroidDeck's [rules] in a marked block of every harness's global instructions file,
|
||||
* keeping whatever the user wrote around it. Returns the files that could not be written.
|
||||
*/
|
||||
internal fun installInstructions(root: File, rules: String): List<String> {
|
||||
val failed = mutableListOf<String>()
|
||||
for (harness in AgentHarness.all) runCatching {
|
||||
val file = guestTarget(root, File(root, harness.instructions)).apply { parentFile?.mkdirs() }
|
||||
val existing = if (file.exists()) file.readText() else null
|
||||
val merged = withBlock(existing, rules)
|
||||
if (merged != existing) replaceFile(merged.byteInputStream(), file, executable = false)
|
||||
}.onFailure {
|
||||
android.util.Log.w("AgentSetup", "could not write ${harness.instructions}", it)
|
||||
failed += harness.instructions.substringAfterLast("root/")
|
||||
}
|
||||
return failed
|
||||
}
|
||||
|
||||
/** [existing] with DroidDeck's block set to [rules]: replaced in place, or put first when there is none yet. */
|
||||
internal fun withBlock(existing: String?, rules: String): String {
|
||||
val block = "$BLOCK_BEGIN\n${rules.trim()}\n$BLOCK_END\n"
|
||||
if (existing.isNullOrBlank()) return block
|
||||
val start = existing.indexOf(BLOCK_BEGIN)
|
||||
val end = existing.indexOf(BLOCK_END, start.coerceAtLeast(0))
|
||||
if (start < 0 || end < 0) return "$block\n$existing"
|
||||
val after = existing.substring(end + BLOCK_END.length).removePrefix("\n")
|
||||
return existing.substring(0, start) + block + after
|
||||
}
|
||||
|
||||
/** Older tools/agent/setup pinned the adb port in .bashrc, which overrides the live port DroidDeck passes. */
|
||||
@@ -201,8 +291,24 @@ object AgentSetup {
|
||||
if (fixed != text) runCatching { bashrc.writeText(fixed) }
|
||||
}
|
||||
|
||||
/**
|
||||
* Written beside [target] and renamed over it, so a symlink left there by a hand-made setup is
|
||||
* replaced rather than followed: its absolute target is a userland path the app cannot reach,
|
||||
* and the failed write stopped every helper after it, the droiddeckctl guide included.
|
||||
*/
|
||||
private fun copyAsset(app: Context, asset: String, target: File) {
|
||||
app.assets.open(asset).use { input -> target.outputStream().use { input.copyTo(it) } }
|
||||
target.setExecutable(true, false)
|
||||
app.assets.open(asset).use { replaceFile(it, target) }
|
||||
}
|
||||
|
||||
/** Replaces [target], or the symlink at it, with [input]. */
|
||||
internal fun replaceFile(input: java.io.InputStream, target: File, executable: Boolean = true) {
|
||||
// A unique name, since an agent turn and a setup step can install at the same time.
|
||||
val staged = File.createTempFile(".${target.name}.", ".part", target.parentFile)
|
||||
staged.outputStream().use { input.copyTo(it) }
|
||||
if (executable) staged.setExecutable(true, false)
|
||||
if (!staged.renameTo(target)) {
|
||||
staged.delete()
|
||||
throw java.io.IOException("could not replace $target")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -168,7 +168,7 @@ public class PulseAudioComponent extends SessionPart {
|
||||
env.add("HOME=" + workingDir);
|
||||
env.add("TMPDIR=" + workingDir);
|
||||
|
||||
String command = workingDir.getAbsolutePath() + "/libpulseaudio.so"
|
||||
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";
|
||||
@@ -259,7 +259,7 @@ public class PulseAudioComponent extends SessionPart {
|
||||
try {
|
||||
File modules = new File(workingDir, "modules/arm64");
|
||||
ArrayList<String> cmd = new ArrayList<>();
|
||||
cmd.add(pactl.getAbsolutePath());
|
||||
cmd.addAll(HostProcess.dataExecutable(pactl.getAbsolutePath()));
|
||||
java.util.Collections.addAll(cmd, args);
|
||||
ProcessBuilder builder = new ProcessBuilder(cmd);
|
||||
builder.directory(workingDir);
|
||||
@@ -316,8 +316,9 @@ public class PulseAudioComponent extends SessionPart {
|
||||
java.lang.Process process = null;
|
||||
try {
|
||||
File modules = new File(workingDir, "modules/arm64");
|
||||
ProcessBuilder builder = new ProcessBuilder(
|
||||
pactl.getAbsolutePath(), "suspend-" + kind, name, Boolean.toString(suspended));
|
||||
ArrayList<String> argv = new ArrayList<>(HostProcess.dataExecutable(pactl.getAbsolutePath()));
|
||||
argv.addAll(java.util.Arrays.asList("suspend-" + kind, name, Boolean.toString(suspended)));
|
||||
ProcessBuilder builder = new ProcessBuilder(argv);
|
||||
builder.directory(workingDir);
|
||||
builder.redirectErrorStream(true);
|
||||
builder.redirectOutput(new File("/dev/null"));
|
||||
|
||||
@@ -172,5 +172,8 @@ internal class AddonPack(
|
||||
listOf("runtime.tzst", "version.txt"))
|
||||
val UBISOFT = AddonPack("ubisoft", BuildConfig.PACK_UBISOFT_SHA256, BuildConfig.PACK_UBISOFT_SIZE,
|
||||
listOf("droiddeck-upc.exe"))
|
||||
val ROCKSTAR = AddonPack("rockstar", BuildConfig.PACK_ROCKSTAR_SHA256, BuildConfig.PACK_ROCKSTAR_SIZE,
|
||||
listOf("Launcher32.exe", "Launcher64.exe"))
|
||||
val DIRT = AddonPack("dirt", BuildConfig.PACK_DIRT_SHA256, BuildConfig.PACK_DIRT_SIZE, listOf("ws2_32.dll"))
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,12 @@ import java.util.function.Consumer
|
||||
|
||||
object HostProcess {
|
||||
private const val TAG = "HostProcess"
|
||||
private const val LINKER = "/system/bin/linker64"
|
||||
|
||||
/** Android 10+ refuses to execute app data files for targetSdk 29+; its linker still loads them. */
|
||||
@JvmStatic
|
||||
fun dataExecutable(path: String): List<String> =
|
||||
if (android.os.Build.VERSION.SDK_INT >= 29) listOf(LINKER, path) else listOf(path)
|
||||
|
||||
@JvmStatic
|
||||
fun start(command: String, env: Array<String>?, dir: File?, onExit: Consumer<Int>?, onLine: Consumer<String>?): Int =
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.droiddeck.launcher.frontend
|
||||
|
||||
import android.content.Context
|
||||
import com.droiddeck.launcher.session.SessionPrefs
|
||||
import com.droiddeck.launcher.session.SessionState
|
||||
|
||||
object SteamInputOverride {
|
||||
private const val CONFIG_KEY = "UseSteamControllerConfig"
|
||||
private const val DEFAULT_VALUE = "1"
|
||||
|
||||
enum class Mode(val value: String?) {
|
||||
DEFAULT(null), ENABLED("2"), DISABLED("0");
|
||||
|
||||
companion object {
|
||||
fun from(value: String): Mode? = when (value) {
|
||||
DEFAULT_VALUE -> DEFAULT
|
||||
"2" -> ENABLED
|
||||
"0" -> DISABLED
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
enum class Saved { YES, NO, RUNNING }
|
||||
|
||||
fun current(context: Context, appId: Int): Mode? =
|
||||
SteamLaunchOptions.steamAppSetting(
|
||||
SessionPrefs.activeSteamRoot(context), appId, CONFIG_KEY, DEFAULT_VALUE,
|
||||
)?.let(Mode::from)
|
||||
|
||||
fun set(context: Context, appId: Int, mode: Mode, shown: Mode): Saved {
|
||||
if (SessionState.running) return Saved.RUNNING
|
||||
val saved = SteamLaunchOptions.writeSteamAppSetting(
|
||||
SessionPrefs.activeSteamRoot(context), appId, CONFIG_KEY,
|
||||
shown.value ?: DEFAULT_VALUE, mode.value, DEFAULT_VALUE,
|
||||
)
|
||||
return if (saved) Saved.YES else Saved.NO
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,8 @@ import java.nio.file.StandardCopyOption
|
||||
object SteamLaunchOptions {
|
||||
private const val TAG = "SteamLaunchOptions"
|
||||
private val STEAM = listOf("UserLocalConfigStore", "Software", "Valve", "Steam")
|
||||
// Steam keeps per-game settings such as UseSteamControllerConfig in the root apps section, and launch options under Software/Valve/Steam.
|
||||
private val ROOT = listOf("UserLocalConfigStore")
|
||||
|
||||
fun current(context: Context, appId: Int): String? =
|
||||
SteamLiveShortcuts.launchOptions(context, appId.toLong()) ?: steam(SessionPrefs.activeSteamRoot(context), appId)
|
||||
@@ -36,13 +38,38 @@ object SteamLaunchOptions {
|
||||
val config = AddedGames.accountConfig(steamHome) ?: return null
|
||||
val text = runCatching { File(config, "localconfig.vdf").readText() }.getOrNull() ?: return null
|
||||
if (section(text, STEAM) == null) return null
|
||||
return launchOptions(text, appId).orEmpty()
|
||||
return appValue(text, appId, "LaunchOptions").orEmpty()
|
||||
}
|
||||
|
||||
internal fun write(steamHome: File, appId: Int, options: String): Boolean {
|
||||
val config = AddedGames.accountConfig(steamHome)?.let { File(it, "localconfig.vdf") } ?: return false
|
||||
val text = runCatching { config.readText() }.getOrNull() ?: return false
|
||||
val updated = withLaunchOptions(text, appId, options) ?: return false
|
||||
return writeConfig(config, text, updated)
|
||||
}
|
||||
|
||||
internal fun steamAppSetting(steamHome: File, appId: Int, key: String, default: String): String? {
|
||||
val config = AddedGames.accountConfig(steamHome) ?: return null
|
||||
val text = runCatching { File(config, "localconfig.vdf").readText() }.getOrNull() ?: return null
|
||||
if (section(text, ROOT) == null) return null
|
||||
return settingValue(text, appId, key) ?: default
|
||||
}
|
||||
|
||||
private fun settingValue(text: String, appId: Int, key: String): String? =
|
||||
appValue(text, appId, key, ROOT) ?: appValue(text, appId, key, STEAM)
|
||||
|
||||
internal fun writeSteamAppSetting(
|
||||
steamHome: File, appId: Int, key: String, expected: String, value: String?, default: String,
|
||||
): Boolean {
|
||||
val config = AddedGames.accountConfig(steamHome)?.let { File(it, "localconfig.vdf") } ?: return false
|
||||
val text = runCatching { config.readText() }.getOrNull() ?: return false
|
||||
if (section(text, ROOT) == null || (settingValue(text, appId, key) ?: default) != expected) return false
|
||||
val updated = (if (value == null) withoutAppValue(text, appId, key, ROOT) else withAppValue(text, appId, key, value, ROOT))
|
||||
?.let { withoutAppValue(it, appId, key, STEAM) } ?: return false
|
||||
return writeConfig(config, text, updated)
|
||||
}
|
||||
|
||||
private fun writeConfig(config: File, text: String, updated: String): Boolean {
|
||||
if (updated == text) return true
|
||||
val staged = File(config.parentFile, config.name + ".staged")
|
||||
return try {
|
||||
@@ -55,36 +82,57 @@ object SteamLaunchOptions {
|
||||
true
|
||||
} catch (e: Exception) {
|
||||
staged.delete()
|
||||
Log.w(TAG, "could not write launch options to ${config.path}", e)
|
||||
Log.w(TAG, "could not write Steam app settings to ${config.path}", e)
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
internal fun launchOptions(text: String, appId: Int): String? {
|
||||
val app = section(text, STEAM + "apps" + appId.toString()) ?: return null
|
||||
return entries(text, app.valueStart, app.end).firstOrNull { !it.section && it.key.equals("LaunchOptions", true) }
|
||||
return appValue(text, appId, "LaunchOptions")
|
||||
}
|
||||
|
||||
private fun appValue(text: String, appId: Int, key: String, base: List<String> = STEAM): String? {
|
||||
val app = section(text, base + "apps" + appId.toString()) ?: return null
|
||||
return entries(text, app.valueStart, app.end).firstOrNull { !it.section && it.key.equals(key, true) }
|
||||
?.let { unescape(text.substring(it.valueStart + 1, it.end)) }
|
||||
}
|
||||
|
||||
internal fun withLaunchOptions(text: String, appId: Int, options: String): String? {
|
||||
internal fun withLaunchOptions(text: String, appId: Int, options: String): String? =
|
||||
withAppValue(text, appId, "LaunchOptions", options)
|
||||
|
||||
private fun withAppValue(text: String, appId: Int, key: String, rawValue: String, base: List<String> = STEAM): String? {
|
||||
val newline = if (text.contains("\r\n")) "\r\n" else "\n"
|
||||
var updated = text
|
||||
var path = STEAM
|
||||
for (key in listOf("apps", appId.toString())) {
|
||||
updated = withSection(updated, section(updated, path) ?: return null, key, newline) ?: return null
|
||||
path = path + key
|
||||
var path = base
|
||||
for (pathPart in listOf("apps", appId.toString())) {
|
||||
updated = withSection(updated, section(updated, path) ?: return null, pathPart, newline) ?: return null
|
||||
path = path + pathPart
|
||||
}
|
||||
val app = section(updated, path) ?: return null
|
||||
val value = "\"" + escape(options) + "\""
|
||||
entries(updated, app.valueStart, app.end).firstOrNull { !it.section && it.key.equals("LaunchOptions", true) }?.let {
|
||||
val value = "\"" + escape(rawValue) + "\""
|
||||
entries(updated, app.valueStart, app.end).firstOrNull { !it.section && it.key.equals(key, true) }?.let {
|
||||
return updated.replaceRange(it.valueStart, it.end + 1, value)
|
||||
}
|
||||
val lineStart = closingLine(updated, app) ?: return null
|
||||
val indent = updated.substring(lineStart, app.end) + "\t"
|
||||
return updated.substring(0, lineStart) + indent + "\"LaunchOptions\"\t\t" + value + newline + updated.substring(lineStart)
|
||||
return updated.substring(0, lineStart) + indent + "\"${escape(key)}\"\t\t" + value + newline + updated.substring(lineStart)
|
||||
}
|
||||
|
||||
private class Entry(val key: String, val valueStart: Int, val end: Int, val section: Boolean)
|
||||
private fun withoutAppValue(text: String, appId: Int, key: String, base: List<String> = STEAM): String {
|
||||
val app = section(text, base + "apps" + appId.toString()) ?: return text
|
||||
val entry = entries(text, app.valueStart, app.end).firstOrNull { !it.section && it.key.equals(key, true) } ?: return text
|
||||
val lineStart = text.lastIndexOf('\n', entry.start - 1) + 1
|
||||
val lineEnd = text.indexOf('\n', entry.end + 1).let { if (it < 0) text.length else it }
|
||||
val onlyEntryOnLine = text.substring(lineStart, entry.start).all(Char::isWhitespace) &&
|
||||
text.substring(entry.end + 1, lineEnd).all(Char::isWhitespace)
|
||||
return if (onlyEntryOnLine) {
|
||||
text.removeRange(lineStart, if (lineEnd < text.length) lineEnd + 1 else lineEnd)
|
||||
} else {
|
||||
text.removeRange(entry.start, entry.end + 1)
|
||||
}
|
||||
}
|
||||
|
||||
private class Entry(val key: String, val start: Int, val valueStart: Int, val end: Int, val section: Boolean)
|
||||
|
||||
private fun section(text: String, path: List<String>): Entry? {
|
||||
var found: Entry? = null
|
||||
@@ -98,18 +146,27 @@ object SteamLaunchOptions {
|
||||
private fun entries(text: String, open: Int, close: Int): List<Entry> {
|
||||
val found = ArrayList<Entry>()
|
||||
var key: String? = null
|
||||
var keyStart = -1
|
||||
var i = open + 1
|
||||
while (i < close) {
|
||||
when {
|
||||
text[i] == '"' -> {
|
||||
val end = stringEnd(text, i) ?: return found
|
||||
if (key == null) key = unescape(text.substring(i + 1, end)) else { found += Entry(key, i, end, false); key = null }
|
||||
if (key == null) {
|
||||
key = unescape(text.substring(i + 1, end))
|
||||
keyStart = i
|
||||
} else {
|
||||
found += Entry(key, keyStart, i, end, false)
|
||||
key = null
|
||||
keyStart = -1
|
||||
}
|
||||
i = end + 1
|
||||
}
|
||||
text[i] == '{' -> {
|
||||
val end = sectionEnd(text, i) ?: return found
|
||||
key?.let { found += Entry(it, i, end, true) }
|
||||
key?.let { found += Entry(it, keyStart, i, end, true) }
|
||||
key = null
|
||||
keyStart = -1
|
||||
i = end + 1
|
||||
}
|
||||
text.startsWith("//", i) -> i = text.indexOf('\n', i).let { if (it < 0) close else it }
|
||||
|
||||
@@ -166,14 +166,21 @@ object SteamTouchConfig {
|
||||
|
||||
fun steamRoot(context: Context) = com.droiddeck.launcher.session.SessionPrefs.activeSteamRoot(context)
|
||||
|
||||
private fun controllerConfigs(context: Context) = File(steamRoot(context), "steamapps/common/Steam Controller Configs")
|
||||
|
||||
fun configDir(context: Context): File? {
|
||||
val base = File(steamRoot(context), "steamapps/common/Steam Controller Configs")
|
||||
val base = controllerConfigs(context)
|
||||
val account = accountId(context)
|
||||
if (account != null) File(base, "$account/config").takeIf { it.isDirectory }?.let { return it }
|
||||
return base.listFiles()?.filter { it.name.all(Char::isDigit) && File(it, "config").isDirectory }
|
||||
?.maxByOrNull { it.lastModified() }?.let { File(it, "config") }
|
||||
}
|
||||
|
||||
private fun writableConfigDir(context: Context): File? {
|
||||
val account = accountId(context) ?: return configDir(context)
|
||||
return File(controllerConfigs(context), "$account/config").apply { mkdirs() }.takeIf { it.isDirectory }
|
||||
}
|
||||
|
||||
private fun accountId(context: Context): Long? = try {
|
||||
val users = KeyValues.parse(File(steamRoot(context), "config/loginusers.vdf").readText())
|
||||
val node = users.child("users")
|
||||
@@ -197,7 +204,7 @@ object SteamTouchConfig {
|
||||
}
|
||||
return try {
|
||||
val text = file.readText()
|
||||
val kv = KeyValues.parse(text.removePrefix(""))
|
||||
val kv = KeyValues.parse(text)
|
||||
val mappings = kv.child("controller_mappings") ?: kv
|
||||
val layouts = mappings.string("touch_layout")?.let { hex -> decodeLayouts(hexToBytes(hex)) }
|
||||
Log.i(TAG, "steam touch: app $appId uses ${file.path} (${layouts?.layouts?.size ?: 0} layouts)")
|
||||
@@ -389,8 +396,9 @@ object SteamTouchConfig {
|
||||
bindings: Map<SteamTouchBindings.Ref, (SteamTouchBindings.Binding) -> SteamTouchBindings.Binding> = emptyMap(),
|
||||
options: Options? = null,
|
||||
): File? {
|
||||
val dir = configDir(context) ?: return null
|
||||
val base = config.text ?: if (config.file == null && bindings.isEmpty()) "\"controller_mappings\"\n{\n\t\"controller_type\"\t\t\"controller_mobile_touch\"\n}\n" else return null
|
||||
val dir = writableConfigDir(context) ?: return null.also { Log.w(TAG, "steam touch: no controller config folder to save app $appId in") }
|
||||
val base = config.text ?: if (config.file == null && bindings.isEmpty()) "\"controller_mappings\"\n{\n\t\"controller_type\"\t\t\"controller_mobile_touch\"\n}\n"
|
||||
else return null.also { Log.w(TAG, "steam touch: ${config.file?.path ?: "default layout"} has no readable text to save into") }
|
||||
val source = bindings.entries.fold(base) { text, (ref, change) ->
|
||||
SteamTouchBindings.rewrite(text, ref, change) ?: text
|
||||
}
|
||||
@@ -408,11 +416,11 @@ object SteamTouchConfig {
|
||||
val existing = Regex("""\n\s*"touch_layout"\s+"[0-9a-fA-F]*"""")
|
||||
val text = if (existing.containsMatchIn(source)) source.replace(existing, "\n$line")
|
||||
else source.replaceFirst(Regex("""("controller_type"\s+"controller_mobile_touch"[^\n]*)"""), "$1\n$line")
|
||||
if (!text.contains("touch_layout")) return null
|
||||
if (!text.contains("touch_layout")) return null.also { Log.w(TAG, "steam touch: ${config.file?.path} is no controller_mobile_touch config") }
|
||||
target.parentFile?.mkdirs()
|
||||
val tmp = File(target.path + ".tmp")
|
||||
tmp.writeText(text)
|
||||
if (!tmp.renameTo(target)) return null
|
||||
if (!tmp.renameTo(target)) return null.also { Log.w(TAG, "steam touch: could not replace ${target.path}") }
|
||||
selectAutosave(dir, key)
|
||||
dropDeviceEntry(dir, key)
|
||||
Log.i(TAG, "steam touch: saved layouts ${sets.keys} for app $appId to ${target.path}")
|
||||
@@ -430,12 +438,13 @@ object SteamTouchConfig {
|
||||
|
||||
private fun selectAutosave(dir: File, key: String) {
|
||||
val file = File(dir, CONFIGSET)
|
||||
val text = if (file.isFile) file.readText() else "\"controller_config\"\n{\n}\n"
|
||||
val entry = "\t\"$key\"\n\t{\n\t\t\"autosave\"\t\t\"1\"\n\t}"
|
||||
val block = Regex("""\n\s*"${Regex.escape(key)}"\s*\{[^}]*\}""", RegexOption.IGNORE_CASE)
|
||||
val next = if (block.containsMatchIn(text)) text.replace(block) { "\n$entry" }
|
||||
else text.substring(0, text.lastIndexOf('}')).trimEnd() + "\n$entry\n}\n"
|
||||
File(file.path + ".tmp").apply { writeText(next) }.renameTo(file)
|
||||
val root = file.takeIf { it.isFile }?.readText()?.let(KeyValues::parse)?.takeIf { it.child("controller_config") != null }
|
||||
?: KeyValues.Node(mutableListOf("controller_config" to KeyValues.Node()))
|
||||
val config = root.child("controller_config") ?: return
|
||||
val entry = key to KeyValues.Node(mutableListOf("autosave" to "1"))
|
||||
val at = config.entries.indexOfFirst { it.first.equals(key, true) && it.second is KeyValues.Node }
|
||||
if (at >= 0) config.entries[at] = entry else config.entries += entry
|
||||
File(file.path + ".tmp").apply { writeText(KeyValues.write(root)) }.renameTo(file)
|
||||
}
|
||||
|
||||
|
||||
@@ -593,34 +602,48 @@ class KeyValues private constructor() {
|
||||
fun string(key: String): String? = entries.firstOrNull { it.first.equals(key, true) && it.second is String }?.second as String?
|
||||
}
|
||||
|
||||
private class Token(val text: String, val quoted: Boolean) {
|
||||
val opens get() = !quoted && text == "{"
|
||||
val closes get() = !quoted && text == "}"
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun write(node: Node): String = write(node, "")
|
||||
|
||||
private fun write(node: Node, indent: String): String = node.entries.joinToString("") { (key, value) ->
|
||||
if (value is Node) "$indent\"${escape(key)}\"\n$indent{\n${write(value, "$indent\t")}$indent}\n"
|
||||
else "$indent\"${escape(key)}\"\t\t\"${escape(value.toString())}\"\n"
|
||||
}
|
||||
|
||||
private fun escape(text: String) = text.replace("\\", "\\\\").replace("\"", "\\\"").replace("\n", "\\n").replace("\t", "\\t")
|
||||
|
||||
fun parse(text: String): Node {
|
||||
val tokens = tokenize(text)
|
||||
val tokens = tokenize(text.removePrefix("\uFEFF"))
|
||||
var i = 0
|
||||
fun node(): Node {
|
||||
val n = Node()
|
||||
while (i < tokens.size) {
|
||||
val t = tokens[i++]
|
||||
if (t == "}" ) return n
|
||||
if (t == "{") continue
|
||||
if (t.closes) return n
|
||||
if (t.opens) continue
|
||||
if (i >= tokens.size) break
|
||||
val next = tokens[i]
|
||||
if (next == "{") { i++; n.entries += t to node() } else { i++; n.entries += t to next }
|
||||
if (next.opens) { i++; n.entries += t.text to node() } else { i++; n.entries += t.text to next.text }
|
||||
}
|
||||
return n
|
||||
}
|
||||
return node()
|
||||
}
|
||||
|
||||
private fun tokenize(text: String): List<String> {
|
||||
val out = mutableListOf<String>()
|
||||
private fun tokenize(text: String): List<Token> {
|
||||
val out = mutableListOf<Token>()
|
||||
var i = 0
|
||||
while (i < text.length) {
|
||||
val c = text[i]
|
||||
when {
|
||||
c.isWhitespace() -> i++
|
||||
c == '/' && i + 1 < text.length && text[i + 1] == '/' -> while (i < text.length && text[i] != '\n') i++
|
||||
c == '{' || c == '}' -> { out += c.toString(); i++ }
|
||||
c == '{' || c == '}' -> { out += Token(c.toString(), false); i++ }
|
||||
c == '"' -> {
|
||||
val sb = StringBuilder()
|
||||
i++
|
||||
@@ -632,13 +655,13 @@ class KeyValues private constructor() {
|
||||
i++
|
||||
}
|
||||
i++
|
||||
out += sb.toString()
|
||||
out += Token(sb.toString(), true)
|
||||
}
|
||||
c == '[' -> { while (i < text.length && text[i] != ']') i++; i++ }
|
||||
else -> {
|
||||
val start = i
|
||||
while (i < text.length && !text[i].isWhitespace() && text[i] != '{' && text[i] != '}' && text[i] != '"') i++
|
||||
out += text.substring(start, i)
|
||||
out += Token(text.substring(start, i), false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -384,7 +384,7 @@ object BwrapSpawner {
|
||||
val program = plan.argv.firstOrNull()?.takeIf { it.startsWith("/") }?.let(::host)?.canonicalFile
|
||||
?.takeIf { it.isFile && isStaticElf(it) } ?: return null
|
||||
if (!linkMounts(plan)) return null
|
||||
return (listOf(program.path) + plan.argv.drop(1)) to plan.env
|
||||
return (NativeGuest.execPrefix(program.path) + listOf(program.path) + plan.argv.drop(1)) to plan.env
|
||||
}
|
||||
val loader = SANDBOX_LOADERS.map(::host).firstOrNull { it.isFile }?.canonicalFile ?: return null
|
||||
val libc = SANDBOX_LIBCS.map(::host).firstOrNull { it.isFile }?.canonicalFile ?: return null
|
||||
@@ -411,13 +411,14 @@ object BwrapSpawner {
|
||||
plan.env.map { (k, v) -> "$k=$v" } + plan.argv
|
||||
val env = linkedMapOf(
|
||||
"DDNATV_ROOT" to sandbox,
|
||||
"DDNATV_EXEC" to NativeGuest.execLoader.orEmpty(),
|
||||
"DDNATV_LINK_ROOT" to rootfs.path,
|
||||
"DDNATV_BINDS" to plan.binds.joinToString("|") { "${it.host}:${it.guest}" },
|
||||
"DDNATV_HOSTNAME" to SessionPrefs.guestHostname(context),
|
||||
"LD_LIBRARY_PATH" to SANDBOX_LIB_DIRS.map(::host).filter { it.isDirectory }.joinToString(":") { it.path },
|
||||
"LD_PRELOAD" to hook.path,
|
||||
).filterValues { it.isNotEmpty() }
|
||||
return (NativeGuest.simulator(rootfs)?.let { it + launch } ?: launch) to env
|
||||
return (NativeGuest.simulator(rootfs)?.let { it + launch } ?: (NativeGuest.execPrefix(loader.path) + launch)) to env
|
||||
}
|
||||
|
||||
private val runpathDirs = java.util.concurrent.ConcurrentHashMap<String, List<String>>()
|
||||
@@ -542,7 +543,7 @@ object BwrapSpawner {
|
||||
.also { b -> b.environment().apply { clear(); putAll(native.second) } }
|
||||
} else {
|
||||
val cmd = LinuxRuntime.prootPrefix(context, plan.root, plan.cwd)
|
||||
if (verbose != null) { cmd.add(1, "-v"); cmd.add(2, verbose.toString()) }
|
||||
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) {
|
||||
|
||||
@@ -95,10 +95,13 @@ class DeviceControlsComponent(context: Context, root: File, private val activity
|
||||
permissionNotified = false
|
||||
context.contentResolver.registerContentObserver(Settings.System.CONTENT_URI, true, observer)
|
||||
requests.startWatching()
|
||||
context.registerReceiver(volumeSteps, IntentFilter().apply {
|
||||
val volumeFilter = IntentFilter().apply {
|
||||
addAction(VOLUME_CHANGED_ACTION)
|
||||
addAction(STREAM_MUTE_CHANGED_ACTION)
|
||||
}, null, handler)
|
||||
}
|
||||
if (android.os.Build.VERSION.SDK_INT >= 33)
|
||||
context.registerReceiver(volumeSteps, volumeFilter, null, handler, Context.RECEIVER_NOT_EXPORTED)
|
||||
else context.registerReceiver(volumeSteps, volumeFilter, null, handler)
|
||||
refresh.run()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ object GuestCommand {
|
||||
NativeGuest.processBuilder(context, root, binds, guest).redirectErrorStream(true)
|
||||
} else {
|
||||
val cmd = LinuxRuntime.prootPrefix(context, root, "/root", fakeRoot)
|
||||
if (linkDir != null) cmd.add(1, "--link2symlink")
|
||||
if (linkDir != null) cmd.add("--link2symlink")
|
||||
binds.forEach { cmd.add("-b"); cmd.add(it) }
|
||||
cmd += guest
|
||||
ProcessBuilder(cmd).directory(root).redirectErrorStream(true).also { b ->
|
||||
|
||||
@@ -106,13 +106,15 @@ class LinuxNetworkLinkComponent(
|
||||
synchronized(lock) { writeNetworkState(currentProperties, currentCapabilities) }
|
||||
}
|
||||
}
|
||||
appContext.registerReceiver(receiver, IntentFilter().apply {
|
||||
val wifiFilter = IntentFilter().apply {
|
||||
addAction(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION)
|
||||
addAction(WifiManager.RSSI_CHANGED_ACTION)
|
||||
addAction(WifiManager.WIFI_STATE_CHANGED_ACTION)
|
||||
addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION)
|
||||
addAction(LocationManager.MODE_CHANGED_ACTION)
|
||||
})
|
||||
}
|
||||
if (android.os.Build.VERSION.SDK_INT >= 33) appContext.registerReceiver(receiver, wifiFilter, Context.RECEIVER_NOT_EXPORTED)
|
||||
else appContext.registerReceiver(receiver, wifiFilter)
|
||||
wifiReceiver = receiver
|
||||
scanRequestStamp = File(rootDir, "etc/droiddeck-wifi-scan-request").lastModified()
|
||||
scanHandler.post(scanRequests)
|
||||
|
||||
@@ -2,6 +2,7 @@ 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;
|
||||
@@ -77,7 +78,18 @@ public final class LinuxRuntime {
|
||||
}
|
||||
|
||||
private static boolean rootfsProotReady(Context context) {
|
||||
return rootfsProot(context).isFile() && rootfsLoader(context).isFile();
|
||||
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) {
|
||||
@@ -86,22 +98,21 @@ public final class LinuxRuntime {
|
||||
|
||||
public static File prootBinary(Context context) {
|
||||
if (AddonPack.PROOT.installed(context)) return AddonPack.PROOT.file(context, "libproot.so");
|
||||
if (SessionPrefs.allowStockProot(context)) return rootfsProot(context);
|
||||
if (stockProotAllowed(context)) return rootfsProot(context);
|
||||
return AddonPack.PROOT.file(context, "libproot.so");
|
||||
}
|
||||
|
||||
public static File prootLoader(Context context) {
|
||||
if (AddonPack.PROOT.installed(context)) return AddonPack.PROOT.file(context, "libproot-loader.so");
|
||||
if (SessionPrefs.allowStockProot(context)) return rootfsLoader(context);
|
||||
return AddonPack.PROOT.file(context, "libproot-loader.so");
|
||||
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;
|
||||
if (AddonPack.PROOT.installed(context)
|
||||
&& bin.getPath().equals(AddonPack.PROOT.file(context, "libproot.so").getPath())) return PROOT_PACK;
|
||||
return PROOT_ROOTFS;
|
||||
return patchedProot(context) && !bin.equals(rootfsProot(context)) ? PROOT_PACK : PROOT_ROOTFS;
|
||||
}
|
||||
|
||||
public static String prootLibraryPath(Context context) {
|
||||
@@ -183,13 +194,13 @@ public final class LinuxRuntime {
|
||||
|
||||
public static List<String> rootPrefix(Context context, File root, String cwd) {
|
||||
List<String> cmd = prootPrefix(context, root, cwd, true);
|
||||
cmd.add(1, "--link2symlink");
|
||||
cmd.add("--link2symlink");
|
||||
return cmd;
|
||||
}
|
||||
|
||||
public static List<String> prootPrefix(Context context, File root, String cwd, boolean fakeRoot) {
|
||||
List<String> cmd = new ArrayList<>();
|
||||
cmd.add(prootBinary(context).getPath());
|
||||
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();
|
||||
|
||||
@@ -384,7 +384,7 @@ public final class LinuxRuntimeInstaller {
|
||||
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))
|
||||
&& !SessionPrefs.allowStockProot(context))
|
||||
&& !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());
|
||||
|
||||
@@ -50,6 +50,21 @@ object NativeGuest {
|
||||
|
||||
fun hook(root: File): File = File(root, HOOK)
|
||||
|
||||
/**
|
||||
* libddexec.so, which starts the rootfs loader on Android 10+, where a targetSdk 29+ app may not
|
||||
* execute its data files; null where the kernel still starts them directly.
|
||||
*/
|
||||
@Volatile var execLoader: String? = null
|
||||
private set
|
||||
|
||||
/** What starts the program at [path] from the host: nothing before it, or [execLoader] and the path. */
|
||||
fun execPrefix(path: String): List<String> = execLoader?.let { listOf(it, path) }.orEmpty()
|
||||
|
||||
fun init(context: Context) {
|
||||
execLoader = File(context.applicationInfo.nativeLibraryDir, "libddexec.so")
|
||||
.takeIf { android.os.Build.VERSION.SDK_INT >= 29 && it.isFile }?.path
|
||||
}
|
||||
|
||||
fun loader(root: File): File? =
|
||||
listOf("usr/lib/ld-linux-aarch64.so.1", "lib/ld-linux-aarch64.so.1").map { File(root, it) }.firstOrNull { it.exists() }
|
||||
|
||||
@@ -60,9 +75,10 @@ object NativeGuest {
|
||||
/** Environment every native process starts with; a guest `env -i` is re-seeded by the hook. */
|
||||
fun environment(root: File, preload: List<String> = emptyList()): Map<String, String> = linkedMapOf(
|
||||
"DDNATV_ROOT" to root.path,
|
||||
"DDNATV_EXEC" to execLoader.orEmpty(),
|
||||
"LD_LIBRARY_PATH" to libraryPath(root),
|
||||
"LD_PRELOAD" to (preload.map { File(root, it.removePrefix("/")).path } + hook(root).path).joinToString(":"),
|
||||
)
|
||||
).filterValues { it.isNotEmpty() }
|
||||
|
||||
/**
|
||||
* The host command line for the guest program at [program] (an absolute guest path to a real
|
||||
@@ -72,7 +88,7 @@ object NativeGuest {
|
||||
val loader = checkNotNull(loader(root)) { "no glibc loader in ${root.path}" }
|
||||
val host = File(root, program.removePrefix("/"))
|
||||
val launch = listOf(loader.path, "--argv0", host.name, host.path) + args
|
||||
return simulator(root)?.let { it + launch } ?: launch
|
||||
return simulator(root)?.let { it + launch } ?: (execPrefix(loader.path) + launch)
|
||||
}
|
||||
|
||||
/** The environment of the session process: the hook's root, the mounts proot used to make, the preload list. */
|
||||
@@ -80,6 +96,7 @@ object NativeGuest {
|
||||
val preload = preloadList(root)
|
||||
return linkedMapOf(
|
||||
"DDNATV_ROOT" to root.path,
|
||||
"DDNATV_EXEC" to execLoader.orEmpty(),
|
||||
"DDNATV_HOSTNAME" to hostname.orEmpty(),
|
||||
"DDNATV_BINDS" to binds.joinToString("|") { if (it.contains(':')) it else "$it:$it" },
|
||||
"DDNATV_PRELOAD" to preload.joinToString(":"),
|
||||
|
||||
@@ -11,6 +11,7 @@ import android.view.Display
|
||||
|
||||
object PerfMode {
|
||||
private const val TAG = "PerfMode"
|
||||
const val BFI_MIN_REFRESH_HZ = 100f
|
||||
|
||||
fun apply(a: Activity, fpsLimit: Int = 0, refreshLimit: Int = 0): String {
|
||||
val parts = ArrayList<String>(2)
|
||||
|
||||
@@ -36,35 +36,60 @@ object SessionFiles {
|
||||
"etc/xdg/autostart/droiddeck-clipboard.desktop" to "etc/xdg/autostart/droiddeck-clipboard.desktop",
|
||||
)
|
||||
|
||||
private const val UBISOFT_SERVICE = "usr/local/lib/droiddeck-ubisoft/droiddeck-upc.exe"
|
||||
private val SERVICE_PACKS = mapOf(
|
||||
AddonPack.UBISOFT to "usr/local/lib/droiddeck-ubisoft",
|
||||
AddonPack.ROCKSTAR to "usr/local/lib/droiddeck-rockstar",
|
||||
AddonPack.DIRT to "usr/local/lib/droiddeck-dirt",
|
||||
)
|
||||
|
||||
/** Fetches the Ubisoft pack and, once it lands, stages the service so a running session gets it without restarting. */
|
||||
fun ensureUbisoftService(context: Context) {
|
||||
AddonPack.UBISOFT.ensure(context) { app ->
|
||||
fun ensureUbisoftService(context: Context) = ensureStoreService(context, AddonPack.UBISOFT)
|
||||
|
||||
fun ensureRockstarService(context: Context) = ensureStoreService(context, AddonPack.ROCKSTAR)
|
||||
|
||||
/** The DiRT 3 / DiRT Showdown ws2_32 stand-in; droiddeck-game-env applies it only when it is staged. */
|
||||
fun ensureDirtStandIn(context: Context) = ensureStoreService(context, AddonPack.DIRT)
|
||||
|
||||
private fun ensureStoreService(context: Context, pack: AddonPack) {
|
||||
pack.ensure(context) { app ->
|
||||
com.droiddeck.launcher.runtime.LinuxRuntime.rootDir(app).takeIf { it.isDirectory }
|
||||
?.let { stageUbisoftService(app, it, null) }
|
||||
?.let { stageStoreService(app, it, pack, null) }
|
||||
}
|
||||
}
|
||||
|
||||
/** Blocks until the store's service pack is installed and staged in [root]; false when it could not be fetched. */
|
||||
fun awaitStoreService(context: Context, store: String, root: File): Boolean {
|
||||
val pack = SERVICE_PACKS.keys.firstOrNull { it.name == store } ?: return false
|
||||
if (!pack.await(context)) return false
|
||||
return stageStoreService(context, root, pack, null)
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
private fun stageUbisoftService(context: Context, root: File, ledger: StageLedger?) {
|
||||
val pack = AddonPack.UBISOFT.takeIf { it.installed(context) }?.dir(context) ?: return
|
||||
val target = File(root, UBISOFT_SERVICE)
|
||||
if (ledger?.current(UBISOFT_SERVICE, target) == true) return
|
||||
val staged = File(target.parentFile, target.name + ".staged")
|
||||
var installed = false
|
||||
try {
|
||||
target.parentFile?.mkdirs()
|
||||
File(pack, "droiddeck-upc.exe").inputStream().use { input ->
|
||||
staged.outputStream().use { output -> FileUtils.copy(input, output) }
|
||||
private fun stageStoreService(context: Context, root: File, pack: AddonPack, ledger: StageLedger?): Boolean {
|
||||
val dir = pack.takeIf { it.installed(context) }?.dir(context) ?: return false
|
||||
val base = SERVICE_PACKS.getValue(pack)
|
||||
var all = true
|
||||
for (file in dir.listFiles().orEmpty().filter { it.isFile && it.name != AddonPack.COMPLETE }.sortedBy { it.name }) {
|
||||
val relative = "$base/${file.name}"
|
||||
val target = File(root, relative)
|
||||
if (ledger?.current(relative, target) == true) continue
|
||||
val staged = File(target.parentFile, target.name + ".staged")
|
||||
var installed = false
|
||||
try {
|
||||
target.parentFile?.mkdirs()
|
||||
file.inputStream().use { input ->
|
||||
staged.outputStream().use { output -> FileUtils.copy(input, output) }
|
||||
}
|
||||
installed = staged.setExecutable(true, false) && staged.renameTo(target)
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, "could not stage the ${pack.name} pack", e)
|
||||
} finally {
|
||||
if (!installed) staged.delete()
|
||||
}
|
||||
installed = staged.setExecutable(true, false) && staged.renameTo(target)
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, "could not stage the Ubisoft launcher service", e)
|
||||
} finally {
|
||||
if (!installed) staged.delete()
|
||||
if (installed) ledger?.staged(relative, target) else Log.e(TAG, "$relative NOT staged")
|
||||
all = all && installed
|
||||
}
|
||||
if (installed) ledger?.staged(UBISOFT_SERVICE, target) else Log.e(TAG, "$UBISOFT_SERVICE NOT staged")
|
||||
return all
|
||||
}
|
||||
|
||||
fun stage(context: Context, root: File, startsSession: Boolean = false) {
|
||||
@@ -73,8 +98,6 @@ object SessionFiles {
|
||||
GameEnvironmentStore.publish(context)
|
||||
WinComponents.publish(context)
|
||||
val files = arrayOf(
|
||||
"rockstar/helpers/Launcher32.exe" to "usr/local/lib/droiddeck-rockstar/Launcher32.exe",
|
||||
"rockstar/helpers/Launcher64.exe" to "usr/local/lib/droiddeck-rockstar/Launcher64.exe",
|
||||
"usr/local/bin/droiddeck-game-env" to "usr/local/bin/droiddeck-game-env",
|
||||
"usr/local/bin/droiddeck-game-debug" to "usr/local/bin/droiddeck-game-debug",
|
||||
"usr/local/bin/droiddeck-game-gpu" to "usr/local/bin/droiddeck-game-gpu",
|
||||
@@ -234,7 +257,6 @@ object SessionFiles {
|
||||
"usr/local/lib/droiddeck/uruntime" to "usr/local/lib/droiddeck/uruntime",
|
||||
"usr/local/lib/droiddeck-pipewire.tzst" to "usr/local/lib/droiddeck-pipewire.tzst",
|
||||
"usr/local/share/licenses/uruntime/LICENSE" to "usr/local/share/licenses/uruntime/LICENSE",
|
||||
"usr/local/lib/droiddeck-dirt/ws2_32.dll" to "usr/local/lib/droiddeck-dirt/ws2_32.dll",
|
||||
) + mangoapp + xclipse.map { it to it } + maliCompat + msitools.map { it to it } + vr + gpuLoad + fexPreloads).filter { (asset, _) ->
|
||||
val dir = asset.substringBeforeLast('/')
|
||||
runCatching { context.assets.list("linuxfs/$dir")?.contains(asset.substringAfterLast('/')) == true }.getOrDefault(false)
|
||||
@@ -248,7 +270,7 @@ object SessionFiles {
|
||||
var installed = false
|
||||
try {
|
||||
target.parentFile?.mkdirs()
|
||||
(if (asset.startsWith("rockstar/")) requireNotNull(javaClass.getResourceAsStream("/$asset")) else context.assets.open("linuxfs/$asset")).use { input ->
|
||||
context.assets.open("linuxfs/$asset").use { input ->
|
||||
staged.outputStream().use { output -> FileUtils.copy(input, output) }
|
||||
}
|
||||
installed = staged.setExecutable(true, false) && staged.renameTo(target)
|
||||
@@ -290,7 +312,7 @@ object SessionFiles {
|
||||
}
|
||||
if (installed) ledger.staged(key, target) else Log.e(TAG, "DirectAudio $set/$relative NOT staged")
|
||||
}
|
||||
stageUbisoftService(context, root, ledger)
|
||||
for (pack in SERVICE_PACKS.keys) stageStoreService(context, root, pack, ledger)
|
||||
ledger.save()
|
||||
for (old in arrayOf("aarch64-unix", "aarch64-windows", "i386-windows")) File(root, "$DIRECTAUDIO_DIR/lib/wine/$old").deleteRecursively()
|
||||
val preload = StringBuilder("/usr/local/lib/libblsession.so\n")
|
||||
|
||||
@@ -85,6 +85,12 @@ object SessionPrefs {
|
||||
prefs(context).edit().putBoolean("launcherFullscreen", on).apply()
|
||||
}
|
||||
|
||||
fun blackFrameInsertion(context: Context): Boolean = prefs(context).getBoolean("blackFrameInsertion", false)
|
||||
|
||||
fun setBlackFrameInsertion(context: Context, on: Boolean) {
|
||||
prefs(context).edit().putBoolean("blackFrameInsertion", on).apply()
|
||||
}
|
||||
|
||||
fun animationsEnabled(context: Context): Boolean = prefs(context).getBoolean("animations", true)
|
||||
|
||||
fun setAnimationsEnabled(context: Context, on: Boolean) {
|
||||
@@ -641,6 +647,13 @@ object SessionPrefs {
|
||||
position.takeIf { it in listOf("top", "bottom", "left", "right", "center") } ?: "center").apply()
|
||||
}
|
||||
|
||||
fun integerScaling(context: Context): Boolean =
|
||||
prefs(context).getBoolean("integerScaling", false)
|
||||
|
||||
fun setIntegerScaling(context: Context, enabled: Boolean) {
|
||||
prefs(context).edit().putBoolean("integerScaling", enabled).apply()
|
||||
}
|
||||
|
||||
fun returnAfterGame(context: Context): Boolean = prefs(context).getBoolean("returnAfterGame", true)
|
||||
|
||||
fun setReturnAfterGame(context: Context, on: Boolean) {
|
||||
@@ -694,6 +707,18 @@ object SessionPrefs {
|
||||
|
||||
fun micAsked(context: Context): Boolean = prefs(context).getBoolean("micAsked", false)
|
||||
|
||||
fun allFilesAsked(context: Context): Boolean = prefs(context).getBoolean("allFilesAsked", false)
|
||||
|
||||
fun setAllFilesAsked(context: Context) {
|
||||
prefs(context).edit().putBoolean("allFilesAsked", true).apply()
|
||||
}
|
||||
|
||||
fun bluetoothAsked(context: Context): Boolean = prefs(context).getBoolean("bluetoothAsked", false)
|
||||
|
||||
fun setBluetoothAsked(context: Context) {
|
||||
prefs(context).edit().putBoolean("bluetoothAsked", true).apply()
|
||||
}
|
||||
|
||||
fun setMicAsked(context: Context) {
|
||||
prefs(context).edit().putBoolean("micAsked", true).apply()
|
||||
}
|
||||
@@ -939,7 +964,7 @@ object SessionPrefs {
|
||||
prefs(context).edit().putBoolean("steamGpuCompositing", false).apply()
|
||||
return false
|
||||
}
|
||||
return prefs(context).getBoolean("steamGpuCompositing", false)
|
||||
return prefs(context).getBoolean("steamGpuCompositing", true)
|
||||
}
|
||||
|
||||
fun steamGpuCompositingAllowed(): Boolean =
|
||||
|
||||
@@ -540,7 +540,7 @@ class SessionService : Service() {
|
||||
}
|
||||
}
|
||||
if (!LinuxRuntime.patchedProot(this)) {
|
||||
if (SessionPrefs.allowStockProot(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)
|
||||
|
||||
@@ -18,13 +18,13 @@ object SettingsReset {
|
||||
"storesInstallLanguage",
|
||||
"hud", "hudDeck", "hudFps", "hudBattery", "hudGraph", "hudColor", "hudOpacity", "__KEEP_droidDeckHud__", "__KEEP_droidDeckHudPos__", "backHold", "backActionsInverted", "backDoubleTapMs", "touch", "pen", "penButton", "osc", "shape", "steamController",
|
||||
"gamepadLeft", "gamepadRight", "pipAutoEnter", "unfoldedControls", "unfoldedControlsWithController",
|
||||
"stretch16x9", "picturePosition", "railLabels", "agentTab", "navTabOrder", "navTabShelved", "navTabHidden", "pcKeyboardSize", "pcKeyboardOpacity", "pcKeyboardHiddenKeys",
|
||||
"stretch16x9", "picturePosition", "integerScaling", "railLabels", "agentTab", "navTabOrder", "navTabShelved", "navTabHidden", "pcKeyboardSize", "pcKeyboardOpacity", "pcKeyboardHiddenKeys",
|
||||
"gpuDriverMode", "androidDriver", "linuxDriver", "linuxDriver.steam", "linuxDriver.desktop",
|
||||
"tuSysmem", "glThread", "noGlError", "zinkLazy", "mangoapp", "gpuClockPin", "gamescopeRealtime", "paceCores", "ramCapMb", "vramCapMb", "zramClient", "zramIdle",
|
||||
"directAudio", "mic", "wifiDiscovery", "clientCpusOverride", "clientCpus", "gameCpus",
|
||||
"noXalia", "fastSync", "fsyncFirst", "syncFallback", "prootNoSeccomp", "prootFastPath", "nativeUserland", "cursorComposite",
|
||||
"guestHostname", "fexPreset", "forceSsbs", "logs", "gameDebugLogsEnabled", "enhancedDiagnosticsNext", "storageDiagnostics", "buildWatermark",
|
||||
"upscaler", "upscaleSharpness", "screenEffects", "textureAnisotropy", "textureLodBias",
|
||||
"upscaler", "upscaleSharpness", "screenEffects", "blackFrameInsertion", "textureAnisotropy", "textureLodBias",
|
||||
"steamDownloadsInBackground", "steam_offline", "bootMovie", "bootMovieSound", "bootMovieVolume", "bootMovieSeconds", "skipBootMovie",
|
||||
"bootMovieApplyNext", "bootMovieSteamSeen", "bootMovieShuffle",
|
||||
"questDefaultsV1", "telemetryAuto", "telemetryOff", "statsStrip", "statsHud", "bottomHud", "bottomStripMetrics", "bottomStripTabs", "statsDash", "statsSpeedUnit",
|
||||
|
||||
@@ -80,6 +80,11 @@ object StoreLaunchRequests {
|
||||
lastLaunched = Store.ROCKSTAR to request.optString("id")
|
||||
com.droiddeck.launcher.stores.rockstar.RockstarLaunch.prepare(app, request.optString("id"))
|
||||
}.getOrElse { JSONObject().put("ok", false).put("reason", "error-" + it.javaClass.simpleName) }
|
||||
"store-service" -> runCatching {
|
||||
val root = com.droiddeck.launcher.runtime.LinuxRuntime.rootDir(app)
|
||||
if (com.droiddeck.launcher.session.SessionFiles.awaitStoreService(app, request.optString("store"), root)) JSONObject().put("ok", true)
|
||||
else JSONObject().put("ok", false).put("reason", "service-unavailable")
|
||||
}.getOrElse { JSONObject().put("ok", false).put("reason", "error-" + it.javaClass.simpleName) }
|
||||
"rockstar-exited" -> {
|
||||
if (lastLaunched == (Store.ROCKSTAR to request.optString("id"))) lastLaunched = null
|
||||
JSONObject().put("ok", true)
|
||||
|
||||
@@ -141,6 +141,7 @@ object RockstarAuth {
|
||||
StoreAccounts.clear(context.applicationContext, Store.ROCKSTAR)
|
||||
return "ticket"
|
||||
}
|
||||
com.droiddeck.launcher.session.SessionFiles.ensureRockstarService(context)
|
||||
return null
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +1,27 @@
|
||||
package com.droiddeck.launcher.stores.xbox
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Intent
|
||||
import android.graphics.Color
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.util.TypedValue
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.webkit.CookieManager
|
||||
import android.webkit.WebResourceRequest
|
||||
import android.webkit.WebView
|
||||
import android.webkit.WebViewClient
|
||||
import android.widget.Button
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.ImageButton
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.ProgressBar
|
||||
import android.widget.TextView
|
||||
import androidx.activity.ComponentActivity
|
||||
import com.droiddeck.launcher.R
|
||||
import androidx.webkit.WebViewCompat
|
||||
import androidx.webkit.WebViewFeature
|
||||
import com.droiddeck.launcher.core.AddonPack
|
||||
@@ -24,8 +33,10 @@ import org.json.JSONObject
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
class XboxLoginActivity : ComponentActivity() {
|
||||
private lateinit var host: LinearLayout
|
||||
private lateinit var host: FrameLayout
|
||||
private lateinit var status: TextView
|
||||
private lateinit var retry: Button
|
||||
private lateinit var progressBar: ProgressBar
|
||||
private var view: WebView? = null
|
||||
@Volatile private var child: Xodus.Child? = null
|
||||
@Volatile private var session = 0L
|
||||
@@ -37,11 +48,7 @@ class XboxLoginActivity : ComponentActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
requestedOrientation = com.droiddeck.launcher.core.AppUiPrefs.orientation(this)
|
||||
host = LinearLayout(this).apply { orientation = LinearLayout.VERTICAL; setBackgroundColor(Color.BLACK) }
|
||||
status = TextView(this).apply { setTextColor(Color.WHITE); text = "Preparing Microsoft sign-in…"; setPadding(24, 16, 24, 16) }
|
||||
host.addView(status)
|
||||
host.addView(Button(this).apply { text = getString(com.droiddeck.launcher.R.string.stores_login_close); setOnClickListener { finish() } })
|
||||
setContentView(host)
|
||||
setContentView(buildChrome())
|
||||
if (android.os.Build.VERSION.SDK_INT < 28 || !WebViewFeature.isFeatureSupported(WebViewFeature.WEB_MESSAGE_LISTENER) ||
|
||||
!WebViewFeature.isFeatureSupported(WebViewFeature.DOCUMENT_START_SCRIPT)) {
|
||||
status.text = "Update Android System WebView to sign in to Xbox."
|
||||
@@ -148,15 +155,60 @@ class XboxLoginActivity : ComponentActivity() {
|
||||
val failed = step
|
||||
val reason = failure(e)
|
||||
logStep("failed while $failed: $reason")
|
||||
if (e is java.io.IOException) logStep("I/O detail: ${e.message.orEmpty().take(300)}")
|
||||
runOnUiThread {
|
||||
disposeView()
|
||||
val details = if (codes.isEmpty()) "" else "\nDetails: ${codes.joinToString(", ")}"
|
||||
status.text = "Microsoft sign-in did not complete.\nFailed while $failed: $reason$details\nClose this window and try again."
|
||||
status.text = "Microsoft sign-in did not complete.\nFailed while $failed: $reason$details"
|
||||
retry.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
}, "xbox-login").start()
|
||||
}
|
||||
|
||||
private fun dp(value: Int): Int = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, value.toFloat(), resources.displayMetrics).toInt()
|
||||
|
||||
/** The other stores' sign-in frame: a title bar with close, a load bar, and a centered status. */
|
||||
private fun buildChrome(): View {
|
||||
val root = LinearLayout(this).apply { orientation = LinearLayout.VERTICAL; setBackgroundColor(BACKGROUND) }
|
||||
val bar = LinearLayout(this).apply {
|
||||
orientation = LinearLayout.HORIZONTAL; gravity = Gravity.CENTER_VERTICAL; setBackgroundColor(BAR)
|
||||
layoutParams = LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, dp(48))
|
||||
}
|
||||
bar.addView(TextView(this).apply {
|
||||
text = getString(R.string.stores_login_title, Store.XBOX.label)
|
||||
setTextColor(TEXT); textSize = 16f; setPadding(dp(16), 0, dp(8), 0)
|
||||
layoutParams = LinearLayout.LayoutParams(0, ViewGroup.LayoutParams.WRAP_CONTENT, 1f)
|
||||
})
|
||||
bar.addView(ImageButton(this).apply {
|
||||
setImageResource(android.R.drawable.ic_menu_close_clear_cancel); setBackgroundColor(Color.TRANSPARENT)
|
||||
contentDescription = getString(R.string.stores_login_close); layoutParams = LinearLayout.LayoutParams(dp(48), dp(48))
|
||||
setOnClickListener { finish() }
|
||||
})
|
||||
progressBar = ProgressBar(this, null, android.R.attr.progressBarStyleHorizontal).apply {
|
||||
max = 100; visibility = View.GONE
|
||||
layoutParams = LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, dp(3))
|
||||
}
|
||||
host = FrameLayout(this).apply {
|
||||
setBackgroundColor(BACKGROUND)
|
||||
layoutParams = LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 0, 1f)
|
||||
}
|
||||
val panel = LinearLayout(this).apply {
|
||||
orientation = LinearLayout.VERTICAL; gravity = Gravity.CENTER; setBackgroundColor(BACKGROUND)
|
||||
setPadding(dp(24), dp(24), dp(24), dp(24))
|
||||
}
|
||||
status = TextView(this).apply { setTextColor(TEXT); textSize = 15f; gravity = Gravity.CENTER; text = "Preparing Microsoft sign-in…" }
|
||||
retry = Button(this).apply {
|
||||
text = getString(R.string.stores_login_retry); visibility = View.GONE
|
||||
setOnClickListener { startActivity(Intent(intent)); finish() }
|
||||
}
|
||||
panel.addView(status)
|
||||
panel.addView(retry, LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT).apply { topMargin = dp(16) })
|
||||
host.addView(panel, FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT))
|
||||
root.addView(bar); root.addView(progressBar); root.addView(host)
|
||||
return root
|
||||
}
|
||||
|
||||
private fun show(text: String) = runOnUiThread { if (!closed && view == null) status.text = text }
|
||||
|
||||
private fun progress(name: String, text: String) { step = name; show(text) }
|
||||
@@ -191,7 +243,6 @@ class XboxLoginActivity : ComponentActivity() {
|
||||
override fun shouldOverrideUrlLoading(view: WebView, request: WebResourceRequest): Boolean = !trusted(request.url.toString())
|
||||
override fun onPageFinished(view: WebView, url: String) {
|
||||
if (!trusted(url)) { finish(); return }
|
||||
status.text = "Microsoft sign-in"
|
||||
val uri = Uri.parse(url)
|
||||
if (uri.host == "login.live.com" && uri.path == "/ppsecure/post.srf") {
|
||||
view.evaluateJavascript("JSON.stringify(globalThis.ServerData ?? null)") { raw ->
|
||||
@@ -203,7 +254,14 @@ class XboxLoginActivity : ComponentActivity() {
|
||||
}
|
||||
}
|
||||
}
|
||||
host.addView(web, LinearLayout.LayoutParams(-1, 0, 1f))
|
||||
web.setBackgroundColor(BACKGROUND)
|
||||
web.webChromeClient = object : android.webkit.WebChromeClient() {
|
||||
override fun onProgressChanged(view: WebView?, newProgress: Int) {
|
||||
progressBar.progress = newProgress
|
||||
progressBar.visibility = if (newProgress in 1..99) View.VISIBLE else View.GONE
|
||||
}
|
||||
}
|
||||
host.addView(web, FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT))
|
||||
val headers = frame.getJSONObject("headers")
|
||||
val values = headers.keys().asSequence().associateWith { key ->
|
||||
require(key in allowedHeaders)
|
||||
@@ -212,7 +270,11 @@ class XboxLoginActivity : ComponentActivity() {
|
||||
web.loadUrl(frame.getString("url"), values)
|
||||
}
|
||||
|
||||
private fun disposeView() { view?.let { host.removeView(it); it.stopLoading(); it.destroy() }; view = null }
|
||||
private fun disposeView() {
|
||||
view?.let { host.removeView(it); it.stopLoading(); it.destroy() }
|
||||
view = null
|
||||
if (::progressBar.isInitialized) progressBar.visibility = View.GONE
|
||||
}
|
||||
override fun onDestroy() {
|
||||
closed = true
|
||||
val current = child; child = null
|
||||
@@ -225,6 +287,9 @@ class XboxLoginActivity : ComponentActivity() {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "XboxLogin"
|
||||
private const val BACKGROUND = 0xFF0A0B0D.toInt()
|
||||
private const val BAR = 0xFF121417.toInt()
|
||||
private const val TEXT = 0xFFF2F4F7.toInt()
|
||||
|
||||
internal fun failure(e: Exception): String {
|
||||
val message = e.message.orEmpty()
|
||||
|
||||
@@ -61,7 +61,7 @@ internal object XboxRuntime {
|
||||
val view = result.get(90, java.util.concurrent.TimeUnit.SECONDS)
|
||||
check(renew(app, id, token) && synchronized(state) { generation == current }) { "Xbox launch was cancelled" }
|
||||
return JSONObject().put("ok", true).put("socket", socket.path).put("lease", token)
|
||||
.put("exe", view.getString("exe")).put("playfab", view.opt("playfab"))
|
||||
.put("exe", view.getString("exe")).put("playfab", view.opt("playfab")).put("mountRoot", view.opt("mountRoot"))
|
||||
} catch (e: Exception) { released(token); throw e }
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ import androidx.compose.runtime.key
|
||||
import androidx.compose.runtime.mutableIntStateOf
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.produceState
|
||||
import androidx.compose.runtime.rememberCoroutineScope
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment
|
||||
@@ -73,8 +74,10 @@ import com.droiddeck.launcher.frontend.LogoPosition
|
||||
import com.droiddeck.launcher.frontend.SoundtrackCollectionArt
|
||||
import com.droiddeck.launcher.frontend.SteamGameArt
|
||||
import com.droiddeck.launcher.frontend.SteamGridDb
|
||||
import com.droiddeck.launcher.frontend.SteamInputOverride
|
||||
import com.droiddeck.launcher.frontend.SteamLaunchOptions
|
||||
import com.droiddeck.launcher.session.SessionPrefs
|
||||
import com.droiddeck.launcher.session.SessionState
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
@@ -336,6 +339,107 @@ internal fun SteamLaunchOptionsPanel(appId: Int) {
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun SteamInputOverridePanel(appId: Int) {
|
||||
val app = LocalContext.current.applicationContext
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val scope = rememberCoroutineScope()
|
||||
var selected by remember(appId) { mutableStateOf<SteamInputOverride.Mode?>(null) }
|
||||
var version by remember(appId) { mutableIntStateOf(0) }
|
||||
var saving by remember(appId) { mutableStateOf(false) }
|
||||
var loading by remember(appId) { mutableStateOf(true) }
|
||||
var error by remember(appId) { mutableStateOf<Int?>(null) }
|
||||
var saves by remember(appId) { mutableIntStateOf(0) }
|
||||
// SessionState.running is not snapshot state, so the panel polls it while shown.
|
||||
val sessionRunning by produceState(SessionState.running) {
|
||||
while (true) {
|
||||
value = SessionState.running
|
||||
kotlinx.coroutines.delay(1000)
|
||||
}
|
||||
}
|
||||
|
||||
LaunchedEffect(appId, version) {
|
||||
val savesAtStart = saves
|
||||
val read = withContext(Dispatchers.IO) { SteamInputOverride.current(app, appId) }
|
||||
// A save that finished while this read ran already set the selection; the read may predate it.
|
||||
if (!saving && saves == savesAtStart) selected = read
|
||||
loading = false
|
||||
}
|
||||
var wasRunning by remember(appId) { mutableStateOf(SessionState.running) }
|
||||
LaunchedEffect(sessionRunning) {
|
||||
// Steam may have changed the override while it ran, so every stop reloads it.
|
||||
if (wasRunning && !sessionRunning) {
|
||||
if (error == R.string.edit_steam_input_running) error = null
|
||||
loading = true
|
||||
version++
|
||||
}
|
||||
wasRunning = sessionRunning
|
||||
}
|
||||
val lifecycle = LocalLifecycleOwner.current.lifecycle
|
||||
DisposableEffect(lifecycle, appId) {
|
||||
val observer = LifecycleEventObserver { _, event ->
|
||||
if (event == Lifecycle.Event.ON_RESUME && !saving) {
|
||||
loading = true
|
||||
version++
|
||||
}
|
||||
}
|
||||
lifecycle.addObserver(observer)
|
||||
onDispose { lifecycle.removeObserver(observer) }
|
||||
}
|
||||
|
||||
val choices = listOf(
|
||||
SteamInputOverride.Mode.DEFAULT to R.string.edit_steam_input_default,
|
||||
SteamInputOverride.Mode.ENABLED to R.string.edit_steam_input_enable,
|
||||
SteamInputOverride.Mode.DISABLED to R.string.edit_steam_input_disable,
|
||||
)
|
||||
Column(Modifier.fillMaxWidth().tabPanel(), verticalArrangement = Arrangement.spacedBy(2.dp)) {
|
||||
Text(
|
||||
stringResource(R.string.edit_steam_input_override),
|
||||
fontSize = 13.sp,
|
||||
fontWeight = FontWeight.SemiBold,
|
||||
color = colors.onSurfaceVariant,
|
||||
modifier = Modifier.padding(start = 4.dp, bottom = 2.dp),
|
||||
)
|
||||
choices.forEach { (mode, label) ->
|
||||
MenuItem(
|
||||
stringResource(label),
|
||||
checked = selected == mode,
|
||||
enabled = selected != null && !saving && !loading && !sessionRunning && selected != mode,
|
||||
) {
|
||||
val before = selected ?: return@MenuItem
|
||||
saving = true
|
||||
scope.launch {
|
||||
try {
|
||||
val saved = withContext(Dispatchers.IO) { SteamInputOverride.set(app, appId, mode, before) }
|
||||
error = when (saved) {
|
||||
SteamInputOverride.Saved.YES -> null
|
||||
SteamInputOverride.Saved.NO -> R.string.edit_steam_input_not_saved
|
||||
SteamInputOverride.Saved.RUNNING -> R.string.edit_steam_input_running
|
||||
}
|
||||
if (saved == SteamInputOverride.Saved.YES) {
|
||||
saves++
|
||||
selected = mode
|
||||
} else version++
|
||||
} finally {
|
||||
saving = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
val message = error ?: when {
|
||||
sessionRunning -> R.string.edit_steam_input_running
|
||||
selected == null && !loading -> R.string.edit_steam_input_unavailable
|
||||
else -> R.string.edit_steam_input_hint
|
||||
}
|
||||
Text(
|
||||
stringResource(message),
|
||||
fontSize = 12.sp,
|
||||
color = if (error == null) colors.onSurfaceVariant else colors.error,
|
||||
modifier = Modifier.padding(start = 4.dp),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private class LoadedPosition(val value: LogoPosition.Value?)
|
||||
|
||||
@Composable
|
||||
|
||||
@@ -82,6 +82,7 @@ internal fun AgentEntry(
|
||||
if (reply.options.isNotEmpty()) AgentChoices(reply.options, answerable, onSent)
|
||||
}
|
||||
}
|
||||
is Entry.Notice -> Text(entry.text, color = colors.error, modifier = Modifier.padding(horizontal = 4.dp))
|
||||
is Entry.Thought -> AgentThought(entry.text, live = false)
|
||||
is Entry.Used -> if (entry.tool == "TodoWrite") AgentTodos(entry.input) else AgentToolCall(entry, running, children)
|
||||
is Entry.Result -> Unit
|
||||
|
||||
@@ -567,7 +567,8 @@ private fun labStage(lab: com.droiddeck.launcher.agent.LabProgress) = when (lab.
|
||||
else -> stringResource(R.string.agent_lab_stage_starting)
|
||||
}
|
||||
|
||||
private fun hasActivity() = AgentHost.lab != null || AgentHost.queue.isNotEmpty() || currentTodo() != null
|
||||
private fun hasActivity() = AgentHost.lab != null || AgentHost.queue.isNotEmpty() || currentTodo() != null ||
|
||||
com.droiddeck.launcher.agent.AgentSetup.problems.isNotEmpty()
|
||||
|
||||
/** The todo item in progress and how many are done, while the agent works through a list. */
|
||||
private fun currentTodo(): String? {
|
||||
@@ -594,6 +595,11 @@ private fun AgentActivity(labOpen: Boolean, onLab: () -> Unit) {
|
||||
Text(todo, fontSize = 12.5.sp, color = pal.onSurfaceVariant, maxLines = 1, overflow = TextOverflow.Ellipsis, modifier = Modifier.widthIn(max = 220.dp))
|
||||
}
|
||||
}
|
||||
val problems = com.droiddeck.launcher.agent.AgentSetup.problems
|
||||
if (problems.isNotEmpty()) AgentChip(warn = true, tag = "agent-tools-missing") {
|
||||
Text(stringResource(R.string.agent_tools_missing, problems.joinToString(", ")), fontSize = 12.5.sp, color = AttentionAmber,
|
||||
maxLines = 2, overflow = TextOverflow.Ellipsis, modifier = Modifier.widthIn(max = 260.dp))
|
||||
}
|
||||
for (queued in AgentHost.queue) AgentChip(warn = true) {
|
||||
Text(stringResource(R.string.agent_queued, queued.text), fontSize = 12.5.sp, color = AttentionAmber, maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis, modifier = Modifier.widthIn(max = 180.dp))
|
||||
|
||||
@@ -835,6 +835,7 @@ private fun LaunchTab(game: Library.SteamGame, s: FrontEndState, a: FrontEndActi
|
||||
LaunchSettings(s, a, host, game, hopRail ?: GameRef.key(game))
|
||||
if (canEditSteamLaunchOptions(game, s.shortcutPicker)) {
|
||||
SteamLaunchOptionsPanel(game.appId)
|
||||
SteamInputOverridePanel(game.appId)
|
||||
}
|
||||
val folder = game.gameFiles
|
||||
if (game.library == Library.ADDED && game.source == Library.ADDED && !s.shortcutPicker && folder != null) ShortcutFields(game, folder)
|
||||
|
||||
@@ -83,6 +83,7 @@ class ModeSettings(
|
||||
val forceSsbs: Boolean = false,
|
||||
val syncBackend: String? = null,
|
||||
val picturePosition: String? = null,
|
||||
val integerScaling: Boolean? = null,
|
||||
val stretch16x9: Boolean? = null,
|
||||
val steamClientArch: String? = null,
|
||||
val returnAfterGame: Boolean? = null,
|
||||
@@ -139,6 +140,7 @@ class ModeSettingsActions(
|
||||
val onForceSsbs: (Boolean) -> Unit = {},
|
||||
val onSyncBackend: (String) -> Unit = {},
|
||||
val onPicturePosition: (String) -> Unit = {},
|
||||
val onIntegerScaling: (Boolean) -> Unit = {},
|
||||
val onStretch16x9: (Boolean) -> Unit = {},
|
||||
val onSteamRepair: () -> Unit = {},
|
||||
val onSteamClientArch: (String) -> Unit = {},
|
||||
@@ -242,6 +244,18 @@ fun ModeSheetRows(s: ModeSettings, a: ModeSettingsActions, tab: String, extras:
|
||||
}
|
||||
}
|
||||
SettingsGroup(stringResource(R.string.display_image_scaling)) {
|
||||
s.integerScaling?.let { enabled ->
|
||||
ChoiceRow(
|
||||
host, "integer-scaling",
|
||||
stringResource(R.string.display_integer_scaling),
|
||||
stringResource(R.string.display_integer_scaling_hint),
|
||||
listOf(
|
||||
false to stringResource(R.string.display_scaling_fit),
|
||||
true to stringResource(R.string.display_scaling_integer),
|
||||
),
|
||||
enabled, onPick = a.onIntegerScaling,
|
||||
)
|
||||
}
|
||||
ChoiceRow(
|
||||
host, "upscaler", stringResource(R.string.display_filter), null,
|
||||
SessionPrefs.upscalerChoices(LocalContext.current), s.upscaler,
|
||||
|
||||
@@ -244,6 +244,8 @@ class DrawerActions(
|
||||
val fexPreset: String,
|
||||
val upscaler: Int = 0,
|
||||
val upscaleSharpness: Int = 75,
|
||||
val integerScaling: Boolean = false,
|
||||
val onIntegerScaling: (Boolean) -> Unit = {},
|
||||
val effects: ScreenEffects = ScreenEffects.OFF,
|
||||
val screenEffectsTarget: String = "auto",
|
||||
val screenEffectsTargets: List<Pair<String, String>> = emptyList(),
|
||||
@@ -275,6 +277,9 @@ class DrawerActions(
|
||||
val onFrameGenReset: () -> Unit = {},
|
||||
val fpsLimit: Int = 0,
|
||||
val onFpsLimit: (Int) -> Unit = {},
|
||||
val blackFrameInsertion: Boolean = false,
|
||||
val blackFrameInsertionAvailable: Boolean = false,
|
||||
val onBlackFrameInsertion: (Boolean) -> Unit = {},
|
||||
val onImportLossless: () -> Unit,
|
||||
val onKeyboard: () -> Unit,
|
||||
val onHardwareKeyboard: () -> Unit,
|
||||
@@ -615,6 +620,16 @@ internal fun SessionDrawer(open: Boolean, requestedPage: SessionDrawerPage, cont
|
||||
onChange = { a.onFpsLimit(if (it <= SessionPrefs.FPS_LIMIT_OFF) 0 else it) })
|
||||
}
|
||||
SettingsGroup(stringResource(R.string.display_image_scaling)) {
|
||||
if (a.steam) SettingsRow(stringResource(R.string.display_integer_scaling), null) {
|
||||
PadTextButton(
|
||||
onClick = { a.onIntegerScaling(!a.integerScaling) }
|
||||
) {
|
||||
Text(stringResource(
|
||||
if (a.integerScaling) R.string.display_scaling_integer
|
||||
else R.string.display_scaling_fit
|
||||
))
|
||||
}
|
||||
}
|
||||
ChoiceRow(host, "upscaler", stringResource(R.string.display_filter), null,
|
||||
SessionPrefs.upscalerChoices(LocalContext.current), a.upscaler,
|
||||
note = stringResource(R.string.display_filter_note),
|
||||
@@ -1112,6 +1127,9 @@ private fun ScreenEffectsGroup(
|
||||
ToggleRow(host, "crt", stringResource(R.string.drawer_crt), null, e.crt, chipModifier = track("crt")) { a.onEffects(e.copy(crt = it)) }
|
||||
ToggleRow(host, "ntsc", stringResource(R.string.drawer_ntsc), null, e.ntsc, chipModifier = track("ntsc")) { a.onEffects(e.copy(ntsc = it)) }
|
||||
ToggleRow(host, "fake-hdr", stringResource(R.string.drawer_fake_hdr), null, e.hdr, chipModifier = track("fake-hdr")) { a.onEffects(e.copy(hdr = it)) }
|
||||
if (a.blackFrameInsertionAvailable) ToggleRow(host, "bfi", stringResource(R.string.drawer_bfi),
|
||||
stringResource(R.string.drawer_bfi_note), a.blackFrameInsertion,
|
||||
chipModifier = track("bfi"), onChange = a.onBlackFrameInsertion)
|
||||
}
|
||||
val source = remember { MutableInteractionSource() }
|
||||
val hot = source.collectIsFocusedAsState().value || source.collectIsHoveredAsState().value
|
||||
|
||||
@@ -53,6 +53,8 @@ object CompositorHost {
|
||||
WaylandCompositor.nativeSetClockControl(java.io.File(context.filesDir, "${com.droiddeck.launcher.runtime.LinuxRuntime.DIR}/tmp/.bl-clock").path)
|
||||
ownVsyncThread = SessionPrefs.vsyncThread(context)
|
||||
WaylandCompositor.nativeSetRenderOnCommit(SessionPrefs.renderOnCommit(context))
|
||||
blackFrameInsertion = SessionPrefs.blackFrameInsertion(context)
|
||||
WaylandCompositor.nativeSetBlackFrameInsertion(blackFrameInsertion)
|
||||
pace(refreshHz, fpsLimit)
|
||||
if (!SessionState.running) WaylandCompositor.nativeSetOutputSize(outputWidth, outputHeight)
|
||||
if (started) {
|
||||
@@ -72,9 +74,12 @@ object CompositorHost {
|
||||
return true
|
||||
}
|
||||
|
||||
private var blackFrameInsertion = false
|
||||
private var pictureHolds = 0
|
||||
|
||||
private fun pace(refreshHz: Float, fpsLimit: Int) {
|
||||
WaylandCompositor.nativeSetFpsLimit(fpsLimit)
|
||||
WaylandCompositor.nativeSetLayerFrameRate(if (fpsLimit > 0) fpsLimit.toFloat() else refreshHz)
|
||||
WaylandCompositor.nativeSetLayerFrameRate(if (fpsLimit > 0 && !blackFrameInsertion) fpsLimit.toFloat() else refreshHz)
|
||||
WaylandCompositor.nativeSetOutputRefreshRate(refreshHz)
|
||||
SessionState.refreshHz = refreshHz
|
||||
}
|
||||
@@ -84,6 +89,27 @@ object CompositorHost {
|
||||
if (started) pace(refreshHz, fpsLimit)
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
fun setBlackFrameInsertion(on: Boolean, refreshHz: Float, fpsLimit: Int) {
|
||||
blackFrameInsertion = on
|
||||
WaylandCompositor.nativeSetBlackFrameInsertion(on)
|
||||
if (started) pace(refreshHz, fpsLimit)
|
||||
}
|
||||
|
||||
/** Presents only pictures until the matching release; false when nothing is strobing. */
|
||||
@Synchronized
|
||||
fun holdPicture(): Boolean {
|
||||
if (!started || !blackFrameInsertion) return false
|
||||
if (pictureHolds++ == 0) WaylandCompositor.nativeSetPictureHold(true)
|
||||
return true
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
fun releasePicture() {
|
||||
if (pictureHolds == 0) return
|
||||
if (--pictureHolds == 0) WaylandCompositor.nativeSetPictureHold(false)
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
fun resize(surface: Surface, rearm: () -> Unit) {
|
||||
if (!started) return
|
||||
|
||||
@@ -321,6 +321,10 @@ public final class WaylandCompositor {
|
||||
|
||||
public static native void nativeSetFpsLimit(int fps);
|
||||
|
||||
public static native void nativeSetBlackFrameInsertion(boolean on);
|
||||
|
||||
public static native void nativeSetPictureHold(boolean on);
|
||||
|
||||
public static native void nativeSetRenderOnCommit(boolean on);
|
||||
|
||||
public static native void nativeSetGpuTurbo(boolean on);
|
||||
|
||||
@@ -683,6 +683,8 @@
|
||||
<string name="drawer_page_display">العرض</string>
|
||||
<string name="drawer_frame_limit">حد الإطارات</string>
|
||||
<string name="drawer_frame_limit_note">يحدّ هذه اللعبة. تنتقل الشاشة إلى معدل تحديث يقبل القسمة على الحد إن وُجد، وقد تبدو الحدود الأخرى غير منتظمة. تستخدم ألعاب Steam حد الإطارات في Steam ضمن قائمة الوصول السريع.</string>
|
||||
<string name="drawer_bfi">إدراج إطار أسود</string>
|
||||
<string name="drawer_bfi_note">حركة أوضح: يتبع كل إطار تحديث أسود. يتطلب 100 هرتز أو أكثر؛ تعمل اللعبة بنصف معدل التحديث وتبدو أغمق. يتوقف أثناء تشغيل توليد الإطارات.</string>
|
||||
<string name="drawer_page_effects">المؤثرات</string>
|
||||
<string name="drawer_page_controls">عناصر التحكم</string>
|
||||
<string name="drawer_page_components">المكوّنات</string>
|
||||
@@ -1195,6 +1197,7 @@
|
||||
<string name="agent_hint_working">اكتب لإضافة الرسالة التالية إلى الانتظار</string>
|
||||
<string name="agent_queue">إضافة إلى الانتظار</string>
|
||||
<string name="agent_queued">التالي: %1$s</string>
|
||||
<string name="agent_tools_missing">أدوات الوكيل غير مثبتة: %1$s</string>
|
||||
<string name="agent_unqueue">لا تُرسل</string>
|
||||
<string name="agent_attach">إرفاق</string>
|
||||
<string name="agent_remove_attachment">إزالة</string>
|
||||
@@ -4266,4 +4269,9 @@
|
||||
<string name="hud_readings_shown">المعروض</string>
|
||||
<string name="hud_readings_count">%1$d من %2$d</string>
|
||||
<string name="exit_hint_back">اضغط زر الرجوع مرة أخرى للخروج</string>
|
||||
|
||||
<string name="display_integer_scaling">تحجيم صحيح بالأعداد الصحيحة</string>
|
||||
<string name="display_integer_scaling_hint">يستخدم أكبر معامل تكبير صحيح يناسب الشاشة. قد يقص الحواف. إذا كان المصدر أكبر من الناتج، فإن التحجيم الكسري يعرض الصورة كاملة. يتم ضبط الدقة بشكل منفصل.</string>
|
||||
<string name="display_scaling_integer">عدد صحيح</string>
|
||||
<string name="display_scaling_fit">ملاءمة</string>
|
||||
</resources>
|
||||
@@ -677,6 +677,8 @@
|
||||
<string name="drawer_page_display">Pantalla</string>
|
||||
<string name="drawer_frame_limit">Límite de fotogramas</string>
|
||||
<string name="drawer_frame_limit_note">Limita este juego. La pantalla cambia a una frecuencia de actualización que sea múltiplo exacto del límite cuando la hay; otros límites pueden verse irregulares. Los juegos de Steam usan el Límite de fotogramas de Steam en el menú Quick Access.</string>
|
||||
<string name="drawer_bfi">Inserción de cuadros negros</string>
|
||||
<string name="drawer_bfi_note">Movimiento más nítido: cada cuadro va seguido de un refresco negro. Requiere 100 Hz o más; el juego corre a la mitad de la frecuencia y se ve más oscuro. Se apaga con la generación de cuadros.</string>
|
||||
<string name="drawer_page_effects">Efectos</string>
|
||||
<string name="drawer_page_controls">Controles</string>
|
||||
<string name="drawer_page_components">Componentes</string>
|
||||
@@ -1213,6 +1215,7 @@
|
||||
<string name="agent_hint_working">Escribe para encolar el siguiente mensaje</string>
|
||||
<string name="agent_queue">Encolar</string>
|
||||
<string name="agent_queued">Siguiente: %1$s</string>
|
||||
<string name="agent_tools_missing">Herramientas del agente sin instalar: %1$s</string>
|
||||
<string name="agent_unqueue">No enviar</string>
|
||||
<string name="agent_attach">Adjuntar</string>
|
||||
<string name="agent_remove_attachment">Quitar</string>
|
||||
@@ -4117,4 +4120,9 @@
|
||||
<string name="hud_readings_shown">Mostrados</string>
|
||||
<string name="hud_readings_count">%1$d de %2$d</string>
|
||||
<string name="exit_hint_back">Presiona atrás una vez más para salir</string>
|
||||
|
||||
<string name="display_integer_scaling">Escalado de píxeles enteros</string>
|
||||
<string name="display_integer_scaling_hint">Usa la mayor escala entera que cabe. Puede recortar los bordes. Si la imagen original supera el tamaño de salida, el escalado fraccional muestra la imagen completa. La resolución se configura por separado.</string>
|
||||
<string name="display_scaling_integer">Entero</string>
|
||||
<string name="display_scaling_fit">Ajustar</string>
|
||||
</resources>
|
||||
@@ -675,6 +675,8 @@
|
||||
<string name="drawer_page_display">Екран</string>
|
||||
<string name="drawer_frame_limit">Ограничение на кадрите</string>
|
||||
<string name="drawer_frame_limit_note">Ограничава тази игра. Екранът преминава към честота на опресняване, която се дели точно на ограничението, ако има такава; другите ограничения може да изглеждат неравномерни. Игрите в Steam използват Frame Limit на Steam в менюто Quick Access.</string>
|
||||
<string name="drawer_bfi">Вмъкване на черни кадри</string>
|
||||
<string name="drawer_bfi_note">По-ясно движение: след всеки кадър следва черно опресняване. Нужни са 100 Hz или повече; играта върви на половината честота и изглежда по-тъмна. Изключено при генериране на кадри.</string>
|
||||
<string name="drawer_page_effects">Ефекти</string>
|
||||
<string name="drawer_page_controls">Контроли</string>
|
||||
<string name="drawer_page_components">Компоненти</string>
|
||||
@@ -1183,6 +1185,7 @@
|
||||
<string name="agent_hint_working">Въведете, за да наредите следващото съобщение</string>
|
||||
<string name="agent_queue">В опашката</string>
|
||||
<string name="agent_queued">Следващо: %1$s</string>
|
||||
<string name="agent_tools_missing">Инструментите на агента не са инсталирани: %1$s</string>
|
||||
<string name="agent_unqueue">Не изпращай</string>
|
||||
<string name="agent_attach">Прикачи</string>
|
||||
<string name="agent_remove_attachment">Премахни</string>
|
||||
@@ -4106,4 +4109,9 @@
|
||||
<string name="hud_readings_shown">Показани</string>
|
||||
<string name="hud_readings_count">%1$d от %2$d</string>
|
||||
<string name="exit_hint_back">Натиснете отново „Назад“, за да излезете</string>
|
||||
|
||||
<string name="display_integer_scaling">Целочислено мащабиране</string>
|
||||
<string name="display_integer_scaling_hint">Използва най-големия цял коефициент на мащабиране, който се побира. Възможно е изрязване на краищата. Ако източникът е по-голям от изхода, дробното мащабиране показва цялото изображение. Разделителната способност се настройва отделно.</string>
|
||||
<string name="display_scaling_integer">Цяло число</string>
|
||||
<string name="display_scaling_fit">Побиране</string>
|
||||
</resources>
|
||||
@@ -679,6 +679,8 @@
|
||||
<string name="drawer_page_display">Displej</string>
|
||||
<string name="drawer_frame_limit">Limit snímků</string>
|
||||
<string name="drawer_frame_limit_note">Omezí tuto hru. Displej se přepne na obnovovací frekvenci, kterou limit beze zbytku dělí, pokud nějakou má; jiné limity mohou působit nerovnoměrně. Hry ze Steamu používají Limit snímků Steamu v nabídce Rychlý přístup.</string>
|
||||
<string name="drawer_bfi">Vkládání černých snímků</string>
|
||||
<string name="drawer_bfi_note">Ostřejší pohyb: po každém snímku následuje černé obnovení. Vyžaduje 100 Hz a více; hra běží na polovině obnovovací frekvence a je tmavší. Vypnuto při generování snímků.</string>
|
||||
<string name="drawer_page_effects">Efekty</string>
|
||||
<string name="drawer_page_controls">Ovládání</string>
|
||||
<string name="drawer_page_components">Komponenty</string>
|
||||
@@ -1189,6 +1191,7 @@
|
||||
<string name="agent_hint_working">Psaním zařadíte další zprávu do fronty</string>
|
||||
<string name="agent_queue">Zařadit do fronty</string>
|
||||
<string name="agent_queued">Další: %1$s</string>
|
||||
<string name="agent_tools_missing">Nástroje agenta nejsou nainstalované: %1$s</string>
|
||||
<string name="agent_unqueue">Neposílat</string>
|
||||
<string name="agent_attach">Přiložit</string>
|
||||
<string name="agent_remove_attachment">Odebrat</string>
|
||||
@@ -4186,4 +4189,9 @@
|
||||
<string name="hud_readings_shown">Zobrazeno</string>
|
||||
<string name="hud_readings_count">%1$d z %2$d</string>
|
||||
<string name="exit_hint_back">Stiskněte znovu zpět pro ukončení</string>
|
||||
|
||||
<string name="display_integer_scaling">Celočíselné škálování</string>
|
||||
<string name="display_integer_scaling_hint">Použije největší celočíselné měřítko, které se vejde. Může oříznout okraje. Pokud je zdroj větší než výstup, zlomkové měřítko zobrazí celý obraz. Rozlišení se nastavuje samostatně.</string>
|
||||
<string name="display_scaling_integer">Celé číslo</string>
|
||||
<string name="display_scaling_fit">Přizpůsobit</string>
|
||||
</resources>
|
||||
@@ -675,6 +675,8 @@
|
||||
<string name="drawer_page_display">Skærm</string>
|
||||
<string name="drawer_frame_limit">Billedgrænse</string>
|
||||
<string name="drawer_frame_limit_note">Begrænser dette spil. Skærmen skifter til en opdateringshastighed, som grænsen går lige op i, når den har en; andre grænser kan virke ujævne. Steam-spil bruger Steams Frame Limit i Hurtig adgang-menuen.</string>
|
||||
<string name="drawer_bfi">Indsættelse af sorte billeder</string>
|
||||
<string name="drawer_bfi_note">Skarpere bevægelse: hvert billede efterfølges af en sort opdatering. Kræver 100 Hz eller mere; spillet kører ved halv opdateringshastighed og ser mørkere ud. Slået fra under billedgenerering.</string>
|
||||
<string name="drawer_page_effects">Effekter</string>
|
||||
<string name="drawer_page_controls">Kontroller</string>
|
||||
<string name="drawer_page_components">Komponenter</string>
|
||||
@@ -1183,6 +1185,7 @@
|
||||
<string name="agent_hint_working">Skriv for at sætte den næste besked i kø</string>
|
||||
<string name="agent_queue">Sæt i kø</string>
|
||||
<string name="agent_queued">Næste: %1$s</string>
|
||||
<string name="agent_tools_missing">Agentens værktøjer er ikke installeret: %1$s</string>
|
||||
<string name="agent_unqueue">Send ikke</string>
|
||||
<string name="agent_attach">Vedhæft</string>
|
||||
<string name="agent_remove_attachment">Fjern</string>
|
||||
@@ -4106,4 +4109,9 @@
|
||||
<string name="hud_readings_shown">Vist</string>
|
||||
<string name="hud_readings_count">%1$d af %2$d</string>
|
||||
<string name="exit_hint_back">Tryk tilbage igen for at afslutte</string>
|
||||
|
||||
<string name="display_integer_scaling">Heltalsskalering</string>
|
||||
<string name="display_integer_scaling_hint">Bruger den største hele skalering, der kan være på skærmen. Kan beskære kanterne. Hvis kilden er større end outputtet, viser brøkbaseret skalering hele billedet. Opløsningen indstilles separat.</string>
|
||||
<string name="display_scaling_integer">Heltal</string>
|
||||
<string name="display_scaling_fit">Tilpas</string>
|
||||
</resources>
|
||||
@@ -675,6 +675,8 @@
|
||||
<string name="drawer_page_display">Anzeige</string>
|
||||
<string name="drawer_frame_limit">Bildratenlimit</string>
|
||||
<string name="drawer_frame_limit_note">Begrenzt dieses Spiel. Der Bildschirm wechselt zu einer Bildwiederholrate, die durch das Limit glatt teilbar ist, sofern vorhanden; andere Limits können ungleichmäßig wirken. Steam-Spiele nutzen das Bildratenlimit von Steam im Schnellzugriffsmenü.</string>
|
||||
<string name="drawer_bfi">Schwarzbild-Einfügung</string>
|
||||
<string name="drawer_bfi_note">Schärfere Bewegung: Auf jedes Bild folgt ein schwarzer Refresh. Braucht 100 Hz oder mehr; das Spiel läuft mit halber Bildwiederholrate und wirkt dunkler. Aus, solange Frame Generation läuft.</string>
|
||||
<string name="drawer_page_effects">Effekte</string>
|
||||
<string name="drawer_page_controls">Steuerung</string>
|
||||
<string name="drawer_page_components">Komponenten</string>
|
||||
@@ -1175,6 +1177,7 @@
|
||||
<string name="agent_hint_working">Tippen, um die nächste Nachricht einzureihen</string>
|
||||
<string name="agent_queue">Einreihen</string>
|
||||
<string name="agent_queued">Als Nächstes: %1$s</string>
|
||||
<string name="agent_tools_missing">Agent-Werkzeuge nicht installiert: %1$s</string>
|
||||
<string name="agent_unqueue">Nicht senden</string>
|
||||
<string name="agent_attach">Anhängen</string>
|
||||
<string name="agent_remove_attachment">Entfernen</string>
|
||||
@@ -4106,4 +4109,9 @@
|
||||
<string name="hud_readings_shown">Angezeigt</string>
|
||||
<string name="hud_readings_count">%1$d von %2$d</string>
|
||||
<string name="exit_hint_back">Noch einmal zurück drücken zum Beenden</string>
|
||||
|
||||
<string name="display_integer_scaling">Ganzzahlige Skalierung</string>
|
||||
<string name="display_integer_scaling_hint">Verwendet die größte passende ganzzahlige Skalierung. Bildschirmränder können abgeschnitten werden. Ist die Quelle größer als die Ausgabe, zeigt eine gebrochene Skalierung das vollständige Bild. Die Auflösung wird separat eingestellt.</string>
|
||||
<string name="display_scaling_integer">Ganzzahlig</string>
|
||||
<string name="display_scaling_fit">Anpassen</string>
|
||||
</resources>
|
||||
@@ -675,6 +675,8 @@
|
||||
<string name="drawer_page_display">Οθόνη</string>
|
||||
<string name="drawer_frame_limit">Όριο καρέ</string>
|
||||
<string name="drawer_frame_limit_note">Περιορίζει αυτό το παιχνίδι. Η οθόνη αλλάζει σε ρυθμό ανανέωσης που διαιρείται ακριβώς με το όριο, αν υπάρχει· άλλα όρια μπορεί να φαίνονται ανομοιόμορφα. Τα παιχνίδια Steam χρησιμοποιούν το Frame Limit του Steam στο μενού Quick Access.</string>
|
||||
<string name="drawer_bfi">Εισαγωγή μαύρων καρέ</string>
|
||||
<string name="drawer_bfi_note">Πιο καθαρή κίνηση: κάθε καρέ ακολουθείται από μαύρη ανανέωση. Απαιτεί 100 Hz ή περισσότερα· το παιχνίδι τρέχει στον μισό ρυθμό ανανέωσης και φαίνεται πιο σκοτεινό. Ανενεργό όσο λειτουργεί η δημιουργία καρέ.</string>
|
||||
<string name="drawer_page_effects">Εφέ</string>
|
||||
<string name="drawer_page_controls">Χειριστήρια</string>
|
||||
<string name="drawer_page_components">Στοιχεία</string>
|
||||
@@ -1183,6 +1185,7 @@
|
||||
<string name="agent_hint_working">Γράψτε για να προσθέσετε το επόμενο μήνυμα στην ουρά</string>
|
||||
<string name="agent_queue">Στην ουρά</string>
|
||||
<string name="agent_queued">Επόμενο: %1$s</string>
|
||||
<string name="agent_tools_missing">Τα εργαλεία του πράκτορα δεν εγκαταστάθηκαν: %1$s</string>
|
||||
<string name="agent_unqueue">Να μην σταλεί</string>
|
||||
<string name="agent_attach">Επισύναψη</string>
|
||||
<string name="agent_remove_attachment">Αφαίρεση</string>
|
||||
@@ -4106,4 +4109,9 @@
|
||||
<string name="hud_readings_shown">Εμφανίζονται</string>
|
||||
<string name="hud_readings_count">%1$d από %2$d</string>
|
||||
<string name="exit_hint_back">Πατήστε ξανά πίσω για έξοδο</string>
|
||||
|
||||
<string name="display_integer_scaling">Ακέραια κλιμάκωση</string>
|
||||
<string name="display_integer_scaling_hint">Χρησιμοποιεί τη μεγαλύτερη ακέραια κλίμακα που χωράει. Ενδέχεται να περικοπούν οι άκρες. Αν η πηγή είναι μεγαλύτερη από την έξοδο, η κλασματική κλιμάκωση εμφανίζει ολόκληρη την εικόνα. Η ανάλυση ρυθμίζεται ξεχωριστά.</string>
|
||||
<string name="display_scaling_integer">Ακέραιος</string>
|
||||
<string name="display_scaling_fit">Προσαρμογή</string>
|
||||
</resources>
|
||||
@@ -677,6 +677,8 @@
|
||||
<string name="drawer_page_display">Pantalla</string>
|
||||
<string name="drawer_frame_limit">Límite de fotogramas</string>
|
||||
<string name="drawer_frame_limit_note">Limita este juego. La pantalla cambia a una frecuencia de actualización que sea múltiplo exacto del límite cuando la hay; otros límites pueden verse irregulares. Los juegos de Steam usan el Límite de fotogramas de Steam en el menú Quick Access.</string>
|
||||
<string name="drawer_bfi">Inserción de fotogramas negros</string>
|
||||
<string name="drawer_bfi_note">Movimiento más nítido: cada fotograma va seguido de un refresco negro. Requiere 100 Hz o más; el juego va a la mitad de la frecuencia y se ve más oscuro. Desactivado con la generación de fotogramas.</string>
|
||||
<string name="drawer_page_effects">Efectos</string>
|
||||
<string name="drawer_page_controls">Controles</string>
|
||||
<string name="drawer_page_components">Componentes</string>
|
||||
@@ -1186,6 +1188,7 @@
|
||||
<string name="agent_hint_working">Escribe para encolar el siguiente mensaje</string>
|
||||
<string name="agent_queue">Encolar</string>
|
||||
<string name="agent_queued">Siguiente: %1$s</string>
|
||||
<string name="agent_tools_missing">Herramientas del agente sin instalar: %1$s</string>
|
||||
<string name="agent_unqueue">No enviar</string>
|
||||
<string name="agent_attach">Adjuntar</string>
|
||||
<string name="agent_remove_attachment">Quitar</string>
|
||||
@@ -4146,4 +4149,9 @@
|
||||
<string name="hud_readings_shown">Mostrados</string>
|
||||
<string name="hud_readings_count">%1$d de %2$d</string>
|
||||
<string name="exit_hint_back">Pulsa atrás una vez más para salir</string>
|
||||
|
||||
<string name="display_integer_scaling">Escalado de píxeles enteros</string>
|
||||
<string name="display_integer_scaling_hint">Usa la mayor escala entera que cabe. Puede recortar los bordes. Si la imagen original supera el tamaño de salida, el escalado fraccional muestra la imagen completa. La resolución se configura por separado.</string>
|
||||
<string name="display_scaling_integer">Entero</string>
|
||||
<string name="display_scaling_fit">Ajustar</string>
|
||||
</resources>
|
||||
@@ -675,6 +675,8 @@
|
||||
<string name="drawer_page_display">Näyttö</string>
|
||||
<string name="drawer_frame_limit">Kuvanopeusraja</string>
|
||||
<string name="drawer_frame_limit_note">Rajoittaa tätä peliä. Näyttö vaihtaa virkistystaajuuteen, joka on rajan tasakerrannainen, jos sellainen on; muut rajat voivat näyttää epätasaisilta. Steam-pelit käyttävät Steamin Frame Limit -asetusta Pikavalikossa.</string>
|
||||
<string name="drawer_bfi">Mustien kuvien lisäys</string>
|
||||
<string name="drawer_bfi_note">Terävämpi liike: jokaista kuvaa seuraa musta päivitys. Vaatii vähintään 100 Hz; peli pyörii puolella virkistystaajuudesta ja näyttää tummemmalta. Pois päältä kuvien generoinnin aikana.</string>
|
||||
<string name="drawer_page_effects">Tehosteet</string>
|
||||
<string name="drawer_page_controls">Ohjaimet</string>
|
||||
<string name="drawer_page_components">Komponentit</string>
|
||||
@@ -1183,6 +1185,7 @@
|
||||
<string name="agent_hint_working">Kirjoita lisätäksesi seuraavan viestin jonoon</string>
|
||||
<string name="agent_queue">Jono</string>
|
||||
<string name="agent_queued">Seuraava: %1$s</string>
|
||||
<string name="agent_tools_missing">Agentin työkaluja ei ole asennettu: %1$s</string>
|
||||
<string name="agent_unqueue">Älä lähetä</string>
|
||||
<string name="agent_attach">Liitä</string>
|
||||
<string name="agent_remove_attachment">Poista</string>
|
||||
@@ -4106,4 +4109,9 @@
|
||||
<string name="hud_readings_shown">Näkyvissä</string>
|
||||
<string name="hud_readings_count">%1$d / %2$d</string>
|
||||
<string name="exit_hint_back">Paina takaisin vielä kerran poistuaksesi</string>
|
||||
|
||||
<string name="display_integer_scaling">Kokonaislukuskaalaus</string>
|
||||
<string name="display_integer_scaling_hint">Käyttää suurinta kokonaislukukerrointa, joka mahtuu näyttöön. Reunat voivat rajautua. Jos lähde on tulostetta suurempi, murto-osaskaalaus näyttää koko kuvan. Resoluutio määritetään erikseen.</string>
|
||||
<string name="display_scaling_integer">Kokonaisluku</string>
|
||||
<string name="display_scaling_fit">Sovita</string>
|
||||
</resources>
|
||||
@@ -677,6 +677,8 @@
|
||||
<string name="drawer_page_display">Affichage</string>
|
||||
<string name="drawer_frame_limit">Limite d\'images</string>
|
||||
<string name="drawer_frame_limit_note">Limite ce jeu. L\'écran passe à une fréquence de rafraîchissement multiple de la limite lorsqu\'il en propose une ; les autres limites peuvent paraître irrégulières. Les jeux Steam utilisent la limite d\'images de Steam dans le menu d\'accès rapide.</string>
|
||||
<string name="drawer_bfi">Insertion d\'images noires</string>
|
||||
<string name="drawer_bfi_note">Mouvement plus net : chaque image est suivie d\'un rafraîchissement noir. Nécessite 100 Hz ou plus ; le jeu tourne à la moitié de la fréquence et paraît plus sombre. Désactivé avec la génération d\'images.</string>
|
||||
<string name="drawer_page_effects">Effets</string>
|
||||
<string name="drawer_page_controls">Contrôles</string>
|
||||
<string name="drawer_page_components">Composants</string>
|
||||
@@ -1186,6 +1188,7 @@
|
||||
<string name="agent_hint_working">Tapez pour mettre le prochain message en attente</string>
|
||||
<string name="agent_queue">Mettre en attente</string>
|
||||
<string name="agent_queued">Suivant : %1$s</string>
|
||||
<string name="agent_tools_missing">Outils de l’agent non installés : %1$s</string>
|
||||
<string name="agent_unqueue">Ne pas envoyer</string>
|
||||
<string name="agent_attach">Joindre</string>
|
||||
<string name="agent_remove_attachment">Supprimer</string>
|
||||
@@ -4145,4 +4148,9 @@
|
||||
<string name="hud_readings_shown">Affichés</string>
|
||||
<string name="hud_readings_count">%1$d sur %2$d</string>
|
||||
<string name="exit_hint_back">Appuyez à nouveau sur retour pour quitter</string>
|
||||
|
||||
<string name="display_integer_scaling">Mise à l’échelle entière</string>
|
||||
<string name="display_integer_scaling_hint">Utilise le plus grand facteur d’échelle entier adapté. Les bords peuvent être rognés. Si la source est plus grande que la sortie, la mise à l’échelle fractionnaire affiche l’image entière. La résolution se règle séparément.</string>
|
||||
<string name="display_scaling_integer">Entier</string>
|
||||
<string name="display_scaling_fit">Ajuster</string>
|
||||
</resources>
|
||||
@@ -675,6 +675,8 @@
|
||||
<string name="drawer_page_display">डिस्प्ले</string>
|
||||
<string name="drawer_frame_limit">फ़्रेम सीमा</string>
|
||||
<string name="drawer_frame_limit_note">इस गेम को सीमित करता है। अगर डिस्प्ले में ऐसा रिफ़्रेश रेट है जिसे सीमा बराबर भाग देती है, तो वह उस पर चला जाता है; दूसरी सीमाएं असमान लग सकती हैं। Steam गेम, Quick Access मेनू में Steam की Frame Limit इस्तेमाल करते हैं।</string>
|
||||
<string name="drawer_bfi">ब्लैक फ़्रेम इंसर्शन</string>
|
||||
<string name="drawer_bfi_note">ज़्यादा साफ़ मोशन: हर फ़्रेम के बाद एक काला रिफ़्रेश आता है। 100 Hz या ज़्यादा चाहिए; गेम आधे रिफ़्रेश रेट पर चलता है और गहरा दिखता है। फ़्रेम जनरेशन चालू होने पर बंद रहता है।</string>
|
||||
<string name="drawer_page_effects">इफ़ेक्ट</string>
|
||||
<string name="drawer_page_controls">कंट्रोल</string>
|
||||
<string name="drawer_page_components">कॉम्पोनेंट</string>
|
||||
@@ -1183,6 +1185,7 @@
|
||||
<string name="agent_hint_working">अगला संदेश कतार में जोड़ने के लिए टाइप करें</string>
|
||||
<string name="agent_queue">कतार में जोड़ें</string>
|
||||
<string name="agent_queued">अगला: %1$s</string>
|
||||
<string name="agent_tools_missing">एजेंट टूल इंस्टॉल नहीं हुए: %1$s</string>
|
||||
<string name="agent_unqueue">न भेजें</string>
|
||||
<string name="agent_attach">संलग्न करें</string>
|
||||
<string name="agent_remove_attachment">हटाएँ</string>
|
||||
@@ -4106,4 +4109,9 @@
|
||||
<string name="hud_readings_shown">दिखाए गए</string>
|
||||
<string name="hud_readings_count">%2$d में से %1$d</string>
|
||||
<string name="exit_hint_back">बाहर निकलने के लिए फिर से बैक दबाएँ</string>
|
||||
|
||||
<string name="display_integer_scaling">पूर्णांक स्केलिंग</string>
|
||||
<string name="display_integer_scaling_hint">स्क्रीन में समाने वाला सबसे बड़ा पूर्णांक स्केल उपयोग करता है। किनारे कट सकते हैं। यदि स्रोत आउटपुट से बड़ा है, तो भिन्नात्मक स्केलिंग पूरी छवि दिखाती है। रिज़ॉल्यूशन अलग से सेट होता है।</string>
|
||||
<string name="display_scaling_integer">पूर्णांक</string>
|
||||
<string name="display_scaling_fit">फ़िट</string>
|
||||
</resources>
|
||||
@@ -675,6 +675,8 @@
|
||||
<string name="drawer_page_display">Kijelző</string>
|
||||
<string name="drawer_frame_limit">Képkockakorlát</string>
|
||||
<string name="drawer_frame_limit_note">Korlátozza ezt a játékot. A kijelző olyan frissítési frekvenciára vált, amelyet a korlát egyenletesen oszt, ha van ilyen; más korlátok egyenetlennek tűnhetnek. A Steam-játékok a Steam képkockakorlátját használják a Gyors hozzáférés menüben.</string>
|
||||
<string name="drawer_bfi">Fekete képkocka beszúrása</string>
|
||||
<string name="drawer_bfi_note">Élesebb mozgás: minden képkockát fekete frissítés követ. Legalább 100 Hz kell; a játék a frissítési frekvencia felével fut és sötétebb. Képkocka-generálás közben ki van kapcsolva.</string>
|
||||
<string name="drawer_page_effects">Effektek</string>
|
||||
<string name="drawer_page_controls">Vezérlők</string>
|
||||
<string name="drawer_page_components">Összetevők</string>
|
||||
@@ -1183,6 +1185,7 @@
|
||||
<string name="agent_hint_working">Gépelj a következő üzenet sorba állításához</string>
|
||||
<string name="agent_queue">Sorba állítás</string>
|
||||
<string name="agent_queued">Következő: %1$s</string>
|
||||
<string name="agent_tools_missing">Az ügynök eszközei nincsenek telepítve: %1$s</string>
|
||||
<string name="agent_unqueue">Ne küldd el</string>
|
||||
<string name="agent_attach">Csatolás</string>
|
||||
<string name="agent_remove_attachment">Eltávolítás</string>
|
||||
@@ -4106,4 +4109,9 @@
|
||||
<string name="hud_readings_shown">Megjelenítve</string>
|
||||
<string name="hud_readings_count">%1$d / %2$d</string>
|
||||
<string name="exit_hint_back">Nyomd meg még egyszer a visszát a kilépéshez</string>
|
||||
|
||||
<string name="display_integer_scaling">Egész számú méretezés</string>
|
||||
<string name="display_integer_scaling_hint">A legnagyobb elférő egész számú méretezést használja. A szélek levágódhatnak. Ha a forrás nagyobb a kimenetnél, a tört méretezés a teljes képet jeleníti meg. A felbontás külön állítható.</string>
|
||||
<string name="display_scaling_integer">Egész szám</string>
|
||||
<string name="display_scaling_fit">Igazítás</string>
|
||||
</resources>
|
||||
@@ -673,6 +673,8 @@
|
||||
<string name="drawer_page_display">Tampilan</string>
|
||||
<string name="drawer_frame_limit">Batas frame</string>
|
||||
<string name="drawer_frame_limit_note">Membatasi gim ini. Layar beralih ke refresh rate yang habis dibagi batas tersebut jika ada; batas lain bisa terlihat tidak rata. Gim Steam menggunakan Frame Limit milik Steam di menu Quick Access.</string>
|
||||
<string name="drawer_bfi">Penyisipan bingkai hitam</string>
|
||||
<string name="drawer_bfi_note">Gerakan lebih tajam: setiap bingkai diikuti refresh hitam. Butuh 100 Hz atau lebih; game berjalan di setengah refresh rate dan terlihat lebih gelap. Mati saat pembuatan bingkai aktif.</string>
|
||||
<string name="drawer_page_effects">Efek</string>
|
||||
<string name="drawer_page_controls">Kontrol</string>
|
||||
<string name="drawer_page_components">Komponen</string>
|
||||
@@ -1180,6 +1182,7 @@
|
||||
<string name="agent_hint_working">Ketik untuk mengantrekan pesan berikutnya</string>
|
||||
<string name="agent_queue">Antrekan</string>
|
||||
<string name="agent_queued">Berikutnya: %1$s</string>
|
||||
<string name="agent_tools_missing">Alat agen tidak terpasang: %1$s</string>
|
||||
<string name="agent_unqueue">Jangan kirim</string>
|
||||
<string name="agent_attach">Lampirkan</string>
|
||||
<string name="agent_remove_attachment">Hapus</string>
|
||||
@@ -4076,4 +4079,9 @@
|
||||
<string name="hud_readings_shown">Ditampilkan</string>
|
||||
<string name="hud_readings_count">%1$d dari %2$d</string>
|
||||
<string name="exit_hint_back">Tekan kembali sekali lagi untuk keluar</string>
|
||||
|
||||
<string name="display_integer_scaling">Penskalaan bilangan bulat</string>
|
||||
<string name="display_integer_scaling_hint">Menggunakan skala bilangan bulat terbesar yang muat. Tepi layar mungkin terpotong. Jika sumber lebih besar daripada keluaran, penskalaan pecahan menampilkan seluruh gambar. Resolusi diatur secara terpisah.</string>
|
||||
<string name="display_scaling_integer">Bilangan bulat</string>
|
||||
<string name="display_scaling_fit">Sesuaikan</string>
|
||||
</resources>
|
||||
@@ -677,6 +677,8 @@
|
||||
<string name="drawer_page_display">Schermo</string>
|
||||
<string name="drawer_frame_limit">Limite frame</string>
|
||||
<string name="drawer_frame_limit_note">Limita questo gioco. Lo schermo passa a una frequenza di aggiornamento divisibile per il limite, se disponibile; altri limiti possono risultare irregolari. I giochi Steam usano il Limite frame di Steam nel menu di accesso rapido.</string>
|
||||
<string name="drawer_bfi">Inserimento di fotogrammi neri</string>
|
||||
<string name="drawer_bfi_note">Movimento più nitido: ogni fotogramma è seguito da un refresh nero. Richiede almeno 100 Hz; il gioco gira a metà della frequenza e appare più scuro. Disattivato con la generazione di fotogrammi.</string>
|
||||
<string name="drawer_page_effects">Effetti</string>
|
||||
<string name="drawer_page_controls">Controlli</string>
|
||||
<string name="drawer_page_components">Componenti</string>
|
||||
@@ -1178,6 +1180,7 @@
|
||||
<string name="agent_hint_working">Digita per mettere in coda il messaggio successivo</string>
|
||||
<string name="agent_queue">Metti in coda</string>
|
||||
<string name="agent_queued">Prossimo: %1$s</string>
|
||||
<string name="agent_tools_missing">Strumenti dell’agente non installati: %1$s</string>
|
||||
<string name="agent_unqueue">Non inviare</string>
|
||||
<string name="agent_attach">Allega</string>
|
||||
<string name="agent_remove_attachment">Rimuovi</string>
|
||||
@@ -4145,4 +4148,9 @@
|
||||
<string name="hud_readings_shown">Mostrati</string>
|
||||
<string name="hud_readings_count">%1$d di %2$d</string>
|
||||
<string name="exit_hint_back">Premi di nuovo indietro per uscire</string>
|
||||
|
||||
<string name="display_integer_scaling">Ridimensionamento intero</string>
|
||||
<string name="display_integer_scaling_hint">Usa il massimo fattore di scala intero che entra nello schermo. I bordi potrebbero essere tagliati. Se la sorgente è più grande dell\'output, la scalatura frazionaria mostra l\'intera immagine. La risoluzione si configura separatamente.</string>
|
||||
<string name="display_scaling_integer">Intero</string>
|
||||
<string name="display_scaling_fit">Adatta</string>
|
||||
</resources>
|
||||
@@ -357,7 +357,7 @@
|
||||
<string name="mode_return_after_game">ゲーム終了後にDroidDeckへ戻る</string>
|
||||
<string name="mode_return_after_game_hint">DroidDeckや他のランチャーから起動したゲームを閉じると、Steamが正しく終了し(クラウドセーブの同期を先に完了)、起動元に戻ります。オフ:Steamに留まります。</string>
|
||||
<string name="mode_shader_precache">シェーダーの事前キャッシュ</string>
|
||||
<string name="mode_shader_precache_hint">Steamがゲーム用にビルド済みのシェーダーをダウンロードしてバックグラウンドで処理するため、ゲームのカクつきが減ります。オフにするとデータ通信量、ストレージ、バッテリーを節約できますが、ゲームはプレイ中にシェーダーをビルドします。Steamの「ダウンロード」>「シェーダーの事前キャッシュ」と同じ設定です。次回のセッションから適用されます。</string>
|
||||
<string name="mode_shader_precache_hint">Steamがゲーム用にビルド済みのシェーダーをダウンロードしてバックグラウンドで処理するため、ゲームのカクつきが減ります。オフにするとデータ通信量、ストレージ、バッテリーを節約できますが、ゲームはプレイ中にシェーダーをビルドします。Steamの「ダウンロード」>「シェーダーの事前キャッシュ」と同じ設定です。次回のセッションから適用されます。</string>
|
||||
<string name="mode_steam_repair">Steamクライアントを修復</string>
|
||||
<string name="mode_steam_repair_hint">次回Steamの起動時にSteamクライアントを再ダウンロードします。Steamが読み込み画面のまま進まない場合に使用してください。ゲーム、ログイン情報、設定は保持されます。</string>
|
||||
<string name="mode_steam_repair_queued">次回Steamの起動時にSteamクライアントを再ダウンロードします。</string>
|
||||
@@ -673,6 +673,8 @@
|
||||
<string name="drawer_page_display">表示</string>
|
||||
<string name="drawer_frame_limit">フレームレート制限</string>
|
||||
<string name="drawer_frame_limit_note">このゲームのフレームレートを制限します。上限で割り切れるリフレッシュレートがあれば画面はそれに切り替わり、それ以外の上限では表示が不均一になることがあります。SteamゲームではクイックアクセスメニューにあるSteamのフレームレート制限を使用します。</string>
|
||||
<string name="drawer_bfi">黒フレーム挿入</string>
|
||||
<string name="drawer_bfi_note">動きがくっきり: 各フレームの後に黒いリフレッシュが入ります。100 Hz 以上が必要で、ゲームはリフレッシュレートの半分で動作し、画面は暗くなります。フレーム生成中はオフです。</string>
|
||||
<string name="drawer_page_effects">エフェクト</string>
|
||||
<string name="drawer_page_controls">コントロール</string>
|
||||
<string name="drawer_page_components">コンポーネント</string>
|
||||
@@ -1180,6 +1182,7 @@
|
||||
<string name="agent_hint_working">入力すると次のメッセージをキューに追加できます</string>
|
||||
<string name="agent_queue">キューに追加</string>
|
||||
<string name="agent_queued">次: %1$s</string>
|
||||
<string name="agent_tools_missing">エージェントのツールが未インストール: %1$s</string>
|
||||
<string name="agent_unqueue">送信しない</string>
|
||||
<string name="agent_attach">添付</string>
|
||||
<string name="agent_remove_attachment">削除</string>
|
||||
@@ -4076,4 +4079,9 @@
|
||||
<string name="hud_readings_shown">表示中</string>
|
||||
<string name="hud_readings_count">%2$d 中 %1$d</string>
|
||||
<string name="exit_hint_back">もう一度戻るを押すと終了します</string>
|
||||
</resources>
|
||||
|
||||
<string name="display_integer_scaling">整数スケーリング</string>
|
||||
<string name="display_integer_scaling_hint">画面に収まる最大の整数倍率を使用します。画面の端が切れる場合があります。元画像が出力より大きい場合、小数倍率で画像全体を表示します。解像度は別途設定します。</string>
|
||||
<string name="display_scaling_integer">整数</string>
|
||||
<string name="display_scaling_fit">画面に合わせる</string>
|
||||
</resources>
|
||||
@@ -673,6 +673,8 @@
|
||||
<string name="drawer_page_display">디스플레이</string>
|
||||
<string name="drawer_frame_limit">프레임 제한</string>
|
||||
<string name="drawer_frame_limit_note">이 게임의 프레임을 제한합니다. 제한값으로 나누어떨어지는 주사율이 있으면 디스플레이가 그 주사율로 전환되며, 그 밖의 제한값은 고르지 않게 보일 수 있습니다. Steam 게임은 빠른 액세스 메뉴의 Steam 프레임 제한을 사용합니다.</string>
|
||||
<string name="drawer_bfi">블랙 프레임 삽입</string>
|
||||
<string name="drawer_bfi_note">더 선명한 움직임: 매 프레임 뒤에 검은 화면 갱신이 들어갑니다. 100Hz 이상이 필요하며 게임은 주사율의 절반으로 실행되고 더 어둡게 보입니다. 프레임 생성 중에는 꺼집니다.</string>
|
||||
<string name="drawer_page_effects">효과</string>
|
||||
<string name="drawer_page_controls">컨트롤</string>
|
||||
<string name="drawer_page_components">구성 요소</string>
|
||||
@@ -1180,6 +1182,7 @@
|
||||
<string name="agent_hint_working">입력하면 다음 메시지가 대기열에 추가됩니다</string>
|
||||
<string name="agent_queue">대기열에 추가</string>
|
||||
<string name="agent_queued">다음: %1$s</string>
|
||||
<string name="agent_tools_missing">에이전트 도구가 설치되지 않음: %1$s</string>
|
||||
<string name="agent_unqueue">보내지 않기</string>
|
||||
<string name="agent_attach">첨부</string>
|
||||
<string name="agent_remove_attachment">제거</string>
|
||||
@@ -4076,4 +4079,9 @@
|
||||
<string name="hud_readings_shown">표시됨</string>
|
||||
<string name="hud_readings_count">%2$d 중 %1$d</string>
|
||||
<string name="exit_hint_back">한 번 더 뒤로를 누르면 종료됩니다</string>
|
||||
|
||||
<string name="display_integer_scaling">정수 배율 조정</string>
|
||||
<string name="display_integer_scaling_hint">화면에 맞는 가장 큰 정수 배율을 사용합니다. 화면 가장자리가 잘릴 수 있습니다. 원본이 출력보다 크면 소수 배율로 전체 이미지를 표시합니다. 해상도는 별도로 설정합니다.</string>
|
||||
<string name="display_scaling_integer">정수</string>
|
||||
<string name="display_scaling_fit">화면에 맞춤</string>
|
||||
</resources>
|
||||
@@ -673,6 +673,8 @@
|
||||
<string name="drawer_page_display">Paparan</string>
|
||||
<string name="drawer_frame_limit">Had bingkai</string>
|
||||
<string name="drawer_frame_limit_note">Mengehadkan permainan ini. Paparan bertukar kepada kadar segar semula yang boleh dibahagi sama rata dengan had jika ada; had lain mungkin kelihatan tidak sekata. Permainan Steam menggunakan Frame Limit Steam dalam menu Akses Pantas.</string>
|
||||
<string name="drawer_bfi">Sisipan bingkai hitam</string>
|
||||
<string name="drawer_bfi_note">Gerakan lebih tajam: setiap bingkai diikuti segar semula hitam. Perlu 100 Hz atau lebih; permainan berjalan pada separuh kadar segar semula dan kelihatan lebih gelap. Dimatikan semasa penjanaan bingkai.</string>
|
||||
<string name="drawer_page_effects">Kesan</string>
|
||||
<string name="drawer_page_controls">Kawalan</string>
|
||||
<string name="drawer_page_components">Komponen</string>
|
||||
@@ -1180,6 +1182,7 @@
|
||||
<string name="agent_hint_working">Taip untuk membariskan mesej seterusnya</string>
|
||||
<string name="agent_queue">Baris gilir</string>
|
||||
<string name="agent_queued">Seterusnya: %1$s</string>
|
||||
<string name="agent_tools_missing">Alat ejen tidak dipasang: %1$s</string>
|
||||
<string name="agent_unqueue">Jangan hantar</string>
|
||||
<string name="agent_attach">Lampirkan</string>
|
||||
<string name="agent_remove_attachment">Alih keluar</string>
|
||||
@@ -4076,4 +4079,9 @@
|
||||
<string name="hud_readings_shown">Dipaparkan</string>
|
||||
<string name="hud_readings_count">%1$d daripada %2$d</string>
|
||||
<string name="exit_hint_back">Tekan kembali sekali lagi untuk keluar</string>
|
||||
|
||||
<string name="display_integer_scaling">Penskalaan integer</string>
|
||||
<string name="display_integer_scaling_hint">Menggunakan skala nombor bulat terbesar yang muat. Tepi skrin mungkin terpotong. Jika sumber lebih besar daripada output, penskalaan pecahan memaparkan keseluruhan imej. Resolusi ditetapkan secara berasingan.</string>
|
||||
<string name="display_scaling_integer">Integer</string>
|
||||
<string name="display_scaling_fit">Muat</string>
|
||||
</resources>
|
||||
@@ -675,6 +675,8 @@
|
||||
<string name="drawer_page_display">Skjerm</string>
|
||||
<string name="drawer_frame_limit">Bildefrekvensgrense</string>
|
||||
<string name="drawer_frame_limit_note">Begrenser dette spillet. Skjermen bytter til en oppdateringsfrekvens som grensen går opp i når det finnes en; andre grenser kan se ujevne ut. Steam-spill bruker Steams Frame Limit i Hurtigmenyen.</string>
|
||||
<string name="drawer_bfi">Innsetting av svarte bilder</string>
|
||||
<string name="drawer_bfi_note">Skarpere bevegelse: hvert bilde etterfølges av en svart oppdatering. Krever 100 Hz eller mer; spillet kjører på halv oppdateringsfrekvens og ser mørkere ut. Av mens bildegenerering er på.</string>
|
||||
<string name="drawer_page_effects">Effekter</string>
|
||||
<string name="drawer_page_controls">Kontroller</string>
|
||||
<string name="drawer_page_components">Komponenter</string>
|
||||
@@ -1183,6 +1185,7 @@
|
||||
<string name="agent_hint_working">Skriv for å legge neste melding i kø</string>
|
||||
<string name="agent_queue">Legg i kø</string>
|
||||
<string name="agent_queued">Neste: %1$s</string>
|
||||
<string name="agent_tools_missing">Agentverktøy er ikke installert: %1$s</string>
|
||||
<string name="agent_unqueue">Ikke send</string>
|
||||
<string name="agent_attach">Legg ved</string>
|
||||
<string name="agent_remove_attachment">Fjern</string>
|
||||
@@ -4106,4 +4109,8 @@
|
||||
<string name="hud_readings_shown">Vist</string>
|
||||
<string name="hud_readings_count">%1$d av %2$d</string>
|
||||
<string name="exit_hint_back">Trykk tilbake én gang til for å avslutte</string>
|
||||
<string name="display_integer_scaling">Heltallsskalering</string>
|
||||
<string name="display_integer_scaling_hint">Bruker den største heltallsskalaen som får plass. Kan beskjære skjermkantene. Hvis kilden er større enn utdataene, viser brøkbasert skalering hele bildet. Oppløsningen stilles inn separat.</string>
|
||||
<string name="display_scaling_integer">Heltall</string>
|
||||
<string name="display_scaling_fit">Tilpass</string>
|
||||
</resources>
|
||||
@@ -675,6 +675,8 @@
|
||||
<string name="drawer_page_display">Scherm</string>
|
||||
<string name="drawer_frame_limit">Framelimiet</string>
|
||||
<string name="drawer_frame_limit_note">Begrenst deze game. Het scherm schakelt over naar een vernieuwingsfrequentie die precies deelbaar is door de limiet, als die er is; andere limieten kunnen ongelijkmatig ogen. Steam-games gebruiken de framelimiet van Steam in het Snelmenu.</string>
|
||||
<string name="drawer_bfi">Zwarte frames invoegen</string>
|
||||
<string name="drawer_bfi_note">Scherpere beweging: na elk frame volgt een zwarte verversing. Vereist 100 Hz of meer; de game draait op de helft van de verversingssnelheid en oogt donkerder. Uit zolang framegeneratie aanstaat.</string>
|
||||
<string name="drawer_page_effects">Effecten</string>
|
||||
<string name="drawer_page_controls">Bediening</string>
|
||||
<string name="drawer_page_components">Componenten</string>
|
||||
@@ -1183,6 +1185,7 @@
|
||||
<string name="agent_hint_working">Typ om het volgende bericht in de wachtrij te zetten</string>
|
||||
<string name="agent_queue">In wachtrij</string>
|
||||
<string name="agent_queued">Volgende: %1$s</string>
|
||||
<string name="agent_tools_missing">Agenttools niet geïnstalleerd: %1$s</string>
|
||||
<string name="agent_unqueue">Niet verzenden</string>
|
||||
<string name="agent_attach">Bijvoegen</string>
|
||||
<string name="agent_remove_attachment">Verwijderen</string>
|
||||
@@ -4106,4 +4109,9 @@
|
||||
<string name="hud_readings_shown">Getoond</string>
|
||||
<string name="hud_readings_count">%1$d van %2$d</string>
|
||||
<string name="exit_hint_back">Druk nog één keer op terug om af te sluiten</string>
|
||||
|
||||
<string name="display_integer_scaling">Gehele-getallenschaal</string>
|
||||
<string name="display_integer_scaling_hint">Gebruikt de grootste passende gehele schaalfactor. Schermranden kunnen worden afgesneden. Als de bron groter is dan de uitvoer, toont fractionele schaling de volledige afbeelding. De resolutie wordt apart ingesteld.</string>
|
||||
<string name="display_scaling_integer">Geheel getal</string>
|
||||
<string name="display_scaling_fit">Passend</string>
|
||||
</resources>
|
||||
@@ -679,6 +679,8 @@
|
||||
<string name="drawer_page_display">Wyświetlacz</string>
|
||||
<string name="drawer_frame_limit">Limit klatek</string>
|
||||
<string name="drawer_frame_limit_note">Ogranicza tę grę. Wyświetlacz przełącza się na częstotliwość odświeżania podzielną przez limit, jeśli taka jest; inne limity mogą wyglądać nierówno. Gry Steam używają limitu klatek Steam w menu szybkiego dostępu.</string>
|
||||
<string name="drawer_bfi">Wstawianie czarnych klatek</string>
|
||||
<string name="drawer_bfi_note">Ostrzejszy ruch: po każdej klatce następuje czarne odświeżenie. Wymaga 100 Hz lub więcej; gra działa z połową częstotliwości odświeżania i jest ciemniejsza. Wyłączone przy generowaniu klatek.</string>
|
||||
<string name="drawer_page_effects">Efekty</string>
|
||||
<string name="drawer_page_controls">Sterowanie</string>
|
||||
<string name="drawer_page_components">Komponenty</string>
|
||||
@@ -1189,6 +1191,7 @@
|
||||
<string name="agent_hint_working">Wpisz, aby zakolejkować następną wiadomość</string>
|
||||
<string name="agent_queue">Zakolejkuj</string>
|
||||
<string name="agent_queued">Następna: %1$s</string>
|
||||
<string name="agent_tools_missing">Narzędzia agenta nie są zainstalowane: %1$s</string>
|
||||
<string name="agent_unqueue">Nie wysyłaj</string>
|
||||
<string name="agent_attach">Załącz</string>
|
||||
<string name="agent_remove_attachment">Usuń</string>
|
||||
@@ -4186,4 +4189,9 @@
|
||||
<string name="hud_readings_shown">Pokazane</string>
|
||||
<string name="hud_readings_count">%1$d z %2$d</string>
|
||||
<string name="exit_hint_back">Naciśnij wstecz jeszcze raz, aby wyjść</string>
|
||||
|
||||
<string name="display_integer_scaling">Skalowanie całkowite</string>
|
||||
<string name="display_integer_scaling_hint">Używa największej całkowitej skali, która się mieści. Krawędzie ekranu mogą zostać przycięte. Jeśli źródło jest większe niż wynik, skalowanie ułamkowe wyświetla cały obraz. Rozdzielczość ustawia się osobno.</string>
|
||||
<string name="display_scaling_integer">Liczba całkowita</string>
|
||||
<string name="display_scaling_fit">Dopasuj</string>
|
||||
</resources>
|
||||
@@ -677,6 +677,8 @@
|
||||
<string name="drawer_page_display">Ecrã</string>
|
||||
<string name="drawer_frame_limit">Limite de fotogramas</string>
|
||||
<string name="drawer_frame_limit_note">Limita este jogo. O ecrã muda para uma taxa de atualização que o limite divida de forma exata, quando existe; outros limites podem parecer irregulares. Os jogos Steam utilizam o Limite de fotogramas do Steam no Menu de acesso rápido.</string>
|
||||
<string name="drawer_bfi">Inserção de fotogramas pretos</string>
|
||||
<string name="drawer_bfi_note">Movimento mais nítido: cada fotograma é seguido de uma atualização preta. Requer 100 Hz ou mais; o jogo corre a metade da taxa de atualização e fica mais escuro. Desligado com a geração de fotogramas.</string>
|
||||
<string name="drawer_page_effects">Efeitos</string>
|
||||
<string name="drawer_page_controls">Controlos</string>
|
||||
<string name="drawer_page_components">Componentes</string>
|
||||
@@ -1178,6 +1180,7 @@
|
||||
<string name="agent_hint_working">Escreva para pôr a mensagem seguinte na fila</string>
|
||||
<string name="agent_queue">Pôr na fila</string>
|
||||
<string name="agent_queued">Seguinte: %1$s</string>
|
||||
<string name="agent_tools_missing">Ferramentas do agente não instaladas: %1$s</string>
|
||||
<string name="agent_unqueue">Não enviar</string>
|
||||
<string name="agent_attach">Anexar</string>
|
||||
<string name="agent_remove_attachment">Remover</string>
|
||||
@@ -4145,4 +4148,9 @@
|
||||
<string name="hud_readings_shown">Mostrados</string>
|
||||
<string name="hud_readings_count">%1$d de %2$d</string>
|
||||
<string name="exit_hint_back">Prima novamente o botão Voltar para sair</string>
|
||||
|
||||
<string name="display_integer_scaling">Escala por números inteiros</string>
|
||||
<string name="display_integer_scaling_hint">Usa a maior escala inteira que cabe. Pode cortar as margens do ecrã. Se a origem for maior do que a saída, a escala fracionária apresenta a imagem completa. A resolução é configurada separadamente.</string>
|
||||
<string name="display_scaling_integer">Inteiro</string>
|
||||
<string name="display_scaling_fit">Ajustar</string>
|
||||
</resources>
|
||||
@@ -677,6 +677,8 @@
|
||||
<string name="drawer_page_display">Tela</string>
|
||||
<string name="drawer_frame_limit">Limite de quadros</string>
|
||||
<string name="drawer_frame_limit_note">Limita este jogo. A tela muda para uma taxa de atualização que o limite divida por igual, quando houver; outros limites podem parecer irregulares. Jogos da Steam usam o Limite de quadros da Steam no menu de Acesso rápido.</string>
|
||||
<string name="drawer_bfi">Inserção de quadros pretos</string>
|
||||
<string name="drawer_bfi_note">Movimento mais nítido: cada quadro é seguido por uma atualização preta. Requer 100 Hz ou mais; o jogo roda na metade da taxa de atualização e fica mais escuro. Desligado com a geração de quadros.</string>
|
||||
<string name="drawer_page_effects">Efeitos</string>
|
||||
<string name="drawer_page_controls">Controles</string>
|
||||
<string name="drawer_page_components">Componentes</string>
|
||||
@@ -1185,6 +1187,7 @@
|
||||
<string name="agent_hint_working">Digite para enfileirar a próxima mensagem</string>
|
||||
<string name="agent_queue">Enfileirar</string>
|
||||
<string name="agent_queued">Próxima: %1$s</string>
|
||||
<string name="agent_tools_missing">Ferramentas do agente não instaladas: %1$s</string>
|
||||
<string name="agent_unqueue">Não enviar</string>
|
||||
<string name="agent_attach">Anexar</string>
|
||||
<string name="agent_remove_attachment">Remover</string>
|
||||
@@ -4153,4 +4156,9 @@
|
||||
<string name="hud_readings_shown">Exibidos</string>
|
||||
<string name="hud_readings_count">%1$d de %2$d</string>
|
||||
<string name="exit_hint_back">Pressione o botão Voltar novamente para sair</string>
|
||||
|
||||
<string name="display_integer_scaling">Escala por números inteiros</string>
|
||||
<string name="display_integer_scaling_hint">Usa a maior escala inteira que cabe. Pode cortar as bordas da tela. Se a origem for maior que a saída, a escala fracionária exibe a imagem completa. A resolução é configurada separadamente.</string>
|
||||
<string name="display_scaling_integer">Inteiro</string>
|
||||
<string name="display_scaling_fit">Ajustar</string>
|
||||
</resources>
|
||||
@@ -677,6 +677,8 @@
|
||||
<string name="drawer_page_display">Afișaj</string>
|
||||
<string name="drawer_frame_limit">Limită de cadre</string>
|
||||
<string name="drawer_frame_limit_note">Limitează acest joc. Afișajul trece la o rată de reîmprospătare pe care limita o împarte exact, dacă există; alte limite pot părea neuniforme. Jocurile Steam folosesc Limita de cadre a Steam din meniul Acces rapid.</string>
|
||||
<string name="drawer_bfi">Inserare de cadre negre</string>
|
||||
<string name="drawer_bfi_note">Mișcare mai clară: fiecare cadru este urmat de o reîmprospătare neagră. Necesită 100 Hz sau mai mult; jocul rulează la jumătate din rată și pare mai întunecat. Oprit cât timp generarea de cadre e activă.</string>
|
||||
<string name="drawer_page_effects">Efecte</string>
|
||||
<string name="drawer_page_controls">Comenzi</string>
|
||||
<string name="drawer_page_components">Componente</string>
|
||||
@@ -1186,6 +1188,7 @@
|
||||
<string name="agent_hint_working">Scrie pentru a pune următorul mesaj în coadă</string>
|
||||
<string name="agent_queue">Pune în coadă</string>
|
||||
<string name="agent_queued">Următorul: %1$s</string>
|
||||
<string name="agent_tools_missing">Instrumentele agentului nu sunt instalate: %1$s</string>
|
||||
<string name="agent_unqueue">Nu trimite</string>
|
||||
<string name="agent_attach">Atașează</string>
|
||||
<string name="agent_remove_attachment">Elimină</string>
|
||||
@@ -4146,4 +4149,9 @@
|
||||
<string name="hud_readings_shown">Afișate</string>
|
||||
<string name="hud_readings_count">%1$d din %2$d</string>
|
||||
<string name="exit_hint_back">Apasă din nou înapoi pentru a ieși</string>
|
||||
|
||||
<string name="display_integer_scaling">Scalare cu numere întregi</string>
|
||||
<string name="display_integer_scaling_hint">Folosește cea mai mare scară întreagă care încape. Marginile ecranului pot fi decupate. Dacă sursa este mai mare decât ieșirea, scalarea fracționară afișează imaginea completă. Rezoluția se configurează separat.</string>
|
||||
<string name="display_scaling_integer">Număr întreg</string>
|
||||
<string name="display_scaling_fit">Potrivire</string>
|
||||
</resources>
|
||||
@@ -679,6 +679,8 @@
|
||||
<string name="drawer_page_display">Экран</string>
|
||||
<string name="drawer_frame_limit">Ограничение кадров</string>
|
||||
<string name="drawer_frame_limit_note">Ограничивает эту игру. Экран переключается на частоту обновления, которая делится на ограничение без остатка, если такая есть; при других ограничениях движение может быть неровным. Игры Steam используют ограничение кадров Steam в меню быстрого доступа.</string>
|
||||
<string name="drawer_bfi">Вставка чёрных кадров</string>
|
||||
<string name="drawer_bfi_note">Более чёткое движение: после каждого кадра идёт чёрное обновление. Нужно 100 Гц или больше; игра работает на половине частоты обновления и выглядит темнее. Отключено при генерации кадров.</string>
|
||||
<string name="drawer_page_effects">Эффекты</string>
|
||||
<string name="drawer_page_controls">Управление</string>
|
||||
<string name="drawer_page_components">Компоненты</string>
|
||||
@@ -1189,6 +1191,7 @@
|
||||
<string name="agent_hint_working">Введите текст, чтобы поставить следующее сообщение в очередь</string>
|
||||
<string name="agent_queue">В очередь</string>
|
||||
<string name="agent_queued">Далее: %1$s</string>
|
||||
<string name="agent_tools_missing">Инструменты агента не установлены: %1$s</string>
|
||||
<string name="agent_unqueue">Не отправлять</string>
|
||||
<string name="agent_attach">Прикрепить</string>
|
||||
<string name="agent_remove_attachment">Удалить</string>
|
||||
@@ -4186,4 +4189,9 @@
|
||||
<string name="hud_readings_shown">Показано</string>
|
||||
<string name="hud_readings_count">%1$d из %2$d</string>
|
||||
<string name="exit_hint_back">Нажмите «Назад» ещё раз, чтобы выйти</string>
|
||||
|
||||
<string name="display_integer_scaling">Целочисленное масштабирование</string>
|
||||
<string name="display_integer_scaling_hint">Использует наибольший целочисленный масштаб, который помещается на экране. Края могут обрезаться. Если исходное изображение больше выходного, дробное масштабирование показывает его целиком. Разрешение настраивается отдельно.</string>
|
||||
<string name="display_scaling_integer">Целое число</string>
|
||||
<string name="display_scaling_fit">По размеру</string>
|
||||
</resources>
|
||||
@@ -675,6 +675,8 @@
|
||||
<string name="drawer_page_display">Skärm</string>
|
||||
<string name="drawer_frame_limit">Bildgräns</string>
|
||||
<string name="drawer_frame_limit_note">Begränsar det här spelet. Skärmen byter till en uppdateringsfrekvens som gränsen delar jämnt när en sådan finns; andra gränser kan se ojämna ut. Steam-spel använder Steams Frame Limit i snabbåtkomstmenyn.</string>
|
||||
<string name="drawer_bfi">Infogning av svarta bilder</string>
|
||||
<string name="drawer_bfi_note">Skarpare rörelser: varje bild följs av en svart uppdatering. Kräver 100 Hz eller mer; spelet körs på halva uppdateringsfrekvensen och ser mörkare ut. Av medan bildgenerering är på.</string>
|
||||
<string name="drawer_page_effects">Effekter</string>
|
||||
<string name="drawer_page_controls">Kontroller</string>
|
||||
<string name="drawer_page_components">Komponenter</string>
|
||||
@@ -1183,6 +1185,7 @@
|
||||
<string name="agent_hint_working">Skriv för att köa nästa meddelande</string>
|
||||
<string name="agent_queue">Köa</string>
|
||||
<string name="agent_queued">Nästa: %1$s</string>
|
||||
<string name="agent_tools_missing">Agentens verktyg är inte installerade: %1$s</string>
|
||||
<string name="agent_unqueue">Skicka inte</string>
|
||||
<string name="agent_attach">Bifoga</string>
|
||||
<string name="agent_remove_attachment">Ta bort</string>
|
||||
@@ -4106,4 +4109,9 @@
|
||||
<string name="hud_readings_shown">Visade</string>
|
||||
<string name="hud_readings_count">%1$d av %2$d</string>
|
||||
<string name="exit_hint_back">Tryck tillbaka igen för att avsluta</string>
|
||||
|
||||
<string name="display_integer_scaling">Heltalsskalning</string>
|
||||
<string name="display_integer_scaling_hint">Använder den största heltalsskalningen som får plats. Kan beskära skärmkanterna. Om källan är större än utdata visar bråkskalning hela bilden. Upplösningen ställs in separat.</string>
|
||||
<string name="display_scaling_integer">Heltal</string>
|
||||
<string name="display_scaling_fit">Anpassa</string>
|
||||
</resources>
|
||||
@@ -357,7 +357,7 @@
|
||||
<string name="mode_return_after_game">กลับไปที่ DroidDeck หลังเล่นเกม</string>
|
||||
<string name="mode_return_after_game_hint">เมื่อเกมที่คุณเริ่มจาก DroidDeck หรือตัวเปิดเกมอื่นปิดลง Steam จะออกอย่างเรียบร้อย (บันทึกบนคลาวด์เสร็จก่อน) แล้วคุณจะกลับไปที่นั่น ปิด: อยู่ใน Steam ต่อ</string>
|
||||
<string name="mode_shader_precache">แคชเชเดอร์ล่วงหน้า</string>
|
||||
<string name="mode_shader_precache_hint">Steam จะดาวน์โหลดเชเดอร์ที่สร้างไว้แล้วสำหรับเกมของคุณและประมวลผลในเบื้องหลัง เกมจึงกระตุกน้อยลง การปิดช่วยประหยัดข้อมูล พื้นที่จัดเก็บ และแบตเตอรี่ โดยเกมจะสร้างเชเดอร์ระหว่างเล่นแทน เป็นการตั้งค่าเดียวกับ Downloads > Shader Pre-Caching ของ Steam มีผลในเซสชันถัดไป</string>
|
||||
<string name="mode_shader_precache_hint">Steam จะดาวน์โหลดเชเดอร์ที่สร้างไว้แล้วสำหรับเกมของคุณและประมวลผลในเบื้องหลัง เกมจึงกระตุกน้อยลง การปิดช่วยประหยัดข้อมูล พื้นที่จัดเก็บ และแบตเตอรี่ โดยเกมจะสร้างเชเดอร์ระหว่างเล่นแทน เป็นการตั้งค่าเดียวกับ Downloads > Shader Pre-Caching ของ Steam มีผลในเซสชันถัดไป</string>
|
||||
<string name="mode_steam_repair">ซ่อมแซมไคลเอนต์ Steam</string>
|
||||
<string name="mode_steam_repair_hint">ดาวน์โหลดไคลเอนต์ Steam ใหม่อีกครั้งในครั้งถัดไปที่ Steam เริ่มทำงาน ใช้เมื่อ Steam ค้างอยู่ที่หน้าจอโหลด เกม การลงชื่อเข้าใช้ และการตั้งค่ายังคงอยู่</string>
|
||||
<string name="mode_steam_repair_queued">ไคลเอนต์ Steam จะถูกดาวน์โหลดใหม่อีกครั้งในครั้งถัดไปที่ Steam เริ่มทำงาน</string>
|
||||
@@ -673,6 +673,8 @@
|
||||
<string name="drawer_page_display">หน้าจอ</string>
|
||||
<string name="drawer_frame_limit">จำกัดเฟรม</string>
|
||||
<string name="drawer_frame_limit_note">จำกัดเฟรมเรตของเกมนี้ หน้าจอจะเปลี่ยนไปใช้อัตรารีเฟรชที่หารด้วยค่าที่จำกัดได้ลงตัวหากมี ค่าอื่นอาจดูไม่สม่ำเสมอ เกม Steam ใช้ Frame Limit ของ Steam ในเมนู Quick Access</string>
|
||||
<string name="drawer_bfi">แทรกเฟรมสีดำ</string>
|
||||
<string name="drawer_bfi_note">ภาพเคลื่อนไหวคมขึ้น: ทุกเฟรมตามด้วยการรีเฟรชสีดำ ต้องใช้ 100 Hz ขึ้นไป เกมจะทำงานที่ครึ่งหนึ่งของรีเฟรชเรตและดูมืดลง ปิดอยู่ขณะเปิดการสร้างเฟรม</string>
|
||||
<string name="drawer_page_effects">เอฟเฟกต์</string>
|
||||
<string name="drawer_page_controls">การควบคุม</string>
|
||||
<string name="drawer_page_components">คอมโพเนนต์</string>
|
||||
@@ -1180,6 +1182,7 @@
|
||||
<string name="agent_hint_working">พิมพ์เพื่อเข้าคิวข้อความถัดไป</string>
|
||||
<string name="agent_queue">เข้าคิว</string>
|
||||
<string name="agent_queued">ถัดไป: %1$s</string>
|
||||
<string name="agent_tools_missing">ยังไม่ได้ติดตั้งเครื่องมือของเอเจนต์: %1$s</string>
|
||||
<string name="agent_unqueue">ไม่ต้องส่ง</string>
|
||||
<string name="agent_attach">แนบ</string>
|
||||
<string name="agent_remove_attachment">นำออก</string>
|
||||
@@ -4076,4 +4079,9 @@
|
||||
<string name="hud_readings_shown">ที่แสดง</string>
|
||||
<string name="hud_readings_count">%1$d จาก %2$d</string>
|
||||
<string name="exit_hint_back">กดกลับอีกครั้งเพื่อออก</string>
|
||||
</resources>
|
||||
|
||||
<string name="display_integer_scaling">การปรับขนาดจำนวนเต็ม</string>
|
||||
<string name="display_integer_scaling_hint">ใช้ตัวคูณจำนวนเต็มที่ใหญ่ที่สุดที่พอดีกับหน้าจอ ขอบภาพอาจถูกตัด หากภาพต้นฉบับใหญ่กว่าภาพขาออก การปรับขนาดแบบเศษส่วนจะแสดงภาพทั้งหมด โดยตั้งค่าความละเอียดแยกต่างหาก</string>
|
||||
<string name="display_scaling_integer">จำนวนเต็ม</string>
|
||||
<string name="display_scaling_fit">พอดีหน้าจอ</string>
|
||||
</resources>
|
||||
@@ -675,6 +675,8 @@
|
||||
<string name="drawer_page_display">Ekran</string>
|
||||
<string name="drawer_frame_limit">Kare sınırı</string>
|
||||
<string name="drawer_frame_limit_note">Bu oyunu sınırlar. Ekran, varsa sınırın tam böldüğü bir yenileme hızına geçer; diğer sınırlar düzensiz görünebilir. Steam oyunları Hızlı erişim menüsündeki Steam\'in Kare Sınırı ayarını kullanır.</string>
|
||||
<string name="drawer_bfi">Siyah kare ekleme</string>
|
||||
<string name="drawer_bfi_note">Daha net hareket: her kareyi siyah bir yenileme izler. 100 Hz veya üzeri gerekir; oyun yenileme hızının yarısında çalışır ve daha koyu görünür. Kare üretimi açıkken kapalıdır.</string>
|
||||
<string name="drawer_page_effects">Efektler</string>
|
||||
<string name="drawer_page_controls">Kontroller</string>
|
||||
<string name="drawer_page_components">Bileşenler</string>
|
||||
@@ -1175,6 +1177,7 @@
|
||||
<string name="agent_hint_working">Sonraki mesajı sıraya almak için yazın</string>
|
||||
<string name="agent_queue">Sıraya ekle</string>
|
||||
<string name="agent_queued">Sıradaki: %1$s</string>
|
||||
<string name="agent_tools_missing">Ajan araçları yüklenmedi: %1$s</string>
|
||||
<string name="agent_unqueue">Gönderme</string>
|
||||
<string name="agent_attach">Ekle</string>
|
||||
<string name="agent_remove_attachment">Kaldır</string>
|
||||
@@ -4106,4 +4109,9 @@
|
||||
<string name="hud_readings_shown">Gösterilen</string>
|
||||
<string name="hud_readings_count">%1$d / %2$d</string>
|
||||
<string name="exit_hint_back">Çıkmak için bir kez daha geri basın</string>
|
||||
|
||||
<string name="display_integer_scaling">Tam sayı ölçeklendirme</string>
|
||||
<string name="display_integer_scaling_hint">Ekrana sığan en büyük tam sayı ölçeğini kullanır. Ekran kenarları kırpılabilir. Kaynak görüntü çıktıdan büyükse kesirli ölçekleme görüntünün tamamını gösterir. Çözünürlük ayrı ayarlanır.</string>
|
||||
<string name="display_scaling_integer">Tam sayı</string>
|
||||
<string name="display_scaling_fit">Sığdır</string>
|
||||
</resources>
|
||||
@@ -679,6 +679,8 @@
|
||||
<string name="drawer_page_display">Екран</string>
|
||||
<string name="drawer_frame_limit">Обмеження кадрів</string>
|
||||
<string name="drawer_frame_limit_note">Обмежує цю гру. Екран перемикається на частоту оновлення, яка ділиться на обмеження без залишку, якщо така є; інші обмеження можуть виглядати нерівно. Ігри Steam використовують обмеження кадрів Steam у меню швидкого доступу.</string>
|
||||
<string name="drawer_bfi">Вставлення чорних кадрів</string>
|
||||
<string name="drawer_bfi_note">Чіткіший рух: після кожного кадру йде чорне оновлення. Потрібно 100 Гц або більше; гра працює на половині частоти оновлення й виглядає темнішою. Вимкнено під час генерації кадрів.</string>
|
||||
<string name="drawer_page_effects">Ефекти</string>
|
||||
<string name="drawer_page_controls">Керування</string>
|
||||
<string name="drawer_page_components">Компоненти</string>
|
||||
@@ -1189,6 +1191,7 @@
|
||||
<string name="agent_hint_working">Введіть текст, щоб поставити наступне повідомлення в чергу</string>
|
||||
<string name="agent_queue">Поставити в чергу</string>
|
||||
<string name="agent_queued">Далі: %1$s</string>
|
||||
<string name="agent_tools_missing">Інструменти агента не встановлено: %1$s</string>
|
||||
<string name="agent_unqueue">Не надсилати</string>
|
||||
<string name="agent_attach">Прикріпити</string>
|
||||
<string name="agent_remove_attachment">Видалити</string>
|
||||
@@ -4186,4 +4189,9 @@
|
||||
<string name="hud_readings_shown">Показано</string>
|
||||
<string name="hud_readings_count">%1$d з %2$d</string>
|
||||
<string name="exit_hint_back">Натисніть «Назад» ще раз, щоб вийти</string>
|
||||
|
||||
<string name="display_integer_scaling">Цілочисельне масштабування</string>
|
||||
<string name="display_integer_scaling_hint">Використовує найбільший цілий масштаб, що вміщується. Краї екрана можуть обрізатися. Якщо джерело більше за вихідне зображення, дробове масштабування показує його повністю. Роздільна здатність налаштовується окремо.</string>
|
||||
<string name="display_scaling_integer">Ціле число</string>
|
||||
<string name="display_scaling_fit">За розміром</string>
|
||||
</resources>
|
||||
@@ -673,6 +673,8 @@
|
||||
<string name="drawer_page_display">Hiển thị</string>
|
||||
<string name="drawer_frame_limit">Giới hạn khung hình</string>
|
||||
<string name="drawer_frame_limit_note">Giới hạn game này. Màn hình chuyển sang tần số quét chia hết cho mức giới hạn nếu có; các mức khác có thể trông không đều. Game Steam dùng Frame Limit của Steam trong menu Quick Access.</string>
|
||||
<string name="drawer_bfi">Chèn khung hình đen</string>
|
||||
<string name="drawer_bfi_note">Chuyển động sắc nét hơn: mỗi khung hình được theo sau bởi một lần làm mới màu đen. Cần 100 Hz trở lên; trò chơi chạy ở một nửa tần số quét và trông tối hơn. Tắt khi bật tạo khung hình.</string>
|
||||
<string name="drawer_page_effects">Hiệu ứng</string>
|
||||
<string name="drawer_page_controls">Điều khiển</string>
|
||||
<string name="drawer_page_components">Thành phần</string>
|
||||
@@ -1180,6 +1182,7 @@
|
||||
<string name="agent_hint_working">Nhập để xếp tin nhắn tiếp theo vào hàng đợi</string>
|
||||
<string name="agent_queue">Xếp hàng</string>
|
||||
<string name="agent_queued">Tiếp theo: %1$s</string>
|
||||
<string name="agent_tools_missing">Chưa cài công cụ của tác tử: %1$s</string>
|
||||
<string name="agent_unqueue">Không gửi</string>
|
||||
<string name="agent_attach">Đính kèm</string>
|
||||
<string name="agent_remove_attachment">Xóa</string>
|
||||
@@ -4076,4 +4079,9 @@
|
||||
<string name="hud_readings_shown">Đang hiển thị</string>
|
||||
<string name="hud_readings_count">%1$d trên %2$d</string>
|
||||
<string name="exit_hint_back">Nhấn lại để thoát</string>
|
||||
|
||||
<string name="display_integer_scaling">Tỷ lệ nguyên</string>
|
||||
<string name="display_integer_scaling_hint">Dùng tỷ lệ nguyên lớn nhất vừa với màn hình. Có thể cắt mép màn hình. Nếu ảnh nguồn lớn hơn đầu ra, tỷ lệ phân số sẽ hiển thị toàn bộ ảnh. Độ phân giải được thiết lập riêng.</string>
|
||||
<string name="display_scaling_integer">Số nguyên</string>
|
||||
<string name="display_scaling_fit">Vừa màn hình</string>
|
||||
</resources>
|
||||
@@ -357,7 +357,7 @@
|
||||
<string name="mode_return_after_game">游戏结束后返回 DroidDeck</string>
|
||||
<string name="mode_return_after_game_hint">从 DroidDeck 或其他启动器启动的游戏关闭后,Steam 会正常退出(先完成云存档同步),并返回启动位置。关闭:留在 Steam 中。</string>
|
||||
<string name="mode_shader_precache">着色器预缓存</string>
|
||||
<string name="mode_shader_precache_hint">Steam 会为你的游戏下载预编译的着色器并在后台处理,以减少游戏卡顿。关闭可节省流量、存储空间和电量;游戏会改为在运行时编译着色器。与 Steam 的“下载”>“着色器预缓存”为同一设置。下次会话时生效。</string>
|
||||
<string name="mode_shader_precache_hint">Steam 会为你的游戏下载预编译的着色器并在后台处理,以减少游戏卡顿。关闭可节省流量、存储空间和电量;游戏会改为在运行时编译着色器。与 Steam 的“下载”>“着色器预缓存”为同一设置。下次会话时生效。</string>
|
||||
<string name="mode_steam_repair">修复 Steam 客户端</string>
|
||||
<string name="mode_steam_repair_hint">下次启动 Steam 时重新下载 Steam 客户端。如果 Steam 一直停在加载画面,请使用此项。游戏、登录信息和设置都会保留。</string>
|
||||
<string name="mode_steam_repair_queued">下次启动 Steam 时将重新下载 Steam 客户端。</string>
|
||||
@@ -673,6 +673,8 @@
|
||||
<string name="drawer_page_display">显示</string>
|
||||
<string name="drawer_frame_limit">帧率限制</string>
|
||||
<string name="drawer_frame_limit_note">限制此游戏的帧率。如有能被上限整除的刷新率,显示屏会切换到该刷新率;其他上限可能导致画面不均匀。Steam 游戏请使用快捷访问菜单中的 Steam 帧率限制。</string>
|
||||
<string name="drawer_bfi">黑帧插入</string>
|
||||
<string name="drawer_bfi_note">动态更清晰:每帧之后插入一次黑色刷新。需要 100 Hz 或更高;游戏以一半刷新率运行,画面更暗。开启帧生成时不可用。</string>
|
||||
<string name="drawer_page_effects">画面效果</string>
|
||||
<string name="drawer_page_controls">控制</string>
|
||||
<string name="drawer_page_components">组件</string>
|
||||
@@ -1263,6 +1265,7 @@
|
||||
<string name="agent_hint_working">输入以排队下一条消息</string>
|
||||
<string name="agent_queue">排队</string>
|
||||
<string name="agent_queued">下一条:%1$s</string>
|
||||
<string name="agent_tools_missing">智能体工具未安装:%1$s</string>
|
||||
<string name="agent_unqueue">不发送</string>
|
||||
<string name="agent_attach">添加附件</string>
|
||||
<string name="agent_remove_attachment">移除</string>
|
||||
@@ -4076,4 +4079,9 @@
|
||||
<string name="hud_readings_shown">已显示</string>
|
||||
<string name="hud_readings_count">%1$d / %2$d</string>
|
||||
<string name="exit_hint_back">再按一次返回键退出</string>
|
||||
</resources>
|
||||
|
||||
<string name="display_integer_scaling">整数缩放</string>
|
||||
<string name="display_integer_scaling_hint">使用屏幕可容纳的最大整数倍缩放,可能会裁切屏幕边缘。如果源图像大于输出尺寸,分数缩放会显示完整图像。分辨率需单独设置。</string>
|
||||
<string name="display_scaling_integer">整数</string>
|
||||
<string name="display_scaling_fit">适应</string>
|
||||
</resources>
|
||||
@@ -357,7 +357,7 @@
|
||||
<string name="mode_return_after_game">遊戲結束後返回 DroidDeck</string>
|
||||
<string name="mode_return_after_game_hint">從 DroidDeck 或其他啟動器啟動的遊戲關閉後,Steam 會正常退出(先完成雲端存檔同步),並返回啟動位置。關閉:留在 Steam 中。</string>
|
||||
<string name="mode_shader_precache">著色器預先快取</string>
|
||||
<string name="mode_shader_precache_hint">Steam 會為你的遊戲下載預先編譯的著色器並在背景處理,讓遊戲較不卡頓。關閉可節省流動數據用量、儲存空間和電量;遊戲則會改為在執行時編譯著色器。與 Steam 的「下載」>「著色器預先快取」為同一個設定。下次工作階段生效。</string>
|
||||
<string name="mode_shader_precache_hint">Steam 會為你的遊戲下載預先編譯的著色器並在背景處理,讓遊戲較不卡頓。關閉可節省流動數據用量、儲存空間和電量;遊戲則會改為在執行時編譯著色器。與 Steam 的「下載」>「著色器預先快取」為同一個設定。下次工作階段生效。</string>
|
||||
<string name="mode_steam_repair">修復 Steam 用戶端</string>
|
||||
<string name="mode_steam_repair_hint">下次啟動 Steam 時重新下載 Steam 用戶端。如果 Steam 一直停留在載入畫面,請使用此功能。遊戲、登入資料和設定都會保留。</string>
|
||||
<string name="mode_steam_repair_queued">下次啟動 Steam 時會重新下載 Steam 用戶端。</string>
|
||||
@@ -673,6 +673,8 @@
|
||||
<string name="drawer_page_display">顯示</string>
|
||||
<string name="drawer_frame_limit">幀率限制</string>
|
||||
<string name="drawer_frame_limit_note">限制此遊戲的幀率。若有能被此上限整除的螢幕更新率,顯示器會切換至該更新率;其他上限可能看起來不平順。Steam 遊戲請使用快速存取選單中 Steam 的幀率限制。</string>
|
||||
<string name="drawer_bfi">黑幀插入</string>
|
||||
<string name="drawer_bfi_note">動態更清晰:每幀之後插入一次黑色更新。需要 100 Hz 或更高;遊戲以一半更新率運行,畫面較暗。開啟幀生成時不可用。</string>
|
||||
<string name="drawer_page_effects">效果</string>
|
||||
<string name="drawer_page_controls">控制</string>
|
||||
<string name="drawer_page_components">組件</string>
|
||||
@@ -1179,6 +1181,7 @@
|
||||
<string name="agent_hint_working">輸入即可排入下一則訊息</string>
|
||||
<string name="agent_queue">排入</string>
|
||||
<string name="agent_queued">下一則:%1$s</string>
|
||||
<string name="agent_tools_missing">智能體工具未安裝:%1$s</string>
|
||||
<string name="agent_unqueue">不要傳送</string>
|
||||
<string name="agent_attach">附加</string>
|
||||
<string name="agent_remove_attachment">移除</string>
|
||||
@@ -4076,4 +4079,9 @@
|
||||
<string name="hud_readings_shown">已顯示</string>
|
||||
<string name="hud_readings_count">%1$d / %2$d</string>
|
||||
<string name="exit_hint_back">再按一次返回鍵退出</string>
|
||||
</resources>
|
||||
|
||||
<string name="display_integer_scaling">整數縮放</string>
|
||||
<string name="display_integer_scaling_hint">使用螢幕可容納的最大整數倍縮放,可能會裁切螢幕邊緣。如果來源圖像大於輸出尺寸,分數縮放會顯示完整圖像。解像度需另外設定。</string>
|
||||
<string name="display_scaling_integer">整數</string>
|
||||
<string name="display_scaling_fit">配合畫面</string>
|
||||
</resources>
|
||||
@@ -357,7 +357,7 @@
|
||||
<string name="mode_return_after_game">遊戲結束後返回 DroidDeck</string>
|
||||
<string name="mode_return_after_game_hint">從 DroidDeck 或其他啟動器啟動的遊戲關閉後,Steam 會正常退出(先完成雲端存檔同步),並返回啟動位置。關閉:留在 Steam 中。</string>
|
||||
<string name="mode_shader_precache">著色器預先快取</string>
|
||||
<string name="mode_shader_precache_hint">Steam 會為你的遊戲下載預先編譯的著色器並在背景處理,讓遊戲較不卡頓。關閉可節省數據用量、儲存空間和電量;遊戲則會改為在執行時編譯著色器。與 Steam 的「下載」>「著色器預先快取」為同一個設定。下次工作階段生效。</string>
|
||||
<string name="mode_shader_precache_hint">Steam 會為你的遊戲下載預先編譯的著色器並在背景處理,讓遊戲較不卡頓。關閉可節省數據用量、儲存空間和電量;遊戲則會改為在執行時編譯著色器。與 Steam 的「下載」>「著色器預先快取」為同一個設定。下次工作階段生效。</string>
|
||||
<string name="mode_steam_repair">修復 Steam 用戶端</string>
|
||||
<string name="mode_steam_repair_hint">下次啟動 Steam 時重新下載 Steam 用戶端。如果 Steam 一直停在載入畫面,請使用此功能。遊戲、登入狀態和設定都會保留。</string>
|
||||
<string name="mode_steam_repair_queued">下次啟動 Steam 時會重新下載 Steam 用戶端。</string>
|
||||
@@ -673,6 +673,8 @@
|
||||
<string name="drawer_page_display">顯示</string>
|
||||
<string name="drawer_frame_limit">影格率限制</string>
|
||||
<string name="drawer_frame_limit_note">限制此遊戲的影格率。若有能被此上限整除的螢幕更新率,顯示器會切換至該更新率;其他上限可能看起來不平順。Steam 遊戲請使用快速存取選單中 Steam 的影格率限制。</string>
|
||||
<string name="drawer_bfi">黑幀插入</string>
|
||||
<string name="drawer_bfi_note">動態更清晰:每幀之後插入一次黑色更新。需要 100 Hz 或更高;遊戲以一半更新率執行,畫面較暗。開啟幀生成時不可用。</string>
|
||||
<string name="drawer_page_effects">效果</string>
|
||||
<string name="drawer_page_controls">控制</string>
|
||||
<string name="drawer_page_components">元件</string>
|
||||
@@ -1179,6 +1181,7 @@
|
||||
<string name="agent_hint_working">輸入以排入下一則訊息</string>
|
||||
<string name="agent_queue">排入佇列</string>
|
||||
<string name="agent_queued">下一則:%1$s</string>
|
||||
<string name="agent_tools_missing">智慧代理工具未安裝:%1$s</string>
|
||||
<string name="agent_unqueue">不要傳送</string>
|
||||
<string name="agent_attach">附加</string>
|
||||
<string name="agent_remove_attachment">移除</string>
|
||||
@@ -4076,4 +4079,9 @@
|
||||
<string name="hud_readings_shown">已顯示</string>
|
||||
<string name="hud_readings_count">%1$d / %2$d</string>
|
||||
<string name="exit_hint_back">再按一次返回鍵退出</string>
|
||||
</resources>
|
||||
|
||||
<string name="display_integer_scaling">整數縮放</string>
|
||||
<string name="display_integer_scaling_hint">使用螢幕可容納的最大整數倍縮放,可能會裁切螢幕邊緣。如果來源圖像大於輸出尺寸,分數縮放會顯示完整圖像。解析度需另外設定。</string>
|
||||
<string name="display_scaling_integer">整數</string>
|
||||
<string name="display_scaling_fit">符合畫面</string>
|
||||
</resources>
|
||||
@@ -703,6 +703,8 @@
|
||||
<string name="drawer_page_display">Display</string>
|
||||
<string name="drawer_frame_limit">Frame limit</string>
|
||||
<string name="drawer_frame_limit_note">Caps this game. The display switches to a refresh rate the cap divides evenly when it has one; other caps can look uneven. Steam games use Steam\'s Frame Limit in the Quick Access menu.</string>
|
||||
<string name="drawer_bfi">Black frame insertion</string>
|
||||
<string name="drawer_bfi_note">Sharper motion: a black refresh follows every frame. Needs 100 Hz or more; the game runs at half the refresh rate and looks dimmer. Off while frame generation is on.</string>
|
||||
<string name="drawer_page_effects">Effects</string>
|
||||
<string name="drawer_page_controls">Controls</string>
|
||||
<string name="drawer_page_components">Components</string>
|
||||
@@ -1269,6 +1271,7 @@
|
||||
<string name="agent_no_reply">Ended without a reply</string>
|
||||
<string name="agent_retry">Retry</string>
|
||||
<string name="agent_setting_up">Setting up the agent</string>
|
||||
<string name="agent_waiting_background">Waiting for background work</string>
|
||||
<string name="agent_rebuild_lab">Rebuild my Lab build %1$s for the installed version of DroidDeck and restart on it.</string>
|
||||
<string name="agent_tokens">%1$s in · %2$s out</string>
|
||||
<string name="agent_thinking">Thinking</string>
|
||||
@@ -1283,6 +1286,7 @@
|
||||
<string name="agent_hint_working">Type to queue the next message</string>
|
||||
<string name="agent_queue">Queue</string>
|
||||
<string name="agent_queued">Next: %1$s</string>
|
||||
<string name="agent_tools_missing">Agent tools not installed: %1$s</string>
|
||||
<string name="agent_unqueue">Don\'t send</string>
|
||||
<string name="agent_attach">Attach</string>
|
||||
<string name="agent_remove_attachment">Remove</string>
|
||||
@@ -2658,6 +2662,9 @@
|
||||
<string name="display_preserve">Keep proportions</string>
|
||||
<string name="display_stretch">Stretch to display</string>
|
||||
<string name="display_image_scaling">Image scaling</string>
|
||||
<string name="display_integer_scaling">Integer scaling</string>
|
||||
<string name="display_integer_scaling_hint">Uses the largest whole-number scale that fits. May crop screen edges. If the source is larger than the output, fractional scaling fits the full image. Resolution is configured separately.</string>
|
||||
<string name="display_scaling_fit">Fit</string>
|
||||
<string name="display_filter">Scaling filter</string>
|
||||
<string name="display_filter_hint">Shared by Steam and Desktop.</string>
|
||||
<string name="display_filter_live">Applies live. Shared by Steam and Desktop.</string>
|
||||
@@ -2976,6 +2983,14 @@
|
||||
<string name="edit_launch_options_steam_hint">Shared with Steam\'s Properties: a change in either one shows in both.</string>
|
||||
<string name="edit_launch_options_not_saved">Could not save the launch options to Steam. Try again.</string>
|
||||
<string name="edit_launch_options_desktop">Steam may be open in the desktop session. Change the launch options in its Properties, or close the session first.</string>
|
||||
<string name="edit_steam_input_override">Steam Input</string>
|
||||
<string name="edit_steam_input_default">Use Steam\'s default</string>
|
||||
<string name="edit_steam_input_enable">Enable Steam Input</string>
|
||||
<string name="edit_steam_input_disable">Disable Steam Input</string>
|
||||
<string name="edit_steam_input_hint">Same as the game\'s Controller setting in Steam Properties.</string>
|
||||
<string name="edit_steam_input_running">Close the Steam or desktop session before changing this setting.</string>
|
||||
<string name="edit_steam_input_not_saved">Could not save the Steam Input setting. Close Steam and try again.</string>
|
||||
<string name="edit_steam_input_unavailable">Could not read this game\'s Steam Input setting.</string>
|
||||
<string name="edit_artwork">Artwork</string>
|
||||
<string name="edit_other_exe">Other exe…</string>
|
||||
<string name="edit_remove">Remove</string>
|
||||
@@ -4189,4 +4204,5 @@
|
||||
<string name="hud_readings_shown">Shown</string>
|
||||
<string name="hud_readings_count">%1$d of %2$d</string>
|
||||
<string name="exit_hint_back">Press back once more to exit</string>
|
||||
<string name="display_scaling_integer">Integer</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,117 @@
|
||||
package com.droiddeck.launcher.agent
|
||||
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
import org.junit.rules.TemporaryFolder
|
||||
import java.io.File
|
||||
import java.nio.file.Files
|
||||
|
||||
class AgentHelpersTest {
|
||||
@get:Rule val tmp = TemporaryFolder()
|
||||
|
||||
@Test fun aSymlinkLeftByAHandMadeSetupIsReplacedNotFollowed() {
|
||||
val bin = tmp.newFolder("bin")
|
||||
val old = tmp.newFile("old-droiddeckctl").apply { writeText("old") }
|
||||
val target = File(bin, "droiddeckctl")
|
||||
Files.createSymbolicLink(target.toPath(), old.toPath())
|
||||
|
||||
AgentSetup.replaceFile("new".byteInputStream(), target)
|
||||
|
||||
assertFalse(Files.isSymbolicLink(target.toPath()))
|
||||
assertEquals("new", target.readText())
|
||||
assertEquals("old", old.readText())
|
||||
assertTrue(target.canExecute())
|
||||
}
|
||||
|
||||
@Test fun aDanglingSymlinkIsReplaced() {
|
||||
val bin = tmp.newFolder("bin")
|
||||
val target = File(bin, "droiddeckctl")
|
||||
Files.createSymbolicLink(target.toPath(), File("/no/such/userland/path").toPath())
|
||||
|
||||
AgentSetup.replaceFile("new".byteInputStream(), target)
|
||||
|
||||
assertEquals("new", target.readText())
|
||||
assertEquals(listOf("droiddeckctl"), bin.list()!!.toList())
|
||||
}
|
||||
|
||||
@Test fun skillsGoToEveryHarnessAndLeaveTheUsersOwnAlone() {
|
||||
val root = tmp.newFolder("rootfs")
|
||||
val mine = File(root, "root/.claude/skills/my-skill/SKILL.md").apply { parentFile!!.mkdirs(); writeText("mine") }
|
||||
val stale = File(root, "root/.codex/skills/diagnose-game/SKILL.md").apply { parentFile!!.mkdirs(); writeText("old") }
|
||||
File(stale.parentFile, AgentSetup.SKILL_MARK).writeText("")
|
||||
|
||||
val failed = AgentSetup.installSkills(root, mapOf("diagnose-game" to listOf("SKILL.md"))) { "new $it".byteInputStream() }
|
||||
|
||||
assertEquals(emptyList<String>(), failed)
|
||||
for (harness in AgentHarness.all) {
|
||||
assertEquals("new diagnose-game/SKILL.md", File(root, "${harness.skills}/diagnose-game/SKILL.md").readText())
|
||||
}
|
||||
assertEquals("mine", mine.readText())
|
||||
assertFalse(File(root, "${ClaudeCode.skills}/diagnose-game/SKILL.md").canExecute())
|
||||
}
|
||||
|
||||
@Test fun aSkillTheUserMadeWithTheSameNameIsKept() {
|
||||
val root = tmp.newFolder("rootfs3")
|
||||
val own = File(root, "${ClaudeCode.skills}/diagnose-game/SKILL.md").apply { parentFile!!.mkdirs(); writeText("my version") }
|
||||
|
||||
AgentSetup.installSkills(root, mapOf("diagnose-game" to listOf("SKILL.md"))) { "new".byteInputStream() }
|
||||
|
||||
assertEquals("my version", own.readText())
|
||||
assertFalse(File(own.parentFile, AgentSetup.SKILL_MARK).exists())
|
||||
assertEquals("new", File(root, "${Codex.skills}/diagnose-game/SKILL.md").readText())
|
||||
}
|
||||
|
||||
@Test fun aSkillThatFailedPartWayIsRetriedNextTurn() {
|
||||
val root = tmp.newFolder("rootfs5")
|
||||
val skills = mapOf("diagnose-game" to listOf("SKILL.md"))
|
||||
|
||||
val failed = AgentSetup.installSkills(root, skills) { throw java.io.IOException("asset unreadable") }
|
||||
assertEquals(AgentHarness.all.size, failed.size)
|
||||
|
||||
assertEquals(emptyList<String>(), AgentSetup.installSkills(root, skills) { "new".byteInputStream() })
|
||||
for (harness in AgentHarness.all) assertEquals("new", File(root, "${harness.skills}/diagnose-game/SKILL.md").readText())
|
||||
}
|
||||
|
||||
@Test fun instructionsBehindAGuestSymlinkAreWrittenWhereItPoints() {
|
||||
val root = tmp.newFolder("rootfs4")
|
||||
val dotfile = File(root, "root/dotfiles/CLAUDE.md").apply { parentFile!!.mkdirs(); writeText("my rule\n") }
|
||||
val link = File(root, ClaudeCode.instructions).apply { parentFile!!.mkdirs() }
|
||||
Files.createSymbolicLink(link.toPath(), File("/root/dotfiles/CLAUDE.md").toPath())
|
||||
|
||||
AgentSetup.installInstructions(root, "rules")
|
||||
|
||||
assertTrue(Files.isSymbolicLink(link.toPath()))
|
||||
assertTrue(dotfile.readText().contains("rules"))
|
||||
assertTrue(dotfile.readText().endsWith("\nmy rule\n"))
|
||||
}
|
||||
|
||||
@Test fun theRulesGoFirstInAFileThatHasNoBlockYetAndKeepTheUsersOwn() {
|
||||
val text = AgentSetup.withBlock("# Mine\nAlways answer in French.\n", "rules v1")
|
||||
assertEquals("${AgentSetup.BLOCK_BEGIN}\nrules v1\n${AgentSetup.BLOCK_END}\n\n# Mine\nAlways answer in French.\n", text)
|
||||
}
|
||||
|
||||
@Test fun onlyTheBlockIsReplacedOnTheNextTurn() {
|
||||
val first = AgentSetup.withBlock("before\n", "rules v1") + "after\n"
|
||||
val second = AgentSetup.withBlock(first, "rules v2")
|
||||
assertEquals(first.replace("rules v1", "rules v2"), second)
|
||||
assertEquals(second, AgentSetup.withBlock(second, "rules v2"))
|
||||
}
|
||||
|
||||
@Test fun anEmptyOrMissingFileGetsJustTheBlock() {
|
||||
assertEquals("${AgentSetup.BLOCK_BEGIN}\nrules\n${AgentSetup.BLOCK_END}\n", AgentSetup.withBlock(null, "rules\n"))
|
||||
assertEquals(AgentSetup.withBlock(null, "rules"), AgentSetup.withBlock(" \n", "rules"))
|
||||
}
|
||||
|
||||
@Test fun everyHarnessGetsTheRules() {
|
||||
val root = tmp.newFolder("rootfs2")
|
||||
val claude = File(root, ClaudeCode.instructions).apply { parentFile!!.mkdirs(); writeText("my rule\n") }
|
||||
|
||||
assertEquals(emptyList<String>(), AgentSetup.installInstructions(root, "rules"))
|
||||
|
||||
for (harness in AgentHarness.all) assertTrue(File(root, harness.instructions).readText().contains("rules"))
|
||||
assertTrue(claude.readText().endsWith("\nmy rule\n"))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.droiddeck.launcher.agent
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.content.ContextWrapper
|
||||
import android.content.Intent
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertNotNull
|
||||
import org.junit.Assert.assertNull
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.robolectric.Robolectric
|
||||
import org.robolectric.RobolectricTestRunner
|
||||
import org.robolectric.RuntimeEnvironment
|
||||
import org.robolectric.annotation.Config
|
||||
|
||||
@RunWith(RobolectricTestRunner::class)
|
||||
@Config(sdk = [28], manifest = Config.NONE)
|
||||
class AgentHostServiceTest {
|
||||
private class ServiceContext : ContextWrapper(RuntimeEnvironment.getApplication()) {
|
||||
var stops = 0
|
||||
var reject = false
|
||||
override fun startForegroundService(service: Intent): ComponentName {
|
||||
if (reject) throw IllegalStateException("start rejected")
|
||||
return ComponentName(packageName, AgentHostService::class.java.name)
|
||||
}
|
||||
override fun stopService(service: Intent): Boolean { stops++; return true }
|
||||
}
|
||||
|
||||
@Test fun setupCompletionKeepsBackgroundWaitUntilItEnds() {
|
||||
val context = ServiceContext()
|
||||
AgentHostService.setupStarted(context)
|
||||
val service = Robolectric.buildService(AgentHostService::class.java).create().get()
|
||||
service.onStartCommand(Intent(context, AgentHostService::class.java), 0, 1)
|
||||
assertNull(AgentHostService.waitForBackground(context))
|
||||
AgentHostService.setupEnded(context)
|
||||
assertEquals(0, context.stops)
|
||||
AgentHostService.backgroundDone(context)
|
||||
assertEquals(1, context.stops)
|
||||
}
|
||||
|
||||
@Test fun rejectedForegroundStartIsReportedAndCanBeRetried() {
|
||||
val context = ServiceContext()
|
||||
context.reject = true
|
||||
assertNotNull(AgentHostService.start(context))
|
||||
context.reject = false
|
||||
assertNull(AgentHostService.start(context))
|
||||
val service = Robolectric.buildService(AgentHostService::class.java).create().get()
|
||||
service.onStartCommand(Intent(context, AgentHostService::class.java), 0, 1)
|
||||
AgentHostService.stop(context)
|
||||
}
|
||||
}
|
||||
@@ -80,6 +80,52 @@ class AgentHostTest {
|
||||
assertTrue(event == null || event.entries.none { it is Entry.Finished })
|
||||
}
|
||||
|
||||
@Test fun claudeTakesItsMessagesOverStdinSoItStaysOpen() {
|
||||
val command = ClaudeCode.turn("hello there", null, AgentHarness.Options())
|
||||
assertEquals("stream-json", command[command.indexOf("--input-format") + 1])
|
||||
assertFalse("hello there" in command)
|
||||
val line = org.json.JSONObject(ClaudeCode.input("hello there")!!)
|
||||
assertEquals("user", line.getString("type"))
|
||||
assertEquals("hello there", line.getJSONObject("message").getJSONArray("content").getJSONObject(0).getString("text"))
|
||||
assertNull(Codex.input("hi"))
|
||||
}
|
||||
|
||||
@Test fun aTaskNotificationResultIsMarkedBackgroundAndCarriesItsUsage() {
|
||||
val event = ClaudeCode.parse("""{"type":"result","is_error":false,"session_id":"s","duration_ms":900,"total_cost_usd":0.01,"usage":{"input_tokens":3,"output_tokens":4},"origin":{"kind":"task-notification"}}""")!!
|
||||
assertTrue(event.background)
|
||||
assertTrue(event.entries.isEmpty())
|
||||
assertEquals(4L, event.usage?.outputTokens)
|
||||
assertNull(event.backgroundError)
|
||||
}
|
||||
|
||||
@Test fun retainedClaudeCostsAreRecordedOncePerProcess() {
|
||||
val costs = AgentCostTracker()
|
||||
fun usage(cost: Double) = AgentHost.Usage(1, cost, 1, 1)
|
||||
assertEquals(0.05, costs.perTurn(usage(0.05)).costUsd, 0.000001)
|
||||
assertEquals(0.02, costs.perTurn(usage(0.07)).costUsd, 0.000001)
|
||||
assertEquals(0.0, costs.perTurn(usage(0.07)).costUsd, 0.000001)
|
||||
costs.reset()
|
||||
assertEquals(0.0, costs.perTurn(usage(0.0)).costUsd, 0.000001)
|
||||
assertEquals(0.07, costs.perTurn(usage(0.07)).costUsd, 0.000001)
|
||||
assertEquals(0.01, costs.perTurn(usage(0.01)).costUsd, 0.000001)
|
||||
assertEquals(0.07, AgentCostTracker().perTurn(usage(0.07)).costUsd, 0.000001)
|
||||
}
|
||||
|
||||
@Test fun aFailedTaskNotificationResultKeepsItsError() {
|
||||
val event = ClaudeCode.parse("""{"type":"result","is_error":true,"result":"API Error: overloaded","session_id":"s","usage":{"input_tokens":0,"output_tokens":0},"origin":{"kind":"task-notification"}}""")!!
|
||||
assertTrue(event.background)
|
||||
assertEquals("API Error: overloaded", event.backgroundError)
|
||||
}
|
||||
|
||||
@Test fun aToolCallThatRunsInTheBackgroundIsMarked() {
|
||||
fun used(tool: String, input: String) = ClaudeCode.parse(
|
||||
"""{"type":"assistant","session_id":"s","message":{"content":[{"type":"tool_use","id":"t","name":"$tool","input":$input}]}}"""
|
||||
)!!.entries.single() as Entry.Used
|
||||
assertTrue(used("Bash", """{"command":"./gradlew test","run_in_background":true}""").background)
|
||||
assertFalse(used("Bash", """{"command":"ls"}""").background)
|
||||
assertTrue(used("Monitor", """{"command":"tail -f log"}""").background)
|
||||
}
|
||||
|
||||
@Test fun claudeTurnsBypassPermissionsOrPlanAndTakeAModel() {
|
||||
val first = ClaudeCode.turn("hi", null, AgentHarness.Options())
|
||||
assertTrue("bypassPermissions" in first && "--resume" !in first && "--model" !in first && "--include-partial-messages" in first)
|
||||
@@ -179,7 +225,7 @@ class AgentHostTest {
|
||||
AgentChats.start(file, "claude")
|
||||
AgentChats.appendConversation(file, "abc")
|
||||
val written = listOf(
|
||||
Entry.Asked("hi", listOf("/root/x.png")), Entry.Said("hello"), Entry.Thought("hm"), Entry.Used("t1", "Read", "/root/x", "{}"),
|
||||
Entry.Asked("hi", listOf("/root/x.png")), Entry.Said("hello"), Entry.Notice("service unavailable"), Entry.Thought("hm"), Entry.Used("t1", "Read", "/root/x", "{}"),
|
||||
Entry.Result("t1", "contents", false), Entry.Finished(null, usage = AgentHost.Usage(1, 0.5, 2, 3)), Entry.Finished("boom", stopped = true),
|
||||
Entry.Finished(null, usage = AgentHost.Usage(1, 0.5, 2, 3, context = 40_000, window = 200_000), planned = true),
|
||||
)
|
||||
@@ -189,7 +235,7 @@ class AgentHostTest {
|
||||
assertEquals("claude", loaded.harness)
|
||||
assertEquals("abc", loaded.conversation)
|
||||
assertEquals(listOf(
|
||||
Entry.Asked("hi", listOf("/root/x.png")), Entry.Said("hello"), Entry.Thought("hm"), Entry.Used("t1", "Read", "/root/x", "{}", "contents", false),
|
||||
Entry.Asked("hi", listOf("/root/x.png")), Entry.Said("hello"), Entry.Notice("service unavailable"), Entry.Thought("hm"), Entry.Used("t1", "Read", "/root/x", "{}", "contents", false),
|
||||
Entry.Finished(null, usage = AgentHost.Usage(1, 0.5, 2, 3)), Entry.Finished("boom", stopped = true),
|
||||
Entry.Finished(null, usage = AgentHost.Usage(1, 0.5, 2, 3, context = 40_000, window = 200_000), planned = true),
|
||||
), loaded.entries)
|
||||
@@ -198,6 +244,7 @@ class AgentHostTest {
|
||||
|
||||
@Test fun aTurnThatEndsWithNothingIsAnswerless() {
|
||||
assertTrue(AgentHost.answerless(listOf(Entry.Said("x"), Entry.Asked("go on"), Entry.Finished(null))))
|
||||
assertTrue(AgentHost.answerless(listOf(Entry.Asked("go on"), Entry.Notice("service unavailable"), Entry.Finished(null))))
|
||||
assertFalse(AgentHost.answerless(listOf(Entry.Asked("go on"), Entry.Said("ok"), Entry.Finished(null))))
|
||||
assertFalse(AgentHost.answerless(listOf(Entry.Asked("go on"), Entry.Finished("boom"))))
|
||||
assertFalse(AgentHost.answerless(listOf(Entry.Asked("go on"), Entry.Finished(null, stopped = true))))
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.droiddeck.launcher.frontend
|
||||
|
||||
import com.droiddeck.launcher.core.AddonPack
|
||||
import com.droiddeck.launcher.runtime.LinuxRuntime
|
||||
import com.droiddeck.launcher.session.SessionPrefs
|
||||
import org.junit.Assert.*
|
||||
@@ -16,9 +17,10 @@ class GameFileSyncTest {
|
||||
@Test fun syncUsesFreshInstalledManifestsAndStopsWhenDisabled() {
|
||||
val context = RuntimeEnvironment.getApplication()
|
||||
val root = LinuxRuntime.rootDir(context)
|
||||
listOf("usr/bin/gamescope", LinuxRuntime.SESSION_SCRIPT.removePrefix("/"), "opt/android-host/proot", "opt/android-host/loader").forEach { path ->
|
||||
listOf("usr/bin/gamescope", LinuxRuntime.SESSION_SCRIPT.removePrefix("/")).forEach { path ->
|
||||
File(root, path).apply { parentFile!!.mkdirs(); writeText("") }
|
||||
}
|
||||
AddonPack.PROOT.file(context, AddonPack.COMPLETE).apply { parentFile!!.mkdirs(); writeText("") }
|
||||
SessionPrefs.setGameStorage(context, SessionPrefs.GAME_STORAGE_OFF, "")
|
||||
SessionPrefs.setAddedGamesDirs(context, emptyList())
|
||||
val steamapps = File(root, "root/.local/share/Steam/steamapps").apply { mkdirs() }
|
||||
@@ -51,9 +53,10 @@ class GameFileSyncTest {
|
||||
@Test fun libraryNotCreatedYetOnPresentStorageIsEmptyNotUnavailable() {
|
||||
val context = RuntimeEnvironment.getApplication()
|
||||
val root = LinuxRuntime.rootDir(context)
|
||||
listOf("usr/bin/gamescope", LinuxRuntime.SESSION_SCRIPT.removePrefix("/"), "opt/android-host/proot", "opt/android-host/loader").forEach { path ->
|
||||
listOf("usr/bin/gamescope", LinuxRuntime.SESSION_SCRIPT.removePrefix("/")).forEach { path ->
|
||||
File(root, path).apply { parentFile!!.mkdirs(); writeText("") }
|
||||
}
|
||||
AddonPack.PROOT.file(context, AddonPack.COMPLETE).apply { parentFile!!.mkdirs(); writeText("") }
|
||||
SessionPrefs.setAddedGamesDirs(context, emptyList())
|
||||
File(root, "root/.local/share/Steam/steamapps").mkdirs()
|
||||
val volume = File(context.filesDir, "card").apply { mkdirs() }
|
||||
@@ -80,9 +83,10 @@ class GameFileSyncTest {
|
||||
@Test fun previousAutomaticLibraryNotCreatedYetKeepsSyncingButRemovedDriveStops() {
|
||||
val context = RuntimeEnvironment.getApplication()
|
||||
val root = LinuxRuntime.rootDir(context)
|
||||
listOf("usr/bin/gamescope", LinuxRuntime.SESSION_SCRIPT.removePrefix("/"), "opt/android-host/proot", "opt/android-host/loader").forEach { path ->
|
||||
listOf("usr/bin/gamescope", LinuxRuntime.SESSION_SCRIPT.removePrefix("/")).forEach { path ->
|
||||
File(root, path).apply { parentFile!!.mkdirs(); writeText("") }
|
||||
}
|
||||
AddonPack.PROOT.file(context, AddonPack.COMPLETE).apply { parentFile!!.mkdirs(); writeText("") }
|
||||
SessionPrefs.setAddedGamesDirs(context, emptyList())
|
||||
SessionPrefs.setGameStorage(context, "", "")
|
||||
File(root, "root/.local/share/Steam/steamapps").mkdirs()
|
||||
|
||||
@@ -100,6 +100,36 @@ class SteamLaunchOptionsTest {
|
||||
|
||||
private fun localConfig(home: File, account: String) = File(home, "userdata/$account/config/localconfig.vdf").apply { parentFile!!.mkdirs() }
|
||||
|
||||
private fun withRootApp(text: String, appId: Int, key: String, value: String) = text.replaceFirst(
|
||||
"{\n\t\"Software\"",
|
||||
"{\n\t\"apps\"\n\t{\n\t\t\"$appId\"\n\t\t{\n\t\t\t\"$key\"\t\t\"$value\"\n\t\t}\n\t}\n\t\"Software\"",
|
||||
)
|
||||
|
||||
@Test fun steamInputIsReadFromTheRootAppsSection() {
|
||||
val home = steamHome()
|
||||
localConfig(home, "60974196").writeText(withRootApp(config(apps(*sparking)), 1790600, "UseSteamControllerConfig", "2"))
|
||||
assertEquals("2", SteamLaunchOptions.steamAppSetting(home, 1790600, "UseSteamControllerConfig", "1"))
|
||||
assertEquals("1", SteamLaunchOptions.steamAppSetting(home, 400, "UseSteamControllerConfig", "1"))
|
||||
}
|
||||
|
||||
@Test fun steamInputIsWrittenToTheRootAppsSectionAndAnOldCopyIsDropped() {
|
||||
val home = steamHome()
|
||||
val legacy = arrayOf(
|
||||
"\t\t\t\t\t\"1790600\"", "\t\t\t\t\t{", "\t\t\t\t\t\t\"LaunchOptions\"\t\t\"-dx11\"",
|
||||
"\t\t\t\t\t\t\"UseSteamControllerConfig\"\t\t\"0\"", "\t\t\t\t\t}",
|
||||
)
|
||||
val file = localConfig(home, "60974196").apply { writeText(config(apps(*legacy))) }
|
||||
assertEquals("0", SteamLaunchOptions.steamAppSetting(home, 1790600, "UseSteamControllerConfig", "1"))
|
||||
assertTrue(SteamLaunchOptions.writeSteamAppSetting(home, 1790600, "UseSteamControllerConfig", "0", "2", "1"))
|
||||
val written = file.readText()
|
||||
assertEquals("2", SteamLaunchOptions.steamAppSetting(home, 1790600, "UseSteamControllerConfig", "1"))
|
||||
assertEquals(1, Regex("UseSteamControllerConfig").findAll(written).count())
|
||||
assertFalse(written.substring(written.indexOf("\"Software\""), written.indexOf("\"WebStorage\"")).contains("UseSteamControllerConfig"))
|
||||
assertEquals("-dx11", SteamLaunchOptions.launchOptions(written, 1790600))
|
||||
assertTrue(SteamLaunchOptions.writeSteamAppSetting(home, 1790600, "UseSteamControllerConfig", "2", null, "1"))
|
||||
assertFalse(file.readText().contains("UseSteamControllerConfig"))
|
||||
}
|
||||
|
||||
@Test fun aChangeGoesToTheSignedInAccountOnly() {
|
||||
val home = steamHome()
|
||||
val signedIn = localConfig(home, "60974196").apply { writeText(config(apps(*sparking))) }
|
||||
|
||||
@@ -60,6 +60,117 @@ class SteamTouchConfigFilesTest {
|
||||
|
||||
private val template get() = File(steam, "controller_base/templates/controller_mobile_touch_gamepad_joystick.vdf")
|
||||
|
||||
private fun login() = File(steam, "config/loginusers.vdf").apply { parentFile!!.mkdirs() }
|
||||
.writeText("\"users\"\n{\n\t\"76561197960265851\"\n\t{\n\t\t\"MostRecent\"\t\t\"1\"\n\t}\n}\n")
|
||||
|
||||
private fun saveDefault(app: Int): File? {
|
||||
val elements = listOf(SteamTouchConfig.Element(SteamTouchConfig.A, true, 0.5f, 0.6f))
|
||||
return SteamTouchConfig.saveLayouts(context, app, SteamTouchConfig.load(context, app), mapOf(1 to elements))
|
||||
}
|
||||
|
||||
private fun assertSavedA(app: Int, saved: File?) {
|
||||
val loaded = SteamTouchConfig.load(context, app)
|
||||
assertEquals(saved, loaded.file)
|
||||
val a = SteamTouchConfig.elementsFor(loaded, 1, emptyList()).first { it.type == SteamTouchConfig.A }
|
||||
assertEquals(0.5f, a.x, 0.002f)
|
||||
assertEquals(0.6f, a.y, 0.002f)
|
||||
}
|
||||
|
||||
@Test fun savesWhenSteamHasNotCreatedTheAccountsControllerFolder() {
|
||||
File(steam, "steamapps/common/Steam Controller Configs").deleteRecursively()
|
||||
login()
|
||||
val saved = saveDefault(413150)
|
||||
assertEquals(File(dir, "413150/controller_mobile_touch.vdf"), saved)
|
||||
assertSavedA(413150, saved)
|
||||
}
|
||||
|
||||
@Test fun savesIntoTheSignedInAccountNotAnotherAccountsFolder() {
|
||||
dir.parentFile!!.deleteRecursively()
|
||||
val other = File(steam, "steamapps/common/Steam Controller Configs/456/config").apply { mkdirs() }
|
||||
login()
|
||||
val saved = saveDefault(413150)
|
||||
assertEquals(File(dir, "413150/controller_mobile_touch.vdf"), saved)
|
||||
assertFalse(File(other, "413150").exists())
|
||||
assertSavedA(413150, saved)
|
||||
}
|
||||
|
||||
@Test fun withoutAnAccountOrControllerFolderNothingIsWritten() {
|
||||
File(steam, "steamapps/common/Steam Controller Configs").deleteRecursively()
|
||||
assertEquals(null, saveDefault(413150))
|
||||
assertFalse(File(steam, "steamapps/common/Steam Controller Configs").exists())
|
||||
}
|
||||
|
||||
@Test fun anEmptyConfigsetIsRebuiltInsteadOfFailingTheSave() {
|
||||
File(dir, "configset_controller_mobile_touch.vdf").writeText("")
|
||||
val saved = saveDefault(413150)
|
||||
assertEquals(File(dir, "413150/controller_mobile_touch.vdf"), saved)
|
||||
assertTrue(File(dir, "configset_controller_mobile_touch.vdf").readText().contains("\"413150\""))
|
||||
assertSavedA(413150, saved)
|
||||
}
|
||||
|
||||
@Test fun aConfigsetWithOnlyAQuotedBraceIsRebuilt() {
|
||||
File(dir, "configset_controller_mobile_touch.vdf").writeText("\"controller_config\" \"{\"\n")
|
||||
val saved = saveDefault(413150)
|
||||
val root = KeyValues.parse(File(dir, "configset_controller_mobile_touch.vdf").readText()).child("controller_config")
|
||||
assertEquals("1", root?.child("413150")?.string("autosave"))
|
||||
assertSavedA(413150, saved)
|
||||
}
|
||||
|
||||
@Test fun anExistingConfigsetKeepsItsOtherEntries() {
|
||||
configset("configset_controller_mobile_touch.vdf", "8400" to "\"workshop\"\t\t\"7\"")
|
||||
saveDefault(413150)
|
||||
val text = File(dir, "configset_controller_mobile_touch.vdf").readText()
|
||||
assertTrue(text.contains("\"8400\""))
|
||||
assertTrue(text.contains("\"413150\""))
|
||||
}
|
||||
|
||||
private fun withBom(name: String) = File(dir, name).apply { writeText("\uFEFF" + readText()) }
|
||||
|
||||
@Test fun aConfigsetWithAByteOrderMarkKeepsItsOtherEntries() {
|
||||
configset("configset_controller_mobile_touch.vdf", "8400" to "\"workshop\"\t\t\"7\"")
|
||||
withBom("configset_controller_mobile_touch.vdf")
|
||||
val saved = saveDefault(413150)
|
||||
val root = KeyValues.parse(File(dir, "configset_controller_mobile_touch.vdf").readText()).child("controller_config")
|
||||
assertEquals("1", root?.child("413150")?.string("autosave"))
|
||||
assertEquals("7", root?.child("8400")?.string("workshop"))
|
||||
assertSavedA(413150, saved)
|
||||
}
|
||||
|
||||
@Test fun aWorkshopPickInAConfigsetWithAByteOrderMarkIsRead() {
|
||||
val picked = workshop("42", "community")
|
||||
configset("configset_controller_mobile_touch.vdf", "413150" to "\"workshop\"\t\t\"42\"")
|
||||
withBom("configset_controller_mobile_touch.vdf")
|
||||
assertEquals(picked, SteamTouchConfig.load(context, 413150).file)
|
||||
}
|
||||
|
||||
@Test fun aConfigsetMissingItsRootBraceGetsTheEntryAtTheRoot() {
|
||||
File(dir, "configset_controller_mobile_touch.vdf")
|
||||
.writeText("\"controller_config\"\n{\n\t\"8400\"\n\t{\n\t\t\"workshop\"\t\t\"7\"\n\t}\n")
|
||||
val saved = saveDefault(413150)
|
||||
val root = KeyValues.parse(File(dir, "configset_controller_mobile_touch.vdf").readText()).child("controller_config")
|
||||
assertEquals("1", root?.child("413150")?.string("autosave"))
|
||||
assertEquals("7", root?.child("8400")?.string("workshop"))
|
||||
assertEquals(null, root?.child("8400")?.child("413150"))
|
||||
assertSavedA(413150, saved)
|
||||
}
|
||||
|
||||
@Test fun aConfigsetCutOffAfterAKeyGetsTheEntryAtTheRoot() {
|
||||
File(dir, "configset_controller_mobile_touch.vdf").writeText("\"controller_config\"\n{\n\t\"8400\"\n\t{\n\t\t\"workshop\"")
|
||||
val saved = saveDefault(413150)
|
||||
val root = KeyValues.parse(File(dir, "configset_controller_mobile_touch.vdf").readText()).child("controller_config")
|
||||
assertEquals("1", root?.child("413150")?.string("autosave"))
|
||||
assertEquals(null, root?.child("8400")?.child("413150"))
|
||||
assertSavedA(413150, saved)
|
||||
}
|
||||
|
||||
@Test fun aConfigsetWhoseRootIsAQuotedValueIsRebuilt() {
|
||||
File(dir, "configset_controller_mobile_touch.vdf").writeText("\"controller_config\" \"{}\"\n")
|
||||
val saved = saveDefault(413150)
|
||||
val root = KeyValues.parse(File(dir, "configset_controller_mobile_touch.vdf").readText()).child("controller_config")
|
||||
assertEquals("1", root?.child("413150")?.string("autosave"))
|
||||
assertSavedA(413150, saved)
|
||||
}
|
||||
|
||||
private fun shortcut(name: String): Int {
|
||||
val shortcut = 2702387189L.toInt()
|
||||
template.apply { parentFile!!.mkdirs(); writeText(touch("Gamepad with Joystick")) }
|
||||
@@ -67,8 +178,7 @@ class SteamTouchConfigFilesTest {
|
||||
"!! Controller 0 attributes:\n Type: 43\n" +
|
||||
"Loaded Config for Last Resort Path for App ID 2702387189, Controller 0: /root/.local/share/Steam//controller_base/templates/controller_mobile_touch_gamepad_joystick.vdf\n",
|
||||
)
|
||||
File(steam, "config/loginusers.vdf").apply { parentFile!!.mkdirs() }
|
||||
.writeText("\"users\"\n{\n\t\"76561197960265851\"\n\t{\n\t\t\"MostRecent\"\t\t\"1\"\n\t}\n}\n")
|
||||
login()
|
||||
val vdf = java.io.ByteArrayOutputStream().apply {
|
||||
write("\u0000shortcuts\u0000\u00000\u0000\u0002appid\u0000".toByteArray())
|
||||
write(java.nio.ByteBuffer.allocate(4).order(java.nio.ByteOrder.LITTLE_ENDIAN).putInt(shortcut).array())
|
||||
@@ -89,6 +199,16 @@ class SteamTouchConfigFilesTest {
|
||||
assertEquals(saved, SteamTouchConfig.load(context, shortcut).file)
|
||||
}
|
||||
|
||||
@Test fun aSavedShortcutNameWithBracesDoesNotHideTheNextAppsEntry() {
|
||||
val shortcut = shortcut("Game {")
|
||||
SteamTouchConfig.saveLayouts(context, shortcut, SteamTouchConfig.load(context, shortcut), mapOf(1 to emptyList()))
|
||||
val saved = saveDefault(413150)
|
||||
val root = KeyValues.parse(File(dir, "configset_controller_mobile_touch.vdf").readText()).child("controller_config")
|
||||
assertEquals("1", root?.child("game {")?.string("autosave"))
|
||||
assertEquals("1", root?.child("413150")?.string("autosave"))
|
||||
assertSavedA(413150, saved)
|
||||
}
|
||||
|
||||
@Test fun aShortcutNameThatIsNoPlainFolderNameUsesTheAppId() {
|
||||
for (name in listOf("../escape", "a/b", "..", "Tab\tName")) {
|
||||
assertEquals(name, "2702387189", SteamTouchConfig.steamKey(context, shortcut(name)))
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.droiddeck.launcher.session
|
||||
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.robolectric.RobolectricTestRunner
|
||||
import org.robolectric.RuntimeEnvironment
|
||||
import org.robolectric.annotation.Config
|
||||
|
||||
@RunWith(RobolectricTestRunner::class)
|
||||
@Config(sdk = [34], application = android.app.Application::class)
|
||||
class SteamGpuCompositingTest {
|
||||
private val context get() = RuntimeEnvironment.getApplication()
|
||||
|
||||
@Before fun clear() {
|
||||
context.getSharedPreferences("session", 0).edit().clear().commit()
|
||||
assertTrue(SessionPrefs.steamGpuCompositingAllowed())
|
||||
}
|
||||
|
||||
@Test fun eligibleRendererUsesGpuCompositingByDefault() {
|
||||
assertTrue(SessionPrefs.steamGpuCompositing(context))
|
||||
}
|
||||
|
||||
@Test fun savedSoftwareChoiceIsPreserved() {
|
||||
context.getSharedPreferences("session", 0).edit()
|
||||
.putBoolean("steamGpuCompositing", false).commit()
|
||||
assertFalse(SessionPrefs.steamGpuCompositing(context))
|
||||
}
|
||||
|
||||
@Test fun savedGpuChoiceIsPreserved() {
|
||||
context.getSharedPreferences("session", 0).edit()
|
||||
.putBoolean("steamGpuCompositing", true).commit()
|
||||
assertTrue(SessionPrefs.steamGpuCompositing(context))
|
||||
}
|
||||
|
||||
@Test fun preferenceCanStillBeToggled() {
|
||||
SessionPrefs.setSteamGpuCompositing(context, false)
|
||||
assertFalse(SessionPrefs.steamGpuCompositing(context))
|
||||
SessionPrefs.setSteamGpuCompositing(context, true)
|
||||
assertTrue(SessionPrefs.steamGpuCompositing(context))
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,18 @@ and reports every run.
|
||||
works on every display and window. UI Automator, by contrast, dumps whichever window has focus,
|
||||
which on a dual-screen device is often another app's.
|
||||
|
||||
## On the device
|
||||
|
||||
The agent in DroidDeck's Agent tab gets its working rules from `tools/agent/AGENTS.md` and its
|
||||
skills from `tools/agent/skills`. Both ship in the APK; before every turn the app writes the rules
|
||||
as a marked block into each harness's global instructions (`~/.claude/CLAUDE.md`,
|
||||
`~/.codex/AGENTS.md`) and the skills into its skills folder (`~/.claude/skills`, `~/.codex/skills`).
|
||||
Only DroidDeck's own block and skills (folders holding a `.droiddeck` file) are replaced: rules
|
||||
the user writes outside the block, and skills they add, stay. A symlinked instructions file is
|
||||
followed, so the block lands in the file it points to. `droiddeckctl`, `droiddeck-scenario` and this guide are installed in
|
||||
`~/.local/share/droiddeck/ctl` (with `droiddeckctl` and `droiddeck-scenario` on PATH). If any of
|
||||
these cannot be installed, the Agent tab shows which.
|
||||
|
||||
## Access
|
||||
|
||||
Player controls and observations work over authorized ADB on any build: `state`, `start`, `stop`,
|
||||
|
||||
+4
-4
@@ -3,15 +3,15 @@
|
||||
MaliBridge by ASEbrahim: https://github.com/ASEbrahim/MaliBridge
|
||||
(GPL-3.0-or-later with the additional terms in NOTICE here, copied unchanged from the project).
|
||||
|
||||
DroidDeck builds MaliBridge from the `external/MaliBridge` submodule, pinned at 48477fe
|
||||
(v0.5.4) and not modified. Its Vulkan ICD runs inside the Linux runtime and forwards each call
|
||||
DroidDeck builds MaliBridge from the `external/MaliBridge` submodule, pinned at 64a3f22
|
||||
(v0.5.5.4) and not modified. Its Vulkan ICD runs inside the Linux runtime and forwards each call
|
||||
over a Unix socket to its server, which runs in the app on the phone's own Vulkan driver.
|
||||
DroidDeck uses it only on a GPU without Adreno's KGSL; an Adreno keeps Turnip.
|
||||
|
||||
The DroidDeck side of the bridge (the Setup switches, the server's start and session wiring, the
|
||||
Mali render node stand-in, the compositor's AHardwareBuffer import off Adreno, the Steam web helper
|
||||
layout, the socket wait and the DXVK choice for older Vulkan drivers) is Ahmad Sayed Alsayed
|
||||
Ebrahim's (ASEbrahim) work from https://github.com/ASEbrahim/DroidDeck, kept under their name in
|
||||
layout, the socket wait and the DXVK choice for older Vulkan drivers) is ASEbrahim's work
|
||||
from https://github.com/ASEbrahim/DroidDeck, kept under their name in
|
||||
this repository's history.
|
||||
|
||||
MaliBridge's own credits, in its README, include:
|
||||
|
||||
Vendored
+1
-1
Submodule external/MaliBridge updated: 95a1e600a5...64a3f22354.
@@ -0,0 +1,74 @@
|
||||
# DroidDeck on-device agent
|
||||
|
||||
You run in DroidDeck's Agent tab, on the user's handheld, in DroidDeck's Linux userland (Ubuntu
|
||||
under proot, aarch64). The user is often on a small screen: keep replies short. These notes come
|
||||
from what tripped agents up on real devices.
|
||||
|
||||
## Where you run
|
||||
|
||||
- Steam, the desktop and games run in DroidDeck's session, a separate guest from yours: a program
|
||||
you start here is not in it and has no screen. Reach it with `droiddeckctl` (guide:
|
||||
`/root/.local/share/droiddeck/ctl/agent-control.md`): `state`, `start steam`, `stop`, `launch`,
|
||||
`quit`, `focus`, `screenshot`, `logs`, `pacing`, `thermal`, and `guest` to run a command in it.
|
||||
- `droiddeckctl stop`, `start steam` and `resume` end or restart only the session. You keep
|
||||
running, so restart it yourself when a change needs a new session.
|
||||
- The session shares your filesystem. Steam is in `/root/.local/share/Steam` (its logs in
|
||||
`logs/`), and the session's live logs are in the folder `state` gives as `session.logDir`.
|
||||
`logs latest` makes a redacted, partial copy: read the live folder yourself. X properties,
|
||||
gamescope and the session's processes are only reachable through `guest`.
|
||||
|
||||
## Commands
|
||||
|
||||
- `guest` runs one program, not a shell line: `droiddeckctl guest -- sh -c '...'` for pipes,
|
||||
`$(...)` or `DISPLAY=:0 xprop ...`. Its answer is JSON; the output is in `stdout.text`.
|
||||
- `screenshot` takes the path as an argument (`screenshot /tmp/top.png --display 0`); on a
|
||||
dual-screen device see `droiddeckctl displays`. `prefs get` takes a file (`prefs get session`).
|
||||
- `input` drives a game session that has drawn a frame. For the launcher's own screens use
|
||||
`adb -s $ADB_SERIAL shell input keyevent KEYCODE_BACK` and similar.
|
||||
- `droiddeck-scenario` replays a scripted test through `droiddeckctl` (`--help` for the format).
|
||||
- Never kill by a command-line pattern (`pkill -f`, `pgrep -f` piped to `kill`): your own command
|
||||
line holds the user's message, so the pattern matches you. End a game with `droiddeckctl quit`,
|
||||
the session with `droiddeckctl stop`, anything else by its pid after checking what it is
|
||||
(`ps -o pid,args -p <pid>`): a pid near a game can be the Steam client.
|
||||
- `DEVICE_RESOLUTION_FAILED`: run `adb devices` and use the serial it lists.
|
||||
- Do not chain `sleep` before a check. Start long work in the background. In Claude Code, its end
|
||||
starts you again; other harnesses are not woken, so check it before ending your turn or tell the
|
||||
user it is still running.
|
||||
|
||||
## What applies when
|
||||
|
||||
- Many session settings (black frame insertion, environment, Proton) are read when a session or
|
||||
game starts. After changing one, restart the game or the session before judging it.
|
||||
- With "Return after game" on (the default), quitting a game DroidDeck launched ends the whole
|
||||
session; `start steam --wait --reuse` before the next launch. Launching a game that is already
|
||||
running makes Steam show "Game already running" and `launch` time out.
|
||||
- Session scripts are APK assets, copied into the rootfs at every session start over any local
|
||||
edit. A Lab build (`dd-lab-build`, see `docs/lab-builds.md`) carries app code and resources only:
|
||||
session scripts, native code and assets need a new APK, such as the pull request's CI test build
|
||||
(DroidDeck > Updates > Test builds).
|
||||
|
||||
## Changing DroidDeck
|
||||
|
||||
The source is checked out at `/root/DroidDeck` once the Agent tab's build tools are set up.
|
||||
|
||||
- It often holds the user's uncommitted work and a stale local `main`. Branch from `origin/main`
|
||||
in a worktree (`git worktree add -b <branch> ../<dir> origin/main`).
|
||||
- `dd-lab-build` builds the checkout as a Lab build and restarts DroidDeck on it. DroidDeck runs the
|
||||
build in a process of its own and shows its progress; `dd-lab-build` follows its log. Run it in
|
||||
the background and keep checking, so the user can talk to you meanwhile. The restart ends your
|
||||
process, and the conversation continues on the new build.
|
||||
- Python tests run from the repository root: `python3 -m unittest tools.tests.test_x`. Some fail on
|
||||
the device on `origin/main` too; run them on a worktree of `origin/main` before blaming a change.
|
||||
- Gradle unit tests rarely run on the device. Leave them to CI and say so rather than retrying.
|
||||
- If `git push` asks for credentials, run `gh auth setup-git` once.
|
||||
- Commits and pull requests you make are the user's own: no co-author line, AI credit or
|
||||
generated-by note.
|
||||
|
||||
## This file
|
||||
|
||||
DroidDeck writes this block into your global instructions (`~/.claude/CLAUDE.md`,
|
||||
`~/.codex/AGENTS.md`) before every turn, and its skills into `~/.claude/skills` and
|
||||
`~/.codex/skills`. It replaces only its own block and its own skills (folders holding a `.droiddeck` file): the
|
||||
user's rules go outside the block, and their skills stay, even one with the same name. Deleting a
|
||||
skill's `.droiddeck` file keeps local edits to it. To change DroidDeck's, edit `tools/agent/AGENTS.md` and
|
||||
`tools/agent/skills` in the source.
|
||||
@@ -19,6 +19,9 @@ for arg in "$@"; do
|
||||
--no-restart) mode=no-restart ;;
|
||||
--prepare) mode=prepare ;;
|
||||
--explain) explain=(--info -Pkotlin.build.report.output=file) ;;
|
||||
# Anything else used to start a full build and restart the app, --help included.
|
||||
-h|--help) sed -n '2,6s/^# \{0,1\}//p' "$0"; exit 0 ;;
|
||||
*) echo "dd-lab-build: unknown option $arg (see --help)" >&2; exit 2 ;;
|
||||
esac
|
||||
done
|
||||
started=$(date +%s)
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
---
|
||||
name: diagnose-game
|
||||
description: Find why a game crashed, hung or ran badly in DroidDeck, from session state and logs
|
||||
---
|
||||
|
||||
1. `droiddeckctl state`: `session.phase`, `session.failure`, `session.focus.focusedApp` (769 is
|
||||
Steam's own UI) and `session.logDir`.
|
||||
2. Read that log folder directly; it is on your filesystem. Earlier sessions are its siblings:
|
||||
`ls -t "$(dirname <logDir>)"`; the crash may be in the one before a restart. `logs latest`
|
||||
makes a redacted, partial copy with renamed files: use it only to hand logs to someone.
|
||||
- `games/<time>-<id>-<appid>/`, one folder per launch: `launch.txt` (exe, Proton, environment)
|
||||
and `steam-<appid>.log` (Proton and Wine).
|
||||
- `session.log` (the session script, `== ` lines), `wayland.log` (compositor), `app.log`,
|
||||
`events.jsonl`, `crash.log` (Android's crash buffer at session end), `memory-pressure.log`
|
||||
(low-memory kills), `graphics-report.txt`, `vulkan-summary.txt`, `steam/` (client logs).
|
||||
- The game's own log is in its prefix,
|
||||
`/root/.local/share/Steam/steamapps/compatdata/<appid>/pfx/drive_c/users/steamuser/`:
|
||||
Unity writes `AppData/LocalLow/<company>/<game>/Player.log`, Unreal
|
||||
`AppData/Local/<game>/Saved/Logs/`.
|
||||
3. Find the fatal error, not the first `err:`. Every run logs harmless ones (`err:nsi` bind
|
||||
errno 13, `err:hid`, `winebth`, `tabtip`, `overriding CPU configuration`), and `trace:seh`
|
||||
first-chance exceptions are often handled. Look for the last exception before the process ends:
|
||||
`grep -nE "EXCEPTION_ACCESS_VIOLATION|Unhandled exception|virtual_setup_exception|DEVICE_LOST|VK_ERROR" steam-<appid>.log`.
|
||||
Same address in every launch means a deterministic fault; compare with an older launch that
|
||||
worked before blaming a line.
|
||||
4. For performance, `droiddeckctl pacing --seconds 20` (`fpsOnScreen`, `offCadencePercent`) and
|
||||
`droiddeckctl thermal`: at `SEVERE` or worse the device is throttling, so say that first.
|
||||
5. Explain the cause in plain words with the lines that show it (file and line number). Propose
|
||||
the smallest reversible change and ask before applying it:
|
||||
- Proton for one game: list `/root/.local/share/Steam/compatibilitytools.d` and
|
||||
`steamapps/common/Proton*`, then
|
||||
`droiddeckctl cdp eval 'SteamClient.Apps.SpecifyCompatTool(<appid>, "<tool dir name>")'`;
|
||||
check `CompatToolMapping` in `config/config.vdf`.
|
||||
- Launch options for one game: read them first,
|
||||
`droiddeckctl cdp eval 'appDetailsStore.GetAppDetails(<appid>)?.strLaunchOptions'`, keep
|
||||
them, then `SteamClient.Apps.SetAppLaunchOptions(<appid>, "VAR=1 %command%")`.
|
||||
- For every game: `droiddeckctl env set KEY=VALUE` applies to the next session only
|
||||
(`--persistent` keeps it); restart the session with `droiddeckctl stop` and `start steam`.
|
||||
6. Relaunch and read the new launch folder before saying it is fixed. If Steam stays on
|
||||
"Stopping", `droiddeckctl quit <appid>`, then look for leftover Wine processes with
|
||||
`droiddeckctl guest -- sh -c 'ps -eo pid,args | grep -i wine'`; never kill the Steam client.
|
||||
@@ -0,0 +1,41 @@
|
||||
---
|
||||
name: reproduce-with-input
|
||||
description: Reproduce a reported game problem by launching the game and driving controller input
|
||||
---
|
||||
|
||||
1. `droiddeckctl state` first. If the game already has focus, do not launch it again: Steam shows
|
||||
"Game already running" and `launch` times out. With no session, `droiddeckctl start steam --wait`.
|
||||
Then `droiddeckctl launch <appid> --wait` and `droiddeckctl wait focused <appid> --timeout 180`.
|
||||
Check `droiddeckctl thermal` too: at `SEVERE` or worse, performance results mean little.
|
||||
2. Look before acting: `droiddeckctl screenshot ./shot.png --display 0`, then read the image. On the
|
||||
Retroid Pocket Duo the top screen is display 0 and the bottom is 2 (`droiddeckctl displays`).
|
||||
A game shows black or loading frames for a while after it takes focus; take another shot a few
|
||||
seconds later before calling it a black screen.
|
||||
3. Drive it with `droiddeckctl input`: `pad a` (also `b x y lb rb start select l3 r3 guide qam`
|
||||
and the D-pad `up down left right`; `--hold` in ms), `stick left 0 -1 --hold 800`,
|
||||
`trigger right 1.0`, `key ENTER`, `text 'hello'`. Input goes to the game window that has
|
||||
focus once the session has drawn a frame. The launcher's own screens need
|
||||
`adb -s $ADB_SERIAL shell input keyevent ...` instead. Take a screenshot after each step that
|
||||
should change the screen.
|
||||
4. Measure: `droiddeckctl pacing --seconds 20` (`fpsOnScreen`, `offCadencePercent`). For flicker
|
||||
or stutter a still cannot show, `droiddeckctl record ./clip.mp4 --seconds 8 --display 0`.
|
||||
5. Make it replayable: write the steps as a scenario and run it with `droiddeck-scenario`
|
||||
(installed beside `droiddeckctl`); `--help` documents the format. Give screenshot steps a display:
|
||||
|
||||
```json
|
||||
{"name": "nfs-menu", "vars": {"appId": 47870}, "repeat": 1,
|
||||
"before": [["start", "steam", "--wait", "--reuse", "--timeout", "240"]],
|
||||
"steps": [["launch", "${appId}", "--wait"],
|
||||
["wait", "focused", "${appId}", "--timeout", "180"],
|
||||
{"sleep": 20}, ["input", "pad", "a"], {"sleep": 3},
|
||||
{"screenshot": "after-a", "display": 0},
|
||||
["pacing", "--seconds", "10"], {"assert": "fpsOnScreen", "exists": true}],
|
||||
"after": [["quit", "${appId}"]]}
|
||||
```
|
||||
|
||||
`droiddeck-scenario nfs-menu.json --out ./runs` writes `report.json` and, for a failed
|
||||
run, a screenshot, focus and logs.
|
||||
6. Report the steps that reproduce it and what you saw at each. Quit the game with
|
||||
`droiddeckctl quit <appid>` unless the user is playing it. With "Return after game" on (the
|
||||
default), quitting a game DroidDeck launched also ends the session, so `start steam` again
|
||||
before the next launch.
|
||||
@@ -433,7 +433,7 @@ if [[ "${DROIDDECK_SKIP_RUST:-0}" != 1 ]]; then
|
||||
CARGO_TARGET_DIR="${cache_dir}/ubisoft-target" bash tools/ubisoft-launcher/build.sh "${upc_out}"
|
||||
save_step ubisoft "${upc_key}" "${upc_out}"
|
||||
fi
|
||||
rockstar_out="${repo_root}/app/src/main/resources/rockstar/helpers"
|
||||
rockstar_out="${linuxfs_dir}/usr/local/lib/droiddeck-rockstar"
|
||||
rockstar_key=$(inputs_hash "windows-gnu" tools/rockstar-launcher/src tools/rockstar-launcher/Cargo.toml tools/rockstar-launcher/Cargo.lock tools/rockstar-launcher/build.sh)
|
||||
if ! restore_step rockstar "${rockstar_key}" "${rockstar_out}"; then
|
||||
command -v i686-w64-mingw32-gcc >/dev/null 2>&1 || { echo "i686-w64-mingw32-gcc is required for the Rockstar launcher service." >&2; exit 1; }
|
||||
|
||||
@@ -16,7 +16,7 @@ if grep -qxE '__gxx_personality_v0|__cxa_throw|_Unwind_Resume' <<<"$FAKE"; then
|
||||
echo "::error::libfakeinput.so exports the C++ runtime"; exit 1
|
||||
fi
|
||||
SESSION=$(syms "$D/libblsession.so")
|
||||
for sym in socket bind getsockname setsockopt statfs statvfs syscall shm_open shm_unlink mmap mmap64 munmap drmPrimeFDToHandle drmCloseBufferHandle; do
|
||||
for sym in socket bind getsockname setsockopt statfs statvfs syscall shm_open shm_unlink mmap mmap64 munmap mprotect drmPrimeFDToHandle drmCloseBufferHandle; do
|
||||
grep -qx "$sym" <<<"$SESSION" || { echo "::error::libblsession.so does not export $sym"; exit 1; }
|
||||
done
|
||||
if grep -qx drmIoctl <<<"$SESSION"; then
|
||||
|
||||
Loaded 100 of 146 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user