1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-19 23:33:33 +08:00

Fix: Accessibility service handing in different languages

This commit is contained in:
LmeSzinc
2022-01-30 22:52:07 +08:00
parent d646d6b79a
commit 7c4dfd8948

View File

@@ -148,18 +148,16 @@ class Hermit(Adb):
else: else:
return False return False
if appear('//*[@text="Accessibility"]') and appear_then_click('//*[@text="Hermit"]'): if appear_then_click('//*[@text="Hermit" and @resource-id="android:id/title"]'):
continue continue
if appear('//*[@text="Hermit"]') \ if appear_then_click('//*[@class="android.widget.Switch" and @checked="false"]'):
and appear_then_click('//*[@class="android.widget.Switch" and @checked="false"]'):
continue continue
if appear_then_click('//*[@text="OK"]'): if appear_then_click('//*[@resource-id="android:id/button1"]'):
# Just plain click here # Just plain click here
# Can't use uiautomator once hermit has access to accessibility service, # Can't use uiautomator once hermit has access to accessibility service,
# or uiautomator will get the access. # or uiautomator will get the access.
break break
if appear('//*[@text="Hermit"]') \ if appear('//*[@class="android.widget.Switch" and @checked="true"]'):
and appear_then_click('//*[@class="android.widget.Switch" and @checked="true"]'):
raise HermitError('Accessibility service already enable but get error') raise HermitError('Accessibility service already enable but get error')
# End # End