feat: completely remove start remote frida-server feature

pull/1/head
WorldObservationLog 6 months ago
parent 22eeed00a0
commit 4c1dcd9a72
  1. 1
      config.toml
  2. 19
      src/adb.py
  3. 2
      src/cmd.py
  4. 1
      src/config.py

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

@ -9,7 +9,7 @@ from loguru import logger
from ppadb.client import Client as AdbClient
from ppadb.device import Device as AdbDevice
from src.exceptions import FridaNotExistException, ADBConnectException, FailedGetAuthParamException, \
from src.exceptions import ADBConnectException, FailedGetAuthParamException, \
FridaNotRunningException
from src.types import AuthParams
@ -18,7 +18,6 @@ class Device:
host: str
client: AdbClient
device: AdbDevice
fridaPath: str
fridaPort: int
fridaDevice: frida.core.Device = None
fridaSession: frida.core.Session = None
@ -27,10 +26,8 @@ class Device:
suMethod: str
decryptLock: asyncio.Lock
def __init__(self, host="127.0.0.1", port=5037,
frida_path="/data/local/tmp/frida-server-16.2.1-android-x86_64", su_method: str = "su -c"):
def __init__(self, host="127.0.0.1", port=5037, su_method: str = "su -c"):
self.client = AdbClient(host, port)
self.fridaPath = frida_path
self.suMethod = su_method
self.host = host
self.decryptLock = asyncio.Lock()
@ -68,18 +65,6 @@ class Device:
return False
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):
self.device.forward(f"tcp:{local_port}", f"tcp:{remote_port}")

@ -43,7 +43,7 @@ class NewInteractiveShell:
logger.add(lambda msg: print_formatted_text(ANSI(msg), end=""), colorize=True, level="INFO")
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)
logger.info(f"Device {device_info.host}:{device_info.port} has connected")
self.devices.append(device)

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

Loading…
Cancel
Save