.class public Lcom/google/zxing/qrcode/QRCodeReader; .super Ljava/lang/Object; .source "QRCodeReader.java" # interfaces .implements Lcom/google/zxing/Reader; # static fields .field private static final NO_POINTS:[Lcom/google/zxing/ResultPoint; # instance fields .field private final decoder:Lcom/google/zxing/qrcode/decoder/Decoder; # direct methods .method static constructor ()V .locals 1 const/4 v0, 0x0 new-array v0, v0, [Lcom/google/zxing/ResultPoint; sput-object v0, Lcom/google/zxing/qrcode/QRCodeReader;->NO_POINTS:[Lcom/google/zxing/ResultPoint; return-void .end method .method public constructor ()V .locals 1 .line 44 invoke-direct {p0}, Ljava/lang/Object;->()V .line 48 new-instance v0, Lcom/google/zxing/qrcode/decoder/Decoder; invoke-direct {v0}, Lcom/google/zxing/qrcode/decoder/Decoder;->()V iput-object v0, p0, Lcom/google/zxing/qrcode/QRCodeReader;->decoder:Lcom/google/zxing/qrcode/decoder/Decoder; return-void .end method .method private static extractPureBits(Lcom/google/zxing/common/BitMatrix;)Lcom/google/zxing/common/BitMatrix; .locals 11 .annotation system Ldalvik/annotation/Throws; value = { Lcom/google/zxing/NotFoundException; } .end annotation .line 118 invoke-virtual {p0}, Lcom/google/zxing/common/BitMatrix;->getTopLeftOnBit()[I move-result-object v0 .line 119 invoke-virtual {p0}, Lcom/google/zxing/common/BitMatrix;->getBottomRightOnBit()[I move-result-object v1 if-eqz v0, :cond_c if-eqz v1, :cond_c .line 124 invoke-static {v0, p0}, Lcom/google/zxing/qrcode/QRCodeReader;->moduleSize([ILcom/google/zxing/common/BitMatrix;)F move-result v2 const/4 v3, 0x1 .line 126 aget v4, v0, v3 .line 127 aget v5, v1, v3 const/4 v6, 0x0 .line 128 aget v0, v0, v6 .line 129 aget v1, v1, v6 if-ge v0, v1, :cond_b if-ge v4, v5, :cond_b sub-int v7, v5, v4 sub-int v8, v1, v0 if-eq v7, v8, :cond_1 add-int v1, v0, v7 .line 140 invoke-virtual {p0}, Lcom/google/zxing/common/BitMatrix;->getWidth()I move-result v8 if-ge v1, v8, :cond_0 goto :goto_0 .line 142 :cond_0 invoke-static {}, Lcom/google/zxing/NotFoundException;->getNotFoundInstance()Lcom/google/zxing/NotFoundException; move-result-object p0 throw p0 :cond_1 :goto_0 sub-int v8, v1, v0 add-int/2addr v8, v3 int-to-float v8, v8 div-float/2addr v8, v2 .line 146 invoke-static {v8}, Ljava/lang/Math;->round(F)I move-result v8 add-int/2addr v7, v3 int-to-float v3, v7 div-float/2addr v3, v2 .line 147 invoke-static {v3}, Ljava/lang/Math;->round(F)I move-result v3 if-lez v8, :cond_a if-lez v3, :cond_a if-ne v3, v8, :cond_9 const/high16 v7, 0x40000000 # 2.0f div-float v7, v2, v7 float-to-int v7, v7 add-int/2addr v4, v7 add-int/2addr v0, v7 add-int/lit8 v9, v8, -0x1 int-to-float v9, v9 mul-float/2addr v9, v2 float-to-int v9, v9 add-int/2addr v9, v0 sub-int/2addr v9, v1 if-lez v9, :cond_3 if-gt v9, v7, :cond_2 sub-int/2addr v0, v9 goto :goto_1 .line 170 :cond_2 invoke-static {}, Lcom/google/zxing/NotFoundException;->getNotFoundInstance()Lcom/google/zxing/NotFoundException; move-result-object p0 throw p0 :cond_3 :goto_1 add-int/lit8 v1, v3, -0x1 int-to-float v1, v1 mul-float/2addr v1, v2 float-to-int v1, v1 add-int/2addr v1, v4 sub-int/2addr v1, v5 if-lez v1, :cond_5 if-gt v1, v7, :cond_4 sub-int/2addr v4, v1 goto :goto_2 .line 179 :cond_4 invoke-static {}, Lcom/google/zxing/NotFoundException;->getNotFoundInstance()Lcom/google/zxing/NotFoundException; move-result-object p0 throw p0 .line 185 :cond_5 :goto_2 new-instance v1, Lcom/google/zxing/common/BitMatrix; invoke-direct {v1, v8, v3}, Lcom/google/zxing/common/BitMatrix;->(II)V move v5, v6 :goto_3 if-ge v5, v3, :cond_8 int-to-float v7, v5 mul-float/2addr v7, v2 float-to-int v7, v7 add-int/2addr v7, v4 move v9, v6 :goto_4 if-ge v9, v8, :cond_7 int-to-float v10, v9 mul-float/2addr v10, v2 float-to-int v10, v10 add-int/2addr v10, v0 .line 189 invoke-virtual {p0, v10, v7}, Lcom/google/zxing/common/BitMatrix;->get(II)Z move-result v10 if-eqz v10, :cond_6 .line 190 invoke-virtual {v1, v9, v5}, Lcom/google/zxing/common/BitMatrix;->set(II)V :cond_6 add-int/lit8 v9, v9, 0x1 goto :goto_4 :cond_7 add-int/lit8 v5, v5, 0x1 goto :goto_3 :cond_8 return-object v1 .line 153 :cond_9 invoke-static {}, Lcom/google/zxing/NotFoundException;->getNotFoundInstance()Lcom/google/zxing/NotFoundException; move-result-object p0 throw p0 .line 149 :cond_a invoke-static {}, Lcom/google/zxing/NotFoundException;->getNotFoundInstance()Lcom/google/zxing/NotFoundException; move-result-object p0 throw p0 .line 133 :cond_b invoke-static {}, Lcom/google/zxing/NotFoundException;->getNotFoundInstance()Lcom/google/zxing/NotFoundException; move-result-object p0 throw p0 .line 121 :cond_c invoke-static {}, Lcom/google/zxing/NotFoundException;->getNotFoundInstance()Lcom/google/zxing/NotFoundException; move-result-object p0 throw p0 .end method .method private static moduleSize([ILcom/google/zxing/common/BitMatrix;)F .locals 8 .annotation system Ldalvik/annotation/Throws; value = { Lcom/google/zxing/NotFoundException; } .end annotation .line 198 invoke-virtual {p1}, Lcom/google/zxing/common/BitMatrix;->getHeight()I move-result v0 .line 199 invoke-virtual {p1}, Lcom/google/zxing/common/BitMatrix;->getWidth()I move-result v1 const/4 v2, 0x0 .line 200 aget v3, p0, v2 const/4 v4, 0x1 .line 201 aget v5, p0, v4 move v6, v2 :goto_0 if-ge v3, v1, :cond_1 if-ge v5, v0, :cond_1 .line 205 invoke-virtual {p1, v3, v5}, Lcom/google/zxing/common/BitMatrix;->get(II)Z move-result v7 if-eq v4, v7, :cond_0 add-int/lit8 v6, v6, 0x1 const/4 v7, 0x5 if-eq v6, v7, :cond_1 xor-int/lit8 v4, v4, 0x1 :cond_0 add-int/lit8 v3, v3, 0x1 add-int/lit8 v5, v5, 0x1 goto :goto_0 :cond_1 if-eq v3, v1, :cond_2 if-eq v5, v0, :cond_2 .line 217 aget p0, p0, v2 sub-int/2addr v3, p0 int-to-float p0, v3 const/high16 p1, 0x40e00000 # 7.0f div-float/2addr p0, p1 return p0 .line 215 :cond_2 invoke-static {}, Lcom/google/zxing/NotFoundException;->getNotFoundInstance()Lcom/google/zxing/NotFoundException; move-result-object p0 throw p0 .end method # virtual methods .method public decode(Lcom/google/zxing/BinaryBitmap;)Lcom/google/zxing/Result; .locals 1 .annotation system Ldalvik/annotation/Throws; value = { Lcom/google/zxing/NotFoundException;, Lcom/google/zxing/ChecksumException;, Lcom/google/zxing/FormatException; } .end annotation const/4 v0, 0x0 .line 64 invoke-virtual {p0, p1, v0}, Lcom/google/zxing/qrcode/QRCodeReader;->decode(Lcom/google/zxing/BinaryBitmap;Ljava/util/Map;)Lcom/google/zxing/Result; move-result-object p0 return-object p0 .end method .method public final decode(Lcom/google/zxing/BinaryBitmap;Ljava/util/Map;)Lcom/google/zxing/Result; .locals 3 .annotation system Ldalvik/annotation/Signature; value = { "(", "Lcom/google/zxing/BinaryBitmap;", "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 if-eqz p2, :cond_0 .line 72 sget-object v0, Lcom/google/zxing/DecodeHintType;->PURE_BARCODE:Lcom/google/zxing/DecodeHintType; invoke-interface {p2, v0}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z move-result v0 if-eqz v0, :cond_0 .line 73 invoke-virtual {p1}, Lcom/google/zxing/BinaryBitmap;->getBlackMatrix()Lcom/google/zxing/common/BitMatrix; move-result-object p1 invoke-static {p1}, Lcom/google/zxing/qrcode/QRCodeReader;->extractPureBits(Lcom/google/zxing/common/BitMatrix;)Lcom/google/zxing/common/BitMatrix; move-result-object p1 iget-object p0, p0, Lcom/google/zxing/qrcode/QRCodeReader;->decoder:Lcom/google/zxing/qrcode/decoder/Decoder; .line 74 invoke-virtual {p0, p1, p2}, Lcom/google/zxing/qrcode/decoder/Decoder;->decode(Lcom/google/zxing/common/BitMatrix;Ljava/util/Map;)Lcom/google/zxing/common/DecoderResult; move-result-object p0 sget-object p1, Lcom/google/zxing/qrcode/QRCodeReader;->NO_POINTS:[Lcom/google/zxing/ResultPoint; goto :goto_0 .line 77 :cond_0 new-instance v0, Lcom/google/zxing/qrcode/detector/Detector; invoke-virtual {p1}, Lcom/google/zxing/BinaryBitmap;->getBlackMatrix()Lcom/google/zxing/common/BitMatrix; move-result-object p1 invoke-direct {v0, p1}, Lcom/google/zxing/qrcode/detector/Detector;->(Lcom/google/zxing/common/BitMatrix;)V invoke-virtual {v0, p2}, Lcom/google/zxing/qrcode/detector/Detector;->detect(Ljava/util/Map;)Lcom/google/zxing/common/DetectorResult; move-result-object p1 iget-object p0, p0, Lcom/google/zxing/qrcode/QRCodeReader;->decoder:Lcom/google/zxing/qrcode/decoder/Decoder; .line 78 invoke-virtual {p1}, Lcom/google/zxing/common/DetectorResult;->getBits()Lcom/google/zxing/common/BitMatrix; move-result-object v0 invoke-virtual {p0, v0, p2}, Lcom/google/zxing/qrcode/decoder/Decoder;->decode(Lcom/google/zxing/common/BitMatrix;Ljava/util/Map;)Lcom/google/zxing/common/DecoderResult; move-result-object p0 .line 79 invoke-virtual {p1}, Lcom/google/zxing/common/DetectorResult;->getPoints()[Lcom/google/zxing/ResultPoint; move-result-object p1 .line 83 :goto_0 invoke-virtual {p0}, Lcom/google/zxing/common/DecoderResult;->getOther()Ljava/lang/Object; move-result-object p2 instance-of p2, p2, Lcom/google/zxing/qrcode/decoder/QRCodeDecoderMetaData; if-eqz p2, :cond_1 .line 84 invoke-virtual {p0}, Lcom/google/zxing/common/DecoderResult;->getOther()Ljava/lang/Object; move-result-object p2 check-cast p2, Lcom/google/zxing/qrcode/decoder/QRCodeDecoderMetaData; invoke-virtual {p2, p1}, Lcom/google/zxing/qrcode/decoder/QRCodeDecoderMetaData;->applyMirroredCorrection([Lcom/google/zxing/ResultPoint;)V .line 87 :cond_1 new-instance p2, Lcom/google/zxing/Result; invoke-virtual {p0}, Lcom/google/zxing/common/DecoderResult;->getText()Ljava/lang/String; move-result-object v0 invoke-virtual {p0}, Lcom/google/zxing/common/DecoderResult;->getRawBytes()[B move-result-object v1 sget-object v2, Lcom/google/zxing/BarcodeFormat;->QR_CODE:Lcom/google/zxing/BarcodeFormat; invoke-direct {p2, v0, v1, p1, v2}, Lcom/google/zxing/Result;->(Ljava/lang/String;[B[Lcom/google/zxing/ResultPoint;Lcom/google/zxing/BarcodeFormat;)V .line 88 invoke-virtual {p0}, Lcom/google/zxing/common/DecoderResult;->getByteSegments()Ljava/util/List; move-result-object p1 if-eqz p1, :cond_2 .line 90 sget-object v0, Lcom/google/zxing/ResultMetadataType;->BYTE_SEGMENTS:Lcom/google/zxing/ResultMetadataType; invoke-virtual {p2, v0, p1}, Lcom/google/zxing/Result;->putMetadata(Lcom/google/zxing/ResultMetadataType;Ljava/lang/Object;)V .line 92 :cond_2 invoke-virtual {p0}, Lcom/google/zxing/common/DecoderResult;->getECLevel()Ljava/lang/String; move-result-object p1 if-eqz p1, :cond_3 .line 94 sget-object v0, Lcom/google/zxing/ResultMetadataType;->ERROR_CORRECTION_LEVEL:Lcom/google/zxing/ResultMetadataType; invoke-virtual {p2, v0, p1}, Lcom/google/zxing/Result;->putMetadata(Lcom/google/zxing/ResultMetadataType;Ljava/lang/Object;)V .line 96 :cond_3 invoke-virtual {p0}, Lcom/google/zxing/common/DecoderResult;->hasStructuredAppend()Z move-result p1 if-eqz p1, :cond_4 .line 97 sget-object p1, Lcom/google/zxing/ResultMetadataType;->STRUCTURED_APPEND_SEQUENCE:Lcom/google/zxing/ResultMetadataType; .line 98 invoke-virtual {p0}, Lcom/google/zxing/common/DecoderResult;->getStructuredAppendSequenceNumber()I move-result v0 invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer; move-result-object v0 .line 97 invoke-virtual {p2, p1, v0}, Lcom/google/zxing/Result;->putMetadata(Lcom/google/zxing/ResultMetadataType;Ljava/lang/Object;)V .line 99 sget-object p1, Lcom/google/zxing/ResultMetadataType;->STRUCTURED_APPEND_PARITY:Lcom/google/zxing/ResultMetadataType; .line 100 invoke-virtual {p0}, Lcom/google/zxing/common/DecoderResult;->getStructuredAppendParity()I move-result p0 invoke-static {p0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer; move-result-object p0 .line 99 invoke-virtual {p2, p1, p0}, Lcom/google/zxing/Result;->putMetadata(Lcom/google/zxing/ResultMetadataType;Ljava/lang/Object;)V :cond_4 return-object p2 .end method .method protected final getDecoder()Lcom/google/zxing/qrcode/decoder/Decoder; .locals 0 iget-object p0, p0, Lcom/google/zxing/qrcode/QRCodeReader;->decoder:Lcom/google/zxing/qrcode/decoder/Decoder; return-object p0 .end method .method public reset()V .locals 0 return-void .end method