package com.google.zxing.client.result;

import com.cvte.vman.instance.InvokeCmd;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.Result;
import com.seewo.sdk.model.SDKKeyboardCode;
import java.util.HashMap;

/* JADX INFO: loaded from: classes.dex */
public final class ExpandedProductResultParser extends ResultParser {
    private static String findAIvalue(int i2, String str) {
        char cCharAt;
        if (str.charAt(i2) != '(') {
            return null;
        }
        String strSubstring = str.substring(i2 + 1);
        StringBuilder sb = new StringBuilder();
        for (int i3 = 0; i3 < strSubstring.length() && (cCharAt = strSubstring.charAt(i3)) != ')'; i3++) {
            if (cCharAt < '0' || cCharAt > '9') {
                return null;
            }
            sb.append(cCharAt);
        }
        return sb.toString();
    }

    private static String findValue(int i2, String str) {
        StringBuilder sb = new StringBuilder();
        String strSubstring = str.substring(i2);
        for (int i3 = 0; i3 < strSubstring.length(); i3++) {
            char cCharAt = strSubstring.charAt(i3);
            if (cCharAt != '(') {
                sb.append(cCharAt);
            } else {
                if (findAIvalue(i3, strSubstring) != null) {
                    break;
                }
                sb.append('(');
            }
        }
        return sb.toString();
    }

    /* JADX WARN: Failed to restore switch over string. Please report as a decompilation issue */
    @Override // com.google.zxing.client.result.ResultParser
    public ExpandedProductParsedResult parse(Result result) {
        if (result.getBarcodeFormat() != BarcodeFormat.RSS_EXPANDED) {
            return null;
        }
        String massagedText = ResultParser.getMassagedText(result);
        HashMap map = 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 strSubstring = null;
        String strSubstring2 = null;
        String strSubstring3 = null;
        String strSubstring4 = null;
        int length = 0;
        while (length < massagedText.length()) {
            String strFindAIvalue = findAIvalue(length, massagedText);
            if (strFindAIvalue == null) {
                return null;
            }
            int length2 = length + strFindAIvalue.length() + 2;
            String strFindValue = findValue(length2, massagedText);
            length = length2 + strFindValue.length();
            byte b2 = -1;
            switch (strFindAIvalue.hashCode()) {
                case 1536:
                    if (strFindAIvalue.equals("00")) {
                        b2 = 0;
                    }
                    break;
                case InvokeCmd.CMD_EASYTOUCH_GET_LOGINFO /* 1537 */:
                    if (strFindAIvalue.equals("01")) {
                        b2 = 1;
                    }
                    break;
                case 1567:
                    if (strFindAIvalue.equals("10")) {
                        b2 = 2;
                    }
                    break;
                case 1568:
                    if (strFindAIvalue.equals("11")) {
                        b2 = 3;
                    }
                    break;
                case 1570:
                    if (strFindAIvalue.equals("13")) {
                        b2 = 4;
                    }
                    break;
                case 1572:
                    if (strFindAIvalue.equals("15")) {
                        b2 = 5;
                    }
                    break;
                case 1574:
                    if (strFindAIvalue.equals("17")) {
                        b2 = 6;
                    }
                    break;
                case 1567966:
                    if (strFindAIvalue.equals("3100")) {
                        b2 = 7;
                    }
                    break;
                case 1567967:
                    if (strFindAIvalue.equals("3101")) {
                        b2 = 8;
                    }
                    break;
                case 1567968:
                    if (strFindAIvalue.equals("3102")) {
                        b2 = 9;
                    }
                    break;
                case 1567969:
                    if (strFindAIvalue.equals("3103")) {
                        b2 = 10;
                    }
                    break;
                case 1567970:
                    if (strFindAIvalue.equals("3104")) {
                        b2 = SDKKeyboardCode.FUNCTION_KEY_BOARD_H;
                    }
                    break;
                case 1567971:
                    if (strFindAIvalue.equals("3105")) {
                        b2 = SDKKeyboardCode.FUNCTION_KEY_BOARD_I;
                    }
                    break;
                case 1567972:
                    if (strFindAIvalue.equals("3106")) {
                        b2 = SDKKeyboardCode.FUNCTION_KEY_BOARD_J;
                    }
                    break;
                case 1567973:
                    if (strFindAIvalue.equals("3107")) {
                        b2 = SDKKeyboardCode.FUNCTION_KEY_BOARD_K;
                    }
                    break;
                case 1567974:
                    if (strFindAIvalue.equals("3108")) {
                        b2 = SDKKeyboardCode.FUNCTION_KEY_BOARD_L;
                    }
                    break;
                case 1567975:
                    if (strFindAIvalue.equals("3109")) {
                        b2 = SDKKeyboardCode.FUNCTION_KEY_BOARD_M;
                    }
                    break;
                case 1568927:
                    if (strFindAIvalue.equals("3200")) {
                        b2 = SDKKeyboardCode.FUNCTION_KEY_BOARD_N;
                    }
                    break;
                case 1568928:
                    if (strFindAIvalue.equals("3201")) {
                        b2 = SDKKeyboardCode.FUNCTION_KEY_BOARD_O;
                    }
                    break;
                case 1568929:
                    if (strFindAIvalue.equals("3202")) {
                        b2 = SDKKeyboardCode.FUNCTION_KEY_BOARD_P;
                    }
                    break;
                case 1568930:
                    if (strFindAIvalue.equals("3203")) {
                        b2 = SDKKeyboardCode.FUNCTION_KEY_BOARD_Q;
                    }
                    break;
                case 1568931:
                    if (strFindAIvalue.equals("3204")) {
                        b2 = SDKKeyboardCode.FUNCTION_KEY_BOARD_R;
                    }
                    break;
                case 1568932:
                    if (strFindAIvalue.equals("3205")) {
                        b2 = SDKKeyboardCode.FUNCTION_KEY_BOARD_S;
                    }
                    break;
                case 1568933:
                    if (strFindAIvalue.equals("3206")) {
                        b2 = SDKKeyboardCode.FUNCTION_KEY_BOARD_T;
                    }
                    break;
                case 1568934:
                    if (strFindAIvalue.equals("3207")) {
                        b2 = SDKKeyboardCode.FUNCTION_KEY_BOARD_U;
                    }
                    break;
                case 1568935:
                    if (strFindAIvalue.equals("3208")) {
                        b2 = SDKKeyboardCode.FUNCTION_KEY_BOARD_V;
                    }
                    break;
                case 1568936:
                    if (strFindAIvalue.equals("3209")) {
                        b2 = SDKKeyboardCode.FUNCTION_KEY_BOARD_W;
                    }
                    break;
                case 1575716:
                    if (strFindAIvalue.equals("3920")) {
                        b2 = SDKKeyboardCode.FUNCTION_KEY_BOARD_X;
                    }
                    break;
                case 1575717:
                    if (strFindAIvalue.equals("3921")) {
                        b2 = SDKKeyboardCode.FUNCTION_KEY_BOARD_Y;
                    }
                    break;
                case 1575718:
                    if (strFindAIvalue.equals("3922")) {
                        b2 = SDKKeyboardCode.FUNCTION_KEY_BOARD_Z;
                    }
                    break;
                case 1575719:
                    if (strFindAIvalue.equals("3923")) {
                        b2 = SDKKeyboardCode.FUNCTION_KEY_BOARD_1;
                    }
                    break;
                case 1575747:
                    if (strFindAIvalue.equals("3930")) {
                        b2 = SDKKeyboardCode.FUNCTION_KEY_BOARD_2;
                    }
                    break;
                case 1575748:
                    if (strFindAIvalue.equals("3931")) {
                        b2 = SDKKeyboardCode.FUNCTION_KEY_BOARD_3;
                    }
                    break;
                case 1575749:
                    if (strFindAIvalue.equals("3932")) {
                        b2 = SDKKeyboardCode.FUNCTION_KEY_BOARD_4;
                    }
                    break;
                case 1575750:
                    if (strFindAIvalue.equals("3933")) {
                        b2 = SDKKeyboardCode.FUNCTION_KEY_BOARD_5;
                    }
                    break;
            }
            switch (b2) {
                case 0:
                    str2 = strFindValue;
                    continue;
                case 1:
                    str = strFindValue;
                    continue;
                case 2:
                    str3 = strFindValue;
                    continue;
                case 3:
                    str4 = strFindValue;
                    continue;
                case 4:
                    str5 = strFindValue;
                    continue;
                case 5:
                    str6 = strFindValue;
                    continue;
                case 6:
                    str7 = strFindValue;
                    continue;
                case 7:
                case 8:
                case 9:
                case 10:
                case 11:
                case 12:
                case 13:
                case 14:
                case 15:
                case 16:
                    strSubstring = strFindAIvalue.substring(3);
                    str9 = ExpandedProductParsedResult.KILOGRAM;
                    break;
                case 17:
                case 18:
                case 19:
                case 20:
                case 21:
                case 22:
                case 23:
                case 24:
                case 25:
                case 26:
                    strSubstring = strFindAIvalue.substring(3);
                    str9 = ExpandedProductParsedResult.POUND;
                    break;
                case 27:
                case 28:
                case 29:
                case 30:
                    strSubstring3 = strFindAIvalue.substring(3);
                    strSubstring2 = strFindValue;
                    continue;
                case 31:
                case 32:
                case 33:
                case 34:
                    if (strFindValue.length() < 4) {
                        return null;
                    }
                    strSubstring2 = strFindValue.substring(3);
                    strSubstring4 = strFindValue.substring(0, 3);
                    strSubstring3 = strFindAIvalue.substring(3);
                    continue;
                    break;
                default:
                    map.put(strFindAIvalue, strFindValue);
                    continue;
            }
            str8 = strFindValue;
        }
        return new ExpandedProductParsedResult(massagedText, str, str2, str3, str4, str5, str6, str7, str8, str9, strSubstring, strSubstring2, strSubstring3, strSubstring4, map);
    }
}
