开启辅助访问 切换到宽版

精易论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

用微信号发送消息登录论坛

新人指南 邀请好友注册 - 我关注人的新帖 教你赚取精币 - 每日签到


求职/招聘- 论坛接单- 开发者大厅

论坛版规 总版规 - 建议/投诉 - 应聘版主 - 精华帖总集 积分说明 - 禁言标准 - 有奖举报

查看: 5005|回复: 42
收起左侧

[Web源码] zepp小米运动步数接口PHP源码

[复制链接]
结帖率:97% (36/37)
发表于 2024-2-25 14:26:53 | 显示全部楼层 |阅读模式   广东省中山市
分享源码
界面截图:
是否带模块: 纯源码
备注说明: -
女票有天突然好奇别人步数都是5-6W+的,我就随口说刷的。
然后我的任务就来了。

工具人上线:{:4_255:}

1、首先自己没去抓官方接口,直接调用别人的免费接口,然后利用金山文档的AirScript脚本编辑器,写了个js代码,实现24小时重复刷,提交步数随机递增,设置个最大步数限制,大于等于就不再执行代码。

2、然后就没理他了,每天大概能跑到5W左右,金山文档的只能创建10个任务,能跑就不想动的原则,也没优化代码了。

结果昨天我白嫖的站点关闭了,然后百度了一圈也没发现能用的,自己的帐号密码交到别人哪儿还是多多少少有点膈应。但是自己不想去抓接口,结果无意找到这份前辈写的PHP接口源码。

但是不可能为了刷步就买个服务器吧,目前对服务器也没啥需求,然后想到了某免费主机,然后果断上传测试,中间有点小插曲,完美调试成功。

前辈这个是get方式的,上传源码成功之后可以直接访问,格式是:http://域名?user=小米运动帐号&pass=小米运动密码&count=步数


[PHP] 纯文本查看 复制代码
<?php
error_reporting(0);//抑制所有错误
header('Access-Control-Allow-Origin: *');
header('Content-type:application/json; charset=utf-8');
echo shuabu($_GET['user'],$_GET['pass'],$_GET['count']);

function shuabu($user,$pass,$count){
    if($user==''){$json = array("code"=>207,"msg"=>'小米运动账号不能为空',);return json_encode($json,JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);}
    if($pass==''){$json = array("code"=>202,"msg"=>'小米运动密码不能为空',);return json_encode($json,JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);}
    if($count==''){$json = array("code"=>205,"msg"=>'小米运动步数不能为空',);return json_encode($json,JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);}
    if(preg_match("/^1[3456789]\d{9}$/", $user) == 0) {$json = array("code"=>203,"msg"=>'手机号格式错误!',);return json_encode($json,JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);}
    if(intval($count)<= 0){$json = array("code"=>206,"msg"=>'步数格式错误!',);return json_encode($json,JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);}
    if(intval($count)>99999){$json = array("code"=>204,"msg"=>'步数最大限制为99999',);return json_encode($json,JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);}
    $access = login($user,$pass);
    if($access == ''){
        $json = array(
            "code"=>201,
            "msg"=>'小米运动账号或者密码错误',
        );
        return json_encode($json,JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
    }
    $user_json = get_user($access);
    $user_id = get_user_id($user_json);
    $app_token = get_app_token($user_json);
    $return = json_decode(load($user_id,$app_token,$count),true);
    if($return['code']=='1'){
        $json = array(
            "code"=>200,
            "msg"=>'提交步数成功',
            "user"=>$_GET['user'],
            "count"=>$_GET['count']
        );
    }else{
        $json = array(
            "code"=>208,
            "msg"=>'提交步数失败,API返回结果为:'.$json['message'].'',
            "user"=>$_GET['user'],
            "count"=>$_GET['count']
        );
    }
    return json_encode($json,JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
}   
function login($user,$pass){//登录,成功返回access,失败返回空
    $data_url = 'https://api-user.huami.com/registrations/+86'.$user.'/tokens';
    $post_data = array(
        "client_id" => "HuaMi",
        "country_code" => "CN",
        "password" => $pass,
        "redirect_uri" => "https%3A//s3-us-west-2.amazonaws.com/hm-registration/successsignin.html",
        "state" => "REDIRECTION",
        "token" => "access"
    );
    $return = curl_sport($data_url,$post_data,1);
    if(strexists($return,'access')){
        return GetBetween($return,'access=','&');
    }else{
        return '';
    }
}
function get_user($access){//获取用户信息,json类型
    $data_url = 'https://account.huami.com/v2/client/login';
    $post_data="allow_registration=false&app_name=com.xiaomi.hm.health&app_version=4.1.0&code=".$access."&country_code=CN&device_id=device_id_type=uuid&device_model=phone&dn=api-user.huami.com%2Capi-mifit.huami.com%2Capp-analytics.huami.com&grant_type=access_token&lang=zh_CN&os_version=1.5.0&source=com.xiaomi.hm.health&third_name=huami_phone";
    $return = curl_sport($data_url,$post_data,0);
    return $return;     
}
function load($user_id,$app_token,$count){//提交步数
    $data_url = "https://api-mifit-cn.huami.com/v1/data/band_data.json?&t=" . time();
    $headers = [
            'apptoken: ' . $app_token,
            'User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 13_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.12(0x17000c2d) NetType/WIFI Language/zh_CN'
        ];
    $json = '[{"data_hr":"\/\/\/\/\/\/9L\/\/\/\/\/\/\/\/\/\/\/\/Vv\/\/\/\/\/\/\/\/\/\/\/0v\/\/\/\/\/\/\/\/\/\/\/9e\/\/\/\/\/0n\/a\/\/\/S\/\/\/\/\/\/\/\/\/\/\/\/0b\/\/\/\/\/\/\/\/\/\/1FK\/\/\/\/\/\/\/\/\/\/\/\/R\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/9PTFFpaf9L\/\/\/\/\/\/\/\/\/\/\/\/R\/\/\/\/\/\/\/\/\/\/\/\/0j\/\/\/\/\/\/\/\/\/\/\/9K\/\/\/\/\/\/\/\/\/\/\/\/Ov\/\/\/\/\/\/\/\/\/\/\/zf\/\/\/86\/zr\/Ov88\/zf\/Pf\/\/\/0v\/S\/8\/\/\/\/\/\/\/\/\/\/\/\/\/Sf\/\/\/\/\/\/\/\/\/\/\/z3\/\/\/\/\/\/0r\/Ov\/\/\/\/\/\/S\/9L\/zb\/Sf9K\/0v\/Rf9H\/zj\/Sf9K\/0\/\/N\/\/\/\/0D\/Sf83\/zr\/Pf9M\/0v\/Ov9e\/\/\/\/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AfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAA","tz":32,"did":"DA932FFFFE8816E7","src":24}],"summary":"{\"v\":6,\"slp\":{\"st\":1628296479,\"ed\":1628296479,\"dp\":0,\"lt\":0,\"wk\":0,\"usrSt\":-1440,\"usrEd\":-1440,\"wc\":0,\"is\":0,\"lb\":0,\"to\":0,\"dt\":0,\"rhr\":0,\"ss\":0},\"stp\":{\"ttl\":' . $count . ',\"dis\":10627,\"cal\":510,\"wk\":41,\"rn\":50,\"runDist\":7654,\"runCal\":397,\"stage\":[{\"start\":327,\"stop\":341,\"mode\":1,\"dis\":481,\"cal\":13,\"step\":680},{\"start\":342,\"stop\":367,\"mode\":3,\"dis\":2295,\"cal\":95,\"step\":2874},{\"start\":368,\"stop\":377,\"mode\":4,\"dis\":1592,\"cal\":88,\"step\":1664},{\"start\":378,\"stop\":386,\"mode\":3,\"dis\":1072,\"cal\":51,\"step\":1245},{\"start\":387,\"stop\":393,\"mode\":4,\"dis\":1036,\"cal\":57,\"step\":1124},{\"start\":394,\"stop\":398,\"mode\":3,\"dis\":488,\"cal\":19,\"step\":607},{\"start\":399,\"stop\":414,\"mode\":4,\"dis\":2220,\"cal\":120,\"step\":2371},{\"start\":415,\"stop\":427,\"mode\":3,\"dis\":1268,\"cal\":59,\"step\":1489},{\"start\":428,\"stop\":433,\"mode\":1,\"dis\":152,\"cal\":4,\"step\":238},{\"start\":434,\"stop\":444,\"mode\":3,\"dis\":2295,\"cal\":95,\"step\":2874},{\"start\":445,\"stop\":455,\"mode\":4,\"dis\":1592,\"cal\":88,\"step\":1664},{\"start\":456,\"stop\":466,\"mode\":3,\"dis\":1072,\"cal\":51,\"step\":1245},{\"start\":467,\"stop\":477,\"mode\":4,\"dis\":1036,\"cal\":57,\"step\":1124},{\"start\":478,\"stop\":488,\"mode\":3,\"dis\":488,\"cal\":19,\"step\":607},{\"start\":489,\"stop\":499,\"mode\":4,\"dis\":2220,\"cal\":120,\"step\":2371},{\"start\":500,\"stop\":511,\"mode\":3,\"dis\":1268,\"cal\":59,\"step\":1489},{\"start\":512,\"stop\":522,\"mode\":1,\"dis\":152,\"cal\":4,\"step\":238}]},\"goal\":8000,\"tz\":\"28800\"}","source":24,"type":0}]';
    $data = [
            'data_json' => $json,
            'userid' => $userid,
            'device_type' => '0',
            'last_sync_data_time' => '1597306380',
            'last_deviceid' => 'DA932FFFFE8816E7',
        ];
    $return=Curl($data_url, $data, null, $headers);
    $return2=json_encode(array('code'=>1,'msg'=>'提交成功'));
    return $return2;
}
function get_user_id($user_json){//解析user_json,获取user_id
    $json = json_decode($user_json,true);
    return $json['token_info']['user_id'];      
}
function get_app_token($user_json){//解析user_json,获取app_token
    $json = json_decode($user_json,true);
    return $json['token_info']['app_token'];        
}
//取出文本中间文本
function GetBetween($content,$start,$end){
    $r = explode($start, $content);
    if (isset($r[1])){
        $r = explode($end, $r[1]);
        return $r[0];
    }
    return '';
}


//此应用专用curl,返回response_header
function curl_sport($url,$post=0,$type=0,$request=''){//GET\POST网络请求
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL,$url);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $httpheader);
    curl_setopt($ch, CURLOPT_TIMEOUT, 10);  
    if($post){
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
    }
    if($request!=''){
        $httpheader[] = "apptoken:".$request;
        curl_setopt($ch, CURLOPT_HTTPHEADER, $httpheader);
    }
    //返回 response_header, 该选项非常重要,如果不为 true, 只会获得响应的正文
    curl_setopt($ch, CURLOPT_HEADER, $type);
    curl_setopt($ch, CURLINFO_HEADER_OUT, true);
    curl_setopt($ch, CURLOPT_AUTOREFERER, false);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
    $ret = curl_exec($ch);
    curl_close($ch);
    return $ret;
}

function strexists($string, $find) {//取字符串中是否包含指定字符串
    return !(strpos($string, $find) === FALSE);
}

function Curl($url, $data = null, $cookie = null, $httpheader = null)
    {
        $curl = curl_init();
        curl_setopt($curl, CURLOPT_URL, $url);
        $httpheader[] = "Accept-Language: zh-CN,zh;q=0.8";
        $httpheader[] = "Connection: keep-alive";
        curl_setopt($curl, CURLOPT_HTTPHEADER, $httpheader);
        if ($data) {
            if (is_array($data)) $data = http_build_query($data);
            curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
            curl_setopt($curl, CURLOPT_POST, 1);
        }
        if($cookie){
            curl_setopt($curl, CURLOPT_COOKIE, $cookie);
        }
        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 10);
        curl_setopt($curl, CURLOPT_HEADER, 1);
        $ret = curl_exec($curl);
        $headerSize = curl_getinfo($curl, CURLINFO_HEADER_SIZE);
        $header = substr($ret, 0, $headerSize);
        $content = substr($ret, $headerSize);
        $ret = array();
        $ret['header'] = $header;
        $ret['content'] = $content;
        curl_close($curl);
        return $ret;
    }
?>


在这先感谢前辈开源,在论坛没找到类似的,就搬过来给用得上的朋友。



由于前辈写的这个是get的,我想继续在金山文档实现调用的话,还是需要改成post的才方便,最后简单修改了2个地方,实现了POST请求。
VX截图_20240225142323.jpg

接下来又可以继续在金山文档去用脚本调用,而且也没了各种限制,最重要的是不用担心帐号密码泄露,而且主机和金山文档都是免费的。

再次感谢前辈的源码让我能继续装逼(▼へ▼メ)

评分

参与人数 6好评 +3 精币 +7 收起 理由
316840427 + 1 + 2 大家注意,不能是PHP8.0版本,要7.0才可以执行噢
wa690602724 + 1 感谢分享,很给力!~
w15938117152 + 1 + 1 大神,这种源码怎么搭建呢?求教练.
kyo9766 + 1 感谢分享,很给力!~
財財 + 1 感谢分享,很给力!~
光影魔术 + 1 + 1 开源精神必须支持~

查看全部评分


结帖率:97% (36/37)

签到天数: 25 天

 楼主| 发表于 2024-3-3 10:42:49 | 显示全部楼层   广东省中山市
@w15938117152
我的搭建步骤:

1、找个免费主机,如果你有服务器的话就用服务器,没有就去白嫖个每天签到就能获取续费余额,直接自动续费就行了。
(要长期签到白嫖主机,我们直接还是利用AirScript脚本编辑器来编写个签到程序,其实就是个简单的post,然后设置每天定时启动一下就好了,完全无人值守。)
VX截图_20240303095620.jpg
2、主机有了之后,再去找个免费域名,这种免费域名差不多1年去手动刷新续期一次,都是免费的。
(注册不需要太多资料,注册成功之后就解析绑定到我们主机去,这儿解析绑定需要一定时间)
VX截图_20240303095459.jpg
域名注册成功之后就点你域名右边的绿色“➕”绑定域名,如下图,地址就写你主机的地址,然后提交等通过。
VX截图_20240303100140.jpg
3、域名和主机都OK之后,就上传源码到主机去。
(把源码复制下来,新建个txt文本,把源码复制进去保存,然后修改txt后缀为php,文件名字改成“index.php”然后上传到主机根目录)
源码这儿要注意下,大佬的源码是get方式提交的,如果你觉得没啥的话就直接用get方式,如果要用post方式,就要修改下源码。
VX截图_20240303100554.jpg

4、主机,域名,源码都搞定了,就差定时运行,然后和一系列数据提交。
(这一步,我们还是用金山文档的AirScript脚本编辑器来编写一个访问程序,然后再设置文档内的脚本定时启动,这就完事啦)
VX截图_20240303102054.jpg

*AirScript的程序代码是JavaScript编汇语言,可以用表格自带AI按照你要求写代码,免费的。
然后写出来的代码调试的时候报错可以复制到其他AI工具去让AI修正。


我的这个AirScript脚本编汇逻辑是:
1、历遍AB列2-11的表格,循环提交,要挂多少帐号就多少帐号(这个帐号是小米zepp的,没注册过的要去搜索下相关绑定教程)
2、设置初始步数0,然后再定义一个步数上限值和提交区间的常量,每次提交的数值在区间内随机,然后加到表格。循环前面加个判断,如果提交的数字≥上限,就跳过提交,程序直接结束。
(这儿要注意加到表格的这个提交的数值,每天0点记得清0,用程序判断时间再更改就行了。)
3、程序主要就是提交数据到前面搭建的接口哪儿去,所以具体要怎么写可以根据自己情况来。程序完了就去设置个定时,然后就甩手了。


*我写的是单次随机增加步数,然后把结果推送到张小龙的
回复 支持 1 反对 0

使用道具 举报

结帖率:100% (2/2)

签到天数: 2 天

发表于 2024-3-23 13:56:27 | 显示全部楼层   福建省泉州市
734030986 发表于 2024-3-22 22:46
源码直接搭建过去是get的,直接get你源码所在的域名,提交方式是json格式的 ...

我就是看你上面php里那个获取access这一段,post了下获取不到access,奇了怪了
回复 支持 反对

使用道具 举报

结帖率:97% (36/37)

签到天数: 25 天

 楼主| 发表于 2024-3-22 22:46:48 | 显示全部楼层   广东省中山市
shareol25 发表于 2024-3-22 19:35
问下大佬,按你的源码。
url=https://api-user.huami.com/registrations/+861380013800/tokens
post=client ...

源码直接搭建过去是get的,直接get你源码所在的域名,提交方式是json格式的
回复 支持 反对

使用道具 举报

结帖率:100% (2/2)

签到天数: 2 天

发表于 2024-3-22 19:35:36 | 显示全部楼层   福建省泉州市
问下大佬,按你的源码。
url=https://api-user.huami.com/registrations/+861380013800/tokens
post=client_id=HuaMi&password=123456&redirect_uri=https%3A//s3-us-west-2.amazonaws.com/hm-registration/successsignin.html&country_cod=CN&state=REDIRECTION&token=access

post后,怎么娶不到access
回复 支持 反对

使用道具 举报

结帖率:97% (36/37)

签到天数: 25 天

 楼主| 发表于 2024-3-8 08:30:34 | 显示全部楼层   广东省中山市
w15938117152 发表于 2024-3-7 20:02
经过大佬的指导  终于好了       首先接口前面加上跨域代码   和请求方式方式      
// 允许所有来源访问 ...

记得给蛋蛋也写个签到脚本挂表格
回复 支持 反对

使用道具 举报

结帖率:92% (12/13)

签到天数: 4 天

发表于 2024-3-7 20:02:44 | 显示全部楼层   江苏省苏州市
734030986 发表于 2024-3-7 08:21
代码直接复制过去用是get的

经过大佬的指导  终于好了       首先接口前面加上跨域代码   和请求方式方式      
// 允许所有来源访问
header("Access-Control-Allow-Origin: *");
// 允许使用的请求方法
header("Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS");
// 允许的请求头
header("Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With");


再次
$.ajax({
  url: 'http://域名/sport.php?do=shuabu&user=' + username + '&pass=' + password + '&count=' + steps,
  type: 'POST',
  dataType: 'json',

GET需要改成POST      

经过测试    完美修改
回复 支持 反对

使用道具 举报

结帖率:97% (36/37)

签到天数: 25 天

 楼主| 发表于 2024-3-7 08:25:56 | 显示全部楼层   广东省中山市

VX截图_20240307082409.jpg

每天都有人说失效,自己去测试吧
回复 支持 反对

使用道具 举报

结帖率:97% (36/37)

签到天数: 25 天

 楼主| 发表于 2024-3-7 08:21:57 | 显示全部楼层   广东省中山市
w15938117152 发表于 2024-3-6 15:18
主页php名字修改成了sport.php,然后POST  域名/sport.php?do=shuabu&user=手机号&pass=密码&count=步数  ...

代码直接复制过去用是get的
回复 支持 反对

使用道具 举报

结帖率:78% (64/82)
发表于 2024-3-6 20:46:33 | 显示全部楼层   河南省新乡市
接口已经失效了
回复 支持 0 反对 1

使用道具 举报

结帖率:92% (12/13)

签到天数: 4 天

发表于 2024-3-6 15:18:28 | 显示全部楼层   江苏省苏州市
734030986 发表于 2024-3-6 08:58
你提交POST的格式是啥

主页php名字修改成了sport.php,然后POST  域名/sport.php?do=shuabu&user=手机号&pass=密码&count=步数    然后返回的就是201
回复 支持 反对

使用道具 举报

结帖率:97% (36/37)

签到天数: 25 天

 楼主| 发表于 2024-3-6 08:58:13 | 显示全部楼层   广东省中山市
w15938117152 发表于 2024-3-5 21:21
按照大佬的搭建完成了  也可以POST    就是明明账号和密码对了  但是获取的结果却是
{
    "code": 201,

你提交POST的格式是啥
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则 致发广告者

发布主题 收藏帖子 返回列表

sitemap| 易语言源码| 易语言教程| 易语言论坛| 易语言模块| 手机版| 广告投放| 精易论坛
拒绝任何人以任何形式在本论坛发表与中华人民共和国法律相抵触的言论,本站内容均为会员发表,并不代表精易立场!
论坛帖子内容仅用于技术交流学习和研究的目的,严禁用于非法目的,否则造成一切后果自负!如帖子内容侵害到你的权益,请联系我们!
防范网络诈骗,远离网络犯罪 违法和不良信息举报电话0663-3422125,QQ: 793400750,邮箱:wp@125.la
Powered by Discuz! X3.4 揭阳市揭东区精易科技有限公司 ( 粤ICP备12094385号-1) 粤公网安备 44522102000125 增值电信业务经营许可证 粤B2-20192173

快速回复 返回顶部 返回列表