Rabbit-R1/android (non root)/smali/smali_classes3/com/google/zxing/oned/Code93Reader.smali
2024-05-21 17:08:36 -04:00

989 lines
18 KiB
Smali

.class public final Lcom/google/zxing/oned/Code93Reader;
.super Lcom/google/zxing/oned/OneDReader;
.source "Code93Reader.java"
# static fields
.field private static final ALPHABET:[C
.field static final ALPHABET_STRING:Ljava/lang/String; = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%abcd*"
.field static final ASTERISK_ENCODING:I
.field static final CHARACTER_ENCODINGS:[I
# instance fields
.field private final counters:[I
.field private final decodeRowResult:Ljava/lang/StringBuilder;
# direct methods
.method static constructor <clinit>()V
.locals 2
const-string v0, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%abcd*"
.line 41
invoke-virtual {v0}, Ljava/lang/String;->toCharArray()[C
move-result-object v0
sput-object v0, Lcom/google/zxing/oned/Code93Reader;->ALPHABET:[C
const/16 v0, 0x30
new-array v0, v0, [I
fill-array-data v0, :array_0
sput-object v0, Lcom/google/zxing/oned/Code93Reader;->CHARACTER_ENCODINGS:[I
const/16 v1, 0x2f
aget v0, v0, v1
sput v0, Lcom/google/zxing/oned/Code93Reader;->ASTERISK_ENCODING:I
return-void
:array_0
.array-data 4
0x114
0x148
0x144
0x142
0x128
0x124
0x122
0x150
0x112
0x10a
0x1a8
0x1a4
0x1a2
0x194
0x192
0x18a
0x168
0x164
0x162
0x134
0x11a
0x158
0x14c
0x146
0x12c
0x116
0x1b4
0x1b2
0x1ac
0x1a6
0x196
0x19a
0x16c
0x166
0x136
0x13a
0x12e
0x1d4
0x1d2
0x1ca
0x16e
0x176
0x1ae
0x126
0x1da
0x1d6
0x132
0x15e
.end array-data
.end method
.method public constructor <init>()V
.locals 2
.line 60
invoke-direct {p0}, Lcom/google/zxing/oned/OneDReader;-><init>()V
.line 61
new-instance v0, Ljava/lang/StringBuilder;
const/16 v1, 0x14
invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(I)V
iput-object v0, p0, Lcom/google/zxing/oned/Code93Reader;->decodeRowResult:Ljava/lang/StringBuilder;
const/4 v0, 0x6
new-array v0, v0, [I
iput-object v0, p0, Lcom/google/zxing/oned/Code93Reader;->counters:[I
return-void
.end method
.method private static checkChecksums(Ljava/lang/CharSequence;)V
.locals 3
.annotation system Ldalvik/annotation/Throws;
value = {
Lcom/google/zxing/ChecksumException;
}
.end annotation
.line 276
invoke-interface {p0}, Ljava/lang/CharSequence;->length()I
move-result v0
add-int/lit8 v1, v0, -0x2
const/16 v2, 0x14
.line 277
invoke-static {p0, v1, v2}, Lcom/google/zxing/oned/Code93Reader;->checkOneChecksum(Ljava/lang/CharSequence;II)V
add-int/lit8 v0, v0, -0x1
const/16 v1, 0xf
.line 278
invoke-static {p0, v0, v1}, Lcom/google/zxing/oned/Code93Reader;->checkOneChecksum(Ljava/lang/CharSequence;II)V
return-void
.end method
.method private static checkOneChecksum(Ljava/lang/CharSequence;II)V
.locals 6
.annotation system Ldalvik/annotation/Throws;
value = {
Lcom/google/zxing/ChecksumException;
}
.end annotation
add-int/lit8 v0, p1, -0x1
const/4 v1, 0x1
const/4 v2, 0x0
move v3, v1
:goto_0
if-ltz v0, :cond_1
const-string v4, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%abcd*"
.line 286
invoke-interface {p0, v0}, Ljava/lang/CharSequence;->charAt(I)C
move-result v5
invoke-virtual {v4, v5}, Ljava/lang/String;->indexOf(I)I
move-result v4
mul-int/2addr v4, v3
add-int/2addr v2, v4
add-int/2addr v3, v1
if-le v3, p2, :cond_0
move v3, v1
:cond_0
add-int/lit8 v0, v0, -0x1
goto :goto_0
.line 291
:cond_1
invoke-interface {p0, p1}, Ljava/lang/CharSequence;->charAt(I)C
move-result p0
sget-object p1, Lcom/google/zxing/oned/Code93Reader;->ALPHABET:[C
rem-int/lit8 v2, v2, 0x2f
aget-char p1, p1, v2
if-ne p0, p1, :cond_2
return-void
.line 292
:cond_2
invoke-static {}, Lcom/google/zxing/ChecksumException;->getChecksumInstance()Lcom/google/zxing/ChecksumException;
move-result-object p0
throw p0
.end method
.method private static decodeExtended(Ljava/lang/CharSequence;)Ljava/lang/String;
.locals 9
.annotation system Ldalvik/annotation/Throws;
value = {
Lcom/google/zxing/FormatException;
}
.end annotation
.line 198
invoke-interface {p0}, Ljava/lang/CharSequence;->length()I
move-result v0
.line 199
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1, v0}, Ljava/lang/StringBuilder;-><init>(I)V
const/4 v2, 0x0
move v3, v2
:goto_0
if-ge v3, v0, :cond_e
.line 201
invoke-interface {p0, v3}, Ljava/lang/CharSequence;->charAt(I)C
move-result v4
const/16 v5, 0x61
if-lt v4, v5, :cond_d
const/16 v5, 0x64
if-gt v4, v5, :cond_d
add-int/lit8 v5, v0, -0x1
if-ge v3, v5, :cond_c
add-int/lit8 v3, v3, 0x1
.line 206
invoke-interface {p0, v3}, Ljava/lang/CharSequence;->charAt(I)C
move-result v5
const/16 v6, 0x4f
const/16 v7, 0x5a
const/16 v8, 0x41
packed-switch v4, :pswitch_data_0
:goto_1
move v4, v2
goto/16 :goto_3
:pswitch_0
if-lt v5, v8, :cond_0
if-gt v5, v7, :cond_0
add-int/lit8 v5, v5, 0x20
goto/16 :goto_2
.line 214
:cond_0
invoke-static {}, Lcom/google/zxing/FormatException;->getFormatInstance()Lcom/google/zxing/FormatException;
move-result-object p0
throw p0
:pswitch_1
if-lt v5, v8, :cond_1
if-gt v5, v6, :cond_1
add-int/lit8 v5, v5, -0x20
goto :goto_2
:cond_1
if-ne v5, v7, :cond_2
const/16 v4, 0x3a
goto :goto_3
.line 261
:cond_2
invoke-static {}, Lcom/google/zxing/FormatException;->getFormatInstance()Lcom/google/zxing/FormatException;
move-result-object p0
throw p0
:pswitch_2
if-lt v5, v8, :cond_3
const/16 v4, 0x45
if-gt v5, v4, :cond_3
add-int/lit8 v5, v5, -0x26
goto :goto_2
:cond_3
const/16 v4, 0x46
if-lt v5, v4, :cond_4
const/16 v4, 0x4a
if-gt v5, v4, :cond_4
add-int/lit8 v5, v5, -0xb
goto :goto_2
:cond_4
const/16 v4, 0x4b
if-lt v5, v4, :cond_5
if-gt v5, v6, :cond_5
add-int/lit8 v5, v5, 0x10
goto :goto_2
:cond_5
const/16 v4, 0x50
if-lt v5, v4, :cond_6
const/16 v4, 0x54
if-gt v5, v4, :cond_6
add-int/lit8 v5, v5, 0x2b
goto :goto_2
:cond_6
const/16 v4, 0x55
if-ne v5, v4, :cond_7
goto :goto_1
:cond_7
const/16 v4, 0x56
if-ne v5, v4, :cond_8
const/16 v4, 0x40
goto :goto_3
:cond_8
const/16 v4, 0x57
if-ne v5, v4, :cond_9
const/16 v4, 0x60
goto :goto_3
:cond_9
const/16 v4, 0x58
if-lt v5, v4, :cond_a
if-gt v5, v7, :cond_a
const/16 v4, 0x7f
goto :goto_3
.line 251
:cond_a
invoke-static {}, Lcom/google/zxing/FormatException;->getFormatInstance()Lcom/google/zxing/FormatException;
move-result-object p0
throw p0
:pswitch_3
if-lt v5, v8, :cond_b
if-gt v5, v7, :cond_b
add-int/lit8 v5, v5, -0x40
:goto_2
int-to-char v4, v5
goto :goto_3
.line 222
:cond_b
invoke-static {}, Lcom/google/zxing/FormatException;->getFormatInstance()Lcom/google/zxing/FormatException;
move-result-object p0
throw p0
.line 265
:goto_3
invoke-virtual {v1, v4}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
goto :goto_4
.line 204
:cond_c
invoke-static {}, Lcom/google/zxing/FormatException;->getFormatInstance()Lcom/google/zxing/FormatException;
move-result-object p0
throw p0
.line 269
:cond_d
invoke-virtual {v1, v4}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
:goto_4
add-int/lit8 v3, v3, 0x1
goto/16 :goto_0
.line 272
:cond_e
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p0
return-object p0
:pswitch_data_0
.packed-switch 0x61
:pswitch_3
:pswitch_2
:pswitch_1
:pswitch_0
.end packed-switch
.end method
.method private findAsteriskPattern(Lcom/google/zxing/common/BitArray;)[I
.locals 10
.annotation system Ldalvik/annotation/Throws;
value = {
Lcom/google/zxing/NotFoundException;
}
.end annotation
.line 132
invoke-virtual {p1}, Lcom/google/zxing/common/BitArray;->getSize()I
move-result v0
const/4 v1, 0x0
.line 133
invoke-virtual {p1, v1}, Lcom/google/zxing/common/BitArray;->getNextSet(I)I
move-result v2
iget-object v3, p0, Lcom/google/zxing/oned/Code93Reader;->counters:[I
.line 135
invoke-static {v3, v1}, Ljava/util/Arrays;->fill([II)V
iget-object p0, p0, Lcom/google/zxing/oned/Code93Reader;->counters:[I
.line 139
array-length v3, p0
move v5, v1
move v6, v5
move v4, v2
:goto_0
if-ge v2, v0, :cond_3
.line 143
invoke-virtual {p1, v2}, Lcom/google/zxing/common/BitArray;->get(I)Z
move-result v7
const/4 v8, 0x1
if-eq v7, v5, :cond_0
.line 144
aget v7, p0, v6
add-int/2addr v7, v8
aput v7, p0, v6
goto :goto_2
:cond_0
add-int/lit8 v7, v3, -0x1
if-ne v6, v7, :cond_2
.line 147
invoke-static {p0}, Lcom/google/zxing/oned/Code93Reader;->toPattern([I)I
move-result v7
sget v9, Lcom/google/zxing/oned/Code93Reader;->ASTERISK_ENCODING:I
if-ne v7, v9, :cond_1
filled-new-array {v4, v2}, [I
move-result-object p0
return-object p0
.line 150
:cond_1
aget v7, p0, v1
aget v9, p0, v8
add-int/2addr v7, v9
add-int/2addr v4, v7
add-int/lit8 v7, v6, -0x1
const/4 v9, 0x2
.line 151
invoke-static {p0, v9, p0, v1, v7}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
.line 152
aput v1, p0, v7
.line 153
aput v1, p0, v6
add-int/lit8 v6, v6, -0x1
goto :goto_1
:cond_2
add-int/lit8 v6, v6, 0x1
.line 158
:goto_1
aput v8, p0, v6
xor-int/lit8 v5, v5, 0x1
:goto_2
add-int/lit8 v2, v2, 0x1
goto :goto_0
.line 162
:cond_3
invoke-static {}, Lcom/google/zxing/NotFoundException;->getNotFoundInstance()Lcom/google/zxing/NotFoundException;
move-result-object p0
throw p0
.end method
.method private static patternToChar(I)C
.locals 3
.annotation system Ldalvik/annotation/Throws;
value = {
Lcom/google/zxing/NotFoundException;
}
.end annotation
const/4 v0, 0x0
:goto_0
sget-object v1, Lcom/google/zxing/oned/Code93Reader;->CHARACTER_ENCODINGS:[I
.line 189
array-length v2, v1
if-ge v0, v2, :cond_1
.line 190
aget v1, v1, v0
if-ne v1, p0, :cond_0
sget-object p0, Lcom/google/zxing/oned/Code93Reader;->ALPHABET:[C
.line 191
aget-char p0, p0, v0
return p0
:cond_0
add-int/lit8 v0, v0, 0x1
goto :goto_0
.line 194
:cond_1
invoke-static {}, Lcom/google/zxing/NotFoundException;->getNotFoundInstance()Lcom/google/zxing/NotFoundException;
move-result-object p0
throw p0
.end method
.method private static toPattern([I)I
.locals 7
.line 167
array-length v0, p0
const/4 v1, 0x0
move v2, v1
move v3, v2
:goto_0
if-ge v2, v0, :cond_0
aget v4, p0, v2
add-int/2addr v3, v4
add-int/lit8 v2, v2, 0x1
goto :goto_0
.line 171
:cond_0
array-length v0, p0
move v2, v1
move v4, v2
:goto_1
if-ge v2, v0, :cond_5
.line 173
aget v5, p0, v2
int-to-float v5, v5
const/high16 v6, 0x41100000 # 9.0f
mul-float/2addr v5, v6
int-to-float v6, v3
div-float/2addr v5, v6
invoke-static {v5}, Ljava/lang/Math;->round(F)I
move-result v5
if-lez v5, :cond_4
const/4 v6, 0x4
if-le v5, v6, :cond_1
goto :goto_3
:cond_1
and-int/lit8 v6, v2, 0x1
if-nez v6, :cond_2
move v6, v1
:goto_2
if-ge v6, v5, :cond_3
shl-int/lit8 v4, v4, 0x1
or-int/lit8 v4, v4, 0x1
add-int/lit8 v6, v6, 0x1
goto :goto_2
:cond_2
shl-int/2addr v4, v5
:cond_3
add-int/lit8 v2, v2, 0x1
goto :goto_1
:cond_4
:goto_3
const/4 p0, -0x1
return p0
:cond_5
return v4
.end method
# virtual methods
.method public decodeRow(ILcom/google/zxing/common/BitArray;Ljava/util/Map;)Lcom/google/zxing/Result;
.locals 10
.annotation system Ldalvik/annotation/Signature;
value = {
"(I",
"Lcom/google/zxing/common/BitArray;",
"Ljava/util/Map<",
"Lcom/google/zxing/DecodeHintType;",
"*>;)",
"Lcom/google/zxing/Result;"
}
.end annotation
.annotation system Ldalvik/annotation/Throws;
value = {
Lcom/google/zxing/NotFoundException;,
Lcom/google/zxing/ChecksumException;,
Lcom/google/zxing/FormatException;
}
.end annotation
.line 69
invoke-direct {p0, p2}, Lcom/google/zxing/oned/Code93Reader;->findAsteriskPattern(Lcom/google/zxing/common/BitArray;)[I
move-result-object p3
const/4 v0, 0x1
.line 71
aget v1, p3, v0
invoke-virtual {p2, v1}, Lcom/google/zxing/common/BitArray;->getNextSet(I)I
move-result v1
.line 72
invoke-virtual {p2}, Lcom/google/zxing/common/BitArray;->getSize()I
move-result v2
iget-object v3, p0, Lcom/google/zxing/oned/Code93Reader;->counters:[I
const/4 v4, 0x0
.line 75
invoke-static {v3, v4}, Ljava/util/Arrays;->fill([II)V
iget-object p0, p0, Lcom/google/zxing/oned/Code93Reader;->decodeRowResult:Ljava/lang/StringBuilder;
.line 77
invoke-virtual {p0, v4}, Ljava/lang/StringBuilder;->setLength(I)V
.line 82
:goto_0
invoke-static {p2, v1, v3}, Lcom/google/zxing/oned/Code93Reader;->recordPattern(Lcom/google/zxing/common/BitArray;I[I)V
.line 83
invoke-static {v3}, Lcom/google/zxing/oned/Code93Reader;->toPattern([I)I
move-result v5
if-ltz v5, :cond_5
.line 87
invoke-static {v5}, Lcom/google/zxing/oned/Code93Reader;->patternToChar(I)C
move-result v5
.line 88
invoke-virtual {p0, v5}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
.line 90
array-length v6, v3
move v8, v1
move v7, v4
:goto_1
if-ge v7, v6, :cond_0
aget v9, v3, v7
add-int/2addr v8, v9
add-int/lit8 v7, v7, 0x1
goto :goto_1
.line 94
:cond_0
invoke-virtual {p2, v8}, Lcom/google/zxing/common/BitArray;->getNextSet(I)I
move-result v6
const/16 v7, 0x2a
if-ne v5, v7, :cond_4
.line 96
invoke-virtual {p0}, Ljava/lang/StringBuilder;->length()I
move-result v5
sub-int/2addr v5, v0
invoke-virtual {p0, v5}, Ljava/lang/StringBuilder;->deleteCharAt(I)Ljava/lang/StringBuilder;
.line 99
array-length v5, v3
move v7, v4
move v8, v7
:goto_2
if-ge v7, v5, :cond_1
aget v9, v3, v7
add-int/2addr v8, v9
add-int/lit8 v7, v7, 0x1
goto :goto_2
:cond_1
if-eq v6, v2, :cond_3
.line 104
invoke-virtual {p2, v6}, Lcom/google/zxing/common/BitArray;->get(I)Z
move-result p2
if-eqz p2, :cond_3
.line 108
invoke-virtual {p0}, Ljava/lang/StringBuilder;->length()I
move-result p2
const/4 v2, 0x2
if-lt p2, v2, :cond_2
.line 113
invoke-static {p0}, Lcom/google/zxing/oned/Code93Reader;->checkChecksums(Ljava/lang/CharSequence;)V
.line 115
invoke-virtual {p0}, Ljava/lang/StringBuilder;->length()I
move-result p2
sub-int/2addr p2, v2
invoke-virtual {p0, p2}, Ljava/lang/StringBuilder;->setLength(I)V
.line 117
invoke-static {p0}, Lcom/google/zxing/oned/Code93Reader;->decodeExtended(Ljava/lang/CharSequence;)Ljava/lang/String;
move-result-object p0
.line 119
aget p2, p3, v0
aget p3, p3, v4
add-int/2addr p2, p3
int-to-float p2, p2
const/high16 p3, 0x40000000 # 2.0f
div-float/2addr p2, p3
int-to-float v1, v1
int-to-float v3, v8
div-float/2addr v3, p3
add-float/2addr v1, v3
.line 121
new-instance p3, Lcom/google/zxing/Result;
new-array v2, v2, [Lcom/google/zxing/ResultPoint;
new-instance v3, Lcom/google/zxing/ResultPoint;
int-to-float p1, p1
invoke-direct {v3, p2, p1}, Lcom/google/zxing/ResultPoint;-><init>(FF)V
aput-object v3, v2, v4
new-instance p2, Lcom/google/zxing/ResultPoint;
invoke-direct {p2, v1, p1}, Lcom/google/zxing/ResultPoint;-><init>(FF)V
aput-object p2, v2, v0
sget-object p1, Lcom/google/zxing/BarcodeFormat;->CODE_93:Lcom/google/zxing/BarcodeFormat;
const/4 p2, 0x0
invoke-direct {p3, p0, p2, v2, p1}, Lcom/google/zxing/Result;-><init>(Ljava/lang/String;[B[Lcom/google/zxing/ResultPoint;Lcom/google/zxing/BarcodeFormat;)V
return-object p3
.line 110
:cond_2
invoke-static {}, Lcom/google/zxing/NotFoundException;->getNotFoundInstance()Lcom/google/zxing/NotFoundException;
move-result-object p0
throw p0
.line 105
:cond_3
invoke-static {}, Lcom/google/zxing/NotFoundException;->getNotFoundInstance()Lcom/google/zxing/NotFoundException;
move-result-object p0
throw p0
:cond_4
move v1, v6
goto/16 :goto_0
.line 85
:cond_5
invoke-static {}, Lcom/google/zxing/NotFoundException;->getNotFoundInstance()Lcom/google/zxing/NotFoundException;
move-result-object p0
throw p0
.end method