cqi.smali

.class public final Ldxoptimizer/cqi;
.super Ljava/lang/Object;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Ldxoptimizer/cqi$a;,
        Ldxoptimizer/cqi$b;
    }
.end annotation


# static fields
.field private static a:J


# direct methods
.method private static a(Landroid/content/Context;Ljava/io/InputStream;)I
    .registers 6

    const/4 v3, -0x1

    const/4 v0, 0x1

    new-instance v1, Landroid/graphics/BitmapFactory$Options;

    invoke-direct {v1}, Landroid/graphics/BitmapFactory$Options;-><init>()V

    iput-boolean v0, v1, Landroid/graphics/BitmapFactory$Options;->inJustDecodeBounds:Z

    const/4 v2, 0x0

    invoke-static {p1, v2, v1}, Landroid/graphics/BitmapFactory;->decodeStream(Ljava/io/InputStream;Landroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;

    iget v2, v1, Landroid/graphics/BitmapFactory$Options;->outWidth:I

    if-eq v2, v3, :cond_15

    iget v2, v1, Landroid/graphics/BitmapFactory$Options;->outHeight:I

    if-ne v2, v3, :cond_1b

    :cond_15
    const-string v1, "decode dimension failed for bitmap."

    invoke-static {v1}, Lcom/baidu/techain/aa/c;->a(Ljava/lang/String;)V

    :cond_1a
    :goto_1a
    return v0

    :cond_1b
    invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v2

    invoke-virtual {v2}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;

    move-result-object v2

    iget v2, v2, Landroid/util/DisplayMetrics;->densityDpi:I

    int-to-float v2, v2

    const/high16 v3, 0x43200000    # 160.0f

    div-float/2addr v2, v3

    const/high16 v3, 0x42400000    # 48.0f

    mul-float/2addr v2, v3

    invoke-static {v2}, Ljava/lang/Math;->round(F)I

    move-result v2

    iget v3, v1, Landroid/graphics/BitmapFactory$Options;->outWidth:I

    if-le v3, v2, :cond_1a

    iget v3, v1, Landroid/graphics/BitmapFactory$Options;->outHeight:I

    if-le v3, v2, :cond_1a

    iget v0, v1, Landroid/graphics/BitmapFactory$Options;->outWidth:I

    div-int/2addr v0, v2

    iget v1, v1, Landroid/graphics/BitmapFactory$Options;->outHeight:I

    div-int/2addr v1, v2

    invoke-static {v0, v1}, Ljava/lang/Math;->min(II)I

    move-result v0

    goto :goto_1a
.end method

.method public static a(Landroid/content/Context;Ljava/lang/String;)Landroid/graphics/Bitmap;
    .registers 7

    const/4 v0, 0x0

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

    move-result-object v1

    :try_start_5
    invoke-virtual {p0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v2

    invoke-virtual {v2, v1}, Landroid/content/ContentResolver;->openInputStream(Landroid/net/Uri;)Ljava/io/InputStream;
    :try_end_c
    .catch Ljava/io/IOException; {:try_start_5 .. :try_end_c} :catch_2c
    .catchall {:try_start_5 .. :try_end_c} :catchall_39

    move-result-object v2

    :try_start_d
    invoke-static {p0, v2}, Ldxoptimizer/cqi;->a(Landroid/content/Context;Ljava/io/InputStream;)I

    move-result v4

    invoke-virtual {p0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    invoke-virtual {v3, v1}, Landroid/content/ContentResolver;->openInputStream(Landroid/net/Uri;)Ljava/io/InputStream;
    :try_end_18
    .catch Ljava/io/IOException; {:try_start_d .. :try_end_18} :catch_4a
    .catchall {:try_start_d .. :try_end_18} :catchall_44

    move-result-object v3

    :try_start_19
    new-instance v1, Landroid/graphics/BitmapFactory$Options;

    invoke-direct {v1}, Landroid/graphics/BitmapFactory$Options;-><init>()V

    iput v4, v1, Landroid/graphics/BitmapFactory$Options;->inSampleSize:I

    const/4 v4, 0x0

    invoke-static {v3, v4, v1}, Landroid/graphics/BitmapFactory;->decodeStream(Ljava/io/InputStream;Landroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
    :try_end_24
    .catch Ljava/io/IOException; {:try_start_19 .. :try_end_24} :catch_4d
    .catchall {:try_start_19 .. :try_end_24} :catchall_48

    move-result-object v0

    invoke-static {v3}, Lcom/baidu/techain/af/ke;->a(Ljava/io/Closeable;)V

    invoke-static {v2}, Lcom/baidu/techain/af/ke;->a(Ljava/io/Closeable;)V

    :goto_2b
    return-object v0

    :catch_2c
    move-exception v1

    move-object v2, v0

    move-object v3, v0

    :goto_2f
    :try_start_2f
    invoke-static {v1}, Lcom/baidu/techain/aa/c;->a(Ljava/lang/Throwable;)V
    :try_end_32
    .catchall {:try_start_2f .. :try_end_32} :catchall_48

    invoke-static {v3}, Lcom/baidu/techain/af/ke;->a(Ljava/io/Closeable;)V

    invoke-static {v2}, Lcom/baidu/techain/af/ke;->a(Ljava/io/Closeable;)V

    goto :goto_2b

    :catchall_39
    move-exception v1

    move-object v2, v0

    move-object v3, v0

    move-object v0, v1

    :goto_3d
    invoke-static {v3}, Lcom/baidu/techain/af/ke;->a(Ljava/io/Closeable;)V

    invoke-static {v2}, Lcom/baidu/techain/af/ke;->a(Ljava/io/Closeable;)V

    throw v0

    :catchall_44
    move-exception v1

    move-object v3, v0

    move-object v0, v1

    goto :goto_3d

    :catchall_48
    move-exception v0

    goto :goto_3d

    :catch_4a
    move-exception v1

    move-object v3, v0

    goto :goto_2f

    :catch_4d
    move-exception v1

    goto :goto_2f
.end method

.method private static a(Ljava/lang/String;Z)Ldxoptimizer/cqi$a;
    .registers 11

    const v2, 0x19000

    const/4 v1, 0x0

    :try_start_4
    new-instance v0, Ljava/net/URL;

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

    invoke-virtual {v0}, Ljava/net/URL;->openConnection()Ljava/net/URLConnection;

    move-result-object v0

    check-cast v0, Ljava/net/HttpURLConnection;
    :try_end_f
    .catch Ljava/net/SocketTimeoutException; {:try_start_4 .. :try_end_f} :catch_11f
    .catch Ljava/io/IOException; {:try_start_4 .. :try_end_f} :catch_e7
    .catchall {:try_start_4 .. :try_end_f} :catchall_f6

    const/16 v3, 0x1f40

    :try_start_11
    invoke-virtual {v0, v3}, Ljava/net/HttpURLConnection;->setConnectTimeout(I)V

    const/16 v3, 0x4e20

    invoke-virtual {v0, v3}, Ljava/net/HttpURLConnection;->setReadTimeout(I)V

    invoke-virtual {v0}, Ljava/net/HttpURLConnection;->connect()V

    invoke-virtual {v0}, Ljava/net/HttpURLConnection;->getContentLength()I

    move-result v3

    if-eqz p1, :cond_4a

    if-le v3, v2, :cond_4a

    new-instance v2, Ljava/lang/StringBuilder;

    const-string v4, "Bitmap size is too big, max size is 102400  contentLen size is "

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

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

    move-result-object v2

    const-string v3, " from url "

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

    move-result-object v2

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

    move-result-object v2

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

    move-result-object v2

    invoke-static {v2}, Lcom/baidu/techain/aa/c;->a(Ljava/lang/String;)V
    :try_end_40
    .catch Ljava/net/SocketTimeoutException; {:try_start_11 .. :try_end_40} :catch_124
    .catch Ljava/io/IOException; {:try_start_11 .. :try_end_40} :catch_114
    .catchall {:try_start_11 .. :try_end_40} :catchall_101

    invoke-static {v1}, Lcom/baidu/techain/af/ke;->a(Ljava/io/Closeable;)V

    if-eqz v0, :cond_48

    invoke-virtual {v0}, Ljava/net/HttpURLConnection;->disconnect()V

    :cond_48
    move-object v0, v1

    :goto_49
    return-object v0

    :cond_4a
    :try_start_4a
    invoke-virtual {v0}, Ljava/net/HttpURLConnection;->getResponseCode()I

    move-result v3

    const/16 v4, 0xc8

    if-eq v3, v4, :cond_74

    new-instance v2, Ljava/lang/StringBuilder;

    const-string v4, "Invalid Http Response Code "

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

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

    move-result-object v2

    const-string v3, " received"

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

    move-result-object v2

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

    move-result-object v2

    invoke-static {v2}, Lcom/baidu/techain/aa/c;->a(Ljava/lang/String;)V
    :try_end_6a
    .catch Ljava/net/SocketTimeoutException; {:try_start_4a .. :try_end_6a} :catch_124
    .catch Ljava/io/IOException; {:try_start_4a .. :try_end_6a} :catch_114
    .catchall {:try_start_4a .. :try_end_6a} :catchall_101

    invoke-static {v1}, Lcom/baidu/techain/af/ke;->a(Ljava/io/Closeable;)V

    if-eqz v0, :cond_72

    invoke-virtual {v0}, Ljava/net/HttpURLConnection;->disconnect()V

    :cond_72
    move-object v0, v1

    goto :goto_49

    :cond_74
    :try_start_74
    invoke-virtual {v0}, Ljava/net/HttpURLConnection;->getInputStream()Ljava/io/InputStream;
    :try_end_77
    .catch Ljava/net/SocketTimeoutException; {:try_start_74 .. :try_end_77} :catch_124
    .catch Ljava/io/IOException; {:try_start_74 .. :try_end_77} :catch_114
    .catchall {:try_start_74 .. :try_end_77} :catchall_101

    move-result-object v3

    :try_start_78
    new-instance v4, Ljava/io/ByteArrayOutputStream;

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

    if-eqz p1, :cond_b3

    :goto_7f
    const/16 v5, 0x400

    new-array v5, v5, [B

    :goto_83
    if-lez v2, :cond_b7

    const/4 v6, 0x0

    const/16 v7, 0x400

    invoke-virtual {v3, v5, v6, v7}, Ljava/io/InputStream;->read([BII)I

    move-result v6

    const/4 v7, -0x1

    if-eq v6, v7, :cond_b7

    sub-int/2addr v2, v6

    const/4 v7, 0x0

    invoke-virtual {v4, v5, v7, v6}, Ljava/io/ByteArrayOutputStream;->write([BII)V
    :try_end_94
    .catch Ljava/net/SocketTimeoutException; {:try_start_78 .. :try_end_94} :catch_95
    .catch Ljava/io/IOException; {:try_start_78 .. :try_end_94} :catch_11a
    .catchall {:try_start_78 .. :try_end_94} :catchall_106

    goto :goto_83

    :catch_95
    move-exception v2

    move-object v2, v3

    :goto_97
    :try_start_97
    new-instance v3, Ljava/lang/StringBuilder;

    const-string v4, "Connect timeout to "

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

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

    move-result-object v3

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

    move-result-object v3

    invoke-static {v3}, Lcom/baidu/techain/aa/c;->d(Ljava/lang/String;)V
    :try_end_a9
    .catchall {:try_start_97 .. :try_end_a9} :catchall_10b

    invoke-static {v2}, Lcom/baidu/techain/af/ke;->a(Ljava/io/Closeable;)V

    if-eqz v0, :cond_b1

    invoke-virtual {v0}, Ljava/net/HttpURLConnection;->disconnect()V

    :cond_b1
    :goto_b1
    move-object v0, v1

    goto :goto_49

    :cond_b3
    const v2, 0x1f4000

    goto :goto_7f

    :cond_b7
    if-gtz v2, :cond_d2

    :try_start_b9
    const-string v2, "length 102400 exhausted."

    invoke-static {v2}, Lcom/baidu/techain/aa/c;->a(Ljava/lang/String;)V

    new-instance v2, Ldxoptimizer/cqi$a;

    const/4 v4, 0x0

    const v5, 0x19000

    invoke-direct {v2, v4, v5}, Ldxoptimizer/cqi$a;-><init>([BI)V
    :try_end_c7
    .catch Ljava/net/SocketTimeoutException; {:try_start_b9 .. :try_end_c7} :catch_95
    .catch Ljava/io/IOException; {:try_start_b9 .. :try_end_c7} :catch_11a
    .catchall {:try_start_b9 .. :try_end_c7} :catchall_106

    invoke-static {v3}, Lcom/baidu/techain/af/ke;->a(Ljava/io/Closeable;)V

    if-eqz v0, :cond_cf

    invoke-virtual {v0}, Ljava/net/HttpURLConnection;->disconnect()V

    :cond_cf
    move-object v0, v2

    goto/16 :goto_49

    :cond_d2
    :try_start_d2
    invoke-virtual {v4}, Ljava/io/ByteArrayOutputStream;->toByteArray()[B

    move-result-object v4

    new-instance v2, Ldxoptimizer/cqi$a;

    array-length v5, v4

    invoke-direct {v2, v4, v5}, Ldxoptimizer/cqi$a;-><init>([BI)V
    :try_end_dc
    .catch Ljava/net/SocketTimeoutException; {:try_start_d2 .. :try_end_dc} :catch_95
    .catch Ljava/io/IOException; {:try_start_d2 .. :try_end_dc} :catch_11a
    .catchall {:try_start_d2 .. :try_end_dc} :catchall_106

    invoke-static {v3}, Lcom/baidu/techain/af/ke;->a(Ljava/io/Closeable;)V

    if-eqz v0, :cond_e4

    invoke-virtual {v0}, Ljava/net/HttpURLConnection;->disconnect()V

    :cond_e4
    move-object v0, v2

    goto/16 :goto_49

    :catch_e7
    move-exception v0

    move-object v2, v1

    move-object v3, v1

    :goto_ea
    :try_start_ea
    invoke-static {v0}, Lcom/baidu/techain/aa/c;->a(Ljava/lang/Throwable;)V
    :try_end_ed
    .catchall {:try_start_ea .. :try_end_ed} :catchall_111

    invoke-static {v3}, Lcom/baidu/techain/af/ke;->a(Ljava/io/Closeable;)V

    if-eqz v2, :cond_b1

    invoke-virtual {v2}, Ljava/net/HttpURLConnection;->disconnect()V

    goto :goto_b1

    :catchall_f6
    move-exception v0

    move-object v3, v1

    :goto_f8
    invoke-static {v3}, Lcom/baidu/techain/af/ke;->a(Ljava/io/Closeable;)V

    if-eqz v1, :cond_100

    invoke-virtual {v1}, Ljava/net/HttpURLConnection;->disconnect()V

    :cond_100
    throw v0

    :catchall_101
    move-exception v2

    move-object v3, v1

    move-object v1, v0

    move-object v0, v2

    goto :goto_f8

    :catchall_106
    move-exception v1

    move-object v8, v1

    move-object v1, v0

    move-object v0, v8

    goto :goto_f8

    :catchall_10b
    move-exception v1

    move-object v3, v2

    move-object v8, v0

    move-object v0, v1

    move-object v1, v8

    goto :goto_f8

    :catchall_111
    move-exception v0

    move-object v1, v2

    goto :goto_f8

    :catch_114
    move-exception v2

    move-object v3, v1

    move-object v8, v0

    move-object v0, v2

    move-object v2, v8

    goto :goto_ea

    :catch_11a
    move-exception v2

    move-object v8, v2

    move-object v2, v0

    move-object v0, v8

    goto :goto_ea

    :catch_11f
    move-exception v0

    move-object v0, v1

    move-object v2, v1

    goto/16 :goto_97

    :catch_124
    move-exception v2

    move-object v2, v1

    goto/16 :goto_97
.end method

.method public static a(Landroid/content/Context;Ljava/lang/String;Z)Ldxoptimizer/cqi$b;
    .registers 14

    .prologue
    const/4 v2, 0x0

    .line 0
    new-instance v0, Ldxoptimizer/cqi$b;

    invoke-direct {v0}, Ldxoptimizer/cqi$b;-><init>()V

    invoke-static {p0, p1}, Ldxoptimizer/cqi;->b(Landroid/content/Context;Ljava/lang/String;)Landroid/graphics/Bitmap;

    move-result-object v1

    if-eqz v1, :cond_f

    iput-object v1, v0, Ldxoptimizer/cqi$b;->a:Landroid/graphics/Bitmap;

    :goto_e
    return-object v0

    :cond_f
    :try_start_f
    invoke-static {p1, p2}, Ldxoptimizer/cqi;->a(Ljava/lang/String;Z)Ldxoptimizer/cqi$a;
    :try_end_12
    .catch Ljava/lang/Exception; {:try_start_f .. :try_end_12} :catch_116
    .catchall {:try_start_f .. :try_end_12} :catchall_10d

    move-result-object v1

    if-nez v1, :cond_19

    invoke-static {v2}, Lcom/baidu/techain/af/ke;->a(Ljava/io/Closeable;)V

    goto :goto_e

    :cond_19
    :try_start_19
    iget v3, v1, Ldxoptimizer/cqi$a;->b:I

    int-to-long v4, v3

    iput-wide v4, v0, Ldxoptimizer/cqi$b;->b:J

    iget-object v4, v1, Ldxoptimizer/cqi$a;->a:[B

    if-eqz v4, :cond_52

    if-eqz p2, :cond_4a

    new-instance v3, Ljava/io/ByteArrayInputStream;

    invoke-direct {v3, v4}, Ljava/io/ByteArrayInputStream;-><init>([B)V
    :try_end_29
    .catch Ljava/lang/Exception; {:try_start_19 .. :try_end_29} :catch_116
    .catchall {:try_start_19 .. :try_end_29} :catchall_10d

    :try_start_29
    invoke-static {p0, v3}, Ldxoptimizer/cqi;->a(Landroid/content/Context;Ljava/io/InputStream;)I

    move-result v5

    new-instance v6, Landroid/graphics/BitmapFactory$Options;

    invoke-direct {v6}, Landroid/graphics/BitmapFactory$Options;-><init>()V

    iput v5, v6, Landroid/graphics/BitmapFactory$Options;->inSampleSize:I

    const/4 v5, 0x0

    array-length v7, v4

    invoke-static {v4, v5, v7, v6}, Landroid/graphics/BitmapFactory;->decodeByteArray([BIILandroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;

    move-result-object v4

    iput-object v4, v0, Ldxoptimizer/cqi$b;->a:Landroid/graphics/Bitmap;
    :try_end_3c
    .catch Ljava/lang/Exception; {:try_start_29 .. :try_end_3c} :catch_118
    .catchall {:try_start_29 .. :try_end_3c} :catchall_110

    move-object v5, v3

    :goto_3d
    :try_start_3d
    iget-object v1, v1, Ldxoptimizer/cqi$a;->a:[B

    .line 1000
    if-nez v1, :cond_54

    const-string v1, "cannot save small icon cause bitmap is null"

    invoke-static {v1}, Lcom/baidu/techain/aa/c;->a(Ljava/lang/String;)V
    :try_end_46
    .catch Ljava/lang/Exception; {:try_start_3d .. :try_end_46} :catch_e9
    .catchall {:try_start_3d .. :try_end_46} :catchall_ff

    .line 0
    :cond_46
    :goto_46
    invoke-static {v5}, Lcom/baidu/techain/af/ke;->a(Ljava/io/Closeable;)V

    goto :goto_e

    :cond_4a
    const/4 v3, 0x0

    :try_start_4b
    array-length v5, v4

    invoke-static {v4, v3, v5}, Landroid/graphics/BitmapFactory;->decodeByteArray([BII)Landroid/graphics/Bitmap;

    move-result-object v3

    iput-object v3, v0, Ldxoptimizer/cqi$b;->a:Landroid/graphics/Bitmap;
    :try_end_52
    .catch Ljava/lang/Exception; {:try_start_4b .. :try_end_52} :catch_116
    .catchall {:try_start_4b .. :try_end_52} :catchall_10d

    :cond_52
    move-object v5, v2

    goto :goto_3d

    .line 1000
    :cond_54
    :try_start_54
    invoke-static {p0}, Ldxoptimizer/cqi;->a(Landroid/content/Context;)V

    new-instance v3, Ljava/io/File;

    new-instance v4, Ljava/lang/StringBuilder;

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

    invoke-virtual {p0}, Landroid/content/Context;->getCacheDir()Ljava/io/File;

    move-result-object v6

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

    move-result-object v6

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

    move-result-object v4

    sget-object v6, Ljava/io/File;->separator:Ljava/lang/String;

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

    move-result-object v4

    const-string v6, "mipush_icon"

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

    move-result-object v4

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

    move-result-object v4

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

    invoke-virtual {v3}, Ljava/io/File;->exists()Z

    move-result v4

    if-nez v4, :cond_86

    invoke-virtual {v3}, Ljava/io/File;->mkdirs()Z

    :cond_86
    new-instance v6, Ljava/io/File;

    invoke-static {p1}, Lcom/baidu/techain/af/y;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    invoke-direct {v6, v3, v4}, Ljava/io/File;-><init>(Ljava/io/File;Ljava/lang/String;)V
    :try_end_8f
    .catch Ljava/lang/Exception; {:try_start_54 .. :try_end_8f} :catch_e9
    .catchall {:try_start_54 .. :try_end_8f} :catchall_ff

    :try_start_8f
    invoke-virtual {v6}, Ljava/io/File;->exists()Z

    move-result v3

    if-nez v3, :cond_98

    invoke-virtual {v6}, Ljava/io/File;->createNewFile()Z

    :cond_98
    new-instance v3, Ljava/io/FileOutputStream;

    invoke-direct {v3, v6}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;)V
    :try_end_9d
    .catch Ljava/lang/Exception; {:try_start_8f .. :try_end_9d} :catch_f3
    .catchall {:try_start_8f .. :try_end_9d} :catchall_104

    :try_start_9d
    new-instance v4, Ljava/io/BufferedOutputStream;

    invoke-direct {v4, v3}, Ljava/io/BufferedOutputStream;-><init>(Ljava/io/OutputStream;)V
    :try_end_a2
    .catch Ljava/lang/Exception; {:try_start_9d .. :try_end_a2} :catch_125
    .catchall {:try_start_9d .. :try_end_a2} :catchall_11b

    :try_start_a2
    invoke-virtual {v4, v1}, Ljava/io/BufferedOutputStream;->write([B)V

    invoke-virtual {v4}, Ljava/io/BufferedOutputStream;->flush()V
    :try_end_a8
    .catch Ljava/lang/Exception; {:try_start_a2 .. :try_end_a8} :catch_12a
    .catchall {:try_start_a2 .. :try_end_a8} :catchall_11f

    :try_start_a8
    invoke-static {v4}, Lcom/baidu/techain/af/ke;->a(Ljava/io/Closeable;)V

    invoke-static {v3}, Lcom/baidu/techain/af/ke;->a(Ljava/io/Closeable;)V

    :goto_ae
    sget-wide v2, Ldxoptimizer/cqi;->a:J

    const-wide/16 v8, 0x0

    cmp-long v1, v2, v8

    if-nez v1, :cond_46

    new-instance v1, Ljava/io/File;

    new-instance v2, Ljava/lang/StringBuilder;

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

    invoke-virtual {p0}, Landroid/content/Context;->getCacheDir()Ljava/io/File;

    move-result-object v3

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

    move-result-object v3

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

    move-result-object v2

    sget-object v3, Ljava/io/File;->separator:Ljava/lang/String;

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

    move-result-object v2

    const-string v3, "mipush_icon"

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

    move-result-object v2

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

    move-result-object v2

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

    invoke-static {v1}, Lcom/baidu/techain/af/kd;->a(Ljava/io/File;)J

    move-result-wide v2

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

    move-result-wide v6

    add-long/2addr v2, v6

    sput-wide v2, Ldxoptimizer/cqi;->a:J
    :try_end_e7
    .catch Ljava/lang/Exception; {:try_start_a8 .. :try_end_e7} :catch_e9
    .catchall {:try_start_a8 .. :try_end_e7} :catchall_ff

    goto/16 :goto_46

    .line 0
    :catch_e9
    move-exception v1

    move-object v2, v5

    :goto_eb
    :try_start_eb
    invoke-static {v1}, Lcom/baidu/techain/aa/c;->a(Ljava/lang/Throwable;)V
    :try_end_ee
    .catchall {:try_start_eb .. :try_end_ee} :catchall_113

    invoke-static {v2}, Lcom/baidu/techain/af/ke;->a(Ljava/io/Closeable;)V

    goto/16 :goto_e

    .line 1000
    :catch_f3
    move-exception v1

    move-object v3, v2

    :goto_f5
    :try_start_f5
    invoke-static {v1}, Lcom/baidu/techain/aa/c;->a(Ljava/lang/Throwable;)V
    :try_end_f8
    .catchall {:try_start_f5 .. :try_end_f8} :catchall_122

    :try_start_f8
    invoke-static {v3}, Lcom/baidu/techain/af/ke;->a(Ljava/io/Closeable;)V

    invoke-static {v2}, Lcom/baidu/techain/af/ke;->a(Ljava/io/Closeable;)V
    :try_end_fe
    .catch Ljava/lang/Exception; {:try_start_f8 .. :try_end_fe} :catch_e9
    .catchall {:try_start_f8 .. :try_end_fe} :catchall_ff

    goto :goto_ae

    .line 0
    :catchall_ff
    move-exception v0

    :goto_100
    invoke-static {v5}, Lcom/baidu/techain/af/ke;->a(Ljava/io/Closeable;)V

    throw v0

    .line 1000
    :catchall_104
    move-exception v1

    move-object v4, v2

    :goto_106
    :try_start_106
    invoke-static {v4}, Lcom/baidu/techain/af/ke;->a(Ljava/io/Closeable;)V

    invoke-static {v2}, Lcom/baidu/techain/af/ke;->a(Ljava/io/Closeable;)V

    throw v1
    :try_end_10d
    .catch Ljava/lang/Exception; {:try_start_106 .. :try_end_10d} :catch_e9
    .catchall {:try_start_106 .. :try_end_10d} :catchall_ff

    .line 0
    :catchall_10d
    move-exception v0

    move-object v5, v2

    goto :goto_100

    :catchall_110
    move-exception v0

    move-object v5, v3

    goto :goto_100

    :catchall_113
    move-exception v0

    move-object v5, v2

    goto :goto_100

    :catch_116
    move-exception v1

    goto :goto_eb

    :catch_118
    move-exception v1

    move-object v2, v3

    goto :goto_eb

    .line 1000
    :catchall_11b
    move-exception v1

    move-object v4, v2

    move-object v2, v3

    goto :goto_106

    :catchall_11f
    move-exception v1

    move-object v2, v3

    goto :goto_106

    :catchall_122
    move-exception v1

    move-object v4, v3

    goto :goto_106

    :catch_125
    move-exception v1

    move-object v10, v3

    move-object v3, v2

    move-object v2, v10

    goto :goto_f5

    :catch_12a
    move-exception v1

    move-object v2, v3

    move-object v3, v4

    goto :goto_f5
.end method

.method private static a(Landroid/content/Context;)V
    .registers 9

    const-wide/16 v6, 0x0

    new-instance v0, Ljava/io/File;

    new-instance v1, Ljava/lang/StringBuilder;

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

    invoke-virtual {p0}, Landroid/content/Context;->getCacheDir()Ljava/io/File;

    move-result-object v2

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

    move-result-object v2

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

    move-result-object v1

    sget-object v2, Ljava/io/File;->separator:Ljava/lang/String;

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

    move-result-object v1

    const-string v2, "mipush_icon"

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

    move-result-object v1

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

    move-result-object v1

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

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

    move-result v1

    if-nez v1, :cond_2f

    :cond_2e
    :goto_2e
    return-void

    :cond_2f
    sget-wide v2, Ldxoptimizer/cqi;->a:J

    cmp-long v1, v2, v6

    if-nez v1, :cond_3b

    invoke-static {v0}, Lcom/baidu/techain/af/kd;->a(Ljava/io/File;)J

    move-result-wide v2

    sput-wide v2, Ldxoptimizer/cqi;->a:J

    :cond_3b
    sget-wide v2, Ldxoptimizer/cqi;->a:J

    const-wide/32 v4, 0xf00000

    cmp-long v1, v2, v4

    if-lez v1, :cond_2e

    :try_start_44
    invoke-virtual {v0}, Ljava/io/File;->listFiles()[Ljava/io/File;

    move-result-object v1

    const/4 v0, 0x0

    :goto_49
    array-length v2, v1

    if-ge v0, v2, :cond_76

    aget-object v2, v1, v0

    invoke-virtual {v2}, Ljava/io/File;->isDirectory()Z

    move-result v2

    if-nez v2, :cond_6f

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

    move-result-wide v2

    aget-object v4, v1, v0

    invoke-virtual {v4}, Ljava/io/File;->lastModified()J

    move-result-wide v4

    sub-long/2addr v2, v4

    invoke-static {v2, v3}, Ljava/lang/Math;->abs(J)J

    move-result-wide v2

    const-wide/32 v4, 0x127500

    cmp-long v2, v2, v4

    if-lez v2, :cond_6f

    aget-object v2, v1, v0

    invoke-virtual {v2}, Ljava/io/File;->delete()Z
    :try_end_6f
    .catch Ljava/lang/Exception; {:try_start_44 .. :try_end_6f} :catch_72

    :cond_6f
    add-int/lit8 v0, v0, 0x1

    goto :goto_49

    :catch_72
    move-exception v0

    invoke-static {v0}, Lcom/baidu/techain/aa/c;->a(Ljava/lang/Throwable;)V

    :cond_76
    sput-wide v6, Ldxoptimizer/cqi;->a:J

    goto :goto_2e
.end method

.method private static b(Landroid/content/Context;Ljava/lang/String;)Landroid/graphics/Bitmap;
    .registers 8

    const/4 v0, 0x0

    new-instance v1, Ljava/io/File;

    new-instance v2, Ljava/lang/StringBuilder;

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

    invoke-virtual {p0}, Landroid/content/Context;->getCacheDir()Ljava/io/File;

    move-result-object v3

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

    move-result-object v3

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

    move-result-object v2

    sget-object v3, Ljava/io/File;->separator:Ljava/lang/String;

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

    move-result-object v2

    const-string v3, "mipush_icon"

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

    move-result-object v2

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

    move-result-object v2

    invoke-static {p1}, Lcom/baidu/techain/af/y;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

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

    invoke-virtual {v1}, Ljava/io/File;->exists()Z

    move-result v2

    if-nez v2, :cond_32

    :goto_31
    return-object v0

    :cond_32
    :try_start_32
    new-instance v2, Ljava/io/FileInputStream;

    invoke-direct {v2, v1}, Ljava/io/FileInputStream;-><init>(Ljava/io/File;)V
    :try_end_37
    .catch Ljava/lang/Exception; {:try_start_32 .. :try_end_37} :catch_46
    .catchall {:try_start_32 .. :try_end_37} :catchall_4f

    :try_start_37
    invoke-static {v2}, Landroid/graphics/BitmapFactory;->decodeStream(Ljava/io/InputStream;)Landroid/graphics/Bitmap;

    move-result-object v0

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

    move-result-wide v4

    invoke-virtual {v1, v4, v5}, Ljava/io/File;->setLastModified(J)Z
    :try_end_42
    .catch Ljava/lang/Exception; {:try_start_37 .. :try_end_42} :catch_58
    .catchall {:try_start_37 .. :try_end_42} :catchall_56

    invoke-static {v2}, Lcom/baidu/techain/af/ke;->a(Ljava/io/Closeable;)V

    goto :goto_31

    :catch_46
    move-exception v1

    move-object v2, v0

    :goto_48
    :try_start_48
    invoke-static {v1}, Lcom/baidu/techain/aa/c;->a(Ljava/lang/Throwable;)V
    :try_end_4b
    .catchall {:try_start_48 .. :try_end_4b} :catchall_56

    invoke-static {v2}, Lcom/baidu/techain/af/ke;->a(Ljava/io/Closeable;)V

    goto :goto_31

    :catchall_4f
    move-exception v1

    move-object v2, v0

    move-object v0, v1

    :goto_52
    invoke-static {v2}, Lcom/baidu/techain/af/ke;->a(Ljava/io/Closeable;)V

    throw v0

    :catchall_56
    move-exception v0

    goto :goto_52

    :catch_58
    move-exception v1

    goto :goto_48
.end method