1 Star 0 Fork 75

Robot-development/PHP-DouyinRobot

forked from Bygones/PHP-DouyinRobot 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Adb.php 1.53 KB
一键复制 编辑 原始数据 按行查看 历史
Bygones 提交于 2019-06-16 13:47 . 提交代码
<?php
class Adb
{
protected $follow = [];
protected $slide = [];
protected $fabulous = [];
public function __construct(array $config)
{
$this->follow = $config["follow"];
$this->slide = $config["slide"];
$this->fabulous = $config["fabulous"];
}
/**
* Describe:关注
* @Author: Bygones
* Date: 2019-06-15
* Time: 23:16
* @return mixed
*/
public function Follow()
{
$x = $this->follow["x"];
$y = $this->follow["y"];
exec("adb shell input tap ".$x." ".$y." ");
return true;
}
/**
* Describe:滑动
* @Author: Bygones
* Date: 2019-06-15
* Time: 23:22
* @return mixed
*/
public function Slide()
{
$x = $this->slide["x"];
$y = $this->slide["y"];
$x1 = $this->slide["x1"];
$y1 = $this->slide["y1"];
exec("adb shell input swipe ".$x." ".$y." ".$x1." ".$y1." ");
return true;
}
/**
* Describe:点赞
* @Author: Bygones
* Date: 2019-06-16
* Time: 11:05
*/
public function Fabulous()
{
$x = $this->fabulous["x"];
$y = $this->fabulous["y"];
exec("adb shell input tap ".$x." ".$y." ");
return true;
}
/**
* Describe:截图
* @Author: Bygones
* Date: 2019-06-15
* Time: 23:33
*/
public function Screenshot()
{
$dir = __DIR__ . "/img/dy".date("YmdHis").".png";
exec("adb exec-out screencap -p > ".$dir);
return $dir;
}
}
?>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/robot-code/PHP-DouyinRobot.git
git@gitee.com:robot-code/PHP-DouyinRobot.git
robot-code
PHP-DouyinRobot
PHP-DouyinRobot
master

搜索帮助