package ff;

import android.app.Application;
import android.content.Context;
import android.content.res.TypedArray;
import androidx.lifecycle.a0;
import androidx.lifecycle.f0;
import d9.f;
import java.util.ArrayList;
import java.util.Arrays;
import kn.l;
import kotlin.jvm.internal.g0;
import kotlin.jvm.internal.p0;
import kotlin.jvm.internal.t;
import kotlin.jvm.internal.u0;
import l8.g;

/* loaded from: classes4.dex */
public final class d extends androidx.lifecycle.b {

    /* renamed from: n, reason: collision with root package name */
    static final /* synthetic */ l[] f18231n = {p0.h(new g0(d.class, "doubleClickGuard", "getDoubleClickGuard()Z", 0))};

    /* renamed from: c, reason: collision with root package name */
    private final d9.f f18232c;

    /* renamed from: d, reason: collision with root package name */
    private final t7.c f18233d;

    /* renamed from: e, reason: collision with root package name */
    private final ja.d f18234e;

    /* renamed from: f, reason: collision with root package name */
    private final f0 f18235f;

    /* renamed from: g, reason: collision with root package name */
    private final a0 f18236g;

    /* renamed from: h, reason: collision with root package name */
    private final l8.e f18237h;

    /* renamed from: i, reason: collision with root package name */
    private final g f18238i;

    /* renamed from: j, reason: collision with root package name */
    private final a0 f18239j;

    /* renamed from: k, reason: collision with root package name */
    private final g f18240k;

    /* renamed from: l, reason: collision with root package name */
    private final a0 f18241l;

    /* renamed from: m, reason: collision with root package name */
    private final Integer[] f18242m;

    /* JADX WARN: Illegal instructions before constructor call */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public d(d9.f analyticsService, t7.c contextService, ja.d sharedPreferencesService) {
        super((Application) r0);
        t.g(analyticsService, "analyticsService");
        t.g(contextService, "contextService");
        t.g(sharedPreferencesService, "sharedPreferencesService");
        Context a10 = contextService.a();
        t.e(a10, "null cannot be cast to non-null type android.app.Application");
        this.f18232c = analyticsService;
        this.f18233d = contextService;
        this.f18234e = sharedPreferencesService;
        f0 f0Var = new f0();
        this.f18235f = f0Var;
        this.f18236g = f0Var;
        this.f18237h = new l8.e(false, 0L, 3, null);
        g gVar = new g();
        this.f18238i = gVar;
        this.f18239j = gVar;
        g gVar2 = new g();
        this.f18240k = gVar2;
        this.f18241l = gVar2;
        this.f18242m = new Integer[]{Integer.valueOf(af.f.f369i), Integer.valueOf(af.f.f370j), Integer.valueOf(af.f.f371k)};
        Q();
    }

    private final void Q() {
        TypedArray obtainTypedArray = this.f18233d.a().getResources().obtainTypedArray(af.b.f322c);
        t.f(obtainTypedArray, "obtainTypedArray(...)");
        TypedArray obtainTypedArray2 = this.f18233d.a().getResources().obtainTypedArray(af.b.f321b);
        t.f(obtainTypedArray2, "obtainTypedArray(...)");
        String[] stringArray = this.f18233d.a().getResources().getStringArray(af.b.f320a);
        t.f(stringArray, "getStringArray(...)");
        ArrayList arrayList = new ArrayList();
        int min = Math.min(obtainTypedArray.length(), obtainTypedArray2.length());
        for (int i10 = 0; i10 < min; i10++) {
            int resourceId = obtainTypedArray.getResourceId(i10, 0);
            int resourceId2 = obtainTypedArray2.getResourceId(i10, 0);
            String str = stringArray[i10];
            t.f(str, "get(...)");
            arrayList.add(new f(resourceId, resourceId2, str));
        }
        this.f18235f.q(arrayList);
        obtainTypedArray.recycle();
        obtainTypedArray2.recycle();
    }

    private final boolean R() {
        return this.f18237h.a(this, f18231n[0]).booleanValue();
    }

    /* JADX INFO: Access modifiers changed from: protected */
    @Override // androidx.lifecycle.z0
    public void O() {
        this.f18234e.putBoolean("SELFSCAN_SHOW_FIRST_TIME", false);
        super.O();
    }

    public final boolean S() {
        return this.f18234e.getBoolean("SELFSCAN_SHOW_FIRST_TIME", true);
    }

    public final a0 T() {
        return this.f18236g;
    }

    public final a0 U() {
        return this.f18241l;
    }

    public final a0 V() {
        return this.f18239j;
    }

    public final Integer[] W() {
        return this.f18242m;
    }

    public final void X() {
        if (R()) {
            return;
        }
        this.f18240k.s();
    }

    public final void Y() {
        if (R()) {
            return;
        }
        this.f18238i.s();
    }

    public final void Z(int i10) {
        d9.f fVar = this.f18232c;
        u0 u0Var = u0.f26205a;
        String format = String.format("Quickdrop_onboardingstep%d", Arrays.copyOf(new Object[]{Integer.valueOf(i10 + 1)}, 1));
        t.f(format, "format(...)");
        f.a.c(fVar, format, null, 2, null);
    }
}
