【2020-10-26】APP逆向之某某健康(2)

声明:本文只作学习研究,禁止用于非法用途,否则后果自负,如有侵权,请告知删除,谢谢!



项目场景:


接上一篇https://blog.csdn.net/qq_26079939/article/details/109285783


1.上一篇讲到了模拟登入,这一篇要实现的是上传自己设定的步数到WX和ZFB。

2.准备阶段
  1. 登入账号
  2. 点击我的
  3. 点击数据共享
  4. 然后第三方同步到WX和ZFB

解决方案:


1.然后我们开始抓同步部署数据的包,由于现在博主用的是模拟器,无法增加步数,所以抓不到上传步数的包,大家可以在手机端抓到。

2.这是我之前用手机抓到的上传数据的请求。

	url = 'https://sports.lifesense.com/sport_service/sport/sport/uploadMobileStepV2?systemType=2&version=4.6.7'
	data = {
    
    
	    'list':
	        [
	            {
    
    
	                'DataSource': 2,
	                'active': 1,
	                'calories': int(step / 4),
	                'dataSource': 2,
	                'deviceId': 'M_NULL',
	                'distance': int(step / 3),
	                'exerciseTime': 0,
	                'isUpload': 0,
	                'measurementTime': time.strftime('%Y-%m-%d %H:%M:%S'),
	                'priority': 0,
	                'step': step,
	                'type': 2,
	                'updated': int(round(time.time() * 1000)),
	                'userId': login_result[0]
	            }
	        ]
	}
	

3.接下来我们实现修改步数的代码。

# 修改步数
def change_step():
    # 登录结果
    login_result = login()
    if login_result == '登录失败':
        return '登录失败'
    else:
        url = 'https://sports.lifesense.com/sport_service/sport/sport/uploadMobileStepV2?systemType=2&version=4.6.7'
        data = {
    
    
            'list':
                [
                    {
    
    
                        'DataSource': 2,
                        'active': 1,
                        'calories': int(step / 4),
                        'dataSource': 2,
                        'deviceId': 'M_NULL',
                        'distance': int(step / 3),
                        'exerciseTime': 0,
                        'isUpload': 0,
                        'measurementTime': time.strftime('%Y-%m-%d %H:%M:%S'),
                        'priority': 0,
                        'step': step,
                        'type': 2,
                        'updated': int(round(time.time() * 1000)),
                        'userId': login_result[0]
                    }
                ]
        }
        headers = {
    
    
            'Content-Type': 'application/json; charset=utf-8',
            'Cookie': 'accessToken=%s' % login_result[1]
        }
        response_result = requests.post(url, data=json.dumps(data), headers=headers,verify=False)
        status_code = response_result.status_code
        print('修改步数返回的数据:',response_result.text)
        if status_code == 200:
            print('修改步数为【%s】成功' % step)
        else:
            print('修改步数失败')



4.然后我们执行一下,再去看看微信运动里的数据,哈哈哈,修改成功了66666,马上登顶封面了!

在这里插入图片描述

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_26079939/article/details/109291556