恐 怖 老 奶 奶1破 解 版 中 文 版 无 敌 版 v4.15.00版本的 MD5 值为:2c4218ea002b12a6cce81f33a9f0144d

以下内容为反编译后的 SplashJsUtils.java 源代码,内容仅作参考


package com.anythink.expressad.splash.js;

import android.text.TextUtils;
import android.util.Base64;
import android.webkit.WebView;
import com.anythink.core.common.a.i;
import com.anythink.expressad.atsignalcommon.windvane.j;
import com.anythink.expressad.foundation.d.c;
import com.anythink.expressad.foundation.g.a.f;
import com.anythink.expressad.foundation.h.o;
import com.anythink.expressad.foundation.h.s;
import com.anythink.expressad.videocommon.b.a;
import java.io.File;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public class SplashJsUtils {
    public static final String f7122a = "onSystemPause";
    public static final String f7123b = "onSystemResume";
    public static final String f7124c = "onSystemDestory";
    public static String f7125d = "SplashJsUtils";
    public static int f7126e = 0;
    public static int f7127f = 1;

    public static void b(String str, c cVar) {
        if (f.o == null || TextUtils.isEmpty(cVar.aZ())) {
            return;
        }
        f.a(str, cVar, f.f6079f);
    }

    public static void callbackExcep(Object obj, String str) {
        try {
            JSONObject jSONObject = new JSONObject();
            jSONObject.put("code", f7127f);
            jSONObject.put("message", str);
            jSONObject.put("data", new JSONObject());
            j.a().a(obj, Base64.encodeToString(jSONObject.toString().getBytes(), 2));
        } catch (Exception e2) {
            o.a(f7125d, e2.getMessage());
        }
    }

    public static void callbackSuccess(Object obj, String str) {
        try {
            JSONObject jSONObject = new JSONObject();
            jSONObject.put("code", f7126e);
            JSONObject jSONObject2 = new JSONObject();
            jSONObject2.put("id", str);
            jSONObject.put("data", jSONObject2);
            j.a().a(obj, Base64.encodeToString(jSONObject.toString().getBytes(), 2));
        } catch (Exception e2) {
            callbackExcep(obj, e2.getMessage());
            o.a(f7125d, e2.getMessage());
        }
    }

    public static String codeToJsonString(int i2) {
        try {
            JSONObject jSONObject = new JSONObject();
            jSONObject.put("code", i2);
            String jSONObject2 = jSONObject.toString();
            return !TextUtils.isEmpty(jSONObject2) ? Base64.encodeToString(jSONObject2.getBytes(), 2) : "";
        } catch (Throwable unused) {
            o.d(f7125d, "code to string is error");
            return "";
        }
    }

    public static void fireOnJSBridgeConnected(WebView webView) {
        o.d(f7125d, "fireOnJSBridgeConnected");
        j.a();
        j.b(webView);
    }

    public static void getFileInfo(Object obj, JSONObject jSONObject) {
        String str;
        String str2;
        Object obj2;
        String str3;
        String str4;
        JSONArray jSONArray;
        String str5;
        String str6;
        String str7 = "";
        JSONObject jSONObject2 = new JSONObject();
        String str8 = "message";
        String str9 = "code";
        int i2 = 1;
        if (jSONObject == null) {
            try {
                jSONObject2.put("code", 1);
                jSONObject2.put("message", "params is null");
                j.a().a(obj, Base64.encodeToString(jSONObject2.toString().getBytes(), 2));
                return;
            } catch (JSONException e2) {
                o.a(f7125d, e2.getMessage());
                return;
            }
        }
        try {
            jSONObject2.put("code", 0);
            jSONObject2.put("message", "");
            str2 = jSONObject.getJSONArray("resource");
            try {
                if (str2 != 0) {
                    try {
                        if (str2.length() > 0) {
                            JSONArray jSONArray2 = new JSONArray();
                            int length = str2.length();
                            int i3 = 0;
                            JSONArray jSONArray3 = str2;
                            while (i3 < length) {
                                JSONObject jSONObject3 = jSONArray3.getJSONObject(i3);
                                String optString = jSONObject3.optString("ref", str7);
                                int i4 = jSONObject3.getInt("type");
                                JSONObject jSONObject4 = new JSONObject();
                                if (i4 == i2 && !TextUtils.isEmpty(optString)) {
                                    JSONObject jSONObject5 = new JSONObject();
                                    a.a();
                                    i b2 = a.b(optString);
                                    if (b2 != null) {
                                        jSONArray = jSONArray3;
                                        o.a(f7125d, "VideoBean not null");
                                        jSONObject5.put("type", 1);
                                        str4 = str8;
                                        str5 = str9;
                                        jSONObject5.put("videoDataLength", b2.d());
                                        String b3 = b2.b();
                                        if (TextUtils.isEmpty(b3)) {
                                            o.a(f7125d, "VideoPath null");
                                            jSONObject5.put("path", str7);
                                            jSONObject5.put("path4Web", str7);
                                            str3 = str7;
                                        } else {
                                            str3 = str7;
                                            o.a(f7125d, "VideoPath not null");
                                            jSONObject5.put("path", b3);
                                            jSONObject5.put("path4Web", b3);
                                        }
                                        if (b2.c() == 100) {
                                            jSONObject5.put("downloaded", 1);
                                        } else {
                                            jSONObject5.put("downloaded", 0);
                                        }
                                        jSONObject4.put(optString, jSONObject5);
                                        jSONArray2.put(jSONObject4);
                                    } else {
                                        str3 = str7;
                                        str4 = str8;
                                        jSONArray = jSONArray3;
                                        str5 = str9;
                                        o.a(f7125d, "VideoBean null");
                                    }
                                } else {
                                    str3 = str7;
                                    str4 = str8;
                                    jSONArray = jSONArray3;
                                    str5 = str9;
                                    if (i4 == 2 && !TextUtils.isEmpty(optString)) {
                                        JSONObject jSONObject6 = new JSONObject();
                                        jSONObject6.put("type", 2);
                                        jSONObject6.put("path", com.anythink.expressad.videocommon.b.i.a().c(optString) == null ? str3 : com.anythink.expressad.videocommon.b.i.a().c(optString));
                                        jSONObject4.put(optString, jSONObject6);
                                        jSONArray2.put(jSONObject4);
                                    } else if (i4 == 3 && !TextUtils.isEmpty(optString)) {
                                        File file = new File(optString);
                                        if (file.exists() && file.isFile() && file.canRead()) {
                                            o.a(f7125d, "getFileInfo Mraid file ".concat(String.valueOf(optString)));
                                            str6 = "file:////".concat(String.valueOf(optString));
                                        } else {
                                            str6 = str3;
                                        }
                                        JSONObject jSONObject7 = new JSONObject();
                                        jSONObject7.put("type", 3);
                                        jSONObject7.put("path", str6);
                                        jSONObject4.put(optString, jSONObject7);
                                        jSONArray2.put(jSONObject4);
                                    } else if (i4 == 4 && !TextUtils.isEmpty(optString)) {
                                        JSONObject jSONObject8 = new JSONObject();
                                        jSONObject8.put("type", 4);
                                        jSONObject8.put("path", s.a(optString) == null ? str3 : s.a(optString));
                                        jSONObject4.put(optString, jSONObject8);
                                        jSONArray2.put(jSONObject4);
                                    }
                                }
                                i3++;
                                str9 = str5;
                                str8 = str4;
                                str7 = str3;
                                i2 = 1;
                                jSONArray3 = jSONArray;
                            }
                            jSONObject2.put("resource", jSONArray2);
                            j.a().a(obj, Base64.encodeToString(jSONObject2.toString().getBytes(), 2));
                            return;
                        }
                    } catch (Throwable th) {
                        th = th;
                        str2 = str9;
                        str = str8;
                        try {
                            jSONObject2.put(str2, 1);
                            jSONObject2.put(str, th.getLocalizedMessage());
                            j.a().a(obj, Base64.encodeToString(jSONObject2.toString().getBytes(), 2));
                            return;
                        } catch (JSONException e3) {
                            o.a(f7125d, e3.getMessage());
                            return;
                        }
                    }
                }
                str2 = "code";
                str = 1;
                try {
                    try {
                        jSONObject2.put((String) str2, 1);
                    } catch (Throwable th2) {
                        th = th2;
                        jSONObject2.put(str2, 1);
                        jSONObject2.put(str, th.getLocalizedMessage());
                        j.a().a(obj, Base64.encodeToString(jSONObject2.toString().getBytes(), 2));
                        return;
                    }
                } catch (JSONException e4) {
                    e = e4;
                }
                try {
                    jSONObject2.put("message", "resource is null");
                    j.a().a(obj, Base64.encodeToString(jSONObject2.toString().getBytes(), 2));
                } catch (JSONException e5) {
                    e = e5;
                    o.a(f7125d, e.getMessage());
                }
            } catch (Throwable th3) {
                th = th3;
                str = obj2;
            }
        } catch (Throwable th4) {
            th = th4;
            str = "message";
            str2 = "code";
        }
    }

    public static void increaseOfferFrequence(Object obj, JSONObject jSONObject) {
        try {
            JSONObject optJSONObject = jSONObject.optJSONObject("data");
            if (optJSONObject == null) {
                callbackExcep(obj, "data is empty");
                return;
            }
            c b2 = c.b(optJSONObject);
            if (b2 == null) {
                callbackExcep(obj, "data camapign is empty");
                return;
            }
            updateFrequence(b2);
            callbackSuccess(obj, "");
        } catch (Throwable th) {
            callbackExcep(obj, th.getMessage());
        }
    }

    public static void sendEventToH5(WebView webView, String str, String str2) {
        j.a();
        j.a(webView, str, str2);
    }

    public static void updateFrequence(final c cVar) {
        new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    SplashJsUtils.a(c.this.K(), c.this);
                } catch (Throwable th) {
                    o.b(SplashJsUtils.f7125d, th.getMessage(), th);
                }
            }
        }).start();
    }

    public static void a(String str, c cVar) {
        if (f.o == null || TextUtils.isEmpty(cVar.aZ())) {
            return;
        }
        f.a(str, cVar, f.f6079f);
    }
}