ソースを参照

Split start and stop to two commands

wudi 4 年 前
コミット
5a723b3c52
3 ファイル変更6 行追加7 行削除
  1. 2 1
      crontab/root
  2. 2 4
      exec.sh.in
  3. 2 2
      install.sh

+ 2 - 1
crontab/root

@@ -1 +1,2 @@
-0 3-6 * * * /data/data/com.termux/files/usr/bin/bash /sdcard/wechat/exec.sh > /sdcard/wechat/exec.log 2>&1
+0 * * * * /data/data/com.termux/files/usr/bin/bash /sdcard/wechat/exec.sh > /sdcard/wechat/exec.log 2>&1
+50 * * * * /system/bin/am force-stop com.tencent.mm

+ 2 - 4
exec.sh.in

@@ -1,6 +1,4 @@
 #!/data/data/com.termux/files/usr/bin/bash
 echo "Start activity..."
-su - am start -n com.tencent.mm/.plugin.webview.ui.tools.WebViewUI --es "rawUrl" "https://mp.weixin.qq.com/mp/getverifyinfo?__biz=MzAxNTA4OTQ3MA==&mobile_id=AGENCY_ID&type=reg_info#wechat_redirect"
-sleep 35
-echo "Stop activities..."
-am force-stop com.tencent.mm
+am start -n com.tencent.mm/.plugin.webview.ui.tools.WebViewUI --es "rawUrl" "https://mp.weixin.qq.com/mp/getverifyinfo?__biz=MzAxNTA4OTQ3MA==&mobile_id=AGENCY_ID&type=reg_info#wechat_redirect"
+echo "Done"

+ 2 - 2
install.sh

@@ -17,12 +17,12 @@ copy_scripts () {
     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"
+    echo "Final step: install Busybox MANUALLY and execute ./start.sh in Termux 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
+    install_tools
     read -p 'AGENCY_ID: ' AGENCY_ID
     copy_scripts $AGENCY_ID
 else