Fix: Spaces around package name cause inequality

This commit is contained in:
LmeSzinc 2022-02-07 23:38:14 +08:00
parent f891689bee
commit 5348c6f58f
2 changed files with 9 additions and 3 deletions

View File

@ -126,9 +126,13 @@ class AzurLaneAutoScript:
def goto_main(self):
from module.handler.login import LoginHandler
from module.ui.ui import UI
if not self.device.app_is_running():
if self.device.app_is_running():
logger.info('App is already running, goto main page')
UI(self.config, device=self.device).ui_goto_main()
else:
logger.info('App is not running, start app and goto main page')
LoginHandler(self.config, device=self.device).app_start()
UI(self.config, device=self.device).ui_goto_main()
UI(self.config, device=self.device).ui_goto_main()
def research(self):
from module.research.research import RewardResearch

View File

@ -16,8 +16,10 @@ class AppControl(Adb, Uiautomator2):
else:
package = self.app_current_adb()
package = package.strip(' \t\r\n')
logger.attr('Package_name', package)
return package == self.config.Emulator_PackageName
target = self.config.Emulator_PackageName.strip(' \t\r\n')
return package == target
def app_start(self):
package = self.config.Emulator_PackageName