.class public final Lcom/google/android/gms/internal/ads/zzbye;
.super Ljava/lang/Object;
.source ""

# interfaces
.implements Lcom/google/android/gms/ads/mediation/MediationInterstitialAdapter;


# instance fields
.field public a:Landroid/app/Activity;

.field public b:Lcom/google/android/gms/ads/mediation/MediationInterstitialListener;

.field public c:Landroid/net/Uri;


# direct methods
.method public constructor <init>()V
    .registers 1

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public final onDestroy()V
    .registers 2

    const-string v0, "Destroying AdMobCustomTabsAdapter adapter."

    invoke-static {v0}, Lz5/d50;->zzd(Ljava/lang/String;)V

    return-void
.end method

.method public final onPause()V
    .registers 2

    const-string v0, "Pausing AdMobCustomTabsAdapter adapter."

    invoke-static {v0}, Lz5/d50;->zzd(Ljava/lang/String;)V

    return-void
.end method

.method public final onResume()V
    .registers 2

    const-string v0, "Resuming AdMobCustomTabsAdapter adapter."

    invoke-static {v0}, Lz5/d50;->zzd(Ljava/lang/String;)V

    return-void
.end method

.method public final requestInterstitialAd(Landroid/content/Context;Lcom/google/android/gms/ads/mediation/MediationInterstitialListener;Landroid/os/Bundle;Lcom/google/android/gms/ads/mediation/MediationAdRequest;Landroid/os/Bundle;)V
    .registers 6

    iput-object p2, p0, Lcom/google/android/gms/internal/ads/zzbye;->b:Lcom/google/android/gms/ads/mediation/MediationInterstitialListener;

    if-nez p2, :cond_a

    const-string p1, "Listener not set for mediation. Returning."

    invoke-static {p1}, Lz5/d50;->zzi(Ljava/lang/String;)V

    return-void

    :cond_a
    instance-of p2, p1, Landroid/app/Activity;

    const/4 p4, 0x0

    if-eqz p2, :cond_47

    invoke-static {p1}, Lcom/google/android/gms/internal/ads/n0;->a(Landroid/content/Context;)Z

    move-result p2

    if-eqz p2, :cond_3c

    const-string p2, "tab_url"

    invoke-virtual {p3, p2}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object p2

    invoke-static {p2}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result p3

    if-eqz p3, :cond_2c

    const-string p1, "The tab_url retrieved from mediation metadata is empty. Bailing out."

    invoke-static {p1}, Lz5/d50;->zzi(Ljava/lang/String;)V

    iget-object p1, p0, Lcom/google/android/gms/internal/ads/zzbye;->b:Lcom/google/android/gms/ads/mediation/MediationInterstitialListener;

    invoke-interface {p1, p0, p4}, Lcom/google/android/gms/ads/mediation/MediationInterstitialListener;->onAdFailedToLoad(Lcom/google/android/gms/ads/mediation/MediationInterstitialAdapter;I)V

    return-void

    :cond_2c
    check-cast p1, Landroid/app/Activity;

    iput-object p1, p0, Lcom/google/android/gms/internal/ads/zzbye;->a:Landroid/app/Activity;

    invoke-static {p2}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object p1

    iput-object p1, p0, Lcom/google/android/gms/internal/ads/zzbye;->c:Landroid/net/Uri;

    iget-object p1, p0, Lcom/google/android/gms/internal/ads/zzbye;->b:Lcom/google/android/gms/ads/mediation/MediationInterstitialListener;

    invoke-interface {p1, p0}, Lcom/google/android/gms/ads/mediation/MediationInterstitialListener;->onAdLoaded(Lcom/google/android/gms/ads/mediation/MediationInterstitialAdapter;)V

    return-void

    :cond_3c
    const-string p1, "Default browser does not support custom tabs. Bailing out."

    invoke-static {p1}, Lz5/d50;->zzi(Ljava/lang/String;)V

    iget-object p1, p0, Lcom/google/android/gms/internal/ads/zzbye;->b:Lcom/google/android/gms/ads/mediation/MediationInterstitialListener;

    invoke-interface {p1, p0, p4}, Lcom/google/android/gms/ads/mediation/MediationInterstitialListener;->onAdFailedToLoad(Lcom/google/android/gms/ads/mediation/MediationInterstitialAdapter;I)V

    return-void

    :cond_47
    const-string p1, "AdMobCustomTabs can only work with Activity context. Bailing out."

    invoke-static {p1}, Lz5/d50;->zzi(Ljava/lang/String;)V

    iget-object p1, p0, Lcom/google/android/gms/internal/ads/zzbye;->b:Lcom/google/android/gms/ads/mediation/MediationInterstitialListener;

    invoke-interface {p1, p0, p4}, Lcom/google/android/gms/ads/mediation/MediationInterstitialListener;->onAdFailedToLoad(Lcom/google/android/gms/ads/mediation/MediationInterstitialAdapter;I)V

    return-void
.end method

.method public final showInterstitial()V
    .registers 16

    .line 1
    new-instance v0, Landroid/content/Intent;

    const-string v1, "android.intent.action.VIEW"

    invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    new-instance v1, Landroid/os/Bundle;

    invoke-direct {v1}, Landroid/os/Bundle;-><init>()V

    const-string v2, "android.support.customtabs.extra.SESSION"

    const/4 v3, 0x0

    .line 2
    invoke-virtual {v1, v2, v3}, Landroid/os/Bundle;->putBinder(Ljava/lang/String;Landroid/os/IBinder;)V

    .line 3
    invoke-virtual {v0, v1}, Landroid/content/Intent;->putExtras(Landroid/os/Bundle;)Landroid/content/Intent;

    const-string v1, "android.support.customtabs.extra.EXTRA_ENABLE_INSTANT_APPS"

    const/4 v2, 0x1

    .line 4
    invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;

    new-instance v1, Lo/e;

    invoke-direct {v1, v0, v3}, Lo/e;-><init>(Landroid/content/Intent;Landroid/os/Bundle;)V

    .line 5
    iget-object v0, v1, Lo/e;->a:Landroid/content/Intent;

    iget-object v4, p0, Lcom/google/android/gms/internal/ads/zzbye;->c:Landroid/net/Uri;

    invoke-virtual {v0, v4}, Landroid/content/Intent;->setData(Landroid/net/Uri;)Landroid/content/Intent;

    new-instance v6, Lcom/google/android/gms/ads/internal/overlay/zzc;

    iget-object v0, v1, Lo/e;->a:Landroid/content/Intent;

    invoke-direct {v6, v0, v3}, Lcom/google/android/gms/ads/internal/overlay/zzc;-><init>(Landroid/content/Intent;Lcom/google/android/gms/ads/internal/overlay/zzt;)V

    new-instance v0, Lcom/google/android/gms/ads/internal/overlay/AdOverlayInfoParcel;

    new-instance v8, Lz5/iz;

    invoke-direct {v8, p0}, Lz5/iz;-><init>(Lcom/google/android/gms/internal/ads/zzbye;)V

    new-instance v1, Lz5/g50;

    const/4 v10, 0x0

    const/4 v11, 0x0

    const/4 v12, 0x0

    const/4 v13, 0x0

    const/4 v14, 0x0

    move-object v9, v1

    invoke-direct/range {v9 .. v14}, Lz5/g50;-><init>(IIZZZ)V

    const/4 v7, 0x0

    const/4 v9, 0x0

    const/4 v11, 0x0

    const/4 v12, 0x0

    move-object v5, v0

    move-object v10, v1

    invoke-direct/range {v5 .. v12}, Lcom/google/android/gms/ads/internal/overlay/AdOverlayInfoParcel;-><init>(Lcom/google/android/gms/ads/internal/overlay/zzc;Lz5/oj;Lcom/google/android/gms/ads/internal/overlay/zzo;Lcom/google/android/gms/ads/internal/overlay/zzv;Lz5/g50;Lcom/google/android/gms/internal/ads/g2;Lz5/hk0;)V

    sget-object v1, Lcom/google/android/gms/ads/internal/util/zzs;->zza:Lz5/i91;

    new-instance v3, Ll5/l;

    invoke-direct {v3, p0, v0}, Ll5/l;-><init>(Lcom/google/android/gms/internal/ads/zzbye;Lcom/google/android/gms/ads/internal/overlay/AdOverlayInfoParcel;)V

    invoke-virtual {v1, v3}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    invoke-static {}, Lcom/google/android/gms/ads/internal/zzt;->zzg()Lcom/google/android/gms/internal/ads/u1;

    move-result-object v0

    .line 6
    iget-object v0, v0, Lcom/google/android/gms/internal/ads/u1;->j:Lz5/u40;

    invoke-static {v0}, Ljava/util/Objects;->requireNonNull(Ljava/lang/Object;)Ljava/lang/Object;

    .line 7
    invoke-static {}, Lcom/google/android/gms/ads/internal/zzt;->zzj()Lu5/c;

    move-result-object v1

    invoke-interface {v1}, Lu5/c;->b()J

    move-result-wide v3

    iget-object v1, v0, Lz5/u40;->a:Ljava/lang/Object;

    monitor-enter v1

    :try_start_67
    iget v5, v0, Lz5/u40;->c:I

    const/4 v6, 0x3

    if-ne v5, v6, :cond_85

    iget-wide v7, v0, Lz5/u40;->b:J

    sget-object v5, Lz5/so;->I3:Lz5/no;

    .line 8
    sget-object v9, Lz5/xk;->d:Lz5/xk;

    iget-object v9, v9, Lz5/xk;->c:Lcom/google/android/gms/internal/ads/g0;

    .line 9
    invoke-virtual {v9, v5}, Lcom/google/android/gms/internal/ads/g0;->a(Lz5/no;)Ljava/lang/Object;

    move-result-object v5

    check-cast v5, Ljava/lang/Long;

    invoke-virtual {v5}, Ljava/lang/Long;->longValue()J

    move-result-wide v9

    add-long/2addr v7, v9

    cmp-long v3, v7, v3

    if-gtz v3, :cond_85

    iput v2, v0, Lz5/u40;->c:I

    :cond_85
    monitor-exit v1
    :try_end_86
    .catchall {:try_start_67 .. :try_end_86} :catchall_a4

    invoke-static {}, Lcom/google/android/gms/ads/internal/zzt;->zzj()Lu5/c;

    move-result-object v1

    invoke-interface {v1}, Lu5/c;->b()J

    move-result-wide v1

    iget-object v3, v0, Lz5/u40;->a:Ljava/lang/Object;

    monitor-enter v3

    :try_start_91
    iget v4, v0, Lz5/u40;->c:I

    const/4 v5, 0x2

    if-eq v4, v5, :cond_97

    goto :goto_9f

    :cond_97
    iput v6, v0, Lz5/u40;->c:I

    iget v4, v0, Lz5/u40;->c:I

    if-ne v4, v6, :cond_9f

    iput-wide v1, v0, Lz5/u40;->b:J

    :cond_9f
    :goto_9f
    monitor-exit v3

    return-void

    :catchall_a1
    move-exception v0

    monitor-exit v3
    :try_end_a3
    .catchall {:try_start_91 .. :try_end_a3} :catchall_a1

    throw v0

    :catchall_a4
    move-exception v0

    :try_start_a5
    monitor-exit v1
    :try_end_a6
    .catchall {:try_start_a5 .. :try_end_a6} :catchall_a4

    throw v0
.end method
