feat: support MuMuPlayer12 5.0

This commit is contained in:
2026-07-06 22:40:54 +08:00
parent 6774c2070b
commit 3dc24d56e1
4 changed files with 57 additions and 24 deletions
+24 -14
View File
@@ -219,7 +219,30 @@ class NemuIpcImpl:
self.instance_id: int = instance_id
self.display_id: int = display_id
ipc_dll = os.path.abspath(os.path.join(nemu_folder, './shell/sdk/external_renderer_ipc.dll'))
# try to load dll from various path
list_dll = [
# MuMuPlayer12
os.path.abspath(os.path.join(nemu_folder, './shell/sdk/external_renderer_ipc.dll')),
# MuMuPlayer12 5.0
os.path.abspath(os.path.join(nemu_folder, './nx_device/12.0/shell/sdk/external_renderer_ipc.dll')),
]
ipc_dll = ''
for ipc_dll in list_dll:
if not os.path.exists(ipc_dll):
continue
try:
self.lib = ctypes.CDLL(ipc_dll)
break
except OSError as e:
logger.error(e)
logger.error(f'ipc_dll={ipc_dll} exists, but cannot be loaded')
continue
if not ipc_dll:
# not found
raise NemuIpcIncompatible(
f'NemuIpc requires MuMu12 version >= 3.8.13, please check your version. '
f'None of the following path exists: {list_dll}')
# success
logger.info(
f'NemuIpcImpl init, '
f'nemu_folder={nemu_folder}, '
@@ -227,19 +250,6 @@ class NemuIpcImpl:
f'instance_id={instance_id}, '
f'display_id={display_id}'
)
try:
self.lib = ctypes.CDLL(ipc_dll)
except OSError as e:
logger.error(e)
# OSError: [WinError 126] 找不到指定的模块。
if not os.path.exists(ipc_dll):
raise NemuIpcIncompatible(
f'ipc_dll={ipc_dll} does not exist, '
f'NemuIpc requires MuMu12 version >= 3.8.13, please check your version')
else:
raise NemuIpcIncompatible(
f'ipc_dll={ipc_dll} exists, but cannot be loaded')
self.connect_id: int = 0
self.width = 0
self.height = 0