c.smali

.class public abstract Lcom/huawei/updatesdk/sdk/a/d/c;
.super Ljava/lang/Object;


# direct methods
.method public static a(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    .registers 12

    const-wide/16 v6, 0x0

    const/4 v0, 0x0

    :try_start_3
    invoke-static {p1}, Ljava/security/MessageDigest;->getInstance(Ljava/lang/String;)Ljava/security/MessageDigest;

    move-result-object v1

    new-instance v2, Ljava/io/FileInputStream;

    invoke-direct {v2, p0}, Ljava/io/FileInputStream;-><init>(Ljava/lang/String;)V
    :try_end_c
    .catch Ljava/security/NoSuchAlgorithmException; {:try_start_3 .. :try_end_c} :catch_38
    .catch Ljava/io/FileNotFoundException; {:try_start_3 .. :try_end_c} :catch_50
    .catch Ljava/io/IOException; {:try_start_3 .. :try_end_c} :catch_68
    .catch Ljava/lang/IllegalArgumentException; {:try_start_3 .. :try_end_c} :catch_80
    .catch Ljava/lang/IndexOutOfBoundsException; {:try_start_3 .. :try_end_c} :catch_98
    .catchall {:try_start_3 .. :try_end_c} :catchall_b1

    const/16 v3, 0x400

    :try_start_e
    new-array v3, v3, [B

    move-wide v4, v6

    :goto_11
    invoke-virtual {v2, v3}, Ljava/io/FileInputStream;->read([B)I

    move-result v8

    const/4 v9, -0x1

    if-eq v8, v9, :cond_1f

    const/4 v9, 0x0

    invoke-virtual {v1, v3, v9, v8}, Ljava/security/MessageDigest;->update([BII)V

    int-to-long v8, v8

    add-long/2addr v4, v8

    goto :goto_11

    :cond_1f
    cmp-long v3, v4, v6

    if-lez v3, :cond_2b

    invoke-virtual {v1}, Ljava/security/MessageDigest;->digest()[B

    move-result-object v1

    invoke-static {v1}, Lcom/huawei/updatesdk/sdk/a/d/b;->a([B)Ljava/lang/String;
    :try_end_2a
    .catch Ljava/security/NoSuchAlgorithmException; {:try_start_e .. :try_end_2a} :catch_cd
    .catch Ljava/io/FileNotFoundException; {:try_start_e .. :try_end_2a} :catch_cb
    .catch Ljava/io/IOException; {:try_start_e .. :try_end_2a} :catch_c9
    .catch Ljava/lang/IllegalArgumentException; {:try_start_e .. :try_end_2a} :catch_c7
    .catch Ljava/lang/IndexOutOfBoundsException; {:try_start_e .. :try_end_2a} :catch_c5
    .catchall {:try_start_e .. :try_end_2a} :catchall_c3

    move-result-object v0

    :cond_2b
    :try_start_2b
    invoke-virtual {v2}, Ljava/io/FileInputStream;->close()V
    :try_end_2e
    .catch Ljava/io/IOException; {:try_start_2b .. :try_end_2e} :catch_2f

    :cond_2e
    :goto_2e
    return-object v0

    :catch_2f
    move-exception v1

    const-string v1, "FileUtil"

    const-string v2, "Close FileInputStream failed!"

    invoke-static {v1, v2}, Lcom/huawei/updatesdk/sdk/a/c/a/a/a;->d(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_2e

    :catch_38
    move-exception v1

    move-object v2, v0

    :goto_3a
    :try_start_3a
    const-string v3, "FileUtil"

    const-string v4, "getFileHashData NoSuchAlgorithmException"

    invoke-static {v3, v4, v1}, Lcom/huawei/updatesdk/sdk/a/c/a/a/a;->a(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
    :try_end_41
    .catchall {:try_start_3a .. :try_end_41} :catchall_c3

    if-eqz v2, :cond_2e

    :try_start_43
    invoke-virtual {v2}, Ljava/io/FileInputStream;->close()V
    :try_end_46
    .catch Ljava/io/IOException; {:try_start_43 .. :try_end_46} :catch_47

    goto :goto_2e

    :catch_47
    move-exception v1

    const-string v1, "FileUtil"

    const-string v2, "Close FileInputStream failed!"

    invoke-static {v1, v2}, Lcom/huawei/updatesdk/sdk/a/c/a/a/a;->d(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_2e

    :catch_50
    move-exception v1

    move-object v2, v0

    :goto_52
    :try_start_52
    const-string v3, "FileUtil"

    const-string v4, "getFileHashData FileNotFoundException"

    invoke-static {v3, v4, v1}, Lcom/huawei/updatesdk/sdk/a/c/a/a/a;->a(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
    :try_end_59
    .catchall {:try_start_52 .. :try_end_59} :catchall_c3

    if-eqz v2, :cond_2e

    :try_start_5b
    invoke-virtual {v2}, Ljava/io/FileInputStream;->close()V
    :try_end_5e
    .catch Ljava/io/IOException; {:try_start_5b .. :try_end_5e} :catch_5f

    goto :goto_2e

    :catch_5f
    move-exception v1

    const-string v1, "FileUtil"

    const-string v2, "Close FileInputStream failed!"

    invoke-static {v1, v2}, Lcom/huawei/updatesdk/sdk/a/c/a/a/a;->d(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_2e

    :catch_68
    move-exception v1

    move-object v2, v0

    :goto_6a
    :try_start_6a
    const-string v3, "FileUtil"

    const-string v4, "getFileHashData IOException"

    invoke-static {v3, v4, v1}, Lcom/huawei/updatesdk/sdk/a/c/a/a/a;->a(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
    :try_end_71
    .catchall {:try_start_6a .. :try_end_71} :catchall_c3

    if-eqz v2, :cond_2e

    :try_start_73
    invoke-virtual {v2}, Ljava/io/FileInputStream;->close()V
    :try_end_76
    .catch Ljava/io/IOException; {:try_start_73 .. :try_end_76} :catch_77

    goto :goto_2e

    :catch_77
    move-exception v1

    const-string v1, "FileUtil"

    const-string v2, "Close FileInputStream failed!"

    invoke-static {v1, v2}, Lcom/huawei/updatesdk/sdk/a/c/a/a/a;->d(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_2e

    :catch_80
    move-exception v1

    move-object v2, v0

    :goto_82
    :try_start_82
    const-string v3, "FileUtil"

    const-string v4, "getFileHashData IllegalArgumentException"

    invoke-static {v3, v4, v1}, Lcom/huawei/updatesdk/sdk/a/c/a/a/a;->a(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
    :try_end_89
    .catchall {:try_start_82 .. :try_end_89} :catchall_c3

    if-eqz v2, :cond_2e

    :try_start_8b
    invoke-virtual {v2}, Ljava/io/FileInputStream;->close()V
    :try_end_8e
    .catch Ljava/io/IOException; {:try_start_8b .. :try_end_8e} :catch_8f

    goto :goto_2e

    :catch_8f
    move-exception v1

    const-string v1, "FileUtil"

    const-string v2, "Close FileInputStream failed!"

    invoke-static {v1, v2}, Lcom/huawei/updatesdk/sdk/a/c/a/a/a;->d(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_2e

    :catch_98
    move-exception v1

    move-object v2, v0

    :goto_9a
    :try_start_9a
    const-string v3, "FileUtil"

    const-string v4, "getFileHashData IndexOutOfBoundsException"

    invoke-static {v3, v4, v1}, Lcom/huawei/updatesdk/sdk/a/c/a/a/a;->a(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
    :try_end_a1
    .catchall {:try_start_9a .. :try_end_a1} :catchall_c3

    if-eqz v2, :cond_2e

    :try_start_a3
    invoke-virtual {v2}, Ljava/io/FileInputStream;->close()V
    :try_end_a6
    .catch Ljava/io/IOException; {:try_start_a3 .. :try_end_a6} :catch_a7

    goto :goto_2e

    :catch_a7
    move-exception v1

    const-string v1, "FileUtil"

    const-string v2, "Close FileInputStream failed!"

    invoke-static {v1, v2}, Lcom/huawei/updatesdk/sdk/a/c/a/a/a;->d(Ljava/lang/String;Ljava/lang/String;)V

    goto/16 :goto_2e

    :catchall_b1
    move-exception v1

    move-object v2, v0

    move-object v0, v1

    :goto_b4
    if-eqz v2, :cond_b9

    :try_start_b6
    invoke-virtual {v2}, Ljava/io/FileInputStream;->close()V
    :try_end_b9
    .catch Ljava/io/IOException; {:try_start_b6 .. :try_end_b9} :catch_ba

    :cond_b9
    :goto_b9
    throw v0

    :catch_ba
    move-exception v1

    const-string v1, "FileUtil"

    const-string v2, "Close FileInputStream failed!"

    invoke-static {v1, v2}, Lcom/huawei/updatesdk/sdk/a/c/a/a/a;->d(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_b9

    :catchall_c3
    move-exception v0

    goto :goto_b4

    :catch_c5
    move-exception v1

    goto :goto_9a

    :catch_c7
    move-exception v1

    goto :goto_82

    :catch_c9
    move-exception v1

    goto :goto_6a

    :catch_cb
    move-exception v1

    goto :goto_52

    :catch_cd
    move-exception v1

    goto/16 :goto_3a
.end method

.method public static a(Ljava/io/Closeable;)V
    .registers 4

    if-eqz p0, :cond_5

    :try_start_2
    invoke-interface {p0}, Ljava/io/Closeable;->close()V
    :try_end_5
    .catch Ljava/io/IOException; {:try_start_2 .. :try_end_5} :catch_6

    :cond_5
    :goto_5
    return-void

    :catch_6
    move-exception v0

    const-string v1, "FileUtil"

    const-string v2, "Closeable exception"

    invoke-static {v1, v2, v0}, Lcom/huawei/updatesdk/sdk/a/c/a/a/a;->a(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V

    goto :goto_5
.end method