package g.i.a.c.y;

import android.bluetooth.BluetoothDevice;
import android.content.Context;
import com.cvte.vman.instance.InvokeCmd;
import g.h.a.i;
import g.i.a.a.a.a.d;
import g.i.a.a.a.a.e;
import g.i.a.c.g.c;
import g.i.a.c.q.f;
import io.netty.handler.codec.compression.Bzip2Constants;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Objects;
import no.nordicsemi.android.dfu.DfuServiceInitiator;

/* JADX INFO: loaded from: classes.dex */
public class b extends g.i.a.c.x.a {
    public d u0;

    public class a extends d {
        public a() {
        }

        @Override // g.i.a.a.a.a.d
        public void a(g.i.a.a.a.a.a aVar) {
            b bVar = b.this;
            Objects.requireNonNull(bVar);
            short s2 = aVar.a;
            byte b2 = aVar.f5275b;
            if (bVar.s0.containsKey(Short.valueOf(s2))) {
                bVar.s0.put(Short.valueOf(s2), aVar);
            }
            switch (s2) {
                case 1536:
                    i.U3("ACK-CMD_OTA_GET_DEVICE_INFO");
                    if (b2 == 2 || b2 == 1) {
                        i.W3("CMD_OTA_GET_DEVICE_INFO not support");
                        bVar.M = 281;
                        bVar.f5608z = null;
                        bVar.r0.remove((short) 1536);
                        bVar.y();
                        return;
                    }
                    return;
                case InvokeCmd.CMD_EASYTOUCH_GET_LOGINFO /* 1537 */:
                default:
                    return;
                case 1538:
                case 1540:
                case 1541:
                case 1542:
                case 1543:
                case 1544:
                case 1545:
                    if (aVar.f5275b == 0) {
                        bVar.C = false;
                    } else {
                        bVar.C = true;
                    }
                    bVar.q();
                    break;
                case 1539:
                    break;
            }
            if (aVar.f5275b != 0) {
                bVar.C = true;
                bVar.q();
            }
        }

        @Override // g.i.a.a.a.a.d
        public void b(BluetoothDevice bluetoothDevice, boolean z2, int i2) {
            if (i2 == 512) {
                b.this.B(InvokeCmd.CMD_XBUG_SET_XBUG_DUMP_CVTE_LOG);
            } else {
                if (i2 != 0) {
                    return;
                }
                if (b.this.E == 521) {
                    b.this.M = 2048;
                    b bVar = b.this;
                    if (bVar.f5594f) {
                        i.W3(String.format("disconnect in OTA process, mErrorState: 0x%04X", Integer.valueOf(bVar.M)));
                    }
                    b.this.q();
                }
                b.this.B(0);
            }
            b.this.w();
        }

        @Override // g.i.a.a.a.a.d
        public void c(e eVar) {
            b bVar = b.this;
            Objects.requireNonNull(bVar);
            short s2 = eVar.f5300d;
            byte[] bArr = eVar.f5301e;
            switch (s2) {
                case 1536:
                case InvokeCmd.CMD_EASYTOUCH_GET_LOGINFO /* 1537 */:
                case 1544:
                case 1545:
                    short s3 = (short) (s2 & 65535);
                    if (!bVar.r0.contains(Short.valueOf(s3))) {
                        i.W3(String.format("not expect event: 0x%04X", Short.valueOf(s3)));
                        return;
                    }
                    bVar.r0.remove(Short.valueOf(s3));
                    bVar.f5608z = bArr;
                    bVar.y();
                    return;
                case 1538:
                case 1540:
                case 1541:
                case 1542:
                case 1543:
                    synchronized (bVar.V) {
                        bVar.p0 = bArr;
                        bVar.q0 = true;
                        bVar.V.notifyAll();
                        break;
                    }
                    return;
                case 1539:
                    if (((bArr == null || bArr.length <= 0) ? (byte) 1 : bArr[0]) == 1) {
                        bVar.C = false;
                    } else {
                        bVar.C = true;
                    }
                    bVar.q();
                    return;
                default:
                    return;
            }
        }
    }

    public b(Context context, f fVar, g.i.a.c.m.a.b bVar) {
        super(context, fVar, bVar);
        this.u0 = new a();
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:91:0x02da A[Catch: IOException -> 0x055a, TryCatch #0 {IOException -> 0x055a, blocks: (B:87:0x02cb, B:89:0x02d0, B:92:0x02e7, B:94:0x02eb, B:99:0x0339, B:102:0x0340, B:103:0x0351, B:105:0x035b, B:107:0x0367, B:109:0x037d, B:111:0x0381, B:97:0x0316, B:98:0x0327, B:91:0x02da), top: B:235:0x02cb }] */
    /* JADX WARN: Type inference failed for: r2v10, types: [boolean] */
    /* JADX WARN: Type inference failed for: r2v40 */
    /* JADX WARN: Type inference failed for: r2v64 */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final boolean S() throws g.i.a.c.g.c {
        /*
            Method dump skipped, instruction units count: 1763
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: g.i.a.c.y.b.S():boolean");
    }

    public final int T(String str, int i2) {
        BluetoothDevice remoteDevice;
        int i3;
        int i4;
        int i5 = 0;
        while (!this.f5600r) {
            B(256);
            this.M = 0;
            this.f5603u = false;
            try {
                remoteDevice = this.i0.getRemoteDevice(str);
            } catch (Exception e2) {
                i.D0(e2.toString());
                remoteDevice = null;
            }
            if (remoteDevice == null) {
                i3 = InvokeCmd.CMD_EXTENDDISPLAY_CTRL_GET_HDMI_IN_OUT;
            } else {
                i.V3(this.f5594f, "connecting to " + str);
                b0().h(this.u0);
                b0().b(remoteDevice, null);
                try {
                    synchronized (this.f5604v) {
                        if (!this.f5603u && this.M == 0) {
                            i.x0(this.f5594f, "wait for connect for 32000 ms");
                            this.f5604v.wait(32000L);
                        }
                    }
                } catch (InterruptedException e3) {
                    StringBuilder sbF = g.a.a.a.a.F("Sleeping interrupted : ");
                    sbF.append(e3.toString());
                    i.D0(sbF.toString());
                    this.M = 259;
                }
                if (this.M == 0) {
                    if (!this.f5603u) {
                        i.W3("wait for connect, but can not connect with no callback");
                        i4 = 260;
                    } else if (this.f5605w != 515) {
                        StringBuilder sbF2 = g.a.a.a.a.F("connect with some error, please check. mConnectionState");
                        sbF2.append(this.f5605w);
                        i.W3(sbF2.toString());
                        i4 = 264;
                    }
                    this.M = i4;
                }
                if (this.M == 0) {
                    i.V3(this.f5594f, "connected the device which going to upgrade");
                } else if (this.f5605w == 256) {
                    B(0);
                }
                i3 = this.M;
            }
            if (i3 == 0) {
                return 0;
            }
            if ((i3 & (-2049)) != 133) {
                a0();
            } else if (this.f5594f) {
                i.w0("connect fail with GATT_ERROR, do not need disconnect");
            }
            B(1280);
            try {
                Thread.sleep(1600L);
            } catch (InterruptedException e4) {
                e4.printStackTrace();
            }
            i5++;
            if (i5 > i2) {
                return i3;
            }
        }
        return InvokeCmd.CMD_EXTENDDISPLAY_CTRL_GET_DISPLAY_EDID_INFO;
    }

    public final void U(int i2, boolean z2) {
        if (this.f5600r) {
            i2 = 4128;
        }
        if (i2 != 4128) {
            z(260, true);
        }
        if (this.f5594f) {
            i.w0(String.format("error = 0x%04X", Integer.valueOf(i2)));
        }
        if (z2) {
            d0();
        }
        g.i.a.b.e.h.a aVar = this.m0;
        if (aVar != null) {
            aVar.l();
        }
        if (r().f(1)) {
            X(i2);
        }
        k(this.G);
        g.i.a.c.m.a.b bVar = this.f5598p;
        if (bVar != null) {
            bVar.a(i2);
        }
        this.f5600r = true;
    }

    /* JADX WARN: Removed duplicated region for block: B:19:0x0045  */
    /* JADX WARN: Removed duplicated region for block: B:21:0x004b  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final boolean V(byte[] r8) throws g.i.a.c.g.c {
        /*
            r7 = this;
            r0 = 524(0x20c, float:7.34E-43)
            r1 = 1
            r7.z(r0, r1)
            r0 = 4128(0x1020, float:5.785E-42)
            r2 = 0
            boolean r3 = r7.f5594f     // Catch: g.i.a.c.a -> L26
            r4 = 1542(0x606, float:2.161E-42)
            if (r3 == 0) goto L20
            java.lang.String r3 = "<< CMD_OTA_ACTIVE_RESET(0x%04X)"
            java.lang.Object[] r5 = new java.lang.Object[r1]     // Catch: g.i.a.c.a -> L26
            java.lang.Short r6 = java.lang.Short.valueOf(r4)     // Catch: g.i.a.c.a -> L26
            r5[r2] = r6     // Catch: g.i.a.c.a -> L26
            java.lang.String r3 = java.lang.String.format(r3, r5)     // Catch: g.i.a.c.a -> L26
            g.h.a.i.w0(r3)     // Catch: g.i.a.c.a -> L26
        L20:
            boolean r1 = r7.L(r4, r8)     // Catch: g.i.a.c.a -> L26
        L24:
            r0 = r2
            goto L43
        L26:
            r8 = move-exception
            int r3 = r8.f5446m
            if (r3 != r0) goto L2d
        L2b:
            r1 = r2
            goto L43
        L2d:
            g.i.a.c.q.f r0 = r7.r()
            boolean r0 = r0.f5709z
            if (r0 != 0) goto L3b
            java.lang.String r8 = "active cmd has no response, ignore"
            g.h.a.i.w0(r8)
            goto L24
        L3b:
            java.lang.String r0 = "active cmd has no response, notify error"
            g.h.a.i.W3(r0)
            int r0 = r8.f5446m
            goto L2b
        L43:
            if (r1 == 0) goto L4b
            java.lang.String r8 = "image active success"
            g.h.a.i.w0(r8)
            return r1
        L4b:
            g.i.a.c.g.c r8 = new g.i.a.c.g.c
            r8.<init>(r0)
            throw r8
        */
        throw new UnsupportedOperationException("Method not decompiled: g.i.a.c.y.b.V(byte[]):boolean");
    }

    /* JADX WARN: Removed duplicated region for block: B:14:0x0028 A[PHI: r2
      0x0028: PHI (r2v1 short) = (r2v0 short), (r2v4 short) binds: [B:3:0x0008, B:5:0x000c] A[DONT_GENERATE, DONT_INLINE]] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final byte[] W(short r5) throws g.i.a.c.g.c {
        /*
            r4 = this;
            r0 = 0
            r4.M = r0
            r1 = 0
            r4.f5608z = r1
            r2 = 1536(0x600, float:2.152E-42)
            if (r5 == r2) goto L28
            r2 = 1537(0x601, float:2.154E-42)
            if (r5 == r2) goto L28
            r2 = 1546(0x60a, float:2.166E-42)
            if (r5 == r2) goto L1c
            r2 = 1547(0x60b, float:2.168E-42)
            if (r5 == r2) goto L17
            goto L31
        L17:
            java.util.Set<java.lang.Short> r2 = r4.r0
            r3 = 1545(0x609, float:2.165E-42)
            goto L20
        L1c:
            java.util.Set<java.lang.Short> r2 = r4.r0
            r3 = 1544(0x608, float:2.164E-42)
        L20:
            java.lang.Short r3 = java.lang.Short.valueOf(r3)
            r2.add(r3)
            goto L31
        L28:
            java.util.Set<java.lang.Short> r3 = r4.r0
            java.lang.Short r2 = java.lang.Short.valueOf(r2)
            r3.add(r2)
        L31:
            r4.f5607y = r0
            g.i.a.a.a.a.c r0 = r4.b0()
            boolean r5 = r0.j(r5, r1)
            if (r5 != 0) goto L3e
            return r1
        L3e:
            java.lang.Object r5 = r4.f5606x
            monitor-enter(r5)
            int r0 = r4.M     // Catch: java.lang.Throwable -> L57 java.lang.InterruptedException -> L59
            if (r0 != 0) goto L72
            boolean r0 = r4.f5607y     // Catch: java.lang.Throwable -> L57 java.lang.InterruptedException -> L59
            if (r0 != 0) goto L72
            int r0 = r4.f5605w     // Catch: java.lang.Throwable -> L57 java.lang.InterruptedException -> L59
            r1 = 515(0x203, float:7.22E-43)
            if (r0 != r1) goto L72
            java.lang.Object r0 = r4.f5606x     // Catch: java.lang.Throwable -> L57 java.lang.InterruptedException -> L59
            r1 = 15000(0x3a98, double:7.411E-320)
            r0.wait(r1)     // Catch: java.lang.Throwable -> L57 java.lang.InterruptedException -> L59
            goto L72
        L57:
            r0 = move-exception
            goto L97
        L59:
            r0 = move-exception
            java.lang.StringBuilder r1 = new java.lang.StringBuilder     // Catch: java.lang.Throwable -> L57
            r1.<init>()     // Catch: java.lang.Throwable -> L57
            java.lang.String r2 = "mCharacteristicReadCalledLock Sleeping interrupted,e:"
            r1.append(r2)     // Catch: java.lang.Throwable -> L57
            r1.append(r0)     // Catch: java.lang.Throwable -> L57
            java.lang.String r0 = r1.toString()     // Catch: java.lang.Throwable -> L57
            g.h.a.i.D0(r0)     // Catch: java.lang.Throwable -> L57
            r0 = 259(0x103, float:3.63E-43)
            r4.M = r0     // Catch: java.lang.Throwable -> L57
        L72:
            monitor-exit(r5)     // Catch: java.lang.Throwable -> L57
            int r5 = r4.M
            if (r5 != 0) goto L86
            boolean r5 = r4.f5607y
            if (r5 != 0) goto L86
            boolean r5 = r4.f5594f
            java.lang.String r0 = "read value but no callback"
            g.h.a.i.x0(r5, r0)
            r5 = 261(0x105, float:3.66E-43)
            r4.M = r5
        L86:
            int r5 = r4.M
            if (r5 != 0) goto L8d
            byte[] r5 = r4.f5608z
            return r5
        L8d:
            g.i.a.c.g.c r5 = new g.i.a.c.g.c
            int r0 = r4.M
            java.lang.String r1 = "Error while send command"
            r5.<init>(r1, r0)
            throw r5
        L97:
            monitor-exit(r5)     // Catch: java.lang.Throwable -> L57
            throw r0
        */
        throw new UnsupportedOperationException("Method not decompiled: g.i.a.c.y.b.W(short):byte[]");
    }

    public final void X(int i2) {
        int i3 = this.f5605w;
        if (i3 != 0 && i3 != 1280) {
            a0();
        }
        b0().d();
        b0().k(this.u0);
        B(1280);
        if (this.f5594f) {
            i.w0(String.format("terminateConnection, error = 0x%04X", Integer.valueOf(i2)));
        }
    }

    public final void Y() {
        if (V(null)) {
            if (t().f5686v) {
                i.U3("RWS, no need to disconnect manully");
            } else {
                if (m()) {
                    D();
                } else {
                    i.w0("device already disconnected");
                }
                X(0);
            }
            k(this.G);
        }
    }

    public final boolean Z() throws c {
        String str = this.O;
        if (this.f5600r) {
            throw new c("user aborted", InvokeCmd.CMD_EXTENDDISPLAY_CTRL_GET_DISPLAY_EDID_INFO);
        }
        z(InvokeCmd.CMD_XBUG_VMAN_FUNTION_CHECK_TIMEOUT_BASE_SET, true);
        int iT = T(str, r().M);
        if (iT != 0) {
            if (iT == 4128) {
                throw new c("aborted, connectRemoteDevice failed", iT);
            }
            i.w0("connect failed:" + iT);
            g.i.a.b.e.h.e eVar = new g.i.a.b.e.h.e(32);
            eVar.f5394s = 31000L;
            F(eVar);
            int iT2 = T(str, r().M);
            if (iT2 != 0) {
                if (iT2 == 4128) {
                    throw new c("aborted, connectRemoteDevice failed", iT2);
                }
                throw new c("connectRemoteDevice failed", iT2);
            }
        }
        if (this.f5601s) {
            J();
        } else {
            this.f5601s = false;
            if (!this.f5600r) {
                z(InvokeCmd.CMD_XBUG_VMAN_FUNTION_CHECK_TIMEOUT_BASE_GET, true);
                try {
                    Thread.sleep(1500L);
                } catch (InterruptedException e2) {
                    e2.printStackTrace();
                }
                this.W = new g.i.a.c.q.i(this.f5596n, 2);
                i.x0(this.f5594f, String.format("<< CMD_OTA_GET_DEVICE_INFO (0x%04X)", (short) 1536));
                byte[] bArrW = W((short) 1536);
                if (bArrW == null) {
                    throw g.a.a.a.a.x0("Get dev info failed", "get remote dev info failed", 270);
                }
                i.U3(i.y(bArrW));
                t().s(bArrW, 0);
                b(t().B);
                if (this.f5594f) {
                    i.w0(t().toString());
                }
                if (t().f5686v) {
                    i.x0(this.f5594f, String.format("<< CMD_OTA_GET_OTHER_INFO (0x%04X)", (short) 1547));
                    byte[] bArrW2 = W((short) 1547);
                    if (bArrW2 == null || bArrW2.length <= 0) {
                        t().f5688x = 0;
                    } else {
                        t().f5688x = bArrW2[0] & 1;
                    }
                    if (t().f5688x != 0) {
                        throw new c("rws state not ready", 282);
                    }
                }
                i.x0(this.f5594f, String.format("<< CMD_OTA_GET_IMAGE_INFO (0x%04X)", (short) 1537));
                byte[] bArrW3 = W((short) 1537);
                g.i.a.c.q.i iVarT = t();
                iVarT.P = bArrW3;
                iVarT.i();
                if (this.f5594f) {
                    i.w0(t().toString());
                }
                K();
                List<g.i.a.c.l.e.a> list = this.F;
                if (list != null && list.size() > 0) {
                    Iterator<g.i.a.c.l.e.a> it = this.F.iterator();
                    while (it.hasNext()) {
                        int i2 = it.next().f5573x;
                    }
                }
                this.f5601s = true;
                i.w0("Ota Environment prepared.");
            } else {
                U(InvokeCmd.CMD_EXTENDDISPLAY_CTRL_GET_DISPLAY_EDID_INFO, false);
            }
        }
        if (this.G != null) {
            return true;
        }
        U(4097, false);
        return false;
    }

    public final void a0() {
        int i2 = this.f5605w;
        if (i2 != 0 && i2 != 1280) {
            b0().d();
            D();
        } else if (this.f5594f) {
            i.w0("already disconnect");
        }
    }

    public final g.i.a.a.a.a.c b0() {
        if (this.t0 == null) {
            g.i.a.a.a.a.c cVarF = g.i.a.a.a.a.c.f();
            this.t0 = cVarF;
            cVarF.h(this.u0);
        }
        return this.t0;
    }

    public boolean c0() {
        g.i.a.c.l.e.a aVar;
        boolean z2 = false;
        while (!this.f5600r) {
            try {
            } catch (g.i.a.c.a e2) {
                g.a.a.a.a.R(this.E, new StringBuilder(), ", ", e2);
                int i2 = e2.f5446m;
                if (i2 == 4128) {
                    U(i2, true);
                } else if (i2 == 4097) {
                    U(i2, false);
                } else {
                    d0();
                    U(i2, false);
                }
            }
            if (!Z() || !S()) {
                return false;
            }
            this.J += s().f5711m;
            if (s().p()) {
                i.w0("no pendding image file to upload.");
                s().f5721w = this.J;
                z2 = true;
            } else {
                i.w0("has pendding image file to upload");
                if (t().M == 1) {
                    this.O = this.P;
                    this.f5602t = true;
                    this.J = 0;
                    Y();
                } else if (t().M == 3 && (aVar = this.H) != null) {
                    int i3 = this.J;
                    int i4 = t().C * 4096;
                    i.V3(this.f5594f, String.format(Locale.US, "nextBinSize=%d, mBytesSentBuffer=%d, bufferSize=%d", Integer.valueOf(aVar.h()), Integer.valueOf(i3), Integer.valueOf(i4)));
                    if (aVar.h() + i3 > i4) {
                        i.w0("make device to enter the ota advertiser mode, and let the app continue update imae");
                        this.f5602t = true;
                        this.J = 0;
                        if (V(new byte[]{1})) {
                            if (t().f5686v) {
                                i.U3("RWS, no need to disconnect manully");
                            } else {
                                if (m()) {
                                    D();
                                } else {
                                    i.w0("device already disconnected");
                                }
                                X(0);
                            }
                            k(this.G);
                        }
                    }
                }
                c(DfuServiceInitiator.DEFAULT_SCAN_TIMEOUT);
            }
            try {
                Thread.sleep(1000L);
            } catch (InterruptedException e3) {
                e3.printStackTrace();
            }
            if (z2) {
                return z2;
            }
        }
        U(InvokeCmd.CMD_EXTENDDISPLAY_CTRL_GET_DISPLAY_EDID_INFO, false);
        return false;
    }

    public final boolean d0() {
        try {
            i.x0(this.f5594f, String.format("<< CMD_OTA_RESET (0x%04X)", (short) 1541));
            return L((short) 1541, null);
        } catch (g.i.a.c.a e2) {
            i.W3(String.format("Send OPCODE_DFU_RESET_SYSTEM failed, ignore it, errorcode= 0x%04X", Integer.valueOf(e2.f5446m)));
            this.M = 0;
            return false;
        }
    }

    @Override // g.i.a.c.m.a.a
    public boolean f(boolean z2) {
        if (!super.f(z2)) {
            return false;
        }
        if (this.f5605w != 515) {
            if (this.f5594f) {
                g.a.a.a.a.m0(g.a.a.a.a.F("start to re-connect the RCU which going to active image, current state is: "), this.f5605w);
            }
            int iT = T(this.O, r().M);
            if (iT != 0) {
                StringBuilder sbG = g.a.a.a.a.G("Something error in OTA process, errorCode: ", iT, "mProcessState");
                sbG.append(this.E);
                i.D0(sbG.toString());
                U(iT, true);
                return false;
            }
        }
        if (z2) {
            try {
                Y();
                if (r().d(1)) {
                    g.i.a.b.e.b.a.c(this.i0.getRemoteDevice(this.O));
                    g.i.a.b.e.b.a.d(this.O);
                }
                z(Bzip2Constants.HUFFMAN_MAX_ALPHABET_SIZE, true);
            } catch (g.i.a.c.a e2) {
                e2.printStackTrace();
                U(e2.f5446m, false);
            }
        } else {
            d0();
            U(274, true);
        }
        return true;
    }

    @Override // g.i.a.c.m.a.a
    public void o() {
        int iV;
        try {
            setName("ProcessorXS0000");
            i.w0("ProcessorXS0000 running.");
            iV = v();
        } catch (Exception e2) {
            e2.printStackTrace();
            i.D0(e2.toString());
            U(0, false);
        }
        if (iV != 0) {
            U(iV, false);
            return;
        }
        z(InvokeCmd.CMD_XBUG_GET_VMAN_SERVICE_LOG_LEVEL, true);
        this.O = this.P;
        this.f5602t = true;
        this.J = 0;
        if (c0()) {
            if (t().f5686v) {
                Y();
                z(522, true);
                this.f5602t = true;
                this.f5601s = false;
                this.J = 0;
                i.x0(this.f5594f, "wait master to handover ...");
                try {
                    Thread.sleep(((long) r().f5692b0) * 1000);
                } catch (InterruptedException unused) {
                }
                if (c0()) {
                    if (this.T) {
                        Y();
                        if (r().d(1)) {
                            g.i.a.b.e.b.a.c(this.i0.getRemoteDevice(this.O));
                            g.i.a.b.e.b.a.d(this.O);
                        }
                        z(Bzip2Constants.HUFFMAN_MAX_ALPHABET_SIZE, true);
                    }
                    z(523, true);
                }
            } else if (this.T) {
                Y();
                if (r().d(1)) {
                    g.i.a.b.e.b.a.c(this.i0.getRemoteDevice(this.O));
                    g.i.a.b.e.b.a.d(this.O);
                }
                z(Bzip2Constants.HUFFMAN_MAX_ALPHABET_SIZE, true);
            } else {
                z(523, true);
            }
        }
        k(this.G);
        if (this.f5594f) {
            i.w0("DfuThread stopped");
        }
        g.i.a.a.a.a.c cVar = this.t0;
        if (cVar != null) {
            cVar.k(this.u0);
        }
        if (this.E == 525) {
            z(259, true);
        }
    }
}
