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

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


package com.anythink.expressad.mbbanner.a.a;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Base64;
import com.anythink.core.common.a.i;
import com.anythink.core.common.b.n;
import com.anythink.expressad.atsignalcommon.bridge.CommonBannerJSBridgeImp;
import com.anythink.expressad.atsignalcommon.bridge.CommonJSBridgeImpUtils;
import com.anythink.expressad.atsignalcommon.mraid.CallMraidJS;
import com.anythink.expressad.atsignalcommon.windvane.j;
import com.anythink.expressad.foundation.g.a.f;
import com.anythink.expressad.foundation.h.o;
import com.anythink.expressad.foundation.h.s;
import java.io.File;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public final class c extends CommonBannerJSBridgeImp {
    public static final String f6505b = "BannerJSBridgeImpl";
    public WeakReference<Context> f6506c;
    public List<com.anythink.expressad.foundation.d.c> f6507d;
    public String f6508e;
    public String f6509f;
    public int f6510g;
    public com.anythink.expressad.mbbanner.a.c.a f6511h;
    public b f6512i;
    public boolean j = false;

    public c(Context context, String str, String str2) {
        this.f6508e = str;
        this.f6509f = str2;
        this.f6506c = new WeakReference<>(context);
    }

    public final void a(com.anythink.expressad.mbbanner.a.c.a aVar) {
        if (aVar != null) {
            this.f6511h = aVar;
        }
    }

    @Override
    public final void click(Object obj, String str) {
        o.d(f6505b, com.anythink.expressad.foundation.d.c.ca);
        try {
            if (this.f6507d == null) {
                return;
            }
            com.anythink.expressad.foundation.d.c cVar = null;
            if (this.f6507d != null && this.f6507d.size() > 0) {
                cVar = this.f6507d.get(0);
            }
            if (TextUtils.isEmpty(str)) {
                return;
            }
            try {
                JSONObject a2 = com.anythink.expressad.foundation.d.c.a(cVar);
                JSONObject jSONObject = new JSONObject(str).getJSONObject("pt");
                Iterator<String> keys = jSONObject.keys();
                while (keys.hasNext()) {
                    String next = keys.next();
                    a2.put(next, jSONObject.getString(next));
                }
                com.anythink.expressad.foundation.d.c b2 = com.anythink.expressad.foundation.d.c.b(a2);
                String optString = a2.optString("unitId");
                if (!TextUtils.isEmpty(optString)) {
                    b2.l(optString);
                }
                cVar = b2;
            } catch (JSONException e2) {
                e2.printStackTrace();
            }
            if (this.f6511h != null) {
                this.f6511h.a(cVar);
            }
        } catch (Throwable th) {
            o.b(f6505b, com.anythink.expressad.foundation.d.c.ca, th);
        }
    }

    @Override
    public final void close() {
        o.d(f6505b, com.anythink.expressad.foundation.d.c.cf);
        try {
            if (this.f6511h != null) {
                this.f6511h.b();
            }
        } catch (Throwable th) {
            o.b(f6505b, com.anythink.expressad.foundation.d.c.cf, th);
        }
    }

    @Override
    public final void expand(String str, boolean z) {
        Context context;
        try {
            String str2 = "";
            if (getMraidCampaign() != null) {
                if (TextUtils.isEmpty(getMraidCampaign().q())) {
                    str2 = getMraidCampaign().p();
                } else {
                    str2 = "file:////" + getMraidCampaign().q();
                }
            }
            Bundle bundle = new Bundle();
            if (TextUtils.isEmpty(str)) {
                str = str2;
            }
            bundle.putString(com.anythink.expressad.foundation.d.c.am, str);
            bundle.putBoolean("shouldUseCustomClose", z);
            if (this.f6506c != null && (context = this.f6506c.get()) != null) {
                if (this.f6512i != null && this.f6512i.isShowing()) {
                    return;
                }
                b bVar = new b(context, bundle, this.f6511h);
                this.f6512i = bVar;
                bVar.a(this.f6509f, this.f6507d);
                this.f6512i.show();
            }
            if (this.f6511h != null) {
                this.f6511h.a(true);
            }
        } catch (Throwable th) {
            o.b(f6505b, "expand", th);
        }
    }

    @Override
    public final void getFileInfo(Object obj, String str) {
        if (TextUtils.isEmpty(str)) {
            CommonJSBridgeImpUtils.callbackExcep(obj, "params is empty");
            return;
        }
        try {
            a(obj, new JSONObject(str));
        } catch (Throwable th) {
            o.a(f6505b, th.getMessage());
        }
    }

    @Override
    public final com.anythink.expressad.foundation.d.c getMraidCampaign() {
        List<com.anythink.expressad.foundation.d.c> list = this.f6507d;
        if (list == null || list.size() <= 0) {
            return null;
        }
        return this.f6507d.get(0);
    }

    @Override
    public final void init(Object obj, String str) {
        o.d(f6505b, "BANNER INIT INVOKE");
        try {
            JSONObject jSONObject = new JSONObject();
            com.anythink.expressad.foundation.h.c cVar = new com.anythink.expressad.foundation.h.c(n.a().f());
            JSONObject jSONObject2 = new JSONObject();
            jSONObject2.put("dev_close_state", this.f6510g);
            jSONObject.put("sdkSetting", jSONObject2);
            jSONObject.put("device", cVar.a());
            jSONObject.put("campaignList", com.anythink.expressad.foundation.d.c.b(this.f6507d));
            com.anythink.expressad.d.b.a();
            com.anythink.expressad.d.c c2 = com.anythink.expressad.d.b.c(com.anythink.expressad.foundation.b.a.b().e(), this.f6509f);
            if (c2 == null) {
                c2 = com.anythink.expressad.d.c.c(this.f6509f);
            }
            if (!TextUtils.isEmpty(this.f6508e)) {
                c2.e(this.f6508e);
            }
            jSONObject.put("unitSetting", c2.s());
            com.anythink.expressad.d.b.a();
            com.anythink.expressad.d.b.a(com.anythink.expressad.foundation.b.a.b().e());
            jSONObject.put("appSetting", new JSONObject());
            j.a().a(obj, Base64.encodeToString(jSONObject.toString().getBytes(), 2));
        } catch (Throwable th) {
            o.b(f6505b, "init", th);
        }
    }

    @Override
    public final void open(String str) {
        o.d(f6505b, "open");
        try {
            o.d(f6505b, str);
            if (this.f6507d.size() > 1) {
                n.a().f().startActivity(new Intent("android.intent.action.VIEW", Uri.parse(str)));
                str = null;
            }
            if (this.f6511h != null) {
                this.f6511h.a(true, str);
            }
        } catch (Throwable th) {
            o.b(f6505b, "open", th);
        }
    }

    @Override
    public final void readyStatus(Object obj, String str) {
        if (obj != null) {
            try {
                int optInt = new JSONObject(str).optInt("isReady", 1);
                j.a().a(obj, CommonJSBridgeImpUtils.codeToJsonString(0));
                if (this.f6511h != null) {
                    this.f6511h.b(optInt);
                }
            } catch (Throwable th) {
                o.b(f6505b, "readyStatus", th);
            }
        }
    }

    @Override
    public final void sendImpressions(Object obj, String str) {
        o.a(f6505b, "sendImpressions:".concat(String.valueOf(str)));
        try {
            if (TextUtils.isEmpty(str)) {
                return;
            }
            JSONArray jSONArray = new JSONArray(str);
            ArrayList arrayList = new ArrayList();
            for (int i2 = 0; i2 < jSONArray.length(); i2++) {
                String string = jSONArray.getString(i2);
                for (com.anythink.expressad.foundation.d.c cVar : this.f6507d) {
                    if (cVar.aZ().equals(string)) {
                        f.a(this.f6509f, cVar, f.f6078e);
                        arrayList.add(string);
                    }
                }
            }
        } catch (Throwable th) {
            o.b(f6505b, "sendImpressions", th);
        }
    }

    @Override
    public final void toggleCloseBtn(Object obj, String str) {
        o.d(f6505b, "toggleCloseBtn");
        try {
            if (TextUtils.isEmpty(str)) {
                return;
            }
            int optInt = new JSONObject(str).optInt(CallMraidJS.f3970b);
            if (this.f6511h != null) {
                this.f6511h.a(optInt);
            }
        } catch (Throwable th) {
            o.b(f6505b, "toggleCloseBtn", th);
        }
    }

    @Override
    public final void triggerCloseBtn(Object obj, String str) {
        o.d(f6505b, "triggerCloseBtn");
        try {
            if (TextUtils.isEmpty(str)) {
                return;
            }
            new JSONObject(str).optString(CallMraidJS.f3970b);
            if (this.f6511h != null) {
                this.f6511h.a();
            }
            j.a().a(obj, CommonJSBridgeImpUtils.codeToJsonString(0));
        } catch (Throwable th) {
            o.b(f6505b, "triggerCloseBtn", th);
            j.a().a(obj, CommonJSBridgeImpUtils.codeToJsonString(-1));
        }
    }

    @Override
    public final void unload() {
        close();
    }

    @Override
    public final void useCustomClose(boolean z) {
        int i2 = z ? 2 : 1;
        try {
            if (this.f6511h != null) {
                this.f6511h.a(i2);
            }
        } catch (Throwable th) {
            o.b(f6505b, "useCustomClose", th);
        }
    }

    public final void a(List<com.anythink.expressad.foundation.d.c> list) {
        this.f6507d = list;
    }

    public final void a(int i2) {
        this.f6510g = i2;
    }

    public final void a() {
        if (this.f6511h != null) {
            this.f6511h = null;
        }
        if (this.f6512i != null) {
            this.f6512i = null;
        }
    }

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