feat: completely remove start remote frida-server feature

This commit is contained in:
WorldObservationLog
2024-05-04 20:13:13 +08:00
parent 22eeed00a0
commit 4c1dcd9a72
4 changed files with 3 additions and 20 deletions

View File

@@ -6,7 +6,6 @@ languageForGenre = "en_US"
host = "127.0.0.1" host = "127.0.0.1"
port = 58526 port = 58526
agentPort = 10020 agentPort = 10020
fridaPath = "/system/bin/frida-server"
suMethod = "su -c" suMethod = "su -c"
[download] [download]

View File

@@ -9,7 +9,7 @@ from loguru import logger
from ppadb.client import Client as AdbClient from ppadb.client import Client as AdbClient
from ppadb.device import Device as AdbDevice from ppadb.device import Device as AdbDevice
from src.exceptions import FridaNotExistException, ADBConnectException, FailedGetAuthParamException, \ from src.exceptions import ADBConnectException, FailedGetAuthParamException, \
FridaNotRunningException FridaNotRunningException
from src.types import AuthParams from src.types import AuthParams
@@ -18,7 +18,6 @@ class Device:
host: str host: str
client: AdbClient client: AdbClient
device: AdbDevice device: AdbDevice
fridaPath: str
fridaPort: int fridaPort: int
fridaDevice: frida.core.Device = None fridaDevice: frida.core.Device = None
fridaSession: frida.core.Session = None fridaSession: frida.core.Session = None
@@ -27,10 +26,8 @@ class Device:
suMethod: str suMethod: str
decryptLock: asyncio.Lock decryptLock: asyncio.Lock
def __init__(self, host="127.0.0.1", port=5037, def __init__(self, host="127.0.0.1", port=5037, su_method: str = "su -c"):
frida_path="/data/local/tmp/frida-server-16.2.1-android-x86_64", su_method: str = "su -c"):
self.client = AdbClient(host, port) self.client = AdbClient(host, port)
self.fridaPath = frida_path
self.suMethod = su_method self.suMethod = su_method
self.host = host self.host = host
self.decryptLock = asyncio.Lock() self.decryptLock = asyncio.Lock()
@@ -68,18 +65,6 @@ class Device:
return False return False
return True return True
def _start_remote_frida(self):
logger.debug("starting remote frida")
output = self._execute_command(f"(ls {self.fridaPath} && echo True) || echo False")
if not output or "True" not in output:
raise FridaNotExistException
permission = self._execute_command(f"ls -l {self.fridaPath}")
if not permission or "x" not in permission[:10]:
self._execute_command(f"chmod +x {self.fridaPath}", True)
self._execute_command(f"{self.fridaPath} &", su=True)
if not self._if_frida_running():
logger.error("Failed to start remote frida")
def _start_forward(self, local_port: int, remote_port: int): def _start_forward(self, local_port: int, remote_port: int):
self.device.forward(f"tcp:{local_port}", f"tcp:{remote_port}") self.device.forward(f"tcp:{local_port}", f"tcp:{remote_port}")

View File

@@ -43,7 +43,7 @@ class NewInteractiveShell:
logger.add(lambda msg: print_formatted_text(ANSI(msg), end=""), colorize=True, level="INFO") logger.add(lambda msg: print_formatted_text(ANSI(msg), end=""), colorize=True, level="INFO")
for device_info in self.config.devices: for device_info in self.config.devices:
device = Device(frida_path=device_info.fridaPath, su_method=device_info.suMethod) device = Device(su_method=device_info.suMethod)
device.connect(device_info.host, device_info.port) device.connect(device_info.host, device_info.port)
logger.info(f"Device {device_info.host}:{device_info.port} has connected") logger.info(f"Device {device_info.host}:{device_info.port} has connected")
self.devices.append(device) self.devices.append(device)

View File

@@ -12,7 +12,6 @@ class Device(BaseModel):
host: str host: str
port: int port: int
agentPort: int agentPort: int
fridaPath: str
suMethod: str suMethod: str