package retrofit2; import android.os.Build; import android.os.Handler; import android.os.Looper; import java.lang.invoke.MethodHandles; import java.lang.reflect.Constructor; import java.lang.reflect.Method; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.concurrent.Executor; import retrofit2.c; import retrofit2.f; /* compiled from: Platform */ public class o { /* renamed from: c reason: collision with root package name */ public static final o f125931c = e(); /* renamed from: a reason: collision with root package name */ public final boolean f125932a; /* renamed from: b reason: collision with root package name */ public final Constructor<MethodHandles.Lookup> f125933b; /* compiled from: Platform */ public static final class a extends o { /* renamed from: retrofit2.o$a$a reason: collision with other inner class name */ /* compiled from: Platform */ public static final class ExecutorC1996a implements Executor { /* renamed from: a reason: collision with root package name */ public final Handler f125934a = new Handler(Looper.getMainLooper()); public void execute(Runnable runnable) { this.f125934a.post(runnable); } } /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public a() { super(Build.VERSION.SDK_INT >= 24); } @Override // retrofit2.o public Executor b() { return new ExecutorC1996a(); } @Override // retrofit2.o public Object g(Method method, Class<?> cls, Object obj, Object... objArr) throws Throwable { if (Build.VERSION.SDK_INT >= 26) { return o.super.g(method, cls, obj, objArr); } throw new UnsupportedOperationException("Calling default methods on API 24 and 25 is not supported"); } } public o(boolean z14) { this.f125932a = z14; Constructor<MethodHandles.Lookup> constructor = null; if (z14) { try { constructor = MethodHandles.Lookup.class.getDeclaredConstructor(Class.class, Integer.TYPE); constructor.setAccessible(true); } catch (NoClassDefFoundError | NoSuchMethodException unused) { } } this.f125933b = constructor; } public static o e() { if ("Dalvik".equals(System.getProperty("java.vm.name"))) { return new a(); } return new o(true); } public static o f() { return f125931c; } public List<? extends c.a> a(Executor executor) { g gVar = new g(executor); if (!this.f125932a) { return Collections.singletonList(gVar); } return Arrays.asList(e.f125842a, gVar); } public Executor b() { return null; } public List<? extends f.a> c() { return this.f125932a ? Collections.singletonList(m.f125884a) : Collections.emptyList(); } public int d() { return this.f125932a ? 1 : 0; } public Object g(Method method, Class<?> cls, Object obj, Object... objArr) throws Throwable { MethodHandles.Lookup lookup; Constructor<MethodHandles.Lookup> constructor = this.f125933b; if (constructor != null) { lookup = constructor.newInstance(cls, -1); } else { lookup = MethodHandles.lookup(); } return lookup.unreflectSpecial(method, cls).bindTo(obj).invokeWithArguments(objArr); } public boolean h(Method method) { return this.f125932a && method.isDefault(); } }