From 5170041d851fc7d4916fed213dfc083932eb5e99 Mon Sep 17 00:00:00 2001 From: hyugogirubato <65763543+hyugogirubato@users.noreply.github.com> Date: Sat, 21 Jun 2025 16:23:15 +0200 Subject: [PATCH] support frida different version --- keydive/core.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/keydive/core.py b/keydive/core.py index b4024bd..3796a43 100644 --- a/keydive/core.py +++ b/keydive/core.py @@ -4,7 +4,7 @@ import time from typing import Optional, Tuple, Literal from pathlib import Path -from frida import ServerNotRunningError +from frida import ServerNotRunningError, ProtocolError from frida.core import Session, Script from pathvalidate import sanitize_filepath @@ -413,6 +413,9 @@ class Core(Remote): except ServerNotRunningError as e: # Handle the case where the Frida server is not running on the device raise EnvironmentError('Frida server is not running on the device.') from e + except ProtocolError as e: + # Handle the case where the Frida python version is different from the server version + raise EnvironmentError('Frida python version is different from the server version.') from e except Exception as e: # Catch and log all other errors that occur during session attachment self.logger.error('Could not attach to process %s: %s', pid, e)