This commit is contained in:
KOWX712
2024-10-31 23:27:00 +08:00
parent 842b2691a7
commit 2948476589
3 changed files with 9 additions and 9 deletions

View File

@@ -1,7 +1,7 @@
#!/bin/sh
# by KOW
# Tricky Addon Lite: Update Target List Script v1.4.1 (v1.3.1)
# Tricky Addon Lite: Update Target List Script v1.5
# GitHub Repository: https://github.com/KOWX712/Tricky-Addon-Update-Target-List/blob/master/lite-script_only/README.md
# Telegram channel: https://t.me/kowchannel
@@ -26,7 +26,6 @@ echo " "
echo " Staring script..."
echo " "
# Create or overwrite the target.txt file
> /data/adb/tricky_store/target.txt
echo " Adding apps to target.txt..."

View File

@@ -3,7 +3,13 @@ echo "**********************************************"
echo "- Staring script..."
echo " "
sh "$TS"/UpdateTargetList.sh
if [ ! -f "$TS/UpdateTargetList.sh" ]; then
echo "! Script missing, please install module again"
echo "**********************************************"
exit 1
else
. "$TS/UpdateTargetList.sh"
fi
echo "**********************************************"
echo "\(__All set!__)/"

View File

@@ -6,7 +6,6 @@
# Using module to put normal app into system app may exclude corresponding app from this script too, please disable it if you found this script doesn't work.
MODDIR="/data/adb/tricky_store/target_list_config"
# Config file check
echo "- Checking config files..."
echo " "
if [ ! -f "$MODDIR/EXCLUDE" ]; then
@@ -24,26 +23,22 @@ else
echo " "
fi
# Read exclution and addition config
EXCLUDE=$(grep -vE '^[[:space:]]*#|^[[:space:]]*$' "$MODDIR/EXCLUDE" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//' | tr '\n' '|' | sed 's/|$//')
ADDITION=$(grep -vE '^[[:space:]]*#|^[[:space:]]*$' "$MODDIR/ADDITION")
# Create or overwrite the target.txt file
echo "- Overwritting target.txt"
echo " "
> /data/adb/tricky_store/target.txt
# Add all non-system apps to the target file and remove exclusions
echo "- Adding apps into /data/adb/tricky_store/target.txt"
echo " "
su -c pm list packages -3 </dev/null 2>&1 | cat | awk -F: '{print $2}' | grep -Ev "$EXCLUDE" > /data/adb/tricky_store/target.txt
sleep 1
# Add additional apps to the target file if they are not already present
echo "- Adding addition app... "
echo " "
for app in $ADDITION; do
app=$(echo "$app" | tr -d '[:space:]') # Trim any whitespace
app=$(echo "$app" | tr -d '[:space:]')
if ! grep -Fxq "$app" /data/adb/tricky_store/target.txt; then
echo "$app" >> /data/adb/tricky_store/target.txt
fi