d.smali

.class public Lwa/d;
.super Ljava/lang/Object;
.source "LoganParser.java"


# instance fields
.field public a:Ljavax/crypto/Cipher;

.field public b:[B

.field public c:[B


# direct methods
.method static constructor <clinit>()V
    .registers 1

    return-void
.end method

.method public constructor <init>([B[B)V
    .registers 3

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

    iput-object p1, p0, Lwa/d;->b:[B

    iput-object p2, p0, Lwa/d;->c:[B

    invoke-virtual {p0}, Lwa/d;->a()V

    return-void
.end method


# virtual methods
.method public final a()V
    .registers 6

    new-instance v0, Ljavax/crypto/spec/SecretKeySpec;

    iget-object v1, p0, Lwa/d;->b:[B

    const-string v2, "AES"

    invoke-direct {v0, v1, v2}, Ljavax/crypto/spec/SecretKeySpec;-><init>([BLjava/lang/String;)V

    :try_start_9
    const-string v1, "AES/CBC/NoPadding"

    invoke-static {v1}, Ljavax/crypto/Cipher;->getInstance(Ljava/lang/String;)Ljavax/crypto/Cipher;

    move-result-object v1

    iput-object v1, p0, Lwa/d;->a:Ljavax/crypto/Cipher;

    const/4 v2, 0x2

    new-instance v3, Ljavax/crypto/spec/IvParameterSpec;

    iget-object v4, p0, Lwa/d;->c:[B

    invoke-direct {v3, v4}, Ljavax/crypto/spec/IvParameterSpec;-><init>([B)V

    invoke-virtual {v1, v2, v0, v3}, Ljavax/crypto/Cipher;->init(ILjava/security/Key;Ljava/security/spec/AlgorithmParameterSpec;)V
    :try_end_1c
    .catch Ljava/security/NoSuchAlgorithmException; {:try_start_9 .. :try_end_1c} :catch_23
    .catch Ljavax/crypto/NoSuchPaddingException; {:try_start_9 .. :try_end_1c} :catch_21
    .catch Ljava/security/InvalidKeyException; {:try_start_9 .. :try_end_1c} :catch_1f
    .catch Ljava/security/InvalidAlgorithmParameterException; {:try_start_9 .. :try_end_1c} :catch_1d

    goto :goto_2e

    :catch_1d
    move-exception v0

    goto :goto_24

    :catch_1f
    move-exception v0

    goto :goto_24

    :catch_21
    move-exception v0

    goto :goto_24

    :catch_23
    move-exception v0

    :goto_24
    new-instance v1, Lwa/d$a;

    invoke-direct {v1, p0, v0}, Lwa/d$a;-><init>(Lwa/d;Ljava/security/GeneralSecurityException;)V

    const-string v0, "LoganParser"

    invoke-static {v0, v1}, Lqa/d;->a(Ljava/lang/String;Lkotlin/jvm/functions/Function0;)V

    :goto_2e
    return-void
.end method

.method public a(Ljava/io/InputStream;Ljava/io/OutputStream;)V
    .registers 16

    const-string v0, "LoganParser"

    new-instance v1, Ljava/io/ByteArrayOutputStream;

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

    const/16 v2, 0x400

    new-array v2, v2, [B

    :goto_b
    :try_start_b
    invoke-virtual {p1, v2}, Ljava/io/InputStream;->read([B)I

    move-result v3

    const/4 v4, 0x0

    if-ltz v3, :cond_19

    invoke-virtual {v1, v2, v4, v3}, Ljava/io/ByteArrayOutputStream;->write([BII)V

    invoke-virtual {v1}, Ljava/io/ByteArrayOutputStream;->flush()V

    goto :goto_b

    :cond_19
    invoke-virtual {v1}, Ljava/io/ByteArrayOutputStream;->toByteArray()[B

    move-result-object p1

    const/4 v1, 0x0

    :goto_1e
    array-length v3, p1

    if-ge v1, v3, :cond_c4

    aget-byte v3, p1, v1

    const/4 v5, 0x1

    if-ne v3, v5, :cond_b8

    add-int/lit8 v1, v1, 0x1

    aget-byte v3, p1, v1

    and-int/lit16 v3, v3, 0xff

    shl-int/lit8 v3, v3, 0x18

    add-int/lit8 v6, v1, 0x1

    aget-byte v6, p1, v6

    and-int/lit16 v6, v6, 0xff

    shl-int/lit8 v6, v6, 0x10

    or-int/2addr v3, v6

    add-int/lit8 v6, v1, 0x2

    aget-byte v6, p1, v6

    and-int/lit16 v6, v6, 0xff

    shl-int/lit8 v6, v6, 0x8

    or-int/2addr v3, v6

    add-int/lit8 v1, v1, 0x3

    aget-byte v6, p1, v1

    and-int/lit16 v6, v6, 0xff

    or-int/2addr v3, v6

    if-lez v3, :cond_b8

    add-int v6, v1, v3

    add-int/lit8 v7, v6, 0x1

    array-length v8, p1

    sub-int/2addr v8, v1

    sub-int/2addr v8, v5

    if-ne v8, v3, :cond_54

    const/4 v8, 0x0

    goto :goto_69

    :cond_54
    array-length v8, p1

    sub-int/2addr v8, v1

    sub-int/2addr v8, v5

    if-le v8, v3, :cond_5f

    aget-byte v8, p1, v7

    if-nez v8, :cond_5f

    const/4 v8, 0x1

    goto :goto_69

    :cond_5f
    array-length v8, p1

    sub-int/2addr v8, v1

    sub-int/2addr v8, v5

    if-le v8, v3, :cond_b6

    aget-byte v8, p1, v7

    if-ne v5, v8, :cond_b6

    const/4 v8, 0x2

    :goto_69
    new-array v9, v3, [B

    add-int/lit8 v1, v1, 0x1

    invoke-static {p1, v1, v9, v4, v3}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V

    new-instance v1, Ljava/io/ByteArrayOutputStream;

    invoke-direct {v1}, Ljava/io/ByteArrayOutputStream;-><init>()V
    :try_end_75
    .catch Ljava/io/IOException; {:try_start_b .. :try_end_75} :catch_bb

    const/4 v3, 0x0

    :try_start_76
    invoke-virtual {v1}, Ljava/io/ByteArrayOutputStream;->reset()V

    new-instance v10, Ljava/util/zip/GZIPInputStream;

    new-instance v11, Ljavax/crypto/CipherInputStream;

    new-instance v12, Ljava/io/ByteArrayInputStream;

    invoke-direct {v12, v9}, Ljava/io/ByteArrayInputStream;-><init>([B)V

    iget-object v9, p0, Lwa/d;->a:Ljavax/crypto/Cipher;

    invoke-direct {v11, v12, v9}, Ljavax/crypto/CipherInputStream;-><init>(Ljava/io/InputStream;Ljavax/crypto/Cipher;)V

    invoke-direct {v10, v11}, Ljava/util/zip/GZIPInputStream;-><init>(Ljava/io/InputStream;)V
    :try_end_8a
    .catch Ljava/lang/Exception; {:try_start_76 .. :try_end_8a} :catch_96

    :goto_8a
    :try_start_8a
    invoke-virtual {v10, v2}, Ljava/util/zip/InflaterInputStream;->read([B)I

    move-result v3

    if-ltz v3, :cond_a1

    invoke-virtual {v1, v2, v4, v3}, Ljava/io/ByteArrayOutputStream;->write([BII)V
    :try_end_93
    .catch Ljava/lang/Exception; {:try_start_8a .. :try_end_93} :catch_94

    goto :goto_8a

    :catch_94
    move-exception v3

    goto :goto_99

    :catch_96
    move-exception v9

    move-object v10, v3

    move-object v3, v9

    :goto_99
    :try_start_99
    new-instance v9, Lwa/d$b;

    invoke-direct {v9, p0, v3}, Lwa/d$b;-><init>(Lwa/d;Ljava/lang/Exception;)V

    invoke-static {v0, v9}, Lqa/d;->a(Ljava/lang/String;Lkotlin/jvm/functions/Function0;)V

    :cond_a1
    invoke-virtual {v1}, Ljava/io/ByteArrayOutputStream;->toByteArray()[B

    move-result-object v3

    invoke-virtual {v1}, Ljava/io/ByteArrayOutputStream;->reset()V

    invoke-virtual {p2, v3}, Ljava/io/OutputStream;->write([B)V

    if-eqz v10, :cond_b0

    invoke-virtual {v10}, Ljava/util/zip/InflaterInputStream;->close()V
    :try_end_b0
    .catch Ljava/io/IOException; {:try_start_99 .. :try_end_b0} :catch_bb

    :cond_b0
    if-ne v8, v5, :cond_b4

    move v1, v7

    goto :goto_b8

    :cond_b4
    move v1, v6

    goto :goto_b8

    :cond_b6
    add-int/lit8 v1, v1, -0x4

    :cond_b8
    :goto_b8
    add-int/2addr v1, v5

    goto/16 :goto_1e

    :catch_bb
    move-exception p1

    new-instance p2, Lwa/d$c;

    invoke-direct {p2, p0, p1}, Lwa/d$c;-><init>(Lwa/d;Ljava/io/IOException;)V

    invoke-static {v0, p2}, Lqa/d;->a(Ljava/lang/String;Lkotlin/jvm/functions/Function0;)V

    :cond_c4
    return-void
.end method