好友
阅读权限10
听众
最后登录1970-1-1
|
梦迪丶
发表于 2019-12-3 17:49
看蒙圈了,刚学习入门,想试着找一个协议的加密,这段代码看蒙圈了,有大佬给解释下么,感谢。
public class c {
public c() {
super();
}
private static a a() {
Object v0_1;
a v1 = null;
try {
v0_1 = e.a(a.class);
}
catch(Exception v0) {
ThrowableExtension.printStackTrace(((Throwable)v0));
a v0_2 = v1;
}
return ((a)v0_1);
}
private static String a(Context arg4, HashMap arg5) {
int v3 = 16;
if(arg5 == null) {
arg5 = new HashMap(v3);
}
long v0 = System.currentTimeMillis();
byte[] v1 = InnoSecureUtils.secureSo(arg4, c.a(arg4, arg5, c.a(arg5, v0), v0), com.jifen.open.biz.login.a.a.a().h());
String v0_1 = "";
if(v1 != null) {
v0_1 = Base64.encodeToString(v1, 2);
}
HashMap v1_1 = new HashMap(v3);
v1_1.put("qdata", v0_1);
v1_1.put("app_id", com.jifen.open.biz.login.a.a.a().b());
return n.a(v1_1);
}
private static String a(Context arg3, HashMap arg4, String arg5, long arg6) {
HashMap v0 = new HashMap(16);
v0.put("app_id", com.jifen.open.biz.login.a.a.a().b());
v0.put("time", Long.valueOf(arg6));
v0.put("sign", arg5);
v0.putAll(c.b(arg3, v0));
arg4.put("public_params", v0);
return n.a(arg4);
}
private static String a(HashMap arg5, long arg6) {
ArrayList v0 = new ArrayList(arg5.keySet());
Collections.sort(((List)v0), new Comparator() {
public int a(String arg3, String arg4) {
return arg3.toLowerCase().compareTo(arg4.toLowerCase());
}
public int compare(Object arg2, Object arg3) {
return this.a(((String)arg2), ((String)arg3));
}
});
StringBuilder v1 = new StringBuilder();
Iterator v2 = ((List)v0).iterator();
while(v2.hasNext()) {
Object v0_1 = arg5.get(v2.next());
if((v0_1 instanceof Boolean)) {
int v0_2 = ((Boolean)v0_1).booleanValue() ? 1 : 0;
v1.append(v0_2);
}
else {
v1.append(v0_1);
}
v1.append("#");
}
v1.append(com.jifen.open.biz.login.a.a.a().b());
v1.append("#");
v1.append(com.jifen.open.biz.login.a.a.a().c());
v1.append("#");
v1.append(arg6);
return com.jifen.framework.core.f.c.a(v1.toString());
}
public static void a(Context arg3, HashMap arg4, b arg5) {
c.a(com.jifen.open.biz.login.repository.b.d, null, c.a(arg3, arg4), arg5);
}
private static void a(String arg3, String arg4, String arg5, b arg6) {
a v0 = c.a();
if(v0 != null) {
v0.postString(arg3, null, arg5, new b(arg6) {
public void a() {
if(this.a != null) {
this.a.a();
}
}
public void a(Object arg1) {
this.a(((String)arg1));
}
public void a(String arg4) {
Object v0 = n.a(arg4, com.jifen.open.biz.login.repository.a.class);
if(v0 == null) {
if(this.a != null) {
this.a.a(new LoginApiException("网络返回异常,请稍后重试"));
}
}
else if(this.a != null) {
this.a.a(v0);
}
}
public void a(Throwable arg2) {
if(this.a != null) {
this.a.a(arg2);
}
}
});
}
}
private static void a(String arg3, String arg4, String arg5, b arg6, Class arg7) {
a v0 = c.a();
if(v0 != null) {
v0.postString(arg3, null, arg5, new b(arg7, arg6) {
public void a() {
if(this.b != null) {
this.b.a();
}
}
public void a(Object arg1) {
this.a(((String)arg1));
}
public void a(String arg4) {
Object v0 = n.a(arg4, new ParameterizedType() {
public Type[] getActualTypeArguments() {
return new Class[]{this.a.a};
}
public Type getOwnerType() {
return null;
}
public Type getRawType() {
return com.jifen.open.biz.login.repository.a.class;
}
});
if(v0 == null) {
if(this.b != null) {
this.b.a(new LoginApiException("网络返回异常,请稍后重试"));
}
}
else if(this.b != null) {
this.b.a(v0);
}
}
public void a(Throwable arg2) {
if(this.b != null) {
this.b.a(arg2);
}
}
});
}
}
private static HashMap b(Context arg3, HashMap arg4) {
arg4.put("app_version", d.a() + "");
arg4.put("app_version_name", d.b());
arg4.put("os", "android");
arg4.put("os_version", j.d());
arg4.put("tk", com.jifen.open.biz.login.e.a.a(arg3));
arg4.put("deviceCode", j.a(arg3));
arg4.put("network", r.a(arg3));
arg4.put("uuid", j.d(arg3));
return arg4;
} |
|