From 3e03ec59b694890d94bfebce242f4dfe935e0a54 Mon Sep 17 00:00:00 2001 From: Build Bot Date: Tue, 22 Sep 2026 19:21:14 +0800 Subject: [PATCH] fix: truncate long matched strings in findrefs output String matches against regex constants (e.g. searching 'frida' hits the 'blackfriday' TLD inside androidx WEB_URL patterns) printed multi-KB regex literals verbatim, flooding the console. Truncate matched string names at 200 chars with an ellipsis. --- droidasc/asc_client/asc_handler.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/droidasc/asc_client/asc_handler.py b/droidasc/asc_client/asc_handler.py index 63435ce..43edc41 100644 --- a/droidasc/asc_client/asc_handler.py +++ b/droidasc/asc_client/asc_handler.py @@ -74,9 +74,14 @@ def _format_method(self, dex, midx : int) -> str: method = dex.methods[midx] return f"{method.cls.fullname}->{method.name}" + _MATCHED_NAME_MAX_LEN = 200 + def _format_matched_name(self, dex, find_type : str, idx : int) -> str: if find_type == "string": - return str(dex.strings[idx]) + s = str(dex.strings[idx]) + if len(s) > self._MATCHED_NAME_MAX_LEN: + return s[: self._MATCHED_NAME_MAX_LEN] + "..." + return s if find_type == "type": return dex.types[idx].descriptor if find_type == "method":