2367 lines
48 KiB
Smali
2367 lines
48 KiB
Smali
.class public final Lcom/google/zxing/qrcode/encoder/Encoder;
|
|
.super Ljava/lang/Object;
|
|
.source "Encoder.java"
|
|
|
|
|
|
# static fields
|
|
.field private static synthetic $SWITCH_TABLE$com$google$zxing$qrcode$decoder$Mode:[I = null
|
|
|
|
.field private static final ALPHANUMERIC_TABLE:[I
|
|
|
|
.field public static final DEFAULT_BYTE_MODE_ENCODING:Ljava/lang/String; = "ISO-8859-1"
|
|
|
|
|
|
# direct methods
|
|
.method public static synthetic $SWITCH_TABLE$com$google$zxing$qrcode$decoder$Mode()[I
|
|
.locals 3
|
|
|
|
.line 1
|
|
sget-object v0, Lcom/google/zxing/qrcode/encoder/Encoder;->$SWITCH_TABLE$com$google$zxing$qrcode$decoder$Mode:[I
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
return-object v0
|
|
|
|
:cond_0
|
|
invoke-static {}, Lcom/google/zxing/qrcode/decoder/Mode;->values()[Lcom/google/zxing/qrcode/decoder/Mode;
|
|
|
|
move-result-object v0
|
|
|
|
array-length v0, v0
|
|
|
|
new-array v0, v0, [I
|
|
|
|
:try_start_0
|
|
sget-object v1, Lcom/google/zxing/qrcode/decoder/Mode;->ALPHANUMERIC:Lcom/google/zxing/qrcode/decoder/Mode;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/Enum;->ordinal()I
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, 0x3
|
|
|
|
aput v2, v0, v1
|
|
:try_end_0
|
|
.catch Ljava/lang/NoSuchFieldError; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
:catch_0
|
|
:try_start_1
|
|
sget-object v1, Lcom/google/zxing/qrcode/decoder/Mode;->BYTE:Lcom/google/zxing/qrcode/decoder/Mode;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/Enum;->ordinal()I
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, 0x5
|
|
|
|
aput v2, v0, v1
|
|
:try_end_1
|
|
.catch Ljava/lang/NoSuchFieldError; {:try_start_1 .. :try_end_1} :catch_1
|
|
|
|
:catch_1
|
|
:try_start_2
|
|
sget-object v1, Lcom/google/zxing/qrcode/decoder/Mode;->ECI:Lcom/google/zxing/qrcode/decoder/Mode;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/Enum;->ordinal()I
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, 0x6
|
|
|
|
aput v2, v0, v1
|
|
:try_end_2
|
|
.catch Ljava/lang/NoSuchFieldError; {:try_start_2 .. :try_end_2} :catch_2
|
|
|
|
:catch_2
|
|
:try_start_3
|
|
sget-object v1, Lcom/google/zxing/qrcode/decoder/Mode;->FNC1_FIRST_POSITION:Lcom/google/zxing/qrcode/decoder/Mode;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/Enum;->ordinal()I
|
|
|
|
move-result v1
|
|
|
|
const/16 v2, 0x8
|
|
|
|
aput v2, v0, v1
|
|
:try_end_3
|
|
.catch Ljava/lang/NoSuchFieldError; {:try_start_3 .. :try_end_3} :catch_3
|
|
|
|
:catch_3
|
|
:try_start_4
|
|
sget-object v1, Lcom/google/zxing/qrcode/decoder/Mode;->FNC1_SECOND_POSITION:Lcom/google/zxing/qrcode/decoder/Mode;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/Enum;->ordinal()I
|
|
|
|
move-result v1
|
|
|
|
const/16 v2, 0x9
|
|
|
|
aput v2, v0, v1
|
|
:try_end_4
|
|
.catch Ljava/lang/NoSuchFieldError; {:try_start_4 .. :try_end_4} :catch_4
|
|
|
|
:catch_4
|
|
:try_start_5
|
|
sget-object v1, Lcom/google/zxing/qrcode/decoder/Mode;->HANZI:Lcom/google/zxing/qrcode/decoder/Mode;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/Enum;->ordinal()I
|
|
|
|
move-result v1
|
|
|
|
const/16 v2, 0xa
|
|
|
|
aput v2, v0, v1
|
|
:try_end_5
|
|
.catch Ljava/lang/NoSuchFieldError; {:try_start_5 .. :try_end_5} :catch_5
|
|
|
|
:catch_5
|
|
:try_start_6
|
|
sget-object v1, Lcom/google/zxing/qrcode/decoder/Mode;->KANJI:Lcom/google/zxing/qrcode/decoder/Mode;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/Enum;->ordinal()I
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, 0x7
|
|
|
|
aput v2, v0, v1
|
|
:try_end_6
|
|
.catch Ljava/lang/NoSuchFieldError; {:try_start_6 .. :try_end_6} :catch_6
|
|
|
|
:catch_6
|
|
:try_start_7
|
|
sget-object v1, Lcom/google/zxing/qrcode/decoder/Mode;->NUMERIC:Lcom/google/zxing/qrcode/decoder/Mode;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/Enum;->ordinal()I
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, 0x2
|
|
|
|
aput v2, v0, v1
|
|
:try_end_7
|
|
.catch Ljava/lang/NoSuchFieldError; {:try_start_7 .. :try_end_7} :catch_7
|
|
|
|
:catch_7
|
|
:try_start_8
|
|
sget-object v1, Lcom/google/zxing/qrcode/decoder/Mode;->STRUCTURED_APPEND:Lcom/google/zxing/qrcode/decoder/Mode;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/Enum;->ordinal()I
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, 0x4
|
|
|
|
aput v2, v0, v1
|
|
:try_end_8
|
|
.catch Ljava/lang/NoSuchFieldError; {:try_start_8 .. :try_end_8} :catch_8
|
|
|
|
:catch_8
|
|
:try_start_9
|
|
sget-object v1, Lcom/google/zxing/qrcode/decoder/Mode;->TERMINATOR:Lcom/google/zxing/qrcode/decoder/Mode;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/Enum;->ordinal()I
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, 0x1
|
|
|
|
aput v2, v0, v1
|
|
:try_end_9
|
|
.catch Ljava/lang/NoSuchFieldError; {:try_start_9 .. :try_end_9} :catch_9
|
|
|
|
:catch_9
|
|
sput-object v0, Lcom/google/zxing/qrcode/encoder/Encoder;->$SWITCH_TABLE$com$google$zxing$qrcode$decoder$Mode:[I
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static constructor <clinit>()V
|
|
.locals 25
|
|
|
|
const/16 v0, 0x60
|
|
|
|
new-array v0, v0, [I
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const/4 v2, -0x1
|
|
|
|
aput v2, v0, v1
|
|
|
|
const/4 v1, 0x1
|
|
|
|
aput v2, v0, v1
|
|
|
|
const/4 v3, 0x2
|
|
|
|
aput v2, v0, v3
|
|
|
|
const/4 v4, 0x3
|
|
|
|
aput v2, v0, v4
|
|
|
|
const/4 v5, 0x4
|
|
|
|
aput v2, v0, v5
|
|
|
|
const/4 v6, 0x5
|
|
|
|
aput v2, v0, v6
|
|
|
|
const/4 v7, 0x6
|
|
|
|
aput v2, v0, v7
|
|
|
|
const/4 v8, 0x7
|
|
|
|
aput v2, v0, v8
|
|
|
|
const/16 v9, 0x8
|
|
|
|
aput v2, v0, v9
|
|
|
|
const/16 v10, 0x9
|
|
|
|
aput v2, v0, v10
|
|
|
|
const/16 v11, 0xa
|
|
|
|
aput v2, v0, v11
|
|
|
|
const/16 v12, 0xb
|
|
|
|
aput v2, v0, v12
|
|
|
|
const/16 v13, 0xc
|
|
|
|
aput v2, v0, v13
|
|
|
|
const/16 v14, 0xd
|
|
|
|
aput v2, v0, v14
|
|
|
|
const/16 v15, 0xe
|
|
|
|
aput v2, v0, v15
|
|
|
|
const/16 v16, 0xf
|
|
|
|
aput v2, v0, v16
|
|
|
|
const/16 v17, 0x10
|
|
|
|
aput v2, v0, v17
|
|
|
|
const/16 v18, 0x11
|
|
|
|
aput v2, v0, v18
|
|
|
|
const/16 v19, 0x12
|
|
|
|
aput v2, v0, v19
|
|
|
|
const/16 v20, 0x13
|
|
|
|
aput v2, v0, v20
|
|
|
|
const/16 v21, 0x14
|
|
|
|
aput v2, v0, v21
|
|
|
|
const/16 v22, 0x15
|
|
|
|
aput v2, v0, v22
|
|
|
|
const/16 v23, 0x16
|
|
|
|
aput v2, v0, v23
|
|
|
|
const/16 v23, 0x17
|
|
|
|
aput v2, v0, v23
|
|
|
|
const/16 v23, 0x18
|
|
|
|
aput v2, v0, v23
|
|
|
|
const/16 v23, 0x19
|
|
|
|
aput v2, v0, v23
|
|
|
|
const/16 v23, 0x1a
|
|
|
|
aput v2, v0, v23
|
|
|
|
const/16 v23, 0x1b
|
|
|
|
aput v2, v0, v23
|
|
|
|
const/16 v23, 0x1c
|
|
|
|
aput v2, v0, v23
|
|
|
|
const/16 v23, 0x1d
|
|
|
|
aput v2, v0, v23
|
|
|
|
const/16 v23, 0x1e
|
|
|
|
aput v2, v0, v23
|
|
|
|
const/16 v23, 0x1f
|
|
|
|
aput v2, v0, v23
|
|
|
|
const/16 v23, 0x20
|
|
|
|
const/16 v24, 0x24
|
|
|
|
aput v24, v0, v23
|
|
|
|
const/16 v23, 0x21
|
|
|
|
aput v2, v0, v23
|
|
|
|
const/16 v23, 0x22
|
|
|
|
aput v2, v0, v23
|
|
|
|
const/16 v23, 0x23
|
|
|
|
aput v2, v0, v23
|
|
|
|
const/16 v23, 0x24
|
|
|
|
const/16 v24, 0x25
|
|
|
|
aput v24, v0, v23
|
|
|
|
const/16 v23, 0x25
|
|
|
|
const/16 v24, 0x26
|
|
|
|
aput v24, v0, v23
|
|
|
|
const/16 v23, 0x26
|
|
|
|
aput v2, v0, v23
|
|
|
|
const/16 v23, 0x27
|
|
|
|
aput v2, v0, v23
|
|
|
|
const/16 v23, 0x28
|
|
|
|
aput v2, v0, v23
|
|
|
|
const/16 v23, 0x29
|
|
|
|
aput v2, v0, v23
|
|
|
|
const/16 v23, 0x2a
|
|
|
|
const/16 v24, 0x27
|
|
|
|
aput v24, v0, v23
|
|
|
|
const/16 v23, 0x2b
|
|
|
|
const/16 v24, 0x28
|
|
|
|
aput v24, v0, v23
|
|
|
|
const/16 v23, 0x2c
|
|
|
|
aput v2, v0, v23
|
|
|
|
const/16 v23, 0x2d
|
|
|
|
const/16 v24, 0x29
|
|
|
|
aput v24, v0, v23
|
|
|
|
const/16 v23, 0x2e
|
|
|
|
const/16 v24, 0x2a
|
|
|
|
aput v24, v0, v23
|
|
|
|
const/16 v23, 0x2f
|
|
|
|
const/16 v24, 0x2b
|
|
|
|
aput v24, v0, v23
|
|
|
|
const/16 v23, 0x31
|
|
|
|
aput v1, v0, v23
|
|
|
|
const/16 v1, 0x32
|
|
|
|
aput v3, v0, v1
|
|
|
|
const/16 v1, 0x33
|
|
|
|
aput v4, v0, v1
|
|
|
|
const/16 v1, 0x34
|
|
|
|
aput v5, v0, v1
|
|
|
|
const/16 v1, 0x35
|
|
|
|
aput v6, v0, v1
|
|
|
|
const/16 v1, 0x36
|
|
|
|
aput v7, v0, v1
|
|
|
|
const/16 v1, 0x37
|
|
|
|
aput v8, v0, v1
|
|
|
|
const/16 v1, 0x38
|
|
|
|
aput v9, v0, v1
|
|
|
|
const/16 v1, 0x39
|
|
|
|
aput v10, v0, v1
|
|
|
|
const/16 v1, 0x3a
|
|
|
|
const/16 v3, 0x2c
|
|
|
|
aput v3, v0, v1
|
|
|
|
const/16 v1, 0x3b
|
|
|
|
aput v2, v0, v1
|
|
|
|
const/16 v1, 0x3c
|
|
|
|
aput v2, v0, v1
|
|
|
|
const/16 v1, 0x3d
|
|
|
|
aput v2, v0, v1
|
|
|
|
const/16 v1, 0x3e
|
|
|
|
aput v2, v0, v1
|
|
|
|
const/16 v1, 0x3f
|
|
|
|
aput v2, v0, v1
|
|
|
|
const/16 v1, 0x40
|
|
|
|
aput v2, v0, v1
|
|
|
|
const/16 v1, 0x41
|
|
|
|
aput v11, v0, v1
|
|
|
|
const/16 v1, 0x42
|
|
|
|
aput v12, v0, v1
|
|
|
|
const/16 v1, 0x43
|
|
|
|
aput v13, v0, v1
|
|
|
|
const/16 v1, 0x44
|
|
|
|
aput v14, v0, v1
|
|
|
|
const/16 v1, 0x45
|
|
|
|
aput v15, v0, v1
|
|
|
|
const/16 v1, 0x46
|
|
|
|
aput v16, v0, v1
|
|
|
|
const/16 v1, 0x47
|
|
|
|
aput v17, v0, v1
|
|
|
|
const/16 v1, 0x48
|
|
|
|
aput v18, v0, v1
|
|
|
|
const/16 v1, 0x49
|
|
|
|
aput v19, v0, v1
|
|
|
|
const/16 v1, 0x4a
|
|
|
|
aput v20, v0, v1
|
|
|
|
const/16 v1, 0x4b
|
|
|
|
aput v21, v0, v1
|
|
|
|
const/16 v1, 0x4c
|
|
|
|
aput v22, v0, v1
|
|
|
|
const/16 v1, 0x4d
|
|
|
|
const/16 v3, 0x16
|
|
|
|
aput v3, v0, v1
|
|
|
|
const/16 v1, 0x4e
|
|
|
|
const/16 v3, 0x17
|
|
|
|
aput v3, v0, v1
|
|
|
|
const/16 v1, 0x4f
|
|
|
|
const/16 v3, 0x18
|
|
|
|
aput v3, v0, v1
|
|
|
|
const/16 v1, 0x50
|
|
|
|
const/16 v3, 0x19
|
|
|
|
aput v3, v0, v1
|
|
|
|
const/16 v1, 0x51
|
|
|
|
const/16 v3, 0x1a
|
|
|
|
aput v3, v0, v1
|
|
|
|
const/16 v1, 0x52
|
|
|
|
const/16 v3, 0x1b
|
|
|
|
aput v3, v0, v1
|
|
|
|
const/16 v1, 0x53
|
|
|
|
const/16 v3, 0x1c
|
|
|
|
aput v3, v0, v1
|
|
|
|
const/16 v1, 0x54
|
|
|
|
const/16 v3, 0x1d
|
|
|
|
aput v3, v0, v1
|
|
|
|
const/16 v1, 0x55
|
|
|
|
const/16 v3, 0x1e
|
|
|
|
aput v3, v0, v1
|
|
|
|
const/16 v1, 0x56
|
|
|
|
const/16 v3, 0x1f
|
|
|
|
aput v3, v0, v1
|
|
|
|
const/16 v1, 0x57
|
|
|
|
const/16 v3, 0x20
|
|
|
|
aput v3, v0, v1
|
|
|
|
const/16 v1, 0x58
|
|
|
|
const/16 v3, 0x21
|
|
|
|
aput v3, v0, v1
|
|
|
|
const/16 v1, 0x59
|
|
|
|
const/16 v3, 0x22
|
|
|
|
aput v3, v0, v1
|
|
|
|
const/16 v1, 0x5a
|
|
|
|
const/16 v3, 0x23
|
|
|
|
aput v3, v0, v1
|
|
|
|
const/16 v1, 0x5b
|
|
|
|
aput v2, v0, v1
|
|
|
|
const/16 v1, 0x5c
|
|
|
|
aput v2, v0, v1
|
|
|
|
const/16 v1, 0x5d
|
|
|
|
aput v2, v0, v1
|
|
|
|
const/16 v1, 0x5e
|
|
|
|
aput v2, v0, v1
|
|
|
|
const/16 v1, 0x5f
|
|
|
|
aput v2, v0, v1
|
|
|
|
.line 1
|
|
sput-object v0, Lcom/google/zxing/qrcode/encoder/Encoder;->ALPHANUMERIC_TABLE:[I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private constructor <init>()V
|
|
.locals 0
|
|
|
|
.line 1
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static append8BitBytes(Ljava/lang/String;Lcom/google/zxing/common/BitArray;Ljava/lang/String;)V
|
|
.locals 3
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Lcom/google/zxing/WriterException;
|
|
}
|
|
.end annotation
|
|
|
|
.line 1
|
|
:try_start_0
|
|
invoke-virtual {p0, p2}, Ljava/lang/String;->getBytes(Ljava/lang/String;)[B
|
|
|
|
move-result-object p0
|
|
:try_end_0
|
|
.catch Ljava/io/UnsupportedEncodingException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
.line 2
|
|
array-length p2, p0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
if-lt v0, p2, :cond_0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
aget-byte v1, p0, v0
|
|
|
|
const/16 v2, 0x8
|
|
|
|
.line 3
|
|
invoke-virtual {p1, v1, v2}, Lcom/google/zxing/common/BitArray;->appendBits(II)V
|
|
|
|
add-int/lit8 v0, v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
move-exception p0
|
|
|
|
.line 4
|
|
new-instance p1, Lcom/google/zxing/WriterException;
|
|
|
|
invoke-direct {p1, p0}, Lcom/google/zxing/WriterException;-><init>(Ljava/lang/Throwable;)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public static appendAlphanumericBytes(Ljava/lang/CharSequence;Lcom/google/zxing/common/BitArray;)V
|
|
.locals 5
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Lcom/google/zxing/WriterException;
|
|
}
|
|
.end annotation
|
|
|
|
.line 1
|
|
invoke-interface {p0}, Ljava/lang/CharSequence;->length()I
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
:goto_0
|
|
if-lt v1, v0, :cond_0
|
|
|
|
return-void
|
|
|
|
.line 2
|
|
:cond_0
|
|
invoke-interface {p0, v1}, Ljava/lang/CharSequence;->charAt(I)C
|
|
|
|
move-result v2
|
|
|
|
invoke-static {v2}, Lcom/google/zxing/qrcode/encoder/Encoder;->getAlphanumericCode(I)I
|
|
|
|
move-result v2
|
|
|
|
const/4 v3, -0x1
|
|
|
|
if-eq v2, v3, :cond_3
|
|
|
|
add-int/lit8 v4, v1, 0x1
|
|
|
|
if-ge v4, v0, :cond_2
|
|
|
|
.line 3
|
|
invoke-interface {p0, v4}, Ljava/lang/CharSequence;->charAt(I)C
|
|
|
|
move-result v4
|
|
|
|
invoke-static {v4}, Lcom/google/zxing/qrcode/encoder/Encoder;->getAlphanumericCode(I)I
|
|
|
|
move-result v4
|
|
|
|
if-eq v4, v3, :cond_1
|
|
|
|
mul-int/lit8 v2, v2, 0x2d
|
|
|
|
add-int/2addr v2, v4
|
|
|
|
const/16 v3, 0xb
|
|
|
|
.line 4
|
|
invoke-virtual {p1, v2, v3}, Lcom/google/zxing/common/BitArray;->appendBits(II)V
|
|
|
|
add-int/lit8 v1, v1, 0x2
|
|
|
|
goto :goto_0
|
|
|
|
.line 5
|
|
:cond_1
|
|
new-instance p0, Lcom/google/zxing/WriterException;
|
|
|
|
invoke-direct {p0}, Lcom/google/zxing/WriterException;-><init>()V
|
|
|
|
throw p0
|
|
|
|
:cond_2
|
|
const/4 v1, 0x6
|
|
|
|
.line 6
|
|
invoke-virtual {p1, v2, v1}, Lcom/google/zxing/common/BitArray;->appendBits(II)V
|
|
|
|
move v1, v4
|
|
|
|
goto :goto_0
|
|
|
|
.line 7
|
|
:cond_3
|
|
new-instance p0, Lcom/google/zxing/WriterException;
|
|
|
|
invoke-direct {p0}, Lcom/google/zxing/WriterException;-><init>()V
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
.method public static appendBytes(Ljava/lang/String;Lcom/google/zxing/qrcode/decoder/Mode;Lcom/google/zxing/common/BitArray;Ljava/lang/String;)V
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Lcom/google/zxing/WriterException;
|
|
}
|
|
.end annotation
|
|
|
|
.line 1
|
|
invoke-static {}, Lcom/google/zxing/qrcode/encoder/Encoder;->$SWITCH_TABLE$com$google$zxing$qrcode$decoder$Mode()[I
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Enum;->ordinal()I
|
|
|
|
move-result v1
|
|
|
|
aget v0, v0, v1
|
|
|
|
const/4 v1, 0x2
|
|
|
|
if-eq v0, v1, :cond_3
|
|
|
|
const/4 v1, 0x3
|
|
|
|
if-eq v0, v1, :cond_2
|
|
|
|
const/4 v1, 0x5
|
|
|
|
if-eq v0, v1, :cond_1
|
|
|
|
const/4 p3, 0x7
|
|
|
|
if-ne v0, p3, :cond_0
|
|
|
|
.line 2
|
|
invoke-static {p0, p2}, Lcom/google/zxing/qrcode/encoder/Encoder;->appendKanjiBytes(Ljava/lang/String;Lcom/google/zxing/common/BitArray;)V
|
|
|
|
goto :goto_0
|
|
|
|
.line 3
|
|
:cond_0
|
|
new-instance p0, Lcom/google/zxing/WriterException;
|
|
|
|
new-instance p2, Ljava/lang/StringBuilder;
|
|
|
|
const-string p3, "Invalid mode: "
|
|
|
|
invoke-direct {p2, p3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p0, p1}, Lcom/google/zxing/WriterException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
|
|
.line 4
|
|
:cond_1
|
|
invoke-static {p0, p2, p3}, Lcom/google/zxing/qrcode/encoder/Encoder;->append8BitBytes(Ljava/lang/String;Lcom/google/zxing/common/BitArray;Ljava/lang/String;)V
|
|
|
|
goto :goto_0
|
|
|
|
.line 5
|
|
:cond_2
|
|
invoke-static {p0, p2}, Lcom/google/zxing/qrcode/encoder/Encoder;->appendAlphanumericBytes(Ljava/lang/CharSequence;Lcom/google/zxing/common/BitArray;)V
|
|
|
|
goto :goto_0
|
|
|
|
.line 6
|
|
:cond_3
|
|
invoke-static {p0, p2}, Lcom/google/zxing/qrcode/encoder/Encoder;->appendNumericBytes(Ljava/lang/CharSequence;Lcom/google/zxing/common/BitArray;)V
|
|
|
|
:goto_0
|
|
return-void
|
|
.end method
|
|
|
|
.method private static appendECI(Lcom/google/zxing/common/CharacterSetECI;Lcom/google/zxing/common/BitArray;)V
|
|
.locals 2
|
|
|
|
.line 1
|
|
sget-object v0, Lcom/google/zxing/qrcode/decoder/Mode;->ECI:Lcom/google/zxing/qrcode/decoder/Mode;
|
|
|
|
invoke-virtual {v0}, Lcom/google/zxing/qrcode/decoder/Mode;->getBits()I
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x4
|
|
|
|
invoke-virtual {p1, v0, v1}, Lcom/google/zxing/common/BitArray;->appendBits(II)V
|
|
|
|
.line 2
|
|
invoke-virtual {p0}, Lcom/google/zxing/common/CharacterSetECI;->getValue()I
|
|
|
|
move-result p0
|
|
|
|
const/16 v0, 0x8
|
|
|
|
invoke-virtual {p1, p0, v0}, Lcom/google/zxing/common/BitArray;->appendBits(II)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static appendKanjiBytes(Ljava/lang/String;Lcom/google/zxing/common/BitArray;)V
|
|
.locals 6
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Lcom/google/zxing/WriterException;
|
|
}
|
|
.end annotation
|
|
|
|
:try_start_0
|
|
const-string v0, "Shift_JIS"
|
|
|
|
.line 1
|
|
invoke-virtual {p0, v0}, Ljava/lang/String;->getBytes(Ljava/lang/String;)[B
|
|
|
|
move-result-object p0
|
|
:try_end_0
|
|
.catch Ljava/io/UnsupportedEncodingException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
.line 2
|
|
array-length v0, p0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
:goto_0
|
|
if-lt v1, v0, :cond_0
|
|
|
|
return-void
|
|
|
|
.line 3
|
|
:cond_0
|
|
aget-byte v2, p0, v1
|
|
|
|
and-int/lit16 v2, v2, 0xff
|
|
|
|
add-int/lit8 v3, v1, 0x1
|
|
|
|
.line 4
|
|
aget-byte v3, p0, v3
|
|
|
|
and-int/lit16 v3, v3, 0xff
|
|
|
|
shl-int/lit8 v2, v2, 0x8
|
|
|
|
or-int/2addr v2, v3
|
|
|
|
const v3, 0x8140
|
|
|
|
const/4 v4, -0x1
|
|
|
|
if-lt v2, v3, :cond_1
|
|
|
|
const v5, 0x9ffc
|
|
|
|
if-gt v2, v5, :cond_1
|
|
|
|
:goto_1
|
|
sub-int/2addr v2, v3
|
|
|
|
goto :goto_2
|
|
|
|
:cond_1
|
|
const v3, 0xe040
|
|
|
|
if-lt v2, v3, :cond_2
|
|
|
|
const v3, 0xebbf
|
|
|
|
if-gt v2, v3, :cond_2
|
|
|
|
const v3, 0xc140
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
move v2, v4
|
|
|
|
:goto_2
|
|
if-eq v2, v4, :cond_3
|
|
|
|
shr-int/lit8 v3, v2, 0x8
|
|
|
|
mul-int/lit16 v3, v3, 0xc0
|
|
|
|
and-int/lit16 v2, v2, 0xff
|
|
|
|
add-int/2addr v3, v2
|
|
|
|
const/16 v2, 0xd
|
|
|
|
.line 5
|
|
invoke-virtual {p1, v3, v2}, Lcom/google/zxing/common/BitArray;->appendBits(II)V
|
|
|
|
add-int/lit8 v1, v1, 0x2
|
|
|
|
goto :goto_0
|
|
|
|
.line 6
|
|
:cond_3
|
|
new-instance p0, Lcom/google/zxing/WriterException;
|
|
|
|
const-string p1, "Invalid byte sequence"
|
|
|
|
invoke-direct {p0, p1}, Lcom/google/zxing/WriterException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
|
|
:catch_0
|
|
move-exception p0
|
|
|
|
.line 7
|
|
new-instance p1, Lcom/google/zxing/WriterException;
|
|
|
|
invoke-direct {p1, p0}, Lcom/google/zxing/WriterException;-><init>(Ljava/lang/Throwable;)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public static appendLengthInfo(ILcom/google/zxing/qrcode/decoder/Version;Lcom/google/zxing/qrcode/decoder/Mode;Lcom/google/zxing/common/BitArray;)V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Lcom/google/zxing/WriterException;
|
|
}
|
|
.end annotation
|
|
|
|
.line 1
|
|
invoke-virtual {p2, p1}, Lcom/google/zxing/qrcode/decoder/Mode;->getCharacterCountBits(Lcom/google/zxing/qrcode/decoder/Version;)I
|
|
|
|
move-result p1
|
|
|
|
const/4 p2, 0x1
|
|
|
|
shl-int v0, p2, p1
|
|
|
|
if-ge p0, v0, :cond_0
|
|
|
|
.line 2
|
|
invoke-virtual {p3, p0, p1}, Lcom/google/zxing/common/BitArray;->appendBits(II)V
|
|
|
|
return-void
|
|
|
|
.line 3
|
|
:cond_0
|
|
new-instance p1, Lcom/google/zxing/WriterException;
|
|
|
|
new-instance p3, Ljava/lang/StringBuilder;
|
|
|
|
invoke-static {p0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-direct {p3, p0}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
const-string p0, " is bigger than "
|
|
|
|
invoke-virtual {p3, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
sub-int/2addr v0, p2
|
|
|
|
invoke-virtual {p3, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-direct {p1, p0}, Lcom/google/zxing/WriterException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public static appendModeInfo(Lcom/google/zxing/qrcode/decoder/Mode;Lcom/google/zxing/common/BitArray;)V
|
|
.locals 1
|
|
|
|
.line 1
|
|
invoke-virtual {p0}, Lcom/google/zxing/qrcode/decoder/Mode;->getBits()I
|
|
|
|
move-result p0
|
|
|
|
const/4 v0, 0x4
|
|
|
|
invoke-virtual {p1, p0, v0}, Lcom/google/zxing/common/BitArray;->appendBits(II)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static appendNumericBytes(Ljava/lang/CharSequence;Lcom/google/zxing/common/BitArray;)V
|
|
.locals 6
|
|
|
|
.line 1
|
|
invoke-interface {p0}, Ljava/lang/CharSequence;->length()I
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
:goto_0
|
|
if-lt v1, v0, :cond_0
|
|
|
|
return-void
|
|
|
|
.line 2
|
|
:cond_0
|
|
invoke-interface {p0, v1}, Ljava/lang/CharSequence;->charAt(I)C
|
|
|
|
move-result v2
|
|
|
|
add-int/lit8 v2, v2, -0x30
|
|
|
|
add-int/lit8 v3, v1, 0x2
|
|
|
|
if-ge v3, v0, :cond_1
|
|
|
|
add-int/lit8 v4, v1, 0x1
|
|
|
|
.line 3
|
|
invoke-interface {p0, v4}, Ljava/lang/CharSequence;->charAt(I)C
|
|
|
|
move-result v4
|
|
|
|
add-int/lit8 v4, v4, -0x30
|
|
|
|
.line 4
|
|
invoke-interface {p0, v3}, Ljava/lang/CharSequence;->charAt(I)C
|
|
|
|
move-result v3
|
|
|
|
add-int/lit8 v3, v3, -0x30
|
|
|
|
mul-int/lit8 v2, v2, 0x64
|
|
|
|
const/16 v5, 0xa
|
|
|
|
mul-int/2addr v4, v5
|
|
|
|
add-int/2addr v4, v2
|
|
|
|
add-int/2addr v4, v3
|
|
|
|
.line 5
|
|
invoke-virtual {p1, v4, v5}, Lcom/google/zxing/common/BitArray;->appendBits(II)V
|
|
|
|
add-int/lit8 v1, v1, 0x3
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
add-int/lit8 v1, v1, 0x1
|
|
|
|
if-ge v1, v0, :cond_2
|
|
|
|
.line 6
|
|
invoke-interface {p0, v1}, Ljava/lang/CharSequence;->charAt(I)C
|
|
|
|
move-result v1
|
|
|
|
add-int/lit8 v1, v1, -0x30
|
|
|
|
mul-int/lit8 v2, v2, 0xa
|
|
|
|
add-int/2addr v2, v1
|
|
|
|
const/4 v1, 0x7
|
|
|
|
.line 7
|
|
invoke-virtual {p1, v2, v1}, Lcom/google/zxing/common/BitArray;->appendBits(II)V
|
|
|
|
move v1, v3
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
const/4 v3, 0x4
|
|
|
|
.line 8
|
|
invoke-virtual {p1, v2, v3}, Lcom/google/zxing/common/BitArray;->appendBits(II)V
|
|
|
|
goto :goto_0
|
|
.end method
|
|
|
|
.method private static calculateMaskPenalty(Lcom/google/zxing/qrcode/encoder/ByteMatrix;)I
|
|
.locals 2
|
|
|
|
.line 1
|
|
invoke-static {p0}, Lcom/google/zxing/qrcode/encoder/MaskUtil;->applyMaskPenaltyRule1(Lcom/google/zxing/qrcode/encoder/ByteMatrix;)I
|
|
|
|
move-result v0
|
|
|
|
.line 2
|
|
invoke-static {p0}, Lcom/google/zxing/qrcode/encoder/MaskUtil;->applyMaskPenaltyRule2(Lcom/google/zxing/qrcode/encoder/ByteMatrix;)I
|
|
|
|
move-result v1
|
|
|
|
add-int/2addr v0, v1
|
|
|
|
.line 3
|
|
invoke-static {p0}, Lcom/google/zxing/qrcode/encoder/MaskUtil;->applyMaskPenaltyRule3(Lcom/google/zxing/qrcode/encoder/ByteMatrix;)I
|
|
|
|
move-result v1
|
|
|
|
add-int/2addr v0, v1
|
|
|
|
.line 4
|
|
invoke-static {p0}, Lcom/google/zxing/qrcode/encoder/MaskUtil;->applyMaskPenaltyRule4(Lcom/google/zxing/qrcode/encoder/ByteMatrix;)I
|
|
|
|
move-result p0
|
|
|
|
add-int/2addr v0, p0
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method private static chooseMaskPattern(Lcom/google/zxing/common/BitArray;Lcom/google/zxing/qrcode/decoder/ErrorCorrectionLevel;Lcom/google/zxing/qrcode/decoder/Version;Lcom/google/zxing/qrcode/encoder/ByteMatrix;)I
|
|
.locals 4
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Lcom/google/zxing/WriterException;
|
|
}
|
|
.end annotation
|
|
|
|
const v0, 0x7fffffff
|
|
|
|
const/4 v1, -0x1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
:goto_0
|
|
const/16 v3, 0x8
|
|
|
|
if-lt v2, v3, :cond_0
|
|
|
|
return v1
|
|
|
|
.line 1
|
|
:cond_0
|
|
invoke-static {p0, p1, p2, v2, p3}, Lcom/google/zxing/qrcode/encoder/MatrixUtil;->buildMatrix(Lcom/google/zxing/common/BitArray;Lcom/google/zxing/qrcode/decoder/ErrorCorrectionLevel;Lcom/google/zxing/qrcode/decoder/Version;ILcom/google/zxing/qrcode/encoder/ByteMatrix;)V
|
|
|
|
.line 2
|
|
invoke-static {p3}, Lcom/google/zxing/qrcode/encoder/Encoder;->calculateMaskPenalty(Lcom/google/zxing/qrcode/encoder/ByteMatrix;)I
|
|
|
|
move-result v3
|
|
|
|
if-ge v3, v0, :cond_1
|
|
|
|
move v1, v2
|
|
|
|
move v0, v3
|
|
|
|
:cond_1
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
goto :goto_0
|
|
.end method
|
|
|
|
.method public static chooseMode(Ljava/lang/String;)Lcom/google/zxing/qrcode/decoder/Mode;
|
|
.locals 1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
.line 1
|
|
invoke-static {p0, v0}, Lcom/google/zxing/qrcode/encoder/Encoder;->chooseMode(Ljava/lang/String;Ljava/lang/String;)Lcom/google/zxing/qrcode/decoder/Mode;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method private static chooseMode(Ljava/lang/String;Ljava/lang/String;)Lcom/google/zxing/qrcode/decoder/Mode;
|
|
.locals 5
|
|
|
|
const-string v0, "Shift_JIS"
|
|
|
|
.line 2
|
|
invoke-virtual {v0, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
.line 3
|
|
invoke-static {p0}, Lcom/google/zxing/qrcode/encoder/Encoder;->isOnlyDoubleByteKanji(Ljava/lang/String;)Z
|
|
|
|
move-result p0
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
sget-object p0, Lcom/google/zxing/qrcode/decoder/Mode;->KANJI:Lcom/google/zxing/qrcode/decoder/Mode;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
sget-object p0, Lcom/google/zxing/qrcode/decoder/Mode;->BYTE:Lcom/google/zxing/qrcode/decoder/Mode;
|
|
|
|
:goto_0
|
|
return-object p0
|
|
|
|
:cond_1
|
|
const/4 p1, 0x0
|
|
|
|
move v0, p1
|
|
|
|
move v1, v0
|
|
|
|
.line 4
|
|
:goto_1
|
|
invoke-virtual {p0}, Ljava/lang/String;->length()I
|
|
|
|
move-result v2
|
|
|
|
if-lt p1, v2, :cond_4
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
.line 5
|
|
sget-object p0, Lcom/google/zxing/qrcode/decoder/Mode;->ALPHANUMERIC:Lcom/google/zxing/qrcode/decoder/Mode;
|
|
|
|
return-object p0
|
|
|
|
:cond_2
|
|
if-eqz v1, :cond_3
|
|
|
|
.line 6
|
|
sget-object p0, Lcom/google/zxing/qrcode/decoder/Mode;->NUMERIC:Lcom/google/zxing/qrcode/decoder/Mode;
|
|
|
|
return-object p0
|
|
|
|
.line 7
|
|
:cond_3
|
|
sget-object p0, Lcom/google/zxing/qrcode/decoder/Mode;->BYTE:Lcom/google/zxing/qrcode/decoder/Mode;
|
|
|
|
return-object p0
|
|
|
|
.line 8
|
|
:cond_4
|
|
invoke-virtual {p0, p1}, Ljava/lang/String;->charAt(I)C
|
|
|
|
move-result v2
|
|
|
|
const/16 v3, 0x30
|
|
|
|
const/4 v4, 0x1
|
|
|
|
if-lt v2, v3, :cond_5
|
|
|
|
const/16 v3, 0x39
|
|
|
|
if-gt v2, v3, :cond_5
|
|
|
|
move v1, v4
|
|
|
|
goto :goto_2
|
|
|
|
.line 9
|
|
:cond_5
|
|
invoke-static {v2}, Lcom/google/zxing/qrcode/encoder/Encoder;->getAlphanumericCode(I)I
|
|
|
|
move-result v0
|
|
|
|
const/4 v2, -0x1
|
|
|
|
if-eq v0, v2, :cond_6
|
|
|
|
move v0, v4
|
|
|
|
:goto_2
|
|
add-int/lit8 p1, p1, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
.line 10
|
|
:cond_6
|
|
sget-object p0, Lcom/google/zxing/qrcode/decoder/Mode;->BYTE:Lcom/google/zxing/qrcode/decoder/Mode;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method private static chooseVersion(ILcom/google/zxing/qrcode/decoder/ErrorCorrectionLevel;)Lcom/google/zxing/qrcode/decoder/Version;
|
|
.locals 4
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Lcom/google/zxing/WriterException;
|
|
}
|
|
.end annotation
|
|
|
|
const/4 v0, 0x1
|
|
|
|
:goto_0
|
|
const/16 v1, 0x28
|
|
|
|
if-gt v0, v1, :cond_1
|
|
|
|
.line 1
|
|
invoke-static {v0}, Lcom/google/zxing/qrcode/decoder/Version;->getVersionForNumber(I)Lcom/google/zxing/qrcode/decoder/Version;
|
|
|
|
move-result-object v1
|
|
|
|
.line 2
|
|
invoke-virtual {v1}, Lcom/google/zxing/qrcode/decoder/Version;->getTotalCodewords()I
|
|
|
|
move-result v2
|
|
|
|
.line 3
|
|
invoke-virtual {v1, p1}, Lcom/google/zxing/qrcode/decoder/Version;->getECBlocksForLevel(Lcom/google/zxing/qrcode/decoder/ErrorCorrectionLevel;)Lcom/google/zxing/qrcode/decoder/Version$ECBlocks;
|
|
|
|
move-result-object v3
|
|
|
|
.line 4
|
|
invoke-virtual {v3}, Lcom/google/zxing/qrcode/decoder/Version$ECBlocks;->getTotalECCodewords()I
|
|
|
|
move-result v3
|
|
|
|
sub-int/2addr v2, v3
|
|
|
|
add-int/lit8 v3, p0, 0x7
|
|
|
|
.line 5
|
|
div-int/lit8 v3, v3, 0x8
|
|
|
|
if-lt v2, v3, :cond_0
|
|
|
|
return-object v1
|
|
|
|
:cond_0
|
|
add-int/lit8 v0, v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
.line 6
|
|
:cond_1
|
|
new-instance p0, Lcom/google/zxing/WriterException;
|
|
|
|
const-string p1, "Data too big"
|
|
|
|
invoke-direct {p0, p1}, Lcom/google/zxing/WriterException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
.method public static encode(Ljava/lang/String;Lcom/google/zxing/qrcode/decoder/ErrorCorrectionLevel;)Lcom/google/zxing/qrcode/encoder/QRCode;
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Lcom/google/zxing/WriterException;
|
|
}
|
|
.end annotation
|
|
|
|
const/4 v0, 0x0
|
|
|
|
.line 1
|
|
invoke-static {p0, p1, v0}, Lcom/google/zxing/qrcode/encoder/Encoder;->encode(Ljava/lang/String;Lcom/google/zxing/qrcode/decoder/ErrorCorrectionLevel;Ljava/util/Map;)Lcom/google/zxing/qrcode/encoder/QRCode;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static encode(Ljava/lang/String;Lcom/google/zxing/qrcode/decoder/ErrorCorrectionLevel;Ljava/util/Map;)Lcom/google/zxing/qrcode/encoder/QRCode;
|
|
.locals 5
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/lang/String;",
|
|
"Lcom/google/zxing/qrcode/decoder/ErrorCorrectionLevel;",
|
|
"Ljava/util/Map<",
|
|
"Lcom/google/zxing/EncodeHintType;",
|
|
"*>;)",
|
|
"Lcom/google/zxing/qrcode/encoder/QRCode;"
|
|
}
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Lcom/google/zxing/WriterException;
|
|
}
|
|
.end annotation
|
|
|
|
if-nez p2, :cond_0
|
|
|
|
const/4 p2, 0x0
|
|
|
|
goto :goto_0
|
|
|
|
.line 2
|
|
:cond_0
|
|
sget-object v0, Lcom/google/zxing/EncodeHintType;->CHARACTER_SET:Lcom/google/zxing/EncodeHintType;
|
|
|
|
invoke-interface {p2, v0}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object p2
|
|
|
|
check-cast p2, Ljava/lang/String;
|
|
|
|
:goto_0
|
|
const-string v0, "ISO-8859-1"
|
|
|
|
if-nez p2, :cond_1
|
|
|
|
move-object p2, v0
|
|
|
|
.line 3
|
|
:cond_1
|
|
invoke-static {p0, p2}, Lcom/google/zxing/qrcode/encoder/Encoder;->chooseMode(Ljava/lang/String;Ljava/lang/String;)Lcom/google/zxing/qrcode/decoder/Mode;
|
|
|
|
move-result-object v1
|
|
|
|
.line 4
|
|
new-instance v2, Lcom/google/zxing/common/BitArray;
|
|
|
|
invoke-direct {v2}, Lcom/google/zxing/common/BitArray;-><init>()V
|
|
|
|
.line 5
|
|
sget-object v3, Lcom/google/zxing/qrcode/decoder/Mode;->BYTE:Lcom/google/zxing/qrcode/decoder/Mode;
|
|
|
|
if-ne v1, v3, :cond_2
|
|
|
|
invoke-virtual {v0, p2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_2
|
|
|
|
.line 6
|
|
invoke-static {p2}, Lcom/google/zxing/common/CharacterSetECI;->getCharacterSetECIByName(Ljava/lang/String;)Lcom/google/zxing/common/CharacterSetECI;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
.line 7
|
|
invoke-static {v0, v2}, Lcom/google/zxing/qrcode/encoder/Encoder;->appendECI(Lcom/google/zxing/common/CharacterSetECI;Lcom/google/zxing/common/BitArray;)V
|
|
|
|
.line 8
|
|
:cond_2
|
|
invoke-static {v1, v2}, Lcom/google/zxing/qrcode/encoder/Encoder;->appendModeInfo(Lcom/google/zxing/qrcode/decoder/Mode;Lcom/google/zxing/common/BitArray;)V
|
|
|
|
.line 9
|
|
new-instance v0, Lcom/google/zxing/common/BitArray;
|
|
|
|
invoke-direct {v0}, Lcom/google/zxing/common/BitArray;-><init>()V
|
|
|
|
.line 10
|
|
invoke-static {p0, v1, v0, p2}, Lcom/google/zxing/qrcode/encoder/Encoder;->appendBytes(Ljava/lang/String;Lcom/google/zxing/qrcode/decoder/Mode;Lcom/google/zxing/common/BitArray;Ljava/lang/String;)V
|
|
|
|
.line 11
|
|
invoke-virtual {v2}, Lcom/google/zxing/common/BitArray;->getSize()I
|
|
|
|
move-result p2
|
|
|
|
const/4 v4, 0x1
|
|
|
|
.line 12
|
|
invoke-static {v4}, Lcom/google/zxing/qrcode/decoder/Version;->getVersionForNumber(I)Lcom/google/zxing/qrcode/decoder/Version;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-virtual {v1, v4}, Lcom/google/zxing/qrcode/decoder/Mode;->getCharacterCountBits(Lcom/google/zxing/qrcode/decoder/Version;)I
|
|
|
|
move-result v4
|
|
|
|
add-int/2addr v4, p2
|
|
|
|
.line 13
|
|
invoke-virtual {v0}, Lcom/google/zxing/common/BitArray;->getSize()I
|
|
|
|
move-result p2
|
|
|
|
add-int/2addr p2, v4
|
|
|
|
.line 14
|
|
invoke-static {p2, p1}, Lcom/google/zxing/qrcode/encoder/Encoder;->chooseVersion(ILcom/google/zxing/qrcode/decoder/ErrorCorrectionLevel;)Lcom/google/zxing/qrcode/decoder/Version;
|
|
|
|
move-result-object p2
|
|
|
|
.line 15
|
|
invoke-virtual {v2}, Lcom/google/zxing/common/BitArray;->getSize()I
|
|
|
|
move-result v4
|
|
|
|
.line 16
|
|
invoke-virtual {v1, p2}, Lcom/google/zxing/qrcode/decoder/Mode;->getCharacterCountBits(Lcom/google/zxing/qrcode/decoder/Version;)I
|
|
|
|
move-result p2
|
|
|
|
add-int/2addr p2, v4
|
|
|
|
.line 17
|
|
invoke-virtual {v0}, Lcom/google/zxing/common/BitArray;->getSize()I
|
|
|
|
move-result v4
|
|
|
|
add-int/2addr v4, p2
|
|
|
|
.line 18
|
|
invoke-static {v4, p1}, Lcom/google/zxing/qrcode/encoder/Encoder;->chooseVersion(ILcom/google/zxing/qrcode/decoder/ErrorCorrectionLevel;)Lcom/google/zxing/qrcode/decoder/Version;
|
|
|
|
move-result-object p2
|
|
|
|
.line 19
|
|
new-instance v4, Lcom/google/zxing/common/BitArray;
|
|
|
|
invoke-direct {v4}, Lcom/google/zxing/common/BitArray;-><init>()V
|
|
|
|
.line 20
|
|
invoke-virtual {v4, v2}, Lcom/google/zxing/common/BitArray;->appendBitArray(Lcom/google/zxing/common/BitArray;)V
|
|
|
|
if-ne v1, v3, :cond_3
|
|
|
|
.line 21
|
|
invoke-virtual {v0}, Lcom/google/zxing/common/BitArray;->getSizeInBytes()I
|
|
|
|
move-result p0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_3
|
|
invoke-virtual {p0}, Ljava/lang/String;->length()I
|
|
|
|
move-result p0
|
|
|
|
.line 22
|
|
:goto_1
|
|
invoke-static {p0, p2, v1, v4}, Lcom/google/zxing/qrcode/encoder/Encoder;->appendLengthInfo(ILcom/google/zxing/qrcode/decoder/Version;Lcom/google/zxing/qrcode/decoder/Mode;Lcom/google/zxing/common/BitArray;)V
|
|
|
|
.line 23
|
|
invoke-virtual {v4, v0}, Lcom/google/zxing/common/BitArray;->appendBitArray(Lcom/google/zxing/common/BitArray;)V
|
|
|
|
.line 24
|
|
invoke-virtual {p2, p1}, Lcom/google/zxing/qrcode/decoder/Version;->getECBlocksForLevel(Lcom/google/zxing/qrcode/decoder/ErrorCorrectionLevel;)Lcom/google/zxing/qrcode/decoder/Version$ECBlocks;
|
|
|
|
move-result-object p0
|
|
|
|
.line 25
|
|
invoke-virtual {p2}, Lcom/google/zxing/qrcode/decoder/Version;->getTotalCodewords()I
|
|
|
|
move-result v0
|
|
|
|
invoke-virtual {p0}, Lcom/google/zxing/qrcode/decoder/Version$ECBlocks;->getTotalECCodewords()I
|
|
|
|
move-result v2
|
|
|
|
sub-int/2addr v0, v2
|
|
|
|
.line 26
|
|
invoke-static {v0, v4}, Lcom/google/zxing/qrcode/encoder/Encoder;->terminateBits(ILcom/google/zxing/common/BitArray;)V
|
|
|
|
.line 27
|
|
invoke-virtual {p2}, Lcom/google/zxing/qrcode/decoder/Version;->getTotalCodewords()I
|
|
|
|
move-result v2
|
|
|
|
.line 28
|
|
invoke-virtual {p0}, Lcom/google/zxing/qrcode/decoder/Version$ECBlocks;->getNumBlocks()I
|
|
|
|
move-result p0
|
|
|
|
.line 29
|
|
invoke-static {v4, v2, v0, p0}, Lcom/google/zxing/qrcode/encoder/Encoder;->interleaveWithECBytes(Lcom/google/zxing/common/BitArray;III)Lcom/google/zxing/common/BitArray;
|
|
|
|
move-result-object p0
|
|
|
|
.line 30
|
|
new-instance v0, Lcom/google/zxing/qrcode/encoder/QRCode;
|
|
|
|
invoke-direct {v0}, Lcom/google/zxing/qrcode/encoder/QRCode;-><init>()V
|
|
|
|
.line 31
|
|
invoke-virtual {v0, p1}, Lcom/google/zxing/qrcode/encoder/QRCode;->setECLevel(Lcom/google/zxing/qrcode/decoder/ErrorCorrectionLevel;)V
|
|
|
|
.line 32
|
|
invoke-virtual {v0, v1}, Lcom/google/zxing/qrcode/encoder/QRCode;->setMode(Lcom/google/zxing/qrcode/decoder/Mode;)V
|
|
|
|
.line 33
|
|
invoke-virtual {v0, p2}, Lcom/google/zxing/qrcode/encoder/QRCode;->setVersion(Lcom/google/zxing/qrcode/decoder/Version;)V
|
|
|
|
.line 34
|
|
invoke-virtual {p2}, Lcom/google/zxing/qrcode/decoder/Version;->getDimensionForVersion()I
|
|
|
|
move-result v1
|
|
|
|
.line 35
|
|
new-instance v2, Lcom/google/zxing/qrcode/encoder/ByteMatrix;
|
|
|
|
invoke-direct {v2, v1, v1}, Lcom/google/zxing/qrcode/encoder/ByteMatrix;-><init>(II)V
|
|
|
|
.line 36
|
|
invoke-static {p0, p1, p2, v2}, Lcom/google/zxing/qrcode/encoder/Encoder;->chooseMaskPattern(Lcom/google/zxing/common/BitArray;Lcom/google/zxing/qrcode/decoder/ErrorCorrectionLevel;Lcom/google/zxing/qrcode/decoder/Version;Lcom/google/zxing/qrcode/encoder/ByteMatrix;)I
|
|
|
|
move-result v1
|
|
|
|
.line 37
|
|
invoke-virtual {v0, v1}, Lcom/google/zxing/qrcode/encoder/QRCode;->setMaskPattern(I)V
|
|
|
|
.line 38
|
|
invoke-static {p0, p1, p2, v1, v2}, Lcom/google/zxing/qrcode/encoder/MatrixUtil;->buildMatrix(Lcom/google/zxing/common/BitArray;Lcom/google/zxing/qrcode/decoder/ErrorCorrectionLevel;Lcom/google/zxing/qrcode/decoder/Version;ILcom/google/zxing/qrcode/encoder/ByteMatrix;)V
|
|
|
|
.line 39
|
|
invoke-virtual {v0, v2}, Lcom/google/zxing/qrcode/encoder/QRCode;->setMatrix(Lcom/google/zxing/qrcode/encoder/ByteMatrix;)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static generateECBytes([BI)[B
|
|
.locals 5
|
|
|
|
.line 1
|
|
array-length v0, p0
|
|
|
|
add-int v1, v0, p1
|
|
|
|
.line 2
|
|
new-array v1, v1, [I
|
|
|
|
const/4 v2, 0x0
|
|
|
|
move v3, v2
|
|
|
|
:goto_0
|
|
if-lt v3, v0, :cond_1
|
|
|
|
.line 3
|
|
new-instance p0, Lcom/google/zxing/common/reedsolomon/ReedSolomonEncoder;
|
|
|
|
sget-object v3, Lcom/google/zxing/common/reedsolomon/GenericGF;->QR_CODE_FIELD_256:Lcom/google/zxing/common/reedsolomon/GenericGF;
|
|
|
|
invoke-direct {p0, v3}, Lcom/google/zxing/common/reedsolomon/ReedSolomonEncoder;-><init>(Lcom/google/zxing/common/reedsolomon/GenericGF;)V
|
|
|
|
invoke-virtual {p0, v1, p1}, Lcom/google/zxing/common/reedsolomon/ReedSolomonEncoder;->encode([II)V
|
|
|
|
.line 4
|
|
new-array v4, p1, [B
|
|
|
|
:goto_1
|
|
if-lt v2, p1, :cond_0
|
|
|
|
return-object v4
|
|
|
|
:cond_0
|
|
add-int p0, v0, v2
|
|
|
|
.line 5
|
|
aget p0, v1, p0
|
|
|
|
int-to-byte p0, p0
|
|
|
|
aput-byte p0, v4, v2
|
|
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
.line 6
|
|
:cond_1
|
|
aget-byte v4, p0, v3
|
|
|
|
and-int/lit16 v4, v4, 0xff
|
|
|
|
aput v4, v1, v3
|
|
|
|
add-int/lit8 v3, v3, 0x1
|
|
|
|
goto :goto_0
|
|
.end method
|
|
|
|
.method public static getAlphanumericCode(I)I
|
|
.locals 2
|
|
|
|
.line 1
|
|
sget-object v0, Lcom/google/zxing/qrcode/encoder/Encoder;->ALPHANUMERIC_TABLE:[I
|
|
|
|
array-length v1, v0
|
|
|
|
if-ge p0, v1, :cond_0
|
|
|
|
.line 2
|
|
aget p0, v0, p0
|
|
|
|
return p0
|
|
|
|
:cond_0
|
|
const/4 p0, -0x1
|
|
|
|
return p0
|
|
.end method
|
|
|
|
.method public static getNumDataBytesAndNumECBytesForBlockID(IIII[I[I)V
|
|
.locals 6
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Lcom/google/zxing/WriterException;
|
|
}
|
|
.end annotation
|
|
|
|
if-ge p3, p2, :cond_4
|
|
|
|
.line 1
|
|
rem-int v0, p0, p2
|
|
|
|
sub-int v1, p2, v0
|
|
|
|
.line 2
|
|
div-int v2, p0, p2
|
|
|
|
add-int/lit8 v3, v2, 0x1
|
|
|
|
.line 3
|
|
div-int/2addr p1, p2
|
|
|
|
add-int/lit8 v4, p1, 0x1
|
|
|
|
sub-int/2addr v2, p1
|
|
|
|
sub-int/2addr v3, v4
|
|
|
|
if-ne v2, v3, :cond_3
|
|
|
|
add-int v5, v1, v0
|
|
|
|
if-ne p2, v5, :cond_2
|
|
|
|
add-int p2, p1, v2
|
|
|
|
mul-int/2addr p2, v1
|
|
|
|
add-int v5, v4, v3
|
|
|
|
mul-int/2addr v5, v0
|
|
|
|
add-int/2addr v5, p2
|
|
|
|
if-ne p0, v5, :cond_1
|
|
|
|
const/4 p0, 0x0
|
|
|
|
if-ge p3, v1, :cond_0
|
|
|
|
.line 4
|
|
aput p1, p4, p0
|
|
|
|
.line 5
|
|
aput v2, p5, p0
|
|
|
|
goto :goto_0
|
|
|
|
.line 6
|
|
:cond_0
|
|
aput v4, p4, p0
|
|
|
|
.line 7
|
|
aput v3, p5, p0
|
|
|
|
:goto_0
|
|
return-void
|
|
|
|
.line 8
|
|
:cond_1
|
|
new-instance p0, Lcom/google/zxing/WriterException;
|
|
|
|
const-string p1, "Total bytes mismatch"
|
|
|
|
invoke-direct {p0, p1}, Lcom/google/zxing/WriterException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
|
|
.line 9
|
|
:cond_2
|
|
new-instance p0, Lcom/google/zxing/WriterException;
|
|
|
|
const-string p1, "RS blocks mismatch"
|
|
|
|
invoke-direct {p0, p1}, Lcom/google/zxing/WriterException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
|
|
.line 10
|
|
:cond_3
|
|
new-instance p0, Lcom/google/zxing/WriterException;
|
|
|
|
const-string p1, "EC bytes mismatch"
|
|
|
|
invoke-direct {p0, p1}, Lcom/google/zxing/WriterException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
|
|
.line 11
|
|
:cond_4
|
|
new-instance p0, Lcom/google/zxing/WriterException;
|
|
|
|
const-string p1, "Block ID too large"
|
|
|
|
invoke-direct {p0, p1}, Lcom/google/zxing/WriterException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
.method public static interleaveWithECBytes(Lcom/google/zxing/common/BitArray;III)Lcom/google/zxing/common/BitArray;
|
|
.locals 17
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Lcom/google/zxing/WriterException;
|
|
}
|
|
.end annotation
|
|
|
|
move/from16 v6, p1
|
|
|
|
move/from16 v7, p2
|
|
|
|
move/from16 v8, p3
|
|
|
|
.line 1
|
|
invoke-virtual/range {p0 .. p0}, Lcom/google/zxing/common/BitArray;->getSizeInBytes()I
|
|
|
|
move-result v0
|
|
|
|
if-ne v0, v7, :cond_9
|
|
|
|
.line 2
|
|
new-instance v9, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v9, v8}, Ljava/util/ArrayList;-><init>(I)V
|
|
|
|
const/4 v10, 0x0
|
|
|
|
move v11, v10
|
|
|
|
move v12, v11
|
|
|
|
move v13, v12
|
|
|
|
move v14, v13
|
|
|
|
:goto_0
|
|
if-lt v11, v8, :cond_8
|
|
|
|
if-ne v7, v12, :cond_7
|
|
|
|
.line 3
|
|
new-instance v0, Lcom/google/zxing/common/BitArray;
|
|
|
|
invoke-direct {v0}, Lcom/google/zxing/common/BitArray;-><init>()V
|
|
|
|
move v1, v10
|
|
|
|
:goto_1
|
|
const/16 v2, 0x8
|
|
|
|
if-lt v1, v13, :cond_4
|
|
|
|
move v3, v10
|
|
|
|
:goto_2
|
|
if-lt v3, v14, :cond_1
|
|
|
|
.line 4
|
|
invoke-virtual {v0}, Lcom/google/zxing/common/BitArray;->getSizeInBytes()I
|
|
|
|
move-result v1
|
|
|
|
if-ne v6, v1, :cond_0
|
|
|
|
return-object v0
|
|
|
|
.line 5
|
|
:cond_0
|
|
new-instance v1, Lcom/google/zxing/WriterException;
|
|
|
|
new-instance v2, Ljava/lang/StringBuilder;
|
|
|
|
const-string v3, "Interleaving error: "
|
|
|
|
invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v2, v6}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
const-string v3, " and "
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
.line 6
|
|
invoke-virtual {v0}, Lcom/google/zxing/common/BitArray;->getSizeInBytes()I
|
|
|
|
move-result v0
|
|
|
|
invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
const-string v0, " differ."
|
|
|
|
invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
.line 7
|
|
invoke-direct {v1, v0}, Lcom/google/zxing/WriterException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v1
|
|
|
|
.line 8
|
|
:cond_1
|
|
invoke-virtual {v9}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v4
|
|
|
|
:cond_2
|
|
:goto_3
|
|
invoke-interface {v4}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v1
|
|
|
|
if-nez v1, :cond_3
|
|
|
|
add-int/lit8 v3, v3, 0x1
|
|
|
|
goto :goto_2
|
|
|
|
:cond_3
|
|
invoke-interface {v4}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Lcom/google/zxing/qrcode/encoder/BlockPair;
|
|
|
|
.line 9
|
|
invoke-virtual {v1}, Lcom/google/zxing/qrcode/encoder/BlockPair;->getErrorCorrectionBytes()[B
|
|
|
|
move-result-object v1
|
|
|
|
.line 10
|
|
array-length v5, v1
|
|
|
|
if-ge v3, v5, :cond_2
|
|
|
|
.line 11
|
|
aget-byte v1, v1, v3
|
|
|
|
invoke-virtual {v0, v1, v2}, Lcom/google/zxing/common/BitArray;->appendBits(II)V
|
|
|
|
goto :goto_3
|
|
|
|
.line 12
|
|
:cond_4
|
|
invoke-virtual {v9}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v3
|
|
|
|
:cond_5
|
|
:goto_4
|
|
invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v4
|
|
|
|
if-nez v4, :cond_6
|
|
|
|
add-int/lit8 v1, v1, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_6
|
|
invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v4
|
|
|
|
check-cast v4, Lcom/google/zxing/qrcode/encoder/BlockPair;
|
|
|
|
.line 13
|
|
invoke-virtual {v4}, Lcom/google/zxing/qrcode/encoder/BlockPair;->getDataBytes()[B
|
|
|
|
move-result-object v4
|
|
|
|
.line 14
|
|
array-length v5, v4
|
|
|
|
if-ge v1, v5, :cond_5
|
|
|
|
.line 15
|
|
aget-byte v4, v4, v1
|
|
|
|
invoke-virtual {v0, v4, v2}, Lcom/google/zxing/common/BitArray;->appendBits(II)V
|
|
|
|
goto :goto_4
|
|
|
|
.line 16
|
|
:cond_7
|
|
new-instance v0, Lcom/google/zxing/WriterException;
|
|
|
|
const-string v1, "Data bytes does not match offset"
|
|
|
|
invoke-direct {v0, v1}, Lcom/google/zxing/WriterException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_8
|
|
const/4 v0, 0x1
|
|
|
|
new-array v15, v0, [I
|
|
|
|
new-array v5, v0, [I
|
|
|
|
move/from16 v0, p1
|
|
|
|
move/from16 v1, p2
|
|
|
|
move/from16 v2, p3
|
|
|
|
move v3, v11
|
|
|
|
move-object v4, v15
|
|
|
|
move-object/from16 v16, v5
|
|
|
|
.line 17
|
|
invoke-static/range {v0 .. v5}, Lcom/google/zxing/qrcode/encoder/Encoder;->getNumDataBytesAndNumECBytesForBlockID(IIII[I[I)V
|
|
|
|
.line 18
|
|
aget v0, v15, v10
|
|
|
|
.line 19
|
|
new-array v1, v0, [B
|
|
|
|
mul-int/lit8 v2, v12, 0x8
|
|
|
|
move-object/from16 v3, p0
|
|
|
|
.line 20
|
|
invoke-virtual {v3, v2, v1, v10, v0}, Lcom/google/zxing/common/BitArray;->toBytes(I[BII)V
|
|
|
|
.line 21
|
|
aget v2, v16, v10
|
|
|
|
invoke-static {v1, v2}, Lcom/google/zxing/qrcode/encoder/Encoder;->generateECBytes([BI)[B
|
|
|
|
move-result-object v2
|
|
|
|
.line 22
|
|
new-instance v4, Lcom/google/zxing/qrcode/encoder/BlockPair;
|
|
|
|
invoke-direct {v4, v1, v2}, Lcom/google/zxing/qrcode/encoder/BlockPair;-><init>([B[B)V
|
|
|
|
invoke-virtual {v9, v4}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
|
|
|
.line 23
|
|
invoke-static {v13, v0}, Ljava/lang/Math;->max(II)I
|
|
|
|
move-result v13
|
|
|
|
.line 24
|
|
array-length v0, v2
|
|
|
|
invoke-static {v14, v0}, Ljava/lang/Math;->max(II)I
|
|
|
|
move-result v14
|
|
|
|
.line 25
|
|
aget v0, v15, v10
|
|
|
|
add-int/2addr v12, v0
|
|
|
|
add-int/lit8 v11, v11, 0x1
|
|
|
|
goto/16 :goto_0
|
|
|
|
.line 26
|
|
:cond_9
|
|
new-instance v0, Lcom/google/zxing/WriterException;
|
|
|
|
const-string v1, "Number of bits and data bytes does not match"
|
|
|
|
invoke-direct {v0, v1}, Lcom/google/zxing/WriterException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method private static isOnlyDoubleByteKanji(Ljava/lang/String;)Z
|
|
.locals 5
|
|
|
|
const/4 v0, 0x0
|
|
|
|
:try_start_0
|
|
const-string v1, "Shift_JIS"
|
|
|
|
.line 1
|
|
invoke-virtual {p0, v1}, Ljava/lang/String;->getBytes(Ljava/lang/String;)[B
|
|
|
|
move-result-object p0
|
|
:try_end_0
|
|
.catch Ljava/io/UnsupportedEncodingException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
.line 2
|
|
array-length v1, p0
|
|
|
|
.line 3
|
|
rem-int/lit8 v2, v1, 0x2
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
return v0
|
|
|
|
:cond_0
|
|
move v2, v0
|
|
|
|
:goto_0
|
|
if-lt v2, v1, :cond_1
|
|
|
|
const/4 p0, 0x1
|
|
|
|
return p0
|
|
|
|
.line 4
|
|
:cond_1
|
|
aget-byte v3, p0, v2
|
|
|
|
and-int/lit16 v3, v3, 0xff
|
|
|
|
const/16 v4, 0x81
|
|
|
|
if-lt v3, v4, :cond_2
|
|
|
|
const/16 v4, 0x9f
|
|
|
|
if-le v3, v4, :cond_3
|
|
|
|
:cond_2
|
|
const/16 v4, 0xe0
|
|
|
|
if-lt v3, v4, :cond_4
|
|
|
|
const/16 v4, 0xeb
|
|
|
|
if-le v3, v4, :cond_3
|
|
|
|
goto :goto_1
|
|
|
|
:cond_3
|
|
add-int/lit8 v2, v2, 0x2
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
:cond_4
|
|
:goto_1
|
|
return v0
|
|
.end method
|
|
|
|
.method public static terminateBits(ILcom/google/zxing/common/BitArray;)V
|
|
.locals 4
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Lcom/google/zxing/WriterException;
|
|
}
|
|
.end annotation
|
|
|
|
shl-int/lit8 v0, p0, 0x3
|
|
|
|
.line 1
|
|
invoke-virtual {p1}, Lcom/google/zxing/common/BitArray;->getSize()I
|
|
|
|
move-result v1
|
|
|
|
if-gt v1, v0, :cond_7
|
|
|
|
const/4 v1, 0x0
|
|
|
|
move v2, v1
|
|
|
|
:goto_0
|
|
const/4 v3, 0x4
|
|
|
|
if-ge v2, v3, :cond_1
|
|
|
|
.line 2
|
|
invoke-virtual {p1}, Lcom/google/zxing/common/BitArray;->getSize()I
|
|
|
|
move-result v3
|
|
|
|
if-lt v3, v0, :cond_0
|
|
|
|
goto :goto_1
|
|
|
|
.line 3
|
|
:cond_0
|
|
invoke-virtual {p1, v1}, Lcom/google/zxing/common/BitArray;->appendBit(Z)V
|
|
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
.line 4
|
|
:cond_1
|
|
:goto_1
|
|
invoke-virtual {p1}, Lcom/google/zxing/common/BitArray;->getSize()I
|
|
|
|
move-result v2
|
|
|
|
and-int/lit8 v2, v2, 0x7
|
|
|
|
const/16 v3, 0x8
|
|
|
|
if-lez v2, :cond_3
|
|
|
|
:goto_2
|
|
if-lt v2, v3, :cond_2
|
|
|
|
goto :goto_3
|
|
|
|
.line 5
|
|
:cond_2
|
|
invoke-virtual {p1, v1}, Lcom/google/zxing/common/BitArray;->appendBit(Z)V
|
|
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
goto :goto_2
|
|
|
|
.line 6
|
|
:cond_3
|
|
:goto_3
|
|
invoke-virtual {p1}, Lcom/google/zxing/common/BitArray;->getSizeInBytes()I
|
|
|
|
move-result v2
|
|
|
|
sub-int/2addr p0, v2
|
|
|
|
:goto_4
|
|
if-lt v1, p0, :cond_5
|
|
|
|
.line 7
|
|
invoke-virtual {p1}, Lcom/google/zxing/common/BitArray;->getSize()I
|
|
|
|
move-result p0
|
|
|
|
if-ne p0, v0, :cond_4
|
|
|
|
return-void
|
|
|
|
.line 8
|
|
:cond_4
|
|
new-instance p0, Lcom/google/zxing/WriterException;
|
|
|
|
const-string p1, "Bits size does not equal capacity"
|
|
|
|
invoke-direct {p0, p1}, Lcom/google/zxing/WriterException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
|
|
:cond_5
|
|
and-int/lit8 v2, v1, 0x1
|
|
|
|
if-nez v2, :cond_6
|
|
|
|
const/16 v2, 0xec
|
|
|
|
goto :goto_5
|
|
|
|
:cond_6
|
|
const/16 v2, 0x11
|
|
|
|
.line 9
|
|
:goto_5
|
|
invoke-virtual {p1, v2, v3}, Lcom/google/zxing/common/BitArray;->appendBits(II)V
|
|
|
|
add-int/lit8 v1, v1, 0x1
|
|
|
|
goto :goto_4
|
|
|
|
.line 10
|
|
:cond_7
|
|
new-instance p0, Lcom/google/zxing/WriterException;
|
|
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
const-string v2, "data bits cannot fit in the QR Code"
|
|
|
|
invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p1}, Lcom/google/zxing/common/BitArray;->getSize()I
|
|
|
|
move-result p1
|
|
|
|
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
const-string p1, " > "
|
|
|
|
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
.line 11
|
|
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
.line 12
|
|
invoke-direct {p0, p1}, Lcom/google/zxing/WriterException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
.end method
|