fix: allow Hermit on VMOS only

This commit is contained in:
2026-07-06 22:40:36 +08:00
parent 67bd1d9a1c
commit c9edcd0a40
2 changed files with 13 additions and 1 deletions
+9 -1
View File
@@ -7,6 +7,7 @@ from adbutils import AdbClient, AdbDevice
from module.base.decorator import cached_property
from module.config.config import AzurLaneConfig
from module.device.method.utils import get_serial_pair
from module.exception import RequestHumanTakeover
from module.logger import logger
@@ -128,8 +129,11 @@ class ConnectionAttr:
@cached_property
def port(self) -> int:
port_serial, _ = get_serial_pair(self.serial)
if port_serial is None:
port_serial = self.serial
try:
return int(self.serial.split(':')[1])
return int(port_serial.split(':')[1])
except (IndexError, ValueError):
return 0
@@ -148,6 +152,10 @@ class ConnectionAttr:
def is_nox_family(self):
return 62001 <= self.port <= 63025
@cached_property
def is_vmos(self):
return 5667 <= self.port <= 5699
@cached_property
def is_emulator(self):
return self.serial.startswith('emulator-') or self.serial.startswith('127.0.0.1:')