mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-20 05:16:01 +00:00
chore: remove source comments and unused code, translate every missing string (#1965)
* chore(i18n): translate every missing string in all locales Adds the 87 strings the bottom-screen Dashboard and in-game stats pages introduced to all 32 locales, plus the 51 older settings strings Japanese and the 50 Chinese locales were still missing. Every locale now has all 3456 translatable strings with the same placeholders as English. Also translates 36 entries that were still English where the language does not use the English word, and makes es-419 touch_app_id use the same %1$s placeholder as English. * chore(patches): drop comments from the lines downstream patches add Removes comment lines and trailing comments from lines our patches add, with hunk headers recounted. Lines that a later patch uses as context and the upstream backport 0123 are left as they are. The gamescope, FEX, proot and xodus series still apply to their pinned sources, and the patched trees differ only in those comments. test_hud_frames now finds the HUD writer by its first declaration. * docs: credit Greenlight, Better xCloud, viture-v2, GameNative and DiRTTelemetryErrorFix These were credited only in source headers and NOTICE files. * chore: remove source comments and unused functions Removes explanatory comments from first-party Kotlin, Java, C, C++, Rust, TypeScript, Python, shell, Gradle, CMake and workflow files. License and attribution headers stay, and vendored third-party trees, generated files and license files are untouched. A shellcheck directive is kept, and udevmon's fallthrough comments became fallthrough attributes. Syntax trees and token streams match the previous sources apart from the comments and Python docstrings. Module docstrings that argparse prints are kept, and device-smoke.sh prints the same --help text from a heredoc. Also removes 37 functions and 4 fields that nothing referenced. * chore: remove comments from the Syncthing integration and the latest main sources * docs: credit Syncthing and the syncthing-android fork * chore(i18n): translate the Syncthing strings in all locales The 107 strings the Syncthing integration added are now in all 32 locales. sync_web_path_locked names the Syncthing tab by its label. * docs: credit @xXJSONDeruloXx for the HUD metric readers The CPU, GPU load, thermal and battery readers come from their PerformanceHudView pull requests #777, #877, #991, #1406 and #1573. The FusionHUD credit line is unchanged. * docs: credit the HUD metric readers to @xXJSONDeruloXx's work
This commit is contained in:
1 parent
d730f0fa8b
commit
c5577478ca
511 files changed
+6813
-4068
No files matched your search
@@ -29,15 +29,12 @@ int main(void) {
|
||||
assert(cursor_scene_positions(3840, CARDBOARD_SOURCE_SBS, 1920, 0, out) == 2);
|
||||
assert(out[0] == 1920 && out[1] == 0);
|
||||
|
||||
/* A hotspot that pushes the image across the seam must not move the mirror to the
|
||||
* other eye: the pointer decides the eye, the hotspot only shifts the image. */
|
||||
assert(cursor_scene_positions(1920, CARDBOARD_SOURCE_SBS, 960, 32, out) == 2);
|
||||
assert(out[0] == 928 && out[1] == -32);
|
||||
|
||||
assert(cursor_scene_positions(1920, CARDBOARD_SOURCE_SBS, 959, 32, out) == 2);
|
||||
assert(out[0] == 927 && out[1] == 1887);
|
||||
|
||||
/* Each copy is cropped to its own eye, so nothing bleeds into the other eye's half. */
|
||||
assert(cursor_clip_to_eye(1920, -1, 100, 32, &dx, &sx, &dw) == 1);
|
||||
assert(dx == 100 && sx == 0 && dw == 32);
|
||||
|
||||
|
||||
@@ -23,8 +23,6 @@ static void wl_pointer_send_button(struct wl_resource *r, uint32_t serial,
|
||||
r->held &= ~(1u << (button - 0x110));
|
||||
r->releases++;
|
||||
}
|
||||
/* The old dispatcher calls this even for releases, emitting stale coordinates.
|
||||
* Recording this boundary detects that unwanted motion/focus routing path. */
|
||||
static void pointer_input(double x, double y, int relative, uint32_t button, int pressed) {
|
||||
assert(x == 0 && y == 0 && relative == 1 && button >= 0x110 && button <= 0x112);
|
||||
assert(pressed == 1);
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
"""Single-core Steam affinity is rechecked even if its thread count stayed the same."""
|
||||
import subprocess
|
||||
import tempfile
|
||||
import unittest
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
"""Exercise the compositor's real cursor placement rule for glasses output."""
|
||||
import os
|
||||
from pathlib import Path
|
||||
import re
|
||||
|
||||
@@ -316,7 +316,6 @@ class GameFolderTest(Temp):
|
||||
|
||||
|
||||
def appinfo(apps):
|
||||
"""appinfo.vdf as the client writes it (format 29: keys in a string table)."""
|
||||
strings = []
|
||||
|
||||
def key(name):
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
"""The guest agent: its request files, exec, errors and the DevTools client, without a session."""
|
||||
import base64
|
||||
import hashlib
|
||||
import importlib.machinery
|
||||
@@ -26,7 +25,6 @@ loader.exec_module(agent)
|
||||
|
||||
|
||||
class FakeDevTools(threading.Thread):
|
||||
"""GET /json lists one target; its WebSocket answers Runtime.evaluate the way Chromium does."""
|
||||
|
||||
def __init__(self, answer):
|
||||
super().__init__(daemon=True)
|
||||
@@ -857,7 +855,6 @@ class VrFocusTest(unittest.TestCase):
|
||||
self.assertEqual(focus.order([42, 9, 7], [7, 42], None), [9, 7])
|
||||
self.assertIsNone(focus.order([9, 7], [7], 42))
|
||||
self.assertEqual(focus.order([9, 7], [7, 42], 42), [42, 9, 7])
|
||||
# Do not overwrite a different focus order installed after our last write.
|
||||
self.assertIsNone(focus.order([123, 7], [7, 42], None))
|
||||
|
||||
def test_scene_requires_live_server_and_game_environment(self):
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
"""droiddeckctl and droiddeck-scenario against a fake adb: the JSON contract and exit codes."""
|
||||
import base64
|
||||
import contextlib
|
||||
import importlib.machinery
|
||||
@@ -88,8 +87,6 @@ def timestats_record(name, frames, histogram, hz):
|
||||
f"present2present histogram is as below:\n{bins}\nlatch2present histogram is as below:\n8ms={frames}\n")
|
||||
|
||||
|
||||
# A capture where the panel went from 60 to 120 Hz: the game layer is split in two records. The
|
||||
# activity's own window and an unrelated app draw too, and must not count.
|
||||
TIMESTATS_SPLIT = "SurfaceFlinger TimeStats:\ntotalFrames = 2000\n" + "".join([
|
||||
timestats_record("droiddeck_wayland_game#6110", 900, {16: 700, 33: 199}, 60),
|
||||
timestats_record("droiddeck_wayland_game#6110", 900, {16: 850, 25: 49}, 120),
|
||||
@@ -99,7 +96,6 @@ TIMESTATS_SPLIT = "SurfaceFlinger TimeStats:\ntotalFrames = 2000\n" + "".join([
|
||||
timestats_record("StatusBar#106", 1, {}, 60),
|
||||
])
|
||||
|
||||
# A build that presents the game on the session's SurfaceView instead of a layer of its own.
|
||||
TIMESTATS_SURFACEVIEW = "SurfaceFlinger TimeStats:\n" + "".join([
|
||||
timestats_record("a1b2c3 SurfaceView[com.droiddeck.launcher/com.droiddeck.launcher.SessionActivity]#77",
|
||||
1800, {16: 1796, 33: 3}, 120),
|
||||
@@ -155,7 +151,7 @@ class DroiddeckctlTest(FakeAdbTest):
|
||||
with unittest.mock.patch.dict(os.environ, {"DROIDDECK_PACKAGE": "com.antutu.benchmark.full"}):
|
||||
variant = load("droiddeckctl")
|
||||
self.assertEqual("content://com.antutu.benchmark.full.agent", variant.AUTHORITY)
|
||||
with self.assertRaises(variant.ControlError): # the fake adb does not answer `am start`
|
||||
with self.assertRaises(variant.ControlError):
|
||||
variant.start_agent_activity(str(self.adb), "fake-1", {"mode": "steam"})
|
||||
started = [e["args"] for e in self.calls() if e["args"][:3] == ["shell", "am", "start"]]
|
||||
self.assertIn("com.antutu.benchmark.full/com.droiddeck.launcher.agent.AgentStartActivity", started[0])
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
"""The Quick Access Frame Limit follows the panel when its refresh rate changes."""
|
||||
from pathlib import Path
|
||||
import runpy
|
||||
import subprocess
|
||||
|
||||
@@ -246,7 +246,6 @@ class DirtTelemetryFixTest(unittest.TestCase):
|
||||
|
||||
|
||||
class EgoCorePlanTest(unittest.TestCase):
|
||||
"""DiRT 3's restrictions as shipped: plans for 2, 3, 4, 6 and 8+ cores, one core for anything else."""
|
||||
|
||||
@staticmethod
|
||||
def rule(op, value, worker_map):
|
||||
@@ -460,7 +459,6 @@ class GameDebugLoggingTest(unittest.TestCase):
|
||||
result = launch([str(probe), verb], {**env, "STEAM_COMPAT_DATA_PATH": str(home / "compatdata" / prefix)})
|
||||
self.assertEqual(result["env"]["PROTON_LOG"], "0")
|
||||
self.assertEqual(result["env"]["WINEDEBUG"], "-all")
|
||||
# Non-Steam shortcuts use the same normalized unsigned compatdata identity.
|
||||
result = launch(command, {**env, "STEAM_COMPAT_DATA_PATH": str(home / "compatdata/-1")})
|
||||
self.assertEqual(result["env"]["PROTON_LOG"], "1")
|
||||
self.assertFalse((home / "never-created").exists())
|
||||
|
||||
@@ -106,9 +106,6 @@ def main():
|
||||
surface = alloc()
|
||||
send(comp, 0, U(surface))
|
||||
if not args.unassigned_control:
|
||||
# wlroots 0.20.2 assigns the cursor role before forwarding this serial
|
||||
# to Gamescope, so zero avoids needing pointer focus but still tests the
|
||||
# role guard in xwayland_surface_commit.
|
||||
send(pointer, 0, U(0, surface, 0, 0))
|
||||
roundtrip()
|
||||
before = count()
|
||||
|
||||
@@ -14,7 +14,7 @@ READER = ROOT / "app/src/main/cpp/waylandcomp/src/hudframes.c"
|
||||
def patch_writer():
|
||||
added = [line[1:] for line in PATCH.read_text().splitlines() if line.startswith("+") and not line.startswith("+++")]
|
||||
text = "\n".join(added)
|
||||
start = text.index("// DroidDeck's own HUD reads")
|
||||
start = text.index("static constexpr uint32_t k_uDroidDeckHudFramesMagic")
|
||||
end = text.index("\n}\n", text.index("static void publish_droiddeck_hud_info()", start)) + 3
|
||||
return text[start:end]
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ ALL = set(range(8))
|
||||
|
||||
|
||||
class FakeCores:
|
||||
"""Per-thread masks and priorities, with every change recorded."""
|
||||
|
||||
def __init__(self):
|
||||
self.state = {}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
"""Real login1 sleep handshakes; run with dbus-run-session and python3-gi."""
|
||||
import os
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
|
||||
@@ -10,7 +10,6 @@ COMPONENTS = runpy.run_path(str(BIN / "droiddeck-wincomponents"))
|
||||
|
||||
|
||||
class FakePackage:
|
||||
"""A package's tables in memory, as msiinfo would give them."""
|
||||
|
||||
def __init__(self, tables, summary=None):
|
||||
self.path = "fake.msi"
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
"""NetworkManager contract and real D-Bus handovers (requires python3-gi and dbus).
|
||||
|
||||
Run on Linux: dbus-run-session -- python3 -m unittest discover -s tools/tests -p test_netmanager.py
|
||||
"""
|
||||
import importlib.machinery
|
||||
import importlib.util
|
||||
import json
|
||||
|
||||
@@ -9,8 +9,6 @@ import unittest
|
||||
PRELOAD = Path(__file__).resolve().parents[1] / "linuxfs/preload"
|
||||
FASTPATH = Path(__file__).resolve().parents[1] / "proot/fastpath/fastpath.c"
|
||||
|
||||
# Opens each "<dirfd>\t<flags>\t<path>" case with openat2(RESOLVE_IN_ROOT) as FEX does: first through the kernel's own
|
||||
# openat2 on argv[1] when it has one, then, with openat2 failing ENOSYS as under proot, through the preload on argv[2].
|
||||
PROGRAM = r"""
|
||||
#define _GNU_SOURCE
|
||||
#include <dlfcn.h>
|
||||
@@ -225,7 +223,6 @@ int main(int argc, char **argv) {
|
||||
|
||||
O_PATH = getattr(os, "O_PATH", 0o10000000)
|
||||
|
||||
# (dirfd: r = the tree, o = "/"), flags, path, expected: a path in the tree, an errno name, or "proc" for a file outside it.
|
||||
CASES = [
|
||||
("r", os.O_RDONLY, "etc/alternatives/hn", "etc/hostname"),
|
||||
("r", os.O_RDONLY, "/lib64/x86_64-linux-gnu/libfoo.so.1", "usr/lib/x86_64-linux-gnu/libfoo.so.1.2"),
|
||||
@@ -256,7 +253,6 @@ CASES = [
|
||||
("o", os.O_RDONLY, "proc/self/status", "proc"),
|
||||
]
|
||||
|
||||
# Only the preload: an absolute link to a path missing in the tree but present outside it, as droiddeck-fex's rootfs has.
|
||||
HOST_CASES = [
|
||||
("r", os.O_RDONLY, "lib/x86_64-linux-gnu/libbar.so.2", "host:libbar.so.2"),
|
||||
("r", os.O_RDONLY, "hostdir/sub/data", "host:sub/data"),
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
"""Test the renderer's actual map and inverse map without a Vulkan device."""
|
||||
import os
|
||||
from pathlib import Path
|
||||
import shutil
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
"""Exercise the compositor's real button dispatcher with a recording Wayland sink."""
|
||||
import os
|
||||
from pathlib import Path
|
||||
import shutil
|
||||
|
||||
@@ -30,7 +30,6 @@ class PreloadSnapshotTest(unittest.TestCase):
|
||||
directory = tempfile.TemporaryDirectory()
|
||||
self.addCleanup(directory.cleanup)
|
||||
self.root = Path(directory.name)
|
||||
# Real repository inputs exercise the transitive include walker and build recipe.
|
||||
for group in snapshots.INPUTS:
|
||||
for name in snapshots.source_files(group):
|
||||
if name.startswith('@'):
|
||||
|
||||
@@ -10,8 +10,6 @@ ROOT = Path(__file__).resolve().parents[2]
|
||||
@unittest.skipUnless(shutil.which('cc'), 'needs a C compiler')
|
||||
class QuestBackdropTest(unittest.TestCase):
|
||||
def test_first_frame_requires_client_content(self):
|
||||
# Compile the real entrypoint with controlled layer outcomes, including the
|
||||
# successful no-op that previously dismissed the loading UI on a black frame.
|
||||
source = (ROOT / 'app/src/main/cpp/waylandcomp/src/vk_present.c').read_text()
|
||||
start = source.index('\nint vkp_render(')
|
||||
end = source.index('\nint vkp_render_hdr(', start)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
"""Exercise the Windows launcher without building an APK or contacting a phone."""
|
||||
import os
|
||||
from pathlib import Path
|
||||
import shutil
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
"""Gamescope composites the cursor only when a Steam session asks for it."""
|
||||
import os
|
||||
from pathlib import Path
|
||||
import re
|
||||
|
||||
@@ -1,9 +1,3 @@
|
||||
"""Exercise the literal launch prefix from SessionService without an Android runtime.
|
||||
|
||||
This is a focused source/exec regression check, not a Kotlin or PRoot integration
|
||||
test. PRoot executes the first guest argument directly; KEY=VALUE is meaningful
|
||||
only after /usr/bin/env. Read the production prefix rather than duplicate it.
|
||||
"""
|
||||
import json
|
||||
from pathlib import Path
|
||||
import re
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
"""Steam owns game caps; the nested compositor follows the output refresh rate."""
|
||||
import os
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
|
||||
@@ -9,8 +9,6 @@ PACKAGE = 'com.droiddeck.launcher'
|
||||
|
||||
class SignApkRenamesTest(unittest.TestCase):
|
||||
def test_variants_rename_every_authority_and_task_named_after_the_package(self):
|
||||
# sign-apk.sh renames a fixed list of names for the pubg/antutu/ludashi variants and fails the
|
||||
# main build on any authority or task affinity it leaves on the base package; PR builds do not sign.
|
||||
manifest = (ROOT / 'app/src/main/AndroidManifest.xml').read_text()
|
||||
names = set()
|
||||
for attribute in ('authorities', 'taskAffinity'):
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
"""Retry a dropped shortcut without duplicating a launch that is still preparing its first window."""
|
||||
import os
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
@@ -29,7 +28,6 @@ class SteamColdLaunchTest(unittest.TestCase):
|
||||
self.agent_count = self.root / "agent-count"
|
||||
self.focus_count = self.root / "focus-count"
|
||||
|
||||
# FOCUS lists the focused app per xprop call; the last value repeats.
|
||||
xprop = self.bin / "xprop"
|
||||
xprop.write_text(
|
||||
"#!/bin/sh\n"
|
||||
|
||||
@@ -50,14 +50,12 @@ CONFIG = '''"InstallConfigStore"
|
||||
|
||||
|
||||
class X64RepointTest(unittest.TestCase):
|
||||
"""steam-compatibility --x64: the x86-64 client's Proton entries go to its arm64 wrapper."""
|
||||
|
||||
def setUp(self):
|
||||
self.home = tempfile.TemporaryDirectory()
|
||||
self.root = Path(self.home.name) / "Steam"
|
||||
(self.root / "config").mkdir(parents=True)
|
||||
(self.root / "config" / "config.vdf").write_text(CONFIG)
|
||||
# A wrapper of its own whose name starts with "proton": kept, never repointed.
|
||||
own = self.root / "compatibilitytools.d" / "proton-cachyos-a64"
|
||||
own.mkdir(parents=True)
|
||||
(own / "compatibilitytool.vdf").write_text('"compatibilitytools"\n{\n\t"compat_tools"\n\t{\n\t\t"proton-cachyos-a64"\n\t\t{\n\t\t}\n\t}\n}\n')
|
||||
@@ -82,12 +80,10 @@ class X64RepointTest(unittest.TestCase):
|
||||
self.assertEqual(m["550"], "GE-Proton11-7-a64")
|
||||
self.assertEqual(m["620"], "proton-cachyos-a64")
|
||||
self.assertEqual(m["730"], "steamlinuxruntime")
|
||||
# The arm64 client's own Proton name, which this client ignores.
|
||||
self.assertEqual(m["880"], "GE-Proton11-7-a64")
|
||||
self.assertEqual(m["0"], "GE-Proton11-7-a64")
|
||||
|
||||
def test_repoints_arm64_name_even_with_its_stray_tool(self):
|
||||
# An arm64 compat pass that ran against this client also left its tool folder here.
|
||||
stray = self.root / "compatibilitytools.d" / "droiddeck-proton-arm64"
|
||||
stray.mkdir(parents=True)
|
||||
(stray / "compatibilitytool.vdf").write_text('"compatibilitytools"\n{\n\t"compat_tools"\n\t{\n\t\t"droiddeck-proton-arm64"\n\t\t{\n\t\t}\n\t}\n}\n')
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
"""Desktop Steam stays on KDE; explicit Big Picture still switches sessions."""
|
||||
import fcntl
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
@@ -280,8 +280,6 @@ done(28 if end < len(data) else 0)
|
||||
self.assertFalse(self.requests.exists())
|
||||
|
||||
def publish(self, **parts):
|
||||
"""The CDN's client as these parts (block name -> byte count of incompressible content),
|
||||
listed with sizes as Valve's manifest lists them."""
|
||||
files = {}
|
||||
blocks = ''
|
||||
for block, length in parts.items():
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
"""droiddeck-store-launch: a launch from anywhere - the Steam client's own Play button included -
|
||||
asks the app for an Epic game's sign-in code before Proton starts. These pin how it recognises a
|
||||
store game, how it asks, and that both Proton launchers call it."""
|
||||
import importlib.machinery
|
||||
import importlib.util
|
||||
import json
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
"""The shortcuts writer and a store install: the app registers a game GOG, Epic or Amazon
|
||||
installed through the same listing as an added folder, pointing the shortcut at the game's
|
||||
launcher .bat when it has one. These pin the parts of the writer that contract relies on."""
|
||||
import importlib.machinery
|
||||
import importlib.util
|
||||
import json
|
||||
@@ -28,8 +25,6 @@ LAUNCHER = FOLDER + '/.droiddeck-launch.bat'
|
||||
|
||||
|
||||
def app_id(exe, name):
|
||||
"""The appid the app computes for a shortcut (AddedGames.scanGame): CRC32 of the quoted exe
|
||||
and the name, high bit set - what Steam itself derives for a shortcut it is given."""
|
||||
return (zlib.crc32(('"%s"' % exe + name).encode()) | 0x80000000) & 0xFFFFFFFF
|
||||
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ TERMUX_DIR = TESTS.parents[1] / "app/src/main/cpp/termux"
|
||||
|
||||
|
||||
def jni_include_dir():
|
||||
"""A directory holding jni.h: JNI_INCLUDE, then the JDK, then the Android NDK."""
|
||||
candidates = [os.environ.get("JNI_INCLUDE")]
|
||||
java_home = os.environ.get("JAVA_HOME")
|
||||
if java_home:
|
||||
@@ -29,7 +28,6 @@ def jni_include_dir():
|
||||
|
||||
|
||||
def include_flags():
|
||||
"""-I flags for jni.h, plus the JDK's per-platform directory that holds jni_md.h."""
|
||||
base = jni_include_dir()
|
||||
flags = ["-I", base]
|
||||
for sub in glob.glob(os.path.join(base, "*")):
|
||||
|
||||
@@ -8,7 +8,6 @@ import unittest
|
||||
|
||||
PRELOAD = Path(__file__).resolve().parents[1] / "linuxfs/preload"
|
||||
|
||||
# Stands in for libfakeinput.so, which ld.so.preload lists after libblsession.so.
|
||||
SHIM = r"""
|
||||
#include <linux/input.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
Reference in new issue
Block a user