package com.google.android.gms.internal.ads;

import android.content.pm.PackageInfo;
import android.os.Bundle;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Callable;
import org.json.JSONArray;
import org.json.JSONObject;

/* JADX INFO: loaded from: classes2.dex */
public final /* synthetic */ class ae0 implements Callable {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ int f8671a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final /* synthetic */ Object f8672b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final /* synthetic */ Object f8673c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final /* synthetic */ Object f8674d;

    public /* synthetic */ ae0(Bundle bundle, String str, ArrayList arrayList) {
        this.f8671a = 2;
        this.f8673c = arrayList;
        this.f8674d = bundle;
        this.f8672b = str;
    }

    @Override // java.util.concurrent.Callable
    public final Object call() {
        Bundle bundle;
        int i10 = this.f8671a;
        int i11 = 1;
        u11 u11Var = null;
        Object obj = this.f8674d;
        Object obj2 = this.f8672b;
        Object obj3 = this.f8673c;
        switch (i10) {
            case 0:
                be0 be0Var = (be0) obj3;
                Bundle bundle2 = (Bundle) obj;
                be0Var.getClass();
                zd0 zd0Var = (zd0) ((com.google.common.util.concurrent.w) obj2).get();
                Bundle bundle3 = zd0Var.f19235a;
                String str = (String) ((com.google.common.util.concurrent.w) be0Var.f9513g.zzb()).get();
                boolean z10 = ((Boolean) n7.y.f31093e.f31096c.b(ao.M7)).booleanValue() && ((p7.o0) be0Var.f9516j).C();
                String str2 = be0Var.f9514h;
                PackageInfo packageInfo = be0Var.f9512f;
                return new tz(bundle3, be0Var.f9508b, be0Var.f9509c, be0Var.f9510d, be0Var.f9511e, packageInfo, str, str2, null, null, z10, be0Var.f9517k.a(), bundle2, zd0Var.f19236b, be0Var.f9518l);
            case 1:
                uz uzVar = (uz) ((com.google.common.util.concurrent.w) obj2).get();
                if (((Boolean) n7.y.f31093e.f31096c.b(ao.B2)).booleanValue() && (bundle = ((tz) obj3).f17040j) != null) {
                    bundle.putLong(zzdxh.GET_AD_DICTIONARY_SDKCORE_START.a(), uzVar.f17455j);
                    bundle.putLong(zzdxh.GET_AD_DICTIONARY_SDKCORE_END.a(), uzVar.f17456k);
                }
                return new iv0((JSONObject) ((com.google.common.util.concurrent.w) obj).get(), uzVar);
            case 2:
                u11 u11Var2 = c61.f9764k;
                JSONArray jSONArray = new JSONArray();
                for (com.google.common.util.concurrent.w wVar : (List) obj3) {
                    if (((JSONObject) wVar.get()) != null) {
                        jSONArray.put(wVar.get());
                    }
                }
                String str3 = (String) obj2;
                Bundle bundle4 = (Bundle) obj;
                if (jSONArray.length() != 0) {
                    u11Var = new u11(jSONArray.toString(), bundle4, str3, i11);
                } else if (((Boolean) n7.y.f31093e.f31096c.b(ao.T4)).booleanValue()) {
                    return new u11(new JSONArray().toString(), bundle4, str3, i11);
                }
                return u11Var;
            default:
                ((so1) obj3).f16515a.a((ql1) obj2, null, (byte[]) obj);
                return null;
        }
    }

    public /* synthetic */ ae0(vc1 vc1Var, tz tzVar, vc1 vc1Var2) {
        this.f8671a = 1;
        this.f8672b = vc1Var;
        this.f8673c = tzVar;
        this.f8674d = vc1Var2;
    }

    public /* synthetic */ ae0(Object obj, Object obj2, Cloneable cloneable, int i10) {
        this.f8671a = i10;
        this.f8673c = obj;
        this.f8672b = obj2;
        this.f8674d = cloneable;
    }
}
