From 9922e25d388b4ff34b17c94fa4ed30c5baaa0f80 Mon Sep 17 00:00:00 2001 From: YoursFunny Date: Mon, 6 Jul 2026 17:03:38 +0800 Subject: [PATCH] fix: remove render errors on waydroid --- module/device/method/utils.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/module/device/method/utils.py b/module/device/method/utils.py index 42c96e7..cbf081d 100644 --- a/module/device/method/utils.py +++ b/module/device/method/utils.py @@ -331,27 +331,30 @@ def remove_shell_warning(s): """ Remove warnings from shell + Warnings in VMOS shell + https://github.com/LmeSzinc/AzurLaneAutoScript/issues/1425 + WARNING: linker: [vdso]: unused DT entry: type 0x70000001 arg 0x0\n\x89PNG\r\n\x1a\n\x00\x00\x00\rIH + + Errors in waydroid screencap render + https://github.com/LmeSzinc/AzurLaneAutoScript/issues/4760 + Failed to create //.cache for shader cache (Read-only file system)---disabling.\n + Args: s (str, bytes): Returns: str, bytes: """ - # WARNING: linker: [vdso]: unused DT entry: type 0x70000001 arg 0x0\n\x89PNG\r\n\x1a\n\x00\x00\x00\rIH if isinstance(s, bytes): if s.startswith(b'WARNING'): - try: - s = s.split(b'\n', maxsplit=1)[1] - except IndexError: - pass - return s - # return re.sub(b'^WARNING.+\n', b'', s) + _, _, s = s.partition(b'\n') + if s.startswith(b'Failed'): + _, _, s = s.partition(b'\n') elif isinstance(s, str): if s.startswith('WARNING'): - try: - s = s.split('\n', maxsplit=1)[1] - except IndexError: - pass + _, _, s = s.partition('\n') + if s.startswith('Failed'): + _, _, s = s.partition('\n') return s