fix: installation fail

you can use apd to install module in kernelsu O_O
This commit is contained in:
KOWX712
2025-03-06 19:57:44 +08:00
parent c879dfa428
commit 4176bd9ce1
4 changed files with 13 additions and 14 deletions

View File

@@ -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

View File

@@ -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",

View File

@@ -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",

View File

@@ -160,12 +160,11 @@ function setupUpdateMenu() {
installButton.addEventListener('click', async () => {
try {
showPrompt("prompt.installing");
setTimeout(async () => {
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";
}, 300);
} 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 new Promise(resolve => setTimeout(resolve, 1000));
await execCommand("svc power reboot");
}, 1000);
} catch (error) {
showPrompt("prompt.reboot_fail", false);
console.error('Fail to reboot:', error);