fix: handle copy-pasted serial 5555,16384 to be fool-proof

This commit is contained in:
2026-07-06 22:40:58 +08:00
parent d7277fb22d
commit 9135b74484
+6
View File
@@ -57,6 +57,12 @@ class ConnectionAttr:
serial = serial.replace('。', '.').replace(',', '.').replace(',', '.').replace(':', ':')
# 127.0.0.1.5555
serial = serial.replace('127.0.0.1.', '127.0.0.1:')
# Mumu12 5.0 shows double serials, some people may just copy-paste it
# 5555,16384
if ',' in serial:
left, _, right = serial.partition(',')
if left.startswith('55') and right.startswith('16'):
serial = right
# 16384
try:
port = int(serial)