.class Lcom/baidu/mobad/feeds/BaiduNative$CustomIOAdEventListener;
.super Ljava/lang/Object;
.source "SourceFile"

# interfaces
.implements Lcom/baidu/mobads/openad/interfaces/event/IOAdEventListener;


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/baidu/mobad/feeds/BaiduNative;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = "CustomIOAdEventListener"
.end annotation


# instance fields
.field final synthetic a:Lcom/baidu/mobad/feeds/BaiduNative;

.field private b:Lcom/baidu/mobads/interfaces/feeds/IXAdFeedsRequestParameters;


# direct methods
.method public constructor <init>(Lcom/baidu/mobad/feeds/BaiduNative;Lcom/baidu/mobads/interfaces/feeds/IXAdFeedsRequestParameters;)V
    .locals 0

    .line 38
    iput-object p1, p0, Lcom/baidu/mobad/feeds/BaiduNative$CustomIOAdEventListener;->a:Lcom/baidu/mobad/feeds/BaiduNative;

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

    .line 39
    iput-object p2, p0, Lcom/baidu/mobad/feeds/BaiduNative$CustomIOAdEventListener;->b:Lcom/baidu/mobads/interfaces/feeds/IXAdFeedsRequestParameters;

    return-void
.end method


# virtual methods
.method public run(Lcom/baidu/mobads/openad/interfaces/event/IOAdEvent;)V
    .locals 12

    const-string v0, "AdStarted"

    .line 44
    invoke-interface {p1}, Lcom/baidu/mobads/openad/interfaces/event/IOAdEvent;->getType()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_6

    .line 45
    iget-object v0, p0, Lcom/baidu/mobad/feeds/BaiduNative$CustomIOAdEventListener;->a:Lcom/baidu/mobad/feeds/BaiduNative;

    invoke-static {v0}, Lcom/baidu/mobad/feeds/BaiduNative;->a(Lcom/baidu/mobad/feeds/BaiduNative;)Lcom/baidu/mobads/production/d/c;

    move-result-object v0

    invoke-virtual {v0}, Lcom/baidu/mobads/production/d/c;->removeAllListeners()V

    .line 47
    iget-object v0, p0, Lcom/baidu/mobad/feeds/BaiduNative$CustomIOAdEventListener;->a:Lcom/baidu/mobad/feeds/BaiduNative;

    invoke-static {v0}, Lcom/baidu/mobad/feeds/BaiduNative;->b(Lcom/baidu/mobad/feeds/BaiduNative;)Lcom/baidu/mobad/feeds/BaiduNative$BaiduNativeNetworkListener;

    move-result-object v0

    if-eqz v0, :cond_6

    .line 49
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    .line 50
    new-instance v1, Ljava/util/HashSet;

    invoke-direct {v1}, Ljava/util/HashSet;-><init>()V

    .line 51
    invoke-static {}, Lcom/baidu/mobads/utils/XAdSDKFoundationFacade;->getInstance()Lcom/baidu/mobads/utils/XAdSDKFoundationFacade;

    move-result-object v2

    invoke-virtual {v2}, Lcom/baidu/mobads/utils/XAdSDKFoundationFacade;->getAdConstants()Lcom/baidu/mobads/utils/g;

    move-result-object v2

    const/4 v3, 0x0

    const/4 v4, 0x0

    .line 53
    :goto_0
    iget-object v5, p0, Lcom/baidu/mobad/feeds/BaiduNative$CustomIOAdEventListener;->a:Lcom/baidu/mobad/feeds/BaiduNative;

    invoke-static {v5}, Lcom/baidu/mobad/feeds/BaiduNative;->a(Lcom/baidu/mobad/feeds/BaiduNative;)Lcom/baidu/mobads/production/d/c;

    move-result-object v5

    invoke-virtual {v5}, Lcom/baidu/mobads/production/d/c;->n()Ljava/util/ArrayList;

    move-result-object v5

    invoke-virtual {v5}, Ljava/util/ArrayList;->size()I

    move-result v5

    if-ge v4, v5, :cond_5

    .line 54
    iget-object v5, p0, Lcom/baidu/mobad/feeds/BaiduNative$CustomIOAdEventListener;->a:Lcom/baidu/mobad/feeds/BaiduNative;

    invoke-static {v5}, Lcom/baidu/mobad/feeds/BaiduNative;->a(Lcom/baidu/mobad/feeds/BaiduNative;)Lcom/baidu/mobads/production/d/c;

    move-result-object v5

    invoke-virtual {v5}, Lcom/baidu/mobads/production/d/c;->n()Ljava/util/ArrayList;

    move-result-object v5

    invoke-virtual {v5, v4}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v5

    check-cast v5, Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;

    .line 55
    invoke-interface {v5}, Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;->getAppPackageName()Ljava/lang/String;

    move-result-object v6

    .line 59
    invoke-interface {v5}, Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;->getActionType()I

    move-result v7

    invoke-interface {v2}, Lcom/baidu/mobads/interfaces/utils/IXAdConstants;->getActTypeDownload()I

    move-result v8

    const/4 v9, 0x1

    if-ne v7, v8, :cond_2

    if-eqz v6, :cond_1

    const-string v7, ""

    .line 60
    invoke-virtual {v6, v7}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v7

    if-nez v7, :cond_1

    const-string v7, "null"

    invoke-virtual {v6, v7}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v7

    if-nez v7, :cond_1

    invoke-virtual {v1, v6}, Ljava/util/HashSet;->contains(Ljava/lang/Object;)Z

    move-result v7

    if-eqz v7, :cond_0

    goto :goto_1

    .line 63
    :cond_0
    invoke-virtual {v1, v6}, Ljava/util/HashSet;->add(Ljava/lang/Object;)Z

    .line 64
    invoke-static {}, Lcom/baidu/mobads/utils/XAdSDKFoundationFacade;->getInstance()Lcom/baidu/mobads/utils/XAdSDKFoundationFacade;

    move-result-object v7

    invoke-virtual {v7}, Lcom/baidu/mobads/utils/XAdSDKFoundationFacade;->getPackageUtils()Lcom/baidu/mobads/utils/l;

    move-result-object v7

    iget-object v8, p0, Lcom/baidu/mobad/feeds/BaiduNative$CustomIOAdEventListener;->a:Lcom/baidu/mobad/feeds/BaiduNative;

    invoke-static {v8}, Lcom/baidu/mobad/feeds/BaiduNative;->c(Lcom/baidu/mobad/feeds/BaiduNative;)Landroid/content/Context;

    move-result-object v8

    invoke-virtual {v7, v8, v6}, Lcom/baidu/mobads/utils/l;->isInstalled(Landroid/content/Context;Ljava/lang/String;)Z

    move-result v6

    if-eqz v6, :cond_2

    const/4 v6, 0x0

    const/4 v7, 0x1

    goto :goto_3

    :cond_1
    :goto_1
    const/4 v6, 0x1

    goto :goto_2

    :cond_2
    const/4 v6, 0x0

    :goto_2
    const/4 v7, 0x0

    :goto_3
    if-nez v6, :cond_4

    .line 70
    new-instance v6, Lcom/baidu/mobad/feeds/XAdNativeResponse;

    iget-object v8, p0, Lcom/baidu/mobad/feeds/BaiduNative$CustomIOAdEventListener;->a:Lcom/baidu/mobad/feeds/BaiduNative;

    iget-object v10, p0, Lcom/baidu/mobad/feeds/BaiduNative$CustomIOAdEventListener;->b:Lcom/baidu/mobads/interfaces/feeds/IXAdFeedsRequestParameters;

    iget-object v11, p0, Lcom/baidu/mobad/feeds/BaiduNative$CustomIOAdEventListener;->a:Lcom/baidu/mobad/feeds/BaiduNative;

    invoke-static {v11}, Lcom/baidu/mobad/feeds/BaiduNative;->a(Lcom/baidu/mobad/feeds/BaiduNative;)Lcom/baidu/mobads/production/d/c;

    move-result-object v11

    invoke-virtual {v11}, Lcom/baidu/mobads/production/d/c;->getCurrentXAdContainer()Lcom/baidu/mobads/interfaces/IXAdContainer;

    move-result-object v11

    invoke-direct {v6, v5, v8, v10, v11}, Lcom/baidu/mobad/feeds/XAdNativeResponse;-><init>(Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;Lcom/baidu/mobad/feeds/BaiduNative;Lcom/baidu/mobads/interfaces/feeds/IXAdFeedsRequestParameters;Lcom/baidu/mobads/interfaces/IXAdContainer;)V

    if-ne v7, v9, :cond_3

    .line 74
    invoke-virtual {v6, v3}, Lcom/baidu/mobad/feeds/XAdNativeResponse;->setIsDownloadApp(Z)V

    .line 76
    :cond_3
    invoke-interface {v0, v6}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    :cond_4
    add-int/lit8 v4, v4, 0x1

    goto/16 :goto_0

    .line 79
    :cond_5
    invoke-static {}, Lcom/baidu/mobads/utils/XAdSDKFoundationFacade;->getInstance()Lcom/baidu/mobads/utils/XAdSDKFoundationFacade;

    move-result-object v1

    invoke-virtual {v1}, Lcom/baidu/mobads/utils/XAdSDKFoundationFacade;->getCommonUtils()Lcom/baidu/mobads/utils/d;

    move-result-object v1

    new-instance v2, Lcom/baidu/mobad/feeds/BaiduNative$CustomIOAdEventListener$1;

    invoke-direct {v2, p0, v0}, Lcom/baidu/mobad/feeds/BaiduNative$CustomIOAdEventListener$1;-><init>(Lcom/baidu/mobad/feeds/BaiduNative$CustomIOAdEventListener;Ljava/util/List;)V

    invoke-virtual {v1, v2}, Lcom/baidu/mobads/utils/d;->a(Ljava/lang/Runnable;)V

    :cond_6
    const-string v0, "AdError"

    .line 88
    invoke-interface {p1}, Lcom/baidu/mobads/openad/interfaces/event/IOAdEvent;->getType()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_7

    .line 89
    iget-object v0, p0, Lcom/baidu/mobad/feeds/BaiduNative$CustomIOAdEventListener;->a:Lcom/baidu/mobad/feeds/BaiduNative;

    invoke-static {v0}, Lcom/baidu/mobad/feeds/BaiduNative;->a(Lcom/baidu/mobad/feeds/BaiduNative;)Lcom/baidu/mobads/production/d/c;

    move-result-object v0

    invoke-virtual {v0}, Lcom/baidu/mobads/production/d/c;->removeAllListeners()V

    .line 90
    invoke-interface {p1}, Lcom/baidu/mobads/openad/interfaces/event/IOAdEvent;->getData()Ljava/util/Map;

    move-result-object p1

    const-string v0, "message"

    invoke-interface {p1, v0}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Ljava/lang/String;

    .line 93
    iget-object p1, p0, Lcom/baidu/mobad/feeds/BaiduNative$CustomIOAdEventListener;->a:Lcom/baidu/mobad/feeds/BaiduNative;

    invoke-static {p1}, Lcom/baidu/mobad/feeds/BaiduNative;->b(Lcom/baidu/mobad/feeds/BaiduNative;)Lcom/baidu/mobad/feeds/BaiduNative$BaiduNativeNetworkListener;

    move-result-object p1

    if-eqz p1, :cond_7

    .line 94
    invoke-static {}, Lcom/baidu/mobads/utils/XAdSDKFoundationFacade;->getInstance()Lcom/baidu/mobads/utils/XAdSDKFoundationFacade;

    move-result-object p1

    invoke-virtual {p1}, Lcom/baidu/mobads/utils/XAdSDKFoundationFacade;->getCommonUtils()Lcom/baidu/mobads/utils/d;

    move-result-object p1

    new-instance v0, Lcom/baidu/mobad/feeds/BaiduNative$CustomIOAdEventListener$2;

    invoke-direct {v0, p0}, Lcom/baidu/mobad/feeds/BaiduNative$CustomIOAdEventListener$2;-><init>(Lcom/baidu/mobad/feeds/BaiduNative$CustomIOAdEventListener;)V

    invoke-virtual {p1, v0}, Lcom/baidu/mobads/utils/d;->a(Ljava/lang/Runnable;)V

    :cond_7
    return-void
.end method
