package p138.p176.p291.p296.p297.p306.p308;

import java.io.File;
import java.io.IOException;
import p138.p139.p143.p144.C2803;
import p138.p176.p177.p242.p246.p251.C4303;
import p138.p176.p291.p296.p297.C5608;
import p138.p176.p291.p296.p297.p299.AbstractC5621;
import p138.p176.p291.p296.p297.p303.C5819;
import p138.p176.p291.p296.p297.p303.C5820;
import p138.p176.p291.p296.p297.p303.EnumC5818;
import p138.p176.p291.p296.p297.p306.p307.C5842;
import p138.p176.p291.p296.p297.p306.p307.InterfaceC5844;

/* JADX INFO: renamed from: ދ.ހ.ށ.ބ.ށ.ލ.ށ.ށ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public class C5850 extends AbstractC5621 implements InterfaceC5848 {

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public final String f16568;

    public C5850(String str, String str2, C5820 c5820, String str3) {
        super(str, str2, c5820, EnumC5818.POST);
        this.f16568 = str3;
    }

    @Override // p138.p176.p291.p296.p297.p306.p308.InterfaceC5848
    /* JADX INFO: renamed from: ֏ */
    public boolean mo9195(C5842 c5842, boolean z) {
        if (!z) {
            throw new RuntimeException("An invalid data collection token was used.");
        }
        C5819 c5819M8983 = m8983();
        String str = c5842.f16556;
        c5819M8983.f16507.put("User-Agent", "Crashlytics Android SDK/17.0.0");
        c5819M8983.f16507.put("X-CRASHLYTICS-API-CLIENT-TYPE", "android");
        c5819M8983.f16507.put("X-CRASHLYTICS-API-CLIENT-VERSION", this.f16568);
        c5819M8983.f16507.put("X-CRASHLYTICS-GOOGLE-APP-ID", str);
        String str2 = c5842.f16555;
        InterfaceC5844 interfaceC5844 = c5842.f16557;
        if (str2 != null) {
            c5819M8983.m9123("org_id", str2);
        }
        c5819M8983.m9123("report_id", interfaceC5844.mo9192());
        for (File file : interfaceC5844.mo9190()) {
            if (file.getName().equals("minidump")) {
                c5819M8983.m9124("minidump_file", file.getName(), "application/octet-stream", file);
            } else if (file.getName().equals("metadata")) {
                c5819M8983.m9124("crash_meta_file", file.getName(), "application/octet-stream", file);
            } else if (file.getName().equals("binaryImages")) {
                c5819M8983.m9124("binary_images_file", file.getName(), "application/octet-stream", file);
            } else if (file.getName().equals("session")) {
                c5819M8983.m9124("session_meta_file", file.getName(), "application/octet-stream", file);
            } else if (file.getName().equals("app")) {
                c5819M8983.m9124("app_meta_file", file.getName(), "application/octet-stream", file);
            } else if (file.getName().equals("device")) {
                c5819M8983.m9124("device_meta_file", file.getName(), "application/octet-stream", file);
            } else if (file.getName().equals("os")) {
                c5819M8983.m9124("os_meta_file", file.getName(), "application/octet-stream", file);
            } else if (file.getName().equals("user")) {
                c5819M8983.m9124("user_meta_file", file.getName(), "application/octet-stream", file);
            } else if (file.getName().equals("logs")) {
                c5819M8983.m9124("logs_file", file.getName(), "application/octet-stream", file);
            } else if (file.getName().equals("keys")) {
                c5819M8983.m9124("keys_file", file.getName(), "application/octet-stream", file);
            }
        }
        C5608 c5608 = C5608.f16066;
        StringBuilder sbM4889 = C2803.m4889("Sending report to: ");
        sbM4889.append(this.f16093);
        c5608.m8972(sbM4889.toString());
        try {
            int i = c5819M8983.m9125().f16509;
            C5608.f16066.m8972("Result was: " + i);
            return C4303.m7188(i) == 0;
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
