Nota: El siguiente análisis es solo para aprendizaje y comunicación, y otros propósitos están prohibidos.
Recientemente quise matar algo en JD.com, pero descubrí que no podía conseguirlo en absoluto. Tomemos la bolsa y echemos un vistazo. Aprenda por cierto.
Encontré una solicitud al azar y descubrí que hay tres valores que son diferentes cada vez: st, sign, sv. Parece que esto está encriptado
Si la clave secreta es incorrecta, devolverá la verificación de la firma fallida
//这里是url参数
functionId=getLegoWareDetailComment
clientVersion=9.4.4
build=87076
client=android
d_brand=Meizu
d_model=Meizu60
osVersion=10.0
screen=1380*720
partner=tencent
oaid=
eid=eidndjfkldaju897dfncHdk
sdkVersion=24
lang=zh_CN
uuid=oe9a3ff1fce3f
aid=oe9a3ff1fce3f
area=1_73_55177_9
networkType=wifi
wifiBssid=5771b7c0c1a46w4123zxcv3nm18190b1
//这几个是加密
st=1616770835649
sign=0f0sfzxcvbnm41df07e7d85b34cb8h31
sv=120
//这个是body
{"category":"12259;12260;9435","shadowMainSku":"0","shieldCurrentComment":"1","shopType":"0","sku":"000000558","venderId":"1009943","wareType":"1"}
秘钥不对会返回:
{
"code": "600",
"echo": "signature verification failed"
}
Eso solo se puede encontrar en la aplicación, versión de la aplicación 9.4.4, descompilar, tomar el código fuente y encontrar el lugar donde se genera el letrero
private static void b(HttpSetting httpSetting, String str, String str2) {
String functionId = httpSetting.getFunctionId();
String property = b.getProperty(Configuration.CLIENT, "");
String versionName = a.Uk().getStatInfoConfigImpl().getVersionName();
if (functionId != null) {
if (OKLog.D) {
String str3 = TAG;
OKLog.d(str3, "id:" + httpSetting.getId() + "- ..functionId -->> " + functionId);
String str4 = TAG;
OKLog.d(str4, "id:" + httpSetting.getId() + "- ..body -->> " + str);
String str5 = TAG;
OKLog.d(str5, "id:" + httpSetting.getId() + "- ..uuid -->> " + str2);
String str6 = TAG;
OKLog.d(str6, "id:" + httpSetting.getId() + "- ..client -->> " + property);
String str7 = TAG;
OKLog.d(str7, "id:" + httpSetting.getId() + "- ..clientVersion -->> " + versionName);
}
try {
//这里就是了
String signature = a.Uk().Ur().signature(a.Uk().getApplicationContext(), functionId, str, str2, property, versionName);
if (OKLog.D) {
OKLog.d("Signature", "native load sucess " + signature);
}
httpSetting.setSignature("&" + signature);
httpSetting.setUrl(httpSetting.getUrl() + httpSetting.getSignature());
} catch (Exception unused) {
}
}
}
Encontré el código y finalmente descubrí que así se llamaba
public static native String getSignFromJni(Context context, String functionId, String body, String uuid, String client, String clientVersion);
¿Entonces, Qué haces? Ensamblaje, depuración dinámica, caminar
//so返回的结果
st=1616804726304&sign=bc587e1837f8a996825023b9ea6fa03e&sv=111
OK, para resumir, los parámetros están encriptados para generar la señal. Los amigos interesados pueden contactar o agregar directamente QQ1661639956, comunicémonos juntos