.class public Lcom/moji/mjad/third/LoadBaiduAd;
.super Ljava/lang/Object;
.source "LoadBaiduAd.java"


# direct methods
.method public constructor <init>(Landroid/content/Context;Ljava/lang/String;Lcom/moji/mjad/common/data/AdCommon;)V
    .locals 6

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

    const/4 v4, 0x0

    const/4 v5, 0x0

    move-object v0, p0

    move-object v1, p1

    move-object v2, p2

    move-object v3, p3

    .line 30
    invoke-direct/range {v0 .. v5}, Lcom/moji/mjad/third/LoadBaiduAd;->a(Landroid/content/Context;Ljava/lang/String;Lcom/moji/mjad/common/data/AdCommon;Ljava/util/List;Lcom/moji/mjad/common/network/AdCommonRequestCallBack;)V

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Ljava/lang/String;Lcom/moji/mjad/common/data/AdCommon;Lcom/moji/mjad/common/network/ISDKRequestCallBack;)V
    .locals 1

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

    if-eqz p3, :cond_1

    .line 50
    iget-object v0, p3, Lcom/moji/mjad/common/data/AdCommon;->appId:Ljava/lang/String;

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

    move-result v0

    if-nez v0, :cond_1

    iget-object v0, p3, Lcom/moji/mjad/common/data/AdCommon;->adRequeestId:Ljava/lang/String;

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

    move-result v0

    if-eqz v0, :cond_0

    goto :goto_0

    .line 55
    :cond_0
    invoke-direct {p0, p1, p2, p3, p4}, Lcom/moji/mjad/third/LoadBaiduAd;->a(Landroid/content/Context;Ljava/lang/String;Lcom/moji/mjad/common/data/AdCommon;Lcom/moji/mjad/common/network/ISDKRequestCallBack;)V

    goto :goto_1

    :cond_1
    :goto_0
    if-eqz p4, :cond_2

    .line 52
    sget-object p1, Lcom/moji/mjad/enumdata/ERROR_CODE;->NODATA:Lcom/moji/mjad/enumdata/ERROR_CODE;

    invoke-interface {p4, p1, p2}, Lcom/moji/mjad/common/network/ISDKRequestCallBack;->a(Lcom/moji/mjad/enumdata/ERROR_CODE;Ljava/lang/String;)V

    :cond_2
    :goto_1
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Ljava/lang/String;Ljava/util/List;Lcom/moji/mjad/common/data/AdCommon;Lcom/moji/mjad/common/network/AdCommonRequestCallBack;)V
    .locals 6
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/content/Context;",
            "Ljava/lang/String;",
            "Ljava/util/List<",
            "Lcom/moji/mjad/common/data/AdCommon;",
            ">;",
            "Lcom/moji/mjad/common/data/AdCommon;",
            "Lcom/moji/mjad/common/network/AdCommonRequestCallBack;",
            ")V"
        }
    .end annotation

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

    if-eqz p3, :cond_0

    .line 33
    invoke-interface {p3}, Ljava/util/List;->isEmpty()Z

    move-result v0

    if-nez v0, :cond_0

    move-object v0, p0

    move-object v1, p1

    move-object v2, p2

    move-object v3, p4

    move-object v4, p3

    move-object v5, p5

    .line 34
    invoke-direct/range {v0 .. v5}, Lcom/moji/mjad/third/LoadBaiduAd;->a(Landroid/content/Context;Ljava/lang/String;Lcom/moji/mjad/common/data/AdCommon;Ljava/util/List;Lcom/moji/mjad/common/network/AdCommonRequestCallBack;)V

    goto :goto_0

    :cond_0
    if-eqz p5, :cond_1

    .line 37
    sget-object p1, Lcom/moji/mjad/enumdata/ERROR_CODE;->NODATA:Lcom/moji/mjad/enumdata/ERROR_CODE;

    invoke-virtual {p5, p1, p2}, Lcom/moji/mjad/common/network/AdCommonRequestCallBack;->a(Lcom/moji/mjad/enumdata/ERROR_CODE;Ljava/lang/String;)V

    :cond_1
    :goto_0
    return-void
.end method

.method private a(Landroid/content/Context;Ljava/lang/String;Lcom/moji/mjad/common/data/AdCommon;Lcom/moji/mjad/common/network/ISDKRequestCallBack;)V
    .locals 3

    .line 60
    iget-object v0, p3, Lcom/moji/mjad/common/data/AdCommon;->appId:Ljava/lang/String;

    invoke-static {p1, v0}, Lcom/baidu/mobads/AdView;->setAppSid(Landroid/content/Context;Ljava/lang/String;)V

    .line 66
    new-instance v0, Lcom/baidu/mobad/feeds/BaiduNative;

    iget-object v1, p3, Lcom/moji/mjad/common/data/AdCommon;->adRequeestId:Ljava/lang/String;

    new-instance v2, Lcom/moji/mjad/third/LoadBaiduAd$1;

    invoke-direct {v2, p0, p3, p2, p4}, Lcom/moji/mjad/third/LoadBaiduAd$1;-><init>(Lcom/moji/mjad/third/LoadBaiduAd;Lcom/moji/mjad/common/data/AdCommon;Ljava/lang/String;Lcom/moji/mjad/common/network/ISDKRequestCallBack;)V

    invoke-direct {v0, p1, v1, v2}, Lcom/baidu/mobad/feeds/BaiduNative;-><init>(Landroid/content/Context;Ljava/lang/String;Lcom/baidu/mobad/feeds/BaiduNative$BaiduNativeNetworkListener;)V

    .line 116
    new-instance p1, Lcom/baidu/mobad/feeds/RequestParameters$Builder;

    invoke-direct {p1}, Lcom/baidu/mobad/feeds/RequestParameters$Builder;-><init>()V

    const/4 p2, 0x1

    .line 117
    invoke-virtual {p1, p2}, Lcom/baidu/mobad/feeds/RequestParameters$Builder;->downloadAppConfirmPolicy(I)Lcom/baidu/mobad/feeds/RequestParameters$Builder;

    move-result-object p1

    .line 118
    invoke-virtual {p1}, Lcom/baidu/mobad/feeds/RequestParameters$Builder;->build()Lcom/baidu/mobad/feeds/RequestParameters;

    move-result-object p1

    .line 119
    invoke-virtual {v0, p1}, Lcom/baidu/mobad/feeds/BaiduNative;->makeRequest(Lcom/baidu/mobad/feeds/RequestParameters;)V

    return-void
.end method

.method private a(Landroid/content/Context;Ljava/lang/String;Lcom/moji/mjad/common/data/AdCommon;Ljava/util/List;Lcom/moji/mjad/common/network/AdCommonRequestCallBack;)V
    .locals 9
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/content/Context;",
            "Ljava/lang/String;",
            "Lcom/moji/mjad/common/data/AdCommon;",
            "Ljava/util/List<",
            "Lcom/moji/mjad/common/data/AdCommon;",
            ">;",
            "Lcom/moji/mjad/common/network/AdCommonRequestCallBack;",
            ")V"
        }
    .end annotation

    .line 123
    iget-object v0, p3, Lcom/moji/mjad/common/data/AdCommon;->appId:Ljava/lang/String;

    invoke-static {p1, v0}, Lcom/baidu/mobads/AdView;->setAppSid(Landroid/content/Context;Ljava/lang/String;)V

    .line 129
    new-instance v0, Lcom/baidu/mobad/feeds/BaiduNative;

    iget-object v1, p3, Lcom/moji/mjad/common/data/AdCommon;->adRequeestId:Ljava/lang/String;

    new-instance v8, Lcom/moji/mjad/third/LoadBaiduAd$2;

    move-object v2, v8

    move-object v3, p0

    move-object v4, p3

    move-object v5, p2

    move-object v6, p5

    move-object v7, p4

    invoke-direct/range {v2 .. v7}, Lcom/moji/mjad/third/LoadBaiduAd$2;-><init>(Lcom/moji/mjad/third/LoadBaiduAd;Lcom/moji/mjad/common/data/AdCommon;Ljava/lang/String;Lcom/moji/mjad/common/network/AdCommonRequestCallBack;Ljava/util/List;)V

    invoke-direct {v0, p1, v1, v8}, Lcom/baidu/mobad/feeds/BaiduNative;-><init>(Landroid/content/Context;Ljava/lang/String;Lcom/baidu/mobad/feeds/BaiduNative$BaiduNativeNetworkListener;)V

    .line 179
    new-instance p1, Lcom/baidu/mobad/feeds/RequestParameters$Builder;

    invoke-direct {p1}, Lcom/baidu/mobad/feeds/RequestParameters$Builder;-><init>()V

    const/4 p2, 0x1

    .line 180
    invoke-virtual {p1, p2}, Lcom/baidu/mobad/feeds/RequestParameters$Builder;->downloadAppConfirmPolicy(I)Lcom/baidu/mobad/feeds/RequestParameters$Builder;

    move-result-object p1

    .line 181
    invoke-virtual {p1}, Lcom/baidu/mobad/feeds/RequestParameters$Builder;->build()Lcom/baidu/mobad/feeds/RequestParameters;

    move-result-object p1

    .line 182
    invoke-virtual {v0, p1}, Lcom/baidu/mobad/feeds/BaiduNative;->makeRequest(Lcom/baidu/mobad/feeds/RequestParameters;)V

    return-void
.end method

.method private a(Lcom/baidu/mobad/feeds/NativeResponse;Lcom/moji/mjad/common/data/AdCommon;Z)Z
    .locals 3

    const/4 v0, 0x0

    if-eqz p1, :cond_7

    if-eqz p2, :cond_7

    .line 187
    iput-object p1, p2, Lcom/moji/mjad/common/data/AdCommon;->baiduAd:Lcom/baidu/mobad/feeds/NativeResponse;

    .line 188
    invoke-interface {p1}, Lcom/baidu/mobad/feeds/NativeResponse;->getTitle()Ljava/lang/String;

    move-result-object v1

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

    move-result v1

    if-nez v1, :cond_0

    .line 189
    invoke-interface {p1}, Lcom/baidu/mobad/feeds/NativeResponse;->getTitle()Ljava/lang/String;

    move-result-object v1

    iput-object v1, p2, Lcom/moji/mjad/common/data/AdCommon;->title:Ljava/lang/String;

    :cond_0
    if-eqz p3, :cond_1

    .line 192
    invoke-interface {p1}, Lcom/baidu/mobad/feeds/NativeResponse;->getTitle()Ljava/lang/String;

    move-result-object p3

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

    move-result p3

    if-nez p3, :cond_2

    .line 193
    invoke-interface {p1}, Lcom/baidu/mobad/feeds/NativeResponse;->getTitle()Ljava/lang/String;

    move-result-object p3

    iput-object p3, p2, Lcom/moji/mjad/common/data/AdCommon;->description:Ljava/lang/String;

    goto :goto_0

    .line 196
    :cond_1
    invoke-interface {p1}, Lcom/baidu/mobad/feeds/NativeResponse;->getDesc()Ljava/lang/String;

    move-result-object p3

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

    move-result p3

    if-nez p3, :cond_2

    .line 197
    invoke-interface {p1}, Lcom/baidu/mobad/feeds/NativeResponse;->getDesc()Ljava/lang/String;

    move-result-object p3

    iput-object p3, p2, Lcom/moji/mjad/common/data/AdCommon;->description:Ljava/lang/String;

    .line 201
    :cond_2
    :goto_0
    iget-object p3, p2, Lcom/moji/mjad/common/data/AdCommon;->position:Lcom/moji/mjad/enumdata/MojiAdPosition;

    sget-object v1, Lcom/moji/mjad/enumdata/MojiAdPosition;->POS_MY_PAGE_DYNAMIC_MENU:Lcom/moji/mjad/enumdata/MojiAdPosition;

    if-eq p3, v1, :cond_3

    iget-object p3, p2, Lcom/moji/mjad/common/data/AdCommon;->position:Lcom/moji/mjad/enumdata/MojiAdPosition;

    sget-object v1, Lcom/moji/mjad/enumdata/MojiAdPosition;->POS_MY_PAGE_DYNAMIC_MENU_TWO:Lcom/moji/mjad/enumdata/MojiAdPosition;

    if-eq p3, v1, :cond_3

    iget p3, p2, Lcom/moji/mjad/common/data/AdCommon;->adStyle:I

    const/16 v1, 0x9

    if-eq p3, v1, :cond_3

    .line 204
    invoke-interface {p1}, Lcom/baidu/mobad/feeds/NativeResponse;->getIconUrl()Ljava/lang/String;

    move-result-object p3

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

    move-result p3

    if-nez p3, :cond_3

    .line 206
    new-instance p3, Lcom/moji/mjad/base/data/AdIconInfo;

    invoke-direct {p3}, Lcom/moji/mjad/base/data/AdIconInfo;-><init>()V

    .line 207
    invoke-interface {p1}, Lcom/baidu/mobad/feeds/NativeResponse;->getIconUrl()Ljava/lang/String;

    move-result-object v1

    iput-object v1, p3, Lcom/moji/mjad/base/data/AdIconInfo;->iconUrl:Ljava/lang/String;

    .line 208
    iput-object p3, p2, Lcom/moji/mjad/common/data/AdCommon;->iconInfo:Lcom/moji/mjad/base/data/AdIconInfo;

    .line 210
    :cond_3
    iput-boolean v0, p2, Lcom/moji/mjad/common/data/AdCommon;->isRecord:Z

    .line 211
    iget p3, p2, Lcom/moji/mjad/common/data/AdCommon;->adStyle:I

    const/4 v1, 0x6

    const/4 v2, 0x1

    if-ne p3, v1, :cond_6

    .line 212
    invoke-interface {p1}, Lcom/baidu/mobad/feeds/NativeResponse;->getMultiPicUrls()Ljava/util/List;

    move-result-object p3

    if-eqz p3, :cond_7

    invoke-interface {p1}, Lcom/baidu/mobad/feeds/NativeResponse;->getMultiPicUrls()Ljava/util/List;

    move-result-object p3

    invoke-interface {p3}, Ljava/util/List;->size()I

    move-result p3

    const/4 v1, 0x2

    if-le p3, v1, :cond_7

    .line 213
    new-instance p3, Ljava/util/ArrayList;

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

    iput-object p3, p2, Lcom/moji/mjad/common/data/AdCommon;->imageInfos:Ljava/util/List;

    .line 214
    invoke-interface {p1}, Lcom/baidu/mobad/feeds/NativeResponse;->getMultiPicUrls()Ljava/util/List;

    move-result-object p1

    invoke-interface {p1}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object p1

    :cond_4
    :goto_1
    invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z

    move-result p3

    if-eqz p3, :cond_5

    invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object p3

    check-cast p3, Ljava/lang/String;

    .line 215
    invoke-static {p3}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-nez v0, :cond_4

    .line 216
    new-instance v0, Lcom/moji/mjad/base/data/AdImageInfo;

    invoke-direct {v0}, Lcom/moji/mjad/base/data/AdImageInfo;-><init>()V

    .line 217
    iput-object p3, v0, Lcom/moji/mjad/base/data/AdImageInfo;->imageUrl:Ljava/lang/String;

    .line 218
    iget-object p3, p2, Lcom/moji/mjad/common/data/AdCommon;->imageInfos:Ljava/util/List;

    invoke-interface {p3, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    goto :goto_1

    :cond_5
    return v2

    .line 224
    :cond_6
    invoke-interface {p1}, Lcom/baidu/mobad/feeds/NativeResponse;->getImageUrl()Ljava/lang/String;

    move-result-object p3

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

    move-result p3

    if-nez p3, :cond_7

    .line 225
    new-instance p3, Lcom/moji/mjad/base/data/AdImageInfo;

    invoke-direct {p3}, Lcom/moji/mjad/base/data/AdImageInfo;-><init>()V

    .line 226
    invoke-interface {p1}, Lcom/baidu/mobad/feeds/NativeResponse;->getImageUrl()Ljava/lang/String;

    move-result-object p1

    iput-object p1, p3, Lcom/moji/mjad/base/data/AdImageInfo;->imageUrl:Ljava/lang/String;

    .line 227
    iput-object p3, p2, Lcom/moji/mjad/common/data/AdCommon;->imageInfo:Lcom/moji/mjad/base/data/AdImageInfo;

    return v2

    :cond_7
    return v0
.end method

.method static synthetic a(Lcom/moji/mjad/third/LoadBaiduAd;Lcom/baidu/mobad/feeds/NativeResponse;Lcom/moji/mjad/common/data/AdCommon;Z)Z
    .locals 0

    .line 28
    invoke-direct {p0, p1, p2, p3}, Lcom/moji/mjad/third/LoadBaiduAd;->a(Lcom/baidu/mobad/feeds/NativeResponse;Lcom/moji/mjad/common/data/AdCommon;Z)Z

    move-result p0

    return p0
.end method
