From cbd1ba9f3cde1b0cb4bf75afbd73fcf59a43440a Mon Sep 17 00:00:00 2001 From: hyugogirubato <65763543+hyugogirubato@users.noreply.github.com> Date: Tue, 23 Jul 2024 22:16:54 +0200 Subject: [PATCH] fix old android process enumeration --- keydive/core.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/keydive/core.py b/keydive/core.py index 9e5594b..be92f45 100644 --- a/keydive/core.py +++ b/keydive/core.py @@ -69,7 +69,8 @@ class Core: return content - def __prepare_symbols(self, path: Path) -> list: + @staticmethod + def __prepare_symbols(path: Path) -> list: """ Parses the provided XML functions file to select relevant functions. @@ -151,9 +152,9 @@ class Core: # https://github.com/frida/frida/issues/1225#issuecomment-604181822 prompt = ['adb', '-s', str(self.device.id), 'shell', 'ps'] - lines = subprocess.run([*prompt, '-A'], capture_output=True).stdout.decode('utf-8').strip().splitlines() - if len(lines) <= 1: - lines = subprocess.run(prompt, capture_output=True).stdout.decode('utf-8').strip().splitlines() + lines = subprocess.run([*prompt, '-A'], capture_output=True).stdout.decode('utf-8').splitlines() + if len(lines) < 10: + lines = subprocess.run(prompt, capture_output=True).stdout.decode('utf-8').splitlines() # Iterate through lines starting from the second line (skipping header) for line in lines[1:]: try: