.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 private static final ALPHABET_STRING:Ljava/lang/String; = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%abcd*" .field private static final ASTERISK_ENCODING:I .field private static final CHARACTER_ENCODINGS:[I # direct methods .method public static constructor ()V .locals 2 const-string v0, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%abcd*" .line 1 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 .line 2 fill-array-data v0, :array_0 sput-object v0, Lcom/google/zxing/oned/Code93Reader;->CHARACTER_ENCODINGS:[I const/16 v1, 0x2f .line 3 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 ()V .locals 0 .line 1 invoke-direct {p0}, Lcom/google/zxing/oned/OneDReader;->()V 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 1 invoke-interface {p0}, Ljava/lang/CharSequence;->length()I move-result v0 add-int/lit8 v1, v0, -0x2 const/16 v2, 0x14 .line 2 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 3 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-gez v0, :cond_1 .line 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_0 return-void .line 2 :cond_0 invoke-static {}, Lcom/google/zxing/ChecksumException;->getChecksumInstance()Lcom/google/zxing/ChecksumException; move-result-object p0 throw p0 .line 3 :cond_1 invoke-interface {p0, v0}, Ljava/lang/CharSequence;->charAt(I)C move-result v4 const-string v5, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%abcd*" invoke-virtual {v5, v4}, 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_2 move v3, v1 :cond_2 add-int/lit8 v0, v0, -0x1 goto :goto_0 .end method .method private static decodeExtended(Ljava/lang/CharSequence;)Ljava/lang/String; .locals 8 .annotation system Ldalvik/annotation/Throws; value = { Lcom/google/zxing/FormatException; } .end annotation .line 1 invoke-interface {p0}, Ljava/lang/CharSequence;->length()I move-result v0 .line 2 new-instance v1, Ljava/lang/StringBuilder; invoke-direct {v1, v0}, Ljava/lang/StringBuilder;->(I)V const/4 v2, 0x0 move v3, v2 :goto_0 if-lt v3, v0, :cond_0 .line 3 invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p0 return-object p0 .line 4 :cond_0 invoke-interface {p0, v3}, Ljava/lang/CharSequence;->charAt(I)C move-result v4 const/16 v5, 0x61 if-lt v4, v5, :cond_8 const/16 v5, 0x64 if-gt v4, v5, :cond_8 add-int/lit8 v5, v0, -0x1 if-ge v3, v5, :cond_7 add-int/lit8 v3, v3, 0x1 .line 5 invoke-interface {p0, v3}, Ljava/lang/CharSequence;->charAt(I)C move-result v5 const/16 v6, 0x5a const/16 v7, 0x41 packed-switch v4, :pswitch_data_0 move v4, v2 goto :goto_2 :pswitch_0 if-lt v5, v7, :cond_1 if-gt v5, v6, :cond_1 add-int/lit8 v5, v5, 0x20 goto :goto_1 .line 6 :cond_1 invoke-static {}, Lcom/google/zxing/FormatException;->getFormatInstance()Lcom/google/zxing/FormatException; move-result-object p0 throw p0 :pswitch_1 if-lt v5, v7, :cond_2 const/16 v4, 0x4f if-gt v5, v4, :cond_2 add-int/lit8 v5, v5, -0x20 goto :goto_1 :cond_2 if-ne v5, v6, :cond_3 const/16 v4, 0x3a goto :goto_2 .line 7 :cond_3 invoke-static {}, Lcom/google/zxing/FormatException;->getFormatInstance()Lcom/google/zxing/FormatException; move-result-object p0 throw p0 :pswitch_2 if-lt v5, v7, :cond_4 const/16 v4, 0x45 if-gt v5, v4, :cond_4 add-int/lit8 v5, v5, -0x26 goto :goto_1 :cond_4 const/16 v4, 0x46 if-lt v5, v4, :cond_5 const/16 v4, 0x57 if-gt v5, v4, :cond_5 add-int/lit8 v5, v5, -0xb goto :goto_1 .line 8 :cond_5 invoke-static {}, Lcom/google/zxing/FormatException;->getFormatInstance()Lcom/google/zxing/FormatException; move-result-object p0 throw p0 :pswitch_3 if-lt v5, v7, :cond_6 if-gt v5, v6, :cond_6 add-int/lit8 v5, v5, -0x40 :goto_1 int-to-char v4, v5 goto :goto_2 .line 9 :cond_6 invoke-static {}, Lcom/google/zxing/FormatException;->getFormatInstance()Lcom/google/zxing/FormatException; move-result-object p0 throw p0 .line 10 :goto_2 invoke-virtual {v1, v4}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder; goto :goto_3 .line 11 :cond_7 invoke-static {}, Lcom/google/zxing/FormatException;->getFormatInstance()Lcom/google/zxing/FormatException; move-result-object p0 throw p0 .line 12 :cond_8 invoke-virtual {v1, v4}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder; :goto_3 add-int/lit8 v3, v3, 0x1 goto :goto_0 nop :pswitch_data_0 .packed-switch 0x61 :pswitch_3 :pswitch_2 :pswitch_1 :pswitch_0 .end packed-switch .end method .method private static findAsteriskPattern(Lcom/google/zxing/common/BitArray;)[I .locals 12 .annotation system Ldalvik/annotation/Throws; value = { Lcom/google/zxing/NotFoundException; } .end annotation .line 1 invoke-virtual {p0}, Lcom/google/zxing/common/BitArray;->getSize()I move-result v0 const/4 v1, 0x0 .line 2 invoke-virtual {p0, v1}, Lcom/google/zxing/common/BitArray;->getNextSet(I)I move-result v2 const/4 v3, 0x6 new-array v3, v3, [I move v5, v1 move v6, v5 move v4, v2 :goto_0 if-ge v2, v0, :cond_3 .line 3 invoke-virtual {p0, v2}, Lcom/google/zxing/common/BitArray;->get(I)Z move-result v7 xor-int/2addr v7, v5 const/4 v8, 0x1 if-eqz v7, :cond_0 .line 4 aget v7, v3, v6 add-int/2addr v7, v8 aput v7, v3, v6 goto :goto_2 :cond_0 const/4 v7, 0x5 if-ne v6, v7, :cond_2 .line 5 invoke-static {v3}, Lcom/google/zxing/oned/Code93Reader;->toPattern([I)I move-result v9 sget v10, Lcom/google/zxing/oned/Code93Reader;->ASTERISK_ENCODING:I const/4 v11, 0x2 if-ne v9, v10, :cond_1 new-array p0, v11, [I aput v4, p0, v1 aput v2, p0, v8 return-object p0 .line 6 :cond_1 aget v9, v3, v1 aget v10, v3, v8 add-int/2addr v9, v10 add-int/2addr v4, v9 const/4 v9, 0x4 .line 7 invoke-static {v3, v11, v3, v1, v9}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V aput v1, v3, v9 aput v1, v3, v7 add-int/lit8 v6, v6, -0x1 goto :goto_1 :cond_2 add-int/lit8 v6, v6, 0x1 .line 8 :goto_1 aput v8, v3, v6 xor-int/lit8 v5, v5, 0x1 :goto_2 add-int/lit8 v2, v2, 0x1 goto :goto_0 .line 9 :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 .line 1 :goto_0 sget-object v1, Lcom/google/zxing/oned/Code93Reader;->CHARACTER_ENCODINGS:[I array-length v2, v1 if-ge v0, v2, :cond_1 .line 2 aget v1, v1, v0 if-ne v1, p0, :cond_0 .line 3 sget-object p0, Lcom/google/zxing/oned/Code93Reader;->ALPHABET:[C aget-char p0, p0, v0 return p0 :cond_0 add-int/lit8 v0, v0, 0x1 goto :goto_0 .line 4 :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 8 .line 1 array-length v0, p0 .line 2 array-length v1, p0 const/4 v2, 0x0 move v3, v2 move v4, v3 :goto_0 if-lt v3, v1, :cond_6 move v1, v2 move v3, v1 :goto_1 if-lt v1, v0, :cond_0 return v3 .line 3 :cond_0 aget v5, p0, v1 shl-int/lit8 v5, v5, 0x8 mul-int/lit8 v5, v5, 0x9 div-int/2addr v5, v4 shr-int/lit8 v6, v5, 0x8 and-int/lit16 v5, v5, 0xff const/16 v7, 0x7f if-le v5, v7, :cond_1 add-int/lit8 v6, v6, 0x1 :cond_1 const/4 v5, 0x1 if-lt v6, v5, :cond_5 const/4 v7, 0x4 if-le v6, v7, :cond_2 goto :goto_4 :cond_2 and-int/lit8 v7, v1, 0x1 if-nez v7, :cond_4 move v7, v2 :goto_2 if-lt v7, v6, :cond_3 goto :goto_3 :cond_3 shl-int/lit8 v3, v3, 0x1 or-int/2addr v3, v5 add-int/lit8 v7, v7, 0x1 goto :goto_2 :cond_4 shl-int/2addr v3, v6 :goto_3 add-int/lit8 v1, v1, 0x1 goto :goto_1 :cond_5 :goto_4 const/4 p0, -0x1 return p0 .line 4 :cond_6 aget v5, p0, v3 add-int/2addr v4, v5 add-int/lit8 v3, v3, 0x1 goto :goto_0 .end method # virtual methods .method public decodeRow(ILcom/google/zxing/common/BitArray;Ljava/util/Map;)Lcom/google/zxing/Result; .locals 11 .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 1 invoke-static {p2}, Lcom/google/zxing/oned/Code93Reader;->findAsteriskPattern(Lcom/google/zxing/common/BitArray;)[I move-result-object p3 const/4 v0, 0x1 .line 2 aget v1, p3, v0 invoke-virtual {p2, v1}, Lcom/google/zxing/common/BitArray;->getNextSet(I)I move-result v1 .line 3 invoke-virtual {p2}, Lcom/google/zxing/common/BitArray;->getSize()I move-result v2 .line 4 new-instance v3, Ljava/lang/StringBuilder; const/16 v4, 0x14 invoke-direct {v3, v4}, Ljava/lang/StringBuilder;->(I)V const/4 v4, 0x6 new-array v5, v4, [I .line 5 :goto_0 invoke-static {p2, v1, v5}, Lcom/google/zxing/oned/OneDReader;->recordPattern(Lcom/google/zxing/common/BitArray;I[I)V .line 6 invoke-static {v5}, Lcom/google/zxing/oned/Code93Reader;->toPattern([I)I move-result v6 if-ltz v6, :cond_4 .line 7 invoke-static {v6}, Lcom/google/zxing/oned/Code93Reader;->patternToChar(I)C move-result v6 .line 8 invoke-virtual {v3, v6}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder; const/4 v7, 0x0 move v9, v1 move v8, v7 :goto_1 if-lt v8, v4, :cond_3 .line 9 invoke-virtual {p2, v9}, Lcom/google/zxing/common/BitArray;->getNextSet(I)I move-result v8 const/16 v9, 0x2a if-ne v6, v9, :cond_2 .line 10 invoke-virtual {v3}, Ljava/lang/StringBuilder;->length()I move-result v4 sub-int/2addr v4, v0 invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->deleteCharAt(I)Ljava/lang/StringBuilder; if-eq v8, v2, :cond_1 .line 11 invoke-virtual {p2, v8}, Lcom/google/zxing/common/BitArray;->get(I)Z move-result p2 if-eqz p2, :cond_1 .line 12 invoke-virtual {v3}, Ljava/lang/StringBuilder;->length()I move-result p2 const/4 v2, 0x2 if-lt p2, v2, :cond_0 .line 13 invoke-static {v3}, Lcom/google/zxing/oned/Code93Reader;->checkChecksums(Ljava/lang/CharSequence;)V .line 14 invoke-virtual {v3}, Ljava/lang/StringBuilder;->length()I move-result p2 sub-int/2addr p2, v2 invoke-virtual {v3, p2}, Ljava/lang/StringBuilder;->setLength(I)V .line 15 invoke-static {v3}, Lcom/google/zxing/oned/Code93Reader;->decodeExtended(Ljava/lang/CharSequence;)Ljava/lang/String; move-result-object p2 .line 16 aget v3, p3, v0 aget p3, p3, v7 add-int/2addr v3, p3 int-to-float p3, v3 const/high16 v3, 0x40000000 # 2.0f div-float/2addr p3, v3 add-int/2addr v8, v1 int-to-float v1, v8 div-float/2addr v1, v3 .line 17 new-instance v3, Lcom/google/zxing/Result; const/4 v4, 0x0 new-array v2, v2, [Lcom/google/zxing/ResultPoint; .line 18 new-instance v5, Lcom/google/zxing/ResultPoint; int-to-float p1, p1 invoke-direct {v5, p3, p1}, Lcom/google/zxing/ResultPoint;->(FF)V aput-object v5, v2, v7 .line 19 new-instance p3, Lcom/google/zxing/ResultPoint; invoke-direct {p3, v1, p1}, Lcom/google/zxing/ResultPoint;->(FF)V aput-object p3, v2, v0 .line 20 sget-object p1, Lcom/google/zxing/BarcodeFormat;->CODE_93:Lcom/google/zxing/BarcodeFormat; .line 21 invoke-direct {v3, p2, v4, v2, p1}, Lcom/google/zxing/Result;->(Ljava/lang/String;[B[Lcom/google/zxing/ResultPoint;Lcom/google/zxing/BarcodeFormat;)V return-object v3 .line 22 :cond_0 invoke-static {}, Lcom/google/zxing/NotFoundException;->getNotFoundInstance()Lcom/google/zxing/NotFoundException; move-result-object p1 throw p1 .line 23 :cond_1 invoke-static {}, Lcom/google/zxing/NotFoundException;->getNotFoundInstance()Lcom/google/zxing/NotFoundException; move-result-object p1 throw p1 :cond_2 move v1, v8 goto :goto_0 .line 24 :cond_3 aget v10, v5, v8 add-int/2addr v9, v10 add-int/lit8 v8, v8, 0x1 goto :goto_1 .line 25 :cond_4 invoke-static {}, Lcom/google/zxing/NotFoundException;->getNotFoundInstance()Lcom/google/zxing/NotFoundException; move-result-object p1 throw p1 .end method