Driving Zone: Germany v1.22.4版本的 MD5 值为:2b6e2d8e8733a3104dcc306c5770286c

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


package com.com.bytedance.overseas.sdk.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.l;
import com.bytedance.sdk.openadsdk.b.e;
import com.bytedance.sdk.openadsdk.b.p;
import com.bytedance.sdk.openadsdk.core.e.n;
import com.bytedance.sdk.openadsdk.core.m;
import com.bytedance.sdk.openadsdk.core.y;
import com.bytedance.sdk.openadsdk.utils.u;
import java.lang.ref.WeakReference;
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;

public class b implements c {

    protected com.bytedance.sdk.openadsdk.core.e.c f4044a;
    protected n 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, n nVar, String str) {
        this.f = new WeakReference<>(context);
        this.b = nVar;
        this.f4044a = nVar.aa();
        this.c = str;
        l.c("GPDownLoader", "====tag===" + str);
        if (m.a() == null) {
            m.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)) {
            l.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, 65536)) {
                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) ? m.a() : this.f.get();
    }

    @Override
    public void d() {
        if (c() == null) {
            return;
        }
        if (b()) {
            this.e.set(true);
        } else {
            if (a() || e() || this.b.aa() != null || this.b.O() == null) {
                return;
            }
            y.a(c(), this.b.O(), this.b, u.a(this.c), this.c, true);
        }
    }

    public boolean b() {
        if (this.b.ab() == null) {
            return false;
        }
        String a2 = this.b.ab().a();
        if (!TextUtils.isEmpty(a2)) {
            Uri parse = Uri.parse(a2);
            Intent intent = new Intent("android.intent.action.VIEW");
            intent.setData(parse);
            if (u.a(c(), intent)) {
                if (!(c() instanceof Activity)) {
                    intent.addFlags(268435456);
                }
                try {
                    e.d(m.a(), this.b, this.c, "open_url_app", (Map<String, Object>) null);
                    c().startActivity(intent);
                    p.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.d(c(), this.b, this.c, "open_fallback_url", (Map<String, Object>) null);
        return false;
    }

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

    @Override
    public boolean a() {
        Intent a2;
        if (this.f4044a == null) {
            return false;
        }
        n nVar = this.b;
        if (nVar != null && nVar.as() == 0) {
            return false;
        }
        String c = this.f4044a.c();
        if (TextUtils.isEmpty(c) || !u.b(c(), c) || (a2 = u.a(c(), c)) == null) {
            return false;
        }
        a2.putExtra("START_ONLY_FOR_ANDROID", true);
        try {
            c().startActivity(a2);
            e.d(c(), this.b, this.c, "click_open", (Map<String, Object>) null);
            return true;
        } catch (Throwable th) {
            th.printStackTrace();
            return false;
        }
    }
}