248 words
1 minutes
今视频app sign
目标:今视频app登陆验证码接口sign
版本5.09.35
发送验证码
import requests
headers = {
'Host': 'app.jxgdw.com',
'appversion': '5.09.35',
'channeltype': 'jinshipin',
'os': 'Android',
'device': 'D5C92621B033AB5B54BC8FAF976B53D0F76102A1',
'content-type': 'application/json; charset=UTF-8',
'user-agent': 'okhttp/4.9.2',
}
json_data = {
't': '1752138114',
'phone': '15247865936',
'countryCode': '+86',
'sign': '4f01a598fcc8b7dbe8be6ef64ac55624',
'type': '1',
}
response = requests.post('https://app.jxgdw.com/api/code/sms/v3', headers=headers, json=json_data)
print(response.text)
验证验证码
import requests
headers = {
'Host': 'app.jxgdw.com',
'appversion': '5.09.35',
'channeltype': 'jinshipin',
'os': 'Android',
'device': 'D5C92621B033AB5B54BC8FAF976B53D0F76102A1',
'content-type': 'application/json; charset=UTF-8',
'user-agent': 'okhttp/4.9.2',
}
json_data = {
'distinctId': 'D5C92621B033AB5B54BC8FAF976B53D0F76102A1',
'phone': '15247865936',
'countryCode': '+86',
'smsCode': '123459',
}
response = requests.post('https://app.jxgdw.com/api/auth/sms', headers=headers, json=json_data)
print(response.text)
所以只做device
和 sign
就行
sign
直接搜 sms/v3
搜出来接口,然后查找用例
@Override // com.jxntv.network.request.BaseGVideoRequest
protected Observable<Response<JsonElement>> getResponseObservable() {
SmsAuthUtils.addAuthParams(this.mParameters);
parseGeeResponseParams();
return AccountAPI.Instance.get().sendSmsCode(this.mParameters);
}
进去addAuthParams
看下
package com.jxntv.account.utils;
import com.huawei.hms.framework.common.ContainerUtils;
import com.jxntv.account.BuildConfig;
import com.jxntv.utils.ClockUtils;
import com.jxntv.utils.XorUtils;
import com.tencent.smtt.utils.Md5Utils;
import java.util.Map;
import java.util.TreeMap;
/* loaded from: classes6.dex */
public class SmsAuthUtils {
private SmsAuthUtils() {
}
public static void addAuthParams(Map<String, Object> map) {
TreeMap treeMap = new TreeMap();
long currentServerTimestamp = ClockUtils.getCurrentServerTimestamp() / 1000;
treeMap.put("t", String.valueOf(currentServerTimestamp));
for (Map.Entry<String, Object> entry : map.entrySet()) {
if (entry.getValue() != null) {
treeMap.put(entry.getKey(), entry.getValue().toString());
}
}
StringBuilder sb = new StringBuilder();
for (Map.Entry<? extends String, ? extends Object> entry2 : treeMap.entrySet()) {
sb.append(entry2.getKey());
sb.append(ContainerUtils.KEY_VALUE_DELIMITER);
sb.append((String) entry2.getValue());
sb.append(ContainerUtils.FIELD_DELIMITER);
}
sb.append(new String(XorUtils.xor(BuildConfig.BYTES, 101)));
sb.append("×tamp=" + currentServerTimestamp);
treeMap.put("sign", Md5Utils.getMD5(sb.toString()));
map.putAll(treeMap);
}
}