创建仓库

This commit is contained in:
zw
2025-08-01 13:43:51 +08:00
commit 3c60d3c7d2
20 changed files with 760 additions and 0 deletions

46
script/ScriptManager.py Normal file
View File

@@ -0,0 +1,46 @@
import cv2
import lxml
import wda
from lxml import etree
from script.AiTools import AiTools
# 脚本管理类
class ScriptManager():
def __init__(self):
super().__init__()
# 养号
@classmethod
def growAccount(self, udid):
client = wda.USBClient(udid)
session = client.session()
session.appium_settings({"snapshotMaxDepth": 0})
deviceWidth = client.window_size().width
deviceHeight = client.window_size().height
img = client.screenshot()
tempPath = "resources/bgv.png"
img.save(tempPath)
bgvPath = AiTools.imagePath("bgv")
likePath = AiTools.imagePath("like")
x, y = AiTools.find_image_in_image(bgvPath, likePath)
print(x, y)
# client.tap(end[0] / 3 - 2, end[1] / 3 - 2)
# xml = session.source()
# print(xml)
# root = etree.fromstring(xml.encode('utf-8'))
# try:
# msg = client.xpath('label="收件箱"')
# msg.click()
# print(msg)
# except Exception as e:
# print(e)