AI Chat v1.1.8版本的 MD5 值为:1bcdce875f86738c8cfbf1e5f4064353

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


package com.mbridge.msdk.a;

import android.content.Context;
import android.text.TextUtils;
import android.webkit.WebView;
import com.mbridge.msdk.MBridgeConstans;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.foundation.same.b.c;
import com.mbridge.msdk.foundation.same.b.e;
import com.mbridge.msdk.foundation.same.report.d;
import com.mbridge.msdk.foundation.tools.v;
import com.mbridge.msdk.foundation.tools.x;
import com.mbridge.msdk.out.MBConfiguration;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public final class b {
    public static void a(final Context context) {
        if (TextUtils.isEmpty(MBridgeConstans.OMID_JS_SERVICE_URL)) {
            MBridgeConstans.OMID_JS_SERVICE_CONTENT = "";
            new d(context).a("", "", "", "", "fetch OM failed, OMID_JS_SERVICE_URL null");
        } else if (context == null) {
        } else {
            try {
                new a(context.getApplicationContext()).get(0, MBridgeConstans.OMID_JS_SERVICE_URL, null, new com.mbridge.msdk.foundation.same.net.b.a() {
                    @Override
                    public final void a(final String str) {
                        MBridgeConstans.OMID_JS_SERVICE_CONTENT = str;
                        x.a("OMSDK", "fetch OMJSContent success, content = " + str);
                        new Thread(new Runnable() {
                            @Override
                            public final void run() {
                                try {
                                    File file = new File(e.b(c.MBRIDGE_OTHER), "/omsdk/om_js_content.txt");
                                    if (file.exists()) {
                                        file.delete();
                                    }
                                    v.a(str.getBytes(), file);
                                } catch (Exception e) {
                                    x.a("OMSDK", e.getMessage());
                                }
                            }
                        }).start();
                    }

                    @Override
                    public final void b(String str) {
                        x.a("OMSDK", "fetch OMJSContent failed, errorCode = " + str);
                        new d(context).a("", "", "", "", "fetch OM failed, request failed");
                    }
                });
            } catch (Exception e) {
                x.d("OMSDK", e.getMessage());
            }
        }
    }

    public static void b(final Context context) {
        if (TextUtils.isEmpty(MBridgeConstans.OMID_JS_H5_URL)) {
            MBridgeConstans.OMID_JS_H5_CONTENT = "";
            new d(context).a("", "", "", "", "fetch OM failed, OMID_JS_H5_URL null");
        } else if (context == null) {
        } else {
            try {
                new a(context.getApplicationContext()).get(0, MBridgeConstans.OMID_JS_H5_URL, null, new com.mbridge.msdk.foundation.same.net.b.a() {
                    @Override
                    public final void a(final String str) {
                        MBridgeConstans.OMID_JS_H5_CONTENT = str;
                        x.a("OMSDK", "fetch OMJSH5Content success, content = " + str);
                        new Thread(new Runnable() {
                            @Override
                            public final void run() {
                                try {
                                    File file = new File(e.b(c.MBRIDGE_OTHER), "/omsdk/om_js_h5_content.txt");
                                    if (file.exists()) {
                                        file.delete();
                                    }
                                    v.a(str.getBytes(), file);
                                } catch (Exception e) {
                                    x.a("OMSDK", e.getMessage());
                                }
                            }
                        }).start();
                    }

                    @Override
                    public final void b(String str) {
                        x.a("OMSDK", "fetch OMJSH5Content failed, errorCode = " + str);
                        new d(context).a("", "", "", "", "fetch OM H5 failed, request failed");
                    }
                });
            } catch (Exception e) {
                x.d("OMSDK", e.getMessage());
            }
        }
    }

    private static void c(Context context) {
        if (jd7.b()) {
            return;
        }
        jd7.a(context);
    }

    private static List<zd7> a(String str, Context context, String str2, String str3, String str4, String str5) {
        zd7 a;
        ArrayList arrayList = new ArrayList();
        try {
            JSONArray jSONArray = new JSONArray(str);
            if (str != null) {
                for (int i = 0; i < jSONArray.length(); i++) {
                    JSONObject optJSONObject = jSONArray.optJSONObject(i);
                    String optString = optJSONObject.optString("vkey", "");
                    URL url = new URL(optJSONObject.optString("et_url", ""));
                    String optString2 = optJSONObject.optString("verification_p", "");
                    if (TextUtils.isEmpty(optString2)) {
                        if (TextUtils.isEmpty(optString)) {
                            a = zd7.b(url);
                        } else {
                            a = zd7.b(url);
                        }
                    } else {
                        a = zd7.a(optString, url, optString2);
                    }
                    arrayList.add(a);
                }
            }
        } catch (IllegalArgumentException e) {
            x.d("OMSDK", e.getMessage());
            d dVar = new d(context);
            dVar.a(str2, str5, str3, str4, "failed, exception " + e.getMessage());
        } catch (MalformedURLException e2) {
            x.d("OMSDK", e2.getMessage());
            d dVar2 = new d(context);
            dVar2.a(str2, str5, str3, str4, "failed, exception " + e2.getMessage());
        } catch (JSONException e3) {
            x.d("OMSDK", e3.getMessage());
            d dVar3 = new d(context);
            dVar3.a(str2, str5, str3, str4, "failed, exception " + e3.getMessage());
        }
        return arrayList;
    }

    private static String b() {
        try {
            File file = new File(e.b(c.MBRIDGE_OTHER), "/omsdk/om_js_h5_content.txt");
            return file.exists() ? v.a(file) : "";
        } catch (Exception e) {
            x.a("OMSDK", e.getMessage());
            return "";
        }
    }

    public static nd7 a(Context context, WebView webView, String str, CampaignEx campaignEx) {
        if (TextUtils.isEmpty(MBridgeConstans.OMID_JS_SERVICE_CONTENT)) {
            MBridgeConstans.OMID_JS_SERVICE_CONTENT = a();
        }
        if (TextUtils.isEmpty(MBridgeConstans.OMID_JS_H5_CONTENT)) {
            MBridgeConstans.OMID_JS_H5_CONTENT = b();
        }
        if (!TextUtils.isEmpty(MBridgeConstans.OMID_JS_SERVICE_CONTENT) && !TextUtils.isEmpty(campaignEx.getOmid())) {
            rd7 rd7Var = rd7.DEFINED_BY_JAVASCRIPT;
            c(context);
            nd7 b = nd7.b(od7.a(rd7Var, ud7.BEGIN_TO_RENDER, wd7.JAVASCRIPT, (rd7Var == rd7.HTML_DISPLAY || rd7Var == rd7Var) ? wd7.NONE : wd7.NATIVE, false), pd7.a(xd7.a("Mintegral", MBConfiguration.SDK_VERSION), webView, null, null));
            b.d(webView);
            return b;
        }
        x.a("OMSDK", "createNativeAdSession: TextUtils.isEmpty(omid) = " + TextUtils.isEmpty(campaignEx.getOmid()) + " TextUtils.isEmpty(MIntegralConstans.OMID_JS_SERVICE_CONTENT) = " + TextUtils.isEmpty(MBridgeConstans.OMID_JS_SERVICE_CONTENT));
        new d(context).a(campaignEx.getRequestId(), campaignEx.getRequestIdNotice(), campaignEx.getId(), campaignEx.getCampaignUnitId(), "failed, OMID_JS_SERVICE_CONTENT null or omid null");
        return null;
    }

    public static nd7 a(Context context, boolean z, String str, String str2, String str3, String str4, String str5, String str6) {
        xd7 a;
        rd7 rd7Var;
        ud7 ud7Var;
        wd7 wd7Var;
        if (TextUtils.isEmpty(MBridgeConstans.OMID_JS_SERVICE_CONTENT)) {
            MBridgeConstans.OMID_JS_SERVICE_CONTENT = a();
        }
        nd7 nd7Var = null;
        if (!TextUtils.isEmpty(MBridgeConstans.OMID_JS_SERVICE_CONTENT) && !TextUtils.isEmpty(str)) {
            try {
                c(context);
                a = xd7.a("Mintegral", MBConfiguration.SDK_VERSION);
                rd7Var = rd7.NATIVE_DISPLAY;
                ud7Var = ud7.LOADED;
                wd7Var = wd7.NATIVE;
            } catch (IllegalArgumentException e) {
                e = e;
            } catch (Exception e2) {
                e = e2;
            }
            try {
                nd7Var = nd7.b(od7.a(rd7Var, ud7Var, wd7Var, z ? wd7.NONE : wd7Var, false), pd7.b(a, MBridgeConstans.OMID_JS_SERVICE_CONTENT, a(str, context, str2, str3, str4, str6), str5, str2));
                x.a("OMSDK", "adSession create success");
                return nd7Var;
            } catch (IllegalArgumentException e3) {
                e = e3;
                x.d("OMSDK", e.getMessage());
                d dVar = new d(context);
                dVar.a(str2, str6, str3, str4, "failed, exception " + e.getMessage());
                return nd7Var;
            } catch (Exception e4) {
                e = e4;
                x.d("OMSDK", e.getMessage());
                d dVar2 = new d(context);
                dVar2.a(str2, str6, str3, str4, "failed, exception " + e.getMessage());
                return nd7Var;
            }
        }
        x.a("OMSDK", "createNativeAdSession: TextUtils.isEmpty(omid) = " + TextUtils.isEmpty(str) + " TextUtils.isEmpty(MIntegralConstans.OMID_JS_SERVICE_CONTENT) = " + TextUtils.isEmpty(MBridgeConstans.OMID_JS_SERVICE_CONTENT));
        new d(context).a(str2, str6, str3, str4, "failed, OMID_JS_SERVICE_CONTENT null or omid null");
        return null;
    }

    private static String a() {
        try {
            return v.a(new File(e.b(c.MBRIDGE_OTHER), "/omsdk/om_js_content.txt"));
        } catch (Exception e) {
            x.a("OMSDK", e.getMessage());
            return "";
        }
    }

    public static String a(String str) {
        if (TextUtils.isEmpty(MBridgeConstans.OMID_JS_H5_CONTENT)) {
            MBridgeConstans.OMID_JS_H5_CONTENT = b();
        }
        return TextUtils.isEmpty(str) ? str : str.replace("/*OMSDK_INSERT_HERE*/", MBridgeConstans.OMID_JS_H5_CONTENT).replace("[INSERT RESOURCE URL]", "https://s3-us-west-2.amazonaws.com/omsdk-files/compliance-js/omid-validation-verification-script-v1.js");
    }
}