|
最近在学习安卓逆向时,自己上手了一个app逆向其登录协议。抓包到了请求内容:{"oauth_id":"cec4e631f2ccaba57d2eb98919f7c30c","oauth_type":"android","app_status":"4DFD3EAAE16A0D50B04F6B715DA4556E84D12CFA:2","version":"2.6.5","app_type":"time"} 很明显,"oauth_id" 和 "app_status" 为加密内容,
经过反编译软件,找到了 "app_status" 和"oauth_id"的算法如下,但是看不懂啊求大佬帮忙看看,代码也上传至附件,求大佬转换易语言代码
// app_status 的加密方法
public String a(Context p0){
byte[] p0;
try{
p0 = MessageDigest.getInstance("SHA1").digest(p0.getPackageManager().getPackageInfo(p0.getPackageName(), 64).signatures[0].toByteArray());
StringBuffer str = new StringBuffer();
for (int i = 0; i < p0.length; i = i + 1) {
String str1 = Integer.toHexString((p0 & 0x00ff)).toUpperCase(Locale.US);
if (str1.length() == 1) {
str = str+"0";
}
str = str+str1;
}
String p01 = str;
return p01.substring(0, p01.length());
}catch(java.lang.Exception e7){
p0.printStackTrace();
return null;
}
}
// oauth_id 的加密方法
public static ea j(){
if (ea.X == null) {
_monitor_enter(ea.class);
if (ea.X == null) {
ea.X = new ea();
}
_monitor_exit(ea.class);
}
return ea.X;
}
public static Y c(){
if (Y.b == null) {
_monitor_enter(Y.class);
if (Y.b == null) {
Y.b = new Y();
}
_monitor_exit(Y.class);
}
return Y.b;
}
public String a(String p0,String p1){
return Y.c.getString(p0, p1);
}
public String s(){
return Y.c().a("uuid", "");
}
//这是最终得到的oauth_id 值
hashMap.put("oauth_id", ea.j().s());
|
|