Rabbit-R1/android (non root)/smali/smali_classes3/com/google/zxing/pdf417/PDF417Reader.smali

543 lines
13 KiB
Smali
Raw Normal View History

2024-05-21 21:08:36 +00:00
.class public final Lcom/google/zxing/pdf417/PDF417Reader;
.super Ljava/lang/Object;
.source "PDF417Reader.java"
# interfaces
.implements Lcom/google/zxing/Reader;
.implements Lcom/google/zxing/multi/MultipleBarcodeReader;
# static fields
.field private static final EMPTY_RESULT_ARRAY:[Lcom/google/zxing/Result;
# direct methods
.method static constructor <clinit>()V
.locals 1
const/4 v0, 0x0
new-array v0, v0, [Lcom/google/zxing/Result;
sput-object v0, Lcom/google/zxing/pdf417/PDF417Reader;->EMPTY_RESULT_ARRAY:[Lcom/google/zxing/Result;
return-void
.end method
.method public constructor <init>()V
.locals 0
.line 44
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method private static decode(Lcom/google/zxing/BinaryBitmap;Ljava/util/Map;Z)[Lcom/google/zxing/Result;
.locals 8
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lcom/google/zxing/BinaryBitmap;",
"Ljava/util/Map<",
"Lcom/google/zxing/DecodeHintType;",
"*>;Z)[",
"Lcom/google/zxing/Result;"
}
.end annotation
.annotation system Ldalvik/annotation/Throws;
value = {
Lcom/google/zxing/NotFoundException;,
Lcom/google/zxing/FormatException;,
Lcom/google/zxing/ChecksumException;
}
.end annotation
.line 86
new-instance v0, Ljava/util/ArrayList;
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
.line 87
invoke-static {p0, p1, p2}, Lcom/google/zxing/pdf417/detector/Detector;->detect(Lcom/google/zxing/BinaryBitmap;Ljava/util/Map;Z)Lcom/google/zxing/pdf417/detector/PDF417DetectorResult;
move-result-object p0
.line 88
invoke-virtual {p0}, Lcom/google/zxing/pdf417/detector/PDF417DetectorResult;->getPoints()Ljava/util/List;
move-result-object p1
invoke-interface {p1}, Ljava/util/List;->iterator()Ljava/util/Iterator;
move-result-object p1
:goto_0
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
move-result p2
if-eqz p2, :cond_1
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object p2
check-cast p2, [Lcom/google/zxing/ResultPoint;
.line 89
invoke-virtual {p0}, Lcom/google/zxing/pdf417/detector/PDF417DetectorResult;->getBits()Lcom/google/zxing/common/BitMatrix;
move-result-object v1
const/4 v2, 0x4
aget-object v2, p2, v2
const/4 v3, 0x5
aget-object v3, p2, v3
const/4 v4, 0x6
aget-object v4, p2, v4
const/4 v5, 0x7
aget-object v5, p2, v5
.line 90
invoke-static {p2}, Lcom/google/zxing/pdf417/PDF417Reader;->getMinCodewordWidth([Lcom/google/zxing/ResultPoint;)I
move-result v6
invoke-static {p2}, Lcom/google/zxing/pdf417/PDF417Reader;->getMaxCodewordWidth([Lcom/google/zxing/ResultPoint;)I
move-result v7
.line 89
invoke-static/range {v1 .. v7}, Lcom/google/zxing/pdf417/decoder/PDF417ScanningDecoder;->decode(Lcom/google/zxing/common/BitMatrix;Lcom/google/zxing/ResultPoint;Lcom/google/zxing/ResultPoint;Lcom/google/zxing/ResultPoint;Lcom/google/zxing/ResultPoint;II)Lcom/google/zxing/common/DecoderResult;
move-result-object v1
.line 91
new-instance v2, Lcom/google/zxing/Result;
invoke-virtual {v1}, Lcom/google/zxing/common/DecoderResult;->getText()Ljava/lang/String;
move-result-object v3
invoke-virtual {v1}, Lcom/google/zxing/common/DecoderResult;->getRawBytes()[B
move-result-object v4
sget-object v5, Lcom/google/zxing/BarcodeFormat;->PDF_417:Lcom/google/zxing/BarcodeFormat;
invoke-direct {v2, v3, v4, p2, v5}, Lcom/google/zxing/Result;-><init>(Ljava/lang/String;[B[Lcom/google/zxing/ResultPoint;Lcom/google/zxing/BarcodeFormat;)V
.line 92
sget-object p2, Lcom/google/zxing/ResultMetadataType;->ERROR_CORRECTION_LEVEL:Lcom/google/zxing/ResultMetadataType;
invoke-virtual {v1}, Lcom/google/zxing/common/DecoderResult;->getECLevel()Ljava/lang/String;
move-result-object v3
invoke-virtual {v2, p2, v3}, Lcom/google/zxing/Result;->putMetadata(Lcom/google/zxing/ResultMetadataType;Ljava/lang/Object;)V
.line 93
invoke-virtual {v1}, Lcom/google/zxing/common/DecoderResult;->getOther()Ljava/lang/Object;
move-result-object p2
check-cast p2, Lcom/google/zxing/pdf417/PDF417ResultMetadata;
if-eqz p2, :cond_0
.line 95
sget-object v1, Lcom/google/zxing/ResultMetadataType;->PDF417_EXTRA_METADATA:Lcom/google/zxing/ResultMetadataType;
invoke-virtual {v2, v1, p2}, Lcom/google/zxing/Result;->putMetadata(Lcom/google/zxing/ResultMetadataType;Ljava/lang/Object;)V
.line 97
:cond_0
invoke-interface {v0, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z
goto :goto_0
:cond_1
sget-object p0, Lcom/google/zxing/pdf417/PDF417Reader;->EMPTY_RESULT_ARRAY:[Lcom/google/zxing/Result;
.line 99
invoke-interface {v0, p0}, Ljava/util/List;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;
move-result-object p0
check-cast p0, [Lcom/google/zxing/Result;
return-object p0
.end method
.method private static getMaxCodewordWidth([Lcom/google/zxing/ResultPoint;)I
.locals 4
const/4 v0, 0x0
.line 117
aget-object v0, p0, v0
const/4 v1, 0x4
aget-object v1, p0, v1
.line 118
invoke-static {v0, v1}, Lcom/google/zxing/pdf417/PDF417Reader;->getMaxWidth(Lcom/google/zxing/ResultPoint;Lcom/google/zxing/ResultPoint;)I
move-result v0
const/4 v1, 0x6
aget-object v1, p0, v1
const/4 v2, 0x2
aget-object v2, p0, v2
invoke-static {v1, v2}, Lcom/google/zxing/pdf417/PDF417Reader;->getMaxWidth(Lcom/google/zxing/ResultPoint;Lcom/google/zxing/ResultPoint;)I
move-result v1
mul-int/lit8 v1, v1, 0x11
div-int/lit8 v1, v1, 0x12
invoke-static {v0, v1}, Ljava/lang/Math;->max(II)I
move-result v0
const/4 v1, 0x1
aget-object v1, p0, v1
const/4 v2, 0x5
aget-object v2, p0, v2
.line 120
invoke-static {v1, v2}, Lcom/google/zxing/pdf417/PDF417Reader;->getMaxWidth(Lcom/google/zxing/ResultPoint;Lcom/google/zxing/ResultPoint;)I
move-result v1
const/4 v2, 0x7
aget-object v2, p0, v2
const/4 v3, 0x3
aget-object p0, p0, v3
invoke-static {v2, p0}, Lcom/google/zxing/pdf417/PDF417Reader;->getMaxWidth(Lcom/google/zxing/ResultPoint;Lcom/google/zxing/ResultPoint;)I
move-result p0
mul-int/lit8 p0, p0, 0x11
div-int/lit8 p0, p0, 0x12
invoke-static {v1, p0}, Ljava/lang/Math;->max(II)I
move-result p0
.line 117
invoke-static {v0, p0}, Ljava/lang/Math;->max(II)I
move-result p0
return p0
.end method
.method private static getMaxWidth(Lcom/google/zxing/ResultPoint;Lcom/google/zxing/ResultPoint;)I
.locals 0
if-eqz p0, :cond_1
if-nez p1, :cond_0
goto :goto_0
.line 106
:cond_0
invoke-virtual {p0}, Lcom/google/zxing/ResultPoint;->getX()F
move-result p0
invoke-virtual {p1}, Lcom/google/zxing/ResultPoint;->getX()F
move-result p1
sub-float/2addr p0, p1
invoke-static {p0}, Ljava/lang/Math;->abs(F)F
move-result p0
float-to-int p0, p0
return p0
:cond_1
:goto_0
const/4 p0, 0x0
return p0
.end method
.method private static getMinCodewordWidth([Lcom/google/zxing/ResultPoint;)I
.locals 4
const/4 v0, 0x0
.line 125
aget-object v0, p0, v0
const/4 v1, 0x4
aget-object v1, p0, v1
.line 126
invoke-static {v0, v1}, Lcom/google/zxing/pdf417/PDF417Reader;->getMinWidth(Lcom/google/zxing/ResultPoint;Lcom/google/zxing/ResultPoint;)I
move-result v0
const/4 v1, 0x6
aget-object v1, p0, v1
const/4 v2, 0x2
aget-object v2, p0, v2
invoke-static {v1, v2}, Lcom/google/zxing/pdf417/PDF417Reader;->getMinWidth(Lcom/google/zxing/ResultPoint;Lcom/google/zxing/ResultPoint;)I
move-result v1
mul-int/lit8 v1, v1, 0x11
div-int/lit8 v1, v1, 0x12
invoke-static {v0, v1}, Ljava/lang/Math;->min(II)I
move-result v0
const/4 v1, 0x1
aget-object v1, p0, v1
const/4 v2, 0x5
aget-object v2, p0, v2
.line 128
invoke-static {v1, v2}, Lcom/google/zxing/pdf417/PDF417Reader;->getMinWidth(Lcom/google/zxing/ResultPoint;Lcom/google/zxing/ResultPoint;)I
move-result v1
const/4 v2, 0x7
aget-object v2, p0, v2
const/4 v3, 0x3
aget-object p0, p0, v3
invoke-static {v2, p0}, Lcom/google/zxing/pdf417/PDF417Reader;->getMinWidth(Lcom/google/zxing/ResultPoint;Lcom/google/zxing/ResultPoint;)I
move-result p0
mul-int/lit8 p0, p0, 0x11
div-int/lit8 p0, p0, 0x12
invoke-static {v1, p0}, Ljava/lang/Math;->min(II)I
move-result p0
.line 125
invoke-static {v0, p0}, Ljava/lang/Math;->min(II)I
move-result p0
return p0
.end method
.method private static getMinWidth(Lcom/google/zxing/ResultPoint;Lcom/google/zxing/ResultPoint;)I
.locals 0
if-eqz p0, :cond_1
if-nez p1, :cond_0
goto :goto_0
.line 113
:cond_0
invoke-virtual {p0}, Lcom/google/zxing/ResultPoint;->getX()F
move-result p0
invoke-virtual {p1}, Lcom/google/zxing/ResultPoint;->getX()F
move-result p1
sub-float/2addr p0, p1
invoke-static {p0}, Ljava/lang/Math;->abs(F)F
move-result p0
float-to-int p0, p0
return p0
:cond_1
:goto_0
const p0, 0x7fffffff
return 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/FormatException;,
Lcom/google/zxing/ChecksumException;
}
.end annotation
const/4 v0, 0x0
.line 57
invoke-virtual {p0, p1, v0}, Lcom/google/zxing/pdf417/PDF417Reader;->decode(Lcom/google/zxing/BinaryBitmap;Ljava/util/Map;)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;,
Lcom/google/zxing/FormatException;,
Lcom/google/zxing/ChecksumException;
}
.end annotation
const/4 p0, 0x0
.line 63
invoke-static {p1, p2, p0}, Lcom/google/zxing/pdf417/PDF417Reader;->decode(Lcom/google/zxing/BinaryBitmap;Ljava/util/Map;Z)[Lcom/google/zxing/Result;
move-result-object p1
.line 64
array-length p2, p1
if-eqz p2, :cond_0
aget-object p0, p1, p0
if-eqz p0, :cond_0
return-object p0
.line 65
:cond_0
invoke-static {}, Lcom/google/zxing/NotFoundException;->getNotFoundInstance()Lcom/google/zxing/NotFoundException;
move-result-object p0
throw p0
.end method
.method public decodeMultiple(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 72
invoke-virtual {p0, p1, v0}, Lcom/google/zxing/pdf417/PDF417Reader;->decodeMultiple(Lcom/google/zxing/BinaryBitmap;Ljava/util/Map;)[Lcom/google/zxing/Result;
move-result-object p0
return-object p0
.end method
.method public decodeMultiple(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
const/4 p0, 0x1
.line 78
:try_start_0
invoke-static {p1, p2, p0}, Lcom/google/zxing/pdf417/PDF417Reader;->decode(Lcom/google/zxing/BinaryBitmap;Ljava/util/Map;Z)[Lcom/google/zxing/Result;
move-result-object p0
:try_end_0
.catch Lcom/google/zxing/FormatException; {:try_start_0 .. :try_end_0} :catch_0
.catch Lcom/google/zxing/ChecksumException; {:try_start_0 .. :try_end_0} :catch_0
return-object p0
.line 80
:catch_0
invoke-static {}, Lcom/google/zxing/NotFoundException;->getNotFoundInstance()Lcom/google/zxing/NotFoundException;
move-result-object p0
throw p0
.end method
.method public reset()V
.locals 0
return-void
.end method