@@ -9,10 +9,12 @@ if checkonline; then
99 # Tải về nhật ký
1010 echo -e " Download the log and the latest version..."
1111 timeout 20 taive ' https://raw.githubusercontent.com/Zenlua/Tool-Tree/refs/heads/main/Version.md' $TEMP /Version.md
12- text_num_1=" $( grep -nm1 Version: $TEMP /Version.md | tail -1 | cut -d: -f1) "
13- text_num_2=" $( grep -nm5 Version: $TEMP /Version.md | tail -1 | cut -d: -f1) "
14- sed -n " $text_num_1 ,$(( text_num_2 - 1 )) p" $TEMP /Version.md | sed -e " s|\*\*||g" -e " s|+|•|g" | trans -b " $LANGUAGE -$COUNTRY " > $TEMP /version.txt
15-
12+ inputtextver=" $( cat $TEMP /Version.md | sed -e ' s|\*\*||g' -e ' s|+|•|g' ) "
13+ echo " $inputtextver " | awk ' BEGIN{RS="\\*\\*Version:"} NR==2 {printf "**Version:%s", $0}' | trans -b " $LANGUAGE -$COUNTRY " > $TEMP /ver1.txt
14+ echo " $inputtextver " | awk ' BEGIN{RS="\\*\\*Version:"} NR==3 {printf "**Version:%s", $0}' | trans -b " $LANGUAGE -$COUNTRY " > $TEMP /ver2.txt
15+ echo " $inputtextver " | awk ' BEGIN{RS="\\*\\*Version:"} NR==4 {printf "**Version:%s", $0}' | trans -b " $LANGUAGE -$COUNTRY " > $TEMP /ver3.txt
16+ echo " $inputtextver " | awk ' BEGIN{RS="\\*\\*Version:"} NR==5 {printf "**Version:%s", $0}' | trans -b " $LANGUAGE -$COUNTRY " > $TEMP /ver4.txt
17+
1618 # Thông báo cập nhật
1719 websums=" $( xem https://api.github.com/repos/Zenlua/Tool-Tree/releases/latest) "
1820 websum=" $( echo " $websums " | jq -r .assets[0].digest | cut -d: -f2) "
@@ -22,20 +24,16 @@ if checkonline; then
2224 elif [[ ${PACKAGE_VERSION_NAME// ./ } == $tagname ]]; then
2325 if [[ " $websum " != " $( checksum " $PATH_APK " ) " ]] && [[ -n $websum ]]; then
2426 if [ ! -f $TEMP /update ] && [ -n " $tagname " ]; then
25- notiservice --am --id 12345 --message " $update_text_6 "
27+ showtoast --am " $update_text_6 "
2628 echo " $tagname " > $TEMP /update
27- sleep 10
28- notiservice --am --id 12345 -d true
2929 fi
3030 else
3131 [ -f $TEMP /update ] && rm -f $TEMP /update
3232 fi
3333 else
3434 if [ ! -f $TEMP /update ] && [ -n " $tagname " ]; then
35- notiservice --am --id 12345 --message " $update_text_6 "
35+ showtoast --am " $update_text_6 "
3636 echo " $tagname " > $TEMP /update
37- sleep 10
38- notiservice --am --id 12345 -d true
3937 fi
4038 fi
4139fi
0 commit comments