Initial import of ADIF API reverse-engineering toolkit

This commit is contained in:
2025-12-16 08:37:56 +01:00
commit 60388529c1
11486 changed files with 1086536 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
package V2;
import a.AbstractC0106b;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
/* loaded from: classes3.dex */
public final class a extends AbstractC0106b {
@Override // a.AbstractC0106b
public final Method j(Class cls, Field field) {
throw new UnsupportedOperationException("Records are not supported on this JVM, this method should not be called");
}
@Override // a.AbstractC0106b
public final Constructor k(Class cls) {
throw new UnsupportedOperationException("Records are not supported on this JVM, this method should not be called");
}
@Override // a.AbstractC0106b
public final String[] o(Class cls) {
throw new UnsupportedOperationException("Records are not supported on this JVM, this method should not be called");
}
@Override // a.AbstractC0106b
public final boolean t(Class cls) {
return false;
}
}

View File

@@ -0,0 +1,76 @@
package V2;
import a.AbstractC0106b;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
/* loaded from: classes3.dex */
public final class b extends AbstractC0106b {
/* renamed from: a, reason: collision with root package name */
public final Method f1874a = Class.class.getMethod("isRecord", new Class[0]);
/* renamed from: b, reason: collision with root package name */
public final Method f1875b;
/* renamed from: c, reason: collision with root package name */
public final Method f1876c;
/* renamed from: d, reason: collision with root package name */
public final Method f1877d;
public b() {
Method method = Class.class.getMethod("getRecordComponents", new Class[0]);
this.f1875b = method;
Class<?> componentType = method.getReturnType().getComponentType();
this.f1876c = componentType.getMethod("getName", new Class[0]);
this.f1877d = componentType.getMethod("getType", new Class[0]);
}
@Override // a.AbstractC0106b
public final Method j(Class cls, Field field) {
try {
return cls.getMethod(field.getName(), new Class[0]);
} catch (ReflectiveOperationException e4) {
throw new RuntimeException("Unexpected ReflectiveOperationException occurred (Gson 2.10.1). To support Java records, reflection is utilized to read out information about records. All these invocations happens after it is established that records exist in the JVM. This exception is unexpected behavior.", e4);
}
}
@Override // a.AbstractC0106b
public final Constructor k(Class cls) {
try {
Object[] objArr = (Object[]) this.f1875b.invoke(cls, new Object[0]);
Class<?>[] clsArr = new Class[objArr.length];
for (int i = 0; i < objArr.length; i++) {
clsArr[i] = (Class) this.f1877d.invoke(objArr[i], new Object[0]);
}
return cls.getDeclaredConstructor(clsArr);
} catch (ReflectiveOperationException e4) {
throw new RuntimeException("Unexpected ReflectiveOperationException occurred (Gson 2.10.1). To support Java records, reflection is utilized to read out information about records. All these invocations happens after it is established that records exist in the JVM. This exception is unexpected behavior.", e4);
}
}
@Override // a.AbstractC0106b
public final String[] o(Class cls) {
try {
Object[] objArr = (Object[]) this.f1875b.invoke(cls, new Object[0]);
String[] strArr = new String[objArr.length];
for (int i = 0; i < objArr.length; i++) {
strArr[i] = (String) this.f1876c.invoke(objArr[i], new Object[0]);
}
return strArr;
} catch (ReflectiveOperationException e4) {
throw new RuntimeException("Unexpected ReflectiveOperationException occurred (Gson 2.10.1). To support Java records, reflection is utilized to read out information about records. All these invocations happens after it is established that records exist in the JVM. This exception is unexpected behavior.", e4);
}
}
@Override // a.AbstractC0106b
public final boolean t(Class cls) {
try {
return ((Boolean) this.f1874a.invoke(cls, new Object[0])).booleanValue();
} catch (ReflectiveOperationException e4) {
throw new RuntimeException("Unexpected ReflectiveOperationException occurred (Gson 2.10.1). To support Java records, reflection is utilized to read out information about records. All these invocations happens after it is established that records exist in the JVM. This exception is unexpected behavior.", e4);
}
}
}

View File

@@ -0,0 +1,79 @@
package V2;
import C.w;
import a.AbstractC0106b;
import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
/* loaded from: classes3.dex */
public abstract class c {
/* renamed from: a, reason: collision with root package name */
public static final AbstractC0106b f1878a;
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARN: Type inference failed for: r0v1, types: [a.b] */
/* JADX WARN: Type inference failed for: r0v3 */
/* JADX WARN: Type inference failed for: r0v4 */
static {
?? r02;
try {
r02 = new b();
} catch (NoSuchMethodException unused) {
r02 = new Object();
}
f1878a = r02;
}
public static void a(AccessibleObject accessibleObject, StringBuilder sb) {
sb.append('(');
Class<?>[] parameterTypes = accessibleObject instanceof Method ? ((Method) accessibleObject).getParameterTypes() : ((Constructor) accessibleObject).getParameterTypes();
for (int i = 0; i < parameterTypes.length; i++) {
if (i > 0) {
sb.append(", ");
}
sb.append(parameterTypes[i].getSimpleName());
}
sb.append(')');
}
public static String b(Constructor constructor) {
StringBuilder sb = new StringBuilder(constructor.getDeclaringClass().getName());
a(constructor, sb);
return sb.toString();
}
public static String c(Field field) {
return field.getDeclaringClass().getName() + "#" + field.getName();
}
public static String d(AccessibleObject accessibleObject, boolean z3) {
String str;
if (accessibleObject instanceof Field) {
str = "field '" + c((Field) accessibleObject) + "'";
} else if (accessibleObject instanceof Method) {
Method method = (Method) accessibleObject;
StringBuilder sb = new StringBuilder(method.getName());
a(method, sb);
str = "method '" + method.getDeclaringClass().getName() + "#" + sb.toString() + "'";
} else if (accessibleObject instanceof Constructor) {
str = "constructor '" + b((Constructor) accessibleObject) + "'";
} else {
str = "<unknown AccessibleObject> " + accessibleObject.toString();
}
if (!z3 || !Character.isLowerCase(str.charAt(0))) {
return str;
}
return Character.toUpperCase(str.charAt(0)) + str.substring(1);
}
public static void e(AccessibleObject accessibleObject) {
try {
accessibleObject.setAccessible(true);
} catch (Exception e4) {
throw new RuntimeException(w.o("Failed making ", d(accessibleObject, false), " accessible; either increase its visibility or write a custom TypeAdapter for its declaring type."), e4);
}
}
}