From 729e2bfa311f8724711868a9bd04a6b6f722bca9 Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Fri, 23 Aug 2024 02:22:14 +0800 Subject: [PATCH] Fix: [ALAS] Predict MuMu12 serial from instance id if it was missing in vbox file (cherry picked from commit b8c89285c10550ef09c52ea717a20a8ecc5994cc) --- module/device/platform/emulator_windows.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/module/device/platform/emulator_windows.py b/module/device/platform/emulator_windows.py index b04787c8e..4095ba9e7 100644 --- a/module/device/platform/emulator_windows.py +++ b/module/device/platform/emulator_windows.py @@ -307,12 +307,15 @@ class Emulator(EmulatorBase): path=self.path, ) # Fix for MuMu12 v4.0.4, default instance of which has no forward record in vbox config - elif name == 'MuMuPlayer-12.0-0': - yield EmulatorInstance( - serial='127.0.0.1:16384', + else: + instance = EmulatorInstance( + serial=serial, name=name, path=self.path, ) + if instance.MuMuPlayer12_id: + instance.serial = f'127.0.0.1:{16384 + 32 * instance.MuMuPlayer12_id}' + yield instance elif self == Emulator.MEmuPlayer: # ./MemuHyperv VMs/{name}/{name}.memu for folder in self.list_folder('./MemuHyperv VMs', is_dir=True):