diff --git a/module/common/get_extra.sh b/module/common/get_extra.sh index 72267b6..6d628f2 100644 --- a/module/common/get_extra.sh +++ b/module/common/get_extra.sh @@ -68,12 +68,13 @@ get_update() { } install_update() { + PATH=/data/adb/ap/bin:/data/adb/ksu/bin:/data/adb/magisk:$PATH if command -v magisk >/dev/null 2>&1; then - magisk --install-module "$MODPATH/tmp/module.zip" + magisk --install-module "$MODPATH/tmp/module.zip" || exit 1 elif command -v apd >/dev/null 2>&1; then - apd module install "$MODPATH/tmp/module.zip" + apd module install "$MODPATH/tmp/module.zip" || exit 1 elif command -v ksud >/dev/null 2>&1; then - ksud module install "$MODPATH/tmp/module.zip" + ksud module install "$MODPATH/tmp/module.zip" || exit 1 else exit 1 fi diff --git a/module/webui/locales/A-template.json b/module/webui/locales/A-template.json index f0074a9..2091a0d 100644 --- a/module/webui/locales/A-template.json +++ b/module/webui/locales/A-template.json @@ -89,7 +89,7 @@ "download_fail": "Fail to download update", "installing": "Installing update...", "installed": "Installed successfully, reboot now.", - "install_fail": "Fail to install, please update manual", + "install_fail": "Fail to install, please update manually", "rebooting": "Rebooting...", "reboot_fail": "Fail to reboot, please reboot manually", "custom_key_set": "Custom keybox set successfully", diff --git a/module/webui/locales/en-US.json b/module/webui/locales/en-US.json index f0074a9..2091a0d 100644 --- a/module/webui/locales/en-US.json +++ b/module/webui/locales/en-US.json @@ -89,7 +89,7 @@ "download_fail": "Fail to download update", "installing": "Installing update...", "installed": "Installed successfully, reboot now.", - "install_fail": "Fail to install, please update manual", + "install_fail": "Fail to install, please update manually", "rebooting": "Rebooting...", "reboot_fail": "Fail to reboot, please reboot manually", "custom_key_set": "Custom keybox set successfully", diff --git a/module/webui/scripts/update.js b/module/webui/scripts/update.js index 549481e..ca74dff 100644 --- a/module/webui/scripts/update.js +++ b/module/webui/scripts/update.js @@ -160,12 +160,11 @@ function setupUpdateMenu() { installButton.addEventListener('click', async () => { try { showPrompt("prompt.installing"); - setTimeout(async () => { - await execCommand(`sh ${basePath}common/get_extra.sh --install-update`); - showPrompt("prompt.installed"); - installButton.style.display = "none"; - rebootButton.style.display = "flex"; - }, 300); + await new Promise(resolve => setTimeout(resolve, 300)); + await execCommand(`sh ${basePath}common/get_extra.sh --install-update`); + showPrompt("prompt.installed"); + installButton.style.display = "none"; + rebootButton.style.display = "flex"; } catch (error) { showPrompt("prompt.install_fail", false); console.error('Fail to execute installation script:', error); @@ -176,9 +175,8 @@ function setupUpdateMenu() { rebootButton.addEventListener('click', async () => { try { showPrompt("prompt.rebooting"); - setTimeout(async () => { - await execCommand("svc power reboot"); - }, 1000); + await new Promise(resolve => setTimeout(resolve, 1000)); + await execCommand("svc power reboot"); } catch (error) { showPrompt("prompt.reboot_fail", false); console.error('Fail to reboot:', error);