discord-jadx/app/src/main/java/d0/e0/p/d/j.java

420 lines
19 KiB
Java

package d0.e0.p.d;
import com.discord.models.domain.ModelAuditLogEntry;
import d0.e0.f;
import d0.e0.p.d.c;
import d0.e0.p.d.c0;
import d0.e0.p.d.d;
import d0.e0.p.d.l0.a;
import d0.e0.p.d.l0.d;
import d0.e0.p.d.l0.e;
import d0.e0.p.d.l0.h;
import d0.e0.p.d.m0.c.e;
import d0.e0.p.d.m0.c.x;
import d0.z.d.a0;
import d0.z.d.i;
import d0.z.d.m;
import d0.z.d.o;
import d0.z.d.y;
import java.lang.reflect.Constructor;
import java.lang.reflect.Member;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import kotlin.NoWhenBranchMatchedException;
import kotlin.jvm.functions.Function0;
import kotlin.reflect.KFunction;
import kotlin.reflect.KProperty;
/* compiled from: KFunctionImpl.kt */
public final class j extends f<Object> implements i<Object>, KFunction<Object>, c {
public static final /* synthetic */ KProperty[] m = {a0.property1(new y(a0.getOrCreateKotlinClass(j.class), "descriptor", "getDescriptor()Lorg/jetbrains/kotlin/descriptors/FunctionDescriptor;")), a0.property1(new y(a0.getOrCreateKotlinClass(j.class), "caller", "getCaller()Lkotlin/reflect/jvm/internal/calls/Caller;")), a0.property1(new y(a0.getOrCreateKotlinClass(j.class), "defaultCaller", "getDefaultCaller()Lkotlin/reflect/jvm/internal/calls/Caller;"))};
public final c0.a n;
public final c0.b o;
public final c0.b p;
public final i q;
public final String r;
/* renamed from: s reason: collision with root package name */
public final Object f2524s;
/* compiled from: KFunctionImpl.kt */
public static final class a extends o implements Function0<d<? extends Member>> {
public final /* synthetic */ j this$0;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public a(j jVar) {
super(0);
this.this$0 = jVar;
}
/* Return type fixed from 'd0.e0.p.d.l0.d<java.lang.reflect.Member>' to match base method */
@Override // kotlin.jvm.functions.Function0
/* renamed from: invoke */
public final d<? extends Member> mo1invoke() {
Object obj;
d dVar;
a.EnumC0203a aVar = a.EnumC0203a.POSITIONAL_CALL;
d mapSignature = f0.b.mapSignature(this.this$0.getDescriptor());
if (mapSignature instanceof d.C0198d) {
if (this.this$0.b()) {
Class<?> jClass = this.this$0.getContainer().getJClass();
List<f> parameters = this.this$0.getParameters();
ArrayList arrayList = new ArrayList(d0.t.o.collectionSizeOrDefault(parameters, 10));
for (f fVar : parameters) {
String name = fVar.getName();
m.checkNotNull(name);
arrayList.add(name);
}
return new d0.e0.p.d.l0.a(jClass, arrayList, aVar, a.b.KOTLIN, null, 16, null);
}
obj = this.this$0.getContainer().findConstructorBySignature(((d.C0198d) mapSignature).getConstructorDesc());
} else if (mapSignature instanceof d.e) {
d.e eVar = (d.e) mapSignature;
obj = this.this$0.getContainer().findMethodBySignature(eVar.getMethodName(), eVar.getMethodDesc());
} else if (mapSignature instanceof d.c) {
obj = ((d.c) mapSignature).getMethod();
} else if (mapSignature instanceof d.b) {
obj = ((d.b) mapSignature).getConstructor();
} else if (mapSignature instanceof d.a) {
List<Method> methods = ((d.a) mapSignature).getMethods();
Class<?> jClass2 = this.this$0.getContainer().getJClass();
ArrayList arrayList2 = new ArrayList(d0.t.o.collectionSizeOrDefault(methods, 10));
for (Method method : methods) {
m.checkNotNullExpressionValue(method, "it");
arrayList2.add(method.getName());
}
return new d0.e0.p.d.l0.a(jClass2, arrayList2, aVar, a.b.JAVA, methods);
} else {
throw new NoWhenBranchMatchedException();
}
if (obj instanceof Constructor) {
j jVar = this.this$0;
dVar = j.access$createConstructorCaller(jVar, (Constructor) obj, jVar.getDescriptor());
} else if (obj instanceof Method) {
Method method2 = (Method) obj;
dVar = !Modifier.isStatic(method2.getModifiers()) ? j.access$createInstanceMethodCaller(this.this$0, method2) : this.this$0.getDescriptor().getAnnotations().findAnnotation(j0.getJVM_STATIC()) != null ? j.access$createJvmStaticInObjectCaller(this.this$0, method2) : j.access$createStaticMethodCaller(this.this$0, method2);
} else {
StringBuilder R = c.d.b.a.a.R("Could not compute caller for function: ");
R.append(this.this$0.getDescriptor());
R.append(" (member = ");
R.append(obj);
R.append(')');
throw new a0(R.toString());
}
return h.createInlineClassAwareCallerIfNeeded$default(dVar, this.this$0.getDescriptor(), false, 2, null);
}
}
/* compiled from: KFunctionImpl.kt */
public static final class b extends o implements Function0<d0.e0.p.d.l0.d<? extends Member>> {
public final /* synthetic */ j this$0;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public b(j jVar) {
super(0);
this.this$0 = jVar;
}
/* Return type fixed from 'd0.e0.p.d.l0.d<java.lang.reflect.Member>' to match base method */
@Override // kotlin.jvm.functions.Function0
/* renamed from: invoke */
public final d0.e0.p.d.l0.d<? extends Member> mo1invoke() {
Object obj;
d0.e0.p.d.l0.d dVar;
a.EnumC0203a aVar = a.EnumC0203a.CALL_BY_NAME;
d mapSignature = f0.b.mapSignature(this.this$0.getDescriptor());
if (mapSignature instanceof d.e) {
i container = this.this$0.getContainer();
d.e eVar = (d.e) mapSignature;
String methodName = eVar.getMethodName();
String methodDesc = eVar.getMethodDesc();
Member member = this.this$0.getCaller().getMember();
m.checkNotNull(member);
obj = container.findDefaultMethod(methodName, methodDesc, !Modifier.isStatic(member.getModifiers()));
} else if (mapSignature instanceof d.C0198d) {
if (this.this$0.b()) {
Class<?> jClass = this.this$0.getContainer().getJClass();
List<f> parameters = this.this$0.getParameters();
ArrayList arrayList = new ArrayList(d0.t.o.collectionSizeOrDefault(parameters, 10));
for (f fVar : parameters) {
String name = fVar.getName();
m.checkNotNull(name);
arrayList.add(name);
}
return new d0.e0.p.d.l0.a(jClass, arrayList, aVar, a.b.KOTLIN, null, 16, null);
}
obj = this.this$0.getContainer().findDefaultConstructor(((d.C0198d) mapSignature).getConstructorDesc());
} else if (mapSignature instanceof d.a) {
List<Method> methods = ((d.a) mapSignature).getMethods();
Class<?> jClass2 = this.this$0.getContainer().getJClass();
ArrayList arrayList2 = new ArrayList(d0.t.o.collectionSizeOrDefault(methods, 10));
for (Method method : methods) {
m.checkNotNullExpressionValue(method, "it");
arrayList2.add(method.getName());
}
return new d0.e0.p.d.l0.a(jClass2, arrayList2, aVar, a.b.JAVA, methods);
} else {
obj = null;
}
if (obj instanceof Constructor) {
j jVar = this.this$0;
dVar = j.access$createConstructorCaller(jVar, (Constructor) obj, jVar.getDescriptor());
} else if (obj instanceof Method) {
if (this.this$0.getDescriptor().getAnnotations().findAnnotation(j0.getJVM_STATIC()) != null) {
d0.e0.p.d.m0.c.m containingDeclaration = this.this$0.getDescriptor().getContainingDeclaration();
Objects.requireNonNull(containingDeclaration, "null cannot be cast to non-null type org.jetbrains.kotlin.descriptors.ClassDescriptor");
if (!((e) containingDeclaration).isCompanionObject()) {
dVar = j.access$createJvmStaticInObjectCaller(this.this$0, (Method) obj);
}
}
dVar = j.access$createStaticMethodCaller(this.this$0, (Method) obj);
} else {
dVar = null;
}
if (dVar != null) {
return h.createInlineClassAwareCallerIfNeeded(dVar, this.this$0.getDescriptor(), true);
}
return null;
}
}
/* compiled from: KFunctionImpl.kt */
public static final class c extends o implements Function0<x> {
public final /* synthetic */ String $name;
public final /* synthetic */ j this$0;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public c(j jVar, String str) {
super(0);
this.this$0 = jVar;
this.$name = str;
}
@Override // kotlin.jvm.functions.Function0
/* renamed from: invoke */
public final x mo1invoke() {
return this.this$0.getContainer().findFunctionDescriptor(this.$name, j.access$getSignature$p(this.this$0));
}
}
/* JADX WARNING: Illegal instructions before constructor call */
public j(i iVar, x xVar) {
this(iVar, r3, f0.b.mapSignature(xVar).asString(), xVar, d0.z.d.d.NO_RECEIVER);
m.checkNotNullParameter(iVar, "container");
m.checkNotNullParameter(xVar, "descriptor");
String asString = xVar.getName().asString();
m.checkNotNullExpressionValue(asString, "descriptor.name.asString()");
}
public j(i iVar, String str, String str2, x xVar, Object obj) {
this.q = iVar;
this.r = str2;
this.f2524s = obj;
this.n = c0.lazySoft(xVar, new c(this, str));
this.o = c0.lazy(new a(this));
this.p = c0.lazy(new b(this));
}
/* JADX INFO: this call moved to the top of the method (can break code semantics) */
public j(i iVar, String str, String str2, Object obj) {
this(iVar, str, str2, null, obj);
m.checkNotNullParameter(iVar, "container");
m.checkNotNullParameter(str, ModelAuditLogEntry.CHANGE_KEY_NAME);
m.checkNotNullParameter(str2, "signature");
}
public static final d0.e0.p.d.l0.e access$createConstructorCaller(j jVar, Constructor constructor, x xVar) {
Objects.requireNonNull(jVar);
return d0.e0.p.d.m0.k.y.a.shouldHideConstructorDueToInlineClassTypeValueParameters(xVar) ? jVar.isBound() ? new e.a(constructor, jVar.getBoundReceiver()) : new e.b(constructor) : jVar.isBound() ? new e.c(constructor, jVar.getBoundReceiver()) : new e.C0205e(constructor);
}
public static final e.h access$createInstanceMethodCaller(j jVar, Method method) {
return jVar.isBound() ? new e.h.a(method, jVar.getBoundReceiver()) : new e.h.d(method);
}
public static final e.h access$createJvmStaticInObjectCaller(j jVar, Method method) {
return jVar.isBound() ? new e.h.b(method) : new e.h.C0208e(method);
}
public static final e.h access$createStaticMethodCaller(j jVar, Method method) {
return jVar.isBound() ? new e.h.c(method, jVar.getBoundReceiver()) : new e.h.f(method);
}
public static final /* synthetic */ String access$getSignature$p(j jVar) {
return jVar.r;
}
public boolean equals(Object obj) {
j asKFunctionImpl = j0.asKFunctionImpl(obj);
return asKFunctionImpl != null && m.areEqual(getContainer(), asKFunctionImpl.getContainer()) && m.areEqual(getName(), asKFunctionImpl.getName()) && m.areEqual(this.r, asKFunctionImpl.r) && m.areEqual(this.f2524s, asKFunctionImpl.f2524s);
}
@Override // d0.z.d.i
public int getArity() {
return d0.e0.p.d.l0.f.getArity(getCaller());
}
public final Object getBoundReceiver() {
return h.coerceToExpectedReceiverType(this.f2524s, getDescriptor());
}
@Override // d0.e0.p.d.f
public d0.e0.p.d.l0.d<?> getCaller() {
return this.o.getValue(this, m[1]);
}
@Override // d0.e0.p.d.f
public i getContainer() {
return this.q;
}
@Override // d0.e0.p.d.f
public d0.e0.p.d.l0.d<?> getDefaultCaller() {
return this.p.getValue(this, m[2]);
}
@Override // d0.e0.p.d.f
public x getDescriptor() {
return this.n.getValue(this, m[0]);
}
@Override // kotlin.reflect.KCallable
public String getName() {
String asString = getDescriptor().getName().asString();
m.checkNotNullExpressionValue(asString, "descriptor.name.asString()");
return asString;
}
public int hashCode() {
int hashCode = getName().hashCode();
return this.r.hashCode() + ((hashCode + (getContainer().hashCode() * 31)) * 31);
}
@Override // kotlin.jvm.functions.Function0
/* renamed from: invoke */
public Object mo1invoke() {
return c.a.invoke(this);
}
@Override // kotlin.jvm.functions.Function1
public Object invoke(Object obj) {
return c.a.invoke(this, obj);
}
@Override // kotlin.jvm.functions.Function2
public Object invoke(Object obj, Object obj2) {
return c.a.invoke(this, obj, obj2);
}
@Override // kotlin.jvm.functions.Function3
public Object invoke(Object obj, Object obj2, Object obj3) {
return c.a.invoke(this, obj, obj2, obj3);
}
@Override // kotlin.jvm.functions.Function4
public Object invoke(Object obj, Object obj2, Object obj3, Object obj4) {
return c.a.invoke(this, obj, obj2, obj3, obj4);
}
@Override // kotlin.jvm.functions.Function5
public Object invoke(Object obj, Object obj2, Object obj3, Object obj4, Object obj5) {
return c.a.invoke(this, obj, obj2, obj3, obj4, obj5);
}
@Override // kotlin.jvm.functions.Function6
public Object invoke(Object obj, Object obj2, Object obj3, Object obj4, Object obj5, Object obj6) {
return c.a.invoke(this, obj, obj2, obj3, obj4, obj5, obj6);
}
@Override // kotlin.jvm.functions.Function7
public Object invoke(Object obj, Object obj2, Object obj3, Object obj4, Object obj5, Object obj6, Object obj7) {
return c.a.invoke(this, obj, obj2, obj3, obj4, obj5, obj6, obj7);
}
@Override // kotlin.jvm.functions.Function8
public Object invoke(Object obj, Object obj2, Object obj3, Object obj4, Object obj5, Object obj6, Object obj7, Object obj8) {
return c.a.invoke(this, obj, obj2, obj3, obj4, obj5, obj6, obj7, obj8);
}
@Override // kotlin.jvm.functions.Function9
public Object invoke(Object obj, Object obj2, Object obj3, Object obj4, Object obj5, Object obj6, Object obj7, Object obj8, Object obj9) {
return c.a.invoke(this, obj, obj2, obj3, obj4, obj5, obj6, obj7, obj8, obj9);
}
@Override // kotlin.jvm.functions.Function10
public Object invoke(Object obj, Object obj2, Object obj3, Object obj4, Object obj5, Object obj6, Object obj7, Object obj8, Object obj9, Object obj10) {
return c.a.invoke(this, obj, obj2, obj3, obj4, obj5, obj6, obj7, obj8, obj9, obj10);
}
@Override // kotlin.jvm.functions.Function11
public Object invoke(Object obj, Object obj2, Object obj3, Object obj4, Object obj5, Object obj6, Object obj7, Object obj8, Object obj9, Object obj10, Object obj11) {
return c.a.invoke(this, obj, obj2, obj3, obj4, obj5, obj6, obj7, obj8, obj9, obj10, obj11);
}
@Override // kotlin.jvm.functions.Function12
public Object invoke(Object obj, Object obj2, Object obj3, Object obj4, Object obj5, Object obj6, Object obj7, Object obj8, Object obj9, Object obj10, Object obj11, Object obj12) {
return c.a.invoke(this, obj, obj2, obj3, obj4, obj5, obj6, obj7, obj8, obj9, obj10, obj11, obj12);
}
@Override // kotlin.jvm.functions.Function13
public Object invoke(Object obj, Object obj2, Object obj3, Object obj4, Object obj5, Object obj6, Object obj7, Object obj8, Object obj9, Object obj10, Object obj11, Object obj12, Object obj13) {
return c.a.invoke(this, obj, obj2, obj3, obj4, obj5, obj6, obj7, obj8, obj9, obj10, obj11, obj12, obj13);
}
@Override // kotlin.jvm.functions.Function14
public Object invoke(Object obj, Object obj2, Object obj3, Object obj4, Object obj5, Object obj6, Object obj7, Object obj8, Object obj9, Object obj10, Object obj11, Object obj12, Object obj13, Object obj14) {
return c.a.invoke(this, obj, obj2, obj3, obj4, obj5, obj6, obj7, obj8, obj9, obj10, obj11, obj12, obj13, obj14);
}
@Override // kotlin.jvm.functions.Function15
public Object invoke(Object obj, Object obj2, Object obj3, Object obj4, Object obj5, Object obj6, Object obj7, Object obj8, Object obj9, Object obj10, Object obj11, Object obj12, Object obj13, Object obj14, Object obj15) {
return c.a.invoke(this, obj, obj2, obj3, obj4, obj5, obj6, obj7, obj8, obj9, obj10, obj11, obj12, obj13, obj14, obj15);
}
@Override // kotlin.jvm.functions.Function16
public Object invoke(Object obj, Object obj2, Object obj3, Object obj4, Object obj5, Object obj6, Object obj7, Object obj8, Object obj9, Object obj10, Object obj11, Object obj12, Object obj13, Object obj14, Object obj15, Object obj16) {
return c.a.invoke(this, obj, obj2, obj3, obj4, obj5, obj6, obj7, obj8, obj9, obj10, obj11, obj12, obj13, obj14, obj15, obj16);
}
@Override // kotlin.jvm.functions.Function19
public Object invoke(Object obj, Object obj2, Object obj3, Object obj4, Object obj5, Object obj6, Object obj7, Object obj8, Object obj9, Object obj10, Object obj11, Object obj12, Object obj13, Object obj14, Object obj15, Object obj16, Object obj17, Object obj18, Object obj19) {
return c.a.invoke(this, obj, obj2, obj3, obj4, obj5, obj6, obj7, obj8, obj9, obj10, obj11, obj12, obj13, obj14, obj15, obj16, obj17, obj18, obj19);
}
@Override // d0.e0.p.d.f
public boolean isBound() {
return !m.areEqual(this.f2524s, d0.z.d.d.NO_RECEIVER);
}
@Override // kotlin.reflect.KFunction
public boolean isExternal() {
return getDescriptor().isExternal();
}
@Override // kotlin.reflect.KFunction
public boolean isInfix() {
return getDescriptor().isInfix();
}
@Override // kotlin.reflect.KFunction
public boolean isInline() {
return getDescriptor().isInline();
}
@Override // kotlin.reflect.KFunction
public boolean isOperator() {
return getDescriptor().isOperator();
}
@Override // kotlin.reflect.KCallable, kotlin.reflect.KFunction
public boolean isSuspend() {
return getDescriptor().isSuspend();
}
public String toString() {
return e0.b.renderFunction(getDescriptor());
}
}