From e16a77facbddbf989831cb8fa57d55ff3d88ce8a Mon Sep 17 00:00:00 2001 From: maxjivi05 Date: Thu, 3 Dec 2026 00:14:06 -0500 Subject: [PATCH] droiddeck-fex: take the runtime from an adopted tool's original manifest --- tools/linuxfs/overlay/usr/local/bin/droiddeck-fex | 9 ++++++--- tools/tests/test_droiddeck_fex.py | 9 +++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/tools/linuxfs/overlay/usr/local/bin/droiddeck-fex b/tools/linuxfs/overlay/usr/local/bin/droiddeck-fex index 76b8a73b24..f651d34b27 100755 --- a/tools/linuxfs/overlay/usr/local/bin/droiddeck-fex +++ b/tools/linuxfs/overlay/usr/local/bin/droiddeck-fex @@ -750,9 +750,12 @@ def vulkan_thunk_loads(fex, folder): def required_runtime(program): - text = read_text(os.path.join(os.path.dirname(program), "toolmanifest.vdf")) or "" - match = re.search(r'"require_tool_appid"\s+"(\d+)"', text) - return match.group(1) if match and match.group(1) in RUNTIMES else SNIPER_APPID + folder = os.path.dirname(program) + for name in ("toolmanifest.vdf.droiddeck-orig", "toolmanifest.vdf"): + match = re.search(r'"require_tool_appid"\s+"(\d+)"', read_text(os.path.join(folder, name)) or "") + if match and match.group(1) in RUNTIMES: + return match.group(1) + return SNIPER_APPID def resolve(program, env): diff --git a/tools/tests/test_droiddeck_fex.py b/tools/tests/test_droiddeck_fex.py index 6dde936739..2eecb9cfeb 100644 --- a/tools/tests/test_droiddeck_fex.py +++ b/tools/tests/test_droiddeck_fex.py @@ -1235,6 +1235,15 @@ class LaunchTest(FexTestCase): self.assertEqual(emulated.call_args[0][2]["FEX_ROOTFS"], str(platform / "files")) self.assertEqual(FEX["required_runtime"](str(self.proton("1391110"))), "1628350") + def test_an_adopted_proton_keeps_the_runtime_of_its_original_manifest(self): + proton = self.proton("4183110") + folder = proton.parent + os.rename(folder / "toolmanifest.vdf", folder / "toolmanifest.vdf.droiddeck-orig") + self.write(folder / "toolmanifest.vdf", '"manifest"\n{\n "commandline" "/droiddeck-proton-wrap %verb%"\n}\n') + self.assertEqual(FEX["required_runtime"](str(proton)), "4183110") + os.unlink(folder / "toolmanifest.vdf.droiddeck-orig") + self.assertEqual(FEX["required_runtime"](str(proton)), "1628350") + def test_proton_action_keeps_the_prefix_and_runs_under_fex(self): self.fex_tool() self.runtime()