.class public Lcom/baidu/mobads/command/a/a;
.super Lcom/baidu/mobads/command/b;
.source "SourceFile"


# direct methods
.method public constructor <init>(Lcom/baidu/mobads/interfaces/IXNonLinearAdSlot;Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;Lcom/baidu/mobads/interfaces/IXAdResource;)V
    .locals 0

    .line 49
    invoke-direct {p0, p1, p2, p3}, Lcom/baidu/mobads/command/b;-><init>(Lcom/baidu/mobads/interfaces/IXNonLinearAdSlot;Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;Lcom/baidu/mobads/interfaces/IXAdResource;)V

    return-void
.end method

.method public static a(Lcom/baidu/mobads/command/a;)Lcom/baidu/mobads/interfaces/download/activate/IXAppInfo;
    .locals 3

    const/4 v0, 0x0

    if-eqz p0, :cond_1

    .line 277
    invoke-static {}, Lcom/baidu/mobads/production/a;->c()Lcom/baidu/mobads/interfaces/IXAdContainerFactory;

    move-result-object v1

    if-nez v1, :cond_0

    return-object v0

    .line 281
    :cond_0
    invoke-interface {v1}, Lcom/baidu/mobads/interfaces/IXAdContainerFactory;->createAppInfo()Lcom/baidu/mobads/interfaces/download/activate/IXAppInfo;

    move-result-object v0

    .line 282
    invoke-virtual {p0}, Lcom/baidu/mobads/command/a;->g()Ljava/lang/String;

    move-result-object v1

    invoke-interface {v0, v1}, Lcom/baidu/mobads/interfaces/download/activate/IXAppInfo;->setAdId(Ljava/lang/String;)V

    .line 283
    invoke-virtual {p0}, Lcom/baidu/mobads/command/a;->e()J

    move-result-wide v1

    invoke-interface {v0, v1, v2}, Lcom/baidu/mobads/interfaces/download/activate/IXAppInfo;->setAppSize(J)V

    .line 284
    invoke-virtual {p0}, Lcom/baidu/mobads/command/a;->c()J

    move-result-wide v1

    invoke-interface {v0, v1, v2}, Lcom/baidu/mobads/interfaces/download/activate/IXAppInfo;->setClickTime(J)V

    .line 285
    invoke-virtual {p0}, Lcom/baidu/mobads/command/a;->d()Ljava/lang/String;

    move-result-object v1

    invoke-interface {v0, v1}, Lcom/baidu/mobads/interfaces/download/activate/IXAppInfo;->setPackageName(Ljava/lang/String;)V

    .line 286
    invoke-virtual {p0}, Lcom/baidu/mobads/command/a;->h()Ljava/lang/String;

    move-result-object v1

    invoke-interface {v0, v1}, Lcom/baidu/mobads/interfaces/download/activate/IXAppInfo;->setQk(Ljava/lang/String;)V

    .line 287
    invoke-virtual {p0}, Lcom/baidu/mobads/command/a;->i()Ljava/lang/String;

    move-result-object v1

    invoke-interface {v0, v1}, Lcom/baidu/mobads/interfaces/download/activate/IXAppInfo;->setProd(Ljava/lang/String;)V

    .line 288
    invoke-virtual {p0}, Lcom/baidu/mobads/command/a;->f()Z

    move-result p0

    invoke-interface {v0, p0}, Lcom/baidu/mobads/interfaces/download/activate/IXAppInfo;->setTooLarge(Z)V

    return-object v0

    :cond_1
    return-object v0
.end method

.method private b(Lcom/baidu/mobads/command/a;)V
    .locals 3

    .line 264
    invoke-static {}, Lcom/baidu/mobads/production/a;->c()Lcom/baidu/mobads/interfaces/IXAdContainerFactory;

    move-result-object v0

    if-eqz v0, :cond_1

    .line 265
    invoke-static {p1}, Lcom/baidu/mobads/command/a/a;->a(Lcom/baidu/mobads/command/a;)Lcom/baidu/mobads/interfaces/download/activate/IXAppInfo;

    move-result-object p1

    if-eqz p1, :cond_0

    .line 267
    invoke-static {}, Lcom/baidu/mobads/production/a;->c()Lcom/baidu/mobads/interfaces/IXAdContainerFactory;

    move-result-object v0

    iget-object v1, p0, Lcom/baidu/mobads/command/a/a;->a:Landroid/content/Context;

    iget-object v2, p0, Lcom/baidu/mobads/command/a/a;->e:Lcom/baidu/mobads/interfaces/utils/IXAdLogger;

    invoke-interface {v0, v1, v2}, Lcom/baidu/mobads/interfaces/IXAdContainerFactory;->getXMonitorActivation(Landroid/content/Context;Lcom/baidu/mobads/interfaces/utils/IXAdLogger;)Lcom/baidu/mobads/interfaces/download/activate/IXMonitorActivation;

    move-result-object v0

    invoke-interface {v0, p1}, Lcom/baidu/mobads/interfaces/download/activate/IXMonitorActivation;->addAppInfoForMonitor(Lcom/baidu/mobads/interfaces/download/activate/IXAppInfo;)V

    goto :goto_0

    .line 270
    :cond_0
    iget-object p1, p0, Lcom/baidu/mobads/command/a/a;->e:Lcom/baidu/mobads/interfaces/utils/IXAdLogger;

    const-string v0, "addAppInfoForMonitor error, appInfo is null"

    invoke-interface {p1, v0}, Lcom/baidu/mobads/interfaces/utils/IXAdLogger;->e(Ljava/lang/String;)I

    :cond_1
    :goto_0
    return-void
.end method

.method private b()Z
    .locals 3

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

    move-result-object v0

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

    move-result-object v0

    iget-object v1, p0, Lcom/baidu/mobads/command/a/a;->a:Landroid/content/Context;

    iget-object v2, p0, Lcom/baidu/mobads/command/a/a;->c:Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;

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

    move-result-object v2

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

    move-result v0

    return v0
.end method


# virtual methods
.method public a()V
    .locals 17

    move-object/from16 v1, p0

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

    move-result-object v0

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

    move-result-object v0

    .line 80
    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;->getIoUtils()Lcom/baidu/mobads/interfaces/utils/IXAdIOUtils;

    move-result-object v2

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

    move-result-object v3

    invoke-virtual {v3}, Lcom/baidu/mobads/utils/XAdSDKFoundationFacade;->getURIUitls()Lcom/baidu/mobads/interfaces/utils/IXAdURIUitls;

    move-result-object v3

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

    move-result-object v4

    invoke-virtual {v4}, Lcom/baidu/mobads/utils/XAdSDKFoundationFacade;->getSystemUtils()Lcom/baidu/mobads/interfaces/utils/IXAdSystemUtils;

    move-result-object v4

    .line 85
    :try_start_0
    iget-object v5, v1, Lcom/baidu/mobads/command/a/a;->c:Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;

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

    move-result-object v5

    .line 86
    iget-object v6, v1, Lcom/baidu/mobads/command/a/a;->e:Lcom/baidu/mobads/interfaces/utils/IXAdLogger;

    const-string v7, "XAdDownloadAPKCommand"

    new-instance v8, Ljava/lang/StringBuilder;

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

    const-string v9, "download pkg = "

    invoke-virtual {v8, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v8, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v8}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v8

    invoke-interface {v6, v7, v8}, Lcom/baidu/mobads/interfaces/utils/IXAdLogger;->i(Ljava/lang/String;Ljava/lang/String;)I

    if-eqz v5, :cond_0

    const-string v6, ""

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

    move-result v6

    if-eqz v6, :cond_1

    :cond_0
    iget-object v6, v1, Lcom/baidu/mobads/command/a/a;->c:Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;

    invoke-interface {v6}, Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;->getOriginClickUrl()Ljava/lang/String;

    move-result-object v6

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

    move-result v6

    if-nez v6, :cond_1

    .line 90
    iget-object v5, v1, Lcom/baidu/mobads/command/a/a;->e:Lcom/baidu/mobads/interfaces/utils/IXAdLogger;

    const-string v6, "XAdDownloadAPKCommand"

    const-string v7, "start to download but package is empty"

    invoke-interface {v5, v6, v7}, Lcom/baidu/mobads/interfaces/utils/IXAdLogger;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 91
    iget-object v5, v1, Lcom/baidu/mobads/command/a/a;->c:Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;

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

    move-result-object v5

    invoke-virtual {v0, v5}, Lcom/baidu/mobads/utils/d;->getMD5(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    .line 94
    :cond_1
    iget-object v6, v1, Lcom/baidu/mobads/command/a/a;->a:Landroid/content/Context;

    invoke-static {v6}, Lcom/baidu/mobads/openad/c/d;->a(Landroid/content/Context;)Lcom/baidu/mobads/openad/c/d;

    move-result-object v6

    invoke-virtual {v6, v5}, Lcom/baidu/mobads/openad/c/d;->getAdsApkDownloader(Ljava/lang/String;)Lcom/baidu/mobads/openad/interfaces/download/IOAdDownloader;

    move-result-object v6

    .line 96
    invoke-static {v5}, Lcom/baidu/mobads/openad/c/b;->a(Ljava/lang/String;)Lcom/baidu/mobads/openad/c/b;

    move-result-object v7

    const/4 v8, 0x0

    const/16 v9, 0x211

    if-eqz v7, :cond_7

    if-eqz v6, :cond_7

    .line 98
    invoke-virtual {v7}, Lcom/baidu/mobads/openad/c/b;->a()Lcom/baidu/mobads/command/a;

    move-result-object v7

    .line 99
    invoke-interface {v6}, Lcom/baidu/mobads/openad/interfaces/download/IOAdDownloader;->getState()Lcom/baidu/mobads/openad/interfaces/download/IOAdDownloader$DownloadStatus;

    move-result-object v10

    .line 100
    iget-object v11, v1, Lcom/baidu/mobads/command/a/a;->e:Lcom/baidu/mobads/interfaces/utils/IXAdLogger;

    const-string v12, "XAdDownloadAPKCommand"

    new-instance v13, Ljava/lang/StringBuilder;

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

    const-string v14, "startDownload>> downloader exist: state="

    invoke-virtual {v13, v14}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v13, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    invoke-virtual {v13}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v13

    invoke-interface {v11, v12, v13}, Lcom/baidu/mobads/interfaces/utils/IXAdLogger;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 101
    sget-object v11, Lcom/baidu/mobads/openad/interfaces/download/IOAdDownloader$DownloadStatus;->CANCELLED:Lcom/baidu/mobads/openad/interfaces/download/IOAdDownloader$DownloadStatus;

    if-eq v10, v11, :cond_6

    sget-object v11, Lcom/baidu/mobads/openad/interfaces/download/IOAdDownloader$DownloadStatus;->ERROR:Lcom/baidu/mobads/openad/interfaces/download/IOAdDownloader$DownloadStatus;

    if-eq v10, v11, :cond_6

    sget-object v11, Lcom/baidu/mobads/openad/interfaces/download/IOAdDownloader$DownloadStatus;->PAUSED:Lcom/baidu/mobads/openad/interfaces/download/IOAdDownloader$DownloadStatus;

    if-ne v10, v11, :cond_2

    goto :goto_0

    .line 107
    :cond_2
    sget-object v11, Lcom/baidu/mobads/openad/interfaces/download/IOAdDownloader$DownloadStatus;->COMPLETED:Lcom/baidu/mobads/openad/interfaces/download/IOAdDownloader$DownloadStatus;

    if-ne v10, v11, :cond_4

    .line 108
    iget-object v10, v1, Lcom/baidu/mobads/command/a/a;->a:Landroid/content/Context;

    invoke-virtual {v1, v10, v7}, Lcom/baidu/mobads/command/a/a;->a(Landroid/content/Context;Lcom/baidu/mobads/command/a;)Z

    move-result v10

    if-eqz v10, :cond_3

    .line 109
    iget-object v0, v1, Lcom/baidu/mobads/command/a/a;->c:Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;

    invoke-interface {v0}, Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;->getClickThroughUrl()Ljava/lang/String;

    move-result-object v0

    invoke-interface {v3, v0}, Lcom/baidu/mobads/interfaces/utils/IXAdURIUitls;->pintHttpInNewThread(Ljava/lang/String;)V

    .line 110
    invoke-direct {v1, v7}, Lcom/baidu/mobads/command/a/a;->b(Lcom/baidu/mobads/command/a;)V

    return-void

    .line 114
    :cond_3
    invoke-interface {v6}, Lcom/baidu/mobads/openad/interfaces/download/IOAdDownloader;->cancel()V

    .line 115
    invoke-interface {v6}, Lcom/baidu/mobads/openad/interfaces/download/IOAdDownloader;->removeObservers()V

    .line 116
    invoke-static {v5}, Lcom/baidu/mobads/openad/c/b;->b(Ljava/lang/String;)Lcom/baidu/mobads/openad/c/b;

    .line 117
    iget-object v6, v1, Lcom/baidu/mobads/command/a/a;->a:Landroid/content/Context;

    invoke-static {v6}, Lcom/baidu/mobads/openad/c/d;->a(Landroid/content/Context;)Lcom/baidu/mobads/openad/c/d;

    move-result-object v6

    invoke-virtual {v6, v5}, Lcom/baidu/mobads/openad/c/d;->removeAdsApkDownloader(Ljava/lang/String;)Ljava/lang/Boolean;

    goto :goto_1

    .line 118
    :cond_4
    sget-object v7, Lcom/baidu/mobads/openad/interfaces/download/IOAdDownloader$DownloadStatus;->DOWNLOADING:Lcom/baidu/mobads/openad/interfaces/download/IOAdDownloader$DownloadStatus;

    if-eq v10, v7, :cond_5

    sget-object v7, Lcom/baidu/mobads/openad/interfaces/download/IOAdDownloader$DownloadStatus;->INITING:Lcom/baidu/mobads/openad/interfaces/download/IOAdDownloader$DownloadStatus;

    if-ne v10, v7, :cond_9

    .line 119
    :cond_5
    iget-object v0, v1, Lcom/baidu/mobads/command/a/a;->a:Landroid/content/Context;

    const-string v2, "downloading"

    invoke-virtual {v1, v0, v2, v9}, Lcom/baidu/mobads/command/a/a;->a(Landroid/content/Context;Ljava/lang/String;I)V

    .line 120
    iget-object v0, v1, Lcom/baidu/mobads/command/a/a;->a:Landroid/content/Context;

    new-instance v2, Ljava/lang/StringBuilder;

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

    invoke-interface {v6}, Lcom/baidu/mobads/openad/interfaces/download/IOAdDownloader;->getTitle()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-interface {v6}, Lcom/baidu/mobads/openad/interfaces/download/IOAdDownloader;->getState()Lcom/baidu/mobads/openad/interfaces/download/IOAdDownloader$DownloadStatus;

    move-result-object v3

    invoke-virtual {v3}, Lcom/baidu/mobads/openad/interfaces/download/IOAdDownloader$DownloadStatus;->getMessage()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v0, v2, v8}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;

    move-result-object v0

    invoke-virtual {v0}, Landroid/widget/Toast;->show()V

    return-void

    .line 104
    :cond_6
    :goto_0
    invoke-interface {v6}, Lcom/baidu/mobads/openad/interfaces/download/IOAdDownloader;->resume()V

    .line 105
    iget-object v0, v1, Lcom/baidu/mobads/command/a/a;->c:Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;

    invoke-interface {v0}, Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;->getClickThroughUrl()Ljava/lang/String;

    move-result-object v0

    invoke-interface {v3, v0}, Lcom/baidu/mobads/interfaces/utils/IXAdURIUitls;->pintHttpInNewThread(Ljava/lang/String;)V

    return-void

    :cond_7
    if-eqz v6, :cond_8

    .line 128
    invoke-interface {v6}, Lcom/baidu/mobads/openad/interfaces/download/IOAdDownloader;->cancel()V

    .line 129
    invoke-interface {v6}, Lcom/baidu/mobads/openad/interfaces/download/IOAdDownloader;->removeObservers()V

    .line 131
    :cond_8
    invoke-static {v5}, Lcom/baidu/mobads/openad/c/b;->b(Ljava/lang/String;)Lcom/baidu/mobads/openad/c/b;

    .line 132
    iget-object v6, v1, Lcom/baidu/mobads/command/a/a;->a:Landroid/content/Context;

    invoke-static {v6}, Lcom/baidu/mobads/openad/c/d;->a(Landroid/content/Context;)Lcom/baidu/mobads/openad/c/d;

    move-result-object v6

    invoke-virtual {v6, v5}, Lcom/baidu/mobads/openad/c/d;->removeAdsApkDownloader(Ljava/lang/String;)Ljava/lang/Boolean;

    .line 136
    :cond_9
    :goto_1
    iget-object v6, v1, Lcom/baidu/mobads/command/a/a;->a:Landroid/content/Context;

    invoke-static {v6, v5}, Lcom/baidu/mobads/command/a;->a(Landroid/content/Context;Ljava/lang/String;)Lcom/baidu/mobads/command/a;

    move-result-object v6

    const/4 v7, 0x1

    if-eqz v6, :cond_b

    .line 140
    iget-object v0, v6, Lcom/baidu/mobads/command/a;->g:Lcom/baidu/mobads/openad/interfaces/download/IOAdDownloader$DownloadStatus;

    sget-object v2, Lcom/baidu/mobads/openad/interfaces/download/IOAdDownloader$DownloadStatus;->COMPLETED:Lcom/baidu/mobads/openad/interfaces/download/IOAdDownloader$DownloadStatus;

    if-ne v0, v2, :cond_a

    .line 142
    iget-object v0, v1, Lcom/baidu/mobads/command/a/a;->a:Landroid/content/Context;

    invoke-virtual {v1, v0, v6}, Lcom/baidu/mobads/command/a/a;->a(Landroid/content/Context;Lcom/baidu/mobads/command/a;)Z

    move-result v0

    if-eqz v0, :cond_a

    .line 143
    invoke-direct {v1, v6}, Lcom/baidu/mobads/command/a/a;->b(Lcom/baidu/mobads/command/a;)V

    return-void

    .line 148
    :cond_a
    iget-object v0, v1, Lcom/baidu/mobads/command/a/a;->c:Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;

    invoke-interface {v0}, Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;->getClickThroughUrl()Ljava/lang/String;

    move-result-object v0

    invoke-interface {v3, v0}, Lcom/baidu/mobads/interfaces/utils/IXAdURIUitls;->pintHttpInNewThread(Ljava/lang/String;)V

    goto/16 :goto_2

    .line 149
    :cond_b
    invoke-direct/range {p0 .. p0}, Lcom/baidu/mobads/command/a/a;->b()Z

    move-result v6

    if-eqz v6, :cond_c

    .line 150
    iget-object v0, v1, Lcom/baidu/mobads/command/a/a;->a:Landroid/content/Context;

    const-string v2, "alreadyinstalled1"

    invoke-virtual {v1, v0, v2, v9}, Lcom/baidu/mobads/command/a/a;->a(Landroid/content/Context;Ljava/lang/String;I)V

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

    move-result-object v0

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

    move-result-object v0

    iget-object v2, v1, Lcom/baidu/mobads/command/a/a;->a:Landroid/content/Context;

    iget-object v4, v1, Lcom/baidu/mobads/command/a/a;->c:Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;

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

    move-result-object v4

    invoke-virtual {v0, v2, v4}, Lcom/baidu/mobads/utils/l;->openApp(Landroid/content/Context;Ljava/lang/String;)V

    .line 153
    iget-object v0, v1, Lcom/baidu/mobads/command/a/a;->c:Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;

    invoke-interface {v0}, Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;->getClickThroughUrl()Ljava/lang/String;

    move-result-object v0

    invoke-interface {v3, v0}, Lcom/baidu/mobads/interfaces/utils/IXAdURIUitls;->pintHttpInNewThread(Ljava/lang/String;)V

    .line 160
    invoke-static {}, Lcom/baidu/mobads/production/a;->c()Lcom/baidu/mobads/interfaces/IXAdContainerFactory;

    move-result-object v0

    iget-object v2, v1, Lcom/baidu/mobads/command/a/a;->a:Landroid/content/Context;

    iget-object v3, v1, Lcom/baidu/mobads/command/a/a;->e:Lcom/baidu/mobads/interfaces/utils/IXAdLogger;

    invoke-interface {v0, v2, v3}, Lcom/baidu/mobads/interfaces/IXAdContainerFactory;->getXMonitorActivation(Landroid/content/Context;Lcom/baidu/mobads/interfaces/utils/IXAdLogger;)Lcom/baidu/mobads/interfaces/download/activate/IXMonitorActivation;

    move-result-object v0

    invoke-interface {v0}, Lcom/baidu/mobads/interfaces/download/activate/IXMonitorActivation;->startMonitor()V

    return-void

    .line 165
    :cond_c
    iget-object v3, v1, Lcom/baidu/mobads/command/a/a;->c:Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;

    invoke-interface {v3}, Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;->getAppName()Ljava/lang/String;

    move-result-object v3

    if-eqz v3, :cond_d

    const-string v6, ""

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

    move-result v6

    if-eqz v6, :cond_f

    .line 167
    :cond_d
    iget-object v3, v1, Lcom/baidu/mobads/command/a/a;->c:Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;

    invoke-interface {v3}, Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;->getTitle()Ljava/lang/String;

    move-result-object v3

    if-eqz v3, :cond_e

    const-string v6, ""

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

    move-result v6

    if-eqz v6, :cond_f

    :cond_e
    const-string v3, "\u60a8\u70b9\u51fb\u7684\u5e94\u7528"

    .line 172
    :cond_f
    new-instance v6, Lcom/baidu/mobads/command/a;

    invoke-direct {v6, v5, v3}, Lcom/baidu/mobads/command/a;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 173
    iget-object v3, v1, Lcom/baidu/mobads/command/a/a;->c:Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;

    invoke-interface {v3}, Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;->getQueryKey()Ljava/lang/String;

    move-result-object v3

    iget-object v10, v1, Lcom/baidu/mobads/command/a/a;->c:Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;

    invoke-interface {v10}, Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;->getAdId()Ljava/lang/String;

    move-result-object v10

    iget-object v11, v1, Lcom/baidu/mobads/command/a/a;->c:Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;

    invoke-interface {v11}, Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;->getClickThroughUrl()Ljava/lang/String;

    move-result-object v11

    iget-object v12, v1, Lcom/baidu/mobads/command/a/a;->c:Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;

    invoke-interface {v12}, Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;->isAutoOpen()Z

    move-result v12

    invoke-virtual {v6, v3, v10, v11, v12}, Lcom/baidu/mobads/command/a;->a(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)V

    .line 175
    new-instance v3, Ljava/lang/StringBuilder;

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

    iget-object v10, v6, Lcom/baidu/mobads/command/a;->j:Ljava/lang/String;

    invoke-virtual {v0, v10}, Lcom/baidu/mobads/utils/d;->getMD5(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v0, ".apk"

    invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    iget-object v3, v1, Lcom/baidu/mobads/command/a/a;->a:Landroid/content/Context;

    invoke-interface {v2, v3}, Lcom/baidu/mobads/interfaces/utils/IXAdIOUtils;->getStoreagePath(Landroid/content/Context;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v6, v0, v2}, Lcom/baidu/mobads/command/a;->a(Ljava/lang/String;Ljava/lang/String;)V

    .line 176
    iget-object v0, v1, Lcom/baidu/mobads/command/a/a;->b:Lcom/baidu/mobads/interfaces/IXNonLinearAdSlot;

    if-eqz v0, :cond_10

    .line 177
    iget-object v0, v1, Lcom/baidu/mobads/command/a/a;->b:Lcom/baidu/mobads/interfaces/IXNonLinearAdSlot;

    invoke-interface {v0}, Lcom/baidu/mobads/interfaces/IXNonLinearAdSlot;->getAdRequestInfo()Lcom/baidu/mobads/interfaces/IXAdRequestInfo;

    move-result-object v0

    invoke-interface {v0}, Lcom/baidu/mobads/interfaces/IXAdRequestInfo;->getApid()Ljava/lang/String;

    move-result-object v0

    iget-object v2, v1, Lcom/baidu/mobads/command/a/a;->b:Lcom/baidu/mobads/interfaces/IXNonLinearAdSlot;

    invoke-interface {v2}, Lcom/baidu/mobads/interfaces/IXNonLinearAdSlot;->getProdInfo()Lcom/baidu/mobads/interfaces/IXAdProdInfo;

    move-result-object v2

    invoke-interface {v2}, Lcom/baidu/mobads/interfaces/IXAdProdInfo;->getProdType()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v6, v0, v2}, Lcom/baidu/mobads/command/a;->b(Ljava/lang/String;Ljava/lang/String;)V

    .line 179
    :cond_10
    invoke-static {v5}, Lcom/baidu/mobads/openad/c/b;->c(Ljava/lang/String;)I

    move-result v0

    iput v0, v6, Lcom/baidu/mobads/command/a;->f:I

    .line 180
    iget-object v0, v1, Lcom/baidu/mobads/command/a/a;->c:Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;

    invoke-interface {v0}, Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;->isActionOnlyWifi()Z

    move-result v0

    xor-int/2addr v0, v7

    iput-boolean v0, v6, Lcom/baidu/mobads/command/a;->r:Z

    .line 182
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v2

    invoke-virtual {v6, v2, v3}, Lcom/baidu/mobads/command/a;->a(J)V

    .line 183
    iget-object v0, v1, Lcom/baidu/mobads/command/a/a;->c:Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;

    invoke-interface {v0}, Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;->getAppSize()J

    move-result-wide v2

    invoke-virtual {v6, v2, v3}, Lcom/baidu/mobads/command/a;->b(J)V

    .line 184
    iget-object v0, v1, Lcom/baidu/mobads/command/a/a;->c:Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;

    invoke-interface {v0}, Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;->isTooLarge()Z

    move-result v0

    invoke-virtual {v6, v0}, Lcom/baidu/mobads/command/a;->a(Z)V

    .line 186
    :goto_2
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v2

    iput-wide v2, v6, Lcom/baidu/mobads/command/a;->s:J

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

    move-result-object v0

    iget-object v2, v1, Lcom/baidu/mobads/command/a/a;->a:Landroid/content/Context;

    invoke-virtual {v0, v2}, Lcom/baidu/mobads/utils/XAdSDKFoundationFacade;->getDownloaderManager(Landroid/content/Context;)Lcom/baidu/mobads/openad/interfaces/download/IOAdDownloaderManager;

    move-result-object v10

    new-instance v11, Ljava/net/URL;

    iget-object v0, v6, Lcom/baidu/mobads/command/a;->j:Ljava/lang/String;

    invoke-direct {v11, v0}, Ljava/net/URL;-><init>(Ljava/lang/String;)V

    iget-object v12, v6, Lcom/baidu/mobads/command/a;->c:Ljava/lang/String;

    iget-object v13, v6, Lcom/baidu/mobads/command/a;->b:Ljava/lang/String;

    const/4 v14, 0x3

    iget-object v15, v6, Lcom/baidu/mobads/command/a;->a:Ljava/lang/String;

    iget-object v0, v6, Lcom/baidu/mobads/command/a;->i:Ljava/lang/String;

    move-object/from16 v16, v0

    invoke-interface/range {v10 .. v16}, Lcom/baidu/mobads/openad/interfaces/download/IOAdDownloaderManager;->createAdsApkDownloader(Ljava/net/URL;Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;)Lcom/baidu/mobads/openad/interfaces/download/IOAdDownloader;

    move-result-object v0

    .line 191
    iget-object v2, v1, Lcom/baidu/mobads/command/a/a;->c:Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;

    invoke-interface {v2}, Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;->getAPOOpen()Z

    move-result v2

    if-ne v2, v7, :cond_11

    iget-object v2, v1, Lcom/baidu/mobads/command/a/a;->c:Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;

    invoke-interface {v2}, Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;->getPage()Ljava/lang/String;

    move-result-object v2

    if-eqz v2, :cond_11

    iget-object v2, v1, Lcom/baidu/mobads/command/a/a;->c:Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;

    invoke-interface {v2}, Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;->getPage()Ljava/lang/String;

    move-result-object v2

    const-string v3, ""

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

    move-result v2

    if-nez v2, :cond_11

    .line 194
    iput-boolean v7, v6, Lcom/baidu/mobads/command/a;->v:Z

    .line 195
    iget-object v2, v1, Lcom/baidu/mobads/command/a/a;->c:Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;

    invoke-interface {v2}, Lcom/baidu/mobads/interfaces/IXAdInstanceInfo;->getPage()Ljava/lang/String;

    move-result-object v2

    iput-object v2, v6, Lcom/baidu/mobads/command/a;->w:Ljava/lang/String;

    .line 197
    :cond_11
    new-instance v2, Lcom/baidu/mobads/openad/c/b;

    iget-object v3, v1, Lcom/baidu/mobads/command/a/a;->a:Landroid/content/Context;

    invoke-direct {v2, v3, v6}, Lcom/baidu/mobads/openad/c/b;-><init>(Landroid/content/Context;Lcom/baidu/mobads/command/a;)V

    .line 198
    invoke-interface {v0, v2}, Lcom/baidu/mobads/openad/interfaces/download/IOAdDownloader;->addObserver(Ljava/util/Observer;)V

    .line 201
    iget-boolean v2, v6, Lcom/baidu/mobads/command/a;->r:Z

    if-nez v2, :cond_12

    iget-object v2, v1, Lcom/baidu/mobads/command/a/a;->a:Landroid/content/Context;

    invoke-interface {v4, v2}, Lcom/baidu/mobads/interfaces/utils/IXAdSystemUtils;->is3GConnected(Landroid/content/Context;)Ljava/lang/Boolean;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/Boolean;->booleanValue()Z

    move-result v2

    if-eqz v2, :cond_12

    .line 202
    iget-object v2, v1, Lcom/baidu/mobads/command/a/a;->a:Landroid/content/Context;

    const-string v3, "waitwifi"

    invoke-virtual {v1, v2, v3, v9}, Lcom/baidu/mobads/command/a/a;->a(Landroid/content/Context;Ljava/lang/String;I)V

    .line 204
    invoke-interface {v0}, Lcom/baidu/mobads/openad/interfaces/download/IOAdDownloader;->pause()V

    .line 205
    iget-object v2, v1, Lcom/baidu/mobads/command/a/a;->a:Landroid/content/Context;

    new-instance v3, Ljava/lang/StringBuilder;

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

    invoke-interface {v0}, Lcom/baidu/mobads/openad/interfaces/download/IOAdDownloader;->getTitle()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v0, " \u5c06\u5728\u8fde\u5165Wifi\u540e\u5f00\u59cb\u4e0b\u8f7d"

    invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v2, v0, v8}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;

    move-result-object v0

    invoke-virtual {v0}, Landroid/widget/Toast;->show()V

    goto :goto_3

    .line 209
    :cond_12
    iget-object v2, v1, Lcom/baidu/mobads/command/a/a;->a:Landroid/content/Context;

    iget-object v3, v6, Lcom/baidu/mobads/command/a;->i:Ljava/lang/String;

    const/16 v4, 0x20f

    invoke-virtual {v1, v2, v3, v4}, Lcom/baidu/mobads/command/a/a;->a(Landroid/content/Context;Ljava/lang/String;I)V

    .line 210
    invoke-interface {v0}, Lcom/baidu/mobads/openad/interfaces/download/IOAdDownloader;->start()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_3

    :catch_0
    move-exception v0

    .line 214
    iget-object v2, v1, Lcom/baidu/mobads/command/a/a;->e:Lcom/baidu/mobads/interfaces/utils/IXAdLogger;

    const-string v3, "XAdDownloadAPKCommand"

    invoke-interface {v2, v3, v0}, Lcom/baidu/mobads/interfaces/utils/IXAdLogger;->e(Ljava/lang/String;Ljava/lang/Throwable;)I

    .line 216
    invoke-static {}, Lcom/baidu/mobads/c/a;->a()Lcom/baidu/mobads/c/a;

    move-result-object v2

    new-instance v3, Ljava/lang/StringBuilder;

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

    const-string v4, "ad app download failed: "

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/Exception;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v2, v0}, Lcom/baidu/mobads/c/a;->a(Ljava/lang/String;)V

    :goto_3
    return-void
.end method

.method public a(Landroid/content/Context;Ljava/lang/String;I)V
    .locals 2

    .line 221
    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

    .line 222
    iget-object v0, p0, Lcom/baidu/mobads/command/a/a;->b:Lcom/baidu/mobads/interfaces/IXNonLinearAdSlot;

    if-eqz v0, :cond_0

    .line 223
    iget-object v0, p0, Lcom/baidu/mobads/command/a/a;->a:Landroid/content/Context;

    iget-object v1, p0, Lcom/baidu/mobads/command/a/a;->b:Lcom/baidu/mobads/interfaces/IXNonLinearAdSlot;

    invoke-interface {v1}, Lcom/baidu/mobads/interfaces/IXNonLinearAdSlot;->getProdInfo()Lcom/baidu/mobads/interfaces/IXAdProdInfo;

    move-result-object v1

    invoke-interface {v1}, Lcom/baidu/mobads/interfaces/IXAdProdInfo;->getProdType()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {p1, v0, p2, p3, v1}, Lcom/baidu/mobads/utils/d;->sendDownloadAdLog(Landroid/content/Context;Ljava/lang/String;ILjava/lang/String;)V

    goto :goto_0

    .line 225
    :cond_0
    iget-object v0, p0, Lcom/baidu/mobads/command/a/a;->a:Landroid/content/Context;

    const-string v1, ""

    invoke-virtual {p1, v0, p2, p3, v1}, Lcom/baidu/mobads/utils/d;->sendDownloadAdLog(Landroid/content/Context;Ljava/lang/String;ILjava/lang/String;)V

    :goto_0
    return-void
.end method

.method protected a(Landroid/content/Context;Lcom/baidu/mobads/command/a;)Z
    .locals 6

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

    move-result-object v0

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

    move-result-object v0

    iget-object v1, p2, Lcom/baidu/mobads/command/a;->i:Ljava/lang/String;

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

    move-result v0

    .line 245
    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;

    const/4 v1, 0x1

    const/16 v2, 0x211

    if-eqz v0, :cond_0

    .line 247
    iget-object v0, p0, Lcom/baidu/mobads/command/a/a;->a:Landroid/content/Context;

    const-string v3, "alreadyinstalled"

    invoke-virtual {p0, v0, v3, v2}, Lcom/baidu/mobads/command/a/a;->a(Landroid/content/Context;Ljava/lang/String;I)V

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

    move-result-object v0

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

    move-result-object v0

    iget-object p2, p2, Lcom/baidu/mobads/command/a;->i:Ljava/lang/String;

    invoke-virtual {v0, p1, p2}, Lcom/baidu/mobads/utils/l;->openApp(Landroid/content/Context;Ljava/lang/String;)V

    return v1

    .line 251
    :cond_0
    iget-object v0, p0, Lcom/baidu/mobads/command/a/a;->a:Landroid/content/Context;

    const-string v3, "alreadydownloaded"

    invoke-virtual {p0, v0, v3, v2}, Lcom/baidu/mobads/command/a/a;->a(Landroid/content/Context;Ljava/lang/String;I)V

    .line 252
    new-instance v0, Ljava/lang/StringBuilder;

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

    iget-object v2, p2, Lcom/baidu/mobads/command/a;->c:Ljava/lang/String;

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-object p2, p2, Lcom/baidu/mobads/command/a;->b:Ljava/lang/String;

    invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p2

    .line 253
    new-instance v0, Ljava/io/File;

    invoke-direct {v0, p2}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 254
    invoke-virtual {v0}, Ljava/io/File;->exists()Z

    move-result v2

    if-eqz v2, :cond_1

    invoke-virtual {v0}, Ljava/io/File;->length()J

    move-result-wide v2

    const-wide/16 v4, 0x0

    cmp-long v0, v2, v4

    if-lez v0, :cond_1

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

    move-result-object v0

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

    move-result-object v0

    invoke-virtual {v0, p1, p2}, Lcom/baidu/mobads/utils/l;->b(Landroid/content/Context;Ljava/lang/String;)V

    return v1

    :cond_1
    const/4 p1, 0x0

    return p1
.end method
