echo -e "\033[42m"感谢使用本flashtool脚本，首次安装需要一点时间，请稍后"\033[0m" sed -i 's@^\(deb.*stable main\)$@#\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/apt/termux-main stable main@' $PREFIX/etc/apt/sources.list ##更换清华源 echo -e "\033[42m"正在更新软件源"\033[0m" apt update -y yes | apt upgrade -y sed -i 's@^\(deb.*stable main\)$@#\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/apt/termux-main stable main@' $PREFIX/etc/apt/sources.list ##更换清华源 echo -e "\033[42m"正在安装必要软件"\033[0m" apt install wget android-tools proot termux-api libusb clang git python p7zip -y echo -e "\033[42m"正在安装主要程序"\033[0m" wget https://gitee.com/tytysky/flashtool/raw/master/library/flashtoold -O /data/user/0/com.termux/files/usr/bin/flashtoold chmod 777 /data/user/0/com.termux/files/usr/bin/flashtoold ##给予日志程序权限 if getprop ro.product.cpu.abi | grep -iq "v7a"; then wget https://gitee.com/tytysky/flashtool/raw/master/library/flashtool_arm -O /data/user/0/com.termux/files/usr/bin/flashtool chmod 777 /data/user/0/com.termux/files/usr/bin/flashtool ##给予主程序权限 wget https://gitee.com/tytysky/flashtool/raw/master/library/payload-dumper-go_arm -O /data/user/0/com.termux/files/usr/bin/payload-dumper-go ##安装解包 chmod 777 /data/user/0/com.termux/files/usr/bin/payload-dumper-go wget https://gitee.com/tytysky/flashtool/raw/master/library/termux-adb_arm -O /data/user/0/com.termux/files/usr/bin/termux-adb ##安装adb chmod 777 /data/user/0/com.termux/files/usr/bin/termux-adb wget https://gitee.com/tytysky/flashtool/raw/master/library/magiskboot_arm -O /data/user/0/com.termux/files/usr/bin/magiskboot ##安装magiskboot chmod 777 /data/user/0/com.termux/files/usr/bin/magiskboot wget https://gitee.com/tytysky/flashtool/raw/master/library/ksud_arm -O /data/user/0/com.termux/files/usr/bin/ksud ##安装ksud chmod 777 /data/user/0/com.termux/files/usr/bin/ksud else wget https://gitee.com/tytysky/flashtool/raw/master/library/flashtool -O /data/user/0/com.termux/files/usr/bin/flashtool chmod 777 /data/user/0/com.termux/files/usr/bin/flashtool ##给予主程序权限 wget https://gitee.com/tytysky/flashtool/raw/master/library/payload-dumper-go -O /data/user/0/com.termux/files/usr/bin/payload-dumper-go ##安装解包 chmod 777 /data/user/0/com.termux/files/usr/bin/payload-dumper-go wget https://gitee.com/tytysky/flashtool/raw/master/library/termux-adb -O /data/user/0/com.termux/files/usr/bin/termux-adb ##安装adb chmod 777 /data/user/0/com.termux/files/usr/bin/termux-adb wget https://gitee.com/tytysky/flashtool/raw/master/library/magiskboot -O /data/user/0/com.termux/files/usr/bin/magiskboot ##安装magiskboot chmod 777 /data/user/0/com.termux/files/usr/bin/magiskboot wget https://gitee.com/tytysky/flashtool/raw/master/library/ksud -O /data/user/0/com.termux/files/usr/bin/ksud ##安装ksud chmod 777 /data/user/0/com.termux/files/usr/bin/ksud fi wget https://gitee.com/tytysky/flashtool/raw/master/library/my_preload.img -O /data/user/0/com.termux/files/usr/etc/my_preload.img chmod 777 /data/user/0/com.termux/files/usr/etc/my_preload.img wget https://gitee.com/tytysky/flashtool/raw/master/library/my_company.img -O /data/user/0/com.termux/files/usr/etc/my_company.img chmod 777 /data/user/0/com.termux/files/usr/etc/my_company.img wget https://gitee.com/tytysky/flashtool/raw/master/library/misc_wipedata_oppo.img -O /data/user/0/com.termux/files/usr/etc/misc_wipedata_oppo.img chmod 777 /data/user/0/com.termux/files/usr/etc/misc_wipedata_oppo.img echo "开始安装payload_dumper" pip install git+https://gitee.com/tytysky/payload-dumper echo -e "\033[42m"安装成功输入"\"flashtool\""来启动"\033[0m"