mirror of
https://github.com/0O0o0oOoO00/Alas.git
synced 2026-05-22 21:09:29 +08:00
add: remote file existence check
This commit is contained in:
@@ -348,6 +348,13 @@ class CrackResource:
|
||||
logger.info(f"GameLibDir: {game_lib_dir}, do inject")
|
||||
self.device.adb_shell(f"cd {self.upload_dir} && ./patchelf --local-patch --game-lib-dir {game_lib_dir}")
|
||||
|
||||
def __is_remote_file_exist(self) -> bool:
|
||||
def is_exist(path):
|
||||
return self.device.adb_shell(f"if [ -d {path} ]; then echo 'exist'; else echo 'not exist'; fi") == "exist"
|
||||
|
||||
return is_exist(self.upload_dir) and is_exist(f"{self.upload_dir}/libcracker.so") and is_exist(f"{self.upload_dir}/patchelf")
|
||||
|
||||
|
||||
def ensure(self):
|
||||
if not deep_get(self.config.data, "Hook.HookGeneral.Enable", False):
|
||||
return
|
||||
@@ -355,6 +362,6 @@ class CrackResource:
|
||||
self.__ensure_crack_resource()
|
||||
if not self.first_init:
|
||||
self.__check_update()
|
||||
if self.has_new_version:
|
||||
if self.has_new_version or not self.__is_remote_file_exist():
|
||||
self.__push_resource()
|
||||
self.__do_inject()
|
||||
|
||||
Reference in New Issue
Block a user