diff --git a/extractor/cdm.py b/extractor/cdm.py index 54feb99..61dca10 100644 --- a/extractor/cdm.py +++ b/extractor/cdm.py @@ -64,7 +64,7 @@ class Cdm: """ # https://source.android.com/docs/core/architecture/configuration/add-system-properties?#shell-commands properties = {} - sp = subprocess.run(f'adb -s "{self.device.id}" shell getprop', capture_output=True) + sp = subprocess.run(['adb', '-s', self.device.id, 'shell', 'getprop'], capture_output=True) for line in sp.stdout.decode('utf-8').splitlines(): match = re.match(r'\[(.*?)\]: \[(.*?)\]', line) if match: @@ -137,7 +137,7 @@ class Cdm: # https://github.com/frida/frida/issues/1225#issuecomment-604181822 # Iterate through lines starting from the second line (skipping header) processes = {} - sp = subprocess.run(f'adb -s "{self.device.id}" shell ps', capture_output=True) + sp = subprocess.run(['adb', '-s', self.device.id, 'shell', 'ps'], capture_output=True) for line in sp.stdout.decode('utf-8').splitlines()[1:]: try: line = line.split() # USER,PID,PPID,VSZ,RSS,WCHAN,ADDR,S,NAME diff --git a/keydive.py b/keydive.py index 92f38a9..92591de 100644 --- a/keydive.py +++ b/keydive.py @@ -29,7 +29,7 @@ if __name__ == '__main__': logger.info('Version: %s', extractor.__version__) # Ensure the ADB server is running - sp = subprocess.run('adb start-server', capture_output=True) + sp = subprocess.run(['adb', 'start-server'], capture_output=True) if sp.returncode != 0: raise EnvironmentError('ADB is not recognized as an environment variable, see https://github.com/hyugogirubato/KeyDive/blob/main/docs/PACKAGE.md#adb-android-debug-bridge')