Initial commit

This commit is contained in:
2025-05-13 19:24:51 +02:00
commit a950f49678
10604 changed files with 932663 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
package com.google.zxing.client.result;
/* loaded from: classes.dex */
abstract class AbstractDoCoMoResultParser extends ResultParser {
AbstractDoCoMoResultParser() {
}
static String[] a(String str, String str2, boolean z) {
return ResultParser.a(str, str2, ';', z);
}
static String b(String str, String str2, boolean z) {
return ResultParser.b(str, str2, ';', z);
}
}

View File

@@ -0,0 +1,40 @@
package com.google.zxing.client.result;
import com.google.zxing.Result;
import java.util.ArrayList;
/* loaded from: classes.dex */
public final class AddressBookAUResultParser extends ResultParser {
@Override // com.google.zxing.client.result.ResultParser
public AddressBookParsedResult a(Result result) {
String b = ResultParser.b(result);
if (!b.contains("MEMORY") || !b.contains("\r\n")) {
return null;
}
String b2 = ResultParser.b("NAME1:", b, '\r', true);
String b3 = ResultParser.b("NAME2:", b, '\r', true);
String[] a = a("TEL", 3, b, true);
String[] a2 = a("MAIL", 3, b, true);
String b4 = ResultParser.b("MEMORY:", b, '\r', false);
String b5 = ResultParser.b("ADD:", b, '\r', true);
return new AddressBookParsedResult(ResultParser.a(b2), null, b3, a, null, a2, null, null, b4, b5 != null ? new String[]{b5} : null, null, null, null, null, null, null);
}
private static String[] a(String str, int i, String str2, boolean z) {
ArrayList arrayList = null;
for (int i2 = 1; i2 <= i; i2++) {
String b = ResultParser.b(str + i2 + ':', str2, '\r', z);
if (b == null) {
break;
}
if (arrayList == null) {
arrayList = new ArrayList(i);
}
arrayList.add(b);
}
if (arrayList == null) {
return null;
}
return (String[]) arrayList.toArray(new String[arrayList.size()]);
}
}

View File

@@ -0,0 +1,31 @@
package com.google.zxing.client.result;
import com.google.zxing.Result;
/* loaded from: classes.dex */
public final class AddressBookDoCoMoResultParser extends AbstractDoCoMoResultParser {
private static String e(String str) {
int indexOf = str.indexOf(44);
if (indexOf < 0) {
return str;
}
return str.substring(indexOf + 1) + ' ' + str.substring(0, indexOf);
}
@Override // com.google.zxing.client.result.ResultParser
public AddressBookParsedResult a(Result result) {
String[] a;
String b = ResultParser.b(result);
if (!b.startsWith("MECARD:") || (a = AbstractDoCoMoResultParser.a("N:", b, true)) == null) {
return null;
}
String e = e(a[0]);
String b2 = AbstractDoCoMoResultParser.b("SOUND:", b, true);
String[] a2 = AbstractDoCoMoResultParser.a("TEL:", b, true);
String[] a3 = AbstractDoCoMoResultParser.a("EMAIL:", b, true);
String b3 = AbstractDoCoMoResultParser.b("NOTE:", b, false);
String[] a4 = AbstractDoCoMoResultParser.a("ADR:", b, true);
String b4 = AbstractDoCoMoResultParser.b("BDAY:", b, true);
return new AddressBookParsedResult(ResultParser.a(e), null, b2, a2, null, a3, null, null, b3, a4, null, AbstractDoCoMoResultParser.b("ORG:", b, true), !ResultParser.b(b4, 8) ? null : b4, null, AbstractDoCoMoResultParser.a("URL:", b, true), null);
}
}

View File

@@ -0,0 +1,133 @@
package com.google.zxing.client.result;
/* loaded from: classes.dex */
public final class AddressBookParsedResult extends ParsedResult {
private final String[] b;
private final String[] c;
private final String d;
private final String[] e;
private final String[] f;
private final String[] g;
private final String[] h;
private final String i;
private final String j;
private final String[] k;
private final String[] l;
private final String m;
private final String n;
private final String o;
private final String[] p;
private final String[] q;
public AddressBookParsedResult(String[] strArr, String[] strArr2, String str, String[] strArr3, String[] strArr4, String[] strArr5, String[] strArr6, String str2, String str3, String[] strArr7, String[] strArr8, String str4, String str5, String str6, String[] strArr9, String[] strArr10) {
super(ParsedResultType.ADDRESSBOOK);
if (strArr3 != null && strArr4 != null && strArr3.length != strArr4.length) {
throw new IllegalArgumentException("Phone numbers and types lengths differ");
}
if (strArr5 != null && strArr6 != null && strArr5.length != strArr6.length) {
throw new IllegalArgumentException("Emails and types lengths differ");
}
if (strArr7 != null && strArr8 != null && strArr7.length != strArr8.length) {
throw new IllegalArgumentException("Addresses and types lengths differ");
}
this.b = strArr;
this.c = strArr2;
this.d = str;
this.e = strArr3;
this.f = strArr4;
this.g = strArr5;
this.h = strArr6;
this.i = str2;
this.j = str3;
this.k = strArr7;
this.l = strArr8;
this.m = str4;
this.n = str5;
this.o = str6;
this.p = strArr9;
this.q = strArr10;
}
@Override // com.google.zxing.client.result.ParsedResult
public String a() {
StringBuilder sb = new StringBuilder(100);
ParsedResult.a(this.b, sb);
ParsedResult.a(this.c, sb);
ParsedResult.a(this.d, sb);
ParsedResult.a(this.o, sb);
ParsedResult.a(this.m, sb);
ParsedResult.a(this.k, sb);
ParsedResult.a(this.e, sb);
ParsedResult.a(this.g, sb);
ParsedResult.a(this.i, sb);
ParsedResult.a(this.p, sb);
ParsedResult.a(this.n, sb);
ParsedResult.a(this.q, sb);
ParsedResult.a(this.j, sb);
return sb.toString();
}
public String[] c() {
return this.l;
}
public String[] d() {
return this.k;
}
public String e() {
return this.n;
}
public String[] f() {
return this.h;
}
public String[] g() {
return this.g;
}
public String[] h() {
return this.q;
}
public String i() {
return this.i;
}
public String[] j() {
return this.b;
}
public String[] k() {
return this.c;
}
public String l() {
return this.j;
}
public String m() {
return this.m;
}
public String[] n() {
return this.e;
}
public String[] o() {
return this.f;
}
public String p() {
return this.d;
}
public String q() {
return this.o;
}
public String[] r() {
return this.p;
}
}

View File

@@ -0,0 +1,47 @@
package com.google.zxing.client.result;
import com.google.zxing.Result;
import java.util.ArrayList;
/* loaded from: classes.dex */
public final class BizcardResultParser extends AbstractDoCoMoResultParser {
@Override // com.google.zxing.client.result.ResultParser
public AddressBookParsedResult a(Result result) {
String b = ResultParser.b(result);
if (!b.startsWith("BIZCARD:")) {
return null;
}
String a = a(AbstractDoCoMoResultParser.b("N:", b, true), AbstractDoCoMoResultParser.b("X:", b, true));
String b2 = AbstractDoCoMoResultParser.b("T:", b, true);
String b3 = AbstractDoCoMoResultParser.b("C:", b, true);
return new AddressBookParsedResult(ResultParser.a(a), null, null, a(AbstractDoCoMoResultParser.b("B:", b, true), AbstractDoCoMoResultParser.b("M:", b, true), AbstractDoCoMoResultParser.b("F:", b, true)), null, ResultParser.a(AbstractDoCoMoResultParser.b("E:", b, true)), null, null, null, AbstractDoCoMoResultParser.a("A:", b, true), null, b3, null, b2, null, null);
}
private static String[] a(String str, String str2, String str3) {
ArrayList arrayList = new ArrayList(3);
if (str != null) {
arrayList.add(str);
}
if (str2 != null) {
arrayList.add(str2);
}
if (str3 != null) {
arrayList.add(str3);
}
int size = arrayList.size();
if (size == 0) {
return null;
}
return (String[]) arrayList.toArray(new String[size]);
}
private static String a(String str, String str2) {
if (str == null) {
return str2;
}
if (str2 == null) {
return str;
}
return str + ' ' + str2;
}
}

View File

@@ -0,0 +1,24 @@
package com.google.zxing.client.result;
import com.google.zxing.Result;
/* loaded from: classes.dex */
public final class BookmarkDoCoMoResultParser extends AbstractDoCoMoResultParser {
@Override // com.google.zxing.client.result.ResultParser
public URIParsedResult a(Result result) {
String e = result.e();
if (!e.startsWith("MEBKM:")) {
return null;
}
String b = AbstractDoCoMoResultParser.b("TITLE:", e, true);
String[] a = AbstractDoCoMoResultParser.a("URL:", e, true);
if (a == null) {
return null;
}
String str = a[0];
if (URIResultParser.e(str)) {
return new URIParsedResult(str, b);
}
return null;
}
}

View File

@@ -0,0 +1,157 @@
package com.google.zxing.client.result;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.Locale;
import java.util.TimeZone;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/* loaded from: classes.dex */
public final class CalendarParsedResult extends ParsedResult {
private static final Pattern k = Pattern.compile("P(?:(\\d+)W)?(?:(\\d+)D)?(?:T(?:(\\d+)H)?(?:(\\d+)M)?(?:(\\d+)S)?)?");
private static final long[] l = {604800000, 86400000, 3600000, 60000, 1000};
private static final Pattern m = Pattern.compile("[0-9]{8}(T[0-9]{6}Z?)?");
private final String b;
private final long c;
private final boolean d;
private final long e;
private final boolean f;
private final String g;
private final String h;
private final String[] i;
private final String j;
public CalendarParsedResult(String str, String str2, String str3, String str4, String str5, String str6, String[] strArr, String str7, double d, double d2) {
super(ParsedResultType.CALENDAR);
this.b = str;
try {
this.c = a(str2);
if (str3 == null) {
long a = a((CharSequence) str4);
this.e = a < 0 ? -1L : a + this.c;
} else {
try {
this.e = a(str3);
} catch (ParseException e) {
throw new IllegalArgumentException(e.toString());
}
}
this.d = str2.length() == 8;
this.f = str3 != null && str3.length() == 8;
this.g = str5;
this.h = str6;
this.i = strArr;
this.j = str7;
} catch (ParseException e2) {
throw new IllegalArgumentException(e2.toString());
}
}
private static long b(String str) throws ParseException {
return new SimpleDateFormat("yyyyMMdd'T'HHmmss", Locale.ENGLISH).parse(str).getTime();
}
@Override // com.google.zxing.client.result.ParsedResult
public String a() {
StringBuilder sb = new StringBuilder(100);
ParsedResult.a(this.b, sb);
ParsedResult.a(a(this.d, this.c), sb);
ParsedResult.a(a(this.f, this.e), sb);
ParsedResult.a(this.g, sb);
ParsedResult.a(this.h, sb);
ParsedResult.a(this.i, sb);
ParsedResult.a(this.j, sb);
return sb.toString();
}
public String[] c() {
return this.i;
}
public String d() {
return this.j;
}
public long e() {
return this.e;
}
public String f() {
return this.g;
}
public String g() {
return this.h;
}
public long h() {
return this.c;
}
public String i() {
return this.b;
}
public boolean j() {
return this.f;
}
public boolean k() {
return this.d;
}
private static long a(String str) throws ParseException {
if (m.matcher(str).matches()) {
if (str.length() == 8) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd", Locale.ENGLISH);
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
return simpleDateFormat.parse(str).getTime();
}
if (str.length() == 16 && str.charAt(15) == 'Z') {
long b = b(str.substring(0, 15));
long j = b + r5.get(15);
new GregorianCalendar().setTime(new Date(j));
return j + r5.get(16);
}
return b(str);
}
throw new ParseException(str, 0);
}
private static String a(boolean z, long j) {
DateFormat dateTimeInstance;
if (j < 0) {
return null;
}
if (z) {
dateTimeInstance = DateFormat.getDateInstance(2);
} else {
dateTimeInstance = DateFormat.getDateTimeInstance(2, 2);
}
return dateTimeInstance.format(Long.valueOf(j));
}
private static long a(CharSequence charSequence) {
if (charSequence == null) {
return -1L;
}
Matcher matcher = k.matcher(charSequence);
if (!matcher.matches()) {
return -1L;
}
long j = 0;
int i = 0;
while (i < l.length) {
int i2 = i + 1;
if (matcher.group(i2) != null) {
j += l[i] * Integer.parseInt(r4);
}
i = i2;
}
return j;
}
}

View File

@@ -0,0 +1,54 @@
package com.google.zxing.client.result;
/* loaded from: classes.dex */
public final class EmailAddressParsedResult extends ParsedResult {
private final String[] b;
private final String[] c;
private final String[] d;
private final String e;
private final String f;
EmailAddressParsedResult(String str) {
this(new String[]{str}, null, null, null, null);
}
@Override // com.google.zxing.client.result.ParsedResult
public String a() {
StringBuilder sb = new StringBuilder(30);
ParsedResult.a(this.b, sb);
ParsedResult.a(this.c, sb);
ParsedResult.a(this.d, sb);
ParsedResult.a(this.e, sb);
ParsedResult.a(this.f, sb);
return sb.toString();
}
public String[] c() {
return this.d;
}
public String d() {
return this.f;
}
public String[] e() {
return this.c;
}
public String f() {
return this.e;
}
public String[] g() {
return this.b;
}
EmailAddressParsedResult(String[] strArr, String[] strArr2, String[] strArr3, String str, String str2) {
super(ParsedResultType.EMAIL_ADDRESS);
this.b = strArr;
this.c = strArr2;
this.d = strArr3;
this.e = str;
this.f = str2;
}
}

View File

@@ -0,0 +1,61 @@
package com.google.zxing.client.result;
import com.google.zxing.Result;
import java.util.Map;
import java.util.regex.Pattern;
/* loaded from: classes.dex */
public final class EmailAddressResultParser extends ResultParser {
private static final Pattern e = Pattern.compile(",");
@Override // com.google.zxing.client.result.ResultParser
public EmailAddressParsedResult a(Result result) {
String[] strArr;
String[] strArr2;
String[] strArr3;
String str;
String str2;
String str3;
String b = ResultParser.b(result);
if (!b.startsWith("mailto:") && !b.startsWith("MAILTO:")) {
if (EmailDoCoMoResultParser.e(b)) {
return new EmailAddressParsedResult(b);
}
return null;
}
String substring = b.substring(7);
int indexOf = substring.indexOf(63);
if (indexOf >= 0) {
substring = substring.substring(0, indexOf);
}
try {
String d = ResultParser.d(substring);
String[] split = !d.isEmpty() ? e.split(d) : null;
Map<String, String> b2 = ResultParser.b(b);
if (b2 != null) {
if (split == null && (str3 = b2.get("to")) != null) {
split = e.split(str3);
}
String str4 = b2.get("cc");
String[] split2 = str4 != null ? e.split(str4) : null;
String str5 = b2.get("bcc");
String[] split3 = str5 != null ? e.split(str5) : null;
String str6 = b2.get("subject");
str2 = b2.get("body");
strArr = split;
strArr3 = split3;
strArr2 = split2;
str = str6;
} else {
strArr = split;
strArr2 = null;
strArr3 = null;
str = null;
str2 = null;
}
return new EmailAddressParsedResult(strArr, strArr2, strArr3, str, str2);
} catch (IllegalArgumentException unused) {
return null;
}
}
}

View File

@@ -0,0 +1,28 @@
package com.google.zxing.client.result;
import com.google.zxing.Result;
import java.util.regex.Pattern;
/* loaded from: classes.dex */
public final class EmailDoCoMoResultParser extends AbstractDoCoMoResultParser {
private static final Pattern e = Pattern.compile("[a-zA-Z0-9@.!#$%&'*+\\-/=?^_`{|}~]+");
static boolean e(String str) {
return str != null && e.matcher(str).matches() && str.indexOf(64) >= 0;
}
@Override // com.google.zxing.client.result.ResultParser
public EmailAddressParsedResult a(Result result) {
String[] a;
String b = ResultParser.b(result);
if (!b.startsWith("MATMSG:") || (a = AbstractDoCoMoResultParser.a("TO:", b, true)) == null) {
return null;
}
for (String str : a) {
if (!e(str)) {
return null;
}
}
return new EmailAddressParsedResult(a, null, null, AbstractDoCoMoResultParser.b("SUB:", b, false), AbstractDoCoMoResultParser.b("BODY:", b, false));
}
}

View File

@@ -0,0 +1,71 @@
package com.google.zxing.client.result;
import java.util.Map;
/* loaded from: classes.dex */
public final class ExpandedProductParsedResult extends ParsedResult {
private final String b;
private final String c;
private final String d;
private final String e;
private final String f;
private final String g;
private final String h;
private final String i;
private final String j;
private final String k;
private final String l;
private final String m;
private final String n;
private final Map<String, String> o;
public ExpandedProductParsedResult(String str, String str2, String str3, String str4, String str5, String str6, String str7, String str8, String str9, String str10, String str11, String str12, String str13, String str14, Map<String, String> map) {
super(ParsedResultType.PRODUCT);
this.b = str;
this.c = str2;
this.d = str3;
this.e = str4;
this.f = str5;
this.g = str7;
this.h = str8;
this.i = str9;
this.j = str10;
this.k = str11;
this.l = str12;
this.m = str13;
this.n = str14;
this.o = map;
}
private static boolean a(Object obj, Object obj2) {
return obj == null ? obj2 == null : obj.equals(obj2);
}
public String c() {
return this.b;
}
public boolean equals(Object obj) {
if (!(obj instanceof ExpandedProductParsedResult)) {
return false;
}
ExpandedProductParsedResult expandedProductParsedResult = (ExpandedProductParsedResult) obj;
return a(this.c, expandedProductParsedResult.c) && a(this.d, expandedProductParsedResult.d) && a(this.e, expandedProductParsedResult.e) && a(this.f, expandedProductParsedResult.f) && a(this.g, expandedProductParsedResult.g) && a(this.h, expandedProductParsedResult.h) && a(this.i, expandedProductParsedResult.i) && a(this.j, expandedProductParsedResult.j) && a(this.k, expandedProductParsedResult.k) && a(this.l, expandedProductParsedResult.l) && a(this.m, expandedProductParsedResult.m) && a(this.n, expandedProductParsedResult.n) && a(this.o, expandedProductParsedResult.o);
}
public int hashCode() {
return ((((((((((((a(this.c) ^ 0) ^ a(this.d)) ^ a(this.e)) ^ a(this.f)) ^ a(this.g)) ^ a(this.h)) ^ a(this.i)) ^ a(this.j)) ^ a(this.k)) ^ a(this.l)) ^ a(this.m)) ^ a(this.n)) ^ a(this.o);
}
private static int a(Object obj) {
if (obj == null) {
return 0;
}
return obj.hashCode();
}
@Override // com.google.zxing.client.result.ParsedResult
public String a() {
return String.valueOf(this.b);
}
}

View File

@@ -0,0 +1,435 @@
package com.google.zxing.client.result;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.Result;
import java.util.HashMap;
/* loaded from: classes.dex */
public final class ExpandedProductResultParser extends ResultParser {
private static String b(int i, String str) {
StringBuilder sb = new StringBuilder();
String substring = str.substring(i);
for (int i2 = 0; i2 < substring.length(); i2++) {
char charAt = substring.charAt(i2);
if (charAt != '(') {
sb.append(charAt);
} else {
if (a(i2, substring) != null) {
break;
}
sb.append('(');
}
}
return sb.toString();
}
/* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */
/* JADX WARN: Failed to restore switch over string. Please report as a decompilation issue */
@Override // com.google.zxing.client.result.ResultParser
public ExpandedProductParsedResult a(Result result) {
char c;
ExpandedProductParsedResult expandedProductParsedResult = null;
if (result.a() != BarcodeFormat.RSS_EXPANDED) {
return null;
}
String b = ResultParser.b(result);
HashMap hashMap = new HashMap();
String str = null;
String str2 = null;
String str3 = null;
String str4 = null;
String str5 = null;
String str6 = null;
String str7 = null;
String str8 = null;
String str9 = null;
String str10 = null;
String str11 = null;
String str12 = null;
String str13 = null;
int i = 0;
while (i < b.length()) {
String a = a(i, b);
if (a == null) {
return expandedProductParsedResult;
}
int length = i + a.length() + 2;
String b2 = b(length, b);
int length2 = length + b2.length();
int hashCode = a.hashCode();
String str14 = str11;
String str15 = str10;
if (hashCode == 1536) {
if (a.equals("00")) {
c = 0;
}
c = 65535;
} else if (hashCode == 1537) {
if (a.equals("01")) {
c = 1;
}
c = 65535;
} else if (hashCode == 1567) {
if (a.equals("10")) {
c = 2;
}
c = 65535;
} else if (hashCode == 1568) {
if (a.equals("11")) {
c = 3;
}
c = 65535;
} else if (hashCode == 1570) {
if (a.equals("13")) {
c = 4;
}
c = 65535;
} else if (hashCode == 1572) {
if (a.equals("15")) {
c = 5;
}
c = 65535;
} else if (hashCode != 1574) {
switch (hashCode) {
case 1567966:
if (a.equals("3100")) {
c = 7;
break;
}
c = 65535;
break;
case 1567967:
if (a.equals("3101")) {
c = '\b';
break;
}
c = 65535;
break;
case 1567968:
if (a.equals("3102")) {
c = '\t';
break;
}
c = 65535;
break;
case 1567969:
if (a.equals("3103")) {
c = '\n';
break;
}
c = 65535;
break;
case 1567970:
if (a.equals("3104")) {
c = 11;
break;
}
c = 65535;
break;
case 1567971:
if (a.equals("3105")) {
c = '\f';
break;
}
c = 65535;
break;
case 1567972:
if (a.equals("3106")) {
c = '\r';
break;
}
c = 65535;
break;
case 1567973:
if (a.equals("3107")) {
c = 14;
break;
}
c = 65535;
break;
case 1567974:
if (a.equals("3108")) {
c = 15;
break;
}
c = 65535;
break;
case 1567975:
if (a.equals("3109")) {
c = 16;
break;
}
c = 65535;
break;
default:
switch (hashCode) {
case 1568927:
if (a.equals("3200")) {
c = 17;
break;
}
c = 65535;
break;
case 1568928:
if (a.equals("3201")) {
c = 18;
break;
}
c = 65535;
break;
case 1568929:
if (a.equals("3202")) {
c = 19;
break;
}
c = 65535;
break;
case 1568930:
if (a.equals("3203")) {
c = 20;
break;
}
c = 65535;
break;
case 1568931:
if (a.equals("3204")) {
c = 21;
break;
}
c = 65535;
break;
case 1568932:
if (a.equals("3205")) {
c = 22;
break;
}
c = 65535;
break;
case 1568933:
if (a.equals("3206")) {
c = 23;
break;
}
c = 65535;
break;
case 1568934:
if (a.equals("3207")) {
c = 24;
break;
}
c = 65535;
break;
case 1568935:
if (a.equals("3208")) {
c = 25;
break;
}
c = 65535;
break;
case 1568936:
if (a.equals("3209")) {
c = 26;
break;
}
c = 65535;
break;
default:
switch (hashCode) {
case 1575716:
if (a.equals("3920")) {
c = 27;
break;
}
c = 65535;
break;
case 1575717:
if (a.equals("3921")) {
c = 28;
break;
}
c = 65535;
break;
case 1575718:
if (a.equals("3922")) {
c = 29;
break;
}
c = 65535;
break;
case 1575719:
if (a.equals("3923")) {
c = 30;
break;
}
c = 65535;
break;
default:
switch (hashCode) {
case 1575747:
if (a.equals("3930")) {
c = 31;
break;
}
c = 65535;
break;
case 1575748:
if (a.equals("3931")) {
c = ' ';
break;
}
c = 65535;
break;
case 1575749:
if (a.equals("3932")) {
c = '!';
break;
}
c = 65535;
break;
case 1575750:
if (a.equals("3933")) {
c = '\"';
break;
}
c = 65535;
break;
default:
c = 65535;
break;
}
}
}
}
} else {
if (a.equals("17")) {
c = 6;
}
c = 65535;
}
switch (c) {
case 0:
str2 = b2;
i = length2;
str11 = str14;
str10 = str15;
expandedProductParsedResult = null;
case 1:
str = b2;
i = length2;
str11 = str14;
str10 = str15;
expandedProductParsedResult = null;
case 2:
str3 = b2;
i = length2;
str11 = str14;
str10 = str15;
expandedProductParsedResult = null;
case 3:
str4 = b2;
i = length2;
str11 = str14;
str10 = str15;
expandedProductParsedResult = null;
case 4:
str5 = b2;
i = length2;
str11 = str14;
str10 = str15;
expandedProductParsedResult = null;
case 5:
str6 = b2;
i = length2;
str11 = str14;
str10 = str15;
expandedProductParsedResult = null;
case 6:
str7 = b2;
i = length2;
str11 = str14;
str10 = str15;
expandedProductParsedResult = null;
case 7:
case '\b':
case '\t':
case '\n':
case 11:
case '\f':
case '\r':
case 14:
case 15:
case 16:
str10 = a.substring(3);
str9 = "KG";
str8 = b2;
i = length2;
str11 = str14;
expandedProductParsedResult = null;
case 17:
case 18:
case 19:
case 20:
case 21:
case 22:
case 23:
case 24:
case 25:
case 26:
str10 = a.substring(3);
str9 = "LB";
str8 = b2;
i = length2;
str11 = str14;
expandedProductParsedResult = null;
case 27:
case 28:
case 29:
case 30:
str12 = a.substring(3);
str11 = b2;
i = length2;
str10 = str15;
expandedProductParsedResult = null;
case 31:
case ' ':
case '!':
case '\"':
if (b2.length() < 4) {
return null;
}
str11 = b2.substring(3);
str13 = b2.substring(0, 3);
str12 = a.substring(3);
i = length2;
str10 = str15;
expandedProductParsedResult = null;
default:
hashMap.put(a, b2);
i = length2;
str11 = str14;
str10 = str15;
expandedProductParsedResult = null;
}
}
return new ExpandedProductParsedResult(b, str, str2, str3, str4, str5, str6, str7, str8, str9, str10, str11, str12, str13, hashMap);
}
private static String a(int i, String str) {
if (str.charAt(i) != '(') {
return null;
}
String substring = str.substring(i + 1);
StringBuilder sb = new StringBuilder();
for (int i2 = 0; i2 < substring.length(); i2++) {
char charAt = substring.charAt(i2);
if (charAt == ')') {
return sb.toString();
}
if (charAt < '0' || charAt > '9') {
return null;
}
sb.append(charAt);
}
return sb.toString();
}
}

View File

@@ -0,0 +1,61 @@
package com.google.zxing.client.result;
/* loaded from: classes.dex */
public final class GeoParsedResult extends ParsedResult {
private final double b;
private final double c;
private final double d;
private final String e;
GeoParsedResult(double d, double d2, double d3, String str) {
super(ParsedResultType.GEO);
this.b = d;
this.c = d2;
this.d = d3;
this.e = str;
}
@Override // com.google.zxing.client.result.ParsedResult
public String a() {
StringBuilder sb = new StringBuilder(20);
sb.append(this.b);
sb.append(", ");
sb.append(this.c);
if (this.d > 0.0d) {
sb.append(", ");
sb.append(this.d);
sb.append('m');
}
if (this.e != null) {
sb.append(" (");
sb.append(this.e);
sb.append(')');
}
return sb.toString();
}
public String c() {
StringBuilder sb = new StringBuilder();
sb.append("geo:");
sb.append(this.b);
sb.append(',');
sb.append(this.c);
if (this.d > 0.0d) {
sb.append(',');
sb.append(this.d);
}
if (this.e != null) {
sb.append('?');
sb.append(this.e);
}
return sb.toString();
}
public double d() {
return this.b;
}
public double e() {
return this.c;
}
}

View File

@@ -0,0 +1,38 @@
package com.google.zxing.client.result;
import com.google.zxing.Result;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/* loaded from: classes.dex */
public final class GeoResultParser extends ResultParser {
private static final Pattern e = Pattern.compile("geo:([\\-0-9.]+),([\\-0-9.]+)(?:,([\\-0-9.]+))?(?:\\?(.*))?", 2);
@Override // com.google.zxing.client.result.ResultParser
public GeoParsedResult a(Result result) {
Matcher matcher = e.matcher(ResultParser.b(result));
if (!matcher.matches()) {
return null;
}
String group = matcher.group(4);
try {
double parseDouble = Double.parseDouble(matcher.group(1));
if (parseDouble <= 90.0d && parseDouble >= -90.0d) {
double parseDouble2 = Double.parseDouble(matcher.group(2));
if (parseDouble2 <= 180.0d && parseDouble2 >= -180.0d) {
double d = 0.0d;
if (matcher.group(3) != null) {
double parseDouble3 = Double.parseDouble(matcher.group(3));
if (parseDouble3 < 0.0d) {
return null;
}
d = parseDouble3;
}
return new GeoParsedResult(parseDouble, parseDouble2, d, group);
}
}
} catch (NumberFormatException unused) {
}
return null;
}
}

View File

@@ -0,0 +1,20 @@
package com.google.zxing.client.result;
/* loaded from: classes.dex */
public final class ISBNParsedResult extends ParsedResult {
private final String b;
ISBNParsedResult(String str) {
super(ParsedResultType.ISBN);
this.b = str;
}
@Override // com.google.zxing.client.result.ParsedResult
public String a() {
return this.b;
}
public String c() {
return this.b;
}
}

View File

@@ -0,0 +1,22 @@
package com.google.zxing.client.result;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.Result;
/* loaded from: classes.dex */
public final class ISBNResultParser extends ResultParser {
@Override // com.google.zxing.client.result.ResultParser
public ISBNParsedResult a(Result result) {
if (result.a() != BarcodeFormat.EAN_13) {
return null;
}
String b = ResultParser.b(result);
if (b.length() != 13) {
return null;
}
if (b.startsWith("978") || b.startsWith("979")) {
return new ISBNParsedResult(b);
}
return null;
}
}

View File

@@ -0,0 +1,38 @@
package com.google.zxing.client.result;
/* loaded from: classes.dex */
public abstract class ParsedResult {
private final ParsedResultType a;
protected ParsedResult(ParsedResultType parsedResultType) {
this.a = parsedResultType;
}
public static void a(String str, StringBuilder sb) {
if (str == null || str.isEmpty()) {
return;
}
if (sb.length() > 0) {
sb.append('\n');
}
sb.append(str);
}
public abstract String a();
public final ParsedResultType b() {
return this.a;
}
public final String toString() {
return a();
}
public static void a(String[] strArr, StringBuilder sb) {
if (strArr != null) {
for (String str : strArr) {
a(str, sb);
}
}
}
}

View File

@@ -0,0 +1,17 @@
package com.google.zxing.client.result;
/* loaded from: classes.dex */
public enum ParsedResultType {
ADDRESSBOOK,
EMAIL_ADDRESS,
PRODUCT,
URI,
TEXT,
GEO,
TEL,
SMS,
CALENDAR,
WIFI,
ISBN,
VIN
}

View File

@@ -0,0 +1,26 @@
package com.google.zxing.client.result;
/* loaded from: classes.dex */
public final class ProductParsedResult extends ParsedResult {
private final String b;
private final String c;
ProductParsedResult(String str, String str2) {
super(ParsedResultType.PRODUCT);
this.b = str;
this.c = str2;
}
@Override // com.google.zxing.client.result.ParsedResult
public String a() {
return this.b;
}
public String c() {
return this.c;
}
public String d() {
return this.b;
}
}

View File

@@ -0,0 +1,21 @@
package com.google.zxing.client.result;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.Result;
import com.google.zxing.oned.UPCEReader;
/* loaded from: classes.dex */
public final class ProductResultParser extends ResultParser {
@Override // com.google.zxing.client.result.ResultParser
public ProductParsedResult a(Result result) {
BarcodeFormat a = result.a();
if (a != BarcodeFormat.UPC_A && a != BarcodeFormat.UPC_E && a != BarcodeFormat.EAN_8 && a != BarcodeFormat.EAN_13) {
return null;
}
String b = ResultParser.b(result);
if (ResultParser.b(b, b.length())) {
return new ProductParsedResult(b, (a == BarcodeFormat.UPC_E && b.length() == 8) ? UPCEReader.b(b) : b);
}
return null;
}
}

View File

@@ -0,0 +1,172 @@
package com.google.zxing.client.result;
import com.google.zxing.Result;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Pattern;
/* loaded from: classes.dex */
public abstract class ResultParser {
private static final ResultParser[] a = {new BookmarkDoCoMoResultParser(), new AddressBookDoCoMoResultParser(), new EmailDoCoMoResultParser(), new AddressBookAUResultParser(), new VCardResultParser(), new BizcardResultParser(), new VEventResultParser(), new EmailAddressResultParser(), new SMTPResultParser(), new TelResultParser(), new SMSMMSResultParser(), new SMSTOMMSTOResultParser(), new GeoResultParser(), new WifiResultParser(), new URLTOResultParser(), new URIResultParser(), new ISBNResultParser(), new ProductResultParser(), new ExpandedProductResultParser(), new VINResultParser()};
private static final Pattern b = Pattern.compile("\\d+");
private static final Pattern c = Pattern.compile("&");
private static final Pattern d = Pattern.compile("=");
protected static int a(char c2) {
if (c2 >= '0' && c2 <= '9') {
return c2 - '0';
}
char c3 = 'a';
if (c2 < 'a' || c2 > 'f') {
c3 = 'A';
if (c2 < 'A' || c2 > 'F') {
return -1;
}
}
return (c2 - c3) + 10;
}
protected static boolean a(CharSequence charSequence, int i, int i2) {
int i3;
return charSequence != null && i2 > 0 && charSequence.length() >= (i3 = i2 + i) && b.matcher(charSequence.subSequence(i, i3)).matches();
}
protected static String[] a(String str) {
if (str == null) {
return null;
}
return new String[]{str};
}
protected static String b(Result result) {
String e = result.e();
return e.startsWith("\ufeff") ? e.substring(1) : e;
}
public static ParsedResult c(Result result) {
for (ResultParser resultParser : a) {
ParsedResult a2 = resultParser.a(result);
if (a2 != null) {
return a2;
}
}
return new TextParsedResult(result.e(), null);
}
static String d(String str) {
try {
return URLDecoder.decode(str, "UTF-8");
} catch (UnsupportedEncodingException e) {
throw new IllegalStateException(e);
}
}
public abstract ParsedResult a(Result result);
private static void a(CharSequence charSequence, Map<String, String> map) {
String[] split = d.split(charSequence, 2);
if (split.length == 2) {
try {
map.put(split[0], d(split[1]));
} catch (IllegalArgumentException unused) {
}
}
}
protected static boolean b(CharSequence charSequence, int i) {
return charSequence != null && i > 0 && i == charSequence.length() && b.matcher(charSequence).matches();
}
protected static String c(String str) {
int indexOf = str.indexOf(92);
if (indexOf < 0) {
return str;
}
int length = str.length();
StringBuilder sb = new StringBuilder(length - 1);
sb.append(str.toCharArray(), 0, indexOf);
boolean z = false;
while (indexOf < length) {
char charAt = str.charAt(indexOf);
if (z || charAt != '\\') {
sb.append(charAt);
z = false;
} else {
z = true;
}
indexOf++;
}
return sb.toString();
}
static Map<String, String> b(String str) {
int indexOf = str.indexOf(63);
if (indexOf < 0) {
return null;
}
HashMap hashMap = new HashMap(3);
for (String str2 : c.split(str.substring(indexOf + 1))) {
a(str2, hashMap);
}
return hashMap;
}
static String[] a(String str, String str2, char c2, boolean z) {
int i;
int length = str2.length();
ArrayList arrayList = null;
for (int i2 = 0; i2 < length; i2 = i) {
int indexOf = str2.indexOf(str, i2);
if (indexOf < 0) {
break;
}
int length2 = indexOf + str.length();
boolean z2 = true;
i = length2;
while (z2) {
int indexOf2 = str2.indexOf(c2, i);
if (indexOf2 < 0) {
i = str2.length();
} else if (a(str2, indexOf2) % 2 != 0) {
i = indexOf2 + 1;
} else {
if (arrayList == null) {
arrayList = new ArrayList(3);
}
String c3 = c(str2.substring(length2, indexOf2));
if (z) {
c3 = c3.trim();
}
if (!c3.isEmpty()) {
arrayList.add(c3);
}
i = indexOf2 + 1;
}
z2 = false;
}
}
if (arrayList == null || arrayList.isEmpty()) {
return null;
}
return (String[]) arrayList.toArray(new String[arrayList.size()]);
}
static String b(String str, String str2, char c2, boolean z) {
String[] a2 = a(str, str2, c2, z);
if (a2 == null) {
return null;
}
return a2[0];
}
private static int a(CharSequence charSequence, int i) {
int i2 = 0;
for (int i3 = i - 1; i3 >= 0 && charSequence.charAt(i3) == '\\'; i3--) {
i2++;
}
return i2;
}
}

View File

@@ -0,0 +1,55 @@
package com.google.zxing.client.result;
import com.google.zxing.Result;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Map;
/* loaded from: classes.dex */
public final class SMSMMSResultParser extends ResultParser {
@Override // com.google.zxing.client.result.ResultParser
public SMSParsedResult a(Result result) {
String str;
String b = ResultParser.b(result);
String str2 = null;
if (!b.startsWith("sms:") && !b.startsWith("SMS:") && !b.startsWith("mms:") && !b.startsWith("MMS:")) {
return null;
}
Map<String, String> b2 = ResultParser.b(b);
boolean z = false;
if (b2 == null || b2.isEmpty()) {
str = null;
} else {
str2 = b2.get("subject");
str = b2.get("body");
z = true;
}
int indexOf = b.indexOf(63, 4);
String substring = (indexOf < 0 || !z) ? b.substring(4) : b.substring(4, indexOf);
int i = -1;
ArrayList arrayList = new ArrayList(1);
ArrayList arrayList2 = new ArrayList(1);
while (true) {
int i2 = i + 1;
int indexOf2 = substring.indexOf(44, i2);
if (indexOf2 <= i) {
a(arrayList, arrayList2, substring.substring(i2));
return new SMSParsedResult((String[]) arrayList.toArray(new String[arrayList.size()]), (String[]) arrayList2.toArray(new String[arrayList2.size()]), str2, str);
}
a(arrayList, arrayList2, substring.substring(i2, indexOf2));
i = indexOf2;
}
}
private static void a(Collection<String> collection, Collection<String> collection2, String str) {
int indexOf = str.indexOf(59);
if (indexOf < 0) {
collection.add(str);
collection2.add(null);
} else {
collection.add(str.substring(0, indexOf));
String substring = str.substring(indexOf + 1);
collection2.add(substring.startsWith("via=") ? substring.substring(4) : null);
}
}
}

View File

@@ -0,0 +1,44 @@
package com.google.zxing.client.result;
/* loaded from: classes.dex */
public final class SMSParsedResult extends ParsedResult {
private final String[] b;
private final String c;
private final String d;
public SMSParsedResult(String str, String str2, String str3, String str4) {
super(ParsedResultType.SMS);
this.b = new String[]{str};
new String[1][0] = str2;
this.c = str3;
this.d = str4;
}
@Override // com.google.zxing.client.result.ParsedResult
public String a() {
StringBuilder sb = new StringBuilder(100);
ParsedResult.a(this.b, sb);
ParsedResult.a(this.c, sb);
ParsedResult.a(this.d, sb);
return sb.toString();
}
public String c() {
return this.d;
}
public String[] d() {
return this.b;
}
public String e() {
return this.c;
}
public SMSParsedResult(String[] strArr, String[] strArr2, String str, String str2) {
super(ParsedResultType.SMS);
this.b = strArr;
this.c = str;
this.d = str2;
}
}

View File

@@ -0,0 +1,24 @@
package com.google.zxing.client.result;
import com.google.zxing.Result;
/* loaded from: classes.dex */
public final class SMSTOMMSTOResultParser extends ResultParser {
@Override // com.google.zxing.client.result.ResultParser
public SMSParsedResult a(Result result) {
String str;
String b = ResultParser.b(result);
if (!b.startsWith("smsto:") && !b.startsWith("SMSTO:") && !b.startsWith("mmsto:") && !b.startsWith("MMSTO:")) {
return null;
}
String substring = b.substring(6);
int indexOf = substring.indexOf(58);
if (indexOf >= 0) {
str = substring.substring(indexOf + 1);
substring = substring.substring(0, indexOf);
} else {
str = null;
}
return new SMSParsedResult(substring, (String) null, (String) null, str);
}
}

View File

@@ -0,0 +1,35 @@
package com.google.zxing.client.result;
import com.google.zxing.Result;
/* loaded from: classes.dex */
public final class SMTPResultParser extends ResultParser {
@Override // com.google.zxing.client.result.ResultParser
public EmailAddressParsedResult a(Result result) {
String str;
String str2;
String b = ResultParser.b(result);
if (!b.startsWith("smtp:") && !b.startsWith("SMTP:")) {
return null;
}
String substring = b.substring(5);
int indexOf = substring.indexOf(58);
if (indexOf >= 0) {
String substring2 = substring.substring(indexOf + 1);
substring = substring.substring(0, indexOf);
int indexOf2 = substring2.indexOf(58);
if (indexOf2 >= 0) {
String substring3 = substring2.substring(indexOf2 + 1);
str = substring2.substring(0, indexOf2);
str2 = substring3;
} else {
str2 = null;
str = substring2;
}
} else {
str = null;
str2 = null;
}
return new EmailAddressParsedResult(new String[]{substring}, null, null, str, str2);
}
}

View File

@@ -0,0 +1,31 @@
package com.google.zxing.client.result;
/* loaded from: classes.dex */
public final class TelParsedResult extends ParsedResult {
private final String b;
private final String c;
private final String d;
public TelParsedResult(String str, String str2, String str3) {
super(ParsedResultType.TEL);
this.b = str;
this.c = str2;
this.d = str3;
}
@Override // com.google.zxing.client.result.ParsedResult
public String a() {
StringBuilder sb = new StringBuilder(20);
ParsedResult.a(this.b, sb);
ParsedResult.a(this.d, sb);
return sb.toString();
}
public String c() {
return this.b;
}
public String d() {
return this.c;
}
}

View File

@@ -0,0 +1,22 @@
package com.google.zxing.client.result;
import com.google.zxing.Result;
/* loaded from: classes.dex */
public final class TelResultParser extends ResultParser {
@Override // com.google.zxing.client.result.ResultParser
public TelParsedResult a(Result result) {
String str;
String b = ResultParser.b(result);
if (!b.startsWith("tel:") && !b.startsWith("TEL:")) {
return null;
}
if (b.startsWith("TEL:")) {
str = "tel:" + b.substring(4);
} else {
str = b;
}
int indexOf = b.indexOf(63, 4);
return new TelParsedResult(indexOf < 0 ? b.substring(4) : b.substring(4, indexOf), str, null);
}
}

View File

@@ -0,0 +1,16 @@
package com.google.zxing.client.result;
/* loaded from: classes.dex */
public final class TextParsedResult extends ParsedResult {
private final String b;
public TextParsedResult(String str, String str2) {
super(ParsedResultType.TEXT);
this.b = str;
}
@Override // com.google.zxing.client.result.ParsedResult
public String a() {
return this.b;
}
}

View File

@@ -0,0 +1,46 @@
package com.google.zxing.client.result;
import java.util.regex.Pattern;
/* loaded from: classes.dex */
public final class URIParsedResult extends ParsedResult {
private final String b;
private final String c;
static {
Pattern.compile(":/*([^/@]+)@[^/]+");
}
public URIParsedResult(String str, String str2) {
super(ParsedResultType.URI);
this.b = a(str);
this.c = str2;
}
@Override // com.google.zxing.client.result.ParsedResult
public String a() {
StringBuilder sb = new StringBuilder(30);
ParsedResult.a(this.c, sb);
ParsedResult.a(this.b, sb);
return sb.toString();
}
public String c() {
return this.b;
}
private static String a(String str) {
String trim = str.trim();
int indexOf = trim.indexOf(58);
return (indexOf < 0 || a(trim, indexOf)) ? "http://".concat(String.valueOf(trim)) : trim;
}
private static boolean a(String str, int i) {
int i2 = i + 1;
int indexOf = str.indexOf(47, i2);
if (indexOf < 0) {
indexOf = str.length();
}
return ResultParser.a(str, i2, indexOf - i2);
}
}

View File

@@ -0,0 +1,36 @@
package com.google.zxing.client.result;
import com.google.zxing.Result;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/* loaded from: classes.dex */
public final class URIResultParser extends ResultParser {
private static final Pattern e = Pattern.compile("[a-zA-Z][a-zA-Z0-9+-.]+:");
private static final Pattern f = Pattern.compile("([a-zA-Z0-9\\-]+\\.){1,6}[a-zA-Z]{2,}(:\\d{1,5})?(/|\\?|$)");
static boolean e(String str) {
if (str.contains(" ")) {
return false;
}
Matcher matcher = e.matcher(str);
if (matcher.find() && matcher.start() == 0) {
return true;
}
Matcher matcher2 = f.matcher(str);
return matcher2.find() && matcher2.start() == 0;
}
@Override // com.google.zxing.client.result.ResultParser
public URIParsedResult a(Result result) {
String b = ResultParser.b(result);
if (b.startsWith("URL:") || b.startsWith("URI:")) {
return new URIParsedResult(b.substring(4).trim(), null);
}
String trim = b.trim();
if (e(trim)) {
return new URIParsedResult(trim, null);
}
return null;
}
}

View File

@@ -0,0 +1,16 @@
package com.google.zxing.client.result;
import com.google.zxing.Result;
/* loaded from: classes.dex */
public final class URLTOResultParser extends ResultParser {
@Override // com.google.zxing.client.result.ResultParser
public URIParsedResult a(Result result) {
int indexOf;
String b = ResultParser.b(result);
if ((b.startsWith("urlto:") || b.startsWith("URLTO:")) && (indexOf = b.indexOf(58, 6)) >= 0) {
return new URIParsedResult(b.substring(indexOf + 1), indexOf > 6 ? b.substring(6, indexOf) : null);
}
return null;
}
}

View File

@@ -0,0 +1,337 @@
package com.google.zxing.client.result;
import com.google.zxing.Result;
import java.io.ByteArrayOutputStream;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/* loaded from: classes.dex */
public final class VCardResultParser extends ResultParser {
private static final Pattern e = Pattern.compile("BEGIN:VCARD", 2);
private static final Pattern f = Pattern.compile("\\d{4}-?\\d{2}-?\\d{2}");
private static final Pattern g = Pattern.compile("\r\n[ \t]");
private static final Pattern h = Pattern.compile("\\\\[nN]");
private static final Pattern i = Pattern.compile("\\\\([,;\\\\])");
private static final Pattern j = Pattern.compile("=");
private static final Pattern k = Pattern.compile(";");
private static final Pattern l = Pattern.compile("(?<!\\\\);+");
private static final Pattern m = Pattern.compile(",");
private static final Pattern n = Pattern.compile("[;,]");
static List<List<String>> b(CharSequence charSequence, String str, boolean z, boolean z2) {
ArrayList arrayList;
boolean z3;
String str2;
String str3;
int indexOf;
String replaceAll;
int length = str.length();
int i2 = 0;
int i3 = 0;
ArrayList arrayList2 = null;
while (i3 < length) {
int i4 = 2;
Matcher matcher = Pattern.compile("(?:^|\n)" + ((Object) charSequence) + "(?:;([^:]*))?:", 2).matcher(str);
if (i3 > 0) {
i3--;
}
if (!matcher.find(i3)) {
break;
}
int end = matcher.end(i2);
String group = matcher.group(1);
if (group != null) {
String[] split = k.split(group);
int length2 = split.length;
int i5 = 0;
arrayList = null;
z3 = false;
str2 = null;
str3 = null;
while (i5 < length2) {
String str4 = split[i5];
if (arrayList == null) {
arrayList = new ArrayList(1);
}
arrayList.add(str4);
String[] split2 = j.split(str4, i4);
if (split2.length > 1) {
String str5 = split2[0];
String str6 = split2[1];
if ("ENCODING".equalsIgnoreCase(str5) && "QUOTED-PRINTABLE".equalsIgnoreCase(str6)) {
z3 = true;
} else if ("CHARSET".equalsIgnoreCase(str5)) {
str2 = str6;
} else if ("VALUE".equalsIgnoreCase(str5)) {
str3 = str6;
}
}
i5++;
i4 = 2;
}
} else {
arrayList = null;
z3 = false;
str2 = null;
str3 = null;
}
int i6 = end;
while (true) {
indexOf = str.indexOf(10, i6);
if (indexOf < 0) {
break;
}
if (indexOf < str.length() - 1) {
int i7 = indexOf + 1;
if (str.charAt(i7) == ' ' || str.charAt(i7) == '\t') {
i6 = indexOf + 2;
}
}
if (!z3) {
break;
}
if (indexOf > 0) {
if (str.charAt(indexOf - 1) == '=') {
i6 = indexOf + 1;
}
}
if (indexOf < 2) {
break;
}
if (str.charAt(indexOf - 2) != '=') {
break;
}
i6 = indexOf + 1;
}
if (indexOf < 0) {
i3 = length;
} else {
if (indexOf > end) {
if (arrayList2 == null) {
arrayList2 = new ArrayList(1);
}
if (indexOf > 0 && str.charAt(indexOf - 1) == '\r') {
indexOf--;
}
String substring = str.substring(end, indexOf);
if (z) {
substring = substring.trim();
}
if (z3) {
replaceAll = a(substring, str2);
if (z2) {
replaceAll = l.matcher(replaceAll).replaceAll("\n").trim();
}
} else {
if (z2) {
substring = l.matcher(substring).replaceAll("\n").trim();
}
replaceAll = i.matcher(h.matcher(g.matcher(substring).replaceAll("")).replaceAll("\n")).replaceAll("$1");
}
if ("uri".equals(str3)) {
try {
replaceAll = URI.create(replaceAll).getSchemeSpecificPart();
} catch (IllegalArgumentException unused) {
}
}
if (arrayList == null) {
ArrayList arrayList3 = new ArrayList(1);
arrayList3.add(replaceAll);
arrayList2.add(arrayList3);
} else {
arrayList.add(0, replaceAll);
arrayList2.add(arrayList);
i3 = indexOf + 1;
}
}
i3 = indexOf + 1;
}
i2 = 0;
}
return arrayList2;
}
@Override // com.google.zxing.client.result.ResultParser
public AddressBookParsedResult a(Result result) {
String b = ResultParser.b(result);
Matcher matcher = e.matcher(b);
if (!matcher.find() || matcher.start() != 0) {
return null;
}
List<List<String>> b2 = b((CharSequence) "FN", b, true, false);
if (b2 == null) {
b2 = b((CharSequence) "N", b, true, false);
a((Iterable<List<String>>) b2);
}
List<String> a = a((CharSequence) "NICKNAME", b, true, false);
String[] split = a == null ? null : m.split(a.get(0));
List<List<String>> b3 = b((CharSequence) "TEL", b, true, false);
List<List<String>> b4 = b((CharSequence) "EMAIL", b, true, false);
List<String> a2 = a((CharSequence) "NOTE", b, false, false);
List<List<String>> b5 = b((CharSequence) "ADR", b, true, true);
List<String> a3 = a((CharSequence) "ORG", b, true, true);
List<String> a4 = a((CharSequence) "BDAY", b, true, false);
List<String> list = (a4 == null || a((CharSequence) a4.get(0))) ? a4 : null;
List<String> a5 = a((CharSequence) "TITLE", b, true, false);
List<List<String>> b6 = b((CharSequence) "URL", b, true, false);
List<String> a6 = a((CharSequence) "IMPP", b, true, false);
List<String> a7 = a((CharSequence) "GEO", b, true, false);
String[] split2 = a7 == null ? null : n.split(a7.get(0));
return new AddressBookParsedResult(a((Collection<List<String>>) b2), split, null, a((Collection<List<String>>) b3), b(b3), a((Collection<List<String>>) b4), b(b4), a(a6), a(a2), a((Collection<List<String>>) b5), b(b5), a(a3), a(list), a(a5), a((Collection<List<String>>) b6), (split2 == null || split2.length == 2) ? split2 : null);
}
private static String a(CharSequence charSequence, String str) {
char charAt;
int length = charSequence.length();
StringBuilder sb = new StringBuilder(length);
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
int i2 = 0;
while (i2 < length) {
char charAt2 = charSequence.charAt(i2);
if (charAt2 != '\n' && charAt2 != '\r') {
if (charAt2 != '=') {
a(byteArrayOutputStream, str, sb);
sb.append(charAt2);
} else if (i2 < length - 2 && (charAt = charSequence.charAt(i2 + 1)) != '\r' && charAt != '\n') {
i2 += 2;
char charAt3 = charSequence.charAt(i2);
int a = ResultParser.a(charAt);
int a2 = ResultParser.a(charAt3);
if (a >= 0 && a2 >= 0) {
byteArrayOutputStream.write((a << 4) + a2);
}
}
}
i2++;
}
a(byteArrayOutputStream, str, sb);
return sb.toString();
}
private static String[] b(Collection<List<String>> collection) {
String str;
if (collection == null || collection.isEmpty()) {
return null;
}
ArrayList arrayList = new ArrayList(collection.size());
for (List<String> list : collection) {
String str2 = list.get(0);
if (str2 != null && !str2.isEmpty()) {
int i2 = 1;
while (true) {
if (i2 >= list.size()) {
str = null;
break;
}
String str3 = list.get(i2);
int indexOf = str3.indexOf(61);
if (indexOf < 0) {
str = str3;
break;
}
if ("TYPE".equalsIgnoreCase(str3.substring(0, indexOf))) {
str = str3.substring(indexOf + 1);
break;
}
i2++;
}
arrayList.add(str);
}
}
return (String[]) arrayList.toArray(new String[arrayList.size()]);
}
private static void a(ByteArrayOutputStream byteArrayOutputStream, String str, StringBuilder sb) {
String str2;
if (byteArrayOutputStream.size() > 0) {
byte[] byteArray = byteArrayOutputStream.toByteArray();
if (str == null) {
str2 = new String(byteArray, StandardCharsets.UTF_8);
} else {
try {
str2 = new String(byteArray, str);
} catch (UnsupportedEncodingException unused) {
str2 = new String(byteArray, StandardCharsets.UTF_8);
}
}
byteArrayOutputStream.reset();
sb.append(str2);
}
}
static List<String> a(CharSequence charSequence, String str, boolean z, boolean z2) {
List<List<String>> b = b(charSequence, str, z, z2);
if (b == null || b.isEmpty()) {
return null;
}
return b.get(0);
}
private static String a(List<String> list) {
if (list == null || list.isEmpty()) {
return null;
}
return list.get(0);
}
private static String[] a(Collection<List<String>> collection) {
if (collection == null || collection.isEmpty()) {
return null;
}
ArrayList arrayList = new ArrayList(collection.size());
Iterator<List<String>> it = collection.iterator();
while (it.hasNext()) {
String str = it.next().get(0);
if (str != null && !str.isEmpty()) {
arrayList.add(str);
}
}
return (String[]) arrayList.toArray(new String[arrayList.size()]);
}
private static boolean a(CharSequence charSequence) {
return charSequence == null || f.matcher(charSequence).matches();
}
private static void a(Iterable<List<String>> iterable) {
int indexOf;
if (iterable != null) {
for (List<String> list : iterable) {
String str = list.get(0);
String[] strArr = new String[5];
int i2 = 0;
int i3 = 0;
while (i2 < 4 && (indexOf = str.indexOf(59, i3)) >= 0) {
strArr[i2] = str.substring(i3, indexOf);
i2++;
i3 = indexOf + 1;
}
strArr[i2] = str.substring(i3);
StringBuilder sb = new StringBuilder(100);
a(strArr, 3, sb);
a(strArr, 1, sb);
a(strArr, 2, sb);
a(strArr, 0, sb);
a(strArr, 4, sb);
list.set(0, sb.toString().trim());
}
}
}
private static void a(String[] strArr, int i2, StringBuilder sb) {
if (strArr[i2] == null || strArr[i2].isEmpty()) {
return;
}
if (sb.length() > 0) {
sb.append(' ');
}
sb.append(strArr[i2]);
}
}

View File

@@ -0,0 +1,74 @@
package com.google.zxing.client.result;
import com.google.zxing.Result;
import java.util.List;
/* loaded from: classes.dex */
public final class VEventResultParser extends ResultParser {
private static String[] b(CharSequence charSequence, String str, boolean z) {
List<List<String>> b = VCardResultParser.b(charSequence, str, z, false);
if (b == null || b.isEmpty()) {
return null;
}
int size = b.size();
String[] strArr = new String[size];
for (int i = 0; i < size; i++) {
strArr[i] = b.get(i).get(0);
}
return strArr;
}
private static String e(String str) {
return str != null ? (str.startsWith("mailto:") || str.startsWith("MAILTO:")) ? str.substring(7) : str : str;
}
@Override // com.google.zxing.client.result.ResultParser
public CalendarParsedResult a(Result result) {
double parseDouble;
String b = ResultParser.b(result);
if (b.indexOf("BEGIN:VEVENT") < 0) {
return null;
}
String a = a((CharSequence) "SUMMARY", b, true);
String a2 = a((CharSequence) "DTSTART", b, true);
if (a2 == null) {
return null;
}
String a3 = a((CharSequence) "DTEND", b, true);
String a4 = a((CharSequence) "DURATION", b, true);
String a5 = a((CharSequence) "LOCATION", b, true);
String e = e(a((CharSequence) "ORGANIZER", b, true));
String[] b2 = b("ATTENDEE", b, true);
if (b2 != null) {
for (int i = 0; i < b2.length; i++) {
b2[i] = e(b2[i]);
}
}
String a6 = a((CharSequence) "DESCRIPTION", b, true);
String a7 = a((CharSequence) "GEO", b, true);
double d = Double.NaN;
if (a7 == null) {
parseDouble = Double.NaN;
} else {
int indexOf = a7.indexOf(59);
if (indexOf < 0) {
return null;
}
try {
d = Double.parseDouble(a7.substring(0, indexOf));
parseDouble = Double.parseDouble(a7.substring(indexOf + 1));
} catch (NumberFormatException | IllegalArgumentException unused) {
return null;
}
}
return new CalendarParsedResult(a, a2, a3, a4, a5, e, b2, a6, d, parseDouble);
}
private static String a(CharSequence charSequence, String str, boolean z) {
List<String> a = VCardResultParser.a(charSequence, str, z, false);
if (a == null || a.isEmpty()) {
return null;
}
return a.get(0);
}
}

View File

@@ -0,0 +1,46 @@
package com.google.zxing.client.result;
/* loaded from: classes.dex */
public final class VINParsedResult extends ParsedResult {
private final String b;
private final String c;
private final String d;
private final String e;
private final int f;
private final char g;
private final String h;
public VINParsedResult(String str, String str2, String str3, String str4, String str5, String str6, int i, char c, String str7) {
super(ParsedResultType.VIN);
this.b = str2;
this.c = str3;
this.d = str4;
this.e = str5;
this.f = i;
this.g = c;
this.h = str7;
}
@Override // com.google.zxing.client.result.ParsedResult
public String a() {
StringBuilder sb = new StringBuilder(50);
sb.append(this.b);
sb.append(' ');
sb.append(this.c);
sb.append(' ');
sb.append(this.d);
sb.append('\n');
String str = this.e;
if (str != null) {
sb.append(str);
sb.append(' ');
}
sb.append(this.f);
sb.append(' ');
sb.append(this.g);
sb.append(' ');
sb.append(this.h);
sb.append('\n');
return sb.toString();
}
}

View File

@@ -0,0 +1,194 @@
package com.google.zxing.client.result;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.Result;
import java.util.regex.Pattern;
/* loaded from: classes.dex */
public final class VINResultParser extends ResultParser {
private static final Pattern e = Pattern.compile("[IOQ]");
private static final Pattern f = Pattern.compile("[A-Z0-9]{17}");
private static int b(int i) {
if (i > 0 && i <= 7) {
return 9 - i;
}
if (i == 8) {
return 10;
}
if (i == 9) {
return 0;
}
if (i < 10 || i > 17) {
throw new IllegalArgumentException();
}
return 19 - i;
}
private static int c(char c) {
if (c >= 'A' && c <= 'I') {
return (c - 'A') + 1;
}
if (c >= 'J' && c <= 'R') {
return (c - 'J') + 1;
}
if (c >= 'S' && c <= 'Z') {
return (c - 'S') + 2;
}
if (c < '0' || c > '9') {
throw new IllegalArgumentException();
}
return c - '0';
}
private static int b(char c) {
if (c >= 'E' && c <= 'H') {
return (c - 'E') + 1984;
}
if (c >= 'J' && c <= 'N') {
return (c - 'J') + 1988;
}
if (c == 'P') {
return 1993;
}
if (c >= 'R' && c <= 'T') {
return (c - 'R') + 1994;
}
if (c >= 'V' && c <= 'Y') {
return (c - 'V') + 1997;
}
if (c >= '1' && c <= '9') {
return (c - '1') + 2001;
}
if (c < 'A' || c > 'D') {
throw new IllegalArgumentException();
}
return (c - 'A') + 2010;
}
@Override // com.google.zxing.client.result.ResultParser
public VINParsedResult a(Result result) {
if (result.a() != BarcodeFormat.CODE_39) {
return null;
}
String trim = e.matcher(result.e()).replaceAll("").trim();
if (!f.matcher(trim).matches()) {
return null;
}
try {
if (!a((CharSequence) trim)) {
return null;
}
String substring = trim.substring(0, 3);
return new VINParsedResult(trim, substring, trim.substring(3, 9), trim.substring(9, 17), b((CharSequence) substring), trim.substring(3, 8), b(trim.charAt(9)), trim.charAt(10), trim.substring(11));
} catch (IllegalArgumentException unused) {
return null;
}
}
private static String b(CharSequence charSequence) {
char charAt = charSequence.charAt(0);
char charAt2 = charSequence.charAt(1);
if (charAt == '9') {
if (charAt2 >= 'A' && charAt2 <= 'E') {
return "BR";
}
if (charAt2 < '3' || charAt2 > '9') {
return null;
}
return "BR";
}
if (charAt == 'S') {
if (charAt2 >= 'A' && charAt2 <= 'M') {
return "UK";
}
if (charAt2 < 'N' || charAt2 > 'T') {
return null;
}
return "DE";
}
if (charAt == 'Z') {
if (charAt2 < 'A' || charAt2 > 'R') {
return null;
}
return "IT";
}
switch (charAt) {
case '1':
case '4':
case '5':
return "US";
case '2':
return "CA";
case '3':
if (charAt2 < 'A' || charAt2 > 'W') {
return null;
}
return "MX";
default:
switch (charAt) {
case 'J':
if (charAt2 < 'A' || charAt2 > 'T') {
return null;
}
return "JP";
case 'K':
if (charAt2 < 'L' || charAt2 > 'R') {
return null;
}
return "KO";
case 'L':
return "CN";
case 'M':
if (charAt2 < 'A' || charAt2 > 'E') {
return null;
}
return "IN";
default:
switch (charAt) {
case 'V':
if (charAt2 >= 'F' && charAt2 <= 'R') {
return "FR";
}
if (charAt2 < 'S' || charAt2 > 'W') {
return null;
}
return "ES";
case 'W':
return "DE";
case 'X':
if (charAt2 == '0') {
return "RU";
}
if (charAt2 < '3' || charAt2 > '9') {
return null;
}
return "RU";
default:
return null;
}
}
}
}
private static boolean a(CharSequence charSequence) {
int i = 0;
int i2 = 0;
while (i < charSequence.length()) {
int i3 = i + 1;
i2 += b(i3) * c(charSequence.charAt(i));
i = i3;
}
return charSequence.charAt(8) == a(i2 % 11);
}
private static char a(int i) {
if (i < 10) {
return (char) (i + 48);
}
if (i == 10) {
return 'X';
}
throw new IllegalArgumentException();
}
}

View File

@@ -0,0 +1,67 @@
package com.google.zxing.client.result;
/* loaded from: classes.dex */
public final class WifiParsedResult extends ParsedResult {
private final String b;
private final String c;
private final String d;
private final boolean e;
private final String f;
private final String g;
private final String h;
private final String i;
public WifiParsedResult(String str, String str2, String str3, boolean z, String str4, String str5, String str6, String str7) {
super(ParsedResultType.WIFI);
this.b = str2;
this.c = str;
this.d = str3;
this.e = z;
this.f = str4;
this.g = str5;
this.h = str6;
this.i = str7;
}
@Override // com.google.zxing.client.result.ParsedResult
public String a() {
StringBuilder sb = new StringBuilder(80);
ParsedResult.a(this.b, sb);
ParsedResult.a(this.c, sb);
ParsedResult.a(this.d, sb);
ParsedResult.a(Boolean.toString(this.e), sb);
return sb.toString();
}
public String c() {
return this.g;
}
public String d() {
return this.h;
}
public String e() {
return this.f;
}
public String f() {
return this.c;
}
public String g() {
return this.d;
}
public String h() {
return this.i;
}
public String i() {
return this.b;
}
public boolean j() {
return this.e;
}
}

View File

@@ -0,0 +1,22 @@
package com.google.zxing.client.result;
import com.google.zxing.Result;
/* loaded from: classes.dex */
public final class WifiResultParser extends ResultParser {
@Override // com.google.zxing.client.result.ResultParser
public WifiParsedResult a(Result result) {
String substring;
String b;
String b2 = ResultParser.b(result);
if (!b2.startsWith("WIFI:") || (b = ResultParser.b("S:", (substring = b2.substring(5)), ';', false)) == null || b.isEmpty()) {
return null;
}
String b3 = ResultParser.b("P:", substring, ';', false);
String b4 = ResultParser.b("T:", substring, ';', false);
if (b4 == null) {
b4 = "nopass";
}
return new WifiParsedResult(b4, b, b3, Boolean.parseBoolean(ResultParser.b("H:", substring, ';', false)), ResultParser.b("I:", substring, ';', false), ResultParser.b("A:", substring, ';', false), ResultParser.b("E:", substring, ';', false), ResultParser.b("H:", substring, ';', false));
}
}