一、主要功能
自动刷支付宝视频
遇到直播间直接跳过
弹出验证界面,可以自动验证
二、代码实现
# __init__.py 为初始化加载文件
# 导入系统资源模块
from ascript.android.system import R
# 导入动作模块
from ascript.android import action
# 导入节点检索模块
from ascript.android import node
# 导入图色检索模块
from ascript.android import screen
from ascript.android import system
from ascript.android.screen.color_tools import time
from ascript.android.ui import time
from ascript.android.node import Selector
from ascript.android.ui import Dialog
print("启动软件")
system.open("com.eg.android.AlipayGphone")
time.sleep(3)
#点击视频跳转到视频页
action.click(540,2248)
i=1
while(1):
print(f'现在是第{i}个视频')
if i==1:
time.sleep(5)
time.sleep(5)
action.slide(540,1690,540,200,1000)
#判断是否弹出右滑验证,出现就右滑
#发现直播间直接跳过
node2=Selector(2).text("点击进入直播间").type("TextView").packageName("com.eg.android.AlipayGphone").path("/FrameLayout/LinearLayout/FrameLayout/RelativeLayout/LinearLayout/TabHost/FrameLayout/RelativeLayout/ViewPager/FrameLayout/FrameLayout/FrameLayout/RecyclerView/LinearLayout/RelativeLayout/RelativeLayout/RelativeLayout/RelativeLayout/FrameLayout/RelativeLayout/FrameLayout/TextView").find()
if node2:
print('发现直播间,准备跳过')
action.slide(540,1690,540,200,1000)
node=Selector(3).id("com.alipay.android.phone.thirdparty:id/title").text("为保障您的正常访问请进行验证").type("TextView").packageName("com.eg.android.AlipayGphone").path("/FrameLayout/FrameLayout/FrameLayout/LinearLayout/TextView").find()
if node:
print('出现了验证界面,开始右滑')
action.slide(227,1327,1000,1327,1000)
time.sleep(2)
time.sleep(5)
# #出现直播间,取消进入直播间
# node1=Selector(2).text("取消进入").type("TextView").packageName("com.eg.android.AlipayGphone").path("/FrameLayout/LinearLayout/FrameLayout/RelativeLayout/LinearLayout/TabHost/FrameLayout/RelativeLayout/ViewPager/FrameLayout/FrameLayout/FrameLayout/RecyclerView/LinearLayout/RelativeLayout/RelativeLayout/RelativeLayout/RelativeLayout/FrameLayout/RelativeLayout/TextView").find()
# if node1:
# print('取消进入直播间')
# Selector(2).text("取消进入").type("TextView").packageName("com.eg.android.AlipayGphone").path("/FrameLayout/LinearLayout/FrameLayout/RelativeLayout/LinearLayout/TabHost/FrameLayout/RelativeLayout/ViewPager/FrameLayout/FrameLayout/FrameLayout/RecyclerView/LinearLayout/RelativeLayout/RelativeLayout/RelativeLayout/RelativeLayout/FrameLayout/RelativeLayout/TextView").click().find()
i+=1
Dialog.toast(f'现在在刷第{i}个视频')