package com.ifpdos.udi.service.tea;

import android.util.Log;
import com.ifpdos.udi.sdk.service.sdk.UdiGlobal;
import com.ifpdos.udi.sdk.service.sdk.json.IConverter;
import com.ifpdos.udi.sdk.service.sdk.json.TypeToken;
import com.ifpdos.udi.sdk.service.sdk.server.IUdiServer;
import com.ifpdos.udi.service.core.pc.UpgradeResultNotify;
import com.ifpdos.udi.service.core.pc.UpgradeStatusNotify;
import com.tencent.api.ITEAUsbEventCb;
import com.tencent.api.TEANativeInsideApi;
import com.tencent.common.ITEAInsideDeviceConnectStateUpdateCbDelegate;
import g.f.c.b.tea.TeaDeviceInfoUpgradeResultApi;
import g.f.c.b.tea.TeaDeviceInfoUpgradeStatusApi;
import g.f.c.b.tea.tea.EmptyImplTeaDevEventCb;
import g.f.c.b.tea.util.IMicAbility;
import g.h.a.i;
import io.netty.handler.codec.rtsp.RtspHeaders;
import java.io.File;
import java.util.ArrayList;
import java.util.Base64;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import kotlin.Lazy;
import kotlin.Metadata;
import kotlin.Pair;
import kotlin.collections.j;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Lambda;
import kotlin.jvm.internal.e0;
import kotlin.jvm.internal.o;
import kotlin.text.Charsets;
import kotlinx.serialization.KSerializer;
import kotlinx.serialization.SerialName;
import kotlinx.serialization.Serializable;
import kotlinx.serialization.UnknownFieldException;
import kotlinx.serialization.descriptors.SerialDescriptor;
import kotlinx.serialization.encoding.CompositeDecoder;
import kotlinx.serialization.encoding.CompositeEncoder;
import kotlinx.serialization.encoding.Decoder;
import kotlinx.serialization.encoding.Encoder;
import kotlinx.serialization.internal.ArrayListSerializer;
import kotlinx.serialization.internal.GeneratedSerializer;
import kotlinx.serialization.internal.PluginExceptionsKt;
import kotlinx.serialization.internal.PluginGeneratedSerialDescriptor;
import kotlinx.serialization.internal.SerializationConstructorMarker;
import kotlinx.serialization.internal.StringSerializer;
import kotlinx.serialization.json.internal.AbstractJsonLexerKt;
import s.coroutines.Job;

/* JADX INFO: loaded from: classes.dex */
@Metadata(d1 = {"\u0000 \u0001\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010$\n\u0002\b\u0003\n\u0002\u0010!\n\u0002\u0018\u0002\n\u0000\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0000\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\b\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0010\u0002\n\u0002\b\t\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u001a*\u0002\r\u001a\bÆ\u0002\u0018\u00002\u00020\u0001:\u0002cdB\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u000e\u0010.\u001a\u00020/2\u0006\u00100\u001a\u00020\u000bJ\u0018\u00101\u001a\u00020/2\u0006\u00102\u001a\u00020\u00042\u0006\u00103\u001a\u00020\u0004H\u0002J\u000e\u00104\u001a\u00020\u00042\u0006\u00105\u001a\u00020\u0004J\b\u00106\u001a\u00020/H\u0002J\u000e\u00107\u001a\u00020\u00042\u0006\u00105\u001a\u00020\u0004J\b\u00108\u001a\u0004\u0018\u000109J\u000e\u0010:\u001a\u00020;2\u0006\u00102\u001a\u00020\u0004J\u000e\u0010<\u001a\u00020=2\u0006\u00102\u001a\u00020\u0004J\u000e\u0010>\u001a\u00020?2\u0006\u00102\u001a\u00020\u0004J\b\u0010@\u001a\u00020AH\u0016J\n\u0010B\u001a\u0004\u0018\u00010CH\u0016J\u0014\u0010D\u001a\b\u0012\u0004\u0012\u00020F0E2\u0006\u00102\u001a\u00020\u0004J\f\u0010G\u001a\b\u0012\u0004\u0012\u00020H0EJ\u000e\u0010I\u001a\u00020/2\u0006\u0010J\u001a\u00020KJ\u0006\u0010L\u001a\u00020\u0012J\u000e\u0010M\u001a\u00020/2\u0006\u00100\u001a\u00020\u0010J\b\u0010N\u001a\u00020/H\u0002J\u0006\u0010O\u001a\u00020/J\u0010\u0010P\u001a\u00020\u00122\u0006\u0010Q\u001a\u00020\u0004H\u0002J\u0006\u0010R\u001a\u00020/J\u0016\u0010S\u001a\u00020/2\u0006\u00102\u001a\u00020\u00042\u0006\u0010T\u001a\u00020;J\u0016\u0010U\u001a\u00020/2\u0006\u00102\u001a\u00020\u00042\u0006\u0010T\u001a\u00020=J\u0010\u0010V\u001a\u00020\u00122\u0006\u0010W\u001a\u00020AH\u0016J\u0018\u0010X\u001a\u00020\u00122\u0006\u0010Y\u001a\u00020A2\u0006\u0010Z\u001a\u00020AH\u0016J\u000e\u0010[\u001a\u00020\u00122\u0006\u0010\\\u001a\u00020\u0012J\b\u0010]\u001a\u00020/H\u0002J\u0010\u0010^\u001a\u00020/2\u0006\u00100\u001a\u00020\u0010H\u0002J\u000e\u0010_\u001a\u00020\u00122\u0006\u0010`\u001a\u00020\u0004J\u0018\u0010%\u001a\u00020/2\u0006\u0010a\u001a\u00020\u00122\u0006\u0010b\u001a\u00020\u0004H\u0002R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082T¢\u0006\u0002\n\u0000R\u001a\u0010\u0005\u001a\u000e\u0012\u0004\u0012\u00020\u0004\u0012\u0004\u0012\u00020\u00040\u0006X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0007\u001a\u00020\u0004X\u0082T¢\u0006\u0002\n\u0000R\u0010\u0010\b\u001a\u00020\u00048\u0002X\u0083T¢\u0006\u0002\n\u0000R\u0014\u0010\t\u001a\b\u0012\u0004\u0012\u00020\u000b0\nX\u0082\u0004¢\u0006\u0002\n\u0000R\u0010\u0010\f\u001a\u00020\rX\u0082\u0004¢\u0006\u0004\n\u0002\u0010\u000eR\u0014\u0010\u000f\u001a\b\u0012\u0004\u0012\u00020\u00100\nX\u0082\u0004¢\u0006\u0002\n\u0000R&\u0010\u0013\u001a\u00020\u00122\u0006\u0010\u0011\u001a\u00020\u00128F@FX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0013\u0010\u0014\"\u0004\b\u0015\u0010\u0016R\u0010\u0010\u0017\u001a\u0004\u0018\u00010\u0018X\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\u0019\u001a\u00020\u001aX\u0082\u0004¢\u0006\u0004\n\u0002\u0010\u001bR\u0010\u0010\u001c\u001a\u0004\u0018\u00010\u001dX\u0082\u000e¢\u0006\u0002\n\u0000R\u001a\u0010\u001e\u001a\u00020\u001fX\u0086.¢\u0006\u000e\n\u0000\u001a\u0004\b \u0010!\"\u0004\b\"\u0010#R\u0010\u0010$\u001a\u0004\u0018\u00010\u0004X\u0082\u000e¢\u0006\u0002\n\u0000R\u0012\u0010%\u001a\u0004\u0018\u00010\u0012X\u0082\u000e¢\u0006\u0004\n\u0002\u0010&R#\u0010'\u001a\n )*\u0004\u0018\u00010(0(8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b,\u0010-\u001a\u0004\b*\u0010+¨\u0006e"}, d2 = {"Lcom/ifpdos/udi/service/tea/TeaDeviceHelper;", "Lcom/ifpdos/udi/service/tea/util/IMicAbility;", "()V", "OTA_ID", "", "OTA_KEU_MAP", "", "TAG", "TEMP_FILE_DIR_PATH", "connectListenerList", "", "Lcom/tencent/common/ITEAInsideDeviceConnectStateUpdateCbDelegate;", "deviceStateCallback", "com/ifpdos/udi/service/tea/TeaDeviceHelper$deviceStateCallback$1", "Lcom/ifpdos/udi/service/tea/TeaDeviceHelper$deviceStateCallback$1;", "deviceStateListenerList", "Lcom/tencent/api/ITEAUsbEventCb;", "<set-?>", "", "isUpgrading", "()Z", "setUpgrading", "(Z)V", "mCurrentSelectDevice", "Lcom/ifpdos/udi/service/tea/TeaDeviceSelectInfo;", "otaListener", "com/ifpdos/udi/service/tea/TeaDeviceHelper$otaListener$1", "Lcom/ifpdos/udi/service/tea/TeaDeviceHelper$otaListener$1;", "progressJob", "Lkotlinx/coroutines/Job;", "teaNativeInsideApi", "Lcom/tencent/api/TEANativeInsideApi;", "getTeaNativeInsideApi", "()Lcom/tencent/api/TEANativeInsideApi;", "setTeaNativeInsideApi", "(Lcom/tencent/api/TEANativeInsideApi;)V", "upgradeFilePath", "upgradeResult", "Ljava/lang/Boolean;", "upgradeThread", "Ljava/util/concurrent/ExecutorService;", "kotlin.jvm.PlatformType", "getUpgradeThread", "()Ljava/util/concurrent/ExecutorService;", "upgradeThread$delegate", "Lkotlin/Lazy;", "addConnectListener", "", "listener", "changeTeaSDKDeviceSelect", "id", "value", "decodeDeviceId", "deviceId", "deleteTempFile", "encodeDeviceId", "getDeviceInfo", "Lcom/ifpdos/udi/service/core/pc/FirmwareInfoList;", "getLineOutSinkRouteMode", "Lcom/ifpdos/udi/service/tea/LineOutSinkRouteModeEnum;", "getPoeSinkRouteMode", "Lcom/ifpdos/udi/service/tea/PoeSinkRouteModeEnum;", "getPortInformation", "Lcom/ifpdos/udi/service/tea/PortAttachInfo;", "getSmartNoiseCancellation", "", "getSmartSourceAngle", "Lcom/ifpdos/udi/service/tea/SmartSourceAngleBody;", "getTeaDevicesInformation", "", "Lcom/ifpdos/udi/service/tea/TeaDeviceInfo;", "getTeaHidDeviceList", "Lcom/ifpdos/udi/service/tea/TeaDevice;", "init", "context", "Landroid/content/Context;", "isTeaPoeBM51", "registerDeviceStateListener", "releaseJob", "selectBM51Device", "selectTeaDevice", "encodeId", "selectTeaMicDevice", "setLineOutSinkRouteMode", RtspHeaders.Values.MODE, "setPoeSinkRouteMode", "setSmartNoiseCancellation", "noise", "setSmartSourceAngle", "start", "end", "setTeaDeviceMicMute", "mute", "startFakeProcess", "unRegisterDeviceStateListener", "upgradeDevice", "filePath", "error", "msg", "AllDeviceInformation", "TeaDeviceInfoSDK", "tea_release"}, k = 1, mv = {1, 6, 0}, xi = 48)
public final class TeaDeviceHelper implements IMicAbility {

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public static TeaDeviceSelectInfo f1368b;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public static String f1371e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public static Boolean f1372f;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public static Job f1375i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public static TEANativeInsideApi f1376j;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public static boolean f1377k;
    public static final TeaDeviceHelper a = new TeaDeviceHelper();

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public static final Map<String, String> f1369c = j.J(new Pair("rk3308", "91e0d92f0b236c3f0c5670cfdd163e17e3aa7c1b"), new Pair("rk3562", "1360013043b8b3c8d6866c368e1ac7589c0d5ee3"));

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public static final Lazy f1370d = i.D2(d.f1382f);

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public static final c f1373g = new c();

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public static final List<ITEAInsideDeviceConnectStateUpdateCbDelegate> f1374h = new ArrayList();

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    public static final List<ITEAUsbEventCb> f1378l = new ArrayList();

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public static final a f1379m = new a();

    @Metadata(d1 = {"\u0000F\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\t\n\u0002\u0010\u000b\n\u0002\b\u0003\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\b\u0087\b\u0018\u0000 \u001f2\u00020\u0001:\u0002\u001e\u001fB+\b\u0017\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0010\b\u0001\u0010\u0004\u001a\n\u0012\u0004\u0012\u00020\u0006\u0018\u00010\u0005\u0012\b\u0010\u0007\u001a\u0004\u0018\u00010\b¢\u0006\u0002\u0010\tB\u0013\u0012\f\u0010\u0004\u001a\b\u0012\u0004\u0012\u00020\u00060\u0005¢\u0006\u0002\u0010\nJ\u000f\u0010\u000f\u001a\b\u0012\u0004\u0012\u00020\u00060\u0005HÆ\u0003J\u0019\u0010\u0010\u001a\u00020\u00002\u000e\b\u0002\u0010\u0004\u001a\b\u0012\u0004\u0012\u00020\u00060\u0005HÆ\u0001J\u0013\u0010\u0011\u001a\u00020\u00122\b\u0010\u0013\u001a\u0004\u0018\u00010\u0001HÖ\u0003J\t\u0010\u0014\u001a\u00020\u0003HÖ\u0001J\t\u0010\u0015\u001a\u00020\u0016HÖ\u0001J!\u0010\u0017\u001a\u00020\u00182\u0006\u0010\u0019\u001a\u00020\u00002\u0006\u0010\u001a\u001a\u00020\u001b2\u0006\u0010\u001c\u001a\u00020\u001dHÇ\u0001R\"\u0010\u0004\u001a\b\u0012\u0004\u0012\u00020\u00060\u00058\u0006X\u0087\u0004¢\u0006\u000e\n\u0000\u0012\u0004\b\u000b\u0010\f\u001a\u0004\b\r\u0010\u000e¨\u0006 "}, d2 = {"Lcom/ifpdos/udi/service/tea/TeaDeviceHelper$AllDeviceInformation;", "", "seen1", "", "devices", "", "Lcom/ifpdos/udi/service/tea/TeaDeviceHelper$TeaDeviceInfoSDK;", "serializationConstructorMarker", "Lkotlinx/serialization/internal/SerializationConstructorMarker;", "(ILjava/util/List;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V", "(Ljava/util/List;)V", "getDevices$annotations", "()V", "getDevices", "()Ljava/util/List;", "component1", "copy", "equals", "", "other", "hashCode", "toString", "", "write$Self", "", "self", "output", "Lkotlinx/serialization/encoding/CompositeEncoder;", "serialDesc", "Lkotlinx/serialization/descriptors/SerialDescriptor;", "$serializer", "Companion", "tea_release"}, k = 1, mv = {1, 6, 0}, xi = 48)
    @Serializable
    public static final /* data */ class AllDeviceInformation {

        /* JADX INFO: renamed from: Companion, reason: from kotlin metadata */
        public static final Companion INSTANCE = new Companion(null);
        private final List<TeaDeviceInfoSDK> devices;

        @Metadata(d1 = {"\u00006\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u0011\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\bÇ\u0002\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0003J\u0018\u0010\b\u001a\f\u0012\b\u0012\u0006\u0012\u0002\b\u00030\n0\tHÖ\u0001¢\u0006\u0002\u0010\u000bJ\u0011\u0010\f\u001a\u00020\u00022\u0006\u0010\r\u001a\u00020\u000eHÖ\u0001J\u0019\u0010\u000f\u001a\u00020\u00102\u0006\u0010\u0011\u001a\u00020\u00122\u0006\u0010\u0013\u001a\u00020\u0002HÖ\u0001R\u0014\u0010\u0004\u001a\u00020\u00058VXÖ\u0005¢\u0006\u0006\u001a\u0004\b\u0006\u0010\u0007¨\u0006\u0014"}, d2 = {"com/ifpdos/udi/service/tea/TeaDeviceHelper.AllDeviceInformation.$serializer", "Lkotlinx/serialization/internal/GeneratedSerializer;", "Lcom/ifpdos/udi/service/tea/TeaDeviceHelper$AllDeviceInformation;", "()V", "descriptor", "Lkotlinx/serialization/descriptors/SerialDescriptor;", "getDescriptor", "()Lkotlinx/serialization/descriptors/SerialDescriptor;", "childSerializers", "", "Lkotlinx/serialization/KSerializer;", "()[Lkotlinx/serialization/KSerializer;", "deserialize", "decoder", "Lkotlinx/serialization/encoding/Decoder;", "serialize", "", "encoder", "Lkotlinx/serialization/encoding/Encoder;", "value", "tea_release"}, k = 1, mv = {1, 6, 0}, xi = 48)
        public static final class a implements GeneratedSerializer<AllDeviceInformation> {
            public static final a a;

            /* JADX INFO: renamed from: b, reason: collision with root package name */
            public static final /* synthetic */ SerialDescriptor f1380b;

            static {
                a aVar = new a();
                a = aVar;
                PluginGeneratedSerialDescriptor pluginGeneratedSerialDescriptor = new PluginGeneratedSerialDescriptor("com.ifpdos.udi.service.tea.TeaDeviceHelper.AllDeviceInformation", aVar, 1);
                pluginGeneratedSerialDescriptor.addElement("all_device_info", false);
                f1380b = pluginGeneratedSerialDescriptor;
            }

            @Override // kotlinx.serialization.internal.GeneratedSerializer
            public KSerializer<?>[] childSerializers() {
                return new KSerializer[]{new ArrayListSerializer(TeaDeviceInfoSDK.a.a)};
            }

            @Override // kotlinx.serialization.DeserializationStrategy
            public Object deserialize(Decoder decoder) {
                Object objDecodeSerializableElement;
                o.f(decoder, "decoder");
                SerialDescriptor serialDescriptor = f1380b;
                CompositeDecoder compositeDecoderBeginStructure = decoder.beginStructure(serialDescriptor);
                int i2 = 1;
                if (compositeDecoderBeginStructure.decodeSequentially()) {
                    objDecodeSerializableElement = compositeDecoderBeginStructure.decodeSerializableElement(serialDescriptor, 0, new ArrayListSerializer(TeaDeviceInfoSDK.a.a), null);
                } else {
                    objDecodeSerializableElement = null;
                    int i3 = 0;
                    while (i2 != 0) {
                        int iDecodeElementIndex = compositeDecoderBeginStructure.decodeElementIndex(serialDescriptor);
                        if (iDecodeElementIndex == -1) {
                            i2 = 0;
                        } else {
                            if (iDecodeElementIndex != 0) {
                                throw new UnknownFieldException(iDecodeElementIndex);
                            }
                            objDecodeSerializableElement = compositeDecoderBeginStructure.decodeSerializableElement(serialDescriptor, 0, new ArrayListSerializer(TeaDeviceInfoSDK.a.a), objDecodeSerializableElement);
                            i3 |= 1;
                        }
                    }
                    i2 = i3;
                }
                compositeDecoderBeginStructure.endStructure(serialDescriptor);
                return new AllDeviceInformation(i2, (List) objDecodeSerializableElement, null);
            }

            @Override // kotlinx.serialization.KSerializer, kotlinx.serialization.SerializationStrategy, kotlinx.serialization.DeserializationStrategy
            public SerialDescriptor getDescriptor() {
                return f1380b;
            }

            @Override // kotlinx.serialization.SerializationStrategy
            public void serialize(Encoder encoder, Object obj) {
                AllDeviceInformation allDeviceInformation = (AllDeviceInformation) obj;
                o.f(encoder, "encoder");
                o.f(allDeviceInformation, "value");
                SerialDescriptor serialDescriptor = f1380b;
                CompositeEncoder compositeEncoderBeginStructure = encoder.beginStructure(serialDescriptor);
                AllDeviceInformation.write$Self(allDeviceInformation, compositeEncoderBeginStructure, serialDescriptor);
                compositeEncoderBeginStructure.endStructure(serialDescriptor);
            }

            @Override // kotlinx.serialization.internal.GeneratedSerializer
            public KSerializer<?>[] typeParametersSerializers() {
                return GeneratedSerializer.DefaultImpls.typeParametersSerializers(this);
            }
        }

        /* JADX INFO: renamed from: com.ifpdos.udi.service.tea.TeaDeviceHelper$AllDeviceInformation$b, reason: from kotlin metadata */
        @Metadata(d1 = {"\u0000\u0016\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u000f\u0010\u0003\u001a\b\u0012\u0004\u0012\u00020\u00050\u0004HÆ\u0001¨\u0006\u0006"}, d2 = {"Lcom/ifpdos/udi/service/tea/TeaDeviceHelper$AllDeviceInformation$Companion;", "", "()V", "serializer", "Lkotlinx/serialization/KSerializer;", "Lcom/ifpdos/udi/service/tea/TeaDeviceHelper$AllDeviceInformation;", "tea_release"}, k = 1, mv = {1, 6, 0}, xi = 48)
        public static final class Companion {
            public Companion() {
            }

            public Companion(DefaultConstructorMarker defaultConstructorMarker) {
            }

            public final KSerializer<AllDeviceInformation> serializer() {
                return a.a;
            }
        }

        public AllDeviceInformation(int i2, @SerialName("all_device_info") List list, SerializationConstructorMarker serializationConstructorMarker) {
            if (1 != (i2 & 1)) {
                a aVar = a.a;
                PluginExceptionsKt.throwMissingFieldException(i2, 1, a.f1380b);
            }
            this.devices = list;
        }

        public AllDeviceInformation(List<TeaDeviceInfoSDK> list) {
            o.f(list, "devices");
            this.devices = list;
        }

        /* JADX WARN: Multi-variable type inference failed */
        public static /* synthetic */ AllDeviceInformation copy$default(AllDeviceInformation allDeviceInformation, List list, int i2, Object obj) {
            if ((i2 & 1) != 0) {
                list = allDeviceInformation.devices;
            }
            return allDeviceInformation.copy(list);
        }

        @SerialName("all_device_info")
        public static /* synthetic */ void getDevices$annotations() {
        }

        public static final void write$Self(AllDeviceInformation self, CompositeEncoder output, SerialDescriptor serialDesc) {
            o.f(self, "self");
            o.f(output, "output");
            o.f(serialDesc, "serialDesc");
            output.encodeSerializableElement(serialDesc, 0, new ArrayListSerializer(TeaDeviceInfoSDK.a.a), self.devices);
        }

        public final List<TeaDeviceInfoSDK> component1() {
            return this.devices;
        }

        public final AllDeviceInformation copy(List<TeaDeviceInfoSDK> devices) {
            o.f(devices, "devices");
            return new AllDeviceInformation(devices);
        }

        public boolean equals(Object other) {
            if (this == other) {
                return true;
            }
            return (other instanceof AllDeviceInformation) && o.a(this.devices, ((AllDeviceInformation) other).devices);
        }

        public final List<TeaDeviceInfoSDK> getDevices() {
            return this.devices;
        }

        public int hashCode() {
            return this.devices.hashCode();
        }

        public String toString() {
            return g.a.a.a.a.B(g.a.a.a.a.F("AllDeviceInformation(devices="), this.devices, ')');
        }
    }

    @Metadata(d1 = {"\u0000>\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u000f\n\u0002\u0010\u000b\n\u0002\b\u0004\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\b\u0087\b\u0018\u0000 %2\u00020\u0001:\u0002$%B=\b\u0017\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\n\b\u0001\u0010\u0004\u001a\u0004\u0018\u00010\u0005\u0012\n\b\u0001\u0010\u0006\u001a\u0004\u0018\u00010\u0005\u0012\n\b\u0001\u0010\u0007\u001a\u0004\u0018\u00010\u0005\u0012\b\u0010\b\u001a\u0004\u0018\u00010\t¢\u0006\u0002\u0010\nB\u001d\u0012\u0006\u0010\u0004\u001a\u00020\u0005\u0012\u0006\u0010\u0006\u001a\u00020\u0005\u0012\u0006\u0010\u0007\u001a\u00020\u0005¢\u0006\u0002\u0010\u000bJ\t\u0010\u0014\u001a\u00020\u0005HÆ\u0003J\t\u0010\u0015\u001a\u00020\u0005HÆ\u0003J\t\u0010\u0016\u001a\u00020\u0005HÆ\u0003J'\u0010\u0017\u001a\u00020\u00002\b\b\u0002\u0010\u0004\u001a\u00020\u00052\b\b\u0002\u0010\u0006\u001a\u00020\u00052\b\b\u0002\u0010\u0007\u001a\u00020\u0005HÆ\u0001J\u0013\u0010\u0018\u001a\u00020\u00192\b\u0010\u001a\u001a\u0004\u0018\u00010\u0001HÖ\u0003J\t\u0010\u001b\u001a\u00020\u0003HÖ\u0001J\t\u0010\u001c\u001a\u00020\u0005HÖ\u0001J!\u0010\u001d\u001a\u00020\u001e2\u0006\u0010\u001f\u001a\u00020\u00002\u0006\u0010 \u001a\u00020!2\u0006\u0010\"\u001a\u00020#HÇ\u0001R\u001c\u0010\u0004\u001a\u00020\u00058\u0006X\u0087\u0004¢\u0006\u000e\n\u0000\u0012\u0004\b\f\u0010\r\u001a\u0004\b\u000e\u0010\u000fR\u001c\u0010\u0006\u001a\u00020\u00058\u0006X\u0087\u0004¢\u0006\u000e\n\u0000\u0012\u0004\b\u0010\u0010\r\u001a\u0004\b\u0011\u0010\u000fR\u001c\u0010\u0007\u001a\u00020\u00058\u0006X\u0087\u0004¢\u0006\u000e\n\u0000\u0012\u0004\b\u0012\u0010\r\u001a\u0004\b\u0013\u0010\u000f¨\u0006&"}, d2 = {"Lcom/ifpdos/udi/service/tea/TeaDeviceHelper$TeaDeviceInfoSDK;", "", "seen1", "", "productName", "", "roomixVersion", "sn", "serializationConstructorMarker", "Lkotlinx/serialization/internal/SerializationConstructorMarker;", "(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", "getProductName$annotations", "()V", "getProductName", "()Ljava/lang/String;", "getRoomixVersion$annotations", "getRoomixVersion", "getSn$annotations", "getSn", "component1", "component2", "component3", "copy", "equals", "", "other", "hashCode", "toString", "write$Self", "", "self", "output", "Lkotlinx/serialization/encoding/CompositeEncoder;", "serialDesc", "Lkotlinx/serialization/descriptors/SerialDescriptor;", "$serializer", "Companion", "tea_release"}, k = 1, mv = {1, 6, 0}, xi = 48)
    @Serializable
    public static final /* data */ class TeaDeviceInfoSDK {

        /* JADX INFO: renamed from: Companion, reason: from kotlin metadata */
        public static final Companion INSTANCE = new Companion(null);
        private final String productName;
        private final String roomixVersion;
        private final String sn;

        @Metadata(d1 = {"\u00006\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u0011\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\bÇ\u0002\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0003J\u0018\u0010\b\u001a\f\u0012\b\u0012\u0006\u0012\u0002\b\u00030\n0\tHÖ\u0001¢\u0006\u0002\u0010\u000bJ\u0011\u0010\f\u001a\u00020\u00022\u0006\u0010\r\u001a\u00020\u000eHÖ\u0001J\u0019\u0010\u000f\u001a\u00020\u00102\u0006\u0010\u0011\u001a\u00020\u00122\u0006\u0010\u0013\u001a\u00020\u0002HÖ\u0001R\u0014\u0010\u0004\u001a\u00020\u00058VXÖ\u0005¢\u0006\u0006\u001a\u0004\b\u0006\u0010\u0007¨\u0006\u0014"}, d2 = {"com/ifpdos/udi/service/tea/TeaDeviceHelper.TeaDeviceInfoSDK.$serializer", "Lkotlinx/serialization/internal/GeneratedSerializer;", "Lcom/ifpdos/udi/service/tea/TeaDeviceHelper$TeaDeviceInfoSDK;", "()V", "descriptor", "Lkotlinx/serialization/descriptors/SerialDescriptor;", "getDescriptor", "()Lkotlinx/serialization/descriptors/SerialDescriptor;", "childSerializers", "", "Lkotlinx/serialization/KSerializer;", "()[Lkotlinx/serialization/KSerializer;", "deserialize", "decoder", "Lkotlinx/serialization/encoding/Decoder;", "serialize", "", "encoder", "Lkotlinx/serialization/encoding/Encoder;", "value", "tea_release"}, k = 1, mv = {1, 6, 0}, xi = 48)
        public static final class a implements GeneratedSerializer<TeaDeviceInfoSDK> {
            public static final a a;

            /* JADX INFO: renamed from: b, reason: collision with root package name */
            public static final /* synthetic */ SerialDescriptor f1381b;

            static {
                a aVar = new a();
                a = aVar;
                PluginGeneratedSerialDescriptor pluginGeneratedSerialDescriptor = new PluginGeneratedSerialDescriptor("com.ifpdos.udi.service.tea.TeaDeviceHelper.TeaDeviceInfoSDK", aVar, 3);
                pluginGeneratedSerialDescriptor.addElement("product_name", false);
                pluginGeneratedSerialDescriptor.addElement("roomix_version", false);
                pluginGeneratedSerialDescriptor.addElement("sn", false);
                f1381b = pluginGeneratedSerialDescriptor;
            }

            @Override // kotlinx.serialization.internal.GeneratedSerializer
            public KSerializer<?>[] childSerializers() {
                StringSerializer stringSerializer = StringSerializer.INSTANCE;
                return new KSerializer[]{stringSerializer, stringSerializer, stringSerializer};
            }

            @Override // kotlinx.serialization.DeserializationStrategy
            public Object deserialize(Decoder decoder) {
                String strDecodeStringElement;
                String strDecodeStringElement2;
                String strDecodeStringElement3;
                int i2;
                o.f(decoder, "decoder");
                SerialDescriptor serialDescriptor = f1381b;
                CompositeDecoder compositeDecoderBeginStructure = decoder.beginStructure(serialDescriptor);
                if (compositeDecoderBeginStructure.decodeSequentially()) {
                    strDecodeStringElement = compositeDecoderBeginStructure.decodeStringElement(serialDescriptor, 0);
                    strDecodeStringElement2 = compositeDecoderBeginStructure.decodeStringElement(serialDescriptor, 1);
                    strDecodeStringElement3 = compositeDecoderBeginStructure.decodeStringElement(serialDescriptor, 2);
                    i2 = 7;
                } else {
                    String strDecodeStringElement4 = null;
                    String strDecodeStringElement5 = null;
                    String strDecodeStringElement6 = null;
                    int i3 = 0;
                    boolean z2 = true;
                    while (z2) {
                        int iDecodeElementIndex = compositeDecoderBeginStructure.decodeElementIndex(serialDescriptor);
                        if (iDecodeElementIndex == -1) {
                            z2 = false;
                        } else if (iDecodeElementIndex == 0) {
                            strDecodeStringElement4 = compositeDecoderBeginStructure.decodeStringElement(serialDescriptor, 0);
                            i3 |= 1;
                        } else if (iDecodeElementIndex == 1) {
                            strDecodeStringElement5 = compositeDecoderBeginStructure.decodeStringElement(serialDescriptor, 1);
                            i3 |= 2;
                        } else {
                            if (iDecodeElementIndex != 2) {
                                throw new UnknownFieldException(iDecodeElementIndex);
                            }
                            strDecodeStringElement6 = compositeDecoderBeginStructure.decodeStringElement(serialDescriptor, 2);
                            i3 |= 4;
                        }
                    }
                    strDecodeStringElement = strDecodeStringElement4;
                    strDecodeStringElement2 = strDecodeStringElement5;
                    strDecodeStringElement3 = strDecodeStringElement6;
                    i2 = i3;
                }
                compositeDecoderBeginStructure.endStructure(serialDescriptor);
                return new TeaDeviceInfoSDK(i2, strDecodeStringElement, strDecodeStringElement2, strDecodeStringElement3, null);
            }

            @Override // kotlinx.serialization.KSerializer, kotlinx.serialization.SerializationStrategy, kotlinx.serialization.DeserializationStrategy
            public SerialDescriptor getDescriptor() {
                return f1381b;
            }

            @Override // kotlinx.serialization.SerializationStrategy
            public void serialize(Encoder encoder, Object obj) {
                TeaDeviceInfoSDK teaDeviceInfoSDK = (TeaDeviceInfoSDK) obj;
                o.f(encoder, "encoder");
                o.f(teaDeviceInfoSDK, "value");
                SerialDescriptor serialDescriptor = f1381b;
                CompositeEncoder compositeEncoderBeginStructure = encoder.beginStructure(serialDescriptor);
                TeaDeviceInfoSDK.write$Self(teaDeviceInfoSDK, compositeEncoderBeginStructure, serialDescriptor);
                compositeEncoderBeginStructure.endStructure(serialDescriptor);
            }

            @Override // kotlinx.serialization.internal.GeneratedSerializer
            public KSerializer<?>[] typeParametersSerializers() {
                return GeneratedSerializer.DefaultImpls.typeParametersSerializers(this);
            }
        }

        /* JADX INFO: renamed from: com.ifpdos.udi.service.tea.TeaDeviceHelper$TeaDeviceInfoSDK$b, reason: from kotlin metadata */
        @Metadata(d1 = {"\u0000\u0016\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u000f\u0010\u0003\u001a\b\u0012\u0004\u0012\u00020\u00050\u0004HÆ\u0001¨\u0006\u0006"}, d2 = {"Lcom/ifpdos/udi/service/tea/TeaDeviceHelper$TeaDeviceInfoSDK$Companion;", "", "()V", "serializer", "Lkotlinx/serialization/KSerializer;", "Lcom/ifpdos/udi/service/tea/TeaDeviceHelper$TeaDeviceInfoSDK;", "tea_release"}, k = 1, mv = {1, 6, 0}, xi = 48)
        public static final class Companion {
            public Companion() {
            }

            public Companion(DefaultConstructorMarker defaultConstructorMarker) {
            }

            public final KSerializer<TeaDeviceInfoSDK> serializer() {
                return a.a;
            }
        }

        public TeaDeviceInfoSDK(int i2, @SerialName("product_name") String str, @SerialName("roomix_version") String str2, @SerialName("sn") String str3, SerializationConstructorMarker serializationConstructorMarker) {
            if (7 != (i2 & 7)) {
                a aVar = a.a;
                PluginExceptionsKt.throwMissingFieldException(i2, 7, a.f1381b);
            }
            this.productName = str;
            this.roomixVersion = str2;
            this.sn = str3;
        }

        public TeaDeviceInfoSDK(String str, String str2, String str3) {
            o.f(str, "productName");
            o.f(str2, "roomixVersion");
            o.f(str3, "sn");
            this.productName = str;
            this.roomixVersion = str2;
            this.sn = str3;
        }

        public static /* synthetic */ TeaDeviceInfoSDK copy$default(TeaDeviceInfoSDK teaDeviceInfoSDK, String str, String str2, String str3, int i2, Object obj) {
            if ((i2 & 1) != 0) {
                str = teaDeviceInfoSDK.productName;
            }
            if ((i2 & 2) != 0) {
                str2 = teaDeviceInfoSDK.roomixVersion;
            }
            if ((i2 & 4) != 0) {
                str3 = teaDeviceInfoSDK.sn;
            }
            return teaDeviceInfoSDK.copy(str, str2, str3);
        }

        @SerialName("product_name")
        public static /* synthetic */ void getProductName$annotations() {
        }

        @SerialName("roomix_version")
        public static /* synthetic */ void getRoomixVersion$annotations() {
        }

        @SerialName("sn")
        public static /* synthetic */ void getSn$annotations() {
        }

        public static final void write$Self(TeaDeviceInfoSDK self, CompositeEncoder output, SerialDescriptor serialDesc) {
            o.f(self, "self");
            o.f(output, "output");
            o.f(serialDesc, "serialDesc");
            output.encodeStringElement(serialDesc, 0, self.productName);
            output.encodeStringElement(serialDesc, 1, self.roomixVersion);
            output.encodeStringElement(serialDesc, 2, self.sn);
        }

        /* JADX INFO: renamed from: component1, reason: from getter */
        public final String getProductName() {
            return this.productName;
        }

        /* JADX INFO: renamed from: component2, reason: from getter */
        public final String getRoomixVersion() {
            return this.roomixVersion;
        }

        /* JADX INFO: renamed from: component3, reason: from getter */
        public final String getSn() {
            return this.sn;
        }

        public final TeaDeviceInfoSDK copy(String productName, String roomixVersion, String sn) {
            o.f(productName, "productName");
            o.f(roomixVersion, "roomixVersion");
            o.f(sn, "sn");
            return new TeaDeviceInfoSDK(productName, roomixVersion, sn);
        }

        public boolean equals(Object other) {
            if (this == other) {
                return true;
            }
            if (!(other instanceof TeaDeviceInfoSDK)) {
                return false;
            }
            TeaDeviceInfoSDK teaDeviceInfoSDK = (TeaDeviceInfoSDK) other;
            return o.a(this.productName, teaDeviceInfoSDK.productName) && o.a(this.roomixVersion, teaDeviceInfoSDK.roomixVersion) && o.a(this.sn, teaDeviceInfoSDK.sn);
        }

        public final String getProductName() {
            return this.productName;
        }

        public final String getRoomixVersion() {
            return this.roomixVersion;
        }

        public final String getSn() {
            return this.sn;
        }

        public int hashCode() {
            return this.sn.hashCode() + g.a.a.a.a.H(this.roomixVersion, this.productName.hashCode() * 31, 31);
        }

        public String toString() {
            StringBuilder sbF = g.a.a.a.a.F("TeaDeviceInfoSDK(productName=");
            sbF.append(this.productName);
            sbF.append(", roomixVersion=");
            sbF.append(this.roomixVersion);
            sbF.append(", sn=");
            return g.a.a.a.a.z(sbF, this.sn, ')');
        }
    }

    @Metadata(d1 = {"\u0000'\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\b\n\u0002\b\u0005\n\u0002\u0010\u000b\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\"\u0010\u0002\u001a\u00020\u00032\b\u0010\u0004\u001a\u0004\u0018\u00010\u00052\u0006\u0010\u0006\u001a\u00020\u00072\u0006\u0010\b\u001a\u00020\u0007H\u0016J\"\u0010\t\u001a\u00020\u00032\b\u0010\n\u001a\u0004\u0018\u00010\u00052\u0006\u0010\u0006\u001a\u00020\u00072\u0006\u0010\b\u001a\u00020\u0007H\u0016J\u0010\u0010\u000b\u001a\u00020\u00032\u0006\u0010\n\u001a\u00020\u0005H\u0016J*\u0010\f\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\r2\b\u0010\u0006\u001a\u0004\u0018\u00010\u00052\u0006\u0010\b\u001a\u00020\u00072\u0006\u0010\u000e\u001a\u00020\u0007H\u0016¨\u0006\u000f"}, d2 = {"com/ifpdos/udi/service/tea/TeaDeviceHelper$deviceStateCallback$1", "Lcom/tencent/api/ITEAUsbEventCb;", "onUsbAttach", "", "p0", "", "p1", "", "p2", "onUsbDetech", "id", "onUsbDeviceSelect", "onUsbOpenSuccess", "", "p3", "tea_release"}, k = 1, mv = {1, 6, 0}, xi = 48)
    public static final class a implements ITEAUsbEventCb {
        @Override // com.tencent.api.ITEAUsbEventCb
        public void onUsbAttach(String p0, int p1, int p2) {
            Log.d("TeaDeviceHelper", "onUsbAttach");
            Iterator<T> it = TeaDeviceHelper.f1378l.iterator();
            while (it.hasNext()) {
                ((ITEAUsbEventCb) it.next()).onUsbAttach(p0, p1, p2);
            }
        }

        @Override // com.tencent.api.ITEAUsbEventCb
        public void onUsbDetech(String id, int p1, int p2) {
            g.a.a.a.a.g0("onUsbDetech ", id, "TeaDeviceHelper");
            TeaDeviceHelper teaDeviceHelper = TeaDeviceHelper.a;
            TeaDeviceHelper.f1368b = null;
            Iterator<T> it = TeaDeviceHelper.f1378l.iterator();
            while (it.hasNext()) {
                ((ITEAUsbEventCb) it.next()).onUsbDetech(id, p1, p2);
            }
        }

        @Override // com.tencent.api.ITEAUsbEventCb
        public void onUsbDeviceSelect(String id) {
            o.f(id, "id");
            Log.d("TeaDeviceHelper", "onUsbDeviceSelect:" + id);
            Iterator<T> it = TeaDeviceHelper.f1378l.iterator();
            while (it.hasNext()) {
                ((ITEAUsbEventCb) it.next()).onUsbDeviceSelect(id);
            }
        }

        @Override // com.tencent.api.ITEAUsbEventCb
        public void onUsbOpenSuccess(boolean p0, String p1, int p2, int p3) {
            Log.d("TeaDeviceHelper", "onUsbOpenSuccess " + p0 + ", " + p1 + ", " + p2 + ", " + p3);
            Iterator<T> it = TeaDeviceHelper.f1378l.iterator();
            while (it.hasNext()) {
                ((ITEAUsbEventCb) it.next()).onUsbOpenSuccess(p0, p1, p2, p3);
            }
        }
    }

    @Metadata(d1 = {"\u0000\u000f\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000*\u0001\u0000\b\n\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001¨\u0006\u0003"}, d2 = {"com/ifpdos/udi/service/tea/TeaDeviceHelper$isTeaPoeBM51$token$1", "Lcom/ifpdos/udi/sdk/service/sdk/json/TypeToken;", "Lcom/ifpdos/udi/service/tea/TeaDeviceHelper$AllDeviceInformation;", "tea_release"}, k = 1, mv = {1, 6, 0}, xi = 48)
    public static final class b extends TypeToken<AllDeviceInformation> {
    }

    @Metadata(d1 = {"\u0000-\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0003\n\u0002\u0010\u000e\n\u0002\b\b\n\u0002\u0010\u000b\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\u00020\u00012\u00020\u0002J\u0010\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0016J\u0010\u0010\u0007\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0016J \u0010\b\u001a\u00020\u00042\u0006\u0010\t\u001a\u00020\n2\u0006\u0010\u000b\u001a\u00020\u00062\u0006\u0010\f\u001a\u00020\u0006H\u0016J\"\u0010\r\u001a\u00020\u00042\b\u0010\u0005\u001a\u0004\u0018\u00010\n2\u0006\u0010\u000e\u001a\u00020\u00062\u0006\u0010\u000f\u001a\u00020\u0006H\u0016J\u0010\u0010\u0010\u001a\u00020\u00042\u0006\u0010\u0011\u001a\u00020\nH\u0016J*\u0010\u0012\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u00132\b\u0010\u000e\u001a\u0004\u0018\u00010\n2\u0006\u0010\u000f\u001a\u00020\u00062\u0006\u0010\u0014\u001a\u00020\u0006H\u0016¨\u0006\u0015"}, d2 = {"com/ifpdos/udi/service/tea/TeaDeviceHelper$otaListener$1", "Lcom/ifpdos/udi/service/tea/tea/EmptyImplTeaDevEventCb;", "Lcom/tencent/api/ITEAUsbEventCb;", "onOTAResultUpdate", "", "p0", "", "onOTAStateChange", "onUsbAttach", "deviceId", "", "vid", "pid", "onUsbDetech", "p1", "p2", "onUsbDeviceSelect", "id", "onUsbOpenSuccess", "", "p3", "tea_release"}, k = 1, mv = {1, 6, 0}, xi = 48)
    public static final class c extends EmptyImplTeaDevEventCb implements ITEAUsbEventCb {
        @Override // g.f.c.b.tea.tea.EmptyImplTeaDevEventCb, com.tencent.api.ITEANativeInsideTeaDevEventCb
        public void onOTAResultUpdate(int p0) {
            g.a.a.a.a.c0("onOTAResultUpdate ", p0, "TeaDeviceHelper");
            TeaDeviceHelper teaDeviceHelper = TeaDeviceHelper.a;
            TeaDeviceHelper.f1372f = Boolean.valueOf(p0 == 0);
            Job job = TeaDeviceHelper.f1375i;
            if (job != null) {
                kotlin.reflect.w.internal.y0.n.c2.c.o(job, null, 1, null);
            }
            TeaDeviceHelper.f1375i = null;
            if (o.a(TeaDeviceHelper.f1372f, Boolean.TRUE)) {
                TeaDeviceInfoUpgradeStatusApi teaDeviceInfoUpgradeStatusApi = TeaDeviceInfoUpgradeStatusApi.a;
                TeaDeviceInfoUpgradeStatusApi.a("tea_id", new UpgradeStatusNotify(0.9f));
                return;
            }
            teaDeviceHelper.n(true, "upgrade failed");
            synchronized (teaDeviceHelper) {
                TeaDeviceHelper.f1377k = false;
            }
            teaDeviceHelper.e();
            TeaDeviceHelper.f1378l.remove(this);
        }

        @Override // g.f.c.b.tea.tea.EmptyImplTeaDevEventCb, com.tencent.api.ITEANativeInsideTeaDevEventCb
        public void onOTAStateChange(int p0) {
            g.a.a.a.a.c0("onOTAStateChange ", p0, "TeaDeviceHelper");
        }

        @Override // com.tencent.api.ITEAUsbEventCb
        public void onUsbAttach(String deviceId, int vid, int pid) {
            boolean z2;
            o.f(deviceId, "deviceId");
            StringBuilder sb = new StringBuilder();
            sb.append("onUsbAttach,deviceId:");
            sb.append(deviceId);
            sb.append(",vid:");
            sb.append(vid);
            sb.append(",pid:");
            g.a.a.a.a.p0(sb, pid, "TeaDeviceHelper");
            if (vid == 8183 || pid == 1105) {
                return;
            }
            TeaDeviceHelper teaDeviceHelper = TeaDeviceHelper.a;
            synchronized (teaDeviceHelper) {
                z2 = TeaDeviceHelper.f1377k;
            }
            if (z2) {
                synchronized (teaDeviceHelper) {
                    TeaDeviceHelper.f1377k = false;
                }
                teaDeviceHelper.n(false, "upgrade success");
                Job job = TeaDeviceHelper.f1375i;
                if (job != null) {
                    kotlin.reflect.w.internal.y0.n.c2.c.o(job, null, 1, null);
                }
                TeaDeviceHelper.f1375i = null;
                teaDeviceHelper.e();
                TeaDeviceHelper.f1378l.remove(this);
            }
        }

        @Override // com.tencent.api.ITEAUsbEventCb
        public void onUsbDetech(String p0, int p1, int p2) {
        }

        @Override // com.tencent.api.ITEAUsbEventCb
        public void onUsbDeviceSelect(String id) {
            o.f(id, "id");
        }

        @Override // com.tencent.api.ITEAUsbEventCb
        public void onUsbOpenSuccess(boolean p0, String p1, int p2, int p3) {
        }
    }

    @Metadata(d1 = {"\u0000\n\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0000\u001a\n \u0002*\u0004\u0018\u00010\u00010\u0001H\n¢\u0006\u0002\b\u0003"}, d2 = {"<anonymous>", "Ljava/util/concurrent/ExecutorService;", "kotlin.jvm.PlatformType", "invoke"}, k = 3, mv = {1, 6, 0}, xi = 48)
    public static final class d extends Lambda implements Function0<ExecutorService> {

        /* JADX INFO: renamed from: f, reason: collision with root package name */
        public static final d f1382f = new d();

        public d() {
            super(0);
        }

        @Override // kotlin.jvm.functions.Function0
        public ExecutorService invoke() {
            return Executors.newSingleThreadExecutor();
        }
    }

    @Override // g.f.c.b.tea.util.IMicAbility
    public SmartSourceAngleBody a() {
        l();
        int[] deviceOverallBeamformingStartEndAngle = h().getDeviceOverallBeamformingStartEndAngle();
        if (deviceOverallBeamformingStartEndAngle.length >= 2) {
            return new SmartSourceAngleBody(deviceOverallBeamformingStartEndAngle[0], deviceOverallBeamformingStartEndAngle[1]);
        }
        Log.e("TeaDeviceHelper", "angle size < 2 return null");
        return null;
    }

    @Override // g.f.c.b.tea.util.IMicAbility
    public boolean b(int i2, int i3) {
        l();
        int deviceOverallBeamformingStartEndAngle = h().setDeviceOverallBeamformingStartEndAngle(i2, i3);
        g.a.a.a.a.c0("setSmartSourceAngle result:", deviceOverallBeamformingStartEndAngle, "TeaDeviceHelper");
        return deviceOverallBeamformingStartEndAngle >= 0;
    }

    @Override // g.f.c.b.tea.util.IMicAbility
    public int c() {
        l();
        float devicePreprocessOverallAiNsAggressiveness = h().getDevicePreprocessOverallAiNsAggressiveness();
        Log.d("TeaDeviceHelper", "getSmartNoiseCancellation from TEA SDK:" + devicePreprocessOverallAiNsAggressiveness);
        return (int) ((((double) devicePreprocessOverallAiNsAggressiveness) + 1.0E-4d) * ((double) 100));
    }

    @Override // g.f.c.b.tea.util.IMicAbility
    public boolean d(int i2) {
        float f2 = i2 / 100.0f;
        l();
        int devicePreprocessOverallAiNsAggressiveness = h().setDevicePreprocessOverallAiNsAggressiveness(f2);
        StringBuilder sb = new StringBuilder();
        sb.append("setSmartNoiseCancellation ");
        sb.append(i2);
        sb.append(AbstractJsonLexerKt.BEGIN_LIST);
        sb.append(f2);
        sb.append("] --> ");
        g.a.a.a.a.p0(sb, devicePreprocessOverallAiNsAggressiveness, "TeaDeviceHelper");
        return devicePreprocessOverallAiNsAggressiveness >= 0;
    }

    public final void e() {
        if (f1371e == null) {
            return;
        }
        String str = f1371e;
        o.c(str);
        File file = new File(str);
        if (file.exists()) {
            file.delete();
        }
    }

    public final String f(String str) {
        o.f(str, "deviceId");
        Base64.Encoder urlEncoder = Base64.getUrlEncoder();
        byte[] bytes = str.getBytes(Charsets.f9181b);
        o.e(bytes, "this as java.lang.String).getBytes(charset)");
        String strEncodeToString = urlEncoder.encodeToString(bytes);
        o.e(strEncodeToString, "getUrlEncoder().encodeTo…g(deviceId.toByteArray())");
        return strEncodeToString;
    }

    public final List<TeaDevice> g() {
        ArrayList arrayList = new ArrayList();
        Map<String, String> hidDeviceList = h().getHidDeviceList();
        o.e(hidDeviceList, "teaNativeInsideApi.hidDeviceList");
        for (Map.Entry<String, String> entry : hidDeviceList.entrySet()) {
            StringBuilder sbF = g.a.a.a.a.F("hid DeviceList:");
            sbF.append(entry.getKey());
            sbF.append(",value:");
            sbF.append(entry.getValue());
            Log.d("TeaDeviceHelper", sbF.toString());
            String key = entry.getKey();
            o.e(key, "it.key");
            String str = key;
            String value = entry.getValue();
            o.e(value, "it.value");
            String str2 = value;
            f1368b = new TeaDeviceSelectInfo(str, str2, kotlin.text.j.b(str2, "TEA Mic Array", true) ? TeaSDKDeviceEnum.TEA_MIC_ARRAY : kotlin.text.j.b(str2, "BM51", true) ? TeaSDKDeviceEnum.BM51 : TeaSDKDeviceEnum.UNKNOWN);
            StringBuilder sbF2 = g.a.a.a.a.F("changeTeaSDKDeviceSelect:");
            sbF2.append(f1368b);
            Log.d("TeaDeviceHelper", sbF2.toString());
            TEANativeInsideApi tEANativeInsideApi = f1376j;
            if (tEANativeInsideApi == null) {
                o.n("teaNativeInsideApi");
                throw null;
            }
            tEANativeInsideApi.usbDeviceSelect(entry.getKey());
            String key2 = entry.getKey();
            o.e(key2, "it.key");
            String str3 = key2;
            o.f(str3, "deviceId");
            Base64.Encoder urlEncoder = Base64.getUrlEncoder();
            byte[] bytes = str3.getBytes(Charsets.f9181b);
            o.e(bytes, "this as java.lang.String).getBytes(charset)");
            String strEncodeToString = urlEncoder.encodeToString(bytes);
            o.e(strEncodeToString, "getUrlEncoder().encodeTo…g(deviceId.toByteArray())");
            String value2 = entry.getValue();
            o.e(value2, "it.value");
            List listG = kotlin.text.j.G(value2, new String[]{";"}, false, 0, 6);
            if (listG.size() < 4) {
                Log.e("TeaDeviceHelper", "arrays size < 4");
            } else {
                String str4 = (String) listG.get(0);
                String str5 = (String) listG.get(1);
                String str6 = (String) listG.get(2);
                kotlin.reflect.w.internal.y0.n.c2.c.r(16);
                int i2 = Integer.parseInt(str6, 16);
                String str7 = (String) listG.get(3);
                kotlin.reflect.w.internal.y0.n.c2.c.r(16);
                arrayList.add(new TeaDevice(strEncodeToString, str4, str5, i2, Integer.parseInt(str7, 16)));
            }
        }
        return arrayList;
    }

    public final TEANativeInsideApi h() {
        TEANativeInsideApi tEANativeInsideApi = f1376j;
        if (tEANativeInsideApi != null) {
            return tEANativeInsideApi;
        }
        o.n("teaNativeInsideApi");
        throw null;
    }

    public final boolean i() {
        l();
        String allDeviceInformation = h().getAllDeviceInformation();
        g.a.a.a.a.g0("teaDevicesInformation:", allDeviceInformation, "TeaDeviceHelper");
        if (allDeviceInformation == null || allDeviceInformation.length() == 0) {
            Log.e("TeaDeviceHelper", "allDeviceInformation is null or empty");
            return false;
        }
        b bVar = new b();
        try {
            o.e(allDeviceInformation, "teaDevicesInformation");
            o.f(allDeviceInformation, "json");
            o.f(bVar, "token");
            return ((AllDeviceInformation) ((IConverter) UdiGlobal.INSTANCE.get(e0.a(IConverter.class))).fromJson(allDeviceInformation.length() == 0 ? "{}" : allDeviceInformation, bVar)).getDevices().size() > 1;
        } catch (Exception unused) {
            Log.e("TeaDeviceHelper", allDeviceInformation + " fromJson error");
            return false;
        }
    }

    public final void j() {
        TeaDeviceSelectInfo teaDeviceSelectInfo = f1368b;
        if ((teaDeviceSelectInfo != null ? teaDeviceSelectInfo.getType() : null) == TeaSDKDeviceEnum.BM51) {
            Log.d("TeaDeviceHelper", "selectBM51Device already select");
            return;
        }
        Map<String, String> hidDeviceList = h().getHidDeviceList();
        o.e(hidDeviceList, "teaNativeInsideApi.hidDeviceList");
        for (Map.Entry<String, String> entry : hidDeviceList.entrySet()) {
            StringBuilder sbF = g.a.a.a.a.F("hid DeviceList:");
            sbF.append(entry.getKey());
            sbF.append(",value:");
            sbF.append(entry.getValue());
            Log.d("TeaDeviceHelper", sbF.toString());
            String value = entry.getValue();
            o.e(value, "it.value");
            if (kotlin.text.j.b(value, "BM51", true)) {
                TEANativeInsideApi tEANativeInsideApi = f1376j;
                if (tEANativeInsideApi == null) {
                    o.n("teaNativeInsideApi");
                    throw null;
                }
                if (tEANativeInsideApi.usbDeviceSelect(entry.getKey()) >= 0) {
                    Log.d("TeaDeviceHelper", "usbDeviceSelect success");
                    String key = entry.getKey();
                    o.e(key, "it.key");
                    String str = key;
                    String value2 = entry.getValue();
                    o.e(value2, "it.value");
                    String str2 = value2;
                    f1368b = new TeaDeviceSelectInfo(str, str2, kotlin.text.j.b(str2, "TEA Mic Array", true) ? TeaSDKDeviceEnum.TEA_MIC_ARRAY : kotlin.text.j.b(str2, "BM51", true) ? TeaSDKDeviceEnum.BM51 : TeaSDKDeviceEnum.UNKNOWN);
                    StringBuilder sbF2 = g.a.a.a.a.F("changeTeaSDKDeviceSelect:");
                    sbF2.append(f1368b);
                    Log.d("TeaDeviceHelper", sbF2.toString());
                    return;
                }
                return;
            }
        }
    }

    public final boolean k(String str) {
        o.f(str, "deviceId");
        byte[] bArrDecode = Base64.getUrlDecoder().decode(str);
        o.e(bArrDecode, "getUrlDecoder().decode(deviceId)");
        String str2 = new String(bArrDecode, Charsets.f9181b);
        Log.d("TeaDeviceHelper", "selectTeaDevice:" + str2);
        Map<String, String> hidDeviceList = h().getHidDeviceList();
        o.e(hidDeviceList, "teaNativeInsideApi.hidDeviceList");
        for (Map.Entry<String, String> entry : hidDeviceList.entrySet()) {
            StringBuilder sbF = g.a.a.a.a.F("hid DeviceList:");
            sbF.append(entry.getKey());
            sbF.append(",value:");
            sbF.append(entry.getValue());
            Log.d("TeaDeviceHelper", sbF.toString());
            if (o.a(entry.getKey(), str2)) {
                TeaDeviceSelectInfo teaDeviceSelectInfo = f1368b;
                if (o.a(teaDeviceSelectInfo != null ? teaDeviceSelectInfo.getId() : null, entry.getKey())) {
                    TeaDeviceSelectInfo teaDeviceSelectInfo2 = f1368b;
                    if (o.a(teaDeviceSelectInfo2 != null ? teaDeviceSelectInfo2.getValue() : null, entry.getValue())) {
                        Log.d("TeaDeviceHelper", "selectTeaDevice already select");
                        return true;
                    }
                }
                String key = entry.getKey();
                o.e(key, "it.key");
                String str3 = key;
                String value = entry.getValue();
                o.e(value, "it.value");
                String str4 = value;
                f1368b = new TeaDeviceSelectInfo(str3, str4, kotlin.text.j.b(str4, "TEA Mic Array", true) ? TeaSDKDeviceEnum.TEA_MIC_ARRAY : kotlin.text.j.b(str4, "BM51", true) ? TeaSDKDeviceEnum.BM51 : TeaSDKDeviceEnum.UNKNOWN);
                StringBuilder sbF2 = g.a.a.a.a.F("changeTeaSDKDeviceSelect:");
                sbF2.append(f1368b);
                Log.d("TeaDeviceHelper", sbF2.toString());
                TEANativeInsideApi tEANativeInsideApi = f1376j;
                if (tEANativeInsideApi != null) {
                    tEANativeInsideApi.usbDeviceSelect(entry.getKey());
                    return true;
                }
                o.n("teaNativeInsideApi");
                throw null;
            }
        }
        return false;
    }

    public final void l() {
        TeaDeviceSelectInfo teaDeviceSelectInfo = f1368b;
        if ((teaDeviceSelectInfo != null ? teaDeviceSelectInfo.getType() : null) == TeaSDKDeviceEnum.TEA_MIC_ARRAY) {
            Log.d("TeaDeviceHelper", "selectTEA_MIC_ARRAY already select");
            return;
        }
        Map<String, String> hidDeviceList = h().getHidDeviceList();
        StringBuilder sbF = g.a.a.a.a.F("hid DeviceList: length = ");
        sbF.append(hidDeviceList.size());
        sbF.append(' ');
        sbF.append(hidDeviceList);
        Log.d("TeaDeviceHelper", sbF.toString());
        o.e(hidDeviceList, "teaNativeInsideApi.hidDe…{it.size} $it\")\n        }");
        for (Map.Entry<String, String> entry : hidDeviceList.entrySet()) {
            StringBuilder sbF2 = g.a.a.a.a.F("hid DeviceList:");
            sbF2.append(entry.getKey());
            sbF2.append(",value:");
            sbF2.append(entry.getValue());
            Log.d("TeaDeviceHelper", sbF2.toString());
            String value = entry.getValue();
            o.e(value, "it.value");
            if (kotlin.text.j.b(value, "TEA Mic Array", true)) {
                String key = entry.getKey();
                o.e(key, "it.key");
                String str = key;
                String value2 = entry.getValue();
                o.e(value2, "it.value");
                String str2 = value2;
                f1368b = new TeaDeviceSelectInfo(str, str2, kotlin.text.j.b(str2, "TEA Mic Array", true) ? TeaSDKDeviceEnum.TEA_MIC_ARRAY : kotlin.text.j.b(str2, "BM51", true) ? TeaSDKDeviceEnum.BM51 : TeaSDKDeviceEnum.UNKNOWN);
                StringBuilder sbF3 = g.a.a.a.a.F("changeTeaSDKDeviceSelect:");
                sbF3.append(f1368b);
                Log.d("TeaDeviceHelper", sbF3.toString());
                TEANativeInsideApi tEANativeInsideApi = f1376j;
                if (tEANativeInsideApi != null) {
                    tEANativeInsideApi.usbDeviceSelect(entry.getKey());
                    return;
                } else {
                    o.n("teaNativeInsideApi");
                    throw null;
                }
            }
        }
    }

    public final boolean m(boolean z2) {
        Log.d("TeaDeviceHelper", "setTeaDeviceMicMute:" + z2);
        l();
        h().SetDeviceMicrophoneOverallMute(0, z2);
        return true;
    }

    public final void n(boolean z2, String str) {
        TeaDeviceInfoUpgradeStatusApi teaDeviceInfoUpgradeStatusApi = TeaDeviceInfoUpgradeStatusApi.a;
        TeaDeviceInfoUpgradeStatusApi.a("tea_id", new UpgradeStatusNotify(1.0f));
        TeaDeviceInfoUpgradeResultApi teaDeviceInfoUpgradeResultApi = TeaDeviceInfoUpgradeResultApi.a;
        UpgradeResultNotify upgradeResultNotify = new UpgradeResultNotify(z2, str);
        o.f("tea_id", "id");
        o.f(upgradeResultNotify, "notify");
        TeaDeviceInfoUpgradeResultApi.a aVar = TeaDeviceInfoUpgradeResultApi.f4727b;
        o.f(aVar, "token");
        UdiGlobal udiGlobal = UdiGlobal.INSTANCE;
        IUdiServer.DefaultImpls.sendEvent$default((IUdiServer) udiGlobal.get(e0.a(IUdiServer.class)), "v1/tea/ota/upgrade/result/tea_id", ((IConverter) udiGlobal.get(e0.a(IConverter.class))).toJson(upgradeResultNotify, aVar), null, false, 12, null);
    }
}
