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

import android.net.Uri;
import android.util.Base64;
import androidx.annotation.Nullable;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;

/* JADX INFO: loaded from: classes2.dex */
public final class e70 {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final ScheduledExecutorService f10648a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final AtomicBoolean f10649b = new AtomicBoolean(false);

    @Nullable
    private String zza;

    @Nullable
    private xc2 zzb;

    @Nullable
    private rf2 zzc;

    public e70(ScheduledExecutorService scheduledExecutorService) {
        this.f10648a = scheduledExecutorService;
    }

    public final void a() {
        String variationsHeader;
        try {
            if (z3.c0.a("GET_VARIATIONS_HEADER")) {
                Uri uri = z3.b0.f37032a;
                if (!a4.k0.O.b()) {
                    throw a4.k0.a();
                }
                variationsHeader = a4.m0.f345a.getStatics().getVariationsHeader();
            } else {
                variationsHeader = null;
            }
            if (variationsHeader != null && !variationsHeader.isEmpty()) {
                this.zza = variationsHeader;
                byte[] bArrDecode = Base64.decode(variationsHeader, 10);
                this.zzb = xc2.B(bArrDecode, ua2.b());
                tn tnVar = ao.Z9;
                n7.y yVar = n7.y.f31093e;
                yn ynVar = yVar.f31096c;
                yn ynVar2 = yVar.f31096c;
                if (((Boolean) ynVar.b(tnVar)).booleanValue()) {
                    this.zzc = rf2.B(bArrDecode, ua2.b());
                }
                if (((Boolean) ynVar2.b(ao.X9)).booleanValue() && ((Boolean) ynVar2.b(ao.W9)).booleanValue()) {
                    this.f10648a.schedule(new mv1(this, 29), ((Integer) ynVar2.b(ao.Y9)).intValue(), TimeUnit.MINUTES);
                }
            }
        } catch (zzicg e10) {
            e = e10;
            m7.n.C.f30469h.e("ChromeVariations", e);
        } catch (IllegalArgumentException e11) {
            e = e11;
            m7.n.C.f30469h.e("ChromeVariations", e);
        }
    }

    @Nullable
    public final String zzb() {
        rf2 rf2Var = this.zzc;
        if (rf2Var != null) {
            return Base64.encodeToString(rf2Var.b(), 10);
        }
        return null;
    }

    @Nullable
    public final String zzc() {
        return this.zza;
    }

    @Nullable
    public final xc2 zzd() {
        return this.zzb;
    }
}
