1
0
mirror of https://github.com/0O0o0oOoO00/Alas.git synced 2026-05-14 10:59:24 +08:00

fix: unexpected restarts caused by do_inject

This commit is contained in:
ZuoSiZhu
2025-06-08 02:48:37 +08:00
parent 573582a452
commit 733b20a6db
9 changed files with 18 additions and 22 deletions

View File

@@ -235,7 +235,7 @@
"Hook": {
"HookGeneral": {
"Enable": false,
"RestartEverytime": true,
"PushEveryTime": true,
"Architecture": "auto",
"InjectMethod": "local_patch",
"RequestTimeLimit": 10,

View File

@@ -931,7 +931,7 @@
"type": "checkbox",
"value": false
},
"RestartEverytime": {
"PushEveryTime": {
"type": "checkbox",
"value": true
},

View File

@@ -152,7 +152,7 @@ OldRetire:
HookGeneral:
Enable: false
RestartEverytime: true
PushEveryTime: true
Architecture:
value: auto
option: [ auto, x86, x86_64, arm64-v8a, armeabi-v7a ]

View File

@@ -80,7 +80,7 @@ class GeneratedConfig:
# Group `HookGeneral`
HookGeneral_Enable = False
HookGeneral_RestartEverytime = True
HookGeneral_PushEveryTime = True
HookGeneral_Architecture = 'auto' # auto, x86, x86_64, arm64-v8a, armeabi-v7a
HookGeneral_InjectMethod = 'local_patch' # local_patch, global_patch, outer_inject
HookGeneral_RequestTimeLimit = 10

View File

@@ -773,9 +773,9 @@
"name": "HookGeneral.Enable.name",
"help": "HookGeneral.Enable.help"
},
"RestartEverytime": {
"name": "HookGeneral.RestartEverytime.name",
"help": "HookGeneral.RestartEverytime.help"
"PushEveryTime": {
"name": "HookGeneral.PushEveryTime.name",
"help": "HookGeneral.PushEveryTime.help"
},
"Architecture": {
"name": "HookGeneral.Architecture.name",

View File

@@ -773,9 +773,9 @@
"name": "HookGeneral.Enable.name",
"help": "HookGeneral.Enable.help"
},
"RestartEverytime": {
"name": "HookGeneral.RestartEverytime.name",
"help": "HookGeneral.RestartEverytime.help"
"PushEveryTime": {
"name": "HookGeneral.PushEveryTime.name",
"help": "HookGeneral.PushEveryTime.help"
},
"Architecture": {
"name": "HookGeneral.Architecture.name",

View File

@@ -773,9 +773,9 @@
"name": "总开关",
"help": ""
},
"RestartEverytime": {
"name": "每次启动Alas时重启",
"help": "推荐打开"
"PushEveryTime": {
"name": "每次重新推送资源",
"help": "视情况开关,一般更新时推送"
},
"Architecture": {
"name": "架构",

View File

@@ -773,9 +773,9 @@
"name": "HookGeneral.Enable.name",
"help": "HookGeneral.Enable.help"
},
"RestartEverytime": {
"name": "HookGeneral.RestartEverytime.name",
"help": "HookGeneral.RestartEverytime.help"
"PushEveryTime": {
"name": "HookGeneral.PushEveryTime.name",
"help": "HookGeneral.PushEveryTime.help"
},
"Architecture": {
"name": "HookGeneral.Architecture.name",

View File

@@ -464,16 +464,12 @@ class CrackResource:
if not self.__check_game_lib_dir():
raise CrackerError(f"GameLibDir '{self.game_lib_dir}' is invalid")
if deep_get(self.config.data, "Hook.HookGeneral.RestartEverytime", True):
self.device.app_stop()
self.config.task_call("Restart")
self.__adb_root()
self.__ensure_crack_resource()
if not self.first_init:
self.__check_update()
if self.has_new_version or not self.__is_remote_file_exist():
if self.has_new_version or not self.__is_remote_file_exist() or deep_get(self.config.data, "Hook.HookGeneral.PushEverytime", True):
self.__push_resource()
self.device.app_stop()
self.config.task_call("Restart")
self.__do_inject()
self.__do_inject()