2021-06-27 20:44:35 +00:00
|
|
|
package c.e.b;
|
|
|
|
|
|
|
|
import c.d.b.a.a;
|
|
|
|
import h0.a.a.f;
|
|
|
|
import h0.a.a.p;
|
|
|
|
import h0.a.a.q;
|
|
|
|
import h0.a.a.w;
|
|
|
|
import java.lang.reflect.Method;
|
|
|
|
import java.lang.reflect.Modifier;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Arrays;
|
|
|
|
/* compiled from: MethodAccess */
|
|
|
|
public abstract class d {
|
|
|
|
public String[] a;
|
|
|
|
public Class[][] b;
|
|
|
|
|
|
|
|
public static void a(Class cls, ArrayList<Method> arrayList) {
|
|
|
|
Method[] declaredMethods = cls.getDeclaredMethods();
|
|
|
|
for (Method method : declaredMethods) {
|
|
|
|
if (!Modifier.isPrivate(method.getModifiers())) {
|
|
|
|
arrayList.add(method);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static d b(Class cls) {
|
|
|
|
Class[][] clsArr;
|
|
|
|
Class<?> cls2;
|
|
|
|
String str;
|
|
|
|
q qVar;
|
|
|
|
q qVar2;
|
|
|
|
p pVar;
|
|
|
|
int i;
|
|
|
|
p[] pVarArr;
|
|
|
|
Class[] clsArr2;
|
|
|
|
String str2;
|
|
|
|
Class[][] clsArr3;
|
|
|
|
ArrayList arrayList = new ArrayList();
|
|
|
|
boolean isInterface = cls.isInterface();
|
|
|
|
if (!isInterface) {
|
|
|
|
for (Class cls3 = cls; cls3 != Object.class; cls3 = cls3.getSuperclass()) {
|
|
|
|
a(cls3, arrayList);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
e(cls, arrayList);
|
|
|
|
}
|
|
|
|
int size = arrayList.size();
|
|
|
|
String[] strArr = new String[size];
|
|
|
|
Class[][] clsArr4 = new Class[size][];
|
|
|
|
Class[] clsArr5 = new Class[size];
|
|
|
|
for (int i2 = 0; i2 < size; i2++) {
|
|
|
|
Method method = (Method) arrayList.get(i2);
|
|
|
|
strArr[i2] = method.getName();
|
|
|
|
clsArr4[i2] = method.getParameterTypes();
|
|
|
|
clsArr5[i2] = method.getReturnType();
|
|
|
|
}
|
|
|
|
String name = cls.getName();
|
2021-07-13 20:23:20 +00:00
|
|
|
String t = a.t(name, "MethodAccess");
|
|
|
|
if (t.startsWith("java.")) {
|
|
|
|
t = a.t("reflectasm.", t);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
a b = a.b(cls);
|
|
|
|
try {
|
2021-07-13 20:23:20 +00:00
|
|
|
cls2 = b.loadClass(t);
|
2021-06-27 20:44:35 +00:00
|
|
|
clsArr = clsArr4;
|
|
|
|
} catch (ClassNotFoundException unused) {
|
|
|
|
synchronized (b) {
|
|
|
|
try {
|
2021-07-13 20:23:20 +00:00
|
|
|
cls2 = b.loadClass(t);
|
2021-06-27 20:44:35 +00:00
|
|
|
clsArr = clsArr4;
|
|
|
|
} catch (ClassNotFoundException unused2) {
|
2021-07-13 20:23:20 +00:00
|
|
|
String replace = t.replace('.', '/');
|
2021-06-27 20:44:35 +00:00
|
|
|
String replace2 = name.replace('.', '/');
|
|
|
|
f fVar = new f(1);
|
|
|
|
fVar.c(196653, 33, replace, null, "com/esotericsoftware/reflectasm/MethodAccess", null);
|
|
|
|
q e = fVar.e(1, "<init>", "()V", null, null);
|
|
|
|
e.t(25, 0);
|
|
|
|
e.o(183, "com/esotericsoftware/reflectasm/MethodAccess", "<init>", "()V");
|
|
|
|
e.e(177);
|
|
|
|
e.n(0, 0);
|
|
|
|
q e2 = fVar.e(129, "invoke", "(Ljava/lang/Object;I[Ljava/lang/Object;)Ljava/lang/Object;", null, null);
|
|
|
|
if (!arrayList.isEmpty()) {
|
|
|
|
e2.t(25, 1);
|
|
|
|
e2.s(192, replace2);
|
|
|
|
e2.t(58, 4);
|
|
|
|
e2.t(21, 2);
|
|
|
|
p[] pVarArr2 = new p[size];
|
|
|
|
for (int i3 = 0; i3 < size; i3++) {
|
|
|
|
pVarArr2[i3] = new p();
|
|
|
|
}
|
|
|
|
p pVar2 = new p();
|
|
|
|
e2.q(0, size - 1, pVar2, pVarArr2);
|
|
|
|
StringBuilder sb = new StringBuilder(128);
|
|
|
|
int i4 = 0;
|
|
|
|
while (i4 < size) {
|
|
|
|
e2.i(pVarArr2[i4]);
|
|
|
|
if (i4 == 0) {
|
|
|
|
i = i4;
|
|
|
|
pVar = pVar2;
|
|
|
|
pVarArr = pVarArr2;
|
|
|
|
qVar2 = e2;
|
|
|
|
e2.c(1, 1, new Object[]{replace2}, 0, null);
|
|
|
|
} else {
|
|
|
|
i = i4;
|
|
|
|
pVar = pVar2;
|
|
|
|
pVarArr = pVarArr2;
|
|
|
|
qVar2 = e2;
|
|
|
|
qVar2.c(3, 0, null, 0, null);
|
|
|
|
}
|
|
|
|
e2 = qVar2;
|
|
|
|
e2.t(25, 4);
|
|
|
|
sb.setLength(0);
|
|
|
|
sb.append('(');
|
|
|
|
Class[] clsArr6 = clsArr4[i];
|
|
|
|
Class cls4 = clsArr5[i];
|
|
|
|
int i5 = 0;
|
|
|
|
while (i5 < clsArr6.length) {
|
|
|
|
e2.t(25, 3);
|
|
|
|
e2.g(16, i5);
|
|
|
|
e2.e(50);
|
|
|
|
w j = w.j(clsArr6[i5]);
|
|
|
|
switch (j.i()) {
|
|
|
|
case 1:
|
|
|
|
clsArr3 = clsArr4;
|
2021-07-13 20:23:20 +00:00
|
|
|
str2 = t;
|
2021-06-27 20:44:35 +00:00
|
|
|
clsArr2 = clsArr6;
|
|
|
|
e2.s(192, "java/lang/Boolean");
|
|
|
|
e2.o(182, "java/lang/Boolean", "booleanValue", "()Z");
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
clsArr3 = clsArr4;
|
2021-07-13 20:23:20 +00:00
|
|
|
str2 = t;
|
2021-06-27 20:44:35 +00:00
|
|
|
clsArr2 = clsArr6;
|
|
|
|
e2.s(192, "java/lang/Character");
|
|
|
|
e2.o(182, "java/lang/Character", "charValue", "()C");
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
clsArr3 = clsArr4;
|
2021-07-13 20:23:20 +00:00
|
|
|
str2 = t;
|
2021-06-27 20:44:35 +00:00
|
|
|
clsArr2 = clsArr6;
|
|
|
|
e2.s(192, "java/lang/Byte");
|
|
|
|
e2.o(182, "java/lang/Byte", "byteValue", "()B");
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
clsArr3 = clsArr4;
|
2021-07-13 20:23:20 +00:00
|
|
|
str2 = t;
|
2021-06-27 20:44:35 +00:00
|
|
|
clsArr2 = clsArr6;
|
|
|
|
e2.s(192, "java/lang/Short");
|
|
|
|
e2.o(182, "java/lang/Short", "shortValue", "()S");
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
clsArr3 = clsArr4;
|
2021-07-13 20:23:20 +00:00
|
|
|
str2 = t;
|
2021-06-27 20:44:35 +00:00
|
|
|
clsArr2 = clsArr6;
|
|
|
|
e2.s(192, "java/lang/Integer");
|
|
|
|
e2.o(182, "java/lang/Integer", "intValue", "()I");
|
|
|
|
break;
|
|
|
|
case 6:
|
|
|
|
clsArr3 = clsArr4;
|
2021-07-13 20:23:20 +00:00
|
|
|
str2 = t;
|
2021-06-27 20:44:35 +00:00
|
|
|
clsArr2 = clsArr6;
|
|
|
|
e2.s(192, "java/lang/Float");
|
|
|
|
e2.o(182, "java/lang/Float", "floatValue", "()F");
|
|
|
|
break;
|
|
|
|
case 7:
|
|
|
|
clsArr3 = clsArr4;
|
2021-07-13 20:23:20 +00:00
|
|
|
str2 = t;
|
2021-06-27 20:44:35 +00:00
|
|
|
clsArr2 = clsArr6;
|
|
|
|
e2.s(192, "java/lang/Long");
|
|
|
|
e2.o(182, "java/lang/Long", "longValue", "()J");
|
|
|
|
break;
|
|
|
|
case 8:
|
|
|
|
clsArr2 = clsArr6;
|
|
|
|
e2.s(192, "java/lang/Double");
|
|
|
|
clsArr3 = clsArr4;
|
2021-07-13 20:23:20 +00:00
|
|
|
str2 = t;
|
2021-06-27 20:44:35 +00:00
|
|
|
e2.o(182, "java/lang/Double", "doubleValue", "()D");
|
|
|
|
break;
|
|
|
|
case 9:
|
|
|
|
clsArr2 = clsArr6;
|
|
|
|
e2.s(192, j.d());
|
|
|
|
clsArr3 = clsArr4;
|
2021-07-13 20:23:20 +00:00
|
|
|
str2 = t;
|
2021-06-27 20:44:35 +00:00
|
|
|
break;
|
|
|
|
case 10:
|
|
|
|
clsArr2 = clsArr6;
|
|
|
|
e2.s(192, j.g());
|
|
|
|
clsArr3 = clsArr4;
|
2021-07-13 20:23:20 +00:00
|
|
|
str2 = t;
|
2021-06-27 20:44:35 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
clsArr3 = clsArr4;
|
2021-07-13 20:23:20 +00:00
|
|
|
str2 = t;
|
2021-06-27 20:44:35 +00:00
|
|
|
clsArr2 = clsArr6;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
sb.append(j.d());
|
|
|
|
i5++;
|
|
|
|
clsArr6 = clsArr2;
|
|
|
|
clsArr5 = clsArr5;
|
|
|
|
clsArr4 = clsArr3;
|
2021-07-13 20:23:20 +00:00
|
|
|
t = str2;
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
sb.append(')');
|
|
|
|
sb.append(w.e(cls4));
|
|
|
|
e2.o(isInterface ? 185 : Modifier.isStatic(((Method) arrayList.get(i)).getModifiers()) ? 184 : 182, replace2, strArr[i], sb.toString());
|
|
|
|
switch (w.j(cls4).i()) {
|
|
|
|
case 0:
|
|
|
|
e2.e(1);
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
e2.o(184, "java/lang/Boolean", "valueOf", "(Z)Ljava/lang/Boolean;");
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
e2.o(184, "java/lang/Character", "valueOf", "(C)Ljava/lang/Character;");
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
e2.o(184, "java/lang/Byte", "valueOf", "(B)Ljava/lang/Byte;");
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
e2.o(184, "java/lang/Short", "valueOf", "(S)Ljava/lang/Short;");
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
e2.o(184, "java/lang/Integer", "valueOf", "(I)Ljava/lang/Integer;");
|
|
|
|
break;
|
|
|
|
case 6:
|
|
|
|
e2.o(184, "java/lang/Float", "valueOf", "(F)Ljava/lang/Float;");
|
|
|
|
break;
|
|
|
|
case 7:
|
|
|
|
e2.o(184, "java/lang/Long", "valueOf", "(J)Ljava/lang/Long;");
|
|
|
|
break;
|
|
|
|
case 8:
|
|
|
|
e2.o(184, "java/lang/Double", "valueOf", "(D)Ljava/lang/Double;");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
e2.e(176);
|
|
|
|
i4 = i + 1;
|
|
|
|
size = size;
|
|
|
|
pVarArr2 = pVarArr;
|
|
|
|
clsArr5 = clsArr5;
|
|
|
|
clsArr4 = clsArr4;
|
2021-07-13 20:23:20 +00:00
|
|
|
t = t;
|
2021-06-27 20:44:35 +00:00
|
|
|
pVar2 = pVar;
|
|
|
|
}
|
|
|
|
clsArr = clsArr4;
|
2021-07-13 20:23:20 +00:00
|
|
|
str = t;
|
2021-06-27 20:44:35 +00:00
|
|
|
e2.i(pVar2);
|
|
|
|
qVar = e2;
|
|
|
|
e2.c(3, 0, null, 0, null);
|
|
|
|
} else {
|
|
|
|
clsArr = clsArr4;
|
2021-07-13 20:23:20 +00:00
|
|
|
str = t;
|
2021-06-27 20:44:35 +00:00
|
|
|
qVar = e2;
|
|
|
|
}
|
|
|
|
qVar.s(187, "java/lang/IllegalArgumentException");
|
|
|
|
qVar.e(89);
|
|
|
|
qVar.s(187, "java/lang/StringBuilder");
|
|
|
|
qVar.e(89);
|
|
|
|
qVar.j("Method not found: ");
|
|
|
|
qVar.o(183, "java/lang/StringBuilder", "<init>", "(Ljava/lang/String;)V");
|
|
|
|
qVar.t(21, 2);
|
|
|
|
qVar.o(182, "java/lang/StringBuilder", "append", "(I)Ljava/lang/StringBuilder;");
|
|
|
|
qVar.o(182, "java/lang/StringBuilder", "toString", "()Ljava/lang/String;");
|
|
|
|
qVar.o(183, "java/lang/IllegalArgumentException", "<init>", "(Ljava/lang/String;)V");
|
|
|
|
qVar.e(191);
|
|
|
|
qVar.n(0, 0);
|
2021-07-13 20:23:20 +00:00
|
|
|
t = str;
|
|
|
|
cls2 = b.a(t, fVar.b());
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
d dVar = (d) cls2.newInstance();
|
|
|
|
dVar.a = strArr;
|
|
|
|
dVar.b = clsArr;
|
|
|
|
return dVar;
|
|
|
|
} catch (Throwable th) {
|
2021-07-13 20:23:20 +00:00
|
|
|
throw new RuntimeException(a.t("Error constructing method access class: ", t), th);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void e(Class cls, ArrayList<Method> arrayList) {
|
|
|
|
a(cls, arrayList);
|
|
|
|
for (Class<?> cls2 : cls.getInterfaces()) {
|
|
|
|
e(cls2, arrayList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public int c(String str, Class... clsArr) {
|
|
|
|
int length = this.a.length;
|
|
|
|
for (int i = 0; i < length; i++) {
|
|
|
|
if (this.a[i].equals(str) && Arrays.equals(clsArr, this.b[i])) {
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
StringBuilder Q = a.Q("Unable to find non-private method: ", str, " ");
|
|
|
|
Q.append(Arrays.toString(clsArr));
|
|
|
|
throw new IllegalArgumentException(Q.toString());
|
|
|
|
}
|
|
|
|
|
|
|
|
public abstract Object d(Object obj, int i, Object... objArr);
|
|
|
|
}
|