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
fix: deselect unnecessary app
This commit is contained in:
@@ -40,9 +40,7 @@ document.getElementById("select-denylist").addEventListener("click", async () =>
|
|||||||
// Function to read the exclude list and uncheck corresponding apps
|
// Function to read the exclude list and uncheck corresponding apps
|
||||||
document.getElementById("deselect-unnecessary").addEventListener("click", async () => {
|
document.getElementById("deselect-unnecessary").addEventListener("click", async () => {
|
||||||
try {
|
try {
|
||||||
const fileCheck = await execCommand(`[ -f ${basePath}common/tmp/exclude-list ] || echo "false"`);
|
const excludeList = await fetch("https://raw.githubusercontent.com/KOWX712/Tricky-Addon-Update-Target-List/main/more-exclude.json")
|
||||||
if (fileCheck.trim() === "false") {
|
|
||||||
fetch("https://raw.githubusercontent.com/KOWX712/Tricky-Addon-Update-Target-List/main/more-exclude.json")
|
|
||||||
.then(response => {
|
.then(response => {
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
throw new Error(`HTTP error! status: ${response.status}`);
|
throw new Error(`HTTP error! status: ${response.status}`);
|
||||||
@@ -50,27 +48,17 @@ document.getElementById("deselect-unnecessary").addEventListener("click", async
|
|||||||
return response.json();
|
return response.json();
|
||||||
})
|
})
|
||||||
.then(data => {
|
.then(data => {
|
||||||
const excludeList = data.data
|
return data.data
|
||||||
.flatMap(category => category.apps)
|
.flatMap(category => category.apps)
|
||||||
.map(app => app['package-name'])
|
.map(app => app['package-name'])
|
||||||
.join('\n');
|
.join('\n');
|
||||||
return excludeList;
|
|
||||||
})
|
|
||||||
.then(async excludeList => {
|
|
||||||
await execCommand(`
|
|
||||||
echo "${excludeList}" > ${basePath}common/tmp/exclude-list
|
|
||||||
sh ${basePath}common/get_extra.sh --xposed
|
|
||||||
`);
|
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
toast("Failed to download unnecessary apps!");
|
toast("Failed to download unnecessary apps!");
|
||||||
|
throw error;
|
||||||
});
|
});
|
||||||
} else {
|
const xposed = await execCommand(`sh ${basePath}common/get_extra.sh --xposed`);
|
||||||
await execCommand(`sh ${basePath}common/get_extra.sh --xposed`);
|
const UnnecessaryApps = excludeList.split("\n").map(app => app.trim()).filter(Boolean).concat(xposed.split("\n").map(app => app.trim()).filter(Boolean));
|
||||||
}
|
|
||||||
await new Promise(resolve => setTimeout(resolve, 100));
|
|
||||||
const result = await execCommand(`cat ${basePath}common/tmp/exclude-list`);
|
|
||||||
const UnnecessaryApps = result.split("\n").map(app => app.trim()).filter(Boolean);
|
|
||||||
const apps = document.querySelectorAll(".card");
|
const apps = document.querySelectorAll(".card");
|
||||||
apps.forEach(app => {
|
apps.forEach(app => {
|
||||||
const contentElement = app.querySelector(".content");
|
const contentElement = app.querySelector(".content");
|
||||||
|
|||||||
Reference in New Issue
Block a user