From 5a6c08a8ac039f0fcd105b929a7657ea5b5c012f Mon Sep 17 00:00:00 2001 From: aixiao Date: Wed, 29 Dec 2021 18:36:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=92=B8=E9=B1=BC=E8=87=AA=E5=8A=A8=E5=8C=96?= =?UTF-8?q?=E6=9B=9D=E5=85=89=E3=80=81=E9=87=8D=E6=96=B0=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E3=80=81=E5=BE=AE=E6=8B=8D=E5=A0=82=E7=AD=BE=E5=88=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Douyin-MI_MIX2S.bat | 53 ++++++++++++++ fish.sh | 175 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 228 insertions(+) create mode 100644 Douyin-MI_MIX2S.bat create mode 100644 fish.sh diff --git a/Douyin-MI_MIX2S.bat b/Douyin-MI_MIX2S.bat new file mode 100644 index 0000000..6d11ece --- /dev/null +++ b/Douyin-MI_MIX2S.bat @@ -0,0 +1,53 @@ +@echo off + + +for /l %%i in (1,1,100) do ( + timeout /T 3 + + ::下一页 + C:\Users\aixiao\Desktop\Douyin-Bot\Tools\adb.exe shell input swipe 540 1365 540 965 200; + timeout /T 6 + + ::关注按钮 + C:\Users\aixiao\Desktop\Douyin-Bot\Tools\adb.exe shell input tap 380 150 + timeout /T 3 + + ::点头像 + C:\Users\aixiao\Desktop\Douyin-Bot\Tools\adb.exe shell input tap 79 143 + timeout /T 3 + + ::再次点头像 + C:\Users\aixiao\Desktop\Douyin-Bot\Tools\adb.exe shell input tap 140 1390 + timeout /T 3 + + ::私信 + C:\Users\aixiao\Desktop\Douyin-Bot\Tools\adb.exe shell input tap 1000 138 + C:\Users\aixiao\Desktop\Douyin-Bot\Tools\adb.exe shell input tap 426 1225 + timeout /T 3 + + ::下面输入框 + C:\Users\aixiao\Desktop\Douyin-Bot\Tools\adb.exe shell input tap 400 1913 + timeout /T 3 + ::发送文本 + C:\Users\aixiao\Desktop\Douyin-Bot\Tools\adb.exe shell am broadcast -a ADB_INPUT_TEXT --es msg "小姐姐,找你合作" + timeout /T 3 + ::回车 + C:\Users\aixiao\Desktop\Douyin-Bot\Tools\adb.exe shell input tap 1000 1942 + timeout /T 3 + + C:\Users\aixiao\Desktop\Douyin-Bot\Tools\adb.exe shell input tap 400 1913 + timeout /T 3 + C:\Users\aixiao\Desktop\Douyin-Bot\Tools\adb.exe shell am broadcast -a ADB_INPUT_TEXT --es msg "我是抖音工会经纪人,你有了解吗,我想邀请你加入我们" + timeout /T 3 + C:\Users\aixiao\Desktop\Douyin-Bot\Tools\adb.exe shell input tap 1000 1942 + timeout /T 3 + + ::返回按钮 + C:\Users\aixiao\Desktop\Douyin-Bot\Tools\adb.exe shell input keyevent 4 + C:\Users\aixiao\Desktop\Douyin-Bot\Tools\adb.exe shell input keyevent 4 + + + timeout /T 30 +) + + diff --git a/fish.sh b/fish.sh new file mode 100644 index 0000000..437e55e --- /dev/null +++ b/fish.sh @@ -0,0 +1,175 @@ +: + +initialization() { + GOODS_NUMBER=10 + SHELL_DIR=$(pwd) + + ADB="$(which adb)" + if [ "${ADB}" = "" ]; then + ADB=""; + else + ADB="$ADB shell" + fi + + #显示 true false + showing=$(${ADB} dumpsys window policy | grep 'showing=' | cut -d = -f 2) + #睡眠 true false + dreaming=$(${ADB} dumpsys window policy | grep 'dreaming=' | cut -d = -f 2) + #屏幕状态 SCREEN_STATE_OFF SCREEN_STATE_ON + screenState=$(${ADB} dumpsys window policy | grep 'screenState=' | cut -d = -f 2) + #交互状态 INTERACTIVE_STATE_SLEEP INTERACTIVE_STATE_AWAKE + interactiveState=$(${ADB} dumpsys window policy | grep 'interactiveState=' | cut -d = -f 2) + + mTrusted=$(${ADB} dumpsys window policy | grep 'mTrusted=' | cut -d = -f 2) +} + +sleep_() { + sleep 1 + sleep $1 +} + +Lock_screen() { + + if test "${showing}" = "true" -a "${dreaming}" = "true" -a "${screenState}" = "SCREEN_STATE_OFF" -a ${interactiveState} = "INTERACTIVE_STATE_SLEEP"; then + #点亮屏幕 + ${ADB} input keyevent 26 + ${ADB} input swipe 540 1810 540 1500 200; + + if test ${mTrusted} = "false"; then + ${ADB} input tap 242 1130 #1 + ${ADB} input tap 832 1593 #9 + ${ADB} input tap 520 1577 #8 + ${ADB} input tap 832 1593 #9 + ${ADB} input tap 242 1130 #1 + ${ADB} input tap 536 1790 #0 + ${ADB} input tap 536 1790 #0 + ${ADB} input tap 832 1593 #9 + ${ADB} input tap 824 1807 #enter + sleep_ 1 + fi + else + : + fi +} + +Weipaitang() { + #打开微拍堂 + ${ADB} am start -n com.weipaitang.wpt/com.weipaitang.wpt.wptnative.module.launch.MainActivity + sleep_ 5 + #我的 + ${ADB} input tap 950 1982 + sleep_ 3 + ${ADB} input tap 960 246 + sleep_ 3 + ${ADB} input tap 483 772 + sleep_ 2 + + ${ADB} input keyevent 4 +} + +Salted_fish() { + #打开APP + ${ADB} am start -n com.taobao.idlefish/com.taobao.fleamarket.home.activity.InitActivity + sleep_ 5 + + #我的 + ${ADB} input tap 964 1960 + sleep_ 1 + + #下拉 + ${ADB} input swipe 500 480 500 1100 200; + sleep_ 2 + + #我发布的 + ${ADB} input tap 134 1753 + sleep_ 1 + + #擦亮 + ${ADB} input tap 600 730 + sleep_ 1 + + #第一件商品, 重新发布 + ${ADB} input tap 959 1810 + sleep_ 1 + ${ADB} input tap 925 129 + sleep_ 1 + ${ADB} input keyevent 4 + + sleep_ 2 + while [ $GOODS_NUMBER -gt 0 ]; do + GOODS_NUMBER=$((GOODS_NUMBER-1)) + + ${ADB} input swipe 540 1810 540 1500 200; + sleep_ 1 + ${ADB} input tap 579 1530 + sleep_ 2 + ${ADB} input tap 935 1971 + sleep_ 2 + ${ADB} input tap 300 1088 + sleep_ 2 + ${ADB} input tap 925 129 + sleep_ 2 + ${ADB} input keyevent 4 + sleep_ 2 + ${ADB} input keyevent 4 + sleep_ 2 + + done + + ${ADB} input keyevent 4 +} + +function HELP_() { +#帮助 +echo -e "\033[31mXiaoMi MIX 2S Automated script\033[0m" + cat << EOF +Usage: + ${0} [XY] [WPT] + ${0} [-xnh] +options: + -x : Print Debug. + -n : loop Number. + -h : Print Help. + +by AIXIAO@AIXIAO.ME +EOF + + echo -e "\033[31m仅适用于MI MIX 2s设备!\033[0m" + exit 0; +} + +initialization + +while getopts :xn:h? l; do + case ${l} in + x) + debug=x; + shift $((OPTIND-1)); + ;; + n) + GOODS_NUMBER=${OPTARG}; + shift $((OPTIND-1)); + ;; + h|?) + HELP_; + ;; + *) + HELP_; + ;; + esac +done +test "${debug}" = "x" && set -x; + +Lock_screen +case $@ in + "XY") + Salted_fish + ;; + "WPT") + Weipaitang + ;; + *) + HELP_ + ;; +esac +