diff --git a/module/common/get_extra.sh b/module/common/get_extra.sh index 70ebdf9..509a489 100644 --- a/module/common/get_extra.sh +++ b/module/common/get_extra.sh @@ -1,5 +1,5 @@ -#!/system/bin/sh - +#!/bin/sh +PATH=/data/adb/ap/bin:/data/adb/ksu/bin:/data/adb/magisk:/data/data/com.termux/files/usr/bin:$PATH MODPATH=${0%/*} SKIPLIST="$MODPATH/tmp/skiplist" OUTPUT="$MODPATH/tmp/exclude-list" @@ -7,6 +7,17 @@ KBOUTPUT="$MODPATH/tmp/.extra" aapt() { "$MODPATH/aapt" "$@"; } +# probe for downloaders +# wget = low pref, no ssl. +# curl, has ssl on android, we use it if found +download() { + if command -v curl > /dev/null 2>&1; then + curl --connect-timeout 3 -s "$1" + else + busybox wget -T 3 --no-check-certificate -qO - "$1" + fi +} + get_kb() { check_wget wget --no-check-certificate -qO "$KBOUTPUT" "https://raw.githubusercontent.com/KOWX712/Tricky-Addon-Update-Target-List/main/.extra" @@ -51,4 +62,4 @@ case "$1" in --unnecessary) get_unnecessary; exit ;; --xposed) get_xposed; exit ;; --update) check_update; exit ;; -esac \ No newline at end of file +esac