From eb5e07c9ffb23962a6c4cef08a752f8de8873c38 Mon Sep 17 00:00:00 2001 From: YoursFunny Date: Mon, 6 Jul 2026 19:40:12 +0800 Subject: [PATCH] fix: ensure BlueStacks Air serial auto increase from 127.0.0.1:5555 + 10*n --- module/device/connection.py | 3 ++- module/device/connection_attr.py | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/module/device/connection.py b/module/device/connection.py index 867de9d..2107266 100644 --- a/module/device/connection.py +++ b/module/device/connection.py @@ -322,7 +322,8 @@ class Connection(ConnectionAttr): # BlueStacks Air is the Mac version of BlueStacks if not IS_MACINTOSH: return False - if not self.is_ldplayer_bluestacks_family: + # 127.0.0.1:5555 + 10*n, assume 32 instances at max + if not (5555 <= self.port <= 5875): return False # [bst.installed_images]: [Tiramisu64] # [bst.instance]: [Tiramisu64] diff --git a/module/device/connection_attr.py b/module/device/connection_attr.py index 69dc371..35efe2d 100644 --- a/module/device/connection_attr.py +++ b/module/device/connection_attr.py @@ -145,7 +145,7 @@ class ConnectionAttr: @cached_property def is_mumu12_family(self): - # 127.0.0.1:16XXX + # 127.0.0.1:16384 + 32*n, assume 32 instances at max return 16384 <= self.port <= 17408 @cached_property @@ -157,7 +157,8 @@ class ConnectionAttr: @cached_property def is_ldplayer_bluestacks_family(self): # Note that LDPlayer and BlueStacks have the same serial range - return self.serial.startswith('emulator-') or 5555 <= self.port <= 5587 + # 127.0.0.1:5555 + 2*n, assume 32 instances at max + return self.serial.startswith('emulator-') or 5555 <= self.port <= 5619 @cached_property def is_nox_family(self):