package com.ironsource; import android.net.Uri; import android.util.Pair; import com.google.firebase.perf.network.FirebasePerfUrlConnection; import com.mbridge.msdk.playercommon.exoplayer2.DefaultLoadControl; import java.io.DataOutputStream; import java.io.IOException; import java.net.HttpURLConnection; import java.net.ProtocolException; import java.net.URL; import java.net.URLConnection; import java.util.ArrayList; import java.util.List; import org.apache.http.protocol.HTTP; /* loaded from: classes2.dex */ public class ff { private static final String a = "POST"; private static final String b = "GET"; private static final String c = "ISHttpService"; public static class a { private static final int h = 15000; private static final int i = 15000; private static final String j = "UTF-8"; final String a; final String b; final String c; final int d; final int e; final String f; ArrayList> g; /* renamed from: com.ironsource.ff$a$a, reason: collision with other inner class name */ public static class C0170a { String b; String d; List> a = new ArrayList(); String c = "POST"; int e = DefaultLoadControl.DEFAULT_MIN_BUFFER_MS; int f = DefaultLoadControl.DEFAULT_MIN_BUFFER_MS; String g = "UTF-8"; public C0170a a(int i) { this.e = i; return this; } public C0170a a(Pair pair) { this.a.add(pair); return this; } public C0170a a(String str) { this.d = str; return this; } public C0170a a(List> list) { this.a.addAll(list); return this; } public a a() { return new a(this); } public C0170a b(int i) { this.f = i; return this; } public C0170a b(String str) { this.g = str; return this; } public C0170a c(String str) { this.b = str; return this; } public C0170a d(String str) { this.c = str; return this; } } public a(C0170a c0170a) { this.a = c0170a.b; this.b = c0170a.c; this.c = c0170a.d; this.g = new ArrayList<>(c0170a.a); this.d = c0170a.e; this.e = c0170a.f; this.f = c0170a.g; } public boolean a() { return "POST".equals(this.b); } } public static vo a(String str, String str2, List> list) throws Exception { Uri build = Uri.parse(str).buildUpon().encodedQuery(str2).build(); a.C0170a c0170a = new a.C0170a(); c0170a.c(build.toString()).a(str2).d("GET").a(list); return b(c0170a.a()); } private static HttpURLConnection a(a aVar) throws IOException { HttpURLConnection httpURLConnection = (HttpURLConnection) ((URLConnection) FirebasePerfUrlConnection.instrument(new URL(aVar.a).openConnection())); httpURLConnection.setConnectTimeout(aVar.d); httpURLConnection.setReadTimeout(aVar.e); httpURLConnection.setRequestMethod(aVar.b); return httpURLConnection; } private static void a(HttpURLConnection httpURLConnection, a aVar) throws Exception { if (aVar.a()) { byte[] bytes = aVar.c.getBytes(aVar.f); httpURLConnection.setRequestProperty(HTTP.CONTENT_LEN, Integer.toString(bytes.length)); a(httpURLConnection, bytes); } } private static void a(HttpURLConnection httpURLConnection, List> list) throws ProtocolException { for (Pair pair : list) { httpURLConnection.setRequestProperty((String) pair.first, (String) pair.second); } } private static void a(HttpURLConnection httpURLConnection, byte[] bArr) throws Exception { httpURLConnection.setDoOutput(true); DataOutputStream dataOutputStream = new DataOutputStream(httpURLConnection.getOutputStream()); try { dataOutputStream.write(bArr); dataOutputStream.flush(); } finally { dataOutputStream.close(); } } private static boolean a(String str, String str2) { return (str == null || str.isEmpty() || str2 == null || str2.isEmpty()) ? false : true; } /* JADX ERROR: Types fix failed java.lang.NullPointerException: Cannot invoke "jadx.core.dex.instructions.args.InsnArg.getType()" because "changeArg" is null at jadx.core.dex.visitors.typeinference.TypeUpdate.moveListener(TypeUpdate.java:439) at jadx.core.dex.visitors.typeinference.TypeUpdate.runListeners(TypeUpdate.java:232) at jadx.core.dex.visitors.typeinference.TypeUpdate.requestUpdate(TypeUpdate.java:212) at jadx.core.dex.visitors.typeinference.TypeUpdate.updateTypeForSsaVar(TypeUpdate.java:183) at jadx.core.dex.visitors.typeinference.TypeUpdate.updateTypeChecked(TypeUpdate.java:112) at jadx.core.dex.visitors.typeinference.TypeUpdate.apply(TypeUpdate.java:83) at jadx.core.dex.visitors.typeinference.TypeUpdate.apply(TypeUpdate.java:56) at jadx.core.dex.visitors.typeinference.FixTypesVisitor.tryPossibleTypes(FixTypesVisitor.java:183) at jadx.core.dex.visitors.typeinference.FixTypesVisitor.deduceType(FixTypesVisitor.java:242) at jadx.core.dex.visitors.typeinference.FixTypesVisitor.tryDeduceTypes(FixTypesVisitor.java:221) at jadx.core.dex.visitors.typeinference.FixTypesVisitor.visit(FixTypesVisitor.java:91) */ /* JADX WARN: Not initialized variable reg: 3, insn: 0x0065: MOVE (r7 I:??[OBJECT, ARRAY]) = (r3 I:??[OBJECT, ARRAY]), block:B:46:0x0065 */ public static com.ironsource.vo b(com.ironsource.ff.a r8) throws java.lang.Exception { /* Method dump skipped, instructions count: 205 To view this dump add '--comments-level debug' option */ throw new UnsupportedOperationException("Method not decompiled: com.ironsource.ff.b(com.ironsource.ff$a):com.ironsource.vo"); } public static vo b(String str, String str2, List> list) throws Exception { a.C0170a c0170a = new a.C0170a(); c0170a.c(str).a(str2).d("POST").a(list); return b(c0170a.a()); } }