.class public final Lcom/google/zxing/oned/Code128Writer; .super Lcom/google/zxing/oned/OneDimensionalCodeWriter; .source "Code128Writer.java" # annotations .annotation system Ldalvik/annotation/MemberClasses; value = { Lcom/google/zxing/oned/Code128Writer$CType; } .end annotation # static fields .field private static final CODE_CODE_A:I = 0x65 .field private static final CODE_CODE_B:I = 0x64 .field private static final CODE_CODE_C:I = 0x63 .field private static final CODE_FNC_1:I = 0x66 .field private static final CODE_FNC_2:I = 0x61 .field private static final CODE_FNC_3:I = 0x60 .field private static final CODE_FNC_4_A:I = 0x65 .field private static final CODE_FNC_4_B:I = 0x64 .field private static final CODE_START_A:I = 0x67 .field private static final CODE_START_B:I = 0x68 .field private static final CODE_START_C:I = 0x69 .field private static final CODE_STOP:I = 0x6a .field private static final ESCAPE_FNC_1:C = '\u00f1' .field private static final ESCAPE_FNC_2:C = '\u00f2' .field private static final ESCAPE_FNC_3:C = '\u00f3' .field private static final ESCAPE_FNC_4:C = '\u00f4' # direct methods .method public constructor ()V .locals 0 .line 31 invoke-direct {p0}, Lcom/google/zxing/oned/OneDimensionalCodeWriter;->()V return-void .end method .method private static chooseCode(Ljava/lang/CharSequence;II)I .locals 4 .line 225 invoke-static {p0, p1}, Lcom/google/zxing/oned/Code128Writer;->findCType(Ljava/lang/CharSequence;I)Lcom/google/zxing/oned/Code128Writer$CType; move-result-object v0 .line 226 sget-object v1, Lcom/google/zxing/oned/Code128Writer$CType;->ONE_DIGIT:Lcom/google/zxing/oned/Code128Writer$CType; const/16 v2, 0x65 const/16 v3, 0x64 if-ne v0, v1, :cond_1 if-ne p2, v2, :cond_0 return v2 :cond_0 return v3 .line 232 :cond_1 sget-object v1, Lcom/google/zxing/oned/Code128Writer$CType;->UNCODABLE:Lcom/google/zxing/oned/Code128Writer$CType; if-ne v0, v1, :cond_4 .line 233 invoke-interface {p0}, Ljava/lang/CharSequence;->length()I move-result v0 if-ge p1, v0, :cond_3 .line 234 invoke-interface {p0, p1}, Ljava/lang/CharSequence;->charAt(I)C move-result p0 const/16 p1, 0x20 if-lt p0, p1, :cond_2 if-ne p2, v2, :cond_3 const/16 p1, 0x60 if-lt p0, p1, :cond_2 const/16 p1, 0xf1 if-lt p0, p1, :cond_3 const/16 p1, 0xf4 if-gt p0, p1, :cond_3 :cond_2 return v2 :cond_3 return v3 :cond_4 if-ne p2, v2, :cond_5 .line 242 sget-object v1, Lcom/google/zxing/oned/Code128Writer$CType;->FNC_1:Lcom/google/zxing/oned/Code128Writer$CType; if-ne v0, v1, :cond_5 return v2 :cond_5 const/16 v1, 0x63 if-ne p2, v1, :cond_6 return v1 :cond_6 if-ne p2, v3, :cond_e .line 249 sget-object p2, Lcom/google/zxing/oned/Code128Writer$CType;->FNC_1:Lcom/google/zxing/oned/Code128Writer$CType; if-ne v0, p2, :cond_7 return v3 :cond_7 add-int/lit8 p2, p1, 0x2 .line 253 invoke-static {p0, p2}, Lcom/google/zxing/oned/Code128Writer;->findCType(Ljava/lang/CharSequence;I)Lcom/google/zxing/oned/Code128Writer$CType; move-result-object p2 .line 254 sget-object v0, Lcom/google/zxing/oned/Code128Writer$CType;->UNCODABLE:Lcom/google/zxing/oned/Code128Writer$CType; if-eq p2, v0, :cond_d sget-object v0, Lcom/google/zxing/oned/Code128Writer$CType;->ONE_DIGIT:Lcom/google/zxing/oned/Code128Writer$CType; if-ne p2, v0, :cond_8 goto :goto_1 .line 257 :cond_8 sget-object v0, Lcom/google/zxing/oned/Code128Writer$CType;->FNC_1:Lcom/google/zxing/oned/Code128Writer$CType; if-ne p2, v0, :cond_a add-int/lit8 p1, p1, 0x3 .line 258 invoke-static {p0, p1}, Lcom/google/zxing/oned/Code128Writer;->findCType(Ljava/lang/CharSequence;I)Lcom/google/zxing/oned/Code128Writer$CType; move-result-object p0 .line 259 sget-object p1, Lcom/google/zxing/oned/Code128Writer$CType;->TWO_DIGITS:Lcom/google/zxing/oned/Code128Writer$CType; if-ne p0, p1, :cond_9 return v1 :cond_9 return v3 :cond_a add-int/lit8 p1, p1, 0x4 .line 268 :goto_0 invoke-static {p0, p1}, Lcom/google/zxing/oned/Code128Writer;->findCType(Ljava/lang/CharSequence;I)Lcom/google/zxing/oned/Code128Writer$CType; move-result-object p2 sget-object v0, Lcom/google/zxing/oned/Code128Writer$CType;->TWO_DIGITS:Lcom/google/zxing/oned/Code128Writer$CType; if-ne p2, v0, :cond_b add-int/lit8 p1, p1, 0x2 goto :goto_0 .line 271 :cond_b sget-object p0, Lcom/google/zxing/oned/Code128Writer$CType;->ONE_DIGIT:Lcom/google/zxing/oned/Code128Writer$CType; if-ne p2, p0, :cond_c return v3 :cond_c return v1 :cond_d :goto_1 return v3 .line 277 :cond_e sget-object p2, Lcom/google/zxing/oned/Code128Writer$CType;->FNC_1:Lcom/google/zxing/oned/Code128Writer$CType; if-ne v0, p2, :cond_f add-int/lit8 p1, p1, 0x1 .line 278 invoke-static {p0, p1}, Lcom/google/zxing/oned/Code128Writer;->findCType(Ljava/lang/CharSequence;I)Lcom/google/zxing/oned/Code128Writer$CType; move-result-object v0 .line 280 :cond_f sget-object p0, Lcom/google/zxing/oned/Code128Writer$CType;->TWO_DIGITS:Lcom/google/zxing/oned/Code128Writer$CType; if-ne v0, p0, :cond_10 return v1 :cond_10 return v3 .end method .method private static findCType(Ljava/lang/CharSequence;I)Lcom/google/zxing/oned/Code128Writer$CType; .locals 4 .line 203 invoke-interface {p0}, Ljava/lang/CharSequence;->length()I move-result v0 if-lt p1, v0, :cond_0 .line 205 sget-object p0, Lcom/google/zxing/oned/Code128Writer$CType;->UNCODABLE:Lcom/google/zxing/oned/Code128Writer$CType; return-object p0 .line 207 :cond_0 invoke-interface {p0, p1}, Ljava/lang/CharSequence;->charAt(I)C move-result v1 const/16 v2, 0xf1 if-ne v1, v2, :cond_1 .line 209 sget-object p0, Lcom/google/zxing/oned/Code128Writer$CType;->FNC_1:Lcom/google/zxing/oned/Code128Writer$CType; return-object p0 :cond_1 const/16 v2, 0x30 if-lt v1, v2, :cond_6 const/16 v3, 0x39 if-le v1, v3, :cond_2 goto :goto_1 :cond_2 add-int/lit8 p1, p1, 0x1 if-lt p1, v0, :cond_3 .line 215 sget-object p0, Lcom/google/zxing/oned/Code128Writer$CType;->ONE_DIGIT:Lcom/google/zxing/oned/Code128Writer$CType; return-object p0 .line 217 :cond_3 invoke-interface {p0, p1}, Ljava/lang/CharSequence;->charAt(I)C move-result p0 if-lt p0, v2, :cond_5 if-le p0, v3, :cond_4 goto :goto_0 .line 221 :cond_4 sget-object p0, Lcom/google/zxing/oned/Code128Writer$CType;->TWO_DIGITS:Lcom/google/zxing/oned/Code128Writer$CType; return-object p0 .line 219 :cond_5 :goto_0 sget-object p0, Lcom/google/zxing/oned/Code128Writer$CType;->ONE_DIGIT:Lcom/google/zxing/oned/Code128Writer$CType; return-object p0 .line 212 :cond_6 :goto_1 sget-object p0, Lcom/google/zxing/oned/Code128Writer$CType;->UNCODABLE:Lcom/google/zxing/oned/Code128Writer$CType; return-object p0 .end method # virtual methods .method public encode(Ljava/lang/String;)[Z .locals 11 .line 68 invoke-virtual {p1}, Ljava/lang/String;->length()I move-result p0 if-lez p0, :cond_e const/16 v0, 0x50 if-gt p0, v0, :cond_e const/4 v0, 0x0 move v1, v0 :goto_0 if-ge v1, p0, :cond_1 .line 76 invoke-virtual {p1, v1}, Ljava/lang/String;->charAt(I)C move-result v2 packed-switch v2, :pswitch_data_0 const/16 v3, 0x7f if-gt v2, v3, :cond_0 :pswitch_0 add-int/lit8 v1, v1, 0x1 goto :goto_0 .line 86 :cond_0 new-instance p0, Ljava/lang/IllegalArgumentException; const-string p1, "Bad character in input: " invoke-static {v2}, Ljava/lang/String;->valueOf(C)Ljava/lang/String; move-result-object v0 invoke-virtual {p1, v0}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String; move-result-object p1 invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;->(Ljava/lang/String;)V throw p0 .line 91 :cond_1 new-instance v1, Ljava/util/ArrayList; invoke-direct {v1}, Ljava/util/ArrayList;->()V const/4 v2, 0x1 move v3, v0 move v4, v3 move v5, v4 move v6, v2 :cond_2 :goto_1 const/16 v7, 0x67 if-ge v3, p0, :cond_a .line 99 invoke-static {p1, v3, v5}, Lcom/google/zxing/oned/Code128Writer;->chooseCode(Ljava/lang/CharSequence;II)I move-result v8 const/16 v9, 0x64 const/16 v10, 0x65 if-ne v8, v5, :cond_6 .line 106 invoke-virtual {p1, v3}, Ljava/lang/String;->charAt(I)C move-result v7 packed-switch v7, :pswitch_data_1 if-eq v5, v9, :cond_4 if-eq v5, v10, :cond_3 add-int/lit8 v7, v3, 0x2 .line 138 invoke-virtual {p1, v3, v7}, Ljava/lang/String;->substring(II)Ljava/lang/String; move-result-object v7 invoke-static {v7}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I move-result v9 add-int/lit8 v3, v3, 0x1 goto :goto_2 :pswitch_1 if-ne v5, v10, :cond_5 move v9, v10 goto :goto_2 :pswitch_2 const/16 v9, 0x60 goto :goto_2 :pswitch_3 const/16 v9, 0x61 goto :goto_2 :pswitch_4 const/16 v9, 0x66 goto :goto_2 .line 127 :cond_3 invoke-virtual {p1, v3}, Ljava/lang/String;->charAt(I)C move-result v7 add-int/lit8 v9, v7, -0x20 if-gez v9, :cond_5 add-int/lit8 v9, v7, 0x40 goto :goto_2 .line 134 :cond_4 invoke-virtual {p1, v3}, Ljava/lang/String;->charAt(I)C move-result v7 add-int/lit8 v9, v7, -0x20 :cond_5 :goto_2 add-int/2addr v3, v2 goto :goto_4 :cond_6 if-nez v5, :cond_8 if-eq v8, v9, :cond_7 if-eq v8, v10, :cond_9 const/16 v7, 0x69 goto :goto_3 :cond_7 const/16 v7, 0x68 goto :goto_3 :cond_8 move v7, v8 :cond_9 :goto_3 move v9, v7 move v5, v8 .line 168 :goto_4 sget-object v7, Lcom/google/zxing/oned/Code128Reader;->CODE_PATTERNS:[[I aget-object v7, v7, v9 invoke-interface {v1, v7}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z mul-int/2addr v9, v6 add-int/2addr v4, v9 if-eqz v3, :cond_2 add-int/lit8 v6, v6, 0x1 goto :goto_1 .line 178 :cond_a rem-int/2addr v4, v7 .line 179 sget-object p0, Lcom/google/zxing/oned/Code128Reader;->CODE_PATTERNS:[[I aget-object p0, p0, v4 invoke-interface {v1, p0}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z .line 182 sget-object p0, Lcom/google/zxing/oned/Code128Reader;->CODE_PATTERNS:[[I const/16 p1, 0x6a aget-object p0, p0, p1 invoke-interface {v1, p0}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z .line 186 invoke-interface {v1}, Ljava/util/Collection;->iterator()Ljava/util/Iterator; move-result-object p0 move p1, v0 :cond_b invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z move-result v3 if-eqz v3, :cond_c invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object; move-result-object v3 check-cast v3, [I .line 187 array-length v4, v3 move v5, v0 :goto_5 if-ge v5, v4, :cond_b aget v6, v3, v5 add-int/2addr p1, v6 add-int/lit8 v5, v5, 0x1 goto :goto_5 .line 193 :cond_c new-array p0, p1, [Z .line 195 invoke-interface {v1}, Ljava/util/Collection;->iterator()Ljava/util/Iterator; move-result-object p1 :goto_6 invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z move-result v1 if-eqz v1, :cond_d invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object; move-result-object v1 check-cast v1, [I .line 196 invoke-static {p0, v0, v1, v2}, Lcom/google/zxing/oned/Code128Writer;->appendPattern([ZI[IZ)I move-result v1 add-int/2addr v0, v1 goto :goto_6 :cond_d return-object p0 .line 71 :cond_e new-instance p1, Ljava/lang/IllegalArgumentException; const-string v0, "Contents length should be between 1 and 80 characters, but got " invoke-static {p0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String; move-result-object p0 invoke-virtual {v0, p0}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String; move-result-object p0 invoke-direct {p1, p0}, Ljava/lang/IllegalArgumentException;->(Ljava/lang/String;)V throw p1 :pswitch_data_0 .packed-switch 0xf1 :pswitch_0 :pswitch_0 :pswitch_0 :pswitch_0 .end packed-switch :pswitch_data_1 .packed-switch 0xf1 :pswitch_4 :pswitch_3 :pswitch_2 :pswitch_1 .end packed-switch .end method .method protected getSupportedWriteFormats()Ljava/util/Collection; .locals 0 .annotation system Ldalvik/annotation/Signature; value = { "()", "Ljava/util/Collection<", "Lcom/google/zxing/BarcodeFormat;", ">;" } .end annotation .line 63 sget-object p0, Lcom/google/zxing/BarcodeFormat;->CODE_128:Lcom/google/zxing/BarcodeFormat; invoke-static {p0}, Ljava/util/Collections;->singleton(Ljava/lang/Object;)Ljava/util/Set; move-result-object p0 return-object p0 .end method