Rabbit-R1/android (non root)/smali/smali_classes3/com/google/zxing/MultiFormatReader.smali
2024-05-21 17:08:36 -04:00

555 lines
14 KiB
Smali

.class public final Lcom/google/zxing/MultiFormatReader;
.super Ljava/lang/Object;
.source "MultiFormatReader.java"
# interfaces
.implements Lcom/google/zxing/Reader;
# static fields
.field private static final EMPTY_READER_ARRAY:[Lcom/google/zxing/Reader;
# instance fields
.field private hints:Ljava/util/Map;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/Map<",
"Lcom/google/zxing/DecodeHintType;",
"*>;"
}
.end annotation
.end field
.field private readers:[Lcom/google/zxing/Reader;
# direct methods
.method static constructor <clinit>()V
.locals 1
const/4 v0, 0x0
new-array v0, v0, [Lcom/google/zxing/Reader;
sput-object v0, Lcom/google/zxing/MultiFormatReader;->EMPTY_READER_ARRAY:[Lcom/google/zxing/Reader;
return-void
.end method
.method public constructor <init>()V
.locals 0
.line 38
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method private decodeInternal(Lcom/google/zxing/BinaryBitmap;)Lcom/google/zxing/Result;
.locals 5
.annotation system Ldalvik/annotation/Throws;
value = {
Lcom/google/zxing/NotFoundException;
}
.end annotation
iget-object v0, p0, Lcom/google/zxing/MultiFormatReader;->readers:[Lcom/google/zxing/Reader;
if-eqz v0, :cond_0
.line 171
array-length v1, v0
const/4 v2, 0x0
:goto_0
if-ge v2, v1, :cond_0
aget-object v3, v0, v2
:try_start_0
iget-object v4, p0, Lcom/google/zxing/MultiFormatReader;->hints:Ljava/util/Map;
.line 173
invoke-interface {v3, p1, v4}, Lcom/google/zxing/Reader;->decode(Lcom/google/zxing/BinaryBitmap;Ljava/util/Map;)Lcom/google/zxing/Result;
move-result-object p0
:try_end_0
.catch Lcom/google/zxing/ReaderException; {:try_start_0 .. :try_end_0} :catch_0
return-object p0
:catch_0
add-int/lit8 v2, v2, 0x1
goto :goto_0
.line 179
:cond_0
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;
}
.end annotation
const/4 v0, 0x0
.line 56
invoke-virtual {p0, v0}, Lcom/google/zxing/MultiFormatReader;->setHints(Ljava/util/Map;)V
.line 57
invoke-direct {p0, p1}, Lcom/google/zxing/MultiFormatReader;->decodeInternal(Lcom/google/zxing/BinaryBitmap;)Lcom/google/zxing/Result;
move-result-object p0
return-object p0
.end method
.method public decode(Lcom/google/zxing/BinaryBitmap;Ljava/util/Map;)Lcom/google/zxing/Result;
.locals 0
.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 70
invoke-virtual {p0, p2}, Lcom/google/zxing/MultiFormatReader;->setHints(Ljava/util/Map;)V
.line 71
invoke-direct {p0, p1}, Lcom/google/zxing/MultiFormatReader;->decodeInternal(Lcom/google/zxing/BinaryBitmap;)Lcom/google/zxing/Result;
move-result-object p0
return-object p0
.end method
.method public decodeWithState(Lcom/google/zxing/BinaryBitmap;)Lcom/google/zxing/Result;
.locals 1
.annotation system Ldalvik/annotation/Throws;
value = {
Lcom/google/zxing/NotFoundException;
}
.end annotation
iget-object v0, p0, Lcom/google/zxing/MultiFormatReader;->readers:[Lcom/google/zxing/Reader;
if-nez v0, :cond_0
const/4 v0, 0x0
.line 85
invoke-virtual {p0, v0}, Lcom/google/zxing/MultiFormatReader;->setHints(Ljava/util/Map;)V
.line 87
:cond_0
invoke-direct {p0, p1}, Lcom/google/zxing/MultiFormatReader;->decodeInternal(Lcom/google/zxing/BinaryBitmap;)Lcom/google/zxing/Result;
move-result-object p0
return-object p0
.end method
.method public reset()V
.locals 3
iget-object p0, p0, Lcom/google/zxing/MultiFormatReader;->readers:[Lcom/google/zxing/Reader;
if-eqz p0, :cond_0
.line 163
array-length v0, p0
const/4 v1, 0x0
:goto_0
if-ge v1, v0, :cond_0
aget-object v2, p0, v1
.line 164
invoke-interface {v2}, Lcom/google/zxing/Reader;->reset()V
add-int/lit8 v1, v1, 0x1
goto :goto_0
:cond_0
return-void
.end method
.method public setHints(Ljava/util/Map;)V
.locals 6
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/Map<",
"Lcom/google/zxing/DecodeHintType;",
"*>;)V"
}
.end annotation
iput-object p1, p0, Lcom/google/zxing/MultiFormatReader;->hints:Ljava/util/Map;
const/4 v0, 0x1
const/4 v1, 0x0
if-eqz p1, :cond_0
.line 100
sget-object v2, Lcom/google/zxing/DecodeHintType;->TRY_HARDER:Lcom/google/zxing/DecodeHintType;
invoke-interface {p1, v2}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_0
move v2, v0
goto :goto_0
:cond_0
move v2, v1
:goto_0
if-nez p1, :cond_1
const/4 v3, 0x0
goto :goto_1
.line 102
:cond_1
sget-object v3, Lcom/google/zxing/DecodeHintType;->POSSIBLE_FORMATS:Lcom/google/zxing/DecodeHintType;
.line 103
invoke-interface {p1, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v3
check-cast v3, Ljava/util/Collection;
.line 104
:goto_1
new-instance v4, Ljava/util/ArrayList;
invoke-direct {v4}, Ljava/util/ArrayList;-><init>()V
if-eqz v3, :cond_a
.line 106
sget-object v5, Lcom/google/zxing/BarcodeFormat;->UPC_A:Lcom/google/zxing/BarcodeFormat;
.line 107
invoke-interface {v3, v5}, Ljava/util/Collection;->contains(Ljava/lang/Object;)Z
move-result v5
if-nez v5, :cond_3
sget-object v5, Lcom/google/zxing/BarcodeFormat;->UPC_E:Lcom/google/zxing/BarcodeFormat;
.line 108
invoke-interface {v3, v5}, Ljava/util/Collection;->contains(Ljava/lang/Object;)Z
move-result v5
if-nez v5, :cond_3
sget-object v5, Lcom/google/zxing/BarcodeFormat;->EAN_13:Lcom/google/zxing/BarcodeFormat;
.line 109
invoke-interface {v3, v5}, Ljava/util/Collection;->contains(Ljava/lang/Object;)Z
move-result v5
if-nez v5, :cond_3
sget-object v5, Lcom/google/zxing/BarcodeFormat;->EAN_8:Lcom/google/zxing/BarcodeFormat;
.line 110
invoke-interface {v3, v5}, Ljava/util/Collection;->contains(Ljava/lang/Object;)Z
move-result v5
if-nez v5, :cond_3
sget-object v5, Lcom/google/zxing/BarcodeFormat;->CODABAR:Lcom/google/zxing/BarcodeFormat;
.line 111
invoke-interface {v3, v5}, Ljava/util/Collection;->contains(Ljava/lang/Object;)Z
move-result v5
if-nez v5, :cond_3
sget-object v5, Lcom/google/zxing/BarcodeFormat;->CODE_39:Lcom/google/zxing/BarcodeFormat;
.line 112
invoke-interface {v3, v5}, Ljava/util/Collection;->contains(Ljava/lang/Object;)Z
move-result v5
if-nez v5, :cond_3
sget-object v5, Lcom/google/zxing/BarcodeFormat;->CODE_93:Lcom/google/zxing/BarcodeFormat;
.line 113
invoke-interface {v3, v5}, Ljava/util/Collection;->contains(Ljava/lang/Object;)Z
move-result v5
if-nez v5, :cond_3
sget-object v5, Lcom/google/zxing/BarcodeFormat;->CODE_128:Lcom/google/zxing/BarcodeFormat;
.line 114
invoke-interface {v3, v5}, Ljava/util/Collection;->contains(Ljava/lang/Object;)Z
move-result v5
if-nez v5, :cond_3
sget-object v5, Lcom/google/zxing/BarcodeFormat;->ITF:Lcom/google/zxing/BarcodeFormat;
.line 115
invoke-interface {v3, v5}, Ljava/util/Collection;->contains(Ljava/lang/Object;)Z
move-result v5
if-nez v5, :cond_3
sget-object v5, Lcom/google/zxing/BarcodeFormat;->RSS_14:Lcom/google/zxing/BarcodeFormat;
.line 116
invoke-interface {v3, v5}, Ljava/util/Collection;->contains(Ljava/lang/Object;)Z
move-result v5
if-nez v5, :cond_3
sget-object v5, Lcom/google/zxing/BarcodeFormat;->RSS_EXPANDED:Lcom/google/zxing/BarcodeFormat;
.line 117
invoke-interface {v3, v5}, Ljava/util/Collection;->contains(Ljava/lang/Object;)Z
move-result v5
if-eqz v5, :cond_2
goto :goto_2
:cond_2
move v0, v1
:cond_3
:goto_2
if-eqz v0, :cond_4
if-nez v2, :cond_4
.line 120
new-instance v1, Lcom/google/zxing/oned/MultiFormatOneDReader;
invoke-direct {v1, p1}, Lcom/google/zxing/oned/MultiFormatOneDReader;-><init>(Ljava/util/Map;)V
invoke-interface {v4, v1}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
.line 122
:cond_4
sget-object v1, Lcom/google/zxing/BarcodeFormat;->QR_CODE:Lcom/google/zxing/BarcodeFormat;
invoke-interface {v3, v1}, Ljava/util/Collection;->contains(Ljava/lang/Object;)Z
move-result v1
if-eqz v1, :cond_5
.line 123
new-instance v1, Lcom/google/zxing/qrcode/QRCodeReader;
invoke-direct {v1}, Lcom/google/zxing/qrcode/QRCodeReader;-><init>()V
invoke-interface {v4, v1}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
.line 125
:cond_5
sget-object v1, Lcom/google/zxing/BarcodeFormat;->DATA_MATRIX:Lcom/google/zxing/BarcodeFormat;
invoke-interface {v3, v1}, Ljava/util/Collection;->contains(Ljava/lang/Object;)Z
move-result v1
if-eqz v1, :cond_6
.line 126
new-instance v1, Lcom/google/zxing/datamatrix/DataMatrixReader;
invoke-direct {v1}, Lcom/google/zxing/datamatrix/DataMatrixReader;-><init>()V
invoke-interface {v4, v1}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
.line 128
:cond_6
sget-object v1, Lcom/google/zxing/BarcodeFormat;->AZTEC:Lcom/google/zxing/BarcodeFormat;
invoke-interface {v3, v1}, Ljava/util/Collection;->contains(Ljava/lang/Object;)Z
move-result v1
if-eqz v1, :cond_7
.line 129
new-instance v1, Lcom/google/zxing/aztec/AztecReader;
invoke-direct {v1}, Lcom/google/zxing/aztec/AztecReader;-><init>()V
invoke-interface {v4, v1}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
.line 131
:cond_7
sget-object v1, Lcom/google/zxing/BarcodeFormat;->PDF_417:Lcom/google/zxing/BarcodeFormat;
invoke-interface {v3, v1}, Ljava/util/Collection;->contains(Ljava/lang/Object;)Z
move-result v1
if-eqz v1, :cond_8
.line 132
new-instance v1, Lcom/google/zxing/pdf417/PDF417Reader;
invoke-direct {v1}, Lcom/google/zxing/pdf417/PDF417Reader;-><init>()V
invoke-interface {v4, v1}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
.line 134
:cond_8
sget-object v1, Lcom/google/zxing/BarcodeFormat;->MAXICODE:Lcom/google/zxing/BarcodeFormat;
invoke-interface {v3, v1}, Ljava/util/Collection;->contains(Ljava/lang/Object;)Z
move-result v1
if-eqz v1, :cond_9
.line 135
new-instance v1, Lcom/google/zxing/maxicode/MaxiCodeReader;
invoke-direct {v1}, Lcom/google/zxing/maxicode/MaxiCodeReader;-><init>()V
invoke-interface {v4, v1}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
:cond_9
if-eqz v0, :cond_a
if-eqz v2, :cond_a
.line 139
new-instance v0, Lcom/google/zxing/oned/MultiFormatOneDReader;
invoke-direct {v0, p1}, Lcom/google/zxing/oned/MultiFormatOneDReader;-><init>(Ljava/util/Map;)V
invoke-interface {v4, v0}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
.line 142
:cond_a
invoke-interface {v4}, Ljava/util/Collection;->isEmpty()Z
move-result v0
if-eqz v0, :cond_c
if-nez v2, :cond_b
.line 144
new-instance v0, Lcom/google/zxing/oned/MultiFormatOneDReader;
invoke-direct {v0, p1}, Lcom/google/zxing/oned/MultiFormatOneDReader;-><init>(Ljava/util/Map;)V
invoke-interface {v4, v0}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
.line 147
:cond_b
new-instance v0, Lcom/google/zxing/qrcode/QRCodeReader;
invoke-direct {v0}, Lcom/google/zxing/qrcode/QRCodeReader;-><init>()V
invoke-interface {v4, v0}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
.line 148
new-instance v0, Lcom/google/zxing/datamatrix/DataMatrixReader;
invoke-direct {v0}, Lcom/google/zxing/datamatrix/DataMatrixReader;-><init>()V
invoke-interface {v4, v0}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
.line 149
new-instance v0, Lcom/google/zxing/aztec/AztecReader;
invoke-direct {v0}, Lcom/google/zxing/aztec/AztecReader;-><init>()V
invoke-interface {v4, v0}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
.line 150
new-instance v0, Lcom/google/zxing/pdf417/PDF417Reader;
invoke-direct {v0}, Lcom/google/zxing/pdf417/PDF417Reader;-><init>()V
invoke-interface {v4, v0}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
.line 151
new-instance v0, Lcom/google/zxing/maxicode/MaxiCodeReader;
invoke-direct {v0}, Lcom/google/zxing/maxicode/MaxiCodeReader;-><init>()V
invoke-interface {v4, v0}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
if-eqz v2, :cond_c
.line 154
new-instance v0, Lcom/google/zxing/oned/MultiFormatOneDReader;
invoke-direct {v0, p1}, Lcom/google/zxing/oned/MultiFormatOneDReader;-><init>(Ljava/util/Map;)V
invoke-interface {v4, v0}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
:cond_c
sget-object p1, Lcom/google/zxing/MultiFormatReader;->EMPTY_READER_ARRAY:[Lcom/google/zxing/Reader;
.line 157
invoke-interface {v4, p1}, Ljava/util/Collection;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;
move-result-object p1
check-cast p1, [Lcom/google/zxing/Reader;
iput-object p1, p0, Lcom/google/zxing/MultiFormatReader;->readers:[Lcom/google/zxing/Reader;
return-void
.end method