QRCodeMultiReader.smali
.class public final Lcom/google/zxing/multi/qrcode/QRCodeMultiReader;
.super Lcom/google/zxing/qrcode/QRCodeReader;
.source "QRCodeMultiReader.java"
# interfaces
.implements Lcom/google/zxing/multi/MultipleBarcodeReader;
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/google/zxing/multi/qrcode/QRCodeMultiReader$SAComparator;
}
.end annotation
# static fields
.field private static final EMPTY_RESULT_ARRAY:[Lcom/google/zxing/Result;
.field private static final NO_POINTS:[Lcom/google/zxing/ResultPoint;
# direct methods
.method static constructor <clinit>()V
.registers 2
const/4 v0, 0x0
new-array v1, v0, [Lcom/google/zxing/Result;
.line 50
sput-object v1, Lcom/google/zxing/multi/qrcode/QRCodeMultiReader;->EMPTY_RESULT_ARRAY:[Lcom/google/zxing/Result;
new-array v0, v0, [Lcom/google/zxing/ResultPoint;
.line 51
sput-object v0, Lcom/google/zxing/multi/qrcode/QRCodeMultiReader;->NO_POINTS:[Lcom/google/zxing/ResultPoint;
return-void
.end method
.method public constructor <init>()V
.registers 1
.line 48
invoke-direct {p0}, Lcom/google/zxing/qrcode/QRCodeReader;-><init>()V
return-void
.end method
.method private static processStructuredAppend(Ljava/util/List;)Ljava/util/List;
.registers 12
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/List<",
"Lcom/google/zxing/Result;",
">;)",
"Ljava/util/List<",
"Lcom/google/zxing/Result;",
">;"
}
.end annotation
.line 103
invoke-interface {p0}, Ljava/util/List;->iterator()Ljava/util/Iterator;
move-result-object v0
:cond_4
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
move-result v1
const/4 v2, 0x0
if-eqz v1, :cond_1f
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v1
check-cast v1, Lcom/google/zxing/Result;
.line 104
invoke-virtual {v1}, Lcom/google/zxing/Result;->getResultMetadata()Ljava/util/Map;
move-result-object v1
sget-object v3, Lcom/google/zxing/ResultMetadataType;->STRUCTURED_APPEND_SEQUENCE:Lcom/google/zxing/ResultMetadataType;
invoke-interface {v1, v3}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z
move-result v1
if-eqz v1, :cond_4
const/4 v0, 0x1
goto :goto_20
:cond_1f
const/4 v0, 0x0
:goto_20
if-nez v0, :cond_23
return-object p0
.line 114
:cond_23
new-instance v0, Ljava/util/ArrayList;
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
.line 115
new-instance v1, Ljava/util/ArrayList;
invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V
.line 116
invoke-interface {p0}, Ljava/util/List;->iterator()Ljava/util/Iterator;
move-result-object p0
:cond_31
:goto_31
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
move-result v3
if-eqz v3, :cond_50
invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v3
check-cast v3, Lcom/google/zxing/Result;
.line 117
invoke-interface {v0, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z
.line 118
invoke-virtual {v3}, Lcom/google/zxing/Result;->getResultMetadata()Ljava/util/Map;
move-result-object v4
sget-object v5, Lcom/google/zxing/ResultMetadataType;->STRUCTURED_APPEND_SEQUENCE:Lcom/google/zxing/ResultMetadataType;
invoke-interface {v4, v5}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z
move-result v4
if-eqz v4, :cond_31
.line 119
invoke-interface {v1, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z
goto :goto_31
.line 123
:cond_50
new-instance p0, Lcom/google/zxing/multi/qrcode/QRCodeMultiReader$SAComparator;
const/4 v3, 0x0
invoke-direct {p0, v3}, Lcom/google/zxing/multi/qrcode/QRCodeMultiReader$SAComparator;-><init>(Lcom/google/zxing/multi/qrcode/QRCodeMultiReader$1;)V
invoke-static {v1, p0}, Ljava/util/Collections;->sort(Ljava/util/List;Ljava/util/Comparator;)V
.line 124
new-instance p0, Ljava/lang/StringBuilder;
invoke-direct {p0}, Ljava/lang/StringBuilder;-><init>()V
.line 127
invoke-interface {v1}, Ljava/util/List;->iterator()Ljava/util/Iterator;
move-result-object v3
const/4 v4, 0x0
const/4 v5, 0x0
:cond_64
invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z
move-result v6
if-eqz v6, :cond_a8
invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v6
check-cast v6, Lcom/google/zxing/Result;
.line 128
invoke-virtual {v6}, Lcom/google/zxing/Result;->getText()Ljava/lang/String;
move-result-object v7
invoke-virtual {p0, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
.line 129
invoke-virtual {v6}, Lcom/google/zxing/Result;->getRawBytes()[B
move-result-object v7
array-length v7, v7
add-int/2addr v4, v7
.line 130
invoke-virtual {v6}, Lcom/google/zxing/Result;->getResultMetadata()Ljava/util/Map;
move-result-object v7
sget-object v8, Lcom/google/zxing/ResultMetadataType;->BYTE_SEGMENTS:Lcom/google/zxing/ResultMetadataType;
invoke-interface {v7, v8}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z
move-result v7
if-eqz v7, :cond_64
.line 133
invoke-virtual {v6}, Lcom/google/zxing/Result;->getResultMetadata()Ljava/util/Map;
move-result-object v6
sget-object v7, Lcom/google/zxing/ResultMetadataType;->BYTE_SEGMENTS:Lcom/google/zxing/ResultMetadataType;
invoke-interface {v6, v7}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v6
check-cast v6, Ljava/lang/Iterable;
.line 134
invoke-interface {v6}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
move-result-object v6
:goto_99
invoke-interface {v6}, Ljava/util/Iterator;->hasNext()Z
move-result v7
if-eqz v7, :cond_64
invoke-interface {v6}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v7
check-cast v7, [B
.line 135
array-length v7, v7
add-int/2addr v5, v7
goto :goto_99
.line 139
:cond_a8
new-array v3, v4, [B
.line 140
new-array v4, v5, [B
.line 143
invoke-interface {v1}, Ljava/util/List;->iterator()Ljava/util/Iterator;
move-result-object v1
const/4 v6, 0x0
const/4 v7, 0x0
:cond_b2
invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
move-result v8
if-eqz v8, :cond_ff
invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v8
check-cast v8, Lcom/google/zxing/Result;
.line 144
invoke-virtual {v8}, Lcom/google/zxing/Result;->getRawBytes()[B
move-result-object v9
invoke-virtual {v8}, Lcom/google/zxing/Result;->getRawBytes()[B
move-result-object v10
array-length v10, v10
invoke-static {v9, v2, v3, v6, v10}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
.line 145
invoke-virtual {v8}, Lcom/google/zxing/Result;->getRawBytes()[B
move-result-object v9
array-length v9, v9
add-int/2addr v6, v9
.line 146
invoke-virtual {v8}, Lcom/google/zxing/Result;->getResultMetadata()Ljava/util/Map;
move-result-object v9
sget-object v10, Lcom/google/zxing/ResultMetadataType;->BYTE_SEGMENTS:Lcom/google/zxing/ResultMetadataType;
invoke-interface {v9, v10}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z
move-result v9
if-eqz v9, :cond_b2
.line 149
invoke-virtual {v8}, Lcom/google/zxing/Result;->getResultMetadata()Ljava/util/Map;
move-result-object v8
sget-object v9, Lcom/google/zxing/ResultMetadataType;->BYTE_SEGMENTS:Lcom/google/zxing/ResultMetadataType;
invoke-interface {v8, v9}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v8
check-cast v8, Ljava/lang/Iterable;
.line 150
invoke-interface {v8}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
move-result-object v8
:goto_ec
invoke-interface {v8}, Ljava/util/Iterator;->hasNext()Z
move-result v9
if-eqz v9, :cond_b2
invoke-interface {v8}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v9
check-cast v9, [B
.line 151
array-length v10, v9
invoke-static {v9, v2, v4, v7, v10}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
.line 152
array-length v9, v9
add-int/2addr v7, v9
goto :goto_ec
.line 156
:cond_ff
new-instance v1, Lcom/google/zxing/Result;
invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p0
sget-object v2, Lcom/google/zxing/multi/qrcode/QRCodeMultiReader;->NO_POINTS:[Lcom/google/zxing/ResultPoint;
sget-object v6, Lcom/google/zxing/BarcodeFormat;->QR_CODE:Lcom/google/zxing/BarcodeFormat;
invoke-direct {v1, p0, v3, v2, v6}, Lcom/google/zxing/Result;-><init>(Ljava/lang/String;[B[Lcom/google/zxing/ResultPoint;Lcom/google/zxing/BarcodeFormat;)V
if-lez v5, :cond_11b
.line 158
new-instance p0, Ljava/util/ArrayList;
invoke-direct {p0}, Ljava/util/ArrayList;-><init>()V
.line 159
invoke-interface {p0, v4}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
.line 160
sget-object v2, Lcom/google/zxing/ResultMetadataType;->BYTE_SEGMENTS:Lcom/google/zxing/ResultMetadataType;
invoke-virtual {v1, v2, p0}, Lcom/google/zxing/Result;->putMetadata(Lcom/google/zxing/ResultMetadataType;Ljava/lang/Object;)V
.line 162
:cond_11b
invoke-interface {v0, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
return-object v0
.end method
# virtual methods
.method public decodeMultiple(Lcom/google/zxing/BinaryBitmap;)[Lcom/google/zxing/Result;
.registers 3
.annotation system Ldalvik/annotation/Throws;
value = {
Lcom/google/zxing/NotFoundException;
}
.end annotation
const/4 v0, 0x0
.line 55
invoke-virtual {p0, p1, v0}, Lcom/google/zxing/multi/qrcode/QRCodeMultiReader;->decodeMultiple(Lcom/google/zxing/BinaryBitmap;Ljava/util/Map;)[Lcom/google/zxing/Result;
move-result-object p1
return-object p1
.end method
.method public decodeMultiple(Lcom/google/zxing/BinaryBitmap;Ljava/util/Map;)[Lcom/google/zxing/Result;
.registers 12
.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;
}
.end annotation
.line 60
new-instance v0, Ljava/util/ArrayList;
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
.line 61
new-instance v1, Lcom/google/zxing/multi/qrcode/detector/MultiDetector;
invoke-virtual {p1}, Lcom/google/zxing/BinaryBitmap;->getBlackMatrix()Lcom/google/zxing/common/BitMatrix;
move-result-object p1
invoke-direct {v1, p1}, Lcom/google/zxing/multi/qrcode/detector/MultiDetector;-><init>(Lcom/google/zxing/common/BitMatrix;)V
invoke-virtual {v1, p2}, Lcom/google/zxing/multi/qrcode/detector/MultiDetector;->detectMulti(Ljava/util/Map;)[Lcom/google/zxing/common/DetectorResult;
move-result-object p1
.line 62
array-length v1, p1
const/4 v2, 0x0
:goto_14
if-ge v2, v1, :cond_84
aget-object v3, p1, v2
.line 64
:try_start_18
invoke-virtual {p0}, Lcom/google/zxing/multi/qrcode/QRCodeMultiReader;->getDecoder()Lcom/google/zxing/qrcode/decoder/Decoder;
move-result-object v4
invoke-virtual {v3}, Lcom/google/zxing/common/DetectorResult;->getBits()Lcom/google/zxing/common/BitMatrix;
move-result-object v5
invoke-virtual {v4, v5, p2}, Lcom/google/zxing/qrcode/decoder/Decoder;->decode(Lcom/google/zxing/common/BitMatrix;Ljava/util/Map;)Lcom/google/zxing/common/DecoderResult;
move-result-object v4
.line 65
invoke-virtual {v3}, Lcom/google/zxing/common/DetectorResult;->getPoints()[Lcom/google/zxing/ResultPoint;
move-result-object v3
.line 67
invoke-virtual {v4}, Lcom/google/zxing/common/DecoderResult;->getOther()Ljava/lang/Object;
move-result-object v5
instance-of v5, v5, Lcom/google/zxing/qrcode/decoder/QRCodeDecoderMetaData;
if-eqz v5, :cond_39
.line 68
invoke-virtual {v4}, Lcom/google/zxing/common/DecoderResult;->getOther()Ljava/lang/Object;
move-result-object v5
check-cast v5, Lcom/google/zxing/qrcode/decoder/QRCodeDecoderMetaData;
invoke-virtual {v5, v3}, Lcom/google/zxing/qrcode/decoder/QRCodeDecoderMetaData;->applyMirroredCorrection([Lcom/google/zxing/ResultPoint;)V
.line 70
:cond_39
new-instance v5, Lcom/google/zxing/Result;
invoke-virtual {v4}, Lcom/google/zxing/common/DecoderResult;->getText()Ljava/lang/String;
move-result-object v6
invoke-virtual {v4}, Lcom/google/zxing/common/DecoderResult;->getRawBytes()[B
move-result-object v7
sget-object v8, Lcom/google/zxing/BarcodeFormat;->QR_CODE:Lcom/google/zxing/BarcodeFormat;
invoke-direct {v5, v6, v7, v3, v8}, Lcom/google/zxing/Result;-><init>(Ljava/lang/String;[B[Lcom/google/zxing/ResultPoint;Lcom/google/zxing/BarcodeFormat;)V
.line 72
invoke-virtual {v4}, Lcom/google/zxing/common/DecoderResult;->getByteSegments()Ljava/util/List;
move-result-object v3
if-eqz v3, :cond_53
.line 74
sget-object v6, Lcom/google/zxing/ResultMetadataType;->BYTE_SEGMENTS:Lcom/google/zxing/ResultMetadataType;
invoke-virtual {v5, v6, v3}, Lcom/google/zxing/Result;->putMetadata(Lcom/google/zxing/ResultMetadataType;Ljava/lang/Object;)V
.line 76
:cond_53
invoke-virtual {v4}, Lcom/google/zxing/common/DecoderResult;->getECLevel()Ljava/lang/String;
move-result-object v3
if-eqz v3, :cond_5e
.line 78
sget-object v6, Lcom/google/zxing/ResultMetadataType;->ERROR_CORRECTION_LEVEL:Lcom/google/zxing/ResultMetadataType;
invoke-virtual {v5, v6, v3}, Lcom/google/zxing/Result;->putMetadata(Lcom/google/zxing/ResultMetadataType;Ljava/lang/Object;)V
.line 80
:cond_5e
invoke-virtual {v4}, Lcom/google/zxing/common/DecoderResult;->hasStructuredAppend()Z
move-result v3
if-eqz v3, :cond_7e
.line 81
sget-object v3, Lcom/google/zxing/ResultMetadataType;->STRUCTURED_APPEND_SEQUENCE:Lcom/google/zxing/ResultMetadataType;
.line 82
invoke-virtual {v4}, Lcom/google/zxing/common/DecoderResult;->getStructuredAppendSequenceNumber()I
move-result v6
invoke-static {v6}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v6
.line 81
invoke-virtual {v5, v3, v6}, Lcom/google/zxing/Result;->putMetadata(Lcom/google/zxing/ResultMetadataType;Ljava/lang/Object;)V
.line 83
sget-object v3, Lcom/google/zxing/ResultMetadataType;->STRUCTURED_APPEND_PARITY:Lcom/google/zxing/ResultMetadataType;
.line 84
invoke-virtual {v4}, Lcom/google/zxing/common/DecoderResult;->getStructuredAppendParity()I
move-result v4
invoke-static {v4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v4
.line 83
invoke-virtual {v5, v3, v4}, Lcom/google/zxing/Result;->putMetadata(Lcom/google/zxing/ResultMetadataType;Ljava/lang/Object;)V
.line 86
:cond_7e
invoke-interface {v0, v5}, Ljava/util/List;->add(Ljava/lang/Object;)Z
:try_end_81
.catch Lcom/google/zxing/ReaderException; {:try_start_18 .. :try_end_81} :catch_81
:catch_81
add-int/lit8 v2, v2, 0x1
goto :goto_14
.line 91
:cond_84
invoke-interface {v0}, Ljava/util/List;->isEmpty()Z
move-result p1
if-eqz p1, :cond_8d
.line 92
sget-object p1, Lcom/google/zxing/multi/qrcode/QRCodeMultiReader;->EMPTY_RESULT_ARRAY:[Lcom/google/zxing/Result;
return-object p1
.line 94
:cond_8d
invoke-static {v0}, Lcom/google/zxing/multi/qrcode/QRCodeMultiReader;->processStructuredAppend(Ljava/util/List;)Ljava/util/List;
move-result-object p1
.line 95
invoke-interface {p1}, Ljava/util/List;->size()I
move-result p2
new-array p2, p2, [Lcom/google/zxing/Result;
invoke-interface {p1, p2}, Ljava/util/List;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;
move-result-object p1
check-cast p1, [Lcom/google/zxing/Result;
return-object p1
.end method