Fix: [ALAS] Predict MuMu12 serial from instance id if it was missing in vbox file

(cherry picked from commit b8c89285c10550ef09c52ea717a20a8ecc5994cc)
This commit is contained in:
LmeSzinc 2024-08-23 02:22:14 +08:00
parent 2fb637febd
commit 729e2bfa31

View File

@ -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):