package g.i.a.c.t;

import android.content.Context;
import com.cvte.vman.instance.InvokeCmd;
import g.h.a.i;
import io.netty.handler.codec.compression.Bzip2Constants;

/* JADX INFO: loaded from: classes.dex */
public final class f extends e {
    public f(Context context, g.i.a.c.q.f fVar, g.i.a.c.m.a.b bVar) {
        super(context, fVar, bVar);
    }

    /* JADX WARN: Removed duplicated region for block: B:44:0x0178  */
    /* JADX WARN: Removed duplicated region for block: B:47:0x0197  */
    /* JADX WARN: Removed duplicated region for block: B:50:0x01a6  */
    /* JADX WARN: Removed duplicated region for block: B:51:0x01ac  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final boolean A0() throws g.i.a.c.g.c {
        /*
            Method dump skipped, instruction units count: 499
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: g.i.a.c.t.f.A0():boolean");
    }

    public final void B0(String str) throws g.i.a.c.g.c {
        if (this.f5600r) {
            throw new g.i.a.c.g.c("user aborted", InvokeCmd.CMD_EXTENDDISPLAY_CTRL_GET_DISPLAY_EDID_INFO);
        }
        z(520, true);
        int iH0 = h0(str, r().M);
        if (iH0 == 0) {
            return;
        }
        if (iH0 != 4128) {
            throw new g.i.a.c.g.c("connectOtaRemoteDevice failed", iH0);
        }
        throw new g.i.a.c.g.c("aborted, connectRemoteDevice failed", iH0);
    }

    @Override // g.i.a.c.m.a.a
    public boolean f(boolean z2) {
        if (!super.f(z2)) {
            return false;
        }
        if (this.f5605w != 515) {
            boolean z3 = this.f5594f;
            StringBuilder sbF = g.a.a.a.a.F("start to re-connect the RCU which going to active image, current state is: ");
            sbF.append(this.f5605w);
            i.x0(z3, sbF.toString());
            int iH0 = h0(this.O, r().M);
            if (iH0 != 0) {
                i.D0(String.format("Something error in OTA process, errorCode: 0x%04X, mProcessState=0x%04X", Integer.valueOf(iH0), Integer.valueOf(this.E)));
                k0(iH0, true);
                return false;
            }
        }
        if (z2) {
            try {
                q0();
                z(Bzip2Constants.HUFFMAN_MAX_ALPHABET_SIZE, true);
            } catch (g.i.a.c.a e2) {
                e2.printStackTrace();
                k0(e2.f5446m, false);
            }
        } else {
            if (w0()) {
                D();
            }
            k0(274, false);
        }
        return true;
    }

    @Override // g.i.a.c.m.a.a
    public void o() {
        int iV;
        try {
            setName("ProcessorXG0010N");
            i.w0("ProcessorXG0010N running.");
            iV = v();
        } catch (Exception e2) {
            e2.printStackTrace();
            i.D0(e2.toString());
            k0(0, false);
        }
        if (iV != 0) {
            k0(iV, false);
            return;
        }
        z(InvokeCmd.CMD_XBUG_GET_VMAN_SERVICE_LOG_LEVEL, true);
        this.O = this.P;
        this.f5602t = false;
        y0();
        k(this.G);
        i.x0(this.f5594f, "ProcessorXG0010N stopped");
        if (this.E == 525) {
            z(259, true);
        }
    }

    /* JADX WARN: Code restructure failed: missing block: B:18:0x0067, code lost:
    
        if (r22.G == null) goto L19;
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final boolean x0() throws g.i.a.c.g.b, g.i.a.c.g.c {
        /*
            Method dump skipped, instruction units count: 443
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: g.i.a.c.t.f.x0():boolean");
    }

    /* JADX WARN: Can't wrap try/catch for region: R(7:13|(3:15|(1:17)(1:18)|19)(3:20|(1:22)(4:23|(1:41)(4:27|28|(3:30|(2:35|(1:37)(1:39))(1:33)|34)(0)|66)|40|43)|38)|44|69|45|76|(2:74|66)(1:77)) */
    /* JADX WARN: Code restructure failed: missing block: B:47:0x00f2, code lost:
    
        r2 = move-exception;
     */
    /* JADX WARN: Code restructure failed: missing block: B:48:0x00f3, code lost:
    
        r2.printStackTrace();
     */
    /* JADX WARN: Removed duplicated region for block: B:35:0x00af A[Catch: a -> 0x00f9, TryCatch #0 {a -> 0x00f9, blocks: (B:7:0x000e, B:10:0x0015, B:13:0x001c, B:15:0x0031, B:19:0x0053, B:18:0x004e, B:20:0x0059, B:22:0x0068, B:38:0x00d4, B:23:0x007d, B:25:0x0086, B:27:0x008a, B:30:0x0091, B:33:0x0099, B:34:0x00ab, B:35:0x00af, B:37:0x00c1, B:39:0x00d8, B:40:0x00dc, B:43:0x00e9, B:41:0x00df, B:42:0x00e4), top: B:67:0x000e }] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final boolean y0() {
        /*
            Method dump skipped, instruction units count: 296
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: g.i.a.c.t.f.y0():boolean");
    }

    public final void z0() throws g.i.a.c.g.b {
        this.f5601s = false;
        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(20, 2);
        s0();
        t0();
        r0();
        u0();
        if (this.f5594f) {
            i.w0(t().toString());
        }
        K();
        this.f5601s = true;
        i.w0("Ota Environment prepared.");
    }
}
