mirror of
https://github.com/TheFunny/ArisuAutoSweeper
synced 2026-10-10 09:12:05 +00:00
refactor: add app_current()
This commit is contained in:
@@ -16,7 +16,7 @@ class AppControl(Adb, WSA, Uiautomator2):
|
||||
_app_u2_family = []
|
||||
_hierarchy_interval = Timer(0.1)
|
||||
|
||||
def app_is_running(self) -> bool:
|
||||
def app_current(self) -> str:
|
||||
method = self.config.Emulator_ControlMethod
|
||||
if self.is_wsa:
|
||||
package = self.app_current_wsa()
|
||||
@@ -24,8 +24,11 @@ class AppControl(Adb, WSA, Uiautomator2):
|
||||
package = self.app_current_uiautomator2()
|
||||
else:
|
||||
package = self.app_current_adb()
|
||||
|
||||
package = package.strip(' \t\r\n')
|
||||
return package
|
||||
|
||||
def app_is_running(self) -> bool:
|
||||
package = self.app_current()
|
||||
logger.attr('Package_name', package)
|
||||
return package == self.package
|
||||
|
||||
|
||||
Reference in New Issue
Block a user