package com.google.android.gms.internal.ads;

import android.content.Context;
import android.os.SystemClock;
import android.util.DisplayMetrics;
import android.view.Display;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;

/* JADX INFO: loaded from: classes2.dex */
public final class nh {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public long f14599a = -1;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public long f14600b = -1;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public long f14601c = -1;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public long f14602d = -1;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public long f14603e = -1;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public long f14604f = -1;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public long f14605g = -1;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public long f14606h = -1;

    /* JADX WARN: Code restructure failed: missing block: B:24:0x00c4, code lost:
    
        if (r8.contains("REWARDED") != false) goto L25;
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void a(Context context, View view) {
        this.f14602d = this.f14601c;
        this.f14601c = SystemClock.uptimeMillis();
        long j10 = this.f14603e;
        if (j10 != -1) {
            this.f14604f = j10;
        }
        Display defaultDisplay = ((WindowManager) context.getSystemService("window")).getDefaultDisplay();
        DisplayMetrics displayMetrics = new DisplayMetrics();
        try {
            defaultDisplay.getRealMetrics(displayMetrics);
        } catch (NoSuchMethodError unused) {
            defaultDisplay.getMetrics(displayMetrics);
        }
        int i10 = displayMetrics.widthPixels * displayMetrics.heightPixels;
        if (view != null) {
            int iMin = Math.min(view.getHeight(), displayMetrics.heightPixels) * Math.min(view.getWidth(), displayMetrics.widthPixels);
            if (iMin + iMin < i10) {
                if (iMin == 0) {
                    try {
                        if (view.getClass().getName().contains("DebugGestureViewWrapper")) {
                            view = ((ViewGroup) view).getChildAt(0);
                        }
                        Object objInvoke = view.getClass().getMethod("getAdConfiguration", new Class[0]).invoke(view, new Object[0]);
                        String str = (String) objInvoke.getClass().getMethod("adTypeToString", Integer.TYPE).invoke(null, Integer.valueOf(((Integer) objInvoke.getClass().getField("adType").get(objInvoke)).intValue()));
                        if (!str.contains("INTERSTITIAL") && !str.contains("APP_OPEN")) {
                        }
                    } catch (ReflectiveOperationException | SecurityException unused2) {
                    }
                }
            }
            this.f14603e = this.f14601c;
            return;
        }
        this.f14603e = -1L;
    }
}
