本文为看雪论坛优秀文章
看雪论坛作者ID:以和爲貴
http://m.xxxx.com.cn/v2/member?modules=cloudlogin%3A1
&password=666666666
&siteid=10001
&sign=d01f5e4445af0a30d148d4dc451b41cf&clientid=1
&system_name=android
&type=android
&time=1659366738640
&ip=10.0.2.15
&device_id=2a%3Aa5%3A33%3A2d%3Ade%3Ac9
&account=13905376666 HTTP/1.1
public static String m8098a(HashMap<String, String> paramsMap, String time) {
//传入两个参数,一个是map集合,一个是刚刚获取的time
LinkedHashMap<String, String> sortParams = new LinkedHashMap<>();
//声名一个新的集合
Object[] key_arr = paramsMap.keySet().toArray();
//将map中的属性取出来,存放在key_arr数组里面
Arrays.sort(key_arr);
//进行排序
for (Object key : key_arr) {
try {
sortParams.put(key.toString(), URLEncoder.encode(paramsMap.get(key).toString(), "UTF-8"));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
//将刚刚key_arr数组里面的值转化成string类型,然后将map中的数据进行url编码,然后将这两个数组组合成一个键值对放在新声名的sortParams中
StringBuilder result = new StringBuilder();
for (Map.Entry<String, String> entry : sortParams.entrySet()) {
//把刚刚处理完的sortParams中的值利用迭代器取出来放在entry变量中
if (result.length() > 0) {
result.append("&");
}
//在每一个键值对后面用 & 连接
result.append(entry.getKey());
result.append("=");
result.append(entry.getValue());
//将键和值之间用 = 连接
}
//这样就像发往服务器的包的结构了
String replace = result.toString().replace("*", "%2A").replace("%7E", "~").replace("+", "%20");
//将处理完的结果result在to string之后进行字符替换为replace
String resultMD5 = MD5.md5(replace);
//将replace进行md5加密之后为resultMD5
String str = resultMD5 + "1fa50ba25ed527f3fd1eb9467686f2bb" + time;
//进行字符串拼接之后(加盐)转换为str
String md5Result = MD5.md5(str);
//将str在进行md5加密之后作为函数的返回值md5Result
return md5Result;
//返回的md5Result即为sign值
}
POST http://xxxx.xx8xx88xx.com/v2_2/user/login HTTP/1.1
nonce=b104cc74ade1441a9c61759fe330883c
&codeSign=2086B76A137CBA8B84DD1CBCAC3F7B45
×tamp=1659843481869
&data=%7B%22params%22%3A%7B%22username%22%3A%22kanxue%22%2C%22password%22%3A%22kanxue123%22%7D%7D
&version=2.2.1
&product_version=220
&platform=HD1910
&network=1
&device=864282012982996
&access_token=62cb31ab6f2ffdaef382236aba9b98f4
&screen_width=1280
&screen_height=720
&bbsnopic=0
&system=2
&system_version=19
&theme=4
accesstoken一个访问令牌包含了此登陆会话的安全信息。登录一次,服务器生成一个token返回给你,你只需每次请求附带这个token就能对网站标识自己的身份。换句话说,就是一个电子版的令牌。(这个字段可以通过解码,变成人可以看的字段)
public void mo17350a(String str, JSONObject jSONObject, AbstractC5417d<T> dVar) {
String replaceAll = UUID.randomUUID().toString().replaceAll("-", "");
//这里就是随机一个UUID,然后赋值给nonce字段
long currentTimeMillis = System.currentTimeMillis();
//获取系统时间,在计算codesign字段时会用到的·1
JSONObject a = mo17349a(jSONObject);
//从函数的传入的参数中取出的JSON_object中应该就是那个data字段的值
if (MyApplication.getInstance().isLogin()) {
//如果点击登录按钮,就走下面这个分支,就是进行键值对的拼接
C5445g.m20674a(str, new C5445g.C5461f[]{new C5445g.C5461f(ReportActivity.USER_ID, "" + MyApplication.getInstance().getUserDataEntity().getUid()), new C5445g.C5461f("login_token", "" + MyApplication.getInstance().getUserDataEntity().getLogin_token()), new C5445g.C5461f("nonce", replaceAll), new C5445g.C5461f("codeSign", C6485v.m23485a(replaceAll, a, MyApplication.getInstance().getUserDataEntity().getUid() + "", currentTimeMillis)), new C5445g.C5461f("timestamp", currentTimeMillis + ""), new C5445g.C5461f("data", a.toString()), new C5445g.C5461f("version", C5414a.f16227f + ""), new C5445g.C5461f("product_version", "220"), new C5445g.C5461f(C1380c.PLATFORM, Build.PRODUCT + ""), new C5445g.C5461f(CandidatePacketExtension.NETWORK_ATTR_NAME, MyApplication.getNetworkType() + ""), new C5445g.C5461f("device", "" + MyApplication.getDeviceId()), new C5445g.C5461f("access_token", "" + C5414a.f16229h), new C5445g.C5461f("screen_width", "" + C5414a.f16230i), new C5445g.C5461f("screen_height", "" + C5414a.f16231j), new C5445g.C5461f("bbsnopic", MyApplication.isForumNoIMG() + ""), new C5445g.C5461f(C7748d.C7755c.f24519a, MessageService.MSG_DB_NOTIFY_CLICK), new C5445g.C5461f("system_version", Build.VERSION.SDK_INT + ""), new C5445g.C5461f("theme", C5414a.f16223b + "")}, (ResultCallback) dVar);
return;
}
C5445g.m20674a(str, new C5445g.C5461f[]{new C5445g.C5461f("nonce", replaceAll), new C5445g.C5461f("codeSign", C6485v.m23484a(replaceAll, a, currentTimeMillis)), new C5445g.C5461f("timestamp", currentTimeMillis + ""), new C5445g.C5461f("data", a.toString()), new C5445g.C5461f("version", C5414a.f16227f + ""), new C5445g.C5461f("product_version", "220"), new C5445g.C5461f(C1380c.PLATFORM, Build.PRODUCT + ""), new C5445g.C5461f(CandidatePacketExtension.NETWORK_ATTR_NAME, MyApplication.getNetworkType() + ""), new C5445g.C5461f("device", "" + MyApplication.getDeviceId()), new C5445g.C5461f("access_token", "" + C5414a.f16229h), new C5445g.C5461f("screen_width", "" + C5414a.f16230i), new C5445g.C5461f("screen_height", "" + C5414a.f16231j), new C5445g.C5461f("bbsnopic", MyApplication.isForumNoIMG() + ""), new C5445g.C5461f(C7748d.C7755c.f24519a, MessageService.MSG_DB_NOTIFY_CLICK), new C5445g.C5461f("system_version", Build.VERSION.SDK_INT + ""), new C5445g.C5461f("theme", C5414a.f16223b + "")}, (ResultCallback) dVar);
}
static {
String str = f16227f + Build.PRODUCT + MyApplication.getNetworkType() + MyApplication.getDeviceId();
crack.log(str);
f16229h = C6448r.m23455a(str);
}
public static final int forum_key = 2131230990;
<string name="forum_key">94ac5cfb69e87bd7</string>
POST http://passport.xxxx.com.cn/login_jsonp_active.do HTTP/1.1
Content-Type: application/x-www-form-urlencoded; charset=utf-8
Content-Length: 302
Host: passport.xxxx.com.cn
Connection: Keep-Alive
Accept-Encoding: gzip
Cookie: JSESSIONID=aaapcYHe7KtGb7NDScYhy
User-Agent: okhttp/3.1.2
key=dTdlMmtGQjZIQk9CNmdudi95QURUbUNrZ2xKWFRNc0t0Z3g4NnpKRkZDYjRGc25RU05CL0wzSjQ2ZFYrMmxqd1ZaU2JtTVJvaURudWJhVnpFZGRsRmZGQldGQzBxbE0xVFVNVER5TDRpNkFpc1E4eVJVK0VnZWxBUUdaR0lvZ0Y5NTdFKzJKRVFtNlR0SDN5SGtCY1FOZnFIYnpNdmZqa3FPVnc2SkNGUzJ1SWUrb2xBby9wbGUrSUh1bU1wK2pTbW1XYkhzajNsYmM9P2tleUlkPTE
sb.append(DESedeCoder.encode(json, KEYS.get("1"))).append("?keyId=").append("1");
public String encrypt(Map params) {
public static Map<String, String> m264a(Map<String, String> map) {
map.put("t", String.valueOf(System.currentTimeMillis()));
StringBuilder sb = new StringBuilder(128);
sb.append(m265b(map.get("appkey"))).append("&").append(m265b(map.get("domain"))).append("&").append(m265b(map.get("appName"))).append("&").append(m265b(map.get(SdkConstants.APP_VERSION))).append("&").append(m265b(map.get("bssid"))).append("&").append(m265b(map.get("channel"))).append("&").append(m265b(map.get(LeService.KEY_DEVICE_ID))).append("&").append(m265b(map.get("lat"))).append("&").append(m265b(map.get("lng"))).append("&").append(m265b(map.get("machine"))).append("&").append(m265b(map.get("netType"))).append("&").append(m265b(map.get("lng"))).append("&").append(m265b(map.get("platform"))).append("&").append(m265b(map.get("platformVersion"))).append("&").append(m265b(map.get("preIp"))).append("&").append(m265b(map.get("sid"))).append("&").append(m265b(map.get("t"))).append("&").append(m265b(map.get("v")));
map.put("sign", m263a(sb.toString()));
return map;
}
看雪ID:以和爲貴
https://bbs.pediy.com/user-home-939330.htm
# 往期推荐
球分享
球点赞
球在看
点击“阅读原文”,了解更多!