GoooBet v1.0版本的 MD5 值为:ff9748f16167bfd7735b669c0a9931c5

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


package com.a.a.a.a.a;

import android.app.Activity;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.text.TextUtils;
import com.bytedance.sdk.component.utils.j;
import com.bytedance.sdk.openadsdk.c.e;
import com.bytedance.sdk.openadsdk.core.e.i;
import com.bytedance.sdk.openadsdk.core.n;
import com.bytedance.sdk.openadsdk.core.z;
import com.google.android.exoplayer2.C;
import java.lang.ref.WeakReference;
import java.util.concurrent.atomic.AtomicBoolean;

public class b implements c {

    protected com.bytedance.sdk.openadsdk.core.e.b f20a;
    protected i b;
    protected String c;
    private WeakReference<Context> f;
    protected boolean d = false;
    protected final AtomicBoolean e = new AtomicBoolean(false);
    private boolean g = false;

    public b(Context context, i iVar, String str) {
        this.f = new WeakReference<>(context);
        this.b = iVar;
        if (iVar != null) {
            j.c("GPDownLoader", iVar.al().toString());
        }
        this.f20a = iVar.T();
        this.c = str;
        j.c("GPDownLoader", "====tag===" + str);
        if (n.a() == null) {
            n.a(context);
        }
    }

    @Override
    public void a(boolean z) {
        this.g = z;
    }

    public boolean a(Context context, String str) {
        return b(context, str);
    }

    public static boolean b(Context context, String str) {
        Intent launchIntentForPackage;
        if (context != null && str != null && !TextUtils.isEmpty(str)) {
            j.c("GPDownLoader", "gotoGooglePlay :market://details?id=" + str);
            Intent intent = new Intent("android.intent.action.VIEW");
            Uri parse = Uri.parse("market://details?id=" + str);
            intent.setData(parse);
            for (ResolveInfo resolveInfo : context.getPackageManager().queryIntentActivities(intent, C.DEFAULT_BUFFER_SEGMENT_SIZE)) {
                if (resolveInfo.activityInfo.packageName.equals("com.android.vending") && (launchIntentForPackage = context.getPackageManager().getLaunchIntentForPackage("com.android.vending")) != null) {
                    launchIntentForPackage.setComponent(new ComponentName(resolveInfo.activityInfo.packageName, resolveInfo.activityInfo.name));
                    launchIntentForPackage.setData(parse);
                    if (!(context instanceof Activity)) {
                        launchIntentForPackage.setFlags(268435456);
                    }
                    context.startActivity(launchIntentForPackage);
                    return true;
                }
            }
            try {
                Intent intent2 = new Intent("android.intent.action.VIEW", Uri.parse("https://play.google.com/store/apps/details?id=" + str));
                intent2.setFlags(268435456);
                context.startActivity(intent2);
                return true;
            } catch (Throwable th) {
                th.printStackTrace();
            }
        }
        return false;
    }

    public Context c() {
        WeakReference<Context> weakReference = this.f;
        return (weakReference == null || weakReference.get() == null) ? n.a() : this.f.get();
    }

    @Override
    public void d() {
        if (c() == null) {
            return;
        }
        if (b()) {
            this.e.set(true);
        } else {
            if (a() || e() || this.b.T() != null || this.b.I() == null) {
                return;
            }
            z.a(c(), this.b.I(), this.b, com.bytedance.sdk.openadsdk.l.n.a(this.c), this.c, true);
        }
    }

    public boolean b() {
        if (this.b.U() == null) {
            return false;
        }
        String a2 = this.b.U().a();
        if (!TextUtils.isEmpty(a2)) {
            Uri parse = Uri.parse(a2);
            Intent intent = new Intent("android.intent.action.VIEW");
            intent.setData(parse);
            if (com.bytedance.sdk.openadsdk.l.n.a(c(), intent)) {
                if (!(c() instanceof Activity)) {
                    intent.addFlags(268435456);
                }
                try {
                    c().startActivity(intent);
                    e.f(n.a(), this.b, this.c, "open_url_app", null);
                    com.bytedance.sdk.openadsdk.c.n.a().a(this.b, this.c);
                    return true;
                } catch (Throwable th) {
                    th.printStackTrace();
                }
            }
        }
        if (this.d && !this.e.get()) {
            return false;
        }
        this.d = true;
        e.f(c(), this.b, this.c, "open_fallback_url", null);
        return false;
    }

    @Override
    public boolean e() {
        this.e.set(true);
        return this.f20a != null && a(c(), this.f20a.c());
    }

    @Override
    public boolean a() {
        Intent a2;
        if (this.f20a == null) {
            return false;
        }
        i iVar = this.b;
        if (iVar != null && iVar.am() == 0) {
            return false;
        }
        String c = this.f20a.c();
        if (TextUtils.isEmpty(c) || !com.bytedance.sdk.openadsdk.l.n.b(c(), c) || (a2 = com.bytedance.sdk.openadsdk.l.n.a(c(), c)) == null) {
            return false;
        }
        a2.putExtra("START_ONLY_FOR_ANDROID", true);
        try {
            c().startActivity(a2);
            e.f(c(), this.b, this.c, "click_open", null);
            return true;
        } catch (Throwable th) {
            th.printStackTrace();
            return false;
        }
    }
}