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
optimize
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# by KOW
|
# 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
|
# GitHub Repository: https://github.com/KOWX712/Tricky-Addon-Update-Target-List/blob/master/lite-script_only/README.md
|
||||||
# Telegram channel: https://t.me/kowchannel
|
# Telegram channel: https://t.me/kowchannel
|
||||||
|
|
||||||
@@ -26,7 +26,6 @@ echo " "
|
|||||||
echo " Staring script..."
|
echo " Staring script..."
|
||||||
echo " "
|
echo " "
|
||||||
|
|
||||||
# Create or overwrite the target.txt file
|
|
||||||
> /data/adb/tricky_store/target.txt
|
> /data/adb/tricky_store/target.txt
|
||||||
|
|
||||||
echo " Adding apps to target.txt..."
|
echo " Adding apps to target.txt..."
|
||||||
|
|||||||
@@ -3,7 +3,13 @@ echo "**********************************************"
|
|||||||
echo "- Staring script..."
|
echo "- Staring script..."
|
||||||
echo " "
|
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 "**********************************************"
|
||||||
echo "\(__All set!__)/"
|
echo "\(__All set!__)/"
|
||||||
|
|||||||
@@ -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.
|
# 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"
|
MODDIR="/data/adb/tricky_store/target_list_config"
|
||||||
|
|
||||||
# Config file check
|
|
||||||
echo "- Checking config files..."
|
echo "- Checking config files..."
|
||||||
echo " "
|
echo " "
|
||||||
if [ ! -f "$MODDIR/EXCLUDE" ]; then
|
if [ ! -f "$MODDIR/EXCLUDE" ]; then
|
||||||
@@ -24,26 +23,22 @@ else
|
|||||||
echo " "
|
echo " "
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Read exclution and addition config
|
|
||||||
EXCLUDE=$(grep -vE '^[[:space:]]*#|^[[:space:]]*$' "$MODDIR/EXCLUDE" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//' | tr '\n' '|' | sed 's/|$//')
|
EXCLUDE=$(grep -vE '^[[:space:]]*#|^[[:space:]]*$' "$MODDIR/EXCLUDE" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//' | tr '\n' '|' | sed 's/|$//')
|
||||||
ADDITION=$(grep -vE '^[[:space:]]*#|^[[:space:]]*$' "$MODDIR/ADDITION")
|
ADDITION=$(grep -vE '^[[:space:]]*#|^[[:space:]]*$' "$MODDIR/ADDITION")
|
||||||
|
|
||||||
# Create or overwrite the target.txt file
|
|
||||||
echo "- Overwritting target.txt"
|
echo "- Overwritting target.txt"
|
||||||
echo " "
|
echo " "
|
||||||
> /data/adb/tricky_store/target.txt
|
> /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 "- Adding apps into /data/adb/tricky_store/target.txt"
|
||||||
echo " "
|
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
|
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
|
sleep 1
|
||||||
|
|
||||||
# Add additional apps to the target file if they are not already present
|
|
||||||
echo "- Adding addition app... "
|
echo "- Adding addition app... "
|
||||||
echo " "
|
echo " "
|
||||||
for app in $ADDITION; do
|
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
|
if ! grep -Fxq "$app" /data/adb/tricky_store/target.txt; then
|
||||||
echo "$app" >> /data/adb/tricky_store/target.txt
|
echo "$app" >> /data/adb/tricky_store/target.txt
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user