You've already forked Tricky-Addon-Update-Target-List
mirror of
https://github.com/KOWX712/Tricky-Addon-Update-Target-List.git
synced 2025-09-06 06:37:09 +00:00
Add update method for invisible module
optimize uninstall process
This commit is contained in:
@@ -277,16 +277,26 @@ function deselectAllApps() {
|
|||||||
|
|
||||||
// Function to run the extra script
|
// Function to run the extra script
|
||||||
async function runExtraScript() {
|
async function runExtraScript() {
|
||||||
try {
|
try {
|
||||||
const scriptPath = `${basePath}get_extra.sh`;
|
const scriptPath = `${basePath}get_extra.sh`;
|
||||||
await execCommand(scriptPath);
|
const output = await execCommand(scriptPath);
|
||||||
console.log("Extra script executed successfully.");
|
console.log("Extra script executed successfully.");
|
||||||
noConnection.style.display = "none";
|
noConnection.style.display = "none";
|
||||||
} catch (error) {
|
if (output.includes("update")) {
|
||||||
console.error("Failed to execute Extra script:", error);
|
console.log("Update detected from extra script.");
|
||||||
showPrompt("no_internet", false);
|
showPrompt("new_update");
|
||||||
noConnection.style.display = "flex";
|
await execCommand(`
|
||||||
|
su -c "mkdir -p '/data/adb/modules/TA_utl' &&
|
||||||
|
cp -rf '${basePath}temp/'* '/data/adb/modules/TA_utl/'"
|
||||||
|
`);
|
||||||
|
} else {
|
||||||
|
console.log("No update detected from extra script.");
|
||||||
}
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Failed to execute Extra script:", error);
|
||||||
|
showPrompt("no_internet", false);
|
||||||
|
noConnection.style.display = "flex";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Function to read the exclude list and uncheck corresponding apps
|
// Function to read the exclude list and uncheck corresponding apps
|
||||||
@@ -728,12 +738,20 @@ helpOverlay.addEventListener("click", (event) => {
|
|||||||
document.querySelector(".uninstall-container").addEventListener("click", async () => {
|
document.querySelector(".uninstall-container").addEventListener("click", async () => {
|
||||||
try {
|
try {
|
||||||
await execCommand(`
|
await execCommand(`
|
||||||
su -c "mkdir -p '/data/adb/modules/TA_utl' &&
|
su -c "
|
||||||
cp -rf '${basePath}temp/'* '/data/adb/modules/TA_utl/'"
|
if [ -d '${basePath}temp/' ]; then
|
||||||
|
mkdir -p '/data/adb/modules/TA_utl' &&
|
||||||
|
cp -rf '${basePath}temp/'* '/data/adb/modules/TA_utl/' &&
|
||||||
|
touch '/data/adb/modules/TA_utl/remove'
|
||||||
|
else
|
||||||
|
touch '/data/adb/modules/TA_utl/remove'
|
||||||
|
fi
|
||||||
|
"
|
||||||
`);
|
`);
|
||||||
showPrompt("uninstall_prompt");
|
showPrompt("uninstall_prompt");
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Failed to execute uninstall command:", error);
|
console.error("Failed to execute uninstall command:", error);
|
||||||
|
console.log("Error message:", error.message);
|
||||||
showPrompt("uninstall_failed", false);
|
showPrompt("uninstall_failed", false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user