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

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


package com.anythink.expressad.advanced.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.bridge.CommonJSBridgeImpUtils;
import com.anythink.expressad.atsignalcommon.windvane.j;
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 NativeAdvancedJsUtils {
    public static final String f3888a = "onViewDisappeared";
    public static final String f3889b = "onViewAppeared";
    public static final String f3890c = "onSystemDestory";
    public static final String f3891d = "setStyleList";
    public static final String f3892e = "params";
    public static final String f3893f = "showCloseButton";
    public static final String f3894g = "hideCloseButton";
    public static final String f3895h = "setVolume";
    public static final String f3896i = "mute";
    public static final String j = "setVideoPlayMode";
    public static final String k = "autoPlay";
    public static final String l = "onNetstatChanged";
    public static final String m = "netstat";
    public static final String n = "sq";
    public static final String o = "thirdPartyCalled";
    public static final String p = "action";
    public static final String q = "params";
    public static String r = "NativeAdvancedJsUtils";

    public static void callbackSuccess(Object obj) {
        try {
            JSONObject jSONObject = new JSONObject();
            jSONObject.put("code", CommonJSBridgeImpUtils.f3953b);
            j.a().a(obj, Base64.encodeToString(jSONObject.toString().getBytes(), 2));
        } catch (Exception e2) {
            o.a(r, e2.getMessage());
        }
    }

    public static void fireOnJSBridgeConnected(WebView webView) {
        o.d(r, "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(r, 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(r, "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(r, "VideoPath null");
                                            jSONObject5.put("path", str7);
                                            jSONObject5.put("path4Web", str7);
                                            str3 = str7;
                                        } else {
                                            str3 = str7;
                                            o.a(r, "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(r, "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(r, "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(r, 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(r, e.getMessage());
                }
            } catch (Throwable th3) {
                th = th3;
                str = obj2;
            }
        } catch (Throwable th4) {
            th = th4;
            str = "message";
            str2 = "code";
        }
    }

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

    public static void sendThirdToH5(WebView webView, String str, String str2, Object obj) {
        try {
            JSONObject jSONObject = new JSONObject();
            jSONObject.put(n, 1);
            jSONObject.put(p, str);
            if (!TextUtils.isEmpty(str2)) {
                JSONObject jSONObject2 = new JSONObject();
                jSONObject2.put(str2, obj);
                jSONObject.put("params", jSONObject2);
            }
            if (TextUtils.isEmpty(str2) && obj != null) {
                jSONObject.put("params", obj);
            }
            j.a();
            j.a(webView, o, Base64.encodeToString(jSONObject.toString().getBytes(), 2));
        } catch (JSONException e2) {
            e2.printStackTrace();
        }
    }
}