package d3;

import B0.C0016c;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.util.Pair;
import android.util.SparseArray;

/* JADX INFO: renamed from: d3.g0, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C0785g0 extends A0 {

    /* JADX INFO: renamed from: Q, reason: collision with root package name */
    public static final Pair f11956Q = new Pair("", 0L);

    /* JADX INFO: renamed from: A, reason: collision with root package name */
    public long f11957A;

    /* JADX INFO: renamed from: B, reason: collision with root package name */
    public final B0.s0 f11958B;

    /* JADX INFO: renamed from: C, reason: collision with root package name */
    public final C0779e0 f11959C;
    public final C0016c D;

    /* JADX INFO: renamed from: E, reason: collision with root package name */
    public final C2.a f11960E;

    /* JADX INFO: renamed from: F, reason: collision with root package name */
    public final C0779e0 f11961F;

    /* JADX INFO: renamed from: G, reason: collision with root package name */
    public final B0.s0 f11962G;
    public final B0.s0 H;

    /* JADX INFO: renamed from: I, reason: collision with root package name */
    public boolean f11963I;

    /* JADX INFO: renamed from: J, reason: collision with root package name */
    public final C0779e0 f11964J;

    /* JADX INFO: renamed from: K, reason: collision with root package name */
    public final C0779e0 f11965K;

    /* JADX INFO: renamed from: L, reason: collision with root package name */
    public final B0.s0 f11966L;

    /* JADX INFO: renamed from: M, reason: collision with root package name */
    public final C0016c f11967M;

    /* JADX INFO: renamed from: N, reason: collision with root package name */
    public final C0016c f11968N;

    /* JADX INFO: renamed from: O, reason: collision with root package name */
    public final B0.s0 f11969O;

    /* JADX INFO: renamed from: P, reason: collision with root package name */
    public final C2.a f11970P;

    /* JADX INFO: renamed from: s, reason: collision with root package name */
    public SharedPreferences f11971s;

    /* JADX INFO: renamed from: t, reason: collision with root package name */
    public final Object f11972t;

    /* JADX INFO: renamed from: u, reason: collision with root package name */
    public SharedPreferences f11973u;

    /* JADX INFO: renamed from: v, reason: collision with root package name */
    public C0782f0 f11974v;

    /* JADX INFO: renamed from: w, reason: collision with root package name */
    public final B0.s0 f11975w;

    /* JADX INFO: renamed from: x, reason: collision with root package name */
    public final C0016c f11976x;

    /* JADX INFO: renamed from: y, reason: collision with root package name */
    public String f11977y;

    /* JADX INFO: renamed from: z, reason: collision with root package name */
    public boolean f11978z;

    public C0785g0(C0817r0 c0817r0) {
        super(c0817r0);
        this.f11972t = new Object();
        this.f11958B = new B0.s0(this, "session_timeout", 1800000L);
        this.f11959C = new C0779e0(this, "start_new_session", true);
        this.f11962G = new B0.s0(this, "last_pause_time", 0L);
        this.H = new B0.s0(this, "session_id", 0L);
        this.D = new C0016c(this, "non_personalized_ads");
        this.f11960E = new C2.a(this, "last_received_uri_timestamps_by_source");
        this.f11961F = new C0779e0(this, "allow_remote_dynamite", false);
        this.f11975w = new B0.s0(this, "first_open_time", 0L);
        P2.w.c("app_install_time");
        this.f11976x = new C0016c(this, "app_instance_id");
        this.f11964J = new C0779e0(this, "app_backgrounded", false);
        this.f11965K = new C0779e0(this, "deep_link_retrieval_complete", false);
        this.f11966L = new B0.s0(this, "deep_link_retrieval_attempts", 0L);
        this.f11967M = new C0016c(this, "firebase_feature_rollouts");
        this.f11968N = new C0016c(this, "deferred_attribution_cache");
        this.f11969O = new B0.s0(this, "deferred_attribution_cache_timestamp", 0L);
        this.f11970P = new C2.a(this, "default_event_parameters");
    }

    @Override // d3.A0
    public final boolean F() {
        return true;
    }

    public final SharedPreferences I() {
        E();
        G();
        if (this.f11973u == null) {
            synchronized (this.f11972t) {
                try {
                    if (this.f11973u == null) {
                        C0817r0 c0817r0 = (C0817r0) this.f5146q;
                        String str = c0817r0.f12142q.getPackageName() + "_preferences";
                        Z z8 = c0817r0.f12150y;
                        C0817r0.k(z8);
                        z8.D.c(str, "Default prefs file");
                        this.f11973u = c0817r0.f12142q.getSharedPreferences(str, 0);
                    }
                } finally {
                }
            }
        }
        return this.f11973u;
    }

    public final SharedPreferences J() {
        E();
        G();
        P2.w.f(this.f11971s);
        return this.f11971s;
    }

    public final SparseArray K() {
        Bundle bundleN = this.f11960E.N();
        int[] intArray = bundleN.getIntArray("uriSources");
        long[] longArray = bundleN.getLongArray("uriTimestamps");
        if (intArray == null || longArray == null) {
            return new SparseArray();
        }
        if (intArray.length != longArray.length) {
            Z z8 = ((C0817r0) this.f5146q).f12150y;
            C0817r0.k(z8);
            z8.f11875v.b("Trigger URI source and timestamp array lengths do not match");
            return new SparseArray();
        }
        SparseArray sparseArray = new SparseArray();
        for (int i = 0; i < intArray.length; i++) {
            sparseArray.put(intArray[i], Long.valueOf(longArray[i]));
        }
        return sparseArray;
    }

    public final F0 L() {
        E();
        return F0.e(J().getInt("consent_source", 100), J().getString("consent_settings", "G1"));
    }

    public final void M(boolean z8) {
        E();
        Z z9 = ((C0817r0) this.f5146q).f12150y;
        C0817r0.k(z9);
        z9.D.c(Boolean.valueOf(z8), "App measurement setting deferred collection");
        SharedPreferences.Editor editorEdit = J().edit();
        editorEdit.putBoolean("deferred_analytics_collection", z8);
        editorEdit.apply();
    }

    public final boolean N(long j8) {
        return j8 - this.f11958B.g() > this.f11962G.g();
    }

    public final boolean O(B1 b12) {
        E();
        String string = J().getString("stored_tcf_param", "");
        String strC = b12.c();
        if (strC.equals(string)) {
            return false;
        }
        SharedPreferences.Editor editorEdit = J().edit();
        editorEdit.putString("stored_tcf_param", strC);
        editorEdit.apply();
        return true;
    }
}
