新浪彩票 v0.96.37版本的 MD5 值为:0c7ddce345383506e2959f5d75bdceab
以下内容为反编译后的 C3458.java 源代码,内容仅作参考
package ewUlBWKNoApzb1Mnhgn4.HXk9MjYIhUuuFvxoWclq.tuTnrQl15gwcjciRsKuT;
import android.os.SystemClock;
import android.text.TextUtils;
import android.webkit.WebView;
import com.android.internal.http.multipart.Part;
import com.meizu.cloud.pushsdk.notification.model.NotifyType;
import com.netease.nimlib.jsbridge.interfaces.IJavaReplyToJsObject;
import java.lang.reflect.Method;
import java.util.HashMap;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import v4rqru3PdyhrqRZkuHAG.u1YzWeLnRZsoxmkTYWkw.O6AgNJgW1GmSRcLCckPu.C7101;
public class C3458 {
private static final String f13353 = "args";
private static final String f13354 = "JsCallJava";
private static final String[] f13355 = {"getClass", "hashCode", "notify", "notifyAll", "equals", "toString", "wait"};
private static final String f13356 = "{\"CODE\": %d, \"result\": %s}";
private static final String f13357 = "types";
private static final String f13358 = "AgentWeb:";
private static final String f13359 = "method";
private static final String f13360 = "obj";
private HashMap<String, Method> f13361;
private Object f13362;
private String f13363;
private String f13364;
public C3458(Object obj, String str) {
try {
if (!TextUtils.isEmpty(str)) {
this.f13362 = obj;
this.f13364 = str;
this.f13361 = new HashMap<>();
Method[] methods = this.f13362.getClass().getMethods();
StringBuilder sb = new StringBuilder("javascript:(function(b){console.log(\"");
sb.append(this.f13364);
sb.append(" init begin\");var a={queue:[],callback:function(){var d=Array.prototype.slice.call(arguments,0);var c=d.shift();var e=d.shift();this.queue[c].apply(this,d);if(!e){delete this.queue[c]}}};");
for (Method method : methods) {
String str2 = "method:" + method;
String m15567 = m15567(method);
if (m15567 != null) {
this.f13361.put(m15567, method);
sb.append(String.format("a.%s=", method.getName()));
}
}
sb.append("function(){var f=Array.prototype.slice.call(arguments,0);if(f.length<1){throw\"");
sb.append(this.f13364);
sb.append(" call result, message:miss method name\"}var e=[];for(var h=1;h<f.length;h++){var c=f[h];var j=typeof c;e[e.length]=j;if(j==\"function\"){var d=a.queue.length;a.queue[d]=c;f[h]=d}}var k = new Date().getTime();var l = f.shift();var m=prompt('");
sb.append(f13358);
sb.append("'+JSON.stringify(");
sb.append(m15571("'" + this.f13364 + "'", NotifyType.LIGHTS, "e", "f"));
sb.append("));console.log(\"invoke \"+l+\", time: \"+(new Date().getTime()-k));var g=JSON.parse(m);if(g.CODE!=200){throw\"");
sb.append(this.f13364);
sb.append(" call result, CODE:\"+g.CODE+\", message:\"+g.result}return g.result};Object.getOwnPropertyNames(a).forEach(function(d){var c=a[d];if(typeof c===\"function\"&&d!==\"callback\"){a[d]=function(){return c.apply(a,[d].concat(Array.prototype.slice.call(arguments,0)))}}});b.");
sb.append(this.f13364);
sb.append("=a;console.log(\"");
sb.append(this.f13364);
sb.append(" init end\")})(window)");
this.f13363 = sb.toString();
sb.setLength(0);
return;
}
throw new Exception("injected name can not be null");
} catch (Exception e) {
if (C3471.m15594()) {
String str3 = "init js result:" + e.getMessage();
}
}
}
private String m15566(JSONObject jSONObject, int i, Object obj, long j) {
String valueOf;
if (obj == null) {
valueOf = "null";
} else if (obj instanceof String) {
valueOf = Part.QUOTE.concat(String.valueOf(((String) obj).replace(Part.QUOTE, "\\\""))).concat(Part.QUOTE);
} else {
valueOf = String.valueOf(obj);
}
String format = String.format(f13356, Integer.valueOf(i), valueOf);
if (C3471.m15594()) {
String str = "call time: " + (SystemClock.uptimeMillis() - j) + ", request: " + jSONObject + ", result:" + format;
}
return format;
}
private String m15567(Method method) {
String name = method.getName();
Class<?>[] parameterTypes = method.getParameterTypes();
for (String str : f13355) {
if (str.equals(name)) {
if (C3471.m15594()) {
String str2 = "method(" + name + ") is unsafe, will be pass";
return null;
}
return null;
}
}
for (Class<?> cls : parameterTypes) {
if (cls == String.class) {
name = name + "_S";
} else if (cls == Integer.TYPE || cls == Long.TYPE || cls == Float.TYPE || cls == Double.TYPE) {
name = name + "_N";
} else if (cls == Boolean.TYPE) {
name = name + "_B";
} else if (cls == JSONObject.class) {
name = name + "_O";
} else if (cls == C3465.class) {
name = name + "_F";
} else {
name = name + "_P";
}
}
return name;
}
public static JSONObject m15568(String str) {
try {
return new JSONObject(str.substring(9));
} catch (JSONException e) {
e.printStackTrace();
return new JSONObject();
}
}
public static boolean m15569(String str) {
return str.startsWith(f13358);
}
public static String m15570(JSONObject jSONObject) {
return jSONObject.optString("obj");
}
private static String m15571(String str, String str2, String str3, String str4) {
return "{obj:" + str + ",method:" + str2 + "," + f13357 + ":" + str3 + "," + f13353 + ":" + str4 + "}";
}
public String m15572() {
return this.f13363;
}
public String m15573(WebView webView, JSONObject jSONObject) {
long uptimeMillis = C3471.m15594() ? SystemClock.uptimeMillis() : 0L;
if (jSONObject != null) {
try {
String string = jSONObject.getString("method");
JSONArray jSONArray = jSONObject.getJSONArray(f13357);
JSONArray jSONArray2 = jSONObject.getJSONArray(f13353);
int length = jSONArray.length();
Object[] objArr = new Object[length];
int i = 0;
for (int i2 = 0; i2 < length; i2++) {
String optString = jSONArray.optString(i2);
Object obj = null;
if ("string".equals(optString)) {
string = string + "_S";
if (!jSONArray2.isNull(i2)) {
obj = jSONArray2.getString(i2);
}
objArr[i2] = obj;
} else if ("number".equals(optString)) {
string = string + "_N";
i = (i * 10) + i2 + 1;
} else if ("boolean".equals(optString)) {
string = string + "_B";
objArr[i2] = Boolean.valueOf(jSONArray2.getBoolean(i2));
} else if (IJavaReplyToJsObject.RESPONSE_OBJECT_INFO.equals(optString)) {
string = string + "_O";
if (!jSONArray2.isNull(i2)) {
obj = jSONArray2.getJSONObject(i2);
}
objArr[i2] = obj;
} else if ("function".equals(optString)) {
string = string + "_F";
objArr[i2] = new C3465(webView, this.f13364, jSONArray2.getInt(i2));
} else {
string = string + "_P";
}
}
Method method = this.f13361.get(string);
if (method == null) {
return m15566(jSONObject, 500, "not found method(" + string + ") with valid parameters", uptimeMillis);
}
if (i > 0) {
Class<?>[] parameterTypes = method.getParameterTypes();
while (i > 0) {
int i3 = (i - ((i / 10) * 10)) - 1;
Class<?> cls = parameterTypes[i3];
if (cls == Integer.TYPE) {
objArr[i3] = Integer.valueOf(jSONArray2.getInt(i3));
} else if (cls == Long.TYPE) {
objArr[i3] = Long.valueOf(Long.parseLong(jSONArray2.getString(i3)));
} else {
objArr[i3] = Double.valueOf(jSONArray2.getDouble(i3));
}
i /= 10;
}
}
return m15566(jSONObject, 200, method.invoke(this.f13362, objArr), uptimeMillis);
} catch (Exception e) {
C3471.m15590(f13354, C7101.f24863, e);
if (e.getCause() != null) {
return m15566(jSONObject, 500, "method execute result:" + e.getCause().getMessage(), uptimeMillis);
}
return m15566(jSONObject, 500, "method execute result:" + e.getMessage(), uptimeMillis);
}
}
return m15566(jSONObject, 500, "call data empty", uptimeMillis);
}
}