mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-22 16:23:43 +08:00
Fix: Netcat loopback on BlueStacks Pie
This commit is contained in:
@@ -294,11 +294,21 @@ class Connection(ConnectionAttr):
|
|||||||
Returns:
|
Returns:
|
||||||
list[str]: ['nc'] or ['busybox', 'nc']
|
list[str]: ['nc'] or ['busybox', 'nc']
|
||||||
"""
|
"""
|
||||||
# Android 9 emulators does not have `nc`, try `busybox nc`
|
sdk = self.adb_shell(['getprop', 'ro.build.version.sdk'])
|
||||||
trial = [
|
sdk = int(sdk)
|
||||||
['nc'],
|
logger.info(f'sdk_ver: {sdk}')
|
||||||
['busybox', 'nc'],
|
if sdk >= 28:
|
||||||
]
|
# Android 9 emulators does not have `nc`, try `busybox nc`
|
||||||
|
# BlueStacks Pie (Android 9) has `nc` but cannot send data, try `busybox nc` first
|
||||||
|
trial = [
|
||||||
|
['busybox', 'nc'],
|
||||||
|
['nc'],
|
||||||
|
]
|
||||||
|
else:
|
||||||
|
trial = [
|
||||||
|
['nc'],
|
||||||
|
['busybox', 'nc'],
|
||||||
|
]
|
||||||
for command in trial:
|
for command in trial:
|
||||||
# About 3ms
|
# About 3ms
|
||||||
result = self.adb_shell(command)
|
result = self.adb_shell(command)
|
||||||
|
|||||||
Reference in New Issue
Block a user