alexandroid/decompiled/jadx/sources/okhttp3/internal/platform/android/CloseGuard.java
KaKi87 a47fad5135 📦 Add decompiled Alexa 2.2.730155.0 (jadx, apktool, Hermes strings)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 00:04:16 +01:00

93 lines
4.4 KiB
Java

package okhttp3.internal.platform.android;
import com.dee.app.metrics.MetricsConstants;
import java.lang.reflect.Method;
import kotlin.Metadata;
import kotlin.jvm.internal.DefaultConstructorMarker;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
@Metadata(d1 = {"\u0000 \n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0003\b\u0000\u0018\u0000 \r2\u00020\u0001:\u0001\rB#\u0012\b\u0010\u0002\u001a\u0004\u0018\u00010\u0003\u0012\b\u0010\u0004\u001a\u0004\u0018\u00010\u0003\u0012\b\u0010\u0005\u001a\u0004\u0018\u00010\u0003¢\u0006\u0002\u0010\u0006J\u0010\u0010\u0007\u001a\u0004\u0018\u00010\u00012\u0006\u0010\b\u001a\u00020\tJ\u0010\u0010\n\u001a\u00020\u000b2\b\u0010\f\u001a\u0004\u0018\u00010\u0001R\u0010\u0010\u0002\u001a\u0004\u0018\u00010\u0003X\u0082\u0004¢\u0006\u0002\n\u0000R\u0010\u0010\u0004\u001a\u0004\u0018\u00010\u0003X\u0082\u0004¢\u0006\u0002\n\u0000R\u0010\u0010\u0005\u001a\u0004\u0018\u00010\u0003X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u000e"}, d2 = {"Lokhttp3/internal/platform/android/CloseGuard;", "", "getMethod", "Ljava/lang/reflect/Method;", "openMethod", "warnIfOpenMethod", "(Ljava/lang/reflect/Method;Ljava/lang/reflect/Method;Ljava/lang/reflect/Method;)V", "createAndOpen", "closer", "", "warnIfOpen", "", "closeGuardInstance", "Companion", "okhttp"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes10.dex */
public final class CloseGuard {
/* renamed from: Companion, reason: from kotlin metadata */
@NotNull
public static final Companion INSTANCE = new Companion(null);
@Nullable
private final Method getMethod;
@Nullable
private final Method openMethod;
@Nullable
private final Method warnIfOpenMethod;
public CloseGuard(@Nullable Method method, @Nullable Method method2, @Nullable Method method3) {
this.getMethod = method;
this.openMethod = method2;
this.warnIfOpenMethod = method3;
}
@Nullable
public final Object createAndOpen(@NotNull String closer) {
closer.getClass();
Method method = this.getMethod;
if (method != null) {
try {
Object invoke = method.invoke(null, null);
Method method2 = this.openMethod;
method2.getClass();
method2.invoke(invoke, closer);
return invoke;
} catch (Exception unused) {
}
}
return null;
}
public final boolean warnIfOpen(@Nullable Object closeGuardInstance) {
if (closeGuardInstance == null) {
return false;
}
try {
Method method = this.warnIfOpenMethod;
method.getClass();
method.invoke(closeGuardInstance, null);
return true;
} catch (Exception unused) {
return false;
}
}
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
@Metadata(d1 = {"\u0000\u0012\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u0006\u0010\u0003\u001a\u00020\u0004¨\u0006\u0005"}, d2 = {"Lokhttp3/internal/platform/android/CloseGuard$Companion;", "", "()V", MetricsConstants.Method.CACHE_GET, "Lokhttp3/internal/platform/android/CloseGuard;", "okhttp"}, k = 1, mv = {1, 8, 0}, xi = 48)
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
@NotNull
public final CloseGuard get() {
Method method;
Method method2;
Method method3 = null;
try {
Class<?> cls = Class.forName("dalvik.system.CloseGuard");
Method method4 = cls.getMethod(MetricsConstants.Method.CACHE_GET, null);
method2 = cls.getMethod("open", String.class);
method = cls.getMethod("warnIfOpen", null);
method3 = method4;
} catch (Exception unused) {
method = null;
method2 = null;
}
return new CloseGuard(method3, method2, method);
}
private Companion() {
}
}
}