forked from 2moe/tmoe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
termux
executable file
·32 lines (32 loc) · 1.41 KB
/
termux
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env bash
#######################################
aria2_download_termux() {
cd /sdcard/Download
if [ -f "com.termux_Fdroid.apk" ]; then
if (whiptail --title "检测到文件已下载,请选择您需要执行的操作!" --yes-button 'install(* ̄▽ ̄*)o' --no-button 'Upgrade(っ °Д °)' --yesno "Detected that the file has been downloaded, do you want to install it, or download it again?" 7 60); then
install_termux_apk
else
download_termux_apk_again
fi
else
download_termux_apk_again
fi
return 0
}
#######################################
download_termux_apk_again() {
printf "%s\n" "${YELLOW}按回车键开始下载${RESET}"
do_you_want_to_continue
printf '%s\n' 'Downloading termux apk...'
printf '%s\n' '正在为您下载至/sdcard/Download目录...'
printf '%s\n' '下载完成后,需要您手动安装。'
aria2c --console-log-level=warn --no-conf -x 16 -k 1M --split=16 --allow-overwrite=true -o "com.termux_Fdroid.apk" 'https://apk.tmoe.me/termux' || aria2c --console-log-level=warn --no-conf -x 16 -k 1M --split=16 --allow-overwrite=true -o "com.termux_Fdroid.apk" 'https://apk.tmoe.me/termux'
install_termux_apk
}
install_termux_apk() {
printf "%s\n" "${YELLOW}下载完成,请进入下载目录手动安装。${RESET}"
am start -n com.android.documentsui/com.android.documentsui.ViewDownloadsActivity
cd ${CURRENT_DIR}
}
##################################
aria2_download_termux $@