导航菜单

页面标题

页面副标题

小柿子 v1.3.8 - b.java 源代码

正在查看: 小柿子 v1.3.8 应用的 b.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.mbridge.msdk.click;

import android.content.Context;
import android.content.Intent;
import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils;
import com.kwad.sdk.core.response.model.CouponInfo;
import com.kwai.video.player.KsMediaMeta;
import com.mbridge.msdk.MBridgeConstans;
import com.mbridge.msdk.click.entity.JumpLoaderResult;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.foundation.tools.ab;
import com.mbridge.msdk.foundation.tools.af;
import com.mbridge.msdk.foundation.tools.aj;
import com.mbridge.msdk.foundation.tools.ap;
import com.mbridge.msdk.foundation.tools.ar;
import com.mbridge.msdk.out.Campaign;
import com.mbridge.msdk.out.Frame;
import com.mbridge.msdk.out.LoadingActivity;
import com.mbridge.msdk.out.NativeListener;
import com.mbridge.msdk.scheme.applet.AppletSchemeCallBack;
import com.mbridge.msdk.scheme.applet.AppletsModel;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

public final class b {
    public static boolean a = false;
    public static Map<String, Long> b = new HashMap();
    public static Set<String> c = new HashSet();
    private String d;
    private long e;
    private com.mbridge.msdk.foundation.db.j f;
    private Context g;
    private f h;
    private com.mbridge.msdk.foundation.same.report.i j;
    private com.mbridge.msdk.c.g k;
    private boolean l;
    private boolean o;
    private k p;
    private NativeListener.NativeTrackingListener i = null;
    private boolean m = false;
    private boolean n = true;

    public b(Context context, String str) {
        this.f = null;
        this.g = null;
        com.mbridge.msdk.c.g b2 = com.mbridge.msdk.c.h.a().b(str);
        this.k = b2;
        if (b2 == null) {
            com.mbridge.msdk.c.h.a();
            this.k = com.mbridge.msdk.c.i.a();
        }
        this.l = this.k.aJ();
        Context applicationContext = context.getApplicationContext();
        this.g = applicationContext;
        this.d = str;
        if (this.f == null) {
            this.f = com.mbridge.msdk.foundation.db.j.a(applicationContext);
        }
        this.j = new com.mbridge.msdk.foundation.same.report.i(this.g);
    }

    public static String a(int i) {
        return i != 1 ? i != 2 ? i != 3 ? i != 4 ? "" : "2000138" : "2000139" : "2000137" : "2000136";
    }

    public static void f(b bVar) {
        try {
            Intent intent = new Intent();
            intent.setAction("ExitApp");
            bVar.g.sendBroadcast(intent);
        } catch (Exception e) {
            if (MBridgeConstans.DEBUG) {
                af.b("CommonClickControl", "Exception", e);
            }
        }
    }

    public static void b(CampaignEx campaignEx, Context context, String str) {
        c.b(campaignEx, context, str);
    }

    private boolean c(CampaignEx campaignEx) {
        Long l;
        if (campaignEx == null) {
            return true;
        }
        try {
            if (2 != campaignEx.getLinkType() && 3 != campaignEx.getLinkType()) {
                return true;
            }
            String id = campaignEx.getId();
            Map<String, Long> map = b;
            if (map == null) {
                return true;
            }
            if (map.containsKey(id) && (l = b.get(id)) != null) {
                if (l.longValue() > System.currentTimeMillis() || c.contains(campaignEx.getId())) {
                    return false;
                }
            }
            b.put(campaignEx.getId(), Long.valueOf(System.currentTimeMillis() + (campaignEx.getClickTimeOutInterval() * 1000)));
            return true;
        } catch (Exception e) {
            if (!MBridgeConstans.DEBUG) {
                return true;
            }
            e.printStackTrace();
            return true;
        }
    }

    private int b() {
        try {
            com.mbridge.msdk.c.g gVar = this.k;
            if (gVar != null) {
                return gVar.X();
            }
            return 1;
        } catch (Exception e) {
            e.printStackTrace();
            return 1;
        }
    }

    public static void a(Context context, CampaignEx campaignEx, String str, String str2, boolean z2, boolean z3) {
        if (context == null) {
            return;
        }
        new f(context.getApplicationContext()).a(str, campaignEx, null, str2, z2, z3, com.mbridge.msdk.click.a.a.f);
    }

    public static void a(Context context, final CampaignEx campaignEx, String str, final String str2, boolean z2, boolean z3, final int i) {
        if (context == null) {
            return;
        }
        final int i2 = TextUtils.isEmpty(str2) ? -1 : str2.startsWith("tcp") ? 1 : 0;
        new f(context.getApplicationContext()).a(str, campaignEx, new h() {
            @Override
            public final void a(Object obj) {
            }

            @Override
            public final void a(Object obj, String str3) {
                try {
                    String a2 = b.a(i);
                    com.mbridge.msdk.foundation.same.report.d.d dVar = new com.mbridge.msdk.foundation.same.report.d.d();
                    dVar.a("result", 2);
                    if (obj instanceof JumpLoaderResult) {
                        JumpLoaderResult jumpLoaderResult = (JumpLoaderResult) obj;
                        String exceptionMsg = jumpLoaderResult.getExceptionMsg();
                        if (!TextUtils.isEmpty(exceptionMsg)) {
                            str3 = exceptionMsg;
                        }
                        dVar.a("reason", str3);
                        dVar.a("status_code", Integer.valueOf(jumpLoaderResult.getStatusCode()));
                    }
                    dVar.a("code", "");
                    dVar.a("failingURL", ar.d(str2));
                    dVar.a("net_ty", String.valueOf(i2));
                    com.mbridge.msdk.foundation.same.report.d.c.a().a(a2, campaignEx, dVar);
                } catch (Exception e) {
                    if (MBridgeConstans.DEBUG) {
                        af.b("CommonClickControl", e.getMessage());
                    }
                }
            }

            @Override
            public final void b(Object obj) {
                try {
                    com.mbridge.msdk.foundation.same.report.d.d dVar = new com.mbridge.msdk.foundation.same.report.d.d();
                    dVar.a("result", 2);
                    dVar.a("net_ty", String.valueOf(i2));
                    if (obj != null && (obj instanceof JumpLoaderResult)) {
                        JumpLoaderResult jumpLoaderResult = (JumpLoaderResult) obj;
                        String str3 = jumpLoaderResult.getStatusCode() + "";
                        dVar.a("status_code", str3);
                        if (str3.startsWith(CouponInfo.JINNIIU_DISCOUNT)) {
                            dVar.a("result", 1);
                        } else {
                            String exceptionMsg = jumpLoaderResult.getExceptionMsg();
                            if (TextUtils.isEmpty(exceptionMsg)) {
                                exceptionMsg = "UNKNOWN EXCEPTION and Status Code is : " + str3;
                            }
                            dVar.a("failingURL", ar.d(str2));
                            dVar.a("reason", exceptionMsg);
                        }
                    }
                    com.mbridge.msdk.foundation.same.report.d.c.a().a(b.a(i), campaignEx, dVar);
                } catch (Exception e) {
                    if (MBridgeConstans.DEBUG) {
                        af.b("CommonClickControl", e.getMessage());
                    }
                }
            }
        }, str2, z2, z3, i);
    }

    public final boolean b(CampaignEx campaignEx) {
        return c.a(this.g, this.d, campaignEx);
    }

    public static void a(Context context, CampaignEx campaignEx, String str, String[] strArr, boolean z2, boolean z3) {
        if (context == null || campaignEx == null || TextUtils.isEmpty(str) || strArr == null) {
            return;
        }
        f fVar = new f(context.getApplicationContext());
        for (String str2 : strArr) {
            fVar.a(str, campaignEx, new h() {
                @Override
                public final void a(Object obj) {
                }

                @Override
                public final void a(Object obj, String str3) {
                }

                @Override
                public final void b(Object obj) {
                }
            }, str2, z2, z3, com.mbridge.msdk.click.a.a.f);
        }
    }

    public static void a(CampaignEx campaignEx, Context context, String str) {
        c.a(campaignEx, context, str);
    }

    public final void a(String str) {
        this.d = str;
    }

    public final void a(NativeListener.NativeTrackingListener nativeTrackingListener) {
        this.i = nativeTrackingListener;
    }

    public final void a(k kVar) {
        this.p = kVar;
    }

    public final void a(boolean z2) {
        this.n = z2;
    }

    public final void a() {
        try {
            this.i = null;
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public final void a(CampaignEx campaignEx, NativeListener.NativeAdListener nativeAdListener) {
        if (nativeAdListener != null && campaignEx != null) {
            nativeAdListener.onAdClick(campaignEx);
        }
        a(campaignEx);
    }

    public final void a(com.mbridge.msdk.foundation.entity.CampaignEx r18) {
        throw new UnsupportedOperationException("Method not decompiled: com.mbridge.msdk.click.b.a(com.mbridge.msdk.foundation.entity.CampaignEx):void");
    }

    private AppletSchemeCallBack a(NativeListener.NativeTrackingListener nativeTrackingListener, CampaignEx campaignEx, AppletsModel appletsModel, b bVar) {
        return new i(nativeTrackingListener, campaignEx, appletsModel, bVar);
    }

    private void a(Context context, CampaignEx campaignEx, List<String> list) {
        if (context == null) {
            com.mbridge.msdk.foundation.same.report.k.a(com.mbridge.msdk.foundation.controller.c.q().c(), campaignEx, 2, "context is null", this.d);
            return;
        }
        boolean z2 = ab.T() == 1;
        boolean z3 = ab.F(context) == 1;
        if (z2 && z3) {
            String ghId = campaignEx.getGhId();
            String ghPath = campaignEx.getGhPath();
            String bindId = campaignEx.getBindId();
            String h = com.mbridge.msdk.foundation.controller.c.q().h();
            if (!TextUtils.isEmpty(ghId)) {
                try {
                    if (!TextUtils.isEmpty(h)) {
                        bindId = h;
                    }
                    Object g = ab.g(bindId);
                    Class<?> cls = Class.forName("com.tencent.mm.opensdk.modelbiz.WXLaunchMiniProgram$Req");
                    Object newInstance = cls.newInstance();
                    cls.getField("userName").set(newInstance, ghId);
                    cls.getField("path").set(newInstance, ghPath);
                    cls.getField("miniprogramType").set(newInstance, cls.getField("MINIPTOGRAM_TYPE_RELEASE").get(null));
                    Class.forName("com.tencent.mm.opensdk.openapi.IWXAPI").getMethod("sendReq", Class.forName("com.tencent.mm.opensdk.modelbase.BaseReq")).invoke(g, newInstance);
                    com.mbridge.msdk.foundation.same.report.k.a(context, campaignEx, 1, "", this.d);
                    return;
                } catch (Throwable th) {
                    com.mbridge.msdk.foundation.same.report.k.a(context, campaignEx, 2, th.getMessage(), this.d);
                    a(campaignEx, list);
                    return;
                }
            }
            a(campaignEx, list);
            com.mbridge.msdk.foundation.same.report.k.a(context, campaignEx, 2, "ghid is empty", this.d);
            return;
        }
        com.mbridge.msdk.foundation.same.report.k.a(context, campaignEx, 2, "integrated:" + z2 + "-hasWx:" + z3, this.d);
        a(campaignEx, list);
    }

    private void a(CampaignEx campaignEx, List<String> list) {
        if (b() == 2) {
            aj.a(this.g, campaignEx.getClickURL(), campaignEx, this.i, list);
        } else {
            aj.a(this.g, campaignEx.getClickURL(), this.i, campaignEx, list);
        }
    }

    private void a(final com.mbridge.msdk.foundation.entity.CampaignEx r15, final boolean r16, final java.lang.Boolean r17, final java.util.List<java.lang.String> r18) {
        throw new UnsupportedOperationException("Method not decompiled: com.mbridge.msdk.click.b.a(com.mbridge.msdk.foundation.entity.CampaignEx, boolean, java.lang.Boolean, java.util.List):void");
    }

    public final void a(JumpLoaderResult jumpLoaderResult, CampaignEx campaignEx, int i, boolean z2) {
        if (campaignEx == null || jumpLoaderResult == null) {
            return;
        }
        try {
            long currentTimeMillis = System.currentTimeMillis() - this.e;
            com.mbridge.msdk.foundation.entity.f fVar = new com.mbridge.msdk.foundation.entity.f();
            int w2 = ab.w(this.g);
            fVar.a(w2);
            fVar.c(ab.a(this.g, w2));
            fVar.b(campaignEx.getRequestId());
            fVar.k(campaignEx.getRequestIdNotice());
            fVar.b(i);
            fVar.i(currentTimeMillis + "");
            fVar.j(campaignEx.getId());
            fVar.c(jumpLoaderResult.getType());
            if (!TextUtils.isEmpty(jumpLoaderResult.getUrl())) {
                fVar.h(URLEncoder.encode(jumpLoaderResult.getUrl(), "utf-8"));
            }
            fVar.e((this.e / 1000) + "");
            fVar.d(Integer.parseInt(campaignEx.getLandingType()));
            fVar.e(campaignEx.getLinkType());
            fVar.a(this.d);
            fVar.c(jumpLoaderResult.getType());
            if (!TextUtils.isEmpty(jumpLoaderResult.getUrl())) {
                fVar.h(URLEncoder.encode(jumpLoaderResult.getUrl(), "utf-8"));
            }
            if (this.l) {
                fVar.f(jumpLoaderResult.getStatusCode());
                if (!TextUtils.isEmpty(jumpLoaderResult.getHeader())) {
                    fVar.f(URLEncoder.encode(jumpLoaderResult.getHeader(), "utf-8"));
                }
                if (!TextUtils.isEmpty(jumpLoaderResult.getContent())) {
                    fVar.g(URLEncoder.encode(jumpLoaderResult.getContent(), "UTF-8"));
                }
                if (!TextUtils.isEmpty(jumpLoaderResult.getExceptionMsg())) {
                    fVar.d(URLEncoder.encode(jumpLoaderResult.getExceptionMsg(), "utf-8"));
                }
            }
            if (z2) {
                this.j.a("click_jump_error", fVar, this.d);
                return;
            }
            ArrayList arrayList = new ArrayList();
            arrayList.add(fVar);
            String a2 = com.mbridge.msdk.foundation.entity.f.a(arrayList);
            if (ap.b(a2)) {
                if (com.mbridge.msdk.foundation.same.report.e.a().b()) {
                    com.mbridge.msdk.foundation.same.report.e.a().a(a2);
                } else {
                    new com.mbridge.msdk.foundation.same.report.i(this.g, 0).a("click_jump_success", a2, (String) null, (Frame) null);
                }
            }
        } catch (Throwable th) {
            th.printStackTrace();
        }
    }

    public final void a(Campaign campaign, String str) {
        try {
            if (!TextUtils.isEmpty(str) && campaign != null) {
                CampaignEx campaignEx = campaign instanceof CampaignEx ? (CampaignEx) campaign : null;
                if (!str.startsWith("market://") && !str.startsWith("https://play.google.com/")) {
                    c.a(str, this.g, this.d, campaignEx, this.i);
                    return;
                }
                if (aj.a.a(this.g, str, this.i) || campaignEx == null) {
                    return;
                }
                if (!TextUtils.isEmpty(campaignEx.getPackageName())) {
                    aj.a.a(this.g, "market://details?id=" + campaignEx.getPackageName(), this.i);
                    return;
                }
                if (b() == 2) {
                    aj.a(this.g, campaignEx.getClickURL(), campaignEx, this.i, new ArrayList());
                } else {
                    aj.a(this.g, campaignEx.getClickURL(), this.i, campaignEx, new ArrayList());
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public void a(JumpLoaderResult jumpLoaderResult, CampaignEx campaignEx, boolean z2) {
        a(jumpLoaderResult, campaignEx, 1, z2);
    }

    private void a(int i, String str, CampaignEx campaignEx, NativeListener.NativeTrackingListener nativeTrackingListener, List<String> list) {
        try {
            if (!TextUtils.isEmpty(str)) {
                if (i == 2) {
                    aj.a(this.g, str, campaignEx, nativeTrackingListener, list);
                } else {
                    aj.a(this.g, str, nativeTrackingListener, campaignEx, list);
                }
            }
        } catch (Throwable th) {
            if (MBridgeConstans.DEBUG) {
                af.b("CommonClickControl", th.getMessage(), th);
            }
        }
    }

    private boolean a(CampaignEx campaignEx, JumpLoaderResult jumpLoaderResult, boolean z2, int i, List<String> list) {
        boolean z3 = false;
        if (z2) {
            try {
                int parseInt = Integer.parseInt(campaignEx.getLandingType());
                if (parseInt == 1) {
                    aj.a(this.g, jumpLoaderResult.getUrl(), this.i, campaignEx, list);
                } else if (parseInt == 2) {
                    aj.a(this.g, jumpLoaderResult.getUrl(), campaignEx, this.i, list);
                } else if (campaignEx.getPackageName() != null) {
                    if (aj.a.a(this.g, "market://details?id=" + campaignEx.getPackageName(), this.i)) {
                        if (list != null) {
                            try {
                                list.add("google_play");
                            } catch (Throwable th) {
                                th = th;
                                z3 = true;
                                if (MBridgeConstans.DEBUG) {
                                    af.b("CommonClickControl", th.getMessage(), th);
                                }
                                return z3;
                            }
                        }
                        a(campaignEx, 1, 1, list);
                    } else {
                        a(i, jumpLoaderResult.getUrl(), campaignEx, this.i, list);
                    }
                } else {
                    a(i, jumpLoaderResult.getUrl(), campaignEx, this.i, list);
                }
                z3 = true;
            } catch (Throwable th2) {
                th = th2;
            }
        }
        if (z3) {
            a(jumpLoaderResult, campaignEx, true);
            NativeListener.NativeTrackingListener nativeTrackingListener = this.i;
            if (nativeTrackingListener != null) {
                nativeTrackingListener.onFinishRedirection(campaignEx, jumpLoaderResult.getUrl());
            }
        } else {
            a(jumpLoaderResult, campaignEx, true);
            NativeListener.NativeTrackingListener nativeTrackingListener2 = this.i;
            if (nativeTrackingListener2 != null && z2) {
                nativeTrackingListener2.onRedirectionFailed(campaignEx, jumpLoaderResult.getUrl());
            }
        }
        return z3;
    }

    private boolean a(CampaignEx campaignEx, JumpLoaderResult jumpLoaderResult, boolean z2, List<String> list) {
        boolean z3 = false;
        if (z2) {
            try {
                if (com.mbridge.msdk.f.b.a()) {
                    c.a(this.g, this.d, campaignEx, campaignEx.getNoticeUrl(), com.mbridge.msdk.foundation.same.a.L);
                }
                aj.a(this.g, campaignEx.getClickURL(), this.i, campaignEx, list);
                z3 = true;
            } catch (Throwable th) {
                if (MBridgeConstans.DEBUG) {
                    af.b("CommonClickControl", th.getMessage(), th);
                }
            }
        }
        a(jumpLoaderResult, campaignEx, true);
        if (z3) {
            NativeListener.NativeTrackingListener nativeTrackingListener = this.i;
            if (nativeTrackingListener != null) {
                nativeTrackingListener.onFinishRedirection(campaignEx, jumpLoaderResult.getUrl());
            }
        } else {
            if (com.mbridge.msdk.f.b.a()) {
                a(jumpLoaderResult, campaignEx, true);
            }
            NativeListener.NativeTrackingListener nativeTrackingListener2 = this.i;
            if (nativeTrackingListener2 != null) {
                nativeTrackingListener2.onRedirectionFailed(campaignEx, jumpLoaderResult.getUrl());
            }
        }
        return z3;
    }

    public void a(com.mbridge.msdk.foundation.entity.CampaignEx r17, com.mbridge.msdk.click.entity.JumpLoaderResult r18, boolean r19, boolean r20, java.lang.Boolean r21, java.util.List<java.lang.String> r22) {
        throw new UnsupportedOperationException("Method not decompiled: com.mbridge.msdk.click.b.a(com.mbridge.msdk.foundation.entity.CampaignEx, com.mbridge.msdk.click.entity.JumpLoaderResult, boolean, boolean, java.lang.Boolean, java.util.List):void");
    }

    private boolean a(int r4, java.lang.String r5) {
        throw new UnsupportedOperationException("Method not decompiled: com.mbridge.msdk.click.b.a(int, java.lang.String):boolean");
    }

    private void a(CampaignEx campaignEx, int i, int i2, List<String> list) {
        try {
            com.mbridge.msdk.foundation.same.report.d.d dVar = new com.mbridge.msdk.foundation.same.report.d.d();
            dVar.a(KsMediaMeta.KSM_KEY_TYPE, Integer.valueOf(i));
            dVar.a("result", Integer.valueOf(i2));
            if (list != null) {
                dVar.a("click_path", list.toString());
            }
            com.mbridge.msdk.foundation.same.report.d.c.a().a("2000150", campaignEx, dVar);
        } catch (Exception e) {
            if (MBridgeConstans.DEBUG) {
                af.b("CommonClickControl", e.getMessage());
            }
        }
    }

    public static void a(b bVar, CampaignEx campaignEx) {
        try {
            Intent intent = new Intent(bVar.g, (Class<?>) LoadingActivity.class);
            intent.setFlags(268435456);
            intent.putExtra("icon_url", campaignEx.getIconUrl());
            bVar.g.startActivity(intent);
        } catch (Exception e) {
            if (MBridgeConstans.DEBUG) {
                af.b("CommonClickControl", "Exception", e);
            }
        }
    }

    public static void a(b bVar, final boolean z2, final Campaign campaign) {
        new Handler(Looper.getMainLooper()).post(new Runnable() {
            @Override
            public final void run() {
                if (z2 && !b.a && MBridgeConstans.NATIVE_SHOW_LOADINGPAGER) {
                    b.f(b.this);
                }
                if (b.this.i == null || b.a || !MBridgeConstans.NATIVE_SHOW_LOADINGPAGER) {
                    return;
                }
                b.this.i.onDismissLoading(campaign);
            }
        });
    }
}