package defpackage;

import android.content.res.Resources;
import android.net.Uri;
import android.os.Bundle;
import com.google.android.gms.internal.measurement.zzsk;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Set;

/* renamed from: ᵤˑ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C3423 {

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public Object f12724 = new C4479();

    /* renamed from: ˎˏʜʾ, reason: contains not printable characters */
    public Object f12725;

    /* renamed from: ˏˋٴ, reason: contains not printable characters */
    public Object f12726;

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public Object f12727;

    /* renamed from: ᵝᵵᵺ, reason: contains not printable characters */
    public Object f12728;

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public Object f12729;

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public Object f12730;

    /* renamed from: ᵶᵷᵕ, reason: contains not printable characters */
    public Object f12731;

    /* renamed from: ᵹᵝᵶ, reason: contains not printable characters */
    public Object f12732;

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public Object f12733;

    public C3423(C3916 c3916, SurfaceHolderCallbackC4282 surfaceHolderCallbackC4282, C1875 c1875, int i, int i2, int i3, int i4) {
        this.f12727 = c3916;
        this.f12729 = surfaceHolderCallbackC4282;
        this.f12730 = c1875;
        this.f12726 = c1875.m5287(c3916.f14747, new C2810(1, this));
        this.f12725 = new C1747(this, i);
        this.f12732 = new C3723(this, i2);
        this.f12728 = new C3832(this, i3);
        this.f12731 = new C0259(this, i4);
        C3040 c3040 = new C3040(this);
        this.f12733 = c3040;
        c3916.f14768.m10592(c3040);
    }

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public static C3423 m7785(Bundle bundle, AbstractActivityC3177 abstractActivityC3177) throws Resources.NotFoundException {
        C3423 c3423 = new C3423();
        Set<String> setKeySet = bundle.keySet();
        if (setKeySet.contains("com.parse.ui.login.ParseLoginActivity.APP_LOGO")) {
            c3423.f12729 = Integer.valueOf(bundle.getInt("com.parse.ui.login.ParseLoginActivity.APP_LOGO"));
        }
        if (setKeySet.contains("com.parse.ui.login.ParseLoginActivity.PARSE_LOGIN_ENABLED")) {
            c3423.f12727 = Boolean.valueOf(bundle.getBoolean("com.parse.ui.login.ParseLoginActivity.PARSE_LOGIN_ENABLED"));
        }
        if (setKeySet.contains("com.parse.ui.login.ParseLoginActivity.PARSE_LOGIN_BUTTON_TEXT")) {
            c3423.f12733 = bundle.getCharSequence("com.parse.ui.login.ParseLoginActivity.PARSE_LOGIN_BUTTON_TEXT");
        }
        if (setKeySet.contains("com.parse.ui.login.ParseLoginActivity.PARSE_SIGNUP_BUTTON_TEXT")) {
            c3423.f12724 = bundle.getCharSequence("com.parse.ui.login.ParseLoginActivity.PARSE_SIGNUP_BUTTON_TEXT");
        }
        if (setKeySet.contains("com.parse.ui.login.ParseLoginActivity.PARSE_LOGIN_HELP_TEXT")) {
            c3423.f12726 = bundle.getCharSequence("com.parse.ui.login.ParseLoginActivity.PARSE_LOGIN_HELP_TEXT");
        }
        if (setKeySet.contains("com.parse.ui.login.ParseLoginActivity.PARSE_LOGIN_INVALID_CREDENTIALS_TEXT")) {
            c3423.f12725 = bundle.getCharSequence("com.parse.ui.login.ParseLoginActivity.PARSE_LOGIN_INVALID_CREDENTIALS_TEXT");
        }
        if (setKeySet.contains("com.parse.ui.login.ParseLoginActivity.PARSE_LOGIN_EMAIL_AS_USERNAME")) {
            c3423.f12732 = Boolean.valueOf(bundle.getBoolean("com.parse.ui.login.ParseLoginActivity.PARSE_LOGIN_EMAIL_AS_USERNAME"));
        }
        if (setKeySet.contains("com.parse.ui.login.ParseLoginActivity.PARSE_SIGNUP_MIN_PASSWORD_LENGTH")) {
            c3423.f12730 = Integer.valueOf(bundle.getInt("com.parse.ui.login.ParseLoginActivity.PARSE_SIGNUP_MIN_PASSWORD_LENGTH"));
        }
        if (setKeySet.contains("com.parse.ui.login.ParseLoginActivity.PARSE_SIGNUP_SUBMIT_BUTTON_TEXT")) {
            c3423.f12728 = bundle.getCharSequence("com.parse.ui.login.ParseLoginActivity.PARSE_SIGNUP_SUBMIT_BUTTON_TEXT");
        }
        if (setKeySet.contains("com.parse.ui.login.ParseLoginActivity.PARSE_SIGNUP_NAME_FIELD_ENABLED")) {
            c3423.f12731 = Boolean.valueOf(bundle.getBoolean("com.parse.ui.login.ParseLoginActivity.PARSE_SIGNUP_NAME_FIELD_ENABLED"));
        }
        if (setKeySet.contains("com.parse.ui.login.ParseLoginActivity.FACEBOOK_LOGIN_ENABLED")) {
            bundle.getBoolean("com.parse.ui.login.ParseLoginActivity.FACEBOOK_LOGIN_ENABLED");
        }
        if (setKeySet.contains("com.parse.ui.login.ParseLoginActivity.FACEBOOK_LOGIN_BUTTON_TEXT")) {
            bundle.getCharSequence("com.parse.ui.login.ParseLoginActivity.FACEBOOK_LOGIN_BUTTON_TEXT");
        }
        if (setKeySet.contains("com.parse.ui.login.ParseLoginActivity.FACEBOOK_LOGIN_PERMISSIONS") && bundle.getInt("com.parse.ui.login.ParseLoginActivity.FACEBOOK_LOGIN_PERMISSIONS") != 0) {
            try {
                String[] stringArray = abstractActivityC3177.getResources().getStringArray(bundle.getInt("com.parse.ui.login.ParseLoginActivity.FACEBOOK_LOGIN_PERMISSIONS"));
                if (stringArray != null) {
                    listAsList = Arrays.asList(stringArray);
                }
                if (listAsList != null) {
                    new ArrayList(listAsList.size()).addAll(listAsList);
                }
            } catch (Resources.NotFoundException unused) {
                Object obj = ˌˆᵜʛ.ᵥᵯˎ;
            }
        } else if (setKeySet.contains("com.parse.ui.login.ParseLoginActivity.FACEBOOK_LOGIN_PERMISSIONS_STRING_ARRAY")) {
            String[] stringArray2 = bundle.getStringArray("com.parse.ui.login.ParseLoginActivity.FACEBOOK_LOGIN_PERMISSIONS_STRING_ARRAY");
            listAsList = stringArray2 != null ? Arrays.asList(stringArray2) : null;
            if (listAsList != null) {
                new ArrayList(listAsList.size()).addAll(listAsList);
            }
        }
        if (setKeySet.contains("com.parse.ui.login.ParseLoginActivity.TWITTER_LOGIN_ENABLED")) {
            bundle.getBoolean("com.parse.ui.login.ParseLoginActivity.TWITTER_LOGIN_ENABLED");
        }
        if (setKeySet.contains("com.parse.ui.login.ParseLoginActivity.TWITTER_LOGIN_BUTTON_TEXT")) {
            bundle.getCharSequence("com.parse.ui.login.ParseLoginActivity.TWITTER_LOGIN_BUTTON_TEXT");
        }
        return c3423;
    }

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public AbstractC1126 m7786(Uri uri) throws IOException {
        C3720 c3720 = (C3720) this.f12729;
        String str = (String) this.f12727;
        C1109 c1109 = (C1109) this.f12724;
        try {
            try {
                C1355 c1355 = (C1355) this.f12725;
                StringBuilder sb = new StringBuilder(String.valueOf(str).length() + 5);
                sb.append("Read ");
                sb.append(str);
                RunnableC5529 runnableC5529M4194 = c1355.m4194(sb.toString());
                try {
                    InputStream inputStream = ᵸᵡˋʧ.ˑᵥˁ(c1109.m3529(uri));
                    try {
                        AbstractC4985 abstractC4985M4461 = ((C1532) ((InterfaceC2916) c3720.f13886.mo1179(7))).m4461(inputStream, c3720.f13887);
                        if (inputStream != null) {
                            inputStream.close();
                        }
                        runnableC5529M4194.close();
                        return abstractC4985M4461;
                    } finally {
                    }
                } catch (Throwable th) {
                    try {
                        runnableC5529M4194.close();
                    } catch (Throwable th2) {
                        th.addSuppressed(th2);
                    }
                    throw th;
                }
            } catch (IOException e) {
                throw ᵼᵙᵖᵱ.ˎˑː(c1109, uri, e, str);
            }
        } catch (FileNotFoundException e2) {
            C1770 c1770M3529 = c1109.m3529(uri);
            if (c1770M3529.f7146.mo2022(c1770M3529.f7148)) {
                throw e2;
            }
            return c3720.f13886;
        }
    }

    /* renamed from: ˏˋٴ, reason: contains not printable characters */
    public void m7787(Uri uri, Object obj) throws IOException {
        String str = (String) this.f12727;
        C1109 c1109 = (C1109) this.f12724;
        Uri uriBuild = uri.buildUpon().path(String.valueOf(uri.getPath()).concat(".tmp")).build();
        try {
            C1355 c1355 = (C1355) this.f12725;
            StringBuilder sb = new StringBuilder(String.valueOf(str).length() + 6);
            sb.append("Write ");
            sb.append(str);
            RunnableC5529 runnableC5529M4194 = c1355.m4194(sb.toString());
            try {
                C1557 c1557 = new C1557();
                try {
                    C1770 c1770M3529 = c1109.m3529(uriBuild);
                    ArrayList arrayListM5046 = c1770M3529.m5046(c1770M3529.f7146.mo2017(c1770M3529.f7148));
                    new C1557[]{c1557}[0].m4518(arrayListM5046);
                    OutputStream outputStream = (OutputStream) arrayListM5046.get(0);
                    try {
                        ((AbstractC1126) obj).m3566(outputStream);
                        if (((C4003) c1557.f6204) == null) {
                            throw new zzsk("Cannot sync underlying stream");
                        }
                        ((OutputStream) c1557.f6205).flush();
                        ((C4003) c1557.f6204).f15064.getFD().sync();
                        outputStream.close();
                        runnableC5529M4194.close();
                        C1770 c1770M35292 = c1109.m3529(uriBuild);
                        C1770 c1770M35293 = c1109.m3529(uri);
                        InterfaceC3824 interfaceC3824 = c1770M35292.f7146;
                        if (interfaceC3824 != c1770M35293.f7146) {
                            throw new zzsk("Cannot rename file across backends");
                        }
                        interfaceC3824.mo2018(c1770M35292.f7148, c1770M35293.f7148);
                    } catch (Throwable th) {
                        if (outputStream != null) {
                            try {
                                outputStream.close();
                            } catch (Throwable th2) {
                                th.addSuppressed(th2);
                            }
                        }
                        throw th;
                    }
                } catch (IOException e) {
                    throw ᵼᵙᵖᵱ.ˎˑː(c1109, uri, e, str);
                }
            } finally {
            }
        } catch (IOException e2) {
            C1770 c1770M35294 = c1109.m3529(uriBuild);
            if (c1770M35294.f7146.mo2022(c1770M35294.f7148)) {
                try {
                    C1770 c1770M35295 = c1109.m3529(uriBuild);
                    c1770M35295.f7146.mo2019(c1770M35295.f7148);
                } catch (IOException e3) {
                    e2.addSuppressed(e3);
                }
            }
            throw e2;
        }
    }

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public void m7788(String str, String str2) {
        HashMap map = (HashMap) this.f12732;
        if (map != null) {
            map.put(str, str2);
        } else {
            ᵹˉᵞ.ᵳٴᵶ("Property \"autoMetadata\" has not been set");
        }
    }

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public C3681 m7789() {
        String strConcat = ((String) this.f12727) == null ? " transportName" : "";
        if (((C4621) this.f12724) == null) {
            strConcat = strConcat.concat(" encodedPayload");
        }
        if (((Long) this.f12726) == null) {
            strConcat = strConcat.concat(" eventMillis");
        }
        if (((Long) this.f12725) == null) {
            strConcat = strConcat.concat(" uptimeMillis");
        }
        if (((HashMap) this.f12732) == null) {
            strConcat = strConcat.concat(" autoMetadata");
        }
        if (strConcat.isEmpty()) {
            return new C3681((String) this.f12727, (Integer) this.f12729, (C4621) this.f12724, ((Long) this.f12726).longValue(), ((Long) this.f12725).longValue(), (HashMap) this.f12732, (Integer) this.f12730, (String) this.f12733, (byte[]) this.f12728, (byte[]) this.f12731);
        }
        ᵹˉᵞ.ᵳٴᵶ("Missing required properties:".concat(strConcat));
        return null;
    }

    /* JADX WARN: Removed duplicated region for block: B:16:0x0023 A[Catch: all -> 0x0017, TryCatch #1 {, blocks: (B:4:0x0003, B:6:0x0009, B:8:0x000f, B:13:0x001b, B:14:0x001d, B:16:0x0023, B:17:0x003e, B:18:0x0043), top: B:25:0x0003, inners: #0 }] */
    /* 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 com.google.common.util.concurrent.ListenableFuture m7790(defpackage.C0050 r9, java.util.concurrent.Executor r10) {
        /*
            r8 = this;
            java.lang.Object r1 = r8.f12732
            monitor-enter(r1)
            java.lang.Object r0 = r8.f12731     // Catch: java.lang.Throwable -> L17
            com.google.common.util.concurrent.ListenableFuture r0 = (com.google.common.util.concurrent.ListenableFuture) r0     // Catch: java.lang.Throwable -> L17
            if (r0 == 0) goto L1d
            boolean r0 = r0.isDone()     // Catch: java.lang.Throwable -> L17
            if (r0 == 0) goto L1d
            java.lang.Object r0 = r8.f12731     // Catch: java.lang.Throwable -> L17 java.util.concurrent.ExecutionException -> L1a
            com.google.common.util.concurrent.ListenableFuture r0 = (com.google.common.util.concurrent.ListenableFuture) r0     // Catch: java.lang.Throwable -> L17 java.util.concurrent.ExecutionException -> L1a
            defpackage.AbstractC2725.m6769(r0)     // Catch: java.lang.Throwable -> L17 java.util.concurrent.ExecutionException -> L1a
            goto L1d
        L17:
            r0 = move-exception
            r8 = r0
            goto L5d
        L1a:
            r0 = 0
            r8.f12731 = r0     // Catch: java.lang.Throwable -> L17
        L1d:
            java.lang.Object r0 = r8.f12731     // Catch: java.lang.Throwable -> L17
            com.google.common.util.concurrent.ListenableFuture r0 = (com.google.common.util.concurrent.ListenableFuture) r0     // Catch: java.lang.Throwable -> L17
            if (r0 != 0) goto L3e
            java.lang.Object r0 = r8.f12728     // Catch: java.lang.Throwable -> L17
            ᵪᵨ r0 = (ᵪᵨ) r0     // Catch: java.lang.Throwable -> L17
            ᵞˉᵜ r2 = new ᵞˉᵜ     // Catch: java.lang.Throwable -> L17
            r2.<init>(r8)     // Catch: java.lang.Throwable -> L17
            ˀـ r2 = defpackage.AbstractC4530.m9619(r2)     // Catch: java.lang.Throwable -> L17
            java.lang.Object r3 = r8.f12730     // Catch: java.lang.Throwable -> L17
            ᵼᵳˋˀ r3 = (defpackage.ExecutorC5302) r3     // Catch: java.lang.Throwable -> L17
            com.google.common.util.concurrent.ListenableFuture r0 = r0.ᵺʙ(r2, r3)     // Catch: java.lang.Throwable -> L17
            com.google.common.util.concurrent.ListenableFuture r0 = defpackage.AbstractC2725.m6764(r0)     // Catch: java.lang.Throwable -> L17
            r8.f12731 = r0     // Catch: java.lang.Throwable -> L17
        L3e:
            java.lang.Object r0 = r8.f12731     // Catch: java.lang.Throwable -> L17
            r4 = r0
            com.google.common.util.concurrent.ListenableFuture r4 = (com.google.common.util.concurrent.ListenableFuture) r4     // Catch: java.lang.Throwable -> L17
            monitor-exit(r1)     // Catch: java.lang.Throwable -> L17
            java.lang.Object r0 = r8.f12728
            ᵪᵨ r0 = (ᵪᵨ) r0
            ʻʻ r2 = new ʻʻ
            r7 = 11
            r3 = r8
            r5 = r9
            r6 = r10
            r2.<init>(r3, r4, r5, r6, r7)
            ˀـ r8 = defpackage.AbstractC4530.m9619(r2)
            ᵘᵝᵽˀ r9 = defpackage.EnumC2524.f9848
            com.google.common.util.concurrent.ListenableFuture r8 = r0.ᵺʙ(r8, r9)
            return r8
        L5d:
            monitor-exit(r1)     // Catch: java.lang.Throwable -> L17
            throw r8
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C3423.m7790(ʼˈ, java.util.concurrent.Executor):com.google.common.util.concurrent.ListenableFuture");
    }
}
