.class public Lcom/baidu/mobads/g/g;
.super Ljava/lang/Object;
.source "SourceFile"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/baidu/mobads/g/g$b;,
        Lcom/baidu/mobads/g/g$a;,
        Lcom/baidu/mobads/g/g$c;
    }
.end annotation


# static fields
.field protected static a:Ljava/lang/Thread$UncaughtExceptionHandler;

.field protected static volatile b:Lcom/baidu/mobads/g/a;

.field protected static volatile c:Lcom/baidu/mobads/g/a;

.field protected static volatile d:Ljava/lang/Class;

.field protected static e:Ljava/lang/String;

.field protected static final f:Landroid/os/Handler;

.field private static i:Ljava/lang/String;


# instance fields
.field protected g:Landroid/os/Handler;

.field protected final h:Landroid/os/Handler;
    .annotation build Landroid/annotation/SuppressLint;
        value = {
            "HandlerLeak"
        }
    .end annotation
.end field

.field private j:Lcom/baidu/mobads/openad/e/a;

.field private k:Lcom/baidu/mobads/g/e;

.field private final l:Landroid/content/Context;

.field private m:Lcom/baidu/mobads/interfaces/utils/IXAdLogger;

.field private n:Z

.field private o:Lcom/baidu/mobads/g/g$c;


# direct methods
.method static constructor <clinit>()V
    .locals 2

    .line 113
    new-instance v0, Lcom/baidu/mobads/g/h;

    invoke-static {}, Landroid/os/Looper;->getMainLooper()Landroid/os/Looper;

    move-result-object v1

    invoke-direct {v0, v1}, Lcom/baidu/mobads/g/h;-><init>(Landroid/os/Looper;)V

    sput-object v0, Lcom/baidu/mobads/g/g;->f:Landroid/os/Handler;

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;)V
    .locals 3

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

    .line 101
    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;->getAdLogger()Lcom/baidu/mobads/interfaces/utils/IXAdLogger;

    move-result-object v0

    iput-object v0, p0, Lcom/baidu/mobads/g/g;->m:Lcom/baidu/mobads/interfaces/utils/IXAdLogger;

    const/4 v0, 0x0

    .line 111
    iput-boolean v0, p0, Lcom/baidu/mobads/g/g;->n:Z

    .line 119
    sget-object v0, Lcom/baidu/mobads/g/g;->f:Landroid/os/Handler;

    iput-object v0, p0, Lcom/baidu/mobads/g/g;->g:Landroid/os/Handler;

    .line 121
    new-instance v0, Lcom/baidu/mobads/g/i;

    invoke-static {}, Landroid/os/Looper;->getMainLooper()Landroid/os/Looper;

    move-result-object v1

    invoke-direct {v0, p0, v1}, Lcom/baidu/mobads/g/i;-><init>(Lcom/baidu/mobads/g/g;Landroid/os/Looper;)V

    iput-object v0, p0, Lcom/baidu/mobads/g/g;->h:Landroid/os/Handler;

    .line 190
    sget-object v0, Lcom/baidu/mobads/g/g;->i:Ljava/lang/String;

    if-nez v0, :cond_0

    .line 191
    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;->getURIUitls()Lcom/baidu/mobads/interfaces/utils/IXAdURIUitls;

    move-result-object v0

    .line 192
    new-instance v1, Ljava/lang/StringBuilder;

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

    const-string v2, "http://mobads.baidu.com/ads/pa/"

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

    move-result-object v0

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

    invoke-static {}, Lcom/baidu/mobads/a/b;->b()I

    move-result v0

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

    const-string v0, "/__pasys_remote_banner.php"

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

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

    move-result-object v0

    sput-object v0, Lcom/baidu/mobads/g/g;->i:Ljava/lang/String;

    .line 196
    :cond_0
    iput-object p1, p0, Lcom/baidu/mobads/g/g;->l:Landroid/content/Context;

    .line 197
    invoke-static {p1}, Lcom/baidu/mobads/g/g;->c(Landroid/content/Context;)V

    .line 199
    sget-object v0, Lcom/baidu/mobads/g/g;->a:Ljava/lang/Thread$UncaughtExceptionHandler;

    if-nez v0, :cond_1

    .line 200
    invoke-static {p1}, Lcom/baidu/mobads/g/q;->a(Landroid/content/Context;)Lcom/baidu/mobads/g/q;

    move-result-object v0

    sput-object v0, Lcom/baidu/mobads/g/g;->a:Ljava/lang/Thread$UncaughtExceptionHandler;

    .line 201
    invoke-static {p1}, Lcom/baidu/mobads/g/q;->a(Landroid/content/Context;)Lcom/baidu/mobads/g/q;

    move-result-object p1

    new-instance v0, Lcom/baidu/mobads/g/j;

    invoke-direct {v0, p0}, Lcom/baidu/mobads/g/j;-><init>(Lcom/baidu/mobads/g/g;)V

    invoke-virtual {p1, v0}, Lcom/baidu/mobads/g/q;->a(Lcom/baidu/mobads/g/q$a;)V

    .line 217
    :cond_1
    invoke-static {}, Ljava/lang/Thread;->getDefaultUncaughtExceptionHandler()Ljava/lang/Thread$UncaughtExceptionHandler;

    move-result-object p1

    instance-of p1, p1, Lcom/baidu/mobads/g/q;

    if-nez p1, :cond_2

    .line 218
    sget-object p1, Lcom/baidu/mobads/g/g;->a:Ljava/lang/Thread$UncaughtExceptionHandler;

    invoke-static {p1}, Ljava/lang/Thread;->setDefaultUncaughtExceptionHandler(Ljava/lang/Thread$UncaughtExceptionHandler;)V

    :cond_2
    return-void
.end method

.method public static a(Landroid/content/Context;Ljava/lang/String;)D
    .locals 4

    const-wide/16 v0, 0x0

    .line 827
    :try_start_0
    new-instance p0, Ljava/io/File;

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

    .line 828
    invoke-static {p0}, Lcom/baidu/mobads/utils/j;->a(Ljava/io/File;)Z

    move-result p1

    if-eqz p1, :cond_0

    .line 829
    new-instance p1, Ljava/util/jar/JarFile;

    invoke-direct {p1, p0}, Ljava/util/jar/JarFile;-><init>(Ljava/io/File;)V

    .line 830
    invoke-virtual {p1}, Ljava/util/jar/JarFile;->getManifest()Ljava/util/jar/Manifest;

    move-result-object p0

    invoke-virtual {p0}, Ljava/util/jar/Manifest;->getMainAttributes()Ljava/util/jar/Attributes;

    move-result-object p0

    const-string v2, "Implementation-Version"

    invoke-virtual {p0, v2}, Ljava/util/jar/Attributes;->getValue(Ljava/lang/String;)Ljava/lang/String;

    move-result-object p0

    invoke-static {p0}, Ljava/lang/Double;->parseDouble(Ljava/lang/String;)D

    move-result-wide v2

    .line 832
    invoke-virtual {p1}, Ljava/util/jar/JarFile;->close()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    cmpl-double p0, v2, v0

    if-lez p0, :cond_0

    return-wide v2

    :catch_0
    :cond_0
    return-wide v0
.end method

.method static synthetic a(Lcom/baidu/mobads/g/g;)Landroid/content/Context;
    .locals 0

    .line 44
    iget-object p0, p0, Lcom/baidu/mobads/g/g;->l:Landroid/content/Context;

    return-object p0
.end method

.method static synthetic a(Lcom/baidu/mobads/g/g;Lcom/baidu/mobads/g/e;)Lcom/baidu/mobads/g/e;
    .locals 0

    .line 44
    iput-object p1, p0, Lcom/baidu/mobads/g/g;->k:Lcom/baidu/mobads/g/e;

    return-object p1
.end method

.method private a(Lcom/baidu/mobads/g/a;)Lcom/baidu/mobads/interfaces/IXAdContainerFactory;
    .locals 1

    const/4 v0, 0x0

    if-eqz p1, :cond_0

    .line 763
    :try_start_0
    invoke-virtual {p1}, Lcom/baidu/mobads/g/a;->a()Lcom/baidu/mobads/interfaces/IXAdContainerFactory;

    move-result-object p1
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-object v0, p1

    :catch_0
    :cond_0
    return-object v0
.end method

.method static synthetic a(Lcom/baidu/mobads/g/g;Lcom/baidu/mobads/openad/e/a;)Lcom/baidu/mobads/openad/e/a;
    .locals 0

    .line 44
    iput-object p1, p0, Lcom/baidu/mobads/g/g;->j:Lcom/baidu/mobads/openad/e/a;

    return-object p1
.end method

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

    .line 557
    sget-object v0, Lcom/baidu/mobads/g/g;->e:Ljava/lang/String;

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

    move-result v0

    if-eqz v0, :cond_0

    const-string v0, "baidu_ad_sdk"

    const/4 v1, 0x0

    .line 558
    invoke-virtual {p0, v0, v1}, Landroid/content/Context;->getDir(Ljava/lang/String;I)Ljava/io/File;

    move-result-object p0

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

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

    invoke-virtual {p0}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object p0

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

    const-string p0, "/"

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

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

    move-result-object p0

    sput-object p0, Lcom/baidu/mobads/g/g;->e:Ljava/lang/String;

    .line 561
    :cond_0
    sget-object p0, Lcom/baidu/mobads/g/g;->e:Ljava/lang/String;

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

    move-result p0

    if-eqz p0, :cond_1

    const-string p0, ""

    return-object p0

    .line 564
    :cond_1
    new-instance p0, Ljava/lang/StringBuilder;

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

    sget-object v0, Lcom/baidu/mobads/g/g;->e:Ljava/lang/String;

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

    const-string v0, "__xadsdk__remote__final__running__.jar"

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

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

    move-result-object p0

    return-object p0
.end method

.method private a(Lcom/baidu/mobads/g/b;)V
    .locals 6

    .line 336
    invoke-virtual {p1}, Lcom/baidu/mobads/g/b;->b()Ljava/lang/Class;

    move-result-object v1

    .line 337
    monitor-enter p0

    .line 338
    :try_start_0
    new-instance p1, Lcom/baidu/mobads/g/a;

    iget-object v2, p0, Lcom/baidu/mobads/g/g;->l:Landroid/content/Context;

    invoke-static {}, Lcom/baidu/mobads/a/b;->a()D

    move-result-wide v3

    sget-object v5, Lcom/baidu/mobads/a/b;->a:Ljava/lang/Boolean;

    move-object v0, p1

    invoke-direct/range {v0 .. v5}, Lcom/baidu/mobads/g/a;-><init>(Ljava/lang/Class;Landroid/content/Context;DLjava/lang/Boolean;)V

    sput-object p1, Lcom/baidu/mobads/g/g;->c:Lcom/baidu/mobads/g/a;

    .line 341
    monitor-exit p0

    return-void

    :catchall_0
    move-exception p1

    monitor-exit p0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw p1
.end method

.method private a(Lcom/baidu/mobads/g/e;)V
    .locals 4

    .line 643
    invoke-virtual {p1}, Lcom/baidu/mobads/g/e;->a()Ljava/lang/Boolean;

    move-result-object v0

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

    move-result v0

    if-eqz v0, :cond_1

    .line 644
    iget-object v0, p0, Lcom/baidu/mobads/g/g;->l:Landroid/content/Context;

    sget-object v1, Lcom/baidu/mobads/g/g;->e:Ljava/lang/String;

    iget-object v2, p0, Lcom/baidu/mobads/g/g;->h:Landroid/os/Handler;

    invoke-static {v0, p1, v1, v2}, Lcom/baidu/mobads/g/c;->a(Landroid/content/Context;Lcom/baidu/mobads/g/e;Ljava/lang/String;Landroid/os/Handler;)Lcom/baidu/mobads/g/c;

    move-result-object v0

    .line 647
    invoke-virtual {v0}, Lcom/baidu/mobads/g/c;->isAlive()Z

    move-result v1

    if-nez v1, :cond_0

    .line 648
    iget-object p1, p0, Lcom/baidu/mobads/g/g;->m:Lcom/baidu/mobads/interfaces/utils/IXAdLogger;

    const-string v1, "XAdApkLoader"

    const-string v2, "XApkDownloadThread starting ..."

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

    .line 649
    invoke-virtual {v0}, Lcom/baidu/mobads/g/c;->start()V

    goto :goto_0

    .line 651
    :cond_0
    iget-object v1, p0, Lcom/baidu/mobads/g/g;->m:Lcom/baidu/mobads/interfaces/utils/IXAdLogger;

    const-string v2, "XAdApkLoader"

    const-string v3, "XApkDownloadThread already started"

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

    .line 652
    invoke-virtual {p1}, Lcom/baidu/mobads/g/e;->c()Ljava/lang/String;

    move-result-object p1

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

    :cond_1
    :goto_0
    return-void
.end method

.method static synthetic a(Lcom/baidu/mobads/g/g;Lcom/baidu/mobads/g/b;)V
    .locals 0

    .line 44
    invoke-direct {p0, p1}, Lcom/baidu/mobads/g/g;->a(Lcom/baidu/mobads/g/b;)V

    return-void
.end method

.method static synthetic a(Lcom/baidu/mobads/g/g;Lcom/baidu/mobads/g/g$c;Landroid/os/Handler;)V
    .locals 0

    .line 44
    invoke-direct {p0, p1, p2}, Lcom/baidu/mobads/g/g;->b(Lcom/baidu/mobads/g/g$c;Landroid/os/Handler;)V

    return-void
.end method

.method static synthetic a(Lcom/baidu/mobads/g/g;ZLjava/lang/String;)V
    .locals 0

    .line 44
    invoke-direct {p0, p1, p2}, Lcom/baidu/mobads/g/g;->a(ZLjava/lang/String;)V

    return-void
.end method

.method private a(Z)V
    .locals 3

    .line 267
    iget-object v0, p0, Lcom/baidu/mobads/g/g;->g:Landroid/os/Handler;

    invoke-virtual {v0}, Landroid/os/Handler;->obtainMessage()Landroid/os/Message;

    move-result-object v0

    .line 268
    new-instance v1, Landroid/os/Bundle;

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

    const-string v2, "success"

    .line 269
    invoke-virtual {v1, v2, p1}, Landroid/os/Bundle;->putBoolean(Ljava/lang/String;Z)V

    .line 270
    invoke-virtual {v0, v1}, Landroid/os/Message;->setData(Landroid/os/Bundle;)V

    const/4 p1, 0x0

    .line 271
    iput p1, v0, Landroid/os/Message;->what:I

    .line 272
    iget-object p1, p0, Lcom/baidu/mobads/g/g;->g:Landroid/os/Handler;

    invoke-virtual {p1, v0}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z

    return-void
.end method

.method private a(ZLjava/lang/String;)V
    .locals 0

    .line 544
    iget-object p2, p0, Lcom/baidu/mobads/g/g;->l:Landroid/content/Context;

    invoke-static {p2}, Lcom/baidu/mobads/g/q;->a(Landroid/content/Context;)Lcom/baidu/mobads/g/q;

    move-result-object p2

    invoke-virtual {p2}, Lcom/baidu/mobads/g/q;->b()V

    .line 545
    iget-object p2, p0, Lcom/baidu/mobads/g/g;->o:Lcom/baidu/mobads/g/g$c;

    if-eqz p2, :cond_0

    .line 546
    iget-object p2, p0, Lcom/baidu/mobads/g/g;->o:Lcom/baidu/mobads/g/g$c;

    invoke-interface {p2, p1}, Lcom/baidu/mobads/g/g$c;->a(Z)V

    const/4 p1, 0x0

    .line 547
    iput-object p1, p0, Lcom/baidu/mobads/g/g;->o:Lcom/baidu/mobads/g/g$c;

    :cond_0
    return-void
.end method

.method static synthetic a(Lcom/baidu/mobads/g/g;Z)Z
    .locals 0

    .line 44
    iput-boolean p1, p0, Lcom/baidu/mobads/g/g;->n:Z

    return p1
.end method

.method public static b(Landroid/content/Context;)D
    .locals 4

    .line 807
    :try_start_0
    invoke-static {p0}, Lcom/baidu/mobads/g/g;->c(Landroid/content/Context;)V

    .line 808
    invoke-static {}, Lcom/baidu/mobads/g/g;->e()Ljava/lang/String;

    move-result-object v0

    invoke-static {p0, v0}, Lcom/baidu/mobads/g/g;->a(Landroid/content/Context;Ljava/lang/String;)D

    move-result-wide v0

    .line 809
    invoke-static {p0}, Lcom/baidu/mobads/g/g;->d(Landroid/content/Context;)V

    .line 810
    invoke-static {}, Lcom/baidu/mobads/g/g;->c()Ljava/lang/String;

    move-result-object v2

    invoke-static {p0, v2}, Lcom/baidu/mobads/g/g;->a(Landroid/content/Context;Ljava/lang/String;)D

    move-result-wide v2

    .line 811
    invoke-static {v0, v1, v2, v3}, Ljava/lang/Math;->max(DD)D

    move-result-wide v0
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    return-wide v0

    :catch_0
    const-wide/16 v0, 0x0

    return-wide v0
.end method

.method private b(Lcom/baidu/mobads/g/b;)V
    .locals 12

    const-string v0, "XAdApkLoader"

    .line 353
    new-instance v1, Ljava/lang/StringBuilder;

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

    const-string v2, "len="

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

    invoke-virtual {p1}, Lcom/baidu/mobads/g/b;->length()J

    move-result-wide v2

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

    const-string v2, ", path="

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

    invoke-virtual {p1}, Lcom/baidu/mobads/g/b;->getAbsolutePath()Ljava/lang/String;

    move-result-object v2

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

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

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 354
    sget-object v0, Lcom/baidu/mobads/g/g;->b:Lcom/baidu/mobads/g/a;

    const/4 v1, 0x1

    const/4 v2, 0x0

    const/4 v3, 0x2

    if-nez v0, :cond_1

    .line 355
    iget-object v0, p0, Lcom/baidu/mobads/g/g;->l:Landroid/content/Context;

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

    move-result-object v0

    .line 356
    new-instance v4, Lcom/baidu/mobads/g/b;

    iget-object v5, p0, Lcom/baidu/mobads/g/g;->l:Landroid/content/Context;

    invoke-direct {v4, v0, v5}, Lcom/baidu/mobads/g/b;-><init>(Ljava/lang/String;Landroid/content/Context;)V

    .line 357
    invoke-virtual {v4}, Lcom/baidu/mobads/g/b;->exists()Z

    move-result v5

    if-eqz v5, :cond_0

    .line 358
    invoke-virtual {v4}, Lcom/baidu/mobads/g/b;->delete()Z

    .line 362
    :cond_0
    :try_start_0
    new-instance v5, Ljava/io/FileInputStream;

    invoke-direct {v5, p1}, Ljava/io/FileInputStream;-><init>(Ljava/io/File;)V

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

    move-result-object v6

    invoke-virtual {v6}, Lcom/baidu/mobads/utils/XAdSDKFoundationFacade;->getIoUtils()Lcom/baidu/mobads/interfaces/utils/IXAdIOUtils;

    move-result-object v6

    invoke-interface {v6, v5, v0}, Lcom/baidu/mobads/interfaces/utils/IXAdIOUtils;->copyFileInputStream(Ljava/io/InputStream;Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    .line 367
    iget-object v5, p0, Lcom/baidu/mobads/g/g;->m:Lcom/baidu/mobads/interfaces/utils/IXAdLogger;

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

    .line 370
    :goto_0
    invoke-virtual {v4}, Lcom/baidu/mobads/g/b;->b()Ljava/lang/Class;

    move-result-object v7

    .line 372
    new-instance v0, Lcom/baidu/mobads/g/a;

    iget-object v8, p0, Lcom/baidu/mobads/g/g;->l:Landroid/content/Context;

    invoke-static {}, Lcom/baidu/mobads/a/b;->a()D

    move-result-wide v9

    sget-object v11, Lcom/baidu/mobads/a/b;->a:Ljava/lang/Boolean;

    move-object v6, v0

    invoke-direct/range {v6 .. v11}, Lcom/baidu/mobads/g/a;-><init>(Ljava/lang/Class;Landroid/content/Context;DLjava/lang/Boolean;)V

    sput-object v0, Lcom/baidu/mobads/g/g;->b:Lcom/baidu/mobads/g/a;

    .line 377
    :try_start_1
    sget-object v0, Lcom/baidu/mobads/g/g;->b:Lcom/baidu/mobads/g/a;

    invoke-virtual {v0}, Lcom/baidu/mobads/g/a;->a()Lcom/baidu/mobads/interfaces/IXAdContainerFactory;

    move-result-object v0

    .line 378
    iget-object v4, p0, Lcom/baidu/mobads/g/g;->m:Lcom/baidu/mobads/interfaces/utils/IXAdLogger;

    const-string v5, "XAdApkLoader"

    new-instance v6, Ljava/lang/StringBuilder;

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

    const-string v7, "preloaded apk.version="

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

    invoke-interface {v0}, Lcom/baidu/mobads/interfaces/IXAdContainerFactory;->getRemoteVersion()D

    move-result-wide v7

    invoke-virtual {v6, v7, v8}, Ljava/lang/StringBuilder;->append(D)Ljava/lang/StringBuilder;

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

    move-result-object v0

    invoke-interface {v4, v5, v0}, Lcom/baidu/mobads/interfaces/utils/IXAdLogger;->d(Ljava/lang/String;Ljava/lang/String;)I
    :try_end_1
    .catch Lcom/baidu/mobads/g/g$a; {:try_start_1 .. :try_end_1} :catch_1

    goto :goto_1

    :catch_1
    move-exception v0

    .line 380
    iget-object v4, p0, Lcom/baidu/mobads/g/g;->m:Lcom/baidu/mobads/interfaces/utils/IXAdLogger;

    new-array v3, v3, [Ljava/lang/Object;

    const-string v5, "XAdApkLoader"

    aput-object v5, v3, v2

    new-instance v2, Ljava/lang/StringBuilder;

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

    const-string v5, "preload local apk "

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

    invoke-virtual {p1}, Lcom/baidu/mobads/g/b;->getAbsolutePath()Ljava/lang/String;

    move-result-object p1

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

    const-string p1, " failed, msg:"

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

    invoke-virtual {v0}, Lcom/baidu/mobads/g/g$a;->getMessage()Ljava/lang/String;

    move-result-object p1

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

    const-string p1, ", v="

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

    sget-object p1, Lcom/baidu/mobads/g/g;->b:Lcom/baidu/mobads/g/a;

    iget-wide v5, p1, Lcom/baidu/mobads/g/a;->a:D

    invoke-virtual {v2, v5, v6}, Ljava/lang/StringBuilder;->append(D)Ljava/lang/StringBuilder;

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

    move-result-object p1

    aput-object p1, v3, v1

    invoke-interface {v4, v3}, Lcom/baidu/mobads/interfaces/utils/IXAdLogger;->w([Ljava/lang/Object;)I

    .line 383
    invoke-virtual {v0}, Lcom/baidu/mobads/g/g$a;->getMessage()Ljava/lang/String;

    move-result-object p1

    invoke-virtual {p0, p1}, Lcom/baidu/mobads/g/g;->a(Ljava/lang/String;)V

    .line 384
    throw v0

    .line 387
    :cond_1
    iget-object p1, p0, Lcom/baidu/mobads/g/g;->m:Lcom/baidu/mobads/interfaces/utils/IXAdLogger;

    new-array v0, v3, [Ljava/lang/Object;

    const-string v3, "XAdApkLoader"

    aput-object v3, v0, v2

    new-instance v2, Ljava/lang/StringBuilder;

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

    const-string v3, "mApkBuilder already initialized, version: "

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

    sget-object v3, Lcom/baidu/mobads/g/g;->b:Lcom/baidu/mobads/g/a;

    iget-wide v3, v3, Lcom/baidu/mobads/g/a;->a:D

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

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

    move-result-object v2

    aput-object v2, v0, v1

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

    :goto_1
    return-void
.end method

.method private b(Lcom/baidu/mobads/g/g$c;Landroid/os/Handler;)V
    .locals 0

    .line 659
    iput-object p1, p0, Lcom/baidu/mobads/g/g;->o:Lcom/baidu/mobads/g/g$c;

    .line 660
    iput-object p2, p0, Lcom/baidu/mobads/g/g;->g:Landroid/os/Handler;

    .line 661
    sget-object p1, Lcom/baidu/mobads/g/g;->b:Lcom/baidu/mobads/g/a;

    if-nez p1, :cond_0

    .line 663
    invoke-virtual {p0}, Lcom/baidu/mobads/g/g;->f()V

    goto :goto_0

    :cond_0
    const/4 p1, 0x1

    .line 665
    invoke-direct {p0, p1}, Lcom/baidu/mobads/g/g;->b(Z)V

    :goto_0
    return-void
.end method

.method static synthetic b(Lcom/baidu/mobads/g/g;Lcom/baidu/mobads/g/e;)V
    .locals 0

    .line 44
    invoke-direct {p0, p1}, Lcom/baidu/mobads/g/g;->a(Lcom/baidu/mobads/g/e;)V

    return-void
.end method

.method static synthetic b(Lcom/baidu/mobads/g/g;Z)V
    .locals 0

    .line 44
    invoke-direct {p0, p1}, Lcom/baidu/mobads/g/g;->a(Z)V

    return-void
.end method

.method private b(Z)V
    .locals 4

    if-nez p1, :cond_0

    .line 414
    invoke-direct {p0}, Lcom/baidu/mobads/g/g;->l()Z

    move-result v0

    if-nez v0, :cond_0

    const/4 v0, 0x1

    .line 416
    iput-boolean v0, p0, Lcom/baidu/mobads/g/g;->n:Z

    goto :goto_1

    :cond_0
    if-eqz p1, :cond_1

    const-string v0, "apk Successfully Loaded"

    goto :goto_0

    :cond_1
    const-string v0, "apk Load Failed"

    .line 418
    :goto_0
    invoke-direct {p0, p1, v0}, Lcom/baidu/mobads/g/g;->a(ZLjava/lang/String;)V

    .line 420
    :goto_1
    new-instance v0, Landroid/os/Handler;

    invoke-static {}, Landroid/os/Looper;->getMainLooper()Landroid/os/Looper;

    move-result-object v1

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

    new-instance v1, Lcom/baidu/mobads/g/k;

    invoke-direct {v1, p0, p1}, Lcom/baidu/mobads/g/k;-><init>(Lcom/baidu/mobads/g/g;Z)V

    iget-boolean p1, p0, Lcom/baidu/mobads/g/g;->n:Z

    if-eqz p1, :cond_2

    const-wide/16 v2, 0x0

    goto :goto_2

    :cond_2
    const-wide/16 v2, 0x1388

    :goto_2
    invoke-virtual {v0, v1, v2, v3}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z

    return-void
.end method

.method static synthetic b(Lcom/baidu/mobads/g/g;)Z
    .locals 0

    .line 44
    iget-boolean p0, p0, Lcom/baidu/mobads/g/g;->n:Z

    return p0
.end method

.method protected static c()Ljava/lang/String;
    .locals 2

    .line 280
    sget-object v0, Lcom/baidu/mobads/g/g;->e:Ljava/lang/String;

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

    move-result v0

    if-eqz v0, :cond_0

    const-string v0, ""

    return-object v0

    .line 283
    :cond_0
    new-instance v0, Ljava/lang/StringBuilder;

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

    sget-object v1, Lcom/baidu/mobads/g/g;->e:Ljava/lang/String;

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

    const-string v1, "__xadsdk__remote__final__builtin__.jar"

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

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

    move-result-object v0

    return-object v0
.end method

.method private static c(Landroid/content/Context;)V
    .locals 2

    .line 228
    sget-object v0, Lcom/baidu/mobads/g/g;->e:Ljava/lang/String;

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

    move-result v0

    if-eqz v0, :cond_0

    const-string v0, "baidu_ad_sdk"

    const/4 v1, 0x0

    .line 229
    invoke-virtual {p0, v0, v1}, Landroid/content/Context;->getDir(Ljava/lang/String;I)Ljava/io/File;

    move-result-object p0

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

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

    invoke-virtual {p0}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object p0

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

    const-string p0, "/"

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

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

    move-result-object p0

    sput-object p0, Lcom/baidu/mobads/g/g;->e:Ljava/lang/String;

    :cond_0
    return-void
.end method

.method static synthetic c(Lcom/baidu/mobads/g/g;Z)V
    .locals 0

    .line 44
    invoke-direct {p0, p1}, Lcom/baidu/mobads/g/g;->b(Z)V

    return-void
.end method

.method private c(Lcom/baidu/mobads/g/b;)Z
    .locals 4

    .line 392
    monitor-enter p0

    .line 393
    :try_start_0
    invoke-direct {p0, p1}, Lcom/baidu/mobads/g/g;->b(Lcom/baidu/mobads/g/b;)V

    .line 394
    iget-object v0, p0, Lcom/baidu/mobads/g/g;->m:Lcom/baidu/mobads/interfaces/utils/IXAdLogger;

    const-string v1, "XAdApkLoader"

    new-instance v2, Ljava/lang/StringBuilder;

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

    const-string v3, "loaded: "

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

    invoke-virtual {p1}, Lcom/baidu/mobads/g/b;->getPath()Ljava/lang/String;

    move-result-object p1

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

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

    move-result-object p1

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

    const/4 p1, 0x1

    .line 395
    monitor-exit p0

    return p1

    :catchall_0
    move-exception p1

    .line 396
    monitor-exit p0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw p1
.end method

.method static synthetic c(Lcom/baidu/mobads/g/g;)Z
    .locals 0

    .line 44
    invoke-direct {p0}, Lcom/baidu/mobads/g/g;->n()Z

    move-result p0

    return p0
.end method

.method static synthetic d(Lcom/baidu/mobads/g/g;)Lcom/baidu/mobads/interfaces/utils/IXAdLogger;
    .locals 0

    .line 44
    iget-object p0, p0, Lcom/baidu/mobads/g/g;->m:Lcom/baidu/mobads/interfaces/utils/IXAdLogger;

    return-object p0
.end method

.method private static d(Landroid/content/Context;)V
    .locals 6

    .line 309
    :try_start_0
    invoke-static {}, Lcom/baidu/mobads/g/g;->c()Ljava/lang/String;

    move-result-object v0

    .line 310
    invoke-static {p0, v0}, Lcom/baidu/mobads/g/g;->a(Landroid/content/Context;Ljava/lang/String;)D

    move-result-wide v1

    const-string v3, "8.52"

    .line 312
    invoke-static {v3}, Ljava/lang/Double;->valueOf(Ljava/lang/String;)Ljava/lang/Double;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/Double;->doubleValue()D

    move-result-wide v3

    cmpl-double v5, v3, v1

    if-lez v5, :cond_1

    .line 313
    new-instance v1, Lcom/baidu/mobads/g/b;

    invoke-direct {v1, v0, p0}, Lcom/baidu/mobads/g/b;-><init>(Ljava/lang/String;Landroid/content/Context;)V

    .line 314
    invoke-virtual {v1}, Lcom/baidu/mobads/g/b;->exists()Z

    move-result v2

    if-eqz v2, :cond_0

    .line 315
    invoke-virtual {v1}, Lcom/baidu/mobads/g/b;->delete()Z

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

    move-result-object v1

    const-string v2, "bdxadsdk.jar"

    .line 326
    invoke-interface {v1, p0, v2, v0}, Lcom/baidu/mobads/interfaces/utils/IXAdIOUtils;->copyFileFromAssetsTo(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    :cond_1
    return-void

    :catch_0
    move-exception p0

    .line 329
    new-instance v0, Lcom/baidu/mobads/g/g$b;

    new-instance v1, Ljava/lang/StringBuilder;

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

    const-string v2, "loadBuiltInApk failed: "

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

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

    move-result-object p0

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

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

    move-result-object p0

    invoke-direct {v0, p0}, Lcom/baidu/mobads/g/g$b;-><init>(Ljava/lang/String;)V

    throw v0
.end method

.method protected static e()Ljava/lang/String;
    .locals 2

    .line 574
    sget-object v0, Lcom/baidu/mobads/g/g;->e:Ljava/lang/String;

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

    move-result v0

    if-eqz v0, :cond_0

    const-string v0, ""

    return-object v0

    .line 577
    :cond_0
    new-instance v0, Ljava/lang/StringBuilder;

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

    sget-object v1, Lcom/baidu/mobads/g/g;->e:Ljava/lang/String;

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

    const-string v1, "__xadsdk__remote__final__downloaded__.jar"

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

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

    move-result-object v0

    return-object v0
.end method

.method static synthetic e(Lcom/baidu/mobads/g/g;)V
    .locals 0

    .line 44
    invoke-direct {p0}, Lcom/baidu/mobads/g/g;->m()V

    return-void
.end method

.method static synthetic f(Lcom/baidu/mobads/g/g;)Landroid/content/SharedPreferences;
    .locals 0

    .line 44
    invoke-direct {p0}, Lcom/baidu/mobads/g/g;->j()Landroid/content/SharedPreferences;

    move-result-object p0

    return-object p0
.end method

.method static synthetic g(Lcom/baidu/mobads/g/g;)Lcom/baidu/mobads/g/e;
    .locals 0

    .line 44
    iget-object p0, p0, Lcom/baidu/mobads/g/g;->k:Lcom/baidu/mobads/g/e;

    return-object p0
.end method

.method static synthetic h(Lcom/baidu/mobads/g/g;)Lcom/baidu/mobads/openad/e/a;
    .locals 0

    .line 44
    iget-object p0, p0, Lcom/baidu/mobads/g/g;->j:Lcom/baidu/mobads/openad/e/a;

    return-object p0
.end method

.method static synthetic i()Ljava/lang/String;
    .locals 1

    .line 44
    sget-object v0, Lcom/baidu/mobads/g/g;->i:Ljava/lang/String;

    return-object v0
.end method

.method private j()Landroid/content/SharedPreferences;
    .locals 3

    .line 235
    iget-object v0, p0, Lcom/baidu/mobads/g/g;->l:Landroid/content/Context;

    const-string v1, "com.baidu.mobads.loader"

    const/4 v2, 0x0

    invoke-virtual {v0, v1, v2}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;

    move-result-object v0

    return-object v0
.end method

.method private k()Z
    .locals 3

    .line 261
    invoke-direct {p0}, Lcom/baidu/mobads/g/g;->j()Landroid/content/SharedPreferences;

    move-result-object v0

    const-string v1, "previousProxyVersion"

    const/4 v2, 0x0

    invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

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

    move-result-object v1

    const/4 v2, 0x1

    if-nez v0, :cond_0

    goto :goto_0

    .line 263
    :cond_0
    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_1

    goto :goto_0

    :cond_1
    const/4 v2, 0x0

    :goto_0
    return v2
.end method

.method private l()Z
    .locals 3

    const/4 v0, 0x0

    .line 401
    :try_start_0
    invoke-static {}, Lcom/baidu/mobads/g/g;->c()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Lcom/baidu/mobads/utils/j;->a(Ljava/lang/String;)Z

    move-result v1

    if-nez v1, :cond_0

    invoke-static {}, Lcom/baidu/mobads/g/g;->e()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Lcom/baidu/mobads/utils/j;->a(Ljava/lang/String;)Z

    move-result v1
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    if-eqz v1, :cond_1

    :cond_0
    const/4 v0, 0x1

    :cond_1
    return v0

    :catch_0
    move-exception v1

    .line 404
    iget-object v2, p0, Lcom/baidu/mobads/g/g;->m:Lcom/baidu/mobads/interfaces/utils/IXAdLogger;

    invoke-interface {v2, v1}, Lcom/baidu/mobads/interfaces/utils/IXAdLogger;->d(Ljava/lang/Throwable;)I

    return v0
.end method

.method private declared-synchronized m()V
    .locals 1

    monitor-enter p0

    .line 516
    :try_start_0
    iget-object v0, p0, Lcom/baidu/mobads/g/g;->j:Lcom/baidu/mobads/openad/e/a;

    if-eqz v0, :cond_0

    .line 517
    iget-object v0, p0, Lcom/baidu/mobads/g/g;->j:Lcom/baidu/mobads/openad/e/a;

    invoke-virtual {v0}, Lcom/baidu/mobads/openad/e/a;->removeAllListeners()V

    .line 518
    iget-object v0, p0, Lcom/baidu/mobads/g/g;->j:Lcom/baidu/mobads/openad/e/a;

    invoke-virtual {v0}, Lcom/baidu/mobads/openad/e/a;->a()V

    :cond_0
    const/4 v0, 0x0

    .line 520
    iput-object v0, p0, Lcom/baidu/mobads/g/g;->j:Lcom/baidu/mobads/openad/e/a;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    goto :goto_0

    :catchall_0
    move-exception v0

    goto :goto_1

    :catch_0
    move-exception v0

    .line 522
    :try_start_1
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 524
    :goto_0
    monitor-exit p0

    return-void

    .line 515
    :goto_1
    monitor-exit p0

    throw v0
.end method

.method private n()Z
    .locals 10

    .line 601
    invoke-static {}, Lcom/baidu/mobads/g/g;->e()Ljava/lang/String;

    move-result-object v0

    .line 602
    new-instance v1, Lcom/baidu/mobads/g/b;

    iget-object v2, p0, Lcom/baidu/mobads/g/g;->l:Landroid/content/Context;

    invoke-direct {v1, v0, v2}, Lcom/baidu/mobads/g/b;-><init>(Ljava/lang/String;Landroid/content/Context;)V

    .line 603
    invoke-static {v1}, Lcom/baidu/mobads/utils/j;->a(Ljava/io/File;)Z

    move-result v0

    const/4 v2, 0x0

    if-eqz v0, :cond_3

    const/4 v0, 0x1

    .line 607
    :try_start_0
    invoke-direct {p0}, Lcom/baidu/mobads/g/g;->k()Z

    move-result v3

    if-nez v3, :cond_1

    .line 612
    monitor-enter p0
    :try_end_0
    .catch Lcom/baidu/mobads/g/g$a; {:try_start_0 .. :try_end_0} :catch_0

    :try_start_1
    const-string v3, "XAdApkLoader"

    .line 613
    new-instance v4, Ljava/lang/StringBuilder;

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

    const-string v5, "loadDownloadedOrBuiltInApk len="

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

    invoke-virtual {v1}, Lcom/baidu/mobads/g/b;->length()J

    move-result-wide v5

    invoke-virtual {v4, v5, v6}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    const-string v5, ", path="

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

    invoke-virtual {v1}, Lcom/baidu/mobads/g/b;->getAbsolutePath()Ljava/lang/String;

    move-result-object v5

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

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

    move-result-object v4

    invoke-static {v3, v4}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 615
    invoke-direct {p0, v1}, Lcom/baidu/mobads/g/g;->b(Lcom/baidu/mobads/g/b;)V

    .line 617
    invoke-direct {p0}, Lcom/baidu/mobads/g/g;->j()Landroid/content/SharedPreferences;

    move-result-object v3

    const-string v4, "__badApkVersion__8.52"

    const/high16 v5, -0x40800000    # -1.0f

    invoke-interface {v3, v4, v5}, Landroid/content/SharedPreferences;->getFloat(Ljava/lang/String;F)F

    move-result v3

    float-to-double v3, v3

    .line 618
    iget-object v5, p0, Lcom/baidu/mobads/g/g;->m:Lcom/baidu/mobads/interfaces/utils/IXAdLogger;

    const-string v6, "XAdApkLoader"

    new-instance v7, Ljava/lang/StringBuilder;

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

    const-string v8, "downloadedApkFile.getApkVersion(): "

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

    invoke-virtual {v1}, Lcom/baidu/mobads/g/b;->c()D

    move-result-wide v8

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

    const-string v8, ", badApkVersion: "

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

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

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

    move-result-object v7

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

    .line 621
    invoke-virtual {v1}, Lcom/baidu/mobads/g/b;->c()D

    move-result-wide v5

    cmpl-double v7, v5, v3

    if-eqz v7, :cond_0

    .line 624
    iget-object v3, p0, Lcom/baidu/mobads/g/g;->m:Lcom/baidu/mobads/interfaces/utils/IXAdLogger;

    const-string v4, "XAdApkLoader"

    new-instance v5, Ljava/lang/StringBuilder;

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

    const-string v6, "loaded: "

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

    invoke-virtual {v1}, Lcom/baidu/mobads/g/b;->getPath()Ljava/lang/String;

    move-result-object v6

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

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

    move-result-object v5

    invoke-interface {v3, v4, v5}, Lcom/baidu/mobads/interfaces/utils/IXAdLogger;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 625
    monitor-exit p0

    return v0

    .line 622
    :cond_0
    new-instance v3, Lcom/baidu/mobads/g/g$a;

    const-string v4, "downloaded file marked bad, drop it and use built-in"

    invoke-direct {v3, v4}, Lcom/baidu/mobads/g/g$a;-><init>(Ljava/lang/String;)V

    throw v3

    :catchall_0
    move-exception v3

    .line 628
    monitor-exit p0
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    :try_start_2
    throw v3

    .line 609
    :cond_1
    new-instance v3, Lcom/baidu/mobads/g/g$a;

    const-string v4, "XAdApkLoader upgraded, drop stale downloaded file, use built-in instead"

    invoke-direct {v3, v4}, Lcom/baidu/mobads/g/g$a;-><init>(Ljava/lang/String;)V

    throw v3
    :try_end_2
    .catch Lcom/baidu/mobads/g/g$a; {:try_start_2 .. :try_end_2} :catch_0

    :catch_0
    move-exception v3

    .line 630
    iget-object v4, p0, Lcom/baidu/mobads/g/g;->m:Lcom/baidu/mobads/interfaces/utils/IXAdLogger;

    const/4 v5, 0x2

    new-array v5, v5, [Ljava/lang/Object;

    const-string v6, "XAdApkLoader"

    aput-object v6, v5, v2

    new-instance v6, Ljava/lang/StringBuilder;

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

    const-string v7, "load downloaded apk failed: "

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

    invoke-virtual {v3}, Lcom/baidu/mobads/g/g$a;->toString()Ljava/lang/String;

    move-result-object v3

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

    const-string v3, ", fallback to built-in"

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

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

    move-result-object v3

    aput-object v3, v5, v0

    invoke-interface {v4, v5}, Lcom/baidu/mobads/interfaces/utils/IXAdLogger;->e([Ljava/lang/Object;)I

    .line 631
    invoke-virtual {v1}, Lcom/baidu/mobads/g/b;->exists()Z

    move-result v0

    if-eqz v0, :cond_2

    .line 632
    invoke-virtual {v1}, Lcom/baidu/mobads/g/b;->delete()Z

    .line 634
    :cond_2
    invoke-virtual {p0}, Lcom/baidu/mobads/g/g;->h()V

    :cond_3
    return v2
.end method


# virtual methods
.method public final a()Ljava/lang/String;
    .locals 1

    const-string v0, "8.52"

    return-object v0
.end method

.method public a(Lcom/baidu/mobads/g/g$c;)V
    .locals 1

    .line 743
    sget-object v0, Lcom/baidu/mobads/g/g;->f:Landroid/os/Handler;

    invoke-virtual {p0, p1, v0}, Lcom/baidu/mobads/g/g;->a(Lcom/baidu/mobads/g/g$c;Landroid/os/Handler;)V

    return-void
.end method

.method public a(Lcom/baidu/mobads/g/g$c;Landroid/os/Handler;)V
    .locals 2
    .annotation build Landroid/annotation/TargetApi;
        value = 0x9
    .end annotation

    .line 675
    new-instance v0, Ljava/lang/Thread;

    new-instance v1, Lcom/baidu/mobads/g/n;

    invoke-direct {v1, p0, p1, p2}, Lcom/baidu/mobads/g/n;-><init>(Lcom/baidu/mobads/g/g;Lcom/baidu/mobads/g/g$c;Landroid/os/Handler;)V

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

    invoke-virtual {v0}, Ljava/lang/Thread;->start()V

    return-void
.end method

.method protected a(Ljava/lang/String;)V
    .locals 3
    .annotation build Landroid/annotation/TargetApi;
        value = 0x9
    .end annotation

    .line 245
    sget-object p1, Lcom/baidu/mobads/g/g;->b:Lcom/baidu/mobads/g/a;

    if-eqz p1, :cond_1

    .line 246
    invoke-direct {p0}, Lcom/baidu/mobads/g/g;->j()Landroid/content/SharedPreferences;

    move-result-object p1

    invoke-interface {p1}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object p1

    const-string v0, "__badApkVersion__8.52"

    .line 247
    sget-object v1, Lcom/baidu/mobads/g/g;->b:Lcom/baidu/mobads/g/a;

    iget-wide v1, v1, Lcom/baidu/mobads/g/a;->a:D

    double-to-float v1, v1

    invoke-interface {p1, v0, v1}, Landroid/content/SharedPreferences$Editor;->putFloat(Ljava/lang/String;F)Landroid/content/SharedPreferences$Editor;

    .line 252
    sget v0, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v1, 0x9

    if-lt v0, v1, :cond_0

    .line 253
    invoke-interface {p1}, Landroid/content/SharedPreferences$Editor;->apply()V

    goto :goto_0

    .line 255
    :cond_0
    invoke-interface {p1}, Landroid/content/SharedPreferences$Editor;->commit()Z

    :cond_1
    :goto_0
    return-void
.end method

.method protected b()V
    .locals 2

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

    invoke-static {}, Lcom/baidu/mobads/g/g;->e()Ljava/lang/String;

    move-result-object v1

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

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

    return-void
.end method

.method protected d()V
    .locals 4

    .line 288
    iget-object v0, p0, Lcom/baidu/mobads/g/g;->l:Landroid/content/Context;

    invoke-static {v0}, Lcom/baidu/mobads/g/g;->d(Landroid/content/Context;)V

    .line 289
    invoke-static {}, Lcom/baidu/mobads/g/g;->c()Ljava/lang/String;

    move-result-object v0

    .line 290
    new-instance v1, Lcom/baidu/mobads/g/b;

    iget-object v2, p0, Lcom/baidu/mobads/g/g;->l:Landroid/content/Context;

    invoke-direct {v1, v0, v2}, Lcom/baidu/mobads/g/b;-><init>(Ljava/lang/String;Landroid/content/Context;)V

    .line 291
    invoke-static {v1}, Lcom/baidu/mobads/utils/j;->a(Ljava/io/File;)Z

    move-result v2

    if-eqz v2, :cond_1

    .line 292
    invoke-direct {p0, v1}, Lcom/baidu/mobads/g/g;->c(Lcom/baidu/mobads/g/b;)Z

    move-result v0

    if-eqz v0, :cond_0

    const/4 v0, 0x1

    .line 293
    invoke-direct {p0, v0}, Lcom/baidu/mobads/g/g;->b(Z)V

    :cond_0
    return-void

    .line 296
    :cond_1
    new-instance v1, Lcom/baidu/mobads/g/g$b;

    new-instance v2, Ljava/lang/StringBuilder;

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

    const-string v3, "loadBuiltInApk failed: "

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

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

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

    move-result-object v0

    invoke-direct {v1, v0}, Lcom/baidu/mobads/g/g$b;-><init>(Ljava/lang/String;)V

    throw v1
.end method

.method protected f()V
    .locals 6

    .line 586
    invoke-direct {p0}, Lcom/baidu/mobads/g/g;->n()Z

    move-result v0

    const/4 v1, 0x1

    if-eqz v0, :cond_0

    .line 588
    invoke-direct {p0, v1}, Lcom/baidu/mobads/g/g;->b(Z)V

    goto :goto_0

    .line 590
    :cond_0
    iget-object v0, p0, Lcom/baidu/mobads/g/g;->m:Lcom/baidu/mobads/interfaces/utils/IXAdLogger;

    const-string v2, "XAdApkLoader"

    const-string v3, "no downloaded file yet, use built-in apk file"

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

    .line 592
    :try_start_0
    invoke-virtual {p0}, Lcom/baidu/mobads/g/g;->d()V
    :try_end_0
    .catch Lcom/baidu/mobads/g/g$b; {:try_start_0 .. :try_end_0} :catch_0

    :goto_0
    return-void

    :catch_0
    move-exception v0

    .line 594
    iget-object v2, p0, Lcom/baidu/mobads/g/g;->m:Lcom/baidu/mobads/interfaces/utils/IXAdLogger;

    const/4 v3, 0x2

    new-array v3, v3, [Ljava/lang/Object;

    const/4 v4, 0x0

    const-string v5, "XAdApkLoader"

    aput-object v5, v3, v4

    new-instance v4, Ljava/lang/StringBuilder;

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

    const-string v5, "loadBuiltInApk failed: "

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

    invoke-virtual {v0}, Lcom/baidu/mobads/g/g$b;->toString()Ljava/lang/String;

    move-result-object v5

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

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

    move-result-object v4

    aput-object v4, v3, v1

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

    .line 595
    new-instance v1, Lcom/baidu/mobads/g/g$a;

    new-instance v2, Ljava/lang/StringBuilder;

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

    const-string v3, "load built-in apk failed"

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

    invoke-virtual {v0}, Lcom/baidu/mobads/g/g$b;->toString()Ljava/lang/String;

    move-result-object v0

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

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

    move-result-object v0

    invoke-direct {v1, v0}, Lcom/baidu/mobads/g/g$a;-><init>(Ljava/lang/String;)V

    throw v1
.end method

.method public g()Lcom/baidu/mobads/interfaces/IXAdContainerFactory;
    .locals 1

    .line 752
    sget-object v0, Lcom/baidu/mobads/g/g;->b:Lcom/baidu/mobads/g/a;

    invoke-direct {p0, v0}, Lcom/baidu/mobads/g/g;->a(Lcom/baidu/mobads/g/a;)Lcom/baidu/mobads/interfaces/IXAdContainerFactory;

    move-result-object v0

    return-object v0
.end method

.method protected h()V
    .locals 1

    .line 772
    sget-object v0, Lcom/baidu/mobads/g/g;->b:Lcom/baidu/mobads/g/a;

    if-eqz v0, :cond_0

    .line 773
    sget-object v0, Lcom/baidu/mobads/g/g;->b:Lcom/baidu/mobads/g/a;

    invoke-virtual {v0}, Lcom/baidu/mobads/g/a;->b()V

    const/4 v0, 0x0

    .line 774
    sput-object v0, Lcom/baidu/mobads/g/g;->b:Lcom/baidu/mobads/g/a;

    :cond_0
    return-void
.end method
