package defpackage;

import android.content.Context;
import android.location.LocationManager;
import android.os.SystemClock;
import android.view.View;
import android.view.ViewGroup;
import ar.tvplayer.tv.R;
import j$.util.concurrent.ConcurrentHashMap;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;
import net.lingala.zip4j.exception.ZipException;

/* renamed from: ˌᵎʕᵪ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C1601 implements InterfaceC1099, InterfaceC4447, InterfaceC1783, InterfaceC0369, InterfaceC2326 {

    /* renamed from: ᵡⁱᵥ, reason: contains not printable characters */
    public static C1601 f6350;

    /* renamed from: ᵤᵙᵷ, reason: contains not printable characters */
    public static C1601 f6351;

    /* renamed from: ᵢˇᵭ, reason: contains not printable characters */
    public Object f6352;

    /* renamed from: ᵧᵾˀˈ, reason: contains not printable characters */
    public final /* synthetic */ int f6353;

    /* renamed from: ᵾᵬ, reason: contains not printable characters */
    public Object f6354;

    /* renamed from: ᵿʗᵝʽ, reason: contains not printable characters */
    public Object f6355;

    public C1601(int i) {
        this.f6353 = i;
        switch (i) {
            case 3:
                this.f6352 = new byte[2];
                this.f6355 = new byte[4];
                this.f6354 = new byte[8];
                break;
            case C1339.DOUBLE_FIELD_NUMBER /* 7 */:
                this.f6352 = new C4587("", 0L, null);
                this.f6355 = new C4587("", 0L, null);
                this.f6354 = new ArrayList();
                break;
            case 11:
                this.f6352 = new AtomicBoolean(false);
                new ConcurrentHashMap();
                this.f6355 = new ConcurrentHashMap();
                new ConcurrentHashMap();
                this.f6354 = new ConcurrentHashMap();
                break;
        }
    }

    public /* synthetic */ C1601(int i, Object obj, Object obj2, Object obj3, boolean z) {
        this.f6353 = i;
        this.f6354 = obj;
        this.f6352 = obj2;
        this.f6355 = obj3;
    }

    public C1601(Context context, LocationManager locationManager) {
        this.f6353 = 6;
        this.f6354 = new C0735();
        this.f6352 = context;
        this.f6355 = locationManager;
    }

    public C1601(Context context, C4205 c4205) {
        this.f6353 = 9;
        this.f6354 = new AtomicLong(-1L);
        this.f6355 = new C4836(context, C4836.f17961, new C0365("measurement:api"), C1737.f6944);
        this.f6352 = c4205;
    }

    public /* synthetic */ C1601(Object obj, Object obj2, Object obj3, int i) {
        this.f6353 = i;
        this.f6352 = obj;
        this.f6355 = obj2;
        this.f6354 = obj3;
    }

    public C1601(C4587 c4587) {
        this.f6353 = 7;
        this.f6352 = c4587;
        this.f6355 = c4587.clone();
        this.f6354 = new ArrayList();
    }

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public static int m4580(int i, byte[] bArr) {
        return ((((bArr[i + 3] & 255) << 8) | (bArr[i + 2] & 255)) << 16) | (bArr[i] & 255) | ((bArr[i + 1] & 255) << 8);
    }

    /* renamed from: ᵝᵵᵺ, reason: contains not printable characters */
    public static void m4581(int i, byte[] bArr) {
        bArr[3] = (byte) (i >>> 24);
        bArr[2] = (byte) (i >>> 16);
        bArr[1] = (byte) (i >>> 8);
        bArr[0] = (byte) (i & 255);
    }

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public static void m4582(InputStream inputStream, byte[] bArr, int i) throws ZipException {
        if (ᵙᵛᵯ.ˎˑː(inputStream, bArr, 0, i) == i) {
            return;
        }
        C0190.m1425("Could not fill buffer");
    }

    /* renamed from: ᵸˑ, reason: contains not printable characters */
    public static void m4583(long j, byte[] bArr) {
        bArr[7] = (byte) (j >>> 56);
        bArr[6] = (byte) (j >>> 48);
        bArr[5] = (byte) (j >>> 40);
        bArr[4] = (byte) (j >>> 32);
        bArr[3] = (byte) (j >>> 24);
        bArr[2] = (byte) (j >>> 16);
        bArr[1] = (byte) (j >>> 8);
        bArr[0] = (byte) (j & 255);
    }

    /* renamed from: ᵹᵝᵶ, reason: contains not printable characters */
    public static int m4584(int i, byte[] bArr) {
        return ((bArr[i + 1] & 255) << 8) | (bArr[i] & 255);
    }

    public /* bridge */ /* synthetic */ Object clone() {
        switch (this.f6353) {
            case C1339.DOUBLE_FIELD_NUMBER /* 7 */:
                C1601 c1601 = new C1601(((C4587) this.f6352).clone());
                ArrayList arrayList = (ArrayList) this.f6354;
                int size = arrayList.size();
                int i = 0;
                while (i < size) {
                    Object obj = arrayList.get(i);
                    i++;
                    ((ArrayList) c1601.f6354).add(((C4587) obj).clone());
                }
                return c1601;
            default:
                return super.clone();
        }
    }

    @Override // defpackage.InterfaceC2765
    public Object get() {
        switch (this.f6353) {
            case 4:
                return new C1748((InterfaceC2262) ((InterfaceC3729) this.f6352).get(), (C2103) ((InterfaceC3729) this.f6355).get(), (InterfaceC2715) ((InterfaceC3729) this.f6354).get());
            default:
                return new C2210(new ˉᵻ(15), new ˊᵿʗ(13), (C0384) ((ʽˋːᵜ) this.f6352).get(), (C0975) ((C1188) this.f6355).get(), (C0030) ((C0030) this.f6354).get());
        }
    }

    /* renamed from: ˌᵜᵹᵩ, reason: contains not printable characters */
    public void m4585(OutputStream outputStream, long j) throws IOException {
        byte[] bArr = (byte[]) this.f6354;
        m4583(j, bArr);
        outputStream.write(bArr);
    }

    /* renamed from: ˎˏʜʾ, reason: contains not printable characters */
    public long m4586(int i, byte[] bArr) {
        byte[] bArr2 = (byte[]) this.f6354;
        if (bArr.length - i < 8) {
            Arrays.fill(bArr2, (byte) 0);
        }
        System.arraycopy(bArr, i, bArr2, 0, Math.min(bArr.length - i, 8));
        return ((((((((((((((bArr2[7] & 255) << 8) | (bArr2[6] & 255)) << 8) | (bArr2[5] & 255)) << 8) | (bArr2[4] & 255)) << 8) | (bArr2[3] & 255)) << 8) | (bArr2[2] & 255)) << 8) | (bArr2[1] & 255)) << 8) | (bArr2[0] & 255);
    }

    /* renamed from: ˏˋٴ, reason: contains not printable characters */
    public int m4587(InputStream inputStream) throws ZipException {
        byte[] bArr = (byte[]) this.f6355;
        m4582(inputStream, bArr, 4);
        return m4580(0, bArr);
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:13:0x0032 A[Catch: all -> 0x0027, TryCatch #1 {all -> 0x0027, blocks: (B:6:0x0024, B:19:0x006b, B:22:0x008f, B:13:0x0032, B:15:0x0058, B:17:0x0063, B:18:0x0067), top: B:50:0x0024 }] */
    /* JADX WARN: Removed duplicated region for block: B:18:0x0067 A[Catch: all -> 0x0027, TryCatch #1 {all -> 0x0027, blocks: (B:6:0x0024, B:19:0x006b, B:22:0x008f, B:13:0x0032, B:15:0x0058, B:17:0x0063, B:18:0x0067), top: B:50:0x0024 }] */
    /* JADX WARN: Removed duplicated region for block: B:21:0x008e  */
    /* JADX WARN: Removed duplicated region for block: B:34:0x00c3  */
    /* JADX WARN: Removed duplicated region for block: B:37:0x0113  */
    /* JADX WARN: Removed duplicated region for block: B:38:0x0116  */
    /* JADX WARN: Type inference failed for: r10v12, types: [java.lang.String] */
    @Override // defpackage.InterfaceC0369, defpackage.InterfaceC2326
    /* renamed from: ˏᵙ */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public void mo1806(java.lang.String r7, int r8, java.lang.Throwable r9, byte[] r10, java.util.Map r11) {
        /*
            Method dump skipped, instructions count: 364
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C1601.mo1806(java.lang.String, int, java.lang.Throwable, byte[], java.util.Map):void");
    }

    /* JADX WARN: Removed duplicated region for block: B:55:0x00fe  */
    /* renamed from: ᵪʩ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public void m4588(defpackage.AbstractC2646 r10, java.util.Set r11, java.lang.String r12) {
        /*
            Method dump skipped, instructions count: 262
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C1601.m4588(ᵚˁˋ, java.util.Set, java.lang.String):void");
    }

    /* renamed from: ᵯٴᵦ, reason: contains not printable characters */
    public void m4589(ByteArrayOutputStream byteArrayOutputStream, int i) throws IOException {
        byte[] bArr = (byte[]) this.f6352;
        bArr[1] = (byte) (i >>> 8);
        bArr[0] = (byte) (i & 255);
        byteArrayOutputStream.write(bArr);
    }

    /* renamed from: ᵳٴᵶ, reason: contains not printable characters */
    public synchronized void m4590(int i, int i2, long j, long j2) {
        ((C4205) this.f6352).f15721.getClass();
        long jElapsedRealtime = SystemClock.elapsedRealtime();
        AtomicLong atomicLong = (AtomicLong) this.f6354;
        if (atomicLong.get() != -1 && jElapsedRealtime - atomicLong.get() <= 1800000) {
            return;
        }
        C3921 c3921M10162 = ((C4836) this.f6355).m10162(new C1382(0, Arrays.asList(new C4465(36301, i, 0, j, j2, null, null, 0, i2))));
        C3293 c3293 = new C3293(this, jElapsedRealtime, 7);
        c3921M10162.getClass();
        c3921M10162.m8714(AbstractC3367.f12590, c3293);
    }

    @Override // defpackage.InterfaceC1099
    /* renamed from: ᵴᵳ */
    public void mo2371(Object obj) {
        View view = (View) obj;
        ViewGroup viewGroup = (ViewGroup) this.f6355;
        View view2 = (View) this.f6352;
        ViewGroup.LayoutParams layoutParams = view2.getLayoutParams();
        if (layoutParams == null) {
            ᵹˉᵞ.ᵳٴᵶ("The media route button placeholder missing layout params.");
            return;
        }
        view.setId(R.id._11_res_0x7f0b0176);
        view.setLayoutParams(layoutParams);
        int iIndexOfChild = viewGroup.indexOfChild(view2);
        viewGroup.removeView(view2);
        viewGroup.addView(view, iIndexOfChild);
        view.setVisibility(0);
        ((C5225) this.f6354).f19559.m6318(view, true);
    }

    /* renamed from: ᵶᵷᵕ, reason: contains not printable characters */
    public void m4591(OutputStream outputStream, int i) throws IOException {
        byte[] bArr = (byte[]) this.f6355;
        m4581(i, bArr);
        outputStream.write(bArr);
    }

    @Override // defpackage.InterfaceC1099
    /* renamed from: ᵻᵢﹳᵰ */
    public void mo2376(Throwable th) {
        ((View) this.f6352).setVisibility(8);
    }
}
