321 lines
5.4 KiB
Smali
321 lines
5.4 KiB
Smali
.class public final Lcom/google/zxing/oned/EAN13Reader;
|
|
.super Lcom/google/zxing/oned/UPCEANReader;
|
|
.source "EAN13Reader.java"
|
|
|
|
|
|
# static fields
|
|
.field public static final FIRST_DIGIT_ENCODINGS:[I
|
|
|
|
|
|
# instance fields
|
|
.field private final decodeMiddleCounters:[I
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 3
|
|
|
|
const/16 v0, 0xa
|
|
|
|
new-array v0, v0, [I
|
|
|
|
const/4 v1, 0x1
|
|
|
|
const/16 v2, 0xb
|
|
|
|
aput v2, v0, v1
|
|
|
|
const/4 v1, 0x2
|
|
|
|
const/16 v2, 0xd
|
|
|
|
aput v2, v0, v1
|
|
|
|
const/4 v1, 0x3
|
|
|
|
const/16 v2, 0xe
|
|
|
|
aput v2, v0, v1
|
|
|
|
const/4 v1, 0x4
|
|
|
|
const/16 v2, 0x13
|
|
|
|
aput v2, v0, v1
|
|
|
|
const/4 v1, 0x5
|
|
|
|
const/16 v2, 0x19
|
|
|
|
aput v2, v0, v1
|
|
|
|
const/4 v1, 0x6
|
|
|
|
const/16 v2, 0x1c
|
|
|
|
aput v2, v0, v1
|
|
|
|
const/4 v1, 0x7
|
|
|
|
const/16 v2, 0x15
|
|
|
|
aput v2, v0, v1
|
|
|
|
const/16 v1, 0x8
|
|
|
|
const/16 v2, 0x16
|
|
|
|
aput v2, v0, v1
|
|
|
|
const/16 v1, 0x9
|
|
|
|
const/16 v2, 0x1a
|
|
|
|
aput v2, v0, v1
|
|
|
|
.line 1
|
|
sput-object v0, Lcom/google/zxing/oned/EAN13Reader;->FIRST_DIGIT_ENCODINGS:[I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>()V
|
|
.locals 1
|
|
|
|
.line 1
|
|
invoke-direct {p0}, Lcom/google/zxing/oned/UPCEANReader;-><init>()V
|
|
|
|
const/4 v0, 0x4
|
|
|
|
new-array v0, v0, [I
|
|
|
|
.line 2
|
|
iput-object v0, p0, Lcom/google/zxing/oned/EAN13Reader;->decodeMiddleCounters:[I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private static determineFirstDigit(Ljava/lang/StringBuilder;I)V
|
|
.locals 3
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Lcom/google/zxing/NotFoundException;
|
|
}
|
|
.end annotation
|
|
|
|
const/4 v0, 0x0
|
|
|
|
move v1, v0
|
|
|
|
:goto_0
|
|
const/16 v2, 0xa
|
|
|
|
if-ge v1, v2, :cond_1
|
|
|
|
.line 1
|
|
sget-object v2, Lcom/google/zxing/oned/EAN13Reader;->FIRST_DIGIT_ENCODINGS:[I
|
|
|
|
aget v2, v2, v1
|
|
|
|
if-ne p1, v2, :cond_0
|
|
|
|
add-int/lit8 v1, v1, 0x30
|
|
|
|
int-to-char p1, v1
|
|
|
|
.line 2
|
|
invoke-virtual {p0, v0, p1}, Ljava/lang/StringBuilder;->insert(IC)Ljava/lang/StringBuilder;
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
add-int/lit8 v1, v1, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
.line 3
|
|
:cond_1
|
|
invoke-static {}, Lcom/google/zxing/NotFoundException;->getNotFoundInstance()Lcom/google/zxing/NotFoundException;
|
|
|
|
move-result-object p0
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public decodeMiddle(Lcom/google/zxing/common/BitArray;[ILjava/lang/StringBuilder;)I
|
|
.locals 10
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Lcom/google/zxing/NotFoundException;
|
|
}
|
|
.end annotation
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lcom/google/zxing/oned/EAN13Reader;->decodeMiddleCounters:[I
|
|
|
|
const/4 v1, 0x0
|
|
|
|
.line 2
|
|
aput v1, v0, v1
|
|
|
|
const/4 v2, 0x1
|
|
|
|
.line 3
|
|
aput v1, v0, v2
|
|
|
|
const/4 v3, 0x2
|
|
|
|
.line 4
|
|
aput v1, v0, v3
|
|
|
|
const/4 v3, 0x3
|
|
|
|
.line 5
|
|
aput v1, v0, v3
|
|
|
|
.line 6
|
|
invoke-virtual {p1}, Lcom/google/zxing/common/BitArray;->getSize()I
|
|
|
|
move-result v3
|
|
|
|
.line 7
|
|
aget p2, p2, v2
|
|
|
|
move v4, v1
|
|
|
|
move v5, v4
|
|
|
|
:goto_0
|
|
const/4 v6, 0x6
|
|
|
|
if-ge v4, v6, :cond_3
|
|
|
|
if-lt p2, v3, :cond_0
|
|
|
|
goto :goto_2
|
|
|
|
.line 8
|
|
:cond_0
|
|
sget-object v6, Lcom/google/zxing/oned/UPCEANReader;->L_AND_G_PATTERNS:[[I
|
|
|
|
invoke-static {p1, v0, p2, v6}, Lcom/google/zxing/oned/UPCEANReader;->decodeDigit(Lcom/google/zxing/common/BitArray;[II[[I)I
|
|
|
|
move-result v7
|
|
|
|
.line 9
|
|
rem-int/lit8 v6, v7, 0xa
|
|
|
|
add-int/lit8 v6, v6, 0x30
|
|
|
|
int-to-char v6, v6
|
|
|
|
invoke-virtual {p3, v6}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
|
|
|
|
.line 10
|
|
array-length v8, v0
|
|
|
|
move v6, v1
|
|
|
|
:goto_1
|
|
if-lt v6, v8, :cond_2
|
|
|
|
const/16 v6, 0xa
|
|
|
|
if-lt v7, v6, :cond_1
|
|
|
|
rsub-int/lit8 v6, v4, 0x5
|
|
|
|
shl-int v6, v2, v6
|
|
|
|
or-int/2addr v5, v6
|
|
|
|
:cond_1
|
|
add-int/lit8 v4, v4, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
aget v9, v0, v6
|
|
|
|
add-int/2addr p2, v9
|
|
|
|
add-int/lit8 v6, v6, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
.line 11
|
|
:cond_3
|
|
:goto_2
|
|
invoke-static {p3, v5}, Lcom/google/zxing/oned/EAN13Reader;->determineFirstDigit(Ljava/lang/StringBuilder;I)V
|
|
|
|
.line 12
|
|
sget-object v4, Lcom/google/zxing/oned/UPCEANReader;->MIDDLE_PATTERN:[I
|
|
|
|
invoke-static {p1, p2, v2, v4}, Lcom/google/zxing/oned/UPCEANReader;->findGuardPattern(Lcom/google/zxing/common/BitArray;IZ[I)[I
|
|
|
|
move-result-object p2
|
|
|
|
.line 13
|
|
aget p2, p2, v2
|
|
|
|
move v2, v1
|
|
|
|
:goto_3
|
|
if-ge v2, v6, :cond_6
|
|
|
|
if-lt p2, v3, :cond_4
|
|
|
|
goto :goto_5
|
|
|
|
.line 14
|
|
:cond_4
|
|
sget-object v4, Lcom/google/zxing/oned/UPCEANReader;->L_PATTERNS:[[I
|
|
|
|
invoke-static {p1, v0, p2, v4}, Lcom/google/zxing/oned/UPCEANReader;->decodeDigit(Lcom/google/zxing/common/BitArray;[II[[I)I
|
|
|
|
move-result v4
|
|
|
|
add-int/lit8 v4, v4, 0x30
|
|
|
|
int-to-char v4, v4
|
|
|
|
.line 15
|
|
invoke-virtual {p3, v4}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
|
|
|
|
.line 16
|
|
array-length v4, v0
|
|
|
|
move v5, v1
|
|
|
|
:goto_4
|
|
if-lt v5, v4, :cond_5
|
|
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
goto :goto_3
|
|
|
|
:cond_5
|
|
aget v7, v0, v5
|
|
|
|
add-int/2addr p2, v7
|
|
|
|
add-int/lit8 v5, v5, 0x1
|
|
|
|
goto :goto_4
|
|
|
|
:cond_6
|
|
:goto_5
|
|
return p2
|
|
.end method
|
|
|
|
.method public getBarcodeFormat()Lcom/google/zxing/BarcodeFormat;
|
|
.locals 1
|
|
|
|
.line 1
|
|
sget-object v0, Lcom/google/zxing/BarcodeFormat;->EAN_13:Lcom/google/zxing/BarcodeFormat;
|
|
|
|
return-object v0
|
|
.end method
|