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
remove curl binary
use busybox wget binary instead of curl binary to fetch exclude-list
This commit is contained in:
@@ -2,17 +2,43 @@
|
||||
|
||||
MODPATH=${0%/*}
|
||||
OUTPUT="$MODPATH/exclude-list"
|
||||
BBPATH="/data/adb/modules/busybox-ndk/system/*/busybox \
|
||||
/data/adb/magisk/busybox \
|
||||
/data/adb/ksu/bin/busybox \
|
||||
/data/adb/ap/bin/busybox"
|
||||
|
||||
find_busybox() {
|
||||
for path in $BBPATH; do
|
||||
if [ -f "$path" ]; then
|
||||
BUSYBOX="$path"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
if ! curl -s "https://modules.lsposed.org/modules.json" > /dev/null; then
|
||||
exit 1
|
||||
# Check for wget binary
|
||||
if ! command -v wget >/dev/null || grep -q "wget-curl" "$(command -v wget)"; then
|
||||
if find_busybox; then
|
||||
wget() { "$BUSYBOX" wget "$@"; }
|
||||
else
|
||||
echo "Error: busybox not found in specified paths." > "$OUTPUT"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Fetch Xposed module package names
|
||||
curl -s "https://modules.lsposed.org/modules.json" | \
|
||||
wget --no-check-certificate -q -O - "https://modules.lsposed.org/modules.json" 2>/dev/null | \
|
||||
grep -o '"name":"[^"]*","description":' | \
|
||||
awk -F'"' '{print $4}' > "$OUTPUT"
|
||||
|
||||
# Fetch additional package names
|
||||
curl -s "https://raw.githubusercontent.com/KOWX712/Tricky-Addon-Update-Target-List/master/more-excldue.json" | \
|
||||
wget --no-check-certificate -q -O - "https://raw.githubusercontent.com/KOWX712/Tricky-Addon-Update-Target-List/master/more-excldue.json" 2>/dev/null | \
|
||||
grep -o '"package-name": *"[^"]*"' | \
|
||||
awk -F'"' '{print $4}' >> "$OUTPUT"
|
||||
|
||||
# Check if the output directory is empty
|
||||
if [ ! -s "$OUTPUT" ]; then
|
||||
echo "Error: Failed to fetch data." > "$OUTPUT"
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user