package com.cvte.dss.ups.main;

import android.content.Context;
import android.os.Build;
import android.util.Log;
import com.cvte.dss.ups.plugin.IUpsPlugin;
import com.ifpdos.udi.sdk.IEventHandler;
import com.ifpdos.udi.sdk.UdiSdk;
import g.a.a.a.a;
import g.e.b.f0.b;
import g.e.b.j;
import g.h.a.i;
import io.netty.handler.codec.memcache.binary.BinaryMemcacheOpcodes;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.TimeUnit;
import kotlin.Lazy;
import kotlin.Metadata;
import kotlin.Pair;
import kotlin.Unit;
import kotlin.collections.EmptyList;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.e0;
import kotlin.jvm.internal.o;
import kotlin.jvm.internal.z;
import kotlin.reflect.KFunction;
import kotlin.reflect.KProperty;
import no.nordicsemi.android.dfu.DfuServiceInitiator;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
import okhttp3.ResponseBody;
import okhttp3.n0.connection.RealCall;

/* JADX INFO: loaded from: classes.dex */
@Metadata(bv = {1, 0, 3}, d1 = {"\u0000d\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u000b\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0010\u0007\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u001d\n\u0002\u0018\u0002\n\u0002\b\u000b\n\u0002\u0018\u0002\n\u0002\b\n\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\f\b&\u0018\u0000 b2\u00020\u0001:\u0007bcdefghB\u0007¢\u0006\u0004\b`\u0010aJ/\u0010\n\u001a\u00020\t2\u0006\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0005\u001a\u00020\u00042\u0006\u0010\u0006\u001a\u00020\u00042\u0006\u0010\b\u001a\u00020\u0007H\u0002¢\u0006\u0004\b\n\u0010\u000bJ\u001f\u0010\r\u001a\u00020\t2\u0006\u0010\u0003\u001a\u00020\u00022\u0006\u0010\f\u001a\u00020\u0004H\u0002¢\u0006\u0004\b\r\u0010\u000eJ\u000f\u0010\u000f\u001a\u00020\tH\u0002¢\u0006\u0004\b\u000f\u0010\u0010J'\u0010\u0012\u001a\u00020\t2\u0006\u0010\u0011\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u00042\u0006\u0010\b\u001a\u00020\u0007H\u0002¢\u0006\u0004\b\u0012\u0010\u0013J)\u0010\u0016\u001a\u00020\u00152\b\u0010\u0014\u001a\u0004\u0018\u00010\u00042\u0006\u0010\u0005\u001a\u00020\u00042\u0006\u0010\b\u001a\u00020\u0007H\u0002¢\u0006\u0004\b\u0016\u0010\u0017J7\u0010\u001e\u001a\u00020\u00182\u0006\u0010\u0019\u001a\u00020\u00182\u0006\u0010\u001a\u001a\u00020\u00182\u0006\u0010\u001b\u001a\u00020\u00182\u0006\u0010\u001c\u001a\u00020\u00182\u0006\u0010\u001d\u001a\u00020\u0018H\u0002¢\u0006\u0004\b\u001e\u0010\u001fJ\u0011\u0010!\u001a\u0004\u0018\u00010 H\u0002¢\u0006\u0004\b!\u0010\"J\u001f\u0010#\u001a\u00020\u00042\u0006\u0010\u0006\u001a\u00020\u00042\u0006\u0010\b\u001a\u00020\u0007H\u0002¢\u0006\u0004\b#\u0010$J\u0017\u0010'\u001a\u00020\u00042\u0006\u0010&\u001a\u00020%H\u0002¢\u0006\u0004\b'\u0010(J\u000f\u0010)\u001a\u00020\u0004H\u0002¢\u0006\u0004\b)\u0010*J\u000f\u0010+\u001a\u00020\u0004H$¢\u0006\u0004\b+\u0010*J\u000f\u0010,\u001a\u00020\u0004H$¢\u0006\u0004\b,\u0010*J\u000f\u0010-\u001a\u00020\tH$¢\u0006\u0004\b-\u0010\u0010J\u000f\u0010.\u001a\u00020\tH$¢\u0006\u0004\b.\u0010\u0010J\u000f\u0010/\u001a\u00020\u0004H$¢\u0006\u0004\b/\u0010*J\u000f\u00100\u001a\u00020\u0004H$¢\u0006\u0004\b0\u0010*J\u000f\u00101\u001a\u00020\u0004H$¢\u0006\u0004\b1\u0010*J\u000f\u00102\u001a\u00020\u0004H$¢\u0006\u0004\b2\u0010*J\u0019\u0010!\u001a\u0004\u0018\u00010 2\u0006\u0010\u0003\u001a\u00020\u0002H\u0016¢\u0006\u0004\b!\u00103J/\u00105\u001a\u00020\t2\u0006\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0006\u001a\u00020\u00042\u0006\u00104\u001a\u00020\t2\u0006\u0010\b\u001a\u00020\u0007H\u0016¢\u0006\u0004\b5\u00106J\u001d\u00107\u001a\u00020\t2\u0006\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0005\u001a\u00020\u0004¢\u0006\u0004\b7\u0010\u000eJ7\u00105\u001a\u00020\t2\u0006\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0005\u001a\u00020\u00042\u0006\u0010\u0006\u001a\u00020\u00042\u0006\u00104\u001a\u00020\t2\u0006\u0010\b\u001a\u00020\u0007H\u0016¢\u0006\u0004\b5\u00108J\u0015\u00109\u001a\u00020\t2\u0006\u0010\u0003\u001a\u00020\u0002¢\u0006\u0004\b9\u0010:J%\u0010<\u001a\u00020\u00152\u0006\u0010\u0005\u001a\u00020\u00042\u0006\u0010;\u001a\u00020\u00042\u0006\u0010\b\u001a\u00020\u0007¢\u0006\u0004\b<\u0010\u0017J\u001d\u0010=\u001a\u00020\u00152\u0006\u0010\u0005\u001a\u00020\u00042\u0006\u0010\b\u001a\u00020\u0007¢\u0006\u0004\b=\u0010>J\u0015\u0010@\u001a\u00020\t2\u0006\u0010?\u001a\u00020\u0004¢\u0006\u0004\b@\u0010AJ)\u0010B\u001a\u00020\u00152\b\u0010\u0014\u001a\u0004\u0018\u00010\u00042\u0006\u0010\u0005\u001a\u00020\u00042\u0006\u0010\b\u001a\u00020\u0007H\u0016¢\u0006\u0004\bB\u0010\u0017R\u001d\u0010H\u001a\u00020C8F@\u0006X\u0086\u0084\u0002¢\u0006\f\n\u0004\bD\u0010E\u001a\u0004\bF\u0010GR$\u0010I\u001a\u0004\u0018\u00010\t8\u0006@\u0006X\u0086\u000e¢\u0006\u0012\n\u0004\bI\u0010J\u001a\u0004\bK\u0010L\"\u0004\bM\u0010NR\u0018\u0010P\u001a\u0004\u0018\u00010O8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\bP\u0010QR\u001c\u0010R\u001a\u00020\t8\u0014@\u0014X\u0094D¢\u0006\f\n\u0004\bR\u0010S\u001a\u0004\bT\u0010\u0010R\u001d\u0010W\u001a\u00020\t8F@\u0006X\u0086\u0084\u0002¢\u0006\f\n\u0004\bU\u0010E\u001a\u0004\bV\u0010\u0010R\u0016\u0010Y\u001a\u00020\t8B@\u0002X\u0082\u0004¢\u0006\u0006\u001a\u0004\bX\u0010\u0010R\u001c\u0010[\u001a\b\u0012\u0004\u0012\u00020\u00040Z8\u0002@\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b[\u0010\\R\u0016\u0010^\u001a\u00020]8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b^\u0010_¨\u0006i"}, d2 = {"Lcom/cvte/dss/ups/main/BasePlugin;", "Lcom/cvte/dss/ups/plugin/IUpsPlugin;", "Landroid/content/Context;", "context", "", "id", "path", "Lcom/cvte/dss/ups/plugin/IUpsPlugin$IUpgradeStatusListener;", "listener", "", "startUpgrade", "(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;Lcom/cvte/dss/ups/plugin/IUpsPlugin$IUpgradeStatusListener;)Z", "pkgName", "isAppInstalled", "(Landroid/content/Context;Ljava/lang/String;)Z", "rebootOnSuccess", "()Z", "dest", "doUpgradeFirmware", "(Ljava/lang/String;Ljava/lang/String;Lcom/cvte/dss/ups/plugin/IUpsPlugin$IUpgradeStatusListener;)Z", "data", "", "onNewStatusEvent", "(Ljava/lang/String;Ljava/lang/String;Lcom/cvte/dss/ups/plugin/IUpsPlugin$IUpgradeStatusListener;)V", "", "progress", "inMin", "inMax", "outMin", "outMax", "normalizeProgress", "(FFFFF)F", "Lcom/cvte/dss/ups/plugin/IUpsPlugin$FirmwareInfo;", "getFirmwareInfo", "()Lcom/cvte/dss/ups/plugin/IUpsPlugin$FirmwareInfo;", "uploadFile", "(Ljava/lang/String;Lcom/cvte/dss/ups/plugin/IUpsPlugin$IUpgradeStatusListener;)Ljava/lang/String;", "Ljava/io/File;", "file", "getMd5OfFile", "(Ljava/io/File;)Ljava/lang/String;", "getFileUploadToken", "()Ljava/lang/String;", "getName", "getType", "getReboot", "getMonopolize", "getOtaInformationUrl", "getOtaUpgradeUrl", "getOtaUpgradeStatusNotify", "getOtaUpgradeResultNotify", "(Landroid/content/Context;)Lcom/cvte/dss/ups/plugin/IUpsPlugin$FirmwareInfo;", "force", "upgradeFirmware", "(Landroid/content/Context;Ljava/lang/String;ZLcom/cvte/dss/ups/plugin/IUpsPlugin$IUpgradeStatusListener;)Z", "checkParamsLegalBeforeUpgrade", "(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;ZLcom/cvte/dss/ups/plugin/IUpsPlugin$IUpgradeStatusListener;)Z", "isRunningInDsu", "(Landroid/content/Context;)Z", "msg", "onFailure", "registerUpgradeEvent", "(Ljava/lang/String;Lcom/cvte/dss/ups/plugin/IUpsPlugin$IUpgradeStatusListener;)V", "jsonBody", "invokeUdiUpgrade", "(Ljava/lang/String;)Z", "onNewResultEvent", "Lg/e/b/j;", "mGson$delegate", "Lkotlin/Lazy;", "getMGson", "()Lg/e/b/j;", "mGson", "mRunInDsu", "Ljava/lang/Boolean;", "getMRunInDsu", "()Ljava/lang/Boolean;", "setMRunInDsu", "(Ljava/lang/Boolean;)V", "Lcom/ifpdos/udi/sdk/IEventHandler;", "mEventHandler", "Lcom/ifpdos/udi/sdk/IEventHandler;", "mUpgradeInPc", "Z", "getMUpgradeInPc", "mRebootOnSuccess$delegate", "getMRebootOnSuccess", "mRebootOnSuccess", "getMUpgradeControlBySelf", "mUpgradeControlBySelf", "Ljava/util/concurrent/CopyOnWriteArrayList;", "mUpgradingList", "Ljava/util/concurrent/CopyOnWriteArrayList;", "", "mRetryCount", "I", "<init>", "()V", "Companion", "StreamingData", "SystemInfo", "SystemUpgradeBody", "UpgradeBody", "UpgradeResultNotify", "UpgradeStatusNotify", "lib_release"}, k = 1, mv = {1, 4, 0})
public abstract class BasePlugin implements IUpsPlugin {
    public static final /* synthetic */ KProperty[] $$delegatedProperties = {e0.c(new z(e0.a(BasePlugin.class), "mGson", "getMGson()Lcom/google/gson/Gson;")), e0.c(new z(e0.a(BasePlugin.class), "mRebootOnSuccess", "getMRebootOnSuccess()Z"))};

    /* JADX INFO: renamed from: Companion, reason: from kotlin metadata */
    public static final Companion INSTANCE = new Companion(null);
    public static final String TAG = "UPS-PLUGIN-DSU";
    private static final String uploadFilePath;
    private IEventHandler mEventHandler;
    private int mRetryCount;
    private Boolean mRunInDsu;
    private final boolean mUpgradeInPc;

    /* JADX INFO: renamed from: mGson$delegate, reason: from kotlin metadata */
    private final Lazy mGson = i.D2(BasePlugin$mGson$2.INSTANCE);
    private final CopyOnWriteArrayList<String> mUpgradingList = new CopyOnWriteArrayList<>();

    /* JADX INFO: renamed from: mRebootOnSuccess$delegate, reason: from kotlin metadata */
    private final Lazy mRebootOnSuccess = i.D2(new BasePlugin$mRebootOnSuccess$2(this));

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u0010\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0010\u000e\n\u0002\b\b\b\u0086\u0003\u0018\u00002\u00020\u0001B\t\b\u0002¢\u0006\u0004\b\b\u0010\tR\u0019\u0010\u0003\u001a\u00020\u00028\u0006@\u0006¢\u0006\f\n\u0004\b\u0003\u0010\u0004\u001a\u0004\b\u0005\u0010\u0006R\u0016\u0010\u0007\u001a\u00020\u00028\u0006@\u0006X\u0086T¢\u0006\u0006\n\u0004\b\u0007\u0010\u0004¨\u0006\n"}, d2 = {"Lcom/cvte/dss/ups/main/BasePlugin$Companion;", "", "", "uploadFilePath", "Ljava/lang/String;", "getUploadFilePath", "()Ljava/lang/String;", "TAG", "<init>", "()V", "lib_release"}, k = 1, mv = {1, 4, 0})
    public static final class Companion {
        private Companion() {
        }

        public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
            this();
        }

        public final String getUploadFilePath() {
            return BasePlugin.uploadFilePath;
        }
    }

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000,\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0010\t\n\u0002\b\u0003\n\u0002\u0010 \n\u0002\u0010\u000e\n\u0002\b\t\n\u0002\u0010\b\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0002\b\n\b\u0086\b\u0018\u00002\u00020\u0001B%\u0012\u0006\u0010\n\u001a\u00020\u0002\u0012\u0006\u0010\u000b\u001a\u00020\u0002\u0012\f\u0010\f\u001a\b\u0012\u0004\u0012\u00020\u00070\u0006¢\u0006\u0004\b\u001d\u0010\u001eJ\u0010\u0010\u0003\u001a\u00020\u0002HÆ\u0003¢\u0006\u0004\b\u0003\u0010\u0004J\u0010\u0010\u0005\u001a\u00020\u0002HÆ\u0003¢\u0006\u0004\b\u0005\u0010\u0004J\u0016\u0010\b\u001a\b\u0012\u0004\u0012\u00020\u00070\u0006HÆ\u0003¢\u0006\u0004\b\b\u0010\tJ4\u0010\r\u001a\u00020\u00002\b\b\u0002\u0010\n\u001a\u00020\u00022\b\b\u0002\u0010\u000b\u001a\u00020\u00022\u000e\b\u0002\u0010\f\u001a\b\u0012\u0004\u0012\u00020\u00070\u0006HÆ\u0001¢\u0006\u0004\b\r\u0010\u000eJ\u0010\u0010\u000f\u001a\u00020\u0007HÖ\u0001¢\u0006\u0004\b\u000f\u0010\u0010J\u0010\u0010\u0012\u001a\u00020\u0011HÖ\u0001¢\u0006\u0004\b\u0012\u0010\u0013J\u001a\u0010\u0016\u001a\u00020\u00152\b\u0010\u0014\u001a\u0004\u0018\u00010\u0001HÖ\u0003¢\u0006\u0004\b\u0016\u0010\u0017R\u001c\u0010\n\u001a\u00020\u00028\u0006@\u0007X\u0087\u0004¢\u0006\f\n\u0004\b\n\u0010\u0018\u001a\u0004\b\u0019\u0010\u0004R\"\u0010\f\u001a\b\u0012\u0004\u0012\u00020\u00070\u00068\u0006@\u0007X\u0087\u0004¢\u0006\f\n\u0004\b\f\u0010\u001a\u001a\u0004\b\u001b\u0010\tR\u001c\u0010\u000b\u001a\u00020\u00028\u0006@\u0007X\u0087\u0004¢\u0006\f\n\u0004\b\u000b\u0010\u0018\u001a\u0004\b\u001c\u0010\u0004¨\u0006\u001f"}, d2 = {"Lcom/cvte/dss/ups/main/BasePlugin$StreamingData;", "", "", "component1", "()J", "component2", "", "", "component3", "()Ljava/util/List;", "offset", "size", "properties", "copy", "(JJLjava/util/List;)Lcom/cvte/dss/ups/main/BasePlugin$StreamingData;", "toString", "()Ljava/lang/String;", "", "hashCode", "()I", "other", "", "equals", "(Ljava/lang/Object;)Z", "J", "getOffset", "Ljava/util/List;", "getProperties", "getSize", "<init>", "(JJLjava/util/List;)V", "lib_release"}, k = 1, mv = {1, 4, 0})
    public static final /* data */ class StreamingData {

        @b("offset")
        private final long offset;

        @b("properties")
        private final List<String> properties;

        @b("size")
        private final long size;

        public StreamingData(long j2, long j3, List<String> list) {
            o.g(list, "properties");
            this.offset = j2;
            this.size = j3;
            this.properties = list;
        }

        /* JADX WARN: Multi-variable type inference failed */
        public static /* synthetic */ StreamingData copy$default(StreamingData streamingData, long j2, long j3, List list, int i2, Object obj) {
            if ((i2 & 1) != 0) {
                j2 = streamingData.offset;
            }
            long j4 = j2;
            if ((i2 & 2) != 0) {
                j3 = streamingData.size;
            }
            long j5 = j3;
            if ((i2 & 4) != 0) {
                list = streamingData.properties;
            }
            return streamingData.copy(j4, j5, list);
        }

        /* JADX INFO: renamed from: component1, reason: from getter */
        public final long getOffset() {
            return this.offset;
        }

        /* JADX INFO: renamed from: component2, reason: from getter */
        public final long getSize() {
            return this.size;
        }

        public final List<String> component3() {
            return this.properties;
        }

        public final StreamingData copy(long offset, long size, List<String> properties) {
            o.g(properties, "properties");
            return new StreamingData(offset, size, properties);
        }

        public boolean equals(Object other) {
            if (this != other) {
                if (other instanceof StreamingData) {
                    StreamingData streamingData = (StreamingData) other;
                    if (this.offset == streamingData.offset) {
                        if (!(this.size == streamingData.size) || !o.a(this.properties, streamingData.properties)) {
                        }
                    }
                }
                return false;
            }
            return true;
        }

        public final long getOffset() {
            return this.offset;
        }

        public final List<String> getProperties() {
            return this.properties;
        }

        public final long getSize() {
            return this.size;
        }

        public int hashCode() {
            int iHashCode = (Long.hashCode(this.size) + (Long.hashCode(this.offset) * 31)) * 31;
            List<String> list = this.properties;
            return iHashCode + (list != null ? list.hashCode() : 0);
        }

        public String toString() {
            StringBuilder sbF = a.F("StreamingData(offset=");
            sbF.append(this.offset);
            sbF.append(", size=");
            sbF.append(this.size);
            sbF.append(", properties=");
            sbF.append(this.properties);
            sbF.append(")");
            return sbF.toString();
        }
    }

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000(\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0010\u000e\n\u0002\b\u0004\n\u0002\u0010 \n\u0002\b\t\n\u0002\u0010\b\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0002\b\u000b\b\u0086\b\u0018\u00002\u00020\u0001B5\u0012\b\b\u0002\u0010\n\u001a\u00020\u0002\u0012\b\b\u0002\u0010\u000b\u001a\u00020\u0002\u0012\b\b\u0002\u0010\f\u001a\u00020\u0002\u0012\u000e\b\u0002\u0010\r\u001a\b\u0012\u0004\u0012\u00020\u00020\u0007¢\u0006\u0004\b\u001e\u0010\u001fJ\u0010\u0010\u0003\u001a\u00020\u0002HÆ\u0003¢\u0006\u0004\b\u0003\u0010\u0004J\u0010\u0010\u0005\u001a\u00020\u0002HÆ\u0003¢\u0006\u0004\b\u0005\u0010\u0004J\u0010\u0010\u0006\u001a\u00020\u0002HÆ\u0003¢\u0006\u0004\b\u0006\u0010\u0004J\u0016\u0010\b\u001a\b\u0012\u0004\u0012\u00020\u00020\u0007HÆ\u0003¢\u0006\u0004\b\b\u0010\tJ>\u0010\u000e\u001a\u00020\u00002\b\b\u0002\u0010\n\u001a\u00020\u00022\b\b\u0002\u0010\u000b\u001a\u00020\u00022\b\b\u0002\u0010\f\u001a\u00020\u00022\u000e\b\u0002\u0010\r\u001a\b\u0012\u0004\u0012\u00020\u00020\u0007HÆ\u0001¢\u0006\u0004\b\u000e\u0010\u000fJ\u0010\u0010\u0010\u001a\u00020\u0002HÖ\u0001¢\u0006\u0004\b\u0010\u0010\u0004J\u0010\u0010\u0012\u001a\u00020\u0011HÖ\u0001¢\u0006\u0004\b\u0012\u0010\u0013J\u001a\u0010\u0016\u001a\u00020\u00152\b\u0010\u0014\u001a\u0004\u0018\u00010\u0001HÖ\u0003¢\u0006\u0004\b\u0016\u0010\u0017R\u001c\u0010\n\u001a\u00020\u00028\u0006@\u0007X\u0087\u0004¢\u0006\f\n\u0004\b\n\u0010\u0018\u001a\u0004\b\u0019\u0010\u0004R\u001c\u0010\u000b\u001a\u00020\u00028\u0006@\u0007X\u0087\u0004¢\u0006\f\n\u0004\b\u000b\u0010\u0018\u001a\u0004\b\u001a\u0010\u0004R\u001c\u0010\f\u001a\u00020\u00028\u0006@\u0007X\u0087\u0004¢\u0006\f\n\u0004\b\f\u0010\u0018\u001a\u0004\b\u001b\u0010\u0004R\"\u0010\r\u001a\b\u0012\u0004\u0012\u00020\u00020\u00078\u0006@\u0007X\u0087\u0004¢\u0006\f\n\u0004\b\r\u0010\u001c\u001a\u0004\b\u001d\u0010\t¨\u0006 "}, d2 = {"Lcom/cvte/dss/ups/main/BasePlugin$SystemInfo;", "", "", "component1", "()Ljava/lang/String;", "component2", "component3", "", "component4", "()Ljava/util/List;", "key", "model", "version", "capabilities", "copy", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;)Lcom/cvte/dss/ups/main/BasePlugin$SystemInfo;", "toString", "", "hashCode", "()I", "other", "", "equals", "(Ljava/lang/Object;)Z", "Ljava/lang/String;", "getKey", "getModel", "getVersion", "Ljava/util/List;", "getCapabilities", "<init>", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;)V", "lib_release"}, k = 1, mv = {1, 4, 0})
    public static final /* data */ class SystemInfo {

        @b("capabilities")
        private final List<String> capabilities;

        @b("key")
        private final String key;

        @b("model")
        private final String model;

        @b("version")
        private final String version;

        public SystemInfo() {
            this(null, null, null, null, 15, null);
        }

        public SystemInfo(String str, String str2, String str3, List<String> list) {
            o.g(str, "key");
            o.g(str2, "model");
            o.g(str3, "version");
            o.g(list, "capabilities");
            this.key = str;
            this.model = str2;
            this.version = str3;
            this.capabilities = list;
        }

        public /* synthetic */ SystemInfo(String str, String str2, String str3, List list, int i2, DefaultConstructorMarker defaultConstructorMarker) {
            this((i2 & 1) != 0 ? "" : str, (i2 & 2) != 0 ? "" : str2, (i2 & 4) != 0 ? "" : str3, (i2 & 8) != 0 ? EmptyList.f9307f : list);
        }

        /* JADX WARN: Multi-variable type inference failed */
        public static /* synthetic */ SystemInfo copy$default(SystemInfo systemInfo, String str, String str2, String str3, List list, int i2, Object obj) {
            if ((i2 & 1) != 0) {
                str = systemInfo.key;
            }
            if ((i2 & 2) != 0) {
                str2 = systemInfo.model;
            }
            if ((i2 & 4) != 0) {
                str3 = systemInfo.version;
            }
            if ((i2 & 8) != 0) {
                list = systemInfo.capabilities;
            }
            return systemInfo.copy(str, str2, str3, list);
        }

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

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

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

        public final List<String> component4() {
            return this.capabilities;
        }

        public final SystemInfo copy(String key, String model, String version, List<String> capabilities) {
            o.g(key, "key");
            o.g(model, "model");
            o.g(version, "version");
            o.g(capabilities, "capabilities");
            return new SystemInfo(key, model, version, capabilities);
        }

        public boolean equals(Object other) {
            if (this == other) {
                return true;
            }
            if (!(other instanceof SystemInfo)) {
                return false;
            }
            SystemInfo systemInfo = (SystemInfo) other;
            return o.a(this.key, systemInfo.key) && o.a(this.model, systemInfo.model) && o.a(this.version, systemInfo.version) && o.a(this.capabilities, systemInfo.capabilities);
        }

        public final List<String> getCapabilities() {
            return this.capabilities;
        }

        public final String getKey() {
            return this.key;
        }

        public final String getModel() {
            return this.model;
        }

        public final String getVersion() {
            return this.version;
        }

        public int hashCode() {
            String str = this.key;
            int iHashCode = (str != null ? str.hashCode() : 0) * 31;
            String str2 = this.model;
            int iHashCode2 = (iHashCode + (str2 != null ? str2.hashCode() : 0)) * 31;
            String str3 = this.version;
            int iHashCode3 = (iHashCode2 + (str3 != null ? str3.hashCode() : 0)) * 31;
            List<String> list = this.capabilities;
            return iHashCode3 + (list != null ? list.hashCode() : 0);
        }

        public String toString() {
            StringBuilder sbF = a.F("SystemInfo(key=");
            sbF.append(this.key);
            sbF.append(", model=");
            sbF.append(this.model);
            sbF.append(", version=");
            sbF.append(this.version);
            sbF.append(", capabilities=");
            sbF.append(this.capabilities);
            sbF.append(")");
            return sbF.toString();
        }
    }

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000(\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\b\n\u0002\u0010\b\n\u0002\b\u000e\b\u0086\b\u0018\u00002\u00020\u0001B!\u0012\u0006\u0010\u000b\u001a\u00020\u0002\u0012\u0006\u0010\f\u001a\u00020\u0005\u0012\b\u0010\r\u001a\u0004\u0018\u00010\b¢\u0006\u0004\b\u001d\u0010\u001eJ\u0010\u0010\u0003\u001a\u00020\u0002HÆ\u0003¢\u0006\u0004\b\u0003\u0010\u0004J\u0010\u0010\u0006\u001a\u00020\u0005HÆ\u0003¢\u0006\u0004\b\u0006\u0010\u0007J\u0012\u0010\t\u001a\u0004\u0018\u00010\bHÆ\u0003¢\u0006\u0004\b\t\u0010\nJ0\u0010\u000e\u001a\u00020\u00002\b\b\u0002\u0010\u000b\u001a\u00020\u00022\b\b\u0002\u0010\f\u001a\u00020\u00052\n\b\u0002\u0010\r\u001a\u0004\u0018\u00010\bHÆ\u0001¢\u0006\u0004\b\u000e\u0010\u000fJ\u0010\u0010\u0010\u001a\u00020\u0002HÖ\u0001¢\u0006\u0004\b\u0010\u0010\u0004J\u0010\u0010\u0012\u001a\u00020\u0011HÖ\u0001¢\u0006\u0004\b\u0012\u0010\u0013J\u001a\u0010\u0015\u001a\u00020\u00052\b\u0010\u0014\u001a\u0004\u0018\u00010\u0001HÖ\u0003¢\u0006\u0004\b\u0015\u0010\u0016R\u001c\u0010\f\u001a\u00020\u00058\u0006@\u0007X\u0087\u0004¢\u0006\f\n\u0004\b\f\u0010\u0017\u001a\u0004\b\u0018\u0010\u0007R\u001e\u0010\r\u001a\u0004\u0018\u00010\b8\u0006@\u0007X\u0087\u0004¢\u0006\f\n\u0004\b\r\u0010\u0019\u001a\u0004\b\u001a\u0010\nR\u001c\u0010\u000b\u001a\u00020\u00028\u0006@\u0007X\u0087\u0004¢\u0006\f\n\u0004\b\u000b\u0010\u001b\u001a\u0004\b\u001c\u0010\u0004¨\u0006\u001f"}, d2 = {"Lcom/cvte/dss/ups/main/BasePlugin$SystemUpgradeBody;", "", "", "component1", "()Ljava/lang/String;", "", "component2", "()Z", "Lcom/cvte/dss/ups/main/BasePlugin$StreamingData;", "component3", "()Lcom/cvte/dss/ups/main/BasePlugin$StreamingData;", "path", "rebootOnSuccess", "streamingData", "copy", "(Ljava/lang/String;ZLcom/cvte/dss/ups/main/BasePlugin$StreamingData;)Lcom/cvte/dss/ups/main/BasePlugin$SystemUpgradeBody;", "toString", "", "hashCode", "()I", "other", "equals", "(Ljava/lang/Object;)Z", "Z", "getRebootOnSuccess", "Lcom/cvte/dss/ups/main/BasePlugin$StreamingData;", "getStreamingData", "Ljava/lang/String;", "getPath", "<init>", "(Ljava/lang/String;ZLcom/cvte/dss/ups/main/BasePlugin$StreamingData;)V", "lib_release"}, k = 1, mv = {1, 4, 0})
    public static final /* data */ class SystemUpgradeBody {

        @b("path")
        private final String path;

        @b("rebootOnSuccess")
        private final boolean rebootOnSuccess;

        @b("streamingData")
        private final StreamingData streamingData;

        public SystemUpgradeBody(String str, boolean z2, StreamingData streamingData) {
            o.g(str, "path");
            this.path = str;
            this.rebootOnSuccess = z2;
            this.streamingData = streamingData;
        }

        public static /* synthetic */ SystemUpgradeBody copy$default(SystemUpgradeBody systemUpgradeBody, String str, boolean z2, StreamingData streamingData, int i2, Object obj) {
            if ((i2 & 1) != 0) {
                str = systemUpgradeBody.path;
            }
            if ((i2 & 2) != 0) {
                z2 = systemUpgradeBody.rebootOnSuccess;
            }
            if ((i2 & 4) != 0) {
                streamingData = systemUpgradeBody.streamingData;
            }
            return systemUpgradeBody.copy(str, z2, streamingData);
        }

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

        /* JADX INFO: renamed from: component2, reason: from getter */
        public final boolean getRebootOnSuccess() {
            return this.rebootOnSuccess;
        }

        /* JADX INFO: renamed from: component3, reason: from getter */
        public final StreamingData getStreamingData() {
            return this.streamingData;
        }

        public final SystemUpgradeBody copy(String path, boolean rebootOnSuccess, StreamingData streamingData) {
            o.g(path, "path");
            return new SystemUpgradeBody(path, rebootOnSuccess, streamingData);
        }

        public boolean equals(Object other) {
            if (this != other) {
                if (other instanceof SystemUpgradeBody) {
                    SystemUpgradeBody systemUpgradeBody = (SystemUpgradeBody) other;
                    if (o.a(this.path, systemUpgradeBody.path)) {
                        if (!(this.rebootOnSuccess == systemUpgradeBody.rebootOnSuccess) || !o.a(this.streamingData, systemUpgradeBody.streamingData)) {
                        }
                    }
                }
                return false;
            }
            return true;
        }

        public final String getPath() {
            return this.path;
        }

        public final boolean getRebootOnSuccess() {
            return this.rebootOnSuccess;
        }

        public final StreamingData getStreamingData() {
            return this.streamingData;
        }

        /* JADX WARN: Multi-variable type inference failed */
        /* JADX WARN: Type inference failed for: r2v1, types: [int] */
        /* JADX WARN: Type inference failed for: r2v3 */
        /* JADX WARN: Type inference failed for: r2v4 */
        public int hashCode() {
            String str = this.path;
            int iHashCode = (str != null ? str.hashCode() : 0) * 31;
            boolean z2 = this.rebootOnSuccess;
            ?? r2 = z2;
            if (z2) {
                r2 = 1;
            }
            int i2 = (iHashCode + r2) * 31;
            StreamingData streamingData = this.streamingData;
            return i2 + (streamingData != null ? streamingData.hashCode() : 0);
        }

        public String toString() {
            StringBuilder sbF = a.F("SystemUpgradeBody(path=");
            sbF.append(this.path);
            sbF.append(", rebootOnSuccess=");
            sbF.append(this.rebootOnSuccess);
            sbF.append(", streamingData=");
            sbF.append(this.streamingData);
            sbF.append(")");
            return sbF.toString();
        }
    }

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000 \n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0007\n\u0002\u0010\b\n\u0002\b\f\b\u0086\b\u0018\u00002\u00020\u0001B\u0017\u0012\u0006\u0010\b\u001a\u00020\u0002\u0012\u0006\u0010\t\u001a\u00020\u0005¢\u0006\u0004\b\u0017\u0010\u0018J\u0010\u0010\u0003\u001a\u00020\u0002HÆ\u0003¢\u0006\u0004\b\u0003\u0010\u0004J\u0010\u0010\u0006\u001a\u00020\u0005HÆ\u0003¢\u0006\u0004\b\u0006\u0010\u0007J$\u0010\n\u001a\u00020\u00002\b\b\u0002\u0010\b\u001a\u00020\u00022\b\b\u0002\u0010\t\u001a\u00020\u0005HÆ\u0001¢\u0006\u0004\b\n\u0010\u000bJ\u0010\u0010\f\u001a\u00020\u0002HÖ\u0001¢\u0006\u0004\b\f\u0010\u0004J\u0010\u0010\u000e\u001a\u00020\rHÖ\u0001¢\u0006\u0004\b\u000e\u0010\u000fJ\u001a\u0010\u0011\u001a\u00020\u00052\b\u0010\u0010\u001a\u0004\u0018\u00010\u0001HÖ\u0003¢\u0006\u0004\b\u0011\u0010\u0012R\u001c\u0010\t\u001a\u00020\u00058\u0006@\u0007X\u0087\u0004¢\u0006\f\n\u0004\b\t\u0010\u0013\u001a\u0004\b\u0014\u0010\u0007R\u001c\u0010\b\u001a\u00020\u00028\u0006@\u0007X\u0087\u0004¢\u0006\f\n\u0004\b\b\u0010\u0015\u001a\u0004\b\u0016\u0010\u0004¨\u0006\u0019"}, d2 = {"Lcom/cvte/dss/ups/main/BasePlugin$UpgradeBody;", "", "", "component1", "()Ljava/lang/String;", "", "component2", "()Z", "path", "rebootOnSuccess", "copy", "(Ljava/lang/String;Z)Lcom/cvte/dss/ups/main/BasePlugin$UpgradeBody;", "toString", "", "hashCode", "()I", "other", "equals", "(Ljava/lang/Object;)Z", "Z", "getRebootOnSuccess", "Ljava/lang/String;", "getPath", "<init>", "(Ljava/lang/String;Z)V", "lib_release"}, k = 1, mv = {1, 4, 0})
    public static final /* data */ class UpgradeBody {

        @b("path")
        private final String path;

        @b("rebootOnSuccess")
        private final boolean rebootOnSuccess;

        public UpgradeBody(String str, boolean z2) {
            o.g(str, "path");
            this.path = str;
            this.rebootOnSuccess = z2;
        }

        public static /* synthetic */ UpgradeBody copy$default(UpgradeBody upgradeBody, String str, boolean z2, int i2, Object obj) {
            if ((i2 & 1) != 0) {
                str = upgradeBody.path;
            }
            if ((i2 & 2) != 0) {
                z2 = upgradeBody.rebootOnSuccess;
            }
            return upgradeBody.copy(str, z2);
        }

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

        /* JADX INFO: renamed from: component2, reason: from getter */
        public final boolean getRebootOnSuccess() {
            return this.rebootOnSuccess;
        }

        public final UpgradeBody copy(String path, boolean rebootOnSuccess) {
            o.g(path, "path");
            return new UpgradeBody(path, rebootOnSuccess);
        }

        public boolean equals(Object other) {
            if (this != other) {
                if (other instanceof UpgradeBody) {
                    UpgradeBody upgradeBody = (UpgradeBody) other;
                    if (o.a(this.path, upgradeBody.path)) {
                        if (this.rebootOnSuccess == upgradeBody.rebootOnSuccess) {
                        }
                    }
                }
                return false;
            }
            return true;
        }

        public final String getPath() {
            return this.path;
        }

        public final boolean getRebootOnSuccess() {
            return this.rebootOnSuccess;
        }

        /* JADX WARN: Multi-variable type inference failed */
        /* JADX WARN: Type inference failed for: r1v1, types: [int] */
        /* JADX WARN: Type inference failed for: r1v2 */
        /* JADX WARN: Type inference failed for: r1v3 */
        public int hashCode() {
            String str = this.path;
            int iHashCode = (str != null ? str.hashCode() : 0) * 31;
            boolean z2 = this.rebootOnSuccess;
            ?? r1 = z2;
            if (z2) {
                r1 = 1;
            }
            return iHashCode + r1;
        }

        public String toString() {
            StringBuilder sbF = a.F("UpgradeBody(path=");
            sbF.append(this.path);
            sbF.append(", rebootOnSuccess=");
            sbF.append(this.rebootOnSuccess);
            sbF.append(")");
            return sbF.toString();
        }
    }

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000 \n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0007\n\u0002\u0010\b\n\u0002\b\f\b\u0086\b\u0018\u00002\u00020\u0001B\u0019\u0012\u0006\u0010\b\u001a\u00020\u0002\u0012\b\b\u0002\u0010\t\u001a\u00020\u0005¢\u0006\u0004\b\u0017\u0010\u0018J\u0010\u0010\u0003\u001a\u00020\u0002HÆ\u0003¢\u0006\u0004\b\u0003\u0010\u0004J\u0010\u0010\u0006\u001a\u00020\u0005HÆ\u0003¢\u0006\u0004\b\u0006\u0010\u0007J$\u0010\n\u001a\u00020\u00002\b\b\u0002\u0010\b\u001a\u00020\u00022\b\b\u0002\u0010\t\u001a\u00020\u0005HÆ\u0001¢\u0006\u0004\b\n\u0010\u000bJ\u0010\u0010\f\u001a\u00020\u0005HÖ\u0001¢\u0006\u0004\b\f\u0010\u0007J\u0010\u0010\u000e\u001a\u00020\rHÖ\u0001¢\u0006\u0004\b\u000e\u0010\u000fJ\u001a\u0010\u0011\u001a\u00020\u00022\b\u0010\u0010\u001a\u0004\u0018\u00010\u0001HÖ\u0003¢\u0006\u0004\b\u0011\u0010\u0012R\u001c\u0010\b\u001a\u00020\u00028\u0006@\u0007X\u0087\u0004¢\u0006\f\n\u0004\b\b\u0010\u0013\u001a\u0004\b\u0014\u0010\u0004R\u001c\u0010\t\u001a\u00020\u00058\u0006@\u0007X\u0087\u0004¢\u0006\f\n\u0004\b\t\u0010\u0015\u001a\u0004\b\u0016\u0010\u0007¨\u0006\u0019"}, d2 = {"Lcom/cvte/dss/ups/main/BasePlugin$UpgradeResultNotify;", "", "", "component1", "()Z", "", "component2", "()Ljava/lang/String;", "error", "message", "copy", "(ZLjava/lang/String;)Lcom/cvte/dss/ups/main/BasePlugin$UpgradeResultNotify;", "toString", "", "hashCode", "()I", "other", "equals", "(Ljava/lang/Object;)Z", "Z", "getError", "Ljava/lang/String;", "getMessage", "<init>", "(ZLjava/lang/String;)V", "lib_release"}, k = 1, mv = {1, 4, 0})
    public static final /* data */ class UpgradeResultNotify {

        @b("error")
        private final boolean error;

        @b("message")
        private final String message;

        public UpgradeResultNotify(boolean z2, String str) {
            o.g(str, "message");
            this.error = z2;
            this.message = str;
        }

        public /* synthetic */ UpgradeResultNotify(boolean z2, String str, int i2, DefaultConstructorMarker defaultConstructorMarker) {
            this(z2, (i2 & 2) != 0 ? "" : str);
        }

        public static /* synthetic */ UpgradeResultNotify copy$default(UpgradeResultNotify upgradeResultNotify, boolean z2, String str, int i2, Object obj) {
            if ((i2 & 1) != 0) {
                z2 = upgradeResultNotify.error;
            }
            if ((i2 & 2) != 0) {
                str = upgradeResultNotify.message;
            }
            return upgradeResultNotify.copy(z2, str);
        }

        /* JADX INFO: renamed from: component1, reason: from getter */
        public final boolean getError() {
            return this.error;
        }

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

        public final UpgradeResultNotify copy(boolean error, String message) {
            o.g(message, "message");
            return new UpgradeResultNotify(error, message);
        }

        public boolean equals(Object other) {
            if (this != other) {
                if (other instanceof UpgradeResultNotify) {
                    UpgradeResultNotify upgradeResultNotify = (UpgradeResultNotify) other;
                    if (!(this.error == upgradeResultNotify.error) || !o.a(this.message, upgradeResultNotify.message)) {
                    }
                }
                return false;
            }
            return true;
        }

        public final boolean getError() {
            return this.error;
        }

        public final String getMessage() {
            return this.message;
        }

        /* JADX WARN: Multi-variable type inference failed */
        /* JADX WARN: Type inference failed for: r0v1, types: [int] */
        /* JADX WARN: Type inference failed for: r0v4 */
        /* JADX WARN: Type inference failed for: r0v5 */
        public int hashCode() {
            boolean z2 = this.error;
            ?? r0 = z2;
            if (z2) {
                r0 = 1;
            }
            int i2 = r0 * 31;
            String str = this.message;
            return i2 + (str != null ? str.hashCode() : 0);
        }

        public String toString() {
            StringBuilder sbF = a.F("UpgradeResultNotify(error=");
            sbF.append(this.error);
            sbF.append(", message=");
            return a.A(sbF, this.message, ")");
        }
    }

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000(\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0010\u0007\n\u0002\b\u0005\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0002\b\u0007\b\u0086\b\u0018\u00002\u00020\u0001B\u000f\u0012\u0006\u0010\u0005\u001a\u00020\u0002¢\u0006\u0004\b\u0014\u0010\u0015J\u0010\u0010\u0003\u001a\u00020\u0002HÆ\u0003¢\u0006\u0004\b\u0003\u0010\u0004J\u001a\u0010\u0006\u001a\u00020\u00002\b\b\u0002\u0010\u0005\u001a\u00020\u0002HÆ\u0001¢\u0006\u0004\b\u0006\u0010\u0007J\u0010\u0010\t\u001a\u00020\bHÖ\u0001¢\u0006\u0004\b\t\u0010\nJ\u0010\u0010\f\u001a\u00020\u000bHÖ\u0001¢\u0006\u0004\b\f\u0010\rJ\u001a\u0010\u0010\u001a\u00020\u000f2\b\u0010\u000e\u001a\u0004\u0018\u00010\u0001HÖ\u0003¢\u0006\u0004\b\u0010\u0010\u0011R\u001c\u0010\u0005\u001a\u00020\u00028\u0006@\u0007X\u0087\u0004¢\u0006\f\n\u0004\b\u0005\u0010\u0012\u001a\u0004\b\u0013\u0010\u0004¨\u0006\u0016"}, d2 = {"Lcom/cvte/dss/ups/main/BasePlugin$UpgradeStatusNotify;", "", "", "component1", "()F", "progress", "copy", "(F)Lcom/cvte/dss/ups/main/BasePlugin$UpgradeStatusNotify;", "", "toString", "()Ljava/lang/String;", "", "hashCode", "()I", "other", "", "equals", "(Ljava/lang/Object;)Z", "F", "getProgress", "<init>", "(F)V", "lib_release"}, k = 1, mv = {1, 4, 0})
    public static final /* data */ class UpgradeStatusNotify {

        @b("progress")
        private final float progress;

        public UpgradeStatusNotify(float f2) {
            this.progress = f2;
        }

        public static /* synthetic */ UpgradeStatusNotify copy$default(UpgradeStatusNotify upgradeStatusNotify, float f2, int i2, Object obj) {
            if ((i2 & 1) != 0) {
                f2 = upgradeStatusNotify.progress;
            }
            return upgradeStatusNotify.copy(f2);
        }

        /* JADX INFO: renamed from: component1, reason: from getter */
        public final float getProgress() {
            return this.progress;
        }

        public final UpgradeStatusNotify copy(float progress) {
            return new UpgradeStatusNotify(progress);
        }

        public boolean equals(Object other) {
            if (this != other) {
                return (other instanceof UpgradeStatusNotify) && Float.compare(this.progress, ((UpgradeStatusNotify) other).progress) == 0;
            }
            return true;
        }

        public final float getProgress() {
            return this.progress;
        }

        public int hashCode() {
            return Float.hashCode(this.progress);
        }

        public String toString() {
            StringBuilder sbF = a.F("UpgradeStatusNotify(progress=");
            sbF.append(this.progress);
            sbF.append(")");
            return sbF.toString();
        }
    }

    static {
        uploadFilePath = Build.VERSION.SDK_INT >= 33 ? "/sdcard/.monitor/" : "/data/monitor/";
    }

    private final boolean doUpgradeFirmware(String dest, String id, IUpsPlugin.IUpgradeStatusListener listener) {
        registerUpgradeEvent(id, listener);
        String strG = getMGson().g(new UpgradeBody(dest, getMRebootOnSuccess()));
        o.b(strG, "body");
        return invokeUdiUpgrade(strG);
    }

    private final String getFileUploadToken() throws IOException {
        Request.a aVar = new Request.a();
        aVar.f("http://192.168.153.253:8455/token");
        aVar.b("Connection", "close");
        Request requestA = aVar.a();
        OkHttpClient.a aVar2 = new OkHttpClient.a();
        TimeUnit timeUnit = TimeUnit.MINUTES;
        aVar2.b(3L, timeUnit);
        aVar2.d(3L, timeUnit);
        boolean z2 = true;
        aVar2.f9579f = true;
        Response responseJ = ((RealCall) new OkHttpClient(aVar2).b(requestA)).j();
        try {
            Log.i(TAG, "http token get request: " + responseJ);
            if (!responseJ.c()) {
                i.E(responseJ, null);
                return "";
            }
            ResponseBody responseBody = responseJ.f9647r;
            String strG = responseBody != null ? responseBody.g() : null;
            if (strG != null) {
                if (strG.length() != 0) {
                    z2 = false;
                }
            }
            i.E(responseJ, null);
            return z2 ? "" : strG;
        } finally {
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final IUpsPlugin.FirmwareInfo getFirmwareInfo() {
        SystemInfo systemInfo;
        OkHttpClient.a aVarNewOkHttpClientBuilder = UdiSdk.newOkHttpClientBuilder();
        Objects.requireNonNull(aVarNewOkHttpClientBuilder);
        OkHttpClient okHttpClient = new OkHttpClient(aVarNewOkHttpClientBuilder);
        Request.a aVar = new Request.a();
        aVar.f(getOtaInformationUrl());
        try {
            Response responseJ = ((RealCall) okHttpClient.b(aVar.a())).j();
            try {
                if (responseJ.c()) {
                    ResponseBody responseBody = responseJ.f9647r;
                    systemInfo = (SystemInfo) getMGson().b(responseBody != null ? responseBody.g() : null, SystemInfo.class);
                } else {
                    systemInfo = new SystemInfo(null, null, null, null, 15, null);
                }
                Log.i(TAG, "udi ota information request: " + systemInfo + ", " + responseJ);
                if (systemInfo.getKey().length() == 0) {
                    i.E(responseJ, null);
                    return null;
                }
                IUpsPlugin.FirmwareInfo firmwareInfo = new IUpsPlugin.FirmwareInfo(getName(), systemInfo.getModel(), getType(), systemInfo.getVersion(), systemInfo.getKey(), getReboot(), getMonopolize(), systemInfo.getKey());
                i.E(responseJ, null);
                return firmwareInfo;
            } finally {
            }
        } catch (Exception e2) {
            StringBuilder sb = new StringBuilder();
            sb.append("getFirmwareInfo");
            e2.printStackTrace();
            sb.append(Unit.a);
            Log.e(TAG, sb.toString());
            return null;
        }
        StringBuilder sb2 = new StringBuilder();
        sb2.append("getFirmwareInfo");
        e2.printStackTrace();
        sb2.append(Unit.a);
        Log.e(TAG, sb2.toString());
        return null;
    }

    private final boolean getMUpgradeControlBySelf() {
        return o.a(this.mRunInDsu, Boolean.TRUE) || getMUpgradeInPc();
    }

    private final String getMd5OfFile(File file) throws IOException {
        FileInputStream fileInputStream = new FileInputStream(file);
        try {
            MessageDigest messageDigest = MessageDigest.getInstance("MD5");
            byte[] bArr = new byte[1024];
            while (true) {
                int i2 = fileInputStream.read(bArr, 0, 1024);
                if (i2 <= -1) {
                    break;
                }
                messageDigest.update(bArr, 0, i2);
            }
            byte[] bArrDigest = messageDigest.digest();
            char[] cArr = a0.a.a.a.a.a.a;
            char[] cArr2 = a0.a.a.a.a.a.a;
            char[] cArr3 = new char[bArrDigest.length << 1];
            int length = bArrDigest.length;
            int i3 = 0;
            for (int i4 = 0; i4 < 0 + length; i4++) {
                int i5 = i3 + 1;
                cArr3[i3] = cArr2[(bArrDigest[i4] & 240) >>> 4];
                i3 = i5 + 1;
                cArr3[i5] = cArr2[bArrDigest[i4] & BinaryMemcacheOpcodes.PREPEND];
            }
            String str = new String(cArr3);
            o.b(str, "DigestUtils.md5Hex(inputStream)");
            return str;
        } catch (NoSuchAlgorithmException e2) {
            throw new IllegalArgumentException(e2);
        }
    }

    private final boolean isAppInstalled(Context context, String pkgName) {
        try {
            context.getPackageManager().getApplicationEnabledSetting(pkgName);
            return true;
        } catch (IllegalArgumentException unused) {
            return false;
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final float normalizeProgress(float progress, float inMin, float inMax, float outMin, float outMax) {
        if (progress < inMin) {
            return outMin;
        }
        if (progress > inMax) {
            return outMax;
        }
        return (((progress - inMin) * (outMax - outMin)) / (inMax - inMin)) + outMin;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final void onNewStatusEvent(String data, String id, IUpsPlugin.IUpgradeStatusListener listener) {
        if (data != null) {
            UpgradeStatusNotify upgradeStatusNotify = (UpgradeStatusNotify) getMGson().b(data, UpgradeStatusNotify.class);
            float f2 = 0.5f;
            if (getMUpgradeControlBySelf()) {
                f2 = 0.0f;
            } else {
                int i2 = this.mRetryCount;
                if (i2 != 0) {
                    f2 = 0.5f + (i2 * 0.01f);
                }
            }
            float fNormalizeProgress = normalizeProgress(upgradeStatusNotify.getProgress(), 0.0f, 1.0f, f2, 0.9f);
            Log.i(TAG, "on progress: " + fNormalizeProgress);
            listener.onProcess(fNormalizeProgress);
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final boolean rebootOnSuccess() {
        if (getMUpgradeControlBySelf()) {
            return false;
        }
        return getReboot();
    }

    private final boolean startUpgrade(Context context, String id, String path, IUpsPlugin.IUpgradeStatusListener listener) throws InterruptedException, IOException {
        String str;
        if (getMUpgradeControlBySelf()) {
            StringBuilder sbF = a.F("run in dsu[");
            sbF.append(this.mRunInDsu);
            sbF.append("] or[");
            sbF.append(getMUpgradeInPc());
            sbF.append("] upgradeInPc, do not need upload");
            Log.i(TAG, sbF.toString());
        } else {
            path = uploadFile(path, listener);
        }
        if (path.length() == 0) {
            str = "fail to upload firmware";
        } else {
            if (doUpgradeFirmware(path, id, listener)) {
                return true;
            }
            str = "fail to upgrade firmware";
        }
        onFailure(id, str, listener);
        return false;
    }

    /* JADX WARN: Removed duplicated region for block: B:106:0x028c A[SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:80:0x028d A[LOOP:0: B:3:0x000a->B:80:0x028d, LOOP_END] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    private final java.lang.String uploadFile(java.lang.String r21, com.cvte.dss.ups.plugin.IUpsPlugin.IUpgradeStatusListener r22) throws java.lang.InterruptedException, java.io.IOException {
        /*
            Method dump skipped, instruction units count: 711
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: com.cvte.dss.ups.main.BasePlugin.uploadFile(java.lang.String, com.cvte.dss.ups.plugin.IUpsPlugin$IUpgradeStatusListener):java.lang.String");
    }

    public final boolean checkParamsLegalBeforeUpgrade(Context context, String id) {
        Object next;
        String str;
        o.g(context, "context");
        o.g(id, "id");
        Iterator<T> it = getFirmwareInfos(context).iterator();
        while (true) {
            if (!it.hasNext()) {
                next = null;
                break;
            }
            next = it.next();
            if (o.a(((IUpsPlugin.FirmwareInfo) next).getId(), id)) {
                break;
            }
        }
        if (((IUpsPlugin.FirmwareInfo) next) == null) {
            str = "id " + id + " not found";
        } else {
            if (!this.mUpgradingList.contains(id)) {
                if (this.mRunInDsu == null) {
                    this.mRunInDsu = Boolean.valueOf(isRunningInDsu(context));
                }
                this.mUpgradingList.add(id);
                return true;
            }
            str = "Plugin Busy";
        }
        Log.e(TAG, str);
        return false;
    }

    @Override // com.cvte.dss.ups.plugin.IUpsPlugin
    public IUpsPlugin.FirmwareInfo getFirmwareInfo(Context context) {
        o.g(context, "context");
        return getFirmwareInfo();
    }

    @Override // com.cvte.dss.ups.plugin.IUpsPlugin
    public List<IUpsPlugin.FirmwareInfo> getFirmwareInfos(Context context) {
        o.g(context, "context");
        return IUpsPlugin.DefaultImpls.getFirmwareInfos(this, context);
    }

    @Override // com.cvte.dss.ups.plugin.IUpsPlugin
    public List<IUpsPlugin.FirmwareInfo> getFirmwareInfosWithOptions(Context context, String str) {
        o.g(context, "context");
        o.g(str, "options");
        return IUpsPlugin.DefaultImpls.getFirmwareInfosWithOptions(this, context, str);
    }

    public final j getMGson() {
        Lazy lazy = this.mGson;
        KProperty kProperty = $$delegatedProperties[0];
        return (j) lazy.getValue();
    }

    public final boolean getMRebootOnSuccess() {
        Lazy lazy = this.mRebootOnSuccess;
        KProperty kProperty = $$delegatedProperties[1];
        return ((Boolean) lazy.getValue()).booleanValue();
    }

    public final Boolean getMRunInDsu() {
        return this.mRunInDsu;
    }

    public boolean getMUpgradeInPc() {
        return this.mUpgradeInPc;
    }

    public abstract boolean getMonopolize();

    public abstract String getName();

    public abstract String getOtaInformationUrl();

    public abstract String getOtaUpgradeResultNotify();

    public abstract String getOtaUpgradeStatusNotify();

    public abstract String getOtaUpgradeUrl();

    public abstract boolean getReboot();

    public abstract String getType();

    public final boolean invokeUdiUpgrade(String jsonBody) throws IOException {
        o.g(jsonBody, "jsonBody");
        OkHttpClient.a aVarNewOkHttpClientBuilder = UdiSdk.newOkHttpClientBuilder();
        TimeUnit timeUnit = TimeUnit.MINUTES;
        aVarNewOkHttpClientBuilder.b(3L, timeUnit);
        aVarNewOkHttpClientBuilder.d(3L, timeUnit);
        aVarNewOkHttpClientBuilder.f9579f = true;
        OkHttpClient okHttpClient = new OkHttpClient(aVarNewOkHttpClientBuilder);
        Request.a aVar = new Request.a();
        aVar.f(getOtaUpgradeUrl());
        RequestBody.Companion companion = RequestBody.INSTANCE;
        MediaType.a aVar2 = MediaType.a;
        aVar.d(companion.a(jsonBody, MediaType.a.a("application/json;charset=utf-8")));
        Response responseJ = ((RealCall) okHttpClient.b(aVar.a())).j();
        try {
            Log.i(TAG, "udi ota upgrade request: " + responseJ);
            if (!responseJ.c()) {
                UdiSdk.unregisterEvents(this.mEventHandler);
            }
            boolean zC = responseJ.c();
            i.E(responseJ, null);
            return zC;
        } finally {
        }
    }

    public final boolean isRunningInDsu(Context context) {
        o.g(context, "context");
        List listG = kotlin.collections.j.G("com.cvte.udi.service.core", "com.seewo.osservice");
        if (listG.isEmpty()) {
            return false;
        }
        Iterator it = listG.iterator();
        while (it.hasNext()) {
            if (isAppInstalled(context, (String) it.next())) {
                return true;
            }
        }
        return false;
    }

    public final void onFailure(String id, String msg, IUpsPlugin.IUpgradeStatusListener listener) {
        o.g(id, "id");
        o.g(msg, "msg");
        o.g(listener, "listener");
        Log.e(TAG, "id " + id + " upgrade fail,reason:" + msg);
        this.mUpgradingList.remove(id);
        listener.onFailed(msg);
    }

    public void onNewResultEvent(String data, final String id, final IUpsPlugin.IUpgradeStatusListener listener) {
        o.g(id, "id");
        o.g(listener, "listener");
        if (data != null) {
            UdiSdk.unregisterEvents(this.mEventHandler);
            UpgradeResultNotify upgradeResultNotify = (UpgradeResultNotify) getMGson().b(data, UpgradeResultNotify.class);
            StringBuilder sbF = a.F("udi upgrade ");
            sbF.append(getName());
            sbF.append(" result: ");
            sbF.append(upgradeResultNotify);
            Log.i(TAG, sbF.toString());
            if (upgradeResultNotify.getError()) {
                onFailure(id, upgradeResultNotify.getMessage(), listener);
            } else {
                if (!getMUpgradeControlBySelf()) {
                    new Thread(new Runnable() { // from class: com.cvte.dss.ups.main.BasePlugin.onNewResultEvent.1
                        @Override // java.lang.Runnable
                        public final void run() throws InterruptedException {
                            int i2;
                            if (BasePlugin.this.getReboot()) {
                                Thread.sleep(30000L);
                                i2 = 36;
                            } else {
                                i2 = 5;
                            }
                            int i3 = 0;
                            while (true) {
                                IUpsPlugin.FirmwareInfo firmwareInfo = BasePlugin.this.getFirmwareInfo();
                                if ((firmwareInfo != null ? firmwareInfo.getVersion() : null) != null) {
                                    BasePlugin.this.mUpgradingList.remove(id);
                                    listener.onProcess(1.0f);
                                    listener.onComplete();
                                    return;
                                }
                                Log.d(BasePlugin.TAG, "version null,retry :" + i3);
                                Thread.sleep(DfuServiceInitiator.DEFAULT_SCAN_TIMEOUT);
                                int i4 = i3 + 1;
                                if (i3 >= i2) {
                                    BasePlugin.this.onFailure(id, "can't get version after upgrade", listener);
                                    return;
                                }
                                i3 = i4;
                            }
                        }
                    }).start();
                    return;
                }
                this.mUpgradingList.remove(id);
                listener.onProcess(1.0f);
                listener.onComplete();
            }
        }
    }

    public final void registerUpgradeEvent(final String id, final IUpsPlugin.IUpgradeStatusListener listener) {
        o.g(id, "id");
        o.g(listener, "listener");
        final Map mapJ = kotlin.collections.j.J(new Pair(getOtaUpgradeStatusNotify(), new BasePlugin$registerUpgradeEvent$eventHandler$1(this)), new Pair(getOtaUpgradeResultNotify(), new BasePlugin$registerUpgradeEvent$eventHandler$2(this)));
        if (this.mEventHandler == null) {
            this.mEventHandler = new IEventHandler() { // from class: com.cvte.dss.ups.main.BasePlugin.registerUpgradeEvent.1
                @Override // com.ifpdos.udi.sdk.IEventHandler
                public final void onEvent(String str, String str2) {
                    KFunction kFunction;
                    Log.i(BasePlugin.TAG, "receive new event: " + str);
                    if (mapJ.containsKey(str) && (kFunction = (KFunction) mapJ.get(str)) != null) {
                    }
                }
            };
        }
        UdiSdk.registerEvents((Set<String>) mapJ.keySet(), this.mEventHandler);
    }

    public final void setMRunInDsu(Boolean bool) {
        this.mRunInDsu = bool;
    }

    @Override // com.cvte.dss.ups.plugin.IUpsPlugin
    public boolean upgradeFirmware(Context context, String id, String path, boolean force, IUpsPlugin.IUpgradeStatusListener listener) {
        o.g(context, "context");
        o.g(id, "id");
        o.g(path, "path");
        o.g(listener, "listener");
        if (checkParamsLegalBeforeUpgrade(context, id)) {
            return startUpgrade(context, id, path, listener);
        }
        Log.e(TAG, "upgradeFirmware: checkParamsLegalBeforeUpgrade failed");
        return false;
    }

    @Override // com.cvte.dss.ups.plugin.IUpsPlugin
    public boolean upgradeFirmware(Context context, String str, String str2, boolean z2, String str3, IUpsPlugin.IUpgradeStatusListener iUpgradeStatusListener) {
        o.g(context, "context");
        o.g(str, "id");
        o.g(str2, "path");
        o.g(str3, "options");
        o.g(iUpgradeStatusListener, "listener");
        return IUpsPlugin.DefaultImpls.upgradeFirmware(this, context, str, str2, z2, str3, iUpgradeStatusListener);
    }

    @Override // com.cvte.dss.ups.plugin.IUpsPlugin
    public boolean upgradeFirmware(Context context, String path, boolean force, IUpsPlugin.IUpgradeStatusListener listener) {
        String id;
        o.g(context, "context");
        o.g(path, "path");
        o.g(listener, "listener");
        IUpsPlugin.FirmwareInfo firmwareInfo = getFirmwareInfo();
        if (firmwareInfo != null && (id = firmwareInfo.getId()) != null) {
            return upgradeFirmware(context, id, path, force, listener);
        }
        Log.e(TAG, "fail to get firmware info");
        return false;
    }
}
