From f5191c03a1aa1f55a8c46d855294d000d697e1e5 Mon Sep 17 00:00:00 2001 From: 0O0o0oOoO00 <11174151+0O0o0oOoO00@users.noreply.github.com> Date: Thu, 22 May 2025 17:40:05 +0800 Subject: [PATCH] add: push luahook resource everytime --- config/template.json | 1 + module/config/argument/args.json | 4 ++++ module/config/argument/argument.yaml | 1 + module/config/config_generated.py | 1 + module/config/i18n/en-US.json | 4 ++++ module/config/i18n/ja-JP.json | 4 ++++ module/config/i18n/zh-CN.json | 4 ++++ module/config/i18n/zh-TW.json | 4 ++++ module/luahook/crack.py | 2 ++ 9 files changed, 25 insertions(+) diff --git a/config/template.json b/config/template.json index 293e27dec..4a564ea5b 100644 --- a/config/template.json +++ b/config/template.json @@ -236,6 +236,7 @@ "HookGeneral": { "Enable": false, "RestartEverytime": true, + "PushEveryTime": true, "Architecture": "auto", "InjectMethod": "local_patch", "RequestTimeLimit": 10, diff --git a/module/config/argument/args.json b/module/config/argument/args.json index 170d7af8f..054bb71c5 100644 --- a/module/config/argument/args.json +++ b/module/config/argument/args.json @@ -933,6 +933,10 @@ "type": "checkbox", "value": true }, + "PushEveryTime": { + "type": "checkbox", + "value": true + }, "Architecture": { "type": "select", "value": "auto", diff --git a/module/config/argument/argument.yaml b/module/config/argument/argument.yaml index c0066f100..ca6b82b15 100644 --- a/module/config/argument/argument.yaml +++ b/module/config/argument/argument.yaml @@ -153,6 +153,7 @@ OldRetire: HookGeneral: Enable: false RestartEverytime: true + PushEveryTime: true Architecture: value: auto option: [ auto, x86, x86_64, arm64-v8a, armeabi-v7a ] diff --git a/module/config/config_generated.py b/module/config/config_generated.py index ee8c86c9b..f405490ac 100644 --- a/module/config/config_generated.py +++ b/module/config/config_generated.py @@ -81,6 +81,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 diff --git a/module/config/i18n/en-US.json b/module/config/i18n/en-US.json index a72f24b1f..4d182fbe5 100644 --- a/module/config/i18n/en-US.json +++ b/module/config/i18n/en-US.json @@ -775,6 +775,10 @@ "name": "HookGeneral.RestartEverytime.name", "help": "HookGeneral.RestartEverytime.help" }, + "PushEveryTime": { + "name": "HookGeneral.PushEveryTime.name", + "help": "HookGeneral.PushEveryTime.help" + }, "Architecture": { "name": "HookGeneral.Architecture.name", "help": "HookGeneral.Architecture.help", diff --git a/module/config/i18n/ja-JP.json b/module/config/i18n/ja-JP.json index 0e7d22377..cdbc5fc4f 100644 --- a/module/config/i18n/ja-JP.json +++ b/module/config/i18n/ja-JP.json @@ -775,6 +775,10 @@ "name": "HookGeneral.RestartEverytime.name", "help": "HookGeneral.RestartEverytime.help" }, + "PushEveryTime": { + "name": "HookGeneral.PushEveryTime.name", + "help": "HookGeneral.PushEveryTime.help" + }, "Architecture": { "name": "HookGeneral.Architecture.name", "help": "HookGeneral.Architecture.help", diff --git a/module/config/i18n/zh-CN.json b/module/config/i18n/zh-CN.json index 9f75c336b..eeee4c391 100644 --- a/module/config/i18n/zh-CN.json +++ b/module/config/i18n/zh-CN.json @@ -775,6 +775,10 @@ "name": "每次启动Alas时重启", "help": "推荐打开" }, + "PushEveryTime": { + "name": "每次重新推送资源", + "help": "视情况开关,建议开启" + }, "Architecture": { "name": "架构", "help": "选择使用的架构,如果自动检测失败,请手动选择\n游戏库目录中看到的架构和选项的对应关系一般如下:\nx86 -> x86\nx86_64 -> x86_64\narm -> armeabi-v7a\narm64 -> arm64-v8a", diff --git a/module/config/i18n/zh-TW.json b/module/config/i18n/zh-TW.json index 7a6616e9b..6b5d3bd44 100644 --- a/module/config/i18n/zh-TW.json +++ b/module/config/i18n/zh-TW.json @@ -775,6 +775,10 @@ "name": "HookGeneral.RestartEverytime.name", "help": "HookGeneral.RestartEverytime.help" }, + "PushEveryTime": { + "name": "HookGeneral.PushEveryTime.name", + "help": "HookGeneral.PushEveryTime.help" + }, "Architecture": { "name": "HookGeneral.Architecture.name", "help": "HookGeneral.Architecture.help", diff --git a/module/luahook/crack.py b/module/luahook/crack.py index d080b3a48..94de10b63 100644 --- a/module/luahook/crack.py +++ b/module/luahook/crack.py @@ -452,4 +452,6 @@ class CrackResource: self.__check_update() if self.has_new_version or not self.__is_remote_file_exist(): self.__push_resource() + if deep_get(self.config.data, "Hook.HookGeneral.PushEveryTime", True): + self.__push_resource() self.__do_inject()