package defpackage;

import android.content.Context;
import android.net.Uri;
import android.os.Build;
import com.google.common.util.concurrent.ListenableFuture;
import java.io.IOException;
import java.util.logging.Level;

/* JADX INFO: renamed from: ˏʿᵬ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public abstract class AbstractC1829 implements InterfaceC5188 {

    /* JADX INFO: renamed from: ˌᴵ, reason: contains not printable characters */
    public final String f7271;

    /* JADX INFO: renamed from: ᵔᵖᵹᵫ, reason: contains not printable characters */
    public volatile int f7272 = -1;

    /* JADX INFO: renamed from: ᵜᵪʾ, reason: contains not printable characters */
    public final C4923 f7273;

    /* JADX INFO: renamed from: ᵨᵼⁱ, reason: contains not printable characters */
    public C3784 f7274;

    public AbstractC1829(String str, C4923 c4923) {
        this.f7271 = str;
        this.f7273 = c4923;
    }

    @Override // defpackage.InterfaceC5188
    public final Object get() {
        C5429 c5429;
        if (ᵴᵧˈ.ᵪᵹᵥᵻ == null) {
            Object obj = C5429.f20596;
            ᵴᵧˈ.ᵪᵹᵥᵻ = new C3815();
        }
        Context context = (Context) C5429.f20597.get();
        if (context == null) {
            ᵴᵧˈ.ᵜᵪʾ();
            ᵕᵩʽᵲ.ᵪᵹᵥᵻ("Must call PhenotypeContext.setContext() first");
            return null;
        }
        C5429 c54292 = C5429.f20595;
        if (c54292 == null) {
            Context applicationContext = context.getApplicationContext();
            try {
                Class<?> cls = applicationContext.getApplicationContext().getClass();
                new StringBuilder(String.valueOf(cls).length() + 72);
                cls.toString();
                throw new IllegalStateException("Given application context does not implement GeneratedComponentManager: ".concat(String.valueOf(cls)));
            } catch (IllegalStateException unused) {
                synchronized (C5429.f20596) {
                    try {
                        if (C5429.f20595 != null) {
                            c5429 = C5429.f20595;
                        } else {
                            c5429 = (C5429) new C4471(applicationContext, 0).get();
                            C5429.f20595 = c5429;
                            ᵽˊᵘᵬ.ᵶˇᵱ(Level.CONFIG, c5429.m11045(), (Exception) null, "Application doesn't implement PhenotypeApplication interface, falling back to globally set context. See go/phenotype-flag#process-stable-init for more info.", new Object[0]);
                        }
                        c54292 = c5429;
                    } finally {
                    }
                }
            }
        }
        Object objM5010 = m5010(c54292);
        objM5010.getClass();
        return objM5010;
    }

    /* JADX WARN: Removed duplicated region for block: B:28:0x0085  */
    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object m5010(C5429 c5429) {
        C3254 c3254;
        Object objMo1354;
        C4053 c4053;
        int i = this.f7272;
        if (i == -1 || i < this.f7274.f14384.get()) {
            synchronized (this) {
                try {
                    int i2 = this.f7272;
                    Object objMo1355 = null;
                    if (i2 == -1) {
                        C5429.m11044();
                        c5429.getClass();
                        C4923 c4923 = this.f7273;
                        C0752 c0752 = (C0752) c4923.f18723;
                        C0752 c07522 = C3254.f12376;
                        if (c0752 != c07522) {
                            c4923.f18722 = C3254.f12377.m5762(c5429, c0752).f2964;
                            c4923.f18723 = c07522;
                        }
                        c3254 = (C3254) c4923.f18722;
                        this.f7274 = c3254.f12383;
                    } else {
                        c3254 = null;
                    }
                    int i3 = this.f7274.f14384.get();
                    if (i2 < i3) {
                        C5429.m11044();
                        c5429.getClass();
                        AbstractC2677 abstractC2677M8164 = AbstractC3619.m8164(c5429.f20598);
                        if (abstractC2677M8164.mo1972()) {
                            C0665 c0665 = (C0665) abstractC2677M8164.mo1974();
                            Uri uriM9378 = AbstractC4355.m9378();
                            String str = this.f7271;
                            if (uriM9378 != null) {
                                c4053 = (C4053) c0665.f3105.get(uriM9378.toString());
                            } else {
                                c0665.getClass();
                                c4053 = null;
                            }
                            String str2 = c4053 == null ? null : (String) c4053.get(str);
                            if (str2 == null) {
                                objMo1354 = null;
                            } else {
                                try {
                                    objMo1354 = mo1352(str2);
                                } catch (IOException | IllegalArgumentException unused) {
                                    "Invalid Phenotype flag value for flag ".concat(this.f7271);
                                    objMo1354 = null;
                                }
                            }
                        }
                        if (c3254 == null) {
                            C4923 c49232 = this.f7273;
                            C0752 c07523 = (C0752) c49232.f18723;
                            C0752 c07524 = C3254.f12376;
                            if (c07523 != c07524) {
                                c49232.f18722 = C3254.f12377.m5762(c5429, c07523).f2964;
                                c49232.f18723 = c07524;
                            }
                            c3254 = (C3254) c49232.f18722;
                        }
                        String str3 = c3254.f12380;
                        if (Build.VERSION.SDK_INT >= 26 && !c5429.f20598.getPackageName().equals("com.android.vending") && !str3.startsWith("com.google.android.gms.measurement#")) {
                            ListenableFuture listenableFutureM8385 = c5429.m11045().m8385(new ᵟᵰᵕ(c5429, 18, str3));
                            listenableFutureM8385.mo834(new RunnableC1726(13, listenableFutureM8385), EnumC2921.f11255);
                        }
                        Object obj = ((C1323) c3254.m7416().f19121).get(this.f7271);
                        if (obj != null) {
                            try {
                                objMo1355 = mo1355(obj);
                            } catch (IOException | ClassCastException unused2) {
                                "Invalid Phenotype flag value for flag ".concat(this.f7271);
                            }
                        }
                        if (true != abstractC2677M8164.mo1972()) {
                            objMo1354 = objMo1355;
                        }
                        if (objMo1354 == null) {
                            objMo1354 = mo1354();
                        }
                        if (objMo1354 != null) {
                            mo1356(objMo1354);
                            this.f7272 = i3;
                        }
                        return objMo1354;
                    }
                } catch (Throwable th) {
                    throw th;
                }
            }
        }
        return mo1353();
    }

    /* JADX INFO: renamed from: ːˏᵟᵯ */
    public abstract Object mo1352(String str);

    /* JADX INFO: renamed from: ᵨᵣ */
    public abstract Object mo1353();

    /* JADX INFO: renamed from: ᵲᵶᵳˈ */
    public abstract Object mo1354();

    /* JADX INFO: renamed from: ᵷᵺʾᵖ */
    public abstract Object mo1355(Object obj);

    /* JADX INFO: renamed from: ᵻˈᵦʼ */
    public abstract void mo1356(Object obj);
}
