.class public Lcom/moji/encode/Base64;
.super Ljava/lang/Object;
.source "Base64.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/moji/encode/Base64$Encoder;,
        Lcom/moji/encode/Base64$Decoder;,
        Lcom/moji/encode/Base64$Coder;
    }
.end annotation


# static fields
.field static final synthetic a:Z


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

    .line 29
    const-class v0, Lcom/moji/encode/Base64;

    invoke-virtual {v0}, Ljava/lang/Class;->desiredAssertionStatus()Z

    move-result v0

    xor-int/lit8 v0, v0, 0x1

    sput-boolean v0, Lcom/moji/encode/Base64;->a:Z

    return-void
.end method

.method private constructor <init>()V
    .locals 0

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

    return-void
.end method

.method public static a(Ljava/lang/String;I)[B
    .locals 1

    const-string v0, "UTF-8"

    .line 120
    invoke-static {v0}, Ljava/nio/charset/Charset;->forName(Ljava/lang/String;)Ljava/nio/charset/Charset;

    move-result-object v0

    invoke-virtual {p0, v0}, Ljava/lang/String;->getBytes(Ljava/nio/charset/Charset;)[B

    move-result-object p0

    invoke-static {p0, p1}, Lcom/moji/encode/Base64;->a([BI)[B

    move-result-object p0

    return-object p0
.end method

.method public static a([BI)[B
    .locals 2

    .line 138
    array-length v0, p0

    const/4 v1, 0x0

    invoke-static {p0, v1, v0, p1}, Lcom/moji/encode/Base64;->a([BIII)[B

    move-result-object p0

    return-object p0
.end method

.method public static a([BIII)[B
    .locals 2

    .line 160
    new-instance v0, Lcom/moji/encode/Base64$Decoder;

    mul-int/lit8 v1, p2, 0x3

    div-int/lit8 v1, v1, 0x4

    new-array v1, v1, [B

    invoke-direct {v0, p3, v1}, Lcom/moji/encode/Base64$Decoder;-><init>(I[B)V

    const/4 p3, 0x1

    .line 162
    invoke-virtual {v0, p0, p1, p2, p3}, Lcom/moji/encode/Base64$Decoder;->a([BIIZ)Z

    move-result p0

    if-eqz p0, :cond_1

    .line 167
    iget p0, v0, Lcom/moji/encode/Base64$Decoder;->b:I

    iget-object p1, v0, Lcom/moji/encode/Base64$Decoder;->a:[B

    array-length p1, p1

    if-ne p0, p1, :cond_0

    .line 168
    iget-object p0, v0, Lcom/moji/encode/Base64$Decoder;->a:[B

    return-object p0

    .line 173
    :cond_0
    iget p0, v0, Lcom/moji/encode/Base64$Decoder;->b:I

    new-array p0, p0, [B

    .line 174
    iget-object p1, v0, Lcom/moji/encode/Base64$Decoder;->a:[B

    iget p2, v0, Lcom/moji/encode/Base64$Decoder;->b:I

    const/4 p3, 0x0

    invoke-static {p1, p3, p0, p3, p2}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V

    return-object p0

    .line 163
    :cond_1
    new-instance p0, Ljava/lang/IllegalArgumentException;

    const-string p1, "bad base-64"

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

    throw p0
.end method

.method public static b([BI)Ljava/lang/String;
    .locals 1

    .line 458
    :try_start_0
    new-instance v0, Ljava/lang/String;

    invoke-static {p0, p1}, Lcom/moji/encode/Base64;->c([BI)[B

    move-result-object p0

    const-string p1, "US-ASCII"

    invoke-direct {v0, p0, p1}, Ljava/lang/String;-><init>([BLjava/lang/String;)V
    :try_end_0
    .catch Ljava/io/UnsupportedEncodingException; {:try_start_0 .. :try_end_0} :catch_0

    return-object v0

    :catch_0
    move-exception p0

    .line 461
    new-instance p1, Ljava/lang/AssertionError;

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

    throw p1
.end method

.method public static b([BIII)[B
    .locals 4

    .line 512
    new-instance v0, Lcom/moji/encode/Base64$Encoder;

    const/4 v1, 0x0

    invoke-direct {v0, p3, v1}, Lcom/moji/encode/Base64$Encoder;-><init>(I[B)V

    .line 515
    div-int/lit8 p3, p2, 0x3

    mul-int/lit8 p3, p3, 0x4

    .line 518
    iget-boolean v1, v0, Lcom/moji/encode/Base64$Encoder;->d:Z

    if-eqz v1, :cond_0

    .line 519
    rem-int/lit8 v1, p2, 0x3

    if-lez v1, :cond_1

    add-int/lit8 p3, p3, 0x4

    goto :goto_0

    .line 523
    :cond_0
    rem-int/lit8 v1, p2, 0x3

    packed-switch v1, :pswitch_data_0

    goto :goto_0

    :pswitch_0
    add-int/lit8 p3, p3, 0x3

    goto :goto_0

    :pswitch_1
    add-int/lit8 p3, p3, 0x2

    .line 531
    :cond_1
    :goto_0
    :pswitch_2
    iget-boolean v1, v0, Lcom/moji/encode/Base64$Encoder;->e:Z

    const/4 v2, 0x1

    if-eqz v1, :cond_3

    if-lez p2, :cond_3

    add-int/lit8 v1, p2, -0x1

    .line 532
    div-int/lit8 v1, v1, 0x39

    add-int/2addr v1, v2

    iget-boolean v3, v0, Lcom/moji/encode/Base64$Encoder;->f:Z

    if-eqz v3, :cond_2

    const/4 v3, 0x2

    goto :goto_1

    :cond_2
    const/4 v3, 0x1

    :goto_1
    mul-int v1, v1, v3

    add-int/2addr p3, v1

    .line 536
    :cond_3
    new-array v1, p3, [B

    iput-object v1, v0, Lcom/moji/encode/Base64$Encoder;->a:[B

    .line 537
    invoke-virtual {v0, p0, p1, p2, v2}, Lcom/moji/encode/Base64$Encoder;->a([BIIZ)Z

    .line 539
    sget-boolean p0, Lcom/moji/encode/Base64;->a:Z

    if-nez p0, :cond_5

    iget p0, v0, Lcom/moji/encode/Base64$Encoder;->b:I

    if-ne p0, p3, :cond_4

    goto :goto_2

    :cond_4
    new-instance p0, Ljava/lang/AssertionError;

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

    throw p0

    .line 541
    :cond_5
    :goto_2
    iget-object p0, v0, Lcom/moji/encode/Base64$Encoder;->a:[B

    return-object p0

    nop

    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_2
        :pswitch_1
        :pswitch_0
    .end packed-switch
.end method

.method public static c([BI)[B
    .locals 2

    .line 496
    array-length v0, p0

    const/4 v1, 0x0

    invoke-static {p0, v1, v0, p1}, Lcom/moji/encode/Base64;->b([BIII)[B

    move-result-object p0

    return-object p0
.end method
