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 denylist to target on boot
choose "Select from DenyList" in WebUI once to enable this feature
This commit is contained in:
+27
-4
@@ -6,6 +6,23 @@ TSPA="/data/adb/modules/tsupport-advance"
|
|||||||
|
|
||||||
aapt() { "$MODPATH/common/aapt" "$@"; }
|
aapt() { "$MODPATH/common/aapt" "$@"; }
|
||||||
|
|
||||||
|
add_denylist_to_target() {
|
||||||
|
exclamation_target=$(grep '!' "/data/adb/tricky_store/target.txt" | sed 's/!$//')
|
||||||
|
question_target=$(grep '?' "/data/adb/tricky_store/target.txt" | sed 's/?$//')
|
||||||
|
target=$(sed 's/[!?]$//' /data/adb/tricky_store/target.txt)
|
||||||
|
denylist=$(magisk --denylist ls 2>/dev/null | awk -F'|' '{print $1}' | grep -v "isolated")
|
||||||
|
|
||||||
|
printf "%s\n" "$target" "$denylist" | sort -u > "/data/adb/tricky_store/target.txt"
|
||||||
|
|
||||||
|
for target in $exclamation_target; do
|
||||||
|
sed -i "s/^$target$/$target!/" "/data/adb/tricky_store/target.txt"
|
||||||
|
done
|
||||||
|
|
||||||
|
for target in $question_target; do
|
||||||
|
sed -i "s/^$target$/$target?/" "/data/adb/tricky_store/target.txt"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
# Reset verified Boot Hash
|
# Reset verified Boot Hash
|
||||||
hash_value=$(grep -v '^#' "/data/adb/boot_hash" | tr -d '[:space:]')
|
hash_value=$(grep -v '^#' "/data/adb/boot_hash" | tr -d '[:space:]')
|
||||||
if [ -n "$hash_value" ]; then
|
if [ -n "$hash_value" ]; then
|
||||||
@@ -15,7 +32,6 @@ fi
|
|||||||
# Reset vendor patch if different with security patch
|
# Reset vendor patch if different with security patch
|
||||||
security_patch=$(getprop ro.build.version.security_patch)
|
security_patch=$(getprop ro.build.version.security_patch)
|
||||||
vendor_patch=$(getprop ro.vendor.build.security_patch)
|
vendor_patch=$(getprop ro.vendor.build.security_patch)
|
||||||
|
|
||||||
if [ "$vendor_patch" != "$security_patch" ]; then
|
if [ "$vendor_patch" != "$security_patch" ]; then
|
||||||
resetprop ro.vendor.build.security_patch "$security_patch"
|
resetprop ro.vendor.build.security_patch "$security_patch"
|
||||||
fi
|
fi
|
||||||
@@ -27,16 +43,23 @@ elif [ ! -d "$TSPA" ] && [ -f "/storage/emulated/0/stop-tspa-auto-target" ]; the
|
|||||||
rm -f "/storage/emulated/0/stop-tspa-auto-target"
|
rm -f "/storage/emulated/0/stop-tspa-auto-target"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Hide module
|
# Magisk operation
|
||||||
if [ -f "$MODPATH/action.sh" ]; then
|
if [ -f "$MODPATH/action.sh" ]; then
|
||||||
|
# Hide module from Magisk manager
|
||||||
if [ "$MODPATH" != "$HIDE_DIR" ]; then
|
if [ "$MODPATH" != "$HIDE_DIR" ]; then
|
||||||
rm -rf "$HIDE_DIR"
|
rm -rf "$HIDE_DIR"
|
||||||
mv "$MODPATH" "$HIDE_DIR"
|
mv "$MODPATH" "$HIDE_DIR"
|
||||||
fi
|
fi
|
||||||
MODPATH="$HIDE_DIR"
|
MODPATH="$HIDE_DIR"
|
||||||
elif [ -d "$HIDE_DIR" ]; then
|
|
||||||
rm -rf "$HIDE_DIR"
|
# Add target from denylist
|
||||||
|
# To trigger this, choose "Select from DenyList" in WebUI once
|
||||||
|
[ -f "/data/adb/tricky_store/target_from_denylist" ] && add_denylist_to_target
|
||||||
|
else
|
||||||
|
[ -d "$HIDE_DIR" ] && rm -rf "$HIDE_DIR"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Hide module from APatch, KernelSU, KSUWebUIStandalone, MMRL
|
||||||
rm -f "$MODPATH/module.prop"
|
rm -f "$MODPATH/module.prop"
|
||||||
|
|
||||||
# Symlink tricky store
|
# Symlink tricky store
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ fi
|
|||||||
# Remove residue and restore aosp keybox.
|
# Remove residue and restore aosp keybox.
|
||||||
rm -rf "/data/adb/modules/.TA_utl"
|
rm -rf "/data/adb/modules/.TA_utl"
|
||||||
rm -f "/data/adb/boot_hash"
|
rm -f "/data/adb/boot_hash"
|
||||||
|
rm -f "/data/adb/tricky_store/target_from_denylist"
|
||||||
if [ -d "$TS" ]; then
|
if [ -d "$TS" ]; then
|
||||||
[ -L "$TS/webroot" ] && rm -f "$TS/webroot"
|
[ -L "$TS/webroot" ] && rm -f "$TS/webroot"
|
||||||
[ -L "$TS/action.sh" ] && rm -f "$TS/action.sh"
|
[ -L "$TS/action.sh" ] && rm -f "$TS/action.sh"
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ document.getElementById("save").addEventListener("click", async () => {
|
|||||||
return app;
|
return app;
|
||||||
});
|
});
|
||||||
const updatedTargetContent = modifiedAppsList.join("\n");
|
const updatedTargetContent = modifiedAppsList.join("\n");
|
||||||
await execCommand(`echo "${updatedTargetContent}" > /data/adb/tricky_store/target.txt`);
|
await execCommand(`echo "${updatedTargetContent}" | sort -u > /data/adb/tricky_store/target.txt`);
|
||||||
console.log("target.txt updated successfully.");
|
console.log("target.txt updated successfully.");
|
||||||
showPrompt("prompt.saved_target");
|
showPrompt("prompt.saved_target");
|
||||||
for (const app of appsWithExclamation) {
|
for (const app of appsWithExclamation) {
|
||||||
|
|||||||
@@ -18,10 +18,9 @@ document.getElementById("deselect-all").addEventListener("click", () => toggleCh
|
|||||||
// Function to read the denylist and check corresponding apps
|
// Function to read the denylist and check corresponding apps
|
||||||
document.getElementById("select-denylist").addEventListener("click", async () => {
|
document.getElementById("select-denylist").addEventListener("click", async () => {
|
||||||
try {
|
try {
|
||||||
const result = await execCommand(`magisk --denylist ls 2>/dev/null | awk -F'|' '{print $1}' | grep -v "isolated" | sort | uniq`);
|
const result = await execCommand(`magisk --denylist ls 2>/dev/null | awk -F'|' '{print $1}' | grep -v "isolated" | sort -u`);
|
||||||
const denylistApps = result.split("\n").map(app => app.trim()).filter(Boolean);
|
const denylistApps = result.split("\n").map(app => app.trim()).filter(Boolean);
|
||||||
const apps = document.querySelectorAll(".card");
|
const apps = document.querySelectorAll(".card");
|
||||||
toggleCheckboxes(false);
|
|
||||||
apps.forEach(app => {
|
apps.forEach(app => {
|
||||||
const contentElement = app.querySelector(".content");
|
const contentElement = app.querySelector(".content");
|
||||||
const packageName = contentElement.getAttribute("data-package");
|
const packageName = contentElement.getAttribute("data-package");
|
||||||
@@ -30,6 +29,7 @@ document.getElementById("select-denylist").addEventListener("click", async () =>
|
|||||||
checkbox.checked = true;
|
checkbox.checked = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
await execCommand('touch "/data/adb/tricky_store/target_from_denylist"');
|
||||||
console.log("Denylist apps selected successfully.");
|
console.log("Denylist apps selected successfully.");
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
toast("Failed to read DenyList!");
|
toast("Failed to read DenyList!");
|
||||||
|
|||||||
Reference in New Issue
Block a user