fix: remove render errors on waydroid

This commit is contained in:
2026-07-06 22:40:53 +08:00
parent 5fbd775b9a
commit 9922e25d38
+14 -11
View File
@@ -331,27 +331,30 @@ def remove_shell_warning(s):
""" """
Remove warnings from shell 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: Args:
s (str, bytes): s (str, bytes):
Returns: Returns:
str, bytes: 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 isinstance(s, bytes):
if s.startswith(b'WARNING'): if s.startswith(b'WARNING'):
try: _, _, s = s.partition(b'\n')
s = s.split(b'\n', maxsplit=1)[1] if s.startswith(b'Failed'):
except IndexError: _, _, s = s.partition(b'\n')
pass
return s
# return re.sub(b'^WARNING.+\n', b'', s)
elif isinstance(s, str): elif isinstance(s, str):
if s.startswith('WARNING'): if s.startswith('WARNING'):
try: _, _, s = s.partition('\n')
s = s.split('\n', maxsplit=1)[1] if s.startswith('Failed'):
except IndexError: _, _, s = s.partition('\n')
pass
return s return s