| 123456789101112131415161718192021222324252627282930 |
- # install tools
- install_tools () {
- echo "Installing tools, you MAY grant the operation by click the button..."
- sleep 2
- set -e
- (
- set -x
- adb install -r apk/Termux_v0.118.0_apkpure.com.apk
- adb install -r apk/ru.meefik.busybox_46.apk
- )
- }
- copy_scripts () {
- echo $1
- sed "s/AGENCY_ID/${1}/g" exec.sh.in > exec.sh
- adb push exec.sh /sdcard/wechat/exec.sh
- adb push crontab /sdcard/
- adb push start.sh /sdcard/start.sh
- adb shell 'su - mv -f /sdcard/start.sh /data/data/com.termux/files/home/start.sh'
- adb shell 'su - chmod 555 /data/data/com.termux/files/home/start.sh'
- echo "Final step: install Busybox MANUALLY and execute /sdcard/start.sh in terminal at every time startup"
- }
- HAS_DEVICE=`adb devices|wc -l|xargs`
- if [ "$HAS_DEVICE" = "3" ]; then
- echo "Good, a device has been detected"
- # install_tools
- read -p 'AGENCY_ID: ' AGENCY_ID
- copy_scripts $AGENCY_ID
- else
- echo "`adb devices` did not show exactly one device, check and try again"
- fi
|