171 lines
4.6 KiB
Smali
171 lines
4.6 KiB
Smali
.class public final Lcom/google/zxing/aztec/AztecReader;
|
|
.super Ljava/lang/Object;
|
|
.source "AztecReader.java"
|
|
|
|
# interfaces
|
|
.implements Lcom/google/zxing/Reader;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
.line 1
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.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/FormatException;
|
|
}
|
|
.end annotation
|
|
|
|
const/4 v0, 0x0
|
|
|
|
.line 1
|
|
invoke-virtual {p0, p1, v0}, Lcom/google/zxing/aztec/AztecReader;->decode(Lcom/google/zxing/BinaryBitmap;Ljava/util/Map;)Lcom/google/zxing/Result;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public decode(Lcom/google/zxing/BinaryBitmap;Ljava/util/Map;)Lcom/google/zxing/Result;
|
|
.locals 4
|
|
.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/FormatException;
|
|
}
|
|
.end annotation
|
|
|
|
.line 2
|
|
new-instance v0, Lcom/google/zxing/aztec/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/aztec/detector/Detector;-><init>(Lcom/google/zxing/common/BitMatrix;)V
|
|
|
|
invoke-virtual {v0}, Lcom/google/zxing/aztec/detector/Detector;->detect()Lcom/google/zxing/aztec/AztecDetectorResult;
|
|
|
|
move-result-object p1
|
|
|
|
.line 3
|
|
invoke-virtual {p1}, Lcom/google/zxing/common/DetectorResult;->getPoints()[Lcom/google/zxing/ResultPoint;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz p2, :cond_1
|
|
|
|
.line 4
|
|
sget-object v1, Lcom/google/zxing/DecodeHintType;->NEED_RESULT_POINT_CALLBACK:Lcom/google/zxing/DecodeHintType;
|
|
|
|
invoke-interface {p2, v1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object p2
|
|
|
|
check-cast p2, Lcom/google/zxing/ResultPointCallback;
|
|
|
|
if-eqz p2, :cond_1
|
|
|
|
.line 5
|
|
array-length v1, v0
|
|
|
|
const/4 v2, 0x0
|
|
|
|
:goto_0
|
|
if-lt v2, v1, :cond_0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_0
|
|
aget-object v3, v0, v2
|
|
|
|
.line 6
|
|
invoke-interface {p2, v3}, Lcom/google/zxing/ResultPointCallback;->foundPossibleResultPoint(Lcom/google/zxing/ResultPoint;)V
|
|
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
.line 7
|
|
:cond_1
|
|
:goto_1
|
|
new-instance p2, Lcom/google/zxing/aztec/decoder/Decoder;
|
|
|
|
invoke-direct {p2}, Lcom/google/zxing/aztec/decoder/Decoder;-><init>()V
|
|
|
|
invoke-virtual {p2, p1}, Lcom/google/zxing/aztec/decoder/Decoder;->decode(Lcom/google/zxing/aztec/AztecDetectorResult;)Lcom/google/zxing/common/DecoderResult;
|
|
|
|
move-result-object p1
|
|
|
|
.line 8
|
|
new-instance p2, Lcom/google/zxing/Result;
|
|
|
|
invoke-virtual {p1}, Lcom/google/zxing/common/DecoderResult;->getText()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {p1}, Lcom/google/zxing/common/DecoderResult;->getRawBytes()[B
|
|
|
|
move-result-object v2
|
|
|
|
sget-object v3, Lcom/google/zxing/BarcodeFormat;->AZTEC:Lcom/google/zxing/BarcodeFormat;
|
|
|
|
invoke-direct {p2, v1, v2, v0, v3}, Lcom/google/zxing/Result;-><init>(Ljava/lang/String;[B[Lcom/google/zxing/ResultPoint;Lcom/google/zxing/BarcodeFormat;)V
|
|
|
|
.line 9
|
|
invoke-virtual {p1}, Lcom/google/zxing/common/DecoderResult;->getByteSegments()Ljava/util/List;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
.line 10
|
|
sget-object v1, Lcom/google/zxing/ResultMetadataType;->BYTE_SEGMENTS:Lcom/google/zxing/ResultMetadataType;
|
|
|
|
invoke-virtual {p2, v1, v0}, Lcom/google/zxing/Result;->putMetadata(Lcom/google/zxing/ResultMetadataType;Ljava/lang/Object;)V
|
|
|
|
.line 11
|
|
:cond_2
|
|
invoke-virtual {p1}, Lcom/google/zxing/common/DecoderResult;->getECLevel()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
if-eqz p1, :cond_3
|
|
|
|
.line 12
|
|
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
|
|
|
|
:cond_3
|
|
return-object p2
|
|
.end method
|
|
|
|
.method public reset()V
|
|
.locals 0
|
|
|
|
return-void
|
|
.end method
|