f.smali

.class public Lcom/cm/a/a/f;
.super Ljava/lang/Object;
.source "EncryptUtils.java"


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

    .prologue
    const/4 v0, 0x0

    const/4 v1, 0x0

    .line 60
    invoke-static {p0}, Lcom/cm/a/a/f;->b(Ljava/io/InputStream;)[B

    move-result-object v2

    .line 62
    if-nez v2, :cond_a

    move-object v0, v1

    .line 83
    :goto_9
    return-object v0

    .line 67
    :cond_a
    invoke-static {v2, v0}, Landroid/util/Base64;->decode([BI)[B

    move-result-object v2

    .line 72
    if-nez v2, :cond_1b

    move-object v0, v1

    .line 73
    goto :goto_9

    .line 76
    :cond_12
    aget-byte v3, v2, v0

    xor-int/lit16 v3, v3, 0xf1

    int-to-byte v3, v3

    aput-byte v3, v2, v0

    .line 75
    add-int/lit8 v0, v0, 0x1

    :cond_1b
    array-length v3, v2

    if-lt v0, v3, :cond_12

    .line 80
    :try_start_1e
    new-instance v0, Ljava/lang/String;

    const-string/jumbo v3, "utf-8"

    invoke-direct {v0, v2, v3}, Ljava/lang/String;-><init>([BLjava/lang/String;)V
    :try_end_26
    .catch Ljava/lang/Exception; {:try_start_1e .. :try_end_26} :catch_27

    goto :goto_9

    .line 81
    :catch_27
    move-exception v0

    .line 82
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    move-object v0, v1

    .line 83
    goto :goto_9
.end method

.method private static b(Ljava/io/InputStream;)[B
    .registers 6

    .prologue
    .line 89
    :try_start_0
    new-instance v0, Ljava/io/ByteArrayOutputStream;

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

    .line 90
    new-instance v1, Ljava/util/zip/GZIPInputStream;

    invoke-direct {v1, p0}, Ljava/util/zip/GZIPInputStream;-><init>(Ljava/io/InputStream;)V

    .line 91
    const/16 v2, 0x400

    new-array v2, v2, [B

    .line 93
    :goto_e
    invoke-virtual {v1, v2}, Ljava/util/zip/GZIPInputStream;->read([B)I

    move-result v3

    .line 94
    if-gtz v3, :cond_19

    .line 98
    invoke-virtual {v0}, Ljava/io/ByteArrayOutputStream;->toByteArray()[B

    move-result-object v0

    .line 102
    :goto_18
    return-object v0

    .line 96
    :cond_19
    const/4 v4, 0x0

    invoke-virtual {v0, v2, v4, v3}, Ljava/io/ByteArrayOutputStream;->write([BII)V
    :try_end_1d
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_1d} :catch_1e

    goto :goto_e

    .line 99
    :catch_1e
    move-exception v0

    .line 100
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    .line 102
    const/4 v0, 0x0

    goto :goto_18
.end method