Files
Daniel Elliott f9d20bb3fc Add decompiled APK source code (JADX)
- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-18 14:52:23 -08:00

186 lines
8.4 KiB
Java
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package com.mbridge.msdk.newreward.function.g;
import android.os.Handler;
import android.os.HandlerThread;
import android.text.TextUtils;
import com.fyber.inneractive.sdk.bidder.TokenParametersOuterClass$TokenParameters;
import com.mbridge.msdk.MBridgeConstans;
import com.mbridge.msdk.foundation.tools.af;
import com.mbridge.msdk.newreward.function.command.retention.BridgeParameter;
import com.mbridge.msdk.newreward.function.command.retention.ReportAnnotation;
import java.lang.annotation.Annotation;
import java.lang.ref.WeakReference;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
/* loaded from: classes4.dex */
public final class b {
Handler a;
private WeakReference<Object> b;
private com.mbridge.msdk.newreward.a.e c;
private com.mbridge.msdk.newreward.function.command.c d;
public b(Object obj, com.mbridge.msdk.newreward.a.e eVar, com.mbridge.msdk.newreward.function.command.c cVar) {
HandlerThread handlerThread;
this.b = new WeakReference<>(obj);
this.c = eVar;
this.d = cVar;
if (eVar != null) {
if (eVar.a() == null) {
handlerThread = new HandlerThread("HandlerReportMessage");
eVar.a(handlerThread);
handlerThread.start();
} else {
handlerThread = eVar.a();
}
} else {
handlerThread = new HandlerThread("HandlerReportMessage");
handlerThread.start();
}
this.a = new Handler(handlerThread.getLooper());
}
private Map a(Object obj, String str, Object[] objArr) {
HashMap hashMap = new HashMap();
try {
int length = objArr.length;
Class<?>[] clsArr = new Class[length];
for (int i = 0; i < length; i++) {
Object obj2 = objArr[i];
if (obj2 instanceof Integer) {
clsArr[i] = Integer.TYPE;
} else {
clsArr[i] = obj2.getClass();
}
}
Method method = obj.getClass().getMethod(str, clsArr);
Annotation[][] parameterAnnotations = method.getParameterAnnotations();
for (int i2 = 0; i2 < parameterAnnotations.length; i2++) {
int i3 = 0;
while (true) {
Annotation[] annotationArr = parameterAnnotations[i2];
if (i3 < annotationArr.length) {
Annotation annotation = annotationArr[i3];
if (annotation instanceof BridgeParameter) {
String key = ((BridgeParameter) annotation).key();
Object obj3 = objArr[i2];
StringBuilder sb = new StringBuilder();
sb.append("ioc上报参数为");
int i4 = i2 + 1;
sb.append(i4);
sb.append("参数,第");
int i5 = i3 + 1;
sb.append(i5);
sb.append("个注解,Annotation.parametersKey=");
sb.append(key);
sb.append(", methodName->");
sb.append(method.getName());
af.b("HandlerReportMessage", sb.toString());
af.b("HandlerReportMessage", "ioc上报参数为" + i4 + "参数,第" + i5 + "个注解,Parameter.value=" + obj3);
hashMap.put(key, obj3);
}
i3++;
}
}
}
return hashMap;
} catch (Exception e) {
af.b("HandlerReportMessage", e.getMessage());
return hashMap;
}
}
/* JADX WARN: Failed to restore switch over string. Please report as a decompilation issue */
public static /* synthetic */ void a(b bVar, Object obj, Method method, Object[] objArr) throws NoSuchMethodException {
ReportAnnotation.MethodInfo methodInfo;
if (bVar.d != null && method.isAnnotationPresent(ReportAnnotation.MethodInfo.class)) {
if (((obj instanceof Boolean) && ((Boolean) obj).booleanValue()) || (methodInfo = (ReportAnnotation.MethodInfo) method.getAnnotation(ReportAnnotation.MethodInfo.class)) == null) {
return;
}
String key = methodInfo.key();
String reportType = methodInfo.reportType();
reportType.hashCode();
char c = 65535;
switch (reportType.hashCode()) {
case TokenParametersOuterClass$TokenParameters.DARKMODE_FIELD_NUMBER /* 49 */:
if (reportType.equals("1")) {
c = 0;
break;
}
break;
case 50:
if (reportType.equals("2")) {
c = 1;
break;
}
break;
case 51:
if (reportType.equals("3")) {
c = 2;
break;
}
break;
}
Map<String, String> map = null;
switch (c) {
case 0:
boolean isParameter = methodInfo.isParameter();
Map a = (!isParameter || bVar.b.get() == null) ? null : bVar.a(bVar.b.get(), method.getName(), objArr);
af.b("HandlerReportMessage", "开始上报,方法名:" + method.getName() + ", isParameter-->" + isParameter + ",BuildType-->1");
com.mbridge.msdk.newreward.function.command.c cVar = bVar.d;
cVar.a(cVar.a("adapter_model", bVar.c, "metrics_data", a, "metrics_report_key", key), "ReportReceiver");
break;
case 1:
try {
String className = methodInfo.className();
String methodName = methodInfo.methodName();
d[] a2 = bVar.c.c().a();
if (!TextUtils.isEmpty(className) && !TextUtils.isEmpty(methodName) && a2 != null && a2.length != 0) {
for (d dVar : a2) {
if (dVar.a().equals(className) && dVar.b().equals(methodName)) {
String c2 = dVar.c();
if (!TextUtils.isEmpty(c2)) {
com.mbridge.msdk.newreward.function.command.c cVar2 = bVar.d;
cVar2.a(cVar2.a("adapter_model", bVar.c, "metrics_report_key", c2), "ReportReceiver");
}
}
}
break;
}
} catch (Exception e) {
af.b("HandlerReportMessage", e.getMessage());
return;
}
break;
case 2:
af.b("HandlerReportMessage", "开始上报,方法名:" + method.getName() + ",BuildType-->3");
String str = (String) objArr[0];
if (str.equals("onCreate")) {
str = "2000129";
}
if (str.equals("onDestroy")) {
str = "2000151";
}
String str2 = str;
try {
if (methodInfo.isParameter() && bVar.b.get() != null && objArr.length > 1) {
Object obj2 = objArr[1];
if (obj2 instanceof com.mbridge.msdk.foundation.same.report.d.e) {
map = ((com.mbridge.msdk.foundation.same.report.d.e) obj2).a();
}
}
} catch (Exception e2) {
if (MBridgeConstans.DEBUG) {
e2.printStackTrace();
}
}
Map<String, String> map2 = map;
com.mbridge.msdk.newreward.function.command.c cVar3 = bVar.d;
cVar3.a(cVar3.a("adapter_model", bVar.c, "metrics_data", map2, "metrics_report_key", str2), "ReportReceiver");
break;
}
}
}
}