From 4230929dc9021a62c50e7647d9f7e4ed51b23c7a Mon Sep 17 00:00:00 2001 From: backslashxx <118538522+backslashxx@users.noreply.github.com> Date: Sun, 15 Dec 2024 13:04:45 +0800 Subject: [PATCH] module: common/get_extra: import download function from bindhosts --- module/common/get_extra.sh | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) 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