mirror of
https://github.com/mvt-project/mvt.git
synced 2026-05-22 16:19:47 +02:00
Add Android TCP connection support
This commit is contained in:
+1
-1
@@ -49,7 +49,7 @@ def cli():
|
||||
help="Specify a path to a folder where you want to store JSON results")
|
||||
@click.option("--from-file", "-f", type=click.Path(exists=True),
|
||||
help="Instead of acquiring from phone, load an existing packages.json file for lookups (mainly for debug purposes)")
|
||||
@click.option("--serial", "-s", type=str, help="Use the Android device with a given serial")
|
||||
@click.option("--serial", "-s", type=str, help="Use the Android device with a given serial number")
|
||||
def download_apks(all_apks, virustotal, koodous, all_checks, output, from_file, serial):
|
||||
try:
|
||||
if from_file:
|
||||
|
||||
@@ -8,7 +8,7 @@ import sys
|
||||
import time
|
||||
import logging
|
||||
import tempfile
|
||||
from adb_shell.adb_device import AdbDeviceUsb
|
||||
from adb_shell.adb_device import AdbDeviceUsb, AdbDeviceTcp
|
||||
from adb_shell.auth.keygen import keygen, write_public_keyfile
|
||||
from adb_shell.auth.sign_pythonrsa import PythonRSASigner
|
||||
from adb_shell.exceptions import DeviceAuthError, AdbCommandFailureException
|
||||
@@ -58,7 +58,15 @@ class AndroidExtraction(MVTModule):
|
||||
|
||||
signer = PythonRSASigner("", priv_key)
|
||||
|
||||
self.device = AdbDeviceUsb(serial=self.serial)
|
||||
if self.serial is None or ":" not in self.serial:
|
||||
self.device = AdbDeviceUsb(serial=self.serial)
|
||||
else:
|
||||
addr = self.serial.split(":")
|
||||
|
||||
if len(addr) < 2:
|
||||
raise ValueError("TCP serial number must follow the format: `address:port`")
|
||||
|
||||
self.device = AdbDeviceTcp(addr[0], int(addr[1]), default_transport_timeout_s=9.)
|
||||
|
||||
while True:
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user